From d8c8ffdeaa16ea1fe16b844dac93fef74ff605a4 Mon Sep 17 00:00:00 2001 From: George Fu Date: Wed, 28 Oct 2026 18:07:59 +0000 Subject: [PATCH] Adopt smithy-python sync renames and regenerate clients --- .gitignore | 3 + Makefile | 42 +- .../scripts/docs/generate_doc_stubs.py | 76 +- .../aws_sdk_api_gateway/_private/schemas.py | 17480 ++- .../src/aws_sdk_api_gateway/client.py | 516 +- .../src/aws_sdk_api_gateway/config.py | 915 +- .../src/aws_sdk_api_gateway/models.py | 38829 +------ .../src/aws_sdk_api_gateway/models.pyi | 9025 ++ .../scripts/docs/generate_doc_stubs.py | 76 +- .../_private/schemas.py | 14534 ++- .../aws_sdk_bedrock_agent_runtime/client.py | 162 +- .../aws_sdk_bedrock_agent_runtime/config.py | 319 +- .../aws_sdk_bedrock_agent_runtime/models.py | 38352 +------ .../aws_sdk_bedrock_agent_runtime/models.pyi | 9032 ++ .../scripts/docs/generate_doc_stubs.py | 76 +- .../aws_sdk_bedrock_agent/_private/schemas.py | 19583 ++-- .../src/aws_sdk_bedrock_agent/client.py | 336 +- .../src/aws_sdk_bedrock_agent/config.py | 627 +- .../src/aws_sdk_bedrock_agent/models.py | 44350 +------- .../src/aws_sdk_bedrock_agent/models.pyi | 9885 ++ .../scripts/docs/generate_doc_stubs.py | 76 +- .../_private/schemas.py | 37762 +++---- .../client.py | 704 +- .../config.py | 1367 +- .../models.py | 91205 +--------------- .../models.pyi | 19434 ++++ .../scripts/docs/generate_doc_stubs.py | 76 +- .../_private/schemas.py | 18595 ++-- .../src/aws_sdk_bedrock_agentcore/client.py | 292 +- .../src/aws_sdk_bedrock_agentcore/config.py | 585 +- .../src/aws_sdk_bedrock_agentcore/models.py | 44261 +------- .../src/aws_sdk_bedrock_agentcore/models.pyi | 9419 ++ .../scripts/docs/generate_doc_stubs.py | 76 +- .../_private/schemas.py | 1582 +- .../client.py | 44 +- .../config.py | 128 +- .../models.py | 2492 +- .../models.pyi | 472 + .../scripts/docs/generate_doc_stubs.py | 76 +- .../_private/schemas.py | 6254 +- .../aws_sdk_bedrock_data_automation/client.py | 128 +- .../aws_sdk_bedrock_data_automation/config.py | 353 +- .../aws_sdk_bedrock_data_automation/models.py | 12261 +-- .../models.pyi | 2082 + .../scripts/docs/generate_doc_stubs.py | 76 +- .../_private/schemas.py | 7809 +- .../src/aws_sdk_bedrock_runtime/client.py | 66 +- .../src/aws_sdk_bedrock_runtime/config.py | 164 +- .../src/aws_sdk_bedrock_runtime/models.py | 19542 +--- .../src/aws_sdk_bedrock_runtime/models.pyi | 4839 + .../tests/integration/__init__.py | 10 +- .../test_bidirectional_streaming.py | 8 +- .../scripts/docs/generate_doc_stubs.py | 76 +- .../src/aws_sdk_bedrock/_private/schemas.py | 23626 ++-- .../src/aws_sdk_bedrock/client.py | 452 +- .../src/aws_sdk_bedrock/config.py | 1131 +- .../src/aws_sdk_bedrock/models.py | 56204 +--------- .../src/aws_sdk_bedrock/models.pyi | 12017 ++ .../scripts/docs/generate_doc_stubs.py | 76 +- .../aws_sdk_cloudtrail/_private/schemas.py | 9856 +- .../src/aws_sdk_cloudtrail/client.py | 260 +- .../src/aws_sdk_cloudtrail/config.py | 477 +- .../src/aws_sdk_cloudtrail/models.py | 25174 +---- .../src/aws_sdk_cloudtrail/models.pyi | 5970 + .../scripts/docs/generate_doc_stubs.py | 76 +- .../_private/schemas.py | 3240 +- .../src/aws_sdk_cognito_identity/client.py | 112 +- .../src/aws_sdk_cognito_identity/config.py | 258 +- .../src/aws_sdk_cognito_identity/models.py | 6825 +- .../src/aws_sdk_cognito_identity/models.pyi | 1289 + .../scripts/docs/generate_doc_stubs.py | 76 +- .../aws_sdk_connecthealth/_private/schemas.py | 3398 +- .../src/aws_sdk_connecthealth/client.py | 86 +- .../src/aws_sdk_connecthealth/config.py | 201 +- .../src/aws_sdk_connecthealth/models.py | 6683 +- .../src/aws_sdk_connecthealth/models.pyi | 1246 + .../tests/integration/__init__.py | 10 +- .../tests/integration/conftest.py | 4 +- .../test_bidirectional_streaming.py | 10 +- .../tests/integration/test_non_streaming.py | 10 +- .../scripts/docs/generate_doc_stubs.py | 76 +- .../src/aws_sdk_dynamodb/_private/schemas.py | 12038 +- .../src/aws_sdk_dynamodb/client.py | 252 +- .../src/aws_sdk_dynamodb/config.py | 513 +- .../src/aws_sdk_dynamodb/models.py | 33609 +----- .../src/aws_sdk_dynamodb/models.pyi | 9942 ++ .../src/aws_sdk_dynamodb/retries.py | 16 +- .../scripts/docs/generate_doc_stubs.py | 76 +- .../src/aws_sdk_guardduty/_private/schemas.py | 27204 ++--- .../src/aws_sdk_guardduty/client.py | 428 +- .../src/aws_sdk_guardduty/config.py | 901 +- .../src/aws_sdk_guardduty/models.py | 49760 +-------- .../src/aws_sdk_guardduty/models.pyi | 12815 +++ .../scripts/docs/generate_doc_stubs.py | 76 +- .../src/aws_sdk_lambda/_private/schemas.py | 17596 +-- .../src/aws_sdk_lambda/client.py | 374 +- .../src/aws_sdk_lambda/config.py | 841 +- .../src/aws_sdk_lambda/models.py | 43331 +------- .../src/aws_sdk_lambda/models.pyi | 10770 ++ .../scripts/docs/generate_doc_stubs.py | 76 +- .../_private/schemas.py | 3151 +- .../src/aws_sdk_lex_runtime_v2/client.py | 46 +- .../src/aws_sdk_lex_runtime_v2/config.py | 122 +- .../src/aws_sdk_lex_runtime_v2/models.py | 5894 +- .../src/aws_sdk_lex_runtime_v2/models.pyi | 1671 + .../tests/integration/__init__.py | 10 +- .../tests/integration/conftest.py | 6 +- .../test_bidirectional_streaming.py | 6 +- .../examples/stream_speech_to_file.py | 13 +- .../examples/stream_speech_to_speakers.py | 13 +- .../scripts/docs/generate_doc_stubs.py | 76 +- .../src/aws_sdk_polly/_private/schemas.py | 3409 +- .../aws-sdk-polly/src/aws_sdk_polly/client.py | 62 +- .../aws-sdk-polly/src/aws_sdk_polly/config.py | 163 +- .../aws-sdk-polly/src/aws_sdk_polly/models.py | 5140 +- .../src/aws_sdk_polly/models.pyi | 1439 + .../tests/integration/__init__.py | 10 +- .../test_bidirectional_streaming.py | 13 +- .../scripts/docs/generate_doc_stubs.py | 76 +- .../src/aws_sdk_qbusiness/_private/schemas.py | 15555 ++- .../src/aws_sdk_qbusiness/client.py | 354 +- .../src/aws_sdk_qbusiness/config.py | 651 +- .../src/aws_sdk_qbusiness/models.py | 35024 +----- .../src/aws_sdk_qbusiness/models.pyi | 7941 ++ .../tests/integration/__init__.py | 10 +- .../tests/integration/conftest.py | 17 +- .../test_bidirectional_streaming.py | 6 +- .../scripts/docs/generate_doc_stubs.py | 76 +- .../_private/schemas.py | 1134 +- .../aws_sdk_sagemaker_runtime_http2/client.py | 18 +- .../aws_sdk_sagemaker_runtime_http2/config.py | 96 +- .../aws_sdk_sagemaker_runtime_http2/models.py | 981 +- .../models.pyi | 246 + .../scripts/docs/generate_doc_stubs.py | 76 +- .../_private/schemas.py | 3626 +- .../src/aws_sdk_secrets_manager/client.py | 112 +- .../src/aws_sdk_secrets_manager/config.py | 250 +- .../src/aws_sdk_secrets_manager/models.py | 8020 +- .../src/aws_sdk_secrets_manager/models.pyi | 2193 + .../scripts/docs/generate_doc_stubs.py | 76 +- .../src/aws_sdk_signin/_private/schemas.py | 3101 +- .../src/aws_sdk_signin/client.py | 64 +- .../src/aws_sdk_signin/config.py | 204 +- .../src/aws_sdk_signin/models.py | 3429 +- .../src/aws_sdk_signin/models.pyi | 735 + .../scripts/docs/generate_doc_stubs.py | 76 +- .../src/aws_sdk_sns/_private/schemas.py | 5054 +- clients/aws-sdk-sns/src/aws_sdk_sns/client.py | 188 +- clients/aws-sdk-sns/src/aws_sdk_sns/config.py | 428 +- clients/aws-sdk-sns/src/aws_sdk_sns/models.py | 11011 +- .../aws-sdk-sns/src/aws_sdk_sns/models.pyi | 3183 + .../scripts/docs/generate_doc_stubs.py | 76 +- .../src/aws_sdk_sqs/_private/schemas.py | 4200 +- clients/aws-sdk-sqs/src/aws_sdk_sqs/client.py | 112 +- clients/aws-sdk-sqs/src/aws_sdk_sqs/config.py | 238 +- clients/aws-sdk-sqs/src/aws_sdk_sqs/models.py | 8275 +- .../aws-sdk-sqs/src/aws_sdk_sqs/models.pyi | 2699 + .../scripts/docs/generate_doc_stubs.py | 76 +- .../src/aws_sdk_sts/_private/schemas.py | 2805 +- clients/aws-sdk-sts/src/aws_sdk_sts/client.py | 64 +- clients/aws-sdk-sts/src/aws_sdk_sts/config.py | 162 +- clients/aws-sdk-sts/src/aws_sdk_sts/models.py | 4714 +- .../aws-sdk-sts/src/aws_sdk_sts/models.pyi | 1818 + .../examples/simple_file.py | 15 +- .../examples/simple_mic.py | 13 +- .../scripts/docs/generate_doc_stubs.py | 76 +- .../_private/schemas.py | 4822 +- .../aws_sdk_transcribe_streaming/client.py | 39 +- .../aws_sdk_transcribe_streaming/config.py | 141 +- .../aws_sdk_transcribe_streaming/models.py | 9872 +- .../aws_sdk_transcribe_streaming/models.pyi | 3087 + .../tests/integration/__init__.py | 10 +- .../tests/integration/conftest.py | 6 +- .../test_bidirectional_streaming.py | 6 +- ...king-a9562a726ae64d78bdd06d9c9deb5930.json | 4 + packages/aws-credentials-http/README.md | 4 +- packages/aws-credentials-http/pyproject.toml | 14 +- .../src/aws_credentials_http/__init__.py | 8 - .../src/aws_credentials_http/aio/__init__.py | 9 + .../aws_credentials_http/{ => aio}/client.py | 4 +- .../{ => aio}/providers.py | 2 +- .../{ => aio}/resolvers.py | 8 +- .../tests/unit/__init__.py | 2 + .../tests/unit/aio/__init__.py | 2 + .../tests/unit/{ => aio}/test_client.py | 4 +- .../tests/unit/{ => aio}/test_providers.py | 4 +- .../tests/unit/{ => aio}/test_resolvers.py | 2 +- ...king-0571d5ffdf914f739c35123e288e4c2b.json | 4 + packages/aws-credentials-imds/README.md | 6 +- packages/aws-credentials-imds/pyproject.toml | 14 +- .../src/aws_credentials_imds/__init__.py | 11 +- .../src/aws_credentials_imds/aio/__init__.py | 11 + .../src/aws_credentials_imds/aio/client.py | 166 + .../{ => aio}/providers.py | 5 +- .../{ => aio}/resolvers.py | 10 +- .../src/aws_credentials_imds/client.py | 163 +- .../tests/unit/__init__.py | 2 + .../tests/unit/aio/__init__.py | 2 + .../tests/unit/aio/test_client.py | 168 + .../tests/unit/{ => aio}/test_providers.py | 6 +- .../tests/unit/{ => aio}/test_resolvers.py | 4 +- .../tests/unit/test_client.py | 165 +- ...king-f2941adc6fc748ceb6fe97f55492231c.json | 4 + packages/aws-credentials-sts/README.md | 18 +- packages/aws-credentials-sts/pyproject.toml | 14 +- .../src/aws_credentials_sts/__init__.py | 14 +- .../src/aws_credentials_sts/aio/__init__.py | 13 + .../{ => aio}/providers.py | 3 +- .../src/aws_credentials_sts/aio/resolvers.py | 341 + .../src/aws_credentials_sts/resolvers.py | 321 +- .../tests/unit/__init__.py | 2 + .../tests/unit/aio/__init__.py | 2 + .../tests/unit/{ => aio}/test_providers.py | 7 +- .../tests/unit/aio/test_resolvers.py | 763 + .../tests/unit/test_resolvers.py | 753 +- 215 files changed, 317878 insertions(+), 719755 deletions(-) create mode 100644 clients/aws-sdk-api-gateway/src/aws_sdk_api_gateway/models.pyi create mode 100644 clients/aws-sdk-bedrock-agent-runtime/src/aws_sdk_bedrock_agent_runtime/models.pyi create mode 100644 clients/aws-sdk-bedrock-agent/src/aws_sdk_bedrock_agent/models.pyi create mode 100644 clients/aws-sdk-bedrock-agentcore-control/src/aws_sdk_bedrock_agentcore_control/models.pyi create mode 100644 clients/aws-sdk-bedrock-agentcore/src/aws_sdk_bedrock_agentcore/models.pyi create mode 100644 clients/aws-sdk-bedrock-data-automation-runtime/src/aws_sdk_bedrock_data_automation_runtime/models.pyi create mode 100644 clients/aws-sdk-bedrock-data-automation/src/aws_sdk_bedrock_data_automation/models.pyi create mode 100644 clients/aws-sdk-bedrock-runtime/src/aws_sdk_bedrock_runtime/models.pyi create mode 100644 clients/aws-sdk-bedrock/src/aws_sdk_bedrock/models.pyi create mode 100644 clients/aws-sdk-cloudtrail/src/aws_sdk_cloudtrail/models.pyi create mode 100644 clients/aws-sdk-cognito-identity/src/aws_sdk_cognito_identity/models.pyi create mode 100644 clients/aws-sdk-connecthealth/src/aws_sdk_connecthealth/models.pyi create mode 100644 clients/aws-sdk-dynamodb/src/aws_sdk_dynamodb/models.pyi create mode 100644 clients/aws-sdk-guardduty/src/aws_sdk_guardduty/models.pyi create mode 100644 clients/aws-sdk-lambda/src/aws_sdk_lambda/models.pyi create mode 100644 clients/aws-sdk-lex-runtime-v2/src/aws_sdk_lex_runtime_v2/models.pyi create mode 100644 clients/aws-sdk-polly/src/aws_sdk_polly/models.pyi create mode 100644 clients/aws-sdk-qbusiness/src/aws_sdk_qbusiness/models.pyi create mode 100644 clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/models.pyi create mode 100644 clients/aws-sdk-secrets-manager/src/aws_sdk_secrets_manager/models.pyi create mode 100644 clients/aws-sdk-signin/src/aws_sdk_signin/models.pyi create mode 100644 clients/aws-sdk-sns/src/aws_sdk_sns/models.pyi create mode 100644 clients/aws-sdk-sqs/src/aws_sdk_sqs/models.pyi create mode 100644 clients/aws-sdk-sts/src/aws_sdk_sts/models.pyi create mode 100644 clients/aws-sdk-transcribe-streaming/src/aws_sdk_transcribe_streaming/models.pyi create mode 100644 packages/aws-credentials-http/.changes/next-release/aws-credentials-http-breaking-a9562a726ae64d78bdd06d9c9deb5930.json create mode 100644 packages/aws-credentials-http/src/aws_credentials_http/aio/__init__.py rename packages/aws-credentials-http/src/aws_credentials_http/{ => aio}/client.py (97%) rename packages/aws-credentials-http/src/aws_credentials_http/{ => aio}/providers.py (95%) rename packages/aws-credentials-http/src/aws_credentials_http/{ => aio}/resolvers.py (95%) create mode 100644 packages/aws-credentials-http/tests/unit/__init__.py create mode 100644 packages/aws-credentials-http/tests/unit/aio/__init__.py rename packages/aws-credentials-http/tests/unit/{ => aio}/test_client.py (96%) rename packages/aws-credentials-http/tests/unit/{ => aio}/test_providers.py (95%) rename packages/aws-credentials-http/tests/unit/{ => aio}/test_resolvers.py (99%) create mode 100644 packages/aws-credentials-imds/.changes/next-release/aws-credentials-imds-breaking-0571d5ffdf914f739c35123e288e4c2b.json create mode 100644 packages/aws-credentials-imds/src/aws_credentials_imds/aio/__init__.py create mode 100644 packages/aws-credentials-imds/src/aws_credentials_imds/aio/client.py rename packages/aws-credentials-imds/src/aws_credentials_imds/{ => aio}/providers.py (96%) rename packages/aws-credentials-imds/src/aws_credentials_imds/{ => aio}/resolvers.py (88%) create mode 100644 packages/aws-credentials-imds/tests/unit/__init__.py create mode 100644 packages/aws-credentials-imds/tests/unit/aio/__init__.py create mode 100644 packages/aws-credentials-imds/tests/unit/aio/test_client.py rename packages/aws-credentials-imds/tests/unit/{ => aio}/test_providers.py (97%) rename packages/aws-credentials-imds/tests/unit/{ => aio}/test_resolvers.py (97%) create mode 100644 packages/aws-credentials-sts/.changes/next-release/aws-credentials-sts-breaking-f2941adc6fc748ceb6fe97f55492231c.json create mode 100644 packages/aws-credentials-sts/src/aws_credentials_sts/aio/__init__.py rename packages/aws-credentials-sts/src/aws_credentials_sts/{ => aio}/providers.py (91%) create mode 100644 packages/aws-credentials-sts/src/aws_credentials_sts/aio/resolvers.py create mode 100644 packages/aws-credentials-sts/tests/unit/__init__.py create mode 100644 packages/aws-credentials-sts/tests/unit/aio/__init__.py rename packages/aws-credentials-sts/tests/unit/{ => aio}/test_providers.py (92%) create mode 100644 packages/aws-credentials-sts/tests/unit/aio/test_resolvers.py diff --git a/.gitignore b/.gitignore index 501acd30..8b540ef5 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,6 @@ dist/ # scratch workspace /workspace + +# IDE +.idea diff --git a/Makefile b/Makefile index 90c21ea0..0666240d 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,13 @@ PYTHON_VERSION := 3.12 # Colocated smithy-python checkout that provides the codegen jars. SMITHY_PYTHON ?= ../smithy-python -.PHONY: docs docs-serve docs-clean docs-install docs-lock venv gen publish-codegen +.PHONY: docs docs-serve docs-clean docs-install docs-lock venv gen publish-codegen dev-install test test-integration typecheck ruff + +# Each client and hand-written package is its own project with its own pytest +# and pyright config, so the check targets run them one at a time. +PROJECTS := $(patsubst %/pyproject.toml,%,$(wildcard clients/*/pyproject.toml packages/*/pyproject.toml)) +SMITHY_PACKAGES := aws-sdk-signers smithy-core smithy-json smithy-cbor smithy-xml smithy-aws-core smithy-aws-event-stream smithy-test +VENV_BIN := $(CURDIR)/.venv/bin # Publishes the smithy-python codegen jars to the local Maven cache so `gen` # can resolve them. Run once, and again whenever the generator changes. @@ -25,6 +31,40 @@ endif venv: uv venv --python $(PYTHON_VERSION) +# Installs every client and package against the colocated smithy-python +# checkout, so checks run against unreleased runtime changes. +dev-install: + @[ -d .venv ] || uv venv --python $(PYTHON_VERSION) + uv pip install --python $(VENV_BIN)/python \ + $(foreach p,$(SMITHY_PACKAGES),-e $(SMITHY_PYTHON)/packages/$(p)) \ + -e "$(SMITHY_PYTHON)/packages/smithy-http[aiohttp,awscrt]" \ + $(foreach p,$(PROJECTS),-e ./$(p)) \ + "pytest>=9.0.1,<10.0.0" "pytest-asyncio>=1.3.0,<1.4.0" \ + "boto3==1.43.120" "boto3-stubs[iam,lexv2-models,s3,sts]==1.43.120" \ + "pyright==1.1.406" "ruff==0.15.22" + +test: dev-install + @failed=; for t in $(wildcard packages/*/tests/unit); do \ + $(VENV_BIN)/python -m pytest -q $$t || failed="$$failed $$t"; \ + done; [ -z "$$failed" ] || { echo "unit tests failed in:$$failed"; exit 1; } + +# Requires AWS credentials for the accounts and regions the suites target. +test-integration: dev-install + @failed=; for p in $(PROJECTS); do \ + [ -d $$p/tests/integration ] || continue; \ + $(VENV_BIN)/python -m pytest -q $$p/tests/integration || failed="$$failed $$p"; \ + done; [ -z "$$failed" ] || { echo "integration tests failed in:$$failed"; exit 1; } + +typecheck: dev-install + @failed=; for p in $(PROJECTS); do \ + dirs=$$(cd $$p && ls -d src tests 2>/dev/null); [ -n "$$dirs" ] || continue; \ + (cd $$p && $(VENV_BIN)/pyright --pythonpath $(VENV_BIN)/python $$dirs) || failed="$$failed $$p"; \ + done; [ -z "$$failed" ] || { echo "typecheck failed in:$$failed"; exit 1; } + +ruff: dev-install + $(VENV_BIN)/ruff check clients packages + $(VENV_BIN)/ruff format --check clients packages + docs-lock: venv uv pip compile requirements-docs.in -o requirements-docs.txt diff --git a/clients/aws-sdk-api-gateway/scripts/docs/generate_doc_stubs.py b/clients/aws-sdk-api-gateway/scripts/docs/generate_doc_stubs.py index 52d470bc..795f2e4b 100644 --- a/clients/aws-sdk-api-gateway/scripts/docs/generate_doc_stubs.py +++ b/clients/aws-sdk-api-gateway/scripts/docs/generate_doc_stubs.py @@ -126,7 +126,9 @@ class ClientInfo: class DocStubGenerator: """Generate markdown API Reference stubs for AWS SDK for Python v4 clients.""" - def __init__(self, client_dir: Path, output_dir: Path, service_name: str | None = None) -> None: + def __init__( + self, client_dir: Path, output_dir: Path, service_name: str | None = None + ) -> None: """ Initialize the documentation generator. @@ -190,7 +192,9 @@ def _analyze_client_package(self, package_name: str) -> ClientInfo: required = ("client", "config", "models") missing = [name for name in required if not package.modules.get(name)] if missing: - raise ValueError(f"Missing required modules in {package_name}: {', '.join(missing)}") + raise ValueError( + f"Missing required modules in {package_name}: {', '.join(missing)}" + ) # Parse submodules client_module = package.modules["client"] @@ -199,11 +203,15 @@ def _analyze_client_package(self, package_name: str) -> ClientInfo: client_class = self._find_class_with_suffix(client_module, "Client") if not client_class: - raise ValueError(f"No class ending with 'Client' found in {package_name}.client") + raise ValueError( + f"No class ending with 'Client' found in {package_name}.client" + ) config_class = self._find_class_with_suffix(config_module, "Config") if not config_class: - raise ValueError(f"No class ending with 'Config' found in {package_name}.config") + raise ValueError( + f"No class ending with 'Config' found in {package_name}.config" + ) plugin_alias = config_module.members.get("Plugin") if not plugin_alias: @@ -288,7 +296,9 @@ def _analyze_operation(self, operation: Function) -> OperationInfo: if output_type in stream_type_map: stream_type = stream_type_map[output_type] - stream_args = self._get_subscript_elements(returns, f"'{operation.name}' stream type") + stream_args = self._get_subscript_elements( + returns, f"'{operation.name}' stream type" + ) if stream_type in (StreamType.INPUT, StreamType.DUPLEX): event_input_type = stream_args[0].canonical_name @@ -316,7 +326,9 @@ def _analyze_operation(self, operation: Function) -> OperationInfo: def _get_expr(self, annotation: str | Expr | None, context: str) -> Expr: """Extract and validate an Expr from an annotation.""" if not isinstance(annotation, Expr): - raise TypeError(f"{context}: expected Expr, got {type(annotation).__name__}") + raise TypeError( + f"{context}: expected Expr, got {type(annotation).__name__}" + ) return annotation def _get_subscript_elements(self, expr: Expr, context: str) -> list[Expr]: @@ -330,7 +342,9 @@ def _get_subscript_elements(self, expr: Expr, context: str) -> list[Expr]: return [el for el in slice_expr.elements if isinstance(el, Expr)] return [slice_expr] - def _extract_models(self, models_module: Module, operations: list[OperationInfo]) -> ModelsInfo: + def _extract_models( + self, models_module: Module, operations: list[OperationInfo] + ) -> ModelsInfo: """Extract structures, unions, enums, and errors from models module.""" structures, unions, enums, errors = [], [], [], [] @@ -356,14 +370,16 @@ def _extract_models(self, models_module: Module, operations: list[OperationInfo] duplicates = [] for structure in structures: - if self._is_operation_io_type(structure.name, operations) or self._is_union_member( - structure.name, unions - ): + if self._is_operation_io_type( + structure.name, operations + ) or self._is_union_member(structure.name, unions): duplicates.append(structure) structures = [struct for struct in structures if struct not in duplicates] - return ModelsInfo(structures=structures, unions=unions, enums=enums, errors=errors) + return ModelsInfo( + structures=structures, unions=unions, enums=enums, errors=errors + ) def _is_union(self, member: Object | Alias) -> TypeGuard[Attribute]: """Check if a module member is a union type.""" @@ -399,7 +415,9 @@ def _extract_union_members( for name in member_names: if not (member_object := models_module.members.get(name)): raise ValueError(f"Union member '{name}' not found in models module") - members.append(TypeInfo(name=member_object.name, module_path=member_object.path)) + members.append( + TypeInfo(name=member_object.name, module_path=member_object.path) + ) return members @@ -408,7 +426,8 @@ def _is_enum(self, member: Object | Alias) -> TypeGuard[Class]: if not isinstance(member, Class): return False return any( - isinstance(base, ExprName) and base.name in ENUM_BASE_CLASSES for base in member.bases + isinstance(base, ExprName) and base.name in ENUM_BASE_CLASSES + for base in member.bases ) def _is_error(self, member: Object | Alias) -> TypeGuard[Class]: @@ -416,10 +435,13 @@ def _is_error(self, member: Object | Alias) -> TypeGuard[Class]: if not isinstance(member, Class): return False return any( - isinstance(base, ExprName) and base.name in ERROR_BASE_CLASSES for base in member.bases + isinstance(base, ExprName) and base.name in ERROR_BASE_CLASSES + for base in member.bases ) - def _is_operation_io_type(self, type_name: str, operations: list[OperationInfo]) -> bool: + def _is_operation_io_type( + self, type_name: str, operations: list[OperationInfo] + ) -> bool: """Check if a type is used as operation input/output.""" return any(type_name in (op.input.name, op.output.name) for op in operations) @@ -437,8 +459,12 @@ def _generate_client_docs(self, client_info: ClientInfo) -> bool: self._generate_type_stubs( client_info.models.structures, "structures", "Structure Class" ) - self._generate_type_stubs(client_info.models.errors, "errors", "Error Class") - self._generate_type_stubs(client_info.models.enums, "enums", "Enum Class", members=True) + self._generate_type_stubs( + client_info.models.errors, "errors", "Error Class" + ) + self._generate_type_stubs( + client_info.models.enums, "enums", "Enum Class", members=True + ) self._generate_union_stubs(client_info.models.unions) except OSError as e: logger.error(f"Failed to write documentation files: {e}") @@ -470,7 +496,9 @@ def _generate_index(self, client_info: ClientInfo) -> None: ] for method in sorted(client_info.client_methods, key=lambda x: x.name): - lines.extend([*self._mkdocs_directive(method.module_path, heading_level=4), ""]) + lines.extend( + [*self._mkdocs_directive(method.module_path, heading_level=4), ""] + ) # Operations section if client_info.operations: @@ -578,7 +606,9 @@ def _generate_operation_stubs(self, operations: list[OperationInfo]) -> None: output_path = self.output_dir / "operations" / f"{op.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb("Operations", op.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb("Operations", op.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(operations)} operation file(s)") @@ -600,7 +630,9 @@ def _generate_type_stubs( output_path = self.output_dir / category / f"{item.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb(category.title(), item.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb(category.title(), item.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(items)} {category} file(s)") @@ -624,7 +656,9 @@ def _generate_union_stubs(self, unions: list[UnionInfo]) -> None: output_path = self.output_dir / "unions" / f"{union.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb("Unions", union.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb("Unions", union.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(unions)} union file(s)") diff --git a/clients/aws-sdk-api-gateway/src/aws_sdk_api_gateway/_private/schemas.py b/clients/aws-sdk-api-gateway/src/aws_sdk_api_gateway/_private/schemas.py index 1df41ca2..05095e75 100644 --- a/clients/aws-sdk-api-gateway/src/aws_sdk_api_gateway/_private/schemas.py +++ b/clients/aws-sdk-api-gateway/src/aws_sdk_api_gateway/_private/schemas.py @@ -2,9131 +2,8401 @@ from types import MappingProxyType -from smithy_core.prelude import UNIT -from smithy_core.schemas import Schema -from smithy_core.shapes import ShapeID, ShapeType -from smithy_core.traits import Trait - - -ACCESS_ASSOCIATION_SOURCE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#AccessAssociationSourceType"), - shape_type=ShapeType.ENUM, - members={"VPCE": {"target": UNIT}}, -) - -STRING = Schema( - id=ShapeID("com.amazonaws.apigateway#String"), shape_type=ShapeType.STRING -) - -ACCESS_LOG_SETTINGS = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#AccessLogSettings"), - members={"format": {"target": STRING}, "destinationArn": {"target": STRING}}, -) - -LIST_OF_STRING = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#ListOfString"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, -) - -INTEGER = Schema( - id=ShapeID("com.amazonaws.apigateway#Integer"), - shape_type=ShapeType.INTEGER, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=0)], -) - -DOUBLE = Schema( - id=ShapeID("com.amazonaws.apigateway#Double"), - shape_type=ShapeType.DOUBLE, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=0)], -) - -THROTTLE_SETTINGS = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#ThrottleSettings"), - members={ - "burstLimit": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "rateLimit": { - "target": DOUBLE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - }, -) - -TIMESTAMP = Schema( - id=ShapeID("com.amazonaws.apigateway#Timestamp"), shape_type=ShapeType.TIMESTAMP -) - -BOOLEAN = Schema( - id=ShapeID("com.amazonaws.apigateway#Boolean"), - shape_type=ShapeType.BOOLEAN, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=False)], -) - -MAP_OF_STRING_TO_STRING = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#MapOfStringToString"), - shape_type=ShapeType.MAP, - members={"key": {"target": STRING}, "value": {"target": STRING}}, -) - -API_KEY = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#ApiKey"), - members={ - "id": {"target": STRING}, - "value": {"target": STRING}, - "name": {"target": STRING}, - "customerId": {"target": STRING}, - "description": {"target": STRING}, - "enabled": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "createdDate": {"target": TIMESTAMP}, - "lastUpdatedDate": {"target": TIMESTAMP}, - "stageKeys": {"target": LIST_OF_STRING}, - "tags": {"target": MAP_OF_STRING_TO_STRING}, - }, -) - -API_KEYS_FORMAT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#ApiKeysFormat"), - shape_type=ShapeType.ENUM, - members={"csv": {"target": UNIT}}, -) - -API_KEY_SOURCE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#ApiKeySourceType"), - shape_type=ShapeType.ENUM, - members={"HEADER": {"target": UNIT}, "AUTHORIZER": {"target": UNIT}}, -) - -MAP_OF_API_STAGE_THROTTLE_SETTINGS = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#MapOfApiStageThrottleSettings"), - shape_type=ShapeType.MAP, - members={"key": {"target": STRING}, "value": {"target": THROTTLE_SETTINGS}}, -) - -API_STAGE = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#ApiStage"), - members={ - "apiId": {"target": STRING}, - "stage": {"target": STRING}, - "throttle": {"target": MAP_OF_API_STAGE_THROTTLE_SETTINGS}, - }, -) - -API_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#ApiStatus"), - shape_type=ShapeType.ENUM, - members={ - "UPDATING": {"target": UNIT}, - "AVAILABLE": {"target": UNIT}, - "PENDING": {"target": UNIT}, - "FAILED": {"target": UNIT}, - }, -) - -NULLABLE_INTEGER = Schema( - id=ShapeID("com.amazonaws.apigateway#NullableInteger"), shape_type=ShapeType.INTEGER -) - -PROVIDER_ARN = Schema( - id=ShapeID("com.amazonaws.apigateway#ProviderARN"), shape_type=ShapeType.STRING -) - -LIST_OF_AR_NS = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#ListOfARNs"), - shape_type=ShapeType.LIST, - members={"member": {"target": PROVIDER_ARN}}, -) - -AUTHORIZER_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#AuthorizerType"), - shape_type=ShapeType.ENUM, - members={ - "TOKEN": {"target": UNIT}, - "REQUEST": {"target": UNIT}, - "COGNITO_USER_POOLS": {"target": UNIT}, - }, -) - -AUTHORIZER = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#Authorizer"), - members={ - "id": {"target": STRING}, - "name": {"target": STRING}, - "type": {"target": AUTHORIZER_TYPE}, - "providerARNs": {"target": LIST_OF_AR_NS}, - "authType": {"target": STRING}, - "authorizerUri": {"target": STRING}, - "authorizerCredentials": {"target": STRING}, - "identitySource": {"target": STRING}, - "identityValidationExpression": {"target": STRING}, - "authorizerResultTtlInSeconds": {"target": NULLABLE_INTEGER}, - }, -) - -BAD_REQUEST_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#BadRequestException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"message": {"target": STRING}}, -) - -CONFLICT_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#ConflictException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=409), - ], - members={"message": {"target": STRING}}, -) - -STAGE_KEY = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#StageKey"), - members={"restApiId": {"target": STRING}, "stageName": {"target": STRING}}, -) - -LIST_OF_STAGE_KEYS = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#ListOfStageKeys"), - shape_type=ShapeType.LIST, - members={"member": {"target": STAGE_KEY}}, -) - -CREATE_API_KEY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#CreateApiKeyInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#CreateApiKeyRequest", - ) - ], - members={ - "name": {"target": STRING}, - "description": {"target": STRING}, - "enabled": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "generateDistinctId": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "value": {"target": STRING}, - "stageKeys": {"target": LIST_OF_STAGE_KEYS}, - "customerId": {"target": STRING}, - "tags": {"target": MAP_OF_STRING_TO_STRING}, - }, -) - -CREATE_API_KEY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#CreateApiKeyOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#ApiKey", - ) - ], - members={ - "id": {"target": STRING}, - "value": {"target": STRING}, - "name": {"target": STRING}, - "customerId": {"target": STRING}, - "description": {"target": STRING}, - "enabled": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "createdDate": {"target": TIMESTAMP}, - "lastUpdatedDate": {"target": TIMESTAMP}, - "stageKeys": {"target": LIST_OF_STRING}, - "tags": {"target": MAP_OF_STRING_TO_STRING}, - }, -) - -LIMIT_EXCEEDED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#LimitExceededException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=429), - ], - members={ - "retryAfterSeconds": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="Retry-After") - ], - }, - "message": {"target": STRING}, - }, -) - -NOT_FOUND_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#NotFoundException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=404), - ], - members={"message": {"target": STRING}}, -) - -TOO_MANY_REQUESTS_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=429), - ], - members={ - "retryAfterSeconds": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="Retry-After") - ], - }, - "message": {"target": STRING}, - }, -) - -UNAUTHORIZED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#UnauthorizedException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=401), - ], - members={"message": {"target": STRING}}, -) - -CREATE_API_KEY = Schema( - id=ShapeID("com.amazonaws.apigateway#CreateApiKey"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType({"method": "POST", "uri": "/apikeys", "code": 201}), - ) - ], -) - -CREATE_AUTHORIZER_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#CreateAuthorizerInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#CreateAuthorizerRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "name": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "type": { - "target": AUTHORIZER_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "providerARNs": {"target": LIST_OF_AR_NS}, - "authType": {"target": STRING}, - "authorizerUri": {"target": STRING}, - "authorizerCredentials": {"target": STRING}, - "identitySource": {"target": STRING}, - "identityValidationExpression": {"target": STRING}, - "authorizerResultTtlInSeconds": {"target": NULLABLE_INTEGER}, - }, -) - -CREATE_AUTHORIZER_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#CreateAuthorizerOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#Authorizer", - ) - ], - members={ - "id": {"target": STRING}, - "name": {"target": STRING}, - "type": {"target": AUTHORIZER_TYPE}, - "providerARNs": {"target": LIST_OF_AR_NS}, - "authType": {"target": STRING}, - "authorizerUri": {"target": STRING}, - "authorizerCredentials": {"target": STRING}, - "identitySource": {"target": STRING}, - "identityValidationExpression": {"target": STRING}, - "authorizerResultTtlInSeconds": {"target": NULLABLE_INTEGER}, - }, -) - -CREATE_AUTHORIZER = Schema( - id=ShapeID("com.amazonaws.apigateway#CreateAuthorizer"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/restapis/{restApiId}/authorizers", - "code": 201, - } - ), - ) - ], -) - -CREATE_BASE_PATH_MAPPING_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#CreateBasePathMappingInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#CreateBasePathMappingRequest", - ) - ], - members={ - "domainName": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "domainNameId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="domainNameId") - ], - }, - "basePath": {"target": STRING}, - "restApiId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "stage": {"target": STRING}, - }, -) - -CREATE_BASE_PATH_MAPPING_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#CreateBasePathMappingOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#BasePathMapping", - ) - ], - members={ - "basePath": {"target": STRING}, - "restApiId": {"target": STRING}, - "stage": {"target": STRING}, - }, -) - -CREATE_BASE_PATH_MAPPING = Schema( - id=ShapeID("com.amazonaws.apigateway#CreateBasePathMapping"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/domainnames/{domainName}/basepathmappings", - "code": 201, - } - ), - ) - ], -) - -NULLABLE_BOOLEAN = Schema( - id=ShapeID("com.amazonaws.apigateway#NullableBoolean"), shape_type=ShapeType.BOOLEAN -) - -CACHE_CLUSTER_SIZE = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#CacheClusterSize"), - shape_type=ShapeType.ENUM, - members={ - "SIZE_0_POINT_5_GB": {"target": UNIT}, - "SIZE_1_POINT_6_GB": {"target": UNIT}, - "SIZE_6_POINT_1_GB": {"target": UNIT}, - "SIZE_13_POINT_5_GB": {"target": UNIT}, - "SIZE_28_POINT_4_GB": {"target": UNIT}, - "SIZE_58_POINT_2_GB": {"target": UNIT}, - "SIZE_118_GB": {"target": UNIT}, - "SIZE_237_GB": {"target": UNIT}, - }, -) - -DEPLOYMENT_CANARY_SETTINGS = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DeploymentCanarySettings"), - members={ - "percentTraffic": { - "target": DOUBLE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "stageVariableOverrides": {"target": MAP_OF_STRING_TO_STRING}, - "useStageCache": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - }, -) - -CREATE_DEPLOYMENT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#CreateDeploymentInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#CreateDeploymentRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "stageName": {"target": STRING}, - "stageDescription": {"target": STRING}, - "description": {"target": STRING}, - "cacheClusterEnabled": {"target": NULLABLE_BOOLEAN}, - "cacheClusterSize": {"target": CACHE_CLUSTER_SIZE}, - "variables": {"target": MAP_OF_STRING_TO_STRING}, - "canarySettings": {"target": DEPLOYMENT_CANARY_SETTINGS}, - "tracingEnabled": {"target": NULLABLE_BOOLEAN}, - }, -) - -METHOD_SNAPSHOT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#MethodSnapshot"), - members={ - "authorizationType": {"target": STRING}, - "apiKeyRequired": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - }, -) - -MAP_OF_METHOD_SNAPSHOT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#MapOfMethodSnapshot"), - shape_type=ShapeType.MAP, - members={"key": {"target": STRING}, "value": {"target": METHOD_SNAPSHOT}}, -) - -PATH_TO_MAP_OF_METHOD_SNAPSHOT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#PathToMapOfMethodSnapshot"), - shape_type=ShapeType.MAP, - members={"key": {"target": STRING}, "value": {"target": MAP_OF_METHOD_SNAPSHOT}}, -) - -CREATE_DEPLOYMENT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#CreateDeploymentOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#Deployment", - ) - ], - members={ - "id": {"target": STRING}, - "description": {"target": STRING}, - "createdDate": {"target": TIMESTAMP}, - "apiSummary": {"target": PATH_TO_MAP_OF_METHOD_SNAPSHOT}, - }, -) - -SERVICE_UNAVAILABLE_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#ServiceUnavailableException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="server"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=503), - ], - members={ - "retryAfterSeconds": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="Retry-After") - ], - }, - "message": {"target": STRING}, - }, -) - -CREATE_DEPLOYMENT = Schema( - id=ShapeID("com.amazonaws.apigateway#CreateDeployment"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/restapis/{restApiId}/deployments", - "code": 201, - } - ), - ) - ], -) - -DOCUMENTATION_PART_LOCATION_STATUS_CODE = Schema( - id=ShapeID("com.amazonaws.apigateway#DocumentationPartLocationStatusCode"), - shape_type=ShapeType.STRING, -) - -DOCUMENTATION_PART_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DocumentationPartType"), - shape_type=ShapeType.ENUM, - members={ - "API": {"target": UNIT}, - "AUTHORIZER": {"target": UNIT}, - "MODEL": {"target": UNIT}, - "RESOURCE": {"target": UNIT}, - "METHOD": {"target": UNIT}, - "PATH_PARAMETER": {"target": UNIT}, - "QUERY_PARAMETER": {"target": UNIT}, - "REQUEST_HEADER": {"target": UNIT}, - "REQUEST_BODY": {"target": UNIT}, - "RESPONSE": {"target": UNIT}, - "RESPONSE_HEADER": {"target": UNIT}, - "RESPONSE_BODY": {"target": UNIT}, - }, -) - -DOCUMENTATION_PART_LOCATION = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DocumentationPartLocation"), - members={ - "type": { - "target": DOCUMENTATION_PART_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "path": {"target": STRING}, - "method": {"target": STRING}, - "statusCode": {"target": DOCUMENTATION_PART_LOCATION_STATUS_CODE}, - "name": {"target": STRING}, - }, -) - -CREATE_DOCUMENTATION_PART_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#CreateDocumentationPartInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#CreateDocumentationPartRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "location": { - "target": DOCUMENTATION_PART_LOCATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "properties": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -CREATE_DOCUMENTATION_PART_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#CreateDocumentationPartOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#DocumentationPart", - ) - ], - members={ - "id": {"target": STRING}, - "location": {"target": DOCUMENTATION_PART_LOCATION}, - "properties": {"target": STRING}, - }, -) - -CREATE_DOCUMENTATION_PART = Schema( - id=ShapeID("com.amazonaws.apigateway#CreateDocumentationPart"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/restapis/{restApiId}/documentation/parts", - "code": 201, - } - ), - ) - ], -) - -CREATE_DOCUMENTATION_VERSION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#CreateDocumentationVersionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#CreateDocumentationVersionRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "documentationVersion": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "stageName": {"target": STRING}, - "description": {"target": STRING}, - }, -) - -CREATE_DOCUMENTATION_VERSION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#CreateDocumentationVersionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#DocumentationVersion", - ) - ], - members={ - "version": {"target": STRING}, - "createdDate": {"target": TIMESTAMP}, - "description": {"target": STRING}, - }, -) - -CREATE_DOCUMENTATION_VERSION = Schema( - id=ShapeID("com.amazonaws.apigateway#CreateDocumentationVersion"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/restapis/{restApiId}/documentation/versions", - "code": 201, - } - ), - ) - ], -) - -ENDPOINT_ACCESS_MODE = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#EndpointAccessMode"), - shape_type=ShapeType.ENUM, - members={"BASIC": {"target": UNIT}, "STRICT": {"target": UNIT}}, -) - -IP_ADDRESS_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#IpAddressType"), - shape_type=ShapeType.ENUM, - members={"ipv4": {"target": UNIT}, "dualstack": {"target": UNIT}}, -) - -ENDPOINT_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#EndpointType"), - shape_type=ShapeType.ENUM, - members={ - "REGIONAL": {"target": UNIT}, - "EDGE": {"target": UNIT}, - "PRIVATE": {"target": UNIT}, - }, -) - -LIST_OF_ENDPOINT_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#ListOfEndpointType"), - shape_type=ShapeType.LIST, - members={"member": {"target": ENDPOINT_TYPE}}, -) - -ENDPOINT_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#EndpointConfiguration"), - members={ - "types": {"target": LIST_OF_ENDPOINT_TYPE}, - "ipAddressType": {"target": IP_ADDRESS_TYPE}, - "vpcEndpointIds": {"target": LIST_OF_STRING}, - }, -) - -MUTUAL_TLS_AUTHENTICATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#MutualTlsAuthenticationInput"), - members={ - "truststoreUri": {"target": STRING}, - "truststoreVersion": {"target": STRING}, - }, -) - -ROUTING_MODE = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#RoutingMode"), - shape_type=ShapeType.ENUM, - members={ - "BASE_PATH_MAPPING_ONLY": {"target": UNIT}, - "ROUTING_RULE_ONLY": {"target": UNIT}, - "ROUTING_RULE_THEN_BASE_PATH_MAPPING": {"target": UNIT}, - }, -) - -SECURITY_POLICY = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#SecurityPolicy"), - shape_type=ShapeType.ENUM, - members={ - "TLS_1_0": {"target": UNIT}, - "TLS_1_2": {"target": UNIT}, - "SecurityPolicy_TLS13_1_3_2025_09": {"target": UNIT}, - "SecurityPolicy_TLS13_1_3_FIPS_2025_09": {"target": UNIT}, - "SecurityPolicy_TLS13_1_2_PFS_PQ_2025_09": {"target": UNIT}, - "SecurityPolicy_TLS13_1_2_FIPS_PQ_2025_09": {"target": UNIT}, - "SecurityPolicy_TLS13_1_2_FIPS_PFS_PQ_2025_09": {"target": UNIT}, - "SecurityPolicy_TLS13_1_2_Ext2_PQ_2025_09": {"target": UNIT}, - "SecurityPolicy_TLS13_1_2_Ext2_FIPS_PQ_2025_09": {"target": UNIT}, - "SecurityPolicy_TLS13_1_2_PQ_2025_09": {"target": UNIT}, - "SecurityPolicy_TLS13_1_2_2021_06": {"target": UNIT}, - "SecurityPolicy_TLS13_2025_EDGE": {"target": UNIT}, - "SecurityPolicy_TLS12_PFS_2025_EDGE": {"target": UNIT}, - "SecurityPolicy_TLS12_2018_EDGE": {"target": UNIT}, - }, -) - -CREATE_DOMAIN_NAME_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#CreateDomainNameInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#CreateDomainNameRequest", - ) - ], - members={ - "domainName": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "certificateName": {"target": STRING}, - "certificateBody": {"target": STRING}, - "certificatePrivateKey": {"target": STRING}, - "certificateChain": {"target": STRING}, - "certificateArn": {"target": STRING}, - "regionalCertificateName": {"target": STRING}, - "regionalCertificateArn": {"target": STRING}, - "endpointConfiguration": {"target": ENDPOINT_CONFIGURATION}, - "tags": {"target": MAP_OF_STRING_TO_STRING}, - "securityPolicy": {"target": SECURITY_POLICY}, - "endpointAccessMode": {"target": ENDPOINT_ACCESS_MODE}, - "mutualTlsAuthentication": {"target": MUTUAL_TLS_AUTHENTICATION_INPUT}, - "ownershipVerificationCertificateArn": {"target": STRING}, - "policy": {"target": STRING}, - "routingMode": {"target": ROUTING_MODE}, - }, -) - -DOMAIN_NAME_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DomainNameStatus"), - shape_type=ShapeType.ENUM, - members={ - "AVAILABLE": {"target": UNIT}, - "UPDATING": {"target": UNIT}, - "PENDING": {"target": UNIT}, - "PENDING_CERTIFICATE_REIMPORT": {"target": UNIT}, - "PENDING_OWNERSHIP_VERIFICATION": {"target": UNIT}, - "FAILED": {"target": UNIT}, - }, -) - -MUTUAL_TLS_AUTHENTICATION = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#MutualTlsAuthentication"), - members={ - "truststoreUri": {"target": STRING}, - "truststoreVersion": {"target": STRING}, - "truststoreWarnings": {"target": LIST_OF_STRING}, - }, -) - -CREATE_DOMAIN_NAME_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#CreateDomainNameOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#DomainName", - ) - ], - members={ - "domainName": {"target": STRING}, - "domainNameId": {"target": STRING}, - "domainNameArn": {"target": STRING}, - "certificateName": {"target": STRING}, - "certificateArn": {"target": STRING}, - "certificateUploadDate": {"target": TIMESTAMP}, - "regionalDomainName": {"target": STRING}, - "regionalHostedZoneId": {"target": STRING}, - "regionalCertificateName": {"target": STRING}, - "regionalCertificateArn": {"target": STRING}, - "distributionDomainName": {"target": STRING}, - "distributionHostedZoneId": {"target": STRING}, - "endpointConfiguration": {"target": ENDPOINT_CONFIGURATION}, - "domainNameStatus": {"target": DOMAIN_NAME_STATUS}, - "domainNameStatusMessage": {"target": STRING}, - "securityPolicy": {"target": SECURITY_POLICY}, - "endpointAccessMode": {"target": ENDPOINT_ACCESS_MODE}, - "tags": {"target": MAP_OF_STRING_TO_STRING}, - "mutualTlsAuthentication": {"target": MUTUAL_TLS_AUTHENTICATION}, - "ownershipVerificationCertificateArn": {"target": STRING}, - "managementPolicy": {"target": STRING}, - "policy": {"target": STRING}, - "routingMode": {"target": ROUTING_MODE}, - }, -) - -CREATE_DOMAIN_NAME = Schema( - id=ShapeID("com.amazonaws.apigateway#CreateDomainName"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/domainnames", "code": 201} - ), - ) - ], -) - -CREATE_DOMAIN_NAME_ACCESS_ASSOCIATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#CreateDomainNameAccessAssociationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#CreateDomainNameAccessAssociationRequest", - ) - ], - members={ - "domainNameArn": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "accessAssociationSourceType": { - "target": ACCESS_ASSOCIATION_SOURCE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "accessAssociationSource": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "tags": {"target": MAP_OF_STRING_TO_STRING}, - }, -) - -CREATE_DOMAIN_NAME_ACCESS_ASSOCIATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#CreateDomainNameAccessAssociationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#DomainNameAccessAssociation", - ) - ], - members={ - "domainNameAccessAssociationArn": {"target": STRING}, - "domainNameArn": {"target": STRING}, - "accessAssociationSourceType": {"target": ACCESS_ASSOCIATION_SOURCE_TYPE}, - "accessAssociationSource": {"target": STRING}, - "tags": {"target": MAP_OF_STRING_TO_STRING}, - }, -) - -CREATE_DOMAIN_NAME_ACCESS_ASSOCIATION = Schema( - id=ShapeID("com.amazonaws.apigateway#CreateDomainNameAccessAssociation"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/domainnameaccessassociations", "code": 201} - ), - ) - ], -) - -CREATE_MODEL_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#CreateModelInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#CreateModelRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "name": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": STRING}, - "schema": {"target": STRING}, - "contentType": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -CREATE_MODEL_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#CreateModelOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#Model", - ) - ], - members={ - "id": {"target": STRING}, - "name": {"target": STRING}, - "description": {"target": STRING}, - "schema": {"target": STRING}, - "contentType": {"target": STRING}, - }, -) - -CREATE_MODEL = Schema( - id=ShapeID("com.amazonaws.apigateway#CreateModel"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/restapis/{restApiId}/models", "code": 201} - ), - ) - ], -) - -CREATE_REQUEST_VALIDATOR_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#CreateRequestValidatorInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#CreateRequestValidatorRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "name": {"target": STRING}, - "validateRequestBody": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "validateRequestParameters": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - }, -) - -CREATE_REQUEST_VALIDATOR_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#CreateRequestValidatorOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#RequestValidator", - ) - ], - members={ - "id": {"target": STRING}, - "name": {"target": STRING}, - "validateRequestBody": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "validateRequestParameters": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - }, -) - -CREATE_REQUEST_VALIDATOR = Schema( - id=ShapeID("com.amazonaws.apigateway#CreateRequestValidator"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/restapis/{restApiId}/requestvalidators", - "code": 201, - } - ), - ) - ], -) - -CREATE_RESOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#CreateResourceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#CreateResourceRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "parentId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "pathPart": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -CONNECTION_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#ConnectionType"), - shape_type=ShapeType.ENUM, - members={"INTERNET": {"target": UNIT}, "VPC_LINK": {"target": UNIT}}, -) - -CONTENT_HANDLING_STRATEGY = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#ContentHandlingStrategy"), - shape_type=ShapeType.ENUM, - members={ - "CONVERT_TO_BINARY": {"target": UNIT}, - "CONVERT_TO_TEXT": {"target": UNIT}, - }, -) - -STATUS_CODE = Schema( - id=ShapeID("com.amazonaws.apigateway#StatusCode"), shape_type=ShapeType.STRING -) - -INTEGRATION_RESPONSE = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#IntegrationResponse"), - members={ - "statusCode": {"target": STATUS_CODE}, - "selectionPattern": {"target": STRING}, - "responseParameters": {"target": MAP_OF_STRING_TO_STRING}, - "responseTemplates": {"target": MAP_OF_STRING_TO_STRING}, - "contentHandling": {"target": CONTENT_HANDLING_STRATEGY}, - }, -) - -MAP_OF_INTEGRATION_RESPONSE = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#MapOfIntegrationResponse"), - shape_type=ShapeType.MAP, - members={"key": {"target": STRING}, "value": {"target": INTEGRATION_RESPONSE}}, -) - -RESPONSE_TRANSFER_MODE = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#ResponseTransferMode"), - shape_type=ShapeType.ENUM, - members={"BUFFERED": {"target": UNIT}, "STREAM": {"target": UNIT}}, -) - -TLS_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#TlsConfig"), - members={ - "insecureSkipVerification": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - } - }, -) - -INTEGRATION_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#IntegrationType"), - shape_type=ShapeType.ENUM, - members={ - "HTTP": {"target": UNIT}, - "AWS": {"target": UNIT}, - "MOCK": {"target": UNIT}, - "HTTP_PROXY": {"target": UNIT}, - "AWS_PROXY": {"target": UNIT}, - }, -) - -INTEGRATION = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#Integration"), - members={ - "type": {"target": INTEGRATION_TYPE}, - "httpMethod": {"target": STRING}, - "uri": {"target": STRING}, - "connectionType": {"target": CONNECTION_TYPE}, - "connectionId": {"target": STRING}, - "credentials": {"target": STRING}, - "requestParameters": {"target": MAP_OF_STRING_TO_STRING}, - "requestTemplates": {"target": MAP_OF_STRING_TO_STRING}, - "passthroughBehavior": {"target": STRING}, - "contentHandling": {"target": CONTENT_HANDLING_STRATEGY}, - "timeoutInMillis": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "cacheNamespace": {"target": STRING}, - "cacheKeyParameters": {"target": LIST_OF_STRING}, - "integrationResponses": {"target": MAP_OF_INTEGRATION_RESPONSE}, - "tlsConfig": {"target": TLS_CONFIG}, - "responseTransferMode": {"target": RESPONSE_TRANSFER_MODE}, - "integrationTarget": {"target": STRING}, - }, -) - -MAP_OF_STRING_TO_BOOLEAN = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#MapOfStringToBoolean"), - shape_type=ShapeType.MAP, - members={"key": {"target": STRING}, "value": {"target": NULLABLE_BOOLEAN}}, -) - -METHOD_RESPONSE = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#MethodResponse"), - members={ - "statusCode": {"target": STATUS_CODE}, - "responseParameters": {"target": MAP_OF_STRING_TO_BOOLEAN}, - "responseModels": {"target": MAP_OF_STRING_TO_STRING}, - }, -) - -MAP_OF_METHOD_RESPONSE = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#MapOfMethodResponse"), - shape_type=ShapeType.MAP, - members={"key": {"target": STRING}, "value": {"target": METHOD_RESPONSE}}, -) - -METHOD = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#Method"), - members={ - "httpMethod": {"target": STRING}, - "authorizationType": {"target": STRING}, - "authorizerId": {"target": STRING}, - "apiKeyRequired": {"target": NULLABLE_BOOLEAN}, - "requestValidatorId": {"target": STRING}, - "operationName": {"target": STRING}, - "requestParameters": {"target": MAP_OF_STRING_TO_BOOLEAN}, - "requestModels": {"target": MAP_OF_STRING_TO_STRING}, - "methodResponses": {"target": MAP_OF_METHOD_RESPONSE}, - "methodIntegration": {"target": INTEGRATION}, - "authorizationScopes": {"target": LIST_OF_STRING}, - }, -) - -MAP_OF_METHOD = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#MapOfMethod"), - shape_type=ShapeType.MAP, - members={"key": {"target": STRING}, "value": {"target": METHOD}}, -) - -CREATE_RESOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#CreateResourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#Resource", - ) - ], - members={ - "id": {"target": STRING}, - "parentId": {"target": STRING}, - "pathPart": {"target": STRING}, - "path": {"target": STRING}, - "resourceMethods": {"target": MAP_OF_METHOD}, - }, -) - -CREATE_RESOURCE = Schema( - id=ShapeID("com.amazonaws.apigateway#CreateResource"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/restapis/{restApiId}/resources/{parentId}", - "code": 201, - } - ), - ) - ], -) - -CREATE_REST_API_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#CreateRestApiInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#CreateRestApiRequest", - ) - ], - members={ - "name": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": STRING}, - "version": {"target": STRING}, - "cloneFrom": {"target": STRING}, - "binaryMediaTypes": {"target": LIST_OF_STRING}, - "minimumCompressionSize": {"target": NULLABLE_INTEGER}, - "apiKeySource": {"target": API_KEY_SOURCE_TYPE}, - "endpointConfiguration": {"target": ENDPOINT_CONFIGURATION}, - "policy": {"target": STRING}, - "tags": {"target": MAP_OF_STRING_TO_STRING}, - "disableExecuteApiEndpoint": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "securityPolicy": {"target": SECURITY_POLICY}, - "endpointAccessMode": {"target": ENDPOINT_ACCESS_MODE}, - }, -) - -CREATE_REST_API_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#CreateRestApiOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#RestApi", - ) - ], - members={ - "id": {"target": STRING}, - "name": {"target": STRING}, - "description": {"target": STRING}, - "createdDate": {"target": TIMESTAMP}, - "version": {"target": STRING}, - "warnings": {"target": LIST_OF_STRING}, - "binaryMediaTypes": {"target": LIST_OF_STRING}, - "minimumCompressionSize": {"target": NULLABLE_INTEGER}, - "apiKeySource": {"target": API_KEY_SOURCE_TYPE}, - "endpointConfiguration": {"target": ENDPOINT_CONFIGURATION}, - "policy": {"target": STRING}, - "tags": {"target": MAP_OF_STRING_TO_STRING}, - "disableExecuteApiEndpoint": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "rootResourceId": {"target": STRING}, - "securityPolicy": {"target": SECURITY_POLICY}, - "endpointAccessMode": {"target": ENDPOINT_ACCESS_MODE}, - "apiStatus": {"target": API_STATUS}, - "apiStatusMessage": {"target": STRING}, - }, -) - -CREATE_REST_API = Schema( - id=ShapeID("com.amazonaws.apigateway#CreateRestApi"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType({"method": "POST", "uri": "/restapis", "code": 201}), - ) - ], -) - -CANARY_SETTINGS = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#CanarySettings"), - members={ - "percentTraffic": { - "target": DOUBLE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "deploymentId": {"target": STRING}, - "stageVariableOverrides": {"target": MAP_OF_STRING_TO_STRING}, - "useStageCache": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - }, -) - -CREATE_STAGE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#CreateStageInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#CreateStageRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "stageName": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "deploymentId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": STRING}, - "cacheClusterEnabled": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "cacheClusterSize": {"target": CACHE_CLUSTER_SIZE}, - "variables": {"target": MAP_OF_STRING_TO_STRING}, - "documentationVersion": {"target": STRING}, - "canarySettings": {"target": CANARY_SETTINGS}, - "tracingEnabled": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "tags": {"target": MAP_OF_STRING_TO_STRING}, - }, -) - -CACHE_CLUSTER_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#CacheClusterStatus"), - shape_type=ShapeType.ENUM, - members={ - "CREATE_IN_PROGRESS": {"target": UNIT}, - "AVAILABLE": {"target": UNIT}, - "DELETE_IN_PROGRESS": {"target": UNIT}, - "NOT_AVAILABLE": {"target": UNIT}, - "FLUSH_IN_PROGRESS": {"target": UNIT}, - }, -) - -UNAUTHORIZED_CACHE_CONTROL_HEADER_STRATEGY = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#UnauthorizedCacheControlHeaderStrategy"), - shape_type=ShapeType.ENUM, - members={ - "FAIL_WITH_403": {"target": UNIT}, - "SUCCEED_WITH_RESPONSE_HEADER": {"target": UNIT}, - "SUCCEED_WITHOUT_RESPONSE_HEADER": {"target": UNIT}, - }, -) - -METHOD_SETTING = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#MethodSetting"), - members={ - "metricsEnabled": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "loggingLevel": {"target": STRING}, - "dataTraceEnabled": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "throttlingBurstLimit": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "throttlingRateLimit": { - "target": DOUBLE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "cachingEnabled": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "cacheTtlInSeconds": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "cacheDataEncrypted": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "requireAuthorizationForCacheControl": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "unauthorizedCacheControlHeaderStrategy": { - "target": UNAUTHORIZED_CACHE_CONTROL_HEADER_STRATEGY - }, - }, -) - -MAP_OF_METHOD_SETTINGS = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#MapOfMethodSettings"), - shape_type=ShapeType.MAP, - members={"key": {"target": STRING}, "value": {"target": METHOD_SETTING}}, -) - -CREATE_STAGE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#CreateStageOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#Stage", - ) - ], - members={ - "deploymentId": {"target": STRING}, - "clientCertificateId": {"target": STRING}, - "stageName": {"target": STRING}, - "description": {"target": STRING}, - "cacheClusterEnabled": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "cacheClusterSize": {"target": CACHE_CLUSTER_SIZE}, - "cacheClusterStatus": {"target": CACHE_CLUSTER_STATUS}, - "methodSettings": {"target": MAP_OF_METHOD_SETTINGS}, - "variables": {"target": MAP_OF_STRING_TO_STRING}, - "documentationVersion": {"target": STRING}, - "accessLogSettings": {"target": ACCESS_LOG_SETTINGS}, - "canarySettings": {"target": CANARY_SETTINGS}, - "tracingEnabled": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "webAclArn": {"target": STRING}, - "tags": {"target": MAP_OF_STRING_TO_STRING}, - "createdDate": {"target": TIMESTAMP}, - "lastUpdatedDate": {"target": TIMESTAMP}, - }, -) - -CREATE_STAGE = Schema( - id=ShapeID("com.amazonaws.apigateway#CreateStage"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/restapis/{restApiId}/stages", "code": 201} - ), - ) - ], -) - -LIST_OF_API_STAGE = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#ListOfApiStage"), - shape_type=ShapeType.LIST, - members={"member": {"target": API_STAGE}}, -) - -QUOTA_PERIOD_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#QuotaPeriodType"), - shape_type=ShapeType.ENUM, - members={ - "DAY": {"target": UNIT}, - "WEEK": {"target": UNIT}, - "MONTH": {"target": UNIT}, - }, -) - -QUOTA_SETTINGS = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#QuotaSettings"), - members={ - "limit": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "offset": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "period": {"target": QUOTA_PERIOD_TYPE}, - }, -) - -CREATE_USAGE_PLAN_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#CreateUsagePlanInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#CreateUsagePlanRequest", - ) - ], - members={ - "name": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": STRING}, - "apiStages": {"target": LIST_OF_API_STAGE}, - "throttle": {"target": THROTTLE_SETTINGS}, - "quota": {"target": QUOTA_SETTINGS}, - "tags": {"target": MAP_OF_STRING_TO_STRING}, - }, -) - -CREATE_USAGE_PLAN_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#CreateUsagePlanOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#UsagePlan", - ) - ], - members={ - "id": {"target": STRING}, - "name": {"target": STRING}, - "description": {"target": STRING}, - "apiStages": {"target": LIST_OF_API_STAGE}, - "throttle": {"target": THROTTLE_SETTINGS}, - "quota": {"target": QUOTA_SETTINGS}, - "productCode": {"target": STRING}, - "tags": {"target": MAP_OF_STRING_TO_STRING}, - }, -) - -CREATE_USAGE_PLAN = Schema( - id=ShapeID("com.amazonaws.apigateway#CreateUsagePlan"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/usageplans", "code": 201} - ), - ) - ], -) - -CREATE_USAGE_PLAN_KEY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#CreateUsagePlanKeyInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#CreateUsagePlanKeyRequest", - ) - ], - members={ - "usagePlanId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "keyId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "keyType": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -CREATE_USAGE_PLAN_KEY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#CreateUsagePlanKeyOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#UsagePlanKey", - ) - ], - members={ - "id": {"target": STRING}, - "type": {"target": STRING}, - "value": {"target": STRING}, - "name": {"target": STRING}, - }, -) - -CREATE_USAGE_PLAN_KEY = Schema( - id=ShapeID("com.amazonaws.apigateway#CreateUsagePlanKey"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/usageplans/{usagePlanId}/keys", "code": 201} - ), - ) - ], -) - -CREATE_VPC_LINK_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#CreateVpcLinkInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#CreateVpcLinkRequest", - ) - ], - members={ - "name": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": STRING}, - "targetArns": { - "target": LIST_OF_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "tags": {"target": MAP_OF_STRING_TO_STRING}, - }, -) - -VPC_LINK_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#VpcLinkStatus"), - shape_type=ShapeType.ENUM, - members={ - "AVAILABLE": {"target": UNIT}, - "PENDING": {"target": UNIT}, - "DELETING": {"target": UNIT}, - "FAILED": {"target": UNIT}, - }, -) - -CREATE_VPC_LINK_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#CreateVpcLinkOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#VpcLink", - ) - ], - members={ - "id": {"target": STRING}, - "name": {"target": STRING}, - "description": {"target": STRING}, - "targetArns": {"target": LIST_OF_STRING}, - "status": {"target": VPC_LINK_STATUS}, - "statusMessage": {"target": STRING}, - "tags": {"target": MAP_OF_STRING_TO_STRING}, - }, -) - -CREATE_VPC_LINK = Schema( - id=ShapeID("com.amazonaws.apigateway#CreateVpcLink"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType({"method": "POST", "uri": "/vpclinks", "code": 202}), - ) - ], -) - -DELETE_API_KEY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DeleteApiKeyInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#DeleteApiKeyRequest", - ) - ], - members={ - "apiKey": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -DELETE_API_KEY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DeleteApiKeyOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -DELETE_API_KEY = Schema( - id=ShapeID("com.amazonaws.apigateway#DeleteApiKey"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "DELETE", "uri": "/apikeys/{apiKey}", "code": 202} - ), - ) - ], -) - -DELETE_AUTHORIZER_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DeleteAuthorizerInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#DeleteAuthorizerRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "authorizerId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -DELETE_AUTHORIZER_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DeleteAuthorizerOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -DELETE_AUTHORIZER = Schema( - id=ShapeID("com.amazonaws.apigateway#DeleteAuthorizer"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/restapis/{restApiId}/authorizers/{authorizerId}", - "code": 202, - } - ), - ) - ], -) - -DELETE_BASE_PATH_MAPPING_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DeleteBasePathMappingInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#DeleteBasePathMappingRequest", - ) - ], - members={ - "domainName": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "domainNameId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="domainNameId") - ], - }, - "basePath": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -DELETE_BASE_PATH_MAPPING_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DeleteBasePathMappingOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -DELETE_BASE_PATH_MAPPING = Schema( - id=ShapeID("com.amazonaws.apigateway#DeleteBasePathMapping"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/domainnames/{domainName}/basepathmappings/{basePath}", - "code": 202, - } - ), - ) - ], -) - -DELETE_CLIENT_CERTIFICATE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DeleteClientCertificateInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#DeleteClientCertificateRequest", - ) - ], - members={ - "clientCertificateId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -DELETE_CLIENT_CERTIFICATE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DeleteClientCertificateOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -DELETE_CLIENT_CERTIFICATE = Schema( - id=ShapeID("com.amazonaws.apigateway#DeleteClientCertificate"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/clientcertificates/{clientCertificateId}", - "code": 202, - } - ), - ) - ], -) - -DELETE_DEPLOYMENT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DeleteDeploymentInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#DeleteDeploymentRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "deploymentId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -DELETE_DEPLOYMENT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DeleteDeploymentOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -DELETE_DEPLOYMENT = Schema( - id=ShapeID("com.amazonaws.apigateway#DeleteDeployment"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/restapis/{restApiId}/deployments/{deploymentId}", - "code": 202, - } - ), - ) - ], -) - -DELETE_DOCUMENTATION_PART_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DeleteDocumentationPartInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#DeleteDocumentationPartRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "documentationPartId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -DELETE_DOCUMENTATION_PART_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DeleteDocumentationPartOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -DELETE_DOCUMENTATION_PART = Schema( - id=ShapeID("com.amazonaws.apigateway#DeleteDocumentationPart"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/restapis/{restApiId}/documentation/parts/{documentationPartId}", - "code": 202, - } - ), - ) - ], -) - -DELETE_DOCUMENTATION_VERSION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DeleteDocumentationVersionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#DeleteDocumentationVersionRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "documentationVersion": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -DELETE_DOCUMENTATION_VERSION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DeleteDocumentationVersionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -DELETE_DOCUMENTATION_VERSION = Schema( - id=ShapeID("com.amazonaws.apigateway#DeleteDocumentationVersion"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/restapis/{restApiId}/documentation/versions/{documentationVersion}", - "code": 202, - } - ), - ) - ], -) - -DELETE_DOMAIN_NAME_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DeleteDomainNameInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#DeleteDomainNameRequest", - ) - ], - members={ - "domainName": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "domainNameId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="domainNameId") - ], - }, - }, -) - -DELETE_DOMAIN_NAME_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DeleteDomainNameOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -DELETE_DOMAIN_NAME = Schema( - id=ShapeID("com.amazonaws.apigateway#DeleteDomainName"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "DELETE", "uri": "/domainnames/{domainName}", "code": 202} - ), - ) - ], -) - -DELETE_DOMAIN_NAME_ACCESS_ASSOCIATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DeleteDomainNameAccessAssociationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#DeleteDomainNameAccessAssociationRequest", - ) - ], - members={ - "domainNameAccessAssociationArn": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -DELETE_DOMAIN_NAME_ACCESS_ASSOCIATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DeleteDomainNameAccessAssociationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -DELETE_DOMAIN_NAME_ACCESS_ASSOCIATION = Schema( - id=ShapeID("com.amazonaws.apigateway#DeleteDomainNameAccessAssociation"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/domainnameaccessassociations/{domainNameAccessAssociationArn}", - "code": 202, - } - ), - ) - ], -) - -GATEWAY_RESPONSE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GatewayResponseType"), - shape_type=ShapeType.ENUM, - members={ - "DEFAULT_4XX": {"target": UNIT}, - "DEFAULT_5XX": {"target": UNIT}, - "RESOURCE_NOT_FOUND": {"target": UNIT}, - "UNAUTHORIZED": {"target": UNIT}, - "INVALID_API_KEY": {"target": UNIT}, - "ACCESS_DENIED": {"target": UNIT}, - "AUTHORIZER_FAILURE": {"target": UNIT}, - "AUTHORIZER_CONFIGURATION_ERROR": {"target": UNIT}, - "INVALID_SIGNATURE": {"target": UNIT}, - "EXPIRED_TOKEN": {"target": UNIT}, - "MISSING_AUTHENTICATION_TOKEN": {"target": UNIT}, - "INTEGRATION_FAILURE": {"target": UNIT}, - "INTEGRATION_TIMEOUT": {"target": UNIT}, - "API_CONFIGURATION_ERROR": {"target": UNIT}, - "UNSUPPORTED_MEDIA_TYPE": {"target": UNIT}, - "BAD_REQUEST_PARAMETERS": {"target": UNIT}, - "BAD_REQUEST_BODY": {"target": UNIT}, - "REQUEST_TOO_LARGE": {"target": UNIT}, - "THROTTLED": {"target": UNIT}, - "QUOTA_EXCEEDED": {"target": UNIT}, - "WAF_FILTERED": {"target": UNIT}, - }, -) - -DELETE_GATEWAY_RESPONSE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DeleteGatewayResponseInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#DeleteGatewayResponseRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "responseType": { - "target": GATEWAY_RESPONSE_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -DELETE_GATEWAY_RESPONSE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DeleteGatewayResponseOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -DELETE_GATEWAY_RESPONSE = Schema( - id=ShapeID("com.amazonaws.apigateway#DeleteGatewayResponse"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/restapis/{restApiId}/gatewayresponses/{responseType}", - "code": 202, - } - ), - ) - ], -) - -DELETE_INTEGRATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DeleteIntegrationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#DeleteIntegrationRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "resourceId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "httpMethod": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -DELETE_INTEGRATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DeleteIntegrationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -DELETE_INTEGRATION = Schema( - id=ShapeID("com.amazonaws.apigateway#DeleteIntegration"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}/integration", - "code": 204, - } - ), - ) - ], -) - -DELETE_INTEGRATION_RESPONSE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DeleteIntegrationResponseInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#DeleteIntegrationResponseRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "resourceId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "httpMethod": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "statusCode": { - "target": STATUS_CODE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -DELETE_INTEGRATION_RESPONSE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DeleteIntegrationResponseOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -DELETE_INTEGRATION_RESPONSE = Schema( - id=ShapeID("com.amazonaws.apigateway#DeleteIntegrationResponse"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}/integration/responses/{statusCode}", - "code": 204, - } - ), - ) - ], -) - -DELETE_METHOD_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DeleteMethodInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#DeleteMethodRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "resourceId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "httpMethod": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -DELETE_METHOD_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DeleteMethodOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -DELETE_METHOD = Schema( - id=ShapeID("com.amazonaws.apigateway#DeleteMethod"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}", - "code": 204, - } - ), - ) - ], -) - -DELETE_METHOD_RESPONSE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DeleteMethodResponseInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#DeleteMethodResponseRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "resourceId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "httpMethod": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "statusCode": { - "target": STATUS_CODE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -DELETE_METHOD_RESPONSE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DeleteMethodResponseOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -DELETE_METHOD_RESPONSE = Schema( - id=ShapeID("com.amazonaws.apigateway#DeleteMethodResponse"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}/responses/{statusCode}", - "code": 204, - } - ), - ) - ], -) - -DELETE_MODEL_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DeleteModelInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#DeleteModelRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "modelName": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -DELETE_MODEL_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DeleteModelOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -DELETE_MODEL = Schema( - id=ShapeID("com.amazonaws.apigateway#DeleteModel"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/restapis/{restApiId}/models/{modelName}", - "code": 202, - } - ), - ) - ], -) - -DELETE_REQUEST_VALIDATOR_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DeleteRequestValidatorInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#DeleteRequestValidatorRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "requestValidatorId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -DELETE_REQUEST_VALIDATOR_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DeleteRequestValidatorOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -DELETE_REQUEST_VALIDATOR = Schema( - id=ShapeID("com.amazonaws.apigateway#DeleteRequestValidator"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/restapis/{restApiId}/requestvalidators/{requestValidatorId}", - "code": 202, - } - ), - ) - ], -) - -DELETE_RESOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DeleteResourceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#DeleteResourceRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "resourceId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -DELETE_RESOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DeleteResourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -DELETE_RESOURCE = Schema( - id=ShapeID("com.amazonaws.apigateway#DeleteResource"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/restapis/{restApiId}/resources/{resourceId}", - "code": 202, - } - ), - ) - ], -) - -DELETE_REST_API_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DeleteRestApiInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#DeleteRestApiRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -DELETE_REST_API_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DeleteRestApiOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -DELETE_REST_API = Schema( - id=ShapeID("com.amazonaws.apigateway#DeleteRestApi"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "DELETE", "uri": "/restapis/{restApiId}", "code": 202} - ), - ) - ], -) - -DELETE_STAGE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DeleteStageInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#DeleteStageRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "stageName": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -DELETE_STAGE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DeleteStageOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -DELETE_STAGE = Schema( - id=ShapeID("com.amazonaws.apigateway#DeleteStage"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/restapis/{restApiId}/stages/{stageName}", - "code": 202, - } - ), - ) - ], -) - -DELETE_USAGE_PLAN_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DeleteUsagePlanInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#DeleteUsagePlanRequest", - ) - ], - members={ - "usagePlanId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -DELETE_USAGE_PLAN_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DeleteUsagePlanOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -DELETE_USAGE_PLAN = Schema( - id=ShapeID("com.amazonaws.apigateway#DeleteUsagePlan"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "DELETE", "uri": "/usageplans/{usagePlanId}", "code": 202} - ), - ) - ], -) - -DELETE_USAGE_PLAN_KEY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DeleteUsagePlanKeyInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#DeleteUsagePlanKeyRequest", - ) - ], - members={ - "usagePlanId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "keyId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -DELETE_USAGE_PLAN_KEY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DeleteUsagePlanKeyOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -DELETE_USAGE_PLAN_KEY = Schema( - id=ShapeID("com.amazonaws.apigateway#DeleteUsagePlanKey"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/usageplans/{usagePlanId}/keys/{keyId}", - "code": 202, - } - ), - ) - ], -) - -DELETE_VPC_LINK_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DeleteVpcLinkInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#DeleteVpcLinkRequest", - ) - ], - members={ - "vpcLinkId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -DELETE_VPC_LINK_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DeleteVpcLinkOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -DELETE_VPC_LINK = Schema( - id=ShapeID("com.amazonaws.apigateway#DeleteVpcLink"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "DELETE", "uri": "/vpclinks/{vpcLinkId}", "code": 202} - ), - ) - ], -) - -FLUSH_STAGE_AUTHORIZERS_CACHE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#FlushStageAuthorizersCacheInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#FlushStageAuthorizersCacheRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "stageName": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -FLUSH_STAGE_AUTHORIZERS_CACHE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#FlushStageAuthorizersCacheOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -FLUSH_STAGE_AUTHORIZERS_CACHE = Schema( - id=ShapeID("com.amazonaws.apigateway#FlushStageAuthorizersCache"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/restapis/{restApiId}/stages/{stageName}/cache/authorizers", - "code": 202, - } - ), - ) - ], -) - -FLUSH_STAGE_CACHE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#FlushStageCacheInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#FlushStageCacheRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "stageName": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -FLUSH_STAGE_CACHE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#FlushStageCacheOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -FLUSH_STAGE_CACHE = Schema( - id=ShapeID("com.amazonaws.apigateway#FlushStageCache"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/restapis/{restApiId}/stages/{stageName}/cache/data", - "code": 202, - } - ), - ) - ], -) - -GENERATE_CLIENT_CERTIFICATE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GenerateClientCertificateInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GenerateClientCertificateRequest", - ) - ], - members={ - "description": {"target": STRING}, - "tags": {"target": MAP_OF_STRING_TO_STRING}, - }, -) - -GENERATE_CLIENT_CERTIFICATE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GenerateClientCertificateOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#ClientCertificate", - ) - ], - members={ - "clientCertificateId": {"target": STRING}, - "description": {"target": STRING}, - "pemEncodedCertificate": {"target": STRING}, - "createdDate": {"target": TIMESTAMP}, - "expirationDate": {"target": TIMESTAMP}, - "tags": {"target": MAP_OF_STRING_TO_STRING}, - }, -) - -GENERATE_CLIENT_CERTIFICATE = Schema( - id=ShapeID("com.amazonaws.apigateway#GenerateClientCertificate"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/clientcertificates", "code": 201} - ), - ) - ], -) - -GET_ACCOUNT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetAccountInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GetAccountRequest", - ) - ], -) - -GET_ACCOUNT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetAccountOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#Account", - ) - ], - members={ - "cloudwatchRoleArn": {"target": STRING}, - "throttleSettings": {"target": THROTTLE_SETTINGS}, - "features": {"target": LIST_OF_STRING}, - "apiKeyVersion": {"target": STRING}, - }, -) - -GET_ACCOUNT = Schema( - id=ShapeID("com.amazonaws.apigateway#GetAccount"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType({"method": "GET", "uri": "/account", "code": 200}), - ) - ], -) - -GET_API_KEY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetApiKeyInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GetApiKeyRequest", - ) - ], - members={ - "apiKey": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "includeValue": { - "target": NULLABLE_BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="includeValue") - ], - }, - }, -) - -GET_API_KEY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetApiKeyOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#ApiKey", - ) - ], - members={ - "id": {"target": STRING}, - "value": {"target": STRING}, - "name": {"target": STRING}, - "customerId": {"target": STRING}, - "description": {"target": STRING}, - "enabled": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "createdDate": {"target": TIMESTAMP}, - "lastUpdatedDate": {"target": TIMESTAMP}, - "stageKeys": {"target": LIST_OF_STRING}, - "tags": {"target": MAP_OF_STRING_TO_STRING}, - }, -) - -GET_API_KEY = Schema( - id=ShapeID("com.amazonaws.apigateway#GetApiKey"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/apikeys/{apiKey}", "code": 200} - ), - ) - ], -) - -GET_API_KEYS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetApiKeysInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GetApiKeysRequest", - ) - ], - members={ - "position": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="position")], - }, - "limit": { - "target": NULLABLE_INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="limit")], - }, - "nameQuery": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="name")], - }, - "customerId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="customerId") - ], - }, - "includeValues": { - "target": NULLABLE_BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="includeValues") - ], - }, - }, -) - -LIST_OF_API_KEY = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#ListOfApiKey"), - shape_type=ShapeType.LIST, - members={"member": {"target": API_KEY}}, -) - -GET_API_KEYS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetApiKeysOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#ApiKeys", - ) - ], - members={ - "warnings": {"target": LIST_OF_STRING}, - "items": { - "target": LIST_OF_API_KEY, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="item")], - }, - "position": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="position")], - }, - }, -) - -GET_API_KEYS = Schema( - id=ShapeID("com.amazonaws.apigateway#GetApiKeys"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType({"method": "GET", "uri": "/apikeys", "code": 200}), - ) - ], -) - -GET_AUTHORIZER_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetAuthorizerInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GetAuthorizerRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "authorizerId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -GET_AUTHORIZER_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetAuthorizerOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#Authorizer", - ) - ], - members={ - "id": {"target": STRING}, - "name": {"target": STRING}, - "type": {"target": AUTHORIZER_TYPE}, - "providerARNs": {"target": LIST_OF_AR_NS}, - "authType": {"target": STRING}, - "authorizerUri": {"target": STRING}, - "authorizerCredentials": {"target": STRING}, - "identitySource": {"target": STRING}, - "identityValidationExpression": {"target": STRING}, - "authorizerResultTtlInSeconds": {"target": NULLABLE_INTEGER}, - }, -) - -GET_AUTHORIZER = Schema( - id=ShapeID("com.amazonaws.apigateway#GetAuthorizer"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/restapis/{restApiId}/authorizers/{authorizerId}", - "code": 200, - } - ), - ) - ], -) - -GET_AUTHORIZERS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetAuthorizersInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GetAuthorizersRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "position": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="position")], - }, - "limit": { - "target": NULLABLE_INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="limit")], - }, - }, -) - -LIST_OF_AUTHORIZER = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#ListOfAuthorizer"), - shape_type=ShapeType.LIST, - members={"member": {"target": AUTHORIZER}}, -) - -GET_AUTHORIZERS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetAuthorizersOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#Authorizers", - ) - ], - members={ - "items": { - "target": LIST_OF_AUTHORIZER, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="item")], - }, - "position": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="position")], - }, - }, -) - -GET_AUTHORIZERS = Schema( - id=ShapeID("com.amazonaws.apigateway#GetAuthorizers"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/restapis/{restApiId}/authorizers", - "code": 200, - } - ), - ) - ], -) - -GET_BASE_PATH_MAPPING_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetBasePathMappingInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GetBasePathMappingRequest", - ) - ], - members={ - "domainName": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "domainNameId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="domainNameId") - ], - }, - "basePath": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -GET_BASE_PATH_MAPPING_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetBasePathMappingOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#BasePathMapping", - ) - ], - members={ - "basePath": {"target": STRING}, - "restApiId": {"target": STRING}, - "stage": {"target": STRING}, - }, -) - -GET_BASE_PATH_MAPPING = Schema( - id=ShapeID("com.amazonaws.apigateway#GetBasePathMapping"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/domainnames/{domainName}/basepathmappings/{basePath}", - "code": 200, - } - ), - ) - ], -) - -GET_BASE_PATH_MAPPINGS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetBasePathMappingsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GetBasePathMappingsRequest", - ) - ], - members={ - "domainName": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "domainNameId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="domainNameId") - ], - }, - "position": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="position")], - }, - "limit": { - "target": NULLABLE_INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="limit")], - }, - }, -) - -BASE_PATH_MAPPING = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#BasePathMapping"), - members={ - "basePath": {"target": STRING}, - "restApiId": {"target": STRING}, - "stage": {"target": STRING}, - }, -) - -LIST_OF_BASE_PATH_MAPPING = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#ListOfBasePathMapping"), - shape_type=ShapeType.LIST, - members={"member": {"target": BASE_PATH_MAPPING}}, -) - -GET_BASE_PATH_MAPPINGS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetBasePathMappingsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#BasePathMappings", - ) - ], - members={ - "items": { - "target": LIST_OF_BASE_PATH_MAPPING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="item")], - }, - "position": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="position")], - }, - }, -) - -GET_BASE_PATH_MAPPINGS = Schema( - id=ShapeID("com.amazonaws.apigateway#GetBasePathMappings"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/domainnames/{domainName}/basepathmappings", - "code": 200, - } - ), - ) - ], -) - -GET_CLIENT_CERTIFICATE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetClientCertificateInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GetClientCertificateRequest", - ) - ], - members={ - "clientCertificateId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -GET_CLIENT_CERTIFICATE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetClientCertificateOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#ClientCertificate", - ) - ], - members={ - "clientCertificateId": {"target": STRING}, - "description": {"target": STRING}, - "pemEncodedCertificate": {"target": STRING}, - "createdDate": {"target": TIMESTAMP}, - "expirationDate": {"target": TIMESTAMP}, - "tags": {"target": MAP_OF_STRING_TO_STRING}, - }, -) - -GET_CLIENT_CERTIFICATE = Schema( - id=ShapeID("com.amazonaws.apigateway#GetClientCertificate"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/clientcertificates/{clientCertificateId}", - "code": 200, - } - ), - ) - ], -) - -GET_CLIENT_CERTIFICATES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetClientCertificatesInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GetClientCertificatesRequest", - ) - ], - members={ - "position": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="position")], - }, - "limit": { - "target": NULLABLE_INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="limit")], - }, - }, -) - -CLIENT_CERTIFICATE = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#ClientCertificate"), - members={ - "clientCertificateId": {"target": STRING}, - "description": {"target": STRING}, - "pemEncodedCertificate": {"target": STRING}, - "createdDate": {"target": TIMESTAMP}, - "expirationDate": {"target": TIMESTAMP}, - "tags": {"target": MAP_OF_STRING_TO_STRING}, - }, -) - -LIST_OF_CLIENT_CERTIFICATE = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#ListOfClientCertificate"), - shape_type=ShapeType.LIST, - members={"member": {"target": CLIENT_CERTIFICATE}}, -) - -GET_CLIENT_CERTIFICATES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetClientCertificatesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#ClientCertificates", - ) - ], - members={ - "items": { - "target": LIST_OF_CLIENT_CERTIFICATE, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="item")], - }, - "position": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="position")], - }, - }, -) - -GET_CLIENT_CERTIFICATES = Schema( - id=ShapeID("com.amazonaws.apigateway#GetClientCertificates"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/clientcertificates", "code": 200} - ), - ) - ], -) - -GET_DEPLOYMENT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetDeploymentInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GetDeploymentRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "deploymentId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "embed": { - "target": LIST_OF_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="embed")], - }, - }, -) - -GET_DEPLOYMENT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetDeploymentOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#Deployment", - ) - ], - members={ - "id": {"target": STRING}, - "description": {"target": STRING}, - "createdDate": {"target": TIMESTAMP}, - "apiSummary": {"target": PATH_TO_MAP_OF_METHOD_SNAPSHOT}, - }, -) - -GET_DEPLOYMENT = Schema( - id=ShapeID("com.amazonaws.apigateway#GetDeployment"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/restapis/{restApiId}/deployments/{deploymentId}", - "code": 200, - } - ), - ) - ], -) - -GET_DEPLOYMENTS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetDeploymentsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GetDeploymentsRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "position": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="position")], - }, - "limit": { - "target": NULLABLE_INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="limit")], - }, - }, -) - -DEPLOYMENT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#Deployment"), - members={ - "id": {"target": STRING}, - "description": {"target": STRING}, - "createdDate": {"target": TIMESTAMP}, - "apiSummary": {"target": PATH_TO_MAP_OF_METHOD_SNAPSHOT}, - }, -) - -LIST_OF_DEPLOYMENT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#ListOfDeployment"), - shape_type=ShapeType.LIST, - members={"member": {"target": DEPLOYMENT}}, -) - -GET_DEPLOYMENTS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetDeploymentsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#Deployments", - ) - ], - members={ - "items": { - "target": LIST_OF_DEPLOYMENT, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="item")], - }, - "position": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="position")], - }, - }, -) - -GET_DEPLOYMENTS = Schema( - id=ShapeID("com.amazonaws.apigateway#GetDeployments"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/restapis/{restApiId}/deployments", - "code": 200, - } - ), - ) - ], -) - -GET_DOCUMENTATION_PART_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetDocumentationPartInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GetDocumentationPartRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "documentationPartId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -GET_DOCUMENTATION_PART_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetDocumentationPartOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#DocumentationPart", - ) - ], - members={ - "id": {"target": STRING}, - "location": {"target": DOCUMENTATION_PART_LOCATION}, - "properties": {"target": STRING}, - }, -) - -GET_DOCUMENTATION_PART = Schema( - id=ShapeID("com.amazonaws.apigateway#GetDocumentationPart"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/restapis/{restApiId}/documentation/parts/{documentationPartId}", - "code": 200, - } - ), - ) - ], -) - -LOCATION_STATUS_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#LocationStatusType"), - shape_type=ShapeType.ENUM, - members={"DOCUMENTED": {"target": UNIT}, "UNDOCUMENTED": {"target": UNIT}}, -) - -GET_DOCUMENTATION_PARTS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetDocumentationPartsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GetDocumentationPartsRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "type": { - "target": DOCUMENTATION_PART_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="type")], - }, - "nameQuery": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="name")], - }, - "path": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="path")], - }, - "position": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="position")], - }, - "limit": { - "target": NULLABLE_INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="limit")], - }, - "locationStatus": { - "target": LOCATION_STATUS_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="locationStatus") - ], - }, - }, -) - -DOCUMENTATION_PART = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DocumentationPart"), - members={ - "id": {"target": STRING}, - "location": {"target": DOCUMENTATION_PART_LOCATION}, - "properties": {"target": STRING}, - }, -) - -LIST_OF_DOCUMENTATION_PART = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#ListOfDocumentationPart"), - shape_type=ShapeType.LIST, - members={"member": {"target": DOCUMENTATION_PART}}, -) - -GET_DOCUMENTATION_PARTS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetDocumentationPartsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#DocumentationParts", - ) - ], - members={ - "items": { - "target": LIST_OF_DOCUMENTATION_PART, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="item")], - }, - "position": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="position")], - }, - }, -) - -GET_DOCUMENTATION_PARTS = Schema( - id=ShapeID("com.amazonaws.apigateway#GetDocumentationParts"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/restapis/{restApiId}/documentation/parts", - "code": 200, - } - ), - ) - ], -) - -GET_DOCUMENTATION_VERSION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetDocumentationVersionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GetDocumentationVersionRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "documentationVersion": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -GET_DOCUMENTATION_VERSION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetDocumentationVersionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#DocumentationVersion", - ) - ], - members={ - "version": {"target": STRING}, - "createdDate": {"target": TIMESTAMP}, - "description": {"target": STRING}, - }, -) - -GET_DOCUMENTATION_VERSION = Schema( - id=ShapeID("com.amazonaws.apigateway#GetDocumentationVersion"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/restapis/{restApiId}/documentation/versions/{documentationVersion}", - "code": 200, - } - ), - ) - ], -) - -GET_DOCUMENTATION_VERSIONS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetDocumentationVersionsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GetDocumentationVersionsRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "position": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="position")], - }, - "limit": { - "target": NULLABLE_INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="limit")], - }, - }, -) - -DOCUMENTATION_VERSION = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DocumentationVersion"), - members={ - "version": {"target": STRING}, - "createdDate": {"target": TIMESTAMP}, - "description": {"target": STRING}, - }, -) - -LIST_OF_DOCUMENTATION_VERSION = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#ListOfDocumentationVersion"), - shape_type=ShapeType.LIST, - members={"member": {"target": DOCUMENTATION_VERSION}}, -) - -GET_DOCUMENTATION_VERSIONS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetDocumentationVersionsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#DocumentationVersions", - ) - ], - members={ - "items": { - "target": LIST_OF_DOCUMENTATION_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="item")], - }, - "position": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="position")], - }, - }, -) - -GET_DOCUMENTATION_VERSIONS = Schema( - id=ShapeID("com.amazonaws.apigateway#GetDocumentationVersions"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/restapis/{restApiId}/documentation/versions", - "code": 200, - } - ), - ) - ], -) - -GET_DOMAIN_NAME_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetDomainNameInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GetDomainNameRequest", - ) - ], - members={ - "domainName": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "domainNameId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="domainNameId") - ], - }, - }, -) - -GET_DOMAIN_NAME_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetDomainNameOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#DomainName", - ) - ], - members={ - "domainName": {"target": STRING}, - "domainNameId": {"target": STRING}, - "domainNameArn": {"target": STRING}, - "certificateName": {"target": STRING}, - "certificateArn": {"target": STRING}, - "certificateUploadDate": {"target": TIMESTAMP}, - "regionalDomainName": {"target": STRING}, - "regionalHostedZoneId": {"target": STRING}, - "regionalCertificateName": {"target": STRING}, - "regionalCertificateArn": {"target": STRING}, - "distributionDomainName": {"target": STRING}, - "distributionHostedZoneId": {"target": STRING}, - "endpointConfiguration": {"target": ENDPOINT_CONFIGURATION}, - "domainNameStatus": {"target": DOMAIN_NAME_STATUS}, - "domainNameStatusMessage": {"target": STRING}, - "securityPolicy": {"target": SECURITY_POLICY}, - "endpointAccessMode": {"target": ENDPOINT_ACCESS_MODE}, - "tags": {"target": MAP_OF_STRING_TO_STRING}, - "mutualTlsAuthentication": {"target": MUTUAL_TLS_AUTHENTICATION}, - "ownershipVerificationCertificateArn": {"target": STRING}, - "managementPolicy": {"target": STRING}, - "policy": {"target": STRING}, - "routingMode": {"target": ROUTING_MODE}, - }, -) - -GET_DOMAIN_NAME = Schema( - id=ShapeID("com.amazonaws.apigateway#GetDomainName"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/domainnames/{domainName}", "code": 200} - ), - ) - ], -) - -RESOURCE_OWNER = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#ResourceOwner"), - shape_type=ShapeType.ENUM, - members={"SELF": {"target": UNIT}, "OTHER_ACCOUNTS": {"target": UNIT}}, -) - -GET_DOMAIN_NAME_ACCESS_ASSOCIATIONS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetDomainNameAccessAssociationsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GetDomainNameAccessAssociationsRequest", - ) - ], - members={ - "position": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="position")], - }, - "limit": { - "target": NULLABLE_INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="limit")], - }, - "resourceOwner": { - "target": RESOURCE_OWNER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="resourceOwner") - ], - }, - }, -) - -DOMAIN_NAME_ACCESS_ASSOCIATION = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DomainNameAccessAssociation"), - members={ - "domainNameAccessAssociationArn": {"target": STRING}, - "domainNameArn": {"target": STRING}, - "accessAssociationSourceType": {"target": ACCESS_ASSOCIATION_SOURCE_TYPE}, - "accessAssociationSource": {"target": STRING}, - "tags": {"target": MAP_OF_STRING_TO_STRING}, - }, -) - -LIST_OF_DOMAIN_NAME_ACCESS_ASSOCIATION = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#ListOfDomainNameAccessAssociation"), - shape_type=ShapeType.LIST, - members={"member": {"target": DOMAIN_NAME_ACCESS_ASSOCIATION}}, -) - -GET_DOMAIN_NAME_ACCESS_ASSOCIATIONS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetDomainNameAccessAssociationsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#DomainNameAccessAssociations", - ) - ], - members={ - "items": { - "target": LIST_OF_DOMAIN_NAME_ACCESS_ASSOCIATION, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="item")], - }, - "position": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="position")], - }, - }, -) - -GET_DOMAIN_NAME_ACCESS_ASSOCIATIONS = Schema( - id=ShapeID("com.amazonaws.apigateway#GetDomainNameAccessAssociations"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/domainnameaccessassociations", "code": 200} - ), - ) - ], -) - -GET_DOMAIN_NAMES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetDomainNamesInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GetDomainNamesRequest", - ) - ], - members={ - "position": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="position")], - }, - "limit": { - "target": NULLABLE_INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="limit")], - }, - "resourceOwner": { - "target": RESOURCE_OWNER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="resourceOwner") - ], - }, - }, -) - -DOMAIN_NAME = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#DomainName"), - members={ - "domainName": {"target": STRING}, - "domainNameId": {"target": STRING}, - "domainNameArn": {"target": STRING}, - "certificateName": {"target": STRING}, - "certificateArn": {"target": STRING}, - "certificateUploadDate": {"target": TIMESTAMP}, - "regionalDomainName": {"target": STRING}, - "regionalHostedZoneId": {"target": STRING}, - "regionalCertificateName": {"target": STRING}, - "regionalCertificateArn": {"target": STRING}, - "distributionDomainName": {"target": STRING}, - "distributionHostedZoneId": {"target": STRING}, - "endpointConfiguration": {"target": ENDPOINT_CONFIGURATION}, - "domainNameStatus": {"target": DOMAIN_NAME_STATUS}, - "domainNameStatusMessage": {"target": STRING}, - "securityPolicy": {"target": SECURITY_POLICY}, - "endpointAccessMode": {"target": ENDPOINT_ACCESS_MODE}, - "tags": {"target": MAP_OF_STRING_TO_STRING}, - "mutualTlsAuthentication": {"target": MUTUAL_TLS_AUTHENTICATION}, - "ownershipVerificationCertificateArn": {"target": STRING}, - "managementPolicy": {"target": STRING}, - "policy": {"target": STRING}, - "routingMode": {"target": ROUTING_MODE}, - }, -) - -LIST_OF_DOMAIN_NAME = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#ListOfDomainName"), - shape_type=ShapeType.LIST, - members={"member": {"target": DOMAIN_NAME}}, -) - -GET_DOMAIN_NAMES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetDomainNamesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#DomainNames", - ) - ], - members={ - "items": { - "target": LIST_OF_DOMAIN_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="item")], - }, - "position": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="position")], - }, - }, -) - -GET_DOMAIN_NAMES = Schema( - id=ShapeID("com.amazonaws.apigateway#GetDomainNames"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/domainnames", "code": 200} - ), - ) - ], -) - -GET_EXPORT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetExportInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GetExportRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "stageName": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "exportType": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "parameters": { - "target": MAP_OF_STRING_TO_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQueryParams"))], - }, - "accepts": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpHeader"), value="Accept")], - }, - }, -) - -BLOB = Schema(id=ShapeID("com.amazonaws.apigateway#Blob"), shape_type=ShapeType.BLOB) - -GET_EXPORT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetExportOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#ExportResponse", - ) - ], - members={ - "contentType": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="Content-Type") - ], - }, - "contentDisposition": { - "target": STRING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), value="Content-Disposition" - ) - ], - }, - "body": { - "target": BLOB, - "traits": [Trait.new(id=ShapeID("smithy.api#httpPayload"))], - }, - }, -) - -GET_EXPORT = Schema( - id=ShapeID("com.amazonaws.apigateway#GetExport"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/restapis/{restApiId}/stages/{stageName}/exports/{exportType}", - "code": 200, - } - ), - ) - ], -) - -GET_GATEWAY_RESPONSE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetGatewayResponseInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GetGatewayResponseRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "responseType": { - "target": GATEWAY_RESPONSE_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -GET_GATEWAY_RESPONSE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetGatewayResponseOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GatewayResponse", - ) - ], - members={ - "responseType": {"target": GATEWAY_RESPONSE_TYPE}, - "statusCode": {"target": STATUS_CODE}, - "responseParameters": {"target": MAP_OF_STRING_TO_STRING}, - "responseTemplates": {"target": MAP_OF_STRING_TO_STRING}, - "defaultResponse": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - }, -) - -GET_GATEWAY_RESPONSE = Schema( - id=ShapeID("com.amazonaws.apigateway#GetGatewayResponse"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/restapis/{restApiId}/gatewayresponses/{responseType}", - "code": 200, - } - ), - ) - ], -) - -GET_GATEWAY_RESPONSES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetGatewayResponsesInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GetGatewayResponsesRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "position": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="position")], - }, - "limit": { - "target": NULLABLE_INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="limit")], - }, - }, -) - -GATEWAY_RESPONSE = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GatewayResponse"), - members={ - "responseType": {"target": GATEWAY_RESPONSE_TYPE}, - "statusCode": {"target": STATUS_CODE}, - "responseParameters": {"target": MAP_OF_STRING_TO_STRING}, - "responseTemplates": {"target": MAP_OF_STRING_TO_STRING}, - "defaultResponse": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - }, -) - -LIST_OF_GATEWAY_RESPONSE = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#ListOfGatewayResponse"), - shape_type=ShapeType.LIST, - members={"member": {"target": GATEWAY_RESPONSE}}, -) - -GET_GATEWAY_RESPONSES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetGatewayResponsesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GatewayResponses", - ) - ], - members={ - "items": { - "target": LIST_OF_GATEWAY_RESPONSE, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="item")], - }, - "position": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="position")], - }, - }, -) - -GET_GATEWAY_RESPONSES = Schema( - id=ShapeID("com.amazonaws.apigateway#GetGatewayResponses"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/restapis/{restApiId}/gatewayresponses", - "code": 200, - } - ), - ) - ], -) - -GET_INTEGRATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetIntegrationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GetIntegrationRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "resourceId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "httpMethod": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -GET_INTEGRATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetIntegrationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#Integration", - ) - ], - members={ - "type": {"target": INTEGRATION_TYPE}, - "httpMethod": {"target": STRING}, - "uri": {"target": STRING}, - "connectionType": {"target": CONNECTION_TYPE}, - "connectionId": {"target": STRING}, - "credentials": {"target": STRING}, - "requestParameters": {"target": MAP_OF_STRING_TO_STRING}, - "requestTemplates": {"target": MAP_OF_STRING_TO_STRING}, - "passthroughBehavior": {"target": STRING}, - "contentHandling": {"target": CONTENT_HANDLING_STRATEGY}, - "timeoutInMillis": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "cacheNamespace": {"target": STRING}, - "cacheKeyParameters": {"target": LIST_OF_STRING}, - "integrationResponses": {"target": MAP_OF_INTEGRATION_RESPONSE}, - "tlsConfig": {"target": TLS_CONFIG}, - "responseTransferMode": {"target": RESPONSE_TRANSFER_MODE}, - "integrationTarget": {"target": STRING}, - }, -) - -GET_INTEGRATION = Schema( - id=ShapeID("com.amazonaws.apigateway#GetIntegration"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}/integration", - "code": 200, - } - ), - ) - ], -) - -GET_INTEGRATION_RESPONSE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetIntegrationResponseInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GetIntegrationResponseRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "resourceId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "httpMethod": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "statusCode": { - "target": STATUS_CODE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -GET_INTEGRATION_RESPONSE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetIntegrationResponseOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#IntegrationResponse", - ) - ], - members={ - "statusCode": {"target": STATUS_CODE}, - "selectionPattern": {"target": STRING}, - "responseParameters": {"target": MAP_OF_STRING_TO_STRING}, - "responseTemplates": {"target": MAP_OF_STRING_TO_STRING}, - "contentHandling": {"target": CONTENT_HANDLING_STRATEGY}, - }, -) - -GET_INTEGRATION_RESPONSE = Schema( - id=ShapeID("com.amazonaws.apigateway#GetIntegrationResponse"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}/integration/responses/{statusCode}", - "code": 200, - } - ), - ) - ], -) - -GET_METHOD_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetMethodInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GetMethodRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "resourceId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "httpMethod": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -GET_METHOD_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetMethodOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#Method", - ) - ], - members={ - "httpMethod": {"target": STRING}, - "authorizationType": {"target": STRING}, - "authorizerId": {"target": STRING}, - "apiKeyRequired": {"target": NULLABLE_BOOLEAN}, - "requestValidatorId": {"target": STRING}, - "operationName": {"target": STRING}, - "requestParameters": {"target": MAP_OF_STRING_TO_BOOLEAN}, - "requestModels": {"target": MAP_OF_STRING_TO_STRING}, - "methodResponses": {"target": MAP_OF_METHOD_RESPONSE}, - "methodIntegration": {"target": INTEGRATION}, - "authorizationScopes": {"target": LIST_OF_STRING}, - }, -) - -GET_METHOD = Schema( - id=ShapeID("com.amazonaws.apigateway#GetMethod"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}", - "code": 200, - } - ), - ) - ], -) - -GET_METHOD_RESPONSE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetMethodResponseInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GetMethodResponseRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "resourceId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "httpMethod": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "statusCode": { - "target": STATUS_CODE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -GET_METHOD_RESPONSE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetMethodResponseOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#MethodResponse", - ) - ], - members={ - "statusCode": {"target": STATUS_CODE}, - "responseParameters": {"target": MAP_OF_STRING_TO_BOOLEAN}, - "responseModels": {"target": MAP_OF_STRING_TO_STRING}, - }, -) - -GET_METHOD_RESPONSE = Schema( - id=ShapeID("com.amazonaws.apigateway#GetMethodResponse"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}/responses/{statusCode}", - "code": 200, - } - ), - ) - ], -) - -GET_MODEL_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetModelInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GetModelRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "modelName": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "flatten": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=False), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="flatten"), - ], - }, - }, -) - -GET_MODEL_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetModelOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#Model", - ) - ], - members={ - "id": {"target": STRING}, - "name": {"target": STRING}, - "description": {"target": STRING}, - "schema": {"target": STRING}, - "contentType": {"target": STRING}, - }, -) - -GET_MODEL = Schema( - id=ShapeID("com.amazonaws.apigateway#GetModel"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/restapis/{restApiId}/models/{modelName}", - "code": 200, - } - ), - ) - ], -) - -GET_MODELS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetModelsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GetModelsRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "position": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="position")], - }, - "limit": { - "target": NULLABLE_INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="limit")], - }, - }, -) - -MODEL = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#Model"), - members={ - "id": {"target": STRING}, - "name": {"target": STRING}, - "description": {"target": STRING}, - "schema": {"target": STRING}, - "contentType": {"target": STRING}, - }, -) - -LIST_OF_MODEL = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#ListOfModel"), - shape_type=ShapeType.LIST, - members={"member": {"target": MODEL}}, -) - -GET_MODELS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetModelsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#Models", - ) - ], - members={ - "items": { - "target": LIST_OF_MODEL, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="item")], - }, - "position": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="position")], - }, - }, -) - -GET_MODELS = Schema( - id=ShapeID("com.amazonaws.apigateway#GetModels"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/restapis/{restApiId}/models", "code": 200} - ), - ) - ], -) - -GET_MODEL_TEMPLATE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetModelTemplateInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GetModelTemplateRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "modelName": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -GET_MODEL_TEMPLATE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetModelTemplateOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#Template", - ) - ], - members={"value": {"target": STRING}}, -) - -GET_MODEL_TEMPLATE = Schema( - id=ShapeID("com.amazonaws.apigateway#GetModelTemplate"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/restapis/{restApiId}/models/{modelName}/default_template", - "code": 200, - } - ), - ) - ], -) - -GET_REQUEST_VALIDATOR_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetRequestValidatorInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GetRequestValidatorRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "requestValidatorId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -GET_REQUEST_VALIDATOR_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetRequestValidatorOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#RequestValidator", - ) - ], - members={ - "id": {"target": STRING}, - "name": {"target": STRING}, - "validateRequestBody": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "validateRequestParameters": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - }, -) - -GET_REQUEST_VALIDATOR = Schema( - id=ShapeID("com.amazonaws.apigateway#GetRequestValidator"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/restapis/{restApiId}/requestvalidators/{requestValidatorId}", - "code": 200, - } - ), - ) - ], -) - -GET_REQUEST_VALIDATORS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetRequestValidatorsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GetRequestValidatorsRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "position": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="position")], - }, - "limit": { - "target": NULLABLE_INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="limit")], - }, - }, -) - -REQUEST_VALIDATOR = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#RequestValidator"), - members={ - "id": {"target": STRING}, - "name": {"target": STRING}, - "validateRequestBody": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "validateRequestParameters": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - }, -) - -LIST_OF_REQUEST_VALIDATOR = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#ListOfRequestValidator"), - shape_type=ShapeType.LIST, - members={"member": {"target": REQUEST_VALIDATOR}}, -) - -GET_REQUEST_VALIDATORS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetRequestValidatorsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#RequestValidators", - ) - ], - members={ - "items": { - "target": LIST_OF_REQUEST_VALIDATOR, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="item")], - }, - "position": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="position")], - }, - }, -) - -GET_REQUEST_VALIDATORS = Schema( - id=ShapeID("com.amazonaws.apigateway#GetRequestValidators"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/restapis/{restApiId}/requestvalidators", - "code": 200, - } - ), - ) - ], -) - -GET_RESOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetResourceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GetResourceRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "resourceId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "embed": { - "target": LIST_OF_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="embed")], - }, - }, -) - -GET_RESOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetResourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#Resource", - ) - ], - members={ - "id": {"target": STRING}, - "parentId": {"target": STRING}, - "pathPart": {"target": STRING}, - "path": {"target": STRING}, - "resourceMethods": {"target": MAP_OF_METHOD}, - }, -) - -GET_RESOURCE = Schema( - id=ShapeID("com.amazonaws.apigateway#GetResource"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/restapis/{restApiId}/resources/{resourceId}", - "code": 200, - } - ), - ) - ], -) - -GET_RESOURCES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetResourcesInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GetResourcesRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "position": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="position")], - }, - "limit": { - "target": NULLABLE_INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="limit")], - }, - "embed": { - "target": LIST_OF_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="embed")], - }, - }, -) - -RESOURCE = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#Resource"), - members={ - "id": {"target": STRING}, - "parentId": {"target": STRING}, - "pathPart": {"target": STRING}, - "path": {"target": STRING}, - "resourceMethods": {"target": MAP_OF_METHOD}, - }, -) - -LIST_OF_RESOURCE = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#ListOfResource"), - shape_type=ShapeType.LIST, - members={"member": {"target": RESOURCE}}, -) - -GET_RESOURCES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetResourcesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#Resources", - ) - ], - members={ - "items": { - "target": LIST_OF_RESOURCE, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="item")], - }, - "position": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="position")], - }, - }, -) - -GET_RESOURCES = Schema( - id=ShapeID("com.amazonaws.apigateway#GetResources"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/restapis/{restApiId}/resources", "code": 200} - ), - ) - ], -) - -GET_REST_API_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetRestApiInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GetRestApiRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -GET_REST_API_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetRestApiOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#RestApi", - ) - ], - members={ - "id": {"target": STRING}, - "name": {"target": STRING}, - "description": {"target": STRING}, - "createdDate": {"target": TIMESTAMP}, - "version": {"target": STRING}, - "warnings": {"target": LIST_OF_STRING}, - "binaryMediaTypes": {"target": LIST_OF_STRING}, - "minimumCompressionSize": {"target": NULLABLE_INTEGER}, - "apiKeySource": {"target": API_KEY_SOURCE_TYPE}, - "endpointConfiguration": {"target": ENDPOINT_CONFIGURATION}, - "policy": {"target": STRING}, - "tags": {"target": MAP_OF_STRING_TO_STRING}, - "disableExecuteApiEndpoint": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "rootResourceId": {"target": STRING}, - "securityPolicy": {"target": SECURITY_POLICY}, - "endpointAccessMode": {"target": ENDPOINT_ACCESS_MODE}, - "apiStatus": {"target": API_STATUS}, - "apiStatusMessage": {"target": STRING}, - }, -) - -GET_REST_API = Schema( - id=ShapeID("com.amazonaws.apigateway#GetRestApi"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/restapis/{restApiId}", "code": 200} - ), - ) - ], -) - -GET_REST_APIS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetRestApisInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GetRestApisRequest", - ) - ], - members={ - "position": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="position")], - }, - "limit": { - "target": NULLABLE_INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="limit")], - }, - }, -) - -REST_API = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#RestApi"), - members={ - "id": {"target": STRING}, - "name": {"target": STRING}, - "description": {"target": STRING}, - "createdDate": {"target": TIMESTAMP}, - "version": {"target": STRING}, - "warnings": {"target": LIST_OF_STRING}, - "binaryMediaTypes": {"target": LIST_OF_STRING}, - "minimumCompressionSize": {"target": NULLABLE_INTEGER}, - "apiKeySource": {"target": API_KEY_SOURCE_TYPE}, - "endpointConfiguration": {"target": ENDPOINT_CONFIGURATION}, - "policy": {"target": STRING}, - "tags": {"target": MAP_OF_STRING_TO_STRING}, - "disableExecuteApiEndpoint": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "rootResourceId": {"target": STRING}, - "securityPolicy": {"target": SECURITY_POLICY}, - "endpointAccessMode": {"target": ENDPOINT_ACCESS_MODE}, - "apiStatus": {"target": API_STATUS}, - "apiStatusMessage": {"target": STRING}, - }, -) - -LIST_OF_REST_API = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#ListOfRestApi"), - shape_type=ShapeType.LIST, - members={"member": {"target": REST_API}}, -) - -GET_REST_APIS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetRestApisOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#RestApis", - ) - ], - members={ - "items": { - "target": LIST_OF_REST_API, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="item")], - }, - "position": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="position")], - }, - }, -) - -GET_REST_APIS = Schema( - id=ShapeID("com.amazonaws.apigateway#GetRestApis"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType({"method": "GET", "uri": "/restapis", "code": 200}), - ) - ], -) - -GET_SDK_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetSdkInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GetSdkRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "stageName": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "sdkType": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "parameters": { - "target": MAP_OF_STRING_TO_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQueryParams"))], - }, - }, -) - -GET_SDK_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetSdkOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#SdkResponse", - ) - ], - members={ - "contentType": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="Content-Type") - ], - }, - "contentDisposition": { - "target": STRING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), value="Content-Disposition" - ) - ], - }, - "body": { - "target": BLOB, - "traits": [Trait.new(id=ShapeID("smithy.api#httpPayload"))], - }, - }, -) - -GET_SDK = Schema( - id=ShapeID("com.amazonaws.apigateway#GetSdk"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/restapis/{restApiId}/stages/{stageName}/sdks/{sdkType}", - "code": 200, - } - ), - ) - ], -) - -GET_SDK_TYPE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetSdkTypeInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GetSdkTypeRequest", - ) - ], - members={ - "id": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -SDK_CONFIGURATION_PROPERTY = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#SdkConfigurationProperty"), - members={ - "name": {"target": STRING}, - "friendlyName": {"target": STRING}, - "description": {"target": STRING}, - "required": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "defaultValue": {"target": STRING}, - }, -) - -LIST_OF_SDK_CONFIGURATION_PROPERTY = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#ListOfSdkConfigurationProperty"), - shape_type=ShapeType.LIST, - members={"member": {"target": SDK_CONFIGURATION_PROPERTY}}, -) - -GET_SDK_TYPE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetSdkTypeOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#SdkType", - ) - ], - members={ - "id": {"target": STRING}, - "friendlyName": {"target": STRING}, - "description": {"target": STRING}, - "configurationProperties": {"target": LIST_OF_SDK_CONFIGURATION_PROPERTY}, - }, -) - -GET_SDK_TYPE = Schema( - id=ShapeID("com.amazonaws.apigateway#GetSdkType"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/sdktypes/{id}", "code": 200} - ), - ) - ], -) - -GET_SDK_TYPES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetSdkTypesInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GetSdkTypesRequest", - ) - ], - members={ - "position": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="position")], - }, - "limit": { - "target": NULLABLE_INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="limit")], - }, - }, -) - -SDK_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#SdkType"), - members={ - "id": {"target": STRING}, - "friendlyName": {"target": STRING}, - "description": {"target": STRING}, - "configurationProperties": {"target": LIST_OF_SDK_CONFIGURATION_PROPERTY}, - }, -) - -LIST_OF_SDK_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#ListOfSdkType"), - shape_type=ShapeType.LIST, - members={"member": {"target": SDK_TYPE}}, -) - -GET_SDK_TYPES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetSdkTypesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#SdkTypes", - ) - ], - members={ - "items": { - "target": LIST_OF_SDK_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="item")], - } - }, -) - -GET_SDK_TYPES = Schema( - id=ShapeID("com.amazonaws.apigateway#GetSdkTypes"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType({"method": "GET", "uri": "/sdktypes", "code": 200}), - ) - ], -) - -GET_STAGE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetStageInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GetStageRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "stageName": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -GET_STAGE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetStageOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#Stage", - ) - ], - members={ - "deploymentId": {"target": STRING}, - "clientCertificateId": {"target": STRING}, - "stageName": {"target": STRING}, - "description": {"target": STRING}, - "cacheClusterEnabled": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "cacheClusterSize": {"target": CACHE_CLUSTER_SIZE}, - "cacheClusterStatus": {"target": CACHE_CLUSTER_STATUS}, - "methodSettings": {"target": MAP_OF_METHOD_SETTINGS}, - "variables": {"target": MAP_OF_STRING_TO_STRING}, - "documentationVersion": {"target": STRING}, - "accessLogSettings": {"target": ACCESS_LOG_SETTINGS}, - "canarySettings": {"target": CANARY_SETTINGS}, - "tracingEnabled": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "webAclArn": {"target": STRING}, - "tags": {"target": MAP_OF_STRING_TO_STRING}, - "createdDate": {"target": TIMESTAMP}, - "lastUpdatedDate": {"target": TIMESTAMP}, - }, -) - -GET_STAGE = Schema( - id=ShapeID("com.amazonaws.apigateway#GetStage"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/restapis/{restApiId}/stages/{stageName}", - "code": 200, - } - ), - ) - ], -) - -GET_STAGES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetStagesInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GetStagesRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "deploymentId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="deploymentId") - ], - }, - }, -) - -STAGE = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#Stage"), - members={ - "deploymentId": {"target": STRING}, - "clientCertificateId": {"target": STRING}, - "stageName": {"target": STRING}, - "description": {"target": STRING}, - "cacheClusterEnabled": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "cacheClusterSize": {"target": CACHE_CLUSTER_SIZE}, - "cacheClusterStatus": {"target": CACHE_CLUSTER_STATUS}, - "methodSettings": {"target": MAP_OF_METHOD_SETTINGS}, - "variables": {"target": MAP_OF_STRING_TO_STRING}, - "documentationVersion": {"target": STRING}, - "accessLogSettings": {"target": ACCESS_LOG_SETTINGS}, - "canarySettings": {"target": CANARY_SETTINGS}, - "tracingEnabled": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "webAclArn": {"target": STRING}, - "tags": {"target": MAP_OF_STRING_TO_STRING}, - "createdDate": {"target": TIMESTAMP}, - "lastUpdatedDate": {"target": TIMESTAMP}, - }, -) - -LIST_OF_STAGE = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#ListOfStage"), - shape_type=ShapeType.LIST, - members={"member": {"target": STAGE}}, -) - -GET_STAGES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetStagesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#Stages", - ) - ], - members={"item": {"target": LIST_OF_STAGE}}, -) - -GET_STAGES = Schema( - id=ShapeID("com.amazonaws.apigateway#GetStages"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/restapis/{restApiId}/stages", "code": 200} - ), - ) - ], -) - -GET_TAGS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetTagsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GetTagsRequest", - ) - ], - members={ - "resourceArn": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "position": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="position")], - }, - "limit": { - "target": NULLABLE_INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="limit")], - }, - }, -) - -GET_TAGS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetTagsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#Tags", - ) - ], - members={"tags": {"target": MAP_OF_STRING_TO_STRING}}, -) - -GET_TAGS = Schema( - id=ShapeID("com.amazonaws.apigateway#GetTags"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/tags/{resourceArn}", "code": 200} - ), - ) - ], -) - -GET_USAGE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetUsageInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GetUsageRequest", - ) - ], - members={ - "usagePlanId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "keyId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="keyId")], - }, - "startDate": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="startDate"), - ], - }, - "endDate": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="endDate"), - ], - }, - "position": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="position")], - }, - "limit": { - "target": NULLABLE_INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="limit")], - }, - }, -) - -LONG = Schema( - id=ShapeID("com.amazonaws.apigateway#Long"), - shape_type=ShapeType.LONG, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=0)], -) - -LIST_OF_LONG = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#ListOfLong"), - shape_type=ShapeType.LIST, - members={"member": {"target": LONG}}, -) - -LIST_OF_USAGE = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#ListOfUsage"), - shape_type=ShapeType.LIST, - members={"member": {"target": LIST_OF_LONG}}, -) - -MAP_OF_KEY_USAGES = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#MapOfKeyUsages"), - shape_type=ShapeType.MAP, - members={"key": {"target": STRING}, "value": {"target": LIST_OF_USAGE}}, -) - -GET_USAGE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetUsageOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#Usage", - ) - ], - members={ - "usagePlanId": {"target": STRING}, - "startDate": {"target": STRING}, - "endDate": {"target": STRING}, - "items": { - "target": MAP_OF_KEY_USAGES, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="values")], - }, - "position": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="position")], - }, - }, -) - -GET_USAGE = Schema( - id=ShapeID("com.amazonaws.apigateway#GetUsage"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/usageplans/{usagePlanId}/usage", "code": 200} - ), - ) - ], -) - -GET_USAGE_PLAN_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetUsagePlanInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GetUsagePlanRequest", - ) - ], - members={ - "usagePlanId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -GET_USAGE_PLAN_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetUsagePlanOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#UsagePlan", - ) - ], - members={ - "id": {"target": STRING}, - "name": {"target": STRING}, - "description": {"target": STRING}, - "apiStages": {"target": LIST_OF_API_STAGE}, - "throttle": {"target": THROTTLE_SETTINGS}, - "quota": {"target": QUOTA_SETTINGS}, - "productCode": {"target": STRING}, - "tags": {"target": MAP_OF_STRING_TO_STRING}, - }, -) - -GET_USAGE_PLAN = Schema( - id=ShapeID("com.amazonaws.apigateway#GetUsagePlan"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/usageplans/{usagePlanId}", "code": 200} - ), - ) - ], -) - -GET_USAGE_PLAN_KEY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetUsagePlanKeyInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GetUsagePlanKeyRequest", - ) - ], - members={ - "usagePlanId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "keyId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -GET_USAGE_PLAN_KEY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetUsagePlanKeyOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#UsagePlanKey", - ) - ], - members={ - "id": {"target": STRING}, - "type": {"target": STRING}, - "value": {"target": STRING}, - "name": {"target": STRING}, - }, -) - -GET_USAGE_PLAN_KEY = Schema( - id=ShapeID("com.amazonaws.apigateway#GetUsagePlanKey"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/usageplans/{usagePlanId}/keys/{keyId}", - "code": 200, - } - ), - ) - ], -) - -GET_USAGE_PLAN_KEYS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetUsagePlanKeysInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GetUsagePlanKeysRequest", - ) - ], - members={ - "usagePlanId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "position": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="position")], - }, - "limit": { - "target": NULLABLE_INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="limit")], - }, - "nameQuery": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="name")], - }, - }, -) - -USAGE_PLAN_KEY = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#UsagePlanKey"), - members={ - "id": {"target": STRING}, - "type": {"target": STRING}, - "value": {"target": STRING}, - "name": {"target": STRING}, - }, -) - -LIST_OF_USAGE_PLAN_KEY = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#ListOfUsagePlanKey"), - shape_type=ShapeType.LIST, - members={"member": {"target": USAGE_PLAN_KEY}}, -) - -GET_USAGE_PLAN_KEYS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetUsagePlanKeysOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#UsagePlanKeys", - ) - ], - members={ - "items": { - "target": LIST_OF_USAGE_PLAN_KEY, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="item")], - }, - "position": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="position")], - }, - }, -) - -GET_USAGE_PLAN_KEYS = Schema( - id=ShapeID("com.amazonaws.apigateway#GetUsagePlanKeys"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/usageplans/{usagePlanId}/keys", "code": 200} - ), - ) - ], -) - -GET_USAGE_PLANS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetUsagePlansInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GetUsagePlansRequest", - ) - ], - members={ - "position": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="position")], - }, - "keyId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="keyId")], - }, - "limit": { - "target": NULLABLE_INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="limit")], - }, - }, -) - -USAGE_PLAN = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#UsagePlan"), - members={ - "id": {"target": STRING}, - "name": {"target": STRING}, - "description": {"target": STRING}, - "apiStages": {"target": LIST_OF_API_STAGE}, - "throttle": {"target": THROTTLE_SETTINGS}, - "quota": {"target": QUOTA_SETTINGS}, - "productCode": {"target": STRING}, - "tags": {"target": MAP_OF_STRING_TO_STRING}, - }, -) - -LIST_OF_USAGE_PLAN = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#ListOfUsagePlan"), - shape_type=ShapeType.LIST, - members={"member": {"target": USAGE_PLAN}}, -) - -GET_USAGE_PLANS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetUsagePlansOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#UsagePlans", - ) - ], - members={ - "items": { - "target": LIST_OF_USAGE_PLAN, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="item")], - }, - "position": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="position")], - }, - }, -) - -GET_USAGE_PLANS = Schema( - id=ShapeID("com.amazonaws.apigateway#GetUsagePlans"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/usageplans", "code": 200} - ), - ) - ], -) - -GET_VPC_LINK_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetVpcLinkInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GetVpcLinkRequest", - ) - ], - members={ - "vpcLinkId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -GET_VPC_LINK_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetVpcLinkOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#VpcLink", - ) - ], - members={ - "id": {"target": STRING}, - "name": {"target": STRING}, - "description": {"target": STRING}, - "targetArns": {"target": LIST_OF_STRING}, - "status": {"target": VPC_LINK_STATUS}, - "statusMessage": {"target": STRING}, - "tags": {"target": MAP_OF_STRING_TO_STRING}, - }, -) - -GET_VPC_LINK = Schema( - id=ShapeID("com.amazonaws.apigateway#GetVpcLink"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/vpclinks/{vpcLinkId}", "code": 200} - ), - ) - ], -) - -GET_VPC_LINKS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetVpcLinksInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GetVpcLinksRequest", - ) - ], - members={ - "position": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="position")], - }, - "limit": { - "target": NULLABLE_INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="limit")], - }, - }, -) - -VPC_LINK = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#VpcLink"), - members={ - "id": {"target": STRING}, - "name": {"target": STRING}, - "description": {"target": STRING}, - "targetArns": {"target": LIST_OF_STRING}, - "status": {"target": VPC_LINK_STATUS}, - "statusMessage": {"target": STRING}, - "tags": {"target": MAP_OF_STRING_TO_STRING}, - }, -) - -LIST_OF_VPC_LINK = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#ListOfVpcLink"), - shape_type=ShapeType.LIST, - members={"member": {"target": VPC_LINK}}, -) - -GET_VPC_LINKS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#GetVpcLinksOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#VpcLinks", - ) - ], - members={ - "items": { - "target": LIST_OF_VPC_LINK, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="item")], - }, - "position": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="position")], - }, - }, -) - -GET_VPC_LINKS = Schema( - id=ShapeID("com.amazonaws.apigateway#GetVpcLinks"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType({"method": "GET", "uri": "/vpclinks", "code": 200}), - ) - ], -) - -IMPORT_API_KEYS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#ImportApiKeysInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#ImportApiKeysRequest", - ) - ], - members={ - "body": { - "target": BLOB, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpPayload")), - ], - }, - "format": { - "target": API_KEYS_FORMAT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="format"), - ], - }, - "failOnWarnings": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=False), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="failonwarnings"), - ], - }, - }, -) - -IMPORT_API_KEYS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#ImportApiKeysOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#ApiKeyIds", - ) - ], - members={"ids": {"target": LIST_OF_STRING}, "warnings": {"target": LIST_OF_STRING}}, -) - -IMPORT_API_KEYS = Schema( - id=ShapeID("com.amazonaws.apigateway#ImportApiKeys"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/apikeys?mode=import", "code": 201} - ), - ) - ], -) - -PUT_MODE = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#PutMode"), - shape_type=ShapeType.ENUM, - members={"Merge": {"target": UNIT}, "Overwrite": {"target": UNIT}}, -) - -IMPORT_DOCUMENTATION_PARTS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#ImportDocumentationPartsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#ImportDocumentationPartsRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "mode": { - "target": PUT_MODE, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="mode")], - }, - "failOnWarnings": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=False), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="failonwarnings"), - ], - }, - "body": { - "target": BLOB, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpPayload")), - ], - }, - }, -) - -IMPORT_DOCUMENTATION_PARTS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#ImportDocumentationPartsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#DocumentationPartIds", - ) - ], - members={"ids": {"target": LIST_OF_STRING}, "warnings": {"target": LIST_OF_STRING}}, -) - -IMPORT_DOCUMENTATION_PARTS = Schema( - id=ShapeID("com.amazonaws.apigateway#ImportDocumentationParts"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PUT", - "uri": "/restapis/{restApiId}/documentation/parts", - "code": 200, - } - ), - ) - ], -) - -IMPORT_REST_API_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#ImportRestApiInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#ImportRestApiRequest", - ) - ], - members={ - "failOnWarnings": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=False), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="failonwarnings"), - ], - }, - "parameters": { - "target": MAP_OF_STRING_TO_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQueryParams"))], - }, - "body": { - "target": BLOB, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpPayload")), - ], - }, - }, -) - -IMPORT_REST_API_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#ImportRestApiOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#RestApi", - ) - ], - members={ - "id": {"target": STRING}, - "name": {"target": STRING}, - "description": {"target": STRING}, - "createdDate": {"target": TIMESTAMP}, - "version": {"target": STRING}, - "warnings": {"target": LIST_OF_STRING}, - "binaryMediaTypes": {"target": LIST_OF_STRING}, - "minimumCompressionSize": {"target": NULLABLE_INTEGER}, - "apiKeySource": {"target": API_KEY_SOURCE_TYPE}, - "endpointConfiguration": {"target": ENDPOINT_CONFIGURATION}, - "policy": {"target": STRING}, - "tags": {"target": MAP_OF_STRING_TO_STRING}, - "disableExecuteApiEndpoint": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "rootResourceId": {"target": STRING}, - "securityPolicy": {"target": SECURITY_POLICY}, - "endpointAccessMode": {"target": ENDPOINT_ACCESS_MODE}, - "apiStatus": {"target": API_STATUS}, - "apiStatusMessage": {"target": STRING}, - }, -) - -IMPORT_REST_API = Schema( - id=ShapeID("com.amazonaws.apigateway#ImportRestApi"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/restapis?mode=import", "code": 201} - ), - ) - ], -) - -PUT_GATEWAY_RESPONSE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#PutGatewayResponseInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#PutGatewayResponseRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "responseType": { - "target": GATEWAY_RESPONSE_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "statusCode": {"target": STATUS_CODE}, - "responseParameters": {"target": MAP_OF_STRING_TO_STRING}, - "responseTemplates": {"target": MAP_OF_STRING_TO_STRING}, - }, -) - -PUT_GATEWAY_RESPONSE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#PutGatewayResponseOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GatewayResponse", - ) - ], - members={ - "responseType": {"target": GATEWAY_RESPONSE_TYPE}, - "statusCode": {"target": STATUS_CODE}, - "responseParameters": {"target": MAP_OF_STRING_TO_STRING}, - "responseTemplates": {"target": MAP_OF_STRING_TO_STRING}, - "defaultResponse": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - }, -) - -PUT_GATEWAY_RESPONSE = Schema( - id=ShapeID("com.amazonaws.apigateway#PutGatewayResponse"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PUT", - "uri": "/restapis/{restApiId}/gatewayresponses/{responseType}", - "code": 201, - } - ), - ) - ], -) - -PUT_INTEGRATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#PutIntegrationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#PutIntegrationRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "resourceId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "httpMethod": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="requestHttpMethod"), - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "type": { - "target": INTEGRATION_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "integrationHttpMethod": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="httpMethod") - ], - }, - "uri": {"target": STRING}, - "connectionType": {"target": CONNECTION_TYPE}, - "connectionId": {"target": STRING}, - "credentials": {"target": STRING}, - "requestParameters": {"target": MAP_OF_STRING_TO_STRING}, - "requestTemplates": {"target": MAP_OF_STRING_TO_STRING}, - "passthroughBehavior": {"target": STRING}, - "cacheNamespace": {"target": STRING}, - "cacheKeyParameters": {"target": LIST_OF_STRING}, - "contentHandling": {"target": CONTENT_HANDLING_STRATEGY}, - "timeoutInMillis": {"target": NULLABLE_INTEGER}, - "tlsConfig": {"target": TLS_CONFIG}, - "responseTransferMode": {"target": RESPONSE_TRANSFER_MODE}, - "integrationTarget": {"target": STRING}, - }, -) - -PUT_INTEGRATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#PutIntegrationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#Integration", - ) - ], - members={ - "type": {"target": INTEGRATION_TYPE}, - "httpMethod": {"target": STRING}, - "uri": {"target": STRING}, - "connectionType": {"target": CONNECTION_TYPE}, - "connectionId": {"target": STRING}, - "credentials": {"target": STRING}, - "requestParameters": {"target": MAP_OF_STRING_TO_STRING}, - "requestTemplates": {"target": MAP_OF_STRING_TO_STRING}, - "passthroughBehavior": {"target": STRING}, - "contentHandling": {"target": CONTENT_HANDLING_STRATEGY}, - "timeoutInMillis": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "cacheNamespace": {"target": STRING}, - "cacheKeyParameters": {"target": LIST_OF_STRING}, - "integrationResponses": {"target": MAP_OF_INTEGRATION_RESPONSE}, - "tlsConfig": {"target": TLS_CONFIG}, - "responseTransferMode": {"target": RESPONSE_TRANSFER_MODE}, - "integrationTarget": {"target": STRING}, - }, -) - -PUT_INTEGRATION = Schema( - id=ShapeID("com.amazonaws.apigateway#PutIntegration"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PUT", - "uri": "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}/integration", - "code": 201, - } - ), - ) - ], -) - -PUT_INTEGRATION_RESPONSE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#PutIntegrationResponseInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#PutIntegrationResponseRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "resourceId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "httpMethod": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "statusCode": { - "target": STATUS_CODE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "selectionPattern": {"target": STRING}, - "responseParameters": {"target": MAP_OF_STRING_TO_STRING}, - "responseTemplates": {"target": MAP_OF_STRING_TO_STRING}, - "contentHandling": {"target": CONTENT_HANDLING_STRATEGY}, - }, -) - -PUT_INTEGRATION_RESPONSE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#PutIntegrationResponseOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#IntegrationResponse", - ) - ], - members={ - "statusCode": {"target": STATUS_CODE}, - "selectionPattern": {"target": STRING}, - "responseParameters": {"target": MAP_OF_STRING_TO_STRING}, - "responseTemplates": {"target": MAP_OF_STRING_TO_STRING}, - "contentHandling": {"target": CONTENT_HANDLING_STRATEGY}, - }, -) - -PUT_INTEGRATION_RESPONSE = Schema( - id=ShapeID("com.amazonaws.apigateway#PutIntegrationResponse"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PUT", - "uri": "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}/integration/responses/{statusCode}", - "code": 201, - } - ), - ) - ], -) - -PUT_METHOD_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#PutMethodInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#PutMethodRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "resourceId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "httpMethod": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "authorizationType": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "authorizerId": {"target": STRING}, - "apiKeyRequired": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "operationName": {"target": STRING}, - "requestParameters": {"target": MAP_OF_STRING_TO_BOOLEAN}, - "requestModels": {"target": MAP_OF_STRING_TO_STRING}, - "requestValidatorId": {"target": STRING}, - "authorizationScopes": {"target": LIST_OF_STRING}, - }, -) - -PUT_METHOD_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#PutMethodOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#Method", - ) - ], - members={ - "httpMethod": {"target": STRING}, - "authorizationType": {"target": STRING}, - "authorizerId": {"target": STRING}, - "apiKeyRequired": {"target": NULLABLE_BOOLEAN}, - "requestValidatorId": {"target": STRING}, - "operationName": {"target": STRING}, - "requestParameters": {"target": MAP_OF_STRING_TO_BOOLEAN}, - "requestModels": {"target": MAP_OF_STRING_TO_STRING}, - "methodResponses": {"target": MAP_OF_METHOD_RESPONSE}, - "methodIntegration": {"target": INTEGRATION}, - "authorizationScopes": {"target": LIST_OF_STRING}, - }, -) - -PUT_METHOD = Schema( - id=ShapeID("com.amazonaws.apigateway#PutMethod"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PUT", - "uri": "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}", - "code": 201, - } - ), - ) - ], -) - -PUT_METHOD_RESPONSE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#PutMethodResponseInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#PutMethodResponseRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "resourceId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "httpMethod": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "statusCode": { - "target": STATUS_CODE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "responseParameters": {"target": MAP_OF_STRING_TO_BOOLEAN}, - "responseModels": {"target": MAP_OF_STRING_TO_STRING}, - }, -) - -PUT_METHOD_RESPONSE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#PutMethodResponseOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#MethodResponse", - ) - ], - members={ - "statusCode": {"target": STATUS_CODE}, - "responseParameters": {"target": MAP_OF_STRING_TO_BOOLEAN}, - "responseModels": {"target": MAP_OF_STRING_TO_STRING}, - }, -) - -PUT_METHOD_RESPONSE = Schema( - id=ShapeID("com.amazonaws.apigateway#PutMethodResponse"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PUT", - "uri": "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}/responses/{statusCode}", - "code": 201, - } - ), - ) - ], -) - -PUT_REST_API_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#PutRestApiInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#PutRestApiRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "mode": { - "target": PUT_MODE, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="mode")], - }, - "failOnWarnings": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=False), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="failonwarnings"), - ], - }, - "parameters": { - "target": MAP_OF_STRING_TO_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQueryParams"))], - }, - "body": { - "target": BLOB, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpPayload")), - ], - }, - }, -) - -PUT_REST_API_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#PutRestApiOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#RestApi", - ) - ], - members={ - "id": {"target": STRING}, - "name": {"target": STRING}, - "description": {"target": STRING}, - "createdDate": {"target": TIMESTAMP}, - "version": {"target": STRING}, - "warnings": {"target": LIST_OF_STRING}, - "binaryMediaTypes": {"target": LIST_OF_STRING}, - "minimumCompressionSize": {"target": NULLABLE_INTEGER}, - "apiKeySource": {"target": API_KEY_SOURCE_TYPE}, - "endpointConfiguration": {"target": ENDPOINT_CONFIGURATION}, - "policy": {"target": STRING}, - "tags": {"target": MAP_OF_STRING_TO_STRING}, - "disableExecuteApiEndpoint": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "rootResourceId": {"target": STRING}, - "securityPolicy": {"target": SECURITY_POLICY}, - "endpointAccessMode": {"target": ENDPOINT_ACCESS_MODE}, - "apiStatus": {"target": API_STATUS}, - "apiStatusMessage": {"target": STRING}, - }, -) - -PUT_REST_API = Schema( - id=ShapeID("com.amazonaws.apigateway#PutRestApi"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "PUT", "uri": "/restapis/{restApiId}", "code": 200} - ), - ) - ], -) - -REJECT_DOMAIN_NAME_ACCESS_ASSOCIATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#RejectDomainNameAccessAssociationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#RejectDomainNameAccessAssociationRequest", - ) - ], - members={ - "domainNameAccessAssociationArn": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new( - id=ShapeID("smithy.api#httpQuery"), - value="domainNameAccessAssociationArn", - ), - ], - }, - "domainNameArn": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="domainNameArn"), - ], - }, - }, -) - -REJECT_DOMAIN_NAME_ACCESS_ASSOCIATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#RejectDomainNameAccessAssociationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -REJECT_DOMAIN_NAME_ACCESS_ASSOCIATION = Schema( - id=ShapeID("com.amazonaws.apigateway#RejectDomainNameAccessAssociation"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/rejectdomainnameaccessassociations", - "code": 202, - } - ), - ) - ], -) - -TAG_RESOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#TagResourceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#TagResourceRequest", - ) - ], - members={ - "resourceArn": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "tags": { - "target": MAP_OF_STRING_TO_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -TAG_RESOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#TagResourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -TAG_RESOURCE = Schema( - id=ShapeID("com.amazonaws.apigateway#TagResource"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "PUT", "uri": "/tags/{resourceArn}", "code": 204} - ), - ) - ], -) - -MAP_OF_STRING_TO_LIST = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#MapOfStringToList"), - shape_type=ShapeType.MAP, - members={"key": {"target": STRING}, "value": {"target": LIST_OF_STRING}}, -) - -TEST_INVOKE_AUTHORIZER_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#TestInvokeAuthorizerInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#TestInvokeAuthorizerRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "authorizerId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "headers": {"target": MAP_OF_STRING_TO_STRING}, - "multiValueHeaders": {"target": MAP_OF_STRING_TO_LIST}, - "pathWithQueryString": {"target": STRING}, - "body": {"target": STRING}, - "stageVariables": {"target": MAP_OF_STRING_TO_STRING}, - "additionalContext": {"target": MAP_OF_STRING_TO_STRING}, - }, -) - -TEST_INVOKE_AUTHORIZER_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#TestInvokeAuthorizerOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#TestInvokeAuthorizerResponse", - ) - ], - members={ - "clientStatus": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "log": {"target": STRING}, - "latency": { - "target": LONG, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "principalId": {"target": STRING}, - "policy": {"target": STRING}, - "authorization": {"target": MAP_OF_STRING_TO_LIST}, - "claims": {"target": MAP_OF_STRING_TO_STRING}, - }, -) - -TEST_INVOKE_AUTHORIZER = Schema( - id=ShapeID("com.amazonaws.apigateway#TestInvokeAuthorizer"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/restapis/{restApiId}/authorizers/{authorizerId}", - "code": 200, - } - ), - ) - ], -) - -TEST_INVOKE_METHOD_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#TestInvokeMethodInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#TestInvokeMethodRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "resourceId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "httpMethod": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "pathWithQueryString": {"target": STRING}, - "body": {"target": STRING}, - "headers": {"target": MAP_OF_STRING_TO_STRING}, - "multiValueHeaders": {"target": MAP_OF_STRING_TO_LIST}, - "clientCertificateId": {"target": STRING}, - "stageVariables": {"target": MAP_OF_STRING_TO_STRING}, - }, -) - -TEST_INVOKE_METHOD_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#TestInvokeMethodOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#TestInvokeMethodResponse", - ) - ], - members={ - "status": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "body": {"target": STRING}, - "headers": {"target": MAP_OF_STRING_TO_STRING}, - "multiValueHeaders": {"target": MAP_OF_STRING_TO_LIST}, - "log": {"target": STRING}, - "latency": { - "target": LONG, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - }, -) - -TEST_INVOKE_METHOD = Schema( - id=ShapeID("com.amazonaws.apigateway#TestInvokeMethod"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}", - "code": 200, - } - ), - ) - ], -) - -UNTAG_RESOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#UntagResourceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#UntagResourceRequest", - ) - ], - members={ - "resourceArn": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "tagKeys": { - "target": LIST_OF_STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="tagKeys"), - ], - }, - }, -) - -UNTAG_RESOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#UntagResourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -UNTAG_RESOURCE = Schema( - id=ShapeID("com.amazonaws.apigateway#UntagResource"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "DELETE", "uri": "/tags/{resourceArn}", "code": 204} - ), - ) - ], -) - -OP = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#Op"), - shape_type=ShapeType.ENUM, - members={ - "add": {"target": UNIT}, - "remove": {"target": UNIT}, - "replace": {"target": UNIT}, - "move": {"target": UNIT}, - "copy": {"target": UNIT}, - "test": {"target": UNIT}, - }, -) - -PATCH_OPERATION = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#PatchOperation"), - members={ - "op": {"target": OP}, - "path": {"target": STRING}, - "value": {"target": STRING}, - "from": {"target": STRING}, - }, -) - -LIST_OF_PATCH_OPERATION = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#ListOfPatchOperation"), - shape_type=ShapeType.LIST, - members={"member": {"target": PATCH_OPERATION}}, -) - -UPDATE_ACCOUNT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#UpdateAccountInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#UpdateAccountRequest", - ) - ], - members={"patchOperations": {"target": LIST_OF_PATCH_OPERATION}}, -) - -UPDATE_ACCOUNT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#UpdateAccountOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#Account", - ) - ], - members={ - "cloudwatchRoleArn": {"target": STRING}, - "throttleSettings": {"target": THROTTLE_SETTINGS}, - "features": {"target": LIST_OF_STRING}, - "apiKeyVersion": {"target": STRING}, - }, -) - -UPDATE_ACCOUNT = Schema( - id=ShapeID("com.amazonaws.apigateway#UpdateAccount"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType({"method": "PATCH", "uri": "/account", "code": 200}), - ) - ], -) - -UPDATE_API_KEY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#UpdateApiKeyInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#UpdateApiKeyRequest", - ) - ], - members={ - "apiKey": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "patchOperations": {"target": LIST_OF_PATCH_OPERATION}, - }, -) - -UPDATE_API_KEY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#UpdateApiKeyOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#ApiKey", - ) - ], - members={ - "id": {"target": STRING}, - "value": {"target": STRING}, - "name": {"target": STRING}, - "customerId": {"target": STRING}, - "description": {"target": STRING}, - "enabled": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "createdDate": {"target": TIMESTAMP}, - "lastUpdatedDate": {"target": TIMESTAMP}, - "stageKeys": {"target": LIST_OF_STRING}, - "tags": {"target": MAP_OF_STRING_TO_STRING}, - }, -) - -UPDATE_API_KEY = Schema( - id=ShapeID("com.amazonaws.apigateway#UpdateApiKey"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "PATCH", "uri": "/apikeys/{apiKey}", "code": 200} - ), - ) - ], -) - -UPDATE_AUTHORIZER_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#UpdateAuthorizerInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#UpdateAuthorizerRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "authorizerId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "patchOperations": {"target": LIST_OF_PATCH_OPERATION}, - }, -) - -UPDATE_AUTHORIZER_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#UpdateAuthorizerOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#Authorizer", - ) - ], - members={ - "id": {"target": STRING}, - "name": {"target": STRING}, - "type": {"target": AUTHORIZER_TYPE}, - "providerARNs": {"target": LIST_OF_AR_NS}, - "authType": {"target": STRING}, - "authorizerUri": {"target": STRING}, - "authorizerCredentials": {"target": STRING}, - "identitySource": {"target": STRING}, - "identityValidationExpression": {"target": STRING}, - "authorizerResultTtlInSeconds": {"target": NULLABLE_INTEGER}, - }, -) - -UPDATE_AUTHORIZER = Schema( - id=ShapeID("com.amazonaws.apigateway#UpdateAuthorizer"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PATCH", - "uri": "/restapis/{restApiId}/authorizers/{authorizerId}", - "code": 200, - } - ), - ) - ], -) - -UPDATE_BASE_PATH_MAPPING_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#UpdateBasePathMappingInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#UpdateBasePathMappingRequest", - ) - ], - members={ - "domainName": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "domainNameId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="domainNameId") - ], - }, - "basePath": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "patchOperations": {"target": LIST_OF_PATCH_OPERATION}, - }, -) - -UPDATE_BASE_PATH_MAPPING_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#UpdateBasePathMappingOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#BasePathMapping", - ) - ], - members={ - "basePath": {"target": STRING}, - "restApiId": {"target": STRING}, - "stage": {"target": STRING}, - }, -) - -UPDATE_BASE_PATH_MAPPING = Schema( - id=ShapeID("com.amazonaws.apigateway#UpdateBasePathMapping"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PATCH", - "uri": "/domainnames/{domainName}/basepathmappings/{basePath}", - "code": 200, - } - ), - ) - ], -) - -UPDATE_CLIENT_CERTIFICATE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#UpdateClientCertificateInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#UpdateClientCertificateRequest", - ) - ], - members={ - "clientCertificateId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "patchOperations": {"target": LIST_OF_PATCH_OPERATION}, - }, -) - -UPDATE_CLIENT_CERTIFICATE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#UpdateClientCertificateOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#ClientCertificate", - ) - ], - members={ - "clientCertificateId": {"target": STRING}, - "description": {"target": STRING}, - "pemEncodedCertificate": {"target": STRING}, - "createdDate": {"target": TIMESTAMP}, - "expirationDate": {"target": TIMESTAMP}, - "tags": {"target": MAP_OF_STRING_TO_STRING}, - }, -) - -UPDATE_CLIENT_CERTIFICATE = Schema( - id=ShapeID("com.amazonaws.apigateway#UpdateClientCertificate"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PATCH", - "uri": "/clientcertificates/{clientCertificateId}", - "code": 200, - } - ), - ) - ], -) - -UPDATE_DEPLOYMENT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#UpdateDeploymentInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#UpdateDeploymentRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "deploymentId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "patchOperations": {"target": LIST_OF_PATCH_OPERATION}, - }, -) - -UPDATE_DEPLOYMENT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#UpdateDeploymentOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#Deployment", - ) - ], - members={ - "id": {"target": STRING}, - "description": {"target": STRING}, - "createdDate": {"target": TIMESTAMP}, - "apiSummary": {"target": PATH_TO_MAP_OF_METHOD_SNAPSHOT}, - }, -) - -UPDATE_DEPLOYMENT = Schema( - id=ShapeID("com.amazonaws.apigateway#UpdateDeployment"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PATCH", - "uri": "/restapis/{restApiId}/deployments/{deploymentId}", - "code": 200, - } - ), - ) - ], -) - -UPDATE_DOCUMENTATION_PART_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#UpdateDocumentationPartInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#UpdateDocumentationPartRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "documentationPartId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "patchOperations": {"target": LIST_OF_PATCH_OPERATION}, - }, -) - -UPDATE_DOCUMENTATION_PART_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#UpdateDocumentationPartOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#DocumentationPart", - ) - ], - members={ - "id": {"target": STRING}, - "location": {"target": DOCUMENTATION_PART_LOCATION}, - "properties": {"target": STRING}, - }, -) - -UPDATE_DOCUMENTATION_PART = Schema( - id=ShapeID("com.amazonaws.apigateway#UpdateDocumentationPart"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PATCH", - "uri": "/restapis/{restApiId}/documentation/parts/{documentationPartId}", - "code": 200, - } - ), - ) - ], -) - -UPDATE_DOCUMENTATION_VERSION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#UpdateDocumentationVersionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#UpdateDocumentationVersionRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "documentationVersion": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "patchOperations": {"target": LIST_OF_PATCH_OPERATION}, - }, -) - -UPDATE_DOCUMENTATION_VERSION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#UpdateDocumentationVersionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#DocumentationVersion", - ) - ], - members={ - "version": {"target": STRING}, - "createdDate": {"target": TIMESTAMP}, - "description": {"target": STRING}, - }, -) - -UPDATE_DOCUMENTATION_VERSION = Schema( - id=ShapeID("com.amazonaws.apigateway#UpdateDocumentationVersion"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PATCH", - "uri": "/restapis/{restApiId}/documentation/versions/{documentationVersion}", - "code": 200, - } - ), - ) - ], -) - -UPDATE_DOMAIN_NAME_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#UpdateDomainNameInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#UpdateDomainNameRequest", - ) - ], - members={ - "domainName": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "domainNameId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="domainNameId") - ], - }, - "patchOperations": {"target": LIST_OF_PATCH_OPERATION}, - }, -) - -UPDATE_DOMAIN_NAME_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#UpdateDomainNameOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#DomainName", - ) - ], - members={ - "domainName": {"target": STRING}, - "domainNameId": {"target": STRING}, - "domainNameArn": {"target": STRING}, - "certificateName": {"target": STRING}, - "certificateArn": {"target": STRING}, - "certificateUploadDate": {"target": TIMESTAMP}, - "regionalDomainName": {"target": STRING}, - "regionalHostedZoneId": {"target": STRING}, - "regionalCertificateName": {"target": STRING}, - "regionalCertificateArn": {"target": STRING}, - "distributionDomainName": {"target": STRING}, - "distributionHostedZoneId": {"target": STRING}, - "endpointConfiguration": {"target": ENDPOINT_CONFIGURATION}, - "domainNameStatus": {"target": DOMAIN_NAME_STATUS}, - "domainNameStatusMessage": {"target": STRING}, - "securityPolicy": {"target": SECURITY_POLICY}, - "endpointAccessMode": {"target": ENDPOINT_ACCESS_MODE}, - "tags": {"target": MAP_OF_STRING_TO_STRING}, - "mutualTlsAuthentication": {"target": MUTUAL_TLS_AUTHENTICATION}, - "ownershipVerificationCertificateArn": {"target": STRING}, - "managementPolicy": {"target": STRING}, - "policy": {"target": STRING}, - "routingMode": {"target": ROUTING_MODE}, - }, -) - -UPDATE_DOMAIN_NAME = Schema( - id=ShapeID("com.amazonaws.apigateway#UpdateDomainName"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "PATCH", "uri": "/domainnames/{domainName}", "code": 200} - ), - ) - ], -) - -UPDATE_GATEWAY_RESPONSE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#UpdateGatewayResponseInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#UpdateGatewayResponseRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "responseType": { - "target": GATEWAY_RESPONSE_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "patchOperations": {"target": LIST_OF_PATCH_OPERATION}, - }, -) - -UPDATE_GATEWAY_RESPONSE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#UpdateGatewayResponseOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#GatewayResponse", - ) - ], - members={ - "responseType": {"target": GATEWAY_RESPONSE_TYPE}, - "statusCode": {"target": STATUS_CODE}, - "responseParameters": {"target": MAP_OF_STRING_TO_STRING}, - "responseTemplates": {"target": MAP_OF_STRING_TO_STRING}, - "defaultResponse": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - }, -) - -UPDATE_GATEWAY_RESPONSE = Schema( - id=ShapeID("com.amazonaws.apigateway#UpdateGatewayResponse"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PATCH", - "uri": "/restapis/{restApiId}/gatewayresponses/{responseType}", - "code": 200, - } - ), - ) - ], -) - -UPDATE_INTEGRATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#UpdateIntegrationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#UpdateIntegrationRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "resourceId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "httpMethod": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "patchOperations": {"target": LIST_OF_PATCH_OPERATION}, - }, -) - -UPDATE_INTEGRATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#UpdateIntegrationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#Integration", - ) - ], - members={ - "type": {"target": INTEGRATION_TYPE}, - "httpMethod": {"target": STRING}, - "uri": {"target": STRING}, - "connectionType": {"target": CONNECTION_TYPE}, - "connectionId": {"target": STRING}, - "credentials": {"target": STRING}, - "requestParameters": {"target": MAP_OF_STRING_TO_STRING}, - "requestTemplates": {"target": MAP_OF_STRING_TO_STRING}, - "passthroughBehavior": {"target": STRING}, - "contentHandling": {"target": CONTENT_HANDLING_STRATEGY}, - "timeoutInMillis": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "cacheNamespace": {"target": STRING}, - "cacheKeyParameters": {"target": LIST_OF_STRING}, - "integrationResponses": {"target": MAP_OF_INTEGRATION_RESPONSE}, - "tlsConfig": {"target": TLS_CONFIG}, - "responseTransferMode": {"target": RESPONSE_TRANSFER_MODE}, - "integrationTarget": {"target": STRING}, - }, -) - -UPDATE_INTEGRATION = Schema( - id=ShapeID("com.amazonaws.apigateway#UpdateIntegration"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PATCH", - "uri": "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}/integration", - "code": 200, - } - ), - ) - ], -) - -UPDATE_INTEGRATION_RESPONSE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#UpdateIntegrationResponseInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#UpdateIntegrationResponseRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "resourceId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "httpMethod": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "statusCode": { - "target": STATUS_CODE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "patchOperations": {"target": LIST_OF_PATCH_OPERATION}, - }, -) - -UPDATE_INTEGRATION_RESPONSE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#UpdateIntegrationResponseOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#IntegrationResponse", - ) - ], - members={ - "statusCode": {"target": STATUS_CODE}, - "selectionPattern": {"target": STRING}, - "responseParameters": {"target": MAP_OF_STRING_TO_STRING}, - "responseTemplates": {"target": MAP_OF_STRING_TO_STRING}, - "contentHandling": {"target": CONTENT_HANDLING_STRATEGY}, - }, -) - -UPDATE_INTEGRATION_RESPONSE = Schema( - id=ShapeID("com.amazonaws.apigateway#UpdateIntegrationResponse"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PATCH", - "uri": "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}/integration/responses/{statusCode}", - "code": 200, - } - ), - ) - ], -) - -UPDATE_METHOD_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#UpdateMethodInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#UpdateMethodRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "resourceId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "httpMethod": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "patchOperations": {"target": LIST_OF_PATCH_OPERATION}, - }, -) - -UPDATE_METHOD_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#UpdateMethodOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#Method", - ) - ], - members={ - "httpMethod": {"target": STRING}, - "authorizationType": {"target": STRING}, - "authorizerId": {"target": STRING}, - "apiKeyRequired": {"target": NULLABLE_BOOLEAN}, - "requestValidatorId": {"target": STRING}, - "operationName": {"target": STRING}, - "requestParameters": {"target": MAP_OF_STRING_TO_BOOLEAN}, - "requestModels": {"target": MAP_OF_STRING_TO_STRING}, - "methodResponses": {"target": MAP_OF_METHOD_RESPONSE}, - "methodIntegration": {"target": INTEGRATION}, - "authorizationScopes": {"target": LIST_OF_STRING}, - }, -) - -UPDATE_METHOD = Schema( - id=ShapeID("com.amazonaws.apigateway#UpdateMethod"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PATCH", - "uri": "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}", - "code": 200, - } - ), - ) - ], -) - -UPDATE_METHOD_RESPONSE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#UpdateMethodResponseInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#UpdateMethodResponseRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "resourceId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "httpMethod": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "statusCode": { - "target": STATUS_CODE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "patchOperations": {"target": LIST_OF_PATCH_OPERATION}, - }, -) - -UPDATE_METHOD_RESPONSE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#UpdateMethodResponseOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#MethodResponse", - ) - ], - members={ - "statusCode": {"target": STATUS_CODE}, - "responseParameters": {"target": MAP_OF_STRING_TO_BOOLEAN}, - "responseModels": {"target": MAP_OF_STRING_TO_STRING}, - }, -) - -UPDATE_METHOD_RESPONSE = Schema( - id=ShapeID("com.amazonaws.apigateway#UpdateMethodResponse"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PATCH", - "uri": "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}/responses/{statusCode}", - "code": 201, - } - ), - ) - ], -) - -UPDATE_MODEL_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#UpdateModelInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#UpdateModelRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "modelName": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "patchOperations": {"target": LIST_OF_PATCH_OPERATION}, - }, -) - -UPDATE_MODEL_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#UpdateModelOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#Model", - ) - ], - members={ - "id": {"target": STRING}, - "name": {"target": STRING}, - "description": {"target": STRING}, - "schema": {"target": STRING}, - "contentType": {"target": STRING}, - }, -) - -UPDATE_MODEL = Schema( - id=ShapeID("com.amazonaws.apigateway#UpdateModel"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PATCH", - "uri": "/restapis/{restApiId}/models/{modelName}", - "code": 200, - } - ), - ) - ], -) - -UPDATE_REQUEST_VALIDATOR_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#UpdateRequestValidatorInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#UpdateRequestValidatorRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "requestValidatorId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "patchOperations": {"target": LIST_OF_PATCH_OPERATION}, - }, -) - -UPDATE_REQUEST_VALIDATOR_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#UpdateRequestValidatorOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#RequestValidator", - ) - ], - members={ - "id": {"target": STRING}, - "name": {"target": STRING}, - "validateRequestBody": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "validateRequestParameters": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - }, -) - -UPDATE_REQUEST_VALIDATOR = Schema( - id=ShapeID("com.amazonaws.apigateway#UpdateRequestValidator"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PATCH", - "uri": "/restapis/{restApiId}/requestvalidators/{requestValidatorId}", - "code": 200, - } - ), - ) - ], -) - -UPDATE_RESOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#UpdateResourceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#UpdateResourceRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "resourceId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "patchOperations": {"target": LIST_OF_PATCH_OPERATION}, - }, -) - -UPDATE_RESOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#UpdateResourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#Resource", - ) - ], - members={ - "id": {"target": STRING}, - "parentId": {"target": STRING}, - "pathPart": {"target": STRING}, - "path": {"target": STRING}, - "resourceMethods": {"target": MAP_OF_METHOD}, - }, -) - -UPDATE_RESOURCE = Schema( - id=ShapeID("com.amazonaws.apigateway#UpdateResource"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PATCH", - "uri": "/restapis/{restApiId}/resources/{resourceId}", - "code": 200, - } - ), - ) - ], -) - -UPDATE_REST_API_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#UpdateRestApiInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#UpdateRestApiRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "patchOperations": {"target": LIST_OF_PATCH_OPERATION}, - }, -) - -UPDATE_REST_API_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#UpdateRestApiOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#RestApi", - ) - ], - members={ - "id": {"target": STRING}, - "name": {"target": STRING}, - "description": {"target": STRING}, - "createdDate": {"target": TIMESTAMP}, - "version": {"target": STRING}, - "warnings": {"target": LIST_OF_STRING}, - "binaryMediaTypes": {"target": LIST_OF_STRING}, - "minimumCompressionSize": {"target": NULLABLE_INTEGER}, - "apiKeySource": {"target": API_KEY_SOURCE_TYPE}, - "endpointConfiguration": {"target": ENDPOINT_CONFIGURATION}, - "policy": {"target": STRING}, - "tags": {"target": MAP_OF_STRING_TO_STRING}, - "disableExecuteApiEndpoint": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "rootResourceId": {"target": STRING}, - "securityPolicy": {"target": SECURITY_POLICY}, - "endpointAccessMode": {"target": ENDPOINT_ACCESS_MODE}, - "apiStatus": {"target": API_STATUS}, - "apiStatusMessage": {"target": STRING}, - }, -) - -UPDATE_REST_API = Schema( - id=ShapeID("com.amazonaws.apigateway#UpdateRestApi"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "PATCH", "uri": "/restapis/{restApiId}", "code": 200} - ), - ) - ], -) - -UPDATE_STAGE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#UpdateStageInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#UpdateStageRequest", - ) - ], - members={ - "restApiId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "stageName": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "patchOperations": {"target": LIST_OF_PATCH_OPERATION}, - }, -) - -UPDATE_STAGE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#UpdateStageOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#Stage", - ) - ], - members={ - "deploymentId": {"target": STRING}, - "clientCertificateId": {"target": STRING}, - "stageName": {"target": STRING}, - "description": {"target": STRING}, - "cacheClusterEnabled": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "cacheClusterSize": {"target": CACHE_CLUSTER_SIZE}, - "cacheClusterStatus": {"target": CACHE_CLUSTER_STATUS}, - "methodSettings": {"target": MAP_OF_METHOD_SETTINGS}, - "variables": {"target": MAP_OF_STRING_TO_STRING}, - "documentationVersion": {"target": STRING}, - "accessLogSettings": {"target": ACCESS_LOG_SETTINGS}, - "canarySettings": {"target": CANARY_SETTINGS}, - "tracingEnabled": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "webAclArn": {"target": STRING}, - "tags": {"target": MAP_OF_STRING_TO_STRING}, - "createdDate": {"target": TIMESTAMP}, - "lastUpdatedDate": {"target": TIMESTAMP}, - }, -) - -UPDATE_STAGE = Schema( - id=ShapeID("com.amazonaws.apigateway#UpdateStage"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PATCH", - "uri": "/restapis/{restApiId}/stages/{stageName}", - "code": 200, - } - ), - ) - ], -) - -UPDATE_USAGE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#UpdateUsageInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#UpdateUsageRequest", - ) - ], - members={ - "usagePlanId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "keyId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "patchOperations": {"target": LIST_OF_PATCH_OPERATION}, - }, -) - -UPDATE_USAGE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#UpdateUsageOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#Usage", - ) - ], - members={ - "usagePlanId": {"target": STRING}, - "startDate": {"target": STRING}, - "endDate": {"target": STRING}, - "items": { - "target": MAP_OF_KEY_USAGES, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="values")], - }, - "position": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="position")], - }, - }, -) - -UPDATE_USAGE = Schema( - id=ShapeID("com.amazonaws.apigateway#UpdateUsage"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PATCH", - "uri": "/usageplans/{usagePlanId}/keys/{keyId}/usage", - "code": 200, - } - ), - ) - ], -) - -UPDATE_USAGE_PLAN_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#UpdateUsagePlanInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#UpdateUsagePlanRequest", - ) - ], - members={ - "usagePlanId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "patchOperations": {"target": LIST_OF_PATCH_OPERATION}, - }, -) - -UPDATE_USAGE_PLAN_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#UpdateUsagePlanOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#UsagePlan", - ) - ], - members={ - "id": {"target": STRING}, - "name": {"target": STRING}, - "description": {"target": STRING}, - "apiStages": {"target": LIST_OF_API_STAGE}, - "throttle": {"target": THROTTLE_SETTINGS}, - "quota": {"target": QUOTA_SETTINGS}, - "productCode": {"target": STRING}, - "tags": {"target": MAP_OF_STRING_TO_STRING}, - }, -) - -UPDATE_USAGE_PLAN = Schema( - id=ShapeID("com.amazonaws.apigateway#UpdateUsagePlan"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "PATCH", "uri": "/usageplans/{usagePlanId}", "code": 200} - ), - ) - ], -) - -UPDATE_VPC_LINK_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#UpdateVpcLinkInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#UpdateVpcLinkRequest", - ) - ], - members={ - "vpcLinkId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "patchOperations": {"target": LIST_OF_PATCH_OPERATION}, - }, -) - -UPDATE_VPC_LINK_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.apigateway#UpdateVpcLinkOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.apigateway#VpcLink", - ) - ], - members={ - "id": {"target": STRING}, - "name": {"target": STRING}, - "description": {"target": STRING}, - "targetArns": {"target": LIST_OF_STRING}, - "status": {"target": VPC_LINK_STATUS}, - "statusMessage": {"target": STRING}, - "tags": {"target": MAP_OF_STRING_TO_STRING}, - }, -) - -UPDATE_VPC_LINK = Schema( - id=ShapeID("com.amazonaws.apigateway#UpdateVpcLink"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "PATCH", "uri": "/vpclinks/{vpcLinkId}", "code": 200} - ), - ) - ], -) - -BACKPLANE_CONTROL_SERVICE = Schema( - id=ShapeID("com.amazonaws.apigateway#BackplaneControlService"), - shape_type=ShapeType.SERVICE, - traits=[ - Trait.new( - id=ShapeID("aws.auth#sigv4"), value=MappingProxyType({"name": "apigateway"}) - ), - Trait.new( - id=ShapeID("smithy.rules#endpointBdd"), - value=MappingProxyType( - { - "version": "1.1", - "parameters": MappingProxyType( - { - "Region": MappingProxyType( - { - "builtIn": "AWS::Region", - "required": False, - "documentation": "The AWS region used to dispatch the request.", - "type": "string", - } - ), - "UseDualStack": MappingProxyType( - { - "builtIn": "AWS::UseDualStack", - "required": True, - "default": False, - "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", - "type": "boolean", - } - ), - "UseFIPS": MappingProxyType( - { - "builtIn": "AWS::UseFIPS", - "required": True, - "default": False, - "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", - "type": "boolean", - } - ), - "Endpoint": MappingProxyType( - { - "builtIn": "SDK::Endpoint", - "required": False, - "documentation": "Override the endpoint used to send this request", - "type": "string", - } - ), - } - ), - "conditions": ( - MappingProxyType( - { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "Endpoint"}),), - } - ), - MappingProxyType( - { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "Region"}),), - } - ), - MappingProxyType( - { - "fn": "aws.partition", - "argv": (MappingProxyType({"ref": "Region"}),), - "assign": "PartitionResult", - } - ), - MappingProxyType( +from smithy_core._schema_compact import StaticOperationSchema, StaticSchema + + +n0 = "com.amazonaws.apigateway" +_AAST = "AccessAssociationSourceType" +_VPCE = "VPCE" +_sV = "smithy.api#enumValue" +_S = "String" +_ALS = "AccessLogSettings" +_f = "format" +_dA = "destinationArn" +_LOS = "ListOfString" +_m = "member" +_I = "Integer" +_s = "smithy.api#default" +_D = "Double" +_TS = "ThrottleSettings" +_bL = "burstLimit" +_rL = "rateLimit" +_T = "Timestamp" +_B = "Boolean" +_MOSTS = "MapOfStringToString" +_k = "key" +_v = "value" +_AK = "ApiKey" +_i = "id" +_n = "name" +_cI = "customerId" +_d = "description" +_e = "enabled" +_cD = "createdDate" +_lUD = "lastUpdatedDate" +_sK = "stageKeys" +_t = "tags" +_AKF = "ApiKeysFormat" +_c = "csv" +_AKST = "ApiKeySourceType" +_HEADER = "HEADER" +_AUTHORIZER = "AUTHORIZER" +_MOASTS = "MapOfApiStageThrottleSettings" +_AS = "ApiStage" +_aI = "apiId" +_st = "stage" +_th = "throttle" +_ASp = "ApiStatus" +_UPDATING = "UPDATING" +_AVAILABLE = "AVAILABLE" +_PENDING = "PENDING" +_FAILED = "FAILED" +_NI = "NullableInteger" +_PARN = "ProviderARN" +_LOARN = "ListOfARNs" +_AT = "AuthorizerType" +_TOKEN = "TOKEN" +_REQUEST = "REQUEST" +_CUP = "COGNITO_USER_POOLS" +_A = "Authorizer" +_ty = "type" +_pARN = "providerARNs" +_aT = "authType" +_aU = "authorizerUri" +_aC = "authorizerCredentials" +_iS = "identitySource" +_iVE = "identityValidationExpression" +_aRTIS = "authorizerResultTtlInSeconds" +_BRE = "BadRequestException" +_sm = "smithy.api#error" +_cl = "client" +_sE = "smithy.api#httpError" +_me = "message" +_CE = "ConflictException" +_SK = "StageKey" +_rAI = "restApiId" +_sN = "stageName" +_LOSK = "ListOfStageKeys" +_CAKI = "CreateApiKeyInput" +_sSI = "smithy.synthetic#originalShapeId" +_cCAKR = "com.amazonaws.apigateway#CreateApiKeyRequest" +_smi = "smithy.api#input" +_gDI = "generateDistinctId" +_CAKO = "CreateApiKeyOutput" +_cAK = "com.amazonaws.apigateway#ApiKey" +_smit = "smithy.api#output" +_LEE = "LimitExceededException" +_rAS = "retryAfterSeconds" +_sH = "smithy.api#httpHeader" +_RA = "Retry-After" +_NFE = "NotFoundException" +_TMRE = "TooManyRequestsException" +_UE = "UnauthorizedException" +_CAK = "CreateApiKey" +_smith = "smithy.api#http" +_CAI = "CreateAuthorizerInput" +_cCAR = "com.amazonaws.apigateway#CreateAuthorizerRequest" +_smithy = "smithy.api#required" +_sL = "smithy.api#httpLabel" +_CAO = "CreateAuthorizerOutput" +_cA = "com.amazonaws.apigateway#Authorizer" +_CA = "CreateAuthorizer" +_CBPMI = "CreateBasePathMappingInput" +_cCBPMR = "com.amazonaws.apigateway#CreateBasePathMappingRequest" +_dN = "domainName" +_dNI = "domainNameId" +_sQ = "smithy.api#httpQuery" +_bP = "basePath" +_CBPMO = "CreateBasePathMappingOutput" +_cBPM = "com.amazonaws.apigateway#BasePathMapping" +_CBPM = "CreateBasePathMapping" +_NB = "NullableBoolean" +_CCS = "CacheClusterSize" +_SPG = "SIZE_0_POINT_5_GB" +_v_ = "0.5" +_SPG_ = "SIZE_1_POINT_6_GB" +_v__ = "1.6" +_SPG__ = "SIZE_6_POINT_1_GB" +_v___ = "6.1" +_SPG___ = "SIZE_13_POINT_5_GB" +_v____ = "13.5" +_SPG____ = "SIZE_28_POINT_4_GB" +_v_____ = "28.4" +_SPG_____ = "SIZE_58_POINT_2_GB" +_v______ = "58.2" +_SG = "SIZE_118_GB" +_v_______ = "118" +_SG_ = "SIZE_237_GB" +_v________ = "237" +_DCS = "DeploymentCanarySettings" +_pT = "percentTraffic" +_sVO = "stageVariableOverrides" +_uSC = "useStageCache" +_CDI = "CreateDeploymentInput" +_cCDR = "com.amazonaws.apigateway#CreateDeploymentRequest" +_sD = "stageDescription" +_cCE = "cacheClusterEnabled" +_cCS = "cacheClusterSize" +_va = "variables" +_cS = "canarySettings" +_tE = "tracingEnabled" +_MS = "MethodSnapshot" +_aTu = "authorizationType" +_aKR = "apiKeyRequired" +_MOMS = "MapOfMethodSnapshot" +_PTMOMS = "PathToMapOfMethodSnapshot" +_CDO = "CreateDeploymentOutput" +_cDo = "com.amazonaws.apigateway#Deployment" +_aS = "apiSummary" +_SUE = "ServiceUnavailableException" +_se = "server" +_CD = "CreateDeployment" +_DPLSC = "DocumentationPartLocationStatusCode" +_DPT = "DocumentationPartType" +_API = "API" +_MODEL = "MODEL" +_RESOURCE = "RESOURCE" +_METHOD = "METHOD" +_PP = "PATH_PARAMETER" +_QP = "QUERY_PARAMETER" +_RH = "REQUEST_HEADER" +_RB = "REQUEST_BODY" +_RESPONSE = "RESPONSE" +_RH_ = "RESPONSE_HEADER" +_RB_ = "RESPONSE_BODY" +_DPL = "DocumentationPartLocation" +_p = "path" +_met = "method" +_sC = "statusCode" +_CDPI = "CreateDocumentationPartInput" +_cCDPR = "com.amazonaws.apigateway#CreateDocumentationPartRequest" +_l = "location" +_pr = "properties" +_CDPO = "CreateDocumentationPartOutput" +_cDP = "com.amazonaws.apigateway#DocumentationPart" +_CDP = "CreateDocumentationPart" +_CDVI = "CreateDocumentationVersionInput" +_cCDVR = "com.amazonaws.apigateway#CreateDocumentationVersionRequest" +_dV = "documentationVersion" +_CDVO = "CreateDocumentationVersionOutput" +_cDV = "com.amazonaws.apigateway#DocumentationVersion" +_ve = "version" +_CDV = "CreateDocumentationVersion" +_EAM = "EndpointAccessMode" +_BASIC = "BASIC" +_STRICT = "STRICT" +_IAT = "IpAddressType" +_ip = "ipv4" +_du = "dualstack" +_ET = "EndpointType" +_REGIONAL = "REGIONAL" +_EDGE = "EDGE" +_PRIVATE = "PRIVATE" +_LOET = "ListOfEndpointType" +_EC = "EndpointConfiguration" +_typ = "types" +_iAT = "ipAddressType" +_vEI = "vpcEndpointIds" +_MTAI = "MutualTlsAuthenticationInput" +_tU = "truststoreUri" +_tV = "truststoreVersion" +_RM = "RoutingMode" +_BPMO = "BASE_PATH_MAPPING_ONLY" +_RRO = "ROUTING_RULE_ONLY" +_RRTBPM = "ROUTING_RULE_THEN_BASE_PATH_MAPPING" +_SP = "SecurityPolicy" +_T_ = "TLS_1_0" +_T__ = "TLS_1_2" +_ST = "SecurityPolicy_TLS13_1_3_2025_09" +_STF = "SecurityPolicy_TLS13_1_3_FIPS_2025_09" +_STPP = "SecurityPolicy_TLS13_1_2_PFS_PQ_2025_09" +_STFP = "SecurityPolicy_TLS13_1_2_FIPS_PQ_2025_09" +_STFPP = "SecurityPolicy_TLS13_1_2_FIPS_PFS_PQ_2025_09" +_STEP = "SecurityPolicy_TLS13_1_2_Ext2_PQ_2025_09" +_STEFP = "SecurityPolicy_TLS13_1_2_Ext2_FIPS_PQ_2025_09" +_STP = "SecurityPolicy_TLS13_1_2_PQ_2025_09" +_ST_ = "SecurityPolicy_TLS13_1_2_2021_06" +_STE = "SecurityPolicy_TLS13_2025_EDGE" +_STPE = "SecurityPolicy_TLS12_PFS_2025_EDGE" +_STE_ = "SecurityPolicy_TLS12_2018_EDGE" +_CDNI = "CreateDomainNameInput" +_cCDNR = "com.amazonaws.apigateway#CreateDomainNameRequest" +_cN = "certificateName" +_cB = "certificateBody" +_cPK = "certificatePrivateKey" +_cC = "certificateChain" +_cAe = "certificateArn" +_rCN = "regionalCertificateName" +_rCA = "regionalCertificateArn" +_eC = "endpointConfiguration" +_sP = "securityPolicy" +_eAM = "endpointAccessMode" +_mTA = "mutualTlsAuthentication" +_oVCA = "ownershipVerificationCertificateArn" +_po = "policy" +_rM = "routingMode" +_DNS = "DomainNameStatus" +_PCR = "PENDING_CERTIFICATE_REIMPORT" +_POV = "PENDING_OWNERSHIP_VERIFICATION" +_MTA = "MutualTlsAuthentication" +_tW = "truststoreWarnings" +_CDNO = "CreateDomainNameOutput" +_cDN = "com.amazonaws.apigateway#DomainName" +_dNA = "domainNameArn" +_cUD = "certificateUploadDate" +_rDN = "regionalDomainName" +_rHZI = "regionalHostedZoneId" +_dDN = "distributionDomainName" +_dHZI = "distributionHostedZoneId" +_dNS = "domainNameStatus" +_dNSM = "domainNameStatusMessage" +_mP = "managementPolicy" +_CDN = "CreateDomainName" +_CDNAAI = "CreateDomainNameAccessAssociationInput" +_cCDNAAR = "com.amazonaws.apigateway#CreateDomainNameAccessAssociationRequest" +_aAST = "accessAssociationSourceType" +_aAS = "accessAssociationSource" +_CDNAAO = "CreateDomainNameAccessAssociationOutput" +_cDNAA = "com.amazonaws.apigateway#DomainNameAccessAssociation" +_dNAAA = "domainNameAccessAssociationArn" +_CDNAA = "CreateDomainNameAccessAssociation" +_CMI = "CreateModelInput" +_cCMR = "com.amazonaws.apigateway#CreateModelRequest" +_sc = "schema" +_cT = "contentType" +_CMO = "CreateModelOutput" +_cM = "com.amazonaws.apigateway#Model" +_CM = "CreateModel" +_CRVI = "CreateRequestValidatorInput" +_cCRVR = "com.amazonaws.apigateway#CreateRequestValidatorRequest" +_vRB = "validateRequestBody" +_vRP = "validateRequestParameters" +_CRVO = "CreateRequestValidatorOutput" +_cRV = "com.amazonaws.apigateway#RequestValidator" +_CRV = "CreateRequestValidator" +_CRI = "CreateResourceInput" +_cCRR = "com.amazonaws.apigateway#CreateResourceRequest" +_pI = "parentId" +_pP = "pathPart" +_CT = "ConnectionType" +_INTERNET = "INTERNET" +_VL = "VPC_LINK" +_CHS = "ContentHandlingStrategy" +_CTB = "CONVERT_TO_BINARY" +_CTT = "CONVERT_TO_TEXT" +_SC = "StatusCode" +_IR = "IntegrationResponse" +_sPe = "selectionPattern" +_rP = "responseParameters" +_rT = "responseTemplates" +_cH = "contentHandling" +_MOIR = "MapOfIntegrationResponse" +_RTM = "ResponseTransferMode" +_BUFFERED = "BUFFERED" +_STREAM = "STREAM" +_TC = "TlsConfig" +_iSV = "insecureSkipVerification" +_IT = "IntegrationType" +_HTTP = "HTTP" +_AWS = "AWS" +_MOCK = "MOCK" +_HP = "HTTP_PROXY" +_AP = "AWS_PROXY" +_In = "Integration" +_hM = "httpMethod" +_u = "uri" +_cTo = "connectionType" +_cIo = "connectionId" +_cr = "credentials" +_rPe = "requestParameters" +_rTe = "requestTemplates" +_pB = "passthroughBehavior" +_tIM = "timeoutInMillis" +_cNa = "cacheNamespace" +_cKP = "cacheKeyParameters" +_iR = "integrationResponses" +_tC = "tlsConfig" +_rTM = "responseTransferMode" +_iT = "integrationTarget" +_MOSTB = "MapOfStringToBoolean" +_MR = "MethodResponse" +_rMe = "responseModels" +_MOMR = "MapOfMethodResponse" +_M = "Method" +_aIu = "authorizerId" +_rVI = "requestValidatorId" +_oN = "operationName" +_rMeq = "requestModels" +_mR = "methodResponses" +_mI = "methodIntegration" +_aSu = "authorizationScopes" +_MOM = "MapOfMethod" +_CRO = "CreateResourceOutput" +_cR = "com.amazonaws.apigateway#Resource" +_rMes = "resourceMethods" +_CR = "CreateResource" +_CRAI = "CreateRestApiInput" +_cCRAR = "com.amazonaws.apigateway#CreateRestApiRequest" +_cF = "cloneFrom" +_bMT = "binaryMediaTypes" +_mCS = "minimumCompressionSize" +_aKS = "apiKeySource" +_dEAE = "disableExecuteApiEndpoint" +_CRAO = "CreateRestApiOutput" +_cRA = "com.amazonaws.apigateway#RestApi" +_w = "warnings" +_rRI = "rootResourceId" +_aSp = "apiStatus" +_aSM = "apiStatusMessage" +_CRA = "CreateRestApi" +_CS = "CanarySettings" +_dI = "deploymentId" +_CSI = "CreateStageInput" +_cCSR = "com.amazonaws.apigateway#CreateStageRequest" +_CCSa = "CacheClusterStatus" +_CIP = "CREATE_IN_PROGRESS" +_DIP = "DELETE_IN_PROGRESS" +_NA = "NOT_AVAILABLE" +_FIP = "FLUSH_IN_PROGRESS" +_UCCHS = "UnauthorizedCacheControlHeaderStrategy" +_FW = "FAIL_WITH_403" +_SWRH = "SUCCEED_WITH_RESPONSE_HEADER" +_SWRH_ = "SUCCEED_WITHOUT_RESPONSE_HEADER" +_MSe = "MethodSetting" +_mE = "metricsEnabled" +_lL = "loggingLevel" +_dTE = "dataTraceEnabled" +_tBL = "throttlingBurstLimit" +_tRL = "throttlingRateLimit" +_cE = "cachingEnabled" +_cTIS = "cacheTtlInSeconds" +_cDE = "cacheDataEncrypted" +_rAFCC = "requireAuthorizationForCacheControl" +_uCCHS = "unauthorizedCacheControlHeaderStrategy" +_MOMSa = "MapOfMethodSettings" +_CSO = "CreateStageOutput" +_cSo = "com.amazonaws.apigateway#Stage" +_cCI = "clientCertificateId" +_cCSa = "cacheClusterStatus" +_mS = "methodSettings" +_aLS = "accessLogSettings" +_wAA = "webAclArn" +_CSr = "CreateStage" +_LOAS = "ListOfApiStage" +_QPT = "QuotaPeriodType" +_DAY = "DAY" +_WEEK = "WEEK" +_MONTH = "MONTH" +_QS = "QuotaSettings" +_li = "limit" +_o = "offset" +_pe = "period" +_CUPI = "CreateUsagePlanInput" +_cCUPR = "com.amazonaws.apigateway#CreateUsagePlanRequest" +_aSpi = "apiStages" +_q = "quota" +_CUPO = "CreateUsagePlanOutput" +_cUP = "com.amazonaws.apigateway#UsagePlan" +_pC = "productCode" +_CUPr = "CreateUsagePlan" +_CUPKI = "CreateUsagePlanKeyInput" +_cCUPKR = "com.amazonaws.apigateway#CreateUsagePlanKeyRequest" +_uPI = "usagePlanId" +_kI = "keyId" +_kT = "keyType" +_CUPKO = "CreateUsagePlanKeyOutput" +_cUPK = "com.amazonaws.apigateway#UsagePlanKey" +_CUPK = "CreateUsagePlanKey" +_CVLI = "CreateVpcLinkInput" +_cCVLR = "com.amazonaws.apigateway#CreateVpcLinkRequest" +_tA = "targetArns" +_VLS = "VpcLinkStatus" +_DELETING = "DELETING" +_CVLO = "CreateVpcLinkOutput" +_cVL = "com.amazonaws.apigateway#VpcLink" +_sta = "status" +_sM = "statusMessage" +_CVL = "CreateVpcLink" +_DAKI = "DeleteApiKeyInput" +_cDAKR = "com.amazonaws.apigateway#DeleteApiKeyRequest" +_aK = "apiKey" +_DAKO = "DeleteApiKeyOutput" +_sU = "smithy.api#Unit" +_DAK = "DeleteApiKey" +_DAI = "DeleteAuthorizerInput" +_cDAR = "com.amazonaws.apigateway#DeleteAuthorizerRequest" +_DAO = "DeleteAuthorizerOutput" +_DA = "DeleteAuthorizer" +_DBPMI = "DeleteBasePathMappingInput" +_cDBPMR = "com.amazonaws.apigateway#DeleteBasePathMappingRequest" +_DBPMO = "DeleteBasePathMappingOutput" +_DBPM = "DeleteBasePathMapping" +_DCCI = "DeleteClientCertificateInput" +_cDCCR = "com.amazonaws.apigateway#DeleteClientCertificateRequest" +_DCCO = "DeleteClientCertificateOutput" +_DCC = "DeleteClientCertificate" +_DDI = "DeleteDeploymentInput" +_cDDR = "com.amazonaws.apigateway#DeleteDeploymentRequest" +_DDO = "DeleteDeploymentOutput" +_DD = "DeleteDeployment" +_DDPI = "DeleteDocumentationPartInput" +_cDDPR = "com.amazonaws.apigateway#DeleteDocumentationPartRequest" +_dPI = "documentationPartId" +_DDPO = "DeleteDocumentationPartOutput" +_DDP = "DeleteDocumentationPart" +_DDVI = "DeleteDocumentationVersionInput" +_cDDVR = "com.amazonaws.apigateway#DeleteDocumentationVersionRequest" +_DDVO = "DeleteDocumentationVersionOutput" +_DDV = "DeleteDocumentationVersion" +_DDNI = "DeleteDomainNameInput" +_cDDNR = "com.amazonaws.apigateway#DeleteDomainNameRequest" +_DDNO = "DeleteDomainNameOutput" +_DDN = "DeleteDomainName" +_DDNAAI = "DeleteDomainNameAccessAssociationInput" +_cDDNAAR = "com.amazonaws.apigateway#DeleteDomainNameAccessAssociationRequest" +_DDNAAO = "DeleteDomainNameAccessAssociationOutput" +_DDNAA = "DeleteDomainNameAccessAssociation" +_GRT = "GatewayResponseType" +_D_ = "DEFAULT_4XX" +_D__ = "DEFAULT_5XX" +_RNF = "RESOURCE_NOT_FOUND" +_UNAUTHORIZED = "UNAUTHORIZED" +_IAK = "INVALID_API_KEY" +_AD = "ACCESS_DENIED" +_AF = "AUTHORIZER_FAILURE" +_ACE = "AUTHORIZER_CONFIGURATION_ERROR" +_IS = "INVALID_SIGNATURE" +_ET_ = "EXPIRED_TOKEN" +_MAT = "MISSING_AUTHENTICATION_TOKEN" +_IF = "INTEGRATION_FAILURE" +_IT_ = "INTEGRATION_TIMEOUT" +_ACE_ = "API_CONFIGURATION_ERROR" +_UMT = "UNSUPPORTED_MEDIA_TYPE" +_BRP = "BAD_REQUEST_PARAMETERS" +_BRB = "BAD_REQUEST_BODY" +_RTL = "REQUEST_TOO_LARGE" +_THROTTLED = "THROTTLED" +_QE = "QUOTA_EXCEEDED" +_WF = "WAF_FILTERED" +_DGRI = "DeleteGatewayResponseInput" +_cDGRR = "com.amazonaws.apigateway#DeleteGatewayResponseRequest" +_rTes = "responseType" +_DGRO = "DeleteGatewayResponseOutput" +_DGR = "DeleteGatewayResponse" +_DII = "DeleteIntegrationInput" +_cDIR = "com.amazonaws.apigateway#DeleteIntegrationRequest" +_rI = "resourceId" +_DIO = "DeleteIntegrationOutput" +_DI = "DeleteIntegration" +_DIRI = "DeleteIntegrationResponseInput" +_cDIRR = "com.amazonaws.apigateway#DeleteIntegrationResponseRequest" +_DIRO = "DeleteIntegrationResponseOutput" +_DIR = "DeleteIntegrationResponse" +_DMI = "DeleteMethodInput" +_cDMR = "com.amazonaws.apigateway#DeleteMethodRequest" +_DMO = "DeleteMethodOutput" +_DM = "DeleteMethod" +_DMRI = "DeleteMethodResponseInput" +_cDMRR = "com.amazonaws.apigateway#DeleteMethodResponseRequest" +_DMRO = "DeleteMethodResponseOutput" +_DMR = "DeleteMethodResponse" +_DMIe = "DeleteModelInput" +_cDMRo = "com.amazonaws.apigateway#DeleteModelRequest" +_mN = "modelName" +_DMOe = "DeleteModelOutput" +_DMe = "DeleteModel" +_DRVI = "DeleteRequestValidatorInput" +_cDRVR = "com.amazonaws.apigateway#DeleteRequestValidatorRequest" +_DRVO = "DeleteRequestValidatorOutput" +_DRV = "DeleteRequestValidator" +_DRI = "DeleteResourceInput" +_cDRR = "com.amazonaws.apigateway#DeleteResourceRequest" +_DRO = "DeleteResourceOutput" +_DR = "DeleteResource" +_DRAI = "DeleteRestApiInput" +_cDRAR = "com.amazonaws.apigateway#DeleteRestApiRequest" +_DRAO = "DeleteRestApiOutput" +_DRA = "DeleteRestApi" +_DSI = "DeleteStageInput" +_cDSR = "com.amazonaws.apigateway#DeleteStageRequest" +_DSO = "DeleteStageOutput" +_DS = "DeleteStage" +_DUPI = "DeleteUsagePlanInput" +_cDUPR = "com.amazonaws.apigateway#DeleteUsagePlanRequest" +_DUPO = "DeleteUsagePlanOutput" +_DUP = "DeleteUsagePlan" +_DUPKI = "DeleteUsagePlanKeyInput" +_cDUPKR = "com.amazonaws.apigateway#DeleteUsagePlanKeyRequest" +_DUPKO = "DeleteUsagePlanKeyOutput" +_DUPK = "DeleteUsagePlanKey" +_DVLI = "DeleteVpcLinkInput" +_cDVLR = "com.amazonaws.apigateway#DeleteVpcLinkRequest" +_vLI = "vpcLinkId" +_DVLO = "DeleteVpcLinkOutput" +_DVL = "DeleteVpcLink" +_FSACI = "FlushStageAuthorizersCacheInput" +_cFSACR = "com.amazonaws.apigateway#FlushStageAuthorizersCacheRequest" +_FSACO = "FlushStageAuthorizersCacheOutput" +_FSAC = "FlushStageAuthorizersCache" +_FSCI = "FlushStageCacheInput" +_cFSCR = "com.amazonaws.apigateway#FlushStageCacheRequest" +_FSCO = "FlushStageCacheOutput" +_FSC = "FlushStageCache" +_GCCI = "GenerateClientCertificateInput" +_cGCCR = "com.amazonaws.apigateway#GenerateClientCertificateRequest" +_GCCO = "GenerateClientCertificateOutput" +_cCC = "com.amazonaws.apigateway#ClientCertificate" +_pEC = "pemEncodedCertificate" +_eD = "expirationDate" +_GCC = "GenerateClientCertificate" +_GAI = "GetAccountInput" +_cGAR = "com.amazonaws.apigateway#GetAccountRequest" +_GAO = "GetAccountOutput" +_cAo = "com.amazonaws.apigateway#Account" +_cRAl = "cloudwatchRoleArn" +_tS = "throttleSettings" +_fe = "features" +_aKV = "apiKeyVersion" +_GA = "GetAccount" +_GAKI = "GetApiKeyInput" +_cGAKR = "com.amazonaws.apigateway#GetApiKeyRequest" +_iV = "includeValue" +_GAKO = "GetApiKeyOutput" +_GAK = "GetApiKey" +_GAKIe = "GetApiKeysInput" +_cGAKRo = "com.amazonaws.apigateway#GetApiKeysRequest" +_pos = "position" +_nQ = "nameQuery" +_iVn = "includeValues" +_LOAK = "ListOfApiKey" +_GAKOe = "GetApiKeysOutput" +_cAKo = "com.amazonaws.apigateway#ApiKeys" +_it = "items" +_sNm = "smithy.api#jsonName" +_ite = "item" +_GAKe = "GetApiKeys" +_GAIe = "GetAuthorizerInput" +_cGARo = "com.amazonaws.apigateway#GetAuthorizerRequest" +_GAOe = "GetAuthorizerOutput" +_GAe = "GetAuthorizer" +_GAIet = "GetAuthorizersInput" +_cGARom = "com.amazonaws.apigateway#GetAuthorizersRequest" +_LOA = "ListOfAuthorizer" +_GAOet = "GetAuthorizersOutput" +_cAom = "com.amazonaws.apigateway#Authorizers" +_GAet = "GetAuthorizers" +_GBPMI = "GetBasePathMappingInput" +_cGBPMR = "com.amazonaws.apigateway#GetBasePathMappingRequest" +_GBPMO = "GetBasePathMappingOutput" +_GBPM = "GetBasePathMapping" +_GBPMIe = "GetBasePathMappingsInput" +_cGBPMRo = "com.amazonaws.apigateway#GetBasePathMappingsRequest" +_BPM = "BasePathMapping" +_LOBPM = "ListOfBasePathMapping" +_GBPMOe = "GetBasePathMappingsOutput" +_cBPMo = "com.amazonaws.apigateway#BasePathMappings" +_GBPMe = "GetBasePathMappings" +_GCCIe = "GetClientCertificateInput" +_cGCCRo = "com.amazonaws.apigateway#GetClientCertificateRequest" +_GCCOe = "GetClientCertificateOutput" +_GCCe = "GetClientCertificate" +_GCCIet = "GetClientCertificatesInput" +_cGCCRom = "com.amazonaws.apigateway#GetClientCertificatesRequest" +_CC = "ClientCertificate" +_LOCC = "ListOfClientCertificate" +_GCCOet = "GetClientCertificatesOutput" +_cCCo = "com.amazonaws.apigateway#ClientCertificates" +_GCCet = "GetClientCertificates" +_GDI = "GetDeploymentInput" +_cGDR = "com.amazonaws.apigateway#GetDeploymentRequest" +_em = "embed" +_GDO = "GetDeploymentOutput" +_GD = "GetDeployment" +_GDIe = "GetDeploymentsInput" +_cGDRo = "com.amazonaws.apigateway#GetDeploymentsRequest" +_De = "Deployment" +_LOD = "ListOfDeployment" +_GDOe = "GetDeploymentsOutput" +_cDom = "com.amazonaws.apigateway#Deployments" +_GDe = "GetDeployments" +_GDPI = "GetDocumentationPartInput" +_cGDPR = "com.amazonaws.apigateway#GetDocumentationPartRequest" +_GDPO = "GetDocumentationPartOutput" +_GDP = "GetDocumentationPart" +_LST = "LocationStatusType" +_DOCUMENTED = "DOCUMENTED" +_UNDOCUMENTED = "UNDOCUMENTED" +_GDPIe = "GetDocumentationPartsInput" +_cGDPRo = "com.amazonaws.apigateway#GetDocumentationPartsRequest" +_lS = "locationStatus" +_DP = "DocumentationPart" +_LODP = "ListOfDocumentationPart" +_GDPOe = "GetDocumentationPartsOutput" +_cDPo = "com.amazonaws.apigateway#DocumentationParts" +_GDPe = "GetDocumentationParts" +_GDVI = "GetDocumentationVersionInput" +_cGDVR = "com.amazonaws.apigateway#GetDocumentationVersionRequest" +_GDVO = "GetDocumentationVersionOutput" +_GDV = "GetDocumentationVersion" +_GDVIe = "GetDocumentationVersionsInput" +_cGDVRo = "com.amazonaws.apigateway#GetDocumentationVersionsRequest" +_DV = "DocumentationVersion" +_LODV = "ListOfDocumentationVersion" +_GDVOe = "GetDocumentationVersionsOutput" +_cDVo = "com.amazonaws.apigateway#DocumentationVersions" +_GDVe = "GetDocumentationVersions" +_GDNI = "GetDomainNameInput" +_cGDNR = "com.amazonaws.apigateway#GetDomainNameRequest" +_GDNO = "GetDomainNameOutput" +_GDN = "GetDomainName" +_RO = "ResourceOwner" +_SELF = "SELF" +_OA = "OTHER_ACCOUNTS" +_GDNAAI = "GetDomainNameAccessAssociationsInput" +_cGDNAAR = "com.amazonaws.apigateway#GetDomainNameAccessAssociationsRequest" +_rO = "resourceOwner" +_DNAA = "DomainNameAccessAssociation" +_LODNAA = "ListOfDomainNameAccessAssociation" +_GDNAAO = "GetDomainNameAccessAssociationsOutput" +_cDNAAo = "com.amazonaws.apigateway#DomainNameAccessAssociations" +_GDNAA = "GetDomainNameAccessAssociations" +_GDNIe = "GetDomainNamesInput" +_cGDNRo = "com.amazonaws.apigateway#GetDomainNamesRequest" +_DN = "DomainName" +_LODN = "ListOfDomainName" +_GDNOe = "GetDomainNamesOutput" +_cDNo = "com.amazonaws.apigateway#DomainNames" +_GDNe = "GetDomainNames" +_GEI = "GetExportInput" +_cGER = "com.amazonaws.apigateway#GetExportRequest" +_eT = "exportType" +_pa = "parameters" +_sQP = "smithy.api#httpQueryParams" +_a = "accepts" +_Ac = "Accept" +_Bl = "Blob" +_GEO = "GetExportOutput" +_cER = "com.amazonaws.apigateway#ExportResponse" +_CT_ = "Content-Type" +_cDon = "contentDisposition" +_CD_ = "Content-Disposition" +_b = "body" +_sPm = "smithy.api#httpPayload" +_GE = "GetExport" +_GGRI = "GetGatewayResponseInput" +_cGGRR = "com.amazonaws.apigateway#GetGatewayResponseRequest" +_GGRO = "GetGatewayResponseOutput" +_cGR = "com.amazonaws.apigateway#GatewayResponse" +_dR = "defaultResponse" +_GGR = "GetGatewayResponse" +_GGRIe = "GetGatewayResponsesInput" +_cGGRRo = "com.amazonaws.apigateway#GetGatewayResponsesRequest" +_GR = "GatewayResponse" +_LOGR = "ListOfGatewayResponse" +_GGROe = "GetGatewayResponsesOutput" +_cGRo = "com.amazonaws.apigateway#GatewayResponses" +_GGRe = "GetGatewayResponses" +_GII = "GetIntegrationInput" +_cGIR = "com.amazonaws.apigateway#GetIntegrationRequest" +_GIO = "GetIntegrationOutput" +_cIom = "com.amazonaws.apigateway#Integration" +_GI = "GetIntegration" +_GIRI = "GetIntegrationResponseInput" +_cGIRR = "com.amazonaws.apigateway#GetIntegrationResponseRequest" +_GIRO = "GetIntegrationResponseOutput" +_cIR = "com.amazonaws.apigateway#IntegrationResponse" +_GIR = "GetIntegrationResponse" +_GMI = "GetMethodInput" +_cGMR = "com.amazonaws.apigateway#GetMethodRequest" +_GMO = "GetMethodOutput" +_cMo = "com.amazonaws.apigateway#Method" +_GM = "GetMethod" +_GMRI = "GetMethodResponseInput" +_cGMRR = "com.amazonaws.apigateway#GetMethodResponseRequest" +_GMRO = "GetMethodResponseOutput" +_cMR = "com.amazonaws.apigateway#MethodResponse" +_GMR = "GetMethodResponse" +_GMIe = "GetModelInput" +_cGMRo = "com.amazonaws.apigateway#GetModelRequest" +_fl = "flatten" +_GMOe = "GetModelOutput" +_GMe = "GetModel" +_GMIet = "GetModelsInput" +_cGMRom = "com.amazonaws.apigateway#GetModelsRequest" +_Mo = "Model" +_LOM = "ListOfModel" +_GMOet = "GetModelsOutput" +_cMom = "com.amazonaws.apigateway#Models" +_GMet = "GetModels" +_GMTI = "GetModelTemplateInput" +_cGMTR = "com.amazonaws.apigateway#GetModelTemplateRequest" +_GMTO = "GetModelTemplateOutput" +_cTom = "com.amazonaws.apigateway#Template" +_GMT = "GetModelTemplate" +_GRVI = "GetRequestValidatorInput" +_cGRVR = "com.amazonaws.apigateway#GetRequestValidatorRequest" +_GRVO = "GetRequestValidatorOutput" +_GRV = "GetRequestValidator" +_GRVIe = "GetRequestValidatorsInput" +_cGRVRo = "com.amazonaws.apigateway#GetRequestValidatorsRequest" +_RV = "RequestValidator" +_LORV = "ListOfRequestValidator" +_GRVOe = "GetRequestValidatorsOutput" +_cRVo = "com.amazonaws.apigateway#RequestValidators" +_GRVe = "GetRequestValidators" +_GRI = "GetResourceInput" +_cGRR = "com.amazonaws.apigateway#GetResourceRequest" +_GRO = "GetResourceOutput" +_GRe = "GetResource" +_GRIe = "GetResourcesInput" +_cGRRo = "com.amazonaws.apigateway#GetResourcesRequest" +_R = "Resource" +_LOR = "ListOfResource" +_GROe = "GetResourcesOutput" +_cRo = "com.amazonaws.apigateway#Resources" +_GRet = "GetResources" +_GRAI = "GetRestApiInput" +_cGRAR = "com.amazonaws.apigateway#GetRestApiRequest" +_GRAO = "GetRestApiOutput" +_GRA = "GetRestApi" +_GRAIe = "GetRestApisInput" +_cGRARo = "com.amazonaws.apigateway#GetRestApisRequest" +_RAe = "RestApi" +_LORA = "ListOfRestApi" +_GRAOe = "GetRestApisOutput" +_cRAo = "com.amazonaws.apigateway#RestApis" +_GRAe = "GetRestApis" +_GSI = "GetSdkInput" +_cGSR = "com.amazonaws.apigateway#GetSdkRequest" +_sT = "sdkType" +_GSO = "GetSdkOutput" +_cSR = "com.amazonaws.apigateway#SdkResponse" +_GS = "GetSdk" +_GSTI = "GetSdkTypeInput" +_cGSTR = "com.amazonaws.apigateway#GetSdkTypeRequest" +_SCP = "SdkConfigurationProperty" +_fN = "friendlyName" +_r = "required" +_dVe = "defaultValue" +_LOSCP = "ListOfSdkConfigurationProperty" +_GSTO = "GetSdkTypeOutput" +_cST = "com.amazonaws.apigateway#SdkType" +_cP = "configurationProperties" +_GST = "GetSdkType" +_GSTIe = "GetSdkTypesInput" +_cGSTRo = "com.amazonaws.apigateway#GetSdkTypesRequest" +_STd = "SdkType" +_LOST = "ListOfSdkType" +_GSTOe = "GetSdkTypesOutput" +_cSTo = "com.amazonaws.apigateway#SdkTypes" +_GSTe = "GetSdkTypes" +_GSIe = "GetStageInput" +_cGSRo = "com.amazonaws.apigateway#GetStageRequest" +_GSOe = "GetStageOutput" +_GSe = "GetStage" +_GSIet = "GetStagesInput" +_cGSRom = "com.amazonaws.apigateway#GetStagesRequest" +_St = "Stage" +_LOSi = "ListOfStage" +_GSOet = "GetStagesOutput" +_cSom = "com.amazonaws.apigateway#Stages" +_GSet = "GetStages" +_GTI = "GetTagsInput" +_cGTR = "com.amazonaws.apigateway#GetTagsRequest" +_rA = "resourceArn" +_GTO = "GetTagsOutput" +_cToma = "com.amazonaws.apigateway#Tags" +_GT = "GetTags" +_GUI = "GetUsageInput" +_cGUR = "com.amazonaws.apigateway#GetUsageRequest" +_sDt = "startDate" +_eDn = "endDate" +_L = "Long" +_LOL = "ListOfLong" +_LOU = "ListOfUsage" +_MOKU = "MapOfKeyUsages" +_GUO = "GetUsageOutput" +_cU = "com.amazonaws.apigateway#Usage" +_val = "values" +_GU = "GetUsage" +_GUPI = "GetUsagePlanInput" +_cGUPR = "com.amazonaws.apigateway#GetUsagePlanRequest" +_GUPO = "GetUsagePlanOutput" +_GUP = "GetUsagePlan" +_GUPKI = "GetUsagePlanKeyInput" +_cGUPKR = "com.amazonaws.apigateway#GetUsagePlanKeyRequest" +_GUPKO = "GetUsagePlanKeyOutput" +_GUPK = "GetUsagePlanKey" +_GUPKIe = "GetUsagePlanKeysInput" +_cGUPKRo = "com.amazonaws.apigateway#GetUsagePlanKeysRequest" +_UPK = "UsagePlanKey" +_LOUPK = "ListOfUsagePlanKey" +_GUPKOe = "GetUsagePlanKeysOutput" +_cUPKo = "com.amazonaws.apigateway#UsagePlanKeys" +_GUPKe = "GetUsagePlanKeys" +_GUPIe = "GetUsagePlansInput" +_cGUPRo = "com.amazonaws.apigateway#GetUsagePlansRequest" +_UP = "UsagePlan" +_LOUP = "ListOfUsagePlan" +_GUPOe = "GetUsagePlansOutput" +_cUPo = "com.amazonaws.apigateway#UsagePlans" +_GUPe = "GetUsagePlans" +_GVLI = "GetVpcLinkInput" +_cGVLR = "com.amazonaws.apigateway#GetVpcLinkRequest" +_GVLO = "GetVpcLinkOutput" +_GVL = "GetVpcLink" +_GVLIe = "GetVpcLinksInput" +_cGVLRo = "com.amazonaws.apigateway#GetVpcLinksRequest" +_VLp = "VpcLink" +_LOVL = "ListOfVpcLink" +_GVLOe = "GetVpcLinksOutput" +_cVLo = "com.amazonaws.apigateway#VpcLinks" +_GVLe = "GetVpcLinks" +_IAKI = "ImportApiKeysInput" +_cIAKR = "com.amazonaws.apigateway#ImportApiKeysRequest" +_fOW = "failOnWarnings" +_fa = "failonwarnings" +_IAKO = "ImportApiKeysOutput" +_cAKI = "com.amazonaws.apigateway#ApiKeyIds" +_id = "ids" +_IAKm = "ImportApiKeys" +_PM = "PutMode" +_Me = "Merge" +_mer = "merge" +_O = "Overwrite" +_ov = "overwrite" +_IDPI = "ImportDocumentationPartsInput" +_cIDPR = "com.amazonaws.apigateway#ImportDocumentationPartsRequest" +_mo = "mode" +_IDPO = "ImportDocumentationPartsOutput" +_cDPI = "com.amazonaws.apigateway#DocumentationPartIds" +_IDP = "ImportDocumentationParts" +_IRAI = "ImportRestApiInput" +_cIRAR = "com.amazonaws.apigateway#ImportRestApiRequest" +_IRAO = "ImportRestApiOutput" +_IRA = "ImportRestApi" +_PGRI = "PutGatewayResponseInput" +_cPGRR = "com.amazonaws.apigateway#PutGatewayResponseRequest" +_PGRO = "PutGatewayResponseOutput" +_PGR = "PutGatewayResponse" +_PII = "PutIntegrationInput" +_cPIR = "com.amazonaws.apigateway#PutIntegrationRequest" +_rHM = "requestHttpMethod" +_iHM = "integrationHttpMethod" +_PIO = "PutIntegrationOutput" +_PI = "PutIntegration" +_PIRI = "PutIntegrationResponseInput" +_cPIRR = "com.amazonaws.apigateway#PutIntegrationResponseRequest" +_PIRO = "PutIntegrationResponseOutput" +_PIR = "PutIntegrationResponse" +_PMI = "PutMethodInput" +_cPMR = "com.amazonaws.apigateway#PutMethodRequest" +_PMO = "PutMethodOutput" +_PMu = "PutMethod" +_PMRI = "PutMethodResponseInput" +_cPMRR = "com.amazonaws.apigateway#PutMethodResponseRequest" +_PMRO = "PutMethodResponseOutput" +_PMR = "PutMethodResponse" +_PRAI = "PutRestApiInput" +_cPRAR = "com.amazonaws.apigateway#PutRestApiRequest" +_PRAO = "PutRestApiOutput" +_PRA = "PutRestApi" +_RDNAAI = "RejectDomainNameAccessAssociationInput" +_cRDNAAR = "com.amazonaws.apigateway#RejectDomainNameAccessAssociationRequest" +_RDNAAO = "RejectDomainNameAccessAssociationOutput" +_RDNAA = "RejectDomainNameAccessAssociation" +_TRI = "TagResourceInput" +_cTRR = "com.amazonaws.apigateway#TagResourceRequest" +_TRO = "TagResourceOutput" +_TR = "TagResource" +_MOSTL = "MapOfStringToList" +_TIAI = "TestInvokeAuthorizerInput" +_cTIAR = "com.amazonaws.apigateway#TestInvokeAuthorizerRequest" +_h = "headers" +_mVH = "multiValueHeaders" +_pWQS = "pathWithQueryString" +_sVt = "stageVariables" +_aCd = "additionalContext" +_TIAO = "TestInvokeAuthorizerOutput" +_cTIARo = "com.amazonaws.apigateway#TestInvokeAuthorizerResponse" +_cSl = "clientStatus" +_lo = "log" +_la = "latency" +_pIr = "principalId" +_au = "authorization" +_cla = "claims" +_TIA = "TestInvokeAuthorizer" +_TIMI = "TestInvokeMethodInput" +_cTIMR = "com.amazonaws.apigateway#TestInvokeMethodRequest" +_TIMO = "TestInvokeMethodOutput" +_cTIMRo = "com.amazonaws.apigateway#TestInvokeMethodResponse" +_TIM = "TestInvokeMethod" +_URI = "UntagResourceInput" +_cURR = "com.amazonaws.apigateway#UntagResourceRequest" +_tK = "tagKeys" +_URO = "UntagResourceOutput" +_UR = "UntagResource" +_Op = "Op" +_ad = "add" +_re = "remove" +_rep = "replace" +_mov = "move" +_co = "copy" +_te = "test" +_PO = "PatchOperation" +_op = "op" +_fr = "from" +_LOPO = "ListOfPatchOperation" +_UAI = "UpdateAccountInput" +_cUAR = "com.amazonaws.apigateway#UpdateAccountRequest" +_pO = "patchOperations" +_UAO = "UpdateAccountOutput" +_UA = "UpdateAccount" +_UAKI = "UpdateApiKeyInput" +_cUAKR = "com.amazonaws.apigateway#UpdateApiKeyRequest" +_UAKO = "UpdateApiKeyOutput" +_UAK = "UpdateApiKey" +_UAIp = "UpdateAuthorizerInput" +_cUARo = "com.amazonaws.apigateway#UpdateAuthorizerRequest" +_UAOp = "UpdateAuthorizerOutput" +_UAp = "UpdateAuthorizer" +_UBPMI = "UpdateBasePathMappingInput" +_cUBPMR = "com.amazonaws.apigateway#UpdateBasePathMappingRequest" +_UBPMO = "UpdateBasePathMappingOutput" +_UBPM = "UpdateBasePathMapping" +_UCCI = "UpdateClientCertificateInput" +_cUCCR = "com.amazonaws.apigateway#UpdateClientCertificateRequest" +_UCCO = "UpdateClientCertificateOutput" +_UCC = "UpdateClientCertificate" +_UDI = "UpdateDeploymentInput" +_cUDR = "com.amazonaws.apigateway#UpdateDeploymentRequest" +_UDO = "UpdateDeploymentOutput" +_UD = "UpdateDeployment" +_UDPI = "UpdateDocumentationPartInput" +_cUDPR = "com.amazonaws.apigateway#UpdateDocumentationPartRequest" +_UDPO = "UpdateDocumentationPartOutput" +_UDP = "UpdateDocumentationPart" +_UDVI = "UpdateDocumentationVersionInput" +_cUDVR = "com.amazonaws.apigateway#UpdateDocumentationVersionRequest" +_UDVO = "UpdateDocumentationVersionOutput" +_UDV = "UpdateDocumentationVersion" +_UDNI = "UpdateDomainNameInput" +_cUDNR = "com.amazonaws.apigateway#UpdateDomainNameRequest" +_UDNO = "UpdateDomainNameOutput" +_UDN = "UpdateDomainName" +_UGRI = "UpdateGatewayResponseInput" +_cUGRR = "com.amazonaws.apigateway#UpdateGatewayResponseRequest" +_UGRO = "UpdateGatewayResponseOutput" +_UGR = "UpdateGatewayResponse" +_UII = "UpdateIntegrationInput" +_cUIR = "com.amazonaws.apigateway#UpdateIntegrationRequest" +_UIO = "UpdateIntegrationOutput" +_UI = "UpdateIntegration" +_UIRI = "UpdateIntegrationResponseInput" +_cUIRR = "com.amazonaws.apigateway#UpdateIntegrationResponseRequest" +_UIRO = "UpdateIntegrationResponseOutput" +_UIR = "UpdateIntegrationResponse" +_UMI = "UpdateMethodInput" +_cUMR = "com.amazonaws.apigateway#UpdateMethodRequest" +_UMO = "UpdateMethodOutput" +_UM = "UpdateMethod" +_UMRI = "UpdateMethodResponseInput" +_cUMRR = "com.amazonaws.apigateway#UpdateMethodResponseRequest" +_UMRO = "UpdateMethodResponseOutput" +_UMR = "UpdateMethodResponse" +_UMIp = "UpdateModelInput" +_cUMRo = "com.amazonaws.apigateway#UpdateModelRequest" +_UMOp = "UpdateModelOutput" +_UMp = "UpdateModel" +_URVI = "UpdateRequestValidatorInput" +_cURVR = "com.amazonaws.apigateway#UpdateRequestValidatorRequest" +_URVO = "UpdateRequestValidatorOutput" +_URV = "UpdateRequestValidator" +_URIp = "UpdateResourceInput" +_cURRo = "com.amazonaws.apigateway#UpdateResourceRequest" +_UROp = "UpdateResourceOutput" +_URp = "UpdateResource" +_URAI = "UpdateRestApiInput" +_cURAR = "com.amazonaws.apigateway#UpdateRestApiRequest" +_URAO = "UpdateRestApiOutput" +_URA = "UpdateRestApi" +_USI = "UpdateStageInput" +_cUSR = "com.amazonaws.apigateway#UpdateStageRequest" +_USO = "UpdateStageOutput" +_US = "UpdateStage" +_UUI = "UpdateUsageInput" +_cUUR = "com.amazonaws.apigateway#UpdateUsageRequest" +_UUO = "UpdateUsageOutput" +_UU = "UpdateUsage" +_UUPI = "UpdateUsagePlanInput" +_cUUPR = "com.amazonaws.apigateway#UpdateUsagePlanRequest" +_UUPO = "UpdateUsagePlanOutput" +_UUP = "UpdateUsagePlan" +_UVLI = "UpdateVpcLinkInput" +_cUVLR = "com.amazonaws.apigateway#UpdateVpcLinkRequest" +_UVLO = "UpdateVpcLinkOutput" +_UVL = "UpdateVpcLink" +_BCS = "BackplaneControlService" +_aw = "aws.auth#sigv4" +_sB = "smithy.rules#endpointBdd" +_aws = "aws.api#service" +_aJ = "aws.protocols#restJson1" + +ACCESS_ASSOCIATION_SOURCE_TYPE: StaticSchema = ( + 14, + n0, + _AAST, + 0, + (_VPCE,), + ((-1, {_sV: _VPCE}),), +) + +STRING: StaticSchema = (3, n0, _S, 0) + +ACCESS_LOG_SETTINGS: StaticSchema = ( + 18, + n0, + _ALS, + 0, + (_f, _dA), + ((STRING, 0), (STRING, 0)), +) + +LIST_OF_STRING: StaticSchema = (16, n0, _LOS, 0, (_m,), ((STRING, 0),)) + +INTEGER: StaticSchema = (7, n0, _I, {_s: 0}) + +DOUBLE: StaticSchema = (10, n0, _D, {_s: 0}) + +THROTTLE_SETTINGS: StaticSchema = ( + 18, + n0, + _TS, + 0, + (_bL, _rL), + ((INTEGER, {_s: 0}), (DOUBLE, {_s: 0})), +) + +TIMESTAMP: StaticSchema = (4, n0, _T, 0) + +BOOLEAN: StaticSchema = (2, n0, _B, {_s: False}) + +MAP_OF_STRING_TO_STRING: StaticSchema = ( + 17, + n0, + _MOSTS, + 0, + (_k, _v), + ((STRING, 0), (STRING, 0)), +) + +API_KEY: StaticSchema = ( + 18, + n0, + _AK, + 0, + (_i, _v, _n, _cI, _d, _e, _cD, _lUD, _sK, _t), + ( + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (BOOLEAN, {_s: False}), + (TIMESTAMP, 0), + (TIMESTAMP, 0), + (LIST_OF_STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + ), +) + +API_KEYS_FORMAT: StaticSchema = (14, n0, _AKF, 0, (_c,), ((-1, {_sV: _c}),)) + +API_KEY_SOURCE_TYPE: StaticSchema = ( + 14, + n0, + _AKST, + 0, + (_HEADER, _AUTHORIZER), + ((-1, {_sV: _HEADER}), (-1, {_sV: _AUTHORIZER})), +) + +MAP_OF_API_STAGE_THROTTLE_SETTINGS: StaticSchema = ( + 17, + n0, + _MOASTS, + 0, + (_k, _v), + ((STRING, 0), (THROTTLE_SETTINGS, 0)), +) + +API_STAGE: StaticSchema = ( + 18, + n0, + _AS, + 0, + (_aI, _st, _th), + ((STRING, 0), (STRING, 0), (MAP_OF_API_STAGE_THROTTLE_SETTINGS, 0)), +) + +API_STATUS: StaticSchema = ( + 14, + n0, + _ASp, + 0, + (_UPDATING, _AVAILABLE, _PENDING, _FAILED), + ( + (-1, {_sV: _UPDATING}), + (-1, {_sV: _AVAILABLE}), + (-1, {_sV: _PENDING}), + (-1, {_sV: _FAILED}), + ), +) + +NULLABLE_INTEGER: StaticSchema = (7, n0, _NI, 0) + +PROVIDER_ARN: StaticSchema = (3, n0, _PARN, 0) + +LIST_OF_AR_NS: StaticSchema = (16, n0, _LOARN, 0, (_m,), ((PROVIDER_ARN, 0),)) + +AUTHORIZER_TYPE: StaticSchema = ( + 14, + n0, + _AT, + 0, + (_TOKEN, _REQUEST, _CUP), + ((-1, {_sV: _TOKEN}), (-1, {_sV: _REQUEST}), (-1, {_sV: _CUP})), +) + +AUTHORIZER: StaticSchema = ( + 18, + n0, + _A, + 0, + (_i, _n, _ty, _pARN, _aT, _aU, _aC, _iS, _iVE, _aRTIS), + ( + (STRING, 0), + (STRING, 0), + (AUTHORIZER_TYPE, 0), + (LIST_OF_AR_NS, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (NULLABLE_INTEGER, 0), + ), +) + +BAD_REQUEST_EXCEPTION: StaticSchema = ( + 18, + n0, + _BRE, + {_sm: _cl, _sE: 400}, + (_me,), + ((STRING, 0),), +) + +CONFLICT_EXCEPTION: StaticSchema = ( + 18, + n0, + _CE, + {_sm: _cl, _sE: 409}, + (_me,), + ((STRING, 0),), +) + +STAGE_KEY: StaticSchema = (18, n0, _SK, 0, (_rAI, _sN), ((STRING, 0), (STRING, 0))) + +LIST_OF_STAGE_KEYS: StaticSchema = (16, n0, _LOSK, 0, (_m,), ((STAGE_KEY, 0),)) + +CREATE_API_KEY_INPUT: StaticSchema = ( + 18, + n0, + _CAKI, + {_sSI: _cCAKR, _smi: None}, + (_n, _d, _e, _gDI, _v, _sK, _cI, _t), + ( + (STRING, 0), + (STRING, 0), + (BOOLEAN, {_s: False}), + (BOOLEAN, {_s: False}), + (STRING, 0), + (LIST_OF_STAGE_KEYS, 0), + (STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + ), +) + +CREATE_API_KEY_OUTPUT: StaticSchema = ( + 18, + n0, + _CAKO, + {_sSI: _cAK, _smit: None}, + (_i, _v, _n, _cI, _d, _e, _cD, _lUD, _sK, _t), + ( + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (BOOLEAN, {_s: False}), + (TIMESTAMP, 0), + (TIMESTAMP, 0), + (LIST_OF_STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + ), +) + +LIMIT_EXCEEDED_EXCEPTION: StaticSchema = ( + 18, + n0, + _LEE, + {_sm: _cl, _sE: 429}, + (_rAS, _me), + ((STRING, {_sH: _RA}), (STRING, 0)), +) + +NOT_FOUND_EXCEPTION: StaticSchema = ( + 18, + n0, + _NFE, + {_sm: _cl, _sE: 404}, + (_me,), + ((STRING, 0),), +) + +TOO_MANY_REQUESTS_EXCEPTION: StaticSchema = ( + 18, + n0, + _TMRE, + {_sm: _cl, _sE: 429}, + (_rAS, _me), + ((STRING, {_sH: _RA}), (STRING, 0)), +) + +UNAUTHORIZED_EXCEPTION: StaticSchema = ( + 18, + n0, + _UE, + {_sm: _cl, _sE: 401}, + (_me,), + ((STRING, 0),), +) + +CREATE_API_KEY: StaticOperationSchema = ( + 23, + n0, + _CAK, + {_smith: MappingProxyType({"method": "POST", "uri": "/apikeys", "code": 201})}, + CREATE_API_KEY_INPUT, + CREATE_API_KEY_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +CREATE_AUTHORIZER_INPUT: StaticSchema = ( + 18, + n0, + _CAI, + {_sSI: _cCAR, _smi: None}, + (_rAI, _n, _ty, _pARN, _aT, _aU, _aC, _iS, _iVE, _aRTIS), + ( + (STRING, 9), + (STRING, 1), + (AUTHORIZER_TYPE, 1), + (LIST_OF_AR_NS, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (NULLABLE_INTEGER, 0), + ), +) + +CREATE_AUTHORIZER_OUTPUT: StaticSchema = ( + 18, + n0, + _CAO, + {_sSI: _cA, _smit: None}, + (_i, _n, _ty, _pARN, _aT, _aU, _aC, _iS, _iVE, _aRTIS), + ( + (STRING, 0), + (STRING, 0), + (AUTHORIZER_TYPE, 0), + (LIST_OF_AR_NS, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (NULLABLE_INTEGER, 0), + ), +) + +CREATE_AUTHORIZER: StaticOperationSchema = ( + 23, + n0, + _CA, + { + _smith: MappingProxyType( + {"method": "POST", "uri": "/restapis/{restApiId}/authorizers", "code": 201} + ) + }, + CREATE_AUTHORIZER_INPUT, + CREATE_AUTHORIZER_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +CREATE_BASE_PATH_MAPPING_INPUT: StaticSchema = ( + 18, + n0, + _CBPMI, + {_sSI: _cCBPMR, _smi: None}, + (_dN, _dNI, _bP, _rAI, _st), + ((STRING, 9), (STRING, {_sQ: _dNI}), (STRING, 0), (STRING, 1), (STRING, 0)), +) + +CREATE_BASE_PATH_MAPPING_OUTPUT: StaticSchema = ( + 18, + n0, + _CBPMO, + {_sSI: _cBPM, _smit: None}, + (_bP, _rAI, _st), + ((STRING, 0), (STRING, 0), (STRING, 0)), +) + +CREATE_BASE_PATH_MAPPING: StaticOperationSchema = ( + 23, + n0, + _CBPM, + { + _smith: MappingProxyType( + { + "method": "POST", + "uri": "/domainnames/{domainName}/basepathmappings", + "code": 201, + } + ) + }, + CREATE_BASE_PATH_MAPPING_INPUT, + CREATE_BASE_PATH_MAPPING_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +NULLABLE_BOOLEAN: StaticSchema = (2, n0, _NB, 0) + +CACHE_CLUSTER_SIZE: StaticSchema = ( + 14, + n0, + _CCS, + 0, + (_SPG, _SPG_, _SPG__, _SPG___, _SPG____, _SPG_____, _SG, _SG_), + ( + (-1, {_sV: _v_}), + (-1, {_sV: _v__}), + (-1, {_sV: _v___}), + (-1, {_sV: _v____}), + (-1, {_sV: _v_____}), + (-1, {_sV: _v______}), + (-1, {_sV: _v_______}), + (-1, {_sV: _v________}), + ), +) + +DEPLOYMENT_CANARY_SETTINGS: StaticSchema = ( + 18, + n0, + _DCS, + 0, + (_pT, _sVO, _uSC), + ((DOUBLE, {_s: 0}), (MAP_OF_STRING_TO_STRING, 0), (BOOLEAN, {_s: False})), +) + +CREATE_DEPLOYMENT_INPUT: StaticSchema = ( + 18, + n0, + _CDI, + {_sSI: _cCDR, _smi: None}, + (_rAI, _sN, _sD, _d, _cCE, _cCS, _va, _cS, _tE), + ( + (STRING, 9), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (NULLABLE_BOOLEAN, 0), + (CACHE_CLUSTER_SIZE, 0), + (MAP_OF_STRING_TO_STRING, 0), + (DEPLOYMENT_CANARY_SETTINGS, 0), + (NULLABLE_BOOLEAN, 0), + ), +) + +METHOD_SNAPSHOT: StaticSchema = ( + 18, + n0, + _MS, + 0, + (_aTu, _aKR), + ((STRING, 0), (BOOLEAN, {_s: False})), +) + +MAP_OF_METHOD_SNAPSHOT: StaticSchema = ( + 17, + n0, + _MOMS, + 0, + (_k, _v), + ((STRING, 0), (METHOD_SNAPSHOT, 0)), +) + +PATH_TO_MAP_OF_METHOD_SNAPSHOT: StaticSchema = ( + 17, + n0, + _PTMOMS, + 0, + (_k, _v), + ((STRING, 0), (MAP_OF_METHOD_SNAPSHOT, 0)), +) + +CREATE_DEPLOYMENT_OUTPUT: StaticSchema = ( + 18, + n0, + _CDO, + {_sSI: _cDo, _smit: None}, + (_i, _d, _cD, _aS), + ((STRING, 0), (STRING, 0), (TIMESTAMP, 0), (PATH_TO_MAP_OF_METHOD_SNAPSHOT, 0)), +) + +SERVICE_UNAVAILABLE_EXCEPTION: StaticSchema = ( + 18, + n0, + _SUE, + {_sm: _se, _sE: 503}, + (_rAS, _me), + ((STRING, {_sH: _RA}), (STRING, 0)), +) + +CREATE_DEPLOYMENT: StaticOperationSchema = ( + 23, + n0, + _CD, + { + _smith: MappingProxyType( + {"method": "POST", "uri": "/restapis/{restApiId}/deployments", "code": 201} + ) + }, + CREATE_DEPLOYMENT_INPUT, + CREATE_DEPLOYMENT_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + SERVICE_UNAVAILABLE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +DOCUMENTATION_PART_LOCATION_STATUS_CODE: StaticSchema = (3, n0, _DPLSC, 0) + +DOCUMENTATION_PART_TYPE: StaticSchema = ( + 14, + n0, + _DPT, + 0, + ( + _API, + _AUTHORIZER, + _MODEL, + _RESOURCE, + _METHOD, + _PP, + _QP, + _RH, + _RB, + _RESPONSE, + _RH_, + _RB_, + ), + ( + (-1, {_sV: _API}), + (-1, {_sV: _AUTHORIZER}), + (-1, {_sV: _MODEL}), + (-1, {_sV: _RESOURCE}), + (-1, {_sV: _METHOD}), + (-1, {_sV: _PP}), + (-1, {_sV: _QP}), + (-1, {_sV: _RH}), + (-1, {_sV: _RB}), + (-1, {_sV: _RESPONSE}), + (-1, {_sV: _RH_}), + (-1, {_sV: _RB_}), + ), +) + +DOCUMENTATION_PART_LOCATION: StaticSchema = ( + 18, + n0, + _DPL, + 0, + (_ty, _p, _met, _sC, _n), + ( + (DOCUMENTATION_PART_TYPE, 1), + (STRING, 0), + (STRING, 0), + (DOCUMENTATION_PART_LOCATION_STATUS_CODE, 0), + (STRING, 0), + ), +) + +CREATE_DOCUMENTATION_PART_INPUT: StaticSchema = ( + 18, + n0, + _CDPI, + {_sSI: _cCDPR, _smi: None}, + (_rAI, _l, _pr), + ((STRING, 9), (DOCUMENTATION_PART_LOCATION, 1), (STRING, 1)), +) + +CREATE_DOCUMENTATION_PART_OUTPUT: StaticSchema = ( + 18, + n0, + _CDPO, + {_sSI: _cDP, _smit: None}, + (_i, _l, _pr), + ((STRING, 0), (DOCUMENTATION_PART_LOCATION, 0), (STRING, 0)), +) + +CREATE_DOCUMENTATION_PART: StaticOperationSchema = ( + 23, + n0, + _CDP, + { + _smith: MappingProxyType( + { + "method": "POST", + "uri": "/restapis/{restApiId}/documentation/parts", + "code": 201, + } + ) + }, + CREATE_DOCUMENTATION_PART_INPUT, + CREATE_DOCUMENTATION_PART_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +CREATE_DOCUMENTATION_VERSION_INPUT: StaticSchema = ( + 18, + n0, + _CDVI, + {_sSI: _cCDVR, _smi: None}, + (_rAI, _dV, _sN, _d), + ((STRING, 9), (STRING, 1), (STRING, 0), (STRING, 0)), +) + +CREATE_DOCUMENTATION_VERSION_OUTPUT: StaticSchema = ( + 18, + n0, + _CDVO, + {_sSI: _cDV, _smit: None}, + (_ve, _cD, _d), + ((STRING, 0), (TIMESTAMP, 0), (STRING, 0)), +) + +CREATE_DOCUMENTATION_VERSION: StaticOperationSchema = ( + 23, + n0, + _CDV, + { + _smith: MappingProxyType( + { + "method": "POST", + "uri": "/restapis/{restApiId}/documentation/versions", + "code": 201, + } + ) + }, + CREATE_DOCUMENTATION_VERSION_INPUT, + CREATE_DOCUMENTATION_VERSION_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +ENDPOINT_ACCESS_MODE: StaticSchema = ( + 14, + n0, + _EAM, + 0, + (_BASIC, _STRICT), + ((-1, {_sV: _BASIC}), (-1, {_sV: _STRICT})), +) + +IP_ADDRESS_TYPE: StaticSchema = ( + 14, + n0, + _IAT, + 0, + (_ip, _du), + ((-1, {_sV: _ip}), (-1, {_sV: _du})), +) + +ENDPOINT_TYPE: StaticSchema = ( + 14, + n0, + _ET, + 0, + (_REGIONAL, _EDGE, _PRIVATE), + ((-1, {_sV: _REGIONAL}), (-1, {_sV: _EDGE}), (-1, {_sV: _PRIVATE})), +) + +LIST_OF_ENDPOINT_TYPE: StaticSchema = (16, n0, _LOET, 0, (_m,), ((ENDPOINT_TYPE, 0),)) + +ENDPOINT_CONFIGURATION: StaticSchema = ( + 18, + n0, + _EC, + 0, + (_typ, _iAT, _vEI), + ((LIST_OF_ENDPOINT_TYPE, 0), (IP_ADDRESS_TYPE, 0), (LIST_OF_STRING, 0)), +) + +MUTUAL_TLS_AUTHENTICATION_INPUT: StaticSchema = ( + 18, + n0, + _MTAI, + 0, + (_tU, _tV), + ((STRING, 0), (STRING, 0)), +) + +ROUTING_MODE: StaticSchema = ( + 14, + n0, + _RM, + 0, + (_BPMO, _RRO, _RRTBPM), + ((-1, {_sV: _BPMO}), (-1, {_sV: _RRO}), (-1, {_sV: _RRTBPM})), +) + +SECURITY_POLICY: StaticSchema = ( + 14, + n0, + _SP, + 0, + ( + _T_, + _T__, + _ST, + _STF, + _STPP, + _STFP, + _STFPP, + _STEP, + _STEFP, + _STP, + _ST_, + _STE, + _STPE, + _STE_, + ), + ( + (-1, {_sV: _T_}), + (-1, {_sV: _T__}), + (-1, {_sV: _ST}), + (-1, {_sV: _STF}), + (-1, {_sV: _STPP}), + (-1, {_sV: _STFP}), + (-1, {_sV: _STFPP}), + (-1, {_sV: _STEP}), + (-1, {_sV: _STEFP}), + (-1, {_sV: _STP}), + (-1, {_sV: _ST_}), + (-1, {_sV: _STE}), + (-1, {_sV: _STPE}), + (-1, {_sV: _STE_}), + ), +) + +CREATE_DOMAIN_NAME_INPUT: StaticSchema = ( + 18, + n0, + _CDNI, + {_sSI: _cCDNR, _smi: None}, + ( + _dN, + _cN, + _cB, + _cPK, + _cC, + _cAe, + _rCN, + _rCA, + _eC, + _t, + _sP, + _eAM, + _mTA, + _oVCA, + _po, + _rM, + ), + ( + (STRING, 1), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (ENDPOINT_CONFIGURATION, 0), + (MAP_OF_STRING_TO_STRING, 0), + (SECURITY_POLICY, 0), + (ENDPOINT_ACCESS_MODE, 0), + (MUTUAL_TLS_AUTHENTICATION_INPUT, 0), + (STRING, 0), + (STRING, 0), + (ROUTING_MODE, 0), + ), +) + +DOMAIN_NAME_STATUS: StaticSchema = ( + 14, + n0, + _DNS, + 0, + (_AVAILABLE, _UPDATING, _PENDING, _PCR, _POV, _FAILED), + ( + (-1, {_sV: _AVAILABLE}), + (-1, {_sV: _UPDATING}), + (-1, {_sV: _PENDING}), + (-1, {_sV: _PCR}), + (-1, {_sV: _POV}), + (-1, {_sV: _FAILED}), + ), +) + +MUTUAL_TLS_AUTHENTICATION: StaticSchema = ( + 18, + n0, + _MTA, + 0, + (_tU, _tV, _tW), + ((STRING, 0), (STRING, 0), (LIST_OF_STRING, 0)), +) + +CREATE_DOMAIN_NAME_OUTPUT: StaticSchema = ( + 18, + n0, + _CDNO, + {_sSI: _cDN, _smit: None}, + ( + _dN, + _dNI, + _dNA, + _cN, + _cAe, + _cUD, + _rDN, + _rHZI, + _rCN, + _rCA, + _dDN, + _dHZI, + _eC, + _dNS, + _dNSM, + _sP, + _eAM, + _t, + _mTA, + _oVCA, + _mP, + _po, + _rM, + ), + ( + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (TIMESTAMP, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (ENDPOINT_CONFIGURATION, 0), + (DOMAIN_NAME_STATUS, 0), + (STRING, 0), + (SECURITY_POLICY, 0), + (ENDPOINT_ACCESS_MODE, 0), + (MAP_OF_STRING_TO_STRING, 0), + (MUTUAL_TLS_AUTHENTICATION, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (ROUTING_MODE, 0), + ), +) + +CREATE_DOMAIN_NAME: StaticOperationSchema = ( + 23, + n0, + _CDN, + {_smith: MappingProxyType({"method": "POST", "uri": "/domainnames", "code": 201})}, + CREATE_DOMAIN_NAME_INPUT, + CREATE_DOMAIN_NAME_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +CREATE_DOMAIN_NAME_ACCESS_ASSOCIATION_INPUT: StaticSchema = ( + 18, + n0, + _CDNAAI, + {_sSI: _cCDNAAR, _smi: None}, + (_dNA, _aAST, _aAS, _t), + ( + (STRING, 1), + (ACCESS_ASSOCIATION_SOURCE_TYPE, 1), + (STRING, 1), + (MAP_OF_STRING_TO_STRING, 0), + ), +) + +CREATE_DOMAIN_NAME_ACCESS_ASSOCIATION_OUTPUT: StaticSchema = ( + 18, + n0, + _CDNAAO, + {_sSI: _cDNAA, _smit: None}, + (_dNAAA, _dNA, _aAST, _aAS, _t), + ( + (STRING, 0), + (STRING, 0), + (ACCESS_ASSOCIATION_SOURCE_TYPE, 0), + (STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + ), +) + +CREATE_DOMAIN_NAME_ACCESS_ASSOCIATION: StaticOperationSchema = ( + 23, + n0, + _CDNAA, + { + _smith: MappingProxyType( + {"method": "POST", "uri": "/domainnameaccessassociations", "code": 201} + ) + }, + CREATE_DOMAIN_NAME_ACCESS_ASSOCIATION_INPUT, + CREATE_DOMAIN_NAME_ACCESS_ASSOCIATION_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +CREATE_MODEL_INPUT: StaticSchema = ( + 18, + n0, + _CMI, + {_sSI: _cCMR, _smi: None}, + (_rAI, _n, _d, _sc, _cT), + ((STRING, 9), (STRING, 1), (STRING, 0), (STRING, 0), (STRING, 1)), +) + +CREATE_MODEL_OUTPUT: StaticSchema = ( + 18, + n0, + _CMO, + {_sSI: _cM, _smit: None}, + (_i, _n, _d, _sc, _cT), + ((STRING, 0), (STRING, 0), (STRING, 0), (STRING, 0), (STRING, 0)), +) + +CREATE_MODEL: StaticOperationSchema = ( + 23, + n0, + _CM, + { + _smith: MappingProxyType( + {"method": "POST", "uri": "/restapis/{restApiId}/models", "code": 201} + ) + }, + CREATE_MODEL_INPUT, + CREATE_MODEL_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +CREATE_REQUEST_VALIDATOR_INPUT: StaticSchema = ( + 18, + n0, + _CRVI, + {_sSI: _cCRVR, _smi: None}, + (_rAI, _n, _vRB, _vRP), + ((STRING, 9), (STRING, 0), (BOOLEAN, {_s: False}), (BOOLEAN, {_s: False})), +) + +CREATE_REQUEST_VALIDATOR_OUTPUT: StaticSchema = ( + 18, + n0, + _CRVO, + {_sSI: _cRV, _smit: None}, + (_i, _n, _vRB, _vRP), + ((STRING, 0), (STRING, 0), (BOOLEAN, {_s: False}), (BOOLEAN, {_s: False})), +) + +CREATE_REQUEST_VALIDATOR: StaticOperationSchema = ( + 23, + n0, + _CRV, + { + _smith: MappingProxyType( + { + "method": "POST", + "uri": "/restapis/{restApiId}/requestvalidators", + "code": 201, + } + ) + }, + CREATE_REQUEST_VALIDATOR_INPUT, + CREATE_REQUEST_VALIDATOR_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +CREATE_RESOURCE_INPUT: StaticSchema = ( + 18, + n0, + _CRI, + {_sSI: _cCRR, _smi: None}, + (_rAI, _pI, _pP), + ((STRING, 9), (STRING, 9), (STRING, 1)), +) + +CONNECTION_TYPE: StaticSchema = ( + 14, + n0, + _CT, + 0, + (_INTERNET, _VL), + ((-1, {_sV: _INTERNET}), (-1, {_sV: _VL})), +) + +CONTENT_HANDLING_STRATEGY: StaticSchema = ( + 14, + n0, + _CHS, + 0, + (_CTB, _CTT), + ((-1, {_sV: _CTB}), (-1, {_sV: _CTT})), +) + +STATUS_CODE: StaticSchema = (3, n0, _SC, 0) + +INTEGRATION_RESPONSE: StaticSchema = ( + 18, + n0, + _IR, + 0, + (_sC, _sPe, _rP, _rT, _cH), + ( + (STATUS_CODE, 0), + (STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + (CONTENT_HANDLING_STRATEGY, 0), + ), +) + +MAP_OF_INTEGRATION_RESPONSE: StaticSchema = ( + 17, + n0, + _MOIR, + 0, + (_k, _v), + ((STRING, 0), (INTEGRATION_RESPONSE, 0)), +) + +RESPONSE_TRANSFER_MODE: StaticSchema = ( + 14, + n0, + _RTM, + 0, + (_BUFFERED, _STREAM), + ((-1, {_sV: _BUFFERED}), (-1, {_sV: _STREAM})), +) + +TLS_CONFIG: StaticSchema = (18, n0, _TC, 0, (_iSV,), ((BOOLEAN, {_s: False}),)) + +INTEGRATION_TYPE: StaticSchema = ( + 14, + n0, + _IT, + 0, + (_HTTP, _AWS, _MOCK, _HP, _AP), + ( + (-1, {_sV: _HTTP}), + (-1, {_sV: _AWS}), + (-1, {_sV: _MOCK}), + (-1, {_sV: _HP}), + (-1, {_sV: _AP}), + ), +) + +INTEGRATION: StaticSchema = ( + 18, + n0, + _In, + 0, + ( + _ty, + _hM, + _u, + _cTo, + _cIo, + _cr, + _rPe, + _rTe, + _pB, + _cH, + _tIM, + _cNa, + _cKP, + _iR, + _tC, + _rTM, + _iT, + ), + ( + (INTEGRATION_TYPE, 0), + (STRING, 0), + (STRING, 0), + (CONNECTION_TYPE, 0), + (STRING, 0), + (STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + (STRING, 0), + (CONTENT_HANDLING_STRATEGY, 0), + (INTEGER, {_s: 0}), + (STRING, 0), + (LIST_OF_STRING, 0), + (MAP_OF_INTEGRATION_RESPONSE, 0), + (TLS_CONFIG, 0), + (RESPONSE_TRANSFER_MODE, 0), + (STRING, 0), + ), +) + +MAP_OF_STRING_TO_BOOLEAN: StaticSchema = ( + 17, + n0, + _MOSTB, + 0, + (_k, _v), + ((STRING, 0), (NULLABLE_BOOLEAN, 0)), +) + +METHOD_RESPONSE: StaticSchema = ( + 18, + n0, + _MR, + 0, + (_sC, _rP, _rMe), + ((STATUS_CODE, 0), (MAP_OF_STRING_TO_BOOLEAN, 0), (MAP_OF_STRING_TO_STRING, 0)), +) + +MAP_OF_METHOD_RESPONSE: StaticSchema = ( + 17, + n0, + _MOMR, + 0, + (_k, _v), + ((STRING, 0), (METHOD_RESPONSE, 0)), +) + +METHOD: StaticSchema = ( + 18, + n0, + _M, + 0, + (_hM, _aTu, _aIu, _aKR, _rVI, _oN, _rPe, _rMeq, _mR, _mI, _aSu), + ( + (STRING, 0), + (STRING, 0), + (STRING, 0), + (NULLABLE_BOOLEAN, 0), + (STRING, 0), + (STRING, 0), + (MAP_OF_STRING_TO_BOOLEAN, 0), + (MAP_OF_STRING_TO_STRING, 0), + (MAP_OF_METHOD_RESPONSE, 0), + (INTEGRATION, 0), + (LIST_OF_STRING, 0), + ), +) + +MAP_OF_METHOD: StaticSchema = (17, n0, _MOM, 0, (_k, _v), ((STRING, 0), (METHOD, 0))) + +CREATE_RESOURCE_OUTPUT: StaticSchema = ( + 18, + n0, + _CRO, + {_sSI: _cR, _smit: None}, + (_i, _pI, _pP, _p, _rMes), + ((STRING, 0), (STRING, 0), (STRING, 0), (STRING, 0), (MAP_OF_METHOD, 0)), +) + +CREATE_RESOURCE: StaticOperationSchema = ( + 23, + n0, + _CR, + { + _smith: MappingProxyType( + { + "method": "POST", + "uri": "/restapis/{restApiId}/resources/{parentId}", + "code": 201, + } + ) + }, + CREATE_RESOURCE_INPUT, + CREATE_RESOURCE_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +CREATE_REST_API_INPUT: StaticSchema = ( + 18, + n0, + _CRAI, + {_sSI: _cCRAR, _smi: None}, + (_n, _d, _ve, _cF, _bMT, _mCS, _aKS, _eC, _po, _t, _dEAE, _sP, _eAM), + ( + (STRING, 1), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (LIST_OF_STRING, 0), + (NULLABLE_INTEGER, 0), + (API_KEY_SOURCE_TYPE, 0), + (ENDPOINT_CONFIGURATION, 0), + (STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + (BOOLEAN, {_s: False}), + (SECURITY_POLICY, 0), + (ENDPOINT_ACCESS_MODE, 0), + ), +) + +CREATE_REST_API_OUTPUT: StaticSchema = ( + 18, + n0, + _CRAO, + {_sSI: _cRA, _smit: None}, + ( + _i, + _n, + _d, + _cD, + _ve, + _w, + _bMT, + _mCS, + _aKS, + _eC, + _po, + _t, + _dEAE, + _rRI, + _sP, + _eAM, + _aSp, + _aSM, + ), + ( + (STRING, 0), + (STRING, 0), + (STRING, 0), + (TIMESTAMP, 0), + (STRING, 0), + (LIST_OF_STRING, 0), + (LIST_OF_STRING, 0), + (NULLABLE_INTEGER, 0), + (API_KEY_SOURCE_TYPE, 0), + (ENDPOINT_CONFIGURATION, 0), + (STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + (BOOLEAN, {_s: False}), + (STRING, 0), + (SECURITY_POLICY, 0), + (ENDPOINT_ACCESS_MODE, 0), + (API_STATUS, 0), + (STRING, 0), + ), +) + +CREATE_REST_API: StaticOperationSchema = ( + 23, + n0, + _CRA, + {_smith: MappingProxyType({"method": "POST", "uri": "/restapis", "code": 201})}, + CREATE_REST_API_INPUT, + CREATE_REST_API_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +CANARY_SETTINGS: StaticSchema = ( + 18, + n0, + _CS, + 0, + (_pT, _dI, _sVO, _uSC), + ( + (DOUBLE, {_s: 0}), + (STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + (BOOLEAN, {_s: False}), + ), +) + +CREATE_STAGE_INPUT: StaticSchema = ( + 18, + n0, + _CSI, + {_sSI: _cCSR, _smi: None}, + (_rAI, _sN, _dI, _d, _cCE, _cCS, _va, _dV, _cS, _tE, _t), + ( + (STRING, 9), + (STRING, 1), + (STRING, 1), + (STRING, 0), + (BOOLEAN, {_s: False}), + (CACHE_CLUSTER_SIZE, 0), + (MAP_OF_STRING_TO_STRING, 0), + (STRING, 0), + (CANARY_SETTINGS, 0), + (BOOLEAN, {_s: False}), + (MAP_OF_STRING_TO_STRING, 0), + ), +) + +CACHE_CLUSTER_STATUS: StaticSchema = ( + 14, + n0, + _CCSa, + 0, + (_CIP, _AVAILABLE, _DIP, _NA, _FIP), + ( + (-1, {_sV: _CIP}), + (-1, {_sV: _AVAILABLE}), + (-1, {_sV: _DIP}), + (-1, {_sV: _NA}), + (-1, {_sV: _FIP}), + ), +) + +UNAUTHORIZED_CACHE_CONTROL_HEADER_STRATEGY: StaticSchema = ( + 14, + n0, + _UCCHS, + 0, + (_FW, _SWRH, _SWRH_), + ((-1, {_sV: _FW}), (-1, {_sV: _SWRH}), (-1, {_sV: _SWRH_})), +) + +METHOD_SETTING: StaticSchema = ( + 18, + n0, + _MSe, + 0, + (_mE, _lL, _dTE, _tBL, _tRL, _cE, _cTIS, _cDE, _rAFCC, _uCCHS), + ( + (BOOLEAN, {_s: False}), + (STRING, 0), + (BOOLEAN, {_s: False}), + (INTEGER, {_s: 0}), + (DOUBLE, {_s: 0}), + (BOOLEAN, {_s: False}), + (INTEGER, {_s: 0}), + (BOOLEAN, {_s: False}), + (BOOLEAN, {_s: False}), + (UNAUTHORIZED_CACHE_CONTROL_HEADER_STRATEGY, 0), + ), +) + +MAP_OF_METHOD_SETTINGS: StaticSchema = ( + 17, + n0, + _MOMSa, + 0, + (_k, _v), + ((STRING, 0), (METHOD_SETTING, 0)), +) + +CREATE_STAGE_OUTPUT: StaticSchema = ( + 18, + n0, + _CSO, + {_sSI: _cSo, _smit: None}, + ( + _dI, + _cCI, + _sN, + _d, + _cCE, + _cCS, + _cCSa, + _mS, + _va, + _dV, + _aLS, + _cS, + _tE, + _wAA, + _t, + _cD, + _lUD, + ), + ( + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (BOOLEAN, {_s: False}), + (CACHE_CLUSTER_SIZE, 0), + (CACHE_CLUSTER_STATUS, 0), + (MAP_OF_METHOD_SETTINGS, 0), + (MAP_OF_STRING_TO_STRING, 0), + (STRING, 0), + (ACCESS_LOG_SETTINGS, 0), + (CANARY_SETTINGS, 0), + (BOOLEAN, {_s: False}), + (STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + (TIMESTAMP, 0), + (TIMESTAMP, 0), + ), +) + +CREATE_STAGE: StaticOperationSchema = ( + 23, + n0, + _CSr, + { + _smith: MappingProxyType( + {"method": "POST", "uri": "/restapis/{restApiId}/stages", "code": 201} + ) + }, + CREATE_STAGE_INPUT, + CREATE_STAGE_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +LIST_OF_API_STAGE: StaticSchema = (16, n0, _LOAS, 0, (_m,), ((API_STAGE, 0),)) + +QUOTA_PERIOD_TYPE: StaticSchema = ( + 14, + n0, + _QPT, + 0, + (_DAY, _WEEK, _MONTH), + ((-1, {_sV: _DAY}), (-1, {_sV: _WEEK}), (-1, {_sV: _MONTH})), +) + +QUOTA_SETTINGS: StaticSchema = ( + 18, + n0, + _QS, + 0, + (_li, _o, _pe), + ((INTEGER, {_s: 0}), (INTEGER, {_s: 0}), (QUOTA_PERIOD_TYPE, 0)), +) + +CREATE_USAGE_PLAN_INPUT: StaticSchema = ( + 18, + n0, + _CUPI, + {_sSI: _cCUPR, _smi: None}, + (_n, _d, _aSpi, _th, _q, _t), + ( + (STRING, 1), + (STRING, 0), + (LIST_OF_API_STAGE, 0), + (THROTTLE_SETTINGS, 0), + (QUOTA_SETTINGS, 0), + (MAP_OF_STRING_TO_STRING, 0), + ), +) + +CREATE_USAGE_PLAN_OUTPUT: StaticSchema = ( + 18, + n0, + _CUPO, + {_sSI: _cUP, _smit: None}, + (_i, _n, _d, _aSpi, _th, _q, _pC, _t), + ( + (STRING, 0), + (STRING, 0), + (STRING, 0), + (LIST_OF_API_STAGE, 0), + (THROTTLE_SETTINGS, 0), + (QUOTA_SETTINGS, 0), + (STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + ), +) + +CREATE_USAGE_PLAN: StaticOperationSchema = ( + 23, + n0, + _CUPr, + {_smith: MappingProxyType({"method": "POST", "uri": "/usageplans", "code": 201})}, + CREATE_USAGE_PLAN_INPUT, + CREATE_USAGE_PLAN_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +CREATE_USAGE_PLAN_KEY_INPUT: StaticSchema = ( + 18, + n0, + _CUPKI, + {_sSI: _cCUPKR, _smi: None}, + (_uPI, _kI, _kT), + ((STRING, 9), (STRING, 1), (STRING, 1)), +) + +CREATE_USAGE_PLAN_KEY_OUTPUT: StaticSchema = ( + 18, + n0, + _CUPKO, + {_sSI: _cUPK, _smit: None}, + (_i, _ty, _v, _n), + ((STRING, 0), (STRING, 0), (STRING, 0), (STRING, 0)), +) + +CREATE_USAGE_PLAN_KEY: StaticOperationSchema = ( + 23, + n0, + _CUPK, + { + _smith: MappingProxyType( + {"method": "POST", "uri": "/usageplans/{usagePlanId}/keys", "code": 201} + ) + }, + CREATE_USAGE_PLAN_KEY_INPUT, + CREATE_USAGE_PLAN_KEY_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +CREATE_VPC_LINK_INPUT: StaticSchema = ( + 18, + n0, + _CVLI, + {_sSI: _cCVLR, _smi: None}, + (_n, _d, _tA, _t), + ((STRING, 1), (STRING, 0), (LIST_OF_STRING, 1), (MAP_OF_STRING_TO_STRING, 0)), +) + +VPC_LINK_STATUS: StaticSchema = ( + 14, + n0, + _VLS, + 0, + (_AVAILABLE, _PENDING, _DELETING, _FAILED), + ( + (-1, {_sV: _AVAILABLE}), + (-1, {_sV: _PENDING}), + (-1, {_sV: _DELETING}), + (-1, {_sV: _FAILED}), + ), +) + +CREATE_VPC_LINK_OUTPUT: StaticSchema = ( + 18, + n0, + _CVLO, + {_sSI: _cVL, _smit: None}, + (_i, _n, _d, _tA, _sta, _sM, _t), + ( + (STRING, 0), + (STRING, 0), + (STRING, 0), + (LIST_OF_STRING, 0), + (VPC_LINK_STATUS, 0), + (STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + ), +) + +CREATE_VPC_LINK: StaticOperationSchema = ( + 23, + n0, + _CVL, + {_smith: MappingProxyType({"method": "POST", "uri": "/vpclinks", "code": 202})}, + CREATE_VPC_LINK_INPUT, + CREATE_VPC_LINK_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +DELETE_API_KEY_INPUT: StaticSchema = ( + 18, + n0, + _DAKI, + {_sSI: _cDAKR, _smi: None}, + (_aK,), + ((STRING, 9),), +) + +DELETE_API_KEY_OUTPUT: StaticSchema = (18, n0, _DAKO, {_sSI: _sU, _smit: None}) + +DELETE_API_KEY: StaticOperationSchema = ( + 23, + n0, + _DAK, + { + _smith: MappingProxyType( + {"method": "DELETE", "uri": "/apikeys/{apiKey}", "code": 202} + ) + }, + DELETE_API_KEY_INPUT, + DELETE_API_KEY_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +DELETE_AUTHORIZER_INPUT: StaticSchema = ( + 18, + n0, + _DAI, + {_sSI: _cDAR, _smi: None}, + (_rAI, _aIu), + ((STRING, 9), (STRING, 9)), +) + +DELETE_AUTHORIZER_OUTPUT: StaticSchema = (18, n0, _DAO, {_sSI: _sU, _smit: None}) + +DELETE_AUTHORIZER: StaticOperationSchema = ( + 23, + n0, + _DA, + { + _smith: MappingProxyType( + { + "method": "DELETE", + "uri": "/restapis/{restApiId}/authorizers/{authorizerId}", + "code": 202, + } + ) + }, + DELETE_AUTHORIZER_INPUT, + DELETE_AUTHORIZER_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +DELETE_BASE_PATH_MAPPING_INPUT: StaticSchema = ( + 18, + n0, + _DBPMI, + {_sSI: _cDBPMR, _smi: None}, + (_dN, _dNI, _bP), + ((STRING, 9), (STRING, {_sQ: _dNI}), (STRING, 9)), +) + +DELETE_BASE_PATH_MAPPING_OUTPUT: StaticSchema = ( + 18, + n0, + _DBPMO, + {_sSI: _sU, _smit: None}, +) + +DELETE_BASE_PATH_MAPPING: StaticOperationSchema = ( + 23, + n0, + _DBPM, + { + _smith: MappingProxyType( + { + "method": "DELETE", + "uri": "/domainnames/{domainName}/basepathmappings/{basePath}", + "code": 202, + } + ) + }, + DELETE_BASE_PATH_MAPPING_INPUT, + DELETE_BASE_PATH_MAPPING_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +DELETE_CLIENT_CERTIFICATE_INPUT: StaticSchema = ( + 18, + n0, + _DCCI, + {_sSI: _cDCCR, _smi: None}, + (_cCI,), + ((STRING, 9),), +) + +DELETE_CLIENT_CERTIFICATE_OUTPUT: StaticSchema = ( + 18, + n0, + _DCCO, + {_sSI: _sU, _smit: None}, +) + +DELETE_CLIENT_CERTIFICATE: StaticOperationSchema = ( + 23, + n0, + _DCC, + { + _smith: MappingProxyType( + { + "method": "DELETE", + "uri": "/clientcertificates/{clientCertificateId}", + "code": 202, + } + ) + }, + DELETE_CLIENT_CERTIFICATE_INPUT, + DELETE_CLIENT_CERTIFICATE_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +DELETE_DEPLOYMENT_INPUT: StaticSchema = ( + 18, + n0, + _DDI, + {_sSI: _cDDR, _smi: None}, + (_rAI, _dI), + ((STRING, 9), (STRING, 9)), +) + +DELETE_DEPLOYMENT_OUTPUT: StaticSchema = (18, n0, _DDO, {_sSI: _sU, _smit: None}) + +DELETE_DEPLOYMENT: StaticOperationSchema = ( + 23, + n0, + _DD, + { + _smith: MappingProxyType( + { + "method": "DELETE", + "uri": "/restapis/{restApiId}/deployments/{deploymentId}", + "code": 202, + } + ) + }, + DELETE_DEPLOYMENT_INPUT, + DELETE_DEPLOYMENT_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +DELETE_DOCUMENTATION_PART_INPUT: StaticSchema = ( + 18, + n0, + _DDPI, + {_sSI: _cDDPR, _smi: None}, + (_rAI, _dPI), + ((STRING, 9), (STRING, 9)), +) + +DELETE_DOCUMENTATION_PART_OUTPUT: StaticSchema = ( + 18, + n0, + _DDPO, + {_sSI: _sU, _smit: None}, +) + +DELETE_DOCUMENTATION_PART: StaticOperationSchema = ( + 23, + n0, + _DDP, + { + _smith: MappingProxyType( + { + "method": "DELETE", + "uri": "/restapis/{restApiId}/documentation/parts/{documentationPartId}", + "code": 202, + } + ) + }, + DELETE_DOCUMENTATION_PART_INPUT, + DELETE_DOCUMENTATION_PART_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +DELETE_DOCUMENTATION_VERSION_INPUT: StaticSchema = ( + 18, + n0, + _DDVI, + {_sSI: _cDDVR, _smi: None}, + (_rAI, _dV), + ((STRING, 9), (STRING, 9)), +) + +DELETE_DOCUMENTATION_VERSION_OUTPUT: StaticSchema = ( + 18, + n0, + _DDVO, + {_sSI: _sU, _smit: None}, +) + +DELETE_DOCUMENTATION_VERSION: StaticOperationSchema = ( + 23, + n0, + _DDV, + { + _smith: MappingProxyType( + { + "method": "DELETE", + "uri": "/restapis/{restApiId}/documentation/versions/{documentationVersion}", + "code": 202, + } + ) + }, + DELETE_DOCUMENTATION_VERSION_INPUT, + DELETE_DOCUMENTATION_VERSION_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +DELETE_DOMAIN_NAME_INPUT: StaticSchema = ( + 18, + n0, + _DDNI, + {_sSI: _cDDNR, _smi: None}, + (_dN, _dNI), + ((STRING, 9), (STRING, {_sQ: _dNI})), +) + +DELETE_DOMAIN_NAME_OUTPUT: StaticSchema = (18, n0, _DDNO, {_sSI: _sU, _smit: None}) + +DELETE_DOMAIN_NAME: StaticOperationSchema = ( + 23, + n0, + _DDN, + { + _smith: MappingProxyType( + {"method": "DELETE", "uri": "/domainnames/{domainName}", "code": 202} + ) + }, + DELETE_DOMAIN_NAME_INPUT, + DELETE_DOMAIN_NAME_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +DELETE_DOMAIN_NAME_ACCESS_ASSOCIATION_INPUT: StaticSchema = ( + 18, + n0, + _DDNAAI, + {_sSI: _cDDNAAR, _smi: None}, + (_dNAAA,), + ((STRING, 9),), +) + +DELETE_DOMAIN_NAME_ACCESS_ASSOCIATION_OUTPUT: StaticSchema = ( + 18, + n0, + _DDNAAO, + {_sSI: _sU, _smit: None}, +) + +DELETE_DOMAIN_NAME_ACCESS_ASSOCIATION: StaticOperationSchema = ( + 23, + n0, + _DDNAA, + { + _smith: MappingProxyType( + { + "method": "DELETE", + "uri": "/domainnameaccessassociations/{domainNameAccessAssociationArn}", + "code": 202, + } + ) + }, + DELETE_DOMAIN_NAME_ACCESS_ASSOCIATION_INPUT, + DELETE_DOMAIN_NAME_ACCESS_ASSOCIATION_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +GATEWAY_RESPONSE_TYPE: StaticSchema = ( + 14, + n0, + _GRT, + 0, + ( + _D_, + _D__, + _RNF, + _UNAUTHORIZED, + _IAK, + _AD, + _AF, + _ACE, + _IS, + _ET_, + _MAT, + _IF, + _IT_, + _ACE_, + _UMT, + _BRP, + _BRB, + _RTL, + _THROTTLED, + _QE, + _WF, + ), + ( + (-1, {_sV: _D_}), + (-1, {_sV: _D__}), + (-1, {_sV: _RNF}), + (-1, {_sV: _UNAUTHORIZED}), + (-1, {_sV: _IAK}), + (-1, {_sV: _AD}), + (-1, {_sV: _AF}), + (-1, {_sV: _ACE}), + (-1, {_sV: _IS}), + (-1, {_sV: _ET_}), + (-1, {_sV: _MAT}), + (-1, {_sV: _IF}), + (-1, {_sV: _IT_}), + (-1, {_sV: _ACE_}), + (-1, {_sV: _UMT}), + (-1, {_sV: _BRP}), + (-1, {_sV: _BRB}), + (-1, {_sV: _RTL}), + (-1, {_sV: _THROTTLED}), + (-1, {_sV: _QE}), + (-1, {_sV: _WF}), + ), +) + +DELETE_GATEWAY_RESPONSE_INPUT: StaticSchema = ( + 18, + n0, + _DGRI, + {_sSI: _cDGRR, _smi: None}, + (_rAI, _rTes), + ((STRING, 9), (GATEWAY_RESPONSE_TYPE, 9)), +) + +DELETE_GATEWAY_RESPONSE_OUTPUT: StaticSchema = (18, n0, _DGRO, {_sSI: _sU, _smit: None}) + +DELETE_GATEWAY_RESPONSE: StaticOperationSchema = ( + 23, + n0, + _DGR, + { + _smith: MappingProxyType( + { + "method": "DELETE", + "uri": "/restapis/{restApiId}/gatewayresponses/{responseType}", + "code": 202, + } + ) + }, + DELETE_GATEWAY_RESPONSE_INPUT, + DELETE_GATEWAY_RESPONSE_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +DELETE_INTEGRATION_INPUT: StaticSchema = ( + 18, + n0, + _DII, + {_sSI: _cDIR, _smi: None}, + (_rAI, _rI, _hM), + ((STRING, 9), (STRING, 9), (STRING, 9)), +) + +DELETE_INTEGRATION_OUTPUT: StaticSchema = (18, n0, _DIO, {_sSI: _sU, _smit: None}) + +DELETE_INTEGRATION: StaticOperationSchema = ( + 23, + n0, + _DI, + { + _smith: MappingProxyType( + { + "method": "DELETE", + "uri": "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}/integration", + "code": 204, + } + ) + }, + DELETE_INTEGRATION_INPUT, + DELETE_INTEGRATION_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +DELETE_INTEGRATION_RESPONSE_INPUT: StaticSchema = ( + 18, + n0, + _DIRI, + {_sSI: _cDIRR, _smi: None}, + (_rAI, _rI, _hM, _sC), + ((STRING, 9), (STRING, 9), (STRING, 9), (STATUS_CODE, 9)), +) + +DELETE_INTEGRATION_RESPONSE_OUTPUT: StaticSchema = ( + 18, + n0, + _DIRO, + {_sSI: _sU, _smit: None}, +) + +DELETE_INTEGRATION_RESPONSE: StaticOperationSchema = ( + 23, + n0, + _DIR, + { + _smith: MappingProxyType( + { + "method": "DELETE", + "uri": "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}/integration/responses/{statusCode}", + "code": 204, + } + ) + }, + DELETE_INTEGRATION_RESPONSE_INPUT, + DELETE_INTEGRATION_RESPONSE_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +DELETE_METHOD_INPUT: StaticSchema = ( + 18, + n0, + _DMI, + {_sSI: _cDMR, _smi: None}, + (_rAI, _rI, _hM), + ((STRING, 9), (STRING, 9), (STRING, 9)), +) + +DELETE_METHOD_OUTPUT: StaticSchema = (18, n0, _DMO, {_sSI: _sU, _smit: None}) + +DELETE_METHOD: StaticOperationSchema = ( + 23, + n0, + _DM, + { + _smith: MappingProxyType( + { + "method": "DELETE", + "uri": "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}", + "code": 204, + } + ) + }, + DELETE_METHOD_INPUT, + DELETE_METHOD_OUTPUT, + ( + CONFLICT_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +DELETE_METHOD_RESPONSE_INPUT: StaticSchema = ( + 18, + n0, + _DMRI, + {_sSI: _cDMRR, _smi: None}, + (_rAI, _rI, _hM, _sC), + ((STRING, 9), (STRING, 9), (STRING, 9), (STATUS_CODE, 9)), +) + +DELETE_METHOD_RESPONSE_OUTPUT: StaticSchema = (18, n0, _DMRO, {_sSI: _sU, _smit: None}) + +DELETE_METHOD_RESPONSE: StaticOperationSchema = ( + 23, + n0, + _DMR, + { + _smith: MappingProxyType( + { + "method": "DELETE", + "uri": "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}/responses/{statusCode}", + "code": 204, + } + ) + }, + DELETE_METHOD_RESPONSE_INPUT, + DELETE_METHOD_RESPONSE_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +DELETE_MODEL_INPUT: StaticSchema = ( + 18, + n0, + _DMIe, + {_sSI: _cDMRo, _smi: None}, + (_rAI, _mN), + ((STRING, 9), (STRING, 9)), +) + +DELETE_MODEL_OUTPUT: StaticSchema = (18, n0, _DMOe, {_sSI: _sU, _smit: None}) + +DELETE_MODEL: StaticOperationSchema = ( + 23, + n0, + _DMe, + { + _smith: MappingProxyType( + { + "method": "DELETE", + "uri": "/restapis/{restApiId}/models/{modelName}", + "code": 202, + } + ) + }, + DELETE_MODEL_INPUT, + DELETE_MODEL_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +DELETE_REQUEST_VALIDATOR_INPUT: StaticSchema = ( + 18, + n0, + _DRVI, + {_sSI: _cDRVR, _smi: None}, + (_rAI, _rVI), + ((STRING, 9), (STRING, 9)), +) + +DELETE_REQUEST_VALIDATOR_OUTPUT: StaticSchema = ( + 18, + n0, + _DRVO, + {_sSI: _sU, _smit: None}, +) + +DELETE_REQUEST_VALIDATOR: StaticOperationSchema = ( + 23, + n0, + _DRV, + { + _smith: MappingProxyType( + { + "method": "DELETE", + "uri": "/restapis/{restApiId}/requestvalidators/{requestValidatorId}", + "code": 202, + } + ) + }, + DELETE_REQUEST_VALIDATOR_INPUT, + DELETE_REQUEST_VALIDATOR_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +DELETE_RESOURCE_INPUT: StaticSchema = ( + 18, + n0, + _DRI, + {_sSI: _cDRR, _smi: None}, + (_rAI, _rI), + ((STRING, 9), (STRING, 9)), +) + +DELETE_RESOURCE_OUTPUT: StaticSchema = (18, n0, _DRO, {_sSI: _sU, _smit: None}) + +DELETE_RESOURCE: StaticOperationSchema = ( + 23, + n0, + _DR, + { + _smith: MappingProxyType( + { + "method": "DELETE", + "uri": "/restapis/{restApiId}/resources/{resourceId}", + "code": 202, + } + ) + }, + DELETE_RESOURCE_INPUT, + DELETE_RESOURCE_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +DELETE_REST_API_INPUT: StaticSchema = ( + 18, + n0, + _DRAI, + {_sSI: _cDRAR, _smi: None}, + (_rAI,), + ((STRING, 9),), +) + +DELETE_REST_API_OUTPUT: StaticSchema = (18, n0, _DRAO, {_sSI: _sU, _smit: None}) + +DELETE_REST_API: StaticOperationSchema = ( + 23, + n0, + _DRA, + { + _smith: MappingProxyType( + {"method": "DELETE", "uri": "/restapis/{restApiId}", "code": 202} + ) + }, + DELETE_REST_API_INPUT, + DELETE_REST_API_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +DELETE_STAGE_INPUT: StaticSchema = ( + 18, + n0, + _DSI, + {_sSI: _cDSR, _smi: None}, + (_rAI, _sN), + ((STRING, 9), (STRING, 9)), +) + +DELETE_STAGE_OUTPUT: StaticSchema = (18, n0, _DSO, {_sSI: _sU, _smit: None}) + +DELETE_STAGE: StaticOperationSchema = ( + 23, + n0, + _DS, + { + _smith: MappingProxyType( + { + "method": "DELETE", + "uri": "/restapis/{restApiId}/stages/{stageName}", + "code": 202, + } + ) + }, + DELETE_STAGE_INPUT, + DELETE_STAGE_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +DELETE_USAGE_PLAN_INPUT: StaticSchema = ( + 18, + n0, + _DUPI, + {_sSI: _cDUPR, _smi: None}, + (_uPI,), + ((STRING, 9),), +) + +DELETE_USAGE_PLAN_OUTPUT: StaticSchema = (18, n0, _DUPO, {_sSI: _sU, _smit: None}) + +DELETE_USAGE_PLAN: StaticOperationSchema = ( + 23, + n0, + _DUP, + { + _smith: MappingProxyType( + {"method": "DELETE", "uri": "/usageplans/{usagePlanId}", "code": 202} + ) + }, + DELETE_USAGE_PLAN_INPUT, + DELETE_USAGE_PLAN_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +DELETE_USAGE_PLAN_KEY_INPUT: StaticSchema = ( + 18, + n0, + _DUPKI, + {_sSI: _cDUPKR, _smi: None}, + (_uPI, _kI), + ((STRING, 9), (STRING, 9)), +) + +DELETE_USAGE_PLAN_KEY_OUTPUT: StaticSchema = (18, n0, _DUPKO, {_sSI: _sU, _smit: None}) + +DELETE_USAGE_PLAN_KEY: StaticOperationSchema = ( + 23, + n0, + _DUPK, + { + _smith: MappingProxyType( + { + "method": "DELETE", + "uri": "/usageplans/{usagePlanId}/keys/{keyId}", + "code": 202, + } + ) + }, + DELETE_USAGE_PLAN_KEY_INPUT, + DELETE_USAGE_PLAN_KEY_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +DELETE_VPC_LINK_INPUT: StaticSchema = ( + 18, + n0, + _DVLI, + {_sSI: _cDVLR, _smi: None}, + (_vLI,), + ((STRING, 9),), +) + +DELETE_VPC_LINK_OUTPUT: StaticSchema = (18, n0, _DVLO, {_sSI: _sU, _smit: None}) + +DELETE_VPC_LINK: StaticOperationSchema = ( + 23, + n0, + _DVL, + { + _smith: MappingProxyType( + {"method": "DELETE", "uri": "/vpclinks/{vpcLinkId}", "code": 202} + ) + }, + DELETE_VPC_LINK_INPUT, + DELETE_VPC_LINK_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +FLUSH_STAGE_AUTHORIZERS_CACHE_INPUT: StaticSchema = ( + 18, + n0, + _FSACI, + {_sSI: _cFSACR, _smi: None}, + (_rAI, _sN), + ((STRING, 9), (STRING, 9)), +) + +FLUSH_STAGE_AUTHORIZERS_CACHE_OUTPUT: StaticSchema = ( + 18, + n0, + _FSACO, + {_sSI: _sU, _smit: None}, +) + +FLUSH_STAGE_AUTHORIZERS_CACHE: StaticOperationSchema = ( + 23, + n0, + _FSAC, + { + _smith: MappingProxyType( + { + "method": "DELETE", + "uri": "/restapis/{restApiId}/stages/{stageName}/cache/authorizers", + "code": 202, + } + ) + }, + FLUSH_STAGE_AUTHORIZERS_CACHE_INPUT, + FLUSH_STAGE_AUTHORIZERS_CACHE_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +FLUSH_STAGE_CACHE_INPUT: StaticSchema = ( + 18, + n0, + _FSCI, + {_sSI: _cFSCR, _smi: None}, + (_rAI, _sN), + ((STRING, 9), (STRING, 9)), +) + +FLUSH_STAGE_CACHE_OUTPUT: StaticSchema = (18, n0, _FSCO, {_sSI: _sU, _smit: None}) + +FLUSH_STAGE_CACHE: StaticOperationSchema = ( + 23, + n0, + _FSC, + { + _smith: MappingProxyType( + { + "method": "DELETE", + "uri": "/restapis/{restApiId}/stages/{stageName}/cache/data", + "code": 202, + } + ) + }, + FLUSH_STAGE_CACHE_INPUT, + FLUSH_STAGE_CACHE_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +GENERATE_CLIENT_CERTIFICATE_INPUT: StaticSchema = ( + 18, + n0, + _GCCI, + {_sSI: _cGCCR, _smi: None}, + (_d, _t), + ((STRING, 0), (MAP_OF_STRING_TO_STRING, 0)), +) + +GENERATE_CLIENT_CERTIFICATE_OUTPUT: StaticSchema = ( + 18, + n0, + _GCCO, + {_sSI: _cCC, _smit: None}, + (_cCI, _d, _pEC, _cD, _eD, _t), + ( + (STRING, 0), + (STRING, 0), + (STRING, 0), + (TIMESTAMP, 0), + (TIMESTAMP, 0), + (MAP_OF_STRING_TO_STRING, 0), + ), +) + +GENERATE_CLIENT_CERTIFICATE: StaticOperationSchema = ( + 23, + n0, + _GCC, + { + _smith: MappingProxyType( + {"method": "POST", "uri": "/clientcertificates", "code": 201} + ) + }, + GENERATE_CLIENT_CERTIFICATE_INPUT, + GENERATE_CLIENT_CERTIFICATE_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +GET_ACCOUNT_INPUT: StaticSchema = (18, n0, _GAI, {_sSI: _cGAR, _smi: None}) + +GET_ACCOUNT_OUTPUT: StaticSchema = ( + 18, + n0, + _GAO, + {_sSI: _cAo, _smit: None}, + (_cRAl, _tS, _fe, _aKV), + ((STRING, 0), (THROTTLE_SETTINGS, 0), (LIST_OF_STRING, 0), (STRING, 0)), +) + +GET_ACCOUNT: StaticOperationSchema = ( + 23, + n0, + _GA, + {_smith: MappingProxyType({"method": "GET", "uri": "/account", "code": 200})}, + GET_ACCOUNT_INPUT, + GET_ACCOUNT_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +GET_API_KEY_INPUT: StaticSchema = ( + 18, + n0, + _GAKI, + {_sSI: _cGAKR, _smi: None}, + (_aK, _iV), + ((STRING, 9), (NULLABLE_BOOLEAN, {_sQ: _iV})), +) + +GET_API_KEY_OUTPUT: StaticSchema = ( + 18, + n0, + _GAKO, + {_sSI: _cAK, _smit: None}, + (_i, _v, _n, _cI, _d, _e, _cD, _lUD, _sK, _t), + ( + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (BOOLEAN, {_s: False}), + (TIMESTAMP, 0), + (TIMESTAMP, 0), + (LIST_OF_STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + ), +) + +GET_API_KEY: StaticOperationSchema = ( + 23, + n0, + _GAK, + { + _smith: MappingProxyType( + {"method": "GET", "uri": "/apikeys/{apiKey}", "code": 200} + ) + }, + GET_API_KEY_INPUT, + GET_API_KEY_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +GET_API_KEYS_INPUT: StaticSchema = ( + 18, + n0, + _GAKIe, + {_sSI: _cGAKRo, _smi: None}, + (_pos, _li, _nQ, _cI, _iVn), + ( + (STRING, {_sQ: _pos}), + (NULLABLE_INTEGER, {_sQ: _li}), + (STRING, {_sQ: _n}), + (STRING, {_sQ: _cI}), + (NULLABLE_BOOLEAN, {_sQ: _iVn}), + ), +) + +LIST_OF_API_KEY: StaticSchema = (16, n0, _LOAK, 0, (_m,), ((API_KEY, 0),)) + +GET_API_KEYS_OUTPUT: StaticSchema = ( + 18, + n0, + _GAKOe, + {_sSI: _cAKo, _smit: None}, + (_w, _it, _pos), + ((LIST_OF_STRING, 0), (LIST_OF_API_KEY, {_sNm: _ite}), (STRING, {_sQ: _pos})), +) + +GET_API_KEYS: StaticOperationSchema = ( + 23, + n0, + _GAKe, + {_smith: MappingProxyType({"method": "GET", "uri": "/apikeys", "code": 200})}, + GET_API_KEYS_INPUT, + GET_API_KEYS_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +GET_AUTHORIZER_INPUT: StaticSchema = ( + 18, + n0, + _GAIe, + {_sSI: _cGARo, _smi: None}, + (_rAI, _aIu), + ((STRING, 9), (STRING, 9)), +) + +GET_AUTHORIZER_OUTPUT: StaticSchema = ( + 18, + n0, + _GAOe, + {_sSI: _cA, _smit: None}, + (_i, _n, _ty, _pARN, _aT, _aU, _aC, _iS, _iVE, _aRTIS), + ( + (STRING, 0), + (STRING, 0), + (AUTHORIZER_TYPE, 0), + (LIST_OF_AR_NS, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (NULLABLE_INTEGER, 0), + ), +) + +GET_AUTHORIZER: StaticOperationSchema = ( + 23, + n0, + _GAe, + { + _smith: MappingProxyType( + { + "method": "GET", + "uri": "/restapis/{restApiId}/authorizers/{authorizerId}", + "code": 200, + } + ) + }, + GET_AUTHORIZER_INPUT, + GET_AUTHORIZER_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +GET_AUTHORIZERS_INPUT: StaticSchema = ( + 18, + n0, + _GAIet, + {_sSI: _cGARom, _smi: None}, + (_rAI, _pos, _li), + ((STRING, 9), (STRING, {_sQ: _pos}), (NULLABLE_INTEGER, {_sQ: _li})), +) + +LIST_OF_AUTHORIZER: StaticSchema = (16, n0, _LOA, 0, (_m,), ((AUTHORIZER, 0),)) + +GET_AUTHORIZERS_OUTPUT: StaticSchema = ( + 18, + n0, + _GAOet, + {_sSI: _cAom, _smit: None}, + (_it, _pos), + ((LIST_OF_AUTHORIZER, {_sNm: _ite}), (STRING, {_sQ: _pos})), +) + +GET_AUTHORIZERS: StaticOperationSchema = ( + 23, + n0, + _GAet, + { + _smith: MappingProxyType( + {"method": "GET", "uri": "/restapis/{restApiId}/authorizers", "code": 200} + ) + }, + GET_AUTHORIZERS_INPUT, + GET_AUTHORIZERS_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +GET_BASE_PATH_MAPPING_INPUT: StaticSchema = ( + 18, + n0, + _GBPMI, + {_sSI: _cGBPMR, _smi: None}, + (_dN, _dNI, _bP), + ((STRING, 9), (STRING, {_sQ: _dNI}), (STRING, 9)), +) + +GET_BASE_PATH_MAPPING_OUTPUT: StaticSchema = ( + 18, + n0, + _GBPMO, + {_sSI: _cBPM, _smit: None}, + (_bP, _rAI, _st), + ((STRING, 0), (STRING, 0), (STRING, 0)), +) + +GET_BASE_PATH_MAPPING: StaticOperationSchema = ( + 23, + n0, + _GBPM, + { + _smith: MappingProxyType( + { + "method": "GET", + "uri": "/domainnames/{domainName}/basepathmappings/{basePath}", + "code": 200, + } + ) + }, + GET_BASE_PATH_MAPPING_INPUT, + GET_BASE_PATH_MAPPING_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +GET_BASE_PATH_MAPPINGS_INPUT: StaticSchema = ( + 18, + n0, + _GBPMIe, + {_sSI: _cGBPMRo, _smi: None}, + (_dN, _dNI, _pos, _li), + ( + (STRING, 9), + (STRING, {_sQ: _dNI}), + (STRING, {_sQ: _pos}), + (NULLABLE_INTEGER, {_sQ: _li}), + ), +) + +BASE_PATH_MAPPING: StaticSchema = ( + 18, + n0, + _BPM, + 0, + (_bP, _rAI, _st), + ((STRING, 0), (STRING, 0), (STRING, 0)), +) + +LIST_OF_BASE_PATH_MAPPING: StaticSchema = ( + 16, + n0, + _LOBPM, + 0, + (_m,), + ((BASE_PATH_MAPPING, 0),), +) + +GET_BASE_PATH_MAPPINGS_OUTPUT: StaticSchema = ( + 18, + n0, + _GBPMOe, + {_sSI: _cBPMo, _smit: None}, + (_it, _pos), + ((LIST_OF_BASE_PATH_MAPPING, {_sNm: _ite}), (STRING, {_sQ: _pos})), +) + +GET_BASE_PATH_MAPPINGS: StaticOperationSchema = ( + 23, + n0, + _GBPMe, + { + _smith: MappingProxyType( + { + "method": "GET", + "uri": "/domainnames/{domainName}/basepathmappings", + "code": 200, + } + ) + }, + GET_BASE_PATH_MAPPINGS_INPUT, + GET_BASE_PATH_MAPPINGS_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +GET_CLIENT_CERTIFICATE_INPUT: StaticSchema = ( + 18, + n0, + _GCCIe, + {_sSI: _cGCCRo, _smi: None}, + (_cCI,), + ((STRING, 9),), +) + +GET_CLIENT_CERTIFICATE_OUTPUT: StaticSchema = ( + 18, + n0, + _GCCOe, + {_sSI: _cCC, _smit: None}, + (_cCI, _d, _pEC, _cD, _eD, _t), + ( + (STRING, 0), + (STRING, 0), + (STRING, 0), + (TIMESTAMP, 0), + (TIMESTAMP, 0), + (MAP_OF_STRING_TO_STRING, 0), + ), +) + +GET_CLIENT_CERTIFICATE: StaticOperationSchema = ( + 23, + n0, + _GCCe, + { + _smith: MappingProxyType( + { + "method": "GET", + "uri": "/clientcertificates/{clientCertificateId}", + "code": 200, + } + ) + }, + GET_CLIENT_CERTIFICATE_INPUT, + GET_CLIENT_CERTIFICATE_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +GET_CLIENT_CERTIFICATES_INPUT: StaticSchema = ( + 18, + n0, + _GCCIet, + {_sSI: _cGCCRom, _smi: None}, + (_pos, _li), + ((STRING, {_sQ: _pos}), (NULLABLE_INTEGER, {_sQ: _li})), +) + +CLIENT_CERTIFICATE: StaticSchema = ( + 18, + n0, + _CC, + 0, + (_cCI, _d, _pEC, _cD, _eD, _t), + ( + (STRING, 0), + (STRING, 0), + (STRING, 0), + (TIMESTAMP, 0), + (TIMESTAMP, 0), + (MAP_OF_STRING_TO_STRING, 0), + ), +) + +LIST_OF_CLIENT_CERTIFICATE: StaticSchema = ( + 16, + n0, + _LOCC, + 0, + (_m,), + ((CLIENT_CERTIFICATE, 0),), +) + +GET_CLIENT_CERTIFICATES_OUTPUT: StaticSchema = ( + 18, + n0, + _GCCOet, + {_sSI: _cCCo, _smit: None}, + (_it, _pos), + ((LIST_OF_CLIENT_CERTIFICATE, {_sNm: _ite}), (STRING, {_sQ: _pos})), +) + +GET_CLIENT_CERTIFICATES: StaticOperationSchema = ( + 23, + n0, + _GCCet, + { + _smith: MappingProxyType( + {"method": "GET", "uri": "/clientcertificates", "code": 200} + ) + }, + GET_CLIENT_CERTIFICATES_INPUT, + GET_CLIENT_CERTIFICATES_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +GET_DEPLOYMENT_INPUT: StaticSchema = ( + 18, + n0, + _GDI, + {_sSI: _cGDR, _smi: None}, + (_rAI, _dI, _em), + ((STRING, 9), (STRING, 9), (LIST_OF_STRING, {_sQ: _em})), +) + +GET_DEPLOYMENT_OUTPUT: StaticSchema = ( + 18, + n0, + _GDO, + {_sSI: _cDo, _smit: None}, + (_i, _d, _cD, _aS), + ((STRING, 0), (STRING, 0), (TIMESTAMP, 0), (PATH_TO_MAP_OF_METHOD_SNAPSHOT, 0)), +) + +GET_DEPLOYMENT: StaticOperationSchema = ( + 23, + n0, + _GD, + { + _smith: MappingProxyType( + { + "method": "GET", + "uri": "/restapis/{restApiId}/deployments/{deploymentId}", + "code": 200, + } + ) + }, + GET_DEPLOYMENT_INPUT, + GET_DEPLOYMENT_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + NOT_FOUND_EXCEPTION, + SERVICE_UNAVAILABLE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +GET_DEPLOYMENTS_INPUT: StaticSchema = ( + 18, + n0, + _GDIe, + {_sSI: _cGDRo, _smi: None}, + (_rAI, _pos, _li), + ((STRING, 9), (STRING, {_sQ: _pos}), (NULLABLE_INTEGER, {_sQ: _li})), +) + +DEPLOYMENT: StaticSchema = ( + 18, + n0, + _De, + 0, + (_i, _d, _cD, _aS), + ((STRING, 0), (STRING, 0), (TIMESTAMP, 0), (PATH_TO_MAP_OF_METHOD_SNAPSHOT, 0)), +) + +LIST_OF_DEPLOYMENT: StaticSchema = (16, n0, _LOD, 0, (_m,), ((DEPLOYMENT, 0),)) + +GET_DEPLOYMENTS_OUTPUT: StaticSchema = ( + 18, + n0, + _GDOe, + {_sSI: _cDom, _smit: None}, + (_it, _pos), + ((LIST_OF_DEPLOYMENT, {_sNm: _ite}), (STRING, {_sQ: _pos})), +) + +GET_DEPLOYMENTS: StaticOperationSchema = ( + 23, + n0, + _GDe, + { + _smith: MappingProxyType( + {"method": "GET", "uri": "/restapis/{restApiId}/deployments", "code": 200} + ) + }, + GET_DEPLOYMENTS_INPUT, + GET_DEPLOYMENTS_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + NOT_FOUND_EXCEPTION, + SERVICE_UNAVAILABLE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +GET_DOCUMENTATION_PART_INPUT: StaticSchema = ( + 18, + n0, + _GDPI, + {_sSI: _cGDPR, _smi: None}, + (_rAI, _dPI), + ((STRING, 9), (STRING, 9)), +) + +GET_DOCUMENTATION_PART_OUTPUT: StaticSchema = ( + 18, + n0, + _GDPO, + {_sSI: _cDP, _smit: None}, + (_i, _l, _pr), + ((STRING, 0), (DOCUMENTATION_PART_LOCATION, 0), (STRING, 0)), +) + +GET_DOCUMENTATION_PART: StaticOperationSchema = ( + 23, + n0, + _GDP, + { + _smith: MappingProxyType( + { + "method": "GET", + "uri": "/restapis/{restApiId}/documentation/parts/{documentationPartId}", + "code": 200, + } + ) + }, + GET_DOCUMENTATION_PART_INPUT, + GET_DOCUMENTATION_PART_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +LOCATION_STATUS_TYPE: StaticSchema = ( + 14, + n0, + _LST, + 0, + (_DOCUMENTED, _UNDOCUMENTED), + ((-1, {_sV: _DOCUMENTED}), (-1, {_sV: _UNDOCUMENTED})), +) + +GET_DOCUMENTATION_PARTS_INPUT: StaticSchema = ( + 18, + n0, + _GDPIe, + {_sSI: _cGDPRo, _smi: None}, + (_rAI, _ty, _nQ, _p, _pos, _li, _lS), + ( + (STRING, 9), + (DOCUMENTATION_PART_TYPE, {_sQ: _ty}), + (STRING, {_sQ: _n}), + (STRING, {_sQ: _p}), + (STRING, {_sQ: _pos}), + (NULLABLE_INTEGER, {_sQ: _li}), + (LOCATION_STATUS_TYPE, {_sQ: _lS}), + ), +) + +DOCUMENTATION_PART: StaticSchema = ( + 18, + n0, + _DP, + 0, + (_i, _l, _pr), + ((STRING, 0), (DOCUMENTATION_PART_LOCATION, 0), (STRING, 0)), +) + +LIST_OF_DOCUMENTATION_PART: StaticSchema = ( + 16, + n0, + _LODP, + 0, + (_m,), + ((DOCUMENTATION_PART, 0),), +) + +GET_DOCUMENTATION_PARTS_OUTPUT: StaticSchema = ( + 18, + n0, + _GDPOe, + {_sSI: _cDPo, _smit: None}, + (_it, _pos), + ((LIST_OF_DOCUMENTATION_PART, {_sNm: _ite}), (STRING, {_sQ: _pos})), +) + +GET_DOCUMENTATION_PARTS: StaticOperationSchema = ( + 23, + n0, + _GDPe, + { + _smith: MappingProxyType( + { + "method": "GET", + "uri": "/restapis/{restApiId}/documentation/parts", + "code": 200, + } + ) + }, + GET_DOCUMENTATION_PARTS_INPUT, + GET_DOCUMENTATION_PARTS_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +GET_DOCUMENTATION_VERSION_INPUT: StaticSchema = ( + 18, + n0, + _GDVI, + {_sSI: _cGDVR, _smi: None}, + (_rAI, _dV), + ((STRING, 9), (STRING, 9)), +) + +GET_DOCUMENTATION_VERSION_OUTPUT: StaticSchema = ( + 18, + n0, + _GDVO, + {_sSI: _cDV, _smit: None}, + (_ve, _cD, _d), + ((STRING, 0), (TIMESTAMP, 0), (STRING, 0)), +) + +GET_DOCUMENTATION_VERSION: StaticOperationSchema = ( + 23, + n0, + _GDV, + { + _smith: MappingProxyType( + { + "method": "GET", + "uri": "/restapis/{restApiId}/documentation/versions/{documentationVersion}", + "code": 200, + } + ) + }, + GET_DOCUMENTATION_VERSION_INPUT, + GET_DOCUMENTATION_VERSION_OUTPUT, + (NOT_FOUND_EXCEPTION, TOO_MANY_REQUESTS_EXCEPTION, UNAUTHORIZED_EXCEPTION), +) + +GET_DOCUMENTATION_VERSIONS_INPUT: StaticSchema = ( + 18, + n0, + _GDVIe, + {_sSI: _cGDVRo, _smi: None}, + (_rAI, _pos, _li), + ((STRING, 9), (STRING, {_sQ: _pos}), (NULLABLE_INTEGER, {_sQ: _li})), +) + +DOCUMENTATION_VERSION: StaticSchema = ( + 18, + n0, + _DV, + 0, + (_ve, _cD, _d), + ((STRING, 0), (TIMESTAMP, 0), (STRING, 0)), +) + +LIST_OF_DOCUMENTATION_VERSION: StaticSchema = ( + 16, + n0, + _LODV, + 0, + (_m,), + ((DOCUMENTATION_VERSION, 0),), +) + +GET_DOCUMENTATION_VERSIONS_OUTPUT: StaticSchema = ( + 18, + n0, + _GDVOe, + {_sSI: _cDVo, _smit: None}, + (_it, _pos), + ((LIST_OF_DOCUMENTATION_VERSION, {_sNm: _ite}), (STRING, {_sQ: _pos})), +) + +GET_DOCUMENTATION_VERSIONS: StaticOperationSchema = ( + 23, + n0, + _GDVe, + { + _smith: MappingProxyType( + { + "method": "GET", + "uri": "/restapis/{restApiId}/documentation/versions", + "code": 200, + } + ) + }, + GET_DOCUMENTATION_VERSIONS_INPUT, + GET_DOCUMENTATION_VERSIONS_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +GET_DOMAIN_NAME_INPUT: StaticSchema = ( + 18, + n0, + _GDNI, + {_sSI: _cGDNR, _smi: None}, + (_dN, _dNI), + ((STRING, 9), (STRING, {_sQ: _dNI})), +) + +GET_DOMAIN_NAME_OUTPUT: StaticSchema = ( + 18, + n0, + _GDNO, + {_sSI: _cDN, _smit: None}, + ( + _dN, + _dNI, + _dNA, + _cN, + _cAe, + _cUD, + _rDN, + _rHZI, + _rCN, + _rCA, + _dDN, + _dHZI, + _eC, + _dNS, + _dNSM, + _sP, + _eAM, + _t, + _mTA, + _oVCA, + _mP, + _po, + _rM, + ), + ( + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (TIMESTAMP, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (ENDPOINT_CONFIGURATION, 0), + (DOMAIN_NAME_STATUS, 0), + (STRING, 0), + (SECURITY_POLICY, 0), + (ENDPOINT_ACCESS_MODE, 0), + (MAP_OF_STRING_TO_STRING, 0), + (MUTUAL_TLS_AUTHENTICATION, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (ROUTING_MODE, 0), + ), +) + +GET_DOMAIN_NAME: StaticOperationSchema = ( + 23, + n0, + _GDN, + { + _smith: MappingProxyType( + {"method": "GET", "uri": "/domainnames/{domainName}", "code": 200} + ) + }, + GET_DOMAIN_NAME_INPUT, + GET_DOMAIN_NAME_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +RESOURCE_OWNER: StaticSchema = ( + 14, + n0, + _RO, + 0, + (_SELF, _OA), + ((-1, {_sV: _SELF}), (-1, {_sV: _OA})), +) + +GET_DOMAIN_NAME_ACCESS_ASSOCIATIONS_INPUT: StaticSchema = ( + 18, + n0, + _GDNAAI, + {_sSI: _cGDNAAR, _smi: None}, + (_pos, _li, _rO), + ( + (STRING, {_sQ: _pos}), + (NULLABLE_INTEGER, {_sQ: _li}), + (RESOURCE_OWNER, {_sQ: _rO}), + ), +) + +DOMAIN_NAME_ACCESS_ASSOCIATION: StaticSchema = ( + 18, + n0, + _DNAA, + 0, + (_dNAAA, _dNA, _aAST, _aAS, _t), + ( + (STRING, 0), + (STRING, 0), + (ACCESS_ASSOCIATION_SOURCE_TYPE, 0), + (STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + ), +) + +LIST_OF_DOMAIN_NAME_ACCESS_ASSOCIATION: StaticSchema = ( + 16, + n0, + _LODNAA, + 0, + (_m,), + ((DOMAIN_NAME_ACCESS_ASSOCIATION, 0),), +) + +GET_DOMAIN_NAME_ACCESS_ASSOCIATIONS_OUTPUT: StaticSchema = ( + 18, + n0, + _GDNAAO, + {_sSI: _cDNAAo, _smit: None}, + (_it, _pos), + ((LIST_OF_DOMAIN_NAME_ACCESS_ASSOCIATION, {_sNm: _ite}), (STRING, {_sQ: _pos})), +) + +GET_DOMAIN_NAME_ACCESS_ASSOCIATIONS: StaticOperationSchema = ( + 23, + n0, + _GDNAA, + { + _smith: MappingProxyType( + {"method": "GET", "uri": "/domainnameaccessassociations", "code": 200} + ) + }, + GET_DOMAIN_NAME_ACCESS_ASSOCIATIONS_INPUT, + GET_DOMAIN_NAME_ACCESS_ASSOCIATIONS_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +GET_DOMAIN_NAMES_INPUT: StaticSchema = ( + 18, + n0, + _GDNIe, + {_sSI: _cGDNRo, _smi: None}, + (_pos, _li, _rO), + ( + (STRING, {_sQ: _pos}), + (NULLABLE_INTEGER, {_sQ: _li}), + (RESOURCE_OWNER, {_sQ: _rO}), + ), +) + +DOMAIN_NAME: StaticSchema = ( + 18, + n0, + _DN, + 0, + ( + _dN, + _dNI, + _dNA, + _cN, + _cAe, + _cUD, + _rDN, + _rHZI, + _rCN, + _rCA, + _dDN, + _dHZI, + _eC, + _dNS, + _dNSM, + _sP, + _eAM, + _t, + _mTA, + _oVCA, + _mP, + _po, + _rM, + ), + ( + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (TIMESTAMP, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (ENDPOINT_CONFIGURATION, 0), + (DOMAIN_NAME_STATUS, 0), + (STRING, 0), + (SECURITY_POLICY, 0), + (ENDPOINT_ACCESS_MODE, 0), + (MAP_OF_STRING_TO_STRING, 0), + (MUTUAL_TLS_AUTHENTICATION, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (ROUTING_MODE, 0), + ), +) + +LIST_OF_DOMAIN_NAME: StaticSchema = (16, n0, _LODN, 0, (_m,), ((DOMAIN_NAME, 0),)) + +GET_DOMAIN_NAMES_OUTPUT: StaticSchema = ( + 18, + n0, + _GDNOe, + {_sSI: _cDNo, _smit: None}, + (_it, _pos), + ((LIST_OF_DOMAIN_NAME, {_sNm: _ite}), (STRING, {_sQ: _pos})), +) + +GET_DOMAIN_NAMES: StaticOperationSchema = ( + 23, + n0, + _GDNe, + {_smith: MappingProxyType({"method": "GET", "uri": "/domainnames", "code": 200})}, + GET_DOMAIN_NAMES_INPUT, + GET_DOMAIN_NAMES_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +GET_EXPORT_INPUT: StaticSchema = ( + 18, + n0, + _GEI, + {_sSI: _cGER, _smi: None}, + (_rAI, _sN, _eT, _pa, _a), + ( + (STRING, 9), + (STRING, 9), + (STRING, 9), + (MAP_OF_STRING_TO_STRING, 1024), + (STRING, {_sH: _Ac}), + ), +) + +BLOB: StaticSchema = (1, n0, _Bl, 0) + +GET_EXPORT_OUTPUT: StaticSchema = ( + 18, + n0, + _GEO, + {_sSI: _cER, _smit: None}, + (_cT, _cDon, _b), + ((STRING, {_sH: _CT_}), (STRING, {_sH: _CD_}), (BLOB, 16)), +) + +GET_EXPORT: StaticOperationSchema = ( + 23, + n0, + _GE, + { + _smith: MappingProxyType( + { + "method": "GET", + "uri": "/restapis/{restApiId}/stages/{stageName}/exports/{exportType}", + "code": 200, + } + ) + }, + GET_EXPORT_INPUT, + GET_EXPORT_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +GET_GATEWAY_RESPONSE_INPUT: StaticSchema = ( + 18, + n0, + _GGRI, + {_sSI: _cGGRR, _smi: None}, + (_rAI, _rTes), + ((STRING, 9), (GATEWAY_RESPONSE_TYPE, 9)), +) + +GET_GATEWAY_RESPONSE_OUTPUT: StaticSchema = ( + 18, + n0, + _GGRO, + {_sSI: _cGR, _smit: None}, + (_rTes, _sC, _rP, _rT, _dR), + ( + (GATEWAY_RESPONSE_TYPE, 0), + (STATUS_CODE, 0), + (MAP_OF_STRING_TO_STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + (BOOLEAN, {_s: False}), + ), +) + +GET_GATEWAY_RESPONSE: StaticOperationSchema = ( + 23, + n0, + _GGR, + { + _smith: MappingProxyType( + { + "method": "GET", + "uri": "/restapis/{restApiId}/gatewayresponses/{responseType}", + "code": 200, + } + ) + }, + GET_GATEWAY_RESPONSE_INPUT, + GET_GATEWAY_RESPONSE_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +GET_GATEWAY_RESPONSES_INPUT: StaticSchema = ( + 18, + n0, + _GGRIe, + {_sSI: _cGGRRo, _smi: None}, + (_rAI, _pos, _li), + ((STRING, 9), (STRING, {_sQ: _pos}), (NULLABLE_INTEGER, {_sQ: _li})), +) + +GATEWAY_RESPONSE: StaticSchema = ( + 18, + n0, + _GR, + 0, + (_rTes, _sC, _rP, _rT, _dR), + ( + (GATEWAY_RESPONSE_TYPE, 0), + (STATUS_CODE, 0), + (MAP_OF_STRING_TO_STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + (BOOLEAN, {_s: False}), + ), +) + +LIST_OF_GATEWAY_RESPONSE: StaticSchema = ( + 16, + n0, + _LOGR, + 0, + (_m,), + ((GATEWAY_RESPONSE, 0),), +) + +GET_GATEWAY_RESPONSES_OUTPUT: StaticSchema = ( + 18, + n0, + _GGROe, + {_sSI: _cGRo, _smit: None}, + (_it, _pos), + ((LIST_OF_GATEWAY_RESPONSE, {_sNm: _ite}), (STRING, {_sQ: _pos})), +) + +GET_GATEWAY_RESPONSES: StaticOperationSchema = ( + 23, + n0, + _GGRe, + { + _smith: MappingProxyType( + { + "method": "GET", + "uri": "/restapis/{restApiId}/gatewayresponses", + "code": 200, + } + ) + }, + GET_GATEWAY_RESPONSES_INPUT, + GET_GATEWAY_RESPONSES_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +GET_INTEGRATION_INPUT: StaticSchema = ( + 18, + n0, + _GII, + {_sSI: _cGIR, _smi: None}, + (_rAI, _rI, _hM), + ((STRING, 9), (STRING, 9), (STRING, 9)), +) + +GET_INTEGRATION_OUTPUT: StaticSchema = ( + 18, + n0, + _GIO, + {_sSI: _cIom, _smit: None}, + ( + _ty, + _hM, + _u, + _cTo, + _cIo, + _cr, + _rPe, + _rTe, + _pB, + _cH, + _tIM, + _cNa, + _cKP, + _iR, + _tC, + _rTM, + _iT, + ), + ( + (INTEGRATION_TYPE, 0), + (STRING, 0), + (STRING, 0), + (CONNECTION_TYPE, 0), + (STRING, 0), + (STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + (STRING, 0), + (CONTENT_HANDLING_STRATEGY, 0), + (INTEGER, {_s: 0}), + (STRING, 0), + (LIST_OF_STRING, 0), + (MAP_OF_INTEGRATION_RESPONSE, 0), + (TLS_CONFIG, 0), + (RESPONSE_TRANSFER_MODE, 0), + (STRING, 0), + ), +) + +GET_INTEGRATION: StaticOperationSchema = ( + 23, + n0, + _GI, + { + _smith: MappingProxyType( + { + "method": "GET", + "uri": "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}/integration", + "code": 200, + } + ) + }, + GET_INTEGRATION_INPUT, + GET_INTEGRATION_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +GET_INTEGRATION_RESPONSE_INPUT: StaticSchema = ( + 18, + n0, + _GIRI, + {_sSI: _cGIRR, _smi: None}, + (_rAI, _rI, _hM, _sC), + ((STRING, 9), (STRING, 9), (STRING, 9), (STATUS_CODE, 9)), +) + +GET_INTEGRATION_RESPONSE_OUTPUT: StaticSchema = ( + 18, + n0, + _GIRO, + {_sSI: _cIR, _smit: None}, + (_sC, _sPe, _rP, _rT, _cH), + ( + (STATUS_CODE, 0), + (STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + (CONTENT_HANDLING_STRATEGY, 0), + ), +) + +GET_INTEGRATION_RESPONSE: StaticOperationSchema = ( + 23, + n0, + _GIR, + { + _smith: MappingProxyType( + { + "method": "GET", + "uri": "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}/integration/responses/{statusCode}", + "code": 200, + } + ) + }, + GET_INTEGRATION_RESPONSE_INPUT, + GET_INTEGRATION_RESPONSE_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +GET_METHOD_INPUT: StaticSchema = ( + 18, + n0, + _GMI, + {_sSI: _cGMR, _smi: None}, + (_rAI, _rI, _hM), + ((STRING, 9), (STRING, 9), (STRING, 9)), +) + +GET_METHOD_OUTPUT: StaticSchema = ( + 18, + n0, + _GMO, + {_sSI: _cMo, _smit: None}, + (_hM, _aTu, _aIu, _aKR, _rVI, _oN, _rPe, _rMeq, _mR, _mI, _aSu), + ( + (STRING, 0), + (STRING, 0), + (STRING, 0), + (NULLABLE_BOOLEAN, 0), + (STRING, 0), + (STRING, 0), + (MAP_OF_STRING_TO_BOOLEAN, 0), + (MAP_OF_STRING_TO_STRING, 0), + (MAP_OF_METHOD_RESPONSE, 0), + (INTEGRATION, 0), + (LIST_OF_STRING, 0), + ), +) + +GET_METHOD: StaticOperationSchema = ( + 23, + n0, + _GM, + { + _smith: MappingProxyType( + { + "method": "GET", + "uri": "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}", + "code": 200, + } + ) + }, + GET_METHOD_INPUT, + GET_METHOD_OUTPUT, + (NOT_FOUND_EXCEPTION, TOO_MANY_REQUESTS_EXCEPTION, UNAUTHORIZED_EXCEPTION), +) + +GET_METHOD_RESPONSE_INPUT: StaticSchema = ( + 18, + n0, + _GMRI, + {_sSI: _cGMRR, _smi: None}, + (_rAI, _rI, _hM, _sC), + ((STRING, 9), (STRING, 9), (STRING, 9), (STATUS_CODE, 9)), +) + +GET_METHOD_RESPONSE_OUTPUT: StaticSchema = ( + 18, + n0, + _GMRO, + {_sSI: _cMR, _smit: None}, + (_sC, _rP, _rMe), + ((STATUS_CODE, 0), (MAP_OF_STRING_TO_BOOLEAN, 0), (MAP_OF_STRING_TO_STRING, 0)), +) + +GET_METHOD_RESPONSE: StaticOperationSchema = ( + 23, + n0, + _GMR, + { + _smith: MappingProxyType( + { + "method": "GET", + "uri": "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}/responses/{statusCode}", + "code": 200, + } + ) + }, + GET_METHOD_RESPONSE_INPUT, + GET_METHOD_RESPONSE_OUTPUT, + (NOT_FOUND_EXCEPTION, TOO_MANY_REQUESTS_EXCEPTION, UNAUTHORIZED_EXCEPTION), +) + +GET_MODEL_INPUT: StaticSchema = ( + 18, + n0, + _GMIe, + {_sSI: _cGMRo, _smi: None}, + (_rAI, _mN, _fl), + ((STRING, 9), (STRING, 9), (BOOLEAN, {_s: False, _sQ: _fl})), +) + +GET_MODEL_OUTPUT: StaticSchema = ( + 18, + n0, + _GMOe, + {_sSI: _cM, _smit: None}, + (_i, _n, _d, _sc, _cT), + ((STRING, 0), (STRING, 0), (STRING, 0), (STRING, 0), (STRING, 0)), +) + +GET_MODEL: StaticOperationSchema = ( + 23, + n0, + _GMe, + { + _smith: MappingProxyType( + { + "method": "GET", + "uri": "/restapis/{restApiId}/models/{modelName}", + "code": 200, + } + ) + }, + GET_MODEL_INPUT, + GET_MODEL_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +GET_MODELS_INPUT: StaticSchema = ( + 18, + n0, + _GMIet, + {_sSI: _cGMRom, _smi: None}, + (_rAI, _pos, _li), + ((STRING, 9), (STRING, {_sQ: _pos}), (NULLABLE_INTEGER, {_sQ: _li})), +) + +MODEL: StaticSchema = ( + 18, + n0, + _Mo, + 0, + (_i, _n, _d, _sc, _cT), + ((STRING, 0), (STRING, 0), (STRING, 0), (STRING, 0), (STRING, 0)), +) + +LIST_OF_MODEL: StaticSchema = (16, n0, _LOM, 0, (_m,), ((MODEL, 0),)) + +GET_MODELS_OUTPUT: StaticSchema = ( + 18, + n0, + _GMOet, + {_sSI: _cMom, _smit: None}, + (_it, _pos), + ((LIST_OF_MODEL, {_sNm: _ite}), (STRING, {_sQ: _pos})), +) + +GET_MODELS: StaticOperationSchema = ( + 23, + n0, + _GMet, + { + _smith: MappingProxyType( + {"method": "GET", "uri": "/restapis/{restApiId}/models", "code": 200} + ) + }, + GET_MODELS_INPUT, + GET_MODELS_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +GET_MODEL_TEMPLATE_INPUT: StaticSchema = ( + 18, + n0, + _GMTI, + {_sSI: _cGMTR, _smi: None}, + (_rAI, _mN), + ((STRING, 9), (STRING, 9)), +) + +GET_MODEL_TEMPLATE_OUTPUT: StaticSchema = ( + 18, + n0, + _GMTO, + {_sSI: _cTom, _smit: None}, + (_v,), + ((STRING, 0),), +) + +GET_MODEL_TEMPLATE: StaticOperationSchema = ( + 23, + n0, + _GMT, + { + _smith: MappingProxyType( + { + "method": "GET", + "uri": "/restapis/{restApiId}/models/{modelName}/default_template", + "code": 200, + } + ) + }, + GET_MODEL_TEMPLATE_INPUT, + GET_MODEL_TEMPLATE_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +GET_REQUEST_VALIDATOR_INPUT: StaticSchema = ( + 18, + n0, + _GRVI, + {_sSI: _cGRVR, _smi: None}, + (_rAI, _rVI), + ((STRING, 9), (STRING, 9)), +) + +GET_REQUEST_VALIDATOR_OUTPUT: StaticSchema = ( + 18, + n0, + _GRVO, + {_sSI: _cRV, _smit: None}, + (_i, _n, _vRB, _vRP), + ((STRING, 0), (STRING, 0), (BOOLEAN, {_s: False}), (BOOLEAN, {_s: False})), +) + +GET_REQUEST_VALIDATOR: StaticOperationSchema = ( + 23, + n0, + _GRV, + { + _smith: MappingProxyType( + { + "method": "GET", + "uri": "/restapis/{restApiId}/requestvalidators/{requestValidatorId}", + "code": 200, + } + ) + }, + GET_REQUEST_VALIDATOR_INPUT, + GET_REQUEST_VALIDATOR_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +GET_REQUEST_VALIDATORS_INPUT: StaticSchema = ( + 18, + n0, + _GRVIe, + {_sSI: _cGRVRo, _smi: None}, + (_rAI, _pos, _li), + ((STRING, 9), (STRING, {_sQ: _pos}), (NULLABLE_INTEGER, {_sQ: _li})), +) + +REQUEST_VALIDATOR: StaticSchema = ( + 18, + n0, + _RV, + 0, + (_i, _n, _vRB, _vRP), + ((STRING, 0), (STRING, 0), (BOOLEAN, {_s: False}), (BOOLEAN, {_s: False})), +) + +LIST_OF_REQUEST_VALIDATOR: StaticSchema = ( + 16, + n0, + _LORV, + 0, + (_m,), + ((REQUEST_VALIDATOR, 0),), +) + +GET_REQUEST_VALIDATORS_OUTPUT: StaticSchema = ( + 18, + n0, + _GRVOe, + {_sSI: _cRVo, _smit: None}, + (_it, _pos), + ((LIST_OF_REQUEST_VALIDATOR, {_sNm: _ite}), (STRING, {_sQ: _pos})), +) + +GET_REQUEST_VALIDATORS: StaticOperationSchema = ( + 23, + n0, + _GRVe, + { + _smith: MappingProxyType( + { + "method": "GET", + "uri": "/restapis/{restApiId}/requestvalidators", + "code": 200, + } + ) + }, + GET_REQUEST_VALIDATORS_INPUT, + GET_REQUEST_VALIDATORS_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +GET_RESOURCE_INPUT: StaticSchema = ( + 18, + n0, + _GRI, + {_sSI: _cGRR, _smi: None}, + (_rAI, _rI, _em), + ((STRING, 9), (STRING, 9), (LIST_OF_STRING, {_sQ: _em})), +) + +GET_RESOURCE_OUTPUT: StaticSchema = ( + 18, + n0, + _GRO, + {_sSI: _cR, _smit: None}, + (_i, _pI, _pP, _p, _rMes), + ((STRING, 0), (STRING, 0), (STRING, 0), (STRING, 0), (MAP_OF_METHOD, 0)), +) + +GET_RESOURCE: StaticOperationSchema = ( + 23, + n0, + _GRe, + { + _smith: MappingProxyType( + { + "method": "GET", + "uri": "/restapis/{restApiId}/resources/{resourceId}", + "code": 200, + } + ) + }, + GET_RESOURCE_INPUT, + GET_RESOURCE_OUTPUT, + (NOT_FOUND_EXCEPTION, TOO_MANY_REQUESTS_EXCEPTION, UNAUTHORIZED_EXCEPTION), +) + +GET_RESOURCES_INPUT: StaticSchema = ( + 18, + n0, + _GRIe, + {_sSI: _cGRRo, _smi: None}, + (_rAI, _pos, _li, _em), + ( + (STRING, 9), + (STRING, {_sQ: _pos}), + (NULLABLE_INTEGER, {_sQ: _li}), + (LIST_OF_STRING, {_sQ: _em}), + ), +) + +RESOURCE: StaticSchema = ( + 18, + n0, + _R, + 0, + (_i, _pI, _pP, _p, _rMes), + ((STRING, 0), (STRING, 0), (STRING, 0), (STRING, 0), (MAP_OF_METHOD, 0)), +) + +LIST_OF_RESOURCE: StaticSchema = (16, n0, _LOR, 0, (_m,), ((RESOURCE, 0),)) + +GET_RESOURCES_OUTPUT: StaticSchema = ( + 18, + n0, + _GROe, + {_sSI: _cRo, _smit: None}, + (_it, _pos), + ((LIST_OF_RESOURCE, {_sNm: _ite}), (STRING, {_sQ: _pos})), +) + +GET_RESOURCES: StaticOperationSchema = ( + 23, + n0, + _GRet, + { + _smith: MappingProxyType( + {"method": "GET", "uri": "/restapis/{restApiId}/resources", "code": 200} + ) + }, + GET_RESOURCES_INPUT, + GET_RESOURCES_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +GET_REST_API_INPUT: StaticSchema = ( + 18, + n0, + _GRAI, + {_sSI: _cGRAR, _smi: None}, + (_rAI,), + ((STRING, 9),), +) + +GET_REST_API_OUTPUT: StaticSchema = ( + 18, + n0, + _GRAO, + {_sSI: _cRA, _smit: None}, + ( + _i, + _n, + _d, + _cD, + _ve, + _w, + _bMT, + _mCS, + _aKS, + _eC, + _po, + _t, + _dEAE, + _rRI, + _sP, + _eAM, + _aSp, + _aSM, + ), + ( + (STRING, 0), + (STRING, 0), + (STRING, 0), + (TIMESTAMP, 0), + (STRING, 0), + (LIST_OF_STRING, 0), + (LIST_OF_STRING, 0), + (NULLABLE_INTEGER, 0), + (API_KEY_SOURCE_TYPE, 0), + (ENDPOINT_CONFIGURATION, 0), + (STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + (BOOLEAN, {_s: False}), + (STRING, 0), + (SECURITY_POLICY, 0), + (ENDPOINT_ACCESS_MODE, 0), + (API_STATUS, 0), + (STRING, 0), + ), +) + +GET_REST_API: StaticOperationSchema = ( + 23, + n0, + _GRA, + { + _smith: MappingProxyType( + {"method": "GET", "uri": "/restapis/{restApiId}", "code": 200} + ) + }, + GET_REST_API_INPUT, + GET_REST_API_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +GET_REST_APIS_INPUT: StaticSchema = ( + 18, + n0, + _GRAIe, + {_sSI: _cGRARo, _smi: None}, + (_pos, _li), + ((STRING, {_sQ: _pos}), (NULLABLE_INTEGER, {_sQ: _li})), +) + +REST_API: StaticSchema = ( + 18, + n0, + _RAe, + 0, + ( + _i, + _n, + _d, + _cD, + _ve, + _w, + _bMT, + _mCS, + _aKS, + _eC, + _po, + _t, + _dEAE, + _rRI, + _sP, + _eAM, + _aSp, + _aSM, + ), + ( + (STRING, 0), + (STRING, 0), + (STRING, 0), + (TIMESTAMP, 0), + (STRING, 0), + (LIST_OF_STRING, 0), + (LIST_OF_STRING, 0), + (NULLABLE_INTEGER, 0), + (API_KEY_SOURCE_TYPE, 0), + (ENDPOINT_CONFIGURATION, 0), + (STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + (BOOLEAN, {_s: False}), + (STRING, 0), + (SECURITY_POLICY, 0), + (ENDPOINT_ACCESS_MODE, 0), + (API_STATUS, 0), + (STRING, 0), + ), +) + +LIST_OF_REST_API: StaticSchema = (16, n0, _LORA, 0, (_m,), ((REST_API, 0),)) + +GET_REST_APIS_OUTPUT: StaticSchema = ( + 18, + n0, + _GRAOe, + {_sSI: _cRAo, _smit: None}, + (_it, _pos), + ((LIST_OF_REST_API, {_sNm: _ite}), (STRING, {_sQ: _pos})), +) + +GET_REST_APIS: StaticOperationSchema = ( + 23, + n0, + _GRAe, + {_smith: MappingProxyType({"method": "GET", "uri": "/restapis", "code": 200})}, + GET_REST_APIS_INPUT, + GET_REST_APIS_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +GET_SDK_INPUT: StaticSchema = ( + 18, + n0, + _GSI, + {_sSI: _cGSR, _smi: None}, + (_rAI, _sN, _sT, _pa), + ((STRING, 9), (STRING, 9), (STRING, 9), (MAP_OF_STRING_TO_STRING, 1024)), +) + +GET_SDK_OUTPUT: StaticSchema = ( + 18, + n0, + _GSO, + {_sSI: _cSR, _smit: None}, + (_cT, _cDon, _b), + ((STRING, {_sH: _CT_}), (STRING, {_sH: _CD_}), (BLOB, 16)), +) + +GET_SDK: StaticOperationSchema = ( + 23, + n0, + _GS, + { + _smith: MappingProxyType( + { + "method": "GET", + "uri": "/restapis/{restApiId}/stages/{stageName}/sdks/{sdkType}", + "code": 200, + } + ) + }, + GET_SDK_INPUT, + GET_SDK_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +GET_SDK_TYPE_INPUT: StaticSchema = ( + 18, + n0, + _GSTI, + {_sSI: _cGSTR, _smi: None}, + (_i,), + ((STRING, 9),), +) + +SDK_CONFIGURATION_PROPERTY: StaticSchema = ( + 18, + n0, + _SCP, + 0, + (_n, _fN, _d, _r, _dVe), + ((STRING, 0), (STRING, 0), (STRING, 0), (BOOLEAN, {_s: False}), (STRING, 0)), +) + +LIST_OF_SDK_CONFIGURATION_PROPERTY: StaticSchema = ( + 16, + n0, + _LOSCP, + 0, + (_m,), + ((SDK_CONFIGURATION_PROPERTY, 0),), +) + +GET_SDK_TYPE_OUTPUT: StaticSchema = ( + 18, + n0, + _GSTO, + {_sSI: _cST, _smit: None}, + (_i, _fN, _d, _cP), + ((STRING, 0), (STRING, 0), (STRING, 0), (LIST_OF_SDK_CONFIGURATION_PROPERTY, 0)), +) + +GET_SDK_TYPE: StaticOperationSchema = ( + 23, + n0, + _GST, + {_smith: MappingProxyType({"method": "GET", "uri": "/sdktypes/{id}", "code": 200})}, + GET_SDK_TYPE_INPUT, + GET_SDK_TYPE_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +GET_SDK_TYPES_INPUT: StaticSchema = ( + 18, + n0, + _GSTIe, + {_sSI: _cGSTRo, _smi: None}, + (_pos, _li), + ((STRING, {_sQ: _pos}), (NULLABLE_INTEGER, {_sQ: _li})), +) + +SDK_TYPE: StaticSchema = ( + 18, + n0, + _STd, + 0, + (_i, _fN, _d, _cP), + ((STRING, 0), (STRING, 0), (STRING, 0), (LIST_OF_SDK_CONFIGURATION_PROPERTY, 0)), +) + +LIST_OF_SDK_TYPE: StaticSchema = (16, n0, _LOST, 0, (_m,), ((SDK_TYPE, 0),)) + +GET_SDK_TYPES_OUTPUT: StaticSchema = ( + 18, + n0, + _GSTOe, + {_sSI: _cSTo, _smit: None}, + (_it,), + ((LIST_OF_SDK_TYPE, {_sNm: _ite}),), +) + +GET_SDK_TYPES: StaticOperationSchema = ( + 23, + n0, + _GSTe, + {_smith: MappingProxyType({"method": "GET", "uri": "/sdktypes", "code": 200})}, + GET_SDK_TYPES_INPUT, + GET_SDK_TYPES_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +GET_STAGE_INPUT: StaticSchema = ( + 18, + n0, + _GSIe, + {_sSI: _cGSRo, _smi: None}, + (_rAI, _sN), + ((STRING, 9), (STRING, 9)), +) + +GET_STAGE_OUTPUT: StaticSchema = ( + 18, + n0, + _GSOe, + {_sSI: _cSo, _smit: None}, + ( + _dI, + _cCI, + _sN, + _d, + _cCE, + _cCS, + _cCSa, + _mS, + _va, + _dV, + _aLS, + _cS, + _tE, + _wAA, + _t, + _cD, + _lUD, + ), + ( + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (BOOLEAN, {_s: False}), + (CACHE_CLUSTER_SIZE, 0), + (CACHE_CLUSTER_STATUS, 0), + (MAP_OF_METHOD_SETTINGS, 0), + (MAP_OF_STRING_TO_STRING, 0), + (STRING, 0), + (ACCESS_LOG_SETTINGS, 0), + (CANARY_SETTINGS, 0), + (BOOLEAN, {_s: False}), + (STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + (TIMESTAMP, 0), + (TIMESTAMP, 0), + ), +) + +GET_STAGE: StaticOperationSchema = ( + 23, + n0, + _GSe, + { + _smith: MappingProxyType( + { + "method": "GET", + "uri": "/restapis/{restApiId}/stages/{stageName}", + "code": 200, + } + ) + }, + GET_STAGE_INPUT, + GET_STAGE_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +GET_STAGES_INPUT: StaticSchema = ( + 18, + n0, + _GSIet, + {_sSI: _cGSRom, _smi: None}, + (_rAI, _dI), + ((STRING, 9), (STRING, {_sQ: _dI})), +) + +STAGE: StaticSchema = ( + 18, + n0, + _St, + 0, + ( + _dI, + _cCI, + _sN, + _d, + _cCE, + _cCS, + _cCSa, + _mS, + _va, + _dV, + _aLS, + _cS, + _tE, + _wAA, + _t, + _cD, + _lUD, + ), + ( + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (BOOLEAN, {_s: False}), + (CACHE_CLUSTER_SIZE, 0), + (CACHE_CLUSTER_STATUS, 0), + (MAP_OF_METHOD_SETTINGS, 0), + (MAP_OF_STRING_TO_STRING, 0), + (STRING, 0), + (ACCESS_LOG_SETTINGS, 0), + (CANARY_SETTINGS, 0), + (BOOLEAN, {_s: False}), + (STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + (TIMESTAMP, 0), + (TIMESTAMP, 0), + ), +) + +LIST_OF_STAGE: StaticSchema = (16, n0, _LOSi, 0, (_m,), ((STAGE, 0),)) + +GET_STAGES_OUTPUT: StaticSchema = ( + 18, + n0, + _GSOet, + {_sSI: _cSom, _smit: None}, + (_ite,), + ((LIST_OF_STAGE, 0),), +) + +GET_STAGES: StaticOperationSchema = ( + 23, + n0, + _GSet, + { + _smith: MappingProxyType( + {"method": "GET", "uri": "/restapis/{restApiId}/stages", "code": 200} + ) + }, + GET_STAGES_INPUT, + GET_STAGES_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +GET_TAGS_INPUT: StaticSchema = ( + 18, + n0, + _GTI, + {_sSI: _cGTR, _smi: None}, + (_rA, _pos, _li), + ((STRING, 9), (STRING, {_sQ: _pos}), (NULLABLE_INTEGER, {_sQ: _li})), +) + +GET_TAGS_OUTPUT: StaticSchema = ( + 18, + n0, + _GTO, + {_sSI: _cToma, _smit: None}, + (_t,), + ((MAP_OF_STRING_TO_STRING, 0),), +) + +GET_TAGS: StaticOperationSchema = ( + 23, + n0, + _GT, + { + _smith: MappingProxyType( + {"method": "GET", "uri": "/tags/{resourceArn}", "code": 200} + ) + }, + GET_TAGS_INPUT, + GET_TAGS_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +GET_USAGE_INPUT: StaticSchema = ( + 18, + n0, + _GUI, + {_sSI: _cGUR, _smi: None}, + (_uPI, _kI, _sDt, _eDn, _pos, _li), + ( + (STRING, 9), + (STRING, {_sQ: _kI}), + (STRING, {_sQ: _sDt, _smithy: None}), + (STRING, {_sQ: _eDn, _smithy: None}), + (STRING, {_sQ: _pos}), + (NULLABLE_INTEGER, {_sQ: _li}), + ), +) + +LONG: StaticSchema = (8, n0, _L, {_s: 0}) + +LIST_OF_LONG: StaticSchema = (16, n0, _LOL, 0, (_m,), ((LONG, 0),)) + +LIST_OF_USAGE: StaticSchema = (16, n0, _LOU, 0, (_m,), ((LIST_OF_LONG, 0),)) + +MAP_OF_KEY_USAGES: StaticSchema = ( + 17, + n0, + _MOKU, + 0, + (_k, _v), + ((STRING, 0), (LIST_OF_USAGE, 0)), +) + +GET_USAGE_OUTPUT: StaticSchema = ( + 18, + n0, + _GUO, + {_sSI: _cU, _smit: None}, + (_uPI, _sDt, _eDn, _it, _pos), + ( + (STRING, 0), + (STRING, 0), + (STRING, 0), + (MAP_OF_KEY_USAGES, {_sNm: _val}), + (STRING, {_sQ: _pos}), + ), +) + +GET_USAGE: StaticOperationSchema = ( + 23, + n0, + _GU, + { + _smith: MappingProxyType( + {"method": "GET", "uri": "/usageplans/{usagePlanId}/usage", "code": 200} + ) + }, + GET_USAGE_INPUT, + GET_USAGE_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +GET_USAGE_PLAN_INPUT: StaticSchema = ( + 18, + n0, + _GUPI, + {_sSI: _cGUPR, _smi: None}, + (_uPI,), + ((STRING, 9),), +) + +GET_USAGE_PLAN_OUTPUT: StaticSchema = ( + 18, + n0, + _GUPO, + {_sSI: _cUP, _smit: None}, + (_i, _n, _d, _aSpi, _th, _q, _pC, _t), + ( + (STRING, 0), + (STRING, 0), + (STRING, 0), + (LIST_OF_API_STAGE, 0), + (THROTTLE_SETTINGS, 0), + (QUOTA_SETTINGS, 0), + (STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + ), +) + +GET_USAGE_PLAN: StaticOperationSchema = ( + 23, + n0, + _GUP, + { + _smith: MappingProxyType( + {"method": "GET", "uri": "/usageplans/{usagePlanId}", "code": 200} + ) + }, + GET_USAGE_PLAN_INPUT, + GET_USAGE_PLAN_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +GET_USAGE_PLAN_KEY_INPUT: StaticSchema = ( + 18, + n0, + _GUPKI, + {_sSI: _cGUPKR, _smi: None}, + (_uPI, _kI), + ((STRING, 9), (STRING, 9)), +) + +GET_USAGE_PLAN_KEY_OUTPUT: StaticSchema = ( + 18, + n0, + _GUPKO, + {_sSI: _cUPK, _smit: None}, + (_i, _ty, _v, _n), + ((STRING, 0), (STRING, 0), (STRING, 0), (STRING, 0)), +) + +GET_USAGE_PLAN_KEY: StaticOperationSchema = ( + 23, + n0, + _GUPK, + { + _smith: MappingProxyType( + { + "method": "GET", + "uri": "/usageplans/{usagePlanId}/keys/{keyId}", + "code": 200, + } + ) + }, + GET_USAGE_PLAN_KEY_INPUT, + GET_USAGE_PLAN_KEY_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +GET_USAGE_PLAN_KEYS_INPUT: StaticSchema = ( + 18, + n0, + _GUPKIe, + {_sSI: _cGUPKRo, _smi: None}, + (_uPI, _pos, _li, _nQ), + ( + (STRING, 9), + (STRING, {_sQ: _pos}), + (NULLABLE_INTEGER, {_sQ: _li}), + (STRING, {_sQ: _n}), + ), +) + +USAGE_PLAN_KEY: StaticSchema = ( + 18, + n0, + _UPK, + 0, + (_i, _ty, _v, _n), + ((STRING, 0), (STRING, 0), (STRING, 0), (STRING, 0)), +) + +LIST_OF_USAGE_PLAN_KEY: StaticSchema = ( + 16, + n0, + _LOUPK, + 0, + (_m,), + ((USAGE_PLAN_KEY, 0),), +) + +GET_USAGE_PLAN_KEYS_OUTPUT: StaticSchema = ( + 18, + n0, + _GUPKOe, + {_sSI: _cUPKo, _smit: None}, + (_it, _pos), + ((LIST_OF_USAGE_PLAN_KEY, {_sNm: _ite}), (STRING, {_sQ: _pos})), +) + +GET_USAGE_PLAN_KEYS: StaticOperationSchema = ( + 23, + n0, + _GUPKe, + { + _smith: MappingProxyType( + {"method": "GET", "uri": "/usageplans/{usagePlanId}/keys", "code": 200} + ) + }, + GET_USAGE_PLAN_KEYS_INPUT, + GET_USAGE_PLAN_KEYS_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +GET_USAGE_PLANS_INPUT: StaticSchema = ( + 18, + n0, + _GUPIe, + {_sSI: _cGUPRo, _smi: None}, + (_pos, _kI, _li), + ((STRING, {_sQ: _pos}), (STRING, {_sQ: _kI}), (NULLABLE_INTEGER, {_sQ: _li})), +) + +USAGE_PLAN: StaticSchema = ( + 18, + n0, + _UP, + 0, + (_i, _n, _d, _aSpi, _th, _q, _pC, _t), + ( + (STRING, 0), + (STRING, 0), + (STRING, 0), + (LIST_OF_API_STAGE, 0), + (THROTTLE_SETTINGS, 0), + (QUOTA_SETTINGS, 0), + (STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + ), +) + +LIST_OF_USAGE_PLAN: StaticSchema = (16, n0, _LOUP, 0, (_m,), ((USAGE_PLAN, 0),)) + +GET_USAGE_PLANS_OUTPUT: StaticSchema = ( + 18, + n0, + _GUPOe, + {_sSI: _cUPo, _smit: None}, + (_it, _pos), + ((LIST_OF_USAGE_PLAN, {_sNm: _ite}), (STRING, {_sQ: _pos})), +) + +GET_USAGE_PLANS: StaticOperationSchema = ( + 23, + n0, + _GUPe, + {_smith: MappingProxyType({"method": "GET", "uri": "/usageplans", "code": 200})}, + GET_USAGE_PLANS_INPUT, + GET_USAGE_PLANS_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +GET_VPC_LINK_INPUT: StaticSchema = ( + 18, + n0, + _GVLI, + {_sSI: _cGVLR, _smi: None}, + (_vLI,), + ((STRING, 9),), +) + +GET_VPC_LINK_OUTPUT: StaticSchema = ( + 18, + n0, + _GVLO, + {_sSI: _cVL, _smit: None}, + (_i, _n, _d, _tA, _sta, _sM, _t), + ( + (STRING, 0), + (STRING, 0), + (STRING, 0), + (LIST_OF_STRING, 0), + (VPC_LINK_STATUS, 0), + (STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + ), +) + +GET_VPC_LINK: StaticOperationSchema = ( + 23, + n0, + _GVL, + { + _smith: MappingProxyType( + {"method": "GET", "uri": "/vpclinks/{vpcLinkId}", "code": 200} + ) + }, + GET_VPC_LINK_INPUT, + GET_VPC_LINK_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +GET_VPC_LINKS_INPUT: StaticSchema = ( + 18, + n0, + _GVLIe, + {_sSI: _cGVLRo, _smi: None}, + (_pos, _li), + ((STRING, {_sQ: _pos}), (NULLABLE_INTEGER, {_sQ: _li})), +) + +VPC_LINK: StaticSchema = ( + 18, + n0, + _VLp, + 0, + (_i, _n, _d, _tA, _sta, _sM, _t), + ( + (STRING, 0), + (STRING, 0), + (STRING, 0), + (LIST_OF_STRING, 0), + (VPC_LINK_STATUS, 0), + (STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + ), +) + +LIST_OF_VPC_LINK: StaticSchema = (16, n0, _LOVL, 0, (_m,), ((VPC_LINK, 0),)) + +GET_VPC_LINKS_OUTPUT: StaticSchema = ( + 18, + n0, + _GVLOe, + {_sSI: _cVLo, _smit: None}, + (_it, _pos), + ((LIST_OF_VPC_LINK, {_sNm: _ite}), (STRING, {_sQ: _pos})), +) + +GET_VPC_LINKS: StaticOperationSchema = ( + 23, + n0, + _GVLe, + {_smith: MappingProxyType({"method": "GET", "uri": "/vpclinks", "code": 200})}, + GET_VPC_LINKS_INPUT, + GET_VPC_LINKS_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +IMPORT_API_KEYS_INPUT: StaticSchema = ( + 18, + n0, + _IAKI, + {_sSI: _cIAKR, _smi: None}, + (_b, _f, _fOW), + ( + (BLOB, 17), + (API_KEYS_FORMAT, {_sQ: _f, _smithy: None}), + (BOOLEAN, {_s: False, _sQ: _fa}), + ), +) + +IMPORT_API_KEYS_OUTPUT: StaticSchema = ( + 18, + n0, + _IAKO, + {_sSI: _cAKI, _smit: None}, + (_id, _w), + ((LIST_OF_STRING, 0), (LIST_OF_STRING, 0)), +) + +IMPORT_API_KEYS: StaticOperationSchema = ( + 23, + n0, + _IAKm, + { + _smith: MappingProxyType( + {"method": "POST", "uri": "/apikeys?mode=import", "code": 201} + ) + }, + IMPORT_API_KEYS_INPUT, + IMPORT_API_KEYS_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +PUT_MODE: StaticSchema = ( + 14, + n0, + _PM, + 0, + (_Me, _O), + ((-1, {_sV: _mer}), (-1, {_sV: _ov})), +) + +IMPORT_DOCUMENTATION_PARTS_INPUT: StaticSchema = ( + 18, + n0, + _IDPI, + {_sSI: _cIDPR, _smi: None}, + (_rAI, _mo, _fOW, _b), + ((STRING, 9), (PUT_MODE, {_sQ: _mo}), (BOOLEAN, {_s: False, _sQ: _fa}), (BLOB, 17)), +) + +IMPORT_DOCUMENTATION_PARTS_OUTPUT: StaticSchema = ( + 18, + n0, + _IDPO, + {_sSI: _cDPI, _smit: None}, + (_id, _w), + ((LIST_OF_STRING, 0), (LIST_OF_STRING, 0)), +) + +IMPORT_DOCUMENTATION_PARTS: StaticOperationSchema = ( + 23, + n0, + _IDP, + { + _smith: MappingProxyType( + { + "method": "PUT", + "uri": "/restapis/{restApiId}/documentation/parts", + "code": 200, + } + ) + }, + IMPORT_DOCUMENTATION_PARTS_INPUT, + IMPORT_DOCUMENTATION_PARTS_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +IMPORT_REST_API_INPUT: StaticSchema = ( + 18, + n0, + _IRAI, + {_sSI: _cIRAR, _smi: None}, + (_fOW, _pa, _b), + ((BOOLEAN, {_s: False, _sQ: _fa}), (MAP_OF_STRING_TO_STRING, 1024), (BLOB, 17)), +) + +IMPORT_REST_API_OUTPUT: StaticSchema = ( + 18, + n0, + _IRAO, + {_sSI: _cRA, _smit: None}, + ( + _i, + _n, + _d, + _cD, + _ve, + _w, + _bMT, + _mCS, + _aKS, + _eC, + _po, + _t, + _dEAE, + _rRI, + _sP, + _eAM, + _aSp, + _aSM, + ), + ( + (STRING, 0), + (STRING, 0), + (STRING, 0), + (TIMESTAMP, 0), + (STRING, 0), + (LIST_OF_STRING, 0), + (LIST_OF_STRING, 0), + (NULLABLE_INTEGER, 0), + (API_KEY_SOURCE_TYPE, 0), + (ENDPOINT_CONFIGURATION, 0), + (STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + (BOOLEAN, {_s: False}), + (STRING, 0), + (SECURITY_POLICY, 0), + (ENDPOINT_ACCESS_MODE, 0), + (API_STATUS, 0), + (STRING, 0), + ), +) + +IMPORT_REST_API: StaticOperationSchema = ( + 23, + n0, + _IRA, + { + _smith: MappingProxyType( + {"method": "POST", "uri": "/restapis?mode=import", "code": 201} + ) + }, + IMPORT_REST_API_INPUT, + IMPORT_REST_API_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +PUT_GATEWAY_RESPONSE_INPUT: StaticSchema = ( + 18, + n0, + _PGRI, + {_sSI: _cPGRR, _smi: None}, + (_rAI, _rTes, _sC, _rP, _rT), + ( + (STRING, 9), + (GATEWAY_RESPONSE_TYPE, 9), + (STATUS_CODE, 0), + (MAP_OF_STRING_TO_STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + ), +) + +PUT_GATEWAY_RESPONSE_OUTPUT: StaticSchema = ( + 18, + n0, + _PGRO, + {_sSI: _cGR, _smit: None}, + (_rTes, _sC, _rP, _rT, _dR), + ( + (GATEWAY_RESPONSE_TYPE, 0), + (STATUS_CODE, 0), + (MAP_OF_STRING_TO_STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + (BOOLEAN, {_s: False}), + ), +) + +PUT_GATEWAY_RESPONSE: StaticOperationSchema = ( + 23, + n0, + _PGR, + { + _smith: MappingProxyType( + { + "method": "PUT", + "uri": "/restapis/{restApiId}/gatewayresponses/{responseType}", + "code": 201, + } + ) + }, + PUT_GATEWAY_RESPONSE_INPUT, + PUT_GATEWAY_RESPONSE_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +PUT_INTEGRATION_INPUT: StaticSchema = ( + 18, + n0, + _PII, + {_sSI: _cPIR, _smi: None}, + ( + _rAI, + _rI, + _hM, + _ty, + _iHM, + _u, + _cTo, + _cIo, + _cr, + _rPe, + _rTe, + _pB, + _cNa, + _cKP, + _cH, + _tIM, + _tC, + _rTM, + _iT, + ), + ( + (STRING, 9), + (STRING, 9), + (STRING, {_sNm: _rHM, _smithy: None, _sL: None}), + (INTEGRATION_TYPE, 1), + (STRING, {_sNm: _hM}), + (STRING, 0), + (CONNECTION_TYPE, 0), + (STRING, 0), + (STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + (STRING, 0), + (STRING, 0), + (LIST_OF_STRING, 0), + (CONTENT_HANDLING_STRATEGY, 0), + (NULLABLE_INTEGER, 0), + (TLS_CONFIG, 0), + (RESPONSE_TRANSFER_MODE, 0), + (STRING, 0), + ), +) + +PUT_INTEGRATION_OUTPUT: StaticSchema = ( + 18, + n0, + _PIO, + {_sSI: _cIom, _smit: None}, + ( + _ty, + _hM, + _u, + _cTo, + _cIo, + _cr, + _rPe, + _rTe, + _pB, + _cH, + _tIM, + _cNa, + _cKP, + _iR, + _tC, + _rTM, + _iT, + ), + ( + (INTEGRATION_TYPE, 0), + (STRING, 0), + (STRING, 0), + (CONNECTION_TYPE, 0), + (STRING, 0), + (STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + (STRING, 0), + (CONTENT_HANDLING_STRATEGY, 0), + (INTEGER, {_s: 0}), + (STRING, 0), + (LIST_OF_STRING, 0), + (MAP_OF_INTEGRATION_RESPONSE, 0), + (TLS_CONFIG, 0), + (RESPONSE_TRANSFER_MODE, 0), + (STRING, 0), + ), +) + +PUT_INTEGRATION: StaticOperationSchema = ( + 23, + n0, + _PI, + { + _smith: MappingProxyType( + { + "method": "PUT", + "uri": "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}/integration", + "code": 201, + } + ) + }, + PUT_INTEGRATION_INPUT, + PUT_INTEGRATION_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +PUT_INTEGRATION_RESPONSE_INPUT: StaticSchema = ( + 18, + n0, + _PIRI, + {_sSI: _cPIRR, _smi: None}, + (_rAI, _rI, _hM, _sC, _sPe, _rP, _rT, _cH), + ( + (STRING, 9), + (STRING, 9), + (STRING, 9), + (STATUS_CODE, 9), + (STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + (CONTENT_HANDLING_STRATEGY, 0), + ), +) + +PUT_INTEGRATION_RESPONSE_OUTPUT: StaticSchema = ( + 18, + n0, + _PIRO, + {_sSI: _cIR, _smit: None}, + (_sC, _sPe, _rP, _rT, _cH), + ( + (STATUS_CODE, 0), + (STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + (CONTENT_HANDLING_STRATEGY, 0), + ), +) + +PUT_INTEGRATION_RESPONSE: StaticOperationSchema = ( + 23, + n0, + _PIR, + { + _smith: MappingProxyType( + { + "method": "PUT", + "uri": "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}/integration/responses/{statusCode}", + "code": 201, + } + ) + }, + PUT_INTEGRATION_RESPONSE_INPUT, + PUT_INTEGRATION_RESPONSE_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +PUT_METHOD_INPUT: StaticSchema = ( + 18, + n0, + _PMI, + {_sSI: _cPMR, _smi: None}, + (_rAI, _rI, _hM, _aTu, _aIu, _aKR, _oN, _rPe, _rMeq, _rVI, _aSu), + ( + (STRING, 9), + (STRING, 9), + (STRING, 9), + (STRING, 1), + (STRING, 0), + (BOOLEAN, {_s: False}), + (STRING, 0), + (MAP_OF_STRING_TO_BOOLEAN, 0), + (MAP_OF_STRING_TO_STRING, 0), + (STRING, 0), + (LIST_OF_STRING, 0), + ), +) + +PUT_METHOD_OUTPUT: StaticSchema = ( + 18, + n0, + _PMO, + {_sSI: _cMo, _smit: None}, + (_hM, _aTu, _aIu, _aKR, _rVI, _oN, _rPe, _rMeq, _mR, _mI, _aSu), + ( + (STRING, 0), + (STRING, 0), + (STRING, 0), + (NULLABLE_BOOLEAN, 0), + (STRING, 0), + (STRING, 0), + (MAP_OF_STRING_TO_BOOLEAN, 0), + (MAP_OF_STRING_TO_STRING, 0), + (MAP_OF_METHOD_RESPONSE, 0), + (INTEGRATION, 0), + (LIST_OF_STRING, 0), + ), +) + +PUT_METHOD: StaticOperationSchema = ( + 23, + n0, + _PMu, + { + _smith: MappingProxyType( + { + "method": "PUT", + "uri": "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}", + "code": 201, + } + ) + }, + PUT_METHOD_INPUT, + PUT_METHOD_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +PUT_METHOD_RESPONSE_INPUT: StaticSchema = ( + 18, + n0, + _PMRI, + {_sSI: _cPMRR, _smi: None}, + (_rAI, _rI, _hM, _sC, _rP, _rMe), + ( + (STRING, 9), + (STRING, 9), + (STRING, 9), + (STATUS_CODE, 9), + (MAP_OF_STRING_TO_BOOLEAN, 0), + (MAP_OF_STRING_TO_STRING, 0), + ), +) + +PUT_METHOD_RESPONSE_OUTPUT: StaticSchema = ( + 18, + n0, + _PMRO, + {_sSI: _cMR, _smit: None}, + (_sC, _rP, _rMe), + ((STATUS_CODE, 0), (MAP_OF_STRING_TO_BOOLEAN, 0), (MAP_OF_STRING_TO_STRING, 0)), +) + +PUT_METHOD_RESPONSE: StaticOperationSchema = ( + 23, + n0, + _PMR, + { + _smith: MappingProxyType( + { + "method": "PUT", + "uri": "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}/responses/{statusCode}", + "code": 201, + } + ) + }, + PUT_METHOD_RESPONSE_INPUT, + PUT_METHOD_RESPONSE_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +PUT_REST_API_INPUT: StaticSchema = ( + 18, + n0, + _PRAI, + {_sSI: _cPRAR, _smi: None}, + (_rAI, _mo, _fOW, _pa, _b), + ( + (STRING, 9), + (PUT_MODE, {_sQ: _mo}), + (BOOLEAN, {_s: False, _sQ: _fa}), + (MAP_OF_STRING_TO_STRING, 1024), + (BLOB, 17), + ), +) + +PUT_REST_API_OUTPUT: StaticSchema = ( + 18, + n0, + _PRAO, + {_sSI: _cRA, _smit: None}, + ( + _i, + _n, + _d, + _cD, + _ve, + _w, + _bMT, + _mCS, + _aKS, + _eC, + _po, + _t, + _dEAE, + _rRI, + _sP, + _eAM, + _aSp, + _aSM, + ), + ( + (STRING, 0), + (STRING, 0), + (STRING, 0), + (TIMESTAMP, 0), + (STRING, 0), + (LIST_OF_STRING, 0), + (LIST_OF_STRING, 0), + (NULLABLE_INTEGER, 0), + (API_KEY_SOURCE_TYPE, 0), + (ENDPOINT_CONFIGURATION, 0), + (STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + (BOOLEAN, {_s: False}), + (STRING, 0), + (SECURITY_POLICY, 0), + (ENDPOINT_ACCESS_MODE, 0), + (API_STATUS, 0), + (STRING, 0), + ), +) + +PUT_REST_API: StaticOperationSchema = ( + 23, + n0, + _PRA, + { + _smith: MappingProxyType( + {"method": "PUT", "uri": "/restapis/{restApiId}", "code": 200} + ) + }, + PUT_REST_API_INPUT, + PUT_REST_API_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +REJECT_DOMAIN_NAME_ACCESS_ASSOCIATION_INPUT: StaticSchema = ( + 18, + n0, + _RDNAAI, + {_sSI: _cRDNAAR, _smi: None}, + (_dNAAA, _dNA), + ((STRING, {_sQ: _dNAAA, _smithy: None}), (STRING, {_sQ: _dNA, _smithy: None})), +) + +REJECT_DOMAIN_NAME_ACCESS_ASSOCIATION_OUTPUT: StaticSchema = ( + 18, + n0, + _RDNAAO, + {_sSI: _sU, _smit: None}, +) + +REJECT_DOMAIN_NAME_ACCESS_ASSOCIATION: StaticOperationSchema = ( + 23, + n0, + _RDNAA, + { + _smith: MappingProxyType( + { + "method": "POST", + "uri": "/rejectdomainnameaccessassociations", + "code": 202, + } + ) + }, + REJECT_DOMAIN_NAME_ACCESS_ASSOCIATION_INPUT, + REJECT_DOMAIN_NAME_ACCESS_ASSOCIATION_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +TAG_RESOURCE_INPUT: StaticSchema = ( + 18, + n0, + _TRI, + {_sSI: _cTRR, _smi: None}, + (_rA, _t), + ((STRING, 9), (MAP_OF_STRING_TO_STRING, 1)), +) + +TAG_RESOURCE_OUTPUT: StaticSchema = (18, n0, _TRO, {_sSI: _sU, _smit: None}) + +TAG_RESOURCE: StaticOperationSchema = ( + 23, + n0, + _TR, + { + _smith: MappingProxyType( + {"method": "PUT", "uri": "/tags/{resourceArn}", "code": 204} + ) + }, + TAG_RESOURCE_INPUT, + TAG_RESOURCE_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +MAP_OF_STRING_TO_LIST: StaticSchema = ( + 17, + n0, + _MOSTL, + 0, + (_k, _v), + ((STRING, 0), (LIST_OF_STRING, 0)), +) + +TEST_INVOKE_AUTHORIZER_INPUT: StaticSchema = ( + 18, + n0, + _TIAI, + {_sSI: _cTIAR, _smi: None}, + (_rAI, _aIu, _h, _mVH, _pWQS, _b, _sVt, _aCd), + ( + (STRING, 9), + (STRING, 9), + (MAP_OF_STRING_TO_STRING, 0), + (MAP_OF_STRING_TO_LIST, 0), + (STRING, 0), + (STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + ), +) + +TEST_INVOKE_AUTHORIZER_OUTPUT: StaticSchema = ( + 18, + n0, + _TIAO, + {_sSI: _cTIARo, _smit: None}, + (_cSl, _lo, _la, _pIr, _po, _au, _cla), + ( + (INTEGER, {_s: 0}), + (STRING, 0), + (LONG, {_s: 0}), + (STRING, 0), + (STRING, 0), + (MAP_OF_STRING_TO_LIST, 0), + (MAP_OF_STRING_TO_STRING, 0), + ), +) + +TEST_INVOKE_AUTHORIZER: StaticOperationSchema = ( + 23, + n0, + _TIA, + { + _smith: MappingProxyType( + { + "method": "POST", + "uri": "/restapis/{restApiId}/authorizers/{authorizerId}", + "code": 200, + } + ) + }, + TEST_INVOKE_AUTHORIZER_INPUT, + TEST_INVOKE_AUTHORIZER_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +TEST_INVOKE_METHOD_INPUT: StaticSchema = ( + 18, + n0, + _TIMI, + {_sSI: _cTIMR, _smi: None}, + (_rAI, _rI, _hM, _pWQS, _b, _h, _mVH, _cCI, _sVt), + ( + (STRING, 9), + (STRING, 9), + (STRING, 9), + (STRING, 0), + (STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + (MAP_OF_STRING_TO_LIST, 0), + (STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + ), +) + +TEST_INVOKE_METHOD_OUTPUT: StaticSchema = ( + 18, + n0, + _TIMO, + {_sSI: _cTIMRo, _smit: None}, + (_sta, _b, _h, _mVH, _lo, _la), + ( + (INTEGER, {_s: 0}), + (STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + (MAP_OF_STRING_TO_LIST, 0), + (STRING, 0), + (LONG, {_s: 0}), + ), +) + +TEST_INVOKE_METHOD: StaticOperationSchema = ( + 23, + n0, + _TIM, + { + _smith: MappingProxyType( + { + "method": "POST", + "uri": "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}", + "code": 200, + } + ) + }, + TEST_INVOKE_METHOD_INPUT, + TEST_INVOKE_METHOD_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +UNTAG_RESOURCE_INPUT: StaticSchema = ( + 18, + n0, + _URI, + {_sSI: _cURR, _smi: None}, + (_rA, _tK), + ((STRING, 9), (LIST_OF_STRING, {_sQ: _tK, _smithy: None})), +) + +UNTAG_RESOURCE_OUTPUT: StaticSchema = (18, n0, _URO, {_sSI: _sU, _smit: None}) + +UNTAG_RESOURCE: StaticOperationSchema = ( + 23, + n0, + _UR, + { + _smith: MappingProxyType( + {"method": "DELETE", "uri": "/tags/{resourceArn}", "code": 204} + ) + }, + UNTAG_RESOURCE_INPUT, + UNTAG_RESOURCE_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +OP: StaticSchema = ( + 14, + n0, + _Op, + 0, + (_ad, _re, _rep, _mov, _co, _te), + ( + (-1, {_sV: _ad}), + (-1, {_sV: _re}), + (-1, {_sV: _rep}), + (-1, {_sV: _mov}), + (-1, {_sV: _co}), + (-1, {_sV: _te}), + ), +) + +PATCH_OPERATION: StaticSchema = ( + 18, + n0, + _PO, + 0, + (_op, _p, _v, _fr), + ((OP, 0), (STRING, 0), (STRING, 0), (STRING, 0)), +) + +LIST_OF_PATCH_OPERATION: StaticSchema = ( + 16, + n0, + _LOPO, + 0, + (_m,), + ((PATCH_OPERATION, 0),), +) + +UPDATE_ACCOUNT_INPUT: StaticSchema = ( + 18, + n0, + _UAI, + {_sSI: _cUAR, _smi: None}, + (_pO,), + ((LIST_OF_PATCH_OPERATION, 0),), +) + +UPDATE_ACCOUNT_OUTPUT: StaticSchema = ( + 18, + n0, + _UAO, + {_sSI: _cAo, _smit: None}, + (_cRAl, _tS, _fe, _aKV), + ((STRING, 0), (THROTTLE_SETTINGS, 0), (LIST_OF_STRING, 0), (STRING, 0)), +) + +UPDATE_ACCOUNT: StaticOperationSchema = ( + 23, + n0, + _UA, + {_smith: MappingProxyType({"method": "PATCH", "uri": "/account", "code": 200})}, + UPDATE_ACCOUNT_INPUT, + UPDATE_ACCOUNT_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +UPDATE_API_KEY_INPUT: StaticSchema = ( + 18, + n0, + _UAKI, + {_sSI: _cUAKR, _smi: None}, + (_aK, _pO), + ((STRING, 9), (LIST_OF_PATCH_OPERATION, 0)), +) + +UPDATE_API_KEY_OUTPUT: StaticSchema = ( + 18, + n0, + _UAKO, + {_sSI: _cAK, _smit: None}, + (_i, _v, _n, _cI, _d, _e, _cD, _lUD, _sK, _t), + ( + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (BOOLEAN, {_s: False}), + (TIMESTAMP, 0), + (TIMESTAMP, 0), + (LIST_OF_STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + ), +) + +UPDATE_API_KEY: StaticOperationSchema = ( + 23, + n0, + _UAK, + { + _smith: MappingProxyType( + {"method": "PATCH", "uri": "/apikeys/{apiKey}", "code": 200} + ) + }, + UPDATE_API_KEY_INPUT, + UPDATE_API_KEY_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +UPDATE_AUTHORIZER_INPUT: StaticSchema = ( + 18, + n0, + _UAIp, + {_sSI: _cUARo, _smi: None}, + (_rAI, _aIu, _pO), + ((STRING, 9), (STRING, 9), (LIST_OF_PATCH_OPERATION, 0)), +) + +UPDATE_AUTHORIZER_OUTPUT: StaticSchema = ( + 18, + n0, + _UAOp, + {_sSI: _cA, _smit: None}, + (_i, _n, _ty, _pARN, _aT, _aU, _aC, _iS, _iVE, _aRTIS), + ( + (STRING, 0), + (STRING, 0), + (AUTHORIZER_TYPE, 0), + (LIST_OF_AR_NS, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (NULLABLE_INTEGER, 0), + ), +) + +UPDATE_AUTHORIZER: StaticOperationSchema = ( + 23, + n0, + _UAp, + { + _smith: MappingProxyType( + { + "method": "PATCH", + "uri": "/restapis/{restApiId}/authorizers/{authorizerId}", + "code": 200, + } + ) + }, + UPDATE_AUTHORIZER_INPUT, + UPDATE_AUTHORIZER_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +UPDATE_BASE_PATH_MAPPING_INPUT: StaticSchema = ( + 18, + n0, + _UBPMI, + {_sSI: _cUBPMR, _smi: None}, + (_dN, _dNI, _bP, _pO), + ((STRING, 9), (STRING, {_sQ: _dNI}), (STRING, 9), (LIST_OF_PATCH_OPERATION, 0)), +) + +UPDATE_BASE_PATH_MAPPING_OUTPUT: StaticSchema = ( + 18, + n0, + _UBPMO, + {_sSI: _cBPM, _smit: None}, + (_bP, _rAI, _st), + ((STRING, 0), (STRING, 0), (STRING, 0)), +) + +UPDATE_BASE_PATH_MAPPING: StaticOperationSchema = ( + 23, + n0, + _UBPM, + { + _smith: MappingProxyType( + { + "method": "PATCH", + "uri": "/domainnames/{domainName}/basepathmappings/{basePath}", + "code": 200, + } + ) + }, + UPDATE_BASE_PATH_MAPPING_INPUT, + UPDATE_BASE_PATH_MAPPING_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +UPDATE_CLIENT_CERTIFICATE_INPUT: StaticSchema = ( + 18, + n0, + _UCCI, + {_sSI: _cUCCR, _smi: None}, + (_cCI, _pO), + ((STRING, 9), (LIST_OF_PATCH_OPERATION, 0)), +) + +UPDATE_CLIENT_CERTIFICATE_OUTPUT: StaticSchema = ( + 18, + n0, + _UCCO, + {_sSI: _cCC, _smit: None}, + (_cCI, _d, _pEC, _cD, _eD, _t), + ( + (STRING, 0), + (STRING, 0), + (STRING, 0), + (TIMESTAMP, 0), + (TIMESTAMP, 0), + (MAP_OF_STRING_TO_STRING, 0), + ), +) + +UPDATE_CLIENT_CERTIFICATE: StaticOperationSchema = ( + 23, + n0, + _UCC, + { + _smith: MappingProxyType( + { + "method": "PATCH", + "uri": "/clientcertificates/{clientCertificateId}", + "code": 200, + } + ) + }, + UPDATE_CLIENT_CERTIFICATE_INPUT, + UPDATE_CLIENT_CERTIFICATE_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +UPDATE_DEPLOYMENT_INPUT: StaticSchema = ( + 18, + n0, + _UDI, + {_sSI: _cUDR, _smi: None}, + (_rAI, _dI, _pO), + ((STRING, 9), (STRING, 9), (LIST_OF_PATCH_OPERATION, 0)), +) + +UPDATE_DEPLOYMENT_OUTPUT: StaticSchema = ( + 18, + n0, + _UDO, + {_sSI: _cDo, _smit: None}, + (_i, _d, _cD, _aS), + ((STRING, 0), (STRING, 0), (TIMESTAMP, 0), (PATH_TO_MAP_OF_METHOD_SNAPSHOT, 0)), +) + +UPDATE_DEPLOYMENT: StaticOperationSchema = ( + 23, + n0, + _UD, + { + _smith: MappingProxyType( + { + "method": "PATCH", + "uri": "/restapis/{restApiId}/deployments/{deploymentId}", + "code": 200, + } + ) + }, + UPDATE_DEPLOYMENT_INPUT, + UPDATE_DEPLOYMENT_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + SERVICE_UNAVAILABLE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +UPDATE_DOCUMENTATION_PART_INPUT: StaticSchema = ( + 18, + n0, + _UDPI, + {_sSI: _cUDPR, _smi: None}, + (_rAI, _dPI, _pO), + ((STRING, 9), (STRING, 9), (LIST_OF_PATCH_OPERATION, 0)), +) + +UPDATE_DOCUMENTATION_PART_OUTPUT: StaticSchema = ( + 18, + n0, + _UDPO, + {_sSI: _cDP, _smit: None}, + (_i, _l, _pr), + ((STRING, 0), (DOCUMENTATION_PART_LOCATION, 0), (STRING, 0)), +) + +UPDATE_DOCUMENTATION_PART: StaticOperationSchema = ( + 23, + n0, + _UDP, + { + _smith: MappingProxyType( + { + "method": "PATCH", + "uri": "/restapis/{restApiId}/documentation/parts/{documentationPartId}", + "code": 200, + } + ) + }, + UPDATE_DOCUMENTATION_PART_INPUT, + UPDATE_DOCUMENTATION_PART_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +UPDATE_DOCUMENTATION_VERSION_INPUT: StaticSchema = ( + 18, + n0, + _UDVI, + {_sSI: _cUDVR, _smi: None}, + (_rAI, _dV, _pO), + ((STRING, 9), (STRING, 9), (LIST_OF_PATCH_OPERATION, 0)), +) + +UPDATE_DOCUMENTATION_VERSION_OUTPUT: StaticSchema = ( + 18, + n0, + _UDVO, + {_sSI: _cDV, _smit: None}, + (_ve, _cD, _d), + ((STRING, 0), (TIMESTAMP, 0), (STRING, 0)), +) + +UPDATE_DOCUMENTATION_VERSION: StaticOperationSchema = ( + 23, + n0, + _UDV, + { + _smith: MappingProxyType( + { + "method": "PATCH", + "uri": "/restapis/{restApiId}/documentation/versions/{documentationVersion}", + "code": 200, + } + ) + }, + UPDATE_DOCUMENTATION_VERSION_INPUT, + UPDATE_DOCUMENTATION_VERSION_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +UPDATE_DOMAIN_NAME_INPUT: StaticSchema = ( + 18, + n0, + _UDNI, + {_sSI: _cUDNR, _smi: None}, + (_dN, _dNI, _pO), + ((STRING, 9), (STRING, {_sQ: _dNI}), (LIST_OF_PATCH_OPERATION, 0)), +) + +UPDATE_DOMAIN_NAME_OUTPUT: StaticSchema = ( + 18, + n0, + _UDNO, + {_sSI: _cDN, _smit: None}, + ( + _dN, + _dNI, + _dNA, + _cN, + _cAe, + _cUD, + _rDN, + _rHZI, + _rCN, + _rCA, + _dDN, + _dHZI, + _eC, + _dNS, + _dNSM, + _sP, + _eAM, + _t, + _mTA, + _oVCA, + _mP, + _po, + _rM, + ), + ( + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (TIMESTAMP, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (ENDPOINT_CONFIGURATION, 0), + (DOMAIN_NAME_STATUS, 0), + (STRING, 0), + (SECURITY_POLICY, 0), + (ENDPOINT_ACCESS_MODE, 0), + (MAP_OF_STRING_TO_STRING, 0), + (MUTUAL_TLS_AUTHENTICATION, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (ROUTING_MODE, 0), + ), +) + +UPDATE_DOMAIN_NAME: StaticOperationSchema = ( + 23, + n0, + _UDN, + { + _smith: MappingProxyType( + {"method": "PATCH", "uri": "/domainnames/{domainName}", "code": 200} + ) + }, + UPDATE_DOMAIN_NAME_INPUT, + UPDATE_DOMAIN_NAME_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +UPDATE_GATEWAY_RESPONSE_INPUT: StaticSchema = ( + 18, + n0, + _UGRI, + {_sSI: _cUGRR, _smi: None}, + (_rAI, _rTes, _pO), + ((STRING, 9), (GATEWAY_RESPONSE_TYPE, 9), (LIST_OF_PATCH_OPERATION, 0)), +) + +UPDATE_GATEWAY_RESPONSE_OUTPUT: StaticSchema = ( + 18, + n0, + _UGRO, + {_sSI: _cGR, _smit: None}, + (_rTes, _sC, _rP, _rT, _dR), + ( + (GATEWAY_RESPONSE_TYPE, 0), + (STATUS_CODE, 0), + (MAP_OF_STRING_TO_STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + (BOOLEAN, {_s: False}), + ), +) + +UPDATE_GATEWAY_RESPONSE: StaticOperationSchema = ( + 23, + n0, + _UGR, + { + _smith: MappingProxyType( + { + "method": "PATCH", + "uri": "/restapis/{restApiId}/gatewayresponses/{responseType}", + "code": 200, + } + ) + }, + UPDATE_GATEWAY_RESPONSE_INPUT, + UPDATE_GATEWAY_RESPONSE_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +UPDATE_INTEGRATION_INPUT: StaticSchema = ( + 18, + n0, + _UII, + {_sSI: _cUIR, _smi: None}, + (_rAI, _rI, _hM, _pO), + ((STRING, 9), (STRING, 9), (STRING, 9), (LIST_OF_PATCH_OPERATION, 0)), +) + +UPDATE_INTEGRATION_OUTPUT: StaticSchema = ( + 18, + n0, + _UIO, + {_sSI: _cIom, _smit: None}, + ( + _ty, + _hM, + _u, + _cTo, + _cIo, + _cr, + _rPe, + _rTe, + _pB, + _cH, + _tIM, + _cNa, + _cKP, + _iR, + _tC, + _rTM, + _iT, + ), + ( + (INTEGRATION_TYPE, 0), + (STRING, 0), + (STRING, 0), + (CONNECTION_TYPE, 0), + (STRING, 0), + (STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + (STRING, 0), + (CONTENT_HANDLING_STRATEGY, 0), + (INTEGER, {_s: 0}), + (STRING, 0), + (LIST_OF_STRING, 0), + (MAP_OF_INTEGRATION_RESPONSE, 0), + (TLS_CONFIG, 0), + (RESPONSE_TRANSFER_MODE, 0), + (STRING, 0), + ), +) + +UPDATE_INTEGRATION: StaticOperationSchema = ( + 23, + n0, + _UI, + { + _smith: MappingProxyType( + { + "method": "PATCH", + "uri": "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}/integration", + "code": 200, + } + ) + }, + UPDATE_INTEGRATION_INPUT, + UPDATE_INTEGRATION_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +UPDATE_INTEGRATION_RESPONSE_INPUT: StaticSchema = ( + 18, + n0, + _UIRI, + {_sSI: _cUIRR, _smi: None}, + (_rAI, _rI, _hM, _sC, _pO), + ( + (STRING, 9), + (STRING, 9), + (STRING, 9), + (STATUS_CODE, 9), + (LIST_OF_PATCH_OPERATION, 0), + ), +) + +UPDATE_INTEGRATION_RESPONSE_OUTPUT: StaticSchema = ( + 18, + n0, + _UIRO, + {_sSI: _cIR, _smit: None}, + (_sC, _sPe, _rP, _rT, _cH), + ( + (STATUS_CODE, 0), + (STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + (CONTENT_HANDLING_STRATEGY, 0), + ), +) + +UPDATE_INTEGRATION_RESPONSE: StaticOperationSchema = ( + 23, + n0, + _UIR, + { + _smith: MappingProxyType( + { + "method": "PATCH", + "uri": "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}/integration/responses/{statusCode}", + "code": 200, + } + ) + }, + UPDATE_INTEGRATION_RESPONSE_INPUT, + UPDATE_INTEGRATION_RESPONSE_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +UPDATE_METHOD_INPUT: StaticSchema = ( + 18, + n0, + _UMI, + {_sSI: _cUMR, _smi: None}, + (_rAI, _rI, _hM, _pO), + ((STRING, 9), (STRING, 9), (STRING, 9), (LIST_OF_PATCH_OPERATION, 0)), +) + +UPDATE_METHOD_OUTPUT: StaticSchema = ( + 18, + n0, + _UMO, + {_sSI: _cMo, _smit: None}, + (_hM, _aTu, _aIu, _aKR, _rVI, _oN, _rPe, _rMeq, _mR, _mI, _aSu), + ( + (STRING, 0), + (STRING, 0), + (STRING, 0), + (NULLABLE_BOOLEAN, 0), + (STRING, 0), + (STRING, 0), + (MAP_OF_STRING_TO_BOOLEAN, 0), + (MAP_OF_STRING_TO_STRING, 0), + (MAP_OF_METHOD_RESPONSE, 0), + (INTEGRATION, 0), + (LIST_OF_STRING, 0), + ), +) + +UPDATE_METHOD: StaticOperationSchema = ( + 23, + n0, + _UM, + { + _smith: MappingProxyType( + { + "method": "PATCH", + "uri": "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}", + "code": 200, + } + ) + }, + UPDATE_METHOD_INPUT, + UPDATE_METHOD_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +UPDATE_METHOD_RESPONSE_INPUT: StaticSchema = ( + 18, + n0, + _UMRI, + {_sSI: _cUMRR, _smi: None}, + (_rAI, _rI, _hM, _sC, _pO), + ( + (STRING, 9), + (STRING, 9), + (STRING, 9), + (STATUS_CODE, 9), + (LIST_OF_PATCH_OPERATION, 0), + ), +) + +UPDATE_METHOD_RESPONSE_OUTPUT: StaticSchema = ( + 18, + n0, + _UMRO, + {_sSI: _cMR, _smit: None}, + (_sC, _rP, _rMe), + ((STATUS_CODE, 0), (MAP_OF_STRING_TO_BOOLEAN, 0), (MAP_OF_STRING_TO_STRING, 0)), +) + +UPDATE_METHOD_RESPONSE: StaticOperationSchema = ( + 23, + n0, + _UMR, + { + _smith: MappingProxyType( + { + "method": "PATCH", + "uri": "/restapis/{restApiId}/resources/{resourceId}/methods/{httpMethod}/responses/{statusCode}", + "code": 201, + } + ) + }, + UPDATE_METHOD_RESPONSE_INPUT, + UPDATE_METHOD_RESPONSE_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +UPDATE_MODEL_INPUT: StaticSchema = ( + 18, + n0, + _UMIp, + {_sSI: _cUMRo, _smi: None}, + (_rAI, _mN, _pO), + ((STRING, 9), (STRING, 9), (LIST_OF_PATCH_OPERATION, 0)), +) + +UPDATE_MODEL_OUTPUT: StaticSchema = ( + 18, + n0, + _UMOp, + {_sSI: _cM, _smit: None}, + (_i, _n, _d, _sc, _cT), + ((STRING, 0), (STRING, 0), (STRING, 0), (STRING, 0), (STRING, 0)), +) + +UPDATE_MODEL: StaticOperationSchema = ( + 23, + n0, + _UMp, + { + _smith: MappingProxyType( + { + "method": "PATCH", + "uri": "/restapis/{restApiId}/models/{modelName}", + "code": 200, + } + ) + }, + UPDATE_MODEL_INPUT, + UPDATE_MODEL_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +UPDATE_REQUEST_VALIDATOR_INPUT: StaticSchema = ( + 18, + n0, + _URVI, + {_sSI: _cURVR, _smi: None}, + (_rAI, _rVI, _pO), + ((STRING, 9), (STRING, 9), (LIST_OF_PATCH_OPERATION, 0)), +) + +UPDATE_REQUEST_VALIDATOR_OUTPUT: StaticSchema = ( + 18, + n0, + _URVO, + {_sSI: _cRV, _smit: None}, + (_i, _n, _vRB, _vRP), + ((STRING, 0), (STRING, 0), (BOOLEAN, {_s: False}), (BOOLEAN, {_s: False})), +) + +UPDATE_REQUEST_VALIDATOR: StaticOperationSchema = ( + 23, + n0, + _URV, + { + _smith: MappingProxyType( + { + "method": "PATCH", + "uri": "/restapis/{restApiId}/requestvalidators/{requestValidatorId}", + "code": 200, + } + ) + }, + UPDATE_REQUEST_VALIDATOR_INPUT, + UPDATE_REQUEST_VALIDATOR_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +UPDATE_RESOURCE_INPUT: StaticSchema = ( + 18, + n0, + _URIp, + {_sSI: _cURRo, _smi: None}, + (_rAI, _rI, _pO), + ((STRING, 9), (STRING, 9), (LIST_OF_PATCH_OPERATION, 0)), +) + +UPDATE_RESOURCE_OUTPUT: StaticSchema = ( + 18, + n0, + _UROp, + {_sSI: _cR, _smit: None}, + (_i, _pI, _pP, _p, _rMes), + ((STRING, 0), (STRING, 0), (STRING, 0), (STRING, 0), (MAP_OF_METHOD, 0)), +) + +UPDATE_RESOURCE: StaticOperationSchema = ( + 23, + n0, + _URp, + { + _smith: MappingProxyType( + { + "method": "PATCH", + "uri": "/restapis/{restApiId}/resources/{resourceId}", + "code": 200, + } + ) + }, + UPDATE_RESOURCE_INPUT, + UPDATE_RESOURCE_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +UPDATE_REST_API_INPUT: StaticSchema = ( + 18, + n0, + _URAI, + {_sSI: _cURAR, _smi: None}, + (_rAI, _pO), + ((STRING, 9), (LIST_OF_PATCH_OPERATION, 0)), +) + +UPDATE_REST_API_OUTPUT: StaticSchema = ( + 18, + n0, + _URAO, + {_sSI: _cRA, _smit: None}, + ( + _i, + _n, + _d, + _cD, + _ve, + _w, + _bMT, + _mCS, + _aKS, + _eC, + _po, + _t, + _dEAE, + _rRI, + _sP, + _eAM, + _aSp, + _aSM, + ), + ( + (STRING, 0), + (STRING, 0), + (STRING, 0), + (TIMESTAMP, 0), + (STRING, 0), + (LIST_OF_STRING, 0), + (LIST_OF_STRING, 0), + (NULLABLE_INTEGER, 0), + (API_KEY_SOURCE_TYPE, 0), + (ENDPOINT_CONFIGURATION, 0), + (STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + (BOOLEAN, {_s: False}), + (STRING, 0), + (SECURITY_POLICY, 0), + (ENDPOINT_ACCESS_MODE, 0), + (API_STATUS, 0), + (STRING, 0), + ), +) + +UPDATE_REST_API: StaticOperationSchema = ( + 23, + n0, + _URA, + { + _smith: MappingProxyType( + {"method": "PATCH", "uri": "/restapis/{restApiId}", "code": 200} + ) + }, + UPDATE_REST_API_INPUT, + UPDATE_REST_API_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +UPDATE_STAGE_INPUT: StaticSchema = ( + 18, + n0, + _USI, + {_sSI: _cUSR, _smi: None}, + (_rAI, _sN, _pO), + ((STRING, 9), (STRING, 9), (LIST_OF_PATCH_OPERATION, 0)), +) + +UPDATE_STAGE_OUTPUT: StaticSchema = ( + 18, + n0, + _USO, + {_sSI: _cSo, _smit: None}, + ( + _dI, + _cCI, + _sN, + _d, + _cCE, + _cCS, + _cCSa, + _mS, + _va, + _dV, + _aLS, + _cS, + _tE, + _wAA, + _t, + _cD, + _lUD, + ), + ( + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (BOOLEAN, {_s: False}), + (CACHE_CLUSTER_SIZE, 0), + (CACHE_CLUSTER_STATUS, 0), + (MAP_OF_METHOD_SETTINGS, 0), + (MAP_OF_STRING_TO_STRING, 0), + (STRING, 0), + (ACCESS_LOG_SETTINGS, 0), + (CANARY_SETTINGS, 0), + (BOOLEAN, {_s: False}), + (STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + (TIMESTAMP, 0), + (TIMESTAMP, 0), + ), +) + +UPDATE_STAGE: StaticOperationSchema = ( + 23, + n0, + _US, + { + _smith: MappingProxyType( + { + "method": "PATCH", + "uri": "/restapis/{restApiId}/stages/{stageName}", + "code": 200, + } + ) + }, + UPDATE_STAGE_INPUT, + UPDATE_STAGE_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +UPDATE_USAGE_INPUT: StaticSchema = ( + 18, + n0, + _UUI, + {_sSI: _cUUR, _smi: None}, + (_uPI, _kI, _pO), + ((STRING, 9), (STRING, 9), (LIST_OF_PATCH_OPERATION, 0)), +) + +UPDATE_USAGE_OUTPUT: StaticSchema = ( + 18, + n0, + _UUO, + {_sSI: _cU, _smit: None}, + (_uPI, _sDt, _eDn, _it, _pos), + ( + (STRING, 0), + (STRING, 0), + (STRING, 0), + (MAP_OF_KEY_USAGES, {_sNm: _val}), + (STRING, {_sQ: _pos}), + ), +) + +UPDATE_USAGE: StaticOperationSchema = ( + 23, + n0, + _UU, + { + _smith: MappingProxyType( + { + "method": "PATCH", + "uri": "/usageplans/{usagePlanId}/keys/{keyId}/usage", + "code": 200, + } + ) + }, + UPDATE_USAGE_INPUT, + UPDATE_USAGE_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +UPDATE_USAGE_PLAN_INPUT: StaticSchema = ( + 18, + n0, + _UUPI, + {_sSI: _cUUPR, _smi: None}, + (_uPI, _pO), + ((STRING, 9), (LIST_OF_PATCH_OPERATION, 0)), +) + +UPDATE_USAGE_PLAN_OUTPUT: StaticSchema = ( + 18, + n0, + _UUPO, + {_sSI: _cUP, _smit: None}, + (_i, _n, _d, _aSpi, _th, _q, _pC, _t), + ( + (STRING, 0), + (STRING, 0), + (STRING, 0), + (LIST_OF_API_STAGE, 0), + (THROTTLE_SETTINGS, 0), + (QUOTA_SETTINGS, 0), + (STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + ), +) + +UPDATE_USAGE_PLAN: StaticOperationSchema = ( + 23, + n0, + _UUP, + { + _smith: MappingProxyType( + {"method": "PATCH", "uri": "/usageplans/{usagePlanId}", "code": 200} + ) + }, + UPDATE_USAGE_PLAN_INPUT, + UPDATE_USAGE_PLAN_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +UPDATE_VPC_LINK_INPUT: StaticSchema = ( + 18, + n0, + _UVLI, + {_sSI: _cUVLR, _smi: None}, + (_vLI, _pO), + ((STRING, 9), (LIST_OF_PATCH_OPERATION, 0)), +) + +UPDATE_VPC_LINK_OUTPUT: StaticSchema = ( + 18, + n0, + _UVLO, + {_sSI: _cVL, _smit: None}, + (_i, _n, _d, _tA, _sta, _sM, _t), + ( + (STRING, 0), + (STRING, 0), + (STRING, 0), + (LIST_OF_STRING, 0), + (VPC_LINK_STATUS, 0), + (STRING, 0), + (MAP_OF_STRING_TO_STRING, 0), + ), +) + +UPDATE_VPC_LINK: StaticOperationSchema = ( + 23, + n0, + _UVL, + { + _smith: MappingProxyType( + {"method": "PATCH", "uri": "/vpclinks/{vpcLinkId}", "code": 200} + ) + }, + UPDATE_VPC_LINK_INPUT, + UPDATE_VPC_LINK_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + ), +) + +BACKPLANE_CONTROL_SERVICE: StaticSchema = ( + 21, + n0, + _BCS, + { + _aw: MappingProxyType({"name": "apigateway"}), + _sB: MappingProxyType( + { + "version": "1.1", + "parameters": MappingProxyType( + { + "Region": MappingProxyType( { - "fn": "booleanEquals", - "argv": (MappingProxyType({"ref": "UseFIPS"}), True), + "builtIn": "AWS::Region", + "required": False, + "documentation": "The AWS region used to dispatch the request.", + "type": "string", } ), - MappingProxyType( + "UseDualStack": MappingProxyType( { - "fn": "booleanEquals", - "argv": ( - MappingProxyType({"ref": "UseDualStack"}), - True, - ), + "builtIn": "AWS::UseDualStack", + "required": True, + "default": False, + "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", + "type": "boolean", } ), - MappingProxyType( + "UseFIPS": MappingProxyType( { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "supportsDualStack", - ), - } - ), - True, - ), + "builtIn": "AWS::UseFIPS", + "required": True, + "default": False, + "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", + "type": "boolean", } ), - MappingProxyType( + "Endpoint": MappingProxyType( { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "supportsFIPS", - ), - } - ), - True, - ), + "builtIn": "SDK::Endpoint", + "required": False, + "documentation": "Override the endpoint used to send this request", + "type": "string", } ), + } + ), + "conditions": ( + MappingProxyType( + { + "fn": "isSet", + "argv": (MappingProxyType({"ref": "Endpoint"}),), + } ), - "results": ( - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: FIPS and custom endpoint are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": MappingProxyType({"ref": "Endpoint"}), - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://apigateway-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "FIPS and DualStack are enabled, but this partition does not support one or both", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://apigateway-fips.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "FIPS is enabled but this partition does not support FIPS", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + MappingProxyType( + {"fn": "isSet", "argv": (MappingProxyType({"ref": "Region"}),)} + ), + MappingProxyType( + { + "fn": "aws.partition", + "argv": (MappingProxyType({"ref": "Region"}),), + "assign": "PartitionResult", + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": (MappingProxyType({"ref": "UseFIPS"}), True), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": (MappingProxyType({"ref": "UseDualStack"}), True), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( { - "url": "https://apigateway.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "supportsDualStack", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "DualStack is enabled but this partition does not support DualStack", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + True, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( { - "url": "https://apigateway.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "supportsFIPS", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: Missing Region", - "type": "error", - } - ), + True, + ), + } + ), + ), + "results": ( + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: FIPS and custom endpoint are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": MappingProxyType({"ref": "Endpoint"}), + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://apigateway-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } ), - "root": 2, - "nodeCount": 13, - "nodes": "/////wAAAAH/////AAAAAAAAAAwAAAADAAAAAQAAAAQF9eELAAAAAgAAAAUF9eELAAAAAwAAAAgAAAAGAAAABAAAAAcF9eEKAAAABQX14QgF9eEJAAAABAAAAAoAAAAJAAAABgX14QYF9eEHAAAABQAAAAsF9eEFAAAABgX14QQF9eEFAAAAAwX14QEAAAANAAAABAX14QIF9eED", - } - ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS and DualStack are enabled, but this partition does not support one or both", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://apigateway-fips.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS is enabled but this partition does not support FIPS", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://apigateway.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "DualStack is enabled but this partition does not support DualStack", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://apigateway.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Missing Region", + "type": "error", + } + ), + ), + "root": 2, + "nodeCount": 13, + "nodes": "/////wAAAAH/////AAAAAAAAAAwAAAADAAAAAQAAAAQF9eELAAAAAgAAAAUF9eELAAAAAwAAAAgAAAAGAAAABAAAAAcF9eEKAAAABQX14QgF9eEJAAAABAAAAAoAAAAJAAAABgX14QYF9eEHAAAABQAAAAsF9eEFAAAABgX14QQF9eEFAAAAAwX14QEAAAANAAAABAX14QIF9eED", + } ), - Trait.new( - id=ShapeID("aws.api#service"), - value=MappingProxyType( - { - "sdkId": "API Gateway", - "arnNamespace": "apigateway", - "cloudFormationName": "ApiGateway", - "cloudTrailEventSource": "apigateway.amazonaws.com", - "docId": "apigateway-2015-07-09", - "endpointPrefix": "apigateway", - } - ), + _aws: MappingProxyType( + { + "sdkId": "API Gateway", + "arnNamespace": "apigateway", + "cloudFormationName": "ApiGateway", + "cloudTrailEventSource": "apigateway.amazonaws.com", + "docId": "apigateway-2015-07-09", + "endpointPrefix": "apigateway", + } ), - Trait.new(id=ShapeID("aws.protocols#restJson1")), - ], + _aJ: None, + }, ) diff --git a/clients/aws-sdk-api-gateway/src/aws_sdk_api_gateway/client.py b/clients/aws-sdk-api-gateway/src/aws_sdk_api_gateway/client.py index 49838920..b1b0d6c1 100644 --- a/clients/aws-sdk-api-gateway/src/aws_sdk_api_gateway/client.py +++ b/clients/aws-sdk-api-gateway/src/aws_sdk_api_gateway/client.py @@ -1,18 +1,20 @@ # Code generated by smithy-python-codegen DO NOT EDIT. +from __future__ import annotations + from copy import deepcopy import logging from typing import Any, cast +from smithy_aws_core.aio.identity.chain import AsyncIdentityChain from smithy_aws_core.config import ConfigSource from smithy_aws_core.identity import AWSCredentialsIdentity -from smithy_aws_core.identity.chain import IdentityChain -from smithy_core.aio.client import AsyncClient, ClientCall, RequestPipeline +from smithy_core.aio.client import AsyncClient, AsyncClientCall, AsyncRequestPipeline from smithy_core.deserializers import DeserializeableShape from smithy_core.exceptions import ExpectationNotMetError from smithy_core.schemas import APIOperation from smithy_core.serializers import SerializeableShape -from smithy_http.aio.interfaces import HTTPClient +from smithy_http.aio.interfaces import AsyncHTTPClient from smithy_http.plugins import user_agent_plugin from .accept_header import accept_header_plugin @@ -34,38 +36,6 @@ CREATE_USAGE_PLAN, CREATE_USAGE_PLAN_KEY, CREATE_VPC_LINK, - CreateApiKeyInput, - CreateApiKeyOutput, - CreateAuthorizerInput, - CreateAuthorizerOutput, - CreateBasePathMappingInput, - CreateBasePathMappingOutput, - CreateDeploymentInput, - CreateDeploymentOutput, - CreateDocumentationPartInput, - CreateDocumentationPartOutput, - CreateDocumentationVersionInput, - CreateDocumentationVersionOutput, - CreateDomainNameAccessAssociationInput, - CreateDomainNameAccessAssociationOutput, - CreateDomainNameInput, - CreateDomainNameOutput, - CreateModelInput, - CreateModelOutput, - CreateRequestValidatorInput, - CreateRequestValidatorOutput, - CreateResourceInput, - CreateResourceOutput, - CreateRestApiInput, - CreateRestApiOutput, - CreateStageInput, - CreateStageOutput, - CreateUsagePlanInput, - CreateUsagePlanKeyInput, - CreateUsagePlanKeyOutput, - CreateUsagePlanOutput, - CreateVpcLinkInput, - CreateVpcLinkOutput, DELETE_API_KEY, DELETE_AUTHORIZER, DELETE_BASE_PATH_MAPPING, @@ -88,56 +58,8 @@ DELETE_USAGE_PLAN, DELETE_USAGE_PLAN_KEY, DELETE_VPC_LINK, - DeleteApiKeyInput, - DeleteApiKeyOutput, - DeleteAuthorizerInput, - DeleteAuthorizerOutput, - DeleteBasePathMappingInput, - DeleteBasePathMappingOutput, - DeleteClientCertificateInput, - DeleteClientCertificateOutput, - DeleteDeploymentInput, - DeleteDeploymentOutput, - DeleteDocumentationPartInput, - DeleteDocumentationPartOutput, - DeleteDocumentationVersionInput, - DeleteDocumentationVersionOutput, - DeleteDomainNameAccessAssociationInput, - DeleteDomainNameAccessAssociationOutput, - DeleteDomainNameInput, - DeleteDomainNameOutput, - DeleteGatewayResponseInput, - DeleteGatewayResponseOutput, - DeleteIntegrationInput, - DeleteIntegrationOutput, - DeleteIntegrationResponseInput, - DeleteIntegrationResponseOutput, - DeleteMethodInput, - DeleteMethodOutput, - DeleteMethodResponseInput, - DeleteMethodResponseOutput, - DeleteModelInput, - DeleteModelOutput, - DeleteRequestValidatorInput, - DeleteRequestValidatorOutput, - DeleteResourceInput, - DeleteResourceOutput, - DeleteRestApiInput, - DeleteRestApiOutput, - DeleteStageInput, - DeleteStageOutput, - DeleteUsagePlanInput, - DeleteUsagePlanKeyInput, - DeleteUsagePlanKeyOutput, - DeleteUsagePlanOutput, - DeleteVpcLinkInput, - DeleteVpcLinkOutput, FLUSH_STAGE_AUTHORIZERS_CACHE, FLUSH_STAGE_CACHE, - FlushStageAuthorizersCacheInput, - FlushStageAuthorizersCacheOutput, - FlushStageCacheInput, - FlushStageCacheOutput, GENERATE_CLIENT_CERTIFICATE, GET_ACCOUNT, GET_API_KEY, @@ -186,141 +108,19 @@ GET_USAGE_PLAN_KEYS, GET_VPC_LINK, GET_VPC_LINKS, - GenerateClientCertificateInput, - GenerateClientCertificateOutput, - GetAccountInput, - GetAccountOutput, - GetApiKeyInput, - GetApiKeyOutput, - GetApiKeysInput, - GetApiKeysOutput, - GetAuthorizerInput, - GetAuthorizerOutput, - GetAuthorizersInput, - GetAuthorizersOutput, - GetBasePathMappingInput, - GetBasePathMappingOutput, - GetBasePathMappingsInput, - GetBasePathMappingsOutput, - GetClientCertificateInput, - GetClientCertificateOutput, - GetClientCertificatesInput, - GetClientCertificatesOutput, - GetDeploymentInput, - GetDeploymentOutput, - GetDeploymentsInput, - GetDeploymentsOutput, - GetDocumentationPartInput, - GetDocumentationPartOutput, - GetDocumentationPartsInput, - GetDocumentationPartsOutput, - GetDocumentationVersionInput, - GetDocumentationVersionOutput, - GetDocumentationVersionsInput, - GetDocumentationVersionsOutput, - GetDomainNameAccessAssociationsInput, - GetDomainNameAccessAssociationsOutput, - GetDomainNameInput, - GetDomainNameOutput, - GetDomainNamesInput, - GetDomainNamesOutput, - GetExportInput, - GetExportOutput, - GetGatewayResponseInput, - GetGatewayResponseOutput, - GetGatewayResponsesInput, - GetGatewayResponsesOutput, - GetIntegrationInput, - GetIntegrationOutput, - GetIntegrationResponseInput, - GetIntegrationResponseOutput, - GetMethodInput, - GetMethodOutput, - GetMethodResponseInput, - GetMethodResponseOutput, - GetModelInput, - GetModelOutput, - GetModelTemplateInput, - GetModelTemplateOutput, - GetModelsInput, - GetModelsOutput, - GetRequestValidatorInput, - GetRequestValidatorOutput, - GetRequestValidatorsInput, - GetRequestValidatorsOutput, - GetResourceInput, - GetResourceOutput, - GetResourcesInput, - GetResourcesOutput, - GetRestApiInput, - GetRestApiOutput, - GetRestApisInput, - GetRestApisOutput, - GetSdkInput, - GetSdkOutput, - GetSdkTypeInput, - GetSdkTypeOutput, - GetSdkTypesInput, - GetSdkTypesOutput, - GetStageInput, - GetStageOutput, - GetStagesInput, - GetStagesOutput, - GetTagsInput, - GetTagsOutput, - GetUsageInput, - GetUsageOutput, - GetUsagePlanInput, - GetUsagePlanKeyInput, - GetUsagePlanKeyOutput, - GetUsagePlanKeysInput, - GetUsagePlanKeysOutput, - GetUsagePlanOutput, - GetUsagePlansInput, - GetUsagePlansOutput, - GetVpcLinkInput, - GetVpcLinkOutput, - GetVpcLinksInput, - GetVpcLinksOutput, IMPORT_API_KEYS, IMPORT_DOCUMENTATION_PARTS, IMPORT_REST_API, - ImportApiKeysInput, - ImportApiKeysOutput, - ImportDocumentationPartsInput, - ImportDocumentationPartsOutput, - ImportRestApiInput, - ImportRestApiOutput, PUT_GATEWAY_RESPONSE, PUT_INTEGRATION, PUT_INTEGRATION_RESPONSE, PUT_METHOD, PUT_METHOD_RESPONSE, PUT_REST_API, - PutGatewayResponseInput, - PutGatewayResponseOutput, - PutIntegrationInput, - PutIntegrationOutput, - PutIntegrationResponseInput, - PutIntegrationResponseOutput, - PutMethodInput, - PutMethodOutput, - PutMethodResponseInput, - PutMethodResponseOutput, - PutRestApiInput, - PutRestApiOutput, REJECT_DOMAIN_NAME_ACCESS_ASSOCIATION, - RejectDomainNameAccessAssociationInput, - RejectDomainNameAccessAssociationOutput, TAG_RESOURCE, TEST_INVOKE_AUTHORIZER, TEST_INVOKE_METHOD, - TagResourceInput, - TagResourceOutput, - TestInvokeAuthorizerInput, - TestInvokeAuthorizerOutput, - TestInvokeMethodInput, - TestInvokeMethodOutput, UNTAG_RESOURCE, UPDATE_ACCOUNT, UPDATE_API_KEY, @@ -344,55 +144,263 @@ UPDATE_USAGE, UPDATE_USAGE_PLAN, UPDATE_VPC_LINK, - UntagResourceInput, - UntagResourceOutput, - UpdateAccountInput, - UpdateAccountOutput, - UpdateApiKeyInput, - UpdateApiKeyOutput, - UpdateAuthorizerInput, - UpdateAuthorizerOutput, - UpdateBasePathMappingInput, - UpdateBasePathMappingOutput, - UpdateClientCertificateInput, - UpdateClientCertificateOutput, - UpdateDeploymentInput, - UpdateDeploymentOutput, - UpdateDocumentationPartInput, - UpdateDocumentationPartOutput, - UpdateDocumentationVersionInput, - UpdateDocumentationVersionOutput, - UpdateDomainNameInput, - UpdateDomainNameOutput, - UpdateGatewayResponseInput, - UpdateGatewayResponseOutput, - UpdateIntegrationInput, - UpdateIntegrationOutput, - UpdateIntegrationResponseInput, - UpdateIntegrationResponseOutput, - UpdateMethodInput, - UpdateMethodOutput, - UpdateMethodResponseInput, - UpdateMethodResponseOutput, - UpdateModelInput, - UpdateModelOutput, - UpdateRequestValidatorInput, - UpdateRequestValidatorOutput, - UpdateResourceInput, - UpdateResourceOutput, - UpdateRestApiInput, - UpdateRestApiOutput, - UpdateStageInput, - UpdateStageOutput, - UpdateUsageInput, - UpdateUsageOutput, - UpdateUsagePlanInput, - UpdateUsagePlanOutput, - UpdateVpcLinkInput, - UpdateVpcLinkOutput, ) from .user_agent import aws_user_agent_plugin +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .models import ( + CreateApiKeyInput, + CreateApiKeyOutput, + CreateAuthorizerInput, + CreateAuthorizerOutput, + CreateBasePathMappingInput, + CreateBasePathMappingOutput, + CreateDeploymentInput, + CreateDeploymentOutput, + CreateDocumentationPartInput, + CreateDocumentationPartOutput, + CreateDocumentationVersionInput, + CreateDocumentationVersionOutput, + CreateDomainNameAccessAssociationInput, + CreateDomainNameAccessAssociationOutput, + CreateDomainNameInput, + CreateDomainNameOutput, + CreateModelInput, + CreateModelOutput, + CreateRequestValidatorInput, + CreateRequestValidatorOutput, + CreateResourceInput, + CreateResourceOutput, + CreateRestApiInput, + CreateRestApiOutput, + CreateStageInput, + CreateStageOutput, + CreateUsagePlanInput, + CreateUsagePlanKeyInput, + CreateUsagePlanKeyOutput, + CreateUsagePlanOutput, + CreateVpcLinkInput, + CreateVpcLinkOutput, + DeleteApiKeyInput, + DeleteApiKeyOutput, + DeleteAuthorizerInput, + DeleteAuthorizerOutput, + DeleteBasePathMappingInput, + DeleteBasePathMappingOutput, + DeleteClientCertificateInput, + DeleteClientCertificateOutput, + DeleteDeploymentInput, + DeleteDeploymentOutput, + DeleteDocumentationPartInput, + DeleteDocumentationPartOutput, + DeleteDocumentationVersionInput, + DeleteDocumentationVersionOutput, + DeleteDomainNameAccessAssociationInput, + DeleteDomainNameAccessAssociationOutput, + DeleteDomainNameInput, + DeleteDomainNameOutput, + DeleteGatewayResponseInput, + DeleteGatewayResponseOutput, + DeleteIntegrationInput, + DeleteIntegrationOutput, + DeleteIntegrationResponseInput, + DeleteIntegrationResponseOutput, + DeleteMethodInput, + DeleteMethodOutput, + DeleteMethodResponseInput, + DeleteMethodResponseOutput, + DeleteModelInput, + DeleteModelOutput, + DeleteRequestValidatorInput, + DeleteRequestValidatorOutput, + DeleteResourceInput, + DeleteResourceOutput, + DeleteRestApiInput, + DeleteRestApiOutput, + DeleteStageInput, + DeleteStageOutput, + DeleteUsagePlanInput, + DeleteUsagePlanKeyInput, + DeleteUsagePlanKeyOutput, + DeleteUsagePlanOutput, + DeleteVpcLinkInput, + DeleteVpcLinkOutput, + FlushStageAuthorizersCacheInput, + FlushStageAuthorizersCacheOutput, + FlushStageCacheInput, + FlushStageCacheOutput, + GenerateClientCertificateInput, + GenerateClientCertificateOutput, + GetAccountInput, + GetAccountOutput, + GetApiKeyInput, + GetApiKeyOutput, + GetApiKeysInput, + GetApiKeysOutput, + GetAuthorizerInput, + GetAuthorizerOutput, + GetAuthorizersInput, + GetAuthorizersOutput, + GetBasePathMappingInput, + GetBasePathMappingOutput, + GetBasePathMappingsInput, + GetBasePathMappingsOutput, + GetClientCertificateInput, + GetClientCertificateOutput, + GetClientCertificatesInput, + GetClientCertificatesOutput, + GetDeploymentInput, + GetDeploymentOutput, + GetDeploymentsInput, + GetDeploymentsOutput, + GetDocumentationPartInput, + GetDocumentationPartOutput, + GetDocumentationPartsInput, + GetDocumentationPartsOutput, + GetDocumentationVersionInput, + GetDocumentationVersionOutput, + GetDocumentationVersionsInput, + GetDocumentationVersionsOutput, + GetDomainNameAccessAssociationsInput, + GetDomainNameAccessAssociationsOutput, + GetDomainNameInput, + GetDomainNameOutput, + GetDomainNamesInput, + GetDomainNamesOutput, + GetExportInput, + GetExportOutput, + GetGatewayResponseInput, + GetGatewayResponseOutput, + GetGatewayResponsesInput, + GetGatewayResponsesOutput, + GetIntegrationInput, + GetIntegrationOutput, + GetIntegrationResponseInput, + GetIntegrationResponseOutput, + GetMethodInput, + GetMethodOutput, + GetMethodResponseInput, + GetMethodResponseOutput, + GetModelInput, + GetModelOutput, + GetModelTemplateInput, + GetModelTemplateOutput, + GetModelsInput, + GetModelsOutput, + GetRequestValidatorInput, + GetRequestValidatorOutput, + GetRequestValidatorsInput, + GetRequestValidatorsOutput, + GetResourceInput, + GetResourceOutput, + GetResourcesInput, + GetResourcesOutput, + GetRestApiInput, + GetRestApiOutput, + GetRestApisInput, + GetRestApisOutput, + GetSdkInput, + GetSdkOutput, + GetSdkTypeInput, + GetSdkTypeOutput, + GetSdkTypesInput, + GetSdkTypesOutput, + GetStageInput, + GetStageOutput, + GetStagesInput, + GetStagesOutput, + GetTagsInput, + GetTagsOutput, + GetUsageInput, + GetUsageOutput, + GetUsagePlanInput, + GetUsagePlanKeyInput, + GetUsagePlanKeyOutput, + GetUsagePlanKeysInput, + GetUsagePlanKeysOutput, + GetUsagePlanOutput, + GetUsagePlansInput, + GetUsagePlansOutput, + GetVpcLinkInput, + GetVpcLinkOutput, + GetVpcLinksInput, + GetVpcLinksOutput, + ImportApiKeysInput, + ImportApiKeysOutput, + ImportDocumentationPartsInput, + ImportDocumentationPartsOutput, + ImportRestApiInput, + ImportRestApiOutput, + PutGatewayResponseInput, + PutGatewayResponseOutput, + PutIntegrationInput, + PutIntegrationOutput, + PutIntegrationResponseInput, + PutIntegrationResponseOutput, + PutMethodInput, + PutMethodOutput, + PutMethodResponseInput, + PutMethodResponseOutput, + PutRestApiInput, + PutRestApiOutput, + RejectDomainNameAccessAssociationInput, + RejectDomainNameAccessAssociationOutput, + TagResourceInput, + TagResourceOutput, + TestInvokeAuthorizerInput, + TestInvokeAuthorizerOutput, + TestInvokeMethodInput, + TestInvokeMethodOutput, + UntagResourceInput, + UntagResourceOutput, + UpdateAccountInput, + UpdateAccountOutput, + UpdateApiKeyInput, + UpdateApiKeyOutput, + UpdateAuthorizerInput, + UpdateAuthorizerOutput, + UpdateBasePathMappingInput, + UpdateBasePathMappingOutput, + UpdateClientCertificateInput, + UpdateClientCertificateOutput, + UpdateDeploymentInput, + UpdateDeploymentOutput, + UpdateDocumentationPartInput, + UpdateDocumentationPartOutput, + UpdateDocumentationVersionInput, + UpdateDocumentationVersionOutput, + UpdateDomainNameInput, + UpdateDomainNameOutput, + UpdateGatewayResponseInput, + UpdateGatewayResponseOutput, + UpdateIntegrationInput, + UpdateIntegrationOutput, + UpdateIntegrationResponseInput, + UpdateIntegrationResponseOutput, + UpdateMethodInput, + UpdateMethodOutput, + UpdateMethodResponseInput, + UpdateMethodResponseOutput, + UpdateModelInput, + UpdateModelOutput, + UpdateRequestValidatorInput, + UpdateRequestValidatorOutput, + UpdateResourceInput, + UpdateResourceOutput, + UpdateRestApiInput, + UpdateRestApiOutput, + UpdateStageInput, + UpdateStageOutput, + UpdateUsageInput, + UpdateUsageOutput, + UpdateUsagePlanInput, + UpdateUsagePlanOutput, + UpdateVpcLinkInput, + UpdateVpcLinkOutput, + ) + logger = logging.getLogger(__name__) @@ -468,12 +476,12 @@ async def _post_setup(self, config: AsyncAPIGatewayConfig) -> None: config_file = await config_context.parsed_profiles() if config_context.profile_source is ConfigSource.OVERRIDE: profile_name = config_context.profile_name - config.aws_credentials_identity_resolver = await IdentityChain.create( + config.aws_credentials_identity_resolver = await AsyncIdentityChain.create( AWSCredentialsIdentity, config_file=config_file, profile_name=profile_name, region_override=config.region, - http_client=cast(HTTPClient | None, config.transport), + http_client=cast(AsyncHTTPClient | None, config.transport), ) async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( @@ -482,7 +490,7 @@ async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( operation: APIOperation[I, O], default_plugins: list[Plugin], plugins: list[Plugin] | None, - ) -> tuple[RequestPipeline[Any, Any], ClientCall[I, O]]: + ) -> tuple[AsyncRequestPipeline[Any, Any], AsyncClientCall[I, O]]: if self._closed: raise RuntimeError( "Cannot invoke an operation on a client that has been closed." diff --git a/clients/aws-sdk-api-gateway/src/aws_sdk_api_gateway/config.py b/clients/aws-sdk-api-gateway/src/aws_sdk_api_gateway/config.py index 6f3e6361..bd1d9eb4 100644 --- a/clients/aws-sdk-api-gateway/src/aws_sdk_api_gateway/config.py +++ b/clients/aws-sdk-api-gateway/src/aws_sdk_api_gateway/config.py @@ -1,459 +1,496 @@ # Code generated by smithy-python-codegen DO NOT EDIT. from dataclasses import dataclass, field -from typing import Any, Callable, ClassVar, Self, TypeAlias, Union, Unpack +from typing import ( + Any, + Callable, + ClassVar, + Self, + TYPE_CHECKING, + TypeAlias, + Union, + Unpack, +) -from smithy_aws_core.aio.protocols import RestJsonClientProtocol -from smithy_aws_core.auth import SigV4AuthScheme -from smithy_aws_core.config import AwsConfigOverrides, FileSystem -from smithy_aws_core.config.aws_config import AsyncAwsConfig -from smithy_aws_core.config.resolvers import EndpointUriResolver -from smithy_aws_core.config.types import FieldSpec -from smithy_aws_core.endpoints.standard_regional import ( - StandardRegionalEndpointsResolver, +from smithy_aws_core.aio.auth.sigv4 import AsyncSigV4AuthScheme +from smithy_aws_core.aio.config import AsyncFileSystem +from smithy_aws_core.aio.config.aws_config import AsyncAwsConfig, AwsConfigOverrides +from smithy_aws_core.aio.config.resolvers import EndpointUriResolver +from smithy_aws_core.aio.endpoints.standard_regional import ( + AsyncStandardRegionalEndpointsResolver, ) +from smithy_aws_core.aio.protocols import AsyncRestJsonClientProtocol +from smithy_aws_core.config.types import FieldSpec from smithy_aws_core.identity import AWSCredentialsIdentity, AWSIdentityProperties -from smithy_core.aio.interfaces import ( - ClientProtocol, - EndpointResolver, - ProtocolConstructor, - ProtocolSettings, -) -from smithy_core.aio.interfaces.auth import AuthScheme -from smithy_core.aio.interfaces.identity import IdentityResolver -from smithy_core.interceptors import Interceptor +from smithy_core.aio.interfaces import AsyncClientProtocol, AsyncEndpointResolver +from smithy_core.aio.interfaces.auth import AsyncAuthScheme +from smithy_core.aio.interfaces.identity import AsyncIdentityResolver +from smithy_core.interfaces import ProtocolConstructor, ProtocolSettings from smithy_core.interfaces.auth import AuthSchemeResolver from smithy_core.shapes import ShapeID from smithy_http.aio.aiohttp import AIOHTTPClient +from ._private.schemas import BACKPLANE_CONTROL_SERVICE from .auth import HTTPAuthSchemeResolver -from .models import ( - CreateApiKeyInput, - CreateApiKeyOutput, - CreateAuthorizerInput, - CreateAuthorizerOutput, - CreateBasePathMappingInput, - CreateBasePathMappingOutput, - CreateDeploymentInput, - CreateDeploymentOutput, - CreateDocumentationPartInput, - CreateDocumentationPartOutput, - CreateDocumentationVersionInput, - CreateDocumentationVersionOutput, - CreateDomainNameAccessAssociationInput, - CreateDomainNameAccessAssociationOutput, - CreateDomainNameInput, - CreateDomainNameOutput, - CreateModelInput, - CreateModelOutput, - CreateRequestValidatorInput, - CreateRequestValidatorOutput, - CreateResourceInput, - CreateResourceOutput, - CreateRestApiInput, - CreateRestApiOutput, - CreateStageInput, - CreateStageOutput, - CreateUsagePlanInput, - CreateUsagePlanKeyInput, - CreateUsagePlanKeyOutput, - CreateUsagePlanOutput, - CreateVpcLinkInput, - CreateVpcLinkOutput, - DeleteApiKeyInput, - DeleteApiKeyOutput, - DeleteAuthorizerInput, - DeleteAuthorizerOutput, - DeleteBasePathMappingInput, - DeleteBasePathMappingOutput, - DeleteClientCertificateInput, - DeleteClientCertificateOutput, - DeleteDeploymentInput, - DeleteDeploymentOutput, - DeleteDocumentationPartInput, - DeleteDocumentationPartOutput, - DeleteDocumentationVersionInput, - DeleteDocumentationVersionOutput, - DeleteDomainNameAccessAssociationInput, - DeleteDomainNameAccessAssociationOutput, - DeleteDomainNameInput, - DeleteDomainNameOutput, - DeleteGatewayResponseInput, - DeleteGatewayResponseOutput, - DeleteIntegrationInput, - DeleteIntegrationOutput, - DeleteIntegrationResponseInput, - DeleteIntegrationResponseOutput, - DeleteMethodInput, - DeleteMethodOutput, - DeleteMethodResponseInput, - DeleteMethodResponseOutput, - DeleteModelInput, - DeleteModelOutput, - DeleteRequestValidatorInput, - DeleteRequestValidatorOutput, - DeleteResourceInput, - DeleteResourceOutput, - DeleteRestApiInput, - DeleteRestApiOutput, - DeleteStageInput, - DeleteStageOutput, - DeleteUsagePlanInput, - DeleteUsagePlanKeyInput, - DeleteUsagePlanKeyOutput, - DeleteUsagePlanOutput, - DeleteVpcLinkInput, - DeleteVpcLinkOutput, - FlushStageAuthorizersCacheInput, - FlushStageAuthorizersCacheOutput, - FlushStageCacheInput, - FlushStageCacheOutput, - GenerateClientCertificateInput, - GenerateClientCertificateOutput, - GetAccountInput, - GetAccountOutput, - GetApiKeyInput, - GetApiKeyOutput, - GetApiKeysInput, - GetApiKeysOutput, - GetAuthorizerInput, - GetAuthorizerOutput, - GetAuthorizersInput, - GetAuthorizersOutput, - GetBasePathMappingInput, - GetBasePathMappingOutput, - GetBasePathMappingsInput, - GetBasePathMappingsOutput, - GetClientCertificateInput, - GetClientCertificateOutput, - GetClientCertificatesInput, - GetClientCertificatesOutput, - GetDeploymentInput, - GetDeploymentOutput, - GetDeploymentsInput, - GetDeploymentsOutput, - GetDocumentationPartInput, - GetDocumentationPartOutput, - GetDocumentationPartsInput, - GetDocumentationPartsOutput, - GetDocumentationVersionInput, - GetDocumentationVersionOutput, - GetDocumentationVersionsInput, - GetDocumentationVersionsOutput, - GetDomainNameAccessAssociationsInput, - GetDomainNameAccessAssociationsOutput, - GetDomainNameInput, - GetDomainNameOutput, - GetDomainNamesInput, - GetDomainNamesOutput, - GetExportInput, - GetExportOutput, - GetGatewayResponseInput, - GetGatewayResponseOutput, - GetGatewayResponsesInput, - GetGatewayResponsesOutput, - GetIntegrationInput, - GetIntegrationOutput, - GetIntegrationResponseInput, - GetIntegrationResponseOutput, - GetMethodInput, - GetMethodOutput, - GetMethodResponseInput, - GetMethodResponseOutput, - GetModelInput, - GetModelOutput, - GetModelTemplateInput, - GetModelTemplateOutput, - GetModelsInput, - GetModelsOutput, - GetRequestValidatorInput, - GetRequestValidatorOutput, - GetRequestValidatorsInput, - GetRequestValidatorsOutput, - GetResourceInput, - GetResourceOutput, - GetResourcesInput, - GetResourcesOutput, - GetRestApiInput, - GetRestApiOutput, - GetRestApisInput, - GetRestApisOutput, - GetSdkInput, - GetSdkOutput, - GetSdkTypeInput, - GetSdkTypeOutput, - GetSdkTypesInput, - GetSdkTypesOutput, - GetStageInput, - GetStageOutput, - GetStagesInput, - GetStagesOutput, - GetTagsInput, - GetTagsOutput, - GetUsageInput, - GetUsageOutput, - GetUsagePlanInput, - GetUsagePlanKeyInput, - GetUsagePlanKeyOutput, - GetUsagePlanKeysInput, - GetUsagePlanKeysOutput, - GetUsagePlanOutput, - GetUsagePlansInput, - GetUsagePlansOutput, - GetVpcLinkInput, - GetVpcLinkOutput, - GetVpcLinksInput, - GetVpcLinksOutput, - ImportApiKeysInput, - ImportApiKeysOutput, - ImportDocumentationPartsInput, - ImportDocumentationPartsOutput, - ImportRestApiInput, - ImportRestApiOutput, - PutGatewayResponseInput, - PutGatewayResponseOutput, - PutIntegrationInput, - PutIntegrationOutput, - PutIntegrationResponseInput, - PutIntegrationResponseOutput, - PutMethodInput, - PutMethodOutput, - PutMethodResponseInput, - PutMethodResponseOutput, - PutRestApiInput, - PutRestApiOutput, - RejectDomainNameAccessAssociationInput, - RejectDomainNameAccessAssociationOutput, - TagResourceInput, - TagResourceOutput, - TestInvokeAuthorizerInput, - TestInvokeAuthorizerOutput, - TestInvokeMethodInput, - TestInvokeMethodOutput, - UntagResourceInput, - UntagResourceOutput, - UpdateAccountInput, - UpdateAccountOutput, - UpdateApiKeyInput, - UpdateApiKeyOutput, - UpdateAuthorizerInput, - UpdateAuthorizerOutput, - UpdateBasePathMappingInput, - UpdateBasePathMappingOutput, - UpdateClientCertificateInput, - UpdateClientCertificateOutput, - UpdateDeploymentInput, - UpdateDeploymentOutput, - UpdateDocumentationPartInput, - UpdateDocumentationPartOutput, - UpdateDocumentationVersionInput, - UpdateDocumentationVersionOutput, - UpdateDomainNameInput, - UpdateDomainNameOutput, - UpdateGatewayResponseInput, - UpdateGatewayResponseOutput, - UpdateIntegrationInput, - UpdateIntegrationOutput, - UpdateIntegrationResponseInput, - UpdateIntegrationResponseOutput, - UpdateMethodInput, - UpdateMethodOutput, - UpdateMethodResponseInput, - UpdateMethodResponseOutput, - UpdateModelInput, - UpdateModelOutput, - UpdateRequestValidatorInput, - UpdateRequestValidatorOutput, - UpdateResourceInput, - UpdateResourceOutput, - UpdateRestApiInput, - UpdateRestApiOutput, - UpdateStageInput, - UpdateStageOutput, - UpdateUsageInput, - UpdateUsageOutput, - UpdateUsagePlanInput, - UpdateUsagePlanOutput, - UpdateVpcLinkInput, - UpdateVpcLinkOutput, -) -_ServiceInterceptor = Union[ - Interceptor[CreateApiKeyInput, CreateApiKeyOutput, Any, Any], - Interceptor[CreateAuthorizerInput, CreateAuthorizerOutput, Any, Any], - Interceptor[CreateBasePathMappingInput, CreateBasePathMappingOutput, Any, Any], - Interceptor[CreateDeploymentInput, CreateDeploymentOutput, Any, Any], - Interceptor[CreateDocumentationPartInput, CreateDocumentationPartOutput, Any, Any], - Interceptor[ - CreateDocumentationVersionInput, CreateDocumentationVersionOutput, Any, Any - ], - Interceptor[CreateDomainNameInput, CreateDomainNameOutput, Any, Any], - Interceptor[ +if TYPE_CHECKING: + from smithy_core.interceptors import Interceptor + from .models import ( + CreateApiKeyInput, + CreateApiKeyOutput, + CreateAuthorizerInput, + CreateAuthorizerOutput, + CreateBasePathMappingInput, + CreateBasePathMappingOutput, + CreateDeploymentInput, + CreateDeploymentOutput, + CreateDocumentationPartInput, + CreateDocumentationPartOutput, + CreateDocumentationVersionInput, + CreateDocumentationVersionOutput, CreateDomainNameAccessAssociationInput, CreateDomainNameAccessAssociationOutput, - Any, - Any, - ], - Interceptor[CreateModelInput, CreateModelOutput, Any, Any], - Interceptor[CreateRequestValidatorInput, CreateRequestValidatorOutput, Any, Any], - Interceptor[CreateResourceInput, CreateResourceOutput, Any, Any], - Interceptor[CreateRestApiInput, CreateRestApiOutput, Any, Any], - Interceptor[CreateStageInput, CreateStageOutput, Any, Any], - Interceptor[CreateUsagePlanInput, CreateUsagePlanOutput, Any, Any], - Interceptor[CreateUsagePlanKeyInput, CreateUsagePlanKeyOutput, Any, Any], - Interceptor[CreateVpcLinkInput, CreateVpcLinkOutput, Any, Any], - Interceptor[DeleteApiKeyInput, DeleteApiKeyOutput, Any, Any], - Interceptor[DeleteAuthorizerInput, DeleteAuthorizerOutput, Any, Any], - Interceptor[DeleteBasePathMappingInput, DeleteBasePathMappingOutput, Any, Any], - Interceptor[DeleteClientCertificateInput, DeleteClientCertificateOutput, Any, Any], - Interceptor[DeleteDeploymentInput, DeleteDeploymentOutput, Any, Any], - Interceptor[DeleteDocumentationPartInput, DeleteDocumentationPartOutput, Any, Any], - Interceptor[ - DeleteDocumentationVersionInput, DeleteDocumentationVersionOutput, Any, Any - ], - Interceptor[DeleteDomainNameInput, DeleteDomainNameOutput, Any, Any], - Interceptor[ + CreateDomainNameInput, + CreateDomainNameOutput, + CreateModelInput, + CreateModelOutput, + CreateRequestValidatorInput, + CreateRequestValidatorOutput, + CreateResourceInput, + CreateResourceOutput, + CreateRestApiInput, + CreateRestApiOutput, + CreateStageInput, + CreateStageOutput, + CreateUsagePlanInput, + CreateUsagePlanKeyInput, + CreateUsagePlanKeyOutput, + CreateUsagePlanOutput, + CreateVpcLinkInput, + CreateVpcLinkOutput, + DeleteApiKeyInput, + DeleteApiKeyOutput, + DeleteAuthorizerInput, + DeleteAuthorizerOutput, + DeleteBasePathMappingInput, + DeleteBasePathMappingOutput, + DeleteClientCertificateInput, + DeleteClientCertificateOutput, + DeleteDeploymentInput, + DeleteDeploymentOutput, + DeleteDocumentationPartInput, + DeleteDocumentationPartOutput, + DeleteDocumentationVersionInput, + DeleteDocumentationVersionOutput, DeleteDomainNameAccessAssociationInput, DeleteDomainNameAccessAssociationOutput, - Any, - Any, - ], - Interceptor[DeleteGatewayResponseInput, DeleteGatewayResponseOutput, Any, Any], - Interceptor[DeleteIntegrationInput, DeleteIntegrationOutput, Any, Any], - Interceptor[ - DeleteIntegrationResponseInput, DeleteIntegrationResponseOutput, Any, Any - ], - Interceptor[DeleteMethodInput, DeleteMethodOutput, Any, Any], - Interceptor[DeleteMethodResponseInput, DeleteMethodResponseOutput, Any, Any], - Interceptor[DeleteModelInput, DeleteModelOutput, Any, Any], - Interceptor[DeleteRequestValidatorInput, DeleteRequestValidatorOutput, Any, Any], - Interceptor[DeleteResourceInput, DeleteResourceOutput, Any, Any], - Interceptor[DeleteRestApiInput, DeleteRestApiOutput, Any, Any], - Interceptor[DeleteStageInput, DeleteStageOutput, Any, Any], - Interceptor[DeleteUsagePlanInput, DeleteUsagePlanOutput, Any, Any], - Interceptor[DeleteUsagePlanKeyInput, DeleteUsagePlanKeyOutput, Any, Any], - Interceptor[DeleteVpcLinkInput, DeleteVpcLinkOutput, Any, Any], - Interceptor[ - FlushStageAuthorizersCacheInput, FlushStageAuthorizersCacheOutput, Any, Any - ], - Interceptor[FlushStageCacheInput, FlushStageCacheOutput, Any, Any], - Interceptor[ - GenerateClientCertificateInput, GenerateClientCertificateOutput, Any, Any - ], - Interceptor[GetAccountInput, GetAccountOutput, Any, Any], - Interceptor[GetApiKeyInput, GetApiKeyOutput, Any, Any], - Interceptor[GetApiKeysInput, GetApiKeysOutput, Any, Any], - Interceptor[GetAuthorizerInput, GetAuthorizerOutput, Any, Any], - Interceptor[GetAuthorizersInput, GetAuthorizersOutput, Any, Any], - Interceptor[GetBasePathMappingInput, GetBasePathMappingOutput, Any, Any], - Interceptor[GetBasePathMappingsInput, GetBasePathMappingsOutput, Any, Any], - Interceptor[GetClientCertificateInput, GetClientCertificateOutput, Any, Any], - Interceptor[GetClientCertificatesInput, GetClientCertificatesOutput, Any, Any], - Interceptor[GetDeploymentInput, GetDeploymentOutput, Any, Any], - Interceptor[GetDeploymentsInput, GetDeploymentsOutput, Any, Any], - Interceptor[GetDocumentationPartInput, GetDocumentationPartOutput, Any, Any], - Interceptor[GetDocumentationPartsInput, GetDocumentationPartsOutput, Any, Any], - Interceptor[GetDocumentationVersionInput, GetDocumentationVersionOutput, Any, Any], - Interceptor[ - GetDocumentationVersionsInput, GetDocumentationVersionsOutput, Any, Any - ], - Interceptor[GetDomainNameInput, GetDomainNameOutput, Any, Any], - Interceptor[ + DeleteDomainNameInput, + DeleteDomainNameOutput, + DeleteGatewayResponseInput, + DeleteGatewayResponseOutput, + DeleteIntegrationInput, + DeleteIntegrationOutput, + DeleteIntegrationResponseInput, + DeleteIntegrationResponseOutput, + DeleteMethodInput, + DeleteMethodOutput, + DeleteMethodResponseInput, + DeleteMethodResponseOutput, + DeleteModelInput, + DeleteModelOutput, + DeleteRequestValidatorInput, + DeleteRequestValidatorOutput, + DeleteResourceInput, + DeleteResourceOutput, + DeleteRestApiInput, + DeleteRestApiOutput, + DeleteStageInput, + DeleteStageOutput, + DeleteUsagePlanInput, + DeleteUsagePlanKeyInput, + DeleteUsagePlanKeyOutput, + DeleteUsagePlanOutput, + DeleteVpcLinkInput, + DeleteVpcLinkOutput, + FlushStageAuthorizersCacheInput, + FlushStageAuthorizersCacheOutput, + FlushStageCacheInput, + FlushStageCacheOutput, + GenerateClientCertificateInput, + GenerateClientCertificateOutput, + GetAccountInput, + GetAccountOutput, + GetApiKeyInput, + GetApiKeyOutput, + GetApiKeysInput, + GetApiKeysOutput, + GetAuthorizerInput, + GetAuthorizerOutput, + GetAuthorizersInput, + GetAuthorizersOutput, + GetBasePathMappingInput, + GetBasePathMappingOutput, + GetBasePathMappingsInput, + GetBasePathMappingsOutput, + GetClientCertificateInput, + GetClientCertificateOutput, + GetClientCertificatesInput, + GetClientCertificatesOutput, + GetDeploymentInput, + GetDeploymentOutput, + GetDeploymentsInput, + GetDeploymentsOutput, + GetDocumentationPartInput, + GetDocumentationPartOutput, + GetDocumentationPartsInput, + GetDocumentationPartsOutput, + GetDocumentationVersionInput, + GetDocumentationVersionOutput, + GetDocumentationVersionsInput, + GetDocumentationVersionsOutput, GetDomainNameAccessAssociationsInput, GetDomainNameAccessAssociationsOutput, - Any, - Any, - ], - Interceptor[GetDomainNamesInput, GetDomainNamesOutput, Any, Any], - Interceptor[GetExportInput, GetExportOutput, Any, Any], - Interceptor[GetGatewayResponseInput, GetGatewayResponseOutput, Any, Any], - Interceptor[GetGatewayResponsesInput, GetGatewayResponsesOutput, Any, Any], - Interceptor[GetIntegrationInput, GetIntegrationOutput, Any, Any], - Interceptor[GetIntegrationResponseInput, GetIntegrationResponseOutput, Any, Any], - Interceptor[GetMethodInput, GetMethodOutput, Any, Any], - Interceptor[GetMethodResponseInput, GetMethodResponseOutput, Any, Any], - Interceptor[GetModelInput, GetModelOutput, Any, Any], - Interceptor[GetModelsInput, GetModelsOutput, Any, Any], - Interceptor[GetModelTemplateInput, GetModelTemplateOutput, Any, Any], - Interceptor[GetRequestValidatorInput, GetRequestValidatorOutput, Any, Any], - Interceptor[GetRequestValidatorsInput, GetRequestValidatorsOutput, Any, Any], - Interceptor[GetResourceInput, GetResourceOutput, Any, Any], - Interceptor[GetResourcesInput, GetResourcesOutput, Any, Any], - Interceptor[GetRestApiInput, GetRestApiOutput, Any, Any], - Interceptor[GetRestApisInput, GetRestApisOutput, Any, Any], - Interceptor[GetSdkInput, GetSdkOutput, Any, Any], - Interceptor[GetSdkTypeInput, GetSdkTypeOutput, Any, Any], - Interceptor[GetSdkTypesInput, GetSdkTypesOutput, Any, Any], - Interceptor[GetStageInput, GetStageOutput, Any, Any], - Interceptor[GetStagesInput, GetStagesOutput, Any, Any], - Interceptor[GetTagsInput, GetTagsOutput, Any, Any], - Interceptor[GetUsageInput, GetUsageOutput, Any, Any], - Interceptor[GetUsagePlanInput, GetUsagePlanOutput, Any, Any], - Interceptor[GetUsagePlanKeyInput, GetUsagePlanKeyOutput, Any, Any], - Interceptor[GetUsagePlanKeysInput, GetUsagePlanKeysOutput, Any, Any], - Interceptor[GetUsagePlansInput, GetUsagePlansOutput, Any, Any], - Interceptor[GetVpcLinkInput, GetVpcLinkOutput, Any, Any], - Interceptor[GetVpcLinksInput, GetVpcLinksOutput, Any, Any], - Interceptor[ImportApiKeysInput, ImportApiKeysOutput, Any, Any], - Interceptor[ - ImportDocumentationPartsInput, ImportDocumentationPartsOutput, Any, Any - ], - Interceptor[ImportRestApiInput, ImportRestApiOutput, Any, Any], - Interceptor[PutGatewayResponseInput, PutGatewayResponseOutput, Any, Any], - Interceptor[PutIntegrationInput, PutIntegrationOutput, Any, Any], - Interceptor[PutIntegrationResponseInput, PutIntegrationResponseOutput, Any, Any], - Interceptor[PutMethodInput, PutMethodOutput, Any, Any], - Interceptor[PutMethodResponseInput, PutMethodResponseOutput, Any, Any], - Interceptor[PutRestApiInput, PutRestApiOutput, Any, Any], - Interceptor[ + GetDomainNameInput, + GetDomainNameOutput, + GetDomainNamesInput, + GetDomainNamesOutput, + GetExportInput, + GetExportOutput, + GetGatewayResponseInput, + GetGatewayResponseOutput, + GetGatewayResponsesInput, + GetGatewayResponsesOutput, + GetIntegrationInput, + GetIntegrationOutput, + GetIntegrationResponseInput, + GetIntegrationResponseOutput, + GetMethodInput, + GetMethodOutput, + GetMethodResponseInput, + GetMethodResponseOutput, + GetModelInput, + GetModelOutput, + GetModelTemplateInput, + GetModelTemplateOutput, + GetModelsInput, + GetModelsOutput, + GetRequestValidatorInput, + GetRequestValidatorOutput, + GetRequestValidatorsInput, + GetRequestValidatorsOutput, + GetResourceInput, + GetResourceOutput, + GetResourcesInput, + GetResourcesOutput, + GetRestApiInput, + GetRestApiOutput, + GetRestApisInput, + GetRestApisOutput, + GetSdkInput, + GetSdkOutput, + GetSdkTypeInput, + GetSdkTypeOutput, + GetSdkTypesInput, + GetSdkTypesOutput, + GetStageInput, + GetStageOutput, + GetStagesInput, + GetStagesOutput, + GetTagsInput, + GetTagsOutput, + GetUsageInput, + GetUsageOutput, + GetUsagePlanInput, + GetUsagePlanKeyInput, + GetUsagePlanKeyOutput, + GetUsagePlanKeysInput, + GetUsagePlanKeysOutput, + GetUsagePlanOutput, + GetUsagePlansInput, + GetUsagePlansOutput, + GetVpcLinkInput, + GetVpcLinkOutput, + GetVpcLinksInput, + GetVpcLinksOutput, + ImportApiKeysInput, + ImportApiKeysOutput, + ImportDocumentationPartsInput, + ImportDocumentationPartsOutput, + ImportRestApiInput, + ImportRestApiOutput, + PutGatewayResponseInput, + PutGatewayResponseOutput, + PutIntegrationInput, + PutIntegrationOutput, + PutIntegrationResponseInput, + PutIntegrationResponseOutput, + PutMethodInput, + PutMethodOutput, + PutMethodResponseInput, + PutMethodResponseOutput, + PutRestApiInput, + PutRestApiOutput, RejectDomainNameAccessAssociationInput, RejectDomainNameAccessAssociationOutput, - Any, - Any, - ], - Interceptor[TagResourceInput, TagResourceOutput, Any, Any], - Interceptor[TestInvokeAuthorizerInput, TestInvokeAuthorizerOutput, Any, Any], - Interceptor[TestInvokeMethodInput, TestInvokeMethodOutput, Any, Any], - Interceptor[UntagResourceInput, UntagResourceOutput, Any, Any], - Interceptor[UpdateAccountInput, UpdateAccountOutput, Any, Any], - Interceptor[UpdateApiKeyInput, UpdateApiKeyOutput, Any, Any], - Interceptor[UpdateAuthorizerInput, UpdateAuthorizerOutput, Any, Any], - Interceptor[UpdateBasePathMappingInput, UpdateBasePathMappingOutput, Any, Any], - Interceptor[UpdateClientCertificateInput, UpdateClientCertificateOutput, Any, Any], - Interceptor[UpdateDeploymentInput, UpdateDeploymentOutput, Any, Any], - Interceptor[UpdateDocumentationPartInput, UpdateDocumentationPartOutput, Any, Any], - Interceptor[ - UpdateDocumentationVersionInput, UpdateDocumentationVersionOutput, Any, Any - ], - Interceptor[UpdateDomainNameInput, UpdateDomainNameOutput, Any, Any], - Interceptor[UpdateGatewayResponseInput, UpdateGatewayResponseOutput, Any, Any], - Interceptor[UpdateIntegrationInput, UpdateIntegrationOutput, Any, Any], - Interceptor[ - UpdateIntegrationResponseInput, UpdateIntegrationResponseOutput, Any, Any - ], - Interceptor[UpdateMethodInput, UpdateMethodOutput, Any, Any], - Interceptor[UpdateMethodResponseInput, UpdateMethodResponseOutput, Any, Any], - Interceptor[UpdateModelInput, UpdateModelOutput, Any, Any], - Interceptor[UpdateRequestValidatorInput, UpdateRequestValidatorOutput, Any, Any], - Interceptor[UpdateResourceInput, UpdateResourceOutput, Any, Any], - Interceptor[UpdateRestApiInput, UpdateRestApiOutput, Any, Any], - Interceptor[UpdateStageInput, UpdateStageOutput, Any, Any], - Interceptor[UpdateUsageInput, UpdateUsageOutput, Any, Any], - Interceptor[UpdateUsagePlanInput, UpdateUsagePlanOutput, Any, Any], - Interceptor[UpdateVpcLinkInput, UpdateVpcLinkOutput, Any, Any], -] + TagResourceInput, + TagResourceOutput, + TestInvokeAuthorizerInput, + TestInvokeAuthorizerOutput, + TestInvokeMethodInput, + TestInvokeMethodOutput, + UntagResourceInput, + UntagResourceOutput, + UpdateAccountInput, + UpdateAccountOutput, + UpdateApiKeyInput, + UpdateApiKeyOutput, + UpdateAuthorizerInput, + UpdateAuthorizerOutput, + UpdateBasePathMappingInput, + UpdateBasePathMappingOutput, + UpdateClientCertificateInput, + UpdateClientCertificateOutput, + UpdateDeploymentInput, + UpdateDeploymentOutput, + UpdateDocumentationPartInput, + UpdateDocumentationPartOutput, + UpdateDocumentationVersionInput, + UpdateDocumentationVersionOutput, + UpdateDomainNameInput, + UpdateDomainNameOutput, + UpdateGatewayResponseInput, + UpdateGatewayResponseOutput, + UpdateIntegrationInput, + UpdateIntegrationOutput, + UpdateIntegrationResponseInput, + UpdateIntegrationResponseOutput, + UpdateMethodInput, + UpdateMethodOutput, + UpdateMethodResponseInput, + UpdateMethodResponseOutput, + UpdateModelInput, + UpdateModelOutput, + UpdateRequestValidatorInput, + UpdateRequestValidatorOutput, + UpdateResourceInput, + UpdateResourceOutput, + UpdateRestApiInput, + UpdateRestApiOutput, + UpdateStageInput, + UpdateStageOutput, + UpdateUsageInput, + UpdateUsageOutput, + UpdateUsagePlanInput, + UpdateUsagePlanOutput, + UpdateVpcLinkInput, + UpdateVpcLinkOutput, + ) + + _ServiceInterceptor = Union[ + Interceptor[CreateApiKeyInput, CreateApiKeyOutput, Any, Any], + Interceptor[CreateAuthorizerInput, CreateAuthorizerOutput, Any, Any], + Interceptor[CreateBasePathMappingInput, CreateBasePathMappingOutput, Any, Any], + Interceptor[CreateDeploymentInput, CreateDeploymentOutput, Any, Any], + Interceptor[ + CreateDocumentationPartInput, CreateDocumentationPartOutput, Any, Any + ], + Interceptor[ + CreateDocumentationVersionInput, CreateDocumentationVersionOutput, Any, Any + ], + Interceptor[CreateDomainNameInput, CreateDomainNameOutput, Any, Any], + Interceptor[ + CreateDomainNameAccessAssociationInput, + CreateDomainNameAccessAssociationOutput, + Any, + Any, + ], + Interceptor[CreateModelInput, CreateModelOutput, Any, Any], + Interceptor[ + CreateRequestValidatorInput, CreateRequestValidatorOutput, Any, Any + ], + Interceptor[CreateResourceInput, CreateResourceOutput, Any, Any], + Interceptor[CreateRestApiInput, CreateRestApiOutput, Any, Any], + Interceptor[CreateStageInput, CreateStageOutput, Any, Any], + Interceptor[CreateUsagePlanInput, CreateUsagePlanOutput, Any, Any], + Interceptor[CreateUsagePlanKeyInput, CreateUsagePlanKeyOutput, Any, Any], + Interceptor[CreateVpcLinkInput, CreateVpcLinkOutput, Any, Any], + Interceptor[DeleteApiKeyInput, DeleteApiKeyOutput, Any, Any], + Interceptor[DeleteAuthorizerInput, DeleteAuthorizerOutput, Any, Any], + Interceptor[DeleteBasePathMappingInput, DeleteBasePathMappingOutput, Any, Any], + Interceptor[ + DeleteClientCertificateInput, DeleteClientCertificateOutput, Any, Any + ], + Interceptor[DeleteDeploymentInput, DeleteDeploymentOutput, Any, Any], + Interceptor[ + DeleteDocumentationPartInput, DeleteDocumentationPartOutput, Any, Any + ], + Interceptor[ + DeleteDocumentationVersionInput, DeleteDocumentationVersionOutput, Any, Any + ], + Interceptor[DeleteDomainNameInput, DeleteDomainNameOutput, Any, Any], + Interceptor[ + DeleteDomainNameAccessAssociationInput, + DeleteDomainNameAccessAssociationOutput, + Any, + Any, + ], + Interceptor[DeleteGatewayResponseInput, DeleteGatewayResponseOutput, Any, Any], + Interceptor[DeleteIntegrationInput, DeleteIntegrationOutput, Any, Any], + Interceptor[ + DeleteIntegrationResponseInput, DeleteIntegrationResponseOutput, Any, Any + ], + Interceptor[DeleteMethodInput, DeleteMethodOutput, Any, Any], + Interceptor[DeleteMethodResponseInput, DeleteMethodResponseOutput, Any, Any], + Interceptor[DeleteModelInput, DeleteModelOutput, Any, Any], + Interceptor[ + DeleteRequestValidatorInput, DeleteRequestValidatorOutput, Any, Any + ], + Interceptor[DeleteResourceInput, DeleteResourceOutput, Any, Any], + Interceptor[DeleteRestApiInput, DeleteRestApiOutput, Any, Any], + Interceptor[DeleteStageInput, DeleteStageOutput, Any, Any], + Interceptor[DeleteUsagePlanInput, DeleteUsagePlanOutput, Any, Any], + Interceptor[DeleteUsagePlanKeyInput, DeleteUsagePlanKeyOutput, Any, Any], + Interceptor[DeleteVpcLinkInput, DeleteVpcLinkOutput, Any, Any], + Interceptor[ + FlushStageAuthorizersCacheInput, FlushStageAuthorizersCacheOutput, Any, Any + ], + Interceptor[FlushStageCacheInput, FlushStageCacheOutput, Any, Any], + Interceptor[ + GenerateClientCertificateInput, GenerateClientCertificateOutput, Any, Any + ], + Interceptor[GetAccountInput, GetAccountOutput, Any, Any], + Interceptor[GetApiKeyInput, GetApiKeyOutput, Any, Any], + Interceptor[GetApiKeysInput, GetApiKeysOutput, Any, Any], + Interceptor[GetAuthorizerInput, GetAuthorizerOutput, Any, Any], + Interceptor[GetAuthorizersInput, GetAuthorizersOutput, Any, Any], + Interceptor[GetBasePathMappingInput, GetBasePathMappingOutput, Any, Any], + Interceptor[GetBasePathMappingsInput, GetBasePathMappingsOutput, Any, Any], + Interceptor[GetClientCertificateInput, GetClientCertificateOutput, Any, Any], + Interceptor[GetClientCertificatesInput, GetClientCertificatesOutput, Any, Any], + Interceptor[GetDeploymentInput, GetDeploymentOutput, Any, Any], + Interceptor[GetDeploymentsInput, GetDeploymentsOutput, Any, Any], + Interceptor[GetDocumentationPartInput, GetDocumentationPartOutput, Any, Any], + Interceptor[GetDocumentationPartsInput, GetDocumentationPartsOutput, Any, Any], + Interceptor[ + GetDocumentationVersionInput, GetDocumentationVersionOutput, Any, Any + ], + Interceptor[ + GetDocumentationVersionsInput, GetDocumentationVersionsOutput, Any, Any + ], + Interceptor[GetDomainNameInput, GetDomainNameOutput, Any, Any], + Interceptor[ + GetDomainNameAccessAssociationsInput, + GetDomainNameAccessAssociationsOutput, + Any, + Any, + ], + Interceptor[GetDomainNamesInput, GetDomainNamesOutput, Any, Any], + Interceptor[GetExportInput, GetExportOutput, Any, Any], + Interceptor[GetGatewayResponseInput, GetGatewayResponseOutput, Any, Any], + Interceptor[GetGatewayResponsesInput, GetGatewayResponsesOutput, Any, Any], + Interceptor[GetIntegrationInput, GetIntegrationOutput, Any, Any], + Interceptor[ + GetIntegrationResponseInput, GetIntegrationResponseOutput, Any, Any + ], + Interceptor[GetMethodInput, GetMethodOutput, Any, Any], + Interceptor[GetMethodResponseInput, GetMethodResponseOutput, Any, Any], + Interceptor[GetModelInput, GetModelOutput, Any, Any], + Interceptor[GetModelsInput, GetModelsOutput, Any, Any], + Interceptor[GetModelTemplateInput, GetModelTemplateOutput, Any, Any], + Interceptor[GetRequestValidatorInput, GetRequestValidatorOutput, Any, Any], + Interceptor[GetRequestValidatorsInput, GetRequestValidatorsOutput, Any, Any], + Interceptor[GetResourceInput, GetResourceOutput, Any, Any], + Interceptor[GetResourcesInput, GetResourcesOutput, Any, Any], + Interceptor[GetRestApiInput, GetRestApiOutput, Any, Any], + Interceptor[GetRestApisInput, GetRestApisOutput, Any, Any], + Interceptor[GetSdkInput, GetSdkOutput, Any, Any], + Interceptor[GetSdkTypeInput, GetSdkTypeOutput, Any, Any], + Interceptor[GetSdkTypesInput, GetSdkTypesOutput, Any, Any], + Interceptor[GetStageInput, GetStageOutput, Any, Any], + Interceptor[GetStagesInput, GetStagesOutput, Any, Any], + Interceptor[GetTagsInput, GetTagsOutput, Any, Any], + Interceptor[GetUsageInput, GetUsageOutput, Any, Any], + Interceptor[GetUsagePlanInput, GetUsagePlanOutput, Any, Any], + Interceptor[GetUsagePlanKeyInput, GetUsagePlanKeyOutput, Any, Any], + Interceptor[GetUsagePlanKeysInput, GetUsagePlanKeysOutput, Any, Any], + Interceptor[GetUsagePlansInput, GetUsagePlansOutput, Any, Any], + Interceptor[GetVpcLinkInput, GetVpcLinkOutput, Any, Any], + Interceptor[GetVpcLinksInput, GetVpcLinksOutput, Any, Any], + Interceptor[ImportApiKeysInput, ImportApiKeysOutput, Any, Any], + Interceptor[ + ImportDocumentationPartsInput, ImportDocumentationPartsOutput, Any, Any + ], + Interceptor[ImportRestApiInput, ImportRestApiOutput, Any, Any], + Interceptor[PutGatewayResponseInput, PutGatewayResponseOutput, Any, Any], + Interceptor[PutIntegrationInput, PutIntegrationOutput, Any, Any], + Interceptor[ + PutIntegrationResponseInput, PutIntegrationResponseOutput, Any, Any + ], + Interceptor[PutMethodInput, PutMethodOutput, Any, Any], + Interceptor[PutMethodResponseInput, PutMethodResponseOutput, Any, Any], + Interceptor[PutRestApiInput, PutRestApiOutput, Any, Any], + Interceptor[ + RejectDomainNameAccessAssociationInput, + RejectDomainNameAccessAssociationOutput, + Any, + Any, + ], + Interceptor[TagResourceInput, TagResourceOutput, Any, Any], + Interceptor[TestInvokeAuthorizerInput, TestInvokeAuthorizerOutput, Any, Any], + Interceptor[TestInvokeMethodInput, TestInvokeMethodOutput, Any, Any], + Interceptor[UntagResourceInput, UntagResourceOutput, Any, Any], + Interceptor[UpdateAccountInput, UpdateAccountOutput, Any, Any], + Interceptor[UpdateApiKeyInput, UpdateApiKeyOutput, Any, Any], + Interceptor[UpdateAuthorizerInput, UpdateAuthorizerOutput, Any, Any], + Interceptor[UpdateBasePathMappingInput, UpdateBasePathMappingOutput, Any, Any], + Interceptor[ + UpdateClientCertificateInput, UpdateClientCertificateOutput, Any, Any + ], + Interceptor[UpdateDeploymentInput, UpdateDeploymentOutput, Any, Any], + Interceptor[ + UpdateDocumentationPartInput, UpdateDocumentationPartOutput, Any, Any + ], + Interceptor[ + UpdateDocumentationVersionInput, UpdateDocumentationVersionOutput, Any, Any + ], + Interceptor[UpdateDomainNameInput, UpdateDomainNameOutput, Any, Any], + Interceptor[UpdateGatewayResponseInput, UpdateGatewayResponseOutput, Any, Any], + Interceptor[UpdateIntegrationInput, UpdateIntegrationOutput, Any, Any], + Interceptor[ + UpdateIntegrationResponseInput, UpdateIntegrationResponseOutput, Any, Any + ], + Interceptor[UpdateMethodInput, UpdateMethodOutput, Any, Any], + Interceptor[UpdateMethodResponseInput, UpdateMethodResponseOutput, Any, Any], + Interceptor[UpdateModelInput, UpdateModelOutput, Any, Any], + Interceptor[ + UpdateRequestValidatorInput, UpdateRequestValidatorOutput, Any, Any + ], + Interceptor[UpdateResourceInput, UpdateResourceOutput, Any, Any], + Interceptor[UpdateRestApiInput, UpdateRestApiOutput, Any, Any], + Interceptor[UpdateStageInput, UpdateStageOutput, Any, Any], + Interceptor[UpdateUsageInput, UpdateUsageOutput, Any, Any], + Interceptor[UpdateUsagePlanInput, UpdateUsagePlanOutput, Any, Any], + Interceptor[UpdateVpcLinkInput, UpdateVpcLinkOutput, Any, Any], + ] +else: + _ServiceInterceptor = Any + _PROTOCOL_SETTINGS = ProtocolSettings( - namespace="com.amazonaws.apigateway", service_target="BackplaneControlService" + namespace="com.amazonaws.apigateway", + service_target="BackplaneControlService", + service_schema=BACKPLANE_CONTROL_SERVICE, ) class _AsyncAPIGatewayConfigOverrides(AwsConfigOverrides, total=False): - endpoint_resolver: EndpointResolver | None + endpoint_resolver: AsyncEndpointResolver | None protocol: ( - ClientProtocol[Any, Any] | ProtocolConstructor[ClientProtocol[Any, Any]] | None + AsyncClientProtocol[Any, Any] + | ProtocolConstructor[AsyncClientProtocol[Any, Any]] + | None ) - auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None + auth_schemes: dict[ShapeID, AsyncAuthScheme[Any, Any, Any, Any]] | None auth_scheme_resolver: AuthSchemeResolver | None @@ -461,17 +498,17 @@ class _AsyncAPIGatewayConfigOverrides(AwsConfigOverrides, total=False): class AsyncAPIGatewayConfig(AsyncAwsConfig): """API Gateway configuration (async-resolved).""" - endpoint_resolver: EndpointResolver | None = None + endpoint_resolver: AsyncEndpointResolver | None = None """ The endpoint resolver used to resolve the final endpoint per-operation based on the configuration. """ - protocol: ClientProtocol[Any, Any] | None = None + protocol: AsyncClientProtocol[Any, Any] | None = None """ Pass a protocol class reference from smithy_aws_core.aio.protocols to - select the protocol, e.g. protocol=AwsJson10ClientProtocol. For custom - protocols a protocol instance may also be passed. + select the protocol, e.g. protocol=AsyncAwsJson10ClientProtocol. For + custom protocols a protocol instance may also be passed. """ interceptors: list[_ServiceInterceptor] = field(default_factory=lambda: []) @@ -480,7 +517,7 @@ class AsyncAPIGatewayConfig(AsyncAwsConfig): execution of a request. """ - auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None = None + auth_schemes: dict[ShapeID, AsyncAuthScheme[Any, Any, Any, Any]] | None = None """A map of auth scheme ids to auth schemes.""" auth_scheme_resolver: AuthSchemeResolver | None = None @@ -490,7 +527,7 @@ class AsyncAPIGatewayConfig(AsyncAwsConfig): """ aws_credentials_identity_resolver: ( - IdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None + AsyncIdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None ) = None """Resolves AWS Credentials. Required for operations that use Sigv4 Auth.""" @@ -531,24 +568,24 @@ class AsyncAPIGatewayConfig(AsyncAwsConfig): default=None, resolver=EndpointUriResolver("api_gateway") ), "endpoint_resolver": FieldSpec( - default_factory=lambda: StandardRegionalEndpointsResolver( + default_factory=lambda: AsyncStandardRegionalEndpointsResolver( endpoint_prefix="apigateway" ) ), "protocol": FieldSpec( - default_factory=lambda: RestJsonClientProtocol(_PROTOCOL_SETTINGS), + default_factory=lambda: AsyncRestJsonClientProtocol(_PROTOCOL_SETTINGS), converter=lambda p: p(_PROTOCOL_SETTINGS) if isinstance(p, type) else p, ), "auth_schemes": FieldSpec( default_factory=lambda: { - ShapeID("aws.auth#sigv4"): SigV4AuthScheme(service="apigateway") + ShapeID("aws.auth#sigv4"): AsyncSigV4AuthScheme(service="apigateway") } ), "auth_scheme_resolver": FieldSpec(default_factory=HTTPAuthSchemeResolver), "transport": FieldSpec(default_factory=lambda: AIOHTTPClient()), } - def set_auth_scheme(self, scheme: AuthScheme[Any, Any, Any, Any]) -> None: + def set_auth_scheme(self, scheme: AsyncAuthScheme[Any, Any, Any, Any]) -> None: """ Set an auth scheme implementation using its scheme ID. :param scheme: The auth scheme to add or replace. @@ -562,7 +599,7 @@ async def resolve( # pyright: ignore[reportIncompatibleMethodOverride] cls, *, profile: str | None = None, - fs: FileSystem | None = None, + fs: AsyncFileSystem | None = None, config_file_path: str | None = None, credentials_file_path: str | None = None, **overrides: Unpack[_AsyncAPIGatewayConfigOverrides], diff --git a/clients/aws-sdk-api-gateway/src/aws_sdk_api_gateway/models.py b/clients/aws-sdk-api-gateway/src/aws_sdk_api_gateway/models.py index 66fd5336..1faa80b8 100644 --- a/clients/aws-sdk-api-gateway/src/aws_sdk_api_gateway/models.py +++ b/clients/aws-sdk-api-gateway/src/aws_sdk_api_gateway/models.py @@ -1,443 +1,393 @@ # Code generated by smithy-python-codegen DO NOT EDIT. -from dataclasses import dataclass, field -from datetime import datetime -from enum import StrEnum -import logging -from typing import Any, Literal, Self +from __future__ import annotations -from smithy_core.deserializers import ShapeDeserializer -from smithy_core.documents import TypeRegistry +from ._private import schemas as _schemas +from smithy_core._dynamic_models import ModelRegistry from smithy_core.exceptions import ModeledError -from smithy_core.response import EMPTY_RESPONSE_METADATA, ResponseMetadata -from smithy_core.schemas import APIOperation, Schema -from smithy_core.serializers import ShapeSerializer +from smithy_core.schemas import APIOperation from smithy_core.shapes import ShapeID -from smithy_core.types import UnknownEnumMixin from ._private.schemas import ( - ACCESS_LOG_SETTINGS as _SCHEMA_ACCESS_LOG_SETTINGS, - API_KEY as _SCHEMA_API_KEY, - API_STAGE as _SCHEMA_API_STAGE, - AUTHORIZER as _SCHEMA_AUTHORIZER, - BAD_REQUEST_EXCEPTION as _SCHEMA_BAD_REQUEST_EXCEPTION, - BASE_PATH_MAPPING as _SCHEMA_BASE_PATH_MAPPING, - CANARY_SETTINGS as _SCHEMA_CANARY_SETTINGS, - CLIENT_CERTIFICATE as _SCHEMA_CLIENT_CERTIFICATE, - CONFLICT_EXCEPTION as _SCHEMA_CONFLICT_EXCEPTION, CREATE_API_KEY as _SCHEMA_CREATE_API_KEY, - CREATE_API_KEY_INPUT as _SCHEMA_CREATE_API_KEY_INPUT, - CREATE_API_KEY_OUTPUT as _SCHEMA_CREATE_API_KEY_OUTPUT, CREATE_AUTHORIZER as _SCHEMA_CREATE_AUTHORIZER, - CREATE_AUTHORIZER_INPUT as _SCHEMA_CREATE_AUTHORIZER_INPUT, - CREATE_AUTHORIZER_OUTPUT as _SCHEMA_CREATE_AUTHORIZER_OUTPUT, CREATE_BASE_PATH_MAPPING as _SCHEMA_CREATE_BASE_PATH_MAPPING, - CREATE_BASE_PATH_MAPPING_INPUT as _SCHEMA_CREATE_BASE_PATH_MAPPING_INPUT, - CREATE_BASE_PATH_MAPPING_OUTPUT as _SCHEMA_CREATE_BASE_PATH_MAPPING_OUTPUT, CREATE_DEPLOYMENT as _SCHEMA_CREATE_DEPLOYMENT, - CREATE_DEPLOYMENT_INPUT as _SCHEMA_CREATE_DEPLOYMENT_INPUT, - CREATE_DEPLOYMENT_OUTPUT as _SCHEMA_CREATE_DEPLOYMENT_OUTPUT, CREATE_DOCUMENTATION_PART as _SCHEMA_CREATE_DOCUMENTATION_PART, - CREATE_DOCUMENTATION_PART_INPUT as _SCHEMA_CREATE_DOCUMENTATION_PART_INPUT, - CREATE_DOCUMENTATION_PART_OUTPUT as _SCHEMA_CREATE_DOCUMENTATION_PART_OUTPUT, CREATE_DOCUMENTATION_VERSION as _SCHEMA_CREATE_DOCUMENTATION_VERSION, - CREATE_DOCUMENTATION_VERSION_INPUT as _SCHEMA_CREATE_DOCUMENTATION_VERSION_INPUT, - CREATE_DOCUMENTATION_VERSION_OUTPUT as _SCHEMA_CREATE_DOCUMENTATION_VERSION_OUTPUT, CREATE_DOMAIN_NAME as _SCHEMA_CREATE_DOMAIN_NAME, CREATE_DOMAIN_NAME_ACCESS_ASSOCIATION as _SCHEMA_CREATE_DOMAIN_NAME_ACCESS_ASSOCIATION, - CREATE_DOMAIN_NAME_ACCESS_ASSOCIATION_INPUT as _SCHEMA_CREATE_DOMAIN_NAME_ACCESS_ASSOCIATION_INPUT, - CREATE_DOMAIN_NAME_ACCESS_ASSOCIATION_OUTPUT as _SCHEMA_CREATE_DOMAIN_NAME_ACCESS_ASSOCIATION_OUTPUT, - CREATE_DOMAIN_NAME_INPUT as _SCHEMA_CREATE_DOMAIN_NAME_INPUT, - CREATE_DOMAIN_NAME_OUTPUT as _SCHEMA_CREATE_DOMAIN_NAME_OUTPUT, CREATE_MODEL as _SCHEMA_CREATE_MODEL, - CREATE_MODEL_INPUT as _SCHEMA_CREATE_MODEL_INPUT, - CREATE_MODEL_OUTPUT as _SCHEMA_CREATE_MODEL_OUTPUT, CREATE_REQUEST_VALIDATOR as _SCHEMA_CREATE_REQUEST_VALIDATOR, - CREATE_REQUEST_VALIDATOR_INPUT as _SCHEMA_CREATE_REQUEST_VALIDATOR_INPUT, - CREATE_REQUEST_VALIDATOR_OUTPUT as _SCHEMA_CREATE_REQUEST_VALIDATOR_OUTPUT, CREATE_RESOURCE as _SCHEMA_CREATE_RESOURCE, - CREATE_RESOURCE_INPUT as _SCHEMA_CREATE_RESOURCE_INPUT, - CREATE_RESOURCE_OUTPUT as _SCHEMA_CREATE_RESOURCE_OUTPUT, CREATE_REST_API as _SCHEMA_CREATE_REST_API, - CREATE_REST_API_INPUT as _SCHEMA_CREATE_REST_API_INPUT, - CREATE_REST_API_OUTPUT as _SCHEMA_CREATE_REST_API_OUTPUT, CREATE_STAGE as _SCHEMA_CREATE_STAGE, - CREATE_STAGE_INPUT as _SCHEMA_CREATE_STAGE_INPUT, - CREATE_STAGE_OUTPUT as _SCHEMA_CREATE_STAGE_OUTPUT, CREATE_USAGE_PLAN as _SCHEMA_CREATE_USAGE_PLAN, - CREATE_USAGE_PLAN_INPUT as _SCHEMA_CREATE_USAGE_PLAN_INPUT, CREATE_USAGE_PLAN_KEY as _SCHEMA_CREATE_USAGE_PLAN_KEY, - CREATE_USAGE_PLAN_KEY_INPUT as _SCHEMA_CREATE_USAGE_PLAN_KEY_INPUT, - CREATE_USAGE_PLAN_KEY_OUTPUT as _SCHEMA_CREATE_USAGE_PLAN_KEY_OUTPUT, - CREATE_USAGE_PLAN_OUTPUT as _SCHEMA_CREATE_USAGE_PLAN_OUTPUT, CREATE_VPC_LINK as _SCHEMA_CREATE_VPC_LINK, - CREATE_VPC_LINK_INPUT as _SCHEMA_CREATE_VPC_LINK_INPUT, - CREATE_VPC_LINK_OUTPUT as _SCHEMA_CREATE_VPC_LINK_OUTPUT, DELETE_API_KEY as _SCHEMA_DELETE_API_KEY, - DELETE_API_KEY_INPUT as _SCHEMA_DELETE_API_KEY_INPUT, - DELETE_API_KEY_OUTPUT as _SCHEMA_DELETE_API_KEY_OUTPUT, DELETE_AUTHORIZER as _SCHEMA_DELETE_AUTHORIZER, - DELETE_AUTHORIZER_INPUT as _SCHEMA_DELETE_AUTHORIZER_INPUT, - DELETE_AUTHORIZER_OUTPUT as _SCHEMA_DELETE_AUTHORIZER_OUTPUT, DELETE_BASE_PATH_MAPPING as _SCHEMA_DELETE_BASE_PATH_MAPPING, - DELETE_BASE_PATH_MAPPING_INPUT as _SCHEMA_DELETE_BASE_PATH_MAPPING_INPUT, - DELETE_BASE_PATH_MAPPING_OUTPUT as _SCHEMA_DELETE_BASE_PATH_MAPPING_OUTPUT, DELETE_CLIENT_CERTIFICATE as _SCHEMA_DELETE_CLIENT_CERTIFICATE, - DELETE_CLIENT_CERTIFICATE_INPUT as _SCHEMA_DELETE_CLIENT_CERTIFICATE_INPUT, - DELETE_CLIENT_CERTIFICATE_OUTPUT as _SCHEMA_DELETE_CLIENT_CERTIFICATE_OUTPUT, DELETE_DEPLOYMENT as _SCHEMA_DELETE_DEPLOYMENT, - DELETE_DEPLOYMENT_INPUT as _SCHEMA_DELETE_DEPLOYMENT_INPUT, - DELETE_DEPLOYMENT_OUTPUT as _SCHEMA_DELETE_DEPLOYMENT_OUTPUT, DELETE_DOCUMENTATION_PART as _SCHEMA_DELETE_DOCUMENTATION_PART, - DELETE_DOCUMENTATION_PART_INPUT as _SCHEMA_DELETE_DOCUMENTATION_PART_INPUT, - DELETE_DOCUMENTATION_PART_OUTPUT as _SCHEMA_DELETE_DOCUMENTATION_PART_OUTPUT, DELETE_DOCUMENTATION_VERSION as _SCHEMA_DELETE_DOCUMENTATION_VERSION, - DELETE_DOCUMENTATION_VERSION_INPUT as _SCHEMA_DELETE_DOCUMENTATION_VERSION_INPUT, - DELETE_DOCUMENTATION_VERSION_OUTPUT as _SCHEMA_DELETE_DOCUMENTATION_VERSION_OUTPUT, DELETE_DOMAIN_NAME as _SCHEMA_DELETE_DOMAIN_NAME, DELETE_DOMAIN_NAME_ACCESS_ASSOCIATION as _SCHEMA_DELETE_DOMAIN_NAME_ACCESS_ASSOCIATION, - DELETE_DOMAIN_NAME_ACCESS_ASSOCIATION_INPUT as _SCHEMA_DELETE_DOMAIN_NAME_ACCESS_ASSOCIATION_INPUT, - DELETE_DOMAIN_NAME_ACCESS_ASSOCIATION_OUTPUT as _SCHEMA_DELETE_DOMAIN_NAME_ACCESS_ASSOCIATION_OUTPUT, - DELETE_DOMAIN_NAME_INPUT as _SCHEMA_DELETE_DOMAIN_NAME_INPUT, - DELETE_DOMAIN_NAME_OUTPUT as _SCHEMA_DELETE_DOMAIN_NAME_OUTPUT, DELETE_GATEWAY_RESPONSE as _SCHEMA_DELETE_GATEWAY_RESPONSE, - DELETE_GATEWAY_RESPONSE_INPUT as _SCHEMA_DELETE_GATEWAY_RESPONSE_INPUT, - DELETE_GATEWAY_RESPONSE_OUTPUT as _SCHEMA_DELETE_GATEWAY_RESPONSE_OUTPUT, DELETE_INTEGRATION as _SCHEMA_DELETE_INTEGRATION, - DELETE_INTEGRATION_INPUT as _SCHEMA_DELETE_INTEGRATION_INPUT, - DELETE_INTEGRATION_OUTPUT as _SCHEMA_DELETE_INTEGRATION_OUTPUT, DELETE_INTEGRATION_RESPONSE as _SCHEMA_DELETE_INTEGRATION_RESPONSE, - DELETE_INTEGRATION_RESPONSE_INPUT as _SCHEMA_DELETE_INTEGRATION_RESPONSE_INPUT, - DELETE_INTEGRATION_RESPONSE_OUTPUT as _SCHEMA_DELETE_INTEGRATION_RESPONSE_OUTPUT, DELETE_METHOD as _SCHEMA_DELETE_METHOD, - DELETE_METHOD_INPUT as _SCHEMA_DELETE_METHOD_INPUT, - DELETE_METHOD_OUTPUT as _SCHEMA_DELETE_METHOD_OUTPUT, DELETE_METHOD_RESPONSE as _SCHEMA_DELETE_METHOD_RESPONSE, - DELETE_METHOD_RESPONSE_INPUT as _SCHEMA_DELETE_METHOD_RESPONSE_INPUT, - DELETE_METHOD_RESPONSE_OUTPUT as _SCHEMA_DELETE_METHOD_RESPONSE_OUTPUT, DELETE_MODEL as _SCHEMA_DELETE_MODEL, - DELETE_MODEL_INPUT as _SCHEMA_DELETE_MODEL_INPUT, - DELETE_MODEL_OUTPUT as _SCHEMA_DELETE_MODEL_OUTPUT, DELETE_REQUEST_VALIDATOR as _SCHEMA_DELETE_REQUEST_VALIDATOR, - DELETE_REQUEST_VALIDATOR_INPUT as _SCHEMA_DELETE_REQUEST_VALIDATOR_INPUT, - DELETE_REQUEST_VALIDATOR_OUTPUT as _SCHEMA_DELETE_REQUEST_VALIDATOR_OUTPUT, DELETE_RESOURCE as _SCHEMA_DELETE_RESOURCE, - DELETE_RESOURCE_INPUT as _SCHEMA_DELETE_RESOURCE_INPUT, - DELETE_RESOURCE_OUTPUT as _SCHEMA_DELETE_RESOURCE_OUTPUT, DELETE_REST_API as _SCHEMA_DELETE_REST_API, - DELETE_REST_API_INPUT as _SCHEMA_DELETE_REST_API_INPUT, - DELETE_REST_API_OUTPUT as _SCHEMA_DELETE_REST_API_OUTPUT, DELETE_STAGE as _SCHEMA_DELETE_STAGE, - DELETE_STAGE_INPUT as _SCHEMA_DELETE_STAGE_INPUT, - DELETE_STAGE_OUTPUT as _SCHEMA_DELETE_STAGE_OUTPUT, DELETE_USAGE_PLAN as _SCHEMA_DELETE_USAGE_PLAN, - DELETE_USAGE_PLAN_INPUT as _SCHEMA_DELETE_USAGE_PLAN_INPUT, DELETE_USAGE_PLAN_KEY as _SCHEMA_DELETE_USAGE_PLAN_KEY, - DELETE_USAGE_PLAN_KEY_INPUT as _SCHEMA_DELETE_USAGE_PLAN_KEY_INPUT, - DELETE_USAGE_PLAN_KEY_OUTPUT as _SCHEMA_DELETE_USAGE_PLAN_KEY_OUTPUT, - DELETE_USAGE_PLAN_OUTPUT as _SCHEMA_DELETE_USAGE_PLAN_OUTPUT, DELETE_VPC_LINK as _SCHEMA_DELETE_VPC_LINK, - DELETE_VPC_LINK_INPUT as _SCHEMA_DELETE_VPC_LINK_INPUT, - DELETE_VPC_LINK_OUTPUT as _SCHEMA_DELETE_VPC_LINK_OUTPUT, - DEPLOYMENT as _SCHEMA_DEPLOYMENT, - DEPLOYMENT_CANARY_SETTINGS as _SCHEMA_DEPLOYMENT_CANARY_SETTINGS, - DOCUMENTATION_PART as _SCHEMA_DOCUMENTATION_PART, - DOCUMENTATION_PART_LOCATION as _SCHEMA_DOCUMENTATION_PART_LOCATION, - DOCUMENTATION_VERSION as _SCHEMA_DOCUMENTATION_VERSION, - DOMAIN_NAME as _SCHEMA_DOMAIN_NAME, - DOMAIN_NAME_ACCESS_ASSOCIATION as _SCHEMA_DOMAIN_NAME_ACCESS_ASSOCIATION, - ENDPOINT_CONFIGURATION as _SCHEMA_ENDPOINT_CONFIGURATION, FLUSH_STAGE_AUTHORIZERS_CACHE as _SCHEMA_FLUSH_STAGE_AUTHORIZERS_CACHE, - FLUSH_STAGE_AUTHORIZERS_CACHE_INPUT as _SCHEMA_FLUSH_STAGE_AUTHORIZERS_CACHE_INPUT, - FLUSH_STAGE_AUTHORIZERS_CACHE_OUTPUT as _SCHEMA_FLUSH_STAGE_AUTHORIZERS_CACHE_OUTPUT, FLUSH_STAGE_CACHE as _SCHEMA_FLUSH_STAGE_CACHE, - FLUSH_STAGE_CACHE_INPUT as _SCHEMA_FLUSH_STAGE_CACHE_INPUT, - FLUSH_STAGE_CACHE_OUTPUT as _SCHEMA_FLUSH_STAGE_CACHE_OUTPUT, - GATEWAY_RESPONSE as _SCHEMA_GATEWAY_RESPONSE, GENERATE_CLIENT_CERTIFICATE as _SCHEMA_GENERATE_CLIENT_CERTIFICATE, - GENERATE_CLIENT_CERTIFICATE_INPUT as _SCHEMA_GENERATE_CLIENT_CERTIFICATE_INPUT, - GENERATE_CLIENT_CERTIFICATE_OUTPUT as _SCHEMA_GENERATE_CLIENT_CERTIFICATE_OUTPUT, GET_ACCOUNT as _SCHEMA_GET_ACCOUNT, - GET_ACCOUNT_INPUT as _SCHEMA_GET_ACCOUNT_INPUT, - GET_ACCOUNT_OUTPUT as _SCHEMA_GET_ACCOUNT_OUTPUT, GET_API_KEY as _SCHEMA_GET_API_KEY, GET_API_KEYS as _SCHEMA_GET_API_KEYS, - GET_API_KEYS_INPUT as _SCHEMA_GET_API_KEYS_INPUT, - GET_API_KEYS_OUTPUT as _SCHEMA_GET_API_KEYS_OUTPUT, - GET_API_KEY_INPUT as _SCHEMA_GET_API_KEY_INPUT, - GET_API_KEY_OUTPUT as _SCHEMA_GET_API_KEY_OUTPUT, GET_AUTHORIZER as _SCHEMA_GET_AUTHORIZER, GET_AUTHORIZERS as _SCHEMA_GET_AUTHORIZERS, - GET_AUTHORIZERS_INPUT as _SCHEMA_GET_AUTHORIZERS_INPUT, - GET_AUTHORIZERS_OUTPUT as _SCHEMA_GET_AUTHORIZERS_OUTPUT, - GET_AUTHORIZER_INPUT as _SCHEMA_GET_AUTHORIZER_INPUT, - GET_AUTHORIZER_OUTPUT as _SCHEMA_GET_AUTHORIZER_OUTPUT, GET_BASE_PATH_MAPPING as _SCHEMA_GET_BASE_PATH_MAPPING, GET_BASE_PATH_MAPPINGS as _SCHEMA_GET_BASE_PATH_MAPPINGS, - GET_BASE_PATH_MAPPINGS_INPUT as _SCHEMA_GET_BASE_PATH_MAPPINGS_INPUT, - GET_BASE_PATH_MAPPINGS_OUTPUT as _SCHEMA_GET_BASE_PATH_MAPPINGS_OUTPUT, - GET_BASE_PATH_MAPPING_INPUT as _SCHEMA_GET_BASE_PATH_MAPPING_INPUT, - GET_BASE_PATH_MAPPING_OUTPUT as _SCHEMA_GET_BASE_PATH_MAPPING_OUTPUT, GET_CLIENT_CERTIFICATE as _SCHEMA_GET_CLIENT_CERTIFICATE, GET_CLIENT_CERTIFICATES as _SCHEMA_GET_CLIENT_CERTIFICATES, - GET_CLIENT_CERTIFICATES_INPUT as _SCHEMA_GET_CLIENT_CERTIFICATES_INPUT, - GET_CLIENT_CERTIFICATES_OUTPUT as _SCHEMA_GET_CLIENT_CERTIFICATES_OUTPUT, - GET_CLIENT_CERTIFICATE_INPUT as _SCHEMA_GET_CLIENT_CERTIFICATE_INPUT, - GET_CLIENT_CERTIFICATE_OUTPUT as _SCHEMA_GET_CLIENT_CERTIFICATE_OUTPUT, GET_DEPLOYMENT as _SCHEMA_GET_DEPLOYMENT, GET_DEPLOYMENTS as _SCHEMA_GET_DEPLOYMENTS, - GET_DEPLOYMENTS_INPUT as _SCHEMA_GET_DEPLOYMENTS_INPUT, - GET_DEPLOYMENTS_OUTPUT as _SCHEMA_GET_DEPLOYMENTS_OUTPUT, - GET_DEPLOYMENT_INPUT as _SCHEMA_GET_DEPLOYMENT_INPUT, - GET_DEPLOYMENT_OUTPUT as _SCHEMA_GET_DEPLOYMENT_OUTPUT, GET_DOCUMENTATION_PART as _SCHEMA_GET_DOCUMENTATION_PART, GET_DOCUMENTATION_PARTS as _SCHEMA_GET_DOCUMENTATION_PARTS, - GET_DOCUMENTATION_PARTS_INPUT as _SCHEMA_GET_DOCUMENTATION_PARTS_INPUT, - GET_DOCUMENTATION_PARTS_OUTPUT as _SCHEMA_GET_DOCUMENTATION_PARTS_OUTPUT, - GET_DOCUMENTATION_PART_INPUT as _SCHEMA_GET_DOCUMENTATION_PART_INPUT, - GET_DOCUMENTATION_PART_OUTPUT as _SCHEMA_GET_DOCUMENTATION_PART_OUTPUT, GET_DOCUMENTATION_VERSION as _SCHEMA_GET_DOCUMENTATION_VERSION, GET_DOCUMENTATION_VERSIONS as _SCHEMA_GET_DOCUMENTATION_VERSIONS, - GET_DOCUMENTATION_VERSIONS_INPUT as _SCHEMA_GET_DOCUMENTATION_VERSIONS_INPUT, - GET_DOCUMENTATION_VERSIONS_OUTPUT as _SCHEMA_GET_DOCUMENTATION_VERSIONS_OUTPUT, - GET_DOCUMENTATION_VERSION_INPUT as _SCHEMA_GET_DOCUMENTATION_VERSION_INPUT, - GET_DOCUMENTATION_VERSION_OUTPUT as _SCHEMA_GET_DOCUMENTATION_VERSION_OUTPUT, GET_DOMAIN_NAME as _SCHEMA_GET_DOMAIN_NAME, GET_DOMAIN_NAMES as _SCHEMA_GET_DOMAIN_NAMES, - GET_DOMAIN_NAMES_INPUT as _SCHEMA_GET_DOMAIN_NAMES_INPUT, - GET_DOMAIN_NAMES_OUTPUT as _SCHEMA_GET_DOMAIN_NAMES_OUTPUT, GET_DOMAIN_NAME_ACCESS_ASSOCIATIONS as _SCHEMA_GET_DOMAIN_NAME_ACCESS_ASSOCIATIONS, - GET_DOMAIN_NAME_ACCESS_ASSOCIATIONS_INPUT as _SCHEMA_GET_DOMAIN_NAME_ACCESS_ASSOCIATIONS_INPUT, - GET_DOMAIN_NAME_ACCESS_ASSOCIATIONS_OUTPUT as _SCHEMA_GET_DOMAIN_NAME_ACCESS_ASSOCIATIONS_OUTPUT, - GET_DOMAIN_NAME_INPUT as _SCHEMA_GET_DOMAIN_NAME_INPUT, - GET_DOMAIN_NAME_OUTPUT as _SCHEMA_GET_DOMAIN_NAME_OUTPUT, GET_EXPORT as _SCHEMA_GET_EXPORT, - GET_EXPORT_INPUT as _SCHEMA_GET_EXPORT_INPUT, - GET_EXPORT_OUTPUT as _SCHEMA_GET_EXPORT_OUTPUT, GET_GATEWAY_RESPONSE as _SCHEMA_GET_GATEWAY_RESPONSE, GET_GATEWAY_RESPONSES as _SCHEMA_GET_GATEWAY_RESPONSES, - GET_GATEWAY_RESPONSES_INPUT as _SCHEMA_GET_GATEWAY_RESPONSES_INPUT, - GET_GATEWAY_RESPONSES_OUTPUT as _SCHEMA_GET_GATEWAY_RESPONSES_OUTPUT, - GET_GATEWAY_RESPONSE_INPUT as _SCHEMA_GET_GATEWAY_RESPONSE_INPUT, - GET_GATEWAY_RESPONSE_OUTPUT as _SCHEMA_GET_GATEWAY_RESPONSE_OUTPUT, GET_INTEGRATION as _SCHEMA_GET_INTEGRATION, - GET_INTEGRATION_INPUT as _SCHEMA_GET_INTEGRATION_INPUT, - GET_INTEGRATION_OUTPUT as _SCHEMA_GET_INTEGRATION_OUTPUT, GET_INTEGRATION_RESPONSE as _SCHEMA_GET_INTEGRATION_RESPONSE, - GET_INTEGRATION_RESPONSE_INPUT as _SCHEMA_GET_INTEGRATION_RESPONSE_INPUT, - GET_INTEGRATION_RESPONSE_OUTPUT as _SCHEMA_GET_INTEGRATION_RESPONSE_OUTPUT, GET_METHOD as _SCHEMA_GET_METHOD, - GET_METHOD_INPUT as _SCHEMA_GET_METHOD_INPUT, - GET_METHOD_OUTPUT as _SCHEMA_GET_METHOD_OUTPUT, GET_METHOD_RESPONSE as _SCHEMA_GET_METHOD_RESPONSE, - GET_METHOD_RESPONSE_INPUT as _SCHEMA_GET_METHOD_RESPONSE_INPUT, - GET_METHOD_RESPONSE_OUTPUT as _SCHEMA_GET_METHOD_RESPONSE_OUTPUT, GET_MODEL as _SCHEMA_GET_MODEL, GET_MODELS as _SCHEMA_GET_MODELS, - GET_MODELS_INPUT as _SCHEMA_GET_MODELS_INPUT, - GET_MODELS_OUTPUT as _SCHEMA_GET_MODELS_OUTPUT, - GET_MODEL_INPUT as _SCHEMA_GET_MODEL_INPUT, - GET_MODEL_OUTPUT as _SCHEMA_GET_MODEL_OUTPUT, GET_MODEL_TEMPLATE as _SCHEMA_GET_MODEL_TEMPLATE, - GET_MODEL_TEMPLATE_INPUT as _SCHEMA_GET_MODEL_TEMPLATE_INPUT, - GET_MODEL_TEMPLATE_OUTPUT as _SCHEMA_GET_MODEL_TEMPLATE_OUTPUT, GET_REQUEST_VALIDATOR as _SCHEMA_GET_REQUEST_VALIDATOR, GET_REQUEST_VALIDATORS as _SCHEMA_GET_REQUEST_VALIDATORS, - GET_REQUEST_VALIDATORS_INPUT as _SCHEMA_GET_REQUEST_VALIDATORS_INPUT, - GET_REQUEST_VALIDATORS_OUTPUT as _SCHEMA_GET_REQUEST_VALIDATORS_OUTPUT, - GET_REQUEST_VALIDATOR_INPUT as _SCHEMA_GET_REQUEST_VALIDATOR_INPUT, - GET_REQUEST_VALIDATOR_OUTPUT as _SCHEMA_GET_REQUEST_VALIDATOR_OUTPUT, GET_RESOURCE as _SCHEMA_GET_RESOURCE, GET_RESOURCES as _SCHEMA_GET_RESOURCES, - GET_RESOURCES_INPUT as _SCHEMA_GET_RESOURCES_INPUT, - GET_RESOURCES_OUTPUT as _SCHEMA_GET_RESOURCES_OUTPUT, - GET_RESOURCE_INPUT as _SCHEMA_GET_RESOURCE_INPUT, - GET_RESOURCE_OUTPUT as _SCHEMA_GET_RESOURCE_OUTPUT, GET_REST_API as _SCHEMA_GET_REST_API, GET_REST_APIS as _SCHEMA_GET_REST_APIS, - GET_REST_APIS_INPUT as _SCHEMA_GET_REST_APIS_INPUT, - GET_REST_APIS_OUTPUT as _SCHEMA_GET_REST_APIS_OUTPUT, - GET_REST_API_INPUT as _SCHEMA_GET_REST_API_INPUT, - GET_REST_API_OUTPUT as _SCHEMA_GET_REST_API_OUTPUT, GET_SDK as _SCHEMA_GET_SDK, - GET_SDK_INPUT as _SCHEMA_GET_SDK_INPUT, - GET_SDK_OUTPUT as _SCHEMA_GET_SDK_OUTPUT, GET_SDK_TYPE as _SCHEMA_GET_SDK_TYPE, GET_SDK_TYPES as _SCHEMA_GET_SDK_TYPES, - GET_SDK_TYPES_INPUT as _SCHEMA_GET_SDK_TYPES_INPUT, - GET_SDK_TYPES_OUTPUT as _SCHEMA_GET_SDK_TYPES_OUTPUT, - GET_SDK_TYPE_INPUT as _SCHEMA_GET_SDK_TYPE_INPUT, - GET_SDK_TYPE_OUTPUT as _SCHEMA_GET_SDK_TYPE_OUTPUT, GET_STAGE as _SCHEMA_GET_STAGE, GET_STAGES as _SCHEMA_GET_STAGES, - GET_STAGES_INPUT as _SCHEMA_GET_STAGES_INPUT, - GET_STAGES_OUTPUT as _SCHEMA_GET_STAGES_OUTPUT, - GET_STAGE_INPUT as _SCHEMA_GET_STAGE_INPUT, - GET_STAGE_OUTPUT as _SCHEMA_GET_STAGE_OUTPUT, GET_TAGS as _SCHEMA_GET_TAGS, - GET_TAGS_INPUT as _SCHEMA_GET_TAGS_INPUT, - GET_TAGS_OUTPUT as _SCHEMA_GET_TAGS_OUTPUT, GET_USAGE as _SCHEMA_GET_USAGE, - GET_USAGE_INPUT as _SCHEMA_GET_USAGE_INPUT, - GET_USAGE_OUTPUT as _SCHEMA_GET_USAGE_OUTPUT, GET_USAGE_PLAN as _SCHEMA_GET_USAGE_PLAN, GET_USAGE_PLANS as _SCHEMA_GET_USAGE_PLANS, - GET_USAGE_PLANS_INPUT as _SCHEMA_GET_USAGE_PLANS_INPUT, - GET_USAGE_PLANS_OUTPUT as _SCHEMA_GET_USAGE_PLANS_OUTPUT, - GET_USAGE_PLAN_INPUT as _SCHEMA_GET_USAGE_PLAN_INPUT, GET_USAGE_PLAN_KEY as _SCHEMA_GET_USAGE_PLAN_KEY, GET_USAGE_PLAN_KEYS as _SCHEMA_GET_USAGE_PLAN_KEYS, - GET_USAGE_PLAN_KEYS_INPUT as _SCHEMA_GET_USAGE_PLAN_KEYS_INPUT, - GET_USAGE_PLAN_KEYS_OUTPUT as _SCHEMA_GET_USAGE_PLAN_KEYS_OUTPUT, - GET_USAGE_PLAN_KEY_INPUT as _SCHEMA_GET_USAGE_PLAN_KEY_INPUT, - GET_USAGE_PLAN_KEY_OUTPUT as _SCHEMA_GET_USAGE_PLAN_KEY_OUTPUT, - GET_USAGE_PLAN_OUTPUT as _SCHEMA_GET_USAGE_PLAN_OUTPUT, GET_VPC_LINK as _SCHEMA_GET_VPC_LINK, GET_VPC_LINKS as _SCHEMA_GET_VPC_LINKS, - GET_VPC_LINKS_INPUT as _SCHEMA_GET_VPC_LINKS_INPUT, - GET_VPC_LINKS_OUTPUT as _SCHEMA_GET_VPC_LINKS_OUTPUT, - GET_VPC_LINK_INPUT as _SCHEMA_GET_VPC_LINK_INPUT, - GET_VPC_LINK_OUTPUT as _SCHEMA_GET_VPC_LINK_OUTPUT, IMPORT_API_KEYS as _SCHEMA_IMPORT_API_KEYS, - IMPORT_API_KEYS_INPUT as _SCHEMA_IMPORT_API_KEYS_INPUT, - IMPORT_API_KEYS_OUTPUT as _SCHEMA_IMPORT_API_KEYS_OUTPUT, IMPORT_DOCUMENTATION_PARTS as _SCHEMA_IMPORT_DOCUMENTATION_PARTS, - IMPORT_DOCUMENTATION_PARTS_INPUT as _SCHEMA_IMPORT_DOCUMENTATION_PARTS_INPUT, - IMPORT_DOCUMENTATION_PARTS_OUTPUT as _SCHEMA_IMPORT_DOCUMENTATION_PARTS_OUTPUT, IMPORT_REST_API as _SCHEMA_IMPORT_REST_API, - IMPORT_REST_API_INPUT as _SCHEMA_IMPORT_REST_API_INPUT, - IMPORT_REST_API_OUTPUT as _SCHEMA_IMPORT_REST_API_OUTPUT, - INTEGRATION as _SCHEMA_INTEGRATION, - INTEGRATION_RESPONSE as _SCHEMA_INTEGRATION_RESPONSE, - LIMIT_EXCEEDED_EXCEPTION as _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - METHOD as _SCHEMA_METHOD, - METHOD_RESPONSE as _SCHEMA_METHOD_RESPONSE, - METHOD_SETTING as _SCHEMA_METHOD_SETTING, - METHOD_SNAPSHOT as _SCHEMA_METHOD_SNAPSHOT, - MODEL as _SCHEMA_MODEL, - MUTUAL_TLS_AUTHENTICATION as _SCHEMA_MUTUAL_TLS_AUTHENTICATION, - MUTUAL_TLS_AUTHENTICATION_INPUT as _SCHEMA_MUTUAL_TLS_AUTHENTICATION_INPUT, - NOT_FOUND_EXCEPTION as _SCHEMA_NOT_FOUND_EXCEPTION, - PATCH_OPERATION as _SCHEMA_PATCH_OPERATION, PUT_GATEWAY_RESPONSE as _SCHEMA_PUT_GATEWAY_RESPONSE, - PUT_GATEWAY_RESPONSE_INPUT as _SCHEMA_PUT_GATEWAY_RESPONSE_INPUT, - PUT_GATEWAY_RESPONSE_OUTPUT as _SCHEMA_PUT_GATEWAY_RESPONSE_OUTPUT, PUT_INTEGRATION as _SCHEMA_PUT_INTEGRATION, - PUT_INTEGRATION_INPUT as _SCHEMA_PUT_INTEGRATION_INPUT, - PUT_INTEGRATION_OUTPUT as _SCHEMA_PUT_INTEGRATION_OUTPUT, PUT_INTEGRATION_RESPONSE as _SCHEMA_PUT_INTEGRATION_RESPONSE, - PUT_INTEGRATION_RESPONSE_INPUT as _SCHEMA_PUT_INTEGRATION_RESPONSE_INPUT, - PUT_INTEGRATION_RESPONSE_OUTPUT as _SCHEMA_PUT_INTEGRATION_RESPONSE_OUTPUT, PUT_METHOD as _SCHEMA_PUT_METHOD, - PUT_METHOD_INPUT as _SCHEMA_PUT_METHOD_INPUT, - PUT_METHOD_OUTPUT as _SCHEMA_PUT_METHOD_OUTPUT, PUT_METHOD_RESPONSE as _SCHEMA_PUT_METHOD_RESPONSE, - PUT_METHOD_RESPONSE_INPUT as _SCHEMA_PUT_METHOD_RESPONSE_INPUT, - PUT_METHOD_RESPONSE_OUTPUT as _SCHEMA_PUT_METHOD_RESPONSE_OUTPUT, PUT_REST_API as _SCHEMA_PUT_REST_API, - PUT_REST_API_INPUT as _SCHEMA_PUT_REST_API_INPUT, - PUT_REST_API_OUTPUT as _SCHEMA_PUT_REST_API_OUTPUT, - QUOTA_SETTINGS as _SCHEMA_QUOTA_SETTINGS, REJECT_DOMAIN_NAME_ACCESS_ASSOCIATION as _SCHEMA_REJECT_DOMAIN_NAME_ACCESS_ASSOCIATION, - REJECT_DOMAIN_NAME_ACCESS_ASSOCIATION_INPUT as _SCHEMA_REJECT_DOMAIN_NAME_ACCESS_ASSOCIATION_INPUT, - REJECT_DOMAIN_NAME_ACCESS_ASSOCIATION_OUTPUT as _SCHEMA_REJECT_DOMAIN_NAME_ACCESS_ASSOCIATION_OUTPUT, - REQUEST_VALIDATOR as _SCHEMA_REQUEST_VALIDATOR, - RESOURCE as _SCHEMA_RESOURCE, - REST_API as _SCHEMA_REST_API, - SDK_CONFIGURATION_PROPERTY as _SCHEMA_SDK_CONFIGURATION_PROPERTY, - SDK_TYPE as _SCHEMA_SDK_TYPE, - SERVICE_UNAVAILABLE_EXCEPTION as _SCHEMA_SERVICE_UNAVAILABLE_EXCEPTION, - STAGE as _SCHEMA_STAGE, - STAGE_KEY as _SCHEMA_STAGE_KEY, TAG_RESOURCE as _SCHEMA_TAG_RESOURCE, - TAG_RESOURCE_INPUT as _SCHEMA_TAG_RESOURCE_INPUT, - TAG_RESOURCE_OUTPUT as _SCHEMA_TAG_RESOURCE_OUTPUT, TEST_INVOKE_AUTHORIZER as _SCHEMA_TEST_INVOKE_AUTHORIZER, - TEST_INVOKE_AUTHORIZER_INPUT as _SCHEMA_TEST_INVOKE_AUTHORIZER_INPUT, - TEST_INVOKE_AUTHORIZER_OUTPUT as _SCHEMA_TEST_INVOKE_AUTHORIZER_OUTPUT, TEST_INVOKE_METHOD as _SCHEMA_TEST_INVOKE_METHOD, - TEST_INVOKE_METHOD_INPUT as _SCHEMA_TEST_INVOKE_METHOD_INPUT, - TEST_INVOKE_METHOD_OUTPUT as _SCHEMA_TEST_INVOKE_METHOD_OUTPUT, - THROTTLE_SETTINGS as _SCHEMA_THROTTLE_SETTINGS, - TLS_CONFIG as _SCHEMA_TLS_CONFIG, - TOO_MANY_REQUESTS_EXCEPTION as _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - UNAUTHORIZED_EXCEPTION as _SCHEMA_UNAUTHORIZED_EXCEPTION, UNTAG_RESOURCE as _SCHEMA_UNTAG_RESOURCE, - UNTAG_RESOURCE_INPUT as _SCHEMA_UNTAG_RESOURCE_INPUT, - UNTAG_RESOURCE_OUTPUT as _SCHEMA_UNTAG_RESOURCE_OUTPUT, UPDATE_ACCOUNT as _SCHEMA_UPDATE_ACCOUNT, - UPDATE_ACCOUNT_INPUT as _SCHEMA_UPDATE_ACCOUNT_INPUT, - UPDATE_ACCOUNT_OUTPUT as _SCHEMA_UPDATE_ACCOUNT_OUTPUT, UPDATE_API_KEY as _SCHEMA_UPDATE_API_KEY, - UPDATE_API_KEY_INPUT as _SCHEMA_UPDATE_API_KEY_INPUT, - UPDATE_API_KEY_OUTPUT as _SCHEMA_UPDATE_API_KEY_OUTPUT, UPDATE_AUTHORIZER as _SCHEMA_UPDATE_AUTHORIZER, - UPDATE_AUTHORIZER_INPUT as _SCHEMA_UPDATE_AUTHORIZER_INPUT, - UPDATE_AUTHORIZER_OUTPUT as _SCHEMA_UPDATE_AUTHORIZER_OUTPUT, UPDATE_BASE_PATH_MAPPING as _SCHEMA_UPDATE_BASE_PATH_MAPPING, - UPDATE_BASE_PATH_MAPPING_INPUT as _SCHEMA_UPDATE_BASE_PATH_MAPPING_INPUT, - UPDATE_BASE_PATH_MAPPING_OUTPUT as _SCHEMA_UPDATE_BASE_PATH_MAPPING_OUTPUT, UPDATE_CLIENT_CERTIFICATE as _SCHEMA_UPDATE_CLIENT_CERTIFICATE, - UPDATE_CLIENT_CERTIFICATE_INPUT as _SCHEMA_UPDATE_CLIENT_CERTIFICATE_INPUT, - UPDATE_CLIENT_CERTIFICATE_OUTPUT as _SCHEMA_UPDATE_CLIENT_CERTIFICATE_OUTPUT, UPDATE_DEPLOYMENT as _SCHEMA_UPDATE_DEPLOYMENT, - UPDATE_DEPLOYMENT_INPUT as _SCHEMA_UPDATE_DEPLOYMENT_INPUT, - UPDATE_DEPLOYMENT_OUTPUT as _SCHEMA_UPDATE_DEPLOYMENT_OUTPUT, UPDATE_DOCUMENTATION_PART as _SCHEMA_UPDATE_DOCUMENTATION_PART, - UPDATE_DOCUMENTATION_PART_INPUT as _SCHEMA_UPDATE_DOCUMENTATION_PART_INPUT, - UPDATE_DOCUMENTATION_PART_OUTPUT as _SCHEMA_UPDATE_DOCUMENTATION_PART_OUTPUT, UPDATE_DOCUMENTATION_VERSION as _SCHEMA_UPDATE_DOCUMENTATION_VERSION, - UPDATE_DOCUMENTATION_VERSION_INPUT as _SCHEMA_UPDATE_DOCUMENTATION_VERSION_INPUT, - UPDATE_DOCUMENTATION_VERSION_OUTPUT as _SCHEMA_UPDATE_DOCUMENTATION_VERSION_OUTPUT, UPDATE_DOMAIN_NAME as _SCHEMA_UPDATE_DOMAIN_NAME, - UPDATE_DOMAIN_NAME_INPUT as _SCHEMA_UPDATE_DOMAIN_NAME_INPUT, - UPDATE_DOMAIN_NAME_OUTPUT as _SCHEMA_UPDATE_DOMAIN_NAME_OUTPUT, UPDATE_GATEWAY_RESPONSE as _SCHEMA_UPDATE_GATEWAY_RESPONSE, - UPDATE_GATEWAY_RESPONSE_INPUT as _SCHEMA_UPDATE_GATEWAY_RESPONSE_INPUT, - UPDATE_GATEWAY_RESPONSE_OUTPUT as _SCHEMA_UPDATE_GATEWAY_RESPONSE_OUTPUT, UPDATE_INTEGRATION as _SCHEMA_UPDATE_INTEGRATION, - UPDATE_INTEGRATION_INPUT as _SCHEMA_UPDATE_INTEGRATION_INPUT, - UPDATE_INTEGRATION_OUTPUT as _SCHEMA_UPDATE_INTEGRATION_OUTPUT, UPDATE_INTEGRATION_RESPONSE as _SCHEMA_UPDATE_INTEGRATION_RESPONSE, - UPDATE_INTEGRATION_RESPONSE_INPUT as _SCHEMA_UPDATE_INTEGRATION_RESPONSE_INPUT, - UPDATE_INTEGRATION_RESPONSE_OUTPUT as _SCHEMA_UPDATE_INTEGRATION_RESPONSE_OUTPUT, UPDATE_METHOD as _SCHEMA_UPDATE_METHOD, - UPDATE_METHOD_INPUT as _SCHEMA_UPDATE_METHOD_INPUT, - UPDATE_METHOD_OUTPUT as _SCHEMA_UPDATE_METHOD_OUTPUT, UPDATE_METHOD_RESPONSE as _SCHEMA_UPDATE_METHOD_RESPONSE, - UPDATE_METHOD_RESPONSE_INPUT as _SCHEMA_UPDATE_METHOD_RESPONSE_INPUT, - UPDATE_METHOD_RESPONSE_OUTPUT as _SCHEMA_UPDATE_METHOD_RESPONSE_OUTPUT, UPDATE_MODEL as _SCHEMA_UPDATE_MODEL, - UPDATE_MODEL_INPUT as _SCHEMA_UPDATE_MODEL_INPUT, - UPDATE_MODEL_OUTPUT as _SCHEMA_UPDATE_MODEL_OUTPUT, UPDATE_REQUEST_VALIDATOR as _SCHEMA_UPDATE_REQUEST_VALIDATOR, - UPDATE_REQUEST_VALIDATOR_INPUT as _SCHEMA_UPDATE_REQUEST_VALIDATOR_INPUT, - UPDATE_REQUEST_VALIDATOR_OUTPUT as _SCHEMA_UPDATE_REQUEST_VALIDATOR_OUTPUT, UPDATE_RESOURCE as _SCHEMA_UPDATE_RESOURCE, - UPDATE_RESOURCE_INPUT as _SCHEMA_UPDATE_RESOURCE_INPUT, - UPDATE_RESOURCE_OUTPUT as _SCHEMA_UPDATE_RESOURCE_OUTPUT, UPDATE_REST_API as _SCHEMA_UPDATE_REST_API, - UPDATE_REST_API_INPUT as _SCHEMA_UPDATE_REST_API_INPUT, - UPDATE_REST_API_OUTPUT as _SCHEMA_UPDATE_REST_API_OUTPUT, UPDATE_STAGE as _SCHEMA_UPDATE_STAGE, - UPDATE_STAGE_INPUT as _SCHEMA_UPDATE_STAGE_INPUT, - UPDATE_STAGE_OUTPUT as _SCHEMA_UPDATE_STAGE_OUTPUT, UPDATE_USAGE as _SCHEMA_UPDATE_USAGE, - UPDATE_USAGE_INPUT as _SCHEMA_UPDATE_USAGE_INPUT, - UPDATE_USAGE_OUTPUT as _SCHEMA_UPDATE_USAGE_OUTPUT, UPDATE_USAGE_PLAN as _SCHEMA_UPDATE_USAGE_PLAN, - UPDATE_USAGE_PLAN_INPUT as _SCHEMA_UPDATE_USAGE_PLAN_INPUT, - UPDATE_USAGE_PLAN_OUTPUT as _SCHEMA_UPDATE_USAGE_PLAN_OUTPUT, UPDATE_VPC_LINK as _SCHEMA_UPDATE_VPC_LINK, - UPDATE_VPC_LINK_INPUT as _SCHEMA_UPDATE_VPC_LINK_INPUT, - UPDATE_VPC_LINK_OUTPUT as _SCHEMA_UPDATE_VPC_LINK_OUTPUT, - USAGE_PLAN as _SCHEMA_USAGE_PLAN, - USAGE_PLAN_KEY as _SCHEMA_USAGE_PLAN_KEY, - VPC_LINK as _SCHEMA_VPC_LINK, ) - -logger = logging.getLogger(__name__) +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .models import ( + CreateApiKeyInput, + CreateApiKeyOutput, + CreateAuthorizerInput, + CreateAuthorizerOutput, + CreateBasePathMappingInput, + CreateBasePathMappingOutput, + CreateDeploymentInput, + CreateDeploymentOutput, + CreateDocumentationPartInput, + CreateDocumentationPartOutput, + CreateDocumentationVersionInput, + CreateDocumentationVersionOutput, + CreateDomainNameAccessAssociationInput, + CreateDomainNameAccessAssociationOutput, + CreateDomainNameInput, + CreateDomainNameOutput, + CreateModelInput, + CreateModelOutput, + CreateRequestValidatorInput, + CreateRequestValidatorOutput, + CreateResourceInput, + CreateResourceOutput, + CreateRestApiInput, + CreateRestApiOutput, + CreateStageInput, + CreateStageOutput, + CreateUsagePlanInput, + CreateUsagePlanKeyInput, + CreateUsagePlanKeyOutput, + CreateUsagePlanOutput, + CreateVpcLinkInput, + CreateVpcLinkOutput, + DeleteApiKeyInput, + DeleteApiKeyOutput, + DeleteAuthorizerInput, + DeleteAuthorizerOutput, + DeleteBasePathMappingInput, + DeleteBasePathMappingOutput, + DeleteClientCertificateInput, + DeleteClientCertificateOutput, + DeleteDeploymentInput, + DeleteDeploymentOutput, + DeleteDocumentationPartInput, + DeleteDocumentationPartOutput, + DeleteDocumentationVersionInput, + DeleteDocumentationVersionOutput, + DeleteDomainNameAccessAssociationInput, + DeleteDomainNameAccessAssociationOutput, + DeleteDomainNameInput, + DeleteDomainNameOutput, + DeleteGatewayResponseInput, + DeleteGatewayResponseOutput, + DeleteIntegrationInput, + DeleteIntegrationOutput, + DeleteIntegrationResponseInput, + DeleteIntegrationResponseOutput, + DeleteMethodInput, + DeleteMethodOutput, + DeleteMethodResponseInput, + DeleteMethodResponseOutput, + DeleteModelInput, + DeleteModelOutput, + DeleteRequestValidatorInput, + DeleteRequestValidatorOutput, + DeleteResourceInput, + DeleteResourceOutput, + DeleteRestApiInput, + DeleteRestApiOutput, + DeleteStageInput, + DeleteStageOutput, + DeleteUsagePlanInput, + DeleteUsagePlanKeyInput, + DeleteUsagePlanKeyOutput, + DeleteUsagePlanOutput, + DeleteVpcLinkInput, + DeleteVpcLinkOutput, + FlushStageAuthorizersCacheInput, + FlushStageAuthorizersCacheOutput, + FlushStageCacheInput, + FlushStageCacheOutput, + GenerateClientCertificateInput, + GenerateClientCertificateOutput, + GetAccountInput, + GetAccountOutput, + GetApiKeyInput, + GetApiKeyOutput, + GetApiKeysInput, + GetApiKeysOutput, + GetAuthorizerInput, + GetAuthorizerOutput, + GetAuthorizersInput, + GetAuthorizersOutput, + GetBasePathMappingInput, + GetBasePathMappingOutput, + GetBasePathMappingsInput, + GetBasePathMappingsOutput, + GetClientCertificateInput, + GetClientCertificateOutput, + GetClientCertificatesInput, + GetClientCertificatesOutput, + GetDeploymentInput, + GetDeploymentOutput, + GetDeploymentsInput, + GetDeploymentsOutput, + GetDocumentationPartInput, + GetDocumentationPartOutput, + GetDocumentationPartsInput, + GetDocumentationPartsOutput, + GetDocumentationVersionInput, + GetDocumentationVersionOutput, + GetDocumentationVersionsInput, + GetDocumentationVersionsOutput, + GetDomainNameAccessAssociationsInput, + GetDomainNameAccessAssociationsOutput, + GetDomainNameInput, + GetDomainNameOutput, + GetDomainNamesInput, + GetDomainNamesOutput, + GetExportInput, + GetExportOutput, + GetGatewayResponseInput, + GetGatewayResponseOutput, + GetGatewayResponsesInput, + GetGatewayResponsesOutput, + GetIntegrationInput, + GetIntegrationOutput, + GetIntegrationResponseInput, + GetIntegrationResponseOutput, + GetMethodInput, + GetMethodOutput, + GetMethodResponseInput, + GetMethodResponseOutput, + GetModelInput, + GetModelOutput, + GetModelTemplateInput, + GetModelTemplateOutput, + GetModelsInput, + GetModelsOutput, + GetRequestValidatorInput, + GetRequestValidatorOutput, + GetRequestValidatorsInput, + GetRequestValidatorsOutput, + GetResourceInput, + GetResourceOutput, + GetResourcesInput, + GetResourcesOutput, + GetRestApiInput, + GetRestApiOutput, + GetRestApisInput, + GetRestApisOutput, + GetSdkInput, + GetSdkOutput, + GetSdkTypeInput, + GetSdkTypeOutput, + GetSdkTypesInput, + GetSdkTypesOutput, + GetStageInput, + GetStageOutput, + GetStagesInput, + GetStagesOutput, + GetTagsInput, + GetTagsOutput, + GetUsageInput, + GetUsageOutput, + GetUsagePlanInput, + GetUsagePlanKeyInput, + GetUsagePlanKeyOutput, + GetUsagePlanKeysInput, + GetUsagePlanKeysOutput, + GetUsagePlanOutput, + GetUsagePlansInput, + GetUsagePlansOutput, + GetVpcLinkInput, + GetVpcLinkOutput, + GetVpcLinksInput, + GetVpcLinksOutput, + ImportApiKeysInput, + ImportApiKeysOutput, + ImportDocumentationPartsInput, + ImportDocumentationPartsOutput, + ImportRestApiInput, + ImportRestApiOutput, + PutGatewayResponseInput, + PutGatewayResponseOutput, + PutIntegrationInput, + PutIntegrationOutput, + PutIntegrationResponseInput, + PutIntegrationResponseOutput, + PutMethodInput, + PutMethodOutput, + PutMethodResponseInput, + PutMethodResponseOutput, + PutRestApiInput, + PutRestApiOutput, + RejectDomainNameAccessAssociationInput, + RejectDomainNameAccessAssociationOutput, + TagResourceInput, + TagResourceOutput, + TestInvokeAuthorizerInput, + TestInvokeAuthorizerOutput, + TestInvokeMethodInput, + TestInvokeMethodOutput, + UntagResourceInput, + UntagResourceOutput, + UpdateAccountInput, + UpdateAccountOutput, + UpdateApiKeyInput, + UpdateApiKeyOutput, + UpdateAuthorizerInput, + UpdateAuthorizerOutput, + UpdateBasePathMappingInput, + UpdateBasePathMappingOutput, + UpdateClientCertificateInput, + UpdateClientCertificateOutput, + UpdateDeploymentInput, + UpdateDeploymentOutput, + UpdateDocumentationPartInput, + UpdateDocumentationPartOutput, + UpdateDocumentationVersionInput, + UpdateDocumentationVersionOutput, + UpdateDomainNameInput, + UpdateDomainNameOutput, + UpdateGatewayResponseInput, + UpdateGatewayResponseOutput, + UpdateIntegrationInput, + UpdateIntegrationOutput, + UpdateIntegrationResponseInput, + UpdateIntegrationResponseOutput, + UpdateMethodInput, + UpdateMethodOutput, + UpdateMethodResponseInput, + UpdateMethodResponseOutput, + UpdateModelInput, + UpdateModelOutput, + UpdateRequestValidatorInput, + UpdateRequestValidatorOutput, + UpdateResourceInput, + UpdateResourceOutput, + UpdateRestApiInput, + UpdateRestApiOutput, + UpdateStageInput, + UpdateStageOutput, + UpdateUsageInput, + UpdateUsageOutput, + UpdateUsagePlanInput, + UpdateUsagePlanOutput, + UpdateVpcLinkInput, + UpdateVpcLinkOutput, + ) class ServiceError(ModeledError): @@ -449,36087 +399,2410 @@ class ServiceError(ModeledError): """ -class AccessAssociationSourceType(UnknownEnumMixin, StrEnum): - VPCE = "VPCE" +_registry = ModelRegistry( + _schemas, + renames={}, + index={ + "AccessAssociationSourceType": "ACCESS_ASSOCIATION_SOURCE_TYPE", + "AccessLogSettings": "ACCESS_LOG_SETTINGS", + "ApiKey": "API_KEY", + "ApiKeysFormat": "API_KEYS_FORMAT", + "ApiKeySourceType": "API_KEY_SOURCE_TYPE", + "ApiStage": "API_STAGE", + "ApiStatus": "API_STATUS", + "Authorizer": "AUTHORIZER", + "AuthorizerType": "AUTHORIZER_TYPE", + "BadRequestException": "BAD_REQUEST_EXCEPTION", + "BasePathMapping": "BASE_PATH_MAPPING", + "CacheClusterSize": "CACHE_CLUSTER_SIZE", + "CacheClusterStatus": "CACHE_CLUSTER_STATUS", + "CanarySettings": "CANARY_SETTINGS", + "ClientCertificate": "CLIENT_CERTIFICATE", + "ConflictException": "CONFLICT_EXCEPTION", + "ConnectionType": "CONNECTION_TYPE", + "ContentHandlingStrategy": "CONTENT_HANDLING_STRATEGY", + "CreateApiKeyInput": "CREATE_API_KEY_INPUT", + "CreateApiKeyOutput": "CREATE_API_KEY_OUTPUT", + "CreateAuthorizerInput": "CREATE_AUTHORIZER_INPUT", + "CreateAuthorizerOutput": "CREATE_AUTHORIZER_OUTPUT", + "CreateBasePathMappingInput": "CREATE_BASE_PATH_MAPPING_INPUT", + "CreateBasePathMappingOutput": "CREATE_BASE_PATH_MAPPING_OUTPUT", + "CreateDeploymentInput": "CREATE_DEPLOYMENT_INPUT", + "CreateDeploymentOutput": "CREATE_DEPLOYMENT_OUTPUT", + "CreateDocumentationPartInput": "CREATE_DOCUMENTATION_PART_INPUT", + "CreateDocumentationPartOutput": "CREATE_DOCUMENTATION_PART_OUTPUT", + "CreateDocumentationVersionInput": "CREATE_DOCUMENTATION_VERSION_INPUT", + "CreateDocumentationVersionOutput": "CREATE_DOCUMENTATION_VERSION_OUTPUT", + "CreateDomainNameAccessAssociationInput": "CREATE_DOMAIN_NAME_ACCESS_ASSOCIATION_INPUT", + "CreateDomainNameAccessAssociationOutput": "CREATE_DOMAIN_NAME_ACCESS_ASSOCIATION_OUTPUT", + "CreateDomainNameInput": "CREATE_DOMAIN_NAME_INPUT", + "CreateDomainNameOutput": "CREATE_DOMAIN_NAME_OUTPUT", + "CreateModelInput": "CREATE_MODEL_INPUT", + "CreateModelOutput": "CREATE_MODEL_OUTPUT", + "CreateRequestValidatorInput": "CREATE_REQUEST_VALIDATOR_INPUT", + "CreateRequestValidatorOutput": "CREATE_REQUEST_VALIDATOR_OUTPUT", + "CreateResourceInput": "CREATE_RESOURCE_INPUT", + "CreateResourceOutput": "CREATE_RESOURCE_OUTPUT", + "CreateRestApiInput": "CREATE_REST_API_INPUT", + "CreateRestApiOutput": "CREATE_REST_API_OUTPUT", + "CreateStageInput": "CREATE_STAGE_INPUT", + "CreateStageOutput": "CREATE_STAGE_OUTPUT", + "CreateUsagePlanInput": "CREATE_USAGE_PLAN_INPUT", + "CreateUsagePlanKeyInput": "CREATE_USAGE_PLAN_KEY_INPUT", + "CreateUsagePlanKeyOutput": "CREATE_USAGE_PLAN_KEY_OUTPUT", + "CreateUsagePlanOutput": "CREATE_USAGE_PLAN_OUTPUT", + "CreateVpcLinkInput": "CREATE_VPC_LINK_INPUT", + "CreateVpcLinkOutput": "CREATE_VPC_LINK_OUTPUT", + "DeleteApiKeyInput": "DELETE_API_KEY_INPUT", + "DeleteApiKeyOutput": "DELETE_API_KEY_OUTPUT", + "DeleteAuthorizerInput": "DELETE_AUTHORIZER_INPUT", + "DeleteAuthorizerOutput": "DELETE_AUTHORIZER_OUTPUT", + "DeleteBasePathMappingInput": "DELETE_BASE_PATH_MAPPING_INPUT", + "DeleteBasePathMappingOutput": "DELETE_BASE_PATH_MAPPING_OUTPUT", + "DeleteClientCertificateInput": "DELETE_CLIENT_CERTIFICATE_INPUT", + "DeleteClientCertificateOutput": "DELETE_CLIENT_CERTIFICATE_OUTPUT", + "DeleteDeploymentInput": "DELETE_DEPLOYMENT_INPUT", + "DeleteDeploymentOutput": "DELETE_DEPLOYMENT_OUTPUT", + "DeleteDocumentationPartInput": "DELETE_DOCUMENTATION_PART_INPUT", + "DeleteDocumentationPartOutput": "DELETE_DOCUMENTATION_PART_OUTPUT", + "DeleteDocumentationVersionInput": "DELETE_DOCUMENTATION_VERSION_INPUT", + "DeleteDocumentationVersionOutput": "DELETE_DOCUMENTATION_VERSION_OUTPUT", + "DeleteDomainNameAccessAssociationInput": "DELETE_DOMAIN_NAME_ACCESS_ASSOCIATION_INPUT", + "DeleteDomainNameAccessAssociationOutput": "DELETE_DOMAIN_NAME_ACCESS_ASSOCIATION_OUTPUT", + "DeleteDomainNameInput": "DELETE_DOMAIN_NAME_INPUT", + "DeleteDomainNameOutput": "DELETE_DOMAIN_NAME_OUTPUT", + "DeleteGatewayResponseInput": "DELETE_GATEWAY_RESPONSE_INPUT", + "DeleteGatewayResponseOutput": "DELETE_GATEWAY_RESPONSE_OUTPUT", + "DeleteIntegrationInput": "DELETE_INTEGRATION_INPUT", + "DeleteIntegrationOutput": "DELETE_INTEGRATION_OUTPUT", + "DeleteIntegrationResponseInput": "DELETE_INTEGRATION_RESPONSE_INPUT", + "DeleteIntegrationResponseOutput": "DELETE_INTEGRATION_RESPONSE_OUTPUT", + "DeleteMethodInput": "DELETE_METHOD_INPUT", + "DeleteMethodOutput": "DELETE_METHOD_OUTPUT", + "DeleteMethodResponseInput": "DELETE_METHOD_RESPONSE_INPUT", + "DeleteMethodResponseOutput": "DELETE_METHOD_RESPONSE_OUTPUT", + "DeleteModelInput": "DELETE_MODEL_INPUT", + "DeleteModelOutput": "DELETE_MODEL_OUTPUT", + "DeleteRequestValidatorInput": "DELETE_REQUEST_VALIDATOR_INPUT", + "DeleteRequestValidatorOutput": "DELETE_REQUEST_VALIDATOR_OUTPUT", + "DeleteResourceInput": "DELETE_RESOURCE_INPUT", + "DeleteResourceOutput": "DELETE_RESOURCE_OUTPUT", + "DeleteRestApiInput": "DELETE_REST_API_INPUT", + "DeleteRestApiOutput": "DELETE_REST_API_OUTPUT", + "DeleteStageInput": "DELETE_STAGE_INPUT", + "DeleteStageOutput": "DELETE_STAGE_OUTPUT", + "DeleteUsagePlanInput": "DELETE_USAGE_PLAN_INPUT", + "DeleteUsagePlanKeyInput": "DELETE_USAGE_PLAN_KEY_INPUT", + "DeleteUsagePlanKeyOutput": "DELETE_USAGE_PLAN_KEY_OUTPUT", + "DeleteUsagePlanOutput": "DELETE_USAGE_PLAN_OUTPUT", + "DeleteVpcLinkInput": "DELETE_VPC_LINK_INPUT", + "DeleteVpcLinkOutput": "DELETE_VPC_LINK_OUTPUT", + "Deployment": "DEPLOYMENT", + "DeploymentCanarySettings": "DEPLOYMENT_CANARY_SETTINGS", + "DocumentationPart": "DOCUMENTATION_PART", + "DocumentationPartLocation": "DOCUMENTATION_PART_LOCATION", + "DocumentationPartType": "DOCUMENTATION_PART_TYPE", + "DocumentationVersion": "DOCUMENTATION_VERSION", + "DomainName": "DOMAIN_NAME", + "DomainNameAccessAssociation": "DOMAIN_NAME_ACCESS_ASSOCIATION", + "DomainNameStatus": "DOMAIN_NAME_STATUS", + "EndpointAccessMode": "ENDPOINT_ACCESS_MODE", + "EndpointConfiguration": "ENDPOINT_CONFIGURATION", + "EndpointType": "ENDPOINT_TYPE", + "FlushStageAuthorizersCacheInput": "FLUSH_STAGE_AUTHORIZERS_CACHE_INPUT", + "FlushStageAuthorizersCacheOutput": "FLUSH_STAGE_AUTHORIZERS_CACHE_OUTPUT", + "FlushStageCacheInput": "FLUSH_STAGE_CACHE_INPUT", + "FlushStageCacheOutput": "FLUSH_STAGE_CACHE_OUTPUT", + "GatewayResponse": "GATEWAY_RESPONSE", + "GatewayResponseType": "GATEWAY_RESPONSE_TYPE", + "GenerateClientCertificateInput": "GENERATE_CLIENT_CERTIFICATE_INPUT", + "GenerateClientCertificateOutput": "GENERATE_CLIENT_CERTIFICATE_OUTPUT", + "GetAccountInput": "GET_ACCOUNT_INPUT", + "GetAccountOutput": "GET_ACCOUNT_OUTPUT", + "GetApiKeyInput": "GET_API_KEY_INPUT", + "GetApiKeyOutput": "GET_API_KEY_OUTPUT", + "GetApiKeysInput": "GET_API_KEYS_INPUT", + "GetApiKeysOutput": "GET_API_KEYS_OUTPUT", + "GetAuthorizerInput": "GET_AUTHORIZER_INPUT", + "GetAuthorizerOutput": "GET_AUTHORIZER_OUTPUT", + "GetAuthorizersInput": "GET_AUTHORIZERS_INPUT", + "GetAuthorizersOutput": "GET_AUTHORIZERS_OUTPUT", + "GetBasePathMappingInput": "GET_BASE_PATH_MAPPING_INPUT", + "GetBasePathMappingOutput": "GET_BASE_PATH_MAPPING_OUTPUT", + "GetBasePathMappingsInput": "GET_BASE_PATH_MAPPINGS_INPUT", + "GetBasePathMappingsOutput": "GET_BASE_PATH_MAPPINGS_OUTPUT", + "GetClientCertificateInput": "GET_CLIENT_CERTIFICATE_INPUT", + "GetClientCertificateOutput": "GET_CLIENT_CERTIFICATE_OUTPUT", + "GetClientCertificatesInput": "GET_CLIENT_CERTIFICATES_INPUT", + "GetClientCertificatesOutput": "GET_CLIENT_CERTIFICATES_OUTPUT", + "GetDeploymentInput": "GET_DEPLOYMENT_INPUT", + "GetDeploymentOutput": "GET_DEPLOYMENT_OUTPUT", + "GetDeploymentsInput": "GET_DEPLOYMENTS_INPUT", + "GetDeploymentsOutput": "GET_DEPLOYMENTS_OUTPUT", + "GetDocumentationPartInput": "GET_DOCUMENTATION_PART_INPUT", + "GetDocumentationPartOutput": "GET_DOCUMENTATION_PART_OUTPUT", + "GetDocumentationPartsInput": "GET_DOCUMENTATION_PARTS_INPUT", + "GetDocumentationPartsOutput": "GET_DOCUMENTATION_PARTS_OUTPUT", + "GetDocumentationVersionInput": "GET_DOCUMENTATION_VERSION_INPUT", + "GetDocumentationVersionOutput": "GET_DOCUMENTATION_VERSION_OUTPUT", + "GetDocumentationVersionsInput": "GET_DOCUMENTATION_VERSIONS_INPUT", + "GetDocumentationVersionsOutput": "GET_DOCUMENTATION_VERSIONS_OUTPUT", + "GetDomainNameAccessAssociationsInput": "GET_DOMAIN_NAME_ACCESS_ASSOCIATIONS_INPUT", + "GetDomainNameAccessAssociationsOutput": "GET_DOMAIN_NAME_ACCESS_ASSOCIATIONS_OUTPUT", + "GetDomainNameInput": "GET_DOMAIN_NAME_INPUT", + "GetDomainNameOutput": "GET_DOMAIN_NAME_OUTPUT", + "GetDomainNamesInput": "GET_DOMAIN_NAMES_INPUT", + "GetDomainNamesOutput": "GET_DOMAIN_NAMES_OUTPUT", + "GetExportInput": "GET_EXPORT_INPUT", + "GetExportOutput": "GET_EXPORT_OUTPUT", + "GetGatewayResponseInput": "GET_GATEWAY_RESPONSE_INPUT", + "GetGatewayResponseOutput": "GET_GATEWAY_RESPONSE_OUTPUT", + "GetGatewayResponsesInput": "GET_GATEWAY_RESPONSES_INPUT", + "GetGatewayResponsesOutput": "GET_GATEWAY_RESPONSES_OUTPUT", + "GetIntegrationInput": "GET_INTEGRATION_INPUT", + "GetIntegrationOutput": "GET_INTEGRATION_OUTPUT", + "GetIntegrationResponseInput": "GET_INTEGRATION_RESPONSE_INPUT", + "GetIntegrationResponseOutput": "GET_INTEGRATION_RESPONSE_OUTPUT", + "GetMethodInput": "GET_METHOD_INPUT", + "GetMethodOutput": "GET_METHOD_OUTPUT", + "GetMethodResponseInput": "GET_METHOD_RESPONSE_INPUT", + "GetMethodResponseOutput": "GET_METHOD_RESPONSE_OUTPUT", + "GetModelInput": "GET_MODEL_INPUT", + "GetModelOutput": "GET_MODEL_OUTPUT", + "GetModelsInput": "GET_MODELS_INPUT", + "GetModelsOutput": "GET_MODELS_OUTPUT", + "GetModelTemplateInput": "GET_MODEL_TEMPLATE_INPUT", + "GetModelTemplateOutput": "GET_MODEL_TEMPLATE_OUTPUT", + "GetRequestValidatorInput": "GET_REQUEST_VALIDATOR_INPUT", + "GetRequestValidatorOutput": "GET_REQUEST_VALIDATOR_OUTPUT", + "GetRequestValidatorsInput": "GET_REQUEST_VALIDATORS_INPUT", + "GetRequestValidatorsOutput": "GET_REQUEST_VALIDATORS_OUTPUT", + "GetResourceInput": "GET_RESOURCE_INPUT", + "GetResourceOutput": "GET_RESOURCE_OUTPUT", + "GetResourcesInput": "GET_RESOURCES_INPUT", + "GetResourcesOutput": "GET_RESOURCES_OUTPUT", + "GetRestApiInput": "GET_REST_API_INPUT", + "GetRestApiOutput": "GET_REST_API_OUTPUT", + "GetRestApisInput": "GET_REST_APIS_INPUT", + "GetRestApisOutput": "GET_REST_APIS_OUTPUT", + "GetSdkInput": "GET_SDK_INPUT", + "GetSdkOutput": "GET_SDK_OUTPUT", + "GetSdkTypeInput": "GET_SDK_TYPE_INPUT", + "GetSdkTypeOutput": "GET_SDK_TYPE_OUTPUT", + "GetSdkTypesInput": "GET_SDK_TYPES_INPUT", + "GetSdkTypesOutput": "GET_SDK_TYPES_OUTPUT", + "GetStageInput": "GET_STAGE_INPUT", + "GetStageOutput": "GET_STAGE_OUTPUT", + "GetStagesInput": "GET_STAGES_INPUT", + "GetStagesOutput": "GET_STAGES_OUTPUT", + "GetTagsInput": "GET_TAGS_INPUT", + "GetTagsOutput": "GET_TAGS_OUTPUT", + "GetUsageInput": "GET_USAGE_INPUT", + "GetUsageOutput": "GET_USAGE_OUTPUT", + "GetUsagePlanInput": "GET_USAGE_PLAN_INPUT", + "GetUsagePlanKeyInput": "GET_USAGE_PLAN_KEY_INPUT", + "GetUsagePlanKeyOutput": "GET_USAGE_PLAN_KEY_OUTPUT", + "GetUsagePlanKeysInput": "GET_USAGE_PLAN_KEYS_INPUT", + "GetUsagePlanKeysOutput": "GET_USAGE_PLAN_KEYS_OUTPUT", + "GetUsagePlanOutput": "GET_USAGE_PLAN_OUTPUT", + "GetUsagePlansInput": "GET_USAGE_PLANS_INPUT", + "GetUsagePlansOutput": "GET_USAGE_PLANS_OUTPUT", + "GetVpcLinkInput": "GET_VPC_LINK_INPUT", + "GetVpcLinkOutput": "GET_VPC_LINK_OUTPUT", + "GetVpcLinksInput": "GET_VPC_LINKS_INPUT", + "GetVpcLinksOutput": "GET_VPC_LINKS_OUTPUT", + "ImportApiKeysInput": "IMPORT_API_KEYS_INPUT", + "ImportApiKeysOutput": "IMPORT_API_KEYS_OUTPUT", + "ImportDocumentationPartsInput": "IMPORT_DOCUMENTATION_PARTS_INPUT", + "ImportDocumentationPartsOutput": "IMPORT_DOCUMENTATION_PARTS_OUTPUT", + "ImportRestApiInput": "IMPORT_REST_API_INPUT", + "ImportRestApiOutput": "IMPORT_REST_API_OUTPUT", + "Integration": "INTEGRATION", + "IntegrationResponse": "INTEGRATION_RESPONSE", + "IntegrationType": "INTEGRATION_TYPE", + "IpAddressType": "IP_ADDRESS_TYPE", + "LimitExceededException": "LIMIT_EXCEEDED_EXCEPTION", + "LocationStatusType": "LOCATION_STATUS_TYPE", + "Method": "METHOD", + "MethodResponse": "METHOD_RESPONSE", + "MethodSetting": "METHOD_SETTING", + "MethodSnapshot": "METHOD_SNAPSHOT", + "Model": "MODEL", + "MutualTlsAuthentication": "MUTUAL_TLS_AUTHENTICATION", + "MutualTlsAuthenticationInput": "MUTUAL_TLS_AUTHENTICATION_INPUT", + "NotFoundException": "NOT_FOUND_EXCEPTION", + "Op": "OP", + "PatchOperation": "PATCH_OPERATION", + "PutGatewayResponseInput": "PUT_GATEWAY_RESPONSE_INPUT", + "PutGatewayResponseOutput": "PUT_GATEWAY_RESPONSE_OUTPUT", + "PutIntegrationInput": "PUT_INTEGRATION_INPUT", + "PutIntegrationOutput": "PUT_INTEGRATION_OUTPUT", + "PutIntegrationResponseInput": "PUT_INTEGRATION_RESPONSE_INPUT", + "PutIntegrationResponseOutput": "PUT_INTEGRATION_RESPONSE_OUTPUT", + "PutMethodInput": "PUT_METHOD_INPUT", + "PutMethodOutput": "PUT_METHOD_OUTPUT", + "PutMethodResponseInput": "PUT_METHOD_RESPONSE_INPUT", + "PutMethodResponseOutput": "PUT_METHOD_RESPONSE_OUTPUT", + "PutMode": "PUT_MODE", + "PutRestApiInput": "PUT_REST_API_INPUT", + "PutRestApiOutput": "PUT_REST_API_OUTPUT", + "QuotaPeriodType": "QUOTA_PERIOD_TYPE", + "QuotaSettings": "QUOTA_SETTINGS", + "RejectDomainNameAccessAssociationInput": "REJECT_DOMAIN_NAME_ACCESS_ASSOCIATION_INPUT", + "RejectDomainNameAccessAssociationOutput": "REJECT_DOMAIN_NAME_ACCESS_ASSOCIATION_OUTPUT", + "RequestValidator": "REQUEST_VALIDATOR", + "Resource": "RESOURCE", + "ResourceOwner": "RESOURCE_OWNER", + "ResponseTransferMode": "RESPONSE_TRANSFER_MODE", + "RestApi": "REST_API", + "RoutingMode": "ROUTING_MODE", + "SdkConfigurationProperty": "SDK_CONFIGURATION_PROPERTY", + "SdkType": "SDK_TYPE", + "SecurityPolicy": "SECURITY_POLICY", + "ServiceUnavailableException": "SERVICE_UNAVAILABLE_EXCEPTION", + "Stage": "STAGE", + "StageKey": "STAGE_KEY", + "TagResourceInput": "TAG_RESOURCE_INPUT", + "TagResourceOutput": "TAG_RESOURCE_OUTPUT", + "TestInvokeAuthorizerInput": "TEST_INVOKE_AUTHORIZER_INPUT", + "TestInvokeAuthorizerOutput": "TEST_INVOKE_AUTHORIZER_OUTPUT", + "TestInvokeMethodInput": "TEST_INVOKE_METHOD_INPUT", + "TestInvokeMethodOutput": "TEST_INVOKE_METHOD_OUTPUT", + "ThrottleSettings": "THROTTLE_SETTINGS", + "TlsConfig": "TLS_CONFIG", + "TooManyRequestsException": "TOO_MANY_REQUESTS_EXCEPTION", + "UnauthorizedCacheControlHeaderStrategy": "UNAUTHORIZED_CACHE_CONTROL_HEADER_STRATEGY", + "UnauthorizedException": "UNAUTHORIZED_EXCEPTION", + "UntagResourceInput": "UNTAG_RESOURCE_INPUT", + "UntagResourceOutput": "UNTAG_RESOURCE_OUTPUT", + "UpdateAccountInput": "UPDATE_ACCOUNT_INPUT", + "UpdateAccountOutput": "UPDATE_ACCOUNT_OUTPUT", + "UpdateApiKeyInput": "UPDATE_API_KEY_INPUT", + "UpdateApiKeyOutput": "UPDATE_API_KEY_OUTPUT", + "UpdateAuthorizerInput": "UPDATE_AUTHORIZER_INPUT", + "UpdateAuthorizerOutput": "UPDATE_AUTHORIZER_OUTPUT", + "UpdateBasePathMappingInput": "UPDATE_BASE_PATH_MAPPING_INPUT", + "UpdateBasePathMappingOutput": "UPDATE_BASE_PATH_MAPPING_OUTPUT", + "UpdateClientCertificateInput": "UPDATE_CLIENT_CERTIFICATE_INPUT", + "UpdateClientCertificateOutput": "UPDATE_CLIENT_CERTIFICATE_OUTPUT", + "UpdateDeploymentInput": "UPDATE_DEPLOYMENT_INPUT", + "UpdateDeploymentOutput": "UPDATE_DEPLOYMENT_OUTPUT", + "UpdateDocumentationPartInput": "UPDATE_DOCUMENTATION_PART_INPUT", + "UpdateDocumentationPartOutput": "UPDATE_DOCUMENTATION_PART_OUTPUT", + "UpdateDocumentationVersionInput": "UPDATE_DOCUMENTATION_VERSION_INPUT", + "UpdateDocumentationVersionOutput": "UPDATE_DOCUMENTATION_VERSION_OUTPUT", + "UpdateDomainNameInput": "UPDATE_DOMAIN_NAME_INPUT", + "UpdateDomainNameOutput": "UPDATE_DOMAIN_NAME_OUTPUT", + "UpdateGatewayResponseInput": "UPDATE_GATEWAY_RESPONSE_INPUT", + "UpdateGatewayResponseOutput": "UPDATE_GATEWAY_RESPONSE_OUTPUT", + "UpdateIntegrationInput": "UPDATE_INTEGRATION_INPUT", + "UpdateIntegrationOutput": "UPDATE_INTEGRATION_OUTPUT", + "UpdateIntegrationResponseInput": "UPDATE_INTEGRATION_RESPONSE_INPUT", + "UpdateIntegrationResponseOutput": "UPDATE_INTEGRATION_RESPONSE_OUTPUT", + "UpdateMethodInput": "UPDATE_METHOD_INPUT", + "UpdateMethodOutput": "UPDATE_METHOD_OUTPUT", + "UpdateMethodResponseInput": "UPDATE_METHOD_RESPONSE_INPUT", + "UpdateMethodResponseOutput": "UPDATE_METHOD_RESPONSE_OUTPUT", + "UpdateModelInput": "UPDATE_MODEL_INPUT", + "UpdateModelOutput": "UPDATE_MODEL_OUTPUT", + "UpdateRequestValidatorInput": "UPDATE_REQUEST_VALIDATOR_INPUT", + "UpdateRequestValidatorOutput": "UPDATE_REQUEST_VALIDATOR_OUTPUT", + "UpdateResourceInput": "UPDATE_RESOURCE_INPUT", + "UpdateResourceOutput": "UPDATE_RESOURCE_OUTPUT", + "UpdateRestApiInput": "UPDATE_REST_API_INPUT", + "UpdateRestApiOutput": "UPDATE_REST_API_OUTPUT", + "UpdateStageInput": "UPDATE_STAGE_INPUT", + "UpdateStageOutput": "UPDATE_STAGE_OUTPUT", + "UpdateUsageInput": "UPDATE_USAGE_INPUT", + "UpdateUsageOutput": "UPDATE_USAGE_OUTPUT", + "UpdateUsagePlanInput": "UPDATE_USAGE_PLAN_INPUT", + "UpdateUsagePlanOutput": "UPDATE_USAGE_PLAN_OUTPUT", + "UpdateVpcLinkInput": "UPDATE_VPC_LINK_INPUT", + "UpdateVpcLinkOutput": "UPDATE_VPC_LINK_OUTPUT", + "UsagePlan": "USAGE_PLAN", + "UsagePlanKey": "USAGE_PLAN_KEY", + "VpcLink": "VPC_LINK", + "VpcLinkStatus": "VPC_LINK_STATUS", + }, + shape_names=frozenset( + { + "AccessAssociationSourceType", + "AccessLogSettings", + "ApiKey", + "ApiKeySourceType", + "ApiKeysFormat", + "ApiStage", + "ApiStatus", + "Authorizer", + "AuthorizerType", + "BadRequestException", + "BasePathMapping", + "CacheClusterSize", + "CacheClusterStatus", + "CanarySettings", + "ClientCertificate", + "ConflictException", + "ConnectionType", + "ContentHandlingStrategy", + "CreateApiKeyInput", + "CreateApiKeyOutput", + "CreateAuthorizerInput", + "CreateAuthorizerOutput", + "CreateBasePathMappingInput", + "CreateBasePathMappingOutput", + "CreateDeploymentInput", + "CreateDeploymentOutput", + "CreateDocumentationPartInput", + "CreateDocumentationPartOutput", + "CreateDocumentationVersionInput", + "CreateDocumentationVersionOutput", + "CreateDomainNameAccessAssociationInput", + "CreateDomainNameAccessAssociationOutput", + "CreateDomainNameInput", + "CreateDomainNameOutput", + "CreateModelInput", + "CreateModelOutput", + "CreateRequestValidatorInput", + "CreateRequestValidatorOutput", + "CreateResourceInput", + "CreateResourceOutput", + "CreateRestApiInput", + "CreateRestApiOutput", + "CreateStageInput", + "CreateStageOutput", + "CreateUsagePlanInput", + "CreateUsagePlanKeyInput", + "CreateUsagePlanKeyOutput", + "CreateUsagePlanOutput", + "CreateVpcLinkInput", + "CreateVpcLinkOutput", + "DeleteApiKeyInput", + "DeleteApiKeyOutput", + "DeleteAuthorizerInput", + "DeleteAuthorizerOutput", + "DeleteBasePathMappingInput", + "DeleteBasePathMappingOutput", + "DeleteClientCertificateInput", + "DeleteClientCertificateOutput", + "DeleteDeploymentInput", + "DeleteDeploymentOutput", + "DeleteDocumentationPartInput", + "DeleteDocumentationPartOutput", + "DeleteDocumentationVersionInput", + "DeleteDocumentationVersionOutput", + "DeleteDomainNameAccessAssociationInput", + "DeleteDomainNameAccessAssociationOutput", + "DeleteDomainNameInput", + "DeleteDomainNameOutput", + "DeleteGatewayResponseInput", + "DeleteGatewayResponseOutput", + "DeleteIntegrationInput", + "DeleteIntegrationOutput", + "DeleteIntegrationResponseInput", + "DeleteIntegrationResponseOutput", + "DeleteMethodInput", + "DeleteMethodOutput", + "DeleteMethodResponseInput", + "DeleteMethodResponseOutput", + "DeleteModelInput", + "DeleteModelOutput", + "DeleteRequestValidatorInput", + "DeleteRequestValidatorOutput", + "DeleteResourceInput", + "DeleteResourceOutput", + "DeleteRestApiInput", + "DeleteRestApiOutput", + "DeleteStageInput", + "DeleteStageOutput", + "DeleteUsagePlanInput", + "DeleteUsagePlanKeyInput", + "DeleteUsagePlanKeyOutput", + "DeleteUsagePlanOutput", + "DeleteVpcLinkInput", + "DeleteVpcLinkOutput", + "Deployment", + "DeploymentCanarySettings", + "DocumentationPart", + "DocumentationPartLocation", + "DocumentationPartType", + "DocumentationVersion", + "DomainName", + "DomainNameAccessAssociation", + "DomainNameStatus", + "EndpointAccessMode", + "EndpointConfiguration", + "EndpointType", + "FlushStageAuthorizersCacheInput", + "FlushStageAuthorizersCacheOutput", + "FlushStageCacheInput", + "FlushStageCacheOutput", + "GatewayResponse", + "GatewayResponseType", + "GenerateClientCertificateInput", + "GenerateClientCertificateOutput", + "GetAccountInput", + "GetAccountOutput", + "GetApiKeyInput", + "GetApiKeyOutput", + "GetApiKeysInput", + "GetApiKeysOutput", + "GetAuthorizerInput", + "GetAuthorizerOutput", + "GetAuthorizersInput", + "GetAuthorizersOutput", + "GetBasePathMappingInput", + "GetBasePathMappingOutput", + "GetBasePathMappingsInput", + "GetBasePathMappingsOutput", + "GetClientCertificateInput", + "GetClientCertificateOutput", + "GetClientCertificatesInput", + "GetClientCertificatesOutput", + "GetDeploymentInput", + "GetDeploymentOutput", + "GetDeploymentsInput", + "GetDeploymentsOutput", + "GetDocumentationPartInput", + "GetDocumentationPartOutput", + "GetDocumentationPartsInput", + "GetDocumentationPartsOutput", + "GetDocumentationVersionInput", + "GetDocumentationVersionOutput", + "GetDocumentationVersionsInput", + "GetDocumentationVersionsOutput", + "GetDomainNameAccessAssociationsInput", + "GetDomainNameAccessAssociationsOutput", + "GetDomainNameInput", + "GetDomainNameOutput", + "GetDomainNamesInput", + "GetDomainNamesOutput", + "GetExportInput", + "GetExportOutput", + "GetGatewayResponseInput", + "GetGatewayResponseOutput", + "GetGatewayResponsesInput", + "GetGatewayResponsesOutput", + "GetIntegrationInput", + "GetIntegrationOutput", + "GetIntegrationResponseInput", + "GetIntegrationResponseOutput", + "GetMethodInput", + "GetMethodOutput", + "GetMethodResponseInput", + "GetMethodResponseOutput", + "GetModelInput", + "GetModelOutput", + "GetModelTemplateInput", + "GetModelTemplateOutput", + "GetModelsInput", + "GetModelsOutput", + "GetRequestValidatorInput", + "GetRequestValidatorOutput", + "GetRequestValidatorsInput", + "GetRequestValidatorsOutput", + "GetResourceInput", + "GetResourceOutput", + "GetResourcesInput", + "GetResourcesOutput", + "GetRestApiInput", + "GetRestApiOutput", + "GetRestApisInput", + "GetRestApisOutput", + "GetSdkInput", + "GetSdkOutput", + "GetSdkTypeInput", + "GetSdkTypeOutput", + "GetSdkTypesInput", + "GetSdkTypesOutput", + "GetStageInput", + "GetStageOutput", + "GetStagesInput", + "GetStagesOutput", + "GetTagsInput", + "GetTagsOutput", + "GetUsageInput", + "GetUsageOutput", + "GetUsagePlanInput", + "GetUsagePlanKeyInput", + "GetUsagePlanKeyOutput", + "GetUsagePlanKeysInput", + "GetUsagePlanKeysOutput", + "GetUsagePlanOutput", + "GetUsagePlansInput", + "GetUsagePlansOutput", + "GetVpcLinkInput", + "GetVpcLinkOutput", + "GetVpcLinksInput", + "GetVpcLinksOutput", + "ImportApiKeysInput", + "ImportApiKeysOutput", + "ImportDocumentationPartsInput", + "ImportDocumentationPartsOutput", + "ImportRestApiInput", + "ImportRestApiOutput", + "Integration", + "IntegrationResponse", + "IntegrationType", + "IpAddressType", + "LimitExceededException", + "LocationStatusType", + "Method", + "MethodResponse", + "MethodSetting", + "MethodSnapshot", + "Model", + "MutualTlsAuthentication", + "MutualTlsAuthenticationInput", + "NotFoundException", + "Op", + "PatchOperation", + "PutGatewayResponseInput", + "PutGatewayResponseOutput", + "PutIntegrationInput", + "PutIntegrationOutput", + "PutIntegrationResponseInput", + "PutIntegrationResponseOutput", + "PutMethodInput", + "PutMethodOutput", + "PutMethodResponseInput", + "PutMethodResponseOutput", + "PutMode", + "PutRestApiInput", + "PutRestApiOutput", + "QuotaPeriodType", + "QuotaSettings", + "RejectDomainNameAccessAssociationInput", + "RejectDomainNameAccessAssociationOutput", + "RequestValidator", + "Resource", + "ResourceOwner", + "ResponseTransferMode", + "RestApi", + "RoutingMode", + "SdkConfigurationProperty", + "SdkType", + "SecurityPolicy", + "ServiceUnavailableException", + "Stage", + "StageKey", + "TagResourceInput", + "TagResourceOutput", + "TestInvokeAuthorizerInput", + "TestInvokeAuthorizerOutput", + "TestInvokeMethodInput", + "TestInvokeMethodOutput", + "ThrottleSettings", + "TlsConfig", + "TooManyRequestsException", + "UnauthorizedCacheControlHeaderStrategy", + "UnauthorizedException", + "UntagResourceInput", + "UntagResourceOutput", + "UpdateAccountInput", + "UpdateAccountOutput", + "UpdateApiKeyInput", + "UpdateApiKeyOutput", + "UpdateAuthorizerInput", + "UpdateAuthorizerOutput", + "UpdateBasePathMappingInput", + "UpdateBasePathMappingOutput", + "UpdateClientCertificateInput", + "UpdateClientCertificateOutput", + "UpdateDeploymentInput", + "UpdateDeploymentOutput", + "UpdateDocumentationPartInput", + "UpdateDocumentationPartOutput", + "UpdateDocumentationVersionInput", + "UpdateDocumentationVersionOutput", + "UpdateDomainNameInput", + "UpdateDomainNameOutput", + "UpdateGatewayResponseInput", + "UpdateGatewayResponseOutput", + "UpdateIntegrationInput", + "UpdateIntegrationOutput", + "UpdateIntegrationResponseInput", + "UpdateIntegrationResponseOutput", + "UpdateMethodInput", + "UpdateMethodOutput", + "UpdateMethodResponseInput", + "UpdateMethodResponseOutput", + "UpdateModelInput", + "UpdateModelOutput", + "UpdateRequestValidatorInput", + "UpdateRequestValidatorOutput", + "UpdateResourceInput", + "UpdateResourceOutput", + "UpdateRestApiInput", + "UpdateRestApiOutput", + "UpdateStageInput", + "UpdateStageOutput", + "UpdateUsageInput", + "UpdateUsageOutput", + "UpdateUsagePlanInput", + "UpdateUsagePlanOutput", + "UpdateVpcLinkInput", + "UpdateVpcLinkOutput", + "UsagePlan", + "UsagePlanKey", + "VpcLink", + "VpcLinkStatus", + } + ), + service_error="ServiceError", +) + + +def __getattr__(name: str): + return _registry.build(name) + + +CREATE_API_KEY: APIOperation[CreateApiKeyInput, CreateApiKeyOutput] = APIOperation( + static_schema=_SCHEMA_CREATE_API_KEY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +CREATE_AUTHORIZER: APIOperation[CreateAuthorizerInput, CreateAuthorizerOutput] = ( + APIOperation( + static_schema=_SCHEMA_CREATE_AUTHORIZER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +CREATE_BASE_PATH_MAPPING: APIOperation[ + CreateBasePathMappingInput, CreateBasePathMappingOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_BASE_PATH_MAPPING, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +CREATE_DEPLOYMENT: APIOperation[CreateDeploymentInput, CreateDeploymentOutput] = ( + APIOperation( + static_schema=_SCHEMA_CREATE_DEPLOYMENT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#ServiceUnavailableException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +CREATE_DOCUMENTATION_PART: APIOperation[ + CreateDocumentationPartInput, CreateDocumentationPartOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_DOCUMENTATION_PART, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +CREATE_DOCUMENTATION_VERSION: APIOperation[ + CreateDocumentationVersionInput, CreateDocumentationVersionOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_DOCUMENTATION_VERSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +CREATE_DOMAIN_NAME: APIOperation[CreateDomainNameInput, CreateDomainNameOutput] = ( + APIOperation( + static_schema=_SCHEMA_CREATE_DOMAIN_NAME, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) -@dataclass(kw_only=True) -class AccessLogSettings: - """ - Access log settings, including the access log format and access log - destination ARN. - """ +CREATE_DOMAIN_NAME_ACCESS_ASSOCIATION: APIOperation[ + CreateDomainNameAccessAssociationInput, CreateDomainNameAccessAssociationOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_DOMAIN_NAME_ACCESS_ASSOCIATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +CREATE_MODEL: APIOperation[CreateModelInput, CreateModelOutput] = APIOperation( + static_schema=_SCHEMA_CREATE_MODEL, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - format: str | None = None - """ - A single line format of the access logs of data, as specified by - selected $context variables. The format must include at least - `$context.requestId`. - """ +CREATE_REQUEST_VALIDATOR: APIOperation[ + CreateRequestValidatorInput, CreateRequestValidatorOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_REQUEST_VALIDATOR, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - destination_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the CloudWatch Logs log group or - Kinesis Data Firehose delivery stream to receive access logs. If you - specify a Kinesis Data Firehose delivery stream, the stream name must - begin with `amazon-apigateway-`. - """ +CREATE_RESOURCE: APIOperation[CreateResourceInput, CreateResourceOutput] = APIOperation( + static_schema=_SCHEMA_CREATE_RESOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACCESS_LOG_SETTINGS, self) +CREATE_REST_API: APIOperation[CreateRestApiInput, CreateRestApiOutput] = APIOperation( + static_schema=_SCHEMA_CREATE_REST_API, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize_members(self, serializer: ShapeSerializer): - if self.format is not None: - serializer.write_string( - _SCHEMA_ACCESS_LOG_SETTINGS.members["format"], self.format - ) +CREATE_STAGE: APIOperation[CreateStageInput, CreateStageOutput] = APIOperation( + static_schema=_SCHEMA_CREATE_STAGE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - if self.destination_arn is not None: - serializer.write_string( - _SCHEMA_ACCESS_LOG_SETTINGS.members["destinationArn"], - self.destination_arn, - ) +CREATE_USAGE_PLAN: APIOperation[CreateUsagePlanInput, CreateUsagePlanOutput] = ( + APIOperation( + static_schema=_SCHEMA_CREATE_USAGE_PLAN, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) +CREATE_USAGE_PLAN_KEY: APIOperation[ + CreateUsagePlanKeyInput, CreateUsagePlanKeyOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_USAGE_PLAN_KEY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +CREATE_VPC_LINK: APIOperation[CreateVpcLinkInput, CreateVpcLinkOutput] = APIOperation( + static_schema=_SCHEMA_CREATE_VPC_LINK, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +DELETE_API_KEY: APIOperation[DeleteApiKeyInput, DeleteApiKeyOutput] = APIOperation( + static_schema=_SCHEMA_DELETE_API_KEY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["format"] = de.read_string( - _SCHEMA_ACCESS_LOG_SETTINGS.members["format"] - ) +DELETE_AUTHORIZER: APIOperation[DeleteAuthorizerInput, DeleteAuthorizerOutput] = ( + APIOperation( + static_schema=_SCHEMA_DELETE_AUTHORIZER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +DELETE_BASE_PATH_MAPPING: APIOperation[ + DeleteBasePathMappingInput, DeleteBasePathMappingOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_BASE_PATH_MAPPING, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +DELETE_CLIENT_CERTIFICATE: APIOperation[ + DeleteClientCertificateInput, DeleteClientCertificateOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_CLIENT_CERTIFICATE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +DELETE_DEPLOYMENT: APIOperation[DeleteDeploymentInput, DeleteDeploymentOutput] = ( + APIOperation( + static_schema=_SCHEMA_DELETE_DEPLOYMENT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +DELETE_DOCUMENTATION_PART: APIOperation[ + DeleteDocumentationPartInput, DeleteDocumentationPartOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_DOCUMENTATION_PART, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 1: - kwargs["destination_arn"] = de.read_string( - _SCHEMA_ACCESS_LOG_SETTINGS.members["destinationArn"] - ) +DELETE_DOCUMENTATION_VERSION: APIOperation[ + DeleteDocumentationVersionInput, DeleteDocumentationVersionOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_DOCUMENTATION_VERSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case _: - logger.debug("Unexpected member schema: %s", schema) +DELETE_DOMAIN_NAME: APIOperation[DeleteDomainNameInput, DeleteDomainNameOutput] = ( + APIOperation( + static_schema=_SCHEMA_DELETE_DOMAIN_NAME, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - deserializer.read_struct(_SCHEMA_ACCESS_LOG_SETTINGS, consumer=_consumer) - return kwargs +DELETE_DOMAIN_NAME_ACCESS_ASSOCIATION: APIOperation[ + DeleteDomainNameAccessAssociationInput, DeleteDomainNameAccessAssociationOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_DOMAIN_NAME_ACCESS_ASSOCIATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +DELETE_GATEWAY_RESPONSE: APIOperation[ + DeleteGatewayResponseInput, DeleteGatewayResponseOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_GATEWAY_RESPONSE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -def _serialize_list_of_string( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) +DELETE_INTEGRATION: APIOperation[DeleteIntegrationInput, DeleteIntegrationOutput] = ( + APIOperation( + static_schema=_SCHEMA_DELETE_INTEGRATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) +DELETE_INTEGRATION_RESPONSE: APIOperation[ + DeleteIntegrationResponseInput, DeleteIntegrationResponseOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_INTEGRATION_RESPONSE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -def _deserialize_list_of_string( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] +DELETE_METHOD: APIOperation[DeleteMethodInput, DeleteMethodOutput] = APIOperation( + static_schema=_SCHEMA_DELETE_METHOD, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() +DELETE_METHOD_RESPONSE: APIOperation[ + DeleteMethodResponseInput, DeleteMethodResponseOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_METHOD_RESPONSE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - else: - result.append(d.read_string(member_schema)) +DELETE_MODEL: APIOperation[DeleteModelInput, DeleteModelOutput] = APIOperation( + static_schema=_SCHEMA_DELETE_MODEL, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - deserializer.read_list(schema, _read_value) - return result +DELETE_REQUEST_VALIDATOR: APIOperation[ + DeleteRequestValidatorInput, DeleteRequestValidatorOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_REQUEST_VALIDATOR, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +DELETE_RESOURCE: APIOperation[DeleteResourceInput, DeleteResourceOutput] = APIOperation( + static_schema=_SCHEMA_DELETE_RESOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -@dataclass(kw_only=True) -class ThrottleSettings: - """The API request rate limits.""" +DELETE_REST_API: APIOperation[DeleteRestApiInput, DeleteRestApiOutput] = APIOperation( + static_schema=_SCHEMA_DELETE_REST_API, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - burst_limit: int = 0 - """ - The API target request burst rate limit. This allows more requests - through for a period of time than the target rate limit. - """ +DELETE_STAGE: APIOperation[DeleteStageInput, DeleteStageOutput] = APIOperation( + static_schema=_SCHEMA_DELETE_STAGE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - rate_limit: float = 0 - """The API target request rate limit.""" +DELETE_USAGE_PLAN: APIOperation[DeleteUsagePlanInput, DeleteUsagePlanOutput] = ( + APIOperation( + static_schema=_SCHEMA_DELETE_USAGE_PLAN, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_THROTTLE_SETTINGS, self) +DELETE_USAGE_PLAN_KEY: APIOperation[ + DeleteUsagePlanKeyInput, DeleteUsagePlanKeyOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_USAGE_PLAN_KEY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer( - _SCHEMA_THROTTLE_SETTINGS.members["burstLimit"], self.burst_limit - ) - serializer.write_double( - _SCHEMA_THROTTLE_SETTINGS.members["rateLimit"], self.rate_limit - ) +DELETE_VPC_LINK: APIOperation[DeleteVpcLinkInput, DeleteVpcLinkOutput] = APIOperation( + static_schema=_SCHEMA_DELETE_VPC_LINK, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) +FLUSH_STAGE_AUTHORIZERS_CACHE: APIOperation[ + FlushStageAuthorizersCacheInput, FlushStageAuthorizersCacheOutput +] = APIOperation( + static_schema=_SCHEMA_FLUSH_STAGE_AUTHORIZERS_CACHE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +FLUSH_STAGE_CACHE: APIOperation[FlushStageCacheInput, FlushStageCacheOutput] = ( + APIOperation( + static_schema=_SCHEMA_FLUSH_STAGE_CACHE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["burst_limit"] = de.read_integer( - _SCHEMA_THROTTLE_SETTINGS.members["burstLimit"] - ) +GENERATE_CLIENT_CERTIFICATE: APIOperation[ + GenerateClientCertificateInput, GenerateClientCertificateOutput +] = APIOperation( + static_schema=_SCHEMA_GENERATE_CLIENT_CERTIFICATE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 1: - kwargs["rate_limit"] = de.read_double( - _SCHEMA_THROTTLE_SETTINGS.members["rateLimit"] - ) +GET_ACCOUNT: APIOperation[GetAccountInput, GetAccountOutput] = APIOperation( + static_schema=_SCHEMA_GET_ACCOUNT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case _: - logger.debug("Unexpected member schema: %s", schema) +GET_API_KEY: APIOperation[GetApiKeyInput, GetApiKeyOutput] = APIOperation( + static_schema=_SCHEMA_GET_API_KEY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - deserializer.read_struct(_SCHEMA_THROTTLE_SETTINGS, consumer=_consumer) - return kwargs +GET_API_KEYS: APIOperation[GetApiKeysInput, GetApiKeysOutput] = APIOperation( + static_schema=_SCHEMA_GET_API_KEYS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +GET_AUTHORIZER: APIOperation[GetAuthorizerInput, GetAuthorizerOutput] = APIOperation( + static_schema=_SCHEMA_GET_AUTHORIZER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -def _serialize_map_of_string_to_string( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) +GET_AUTHORIZERS: APIOperation[GetAuthorizersInput, GetAuthorizersOutput] = APIOperation( + static_schema=_SCHEMA_GET_AUTHORIZERS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +GET_BASE_PATH_MAPPING: APIOperation[ + GetBasePathMappingInput, GetBasePathMappingOutput +] = APIOperation( + static_schema=_SCHEMA_GET_BASE_PATH_MAPPING, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -def _deserialize_map_of_string_to_string( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] +GET_BASE_PATH_MAPPINGS: APIOperation[ + GetBasePathMappingsInput, GetBasePathMappingsOutput +] = APIOperation( + static_schema=_SCHEMA_GET_BASE_PATH_MAPPINGS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() +GET_CLIENT_CERTIFICATE: APIOperation[ + GetClientCertificateInput, GetClientCertificateOutput +] = APIOperation( + static_schema=_SCHEMA_GET_CLIENT_CERTIFICATE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - else: - result[k] = d.read_string(value_schema) +GET_CLIENT_CERTIFICATES: APIOperation[ + GetClientCertificatesInput, GetClientCertificatesOutput +] = APIOperation( + static_schema=_SCHEMA_GET_CLIENT_CERTIFICATES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - deserializer.read_map(schema, _read_value) - return result +GET_DEPLOYMENT: APIOperation[GetDeploymentInput, GetDeploymentOutput] = APIOperation( + static_schema=_SCHEMA_GET_DEPLOYMENT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#ServiceUnavailableException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +GET_DEPLOYMENTS: APIOperation[GetDeploymentsInput, GetDeploymentsOutput] = APIOperation( + static_schema=_SCHEMA_GET_DEPLOYMENTS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#ServiceUnavailableException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -@dataclass(kw_only=True) -class ApiKey: - """ - A resource that can be distributed to callers for executing Method - resources that require an API key. API keys can be mapped to any Stage - on any RestApi, which indicates that the callers with the API key can - make requests to that stage. - """ +GET_DOCUMENTATION_PART: APIOperation[ + GetDocumentationPartInput, GetDocumentationPartOutput +] = APIOperation( + static_schema=_SCHEMA_GET_DOCUMENTATION_PART, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - id: str | None = None - """The identifier of the API Key.""" +GET_DOCUMENTATION_PARTS: APIOperation[ + GetDocumentationPartsInput, GetDocumentationPartsOutput +] = APIOperation( + static_schema=_SCHEMA_GET_DOCUMENTATION_PARTS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - value: str | None = None - """The value of the API Key.""" +GET_DOCUMENTATION_VERSION: APIOperation[ + GetDocumentationVersionInput, GetDocumentationVersionOutput +] = APIOperation( + static_schema=_SCHEMA_GET_DOCUMENTATION_VERSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - name: str | None = None - """The name of the API Key.""" +GET_DOCUMENTATION_VERSIONS: APIOperation[ + GetDocumentationVersionsInput, GetDocumentationVersionsOutput +] = APIOperation( + static_schema=_SCHEMA_GET_DOCUMENTATION_VERSIONS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - customer_id: str | None = None - """ - An Amazon Web Services Marketplace customer identifier, when integrating - with the Amazon Web Services SaaS Marketplace. - """ +GET_DOMAIN_NAME: APIOperation[GetDomainNameInput, GetDomainNameOutput] = APIOperation( + static_schema=_SCHEMA_GET_DOMAIN_NAME, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - description: str | None = None - """The description of the API Key.""" +GET_DOMAIN_NAME_ACCESS_ASSOCIATIONS: APIOperation[ + GetDomainNameAccessAssociationsInput, GetDomainNameAccessAssociationsOutput +] = APIOperation( + static_schema=_SCHEMA_GET_DOMAIN_NAME_ACCESS_ASSOCIATIONS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - enabled: bool = False - """Specifies whether the API Key can be used by callers.""" +GET_DOMAIN_NAMES: APIOperation[GetDomainNamesInput, GetDomainNamesOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_DOMAIN_NAMES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - created_date: datetime | None = None - """The timestamp when the API Key was created.""" +GET_EXPORT: APIOperation[GetExportInput, GetExportOutput] = APIOperation( + static_schema=_SCHEMA_GET_EXPORT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - last_updated_date: datetime | None = None - """The timestamp when the API Key was last updated.""" +GET_GATEWAY_RESPONSE: APIOperation[ + GetGatewayResponseInput, GetGatewayResponseOutput +] = APIOperation( + static_schema=_SCHEMA_GET_GATEWAY_RESPONSE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - stage_keys: list[str] | None = None - """A list of Stage resources that are associated with the ApiKey resource.""" +GET_GATEWAY_RESPONSES: APIOperation[ + GetGatewayResponsesInput, GetGatewayResponsesOutput +] = APIOperation( + static_schema=_SCHEMA_GET_GATEWAY_RESPONSES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - tags: dict[str, str] | None = None - """ - The collection of tags. Each tag element is associated with a given - resource. - """ +GET_INTEGRATION: APIOperation[GetIntegrationInput, GetIntegrationOutput] = APIOperation( + static_schema=_SCHEMA_GET_INTEGRATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_API_KEY, self) +GET_INTEGRATION_RESPONSE: APIOperation[ + GetIntegrationResponseInput, GetIntegrationResponseOutput +] = APIOperation( + static_schema=_SCHEMA_GET_INTEGRATION_RESPONSE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string(_SCHEMA_API_KEY.members["id"], self.id) +GET_METHOD: APIOperation[GetMethodInput, GetMethodOutput] = APIOperation( + static_schema=_SCHEMA_GET_METHOD, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - if self.value is not None: - serializer.write_string(_SCHEMA_API_KEY.members["value"], self.value) +GET_METHOD_RESPONSE: APIOperation[GetMethodResponseInput, GetMethodResponseOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_METHOD_RESPONSE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - if self.name is not None: - serializer.write_string(_SCHEMA_API_KEY.members["name"], self.name) +GET_MODEL: APIOperation[GetModelInput, GetModelOutput] = APIOperation( + static_schema=_SCHEMA_GET_MODEL, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - if self.customer_id is not None: - serializer.write_string( - _SCHEMA_API_KEY.members["customerId"], self.customer_id - ) +GET_MODELS: APIOperation[GetModelsInput, GetModelsOutput] = APIOperation( + static_schema=_SCHEMA_GET_MODELS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - if self.description is not None: - serializer.write_string( - _SCHEMA_API_KEY.members["description"], self.description - ) +GET_MODEL_TEMPLATE: APIOperation[GetModelTemplateInput, GetModelTemplateOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_MODEL_TEMPLATE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - serializer.write_boolean(_SCHEMA_API_KEY.members["enabled"], self.enabled) - if self.created_date is not None: - serializer.write_timestamp( - _SCHEMA_API_KEY.members["createdDate"], self.created_date - ) +GET_REQUEST_VALIDATOR: APIOperation[ + GetRequestValidatorInput, GetRequestValidatorOutput +] = APIOperation( + static_schema=_SCHEMA_GET_REQUEST_VALIDATOR, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - if self.last_updated_date is not None: - serializer.write_timestamp( - _SCHEMA_API_KEY.members["lastUpdatedDate"], self.last_updated_date - ) +GET_REQUEST_VALIDATORS: APIOperation[ + GetRequestValidatorsInput, GetRequestValidatorsOutput +] = APIOperation( + static_schema=_SCHEMA_GET_REQUEST_VALIDATORS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - if self.stage_keys is not None: - _serialize_list_of_string( - serializer, _SCHEMA_API_KEY.members["stageKeys"], self.stage_keys - ) +GET_RESOURCE: APIOperation[GetResourceInput, GetResourceOutput] = APIOperation( + static_schema=_SCHEMA_GET_RESOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - if self.tags is not None: - _serialize_map_of_string_to_string( - serializer, _SCHEMA_API_KEY.members["tags"], self.tags - ) +GET_RESOURCES: APIOperation[GetResourcesInput, GetResourcesOutput] = APIOperation( + static_schema=_SCHEMA_GET_RESOURCES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) +GET_REST_API: APIOperation[GetRestApiInput, GetRestApiOutput] = APIOperation( + static_schema=_SCHEMA_GET_REST_API, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +GET_REST_APIS: APIOperation[GetRestApisInput, GetRestApisOutput] = APIOperation( + static_schema=_SCHEMA_GET_REST_APIS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string(_SCHEMA_API_KEY.members["id"]) +GET_SDK: APIOperation[GetSdkInput, GetSdkOutput] = APIOperation( + static_schema=_SCHEMA_GET_SDK, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 1: - kwargs["value"] = de.read_string(_SCHEMA_API_KEY.members["value"]) +GET_SDK_TYPE: APIOperation[GetSdkTypeInput, GetSdkTypeOutput] = APIOperation( + static_schema=_SCHEMA_GET_SDK_TYPE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 2: - kwargs["name"] = de.read_string(_SCHEMA_API_KEY.members["name"]) +GET_SDK_TYPES: APIOperation[GetSdkTypesInput, GetSdkTypesOutput] = APIOperation( + static_schema=_SCHEMA_GET_SDK_TYPES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 3: - kwargs["customer_id"] = de.read_string( - _SCHEMA_API_KEY.members["customerId"] - ) +GET_STAGE: APIOperation[GetStageInput, GetStageOutput] = APIOperation( + static_schema=_SCHEMA_GET_STAGE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 4: - kwargs["description"] = de.read_string( - _SCHEMA_API_KEY.members["description"] - ) +GET_STAGES: APIOperation[GetStagesInput, GetStagesOutput] = APIOperation( + static_schema=_SCHEMA_GET_STAGES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 5: - kwargs["enabled"] = de.read_boolean( - _SCHEMA_API_KEY.members["enabled"] - ) +GET_TAGS: APIOperation[GetTagsInput, GetTagsOutput] = APIOperation( + static_schema=_SCHEMA_GET_TAGS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 6: - kwargs["created_date"] = de.read_timestamp( - _SCHEMA_API_KEY.members["createdDate"] - ) +GET_USAGE: APIOperation[GetUsageInput, GetUsageOutput] = APIOperation( + static_schema=_SCHEMA_GET_USAGE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 7: - kwargs["last_updated_date"] = de.read_timestamp( - _SCHEMA_API_KEY.members["lastUpdatedDate"] - ) +GET_USAGE_PLAN: APIOperation[GetUsagePlanInput, GetUsagePlanOutput] = APIOperation( + static_schema=_SCHEMA_GET_USAGE_PLAN, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 8: - kwargs["stage_keys"] = _deserialize_list_of_string( - de, _SCHEMA_API_KEY.members["stageKeys"] - ) +GET_USAGE_PLAN_KEY: APIOperation[GetUsagePlanKeyInput, GetUsagePlanKeyOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_USAGE_PLAN_KEY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - case 9: - kwargs["tags"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_API_KEY.members["tags"] - ) +GET_USAGE_PLAN_KEYS: APIOperation[GetUsagePlanKeysInput, GetUsagePlanKeysOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_USAGE_PLAN_KEYS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - case _: - logger.debug("Unexpected member schema: %s", schema) +GET_USAGE_PLANS: APIOperation[GetUsagePlansInput, GetUsagePlansOutput] = APIOperation( + static_schema=_SCHEMA_GET_USAGE_PLANS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - deserializer.read_struct(_SCHEMA_API_KEY, consumer=_consumer) - return kwargs +GET_VPC_LINK: APIOperation[GetVpcLinkInput, GetVpcLinkOutput] = APIOperation( + static_schema=_SCHEMA_GET_VPC_LINK, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +GET_VPC_LINKS: APIOperation[GetVpcLinksInput, GetVpcLinksOutput] = APIOperation( + static_schema=_SCHEMA_GET_VPC_LINKS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -class ApiKeysFormat(UnknownEnumMixin, StrEnum): - CSV = "csv" +IMPORT_API_KEYS: APIOperation[ImportApiKeysInput, ImportApiKeysOutput] = APIOperation( + static_schema=_SCHEMA_IMPORT_API_KEYS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +IMPORT_DOCUMENTATION_PARTS: APIOperation[ + ImportDocumentationPartsInput, ImportDocumentationPartsOutput +] = APIOperation( + static_schema=_SCHEMA_IMPORT_DOCUMENTATION_PARTS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -class ApiKeySourceType(UnknownEnumMixin, StrEnum): - HEADER = "HEADER" - AUTHORIZER = "AUTHORIZER" +IMPORT_REST_API: APIOperation[ImportRestApiInput, ImportRestApiOutput] = APIOperation( + static_schema=_SCHEMA_IMPORT_REST_API, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +PUT_GATEWAY_RESPONSE: APIOperation[ + PutGatewayResponseInput, PutGatewayResponseOutput +] = APIOperation( + static_schema=_SCHEMA_PUT_GATEWAY_RESPONSE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -def _serialize_map_of_api_stage_throttle_settings( - serializer: ShapeSerializer, schema: Schema, value: dict[str, ThrottleSettings] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_struct(value_schema, v)) +PUT_INTEGRATION: APIOperation[PutIntegrationInput, PutIntegrationOutput] = APIOperation( + static_schema=_SCHEMA_PUT_INTEGRATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +PUT_INTEGRATION_RESPONSE: APIOperation[ + PutIntegrationResponseInput, PutIntegrationResponseOutput +] = APIOperation( + static_schema=_SCHEMA_PUT_INTEGRATION_RESPONSE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -def _deserialize_map_of_api_stage_throttle_settings( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, ThrottleSettings]: - result: dict[str, ThrottleSettings] = {} - value_schema = schema.members["value"] +PUT_METHOD: APIOperation[PutMethodInput, PutMethodOutput] = APIOperation( + static_schema=_SCHEMA_PUT_METHOD, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() +PUT_METHOD_RESPONSE: APIOperation[PutMethodResponseInput, PutMethodResponseOutput] = ( + APIOperation( + static_schema=_SCHEMA_PUT_METHOD_RESPONSE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - else: - result[k] = ThrottleSettings.deserialize(d) +PUT_REST_API: APIOperation[PutRestApiInput, PutRestApiOutput] = APIOperation( + static_schema=_SCHEMA_PUT_REST_API, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ApiStage: - """API stage name of the associated API stage in a usage plan.""" - - api_id: str | None = None - """API Id of the associated API stage in a usage plan.""" - - stage: str | None = None - """API stage name of the associated API stage in a usage plan.""" - - throttle: dict[str, ThrottleSettings] | None = None - """ - Map containing method level throttling information for API stage in a - usage plan. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_API_STAGE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.api_id is not None: - serializer.write_string(_SCHEMA_API_STAGE.members["apiId"], self.api_id) - - if self.stage is not None: - serializer.write_string(_SCHEMA_API_STAGE.members["stage"], self.stage) - - if self.throttle is not None: - _serialize_map_of_api_stage_throttle_settings( - serializer, _SCHEMA_API_STAGE.members["throttle"], self.throttle - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["api_id"] = de.read_string( - _SCHEMA_API_STAGE.members["apiId"] - ) - - case 1: - kwargs["stage"] = de.read_string(_SCHEMA_API_STAGE.members["stage"]) - - case 2: - kwargs["throttle"] = ( - _deserialize_map_of_api_stage_throttle_settings( - de, _SCHEMA_API_STAGE.members["throttle"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_API_STAGE, consumer=_consumer) - return kwargs - - -class ApiStatus(UnknownEnumMixin, StrEnum): - UPDATING = "UPDATING" - AVAILABLE = "AVAILABLE" - PENDING = "PENDING" - FAILED = "FAILED" - - -def _serialize_list_of_ar_ns( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_list_of_ar_ns( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -class AuthorizerType(UnknownEnumMixin, StrEnum): - """ - The authorizer type. Valid values are `TOKEN` for a Lambda function - using a single authorization token submitted in a custom header, - `REQUEST` for a Lambda function using incoming request parameters, and - `COGNITO_USER_POOLS` for using an Amazon Cognito user pool. - """ - - TOKEN = "TOKEN" - REQUEST = "REQUEST" - COGNITO_USER_POOLS = "COGNITO_USER_POOLS" - - -@dataclass(kw_only=True) -class Authorizer: - """ - Represents an authorization layer for methods. If enabled on a method, - API Gateway will activate the authorizer when a client calls the method. - """ - - id: str | None = None - """The identifier for the authorizer resource.""" - - name: str | None = None - """The name of the authorizer.""" - - type: str | None = None - """ - The authorizer type. Valid values are `TOKEN` for a Lambda function - using a single authorization token submitted in a custom header, - `REQUEST` for a Lambda function using incoming request parameters, and - `COGNITO_USER_POOLS` for using an Amazon Cognito user pool. - """ - - provider_ar_ns: list[str] | None = None - """ - A list of the Amazon Cognito user pool ARNs for the `COGNITO_USER_POOLS` - authorizer. Each element is of this format: - `arn:aws:cognito-idp:{region}:{account_id}:userpool/{user_pool_id}`. For - a `TOKEN` or `REQUEST` authorizer, this is not defined. - """ - - auth_type: str | None = None - """ - Optional customer-defined field, used in OpenAPI imports and exports - without functional impact. - """ - - authorizer_uri: str | None = None - """ - Specifies the authorizer's Uniform Resource Identifier (URI). For - `TOKEN` or `REQUEST` authorizers, this must be a well-formed Lambda - function URI, for example, - `arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:{account_id}:function:{lambda_function_name}/invocations`. - In general, the URI has this form - `arn:aws:apigateway:{region}:lambda:path/{service_api}`, where - `{region}` is the same as the region hosting the Lambda function, `path` - indicates that the remaining substring in the URI should be treated as - the path to the resource, including the initial `/`. For Lambda - functions, this is usually of the form - `/2015-03-31/functions/[FunctionARN]/invocations`. - """ - - authorizer_credentials: str | None = None - """ - Specifies the required credentials as an IAM role for API Gateway to - invoke the authorizer. To specify an IAM role for API Gateway to assume, - use the role's Amazon Resource Name (ARN). To use resource-based - permissions on the Lambda function, specify null. - """ - - identity_source: str | None = None - """ - The identity source for which authorization is requested. For a `TOKEN` - or `COGNITO_USER_POOLS` authorizer, this is required and specifies the - request header mapping expression for the custom header holding the - authorization token submitted by the client. For example, if the token - header name is `Auth`, the header mapping expression is - `method.request.header.Auth`. For the `REQUEST` authorizer, this is - required when authorization caching is enabled. The value is a - comma-separated string of one or more mapping expressions of the - specified request parameters. For example, if an `Auth` header, a `Name` - query string parameter are defined as identity sources, this value is - `method.request.header.Auth`, `method.request.querystring.Name`. These - parameters will be used to derive the authorization caching key and to - perform runtime validation of the `REQUEST` authorizer by verifying all - of the identity-related request parameters are present, not null and - non-empty. Only when this is true does the authorizer invoke the - authorizer Lambda function, otherwise, it returns a 401 Unauthorized - response without calling the Lambda function. The valid value is a - string of comma-separated mapping expressions of the specified request - parameters. When the authorization caching is not enabled, this property - is optional. - """ - - identity_validation_expression: str | None = None - """ - A validation expression for the incoming identity token. For `TOKEN` - authorizers, this value is a regular expression. For - `COGNITO_USER_POOLS` authorizers, API Gateway will match the `aud` field - of the incoming token from the client against the specified regular - expression. It will invoke the authorizer's Lambda function when there - is a match. Otherwise, it will return a 401 Unauthorized response - without calling the Lambda function. The validation expression does not - apply to the `REQUEST` authorizer. - """ - - authorizer_result_ttl_in_seconds: int | None = None - """ - The TTL in seconds of cached authorizer results. If it equals 0, - authorization caching is disabled. If it is greater than 0, API Gateway - will cache authorizer responses. If this field is not set, the default - value is 300. The maximum value is 3600, or 1 hour. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTHORIZER, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string(_SCHEMA_AUTHORIZER.members["id"], self.id) - - if self.name is not None: - serializer.write_string(_SCHEMA_AUTHORIZER.members["name"], self.name) - - if self.type is not None: - serializer.write_string(_SCHEMA_AUTHORIZER.members["type"], self.type) - - if self.provider_ar_ns is not None: - _serialize_list_of_ar_ns( - serializer, - _SCHEMA_AUTHORIZER.members["providerARNs"], - self.provider_ar_ns, - ) - - if self.auth_type is not None: - serializer.write_string( - _SCHEMA_AUTHORIZER.members["authType"], self.auth_type - ) - - if self.authorizer_uri is not None: - serializer.write_string( - _SCHEMA_AUTHORIZER.members["authorizerUri"], self.authorizer_uri - ) - - if self.authorizer_credentials is not None: - serializer.write_string( - _SCHEMA_AUTHORIZER.members["authorizerCredentials"], - self.authorizer_credentials, - ) - - if self.identity_source is not None: - serializer.write_string( - _SCHEMA_AUTHORIZER.members["identitySource"], self.identity_source - ) - - if self.identity_validation_expression is not None: - serializer.write_string( - _SCHEMA_AUTHORIZER.members["identityValidationExpression"], - self.identity_validation_expression, - ) - - if self.authorizer_result_ttl_in_seconds is not None: - serializer.write_integer( - _SCHEMA_AUTHORIZER.members["authorizerResultTtlInSeconds"], - self.authorizer_result_ttl_in_seconds, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string(_SCHEMA_AUTHORIZER.members["id"]) - - case 1: - kwargs["name"] = de.read_string(_SCHEMA_AUTHORIZER.members["name"]) - - case 2: - kwargs["type"] = AuthorizerType( - de.read_string(_SCHEMA_AUTHORIZER.members["type"]) - ) - - case 3: - kwargs["provider_ar_ns"] = _deserialize_list_of_ar_ns( - de, _SCHEMA_AUTHORIZER.members["providerARNs"] - ) - - case 4: - kwargs["auth_type"] = de.read_string( - _SCHEMA_AUTHORIZER.members["authType"] - ) - - case 5: - kwargs["authorizer_uri"] = de.read_string( - _SCHEMA_AUTHORIZER.members["authorizerUri"] - ) - - case 6: - kwargs["authorizer_credentials"] = de.read_string( - _SCHEMA_AUTHORIZER.members["authorizerCredentials"] - ) - - case 7: - kwargs["identity_source"] = de.read_string( - _SCHEMA_AUTHORIZER.members["identitySource"] - ) - - case 8: - kwargs["identity_validation_expression"] = de.read_string( - _SCHEMA_AUTHORIZER.members["identityValidationExpression"] - ) - - case 9: - kwargs["authorizer_result_ttl_in_seconds"] = de.read_integer( - _SCHEMA_AUTHORIZER.members["authorizerResultTtlInSeconds"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AUTHORIZER, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class BadRequestException(ServiceError): - """ - The submitted request is not valid, for example, the input is incomplete - or incorrect. See the accompanying error message for details. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BAD_REQUEST_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_BAD_REQUEST_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_BAD_REQUEST_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BAD_REQUEST_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ConflictException(ServiceError): - """ - The request configuration has conflicts. For details, see the - accompanying error message. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONFLICT_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_CONFLICT_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_CONFLICT_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONFLICT_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class StageKey: - """ - A reference to a unique stage identified in the format - `{restApiId}/{stage}`. - """ - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - stage_name: str | None = None - """The stage name associated with the stage key.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STAGE_KEY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_STAGE_KEY.members["restApiId"], self.rest_api_id - ) - - if self.stage_name is not None: - serializer.write_string( - _SCHEMA_STAGE_KEY.members["stageName"], self.stage_name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_STAGE_KEY.members["restApiId"] - ) - - case 1: - kwargs["stage_name"] = de.read_string( - _SCHEMA_STAGE_KEY.members["stageName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_STAGE_KEY, consumer=_consumer) - return kwargs - - -def _serialize_list_of_stage_keys( - serializer: ShapeSerializer, schema: Schema, value: list[StageKey] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_list_of_stage_keys( - deserializer: ShapeDeserializer, schema: Schema -) -> list[StageKey]: - result: list[StageKey] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(StageKey.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CreateApiKeyInput: - """Request to create an ApiKey resource.""" - - name: str | None = None - """The name of the ApiKey.""" - - description: str | None = None - """The description of the ApiKey.""" - - enabled: bool = False - """Specifies whether the ApiKey can be used by callers.""" - - generate_distinct_id: bool = False - """ - Specifies whether (`true`) or not (`false`) the key identifier is - distinct from the created API key value. This parameter is deprecated - and should not be used. - """ - - value: str | None = None - """Specifies a value of the API key.""" - - stage_keys: list[StageKey] | None = None - """ - DEPRECATED FOR USAGE PLANS - Specifies stages associated with the API - key. - """ - - customer_id: str | None = None - """ - An Amazon Web Services Marketplace customer identifier, when integrating - with the Amazon Web Services SaaS Marketplace. - """ - - tags: dict[str, str] | None = None - """ - The key-value map of strings. The valid character set is - [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not - start with `aws:`. The tag value can be up to 256 characters. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_API_KEY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_API_KEY_INPUT.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_API_KEY_INPUT.members["description"], self.description - ) - - if self.enabled is not None: - serializer.write_boolean( - _SCHEMA_CREATE_API_KEY_INPUT.members["enabled"], self.enabled - ) - - if self.generate_distinct_id is not None: - serializer.write_boolean( - _SCHEMA_CREATE_API_KEY_INPUT.members["generateDistinctId"], - self.generate_distinct_id, - ) - - if self.value is not None: - serializer.write_string( - _SCHEMA_CREATE_API_KEY_INPUT.members["value"], self.value - ) - - if self.stage_keys is not None: - _serialize_list_of_stage_keys( - serializer, - _SCHEMA_CREATE_API_KEY_INPUT.members["stageKeys"], - self.stage_keys, - ) - - if self.customer_id is not None: - serializer.write_string( - _SCHEMA_CREATE_API_KEY_INPUT.members["customerId"], self.customer_id - ) - - if self.tags is not None: - _serialize_map_of_string_to_string( - serializer, _SCHEMA_CREATE_API_KEY_INPUT.members["tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_API_KEY_INPUT.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_API_KEY_INPUT.members["description"] - ) - - case 2: - kwargs["enabled"] = de.read_boolean( - _SCHEMA_CREATE_API_KEY_INPUT.members["enabled"] - ) - - case 3: - kwargs["generate_distinct_id"] = de.read_boolean( - _SCHEMA_CREATE_API_KEY_INPUT.members["generateDistinctId"] - ) - - case 4: - kwargs["value"] = de.read_string( - _SCHEMA_CREATE_API_KEY_INPUT.members["value"] - ) - - case 5: - kwargs["stage_keys"] = _deserialize_list_of_stage_keys( - de, _SCHEMA_CREATE_API_KEY_INPUT.members["stageKeys"] - ) - - case 6: - kwargs["customer_id"] = de.read_string( - _SCHEMA_CREATE_API_KEY_INPUT.members["customerId"] - ) - - case 7: - kwargs["tags"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_CREATE_API_KEY_INPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_API_KEY_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CreateApiKeyOutput: - """ - A resource that can be distributed to callers for executing Method - resources that require an API key. API keys can be mapped to any Stage - on any RestApi, which indicates that the callers with the API key can - make requests to that stage. - """ - - id: str | None = None - """The identifier of the API Key.""" - - value: str | None = None - """The value of the API Key.""" - - name: str | None = None - """The name of the API Key.""" - - customer_id: str | None = None - """ - An Amazon Web Services Marketplace customer identifier, when integrating - with the Amazon Web Services SaaS Marketplace. - """ - - description: str | None = None - """The description of the API Key.""" - - enabled: bool = False - """Specifies whether the API Key can be used by callers.""" - - created_date: datetime | None = None - """The timestamp when the API Key was created.""" - - last_updated_date: datetime | None = None - """The timestamp when the API Key was last updated.""" - - stage_keys: list[str] | None = None - """A list of Stage resources that are associated with the ApiKey resource.""" - - tags: dict[str, str] | None = None - """ - The collection of tags. Each tag element is associated with a given - resource. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_API_KEY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string( - _SCHEMA_CREATE_API_KEY_OUTPUT.members["id"], self.id - ) - - if self.value is not None: - serializer.write_string( - _SCHEMA_CREATE_API_KEY_OUTPUT.members["value"], self.value - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_API_KEY_OUTPUT.members["name"], self.name - ) - - if self.customer_id is not None: - serializer.write_string( - _SCHEMA_CREATE_API_KEY_OUTPUT.members["customerId"], self.customer_id - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_API_KEY_OUTPUT.members["description"], self.description - ) - - serializer.write_boolean( - _SCHEMA_CREATE_API_KEY_OUTPUT.members["enabled"], self.enabled - ) - if self.created_date is not None: - serializer.write_timestamp( - _SCHEMA_CREATE_API_KEY_OUTPUT.members["createdDate"], self.created_date - ) - - if self.last_updated_date is not None: - serializer.write_timestamp( - _SCHEMA_CREATE_API_KEY_OUTPUT.members["lastUpdatedDate"], - self.last_updated_date, - ) - - if self.stage_keys is not None: - _serialize_list_of_string( - serializer, - _SCHEMA_CREATE_API_KEY_OUTPUT.members["stageKeys"], - self.stage_keys, - ) - - if self.tags is not None: - _serialize_map_of_string_to_string( - serializer, _SCHEMA_CREATE_API_KEY_OUTPUT.members["tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_CREATE_API_KEY_OUTPUT.members["id"] - ) - - case 1: - kwargs["value"] = de.read_string( - _SCHEMA_CREATE_API_KEY_OUTPUT.members["value"] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_API_KEY_OUTPUT.members["name"] - ) - - case 3: - kwargs["customer_id"] = de.read_string( - _SCHEMA_CREATE_API_KEY_OUTPUT.members["customerId"] - ) - - case 4: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_API_KEY_OUTPUT.members["description"] - ) - - case 5: - kwargs["enabled"] = de.read_boolean( - _SCHEMA_CREATE_API_KEY_OUTPUT.members["enabled"] - ) - - case 6: - kwargs["created_date"] = de.read_timestamp( - _SCHEMA_CREATE_API_KEY_OUTPUT.members["createdDate"] - ) - - case 7: - kwargs["last_updated_date"] = de.read_timestamp( - _SCHEMA_CREATE_API_KEY_OUTPUT.members["lastUpdatedDate"] - ) - - case 8: - kwargs["stage_keys"] = _deserialize_list_of_string( - de, _SCHEMA_CREATE_API_KEY_OUTPUT.members["stageKeys"] - ) - - case 9: - kwargs["tags"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_CREATE_API_KEY_OUTPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_API_KEY_OUTPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class LimitExceededException(ServiceError): - """ - The request exceeded the rate limit. Retry after the specified time - period. - """ - - fault: Literal["client", "server"] | None = "client" - - retry_after_seconds: str | None = None - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIMIT_EXCEEDED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.retry_after_seconds is not None: - serializer.write_string( - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION.members["retryAfterSeconds"], - self.retry_after_seconds, - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["retry_after_seconds"] = de.read_string( - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION.members["retryAfterSeconds"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIMIT_EXCEEDED_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class NotFoundException(ServiceError): - """ - The requested resource is not found. Make sure that the request URI is - correct. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_NOT_FOUND_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_NOT_FOUND_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_NOT_FOUND_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_NOT_FOUND_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class TooManyRequestsException(ServiceError): - """ - The request has reached its throttling limit. Retry after the specified - time period. - """ - - fault: Literal["client", "server"] | None = "client" - - retry_after_seconds: str | None = None - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.retry_after_seconds is not None: - serializer.write_string( - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION.members["retryAfterSeconds"], - self.retry_after_seconds, - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["retry_after_seconds"] = de.read_string( - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION.members["retryAfterSeconds"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UnauthorizedException(ServiceError): - """The request is denied because the caller has insufficient permissions.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNAUTHORIZED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_UNAUTHORIZED_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_UNAUTHORIZED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UNAUTHORIZED_EXCEPTION, consumer=_consumer) - return kwargs - - -CREATE_API_KEY = APIOperation( - input=CreateApiKeyInput, - output=CreateApiKeyOutput, - schema=_SCHEMA_CREATE_API_KEY, - input_schema=_SCHEMA_CREATE_API_KEY_INPUT, - output_schema=_SCHEMA_CREATE_API_KEY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class CreateAuthorizerInput: - """Request to add a new Authorizer to an existing RestApi resource.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - name: str | None = None - """The name of the authorizer.""" - - type: str | None = None - """ - The authorizer type. Valid values are `TOKEN` for a Lambda function - using a single authorization token submitted in a custom header, - `REQUEST` for a Lambda function using incoming request parameters, and - `COGNITO_USER_POOLS` for using an Amazon Cognito user pool. - """ - - provider_ar_ns: list[str] | None = None - """ - A list of the Amazon Cognito user pool ARNs for the `COGNITO_USER_POOLS` - authorizer. Each element is of this format: - `arn:aws:cognito-idp:{region}:{account_id}:userpool/{user_pool_id}`. For - a `TOKEN` or `REQUEST` authorizer, this is not defined. - """ - - auth_type: str | None = None - """ - Optional customer-defined field, used in OpenAPI imports and exports - without functional impact. - """ - - authorizer_uri: str | None = None - """ - Specifies the authorizer's Uniform Resource Identifier (URI). For - `TOKEN` or `REQUEST` authorizers, this must be a well-formed Lambda - function URI, for example, - `arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:{account_id}:function:{lambda_function_name}/invocations`. - In general, the URI has this form - `arn:aws:apigateway:{region}:lambda:path/{service_api}`, where - `{region}` is the same as the region hosting the Lambda function, `path` - indicates that the remaining substring in the URI should be treated as - the path to the resource, including the initial `/`. For Lambda - functions, this is usually of the form - `/2015-03-31/functions/[FunctionARN]/invocations`. - """ - - authorizer_credentials: str | None = None - """ - Specifies the required credentials as an IAM role for API Gateway to - invoke the authorizer. To specify an IAM role for API Gateway to assume, - use the role's Amazon Resource Name (ARN). To use resource-based - permissions on the Lambda function, specify null. - """ - - identity_source: str | None = None - """ - The identity source for which authorization is requested. For a `TOKEN` - or `COGNITO_USER_POOLS` authorizer, this is required and specifies the - request header mapping expression for the custom header holding the - authorization token submitted by the client. For example, if the token - header name is `Auth`, the header mapping expression is - `method.request.header.Auth`. For the `REQUEST` authorizer, this is - required when authorization caching is enabled. The value is a - comma-separated string of one or more mapping expressions of the - specified request parameters. For example, if an `Auth` header, a `Name` - query string parameter are defined as identity sources, this value is - `method.request.header.Auth, method.request.querystring.Name`. These - parameters will be used to derive the authorization caching key and to - perform runtime validation of the `REQUEST` authorizer by verifying all - of the identity-related request parameters are present, not null and - non-empty. Only when this is true does the authorizer invoke the - authorizer Lambda function, otherwise, it returns a 401 Unauthorized - response without calling the Lambda function. The valid value is a - string of comma-separated mapping expressions of the specified request - parameters. When the authorization caching is not enabled, this property - is optional. - """ - - identity_validation_expression: str | None = None - """ - A validation expression for the incoming identity token. For `TOKEN` - authorizers, this value is a regular expression. For - `COGNITO_USER_POOLS` authorizers, API Gateway will match the `aud` field - of the incoming token from the client against the specified regular - expression. It will invoke the authorizer's Lambda function when there - is a match. Otherwise, it will return a 401 Unauthorized response - without calling the Lambda function. The validation expression does not - apply to the `REQUEST` authorizer. - """ - - authorizer_result_ttl_in_seconds: int | None = None - """ - The TTL in seconds of cached authorizer results. If it equals 0, - authorization caching is disabled. If it is greater than 0, API Gateway - will cache authorizer responses. If this field is not set, the default - value is 300. The maximum value is 3600, or 1 hour. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_AUTHORIZER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_CREATE_AUTHORIZER_INPUT.members["restApiId"], self.rest_api_id - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_AUTHORIZER_INPUT.members["name"], self.name - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_CREATE_AUTHORIZER_INPUT.members["type"], self.type - ) - - if self.provider_ar_ns is not None: - _serialize_list_of_ar_ns( - serializer, - _SCHEMA_CREATE_AUTHORIZER_INPUT.members["providerARNs"], - self.provider_ar_ns, - ) - - if self.auth_type is not None: - serializer.write_string( - _SCHEMA_CREATE_AUTHORIZER_INPUT.members["authType"], self.auth_type - ) - - if self.authorizer_uri is not None: - serializer.write_string( - _SCHEMA_CREATE_AUTHORIZER_INPUT.members["authorizerUri"], - self.authorizer_uri, - ) - - if self.authorizer_credentials is not None: - serializer.write_string( - _SCHEMA_CREATE_AUTHORIZER_INPUT.members["authorizerCredentials"], - self.authorizer_credentials, - ) - - if self.identity_source is not None: - serializer.write_string( - _SCHEMA_CREATE_AUTHORIZER_INPUT.members["identitySource"], - self.identity_source, - ) - - if self.identity_validation_expression is not None: - serializer.write_string( - _SCHEMA_CREATE_AUTHORIZER_INPUT.members["identityValidationExpression"], - self.identity_validation_expression, - ) - - if self.authorizer_result_ttl_in_seconds is not None: - serializer.write_integer( - _SCHEMA_CREATE_AUTHORIZER_INPUT.members["authorizerResultTtlInSeconds"], - self.authorizer_result_ttl_in_seconds, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_CREATE_AUTHORIZER_INPUT.members["restApiId"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_AUTHORIZER_INPUT.members["name"] - ) - - case 2: - kwargs["type"] = AuthorizerType( - de.read_string(_SCHEMA_CREATE_AUTHORIZER_INPUT.members["type"]) - ) - - case 3: - kwargs["provider_ar_ns"] = _deserialize_list_of_ar_ns( - de, _SCHEMA_CREATE_AUTHORIZER_INPUT.members["providerARNs"] - ) - - case 4: - kwargs["auth_type"] = de.read_string( - _SCHEMA_CREATE_AUTHORIZER_INPUT.members["authType"] - ) - - case 5: - kwargs["authorizer_uri"] = de.read_string( - _SCHEMA_CREATE_AUTHORIZER_INPUT.members["authorizerUri"] - ) - - case 6: - kwargs["authorizer_credentials"] = de.read_string( - _SCHEMA_CREATE_AUTHORIZER_INPUT.members["authorizerCredentials"] - ) - - case 7: - kwargs["identity_source"] = de.read_string( - _SCHEMA_CREATE_AUTHORIZER_INPUT.members["identitySource"] - ) - - case 8: - kwargs["identity_validation_expression"] = de.read_string( - _SCHEMA_CREATE_AUTHORIZER_INPUT.members[ - "identityValidationExpression" - ] - ) - - case 9: - kwargs["authorizer_result_ttl_in_seconds"] = de.read_integer( - _SCHEMA_CREATE_AUTHORIZER_INPUT.members[ - "authorizerResultTtlInSeconds" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_AUTHORIZER_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CreateAuthorizerOutput: - """ - Represents an authorization layer for methods. If enabled on a method, - API Gateway will activate the authorizer when a client calls the method. - """ - - id: str | None = None - """The identifier for the authorizer resource.""" - - name: str | None = None - """The name of the authorizer.""" - - type: str | None = None - """ - The authorizer type. Valid values are `TOKEN` for a Lambda function - using a single authorization token submitted in a custom header, - `REQUEST` for a Lambda function using incoming request parameters, and - `COGNITO_USER_POOLS` for using an Amazon Cognito user pool. - """ - - provider_ar_ns: list[str] | None = None - """ - A list of the Amazon Cognito user pool ARNs for the `COGNITO_USER_POOLS` - authorizer. Each element is of this format: - `arn:aws:cognito-idp:{region}:{account_id}:userpool/{user_pool_id}`. For - a `TOKEN` or `REQUEST` authorizer, this is not defined. - """ - - auth_type: str | None = None - """ - Optional customer-defined field, used in OpenAPI imports and exports - without functional impact. - """ - - authorizer_uri: str | None = None - """ - Specifies the authorizer's Uniform Resource Identifier (URI). For - `TOKEN` or `REQUEST` authorizers, this must be a well-formed Lambda - function URI, for example, - `arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:{account_id}:function:{lambda_function_name}/invocations`. - In general, the URI has this form - `arn:aws:apigateway:{region}:lambda:path/{service_api}`, where - `{region}` is the same as the region hosting the Lambda function, `path` - indicates that the remaining substring in the URI should be treated as - the path to the resource, including the initial `/`. For Lambda - functions, this is usually of the form - `/2015-03-31/functions/[FunctionARN]/invocations`. - """ - - authorizer_credentials: str | None = None - """ - Specifies the required credentials as an IAM role for API Gateway to - invoke the authorizer. To specify an IAM role for API Gateway to assume, - use the role's Amazon Resource Name (ARN). To use resource-based - permissions on the Lambda function, specify null. - """ - - identity_source: str | None = None - """ - The identity source for which authorization is requested. For a `TOKEN` - or `COGNITO_USER_POOLS` authorizer, this is required and specifies the - request header mapping expression for the custom header holding the - authorization token submitted by the client. For example, if the token - header name is `Auth`, the header mapping expression is - `method.request.header.Auth`. For the `REQUEST` authorizer, this is - required when authorization caching is enabled. The value is a - comma-separated string of one or more mapping expressions of the - specified request parameters. For example, if an `Auth` header, a `Name` - query string parameter are defined as identity sources, this value is - `method.request.header.Auth`, `method.request.querystring.Name`. These - parameters will be used to derive the authorization caching key and to - perform runtime validation of the `REQUEST` authorizer by verifying all - of the identity-related request parameters are present, not null and - non-empty. Only when this is true does the authorizer invoke the - authorizer Lambda function, otherwise, it returns a 401 Unauthorized - response without calling the Lambda function. The valid value is a - string of comma-separated mapping expressions of the specified request - parameters. When the authorization caching is not enabled, this property - is optional. - """ - - identity_validation_expression: str | None = None - """ - A validation expression for the incoming identity token. For `TOKEN` - authorizers, this value is a regular expression. For - `COGNITO_USER_POOLS` authorizers, API Gateway will match the `aud` field - of the incoming token from the client against the specified regular - expression. It will invoke the authorizer's Lambda function when there - is a match. Otherwise, it will return a 401 Unauthorized response - without calling the Lambda function. The validation expression does not - apply to the `REQUEST` authorizer. - """ - - authorizer_result_ttl_in_seconds: int | None = None - """ - The TTL in seconds of cached authorizer results. If it equals 0, - authorization caching is disabled. If it is greater than 0, API Gateway - will cache authorizer responses. If this field is not set, the default - value is 300. The maximum value is 3600, or 1 hour. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_AUTHORIZER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string( - _SCHEMA_CREATE_AUTHORIZER_OUTPUT.members["id"], self.id - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_AUTHORIZER_OUTPUT.members["name"], self.name - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_CREATE_AUTHORIZER_OUTPUT.members["type"], self.type - ) - - if self.provider_ar_ns is not None: - _serialize_list_of_ar_ns( - serializer, - _SCHEMA_CREATE_AUTHORIZER_OUTPUT.members["providerARNs"], - self.provider_ar_ns, - ) - - if self.auth_type is not None: - serializer.write_string( - _SCHEMA_CREATE_AUTHORIZER_OUTPUT.members["authType"], self.auth_type - ) - - if self.authorizer_uri is not None: - serializer.write_string( - _SCHEMA_CREATE_AUTHORIZER_OUTPUT.members["authorizerUri"], - self.authorizer_uri, - ) - - if self.authorizer_credentials is not None: - serializer.write_string( - _SCHEMA_CREATE_AUTHORIZER_OUTPUT.members["authorizerCredentials"], - self.authorizer_credentials, - ) - - if self.identity_source is not None: - serializer.write_string( - _SCHEMA_CREATE_AUTHORIZER_OUTPUT.members["identitySource"], - self.identity_source, - ) - - if self.identity_validation_expression is not None: - serializer.write_string( - _SCHEMA_CREATE_AUTHORIZER_OUTPUT.members[ - "identityValidationExpression" - ], - self.identity_validation_expression, - ) - - if self.authorizer_result_ttl_in_seconds is not None: - serializer.write_integer( - _SCHEMA_CREATE_AUTHORIZER_OUTPUT.members[ - "authorizerResultTtlInSeconds" - ], - self.authorizer_result_ttl_in_seconds, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_CREATE_AUTHORIZER_OUTPUT.members["id"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_AUTHORIZER_OUTPUT.members["name"] - ) - - case 2: - kwargs["type"] = AuthorizerType( - de.read_string(_SCHEMA_CREATE_AUTHORIZER_OUTPUT.members["type"]) - ) - - case 3: - kwargs["provider_ar_ns"] = _deserialize_list_of_ar_ns( - de, _SCHEMA_CREATE_AUTHORIZER_OUTPUT.members["providerARNs"] - ) - - case 4: - kwargs["auth_type"] = de.read_string( - _SCHEMA_CREATE_AUTHORIZER_OUTPUT.members["authType"] - ) - - case 5: - kwargs["authorizer_uri"] = de.read_string( - _SCHEMA_CREATE_AUTHORIZER_OUTPUT.members["authorizerUri"] - ) - - case 6: - kwargs["authorizer_credentials"] = de.read_string( - _SCHEMA_CREATE_AUTHORIZER_OUTPUT.members[ - "authorizerCredentials" - ] - ) - - case 7: - kwargs["identity_source"] = de.read_string( - _SCHEMA_CREATE_AUTHORIZER_OUTPUT.members["identitySource"] - ) - - case 8: - kwargs["identity_validation_expression"] = de.read_string( - _SCHEMA_CREATE_AUTHORIZER_OUTPUT.members[ - "identityValidationExpression" - ] - ) - - case 9: - kwargs["authorizer_result_ttl_in_seconds"] = de.read_integer( - _SCHEMA_CREATE_AUTHORIZER_OUTPUT.members[ - "authorizerResultTtlInSeconds" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_AUTHORIZER_OUTPUT, consumer=_consumer) - return kwargs - - -CREATE_AUTHORIZER = APIOperation( - input=CreateAuthorizerInput, - output=CreateAuthorizerOutput, - schema=_SCHEMA_CREATE_AUTHORIZER, - input_schema=_SCHEMA_CREATE_AUTHORIZER_INPUT, - output_schema=_SCHEMA_CREATE_AUTHORIZER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class CreateBasePathMappingInput: - """Requests API Gateway to create a new BasePathMapping resource.""" - - domain_name: str | None = None - """The domain name of the BasePathMapping resource to create.""" - - domain_name_id: str | None = None - """ - The identifier for the domain name resource. Required for private custom - domain names. - """ - - base_path: str | None = None - """ - The base path name that callers of the API must provide as part of the - URL after the domain name. This value must be unique for all of the - mappings across a single API. Specify '(none)' if you do not want - callers to specify a base path name after the domain name. - """ - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - stage: str | None = None - """ - The name of the API's stage that you want to use for this mapping. - Specify '(none)' if you want callers to explicitly specify the stage - name after any base path name. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_BASE_PATH_MAPPING_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.domain_name is not None: - serializer.write_string( - _SCHEMA_CREATE_BASE_PATH_MAPPING_INPUT.members["domainName"], - self.domain_name, - ) - - if self.domain_name_id is not None: - serializer.write_string( - _SCHEMA_CREATE_BASE_PATH_MAPPING_INPUT.members["domainNameId"], - self.domain_name_id, - ) - - if self.base_path is not None: - serializer.write_string( - _SCHEMA_CREATE_BASE_PATH_MAPPING_INPUT.members["basePath"], - self.base_path, - ) - - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_CREATE_BASE_PATH_MAPPING_INPUT.members["restApiId"], - self.rest_api_id, - ) - - if self.stage is not None: - serializer.write_string( - _SCHEMA_CREATE_BASE_PATH_MAPPING_INPUT.members["stage"], self.stage - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["domain_name"] = de.read_string( - _SCHEMA_CREATE_BASE_PATH_MAPPING_INPUT.members["domainName"] - ) - - case 1: - kwargs["domain_name_id"] = de.read_string( - _SCHEMA_CREATE_BASE_PATH_MAPPING_INPUT.members["domainNameId"] - ) - - case 2: - kwargs["base_path"] = de.read_string( - _SCHEMA_CREATE_BASE_PATH_MAPPING_INPUT.members["basePath"] - ) - - case 3: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_CREATE_BASE_PATH_MAPPING_INPUT.members["restApiId"] - ) - - case 4: - kwargs["stage"] = de.read_string( - _SCHEMA_CREATE_BASE_PATH_MAPPING_INPUT.members["stage"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_BASE_PATH_MAPPING_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CreateBasePathMappingOutput: - """ - Represents the base path that callers of the API must provide as part of - the URL after the domain name. - """ - - base_path: str | None = None - """ - The base path name that callers of the API must provide as part of the - URL after the domain name. - """ - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - stage: str | None = None - """The name of the associated stage.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_BASE_PATH_MAPPING_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.base_path is not None: - serializer.write_string( - _SCHEMA_CREATE_BASE_PATH_MAPPING_OUTPUT.members["basePath"], - self.base_path, - ) - - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_CREATE_BASE_PATH_MAPPING_OUTPUT.members["restApiId"], - self.rest_api_id, - ) - - if self.stage is not None: - serializer.write_string( - _SCHEMA_CREATE_BASE_PATH_MAPPING_OUTPUT.members["stage"], self.stage - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["base_path"] = de.read_string( - _SCHEMA_CREATE_BASE_PATH_MAPPING_OUTPUT.members["basePath"] - ) - - case 1: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_CREATE_BASE_PATH_MAPPING_OUTPUT.members["restApiId"] - ) - - case 2: - kwargs["stage"] = de.read_string( - _SCHEMA_CREATE_BASE_PATH_MAPPING_OUTPUT.members["stage"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_BASE_PATH_MAPPING_OUTPUT, consumer=_consumer - ) - return kwargs - - -CREATE_BASE_PATH_MAPPING = APIOperation( - input=CreateBasePathMappingInput, - output=CreateBasePathMappingOutput, - schema=_SCHEMA_CREATE_BASE_PATH_MAPPING, - input_schema=_SCHEMA_CREATE_BASE_PATH_MAPPING_INPUT, - output_schema=_SCHEMA_CREATE_BASE_PATH_MAPPING_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -class CacheClusterSize(UnknownEnumMixin, StrEnum): - """Returns the size of the CacheCluster.""" - - SIZE_0_POINT_5_GB = "0.5" - SIZE_1_POINT_6_GB = "1.6" - SIZE_6_POINT_1_GB = "6.1" - SIZE_13_POINT_5_GB = "13.5" - SIZE_28_POINT_4_GB = "28.4" - SIZE_58_POINT_2_GB = "58.2" - SIZE_118_GB = "118" - SIZE_237_GB = "237" - - -@dataclass(kw_only=True) -class DeploymentCanarySettings: - """The input configuration for a canary deployment.""" - - percent_traffic: float = 0 - """The percentage (0.0-100.0) of traffic routed to the canary deployment.""" - - stage_variable_overrides: dict[str, str] | None = None - """ - A stage variable overrides used for the canary release deployment. They - can override existing stage variables or add new stage variables for the - canary release deployment. These stage variables are represented as a - string-to-string map between stage variable names and their values. - """ - - use_stage_cache: bool = False - """ - A Boolean flag to indicate whether the canary release deployment uses - the stage cache or not. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DEPLOYMENT_CANARY_SETTINGS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_double( - _SCHEMA_DEPLOYMENT_CANARY_SETTINGS.members["percentTraffic"], - self.percent_traffic, - ) - if self.stage_variable_overrides is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_DEPLOYMENT_CANARY_SETTINGS.members["stageVariableOverrides"], - self.stage_variable_overrides, - ) - - serializer.write_boolean( - _SCHEMA_DEPLOYMENT_CANARY_SETTINGS.members["useStageCache"], - self.use_stage_cache, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["percent_traffic"] = de.read_double( - _SCHEMA_DEPLOYMENT_CANARY_SETTINGS.members["percentTraffic"] - ) - - case 1: - kwargs["stage_variable_overrides"] = ( - _deserialize_map_of_string_to_string( - de, - _SCHEMA_DEPLOYMENT_CANARY_SETTINGS.members[ - "stageVariableOverrides" - ], - ) - ) - - case 2: - kwargs["use_stage_cache"] = de.read_boolean( - _SCHEMA_DEPLOYMENT_CANARY_SETTINGS.members["useStageCache"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DEPLOYMENT_CANARY_SETTINGS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CreateDeploymentInput: - """Requests API Gateway to create a Deployment resource.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - stage_name: str | None = None - """The name of the Stage resource for the Deployment resource to create.""" - - stage_description: str | None = None - """ - The description of the Stage resource for the Deployment resource to - create. - """ - - description: str | None = None - """The description for the Deployment resource to create.""" - - cache_cluster_enabled: bool | None = None - """Enables a cache cluster for the Stage resource specified in the input.""" - - cache_cluster_size: str | None = None - """ - The stage's cache capacity in GB. For more information about choosing a - cache size, see [Enabling API caching to enhance - responsiveness](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html). - """ - - variables: dict[str, str] | None = None - """ - A map that defines the stage variables for the Stage resource that is - associated with the new deployment. Variable names can have alphanumeric - and underscore characters, and the values must match - `[A-Za-z0-9-._~:/?#&=,]+`. - """ - - canary_settings: DeploymentCanarySettings | None = None - """ - The input configuration for the canary deployment when the deployment is - a canary release deployment. - """ - - tracing_enabled: bool | None = None - """Specifies whether active tracing with X-ray is enabled for the Stage.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_DEPLOYMENT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_CREATE_DEPLOYMENT_INPUT.members["restApiId"], self.rest_api_id - ) - - if self.stage_name is not None: - serializer.write_string( - _SCHEMA_CREATE_DEPLOYMENT_INPUT.members["stageName"], self.stage_name - ) - - if self.stage_description is not None: - serializer.write_string( - _SCHEMA_CREATE_DEPLOYMENT_INPUT.members["stageDescription"], - self.stage_description, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_DEPLOYMENT_INPUT.members["description"], self.description - ) - - if self.cache_cluster_enabled is not None: - serializer.write_boolean( - _SCHEMA_CREATE_DEPLOYMENT_INPUT.members["cacheClusterEnabled"], - self.cache_cluster_enabled, - ) - - if self.cache_cluster_size is not None: - serializer.write_string( - _SCHEMA_CREATE_DEPLOYMENT_INPUT.members["cacheClusterSize"], - self.cache_cluster_size, - ) - - if self.variables is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_CREATE_DEPLOYMENT_INPUT.members["variables"], - self.variables, - ) - - if self.canary_settings is not None: - serializer.write_struct( - _SCHEMA_CREATE_DEPLOYMENT_INPUT.members["canarySettings"], - self.canary_settings, - ) - - if self.tracing_enabled is not None: - serializer.write_boolean( - _SCHEMA_CREATE_DEPLOYMENT_INPUT.members["tracingEnabled"], - self.tracing_enabled, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_CREATE_DEPLOYMENT_INPUT.members["restApiId"] - ) - - case 1: - kwargs["stage_name"] = de.read_string( - _SCHEMA_CREATE_DEPLOYMENT_INPUT.members["stageName"] - ) - - case 2: - kwargs["stage_description"] = de.read_string( - _SCHEMA_CREATE_DEPLOYMENT_INPUT.members["stageDescription"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_DEPLOYMENT_INPUT.members["description"] - ) - - case 4: - kwargs["cache_cluster_enabled"] = de.read_boolean( - _SCHEMA_CREATE_DEPLOYMENT_INPUT.members["cacheClusterEnabled"] - ) - - case 5: - kwargs["cache_cluster_size"] = CacheClusterSize( - de.read_string( - _SCHEMA_CREATE_DEPLOYMENT_INPUT.members["cacheClusterSize"] - ) - ) - - case 6: - kwargs["variables"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_CREATE_DEPLOYMENT_INPUT.members["variables"] - ) - - case 7: - kwargs["canary_settings"] = DeploymentCanarySettings.deserialize(de) - - case 8: - kwargs["tracing_enabled"] = de.read_boolean( - _SCHEMA_CREATE_DEPLOYMENT_INPUT.members["tracingEnabled"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_DEPLOYMENT_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class MethodSnapshot: - """ - Represents a summary of a Method resource, given a particular date and - time. - """ - - authorization_type: str | None = None - """ - The method's authorization type. Valid values are `NONE` for open - access, `AWS_IAM` for using AWS IAM permissions, `CUSTOM` for using a - custom authorizer, or `COGNITO_USER_POOLS` for using a Cognito user - pool. - """ - - api_key_required: bool = False - """Specifies whether the method requires a valid ApiKey.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_METHOD_SNAPSHOT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.authorization_type is not None: - serializer.write_string( - _SCHEMA_METHOD_SNAPSHOT.members["authorizationType"], - self.authorization_type, - ) - - serializer.write_boolean( - _SCHEMA_METHOD_SNAPSHOT.members["apiKeyRequired"], self.api_key_required - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["authorization_type"] = de.read_string( - _SCHEMA_METHOD_SNAPSHOT.members["authorizationType"] - ) - - case 1: - kwargs["api_key_required"] = de.read_boolean( - _SCHEMA_METHOD_SNAPSHOT.members["apiKeyRequired"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_METHOD_SNAPSHOT, consumer=_consumer) - return kwargs - - -def _serialize_map_of_method_snapshot( - serializer: ShapeSerializer, schema: Schema, value: dict[str, MethodSnapshot] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_struct(value_schema, v)) - - -def _deserialize_map_of_method_snapshot( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, MethodSnapshot]: - result: dict[str, MethodSnapshot] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = MethodSnapshot.deserialize(d) - - deserializer.read_map(schema, _read_value) - return result - - -def _serialize_path_to_map_of_method_snapshot( - serializer: ShapeSerializer, - schema: Schema, - value: dict[str, dict[str, MethodSnapshot]], -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry( - k, lambda vs: _serialize_map_of_method_snapshot(vs, value_schema, v) - ) - - -def _deserialize_path_to_map_of_method_snapshot( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, dict[str, MethodSnapshot]]: - result: dict[str, dict[str, MethodSnapshot]] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = _deserialize_map_of_method_snapshot(d, value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CreateDeploymentOutput: - """ - An immutable representation of a RestApi resource that can be called by - users using Stages. A deployment must be associated with a Stage for it - to be callable over the Internet. - """ - - id: str | None = None - """The identifier for the deployment resource.""" - - description: str | None = None - """The description for the deployment resource.""" - - created_date: datetime | None = None - """The date and time that the deployment resource was created.""" - - api_summary: dict[str, dict[str, MethodSnapshot]] | None = None - """ - A summary of the RestApi at the date and time that the deployment - resource was created. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_DEPLOYMENT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string( - _SCHEMA_CREATE_DEPLOYMENT_OUTPUT.members["id"], self.id - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_DEPLOYMENT_OUTPUT.members["description"], - self.description, - ) - - if self.created_date is not None: - serializer.write_timestamp( - _SCHEMA_CREATE_DEPLOYMENT_OUTPUT.members["createdDate"], - self.created_date, - ) - - if self.api_summary is not None: - _serialize_path_to_map_of_method_snapshot( - serializer, - _SCHEMA_CREATE_DEPLOYMENT_OUTPUT.members["apiSummary"], - self.api_summary, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_CREATE_DEPLOYMENT_OUTPUT.members["id"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_DEPLOYMENT_OUTPUT.members["description"] - ) - - case 2: - kwargs["created_date"] = de.read_timestamp( - _SCHEMA_CREATE_DEPLOYMENT_OUTPUT.members["createdDate"] - ) - - case 3: - kwargs["api_summary"] = _deserialize_path_to_map_of_method_snapshot( - de, _SCHEMA_CREATE_DEPLOYMENT_OUTPUT.members["apiSummary"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_DEPLOYMENT_OUTPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ServiceUnavailableException(ServiceError): - """ - The requested service is not available. For details see the accompanying - error message. Retry after the specified time period. - """ - - fault: Literal["client", "server"] | None = "server" - - retry_after_seconds: str | None = None - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SERVICE_UNAVAILABLE_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.retry_after_seconds is not None: - serializer.write_string( - _SCHEMA_SERVICE_UNAVAILABLE_EXCEPTION.members["retryAfterSeconds"], - self.retry_after_seconds, - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_SERVICE_UNAVAILABLE_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["retry_after_seconds"] = de.read_string( - _SCHEMA_SERVICE_UNAVAILABLE_EXCEPTION.members[ - "retryAfterSeconds" - ] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_SERVICE_UNAVAILABLE_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SERVICE_UNAVAILABLE_EXCEPTION, consumer=_consumer - ) - return kwargs - - -CREATE_DEPLOYMENT = APIOperation( - input=CreateDeploymentInput, - output=CreateDeploymentOutput, - schema=_SCHEMA_CREATE_DEPLOYMENT, - input_schema=_SCHEMA_CREATE_DEPLOYMENT_INPUT, - output_schema=_SCHEMA_CREATE_DEPLOYMENT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#ServiceUnavailableException" - ): ServiceUnavailableException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_UNAVAILABLE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -class DocumentationPartType(UnknownEnumMixin, StrEnum): - API = "API" - AUTHORIZER = "AUTHORIZER" - MODEL = "MODEL" - RESOURCE = "RESOURCE" - METHOD = "METHOD" - PATH_PARAMETER = "PATH_PARAMETER" - QUERY_PARAMETER = "QUERY_PARAMETER" - REQUEST_HEADER = "REQUEST_HEADER" - REQUEST_BODY = "REQUEST_BODY" - RESPONSE = "RESPONSE" - RESPONSE_HEADER = "RESPONSE_HEADER" - RESPONSE_BODY = "RESPONSE_BODY" - - -@dataclass(kw_only=True) -class DocumentationPartLocation: - """Specifies the target API entity to which the documentation applies.""" - - type: str - """ - The type of API entity to which the documentation content applies. Valid - values are `API`, `AUTHORIZER`, `MODEL`, `RESOURCE`, `METHOD`, - `PATH_PARAMETER`, `QUERY_PARAMETER`, `REQUEST_HEADER`, `REQUEST_BODY`, - `RESPONSE`, `RESPONSE_HEADER`, and `RESPONSE_BODY`. Content inheritance - does not apply to any entity of the `API`, `AUTHORIZER`, `METHOD`, - `MODEL`, `REQUEST_BODY`, or `RESOURCE` type. - """ - - path: str | None = None - """ - The URL path of the target. It is a valid field for the API entity types - of `RESOURCE`, `METHOD`, `PATH_PARAMETER`, `QUERY_PARAMETER`, - `REQUEST_HEADER`, `REQUEST_BODY`, `RESPONSE`, `RESPONSE_HEADER`, and - `RESPONSE_BODY`. The default value is `/` for the root resource. When an - applicable child entity inherits the content of another entity of the - same type with more general specifications of the other `location` - attributes, the child entity's `path` attribute must match that of the - parent entity as a prefix. - """ - - method: str | None = None - """ - The HTTP verb of a method. It is a valid field for the API entity types - of `METHOD`, `PATH_PARAMETER`, `QUERY_PARAMETER`, `REQUEST_HEADER`, - `REQUEST_BODY`, `RESPONSE`, `RESPONSE_HEADER`, and `RESPONSE_BODY`. The - default value is `*` for any method. When an applicable child entity - inherits the content of an entity of the same type with more general - specifications of the other `location` attributes, the child entity's - `method` attribute must match that of the parent entity exactly. - """ - - status_code: str | None = None - """ - The HTTP status code of a response. It is a valid field for the API - entity types of `RESPONSE`, `RESPONSE_HEADER`, and `RESPONSE_BODY`. The - default value is `*` for any status code. When an applicable child - entity inherits the content of an entity of the same type with more - general specifications of the other `location` attributes, the child - entity's `statusCode` attribute must match that of the parent entity - exactly. - """ - - name: str | None = None - """ - The name of the targeted API entity. It is a valid and required field - for the API entity types of `AUTHORIZER`, `MODEL`, `PATH_PARAMETER`, - `QUERY_PARAMETER`, `REQUEST_HEADER`, `REQUEST_BODY` and - `RESPONSE_HEADER`. It is an invalid field for any other entity type. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENTATION_PART_LOCATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DOCUMENTATION_PART_LOCATION.members["type"], self.type - ) - if self.path is not None: - serializer.write_string( - _SCHEMA_DOCUMENTATION_PART_LOCATION.members["path"], self.path - ) - - if self.method is not None: - serializer.write_string( - _SCHEMA_DOCUMENTATION_PART_LOCATION.members["method"], self.method - ) - - if self.status_code is not None: - serializer.write_string( - _SCHEMA_DOCUMENTATION_PART_LOCATION.members["statusCode"], - self.status_code, - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_DOCUMENTATION_PART_LOCATION.members["name"], self.name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = DocumentationPartType( - de.read_string( - _SCHEMA_DOCUMENTATION_PART_LOCATION.members["type"] - ) - ) - - case 1: - kwargs["path"] = de.read_string( - _SCHEMA_DOCUMENTATION_PART_LOCATION.members["path"] - ) - - case 2: - kwargs["method"] = de.read_string( - _SCHEMA_DOCUMENTATION_PART_LOCATION.members["method"] - ) - - case 3: - kwargs["status_code"] = de.read_string( - _SCHEMA_DOCUMENTATION_PART_LOCATION.members["statusCode"] - ) - - case 4: - kwargs["name"] = de.read_string( - _SCHEMA_DOCUMENTATION_PART_LOCATION.members["name"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DOCUMENTATION_PART_LOCATION, consumer=_consumer - ) - if "type" not in kwargs: - kwargs["type"] = DocumentationPartType._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class CreateDocumentationPartInput: - """Creates a new documentation part of a given API.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - location: DocumentationPartLocation | None = None - """ - The location of the targeted API entity of the to-be-created - documentation part. - """ - - properties: str | None = None - """ - The new documentation content map of the targeted API entity. Enclosed - key-value pairs are API-specific, but only OpenAPI-compliant key-value - pairs can be exported and, hence, published. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_DOCUMENTATION_PART_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_CREATE_DOCUMENTATION_PART_INPUT.members["restApiId"], - self.rest_api_id, - ) - - if self.location is not None: - serializer.write_struct( - _SCHEMA_CREATE_DOCUMENTATION_PART_INPUT.members["location"], - self.location, - ) - - if self.properties is not None: - serializer.write_string( - _SCHEMA_CREATE_DOCUMENTATION_PART_INPUT.members["properties"], - self.properties, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_CREATE_DOCUMENTATION_PART_INPUT.members["restApiId"] - ) - - case 1: - kwargs["location"] = DocumentationPartLocation.deserialize(de) - - case 2: - kwargs["properties"] = de.read_string( - _SCHEMA_CREATE_DOCUMENTATION_PART_INPUT.members["properties"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_DOCUMENTATION_PART_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CreateDocumentationPartOutput: - """A documentation part for a targeted API entity.""" - - id: str | None = None - """ - The DocumentationPart identifier, generated by API Gateway when the - `DocumentationPart` is created. - """ - - location: DocumentationPartLocation | None = None - """ - The location of the API entity to which the documentation applies. Valid - fields depend on the targeted API entity type. All the valid location - fields are not required. If not explicitly specified, a valid location - field is treated as a wildcard and associated documentation content may - be inherited by matching entities, unless overridden. - """ - - properties: str | None = None - """ - A content map of API-specific key-value pairs describing the targeted - API entity. The map must be encoded as a JSON string, e.g., - `"{ \"description\": \"The API does ...\" }"`. Only OpenAPI-compliant - documentation-related fields from the properties map are exported and, - hence, published as part of the API entity definitions, while the - original documentation parts are exported in a OpenAPI extension of - `x-amazon-apigateway-documentation`. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_DOCUMENTATION_PART_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string( - _SCHEMA_CREATE_DOCUMENTATION_PART_OUTPUT.members["id"], self.id - ) - - if self.location is not None: - serializer.write_struct( - _SCHEMA_CREATE_DOCUMENTATION_PART_OUTPUT.members["location"], - self.location, - ) - - if self.properties is not None: - serializer.write_string( - _SCHEMA_CREATE_DOCUMENTATION_PART_OUTPUT.members["properties"], - self.properties, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_CREATE_DOCUMENTATION_PART_OUTPUT.members["id"] - ) - - case 1: - kwargs["location"] = DocumentationPartLocation.deserialize(de) - - case 2: - kwargs["properties"] = de.read_string( - _SCHEMA_CREATE_DOCUMENTATION_PART_OUTPUT.members["properties"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_DOCUMENTATION_PART_OUTPUT, consumer=_consumer - ) - return kwargs - - -CREATE_DOCUMENTATION_PART = APIOperation( - input=CreateDocumentationPartInput, - output=CreateDocumentationPartOutput, - schema=_SCHEMA_CREATE_DOCUMENTATION_PART, - input_schema=_SCHEMA_CREATE_DOCUMENTATION_PART_INPUT, - output_schema=_SCHEMA_CREATE_DOCUMENTATION_PART_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class CreateDocumentationVersionInput: - """Creates a new documentation version of a given API.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - documentation_version: str | None = None - """The version identifier of the new snapshot.""" - - stage_name: str | None = None - """The stage name to be associated with the new documentation snapshot.""" - - description: str | None = None - """A description about the new documentation snapshot.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_DOCUMENTATION_VERSION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_CREATE_DOCUMENTATION_VERSION_INPUT.members["restApiId"], - self.rest_api_id, - ) - - if self.documentation_version is not None: - serializer.write_string( - _SCHEMA_CREATE_DOCUMENTATION_VERSION_INPUT.members[ - "documentationVersion" - ], - self.documentation_version, - ) - - if self.stage_name is not None: - serializer.write_string( - _SCHEMA_CREATE_DOCUMENTATION_VERSION_INPUT.members["stageName"], - self.stage_name, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_DOCUMENTATION_VERSION_INPUT.members["description"], - self.description, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_CREATE_DOCUMENTATION_VERSION_INPUT.members["restApiId"] - ) - - case 1: - kwargs["documentation_version"] = de.read_string( - _SCHEMA_CREATE_DOCUMENTATION_VERSION_INPUT.members[ - "documentationVersion" - ] - ) - - case 2: - kwargs["stage_name"] = de.read_string( - _SCHEMA_CREATE_DOCUMENTATION_VERSION_INPUT.members["stageName"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_DOCUMENTATION_VERSION_INPUT.members[ - "description" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_DOCUMENTATION_VERSION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CreateDocumentationVersionOutput: - """A snapshot of the documentation of an API.""" - - version: str | None = None - """The version identifier of the API documentation snapshot.""" - - created_date: datetime | None = None - """The date when the API documentation snapshot is created.""" - - description: str | None = None - """The description of the API documentation snapshot.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_DOCUMENTATION_VERSION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.version is not None: - serializer.write_string( - _SCHEMA_CREATE_DOCUMENTATION_VERSION_OUTPUT.members["version"], - self.version, - ) - - if self.created_date is not None: - serializer.write_timestamp( - _SCHEMA_CREATE_DOCUMENTATION_VERSION_OUTPUT.members["createdDate"], - self.created_date, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_DOCUMENTATION_VERSION_OUTPUT.members["description"], - self.description, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["version"] = de.read_string( - _SCHEMA_CREATE_DOCUMENTATION_VERSION_OUTPUT.members["version"] - ) - - case 1: - kwargs["created_date"] = de.read_timestamp( - _SCHEMA_CREATE_DOCUMENTATION_VERSION_OUTPUT.members[ - "createdDate" - ] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_DOCUMENTATION_VERSION_OUTPUT.members[ - "description" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_DOCUMENTATION_VERSION_OUTPUT, consumer=_consumer - ) - return kwargs - - -CREATE_DOCUMENTATION_VERSION = APIOperation( - input=CreateDocumentationVersionInput, - output=CreateDocumentationVersionOutput, - schema=_SCHEMA_CREATE_DOCUMENTATION_VERSION, - input_schema=_SCHEMA_CREATE_DOCUMENTATION_VERSION_INPUT, - output_schema=_SCHEMA_CREATE_DOCUMENTATION_VERSION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -class EndpointAccessMode(UnknownEnumMixin, StrEnum): - BASIC = "BASIC" - STRICT = "STRICT" - - -class IpAddressType(UnknownEnumMixin, StrEnum): - IPV4 = "ipv4" - DUALSTACK = "dualstack" - - -class EndpointType(UnknownEnumMixin, StrEnum): - """ - The endpoint type. The valid values are `EDGE` for edge-optimized API - setup, most suitable for mobile applications; `REGIONAL` for regional - API endpoint setup, most suitable for calling from AWS Region; and - `PRIVATE` for private APIs. - """ - - REGIONAL = "REGIONAL" - EDGE = "EDGE" - PRIVATE = "PRIVATE" - - -def _serialize_list_of_endpoint_type( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_list_of_endpoint_type( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(EndpointType(d.read_string(member_schema))) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class EndpointConfiguration: - """ - The endpoint configuration to indicate the types of endpoints an API - (RestApi) or its custom domain name (DomainName) has and the IP address - types that can invoke it. - """ - - types: list[str] | None = None - """ - A list of endpoint types of an API (RestApi) or its custom domain name - (DomainName). For an edge-optimized API and its custom domain name, the - endpoint type is `"EDGE"`. For a regional API and its custom domain - name, the endpoint type is `REGIONAL`. For a private API, the endpoint - type is `PRIVATE`. - """ - - ip_address_type: str | None = None - """ - The IP address types that can invoke an API (RestApi) or a DomainName. - Use `ipv4` to allow only IPv4 addresses to invoke an API or DomainName, - or use `dualstack` to allow both IPv4 and IPv6 addresses to invoke an - API or a DomainName. For the `PRIVATE` endpoint type, only `dualstack` - is supported. - """ - - vpc_endpoint_ids: list[str] | None = None - """ - A list of VpcEndpointIds of an API (RestApi) against which to create - Route53 ALIASes. It is only supported for `PRIVATE` endpoint type. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ENDPOINT_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.types is not None: - _serialize_list_of_endpoint_type( - serializer, _SCHEMA_ENDPOINT_CONFIGURATION.members["types"], self.types - ) - - if self.ip_address_type is not None: - serializer.write_string( - _SCHEMA_ENDPOINT_CONFIGURATION.members["ipAddressType"], - self.ip_address_type, - ) - - if self.vpc_endpoint_ids is not None: - _serialize_list_of_string( - serializer, - _SCHEMA_ENDPOINT_CONFIGURATION.members["vpcEndpointIds"], - self.vpc_endpoint_ids, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["types"] = _deserialize_list_of_endpoint_type( - de, _SCHEMA_ENDPOINT_CONFIGURATION.members["types"] - ) - - case 1: - kwargs["ip_address_type"] = IpAddressType( - de.read_string( - _SCHEMA_ENDPOINT_CONFIGURATION.members["ipAddressType"] - ) - ) - - case 2: - kwargs["vpc_endpoint_ids"] = _deserialize_list_of_string( - de, _SCHEMA_ENDPOINT_CONFIGURATION.members["vpcEndpointIds"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ENDPOINT_CONFIGURATION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class MutualTlsAuthenticationInput: - """ - The mutual TLS authentication configuration for a custom domain name. If - specified, API Gateway performs two-way authentication between the - client and the server. Clients must present a trusted certificate to - access your API. - """ - - truststore_uri: str | None = None - """ - An Amazon S3 URL that specifies the truststore for mutual TLS - authentication, for example `s3://bucket-name/key-name`. The truststore - can contain certificates from public or private certificate authorities. - To update the truststore, upload a new version to S3, and then update - your custom domain name to use the new version. To update the - truststore, you must have permissions to access the S3 object. - """ - - truststore_version: str | None = None - """ - The version of the S3 object that contains your truststore. To specify a - version, you must have versioning enabled for the S3 bucket - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MUTUAL_TLS_AUTHENTICATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.truststore_uri is not None: - serializer.write_string( - _SCHEMA_MUTUAL_TLS_AUTHENTICATION_INPUT.members["truststoreUri"], - self.truststore_uri, - ) - - if self.truststore_version is not None: - serializer.write_string( - _SCHEMA_MUTUAL_TLS_AUTHENTICATION_INPUT.members["truststoreVersion"], - self.truststore_version, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["truststore_uri"] = de.read_string( - _SCHEMA_MUTUAL_TLS_AUTHENTICATION_INPUT.members["truststoreUri"] - ) - - case 1: - kwargs["truststore_version"] = de.read_string( - _SCHEMA_MUTUAL_TLS_AUTHENTICATION_INPUT.members[ - "truststoreVersion" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MUTUAL_TLS_AUTHENTICATION_INPUT, consumer=_consumer - ) - return kwargs - - -class RoutingMode(UnknownEnumMixin, StrEnum): - BASE_PATH_MAPPING_ONLY = "BASE_PATH_MAPPING_ONLY" - ROUTING_RULE_ONLY = "ROUTING_RULE_ONLY" - ROUTING_RULE_THEN_BASE_PATH_MAPPING = "ROUTING_RULE_THEN_BASE_PATH_MAPPING" - - -class SecurityPolicy(UnknownEnumMixin, StrEnum): - TLS_1_0 = "TLS_1_0" - TLS_1_2 = "TLS_1_2" - SECURITY_POLICY_TLS13_1_3_2025_09 = "SecurityPolicy_TLS13_1_3_2025_09" - SECURITY_POLICY_TLS13_1_3_FIPS_2025_09 = "SecurityPolicy_TLS13_1_3_FIPS_2025_09" - SECURITY_POLICY_TLS13_1_2_PFS_PQ_2025_09 = "SecurityPolicy_TLS13_1_2_PFS_PQ_2025_09" - SECURITY_POLICY_TLS13_1_2_FIPS_PQ_2025_09 = ( - "SecurityPolicy_TLS13_1_2_FIPS_PQ_2025_09" - ) - SECURITY_POLICY_TLS13_1_2_FIPS_PFS_PQ_2025_09 = ( - "SecurityPolicy_TLS13_1_2_FIPS_PFS_PQ_2025_09" - ) - SECURITY_POLICY_TLS13_1_2_EXT2_PQ_2025_09 = ( - "SecurityPolicy_TLS13_1_2_Ext2_PQ_2025_09" - ) - SECURITY_POLICY_TLS13_1_2_EXT2_FIPS_PQ_2025_09 = ( - "SecurityPolicy_TLS13_1_2_Ext2_FIPS_PQ_2025_09" - ) - SECURITY_POLICY_TLS13_1_2_PQ_2025_09 = "SecurityPolicy_TLS13_1_2_PQ_2025_09" - SECURITY_POLICY_TLS13_1_2_2021_06 = "SecurityPolicy_TLS13_1_2_2021_06" - SECURITY_POLICY_TLS13_2025_EDGE = "SecurityPolicy_TLS13_2025_EDGE" - SECURITY_POLICY_TLS12_PFS_2025_EDGE = "SecurityPolicy_TLS12_PFS_2025_EDGE" - SECURITY_POLICY_TLS12_2018_EDGE = "SecurityPolicy_TLS12_2018_EDGE" - - -@dataclass(kw_only=True) -class CreateDomainNameInput: - """A request to create a new domain name.""" - - domain_name: str | None = None - """The name of the DomainName resource.""" - - certificate_name: str | None = None - """ - The user-friendly name of the certificate that will be used by - edge-optimized endpoint or private endpoint for this domain name. - """ - - certificate_body: str | None = None - """ - [Deprecated] The body of the server certificate that will be used by - edge-optimized endpoint or private endpoint for this domain name - provided by your certificate authority. - """ - - certificate_private_key: str | None = None - """ - [Deprecated] Your edge-optimized endpoint's domain name - certificate's private key. - """ - - certificate_chain: str | None = None - """ - [Deprecated] The intermediate certificates and optionally the root - certificate, one after the other without any blank lines, used by an - edge-optimized endpoint for this domain name. If you include the root - certificate, your certificate chain must start with intermediate - certificates and end with the root certificate. Use the intermediate - certificates that were provided by your certificate authority. Do not - include any intermediaries that are not in the chain of trust path. - """ - - certificate_arn: str | None = None - """ - The reference to an Amazon Web Services-managed certificate that will be - used by edge-optimized endpoint or private endpoint for this domain - name. Certificate Manager is the only supported source. - """ - - regional_certificate_name: str | None = None - """ - The user-friendly name of the certificate that will be used by regional - endpoint for this domain name. - """ - - regional_certificate_arn: str | None = None - """ - The reference to an Amazon Web Services-managed certificate that will be - used by regional endpoint for this domain name. Certificate Manager is - the only supported source. - """ - - endpoint_configuration: EndpointConfiguration | None = None - """ - The endpoint configuration of this DomainName showing the endpoint types - and IP address types of the domain name. - """ - - tags: dict[str, str] | None = None - """ - The key-value map of strings. The valid character set is - [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not - start with `aws:`. The tag value can be up to 256 characters. - """ - - security_policy: str | None = None - """ - The Transport Layer Security (TLS) version + cipher suite for this - DomainName. - """ - - endpoint_access_mode: str | None = None - """ - The endpoint access mode of the DomainName. Only available for - DomainNames that use security policies that start with - `SecurityPolicy_`. - """ - - mutual_tls_authentication: MutualTlsAuthenticationInput | None = None - """ - The mutual TLS authentication configuration for a custom domain name. If - specified, API Gateway performs two-way authentication between the - client and the server. Clients must present a trusted certificate to - access your API. - """ - - ownership_verification_certificate_arn: str | None = None - """ - The ARN of the public certificate issued by ACM to validate ownership of - your custom domain. Only required when configuring mutual TLS and using - an ACM imported or private CA certificate ARN as the - regionalCertificateArn. - """ - - policy: str | None = None - """ - A stringified JSON policy document that applies to the `execute-api` - service for this DomainName regardless of the caller and Method - configuration. Supported only for private custom domain names. - """ - - routing_mode: str | None = None - """ - The routing mode for this domain name. The routing mode determines how - API Gateway sends traffic from your custom domain name to your private - APIs. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_DOMAIN_NAME_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.domain_name is not None: - serializer.write_string( - _SCHEMA_CREATE_DOMAIN_NAME_INPUT.members["domainName"], self.domain_name - ) - - if self.certificate_name is not None: - serializer.write_string( - _SCHEMA_CREATE_DOMAIN_NAME_INPUT.members["certificateName"], - self.certificate_name, - ) - - if self.certificate_body is not None: - serializer.write_string( - _SCHEMA_CREATE_DOMAIN_NAME_INPUT.members["certificateBody"], - self.certificate_body, - ) - - if self.certificate_private_key is not None: - serializer.write_string( - _SCHEMA_CREATE_DOMAIN_NAME_INPUT.members["certificatePrivateKey"], - self.certificate_private_key, - ) - - if self.certificate_chain is not None: - serializer.write_string( - _SCHEMA_CREATE_DOMAIN_NAME_INPUT.members["certificateChain"], - self.certificate_chain, - ) - - if self.certificate_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_DOMAIN_NAME_INPUT.members["certificateArn"], - self.certificate_arn, - ) - - if self.regional_certificate_name is not None: - serializer.write_string( - _SCHEMA_CREATE_DOMAIN_NAME_INPUT.members["regionalCertificateName"], - self.regional_certificate_name, - ) - - if self.regional_certificate_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_DOMAIN_NAME_INPUT.members["regionalCertificateArn"], - self.regional_certificate_arn, - ) - - if self.endpoint_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_DOMAIN_NAME_INPUT.members["endpointConfiguration"], - self.endpoint_configuration, - ) - - if self.tags is not None: - _serialize_map_of_string_to_string( - serializer, _SCHEMA_CREATE_DOMAIN_NAME_INPUT.members["tags"], self.tags - ) - - if self.security_policy is not None: - serializer.write_string( - _SCHEMA_CREATE_DOMAIN_NAME_INPUT.members["securityPolicy"], - self.security_policy, - ) - - if self.endpoint_access_mode is not None: - serializer.write_string( - _SCHEMA_CREATE_DOMAIN_NAME_INPUT.members["endpointAccessMode"], - self.endpoint_access_mode, - ) - - if self.mutual_tls_authentication is not None: - serializer.write_struct( - _SCHEMA_CREATE_DOMAIN_NAME_INPUT.members["mutualTlsAuthentication"], - self.mutual_tls_authentication, - ) - - if self.ownership_verification_certificate_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_DOMAIN_NAME_INPUT.members[ - "ownershipVerificationCertificateArn" - ], - self.ownership_verification_certificate_arn, - ) - - if self.policy is not None: - serializer.write_string( - _SCHEMA_CREATE_DOMAIN_NAME_INPUT.members["policy"], self.policy - ) - - if self.routing_mode is not None: - serializer.write_string( - _SCHEMA_CREATE_DOMAIN_NAME_INPUT.members["routingMode"], - self.routing_mode, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["domain_name"] = de.read_string( - _SCHEMA_CREATE_DOMAIN_NAME_INPUT.members["domainName"] - ) - - case 1: - kwargs["certificate_name"] = de.read_string( - _SCHEMA_CREATE_DOMAIN_NAME_INPUT.members["certificateName"] - ) - - case 2: - kwargs["certificate_body"] = de.read_string( - _SCHEMA_CREATE_DOMAIN_NAME_INPUT.members["certificateBody"] - ) - - case 3: - kwargs["certificate_private_key"] = de.read_string( - _SCHEMA_CREATE_DOMAIN_NAME_INPUT.members[ - "certificatePrivateKey" - ] - ) - - case 4: - kwargs["certificate_chain"] = de.read_string( - _SCHEMA_CREATE_DOMAIN_NAME_INPUT.members["certificateChain"] - ) - - case 5: - kwargs["certificate_arn"] = de.read_string( - _SCHEMA_CREATE_DOMAIN_NAME_INPUT.members["certificateArn"] - ) - - case 6: - kwargs["regional_certificate_name"] = de.read_string( - _SCHEMA_CREATE_DOMAIN_NAME_INPUT.members[ - "regionalCertificateName" - ] - ) - - case 7: - kwargs["regional_certificate_arn"] = de.read_string( - _SCHEMA_CREATE_DOMAIN_NAME_INPUT.members[ - "regionalCertificateArn" - ] - ) - - case 8: - kwargs["endpoint_configuration"] = ( - EndpointConfiguration.deserialize(de) - ) - - case 9: - kwargs["tags"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_CREATE_DOMAIN_NAME_INPUT.members["tags"] - ) - - case 10: - kwargs["security_policy"] = SecurityPolicy( - de.read_string( - _SCHEMA_CREATE_DOMAIN_NAME_INPUT.members["securityPolicy"] - ) - ) - - case 11: - kwargs["endpoint_access_mode"] = EndpointAccessMode( - de.read_string( - _SCHEMA_CREATE_DOMAIN_NAME_INPUT.members[ - "endpointAccessMode" - ] - ) - ) - - case 12: - kwargs["mutual_tls_authentication"] = ( - MutualTlsAuthenticationInput.deserialize(de) - ) - - case 13: - kwargs["ownership_verification_certificate_arn"] = de.read_string( - _SCHEMA_CREATE_DOMAIN_NAME_INPUT.members[ - "ownershipVerificationCertificateArn" - ] - ) - - case 14: - kwargs["policy"] = de.read_string( - _SCHEMA_CREATE_DOMAIN_NAME_INPUT.members["policy"] - ) - - case 15: - kwargs["routing_mode"] = RoutingMode( - de.read_string( - _SCHEMA_CREATE_DOMAIN_NAME_INPUT.members["routingMode"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_DOMAIN_NAME_INPUT, consumer=_consumer) - return kwargs - - -class DomainNameStatus(UnknownEnumMixin, StrEnum): - AVAILABLE = "AVAILABLE" - UPDATING = "UPDATING" - PENDING = "PENDING" - PENDING_CERTIFICATE_REIMPORT = "PENDING_CERTIFICATE_REIMPORT" - PENDING_OWNERSHIP_VERIFICATION = "PENDING_OWNERSHIP_VERIFICATION" - FAILED = "FAILED" - - -@dataclass(kw_only=True) -class MutualTlsAuthentication: - """ - The mutual TLS authentication configuration for a custom domain name. If - specified, API Gateway performs two-way authentication between the - client and the server. Clients must present a trusted certificate to - access your API. - """ - - truststore_uri: str | None = None - """ - An Amazon S3 URL that specifies the truststore for mutual TLS - authentication, for example `s3://bucket-name/key-name`. The truststore - can contain certificates from public or private certificate authorities. - To update the truststore, upload a new version to S3, and then update - your custom domain name to use the new version. To update the - truststore, you must have permissions to access the S3 object. - """ - - truststore_version: str | None = None - """ - The version of the S3 object that contains your truststore. To specify a - version, you must have versioning enabled for the S3 bucket. - """ - - truststore_warnings: list[str] | None = None - """ - A list of warnings that API Gateway returns while processing your - truststore. Invalid certificates produce warnings. Mutual TLS is still - enabled, but some clients might not be able to access your API. To - resolve warnings, upload a new truststore to S3, and then update you - domain name to use the new version. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MUTUAL_TLS_AUTHENTICATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.truststore_uri is not None: - serializer.write_string( - _SCHEMA_MUTUAL_TLS_AUTHENTICATION.members["truststoreUri"], - self.truststore_uri, - ) - - if self.truststore_version is not None: - serializer.write_string( - _SCHEMA_MUTUAL_TLS_AUTHENTICATION.members["truststoreVersion"], - self.truststore_version, - ) - - if self.truststore_warnings is not None: - _serialize_list_of_string( - serializer, - _SCHEMA_MUTUAL_TLS_AUTHENTICATION.members["truststoreWarnings"], - self.truststore_warnings, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["truststore_uri"] = de.read_string( - _SCHEMA_MUTUAL_TLS_AUTHENTICATION.members["truststoreUri"] - ) - - case 1: - kwargs["truststore_version"] = de.read_string( - _SCHEMA_MUTUAL_TLS_AUTHENTICATION.members["truststoreVersion"] - ) - - case 2: - kwargs["truststore_warnings"] = _deserialize_list_of_string( - de, - _SCHEMA_MUTUAL_TLS_AUTHENTICATION.members["truststoreWarnings"], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MUTUAL_TLS_AUTHENTICATION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CreateDomainNameOutput: - """ - Represents a custom domain name as a user-friendly host name of an API - (RestApi). - """ - - domain_name: str | None = None - """ - The custom domain name as an API host name, for example, - `my-api.example.com`. - """ - - domain_name_id: str | None = None - """ - The identifier for the domain name resource. Supported only for private - custom domain names. - """ - - domain_name_arn: str | None = None - """The ARN of the domain name.""" - - certificate_name: str | None = None - """ - The name of the certificate that will be used by edge-optimized endpoint - or private endpoint for this domain name. - """ - - certificate_arn: str | None = None - """ - The reference to an Amazon Web Services-managed certificate that will be - used by edge-optimized endpoint or private endpoint for this domain - name. Certificate Manager is the only supported source. - """ - - certificate_upload_date: datetime | None = None - """ - The timestamp when the certificate that was used by edge-optimized - endpoint or private endpoint for this domain name was uploaded. - """ - - regional_domain_name: str | None = None - """ - The domain name associated with the regional endpoint for this custom - domain name. You set up this association by adding a DNS record that - points the custom domain name to this regional domain name. The regional - domain name is returned by API Gateway when you create a regional - endpoint. - """ - - regional_hosted_zone_id: str | None = None - """ - The region-specific Amazon Route 53 Hosted Zone ID of the regional - endpoint. For more information, see Set up a Regional Custom Domain Name - and AWS Regions and Endpoints for API Gateway. - """ - - regional_certificate_name: str | None = None - """ - The name of the certificate that will be used for validating the - regional domain name. - """ - - regional_certificate_arn: str | None = None - """ - The reference to an Amazon Web Services-managed certificate that will be - used for validating the regional domain name. Certificate Manager is the - only supported source. - """ - - distribution_domain_name: str | None = None - """ - The domain name of the Amazon CloudFront distribution associated with - this custom domain name for an edge-optimized endpoint. You set up this - association when adding a DNS record pointing the custom domain name to - this distribution name. For more information about CloudFront - distributions, see the Amazon CloudFront documentation. - """ - - distribution_hosted_zone_id: str | None = None - """ - The region-agnostic Amazon Route 53 Hosted Zone ID of the edge-optimized - endpoint. The valid value is `Z2FDTNDATAQYW2` for all the regions. For - more information, see Set up a Regional Custom Domain Name and AWS - Regions and Endpoints for API Gateway. - """ - - endpoint_configuration: EndpointConfiguration | None = None - """ - The endpoint configuration of this DomainName showing the endpoint types - and IP address types of the domain name. - """ - - domain_name_status: str | None = None - """ - The status of the DomainName migration. The valid values are `AVAILABLE` - and `UPDATING`. If the status is `UPDATING`, the domain cannot be - modified further until the existing operation is complete. If it is - `AVAILABLE`, the domain can be updated. - """ - - domain_name_status_message: str | None = None - """ - An optional text message containing detailed information about status of - the DomainName migration. - """ - - security_policy: str | None = None - """ - The Transport Layer Security (TLS) version + cipher suite for this - DomainName. - """ - - endpoint_access_mode: str | None = None - """The endpoint access mode of the DomainName.""" - - tags: dict[str, str] | None = None - """ - The collection of tags. Each tag element is associated with a given - resource. - """ - - mutual_tls_authentication: MutualTlsAuthentication | None = None - """ - The mutual TLS authentication configuration for a custom domain name. If - specified, API Gateway performs two-way authentication between the - client and the server. Clients must present a trusted certificate to - access your API. - """ - - ownership_verification_certificate_arn: str | None = None - """ - The ARN of the public certificate issued by ACM to validate ownership of - your custom domain. Only required when configuring mutual TLS and using - an ACM imported or private CA certificate ARN as the - regionalCertificateArn. - """ - - management_policy: str | None = None - """ - A stringified JSON policy document that applies to the API Gateway - Management service for this DomainName. This policy document controls - access for access association sources to create domain name access - associations with this DomainName. Supported only for private custom - domain names. - """ - - policy: str | None = None - """ - A stringified JSON policy document that applies to the `execute-api` - service for this DomainName regardless of the caller and Method - configuration. Supported only for private custom domain names. - """ - - routing_mode: str | None = None - """ - The routing mode for this domain name. The routing mode determines how - API Gateway sends traffic from your custom domain name to your private - APIs. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_DOMAIN_NAME_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.domain_name is not None: - serializer.write_string( - _SCHEMA_CREATE_DOMAIN_NAME_OUTPUT.members["domainName"], - self.domain_name, - ) - - if self.domain_name_id is not None: - serializer.write_string( - _SCHEMA_CREATE_DOMAIN_NAME_OUTPUT.members["domainNameId"], - self.domain_name_id, - ) - - if self.domain_name_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_DOMAIN_NAME_OUTPUT.members["domainNameArn"], - self.domain_name_arn, - ) - - if self.certificate_name is not None: - serializer.write_string( - _SCHEMA_CREATE_DOMAIN_NAME_OUTPUT.members["certificateName"], - self.certificate_name, - ) - - if self.certificate_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_DOMAIN_NAME_OUTPUT.members["certificateArn"], - self.certificate_arn, - ) - - if self.certificate_upload_date is not None: - serializer.write_timestamp( - _SCHEMA_CREATE_DOMAIN_NAME_OUTPUT.members["certificateUploadDate"], - self.certificate_upload_date, - ) - - if self.regional_domain_name is not None: - serializer.write_string( - _SCHEMA_CREATE_DOMAIN_NAME_OUTPUT.members["regionalDomainName"], - self.regional_domain_name, - ) - - if self.regional_hosted_zone_id is not None: - serializer.write_string( - _SCHEMA_CREATE_DOMAIN_NAME_OUTPUT.members["regionalHostedZoneId"], - self.regional_hosted_zone_id, - ) - - if self.regional_certificate_name is not None: - serializer.write_string( - _SCHEMA_CREATE_DOMAIN_NAME_OUTPUT.members["regionalCertificateName"], - self.regional_certificate_name, - ) - - if self.regional_certificate_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_DOMAIN_NAME_OUTPUT.members["regionalCertificateArn"], - self.regional_certificate_arn, - ) - - if self.distribution_domain_name is not None: - serializer.write_string( - _SCHEMA_CREATE_DOMAIN_NAME_OUTPUT.members["distributionDomainName"], - self.distribution_domain_name, - ) - - if self.distribution_hosted_zone_id is not None: - serializer.write_string( - _SCHEMA_CREATE_DOMAIN_NAME_OUTPUT.members["distributionHostedZoneId"], - self.distribution_hosted_zone_id, - ) - - if self.endpoint_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_DOMAIN_NAME_OUTPUT.members["endpointConfiguration"], - self.endpoint_configuration, - ) - - if self.domain_name_status is not None: - serializer.write_string( - _SCHEMA_CREATE_DOMAIN_NAME_OUTPUT.members["domainNameStatus"], - self.domain_name_status, - ) - - if self.domain_name_status_message is not None: - serializer.write_string( - _SCHEMA_CREATE_DOMAIN_NAME_OUTPUT.members["domainNameStatusMessage"], - self.domain_name_status_message, - ) - - if self.security_policy is not None: - serializer.write_string( - _SCHEMA_CREATE_DOMAIN_NAME_OUTPUT.members["securityPolicy"], - self.security_policy, - ) - - if self.endpoint_access_mode is not None: - serializer.write_string( - _SCHEMA_CREATE_DOMAIN_NAME_OUTPUT.members["endpointAccessMode"], - self.endpoint_access_mode, - ) - - if self.tags is not None: - _serialize_map_of_string_to_string( - serializer, _SCHEMA_CREATE_DOMAIN_NAME_OUTPUT.members["tags"], self.tags - ) - - if self.mutual_tls_authentication is not None: - serializer.write_struct( - _SCHEMA_CREATE_DOMAIN_NAME_OUTPUT.members["mutualTlsAuthentication"], - self.mutual_tls_authentication, - ) - - if self.ownership_verification_certificate_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_DOMAIN_NAME_OUTPUT.members[ - "ownershipVerificationCertificateArn" - ], - self.ownership_verification_certificate_arn, - ) - - if self.management_policy is not None: - serializer.write_string( - _SCHEMA_CREATE_DOMAIN_NAME_OUTPUT.members["managementPolicy"], - self.management_policy, - ) - - if self.policy is not None: - serializer.write_string( - _SCHEMA_CREATE_DOMAIN_NAME_OUTPUT.members["policy"], self.policy - ) - - if self.routing_mode is not None: - serializer.write_string( - _SCHEMA_CREATE_DOMAIN_NAME_OUTPUT.members["routingMode"], - self.routing_mode, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["domain_name"] = de.read_string( - _SCHEMA_CREATE_DOMAIN_NAME_OUTPUT.members["domainName"] - ) - - case 1: - kwargs["domain_name_id"] = de.read_string( - _SCHEMA_CREATE_DOMAIN_NAME_OUTPUT.members["domainNameId"] - ) - - case 2: - kwargs["domain_name_arn"] = de.read_string( - _SCHEMA_CREATE_DOMAIN_NAME_OUTPUT.members["domainNameArn"] - ) - - case 3: - kwargs["certificate_name"] = de.read_string( - _SCHEMA_CREATE_DOMAIN_NAME_OUTPUT.members["certificateName"] - ) - - case 4: - kwargs["certificate_arn"] = de.read_string( - _SCHEMA_CREATE_DOMAIN_NAME_OUTPUT.members["certificateArn"] - ) - - case 5: - kwargs["certificate_upload_date"] = de.read_timestamp( - _SCHEMA_CREATE_DOMAIN_NAME_OUTPUT.members[ - "certificateUploadDate" - ] - ) - - case 6: - kwargs["regional_domain_name"] = de.read_string( - _SCHEMA_CREATE_DOMAIN_NAME_OUTPUT.members["regionalDomainName"] - ) - - case 7: - kwargs["regional_hosted_zone_id"] = de.read_string( - _SCHEMA_CREATE_DOMAIN_NAME_OUTPUT.members[ - "regionalHostedZoneId" - ] - ) - - case 8: - kwargs["regional_certificate_name"] = de.read_string( - _SCHEMA_CREATE_DOMAIN_NAME_OUTPUT.members[ - "regionalCertificateName" - ] - ) - - case 9: - kwargs["regional_certificate_arn"] = de.read_string( - _SCHEMA_CREATE_DOMAIN_NAME_OUTPUT.members[ - "regionalCertificateArn" - ] - ) - - case 10: - kwargs["distribution_domain_name"] = de.read_string( - _SCHEMA_CREATE_DOMAIN_NAME_OUTPUT.members[ - "distributionDomainName" - ] - ) - - case 11: - kwargs["distribution_hosted_zone_id"] = de.read_string( - _SCHEMA_CREATE_DOMAIN_NAME_OUTPUT.members[ - "distributionHostedZoneId" - ] - ) - - case 12: - kwargs["endpoint_configuration"] = ( - EndpointConfiguration.deserialize(de) - ) - - case 13: - kwargs["domain_name_status"] = DomainNameStatus( - de.read_string( - _SCHEMA_CREATE_DOMAIN_NAME_OUTPUT.members[ - "domainNameStatus" - ] - ) - ) - - case 14: - kwargs["domain_name_status_message"] = de.read_string( - _SCHEMA_CREATE_DOMAIN_NAME_OUTPUT.members[ - "domainNameStatusMessage" - ] - ) - - case 15: - kwargs["security_policy"] = SecurityPolicy( - de.read_string( - _SCHEMA_CREATE_DOMAIN_NAME_OUTPUT.members["securityPolicy"] - ) - ) - - case 16: - kwargs["endpoint_access_mode"] = EndpointAccessMode( - de.read_string( - _SCHEMA_CREATE_DOMAIN_NAME_OUTPUT.members[ - "endpointAccessMode" - ] - ) - ) - - case 17: - kwargs["tags"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_CREATE_DOMAIN_NAME_OUTPUT.members["tags"] - ) - - case 18: - kwargs["mutual_tls_authentication"] = ( - MutualTlsAuthentication.deserialize(de) - ) - - case 19: - kwargs["ownership_verification_certificate_arn"] = de.read_string( - _SCHEMA_CREATE_DOMAIN_NAME_OUTPUT.members[ - "ownershipVerificationCertificateArn" - ] - ) - - case 20: - kwargs["management_policy"] = de.read_string( - _SCHEMA_CREATE_DOMAIN_NAME_OUTPUT.members["managementPolicy"] - ) - - case 21: - kwargs["policy"] = de.read_string( - _SCHEMA_CREATE_DOMAIN_NAME_OUTPUT.members["policy"] - ) - - case 22: - kwargs["routing_mode"] = RoutingMode( - de.read_string( - _SCHEMA_CREATE_DOMAIN_NAME_OUTPUT.members["routingMode"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_DOMAIN_NAME_OUTPUT, consumer=_consumer) - return kwargs - - -CREATE_DOMAIN_NAME = APIOperation( - input=CreateDomainNameInput, - output=CreateDomainNameOutput, - schema=_SCHEMA_CREATE_DOMAIN_NAME, - input_schema=_SCHEMA_CREATE_DOMAIN_NAME_INPUT, - output_schema=_SCHEMA_CREATE_DOMAIN_NAME_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class CreateDomainNameAccessAssociationInput: - """Dataclass for CreateDomainNameAccessAssociationInput structure.""" - - domain_name_arn: str | None = None - """The ARN of the domain name.""" - - access_association_source_type: str | None = None - """The type of the domain name access association source.""" - - access_association_source: str | None = None - """ - The identifier of the domain name access association source. For a VPCE, - the value is the VPC endpoint ID. - """ - - tags: dict[str, str] | None = None - """ - The key-value map of strings. The valid character set is - [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not - start with `aws:`. The tag value can be up to 256 characters. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CREATE_DOMAIN_NAME_ACCESS_ASSOCIATION_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.domain_name_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_DOMAIN_NAME_ACCESS_ASSOCIATION_INPUT.members[ - "domainNameArn" - ], - self.domain_name_arn, - ) - - if self.access_association_source_type is not None: - serializer.write_string( - _SCHEMA_CREATE_DOMAIN_NAME_ACCESS_ASSOCIATION_INPUT.members[ - "accessAssociationSourceType" - ], - self.access_association_source_type, - ) - - if self.access_association_source is not None: - serializer.write_string( - _SCHEMA_CREATE_DOMAIN_NAME_ACCESS_ASSOCIATION_INPUT.members[ - "accessAssociationSource" - ], - self.access_association_source, - ) - - if self.tags is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_CREATE_DOMAIN_NAME_ACCESS_ASSOCIATION_INPUT.members["tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["domain_name_arn"] = de.read_string( - _SCHEMA_CREATE_DOMAIN_NAME_ACCESS_ASSOCIATION_INPUT.members[ - "domainNameArn" - ] - ) - - case 1: - kwargs["access_association_source_type"] = ( - AccessAssociationSourceType( - de.read_string( - _SCHEMA_CREATE_DOMAIN_NAME_ACCESS_ASSOCIATION_INPUT.members[ - "accessAssociationSourceType" - ] - ) - ) - ) - - case 2: - kwargs["access_association_source"] = de.read_string( - _SCHEMA_CREATE_DOMAIN_NAME_ACCESS_ASSOCIATION_INPUT.members[ - "accessAssociationSource" - ] - ) - - case 3: - kwargs["tags"] = _deserialize_map_of_string_to_string( - de, - _SCHEMA_CREATE_DOMAIN_NAME_ACCESS_ASSOCIATION_INPUT.members[ - "tags" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_DOMAIN_NAME_ACCESS_ASSOCIATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CreateDomainNameAccessAssociationOutput: - """ - Represents a domain name access association between an access - association source and a private custom domain name. With a domain name - access association, an access association source can invoke a private - custom domain name while isolated from the public internet. - """ - - domain_name_access_association_arn: str | None = None - """The ARN of the domain name access association resource.""" - - domain_name_arn: str | None = None - """The ARN of the domain name.""" - - access_association_source_type: str | None = None - """The type of the domain name access association source.""" - - access_association_source: str | None = None - """ - The ARN of the domain name access association source. For a VPCE, the - ARN must be a VPC endpoint. - """ - - tags: dict[str, str] | None = None - """ - The collection of tags. Each tag element is associated with a given - resource. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CREATE_DOMAIN_NAME_ACCESS_ASSOCIATION_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.domain_name_access_association_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_DOMAIN_NAME_ACCESS_ASSOCIATION_OUTPUT.members[ - "domainNameAccessAssociationArn" - ], - self.domain_name_access_association_arn, - ) - - if self.domain_name_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_DOMAIN_NAME_ACCESS_ASSOCIATION_OUTPUT.members[ - "domainNameArn" - ], - self.domain_name_arn, - ) - - if self.access_association_source_type is not None: - serializer.write_string( - _SCHEMA_CREATE_DOMAIN_NAME_ACCESS_ASSOCIATION_OUTPUT.members[ - "accessAssociationSourceType" - ], - self.access_association_source_type, - ) - - if self.access_association_source is not None: - serializer.write_string( - _SCHEMA_CREATE_DOMAIN_NAME_ACCESS_ASSOCIATION_OUTPUT.members[ - "accessAssociationSource" - ], - self.access_association_source, - ) - - if self.tags is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_CREATE_DOMAIN_NAME_ACCESS_ASSOCIATION_OUTPUT.members["tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["domain_name_access_association_arn"] = de.read_string( - _SCHEMA_CREATE_DOMAIN_NAME_ACCESS_ASSOCIATION_OUTPUT.members[ - "domainNameAccessAssociationArn" - ] - ) - - case 1: - kwargs["domain_name_arn"] = de.read_string( - _SCHEMA_CREATE_DOMAIN_NAME_ACCESS_ASSOCIATION_OUTPUT.members[ - "domainNameArn" - ] - ) - - case 2: - kwargs["access_association_source_type"] = ( - AccessAssociationSourceType( - de.read_string( - _SCHEMA_CREATE_DOMAIN_NAME_ACCESS_ASSOCIATION_OUTPUT.members[ - "accessAssociationSourceType" - ] - ) - ) - ) - - case 3: - kwargs["access_association_source"] = de.read_string( - _SCHEMA_CREATE_DOMAIN_NAME_ACCESS_ASSOCIATION_OUTPUT.members[ - "accessAssociationSource" - ] - ) - - case 4: - kwargs["tags"] = _deserialize_map_of_string_to_string( - de, - _SCHEMA_CREATE_DOMAIN_NAME_ACCESS_ASSOCIATION_OUTPUT.members[ - "tags" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_DOMAIN_NAME_ACCESS_ASSOCIATION_OUTPUT, consumer=_consumer - ) - return kwargs - - -CREATE_DOMAIN_NAME_ACCESS_ASSOCIATION = APIOperation( - input=CreateDomainNameAccessAssociationInput, - output=CreateDomainNameAccessAssociationOutput, - schema=_SCHEMA_CREATE_DOMAIN_NAME_ACCESS_ASSOCIATION, - input_schema=_SCHEMA_CREATE_DOMAIN_NAME_ACCESS_ASSOCIATION_INPUT, - output_schema=_SCHEMA_CREATE_DOMAIN_NAME_ACCESS_ASSOCIATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class CreateModelInput: - """Request to add a new Model to an existing RestApi resource.""" - - rest_api_id: str | None = None - """The RestApi identifier under which the Model will be created.""" - - name: str | None = None - """The name of the model. Must be alphanumeric.""" - - description: str | None = None - """The description of the model.""" - - schema: str | None = None - """ - The schema for the model. For `application/json` models, this should be - JSON schema draft 4 model. The maximum size of the model is 400 KB. - """ - - content_type: str | None = None - """The content-type for the model.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_MODEL_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_CREATE_MODEL_INPUT.members["restApiId"], self.rest_api_id - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_MODEL_INPUT.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_MODEL_INPUT.members["description"], self.description - ) - - if self.schema is not None: - serializer.write_string( - _SCHEMA_CREATE_MODEL_INPUT.members["schema"], self.schema - ) - - if self.content_type is not None: - serializer.write_string( - _SCHEMA_CREATE_MODEL_INPUT.members["contentType"], self.content_type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_CREATE_MODEL_INPUT.members["restApiId"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_MODEL_INPUT.members["name"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_MODEL_INPUT.members["description"] - ) - - case 3: - kwargs["schema"] = de.read_string( - _SCHEMA_CREATE_MODEL_INPUT.members["schema"] - ) - - case 4: - kwargs["content_type"] = de.read_string( - _SCHEMA_CREATE_MODEL_INPUT.members["contentType"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_MODEL_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CreateModelOutput: - """ - Represents the data structure of a method's request or response - payload. - """ - - id: str | None = None - """The identifier for the model resource.""" - - name: str | None = None - """The name of the model. Must be an alphanumeric string.""" - - description: str | None = None - """The description of the model.""" - - schema: str | None = None - """ - The schema for the model. For `application/json` models, this should be - JSON schema draft 4 model. Do not include \"\\*/\" characters in the - description of any properties because such \"\\*/\" characters may be - interpreted as the closing marker for comments in some languages, such - as Java or JavaScript, causing the installation of your API's SDK - generated by API Gateway to fail. - """ - - content_type: str | None = None - """The content-type for the model.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_MODEL_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string(_SCHEMA_CREATE_MODEL_OUTPUT.members["id"], self.id) - - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_MODEL_OUTPUT.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_MODEL_OUTPUT.members["description"], self.description - ) - - if self.schema is not None: - serializer.write_string( - _SCHEMA_CREATE_MODEL_OUTPUT.members["schema"], self.schema - ) - - if self.content_type is not None: - serializer.write_string( - _SCHEMA_CREATE_MODEL_OUTPUT.members["contentType"], self.content_type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_CREATE_MODEL_OUTPUT.members["id"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_MODEL_OUTPUT.members["name"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_MODEL_OUTPUT.members["description"] - ) - - case 3: - kwargs["schema"] = de.read_string( - _SCHEMA_CREATE_MODEL_OUTPUT.members["schema"] - ) - - case 4: - kwargs["content_type"] = de.read_string( - _SCHEMA_CREATE_MODEL_OUTPUT.members["contentType"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_MODEL_OUTPUT, consumer=_consumer) - return kwargs - - -CREATE_MODEL = APIOperation( - input=CreateModelInput, - output=CreateModelOutput, - schema=_SCHEMA_CREATE_MODEL, - input_schema=_SCHEMA_CREATE_MODEL_INPUT, - output_schema=_SCHEMA_CREATE_MODEL_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class CreateRequestValidatorInput: - """Creates a RequestValidator of a given RestApi.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - name: str | None = None - """The name of the to-be-created RequestValidator.""" - - validate_request_body: bool = False - """ - A Boolean flag to indicate whether to validate request body according to - the configured model schema for the method (`true`) or not (`false`). - """ - - validate_request_parameters: bool = False - """ - A Boolean flag to indicate whether to validate request parameters, - `true`, or not `false`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_REQUEST_VALIDATOR_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_CREATE_REQUEST_VALIDATOR_INPUT.members["restApiId"], - self.rest_api_id, - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_REQUEST_VALIDATOR_INPUT.members["name"], self.name - ) - - if self.validate_request_body is not None: - serializer.write_boolean( - _SCHEMA_CREATE_REQUEST_VALIDATOR_INPUT.members["validateRequestBody"], - self.validate_request_body, - ) - - if self.validate_request_parameters is not None: - serializer.write_boolean( - _SCHEMA_CREATE_REQUEST_VALIDATOR_INPUT.members[ - "validateRequestParameters" - ], - self.validate_request_parameters, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_CREATE_REQUEST_VALIDATOR_INPUT.members["restApiId"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_REQUEST_VALIDATOR_INPUT.members["name"] - ) - - case 2: - kwargs["validate_request_body"] = de.read_boolean( - _SCHEMA_CREATE_REQUEST_VALIDATOR_INPUT.members[ - "validateRequestBody" - ] - ) - - case 3: - kwargs["validate_request_parameters"] = de.read_boolean( - _SCHEMA_CREATE_REQUEST_VALIDATOR_INPUT.members[ - "validateRequestParameters" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_REQUEST_VALIDATOR_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CreateRequestValidatorOutput: - """A set of validation rules for incoming Method requests.""" - - id: str | None = None - """The identifier of this RequestValidator.""" - - name: str | None = None - """The name of this RequestValidator""" - - validate_request_body: bool = False - """ - A Boolean flag to indicate whether to validate a request body according - to the configured Model schema. - """ - - validate_request_parameters: bool = False - """ - A Boolean flag to indicate whether to validate request parameters - (`true`) or not (`false`). - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_REQUEST_VALIDATOR_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string( - _SCHEMA_CREATE_REQUEST_VALIDATOR_OUTPUT.members["id"], self.id - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_REQUEST_VALIDATOR_OUTPUT.members["name"], self.name - ) - - serializer.write_boolean( - _SCHEMA_CREATE_REQUEST_VALIDATOR_OUTPUT.members["validateRequestBody"], - self.validate_request_body, - ) - serializer.write_boolean( - _SCHEMA_CREATE_REQUEST_VALIDATOR_OUTPUT.members[ - "validateRequestParameters" - ], - self.validate_request_parameters, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_CREATE_REQUEST_VALIDATOR_OUTPUT.members["id"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_REQUEST_VALIDATOR_OUTPUT.members["name"] - ) - - case 2: - kwargs["validate_request_body"] = de.read_boolean( - _SCHEMA_CREATE_REQUEST_VALIDATOR_OUTPUT.members[ - "validateRequestBody" - ] - ) - - case 3: - kwargs["validate_request_parameters"] = de.read_boolean( - _SCHEMA_CREATE_REQUEST_VALIDATOR_OUTPUT.members[ - "validateRequestParameters" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_REQUEST_VALIDATOR_OUTPUT, consumer=_consumer - ) - return kwargs - - -CREATE_REQUEST_VALIDATOR = APIOperation( - input=CreateRequestValidatorInput, - output=CreateRequestValidatorOutput, - schema=_SCHEMA_CREATE_REQUEST_VALIDATOR, - input_schema=_SCHEMA_CREATE_REQUEST_VALIDATOR_INPUT, - output_schema=_SCHEMA_CREATE_REQUEST_VALIDATOR_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class CreateResourceInput: - """Requests API Gateway to create a Resource resource.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - parent_id: str | None = None - """The parent resource's identifier.""" - - path_part: str | None = None - """The last path segment for this resource.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_RESOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_CREATE_RESOURCE_INPUT.members["restApiId"], self.rest_api_id - ) - - if self.parent_id is not None: - serializer.write_string( - _SCHEMA_CREATE_RESOURCE_INPUT.members["parentId"], self.parent_id - ) - - if self.path_part is not None: - serializer.write_string( - _SCHEMA_CREATE_RESOURCE_INPUT.members["pathPart"], self.path_part - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_CREATE_RESOURCE_INPUT.members["restApiId"] - ) - - case 1: - kwargs["parent_id"] = de.read_string( - _SCHEMA_CREATE_RESOURCE_INPUT.members["parentId"] - ) - - case 2: - kwargs["path_part"] = de.read_string( - _SCHEMA_CREATE_RESOURCE_INPUT.members["pathPart"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_RESOURCE_INPUT, consumer=_consumer) - return kwargs - - -class ConnectionType(UnknownEnumMixin, StrEnum): - INTERNET = "INTERNET" - VPC_LINK = "VPC_LINK" - - -class ContentHandlingStrategy(UnknownEnumMixin, StrEnum): - CONVERT_TO_BINARY = "CONVERT_TO_BINARY" - CONVERT_TO_TEXT = "CONVERT_TO_TEXT" - - -@dataclass(kw_only=True) -class IntegrationResponse: - """ - Represents an integration response. The status code must map to an - existing MethodResponse, and parameters and templates can be used to - transform the back-end response. - """ - - status_code: str | None = None - """ - Specifies the status code that is used to map the integration response - to an existing MethodResponse. - """ - - selection_pattern: str | None = None - """ - Specifies the regular expression (regex) pattern used to choose an - integration response based on the response from the back end. For - example, if the success response returns nothing and the error response - returns some string, you could use the `.+` regex to match error - response. However, make sure that the error response does not contain - any newline (`\n`) character in such cases. If the back end is an Lambda - function, the Lambda function error header is matched. For all other - HTTP and Amazon Web Services back ends, the HTTP status code is matched. - """ - - response_parameters: dict[str, str] | None = None - """ - A key-value map specifying response parameters that are passed to the - method response from the back end. The key is a method response header - parameter name and the mapped value is an integration response header - value, a static value enclosed within a pair of single quotes, or a JSON - expression from the integration response body. The mapping key must - match the pattern of `method.response.header.{name}`, where `name` is a - valid and unique header name. The mapped non-static value must match the - pattern of `integration.response.header.{name}` or - `integration.response.body.{JSON-expression}`, where `name` is a valid - and unique response header name and `JSON-expression` is a valid JSON - expression without the `$` prefix. - """ - - response_templates: dict[str, str] | None = None - """ - Specifies the templates used to transform the integration response body. - Response templates are represented as a key/value map, with a - content-type as the key and a template as the value. - """ - - content_handling: str | None = None - """ - Specifies how to handle response payload content type conversions. - Supported values are `CONVERT_TO_BINARY` and `CONVERT_TO_TEXT`, with the - following behaviors: - - If this property is not defined, the response payload will be passed - through from the integration response to the method response without - modification. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INTEGRATION_RESPONSE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.status_code is not None: - serializer.write_string( - _SCHEMA_INTEGRATION_RESPONSE.members["statusCode"], self.status_code - ) - - if self.selection_pattern is not None: - serializer.write_string( - _SCHEMA_INTEGRATION_RESPONSE.members["selectionPattern"], - self.selection_pattern, - ) - - if self.response_parameters is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_INTEGRATION_RESPONSE.members["responseParameters"], - self.response_parameters, - ) - - if self.response_templates is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_INTEGRATION_RESPONSE.members["responseTemplates"], - self.response_templates, - ) - - if self.content_handling is not None: - serializer.write_string( - _SCHEMA_INTEGRATION_RESPONSE.members["contentHandling"], - self.content_handling, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["status_code"] = de.read_string( - _SCHEMA_INTEGRATION_RESPONSE.members["statusCode"] - ) - - case 1: - kwargs["selection_pattern"] = de.read_string( - _SCHEMA_INTEGRATION_RESPONSE.members["selectionPattern"] - ) - - case 2: - kwargs["response_parameters"] = ( - _deserialize_map_of_string_to_string( - de, - _SCHEMA_INTEGRATION_RESPONSE.members["responseParameters"], - ) - ) - - case 3: - kwargs["response_templates"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_INTEGRATION_RESPONSE.members["responseTemplates"] - ) - - case 4: - kwargs["content_handling"] = ContentHandlingStrategy( - de.read_string( - _SCHEMA_INTEGRATION_RESPONSE.members["contentHandling"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INTEGRATION_RESPONSE, consumer=_consumer) - return kwargs - - -def _serialize_map_of_integration_response( - serializer: ShapeSerializer, schema: Schema, value: dict[str, IntegrationResponse] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_struct(value_schema, v)) - - -def _deserialize_map_of_integration_response( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, IntegrationResponse]: - result: dict[str, IntegrationResponse] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = IntegrationResponse.deserialize(d) - - deserializer.read_map(schema, _read_value) - return result - - -class ResponseTransferMode(UnknownEnumMixin, StrEnum): - BUFFERED = "BUFFERED" - STREAM = "STREAM" - - -@dataclass(kw_only=True) -class TlsConfig: - """Specifies the TLS configuration for an integration.""" - - insecure_skip_verification: bool = False - """ - Specifies whether or not API Gateway skips verification that the - certificate for an integration endpoint is issued by a supported - certificate authority. This isn't recommended, but it enables you to use - certificates that are signed by private certificate authorities, or - certificates that are self-signed. If enabled, API Gateway still - performs basic certificate validation, which includes checking the - certificate's expiration date, hostname, and presence of a root - certificate authority. Supported only for `HTTP` and `HTTP_PROXY` - integrations. - - Warning: - Enabling `insecureSkipVerification` isn't recommended, especially for - integrations with public HTTPS endpoints. If you enable - `insecureSkipVerification`, you increase the risk of man-in-the-middle - attacks. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TLS_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_boolean( - _SCHEMA_TLS_CONFIG.members["insecureSkipVerification"], - self.insecure_skip_verification, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["insecure_skip_verification"] = de.read_boolean( - _SCHEMA_TLS_CONFIG.members["insecureSkipVerification"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TLS_CONFIG, consumer=_consumer) - return kwargs - - -class IntegrationType(UnknownEnumMixin, StrEnum): - """ - The integration type. The valid value is `HTTP` for integrating an API - method with an HTTP backend; `AWS` with any Amazon Web Services service - endpoints; `MOCK` for testing without actually invoking the backend; - `HTTP_PROXY` for integrating with the HTTP proxy integration; - `AWS_PROXY` for integrating with the Lambda proxy integration. - """ - - HTTP = "HTTP" - AWS = "AWS" - MOCK = "MOCK" - HTTP_PROXY = "HTTP_PROXY" - AWS_PROXY = "AWS_PROXY" - - -@dataclass(kw_only=True) -class Integration: - """ - Represents an `HTTP`, `HTTP_PROXY`, `AWS`, `AWS_PROXY`, or Mock - integration. - """ - - type: str | None = None - """ - Specifies an API method integration type. The valid value is one of the - following: - - For the HTTP and HTTP proxy integrations, each integration can specify a - protocol (`http/https`), port and path. Standard 80 and 443 ports are - supported as well as custom ports above 1024. An HTTP or HTTP proxy - integration with a `connectionType` of `VPC_LINK` is referred to as a - private integration and uses a VpcLink to connect API Gateway to a - network load balancer of a VPC. - """ - - http_method: str | None = None - """ - Specifies the integration's HTTP method type. For the Type property, if - you specify `MOCK`, this property is optional. For Lambda integrations, - you must set the integration method to `POST`. For all other types, you - must specify this property. - """ - - uri: str | None = None - """ - Specifies Uniform Resource Identifier (URI) of the integration endpoint. - - For `HTTP` or `HTTP_PROXY` integrations, the URI must be a fully formed, - encoded HTTP(S) URL according to the RFC-3986 specification for standard - integrations. If `connectionType` is `VPC_LINK` specify the Network Load - Balancer DNS name. For `AWS` or `AWS_PROXY` integrations, the URI is of - the form - `arn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api}`. - Here, {Region} is the API Gateway region (e.g., us-east-1); {service} is - the name of the integrated Amazon Web Services service (e.g., s3); and - {subdomain} is a designated subdomain supported by certain Amazon Web - Services service for fast host-name lookup. action can be used for an - Amazon Web Services service action-based API, using an - Action={name}&{p1}={v1}&p2={v2}... query string. The ensuing - {service_api} refers to a supported action {name} plus any required - input parameters. Alternatively, path can be used for an Amazon Web - Services service path-based API. The ensuing service_api refers to the - path to an Amazon Web Services service resource, including the region of - the integrated Amazon Web Services service, if applicable. For example, - for integration with the S3 API of GetObject, the uri can be either - `arn:aws:apigateway:us-west-2:s3:action/GetObject&Bucket={bucket}&Key={key}` - or `arn:aws:apigateway:us-west-2:s3:path/{bucket}/{key}` - """ - - connection_type: str | None = None - """ - The type of the network connection to the integration endpoint. The - valid value is `INTERNET` for connections through the public routable - internet or `VPC_LINK` for private connections between API Gateway and a - network load balancer in a VPC. The default value is `INTERNET`. - """ - - connection_id: str | None = None - """ - The ID of the VpcLink used for the integration when - `connectionType=VPC_LINK` and undefined, otherwise. - """ - - credentials: str | None = None - """ - Specifies the credentials required for the integration, if any. For AWS - integrations, three options are available. To specify an IAM Role for - API Gateway to assume, use the role's Amazon Resource Name (ARN). To - require that the caller's identity be passed through from the request, - specify the string `arn:aws:iam::*:user/*`. To use resource-based - permissions on supported Amazon Web Services services, specify null. - """ - - request_parameters: dict[str, str] | None = None - """ - A key-value map specifying request parameters that are passed from the - method request to the back end. The key is an integration request - parameter name and the associated value is a method request parameter - value or static value that must be enclosed within single quotes and - pre-encoded as required by the back end. The method request parameter - value must match the pattern of `method.request.{location}.{name}`, - where `location` is `querystring`, `path`, or `header` and `name` must - be a valid and unique method request parameter name. - """ - - request_templates: dict[str, str] | None = None - """ - Represents a map of Velocity templates that are applied on the request - payload based on the value of the Content-Type header sent by the - client. The content type value is the key in this map, and the template - (as a String) is the value. - """ - - passthrough_behavior: str | None = None - """ - Specifies how the method request body of an unmapped content type will - be passed through the integration request to the back end without - transformation. A content type is unmapped if no mapping template is - defined in the integration or the content type does not match any of the - mapped content types, as specified in `requestTemplates`. The valid - value is one of the following: `WHEN_NO_MATCH`: passes the method - request body through the integration request to the back end without - transformation when the method request content type does not match any - content type associated with the mapping templates defined in the - integration request. `WHEN_NO_TEMPLATES`: passes the method request body - through the integration request to the back end without transformation - when no mapping template is defined in the integration request. If a - template is defined when this option is selected, the method request of - an unmapped content-type will be rejected with an HTTP 415 Unsupported - Media Type response. `NEVER`: rejects the method request with an HTTP - 415 Unsupported Media Type response when either the method request - content type does not match any content type associated with the mapping - templates defined in the integration request or no mapping template is - defined in the integration request. - """ - - content_handling: str | None = None - """ - Specifies how to handle request payload content type conversions. - Supported values are `CONVERT_TO_BINARY` and `CONVERT_TO_TEXT`, with the - following behaviors: - - If this property is not defined, the request payload will be passed - through from the method request to integration request without - modification, provided that the `passthroughBehavior` is configured to - support payload pass-through. - """ - - timeout_in_millis: int = 0 - """ - Custom timeout between 50 and 29,000 milliseconds. The default value is - 29,000 milliseconds or 29 seconds. You can increase the default value to - longer than 29 seconds for Regional or private APIs only. - """ - - cache_namespace: str | None = None - """ - Specifies a group of related cached parameters. By default, API Gateway - uses the resource ID as the `cacheNamespace`. You can specify the same - `cacheNamespace` across resources to return the same cached data for - requests to different resources. - """ - - cache_key_parameters: list[str] | None = None - """ - A list of request parameters whose values API Gateway caches. To be - valid values for `cacheKeyParameters`, these parameters must also be - specified for Method `requestParameters`. - """ - - integration_responses: dict[str, IntegrationResponse] | None = None - """Specifies the integration's responses.""" - - tls_config: TlsConfig | None = None - """Specifies the TLS configuration for an integration.""" - - response_transfer_mode: str | None = None - """The response transfer mode of the integration.""" - - integration_target: str | None = None - """The ALB or NLB listener to send the request to.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INTEGRATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string(_SCHEMA_INTEGRATION.members["type"], self.type) - - if self.http_method is not None: - serializer.write_string( - _SCHEMA_INTEGRATION.members["httpMethod"], self.http_method - ) - - if self.uri is not None: - serializer.write_string(_SCHEMA_INTEGRATION.members["uri"], self.uri) - - if self.connection_type is not None: - serializer.write_string( - _SCHEMA_INTEGRATION.members["connectionType"], self.connection_type - ) - - if self.connection_id is not None: - serializer.write_string( - _SCHEMA_INTEGRATION.members["connectionId"], self.connection_id - ) - - if self.credentials is not None: - serializer.write_string( - _SCHEMA_INTEGRATION.members["credentials"], self.credentials - ) - - if self.request_parameters is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_INTEGRATION.members["requestParameters"], - self.request_parameters, - ) - - if self.request_templates is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_INTEGRATION.members["requestTemplates"], - self.request_templates, - ) - - if self.passthrough_behavior is not None: - serializer.write_string( - _SCHEMA_INTEGRATION.members["passthroughBehavior"], - self.passthrough_behavior, - ) - - if self.content_handling is not None: - serializer.write_string( - _SCHEMA_INTEGRATION.members["contentHandling"], self.content_handling - ) - - serializer.write_integer( - _SCHEMA_INTEGRATION.members["timeoutInMillis"], self.timeout_in_millis - ) - if self.cache_namespace is not None: - serializer.write_string( - _SCHEMA_INTEGRATION.members["cacheNamespace"], self.cache_namespace - ) - - if self.cache_key_parameters is not None: - _serialize_list_of_string( - serializer, - _SCHEMA_INTEGRATION.members["cacheKeyParameters"], - self.cache_key_parameters, - ) - - if self.integration_responses is not None: - _serialize_map_of_integration_response( - serializer, - _SCHEMA_INTEGRATION.members["integrationResponses"], - self.integration_responses, - ) - - if self.tls_config is not None: - serializer.write_struct( - _SCHEMA_INTEGRATION.members["tlsConfig"], self.tls_config - ) - - if self.response_transfer_mode is not None: - serializer.write_string( - _SCHEMA_INTEGRATION.members["responseTransferMode"], - self.response_transfer_mode, - ) - - if self.integration_target is not None: - serializer.write_string( - _SCHEMA_INTEGRATION.members["integrationTarget"], - self.integration_target, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = IntegrationType( - de.read_string(_SCHEMA_INTEGRATION.members["type"]) - ) - - case 1: - kwargs["http_method"] = de.read_string( - _SCHEMA_INTEGRATION.members["httpMethod"] - ) - - case 2: - kwargs["uri"] = de.read_string(_SCHEMA_INTEGRATION.members["uri"]) - - case 3: - kwargs["connection_type"] = ConnectionType( - de.read_string(_SCHEMA_INTEGRATION.members["connectionType"]) - ) - - case 4: - kwargs["connection_id"] = de.read_string( - _SCHEMA_INTEGRATION.members["connectionId"] - ) - - case 5: - kwargs["credentials"] = de.read_string( - _SCHEMA_INTEGRATION.members["credentials"] - ) - - case 6: - kwargs["request_parameters"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_INTEGRATION.members["requestParameters"] - ) - - case 7: - kwargs["request_templates"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_INTEGRATION.members["requestTemplates"] - ) - - case 8: - kwargs["passthrough_behavior"] = de.read_string( - _SCHEMA_INTEGRATION.members["passthroughBehavior"] - ) - - case 9: - kwargs["content_handling"] = ContentHandlingStrategy( - de.read_string(_SCHEMA_INTEGRATION.members["contentHandling"]) - ) - - case 10: - kwargs["timeout_in_millis"] = de.read_integer( - _SCHEMA_INTEGRATION.members["timeoutInMillis"] - ) - - case 11: - kwargs["cache_namespace"] = de.read_string( - _SCHEMA_INTEGRATION.members["cacheNamespace"] - ) - - case 12: - kwargs["cache_key_parameters"] = _deserialize_list_of_string( - de, _SCHEMA_INTEGRATION.members["cacheKeyParameters"] - ) - - case 13: - kwargs["integration_responses"] = ( - _deserialize_map_of_integration_response( - de, _SCHEMA_INTEGRATION.members["integrationResponses"] - ) - ) - - case 14: - kwargs["tls_config"] = TlsConfig.deserialize(de) - - case 15: - kwargs["response_transfer_mode"] = ResponseTransferMode( - de.read_string( - _SCHEMA_INTEGRATION.members["responseTransferMode"] - ) - ) - - case 16: - kwargs["integration_target"] = de.read_string( - _SCHEMA_INTEGRATION.members["integrationTarget"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INTEGRATION, consumer=_consumer) - return kwargs - - -def _serialize_map_of_string_to_boolean( - serializer: ShapeSerializer, schema: Schema, value: dict[str, bool] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_boolean(value_schema, v)) - - -def _deserialize_map_of_string_to_boolean( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, bool]: - result: dict[str, bool] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_boolean(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class MethodResponse: - """ - Represents a method response of a given HTTP status code returned to the - client. The method response is passed from the back end through the - associated integration response that can be transformed using a mapping - template. - """ - - status_code: str | None = None - """The method response's status code.""" - - response_parameters: dict[str, bool] | None = None - """ - A key-value map specifying required or optional response parameters that - API Gateway can send back to the caller. A key defines a method response - header and the value specifies whether the associated method response - header is required or not. The expression of the key must match the - pattern `method.response.header.{name}`, where `name` is a valid and - unique header name. API Gateway passes certain integration response data - to the method response headers specified here according to the mapping - you prescribe in the API's IntegrationResponse. The integration - response data that can be mapped include an integration response header - expressed in `integration.response.header.{name}`, a static value - enclosed within a pair of single quotes (e.g., `'application/json'`), or - a JSON expression from the back-end response payload in the form of - `integration.response.body.{JSON-expression}`, where `JSON-expression` - is a valid JSON expression without the `$` prefix.) - """ - - response_models: dict[str, str] | None = None - """ - Specifies the Model resources used for the response's content-type. - Response models are represented as a key/value map, with a content-type - as the key and a Model name as the value. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_METHOD_RESPONSE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.status_code is not None: - serializer.write_string( - _SCHEMA_METHOD_RESPONSE.members["statusCode"], self.status_code - ) - - if self.response_parameters is not None: - _serialize_map_of_string_to_boolean( - serializer, - _SCHEMA_METHOD_RESPONSE.members["responseParameters"], - self.response_parameters, - ) - - if self.response_models is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_METHOD_RESPONSE.members["responseModels"], - self.response_models, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["status_code"] = de.read_string( - _SCHEMA_METHOD_RESPONSE.members["statusCode"] - ) - - case 1: - kwargs["response_parameters"] = ( - _deserialize_map_of_string_to_boolean( - de, _SCHEMA_METHOD_RESPONSE.members["responseParameters"] - ) - ) - - case 2: - kwargs["response_models"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_METHOD_RESPONSE.members["responseModels"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_METHOD_RESPONSE, consumer=_consumer) - return kwargs - - -def _serialize_map_of_method_response( - serializer: ShapeSerializer, schema: Schema, value: dict[str, MethodResponse] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_struct(value_schema, v)) - - -def _deserialize_map_of_method_response( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, MethodResponse]: - result: dict[str, MethodResponse] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = MethodResponse.deserialize(d) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class Method: - """ - Represents a client-facing interface by which the client calls the API - to access back-end resources. A Method resource is integrated with an - Integration resource. Both consist of a request and one or more - responses. The method request takes the client input that is passed to - the back end through the integration request. A method response returns - the output from the back end to the client through an integration - response. A method request is embodied in a Method resource, whereas an - integration request is embodied in an Integration resource. On the other - hand, a method response is represented by a MethodResponse resource, - whereas an integration response is represented by an IntegrationResponse - resource. - """ - - http_method: str | None = None - """The method's HTTP verb.""" - - authorization_type: str | None = None - """ - The method's authorization type. Valid values are `NONE` for open - access, `AWS_IAM` for using AWS IAM permissions, `CUSTOM` for using a - custom authorizer, or `COGNITO_USER_POOLS` for using a Cognito user - pool. - """ - - authorizer_id: str | None = None - """ - The identifier of an Authorizer to use on this method. The - `authorizationType` must be `CUSTOM`. - """ - - api_key_required: bool | None = None - """ - A boolean flag specifying whether a valid ApiKey is required to invoke - this method. - """ - - request_validator_id: str | None = None - """The identifier of a RequestValidator for request validation.""" - - operation_name: str | None = None - """ - A human-friendly operation identifier for the method. For example, you - can assign the `operationName` of `ListPets` for the `GET /pets` method - in the `PetStore` example. - """ - - request_parameters: dict[str, bool] | None = None - """ - A key-value map defining required or optional method request parameters - that can be accepted by API Gateway. A key is a method request parameter - name matching the pattern of `method.request.{location}.{name}`, where - `location` is `querystring`, `path`, or `header` and `name` is a valid - and unique parameter name. The value associated with the key is a - Boolean flag indicating whether the parameter is required (`true`) or - optional (`false`). The method request parameter names defined here are - available in Integration to be mapped to integration request parameters - or templates. - """ - - request_models: dict[str, str] | None = None - """ - A key-value map specifying data schemas, represented by Model resources, - (as the mapped value) of the request payloads of given content types (as - the mapping key). - """ - - method_responses: dict[str, MethodResponse] | None = None - """Gets a method response associated with a given HTTP status code.""" - - method_integration: Integration | None = None - """ - Gets the method's integration responsible for passing the - client-submitted request to the back end and performing necessary - transformations to make the request compliant with the back end. - """ - - authorization_scopes: list[str] | None = None - """ - A list of authorization scopes configured on the method. The scopes are - used with a `COGNITO_USER_POOLS` authorizer to authorize the method - invocation. The authorization works by matching the method scopes - against the scopes parsed from the access token in the incoming request. - The method invocation is authorized if any method scopes matches a - claimed scope in the access token. Otherwise, the invocation is not - authorized. When the method scope is configured, the client must provide - an access token instead of an identity token for authorization purposes. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_METHOD, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.http_method is not None: - serializer.write_string( - _SCHEMA_METHOD.members["httpMethod"], self.http_method - ) - - if self.authorization_type is not None: - serializer.write_string( - _SCHEMA_METHOD.members["authorizationType"], self.authorization_type - ) - - if self.authorizer_id is not None: - serializer.write_string( - _SCHEMA_METHOD.members["authorizerId"], self.authorizer_id - ) - - if self.api_key_required is not None: - serializer.write_boolean( - _SCHEMA_METHOD.members["apiKeyRequired"], self.api_key_required - ) - - if self.request_validator_id is not None: - serializer.write_string( - _SCHEMA_METHOD.members["requestValidatorId"], self.request_validator_id - ) - - if self.operation_name is not None: - serializer.write_string( - _SCHEMA_METHOD.members["operationName"], self.operation_name - ) - - if self.request_parameters is not None: - _serialize_map_of_string_to_boolean( - serializer, - _SCHEMA_METHOD.members["requestParameters"], - self.request_parameters, - ) - - if self.request_models is not None: - _serialize_map_of_string_to_string( - serializer, _SCHEMA_METHOD.members["requestModels"], self.request_models - ) - - if self.method_responses is not None: - _serialize_map_of_method_response( - serializer, - _SCHEMA_METHOD.members["methodResponses"], - self.method_responses, - ) - - if self.method_integration is not None: - serializer.write_struct( - _SCHEMA_METHOD.members["methodIntegration"], self.method_integration - ) - - if self.authorization_scopes is not None: - _serialize_list_of_string( - serializer, - _SCHEMA_METHOD.members["authorizationScopes"], - self.authorization_scopes, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["http_method"] = de.read_string( - _SCHEMA_METHOD.members["httpMethod"] - ) - - case 1: - kwargs["authorization_type"] = de.read_string( - _SCHEMA_METHOD.members["authorizationType"] - ) - - case 2: - kwargs["authorizer_id"] = de.read_string( - _SCHEMA_METHOD.members["authorizerId"] - ) - - case 3: - kwargs["api_key_required"] = de.read_boolean( - _SCHEMA_METHOD.members["apiKeyRequired"] - ) - - case 4: - kwargs["request_validator_id"] = de.read_string( - _SCHEMA_METHOD.members["requestValidatorId"] - ) - - case 5: - kwargs["operation_name"] = de.read_string( - _SCHEMA_METHOD.members["operationName"] - ) - - case 6: - kwargs["request_parameters"] = ( - _deserialize_map_of_string_to_boolean( - de, _SCHEMA_METHOD.members["requestParameters"] - ) - ) - - case 7: - kwargs["request_models"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_METHOD.members["requestModels"] - ) - - case 8: - kwargs["method_responses"] = _deserialize_map_of_method_response( - de, _SCHEMA_METHOD.members["methodResponses"] - ) - - case 9: - kwargs["method_integration"] = Integration.deserialize(de) - - case 10: - kwargs["authorization_scopes"] = _deserialize_list_of_string( - de, _SCHEMA_METHOD.members["authorizationScopes"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_METHOD, consumer=_consumer) - return kwargs - - -def _serialize_map_of_method( - serializer: ShapeSerializer, schema: Schema, value: dict[str, Method] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_struct(value_schema, v)) - - -def _deserialize_map_of_method( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, Method]: - result: dict[str, Method] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = Method.deserialize(d) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CreateResourceOutput: - """Represents an API resource.""" - - id: str | None = None - """The resource's identifier.""" - - parent_id: str | None = None - """The parent resource's identifier.""" - - path_part: str | None = None - """The last path segment for this resource.""" - - path: str | None = None - """The full path for this resource.""" - - resource_methods: dict[str, Method] | None = None - """Gets an API resource's method of a given HTTP verb.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_RESOURCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string( - _SCHEMA_CREATE_RESOURCE_OUTPUT.members["id"], self.id - ) - - if self.parent_id is not None: - serializer.write_string( - _SCHEMA_CREATE_RESOURCE_OUTPUT.members["parentId"], self.parent_id - ) - - if self.path_part is not None: - serializer.write_string( - _SCHEMA_CREATE_RESOURCE_OUTPUT.members["pathPart"], self.path_part - ) - - if self.path is not None: - serializer.write_string( - _SCHEMA_CREATE_RESOURCE_OUTPUT.members["path"], self.path - ) - - if self.resource_methods is not None: - _serialize_map_of_method( - serializer, - _SCHEMA_CREATE_RESOURCE_OUTPUT.members["resourceMethods"], - self.resource_methods, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_CREATE_RESOURCE_OUTPUT.members["id"] - ) - - case 1: - kwargs["parent_id"] = de.read_string( - _SCHEMA_CREATE_RESOURCE_OUTPUT.members["parentId"] - ) - - case 2: - kwargs["path_part"] = de.read_string( - _SCHEMA_CREATE_RESOURCE_OUTPUT.members["pathPart"] - ) - - case 3: - kwargs["path"] = de.read_string( - _SCHEMA_CREATE_RESOURCE_OUTPUT.members["path"] - ) - - case 4: - kwargs["resource_methods"] = _deserialize_map_of_method( - de, _SCHEMA_CREATE_RESOURCE_OUTPUT.members["resourceMethods"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_RESOURCE_OUTPUT, consumer=_consumer) - return kwargs - - -CREATE_RESOURCE = APIOperation( - input=CreateResourceInput, - output=CreateResourceOutput, - schema=_SCHEMA_CREATE_RESOURCE, - input_schema=_SCHEMA_CREATE_RESOURCE_INPUT, - output_schema=_SCHEMA_CREATE_RESOURCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class CreateRestApiInput: - """The POST Request to add a new RestApi resource to your collection.""" - - name: str | None = None - """The name of the RestApi.""" - - description: str | None = None - """The description of the RestApi.""" - - version: str | None = None - """A version identifier for the API.""" - - clone_from: str | None = None - """The ID of the RestApi that you want to clone from.""" - - binary_media_types: list[str] | None = None - """ - The list of binary media types supported by the RestApi. By default, the - RestApi supports only UTF-8-encoded text payloads. - """ - - minimum_compression_size: int | None = None - """ - A nullable integer that is used to enable compression (with non-negative - between 0 and 10485760 (10M) bytes, inclusive) or disable compression - (with a null value) on an API. When compression is enabled, compression - or decompression is not applied on the payload if the payload size is - smaller than this value. Setting it to zero allows compression for any - payload size. - """ - - api_key_source: str | None = None - """ - The source of the API key for metering requests according to a usage - plan. Valid values are: `HEADER` to read the API key from the - `X-API-Key` header of a request. `AUTHORIZER` to read the API key from - the `UsageIdentifierKey` from a custom authorizer. - """ - - endpoint_configuration: EndpointConfiguration | None = None - """ - The endpoint configuration of this RestApi showing the endpoint types - and IP address types of the API. - """ - - policy: str | None = None - """ - A stringified JSON policy document that applies to this RestApi - regardless of the caller and Method configuration. - """ - - tags: dict[str, str] | None = None - """ - The key-value map of strings. The valid character set is - [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not - start with `aws:`. The tag value can be up to 256 characters. - """ - - disable_execute_api_endpoint: bool = False - """ - Specifies whether clients can invoke your API by using the default - `execute-api` endpoint. By default, clients can invoke your API with the - default `https://{api_id}.execute-api.{region}.amazonaws.com` endpoint. - To require that clients use a custom domain name to invoke your API, - disable the default endpoint - """ - - security_policy: str | None = None - """ - The Transport Layer Security (TLS) version + cipher suite for this - RestApi. - """ - - endpoint_access_mode: str | None = None - """ - The endpoint access mode of the RestApi. Only available for RestApis - that use security policies that start with `SecurityPolicy_`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_REST_API_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_REST_API_INPUT.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_REST_API_INPUT.members["description"], self.description - ) - - if self.version is not None: - serializer.write_string( - _SCHEMA_CREATE_REST_API_INPUT.members["version"], self.version - ) - - if self.clone_from is not None: - serializer.write_string( - _SCHEMA_CREATE_REST_API_INPUT.members["cloneFrom"], self.clone_from - ) - - if self.binary_media_types is not None: - _serialize_list_of_string( - serializer, - _SCHEMA_CREATE_REST_API_INPUT.members["binaryMediaTypes"], - self.binary_media_types, - ) - - if self.minimum_compression_size is not None: - serializer.write_integer( - _SCHEMA_CREATE_REST_API_INPUT.members["minimumCompressionSize"], - self.minimum_compression_size, - ) - - if self.api_key_source is not None: - serializer.write_string( - _SCHEMA_CREATE_REST_API_INPUT.members["apiKeySource"], - self.api_key_source, - ) - - if self.endpoint_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_REST_API_INPUT.members["endpointConfiguration"], - self.endpoint_configuration, - ) - - if self.policy is not None: - serializer.write_string( - _SCHEMA_CREATE_REST_API_INPUT.members["policy"], self.policy - ) - - if self.tags is not None: - _serialize_map_of_string_to_string( - serializer, _SCHEMA_CREATE_REST_API_INPUT.members["tags"], self.tags - ) - - if self.disable_execute_api_endpoint is not None: - serializer.write_boolean( - _SCHEMA_CREATE_REST_API_INPUT.members["disableExecuteApiEndpoint"], - self.disable_execute_api_endpoint, - ) - - if self.security_policy is not None: - serializer.write_string( - _SCHEMA_CREATE_REST_API_INPUT.members["securityPolicy"], - self.security_policy, - ) - - if self.endpoint_access_mode is not None: - serializer.write_string( - _SCHEMA_CREATE_REST_API_INPUT.members["endpointAccessMode"], - self.endpoint_access_mode, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_REST_API_INPUT.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_REST_API_INPUT.members["description"] - ) - - case 2: - kwargs["version"] = de.read_string( - _SCHEMA_CREATE_REST_API_INPUT.members["version"] - ) - - case 3: - kwargs["clone_from"] = de.read_string( - _SCHEMA_CREATE_REST_API_INPUT.members["cloneFrom"] - ) - - case 4: - kwargs["binary_media_types"] = _deserialize_list_of_string( - de, _SCHEMA_CREATE_REST_API_INPUT.members["binaryMediaTypes"] - ) - - case 5: - kwargs["minimum_compression_size"] = de.read_integer( - _SCHEMA_CREATE_REST_API_INPUT.members["minimumCompressionSize"] - ) - - case 6: - kwargs["api_key_source"] = ApiKeySourceType( - de.read_string( - _SCHEMA_CREATE_REST_API_INPUT.members["apiKeySource"] - ) - ) - - case 7: - kwargs["endpoint_configuration"] = ( - EndpointConfiguration.deserialize(de) - ) - - case 8: - kwargs["policy"] = de.read_string( - _SCHEMA_CREATE_REST_API_INPUT.members["policy"] - ) - - case 9: - kwargs["tags"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_CREATE_REST_API_INPUT.members["tags"] - ) - - case 10: - kwargs["disable_execute_api_endpoint"] = de.read_boolean( - _SCHEMA_CREATE_REST_API_INPUT.members[ - "disableExecuteApiEndpoint" - ] - ) - - case 11: - kwargs["security_policy"] = SecurityPolicy( - de.read_string( - _SCHEMA_CREATE_REST_API_INPUT.members["securityPolicy"] - ) - ) - - case 12: - kwargs["endpoint_access_mode"] = EndpointAccessMode( - de.read_string( - _SCHEMA_CREATE_REST_API_INPUT.members["endpointAccessMode"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_REST_API_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CreateRestApiOutput: - """Represents a REST API.""" - - id: str | None = None - """ - The API's identifier. This identifier is unique across all of your APIs - in API Gateway. - """ - - name: str | None = None - """The API's name.""" - - description: str | None = None - """The API's description.""" - - created_date: datetime | None = None - """The timestamp when the API was created.""" - - version: str | None = None - """A version identifier for the API.""" - - warnings: list[str] | None = None - """ - The warning messages reported when `failonwarnings` is turned on during - API import. - """ - - binary_media_types: list[str] | None = None - """ - The list of binary media types supported by the RestApi. By default, the - RestApi supports only UTF-8-encoded text payloads. - """ - - minimum_compression_size: int | None = None - """ - A nullable integer that is used to enable compression (with non-negative - between 0 and 10485760 (10M) bytes, inclusive) or disable compression - (with a null value) on an API. When compression is enabled, compression - or decompression is not applied on the payload if the payload size is - smaller than this value. Setting it to zero allows compression for any - payload size. - """ - - api_key_source: str | None = None - """ - The source of the API key for metering requests according to a usage - plan. Valid values are: >`HEADER` to read the API key from the - `X-API-Key` header of a request. `AUTHORIZER` to read the API key from - the `UsageIdentifierKey` from a custom authorizer. - """ - - endpoint_configuration: EndpointConfiguration | None = None - """ - The endpoint configuration of this RestApi showing the endpoint types - and IP address types of the API. - """ - - policy: str | None = None - """ - A stringified JSON policy document that applies to this RestApi - regardless of the caller and Method configuration. - """ - - tags: dict[str, str] | None = None - """ - The collection of tags. Each tag element is associated with a given - resource. - """ - - disable_execute_api_endpoint: bool = False - """ - Specifies whether clients can invoke your API by using the default - `execute-api` endpoint. By default, clients can invoke your API with the - default `https://{api_id}.execute-api.{region}.amazonaws.com` endpoint. - To require that clients use a custom domain name to invoke your API, - disable the default endpoint. - """ - - root_resource_id: str | None = None - """The API's root resource ID.""" - - security_policy: str | None = None - """ - The Transport Layer Security (TLS) version + cipher suite for this - RestApi. - """ - - endpoint_access_mode: str | None = None - """The endpoint access mode of the RestApi.""" - - api_status: str | None = None - """The ApiStatus of the RestApi.""" - - api_status_message: str | None = None - """ - The status message of the RestApi. When the status message is `UPDATING` - you can still invoke it. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_REST_API_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string( - _SCHEMA_CREATE_REST_API_OUTPUT.members["id"], self.id - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_REST_API_OUTPUT.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_REST_API_OUTPUT.members["description"], self.description - ) - - if self.created_date is not None: - serializer.write_timestamp( - _SCHEMA_CREATE_REST_API_OUTPUT.members["createdDate"], self.created_date - ) - - if self.version is not None: - serializer.write_string( - _SCHEMA_CREATE_REST_API_OUTPUT.members["version"], self.version - ) - - if self.warnings is not None: - _serialize_list_of_string( - serializer, - _SCHEMA_CREATE_REST_API_OUTPUT.members["warnings"], - self.warnings, - ) - - if self.binary_media_types is not None: - _serialize_list_of_string( - serializer, - _SCHEMA_CREATE_REST_API_OUTPUT.members["binaryMediaTypes"], - self.binary_media_types, - ) - - if self.minimum_compression_size is not None: - serializer.write_integer( - _SCHEMA_CREATE_REST_API_OUTPUT.members["minimumCompressionSize"], - self.minimum_compression_size, - ) - - if self.api_key_source is not None: - serializer.write_string( - _SCHEMA_CREATE_REST_API_OUTPUT.members["apiKeySource"], - self.api_key_source, - ) - - if self.endpoint_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_REST_API_OUTPUT.members["endpointConfiguration"], - self.endpoint_configuration, - ) - - if self.policy is not None: - serializer.write_string( - _SCHEMA_CREATE_REST_API_OUTPUT.members["policy"], self.policy - ) - - if self.tags is not None: - _serialize_map_of_string_to_string( - serializer, _SCHEMA_CREATE_REST_API_OUTPUT.members["tags"], self.tags - ) - - serializer.write_boolean( - _SCHEMA_CREATE_REST_API_OUTPUT.members["disableExecuteApiEndpoint"], - self.disable_execute_api_endpoint, - ) - if self.root_resource_id is not None: - serializer.write_string( - _SCHEMA_CREATE_REST_API_OUTPUT.members["rootResourceId"], - self.root_resource_id, - ) - - if self.security_policy is not None: - serializer.write_string( - _SCHEMA_CREATE_REST_API_OUTPUT.members["securityPolicy"], - self.security_policy, - ) - - if self.endpoint_access_mode is not None: - serializer.write_string( - _SCHEMA_CREATE_REST_API_OUTPUT.members["endpointAccessMode"], - self.endpoint_access_mode, - ) - - if self.api_status is not None: - serializer.write_string( - _SCHEMA_CREATE_REST_API_OUTPUT.members["apiStatus"], self.api_status - ) - - if self.api_status_message is not None: - serializer.write_string( - _SCHEMA_CREATE_REST_API_OUTPUT.members["apiStatusMessage"], - self.api_status_message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_CREATE_REST_API_OUTPUT.members["id"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_REST_API_OUTPUT.members["name"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_REST_API_OUTPUT.members["description"] - ) - - case 3: - kwargs["created_date"] = de.read_timestamp( - _SCHEMA_CREATE_REST_API_OUTPUT.members["createdDate"] - ) - - case 4: - kwargs["version"] = de.read_string( - _SCHEMA_CREATE_REST_API_OUTPUT.members["version"] - ) - - case 5: - kwargs["warnings"] = _deserialize_list_of_string( - de, _SCHEMA_CREATE_REST_API_OUTPUT.members["warnings"] - ) - - case 6: - kwargs["binary_media_types"] = _deserialize_list_of_string( - de, _SCHEMA_CREATE_REST_API_OUTPUT.members["binaryMediaTypes"] - ) - - case 7: - kwargs["minimum_compression_size"] = de.read_integer( - _SCHEMA_CREATE_REST_API_OUTPUT.members["minimumCompressionSize"] - ) - - case 8: - kwargs["api_key_source"] = ApiKeySourceType( - de.read_string( - _SCHEMA_CREATE_REST_API_OUTPUT.members["apiKeySource"] - ) - ) - - case 9: - kwargs["endpoint_configuration"] = ( - EndpointConfiguration.deserialize(de) - ) - - case 10: - kwargs["policy"] = de.read_string( - _SCHEMA_CREATE_REST_API_OUTPUT.members["policy"] - ) - - case 11: - kwargs["tags"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_CREATE_REST_API_OUTPUT.members["tags"] - ) - - case 12: - kwargs["disable_execute_api_endpoint"] = de.read_boolean( - _SCHEMA_CREATE_REST_API_OUTPUT.members[ - "disableExecuteApiEndpoint" - ] - ) - - case 13: - kwargs["root_resource_id"] = de.read_string( - _SCHEMA_CREATE_REST_API_OUTPUT.members["rootResourceId"] - ) - - case 14: - kwargs["security_policy"] = SecurityPolicy( - de.read_string( - _SCHEMA_CREATE_REST_API_OUTPUT.members["securityPolicy"] - ) - ) - - case 15: - kwargs["endpoint_access_mode"] = EndpointAccessMode( - de.read_string( - _SCHEMA_CREATE_REST_API_OUTPUT.members["endpointAccessMode"] - ) - ) - - case 16: - kwargs["api_status"] = ApiStatus( - de.read_string( - _SCHEMA_CREATE_REST_API_OUTPUT.members["apiStatus"] - ) - ) - - case 17: - kwargs["api_status_message"] = de.read_string( - _SCHEMA_CREATE_REST_API_OUTPUT.members["apiStatusMessage"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_REST_API_OUTPUT, consumer=_consumer) - return kwargs - - -CREATE_REST_API = APIOperation( - input=CreateRestApiInput, - output=CreateRestApiOutput, - schema=_SCHEMA_CREATE_REST_API, - input_schema=_SCHEMA_CREATE_REST_API_INPUT, - output_schema=_SCHEMA_CREATE_REST_API_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class CanarySettings: - """Configuration settings of a canary deployment.""" - - percent_traffic: float = 0 - """The percent (0-100) of traffic diverted to a canary deployment.""" - - deployment_id: str | None = None - """The ID of the canary deployment.""" - - stage_variable_overrides: dict[str, str] | None = None - """ - Stage variables overridden for a canary release deployment, including - new stage variables introduced in the canary. These stage variables are - represented as a string-to-string map between stage variable names and - their values. - """ - - use_stage_cache: bool = False - """ - A Boolean flag to indicate whether the canary deployment uses the stage - cache or not. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CANARY_SETTINGS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_double( - _SCHEMA_CANARY_SETTINGS.members["percentTraffic"], self.percent_traffic - ) - if self.deployment_id is not None: - serializer.write_string( - _SCHEMA_CANARY_SETTINGS.members["deploymentId"], self.deployment_id - ) - - if self.stage_variable_overrides is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_CANARY_SETTINGS.members["stageVariableOverrides"], - self.stage_variable_overrides, - ) - - serializer.write_boolean( - _SCHEMA_CANARY_SETTINGS.members["useStageCache"], self.use_stage_cache - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["percent_traffic"] = de.read_double( - _SCHEMA_CANARY_SETTINGS.members["percentTraffic"] - ) - - case 1: - kwargs["deployment_id"] = de.read_string( - _SCHEMA_CANARY_SETTINGS.members["deploymentId"] - ) - - case 2: - kwargs["stage_variable_overrides"] = ( - _deserialize_map_of_string_to_string( - de, - _SCHEMA_CANARY_SETTINGS.members["stageVariableOverrides"], - ) - ) - - case 3: - kwargs["use_stage_cache"] = de.read_boolean( - _SCHEMA_CANARY_SETTINGS.members["useStageCache"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CANARY_SETTINGS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CreateStageInput: - """Requests API Gateway to create a Stage resource.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - stage_name: str | None = None - """ - The name for the Stage resource. Stage names can only contain - alphanumeric characters, hyphens, and underscores. Maximum length is 128 - characters. - """ - - deployment_id: str | None = None - """The identifier of the Deployment resource for the Stage resource.""" - - description: str | None = None - """The description of the Stage resource.""" - - cache_cluster_enabled: bool = False - """Whether cache clustering is enabled for the stage.""" - - cache_cluster_size: str | None = None - """ - The stage's cache capacity in GB. For more information about choosing a - cache size, see [Enabling API caching to enhance - responsiveness](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html). - """ - - variables: dict[str, str] | None = None - """ - A map that defines the stage variables for the new Stage resource. - Variable names can have alphanumeric and underscore characters, and the - values must match `[A-Za-z0-9-._~:/?#&=,]+`. - """ - - documentation_version: str | None = None - """The version of the associated API documentation.""" - - canary_settings: CanarySettings | None = None - """The canary deployment settings of this stage.""" - - tracing_enabled: bool = False - """Specifies whether active tracing with X-ray is enabled for the Stage.""" - - tags: dict[str, str] | None = None - """ - The key-value map of strings. The valid character set is - [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not - start with `aws:`. The tag value can be up to 256 characters. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_STAGE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_CREATE_STAGE_INPUT.members["restApiId"], self.rest_api_id - ) - - if self.stage_name is not None: - serializer.write_string( - _SCHEMA_CREATE_STAGE_INPUT.members["stageName"], self.stage_name - ) - - if self.deployment_id is not None: - serializer.write_string( - _SCHEMA_CREATE_STAGE_INPUT.members["deploymentId"], self.deployment_id - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_STAGE_INPUT.members["description"], self.description - ) - - if self.cache_cluster_enabled is not None: - serializer.write_boolean( - _SCHEMA_CREATE_STAGE_INPUT.members["cacheClusterEnabled"], - self.cache_cluster_enabled, - ) - - if self.cache_cluster_size is not None: - serializer.write_string( - _SCHEMA_CREATE_STAGE_INPUT.members["cacheClusterSize"], - self.cache_cluster_size, - ) - - if self.variables is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_CREATE_STAGE_INPUT.members["variables"], - self.variables, - ) - - if self.documentation_version is not None: - serializer.write_string( - _SCHEMA_CREATE_STAGE_INPUT.members["documentationVersion"], - self.documentation_version, - ) - - if self.canary_settings is not None: - serializer.write_struct( - _SCHEMA_CREATE_STAGE_INPUT.members["canarySettings"], - self.canary_settings, - ) - - if self.tracing_enabled is not None: - serializer.write_boolean( - _SCHEMA_CREATE_STAGE_INPUT.members["tracingEnabled"], - self.tracing_enabled, - ) - - if self.tags is not None: - _serialize_map_of_string_to_string( - serializer, _SCHEMA_CREATE_STAGE_INPUT.members["tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_CREATE_STAGE_INPUT.members["restApiId"] - ) - - case 1: - kwargs["stage_name"] = de.read_string( - _SCHEMA_CREATE_STAGE_INPUT.members["stageName"] - ) - - case 2: - kwargs["deployment_id"] = de.read_string( - _SCHEMA_CREATE_STAGE_INPUT.members["deploymentId"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_STAGE_INPUT.members["description"] - ) - - case 4: - kwargs["cache_cluster_enabled"] = de.read_boolean( - _SCHEMA_CREATE_STAGE_INPUT.members["cacheClusterEnabled"] - ) - - case 5: - kwargs["cache_cluster_size"] = CacheClusterSize( - de.read_string( - _SCHEMA_CREATE_STAGE_INPUT.members["cacheClusterSize"] - ) - ) - - case 6: - kwargs["variables"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_CREATE_STAGE_INPUT.members["variables"] - ) - - case 7: - kwargs["documentation_version"] = de.read_string( - _SCHEMA_CREATE_STAGE_INPUT.members["documentationVersion"] - ) - - case 8: - kwargs["canary_settings"] = CanarySettings.deserialize(de) - - case 9: - kwargs["tracing_enabled"] = de.read_boolean( - _SCHEMA_CREATE_STAGE_INPUT.members["tracingEnabled"] - ) - - case 10: - kwargs["tags"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_CREATE_STAGE_INPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_STAGE_INPUT, consumer=_consumer) - return kwargs - - -class CacheClusterStatus(UnknownEnumMixin, StrEnum): - """Returns the status of the CacheCluster.""" - - CREATE_IN_PROGRESS = "CREATE_IN_PROGRESS" - AVAILABLE = "AVAILABLE" - DELETE_IN_PROGRESS = "DELETE_IN_PROGRESS" - NOT_AVAILABLE = "NOT_AVAILABLE" - FLUSH_IN_PROGRESS = "FLUSH_IN_PROGRESS" - - -class UnauthorizedCacheControlHeaderStrategy(UnknownEnumMixin, StrEnum): - FAIL_WITH_403 = "FAIL_WITH_403" - SUCCEED_WITH_RESPONSE_HEADER = "SUCCEED_WITH_RESPONSE_HEADER" - SUCCEED_WITHOUT_RESPONSE_HEADER = "SUCCEED_WITHOUT_RESPONSE_HEADER" - - -@dataclass(kw_only=True) -class MethodSetting: - """Specifies the method setting properties.""" - - metrics_enabled: bool = False - """Specifies whether Amazon CloudWatch metrics are enabled for this method.""" - - logging_level: str | None = None - """ - Specifies the logging level for this method, which affects the log - entries pushed to Amazon CloudWatch Logs. Valid values are `OFF`, - `ERROR`, and `INFO`. Choose `ERROR` to write only error-level entries to - CloudWatch Logs, or choose `INFO` to include all `ERROR` events as well - as extra informational events. - """ - - data_trace_enabled: bool = False - """ - Specifies whether data trace logging is enabled for this method, which - affects the log entries pushed to Amazon CloudWatch Logs. This can be - useful to troubleshoot APIs, but can result in logging sensitive data. - We recommend that you don't enable this option for production APIs. - """ - - throttling_burst_limit: int = 0 - """Specifies the throttling burst limit.""" - - throttling_rate_limit: float = 0 - """Specifies the throttling rate limit.""" - - caching_enabled: bool = False - """ - Specifies whether responses should be cached and returned for requests. - A cache cluster must be enabled on the stage for responses to be cached. - """ - - cache_ttl_in_seconds: int = 0 - """ - Specifies the time to live (TTL), in seconds, for cached responses. The - higher the TTL, the longer the response will be cached. - """ - - cache_data_encrypted: bool = False - """Specifies whether the cached responses are encrypted.""" - - require_authorization_for_cache_control: bool = False - """ - Specifies whether authorization is required for a cache invalidation - request. - """ - - unauthorized_cache_control_header_strategy: str | None = None - """Specifies how to handle unauthorized requests for cache invalidation.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_METHOD_SETTING, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_boolean( - _SCHEMA_METHOD_SETTING.members["metricsEnabled"], self.metrics_enabled - ) - if self.logging_level is not None: - serializer.write_string( - _SCHEMA_METHOD_SETTING.members["loggingLevel"], self.logging_level - ) - - serializer.write_boolean( - _SCHEMA_METHOD_SETTING.members["dataTraceEnabled"], self.data_trace_enabled - ) - serializer.write_integer( - _SCHEMA_METHOD_SETTING.members["throttlingBurstLimit"], - self.throttling_burst_limit, - ) - serializer.write_double( - _SCHEMA_METHOD_SETTING.members["throttlingRateLimit"], - self.throttling_rate_limit, - ) - serializer.write_boolean( - _SCHEMA_METHOD_SETTING.members["cachingEnabled"], self.caching_enabled - ) - serializer.write_integer( - _SCHEMA_METHOD_SETTING.members["cacheTtlInSeconds"], - self.cache_ttl_in_seconds, - ) - serializer.write_boolean( - _SCHEMA_METHOD_SETTING.members["cacheDataEncrypted"], - self.cache_data_encrypted, - ) - serializer.write_boolean( - _SCHEMA_METHOD_SETTING.members["requireAuthorizationForCacheControl"], - self.require_authorization_for_cache_control, - ) - if self.unauthorized_cache_control_header_strategy is not None: - serializer.write_string( - _SCHEMA_METHOD_SETTING.members[ - "unauthorizedCacheControlHeaderStrategy" - ], - self.unauthorized_cache_control_header_strategy, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["metrics_enabled"] = de.read_boolean( - _SCHEMA_METHOD_SETTING.members["metricsEnabled"] - ) - - case 1: - kwargs["logging_level"] = de.read_string( - _SCHEMA_METHOD_SETTING.members["loggingLevel"] - ) - - case 2: - kwargs["data_trace_enabled"] = de.read_boolean( - _SCHEMA_METHOD_SETTING.members["dataTraceEnabled"] - ) - - case 3: - kwargs["throttling_burst_limit"] = de.read_integer( - _SCHEMA_METHOD_SETTING.members["throttlingBurstLimit"] - ) - - case 4: - kwargs["throttling_rate_limit"] = de.read_double( - _SCHEMA_METHOD_SETTING.members["throttlingRateLimit"] - ) - - case 5: - kwargs["caching_enabled"] = de.read_boolean( - _SCHEMA_METHOD_SETTING.members["cachingEnabled"] - ) - - case 6: - kwargs["cache_ttl_in_seconds"] = de.read_integer( - _SCHEMA_METHOD_SETTING.members["cacheTtlInSeconds"] - ) - - case 7: - kwargs["cache_data_encrypted"] = de.read_boolean( - _SCHEMA_METHOD_SETTING.members["cacheDataEncrypted"] - ) - - case 8: - kwargs["require_authorization_for_cache_control"] = de.read_boolean( - _SCHEMA_METHOD_SETTING.members[ - "requireAuthorizationForCacheControl" - ] - ) - - case 9: - kwargs["unauthorized_cache_control_header_strategy"] = ( - UnauthorizedCacheControlHeaderStrategy( - de.read_string( - _SCHEMA_METHOD_SETTING.members[ - "unauthorizedCacheControlHeaderStrategy" - ] - ) - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_METHOD_SETTING, consumer=_consumer) - return kwargs - - -def _serialize_map_of_method_settings( - serializer: ShapeSerializer, schema: Schema, value: dict[str, MethodSetting] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_struct(value_schema, v)) - - -def _deserialize_map_of_method_settings( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, MethodSetting]: - result: dict[str, MethodSetting] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = MethodSetting.deserialize(d) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CreateStageOutput: - """ - Represents a unique identifier for a version of a deployed RestApi that - is callable by users. - """ - - deployment_id: str | None = None - """The identifier of the Deployment that the stage points to.""" - - client_certificate_id: str | None = None - """The identifier of a client certificate for an API stage.""" - - stage_name: str | None = None - """ - The name of the stage is the first path segment in the Uniform Resource - Identifier (URI) of a call to API Gateway. Stage names can only contain - alphanumeric characters, hyphens, and underscores. Maximum length is 128 - characters. - """ - - description: str | None = None - """The stage's description.""" - - cache_cluster_enabled: bool = False - """ - Specifies whether a cache cluster is enabled for the stage. To activate - a method-level cache, set `CachingEnabled` to `true` for a method. - """ - - cache_cluster_size: str | None = None - """ - The stage's cache capacity in GB. For more information about choosing a - cache size, see [Enabling API caching to enhance - responsiveness](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html). - """ - - cache_cluster_status: str | None = None - """The status of the cache cluster for the stage, if enabled.""" - - method_settings: dict[str, MethodSetting] | None = None - """ - A map that defines the method settings for a Stage resource. Keys - (designated as `/{method_setting_key` below) are method paths defined as - `{resource_path}/{http_method}` for an individual method override, or - `/*/*` for overriding all methods in the stage. - """ - - variables: dict[str, str] | None = None - """ - A map that defines the stage variables for a Stage resource. Variable - names can have alphanumeric and underscore characters, and the values - must match `[A-Za-z0-9-._~:/?#&=,]+`. - """ - - documentation_version: str | None = None - """The version of the associated API documentation.""" - - access_log_settings: AccessLogSettings | None = None - """Settings for logging access in this stage.""" - - canary_settings: CanarySettings | None = None - """Settings for the canary deployment in this stage.""" - - tracing_enabled: bool = False - """Specifies whether active tracing with X-ray is enabled for the Stage.""" - - web_acl_arn: str | None = None - """The ARN of the WebAcl associated with the Stage.""" - - tags: dict[str, str] | None = None - """ - The collection of tags. Each tag element is associated with a given - resource. - """ - - created_date: datetime | None = None - """The timestamp when the stage was created.""" - - last_updated_date: datetime | None = None - """The timestamp when the stage last updated.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_STAGE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.deployment_id is not None: - serializer.write_string( - _SCHEMA_CREATE_STAGE_OUTPUT.members["deploymentId"], self.deployment_id - ) - - if self.client_certificate_id is not None: - serializer.write_string( - _SCHEMA_CREATE_STAGE_OUTPUT.members["clientCertificateId"], - self.client_certificate_id, - ) - - if self.stage_name is not None: - serializer.write_string( - _SCHEMA_CREATE_STAGE_OUTPUT.members["stageName"], self.stage_name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_STAGE_OUTPUT.members["description"], self.description - ) - - serializer.write_boolean( - _SCHEMA_CREATE_STAGE_OUTPUT.members["cacheClusterEnabled"], - self.cache_cluster_enabled, - ) - if self.cache_cluster_size is not None: - serializer.write_string( - _SCHEMA_CREATE_STAGE_OUTPUT.members["cacheClusterSize"], - self.cache_cluster_size, - ) - - if self.cache_cluster_status is not None: - serializer.write_string( - _SCHEMA_CREATE_STAGE_OUTPUT.members["cacheClusterStatus"], - self.cache_cluster_status, - ) - - if self.method_settings is not None: - _serialize_map_of_method_settings( - serializer, - _SCHEMA_CREATE_STAGE_OUTPUT.members["methodSettings"], - self.method_settings, - ) - - if self.variables is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_CREATE_STAGE_OUTPUT.members["variables"], - self.variables, - ) - - if self.documentation_version is not None: - serializer.write_string( - _SCHEMA_CREATE_STAGE_OUTPUT.members["documentationVersion"], - self.documentation_version, - ) - - if self.access_log_settings is not None: - serializer.write_struct( - _SCHEMA_CREATE_STAGE_OUTPUT.members["accessLogSettings"], - self.access_log_settings, - ) - - if self.canary_settings is not None: - serializer.write_struct( - _SCHEMA_CREATE_STAGE_OUTPUT.members["canarySettings"], - self.canary_settings, - ) - - serializer.write_boolean( - _SCHEMA_CREATE_STAGE_OUTPUT.members["tracingEnabled"], self.tracing_enabled - ) - if self.web_acl_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_STAGE_OUTPUT.members["webAclArn"], self.web_acl_arn - ) - - if self.tags is not None: - _serialize_map_of_string_to_string( - serializer, _SCHEMA_CREATE_STAGE_OUTPUT.members["tags"], self.tags - ) - - if self.created_date is not None: - serializer.write_timestamp( - _SCHEMA_CREATE_STAGE_OUTPUT.members["createdDate"], self.created_date - ) - - if self.last_updated_date is not None: - serializer.write_timestamp( - _SCHEMA_CREATE_STAGE_OUTPUT.members["lastUpdatedDate"], - self.last_updated_date, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["deployment_id"] = de.read_string( - _SCHEMA_CREATE_STAGE_OUTPUT.members["deploymentId"] - ) - - case 1: - kwargs["client_certificate_id"] = de.read_string( - _SCHEMA_CREATE_STAGE_OUTPUT.members["clientCertificateId"] - ) - - case 2: - kwargs["stage_name"] = de.read_string( - _SCHEMA_CREATE_STAGE_OUTPUT.members["stageName"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_STAGE_OUTPUT.members["description"] - ) - - case 4: - kwargs["cache_cluster_enabled"] = de.read_boolean( - _SCHEMA_CREATE_STAGE_OUTPUT.members["cacheClusterEnabled"] - ) - - case 5: - kwargs["cache_cluster_size"] = CacheClusterSize( - de.read_string( - _SCHEMA_CREATE_STAGE_OUTPUT.members["cacheClusterSize"] - ) - ) - - case 6: - kwargs["cache_cluster_status"] = CacheClusterStatus( - de.read_string( - _SCHEMA_CREATE_STAGE_OUTPUT.members["cacheClusterStatus"] - ) - ) - - case 7: - kwargs["method_settings"] = _deserialize_map_of_method_settings( - de, _SCHEMA_CREATE_STAGE_OUTPUT.members["methodSettings"] - ) - - case 8: - kwargs["variables"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_CREATE_STAGE_OUTPUT.members["variables"] - ) - - case 9: - kwargs["documentation_version"] = de.read_string( - _SCHEMA_CREATE_STAGE_OUTPUT.members["documentationVersion"] - ) - - case 10: - kwargs["access_log_settings"] = AccessLogSettings.deserialize(de) - - case 11: - kwargs["canary_settings"] = CanarySettings.deserialize(de) - - case 12: - kwargs["tracing_enabled"] = de.read_boolean( - _SCHEMA_CREATE_STAGE_OUTPUT.members["tracingEnabled"] - ) - - case 13: - kwargs["web_acl_arn"] = de.read_string( - _SCHEMA_CREATE_STAGE_OUTPUT.members["webAclArn"] - ) - - case 14: - kwargs["tags"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_CREATE_STAGE_OUTPUT.members["tags"] - ) - - case 15: - kwargs["created_date"] = de.read_timestamp( - _SCHEMA_CREATE_STAGE_OUTPUT.members["createdDate"] - ) - - case 16: - kwargs["last_updated_date"] = de.read_timestamp( - _SCHEMA_CREATE_STAGE_OUTPUT.members["lastUpdatedDate"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_STAGE_OUTPUT, consumer=_consumer) - return kwargs - - -CREATE_STAGE = APIOperation( - input=CreateStageInput, - output=CreateStageOutput, - schema=_SCHEMA_CREATE_STAGE, - input_schema=_SCHEMA_CREATE_STAGE_INPUT, - output_schema=_SCHEMA_CREATE_STAGE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -def _serialize_list_of_api_stage( - serializer: ShapeSerializer, schema: Schema, value: list[ApiStage] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_list_of_api_stage( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ApiStage]: - result: list[ApiStage] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ApiStage.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class QuotaPeriodType(UnknownEnumMixin, StrEnum): - DAY = "DAY" - WEEK = "WEEK" - MONTH = "MONTH" - - -@dataclass(kw_only=True) -class QuotaSettings: - """Quotas configured for a usage plan.""" - - limit: int = 0 - """ - The target maximum number of requests that can be made in a given time - period. - """ - - offset: int = 0 - """ - The number of requests subtracted from the given limit in the initial - time period. - """ - - period: str | None = None - """ - The time period in which the limit applies. Valid values are \"DAY\", - \"WEEK\" or \"MONTH\". - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_QUOTA_SETTINGS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer(_SCHEMA_QUOTA_SETTINGS.members["limit"], self.limit) - serializer.write_integer(_SCHEMA_QUOTA_SETTINGS.members["offset"], self.offset) - if self.period is not None: - serializer.write_string( - _SCHEMA_QUOTA_SETTINGS.members["period"], self.period - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["limit"] = de.read_integer( - _SCHEMA_QUOTA_SETTINGS.members["limit"] - ) - - case 1: - kwargs["offset"] = de.read_integer( - _SCHEMA_QUOTA_SETTINGS.members["offset"] - ) - - case 2: - kwargs["period"] = QuotaPeriodType( - de.read_string(_SCHEMA_QUOTA_SETTINGS.members["period"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_QUOTA_SETTINGS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CreateUsagePlanInput: - """ - The POST request to create a usage plan with the name, description, - throttle limits and quota limits, as well as the associated API stages, - specified in the payload. - """ - - name: str | None = None - """The name of the usage plan.""" - - description: str | None = None - """The description of the usage plan.""" - - api_stages: list[ApiStage] | None = None - """The associated API stages of the usage plan.""" - - throttle: ThrottleSettings | None = None - """The throttling limits of the usage plan.""" - - quota: QuotaSettings | None = None - """The quota of the usage plan.""" - - tags: dict[str, str] | None = None - """ - The key-value map of strings. The valid character set is - [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not - start with `aws:`. The tag value can be up to 256 characters. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_USAGE_PLAN_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_USAGE_PLAN_INPUT.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_USAGE_PLAN_INPUT.members["description"], self.description - ) - - if self.api_stages is not None: - _serialize_list_of_api_stage( - serializer, - _SCHEMA_CREATE_USAGE_PLAN_INPUT.members["apiStages"], - self.api_stages, - ) - - if self.throttle is not None: - serializer.write_struct( - _SCHEMA_CREATE_USAGE_PLAN_INPUT.members["throttle"], self.throttle - ) - - if self.quota is not None: - serializer.write_struct( - _SCHEMA_CREATE_USAGE_PLAN_INPUT.members["quota"], self.quota - ) - - if self.tags is not None: - _serialize_map_of_string_to_string( - serializer, _SCHEMA_CREATE_USAGE_PLAN_INPUT.members["tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_USAGE_PLAN_INPUT.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_USAGE_PLAN_INPUT.members["description"] - ) - - case 2: - kwargs["api_stages"] = _deserialize_list_of_api_stage( - de, _SCHEMA_CREATE_USAGE_PLAN_INPUT.members["apiStages"] - ) - - case 3: - kwargs["throttle"] = ThrottleSettings.deserialize(de) - - case 4: - kwargs["quota"] = QuotaSettings.deserialize(de) - - case 5: - kwargs["tags"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_CREATE_USAGE_PLAN_INPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_USAGE_PLAN_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CreateUsagePlanOutput: - """ - Represents a usage plan used to specify who can assess associated API - stages. Optionally, target request rate and quota limits can be set. In - some cases clients can exceed the targets that you set. Don't rely on - usage plans to control costs. Consider using [Amazon Web Services - Budgets](https://docs.aws.amazon.com/cost-management/latest/userguide/budgets-managing-costs.html) - to monitor costs and - [WAF](https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html) - to manage API requests. - """ - - id: str | None = None - """The identifier of a UsagePlan resource.""" - - name: str | None = None - """The name of a usage plan.""" - - description: str | None = None - """The description of a usage plan.""" - - api_stages: list[ApiStage] | None = None - """The associated API stages of a usage plan.""" - - throttle: ThrottleSettings | None = None - """ - A map containing method level throttling information for API stage in a - usage plan. - """ - - quota: QuotaSettings | None = None - """ - The target maximum number of permitted requests per a given unit time - interval. - """ - - product_code: str | None = None - """ - The Amazon Web Services Marketplace product identifier to associate with - the usage plan as a SaaS product on the Amazon Web Services Marketplace. - """ - - tags: dict[str, str] | None = None - """ - The collection of tags. Each tag element is associated with a given - resource. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_USAGE_PLAN_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string( - _SCHEMA_CREATE_USAGE_PLAN_OUTPUT.members["id"], self.id - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_USAGE_PLAN_OUTPUT.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_USAGE_PLAN_OUTPUT.members["description"], - self.description, - ) - - if self.api_stages is not None: - _serialize_list_of_api_stage( - serializer, - _SCHEMA_CREATE_USAGE_PLAN_OUTPUT.members["apiStages"], - self.api_stages, - ) - - if self.throttle is not None: - serializer.write_struct( - _SCHEMA_CREATE_USAGE_PLAN_OUTPUT.members["throttle"], self.throttle - ) - - if self.quota is not None: - serializer.write_struct( - _SCHEMA_CREATE_USAGE_PLAN_OUTPUT.members["quota"], self.quota - ) - - if self.product_code is not None: - serializer.write_string( - _SCHEMA_CREATE_USAGE_PLAN_OUTPUT.members["productCode"], - self.product_code, - ) - - if self.tags is not None: - _serialize_map_of_string_to_string( - serializer, _SCHEMA_CREATE_USAGE_PLAN_OUTPUT.members["tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_CREATE_USAGE_PLAN_OUTPUT.members["id"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_USAGE_PLAN_OUTPUT.members["name"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_USAGE_PLAN_OUTPUT.members["description"] - ) - - case 3: - kwargs["api_stages"] = _deserialize_list_of_api_stage( - de, _SCHEMA_CREATE_USAGE_PLAN_OUTPUT.members["apiStages"] - ) - - case 4: - kwargs["throttle"] = ThrottleSettings.deserialize(de) - - case 5: - kwargs["quota"] = QuotaSettings.deserialize(de) - - case 6: - kwargs["product_code"] = de.read_string( - _SCHEMA_CREATE_USAGE_PLAN_OUTPUT.members["productCode"] - ) - - case 7: - kwargs["tags"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_CREATE_USAGE_PLAN_OUTPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_USAGE_PLAN_OUTPUT, consumer=_consumer) - return kwargs - - -CREATE_USAGE_PLAN = APIOperation( - input=CreateUsagePlanInput, - output=CreateUsagePlanOutput, - schema=_SCHEMA_CREATE_USAGE_PLAN, - input_schema=_SCHEMA_CREATE_USAGE_PLAN_INPUT, - output_schema=_SCHEMA_CREATE_USAGE_PLAN_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class CreateUsagePlanKeyInput: - """ - The POST request to create a usage plan key for adding an existing API - key to a usage plan. - """ - - usage_plan_id: str | None = None - """ - The Id of the UsagePlan resource representing the usage plan containing - the to-be-created UsagePlanKey resource representing a plan customer. - """ - - key_id: str | None = None - """The identifier of a UsagePlanKey resource for a plan customer.""" - - key_type: str | None = None - """The type of a UsagePlanKey resource for a plan customer.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_USAGE_PLAN_KEY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.usage_plan_id is not None: - serializer.write_string( - _SCHEMA_CREATE_USAGE_PLAN_KEY_INPUT.members["usagePlanId"], - self.usage_plan_id, - ) - - if self.key_id is not None: - serializer.write_string( - _SCHEMA_CREATE_USAGE_PLAN_KEY_INPUT.members["keyId"], self.key_id - ) - - if self.key_type is not None: - serializer.write_string( - _SCHEMA_CREATE_USAGE_PLAN_KEY_INPUT.members["keyType"], self.key_type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["usage_plan_id"] = de.read_string( - _SCHEMA_CREATE_USAGE_PLAN_KEY_INPUT.members["usagePlanId"] - ) - - case 1: - kwargs["key_id"] = de.read_string( - _SCHEMA_CREATE_USAGE_PLAN_KEY_INPUT.members["keyId"] - ) - - case 2: - kwargs["key_type"] = de.read_string( - _SCHEMA_CREATE_USAGE_PLAN_KEY_INPUT.members["keyType"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_USAGE_PLAN_KEY_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CreateUsagePlanKeyOutput: - """Represents a usage plan key to identify a plan customer.""" - - id: str | None = None - """The Id of a usage plan key.""" - - type: str | None = None - """ - The type of a usage plan key. Currently, the valid key type is - `API_KEY`. - """ - - value: str | None = None - """The value of a usage plan key.""" - - name: str | None = None - """The name of a usage plan key.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_USAGE_PLAN_KEY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string( - _SCHEMA_CREATE_USAGE_PLAN_KEY_OUTPUT.members["id"], self.id - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_CREATE_USAGE_PLAN_KEY_OUTPUT.members["type"], self.type - ) - - if self.value is not None: - serializer.write_string( - _SCHEMA_CREATE_USAGE_PLAN_KEY_OUTPUT.members["value"], self.value - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_USAGE_PLAN_KEY_OUTPUT.members["name"], self.name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_CREATE_USAGE_PLAN_KEY_OUTPUT.members["id"] - ) - - case 1: - kwargs["type"] = de.read_string( - _SCHEMA_CREATE_USAGE_PLAN_KEY_OUTPUT.members["type"] - ) - - case 2: - kwargs["value"] = de.read_string( - _SCHEMA_CREATE_USAGE_PLAN_KEY_OUTPUT.members["value"] - ) - - case 3: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_USAGE_PLAN_KEY_OUTPUT.members["name"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_USAGE_PLAN_KEY_OUTPUT, consumer=_consumer - ) - return kwargs - - -CREATE_USAGE_PLAN_KEY = APIOperation( - input=CreateUsagePlanKeyInput, - output=CreateUsagePlanKeyOutput, - schema=_SCHEMA_CREATE_USAGE_PLAN_KEY, - input_schema=_SCHEMA_CREATE_USAGE_PLAN_KEY_INPUT, - output_schema=_SCHEMA_CREATE_USAGE_PLAN_KEY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class CreateVpcLinkInput: - """ - Creates a VPC link, under the caller's account in a selected region, in - an asynchronous operation that typically takes 2-4 minutes to complete - and become operational. The caller must have permissions to create and - update VPC Endpoint services. - """ - - name: str | None = None - """The name used to label and identify the VPC link.""" - - description: str | None = None - """The description of the VPC link.""" - - target_arns: list[str] | None = None - """ - The ARN of the network load balancer of the VPC targeted by the VPC - link. The network load balancer must be owned by the same Amazon Web - Services account of the API owner. - """ - - tags: dict[str, str] | None = None - """ - The key-value map of strings. The valid character set is - [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not - start with `aws:`. The tag value can be up to 256 characters. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_VPC_LINK_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_VPC_LINK_INPUT.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_VPC_LINK_INPUT.members["description"], self.description - ) - - if self.target_arns is not None: - _serialize_list_of_string( - serializer, - _SCHEMA_CREATE_VPC_LINK_INPUT.members["targetArns"], - self.target_arns, - ) - - if self.tags is not None: - _serialize_map_of_string_to_string( - serializer, _SCHEMA_CREATE_VPC_LINK_INPUT.members["tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_VPC_LINK_INPUT.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_VPC_LINK_INPUT.members["description"] - ) - - case 2: - kwargs["target_arns"] = _deserialize_list_of_string( - de, _SCHEMA_CREATE_VPC_LINK_INPUT.members["targetArns"] - ) - - case 3: - kwargs["tags"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_CREATE_VPC_LINK_INPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_VPC_LINK_INPUT, consumer=_consumer) - return kwargs - - -class VpcLinkStatus(UnknownEnumMixin, StrEnum): - AVAILABLE = "AVAILABLE" - PENDING = "PENDING" - DELETING = "DELETING" - FAILED = "FAILED" - - -@dataclass(kw_only=True) -class CreateVpcLinkOutput: - """ - An API Gateway VPC link for a RestApi to access resources in an Amazon - Virtual Private Cloud (VPC). - """ - - id: str | None = None - """ - The identifier of the VpcLink. It is used in an Integration to reference - this VpcLink. - """ - - name: str | None = None - """The name used to label and identify the VPC link.""" - - description: str | None = None - """The description of the VPC link.""" - - target_arns: list[str] | None = None - """ - The ARN of the network load balancer of the VPC targeted by the VPC - link. The network load balancer must be owned by the same Amazon Web - Services account of the API owner. - """ - - status: str | None = None - """ - The status of the VPC link. The valid values are `AVAILABLE`, `PENDING`, - `DELETING`, or `FAILED`. Deploying an API will wait if the status is - `PENDING` and will fail if the status is `DELETING`. - """ - - status_message: str | None = None - """A description about the VPC link status.""" - - tags: dict[str, str] | None = None - """ - The collection of tags. Each tag element is associated with a given - resource. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_VPC_LINK_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string( - _SCHEMA_CREATE_VPC_LINK_OUTPUT.members["id"], self.id - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_VPC_LINK_OUTPUT.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_VPC_LINK_OUTPUT.members["description"], self.description - ) - - if self.target_arns is not None: - _serialize_list_of_string( - serializer, - _SCHEMA_CREATE_VPC_LINK_OUTPUT.members["targetArns"], - self.target_arns, - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_CREATE_VPC_LINK_OUTPUT.members["status"], self.status - ) - - if self.status_message is not None: - serializer.write_string( - _SCHEMA_CREATE_VPC_LINK_OUTPUT.members["statusMessage"], - self.status_message, - ) - - if self.tags is not None: - _serialize_map_of_string_to_string( - serializer, _SCHEMA_CREATE_VPC_LINK_OUTPUT.members["tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_CREATE_VPC_LINK_OUTPUT.members["id"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_VPC_LINK_OUTPUT.members["name"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_VPC_LINK_OUTPUT.members["description"] - ) - - case 3: - kwargs["target_arns"] = _deserialize_list_of_string( - de, _SCHEMA_CREATE_VPC_LINK_OUTPUT.members["targetArns"] - ) - - case 4: - kwargs["status"] = VpcLinkStatus( - de.read_string(_SCHEMA_CREATE_VPC_LINK_OUTPUT.members["status"]) - ) - - case 5: - kwargs["status_message"] = de.read_string( - _SCHEMA_CREATE_VPC_LINK_OUTPUT.members["statusMessage"] - ) - - case 6: - kwargs["tags"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_CREATE_VPC_LINK_OUTPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_VPC_LINK_OUTPUT, consumer=_consumer) - return kwargs - - -CREATE_VPC_LINK = APIOperation( - input=CreateVpcLinkInput, - output=CreateVpcLinkOutput, - schema=_SCHEMA_CREATE_VPC_LINK, - input_schema=_SCHEMA_CREATE_VPC_LINK_INPUT, - output_schema=_SCHEMA_CREATE_VPC_LINK_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteApiKeyInput: - """A request to delete the ApiKey resource.""" - - api_key: str | None = None - """The identifier of the ApiKey resource to be deleted.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_API_KEY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.api_key is not None: - serializer.write_string( - _SCHEMA_DELETE_API_KEY_INPUT.members["apiKey"], self.api_key - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["api_key"] = de.read_string( - _SCHEMA_DELETE_API_KEY_INPUT.members["apiKey"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_API_KEY_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteApiKeyOutput: - """Dataclass for DeleteApiKeyOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_API_KEY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_API_KEY_OUTPUT, consumer=_consumer) - return kwargs - - -DELETE_API_KEY = APIOperation( - input=DeleteApiKeyInput, - output=DeleteApiKeyOutput, - schema=_SCHEMA_DELETE_API_KEY, - input_schema=_SCHEMA_DELETE_API_KEY_INPUT, - output_schema=_SCHEMA_DELETE_API_KEY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteAuthorizerInput: - """Request to delete an existing Authorizer resource.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - authorizer_id: str | None = None - """The identifier of the Authorizer resource.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_AUTHORIZER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_DELETE_AUTHORIZER_INPUT.members["restApiId"], self.rest_api_id - ) - - if self.authorizer_id is not None: - serializer.write_string( - _SCHEMA_DELETE_AUTHORIZER_INPUT.members["authorizerId"], - self.authorizer_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_DELETE_AUTHORIZER_INPUT.members["restApiId"] - ) - - case 1: - kwargs["authorizer_id"] = de.read_string( - _SCHEMA_DELETE_AUTHORIZER_INPUT.members["authorizerId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_AUTHORIZER_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteAuthorizerOutput: - """Dataclass for DeleteAuthorizerOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_AUTHORIZER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_AUTHORIZER_OUTPUT, consumer=_consumer) - return kwargs - - -DELETE_AUTHORIZER = APIOperation( - input=DeleteAuthorizerInput, - output=DeleteAuthorizerOutput, - schema=_SCHEMA_DELETE_AUTHORIZER, - input_schema=_SCHEMA_DELETE_AUTHORIZER_INPUT, - output_schema=_SCHEMA_DELETE_AUTHORIZER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteBasePathMappingInput: - """A request to delete the BasePathMapping resource.""" - - domain_name: str | None = None - """The domain name of the BasePathMapping resource to delete.""" - - domain_name_id: str | None = None - """ - The identifier for the domain name resource. Supported only for private - custom domain names. - """ - - base_path: str | None = None - """ - The base path name of the BasePathMapping resource to delete. - - To specify an empty base path, set this parameter to `'(none)'`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_BASE_PATH_MAPPING_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.domain_name is not None: - serializer.write_string( - _SCHEMA_DELETE_BASE_PATH_MAPPING_INPUT.members["domainName"], - self.domain_name, - ) - - if self.domain_name_id is not None: - serializer.write_string( - _SCHEMA_DELETE_BASE_PATH_MAPPING_INPUT.members["domainNameId"], - self.domain_name_id, - ) - - if self.base_path is not None: - serializer.write_string( - _SCHEMA_DELETE_BASE_PATH_MAPPING_INPUT.members["basePath"], - self.base_path, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["domain_name"] = de.read_string( - _SCHEMA_DELETE_BASE_PATH_MAPPING_INPUT.members["domainName"] - ) - - case 1: - kwargs["domain_name_id"] = de.read_string( - _SCHEMA_DELETE_BASE_PATH_MAPPING_INPUT.members["domainNameId"] - ) - - case 2: - kwargs["base_path"] = de.read_string( - _SCHEMA_DELETE_BASE_PATH_MAPPING_INPUT.members["basePath"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_BASE_PATH_MAPPING_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteBasePathMappingOutput: - """Dataclass for DeleteBasePathMappingOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_BASE_PATH_MAPPING_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_BASE_PATH_MAPPING_OUTPUT, consumer=_consumer - ) - return kwargs - - -DELETE_BASE_PATH_MAPPING = APIOperation( - input=DeleteBasePathMappingInput, - output=DeleteBasePathMappingOutput, - schema=_SCHEMA_DELETE_BASE_PATH_MAPPING, - input_schema=_SCHEMA_DELETE_BASE_PATH_MAPPING_INPUT, - output_schema=_SCHEMA_DELETE_BASE_PATH_MAPPING_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteClientCertificateInput: - """A request to delete the ClientCertificate resource.""" - - client_certificate_id: str | None = None - """The identifier of the ClientCertificate resource to be deleted.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_CLIENT_CERTIFICATE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.client_certificate_id is not None: - serializer.write_string( - _SCHEMA_DELETE_CLIENT_CERTIFICATE_INPUT.members["clientCertificateId"], - self.client_certificate_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["client_certificate_id"] = de.read_string( - _SCHEMA_DELETE_CLIENT_CERTIFICATE_INPUT.members[ - "clientCertificateId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_CLIENT_CERTIFICATE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteClientCertificateOutput: - """Dataclass for DeleteClientCertificateOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_CLIENT_CERTIFICATE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_CLIENT_CERTIFICATE_OUTPUT, consumer=_consumer - ) - return kwargs - - -DELETE_CLIENT_CERTIFICATE = APIOperation( - input=DeleteClientCertificateInput, - output=DeleteClientCertificateOutput, - schema=_SCHEMA_DELETE_CLIENT_CERTIFICATE, - input_schema=_SCHEMA_DELETE_CLIENT_CERTIFICATE_INPUT, - output_schema=_SCHEMA_DELETE_CLIENT_CERTIFICATE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteDeploymentInput: - """Requests API Gateway to delete a Deployment resource.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - deployment_id: str | None = None - """The identifier of the Deployment resource to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_DEPLOYMENT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_DELETE_DEPLOYMENT_INPUT.members["restApiId"], self.rest_api_id - ) - - if self.deployment_id is not None: - serializer.write_string( - _SCHEMA_DELETE_DEPLOYMENT_INPUT.members["deploymentId"], - self.deployment_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_DELETE_DEPLOYMENT_INPUT.members["restApiId"] - ) - - case 1: - kwargs["deployment_id"] = de.read_string( - _SCHEMA_DELETE_DEPLOYMENT_INPUT.members["deploymentId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_DEPLOYMENT_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteDeploymentOutput: - """Dataclass for DeleteDeploymentOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_DEPLOYMENT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_DEPLOYMENT_OUTPUT, consumer=_consumer) - return kwargs - - -DELETE_DEPLOYMENT = APIOperation( - input=DeleteDeploymentInput, - output=DeleteDeploymentOutput, - schema=_SCHEMA_DELETE_DEPLOYMENT, - input_schema=_SCHEMA_DELETE_DEPLOYMENT_INPUT, - output_schema=_SCHEMA_DELETE_DEPLOYMENT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteDocumentationPartInput: - """Deletes an existing documentation part of an API.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - documentation_part_id: str | None = None - """The identifier of the to-be-deleted documentation part.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_DOCUMENTATION_PART_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_DELETE_DOCUMENTATION_PART_INPUT.members["restApiId"], - self.rest_api_id, - ) - - if self.documentation_part_id is not None: - serializer.write_string( - _SCHEMA_DELETE_DOCUMENTATION_PART_INPUT.members["documentationPartId"], - self.documentation_part_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_DELETE_DOCUMENTATION_PART_INPUT.members["restApiId"] - ) - - case 1: - kwargs["documentation_part_id"] = de.read_string( - _SCHEMA_DELETE_DOCUMENTATION_PART_INPUT.members[ - "documentationPartId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_DOCUMENTATION_PART_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteDocumentationPartOutput: - """Dataclass for DeleteDocumentationPartOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_DOCUMENTATION_PART_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_DOCUMENTATION_PART_OUTPUT, consumer=_consumer - ) - return kwargs - - -DELETE_DOCUMENTATION_PART = APIOperation( - input=DeleteDocumentationPartInput, - output=DeleteDocumentationPartOutput, - schema=_SCHEMA_DELETE_DOCUMENTATION_PART, - input_schema=_SCHEMA_DELETE_DOCUMENTATION_PART_INPUT, - output_schema=_SCHEMA_DELETE_DOCUMENTATION_PART_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteDocumentationVersionInput: - """Deletes an existing documentation version of an API.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - documentation_version: str | None = None - """The version identifier of a to-be-deleted documentation snapshot.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_DOCUMENTATION_VERSION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_DELETE_DOCUMENTATION_VERSION_INPUT.members["restApiId"], - self.rest_api_id, - ) - - if self.documentation_version is not None: - serializer.write_string( - _SCHEMA_DELETE_DOCUMENTATION_VERSION_INPUT.members[ - "documentationVersion" - ], - self.documentation_version, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_DELETE_DOCUMENTATION_VERSION_INPUT.members["restApiId"] - ) - - case 1: - kwargs["documentation_version"] = de.read_string( - _SCHEMA_DELETE_DOCUMENTATION_VERSION_INPUT.members[ - "documentationVersion" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_DOCUMENTATION_VERSION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteDocumentationVersionOutput: - """Dataclass for DeleteDocumentationVersionOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_DOCUMENTATION_VERSION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_DOCUMENTATION_VERSION_OUTPUT, consumer=_consumer - ) - return kwargs - - -DELETE_DOCUMENTATION_VERSION = APIOperation( - input=DeleteDocumentationVersionInput, - output=DeleteDocumentationVersionOutput, - schema=_SCHEMA_DELETE_DOCUMENTATION_VERSION, - input_schema=_SCHEMA_DELETE_DOCUMENTATION_VERSION_INPUT, - output_schema=_SCHEMA_DELETE_DOCUMENTATION_VERSION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteDomainNameInput: - """A request to delete the DomainName resource.""" - - domain_name: str | None = None - """The name of the DomainName resource to be deleted.""" - - domain_name_id: str | None = None - """ - The identifier for the domain name resource. Supported only for private - custom domain names. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_DOMAIN_NAME_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.domain_name is not None: - serializer.write_string( - _SCHEMA_DELETE_DOMAIN_NAME_INPUT.members["domainName"], self.domain_name - ) - - if self.domain_name_id is not None: - serializer.write_string( - _SCHEMA_DELETE_DOMAIN_NAME_INPUT.members["domainNameId"], - self.domain_name_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["domain_name"] = de.read_string( - _SCHEMA_DELETE_DOMAIN_NAME_INPUT.members["domainName"] - ) - - case 1: - kwargs["domain_name_id"] = de.read_string( - _SCHEMA_DELETE_DOMAIN_NAME_INPUT.members["domainNameId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_DOMAIN_NAME_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteDomainNameOutput: - """Dataclass for DeleteDomainNameOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_DOMAIN_NAME_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_DOMAIN_NAME_OUTPUT, consumer=_consumer) - return kwargs - - -DELETE_DOMAIN_NAME = APIOperation( - input=DeleteDomainNameInput, - output=DeleteDomainNameOutput, - schema=_SCHEMA_DELETE_DOMAIN_NAME, - input_schema=_SCHEMA_DELETE_DOMAIN_NAME_INPUT, - output_schema=_SCHEMA_DELETE_DOMAIN_NAME_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteDomainNameAccessAssociationInput: - """Dataclass for DeleteDomainNameAccessAssociationInput structure.""" - - domain_name_access_association_arn: str | None = None - """The ARN of the domain name access association resource.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DELETE_DOMAIN_NAME_ACCESS_ASSOCIATION_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.domain_name_access_association_arn is not None: - serializer.write_string( - _SCHEMA_DELETE_DOMAIN_NAME_ACCESS_ASSOCIATION_INPUT.members[ - "domainNameAccessAssociationArn" - ], - self.domain_name_access_association_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["domain_name_access_association_arn"] = de.read_string( - _SCHEMA_DELETE_DOMAIN_NAME_ACCESS_ASSOCIATION_INPUT.members[ - "domainNameAccessAssociationArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_DOMAIN_NAME_ACCESS_ASSOCIATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteDomainNameAccessAssociationOutput: - """Dataclass for DeleteDomainNameAccessAssociationOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DELETE_DOMAIN_NAME_ACCESS_ASSOCIATION_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_DOMAIN_NAME_ACCESS_ASSOCIATION_OUTPUT, consumer=_consumer - ) - return kwargs - - -DELETE_DOMAIN_NAME_ACCESS_ASSOCIATION = APIOperation( - input=DeleteDomainNameAccessAssociationInput, - output=DeleteDomainNameAccessAssociationOutput, - schema=_SCHEMA_DELETE_DOMAIN_NAME_ACCESS_ASSOCIATION, - input_schema=_SCHEMA_DELETE_DOMAIN_NAME_ACCESS_ASSOCIATION_INPUT, - output_schema=_SCHEMA_DELETE_DOMAIN_NAME_ACCESS_ASSOCIATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -class GatewayResponseType(UnknownEnumMixin, StrEnum): - DEFAULT_4_XX = "DEFAULT_4XX" - DEFAULT_5_XX = "DEFAULT_5XX" - RESOURCE_NOT_FOUND = "RESOURCE_NOT_FOUND" - UNAUTHORIZED = "UNAUTHORIZED" - INVALID_API_KEY = "INVALID_API_KEY" - ACCESS_DENIED = "ACCESS_DENIED" - AUTHORIZER_FAILURE = "AUTHORIZER_FAILURE" - AUTHORIZER_CONFIGURATION_ERROR = "AUTHORIZER_CONFIGURATION_ERROR" - INVALID_SIGNATURE = "INVALID_SIGNATURE" - EXPIRED_TOKEN = "EXPIRED_TOKEN" - MISSING_AUTHENTICATION_TOKEN = "MISSING_AUTHENTICATION_TOKEN" - INTEGRATION_FAILURE = "INTEGRATION_FAILURE" - INTEGRATION_TIMEOUT = "INTEGRATION_TIMEOUT" - API_CONFIGURATION_ERROR = "API_CONFIGURATION_ERROR" - UNSUPPORTED_MEDIA_TYPE = "UNSUPPORTED_MEDIA_TYPE" - BAD_REQUEST_PARAMETERS = "BAD_REQUEST_PARAMETERS" - BAD_REQUEST_BODY = "BAD_REQUEST_BODY" - REQUEST_TOO_LARGE = "REQUEST_TOO_LARGE" - THROTTLED = "THROTTLED" - QUOTA_EXCEEDED = "QUOTA_EXCEEDED" - WAF_FILTERED = "WAF_FILTERED" - - -@dataclass(kw_only=True) -class DeleteGatewayResponseInput: - """ - Clears any customization of a GatewayResponse of a specified response - type on the given RestApi and resets it with the default settings. - """ - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - response_type: str | None = None - """The response type of the associated GatewayResponse.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_GATEWAY_RESPONSE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_DELETE_GATEWAY_RESPONSE_INPUT.members["restApiId"], - self.rest_api_id, - ) - - if self.response_type is not None: - serializer.write_string( - _SCHEMA_DELETE_GATEWAY_RESPONSE_INPUT.members["responseType"], - self.response_type, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_DELETE_GATEWAY_RESPONSE_INPUT.members["restApiId"] - ) - - case 1: - kwargs["response_type"] = GatewayResponseType( - de.read_string( - _SCHEMA_DELETE_GATEWAY_RESPONSE_INPUT.members[ - "responseType" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_GATEWAY_RESPONSE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteGatewayResponseOutput: - """Dataclass for DeleteGatewayResponseOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_GATEWAY_RESPONSE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_GATEWAY_RESPONSE_OUTPUT, consumer=_consumer - ) - return kwargs - - -DELETE_GATEWAY_RESPONSE = APIOperation( - input=DeleteGatewayResponseInput, - output=DeleteGatewayResponseOutput, - schema=_SCHEMA_DELETE_GATEWAY_RESPONSE, - input_schema=_SCHEMA_DELETE_GATEWAY_RESPONSE_INPUT, - output_schema=_SCHEMA_DELETE_GATEWAY_RESPONSE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteIntegrationInput: - """Represents a delete integration request.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - resource_id: str | None = None - """Specifies a delete integration request's resource identifier.""" - - http_method: str | None = None - """Specifies a delete integration request's HTTP method.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_INTEGRATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_DELETE_INTEGRATION_INPUT.members["restApiId"], self.rest_api_id - ) - - if self.resource_id is not None: - serializer.write_string( - _SCHEMA_DELETE_INTEGRATION_INPUT.members["resourceId"], self.resource_id - ) - - if self.http_method is not None: - serializer.write_string( - _SCHEMA_DELETE_INTEGRATION_INPUT.members["httpMethod"], self.http_method - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_DELETE_INTEGRATION_INPUT.members["restApiId"] - ) - - case 1: - kwargs["resource_id"] = de.read_string( - _SCHEMA_DELETE_INTEGRATION_INPUT.members["resourceId"] - ) - - case 2: - kwargs["http_method"] = de.read_string( - _SCHEMA_DELETE_INTEGRATION_INPUT.members["httpMethod"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_INTEGRATION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteIntegrationOutput: - """Dataclass for DeleteIntegrationOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_INTEGRATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_INTEGRATION_OUTPUT, consumer=_consumer) - return kwargs - - -DELETE_INTEGRATION = APIOperation( - input=DeleteIntegrationInput, - output=DeleteIntegrationOutput, - schema=_SCHEMA_DELETE_INTEGRATION, - input_schema=_SCHEMA_DELETE_INTEGRATION_INPUT, - output_schema=_SCHEMA_DELETE_INTEGRATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteIntegrationResponseInput: - """Represents a delete integration response request.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - resource_id: str | None = None - """Specifies a delete integration response request's resource identifier.""" - - http_method: str | None = None - """Specifies a delete integration response request's HTTP method.""" - - status_code: str | None = None - """Specifies a delete integration response request's status code.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_INTEGRATION_RESPONSE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_DELETE_INTEGRATION_RESPONSE_INPUT.members["restApiId"], - self.rest_api_id, - ) - - if self.resource_id is not None: - serializer.write_string( - _SCHEMA_DELETE_INTEGRATION_RESPONSE_INPUT.members["resourceId"], - self.resource_id, - ) - - if self.http_method is not None: - serializer.write_string( - _SCHEMA_DELETE_INTEGRATION_RESPONSE_INPUT.members["httpMethod"], - self.http_method, - ) - - if self.status_code is not None: - serializer.write_string( - _SCHEMA_DELETE_INTEGRATION_RESPONSE_INPUT.members["statusCode"], - self.status_code, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_DELETE_INTEGRATION_RESPONSE_INPUT.members["restApiId"] - ) - - case 1: - kwargs["resource_id"] = de.read_string( - _SCHEMA_DELETE_INTEGRATION_RESPONSE_INPUT.members["resourceId"] - ) - - case 2: - kwargs["http_method"] = de.read_string( - _SCHEMA_DELETE_INTEGRATION_RESPONSE_INPUT.members["httpMethod"] - ) - - case 3: - kwargs["status_code"] = de.read_string( - _SCHEMA_DELETE_INTEGRATION_RESPONSE_INPUT.members["statusCode"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_INTEGRATION_RESPONSE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteIntegrationResponseOutput: - """Dataclass for DeleteIntegrationResponseOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_INTEGRATION_RESPONSE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_INTEGRATION_RESPONSE_OUTPUT, consumer=_consumer - ) - return kwargs - - -DELETE_INTEGRATION_RESPONSE = APIOperation( - input=DeleteIntegrationResponseInput, - output=DeleteIntegrationResponseOutput, - schema=_SCHEMA_DELETE_INTEGRATION_RESPONSE, - input_schema=_SCHEMA_DELETE_INTEGRATION_RESPONSE_INPUT, - output_schema=_SCHEMA_DELETE_INTEGRATION_RESPONSE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteMethodInput: - """Request to delete an existing Method resource.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - resource_id: str | None = None - """The Resource identifier for the Method resource.""" - - http_method: str | None = None - """The HTTP verb of the Method resource.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_METHOD_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_DELETE_METHOD_INPUT.members["restApiId"], self.rest_api_id - ) - - if self.resource_id is not None: - serializer.write_string( - _SCHEMA_DELETE_METHOD_INPUT.members["resourceId"], self.resource_id - ) - - if self.http_method is not None: - serializer.write_string( - _SCHEMA_DELETE_METHOD_INPUT.members["httpMethod"], self.http_method - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_DELETE_METHOD_INPUT.members["restApiId"] - ) - - case 1: - kwargs["resource_id"] = de.read_string( - _SCHEMA_DELETE_METHOD_INPUT.members["resourceId"] - ) - - case 2: - kwargs["http_method"] = de.read_string( - _SCHEMA_DELETE_METHOD_INPUT.members["httpMethod"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_METHOD_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteMethodOutput: - """Dataclass for DeleteMethodOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_METHOD_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_METHOD_OUTPUT, consumer=_consumer) - return kwargs - - -DELETE_METHOD = APIOperation( - input=DeleteMethodInput, - output=DeleteMethodOutput, - schema=_SCHEMA_DELETE_METHOD, - input_schema=_SCHEMA_DELETE_METHOD_INPUT, - output_schema=_SCHEMA_DELETE_METHOD_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteMethodResponseInput: - """A request to delete an existing MethodResponse resource.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - resource_id: str | None = None - """The Resource identifier for the MethodResponse resource.""" - - http_method: str | None = None - """The HTTP verb of the Method resource.""" - - status_code: str | None = None - """The status code identifier for the MethodResponse resource.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_METHOD_RESPONSE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_DELETE_METHOD_RESPONSE_INPUT.members["restApiId"], - self.rest_api_id, - ) - - if self.resource_id is not None: - serializer.write_string( - _SCHEMA_DELETE_METHOD_RESPONSE_INPUT.members["resourceId"], - self.resource_id, - ) - - if self.http_method is not None: - serializer.write_string( - _SCHEMA_DELETE_METHOD_RESPONSE_INPUT.members["httpMethod"], - self.http_method, - ) - - if self.status_code is not None: - serializer.write_string( - _SCHEMA_DELETE_METHOD_RESPONSE_INPUT.members["statusCode"], - self.status_code, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_DELETE_METHOD_RESPONSE_INPUT.members["restApiId"] - ) - - case 1: - kwargs["resource_id"] = de.read_string( - _SCHEMA_DELETE_METHOD_RESPONSE_INPUT.members["resourceId"] - ) - - case 2: - kwargs["http_method"] = de.read_string( - _SCHEMA_DELETE_METHOD_RESPONSE_INPUT.members["httpMethod"] - ) - - case 3: - kwargs["status_code"] = de.read_string( - _SCHEMA_DELETE_METHOD_RESPONSE_INPUT.members["statusCode"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_METHOD_RESPONSE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteMethodResponseOutput: - """Dataclass for DeleteMethodResponseOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_METHOD_RESPONSE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_METHOD_RESPONSE_OUTPUT, consumer=_consumer - ) - return kwargs - - -DELETE_METHOD_RESPONSE = APIOperation( - input=DeleteMethodResponseInput, - output=DeleteMethodResponseOutput, - schema=_SCHEMA_DELETE_METHOD_RESPONSE, - input_schema=_SCHEMA_DELETE_METHOD_RESPONSE_INPUT, - output_schema=_SCHEMA_DELETE_METHOD_RESPONSE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteModelInput: - """Request to delete an existing model in an existing RestApi resource.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - model_name: str | None = None - """The name of the model to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_MODEL_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_DELETE_MODEL_INPUT.members["restApiId"], self.rest_api_id - ) - - if self.model_name is not None: - serializer.write_string( - _SCHEMA_DELETE_MODEL_INPUT.members["modelName"], self.model_name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_DELETE_MODEL_INPUT.members["restApiId"] - ) - - case 1: - kwargs["model_name"] = de.read_string( - _SCHEMA_DELETE_MODEL_INPUT.members["modelName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_MODEL_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteModelOutput: - """Dataclass for DeleteModelOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_MODEL_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_MODEL_OUTPUT, consumer=_consumer) - return kwargs - - -DELETE_MODEL = APIOperation( - input=DeleteModelInput, - output=DeleteModelOutput, - schema=_SCHEMA_DELETE_MODEL, - input_schema=_SCHEMA_DELETE_MODEL_INPUT, - output_schema=_SCHEMA_DELETE_MODEL_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteRequestValidatorInput: - """Deletes a specified RequestValidator of a given RestApi.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - request_validator_id: str | None = None - """The identifier of the RequestValidator to be deleted.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_REQUEST_VALIDATOR_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_DELETE_REQUEST_VALIDATOR_INPUT.members["restApiId"], - self.rest_api_id, - ) - - if self.request_validator_id is not None: - serializer.write_string( - _SCHEMA_DELETE_REQUEST_VALIDATOR_INPUT.members["requestValidatorId"], - self.request_validator_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_DELETE_REQUEST_VALIDATOR_INPUT.members["restApiId"] - ) - - case 1: - kwargs["request_validator_id"] = de.read_string( - _SCHEMA_DELETE_REQUEST_VALIDATOR_INPUT.members[ - "requestValidatorId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_REQUEST_VALIDATOR_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteRequestValidatorOutput: - """Dataclass for DeleteRequestValidatorOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_REQUEST_VALIDATOR_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_REQUEST_VALIDATOR_OUTPUT, consumer=_consumer - ) - return kwargs - - -DELETE_REQUEST_VALIDATOR = APIOperation( - input=DeleteRequestValidatorInput, - output=DeleteRequestValidatorOutput, - schema=_SCHEMA_DELETE_REQUEST_VALIDATOR, - input_schema=_SCHEMA_DELETE_REQUEST_VALIDATOR_INPUT, - output_schema=_SCHEMA_DELETE_REQUEST_VALIDATOR_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteResourceInput: - """Request to delete a Resource.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - resource_id: str | None = None - """The identifier of the Resource resource.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_RESOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_DELETE_RESOURCE_INPUT.members["restApiId"], self.rest_api_id - ) - - if self.resource_id is not None: - serializer.write_string( - _SCHEMA_DELETE_RESOURCE_INPUT.members["resourceId"], self.resource_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_DELETE_RESOURCE_INPUT.members["restApiId"] - ) - - case 1: - kwargs["resource_id"] = de.read_string( - _SCHEMA_DELETE_RESOURCE_INPUT.members["resourceId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_RESOURCE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteResourceOutput: - """Dataclass for DeleteResourceOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_RESOURCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_RESOURCE_OUTPUT, consumer=_consumer) - return kwargs - - -DELETE_RESOURCE = APIOperation( - input=DeleteResourceInput, - output=DeleteResourceOutput, - schema=_SCHEMA_DELETE_RESOURCE, - input_schema=_SCHEMA_DELETE_RESOURCE_INPUT, - output_schema=_SCHEMA_DELETE_RESOURCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteRestApiInput: - """Request to delete the specified API from your collection.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_REST_API_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_DELETE_REST_API_INPUT.members["restApiId"], self.rest_api_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_DELETE_REST_API_INPUT.members["restApiId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_REST_API_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteRestApiOutput: - """Dataclass for DeleteRestApiOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_REST_API_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_REST_API_OUTPUT, consumer=_consumer) - return kwargs - - -DELETE_REST_API = APIOperation( - input=DeleteRestApiInput, - output=DeleteRestApiOutput, - schema=_SCHEMA_DELETE_REST_API, - input_schema=_SCHEMA_DELETE_REST_API_INPUT, - output_schema=_SCHEMA_DELETE_REST_API_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteStageInput: - """Requests API Gateway to delete a Stage resource.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - stage_name: str | None = None - """The name of the Stage resource to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_STAGE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_DELETE_STAGE_INPUT.members["restApiId"], self.rest_api_id - ) - - if self.stage_name is not None: - serializer.write_string( - _SCHEMA_DELETE_STAGE_INPUT.members["stageName"], self.stage_name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_DELETE_STAGE_INPUT.members["restApiId"] - ) - - case 1: - kwargs["stage_name"] = de.read_string( - _SCHEMA_DELETE_STAGE_INPUT.members["stageName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_STAGE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteStageOutput: - """Dataclass for DeleteStageOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_STAGE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_STAGE_OUTPUT, consumer=_consumer) - return kwargs - - -DELETE_STAGE = APIOperation( - input=DeleteStageInput, - output=DeleteStageOutput, - schema=_SCHEMA_DELETE_STAGE, - input_schema=_SCHEMA_DELETE_STAGE_INPUT, - output_schema=_SCHEMA_DELETE_STAGE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteUsagePlanInput: - """The DELETE request to delete a usage plan of a given plan Id.""" - - usage_plan_id: str | None = None - """The Id of the to-be-deleted usage plan.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_USAGE_PLAN_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.usage_plan_id is not None: - serializer.write_string( - _SCHEMA_DELETE_USAGE_PLAN_INPUT.members["usagePlanId"], - self.usage_plan_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["usage_plan_id"] = de.read_string( - _SCHEMA_DELETE_USAGE_PLAN_INPUT.members["usagePlanId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_USAGE_PLAN_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteUsagePlanOutput: - """Dataclass for DeleteUsagePlanOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_USAGE_PLAN_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_USAGE_PLAN_OUTPUT, consumer=_consumer) - return kwargs - - -DELETE_USAGE_PLAN = APIOperation( - input=DeleteUsagePlanInput, - output=DeleteUsagePlanOutput, - schema=_SCHEMA_DELETE_USAGE_PLAN, - input_schema=_SCHEMA_DELETE_USAGE_PLAN_INPUT, - output_schema=_SCHEMA_DELETE_USAGE_PLAN_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteUsagePlanKeyInput: - """ - The DELETE request to delete a usage plan key and remove the underlying - API key from the associated usage plan. - """ - - usage_plan_id: str | None = None - """ - The Id of the UsagePlan resource representing the usage plan containing - the to-be-deleted UsagePlanKey resource representing a plan customer. - """ - - key_id: str | None = None - """The Id of the UsagePlanKey resource to be deleted.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_USAGE_PLAN_KEY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.usage_plan_id is not None: - serializer.write_string( - _SCHEMA_DELETE_USAGE_PLAN_KEY_INPUT.members["usagePlanId"], - self.usage_plan_id, - ) - - if self.key_id is not None: - serializer.write_string( - _SCHEMA_DELETE_USAGE_PLAN_KEY_INPUT.members["keyId"], self.key_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["usage_plan_id"] = de.read_string( - _SCHEMA_DELETE_USAGE_PLAN_KEY_INPUT.members["usagePlanId"] - ) - - case 1: - kwargs["key_id"] = de.read_string( - _SCHEMA_DELETE_USAGE_PLAN_KEY_INPUT.members["keyId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_USAGE_PLAN_KEY_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteUsagePlanKeyOutput: - """Dataclass for DeleteUsagePlanKeyOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_USAGE_PLAN_KEY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_USAGE_PLAN_KEY_OUTPUT, consumer=_consumer - ) - return kwargs - - -DELETE_USAGE_PLAN_KEY = APIOperation( - input=DeleteUsagePlanKeyInput, - output=DeleteUsagePlanKeyOutput, - schema=_SCHEMA_DELETE_USAGE_PLAN_KEY, - input_schema=_SCHEMA_DELETE_USAGE_PLAN_KEY_INPUT, - output_schema=_SCHEMA_DELETE_USAGE_PLAN_KEY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteVpcLinkInput: - """Deletes an existing VpcLink of a specified identifier.""" - - vpc_link_id: str | None = None - """ - The identifier of the VpcLink. It is used in an Integration to reference - this VpcLink. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_VPC_LINK_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.vpc_link_id is not None: - serializer.write_string( - _SCHEMA_DELETE_VPC_LINK_INPUT.members["vpcLinkId"], self.vpc_link_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["vpc_link_id"] = de.read_string( - _SCHEMA_DELETE_VPC_LINK_INPUT.members["vpcLinkId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_VPC_LINK_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteVpcLinkOutput: - """Dataclass for DeleteVpcLinkOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_VPC_LINK_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_VPC_LINK_OUTPUT, consumer=_consumer) - return kwargs - - -DELETE_VPC_LINK = APIOperation( - input=DeleteVpcLinkInput, - output=DeleteVpcLinkOutput, - schema=_SCHEMA_DELETE_VPC_LINK, - input_schema=_SCHEMA_DELETE_VPC_LINK_INPUT, - output_schema=_SCHEMA_DELETE_VPC_LINK_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class FlushStageAuthorizersCacheInput: - """Request to flush authorizer cache entries on a specified stage.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - stage_name: str | None = None - """The name of the stage to flush.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLUSH_STAGE_AUTHORIZERS_CACHE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_FLUSH_STAGE_AUTHORIZERS_CACHE_INPUT.members["restApiId"], - self.rest_api_id, - ) - - if self.stage_name is not None: - serializer.write_string( - _SCHEMA_FLUSH_STAGE_AUTHORIZERS_CACHE_INPUT.members["stageName"], - self.stage_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_FLUSH_STAGE_AUTHORIZERS_CACHE_INPUT.members["restApiId"] - ) - - case 1: - kwargs["stage_name"] = de.read_string( - _SCHEMA_FLUSH_STAGE_AUTHORIZERS_CACHE_INPUT.members["stageName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_FLUSH_STAGE_AUTHORIZERS_CACHE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class FlushStageAuthorizersCacheOutput: - """Dataclass for FlushStageAuthorizersCacheOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLUSH_STAGE_AUTHORIZERS_CACHE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_FLUSH_STAGE_AUTHORIZERS_CACHE_OUTPUT, consumer=_consumer - ) - return kwargs - - -FLUSH_STAGE_AUTHORIZERS_CACHE = APIOperation( - input=FlushStageAuthorizersCacheInput, - output=FlushStageAuthorizersCacheOutput, - schema=_SCHEMA_FLUSH_STAGE_AUTHORIZERS_CACHE, - input_schema=_SCHEMA_FLUSH_STAGE_AUTHORIZERS_CACHE_INPUT, - output_schema=_SCHEMA_FLUSH_STAGE_AUTHORIZERS_CACHE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class FlushStageCacheInput: - """Requests API Gateway to flush a stage's cache.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - stage_name: str | None = None - """The name of the stage to flush its cache.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLUSH_STAGE_CACHE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_FLUSH_STAGE_CACHE_INPUT.members["restApiId"], self.rest_api_id - ) - - if self.stage_name is not None: - serializer.write_string( - _SCHEMA_FLUSH_STAGE_CACHE_INPUT.members["stageName"], self.stage_name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_FLUSH_STAGE_CACHE_INPUT.members["restApiId"] - ) - - case 1: - kwargs["stage_name"] = de.read_string( - _SCHEMA_FLUSH_STAGE_CACHE_INPUT.members["stageName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FLUSH_STAGE_CACHE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class FlushStageCacheOutput: - """Dataclass for FlushStageCacheOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLUSH_STAGE_CACHE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FLUSH_STAGE_CACHE_OUTPUT, consumer=_consumer) - return kwargs - - -FLUSH_STAGE_CACHE = APIOperation( - input=FlushStageCacheInput, - output=FlushStageCacheOutput, - schema=_SCHEMA_FLUSH_STAGE_CACHE, - input_schema=_SCHEMA_FLUSH_STAGE_CACHE_INPUT, - output_schema=_SCHEMA_FLUSH_STAGE_CACHE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GenerateClientCertificateInput: - """A request to generate a ClientCertificate resource.""" - - description: str | None = None - """The description of the ClientCertificate.""" - - tags: dict[str, str] | None = None - """ - The key-value map of strings. The valid character set is - [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not - start with `aws:`. The tag value can be up to 256 characters. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GENERATE_CLIENT_CERTIFICATE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.description is not None: - serializer.write_string( - _SCHEMA_GENERATE_CLIENT_CERTIFICATE_INPUT.members["description"], - self.description, - ) - - if self.tags is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_GENERATE_CLIENT_CERTIFICATE_INPUT.members["tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["description"] = de.read_string( - _SCHEMA_GENERATE_CLIENT_CERTIFICATE_INPUT.members["description"] - ) - - case 1: - kwargs["tags"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_GENERATE_CLIENT_CERTIFICATE_INPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GENERATE_CLIENT_CERTIFICATE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GenerateClientCertificateOutput: - """ - Represents a client certificate used to configure client-side SSL - authentication while sending requests to the integration endpoint. - """ - - client_certificate_id: str | None = None - """The identifier of the client certificate.""" - - description: str | None = None - """The description of the client certificate.""" - - pem_encoded_certificate: str | None = None - """ - The PEM-encoded public key of the client certificate, which can be used - to configure certificate authentication in the integration endpoint . - """ - - created_date: datetime | None = None - """The timestamp when the client certificate was created.""" - - expiration_date: datetime | None = None - """The timestamp when the client certificate will expire.""" - - tags: dict[str, str] | None = None - """ - The collection of tags. Each tag element is associated with a given - resource. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GENERATE_CLIENT_CERTIFICATE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.client_certificate_id is not None: - serializer.write_string( - _SCHEMA_GENERATE_CLIENT_CERTIFICATE_OUTPUT.members[ - "clientCertificateId" - ], - self.client_certificate_id, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_GENERATE_CLIENT_CERTIFICATE_OUTPUT.members["description"], - self.description, - ) - - if self.pem_encoded_certificate is not None: - serializer.write_string( - _SCHEMA_GENERATE_CLIENT_CERTIFICATE_OUTPUT.members[ - "pemEncodedCertificate" - ], - self.pem_encoded_certificate, - ) - - if self.created_date is not None: - serializer.write_timestamp( - _SCHEMA_GENERATE_CLIENT_CERTIFICATE_OUTPUT.members["createdDate"], - self.created_date, - ) - - if self.expiration_date is not None: - serializer.write_timestamp( - _SCHEMA_GENERATE_CLIENT_CERTIFICATE_OUTPUT.members["expirationDate"], - self.expiration_date, - ) - - if self.tags is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_GENERATE_CLIENT_CERTIFICATE_OUTPUT.members["tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["client_certificate_id"] = de.read_string( - _SCHEMA_GENERATE_CLIENT_CERTIFICATE_OUTPUT.members[ - "clientCertificateId" - ] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_GENERATE_CLIENT_CERTIFICATE_OUTPUT.members[ - "description" - ] - ) - - case 2: - kwargs["pem_encoded_certificate"] = de.read_string( - _SCHEMA_GENERATE_CLIENT_CERTIFICATE_OUTPUT.members[ - "pemEncodedCertificate" - ] - ) - - case 3: - kwargs["created_date"] = de.read_timestamp( - _SCHEMA_GENERATE_CLIENT_CERTIFICATE_OUTPUT.members[ - "createdDate" - ] - ) - - case 4: - kwargs["expiration_date"] = de.read_timestamp( - _SCHEMA_GENERATE_CLIENT_CERTIFICATE_OUTPUT.members[ - "expirationDate" - ] - ) - - case 5: - kwargs["tags"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_GENERATE_CLIENT_CERTIFICATE_OUTPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GENERATE_CLIENT_CERTIFICATE_OUTPUT, consumer=_consumer - ) - return kwargs - - -GENERATE_CLIENT_CERTIFICATE = APIOperation( - input=GenerateClientCertificateInput, - output=GenerateClientCertificateOutput, - schema=_SCHEMA_GENERATE_CLIENT_CERTIFICATE, - input_schema=_SCHEMA_GENERATE_CLIENT_CERTIFICATE_INPUT, - output_schema=_SCHEMA_GENERATE_CLIENT_CERTIFICATE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetAccountInput: - """ - Requests API Gateway to get information about the current Account - resource. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_ACCOUNT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_ACCOUNT_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetAccountOutput: - """Represents an AWS account that is associated with API Gateway.""" - - cloudwatch_role_arn: str | None = None - """The ARN of an Amazon CloudWatch role for the current Account.""" - - throttle_settings: ThrottleSettings | None = None - """Specifies the API request limits configured for the current Account.""" - - features: list[str] | None = None - """ - A list of features supported for the account. When usage plans are - enabled, the features list will include an entry of `"UsagePlans"`. - """ - - api_key_version: str | None = None - """The version of the API keys used for the account.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_ACCOUNT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.cloudwatch_role_arn is not None: - serializer.write_string( - _SCHEMA_GET_ACCOUNT_OUTPUT.members["cloudwatchRoleArn"], - self.cloudwatch_role_arn, - ) - - if self.throttle_settings is not None: - serializer.write_struct( - _SCHEMA_GET_ACCOUNT_OUTPUT.members["throttleSettings"], - self.throttle_settings, - ) - - if self.features is not None: - _serialize_list_of_string( - serializer, - _SCHEMA_GET_ACCOUNT_OUTPUT.members["features"], - self.features, - ) - - if self.api_key_version is not None: - serializer.write_string( - _SCHEMA_GET_ACCOUNT_OUTPUT.members["apiKeyVersion"], - self.api_key_version, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["cloudwatch_role_arn"] = de.read_string( - _SCHEMA_GET_ACCOUNT_OUTPUT.members["cloudwatchRoleArn"] - ) - - case 1: - kwargs["throttle_settings"] = ThrottleSettings.deserialize(de) - - case 2: - kwargs["features"] = _deserialize_list_of_string( - de, _SCHEMA_GET_ACCOUNT_OUTPUT.members["features"] - ) - - case 3: - kwargs["api_key_version"] = de.read_string( - _SCHEMA_GET_ACCOUNT_OUTPUT.members["apiKeyVersion"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_ACCOUNT_OUTPUT, consumer=_consumer) - return kwargs - - -GET_ACCOUNT = APIOperation( - input=GetAccountInput, - output=GetAccountOutput, - schema=_SCHEMA_GET_ACCOUNT, - input_schema=_SCHEMA_GET_ACCOUNT_INPUT, - output_schema=_SCHEMA_GET_ACCOUNT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetApiKeyInput: - """A request to get information about the current ApiKey resource.""" - - api_key: str | None = None - """The identifier of the ApiKey resource.""" - - include_value: bool | None = None - """ - A boolean flag to specify whether (`true`) or not (`false`) the result - contains the key value. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_API_KEY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.api_key is not None: - serializer.write_string( - _SCHEMA_GET_API_KEY_INPUT.members["apiKey"], self.api_key - ) - - if self.include_value is not None: - serializer.write_boolean( - _SCHEMA_GET_API_KEY_INPUT.members["includeValue"], self.include_value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["api_key"] = de.read_string( - _SCHEMA_GET_API_KEY_INPUT.members["apiKey"] - ) - - case 1: - kwargs["include_value"] = de.read_boolean( - _SCHEMA_GET_API_KEY_INPUT.members["includeValue"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_API_KEY_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetApiKeyOutput: - """ - A resource that can be distributed to callers for executing Method - resources that require an API key. API keys can be mapped to any Stage - on any RestApi, which indicates that the callers with the API key can - make requests to that stage. - """ - - id: str | None = None - """The identifier of the API Key.""" - - value: str | None = None - """The value of the API Key.""" - - name: str | None = None - """The name of the API Key.""" - - customer_id: str | None = None - """ - An Amazon Web Services Marketplace customer identifier, when integrating - with the Amazon Web Services SaaS Marketplace. - """ - - description: str | None = None - """The description of the API Key.""" - - enabled: bool = False - """Specifies whether the API Key can be used by callers.""" - - created_date: datetime | None = None - """The timestamp when the API Key was created.""" - - last_updated_date: datetime | None = None - """The timestamp when the API Key was last updated.""" - - stage_keys: list[str] | None = None - """A list of Stage resources that are associated with the ApiKey resource.""" - - tags: dict[str, str] | None = None - """ - The collection of tags. Each tag element is associated with a given - resource. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_API_KEY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string(_SCHEMA_GET_API_KEY_OUTPUT.members["id"], self.id) - - if self.value is not None: - serializer.write_string( - _SCHEMA_GET_API_KEY_OUTPUT.members["value"], self.value - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_GET_API_KEY_OUTPUT.members["name"], self.name - ) - - if self.customer_id is not None: - serializer.write_string( - _SCHEMA_GET_API_KEY_OUTPUT.members["customerId"], self.customer_id - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_API_KEY_OUTPUT.members["description"], self.description - ) - - serializer.write_boolean( - _SCHEMA_GET_API_KEY_OUTPUT.members["enabled"], self.enabled - ) - if self.created_date is not None: - serializer.write_timestamp( - _SCHEMA_GET_API_KEY_OUTPUT.members["createdDate"], self.created_date - ) - - if self.last_updated_date is not None: - serializer.write_timestamp( - _SCHEMA_GET_API_KEY_OUTPUT.members["lastUpdatedDate"], - self.last_updated_date, - ) - - if self.stage_keys is not None: - _serialize_list_of_string( - serializer, - _SCHEMA_GET_API_KEY_OUTPUT.members["stageKeys"], - self.stage_keys, - ) - - if self.tags is not None: - _serialize_map_of_string_to_string( - serializer, _SCHEMA_GET_API_KEY_OUTPUT.members["tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_GET_API_KEY_OUTPUT.members["id"] - ) - - case 1: - kwargs["value"] = de.read_string( - _SCHEMA_GET_API_KEY_OUTPUT.members["value"] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_GET_API_KEY_OUTPUT.members["name"] - ) - - case 3: - kwargs["customer_id"] = de.read_string( - _SCHEMA_GET_API_KEY_OUTPUT.members["customerId"] - ) - - case 4: - kwargs["description"] = de.read_string( - _SCHEMA_GET_API_KEY_OUTPUT.members["description"] - ) - - case 5: - kwargs["enabled"] = de.read_boolean( - _SCHEMA_GET_API_KEY_OUTPUT.members["enabled"] - ) - - case 6: - kwargs["created_date"] = de.read_timestamp( - _SCHEMA_GET_API_KEY_OUTPUT.members["createdDate"] - ) - - case 7: - kwargs["last_updated_date"] = de.read_timestamp( - _SCHEMA_GET_API_KEY_OUTPUT.members["lastUpdatedDate"] - ) - - case 8: - kwargs["stage_keys"] = _deserialize_list_of_string( - de, _SCHEMA_GET_API_KEY_OUTPUT.members["stageKeys"] - ) - - case 9: - kwargs["tags"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_GET_API_KEY_OUTPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_API_KEY_OUTPUT, consumer=_consumer) - return kwargs - - -GET_API_KEY = APIOperation( - input=GetApiKeyInput, - output=GetApiKeyOutput, - schema=_SCHEMA_GET_API_KEY, - input_schema=_SCHEMA_GET_API_KEY_INPUT, - output_schema=_SCHEMA_GET_API_KEY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetApiKeysInput: - """A request to get information about the current ApiKeys resource.""" - - position: str | None = None - """The current pagination position in the paged result set.""" - - limit: int | None = None - """ - The maximum number of returned results per page. The default value is 25 - and the maximum value is 500. - """ - - name_query: str | None = None - """The name of queried API keys.""" - - customer_id: str | None = None - """ - The identifier of a customer in Amazon Web Services Marketplace or an - external system, such as a developer portal. - """ - - include_values: bool | None = None - """ - A boolean flag to specify whether (`true`) or not (`false`) the result - contains key values. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_API_KEYS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.position is not None: - serializer.write_string( - _SCHEMA_GET_API_KEYS_INPUT.members["position"], self.position - ) - - if self.limit is not None: - serializer.write_integer( - _SCHEMA_GET_API_KEYS_INPUT.members["limit"], self.limit - ) - - if self.name_query is not None: - serializer.write_string( - _SCHEMA_GET_API_KEYS_INPUT.members["nameQuery"], self.name_query - ) - - if self.customer_id is not None: - serializer.write_string( - _SCHEMA_GET_API_KEYS_INPUT.members["customerId"], self.customer_id - ) - - if self.include_values is not None: - serializer.write_boolean( - _SCHEMA_GET_API_KEYS_INPUT.members["includeValues"], self.include_values - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["position"] = de.read_string( - _SCHEMA_GET_API_KEYS_INPUT.members["position"] - ) - - case 1: - kwargs["limit"] = de.read_integer( - _SCHEMA_GET_API_KEYS_INPUT.members["limit"] - ) - - case 2: - kwargs["name_query"] = de.read_string( - _SCHEMA_GET_API_KEYS_INPUT.members["nameQuery"] - ) - - case 3: - kwargs["customer_id"] = de.read_string( - _SCHEMA_GET_API_KEYS_INPUT.members["customerId"] - ) - - case 4: - kwargs["include_values"] = de.read_boolean( - _SCHEMA_GET_API_KEYS_INPUT.members["includeValues"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_API_KEYS_INPUT, consumer=_consumer) - return kwargs - - -def _serialize_list_of_api_key( - serializer: ShapeSerializer, schema: Schema, value: list[ApiKey] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_list_of_api_key( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ApiKey]: - result: list[ApiKey] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ApiKey.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GetApiKeysOutput: - """ - Represents a collection of API keys as represented by an ApiKeys - resource. - """ - - warnings: list[str] | None = None - """ - A list of warning messages logged during the import of API keys when the - `failOnWarnings` option is set to true. - """ - - items: list[ApiKey] | None = None - """The current page of elements from this collection.""" - - position: str | None = None - """The current pagination position in the paged result set.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_API_KEYS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.warnings is not None: - _serialize_list_of_string( - serializer, - _SCHEMA_GET_API_KEYS_OUTPUT.members["warnings"], - self.warnings, - ) - - if self.items is not None: - _serialize_list_of_api_key( - serializer, _SCHEMA_GET_API_KEYS_OUTPUT.members["items"], self.items - ) - - if self.position is not None: - serializer.write_string( - _SCHEMA_GET_API_KEYS_OUTPUT.members["position"], self.position - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["warnings"] = _deserialize_list_of_string( - de, _SCHEMA_GET_API_KEYS_OUTPUT.members["warnings"] - ) - - case 1: - kwargs["items"] = _deserialize_list_of_api_key( - de, _SCHEMA_GET_API_KEYS_OUTPUT.members["items"] - ) - - case 2: - kwargs["position"] = de.read_string( - _SCHEMA_GET_API_KEYS_OUTPUT.members["position"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_API_KEYS_OUTPUT, consumer=_consumer) - return kwargs - - -GET_API_KEYS = APIOperation( - input=GetApiKeysInput, - output=GetApiKeysOutput, - schema=_SCHEMA_GET_API_KEYS, - input_schema=_SCHEMA_GET_API_KEYS_INPUT, - output_schema=_SCHEMA_GET_API_KEYS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetAuthorizerInput: - """Request to describe an existing Authorizer resource.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - authorizer_id: str | None = None - """The identifier of the Authorizer resource.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_AUTHORIZER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_GET_AUTHORIZER_INPUT.members["restApiId"], self.rest_api_id - ) - - if self.authorizer_id is not None: - serializer.write_string( - _SCHEMA_GET_AUTHORIZER_INPUT.members["authorizerId"], self.authorizer_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_GET_AUTHORIZER_INPUT.members["restApiId"] - ) - - case 1: - kwargs["authorizer_id"] = de.read_string( - _SCHEMA_GET_AUTHORIZER_INPUT.members["authorizerId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_AUTHORIZER_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetAuthorizerOutput: - """ - Represents an authorization layer for methods. If enabled on a method, - API Gateway will activate the authorizer when a client calls the method. - """ - - id: str | None = None - """The identifier for the authorizer resource.""" - - name: str | None = None - """The name of the authorizer.""" - - type: str | None = None - """ - The authorizer type. Valid values are `TOKEN` for a Lambda function - using a single authorization token submitted in a custom header, - `REQUEST` for a Lambda function using incoming request parameters, and - `COGNITO_USER_POOLS` for using an Amazon Cognito user pool. - """ - - provider_ar_ns: list[str] | None = None - """ - A list of the Amazon Cognito user pool ARNs for the `COGNITO_USER_POOLS` - authorizer. Each element is of this format: - `arn:aws:cognito-idp:{region}:{account_id}:userpool/{user_pool_id}`. For - a `TOKEN` or `REQUEST` authorizer, this is not defined. - """ - - auth_type: str | None = None - """ - Optional customer-defined field, used in OpenAPI imports and exports - without functional impact. - """ - - authorizer_uri: str | None = None - """ - Specifies the authorizer's Uniform Resource Identifier (URI). For - `TOKEN` or `REQUEST` authorizers, this must be a well-formed Lambda - function URI, for example, - `arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:{account_id}:function:{lambda_function_name}/invocations`. - In general, the URI has this form - `arn:aws:apigateway:{region}:lambda:path/{service_api}`, where - `{region}` is the same as the region hosting the Lambda function, `path` - indicates that the remaining substring in the URI should be treated as - the path to the resource, including the initial `/`. For Lambda - functions, this is usually of the form - `/2015-03-31/functions/[FunctionARN]/invocations`. - """ - - authorizer_credentials: str | None = None - """ - Specifies the required credentials as an IAM role for API Gateway to - invoke the authorizer. To specify an IAM role for API Gateway to assume, - use the role's Amazon Resource Name (ARN). To use resource-based - permissions on the Lambda function, specify null. - """ - - identity_source: str | None = None - """ - The identity source for which authorization is requested. For a `TOKEN` - or `COGNITO_USER_POOLS` authorizer, this is required and specifies the - request header mapping expression for the custom header holding the - authorization token submitted by the client. For example, if the token - header name is `Auth`, the header mapping expression is - `method.request.header.Auth`. For the `REQUEST` authorizer, this is - required when authorization caching is enabled. The value is a - comma-separated string of one or more mapping expressions of the - specified request parameters. For example, if an `Auth` header, a `Name` - query string parameter are defined as identity sources, this value is - `method.request.header.Auth`, `method.request.querystring.Name`. These - parameters will be used to derive the authorization caching key and to - perform runtime validation of the `REQUEST` authorizer by verifying all - of the identity-related request parameters are present, not null and - non-empty. Only when this is true does the authorizer invoke the - authorizer Lambda function, otherwise, it returns a 401 Unauthorized - response without calling the Lambda function. The valid value is a - string of comma-separated mapping expressions of the specified request - parameters. When the authorization caching is not enabled, this property - is optional. - """ - - identity_validation_expression: str | None = None - """ - A validation expression for the incoming identity token. For `TOKEN` - authorizers, this value is a regular expression. For - `COGNITO_USER_POOLS` authorizers, API Gateway will match the `aud` field - of the incoming token from the client against the specified regular - expression. It will invoke the authorizer's Lambda function when there - is a match. Otherwise, it will return a 401 Unauthorized response - without calling the Lambda function. The validation expression does not - apply to the `REQUEST` authorizer. - """ - - authorizer_result_ttl_in_seconds: int | None = None - """ - The TTL in seconds of cached authorizer results. If it equals 0, - authorization caching is disabled. If it is greater than 0, API Gateway - will cache authorizer responses. If this field is not set, the default - value is 300. The maximum value is 3600, or 1 hour. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_AUTHORIZER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string( - _SCHEMA_GET_AUTHORIZER_OUTPUT.members["id"], self.id - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_GET_AUTHORIZER_OUTPUT.members["name"], self.name - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_GET_AUTHORIZER_OUTPUT.members["type"], self.type - ) - - if self.provider_ar_ns is not None: - _serialize_list_of_ar_ns( - serializer, - _SCHEMA_GET_AUTHORIZER_OUTPUT.members["providerARNs"], - self.provider_ar_ns, - ) - - if self.auth_type is not None: - serializer.write_string( - _SCHEMA_GET_AUTHORIZER_OUTPUT.members["authType"], self.auth_type - ) - - if self.authorizer_uri is not None: - serializer.write_string( - _SCHEMA_GET_AUTHORIZER_OUTPUT.members["authorizerUri"], - self.authorizer_uri, - ) - - if self.authorizer_credentials is not None: - serializer.write_string( - _SCHEMA_GET_AUTHORIZER_OUTPUT.members["authorizerCredentials"], - self.authorizer_credentials, - ) - - if self.identity_source is not None: - serializer.write_string( - _SCHEMA_GET_AUTHORIZER_OUTPUT.members["identitySource"], - self.identity_source, - ) - - if self.identity_validation_expression is not None: - serializer.write_string( - _SCHEMA_GET_AUTHORIZER_OUTPUT.members["identityValidationExpression"], - self.identity_validation_expression, - ) - - if self.authorizer_result_ttl_in_seconds is not None: - serializer.write_integer( - _SCHEMA_GET_AUTHORIZER_OUTPUT.members["authorizerResultTtlInSeconds"], - self.authorizer_result_ttl_in_seconds, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_GET_AUTHORIZER_OUTPUT.members["id"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_GET_AUTHORIZER_OUTPUT.members["name"] - ) - - case 2: - kwargs["type"] = AuthorizerType( - de.read_string(_SCHEMA_GET_AUTHORIZER_OUTPUT.members["type"]) - ) - - case 3: - kwargs["provider_ar_ns"] = _deserialize_list_of_ar_ns( - de, _SCHEMA_GET_AUTHORIZER_OUTPUT.members["providerARNs"] - ) - - case 4: - kwargs["auth_type"] = de.read_string( - _SCHEMA_GET_AUTHORIZER_OUTPUT.members["authType"] - ) - - case 5: - kwargs["authorizer_uri"] = de.read_string( - _SCHEMA_GET_AUTHORIZER_OUTPUT.members["authorizerUri"] - ) - - case 6: - kwargs["authorizer_credentials"] = de.read_string( - _SCHEMA_GET_AUTHORIZER_OUTPUT.members["authorizerCredentials"] - ) - - case 7: - kwargs["identity_source"] = de.read_string( - _SCHEMA_GET_AUTHORIZER_OUTPUT.members["identitySource"] - ) - - case 8: - kwargs["identity_validation_expression"] = de.read_string( - _SCHEMA_GET_AUTHORIZER_OUTPUT.members[ - "identityValidationExpression" - ] - ) - - case 9: - kwargs["authorizer_result_ttl_in_seconds"] = de.read_integer( - _SCHEMA_GET_AUTHORIZER_OUTPUT.members[ - "authorizerResultTtlInSeconds" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_AUTHORIZER_OUTPUT, consumer=_consumer) - return kwargs - - -GET_AUTHORIZER = APIOperation( - input=GetAuthorizerInput, - output=GetAuthorizerOutput, - schema=_SCHEMA_GET_AUTHORIZER, - input_schema=_SCHEMA_GET_AUTHORIZER_INPUT, - output_schema=_SCHEMA_GET_AUTHORIZER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetAuthorizersInput: - """Request to describe an existing Authorizers resource.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - position: str | None = None - """The current pagination position in the paged result set.""" - - limit: int | None = None - """ - The maximum number of returned results per page. The default value is 25 - and the maximum value is 500. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_AUTHORIZERS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_GET_AUTHORIZERS_INPUT.members["restApiId"], self.rest_api_id - ) - - if self.position is not None: - serializer.write_string( - _SCHEMA_GET_AUTHORIZERS_INPUT.members["position"], self.position - ) - - if self.limit is not None: - serializer.write_integer( - _SCHEMA_GET_AUTHORIZERS_INPUT.members["limit"], self.limit - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_GET_AUTHORIZERS_INPUT.members["restApiId"] - ) - - case 1: - kwargs["position"] = de.read_string( - _SCHEMA_GET_AUTHORIZERS_INPUT.members["position"] - ) - - case 2: - kwargs["limit"] = de.read_integer( - _SCHEMA_GET_AUTHORIZERS_INPUT.members["limit"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_AUTHORIZERS_INPUT, consumer=_consumer) - return kwargs - - -def _serialize_list_of_authorizer( - serializer: ShapeSerializer, schema: Schema, value: list[Authorizer] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_list_of_authorizer( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Authorizer]: - result: list[Authorizer] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Authorizer.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GetAuthorizersOutput: - """Represents a collection of Authorizer resources.""" - - items: list[Authorizer] | None = None - """The current page of elements from this collection.""" - - position: str | None = None - """The current pagination position in the paged result set.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_AUTHORIZERS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.items is not None: - _serialize_list_of_authorizer( - serializer, _SCHEMA_GET_AUTHORIZERS_OUTPUT.members["items"], self.items - ) - - if self.position is not None: - serializer.write_string( - _SCHEMA_GET_AUTHORIZERS_OUTPUT.members["position"], self.position - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["items"] = _deserialize_list_of_authorizer( - de, _SCHEMA_GET_AUTHORIZERS_OUTPUT.members["items"] - ) - - case 1: - kwargs["position"] = de.read_string( - _SCHEMA_GET_AUTHORIZERS_OUTPUT.members["position"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_AUTHORIZERS_OUTPUT, consumer=_consumer) - return kwargs - - -GET_AUTHORIZERS = APIOperation( - input=GetAuthorizersInput, - output=GetAuthorizersOutput, - schema=_SCHEMA_GET_AUTHORIZERS, - input_schema=_SCHEMA_GET_AUTHORIZERS_INPUT, - output_schema=_SCHEMA_GET_AUTHORIZERS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetBasePathMappingInput: - """Request to describe a BasePathMapping resource.""" - - domain_name: str | None = None - """The domain name of the BasePathMapping resource to be described.""" - - domain_name_id: str | None = None - """ - The identifier for the domain name resource. Supported only for private - custom domain names. - """ - - base_path: str | None = None - """ - The base path name that callers of the API must provide as part of the - URL after the domain name. This value must be unique for all of the - mappings across a single API. Specify '(none)' if you do not want - callers to specify any base path name after the domain name. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_BASE_PATH_MAPPING_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.domain_name is not None: - serializer.write_string( - _SCHEMA_GET_BASE_PATH_MAPPING_INPUT.members["domainName"], - self.domain_name, - ) - - if self.domain_name_id is not None: - serializer.write_string( - _SCHEMA_GET_BASE_PATH_MAPPING_INPUT.members["domainNameId"], - self.domain_name_id, - ) - - if self.base_path is not None: - serializer.write_string( - _SCHEMA_GET_BASE_PATH_MAPPING_INPUT.members["basePath"], self.base_path - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["domain_name"] = de.read_string( - _SCHEMA_GET_BASE_PATH_MAPPING_INPUT.members["domainName"] - ) - - case 1: - kwargs["domain_name_id"] = de.read_string( - _SCHEMA_GET_BASE_PATH_MAPPING_INPUT.members["domainNameId"] - ) - - case 2: - kwargs["base_path"] = de.read_string( - _SCHEMA_GET_BASE_PATH_MAPPING_INPUT.members["basePath"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_BASE_PATH_MAPPING_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetBasePathMappingOutput: - """ - Represents the base path that callers of the API must provide as part of - the URL after the domain name. - """ - - base_path: str | None = None - """ - The base path name that callers of the API must provide as part of the - URL after the domain name. - """ - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - stage: str | None = None - """The name of the associated stage.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_BASE_PATH_MAPPING_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.base_path is not None: - serializer.write_string( - _SCHEMA_GET_BASE_PATH_MAPPING_OUTPUT.members["basePath"], self.base_path - ) - - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_GET_BASE_PATH_MAPPING_OUTPUT.members["restApiId"], - self.rest_api_id, - ) - - if self.stage is not None: - serializer.write_string( - _SCHEMA_GET_BASE_PATH_MAPPING_OUTPUT.members["stage"], self.stage - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["base_path"] = de.read_string( - _SCHEMA_GET_BASE_PATH_MAPPING_OUTPUT.members["basePath"] - ) - - case 1: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_GET_BASE_PATH_MAPPING_OUTPUT.members["restApiId"] - ) - - case 2: - kwargs["stage"] = de.read_string( - _SCHEMA_GET_BASE_PATH_MAPPING_OUTPUT.members["stage"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_BASE_PATH_MAPPING_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_BASE_PATH_MAPPING = APIOperation( - input=GetBasePathMappingInput, - output=GetBasePathMappingOutput, - schema=_SCHEMA_GET_BASE_PATH_MAPPING, - input_schema=_SCHEMA_GET_BASE_PATH_MAPPING_INPUT, - output_schema=_SCHEMA_GET_BASE_PATH_MAPPING_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetBasePathMappingsInput: - """ - A request to get information about a collection of BasePathMapping - resources. - """ - - domain_name: str | None = None - """The domain name of a BasePathMapping resource.""" - - domain_name_id: str | None = None - """ - The identifier for the domain name resource. Supported only for private - custom domain names. - """ - - position: str | None = None - """The current pagination position in the paged result set.""" - - limit: int | None = None - """ - The maximum number of returned results per page. The default value is 25 - and the maximum value is 500. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_BASE_PATH_MAPPINGS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.domain_name is not None: - serializer.write_string( - _SCHEMA_GET_BASE_PATH_MAPPINGS_INPUT.members["domainName"], - self.domain_name, - ) - - if self.domain_name_id is not None: - serializer.write_string( - _SCHEMA_GET_BASE_PATH_MAPPINGS_INPUT.members["domainNameId"], - self.domain_name_id, - ) - - if self.position is not None: - serializer.write_string( - _SCHEMA_GET_BASE_PATH_MAPPINGS_INPUT.members["position"], self.position - ) - - if self.limit is not None: - serializer.write_integer( - _SCHEMA_GET_BASE_PATH_MAPPINGS_INPUT.members["limit"], self.limit - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["domain_name"] = de.read_string( - _SCHEMA_GET_BASE_PATH_MAPPINGS_INPUT.members["domainName"] - ) - - case 1: - kwargs["domain_name_id"] = de.read_string( - _SCHEMA_GET_BASE_PATH_MAPPINGS_INPUT.members["domainNameId"] - ) - - case 2: - kwargs["position"] = de.read_string( - _SCHEMA_GET_BASE_PATH_MAPPINGS_INPUT.members["position"] - ) - - case 3: - kwargs["limit"] = de.read_integer( - _SCHEMA_GET_BASE_PATH_MAPPINGS_INPUT.members["limit"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_BASE_PATH_MAPPINGS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class BasePathMapping: - """ - Represents the base path that callers of the API must provide as part of - the URL after the domain name. - """ - - base_path: str | None = None - """ - The base path name that callers of the API must provide as part of the - URL after the domain name. - """ - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - stage: str | None = None - """The name of the associated stage.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BASE_PATH_MAPPING, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.base_path is not None: - serializer.write_string( - _SCHEMA_BASE_PATH_MAPPING.members["basePath"], self.base_path - ) - - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_BASE_PATH_MAPPING.members["restApiId"], self.rest_api_id - ) - - if self.stage is not None: - serializer.write_string( - _SCHEMA_BASE_PATH_MAPPING.members["stage"], self.stage - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["base_path"] = de.read_string( - _SCHEMA_BASE_PATH_MAPPING.members["basePath"] - ) - - case 1: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_BASE_PATH_MAPPING.members["restApiId"] - ) - - case 2: - kwargs["stage"] = de.read_string( - _SCHEMA_BASE_PATH_MAPPING.members["stage"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BASE_PATH_MAPPING, consumer=_consumer) - return kwargs - - -def _serialize_list_of_base_path_mapping( - serializer: ShapeSerializer, schema: Schema, value: list[BasePathMapping] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_list_of_base_path_mapping( - deserializer: ShapeDeserializer, schema: Schema -) -> list[BasePathMapping]: - result: list[BasePathMapping] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(BasePathMapping.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GetBasePathMappingsOutput: - """Represents a collection of BasePathMapping resources.""" - - items: list[BasePathMapping] | None = None - """The current page of elements from this collection.""" - - position: str | None = None - """The current pagination position in the paged result set.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_BASE_PATH_MAPPINGS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.items is not None: - _serialize_list_of_base_path_mapping( - serializer, - _SCHEMA_GET_BASE_PATH_MAPPINGS_OUTPUT.members["items"], - self.items, - ) - - if self.position is not None: - serializer.write_string( - _SCHEMA_GET_BASE_PATH_MAPPINGS_OUTPUT.members["position"], self.position - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["items"] = _deserialize_list_of_base_path_mapping( - de, _SCHEMA_GET_BASE_PATH_MAPPINGS_OUTPUT.members["items"] - ) - - case 1: - kwargs["position"] = de.read_string( - _SCHEMA_GET_BASE_PATH_MAPPINGS_OUTPUT.members["position"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_BASE_PATH_MAPPINGS_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_BASE_PATH_MAPPINGS = APIOperation( - input=GetBasePathMappingsInput, - output=GetBasePathMappingsOutput, - schema=_SCHEMA_GET_BASE_PATH_MAPPINGS, - input_schema=_SCHEMA_GET_BASE_PATH_MAPPINGS_INPUT, - output_schema=_SCHEMA_GET_BASE_PATH_MAPPINGS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetClientCertificateInput: - """ - A request to get information about the current ClientCertificate - resource. - """ - - client_certificate_id: str | None = None - """The identifier of the ClientCertificate resource to be described.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_CLIENT_CERTIFICATE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.client_certificate_id is not None: - serializer.write_string( - _SCHEMA_GET_CLIENT_CERTIFICATE_INPUT.members["clientCertificateId"], - self.client_certificate_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["client_certificate_id"] = de.read_string( - _SCHEMA_GET_CLIENT_CERTIFICATE_INPUT.members[ - "clientCertificateId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_CLIENT_CERTIFICATE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetClientCertificateOutput: - """ - Represents a client certificate used to configure client-side SSL - authentication while sending requests to the integration endpoint. - """ - - client_certificate_id: str | None = None - """The identifier of the client certificate.""" - - description: str | None = None - """The description of the client certificate.""" - - pem_encoded_certificate: str | None = None - """ - The PEM-encoded public key of the client certificate, which can be used - to configure certificate authentication in the integration endpoint . - """ - - created_date: datetime | None = None - """The timestamp when the client certificate was created.""" - - expiration_date: datetime | None = None - """The timestamp when the client certificate will expire.""" - - tags: dict[str, str] | None = None - """ - The collection of tags. Each tag element is associated with a given - resource. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_CLIENT_CERTIFICATE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.client_certificate_id is not None: - serializer.write_string( - _SCHEMA_GET_CLIENT_CERTIFICATE_OUTPUT.members["clientCertificateId"], - self.client_certificate_id, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_CLIENT_CERTIFICATE_OUTPUT.members["description"], - self.description, - ) - - if self.pem_encoded_certificate is not None: - serializer.write_string( - _SCHEMA_GET_CLIENT_CERTIFICATE_OUTPUT.members["pemEncodedCertificate"], - self.pem_encoded_certificate, - ) - - if self.created_date is not None: - serializer.write_timestamp( - _SCHEMA_GET_CLIENT_CERTIFICATE_OUTPUT.members["createdDate"], - self.created_date, - ) - - if self.expiration_date is not None: - serializer.write_timestamp( - _SCHEMA_GET_CLIENT_CERTIFICATE_OUTPUT.members["expirationDate"], - self.expiration_date, - ) - - if self.tags is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_GET_CLIENT_CERTIFICATE_OUTPUT.members["tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["client_certificate_id"] = de.read_string( - _SCHEMA_GET_CLIENT_CERTIFICATE_OUTPUT.members[ - "clientCertificateId" - ] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_GET_CLIENT_CERTIFICATE_OUTPUT.members["description"] - ) - - case 2: - kwargs["pem_encoded_certificate"] = de.read_string( - _SCHEMA_GET_CLIENT_CERTIFICATE_OUTPUT.members[ - "pemEncodedCertificate" - ] - ) - - case 3: - kwargs["created_date"] = de.read_timestamp( - _SCHEMA_GET_CLIENT_CERTIFICATE_OUTPUT.members["createdDate"] - ) - - case 4: - kwargs["expiration_date"] = de.read_timestamp( - _SCHEMA_GET_CLIENT_CERTIFICATE_OUTPUT.members["expirationDate"] - ) - - case 5: - kwargs["tags"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_GET_CLIENT_CERTIFICATE_OUTPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_CLIENT_CERTIFICATE_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_CLIENT_CERTIFICATE = APIOperation( - input=GetClientCertificateInput, - output=GetClientCertificateOutput, - schema=_SCHEMA_GET_CLIENT_CERTIFICATE, - input_schema=_SCHEMA_GET_CLIENT_CERTIFICATE_INPUT, - output_schema=_SCHEMA_GET_CLIENT_CERTIFICATE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetClientCertificatesInput: - """ - A request to get information about a collection of ClientCertificate - resources. - """ - - position: str | None = None - """The current pagination position in the paged result set.""" - - limit: int | None = None - """ - The maximum number of returned results per page. The default value is 25 - and the maximum value is 500. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_CLIENT_CERTIFICATES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.position is not None: - serializer.write_string( - _SCHEMA_GET_CLIENT_CERTIFICATES_INPUT.members["position"], self.position - ) - - if self.limit is not None: - serializer.write_integer( - _SCHEMA_GET_CLIENT_CERTIFICATES_INPUT.members["limit"], self.limit - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["position"] = de.read_string( - _SCHEMA_GET_CLIENT_CERTIFICATES_INPUT.members["position"] - ) - - case 1: - kwargs["limit"] = de.read_integer( - _SCHEMA_GET_CLIENT_CERTIFICATES_INPUT.members["limit"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_CLIENT_CERTIFICATES_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ClientCertificate: - """ - Represents a client certificate used to configure client-side SSL - authentication while sending requests to the integration endpoint. - """ - - client_certificate_id: str | None = None - """The identifier of the client certificate.""" - - description: str | None = None - """The description of the client certificate.""" - - pem_encoded_certificate: str | None = None - """ - The PEM-encoded public key of the client certificate, which can be used - to configure certificate authentication in the integration endpoint . - """ - - created_date: datetime | None = None - """The timestamp when the client certificate was created.""" - - expiration_date: datetime | None = None - """The timestamp when the client certificate will expire.""" - - tags: dict[str, str] | None = None - """ - The collection of tags. Each tag element is associated with a given - resource. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CLIENT_CERTIFICATE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.client_certificate_id is not None: - serializer.write_string( - _SCHEMA_CLIENT_CERTIFICATE.members["clientCertificateId"], - self.client_certificate_id, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CLIENT_CERTIFICATE.members["description"], self.description - ) - - if self.pem_encoded_certificate is not None: - serializer.write_string( - _SCHEMA_CLIENT_CERTIFICATE.members["pemEncodedCertificate"], - self.pem_encoded_certificate, - ) - - if self.created_date is not None: - serializer.write_timestamp( - _SCHEMA_CLIENT_CERTIFICATE.members["createdDate"], self.created_date - ) - - if self.expiration_date is not None: - serializer.write_timestamp( - _SCHEMA_CLIENT_CERTIFICATE.members["expirationDate"], - self.expiration_date, - ) - - if self.tags is not None: - _serialize_map_of_string_to_string( - serializer, _SCHEMA_CLIENT_CERTIFICATE.members["tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["client_certificate_id"] = de.read_string( - _SCHEMA_CLIENT_CERTIFICATE.members["clientCertificateId"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_CLIENT_CERTIFICATE.members["description"] - ) - - case 2: - kwargs["pem_encoded_certificate"] = de.read_string( - _SCHEMA_CLIENT_CERTIFICATE.members["pemEncodedCertificate"] - ) - - case 3: - kwargs["created_date"] = de.read_timestamp( - _SCHEMA_CLIENT_CERTIFICATE.members["createdDate"] - ) - - case 4: - kwargs["expiration_date"] = de.read_timestamp( - _SCHEMA_CLIENT_CERTIFICATE.members["expirationDate"] - ) - - case 5: - kwargs["tags"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_CLIENT_CERTIFICATE.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CLIENT_CERTIFICATE, consumer=_consumer) - return kwargs - - -def _serialize_list_of_client_certificate( - serializer: ShapeSerializer, schema: Schema, value: list[ClientCertificate] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_list_of_client_certificate( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ClientCertificate]: - result: list[ClientCertificate] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ClientCertificate.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GetClientCertificatesOutput: - """Represents a collection of ClientCertificate resources.""" - - items: list[ClientCertificate] | None = None - """The current page of elements from this collection.""" - - position: str | None = None - """The current pagination position in the paged result set.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_CLIENT_CERTIFICATES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.items is not None: - _serialize_list_of_client_certificate( - serializer, - _SCHEMA_GET_CLIENT_CERTIFICATES_OUTPUT.members["items"], - self.items, - ) - - if self.position is not None: - serializer.write_string( - _SCHEMA_GET_CLIENT_CERTIFICATES_OUTPUT.members["position"], - self.position, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["items"] = _deserialize_list_of_client_certificate( - de, _SCHEMA_GET_CLIENT_CERTIFICATES_OUTPUT.members["items"] - ) - - case 1: - kwargs["position"] = de.read_string( - _SCHEMA_GET_CLIENT_CERTIFICATES_OUTPUT.members["position"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_CLIENT_CERTIFICATES_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_CLIENT_CERTIFICATES = APIOperation( - input=GetClientCertificatesInput, - output=GetClientCertificatesOutput, - schema=_SCHEMA_GET_CLIENT_CERTIFICATES, - input_schema=_SCHEMA_GET_CLIENT_CERTIFICATES_INPUT, - output_schema=_SCHEMA_GET_CLIENT_CERTIFICATES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetDeploymentInput: - """Requests API Gateway to get information about a Deployment resource.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - deployment_id: str | None = None - """The identifier of the Deployment resource to get information about.""" - - embed: list[str] | None = None - """ - A query parameter to retrieve the specified embedded resources of the - returned Deployment resource in the response. In a REST API call, this - `embed` parameter value is a list of comma-separated strings, as in - `GET /restapis/{restapi_id}/deployments/{deployment_id}?embed=var1,var2`. - The SDK and other platform-dependent libraries might use a different - format for the list. Currently, this request supports only retrieval of - the embedded API summary this way. Hence, the parameter value must be a - single-valued list containing only the `"apisummary"` string. For - example, - `GET /restapis/{restapi_id}/deployments/{deployment_id}?embed=apisummary`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DEPLOYMENT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_GET_DEPLOYMENT_INPUT.members["restApiId"], self.rest_api_id - ) - - if self.deployment_id is not None: - serializer.write_string( - _SCHEMA_GET_DEPLOYMENT_INPUT.members["deploymentId"], self.deployment_id - ) - - if self.embed is not None: - _serialize_list_of_string( - serializer, _SCHEMA_GET_DEPLOYMENT_INPUT.members["embed"], self.embed - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_GET_DEPLOYMENT_INPUT.members["restApiId"] - ) - - case 1: - kwargs["deployment_id"] = de.read_string( - _SCHEMA_GET_DEPLOYMENT_INPUT.members["deploymentId"] - ) - - case 2: - kwargs["embed"] = _deserialize_list_of_string( - de, _SCHEMA_GET_DEPLOYMENT_INPUT.members["embed"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_DEPLOYMENT_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetDeploymentOutput: - """ - An immutable representation of a RestApi resource that can be called by - users using Stages. A deployment must be associated with a Stage for it - to be callable over the Internet. - """ - - id: str | None = None - """The identifier for the deployment resource.""" - - description: str | None = None - """The description for the deployment resource.""" - - created_date: datetime | None = None - """The date and time that the deployment resource was created.""" - - api_summary: dict[str, dict[str, MethodSnapshot]] | None = None - """ - A summary of the RestApi at the date and time that the deployment - resource was created. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DEPLOYMENT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string( - _SCHEMA_GET_DEPLOYMENT_OUTPUT.members["id"], self.id - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_DEPLOYMENT_OUTPUT.members["description"], self.description - ) - - if self.created_date is not None: - serializer.write_timestamp( - _SCHEMA_GET_DEPLOYMENT_OUTPUT.members["createdDate"], self.created_date - ) - - if self.api_summary is not None: - _serialize_path_to_map_of_method_snapshot( - serializer, - _SCHEMA_GET_DEPLOYMENT_OUTPUT.members["apiSummary"], - self.api_summary, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_GET_DEPLOYMENT_OUTPUT.members["id"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_GET_DEPLOYMENT_OUTPUT.members["description"] - ) - - case 2: - kwargs["created_date"] = de.read_timestamp( - _SCHEMA_GET_DEPLOYMENT_OUTPUT.members["createdDate"] - ) - - case 3: - kwargs["api_summary"] = _deserialize_path_to_map_of_method_snapshot( - de, _SCHEMA_GET_DEPLOYMENT_OUTPUT.members["apiSummary"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_DEPLOYMENT_OUTPUT, consumer=_consumer) - return kwargs - - -GET_DEPLOYMENT = APIOperation( - input=GetDeploymentInput, - output=GetDeploymentOutput, - schema=_SCHEMA_GET_DEPLOYMENT, - input_schema=_SCHEMA_GET_DEPLOYMENT_INPUT, - output_schema=_SCHEMA_GET_DEPLOYMENT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#ServiceUnavailableException" - ): ServiceUnavailableException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_UNAVAILABLE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetDeploymentsInput: - """Requests API Gateway to get information about a Deployments collection.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - position: str | None = None - """The current pagination position in the paged result set.""" - - limit: int | None = None - """ - The maximum number of returned results per page. The default value is 25 - and the maximum value is 500. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DEPLOYMENTS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_GET_DEPLOYMENTS_INPUT.members["restApiId"], self.rest_api_id - ) - - if self.position is not None: - serializer.write_string( - _SCHEMA_GET_DEPLOYMENTS_INPUT.members["position"], self.position - ) - - if self.limit is not None: - serializer.write_integer( - _SCHEMA_GET_DEPLOYMENTS_INPUT.members["limit"], self.limit - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_GET_DEPLOYMENTS_INPUT.members["restApiId"] - ) - - case 1: - kwargs["position"] = de.read_string( - _SCHEMA_GET_DEPLOYMENTS_INPUT.members["position"] - ) - - case 2: - kwargs["limit"] = de.read_integer( - _SCHEMA_GET_DEPLOYMENTS_INPUT.members["limit"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_DEPLOYMENTS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Deployment: - """ - An immutable representation of a RestApi resource that can be called by - users using Stages. A deployment must be associated with a Stage for it - to be callable over the Internet. - """ - - id: str | None = None - """The identifier for the deployment resource.""" - - description: str | None = None - """The description for the deployment resource.""" - - created_date: datetime | None = None - """The date and time that the deployment resource was created.""" - - api_summary: dict[str, dict[str, MethodSnapshot]] | None = None - """ - A summary of the RestApi at the date and time that the deployment - resource was created. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DEPLOYMENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string(_SCHEMA_DEPLOYMENT.members["id"], self.id) - - if self.description is not None: - serializer.write_string( - _SCHEMA_DEPLOYMENT.members["description"], self.description - ) - - if self.created_date is not None: - serializer.write_timestamp( - _SCHEMA_DEPLOYMENT.members["createdDate"], self.created_date - ) - - if self.api_summary is not None: - _serialize_path_to_map_of_method_snapshot( - serializer, _SCHEMA_DEPLOYMENT.members["apiSummary"], self.api_summary - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string(_SCHEMA_DEPLOYMENT.members["id"]) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_DEPLOYMENT.members["description"] - ) - - case 2: - kwargs["created_date"] = de.read_timestamp( - _SCHEMA_DEPLOYMENT.members["createdDate"] - ) - - case 3: - kwargs["api_summary"] = _deserialize_path_to_map_of_method_snapshot( - de, _SCHEMA_DEPLOYMENT.members["apiSummary"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DEPLOYMENT, consumer=_consumer) - return kwargs - - -def _serialize_list_of_deployment( - serializer: ShapeSerializer, schema: Schema, value: list[Deployment] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_list_of_deployment( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Deployment]: - result: list[Deployment] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Deployment.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GetDeploymentsOutput: - """ - Represents a collection resource that contains zero or more references - to your existing deployments, and links that guide you on how to - interact with your collection. The collection offers a paginated view of - the contained deployments. - """ - - items: list[Deployment] | None = None - """The current page of elements from this collection.""" - - position: str | None = None - """The current pagination position in the paged result set.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DEPLOYMENTS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.items is not None: - _serialize_list_of_deployment( - serializer, _SCHEMA_GET_DEPLOYMENTS_OUTPUT.members["items"], self.items - ) - - if self.position is not None: - serializer.write_string( - _SCHEMA_GET_DEPLOYMENTS_OUTPUT.members["position"], self.position - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["items"] = _deserialize_list_of_deployment( - de, _SCHEMA_GET_DEPLOYMENTS_OUTPUT.members["items"] - ) - - case 1: - kwargs["position"] = de.read_string( - _SCHEMA_GET_DEPLOYMENTS_OUTPUT.members["position"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_DEPLOYMENTS_OUTPUT, consumer=_consumer) - return kwargs - - -GET_DEPLOYMENTS = APIOperation( - input=GetDeploymentsInput, - output=GetDeploymentsOutput, - schema=_SCHEMA_GET_DEPLOYMENTS, - input_schema=_SCHEMA_GET_DEPLOYMENTS_INPUT, - output_schema=_SCHEMA_GET_DEPLOYMENTS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#ServiceUnavailableException" - ): ServiceUnavailableException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_UNAVAILABLE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetDocumentationPartInput: - """Gets a specified documentation part of a given API.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - documentation_part_id: str | None = None - """The string identifier of the associated RestApi.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DOCUMENTATION_PART_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_GET_DOCUMENTATION_PART_INPUT.members["restApiId"], - self.rest_api_id, - ) - - if self.documentation_part_id is not None: - serializer.write_string( - _SCHEMA_GET_DOCUMENTATION_PART_INPUT.members["documentationPartId"], - self.documentation_part_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_GET_DOCUMENTATION_PART_INPUT.members["restApiId"] - ) - - case 1: - kwargs["documentation_part_id"] = de.read_string( - _SCHEMA_GET_DOCUMENTATION_PART_INPUT.members[ - "documentationPartId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_DOCUMENTATION_PART_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetDocumentationPartOutput: - """A documentation part for a targeted API entity.""" - - id: str | None = None - """ - The DocumentationPart identifier, generated by API Gateway when the - `DocumentationPart` is created. - """ - - location: DocumentationPartLocation | None = None - """ - The location of the API entity to which the documentation applies. Valid - fields depend on the targeted API entity type. All the valid location - fields are not required. If not explicitly specified, a valid location - field is treated as a wildcard and associated documentation content may - be inherited by matching entities, unless overridden. - """ - - properties: str | None = None - """ - A content map of API-specific key-value pairs describing the targeted - API entity. The map must be encoded as a JSON string, e.g., - `"{ \"description\": \"The API does ...\" }"`. Only OpenAPI-compliant - documentation-related fields from the properties map are exported and, - hence, published as part of the API entity definitions, while the - original documentation parts are exported in a OpenAPI extension of - `x-amazon-apigateway-documentation`. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DOCUMENTATION_PART_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string( - _SCHEMA_GET_DOCUMENTATION_PART_OUTPUT.members["id"], self.id - ) - - if self.location is not None: - serializer.write_struct( - _SCHEMA_GET_DOCUMENTATION_PART_OUTPUT.members["location"], self.location - ) - - if self.properties is not None: - serializer.write_string( - _SCHEMA_GET_DOCUMENTATION_PART_OUTPUT.members["properties"], - self.properties, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_GET_DOCUMENTATION_PART_OUTPUT.members["id"] - ) - - case 1: - kwargs["location"] = DocumentationPartLocation.deserialize(de) - - case 2: - kwargs["properties"] = de.read_string( - _SCHEMA_GET_DOCUMENTATION_PART_OUTPUT.members["properties"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_DOCUMENTATION_PART_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_DOCUMENTATION_PART = APIOperation( - input=GetDocumentationPartInput, - output=GetDocumentationPartOutput, - schema=_SCHEMA_GET_DOCUMENTATION_PART, - input_schema=_SCHEMA_GET_DOCUMENTATION_PART_INPUT, - output_schema=_SCHEMA_GET_DOCUMENTATION_PART_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -class LocationStatusType(UnknownEnumMixin, StrEnum): - DOCUMENTED = "DOCUMENTED" - UNDOCUMENTED = "UNDOCUMENTED" - - -@dataclass(kw_only=True) -class GetDocumentationPartsInput: - """ - Gets the documentation parts of an API. The result may be filtered by - the type, name, or path of API entities (targets). - """ - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - type: str | None = None - """The type of API entities of the to-be-retrieved documentation parts.""" - - name_query: str | None = None - """The name of API entities of the to-be-retrieved documentation parts.""" - - path: str | None = None - """The path of API entities of the to-be-retrieved documentation parts.""" - - position: str | None = None - """The current pagination position in the paged result set.""" - - limit: int | None = None - """ - The maximum number of returned results per page. The default value is 25 - and the maximum value is 500. - """ - - location_status: str | None = None - """ - The status of the API documentation parts to retrieve. Valid values are - `DOCUMENTED` for retrieving DocumentationPart resources with content and - `UNDOCUMENTED` for DocumentationPart resources without content. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DOCUMENTATION_PARTS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_GET_DOCUMENTATION_PARTS_INPUT.members["restApiId"], - self.rest_api_id, - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_GET_DOCUMENTATION_PARTS_INPUT.members["type"], self.type - ) - - if self.name_query is not None: - serializer.write_string( - _SCHEMA_GET_DOCUMENTATION_PARTS_INPUT.members["nameQuery"], - self.name_query, - ) - - if self.path is not None: - serializer.write_string( - _SCHEMA_GET_DOCUMENTATION_PARTS_INPUT.members["path"], self.path - ) - - if self.position is not None: - serializer.write_string( - _SCHEMA_GET_DOCUMENTATION_PARTS_INPUT.members["position"], self.position - ) - - if self.limit is not None: - serializer.write_integer( - _SCHEMA_GET_DOCUMENTATION_PARTS_INPUT.members["limit"], self.limit - ) - - if self.location_status is not None: - serializer.write_string( - _SCHEMA_GET_DOCUMENTATION_PARTS_INPUT.members["locationStatus"], - self.location_status, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_GET_DOCUMENTATION_PARTS_INPUT.members["restApiId"] - ) - - case 1: - kwargs["type"] = DocumentationPartType( - de.read_string( - _SCHEMA_GET_DOCUMENTATION_PARTS_INPUT.members["type"] - ) - ) - - case 2: - kwargs["name_query"] = de.read_string( - _SCHEMA_GET_DOCUMENTATION_PARTS_INPUT.members["nameQuery"] - ) - - case 3: - kwargs["path"] = de.read_string( - _SCHEMA_GET_DOCUMENTATION_PARTS_INPUT.members["path"] - ) - - case 4: - kwargs["position"] = de.read_string( - _SCHEMA_GET_DOCUMENTATION_PARTS_INPUT.members["position"] - ) - - case 5: - kwargs["limit"] = de.read_integer( - _SCHEMA_GET_DOCUMENTATION_PARTS_INPUT.members["limit"] - ) - - case 6: - kwargs["location_status"] = LocationStatusType( - de.read_string( - _SCHEMA_GET_DOCUMENTATION_PARTS_INPUT.members[ - "locationStatus" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_DOCUMENTATION_PARTS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DocumentationPart: - """A documentation part for a targeted API entity.""" - - id: str | None = None - """ - The DocumentationPart identifier, generated by API Gateway when the - `DocumentationPart` is created. - """ - - location: DocumentationPartLocation | None = None - """ - The location of the API entity to which the documentation applies. Valid - fields depend on the targeted API entity type. All the valid location - fields are not required. If not explicitly specified, a valid location - field is treated as a wildcard and associated documentation content may - be inherited by matching entities, unless overridden. - """ - - properties: str | None = None - """ - A content map of API-specific key-value pairs describing the targeted - API entity. The map must be encoded as a JSON string, e.g., - `"{ \"description\": \"The API does ...\" }"`. Only OpenAPI-compliant - documentation-related fields from the properties map are exported and, - hence, published as part of the API entity definitions, while the - original documentation parts are exported in a OpenAPI extension of - `x-amazon-apigateway-documentation`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENTATION_PART, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string(_SCHEMA_DOCUMENTATION_PART.members["id"], self.id) - - if self.location is not None: - serializer.write_struct( - _SCHEMA_DOCUMENTATION_PART.members["location"], self.location - ) - - if self.properties is not None: - serializer.write_string( - _SCHEMA_DOCUMENTATION_PART.members["properties"], self.properties - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_DOCUMENTATION_PART.members["id"] - ) - - case 1: - kwargs["location"] = DocumentationPartLocation.deserialize(de) - - case 2: - kwargs["properties"] = de.read_string( - _SCHEMA_DOCUMENTATION_PART.members["properties"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DOCUMENTATION_PART, consumer=_consumer) - return kwargs - - -def _serialize_list_of_documentation_part( - serializer: ShapeSerializer, schema: Schema, value: list[DocumentationPart] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_list_of_documentation_part( - deserializer: ShapeDeserializer, schema: Schema -) -> list[DocumentationPart]: - result: list[DocumentationPart] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(DocumentationPart.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GetDocumentationPartsOutput: - """The collection of documentation parts of an API.""" - - items: list[DocumentationPart] | None = None - """The current page of elements from this collection.""" - - position: str | None = None - """The current pagination position in the paged result set.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DOCUMENTATION_PARTS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.items is not None: - _serialize_list_of_documentation_part( - serializer, - _SCHEMA_GET_DOCUMENTATION_PARTS_OUTPUT.members["items"], - self.items, - ) - - if self.position is not None: - serializer.write_string( - _SCHEMA_GET_DOCUMENTATION_PARTS_OUTPUT.members["position"], - self.position, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["items"] = _deserialize_list_of_documentation_part( - de, _SCHEMA_GET_DOCUMENTATION_PARTS_OUTPUT.members["items"] - ) - - case 1: - kwargs["position"] = de.read_string( - _SCHEMA_GET_DOCUMENTATION_PARTS_OUTPUT.members["position"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_DOCUMENTATION_PARTS_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_DOCUMENTATION_PARTS = APIOperation( - input=GetDocumentationPartsInput, - output=GetDocumentationPartsOutput, - schema=_SCHEMA_GET_DOCUMENTATION_PARTS, - input_schema=_SCHEMA_GET_DOCUMENTATION_PARTS_INPUT, - output_schema=_SCHEMA_GET_DOCUMENTATION_PARTS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetDocumentationVersionInput: - """Gets a documentation snapshot of an API.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - documentation_version: str | None = None - """The version identifier of the to-be-retrieved documentation snapshot.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DOCUMENTATION_VERSION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_GET_DOCUMENTATION_VERSION_INPUT.members["restApiId"], - self.rest_api_id, - ) - - if self.documentation_version is not None: - serializer.write_string( - _SCHEMA_GET_DOCUMENTATION_VERSION_INPUT.members["documentationVersion"], - self.documentation_version, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_GET_DOCUMENTATION_VERSION_INPUT.members["restApiId"] - ) - - case 1: - kwargs["documentation_version"] = de.read_string( - _SCHEMA_GET_DOCUMENTATION_VERSION_INPUT.members[ - "documentationVersion" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_DOCUMENTATION_VERSION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetDocumentationVersionOutput: - """A snapshot of the documentation of an API.""" - - version: str | None = None - """The version identifier of the API documentation snapshot.""" - - created_date: datetime | None = None - """The date when the API documentation snapshot is created.""" - - description: str | None = None - """The description of the API documentation snapshot.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DOCUMENTATION_VERSION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.version is not None: - serializer.write_string( - _SCHEMA_GET_DOCUMENTATION_VERSION_OUTPUT.members["version"], - self.version, - ) - - if self.created_date is not None: - serializer.write_timestamp( - _SCHEMA_GET_DOCUMENTATION_VERSION_OUTPUT.members["createdDate"], - self.created_date, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_DOCUMENTATION_VERSION_OUTPUT.members["description"], - self.description, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["version"] = de.read_string( - _SCHEMA_GET_DOCUMENTATION_VERSION_OUTPUT.members["version"] - ) - - case 1: - kwargs["created_date"] = de.read_timestamp( - _SCHEMA_GET_DOCUMENTATION_VERSION_OUTPUT.members["createdDate"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_GET_DOCUMENTATION_VERSION_OUTPUT.members["description"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_DOCUMENTATION_VERSION_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_DOCUMENTATION_VERSION = APIOperation( - input=GetDocumentationVersionInput, - output=GetDocumentationVersionOutput, - schema=_SCHEMA_GET_DOCUMENTATION_VERSION, - input_schema=_SCHEMA_GET_DOCUMENTATION_VERSION_INPUT, - output_schema=_SCHEMA_GET_DOCUMENTATION_VERSION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetDocumentationVersionsInput: - """Gets the documentation versions of an API.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - position: str | None = None - """The current pagination position in the paged result set.""" - - limit: int | None = None - """ - The maximum number of returned results per page. The default value is 25 - and the maximum value is 500. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DOCUMENTATION_VERSIONS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_GET_DOCUMENTATION_VERSIONS_INPUT.members["restApiId"], - self.rest_api_id, - ) - - if self.position is not None: - serializer.write_string( - _SCHEMA_GET_DOCUMENTATION_VERSIONS_INPUT.members["position"], - self.position, - ) - - if self.limit is not None: - serializer.write_integer( - _SCHEMA_GET_DOCUMENTATION_VERSIONS_INPUT.members["limit"], self.limit - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_GET_DOCUMENTATION_VERSIONS_INPUT.members["restApiId"] - ) - - case 1: - kwargs["position"] = de.read_string( - _SCHEMA_GET_DOCUMENTATION_VERSIONS_INPUT.members["position"] - ) - - case 2: - kwargs["limit"] = de.read_integer( - _SCHEMA_GET_DOCUMENTATION_VERSIONS_INPUT.members["limit"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_DOCUMENTATION_VERSIONS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DocumentationVersion: - """A snapshot of the documentation of an API.""" - - version: str | None = None - """The version identifier of the API documentation snapshot.""" - - created_date: datetime | None = None - """The date when the API documentation snapshot is created.""" - - description: str | None = None - """The description of the API documentation snapshot.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENTATION_VERSION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.version is not None: - serializer.write_string( - _SCHEMA_DOCUMENTATION_VERSION.members["version"], self.version - ) - - if self.created_date is not None: - serializer.write_timestamp( - _SCHEMA_DOCUMENTATION_VERSION.members["createdDate"], self.created_date - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_DOCUMENTATION_VERSION.members["description"], self.description - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["version"] = de.read_string( - _SCHEMA_DOCUMENTATION_VERSION.members["version"] - ) - - case 1: - kwargs["created_date"] = de.read_timestamp( - _SCHEMA_DOCUMENTATION_VERSION.members["createdDate"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_DOCUMENTATION_VERSION.members["description"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DOCUMENTATION_VERSION, consumer=_consumer) - return kwargs - - -def _serialize_list_of_documentation_version( - serializer: ShapeSerializer, schema: Schema, value: list[DocumentationVersion] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_list_of_documentation_version( - deserializer: ShapeDeserializer, schema: Schema -) -> list[DocumentationVersion]: - result: list[DocumentationVersion] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(DocumentationVersion.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GetDocumentationVersionsOutput: - """The collection of documentation snapshots of an API.""" - - items: list[DocumentationVersion] | None = None - """The current page of elements from this collection.""" - - position: str | None = None - """The current pagination position in the paged result set.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DOCUMENTATION_VERSIONS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.items is not None: - _serialize_list_of_documentation_version( - serializer, - _SCHEMA_GET_DOCUMENTATION_VERSIONS_OUTPUT.members["items"], - self.items, - ) - - if self.position is not None: - serializer.write_string( - _SCHEMA_GET_DOCUMENTATION_VERSIONS_OUTPUT.members["position"], - self.position, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["items"] = _deserialize_list_of_documentation_version( - de, _SCHEMA_GET_DOCUMENTATION_VERSIONS_OUTPUT.members["items"] - ) - - case 1: - kwargs["position"] = de.read_string( - _SCHEMA_GET_DOCUMENTATION_VERSIONS_OUTPUT.members["position"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_DOCUMENTATION_VERSIONS_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_DOCUMENTATION_VERSIONS = APIOperation( - input=GetDocumentationVersionsInput, - output=GetDocumentationVersionsOutput, - schema=_SCHEMA_GET_DOCUMENTATION_VERSIONS, - input_schema=_SCHEMA_GET_DOCUMENTATION_VERSIONS_INPUT, - output_schema=_SCHEMA_GET_DOCUMENTATION_VERSIONS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetDomainNameInput: - """Request to get the name of a DomainName resource.""" - - domain_name: str | None = None - """The name of the DomainName resource.""" - - domain_name_id: str | None = None - """ - The identifier for the domain name resource. Required for private custom - domain names. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DOMAIN_NAME_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.domain_name is not None: - serializer.write_string( - _SCHEMA_GET_DOMAIN_NAME_INPUT.members["domainName"], self.domain_name - ) - - if self.domain_name_id is not None: - serializer.write_string( - _SCHEMA_GET_DOMAIN_NAME_INPUT.members["domainNameId"], - self.domain_name_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["domain_name"] = de.read_string( - _SCHEMA_GET_DOMAIN_NAME_INPUT.members["domainName"] - ) - - case 1: - kwargs["domain_name_id"] = de.read_string( - _SCHEMA_GET_DOMAIN_NAME_INPUT.members["domainNameId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_DOMAIN_NAME_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetDomainNameOutput: - """ - Represents a custom domain name as a user-friendly host name of an API - (RestApi). - """ - - domain_name: str | None = None - """ - The custom domain name as an API host name, for example, - `my-api.example.com`. - """ - - domain_name_id: str | None = None - """ - The identifier for the domain name resource. Supported only for private - custom domain names. - """ - - domain_name_arn: str | None = None - """The ARN of the domain name.""" - - certificate_name: str | None = None - """ - The name of the certificate that will be used by edge-optimized endpoint - or private endpoint for this domain name. - """ - - certificate_arn: str | None = None - """ - The reference to an Amazon Web Services-managed certificate that will be - used by edge-optimized endpoint or private endpoint for this domain - name. Certificate Manager is the only supported source. - """ - - certificate_upload_date: datetime | None = None - """ - The timestamp when the certificate that was used by edge-optimized - endpoint or private endpoint for this domain name was uploaded. - """ - - regional_domain_name: str | None = None - """ - The domain name associated with the regional endpoint for this custom - domain name. You set up this association by adding a DNS record that - points the custom domain name to this regional domain name. The regional - domain name is returned by API Gateway when you create a regional - endpoint. - """ - - regional_hosted_zone_id: str | None = None - """ - The region-specific Amazon Route 53 Hosted Zone ID of the regional - endpoint. For more information, see Set up a Regional Custom Domain Name - and AWS Regions and Endpoints for API Gateway. - """ - - regional_certificate_name: str | None = None - """ - The name of the certificate that will be used for validating the - regional domain name. - """ - - regional_certificate_arn: str | None = None - """ - The reference to an Amazon Web Services-managed certificate that will be - used for validating the regional domain name. Certificate Manager is the - only supported source. - """ - - distribution_domain_name: str | None = None - """ - The domain name of the Amazon CloudFront distribution associated with - this custom domain name for an edge-optimized endpoint. You set up this - association when adding a DNS record pointing the custom domain name to - this distribution name. For more information about CloudFront - distributions, see the Amazon CloudFront documentation. - """ - - distribution_hosted_zone_id: str | None = None - """ - The region-agnostic Amazon Route 53 Hosted Zone ID of the edge-optimized - endpoint. The valid value is `Z2FDTNDATAQYW2` for all the regions. For - more information, see Set up a Regional Custom Domain Name and AWS - Regions and Endpoints for API Gateway. - """ - - endpoint_configuration: EndpointConfiguration | None = None - """ - The endpoint configuration of this DomainName showing the endpoint types - and IP address types of the domain name. - """ - - domain_name_status: str | None = None - """ - The status of the DomainName migration. The valid values are `AVAILABLE` - and `UPDATING`. If the status is `UPDATING`, the domain cannot be - modified further until the existing operation is complete. If it is - `AVAILABLE`, the domain can be updated. - """ - - domain_name_status_message: str | None = None - """ - An optional text message containing detailed information about status of - the DomainName migration. - """ - - security_policy: str | None = None - """ - The Transport Layer Security (TLS) version + cipher suite for this - DomainName. - """ - - endpoint_access_mode: str | None = None - """The endpoint access mode of the DomainName.""" - - tags: dict[str, str] | None = None - """ - The collection of tags. Each tag element is associated with a given - resource. - """ - - mutual_tls_authentication: MutualTlsAuthentication | None = None - """ - The mutual TLS authentication configuration for a custom domain name. If - specified, API Gateway performs two-way authentication between the - client and the server. Clients must present a trusted certificate to - access your API. - """ - - ownership_verification_certificate_arn: str | None = None - """ - The ARN of the public certificate issued by ACM to validate ownership of - your custom domain. Only required when configuring mutual TLS and using - an ACM imported or private CA certificate ARN as the - regionalCertificateArn. - """ - - management_policy: str | None = None - """ - A stringified JSON policy document that applies to the API Gateway - Management service for this DomainName. This policy document controls - access for access association sources to create domain name access - associations with this DomainName. Supported only for private custom - domain names. - """ - - policy: str | None = None - """ - A stringified JSON policy document that applies to the `execute-api` - service for this DomainName regardless of the caller and Method - configuration. Supported only for private custom domain names. - """ - - routing_mode: str | None = None - """ - The routing mode for this domain name. The routing mode determines how - API Gateway sends traffic from your custom domain name to your private - APIs. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DOMAIN_NAME_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.domain_name is not None: - serializer.write_string( - _SCHEMA_GET_DOMAIN_NAME_OUTPUT.members["domainName"], self.domain_name - ) - - if self.domain_name_id is not None: - serializer.write_string( - _SCHEMA_GET_DOMAIN_NAME_OUTPUT.members["domainNameId"], - self.domain_name_id, - ) - - if self.domain_name_arn is not None: - serializer.write_string( - _SCHEMA_GET_DOMAIN_NAME_OUTPUT.members["domainNameArn"], - self.domain_name_arn, - ) - - if self.certificate_name is not None: - serializer.write_string( - _SCHEMA_GET_DOMAIN_NAME_OUTPUT.members["certificateName"], - self.certificate_name, - ) - - if self.certificate_arn is not None: - serializer.write_string( - _SCHEMA_GET_DOMAIN_NAME_OUTPUT.members["certificateArn"], - self.certificate_arn, - ) - - if self.certificate_upload_date is not None: - serializer.write_timestamp( - _SCHEMA_GET_DOMAIN_NAME_OUTPUT.members["certificateUploadDate"], - self.certificate_upload_date, - ) - - if self.regional_domain_name is not None: - serializer.write_string( - _SCHEMA_GET_DOMAIN_NAME_OUTPUT.members["regionalDomainName"], - self.regional_domain_name, - ) - - if self.regional_hosted_zone_id is not None: - serializer.write_string( - _SCHEMA_GET_DOMAIN_NAME_OUTPUT.members["regionalHostedZoneId"], - self.regional_hosted_zone_id, - ) - - if self.regional_certificate_name is not None: - serializer.write_string( - _SCHEMA_GET_DOMAIN_NAME_OUTPUT.members["regionalCertificateName"], - self.regional_certificate_name, - ) - - if self.regional_certificate_arn is not None: - serializer.write_string( - _SCHEMA_GET_DOMAIN_NAME_OUTPUT.members["regionalCertificateArn"], - self.regional_certificate_arn, - ) - - if self.distribution_domain_name is not None: - serializer.write_string( - _SCHEMA_GET_DOMAIN_NAME_OUTPUT.members["distributionDomainName"], - self.distribution_domain_name, - ) - - if self.distribution_hosted_zone_id is not None: - serializer.write_string( - _SCHEMA_GET_DOMAIN_NAME_OUTPUT.members["distributionHostedZoneId"], - self.distribution_hosted_zone_id, - ) - - if self.endpoint_configuration is not None: - serializer.write_struct( - _SCHEMA_GET_DOMAIN_NAME_OUTPUT.members["endpointConfiguration"], - self.endpoint_configuration, - ) - - if self.domain_name_status is not None: - serializer.write_string( - _SCHEMA_GET_DOMAIN_NAME_OUTPUT.members["domainNameStatus"], - self.domain_name_status, - ) - - if self.domain_name_status_message is not None: - serializer.write_string( - _SCHEMA_GET_DOMAIN_NAME_OUTPUT.members["domainNameStatusMessage"], - self.domain_name_status_message, - ) - - if self.security_policy is not None: - serializer.write_string( - _SCHEMA_GET_DOMAIN_NAME_OUTPUT.members["securityPolicy"], - self.security_policy, - ) - - if self.endpoint_access_mode is not None: - serializer.write_string( - _SCHEMA_GET_DOMAIN_NAME_OUTPUT.members["endpointAccessMode"], - self.endpoint_access_mode, - ) - - if self.tags is not None: - _serialize_map_of_string_to_string( - serializer, _SCHEMA_GET_DOMAIN_NAME_OUTPUT.members["tags"], self.tags - ) - - if self.mutual_tls_authentication is not None: - serializer.write_struct( - _SCHEMA_GET_DOMAIN_NAME_OUTPUT.members["mutualTlsAuthentication"], - self.mutual_tls_authentication, - ) - - if self.ownership_verification_certificate_arn is not None: - serializer.write_string( - _SCHEMA_GET_DOMAIN_NAME_OUTPUT.members[ - "ownershipVerificationCertificateArn" - ], - self.ownership_verification_certificate_arn, - ) - - if self.management_policy is not None: - serializer.write_string( - _SCHEMA_GET_DOMAIN_NAME_OUTPUT.members["managementPolicy"], - self.management_policy, - ) - - if self.policy is not None: - serializer.write_string( - _SCHEMA_GET_DOMAIN_NAME_OUTPUT.members["policy"], self.policy - ) - - if self.routing_mode is not None: - serializer.write_string( - _SCHEMA_GET_DOMAIN_NAME_OUTPUT.members["routingMode"], self.routing_mode - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["domain_name"] = de.read_string( - _SCHEMA_GET_DOMAIN_NAME_OUTPUT.members["domainName"] - ) - - case 1: - kwargs["domain_name_id"] = de.read_string( - _SCHEMA_GET_DOMAIN_NAME_OUTPUT.members["domainNameId"] - ) - - case 2: - kwargs["domain_name_arn"] = de.read_string( - _SCHEMA_GET_DOMAIN_NAME_OUTPUT.members["domainNameArn"] - ) - - case 3: - kwargs["certificate_name"] = de.read_string( - _SCHEMA_GET_DOMAIN_NAME_OUTPUT.members["certificateName"] - ) - - case 4: - kwargs["certificate_arn"] = de.read_string( - _SCHEMA_GET_DOMAIN_NAME_OUTPUT.members["certificateArn"] - ) - - case 5: - kwargs["certificate_upload_date"] = de.read_timestamp( - _SCHEMA_GET_DOMAIN_NAME_OUTPUT.members["certificateUploadDate"] - ) - - case 6: - kwargs["regional_domain_name"] = de.read_string( - _SCHEMA_GET_DOMAIN_NAME_OUTPUT.members["regionalDomainName"] - ) - - case 7: - kwargs["regional_hosted_zone_id"] = de.read_string( - _SCHEMA_GET_DOMAIN_NAME_OUTPUT.members["regionalHostedZoneId"] - ) - - case 8: - kwargs["regional_certificate_name"] = de.read_string( - _SCHEMA_GET_DOMAIN_NAME_OUTPUT.members[ - "regionalCertificateName" - ] - ) - - case 9: - kwargs["regional_certificate_arn"] = de.read_string( - _SCHEMA_GET_DOMAIN_NAME_OUTPUT.members["regionalCertificateArn"] - ) - - case 10: - kwargs["distribution_domain_name"] = de.read_string( - _SCHEMA_GET_DOMAIN_NAME_OUTPUT.members["distributionDomainName"] - ) - - case 11: - kwargs["distribution_hosted_zone_id"] = de.read_string( - _SCHEMA_GET_DOMAIN_NAME_OUTPUT.members[ - "distributionHostedZoneId" - ] - ) - - case 12: - kwargs["endpoint_configuration"] = ( - EndpointConfiguration.deserialize(de) - ) - - case 13: - kwargs["domain_name_status"] = DomainNameStatus( - de.read_string( - _SCHEMA_GET_DOMAIN_NAME_OUTPUT.members["domainNameStatus"] - ) - ) - - case 14: - kwargs["domain_name_status_message"] = de.read_string( - _SCHEMA_GET_DOMAIN_NAME_OUTPUT.members[ - "domainNameStatusMessage" - ] - ) - - case 15: - kwargs["security_policy"] = SecurityPolicy( - de.read_string( - _SCHEMA_GET_DOMAIN_NAME_OUTPUT.members["securityPolicy"] - ) - ) - - case 16: - kwargs["endpoint_access_mode"] = EndpointAccessMode( - de.read_string( - _SCHEMA_GET_DOMAIN_NAME_OUTPUT.members["endpointAccessMode"] - ) - ) - - case 17: - kwargs["tags"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_GET_DOMAIN_NAME_OUTPUT.members["tags"] - ) - - case 18: - kwargs["mutual_tls_authentication"] = ( - MutualTlsAuthentication.deserialize(de) - ) - - case 19: - kwargs["ownership_verification_certificate_arn"] = de.read_string( - _SCHEMA_GET_DOMAIN_NAME_OUTPUT.members[ - "ownershipVerificationCertificateArn" - ] - ) - - case 20: - kwargs["management_policy"] = de.read_string( - _SCHEMA_GET_DOMAIN_NAME_OUTPUT.members["managementPolicy"] - ) - - case 21: - kwargs["policy"] = de.read_string( - _SCHEMA_GET_DOMAIN_NAME_OUTPUT.members["policy"] - ) - - case 22: - kwargs["routing_mode"] = RoutingMode( - de.read_string( - _SCHEMA_GET_DOMAIN_NAME_OUTPUT.members["routingMode"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_DOMAIN_NAME_OUTPUT, consumer=_consumer) - return kwargs - - -GET_DOMAIN_NAME = APIOperation( - input=GetDomainNameInput, - output=GetDomainNameOutput, - schema=_SCHEMA_GET_DOMAIN_NAME, - input_schema=_SCHEMA_GET_DOMAIN_NAME_INPUT, - output_schema=_SCHEMA_GET_DOMAIN_NAME_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -class ResourceOwner(UnknownEnumMixin, StrEnum): - SELF = "SELF" - OTHER_ACCOUNTS = "OTHER_ACCOUNTS" - - -@dataclass(kw_only=True) -class GetDomainNameAccessAssociationsInput: - """Dataclass for GetDomainNameAccessAssociationsInput structure.""" - - position: str | None = None - """The current pagination position in the paged result set.""" - - limit: int | None = None - """ - The maximum number of returned results per page. The default value is 25 - and the maximum value is 500. - """ - - resource_owner: str | None = None - """ - The owner of the domain name access association. Use `SELF` to only list - the domain name access associations owned by your own account. Use - `OTHER_ACCOUNTS` to list the domain name access associations with your - private custom domain names that are owned by other AWS accounts. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DOMAIN_NAME_ACCESS_ASSOCIATIONS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.position is not None: - serializer.write_string( - _SCHEMA_GET_DOMAIN_NAME_ACCESS_ASSOCIATIONS_INPUT.members["position"], - self.position, - ) - - if self.limit is not None: - serializer.write_integer( - _SCHEMA_GET_DOMAIN_NAME_ACCESS_ASSOCIATIONS_INPUT.members["limit"], - self.limit, - ) - - if self.resource_owner is not None: - serializer.write_string( - _SCHEMA_GET_DOMAIN_NAME_ACCESS_ASSOCIATIONS_INPUT.members[ - "resourceOwner" - ], - self.resource_owner, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["position"] = de.read_string( - _SCHEMA_GET_DOMAIN_NAME_ACCESS_ASSOCIATIONS_INPUT.members[ - "position" - ] - ) - - case 1: - kwargs["limit"] = de.read_integer( - _SCHEMA_GET_DOMAIN_NAME_ACCESS_ASSOCIATIONS_INPUT.members[ - "limit" - ] - ) - - case 2: - kwargs["resource_owner"] = ResourceOwner( - de.read_string( - _SCHEMA_GET_DOMAIN_NAME_ACCESS_ASSOCIATIONS_INPUT.members[ - "resourceOwner" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_DOMAIN_NAME_ACCESS_ASSOCIATIONS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DomainNameAccessAssociation: - """ - Represents a domain name access association between an access - association source and a private custom domain name. With a domain name - access association, an access association source can invoke a private - custom domain name while isolated from the public internet. - """ - - domain_name_access_association_arn: str | None = None - """The ARN of the domain name access association resource.""" - - domain_name_arn: str | None = None - """The ARN of the domain name.""" - - access_association_source_type: str | None = None - """The type of the domain name access association source.""" - - access_association_source: str | None = None - """ - The ARN of the domain name access association source. For a VPCE, the - ARN must be a VPC endpoint. - """ - - tags: dict[str, str] | None = None - """ - The collection of tags. Each tag element is associated with a given - resource. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOMAIN_NAME_ACCESS_ASSOCIATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.domain_name_access_association_arn is not None: - serializer.write_string( - _SCHEMA_DOMAIN_NAME_ACCESS_ASSOCIATION.members[ - "domainNameAccessAssociationArn" - ], - self.domain_name_access_association_arn, - ) - - if self.domain_name_arn is not None: - serializer.write_string( - _SCHEMA_DOMAIN_NAME_ACCESS_ASSOCIATION.members["domainNameArn"], - self.domain_name_arn, - ) - - if self.access_association_source_type is not None: - serializer.write_string( - _SCHEMA_DOMAIN_NAME_ACCESS_ASSOCIATION.members[ - "accessAssociationSourceType" - ], - self.access_association_source_type, - ) - - if self.access_association_source is not None: - serializer.write_string( - _SCHEMA_DOMAIN_NAME_ACCESS_ASSOCIATION.members[ - "accessAssociationSource" - ], - self.access_association_source, - ) - - if self.tags is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_DOMAIN_NAME_ACCESS_ASSOCIATION.members["tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["domain_name_access_association_arn"] = de.read_string( - _SCHEMA_DOMAIN_NAME_ACCESS_ASSOCIATION.members[ - "domainNameAccessAssociationArn" - ] - ) - - case 1: - kwargs["domain_name_arn"] = de.read_string( - _SCHEMA_DOMAIN_NAME_ACCESS_ASSOCIATION.members["domainNameArn"] - ) - - case 2: - kwargs["access_association_source_type"] = ( - AccessAssociationSourceType( - de.read_string( - _SCHEMA_DOMAIN_NAME_ACCESS_ASSOCIATION.members[ - "accessAssociationSourceType" - ] - ) - ) - ) - - case 3: - kwargs["access_association_source"] = de.read_string( - _SCHEMA_DOMAIN_NAME_ACCESS_ASSOCIATION.members[ - "accessAssociationSource" - ] - ) - - case 4: - kwargs["tags"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_DOMAIN_NAME_ACCESS_ASSOCIATION.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DOMAIN_NAME_ACCESS_ASSOCIATION, consumer=_consumer - ) - return kwargs - - -def _serialize_list_of_domain_name_access_association( - serializer: ShapeSerializer, - schema: Schema, - value: list[DomainNameAccessAssociation], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_list_of_domain_name_access_association( - deserializer: ShapeDeserializer, schema: Schema -) -> list[DomainNameAccessAssociation]: - result: list[DomainNameAccessAssociation] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(DomainNameAccessAssociation.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GetDomainNameAccessAssociationsOutput: - """Dataclass for GetDomainNameAccessAssociationsOutput structure.""" - - items: list[DomainNameAccessAssociation] | None = None - """The current page of elements from this collection.""" - - position: str | None = None - """The current pagination position in the paged result set.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_DOMAIN_NAME_ACCESS_ASSOCIATIONS_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.items is not None: - _serialize_list_of_domain_name_access_association( - serializer, - _SCHEMA_GET_DOMAIN_NAME_ACCESS_ASSOCIATIONS_OUTPUT.members["items"], - self.items, - ) - - if self.position is not None: - serializer.write_string( - _SCHEMA_GET_DOMAIN_NAME_ACCESS_ASSOCIATIONS_OUTPUT.members["position"], - self.position, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["items"] = ( - _deserialize_list_of_domain_name_access_association( - de, - _SCHEMA_GET_DOMAIN_NAME_ACCESS_ASSOCIATIONS_OUTPUT.members[ - "items" - ], - ) - ) - - case 1: - kwargs["position"] = de.read_string( - _SCHEMA_GET_DOMAIN_NAME_ACCESS_ASSOCIATIONS_OUTPUT.members[ - "position" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_DOMAIN_NAME_ACCESS_ASSOCIATIONS_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_DOMAIN_NAME_ACCESS_ASSOCIATIONS = APIOperation( - input=GetDomainNameAccessAssociationsInput, - output=GetDomainNameAccessAssociationsOutput, - schema=_SCHEMA_GET_DOMAIN_NAME_ACCESS_ASSOCIATIONS, - input_schema=_SCHEMA_GET_DOMAIN_NAME_ACCESS_ASSOCIATIONS_INPUT, - output_schema=_SCHEMA_GET_DOMAIN_NAME_ACCESS_ASSOCIATIONS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetDomainNamesInput: - """Request to describe a collection of DomainName resources.""" - - position: str | None = None - """The current pagination position in the paged result set.""" - - limit: int | None = None - """ - The maximum number of returned results per page. The default value is 25 - and the maximum value is 500. - """ - - resource_owner: str | None = None - """The owner of the domain name access association.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DOMAIN_NAMES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.position is not None: - serializer.write_string( - _SCHEMA_GET_DOMAIN_NAMES_INPUT.members["position"], self.position - ) - - if self.limit is not None: - serializer.write_integer( - _SCHEMA_GET_DOMAIN_NAMES_INPUT.members["limit"], self.limit - ) - - if self.resource_owner is not None: - serializer.write_string( - _SCHEMA_GET_DOMAIN_NAMES_INPUT.members["resourceOwner"], - self.resource_owner, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["position"] = de.read_string( - _SCHEMA_GET_DOMAIN_NAMES_INPUT.members["position"] - ) - - case 1: - kwargs["limit"] = de.read_integer( - _SCHEMA_GET_DOMAIN_NAMES_INPUT.members["limit"] - ) - - case 2: - kwargs["resource_owner"] = ResourceOwner( - de.read_string( - _SCHEMA_GET_DOMAIN_NAMES_INPUT.members["resourceOwner"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_DOMAIN_NAMES_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DomainName: - """ - Represents a custom domain name as a user-friendly host name of an API - (RestApi). - """ - - domain_name: str | None = None - """ - The custom domain name as an API host name, for example, - `my-api.example.com`. - """ - - domain_name_id: str | None = None - """ - The identifier for the domain name resource. Supported only for private - custom domain names. - """ - - domain_name_arn: str | None = None - """The ARN of the domain name.""" - - certificate_name: str | None = None - """ - The name of the certificate that will be used by edge-optimized endpoint - or private endpoint for this domain name. - """ - - certificate_arn: str | None = None - """ - The reference to an Amazon Web Services-managed certificate that will be - used by edge-optimized endpoint or private endpoint for this domain - name. Certificate Manager is the only supported source. - """ - - certificate_upload_date: datetime | None = None - """ - The timestamp when the certificate that was used by edge-optimized - endpoint or private endpoint for this domain name was uploaded. - """ - - regional_domain_name: str | None = None - """ - The domain name associated with the regional endpoint for this custom - domain name. You set up this association by adding a DNS record that - points the custom domain name to this regional domain name. The regional - domain name is returned by API Gateway when you create a regional - endpoint. - """ - - regional_hosted_zone_id: str | None = None - """ - The region-specific Amazon Route 53 Hosted Zone ID of the regional - endpoint. For more information, see Set up a Regional Custom Domain Name - and AWS Regions and Endpoints for API Gateway. - """ - - regional_certificate_name: str | None = None - """ - The name of the certificate that will be used for validating the - regional domain name. - """ - - regional_certificate_arn: str | None = None - """ - The reference to an Amazon Web Services-managed certificate that will be - used for validating the regional domain name. Certificate Manager is the - only supported source. - """ - - distribution_domain_name: str | None = None - """ - The domain name of the Amazon CloudFront distribution associated with - this custom domain name for an edge-optimized endpoint. You set up this - association when adding a DNS record pointing the custom domain name to - this distribution name. For more information about CloudFront - distributions, see the Amazon CloudFront documentation. - """ - - distribution_hosted_zone_id: str | None = None - """ - The region-agnostic Amazon Route 53 Hosted Zone ID of the edge-optimized - endpoint. The valid value is `Z2FDTNDATAQYW2` for all the regions. For - more information, see Set up a Regional Custom Domain Name and AWS - Regions and Endpoints for API Gateway. - """ - - endpoint_configuration: EndpointConfiguration | None = None - """ - The endpoint configuration of this DomainName showing the endpoint types - and IP address types of the domain name. - """ - - domain_name_status: str | None = None - """ - The status of the DomainName migration. The valid values are `AVAILABLE` - and `UPDATING`. If the status is `UPDATING`, the domain cannot be - modified further until the existing operation is complete. If it is - `AVAILABLE`, the domain can be updated. - """ - - domain_name_status_message: str | None = None - """ - An optional text message containing detailed information about status of - the DomainName migration. - """ - - security_policy: str | None = None - """ - The Transport Layer Security (TLS) version + cipher suite for this - DomainName. - """ - - endpoint_access_mode: str | None = None - """The endpoint access mode of the DomainName.""" - - tags: dict[str, str] | None = None - """ - The collection of tags. Each tag element is associated with a given - resource. - """ - - mutual_tls_authentication: MutualTlsAuthentication | None = None - """ - The mutual TLS authentication configuration for a custom domain name. If - specified, API Gateway performs two-way authentication between the - client and the server. Clients must present a trusted certificate to - access your API. - """ - - ownership_verification_certificate_arn: str | None = None - """ - The ARN of the public certificate issued by ACM to validate ownership of - your custom domain. Only required when configuring mutual TLS and using - an ACM imported or private CA certificate ARN as the - regionalCertificateArn. - """ - - management_policy: str | None = None - """ - A stringified JSON policy document that applies to the API Gateway - Management service for this DomainName. This policy document controls - access for access association sources to create domain name access - associations with this DomainName. Supported only for private custom - domain names. - """ - - policy: str | None = None - """ - A stringified JSON policy document that applies to the `execute-api` - service for this DomainName regardless of the caller and Method - configuration. Supported only for private custom domain names. - """ - - routing_mode: str | None = None - """ - The routing mode for this domain name. The routing mode determines how - API Gateway sends traffic from your custom domain name to your private - APIs. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOMAIN_NAME, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.domain_name is not None: - serializer.write_string( - _SCHEMA_DOMAIN_NAME.members["domainName"], self.domain_name - ) - - if self.domain_name_id is not None: - serializer.write_string( - _SCHEMA_DOMAIN_NAME.members["domainNameId"], self.domain_name_id - ) - - if self.domain_name_arn is not None: - serializer.write_string( - _SCHEMA_DOMAIN_NAME.members["domainNameArn"], self.domain_name_arn - ) - - if self.certificate_name is not None: - serializer.write_string( - _SCHEMA_DOMAIN_NAME.members["certificateName"], self.certificate_name - ) - - if self.certificate_arn is not None: - serializer.write_string( - _SCHEMA_DOMAIN_NAME.members["certificateArn"], self.certificate_arn - ) - - if self.certificate_upload_date is not None: - serializer.write_timestamp( - _SCHEMA_DOMAIN_NAME.members["certificateUploadDate"], - self.certificate_upload_date, - ) - - if self.regional_domain_name is not None: - serializer.write_string( - _SCHEMA_DOMAIN_NAME.members["regionalDomainName"], - self.regional_domain_name, - ) - - if self.regional_hosted_zone_id is not None: - serializer.write_string( - _SCHEMA_DOMAIN_NAME.members["regionalHostedZoneId"], - self.regional_hosted_zone_id, - ) - - if self.regional_certificate_name is not None: - serializer.write_string( - _SCHEMA_DOMAIN_NAME.members["regionalCertificateName"], - self.regional_certificate_name, - ) - - if self.regional_certificate_arn is not None: - serializer.write_string( - _SCHEMA_DOMAIN_NAME.members["regionalCertificateArn"], - self.regional_certificate_arn, - ) - - if self.distribution_domain_name is not None: - serializer.write_string( - _SCHEMA_DOMAIN_NAME.members["distributionDomainName"], - self.distribution_domain_name, - ) - - if self.distribution_hosted_zone_id is not None: - serializer.write_string( - _SCHEMA_DOMAIN_NAME.members["distributionHostedZoneId"], - self.distribution_hosted_zone_id, - ) - - if self.endpoint_configuration is not None: - serializer.write_struct( - _SCHEMA_DOMAIN_NAME.members["endpointConfiguration"], - self.endpoint_configuration, - ) - - if self.domain_name_status is not None: - serializer.write_string( - _SCHEMA_DOMAIN_NAME.members["domainNameStatus"], self.domain_name_status - ) - - if self.domain_name_status_message is not None: - serializer.write_string( - _SCHEMA_DOMAIN_NAME.members["domainNameStatusMessage"], - self.domain_name_status_message, - ) - - if self.security_policy is not None: - serializer.write_string( - _SCHEMA_DOMAIN_NAME.members["securityPolicy"], self.security_policy - ) - - if self.endpoint_access_mode is not None: - serializer.write_string( - _SCHEMA_DOMAIN_NAME.members["endpointAccessMode"], - self.endpoint_access_mode, - ) - - if self.tags is not None: - _serialize_map_of_string_to_string( - serializer, _SCHEMA_DOMAIN_NAME.members["tags"], self.tags - ) - - if self.mutual_tls_authentication is not None: - serializer.write_struct( - _SCHEMA_DOMAIN_NAME.members["mutualTlsAuthentication"], - self.mutual_tls_authentication, - ) - - if self.ownership_verification_certificate_arn is not None: - serializer.write_string( - _SCHEMA_DOMAIN_NAME.members["ownershipVerificationCertificateArn"], - self.ownership_verification_certificate_arn, - ) - - if self.management_policy is not None: - serializer.write_string( - _SCHEMA_DOMAIN_NAME.members["managementPolicy"], self.management_policy - ) - - if self.policy is not None: - serializer.write_string(_SCHEMA_DOMAIN_NAME.members["policy"], self.policy) - - if self.routing_mode is not None: - serializer.write_string( - _SCHEMA_DOMAIN_NAME.members["routingMode"], self.routing_mode - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["domain_name"] = de.read_string( - _SCHEMA_DOMAIN_NAME.members["domainName"] - ) - - case 1: - kwargs["domain_name_id"] = de.read_string( - _SCHEMA_DOMAIN_NAME.members["domainNameId"] - ) - - case 2: - kwargs["domain_name_arn"] = de.read_string( - _SCHEMA_DOMAIN_NAME.members["domainNameArn"] - ) - - case 3: - kwargs["certificate_name"] = de.read_string( - _SCHEMA_DOMAIN_NAME.members["certificateName"] - ) - - case 4: - kwargs["certificate_arn"] = de.read_string( - _SCHEMA_DOMAIN_NAME.members["certificateArn"] - ) - - case 5: - kwargs["certificate_upload_date"] = de.read_timestamp( - _SCHEMA_DOMAIN_NAME.members["certificateUploadDate"] - ) - - case 6: - kwargs["regional_domain_name"] = de.read_string( - _SCHEMA_DOMAIN_NAME.members["regionalDomainName"] - ) - - case 7: - kwargs["regional_hosted_zone_id"] = de.read_string( - _SCHEMA_DOMAIN_NAME.members["regionalHostedZoneId"] - ) - - case 8: - kwargs["regional_certificate_name"] = de.read_string( - _SCHEMA_DOMAIN_NAME.members["regionalCertificateName"] - ) - - case 9: - kwargs["regional_certificate_arn"] = de.read_string( - _SCHEMA_DOMAIN_NAME.members["regionalCertificateArn"] - ) - - case 10: - kwargs["distribution_domain_name"] = de.read_string( - _SCHEMA_DOMAIN_NAME.members["distributionDomainName"] - ) - - case 11: - kwargs["distribution_hosted_zone_id"] = de.read_string( - _SCHEMA_DOMAIN_NAME.members["distributionHostedZoneId"] - ) - - case 12: - kwargs["endpoint_configuration"] = ( - EndpointConfiguration.deserialize(de) - ) - - case 13: - kwargs["domain_name_status"] = DomainNameStatus( - de.read_string(_SCHEMA_DOMAIN_NAME.members["domainNameStatus"]) - ) - - case 14: - kwargs["domain_name_status_message"] = de.read_string( - _SCHEMA_DOMAIN_NAME.members["domainNameStatusMessage"] - ) - - case 15: - kwargs["security_policy"] = SecurityPolicy( - de.read_string(_SCHEMA_DOMAIN_NAME.members["securityPolicy"]) - ) - - case 16: - kwargs["endpoint_access_mode"] = EndpointAccessMode( - de.read_string( - _SCHEMA_DOMAIN_NAME.members["endpointAccessMode"] - ) - ) - - case 17: - kwargs["tags"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_DOMAIN_NAME.members["tags"] - ) - - case 18: - kwargs["mutual_tls_authentication"] = ( - MutualTlsAuthentication.deserialize(de) - ) - - case 19: - kwargs["ownership_verification_certificate_arn"] = de.read_string( - _SCHEMA_DOMAIN_NAME.members[ - "ownershipVerificationCertificateArn" - ] - ) - - case 20: - kwargs["management_policy"] = de.read_string( - _SCHEMA_DOMAIN_NAME.members["managementPolicy"] - ) - - case 21: - kwargs["policy"] = de.read_string( - _SCHEMA_DOMAIN_NAME.members["policy"] - ) - - case 22: - kwargs["routing_mode"] = RoutingMode( - de.read_string(_SCHEMA_DOMAIN_NAME.members["routingMode"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DOMAIN_NAME, consumer=_consumer) - return kwargs - - -def _serialize_list_of_domain_name( - serializer: ShapeSerializer, schema: Schema, value: list[DomainName] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_list_of_domain_name( - deserializer: ShapeDeserializer, schema: Schema -) -> list[DomainName]: - result: list[DomainName] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(DomainName.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GetDomainNamesOutput: - """Represents a collection of DomainName resources.""" - - items: list[DomainName] | None = None - """The current page of elements from this collection.""" - - position: str | None = None - """The current pagination position in the paged result set.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DOMAIN_NAMES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.items is not None: - _serialize_list_of_domain_name( - serializer, _SCHEMA_GET_DOMAIN_NAMES_OUTPUT.members["items"], self.items - ) - - if self.position is not None: - serializer.write_string( - _SCHEMA_GET_DOMAIN_NAMES_OUTPUT.members["position"], self.position - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["items"] = _deserialize_list_of_domain_name( - de, _SCHEMA_GET_DOMAIN_NAMES_OUTPUT.members["items"] - ) - - case 1: - kwargs["position"] = de.read_string( - _SCHEMA_GET_DOMAIN_NAMES_OUTPUT.members["position"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_DOMAIN_NAMES_OUTPUT, consumer=_consumer) - return kwargs - - -GET_DOMAIN_NAMES = APIOperation( - input=GetDomainNamesInput, - output=GetDomainNamesOutput, - schema=_SCHEMA_GET_DOMAIN_NAMES, - input_schema=_SCHEMA_GET_DOMAIN_NAMES_INPUT, - output_schema=_SCHEMA_GET_DOMAIN_NAMES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetExportInput: - """Request a new export of a RestApi for a particular Stage.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - stage_name: str | None = None - """The name of the Stage that will be exported.""" - - export_type: str | None = None - """ - The type of export. Acceptable values are 'oas30' for OpenAPI 3.0.x - and 'swagger' for Swagger/OpenAPI 2.0. - """ - - parameters: dict[str, str] | None = None - """ - A key-value map of query string parameters that specify properties of - the export, depending on the requested `exportType`. For `exportType` - `oas30` and `swagger`, any combination of the following parameters are - supported: `extensions='integrations'` or `extensions='apigateway'` will - export the API with x-amazon-apigateway-integration extensions. - `extensions='authorizers'` will export the API with - x-amazon-apigateway-authorizer extensions. `postman` will export the API - with Postman extensions, allowing for import to the Postman tool - """ - - accepts: str | None = None - """ - The content-type of the export, for example `application/json`. - Currently `application/json` and `application/yaml` are supported for - `exportType` of`oas30` and `swagger`. This should be specified in the - `Accept` header for direct API requests. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_EXPORT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_GET_EXPORT_INPUT.members["restApiId"], self.rest_api_id - ) - - if self.stage_name is not None: - serializer.write_string( - _SCHEMA_GET_EXPORT_INPUT.members["stageName"], self.stage_name - ) - - if self.export_type is not None: - serializer.write_string( - _SCHEMA_GET_EXPORT_INPUT.members["exportType"], self.export_type - ) - - if self.parameters is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_GET_EXPORT_INPUT.members["parameters"], - self.parameters, - ) - - if self.accepts is not None: - serializer.write_string( - _SCHEMA_GET_EXPORT_INPUT.members["accepts"], self.accepts - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_GET_EXPORT_INPUT.members["restApiId"] - ) - - case 1: - kwargs["stage_name"] = de.read_string( - _SCHEMA_GET_EXPORT_INPUT.members["stageName"] - ) - - case 2: - kwargs["export_type"] = de.read_string( - _SCHEMA_GET_EXPORT_INPUT.members["exportType"] - ) - - case 3: - kwargs["parameters"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_GET_EXPORT_INPUT.members["parameters"] - ) - - case 4: - kwargs["accepts"] = de.read_string( - _SCHEMA_GET_EXPORT_INPUT.members["accepts"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_EXPORT_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetExportOutput: - """The binary blob response to GetExport, which contains the generated SDK.""" - - content_type: str | None = None - """ - The content-type header value in the HTTP response. This will correspond - to a valid 'accept' type in the request. - """ - - content_disposition: str | None = None - """The content-disposition header value in the HTTP response.""" - - body: bytes | None = None - """The binary blob response to GetExport, which contains the export.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_EXPORT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.content_type is not None: - serializer.write_string( - _SCHEMA_GET_EXPORT_OUTPUT.members["contentType"], self.content_type - ) - - if self.content_disposition is not None: - serializer.write_string( - _SCHEMA_GET_EXPORT_OUTPUT.members["contentDisposition"], - self.content_disposition, - ) - - if self.body is not None: - serializer.write_blob(_SCHEMA_GET_EXPORT_OUTPUT.members["body"], self.body) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["content_type"] = de.read_string( - _SCHEMA_GET_EXPORT_OUTPUT.members["contentType"] - ) - - case 1: - kwargs["content_disposition"] = de.read_string( - _SCHEMA_GET_EXPORT_OUTPUT.members["contentDisposition"] - ) - - case 2: - kwargs["body"] = de.read_blob( - _SCHEMA_GET_EXPORT_OUTPUT.members["body"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_EXPORT_OUTPUT, consumer=_consumer) - return kwargs - - -GET_EXPORT = APIOperation( - input=GetExportInput, - output=GetExportOutput, - schema=_SCHEMA_GET_EXPORT, - input_schema=_SCHEMA_GET_EXPORT_INPUT, - output_schema=_SCHEMA_GET_EXPORT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetGatewayResponseInput: - """ - Gets a GatewayResponse of a specified response type on the given - RestApi. - """ - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - response_type: str | None = None - """The response type of the associated GatewayResponse.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_GATEWAY_RESPONSE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_GET_GATEWAY_RESPONSE_INPUT.members["restApiId"], - self.rest_api_id, - ) - - if self.response_type is not None: - serializer.write_string( - _SCHEMA_GET_GATEWAY_RESPONSE_INPUT.members["responseType"], - self.response_type, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_GET_GATEWAY_RESPONSE_INPUT.members["restApiId"] - ) - - case 1: - kwargs["response_type"] = GatewayResponseType( - de.read_string( - _SCHEMA_GET_GATEWAY_RESPONSE_INPUT.members["responseType"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_GATEWAY_RESPONSE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetGatewayResponseOutput: - """ - A gateway response of a given response type and status code, with - optional response parameters and mapping templates. - """ - - response_type: str | None = None - """The response type of the associated GatewayResponse.""" - - status_code: str | None = None - """The HTTP status code for this GatewayResponse.""" - - response_parameters: dict[str, str] | None = None - """ - Response parameters (paths, query strings and headers) of the - GatewayResponse as a string-to-string map of key-value pairs. - """ - - response_templates: dict[str, str] | None = None - """ - Response templates of the GatewayResponse as a string-to-string map of - key-value pairs. - """ - - default_response: bool = False - """ - A Boolean flag to indicate whether this GatewayResponse is the default - gateway response (`true`) or not (`false`). A default gateway response - is one generated by API Gateway without any customization by an API - developer. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_GATEWAY_RESPONSE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.response_type is not None: - serializer.write_string( - _SCHEMA_GET_GATEWAY_RESPONSE_OUTPUT.members["responseType"], - self.response_type, - ) - - if self.status_code is not None: - serializer.write_string( - _SCHEMA_GET_GATEWAY_RESPONSE_OUTPUT.members["statusCode"], - self.status_code, - ) - - if self.response_parameters is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_GET_GATEWAY_RESPONSE_OUTPUT.members["responseParameters"], - self.response_parameters, - ) - - if self.response_templates is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_GET_GATEWAY_RESPONSE_OUTPUT.members["responseTemplates"], - self.response_templates, - ) - - serializer.write_boolean( - _SCHEMA_GET_GATEWAY_RESPONSE_OUTPUT.members["defaultResponse"], - self.default_response, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["response_type"] = GatewayResponseType( - de.read_string( - _SCHEMA_GET_GATEWAY_RESPONSE_OUTPUT.members["responseType"] - ) - ) - - case 1: - kwargs["status_code"] = de.read_string( - _SCHEMA_GET_GATEWAY_RESPONSE_OUTPUT.members["statusCode"] - ) - - case 2: - kwargs["response_parameters"] = ( - _deserialize_map_of_string_to_string( - de, - _SCHEMA_GET_GATEWAY_RESPONSE_OUTPUT.members[ - "responseParameters" - ], - ) - ) - - case 3: - kwargs["response_templates"] = _deserialize_map_of_string_to_string( - de, - _SCHEMA_GET_GATEWAY_RESPONSE_OUTPUT.members[ - "responseTemplates" - ], - ) - - case 4: - kwargs["default_response"] = de.read_boolean( - _SCHEMA_GET_GATEWAY_RESPONSE_OUTPUT.members["defaultResponse"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_GATEWAY_RESPONSE_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_GATEWAY_RESPONSE = APIOperation( - input=GetGatewayResponseInput, - output=GetGatewayResponseOutput, - schema=_SCHEMA_GET_GATEWAY_RESPONSE, - input_schema=_SCHEMA_GET_GATEWAY_RESPONSE_INPUT, - output_schema=_SCHEMA_GET_GATEWAY_RESPONSE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetGatewayResponsesInput: - """ - Gets the GatewayResponses collection on the given RestApi. If an API - developer has not added any definitions for gateway responses, the - result will be the API Gateway-generated default GatewayResponses - collection for the supported response types. - """ - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - position: str | None = None - """ - The current pagination position in the paged result set. The - GatewayResponse collection does not support pagination and the position - does not apply here. - """ - - limit: int | None = None - """ - The maximum number of returned results per page. The default value is 25 - and the maximum value is 500. The GatewayResponses collection does not - support pagination and the limit does not apply here. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_GATEWAY_RESPONSES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_GET_GATEWAY_RESPONSES_INPUT.members["restApiId"], - self.rest_api_id, - ) - - if self.position is not None: - serializer.write_string( - _SCHEMA_GET_GATEWAY_RESPONSES_INPUT.members["position"], self.position - ) - - if self.limit is not None: - serializer.write_integer( - _SCHEMA_GET_GATEWAY_RESPONSES_INPUT.members["limit"], self.limit - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_GET_GATEWAY_RESPONSES_INPUT.members["restApiId"] - ) - - case 1: - kwargs["position"] = de.read_string( - _SCHEMA_GET_GATEWAY_RESPONSES_INPUT.members["position"] - ) - - case 2: - kwargs["limit"] = de.read_integer( - _SCHEMA_GET_GATEWAY_RESPONSES_INPUT.members["limit"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_GATEWAY_RESPONSES_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GatewayResponse: - """ - A gateway response of a given response type and status code, with - optional response parameters and mapping templates. - """ - - response_type: str | None = None - """The response type of the associated GatewayResponse.""" - - status_code: str | None = None - """The HTTP status code for this GatewayResponse.""" - - response_parameters: dict[str, str] | None = None - """ - Response parameters (paths, query strings and headers) of the - GatewayResponse as a string-to-string map of key-value pairs. - """ - - response_templates: dict[str, str] | None = None - """ - Response templates of the GatewayResponse as a string-to-string map of - key-value pairs. - """ - - default_response: bool = False - """ - A Boolean flag to indicate whether this GatewayResponse is the default - gateway response (`true`) or not (`false`). A default gateway response - is one generated by API Gateway without any customization by an API - developer. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GATEWAY_RESPONSE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.response_type is not None: - serializer.write_string( - _SCHEMA_GATEWAY_RESPONSE.members["responseType"], self.response_type - ) - - if self.status_code is not None: - serializer.write_string( - _SCHEMA_GATEWAY_RESPONSE.members["statusCode"], self.status_code - ) - - if self.response_parameters is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_GATEWAY_RESPONSE.members["responseParameters"], - self.response_parameters, - ) - - if self.response_templates is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_GATEWAY_RESPONSE.members["responseTemplates"], - self.response_templates, - ) - - serializer.write_boolean( - _SCHEMA_GATEWAY_RESPONSE.members["defaultResponse"], self.default_response - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["response_type"] = GatewayResponseType( - de.read_string(_SCHEMA_GATEWAY_RESPONSE.members["responseType"]) - ) - - case 1: - kwargs["status_code"] = de.read_string( - _SCHEMA_GATEWAY_RESPONSE.members["statusCode"] - ) - - case 2: - kwargs["response_parameters"] = ( - _deserialize_map_of_string_to_string( - de, _SCHEMA_GATEWAY_RESPONSE.members["responseParameters"] - ) - ) - - case 3: - kwargs["response_templates"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_GATEWAY_RESPONSE.members["responseTemplates"] - ) - - case 4: - kwargs["default_response"] = de.read_boolean( - _SCHEMA_GATEWAY_RESPONSE.members["defaultResponse"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GATEWAY_RESPONSE, consumer=_consumer) - return kwargs - - -def _serialize_list_of_gateway_response( - serializer: ShapeSerializer, schema: Schema, value: list[GatewayResponse] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_list_of_gateway_response( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GatewayResponse]: - result: list[GatewayResponse] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GatewayResponse.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GetGatewayResponsesOutput: - """ - The collection of the GatewayResponse instances of a RestApi as a - `responseType`-to-GatewayResponse object map of key-value pairs. As - such, pagination is not supported for querying this collection. - """ - - items: list[GatewayResponse] | None = None - """Returns the entire collection, because of no pagination support.""" - - position: str | None = None - """ - The current pagination position in the paged result set. The - GatewayResponse collection does not support pagination and the position - does not apply here. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_GATEWAY_RESPONSES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.items is not None: - _serialize_list_of_gateway_response( - serializer, - _SCHEMA_GET_GATEWAY_RESPONSES_OUTPUT.members["items"], - self.items, - ) - - if self.position is not None: - serializer.write_string( - _SCHEMA_GET_GATEWAY_RESPONSES_OUTPUT.members["position"], self.position - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["items"] = _deserialize_list_of_gateway_response( - de, _SCHEMA_GET_GATEWAY_RESPONSES_OUTPUT.members["items"] - ) - - case 1: - kwargs["position"] = de.read_string( - _SCHEMA_GET_GATEWAY_RESPONSES_OUTPUT.members["position"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_GATEWAY_RESPONSES_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_GATEWAY_RESPONSES = APIOperation( - input=GetGatewayResponsesInput, - output=GetGatewayResponsesOutput, - schema=_SCHEMA_GET_GATEWAY_RESPONSES, - input_schema=_SCHEMA_GET_GATEWAY_RESPONSES_INPUT, - output_schema=_SCHEMA_GET_GATEWAY_RESPONSES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetIntegrationInput: - """Represents a request to get the integration configuration.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - resource_id: str | None = None - """Specifies a get integration request's resource identifier""" - - http_method: str | None = None - """Specifies a get integration request's HTTP method.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_INTEGRATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_GET_INTEGRATION_INPUT.members["restApiId"], self.rest_api_id - ) - - if self.resource_id is not None: - serializer.write_string( - _SCHEMA_GET_INTEGRATION_INPUT.members["resourceId"], self.resource_id - ) - - if self.http_method is not None: - serializer.write_string( - _SCHEMA_GET_INTEGRATION_INPUT.members["httpMethod"], self.http_method - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_GET_INTEGRATION_INPUT.members["restApiId"] - ) - - case 1: - kwargs["resource_id"] = de.read_string( - _SCHEMA_GET_INTEGRATION_INPUT.members["resourceId"] - ) - - case 2: - kwargs["http_method"] = de.read_string( - _SCHEMA_GET_INTEGRATION_INPUT.members["httpMethod"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_INTEGRATION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetIntegrationOutput: - """ - Represents an `HTTP`, `HTTP_PROXY`, `AWS`, `AWS_PROXY`, or Mock - integration. - """ - - type: str | None = None - """ - Specifies an API method integration type. The valid value is one of the - following: - - For the HTTP and HTTP proxy integrations, each integration can specify a - protocol (`http/https`), port and path. Standard 80 and 443 ports are - supported as well as custom ports above 1024. An HTTP or HTTP proxy - integration with a `connectionType` of `VPC_LINK` is referred to as a - private integration and uses a VpcLink to connect API Gateway to a - network load balancer of a VPC. - """ - - http_method: str | None = None - """ - Specifies the integration's HTTP method type. For the Type property, if - you specify `MOCK`, this property is optional. For Lambda integrations, - you must set the integration method to `POST`. For all other types, you - must specify this property. - """ - - uri: str | None = None - """ - Specifies Uniform Resource Identifier (URI) of the integration endpoint. - - For `HTTP` or `HTTP_PROXY` integrations, the URI must be a fully formed, - encoded HTTP(S) URL according to the RFC-3986 specification for standard - integrations. If `connectionType` is `VPC_LINK` specify the Network Load - Balancer DNS name. For `AWS` or `AWS_PROXY` integrations, the URI is of - the form - `arn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api}`. - Here, {Region} is the API Gateway region (e.g., us-east-1); {service} is - the name of the integrated Amazon Web Services service (e.g., s3); and - {subdomain} is a designated subdomain supported by certain Amazon Web - Services service for fast host-name lookup. action can be used for an - Amazon Web Services service action-based API, using an - Action={name}&{p1}={v1}&p2={v2}... query string. The ensuing - {service_api} refers to a supported action {name} plus any required - input parameters. Alternatively, path can be used for an Amazon Web - Services service path-based API. The ensuing service_api refers to the - path to an Amazon Web Services service resource, including the region of - the integrated Amazon Web Services service, if applicable. For example, - for integration with the S3 API of GetObject, the uri can be either - `arn:aws:apigateway:us-west-2:s3:action/GetObject&Bucket={bucket}&Key={key}` - or `arn:aws:apigateway:us-west-2:s3:path/{bucket}/{key}` - """ - - connection_type: str | None = None - """ - The type of the network connection to the integration endpoint. The - valid value is `INTERNET` for connections through the public routable - internet or `VPC_LINK` for private connections between API Gateway and a - network load balancer in a VPC. The default value is `INTERNET`. - """ - - connection_id: str | None = None - """ - The ID of the VpcLink used for the integration when - `connectionType=VPC_LINK` and undefined, otherwise. - """ - - credentials: str | None = None - """ - Specifies the credentials required for the integration, if any. For AWS - integrations, three options are available. To specify an IAM Role for - API Gateway to assume, use the role's Amazon Resource Name (ARN). To - require that the caller's identity be passed through from the request, - specify the string `arn:aws:iam::*:user/*`. To use resource-based - permissions on supported Amazon Web Services services, specify null. - """ - - request_parameters: dict[str, str] | None = None - """ - A key-value map specifying request parameters that are passed from the - method request to the back end. The key is an integration request - parameter name and the associated value is a method request parameter - value or static value that must be enclosed within single quotes and - pre-encoded as required by the back end. The method request parameter - value must match the pattern of `method.request.{location}.{name}`, - where `location` is `querystring`, `path`, or `header` and `name` must - be a valid and unique method request parameter name. - """ - - request_templates: dict[str, str] | None = None - """ - Represents a map of Velocity templates that are applied on the request - payload based on the value of the Content-Type header sent by the - client. The content type value is the key in this map, and the template - (as a String) is the value. - """ - - passthrough_behavior: str | None = None - """ - Specifies how the method request body of an unmapped content type will - be passed through the integration request to the back end without - transformation. A content type is unmapped if no mapping template is - defined in the integration or the content type does not match any of the - mapped content types, as specified in `requestTemplates`. The valid - value is one of the following: `WHEN_NO_MATCH`: passes the method - request body through the integration request to the back end without - transformation when the method request content type does not match any - content type associated with the mapping templates defined in the - integration request. `WHEN_NO_TEMPLATES`: passes the method request body - through the integration request to the back end without transformation - when no mapping template is defined in the integration request. If a - template is defined when this option is selected, the method request of - an unmapped content-type will be rejected with an HTTP 415 Unsupported - Media Type response. `NEVER`: rejects the method request with an HTTP - 415 Unsupported Media Type response when either the method request - content type does not match any content type associated with the mapping - templates defined in the integration request or no mapping template is - defined in the integration request. - """ - - content_handling: str | None = None - """ - Specifies how to handle request payload content type conversions. - Supported values are `CONVERT_TO_BINARY` and `CONVERT_TO_TEXT`, with the - following behaviors: - - If this property is not defined, the request payload will be passed - through from the method request to integration request without - modification, provided that the `passthroughBehavior` is configured to - support payload pass-through. - """ - - timeout_in_millis: int = 0 - """ - Custom timeout between 50 and 29,000 milliseconds. The default value is - 29,000 milliseconds or 29 seconds. You can increase the default value to - longer than 29 seconds for Regional or private APIs only. - """ - - cache_namespace: str | None = None - """ - Specifies a group of related cached parameters. By default, API Gateway - uses the resource ID as the `cacheNamespace`. You can specify the same - `cacheNamespace` across resources to return the same cached data for - requests to different resources. - """ - - cache_key_parameters: list[str] | None = None - """ - A list of request parameters whose values API Gateway caches. To be - valid values for `cacheKeyParameters`, these parameters must also be - specified for Method `requestParameters`. - """ - - integration_responses: dict[str, IntegrationResponse] | None = None - """Specifies the integration's responses.""" - - tls_config: TlsConfig | None = None - """Specifies the TLS configuration for an integration.""" - - response_transfer_mode: str | None = None - """The response transfer mode of the integration.""" - - integration_target: str | None = None - """The ALB or NLB listener to send the request to.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_INTEGRATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_GET_INTEGRATION_OUTPUT.members["type"], self.type - ) - - if self.http_method is not None: - serializer.write_string( - _SCHEMA_GET_INTEGRATION_OUTPUT.members["httpMethod"], self.http_method - ) - - if self.uri is not None: - serializer.write_string( - _SCHEMA_GET_INTEGRATION_OUTPUT.members["uri"], self.uri - ) - - if self.connection_type is not None: - serializer.write_string( - _SCHEMA_GET_INTEGRATION_OUTPUT.members["connectionType"], - self.connection_type, - ) - - if self.connection_id is not None: - serializer.write_string( - _SCHEMA_GET_INTEGRATION_OUTPUT.members["connectionId"], - self.connection_id, - ) - - if self.credentials is not None: - serializer.write_string( - _SCHEMA_GET_INTEGRATION_OUTPUT.members["credentials"], self.credentials - ) - - if self.request_parameters is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_GET_INTEGRATION_OUTPUT.members["requestParameters"], - self.request_parameters, - ) - - if self.request_templates is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_GET_INTEGRATION_OUTPUT.members["requestTemplates"], - self.request_templates, - ) - - if self.passthrough_behavior is not None: - serializer.write_string( - _SCHEMA_GET_INTEGRATION_OUTPUT.members["passthroughBehavior"], - self.passthrough_behavior, - ) - - if self.content_handling is not None: - serializer.write_string( - _SCHEMA_GET_INTEGRATION_OUTPUT.members["contentHandling"], - self.content_handling, - ) - - serializer.write_integer( - _SCHEMA_GET_INTEGRATION_OUTPUT.members["timeoutInMillis"], - self.timeout_in_millis, - ) - if self.cache_namespace is not None: - serializer.write_string( - _SCHEMA_GET_INTEGRATION_OUTPUT.members["cacheNamespace"], - self.cache_namespace, - ) - - if self.cache_key_parameters is not None: - _serialize_list_of_string( - serializer, - _SCHEMA_GET_INTEGRATION_OUTPUT.members["cacheKeyParameters"], - self.cache_key_parameters, - ) - - if self.integration_responses is not None: - _serialize_map_of_integration_response( - serializer, - _SCHEMA_GET_INTEGRATION_OUTPUT.members["integrationResponses"], - self.integration_responses, - ) - - if self.tls_config is not None: - serializer.write_struct( - _SCHEMA_GET_INTEGRATION_OUTPUT.members["tlsConfig"], self.tls_config - ) - - if self.response_transfer_mode is not None: - serializer.write_string( - _SCHEMA_GET_INTEGRATION_OUTPUT.members["responseTransferMode"], - self.response_transfer_mode, - ) - - if self.integration_target is not None: - serializer.write_string( - _SCHEMA_GET_INTEGRATION_OUTPUT.members["integrationTarget"], - self.integration_target, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = IntegrationType( - de.read_string(_SCHEMA_GET_INTEGRATION_OUTPUT.members["type"]) - ) - - case 1: - kwargs["http_method"] = de.read_string( - _SCHEMA_GET_INTEGRATION_OUTPUT.members["httpMethod"] - ) - - case 2: - kwargs["uri"] = de.read_string( - _SCHEMA_GET_INTEGRATION_OUTPUT.members["uri"] - ) - - case 3: - kwargs["connection_type"] = ConnectionType( - de.read_string( - _SCHEMA_GET_INTEGRATION_OUTPUT.members["connectionType"] - ) - ) - - case 4: - kwargs["connection_id"] = de.read_string( - _SCHEMA_GET_INTEGRATION_OUTPUT.members["connectionId"] - ) - - case 5: - kwargs["credentials"] = de.read_string( - _SCHEMA_GET_INTEGRATION_OUTPUT.members["credentials"] - ) - - case 6: - kwargs["request_parameters"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_GET_INTEGRATION_OUTPUT.members["requestParameters"] - ) - - case 7: - kwargs["request_templates"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_GET_INTEGRATION_OUTPUT.members["requestTemplates"] - ) - - case 8: - kwargs["passthrough_behavior"] = de.read_string( - _SCHEMA_GET_INTEGRATION_OUTPUT.members["passthroughBehavior"] - ) - - case 9: - kwargs["content_handling"] = ContentHandlingStrategy( - de.read_string( - _SCHEMA_GET_INTEGRATION_OUTPUT.members["contentHandling"] - ) - ) - - case 10: - kwargs["timeout_in_millis"] = de.read_integer( - _SCHEMA_GET_INTEGRATION_OUTPUT.members["timeoutInMillis"] - ) - - case 11: - kwargs["cache_namespace"] = de.read_string( - _SCHEMA_GET_INTEGRATION_OUTPUT.members["cacheNamespace"] - ) - - case 12: - kwargs["cache_key_parameters"] = _deserialize_list_of_string( - de, _SCHEMA_GET_INTEGRATION_OUTPUT.members["cacheKeyParameters"] - ) - - case 13: - kwargs["integration_responses"] = ( - _deserialize_map_of_integration_response( - de, - _SCHEMA_GET_INTEGRATION_OUTPUT.members[ - "integrationResponses" - ], - ) - ) - - case 14: - kwargs["tls_config"] = TlsConfig.deserialize(de) - - case 15: - kwargs["response_transfer_mode"] = ResponseTransferMode( - de.read_string( - _SCHEMA_GET_INTEGRATION_OUTPUT.members[ - "responseTransferMode" - ] - ) - ) - - case 16: - kwargs["integration_target"] = de.read_string( - _SCHEMA_GET_INTEGRATION_OUTPUT.members["integrationTarget"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_INTEGRATION_OUTPUT, consumer=_consumer) - return kwargs - - -GET_INTEGRATION = APIOperation( - input=GetIntegrationInput, - output=GetIntegrationOutput, - schema=_SCHEMA_GET_INTEGRATION, - input_schema=_SCHEMA_GET_INTEGRATION_INPUT, - output_schema=_SCHEMA_GET_INTEGRATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetIntegrationResponseInput: - """Represents a get integration response request.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - resource_id: str | None = None - """Specifies a get integration response request's resource identifier.""" - - http_method: str | None = None - """Specifies a get integration response request's HTTP method.""" - - status_code: str | None = None - """Specifies a get integration response request's status code.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_INTEGRATION_RESPONSE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_GET_INTEGRATION_RESPONSE_INPUT.members["restApiId"], - self.rest_api_id, - ) - - if self.resource_id is not None: - serializer.write_string( - _SCHEMA_GET_INTEGRATION_RESPONSE_INPUT.members["resourceId"], - self.resource_id, - ) - - if self.http_method is not None: - serializer.write_string( - _SCHEMA_GET_INTEGRATION_RESPONSE_INPUT.members["httpMethod"], - self.http_method, - ) - - if self.status_code is not None: - serializer.write_string( - _SCHEMA_GET_INTEGRATION_RESPONSE_INPUT.members["statusCode"], - self.status_code, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_GET_INTEGRATION_RESPONSE_INPUT.members["restApiId"] - ) - - case 1: - kwargs["resource_id"] = de.read_string( - _SCHEMA_GET_INTEGRATION_RESPONSE_INPUT.members["resourceId"] - ) - - case 2: - kwargs["http_method"] = de.read_string( - _SCHEMA_GET_INTEGRATION_RESPONSE_INPUT.members["httpMethod"] - ) - - case 3: - kwargs["status_code"] = de.read_string( - _SCHEMA_GET_INTEGRATION_RESPONSE_INPUT.members["statusCode"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_INTEGRATION_RESPONSE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetIntegrationResponseOutput: - """ - Represents an integration response. The status code must map to an - existing MethodResponse, and parameters and templates can be used to - transform the back-end response. - """ - - status_code: str | None = None - """ - Specifies the status code that is used to map the integration response - to an existing MethodResponse. - """ - - selection_pattern: str | None = None - """ - Specifies the regular expression (regex) pattern used to choose an - integration response based on the response from the back end. For - example, if the success response returns nothing and the error response - returns some string, you could use the `.+` regex to match error - response. However, make sure that the error response does not contain - any newline (`\n`) character in such cases. If the back end is an Lambda - function, the Lambda function error header is matched. For all other - HTTP and Amazon Web Services back ends, the HTTP status code is matched. - """ - - response_parameters: dict[str, str] | None = None - """ - A key-value map specifying response parameters that are passed to the - method response from the back end. The key is a method response header - parameter name and the mapped value is an integration response header - value, a static value enclosed within a pair of single quotes, or a JSON - expression from the integration response body. The mapping key must - match the pattern of `method.response.header.{name}`, where `name` is a - valid and unique header name. The mapped non-static value must match the - pattern of `integration.response.header.{name}` or - `integration.response.body.{JSON-expression}`, where `name` is a valid - and unique response header name and `JSON-expression` is a valid JSON - expression without the `$` prefix. - """ - - response_templates: dict[str, str] | None = None - """ - Specifies the templates used to transform the integration response body. - Response templates are represented as a key/value map, with a - content-type as the key and a template as the value. - """ - - content_handling: str | None = None - """ - Specifies how to handle response payload content type conversions. - Supported values are `CONVERT_TO_BINARY` and `CONVERT_TO_TEXT`, with the - following behaviors: - - If this property is not defined, the response payload will be passed - through from the integration response to the method response without - modification. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_INTEGRATION_RESPONSE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.status_code is not None: - serializer.write_string( - _SCHEMA_GET_INTEGRATION_RESPONSE_OUTPUT.members["statusCode"], - self.status_code, - ) - - if self.selection_pattern is not None: - serializer.write_string( - _SCHEMA_GET_INTEGRATION_RESPONSE_OUTPUT.members["selectionPattern"], - self.selection_pattern, - ) - - if self.response_parameters is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_GET_INTEGRATION_RESPONSE_OUTPUT.members["responseParameters"], - self.response_parameters, - ) - - if self.response_templates is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_GET_INTEGRATION_RESPONSE_OUTPUT.members["responseTemplates"], - self.response_templates, - ) - - if self.content_handling is not None: - serializer.write_string( - _SCHEMA_GET_INTEGRATION_RESPONSE_OUTPUT.members["contentHandling"], - self.content_handling, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["status_code"] = de.read_string( - _SCHEMA_GET_INTEGRATION_RESPONSE_OUTPUT.members["statusCode"] - ) - - case 1: - kwargs["selection_pattern"] = de.read_string( - _SCHEMA_GET_INTEGRATION_RESPONSE_OUTPUT.members[ - "selectionPattern" - ] - ) - - case 2: - kwargs["response_parameters"] = ( - _deserialize_map_of_string_to_string( - de, - _SCHEMA_GET_INTEGRATION_RESPONSE_OUTPUT.members[ - "responseParameters" - ], - ) - ) - - case 3: - kwargs["response_templates"] = _deserialize_map_of_string_to_string( - de, - _SCHEMA_GET_INTEGRATION_RESPONSE_OUTPUT.members[ - "responseTemplates" - ], - ) - - case 4: - kwargs["content_handling"] = ContentHandlingStrategy( - de.read_string( - _SCHEMA_GET_INTEGRATION_RESPONSE_OUTPUT.members[ - "contentHandling" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_INTEGRATION_RESPONSE_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_INTEGRATION_RESPONSE = APIOperation( - input=GetIntegrationResponseInput, - output=GetIntegrationResponseOutput, - schema=_SCHEMA_GET_INTEGRATION_RESPONSE, - input_schema=_SCHEMA_GET_INTEGRATION_RESPONSE_INPUT, - output_schema=_SCHEMA_GET_INTEGRATION_RESPONSE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetMethodInput: - """Request to describe an existing Method resource.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - resource_id: str | None = None - """The Resource identifier for the Method resource.""" - - http_method: str | None = None - """Specifies the method request's HTTP method type.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_METHOD_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_GET_METHOD_INPUT.members["restApiId"], self.rest_api_id - ) - - if self.resource_id is not None: - serializer.write_string( - _SCHEMA_GET_METHOD_INPUT.members["resourceId"], self.resource_id - ) - - if self.http_method is not None: - serializer.write_string( - _SCHEMA_GET_METHOD_INPUT.members["httpMethod"], self.http_method - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_GET_METHOD_INPUT.members["restApiId"] - ) - - case 1: - kwargs["resource_id"] = de.read_string( - _SCHEMA_GET_METHOD_INPUT.members["resourceId"] - ) - - case 2: - kwargs["http_method"] = de.read_string( - _SCHEMA_GET_METHOD_INPUT.members["httpMethod"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_METHOD_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetMethodOutput: - """ - Represents a client-facing interface by which the client calls the API - to access back-end resources. A Method resource is integrated with an - Integration resource. Both consist of a request and one or more - responses. The method request takes the client input that is passed to - the back end through the integration request. A method response returns - the output from the back end to the client through an integration - response. A method request is embodied in a Method resource, whereas an - integration request is embodied in an Integration resource. On the other - hand, a method response is represented by a MethodResponse resource, - whereas an integration response is represented by an IntegrationResponse - resource. - """ - - http_method: str | None = None - """The method's HTTP verb.""" - - authorization_type: str | None = None - """ - The method's authorization type. Valid values are `NONE` for open - access, `AWS_IAM` for using AWS IAM permissions, `CUSTOM` for using a - custom authorizer, or `COGNITO_USER_POOLS` for using a Cognito user - pool. - """ - - authorizer_id: str | None = None - """ - The identifier of an Authorizer to use on this method. The - `authorizationType` must be `CUSTOM`. - """ - - api_key_required: bool | None = None - """ - A boolean flag specifying whether a valid ApiKey is required to invoke - this method. - """ - - request_validator_id: str | None = None - """The identifier of a RequestValidator for request validation.""" - - operation_name: str | None = None - """ - A human-friendly operation identifier for the method. For example, you - can assign the `operationName` of `ListPets` for the `GET /pets` method - in the `PetStore` example. - """ - - request_parameters: dict[str, bool] | None = None - """ - A key-value map defining required or optional method request parameters - that can be accepted by API Gateway. A key is a method request parameter - name matching the pattern of `method.request.{location}.{name}`, where - `location` is `querystring`, `path`, or `header` and `name` is a valid - and unique parameter name. The value associated with the key is a - Boolean flag indicating whether the parameter is required (`true`) or - optional (`false`). The method request parameter names defined here are - available in Integration to be mapped to integration request parameters - or templates. - """ - - request_models: dict[str, str] | None = None - """ - A key-value map specifying data schemas, represented by Model resources, - (as the mapped value) of the request payloads of given content types (as - the mapping key). - """ - - method_responses: dict[str, MethodResponse] | None = None - """Gets a method response associated with a given HTTP status code.""" - - method_integration: Integration | None = None - """ - Gets the method's integration responsible for passing the - client-submitted request to the back end and performing necessary - transformations to make the request compliant with the back end. - """ - - authorization_scopes: list[str] | None = None - """ - A list of authorization scopes configured on the method. The scopes are - used with a `COGNITO_USER_POOLS` authorizer to authorize the method - invocation. The authorization works by matching the method scopes - against the scopes parsed from the access token in the incoming request. - The method invocation is authorized if any method scopes matches a - claimed scope in the access token. Otherwise, the invocation is not - authorized. When the method scope is configured, the client must provide - an access token instead of an identity token for authorization purposes. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_METHOD_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.http_method is not None: - serializer.write_string( - _SCHEMA_GET_METHOD_OUTPUT.members["httpMethod"], self.http_method - ) - - if self.authorization_type is not None: - serializer.write_string( - _SCHEMA_GET_METHOD_OUTPUT.members["authorizationType"], - self.authorization_type, - ) - - if self.authorizer_id is not None: - serializer.write_string( - _SCHEMA_GET_METHOD_OUTPUT.members["authorizerId"], self.authorizer_id - ) - - if self.api_key_required is not None: - serializer.write_boolean( - _SCHEMA_GET_METHOD_OUTPUT.members["apiKeyRequired"], - self.api_key_required, - ) - - if self.request_validator_id is not None: - serializer.write_string( - _SCHEMA_GET_METHOD_OUTPUT.members["requestValidatorId"], - self.request_validator_id, - ) - - if self.operation_name is not None: - serializer.write_string( - _SCHEMA_GET_METHOD_OUTPUT.members["operationName"], self.operation_name - ) - - if self.request_parameters is not None: - _serialize_map_of_string_to_boolean( - serializer, - _SCHEMA_GET_METHOD_OUTPUT.members["requestParameters"], - self.request_parameters, - ) - - if self.request_models is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_GET_METHOD_OUTPUT.members["requestModels"], - self.request_models, - ) - - if self.method_responses is not None: - _serialize_map_of_method_response( - serializer, - _SCHEMA_GET_METHOD_OUTPUT.members["methodResponses"], - self.method_responses, - ) - - if self.method_integration is not None: - serializer.write_struct( - _SCHEMA_GET_METHOD_OUTPUT.members["methodIntegration"], - self.method_integration, - ) - - if self.authorization_scopes is not None: - _serialize_list_of_string( - serializer, - _SCHEMA_GET_METHOD_OUTPUT.members["authorizationScopes"], - self.authorization_scopes, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["http_method"] = de.read_string( - _SCHEMA_GET_METHOD_OUTPUT.members["httpMethod"] - ) - - case 1: - kwargs["authorization_type"] = de.read_string( - _SCHEMA_GET_METHOD_OUTPUT.members["authorizationType"] - ) - - case 2: - kwargs["authorizer_id"] = de.read_string( - _SCHEMA_GET_METHOD_OUTPUT.members["authorizerId"] - ) - - case 3: - kwargs["api_key_required"] = de.read_boolean( - _SCHEMA_GET_METHOD_OUTPUT.members["apiKeyRequired"] - ) - - case 4: - kwargs["request_validator_id"] = de.read_string( - _SCHEMA_GET_METHOD_OUTPUT.members["requestValidatorId"] - ) - - case 5: - kwargs["operation_name"] = de.read_string( - _SCHEMA_GET_METHOD_OUTPUT.members["operationName"] - ) - - case 6: - kwargs["request_parameters"] = ( - _deserialize_map_of_string_to_boolean( - de, _SCHEMA_GET_METHOD_OUTPUT.members["requestParameters"] - ) - ) - - case 7: - kwargs["request_models"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_GET_METHOD_OUTPUT.members["requestModels"] - ) - - case 8: - kwargs["method_responses"] = _deserialize_map_of_method_response( - de, _SCHEMA_GET_METHOD_OUTPUT.members["methodResponses"] - ) - - case 9: - kwargs["method_integration"] = Integration.deserialize(de) - - case 10: - kwargs["authorization_scopes"] = _deserialize_list_of_string( - de, _SCHEMA_GET_METHOD_OUTPUT.members["authorizationScopes"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_METHOD_OUTPUT, consumer=_consumer) - return kwargs - - -GET_METHOD = APIOperation( - input=GetMethodInput, - output=GetMethodOutput, - schema=_SCHEMA_GET_METHOD, - input_schema=_SCHEMA_GET_METHOD_INPUT, - output_schema=_SCHEMA_GET_METHOD_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetMethodResponseInput: - """Request to describe a MethodResponse resource.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - resource_id: str | None = None - """The Resource identifier for the MethodResponse resource.""" - - http_method: str | None = None - """The HTTP verb of the Method resource.""" - - status_code: str | None = None - """The status code for the MethodResponse resource.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_METHOD_RESPONSE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_GET_METHOD_RESPONSE_INPUT.members["restApiId"], self.rest_api_id - ) - - if self.resource_id is not None: - serializer.write_string( - _SCHEMA_GET_METHOD_RESPONSE_INPUT.members["resourceId"], - self.resource_id, - ) - - if self.http_method is not None: - serializer.write_string( - _SCHEMA_GET_METHOD_RESPONSE_INPUT.members["httpMethod"], - self.http_method, - ) - - if self.status_code is not None: - serializer.write_string( - _SCHEMA_GET_METHOD_RESPONSE_INPUT.members["statusCode"], - self.status_code, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_GET_METHOD_RESPONSE_INPUT.members["restApiId"] - ) - - case 1: - kwargs["resource_id"] = de.read_string( - _SCHEMA_GET_METHOD_RESPONSE_INPUT.members["resourceId"] - ) - - case 2: - kwargs["http_method"] = de.read_string( - _SCHEMA_GET_METHOD_RESPONSE_INPUT.members["httpMethod"] - ) - - case 3: - kwargs["status_code"] = de.read_string( - _SCHEMA_GET_METHOD_RESPONSE_INPUT.members["statusCode"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_METHOD_RESPONSE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetMethodResponseOutput: - """ - Represents a method response of a given HTTP status code returned to the - client. The method response is passed from the back end through the - associated integration response that can be transformed using a mapping - template. - """ - - status_code: str | None = None - """The method response's status code.""" - - response_parameters: dict[str, bool] | None = None - """ - A key-value map specifying required or optional response parameters that - API Gateway can send back to the caller. A key defines a method response - header and the value specifies whether the associated method response - header is required or not. The expression of the key must match the - pattern `method.response.header.{name}`, where `name` is a valid and - unique header name. API Gateway passes certain integration response data - to the method response headers specified here according to the mapping - you prescribe in the API's IntegrationResponse. The integration - response data that can be mapped include an integration response header - expressed in `integration.response.header.{name}`, a static value - enclosed within a pair of single quotes (e.g., `'application/json'`), or - a JSON expression from the back-end response payload in the form of - `integration.response.body.{JSON-expression}`, where `JSON-expression` - is a valid JSON expression without the `$` prefix.) - """ - - response_models: dict[str, str] | None = None - """ - Specifies the Model resources used for the response's content-type. - Response models are represented as a key/value map, with a content-type - as the key and a Model name as the value. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_METHOD_RESPONSE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.status_code is not None: - serializer.write_string( - _SCHEMA_GET_METHOD_RESPONSE_OUTPUT.members["statusCode"], - self.status_code, - ) - - if self.response_parameters is not None: - _serialize_map_of_string_to_boolean( - serializer, - _SCHEMA_GET_METHOD_RESPONSE_OUTPUT.members["responseParameters"], - self.response_parameters, - ) - - if self.response_models is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_GET_METHOD_RESPONSE_OUTPUT.members["responseModels"], - self.response_models, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["status_code"] = de.read_string( - _SCHEMA_GET_METHOD_RESPONSE_OUTPUT.members["statusCode"] - ) - - case 1: - kwargs["response_parameters"] = ( - _deserialize_map_of_string_to_boolean( - de, - _SCHEMA_GET_METHOD_RESPONSE_OUTPUT.members[ - "responseParameters" - ], - ) - ) - - case 2: - kwargs["response_models"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_GET_METHOD_RESPONSE_OUTPUT.members["responseModels"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_METHOD_RESPONSE_OUTPUT, consumer=_consumer) - return kwargs - - -GET_METHOD_RESPONSE = APIOperation( - input=GetMethodResponseInput, - output=GetMethodResponseOutput, - schema=_SCHEMA_GET_METHOD_RESPONSE, - input_schema=_SCHEMA_GET_METHOD_RESPONSE_INPUT, - output_schema=_SCHEMA_GET_METHOD_RESPONSE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetModelInput: - """ - Request to list information about a model in an existing RestApi - resource. - """ - - rest_api_id: str | None = None - """The RestApi identifier under which the Model exists.""" - - model_name: str | None = None - """The name of the model as an identifier.""" - - flatten: bool = False - """ - A query parameter of a Boolean value to resolve (`true`) all external - model references and returns a flattened model schema or not (`false`) - The default is `false`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_MODEL_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_GET_MODEL_INPUT.members["restApiId"], self.rest_api_id - ) - - if self.model_name is not None: - serializer.write_string( - _SCHEMA_GET_MODEL_INPUT.members["modelName"], self.model_name - ) - - if self.flatten is not None: - serializer.write_boolean( - _SCHEMA_GET_MODEL_INPUT.members["flatten"], self.flatten - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_GET_MODEL_INPUT.members["restApiId"] - ) - - case 1: - kwargs["model_name"] = de.read_string( - _SCHEMA_GET_MODEL_INPUT.members["modelName"] - ) - - case 2: - kwargs["flatten"] = de.read_boolean( - _SCHEMA_GET_MODEL_INPUT.members["flatten"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_MODEL_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetModelOutput: - """ - Represents the data structure of a method's request or response - payload. - """ - - id: str | None = None - """The identifier for the model resource.""" - - name: str | None = None - """The name of the model. Must be an alphanumeric string.""" - - description: str | None = None - """The description of the model.""" - - schema: str | None = None - """ - The schema for the model. For `application/json` models, this should be - JSON schema draft 4 model. Do not include \"\\*/\" characters in the - description of any properties because such \"\\*/\" characters may be - interpreted as the closing marker for comments in some languages, such - as Java or JavaScript, causing the installation of your API's SDK - generated by API Gateway to fail. - """ - - content_type: str | None = None - """The content-type for the model.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_MODEL_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string(_SCHEMA_GET_MODEL_OUTPUT.members["id"], self.id) - - if self.name is not None: - serializer.write_string(_SCHEMA_GET_MODEL_OUTPUT.members["name"], self.name) - - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_MODEL_OUTPUT.members["description"], self.description - ) - - if self.schema is not None: - serializer.write_string( - _SCHEMA_GET_MODEL_OUTPUT.members["schema"], self.schema - ) - - if self.content_type is not None: - serializer.write_string( - _SCHEMA_GET_MODEL_OUTPUT.members["contentType"], self.content_type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_GET_MODEL_OUTPUT.members["id"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_GET_MODEL_OUTPUT.members["name"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_GET_MODEL_OUTPUT.members["description"] - ) - - case 3: - kwargs["schema"] = de.read_string( - _SCHEMA_GET_MODEL_OUTPUT.members["schema"] - ) - - case 4: - kwargs["content_type"] = de.read_string( - _SCHEMA_GET_MODEL_OUTPUT.members["contentType"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_MODEL_OUTPUT, consumer=_consumer) - return kwargs - - -GET_MODEL = APIOperation( - input=GetModelInput, - output=GetModelOutput, - schema=_SCHEMA_GET_MODEL, - input_schema=_SCHEMA_GET_MODEL_INPUT, - output_schema=_SCHEMA_GET_MODEL_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetModelsInput: - """Request to list existing Models defined for a RestApi resource.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - position: str | None = None - """The current pagination position in the paged result set.""" - - limit: int | None = None - """ - The maximum number of returned results per page. The default value is 25 - and the maximum value is 500. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_MODELS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_GET_MODELS_INPUT.members["restApiId"], self.rest_api_id - ) - - if self.position is not None: - serializer.write_string( - _SCHEMA_GET_MODELS_INPUT.members["position"], self.position - ) - - if self.limit is not None: - serializer.write_integer( - _SCHEMA_GET_MODELS_INPUT.members["limit"], self.limit - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_GET_MODELS_INPUT.members["restApiId"] - ) - - case 1: - kwargs["position"] = de.read_string( - _SCHEMA_GET_MODELS_INPUT.members["position"] - ) - - case 2: - kwargs["limit"] = de.read_integer( - _SCHEMA_GET_MODELS_INPUT.members["limit"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_MODELS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Model: - """ - Represents the data structure of a method's request or response - payload. - """ - - id: str | None = None - """The identifier for the model resource.""" - - name: str | None = None - """The name of the model. Must be an alphanumeric string.""" - - description: str | None = None - """The description of the model.""" - - schema: str | None = None - """ - The schema for the model. For `application/json` models, this should be - JSON schema draft 4 model. Do not include \"\\*/\" characters in the - description of any properties because such \"\\*/\" characters may be - interpreted as the closing marker for comments in some languages, such - as Java or JavaScript, causing the installation of your API's SDK - generated by API Gateway to fail. - """ - - content_type: str | None = None - """The content-type for the model.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MODEL, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string(_SCHEMA_MODEL.members["id"], self.id) - - if self.name is not None: - serializer.write_string(_SCHEMA_MODEL.members["name"], self.name) - - if self.description is not None: - serializer.write_string( - _SCHEMA_MODEL.members["description"], self.description - ) - - if self.schema is not None: - serializer.write_string(_SCHEMA_MODEL.members["schema"], self.schema) - - if self.content_type is not None: - serializer.write_string( - _SCHEMA_MODEL.members["contentType"], self.content_type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string(_SCHEMA_MODEL.members["id"]) - - case 1: - kwargs["name"] = de.read_string(_SCHEMA_MODEL.members["name"]) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_MODEL.members["description"] - ) - - case 3: - kwargs["schema"] = de.read_string(_SCHEMA_MODEL.members["schema"]) - - case 4: - kwargs["content_type"] = de.read_string( - _SCHEMA_MODEL.members["contentType"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MODEL, consumer=_consumer) - return kwargs - - -def _serialize_list_of_model( - serializer: ShapeSerializer, schema: Schema, value: list[Model] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_list_of_model( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Model]: - result: list[Model] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Model.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GetModelsOutput: - """Represents a collection of Model resources.""" - - items: list[Model] | None = None - """The current page of elements from this collection.""" - - position: str | None = None - """The current pagination position in the paged result set.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_MODELS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.items is not None: - _serialize_list_of_model( - serializer, _SCHEMA_GET_MODELS_OUTPUT.members["items"], self.items - ) - - if self.position is not None: - serializer.write_string( - _SCHEMA_GET_MODELS_OUTPUT.members["position"], self.position - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["items"] = _deserialize_list_of_model( - de, _SCHEMA_GET_MODELS_OUTPUT.members["items"] - ) - - case 1: - kwargs["position"] = de.read_string( - _SCHEMA_GET_MODELS_OUTPUT.members["position"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_MODELS_OUTPUT, consumer=_consumer) - return kwargs - - -GET_MODELS = APIOperation( - input=GetModelsInput, - output=GetModelsOutput, - schema=_SCHEMA_GET_MODELS, - input_schema=_SCHEMA_GET_MODELS_INPUT, - output_schema=_SCHEMA_GET_MODELS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetModelTemplateInput: - """ - Request to generate a sample mapping template used to transform the - payload. - """ - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - model_name: str | None = None - """The name of the model for which to generate a template.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_MODEL_TEMPLATE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_GET_MODEL_TEMPLATE_INPUT.members["restApiId"], self.rest_api_id - ) - - if self.model_name is not None: - serializer.write_string( - _SCHEMA_GET_MODEL_TEMPLATE_INPUT.members["modelName"], self.model_name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_GET_MODEL_TEMPLATE_INPUT.members["restApiId"] - ) - - case 1: - kwargs["model_name"] = de.read_string( - _SCHEMA_GET_MODEL_TEMPLATE_INPUT.members["modelName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_MODEL_TEMPLATE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetModelTemplateOutput: - """Represents a mapping template used to transform a payload.""" - - value: str | None = None - """ - The Apache Velocity Template Language (VTL) template content used for - the template resource. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_MODEL_TEMPLATE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.value is not None: - serializer.write_string( - _SCHEMA_GET_MODEL_TEMPLATE_OUTPUT.members["value"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["value"] = de.read_string( - _SCHEMA_GET_MODEL_TEMPLATE_OUTPUT.members["value"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_MODEL_TEMPLATE_OUTPUT, consumer=_consumer) - return kwargs - - -GET_MODEL_TEMPLATE = APIOperation( - input=GetModelTemplateInput, - output=GetModelTemplateOutput, - schema=_SCHEMA_GET_MODEL_TEMPLATE, - input_schema=_SCHEMA_GET_MODEL_TEMPLATE_INPUT, - output_schema=_SCHEMA_GET_MODEL_TEMPLATE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetRequestValidatorInput: - """Gets a RequestValidator of a given RestApi.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - request_validator_id: str | None = None - """The identifier of the RequestValidator to be retrieved.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_REQUEST_VALIDATOR_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_GET_REQUEST_VALIDATOR_INPUT.members["restApiId"], - self.rest_api_id, - ) - - if self.request_validator_id is not None: - serializer.write_string( - _SCHEMA_GET_REQUEST_VALIDATOR_INPUT.members["requestValidatorId"], - self.request_validator_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_GET_REQUEST_VALIDATOR_INPUT.members["restApiId"] - ) - - case 1: - kwargs["request_validator_id"] = de.read_string( - _SCHEMA_GET_REQUEST_VALIDATOR_INPUT.members[ - "requestValidatorId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_REQUEST_VALIDATOR_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetRequestValidatorOutput: - """A set of validation rules for incoming Method requests.""" - - id: str | None = None - """The identifier of this RequestValidator.""" - - name: str | None = None - """The name of this RequestValidator""" - - validate_request_body: bool = False - """ - A Boolean flag to indicate whether to validate a request body according - to the configured Model schema. - """ - - validate_request_parameters: bool = False - """ - A Boolean flag to indicate whether to validate request parameters - (`true`) or not (`false`). - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_REQUEST_VALIDATOR_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string( - _SCHEMA_GET_REQUEST_VALIDATOR_OUTPUT.members["id"], self.id - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_GET_REQUEST_VALIDATOR_OUTPUT.members["name"], self.name - ) - - serializer.write_boolean( - _SCHEMA_GET_REQUEST_VALIDATOR_OUTPUT.members["validateRequestBody"], - self.validate_request_body, - ) - serializer.write_boolean( - _SCHEMA_GET_REQUEST_VALIDATOR_OUTPUT.members["validateRequestParameters"], - self.validate_request_parameters, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_GET_REQUEST_VALIDATOR_OUTPUT.members["id"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_GET_REQUEST_VALIDATOR_OUTPUT.members["name"] - ) - - case 2: - kwargs["validate_request_body"] = de.read_boolean( - _SCHEMA_GET_REQUEST_VALIDATOR_OUTPUT.members[ - "validateRequestBody" - ] - ) - - case 3: - kwargs["validate_request_parameters"] = de.read_boolean( - _SCHEMA_GET_REQUEST_VALIDATOR_OUTPUT.members[ - "validateRequestParameters" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_REQUEST_VALIDATOR_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_REQUEST_VALIDATOR = APIOperation( - input=GetRequestValidatorInput, - output=GetRequestValidatorOutput, - schema=_SCHEMA_GET_REQUEST_VALIDATOR, - input_schema=_SCHEMA_GET_REQUEST_VALIDATOR_INPUT, - output_schema=_SCHEMA_GET_REQUEST_VALIDATOR_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetRequestValidatorsInput: - """Gets the RequestValidators collection of a given RestApi.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - position: str | None = None - """The current pagination position in the paged result set.""" - - limit: int | None = None - """ - The maximum number of returned results per page. The default value is 25 - and the maximum value is 500. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_REQUEST_VALIDATORS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_GET_REQUEST_VALIDATORS_INPUT.members["restApiId"], - self.rest_api_id, - ) - - if self.position is not None: - serializer.write_string( - _SCHEMA_GET_REQUEST_VALIDATORS_INPUT.members["position"], self.position - ) - - if self.limit is not None: - serializer.write_integer( - _SCHEMA_GET_REQUEST_VALIDATORS_INPUT.members["limit"], self.limit - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_GET_REQUEST_VALIDATORS_INPUT.members["restApiId"] - ) - - case 1: - kwargs["position"] = de.read_string( - _SCHEMA_GET_REQUEST_VALIDATORS_INPUT.members["position"] - ) - - case 2: - kwargs["limit"] = de.read_integer( - _SCHEMA_GET_REQUEST_VALIDATORS_INPUT.members["limit"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_REQUEST_VALIDATORS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class RequestValidator: - """A set of validation rules for incoming Method requests.""" - - id: str | None = None - """The identifier of this RequestValidator.""" - - name: str | None = None - """The name of this RequestValidator""" - - validate_request_body: bool = False - """ - A Boolean flag to indicate whether to validate a request body according - to the configured Model schema. - """ - - validate_request_parameters: bool = False - """ - A Boolean flag to indicate whether to validate request parameters - (`true`) or not (`false`). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REQUEST_VALIDATOR, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string(_SCHEMA_REQUEST_VALIDATOR.members["id"], self.id) - - if self.name is not None: - serializer.write_string( - _SCHEMA_REQUEST_VALIDATOR.members["name"], self.name - ) - - serializer.write_boolean( - _SCHEMA_REQUEST_VALIDATOR.members["validateRequestBody"], - self.validate_request_body, - ) - serializer.write_boolean( - _SCHEMA_REQUEST_VALIDATOR.members["validateRequestParameters"], - self.validate_request_parameters, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_REQUEST_VALIDATOR.members["id"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_REQUEST_VALIDATOR.members["name"] - ) - - case 2: - kwargs["validate_request_body"] = de.read_boolean( - _SCHEMA_REQUEST_VALIDATOR.members["validateRequestBody"] - ) - - case 3: - kwargs["validate_request_parameters"] = de.read_boolean( - _SCHEMA_REQUEST_VALIDATOR.members["validateRequestParameters"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_REQUEST_VALIDATOR, consumer=_consumer) - return kwargs - - -def _serialize_list_of_request_validator( - serializer: ShapeSerializer, schema: Schema, value: list[RequestValidator] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_list_of_request_validator( - deserializer: ShapeDeserializer, schema: Schema -) -> list[RequestValidator]: - result: list[RequestValidator] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(RequestValidator.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GetRequestValidatorsOutput: - """A collection of RequestValidator resources of a given RestApi.""" - - items: list[RequestValidator] | None = None - """The current page of elements from this collection.""" - - position: str | None = None - """The current pagination position in the paged result set.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_REQUEST_VALIDATORS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.items is not None: - _serialize_list_of_request_validator( - serializer, - _SCHEMA_GET_REQUEST_VALIDATORS_OUTPUT.members["items"], - self.items, - ) - - if self.position is not None: - serializer.write_string( - _SCHEMA_GET_REQUEST_VALIDATORS_OUTPUT.members["position"], self.position - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["items"] = _deserialize_list_of_request_validator( - de, _SCHEMA_GET_REQUEST_VALIDATORS_OUTPUT.members["items"] - ) - - case 1: - kwargs["position"] = de.read_string( - _SCHEMA_GET_REQUEST_VALIDATORS_OUTPUT.members["position"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_REQUEST_VALIDATORS_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_REQUEST_VALIDATORS = APIOperation( - input=GetRequestValidatorsInput, - output=GetRequestValidatorsOutput, - schema=_SCHEMA_GET_REQUEST_VALIDATORS, - input_schema=_SCHEMA_GET_REQUEST_VALIDATORS_INPUT, - output_schema=_SCHEMA_GET_REQUEST_VALIDATORS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetResourceInput: - """Request to list information about a resource.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - resource_id: str | None = None - """The identifier for the Resource resource.""" - - embed: list[str] | None = None - """ - A query parameter to retrieve the specified resources embedded in the - returned Resource representation in the response. This `embed` parameter - value is a list of comma-separated strings. Currently, the request - supports only retrieval of the embedded Method resources this way. The - query parameter value must be a single-valued list and contain the - `"methods"` string. For example, - `GET /restapis/{restapi_id}/resources/{resource_id}?embed=methods`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_RESOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_GET_RESOURCE_INPUT.members["restApiId"], self.rest_api_id - ) - - if self.resource_id is not None: - serializer.write_string( - _SCHEMA_GET_RESOURCE_INPUT.members["resourceId"], self.resource_id - ) - - if self.embed is not None: - _serialize_list_of_string( - serializer, _SCHEMA_GET_RESOURCE_INPUT.members["embed"], self.embed - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_GET_RESOURCE_INPUT.members["restApiId"] - ) - - case 1: - kwargs["resource_id"] = de.read_string( - _SCHEMA_GET_RESOURCE_INPUT.members["resourceId"] - ) - - case 2: - kwargs["embed"] = _deserialize_list_of_string( - de, _SCHEMA_GET_RESOURCE_INPUT.members["embed"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_RESOURCE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetResourceOutput: - """Represents an API resource.""" - - id: str | None = None - """The resource's identifier.""" - - parent_id: str | None = None - """The parent resource's identifier.""" - - path_part: str | None = None - """The last path segment for this resource.""" - - path: str | None = None - """The full path for this resource.""" - - resource_methods: dict[str, Method] | None = None - """Gets an API resource's method of a given HTTP verb.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_RESOURCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string(_SCHEMA_GET_RESOURCE_OUTPUT.members["id"], self.id) - - if self.parent_id is not None: - serializer.write_string( - _SCHEMA_GET_RESOURCE_OUTPUT.members["parentId"], self.parent_id - ) - - if self.path_part is not None: - serializer.write_string( - _SCHEMA_GET_RESOURCE_OUTPUT.members["pathPart"], self.path_part - ) - - if self.path is not None: - serializer.write_string( - _SCHEMA_GET_RESOURCE_OUTPUT.members["path"], self.path - ) - - if self.resource_methods is not None: - _serialize_map_of_method( - serializer, - _SCHEMA_GET_RESOURCE_OUTPUT.members["resourceMethods"], - self.resource_methods, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_GET_RESOURCE_OUTPUT.members["id"] - ) - - case 1: - kwargs["parent_id"] = de.read_string( - _SCHEMA_GET_RESOURCE_OUTPUT.members["parentId"] - ) - - case 2: - kwargs["path_part"] = de.read_string( - _SCHEMA_GET_RESOURCE_OUTPUT.members["pathPart"] - ) - - case 3: - kwargs["path"] = de.read_string( - _SCHEMA_GET_RESOURCE_OUTPUT.members["path"] - ) - - case 4: - kwargs["resource_methods"] = _deserialize_map_of_method( - de, _SCHEMA_GET_RESOURCE_OUTPUT.members["resourceMethods"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_RESOURCE_OUTPUT, consumer=_consumer) - return kwargs - - -GET_RESOURCE = APIOperation( - input=GetResourceInput, - output=GetResourceOutput, - schema=_SCHEMA_GET_RESOURCE, - input_schema=_SCHEMA_GET_RESOURCE_INPUT, - output_schema=_SCHEMA_GET_RESOURCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetResourcesInput: - """Request to list information about a collection of resources.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - position: str | None = None - """The current pagination position in the paged result set.""" - - limit: int | None = None - """ - The maximum number of returned results per page. The default value is 25 - and the maximum value is 500. - """ - - embed: list[str] | None = None - """ - A query parameter used to retrieve the specified resources embedded in - the returned Resources resource in the response. This `embed` parameter - value is a list of comma-separated strings. Currently, the request - supports only retrieval of the embedded Method resources this way. The - query parameter value must be a single-valued list and contain the - `"methods"` string. For example, - `GET /restapis/{restapi_id}/resources?embed=methods`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_RESOURCES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_GET_RESOURCES_INPUT.members["restApiId"], self.rest_api_id - ) - - if self.position is not None: - serializer.write_string( - _SCHEMA_GET_RESOURCES_INPUT.members["position"], self.position - ) - - if self.limit is not None: - serializer.write_integer( - _SCHEMA_GET_RESOURCES_INPUT.members["limit"], self.limit - ) - - if self.embed is not None: - _serialize_list_of_string( - serializer, _SCHEMA_GET_RESOURCES_INPUT.members["embed"], self.embed - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_GET_RESOURCES_INPUT.members["restApiId"] - ) - - case 1: - kwargs["position"] = de.read_string( - _SCHEMA_GET_RESOURCES_INPUT.members["position"] - ) - - case 2: - kwargs["limit"] = de.read_integer( - _SCHEMA_GET_RESOURCES_INPUT.members["limit"] - ) - - case 3: - kwargs["embed"] = _deserialize_list_of_string( - de, _SCHEMA_GET_RESOURCES_INPUT.members["embed"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_RESOURCES_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Resource: - """Represents an API resource.""" - - id: str | None = None - """The resource's identifier.""" - - parent_id: str | None = None - """The parent resource's identifier.""" - - path_part: str | None = None - """The last path segment for this resource.""" - - path: str | None = None - """The full path for this resource.""" - - resource_methods: dict[str, Method] | None = None - """Gets an API resource's method of a given HTTP verb.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string(_SCHEMA_RESOURCE.members["id"], self.id) - - if self.parent_id is not None: - serializer.write_string( - _SCHEMA_RESOURCE.members["parentId"], self.parent_id - ) - - if self.path_part is not None: - serializer.write_string( - _SCHEMA_RESOURCE.members["pathPart"], self.path_part - ) - - if self.path is not None: - serializer.write_string(_SCHEMA_RESOURCE.members["path"], self.path) - - if self.resource_methods is not None: - _serialize_map_of_method( - serializer, - _SCHEMA_RESOURCE.members["resourceMethods"], - self.resource_methods, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string(_SCHEMA_RESOURCE.members["id"]) - - case 1: - kwargs["parent_id"] = de.read_string( - _SCHEMA_RESOURCE.members["parentId"] - ) - - case 2: - kwargs["path_part"] = de.read_string( - _SCHEMA_RESOURCE.members["pathPart"] - ) - - case 3: - kwargs["path"] = de.read_string(_SCHEMA_RESOURCE.members["path"]) - - case 4: - kwargs["resource_methods"] = _deserialize_map_of_method( - de, _SCHEMA_RESOURCE.members["resourceMethods"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RESOURCE, consumer=_consumer) - return kwargs - - -def _serialize_list_of_resource( - serializer: ShapeSerializer, schema: Schema, value: list[Resource] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_list_of_resource( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Resource]: - result: list[Resource] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Resource.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GetResourcesOutput: - """Represents a collection of Resource resources.""" - - items: list[Resource] | None = None - """The current page of elements from this collection.""" - - position: str | None = None - """The current pagination position in the paged result set.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_RESOURCES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.items is not None: - _serialize_list_of_resource( - serializer, _SCHEMA_GET_RESOURCES_OUTPUT.members["items"], self.items - ) - - if self.position is not None: - serializer.write_string( - _SCHEMA_GET_RESOURCES_OUTPUT.members["position"], self.position - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["items"] = _deserialize_list_of_resource( - de, _SCHEMA_GET_RESOURCES_OUTPUT.members["items"] - ) - - case 1: - kwargs["position"] = de.read_string( - _SCHEMA_GET_RESOURCES_OUTPUT.members["position"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_RESOURCES_OUTPUT, consumer=_consumer) - return kwargs - - -GET_RESOURCES = APIOperation( - input=GetResourcesInput, - output=GetResourcesOutput, - schema=_SCHEMA_GET_RESOURCES, - input_schema=_SCHEMA_GET_RESOURCES_INPUT, - output_schema=_SCHEMA_GET_RESOURCES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetRestApiInput: - """The GET request to list an existing RestApi defined for your collection.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_REST_API_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_GET_REST_API_INPUT.members["restApiId"], self.rest_api_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_GET_REST_API_INPUT.members["restApiId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_REST_API_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetRestApiOutput: - """Represents a REST API.""" - - id: str | None = None - """ - The API's identifier. This identifier is unique across all of your APIs - in API Gateway. - """ - - name: str | None = None - """The API's name.""" - - description: str | None = None - """The API's description.""" - - created_date: datetime | None = None - """The timestamp when the API was created.""" - - version: str | None = None - """A version identifier for the API.""" - - warnings: list[str] | None = None - """ - The warning messages reported when `failonwarnings` is turned on during - API import. - """ - - binary_media_types: list[str] | None = None - """ - The list of binary media types supported by the RestApi. By default, the - RestApi supports only UTF-8-encoded text payloads. - """ - - minimum_compression_size: int | None = None - """ - A nullable integer that is used to enable compression (with non-negative - between 0 and 10485760 (10M) bytes, inclusive) or disable compression - (with a null value) on an API. When compression is enabled, compression - or decompression is not applied on the payload if the payload size is - smaller than this value. Setting it to zero allows compression for any - payload size. - """ - - api_key_source: str | None = None - """ - The source of the API key for metering requests according to a usage - plan. Valid values are: >`HEADER` to read the API key from the - `X-API-Key` header of a request. `AUTHORIZER` to read the API key from - the `UsageIdentifierKey` from a custom authorizer. - """ - - endpoint_configuration: EndpointConfiguration | None = None - """ - The endpoint configuration of this RestApi showing the endpoint types - and IP address types of the API. - """ - - policy: str | None = None - """ - A stringified JSON policy document that applies to this RestApi - regardless of the caller and Method configuration. - """ - - tags: dict[str, str] | None = None - """ - The collection of tags. Each tag element is associated with a given - resource. - """ - - disable_execute_api_endpoint: bool = False - """ - Specifies whether clients can invoke your API by using the default - `execute-api` endpoint. By default, clients can invoke your API with the - default `https://{api_id}.execute-api.{region}.amazonaws.com` endpoint. - To require that clients use a custom domain name to invoke your API, - disable the default endpoint. - """ - - root_resource_id: str | None = None - """The API's root resource ID.""" - - security_policy: str | None = None - """ - The Transport Layer Security (TLS) version + cipher suite for this - RestApi. - """ - - endpoint_access_mode: str | None = None - """The endpoint access mode of the RestApi.""" - - api_status: str | None = None - """The ApiStatus of the RestApi.""" - - api_status_message: str | None = None - """ - The status message of the RestApi. When the status message is `UPDATING` - you can still invoke it. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_REST_API_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string(_SCHEMA_GET_REST_API_OUTPUT.members["id"], self.id) - - if self.name is not None: - serializer.write_string( - _SCHEMA_GET_REST_API_OUTPUT.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_REST_API_OUTPUT.members["description"], self.description - ) - - if self.created_date is not None: - serializer.write_timestamp( - _SCHEMA_GET_REST_API_OUTPUT.members["createdDate"], self.created_date - ) - - if self.version is not None: - serializer.write_string( - _SCHEMA_GET_REST_API_OUTPUT.members["version"], self.version - ) - - if self.warnings is not None: - _serialize_list_of_string( - serializer, - _SCHEMA_GET_REST_API_OUTPUT.members["warnings"], - self.warnings, - ) - - if self.binary_media_types is not None: - _serialize_list_of_string( - serializer, - _SCHEMA_GET_REST_API_OUTPUT.members["binaryMediaTypes"], - self.binary_media_types, - ) - - if self.minimum_compression_size is not None: - serializer.write_integer( - _SCHEMA_GET_REST_API_OUTPUT.members["minimumCompressionSize"], - self.minimum_compression_size, - ) - - if self.api_key_source is not None: - serializer.write_string( - _SCHEMA_GET_REST_API_OUTPUT.members["apiKeySource"], self.api_key_source - ) - - if self.endpoint_configuration is not None: - serializer.write_struct( - _SCHEMA_GET_REST_API_OUTPUT.members["endpointConfiguration"], - self.endpoint_configuration, - ) - - if self.policy is not None: - serializer.write_string( - _SCHEMA_GET_REST_API_OUTPUT.members["policy"], self.policy - ) - - if self.tags is not None: - _serialize_map_of_string_to_string( - serializer, _SCHEMA_GET_REST_API_OUTPUT.members["tags"], self.tags - ) - - serializer.write_boolean( - _SCHEMA_GET_REST_API_OUTPUT.members["disableExecuteApiEndpoint"], - self.disable_execute_api_endpoint, - ) - if self.root_resource_id is not None: - serializer.write_string( - _SCHEMA_GET_REST_API_OUTPUT.members["rootResourceId"], - self.root_resource_id, - ) - - if self.security_policy is not None: - serializer.write_string( - _SCHEMA_GET_REST_API_OUTPUT.members["securityPolicy"], - self.security_policy, - ) - - if self.endpoint_access_mode is not None: - serializer.write_string( - _SCHEMA_GET_REST_API_OUTPUT.members["endpointAccessMode"], - self.endpoint_access_mode, - ) - - if self.api_status is not None: - serializer.write_string( - _SCHEMA_GET_REST_API_OUTPUT.members["apiStatus"], self.api_status - ) - - if self.api_status_message is not None: - serializer.write_string( - _SCHEMA_GET_REST_API_OUTPUT.members["apiStatusMessage"], - self.api_status_message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_GET_REST_API_OUTPUT.members["id"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_GET_REST_API_OUTPUT.members["name"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_GET_REST_API_OUTPUT.members["description"] - ) - - case 3: - kwargs["created_date"] = de.read_timestamp( - _SCHEMA_GET_REST_API_OUTPUT.members["createdDate"] - ) - - case 4: - kwargs["version"] = de.read_string( - _SCHEMA_GET_REST_API_OUTPUT.members["version"] - ) - - case 5: - kwargs["warnings"] = _deserialize_list_of_string( - de, _SCHEMA_GET_REST_API_OUTPUT.members["warnings"] - ) - - case 6: - kwargs["binary_media_types"] = _deserialize_list_of_string( - de, _SCHEMA_GET_REST_API_OUTPUT.members["binaryMediaTypes"] - ) - - case 7: - kwargs["minimum_compression_size"] = de.read_integer( - _SCHEMA_GET_REST_API_OUTPUT.members["minimumCompressionSize"] - ) - - case 8: - kwargs["api_key_source"] = ApiKeySourceType( - de.read_string( - _SCHEMA_GET_REST_API_OUTPUT.members["apiKeySource"] - ) - ) - - case 9: - kwargs["endpoint_configuration"] = ( - EndpointConfiguration.deserialize(de) - ) - - case 10: - kwargs["policy"] = de.read_string( - _SCHEMA_GET_REST_API_OUTPUT.members["policy"] - ) - - case 11: - kwargs["tags"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_GET_REST_API_OUTPUT.members["tags"] - ) - - case 12: - kwargs["disable_execute_api_endpoint"] = de.read_boolean( - _SCHEMA_GET_REST_API_OUTPUT.members["disableExecuteApiEndpoint"] - ) - - case 13: - kwargs["root_resource_id"] = de.read_string( - _SCHEMA_GET_REST_API_OUTPUT.members["rootResourceId"] - ) - - case 14: - kwargs["security_policy"] = SecurityPolicy( - de.read_string( - _SCHEMA_GET_REST_API_OUTPUT.members["securityPolicy"] - ) - ) - - case 15: - kwargs["endpoint_access_mode"] = EndpointAccessMode( - de.read_string( - _SCHEMA_GET_REST_API_OUTPUT.members["endpointAccessMode"] - ) - ) - - case 16: - kwargs["api_status"] = ApiStatus( - de.read_string(_SCHEMA_GET_REST_API_OUTPUT.members["apiStatus"]) - ) - - case 17: - kwargs["api_status_message"] = de.read_string( - _SCHEMA_GET_REST_API_OUTPUT.members["apiStatusMessage"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_REST_API_OUTPUT, consumer=_consumer) - return kwargs - - -GET_REST_API = APIOperation( - input=GetRestApiInput, - output=GetRestApiOutput, - schema=_SCHEMA_GET_REST_API, - input_schema=_SCHEMA_GET_REST_API_INPUT, - output_schema=_SCHEMA_GET_REST_API_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetRestApisInput: - """The GET request to list existing RestApis defined for your collection.""" - - position: str | None = None - """The current pagination position in the paged result set.""" - - limit: int | None = None - """ - The maximum number of returned results per page. The default value is 25 - and the maximum value is 500. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_REST_APIS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.position is not None: - serializer.write_string( - _SCHEMA_GET_REST_APIS_INPUT.members["position"], self.position - ) - - if self.limit is not None: - serializer.write_integer( - _SCHEMA_GET_REST_APIS_INPUT.members["limit"], self.limit - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["position"] = de.read_string( - _SCHEMA_GET_REST_APIS_INPUT.members["position"] - ) - - case 1: - kwargs["limit"] = de.read_integer( - _SCHEMA_GET_REST_APIS_INPUT.members["limit"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_REST_APIS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class RestApi: - """Represents a REST API.""" - - id: str | None = None - """ - The API's identifier. This identifier is unique across all of your APIs - in API Gateway. - """ - - name: str | None = None - """The API's name.""" - - description: str | None = None - """The API's description.""" - - created_date: datetime | None = None - """The timestamp when the API was created.""" - - version: str | None = None - """A version identifier for the API.""" - - warnings: list[str] | None = None - """ - The warning messages reported when `failonwarnings` is turned on during - API import. - """ - - binary_media_types: list[str] | None = None - """ - The list of binary media types supported by the RestApi. By default, the - RestApi supports only UTF-8-encoded text payloads. - """ - - minimum_compression_size: int | None = None - """ - A nullable integer that is used to enable compression (with non-negative - between 0 and 10485760 (10M) bytes, inclusive) or disable compression - (with a null value) on an API. When compression is enabled, compression - or decompression is not applied on the payload if the payload size is - smaller than this value. Setting it to zero allows compression for any - payload size. - """ - - api_key_source: str | None = None - """ - The source of the API key for metering requests according to a usage - plan. Valid values are: >`HEADER` to read the API key from the - `X-API-Key` header of a request. `AUTHORIZER` to read the API key from - the `UsageIdentifierKey` from a custom authorizer. - """ - - endpoint_configuration: EndpointConfiguration | None = None - """ - The endpoint configuration of this RestApi showing the endpoint types - and IP address types of the API. - """ - - policy: str | None = None - """ - A stringified JSON policy document that applies to this RestApi - regardless of the caller and Method configuration. - """ - - tags: dict[str, str] | None = None - """ - The collection of tags. Each tag element is associated with a given - resource. - """ - - disable_execute_api_endpoint: bool = False - """ - Specifies whether clients can invoke your API by using the default - `execute-api` endpoint. By default, clients can invoke your API with the - default `https://{api_id}.execute-api.{region}.amazonaws.com` endpoint. - To require that clients use a custom domain name to invoke your API, - disable the default endpoint. - """ - - root_resource_id: str | None = None - """The API's root resource ID.""" - - security_policy: str | None = None - """ - The Transport Layer Security (TLS) version + cipher suite for this - RestApi. - """ - - endpoint_access_mode: str | None = None - """The endpoint access mode of the RestApi.""" - - api_status: str | None = None - """The ApiStatus of the RestApi.""" - - api_status_message: str | None = None - """ - The status message of the RestApi. When the status message is `UPDATING` - you can still invoke it. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REST_API, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string(_SCHEMA_REST_API.members["id"], self.id) - - if self.name is not None: - serializer.write_string(_SCHEMA_REST_API.members["name"], self.name) - - if self.description is not None: - serializer.write_string( - _SCHEMA_REST_API.members["description"], self.description - ) - - if self.created_date is not None: - serializer.write_timestamp( - _SCHEMA_REST_API.members["createdDate"], self.created_date - ) - - if self.version is not None: - serializer.write_string(_SCHEMA_REST_API.members["version"], self.version) - - if self.warnings is not None: - _serialize_list_of_string( - serializer, _SCHEMA_REST_API.members["warnings"], self.warnings - ) - - if self.binary_media_types is not None: - _serialize_list_of_string( - serializer, - _SCHEMA_REST_API.members["binaryMediaTypes"], - self.binary_media_types, - ) - - if self.minimum_compression_size is not None: - serializer.write_integer( - _SCHEMA_REST_API.members["minimumCompressionSize"], - self.minimum_compression_size, - ) - - if self.api_key_source is not None: - serializer.write_string( - _SCHEMA_REST_API.members["apiKeySource"], self.api_key_source - ) - - if self.endpoint_configuration is not None: - serializer.write_struct( - _SCHEMA_REST_API.members["endpointConfiguration"], - self.endpoint_configuration, - ) - - if self.policy is not None: - serializer.write_string(_SCHEMA_REST_API.members["policy"], self.policy) - - if self.tags is not None: - _serialize_map_of_string_to_string( - serializer, _SCHEMA_REST_API.members["tags"], self.tags - ) - - serializer.write_boolean( - _SCHEMA_REST_API.members["disableExecuteApiEndpoint"], - self.disable_execute_api_endpoint, - ) - if self.root_resource_id is not None: - serializer.write_string( - _SCHEMA_REST_API.members["rootResourceId"], self.root_resource_id - ) - - if self.security_policy is not None: - serializer.write_string( - _SCHEMA_REST_API.members["securityPolicy"], self.security_policy - ) - - if self.endpoint_access_mode is not None: - serializer.write_string( - _SCHEMA_REST_API.members["endpointAccessMode"], - self.endpoint_access_mode, - ) - - if self.api_status is not None: - serializer.write_string( - _SCHEMA_REST_API.members["apiStatus"], self.api_status - ) - - if self.api_status_message is not None: - serializer.write_string( - _SCHEMA_REST_API.members["apiStatusMessage"], self.api_status_message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string(_SCHEMA_REST_API.members["id"]) - - case 1: - kwargs["name"] = de.read_string(_SCHEMA_REST_API.members["name"]) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_REST_API.members["description"] - ) - - case 3: - kwargs["created_date"] = de.read_timestamp( - _SCHEMA_REST_API.members["createdDate"] - ) - - case 4: - kwargs["version"] = de.read_string( - _SCHEMA_REST_API.members["version"] - ) - - case 5: - kwargs["warnings"] = _deserialize_list_of_string( - de, _SCHEMA_REST_API.members["warnings"] - ) - - case 6: - kwargs["binary_media_types"] = _deserialize_list_of_string( - de, _SCHEMA_REST_API.members["binaryMediaTypes"] - ) - - case 7: - kwargs["minimum_compression_size"] = de.read_integer( - _SCHEMA_REST_API.members["minimumCompressionSize"] - ) - - case 8: - kwargs["api_key_source"] = ApiKeySourceType( - de.read_string(_SCHEMA_REST_API.members["apiKeySource"]) - ) - - case 9: - kwargs["endpoint_configuration"] = ( - EndpointConfiguration.deserialize(de) - ) - - case 10: - kwargs["policy"] = de.read_string( - _SCHEMA_REST_API.members["policy"] - ) - - case 11: - kwargs["tags"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_REST_API.members["tags"] - ) - - case 12: - kwargs["disable_execute_api_endpoint"] = de.read_boolean( - _SCHEMA_REST_API.members["disableExecuteApiEndpoint"] - ) - - case 13: - kwargs["root_resource_id"] = de.read_string( - _SCHEMA_REST_API.members["rootResourceId"] - ) - - case 14: - kwargs["security_policy"] = SecurityPolicy( - de.read_string(_SCHEMA_REST_API.members["securityPolicy"]) - ) - - case 15: - kwargs["endpoint_access_mode"] = EndpointAccessMode( - de.read_string(_SCHEMA_REST_API.members["endpointAccessMode"]) - ) - - case 16: - kwargs["api_status"] = ApiStatus( - de.read_string(_SCHEMA_REST_API.members["apiStatus"]) - ) - - case 17: - kwargs["api_status_message"] = de.read_string( - _SCHEMA_REST_API.members["apiStatusMessage"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_REST_API, consumer=_consumer) - return kwargs - - -def _serialize_list_of_rest_api( - serializer: ShapeSerializer, schema: Schema, value: list[RestApi] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_list_of_rest_api( - deserializer: ShapeDeserializer, schema: Schema -) -> list[RestApi]: - result: list[RestApi] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(RestApi.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GetRestApisOutput: - """ - Contains references to your APIs and links that guide you in how to - interact with your collection. A collection offers a paginated view of - your APIs. - """ - - items: list[RestApi] | None = None - """The current page of elements from this collection.""" - - position: str | None = None - """The current pagination position in the paged result set.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_REST_APIS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.items is not None: - _serialize_list_of_rest_api( - serializer, _SCHEMA_GET_REST_APIS_OUTPUT.members["items"], self.items - ) - - if self.position is not None: - serializer.write_string( - _SCHEMA_GET_REST_APIS_OUTPUT.members["position"], self.position - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["items"] = _deserialize_list_of_rest_api( - de, _SCHEMA_GET_REST_APIS_OUTPUT.members["items"] - ) - - case 1: - kwargs["position"] = de.read_string( - _SCHEMA_GET_REST_APIS_OUTPUT.members["position"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_REST_APIS_OUTPUT, consumer=_consumer) - return kwargs - - -GET_REST_APIS = APIOperation( - input=GetRestApisInput, - output=GetRestApisOutput, - schema=_SCHEMA_GET_REST_APIS, - input_schema=_SCHEMA_GET_REST_APIS_INPUT, - output_schema=_SCHEMA_GET_REST_APIS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetSdkInput: - """Request a new generated client SDK for a RestApi and Stage.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - stage_name: str | None = None - """The name of the Stage that the SDK will use.""" - - sdk_type: str | None = None - """ - The language for the generated SDK. Currently `java`, `javascript`, - `android`, `objectivec` (for iOS), `swift` (for iOS), and `ruby` are - supported. - """ - - parameters: dict[str, str] | None = None - """ - A string-to-string key-value map of query parameters `sdkType`-dependent - properties of the SDK. For `sdkType` of `objectivec` or `swift`, a - parameter named `classPrefix` is required. For `sdkType` of `android`, - parameters named `groupId`, `artifactId`, `artifactVersion`, and - `invokerPackage` are required. For `sdkType` of `java`, parameters named - `serviceName` and `javaPackageName` are required. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_SDK_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_GET_SDK_INPUT.members["restApiId"], self.rest_api_id - ) - - if self.stage_name is not None: - serializer.write_string( - _SCHEMA_GET_SDK_INPUT.members["stageName"], self.stage_name - ) - - if self.sdk_type is not None: - serializer.write_string( - _SCHEMA_GET_SDK_INPUT.members["sdkType"], self.sdk_type - ) - - if self.parameters is not None: - _serialize_map_of_string_to_string( - serializer, _SCHEMA_GET_SDK_INPUT.members["parameters"], self.parameters - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_GET_SDK_INPUT.members["restApiId"] - ) - - case 1: - kwargs["stage_name"] = de.read_string( - _SCHEMA_GET_SDK_INPUT.members["stageName"] - ) - - case 2: - kwargs["sdk_type"] = de.read_string( - _SCHEMA_GET_SDK_INPUT.members["sdkType"] - ) - - case 3: - kwargs["parameters"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_GET_SDK_INPUT.members["parameters"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_SDK_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetSdkOutput: - """The binary blob response to GetSdk, which contains the generated SDK.""" - - content_type: str | None = None - """The content-type header value in the HTTP response.""" - - content_disposition: str | None = None - """The content-disposition header value in the HTTP response.""" - - body: bytes | None = None - """The binary blob response to GetSdk, which contains the generated SDK.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_SDK_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.content_type is not None: - serializer.write_string( - _SCHEMA_GET_SDK_OUTPUT.members["contentType"], self.content_type - ) - - if self.content_disposition is not None: - serializer.write_string( - _SCHEMA_GET_SDK_OUTPUT.members["contentDisposition"], - self.content_disposition, - ) - - if self.body is not None: - serializer.write_blob(_SCHEMA_GET_SDK_OUTPUT.members["body"], self.body) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["content_type"] = de.read_string( - _SCHEMA_GET_SDK_OUTPUT.members["contentType"] - ) - - case 1: - kwargs["content_disposition"] = de.read_string( - _SCHEMA_GET_SDK_OUTPUT.members["contentDisposition"] - ) - - case 2: - kwargs["body"] = de.read_blob( - _SCHEMA_GET_SDK_OUTPUT.members["body"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_SDK_OUTPUT, consumer=_consumer) - return kwargs - - -GET_SDK = APIOperation( - input=GetSdkInput, - output=GetSdkOutput, - schema=_SCHEMA_GET_SDK, - input_schema=_SCHEMA_GET_SDK_INPUT, - output_schema=_SCHEMA_GET_SDK_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetSdkTypeInput: - """Get an SdkType instance.""" - - id: str | None = None - """The identifier of the queried SdkType instance.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_SDK_TYPE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string(_SCHEMA_GET_SDK_TYPE_INPUT.members["id"], self.id) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_GET_SDK_TYPE_INPUT.members["id"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_SDK_TYPE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class SdkConfigurationProperty: - """A configuration property of an SDK type.""" - - name: str | None = None - """The name of a an SdkType configuration property.""" - - friendly_name: str | None = None - """The user-friendly name of an SdkType configuration property.""" - - description: str | None = None - """The description of an SdkType configuration property.""" - - required: bool = False - """ - A boolean flag of an SdkType configuration property to indicate if the - associated SDK configuration property is required (`true`) or not - (`false`). - """ - - default_value: str | None = None - """The default value of an SdkType configuration property.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SDK_CONFIGURATION_PROPERTY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_SDK_CONFIGURATION_PROPERTY.members["name"], self.name - ) - - if self.friendly_name is not None: - serializer.write_string( - _SCHEMA_SDK_CONFIGURATION_PROPERTY.members["friendlyName"], - self.friendly_name, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_SDK_CONFIGURATION_PROPERTY.members["description"], - self.description, - ) - - serializer.write_boolean( - _SCHEMA_SDK_CONFIGURATION_PROPERTY.members["required"], self.required - ) - if self.default_value is not None: - serializer.write_string( - _SCHEMA_SDK_CONFIGURATION_PROPERTY.members["defaultValue"], - self.default_value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_SDK_CONFIGURATION_PROPERTY.members["name"] - ) - - case 1: - kwargs["friendly_name"] = de.read_string( - _SCHEMA_SDK_CONFIGURATION_PROPERTY.members["friendlyName"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_SDK_CONFIGURATION_PROPERTY.members["description"] - ) - - case 3: - kwargs["required"] = de.read_boolean( - _SCHEMA_SDK_CONFIGURATION_PROPERTY.members["required"] - ) - - case 4: - kwargs["default_value"] = de.read_string( - _SCHEMA_SDK_CONFIGURATION_PROPERTY.members["defaultValue"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SDK_CONFIGURATION_PROPERTY, consumer=_consumer) - return kwargs - - -def _serialize_list_of_sdk_configuration_property( - serializer: ShapeSerializer, schema: Schema, value: list[SdkConfigurationProperty] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_list_of_sdk_configuration_property( - deserializer: ShapeDeserializer, schema: Schema -) -> list[SdkConfigurationProperty]: - result: list[SdkConfigurationProperty] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(SdkConfigurationProperty.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GetSdkTypeOutput: - """A type of SDK that API Gateway can generate.""" - - id: str | None = None - """The identifier of an SdkType instance.""" - - friendly_name: str | None = None - """The user-friendly name of an SdkType instance.""" - - description: str | None = None - """The description of an SdkType.""" - - configuration_properties: list[SdkConfigurationProperty] | None = None - """A list of configuration properties of an SdkType.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_SDK_TYPE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string(_SCHEMA_GET_SDK_TYPE_OUTPUT.members["id"], self.id) - - if self.friendly_name is not None: - serializer.write_string( - _SCHEMA_GET_SDK_TYPE_OUTPUT.members["friendlyName"], self.friendly_name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_SDK_TYPE_OUTPUT.members["description"], self.description - ) - - if self.configuration_properties is not None: - _serialize_list_of_sdk_configuration_property( - serializer, - _SCHEMA_GET_SDK_TYPE_OUTPUT.members["configurationProperties"], - self.configuration_properties, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_GET_SDK_TYPE_OUTPUT.members["id"] - ) - - case 1: - kwargs["friendly_name"] = de.read_string( - _SCHEMA_GET_SDK_TYPE_OUTPUT.members["friendlyName"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_GET_SDK_TYPE_OUTPUT.members["description"] - ) - - case 3: - kwargs["configuration_properties"] = ( - _deserialize_list_of_sdk_configuration_property( - de, - _SCHEMA_GET_SDK_TYPE_OUTPUT.members[ - "configurationProperties" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_SDK_TYPE_OUTPUT, consumer=_consumer) - return kwargs - - -GET_SDK_TYPE = APIOperation( - input=GetSdkTypeInput, - output=GetSdkTypeOutput, - schema=_SCHEMA_GET_SDK_TYPE, - input_schema=_SCHEMA_GET_SDK_TYPE_INPUT, - output_schema=_SCHEMA_GET_SDK_TYPE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetSdkTypesInput: - """Get the SdkTypes collection.""" - - position: str | None = None - """The current pagination position in the paged result set.""" - - limit: int | None = None - """ - The maximum number of returned results per page. The default value is 25 - and the maximum value is 500. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_SDK_TYPES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.position is not None: - serializer.write_string( - _SCHEMA_GET_SDK_TYPES_INPUT.members["position"], self.position - ) - - if self.limit is not None: - serializer.write_integer( - _SCHEMA_GET_SDK_TYPES_INPUT.members["limit"], self.limit - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["position"] = de.read_string( - _SCHEMA_GET_SDK_TYPES_INPUT.members["position"] - ) - - case 1: - kwargs["limit"] = de.read_integer( - _SCHEMA_GET_SDK_TYPES_INPUT.members["limit"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_SDK_TYPES_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class SdkType: - """A type of SDK that API Gateway can generate.""" - - id: str | None = None - """The identifier of an SdkType instance.""" - - friendly_name: str | None = None - """The user-friendly name of an SdkType instance.""" - - description: str | None = None - """The description of an SdkType.""" - - configuration_properties: list[SdkConfigurationProperty] | None = None - """A list of configuration properties of an SdkType.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SDK_TYPE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string(_SCHEMA_SDK_TYPE.members["id"], self.id) - - if self.friendly_name is not None: - serializer.write_string( - _SCHEMA_SDK_TYPE.members["friendlyName"], self.friendly_name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_SDK_TYPE.members["description"], self.description - ) - - if self.configuration_properties is not None: - _serialize_list_of_sdk_configuration_property( - serializer, - _SCHEMA_SDK_TYPE.members["configurationProperties"], - self.configuration_properties, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string(_SCHEMA_SDK_TYPE.members["id"]) - - case 1: - kwargs["friendly_name"] = de.read_string( - _SCHEMA_SDK_TYPE.members["friendlyName"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_SDK_TYPE.members["description"] - ) - - case 3: - kwargs["configuration_properties"] = ( - _deserialize_list_of_sdk_configuration_property( - de, _SCHEMA_SDK_TYPE.members["configurationProperties"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SDK_TYPE, consumer=_consumer) - return kwargs - - -def _serialize_list_of_sdk_type( - serializer: ShapeSerializer, schema: Schema, value: list[SdkType] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_list_of_sdk_type( - deserializer: ShapeDeserializer, schema: Schema -) -> list[SdkType]: - result: list[SdkType] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(SdkType.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GetSdkTypesOutput: - """The collection of SdkType instances.""" - - items: list[SdkType] | None = None - """The current page of elements from this collection.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_SDK_TYPES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.items is not None: - _serialize_list_of_sdk_type( - serializer, _SCHEMA_GET_SDK_TYPES_OUTPUT.members["items"], self.items - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["items"] = _deserialize_list_of_sdk_type( - de, _SCHEMA_GET_SDK_TYPES_OUTPUT.members["items"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_SDK_TYPES_OUTPUT, consumer=_consumer) - return kwargs - - -GET_SDK_TYPES = APIOperation( - input=GetSdkTypesInput, - output=GetSdkTypesOutput, - schema=_SCHEMA_GET_SDK_TYPES, - input_schema=_SCHEMA_GET_SDK_TYPES_INPUT, - output_schema=_SCHEMA_GET_SDK_TYPES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetStageInput: - """Requests API Gateway to get information about a Stage resource.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - stage_name: str | None = None - """The name of the Stage resource to get information about.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_STAGE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_GET_STAGE_INPUT.members["restApiId"], self.rest_api_id - ) - - if self.stage_name is not None: - serializer.write_string( - _SCHEMA_GET_STAGE_INPUT.members["stageName"], self.stage_name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_GET_STAGE_INPUT.members["restApiId"] - ) - - case 1: - kwargs["stage_name"] = de.read_string( - _SCHEMA_GET_STAGE_INPUT.members["stageName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_STAGE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetStageOutput: - """ - Represents a unique identifier for a version of a deployed RestApi that - is callable by users. - """ - - deployment_id: str | None = None - """The identifier of the Deployment that the stage points to.""" - - client_certificate_id: str | None = None - """The identifier of a client certificate for an API stage.""" - - stage_name: str | None = None - """ - The name of the stage is the first path segment in the Uniform Resource - Identifier (URI) of a call to API Gateway. Stage names can only contain - alphanumeric characters, hyphens, and underscores. Maximum length is 128 - characters. - """ - - description: str | None = None - """The stage's description.""" - - cache_cluster_enabled: bool = False - """ - Specifies whether a cache cluster is enabled for the stage. To activate - a method-level cache, set `CachingEnabled` to `true` for a method. - """ - - cache_cluster_size: str | None = None - """ - The stage's cache capacity in GB. For more information about choosing a - cache size, see [Enabling API caching to enhance - responsiveness](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html). - """ - - cache_cluster_status: str | None = None - """The status of the cache cluster for the stage, if enabled.""" - - method_settings: dict[str, MethodSetting] | None = None - """ - A map that defines the method settings for a Stage resource. Keys - (designated as `/{method_setting_key` below) are method paths defined as - `{resource_path}/{http_method}` for an individual method override, or - `/*/*` for overriding all methods in the stage. - """ - - variables: dict[str, str] | None = None - """ - A map that defines the stage variables for a Stage resource. Variable - names can have alphanumeric and underscore characters, and the values - must match `[A-Za-z0-9-._~:/?#&=,]+`. - """ - - documentation_version: str | None = None - """The version of the associated API documentation.""" - - access_log_settings: AccessLogSettings | None = None - """Settings for logging access in this stage.""" - - canary_settings: CanarySettings | None = None - """Settings for the canary deployment in this stage.""" - - tracing_enabled: bool = False - """Specifies whether active tracing with X-ray is enabled for the Stage.""" - - web_acl_arn: str | None = None - """The ARN of the WebAcl associated with the Stage.""" - - tags: dict[str, str] | None = None - """ - The collection of tags. Each tag element is associated with a given - resource. - """ - - created_date: datetime | None = None - """The timestamp when the stage was created.""" - - last_updated_date: datetime | None = None - """The timestamp when the stage last updated.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_STAGE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.deployment_id is not None: - serializer.write_string( - _SCHEMA_GET_STAGE_OUTPUT.members["deploymentId"], self.deployment_id - ) - - if self.client_certificate_id is not None: - serializer.write_string( - _SCHEMA_GET_STAGE_OUTPUT.members["clientCertificateId"], - self.client_certificate_id, - ) - - if self.stage_name is not None: - serializer.write_string( - _SCHEMA_GET_STAGE_OUTPUT.members["stageName"], self.stage_name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_STAGE_OUTPUT.members["description"], self.description - ) - - serializer.write_boolean( - _SCHEMA_GET_STAGE_OUTPUT.members["cacheClusterEnabled"], - self.cache_cluster_enabled, - ) - if self.cache_cluster_size is not None: - serializer.write_string( - _SCHEMA_GET_STAGE_OUTPUT.members["cacheClusterSize"], - self.cache_cluster_size, - ) - - if self.cache_cluster_status is not None: - serializer.write_string( - _SCHEMA_GET_STAGE_OUTPUT.members["cacheClusterStatus"], - self.cache_cluster_status, - ) - - if self.method_settings is not None: - _serialize_map_of_method_settings( - serializer, - _SCHEMA_GET_STAGE_OUTPUT.members["methodSettings"], - self.method_settings, - ) - - if self.variables is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_GET_STAGE_OUTPUT.members["variables"], - self.variables, - ) - - if self.documentation_version is not None: - serializer.write_string( - _SCHEMA_GET_STAGE_OUTPUT.members["documentationVersion"], - self.documentation_version, - ) - - if self.access_log_settings is not None: - serializer.write_struct( - _SCHEMA_GET_STAGE_OUTPUT.members["accessLogSettings"], - self.access_log_settings, - ) - - if self.canary_settings is not None: - serializer.write_struct( - _SCHEMA_GET_STAGE_OUTPUT.members["canarySettings"], self.canary_settings - ) - - serializer.write_boolean( - _SCHEMA_GET_STAGE_OUTPUT.members["tracingEnabled"], self.tracing_enabled - ) - if self.web_acl_arn is not None: - serializer.write_string( - _SCHEMA_GET_STAGE_OUTPUT.members["webAclArn"], self.web_acl_arn - ) - - if self.tags is not None: - _serialize_map_of_string_to_string( - serializer, _SCHEMA_GET_STAGE_OUTPUT.members["tags"], self.tags - ) - - if self.created_date is not None: - serializer.write_timestamp( - _SCHEMA_GET_STAGE_OUTPUT.members["createdDate"], self.created_date - ) - - if self.last_updated_date is not None: - serializer.write_timestamp( - _SCHEMA_GET_STAGE_OUTPUT.members["lastUpdatedDate"], - self.last_updated_date, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["deployment_id"] = de.read_string( - _SCHEMA_GET_STAGE_OUTPUT.members["deploymentId"] - ) - - case 1: - kwargs["client_certificate_id"] = de.read_string( - _SCHEMA_GET_STAGE_OUTPUT.members["clientCertificateId"] - ) - - case 2: - kwargs["stage_name"] = de.read_string( - _SCHEMA_GET_STAGE_OUTPUT.members["stageName"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_GET_STAGE_OUTPUT.members["description"] - ) - - case 4: - kwargs["cache_cluster_enabled"] = de.read_boolean( - _SCHEMA_GET_STAGE_OUTPUT.members["cacheClusterEnabled"] - ) - - case 5: - kwargs["cache_cluster_size"] = CacheClusterSize( - de.read_string( - _SCHEMA_GET_STAGE_OUTPUT.members["cacheClusterSize"] - ) - ) - - case 6: - kwargs["cache_cluster_status"] = CacheClusterStatus( - de.read_string( - _SCHEMA_GET_STAGE_OUTPUT.members["cacheClusterStatus"] - ) - ) - - case 7: - kwargs["method_settings"] = _deserialize_map_of_method_settings( - de, _SCHEMA_GET_STAGE_OUTPUT.members["methodSettings"] - ) - - case 8: - kwargs["variables"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_GET_STAGE_OUTPUT.members["variables"] - ) - - case 9: - kwargs["documentation_version"] = de.read_string( - _SCHEMA_GET_STAGE_OUTPUT.members["documentationVersion"] - ) - - case 10: - kwargs["access_log_settings"] = AccessLogSettings.deserialize(de) - - case 11: - kwargs["canary_settings"] = CanarySettings.deserialize(de) - - case 12: - kwargs["tracing_enabled"] = de.read_boolean( - _SCHEMA_GET_STAGE_OUTPUT.members["tracingEnabled"] - ) - - case 13: - kwargs["web_acl_arn"] = de.read_string( - _SCHEMA_GET_STAGE_OUTPUT.members["webAclArn"] - ) - - case 14: - kwargs["tags"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_GET_STAGE_OUTPUT.members["tags"] - ) - - case 15: - kwargs["created_date"] = de.read_timestamp( - _SCHEMA_GET_STAGE_OUTPUT.members["createdDate"] - ) - - case 16: - kwargs["last_updated_date"] = de.read_timestamp( - _SCHEMA_GET_STAGE_OUTPUT.members["lastUpdatedDate"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_STAGE_OUTPUT, consumer=_consumer) - return kwargs - - -GET_STAGE = APIOperation( - input=GetStageInput, - output=GetStageOutput, - schema=_SCHEMA_GET_STAGE, - input_schema=_SCHEMA_GET_STAGE_INPUT, - output_schema=_SCHEMA_GET_STAGE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetStagesInput: - """ - Requests API Gateway to get information about one or more Stage - resources. - """ - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - deployment_id: str | None = None - """The stages' deployment identifiers.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_STAGES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_GET_STAGES_INPUT.members["restApiId"], self.rest_api_id - ) - - if self.deployment_id is not None: - serializer.write_string( - _SCHEMA_GET_STAGES_INPUT.members["deploymentId"], self.deployment_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_GET_STAGES_INPUT.members["restApiId"] - ) - - case 1: - kwargs["deployment_id"] = de.read_string( - _SCHEMA_GET_STAGES_INPUT.members["deploymentId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_STAGES_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Stage: - """ - Represents a unique identifier for a version of a deployed RestApi that - is callable by users. - """ - - deployment_id: str | None = None - """The identifier of the Deployment that the stage points to.""" - - client_certificate_id: str | None = None - """The identifier of a client certificate for an API stage.""" - - stage_name: str | None = None - """ - The name of the stage is the first path segment in the Uniform Resource - Identifier (URI) of a call to API Gateway. Stage names can only contain - alphanumeric characters, hyphens, and underscores. Maximum length is 128 - characters. - """ - - description: str | None = None - """The stage's description.""" - - cache_cluster_enabled: bool = False - """ - Specifies whether a cache cluster is enabled for the stage. To activate - a method-level cache, set `CachingEnabled` to `true` for a method. - """ - - cache_cluster_size: str | None = None - """ - The stage's cache capacity in GB. For more information about choosing a - cache size, see [Enabling API caching to enhance - responsiveness](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html). - """ - - cache_cluster_status: str | None = None - """The status of the cache cluster for the stage, if enabled.""" - - method_settings: dict[str, MethodSetting] | None = None - """ - A map that defines the method settings for a Stage resource. Keys - (designated as `/{method_setting_key` below) are method paths defined as - `{resource_path}/{http_method}` for an individual method override, or - `/*/*` for overriding all methods in the stage. - """ - - variables: dict[str, str] | None = None - """ - A map that defines the stage variables for a Stage resource. Variable - names can have alphanumeric and underscore characters, and the values - must match `[A-Za-z0-9-._~:/?#&=,]+`. - """ - - documentation_version: str | None = None - """The version of the associated API documentation.""" - - access_log_settings: AccessLogSettings | None = None - """Settings for logging access in this stage.""" - - canary_settings: CanarySettings | None = None - """Settings for the canary deployment in this stage.""" - - tracing_enabled: bool = False - """Specifies whether active tracing with X-ray is enabled for the Stage.""" - - web_acl_arn: str | None = None - """The ARN of the WebAcl associated with the Stage.""" - - tags: dict[str, str] | None = None - """ - The collection of tags. Each tag element is associated with a given - resource. - """ - - created_date: datetime | None = None - """The timestamp when the stage was created.""" - - last_updated_date: datetime | None = None - """The timestamp when the stage last updated.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STAGE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.deployment_id is not None: - serializer.write_string( - _SCHEMA_STAGE.members["deploymentId"], self.deployment_id - ) - - if self.client_certificate_id is not None: - serializer.write_string( - _SCHEMA_STAGE.members["clientCertificateId"], self.client_certificate_id - ) - - if self.stage_name is not None: - serializer.write_string(_SCHEMA_STAGE.members["stageName"], self.stage_name) - - if self.description is not None: - serializer.write_string( - _SCHEMA_STAGE.members["description"], self.description - ) - - serializer.write_boolean( - _SCHEMA_STAGE.members["cacheClusterEnabled"], self.cache_cluster_enabled - ) - if self.cache_cluster_size is not None: - serializer.write_string( - _SCHEMA_STAGE.members["cacheClusterSize"], self.cache_cluster_size - ) - - if self.cache_cluster_status is not None: - serializer.write_string( - _SCHEMA_STAGE.members["cacheClusterStatus"], self.cache_cluster_status - ) - - if self.method_settings is not None: - _serialize_map_of_method_settings( - serializer, - _SCHEMA_STAGE.members["methodSettings"], - self.method_settings, - ) - - if self.variables is not None: - _serialize_map_of_string_to_string( - serializer, _SCHEMA_STAGE.members["variables"], self.variables - ) - - if self.documentation_version is not None: - serializer.write_string( - _SCHEMA_STAGE.members["documentationVersion"], - self.documentation_version, - ) - - if self.access_log_settings is not None: - serializer.write_struct( - _SCHEMA_STAGE.members["accessLogSettings"], self.access_log_settings - ) - - if self.canary_settings is not None: - serializer.write_struct( - _SCHEMA_STAGE.members["canarySettings"], self.canary_settings - ) - - serializer.write_boolean( - _SCHEMA_STAGE.members["tracingEnabled"], self.tracing_enabled - ) - if self.web_acl_arn is not None: - serializer.write_string( - _SCHEMA_STAGE.members["webAclArn"], self.web_acl_arn - ) - - if self.tags is not None: - _serialize_map_of_string_to_string( - serializer, _SCHEMA_STAGE.members["tags"], self.tags - ) - - if self.created_date is not None: - serializer.write_timestamp( - _SCHEMA_STAGE.members["createdDate"], self.created_date - ) - - if self.last_updated_date is not None: - serializer.write_timestamp( - _SCHEMA_STAGE.members["lastUpdatedDate"], self.last_updated_date - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["deployment_id"] = de.read_string( - _SCHEMA_STAGE.members["deploymentId"] - ) - - case 1: - kwargs["client_certificate_id"] = de.read_string( - _SCHEMA_STAGE.members["clientCertificateId"] - ) - - case 2: - kwargs["stage_name"] = de.read_string( - _SCHEMA_STAGE.members["stageName"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_STAGE.members["description"] - ) - - case 4: - kwargs["cache_cluster_enabled"] = de.read_boolean( - _SCHEMA_STAGE.members["cacheClusterEnabled"] - ) - - case 5: - kwargs["cache_cluster_size"] = CacheClusterSize( - de.read_string(_SCHEMA_STAGE.members["cacheClusterSize"]) - ) - - case 6: - kwargs["cache_cluster_status"] = CacheClusterStatus( - de.read_string(_SCHEMA_STAGE.members["cacheClusterStatus"]) - ) - - case 7: - kwargs["method_settings"] = _deserialize_map_of_method_settings( - de, _SCHEMA_STAGE.members["methodSettings"] - ) - - case 8: - kwargs["variables"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_STAGE.members["variables"] - ) - - case 9: - kwargs["documentation_version"] = de.read_string( - _SCHEMA_STAGE.members["documentationVersion"] - ) - - case 10: - kwargs["access_log_settings"] = AccessLogSettings.deserialize(de) - - case 11: - kwargs["canary_settings"] = CanarySettings.deserialize(de) - - case 12: - kwargs["tracing_enabled"] = de.read_boolean( - _SCHEMA_STAGE.members["tracingEnabled"] - ) - - case 13: - kwargs["web_acl_arn"] = de.read_string( - _SCHEMA_STAGE.members["webAclArn"] - ) - - case 14: - kwargs["tags"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_STAGE.members["tags"] - ) - - case 15: - kwargs["created_date"] = de.read_timestamp( - _SCHEMA_STAGE.members["createdDate"] - ) - - case 16: - kwargs["last_updated_date"] = de.read_timestamp( - _SCHEMA_STAGE.members["lastUpdatedDate"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_STAGE, consumer=_consumer) - return kwargs - - -def _serialize_list_of_stage( - serializer: ShapeSerializer, schema: Schema, value: list[Stage] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_list_of_stage( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Stage]: - result: list[Stage] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Stage.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GetStagesOutput: - """A list of Stage resources that are associated with the ApiKey resource.""" - - item: list[Stage] | None = None - """The current page of elements from this collection.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_STAGES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.item is not None: - _serialize_list_of_stage( - serializer, _SCHEMA_GET_STAGES_OUTPUT.members["item"], self.item - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["item"] = _deserialize_list_of_stage( - de, _SCHEMA_GET_STAGES_OUTPUT.members["item"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_STAGES_OUTPUT, consumer=_consumer) - return kwargs - - -GET_STAGES = APIOperation( - input=GetStagesInput, - output=GetStagesOutput, - schema=_SCHEMA_GET_STAGES, - input_schema=_SCHEMA_GET_STAGES_INPUT, - output_schema=_SCHEMA_GET_STAGES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetTagsInput: - """Gets the Tags collection for a given resource.""" - - resource_arn: str | None = None - """The ARN of a resource that can be tagged.""" - - position: str | None = None - """ - (Not currently supported) The current pagination position in the paged - result set. - """ - - limit: int | None = None - """ - (Not currently supported) The maximum number of returned results per - page. The default value is 25 and the maximum value is 500. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_TAGS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_GET_TAGS_INPUT.members["resourceArn"], self.resource_arn - ) - - if self.position is not None: - serializer.write_string( - _SCHEMA_GET_TAGS_INPUT.members["position"], self.position - ) - - if self.limit is not None: - serializer.write_integer( - _SCHEMA_GET_TAGS_INPUT.members["limit"], self.limit - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_GET_TAGS_INPUT.members["resourceArn"] - ) - - case 1: - kwargs["position"] = de.read_string( - _SCHEMA_GET_TAGS_INPUT.members["position"] - ) - - case 2: - kwargs["limit"] = de.read_integer( - _SCHEMA_GET_TAGS_INPUT.members["limit"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_TAGS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetTagsOutput: - """ - The collection of tags. Each tag element is associated with a given - resource. - """ - - tags: dict[str, str] | None = None - """ - The collection of tags. Each tag element is associated with a given - resource. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_TAGS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.tags is not None: - _serialize_map_of_string_to_string( - serializer, _SCHEMA_GET_TAGS_OUTPUT.members["tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["tags"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_GET_TAGS_OUTPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_TAGS_OUTPUT, consumer=_consumer) - return kwargs - - -GET_TAGS = APIOperation( - input=GetTagsInput, - output=GetTagsOutput, - schema=_SCHEMA_GET_TAGS, - input_schema=_SCHEMA_GET_TAGS_INPUT, - output_schema=_SCHEMA_GET_TAGS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetUsageInput: - """ - The GET request to get the usage data of a usage plan in a specified - time interval. - """ - - usage_plan_id: str | None = None - """The Id of the usage plan associated with the usage data.""" - - key_id: str | None = None - """The Id of the API key associated with the resultant usage data.""" - - start_date: str | None = None - """The starting date (e.g., 2016-01-01) of the usage data.""" - - end_date: str | None = None - """The ending date (e.g., 2016-12-31) of the usage data.""" - - position: str | None = None - """The current pagination position in the paged result set.""" - - limit: int | None = None - """ - The maximum number of returned results per page. The default value is 25 - and the maximum value is 500. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_USAGE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.usage_plan_id is not None: - serializer.write_string( - _SCHEMA_GET_USAGE_INPUT.members["usagePlanId"], self.usage_plan_id - ) - - if self.key_id is not None: - serializer.write_string( - _SCHEMA_GET_USAGE_INPUT.members["keyId"], self.key_id - ) - - if self.start_date is not None: - serializer.write_string( - _SCHEMA_GET_USAGE_INPUT.members["startDate"], self.start_date - ) - - if self.end_date is not None: - serializer.write_string( - _SCHEMA_GET_USAGE_INPUT.members["endDate"], self.end_date - ) - - if self.position is not None: - serializer.write_string( - _SCHEMA_GET_USAGE_INPUT.members["position"], self.position - ) - - if self.limit is not None: - serializer.write_integer( - _SCHEMA_GET_USAGE_INPUT.members["limit"], self.limit - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["usage_plan_id"] = de.read_string( - _SCHEMA_GET_USAGE_INPUT.members["usagePlanId"] - ) - - case 1: - kwargs["key_id"] = de.read_string( - _SCHEMA_GET_USAGE_INPUT.members["keyId"] - ) - - case 2: - kwargs["start_date"] = de.read_string( - _SCHEMA_GET_USAGE_INPUT.members["startDate"] - ) - - case 3: - kwargs["end_date"] = de.read_string( - _SCHEMA_GET_USAGE_INPUT.members["endDate"] - ) - - case 4: - kwargs["position"] = de.read_string( - _SCHEMA_GET_USAGE_INPUT.members["position"] - ) - - case 5: - kwargs["limit"] = de.read_integer( - _SCHEMA_GET_USAGE_INPUT.members["limit"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_USAGE_INPUT, consumer=_consumer) - return kwargs - - -def _serialize_list_of_long( - serializer: ShapeSerializer, schema: Schema, value: list[int] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_long(member_schema, e) - - -def _deserialize_list_of_long( - deserializer: ShapeDeserializer, schema: Schema -) -> list[int]: - result: list[int] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_long(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_list_of_usage( - serializer: ShapeSerializer, schema: Schema, value: list[list[int]] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - _serialize_list_of_long(ls, member_schema, e) - - -def _deserialize_list_of_usage( - deserializer: ShapeDeserializer, schema: Schema -) -> list[list[int]]: - result: list[list[int]] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_deserialize_list_of_long(d, member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_map_of_key_usages( - serializer: ShapeSerializer, schema: Schema, value: dict[str, list[list[int]]] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: _serialize_list_of_usage(vs, value_schema, v)) - - -def _deserialize_map_of_key_usages( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, list[list[int]]]: - result: dict[str, list[list[int]]] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = _deserialize_list_of_usage(d, value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GetUsageOutput: - """Represents the usage data of a usage plan.""" - - usage_plan_id: str | None = None - """The plan Id associated with this usage data.""" - - start_date: str | None = None - """The starting date of the usage data.""" - - end_date: str | None = None - """The ending date of the usage data.""" - - items: dict[str, list[list[int]]] | None = None - """ - The usage data, as daily logs of used and remaining quotas, over the - specified time interval indexed over the API keys in a usage plan. For - example, - `{..., "values" : { "{api_key}" : [ [0, 100], [10, 90], [100, 10]]}`, - where `{api_key}` stands for an API key value and the daily log entry is - of the format `[used quota, remaining quota]`. - """ - - position: str | None = None - """The current pagination position in the paged result set.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_USAGE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.usage_plan_id is not None: - serializer.write_string( - _SCHEMA_GET_USAGE_OUTPUT.members["usagePlanId"], self.usage_plan_id - ) - - if self.start_date is not None: - serializer.write_string( - _SCHEMA_GET_USAGE_OUTPUT.members["startDate"], self.start_date - ) - - if self.end_date is not None: - serializer.write_string( - _SCHEMA_GET_USAGE_OUTPUT.members["endDate"], self.end_date - ) - - if self.items is not None: - _serialize_map_of_key_usages( - serializer, _SCHEMA_GET_USAGE_OUTPUT.members["items"], self.items - ) - - if self.position is not None: - serializer.write_string( - _SCHEMA_GET_USAGE_OUTPUT.members["position"], self.position - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["usage_plan_id"] = de.read_string( - _SCHEMA_GET_USAGE_OUTPUT.members["usagePlanId"] - ) - - case 1: - kwargs["start_date"] = de.read_string( - _SCHEMA_GET_USAGE_OUTPUT.members["startDate"] - ) - - case 2: - kwargs["end_date"] = de.read_string( - _SCHEMA_GET_USAGE_OUTPUT.members["endDate"] - ) - - case 3: - kwargs["items"] = _deserialize_map_of_key_usages( - de, _SCHEMA_GET_USAGE_OUTPUT.members["items"] - ) - - case 4: - kwargs["position"] = de.read_string( - _SCHEMA_GET_USAGE_OUTPUT.members["position"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_USAGE_OUTPUT, consumer=_consumer) - return kwargs - - -GET_USAGE = APIOperation( - input=GetUsageInput, - output=GetUsageOutput, - schema=_SCHEMA_GET_USAGE, - input_schema=_SCHEMA_GET_USAGE_INPUT, - output_schema=_SCHEMA_GET_USAGE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetUsagePlanInput: - """The GET request to get a usage plan of a given plan identifier.""" - - usage_plan_id: str | None = None - """The identifier of the UsagePlan resource to be retrieved.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_USAGE_PLAN_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.usage_plan_id is not None: - serializer.write_string( - _SCHEMA_GET_USAGE_PLAN_INPUT.members["usagePlanId"], self.usage_plan_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["usage_plan_id"] = de.read_string( - _SCHEMA_GET_USAGE_PLAN_INPUT.members["usagePlanId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_USAGE_PLAN_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetUsagePlanOutput: - """ - Represents a usage plan used to specify who can assess associated API - stages. Optionally, target request rate and quota limits can be set. In - some cases clients can exceed the targets that you set. Don't rely on - usage plans to control costs. Consider using [Amazon Web Services - Budgets](https://docs.aws.amazon.com/cost-management/latest/userguide/budgets-managing-costs.html) - to monitor costs and - [WAF](https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html) - to manage API requests. - """ - - id: str | None = None - """The identifier of a UsagePlan resource.""" - - name: str | None = None - """The name of a usage plan.""" - - description: str | None = None - """The description of a usage plan.""" - - api_stages: list[ApiStage] | None = None - """The associated API stages of a usage plan.""" - - throttle: ThrottleSettings | None = None - """ - A map containing method level throttling information for API stage in a - usage plan. - """ - - quota: QuotaSettings | None = None - """ - The target maximum number of permitted requests per a given unit time - interval. - """ - - product_code: str | None = None - """ - The Amazon Web Services Marketplace product identifier to associate with - the usage plan as a SaaS product on the Amazon Web Services Marketplace. - """ - - tags: dict[str, str] | None = None - """ - The collection of tags. Each tag element is associated with a given - resource. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_USAGE_PLAN_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string( - _SCHEMA_GET_USAGE_PLAN_OUTPUT.members["id"], self.id - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_GET_USAGE_PLAN_OUTPUT.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_USAGE_PLAN_OUTPUT.members["description"], self.description - ) - - if self.api_stages is not None: - _serialize_list_of_api_stage( - serializer, - _SCHEMA_GET_USAGE_PLAN_OUTPUT.members["apiStages"], - self.api_stages, - ) - - if self.throttle is not None: - serializer.write_struct( - _SCHEMA_GET_USAGE_PLAN_OUTPUT.members["throttle"], self.throttle - ) - - if self.quota is not None: - serializer.write_struct( - _SCHEMA_GET_USAGE_PLAN_OUTPUT.members["quota"], self.quota - ) - - if self.product_code is not None: - serializer.write_string( - _SCHEMA_GET_USAGE_PLAN_OUTPUT.members["productCode"], self.product_code - ) - - if self.tags is not None: - _serialize_map_of_string_to_string( - serializer, _SCHEMA_GET_USAGE_PLAN_OUTPUT.members["tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_GET_USAGE_PLAN_OUTPUT.members["id"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_GET_USAGE_PLAN_OUTPUT.members["name"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_GET_USAGE_PLAN_OUTPUT.members["description"] - ) - - case 3: - kwargs["api_stages"] = _deserialize_list_of_api_stage( - de, _SCHEMA_GET_USAGE_PLAN_OUTPUT.members["apiStages"] - ) - - case 4: - kwargs["throttle"] = ThrottleSettings.deserialize(de) - - case 5: - kwargs["quota"] = QuotaSettings.deserialize(de) - - case 6: - kwargs["product_code"] = de.read_string( - _SCHEMA_GET_USAGE_PLAN_OUTPUT.members["productCode"] - ) - - case 7: - kwargs["tags"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_GET_USAGE_PLAN_OUTPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_USAGE_PLAN_OUTPUT, consumer=_consumer) - return kwargs - - -GET_USAGE_PLAN = APIOperation( - input=GetUsagePlanInput, - output=GetUsagePlanOutput, - schema=_SCHEMA_GET_USAGE_PLAN, - input_schema=_SCHEMA_GET_USAGE_PLAN_INPUT, - output_schema=_SCHEMA_GET_USAGE_PLAN_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetUsagePlanKeyInput: - """The GET request to get a usage plan key of a given key identifier.""" - - usage_plan_id: str | None = None - """ - The Id of the UsagePlan resource representing the usage plan containing - the to-be-retrieved UsagePlanKey resource representing a plan customer. - """ - - key_id: str | None = None - """ - The key Id of the to-be-retrieved UsagePlanKey resource representing a - plan customer. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_USAGE_PLAN_KEY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.usage_plan_id is not None: - serializer.write_string( - _SCHEMA_GET_USAGE_PLAN_KEY_INPUT.members["usagePlanId"], - self.usage_plan_id, - ) - - if self.key_id is not None: - serializer.write_string( - _SCHEMA_GET_USAGE_PLAN_KEY_INPUT.members["keyId"], self.key_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["usage_plan_id"] = de.read_string( - _SCHEMA_GET_USAGE_PLAN_KEY_INPUT.members["usagePlanId"] - ) - - case 1: - kwargs["key_id"] = de.read_string( - _SCHEMA_GET_USAGE_PLAN_KEY_INPUT.members["keyId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_USAGE_PLAN_KEY_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetUsagePlanKeyOutput: - """Represents a usage plan key to identify a plan customer.""" - - id: str | None = None - """The Id of a usage plan key.""" - - type: str | None = None - """ - The type of a usage plan key. Currently, the valid key type is - `API_KEY`. - """ - - value: str | None = None - """The value of a usage plan key.""" - - name: str | None = None - """The name of a usage plan key.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_USAGE_PLAN_KEY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string( - _SCHEMA_GET_USAGE_PLAN_KEY_OUTPUT.members["id"], self.id - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_GET_USAGE_PLAN_KEY_OUTPUT.members["type"], self.type - ) - - if self.value is not None: - serializer.write_string( - _SCHEMA_GET_USAGE_PLAN_KEY_OUTPUT.members["value"], self.value - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_GET_USAGE_PLAN_KEY_OUTPUT.members["name"], self.name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_GET_USAGE_PLAN_KEY_OUTPUT.members["id"] - ) - - case 1: - kwargs["type"] = de.read_string( - _SCHEMA_GET_USAGE_PLAN_KEY_OUTPUT.members["type"] - ) - - case 2: - kwargs["value"] = de.read_string( - _SCHEMA_GET_USAGE_PLAN_KEY_OUTPUT.members["value"] - ) - - case 3: - kwargs["name"] = de.read_string( - _SCHEMA_GET_USAGE_PLAN_KEY_OUTPUT.members["name"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_USAGE_PLAN_KEY_OUTPUT, consumer=_consumer) - return kwargs - - -GET_USAGE_PLAN_KEY = APIOperation( - input=GetUsagePlanKeyInput, - output=GetUsagePlanKeyOutput, - schema=_SCHEMA_GET_USAGE_PLAN_KEY, - input_schema=_SCHEMA_GET_USAGE_PLAN_KEY_INPUT, - output_schema=_SCHEMA_GET_USAGE_PLAN_KEY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetUsagePlanKeysInput: - """ - The GET request to get all the usage plan keys representing the API keys - added to a specified usage plan. - """ - - usage_plan_id: str | None = None - """ - The Id of the UsagePlan resource representing the usage plan containing - the to-be-retrieved UsagePlanKey resource representing a plan customer. - """ - - position: str | None = None - """The current pagination position in the paged result set.""" - - limit: int | None = None - """ - The maximum number of returned results per page. The default value is 25 - and the maximum value is 500. - """ - - name_query: str | None = None - """ - A query parameter specifying the name of the to-be-returned usage plan - keys. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_USAGE_PLAN_KEYS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.usage_plan_id is not None: - serializer.write_string( - _SCHEMA_GET_USAGE_PLAN_KEYS_INPUT.members["usagePlanId"], - self.usage_plan_id, - ) - - if self.position is not None: - serializer.write_string( - _SCHEMA_GET_USAGE_PLAN_KEYS_INPUT.members["position"], self.position - ) - - if self.limit is not None: - serializer.write_integer( - _SCHEMA_GET_USAGE_PLAN_KEYS_INPUT.members["limit"], self.limit - ) - - if self.name_query is not None: - serializer.write_string( - _SCHEMA_GET_USAGE_PLAN_KEYS_INPUT.members["nameQuery"], self.name_query - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["usage_plan_id"] = de.read_string( - _SCHEMA_GET_USAGE_PLAN_KEYS_INPUT.members["usagePlanId"] - ) - - case 1: - kwargs["position"] = de.read_string( - _SCHEMA_GET_USAGE_PLAN_KEYS_INPUT.members["position"] - ) - - case 2: - kwargs["limit"] = de.read_integer( - _SCHEMA_GET_USAGE_PLAN_KEYS_INPUT.members["limit"] - ) - - case 3: - kwargs["name_query"] = de.read_string( - _SCHEMA_GET_USAGE_PLAN_KEYS_INPUT.members["nameQuery"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_USAGE_PLAN_KEYS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UsagePlanKey: - """Represents a usage plan key to identify a plan customer.""" - - id: str | None = None - """The Id of a usage plan key.""" - - type: str | None = None - """ - The type of a usage plan key. Currently, the valid key type is - `API_KEY`. - """ - - value: str | None = None - """The value of a usage plan key.""" - - name: str | None = None - """The name of a usage plan key.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_USAGE_PLAN_KEY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string(_SCHEMA_USAGE_PLAN_KEY.members["id"], self.id) - - if self.type is not None: - serializer.write_string(_SCHEMA_USAGE_PLAN_KEY.members["type"], self.type) - - if self.value is not None: - serializer.write_string(_SCHEMA_USAGE_PLAN_KEY.members["value"], self.value) - - if self.name is not None: - serializer.write_string(_SCHEMA_USAGE_PLAN_KEY.members["name"], self.name) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string(_SCHEMA_USAGE_PLAN_KEY.members["id"]) - - case 1: - kwargs["type"] = de.read_string( - _SCHEMA_USAGE_PLAN_KEY.members["type"] - ) - - case 2: - kwargs["value"] = de.read_string( - _SCHEMA_USAGE_PLAN_KEY.members["value"] - ) - - case 3: - kwargs["name"] = de.read_string( - _SCHEMA_USAGE_PLAN_KEY.members["name"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_USAGE_PLAN_KEY, consumer=_consumer) - return kwargs - - -def _serialize_list_of_usage_plan_key( - serializer: ShapeSerializer, schema: Schema, value: list[UsagePlanKey] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_list_of_usage_plan_key( - deserializer: ShapeDeserializer, schema: Schema -) -> list[UsagePlanKey]: - result: list[UsagePlanKey] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(UsagePlanKey.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GetUsagePlanKeysOutput: - """ - Represents the collection of usage plan keys added to usage plans for - the associated API keys and, possibly, other types of keys. - """ - - items: list[UsagePlanKey] | None = None - """The current page of elements from this collection.""" - - position: str | None = None - """The current pagination position in the paged result set.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_USAGE_PLAN_KEYS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.items is not None: - _serialize_list_of_usage_plan_key( - serializer, - _SCHEMA_GET_USAGE_PLAN_KEYS_OUTPUT.members["items"], - self.items, - ) - - if self.position is not None: - serializer.write_string( - _SCHEMA_GET_USAGE_PLAN_KEYS_OUTPUT.members["position"], self.position - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["items"] = _deserialize_list_of_usage_plan_key( - de, _SCHEMA_GET_USAGE_PLAN_KEYS_OUTPUT.members["items"] - ) - - case 1: - kwargs["position"] = de.read_string( - _SCHEMA_GET_USAGE_PLAN_KEYS_OUTPUT.members["position"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_USAGE_PLAN_KEYS_OUTPUT, consumer=_consumer) - return kwargs - - -GET_USAGE_PLAN_KEYS = APIOperation( - input=GetUsagePlanKeysInput, - output=GetUsagePlanKeysOutput, - schema=_SCHEMA_GET_USAGE_PLAN_KEYS, - input_schema=_SCHEMA_GET_USAGE_PLAN_KEYS_INPUT, - output_schema=_SCHEMA_GET_USAGE_PLAN_KEYS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetUsagePlansInput: - """The GET request to get all the usage plans of the caller's account.""" - - position: str | None = None - """The current pagination position in the paged result set.""" - - key_id: str | None = None - """The identifier of the API key associated with the usage plans.""" - - limit: int | None = None - """ - The maximum number of returned results per page. The default value is 25 - and the maximum value is 500. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_USAGE_PLANS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.position is not None: - serializer.write_string( - _SCHEMA_GET_USAGE_PLANS_INPUT.members["position"], self.position - ) - - if self.key_id is not None: - serializer.write_string( - _SCHEMA_GET_USAGE_PLANS_INPUT.members["keyId"], self.key_id - ) - - if self.limit is not None: - serializer.write_integer( - _SCHEMA_GET_USAGE_PLANS_INPUT.members["limit"], self.limit - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["position"] = de.read_string( - _SCHEMA_GET_USAGE_PLANS_INPUT.members["position"] - ) - - case 1: - kwargs["key_id"] = de.read_string( - _SCHEMA_GET_USAGE_PLANS_INPUT.members["keyId"] - ) - - case 2: - kwargs["limit"] = de.read_integer( - _SCHEMA_GET_USAGE_PLANS_INPUT.members["limit"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_USAGE_PLANS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UsagePlan: - """ - Represents a usage plan used to specify who can assess associated API - stages. Optionally, target request rate and quota limits can be set. In - some cases clients can exceed the targets that you set. Don't rely on - usage plans to control costs. Consider using [Amazon Web Services - Budgets](https://docs.aws.amazon.com/cost-management/latest/userguide/budgets-managing-costs.html) - to monitor costs and - [WAF](https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html) - to manage API requests. - """ - - id: str | None = None - """The identifier of a UsagePlan resource.""" - - name: str | None = None - """The name of a usage plan.""" - - description: str | None = None - """The description of a usage plan.""" - - api_stages: list[ApiStage] | None = None - """The associated API stages of a usage plan.""" - - throttle: ThrottleSettings | None = None - """ - A map containing method level throttling information for API stage in a - usage plan. - """ - - quota: QuotaSettings | None = None - """ - The target maximum number of permitted requests per a given unit time - interval. - """ - - product_code: str | None = None - """ - The Amazon Web Services Marketplace product identifier to associate with - the usage plan as a SaaS product on the Amazon Web Services Marketplace. - """ - - tags: dict[str, str] | None = None - """ - The collection of tags. Each tag element is associated with a given - resource. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_USAGE_PLAN, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string(_SCHEMA_USAGE_PLAN.members["id"], self.id) - - if self.name is not None: - serializer.write_string(_SCHEMA_USAGE_PLAN.members["name"], self.name) - - if self.description is not None: - serializer.write_string( - _SCHEMA_USAGE_PLAN.members["description"], self.description - ) - - if self.api_stages is not None: - _serialize_list_of_api_stage( - serializer, _SCHEMA_USAGE_PLAN.members["apiStages"], self.api_stages - ) - - if self.throttle is not None: - serializer.write_struct( - _SCHEMA_USAGE_PLAN.members["throttle"], self.throttle - ) - - if self.quota is not None: - serializer.write_struct(_SCHEMA_USAGE_PLAN.members["quota"], self.quota) - - if self.product_code is not None: - serializer.write_string( - _SCHEMA_USAGE_PLAN.members["productCode"], self.product_code - ) - - if self.tags is not None: - _serialize_map_of_string_to_string( - serializer, _SCHEMA_USAGE_PLAN.members["tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string(_SCHEMA_USAGE_PLAN.members["id"]) - - case 1: - kwargs["name"] = de.read_string(_SCHEMA_USAGE_PLAN.members["name"]) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_USAGE_PLAN.members["description"] - ) - - case 3: - kwargs["api_stages"] = _deserialize_list_of_api_stage( - de, _SCHEMA_USAGE_PLAN.members["apiStages"] - ) - - case 4: - kwargs["throttle"] = ThrottleSettings.deserialize(de) - - case 5: - kwargs["quota"] = QuotaSettings.deserialize(de) - - case 6: - kwargs["product_code"] = de.read_string( - _SCHEMA_USAGE_PLAN.members["productCode"] - ) - - case 7: - kwargs["tags"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_USAGE_PLAN.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_USAGE_PLAN, consumer=_consumer) - return kwargs - - -def _serialize_list_of_usage_plan( - serializer: ShapeSerializer, schema: Schema, value: list[UsagePlan] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_list_of_usage_plan( - deserializer: ShapeDeserializer, schema: Schema -) -> list[UsagePlan]: - result: list[UsagePlan] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(UsagePlan.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GetUsagePlansOutput: - """Represents a collection of usage plans for an AWS account.""" - - items: list[UsagePlan] | None = None - """The current page of elements from this collection.""" - - position: str | None = None - """The current pagination position in the paged result set.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_USAGE_PLANS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.items is not None: - _serialize_list_of_usage_plan( - serializer, _SCHEMA_GET_USAGE_PLANS_OUTPUT.members["items"], self.items - ) - - if self.position is not None: - serializer.write_string( - _SCHEMA_GET_USAGE_PLANS_OUTPUT.members["position"], self.position - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["items"] = _deserialize_list_of_usage_plan( - de, _SCHEMA_GET_USAGE_PLANS_OUTPUT.members["items"] - ) - - case 1: - kwargs["position"] = de.read_string( - _SCHEMA_GET_USAGE_PLANS_OUTPUT.members["position"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_USAGE_PLANS_OUTPUT, consumer=_consumer) - return kwargs - - -GET_USAGE_PLANS = APIOperation( - input=GetUsagePlansInput, - output=GetUsagePlansOutput, - schema=_SCHEMA_GET_USAGE_PLANS, - input_schema=_SCHEMA_GET_USAGE_PLANS_INPUT, - output_schema=_SCHEMA_GET_USAGE_PLANS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetVpcLinkInput: - """Gets a specified VPC link under the caller's account in a region.""" - - vpc_link_id: str | None = None - """ - The identifier of the VpcLink. It is used in an Integration to reference - this VpcLink. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_VPC_LINK_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.vpc_link_id is not None: - serializer.write_string( - _SCHEMA_GET_VPC_LINK_INPUT.members["vpcLinkId"], self.vpc_link_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["vpc_link_id"] = de.read_string( - _SCHEMA_GET_VPC_LINK_INPUT.members["vpcLinkId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_VPC_LINK_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetVpcLinkOutput: - """ - An API Gateway VPC link for a RestApi to access resources in an Amazon - Virtual Private Cloud (VPC). - """ - - id: str | None = None - """ - The identifier of the VpcLink. It is used in an Integration to reference - this VpcLink. - """ - - name: str | None = None - """The name used to label and identify the VPC link.""" - - description: str | None = None - """The description of the VPC link.""" - - target_arns: list[str] | None = None - """ - The ARN of the network load balancer of the VPC targeted by the VPC - link. The network load balancer must be owned by the same Amazon Web - Services account of the API owner. - """ - - status: str | None = None - """ - The status of the VPC link. The valid values are `AVAILABLE`, `PENDING`, - `DELETING`, or `FAILED`. Deploying an API will wait if the status is - `PENDING` and will fail if the status is `DELETING`. - """ - - status_message: str | None = None - """A description about the VPC link status.""" - - tags: dict[str, str] | None = None - """ - The collection of tags. Each tag element is associated with a given - resource. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_VPC_LINK_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string(_SCHEMA_GET_VPC_LINK_OUTPUT.members["id"], self.id) - - if self.name is not None: - serializer.write_string( - _SCHEMA_GET_VPC_LINK_OUTPUT.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_VPC_LINK_OUTPUT.members["description"], self.description - ) - - if self.target_arns is not None: - _serialize_list_of_string( - serializer, - _SCHEMA_GET_VPC_LINK_OUTPUT.members["targetArns"], - self.target_arns, - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_GET_VPC_LINK_OUTPUT.members["status"], self.status - ) - - if self.status_message is not None: - serializer.write_string( - _SCHEMA_GET_VPC_LINK_OUTPUT.members["statusMessage"], - self.status_message, - ) - - if self.tags is not None: - _serialize_map_of_string_to_string( - serializer, _SCHEMA_GET_VPC_LINK_OUTPUT.members["tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_GET_VPC_LINK_OUTPUT.members["id"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_GET_VPC_LINK_OUTPUT.members["name"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_GET_VPC_LINK_OUTPUT.members["description"] - ) - - case 3: - kwargs["target_arns"] = _deserialize_list_of_string( - de, _SCHEMA_GET_VPC_LINK_OUTPUT.members["targetArns"] - ) - - case 4: - kwargs["status"] = VpcLinkStatus( - de.read_string(_SCHEMA_GET_VPC_LINK_OUTPUT.members["status"]) - ) - - case 5: - kwargs["status_message"] = de.read_string( - _SCHEMA_GET_VPC_LINK_OUTPUT.members["statusMessage"] - ) - - case 6: - kwargs["tags"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_GET_VPC_LINK_OUTPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_VPC_LINK_OUTPUT, consumer=_consumer) - return kwargs - - -GET_VPC_LINK = APIOperation( - input=GetVpcLinkInput, - output=GetVpcLinkOutput, - schema=_SCHEMA_GET_VPC_LINK, - input_schema=_SCHEMA_GET_VPC_LINK_INPUT, - output_schema=_SCHEMA_GET_VPC_LINK_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetVpcLinksInput: - """ - Gets the VpcLinks collection under the caller's account in a selected - region. - """ - - position: str | None = None - """The current pagination position in the paged result set.""" - - limit: int | None = None - """ - The maximum number of returned results per page. The default value is 25 - and the maximum value is 500. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_VPC_LINKS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.position is not None: - serializer.write_string( - _SCHEMA_GET_VPC_LINKS_INPUT.members["position"], self.position - ) - - if self.limit is not None: - serializer.write_integer( - _SCHEMA_GET_VPC_LINKS_INPUT.members["limit"], self.limit - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["position"] = de.read_string( - _SCHEMA_GET_VPC_LINKS_INPUT.members["position"] - ) - - case 1: - kwargs["limit"] = de.read_integer( - _SCHEMA_GET_VPC_LINKS_INPUT.members["limit"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_VPC_LINKS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class VpcLink: - """ - An API Gateway VPC link for a RestApi to access resources in an Amazon - Virtual Private Cloud (VPC). - """ - - id: str | None = None - """ - The identifier of the VpcLink. It is used in an Integration to reference - this VpcLink. - """ - - name: str | None = None - """The name used to label and identify the VPC link.""" - - description: str | None = None - """The description of the VPC link.""" - - target_arns: list[str] | None = None - """ - The ARN of the network load balancer of the VPC targeted by the VPC - link. The network load balancer must be owned by the same Amazon Web - Services account of the API owner. - """ - - status: str | None = None - """ - The status of the VPC link. The valid values are `AVAILABLE`, `PENDING`, - `DELETING`, or `FAILED`. Deploying an API will wait if the status is - `PENDING` and will fail if the status is `DELETING`. - """ - - status_message: str | None = None - """A description about the VPC link status.""" - - tags: dict[str, str] | None = None - """ - The collection of tags. Each tag element is associated with a given - resource. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VPC_LINK, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string(_SCHEMA_VPC_LINK.members["id"], self.id) - - if self.name is not None: - serializer.write_string(_SCHEMA_VPC_LINK.members["name"], self.name) - - if self.description is not None: - serializer.write_string( - _SCHEMA_VPC_LINK.members["description"], self.description - ) - - if self.target_arns is not None: - _serialize_list_of_string( - serializer, _SCHEMA_VPC_LINK.members["targetArns"], self.target_arns - ) - - if self.status is not None: - serializer.write_string(_SCHEMA_VPC_LINK.members["status"], self.status) - - if self.status_message is not None: - serializer.write_string( - _SCHEMA_VPC_LINK.members["statusMessage"], self.status_message - ) - - if self.tags is not None: - _serialize_map_of_string_to_string( - serializer, _SCHEMA_VPC_LINK.members["tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string(_SCHEMA_VPC_LINK.members["id"]) - - case 1: - kwargs["name"] = de.read_string(_SCHEMA_VPC_LINK.members["name"]) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_VPC_LINK.members["description"] - ) - - case 3: - kwargs["target_arns"] = _deserialize_list_of_string( - de, _SCHEMA_VPC_LINK.members["targetArns"] - ) - - case 4: - kwargs["status"] = VpcLinkStatus( - de.read_string(_SCHEMA_VPC_LINK.members["status"]) - ) - - case 5: - kwargs["status_message"] = de.read_string( - _SCHEMA_VPC_LINK.members["statusMessage"] - ) - - case 6: - kwargs["tags"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_VPC_LINK.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VPC_LINK, consumer=_consumer) - return kwargs - - -def _serialize_list_of_vpc_link( - serializer: ShapeSerializer, schema: Schema, value: list[VpcLink] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_list_of_vpc_link( - deserializer: ShapeDeserializer, schema: Schema -) -> list[VpcLink]: - result: list[VpcLink] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(VpcLink.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GetVpcLinksOutput: - """The collection of VPC links under the caller's account in a region.""" - - items: list[VpcLink] | None = None - """The current page of elements from this collection.""" - - position: str | None = None - """The current pagination position in the paged result set.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_VPC_LINKS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.items is not None: - _serialize_list_of_vpc_link( - serializer, _SCHEMA_GET_VPC_LINKS_OUTPUT.members["items"], self.items - ) - - if self.position is not None: - serializer.write_string( - _SCHEMA_GET_VPC_LINKS_OUTPUT.members["position"], self.position - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["items"] = _deserialize_list_of_vpc_link( - de, _SCHEMA_GET_VPC_LINKS_OUTPUT.members["items"] - ) - - case 1: - kwargs["position"] = de.read_string( - _SCHEMA_GET_VPC_LINKS_OUTPUT.members["position"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_VPC_LINKS_OUTPUT, consumer=_consumer) - return kwargs - - -GET_VPC_LINKS = APIOperation( - input=GetVpcLinksInput, - output=GetVpcLinksOutput, - schema=_SCHEMA_GET_VPC_LINKS, - input_schema=_SCHEMA_GET_VPC_LINKS_INPUT, - output_schema=_SCHEMA_GET_VPC_LINKS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ImportApiKeysInput: - """ - The POST request to import API keys from an external source, such as a - CSV-formatted file. - """ - - body: bytes | None = None - """ - The payload of the POST request to import API keys. For the payload - format, see API Key File Format. - """ - - format: str | None = None - """ - A query parameter to specify the input format to imported API keys. - Currently, only the `csv` format is supported. - """ - - fail_on_warnings: bool = False - """ - A query parameter to indicate whether to rollback ApiKey importation - (`true`) or not (`false`) when error is encountered. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IMPORT_API_KEYS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.body is not None: - serializer.write_blob( - _SCHEMA_IMPORT_API_KEYS_INPUT.members["body"], self.body - ) - - if self.format is not None: - serializer.write_string( - _SCHEMA_IMPORT_API_KEYS_INPUT.members["format"], self.format - ) - - if self.fail_on_warnings is not None: - serializer.write_boolean( - _SCHEMA_IMPORT_API_KEYS_INPUT.members["failOnWarnings"], - self.fail_on_warnings, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["body"] = de.read_blob( - _SCHEMA_IMPORT_API_KEYS_INPUT.members["body"] - ) - - case 1: - kwargs["format"] = ApiKeysFormat( - de.read_string(_SCHEMA_IMPORT_API_KEYS_INPUT.members["format"]) - ) - - case 2: - kwargs["fail_on_warnings"] = de.read_boolean( - _SCHEMA_IMPORT_API_KEYS_INPUT.members["failOnWarnings"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_IMPORT_API_KEYS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ImportApiKeysOutput: - """The identifier of an ApiKey used in a UsagePlan.""" - - ids: list[str] | None = None - """A list of all the ApiKey identifiers.""" - - warnings: list[str] | None = None - """A list of warning messages.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IMPORT_API_KEYS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.ids is not None: - _serialize_list_of_string( - serializer, _SCHEMA_IMPORT_API_KEYS_OUTPUT.members["ids"], self.ids - ) - - if self.warnings is not None: - _serialize_list_of_string( - serializer, - _SCHEMA_IMPORT_API_KEYS_OUTPUT.members["warnings"], - self.warnings, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["ids"] = _deserialize_list_of_string( - de, _SCHEMA_IMPORT_API_KEYS_OUTPUT.members["ids"] - ) - - case 1: - kwargs["warnings"] = _deserialize_list_of_string( - de, _SCHEMA_IMPORT_API_KEYS_OUTPUT.members["warnings"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_IMPORT_API_KEYS_OUTPUT, consumer=_consumer) - return kwargs - - -IMPORT_API_KEYS = APIOperation( - input=ImportApiKeysInput, - output=ImportApiKeysOutput, - schema=_SCHEMA_IMPORT_API_KEYS, - input_schema=_SCHEMA_IMPORT_API_KEYS_INPUT, - output_schema=_SCHEMA_IMPORT_API_KEYS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -class PutMode(UnknownEnumMixin, StrEnum): - MERGE = "merge" - OVERWRITE = "overwrite" - - -@dataclass(kw_only=True) -class ImportDocumentationPartsInput: - """ - Import documentation parts from an external (e.g., OpenAPI) definition - file. - """ - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - mode: str | None = None - """ - A query parameter to indicate whether to overwrite (`overwrite`) any - existing DocumentationParts definition or to merge (`merge`) the new - definition into the existing one. The default value is `merge`. - """ - - fail_on_warnings: bool = False - """ - A query parameter to specify whether to rollback the documentation - importation (`true`) or not (`false`) when a warning is encountered. The - default value is `false`. - """ - - body: bytes | None = None - """ - Raw byte array representing the to-be-imported documentation parts. To - import from an OpenAPI file, this is a JSON object. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IMPORT_DOCUMENTATION_PARTS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_IMPORT_DOCUMENTATION_PARTS_INPUT.members["restApiId"], - self.rest_api_id, - ) - - if self.mode is not None: - serializer.write_string( - _SCHEMA_IMPORT_DOCUMENTATION_PARTS_INPUT.members["mode"], self.mode - ) - - if self.fail_on_warnings is not None: - serializer.write_boolean( - _SCHEMA_IMPORT_DOCUMENTATION_PARTS_INPUT.members["failOnWarnings"], - self.fail_on_warnings, - ) - - if self.body is not None: - serializer.write_blob( - _SCHEMA_IMPORT_DOCUMENTATION_PARTS_INPUT.members["body"], self.body - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_IMPORT_DOCUMENTATION_PARTS_INPUT.members["restApiId"] - ) - - case 1: - kwargs["mode"] = PutMode( - de.read_string( - _SCHEMA_IMPORT_DOCUMENTATION_PARTS_INPUT.members["mode"] - ) - ) - - case 2: - kwargs["fail_on_warnings"] = de.read_boolean( - _SCHEMA_IMPORT_DOCUMENTATION_PARTS_INPUT.members[ - "failOnWarnings" - ] - ) - - case 3: - kwargs["body"] = de.read_blob( - _SCHEMA_IMPORT_DOCUMENTATION_PARTS_INPUT.members["body"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_IMPORT_DOCUMENTATION_PARTS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ImportDocumentationPartsOutput: - """A collection of the imported DocumentationPart identifiers.""" - - ids: list[str] | None = None - """A list of the returned documentation part identifiers.""" - - warnings: list[str] | None = None - """ - A list of warning messages reported during import of documentation - parts. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IMPORT_DOCUMENTATION_PARTS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.ids is not None: - _serialize_list_of_string( - serializer, - _SCHEMA_IMPORT_DOCUMENTATION_PARTS_OUTPUT.members["ids"], - self.ids, - ) - - if self.warnings is not None: - _serialize_list_of_string( - serializer, - _SCHEMA_IMPORT_DOCUMENTATION_PARTS_OUTPUT.members["warnings"], - self.warnings, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["ids"] = _deserialize_list_of_string( - de, _SCHEMA_IMPORT_DOCUMENTATION_PARTS_OUTPUT.members["ids"] - ) - - case 1: - kwargs["warnings"] = _deserialize_list_of_string( - de, - _SCHEMA_IMPORT_DOCUMENTATION_PARTS_OUTPUT.members["warnings"], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_IMPORT_DOCUMENTATION_PARTS_OUTPUT, consumer=_consumer - ) - return kwargs - - -IMPORT_DOCUMENTATION_PARTS = APIOperation( - input=ImportDocumentationPartsInput, - output=ImportDocumentationPartsOutput, - schema=_SCHEMA_IMPORT_DOCUMENTATION_PARTS, - input_schema=_SCHEMA_IMPORT_DOCUMENTATION_PARTS_INPUT, - output_schema=_SCHEMA_IMPORT_DOCUMENTATION_PARTS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ImportRestApiInput: - """ - A POST request to import an API to API Gateway using an input of an API - definition file. - """ - - fail_on_warnings: bool = False - """ - A query parameter to indicate whether to rollback the API creation - (`true`) or not (`false`) when a warning is encountered. The default - value is `false`. - """ - - parameters: dict[str, str] | None = None - """ - A key-value map of context-specific query string parameters specifying - the behavior of different API importing operations. The following shows - operation-specific parameters and their supported values. - - To exclude DocumentationParts from the import, set `parameters` as - `ignore=documentation`. - - To configure the endpoint type, set `parameters` as - `endpointConfigurationTypes=EDGE`, - `endpointConfigurationTypes=REGIONAL`, or - `endpointConfigurationTypes=PRIVATE`. The default endpoint type is - `EDGE`. - - To handle imported `basepath`, set `parameters` as `basepath=ignore`, - `basepath=prepend` or `basepath=split`. - """ - - body: bytes | None = None - """ - The POST request body containing external API definitions. Currently, - only OpenAPI definition JSON/YAML files are supported. The maximum size - of the API definition file is 6MB. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IMPORT_REST_API_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.fail_on_warnings is not None: - serializer.write_boolean( - _SCHEMA_IMPORT_REST_API_INPUT.members["failOnWarnings"], - self.fail_on_warnings, - ) - - if self.parameters is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_IMPORT_REST_API_INPUT.members["parameters"], - self.parameters, - ) - - if self.body is not None: - serializer.write_blob( - _SCHEMA_IMPORT_REST_API_INPUT.members["body"], self.body - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["fail_on_warnings"] = de.read_boolean( - _SCHEMA_IMPORT_REST_API_INPUT.members["failOnWarnings"] - ) - - case 1: - kwargs["parameters"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_IMPORT_REST_API_INPUT.members["parameters"] - ) - - case 2: - kwargs["body"] = de.read_blob( - _SCHEMA_IMPORT_REST_API_INPUT.members["body"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_IMPORT_REST_API_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ImportRestApiOutput: - """Represents a REST API.""" - - id: str | None = None - """ - The API's identifier. This identifier is unique across all of your APIs - in API Gateway. - """ - - name: str | None = None - """The API's name.""" - - description: str | None = None - """The API's description.""" - - created_date: datetime | None = None - """The timestamp when the API was created.""" - - version: str | None = None - """A version identifier for the API.""" - - warnings: list[str] | None = None - """ - The warning messages reported when `failonwarnings` is turned on during - API import. - """ - - binary_media_types: list[str] | None = None - """ - The list of binary media types supported by the RestApi. By default, the - RestApi supports only UTF-8-encoded text payloads. - """ - - minimum_compression_size: int | None = None - """ - A nullable integer that is used to enable compression (with non-negative - between 0 and 10485760 (10M) bytes, inclusive) or disable compression - (with a null value) on an API. When compression is enabled, compression - or decompression is not applied on the payload if the payload size is - smaller than this value. Setting it to zero allows compression for any - payload size. - """ - - api_key_source: str | None = None - """ - The source of the API key for metering requests according to a usage - plan. Valid values are: >`HEADER` to read the API key from the - `X-API-Key` header of a request. `AUTHORIZER` to read the API key from - the `UsageIdentifierKey` from a custom authorizer. - """ - - endpoint_configuration: EndpointConfiguration | None = None - """ - The endpoint configuration of this RestApi showing the endpoint types - and IP address types of the API. - """ - - policy: str | None = None - """ - A stringified JSON policy document that applies to this RestApi - regardless of the caller and Method configuration. - """ - - tags: dict[str, str] | None = None - """ - The collection of tags. Each tag element is associated with a given - resource. - """ - - disable_execute_api_endpoint: bool = False - """ - Specifies whether clients can invoke your API by using the default - `execute-api` endpoint. By default, clients can invoke your API with the - default `https://{api_id}.execute-api.{region}.amazonaws.com` endpoint. - To require that clients use a custom domain name to invoke your API, - disable the default endpoint. - """ - - root_resource_id: str | None = None - """The API's root resource ID.""" - - security_policy: str | None = None - """ - The Transport Layer Security (TLS) version + cipher suite for this - RestApi. - """ - - endpoint_access_mode: str | None = None - """The endpoint access mode of the RestApi.""" - - api_status: str | None = None - """The ApiStatus of the RestApi.""" - - api_status_message: str | None = None - """ - The status message of the RestApi. When the status message is `UPDATING` - you can still invoke it. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IMPORT_REST_API_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string( - _SCHEMA_IMPORT_REST_API_OUTPUT.members["id"], self.id - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_IMPORT_REST_API_OUTPUT.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_IMPORT_REST_API_OUTPUT.members["description"], self.description - ) - - if self.created_date is not None: - serializer.write_timestamp( - _SCHEMA_IMPORT_REST_API_OUTPUT.members["createdDate"], self.created_date - ) - - if self.version is not None: - serializer.write_string( - _SCHEMA_IMPORT_REST_API_OUTPUT.members["version"], self.version - ) - - if self.warnings is not None: - _serialize_list_of_string( - serializer, - _SCHEMA_IMPORT_REST_API_OUTPUT.members["warnings"], - self.warnings, - ) - - if self.binary_media_types is not None: - _serialize_list_of_string( - serializer, - _SCHEMA_IMPORT_REST_API_OUTPUT.members["binaryMediaTypes"], - self.binary_media_types, - ) - - if self.minimum_compression_size is not None: - serializer.write_integer( - _SCHEMA_IMPORT_REST_API_OUTPUT.members["minimumCompressionSize"], - self.minimum_compression_size, - ) - - if self.api_key_source is not None: - serializer.write_string( - _SCHEMA_IMPORT_REST_API_OUTPUT.members["apiKeySource"], - self.api_key_source, - ) - - if self.endpoint_configuration is not None: - serializer.write_struct( - _SCHEMA_IMPORT_REST_API_OUTPUT.members["endpointConfiguration"], - self.endpoint_configuration, - ) - - if self.policy is not None: - serializer.write_string( - _SCHEMA_IMPORT_REST_API_OUTPUT.members["policy"], self.policy - ) - - if self.tags is not None: - _serialize_map_of_string_to_string( - serializer, _SCHEMA_IMPORT_REST_API_OUTPUT.members["tags"], self.tags - ) - - serializer.write_boolean( - _SCHEMA_IMPORT_REST_API_OUTPUT.members["disableExecuteApiEndpoint"], - self.disable_execute_api_endpoint, - ) - if self.root_resource_id is not None: - serializer.write_string( - _SCHEMA_IMPORT_REST_API_OUTPUT.members["rootResourceId"], - self.root_resource_id, - ) - - if self.security_policy is not None: - serializer.write_string( - _SCHEMA_IMPORT_REST_API_OUTPUT.members["securityPolicy"], - self.security_policy, - ) - - if self.endpoint_access_mode is not None: - serializer.write_string( - _SCHEMA_IMPORT_REST_API_OUTPUT.members["endpointAccessMode"], - self.endpoint_access_mode, - ) - - if self.api_status is not None: - serializer.write_string( - _SCHEMA_IMPORT_REST_API_OUTPUT.members["apiStatus"], self.api_status - ) - - if self.api_status_message is not None: - serializer.write_string( - _SCHEMA_IMPORT_REST_API_OUTPUT.members["apiStatusMessage"], - self.api_status_message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_IMPORT_REST_API_OUTPUT.members["id"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_IMPORT_REST_API_OUTPUT.members["name"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_IMPORT_REST_API_OUTPUT.members["description"] - ) - - case 3: - kwargs["created_date"] = de.read_timestamp( - _SCHEMA_IMPORT_REST_API_OUTPUT.members["createdDate"] - ) - - case 4: - kwargs["version"] = de.read_string( - _SCHEMA_IMPORT_REST_API_OUTPUT.members["version"] - ) - - case 5: - kwargs["warnings"] = _deserialize_list_of_string( - de, _SCHEMA_IMPORT_REST_API_OUTPUT.members["warnings"] - ) - - case 6: - kwargs["binary_media_types"] = _deserialize_list_of_string( - de, _SCHEMA_IMPORT_REST_API_OUTPUT.members["binaryMediaTypes"] - ) - - case 7: - kwargs["minimum_compression_size"] = de.read_integer( - _SCHEMA_IMPORT_REST_API_OUTPUT.members["minimumCompressionSize"] - ) - - case 8: - kwargs["api_key_source"] = ApiKeySourceType( - de.read_string( - _SCHEMA_IMPORT_REST_API_OUTPUT.members["apiKeySource"] - ) - ) - - case 9: - kwargs["endpoint_configuration"] = ( - EndpointConfiguration.deserialize(de) - ) - - case 10: - kwargs["policy"] = de.read_string( - _SCHEMA_IMPORT_REST_API_OUTPUT.members["policy"] - ) - - case 11: - kwargs["tags"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_IMPORT_REST_API_OUTPUT.members["tags"] - ) - - case 12: - kwargs["disable_execute_api_endpoint"] = de.read_boolean( - _SCHEMA_IMPORT_REST_API_OUTPUT.members[ - "disableExecuteApiEndpoint" - ] - ) - - case 13: - kwargs["root_resource_id"] = de.read_string( - _SCHEMA_IMPORT_REST_API_OUTPUT.members["rootResourceId"] - ) - - case 14: - kwargs["security_policy"] = SecurityPolicy( - de.read_string( - _SCHEMA_IMPORT_REST_API_OUTPUT.members["securityPolicy"] - ) - ) - - case 15: - kwargs["endpoint_access_mode"] = EndpointAccessMode( - de.read_string( - _SCHEMA_IMPORT_REST_API_OUTPUT.members["endpointAccessMode"] - ) - ) - - case 16: - kwargs["api_status"] = ApiStatus( - de.read_string( - _SCHEMA_IMPORT_REST_API_OUTPUT.members["apiStatus"] - ) - ) - - case 17: - kwargs["api_status_message"] = de.read_string( - _SCHEMA_IMPORT_REST_API_OUTPUT.members["apiStatusMessage"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_IMPORT_REST_API_OUTPUT, consumer=_consumer) - return kwargs - - -IMPORT_REST_API = APIOperation( - input=ImportRestApiInput, - output=ImportRestApiOutput, - schema=_SCHEMA_IMPORT_REST_API, - input_schema=_SCHEMA_IMPORT_REST_API_INPUT, - output_schema=_SCHEMA_IMPORT_REST_API_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class PutGatewayResponseInput: - """ - Creates a customization of a GatewayResponse of a specified response - type and status code on the given RestApi. - """ - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - response_type: str | None = None - """The response type of the associated GatewayResponse""" - - status_code: str | None = None - """The HTTP status code of the GatewayResponse.""" - - response_parameters: dict[str, str] | None = None - """ - Response parameters (paths, query strings and headers) of the - GatewayResponse as a string-to-string map of key-value pairs. - """ - - response_templates: dict[str, str] | None = None - """ - Response templates of the GatewayResponse as a string-to-string map of - key-value pairs. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_GATEWAY_RESPONSE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_PUT_GATEWAY_RESPONSE_INPUT.members["restApiId"], - self.rest_api_id, - ) - - if self.response_type is not None: - serializer.write_string( - _SCHEMA_PUT_GATEWAY_RESPONSE_INPUT.members["responseType"], - self.response_type, - ) - - if self.status_code is not None: - serializer.write_string( - _SCHEMA_PUT_GATEWAY_RESPONSE_INPUT.members["statusCode"], - self.status_code, - ) - - if self.response_parameters is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_PUT_GATEWAY_RESPONSE_INPUT.members["responseParameters"], - self.response_parameters, - ) - - if self.response_templates is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_PUT_GATEWAY_RESPONSE_INPUT.members["responseTemplates"], - self.response_templates, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_PUT_GATEWAY_RESPONSE_INPUT.members["restApiId"] - ) - - case 1: - kwargs["response_type"] = GatewayResponseType( - de.read_string( - _SCHEMA_PUT_GATEWAY_RESPONSE_INPUT.members["responseType"] - ) - ) - - case 2: - kwargs["status_code"] = de.read_string( - _SCHEMA_PUT_GATEWAY_RESPONSE_INPUT.members["statusCode"] - ) - - case 3: - kwargs["response_parameters"] = ( - _deserialize_map_of_string_to_string( - de, - _SCHEMA_PUT_GATEWAY_RESPONSE_INPUT.members[ - "responseParameters" - ], - ) - ) - - case 4: - kwargs["response_templates"] = _deserialize_map_of_string_to_string( - de, - _SCHEMA_PUT_GATEWAY_RESPONSE_INPUT.members["responseTemplates"], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUT_GATEWAY_RESPONSE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class PutGatewayResponseOutput: - """ - A gateway response of a given response type and status code, with - optional response parameters and mapping templates. - """ - - response_type: str | None = None - """The response type of the associated GatewayResponse.""" - - status_code: str | None = None - """The HTTP status code for this GatewayResponse.""" - - response_parameters: dict[str, str] | None = None - """ - Response parameters (paths, query strings and headers) of the - GatewayResponse as a string-to-string map of key-value pairs. - """ - - response_templates: dict[str, str] | None = None - """ - Response templates of the GatewayResponse as a string-to-string map of - key-value pairs. - """ - - default_response: bool = False - """ - A Boolean flag to indicate whether this GatewayResponse is the default - gateway response (`true`) or not (`false`). A default gateway response - is one generated by API Gateway without any customization by an API - developer. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_GATEWAY_RESPONSE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.response_type is not None: - serializer.write_string( - _SCHEMA_PUT_GATEWAY_RESPONSE_OUTPUT.members["responseType"], - self.response_type, - ) - - if self.status_code is not None: - serializer.write_string( - _SCHEMA_PUT_GATEWAY_RESPONSE_OUTPUT.members["statusCode"], - self.status_code, - ) - - if self.response_parameters is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_PUT_GATEWAY_RESPONSE_OUTPUT.members["responseParameters"], - self.response_parameters, - ) - - if self.response_templates is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_PUT_GATEWAY_RESPONSE_OUTPUT.members["responseTemplates"], - self.response_templates, - ) - - serializer.write_boolean( - _SCHEMA_PUT_GATEWAY_RESPONSE_OUTPUT.members["defaultResponse"], - self.default_response, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["response_type"] = GatewayResponseType( - de.read_string( - _SCHEMA_PUT_GATEWAY_RESPONSE_OUTPUT.members["responseType"] - ) - ) - - case 1: - kwargs["status_code"] = de.read_string( - _SCHEMA_PUT_GATEWAY_RESPONSE_OUTPUT.members["statusCode"] - ) - - case 2: - kwargs["response_parameters"] = ( - _deserialize_map_of_string_to_string( - de, - _SCHEMA_PUT_GATEWAY_RESPONSE_OUTPUT.members[ - "responseParameters" - ], - ) - ) - - case 3: - kwargs["response_templates"] = _deserialize_map_of_string_to_string( - de, - _SCHEMA_PUT_GATEWAY_RESPONSE_OUTPUT.members[ - "responseTemplates" - ], - ) - - case 4: - kwargs["default_response"] = de.read_boolean( - _SCHEMA_PUT_GATEWAY_RESPONSE_OUTPUT.members["defaultResponse"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PUT_GATEWAY_RESPONSE_OUTPUT, consumer=_consumer - ) - return kwargs - - -PUT_GATEWAY_RESPONSE = APIOperation( - input=PutGatewayResponseInput, - output=PutGatewayResponseOutput, - schema=_SCHEMA_PUT_GATEWAY_RESPONSE, - input_schema=_SCHEMA_PUT_GATEWAY_RESPONSE_INPUT, - output_schema=_SCHEMA_PUT_GATEWAY_RESPONSE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class PutIntegrationInput: - """Sets up a method's integration.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - resource_id: str | None = None - """Specifies a put integration request's resource ID.""" - - http_method: str | None = None - """Specifies the HTTP method for the integration.""" - - type: str | None = None - """Specifies a put integration input's type.""" - - integration_http_method: str | None = None - """The HTTP method for the integration.""" - - uri: str | None = None - """ - Specifies Uniform Resource Identifier (URI) of the integration endpoint. - For HTTP or `HTTP_PROXY` integrations, the URI must be a fully formed, - encoded HTTP(S) URL according to the RFC-3986 specification, for either - standard integration, where `connectionType` is not `VPC_LINK`, or - private integration, where `connectionType` is `VPC_LINK`. For a private - HTTP integration, the URI is not used for routing. For `AWS` or - `AWS_PROXY` integrations, the URI is of the form - `arn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api`}. - Here, {Region} is the API Gateway region (e.g., us-east-1); {service} is - the name of the integrated Amazon Web Services service (e.g., s3); and - {subdomain} is a designated subdomain supported by certain Amazon Web - Services service for fast host-name lookup. action can be used for an - Amazon Web Services service action-based API, using an - Action={name}&{p1}={v1}&p2={v2}... query string. The ensuing - {service_api} refers to a supported action {name} plus any required - input parameters. Alternatively, path can be used for an Amazon Web - Services service path-based API. The ensuing service_api refers to the - path to an Amazon Web Services service resource, including the region of - the integrated Amazon Web Services service, if applicable. For example, - for integration with the S3 API of `GetObject`, the `uri` can be either - `arn:aws:apigateway:us-west-2:s3:action/GetObject&Bucket={bucket}&Key={key}` - or `arn:aws:apigateway:us-west-2:s3:path/{bucket}/{key}`. - """ - - connection_type: str | None = None - """ - The type of the network connection to the integration endpoint. The - valid value is `INTERNET` for connections through the public routable - internet or `VPC_LINK` for private connections between API Gateway and a - network load balancer in a VPC. The default value is `INTERNET`. - """ - - connection_id: str | None = None - """ - The ID of the VpcLink used for the integration. Specify this value only - if you specify `VPC_LINK` as the connection type. - """ - - credentials: str | None = None - """Specifies whether credentials are required for a put integration.""" - - request_parameters: dict[str, str] | None = None - """ - A key-value map specifying request parameters that are passed from the - method request to the back end. The key is an integration request - parameter name and the associated value is a method request parameter - value or static value that must be enclosed within single quotes and - pre-encoded as required by the back end. The method request parameter - value must match the pattern of `method.request.{location}.{name}`, - where `location` is `querystring`, `path`, or `header` and `name` must - be a valid and unique method request parameter name. - """ - - request_templates: dict[str, str] | None = None - """ - Represents a map of Velocity templates that are applied on the request - payload based on the value of the Content-Type header sent by the - client. The content type value is the key in this map, and the template - (as a String) is the value. - """ - - passthrough_behavior: str | None = None - """ - Specifies the pass-through behavior for incoming requests based on the - Content-Type header in the request, and the available mapping templates - specified as the `requestTemplates` property on the Integration - resource. There are three valid values: `WHEN_NO_MATCH`, - `WHEN_NO_TEMPLATES`, and `NEVER`. - """ - - cache_namespace: str | None = None - """ - Specifies a group of related cached parameters. By default, API Gateway - uses the resource ID as the `cacheNamespace`. You can specify the same - `cacheNamespace` across resources to return the same cached data for - requests to different resources. - """ - - cache_key_parameters: list[str] | None = None - """ - A list of request parameters whose values API Gateway caches. To be - valid values for `cacheKeyParameters`, these parameters must also be - specified for Method `requestParameters`. - """ - - content_handling: str | None = None - """ - Specifies how to handle request payload content type conversions. - Supported values are `CONVERT_TO_BINARY` and `CONVERT_TO_TEXT`, with the - following behaviors: - - If this property is not defined, the request payload will be passed - through from the method request to integration request without - modification, provided that the `passthroughBehavior` is configured to - support payload pass-through. - """ - - timeout_in_millis: int | None = None - """ - Custom timeout between 50 and 29,000 milliseconds. The default value is - 29,000 milliseconds or 29 seconds. You can increase the default value to - longer than 29 seconds for Regional or private APIs only. - """ - - tls_config: TlsConfig | None = None - """Specifies the TLS configuration for an integration.""" - - response_transfer_mode: str | None = None - """The response transfer mode of the integration.""" - - integration_target: str | None = None - """The ALB or NLB listener to send the request to.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_INTEGRATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_PUT_INTEGRATION_INPUT.members["restApiId"], self.rest_api_id - ) - - if self.resource_id is not None: - serializer.write_string( - _SCHEMA_PUT_INTEGRATION_INPUT.members["resourceId"], self.resource_id - ) - - if self.http_method is not None: - serializer.write_string( - _SCHEMA_PUT_INTEGRATION_INPUT.members["httpMethod"], self.http_method - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_PUT_INTEGRATION_INPUT.members["type"], self.type - ) - - if self.integration_http_method is not None: - serializer.write_string( - _SCHEMA_PUT_INTEGRATION_INPUT.members["integrationHttpMethod"], - self.integration_http_method, - ) - - if self.uri is not None: - serializer.write_string( - _SCHEMA_PUT_INTEGRATION_INPUT.members["uri"], self.uri - ) - - if self.connection_type is not None: - serializer.write_string( - _SCHEMA_PUT_INTEGRATION_INPUT.members["connectionType"], - self.connection_type, - ) - - if self.connection_id is not None: - serializer.write_string( - _SCHEMA_PUT_INTEGRATION_INPUT.members["connectionId"], - self.connection_id, - ) - - if self.credentials is not None: - serializer.write_string( - _SCHEMA_PUT_INTEGRATION_INPUT.members["credentials"], self.credentials - ) - - if self.request_parameters is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_PUT_INTEGRATION_INPUT.members["requestParameters"], - self.request_parameters, - ) - - if self.request_templates is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_PUT_INTEGRATION_INPUT.members["requestTemplates"], - self.request_templates, - ) - - if self.passthrough_behavior is not None: - serializer.write_string( - _SCHEMA_PUT_INTEGRATION_INPUT.members["passthroughBehavior"], - self.passthrough_behavior, - ) - - if self.cache_namespace is not None: - serializer.write_string( - _SCHEMA_PUT_INTEGRATION_INPUT.members["cacheNamespace"], - self.cache_namespace, - ) - - if self.cache_key_parameters is not None: - _serialize_list_of_string( - serializer, - _SCHEMA_PUT_INTEGRATION_INPUT.members["cacheKeyParameters"], - self.cache_key_parameters, - ) - - if self.content_handling is not None: - serializer.write_string( - _SCHEMA_PUT_INTEGRATION_INPUT.members["contentHandling"], - self.content_handling, - ) - - if self.timeout_in_millis is not None: - serializer.write_integer( - _SCHEMA_PUT_INTEGRATION_INPUT.members["timeoutInMillis"], - self.timeout_in_millis, - ) - - if self.tls_config is not None: - serializer.write_struct( - _SCHEMA_PUT_INTEGRATION_INPUT.members["tlsConfig"], self.tls_config - ) - - if self.response_transfer_mode is not None: - serializer.write_string( - _SCHEMA_PUT_INTEGRATION_INPUT.members["responseTransferMode"], - self.response_transfer_mode, - ) - - if self.integration_target is not None: - serializer.write_string( - _SCHEMA_PUT_INTEGRATION_INPUT.members["integrationTarget"], - self.integration_target, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_PUT_INTEGRATION_INPUT.members["restApiId"] - ) - - case 1: - kwargs["resource_id"] = de.read_string( - _SCHEMA_PUT_INTEGRATION_INPUT.members["resourceId"] - ) - - case 2: - kwargs["http_method"] = de.read_string( - _SCHEMA_PUT_INTEGRATION_INPUT.members["httpMethod"] - ) - - case 3: - kwargs["type"] = IntegrationType( - de.read_string(_SCHEMA_PUT_INTEGRATION_INPUT.members["type"]) - ) - - case 4: - kwargs["integration_http_method"] = de.read_string( - _SCHEMA_PUT_INTEGRATION_INPUT.members["integrationHttpMethod"] - ) - - case 5: - kwargs["uri"] = de.read_string( - _SCHEMA_PUT_INTEGRATION_INPUT.members["uri"] - ) - - case 6: - kwargs["connection_type"] = ConnectionType( - de.read_string( - _SCHEMA_PUT_INTEGRATION_INPUT.members["connectionType"] - ) - ) - - case 7: - kwargs["connection_id"] = de.read_string( - _SCHEMA_PUT_INTEGRATION_INPUT.members["connectionId"] - ) - - case 8: - kwargs["credentials"] = de.read_string( - _SCHEMA_PUT_INTEGRATION_INPUT.members["credentials"] - ) - - case 9: - kwargs["request_parameters"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_PUT_INTEGRATION_INPUT.members["requestParameters"] - ) - - case 10: - kwargs["request_templates"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_PUT_INTEGRATION_INPUT.members["requestTemplates"] - ) - - case 11: - kwargs["passthrough_behavior"] = de.read_string( - _SCHEMA_PUT_INTEGRATION_INPUT.members["passthroughBehavior"] - ) - - case 12: - kwargs["cache_namespace"] = de.read_string( - _SCHEMA_PUT_INTEGRATION_INPUT.members["cacheNamespace"] - ) - - case 13: - kwargs["cache_key_parameters"] = _deserialize_list_of_string( - de, _SCHEMA_PUT_INTEGRATION_INPUT.members["cacheKeyParameters"] - ) - - case 14: - kwargs["content_handling"] = ContentHandlingStrategy( - de.read_string( - _SCHEMA_PUT_INTEGRATION_INPUT.members["contentHandling"] - ) - ) - - case 15: - kwargs["timeout_in_millis"] = de.read_integer( - _SCHEMA_PUT_INTEGRATION_INPUT.members["timeoutInMillis"] - ) - - case 16: - kwargs["tls_config"] = TlsConfig.deserialize(de) - - case 17: - kwargs["response_transfer_mode"] = ResponseTransferMode( - de.read_string( - _SCHEMA_PUT_INTEGRATION_INPUT.members[ - "responseTransferMode" - ] - ) - ) - - case 18: - kwargs["integration_target"] = de.read_string( - _SCHEMA_PUT_INTEGRATION_INPUT.members["integrationTarget"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUT_INTEGRATION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class PutIntegrationOutput: - """ - Represents an `HTTP`, `HTTP_PROXY`, `AWS`, `AWS_PROXY`, or Mock - integration. - """ - - type: str | None = None - """ - Specifies an API method integration type. The valid value is one of the - following: - - For the HTTP and HTTP proxy integrations, each integration can specify a - protocol (`http/https`), port and path. Standard 80 and 443 ports are - supported as well as custom ports above 1024. An HTTP or HTTP proxy - integration with a `connectionType` of `VPC_LINK` is referred to as a - private integration and uses a VpcLink to connect API Gateway to a - network load balancer of a VPC. - """ - - http_method: str | None = None - """ - Specifies the integration's HTTP method type. For the Type property, if - you specify `MOCK`, this property is optional. For Lambda integrations, - you must set the integration method to `POST`. For all other types, you - must specify this property. - """ - - uri: str | None = None - """ - Specifies Uniform Resource Identifier (URI) of the integration endpoint. - - For `HTTP` or `HTTP_PROXY` integrations, the URI must be a fully formed, - encoded HTTP(S) URL according to the RFC-3986 specification for standard - integrations. If `connectionType` is `VPC_LINK` specify the Network Load - Balancer DNS name. For `AWS` or `AWS_PROXY` integrations, the URI is of - the form - `arn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api}`. - Here, {Region} is the API Gateway region (e.g., us-east-1); {service} is - the name of the integrated Amazon Web Services service (e.g., s3); and - {subdomain} is a designated subdomain supported by certain Amazon Web - Services service for fast host-name lookup. action can be used for an - Amazon Web Services service action-based API, using an - Action={name}&{p1}={v1}&p2={v2}... query string. The ensuing - {service_api} refers to a supported action {name} plus any required - input parameters. Alternatively, path can be used for an Amazon Web - Services service path-based API. The ensuing service_api refers to the - path to an Amazon Web Services service resource, including the region of - the integrated Amazon Web Services service, if applicable. For example, - for integration with the S3 API of GetObject, the uri can be either - `arn:aws:apigateway:us-west-2:s3:action/GetObject&Bucket={bucket}&Key={key}` - or `arn:aws:apigateway:us-west-2:s3:path/{bucket}/{key}` - """ - - connection_type: str | None = None - """ - The type of the network connection to the integration endpoint. The - valid value is `INTERNET` for connections through the public routable - internet or `VPC_LINK` for private connections between API Gateway and a - network load balancer in a VPC. The default value is `INTERNET`. - """ - - connection_id: str | None = None - """ - The ID of the VpcLink used for the integration when - `connectionType=VPC_LINK` and undefined, otherwise. - """ - - credentials: str | None = None - """ - Specifies the credentials required for the integration, if any. For AWS - integrations, three options are available. To specify an IAM Role for - API Gateway to assume, use the role's Amazon Resource Name (ARN). To - require that the caller's identity be passed through from the request, - specify the string `arn:aws:iam::*:user/*`. To use resource-based - permissions on supported Amazon Web Services services, specify null. - """ - - request_parameters: dict[str, str] | None = None - """ - A key-value map specifying request parameters that are passed from the - method request to the back end. The key is an integration request - parameter name and the associated value is a method request parameter - value or static value that must be enclosed within single quotes and - pre-encoded as required by the back end. The method request parameter - value must match the pattern of `method.request.{location}.{name}`, - where `location` is `querystring`, `path`, or `header` and `name` must - be a valid and unique method request parameter name. - """ - - request_templates: dict[str, str] | None = None - """ - Represents a map of Velocity templates that are applied on the request - payload based on the value of the Content-Type header sent by the - client. The content type value is the key in this map, and the template - (as a String) is the value. - """ - - passthrough_behavior: str | None = None - """ - Specifies how the method request body of an unmapped content type will - be passed through the integration request to the back end without - transformation. A content type is unmapped if no mapping template is - defined in the integration or the content type does not match any of the - mapped content types, as specified in `requestTemplates`. The valid - value is one of the following: `WHEN_NO_MATCH`: passes the method - request body through the integration request to the back end without - transformation when the method request content type does not match any - content type associated with the mapping templates defined in the - integration request. `WHEN_NO_TEMPLATES`: passes the method request body - through the integration request to the back end without transformation - when no mapping template is defined in the integration request. If a - template is defined when this option is selected, the method request of - an unmapped content-type will be rejected with an HTTP 415 Unsupported - Media Type response. `NEVER`: rejects the method request with an HTTP - 415 Unsupported Media Type response when either the method request - content type does not match any content type associated with the mapping - templates defined in the integration request or no mapping template is - defined in the integration request. - """ - - content_handling: str | None = None - """ - Specifies how to handle request payload content type conversions. - Supported values are `CONVERT_TO_BINARY` and `CONVERT_TO_TEXT`, with the - following behaviors: - - If this property is not defined, the request payload will be passed - through from the method request to integration request without - modification, provided that the `passthroughBehavior` is configured to - support payload pass-through. - """ - - timeout_in_millis: int = 0 - """ - Custom timeout between 50 and 29,000 milliseconds. The default value is - 29,000 milliseconds or 29 seconds. You can increase the default value to - longer than 29 seconds for Regional or private APIs only. - """ - - cache_namespace: str | None = None - """ - Specifies a group of related cached parameters. By default, API Gateway - uses the resource ID as the `cacheNamespace`. You can specify the same - `cacheNamespace` across resources to return the same cached data for - requests to different resources. - """ - - cache_key_parameters: list[str] | None = None - """ - A list of request parameters whose values API Gateway caches. To be - valid values for `cacheKeyParameters`, these parameters must also be - specified for Method `requestParameters`. - """ - - integration_responses: dict[str, IntegrationResponse] | None = None - """Specifies the integration's responses.""" - - tls_config: TlsConfig | None = None - """Specifies the TLS configuration for an integration.""" - - response_transfer_mode: str | None = None - """The response transfer mode of the integration.""" - - integration_target: str | None = None - """The ALB or NLB listener to send the request to.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_INTEGRATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_PUT_INTEGRATION_OUTPUT.members["type"], self.type - ) - - if self.http_method is not None: - serializer.write_string( - _SCHEMA_PUT_INTEGRATION_OUTPUT.members["httpMethod"], self.http_method - ) - - if self.uri is not None: - serializer.write_string( - _SCHEMA_PUT_INTEGRATION_OUTPUT.members["uri"], self.uri - ) - - if self.connection_type is not None: - serializer.write_string( - _SCHEMA_PUT_INTEGRATION_OUTPUT.members["connectionType"], - self.connection_type, - ) - - if self.connection_id is not None: - serializer.write_string( - _SCHEMA_PUT_INTEGRATION_OUTPUT.members["connectionId"], - self.connection_id, - ) - - if self.credentials is not None: - serializer.write_string( - _SCHEMA_PUT_INTEGRATION_OUTPUT.members["credentials"], self.credentials - ) - - if self.request_parameters is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_PUT_INTEGRATION_OUTPUT.members["requestParameters"], - self.request_parameters, - ) - - if self.request_templates is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_PUT_INTEGRATION_OUTPUT.members["requestTemplates"], - self.request_templates, - ) - - if self.passthrough_behavior is not None: - serializer.write_string( - _SCHEMA_PUT_INTEGRATION_OUTPUT.members["passthroughBehavior"], - self.passthrough_behavior, - ) - - if self.content_handling is not None: - serializer.write_string( - _SCHEMA_PUT_INTEGRATION_OUTPUT.members["contentHandling"], - self.content_handling, - ) - - serializer.write_integer( - _SCHEMA_PUT_INTEGRATION_OUTPUT.members["timeoutInMillis"], - self.timeout_in_millis, - ) - if self.cache_namespace is not None: - serializer.write_string( - _SCHEMA_PUT_INTEGRATION_OUTPUT.members["cacheNamespace"], - self.cache_namespace, - ) - - if self.cache_key_parameters is not None: - _serialize_list_of_string( - serializer, - _SCHEMA_PUT_INTEGRATION_OUTPUT.members["cacheKeyParameters"], - self.cache_key_parameters, - ) - - if self.integration_responses is not None: - _serialize_map_of_integration_response( - serializer, - _SCHEMA_PUT_INTEGRATION_OUTPUT.members["integrationResponses"], - self.integration_responses, - ) - - if self.tls_config is not None: - serializer.write_struct( - _SCHEMA_PUT_INTEGRATION_OUTPUT.members["tlsConfig"], self.tls_config - ) - - if self.response_transfer_mode is not None: - serializer.write_string( - _SCHEMA_PUT_INTEGRATION_OUTPUT.members["responseTransferMode"], - self.response_transfer_mode, - ) - - if self.integration_target is not None: - serializer.write_string( - _SCHEMA_PUT_INTEGRATION_OUTPUT.members["integrationTarget"], - self.integration_target, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = IntegrationType( - de.read_string(_SCHEMA_PUT_INTEGRATION_OUTPUT.members["type"]) - ) - - case 1: - kwargs["http_method"] = de.read_string( - _SCHEMA_PUT_INTEGRATION_OUTPUT.members["httpMethod"] - ) - - case 2: - kwargs["uri"] = de.read_string( - _SCHEMA_PUT_INTEGRATION_OUTPUT.members["uri"] - ) - - case 3: - kwargs["connection_type"] = ConnectionType( - de.read_string( - _SCHEMA_PUT_INTEGRATION_OUTPUT.members["connectionType"] - ) - ) - - case 4: - kwargs["connection_id"] = de.read_string( - _SCHEMA_PUT_INTEGRATION_OUTPUT.members["connectionId"] - ) - - case 5: - kwargs["credentials"] = de.read_string( - _SCHEMA_PUT_INTEGRATION_OUTPUT.members["credentials"] - ) - - case 6: - kwargs["request_parameters"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_PUT_INTEGRATION_OUTPUT.members["requestParameters"] - ) - - case 7: - kwargs["request_templates"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_PUT_INTEGRATION_OUTPUT.members["requestTemplates"] - ) - - case 8: - kwargs["passthrough_behavior"] = de.read_string( - _SCHEMA_PUT_INTEGRATION_OUTPUT.members["passthroughBehavior"] - ) - - case 9: - kwargs["content_handling"] = ContentHandlingStrategy( - de.read_string( - _SCHEMA_PUT_INTEGRATION_OUTPUT.members["contentHandling"] - ) - ) - - case 10: - kwargs["timeout_in_millis"] = de.read_integer( - _SCHEMA_PUT_INTEGRATION_OUTPUT.members["timeoutInMillis"] - ) - - case 11: - kwargs["cache_namespace"] = de.read_string( - _SCHEMA_PUT_INTEGRATION_OUTPUT.members["cacheNamespace"] - ) - - case 12: - kwargs["cache_key_parameters"] = _deserialize_list_of_string( - de, _SCHEMA_PUT_INTEGRATION_OUTPUT.members["cacheKeyParameters"] - ) - - case 13: - kwargs["integration_responses"] = ( - _deserialize_map_of_integration_response( - de, - _SCHEMA_PUT_INTEGRATION_OUTPUT.members[ - "integrationResponses" - ], - ) - ) - - case 14: - kwargs["tls_config"] = TlsConfig.deserialize(de) - - case 15: - kwargs["response_transfer_mode"] = ResponseTransferMode( - de.read_string( - _SCHEMA_PUT_INTEGRATION_OUTPUT.members[ - "responseTransferMode" - ] - ) - ) - - case 16: - kwargs["integration_target"] = de.read_string( - _SCHEMA_PUT_INTEGRATION_OUTPUT.members["integrationTarget"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUT_INTEGRATION_OUTPUT, consumer=_consumer) - return kwargs - - -PUT_INTEGRATION = APIOperation( - input=PutIntegrationInput, - output=PutIntegrationOutput, - schema=_SCHEMA_PUT_INTEGRATION, - input_schema=_SCHEMA_PUT_INTEGRATION_INPUT, - output_schema=_SCHEMA_PUT_INTEGRATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class PutIntegrationResponseInput: - """Represents a put integration response request.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - resource_id: str | None = None - """Specifies a put integration response request's resource identifier.""" - - http_method: str | None = None - """Specifies a put integration response request's HTTP method.""" - - status_code: str | None = None - """ - Specifies the status code that is used to map the integration response - to an existing MethodResponse. - """ - - selection_pattern: str | None = None - """Specifies the selection pattern of a put integration response.""" - - response_parameters: dict[str, str] | None = None - """ - A key-value map specifying response parameters that are passed to the - method response from the back end. The key is a method response header - parameter name and the mapped value is an integration response header - value, a static value enclosed within a pair of single quotes, or a JSON - expression from the integration response body. The mapping key must - match the pattern of `method.response.header.{name}`, where `name` is a - valid and unique header name. The mapped non-static value must match the - pattern of `integration.response.header.{name}` or - `integration.response.body.{JSON-expression}`, where `name` must be a - valid and unique response header name and `JSON-expression` a valid JSON - expression without the `$` prefix. - """ - - response_templates: dict[str, str] | None = None - """Specifies a put integration response's templates.""" - - content_handling: str | None = None - """ - Specifies how to handle response payload content type conversions. - Supported values are `CONVERT_TO_BINARY` and `CONVERT_TO_TEXT`, with the - following behaviors: - - If this property is not defined, the response payload will be passed - through from the integration response to the method response without - modification. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_INTEGRATION_RESPONSE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_PUT_INTEGRATION_RESPONSE_INPUT.members["restApiId"], - self.rest_api_id, - ) - - if self.resource_id is not None: - serializer.write_string( - _SCHEMA_PUT_INTEGRATION_RESPONSE_INPUT.members["resourceId"], - self.resource_id, - ) - - if self.http_method is not None: - serializer.write_string( - _SCHEMA_PUT_INTEGRATION_RESPONSE_INPUT.members["httpMethod"], - self.http_method, - ) - - if self.status_code is not None: - serializer.write_string( - _SCHEMA_PUT_INTEGRATION_RESPONSE_INPUT.members["statusCode"], - self.status_code, - ) - - if self.selection_pattern is not None: - serializer.write_string( - _SCHEMA_PUT_INTEGRATION_RESPONSE_INPUT.members["selectionPattern"], - self.selection_pattern, - ) - - if self.response_parameters is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_PUT_INTEGRATION_RESPONSE_INPUT.members["responseParameters"], - self.response_parameters, - ) - - if self.response_templates is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_PUT_INTEGRATION_RESPONSE_INPUT.members["responseTemplates"], - self.response_templates, - ) - - if self.content_handling is not None: - serializer.write_string( - _SCHEMA_PUT_INTEGRATION_RESPONSE_INPUT.members["contentHandling"], - self.content_handling, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_PUT_INTEGRATION_RESPONSE_INPUT.members["restApiId"] - ) - - case 1: - kwargs["resource_id"] = de.read_string( - _SCHEMA_PUT_INTEGRATION_RESPONSE_INPUT.members["resourceId"] - ) - - case 2: - kwargs["http_method"] = de.read_string( - _SCHEMA_PUT_INTEGRATION_RESPONSE_INPUT.members["httpMethod"] - ) - - case 3: - kwargs["status_code"] = de.read_string( - _SCHEMA_PUT_INTEGRATION_RESPONSE_INPUT.members["statusCode"] - ) - - case 4: - kwargs["selection_pattern"] = de.read_string( - _SCHEMA_PUT_INTEGRATION_RESPONSE_INPUT.members[ - "selectionPattern" - ] - ) - - case 5: - kwargs["response_parameters"] = ( - _deserialize_map_of_string_to_string( - de, - _SCHEMA_PUT_INTEGRATION_RESPONSE_INPUT.members[ - "responseParameters" - ], - ) - ) - - case 6: - kwargs["response_templates"] = _deserialize_map_of_string_to_string( - de, - _SCHEMA_PUT_INTEGRATION_RESPONSE_INPUT.members[ - "responseTemplates" - ], - ) - - case 7: - kwargs["content_handling"] = ContentHandlingStrategy( - de.read_string( - _SCHEMA_PUT_INTEGRATION_RESPONSE_INPUT.members[ - "contentHandling" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PUT_INTEGRATION_RESPONSE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class PutIntegrationResponseOutput: - """ - Represents an integration response. The status code must map to an - existing MethodResponse, and parameters and templates can be used to - transform the back-end response. - """ - - status_code: str | None = None - """ - Specifies the status code that is used to map the integration response - to an existing MethodResponse. - """ - - selection_pattern: str | None = None - """ - Specifies the regular expression (regex) pattern used to choose an - integration response based on the response from the back end. For - example, if the success response returns nothing and the error response - returns some string, you could use the `.+` regex to match error - response. However, make sure that the error response does not contain - any newline (`\n`) character in such cases. If the back end is an Lambda - function, the Lambda function error header is matched. For all other - HTTP and Amazon Web Services back ends, the HTTP status code is matched. - """ - - response_parameters: dict[str, str] | None = None - """ - A key-value map specifying response parameters that are passed to the - method response from the back end. The key is a method response header - parameter name and the mapped value is an integration response header - value, a static value enclosed within a pair of single quotes, or a JSON - expression from the integration response body. The mapping key must - match the pattern of `method.response.header.{name}`, where `name` is a - valid and unique header name. The mapped non-static value must match the - pattern of `integration.response.header.{name}` or - `integration.response.body.{JSON-expression}`, where `name` is a valid - and unique response header name and `JSON-expression` is a valid JSON - expression without the `$` prefix. - """ - - response_templates: dict[str, str] | None = None - """ - Specifies the templates used to transform the integration response body. - Response templates are represented as a key/value map, with a - content-type as the key and a template as the value. - """ - - content_handling: str | None = None - """ - Specifies how to handle response payload content type conversions. - Supported values are `CONVERT_TO_BINARY` and `CONVERT_TO_TEXT`, with the - following behaviors: - - If this property is not defined, the response payload will be passed - through from the integration response to the method response without - modification. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_INTEGRATION_RESPONSE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.status_code is not None: - serializer.write_string( - _SCHEMA_PUT_INTEGRATION_RESPONSE_OUTPUT.members["statusCode"], - self.status_code, - ) - - if self.selection_pattern is not None: - serializer.write_string( - _SCHEMA_PUT_INTEGRATION_RESPONSE_OUTPUT.members["selectionPattern"], - self.selection_pattern, - ) - - if self.response_parameters is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_PUT_INTEGRATION_RESPONSE_OUTPUT.members["responseParameters"], - self.response_parameters, - ) - - if self.response_templates is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_PUT_INTEGRATION_RESPONSE_OUTPUT.members["responseTemplates"], - self.response_templates, - ) - - if self.content_handling is not None: - serializer.write_string( - _SCHEMA_PUT_INTEGRATION_RESPONSE_OUTPUT.members["contentHandling"], - self.content_handling, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["status_code"] = de.read_string( - _SCHEMA_PUT_INTEGRATION_RESPONSE_OUTPUT.members["statusCode"] - ) - - case 1: - kwargs["selection_pattern"] = de.read_string( - _SCHEMA_PUT_INTEGRATION_RESPONSE_OUTPUT.members[ - "selectionPattern" - ] - ) - - case 2: - kwargs["response_parameters"] = ( - _deserialize_map_of_string_to_string( - de, - _SCHEMA_PUT_INTEGRATION_RESPONSE_OUTPUT.members[ - "responseParameters" - ], - ) - ) - - case 3: - kwargs["response_templates"] = _deserialize_map_of_string_to_string( - de, - _SCHEMA_PUT_INTEGRATION_RESPONSE_OUTPUT.members[ - "responseTemplates" - ], - ) - - case 4: - kwargs["content_handling"] = ContentHandlingStrategy( - de.read_string( - _SCHEMA_PUT_INTEGRATION_RESPONSE_OUTPUT.members[ - "contentHandling" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PUT_INTEGRATION_RESPONSE_OUTPUT, consumer=_consumer - ) - return kwargs - - -PUT_INTEGRATION_RESPONSE = APIOperation( - input=PutIntegrationResponseInput, - output=PutIntegrationResponseOutput, - schema=_SCHEMA_PUT_INTEGRATION_RESPONSE, - input_schema=_SCHEMA_PUT_INTEGRATION_RESPONSE_INPUT, - output_schema=_SCHEMA_PUT_INTEGRATION_RESPONSE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class PutMethodInput: - """Request to add a method to an existing Resource resource.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - resource_id: str | None = None - """The Resource identifier for the new Method resource.""" - - http_method: str | None = None - """Specifies the method request's HTTP method type.""" - - authorization_type: str | None = None - """ - The method's authorization type. Valid values are `NONE` for open - access, `AWS_IAM` for using AWS IAM permissions, `CUSTOM` for using a - custom authorizer, or `COGNITO_USER_POOLS` for using a Cognito user - pool. - """ - - authorizer_id: str | None = None - """ - Specifies the identifier of an Authorizer to use on this Method, if the - type is CUSTOM or COGNITO_USER_POOLS. The authorizer identifier is - generated by API Gateway when you created the authorizer. - """ - - api_key_required: bool = False - """Specifies whether the method required a valid ApiKey.""" - - operation_name: str | None = None - """ - A human-friendly operation identifier for the method. For example, you - can assign the `operationName` of `ListPets` for the `GET /pets` method - in the `PetStore` example. - """ - - request_parameters: dict[str, bool] | None = None - """ - A key-value map defining required or optional method request parameters - that can be accepted by API Gateway. A key defines a method request - parameter name matching the pattern of - `method.request.{location}.{name}`, where `location` is `querystring`, - `path`, or `header` and `name` is a valid and unique parameter name. The - value associated with the key is a Boolean flag indicating whether the - parameter is required (`true`) or optional (`false`). The method request - parameter names defined here are available in Integration to be mapped - to integration request parameters or body-mapping templates. - """ - - request_models: dict[str, str] | None = None - """ - Specifies the Model resources used for the request's content type. - Request models are represented as a key/value map, with a content type - as the key and a Model name as the value. - """ - - request_validator_id: str | None = None - """The identifier of a RequestValidator for validating the method request.""" - - authorization_scopes: list[str] | None = None - """ - A list of authorization scopes configured on the method. The scopes are - used with a `COGNITO_USER_POOLS` authorizer to authorize the method - invocation. The authorization works by matching the method scopes - against the scopes parsed from the access token in the incoming request. - The method invocation is authorized if any method scopes matches a - claimed scope in the access token. Otherwise, the invocation is not - authorized. When the method scope is configured, the client must provide - an access token instead of an identity token for authorization purposes. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_METHOD_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_PUT_METHOD_INPUT.members["restApiId"], self.rest_api_id - ) - - if self.resource_id is not None: - serializer.write_string( - _SCHEMA_PUT_METHOD_INPUT.members["resourceId"], self.resource_id - ) - - if self.http_method is not None: - serializer.write_string( - _SCHEMA_PUT_METHOD_INPUT.members["httpMethod"], self.http_method - ) - - if self.authorization_type is not None: - serializer.write_string( - _SCHEMA_PUT_METHOD_INPUT.members["authorizationType"], - self.authorization_type, - ) - - if self.authorizer_id is not None: - serializer.write_string( - _SCHEMA_PUT_METHOD_INPUT.members["authorizerId"], self.authorizer_id - ) - - if self.api_key_required is not None: - serializer.write_boolean( - _SCHEMA_PUT_METHOD_INPUT.members["apiKeyRequired"], - self.api_key_required, - ) - - if self.operation_name is not None: - serializer.write_string( - _SCHEMA_PUT_METHOD_INPUT.members["operationName"], self.operation_name - ) - - if self.request_parameters is not None: - _serialize_map_of_string_to_boolean( - serializer, - _SCHEMA_PUT_METHOD_INPUT.members["requestParameters"], - self.request_parameters, - ) - - if self.request_models is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_PUT_METHOD_INPUT.members["requestModels"], - self.request_models, - ) - - if self.request_validator_id is not None: - serializer.write_string( - _SCHEMA_PUT_METHOD_INPUT.members["requestValidatorId"], - self.request_validator_id, - ) - - if self.authorization_scopes is not None: - _serialize_list_of_string( - serializer, - _SCHEMA_PUT_METHOD_INPUT.members["authorizationScopes"], - self.authorization_scopes, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_PUT_METHOD_INPUT.members["restApiId"] - ) - - case 1: - kwargs["resource_id"] = de.read_string( - _SCHEMA_PUT_METHOD_INPUT.members["resourceId"] - ) - - case 2: - kwargs["http_method"] = de.read_string( - _SCHEMA_PUT_METHOD_INPUT.members["httpMethod"] - ) - - case 3: - kwargs["authorization_type"] = de.read_string( - _SCHEMA_PUT_METHOD_INPUT.members["authorizationType"] - ) - - case 4: - kwargs["authorizer_id"] = de.read_string( - _SCHEMA_PUT_METHOD_INPUT.members["authorizerId"] - ) - - case 5: - kwargs["api_key_required"] = de.read_boolean( - _SCHEMA_PUT_METHOD_INPUT.members["apiKeyRequired"] - ) - - case 6: - kwargs["operation_name"] = de.read_string( - _SCHEMA_PUT_METHOD_INPUT.members["operationName"] - ) - - case 7: - kwargs["request_parameters"] = ( - _deserialize_map_of_string_to_boolean( - de, _SCHEMA_PUT_METHOD_INPUT.members["requestParameters"] - ) - ) - - case 8: - kwargs["request_models"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_PUT_METHOD_INPUT.members["requestModels"] - ) - - case 9: - kwargs["request_validator_id"] = de.read_string( - _SCHEMA_PUT_METHOD_INPUT.members["requestValidatorId"] - ) - - case 10: - kwargs["authorization_scopes"] = _deserialize_list_of_string( - de, _SCHEMA_PUT_METHOD_INPUT.members["authorizationScopes"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUT_METHOD_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class PutMethodOutput: - """ - Represents a client-facing interface by which the client calls the API - to access back-end resources. A Method resource is integrated with an - Integration resource. Both consist of a request and one or more - responses. The method request takes the client input that is passed to - the back end through the integration request. A method response returns - the output from the back end to the client through an integration - response. A method request is embodied in a Method resource, whereas an - integration request is embodied in an Integration resource. On the other - hand, a method response is represented by a MethodResponse resource, - whereas an integration response is represented by an IntegrationResponse - resource. - """ - - http_method: str | None = None - """The method's HTTP verb.""" - - authorization_type: str | None = None - """ - The method's authorization type. Valid values are `NONE` for open - access, `AWS_IAM` for using AWS IAM permissions, `CUSTOM` for using a - custom authorizer, or `COGNITO_USER_POOLS` for using a Cognito user - pool. - """ - - authorizer_id: str | None = None - """ - The identifier of an Authorizer to use on this method. The - `authorizationType` must be `CUSTOM`. - """ - - api_key_required: bool | None = None - """ - A boolean flag specifying whether a valid ApiKey is required to invoke - this method. - """ - - request_validator_id: str | None = None - """The identifier of a RequestValidator for request validation.""" - - operation_name: str | None = None - """ - A human-friendly operation identifier for the method. For example, you - can assign the `operationName` of `ListPets` for the `GET /pets` method - in the `PetStore` example. - """ - - request_parameters: dict[str, bool] | None = None - """ - A key-value map defining required or optional method request parameters - that can be accepted by API Gateway. A key is a method request parameter - name matching the pattern of `method.request.{location}.{name}`, where - `location` is `querystring`, `path`, or `header` and `name` is a valid - and unique parameter name. The value associated with the key is a - Boolean flag indicating whether the parameter is required (`true`) or - optional (`false`). The method request parameter names defined here are - available in Integration to be mapped to integration request parameters - or templates. - """ - - request_models: dict[str, str] | None = None - """ - A key-value map specifying data schemas, represented by Model resources, - (as the mapped value) of the request payloads of given content types (as - the mapping key). - """ - - method_responses: dict[str, MethodResponse] | None = None - """Gets a method response associated with a given HTTP status code.""" - - method_integration: Integration | None = None - """ - Gets the method's integration responsible for passing the - client-submitted request to the back end and performing necessary - transformations to make the request compliant with the back end. - """ - - authorization_scopes: list[str] | None = None - """ - A list of authorization scopes configured on the method. The scopes are - used with a `COGNITO_USER_POOLS` authorizer to authorize the method - invocation. The authorization works by matching the method scopes - against the scopes parsed from the access token in the incoming request. - The method invocation is authorized if any method scopes matches a - claimed scope in the access token. Otherwise, the invocation is not - authorized. When the method scope is configured, the client must provide - an access token instead of an identity token for authorization purposes. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_METHOD_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.http_method is not None: - serializer.write_string( - _SCHEMA_PUT_METHOD_OUTPUT.members["httpMethod"], self.http_method - ) - - if self.authorization_type is not None: - serializer.write_string( - _SCHEMA_PUT_METHOD_OUTPUT.members["authorizationType"], - self.authorization_type, - ) - - if self.authorizer_id is not None: - serializer.write_string( - _SCHEMA_PUT_METHOD_OUTPUT.members["authorizerId"], self.authorizer_id - ) - - if self.api_key_required is not None: - serializer.write_boolean( - _SCHEMA_PUT_METHOD_OUTPUT.members["apiKeyRequired"], - self.api_key_required, - ) - - if self.request_validator_id is not None: - serializer.write_string( - _SCHEMA_PUT_METHOD_OUTPUT.members["requestValidatorId"], - self.request_validator_id, - ) - - if self.operation_name is not None: - serializer.write_string( - _SCHEMA_PUT_METHOD_OUTPUT.members["operationName"], self.operation_name - ) - - if self.request_parameters is not None: - _serialize_map_of_string_to_boolean( - serializer, - _SCHEMA_PUT_METHOD_OUTPUT.members["requestParameters"], - self.request_parameters, - ) - - if self.request_models is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_PUT_METHOD_OUTPUT.members["requestModels"], - self.request_models, - ) - - if self.method_responses is not None: - _serialize_map_of_method_response( - serializer, - _SCHEMA_PUT_METHOD_OUTPUT.members["methodResponses"], - self.method_responses, - ) - - if self.method_integration is not None: - serializer.write_struct( - _SCHEMA_PUT_METHOD_OUTPUT.members["methodIntegration"], - self.method_integration, - ) - - if self.authorization_scopes is not None: - _serialize_list_of_string( - serializer, - _SCHEMA_PUT_METHOD_OUTPUT.members["authorizationScopes"], - self.authorization_scopes, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["http_method"] = de.read_string( - _SCHEMA_PUT_METHOD_OUTPUT.members["httpMethod"] - ) - - case 1: - kwargs["authorization_type"] = de.read_string( - _SCHEMA_PUT_METHOD_OUTPUT.members["authorizationType"] - ) - - case 2: - kwargs["authorizer_id"] = de.read_string( - _SCHEMA_PUT_METHOD_OUTPUT.members["authorizerId"] - ) - - case 3: - kwargs["api_key_required"] = de.read_boolean( - _SCHEMA_PUT_METHOD_OUTPUT.members["apiKeyRequired"] - ) - - case 4: - kwargs["request_validator_id"] = de.read_string( - _SCHEMA_PUT_METHOD_OUTPUT.members["requestValidatorId"] - ) - - case 5: - kwargs["operation_name"] = de.read_string( - _SCHEMA_PUT_METHOD_OUTPUT.members["operationName"] - ) - - case 6: - kwargs["request_parameters"] = ( - _deserialize_map_of_string_to_boolean( - de, _SCHEMA_PUT_METHOD_OUTPUT.members["requestParameters"] - ) - ) - - case 7: - kwargs["request_models"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_PUT_METHOD_OUTPUT.members["requestModels"] - ) - - case 8: - kwargs["method_responses"] = _deserialize_map_of_method_response( - de, _SCHEMA_PUT_METHOD_OUTPUT.members["methodResponses"] - ) - - case 9: - kwargs["method_integration"] = Integration.deserialize(de) - - case 10: - kwargs["authorization_scopes"] = _deserialize_list_of_string( - de, _SCHEMA_PUT_METHOD_OUTPUT.members["authorizationScopes"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUT_METHOD_OUTPUT, consumer=_consumer) - return kwargs - - -PUT_METHOD = APIOperation( - input=PutMethodInput, - output=PutMethodOutput, - schema=_SCHEMA_PUT_METHOD, - input_schema=_SCHEMA_PUT_METHOD_INPUT, - output_schema=_SCHEMA_PUT_METHOD_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class PutMethodResponseInput: - """Request to add a MethodResponse to an existing Method resource.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - resource_id: str | None = None - """The Resource identifier for the Method resource.""" - - http_method: str | None = None - """The HTTP verb of the Method resource.""" - - status_code: str | None = None - """The method response's status code.""" - - response_parameters: dict[str, bool] | None = None - """ - A key-value map specifying required or optional response parameters that - API Gateway can send back to the caller. A key defines a method response - header name and the associated value is a Boolean flag indicating - whether the method response parameter is required or not. The method - response header names must match the pattern of - `method.response.header.{name}`, where `name` is a valid and unique - header name. The response parameter names defined here are available in - the integration response to be mapped from an integration response - header expressed in `integration.response.header.{name}`, a static value - enclosed within a pair of single quotes (e.g., `'application/json'`), or - a JSON expression from the back-end response payload in the form of - `integration.response.body.{JSON-expression}`, where `JSON-expression` - is a valid JSON expression without the `$` prefix.) - """ - - response_models: dict[str, str] | None = None - """ - Specifies the Model resources used for the response's content type. - Response models are represented as a key/value map, with a content type - as the key and a Model name as the value. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_METHOD_RESPONSE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_PUT_METHOD_RESPONSE_INPUT.members["restApiId"], self.rest_api_id - ) - - if self.resource_id is not None: - serializer.write_string( - _SCHEMA_PUT_METHOD_RESPONSE_INPUT.members["resourceId"], - self.resource_id, - ) - - if self.http_method is not None: - serializer.write_string( - _SCHEMA_PUT_METHOD_RESPONSE_INPUT.members["httpMethod"], - self.http_method, - ) - - if self.status_code is not None: - serializer.write_string( - _SCHEMA_PUT_METHOD_RESPONSE_INPUT.members["statusCode"], - self.status_code, - ) - - if self.response_parameters is not None: - _serialize_map_of_string_to_boolean( - serializer, - _SCHEMA_PUT_METHOD_RESPONSE_INPUT.members["responseParameters"], - self.response_parameters, - ) - - if self.response_models is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_PUT_METHOD_RESPONSE_INPUT.members["responseModels"], - self.response_models, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_PUT_METHOD_RESPONSE_INPUT.members["restApiId"] - ) - - case 1: - kwargs["resource_id"] = de.read_string( - _SCHEMA_PUT_METHOD_RESPONSE_INPUT.members["resourceId"] - ) - - case 2: - kwargs["http_method"] = de.read_string( - _SCHEMA_PUT_METHOD_RESPONSE_INPUT.members["httpMethod"] - ) - - case 3: - kwargs["status_code"] = de.read_string( - _SCHEMA_PUT_METHOD_RESPONSE_INPUT.members["statusCode"] - ) - - case 4: - kwargs["response_parameters"] = ( - _deserialize_map_of_string_to_boolean( - de, - _SCHEMA_PUT_METHOD_RESPONSE_INPUT.members[ - "responseParameters" - ], - ) - ) - - case 5: - kwargs["response_models"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_PUT_METHOD_RESPONSE_INPUT.members["responseModels"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUT_METHOD_RESPONSE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class PutMethodResponseOutput: - """ - Represents a method response of a given HTTP status code returned to the - client. The method response is passed from the back end through the - associated integration response that can be transformed using a mapping - template. - """ - - status_code: str | None = None - """The method response's status code.""" - - response_parameters: dict[str, bool] | None = None - """ - A key-value map specifying required or optional response parameters that - API Gateway can send back to the caller. A key defines a method response - header and the value specifies whether the associated method response - header is required or not. The expression of the key must match the - pattern `method.response.header.{name}`, where `name` is a valid and - unique header name. API Gateway passes certain integration response data - to the method response headers specified here according to the mapping - you prescribe in the API's IntegrationResponse. The integration - response data that can be mapped include an integration response header - expressed in `integration.response.header.{name}`, a static value - enclosed within a pair of single quotes (e.g., `'application/json'`), or - a JSON expression from the back-end response payload in the form of - `integration.response.body.{JSON-expression}`, where `JSON-expression` - is a valid JSON expression without the `$` prefix.) - """ - - response_models: dict[str, str] | None = None - """ - Specifies the Model resources used for the response's content-type. - Response models are represented as a key/value map, with a content-type - as the key and a Model name as the value. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_METHOD_RESPONSE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.status_code is not None: - serializer.write_string( - _SCHEMA_PUT_METHOD_RESPONSE_OUTPUT.members["statusCode"], - self.status_code, - ) - - if self.response_parameters is not None: - _serialize_map_of_string_to_boolean( - serializer, - _SCHEMA_PUT_METHOD_RESPONSE_OUTPUT.members["responseParameters"], - self.response_parameters, - ) - - if self.response_models is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_PUT_METHOD_RESPONSE_OUTPUT.members["responseModels"], - self.response_models, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["status_code"] = de.read_string( - _SCHEMA_PUT_METHOD_RESPONSE_OUTPUT.members["statusCode"] - ) - - case 1: - kwargs["response_parameters"] = ( - _deserialize_map_of_string_to_boolean( - de, - _SCHEMA_PUT_METHOD_RESPONSE_OUTPUT.members[ - "responseParameters" - ], - ) - ) - - case 2: - kwargs["response_models"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_PUT_METHOD_RESPONSE_OUTPUT.members["responseModels"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUT_METHOD_RESPONSE_OUTPUT, consumer=_consumer) - return kwargs - - -PUT_METHOD_RESPONSE = APIOperation( - input=PutMethodResponseInput, - output=PutMethodResponseOutput, - schema=_SCHEMA_PUT_METHOD_RESPONSE, - input_schema=_SCHEMA_PUT_METHOD_RESPONSE_INPUT, - output_schema=_SCHEMA_PUT_METHOD_RESPONSE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class PutRestApiInput: - """ - A PUT request to update an existing API, with external API definitions - specified as the request body. - """ - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - mode: str | None = None - """ - The `mode` query parameter to specify the update mode. Valid values are - \"merge\" and \"overwrite\". By default, the update mode is \"merge\". - """ - - fail_on_warnings: bool = False - """ - A query parameter to indicate whether to rollback the API update - (`true`) or not (`false`) when a warning is encountered. The default - value is `false`. - """ - - parameters: dict[str, str] | None = None - """ - Custom header parameters as part of the request. For example, to exclude - DocumentationParts from an imported API, set `ignore=documentation` as a - `parameters` value, as in the AWS CLI command of - `aws apigateway import-rest-api --parameters ignore=documentation --body 'file:///path/to/imported-api-body.json'`. - """ - - body: bytes | None = None - """ - The PUT request body containing external API definitions. Currently, - only OpenAPI definition JSON/YAML files are supported. The maximum size - of the API definition file is 6MB. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_REST_API_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_PUT_REST_API_INPUT.members["restApiId"], self.rest_api_id - ) - - if self.mode is not None: - serializer.write_string( - _SCHEMA_PUT_REST_API_INPUT.members["mode"], self.mode - ) - - if self.fail_on_warnings is not None: - serializer.write_boolean( - _SCHEMA_PUT_REST_API_INPUT.members["failOnWarnings"], - self.fail_on_warnings, - ) - - if self.parameters is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_PUT_REST_API_INPUT.members["parameters"], - self.parameters, - ) - - if self.body is not None: - serializer.write_blob(_SCHEMA_PUT_REST_API_INPUT.members["body"], self.body) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_PUT_REST_API_INPUT.members["restApiId"] - ) - - case 1: - kwargs["mode"] = PutMode( - de.read_string(_SCHEMA_PUT_REST_API_INPUT.members["mode"]) - ) - - case 2: - kwargs["fail_on_warnings"] = de.read_boolean( - _SCHEMA_PUT_REST_API_INPUT.members["failOnWarnings"] - ) - - case 3: - kwargs["parameters"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_PUT_REST_API_INPUT.members["parameters"] - ) - - case 4: - kwargs["body"] = de.read_blob( - _SCHEMA_PUT_REST_API_INPUT.members["body"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUT_REST_API_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class PutRestApiOutput: - """Represents a REST API.""" - - id: str | None = None - """ - The API's identifier. This identifier is unique across all of your APIs - in API Gateway. - """ - - name: str | None = None - """The API's name.""" - - description: str | None = None - """The API's description.""" - - created_date: datetime | None = None - """The timestamp when the API was created.""" - - version: str | None = None - """A version identifier for the API.""" - - warnings: list[str] | None = None - """ - The warning messages reported when `failonwarnings` is turned on during - API import. - """ - - binary_media_types: list[str] | None = None - """ - The list of binary media types supported by the RestApi. By default, the - RestApi supports only UTF-8-encoded text payloads. - """ - - minimum_compression_size: int | None = None - """ - A nullable integer that is used to enable compression (with non-negative - between 0 and 10485760 (10M) bytes, inclusive) or disable compression - (with a null value) on an API. When compression is enabled, compression - or decompression is not applied on the payload if the payload size is - smaller than this value. Setting it to zero allows compression for any - payload size. - """ - - api_key_source: str | None = None - """ - The source of the API key for metering requests according to a usage - plan. Valid values are: >`HEADER` to read the API key from the - `X-API-Key` header of a request. `AUTHORIZER` to read the API key from - the `UsageIdentifierKey` from a custom authorizer. - """ - - endpoint_configuration: EndpointConfiguration | None = None - """ - The endpoint configuration of this RestApi showing the endpoint types - and IP address types of the API. - """ - - policy: str | None = None - """ - A stringified JSON policy document that applies to this RestApi - regardless of the caller and Method configuration. - """ - - tags: dict[str, str] | None = None - """ - The collection of tags. Each tag element is associated with a given - resource. - """ - - disable_execute_api_endpoint: bool = False - """ - Specifies whether clients can invoke your API by using the default - `execute-api` endpoint. By default, clients can invoke your API with the - default `https://{api_id}.execute-api.{region}.amazonaws.com` endpoint. - To require that clients use a custom domain name to invoke your API, - disable the default endpoint. - """ - - root_resource_id: str | None = None - """The API's root resource ID.""" - - security_policy: str | None = None - """ - The Transport Layer Security (TLS) version + cipher suite for this - RestApi. - """ - - endpoint_access_mode: str | None = None - """The endpoint access mode of the RestApi.""" - - api_status: str | None = None - """The ApiStatus of the RestApi.""" - - api_status_message: str | None = None - """ - The status message of the RestApi. When the status message is `UPDATING` - you can still invoke it. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_REST_API_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string(_SCHEMA_PUT_REST_API_OUTPUT.members["id"], self.id) - - if self.name is not None: - serializer.write_string( - _SCHEMA_PUT_REST_API_OUTPUT.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_PUT_REST_API_OUTPUT.members["description"], self.description - ) - - if self.created_date is not None: - serializer.write_timestamp( - _SCHEMA_PUT_REST_API_OUTPUT.members["createdDate"], self.created_date - ) - - if self.version is not None: - serializer.write_string( - _SCHEMA_PUT_REST_API_OUTPUT.members["version"], self.version - ) - - if self.warnings is not None: - _serialize_list_of_string( - serializer, - _SCHEMA_PUT_REST_API_OUTPUT.members["warnings"], - self.warnings, - ) - - if self.binary_media_types is not None: - _serialize_list_of_string( - serializer, - _SCHEMA_PUT_REST_API_OUTPUT.members["binaryMediaTypes"], - self.binary_media_types, - ) - - if self.minimum_compression_size is not None: - serializer.write_integer( - _SCHEMA_PUT_REST_API_OUTPUT.members["minimumCompressionSize"], - self.minimum_compression_size, - ) - - if self.api_key_source is not None: - serializer.write_string( - _SCHEMA_PUT_REST_API_OUTPUT.members["apiKeySource"], self.api_key_source - ) - - if self.endpoint_configuration is not None: - serializer.write_struct( - _SCHEMA_PUT_REST_API_OUTPUT.members["endpointConfiguration"], - self.endpoint_configuration, - ) - - if self.policy is not None: - serializer.write_string( - _SCHEMA_PUT_REST_API_OUTPUT.members["policy"], self.policy - ) - - if self.tags is not None: - _serialize_map_of_string_to_string( - serializer, _SCHEMA_PUT_REST_API_OUTPUT.members["tags"], self.tags - ) - - serializer.write_boolean( - _SCHEMA_PUT_REST_API_OUTPUT.members["disableExecuteApiEndpoint"], - self.disable_execute_api_endpoint, - ) - if self.root_resource_id is not None: - serializer.write_string( - _SCHEMA_PUT_REST_API_OUTPUT.members["rootResourceId"], - self.root_resource_id, - ) - - if self.security_policy is not None: - serializer.write_string( - _SCHEMA_PUT_REST_API_OUTPUT.members["securityPolicy"], - self.security_policy, - ) - - if self.endpoint_access_mode is not None: - serializer.write_string( - _SCHEMA_PUT_REST_API_OUTPUT.members["endpointAccessMode"], - self.endpoint_access_mode, - ) - - if self.api_status is not None: - serializer.write_string( - _SCHEMA_PUT_REST_API_OUTPUT.members["apiStatus"], self.api_status - ) - - if self.api_status_message is not None: - serializer.write_string( - _SCHEMA_PUT_REST_API_OUTPUT.members["apiStatusMessage"], - self.api_status_message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_PUT_REST_API_OUTPUT.members["id"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_PUT_REST_API_OUTPUT.members["name"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_PUT_REST_API_OUTPUT.members["description"] - ) - - case 3: - kwargs["created_date"] = de.read_timestamp( - _SCHEMA_PUT_REST_API_OUTPUT.members["createdDate"] - ) - - case 4: - kwargs["version"] = de.read_string( - _SCHEMA_PUT_REST_API_OUTPUT.members["version"] - ) - - case 5: - kwargs["warnings"] = _deserialize_list_of_string( - de, _SCHEMA_PUT_REST_API_OUTPUT.members["warnings"] - ) - - case 6: - kwargs["binary_media_types"] = _deserialize_list_of_string( - de, _SCHEMA_PUT_REST_API_OUTPUT.members["binaryMediaTypes"] - ) - - case 7: - kwargs["minimum_compression_size"] = de.read_integer( - _SCHEMA_PUT_REST_API_OUTPUT.members["minimumCompressionSize"] - ) - - case 8: - kwargs["api_key_source"] = ApiKeySourceType( - de.read_string( - _SCHEMA_PUT_REST_API_OUTPUT.members["apiKeySource"] - ) - ) - - case 9: - kwargs["endpoint_configuration"] = ( - EndpointConfiguration.deserialize(de) - ) - - case 10: - kwargs["policy"] = de.read_string( - _SCHEMA_PUT_REST_API_OUTPUT.members["policy"] - ) - - case 11: - kwargs["tags"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_PUT_REST_API_OUTPUT.members["tags"] - ) - - case 12: - kwargs["disable_execute_api_endpoint"] = de.read_boolean( - _SCHEMA_PUT_REST_API_OUTPUT.members["disableExecuteApiEndpoint"] - ) - - case 13: - kwargs["root_resource_id"] = de.read_string( - _SCHEMA_PUT_REST_API_OUTPUT.members["rootResourceId"] - ) - - case 14: - kwargs["security_policy"] = SecurityPolicy( - de.read_string( - _SCHEMA_PUT_REST_API_OUTPUT.members["securityPolicy"] - ) - ) - - case 15: - kwargs["endpoint_access_mode"] = EndpointAccessMode( - de.read_string( - _SCHEMA_PUT_REST_API_OUTPUT.members["endpointAccessMode"] - ) - ) - - case 16: - kwargs["api_status"] = ApiStatus( - de.read_string(_SCHEMA_PUT_REST_API_OUTPUT.members["apiStatus"]) - ) - - case 17: - kwargs["api_status_message"] = de.read_string( - _SCHEMA_PUT_REST_API_OUTPUT.members["apiStatusMessage"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUT_REST_API_OUTPUT, consumer=_consumer) - return kwargs - - -PUT_REST_API = APIOperation( - input=PutRestApiInput, - output=PutRestApiOutput, - schema=_SCHEMA_PUT_REST_API, - input_schema=_SCHEMA_PUT_REST_API_INPUT, - output_schema=_SCHEMA_PUT_REST_API_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class RejectDomainNameAccessAssociationInput: - """Dataclass for RejectDomainNameAccessAssociationInput structure.""" - - domain_name_access_association_arn: str | None = None - """The ARN of the domain name access association resource.""" - - domain_name_arn: str | None = None - """The ARN of the domain name.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_REJECT_DOMAIN_NAME_ACCESS_ASSOCIATION_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.domain_name_access_association_arn is not None: - serializer.write_string( - _SCHEMA_REJECT_DOMAIN_NAME_ACCESS_ASSOCIATION_INPUT.members[ - "domainNameAccessAssociationArn" - ], - self.domain_name_access_association_arn, - ) - - if self.domain_name_arn is not None: - serializer.write_string( - _SCHEMA_REJECT_DOMAIN_NAME_ACCESS_ASSOCIATION_INPUT.members[ - "domainNameArn" - ], - self.domain_name_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["domain_name_access_association_arn"] = de.read_string( - _SCHEMA_REJECT_DOMAIN_NAME_ACCESS_ASSOCIATION_INPUT.members[ - "domainNameAccessAssociationArn" - ] - ) - - case 1: - kwargs["domain_name_arn"] = de.read_string( - _SCHEMA_REJECT_DOMAIN_NAME_ACCESS_ASSOCIATION_INPUT.members[ - "domainNameArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_REJECT_DOMAIN_NAME_ACCESS_ASSOCIATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class RejectDomainNameAccessAssociationOutput: - """Dataclass for RejectDomainNameAccessAssociationOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_REJECT_DOMAIN_NAME_ACCESS_ASSOCIATION_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_REJECT_DOMAIN_NAME_ACCESS_ASSOCIATION_OUTPUT, consumer=_consumer - ) - return kwargs - - -REJECT_DOMAIN_NAME_ACCESS_ASSOCIATION = APIOperation( - input=RejectDomainNameAccessAssociationInput, - output=RejectDomainNameAccessAssociationOutput, - schema=_SCHEMA_REJECT_DOMAIN_NAME_ACCESS_ASSOCIATION, - input_schema=_SCHEMA_REJECT_DOMAIN_NAME_ACCESS_ASSOCIATION_INPUT, - output_schema=_SCHEMA_REJECT_DOMAIN_NAME_ACCESS_ASSOCIATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class TagResourceInput: - """Adds or updates a tag on a given resource.""" - - resource_arn: str | None = None - """The ARN of a resource that can be tagged.""" - - tags: dict[str, str] | None = None - """ - The key-value map of strings. The valid character set is - [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not - start with `aws:`. The tag value can be up to 256 characters. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TAG_RESOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_TAG_RESOURCE_INPUT.members["resourceArn"], self.resource_arn - ) - - if self.tags is not None: - _serialize_map_of_string_to_string( - serializer, _SCHEMA_TAG_RESOURCE_INPUT.members["tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_TAG_RESOURCE_INPUT.members["resourceArn"] - ) - - case 1: - kwargs["tags"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_TAG_RESOURCE_INPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TAG_RESOURCE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class TagResourceOutput: - """Dataclass for TagResourceOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TAG_RESOURCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TAG_RESOURCE_OUTPUT, consumer=_consumer) - return kwargs - - -TAG_RESOURCE = APIOperation( - input=TagResourceInput, - output=TagResourceOutput, - schema=_SCHEMA_TAG_RESOURCE, - input_schema=_SCHEMA_TAG_RESOURCE_INPUT, - output_schema=_SCHEMA_TAG_RESOURCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -def _serialize_map_of_string_to_list( - serializer: ShapeSerializer, schema: Schema, value: dict[str, list[str]] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: _serialize_list_of_string(vs, value_schema, v)) - - -def _deserialize_map_of_string_to_list( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, list[str]]: - result: dict[str, list[str]] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = _deserialize_list_of_string(d, value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class TestInvokeAuthorizerInput: - """Make a request to simulate the invocation of an Authorizer.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - authorizer_id: str | None = None - """Specifies a test invoke authorizer request's Authorizer ID.""" - - headers: dict[str, str] | None = None - """ - A key-value map of headers to simulate an incoming invocation request. - This is where the incoming authorization token, or identity source, - should be specified. - """ - - multi_value_headers: dict[str, list[str]] | None = None - """ - The headers as a map from string to list of values to simulate an - incoming invocation request. This is where the incoming authorization - token, or identity source, may be specified. - """ - - path_with_query_string: str | None = None - """ - The URI path, including query string, of the simulated invocation - request. Use this to specify path parameters and query string - parameters. - """ - - body: str | None = None - """The simulated request body of an incoming invocation request.""" - - stage_variables: dict[str, str] | None = None - """ - A key-value map of stage variables to simulate an invocation on a - deployed Stage. - """ - - additional_context: dict[str, str] | None = None - """A key-value map of additional context variables.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TEST_INVOKE_AUTHORIZER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_TEST_INVOKE_AUTHORIZER_INPUT.members["restApiId"], - self.rest_api_id, - ) - - if self.authorizer_id is not None: - serializer.write_string( - _SCHEMA_TEST_INVOKE_AUTHORIZER_INPUT.members["authorizerId"], - self.authorizer_id, - ) - - if self.headers is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_TEST_INVOKE_AUTHORIZER_INPUT.members["headers"], - self.headers, - ) - - if self.multi_value_headers is not None: - _serialize_map_of_string_to_list( - serializer, - _SCHEMA_TEST_INVOKE_AUTHORIZER_INPUT.members["multiValueHeaders"], - self.multi_value_headers, - ) - - if self.path_with_query_string is not None: - serializer.write_string( - _SCHEMA_TEST_INVOKE_AUTHORIZER_INPUT.members["pathWithQueryString"], - self.path_with_query_string, - ) - - if self.body is not None: - serializer.write_string( - _SCHEMA_TEST_INVOKE_AUTHORIZER_INPUT.members["body"], self.body - ) - - if self.stage_variables is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_TEST_INVOKE_AUTHORIZER_INPUT.members["stageVariables"], - self.stage_variables, - ) - - if self.additional_context is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_TEST_INVOKE_AUTHORIZER_INPUT.members["additionalContext"], - self.additional_context, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_TEST_INVOKE_AUTHORIZER_INPUT.members["restApiId"] - ) - - case 1: - kwargs["authorizer_id"] = de.read_string( - _SCHEMA_TEST_INVOKE_AUTHORIZER_INPUT.members["authorizerId"] - ) - - case 2: - kwargs["headers"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_TEST_INVOKE_AUTHORIZER_INPUT.members["headers"] - ) - - case 3: - kwargs["multi_value_headers"] = _deserialize_map_of_string_to_list( - de, - _SCHEMA_TEST_INVOKE_AUTHORIZER_INPUT.members[ - "multiValueHeaders" - ], - ) - - case 4: - kwargs["path_with_query_string"] = de.read_string( - _SCHEMA_TEST_INVOKE_AUTHORIZER_INPUT.members[ - "pathWithQueryString" - ] - ) - - case 5: - kwargs["body"] = de.read_string( - _SCHEMA_TEST_INVOKE_AUTHORIZER_INPUT.members["body"] - ) - - case 6: - kwargs["stage_variables"] = _deserialize_map_of_string_to_string( - de, - _SCHEMA_TEST_INVOKE_AUTHORIZER_INPUT.members["stageVariables"], - ) - - case 7: - kwargs["additional_context"] = _deserialize_map_of_string_to_string( - de, - _SCHEMA_TEST_INVOKE_AUTHORIZER_INPUT.members[ - "additionalContext" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_TEST_INVOKE_AUTHORIZER_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class TestInvokeAuthorizerOutput: - """ - Represents the response of the test invoke request for a custom - Authorizer - """ - - client_status: int = 0 - """ - The HTTP status code that the client would have received. Value is 0 if - the authorizer succeeded. - """ - - log: str | None = None - """The API Gateway execution log for the test authorizer request.""" - - latency: int = 0 - """The execution latency, in ms, of the test authorizer request.""" - - principal_id: str | None = None - """The principal identity returned by the Authorizer""" - - policy: str | None = None - """The JSON policy document returned by the Authorizer""" - - authorization: dict[str, list[str]] | None = None - """The authorization response.""" - - claims: dict[str, str] | None = None - """ - The open identity claims, with any supported custom attributes, returned - from the Cognito Your User Pool configured for the API. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TEST_INVOKE_AUTHORIZER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer( - _SCHEMA_TEST_INVOKE_AUTHORIZER_OUTPUT.members["clientStatus"], - self.client_status, - ) - if self.log is not None: - serializer.write_string( - _SCHEMA_TEST_INVOKE_AUTHORIZER_OUTPUT.members["log"], self.log - ) - - serializer.write_long( - _SCHEMA_TEST_INVOKE_AUTHORIZER_OUTPUT.members["latency"], self.latency - ) - if self.principal_id is not None: - serializer.write_string( - _SCHEMA_TEST_INVOKE_AUTHORIZER_OUTPUT.members["principalId"], - self.principal_id, - ) - - if self.policy is not None: - serializer.write_string( - _SCHEMA_TEST_INVOKE_AUTHORIZER_OUTPUT.members["policy"], self.policy - ) - - if self.authorization is not None: - _serialize_map_of_string_to_list( - serializer, - _SCHEMA_TEST_INVOKE_AUTHORIZER_OUTPUT.members["authorization"], - self.authorization, - ) - - if self.claims is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_TEST_INVOKE_AUTHORIZER_OUTPUT.members["claims"], - self.claims, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["client_status"] = de.read_integer( - _SCHEMA_TEST_INVOKE_AUTHORIZER_OUTPUT.members["clientStatus"] - ) - - case 1: - kwargs["log"] = de.read_string( - _SCHEMA_TEST_INVOKE_AUTHORIZER_OUTPUT.members["log"] - ) - - case 2: - kwargs["latency"] = de.read_long( - _SCHEMA_TEST_INVOKE_AUTHORIZER_OUTPUT.members["latency"] - ) - - case 3: - kwargs["principal_id"] = de.read_string( - _SCHEMA_TEST_INVOKE_AUTHORIZER_OUTPUT.members["principalId"] - ) - - case 4: - kwargs["policy"] = de.read_string( - _SCHEMA_TEST_INVOKE_AUTHORIZER_OUTPUT.members["policy"] - ) - - case 5: - kwargs["authorization"] = _deserialize_map_of_string_to_list( - de, - _SCHEMA_TEST_INVOKE_AUTHORIZER_OUTPUT.members["authorization"], - ) - - case 6: - kwargs["claims"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_TEST_INVOKE_AUTHORIZER_OUTPUT.members["claims"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_TEST_INVOKE_AUTHORIZER_OUTPUT, consumer=_consumer - ) - return kwargs - - -TEST_INVOKE_AUTHORIZER = APIOperation( - input=TestInvokeAuthorizerInput, - output=TestInvokeAuthorizerOutput, - schema=_SCHEMA_TEST_INVOKE_AUTHORIZER, - input_schema=_SCHEMA_TEST_INVOKE_AUTHORIZER_INPUT, - output_schema=_SCHEMA_TEST_INVOKE_AUTHORIZER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class TestInvokeMethodInput: - """Make a request to simulate the invocation of a Method.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - resource_id: str | None = None - """Specifies a test invoke method request's resource ID.""" - - http_method: str | None = None - """Specifies a test invoke method request's HTTP method.""" - - path_with_query_string: str | None = None - """ - The URI path, including query string, of the simulated invocation - request. Use this to specify path parameters and query string - parameters. - """ - - body: str | None = None - """The simulated request body of an incoming invocation request.""" - - headers: dict[str, str] | None = None - """A key-value map of headers to simulate an incoming invocation request.""" - - multi_value_headers: dict[str, list[str]] | None = None - """ - The headers as a map from string to list of values to simulate an - incoming invocation request. - """ - - client_certificate_id: str | None = None - """ - A ClientCertificate identifier to use in the test invocation. API - Gateway will use the certificate when making the HTTPS request to the - defined back-end endpoint. - """ - - stage_variables: dict[str, str] | None = None - """ - A key-value map of stage variables to simulate an invocation on a - deployed Stage. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TEST_INVOKE_METHOD_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_TEST_INVOKE_METHOD_INPUT.members["restApiId"], self.rest_api_id - ) - - if self.resource_id is not None: - serializer.write_string( - _SCHEMA_TEST_INVOKE_METHOD_INPUT.members["resourceId"], self.resource_id - ) - - if self.http_method is not None: - serializer.write_string( - _SCHEMA_TEST_INVOKE_METHOD_INPUT.members["httpMethod"], self.http_method - ) - - if self.path_with_query_string is not None: - serializer.write_string( - _SCHEMA_TEST_INVOKE_METHOD_INPUT.members["pathWithQueryString"], - self.path_with_query_string, - ) - - if self.body is not None: - serializer.write_string( - _SCHEMA_TEST_INVOKE_METHOD_INPUT.members["body"], self.body - ) - - if self.headers is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_TEST_INVOKE_METHOD_INPUT.members["headers"], - self.headers, - ) - - if self.multi_value_headers is not None: - _serialize_map_of_string_to_list( - serializer, - _SCHEMA_TEST_INVOKE_METHOD_INPUT.members["multiValueHeaders"], - self.multi_value_headers, - ) - - if self.client_certificate_id is not None: - serializer.write_string( - _SCHEMA_TEST_INVOKE_METHOD_INPUT.members["clientCertificateId"], - self.client_certificate_id, - ) - - if self.stage_variables is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_TEST_INVOKE_METHOD_INPUT.members["stageVariables"], - self.stage_variables, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_TEST_INVOKE_METHOD_INPUT.members["restApiId"] - ) - - case 1: - kwargs["resource_id"] = de.read_string( - _SCHEMA_TEST_INVOKE_METHOD_INPUT.members["resourceId"] - ) - - case 2: - kwargs["http_method"] = de.read_string( - _SCHEMA_TEST_INVOKE_METHOD_INPUT.members["httpMethod"] - ) - - case 3: - kwargs["path_with_query_string"] = de.read_string( - _SCHEMA_TEST_INVOKE_METHOD_INPUT.members["pathWithQueryString"] - ) - - case 4: - kwargs["body"] = de.read_string( - _SCHEMA_TEST_INVOKE_METHOD_INPUT.members["body"] - ) - - case 5: - kwargs["headers"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_TEST_INVOKE_METHOD_INPUT.members["headers"] - ) - - case 6: - kwargs["multi_value_headers"] = _deserialize_map_of_string_to_list( - de, - _SCHEMA_TEST_INVOKE_METHOD_INPUT.members["multiValueHeaders"], - ) - - case 7: - kwargs["client_certificate_id"] = de.read_string( - _SCHEMA_TEST_INVOKE_METHOD_INPUT.members["clientCertificateId"] - ) - - case 8: - kwargs["stage_variables"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_TEST_INVOKE_METHOD_INPUT.members["stageVariables"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TEST_INVOKE_METHOD_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class TestInvokeMethodOutput: - """Represents the response of the test invoke request in the HTTP method.""" - - status: int = 0 - """The HTTP status code.""" - - body: str | None = None - """The body of the HTTP response.""" - - headers: dict[str, str] | None = None - """The headers of the HTTP response.""" - - multi_value_headers: dict[str, list[str]] | None = None - """The headers of the HTTP response as a map from string to list of values.""" - - log: str | None = None - """The API Gateway execution log for the test invoke request.""" - - latency: int = 0 - """The execution latency, in ms, of the test invoke request.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TEST_INVOKE_METHOD_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer( - _SCHEMA_TEST_INVOKE_METHOD_OUTPUT.members["status"], self.status - ) - if self.body is not None: - serializer.write_string( - _SCHEMA_TEST_INVOKE_METHOD_OUTPUT.members["body"], self.body - ) - - if self.headers is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_TEST_INVOKE_METHOD_OUTPUT.members["headers"], - self.headers, - ) - - if self.multi_value_headers is not None: - _serialize_map_of_string_to_list( - serializer, - _SCHEMA_TEST_INVOKE_METHOD_OUTPUT.members["multiValueHeaders"], - self.multi_value_headers, - ) - - if self.log is not None: - serializer.write_string( - _SCHEMA_TEST_INVOKE_METHOD_OUTPUT.members["log"], self.log - ) - - serializer.write_long( - _SCHEMA_TEST_INVOKE_METHOD_OUTPUT.members["latency"], self.latency - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["status"] = de.read_integer( - _SCHEMA_TEST_INVOKE_METHOD_OUTPUT.members["status"] - ) - - case 1: - kwargs["body"] = de.read_string( - _SCHEMA_TEST_INVOKE_METHOD_OUTPUT.members["body"] - ) - - case 2: - kwargs["headers"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_TEST_INVOKE_METHOD_OUTPUT.members["headers"] - ) - - case 3: - kwargs["multi_value_headers"] = _deserialize_map_of_string_to_list( - de, - _SCHEMA_TEST_INVOKE_METHOD_OUTPUT.members["multiValueHeaders"], - ) - - case 4: - kwargs["log"] = de.read_string( - _SCHEMA_TEST_INVOKE_METHOD_OUTPUT.members["log"] - ) - - case 5: - kwargs["latency"] = de.read_long( - _SCHEMA_TEST_INVOKE_METHOD_OUTPUT.members["latency"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TEST_INVOKE_METHOD_OUTPUT, consumer=_consumer) - return kwargs - - -TEST_INVOKE_METHOD = APIOperation( - input=TestInvokeMethodInput, - output=TestInvokeMethodOutput, - schema=_SCHEMA_TEST_INVOKE_METHOD, - input_schema=_SCHEMA_TEST_INVOKE_METHOD_INPUT, - output_schema=_SCHEMA_TEST_INVOKE_METHOD_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UntagResourceInput: - """Removes a tag from a given resource.""" - - resource_arn: str | None = None - """The ARN of a resource that can be tagged.""" - - tag_keys: list[str] | None = None - """The Tag keys to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNTAG_RESOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_UNTAG_RESOURCE_INPUT.members["resourceArn"], self.resource_arn - ) - - if self.tag_keys is not None: - _serialize_list_of_string( - serializer, - _SCHEMA_UNTAG_RESOURCE_INPUT.members["tagKeys"], - self.tag_keys, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_UNTAG_RESOURCE_INPUT.members["resourceArn"] - ) - - case 1: - kwargs["tag_keys"] = _deserialize_list_of_string( - de, _SCHEMA_UNTAG_RESOURCE_INPUT.members["tagKeys"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UNTAG_RESOURCE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UntagResourceOutput: - """Dataclass for UntagResourceOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNTAG_RESOURCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UNTAG_RESOURCE_OUTPUT, consumer=_consumer) - return kwargs - - -UNTAG_RESOURCE = APIOperation( - input=UntagResourceInput, - output=UntagResourceOutput, - schema=_SCHEMA_UNTAG_RESOURCE, - input_schema=_SCHEMA_UNTAG_RESOURCE_INPUT, - output_schema=_SCHEMA_UNTAG_RESOURCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -class Op(UnknownEnumMixin, StrEnum): - ADD = "add" - REMOVE = "remove" - REPLACE = "replace" - MOVE = "move" - COPY = "copy" - TEST = "test" - - -@dataclass(kw_only=True) -class PatchOperation: - """ - For more information about supported patch operations, see [Patch - Operations](https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html). - """ - - op: str | None = None - """ - An update operation to be performed with this PATCH request. The valid - value can be add, remove, replace or copy. Not all valid operations are - supported for a given resource. Support of the operations depends on - specific operational contexts. Attempts to apply an unsupported - operation on a resource will return an error message.. - """ - - path: str | None = None - """ - The op operation's target, as identified by a JSON Pointer value that - references a location within the targeted resource. For example, if the - target resource has an updateable property of {\"name\":\"value\"}, the - path for this property is /name. If the name property value is a JSON - object (e.g., {\"name\": {\"child/name\": \"child-value\"}}), the path - for the child/name property will be /name/child~1name. Any slash - (\"/\") character appearing in path names must be escaped with \"~1\", - as shown in the example above. Each op operation can have only one path - associated with it. - """ - - value: str | None = None - """ - The new target value of the update operation. It is applicable for the - add or replace operation. When using AWS CLI to update a property of a - JSON value, enclose the JSON object with a pair of single quotes in a - Linux shell, e.g., '{\"a\": ...}'. - """ - - from_: str | None = None - """ - The copy update operation's source as identified by a JSON-Pointer - value referencing the location within the targeted resource to copy the - value from. For example, to promote a canary deployment, you copy the - canary deployment ID to the affiliated deployment ID by calling a PATCH - request on a Stage resource with \"op\":\"copy\", - \"from\":\"/canarySettings/deploymentId\" and - \"path\":\"/deploymentId\". - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PATCH_OPERATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.op is not None: - serializer.write_string(_SCHEMA_PATCH_OPERATION.members["op"], self.op) - - if self.path is not None: - serializer.write_string(_SCHEMA_PATCH_OPERATION.members["path"], self.path) - - if self.value is not None: - serializer.write_string( - _SCHEMA_PATCH_OPERATION.members["value"], self.value - ) - - if self.from_ is not None: - serializer.write_string(_SCHEMA_PATCH_OPERATION.members["from"], self.from_) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["op"] = Op( - de.read_string(_SCHEMA_PATCH_OPERATION.members["op"]) - ) - - case 1: - kwargs["path"] = de.read_string( - _SCHEMA_PATCH_OPERATION.members["path"] - ) - - case 2: - kwargs["value"] = de.read_string( - _SCHEMA_PATCH_OPERATION.members["value"] - ) - - case 3: - kwargs["from_"] = de.read_string( - _SCHEMA_PATCH_OPERATION.members["from"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PATCH_OPERATION, consumer=_consumer) - return kwargs - - -def _serialize_list_of_patch_operation( - serializer: ShapeSerializer, schema: Schema, value: list[PatchOperation] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_list_of_patch_operation( - deserializer: ShapeDeserializer, schema: Schema -) -> list[PatchOperation]: - result: list[PatchOperation] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(PatchOperation.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class UpdateAccountInput: - """ - Requests API Gateway to change information about the current Account - resource. - """ - - patch_operations: list[PatchOperation] | None = None - """ - For more information about supported patch operations, see [Patch - Operations](https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_ACCOUNT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.patch_operations is not None: - _serialize_list_of_patch_operation( - serializer, - _SCHEMA_UPDATE_ACCOUNT_INPUT.members["patchOperations"], - self.patch_operations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["patch_operations"] = _deserialize_list_of_patch_operation( - de, _SCHEMA_UPDATE_ACCOUNT_INPUT.members["patchOperations"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_ACCOUNT_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateAccountOutput: - """Represents an AWS account that is associated with API Gateway.""" - - cloudwatch_role_arn: str | None = None - """The ARN of an Amazon CloudWatch role for the current Account.""" - - throttle_settings: ThrottleSettings | None = None - """Specifies the API request limits configured for the current Account.""" - - features: list[str] | None = None - """ - A list of features supported for the account. When usage plans are - enabled, the features list will include an entry of `"UsagePlans"`. - """ - - api_key_version: str | None = None - """The version of the API keys used for the account.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_ACCOUNT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.cloudwatch_role_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_ACCOUNT_OUTPUT.members["cloudwatchRoleArn"], - self.cloudwatch_role_arn, - ) - - if self.throttle_settings is not None: - serializer.write_struct( - _SCHEMA_UPDATE_ACCOUNT_OUTPUT.members["throttleSettings"], - self.throttle_settings, - ) - - if self.features is not None: - _serialize_list_of_string( - serializer, - _SCHEMA_UPDATE_ACCOUNT_OUTPUT.members["features"], - self.features, - ) - - if self.api_key_version is not None: - serializer.write_string( - _SCHEMA_UPDATE_ACCOUNT_OUTPUT.members["apiKeyVersion"], - self.api_key_version, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["cloudwatch_role_arn"] = de.read_string( - _SCHEMA_UPDATE_ACCOUNT_OUTPUT.members["cloudwatchRoleArn"] - ) - - case 1: - kwargs["throttle_settings"] = ThrottleSettings.deserialize(de) - - case 2: - kwargs["features"] = _deserialize_list_of_string( - de, _SCHEMA_UPDATE_ACCOUNT_OUTPUT.members["features"] - ) - - case 3: - kwargs["api_key_version"] = de.read_string( - _SCHEMA_UPDATE_ACCOUNT_OUTPUT.members["apiKeyVersion"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_ACCOUNT_OUTPUT, consumer=_consumer) - return kwargs - - -UPDATE_ACCOUNT = APIOperation( - input=UpdateAccountInput, - output=UpdateAccountOutput, - schema=_SCHEMA_UPDATE_ACCOUNT, - input_schema=_SCHEMA_UPDATE_ACCOUNT_INPUT, - output_schema=_SCHEMA_UPDATE_ACCOUNT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateApiKeyInput: - """A request to change information about an ApiKey resource.""" - - api_key: str | None = None - """The identifier of the ApiKey resource to be updated.""" - - patch_operations: list[PatchOperation] | None = None - """ - For more information about supported patch operations, see [Patch - Operations](https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_API_KEY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.api_key is not None: - serializer.write_string( - _SCHEMA_UPDATE_API_KEY_INPUT.members["apiKey"], self.api_key - ) - - if self.patch_operations is not None: - _serialize_list_of_patch_operation( - serializer, - _SCHEMA_UPDATE_API_KEY_INPUT.members["patchOperations"], - self.patch_operations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["api_key"] = de.read_string( - _SCHEMA_UPDATE_API_KEY_INPUT.members["apiKey"] - ) - - case 1: - kwargs["patch_operations"] = _deserialize_list_of_patch_operation( - de, _SCHEMA_UPDATE_API_KEY_INPUT.members["patchOperations"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_API_KEY_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateApiKeyOutput: - """ - A resource that can be distributed to callers for executing Method - resources that require an API key. API keys can be mapped to any Stage - on any RestApi, which indicates that the callers with the API key can - make requests to that stage. - """ - - id: str | None = None - """The identifier of the API Key.""" - - value: str | None = None - """The value of the API Key.""" - - name: str | None = None - """The name of the API Key.""" - - customer_id: str | None = None - """ - An Amazon Web Services Marketplace customer identifier, when integrating - with the Amazon Web Services SaaS Marketplace. - """ - - description: str | None = None - """The description of the API Key.""" - - enabled: bool = False - """Specifies whether the API Key can be used by callers.""" - - created_date: datetime | None = None - """The timestamp when the API Key was created.""" - - last_updated_date: datetime | None = None - """The timestamp when the API Key was last updated.""" - - stage_keys: list[str] | None = None - """A list of Stage resources that are associated with the ApiKey resource.""" - - tags: dict[str, str] | None = None - """ - The collection of tags. Each tag element is associated with a given - resource. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_API_KEY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string( - _SCHEMA_UPDATE_API_KEY_OUTPUT.members["id"], self.id - ) - - if self.value is not None: - serializer.write_string( - _SCHEMA_UPDATE_API_KEY_OUTPUT.members["value"], self.value - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_UPDATE_API_KEY_OUTPUT.members["name"], self.name - ) - - if self.customer_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_API_KEY_OUTPUT.members["customerId"], self.customer_id - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_API_KEY_OUTPUT.members["description"], self.description - ) - - serializer.write_boolean( - _SCHEMA_UPDATE_API_KEY_OUTPUT.members["enabled"], self.enabled - ) - if self.created_date is not None: - serializer.write_timestamp( - _SCHEMA_UPDATE_API_KEY_OUTPUT.members["createdDate"], self.created_date - ) - - if self.last_updated_date is not None: - serializer.write_timestamp( - _SCHEMA_UPDATE_API_KEY_OUTPUT.members["lastUpdatedDate"], - self.last_updated_date, - ) - - if self.stage_keys is not None: - _serialize_list_of_string( - serializer, - _SCHEMA_UPDATE_API_KEY_OUTPUT.members["stageKeys"], - self.stage_keys, - ) - - if self.tags is not None: - _serialize_map_of_string_to_string( - serializer, _SCHEMA_UPDATE_API_KEY_OUTPUT.members["tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_UPDATE_API_KEY_OUTPUT.members["id"] - ) - - case 1: - kwargs["value"] = de.read_string( - _SCHEMA_UPDATE_API_KEY_OUTPUT.members["value"] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_API_KEY_OUTPUT.members["name"] - ) - - case 3: - kwargs["customer_id"] = de.read_string( - _SCHEMA_UPDATE_API_KEY_OUTPUT.members["customerId"] - ) - - case 4: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_API_KEY_OUTPUT.members["description"] - ) - - case 5: - kwargs["enabled"] = de.read_boolean( - _SCHEMA_UPDATE_API_KEY_OUTPUT.members["enabled"] - ) - - case 6: - kwargs["created_date"] = de.read_timestamp( - _SCHEMA_UPDATE_API_KEY_OUTPUT.members["createdDate"] - ) - - case 7: - kwargs["last_updated_date"] = de.read_timestamp( - _SCHEMA_UPDATE_API_KEY_OUTPUT.members["lastUpdatedDate"] - ) - - case 8: - kwargs["stage_keys"] = _deserialize_list_of_string( - de, _SCHEMA_UPDATE_API_KEY_OUTPUT.members["stageKeys"] - ) - - case 9: - kwargs["tags"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_UPDATE_API_KEY_OUTPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_API_KEY_OUTPUT, consumer=_consumer) - return kwargs - - -UPDATE_API_KEY = APIOperation( - input=UpdateApiKeyInput, - output=UpdateApiKeyOutput, - schema=_SCHEMA_UPDATE_API_KEY, - input_schema=_SCHEMA_UPDATE_API_KEY_INPUT, - output_schema=_SCHEMA_UPDATE_API_KEY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateAuthorizerInput: - """Request to update an existing Authorizer resource.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - authorizer_id: str | None = None - """The identifier of the Authorizer resource.""" - - patch_operations: list[PatchOperation] | None = None - """ - For more information about supported patch operations, see [Patch - Operations](https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_AUTHORIZER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_AUTHORIZER_INPUT.members["restApiId"], self.rest_api_id - ) - - if self.authorizer_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_AUTHORIZER_INPUT.members["authorizerId"], - self.authorizer_id, - ) - - if self.patch_operations is not None: - _serialize_list_of_patch_operation( - serializer, - _SCHEMA_UPDATE_AUTHORIZER_INPUT.members["patchOperations"], - self.patch_operations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_UPDATE_AUTHORIZER_INPUT.members["restApiId"] - ) - - case 1: - kwargs["authorizer_id"] = de.read_string( - _SCHEMA_UPDATE_AUTHORIZER_INPUT.members["authorizerId"] - ) - - case 2: - kwargs["patch_operations"] = _deserialize_list_of_patch_operation( - de, _SCHEMA_UPDATE_AUTHORIZER_INPUT.members["patchOperations"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_AUTHORIZER_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateAuthorizerOutput: - """ - Represents an authorization layer for methods. If enabled on a method, - API Gateway will activate the authorizer when a client calls the method. - """ - - id: str | None = None - """The identifier for the authorizer resource.""" - - name: str | None = None - """The name of the authorizer.""" - - type: str | None = None - """ - The authorizer type. Valid values are `TOKEN` for a Lambda function - using a single authorization token submitted in a custom header, - `REQUEST` for a Lambda function using incoming request parameters, and - `COGNITO_USER_POOLS` for using an Amazon Cognito user pool. - """ - - provider_ar_ns: list[str] | None = None - """ - A list of the Amazon Cognito user pool ARNs for the `COGNITO_USER_POOLS` - authorizer. Each element is of this format: - `arn:aws:cognito-idp:{region}:{account_id}:userpool/{user_pool_id}`. For - a `TOKEN` or `REQUEST` authorizer, this is not defined. - """ - - auth_type: str | None = None - """ - Optional customer-defined field, used in OpenAPI imports and exports - without functional impact. - """ - - authorizer_uri: str | None = None - """ - Specifies the authorizer's Uniform Resource Identifier (URI). For - `TOKEN` or `REQUEST` authorizers, this must be a well-formed Lambda - function URI, for example, - `arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:{account_id}:function:{lambda_function_name}/invocations`. - In general, the URI has this form - `arn:aws:apigateway:{region}:lambda:path/{service_api}`, where - `{region}` is the same as the region hosting the Lambda function, `path` - indicates that the remaining substring in the URI should be treated as - the path to the resource, including the initial `/`. For Lambda - functions, this is usually of the form - `/2015-03-31/functions/[FunctionARN]/invocations`. - """ - - authorizer_credentials: str | None = None - """ - Specifies the required credentials as an IAM role for API Gateway to - invoke the authorizer. To specify an IAM role for API Gateway to assume, - use the role's Amazon Resource Name (ARN). To use resource-based - permissions on the Lambda function, specify null. - """ - - identity_source: str | None = None - """ - The identity source for which authorization is requested. For a `TOKEN` - or `COGNITO_USER_POOLS` authorizer, this is required and specifies the - request header mapping expression for the custom header holding the - authorization token submitted by the client. For example, if the token - header name is `Auth`, the header mapping expression is - `method.request.header.Auth`. For the `REQUEST` authorizer, this is - required when authorization caching is enabled. The value is a - comma-separated string of one or more mapping expressions of the - specified request parameters. For example, if an `Auth` header, a `Name` - query string parameter are defined as identity sources, this value is - `method.request.header.Auth`, `method.request.querystring.Name`. These - parameters will be used to derive the authorization caching key and to - perform runtime validation of the `REQUEST` authorizer by verifying all - of the identity-related request parameters are present, not null and - non-empty. Only when this is true does the authorizer invoke the - authorizer Lambda function, otherwise, it returns a 401 Unauthorized - response without calling the Lambda function. The valid value is a - string of comma-separated mapping expressions of the specified request - parameters. When the authorization caching is not enabled, this property - is optional. - """ - - identity_validation_expression: str | None = None - """ - A validation expression for the incoming identity token. For `TOKEN` - authorizers, this value is a regular expression. For - `COGNITO_USER_POOLS` authorizers, API Gateway will match the `aud` field - of the incoming token from the client against the specified regular - expression. It will invoke the authorizer's Lambda function when there - is a match. Otherwise, it will return a 401 Unauthorized response - without calling the Lambda function. The validation expression does not - apply to the `REQUEST` authorizer. - """ - - authorizer_result_ttl_in_seconds: int | None = None - """ - The TTL in seconds of cached authorizer results. If it equals 0, - authorization caching is disabled. If it is greater than 0, API Gateway - will cache authorizer responses. If this field is not set, the default - value is 300. The maximum value is 3600, or 1 hour. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_AUTHORIZER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string( - _SCHEMA_UPDATE_AUTHORIZER_OUTPUT.members["id"], self.id - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_UPDATE_AUTHORIZER_OUTPUT.members["name"], self.name - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_UPDATE_AUTHORIZER_OUTPUT.members["type"], self.type - ) - - if self.provider_ar_ns is not None: - _serialize_list_of_ar_ns( - serializer, - _SCHEMA_UPDATE_AUTHORIZER_OUTPUT.members["providerARNs"], - self.provider_ar_ns, - ) - - if self.auth_type is not None: - serializer.write_string( - _SCHEMA_UPDATE_AUTHORIZER_OUTPUT.members["authType"], self.auth_type - ) - - if self.authorizer_uri is not None: - serializer.write_string( - _SCHEMA_UPDATE_AUTHORIZER_OUTPUT.members["authorizerUri"], - self.authorizer_uri, - ) - - if self.authorizer_credentials is not None: - serializer.write_string( - _SCHEMA_UPDATE_AUTHORIZER_OUTPUT.members["authorizerCredentials"], - self.authorizer_credentials, - ) - - if self.identity_source is not None: - serializer.write_string( - _SCHEMA_UPDATE_AUTHORIZER_OUTPUT.members["identitySource"], - self.identity_source, - ) - - if self.identity_validation_expression is not None: - serializer.write_string( - _SCHEMA_UPDATE_AUTHORIZER_OUTPUT.members[ - "identityValidationExpression" - ], - self.identity_validation_expression, - ) - - if self.authorizer_result_ttl_in_seconds is not None: - serializer.write_integer( - _SCHEMA_UPDATE_AUTHORIZER_OUTPUT.members[ - "authorizerResultTtlInSeconds" - ], - self.authorizer_result_ttl_in_seconds, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_UPDATE_AUTHORIZER_OUTPUT.members["id"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_AUTHORIZER_OUTPUT.members["name"] - ) - - case 2: - kwargs["type"] = AuthorizerType( - de.read_string(_SCHEMA_UPDATE_AUTHORIZER_OUTPUT.members["type"]) - ) - - case 3: - kwargs["provider_ar_ns"] = _deserialize_list_of_ar_ns( - de, _SCHEMA_UPDATE_AUTHORIZER_OUTPUT.members["providerARNs"] - ) - - case 4: - kwargs["auth_type"] = de.read_string( - _SCHEMA_UPDATE_AUTHORIZER_OUTPUT.members["authType"] - ) - - case 5: - kwargs["authorizer_uri"] = de.read_string( - _SCHEMA_UPDATE_AUTHORIZER_OUTPUT.members["authorizerUri"] - ) - - case 6: - kwargs["authorizer_credentials"] = de.read_string( - _SCHEMA_UPDATE_AUTHORIZER_OUTPUT.members[ - "authorizerCredentials" - ] - ) - - case 7: - kwargs["identity_source"] = de.read_string( - _SCHEMA_UPDATE_AUTHORIZER_OUTPUT.members["identitySource"] - ) - - case 8: - kwargs["identity_validation_expression"] = de.read_string( - _SCHEMA_UPDATE_AUTHORIZER_OUTPUT.members[ - "identityValidationExpression" - ] - ) - - case 9: - kwargs["authorizer_result_ttl_in_seconds"] = de.read_integer( - _SCHEMA_UPDATE_AUTHORIZER_OUTPUT.members[ - "authorizerResultTtlInSeconds" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_AUTHORIZER_OUTPUT, consumer=_consumer) - return kwargs - - -UPDATE_AUTHORIZER = APIOperation( - input=UpdateAuthorizerInput, - output=UpdateAuthorizerOutput, - schema=_SCHEMA_UPDATE_AUTHORIZER, - input_schema=_SCHEMA_UPDATE_AUTHORIZER_INPUT, - output_schema=_SCHEMA_UPDATE_AUTHORIZER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateBasePathMappingInput: - """A request to change information about the BasePathMapping resource.""" - - domain_name: str | None = None - """The domain name of the BasePathMapping resource to change.""" - - domain_name_id: str | None = None - """ - The identifier for the domain name resource. Supported only for private - custom domain names. - """ - - base_path: str | None = None - """ - The base path of the BasePathMapping resource to change. - - To specify an empty base path, set this parameter to `'(none)'`. - """ - - patch_operations: list[PatchOperation] | None = None - """ - For more information about supported patch operations, see [Patch - Operations](https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_BASE_PATH_MAPPING_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.domain_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_BASE_PATH_MAPPING_INPUT.members["domainName"], - self.domain_name, - ) - - if self.domain_name_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_BASE_PATH_MAPPING_INPUT.members["domainNameId"], - self.domain_name_id, - ) - - if self.base_path is not None: - serializer.write_string( - _SCHEMA_UPDATE_BASE_PATH_MAPPING_INPUT.members["basePath"], - self.base_path, - ) - - if self.patch_operations is not None: - _serialize_list_of_patch_operation( - serializer, - _SCHEMA_UPDATE_BASE_PATH_MAPPING_INPUT.members["patchOperations"], - self.patch_operations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["domain_name"] = de.read_string( - _SCHEMA_UPDATE_BASE_PATH_MAPPING_INPUT.members["domainName"] - ) - - case 1: - kwargs["domain_name_id"] = de.read_string( - _SCHEMA_UPDATE_BASE_PATH_MAPPING_INPUT.members["domainNameId"] - ) - - case 2: - kwargs["base_path"] = de.read_string( - _SCHEMA_UPDATE_BASE_PATH_MAPPING_INPUT.members["basePath"] - ) - - case 3: - kwargs["patch_operations"] = _deserialize_list_of_patch_operation( - de, - _SCHEMA_UPDATE_BASE_PATH_MAPPING_INPUT.members[ - "patchOperations" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_BASE_PATH_MAPPING_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateBasePathMappingOutput: - """ - Represents the base path that callers of the API must provide as part of - the URL after the domain name. - """ - - base_path: str | None = None - """ - The base path name that callers of the API must provide as part of the - URL after the domain name. - """ - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - stage: str | None = None - """The name of the associated stage.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_BASE_PATH_MAPPING_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.base_path is not None: - serializer.write_string( - _SCHEMA_UPDATE_BASE_PATH_MAPPING_OUTPUT.members["basePath"], - self.base_path, - ) - - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_BASE_PATH_MAPPING_OUTPUT.members["restApiId"], - self.rest_api_id, - ) - - if self.stage is not None: - serializer.write_string( - _SCHEMA_UPDATE_BASE_PATH_MAPPING_OUTPUT.members["stage"], self.stage - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["base_path"] = de.read_string( - _SCHEMA_UPDATE_BASE_PATH_MAPPING_OUTPUT.members["basePath"] - ) - - case 1: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_UPDATE_BASE_PATH_MAPPING_OUTPUT.members["restApiId"] - ) - - case 2: - kwargs["stage"] = de.read_string( - _SCHEMA_UPDATE_BASE_PATH_MAPPING_OUTPUT.members["stage"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_BASE_PATH_MAPPING_OUTPUT, consumer=_consumer - ) - return kwargs - - -UPDATE_BASE_PATH_MAPPING = APIOperation( - input=UpdateBasePathMappingInput, - output=UpdateBasePathMappingOutput, - schema=_SCHEMA_UPDATE_BASE_PATH_MAPPING, - input_schema=_SCHEMA_UPDATE_BASE_PATH_MAPPING_INPUT, - output_schema=_SCHEMA_UPDATE_BASE_PATH_MAPPING_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateClientCertificateInput: - """A request to change information about an ClientCertificate resource.""" - - client_certificate_id: str | None = None - """The identifier of the ClientCertificate resource to be updated.""" - - patch_operations: list[PatchOperation] | None = None - """ - For more information about supported patch operations, see [Patch - Operations](https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_CLIENT_CERTIFICATE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.client_certificate_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_CLIENT_CERTIFICATE_INPUT.members["clientCertificateId"], - self.client_certificate_id, - ) - - if self.patch_operations is not None: - _serialize_list_of_patch_operation( - serializer, - _SCHEMA_UPDATE_CLIENT_CERTIFICATE_INPUT.members["patchOperations"], - self.patch_operations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["client_certificate_id"] = de.read_string( - _SCHEMA_UPDATE_CLIENT_CERTIFICATE_INPUT.members[ - "clientCertificateId" - ] - ) - - case 1: - kwargs["patch_operations"] = _deserialize_list_of_patch_operation( - de, - _SCHEMA_UPDATE_CLIENT_CERTIFICATE_INPUT.members[ - "patchOperations" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_CLIENT_CERTIFICATE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateClientCertificateOutput: - """ - Represents a client certificate used to configure client-side SSL - authentication while sending requests to the integration endpoint. - """ - - client_certificate_id: str | None = None - """The identifier of the client certificate.""" - - description: str | None = None - """The description of the client certificate.""" - - pem_encoded_certificate: str | None = None - """ - The PEM-encoded public key of the client certificate, which can be used - to configure certificate authentication in the integration endpoint . - """ - - created_date: datetime | None = None - """The timestamp when the client certificate was created.""" - - expiration_date: datetime | None = None - """The timestamp when the client certificate will expire.""" - - tags: dict[str, str] | None = None - """ - The collection of tags. Each tag element is associated with a given - resource. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_CLIENT_CERTIFICATE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.client_certificate_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_CLIENT_CERTIFICATE_OUTPUT.members["clientCertificateId"], - self.client_certificate_id, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_CLIENT_CERTIFICATE_OUTPUT.members["description"], - self.description, - ) - - if self.pem_encoded_certificate is not None: - serializer.write_string( - _SCHEMA_UPDATE_CLIENT_CERTIFICATE_OUTPUT.members[ - "pemEncodedCertificate" - ], - self.pem_encoded_certificate, - ) - - if self.created_date is not None: - serializer.write_timestamp( - _SCHEMA_UPDATE_CLIENT_CERTIFICATE_OUTPUT.members["createdDate"], - self.created_date, - ) - - if self.expiration_date is not None: - serializer.write_timestamp( - _SCHEMA_UPDATE_CLIENT_CERTIFICATE_OUTPUT.members["expirationDate"], - self.expiration_date, - ) - - if self.tags is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_UPDATE_CLIENT_CERTIFICATE_OUTPUT.members["tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["client_certificate_id"] = de.read_string( - _SCHEMA_UPDATE_CLIENT_CERTIFICATE_OUTPUT.members[ - "clientCertificateId" - ] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_CLIENT_CERTIFICATE_OUTPUT.members["description"] - ) - - case 2: - kwargs["pem_encoded_certificate"] = de.read_string( - _SCHEMA_UPDATE_CLIENT_CERTIFICATE_OUTPUT.members[ - "pemEncodedCertificate" - ] - ) - - case 3: - kwargs["created_date"] = de.read_timestamp( - _SCHEMA_UPDATE_CLIENT_CERTIFICATE_OUTPUT.members["createdDate"] - ) - - case 4: - kwargs["expiration_date"] = de.read_timestamp( - _SCHEMA_UPDATE_CLIENT_CERTIFICATE_OUTPUT.members[ - "expirationDate" - ] - ) - - case 5: - kwargs["tags"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_UPDATE_CLIENT_CERTIFICATE_OUTPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_CLIENT_CERTIFICATE_OUTPUT, consumer=_consumer - ) - return kwargs - - -UPDATE_CLIENT_CERTIFICATE = APIOperation( - input=UpdateClientCertificateInput, - output=UpdateClientCertificateOutput, - schema=_SCHEMA_UPDATE_CLIENT_CERTIFICATE, - input_schema=_SCHEMA_UPDATE_CLIENT_CERTIFICATE_INPUT, - output_schema=_SCHEMA_UPDATE_CLIENT_CERTIFICATE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateDeploymentInput: - """Requests API Gateway to change information about a Deployment resource.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - deployment_id: str | None = None - """ - The replacement identifier for the Deployment resource to change - information about. - """ - - patch_operations: list[PatchOperation] | None = None - """ - For more information about supported patch operations, see [Patch - Operations](https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_DEPLOYMENT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_DEPLOYMENT_INPUT.members["restApiId"], self.rest_api_id - ) - - if self.deployment_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_DEPLOYMENT_INPUT.members["deploymentId"], - self.deployment_id, - ) - - if self.patch_operations is not None: - _serialize_list_of_patch_operation( - serializer, - _SCHEMA_UPDATE_DEPLOYMENT_INPUT.members["patchOperations"], - self.patch_operations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_UPDATE_DEPLOYMENT_INPUT.members["restApiId"] - ) - - case 1: - kwargs["deployment_id"] = de.read_string( - _SCHEMA_UPDATE_DEPLOYMENT_INPUT.members["deploymentId"] - ) - - case 2: - kwargs["patch_operations"] = _deserialize_list_of_patch_operation( - de, _SCHEMA_UPDATE_DEPLOYMENT_INPUT.members["patchOperations"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_DEPLOYMENT_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateDeploymentOutput: - """ - An immutable representation of a RestApi resource that can be called by - users using Stages. A deployment must be associated with a Stage for it - to be callable over the Internet. - """ - - id: str | None = None - """The identifier for the deployment resource.""" - - description: str | None = None - """The description for the deployment resource.""" - - created_date: datetime | None = None - """The date and time that the deployment resource was created.""" - - api_summary: dict[str, dict[str, MethodSnapshot]] | None = None - """ - A summary of the RestApi at the date and time that the deployment - resource was created. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_DEPLOYMENT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string( - _SCHEMA_UPDATE_DEPLOYMENT_OUTPUT.members["id"], self.id - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_DEPLOYMENT_OUTPUT.members["description"], - self.description, - ) - - if self.created_date is not None: - serializer.write_timestamp( - _SCHEMA_UPDATE_DEPLOYMENT_OUTPUT.members["createdDate"], - self.created_date, - ) - - if self.api_summary is not None: - _serialize_path_to_map_of_method_snapshot( - serializer, - _SCHEMA_UPDATE_DEPLOYMENT_OUTPUT.members["apiSummary"], - self.api_summary, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_UPDATE_DEPLOYMENT_OUTPUT.members["id"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_DEPLOYMENT_OUTPUT.members["description"] - ) - - case 2: - kwargs["created_date"] = de.read_timestamp( - _SCHEMA_UPDATE_DEPLOYMENT_OUTPUT.members["createdDate"] - ) - - case 3: - kwargs["api_summary"] = _deserialize_path_to_map_of_method_snapshot( - de, _SCHEMA_UPDATE_DEPLOYMENT_OUTPUT.members["apiSummary"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_DEPLOYMENT_OUTPUT, consumer=_consumer) - return kwargs - - -UPDATE_DEPLOYMENT = APIOperation( - input=UpdateDeploymentInput, - output=UpdateDeploymentOutput, - schema=_SCHEMA_UPDATE_DEPLOYMENT, - input_schema=_SCHEMA_UPDATE_DEPLOYMENT_INPUT, - output_schema=_SCHEMA_UPDATE_DEPLOYMENT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#ServiceUnavailableException" - ): ServiceUnavailableException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_UNAVAILABLE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateDocumentationPartInput: - """Updates an existing documentation part of a given API.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - documentation_part_id: str | None = None - """The identifier of the to-be-updated documentation part.""" - - patch_operations: list[PatchOperation] | None = None - """ - For more information about supported patch operations, see [Patch - Operations](https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_DOCUMENTATION_PART_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_DOCUMENTATION_PART_INPUT.members["restApiId"], - self.rest_api_id, - ) - - if self.documentation_part_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_DOCUMENTATION_PART_INPUT.members["documentationPartId"], - self.documentation_part_id, - ) - - if self.patch_operations is not None: - _serialize_list_of_patch_operation( - serializer, - _SCHEMA_UPDATE_DOCUMENTATION_PART_INPUT.members["patchOperations"], - self.patch_operations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_UPDATE_DOCUMENTATION_PART_INPUT.members["restApiId"] - ) - - case 1: - kwargs["documentation_part_id"] = de.read_string( - _SCHEMA_UPDATE_DOCUMENTATION_PART_INPUT.members[ - "documentationPartId" - ] - ) - - case 2: - kwargs["patch_operations"] = _deserialize_list_of_patch_operation( - de, - _SCHEMA_UPDATE_DOCUMENTATION_PART_INPUT.members[ - "patchOperations" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_DOCUMENTATION_PART_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateDocumentationPartOutput: - """A documentation part for a targeted API entity.""" - - id: str | None = None - """ - The DocumentationPart identifier, generated by API Gateway when the - `DocumentationPart` is created. - """ - - location: DocumentationPartLocation | None = None - """ - The location of the API entity to which the documentation applies. Valid - fields depend on the targeted API entity type. All the valid location - fields are not required. If not explicitly specified, a valid location - field is treated as a wildcard and associated documentation content may - be inherited by matching entities, unless overridden. - """ - - properties: str | None = None - """ - A content map of API-specific key-value pairs describing the targeted - API entity. The map must be encoded as a JSON string, e.g., - `"{ \"description\": \"The API does ...\" }"`. Only OpenAPI-compliant - documentation-related fields from the properties map are exported and, - hence, published as part of the API entity definitions, while the - original documentation parts are exported in a OpenAPI extension of - `x-amazon-apigateway-documentation`. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_DOCUMENTATION_PART_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string( - _SCHEMA_UPDATE_DOCUMENTATION_PART_OUTPUT.members["id"], self.id - ) - - if self.location is not None: - serializer.write_struct( - _SCHEMA_UPDATE_DOCUMENTATION_PART_OUTPUT.members["location"], - self.location, - ) - - if self.properties is not None: - serializer.write_string( - _SCHEMA_UPDATE_DOCUMENTATION_PART_OUTPUT.members["properties"], - self.properties, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_UPDATE_DOCUMENTATION_PART_OUTPUT.members["id"] - ) - - case 1: - kwargs["location"] = DocumentationPartLocation.deserialize(de) - - case 2: - kwargs["properties"] = de.read_string( - _SCHEMA_UPDATE_DOCUMENTATION_PART_OUTPUT.members["properties"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_DOCUMENTATION_PART_OUTPUT, consumer=_consumer - ) - return kwargs - - -UPDATE_DOCUMENTATION_PART = APIOperation( - input=UpdateDocumentationPartInput, - output=UpdateDocumentationPartOutput, - schema=_SCHEMA_UPDATE_DOCUMENTATION_PART, - input_schema=_SCHEMA_UPDATE_DOCUMENTATION_PART_INPUT, - output_schema=_SCHEMA_UPDATE_DOCUMENTATION_PART_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateDocumentationVersionInput: - """Updates an existing documentation version of an API.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - documentation_version: str | None = None - """The version identifier of the to-be-updated documentation version.""" - - patch_operations: list[PatchOperation] | None = None - """ - For more information about supported patch operations, see [Patch - Operations](https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_DOCUMENTATION_VERSION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_DOCUMENTATION_VERSION_INPUT.members["restApiId"], - self.rest_api_id, - ) - - if self.documentation_version is not None: - serializer.write_string( - _SCHEMA_UPDATE_DOCUMENTATION_VERSION_INPUT.members[ - "documentationVersion" - ], - self.documentation_version, - ) - - if self.patch_operations is not None: - _serialize_list_of_patch_operation( - serializer, - _SCHEMA_UPDATE_DOCUMENTATION_VERSION_INPUT.members["patchOperations"], - self.patch_operations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_UPDATE_DOCUMENTATION_VERSION_INPUT.members["restApiId"] - ) - - case 1: - kwargs["documentation_version"] = de.read_string( - _SCHEMA_UPDATE_DOCUMENTATION_VERSION_INPUT.members[ - "documentationVersion" - ] - ) - - case 2: - kwargs["patch_operations"] = _deserialize_list_of_patch_operation( - de, - _SCHEMA_UPDATE_DOCUMENTATION_VERSION_INPUT.members[ - "patchOperations" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_DOCUMENTATION_VERSION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateDocumentationVersionOutput: - """A snapshot of the documentation of an API.""" - - version: str | None = None - """The version identifier of the API documentation snapshot.""" - - created_date: datetime | None = None - """The date when the API documentation snapshot is created.""" - - description: str | None = None - """The description of the API documentation snapshot.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_DOCUMENTATION_VERSION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.version is not None: - serializer.write_string( - _SCHEMA_UPDATE_DOCUMENTATION_VERSION_OUTPUT.members["version"], - self.version, - ) - - if self.created_date is not None: - serializer.write_timestamp( - _SCHEMA_UPDATE_DOCUMENTATION_VERSION_OUTPUT.members["createdDate"], - self.created_date, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_DOCUMENTATION_VERSION_OUTPUT.members["description"], - self.description, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["version"] = de.read_string( - _SCHEMA_UPDATE_DOCUMENTATION_VERSION_OUTPUT.members["version"] - ) - - case 1: - kwargs["created_date"] = de.read_timestamp( - _SCHEMA_UPDATE_DOCUMENTATION_VERSION_OUTPUT.members[ - "createdDate" - ] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_DOCUMENTATION_VERSION_OUTPUT.members[ - "description" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_DOCUMENTATION_VERSION_OUTPUT, consumer=_consumer - ) - return kwargs - - -UPDATE_DOCUMENTATION_VERSION = APIOperation( - input=UpdateDocumentationVersionInput, - output=UpdateDocumentationVersionOutput, - schema=_SCHEMA_UPDATE_DOCUMENTATION_VERSION, - input_schema=_SCHEMA_UPDATE_DOCUMENTATION_VERSION_INPUT, - output_schema=_SCHEMA_UPDATE_DOCUMENTATION_VERSION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateDomainNameInput: - """A request to change information about the DomainName resource.""" - - domain_name: str | None = None - """The name of the DomainName resource to be changed.""" - - domain_name_id: str | None = None - """ - The identifier for the domain name resource. Supported only for private - custom domain names. - """ - - patch_operations: list[PatchOperation] | None = None - """ - For more information about supported patch operations, see [Patch - Operations](https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_DOMAIN_NAME_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.domain_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_DOMAIN_NAME_INPUT.members["domainName"], self.domain_name - ) - - if self.domain_name_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_DOMAIN_NAME_INPUT.members["domainNameId"], - self.domain_name_id, - ) - - if self.patch_operations is not None: - _serialize_list_of_patch_operation( - serializer, - _SCHEMA_UPDATE_DOMAIN_NAME_INPUT.members["patchOperations"], - self.patch_operations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["domain_name"] = de.read_string( - _SCHEMA_UPDATE_DOMAIN_NAME_INPUT.members["domainName"] - ) - - case 1: - kwargs["domain_name_id"] = de.read_string( - _SCHEMA_UPDATE_DOMAIN_NAME_INPUT.members["domainNameId"] - ) - - case 2: - kwargs["patch_operations"] = _deserialize_list_of_patch_operation( - de, _SCHEMA_UPDATE_DOMAIN_NAME_INPUT.members["patchOperations"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_DOMAIN_NAME_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateDomainNameOutput: - """ - Represents a custom domain name as a user-friendly host name of an API - (RestApi). - """ - - domain_name: str | None = None - """ - The custom domain name as an API host name, for example, - `my-api.example.com`. - """ - - domain_name_id: str | None = None - """ - The identifier for the domain name resource. Supported only for private - custom domain names. - """ - - domain_name_arn: str | None = None - """The ARN of the domain name.""" - - certificate_name: str | None = None - """ - The name of the certificate that will be used by edge-optimized endpoint - or private endpoint for this domain name. - """ - - certificate_arn: str | None = None - """ - The reference to an Amazon Web Services-managed certificate that will be - used by edge-optimized endpoint or private endpoint for this domain - name. Certificate Manager is the only supported source. - """ - - certificate_upload_date: datetime | None = None - """ - The timestamp when the certificate that was used by edge-optimized - endpoint or private endpoint for this domain name was uploaded. - """ - - regional_domain_name: str | None = None - """ - The domain name associated with the regional endpoint for this custom - domain name. You set up this association by adding a DNS record that - points the custom domain name to this regional domain name. The regional - domain name is returned by API Gateway when you create a regional - endpoint. - """ - - regional_hosted_zone_id: str | None = None - """ - The region-specific Amazon Route 53 Hosted Zone ID of the regional - endpoint. For more information, see Set up a Regional Custom Domain Name - and AWS Regions and Endpoints for API Gateway. - """ - - regional_certificate_name: str | None = None - """ - The name of the certificate that will be used for validating the - regional domain name. - """ - - regional_certificate_arn: str | None = None - """ - The reference to an Amazon Web Services-managed certificate that will be - used for validating the regional domain name. Certificate Manager is the - only supported source. - """ - - distribution_domain_name: str | None = None - """ - The domain name of the Amazon CloudFront distribution associated with - this custom domain name for an edge-optimized endpoint. You set up this - association when adding a DNS record pointing the custom domain name to - this distribution name. For more information about CloudFront - distributions, see the Amazon CloudFront documentation. - """ - - distribution_hosted_zone_id: str | None = None - """ - The region-agnostic Amazon Route 53 Hosted Zone ID of the edge-optimized - endpoint. The valid value is `Z2FDTNDATAQYW2` for all the regions. For - more information, see Set up a Regional Custom Domain Name and AWS - Regions and Endpoints for API Gateway. - """ - - endpoint_configuration: EndpointConfiguration | None = None - """ - The endpoint configuration of this DomainName showing the endpoint types - and IP address types of the domain name. - """ - - domain_name_status: str | None = None - """ - The status of the DomainName migration. The valid values are `AVAILABLE` - and `UPDATING`. If the status is `UPDATING`, the domain cannot be - modified further until the existing operation is complete. If it is - `AVAILABLE`, the domain can be updated. - """ - - domain_name_status_message: str | None = None - """ - An optional text message containing detailed information about status of - the DomainName migration. - """ - - security_policy: str | None = None - """ - The Transport Layer Security (TLS) version + cipher suite for this - DomainName. - """ - - endpoint_access_mode: str | None = None - """The endpoint access mode of the DomainName.""" - - tags: dict[str, str] | None = None - """ - The collection of tags. Each tag element is associated with a given - resource. - """ - - mutual_tls_authentication: MutualTlsAuthentication | None = None - """ - The mutual TLS authentication configuration for a custom domain name. If - specified, API Gateway performs two-way authentication between the - client and the server. Clients must present a trusted certificate to - access your API. - """ - - ownership_verification_certificate_arn: str | None = None - """ - The ARN of the public certificate issued by ACM to validate ownership of - your custom domain. Only required when configuring mutual TLS and using - an ACM imported or private CA certificate ARN as the - regionalCertificateArn. - """ - - management_policy: str | None = None - """ - A stringified JSON policy document that applies to the API Gateway - Management service for this DomainName. This policy document controls - access for access association sources to create domain name access - associations with this DomainName. Supported only for private custom - domain names. - """ - - policy: str | None = None - """ - A stringified JSON policy document that applies to the `execute-api` - service for this DomainName regardless of the caller and Method - configuration. Supported only for private custom domain names. - """ - - routing_mode: str | None = None - """ - The routing mode for this domain name. The routing mode determines how - API Gateway sends traffic from your custom domain name to your private - APIs. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_DOMAIN_NAME_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.domain_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_DOMAIN_NAME_OUTPUT.members["domainName"], - self.domain_name, - ) - - if self.domain_name_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_DOMAIN_NAME_OUTPUT.members["domainNameId"], - self.domain_name_id, - ) - - if self.domain_name_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_DOMAIN_NAME_OUTPUT.members["domainNameArn"], - self.domain_name_arn, - ) - - if self.certificate_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_DOMAIN_NAME_OUTPUT.members["certificateName"], - self.certificate_name, - ) - - if self.certificate_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_DOMAIN_NAME_OUTPUT.members["certificateArn"], - self.certificate_arn, - ) - - if self.certificate_upload_date is not None: - serializer.write_timestamp( - _SCHEMA_UPDATE_DOMAIN_NAME_OUTPUT.members["certificateUploadDate"], - self.certificate_upload_date, - ) - - if self.regional_domain_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_DOMAIN_NAME_OUTPUT.members["regionalDomainName"], - self.regional_domain_name, - ) - - if self.regional_hosted_zone_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_DOMAIN_NAME_OUTPUT.members["regionalHostedZoneId"], - self.regional_hosted_zone_id, - ) - - if self.regional_certificate_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_DOMAIN_NAME_OUTPUT.members["regionalCertificateName"], - self.regional_certificate_name, - ) - - if self.regional_certificate_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_DOMAIN_NAME_OUTPUT.members["regionalCertificateArn"], - self.regional_certificate_arn, - ) - - if self.distribution_domain_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_DOMAIN_NAME_OUTPUT.members["distributionDomainName"], - self.distribution_domain_name, - ) - - if self.distribution_hosted_zone_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_DOMAIN_NAME_OUTPUT.members["distributionHostedZoneId"], - self.distribution_hosted_zone_id, - ) - - if self.endpoint_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_DOMAIN_NAME_OUTPUT.members["endpointConfiguration"], - self.endpoint_configuration, - ) - - if self.domain_name_status is not None: - serializer.write_string( - _SCHEMA_UPDATE_DOMAIN_NAME_OUTPUT.members["domainNameStatus"], - self.domain_name_status, - ) - - if self.domain_name_status_message is not None: - serializer.write_string( - _SCHEMA_UPDATE_DOMAIN_NAME_OUTPUT.members["domainNameStatusMessage"], - self.domain_name_status_message, - ) - - if self.security_policy is not None: - serializer.write_string( - _SCHEMA_UPDATE_DOMAIN_NAME_OUTPUT.members["securityPolicy"], - self.security_policy, - ) - - if self.endpoint_access_mode is not None: - serializer.write_string( - _SCHEMA_UPDATE_DOMAIN_NAME_OUTPUT.members["endpointAccessMode"], - self.endpoint_access_mode, - ) - - if self.tags is not None: - _serialize_map_of_string_to_string( - serializer, _SCHEMA_UPDATE_DOMAIN_NAME_OUTPUT.members["tags"], self.tags - ) - - if self.mutual_tls_authentication is not None: - serializer.write_struct( - _SCHEMA_UPDATE_DOMAIN_NAME_OUTPUT.members["mutualTlsAuthentication"], - self.mutual_tls_authentication, - ) - - if self.ownership_verification_certificate_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_DOMAIN_NAME_OUTPUT.members[ - "ownershipVerificationCertificateArn" - ], - self.ownership_verification_certificate_arn, - ) - - if self.management_policy is not None: - serializer.write_string( - _SCHEMA_UPDATE_DOMAIN_NAME_OUTPUT.members["managementPolicy"], - self.management_policy, - ) - - if self.policy is not None: - serializer.write_string( - _SCHEMA_UPDATE_DOMAIN_NAME_OUTPUT.members["policy"], self.policy - ) - - if self.routing_mode is not None: - serializer.write_string( - _SCHEMA_UPDATE_DOMAIN_NAME_OUTPUT.members["routingMode"], - self.routing_mode, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["domain_name"] = de.read_string( - _SCHEMA_UPDATE_DOMAIN_NAME_OUTPUT.members["domainName"] - ) - - case 1: - kwargs["domain_name_id"] = de.read_string( - _SCHEMA_UPDATE_DOMAIN_NAME_OUTPUT.members["domainNameId"] - ) - - case 2: - kwargs["domain_name_arn"] = de.read_string( - _SCHEMA_UPDATE_DOMAIN_NAME_OUTPUT.members["domainNameArn"] - ) - - case 3: - kwargs["certificate_name"] = de.read_string( - _SCHEMA_UPDATE_DOMAIN_NAME_OUTPUT.members["certificateName"] - ) - - case 4: - kwargs["certificate_arn"] = de.read_string( - _SCHEMA_UPDATE_DOMAIN_NAME_OUTPUT.members["certificateArn"] - ) - - case 5: - kwargs["certificate_upload_date"] = de.read_timestamp( - _SCHEMA_UPDATE_DOMAIN_NAME_OUTPUT.members[ - "certificateUploadDate" - ] - ) - - case 6: - kwargs["regional_domain_name"] = de.read_string( - _SCHEMA_UPDATE_DOMAIN_NAME_OUTPUT.members["regionalDomainName"] - ) - - case 7: - kwargs["regional_hosted_zone_id"] = de.read_string( - _SCHEMA_UPDATE_DOMAIN_NAME_OUTPUT.members[ - "regionalHostedZoneId" - ] - ) - - case 8: - kwargs["regional_certificate_name"] = de.read_string( - _SCHEMA_UPDATE_DOMAIN_NAME_OUTPUT.members[ - "regionalCertificateName" - ] - ) - - case 9: - kwargs["regional_certificate_arn"] = de.read_string( - _SCHEMA_UPDATE_DOMAIN_NAME_OUTPUT.members[ - "regionalCertificateArn" - ] - ) - - case 10: - kwargs["distribution_domain_name"] = de.read_string( - _SCHEMA_UPDATE_DOMAIN_NAME_OUTPUT.members[ - "distributionDomainName" - ] - ) - - case 11: - kwargs["distribution_hosted_zone_id"] = de.read_string( - _SCHEMA_UPDATE_DOMAIN_NAME_OUTPUT.members[ - "distributionHostedZoneId" - ] - ) - - case 12: - kwargs["endpoint_configuration"] = ( - EndpointConfiguration.deserialize(de) - ) - - case 13: - kwargs["domain_name_status"] = DomainNameStatus( - de.read_string( - _SCHEMA_UPDATE_DOMAIN_NAME_OUTPUT.members[ - "domainNameStatus" - ] - ) - ) - - case 14: - kwargs["domain_name_status_message"] = de.read_string( - _SCHEMA_UPDATE_DOMAIN_NAME_OUTPUT.members[ - "domainNameStatusMessage" - ] - ) - - case 15: - kwargs["security_policy"] = SecurityPolicy( - de.read_string( - _SCHEMA_UPDATE_DOMAIN_NAME_OUTPUT.members["securityPolicy"] - ) - ) - - case 16: - kwargs["endpoint_access_mode"] = EndpointAccessMode( - de.read_string( - _SCHEMA_UPDATE_DOMAIN_NAME_OUTPUT.members[ - "endpointAccessMode" - ] - ) - ) - - case 17: - kwargs["tags"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_UPDATE_DOMAIN_NAME_OUTPUT.members["tags"] - ) - - case 18: - kwargs["mutual_tls_authentication"] = ( - MutualTlsAuthentication.deserialize(de) - ) - - case 19: - kwargs["ownership_verification_certificate_arn"] = de.read_string( - _SCHEMA_UPDATE_DOMAIN_NAME_OUTPUT.members[ - "ownershipVerificationCertificateArn" - ] - ) - - case 20: - kwargs["management_policy"] = de.read_string( - _SCHEMA_UPDATE_DOMAIN_NAME_OUTPUT.members["managementPolicy"] - ) - - case 21: - kwargs["policy"] = de.read_string( - _SCHEMA_UPDATE_DOMAIN_NAME_OUTPUT.members["policy"] - ) - - case 22: - kwargs["routing_mode"] = RoutingMode( - de.read_string( - _SCHEMA_UPDATE_DOMAIN_NAME_OUTPUT.members["routingMode"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_DOMAIN_NAME_OUTPUT, consumer=_consumer) - return kwargs - - -UPDATE_DOMAIN_NAME = APIOperation( - input=UpdateDomainNameInput, - output=UpdateDomainNameOutput, - schema=_SCHEMA_UPDATE_DOMAIN_NAME, - input_schema=_SCHEMA_UPDATE_DOMAIN_NAME_INPUT, - output_schema=_SCHEMA_UPDATE_DOMAIN_NAME_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateGatewayResponseInput: - """ - Updates a GatewayResponse of a specified response type on the given - RestApi. - """ - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - response_type: str | None = None - """The response type of the associated GatewayResponse.""" - - patch_operations: list[PatchOperation] | None = None - """ - For more information about supported patch operations, see [Patch - Operations](https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_GATEWAY_RESPONSE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_GATEWAY_RESPONSE_INPUT.members["restApiId"], - self.rest_api_id, - ) - - if self.response_type is not None: - serializer.write_string( - _SCHEMA_UPDATE_GATEWAY_RESPONSE_INPUT.members["responseType"], - self.response_type, - ) - - if self.patch_operations is not None: - _serialize_list_of_patch_operation( - serializer, - _SCHEMA_UPDATE_GATEWAY_RESPONSE_INPUT.members["patchOperations"], - self.patch_operations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_UPDATE_GATEWAY_RESPONSE_INPUT.members["restApiId"] - ) - - case 1: - kwargs["response_type"] = GatewayResponseType( - de.read_string( - _SCHEMA_UPDATE_GATEWAY_RESPONSE_INPUT.members[ - "responseType" - ] - ) - ) - - case 2: - kwargs["patch_operations"] = _deserialize_list_of_patch_operation( - de, - _SCHEMA_UPDATE_GATEWAY_RESPONSE_INPUT.members[ - "patchOperations" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_GATEWAY_RESPONSE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateGatewayResponseOutput: - """ - A gateway response of a given response type and status code, with - optional response parameters and mapping templates. - """ - - response_type: str | None = None - """The response type of the associated GatewayResponse.""" - - status_code: str | None = None - """The HTTP status code for this GatewayResponse.""" - - response_parameters: dict[str, str] | None = None - """ - Response parameters (paths, query strings and headers) of the - GatewayResponse as a string-to-string map of key-value pairs. - """ - - response_templates: dict[str, str] | None = None - """ - Response templates of the GatewayResponse as a string-to-string map of - key-value pairs. - """ - - default_response: bool = False - """ - A Boolean flag to indicate whether this GatewayResponse is the default - gateway response (`true`) or not (`false`). A default gateway response - is one generated by API Gateway without any customization by an API - developer. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_GATEWAY_RESPONSE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.response_type is not None: - serializer.write_string( - _SCHEMA_UPDATE_GATEWAY_RESPONSE_OUTPUT.members["responseType"], - self.response_type, - ) - - if self.status_code is not None: - serializer.write_string( - _SCHEMA_UPDATE_GATEWAY_RESPONSE_OUTPUT.members["statusCode"], - self.status_code, - ) - - if self.response_parameters is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_UPDATE_GATEWAY_RESPONSE_OUTPUT.members["responseParameters"], - self.response_parameters, - ) - - if self.response_templates is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_UPDATE_GATEWAY_RESPONSE_OUTPUT.members["responseTemplates"], - self.response_templates, - ) - - serializer.write_boolean( - _SCHEMA_UPDATE_GATEWAY_RESPONSE_OUTPUT.members["defaultResponse"], - self.default_response, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["response_type"] = GatewayResponseType( - de.read_string( - _SCHEMA_UPDATE_GATEWAY_RESPONSE_OUTPUT.members[ - "responseType" - ] - ) - ) - - case 1: - kwargs["status_code"] = de.read_string( - _SCHEMA_UPDATE_GATEWAY_RESPONSE_OUTPUT.members["statusCode"] - ) - - case 2: - kwargs["response_parameters"] = ( - _deserialize_map_of_string_to_string( - de, - _SCHEMA_UPDATE_GATEWAY_RESPONSE_OUTPUT.members[ - "responseParameters" - ], - ) - ) - - case 3: - kwargs["response_templates"] = _deserialize_map_of_string_to_string( - de, - _SCHEMA_UPDATE_GATEWAY_RESPONSE_OUTPUT.members[ - "responseTemplates" - ], - ) - - case 4: - kwargs["default_response"] = de.read_boolean( - _SCHEMA_UPDATE_GATEWAY_RESPONSE_OUTPUT.members[ - "defaultResponse" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_GATEWAY_RESPONSE_OUTPUT, consumer=_consumer - ) - return kwargs - - -UPDATE_GATEWAY_RESPONSE = APIOperation( - input=UpdateGatewayResponseInput, - output=UpdateGatewayResponseOutput, - schema=_SCHEMA_UPDATE_GATEWAY_RESPONSE, - input_schema=_SCHEMA_UPDATE_GATEWAY_RESPONSE_INPUT, - output_schema=_SCHEMA_UPDATE_GATEWAY_RESPONSE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateIntegrationInput: - """Represents an update integration request.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - resource_id: str | None = None - """Represents an update integration request's resource identifier.""" - - http_method: str | None = None - """Represents an update integration request's HTTP method.""" - - patch_operations: list[PatchOperation] | None = None - """ - For more information about supported patch operations, see [Patch - Operations](https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_INTEGRATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_INTEGRATION_INPUT.members["restApiId"], self.rest_api_id - ) - - if self.resource_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_INTEGRATION_INPUT.members["resourceId"], self.resource_id - ) - - if self.http_method is not None: - serializer.write_string( - _SCHEMA_UPDATE_INTEGRATION_INPUT.members["httpMethod"], self.http_method - ) - - if self.patch_operations is not None: - _serialize_list_of_patch_operation( - serializer, - _SCHEMA_UPDATE_INTEGRATION_INPUT.members["patchOperations"], - self.patch_operations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_UPDATE_INTEGRATION_INPUT.members["restApiId"] - ) - - case 1: - kwargs["resource_id"] = de.read_string( - _SCHEMA_UPDATE_INTEGRATION_INPUT.members["resourceId"] - ) - - case 2: - kwargs["http_method"] = de.read_string( - _SCHEMA_UPDATE_INTEGRATION_INPUT.members["httpMethod"] - ) - - case 3: - kwargs["patch_operations"] = _deserialize_list_of_patch_operation( - de, _SCHEMA_UPDATE_INTEGRATION_INPUT.members["patchOperations"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_INTEGRATION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateIntegrationOutput: - """ - Represents an `HTTP`, `HTTP_PROXY`, `AWS`, `AWS_PROXY`, or Mock - integration. - """ - - type: str | None = None - """ - Specifies an API method integration type. The valid value is one of the - following: - - For the HTTP and HTTP proxy integrations, each integration can specify a - protocol (`http/https`), port and path. Standard 80 and 443 ports are - supported as well as custom ports above 1024. An HTTP or HTTP proxy - integration with a `connectionType` of `VPC_LINK` is referred to as a - private integration and uses a VpcLink to connect API Gateway to a - network load balancer of a VPC. - """ - - http_method: str | None = None - """ - Specifies the integration's HTTP method type. For the Type property, if - you specify `MOCK`, this property is optional. For Lambda integrations, - you must set the integration method to `POST`. For all other types, you - must specify this property. - """ - - uri: str | None = None - """ - Specifies Uniform Resource Identifier (URI) of the integration endpoint. - - For `HTTP` or `HTTP_PROXY` integrations, the URI must be a fully formed, - encoded HTTP(S) URL according to the RFC-3986 specification for standard - integrations. If `connectionType` is `VPC_LINK` specify the Network Load - Balancer DNS name. For `AWS` or `AWS_PROXY` integrations, the URI is of - the form - `arn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api}`. - Here, {Region} is the API Gateway region (e.g., us-east-1); {service} is - the name of the integrated Amazon Web Services service (e.g., s3); and - {subdomain} is a designated subdomain supported by certain Amazon Web - Services service for fast host-name lookup. action can be used for an - Amazon Web Services service action-based API, using an - Action={name}&{p1}={v1}&p2={v2}... query string. The ensuing - {service_api} refers to a supported action {name} plus any required - input parameters. Alternatively, path can be used for an Amazon Web - Services service path-based API. The ensuing service_api refers to the - path to an Amazon Web Services service resource, including the region of - the integrated Amazon Web Services service, if applicable. For example, - for integration with the S3 API of GetObject, the uri can be either - `arn:aws:apigateway:us-west-2:s3:action/GetObject&Bucket={bucket}&Key={key}` - or `arn:aws:apigateway:us-west-2:s3:path/{bucket}/{key}` - """ - - connection_type: str | None = None - """ - The type of the network connection to the integration endpoint. The - valid value is `INTERNET` for connections through the public routable - internet or `VPC_LINK` for private connections between API Gateway and a - network load balancer in a VPC. The default value is `INTERNET`. - """ - - connection_id: str | None = None - """ - The ID of the VpcLink used for the integration when - `connectionType=VPC_LINK` and undefined, otherwise. - """ - - credentials: str | None = None - """ - Specifies the credentials required for the integration, if any. For AWS - integrations, three options are available. To specify an IAM Role for - API Gateway to assume, use the role's Amazon Resource Name (ARN). To - require that the caller's identity be passed through from the request, - specify the string `arn:aws:iam::*:user/*`. To use resource-based - permissions on supported Amazon Web Services services, specify null. - """ - - request_parameters: dict[str, str] | None = None - """ - A key-value map specifying request parameters that are passed from the - method request to the back end. The key is an integration request - parameter name and the associated value is a method request parameter - value or static value that must be enclosed within single quotes and - pre-encoded as required by the back end. The method request parameter - value must match the pattern of `method.request.{location}.{name}`, - where `location` is `querystring`, `path`, or `header` and `name` must - be a valid and unique method request parameter name. - """ - - request_templates: dict[str, str] | None = None - """ - Represents a map of Velocity templates that are applied on the request - payload based on the value of the Content-Type header sent by the - client. The content type value is the key in this map, and the template - (as a String) is the value. - """ - - passthrough_behavior: str | None = None - """ - Specifies how the method request body of an unmapped content type will - be passed through the integration request to the back end without - transformation. A content type is unmapped if no mapping template is - defined in the integration or the content type does not match any of the - mapped content types, as specified in `requestTemplates`. The valid - value is one of the following: `WHEN_NO_MATCH`: passes the method - request body through the integration request to the back end without - transformation when the method request content type does not match any - content type associated with the mapping templates defined in the - integration request. `WHEN_NO_TEMPLATES`: passes the method request body - through the integration request to the back end without transformation - when no mapping template is defined in the integration request. If a - template is defined when this option is selected, the method request of - an unmapped content-type will be rejected with an HTTP 415 Unsupported - Media Type response. `NEVER`: rejects the method request with an HTTP - 415 Unsupported Media Type response when either the method request - content type does not match any content type associated with the mapping - templates defined in the integration request or no mapping template is - defined in the integration request. - """ - - content_handling: str | None = None - """ - Specifies how to handle request payload content type conversions. - Supported values are `CONVERT_TO_BINARY` and `CONVERT_TO_TEXT`, with the - following behaviors: - - If this property is not defined, the request payload will be passed - through from the method request to integration request without - modification, provided that the `passthroughBehavior` is configured to - support payload pass-through. - """ - - timeout_in_millis: int = 0 - """ - Custom timeout between 50 and 29,000 milliseconds. The default value is - 29,000 milliseconds or 29 seconds. You can increase the default value to - longer than 29 seconds for Regional or private APIs only. - """ - - cache_namespace: str | None = None - """ - Specifies a group of related cached parameters. By default, API Gateway - uses the resource ID as the `cacheNamespace`. You can specify the same - `cacheNamespace` across resources to return the same cached data for - requests to different resources. - """ - - cache_key_parameters: list[str] | None = None - """ - A list of request parameters whose values API Gateway caches. To be - valid values for `cacheKeyParameters`, these parameters must also be - specified for Method `requestParameters`. - """ - - integration_responses: dict[str, IntegrationResponse] | None = None - """Specifies the integration's responses.""" - - tls_config: TlsConfig | None = None - """Specifies the TLS configuration for an integration.""" - - response_transfer_mode: str | None = None - """The response transfer mode of the integration.""" - - integration_target: str | None = None - """The ALB or NLB listener to send the request to.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_INTEGRATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_UPDATE_INTEGRATION_OUTPUT.members["type"], self.type - ) - - if self.http_method is not None: - serializer.write_string( - _SCHEMA_UPDATE_INTEGRATION_OUTPUT.members["httpMethod"], - self.http_method, - ) - - if self.uri is not None: - serializer.write_string( - _SCHEMA_UPDATE_INTEGRATION_OUTPUT.members["uri"], self.uri - ) - - if self.connection_type is not None: - serializer.write_string( - _SCHEMA_UPDATE_INTEGRATION_OUTPUT.members["connectionType"], - self.connection_type, - ) - - if self.connection_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_INTEGRATION_OUTPUT.members["connectionId"], - self.connection_id, - ) - - if self.credentials is not None: - serializer.write_string( - _SCHEMA_UPDATE_INTEGRATION_OUTPUT.members["credentials"], - self.credentials, - ) - - if self.request_parameters is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_UPDATE_INTEGRATION_OUTPUT.members["requestParameters"], - self.request_parameters, - ) - - if self.request_templates is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_UPDATE_INTEGRATION_OUTPUT.members["requestTemplates"], - self.request_templates, - ) - - if self.passthrough_behavior is not None: - serializer.write_string( - _SCHEMA_UPDATE_INTEGRATION_OUTPUT.members["passthroughBehavior"], - self.passthrough_behavior, - ) - - if self.content_handling is not None: - serializer.write_string( - _SCHEMA_UPDATE_INTEGRATION_OUTPUT.members["contentHandling"], - self.content_handling, - ) - - serializer.write_integer( - _SCHEMA_UPDATE_INTEGRATION_OUTPUT.members["timeoutInMillis"], - self.timeout_in_millis, - ) - if self.cache_namespace is not None: - serializer.write_string( - _SCHEMA_UPDATE_INTEGRATION_OUTPUT.members["cacheNamespace"], - self.cache_namespace, - ) - - if self.cache_key_parameters is not None: - _serialize_list_of_string( - serializer, - _SCHEMA_UPDATE_INTEGRATION_OUTPUT.members["cacheKeyParameters"], - self.cache_key_parameters, - ) - - if self.integration_responses is not None: - _serialize_map_of_integration_response( - serializer, - _SCHEMA_UPDATE_INTEGRATION_OUTPUT.members["integrationResponses"], - self.integration_responses, - ) - - if self.tls_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_INTEGRATION_OUTPUT.members["tlsConfig"], self.tls_config - ) - - if self.response_transfer_mode is not None: - serializer.write_string( - _SCHEMA_UPDATE_INTEGRATION_OUTPUT.members["responseTransferMode"], - self.response_transfer_mode, - ) - - if self.integration_target is not None: - serializer.write_string( - _SCHEMA_UPDATE_INTEGRATION_OUTPUT.members["integrationTarget"], - self.integration_target, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = IntegrationType( - de.read_string( - _SCHEMA_UPDATE_INTEGRATION_OUTPUT.members["type"] - ) - ) - - case 1: - kwargs["http_method"] = de.read_string( - _SCHEMA_UPDATE_INTEGRATION_OUTPUT.members["httpMethod"] - ) - - case 2: - kwargs["uri"] = de.read_string( - _SCHEMA_UPDATE_INTEGRATION_OUTPUT.members["uri"] - ) - - case 3: - kwargs["connection_type"] = ConnectionType( - de.read_string( - _SCHEMA_UPDATE_INTEGRATION_OUTPUT.members["connectionType"] - ) - ) - - case 4: - kwargs["connection_id"] = de.read_string( - _SCHEMA_UPDATE_INTEGRATION_OUTPUT.members["connectionId"] - ) - - case 5: - kwargs["credentials"] = de.read_string( - _SCHEMA_UPDATE_INTEGRATION_OUTPUT.members["credentials"] - ) - - case 6: - kwargs["request_parameters"] = _deserialize_map_of_string_to_string( - de, - _SCHEMA_UPDATE_INTEGRATION_OUTPUT.members["requestParameters"], - ) - - case 7: - kwargs["request_templates"] = _deserialize_map_of_string_to_string( - de, - _SCHEMA_UPDATE_INTEGRATION_OUTPUT.members["requestTemplates"], - ) - - case 8: - kwargs["passthrough_behavior"] = de.read_string( - _SCHEMA_UPDATE_INTEGRATION_OUTPUT.members["passthroughBehavior"] - ) - - case 9: - kwargs["content_handling"] = ContentHandlingStrategy( - de.read_string( - _SCHEMA_UPDATE_INTEGRATION_OUTPUT.members["contentHandling"] - ) - ) - - case 10: - kwargs["timeout_in_millis"] = de.read_integer( - _SCHEMA_UPDATE_INTEGRATION_OUTPUT.members["timeoutInMillis"] - ) - - case 11: - kwargs["cache_namespace"] = de.read_string( - _SCHEMA_UPDATE_INTEGRATION_OUTPUT.members["cacheNamespace"] - ) - - case 12: - kwargs["cache_key_parameters"] = _deserialize_list_of_string( - de, - _SCHEMA_UPDATE_INTEGRATION_OUTPUT.members["cacheKeyParameters"], - ) - - case 13: - kwargs["integration_responses"] = ( - _deserialize_map_of_integration_response( - de, - _SCHEMA_UPDATE_INTEGRATION_OUTPUT.members[ - "integrationResponses" - ], - ) - ) - - case 14: - kwargs["tls_config"] = TlsConfig.deserialize(de) - - case 15: - kwargs["response_transfer_mode"] = ResponseTransferMode( - de.read_string( - _SCHEMA_UPDATE_INTEGRATION_OUTPUT.members[ - "responseTransferMode" - ] - ) - ) - - case 16: - kwargs["integration_target"] = de.read_string( - _SCHEMA_UPDATE_INTEGRATION_OUTPUT.members["integrationTarget"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_INTEGRATION_OUTPUT, consumer=_consumer) - return kwargs - - -UPDATE_INTEGRATION = APIOperation( - input=UpdateIntegrationInput, - output=UpdateIntegrationOutput, - schema=_SCHEMA_UPDATE_INTEGRATION, - input_schema=_SCHEMA_UPDATE_INTEGRATION_INPUT, - output_schema=_SCHEMA_UPDATE_INTEGRATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateIntegrationResponseInput: - """Represents an update integration response request.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - resource_id: str | None = None - """Specifies an update integration response request's resource identifier.""" - - http_method: str | None = None - """Specifies an update integration response request's HTTP method.""" - - status_code: str | None = None - """Specifies an update integration response request's status code.""" - - patch_operations: list[PatchOperation] | None = None - """ - For more information about supported patch operations, see [Patch - Operations](https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_INTEGRATION_RESPONSE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_INTEGRATION_RESPONSE_INPUT.members["restApiId"], - self.rest_api_id, - ) - - if self.resource_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_INTEGRATION_RESPONSE_INPUT.members["resourceId"], - self.resource_id, - ) - - if self.http_method is not None: - serializer.write_string( - _SCHEMA_UPDATE_INTEGRATION_RESPONSE_INPUT.members["httpMethod"], - self.http_method, - ) - - if self.status_code is not None: - serializer.write_string( - _SCHEMA_UPDATE_INTEGRATION_RESPONSE_INPUT.members["statusCode"], - self.status_code, - ) - - if self.patch_operations is not None: - _serialize_list_of_patch_operation( - serializer, - _SCHEMA_UPDATE_INTEGRATION_RESPONSE_INPUT.members["patchOperations"], - self.patch_operations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_UPDATE_INTEGRATION_RESPONSE_INPUT.members["restApiId"] - ) - - case 1: - kwargs["resource_id"] = de.read_string( - _SCHEMA_UPDATE_INTEGRATION_RESPONSE_INPUT.members["resourceId"] - ) - - case 2: - kwargs["http_method"] = de.read_string( - _SCHEMA_UPDATE_INTEGRATION_RESPONSE_INPUT.members["httpMethod"] - ) - - case 3: - kwargs["status_code"] = de.read_string( - _SCHEMA_UPDATE_INTEGRATION_RESPONSE_INPUT.members["statusCode"] - ) - - case 4: - kwargs["patch_operations"] = _deserialize_list_of_patch_operation( - de, - _SCHEMA_UPDATE_INTEGRATION_RESPONSE_INPUT.members[ - "patchOperations" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_INTEGRATION_RESPONSE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateIntegrationResponseOutput: - """ - Represents an integration response. The status code must map to an - existing MethodResponse, and parameters and templates can be used to - transform the back-end response. - """ - - status_code: str | None = None - """ - Specifies the status code that is used to map the integration response - to an existing MethodResponse. - """ - - selection_pattern: str | None = None - """ - Specifies the regular expression (regex) pattern used to choose an - integration response based on the response from the back end. For - example, if the success response returns nothing and the error response - returns some string, you could use the `.+` regex to match error - response. However, make sure that the error response does not contain - any newline (`\n`) character in such cases. If the back end is an Lambda - function, the Lambda function error header is matched. For all other - HTTP and Amazon Web Services back ends, the HTTP status code is matched. - """ - - response_parameters: dict[str, str] | None = None - """ - A key-value map specifying response parameters that are passed to the - method response from the back end. The key is a method response header - parameter name and the mapped value is an integration response header - value, a static value enclosed within a pair of single quotes, or a JSON - expression from the integration response body. The mapping key must - match the pattern of `method.response.header.{name}`, where `name` is a - valid and unique header name. The mapped non-static value must match the - pattern of `integration.response.header.{name}` or - `integration.response.body.{JSON-expression}`, where `name` is a valid - and unique response header name and `JSON-expression` is a valid JSON - expression without the `$` prefix. - """ - - response_templates: dict[str, str] | None = None - """ - Specifies the templates used to transform the integration response body. - Response templates are represented as a key/value map, with a - content-type as the key and a template as the value. - """ - - content_handling: str | None = None - """ - Specifies how to handle response payload content type conversions. - Supported values are `CONVERT_TO_BINARY` and `CONVERT_TO_TEXT`, with the - following behaviors: - - If this property is not defined, the response payload will be passed - through from the integration response to the method response without - modification. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_INTEGRATION_RESPONSE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.status_code is not None: - serializer.write_string( - _SCHEMA_UPDATE_INTEGRATION_RESPONSE_OUTPUT.members["statusCode"], - self.status_code, - ) - - if self.selection_pattern is not None: - serializer.write_string( - _SCHEMA_UPDATE_INTEGRATION_RESPONSE_OUTPUT.members["selectionPattern"], - self.selection_pattern, - ) - - if self.response_parameters is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_UPDATE_INTEGRATION_RESPONSE_OUTPUT.members[ - "responseParameters" - ], - self.response_parameters, - ) - - if self.response_templates is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_UPDATE_INTEGRATION_RESPONSE_OUTPUT.members["responseTemplates"], - self.response_templates, - ) - - if self.content_handling is not None: - serializer.write_string( - _SCHEMA_UPDATE_INTEGRATION_RESPONSE_OUTPUT.members["contentHandling"], - self.content_handling, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["status_code"] = de.read_string( - _SCHEMA_UPDATE_INTEGRATION_RESPONSE_OUTPUT.members["statusCode"] - ) - - case 1: - kwargs["selection_pattern"] = de.read_string( - _SCHEMA_UPDATE_INTEGRATION_RESPONSE_OUTPUT.members[ - "selectionPattern" - ] - ) - - case 2: - kwargs["response_parameters"] = ( - _deserialize_map_of_string_to_string( - de, - _SCHEMA_UPDATE_INTEGRATION_RESPONSE_OUTPUT.members[ - "responseParameters" - ], - ) - ) - - case 3: - kwargs["response_templates"] = _deserialize_map_of_string_to_string( - de, - _SCHEMA_UPDATE_INTEGRATION_RESPONSE_OUTPUT.members[ - "responseTemplates" - ], - ) - - case 4: - kwargs["content_handling"] = ContentHandlingStrategy( - de.read_string( - _SCHEMA_UPDATE_INTEGRATION_RESPONSE_OUTPUT.members[ - "contentHandling" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_INTEGRATION_RESPONSE_OUTPUT, consumer=_consumer - ) - return kwargs - - -UPDATE_INTEGRATION_RESPONSE = APIOperation( - input=UpdateIntegrationResponseInput, - output=UpdateIntegrationResponseOutput, - schema=_SCHEMA_UPDATE_INTEGRATION_RESPONSE, - input_schema=_SCHEMA_UPDATE_INTEGRATION_RESPONSE_INPUT, - output_schema=_SCHEMA_UPDATE_INTEGRATION_RESPONSE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateMethodInput: - """Request to update an existing Method resource.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - resource_id: str | None = None - """The Resource identifier for the Method resource.""" - - http_method: str | None = None - """The HTTP verb of the Method resource.""" - - patch_operations: list[PatchOperation] | None = None - """ - For more information about supported patch operations, see [Patch - Operations](https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_METHOD_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_METHOD_INPUT.members["restApiId"], self.rest_api_id - ) - - if self.resource_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_METHOD_INPUT.members["resourceId"], self.resource_id - ) - - if self.http_method is not None: - serializer.write_string( - _SCHEMA_UPDATE_METHOD_INPUT.members["httpMethod"], self.http_method - ) - - if self.patch_operations is not None: - _serialize_list_of_patch_operation( - serializer, - _SCHEMA_UPDATE_METHOD_INPUT.members["patchOperations"], - self.patch_operations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_UPDATE_METHOD_INPUT.members["restApiId"] - ) - - case 1: - kwargs["resource_id"] = de.read_string( - _SCHEMA_UPDATE_METHOD_INPUT.members["resourceId"] - ) - - case 2: - kwargs["http_method"] = de.read_string( - _SCHEMA_UPDATE_METHOD_INPUT.members["httpMethod"] - ) - - case 3: - kwargs["patch_operations"] = _deserialize_list_of_patch_operation( - de, _SCHEMA_UPDATE_METHOD_INPUT.members["patchOperations"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_METHOD_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateMethodOutput: - """ - Represents a client-facing interface by which the client calls the API - to access back-end resources. A Method resource is integrated with an - Integration resource. Both consist of a request and one or more - responses. The method request takes the client input that is passed to - the back end through the integration request. A method response returns - the output from the back end to the client through an integration - response. A method request is embodied in a Method resource, whereas an - integration request is embodied in an Integration resource. On the other - hand, a method response is represented by a MethodResponse resource, - whereas an integration response is represented by an IntegrationResponse - resource. - """ - - http_method: str | None = None - """The method's HTTP verb.""" - - authorization_type: str | None = None - """ - The method's authorization type. Valid values are `NONE` for open - access, `AWS_IAM` for using AWS IAM permissions, `CUSTOM` for using a - custom authorizer, or `COGNITO_USER_POOLS` for using a Cognito user - pool. - """ - - authorizer_id: str | None = None - """ - The identifier of an Authorizer to use on this method. The - `authorizationType` must be `CUSTOM`. - """ - - api_key_required: bool | None = None - """ - A boolean flag specifying whether a valid ApiKey is required to invoke - this method. - """ - - request_validator_id: str | None = None - """The identifier of a RequestValidator for request validation.""" - - operation_name: str | None = None - """ - A human-friendly operation identifier for the method. For example, you - can assign the `operationName` of `ListPets` for the `GET /pets` method - in the `PetStore` example. - """ - - request_parameters: dict[str, bool] | None = None - """ - A key-value map defining required or optional method request parameters - that can be accepted by API Gateway. A key is a method request parameter - name matching the pattern of `method.request.{location}.{name}`, where - `location` is `querystring`, `path`, or `header` and `name` is a valid - and unique parameter name. The value associated with the key is a - Boolean flag indicating whether the parameter is required (`true`) or - optional (`false`). The method request parameter names defined here are - available in Integration to be mapped to integration request parameters - or templates. - """ - - request_models: dict[str, str] | None = None - """ - A key-value map specifying data schemas, represented by Model resources, - (as the mapped value) of the request payloads of given content types (as - the mapping key). - """ - - method_responses: dict[str, MethodResponse] | None = None - """Gets a method response associated with a given HTTP status code.""" - - method_integration: Integration | None = None - """ - Gets the method's integration responsible for passing the - client-submitted request to the back end and performing necessary - transformations to make the request compliant with the back end. - """ - - authorization_scopes: list[str] | None = None - """ - A list of authorization scopes configured on the method. The scopes are - used with a `COGNITO_USER_POOLS` authorizer to authorize the method - invocation. The authorization works by matching the method scopes - against the scopes parsed from the access token in the incoming request. - The method invocation is authorized if any method scopes matches a - claimed scope in the access token. Otherwise, the invocation is not - authorized. When the method scope is configured, the client must provide - an access token instead of an identity token for authorization purposes. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_METHOD_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.http_method is not None: - serializer.write_string( - _SCHEMA_UPDATE_METHOD_OUTPUT.members["httpMethod"], self.http_method - ) - - if self.authorization_type is not None: - serializer.write_string( - _SCHEMA_UPDATE_METHOD_OUTPUT.members["authorizationType"], - self.authorization_type, - ) - - if self.authorizer_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_METHOD_OUTPUT.members["authorizerId"], self.authorizer_id - ) - - if self.api_key_required is not None: - serializer.write_boolean( - _SCHEMA_UPDATE_METHOD_OUTPUT.members["apiKeyRequired"], - self.api_key_required, - ) - - if self.request_validator_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_METHOD_OUTPUT.members["requestValidatorId"], - self.request_validator_id, - ) - - if self.operation_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_METHOD_OUTPUT.members["operationName"], - self.operation_name, - ) - - if self.request_parameters is not None: - _serialize_map_of_string_to_boolean( - serializer, - _SCHEMA_UPDATE_METHOD_OUTPUT.members["requestParameters"], - self.request_parameters, - ) - - if self.request_models is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_UPDATE_METHOD_OUTPUT.members["requestModels"], - self.request_models, - ) - - if self.method_responses is not None: - _serialize_map_of_method_response( - serializer, - _SCHEMA_UPDATE_METHOD_OUTPUT.members["methodResponses"], - self.method_responses, - ) - - if self.method_integration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_METHOD_OUTPUT.members["methodIntegration"], - self.method_integration, - ) - - if self.authorization_scopes is not None: - _serialize_list_of_string( - serializer, - _SCHEMA_UPDATE_METHOD_OUTPUT.members["authorizationScopes"], - self.authorization_scopes, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["http_method"] = de.read_string( - _SCHEMA_UPDATE_METHOD_OUTPUT.members["httpMethod"] - ) - - case 1: - kwargs["authorization_type"] = de.read_string( - _SCHEMA_UPDATE_METHOD_OUTPUT.members["authorizationType"] - ) - - case 2: - kwargs["authorizer_id"] = de.read_string( - _SCHEMA_UPDATE_METHOD_OUTPUT.members["authorizerId"] - ) - - case 3: - kwargs["api_key_required"] = de.read_boolean( - _SCHEMA_UPDATE_METHOD_OUTPUT.members["apiKeyRequired"] - ) - - case 4: - kwargs["request_validator_id"] = de.read_string( - _SCHEMA_UPDATE_METHOD_OUTPUT.members["requestValidatorId"] - ) - - case 5: - kwargs["operation_name"] = de.read_string( - _SCHEMA_UPDATE_METHOD_OUTPUT.members["operationName"] - ) - - case 6: - kwargs["request_parameters"] = ( - _deserialize_map_of_string_to_boolean( - de, - _SCHEMA_UPDATE_METHOD_OUTPUT.members["requestParameters"], - ) - ) - - case 7: - kwargs["request_models"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_UPDATE_METHOD_OUTPUT.members["requestModels"] - ) - - case 8: - kwargs["method_responses"] = _deserialize_map_of_method_response( - de, _SCHEMA_UPDATE_METHOD_OUTPUT.members["methodResponses"] - ) - - case 9: - kwargs["method_integration"] = Integration.deserialize(de) - - case 10: - kwargs["authorization_scopes"] = _deserialize_list_of_string( - de, _SCHEMA_UPDATE_METHOD_OUTPUT.members["authorizationScopes"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_METHOD_OUTPUT, consumer=_consumer) - return kwargs - - -UPDATE_METHOD = APIOperation( - input=UpdateMethodInput, - output=UpdateMethodOutput, - schema=_SCHEMA_UPDATE_METHOD, - input_schema=_SCHEMA_UPDATE_METHOD_INPUT, - output_schema=_SCHEMA_UPDATE_METHOD_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateMethodResponseInput: - """A request to update an existing MethodResponse resource.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - resource_id: str | None = None - """The Resource identifier for the MethodResponse resource.""" - - http_method: str | None = None - """The HTTP verb of the Method resource.""" - - status_code: str | None = None - """The status code for the MethodResponse resource.""" - - patch_operations: list[PatchOperation] | None = None - """ - For more information about supported patch operations, see [Patch - Operations](https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_METHOD_RESPONSE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_METHOD_RESPONSE_INPUT.members["restApiId"], - self.rest_api_id, - ) - - if self.resource_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_METHOD_RESPONSE_INPUT.members["resourceId"], - self.resource_id, - ) - - if self.http_method is not None: - serializer.write_string( - _SCHEMA_UPDATE_METHOD_RESPONSE_INPUT.members["httpMethod"], - self.http_method, - ) - - if self.status_code is not None: - serializer.write_string( - _SCHEMA_UPDATE_METHOD_RESPONSE_INPUT.members["statusCode"], - self.status_code, - ) - - if self.patch_operations is not None: - _serialize_list_of_patch_operation( - serializer, - _SCHEMA_UPDATE_METHOD_RESPONSE_INPUT.members["patchOperations"], - self.patch_operations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_UPDATE_METHOD_RESPONSE_INPUT.members["restApiId"] - ) - - case 1: - kwargs["resource_id"] = de.read_string( - _SCHEMA_UPDATE_METHOD_RESPONSE_INPUT.members["resourceId"] - ) - - case 2: - kwargs["http_method"] = de.read_string( - _SCHEMA_UPDATE_METHOD_RESPONSE_INPUT.members["httpMethod"] - ) - - case 3: - kwargs["status_code"] = de.read_string( - _SCHEMA_UPDATE_METHOD_RESPONSE_INPUT.members["statusCode"] - ) - - case 4: - kwargs["patch_operations"] = _deserialize_list_of_patch_operation( - de, - _SCHEMA_UPDATE_METHOD_RESPONSE_INPUT.members["patchOperations"], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_METHOD_RESPONSE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateMethodResponseOutput: - """ - Represents a method response of a given HTTP status code returned to the - client. The method response is passed from the back end through the - associated integration response that can be transformed using a mapping - template. - """ - - status_code: str | None = None - """The method response's status code.""" - - response_parameters: dict[str, bool] | None = None - """ - A key-value map specifying required or optional response parameters that - API Gateway can send back to the caller. A key defines a method response - header and the value specifies whether the associated method response - header is required or not. The expression of the key must match the - pattern `method.response.header.{name}`, where `name` is a valid and - unique header name. API Gateway passes certain integration response data - to the method response headers specified here according to the mapping - you prescribe in the API's IntegrationResponse. The integration - response data that can be mapped include an integration response header - expressed in `integration.response.header.{name}`, a static value - enclosed within a pair of single quotes (e.g., `'application/json'`), or - a JSON expression from the back-end response payload in the form of - `integration.response.body.{JSON-expression}`, where `JSON-expression` - is a valid JSON expression without the `$` prefix.) - """ - - response_models: dict[str, str] | None = None - """ - Specifies the Model resources used for the response's content-type. - Response models are represented as a key/value map, with a content-type - as the key and a Model name as the value. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_METHOD_RESPONSE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.status_code is not None: - serializer.write_string( - _SCHEMA_UPDATE_METHOD_RESPONSE_OUTPUT.members["statusCode"], - self.status_code, - ) - - if self.response_parameters is not None: - _serialize_map_of_string_to_boolean( - serializer, - _SCHEMA_UPDATE_METHOD_RESPONSE_OUTPUT.members["responseParameters"], - self.response_parameters, - ) - - if self.response_models is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_UPDATE_METHOD_RESPONSE_OUTPUT.members["responseModels"], - self.response_models, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["status_code"] = de.read_string( - _SCHEMA_UPDATE_METHOD_RESPONSE_OUTPUT.members["statusCode"] - ) - - case 1: - kwargs["response_parameters"] = ( - _deserialize_map_of_string_to_boolean( - de, - _SCHEMA_UPDATE_METHOD_RESPONSE_OUTPUT.members[ - "responseParameters" - ], - ) - ) - - case 2: - kwargs["response_models"] = _deserialize_map_of_string_to_string( - de, - _SCHEMA_UPDATE_METHOD_RESPONSE_OUTPUT.members["responseModels"], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_METHOD_RESPONSE_OUTPUT, consumer=_consumer - ) - return kwargs - - -UPDATE_METHOD_RESPONSE = APIOperation( - input=UpdateMethodResponseInput, - output=UpdateMethodResponseOutput, - schema=_SCHEMA_UPDATE_METHOD_RESPONSE, - input_schema=_SCHEMA_UPDATE_METHOD_RESPONSE_INPUT, - output_schema=_SCHEMA_UPDATE_METHOD_RESPONSE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateModelInput: - """Request to update an existing model in an existing RestApi resource.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - model_name: str | None = None - """The name of the model to update.""" - - patch_operations: list[PatchOperation] | None = None - """ - For more information about supported patch operations, see [Patch - Operations](https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_MODEL_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_MODEL_INPUT.members["restApiId"], self.rest_api_id - ) - - if self.model_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_MODEL_INPUT.members["modelName"], self.model_name - ) - - if self.patch_operations is not None: - _serialize_list_of_patch_operation( - serializer, - _SCHEMA_UPDATE_MODEL_INPUT.members["patchOperations"], - self.patch_operations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_UPDATE_MODEL_INPUT.members["restApiId"] - ) - - case 1: - kwargs["model_name"] = de.read_string( - _SCHEMA_UPDATE_MODEL_INPUT.members["modelName"] - ) - - case 2: - kwargs["patch_operations"] = _deserialize_list_of_patch_operation( - de, _SCHEMA_UPDATE_MODEL_INPUT.members["patchOperations"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_MODEL_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateModelOutput: - """ - Represents the data structure of a method's request or response - payload. - """ - - id: str | None = None - """The identifier for the model resource.""" - - name: str | None = None - """The name of the model. Must be an alphanumeric string.""" - - description: str | None = None - """The description of the model.""" - - schema: str | None = None - """ - The schema for the model. For `application/json` models, this should be - JSON schema draft 4 model. Do not include \"\\*/\" characters in the - description of any properties because such \"\\*/\" characters may be - interpreted as the closing marker for comments in some languages, such - as Java or JavaScript, causing the installation of your API's SDK - generated by API Gateway to fail. - """ - - content_type: str | None = None - """The content-type for the model.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_MODEL_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string(_SCHEMA_UPDATE_MODEL_OUTPUT.members["id"], self.id) - - if self.name is not None: - serializer.write_string( - _SCHEMA_UPDATE_MODEL_OUTPUT.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_MODEL_OUTPUT.members["description"], self.description - ) - - if self.schema is not None: - serializer.write_string( - _SCHEMA_UPDATE_MODEL_OUTPUT.members["schema"], self.schema - ) - - if self.content_type is not None: - serializer.write_string( - _SCHEMA_UPDATE_MODEL_OUTPUT.members["contentType"], self.content_type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_UPDATE_MODEL_OUTPUT.members["id"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_MODEL_OUTPUT.members["name"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_MODEL_OUTPUT.members["description"] - ) - - case 3: - kwargs["schema"] = de.read_string( - _SCHEMA_UPDATE_MODEL_OUTPUT.members["schema"] - ) - - case 4: - kwargs["content_type"] = de.read_string( - _SCHEMA_UPDATE_MODEL_OUTPUT.members["contentType"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_MODEL_OUTPUT, consumer=_consumer) - return kwargs - - -UPDATE_MODEL = APIOperation( - input=UpdateModelInput, - output=UpdateModelOutput, - schema=_SCHEMA_UPDATE_MODEL, - input_schema=_SCHEMA_UPDATE_MODEL_INPUT, - output_schema=_SCHEMA_UPDATE_MODEL_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateRequestValidatorInput: - """Updates a RequestValidator of a given RestApi.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - request_validator_id: str | None = None - """The identifier of RequestValidator to be updated.""" - - patch_operations: list[PatchOperation] | None = None - """ - For more information about supported patch operations, see [Patch - Operations](https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_REQUEST_VALIDATOR_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_REQUEST_VALIDATOR_INPUT.members["restApiId"], - self.rest_api_id, - ) - - if self.request_validator_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_REQUEST_VALIDATOR_INPUT.members["requestValidatorId"], - self.request_validator_id, - ) - - if self.patch_operations is not None: - _serialize_list_of_patch_operation( - serializer, - _SCHEMA_UPDATE_REQUEST_VALIDATOR_INPUT.members["patchOperations"], - self.patch_operations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_UPDATE_REQUEST_VALIDATOR_INPUT.members["restApiId"] - ) - - case 1: - kwargs["request_validator_id"] = de.read_string( - _SCHEMA_UPDATE_REQUEST_VALIDATOR_INPUT.members[ - "requestValidatorId" - ] - ) - - case 2: - kwargs["patch_operations"] = _deserialize_list_of_patch_operation( - de, - _SCHEMA_UPDATE_REQUEST_VALIDATOR_INPUT.members[ - "patchOperations" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_REQUEST_VALIDATOR_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateRequestValidatorOutput: - """A set of validation rules for incoming Method requests.""" - - id: str | None = None - """The identifier of this RequestValidator.""" - - name: str | None = None - """The name of this RequestValidator""" - - validate_request_body: bool = False - """ - A Boolean flag to indicate whether to validate a request body according - to the configured Model schema. - """ - - validate_request_parameters: bool = False - """ - A Boolean flag to indicate whether to validate request parameters - (`true`) or not (`false`). - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_REQUEST_VALIDATOR_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string( - _SCHEMA_UPDATE_REQUEST_VALIDATOR_OUTPUT.members["id"], self.id - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_UPDATE_REQUEST_VALIDATOR_OUTPUT.members["name"], self.name - ) - - serializer.write_boolean( - _SCHEMA_UPDATE_REQUEST_VALIDATOR_OUTPUT.members["validateRequestBody"], - self.validate_request_body, - ) - serializer.write_boolean( - _SCHEMA_UPDATE_REQUEST_VALIDATOR_OUTPUT.members[ - "validateRequestParameters" - ], - self.validate_request_parameters, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_UPDATE_REQUEST_VALIDATOR_OUTPUT.members["id"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_REQUEST_VALIDATOR_OUTPUT.members["name"] - ) - - case 2: - kwargs["validate_request_body"] = de.read_boolean( - _SCHEMA_UPDATE_REQUEST_VALIDATOR_OUTPUT.members[ - "validateRequestBody" - ] - ) - - case 3: - kwargs["validate_request_parameters"] = de.read_boolean( - _SCHEMA_UPDATE_REQUEST_VALIDATOR_OUTPUT.members[ - "validateRequestParameters" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_REQUEST_VALIDATOR_OUTPUT, consumer=_consumer - ) - return kwargs - - -UPDATE_REQUEST_VALIDATOR = APIOperation( - input=UpdateRequestValidatorInput, - output=UpdateRequestValidatorOutput, - schema=_SCHEMA_UPDATE_REQUEST_VALIDATOR, - input_schema=_SCHEMA_UPDATE_REQUEST_VALIDATOR_INPUT, - output_schema=_SCHEMA_UPDATE_REQUEST_VALIDATOR_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateResourceInput: - """Request to change information about a Resource resource.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - resource_id: str | None = None - """The identifier of the Resource resource.""" - - patch_operations: list[PatchOperation] | None = None - """ - For more information about supported patch operations, see [Patch - Operations](https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_RESOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_RESOURCE_INPUT.members["restApiId"], self.rest_api_id - ) - - if self.resource_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_RESOURCE_INPUT.members["resourceId"], self.resource_id - ) - - if self.patch_operations is not None: - _serialize_list_of_patch_operation( - serializer, - _SCHEMA_UPDATE_RESOURCE_INPUT.members["patchOperations"], - self.patch_operations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_UPDATE_RESOURCE_INPUT.members["restApiId"] - ) - - case 1: - kwargs["resource_id"] = de.read_string( - _SCHEMA_UPDATE_RESOURCE_INPUT.members["resourceId"] - ) - - case 2: - kwargs["patch_operations"] = _deserialize_list_of_patch_operation( - de, _SCHEMA_UPDATE_RESOURCE_INPUT.members["patchOperations"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_RESOURCE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateResourceOutput: - """Represents an API resource.""" - - id: str | None = None - """The resource's identifier.""" - - parent_id: str | None = None - """The parent resource's identifier.""" - - path_part: str | None = None - """The last path segment for this resource.""" - - path: str | None = None - """The full path for this resource.""" - - resource_methods: dict[str, Method] | None = None - """Gets an API resource's method of a given HTTP verb.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_RESOURCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string( - _SCHEMA_UPDATE_RESOURCE_OUTPUT.members["id"], self.id - ) - - if self.parent_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_RESOURCE_OUTPUT.members["parentId"], self.parent_id - ) - - if self.path_part is not None: - serializer.write_string( - _SCHEMA_UPDATE_RESOURCE_OUTPUT.members["pathPart"], self.path_part - ) - - if self.path is not None: - serializer.write_string( - _SCHEMA_UPDATE_RESOURCE_OUTPUT.members["path"], self.path - ) - - if self.resource_methods is not None: - _serialize_map_of_method( - serializer, - _SCHEMA_UPDATE_RESOURCE_OUTPUT.members["resourceMethods"], - self.resource_methods, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_UPDATE_RESOURCE_OUTPUT.members["id"] - ) - - case 1: - kwargs["parent_id"] = de.read_string( - _SCHEMA_UPDATE_RESOURCE_OUTPUT.members["parentId"] - ) - - case 2: - kwargs["path_part"] = de.read_string( - _SCHEMA_UPDATE_RESOURCE_OUTPUT.members["pathPart"] - ) - - case 3: - kwargs["path"] = de.read_string( - _SCHEMA_UPDATE_RESOURCE_OUTPUT.members["path"] - ) - - case 4: - kwargs["resource_methods"] = _deserialize_map_of_method( - de, _SCHEMA_UPDATE_RESOURCE_OUTPUT.members["resourceMethods"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_RESOURCE_OUTPUT, consumer=_consumer) - return kwargs - - -UPDATE_RESOURCE = APIOperation( - input=UpdateResourceInput, - output=UpdateResourceOutput, - schema=_SCHEMA_UPDATE_RESOURCE, - input_schema=_SCHEMA_UPDATE_RESOURCE_INPUT, - output_schema=_SCHEMA_UPDATE_RESOURCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateRestApiInput: - """Request to update an existing RestApi resource in your collection.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - patch_operations: list[PatchOperation] | None = None - """ - For more information about supported patch operations, see [Patch - Operations](https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_REST_API_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_REST_API_INPUT.members["restApiId"], self.rest_api_id - ) - - if self.patch_operations is not None: - _serialize_list_of_patch_operation( - serializer, - _SCHEMA_UPDATE_REST_API_INPUT.members["patchOperations"], - self.patch_operations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_UPDATE_REST_API_INPUT.members["restApiId"] - ) - - case 1: - kwargs["patch_operations"] = _deserialize_list_of_patch_operation( - de, _SCHEMA_UPDATE_REST_API_INPUT.members["patchOperations"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_REST_API_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateRestApiOutput: - """Represents a REST API.""" - - id: str | None = None - """ - The API's identifier. This identifier is unique across all of your APIs - in API Gateway. - """ - - name: str | None = None - """The API's name.""" - - description: str | None = None - """The API's description.""" - - created_date: datetime | None = None - """The timestamp when the API was created.""" - - version: str | None = None - """A version identifier for the API.""" - - warnings: list[str] | None = None - """ - The warning messages reported when `failonwarnings` is turned on during - API import. - """ - - binary_media_types: list[str] | None = None - """ - The list of binary media types supported by the RestApi. By default, the - RestApi supports only UTF-8-encoded text payloads. - """ - - minimum_compression_size: int | None = None - """ - A nullable integer that is used to enable compression (with non-negative - between 0 and 10485760 (10M) bytes, inclusive) or disable compression - (with a null value) on an API. When compression is enabled, compression - or decompression is not applied on the payload if the payload size is - smaller than this value. Setting it to zero allows compression for any - payload size. - """ - - api_key_source: str | None = None - """ - The source of the API key for metering requests according to a usage - plan. Valid values are: >`HEADER` to read the API key from the - `X-API-Key` header of a request. `AUTHORIZER` to read the API key from - the `UsageIdentifierKey` from a custom authorizer. - """ - - endpoint_configuration: EndpointConfiguration | None = None - """ - The endpoint configuration of this RestApi showing the endpoint types - and IP address types of the API. - """ - - policy: str | None = None - """ - A stringified JSON policy document that applies to this RestApi - regardless of the caller and Method configuration. - """ - - tags: dict[str, str] | None = None - """ - The collection of tags. Each tag element is associated with a given - resource. - """ - - disable_execute_api_endpoint: bool = False - """ - Specifies whether clients can invoke your API by using the default - `execute-api` endpoint. By default, clients can invoke your API with the - default `https://{api_id}.execute-api.{region}.amazonaws.com` endpoint. - To require that clients use a custom domain name to invoke your API, - disable the default endpoint. - """ - - root_resource_id: str | None = None - """The API's root resource ID.""" - - security_policy: str | None = None - """ - The Transport Layer Security (TLS) version + cipher suite for this - RestApi. - """ - - endpoint_access_mode: str | None = None - """The endpoint access mode of the RestApi.""" - - api_status: str | None = None - """The ApiStatus of the RestApi.""" - - api_status_message: str | None = None - """ - The status message of the RestApi. When the status message is `UPDATING` - you can still invoke it. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_REST_API_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string( - _SCHEMA_UPDATE_REST_API_OUTPUT.members["id"], self.id - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_UPDATE_REST_API_OUTPUT.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_REST_API_OUTPUT.members["description"], self.description - ) - - if self.created_date is not None: - serializer.write_timestamp( - _SCHEMA_UPDATE_REST_API_OUTPUT.members["createdDate"], self.created_date - ) - - if self.version is not None: - serializer.write_string( - _SCHEMA_UPDATE_REST_API_OUTPUT.members["version"], self.version - ) - - if self.warnings is not None: - _serialize_list_of_string( - serializer, - _SCHEMA_UPDATE_REST_API_OUTPUT.members["warnings"], - self.warnings, - ) - - if self.binary_media_types is not None: - _serialize_list_of_string( - serializer, - _SCHEMA_UPDATE_REST_API_OUTPUT.members["binaryMediaTypes"], - self.binary_media_types, - ) - - if self.minimum_compression_size is not None: - serializer.write_integer( - _SCHEMA_UPDATE_REST_API_OUTPUT.members["minimumCompressionSize"], - self.minimum_compression_size, - ) - - if self.api_key_source is not None: - serializer.write_string( - _SCHEMA_UPDATE_REST_API_OUTPUT.members["apiKeySource"], - self.api_key_source, - ) - - if self.endpoint_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_REST_API_OUTPUT.members["endpointConfiguration"], - self.endpoint_configuration, - ) - - if self.policy is not None: - serializer.write_string( - _SCHEMA_UPDATE_REST_API_OUTPUT.members["policy"], self.policy - ) - - if self.tags is not None: - _serialize_map_of_string_to_string( - serializer, _SCHEMA_UPDATE_REST_API_OUTPUT.members["tags"], self.tags - ) - - serializer.write_boolean( - _SCHEMA_UPDATE_REST_API_OUTPUT.members["disableExecuteApiEndpoint"], - self.disable_execute_api_endpoint, - ) - if self.root_resource_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_REST_API_OUTPUT.members["rootResourceId"], - self.root_resource_id, - ) - - if self.security_policy is not None: - serializer.write_string( - _SCHEMA_UPDATE_REST_API_OUTPUT.members["securityPolicy"], - self.security_policy, - ) - - if self.endpoint_access_mode is not None: - serializer.write_string( - _SCHEMA_UPDATE_REST_API_OUTPUT.members["endpointAccessMode"], - self.endpoint_access_mode, - ) - - if self.api_status is not None: - serializer.write_string( - _SCHEMA_UPDATE_REST_API_OUTPUT.members["apiStatus"], self.api_status - ) - - if self.api_status_message is not None: - serializer.write_string( - _SCHEMA_UPDATE_REST_API_OUTPUT.members["apiStatusMessage"], - self.api_status_message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_UPDATE_REST_API_OUTPUT.members["id"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_REST_API_OUTPUT.members["name"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_REST_API_OUTPUT.members["description"] - ) - - case 3: - kwargs["created_date"] = de.read_timestamp( - _SCHEMA_UPDATE_REST_API_OUTPUT.members["createdDate"] - ) - - case 4: - kwargs["version"] = de.read_string( - _SCHEMA_UPDATE_REST_API_OUTPUT.members["version"] - ) - - case 5: - kwargs["warnings"] = _deserialize_list_of_string( - de, _SCHEMA_UPDATE_REST_API_OUTPUT.members["warnings"] - ) - - case 6: - kwargs["binary_media_types"] = _deserialize_list_of_string( - de, _SCHEMA_UPDATE_REST_API_OUTPUT.members["binaryMediaTypes"] - ) - - case 7: - kwargs["minimum_compression_size"] = de.read_integer( - _SCHEMA_UPDATE_REST_API_OUTPUT.members["minimumCompressionSize"] - ) - - case 8: - kwargs["api_key_source"] = ApiKeySourceType( - de.read_string( - _SCHEMA_UPDATE_REST_API_OUTPUT.members["apiKeySource"] - ) - ) - - case 9: - kwargs["endpoint_configuration"] = ( - EndpointConfiguration.deserialize(de) - ) - - case 10: - kwargs["policy"] = de.read_string( - _SCHEMA_UPDATE_REST_API_OUTPUT.members["policy"] - ) - - case 11: - kwargs["tags"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_UPDATE_REST_API_OUTPUT.members["tags"] - ) - - case 12: - kwargs["disable_execute_api_endpoint"] = de.read_boolean( - _SCHEMA_UPDATE_REST_API_OUTPUT.members[ - "disableExecuteApiEndpoint" - ] - ) - - case 13: - kwargs["root_resource_id"] = de.read_string( - _SCHEMA_UPDATE_REST_API_OUTPUT.members["rootResourceId"] - ) - - case 14: - kwargs["security_policy"] = SecurityPolicy( - de.read_string( - _SCHEMA_UPDATE_REST_API_OUTPUT.members["securityPolicy"] - ) - ) - - case 15: - kwargs["endpoint_access_mode"] = EndpointAccessMode( - de.read_string( - _SCHEMA_UPDATE_REST_API_OUTPUT.members["endpointAccessMode"] - ) - ) - - case 16: - kwargs["api_status"] = ApiStatus( - de.read_string( - _SCHEMA_UPDATE_REST_API_OUTPUT.members["apiStatus"] - ) - ) - - case 17: - kwargs["api_status_message"] = de.read_string( - _SCHEMA_UPDATE_REST_API_OUTPUT.members["apiStatusMessage"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_REST_API_OUTPUT, consumer=_consumer) - return kwargs - - -UPDATE_REST_API = APIOperation( - input=UpdateRestApiInput, - output=UpdateRestApiOutput, - schema=_SCHEMA_UPDATE_REST_API, - input_schema=_SCHEMA_UPDATE_REST_API_INPUT, - output_schema=_SCHEMA_UPDATE_REST_API_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateStageInput: - """Requests API Gateway to change information about a Stage resource.""" - - rest_api_id: str | None = None - """The string identifier of the associated RestApi.""" - - stage_name: str | None = None - """The name of the Stage resource to change information about.""" - - patch_operations: list[PatchOperation] | None = None - """ - For more information about supported patch operations, see [Patch - Operations](https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_STAGE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rest_api_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_STAGE_INPUT.members["restApiId"], self.rest_api_id - ) - - if self.stage_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_STAGE_INPUT.members["stageName"], self.stage_name - ) - - if self.patch_operations is not None: - _serialize_list_of_patch_operation( - serializer, - _SCHEMA_UPDATE_STAGE_INPUT.members["patchOperations"], - self.patch_operations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_UPDATE_STAGE_INPUT.members["restApiId"] - ) - - case 1: - kwargs["stage_name"] = de.read_string( - _SCHEMA_UPDATE_STAGE_INPUT.members["stageName"] - ) - - case 2: - kwargs["patch_operations"] = _deserialize_list_of_patch_operation( - de, _SCHEMA_UPDATE_STAGE_INPUT.members["patchOperations"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_STAGE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateStageOutput: - """ - Represents a unique identifier for a version of a deployed RestApi that - is callable by users. - """ - - deployment_id: str | None = None - """The identifier of the Deployment that the stage points to.""" - - client_certificate_id: str | None = None - """The identifier of a client certificate for an API stage.""" - - stage_name: str | None = None - """ - The name of the stage is the first path segment in the Uniform Resource - Identifier (URI) of a call to API Gateway. Stage names can only contain - alphanumeric characters, hyphens, and underscores. Maximum length is 128 - characters. - """ - - description: str | None = None - """The stage's description.""" - - cache_cluster_enabled: bool = False - """ - Specifies whether a cache cluster is enabled for the stage. To activate - a method-level cache, set `CachingEnabled` to `true` for a method. - """ - - cache_cluster_size: str | None = None - """ - The stage's cache capacity in GB. For more information about choosing a - cache size, see [Enabling API caching to enhance - responsiveness](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html). - """ - - cache_cluster_status: str | None = None - """The status of the cache cluster for the stage, if enabled.""" - - method_settings: dict[str, MethodSetting] | None = None - """ - A map that defines the method settings for a Stage resource. Keys - (designated as `/{method_setting_key` below) are method paths defined as - `{resource_path}/{http_method}` for an individual method override, or - `/*/*` for overriding all methods in the stage. - """ - - variables: dict[str, str] | None = None - """ - A map that defines the stage variables for a Stage resource. Variable - names can have alphanumeric and underscore characters, and the values - must match `[A-Za-z0-9-._~:/?#&=,]+`. - """ - - documentation_version: str | None = None - """The version of the associated API documentation.""" - - access_log_settings: AccessLogSettings | None = None - """Settings for logging access in this stage.""" - - canary_settings: CanarySettings | None = None - """Settings for the canary deployment in this stage.""" - - tracing_enabled: bool = False - """Specifies whether active tracing with X-ray is enabled for the Stage.""" - - web_acl_arn: str | None = None - """The ARN of the WebAcl associated with the Stage.""" - - tags: dict[str, str] | None = None - """ - The collection of tags. Each tag element is associated with a given - resource. - """ - - created_date: datetime | None = None - """The timestamp when the stage was created.""" - - last_updated_date: datetime | None = None - """The timestamp when the stage last updated.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_STAGE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.deployment_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_STAGE_OUTPUT.members["deploymentId"], self.deployment_id - ) - - if self.client_certificate_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_STAGE_OUTPUT.members["clientCertificateId"], - self.client_certificate_id, - ) - - if self.stage_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_STAGE_OUTPUT.members["stageName"], self.stage_name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_STAGE_OUTPUT.members["description"], self.description - ) - - serializer.write_boolean( - _SCHEMA_UPDATE_STAGE_OUTPUT.members["cacheClusterEnabled"], - self.cache_cluster_enabled, - ) - if self.cache_cluster_size is not None: - serializer.write_string( - _SCHEMA_UPDATE_STAGE_OUTPUT.members["cacheClusterSize"], - self.cache_cluster_size, - ) - - if self.cache_cluster_status is not None: - serializer.write_string( - _SCHEMA_UPDATE_STAGE_OUTPUT.members["cacheClusterStatus"], - self.cache_cluster_status, - ) - - if self.method_settings is not None: - _serialize_map_of_method_settings( - serializer, - _SCHEMA_UPDATE_STAGE_OUTPUT.members["methodSettings"], - self.method_settings, - ) - - if self.variables is not None: - _serialize_map_of_string_to_string( - serializer, - _SCHEMA_UPDATE_STAGE_OUTPUT.members["variables"], - self.variables, - ) - - if self.documentation_version is not None: - serializer.write_string( - _SCHEMA_UPDATE_STAGE_OUTPUT.members["documentationVersion"], - self.documentation_version, - ) - - if self.access_log_settings is not None: - serializer.write_struct( - _SCHEMA_UPDATE_STAGE_OUTPUT.members["accessLogSettings"], - self.access_log_settings, - ) - - if self.canary_settings is not None: - serializer.write_struct( - _SCHEMA_UPDATE_STAGE_OUTPUT.members["canarySettings"], - self.canary_settings, - ) - - serializer.write_boolean( - _SCHEMA_UPDATE_STAGE_OUTPUT.members["tracingEnabled"], self.tracing_enabled - ) - if self.web_acl_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_STAGE_OUTPUT.members["webAclArn"], self.web_acl_arn - ) - - if self.tags is not None: - _serialize_map_of_string_to_string( - serializer, _SCHEMA_UPDATE_STAGE_OUTPUT.members["tags"], self.tags - ) - - if self.created_date is not None: - serializer.write_timestamp( - _SCHEMA_UPDATE_STAGE_OUTPUT.members["createdDate"], self.created_date - ) - - if self.last_updated_date is not None: - serializer.write_timestamp( - _SCHEMA_UPDATE_STAGE_OUTPUT.members["lastUpdatedDate"], - self.last_updated_date, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["deployment_id"] = de.read_string( - _SCHEMA_UPDATE_STAGE_OUTPUT.members["deploymentId"] - ) - - case 1: - kwargs["client_certificate_id"] = de.read_string( - _SCHEMA_UPDATE_STAGE_OUTPUT.members["clientCertificateId"] - ) - - case 2: - kwargs["stage_name"] = de.read_string( - _SCHEMA_UPDATE_STAGE_OUTPUT.members["stageName"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_STAGE_OUTPUT.members["description"] - ) - - case 4: - kwargs["cache_cluster_enabled"] = de.read_boolean( - _SCHEMA_UPDATE_STAGE_OUTPUT.members["cacheClusterEnabled"] - ) - - case 5: - kwargs["cache_cluster_size"] = CacheClusterSize( - de.read_string( - _SCHEMA_UPDATE_STAGE_OUTPUT.members["cacheClusterSize"] - ) - ) - - case 6: - kwargs["cache_cluster_status"] = CacheClusterStatus( - de.read_string( - _SCHEMA_UPDATE_STAGE_OUTPUT.members["cacheClusterStatus"] - ) - ) - - case 7: - kwargs["method_settings"] = _deserialize_map_of_method_settings( - de, _SCHEMA_UPDATE_STAGE_OUTPUT.members["methodSettings"] - ) - - case 8: - kwargs["variables"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_UPDATE_STAGE_OUTPUT.members["variables"] - ) - - case 9: - kwargs["documentation_version"] = de.read_string( - _SCHEMA_UPDATE_STAGE_OUTPUT.members["documentationVersion"] - ) - - case 10: - kwargs["access_log_settings"] = AccessLogSettings.deserialize(de) - - case 11: - kwargs["canary_settings"] = CanarySettings.deserialize(de) - - case 12: - kwargs["tracing_enabled"] = de.read_boolean( - _SCHEMA_UPDATE_STAGE_OUTPUT.members["tracingEnabled"] - ) - - case 13: - kwargs["web_acl_arn"] = de.read_string( - _SCHEMA_UPDATE_STAGE_OUTPUT.members["webAclArn"] - ) - - case 14: - kwargs["tags"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_UPDATE_STAGE_OUTPUT.members["tags"] - ) - - case 15: - kwargs["created_date"] = de.read_timestamp( - _SCHEMA_UPDATE_STAGE_OUTPUT.members["createdDate"] - ) - - case 16: - kwargs["last_updated_date"] = de.read_timestamp( - _SCHEMA_UPDATE_STAGE_OUTPUT.members["lastUpdatedDate"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_STAGE_OUTPUT, consumer=_consumer) - return kwargs - - -UPDATE_STAGE = APIOperation( - input=UpdateStageInput, - output=UpdateStageOutput, - schema=_SCHEMA_UPDATE_STAGE, - input_schema=_SCHEMA_UPDATE_STAGE_INPUT, - output_schema=_SCHEMA_UPDATE_STAGE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, +REJECT_DOMAIN_NAME_ACCESS_ASSOCIATION: APIOperation[ + RejectDomainNameAccessAssociationInput, RejectDomainNameAccessAssociationOutput +] = APIOperation( + static_schema=_SCHEMA_REJECT_DOMAIN_NAME_ACCESS_ASSOCIATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) +TAG_RESOURCE: APIOperation[TagResourceInput, TagResourceOutput] = APIOperation( + static_schema=_SCHEMA_TAG_RESOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -@dataclass(kw_only=True) -class UpdateUsageInput: - """ - The PATCH request to grant a temporary extension to the remaining quota - of a usage plan associated with a specified API key. - """ - - usage_plan_id: str | None = None - """The Id of the usage plan associated with the usage data.""" - - key_id: str | None = None - """ - The identifier of the API key associated with the usage plan in which a - temporary extension is granted to the remaining quota. - """ - - patch_operations: list[PatchOperation] | None = None - """ - For more information about supported patch operations, see [Patch - Operations](https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_USAGE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.usage_plan_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_USAGE_INPUT.members["usagePlanId"], self.usage_plan_id - ) - - if self.key_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_USAGE_INPUT.members["keyId"], self.key_id - ) - - if self.patch_operations is not None: - _serialize_list_of_patch_operation( - serializer, - _SCHEMA_UPDATE_USAGE_INPUT.members["patchOperations"], - self.patch_operations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["usage_plan_id"] = de.read_string( - _SCHEMA_UPDATE_USAGE_INPUT.members["usagePlanId"] - ) - - case 1: - kwargs["key_id"] = de.read_string( - _SCHEMA_UPDATE_USAGE_INPUT.members["keyId"] - ) - - case 2: - kwargs["patch_operations"] = _deserialize_list_of_patch_operation( - de, _SCHEMA_UPDATE_USAGE_INPUT.members["patchOperations"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_USAGE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateUsageOutput: - """Represents the usage data of a usage plan.""" - - usage_plan_id: str | None = None - """The plan Id associated with this usage data.""" - - start_date: str | None = None - """The starting date of the usage data.""" - - end_date: str | None = None - """The ending date of the usage data.""" - - items: dict[str, list[list[int]]] | None = None - """ - The usage data, as daily logs of used and remaining quotas, over the - specified time interval indexed over the API keys in a usage plan. For - example, - `{..., "values" : { "{api_key}" : [ [0, 100], [10, 90], [100, 10]]}`, - where `{api_key}` stands for an API key value and the daily log entry is - of the format `[used quota, remaining quota]`. - """ - - position: str | None = None - """The current pagination position in the paged result set.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False +TEST_INVOKE_AUTHORIZER: APIOperation[ + TestInvokeAuthorizerInput, TestInvokeAuthorizerOutput +] = APIOperation( + static_schema=_SCHEMA_TEST_INVOKE_AUTHORIZER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +TEST_INVOKE_METHOD: APIOperation[TestInvokeMethodInput, TestInvokeMethodOutput] = ( + APIOperation( + static_schema=_SCHEMA_TEST_INVOKE_METHOD, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_USAGE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.usage_plan_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_USAGE_OUTPUT.members["usagePlanId"], self.usage_plan_id - ) - - if self.start_date is not None: - serializer.write_string( - _SCHEMA_UPDATE_USAGE_OUTPUT.members["startDate"], self.start_date - ) - - if self.end_date is not None: - serializer.write_string( - _SCHEMA_UPDATE_USAGE_OUTPUT.members["endDate"], self.end_date - ) - - if self.items is not None: - _serialize_map_of_key_usages( - serializer, _SCHEMA_UPDATE_USAGE_OUTPUT.members["items"], self.items - ) - - if self.position is not None: - serializer.write_string( - _SCHEMA_UPDATE_USAGE_OUTPUT.members["position"], self.position - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["usage_plan_id"] = de.read_string( - _SCHEMA_UPDATE_USAGE_OUTPUT.members["usagePlanId"] - ) - - case 1: - kwargs["start_date"] = de.read_string( - _SCHEMA_UPDATE_USAGE_OUTPUT.members["startDate"] - ) - - case 2: - kwargs["end_date"] = de.read_string( - _SCHEMA_UPDATE_USAGE_OUTPUT.members["endDate"] - ) - - case 3: - kwargs["items"] = _deserialize_map_of_key_usages( - de, _SCHEMA_UPDATE_USAGE_OUTPUT.members["items"] - ) - - case 4: - kwargs["position"] = de.read_string( - _SCHEMA_UPDATE_USAGE_OUTPUT.members["position"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_USAGE_OUTPUT, consumer=_consumer) - return kwargs - - -UPDATE_USAGE = APIOperation( - input=UpdateUsageInput, - output=UpdateUsageOutput, - schema=_SCHEMA_UPDATE_USAGE, - input_schema=_SCHEMA_UPDATE_USAGE_INPUT, - output_schema=_SCHEMA_UPDATE_USAGE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), +) + +UNTAG_RESOURCE: APIOperation[UntagResourceInput, UntagResourceOutput] = APIOperation( + static_schema=_SCHEMA_UNTAG_RESOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, +) + +UPDATE_ACCOUNT: APIOperation[UpdateAccountInput, UpdateAccountOutput] = APIOperation( + static_schema=_SCHEMA_UPDATE_ACCOUNT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) +UPDATE_API_KEY: APIOperation[UpdateApiKeyInput, UpdateApiKeyOutput] = APIOperation( + static_schema=_SCHEMA_UPDATE_API_KEY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -@dataclass(kw_only=True) -class UpdateUsagePlanInput: - """The PATCH request to update a usage plan of a given plan Id.""" - - usage_plan_id: str | None = None - """The Id of the to-be-updated usage plan.""" - - patch_operations: list[PatchOperation] | None = None - """ - For more information about supported patch operations, see [Patch - Operations](https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_USAGE_PLAN_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.usage_plan_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_USAGE_PLAN_INPUT.members["usagePlanId"], - self.usage_plan_id, - ) - - if self.patch_operations is not None: - _serialize_list_of_patch_operation( - serializer, - _SCHEMA_UPDATE_USAGE_PLAN_INPUT.members["patchOperations"], - self.patch_operations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["usage_plan_id"] = de.read_string( - _SCHEMA_UPDATE_USAGE_PLAN_INPUT.members["usagePlanId"] - ) - - case 1: - kwargs["patch_operations"] = _deserialize_list_of_patch_operation( - de, _SCHEMA_UPDATE_USAGE_PLAN_INPUT.members["patchOperations"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_USAGE_PLAN_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateUsagePlanOutput: - """ - Represents a usage plan used to specify who can assess associated API - stages. Optionally, target request rate and quota limits can be set. In - some cases clients can exceed the targets that you set. Don't rely on - usage plans to control costs. Consider using [Amazon Web Services - Budgets](https://docs.aws.amazon.com/cost-management/latest/userguide/budgets-managing-costs.html) - to monitor costs and - [WAF](https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html) - to manage API requests. - """ - - id: str | None = None - """The identifier of a UsagePlan resource.""" - - name: str | None = None - """The name of a usage plan.""" - - description: str | None = None - """The description of a usage plan.""" - - api_stages: list[ApiStage] | None = None - """The associated API stages of a usage plan.""" - - throttle: ThrottleSettings | None = None - """ - A map containing method level throttling information for API stage in a - usage plan. - """ - - quota: QuotaSettings | None = None - """ - The target maximum number of permitted requests per a given unit time - interval. - """ - - product_code: str | None = None - """ - The Amazon Web Services Marketplace product identifier to associate with - the usage plan as a SaaS product on the Amazon Web Services Marketplace. - """ - - tags: dict[str, str] | None = None - """ - The collection of tags. Each tag element is associated with a given - resource. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False +UPDATE_AUTHORIZER: APIOperation[UpdateAuthorizerInput, UpdateAuthorizerOutput] = ( + APIOperation( + static_schema=_SCHEMA_UPDATE_AUTHORIZER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_USAGE_PLAN_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string( - _SCHEMA_UPDATE_USAGE_PLAN_OUTPUT.members["id"], self.id - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_UPDATE_USAGE_PLAN_OUTPUT.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_USAGE_PLAN_OUTPUT.members["description"], - self.description, - ) - - if self.api_stages is not None: - _serialize_list_of_api_stage( - serializer, - _SCHEMA_UPDATE_USAGE_PLAN_OUTPUT.members["apiStages"], - self.api_stages, - ) - - if self.throttle is not None: - serializer.write_struct( - _SCHEMA_UPDATE_USAGE_PLAN_OUTPUT.members["throttle"], self.throttle - ) - - if self.quota is not None: - serializer.write_struct( - _SCHEMA_UPDATE_USAGE_PLAN_OUTPUT.members["quota"], self.quota - ) - - if self.product_code is not None: - serializer.write_string( - _SCHEMA_UPDATE_USAGE_PLAN_OUTPUT.members["productCode"], - self.product_code, - ) - - if self.tags is not None: - _serialize_map_of_string_to_string( - serializer, _SCHEMA_UPDATE_USAGE_PLAN_OUTPUT.members["tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_UPDATE_USAGE_PLAN_OUTPUT.members["id"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_USAGE_PLAN_OUTPUT.members["name"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_USAGE_PLAN_OUTPUT.members["description"] - ) - - case 3: - kwargs["api_stages"] = _deserialize_list_of_api_stage( - de, _SCHEMA_UPDATE_USAGE_PLAN_OUTPUT.members["apiStages"] - ) - - case 4: - kwargs["throttle"] = ThrottleSettings.deserialize(de) - - case 5: - kwargs["quota"] = QuotaSettings.deserialize(de) - - case 6: - kwargs["product_code"] = de.read_string( - _SCHEMA_UPDATE_USAGE_PLAN_OUTPUT.members["productCode"] - ) - - case 7: - kwargs["tags"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_UPDATE_USAGE_PLAN_OUTPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_USAGE_PLAN_OUTPUT, consumer=_consumer) - return kwargs - - -UPDATE_USAGE_PLAN = APIOperation( - input=UpdateUsagePlanInput, - output=UpdateUsagePlanOutput, - schema=_SCHEMA_UPDATE_USAGE_PLAN, - input_schema=_SCHEMA_UPDATE_USAGE_PLAN_INPUT, - output_schema=_SCHEMA_UPDATE_USAGE_PLAN_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, +) + +UPDATE_BASE_PATH_MAPPING: APIOperation[ + UpdateBasePathMappingInput, UpdateBasePathMappingOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_BASE_PATH_MAPPING, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +UPDATE_CLIENT_CERTIFICATE: APIOperation[ + UpdateClientCertificateInput, UpdateClientCertificateOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_CLIENT_CERTIFICATE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +UPDATE_DEPLOYMENT: APIOperation[UpdateDeploymentInput, UpdateDeploymentOutput] = ( + APIOperation( + static_schema=_SCHEMA_UPDATE_DEPLOYMENT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#ServiceUnavailableException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +UPDATE_DOCUMENTATION_PART: APIOperation[ + UpdateDocumentationPartInput, UpdateDocumentationPartOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_DOCUMENTATION_PART, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +UPDATE_DOCUMENTATION_VERSION: APIOperation[ + UpdateDocumentationVersionInput, UpdateDocumentationVersionOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_DOCUMENTATION_VERSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +UPDATE_DOMAIN_NAME: APIOperation[UpdateDomainNameInput, UpdateDomainNameOutput] = ( + APIOperation( + static_schema=_SCHEMA_UPDATE_DOMAIN_NAME, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +UPDATE_GATEWAY_RESPONSE: APIOperation[ + UpdateGatewayResponseInput, UpdateGatewayResponseOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_GATEWAY_RESPONSE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +UPDATE_INTEGRATION: APIOperation[UpdateIntegrationInput, UpdateIntegrationOutput] = ( + APIOperation( + static_schema=_SCHEMA_UPDATE_INTEGRATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) ) +UPDATE_INTEGRATION_RESPONSE: APIOperation[ + UpdateIntegrationResponseInput, UpdateIntegrationResponseOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_INTEGRATION_RESPONSE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -@dataclass(kw_only=True) -class UpdateVpcLinkInput: - """Updates an existing VpcLink of a specified identifier.""" - - vpc_link_id: str | None = None - """ - The identifier of the VpcLink. It is used in an Integration to reference - this VpcLink. - """ - - patch_operations: list[PatchOperation] | None = None - """ - For more information about supported patch operations, see [Patch - Operations](https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_VPC_LINK_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.vpc_link_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_VPC_LINK_INPUT.members["vpcLinkId"], self.vpc_link_id - ) - - if self.patch_operations is not None: - _serialize_list_of_patch_operation( - serializer, - _SCHEMA_UPDATE_VPC_LINK_INPUT.members["patchOperations"], - self.patch_operations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["vpc_link_id"] = de.read_string( - _SCHEMA_UPDATE_VPC_LINK_INPUT.members["vpcLinkId"] - ) - - case 1: - kwargs["patch_operations"] = _deserialize_list_of_patch_operation( - de, _SCHEMA_UPDATE_VPC_LINK_INPUT.members["patchOperations"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_VPC_LINK_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateVpcLinkOutput: - """ - An API Gateway VPC link for a RestApi to access resources in an Amazon - Virtual Private Cloud (VPC). - """ +UPDATE_METHOD: APIOperation[UpdateMethodInput, UpdateMethodOutput] = APIOperation( + static_schema=_SCHEMA_UPDATE_METHOD, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - id: str | None = None - """ - The identifier of the VpcLink. It is used in an Integration to reference - this VpcLink. - """ +UPDATE_METHOD_RESPONSE: APIOperation[ + UpdateMethodResponseInput, UpdateMethodResponseOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_METHOD_RESPONSE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - name: str | None = None - """The name used to label and identify the VPC link.""" +UPDATE_MODEL: APIOperation[UpdateModelInput, UpdateModelOutput] = APIOperation( + static_schema=_SCHEMA_UPDATE_MODEL, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - description: str | None = None - """The description of the VPC link.""" +UPDATE_REQUEST_VALIDATOR: APIOperation[ + UpdateRequestValidatorInput, UpdateRequestValidatorOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_REQUEST_VALIDATOR, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - target_arns: list[str] | None = None - """ - The ARN of the network load balancer of the VPC targeted by the VPC - link. The network load balancer must be owned by the same Amazon Web - Services account of the API owner. - """ +UPDATE_RESOURCE: APIOperation[UpdateResourceInput, UpdateResourceOutput] = APIOperation( + static_schema=_SCHEMA_UPDATE_RESOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - status: str | None = None - """ - The status of the VPC link. The valid values are `AVAILABLE`, `PENDING`, - `DELETING`, or `FAILED`. Deploying an API will wait if the status is - `PENDING` and will fail if the status is `DELETING`. - """ +UPDATE_REST_API: APIOperation[UpdateRestApiInput, UpdateRestApiOutput] = APIOperation( + static_schema=_SCHEMA_UPDATE_REST_API, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - status_message: str | None = None - """A description about the VPC link status.""" +UPDATE_STAGE: APIOperation[UpdateStageInput, UpdateStageOutput] = APIOperation( + static_schema=_SCHEMA_UPDATE_STAGE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - tags: dict[str, str] | None = None - """ - The collection of tags. Each tag element is associated with a given - resource. - """ +UPDATE_USAGE: APIOperation[UpdateUsageInput, UpdateUsageOutput] = APIOperation( + static_schema=_SCHEMA_UPDATE_USAGE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False +UPDATE_USAGE_PLAN: APIOperation[UpdateUsagePlanInput, UpdateUsagePlanOutput] = ( + APIOperation( + static_schema=_SCHEMA_UPDATE_USAGE_PLAN, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_VPC_LINK_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string( - _SCHEMA_UPDATE_VPC_LINK_OUTPUT.members["id"], self.id - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_UPDATE_VPC_LINK_OUTPUT.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_VPC_LINK_OUTPUT.members["description"], self.description - ) - - if self.target_arns is not None: - _serialize_list_of_string( - serializer, - _SCHEMA_UPDATE_VPC_LINK_OUTPUT.members["targetArns"], - self.target_arns, - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_UPDATE_VPC_LINK_OUTPUT.members["status"], self.status - ) - - if self.status_message is not None: - serializer.write_string( - _SCHEMA_UPDATE_VPC_LINK_OUTPUT.members["statusMessage"], - self.status_message, - ) - - if self.tags is not None: - _serialize_map_of_string_to_string( - serializer, _SCHEMA_UPDATE_VPC_LINK_OUTPUT.members["tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_UPDATE_VPC_LINK_OUTPUT.members["id"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_VPC_LINK_OUTPUT.members["name"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_VPC_LINK_OUTPUT.members["description"] - ) - - case 3: - kwargs["target_arns"] = _deserialize_list_of_string( - de, _SCHEMA_UPDATE_VPC_LINK_OUTPUT.members["targetArns"] - ) - - case 4: - kwargs["status"] = VpcLinkStatus( - de.read_string(_SCHEMA_UPDATE_VPC_LINK_OUTPUT.members["status"]) - ) - - case 5: - kwargs["status_message"] = de.read_string( - _SCHEMA_UPDATE_VPC_LINK_OUTPUT.members["statusMessage"] - ) - - case 6: - kwargs["tags"] = _deserialize_map_of_string_to_string( - de, _SCHEMA_UPDATE_VPC_LINK_OUTPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_VPC_LINK_OUTPUT, consumer=_consumer) - return kwargs - +) -UPDATE_VPC_LINK = APIOperation( - input=UpdateVpcLinkInput, - output=UpdateVpcLinkOutput, - schema=_SCHEMA_UPDATE_VPC_LINK, - input_schema=_SCHEMA_UPDATE_VPC_LINK_INPUT, - output_schema=_SCHEMA_UPDATE_VPC_LINK_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.apigateway#BadRequestException" - ): BadRequestException, - ShapeID("com.amazonaws.apigateway#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.apigateway#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.apigateway#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.apigateway#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.apigateway#UnauthorizedException" - ): UnauthorizedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, +UPDATE_VPC_LINK: APIOperation[UpdateVpcLinkInput, UpdateVpcLinkOutput] = APIOperation( + static_schema=_SCHEMA_UPDATE_VPC_LINK, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.apigateway#BadRequestException"), + ShapeID("com.amazonaws.apigateway#ConflictException"), + ShapeID("com.amazonaws.apigateway#LimitExceededException"), + ShapeID("com.amazonaws.apigateway#NotFoundException"), + ShapeID("com.amazonaws.apigateway#TooManyRequestsException"), + ShapeID("com.amazonaws.apigateway#UnauthorizedException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) diff --git a/clients/aws-sdk-api-gateway/src/aws_sdk_api_gateway/models.pyi b/clients/aws-sdk-api-gateway/src/aws_sdk_api_gateway/models.pyi new file mode 100644 index 00000000..047a0eb0 --- /dev/null +++ b/clients/aws-sdk-api-gateway/src/aws_sdk_api_gateway/models.pyi @@ -0,0 +1,9025 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. + +from dataclasses import dataclass +from datetime import datetime +from enum import StrEnum +from typing import Self + +from smithy_core.deserializers import ShapeDeserializer +from smithy_core.exceptions import ModeledError +from smithy_core.response import ResponseMetadata +from smithy_core.schemas import APIOperation +from smithy_core.serializers import ShapeSerializer +from smithy_core.types import UnknownEnumMixin + +class _SerdeShape: + def serialize(self, serializer: ShapeSerializer) -> None: ... + def serialize_members(self, serializer: ShapeSerializer) -> None: ... + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: ... + +class ServiceError(ModeledError): + """ + Base error for all errors in the service. + + Some exceptions do not extend from this class, including + synthetic, implicit, and shared exception types. + """ + +class AccessAssociationSourceType(UnknownEnumMixin, StrEnum): + VPCE = "VPCE" + +@dataclass(kw_only=True) +class AccessLogSettings(_SerdeShape): + """ + Access log settings, including the access log format and access log + destination ARN. + """ + + format: str | None = ... + """ + A single line format of the access logs of data, as specified by + selected $context variables. The format must include at least + `$context.requestId`. + """ + destination_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the CloudWatch Logs log group or + Kinesis Data Firehose delivery stream to receive access logs. If you + specify a Kinesis Data Firehose delivery stream, the stream name must + begin with `amazon-apigateway-`. + """ + +@dataclass(kw_only=True) +class ApiKey(_SerdeShape): + """ + A resource that can be distributed to callers for executing Method + resources that require an API key. API keys can be mapped to any Stage + on any RestApi, which indicates that the callers with the API key can + make requests to that stage. + """ + + id: str | None = ... + """The identifier of the API Key.""" + value: str | None = ... + """The value of the API Key.""" + name: str | None = ... + """The name of the API Key.""" + customer_id: str | None = ... + """ + An Amazon Web Services Marketplace customer identifier, when integrating + with the Amazon Web Services SaaS Marketplace. + """ + description: str | None = ... + """The description of the API Key.""" + enabled: bool = ... + """Specifies whether the API Key can be used by callers.""" + created_date: datetime | None = ... + """The timestamp when the API Key was created.""" + last_updated_date: datetime | None = ... + """The timestamp when the API Key was last updated.""" + stage_keys: list[str] | None = ... + """A list of Stage resources that are associated with the ApiKey resource.""" + tags: dict[str, str] | None = ... + """ + The collection of tags. Each tag element is associated with a given + resource. + """ + +class ApiKeysFormat(UnknownEnumMixin, StrEnum): + CSV = "csv" + +class ApiKeySourceType(UnknownEnumMixin, StrEnum): + HEADER = "HEADER" + AUTHORIZER = "AUTHORIZER" + +@dataclass(kw_only=True) +class ApiStage(_SerdeShape): + """API stage name of the associated API stage in a usage plan.""" + + api_id: str | None = ... + """API Id of the associated API stage in a usage plan.""" + stage: str | None = ... + """API stage name of the associated API stage in a usage plan.""" + throttle: dict[str, ThrottleSettings] | None = ... + """ + Map containing method level throttling information for API stage in a + usage plan. + """ + +class ApiStatus(UnknownEnumMixin, StrEnum): + UPDATING = "UPDATING" + AVAILABLE = "AVAILABLE" + PENDING = "PENDING" + FAILED = "FAILED" + +@dataclass(kw_only=True) +class Authorizer(_SerdeShape): + """ + Represents an authorization layer for methods. If enabled on a method, + API Gateway will activate the authorizer when a client calls the method. + """ + + id: str | None = ... + """The identifier for the authorizer resource.""" + name: str | None = ... + """The name of the authorizer.""" + type: str | None = ... + """ + The authorizer type. Valid values are `TOKEN` for a Lambda function + using a single authorization token submitted in a custom header, + `REQUEST` for a Lambda function using incoming request parameters, and + `COGNITO_USER_POOLS` for using an Amazon Cognito user pool. + """ + provider_ar_ns: list[str] | None = ... + """ + A list of the Amazon Cognito user pool ARNs for the `COGNITO_USER_POOLS` + authorizer. Each element is of this format: + `arn:aws:cognito-idp:{region}:{account_id}:userpool/{user_pool_id}`. For + a `TOKEN` or `REQUEST` authorizer, this is not defined. + """ + auth_type: str | None = ... + """ + Optional customer-defined field, used in OpenAPI imports and exports + without functional impact. + """ + authorizer_uri: str | None = ... + """ + Specifies the authorizer's Uniform Resource Identifier (URI). For + `TOKEN` or `REQUEST` authorizers, this must be a well-formed Lambda + function URI, for example, + `arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:{account_id}:function:{lambda_function_name}/invocations`. + In general, the URI has this form + `arn:aws:apigateway:{region}:lambda:path/{service_api}`, where + `{region}` is the same as the region hosting the Lambda function, `path` + indicates that the remaining substring in the URI should be treated as + the path to the resource, including the initial `/`. For Lambda + functions, this is usually of the form + `/2015-03-31/functions/[FunctionARN]/invocations`. + """ + authorizer_credentials: str | None = ... + """ + Specifies the required credentials as an IAM role for API Gateway to + invoke the authorizer. To specify an IAM role for API Gateway to assume, + use the role's Amazon Resource Name (ARN). To use resource-based + permissions on the Lambda function, specify null. + """ + identity_source: str | None = ... + """ + The identity source for which authorization is requested. For a `TOKEN` + or `COGNITO_USER_POOLS` authorizer, this is required and specifies the + request header mapping expression for the custom header holding the + authorization token submitted by the client. For example, if the token + header name is `Auth`, the header mapping expression is + `method.request.header.Auth`. For the `REQUEST` authorizer, this is + required when authorization caching is enabled. The value is a + comma-separated string of one or more mapping expressions of the + specified request parameters. For example, if an `Auth` header, a `Name` + query string parameter are defined as identity sources, this value is + `method.request.header.Auth`, `method.request.querystring.Name`. These + parameters will be used to derive the authorization caching key and to + perform runtime validation of the `REQUEST` authorizer by verifying all + of the identity-related request parameters are present, not null and + non-empty. Only when this is true does the authorizer invoke the + authorizer Lambda function, otherwise, it returns a 401 Unauthorized + response without calling the Lambda function. The valid value is a + string of comma-separated mapping expressions of the specified request + parameters. When the authorization caching is not enabled, this property + is optional. + """ + identity_validation_expression: str | None = ... + """ + A validation expression for the incoming identity token. For `TOKEN` + authorizers, this value is a regular expression. For + `COGNITO_USER_POOLS` authorizers, API Gateway will match the `aud` field + of the incoming token from the client against the specified regular + expression. It will invoke the authorizer's Lambda function when there + is a match. Otherwise, it will return a 401 Unauthorized response + without calling the Lambda function. The validation expression does not + apply to the `REQUEST` authorizer. + """ + authorizer_result_ttl_in_seconds: int | None = ... + """ + The TTL in seconds of cached authorizer results. If it equals 0, + authorization caching is disabled. If it is greater than 0, API Gateway + will cache authorizer responses. If this field is not set, the default + value is 300. The maximum value is 3600, or 1 hour. + """ + +class AuthorizerType(UnknownEnumMixin, StrEnum): + """ + The authorizer type. Valid values are `TOKEN` for a Lambda function + using a single authorization token submitted in a custom header, + `REQUEST` for a Lambda function using incoming request parameters, and + `COGNITO_USER_POOLS` for using an Amazon Cognito user pool. + """ + + TOKEN = "TOKEN" + REQUEST = "REQUEST" + COGNITO_USER_POOLS = "COGNITO_USER_POOLS" + +@dataclass(kw_only=True) +class BadRequestException(ServiceError, _SerdeShape): + """ + The submitted request is not valid, for example, the input is incomplete + or incorrect. See the accompanying error message for details. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class BasePathMapping(_SerdeShape): + """ + Represents the base path that callers of the API must provide as part of + the URL after the domain name. + """ + + base_path: str | None = ... + """ + The base path name that callers of the API must provide as part of the + URL after the domain name. + """ + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + stage: str | None = ... + """The name of the associated stage.""" + +class CacheClusterSize(UnknownEnumMixin, StrEnum): + """Returns the size of the CacheCluster.""" + + SIZE_0_POINT_5_GB = "0.5" + SIZE_1_POINT_6_GB = "1.6" + SIZE_6_POINT_1_GB = "6.1" + SIZE_13_POINT_5_GB = "13.5" + SIZE_28_POINT_4_GB = "28.4" + SIZE_58_POINT_2_GB = "58.2" + SIZE_118_GB = "118" + SIZE_237_GB = "237" + +class CacheClusterStatus(UnknownEnumMixin, StrEnum): + """Returns the status of the CacheCluster.""" + + CREATE_IN_PROGRESS = "CREATE_IN_PROGRESS" + AVAILABLE = "AVAILABLE" + DELETE_IN_PROGRESS = "DELETE_IN_PROGRESS" + NOT_AVAILABLE = "NOT_AVAILABLE" + FLUSH_IN_PROGRESS = "FLUSH_IN_PROGRESS" + +@dataclass(kw_only=True) +class CanarySettings(_SerdeShape): + """Configuration settings of a canary deployment.""" + + percent_traffic: float = ... + """The percent (0-100) of traffic diverted to a canary deployment.""" + deployment_id: str | None = ... + """The ID of the canary deployment.""" + stage_variable_overrides: dict[str, str] | None = ... + """ + Stage variables overridden for a canary release deployment, including + new stage variables introduced in the canary. These stage variables are + represented as a string-to-string map between stage variable names and + their values. + """ + use_stage_cache: bool = ... + """ + A Boolean flag to indicate whether the canary deployment uses the stage + cache or not. + """ + +@dataclass(kw_only=True) +class ClientCertificate(_SerdeShape): + """ + Represents a client certificate used to configure client-side SSL + authentication while sending requests to the integration endpoint. + """ + + client_certificate_id: str | None = ... + """The identifier of the client certificate.""" + description: str | None = ... + """The description of the client certificate.""" + pem_encoded_certificate: str | None = ... + """ + The PEM-encoded public key of the client certificate, which can be used + to configure certificate authentication in the integration endpoint . + """ + created_date: datetime | None = ... + """The timestamp when the client certificate was created.""" + expiration_date: datetime | None = ... + """The timestamp when the client certificate will expire.""" + tags: dict[str, str] | None = ... + """ + The collection of tags. Each tag element is associated with a given + resource. + """ + +@dataclass(kw_only=True) +class ConflictException(ServiceError, _SerdeShape): + """ + The request configuration has conflicts. For details, see the + accompanying error message. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class ConnectionType(UnknownEnumMixin, StrEnum): + INTERNET = "INTERNET" + VPC_LINK = "VPC_LINK" + +class ContentHandlingStrategy(UnknownEnumMixin, StrEnum): + CONVERT_TO_BINARY = "CONVERT_TO_BINARY" + CONVERT_TO_TEXT = "CONVERT_TO_TEXT" + +@dataclass(kw_only=True) +class CreateApiKeyInput(_SerdeShape): + """Request to create an ApiKey resource.""" + + name: str | None = ... + """The name of the ApiKey.""" + description: str | None = ... + """The description of the ApiKey.""" + enabled: bool = ... + """Specifies whether the ApiKey can be used by callers.""" + generate_distinct_id: bool = ... + """ + Specifies whether (`true`) or not (`false`) the key identifier is + distinct from the created API key value. This parameter is deprecated + and should not be used. + """ + value: str | None = ... + """Specifies a value of the API key.""" + stage_keys: list[StageKey] | None = ... + """ + DEPRECATED FOR USAGE PLANS - Specifies stages associated with the API + key. + """ + customer_id: str | None = ... + """ + An Amazon Web Services Marketplace customer identifier, when integrating + with the Amazon Web Services SaaS Marketplace. + """ + tags: dict[str, str] | None = ... + """ + The key-value map of strings. The valid character set is + [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not + start with `aws:`. The tag value can be up to 256 characters. + """ + +@dataclass(kw_only=True) +class CreateApiKeyOutput(_SerdeShape): + """ + A resource that can be distributed to callers for executing Method + resources that require an API key. API keys can be mapped to any Stage + on any RestApi, which indicates that the callers with the API key can + make requests to that stage. + """ + + id: str | None = ... + """The identifier of the API Key.""" + value: str | None = ... + """The value of the API Key.""" + name: str | None = ... + """The name of the API Key.""" + customer_id: str | None = ... + """ + An Amazon Web Services Marketplace customer identifier, when integrating + with the Amazon Web Services SaaS Marketplace. + """ + description: str | None = ... + """The description of the API Key.""" + enabled: bool = ... + """Specifies whether the API Key can be used by callers.""" + created_date: datetime | None = ... + """The timestamp when the API Key was created.""" + last_updated_date: datetime | None = ... + """The timestamp when the API Key was last updated.""" + stage_keys: list[str] | None = ... + """A list of Stage resources that are associated with the ApiKey resource.""" + tags: dict[str, str] | None = ... + """ + The collection of tags. Each tag element is associated with a given + resource. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateAuthorizerInput(_SerdeShape): + """Request to add a new Authorizer to an existing RestApi resource.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + name: str | None = ... + """The name of the authorizer.""" + type: str | None = ... + """ + The authorizer type. Valid values are `TOKEN` for a Lambda function + using a single authorization token submitted in a custom header, + `REQUEST` for a Lambda function using incoming request parameters, and + `COGNITO_USER_POOLS` for using an Amazon Cognito user pool. + """ + provider_ar_ns: list[str] | None = ... + """ + A list of the Amazon Cognito user pool ARNs for the `COGNITO_USER_POOLS` + authorizer. Each element is of this format: + `arn:aws:cognito-idp:{region}:{account_id}:userpool/{user_pool_id}`. For + a `TOKEN` or `REQUEST` authorizer, this is not defined. + """ + auth_type: str | None = ... + """ + Optional customer-defined field, used in OpenAPI imports and exports + without functional impact. + """ + authorizer_uri: str | None = ... + """ + Specifies the authorizer's Uniform Resource Identifier (URI). For + `TOKEN` or `REQUEST` authorizers, this must be a well-formed Lambda + function URI, for example, + `arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:{account_id}:function:{lambda_function_name}/invocations`. + In general, the URI has this form + `arn:aws:apigateway:{region}:lambda:path/{service_api}`, where + `{region}` is the same as the region hosting the Lambda function, `path` + indicates that the remaining substring in the URI should be treated as + the path to the resource, including the initial `/`. For Lambda + functions, this is usually of the form + `/2015-03-31/functions/[FunctionARN]/invocations`. + """ + authorizer_credentials: str | None = ... + """ + Specifies the required credentials as an IAM role for API Gateway to + invoke the authorizer. To specify an IAM role for API Gateway to assume, + use the role's Amazon Resource Name (ARN). To use resource-based + permissions on the Lambda function, specify null. + """ + identity_source: str | None = ... + """ + The identity source for which authorization is requested. For a `TOKEN` + or `COGNITO_USER_POOLS` authorizer, this is required and specifies the + request header mapping expression for the custom header holding the + authorization token submitted by the client. For example, if the token + header name is `Auth`, the header mapping expression is + `method.request.header.Auth`. For the `REQUEST` authorizer, this is + required when authorization caching is enabled. The value is a + comma-separated string of one or more mapping expressions of the + specified request parameters. For example, if an `Auth` header, a `Name` + query string parameter are defined as identity sources, this value is + `method.request.header.Auth, method.request.querystring.Name`. These + parameters will be used to derive the authorization caching key and to + perform runtime validation of the `REQUEST` authorizer by verifying all + of the identity-related request parameters are present, not null and + non-empty. Only when this is true does the authorizer invoke the + authorizer Lambda function, otherwise, it returns a 401 Unauthorized + response without calling the Lambda function. The valid value is a + string of comma-separated mapping expressions of the specified request + parameters. When the authorization caching is not enabled, this property + is optional. + """ + identity_validation_expression: str | None = ... + """ + A validation expression for the incoming identity token. For `TOKEN` + authorizers, this value is a regular expression. For + `COGNITO_USER_POOLS` authorizers, API Gateway will match the `aud` field + of the incoming token from the client against the specified regular + expression. It will invoke the authorizer's Lambda function when there + is a match. Otherwise, it will return a 401 Unauthorized response + without calling the Lambda function. The validation expression does not + apply to the `REQUEST` authorizer. + """ + authorizer_result_ttl_in_seconds: int | None = ... + """ + The TTL in seconds of cached authorizer results. If it equals 0, + authorization caching is disabled. If it is greater than 0, API Gateway + will cache authorizer responses. If this field is not set, the default + value is 300. The maximum value is 3600, or 1 hour. + """ + +@dataclass(kw_only=True) +class CreateAuthorizerOutput(_SerdeShape): + """ + Represents an authorization layer for methods. If enabled on a method, + API Gateway will activate the authorizer when a client calls the method. + """ + + id: str | None = ... + """The identifier for the authorizer resource.""" + name: str | None = ... + """The name of the authorizer.""" + type: str | None = ... + """ + The authorizer type. Valid values are `TOKEN` for a Lambda function + using a single authorization token submitted in a custom header, + `REQUEST` for a Lambda function using incoming request parameters, and + `COGNITO_USER_POOLS` for using an Amazon Cognito user pool. + """ + provider_ar_ns: list[str] | None = ... + """ + A list of the Amazon Cognito user pool ARNs for the `COGNITO_USER_POOLS` + authorizer. Each element is of this format: + `arn:aws:cognito-idp:{region}:{account_id}:userpool/{user_pool_id}`. For + a `TOKEN` or `REQUEST` authorizer, this is not defined. + """ + auth_type: str | None = ... + """ + Optional customer-defined field, used in OpenAPI imports and exports + without functional impact. + """ + authorizer_uri: str | None = ... + """ + Specifies the authorizer's Uniform Resource Identifier (URI). For + `TOKEN` or `REQUEST` authorizers, this must be a well-formed Lambda + function URI, for example, + `arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:{account_id}:function:{lambda_function_name}/invocations`. + In general, the URI has this form + `arn:aws:apigateway:{region}:lambda:path/{service_api}`, where + `{region}` is the same as the region hosting the Lambda function, `path` + indicates that the remaining substring in the URI should be treated as + the path to the resource, including the initial `/`. For Lambda + functions, this is usually of the form + `/2015-03-31/functions/[FunctionARN]/invocations`. + """ + authorizer_credentials: str | None = ... + """ + Specifies the required credentials as an IAM role for API Gateway to + invoke the authorizer. To specify an IAM role for API Gateway to assume, + use the role's Amazon Resource Name (ARN). To use resource-based + permissions on the Lambda function, specify null. + """ + identity_source: str | None = ... + """ + The identity source for which authorization is requested. For a `TOKEN` + or `COGNITO_USER_POOLS` authorizer, this is required and specifies the + request header mapping expression for the custom header holding the + authorization token submitted by the client. For example, if the token + header name is `Auth`, the header mapping expression is + `method.request.header.Auth`. For the `REQUEST` authorizer, this is + required when authorization caching is enabled. The value is a + comma-separated string of one or more mapping expressions of the + specified request parameters. For example, if an `Auth` header, a `Name` + query string parameter are defined as identity sources, this value is + `method.request.header.Auth`, `method.request.querystring.Name`. These + parameters will be used to derive the authorization caching key and to + perform runtime validation of the `REQUEST` authorizer by verifying all + of the identity-related request parameters are present, not null and + non-empty. Only when this is true does the authorizer invoke the + authorizer Lambda function, otherwise, it returns a 401 Unauthorized + response without calling the Lambda function. The valid value is a + string of comma-separated mapping expressions of the specified request + parameters. When the authorization caching is not enabled, this property + is optional. + """ + identity_validation_expression: str | None = ... + """ + A validation expression for the incoming identity token. For `TOKEN` + authorizers, this value is a regular expression. For + `COGNITO_USER_POOLS` authorizers, API Gateway will match the `aud` field + of the incoming token from the client against the specified regular + expression. It will invoke the authorizer's Lambda function when there + is a match. Otherwise, it will return a 401 Unauthorized response + without calling the Lambda function. The validation expression does not + apply to the `REQUEST` authorizer. + """ + authorizer_result_ttl_in_seconds: int | None = ... + """ + The TTL in seconds of cached authorizer results. If it equals 0, + authorization caching is disabled. If it is greater than 0, API Gateway + will cache authorizer responses. If this field is not set, the default + value is 300. The maximum value is 3600, or 1 hour. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateBasePathMappingInput(_SerdeShape): + """Requests API Gateway to create a new BasePathMapping resource.""" + + domain_name: str | None = ... + """The domain name of the BasePathMapping resource to create.""" + domain_name_id: str | None = ... + """ + The identifier for the domain name resource. Required for private custom + domain names. + """ + base_path: str | None = ... + """ + The base path name that callers of the API must provide as part of the + URL after the domain name. This value must be unique for all of the + mappings across a single API. Specify '(none)' if you do not want + callers to specify a base path name after the domain name. + """ + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + stage: str | None = ... + """ + The name of the API's stage that you want to use for this mapping. + Specify '(none)' if you want callers to explicitly specify the stage + name after any base path name. + """ + +@dataclass(kw_only=True) +class CreateBasePathMappingOutput(_SerdeShape): + """ + Represents the base path that callers of the API must provide as part of + the URL after the domain name. + """ + + base_path: str | None = ... + """ + The base path name that callers of the API must provide as part of the + URL after the domain name. + """ + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + stage: str | None = ... + """The name of the associated stage.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateDeploymentInput(_SerdeShape): + """Requests API Gateway to create a Deployment resource.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + stage_name: str | None = ... + """The name of the Stage resource for the Deployment resource to create.""" + stage_description: str | None = ... + """ + The description of the Stage resource for the Deployment resource to + create. + """ + description: str | None = ... + """The description for the Deployment resource to create.""" + cache_cluster_enabled: bool | None = ... + """Enables a cache cluster for the Stage resource specified in the input.""" + cache_cluster_size: str | None = ... + """ + The stage's cache capacity in GB. For more information about choosing a + cache size, see [Enabling API caching to enhance + responsiveness](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html). + """ + variables: dict[str, str] | None = ... + """ + A map that defines the stage variables for the Stage resource that is + associated with the new deployment. Variable names can have alphanumeric + and underscore characters, and the values must match + `[A-Za-z0-9-._~:/?#&=,]+`. + """ + canary_settings: DeploymentCanarySettings | None = ... + """ + The input configuration for the canary deployment when the deployment is + a canary release deployment. + """ + tracing_enabled: bool | None = ... + """Specifies whether active tracing with X-ray is enabled for the Stage.""" + +@dataclass(kw_only=True) +class CreateDeploymentOutput(_SerdeShape): + """ + An immutable representation of a RestApi resource that can be called by + users using Stages. A deployment must be associated with a Stage for it + to be callable over the Internet. + """ + + id: str | None = ... + """The identifier for the deployment resource.""" + description: str | None = ... + """The description for the deployment resource.""" + created_date: datetime | None = ... + """The date and time that the deployment resource was created.""" + api_summary: dict[str, dict[str, MethodSnapshot]] | None = ... + """ + A summary of the RestApi at the date and time that the deployment + resource was created. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateDocumentationPartInput(_SerdeShape): + """Creates a new documentation part of a given API.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + location: DocumentationPartLocation | None = ... + """ + The location of the targeted API entity of the to-be-created + documentation part. + """ + properties: str | None = ... + """ + The new documentation content map of the targeted API entity. Enclosed + key-value pairs are API-specific, but only OpenAPI-compliant key-value + pairs can be exported and, hence, published. + """ + +@dataclass(kw_only=True) +class CreateDocumentationPartOutput(_SerdeShape): + """A documentation part for a targeted API entity.""" + + id: str | None = ... + """ + The DocumentationPart identifier, generated by API Gateway when the + `DocumentationPart` is created. + """ + location: DocumentationPartLocation | None = ... + """ + The location of the API entity to which the documentation applies. Valid + fields depend on the targeted API entity type. All the valid location + fields are not required. If not explicitly specified, a valid location + field is treated as a wildcard and associated documentation content may + be inherited by matching entities, unless overridden. + """ + properties: str | None = ... + """ + A content map of API-specific key-value pairs describing the targeted + API entity. The map must be encoded as a JSON string, e.g., + `"{ \"description\": \"The API does ...\" }"`. Only OpenAPI-compliant + documentation-related fields from the properties map are exported and, + hence, published as part of the API entity definitions, while the + original documentation parts are exported in a OpenAPI extension of + `x-amazon-apigateway-documentation`. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateDocumentationVersionInput(_SerdeShape): + """Creates a new documentation version of a given API.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + documentation_version: str | None = ... + """The version identifier of the new snapshot.""" + stage_name: str | None = ... + """The stage name to be associated with the new documentation snapshot.""" + description: str | None = ... + """A description about the new documentation snapshot.""" + +@dataclass(kw_only=True) +class CreateDocumentationVersionOutput(_SerdeShape): + """A snapshot of the documentation of an API.""" + + version: str | None = ... + """The version identifier of the API documentation snapshot.""" + created_date: datetime | None = ... + """The date when the API documentation snapshot is created.""" + description: str | None = ... + """The description of the API documentation snapshot.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateDomainNameAccessAssociationInput(_SerdeShape): + """Dataclass for CreateDomainNameAccessAssociationInput structure.""" + + domain_name_arn: str | None = ... + """The ARN of the domain name.""" + access_association_source_type: str | None = ... + """The type of the domain name access association source.""" + access_association_source: str | None = ... + """ + The identifier of the domain name access association source. For a VPCE, + the value is the VPC endpoint ID. + """ + tags: dict[str, str] | None = ... + """ + The key-value map of strings. The valid character set is + [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not + start with `aws:`. The tag value can be up to 256 characters. + """ + +@dataclass(kw_only=True) +class CreateDomainNameAccessAssociationOutput(_SerdeShape): + """ + Represents a domain name access association between an access + association source and a private custom domain name. With a domain name + access association, an access association source can invoke a private + custom domain name while isolated from the public internet. + """ + + domain_name_access_association_arn: str | None = ... + """The ARN of the domain name access association resource.""" + domain_name_arn: str | None = ... + """The ARN of the domain name.""" + access_association_source_type: str | None = ... + """The type of the domain name access association source.""" + access_association_source: str | None = ... + """ + The ARN of the domain name access association source. For a VPCE, the + ARN must be a VPC endpoint. + """ + tags: dict[str, str] | None = ... + """ + The collection of tags. Each tag element is associated with a given + resource. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateDomainNameInput(_SerdeShape): + """A request to create a new domain name.""" + + domain_name: str | None = ... + """The name of the DomainName resource.""" + certificate_name: str | None = ... + """ + The user-friendly name of the certificate that will be used by + edge-optimized endpoint or private endpoint for this domain name. + """ + certificate_body: str | None = ... + """ + [Deprecated] The body of the server certificate that will be used by + edge-optimized endpoint or private endpoint for this domain name + provided by your certificate authority. + """ + certificate_private_key: str | None = ... + """ + [Deprecated] Your edge-optimized endpoint's domain name + certificate's private key. + """ + certificate_chain: str | None = ... + """ + [Deprecated] The intermediate certificates and optionally the root + certificate, one after the other without any blank lines, used by an + edge-optimized endpoint for this domain name. If you include the root + certificate, your certificate chain must start with intermediate + certificates and end with the root certificate. Use the intermediate + certificates that were provided by your certificate authority. Do not + include any intermediaries that are not in the chain of trust path. + """ + certificate_arn: str | None = ... + """ + The reference to an Amazon Web Services-managed certificate that will be + used by edge-optimized endpoint or private endpoint for this domain + name. Certificate Manager is the only supported source. + """ + regional_certificate_name: str | None = ... + """ + The user-friendly name of the certificate that will be used by regional + endpoint for this domain name. + """ + regional_certificate_arn: str | None = ... + """ + The reference to an Amazon Web Services-managed certificate that will be + used by regional endpoint for this domain name. Certificate Manager is + the only supported source. + """ + endpoint_configuration: EndpointConfiguration | None = ... + """ + The endpoint configuration of this DomainName showing the endpoint types + and IP address types of the domain name. + """ + tags: dict[str, str] | None = ... + """ + The key-value map of strings. The valid character set is + [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not + start with `aws:`. The tag value can be up to 256 characters. + """ + security_policy: str | None = ... + """ + The Transport Layer Security (TLS) version + cipher suite for this + DomainName. + """ + endpoint_access_mode: str | None = ... + """ + The endpoint access mode of the DomainName. Only available for + DomainNames that use security policies that start with + `SecurityPolicy_`. + """ + mutual_tls_authentication: MutualTlsAuthenticationInput | None = ... + """ + The mutual TLS authentication configuration for a custom domain name. If + specified, API Gateway performs two-way authentication between the + client and the server. Clients must present a trusted certificate to + access your API. + """ + ownership_verification_certificate_arn: str | None = ... + """ + The ARN of the public certificate issued by ACM to validate ownership of + your custom domain. Only required when configuring mutual TLS and using + an ACM imported or private CA certificate ARN as the + regionalCertificateArn. + """ + policy: str | None = ... + """ + A stringified JSON policy document that applies to the `execute-api` + service for this DomainName regardless of the caller and Method + configuration. Supported only for private custom domain names. + """ + routing_mode: str | None = ... + """ + The routing mode for this domain name. The routing mode determines how + API Gateway sends traffic from your custom domain name to your private + APIs. + """ + +@dataclass(kw_only=True) +class CreateDomainNameOutput(_SerdeShape): + """ + Represents a custom domain name as a user-friendly host name of an API + (RestApi). + """ + + domain_name: str | None = ... + """ + The custom domain name as an API host name, for example, + `my-api.example.com`. + """ + domain_name_id: str | None = ... + """ + The identifier for the domain name resource. Supported only for private + custom domain names. + """ + domain_name_arn: str | None = ... + """The ARN of the domain name.""" + certificate_name: str | None = ... + """ + The name of the certificate that will be used by edge-optimized endpoint + or private endpoint for this domain name. + """ + certificate_arn: str | None = ... + """ + The reference to an Amazon Web Services-managed certificate that will be + used by edge-optimized endpoint or private endpoint for this domain + name. Certificate Manager is the only supported source. + """ + certificate_upload_date: datetime | None = ... + """ + The timestamp when the certificate that was used by edge-optimized + endpoint or private endpoint for this domain name was uploaded. + """ + regional_domain_name: str | None = ... + """ + The domain name associated with the regional endpoint for this custom + domain name. You set up this association by adding a DNS record that + points the custom domain name to this regional domain name. The regional + domain name is returned by API Gateway when you create a regional + endpoint. + """ + regional_hosted_zone_id: str | None = ... + """ + The region-specific Amazon Route 53 Hosted Zone ID of the regional + endpoint. For more information, see Set up a Regional Custom Domain Name + and AWS Regions and Endpoints for API Gateway. + """ + regional_certificate_name: str | None = ... + """ + The name of the certificate that will be used for validating the + regional domain name. + """ + regional_certificate_arn: str | None = ... + """ + The reference to an Amazon Web Services-managed certificate that will be + used for validating the regional domain name. Certificate Manager is the + only supported source. + """ + distribution_domain_name: str | None = ... + """ + The domain name of the Amazon CloudFront distribution associated with + this custom domain name for an edge-optimized endpoint. You set up this + association when adding a DNS record pointing the custom domain name to + this distribution name. For more information about CloudFront + distributions, see the Amazon CloudFront documentation. + """ + distribution_hosted_zone_id: str | None = ... + """ + The region-agnostic Amazon Route 53 Hosted Zone ID of the edge-optimized + endpoint. The valid value is `Z2FDTNDATAQYW2` for all the regions. For + more information, see Set up a Regional Custom Domain Name and AWS + Regions and Endpoints for API Gateway. + """ + endpoint_configuration: EndpointConfiguration | None = ... + """ + The endpoint configuration of this DomainName showing the endpoint types + and IP address types of the domain name. + """ + domain_name_status: str | None = ... + """ + The status of the DomainName migration. The valid values are `AVAILABLE` + and `UPDATING`. If the status is `UPDATING`, the domain cannot be + modified further until the existing operation is complete. If it is + `AVAILABLE`, the domain can be updated. + """ + domain_name_status_message: str | None = ... + """ + An optional text message containing detailed information about status of + the DomainName migration. + """ + security_policy: str | None = ... + """ + The Transport Layer Security (TLS) version + cipher suite for this + DomainName. + """ + endpoint_access_mode: str | None = ... + """The endpoint access mode of the DomainName.""" + tags: dict[str, str] | None = ... + """ + The collection of tags. Each tag element is associated with a given + resource. + """ + mutual_tls_authentication: MutualTlsAuthentication | None = ... + """ + The mutual TLS authentication configuration for a custom domain name. If + specified, API Gateway performs two-way authentication between the + client and the server. Clients must present a trusted certificate to + access your API. + """ + ownership_verification_certificate_arn: str | None = ... + """ + The ARN of the public certificate issued by ACM to validate ownership of + your custom domain. Only required when configuring mutual TLS and using + an ACM imported or private CA certificate ARN as the + regionalCertificateArn. + """ + management_policy: str | None = ... + """ + A stringified JSON policy document that applies to the API Gateway + Management service for this DomainName. This policy document controls + access for access association sources to create domain name access + associations with this DomainName. Supported only for private custom + domain names. + """ + policy: str | None = ... + """ + A stringified JSON policy document that applies to the `execute-api` + service for this DomainName regardless of the caller and Method + configuration. Supported only for private custom domain names. + """ + routing_mode: str | None = ... + """ + The routing mode for this domain name. The routing mode determines how + API Gateway sends traffic from your custom domain name to your private + APIs. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateModelInput(_SerdeShape): + """Request to add a new Model to an existing RestApi resource.""" + + rest_api_id: str | None = ... + """The RestApi identifier under which the Model will be created.""" + name: str | None = ... + """The name of the model. Must be alphanumeric.""" + description: str | None = ... + """The description of the model.""" + schema: str | None = ... + """ + The schema for the model. For `application/json` models, this should be + JSON schema draft 4 model. The maximum size of the model is 400 KB. + """ + content_type: str | None = ... + """The content-type for the model.""" + +@dataclass(kw_only=True) +class CreateModelOutput(_SerdeShape): + """ + Represents the data structure of a method's request or response + payload. + """ + + id: str | None = ... + """The identifier for the model resource.""" + name: str | None = ... + """The name of the model. Must be an alphanumeric string.""" + description: str | None = ... + """The description of the model.""" + schema: str | None = ... + """ + The schema for the model. For `application/json` models, this should be + JSON schema draft 4 model. Do not include \"\\*/\" characters in the + description of any properties because such \"\\*/\" characters may be + interpreted as the closing marker for comments in some languages, such + as Java or JavaScript, causing the installation of your API's SDK + generated by API Gateway to fail. + """ + content_type: str | None = ... + """The content-type for the model.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateRequestValidatorInput(_SerdeShape): + """Creates a RequestValidator of a given RestApi.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + name: str | None = ... + """The name of the to-be-created RequestValidator.""" + validate_request_body: bool = ... + """ + A Boolean flag to indicate whether to validate request body according to + the configured model schema for the method (`true`) or not (`false`). + """ + validate_request_parameters: bool = ... + """ + A Boolean flag to indicate whether to validate request parameters, + `true`, or not `false`. + """ + +@dataclass(kw_only=True) +class CreateRequestValidatorOutput(_SerdeShape): + """A set of validation rules for incoming Method requests.""" + + id: str | None = ... + """The identifier of this RequestValidator.""" + name: str | None = ... + """The name of this RequestValidator""" + validate_request_body: bool = ... + """ + A Boolean flag to indicate whether to validate a request body according + to the configured Model schema. + """ + validate_request_parameters: bool = ... + """ + A Boolean flag to indicate whether to validate request parameters + (`true`) or not (`false`). + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateResourceInput(_SerdeShape): + """Requests API Gateway to create a Resource resource.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + parent_id: str | None = ... + """The parent resource's identifier.""" + path_part: str | None = ... + """The last path segment for this resource.""" + +@dataclass(kw_only=True) +class CreateResourceOutput(_SerdeShape): + """Represents an API resource.""" + + id: str | None = ... + """The resource's identifier.""" + parent_id: str | None = ... + """The parent resource's identifier.""" + path_part: str | None = ... + """The last path segment for this resource.""" + path: str | None = ... + """The full path for this resource.""" + resource_methods: dict[str, Method] | None = ... + """Gets an API resource's method of a given HTTP verb.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateRestApiInput(_SerdeShape): + """The POST Request to add a new RestApi resource to your collection.""" + + name: str | None = ... + """The name of the RestApi.""" + description: str | None = ... + """The description of the RestApi.""" + version: str | None = ... + """A version identifier for the API.""" + clone_from: str | None = ... + """The ID of the RestApi that you want to clone from.""" + binary_media_types: list[str] | None = ... + """ + The list of binary media types supported by the RestApi. By default, the + RestApi supports only UTF-8-encoded text payloads. + """ + minimum_compression_size: int | None = ... + """ + A nullable integer that is used to enable compression (with non-negative + between 0 and 10485760 (10M) bytes, inclusive) or disable compression + (with a null value) on an API. When compression is enabled, compression + or decompression is not applied on the payload if the payload size is + smaller than this value. Setting it to zero allows compression for any + payload size. + """ + api_key_source: str | None = ... + """ + The source of the API key for metering requests according to a usage + plan. Valid values are: `HEADER` to read the API key from the + `X-API-Key` header of a request. `AUTHORIZER` to read the API key from + the `UsageIdentifierKey` from a custom authorizer. + """ + endpoint_configuration: EndpointConfiguration | None = ... + """ + The endpoint configuration of this RestApi showing the endpoint types + and IP address types of the API. + """ + policy: str | None = ... + """ + A stringified JSON policy document that applies to this RestApi + regardless of the caller and Method configuration. + """ + tags: dict[str, str] | None = ... + """ + The key-value map of strings. The valid character set is + [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not + start with `aws:`. The tag value can be up to 256 characters. + """ + disable_execute_api_endpoint: bool = ... + """ + Specifies whether clients can invoke your API by using the default + `execute-api` endpoint. By default, clients can invoke your API with the + default `https://{api_id}.execute-api.{region}.amazonaws.com` endpoint. + To require that clients use a custom domain name to invoke your API, + disable the default endpoint + """ + security_policy: str | None = ... + """ + The Transport Layer Security (TLS) version + cipher suite for this + RestApi. + """ + endpoint_access_mode: str | None = ... + """ + The endpoint access mode of the RestApi. Only available for RestApis + that use security policies that start with `SecurityPolicy_`. + """ + +@dataclass(kw_only=True) +class CreateRestApiOutput(_SerdeShape): + """Represents a REST API.""" + + id: str | None = ... + """ + The API's identifier. This identifier is unique across all of your APIs + in API Gateway. + """ + name: str | None = ... + """The API's name.""" + description: str | None = ... + """The API's description.""" + created_date: datetime | None = ... + """The timestamp when the API was created.""" + version: str | None = ... + """A version identifier for the API.""" + warnings: list[str] | None = ... + """ + The warning messages reported when `failonwarnings` is turned on during + API import. + """ + binary_media_types: list[str] | None = ... + """ + The list of binary media types supported by the RestApi. By default, the + RestApi supports only UTF-8-encoded text payloads. + """ + minimum_compression_size: int | None = ... + """ + A nullable integer that is used to enable compression (with non-negative + between 0 and 10485760 (10M) bytes, inclusive) or disable compression + (with a null value) on an API. When compression is enabled, compression + or decompression is not applied on the payload if the payload size is + smaller than this value. Setting it to zero allows compression for any + payload size. + """ + api_key_source: str | None = ... + """ + The source of the API key for metering requests according to a usage + plan. Valid values are: >`HEADER` to read the API key from the + `X-API-Key` header of a request. `AUTHORIZER` to read the API key from + the `UsageIdentifierKey` from a custom authorizer. + """ + endpoint_configuration: EndpointConfiguration | None = ... + """ + The endpoint configuration of this RestApi showing the endpoint types + and IP address types of the API. + """ + policy: str | None = ... + """ + A stringified JSON policy document that applies to this RestApi + regardless of the caller and Method configuration. + """ + tags: dict[str, str] | None = ... + """ + The collection of tags. Each tag element is associated with a given + resource. + """ + disable_execute_api_endpoint: bool = ... + """ + Specifies whether clients can invoke your API by using the default + `execute-api` endpoint. By default, clients can invoke your API with the + default `https://{api_id}.execute-api.{region}.amazonaws.com` endpoint. + To require that clients use a custom domain name to invoke your API, + disable the default endpoint. + """ + root_resource_id: str | None = ... + """The API's root resource ID.""" + security_policy: str | None = ... + """ + The Transport Layer Security (TLS) version + cipher suite for this + RestApi. + """ + endpoint_access_mode: str | None = ... + """The endpoint access mode of the RestApi.""" + api_status: str | None = ... + """The ApiStatus of the RestApi.""" + api_status_message: str | None = ... + """ + The status message of the RestApi. When the status message is `UPDATING` + you can still invoke it. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateStageInput(_SerdeShape): + """Requests API Gateway to create a Stage resource.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + stage_name: str | None = ... + """ + The name for the Stage resource. Stage names can only contain + alphanumeric characters, hyphens, and underscores. Maximum length is 128 + characters. + """ + deployment_id: str | None = ... + """The identifier of the Deployment resource for the Stage resource.""" + description: str | None = ... + """The description of the Stage resource.""" + cache_cluster_enabled: bool = ... + """Whether cache clustering is enabled for the stage.""" + cache_cluster_size: str | None = ... + """ + The stage's cache capacity in GB. For more information about choosing a + cache size, see [Enabling API caching to enhance + responsiveness](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html). + """ + variables: dict[str, str] | None = ... + """ + A map that defines the stage variables for the new Stage resource. + Variable names can have alphanumeric and underscore characters, and the + values must match `[A-Za-z0-9-._~:/?#&=,]+`. + """ + documentation_version: str | None = ... + """The version of the associated API documentation.""" + canary_settings: CanarySettings | None = ... + """The canary deployment settings of this stage.""" + tracing_enabled: bool = ... + """Specifies whether active tracing with X-ray is enabled for the Stage.""" + tags: dict[str, str] | None = ... + """ + The key-value map of strings. The valid character set is + [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not + start with `aws:`. The tag value can be up to 256 characters. + """ + +@dataclass(kw_only=True) +class CreateStageOutput(_SerdeShape): + """ + Represents a unique identifier for a version of a deployed RestApi that + is callable by users. + """ + + deployment_id: str | None = ... + """The identifier of the Deployment that the stage points to.""" + client_certificate_id: str | None = ... + """The identifier of a client certificate for an API stage.""" + stage_name: str | None = ... + """ + The name of the stage is the first path segment in the Uniform Resource + Identifier (URI) of a call to API Gateway. Stage names can only contain + alphanumeric characters, hyphens, and underscores. Maximum length is 128 + characters. + """ + description: str | None = ... + """The stage's description.""" + cache_cluster_enabled: bool = ... + """ + Specifies whether a cache cluster is enabled for the stage. To activate + a method-level cache, set `CachingEnabled` to `true` for a method. + """ + cache_cluster_size: str | None = ... + """ + The stage's cache capacity in GB. For more information about choosing a + cache size, see [Enabling API caching to enhance + responsiveness](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html). + """ + cache_cluster_status: str | None = ... + """The status of the cache cluster for the stage, if enabled.""" + method_settings: dict[str, MethodSetting] | None = ... + """ + A map that defines the method settings for a Stage resource. Keys + (designated as `/{method_setting_key` below) are method paths defined as + `{resource_path}/{http_method}` for an individual method override, or + `/*/*` for overriding all methods in the stage. + """ + variables: dict[str, str] | None = ... + """ + A map that defines the stage variables for a Stage resource. Variable + names can have alphanumeric and underscore characters, and the values + must match `[A-Za-z0-9-._~:/?#&=,]+`. + """ + documentation_version: str | None = ... + """The version of the associated API documentation.""" + access_log_settings: AccessLogSettings | None = ... + """Settings for logging access in this stage.""" + canary_settings: CanarySettings | None = ... + """Settings for the canary deployment in this stage.""" + tracing_enabled: bool = ... + """Specifies whether active tracing with X-ray is enabled for the Stage.""" + web_acl_arn: str | None = ... + """The ARN of the WebAcl associated with the Stage.""" + tags: dict[str, str] | None = ... + """ + The collection of tags. Each tag element is associated with a given + resource. + """ + created_date: datetime | None = ... + """The timestamp when the stage was created.""" + last_updated_date: datetime | None = ... + """The timestamp when the stage last updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateUsagePlanInput(_SerdeShape): + """ + The POST request to create a usage plan with the name, description, + throttle limits and quota limits, as well as the associated API stages, + specified in the payload. + """ + + name: str | None = ... + """The name of the usage plan.""" + description: str | None = ... + """The description of the usage plan.""" + api_stages: list[ApiStage] | None = ... + """The associated API stages of the usage plan.""" + throttle: ThrottleSettings | None = ... + """The throttling limits of the usage plan.""" + quota: QuotaSettings | None = ... + """The quota of the usage plan.""" + tags: dict[str, str] | None = ... + """ + The key-value map of strings. The valid character set is + [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not + start with `aws:`. The tag value can be up to 256 characters. + """ + +@dataclass(kw_only=True) +class CreateUsagePlanKeyInput(_SerdeShape): + """ + The POST request to create a usage plan key for adding an existing API + key to a usage plan. + """ + + usage_plan_id: str | None = ... + """ + The Id of the UsagePlan resource representing the usage plan containing + the to-be-created UsagePlanKey resource representing a plan customer. + """ + key_id: str | None = ... + """The identifier of a UsagePlanKey resource for a plan customer.""" + key_type: str | None = ... + """The type of a UsagePlanKey resource for a plan customer.""" + +@dataclass(kw_only=True) +class CreateUsagePlanKeyOutput(_SerdeShape): + """Represents a usage plan key to identify a plan customer.""" + + id: str | None = ... + """The Id of a usage plan key.""" + type: str | None = ... + """ + The type of a usage plan key. Currently, the valid key type is + `API_KEY`. + """ + value: str | None = ... + """The value of a usage plan key.""" + name: str | None = ... + """The name of a usage plan key.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateUsagePlanOutput(_SerdeShape): + """ + Represents a usage plan used to specify who can assess associated API + stages. Optionally, target request rate and quota limits can be set. In + some cases clients can exceed the targets that you set. Don't rely on + usage plans to control costs. Consider using [Amazon Web Services + Budgets](https://docs.aws.amazon.com/cost-management/latest/userguide/budgets-managing-costs.html) + to monitor costs and + [WAF](https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html) + to manage API requests. + """ + + id: str | None = ... + """The identifier of a UsagePlan resource.""" + name: str | None = ... + """The name of a usage plan.""" + description: str | None = ... + """The description of a usage plan.""" + api_stages: list[ApiStage] | None = ... + """The associated API stages of a usage plan.""" + throttle: ThrottleSettings | None = ... + """ + A map containing method level throttling information for API stage in a + usage plan. + """ + quota: QuotaSettings | None = ... + """ + The target maximum number of permitted requests per a given unit time + interval. + """ + product_code: str | None = ... + """ + The Amazon Web Services Marketplace product identifier to associate with + the usage plan as a SaaS product on the Amazon Web Services Marketplace. + """ + tags: dict[str, str] | None = ... + """ + The collection of tags. Each tag element is associated with a given + resource. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateVpcLinkInput(_SerdeShape): + """ + Creates a VPC link, under the caller's account in a selected region, in + an asynchronous operation that typically takes 2-4 minutes to complete + and become operational. The caller must have permissions to create and + update VPC Endpoint services. + """ + + name: str | None = ... + """The name used to label and identify the VPC link.""" + description: str | None = ... + """The description of the VPC link.""" + target_arns: list[str] | None = ... + """ + The ARN of the network load balancer of the VPC targeted by the VPC + link. The network load balancer must be owned by the same Amazon Web + Services account of the API owner. + """ + tags: dict[str, str] | None = ... + """ + The key-value map of strings. The valid character set is + [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not + start with `aws:`. The tag value can be up to 256 characters. + """ + +@dataclass(kw_only=True) +class CreateVpcLinkOutput(_SerdeShape): + """ + An API Gateway VPC link for a RestApi to access resources in an Amazon + Virtual Private Cloud (VPC). + """ + + id: str | None = ... + """ + The identifier of the VpcLink. It is used in an Integration to reference + this VpcLink. + """ + name: str | None = ... + """The name used to label and identify the VPC link.""" + description: str | None = ... + """The description of the VPC link.""" + target_arns: list[str] | None = ... + """ + The ARN of the network load balancer of the VPC targeted by the VPC + link. The network load balancer must be owned by the same Amazon Web + Services account of the API owner. + """ + status: str | None = ... + """ + The status of the VPC link. The valid values are `AVAILABLE`, `PENDING`, + `DELETING`, or `FAILED`. Deploying an API will wait if the status is + `PENDING` and will fail if the status is `DELETING`. + """ + status_message: str | None = ... + """A description about the VPC link status.""" + tags: dict[str, str] | None = ... + """ + The collection of tags. Each tag element is associated with a given + resource. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteApiKeyInput(_SerdeShape): + """A request to delete the ApiKey resource.""" + + api_key: str | None = ... + """The identifier of the ApiKey resource to be deleted.""" + +@dataclass(kw_only=True) +class DeleteApiKeyOutput(_SerdeShape): + """Dataclass for DeleteApiKeyOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteAuthorizerInput(_SerdeShape): + """Request to delete an existing Authorizer resource.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + authorizer_id: str | None = ... + """The identifier of the Authorizer resource.""" + +@dataclass(kw_only=True) +class DeleteAuthorizerOutput(_SerdeShape): + """Dataclass for DeleteAuthorizerOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteBasePathMappingInput(_SerdeShape): + """A request to delete the BasePathMapping resource.""" + + domain_name: str | None = ... + """The domain name of the BasePathMapping resource to delete.""" + domain_name_id: str | None = ... + """ + The identifier for the domain name resource. Supported only for private + custom domain names. + """ + base_path: str | None = ... + """ + The base path name of the BasePathMapping resource to delete. + + To specify an empty base path, set this parameter to `'(none)'`. + """ + +@dataclass(kw_only=True) +class DeleteBasePathMappingOutput(_SerdeShape): + """Dataclass for DeleteBasePathMappingOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteClientCertificateInput(_SerdeShape): + """A request to delete the ClientCertificate resource.""" + + client_certificate_id: str | None = ... + """The identifier of the ClientCertificate resource to be deleted.""" + +@dataclass(kw_only=True) +class DeleteClientCertificateOutput(_SerdeShape): + """Dataclass for DeleteClientCertificateOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteDeploymentInput(_SerdeShape): + """Requests API Gateway to delete a Deployment resource.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + deployment_id: str | None = ... + """The identifier of the Deployment resource to delete.""" + +@dataclass(kw_only=True) +class DeleteDeploymentOutput(_SerdeShape): + """Dataclass for DeleteDeploymentOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteDocumentationPartInput(_SerdeShape): + """Deletes an existing documentation part of an API.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + documentation_part_id: str | None = ... + """The identifier of the to-be-deleted documentation part.""" + +@dataclass(kw_only=True) +class DeleteDocumentationPartOutput(_SerdeShape): + """Dataclass for DeleteDocumentationPartOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteDocumentationVersionInput(_SerdeShape): + """Deletes an existing documentation version of an API.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + documentation_version: str | None = ... + """The version identifier of a to-be-deleted documentation snapshot.""" + +@dataclass(kw_only=True) +class DeleteDocumentationVersionOutput(_SerdeShape): + """Dataclass for DeleteDocumentationVersionOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteDomainNameAccessAssociationInput(_SerdeShape): + """Dataclass for DeleteDomainNameAccessAssociationInput structure.""" + + domain_name_access_association_arn: str | None = ... + """The ARN of the domain name access association resource.""" + +@dataclass(kw_only=True) +class DeleteDomainNameAccessAssociationOutput(_SerdeShape): + """Dataclass for DeleteDomainNameAccessAssociationOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteDomainNameInput(_SerdeShape): + """A request to delete the DomainName resource.""" + + domain_name: str | None = ... + """The name of the DomainName resource to be deleted.""" + domain_name_id: str | None = ... + """ + The identifier for the domain name resource. Supported only for private + custom domain names. + """ + +@dataclass(kw_only=True) +class DeleteDomainNameOutput(_SerdeShape): + """Dataclass for DeleteDomainNameOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteGatewayResponseInput(_SerdeShape): + """ + Clears any customization of a GatewayResponse of a specified response + type on the given RestApi and resets it with the default settings. + """ + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + response_type: str | None = ... + """The response type of the associated GatewayResponse.""" + +@dataclass(kw_only=True) +class DeleteGatewayResponseOutput(_SerdeShape): + """Dataclass for DeleteGatewayResponseOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteIntegrationInput(_SerdeShape): + """Represents a delete integration request.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + resource_id: str | None = ... + """Specifies a delete integration request's resource identifier.""" + http_method: str | None = ... + """Specifies a delete integration request's HTTP method.""" + +@dataclass(kw_only=True) +class DeleteIntegrationOutput(_SerdeShape): + """Dataclass for DeleteIntegrationOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteIntegrationResponseInput(_SerdeShape): + """Represents a delete integration response request.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + resource_id: str | None = ... + """Specifies a delete integration response request's resource identifier.""" + http_method: str | None = ... + """Specifies a delete integration response request's HTTP method.""" + status_code: str | None = ... + """Specifies a delete integration response request's status code.""" + +@dataclass(kw_only=True) +class DeleteIntegrationResponseOutput(_SerdeShape): + """Dataclass for DeleteIntegrationResponseOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteMethodInput(_SerdeShape): + """Request to delete an existing Method resource.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + resource_id: str | None = ... + """The Resource identifier for the Method resource.""" + http_method: str | None = ... + """The HTTP verb of the Method resource.""" + +@dataclass(kw_only=True) +class DeleteMethodOutput(_SerdeShape): + """Dataclass for DeleteMethodOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteMethodResponseInput(_SerdeShape): + """A request to delete an existing MethodResponse resource.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + resource_id: str | None = ... + """The Resource identifier for the MethodResponse resource.""" + http_method: str | None = ... + """The HTTP verb of the Method resource.""" + status_code: str | None = ... + """The status code identifier for the MethodResponse resource.""" + +@dataclass(kw_only=True) +class DeleteMethodResponseOutput(_SerdeShape): + """Dataclass for DeleteMethodResponseOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteModelInput(_SerdeShape): + """Request to delete an existing model in an existing RestApi resource.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + model_name: str | None = ... + """The name of the model to delete.""" + +@dataclass(kw_only=True) +class DeleteModelOutput(_SerdeShape): + """Dataclass for DeleteModelOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteRequestValidatorInput(_SerdeShape): + """Deletes a specified RequestValidator of a given RestApi.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + request_validator_id: str | None = ... + """The identifier of the RequestValidator to be deleted.""" + +@dataclass(kw_only=True) +class DeleteRequestValidatorOutput(_SerdeShape): + """Dataclass for DeleteRequestValidatorOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteResourceInput(_SerdeShape): + """Request to delete a Resource.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + resource_id: str | None = ... + """The identifier of the Resource resource.""" + +@dataclass(kw_only=True) +class DeleteResourceOutput(_SerdeShape): + """Dataclass for DeleteResourceOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteRestApiInput(_SerdeShape): + """Request to delete the specified API from your collection.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + +@dataclass(kw_only=True) +class DeleteRestApiOutput(_SerdeShape): + """Dataclass for DeleteRestApiOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteStageInput(_SerdeShape): + """Requests API Gateway to delete a Stage resource.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + stage_name: str | None = ... + """The name of the Stage resource to delete.""" + +@dataclass(kw_only=True) +class DeleteStageOutput(_SerdeShape): + """Dataclass for DeleteStageOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteUsagePlanInput(_SerdeShape): + """The DELETE request to delete a usage plan of a given plan Id.""" + + usage_plan_id: str | None = ... + """The Id of the to-be-deleted usage plan.""" + +@dataclass(kw_only=True) +class DeleteUsagePlanKeyInput(_SerdeShape): + """ + The DELETE request to delete a usage plan key and remove the underlying + API key from the associated usage plan. + """ + + usage_plan_id: str | None = ... + """ + The Id of the UsagePlan resource representing the usage plan containing + the to-be-deleted UsagePlanKey resource representing a plan customer. + """ + key_id: str | None = ... + """The Id of the UsagePlanKey resource to be deleted.""" + +@dataclass(kw_only=True) +class DeleteUsagePlanKeyOutput(_SerdeShape): + """Dataclass for DeleteUsagePlanKeyOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteUsagePlanOutput(_SerdeShape): + """Dataclass for DeleteUsagePlanOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteVpcLinkInput(_SerdeShape): + """Deletes an existing VpcLink of a specified identifier.""" + + vpc_link_id: str | None = ... + """ + The identifier of the VpcLink. It is used in an Integration to reference + this VpcLink. + """ + +@dataclass(kw_only=True) +class DeleteVpcLinkOutput(_SerdeShape): + """Dataclass for DeleteVpcLinkOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class Deployment(_SerdeShape): + """ + An immutable representation of a RestApi resource that can be called by + users using Stages. A deployment must be associated with a Stage for it + to be callable over the Internet. + """ + + id: str | None = ... + """The identifier for the deployment resource.""" + description: str | None = ... + """The description for the deployment resource.""" + created_date: datetime | None = ... + """The date and time that the deployment resource was created.""" + api_summary: dict[str, dict[str, MethodSnapshot]] | None = ... + """ + A summary of the RestApi at the date and time that the deployment + resource was created. + """ + +@dataclass(kw_only=True) +class DeploymentCanarySettings(_SerdeShape): + """The input configuration for a canary deployment.""" + + percent_traffic: float = ... + """The percentage (0.0-100.0) of traffic routed to the canary deployment.""" + stage_variable_overrides: dict[str, str] | None = ... + """ + A stage variable overrides used for the canary release deployment. They + can override existing stage variables or add new stage variables for the + canary release deployment. These stage variables are represented as a + string-to-string map between stage variable names and their values. + """ + use_stage_cache: bool = ... + """ + A Boolean flag to indicate whether the canary release deployment uses + the stage cache or not. + """ + +@dataclass(kw_only=True) +class DocumentationPart(_SerdeShape): + """A documentation part for a targeted API entity.""" + + id: str | None = ... + """ + The DocumentationPart identifier, generated by API Gateway when the + `DocumentationPart` is created. + """ + location: DocumentationPartLocation | None = ... + """ + The location of the API entity to which the documentation applies. Valid + fields depend on the targeted API entity type. All the valid location + fields are not required. If not explicitly specified, a valid location + field is treated as a wildcard and associated documentation content may + be inherited by matching entities, unless overridden. + """ + properties: str | None = ... + """ + A content map of API-specific key-value pairs describing the targeted + API entity. The map must be encoded as a JSON string, e.g., + `"{ \"description\": \"The API does ...\" }"`. Only OpenAPI-compliant + documentation-related fields from the properties map are exported and, + hence, published as part of the API entity definitions, while the + original documentation parts are exported in a OpenAPI extension of + `x-amazon-apigateway-documentation`. + """ + +@dataclass(kw_only=True) +class DocumentationPartLocation(_SerdeShape): + """Specifies the target API entity to which the documentation applies.""" + + type: str + """ + The type of API entity to which the documentation content applies. Valid + values are `API`, `AUTHORIZER`, `MODEL`, `RESOURCE`, `METHOD`, + `PATH_PARAMETER`, `QUERY_PARAMETER`, `REQUEST_HEADER`, `REQUEST_BODY`, + `RESPONSE`, `RESPONSE_HEADER`, and `RESPONSE_BODY`. Content inheritance + does not apply to any entity of the `API`, `AUTHORIZER`, `METHOD`, + `MODEL`, `REQUEST_BODY`, or `RESOURCE` type. + """ + path: str | None = ... + """ + The URL path of the target. It is a valid field for the API entity types + of `RESOURCE`, `METHOD`, `PATH_PARAMETER`, `QUERY_PARAMETER`, + `REQUEST_HEADER`, `REQUEST_BODY`, `RESPONSE`, `RESPONSE_HEADER`, and + `RESPONSE_BODY`. The default value is `/` for the root resource. When an + applicable child entity inherits the content of another entity of the + same type with more general specifications of the other `location` + attributes, the child entity's `path` attribute must match that of the + parent entity as a prefix. + """ + method: str | None = ... + """ + The HTTP verb of a method. It is a valid field for the API entity types + of `METHOD`, `PATH_PARAMETER`, `QUERY_PARAMETER`, `REQUEST_HEADER`, + `REQUEST_BODY`, `RESPONSE`, `RESPONSE_HEADER`, and `RESPONSE_BODY`. The + default value is `*` for any method. When an applicable child entity + inherits the content of an entity of the same type with more general + specifications of the other `location` attributes, the child entity's + `method` attribute must match that of the parent entity exactly. + """ + status_code: str | None = ... + """ + The HTTP status code of a response. It is a valid field for the API + entity types of `RESPONSE`, `RESPONSE_HEADER`, and `RESPONSE_BODY`. The + default value is `*` for any status code. When an applicable child + entity inherits the content of an entity of the same type with more + general specifications of the other `location` attributes, the child + entity's `statusCode` attribute must match that of the parent entity + exactly. + """ + name: str | None = ... + """ + The name of the targeted API entity. It is a valid and required field + for the API entity types of `AUTHORIZER`, `MODEL`, `PATH_PARAMETER`, + `QUERY_PARAMETER`, `REQUEST_HEADER`, `REQUEST_BODY` and + `RESPONSE_HEADER`. It is an invalid field for any other entity type. + """ + +class DocumentationPartType(UnknownEnumMixin, StrEnum): + API = "API" + AUTHORIZER = "AUTHORIZER" + MODEL = "MODEL" + RESOURCE = "RESOURCE" + METHOD = "METHOD" + PATH_PARAMETER = "PATH_PARAMETER" + QUERY_PARAMETER = "QUERY_PARAMETER" + REQUEST_HEADER = "REQUEST_HEADER" + REQUEST_BODY = "REQUEST_BODY" + RESPONSE = "RESPONSE" + RESPONSE_HEADER = "RESPONSE_HEADER" + RESPONSE_BODY = "RESPONSE_BODY" + +@dataclass(kw_only=True) +class DocumentationVersion(_SerdeShape): + """A snapshot of the documentation of an API.""" + + version: str | None = ... + """The version identifier of the API documentation snapshot.""" + created_date: datetime | None = ... + """The date when the API documentation snapshot is created.""" + description: str | None = ... + """The description of the API documentation snapshot.""" + +@dataclass(kw_only=True) +class DomainName(_SerdeShape): + """ + Represents a custom domain name as a user-friendly host name of an API + (RestApi). + """ + + domain_name: str | None = ... + """ + The custom domain name as an API host name, for example, + `my-api.example.com`. + """ + domain_name_id: str | None = ... + """ + The identifier for the domain name resource. Supported only for private + custom domain names. + """ + domain_name_arn: str | None = ... + """The ARN of the domain name.""" + certificate_name: str | None = ... + """ + The name of the certificate that will be used by edge-optimized endpoint + or private endpoint for this domain name. + """ + certificate_arn: str | None = ... + """ + The reference to an Amazon Web Services-managed certificate that will be + used by edge-optimized endpoint or private endpoint for this domain + name. Certificate Manager is the only supported source. + """ + certificate_upload_date: datetime | None = ... + """ + The timestamp when the certificate that was used by edge-optimized + endpoint or private endpoint for this domain name was uploaded. + """ + regional_domain_name: str | None = ... + """ + The domain name associated with the regional endpoint for this custom + domain name. You set up this association by adding a DNS record that + points the custom domain name to this regional domain name. The regional + domain name is returned by API Gateway when you create a regional + endpoint. + """ + regional_hosted_zone_id: str | None = ... + """ + The region-specific Amazon Route 53 Hosted Zone ID of the regional + endpoint. For more information, see Set up a Regional Custom Domain Name + and AWS Regions and Endpoints for API Gateway. + """ + regional_certificate_name: str | None = ... + """ + The name of the certificate that will be used for validating the + regional domain name. + """ + regional_certificate_arn: str | None = ... + """ + The reference to an Amazon Web Services-managed certificate that will be + used for validating the regional domain name. Certificate Manager is the + only supported source. + """ + distribution_domain_name: str | None = ... + """ + The domain name of the Amazon CloudFront distribution associated with + this custom domain name for an edge-optimized endpoint. You set up this + association when adding a DNS record pointing the custom domain name to + this distribution name. For more information about CloudFront + distributions, see the Amazon CloudFront documentation. + """ + distribution_hosted_zone_id: str | None = ... + """ + The region-agnostic Amazon Route 53 Hosted Zone ID of the edge-optimized + endpoint. The valid value is `Z2FDTNDATAQYW2` for all the regions. For + more information, see Set up a Regional Custom Domain Name and AWS + Regions and Endpoints for API Gateway. + """ + endpoint_configuration: EndpointConfiguration | None = ... + """ + The endpoint configuration of this DomainName showing the endpoint types + and IP address types of the domain name. + """ + domain_name_status: str | None = ... + """ + The status of the DomainName migration. The valid values are `AVAILABLE` + and `UPDATING`. If the status is `UPDATING`, the domain cannot be + modified further until the existing operation is complete. If it is + `AVAILABLE`, the domain can be updated. + """ + domain_name_status_message: str | None = ... + """ + An optional text message containing detailed information about status of + the DomainName migration. + """ + security_policy: str | None = ... + """ + The Transport Layer Security (TLS) version + cipher suite for this + DomainName. + """ + endpoint_access_mode: str | None = ... + """The endpoint access mode of the DomainName.""" + tags: dict[str, str] | None = ... + """ + The collection of tags. Each tag element is associated with a given + resource. + """ + mutual_tls_authentication: MutualTlsAuthentication | None = ... + """ + The mutual TLS authentication configuration for a custom domain name. If + specified, API Gateway performs two-way authentication between the + client and the server. Clients must present a trusted certificate to + access your API. + """ + ownership_verification_certificate_arn: str | None = ... + """ + The ARN of the public certificate issued by ACM to validate ownership of + your custom domain. Only required when configuring mutual TLS and using + an ACM imported or private CA certificate ARN as the + regionalCertificateArn. + """ + management_policy: str | None = ... + """ + A stringified JSON policy document that applies to the API Gateway + Management service for this DomainName. This policy document controls + access for access association sources to create domain name access + associations with this DomainName. Supported only for private custom + domain names. + """ + policy: str | None = ... + """ + A stringified JSON policy document that applies to the `execute-api` + service for this DomainName regardless of the caller and Method + configuration. Supported only for private custom domain names. + """ + routing_mode: str | None = ... + """ + The routing mode for this domain name. The routing mode determines how + API Gateway sends traffic from your custom domain name to your private + APIs. + """ + +@dataclass(kw_only=True) +class DomainNameAccessAssociation(_SerdeShape): + """ + Represents a domain name access association between an access + association source and a private custom domain name. With a domain name + access association, an access association source can invoke a private + custom domain name while isolated from the public internet. + """ + + domain_name_access_association_arn: str | None = ... + """The ARN of the domain name access association resource.""" + domain_name_arn: str | None = ... + """The ARN of the domain name.""" + access_association_source_type: str | None = ... + """The type of the domain name access association source.""" + access_association_source: str | None = ... + """ + The ARN of the domain name access association source. For a VPCE, the + ARN must be a VPC endpoint. + """ + tags: dict[str, str] | None = ... + """ + The collection of tags. Each tag element is associated with a given + resource. + """ + +class DomainNameStatus(UnknownEnumMixin, StrEnum): + AVAILABLE = "AVAILABLE" + UPDATING = "UPDATING" + PENDING = "PENDING" + PENDING_CERTIFICATE_REIMPORT = "PENDING_CERTIFICATE_REIMPORT" + PENDING_OWNERSHIP_VERIFICATION = "PENDING_OWNERSHIP_VERIFICATION" + FAILED = "FAILED" + +class EndpointAccessMode(UnknownEnumMixin, StrEnum): + BASIC = "BASIC" + STRICT = "STRICT" + +@dataclass(kw_only=True) +class EndpointConfiguration(_SerdeShape): + """ + The endpoint configuration to indicate the types of endpoints an API + (RestApi) or its custom domain name (DomainName) has and the IP address + types that can invoke it. + """ + + types: list[str] | None = ... + """ + A list of endpoint types of an API (RestApi) or its custom domain name + (DomainName). For an edge-optimized API and its custom domain name, the + endpoint type is `"EDGE"`. For a regional API and its custom domain + name, the endpoint type is `REGIONAL`. For a private API, the endpoint + type is `PRIVATE`. + """ + ip_address_type: str | None = ... + """ + The IP address types that can invoke an API (RestApi) or a DomainName. + Use `ipv4` to allow only IPv4 addresses to invoke an API or DomainName, + or use `dualstack` to allow both IPv4 and IPv6 addresses to invoke an + API or a DomainName. For the `PRIVATE` endpoint type, only `dualstack` + is supported. + """ + vpc_endpoint_ids: list[str] | None = ... + """ + A list of VpcEndpointIds of an API (RestApi) against which to create + Route53 ALIASes. It is only supported for `PRIVATE` endpoint type. + """ + +class EndpointType(UnknownEnumMixin, StrEnum): + """ + The endpoint type. The valid values are `EDGE` for edge-optimized API + setup, most suitable for mobile applications; `REGIONAL` for regional + API endpoint setup, most suitable for calling from AWS Region; and + `PRIVATE` for private APIs. + """ + + REGIONAL = "REGIONAL" + EDGE = "EDGE" + PRIVATE = "PRIVATE" + +@dataclass(kw_only=True) +class FlushStageAuthorizersCacheInput(_SerdeShape): + """Request to flush authorizer cache entries on a specified stage.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + stage_name: str | None = ... + """The name of the stage to flush.""" + +@dataclass(kw_only=True) +class FlushStageAuthorizersCacheOutput(_SerdeShape): + """Dataclass for FlushStageAuthorizersCacheOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class FlushStageCacheInput(_SerdeShape): + """Requests API Gateway to flush a stage's cache.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + stage_name: str | None = ... + """The name of the stage to flush its cache.""" + +@dataclass(kw_only=True) +class FlushStageCacheOutput(_SerdeShape): + """Dataclass for FlushStageCacheOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GatewayResponse(_SerdeShape): + """ + A gateway response of a given response type and status code, with + optional response parameters and mapping templates. + """ + + response_type: str | None = ... + """The response type of the associated GatewayResponse.""" + status_code: str | None = ... + """The HTTP status code for this GatewayResponse.""" + response_parameters: dict[str, str] | None = ... + """ + Response parameters (paths, query strings and headers) of the + GatewayResponse as a string-to-string map of key-value pairs. + """ + response_templates: dict[str, str] | None = ... + """ + Response templates of the GatewayResponse as a string-to-string map of + key-value pairs. + """ + default_response: bool = ... + """ + A Boolean flag to indicate whether this GatewayResponse is the default + gateway response (`true`) or not (`false`). A default gateway response + is one generated by API Gateway without any customization by an API + developer. + """ + +class GatewayResponseType(UnknownEnumMixin, StrEnum): + DEFAULT_4_XX = "DEFAULT_4XX" + DEFAULT_5_XX = "DEFAULT_5XX" + RESOURCE_NOT_FOUND = "RESOURCE_NOT_FOUND" + UNAUTHORIZED = "UNAUTHORIZED" + INVALID_API_KEY = "INVALID_API_KEY" + ACCESS_DENIED = "ACCESS_DENIED" + AUTHORIZER_FAILURE = "AUTHORIZER_FAILURE" + AUTHORIZER_CONFIGURATION_ERROR = "AUTHORIZER_CONFIGURATION_ERROR" + INVALID_SIGNATURE = "INVALID_SIGNATURE" + EXPIRED_TOKEN = "EXPIRED_TOKEN" + MISSING_AUTHENTICATION_TOKEN = "MISSING_AUTHENTICATION_TOKEN" + INTEGRATION_FAILURE = "INTEGRATION_FAILURE" + INTEGRATION_TIMEOUT = "INTEGRATION_TIMEOUT" + API_CONFIGURATION_ERROR = "API_CONFIGURATION_ERROR" + UNSUPPORTED_MEDIA_TYPE = "UNSUPPORTED_MEDIA_TYPE" + BAD_REQUEST_PARAMETERS = "BAD_REQUEST_PARAMETERS" + BAD_REQUEST_BODY = "BAD_REQUEST_BODY" + REQUEST_TOO_LARGE = "REQUEST_TOO_LARGE" + THROTTLED = "THROTTLED" + QUOTA_EXCEEDED = "QUOTA_EXCEEDED" + WAF_FILTERED = "WAF_FILTERED" + +@dataclass(kw_only=True) +class GenerateClientCertificateInput(_SerdeShape): + """A request to generate a ClientCertificate resource.""" + + description: str | None = ... + """The description of the ClientCertificate.""" + tags: dict[str, str] | None = ... + """ + The key-value map of strings. The valid character set is + [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not + start with `aws:`. The tag value can be up to 256 characters. + """ + +@dataclass(kw_only=True) +class GenerateClientCertificateOutput(_SerdeShape): + """ + Represents a client certificate used to configure client-side SSL + authentication while sending requests to the integration endpoint. + """ + + client_certificate_id: str | None = ... + """The identifier of the client certificate.""" + description: str | None = ... + """The description of the client certificate.""" + pem_encoded_certificate: str | None = ... + """ + The PEM-encoded public key of the client certificate, which can be used + to configure certificate authentication in the integration endpoint . + """ + created_date: datetime | None = ... + """The timestamp when the client certificate was created.""" + expiration_date: datetime | None = ... + """The timestamp when the client certificate will expire.""" + tags: dict[str, str] | None = ... + """ + The collection of tags. Each tag element is associated with a given + resource. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetAccountInput(_SerdeShape): + """ + Requests API Gateway to get information about the current Account + resource. + """ + +@dataclass(kw_only=True) +class GetAccountOutput(_SerdeShape): + """Represents an AWS account that is associated with API Gateway.""" + + cloudwatch_role_arn: str | None = ... + """The ARN of an Amazon CloudWatch role for the current Account.""" + throttle_settings: ThrottleSettings | None = ... + """Specifies the API request limits configured for the current Account.""" + features: list[str] | None = ... + """ + A list of features supported for the account. When usage plans are + enabled, the features list will include an entry of `"UsagePlans"`. + """ + api_key_version: str | None = ... + """The version of the API keys used for the account.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetApiKeyInput(_SerdeShape): + """A request to get information about the current ApiKey resource.""" + + api_key: str | None = ... + """The identifier of the ApiKey resource.""" + include_value: bool | None = ... + """ + A boolean flag to specify whether (`true`) or not (`false`) the result + contains the key value. + """ + +@dataclass(kw_only=True) +class GetApiKeyOutput(_SerdeShape): + """ + A resource that can be distributed to callers for executing Method + resources that require an API key. API keys can be mapped to any Stage + on any RestApi, which indicates that the callers with the API key can + make requests to that stage. + """ + + id: str | None = ... + """The identifier of the API Key.""" + value: str | None = ... + """The value of the API Key.""" + name: str | None = ... + """The name of the API Key.""" + customer_id: str | None = ... + """ + An Amazon Web Services Marketplace customer identifier, when integrating + with the Amazon Web Services SaaS Marketplace. + """ + description: str | None = ... + """The description of the API Key.""" + enabled: bool = ... + """Specifies whether the API Key can be used by callers.""" + created_date: datetime | None = ... + """The timestamp when the API Key was created.""" + last_updated_date: datetime | None = ... + """The timestamp when the API Key was last updated.""" + stage_keys: list[str] | None = ... + """A list of Stage resources that are associated with the ApiKey resource.""" + tags: dict[str, str] | None = ... + """ + The collection of tags. Each tag element is associated with a given + resource. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetApiKeysInput(_SerdeShape): + """A request to get information about the current ApiKeys resource.""" + + position: str | None = ... + """The current pagination position in the paged result set.""" + limit: int | None = ... + """ + The maximum number of returned results per page. The default value is 25 + and the maximum value is 500. + """ + name_query: str | None = ... + """The name of queried API keys.""" + customer_id: str | None = ... + """ + The identifier of a customer in Amazon Web Services Marketplace or an + external system, such as a developer portal. + """ + include_values: bool | None = ... + """ + A boolean flag to specify whether (`true`) or not (`false`) the result + contains key values. + """ + +@dataclass(kw_only=True) +class GetApiKeysOutput(_SerdeShape): + """ + Represents a collection of API keys as represented by an ApiKeys + resource. + """ + + warnings: list[str] | None = ... + """ + A list of warning messages logged during the import of API keys when the + `failOnWarnings` option is set to true. + """ + items: list[ApiKey] | None = ... + """The current page of elements from this collection.""" + position: str | None = ... + """The current pagination position in the paged result set.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetAuthorizerInput(_SerdeShape): + """Request to describe an existing Authorizer resource.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + authorizer_id: str | None = ... + """The identifier of the Authorizer resource.""" + +@dataclass(kw_only=True) +class GetAuthorizerOutput(_SerdeShape): + """ + Represents an authorization layer for methods. If enabled on a method, + API Gateway will activate the authorizer when a client calls the method. + """ + + id: str | None = ... + """The identifier for the authorizer resource.""" + name: str | None = ... + """The name of the authorizer.""" + type: str | None = ... + """ + The authorizer type. Valid values are `TOKEN` for a Lambda function + using a single authorization token submitted in a custom header, + `REQUEST` for a Lambda function using incoming request parameters, and + `COGNITO_USER_POOLS` for using an Amazon Cognito user pool. + """ + provider_ar_ns: list[str] | None = ... + """ + A list of the Amazon Cognito user pool ARNs for the `COGNITO_USER_POOLS` + authorizer. Each element is of this format: + `arn:aws:cognito-idp:{region}:{account_id}:userpool/{user_pool_id}`. For + a `TOKEN` or `REQUEST` authorizer, this is not defined. + """ + auth_type: str | None = ... + """ + Optional customer-defined field, used in OpenAPI imports and exports + without functional impact. + """ + authorizer_uri: str | None = ... + """ + Specifies the authorizer's Uniform Resource Identifier (URI). For + `TOKEN` or `REQUEST` authorizers, this must be a well-formed Lambda + function URI, for example, + `arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:{account_id}:function:{lambda_function_name}/invocations`. + In general, the URI has this form + `arn:aws:apigateway:{region}:lambda:path/{service_api}`, where + `{region}` is the same as the region hosting the Lambda function, `path` + indicates that the remaining substring in the URI should be treated as + the path to the resource, including the initial `/`. For Lambda + functions, this is usually of the form + `/2015-03-31/functions/[FunctionARN]/invocations`. + """ + authorizer_credentials: str | None = ... + """ + Specifies the required credentials as an IAM role for API Gateway to + invoke the authorizer. To specify an IAM role for API Gateway to assume, + use the role's Amazon Resource Name (ARN). To use resource-based + permissions on the Lambda function, specify null. + """ + identity_source: str | None = ... + """ + The identity source for which authorization is requested. For a `TOKEN` + or `COGNITO_USER_POOLS` authorizer, this is required and specifies the + request header mapping expression for the custom header holding the + authorization token submitted by the client. For example, if the token + header name is `Auth`, the header mapping expression is + `method.request.header.Auth`. For the `REQUEST` authorizer, this is + required when authorization caching is enabled. The value is a + comma-separated string of one or more mapping expressions of the + specified request parameters. For example, if an `Auth` header, a `Name` + query string parameter are defined as identity sources, this value is + `method.request.header.Auth`, `method.request.querystring.Name`. These + parameters will be used to derive the authorization caching key and to + perform runtime validation of the `REQUEST` authorizer by verifying all + of the identity-related request parameters are present, not null and + non-empty. Only when this is true does the authorizer invoke the + authorizer Lambda function, otherwise, it returns a 401 Unauthorized + response without calling the Lambda function. The valid value is a + string of comma-separated mapping expressions of the specified request + parameters. When the authorization caching is not enabled, this property + is optional. + """ + identity_validation_expression: str | None = ... + """ + A validation expression for the incoming identity token. For `TOKEN` + authorizers, this value is a regular expression. For + `COGNITO_USER_POOLS` authorizers, API Gateway will match the `aud` field + of the incoming token from the client against the specified regular + expression. It will invoke the authorizer's Lambda function when there + is a match. Otherwise, it will return a 401 Unauthorized response + without calling the Lambda function. The validation expression does not + apply to the `REQUEST` authorizer. + """ + authorizer_result_ttl_in_seconds: int | None = ... + """ + The TTL in seconds of cached authorizer results. If it equals 0, + authorization caching is disabled. If it is greater than 0, API Gateway + will cache authorizer responses. If this field is not set, the default + value is 300. The maximum value is 3600, or 1 hour. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetAuthorizersInput(_SerdeShape): + """Request to describe an existing Authorizers resource.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + position: str | None = ... + """The current pagination position in the paged result set.""" + limit: int | None = ... + """ + The maximum number of returned results per page. The default value is 25 + and the maximum value is 500. + """ + +@dataclass(kw_only=True) +class GetAuthorizersOutput(_SerdeShape): + """Represents a collection of Authorizer resources.""" + + items: list[Authorizer] | None = ... + """The current page of elements from this collection.""" + position: str | None = ... + """The current pagination position in the paged result set.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetBasePathMappingInput(_SerdeShape): + """Request to describe a BasePathMapping resource.""" + + domain_name: str | None = ... + """The domain name of the BasePathMapping resource to be described.""" + domain_name_id: str | None = ... + """ + The identifier for the domain name resource. Supported only for private + custom domain names. + """ + base_path: str | None = ... + """ + The base path name that callers of the API must provide as part of the + URL after the domain name. This value must be unique for all of the + mappings across a single API. Specify '(none)' if you do not want + callers to specify any base path name after the domain name. + """ + +@dataclass(kw_only=True) +class GetBasePathMappingOutput(_SerdeShape): + """ + Represents the base path that callers of the API must provide as part of + the URL after the domain name. + """ + + base_path: str | None = ... + """ + The base path name that callers of the API must provide as part of the + URL after the domain name. + """ + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + stage: str | None = ... + """The name of the associated stage.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetBasePathMappingsInput(_SerdeShape): + """ + A request to get information about a collection of BasePathMapping + resources. + """ + + domain_name: str | None = ... + """The domain name of a BasePathMapping resource.""" + domain_name_id: str | None = ... + """ + The identifier for the domain name resource. Supported only for private + custom domain names. + """ + position: str | None = ... + """The current pagination position in the paged result set.""" + limit: int | None = ... + """ + The maximum number of returned results per page. The default value is 25 + and the maximum value is 500. + """ + +@dataclass(kw_only=True) +class GetBasePathMappingsOutput(_SerdeShape): + """Represents a collection of BasePathMapping resources.""" + + items: list[BasePathMapping] | None = ... + """The current page of elements from this collection.""" + position: str | None = ... + """The current pagination position in the paged result set.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetClientCertificateInput(_SerdeShape): + """ + A request to get information about the current ClientCertificate + resource. + """ + + client_certificate_id: str | None = ... + """The identifier of the ClientCertificate resource to be described.""" + +@dataclass(kw_only=True) +class GetClientCertificateOutput(_SerdeShape): + """ + Represents a client certificate used to configure client-side SSL + authentication while sending requests to the integration endpoint. + """ + + client_certificate_id: str | None = ... + """The identifier of the client certificate.""" + description: str | None = ... + """The description of the client certificate.""" + pem_encoded_certificate: str | None = ... + """ + The PEM-encoded public key of the client certificate, which can be used + to configure certificate authentication in the integration endpoint . + """ + created_date: datetime | None = ... + """The timestamp when the client certificate was created.""" + expiration_date: datetime | None = ... + """The timestamp when the client certificate will expire.""" + tags: dict[str, str] | None = ... + """ + The collection of tags. Each tag element is associated with a given + resource. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetClientCertificatesInput(_SerdeShape): + """ + A request to get information about a collection of ClientCertificate + resources. + """ + + position: str | None = ... + """The current pagination position in the paged result set.""" + limit: int | None = ... + """ + The maximum number of returned results per page. The default value is 25 + and the maximum value is 500. + """ + +@dataclass(kw_only=True) +class GetClientCertificatesOutput(_SerdeShape): + """Represents a collection of ClientCertificate resources.""" + + items: list[ClientCertificate] | None = ... + """The current page of elements from this collection.""" + position: str | None = ... + """The current pagination position in the paged result set.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetDeploymentInput(_SerdeShape): + """Requests API Gateway to get information about a Deployment resource.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + deployment_id: str | None = ... + """The identifier of the Deployment resource to get information about.""" + embed: list[str] | None = ... + """ + A query parameter to retrieve the specified embedded resources of the + returned Deployment resource in the response. In a REST API call, this + `embed` parameter value is a list of comma-separated strings, as in + `GET /restapis/{restapi_id}/deployments/{deployment_id}?embed=var1,var2`. + The SDK and other platform-dependent libraries might use a different + format for the list. Currently, this request supports only retrieval of + the embedded API summary this way. Hence, the parameter value must be a + single-valued list containing only the `"apisummary"` string. For + example, + `GET /restapis/{restapi_id}/deployments/{deployment_id}?embed=apisummary`. + """ + +@dataclass(kw_only=True) +class GetDeploymentOutput(_SerdeShape): + """ + An immutable representation of a RestApi resource that can be called by + users using Stages. A deployment must be associated with a Stage for it + to be callable over the Internet. + """ + + id: str | None = ... + """The identifier for the deployment resource.""" + description: str | None = ... + """The description for the deployment resource.""" + created_date: datetime | None = ... + """The date and time that the deployment resource was created.""" + api_summary: dict[str, dict[str, MethodSnapshot]] | None = ... + """ + A summary of the RestApi at the date and time that the deployment + resource was created. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetDeploymentsInput(_SerdeShape): + """Requests API Gateway to get information about a Deployments collection.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + position: str | None = ... + """The current pagination position in the paged result set.""" + limit: int | None = ... + """ + The maximum number of returned results per page. The default value is 25 + and the maximum value is 500. + """ + +@dataclass(kw_only=True) +class GetDeploymentsOutput(_SerdeShape): + """ + Represents a collection resource that contains zero or more references + to your existing deployments, and links that guide you on how to + interact with your collection. The collection offers a paginated view of + the contained deployments. + """ + + items: list[Deployment] | None = ... + """The current page of elements from this collection.""" + position: str | None = ... + """The current pagination position in the paged result set.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetDocumentationPartInput(_SerdeShape): + """Gets a specified documentation part of a given API.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + documentation_part_id: str | None = ... + """The string identifier of the associated RestApi.""" + +@dataclass(kw_only=True) +class GetDocumentationPartOutput(_SerdeShape): + """A documentation part for a targeted API entity.""" + + id: str | None = ... + """ + The DocumentationPart identifier, generated by API Gateway when the + `DocumentationPart` is created. + """ + location: DocumentationPartLocation | None = ... + """ + The location of the API entity to which the documentation applies. Valid + fields depend on the targeted API entity type. All the valid location + fields are not required. If not explicitly specified, a valid location + field is treated as a wildcard and associated documentation content may + be inherited by matching entities, unless overridden. + """ + properties: str | None = ... + """ + A content map of API-specific key-value pairs describing the targeted + API entity. The map must be encoded as a JSON string, e.g., + `"{ \"description\": \"The API does ...\" }"`. Only OpenAPI-compliant + documentation-related fields from the properties map are exported and, + hence, published as part of the API entity definitions, while the + original documentation parts are exported in a OpenAPI extension of + `x-amazon-apigateway-documentation`. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetDocumentationPartsInput(_SerdeShape): + """ + Gets the documentation parts of an API. The result may be filtered by + the type, name, or path of API entities (targets). + """ + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + type: str | None = ... + """The type of API entities of the to-be-retrieved documentation parts.""" + name_query: str | None = ... + """The name of API entities of the to-be-retrieved documentation parts.""" + path: str | None = ... + """The path of API entities of the to-be-retrieved documentation parts.""" + position: str | None = ... + """The current pagination position in the paged result set.""" + limit: int | None = ... + """ + The maximum number of returned results per page. The default value is 25 + and the maximum value is 500. + """ + location_status: str | None = ... + """ + The status of the API documentation parts to retrieve. Valid values are + `DOCUMENTED` for retrieving DocumentationPart resources with content and + `UNDOCUMENTED` for DocumentationPart resources without content. + """ + +@dataclass(kw_only=True) +class GetDocumentationPartsOutput(_SerdeShape): + """The collection of documentation parts of an API.""" + + items: list[DocumentationPart] | None = ... + """The current page of elements from this collection.""" + position: str | None = ... + """The current pagination position in the paged result set.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetDocumentationVersionInput(_SerdeShape): + """Gets a documentation snapshot of an API.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + documentation_version: str | None = ... + """The version identifier of the to-be-retrieved documentation snapshot.""" + +@dataclass(kw_only=True) +class GetDocumentationVersionOutput(_SerdeShape): + """A snapshot of the documentation of an API.""" + + version: str | None = ... + """The version identifier of the API documentation snapshot.""" + created_date: datetime | None = ... + """The date when the API documentation snapshot is created.""" + description: str | None = ... + """The description of the API documentation snapshot.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetDocumentationVersionsInput(_SerdeShape): + """Gets the documentation versions of an API.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + position: str | None = ... + """The current pagination position in the paged result set.""" + limit: int | None = ... + """ + The maximum number of returned results per page. The default value is 25 + and the maximum value is 500. + """ + +@dataclass(kw_only=True) +class GetDocumentationVersionsOutput(_SerdeShape): + """The collection of documentation snapshots of an API.""" + + items: list[DocumentationVersion] | None = ... + """The current page of elements from this collection.""" + position: str | None = ... + """The current pagination position in the paged result set.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetDomainNameAccessAssociationsInput(_SerdeShape): + """Dataclass for GetDomainNameAccessAssociationsInput structure.""" + + position: str | None = ... + """The current pagination position in the paged result set.""" + limit: int | None = ... + """ + The maximum number of returned results per page. The default value is 25 + and the maximum value is 500. + """ + resource_owner: str | None = ... + """ + The owner of the domain name access association. Use `SELF` to only list + the domain name access associations owned by your own account. Use + `OTHER_ACCOUNTS` to list the domain name access associations with your + private custom domain names that are owned by other AWS accounts. + """ + +@dataclass(kw_only=True) +class GetDomainNameAccessAssociationsOutput(_SerdeShape): + """Dataclass for GetDomainNameAccessAssociationsOutput structure.""" + + items: list[DomainNameAccessAssociation] | None = ... + """The current page of elements from this collection.""" + position: str | None = ... + """The current pagination position in the paged result set.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetDomainNameInput(_SerdeShape): + """Request to get the name of a DomainName resource.""" + + domain_name: str | None = ... + """The name of the DomainName resource.""" + domain_name_id: str | None = ... + """ + The identifier for the domain name resource. Required for private custom + domain names. + """ + +@dataclass(kw_only=True) +class GetDomainNameOutput(_SerdeShape): + """ + Represents a custom domain name as a user-friendly host name of an API + (RestApi). + """ + + domain_name: str | None = ... + """ + The custom domain name as an API host name, for example, + `my-api.example.com`. + """ + domain_name_id: str | None = ... + """ + The identifier for the domain name resource. Supported only for private + custom domain names. + """ + domain_name_arn: str | None = ... + """The ARN of the domain name.""" + certificate_name: str | None = ... + """ + The name of the certificate that will be used by edge-optimized endpoint + or private endpoint for this domain name. + """ + certificate_arn: str | None = ... + """ + The reference to an Amazon Web Services-managed certificate that will be + used by edge-optimized endpoint or private endpoint for this domain + name. Certificate Manager is the only supported source. + """ + certificate_upload_date: datetime | None = ... + """ + The timestamp when the certificate that was used by edge-optimized + endpoint or private endpoint for this domain name was uploaded. + """ + regional_domain_name: str | None = ... + """ + The domain name associated with the regional endpoint for this custom + domain name. You set up this association by adding a DNS record that + points the custom domain name to this regional domain name. The regional + domain name is returned by API Gateway when you create a regional + endpoint. + """ + regional_hosted_zone_id: str | None = ... + """ + The region-specific Amazon Route 53 Hosted Zone ID of the regional + endpoint. For more information, see Set up a Regional Custom Domain Name + and AWS Regions and Endpoints for API Gateway. + """ + regional_certificate_name: str | None = ... + """ + The name of the certificate that will be used for validating the + regional domain name. + """ + regional_certificate_arn: str | None = ... + """ + The reference to an Amazon Web Services-managed certificate that will be + used for validating the regional domain name. Certificate Manager is the + only supported source. + """ + distribution_domain_name: str | None = ... + """ + The domain name of the Amazon CloudFront distribution associated with + this custom domain name for an edge-optimized endpoint. You set up this + association when adding a DNS record pointing the custom domain name to + this distribution name. For more information about CloudFront + distributions, see the Amazon CloudFront documentation. + """ + distribution_hosted_zone_id: str | None = ... + """ + The region-agnostic Amazon Route 53 Hosted Zone ID of the edge-optimized + endpoint. The valid value is `Z2FDTNDATAQYW2` for all the regions. For + more information, see Set up a Regional Custom Domain Name and AWS + Regions and Endpoints for API Gateway. + """ + endpoint_configuration: EndpointConfiguration | None = ... + """ + The endpoint configuration of this DomainName showing the endpoint types + and IP address types of the domain name. + """ + domain_name_status: str | None = ... + """ + The status of the DomainName migration. The valid values are `AVAILABLE` + and `UPDATING`. If the status is `UPDATING`, the domain cannot be + modified further until the existing operation is complete. If it is + `AVAILABLE`, the domain can be updated. + """ + domain_name_status_message: str | None = ... + """ + An optional text message containing detailed information about status of + the DomainName migration. + """ + security_policy: str | None = ... + """ + The Transport Layer Security (TLS) version + cipher suite for this + DomainName. + """ + endpoint_access_mode: str | None = ... + """The endpoint access mode of the DomainName.""" + tags: dict[str, str] | None = ... + """ + The collection of tags. Each tag element is associated with a given + resource. + """ + mutual_tls_authentication: MutualTlsAuthentication | None = ... + """ + The mutual TLS authentication configuration for a custom domain name. If + specified, API Gateway performs two-way authentication between the + client and the server. Clients must present a trusted certificate to + access your API. + """ + ownership_verification_certificate_arn: str | None = ... + """ + The ARN of the public certificate issued by ACM to validate ownership of + your custom domain. Only required when configuring mutual TLS and using + an ACM imported or private CA certificate ARN as the + regionalCertificateArn. + """ + management_policy: str | None = ... + """ + A stringified JSON policy document that applies to the API Gateway + Management service for this DomainName. This policy document controls + access for access association sources to create domain name access + associations with this DomainName. Supported only for private custom + domain names. + """ + policy: str | None = ... + """ + A stringified JSON policy document that applies to the `execute-api` + service for this DomainName regardless of the caller and Method + configuration. Supported only for private custom domain names. + """ + routing_mode: str | None = ... + """ + The routing mode for this domain name. The routing mode determines how + API Gateway sends traffic from your custom domain name to your private + APIs. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetDomainNamesInput(_SerdeShape): + """Request to describe a collection of DomainName resources.""" + + position: str | None = ... + """The current pagination position in the paged result set.""" + limit: int | None = ... + """ + The maximum number of returned results per page. The default value is 25 + and the maximum value is 500. + """ + resource_owner: str | None = ... + """The owner of the domain name access association.""" + +@dataclass(kw_only=True) +class GetDomainNamesOutput(_SerdeShape): + """Represents a collection of DomainName resources.""" + + items: list[DomainName] | None = ... + """The current page of elements from this collection.""" + position: str | None = ... + """The current pagination position in the paged result set.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetExportInput(_SerdeShape): + """Request a new export of a RestApi for a particular Stage.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + stage_name: str | None = ... + """The name of the Stage that will be exported.""" + export_type: str | None = ... + """ + The type of export. Acceptable values are 'oas30' for OpenAPI 3.0.x + and 'swagger' for Swagger/OpenAPI 2.0. + """ + parameters: dict[str, str] | None = ... + """ + A key-value map of query string parameters that specify properties of + the export, depending on the requested `exportType`. For `exportType` + `oas30` and `swagger`, any combination of the following parameters are + supported: `extensions='integrations'` or `extensions='apigateway'` will + export the API with x-amazon-apigateway-integration extensions. + `extensions='authorizers'` will export the API with + x-amazon-apigateway-authorizer extensions. `postman` will export the API + with Postman extensions, allowing for import to the Postman tool + """ + accepts: str | None = ... + """ + The content-type of the export, for example `application/json`. + Currently `application/json` and `application/yaml` are supported for + `exportType` of`oas30` and `swagger`. This should be specified in the + `Accept` header for direct API requests. + """ + +@dataclass(kw_only=True) +class GetExportOutput(_SerdeShape): + """The binary blob response to GetExport, which contains the generated SDK.""" + + content_type: str | None = ... + """ + The content-type header value in the HTTP response. This will correspond + to a valid 'accept' type in the request. + """ + content_disposition: str | None = ... + """The content-disposition header value in the HTTP response.""" + body: bytes | None = ... + """The binary blob response to GetExport, which contains the export.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetGatewayResponseInput(_SerdeShape): + """ + Gets a GatewayResponse of a specified response type on the given + RestApi. + """ + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + response_type: str | None = ... + """The response type of the associated GatewayResponse.""" + +@dataclass(kw_only=True) +class GetGatewayResponseOutput(_SerdeShape): + """ + A gateway response of a given response type and status code, with + optional response parameters and mapping templates. + """ + + response_type: str | None = ... + """The response type of the associated GatewayResponse.""" + status_code: str | None = ... + """The HTTP status code for this GatewayResponse.""" + response_parameters: dict[str, str] | None = ... + """ + Response parameters (paths, query strings and headers) of the + GatewayResponse as a string-to-string map of key-value pairs. + """ + response_templates: dict[str, str] | None = ... + """ + Response templates of the GatewayResponse as a string-to-string map of + key-value pairs. + """ + default_response: bool = ... + """ + A Boolean flag to indicate whether this GatewayResponse is the default + gateway response (`true`) or not (`false`). A default gateway response + is one generated by API Gateway without any customization by an API + developer. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetGatewayResponsesInput(_SerdeShape): + """ + Gets the GatewayResponses collection on the given RestApi. If an API + developer has not added any definitions for gateway responses, the + result will be the API Gateway-generated default GatewayResponses + collection for the supported response types. + """ + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + position: str | None = ... + """ + The current pagination position in the paged result set. The + GatewayResponse collection does not support pagination and the position + does not apply here. + """ + limit: int | None = ... + """ + The maximum number of returned results per page. The default value is 25 + and the maximum value is 500. The GatewayResponses collection does not + support pagination and the limit does not apply here. + """ + +@dataclass(kw_only=True) +class GetGatewayResponsesOutput(_SerdeShape): + """ + The collection of the GatewayResponse instances of a RestApi as a + `responseType`-to-GatewayResponse object map of key-value pairs. As + such, pagination is not supported for querying this collection. + """ + + items: list[GatewayResponse] | None = ... + """Returns the entire collection, because of no pagination support.""" + position: str | None = ... + """ + The current pagination position in the paged result set. The + GatewayResponse collection does not support pagination and the position + does not apply here. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetIntegrationInput(_SerdeShape): + """Represents a request to get the integration configuration.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + resource_id: str | None = ... + """Specifies a get integration request's resource identifier""" + http_method: str | None = ... + """Specifies a get integration request's HTTP method.""" + +@dataclass(kw_only=True) +class GetIntegrationOutput(_SerdeShape): + """ + Represents an `HTTP`, `HTTP_PROXY`, `AWS`, `AWS_PROXY`, or Mock + integration. + """ + + type: str | None = ... + """ + Specifies an API method integration type. The valid value is one of the + following: + + For the HTTP and HTTP proxy integrations, each integration can specify a + protocol (`http/https`), port and path. Standard 80 and 443 ports are + supported as well as custom ports above 1024. An HTTP or HTTP proxy + integration with a `connectionType` of `VPC_LINK` is referred to as a + private integration and uses a VpcLink to connect API Gateway to a + network load balancer of a VPC. + """ + http_method: str | None = ... + """ + Specifies the integration's HTTP method type. For the Type property, if + you specify `MOCK`, this property is optional. For Lambda integrations, + you must set the integration method to `POST`. For all other types, you + must specify this property. + """ + uri: str | None = ... + """ + Specifies Uniform Resource Identifier (URI) of the integration endpoint. + + For `HTTP` or `HTTP_PROXY` integrations, the URI must be a fully formed, + encoded HTTP(S) URL according to the RFC-3986 specification for standard + integrations. If `connectionType` is `VPC_LINK` specify the Network Load + Balancer DNS name. For `AWS` or `AWS_PROXY` integrations, the URI is of + the form + `arn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api}`. + Here, {Region} is the API Gateway region (e.g., us-east-1); {service} is + the name of the integrated Amazon Web Services service (e.g., s3); and + {subdomain} is a designated subdomain supported by certain Amazon Web + Services service for fast host-name lookup. action can be used for an + Amazon Web Services service action-based API, using an + Action={name}&{p1}={v1}&p2={v2}... query string. The ensuing + {service_api} refers to a supported action {name} plus any required + input parameters. Alternatively, path can be used for an Amazon Web + Services service path-based API. The ensuing service_api refers to the + path to an Amazon Web Services service resource, including the region of + the integrated Amazon Web Services service, if applicable. For example, + for integration with the S3 API of GetObject, the uri can be either + `arn:aws:apigateway:us-west-2:s3:action/GetObject&Bucket={bucket}&Key={key}` + or `arn:aws:apigateway:us-west-2:s3:path/{bucket}/{key}` + """ + connection_type: str | None = ... + """ + The type of the network connection to the integration endpoint. The + valid value is `INTERNET` for connections through the public routable + internet or `VPC_LINK` for private connections between API Gateway and a + network load balancer in a VPC. The default value is `INTERNET`. + """ + connection_id: str | None = ... + """ + The ID of the VpcLink used for the integration when + `connectionType=VPC_LINK` and undefined, otherwise. + """ + credentials: str | None = ... + """ + Specifies the credentials required for the integration, if any. For AWS + integrations, three options are available. To specify an IAM Role for + API Gateway to assume, use the role's Amazon Resource Name (ARN). To + require that the caller's identity be passed through from the request, + specify the string `arn:aws:iam::*:user/*`. To use resource-based + permissions on supported Amazon Web Services services, specify null. + """ + request_parameters: dict[str, str] | None = ... + """ + A key-value map specifying request parameters that are passed from the + method request to the back end. The key is an integration request + parameter name and the associated value is a method request parameter + value or static value that must be enclosed within single quotes and + pre-encoded as required by the back end. The method request parameter + value must match the pattern of `method.request.{location}.{name}`, + where `location` is `querystring`, `path`, or `header` and `name` must + be a valid and unique method request parameter name. + """ + request_templates: dict[str, str] | None = ... + """ + Represents a map of Velocity templates that are applied on the request + payload based on the value of the Content-Type header sent by the + client. The content type value is the key in this map, and the template + (as a String) is the value. + """ + passthrough_behavior: str | None = ... + """ + Specifies how the method request body of an unmapped content type will + be passed through the integration request to the back end without + transformation. A content type is unmapped if no mapping template is + defined in the integration or the content type does not match any of the + mapped content types, as specified in `requestTemplates`. The valid + value is one of the following: `WHEN_NO_MATCH`: passes the method + request body through the integration request to the back end without + transformation when the method request content type does not match any + content type associated with the mapping templates defined in the + integration request. `WHEN_NO_TEMPLATES`: passes the method request body + through the integration request to the back end without transformation + when no mapping template is defined in the integration request. If a + template is defined when this option is selected, the method request of + an unmapped content-type will be rejected with an HTTP 415 Unsupported + Media Type response. `NEVER`: rejects the method request with an HTTP + 415 Unsupported Media Type response when either the method request + content type does not match any content type associated with the mapping + templates defined in the integration request or no mapping template is + defined in the integration request. + """ + content_handling: str | None = ... + """ + Specifies how to handle request payload content type conversions. + Supported values are `CONVERT_TO_BINARY` and `CONVERT_TO_TEXT`, with the + following behaviors: + + If this property is not defined, the request payload will be passed + through from the method request to integration request without + modification, provided that the `passthroughBehavior` is configured to + support payload pass-through. + """ + timeout_in_millis: int = ... + """ + Custom timeout between 50 and 29,000 milliseconds. The default value is + 29,000 milliseconds or 29 seconds. You can increase the default value to + longer than 29 seconds for Regional or private APIs only. + """ + cache_namespace: str | None = ... + """ + Specifies a group of related cached parameters. By default, API Gateway + uses the resource ID as the `cacheNamespace`. You can specify the same + `cacheNamespace` across resources to return the same cached data for + requests to different resources. + """ + cache_key_parameters: list[str] | None = ... + """ + A list of request parameters whose values API Gateway caches. To be + valid values for `cacheKeyParameters`, these parameters must also be + specified for Method `requestParameters`. + """ + integration_responses: dict[str, IntegrationResponse] | None = ... + """Specifies the integration's responses.""" + tls_config: TlsConfig | None = ... + """Specifies the TLS configuration for an integration.""" + response_transfer_mode: str | None = ... + """The response transfer mode of the integration.""" + integration_target: str | None = ... + """The ALB or NLB listener to send the request to.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetIntegrationResponseInput(_SerdeShape): + """Represents a get integration response request.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + resource_id: str | None = ... + """Specifies a get integration response request's resource identifier.""" + http_method: str | None = ... + """Specifies a get integration response request's HTTP method.""" + status_code: str | None = ... + """Specifies a get integration response request's status code.""" + +@dataclass(kw_only=True) +class GetIntegrationResponseOutput(_SerdeShape): + """ + Represents an integration response. The status code must map to an + existing MethodResponse, and parameters and templates can be used to + transform the back-end response. + """ + + status_code: str | None = ... + """ + Specifies the status code that is used to map the integration response + to an existing MethodResponse. + """ + selection_pattern: str | None = ... + """ + Specifies the regular expression (regex) pattern used to choose an + integration response based on the response from the back end. For + example, if the success response returns nothing and the error response + returns some string, you could use the `.+` regex to match error + response. However, make sure that the error response does not contain + any newline (`\n`) character in such cases. If the back end is an Lambda + function, the Lambda function error header is matched. For all other + HTTP and Amazon Web Services back ends, the HTTP status code is matched. + """ + response_parameters: dict[str, str] | None = ... + """ + A key-value map specifying response parameters that are passed to the + method response from the back end. The key is a method response header + parameter name and the mapped value is an integration response header + value, a static value enclosed within a pair of single quotes, or a JSON + expression from the integration response body. The mapping key must + match the pattern of `method.response.header.{name}`, where `name` is a + valid and unique header name. The mapped non-static value must match the + pattern of `integration.response.header.{name}` or + `integration.response.body.{JSON-expression}`, where `name` is a valid + and unique response header name and `JSON-expression` is a valid JSON + expression without the `$` prefix. + """ + response_templates: dict[str, str] | None = ... + """ + Specifies the templates used to transform the integration response body. + Response templates are represented as a key/value map, with a + content-type as the key and a template as the value. + """ + content_handling: str | None = ... + """ + Specifies how to handle response payload content type conversions. + Supported values are `CONVERT_TO_BINARY` and `CONVERT_TO_TEXT`, with the + following behaviors: + + If this property is not defined, the response payload will be passed + through from the integration response to the method response without + modification. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetMethodInput(_SerdeShape): + """Request to describe an existing Method resource.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + resource_id: str | None = ... + """The Resource identifier for the Method resource.""" + http_method: str | None = ... + """Specifies the method request's HTTP method type.""" + +@dataclass(kw_only=True) +class GetMethodOutput(_SerdeShape): + """ + Represents a client-facing interface by which the client calls the API + to access back-end resources. A Method resource is integrated with an + Integration resource. Both consist of a request and one or more + responses. The method request takes the client input that is passed to + the back end through the integration request. A method response returns + the output from the back end to the client through an integration + response. A method request is embodied in a Method resource, whereas an + integration request is embodied in an Integration resource. On the other + hand, a method response is represented by a MethodResponse resource, + whereas an integration response is represented by an IntegrationResponse + resource. + """ + + http_method: str | None = ... + """The method's HTTP verb.""" + authorization_type: str | None = ... + """ + The method's authorization type. Valid values are `NONE` for open + access, `AWS_IAM` for using AWS IAM permissions, `CUSTOM` for using a + custom authorizer, or `COGNITO_USER_POOLS` for using a Cognito user + pool. + """ + authorizer_id: str | None = ... + """ + The identifier of an Authorizer to use on this method. The + `authorizationType` must be `CUSTOM`. + """ + api_key_required: bool | None = ... + """ + A boolean flag specifying whether a valid ApiKey is required to invoke + this method. + """ + request_validator_id: str | None = ... + """The identifier of a RequestValidator for request validation.""" + operation_name: str | None = ... + """ + A human-friendly operation identifier for the method. For example, you + can assign the `operationName` of `ListPets` for the `GET /pets` method + in the `PetStore` example. + """ + request_parameters: dict[str, bool] | None = ... + """ + A key-value map defining required or optional method request parameters + that can be accepted by API Gateway. A key is a method request parameter + name matching the pattern of `method.request.{location}.{name}`, where + `location` is `querystring`, `path`, or `header` and `name` is a valid + and unique parameter name. The value associated with the key is a + Boolean flag indicating whether the parameter is required (`true`) or + optional (`false`). The method request parameter names defined here are + available in Integration to be mapped to integration request parameters + or templates. + """ + request_models: dict[str, str] | None = ... + """ + A key-value map specifying data schemas, represented by Model resources, + (as the mapped value) of the request payloads of given content types (as + the mapping key). + """ + method_responses: dict[str, MethodResponse] | None = ... + """Gets a method response associated with a given HTTP status code.""" + method_integration: Integration | None = ... + """ + Gets the method's integration responsible for passing the + client-submitted request to the back end and performing necessary + transformations to make the request compliant with the back end. + """ + authorization_scopes: list[str] | None = ... + """ + A list of authorization scopes configured on the method. The scopes are + used with a `COGNITO_USER_POOLS` authorizer to authorize the method + invocation. The authorization works by matching the method scopes + against the scopes parsed from the access token in the incoming request. + The method invocation is authorized if any method scopes matches a + claimed scope in the access token. Otherwise, the invocation is not + authorized. When the method scope is configured, the client must provide + an access token instead of an identity token for authorization purposes. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetMethodResponseInput(_SerdeShape): + """Request to describe a MethodResponse resource.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + resource_id: str | None = ... + """The Resource identifier for the MethodResponse resource.""" + http_method: str | None = ... + """The HTTP verb of the Method resource.""" + status_code: str | None = ... + """The status code for the MethodResponse resource.""" + +@dataclass(kw_only=True) +class GetMethodResponseOutput(_SerdeShape): + """ + Represents a method response of a given HTTP status code returned to the + client. The method response is passed from the back end through the + associated integration response that can be transformed using a mapping + template. + """ + + status_code: str | None = ... + """The method response's status code.""" + response_parameters: dict[str, bool] | None = ... + """ + A key-value map specifying required or optional response parameters that + API Gateway can send back to the caller. A key defines a method response + header and the value specifies whether the associated method response + header is required or not. The expression of the key must match the + pattern `method.response.header.{name}`, where `name` is a valid and + unique header name. API Gateway passes certain integration response data + to the method response headers specified here according to the mapping + you prescribe in the API's IntegrationResponse. The integration + response data that can be mapped include an integration response header + expressed in `integration.response.header.{name}`, a static value + enclosed within a pair of single quotes (e.g., `'application/json'`), or + a JSON expression from the back-end response payload in the form of + `integration.response.body.{JSON-expression}`, where `JSON-expression` + is a valid JSON expression without the `$` prefix.) + """ + response_models: dict[str, str] | None = ... + """ + Specifies the Model resources used for the response's content-type. + Response models are represented as a key/value map, with a content-type + as the key and a Model name as the value. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetModelInput(_SerdeShape): + """ + Request to list information about a model in an existing RestApi + resource. + """ + + rest_api_id: str | None = ... + """The RestApi identifier under which the Model exists.""" + model_name: str | None = ... + """The name of the model as an identifier.""" + flatten: bool = ... + """ + A query parameter of a Boolean value to resolve (`true`) all external + model references and returns a flattened model schema or not (`false`) + The default is `false`. + """ + +@dataclass(kw_only=True) +class GetModelOutput(_SerdeShape): + """ + Represents the data structure of a method's request or response + payload. + """ + + id: str | None = ... + """The identifier for the model resource.""" + name: str | None = ... + """The name of the model. Must be an alphanumeric string.""" + description: str | None = ... + """The description of the model.""" + schema: str | None = ... + """ + The schema for the model. For `application/json` models, this should be + JSON schema draft 4 model. Do not include \"\\*/\" characters in the + description of any properties because such \"\\*/\" characters may be + interpreted as the closing marker for comments in some languages, such + as Java or JavaScript, causing the installation of your API's SDK + generated by API Gateway to fail. + """ + content_type: str | None = ... + """The content-type for the model.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetModelsInput(_SerdeShape): + """Request to list existing Models defined for a RestApi resource.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + position: str | None = ... + """The current pagination position in the paged result set.""" + limit: int | None = ... + """ + The maximum number of returned results per page. The default value is 25 + and the maximum value is 500. + """ + +@dataclass(kw_only=True) +class GetModelsOutput(_SerdeShape): + """Represents a collection of Model resources.""" + + items: list[Model] | None = ... + """The current page of elements from this collection.""" + position: str | None = ... + """The current pagination position in the paged result set.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetModelTemplateInput(_SerdeShape): + """ + Request to generate a sample mapping template used to transform the + payload. + """ + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + model_name: str | None = ... + """The name of the model for which to generate a template.""" + +@dataclass(kw_only=True) +class GetModelTemplateOutput(_SerdeShape): + """Represents a mapping template used to transform a payload.""" + + value: str | None = ... + """ + The Apache Velocity Template Language (VTL) template content used for + the template resource. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetRequestValidatorInput(_SerdeShape): + """Gets a RequestValidator of a given RestApi.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + request_validator_id: str | None = ... + """The identifier of the RequestValidator to be retrieved.""" + +@dataclass(kw_only=True) +class GetRequestValidatorOutput(_SerdeShape): + """A set of validation rules for incoming Method requests.""" + + id: str | None = ... + """The identifier of this RequestValidator.""" + name: str | None = ... + """The name of this RequestValidator""" + validate_request_body: bool = ... + """ + A Boolean flag to indicate whether to validate a request body according + to the configured Model schema. + """ + validate_request_parameters: bool = ... + """ + A Boolean flag to indicate whether to validate request parameters + (`true`) or not (`false`). + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetRequestValidatorsInput(_SerdeShape): + """Gets the RequestValidators collection of a given RestApi.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + position: str | None = ... + """The current pagination position in the paged result set.""" + limit: int | None = ... + """ + The maximum number of returned results per page. The default value is 25 + and the maximum value is 500. + """ + +@dataclass(kw_only=True) +class GetRequestValidatorsOutput(_SerdeShape): + """A collection of RequestValidator resources of a given RestApi.""" + + items: list[RequestValidator] | None = ... + """The current page of elements from this collection.""" + position: str | None = ... + """The current pagination position in the paged result set.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetResourceInput(_SerdeShape): + """Request to list information about a resource.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + resource_id: str | None = ... + """The identifier for the Resource resource.""" + embed: list[str] | None = ... + """ + A query parameter to retrieve the specified resources embedded in the + returned Resource representation in the response. This `embed` parameter + value is a list of comma-separated strings. Currently, the request + supports only retrieval of the embedded Method resources this way. The + query parameter value must be a single-valued list and contain the + `"methods"` string. For example, + `GET /restapis/{restapi_id}/resources/{resource_id}?embed=methods`. + """ + +@dataclass(kw_only=True) +class GetResourceOutput(_SerdeShape): + """Represents an API resource.""" + + id: str | None = ... + """The resource's identifier.""" + parent_id: str | None = ... + """The parent resource's identifier.""" + path_part: str | None = ... + """The last path segment for this resource.""" + path: str | None = ... + """The full path for this resource.""" + resource_methods: dict[str, Method] | None = ... + """Gets an API resource's method of a given HTTP verb.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetResourcesInput(_SerdeShape): + """Request to list information about a collection of resources.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + position: str | None = ... + """The current pagination position in the paged result set.""" + limit: int | None = ... + """ + The maximum number of returned results per page. The default value is 25 + and the maximum value is 500. + """ + embed: list[str] | None = ... + """ + A query parameter used to retrieve the specified resources embedded in + the returned Resources resource in the response. This `embed` parameter + value is a list of comma-separated strings. Currently, the request + supports only retrieval of the embedded Method resources this way. The + query parameter value must be a single-valued list and contain the + `"methods"` string. For example, + `GET /restapis/{restapi_id}/resources?embed=methods`. + """ + +@dataclass(kw_only=True) +class GetResourcesOutput(_SerdeShape): + """Represents a collection of Resource resources.""" + + items: list[Resource] | None = ... + """The current page of elements from this collection.""" + position: str | None = ... + """The current pagination position in the paged result set.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetRestApiInput(_SerdeShape): + """The GET request to list an existing RestApi defined for your collection.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + +@dataclass(kw_only=True) +class GetRestApiOutput(_SerdeShape): + """Represents a REST API.""" + + id: str | None = ... + """ + The API's identifier. This identifier is unique across all of your APIs + in API Gateway. + """ + name: str | None = ... + """The API's name.""" + description: str | None = ... + """The API's description.""" + created_date: datetime | None = ... + """The timestamp when the API was created.""" + version: str | None = ... + """A version identifier for the API.""" + warnings: list[str] | None = ... + """ + The warning messages reported when `failonwarnings` is turned on during + API import. + """ + binary_media_types: list[str] | None = ... + """ + The list of binary media types supported by the RestApi. By default, the + RestApi supports only UTF-8-encoded text payloads. + """ + minimum_compression_size: int | None = ... + """ + A nullable integer that is used to enable compression (with non-negative + between 0 and 10485760 (10M) bytes, inclusive) or disable compression + (with a null value) on an API. When compression is enabled, compression + or decompression is not applied on the payload if the payload size is + smaller than this value. Setting it to zero allows compression for any + payload size. + """ + api_key_source: str | None = ... + """ + The source of the API key for metering requests according to a usage + plan. Valid values are: >`HEADER` to read the API key from the + `X-API-Key` header of a request. `AUTHORIZER` to read the API key from + the `UsageIdentifierKey` from a custom authorizer. + """ + endpoint_configuration: EndpointConfiguration | None = ... + """ + The endpoint configuration of this RestApi showing the endpoint types + and IP address types of the API. + """ + policy: str | None = ... + """ + A stringified JSON policy document that applies to this RestApi + regardless of the caller and Method configuration. + """ + tags: dict[str, str] | None = ... + """ + The collection of tags. Each tag element is associated with a given + resource. + """ + disable_execute_api_endpoint: bool = ... + """ + Specifies whether clients can invoke your API by using the default + `execute-api` endpoint. By default, clients can invoke your API with the + default `https://{api_id}.execute-api.{region}.amazonaws.com` endpoint. + To require that clients use a custom domain name to invoke your API, + disable the default endpoint. + """ + root_resource_id: str | None = ... + """The API's root resource ID.""" + security_policy: str | None = ... + """ + The Transport Layer Security (TLS) version + cipher suite for this + RestApi. + """ + endpoint_access_mode: str | None = ... + """The endpoint access mode of the RestApi.""" + api_status: str | None = ... + """The ApiStatus of the RestApi.""" + api_status_message: str | None = ... + """ + The status message of the RestApi. When the status message is `UPDATING` + you can still invoke it. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetRestApisInput(_SerdeShape): + """The GET request to list existing RestApis defined for your collection.""" + + position: str | None = ... + """The current pagination position in the paged result set.""" + limit: int | None = ... + """ + The maximum number of returned results per page. The default value is 25 + and the maximum value is 500. + """ + +@dataclass(kw_only=True) +class GetRestApisOutput(_SerdeShape): + """ + Contains references to your APIs and links that guide you in how to + interact with your collection. A collection offers a paginated view of + your APIs. + """ + + items: list[RestApi] | None = ... + """The current page of elements from this collection.""" + position: str | None = ... + """The current pagination position in the paged result set.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetSdkInput(_SerdeShape): + """Request a new generated client SDK for a RestApi and Stage.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + stage_name: str | None = ... + """The name of the Stage that the SDK will use.""" + sdk_type: str | None = ... + """ + The language for the generated SDK. Currently `java`, `javascript`, + `android`, `objectivec` (for iOS), `swift` (for iOS), and `ruby` are + supported. + """ + parameters: dict[str, str] | None = ... + """ + A string-to-string key-value map of query parameters `sdkType`-dependent + properties of the SDK. For `sdkType` of `objectivec` or `swift`, a + parameter named `classPrefix` is required. For `sdkType` of `android`, + parameters named `groupId`, `artifactId`, `artifactVersion`, and + `invokerPackage` are required. For `sdkType` of `java`, parameters named + `serviceName` and `javaPackageName` are required. + """ + +@dataclass(kw_only=True) +class GetSdkOutput(_SerdeShape): + """The binary blob response to GetSdk, which contains the generated SDK.""" + + content_type: str | None = ... + """The content-type header value in the HTTP response.""" + content_disposition: str | None = ... + """The content-disposition header value in the HTTP response.""" + body: bytes | None = ... + """The binary blob response to GetSdk, which contains the generated SDK.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetSdkTypeInput(_SerdeShape): + """Get an SdkType instance.""" + + id: str | None = ... + """The identifier of the queried SdkType instance.""" + +@dataclass(kw_only=True) +class GetSdkTypeOutput(_SerdeShape): + """A type of SDK that API Gateway can generate.""" + + id: str | None = ... + """The identifier of an SdkType instance.""" + friendly_name: str | None = ... + """The user-friendly name of an SdkType instance.""" + description: str | None = ... + """The description of an SdkType.""" + configuration_properties: list[SdkConfigurationProperty] | None = ... + """A list of configuration properties of an SdkType.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetSdkTypesInput(_SerdeShape): + """Get the SdkTypes collection.""" + + position: str | None = ... + """The current pagination position in the paged result set.""" + limit: int | None = ... + """ + The maximum number of returned results per page. The default value is 25 + and the maximum value is 500. + """ + +@dataclass(kw_only=True) +class GetSdkTypesOutput(_SerdeShape): + """The collection of SdkType instances.""" + + items: list[SdkType] | None = ... + """The current page of elements from this collection.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetStageInput(_SerdeShape): + """Requests API Gateway to get information about a Stage resource.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + stage_name: str | None = ... + """The name of the Stage resource to get information about.""" + +@dataclass(kw_only=True) +class GetStageOutput(_SerdeShape): + """ + Represents a unique identifier for a version of a deployed RestApi that + is callable by users. + """ + + deployment_id: str | None = ... + """The identifier of the Deployment that the stage points to.""" + client_certificate_id: str | None = ... + """The identifier of a client certificate for an API stage.""" + stage_name: str | None = ... + """ + The name of the stage is the first path segment in the Uniform Resource + Identifier (URI) of a call to API Gateway. Stage names can only contain + alphanumeric characters, hyphens, and underscores. Maximum length is 128 + characters. + """ + description: str | None = ... + """The stage's description.""" + cache_cluster_enabled: bool = ... + """ + Specifies whether a cache cluster is enabled for the stage. To activate + a method-level cache, set `CachingEnabled` to `true` for a method. + """ + cache_cluster_size: str | None = ... + """ + The stage's cache capacity in GB. For more information about choosing a + cache size, see [Enabling API caching to enhance + responsiveness](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html). + """ + cache_cluster_status: str | None = ... + """The status of the cache cluster for the stage, if enabled.""" + method_settings: dict[str, MethodSetting] | None = ... + """ + A map that defines the method settings for a Stage resource. Keys + (designated as `/{method_setting_key` below) are method paths defined as + `{resource_path}/{http_method}` for an individual method override, or + `/*/*` for overriding all methods in the stage. + """ + variables: dict[str, str] | None = ... + """ + A map that defines the stage variables for a Stage resource. Variable + names can have alphanumeric and underscore characters, and the values + must match `[A-Za-z0-9-._~:/?#&=,]+`. + """ + documentation_version: str | None = ... + """The version of the associated API documentation.""" + access_log_settings: AccessLogSettings | None = ... + """Settings for logging access in this stage.""" + canary_settings: CanarySettings | None = ... + """Settings for the canary deployment in this stage.""" + tracing_enabled: bool = ... + """Specifies whether active tracing with X-ray is enabled for the Stage.""" + web_acl_arn: str | None = ... + """The ARN of the WebAcl associated with the Stage.""" + tags: dict[str, str] | None = ... + """ + The collection of tags. Each tag element is associated with a given + resource. + """ + created_date: datetime | None = ... + """The timestamp when the stage was created.""" + last_updated_date: datetime | None = ... + """The timestamp when the stage last updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetStagesInput(_SerdeShape): + """ + Requests API Gateway to get information about one or more Stage + resources. + """ + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + deployment_id: str | None = ... + """The stages' deployment identifiers.""" + +@dataclass(kw_only=True) +class GetStagesOutput(_SerdeShape): + """A list of Stage resources that are associated with the ApiKey resource.""" + + item: list[Stage] | None = ... + """The current page of elements from this collection.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetTagsInput(_SerdeShape): + """Gets the Tags collection for a given resource.""" + + resource_arn: str | None = ... + """The ARN of a resource that can be tagged.""" + position: str | None = ... + """ + (Not currently supported) The current pagination position in the paged + result set. + """ + limit: int | None = ... + """ + (Not currently supported) The maximum number of returned results per + page. The default value is 25 and the maximum value is 500. + """ + +@dataclass(kw_only=True) +class GetTagsOutput(_SerdeShape): + """ + The collection of tags. Each tag element is associated with a given + resource. + """ + + tags: dict[str, str] | None = ... + """ + The collection of tags. Each tag element is associated with a given + resource. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetUsageInput(_SerdeShape): + """ + The GET request to get the usage data of a usage plan in a specified + time interval. + """ + + usage_plan_id: str | None = ... + """The Id of the usage plan associated with the usage data.""" + key_id: str | None = ... + """The Id of the API key associated with the resultant usage data.""" + start_date: str | None = ... + """The starting date (e.g., 2016-01-01) of the usage data.""" + end_date: str | None = ... + """The ending date (e.g., 2016-12-31) of the usage data.""" + position: str | None = ... + """The current pagination position in the paged result set.""" + limit: int | None = ... + """ + The maximum number of returned results per page. The default value is 25 + and the maximum value is 500. + """ + +@dataclass(kw_only=True) +class GetUsageOutput(_SerdeShape): + """Represents the usage data of a usage plan.""" + + usage_plan_id: str | None = ... + """The plan Id associated with this usage data.""" + start_date: str | None = ... + """The starting date of the usage data.""" + end_date: str | None = ... + """The ending date of the usage data.""" + items: dict[str, list[list[int]]] | None = ... + """ + The usage data, as daily logs of used and remaining quotas, over the + specified time interval indexed over the API keys in a usage plan. For + example, + `{..., "values" : { "{api_key}" : [ [0, 100], [10, 90], [100, 10]]}`, + where `{api_key}` stands for an API key value and the daily log entry is + of the format `[used quota, remaining quota]`. + """ + position: str | None = ... + """The current pagination position in the paged result set.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetUsagePlanInput(_SerdeShape): + """The GET request to get a usage plan of a given plan identifier.""" + + usage_plan_id: str | None = ... + """The identifier of the UsagePlan resource to be retrieved.""" + +@dataclass(kw_only=True) +class GetUsagePlanKeyInput(_SerdeShape): + """The GET request to get a usage plan key of a given key identifier.""" + + usage_plan_id: str | None = ... + """ + The Id of the UsagePlan resource representing the usage plan containing + the to-be-retrieved UsagePlanKey resource representing a plan customer. + """ + key_id: str | None = ... + """ + The key Id of the to-be-retrieved UsagePlanKey resource representing a + plan customer. + """ + +@dataclass(kw_only=True) +class GetUsagePlanKeyOutput(_SerdeShape): + """Represents a usage plan key to identify a plan customer.""" + + id: str | None = ... + """The Id of a usage plan key.""" + type: str | None = ... + """ + The type of a usage plan key. Currently, the valid key type is + `API_KEY`. + """ + value: str | None = ... + """The value of a usage plan key.""" + name: str | None = ... + """The name of a usage plan key.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetUsagePlanKeysInput(_SerdeShape): + """ + The GET request to get all the usage plan keys representing the API keys + added to a specified usage plan. + """ + + usage_plan_id: str | None = ... + """ + The Id of the UsagePlan resource representing the usage plan containing + the to-be-retrieved UsagePlanKey resource representing a plan customer. + """ + position: str | None = ... + """The current pagination position in the paged result set.""" + limit: int | None = ... + """ + The maximum number of returned results per page. The default value is 25 + and the maximum value is 500. + """ + name_query: str | None = ... + """ + A query parameter specifying the name of the to-be-returned usage plan + keys. + """ + +@dataclass(kw_only=True) +class GetUsagePlanKeysOutput(_SerdeShape): + """ + Represents the collection of usage plan keys added to usage plans for + the associated API keys and, possibly, other types of keys. + """ + + items: list[UsagePlanKey] | None = ... + """The current page of elements from this collection.""" + position: str | None = ... + """The current pagination position in the paged result set.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetUsagePlanOutput(_SerdeShape): + """ + Represents a usage plan used to specify who can assess associated API + stages. Optionally, target request rate and quota limits can be set. In + some cases clients can exceed the targets that you set. Don't rely on + usage plans to control costs. Consider using [Amazon Web Services + Budgets](https://docs.aws.amazon.com/cost-management/latest/userguide/budgets-managing-costs.html) + to monitor costs and + [WAF](https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html) + to manage API requests. + """ + + id: str | None = ... + """The identifier of a UsagePlan resource.""" + name: str | None = ... + """The name of a usage plan.""" + description: str | None = ... + """The description of a usage plan.""" + api_stages: list[ApiStage] | None = ... + """The associated API stages of a usage plan.""" + throttle: ThrottleSettings | None = ... + """ + A map containing method level throttling information for API stage in a + usage plan. + """ + quota: QuotaSettings | None = ... + """ + The target maximum number of permitted requests per a given unit time + interval. + """ + product_code: str | None = ... + """ + The Amazon Web Services Marketplace product identifier to associate with + the usage plan as a SaaS product on the Amazon Web Services Marketplace. + """ + tags: dict[str, str] | None = ... + """ + The collection of tags. Each tag element is associated with a given + resource. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetUsagePlansInput(_SerdeShape): + """The GET request to get all the usage plans of the caller's account.""" + + position: str | None = ... + """The current pagination position in the paged result set.""" + key_id: str | None = ... + """The identifier of the API key associated with the usage plans.""" + limit: int | None = ... + """ + The maximum number of returned results per page. The default value is 25 + and the maximum value is 500. + """ + +@dataclass(kw_only=True) +class GetUsagePlansOutput(_SerdeShape): + """Represents a collection of usage plans for an AWS account.""" + + items: list[UsagePlan] | None = ... + """The current page of elements from this collection.""" + position: str | None = ... + """The current pagination position in the paged result set.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetVpcLinkInput(_SerdeShape): + """Gets a specified VPC link under the caller's account in a region.""" + + vpc_link_id: str | None = ... + """ + The identifier of the VpcLink. It is used in an Integration to reference + this VpcLink. + """ + +@dataclass(kw_only=True) +class GetVpcLinkOutput(_SerdeShape): + """ + An API Gateway VPC link for a RestApi to access resources in an Amazon + Virtual Private Cloud (VPC). + """ + + id: str | None = ... + """ + The identifier of the VpcLink. It is used in an Integration to reference + this VpcLink. + """ + name: str | None = ... + """The name used to label and identify the VPC link.""" + description: str | None = ... + """The description of the VPC link.""" + target_arns: list[str] | None = ... + """ + The ARN of the network load balancer of the VPC targeted by the VPC + link. The network load balancer must be owned by the same Amazon Web + Services account of the API owner. + """ + status: str | None = ... + """ + The status of the VPC link. The valid values are `AVAILABLE`, `PENDING`, + `DELETING`, or `FAILED`. Deploying an API will wait if the status is + `PENDING` and will fail if the status is `DELETING`. + """ + status_message: str | None = ... + """A description about the VPC link status.""" + tags: dict[str, str] | None = ... + """ + The collection of tags. Each tag element is associated with a given + resource. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetVpcLinksInput(_SerdeShape): + """ + Gets the VpcLinks collection under the caller's account in a selected + region. + """ + + position: str | None = ... + """The current pagination position in the paged result set.""" + limit: int | None = ... + """ + The maximum number of returned results per page. The default value is 25 + and the maximum value is 500. + """ + +@dataclass(kw_only=True) +class GetVpcLinksOutput(_SerdeShape): + """The collection of VPC links under the caller's account in a region.""" + + items: list[VpcLink] | None = ... + """The current page of elements from this collection.""" + position: str | None = ... + """The current pagination position in the paged result set.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ImportApiKeysInput(_SerdeShape): + """ + The POST request to import API keys from an external source, such as a + CSV-formatted file. + """ + + body: bytes | None = ... + """ + The payload of the POST request to import API keys. For the payload + format, see API Key File Format. + """ + format: str | None = ... + """ + A query parameter to specify the input format to imported API keys. + Currently, only the `csv` format is supported. + """ + fail_on_warnings: bool = ... + """ + A query parameter to indicate whether to rollback ApiKey importation + (`true`) or not (`false`) when error is encountered. + """ + +@dataclass(kw_only=True) +class ImportApiKeysOutput(_SerdeShape): + """The identifier of an ApiKey used in a UsagePlan.""" + + ids: list[str] | None = ... + """A list of all the ApiKey identifiers.""" + warnings: list[str] | None = ... + """A list of warning messages.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ImportDocumentationPartsInput(_SerdeShape): + """ + Import documentation parts from an external (e.g., OpenAPI) definition + file. + """ + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + mode: str | None = ... + """ + A query parameter to indicate whether to overwrite (`overwrite`) any + existing DocumentationParts definition or to merge (`merge`) the new + definition into the existing one. The default value is `merge`. + """ + fail_on_warnings: bool = ... + """ + A query parameter to specify whether to rollback the documentation + importation (`true`) or not (`false`) when a warning is encountered. The + default value is `false`. + """ + body: bytes | None = ... + """ + Raw byte array representing the to-be-imported documentation parts. To + import from an OpenAPI file, this is a JSON object. + """ + +@dataclass(kw_only=True) +class ImportDocumentationPartsOutput(_SerdeShape): + """A collection of the imported DocumentationPart identifiers.""" + + ids: list[str] | None = ... + """A list of the returned documentation part identifiers.""" + warnings: list[str] | None = ... + """ + A list of warning messages reported during import of documentation + parts. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ImportRestApiInput(_SerdeShape): + """ + A POST request to import an API to API Gateway using an input of an API + definition file. + """ + + fail_on_warnings: bool = ... + """ + A query parameter to indicate whether to rollback the API creation + (`true`) or not (`false`) when a warning is encountered. The default + value is `false`. + """ + parameters: dict[str, str] | None = ... + """ + A key-value map of context-specific query string parameters specifying + the behavior of different API importing operations. The following shows + operation-specific parameters and their supported values. + + To exclude DocumentationParts from the import, set `parameters` as + `ignore=documentation`. + + To configure the endpoint type, set `parameters` as + `endpointConfigurationTypes=EDGE`, + `endpointConfigurationTypes=REGIONAL`, or + `endpointConfigurationTypes=PRIVATE`. The default endpoint type is + `EDGE`. + + To handle imported `basepath`, set `parameters` as `basepath=ignore`, + `basepath=prepend` or `basepath=split`. + """ + body: bytes | None = ... + """ + The POST request body containing external API definitions. Currently, + only OpenAPI definition JSON/YAML files are supported. The maximum size + of the API definition file is 6MB. + """ + +@dataclass(kw_only=True) +class ImportRestApiOutput(_SerdeShape): + """Represents a REST API.""" + + id: str | None = ... + """ + The API's identifier. This identifier is unique across all of your APIs + in API Gateway. + """ + name: str | None = ... + """The API's name.""" + description: str | None = ... + """The API's description.""" + created_date: datetime | None = ... + """The timestamp when the API was created.""" + version: str | None = ... + """A version identifier for the API.""" + warnings: list[str] | None = ... + """ + The warning messages reported when `failonwarnings` is turned on during + API import. + """ + binary_media_types: list[str] | None = ... + """ + The list of binary media types supported by the RestApi. By default, the + RestApi supports only UTF-8-encoded text payloads. + """ + minimum_compression_size: int | None = ... + """ + A nullable integer that is used to enable compression (with non-negative + between 0 and 10485760 (10M) bytes, inclusive) or disable compression + (with a null value) on an API. When compression is enabled, compression + or decompression is not applied on the payload if the payload size is + smaller than this value. Setting it to zero allows compression for any + payload size. + """ + api_key_source: str | None = ... + """ + The source of the API key for metering requests according to a usage + plan. Valid values are: >`HEADER` to read the API key from the + `X-API-Key` header of a request. `AUTHORIZER` to read the API key from + the `UsageIdentifierKey` from a custom authorizer. + """ + endpoint_configuration: EndpointConfiguration | None = ... + """ + The endpoint configuration of this RestApi showing the endpoint types + and IP address types of the API. + """ + policy: str | None = ... + """ + A stringified JSON policy document that applies to this RestApi + regardless of the caller and Method configuration. + """ + tags: dict[str, str] | None = ... + """ + The collection of tags. Each tag element is associated with a given + resource. + """ + disable_execute_api_endpoint: bool = ... + """ + Specifies whether clients can invoke your API by using the default + `execute-api` endpoint. By default, clients can invoke your API with the + default `https://{api_id}.execute-api.{region}.amazonaws.com` endpoint. + To require that clients use a custom domain name to invoke your API, + disable the default endpoint. + """ + root_resource_id: str | None = ... + """The API's root resource ID.""" + security_policy: str | None = ... + """ + The Transport Layer Security (TLS) version + cipher suite for this + RestApi. + """ + endpoint_access_mode: str | None = ... + """The endpoint access mode of the RestApi.""" + api_status: str | None = ... + """The ApiStatus of the RestApi.""" + api_status_message: str | None = ... + """ + The status message of the RestApi. When the status message is `UPDATING` + you can still invoke it. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class Integration(_SerdeShape): + """ + Represents an `HTTP`, `HTTP_PROXY`, `AWS`, `AWS_PROXY`, or Mock + integration. + """ + + type: str | None = ... + """ + Specifies an API method integration type. The valid value is one of the + following: + + For the HTTP and HTTP proxy integrations, each integration can specify a + protocol (`http/https`), port and path. Standard 80 and 443 ports are + supported as well as custom ports above 1024. An HTTP or HTTP proxy + integration with a `connectionType` of `VPC_LINK` is referred to as a + private integration and uses a VpcLink to connect API Gateway to a + network load balancer of a VPC. + """ + http_method: str | None = ... + """ + Specifies the integration's HTTP method type. For the Type property, if + you specify `MOCK`, this property is optional. For Lambda integrations, + you must set the integration method to `POST`. For all other types, you + must specify this property. + """ + uri: str | None = ... + """ + Specifies Uniform Resource Identifier (URI) of the integration endpoint. + + For `HTTP` or `HTTP_PROXY` integrations, the URI must be a fully formed, + encoded HTTP(S) URL according to the RFC-3986 specification for standard + integrations. If `connectionType` is `VPC_LINK` specify the Network Load + Balancer DNS name. For `AWS` or `AWS_PROXY` integrations, the URI is of + the form + `arn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api}`. + Here, {Region} is the API Gateway region (e.g., us-east-1); {service} is + the name of the integrated Amazon Web Services service (e.g., s3); and + {subdomain} is a designated subdomain supported by certain Amazon Web + Services service for fast host-name lookup. action can be used for an + Amazon Web Services service action-based API, using an + Action={name}&{p1}={v1}&p2={v2}... query string. The ensuing + {service_api} refers to a supported action {name} plus any required + input parameters. Alternatively, path can be used for an Amazon Web + Services service path-based API. The ensuing service_api refers to the + path to an Amazon Web Services service resource, including the region of + the integrated Amazon Web Services service, if applicable. For example, + for integration with the S3 API of GetObject, the uri can be either + `arn:aws:apigateway:us-west-2:s3:action/GetObject&Bucket={bucket}&Key={key}` + or `arn:aws:apigateway:us-west-2:s3:path/{bucket}/{key}` + """ + connection_type: str | None = ... + """ + The type of the network connection to the integration endpoint. The + valid value is `INTERNET` for connections through the public routable + internet or `VPC_LINK` for private connections between API Gateway and a + network load balancer in a VPC. The default value is `INTERNET`. + """ + connection_id: str | None = ... + """ + The ID of the VpcLink used for the integration when + `connectionType=VPC_LINK` and undefined, otherwise. + """ + credentials: str | None = ... + """ + Specifies the credentials required for the integration, if any. For AWS + integrations, three options are available. To specify an IAM Role for + API Gateway to assume, use the role's Amazon Resource Name (ARN). To + require that the caller's identity be passed through from the request, + specify the string `arn:aws:iam::*:user/*`. To use resource-based + permissions on supported Amazon Web Services services, specify null. + """ + request_parameters: dict[str, str] | None = ... + """ + A key-value map specifying request parameters that are passed from the + method request to the back end. The key is an integration request + parameter name and the associated value is a method request parameter + value or static value that must be enclosed within single quotes and + pre-encoded as required by the back end. The method request parameter + value must match the pattern of `method.request.{location}.{name}`, + where `location` is `querystring`, `path`, or `header` and `name` must + be a valid and unique method request parameter name. + """ + request_templates: dict[str, str] | None = ... + """ + Represents a map of Velocity templates that are applied on the request + payload based on the value of the Content-Type header sent by the + client. The content type value is the key in this map, and the template + (as a String) is the value. + """ + passthrough_behavior: str | None = ... + """ + Specifies how the method request body of an unmapped content type will + be passed through the integration request to the back end without + transformation. A content type is unmapped if no mapping template is + defined in the integration or the content type does not match any of the + mapped content types, as specified in `requestTemplates`. The valid + value is one of the following: `WHEN_NO_MATCH`: passes the method + request body through the integration request to the back end without + transformation when the method request content type does not match any + content type associated with the mapping templates defined in the + integration request. `WHEN_NO_TEMPLATES`: passes the method request body + through the integration request to the back end without transformation + when no mapping template is defined in the integration request. If a + template is defined when this option is selected, the method request of + an unmapped content-type will be rejected with an HTTP 415 Unsupported + Media Type response. `NEVER`: rejects the method request with an HTTP + 415 Unsupported Media Type response when either the method request + content type does not match any content type associated with the mapping + templates defined in the integration request or no mapping template is + defined in the integration request. + """ + content_handling: str | None = ... + """ + Specifies how to handle request payload content type conversions. + Supported values are `CONVERT_TO_BINARY` and `CONVERT_TO_TEXT`, with the + following behaviors: + + If this property is not defined, the request payload will be passed + through from the method request to integration request without + modification, provided that the `passthroughBehavior` is configured to + support payload pass-through. + """ + timeout_in_millis: int = ... + """ + Custom timeout between 50 and 29,000 milliseconds. The default value is + 29,000 milliseconds or 29 seconds. You can increase the default value to + longer than 29 seconds for Regional or private APIs only. + """ + cache_namespace: str | None = ... + """ + Specifies a group of related cached parameters. By default, API Gateway + uses the resource ID as the `cacheNamespace`. You can specify the same + `cacheNamespace` across resources to return the same cached data for + requests to different resources. + """ + cache_key_parameters: list[str] | None = ... + """ + A list of request parameters whose values API Gateway caches. To be + valid values for `cacheKeyParameters`, these parameters must also be + specified for Method `requestParameters`. + """ + integration_responses: dict[str, IntegrationResponse] | None = ... + """Specifies the integration's responses.""" + tls_config: TlsConfig | None = ... + """Specifies the TLS configuration for an integration.""" + response_transfer_mode: str | None = ... + """The response transfer mode of the integration.""" + integration_target: str | None = ... + """The ALB or NLB listener to send the request to.""" + +@dataclass(kw_only=True) +class IntegrationResponse(_SerdeShape): + """ + Represents an integration response. The status code must map to an + existing MethodResponse, and parameters and templates can be used to + transform the back-end response. + """ + + status_code: str | None = ... + """ + Specifies the status code that is used to map the integration response + to an existing MethodResponse. + """ + selection_pattern: str | None = ... + """ + Specifies the regular expression (regex) pattern used to choose an + integration response based on the response from the back end. For + example, if the success response returns nothing and the error response + returns some string, you could use the `.+` regex to match error + response. However, make sure that the error response does not contain + any newline (`\n`) character in such cases. If the back end is an Lambda + function, the Lambda function error header is matched. For all other + HTTP and Amazon Web Services back ends, the HTTP status code is matched. + """ + response_parameters: dict[str, str] | None = ... + """ + A key-value map specifying response parameters that are passed to the + method response from the back end. The key is a method response header + parameter name and the mapped value is an integration response header + value, a static value enclosed within a pair of single quotes, or a JSON + expression from the integration response body. The mapping key must + match the pattern of `method.response.header.{name}`, where `name` is a + valid and unique header name. The mapped non-static value must match the + pattern of `integration.response.header.{name}` or + `integration.response.body.{JSON-expression}`, where `name` is a valid + and unique response header name and `JSON-expression` is a valid JSON + expression without the `$` prefix. + """ + response_templates: dict[str, str] | None = ... + """ + Specifies the templates used to transform the integration response body. + Response templates are represented as a key/value map, with a + content-type as the key and a template as the value. + """ + content_handling: str | None = ... + """ + Specifies how to handle response payload content type conversions. + Supported values are `CONVERT_TO_BINARY` and `CONVERT_TO_TEXT`, with the + following behaviors: + + If this property is not defined, the response payload will be passed + through from the integration response to the method response without + modification. + """ + +class IntegrationType(UnknownEnumMixin, StrEnum): + """ + The integration type. The valid value is `HTTP` for integrating an API + method with an HTTP backend; `AWS` with any Amazon Web Services service + endpoints; `MOCK` for testing without actually invoking the backend; + `HTTP_PROXY` for integrating with the HTTP proxy integration; + `AWS_PROXY` for integrating with the Lambda proxy integration. + """ + + HTTP = "HTTP" + AWS = "AWS" + MOCK = "MOCK" + HTTP_PROXY = "HTTP_PROXY" + AWS_PROXY = "AWS_PROXY" + +class IpAddressType(UnknownEnumMixin, StrEnum): + IPV4 = "ipv4" + DUALSTACK = "dualstack" + +@dataclass(kw_only=True) +class LimitExceededException(ServiceError, _SerdeShape): + """ + The request exceeded the rate limit. Retry after the specified time + period. + """ + + retry_after_seconds: str | None = ... + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class LocationStatusType(UnknownEnumMixin, StrEnum): + DOCUMENTED = "DOCUMENTED" + UNDOCUMENTED = "UNDOCUMENTED" + +@dataclass(kw_only=True) +class Method(_SerdeShape): + """ + Represents a client-facing interface by which the client calls the API + to access back-end resources. A Method resource is integrated with an + Integration resource. Both consist of a request and one or more + responses. The method request takes the client input that is passed to + the back end through the integration request. A method response returns + the output from the back end to the client through an integration + response. A method request is embodied in a Method resource, whereas an + integration request is embodied in an Integration resource. On the other + hand, a method response is represented by a MethodResponse resource, + whereas an integration response is represented by an IntegrationResponse + resource. + """ + + http_method: str | None = ... + """The method's HTTP verb.""" + authorization_type: str | None = ... + """ + The method's authorization type. Valid values are `NONE` for open + access, `AWS_IAM` for using AWS IAM permissions, `CUSTOM` for using a + custom authorizer, or `COGNITO_USER_POOLS` for using a Cognito user + pool. + """ + authorizer_id: str | None = ... + """ + The identifier of an Authorizer to use on this method. The + `authorizationType` must be `CUSTOM`. + """ + api_key_required: bool | None = ... + """ + A boolean flag specifying whether a valid ApiKey is required to invoke + this method. + """ + request_validator_id: str | None = ... + """The identifier of a RequestValidator for request validation.""" + operation_name: str | None = ... + """ + A human-friendly operation identifier for the method. For example, you + can assign the `operationName` of `ListPets` for the `GET /pets` method + in the `PetStore` example. + """ + request_parameters: dict[str, bool] | None = ... + """ + A key-value map defining required or optional method request parameters + that can be accepted by API Gateway. A key is a method request parameter + name matching the pattern of `method.request.{location}.{name}`, where + `location` is `querystring`, `path`, or `header` and `name` is a valid + and unique parameter name. The value associated with the key is a + Boolean flag indicating whether the parameter is required (`true`) or + optional (`false`). The method request parameter names defined here are + available in Integration to be mapped to integration request parameters + or templates. + """ + request_models: dict[str, str] | None = ... + """ + A key-value map specifying data schemas, represented by Model resources, + (as the mapped value) of the request payloads of given content types (as + the mapping key). + """ + method_responses: dict[str, MethodResponse] | None = ... + """Gets a method response associated with a given HTTP status code.""" + method_integration: Integration | None = ... + """ + Gets the method's integration responsible for passing the + client-submitted request to the back end and performing necessary + transformations to make the request compliant with the back end. + """ + authorization_scopes: list[str] | None = ... + """ + A list of authorization scopes configured on the method. The scopes are + used with a `COGNITO_USER_POOLS` authorizer to authorize the method + invocation. The authorization works by matching the method scopes + against the scopes parsed from the access token in the incoming request. + The method invocation is authorized if any method scopes matches a + claimed scope in the access token. Otherwise, the invocation is not + authorized. When the method scope is configured, the client must provide + an access token instead of an identity token for authorization purposes. + """ + +@dataclass(kw_only=True) +class MethodResponse(_SerdeShape): + """ + Represents a method response of a given HTTP status code returned to the + client. The method response is passed from the back end through the + associated integration response that can be transformed using a mapping + template. + """ + + status_code: str | None = ... + """The method response's status code.""" + response_parameters: dict[str, bool] | None = ... + """ + A key-value map specifying required or optional response parameters that + API Gateway can send back to the caller. A key defines a method response + header and the value specifies whether the associated method response + header is required or not. The expression of the key must match the + pattern `method.response.header.{name}`, where `name` is a valid and + unique header name. API Gateway passes certain integration response data + to the method response headers specified here according to the mapping + you prescribe in the API's IntegrationResponse. The integration + response data that can be mapped include an integration response header + expressed in `integration.response.header.{name}`, a static value + enclosed within a pair of single quotes (e.g., `'application/json'`), or + a JSON expression from the back-end response payload in the form of + `integration.response.body.{JSON-expression}`, where `JSON-expression` + is a valid JSON expression without the `$` prefix.) + """ + response_models: dict[str, str] | None = ... + """ + Specifies the Model resources used for the response's content-type. + Response models are represented as a key/value map, with a content-type + as the key and a Model name as the value. + """ + +@dataclass(kw_only=True) +class MethodSetting(_SerdeShape): + """Specifies the method setting properties.""" + + metrics_enabled: bool = ... + """Specifies whether Amazon CloudWatch metrics are enabled for this method.""" + logging_level: str | None = ... + """ + Specifies the logging level for this method, which affects the log + entries pushed to Amazon CloudWatch Logs. Valid values are `OFF`, + `ERROR`, and `INFO`. Choose `ERROR` to write only error-level entries to + CloudWatch Logs, or choose `INFO` to include all `ERROR` events as well + as extra informational events. + """ + data_trace_enabled: bool = ... + """ + Specifies whether data trace logging is enabled for this method, which + affects the log entries pushed to Amazon CloudWatch Logs. This can be + useful to troubleshoot APIs, but can result in logging sensitive data. + We recommend that you don't enable this option for production APIs. + """ + throttling_burst_limit: int = ... + """Specifies the throttling burst limit.""" + throttling_rate_limit: float = ... + """Specifies the throttling rate limit.""" + caching_enabled: bool = ... + """ + Specifies whether responses should be cached and returned for requests. + A cache cluster must be enabled on the stage for responses to be cached. + """ + cache_ttl_in_seconds: int = ... + """ + Specifies the time to live (TTL), in seconds, for cached responses. The + higher the TTL, the longer the response will be cached. + """ + cache_data_encrypted: bool = ... + """Specifies whether the cached responses are encrypted.""" + require_authorization_for_cache_control: bool = ... + """ + Specifies whether authorization is required for a cache invalidation + request. + """ + unauthorized_cache_control_header_strategy: str | None = ... + """Specifies how to handle unauthorized requests for cache invalidation.""" + +@dataclass(kw_only=True) +class MethodSnapshot(_SerdeShape): + """ + Represents a summary of a Method resource, given a particular date and + time. + """ + + authorization_type: str | None = ... + """ + The method's authorization type. Valid values are `NONE` for open + access, `AWS_IAM` for using AWS IAM permissions, `CUSTOM` for using a + custom authorizer, or `COGNITO_USER_POOLS` for using a Cognito user + pool. + """ + api_key_required: bool = ... + """Specifies whether the method requires a valid ApiKey.""" + +@dataclass(kw_only=True) +class Model(_SerdeShape): + """ + Represents the data structure of a method's request or response + payload. + """ + + id: str | None = ... + """The identifier for the model resource.""" + name: str | None = ... + """The name of the model. Must be an alphanumeric string.""" + description: str | None = ... + """The description of the model.""" + schema: str | None = ... + """ + The schema for the model. For `application/json` models, this should be + JSON schema draft 4 model. Do not include \"\\*/\" characters in the + description of any properties because such \"\\*/\" characters may be + interpreted as the closing marker for comments in some languages, such + as Java or JavaScript, causing the installation of your API's SDK + generated by API Gateway to fail. + """ + content_type: str | None = ... + """The content-type for the model.""" + +@dataclass(kw_only=True) +class MutualTlsAuthentication(_SerdeShape): + """ + The mutual TLS authentication configuration for a custom domain name. If + specified, API Gateway performs two-way authentication between the + client and the server. Clients must present a trusted certificate to + access your API. + """ + + truststore_uri: str | None = ... + """ + An Amazon S3 URL that specifies the truststore for mutual TLS + authentication, for example `s3://bucket-name/key-name`. The truststore + can contain certificates from public or private certificate authorities. + To update the truststore, upload a new version to S3, and then update + your custom domain name to use the new version. To update the + truststore, you must have permissions to access the S3 object. + """ + truststore_version: str | None = ... + """ + The version of the S3 object that contains your truststore. To specify a + version, you must have versioning enabled for the S3 bucket. + """ + truststore_warnings: list[str] | None = ... + """ + A list of warnings that API Gateway returns while processing your + truststore. Invalid certificates produce warnings. Mutual TLS is still + enabled, but some clients might not be able to access your API. To + resolve warnings, upload a new truststore to S3, and then update you + domain name to use the new version. + """ + +@dataclass(kw_only=True) +class MutualTlsAuthenticationInput(_SerdeShape): + """ + The mutual TLS authentication configuration for a custom domain name. If + specified, API Gateway performs two-way authentication between the + client and the server. Clients must present a trusted certificate to + access your API. + """ + + truststore_uri: str | None = ... + """ + An Amazon S3 URL that specifies the truststore for mutual TLS + authentication, for example `s3://bucket-name/key-name`. The truststore + can contain certificates from public or private certificate authorities. + To update the truststore, upload a new version to S3, and then update + your custom domain name to use the new version. To update the + truststore, you must have permissions to access the S3 object. + """ + truststore_version: str | None = ... + """ + The version of the S3 object that contains your truststore. To specify a + version, you must have versioning enabled for the S3 bucket + """ + +@dataclass(kw_only=True) +class NotFoundException(ServiceError, _SerdeShape): + """ + The requested resource is not found. Make sure that the request URI is + correct. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class Op(UnknownEnumMixin, StrEnum): + ADD = "add" + REMOVE = "remove" + REPLACE = "replace" + MOVE = "move" + COPY = "copy" + TEST = "test" + +@dataclass(kw_only=True) +class PatchOperation(_SerdeShape): + """ + For more information about supported patch operations, see [Patch + Operations](https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html). + """ + + op: str | None = ... + """ + An update operation to be performed with this PATCH request. The valid + value can be add, remove, replace or copy. Not all valid operations are + supported for a given resource. Support of the operations depends on + specific operational contexts. Attempts to apply an unsupported + operation on a resource will return an error message.. + """ + path: str | None = ... + """ + The op operation's target, as identified by a JSON Pointer value that + references a location within the targeted resource. For example, if the + target resource has an updateable property of {\"name\":\"value\"}, the + path for this property is /name. If the name property value is a JSON + object (e.g., {\"name\": {\"child/name\": \"child-value\"}}), the path + for the child/name property will be /name/child~1name. Any slash + (\"/\") character appearing in path names must be escaped with \"~1\", + as shown in the example above. Each op operation can have only one path + associated with it. + """ + value: str | None = ... + """ + The new target value of the update operation. It is applicable for the + add or replace operation. When using AWS CLI to update a property of a + JSON value, enclose the JSON object with a pair of single quotes in a + Linux shell, e.g., '{\"a\": ...}'. + """ + from_: str | None = ... + """ + The copy update operation's source as identified by a JSON-Pointer + value referencing the location within the targeted resource to copy the + value from. For example, to promote a canary deployment, you copy the + canary deployment ID to the affiliated deployment ID by calling a PATCH + request on a Stage resource with \"op\":\"copy\", + \"from\":\"/canarySettings/deploymentId\" and + \"path\":\"/deploymentId\". + """ + +@dataclass(kw_only=True) +class PutGatewayResponseInput(_SerdeShape): + """ + Creates a customization of a GatewayResponse of a specified response + type and status code on the given RestApi. + """ + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + response_type: str | None = ... + """The response type of the associated GatewayResponse""" + status_code: str | None = ... + """The HTTP status code of the GatewayResponse.""" + response_parameters: dict[str, str] | None = ... + """ + Response parameters (paths, query strings and headers) of the + GatewayResponse as a string-to-string map of key-value pairs. + """ + response_templates: dict[str, str] | None = ... + """ + Response templates of the GatewayResponse as a string-to-string map of + key-value pairs. + """ + +@dataclass(kw_only=True) +class PutGatewayResponseOutput(_SerdeShape): + """ + A gateway response of a given response type and status code, with + optional response parameters and mapping templates. + """ + + response_type: str | None = ... + """The response type of the associated GatewayResponse.""" + status_code: str | None = ... + """The HTTP status code for this GatewayResponse.""" + response_parameters: dict[str, str] | None = ... + """ + Response parameters (paths, query strings and headers) of the + GatewayResponse as a string-to-string map of key-value pairs. + """ + response_templates: dict[str, str] | None = ... + """ + Response templates of the GatewayResponse as a string-to-string map of + key-value pairs. + """ + default_response: bool = ... + """ + A Boolean flag to indicate whether this GatewayResponse is the default + gateway response (`true`) or not (`false`). A default gateway response + is one generated by API Gateway without any customization by an API + developer. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class PutIntegrationInput(_SerdeShape): + """Sets up a method's integration.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + resource_id: str | None = ... + """Specifies a put integration request's resource ID.""" + http_method: str | None = ... + """Specifies the HTTP method for the integration.""" + type: str | None = ... + """Specifies a put integration input's type.""" + integration_http_method: str | None = ... + """The HTTP method for the integration.""" + uri: str | None = ... + """ + Specifies Uniform Resource Identifier (URI) of the integration endpoint. + For HTTP or `HTTP_PROXY` integrations, the URI must be a fully formed, + encoded HTTP(S) URL according to the RFC-3986 specification, for either + standard integration, where `connectionType` is not `VPC_LINK`, or + private integration, where `connectionType` is `VPC_LINK`. For a private + HTTP integration, the URI is not used for routing. For `AWS` or + `AWS_PROXY` integrations, the URI is of the form + `arn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api`}. + Here, {Region} is the API Gateway region (e.g., us-east-1); {service} is + the name of the integrated Amazon Web Services service (e.g., s3); and + {subdomain} is a designated subdomain supported by certain Amazon Web + Services service for fast host-name lookup. action can be used for an + Amazon Web Services service action-based API, using an + Action={name}&{p1}={v1}&p2={v2}... query string. The ensuing + {service_api} refers to a supported action {name} plus any required + input parameters. Alternatively, path can be used for an Amazon Web + Services service path-based API. The ensuing service_api refers to the + path to an Amazon Web Services service resource, including the region of + the integrated Amazon Web Services service, if applicable. For example, + for integration with the S3 API of `GetObject`, the `uri` can be either + `arn:aws:apigateway:us-west-2:s3:action/GetObject&Bucket={bucket}&Key={key}` + or `arn:aws:apigateway:us-west-2:s3:path/{bucket}/{key}`. + """ + connection_type: str | None = ... + """ + The type of the network connection to the integration endpoint. The + valid value is `INTERNET` for connections through the public routable + internet or `VPC_LINK` for private connections between API Gateway and a + network load balancer in a VPC. The default value is `INTERNET`. + """ + connection_id: str | None = ... + """ + The ID of the VpcLink used for the integration. Specify this value only + if you specify `VPC_LINK` as the connection type. + """ + credentials: str | None = ... + """Specifies whether credentials are required for a put integration.""" + request_parameters: dict[str, str] | None = ... + """ + A key-value map specifying request parameters that are passed from the + method request to the back end. The key is an integration request + parameter name and the associated value is a method request parameter + value or static value that must be enclosed within single quotes and + pre-encoded as required by the back end. The method request parameter + value must match the pattern of `method.request.{location}.{name}`, + where `location` is `querystring`, `path`, or `header` and `name` must + be a valid and unique method request parameter name. + """ + request_templates: dict[str, str] | None = ... + """ + Represents a map of Velocity templates that are applied on the request + payload based on the value of the Content-Type header sent by the + client. The content type value is the key in this map, and the template + (as a String) is the value. + """ + passthrough_behavior: str | None = ... + """ + Specifies the pass-through behavior for incoming requests based on the + Content-Type header in the request, and the available mapping templates + specified as the `requestTemplates` property on the Integration + resource. There are three valid values: `WHEN_NO_MATCH`, + `WHEN_NO_TEMPLATES`, and `NEVER`. + """ + cache_namespace: str | None = ... + """ + Specifies a group of related cached parameters. By default, API Gateway + uses the resource ID as the `cacheNamespace`. You can specify the same + `cacheNamespace` across resources to return the same cached data for + requests to different resources. + """ + cache_key_parameters: list[str] | None = ... + """ + A list of request parameters whose values API Gateway caches. To be + valid values for `cacheKeyParameters`, these parameters must also be + specified for Method `requestParameters`. + """ + content_handling: str | None = ... + """ + Specifies how to handle request payload content type conversions. + Supported values are `CONVERT_TO_BINARY` and `CONVERT_TO_TEXT`, with the + following behaviors: + + If this property is not defined, the request payload will be passed + through from the method request to integration request without + modification, provided that the `passthroughBehavior` is configured to + support payload pass-through. + """ + timeout_in_millis: int | None = ... + """ + Custom timeout between 50 and 29,000 milliseconds. The default value is + 29,000 milliseconds or 29 seconds. You can increase the default value to + longer than 29 seconds for Regional or private APIs only. + """ + tls_config: TlsConfig | None = ... + """Specifies the TLS configuration for an integration.""" + response_transfer_mode: str | None = ... + """The response transfer mode of the integration.""" + integration_target: str | None = ... + """The ALB or NLB listener to send the request to.""" + +@dataclass(kw_only=True) +class PutIntegrationOutput(_SerdeShape): + """ + Represents an `HTTP`, `HTTP_PROXY`, `AWS`, `AWS_PROXY`, or Mock + integration. + """ + + type: str | None = ... + """ + Specifies an API method integration type. The valid value is one of the + following: + + For the HTTP and HTTP proxy integrations, each integration can specify a + protocol (`http/https`), port and path. Standard 80 and 443 ports are + supported as well as custom ports above 1024. An HTTP or HTTP proxy + integration with a `connectionType` of `VPC_LINK` is referred to as a + private integration and uses a VpcLink to connect API Gateway to a + network load balancer of a VPC. + """ + http_method: str | None = ... + """ + Specifies the integration's HTTP method type. For the Type property, if + you specify `MOCK`, this property is optional. For Lambda integrations, + you must set the integration method to `POST`. For all other types, you + must specify this property. + """ + uri: str | None = ... + """ + Specifies Uniform Resource Identifier (URI) of the integration endpoint. + + For `HTTP` or `HTTP_PROXY` integrations, the URI must be a fully formed, + encoded HTTP(S) URL according to the RFC-3986 specification for standard + integrations. If `connectionType` is `VPC_LINK` specify the Network Load + Balancer DNS name. For `AWS` or `AWS_PROXY` integrations, the URI is of + the form + `arn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api}`. + Here, {Region} is the API Gateway region (e.g., us-east-1); {service} is + the name of the integrated Amazon Web Services service (e.g., s3); and + {subdomain} is a designated subdomain supported by certain Amazon Web + Services service for fast host-name lookup. action can be used for an + Amazon Web Services service action-based API, using an + Action={name}&{p1}={v1}&p2={v2}... query string. The ensuing + {service_api} refers to a supported action {name} plus any required + input parameters. Alternatively, path can be used for an Amazon Web + Services service path-based API. The ensuing service_api refers to the + path to an Amazon Web Services service resource, including the region of + the integrated Amazon Web Services service, if applicable. For example, + for integration with the S3 API of GetObject, the uri can be either + `arn:aws:apigateway:us-west-2:s3:action/GetObject&Bucket={bucket}&Key={key}` + or `arn:aws:apigateway:us-west-2:s3:path/{bucket}/{key}` + """ + connection_type: str | None = ... + """ + The type of the network connection to the integration endpoint. The + valid value is `INTERNET` for connections through the public routable + internet or `VPC_LINK` for private connections between API Gateway and a + network load balancer in a VPC. The default value is `INTERNET`. + """ + connection_id: str | None = ... + """ + The ID of the VpcLink used for the integration when + `connectionType=VPC_LINK` and undefined, otherwise. + """ + credentials: str | None = ... + """ + Specifies the credentials required for the integration, if any. For AWS + integrations, three options are available. To specify an IAM Role for + API Gateway to assume, use the role's Amazon Resource Name (ARN). To + require that the caller's identity be passed through from the request, + specify the string `arn:aws:iam::*:user/*`. To use resource-based + permissions on supported Amazon Web Services services, specify null. + """ + request_parameters: dict[str, str] | None = ... + """ + A key-value map specifying request parameters that are passed from the + method request to the back end. The key is an integration request + parameter name and the associated value is a method request parameter + value or static value that must be enclosed within single quotes and + pre-encoded as required by the back end. The method request parameter + value must match the pattern of `method.request.{location}.{name}`, + where `location` is `querystring`, `path`, or `header` and `name` must + be a valid and unique method request parameter name. + """ + request_templates: dict[str, str] | None = ... + """ + Represents a map of Velocity templates that are applied on the request + payload based on the value of the Content-Type header sent by the + client. The content type value is the key in this map, and the template + (as a String) is the value. + """ + passthrough_behavior: str | None = ... + """ + Specifies how the method request body of an unmapped content type will + be passed through the integration request to the back end without + transformation. A content type is unmapped if no mapping template is + defined in the integration or the content type does not match any of the + mapped content types, as specified in `requestTemplates`. The valid + value is one of the following: `WHEN_NO_MATCH`: passes the method + request body through the integration request to the back end without + transformation when the method request content type does not match any + content type associated with the mapping templates defined in the + integration request. `WHEN_NO_TEMPLATES`: passes the method request body + through the integration request to the back end without transformation + when no mapping template is defined in the integration request. If a + template is defined when this option is selected, the method request of + an unmapped content-type will be rejected with an HTTP 415 Unsupported + Media Type response. `NEVER`: rejects the method request with an HTTP + 415 Unsupported Media Type response when either the method request + content type does not match any content type associated with the mapping + templates defined in the integration request or no mapping template is + defined in the integration request. + """ + content_handling: str | None = ... + """ + Specifies how to handle request payload content type conversions. + Supported values are `CONVERT_TO_BINARY` and `CONVERT_TO_TEXT`, with the + following behaviors: + + If this property is not defined, the request payload will be passed + through from the method request to integration request without + modification, provided that the `passthroughBehavior` is configured to + support payload pass-through. + """ + timeout_in_millis: int = ... + """ + Custom timeout between 50 and 29,000 milliseconds. The default value is + 29,000 milliseconds or 29 seconds. You can increase the default value to + longer than 29 seconds for Regional or private APIs only. + """ + cache_namespace: str | None = ... + """ + Specifies a group of related cached parameters. By default, API Gateway + uses the resource ID as the `cacheNamespace`. You can specify the same + `cacheNamespace` across resources to return the same cached data for + requests to different resources. + """ + cache_key_parameters: list[str] | None = ... + """ + A list of request parameters whose values API Gateway caches. To be + valid values for `cacheKeyParameters`, these parameters must also be + specified for Method `requestParameters`. + """ + integration_responses: dict[str, IntegrationResponse] | None = ... + """Specifies the integration's responses.""" + tls_config: TlsConfig | None = ... + """Specifies the TLS configuration for an integration.""" + response_transfer_mode: str | None = ... + """The response transfer mode of the integration.""" + integration_target: str | None = ... + """The ALB or NLB listener to send the request to.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class PutIntegrationResponseInput(_SerdeShape): + """Represents a put integration response request.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + resource_id: str | None = ... + """Specifies a put integration response request's resource identifier.""" + http_method: str | None = ... + """Specifies a put integration response request's HTTP method.""" + status_code: str | None = ... + """ + Specifies the status code that is used to map the integration response + to an existing MethodResponse. + """ + selection_pattern: str | None = ... + """Specifies the selection pattern of a put integration response.""" + response_parameters: dict[str, str] | None = ... + """ + A key-value map specifying response parameters that are passed to the + method response from the back end. The key is a method response header + parameter name and the mapped value is an integration response header + value, a static value enclosed within a pair of single quotes, or a JSON + expression from the integration response body. The mapping key must + match the pattern of `method.response.header.{name}`, where `name` is a + valid and unique header name. The mapped non-static value must match the + pattern of `integration.response.header.{name}` or + `integration.response.body.{JSON-expression}`, where `name` must be a + valid and unique response header name and `JSON-expression` a valid JSON + expression without the `$` prefix. + """ + response_templates: dict[str, str] | None = ... + """Specifies a put integration response's templates.""" + content_handling: str | None = ... + """ + Specifies how to handle response payload content type conversions. + Supported values are `CONVERT_TO_BINARY` and `CONVERT_TO_TEXT`, with the + following behaviors: + + If this property is not defined, the response payload will be passed + through from the integration response to the method response without + modification. + """ + +@dataclass(kw_only=True) +class PutIntegrationResponseOutput(_SerdeShape): + """ + Represents an integration response. The status code must map to an + existing MethodResponse, and parameters and templates can be used to + transform the back-end response. + """ + + status_code: str | None = ... + """ + Specifies the status code that is used to map the integration response + to an existing MethodResponse. + """ + selection_pattern: str | None = ... + """ + Specifies the regular expression (regex) pattern used to choose an + integration response based on the response from the back end. For + example, if the success response returns nothing and the error response + returns some string, you could use the `.+` regex to match error + response. However, make sure that the error response does not contain + any newline (`\n`) character in such cases. If the back end is an Lambda + function, the Lambda function error header is matched. For all other + HTTP and Amazon Web Services back ends, the HTTP status code is matched. + """ + response_parameters: dict[str, str] | None = ... + """ + A key-value map specifying response parameters that are passed to the + method response from the back end. The key is a method response header + parameter name and the mapped value is an integration response header + value, a static value enclosed within a pair of single quotes, or a JSON + expression from the integration response body. The mapping key must + match the pattern of `method.response.header.{name}`, where `name` is a + valid and unique header name. The mapped non-static value must match the + pattern of `integration.response.header.{name}` or + `integration.response.body.{JSON-expression}`, where `name` is a valid + and unique response header name and `JSON-expression` is a valid JSON + expression without the `$` prefix. + """ + response_templates: dict[str, str] | None = ... + """ + Specifies the templates used to transform the integration response body. + Response templates are represented as a key/value map, with a + content-type as the key and a template as the value. + """ + content_handling: str | None = ... + """ + Specifies how to handle response payload content type conversions. + Supported values are `CONVERT_TO_BINARY` and `CONVERT_TO_TEXT`, with the + following behaviors: + + If this property is not defined, the response payload will be passed + through from the integration response to the method response without + modification. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class PutMethodInput(_SerdeShape): + """Request to add a method to an existing Resource resource.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + resource_id: str | None = ... + """The Resource identifier for the new Method resource.""" + http_method: str | None = ... + """Specifies the method request's HTTP method type.""" + authorization_type: str | None = ... + """ + The method's authorization type. Valid values are `NONE` for open + access, `AWS_IAM` for using AWS IAM permissions, `CUSTOM` for using a + custom authorizer, or `COGNITO_USER_POOLS` for using a Cognito user + pool. + """ + authorizer_id: str | None = ... + """ + Specifies the identifier of an Authorizer to use on this Method, if the + type is CUSTOM or COGNITO_USER_POOLS. The authorizer identifier is + generated by API Gateway when you created the authorizer. + """ + api_key_required: bool = ... + """Specifies whether the method required a valid ApiKey.""" + operation_name: str | None = ... + """ + A human-friendly operation identifier for the method. For example, you + can assign the `operationName` of `ListPets` for the `GET /pets` method + in the `PetStore` example. + """ + request_parameters: dict[str, bool] | None = ... + """ + A key-value map defining required or optional method request parameters + that can be accepted by API Gateway. A key defines a method request + parameter name matching the pattern of + `method.request.{location}.{name}`, where `location` is `querystring`, + `path`, or `header` and `name` is a valid and unique parameter name. The + value associated with the key is a Boolean flag indicating whether the + parameter is required (`true`) or optional (`false`). The method request + parameter names defined here are available in Integration to be mapped + to integration request parameters or body-mapping templates. + """ + request_models: dict[str, str] | None = ... + """ + Specifies the Model resources used for the request's content type. + Request models are represented as a key/value map, with a content type + as the key and a Model name as the value. + """ + request_validator_id: str | None = ... + """The identifier of a RequestValidator for validating the method request.""" + authorization_scopes: list[str] | None = ... + """ + A list of authorization scopes configured on the method. The scopes are + used with a `COGNITO_USER_POOLS` authorizer to authorize the method + invocation. The authorization works by matching the method scopes + against the scopes parsed from the access token in the incoming request. + The method invocation is authorized if any method scopes matches a + claimed scope in the access token. Otherwise, the invocation is not + authorized. When the method scope is configured, the client must provide + an access token instead of an identity token for authorization purposes. + """ + +@dataclass(kw_only=True) +class PutMethodOutput(_SerdeShape): + """ + Represents a client-facing interface by which the client calls the API + to access back-end resources. A Method resource is integrated with an + Integration resource. Both consist of a request and one or more + responses. The method request takes the client input that is passed to + the back end through the integration request. A method response returns + the output from the back end to the client through an integration + response. A method request is embodied in a Method resource, whereas an + integration request is embodied in an Integration resource. On the other + hand, a method response is represented by a MethodResponse resource, + whereas an integration response is represented by an IntegrationResponse + resource. + """ + + http_method: str | None = ... + """The method's HTTP verb.""" + authorization_type: str | None = ... + """ + The method's authorization type. Valid values are `NONE` for open + access, `AWS_IAM` for using AWS IAM permissions, `CUSTOM` for using a + custom authorizer, or `COGNITO_USER_POOLS` for using a Cognito user + pool. + """ + authorizer_id: str | None = ... + """ + The identifier of an Authorizer to use on this method. The + `authorizationType` must be `CUSTOM`. + """ + api_key_required: bool | None = ... + """ + A boolean flag specifying whether a valid ApiKey is required to invoke + this method. + """ + request_validator_id: str | None = ... + """The identifier of a RequestValidator for request validation.""" + operation_name: str | None = ... + """ + A human-friendly operation identifier for the method. For example, you + can assign the `operationName` of `ListPets` for the `GET /pets` method + in the `PetStore` example. + """ + request_parameters: dict[str, bool] | None = ... + """ + A key-value map defining required or optional method request parameters + that can be accepted by API Gateway. A key is a method request parameter + name matching the pattern of `method.request.{location}.{name}`, where + `location` is `querystring`, `path`, or `header` and `name` is a valid + and unique parameter name. The value associated with the key is a + Boolean flag indicating whether the parameter is required (`true`) or + optional (`false`). The method request parameter names defined here are + available in Integration to be mapped to integration request parameters + or templates. + """ + request_models: dict[str, str] | None = ... + """ + A key-value map specifying data schemas, represented by Model resources, + (as the mapped value) of the request payloads of given content types (as + the mapping key). + """ + method_responses: dict[str, MethodResponse] | None = ... + """Gets a method response associated with a given HTTP status code.""" + method_integration: Integration | None = ... + """ + Gets the method's integration responsible for passing the + client-submitted request to the back end and performing necessary + transformations to make the request compliant with the back end. + """ + authorization_scopes: list[str] | None = ... + """ + A list of authorization scopes configured on the method. The scopes are + used with a `COGNITO_USER_POOLS` authorizer to authorize the method + invocation. The authorization works by matching the method scopes + against the scopes parsed from the access token in the incoming request. + The method invocation is authorized if any method scopes matches a + claimed scope in the access token. Otherwise, the invocation is not + authorized. When the method scope is configured, the client must provide + an access token instead of an identity token for authorization purposes. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class PutMethodResponseInput(_SerdeShape): + """Request to add a MethodResponse to an existing Method resource.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + resource_id: str | None = ... + """The Resource identifier for the Method resource.""" + http_method: str | None = ... + """The HTTP verb of the Method resource.""" + status_code: str | None = ... + """The method response's status code.""" + response_parameters: dict[str, bool] | None = ... + """ + A key-value map specifying required or optional response parameters that + API Gateway can send back to the caller. A key defines a method response + header name and the associated value is a Boolean flag indicating + whether the method response parameter is required or not. The method + response header names must match the pattern of + `method.response.header.{name}`, where `name` is a valid and unique + header name. The response parameter names defined here are available in + the integration response to be mapped from an integration response + header expressed in `integration.response.header.{name}`, a static value + enclosed within a pair of single quotes (e.g., `'application/json'`), or + a JSON expression from the back-end response payload in the form of + `integration.response.body.{JSON-expression}`, where `JSON-expression` + is a valid JSON expression without the `$` prefix.) + """ + response_models: dict[str, str] | None = ... + """ + Specifies the Model resources used for the response's content type. + Response models are represented as a key/value map, with a content type + as the key and a Model name as the value. + """ + +@dataclass(kw_only=True) +class PutMethodResponseOutput(_SerdeShape): + """ + Represents a method response of a given HTTP status code returned to the + client. The method response is passed from the back end through the + associated integration response that can be transformed using a mapping + template. + """ + + status_code: str | None = ... + """The method response's status code.""" + response_parameters: dict[str, bool] | None = ... + """ + A key-value map specifying required or optional response parameters that + API Gateway can send back to the caller. A key defines a method response + header and the value specifies whether the associated method response + header is required or not. The expression of the key must match the + pattern `method.response.header.{name}`, where `name` is a valid and + unique header name. API Gateway passes certain integration response data + to the method response headers specified here according to the mapping + you prescribe in the API's IntegrationResponse. The integration + response data that can be mapped include an integration response header + expressed in `integration.response.header.{name}`, a static value + enclosed within a pair of single quotes (e.g., `'application/json'`), or + a JSON expression from the back-end response payload in the form of + `integration.response.body.{JSON-expression}`, where `JSON-expression` + is a valid JSON expression without the `$` prefix.) + """ + response_models: dict[str, str] | None = ... + """ + Specifies the Model resources used for the response's content-type. + Response models are represented as a key/value map, with a content-type + as the key and a Model name as the value. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class PutMode(UnknownEnumMixin, StrEnum): + MERGE = "merge" + OVERWRITE = "overwrite" + +@dataclass(kw_only=True) +class PutRestApiInput(_SerdeShape): + """ + A PUT request to update an existing API, with external API definitions + specified as the request body. + """ + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + mode: str | None = ... + """ + The `mode` query parameter to specify the update mode. Valid values are + \"merge\" and \"overwrite\". By default, the update mode is \"merge\". + """ + fail_on_warnings: bool = ... + """ + A query parameter to indicate whether to rollback the API update + (`true`) or not (`false`) when a warning is encountered. The default + value is `false`. + """ + parameters: dict[str, str] | None = ... + """ + Custom header parameters as part of the request. For example, to exclude + DocumentationParts from an imported API, set `ignore=documentation` as a + `parameters` value, as in the AWS CLI command of + `aws apigateway import-rest-api --parameters ignore=documentation --body 'file:///path/to/imported-api-body.json'`. + """ + body: bytes | None = ... + """ + The PUT request body containing external API definitions. Currently, + only OpenAPI definition JSON/YAML files are supported. The maximum size + of the API definition file is 6MB. + """ + +@dataclass(kw_only=True) +class PutRestApiOutput(_SerdeShape): + """Represents a REST API.""" + + id: str | None = ... + """ + The API's identifier. This identifier is unique across all of your APIs + in API Gateway. + """ + name: str | None = ... + """The API's name.""" + description: str | None = ... + """The API's description.""" + created_date: datetime | None = ... + """The timestamp when the API was created.""" + version: str | None = ... + """A version identifier for the API.""" + warnings: list[str] | None = ... + """ + The warning messages reported when `failonwarnings` is turned on during + API import. + """ + binary_media_types: list[str] | None = ... + """ + The list of binary media types supported by the RestApi. By default, the + RestApi supports only UTF-8-encoded text payloads. + """ + minimum_compression_size: int | None = ... + """ + A nullable integer that is used to enable compression (with non-negative + between 0 and 10485760 (10M) bytes, inclusive) or disable compression + (with a null value) on an API. When compression is enabled, compression + or decompression is not applied on the payload if the payload size is + smaller than this value. Setting it to zero allows compression for any + payload size. + """ + api_key_source: str | None = ... + """ + The source of the API key for metering requests according to a usage + plan. Valid values are: >`HEADER` to read the API key from the + `X-API-Key` header of a request. `AUTHORIZER` to read the API key from + the `UsageIdentifierKey` from a custom authorizer. + """ + endpoint_configuration: EndpointConfiguration | None = ... + """ + The endpoint configuration of this RestApi showing the endpoint types + and IP address types of the API. + """ + policy: str | None = ... + """ + A stringified JSON policy document that applies to this RestApi + regardless of the caller and Method configuration. + """ + tags: dict[str, str] | None = ... + """ + The collection of tags. Each tag element is associated with a given + resource. + """ + disable_execute_api_endpoint: bool = ... + """ + Specifies whether clients can invoke your API by using the default + `execute-api` endpoint. By default, clients can invoke your API with the + default `https://{api_id}.execute-api.{region}.amazonaws.com` endpoint. + To require that clients use a custom domain name to invoke your API, + disable the default endpoint. + """ + root_resource_id: str | None = ... + """The API's root resource ID.""" + security_policy: str | None = ... + """ + The Transport Layer Security (TLS) version + cipher suite for this + RestApi. + """ + endpoint_access_mode: str | None = ... + """The endpoint access mode of the RestApi.""" + api_status: str | None = ... + """The ApiStatus of the RestApi.""" + api_status_message: str | None = ... + """ + The status message of the RestApi. When the status message is `UPDATING` + you can still invoke it. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class QuotaPeriodType(UnknownEnumMixin, StrEnum): + DAY = "DAY" + WEEK = "WEEK" + MONTH = "MONTH" + +@dataclass(kw_only=True) +class QuotaSettings(_SerdeShape): + """Quotas configured for a usage plan.""" + + limit: int = ... + """ + The target maximum number of requests that can be made in a given time + period. + """ + offset: int = ... + """ + The number of requests subtracted from the given limit in the initial + time period. + """ + period: str | None = ... + """ + The time period in which the limit applies. Valid values are \"DAY\", + \"WEEK\" or \"MONTH\". + """ + +@dataclass(kw_only=True) +class RejectDomainNameAccessAssociationInput(_SerdeShape): + """Dataclass for RejectDomainNameAccessAssociationInput structure.""" + + domain_name_access_association_arn: str | None = ... + """The ARN of the domain name access association resource.""" + domain_name_arn: str | None = ... + """The ARN of the domain name.""" + +@dataclass(kw_only=True) +class RejectDomainNameAccessAssociationOutput(_SerdeShape): + """Dataclass for RejectDomainNameAccessAssociationOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class RequestValidator(_SerdeShape): + """A set of validation rules for incoming Method requests.""" + + id: str | None = ... + """The identifier of this RequestValidator.""" + name: str | None = ... + """The name of this RequestValidator""" + validate_request_body: bool = ... + """ + A Boolean flag to indicate whether to validate a request body according + to the configured Model schema. + """ + validate_request_parameters: bool = ... + """ + A Boolean flag to indicate whether to validate request parameters + (`true`) or not (`false`). + """ + +@dataclass(kw_only=True) +class Resource(_SerdeShape): + """Represents an API resource.""" + + id: str | None = ... + """The resource's identifier.""" + parent_id: str | None = ... + """The parent resource's identifier.""" + path_part: str | None = ... + """The last path segment for this resource.""" + path: str | None = ... + """The full path for this resource.""" + resource_methods: dict[str, Method] | None = ... + """Gets an API resource's method of a given HTTP verb.""" + +class ResourceOwner(UnknownEnumMixin, StrEnum): + SELF = "SELF" + OTHER_ACCOUNTS = "OTHER_ACCOUNTS" + +class ResponseTransferMode(UnknownEnumMixin, StrEnum): + BUFFERED = "BUFFERED" + STREAM = "STREAM" + +@dataclass(kw_only=True) +class RestApi(_SerdeShape): + """Represents a REST API.""" + + id: str | None = ... + """ + The API's identifier. This identifier is unique across all of your APIs + in API Gateway. + """ + name: str | None = ... + """The API's name.""" + description: str | None = ... + """The API's description.""" + created_date: datetime | None = ... + """The timestamp when the API was created.""" + version: str | None = ... + """A version identifier for the API.""" + warnings: list[str] | None = ... + """ + The warning messages reported when `failonwarnings` is turned on during + API import. + """ + binary_media_types: list[str] | None = ... + """ + The list of binary media types supported by the RestApi. By default, the + RestApi supports only UTF-8-encoded text payloads. + """ + minimum_compression_size: int | None = ... + """ + A nullable integer that is used to enable compression (with non-negative + between 0 and 10485760 (10M) bytes, inclusive) or disable compression + (with a null value) on an API. When compression is enabled, compression + or decompression is not applied on the payload if the payload size is + smaller than this value. Setting it to zero allows compression for any + payload size. + """ + api_key_source: str | None = ... + """ + The source of the API key for metering requests according to a usage + plan. Valid values are: >`HEADER` to read the API key from the + `X-API-Key` header of a request. `AUTHORIZER` to read the API key from + the `UsageIdentifierKey` from a custom authorizer. + """ + endpoint_configuration: EndpointConfiguration | None = ... + """ + The endpoint configuration of this RestApi showing the endpoint types + and IP address types of the API. + """ + policy: str | None = ... + """ + A stringified JSON policy document that applies to this RestApi + regardless of the caller and Method configuration. + """ + tags: dict[str, str] | None = ... + """ + The collection of tags. Each tag element is associated with a given + resource. + """ + disable_execute_api_endpoint: bool = ... + """ + Specifies whether clients can invoke your API by using the default + `execute-api` endpoint. By default, clients can invoke your API with the + default `https://{api_id}.execute-api.{region}.amazonaws.com` endpoint. + To require that clients use a custom domain name to invoke your API, + disable the default endpoint. + """ + root_resource_id: str | None = ... + """The API's root resource ID.""" + security_policy: str | None = ... + """ + The Transport Layer Security (TLS) version + cipher suite for this + RestApi. + """ + endpoint_access_mode: str | None = ... + """The endpoint access mode of the RestApi.""" + api_status: str | None = ... + """The ApiStatus of the RestApi.""" + api_status_message: str | None = ... + """ + The status message of the RestApi. When the status message is `UPDATING` + you can still invoke it. + """ + +class RoutingMode(UnknownEnumMixin, StrEnum): + BASE_PATH_MAPPING_ONLY = "BASE_PATH_MAPPING_ONLY" + ROUTING_RULE_ONLY = "ROUTING_RULE_ONLY" + ROUTING_RULE_THEN_BASE_PATH_MAPPING = "ROUTING_RULE_THEN_BASE_PATH_MAPPING" + +@dataclass(kw_only=True) +class SdkConfigurationProperty(_SerdeShape): + """A configuration property of an SDK type.""" + + name: str | None = ... + """The name of a an SdkType configuration property.""" + friendly_name: str | None = ... + """The user-friendly name of an SdkType configuration property.""" + description: str | None = ... + """The description of an SdkType configuration property.""" + required: bool = ... + """ + A boolean flag of an SdkType configuration property to indicate if the + associated SDK configuration property is required (`true`) or not + (`false`). + """ + default_value: str | None = ... + """The default value of an SdkType configuration property.""" + +@dataclass(kw_only=True) +class SdkType(_SerdeShape): + """A type of SDK that API Gateway can generate.""" + + id: str | None = ... + """The identifier of an SdkType instance.""" + friendly_name: str | None = ... + """The user-friendly name of an SdkType instance.""" + description: str | None = ... + """The description of an SdkType.""" + configuration_properties: list[SdkConfigurationProperty] | None = ... + """A list of configuration properties of an SdkType.""" + +class SecurityPolicy(UnknownEnumMixin, StrEnum): + TLS_1_0 = "TLS_1_0" + TLS_1_2 = "TLS_1_2" + SECURITY_POLICY_TLS13_1_3_2025_09 = "SecurityPolicy_TLS13_1_3_2025_09" + SECURITY_POLICY_TLS13_1_3_FIPS_2025_09 = "SecurityPolicy_TLS13_1_3_FIPS_2025_09" + SECURITY_POLICY_TLS13_1_2_PFS_PQ_2025_09 = "SecurityPolicy_TLS13_1_2_PFS_PQ_2025_09" + SECURITY_POLICY_TLS13_1_2_FIPS_PQ_2025_09 = ( + "SecurityPolicy_TLS13_1_2_FIPS_PQ_2025_09" + ) + SECURITY_POLICY_TLS13_1_2_FIPS_PFS_PQ_2025_09 = ( + "SecurityPolicy_TLS13_1_2_FIPS_PFS_PQ_2025_09" + ) + SECURITY_POLICY_TLS13_1_2_EXT2_PQ_2025_09 = ( + "SecurityPolicy_TLS13_1_2_Ext2_PQ_2025_09" + ) + SECURITY_POLICY_TLS13_1_2_EXT2_FIPS_PQ_2025_09 = ( + "SecurityPolicy_TLS13_1_2_Ext2_FIPS_PQ_2025_09" + ) + SECURITY_POLICY_TLS13_1_2_PQ_2025_09 = "SecurityPolicy_TLS13_1_2_PQ_2025_09" + SECURITY_POLICY_TLS13_1_2_2021_06 = "SecurityPolicy_TLS13_1_2_2021_06" + SECURITY_POLICY_TLS13_2025_EDGE = "SecurityPolicy_TLS13_2025_EDGE" + SECURITY_POLICY_TLS12_PFS_2025_EDGE = "SecurityPolicy_TLS12_PFS_2025_EDGE" + SECURITY_POLICY_TLS12_2018_EDGE = "SecurityPolicy_TLS12_2018_EDGE" + +@dataclass(kw_only=True) +class ServiceUnavailableException(ServiceError, _SerdeShape): + """ + The requested service is not available. For details see the accompanying + error message. Retry after the specified time period. + """ + + retry_after_seconds: str | None = ... + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class Stage(_SerdeShape): + """ + Represents a unique identifier for a version of a deployed RestApi that + is callable by users. + """ + + deployment_id: str | None = ... + """The identifier of the Deployment that the stage points to.""" + client_certificate_id: str | None = ... + """The identifier of a client certificate for an API stage.""" + stage_name: str | None = ... + """ + The name of the stage is the first path segment in the Uniform Resource + Identifier (URI) of a call to API Gateway. Stage names can only contain + alphanumeric characters, hyphens, and underscores. Maximum length is 128 + characters. + """ + description: str | None = ... + """The stage's description.""" + cache_cluster_enabled: bool = ... + """ + Specifies whether a cache cluster is enabled for the stage. To activate + a method-level cache, set `CachingEnabled` to `true` for a method. + """ + cache_cluster_size: str | None = ... + """ + The stage's cache capacity in GB. For more information about choosing a + cache size, see [Enabling API caching to enhance + responsiveness](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html). + """ + cache_cluster_status: str | None = ... + """The status of the cache cluster for the stage, if enabled.""" + method_settings: dict[str, MethodSetting] | None = ... + """ + A map that defines the method settings for a Stage resource. Keys + (designated as `/{method_setting_key` below) are method paths defined as + `{resource_path}/{http_method}` for an individual method override, or + `/*/*` for overriding all methods in the stage. + """ + variables: dict[str, str] | None = ... + """ + A map that defines the stage variables for a Stage resource. Variable + names can have alphanumeric and underscore characters, and the values + must match `[A-Za-z0-9-._~:/?#&=,]+`. + """ + documentation_version: str | None = ... + """The version of the associated API documentation.""" + access_log_settings: AccessLogSettings | None = ... + """Settings for logging access in this stage.""" + canary_settings: CanarySettings | None = ... + """Settings for the canary deployment in this stage.""" + tracing_enabled: bool = ... + """Specifies whether active tracing with X-ray is enabled for the Stage.""" + web_acl_arn: str | None = ... + """The ARN of the WebAcl associated with the Stage.""" + tags: dict[str, str] | None = ... + """ + The collection of tags. Each tag element is associated with a given + resource. + """ + created_date: datetime | None = ... + """The timestamp when the stage was created.""" + last_updated_date: datetime | None = ... + """The timestamp when the stage last updated.""" + +@dataclass(kw_only=True) +class StageKey(_SerdeShape): + """ + A reference to a unique stage identified in the format + `{restApiId}/{stage}`. + """ + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + stage_name: str | None = ... + """The stage name associated with the stage key.""" + +@dataclass(kw_only=True) +class TagResourceInput(_SerdeShape): + """Adds or updates a tag on a given resource.""" + + resource_arn: str | None = ... + """The ARN of a resource that can be tagged.""" + tags: dict[str, str] | None = ... + """ + The key-value map of strings. The valid character set is + [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not + start with `aws:`. The tag value can be up to 256 characters. + """ + +@dataclass(kw_only=True) +class TagResourceOutput(_SerdeShape): + """Dataclass for TagResourceOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class TestInvokeAuthorizerInput(_SerdeShape): + """Make a request to simulate the invocation of an Authorizer.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + authorizer_id: str | None = ... + """Specifies a test invoke authorizer request's Authorizer ID.""" + headers: dict[str, str] | None = ... + """ + A key-value map of headers to simulate an incoming invocation request. + This is where the incoming authorization token, or identity source, + should be specified. + """ + multi_value_headers: dict[str, list[str]] | None = ... + """ + The headers as a map from string to list of values to simulate an + incoming invocation request. This is where the incoming authorization + token, or identity source, may be specified. + """ + path_with_query_string: str | None = ... + """ + The URI path, including query string, of the simulated invocation + request. Use this to specify path parameters and query string + parameters. + """ + body: str | None = ... + """The simulated request body of an incoming invocation request.""" + stage_variables: dict[str, str] | None = ... + """ + A key-value map of stage variables to simulate an invocation on a + deployed Stage. + """ + additional_context: dict[str, str] | None = ... + """A key-value map of additional context variables.""" + +@dataclass(kw_only=True) +class TestInvokeAuthorizerOutput(_SerdeShape): + """ + Represents the response of the test invoke request for a custom + Authorizer + """ + + client_status: int = ... + """ + The HTTP status code that the client would have received. Value is 0 if + the authorizer succeeded. + """ + log: str | None = ... + """The API Gateway execution log for the test authorizer request.""" + latency: int = ... + """The execution latency, in ms, of the test authorizer request.""" + principal_id: str | None = ... + """The principal identity returned by the Authorizer""" + policy: str | None = ... + """The JSON policy document returned by the Authorizer""" + authorization: dict[str, list[str]] | None = ... + """The authorization response.""" + claims: dict[str, str] | None = ... + """ + The open identity claims, with any supported custom attributes, returned + from the Cognito Your User Pool configured for the API. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class TestInvokeMethodInput(_SerdeShape): + """Make a request to simulate the invocation of a Method.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + resource_id: str | None = ... + """Specifies a test invoke method request's resource ID.""" + http_method: str | None = ... + """Specifies a test invoke method request's HTTP method.""" + path_with_query_string: str | None = ... + """ + The URI path, including query string, of the simulated invocation + request. Use this to specify path parameters and query string + parameters. + """ + body: str | None = ... + """The simulated request body of an incoming invocation request.""" + headers: dict[str, str] | None = ... + """A key-value map of headers to simulate an incoming invocation request.""" + multi_value_headers: dict[str, list[str]] | None = ... + """ + The headers as a map from string to list of values to simulate an + incoming invocation request. + """ + client_certificate_id: str | None = ... + """ + A ClientCertificate identifier to use in the test invocation. API + Gateway will use the certificate when making the HTTPS request to the + defined back-end endpoint. + """ + stage_variables: dict[str, str] | None = ... + """ + A key-value map of stage variables to simulate an invocation on a + deployed Stage. + """ + +@dataclass(kw_only=True) +class TestInvokeMethodOutput(_SerdeShape): + """Represents the response of the test invoke request in the HTTP method.""" + + status: int = ... + """The HTTP status code.""" + body: str | None = ... + """The body of the HTTP response.""" + headers: dict[str, str] | None = ... + """The headers of the HTTP response.""" + multi_value_headers: dict[str, list[str]] | None = ... + """The headers of the HTTP response as a map from string to list of values.""" + log: str | None = ... + """The API Gateway execution log for the test invoke request.""" + latency: int = ... + """The execution latency, in ms, of the test invoke request.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ThrottleSettings(_SerdeShape): + """The API request rate limits.""" + + burst_limit: int = ... + """ + The API target request burst rate limit. This allows more requests + through for a period of time than the target rate limit. + """ + rate_limit: float = ... + """The API target request rate limit.""" + +@dataclass(kw_only=True) +class TlsConfig(_SerdeShape): + """Specifies the TLS configuration for an integration.""" + + insecure_skip_verification: bool = ... + """ + Specifies whether or not API Gateway skips verification that the + certificate for an integration endpoint is issued by a supported + certificate authority. This isn't recommended, but it enables you to use + certificates that are signed by private certificate authorities, or + certificates that are self-signed. If enabled, API Gateway still + performs basic certificate validation, which includes checking the + certificate's expiration date, hostname, and presence of a root + certificate authority. Supported only for `HTTP` and `HTTP_PROXY` + integrations. + + Warning: + Enabling `insecureSkipVerification` isn't recommended, especially for + integrations with public HTTPS endpoints. If you enable + `insecureSkipVerification`, you increase the risk of man-in-the-middle + attacks. + """ + +@dataclass(kw_only=True) +class TooManyRequestsException(ServiceError, _SerdeShape): + """ + The request has reached its throttling limit. Retry after the specified + time period. + """ + + retry_after_seconds: str | None = ... + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class UnauthorizedCacheControlHeaderStrategy(UnknownEnumMixin, StrEnum): + FAIL_WITH_403 = "FAIL_WITH_403" + SUCCEED_WITH_RESPONSE_HEADER = "SUCCEED_WITH_RESPONSE_HEADER" + SUCCEED_WITHOUT_RESPONSE_HEADER = "SUCCEED_WITHOUT_RESPONSE_HEADER" + +@dataclass(kw_only=True) +class UnauthorizedException(ServiceError, _SerdeShape): + """The request is denied because the caller has insufficient permissions.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UntagResourceInput(_SerdeShape): + """Removes a tag from a given resource.""" + + resource_arn: str | None = ... + """The ARN of a resource that can be tagged.""" + tag_keys: list[str] | None = ... + """The Tag keys to delete.""" + +@dataclass(kw_only=True) +class UntagResourceOutput(_SerdeShape): + """Dataclass for UntagResourceOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateAccountInput(_SerdeShape): + """ + Requests API Gateway to change information about the current Account + resource. + """ + + patch_operations: list[PatchOperation] | None = ... + """ + For more information about supported patch operations, see [Patch + Operations](https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html). + """ + +@dataclass(kw_only=True) +class UpdateAccountOutput(_SerdeShape): + """Represents an AWS account that is associated with API Gateway.""" + + cloudwatch_role_arn: str | None = ... + """The ARN of an Amazon CloudWatch role for the current Account.""" + throttle_settings: ThrottleSettings | None = ... + """Specifies the API request limits configured for the current Account.""" + features: list[str] | None = ... + """ + A list of features supported for the account. When usage plans are + enabled, the features list will include an entry of `"UsagePlans"`. + """ + api_key_version: str | None = ... + """The version of the API keys used for the account.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateApiKeyInput(_SerdeShape): + """A request to change information about an ApiKey resource.""" + + api_key: str | None = ... + """The identifier of the ApiKey resource to be updated.""" + patch_operations: list[PatchOperation] | None = ... + """ + For more information about supported patch operations, see [Patch + Operations](https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html). + """ + +@dataclass(kw_only=True) +class UpdateApiKeyOutput(_SerdeShape): + """ + A resource that can be distributed to callers for executing Method + resources that require an API key. API keys can be mapped to any Stage + on any RestApi, which indicates that the callers with the API key can + make requests to that stage. + """ + + id: str | None = ... + """The identifier of the API Key.""" + value: str | None = ... + """The value of the API Key.""" + name: str | None = ... + """The name of the API Key.""" + customer_id: str | None = ... + """ + An Amazon Web Services Marketplace customer identifier, when integrating + with the Amazon Web Services SaaS Marketplace. + """ + description: str | None = ... + """The description of the API Key.""" + enabled: bool = ... + """Specifies whether the API Key can be used by callers.""" + created_date: datetime | None = ... + """The timestamp when the API Key was created.""" + last_updated_date: datetime | None = ... + """The timestamp when the API Key was last updated.""" + stage_keys: list[str] | None = ... + """A list of Stage resources that are associated with the ApiKey resource.""" + tags: dict[str, str] | None = ... + """ + The collection of tags. Each tag element is associated with a given + resource. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateAuthorizerInput(_SerdeShape): + """Request to update an existing Authorizer resource.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + authorizer_id: str | None = ... + """The identifier of the Authorizer resource.""" + patch_operations: list[PatchOperation] | None = ... + """ + For more information about supported patch operations, see [Patch + Operations](https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html). + """ + +@dataclass(kw_only=True) +class UpdateAuthorizerOutput(_SerdeShape): + """ + Represents an authorization layer for methods. If enabled on a method, + API Gateway will activate the authorizer when a client calls the method. + """ + + id: str | None = ... + """The identifier for the authorizer resource.""" + name: str | None = ... + """The name of the authorizer.""" + type: str | None = ... + """ + The authorizer type. Valid values are `TOKEN` for a Lambda function + using a single authorization token submitted in a custom header, + `REQUEST` for a Lambda function using incoming request parameters, and + `COGNITO_USER_POOLS` for using an Amazon Cognito user pool. + """ + provider_ar_ns: list[str] | None = ... + """ + A list of the Amazon Cognito user pool ARNs for the `COGNITO_USER_POOLS` + authorizer. Each element is of this format: + `arn:aws:cognito-idp:{region}:{account_id}:userpool/{user_pool_id}`. For + a `TOKEN` or `REQUEST` authorizer, this is not defined. + """ + auth_type: str | None = ... + """ + Optional customer-defined field, used in OpenAPI imports and exports + without functional impact. + """ + authorizer_uri: str | None = ... + """ + Specifies the authorizer's Uniform Resource Identifier (URI). For + `TOKEN` or `REQUEST` authorizers, this must be a well-formed Lambda + function URI, for example, + `arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:{account_id}:function:{lambda_function_name}/invocations`. + In general, the URI has this form + `arn:aws:apigateway:{region}:lambda:path/{service_api}`, where + `{region}` is the same as the region hosting the Lambda function, `path` + indicates that the remaining substring in the URI should be treated as + the path to the resource, including the initial `/`. For Lambda + functions, this is usually of the form + `/2015-03-31/functions/[FunctionARN]/invocations`. + """ + authorizer_credentials: str | None = ... + """ + Specifies the required credentials as an IAM role for API Gateway to + invoke the authorizer. To specify an IAM role for API Gateway to assume, + use the role's Amazon Resource Name (ARN). To use resource-based + permissions on the Lambda function, specify null. + """ + identity_source: str | None = ... + """ + The identity source for which authorization is requested. For a `TOKEN` + or `COGNITO_USER_POOLS` authorizer, this is required and specifies the + request header mapping expression for the custom header holding the + authorization token submitted by the client. For example, if the token + header name is `Auth`, the header mapping expression is + `method.request.header.Auth`. For the `REQUEST` authorizer, this is + required when authorization caching is enabled. The value is a + comma-separated string of one or more mapping expressions of the + specified request parameters. For example, if an `Auth` header, a `Name` + query string parameter are defined as identity sources, this value is + `method.request.header.Auth`, `method.request.querystring.Name`. These + parameters will be used to derive the authorization caching key and to + perform runtime validation of the `REQUEST` authorizer by verifying all + of the identity-related request parameters are present, not null and + non-empty. Only when this is true does the authorizer invoke the + authorizer Lambda function, otherwise, it returns a 401 Unauthorized + response without calling the Lambda function. The valid value is a + string of comma-separated mapping expressions of the specified request + parameters. When the authorization caching is not enabled, this property + is optional. + """ + identity_validation_expression: str | None = ... + """ + A validation expression for the incoming identity token. For `TOKEN` + authorizers, this value is a regular expression. For + `COGNITO_USER_POOLS` authorizers, API Gateway will match the `aud` field + of the incoming token from the client against the specified regular + expression. It will invoke the authorizer's Lambda function when there + is a match. Otherwise, it will return a 401 Unauthorized response + without calling the Lambda function. The validation expression does not + apply to the `REQUEST` authorizer. + """ + authorizer_result_ttl_in_seconds: int | None = ... + """ + The TTL in seconds of cached authorizer results. If it equals 0, + authorization caching is disabled. If it is greater than 0, API Gateway + will cache authorizer responses. If this field is not set, the default + value is 300. The maximum value is 3600, or 1 hour. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateBasePathMappingInput(_SerdeShape): + """A request to change information about the BasePathMapping resource.""" + + domain_name: str | None = ... + """The domain name of the BasePathMapping resource to change.""" + domain_name_id: str | None = ... + """ + The identifier for the domain name resource. Supported only for private + custom domain names. + """ + base_path: str | None = ... + """ + The base path of the BasePathMapping resource to change. + + To specify an empty base path, set this parameter to `'(none)'`. + """ + patch_operations: list[PatchOperation] | None = ... + """ + For more information about supported patch operations, see [Patch + Operations](https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html). + """ + +@dataclass(kw_only=True) +class UpdateBasePathMappingOutput(_SerdeShape): + """ + Represents the base path that callers of the API must provide as part of + the URL after the domain name. + """ + + base_path: str | None = ... + """ + The base path name that callers of the API must provide as part of the + URL after the domain name. + """ + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + stage: str | None = ... + """The name of the associated stage.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateClientCertificateInput(_SerdeShape): + """A request to change information about an ClientCertificate resource.""" + + client_certificate_id: str | None = ... + """The identifier of the ClientCertificate resource to be updated.""" + patch_operations: list[PatchOperation] | None = ... + """ + For more information about supported patch operations, see [Patch + Operations](https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html). + """ + +@dataclass(kw_only=True) +class UpdateClientCertificateOutput(_SerdeShape): + """ + Represents a client certificate used to configure client-side SSL + authentication while sending requests to the integration endpoint. + """ + + client_certificate_id: str | None = ... + """The identifier of the client certificate.""" + description: str | None = ... + """The description of the client certificate.""" + pem_encoded_certificate: str | None = ... + """ + The PEM-encoded public key of the client certificate, which can be used + to configure certificate authentication in the integration endpoint . + """ + created_date: datetime | None = ... + """The timestamp when the client certificate was created.""" + expiration_date: datetime | None = ... + """The timestamp when the client certificate will expire.""" + tags: dict[str, str] | None = ... + """ + The collection of tags. Each tag element is associated with a given + resource. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateDeploymentInput(_SerdeShape): + """Requests API Gateway to change information about a Deployment resource.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + deployment_id: str | None = ... + """ + The replacement identifier for the Deployment resource to change + information about. + """ + patch_operations: list[PatchOperation] | None = ... + """ + For more information about supported patch operations, see [Patch + Operations](https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html). + """ + +@dataclass(kw_only=True) +class UpdateDeploymentOutput(_SerdeShape): + """ + An immutable representation of a RestApi resource that can be called by + users using Stages. A deployment must be associated with a Stage for it + to be callable over the Internet. + """ + + id: str | None = ... + """The identifier for the deployment resource.""" + description: str | None = ... + """The description for the deployment resource.""" + created_date: datetime | None = ... + """The date and time that the deployment resource was created.""" + api_summary: dict[str, dict[str, MethodSnapshot]] | None = ... + """ + A summary of the RestApi at the date and time that the deployment + resource was created. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateDocumentationPartInput(_SerdeShape): + """Updates an existing documentation part of a given API.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + documentation_part_id: str | None = ... + """The identifier of the to-be-updated documentation part.""" + patch_operations: list[PatchOperation] | None = ... + """ + For more information about supported patch operations, see [Patch + Operations](https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html). + """ + +@dataclass(kw_only=True) +class UpdateDocumentationPartOutput(_SerdeShape): + """A documentation part for a targeted API entity.""" + + id: str | None = ... + """ + The DocumentationPart identifier, generated by API Gateway when the + `DocumentationPart` is created. + """ + location: DocumentationPartLocation | None = ... + """ + The location of the API entity to which the documentation applies. Valid + fields depend on the targeted API entity type. All the valid location + fields are not required. If not explicitly specified, a valid location + field is treated as a wildcard and associated documentation content may + be inherited by matching entities, unless overridden. + """ + properties: str | None = ... + """ + A content map of API-specific key-value pairs describing the targeted + API entity. The map must be encoded as a JSON string, e.g., + `"{ \"description\": \"The API does ...\" }"`. Only OpenAPI-compliant + documentation-related fields from the properties map are exported and, + hence, published as part of the API entity definitions, while the + original documentation parts are exported in a OpenAPI extension of + `x-amazon-apigateway-documentation`. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateDocumentationVersionInput(_SerdeShape): + """Updates an existing documentation version of an API.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + documentation_version: str | None = ... + """The version identifier of the to-be-updated documentation version.""" + patch_operations: list[PatchOperation] | None = ... + """ + For more information about supported patch operations, see [Patch + Operations](https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html). + """ + +@dataclass(kw_only=True) +class UpdateDocumentationVersionOutput(_SerdeShape): + """A snapshot of the documentation of an API.""" + + version: str | None = ... + """The version identifier of the API documentation snapshot.""" + created_date: datetime | None = ... + """The date when the API documentation snapshot is created.""" + description: str | None = ... + """The description of the API documentation snapshot.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateDomainNameInput(_SerdeShape): + """A request to change information about the DomainName resource.""" + + domain_name: str | None = ... + """The name of the DomainName resource to be changed.""" + domain_name_id: str | None = ... + """ + The identifier for the domain name resource. Supported only for private + custom domain names. + """ + patch_operations: list[PatchOperation] | None = ... + """ + For more information about supported patch operations, see [Patch + Operations](https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html). + """ + +@dataclass(kw_only=True) +class UpdateDomainNameOutput(_SerdeShape): + """ + Represents a custom domain name as a user-friendly host name of an API + (RestApi). + """ + + domain_name: str | None = ... + """ + The custom domain name as an API host name, for example, + `my-api.example.com`. + """ + domain_name_id: str | None = ... + """ + The identifier for the domain name resource. Supported only for private + custom domain names. + """ + domain_name_arn: str | None = ... + """The ARN of the domain name.""" + certificate_name: str | None = ... + """ + The name of the certificate that will be used by edge-optimized endpoint + or private endpoint for this domain name. + """ + certificate_arn: str | None = ... + """ + The reference to an Amazon Web Services-managed certificate that will be + used by edge-optimized endpoint or private endpoint for this domain + name. Certificate Manager is the only supported source. + """ + certificate_upload_date: datetime | None = ... + """ + The timestamp when the certificate that was used by edge-optimized + endpoint or private endpoint for this domain name was uploaded. + """ + regional_domain_name: str | None = ... + """ + The domain name associated with the regional endpoint for this custom + domain name. You set up this association by adding a DNS record that + points the custom domain name to this regional domain name. The regional + domain name is returned by API Gateway when you create a regional + endpoint. + """ + regional_hosted_zone_id: str | None = ... + """ + The region-specific Amazon Route 53 Hosted Zone ID of the regional + endpoint. For more information, see Set up a Regional Custom Domain Name + and AWS Regions and Endpoints for API Gateway. + """ + regional_certificate_name: str | None = ... + """ + The name of the certificate that will be used for validating the + regional domain name. + """ + regional_certificate_arn: str | None = ... + """ + The reference to an Amazon Web Services-managed certificate that will be + used for validating the regional domain name. Certificate Manager is the + only supported source. + """ + distribution_domain_name: str | None = ... + """ + The domain name of the Amazon CloudFront distribution associated with + this custom domain name for an edge-optimized endpoint. You set up this + association when adding a DNS record pointing the custom domain name to + this distribution name. For more information about CloudFront + distributions, see the Amazon CloudFront documentation. + """ + distribution_hosted_zone_id: str | None = ... + """ + The region-agnostic Amazon Route 53 Hosted Zone ID of the edge-optimized + endpoint. The valid value is `Z2FDTNDATAQYW2` for all the regions. For + more information, see Set up a Regional Custom Domain Name and AWS + Regions and Endpoints for API Gateway. + """ + endpoint_configuration: EndpointConfiguration | None = ... + """ + The endpoint configuration of this DomainName showing the endpoint types + and IP address types of the domain name. + """ + domain_name_status: str | None = ... + """ + The status of the DomainName migration. The valid values are `AVAILABLE` + and `UPDATING`. If the status is `UPDATING`, the domain cannot be + modified further until the existing operation is complete. If it is + `AVAILABLE`, the domain can be updated. + """ + domain_name_status_message: str | None = ... + """ + An optional text message containing detailed information about status of + the DomainName migration. + """ + security_policy: str | None = ... + """ + The Transport Layer Security (TLS) version + cipher suite for this + DomainName. + """ + endpoint_access_mode: str | None = ... + """The endpoint access mode of the DomainName.""" + tags: dict[str, str] | None = ... + """ + The collection of tags. Each tag element is associated with a given + resource. + """ + mutual_tls_authentication: MutualTlsAuthentication | None = ... + """ + The mutual TLS authentication configuration for a custom domain name. If + specified, API Gateway performs two-way authentication between the + client and the server. Clients must present a trusted certificate to + access your API. + """ + ownership_verification_certificate_arn: str | None = ... + """ + The ARN of the public certificate issued by ACM to validate ownership of + your custom domain. Only required when configuring mutual TLS and using + an ACM imported or private CA certificate ARN as the + regionalCertificateArn. + """ + management_policy: str | None = ... + """ + A stringified JSON policy document that applies to the API Gateway + Management service for this DomainName. This policy document controls + access for access association sources to create domain name access + associations with this DomainName. Supported only for private custom + domain names. + """ + policy: str | None = ... + """ + A stringified JSON policy document that applies to the `execute-api` + service for this DomainName regardless of the caller and Method + configuration. Supported only for private custom domain names. + """ + routing_mode: str | None = ... + """ + The routing mode for this domain name. The routing mode determines how + API Gateway sends traffic from your custom domain name to your private + APIs. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateGatewayResponseInput(_SerdeShape): + """ + Updates a GatewayResponse of a specified response type on the given + RestApi. + """ + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + response_type: str | None = ... + """The response type of the associated GatewayResponse.""" + patch_operations: list[PatchOperation] | None = ... + """ + For more information about supported patch operations, see [Patch + Operations](https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html). + """ + +@dataclass(kw_only=True) +class UpdateGatewayResponseOutput(_SerdeShape): + """ + A gateway response of a given response type and status code, with + optional response parameters and mapping templates. + """ + + response_type: str | None = ... + """The response type of the associated GatewayResponse.""" + status_code: str | None = ... + """The HTTP status code for this GatewayResponse.""" + response_parameters: dict[str, str] | None = ... + """ + Response parameters (paths, query strings and headers) of the + GatewayResponse as a string-to-string map of key-value pairs. + """ + response_templates: dict[str, str] | None = ... + """ + Response templates of the GatewayResponse as a string-to-string map of + key-value pairs. + """ + default_response: bool = ... + """ + A Boolean flag to indicate whether this GatewayResponse is the default + gateway response (`true`) or not (`false`). A default gateway response + is one generated by API Gateway without any customization by an API + developer. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateIntegrationInput(_SerdeShape): + """Represents an update integration request.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + resource_id: str | None = ... + """Represents an update integration request's resource identifier.""" + http_method: str | None = ... + """Represents an update integration request's HTTP method.""" + patch_operations: list[PatchOperation] | None = ... + """ + For more information about supported patch operations, see [Patch + Operations](https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html). + """ + +@dataclass(kw_only=True) +class UpdateIntegrationOutput(_SerdeShape): + """ + Represents an `HTTP`, `HTTP_PROXY`, `AWS`, `AWS_PROXY`, or Mock + integration. + """ + + type: str | None = ... + """ + Specifies an API method integration type. The valid value is one of the + following: + + For the HTTP and HTTP proxy integrations, each integration can specify a + protocol (`http/https`), port and path. Standard 80 and 443 ports are + supported as well as custom ports above 1024. An HTTP or HTTP proxy + integration with a `connectionType` of `VPC_LINK` is referred to as a + private integration and uses a VpcLink to connect API Gateway to a + network load balancer of a VPC. + """ + http_method: str | None = ... + """ + Specifies the integration's HTTP method type. For the Type property, if + you specify `MOCK`, this property is optional. For Lambda integrations, + you must set the integration method to `POST`. For all other types, you + must specify this property. + """ + uri: str | None = ... + """ + Specifies Uniform Resource Identifier (URI) of the integration endpoint. + + For `HTTP` or `HTTP_PROXY` integrations, the URI must be a fully formed, + encoded HTTP(S) URL according to the RFC-3986 specification for standard + integrations. If `connectionType` is `VPC_LINK` specify the Network Load + Balancer DNS name. For `AWS` or `AWS_PROXY` integrations, the URI is of + the form + `arn:aws:apigateway:{region}:{subdomain.service|service}:path|action/{service_api}`. + Here, {Region} is the API Gateway region (e.g., us-east-1); {service} is + the name of the integrated Amazon Web Services service (e.g., s3); and + {subdomain} is a designated subdomain supported by certain Amazon Web + Services service for fast host-name lookup. action can be used for an + Amazon Web Services service action-based API, using an + Action={name}&{p1}={v1}&p2={v2}... query string. The ensuing + {service_api} refers to a supported action {name} plus any required + input parameters. Alternatively, path can be used for an Amazon Web + Services service path-based API. The ensuing service_api refers to the + path to an Amazon Web Services service resource, including the region of + the integrated Amazon Web Services service, if applicable. For example, + for integration with the S3 API of GetObject, the uri can be either + `arn:aws:apigateway:us-west-2:s3:action/GetObject&Bucket={bucket}&Key={key}` + or `arn:aws:apigateway:us-west-2:s3:path/{bucket}/{key}` + """ + connection_type: str | None = ... + """ + The type of the network connection to the integration endpoint. The + valid value is `INTERNET` for connections through the public routable + internet or `VPC_LINK` for private connections between API Gateway and a + network load balancer in a VPC. The default value is `INTERNET`. + """ + connection_id: str | None = ... + """ + The ID of the VpcLink used for the integration when + `connectionType=VPC_LINK` and undefined, otherwise. + """ + credentials: str | None = ... + """ + Specifies the credentials required for the integration, if any. For AWS + integrations, three options are available. To specify an IAM Role for + API Gateway to assume, use the role's Amazon Resource Name (ARN). To + require that the caller's identity be passed through from the request, + specify the string `arn:aws:iam::*:user/*`. To use resource-based + permissions on supported Amazon Web Services services, specify null. + """ + request_parameters: dict[str, str] | None = ... + """ + A key-value map specifying request parameters that are passed from the + method request to the back end. The key is an integration request + parameter name and the associated value is a method request parameter + value or static value that must be enclosed within single quotes and + pre-encoded as required by the back end. The method request parameter + value must match the pattern of `method.request.{location}.{name}`, + where `location` is `querystring`, `path`, or `header` and `name` must + be a valid and unique method request parameter name. + """ + request_templates: dict[str, str] | None = ... + """ + Represents a map of Velocity templates that are applied on the request + payload based on the value of the Content-Type header sent by the + client. The content type value is the key in this map, and the template + (as a String) is the value. + """ + passthrough_behavior: str | None = ... + """ + Specifies how the method request body of an unmapped content type will + be passed through the integration request to the back end without + transformation. A content type is unmapped if no mapping template is + defined in the integration or the content type does not match any of the + mapped content types, as specified in `requestTemplates`. The valid + value is one of the following: `WHEN_NO_MATCH`: passes the method + request body through the integration request to the back end without + transformation when the method request content type does not match any + content type associated with the mapping templates defined in the + integration request. `WHEN_NO_TEMPLATES`: passes the method request body + through the integration request to the back end without transformation + when no mapping template is defined in the integration request. If a + template is defined when this option is selected, the method request of + an unmapped content-type will be rejected with an HTTP 415 Unsupported + Media Type response. `NEVER`: rejects the method request with an HTTP + 415 Unsupported Media Type response when either the method request + content type does not match any content type associated with the mapping + templates defined in the integration request or no mapping template is + defined in the integration request. + """ + content_handling: str | None = ... + """ + Specifies how to handle request payload content type conversions. + Supported values are `CONVERT_TO_BINARY` and `CONVERT_TO_TEXT`, with the + following behaviors: + + If this property is not defined, the request payload will be passed + through from the method request to integration request without + modification, provided that the `passthroughBehavior` is configured to + support payload pass-through. + """ + timeout_in_millis: int = ... + """ + Custom timeout between 50 and 29,000 milliseconds. The default value is + 29,000 milliseconds or 29 seconds. You can increase the default value to + longer than 29 seconds for Regional or private APIs only. + """ + cache_namespace: str | None = ... + """ + Specifies a group of related cached parameters. By default, API Gateway + uses the resource ID as the `cacheNamespace`. You can specify the same + `cacheNamespace` across resources to return the same cached data for + requests to different resources. + """ + cache_key_parameters: list[str] | None = ... + """ + A list of request parameters whose values API Gateway caches. To be + valid values for `cacheKeyParameters`, these parameters must also be + specified for Method `requestParameters`. + """ + integration_responses: dict[str, IntegrationResponse] | None = ... + """Specifies the integration's responses.""" + tls_config: TlsConfig | None = ... + """Specifies the TLS configuration for an integration.""" + response_transfer_mode: str | None = ... + """The response transfer mode of the integration.""" + integration_target: str | None = ... + """The ALB or NLB listener to send the request to.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateIntegrationResponseInput(_SerdeShape): + """Represents an update integration response request.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + resource_id: str | None = ... + """Specifies an update integration response request's resource identifier.""" + http_method: str | None = ... + """Specifies an update integration response request's HTTP method.""" + status_code: str | None = ... + """Specifies an update integration response request's status code.""" + patch_operations: list[PatchOperation] | None = ... + """ + For more information about supported patch operations, see [Patch + Operations](https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html). + """ + +@dataclass(kw_only=True) +class UpdateIntegrationResponseOutput(_SerdeShape): + """ + Represents an integration response. The status code must map to an + existing MethodResponse, and parameters and templates can be used to + transform the back-end response. + """ + + status_code: str | None = ... + """ + Specifies the status code that is used to map the integration response + to an existing MethodResponse. + """ + selection_pattern: str | None = ... + """ + Specifies the regular expression (regex) pattern used to choose an + integration response based on the response from the back end. For + example, if the success response returns nothing and the error response + returns some string, you could use the `.+` regex to match error + response. However, make sure that the error response does not contain + any newline (`\n`) character in such cases. If the back end is an Lambda + function, the Lambda function error header is matched. For all other + HTTP and Amazon Web Services back ends, the HTTP status code is matched. + """ + response_parameters: dict[str, str] | None = ... + """ + A key-value map specifying response parameters that are passed to the + method response from the back end. The key is a method response header + parameter name and the mapped value is an integration response header + value, a static value enclosed within a pair of single quotes, or a JSON + expression from the integration response body. The mapping key must + match the pattern of `method.response.header.{name}`, where `name` is a + valid and unique header name. The mapped non-static value must match the + pattern of `integration.response.header.{name}` or + `integration.response.body.{JSON-expression}`, where `name` is a valid + and unique response header name and `JSON-expression` is a valid JSON + expression without the `$` prefix. + """ + response_templates: dict[str, str] | None = ... + """ + Specifies the templates used to transform the integration response body. + Response templates are represented as a key/value map, with a + content-type as the key and a template as the value. + """ + content_handling: str | None = ... + """ + Specifies how to handle response payload content type conversions. + Supported values are `CONVERT_TO_BINARY` and `CONVERT_TO_TEXT`, with the + following behaviors: + + If this property is not defined, the response payload will be passed + through from the integration response to the method response without + modification. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateMethodInput(_SerdeShape): + """Request to update an existing Method resource.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + resource_id: str | None = ... + """The Resource identifier for the Method resource.""" + http_method: str | None = ... + """The HTTP verb of the Method resource.""" + patch_operations: list[PatchOperation] | None = ... + """ + For more information about supported patch operations, see [Patch + Operations](https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html). + """ + +@dataclass(kw_only=True) +class UpdateMethodOutput(_SerdeShape): + """ + Represents a client-facing interface by which the client calls the API + to access back-end resources. A Method resource is integrated with an + Integration resource. Both consist of a request and one or more + responses. The method request takes the client input that is passed to + the back end through the integration request. A method response returns + the output from the back end to the client through an integration + response. A method request is embodied in a Method resource, whereas an + integration request is embodied in an Integration resource. On the other + hand, a method response is represented by a MethodResponse resource, + whereas an integration response is represented by an IntegrationResponse + resource. + """ + + http_method: str | None = ... + """The method's HTTP verb.""" + authorization_type: str | None = ... + """ + The method's authorization type. Valid values are `NONE` for open + access, `AWS_IAM` for using AWS IAM permissions, `CUSTOM` for using a + custom authorizer, or `COGNITO_USER_POOLS` for using a Cognito user + pool. + """ + authorizer_id: str | None = ... + """ + The identifier of an Authorizer to use on this method. The + `authorizationType` must be `CUSTOM`. + """ + api_key_required: bool | None = ... + """ + A boolean flag specifying whether a valid ApiKey is required to invoke + this method. + """ + request_validator_id: str | None = ... + """The identifier of a RequestValidator for request validation.""" + operation_name: str | None = ... + """ + A human-friendly operation identifier for the method. For example, you + can assign the `operationName` of `ListPets` for the `GET /pets` method + in the `PetStore` example. + """ + request_parameters: dict[str, bool] | None = ... + """ + A key-value map defining required or optional method request parameters + that can be accepted by API Gateway. A key is a method request parameter + name matching the pattern of `method.request.{location}.{name}`, where + `location` is `querystring`, `path`, or `header` and `name` is a valid + and unique parameter name. The value associated with the key is a + Boolean flag indicating whether the parameter is required (`true`) or + optional (`false`). The method request parameter names defined here are + available in Integration to be mapped to integration request parameters + or templates. + """ + request_models: dict[str, str] | None = ... + """ + A key-value map specifying data schemas, represented by Model resources, + (as the mapped value) of the request payloads of given content types (as + the mapping key). + """ + method_responses: dict[str, MethodResponse] | None = ... + """Gets a method response associated with a given HTTP status code.""" + method_integration: Integration | None = ... + """ + Gets the method's integration responsible for passing the + client-submitted request to the back end and performing necessary + transformations to make the request compliant with the back end. + """ + authorization_scopes: list[str] | None = ... + """ + A list of authorization scopes configured on the method. The scopes are + used with a `COGNITO_USER_POOLS` authorizer to authorize the method + invocation. The authorization works by matching the method scopes + against the scopes parsed from the access token in the incoming request. + The method invocation is authorized if any method scopes matches a + claimed scope in the access token. Otherwise, the invocation is not + authorized. When the method scope is configured, the client must provide + an access token instead of an identity token for authorization purposes. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateMethodResponseInput(_SerdeShape): + """A request to update an existing MethodResponse resource.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + resource_id: str | None = ... + """The Resource identifier for the MethodResponse resource.""" + http_method: str | None = ... + """The HTTP verb of the Method resource.""" + status_code: str | None = ... + """The status code for the MethodResponse resource.""" + patch_operations: list[PatchOperation] | None = ... + """ + For more information about supported patch operations, see [Patch + Operations](https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html). + """ + +@dataclass(kw_only=True) +class UpdateMethodResponseOutput(_SerdeShape): + """ + Represents a method response of a given HTTP status code returned to the + client. The method response is passed from the back end through the + associated integration response that can be transformed using a mapping + template. + """ + + status_code: str | None = ... + """The method response's status code.""" + response_parameters: dict[str, bool] | None = ... + """ + A key-value map specifying required or optional response parameters that + API Gateway can send back to the caller. A key defines a method response + header and the value specifies whether the associated method response + header is required or not. The expression of the key must match the + pattern `method.response.header.{name}`, where `name` is a valid and + unique header name. API Gateway passes certain integration response data + to the method response headers specified here according to the mapping + you prescribe in the API's IntegrationResponse. The integration + response data that can be mapped include an integration response header + expressed in `integration.response.header.{name}`, a static value + enclosed within a pair of single quotes (e.g., `'application/json'`), or + a JSON expression from the back-end response payload in the form of + `integration.response.body.{JSON-expression}`, where `JSON-expression` + is a valid JSON expression without the `$` prefix.) + """ + response_models: dict[str, str] | None = ... + """ + Specifies the Model resources used for the response's content-type. + Response models are represented as a key/value map, with a content-type + as the key and a Model name as the value. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateModelInput(_SerdeShape): + """Request to update an existing model in an existing RestApi resource.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + model_name: str | None = ... + """The name of the model to update.""" + patch_operations: list[PatchOperation] | None = ... + """ + For more information about supported patch operations, see [Patch + Operations](https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html). + """ + +@dataclass(kw_only=True) +class UpdateModelOutput(_SerdeShape): + """ + Represents the data structure of a method's request or response + payload. + """ + + id: str | None = ... + """The identifier for the model resource.""" + name: str | None = ... + """The name of the model. Must be an alphanumeric string.""" + description: str | None = ... + """The description of the model.""" + schema: str | None = ... + """ + The schema for the model. For `application/json` models, this should be + JSON schema draft 4 model. Do not include \"\\*/\" characters in the + description of any properties because such \"\\*/\" characters may be + interpreted as the closing marker for comments in some languages, such + as Java or JavaScript, causing the installation of your API's SDK + generated by API Gateway to fail. + """ + content_type: str | None = ... + """The content-type for the model.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateRequestValidatorInput(_SerdeShape): + """Updates a RequestValidator of a given RestApi.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + request_validator_id: str | None = ... + """The identifier of RequestValidator to be updated.""" + patch_operations: list[PatchOperation] | None = ... + """ + For more information about supported patch operations, see [Patch + Operations](https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html). + """ + +@dataclass(kw_only=True) +class UpdateRequestValidatorOutput(_SerdeShape): + """A set of validation rules for incoming Method requests.""" + + id: str | None = ... + """The identifier of this RequestValidator.""" + name: str | None = ... + """The name of this RequestValidator""" + validate_request_body: bool = ... + """ + A Boolean flag to indicate whether to validate a request body according + to the configured Model schema. + """ + validate_request_parameters: bool = ... + """ + A Boolean flag to indicate whether to validate request parameters + (`true`) or not (`false`). + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateResourceInput(_SerdeShape): + """Request to change information about a Resource resource.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + resource_id: str | None = ... + """The identifier of the Resource resource.""" + patch_operations: list[PatchOperation] | None = ... + """ + For more information about supported patch operations, see [Patch + Operations](https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html). + """ + +@dataclass(kw_only=True) +class UpdateResourceOutput(_SerdeShape): + """Represents an API resource.""" + + id: str | None = ... + """The resource's identifier.""" + parent_id: str | None = ... + """The parent resource's identifier.""" + path_part: str | None = ... + """The last path segment for this resource.""" + path: str | None = ... + """The full path for this resource.""" + resource_methods: dict[str, Method] | None = ... + """Gets an API resource's method of a given HTTP verb.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateRestApiInput(_SerdeShape): + """Request to update an existing RestApi resource in your collection.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + patch_operations: list[PatchOperation] | None = ... + """ + For more information about supported patch operations, see [Patch + Operations](https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html). + """ + +@dataclass(kw_only=True) +class UpdateRestApiOutput(_SerdeShape): + """Represents a REST API.""" + + id: str | None = ... + """ + The API's identifier. This identifier is unique across all of your APIs + in API Gateway. + """ + name: str | None = ... + """The API's name.""" + description: str | None = ... + """The API's description.""" + created_date: datetime | None = ... + """The timestamp when the API was created.""" + version: str | None = ... + """A version identifier for the API.""" + warnings: list[str] | None = ... + """ + The warning messages reported when `failonwarnings` is turned on during + API import. + """ + binary_media_types: list[str] | None = ... + """ + The list of binary media types supported by the RestApi. By default, the + RestApi supports only UTF-8-encoded text payloads. + """ + minimum_compression_size: int | None = ... + """ + A nullable integer that is used to enable compression (with non-negative + between 0 and 10485760 (10M) bytes, inclusive) or disable compression + (with a null value) on an API. When compression is enabled, compression + or decompression is not applied on the payload if the payload size is + smaller than this value. Setting it to zero allows compression for any + payload size. + """ + api_key_source: str | None = ... + """ + The source of the API key for metering requests according to a usage + plan. Valid values are: >`HEADER` to read the API key from the + `X-API-Key` header of a request. `AUTHORIZER` to read the API key from + the `UsageIdentifierKey` from a custom authorizer. + """ + endpoint_configuration: EndpointConfiguration | None = ... + """ + The endpoint configuration of this RestApi showing the endpoint types + and IP address types of the API. + """ + policy: str | None = ... + """ + A stringified JSON policy document that applies to this RestApi + regardless of the caller and Method configuration. + """ + tags: dict[str, str] | None = ... + """ + The collection of tags. Each tag element is associated with a given + resource. + """ + disable_execute_api_endpoint: bool = ... + """ + Specifies whether clients can invoke your API by using the default + `execute-api` endpoint. By default, clients can invoke your API with the + default `https://{api_id}.execute-api.{region}.amazonaws.com` endpoint. + To require that clients use a custom domain name to invoke your API, + disable the default endpoint. + """ + root_resource_id: str | None = ... + """The API's root resource ID.""" + security_policy: str | None = ... + """ + The Transport Layer Security (TLS) version + cipher suite for this + RestApi. + """ + endpoint_access_mode: str | None = ... + """The endpoint access mode of the RestApi.""" + api_status: str | None = ... + """The ApiStatus of the RestApi.""" + api_status_message: str | None = ... + """ + The status message of the RestApi. When the status message is `UPDATING` + you can still invoke it. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateStageInput(_SerdeShape): + """Requests API Gateway to change information about a Stage resource.""" + + rest_api_id: str | None = ... + """The string identifier of the associated RestApi.""" + stage_name: str | None = ... + """The name of the Stage resource to change information about.""" + patch_operations: list[PatchOperation] | None = ... + """ + For more information about supported patch operations, see [Patch + Operations](https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html). + """ + +@dataclass(kw_only=True) +class UpdateStageOutput(_SerdeShape): + """ + Represents a unique identifier for a version of a deployed RestApi that + is callable by users. + """ + + deployment_id: str | None = ... + """The identifier of the Deployment that the stage points to.""" + client_certificate_id: str | None = ... + """The identifier of a client certificate for an API stage.""" + stage_name: str | None = ... + """ + The name of the stage is the first path segment in the Uniform Resource + Identifier (URI) of a call to API Gateway. Stage names can only contain + alphanumeric characters, hyphens, and underscores. Maximum length is 128 + characters. + """ + description: str | None = ... + """The stage's description.""" + cache_cluster_enabled: bool = ... + """ + Specifies whether a cache cluster is enabled for the stage. To activate + a method-level cache, set `CachingEnabled` to `true` for a method. + """ + cache_cluster_size: str | None = ... + """ + The stage's cache capacity in GB. For more information about choosing a + cache size, see [Enabling API caching to enhance + responsiveness](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html). + """ + cache_cluster_status: str | None = ... + """The status of the cache cluster for the stage, if enabled.""" + method_settings: dict[str, MethodSetting] | None = ... + """ + A map that defines the method settings for a Stage resource. Keys + (designated as `/{method_setting_key` below) are method paths defined as + `{resource_path}/{http_method}` for an individual method override, or + `/*/*` for overriding all methods in the stage. + """ + variables: dict[str, str] | None = ... + """ + A map that defines the stage variables for a Stage resource. Variable + names can have alphanumeric and underscore characters, and the values + must match `[A-Za-z0-9-._~:/?#&=,]+`. + """ + documentation_version: str | None = ... + """The version of the associated API documentation.""" + access_log_settings: AccessLogSettings | None = ... + """Settings for logging access in this stage.""" + canary_settings: CanarySettings | None = ... + """Settings for the canary deployment in this stage.""" + tracing_enabled: bool = ... + """Specifies whether active tracing with X-ray is enabled for the Stage.""" + web_acl_arn: str | None = ... + """The ARN of the WebAcl associated with the Stage.""" + tags: dict[str, str] | None = ... + """ + The collection of tags. Each tag element is associated with a given + resource. + """ + created_date: datetime | None = ... + """The timestamp when the stage was created.""" + last_updated_date: datetime | None = ... + """The timestamp when the stage last updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateUsageInput(_SerdeShape): + """ + The PATCH request to grant a temporary extension to the remaining quota + of a usage plan associated with a specified API key. + """ + + usage_plan_id: str | None = ... + """The Id of the usage plan associated with the usage data.""" + key_id: str | None = ... + """ + The identifier of the API key associated with the usage plan in which a + temporary extension is granted to the remaining quota. + """ + patch_operations: list[PatchOperation] | None = ... + """ + For more information about supported patch operations, see [Patch + Operations](https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html). + """ + +@dataclass(kw_only=True) +class UpdateUsageOutput(_SerdeShape): + """Represents the usage data of a usage plan.""" + + usage_plan_id: str | None = ... + """The plan Id associated with this usage data.""" + start_date: str | None = ... + """The starting date of the usage data.""" + end_date: str | None = ... + """The ending date of the usage data.""" + items: dict[str, list[list[int]]] | None = ... + """ + The usage data, as daily logs of used and remaining quotas, over the + specified time interval indexed over the API keys in a usage plan. For + example, + `{..., "values" : { "{api_key}" : [ [0, 100], [10, 90], [100, 10]]}`, + where `{api_key}` stands for an API key value and the daily log entry is + of the format `[used quota, remaining quota]`. + """ + position: str | None = ... + """The current pagination position in the paged result set.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateUsagePlanInput(_SerdeShape): + """The PATCH request to update a usage plan of a given plan Id.""" + + usage_plan_id: str | None = ... + """The Id of the to-be-updated usage plan.""" + patch_operations: list[PatchOperation] | None = ... + """ + For more information about supported patch operations, see [Patch + Operations](https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html). + """ + +@dataclass(kw_only=True) +class UpdateUsagePlanOutput(_SerdeShape): + """ + Represents a usage plan used to specify who can assess associated API + stages. Optionally, target request rate and quota limits can be set. In + some cases clients can exceed the targets that you set. Don't rely on + usage plans to control costs. Consider using [Amazon Web Services + Budgets](https://docs.aws.amazon.com/cost-management/latest/userguide/budgets-managing-costs.html) + to monitor costs and + [WAF](https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html) + to manage API requests. + """ + + id: str | None = ... + """The identifier of a UsagePlan resource.""" + name: str | None = ... + """The name of a usage plan.""" + description: str | None = ... + """The description of a usage plan.""" + api_stages: list[ApiStage] | None = ... + """The associated API stages of a usage plan.""" + throttle: ThrottleSettings | None = ... + """ + A map containing method level throttling information for API stage in a + usage plan. + """ + quota: QuotaSettings | None = ... + """ + The target maximum number of permitted requests per a given unit time + interval. + """ + product_code: str | None = ... + """ + The Amazon Web Services Marketplace product identifier to associate with + the usage plan as a SaaS product on the Amazon Web Services Marketplace. + """ + tags: dict[str, str] | None = ... + """ + The collection of tags. Each tag element is associated with a given + resource. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateVpcLinkInput(_SerdeShape): + """Updates an existing VpcLink of a specified identifier.""" + + vpc_link_id: str | None = ... + """ + The identifier of the VpcLink. It is used in an Integration to reference + this VpcLink. + """ + patch_operations: list[PatchOperation] | None = ... + """ + For more information about supported patch operations, see [Patch + Operations](https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html). + """ + +@dataclass(kw_only=True) +class UpdateVpcLinkOutput(_SerdeShape): + """ + An API Gateway VPC link for a RestApi to access resources in an Amazon + Virtual Private Cloud (VPC). + """ + + id: str | None = ... + """ + The identifier of the VpcLink. It is used in an Integration to reference + this VpcLink. + """ + name: str | None = ... + """The name used to label and identify the VPC link.""" + description: str | None = ... + """The description of the VPC link.""" + target_arns: list[str] | None = ... + """ + The ARN of the network load balancer of the VPC targeted by the VPC + link. The network load balancer must be owned by the same Amazon Web + Services account of the API owner. + """ + status: str | None = ... + """ + The status of the VPC link. The valid values are `AVAILABLE`, `PENDING`, + `DELETING`, or `FAILED`. Deploying an API will wait if the status is + `PENDING` and will fail if the status is `DELETING`. + """ + status_message: str | None = ... + """A description about the VPC link status.""" + tags: dict[str, str] | None = ... + """ + The collection of tags. Each tag element is associated with a given + resource. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UsagePlan(_SerdeShape): + """ + Represents a usage plan used to specify who can assess associated API + stages. Optionally, target request rate and quota limits can be set. In + some cases clients can exceed the targets that you set. Don't rely on + usage plans to control costs. Consider using [Amazon Web Services + Budgets](https://docs.aws.amazon.com/cost-management/latest/userguide/budgets-managing-costs.html) + to monitor costs and + [WAF](https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html) + to manage API requests. + """ + + id: str | None = ... + """The identifier of a UsagePlan resource.""" + name: str | None = ... + """The name of a usage plan.""" + description: str | None = ... + """The description of a usage plan.""" + api_stages: list[ApiStage] | None = ... + """The associated API stages of a usage plan.""" + throttle: ThrottleSettings | None = ... + """ + A map containing method level throttling information for API stage in a + usage plan. + """ + quota: QuotaSettings | None = ... + """ + The target maximum number of permitted requests per a given unit time + interval. + """ + product_code: str | None = ... + """ + The Amazon Web Services Marketplace product identifier to associate with + the usage plan as a SaaS product on the Amazon Web Services Marketplace. + """ + tags: dict[str, str] | None = ... + """ + The collection of tags. Each tag element is associated with a given + resource. + """ + +@dataclass(kw_only=True) +class UsagePlanKey(_SerdeShape): + """Represents a usage plan key to identify a plan customer.""" + + id: str | None = ... + """The Id of a usage plan key.""" + type: str | None = ... + """ + The type of a usage plan key. Currently, the valid key type is + `API_KEY`. + """ + value: str | None = ... + """The value of a usage plan key.""" + name: str | None = ... + """The name of a usage plan key.""" + +@dataclass(kw_only=True) +class VpcLink(_SerdeShape): + """ + An API Gateway VPC link for a RestApi to access resources in an Amazon + Virtual Private Cloud (VPC). + """ + + id: str | None = ... + """ + The identifier of the VpcLink. It is used in an Integration to reference + this VpcLink. + """ + name: str | None = ... + """The name used to label and identify the VPC link.""" + description: str | None = ... + """The description of the VPC link.""" + target_arns: list[str] | None = ... + """ + The ARN of the network load balancer of the VPC targeted by the VPC + link. The network load balancer must be owned by the same Amazon Web + Services account of the API owner. + """ + status: str | None = ... + """ + The status of the VPC link. The valid values are `AVAILABLE`, `PENDING`, + `DELETING`, or `FAILED`. Deploying an API will wait if the status is + `PENDING` and will fail if the status is `DELETING`. + """ + status_message: str | None = ... + """A description about the VPC link status.""" + tags: dict[str, str] | None = ... + """ + The collection of tags. Each tag element is associated with a given + resource. + """ + +class VpcLinkStatus(UnknownEnumMixin, StrEnum): + AVAILABLE = "AVAILABLE" + PENDING = "PENDING" + DELETING = "DELETING" + FAILED = "FAILED" + +CREATE_API_KEY: APIOperation[CreateApiKeyInput, CreateApiKeyOutput] +CREATE_AUTHORIZER: APIOperation[CreateAuthorizerInput, CreateAuthorizerOutput] +CREATE_BASE_PATH_MAPPING: APIOperation[ + CreateBasePathMappingInput, CreateBasePathMappingOutput +] +CREATE_DEPLOYMENT: APIOperation[CreateDeploymentInput, CreateDeploymentOutput] +CREATE_DOCUMENTATION_PART: APIOperation[ + CreateDocumentationPartInput, CreateDocumentationPartOutput +] +CREATE_DOCUMENTATION_VERSION: APIOperation[ + CreateDocumentationVersionInput, CreateDocumentationVersionOutput +] +CREATE_DOMAIN_NAME: APIOperation[CreateDomainNameInput, CreateDomainNameOutput] +CREATE_DOMAIN_NAME_ACCESS_ASSOCIATION: APIOperation[ + CreateDomainNameAccessAssociationInput, CreateDomainNameAccessAssociationOutput +] +CREATE_MODEL: APIOperation[CreateModelInput, CreateModelOutput] +CREATE_REQUEST_VALIDATOR: APIOperation[ + CreateRequestValidatorInput, CreateRequestValidatorOutput +] +CREATE_RESOURCE: APIOperation[CreateResourceInput, CreateResourceOutput] +CREATE_REST_API: APIOperation[CreateRestApiInput, CreateRestApiOutput] +CREATE_STAGE: APIOperation[CreateStageInput, CreateStageOutput] +CREATE_USAGE_PLAN: APIOperation[CreateUsagePlanInput, CreateUsagePlanOutput] +CREATE_USAGE_PLAN_KEY: APIOperation[CreateUsagePlanKeyInput, CreateUsagePlanKeyOutput] +CREATE_VPC_LINK: APIOperation[CreateVpcLinkInput, CreateVpcLinkOutput] +DELETE_API_KEY: APIOperation[DeleteApiKeyInput, DeleteApiKeyOutput] +DELETE_AUTHORIZER: APIOperation[DeleteAuthorizerInput, DeleteAuthorizerOutput] +DELETE_BASE_PATH_MAPPING: APIOperation[ + DeleteBasePathMappingInput, DeleteBasePathMappingOutput +] +DELETE_CLIENT_CERTIFICATE: APIOperation[ + DeleteClientCertificateInput, DeleteClientCertificateOutput +] +DELETE_DEPLOYMENT: APIOperation[DeleteDeploymentInput, DeleteDeploymentOutput] +DELETE_DOCUMENTATION_PART: APIOperation[ + DeleteDocumentationPartInput, DeleteDocumentationPartOutput +] +DELETE_DOCUMENTATION_VERSION: APIOperation[ + DeleteDocumentationVersionInput, DeleteDocumentationVersionOutput +] +DELETE_DOMAIN_NAME: APIOperation[DeleteDomainNameInput, DeleteDomainNameOutput] +DELETE_DOMAIN_NAME_ACCESS_ASSOCIATION: APIOperation[ + DeleteDomainNameAccessAssociationInput, DeleteDomainNameAccessAssociationOutput +] +DELETE_GATEWAY_RESPONSE: APIOperation[ + DeleteGatewayResponseInput, DeleteGatewayResponseOutput +] +DELETE_INTEGRATION: APIOperation[DeleteIntegrationInput, DeleteIntegrationOutput] +DELETE_INTEGRATION_RESPONSE: APIOperation[ + DeleteIntegrationResponseInput, DeleteIntegrationResponseOutput +] +DELETE_METHOD: APIOperation[DeleteMethodInput, DeleteMethodOutput] +DELETE_METHOD_RESPONSE: APIOperation[ + DeleteMethodResponseInput, DeleteMethodResponseOutput +] +DELETE_MODEL: APIOperation[DeleteModelInput, DeleteModelOutput] +DELETE_REQUEST_VALIDATOR: APIOperation[ + DeleteRequestValidatorInput, DeleteRequestValidatorOutput +] +DELETE_RESOURCE: APIOperation[DeleteResourceInput, DeleteResourceOutput] +DELETE_REST_API: APIOperation[DeleteRestApiInput, DeleteRestApiOutput] +DELETE_STAGE: APIOperation[DeleteStageInput, DeleteStageOutput] +DELETE_USAGE_PLAN: APIOperation[DeleteUsagePlanInput, DeleteUsagePlanOutput] +DELETE_USAGE_PLAN_KEY: APIOperation[DeleteUsagePlanKeyInput, DeleteUsagePlanKeyOutput] +DELETE_VPC_LINK: APIOperation[DeleteVpcLinkInput, DeleteVpcLinkOutput] +FLUSH_STAGE_AUTHORIZERS_CACHE: APIOperation[ + FlushStageAuthorizersCacheInput, FlushStageAuthorizersCacheOutput +] +FLUSH_STAGE_CACHE: APIOperation[FlushStageCacheInput, FlushStageCacheOutput] +GENERATE_CLIENT_CERTIFICATE: APIOperation[ + GenerateClientCertificateInput, GenerateClientCertificateOutput +] +GET_ACCOUNT: APIOperation[GetAccountInput, GetAccountOutput] +GET_API_KEY: APIOperation[GetApiKeyInput, GetApiKeyOutput] +GET_API_KEYS: APIOperation[GetApiKeysInput, GetApiKeysOutput] +GET_AUTHORIZER: APIOperation[GetAuthorizerInput, GetAuthorizerOutput] +GET_AUTHORIZERS: APIOperation[GetAuthorizersInput, GetAuthorizersOutput] +GET_BASE_PATH_MAPPING: APIOperation[GetBasePathMappingInput, GetBasePathMappingOutput] +GET_BASE_PATH_MAPPINGS: APIOperation[ + GetBasePathMappingsInput, GetBasePathMappingsOutput +] +GET_CLIENT_CERTIFICATE: APIOperation[ + GetClientCertificateInput, GetClientCertificateOutput +] +GET_CLIENT_CERTIFICATES: APIOperation[ + GetClientCertificatesInput, GetClientCertificatesOutput +] +GET_DEPLOYMENT: APIOperation[GetDeploymentInput, GetDeploymentOutput] +GET_DEPLOYMENTS: APIOperation[GetDeploymentsInput, GetDeploymentsOutput] +GET_DOCUMENTATION_PART: APIOperation[ + GetDocumentationPartInput, GetDocumentationPartOutput +] +GET_DOCUMENTATION_PARTS: APIOperation[ + GetDocumentationPartsInput, GetDocumentationPartsOutput +] +GET_DOCUMENTATION_VERSION: APIOperation[ + GetDocumentationVersionInput, GetDocumentationVersionOutput +] +GET_DOCUMENTATION_VERSIONS: APIOperation[ + GetDocumentationVersionsInput, GetDocumentationVersionsOutput +] +GET_DOMAIN_NAME: APIOperation[GetDomainNameInput, GetDomainNameOutput] +GET_DOMAIN_NAME_ACCESS_ASSOCIATIONS: APIOperation[ + GetDomainNameAccessAssociationsInput, GetDomainNameAccessAssociationsOutput +] +GET_DOMAIN_NAMES: APIOperation[GetDomainNamesInput, GetDomainNamesOutput] +GET_EXPORT: APIOperation[GetExportInput, GetExportOutput] +GET_GATEWAY_RESPONSE: APIOperation[GetGatewayResponseInput, GetGatewayResponseOutput] +GET_GATEWAY_RESPONSES: APIOperation[GetGatewayResponsesInput, GetGatewayResponsesOutput] +GET_INTEGRATION: APIOperation[GetIntegrationInput, GetIntegrationOutput] +GET_INTEGRATION_RESPONSE: APIOperation[ + GetIntegrationResponseInput, GetIntegrationResponseOutput +] +GET_METHOD: APIOperation[GetMethodInput, GetMethodOutput] +GET_METHOD_RESPONSE: APIOperation[GetMethodResponseInput, GetMethodResponseOutput] +GET_MODEL: APIOperation[GetModelInput, GetModelOutput] +GET_MODELS: APIOperation[GetModelsInput, GetModelsOutput] +GET_MODEL_TEMPLATE: APIOperation[GetModelTemplateInput, GetModelTemplateOutput] +GET_REQUEST_VALIDATOR: APIOperation[GetRequestValidatorInput, GetRequestValidatorOutput] +GET_REQUEST_VALIDATORS: APIOperation[ + GetRequestValidatorsInput, GetRequestValidatorsOutput +] +GET_RESOURCE: APIOperation[GetResourceInput, GetResourceOutput] +GET_RESOURCES: APIOperation[GetResourcesInput, GetResourcesOutput] +GET_REST_API: APIOperation[GetRestApiInput, GetRestApiOutput] +GET_REST_APIS: APIOperation[GetRestApisInput, GetRestApisOutput] +GET_SDK: APIOperation[GetSdkInput, GetSdkOutput] +GET_SDK_TYPE: APIOperation[GetSdkTypeInput, GetSdkTypeOutput] +GET_SDK_TYPES: APIOperation[GetSdkTypesInput, GetSdkTypesOutput] +GET_STAGE: APIOperation[GetStageInput, GetStageOutput] +GET_STAGES: APIOperation[GetStagesInput, GetStagesOutput] +GET_TAGS: APIOperation[GetTagsInput, GetTagsOutput] +GET_USAGE: APIOperation[GetUsageInput, GetUsageOutput] +GET_USAGE_PLAN: APIOperation[GetUsagePlanInput, GetUsagePlanOutput] +GET_USAGE_PLAN_KEY: APIOperation[GetUsagePlanKeyInput, GetUsagePlanKeyOutput] +GET_USAGE_PLAN_KEYS: APIOperation[GetUsagePlanKeysInput, GetUsagePlanKeysOutput] +GET_USAGE_PLANS: APIOperation[GetUsagePlansInput, GetUsagePlansOutput] +GET_VPC_LINK: APIOperation[GetVpcLinkInput, GetVpcLinkOutput] +GET_VPC_LINKS: APIOperation[GetVpcLinksInput, GetVpcLinksOutput] +IMPORT_API_KEYS: APIOperation[ImportApiKeysInput, ImportApiKeysOutput] +IMPORT_DOCUMENTATION_PARTS: APIOperation[ + ImportDocumentationPartsInput, ImportDocumentationPartsOutput +] +IMPORT_REST_API: APIOperation[ImportRestApiInput, ImportRestApiOutput] +PUT_GATEWAY_RESPONSE: APIOperation[PutGatewayResponseInput, PutGatewayResponseOutput] +PUT_INTEGRATION: APIOperation[PutIntegrationInput, PutIntegrationOutput] +PUT_INTEGRATION_RESPONSE: APIOperation[ + PutIntegrationResponseInput, PutIntegrationResponseOutput +] +PUT_METHOD: APIOperation[PutMethodInput, PutMethodOutput] +PUT_METHOD_RESPONSE: APIOperation[PutMethodResponseInput, PutMethodResponseOutput] +PUT_REST_API: APIOperation[PutRestApiInput, PutRestApiOutput] +REJECT_DOMAIN_NAME_ACCESS_ASSOCIATION: APIOperation[ + RejectDomainNameAccessAssociationInput, RejectDomainNameAccessAssociationOutput +] +TAG_RESOURCE: APIOperation[TagResourceInput, TagResourceOutput] +TEST_INVOKE_AUTHORIZER: APIOperation[ + TestInvokeAuthorizerInput, TestInvokeAuthorizerOutput +] +TEST_INVOKE_METHOD: APIOperation[TestInvokeMethodInput, TestInvokeMethodOutput] +UNTAG_RESOURCE: APIOperation[UntagResourceInput, UntagResourceOutput] +UPDATE_ACCOUNT: APIOperation[UpdateAccountInput, UpdateAccountOutput] +UPDATE_API_KEY: APIOperation[UpdateApiKeyInput, UpdateApiKeyOutput] +UPDATE_AUTHORIZER: APIOperation[UpdateAuthorizerInput, UpdateAuthorizerOutput] +UPDATE_BASE_PATH_MAPPING: APIOperation[ + UpdateBasePathMappingInput, UpdateBasePathMappingOutput +] +UPDATE_CLIENT_CERTIFICATE: APIOperation[ + UpdateClientCertificateInput, UpdateClientCertificateOutput +] +UPDATE_DEPLOYMENT: APIOperation[UpdateDeploymentInput, UpdateDeploymentOutput] +UPDATE_DOCUMENTATION_PART: APIOperation[ + UpdateDocumentationPartInput, UpdateDocumentationPartOutput +] +UPDATE_DOCUMENTATION_VERSION: APIOperation[ + UpdateDocumentationVersionInput, UpdateDocumentationVersionOutput +] +UPDATE_DOMAIN_NAME: APIOperation[UpdateDomainNameInput, UpdateDomainNameOutput] +UPDATE_GATEWAY_RESPONSE: APIOperation[ + UpdateGatewayResponseInput, UpdateGatewayResponseOutput +] +UPDATE_INTEGRATION: APIOperation[UpdateIntegrationInput, UpdateIntegrationOutput] +UPDATE_INTEGRATION_RESPONSE: APIOperation[ + UpdateIntegrationResponseInput, UpdateIntegrationResponseOutput +] +UPDATE_METHOD: APIOperation[UpdateMethodInput, UpdateMethodOutput] +UPDATE_METHOD_RESPONSE: APIOperation[ + UpdateMethodResponseInput, UpdateMethodResponseOutput +] +UPDATE_MODEL: APIOperation[UpdateModelInput, UpdateModelOutput] +UPDATE_REQUEST_VALIDATOR: APIOperation[ + UpdateRequestValidatorInput, UpdateRequestValidatorOutput +] +UPDATE_RESOURCE: APIOperation[UpdateResourceInput, UpdateResourceOutput] +UPDATE_REST_API: APIOperation[UpdateRestApiInput, UpdateRestApiOutput] +UPDATE_STAGE: APIOperation[UpdateStageInput, UpdateStageOutput] +UPDATE_USAGE: APIOperation[UpdateUsageInput, UpdateUsageOutput] +UPDATE_USAGE_PLAN: APIOperation[UpdateUsagePlanInput, UpdateUsagePlanOutput] +UPDATE_VPC_LINK: APIOperation[UpdateVpcLinkInput, UpdateVpcLinkOutput] diff --git a/clients/aws-sdk-bedrock-agent-runtime/scripts/docs/generate_doc_stubs.py b/clients/aws-sdk-bedrock-agent-runtime/scripts/docs/generate_doc_stubs.py index 52d470bc..795f2e4b 100644 --- a/clients/aws-sdk-bedrock-agent-runtime/scripts/docs/generate_doc_stubs.py +++ b/clients/aws-sdk-bedrock-agent-runtime/scripts/docs/generate_doc_stubs.py @@ -126,7 +126,9 @@ class ClientInfo: class DocStubGenerator: """Generate markdown API Reference stubs for AWS SDK for Python v4 clients.""" - def __init__(self, client_dir: Path, output_dir: Path, service_name: str | None = None) -> None: + def __init__( + self, client_dir: Path, output_dir: Path, service_name: str | None = None + ) -> None: """ Initialize the documentation generator. @@ -190,7 +192,9 @@ def _analyze_client_package(self, package_name: str) -> ClientInfo: required = ("client", "config", "models") missing = [name for name in required if not package.modules.get(name)] if missing: - raise ValueError(f"Missing required modules in {package_name}: {', '.join(missing)}") + raise ValueError( + f"Missing required modules in {package_name}: {', '.join(missing)}" + ) # Parse submodules client_module = package.modules["client"] @@ -199,11 +203,15 @@ def _analyze_client_package(self, package_name: str) -> ClientInfo: client_class = self._find_class_with_suffix(client_module, "Client") if not client_class: - raise ValueError(f"No class ending with 'Client' found in {package_name}.client") + raise ValueError( + f"No class ending with 'Client' found in {package_name}.client" + ) config_class = self._find_class_with_suffix(config_module, "Config") if not config_class: - raise ValueError(f"No class ending with 'Config' found in {package_name}.config") + raise ValueError( + f"No class ending with 'Config' found in {package_name}.config" + ) plugin_alias = config_module.members.get("Plugin") if not plugin_alias: @@ -288,7 +296,9 @@ def _analyze_operation(self, operation: Function) -> OperationInfo: if output_type in stream_type_map: stream_type = stream_type_map[output_type] - stream_args = self._get_subscript_elements(returns, f"'{operation.name}' stream type") + stream_args = self._get_subscript_elements( + returns, f"'{operation.name}' stream type" + ) if stream_type in (StreamType.INPUT, StreamType.DUPLEX): event_input_type = stream_args[0].canonical_name @@ -316,7 +326,9 @@ def _analyze_operation(self, operation: Function) -> OperationInfo: def _get_expr(self, annotation: str | Expr | None, context: str) -> Expr: """Extract and validate an Expr from an annotation.""" if not isinstance(annotation, Expr): - raise TypeError(f"{context}: expected Expr, got {type(annotation).__name__}") + raise TypeError( + f"{context}: expected Expr, got {type(annotation).__name__}" + ) return annotation def _get_subscript_elements(self, expr: Expr, context: str) -> list[Expr]: @@ -330,7 +342,9 @@ def _get_subscript_elements(self, expr: Expr, context: str) -> list[Expr]: return [el for el in slice_expr.elements if isinstance(el, Expr)] return [slice_expr] - def _extract_models(self, models_module: Module, operations: list[OperationInfo]) -> ModelsInfo: + def _extract_models( + self, models_module: Module, operations: list[OperationInfo] + ) -> ModelsInfo: """Extract structures, unions, enums, and errors from models module.""" structures, unions, enums, errors = [], [], [], [] @@ -356,14 +370,16 @@ def _extract_models(self, models_module: Module, operations: list[OperationInfo] duplicates = [] for structure in structures: - if self._is_operation_io_type(structure.name, operations) or self._is_union_member( - structure.name, unions - ): + if self._is_operation_io_type( + structure.name, operations + ) or self._is_union_member(structure.name, unions): duplicates.append(structure) structures = [struct for struct in structures if struct not in duplicates] - return ModelsInfo(structures=structures, unions=unions, enums=enums, errors=errors) + return ModelsInfo( + structures=structures, unions=unions, enums=enums, errors=errors + ) def _is_union(self, member: Object | Alias) -> TypeGuard[Attribute]: """Check if a module member is a union type.""" @@ -399,7 +415,9 @@ def _extract_union_members( for name in member_names: if not (member_object := models_module.members.get(name)): raise ValueError(f"Union member '{name}' not found in models module") - members.append(TypeInfo(name=member_object.name, module_path=member_object.path)) + members.append( + TypeInfo(name=member_object.name, module_path=member_object.path) + ) return members @@ -408,7 +426,8 @@ def _is_enum(self, member: Object | Alias) -> TypeGuard[Class]: if not isinstance(member, Class): return False return any( - isinstance(base, ExprName) and base.name in ENUM_BASE_CLASSES for base in member.bases + isinstance(base, ExprName) and base.name in ENUM_BASE_CLASSES + for base in member.bases ) def _is_error(self, member: Object | Alias) -> TypeGuard[Class]: @@ -416,10 +435,13 @@ def _is_error(self, member: Object | Alias) -> TypeGuard[Class]: if not isinstance(member, Class): return False return any( - isinstance(base, ExprName) and base.name in ERROR_BASE_CLASSES for base in member.bases + isinstance(base, ExprName) and base.name in ERROR_BASE_CLASSES + for base in member.bases ) - def _is_operation_io_type(self, type_name: str, operations: list[OperationInfo]) -> bool: + def _is_operation_io_type( + self, type_name: str, operations: list[OperationInfo] + ) -> bool: """Check if a type is used as operation input/output.""" return any(type_name in (op.input.name, op.output.name) for op in operations) @@ -437,8 +459,12 @@ def _generate_client_docs(self, client_info: ClientInfo) -> bool: self._generate_type_stubs( client_info.models.structures, "structures", "Structure Class" ) - self._generate_type_stubs(client_info.models.errors, "errors", "Error Class") - self._generate_type_stubs(client_info.models.enums, "enums", "Enum Class", members=True) + self._generate_type_stubs( + client_info.models.errors, "errors", "Error Class" + ) + self._generate_type_stubs( + client_info.models.enums, "enums", "Enum Class", members=True + ) self._generate_union_stubs(client_info.models.unions) except OSError as e: logger.error(f"Failed to write documentation files: {e}") @@ -470,7 +496,9 @@ def _generate_index(self, client_info: ClientInfo) -> None: ] for method in sorted(client_info.client_methods, key=lambda x: x.name): - lines.extend([*self._mkdocs_directive(method.module_path, heading_level=4), ""]) + lines.extend( + [*self._mkdocs_directive(method.module_path, heading_level=4), ""] + ) # Operations section if client_info.operations: @@ -578,7 +606,9 @@ def _generate_operation_stubs(self, operations: list[OperationInfo]) -> None: output_path = self.output_dir / "operations" / f"{op.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb("Operations", op.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb("Operations", op.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(operations)} operation file(s)") @@ -600,7 +630,9 @@ def _generate_type_stubs( output_path = self.output_dir / category / f"{item.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb(category.title(), item.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb(category.title(), item.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(items)} {category} file(s)") @@ -624,7 +656,9 @@ def _generate_union_stubs(self, unions: list[UnionInfo]) -> None: output_path = self.output_dir / "unions" / f"{union.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb("Unions", union.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb("Unions", union.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(unions)} union file(s)") diff --git a/clients/aws-sdk-bedrock-agent-runtime/src/aws_sdk_bedrock_agent_runtime/_private/schemas.py b/clients/aws-sdk-bedrock-agent-runtime/src/aws_sdk_bedrock_agent_runtime/_private/schemas.py index ba81c9a6..3bb94ad8 100644 --- a/clients/aws-sdk-bedrock-agent-runtime/src/aws_sdk_bedrock_agent_runtime/_private/schemas.py +++ b/clients/aws-sdk-bedrock-agent-runtime/src/aws_sdk_bedrock_agent_runtime/_private/schemas.py @@ -2,8041 +2,7931 @@ from types import MappingProxyType -from smithy_core.prelude import ( - BLOB, - BOOLEAN, - DOCUMENT, - DOUBLE, - FLOAT, - INTEGER, - LONG, - STRING, - TIMESTAMP, - UNIT, -) -from smithy_core.schemas import Schema -from smithy_core.shapes import ShapeID, ShapeType -from smithy_core.traits import Trait - - -NON_BLANK_STRING = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#NonBlankString"), - shape_type=ShapeType.STRING, -) - -ACCESS_DENIED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AccessDeniedException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=403), - ], - members={"message": {"target": NON_BLANK_STRING}}, -) - -CUSTOM_CONTROL_METHOD = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#CustomControlMethod"), - shape_type=ShapeType.ENUM, - members={"RETURN_CONTROL": {"target": UNIT}}, -) - -LAMBDA_RESOURCE_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#LambdaResourceArn"), - shape_type=ShapeType.STRING, -) - -ACTION_GROUP_EXECUTOR = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ActionGroupExecutor"), - shape_type=ShapeType.UNION, - members={ - "lambda": {"target": LAMBDA_RESOURCE_ARN}, - "customControl": {"target": CUSTOM_CONTROL_METHOD}, - }, +from smithy_core._schema_compact import StaticOperationSchema, StaticSchema + + +n0 = "com.amazonaws.bedrockagentruntime" +_NBS = "NonBlankString" +_ADE = "AccessDeniedException" +_s = "smithy.api#error" +_c = "client" +_sE = "smithy.api#httpError" +_m = "message" +_CCM = "CustomControlMethod" +_RC = "RETURN_CONTROL" +_sV = "smithy.api#enumValue" +_LRA = "LambdaResourceArn" +_AGE = "ActionGroupExecutor" +_l = "lambda" +_cC = "customControl" +_AGN = "ActionGroupName" +_sm = "smithy.api#sensitive" +_AP = "ApiPath" +_ET = "ExecutionType" +_LAMBDA = "LAMBDA" +_F = "Function" +_P = "Parameter" +_n = "name" +_t = "type" +_v = "value" +_Pa = "Parameters" +_me = "member" +_CM = "ContentMap" +_k = "key" +_RB = "RequestBody" +_co = "content" +_V = "Verb" +_AGII = "ActionGroupInvocationInput" +_aGN = "actionGroupName" +_ve = "verb" +_aP = "apiPath" +_p = "parameters" +_rB = "requestBody" +_f = "function" +_eT = "executionType" +_iI = "invocationId" +_DT = "DateTimestamp" +_sF = "smithy.api#timestampFormat" +_dt = "date-time" +_U = "Usage" +_iT = "inputTokens" +_oT = "outputTokens" +_M = "Metadata" +_sT = "startTime" +_eTn = "endTime" +_tTM = "totalTimeMs" +_oTTM = "operationTotalTimeMs" +_cRI = "clientRequestId" +_u = "usage" +_AGOS = "ActionGroupOutputString" +_AGIO = "ActionGroupInvocationOutput" +_te = "text" +_met = "metadata" +_AGS = "ActionGroupSignature" +_AU = "AMAZON_USERINPUT" +_AMAZONUI = "AMAZON.UserInput" +_AC = "AMAZON_CODEINTERPRETER" +_AMAZONCI = "AMAZON.CodeInterpreter" +_AC_ = "ANTHROPIC_COMPUTER" +_ANTHROPICC = "ANTHROPIC.Computer" +_AB = "ANTHROPIC_BASH" +_ANTHROPICB = "ANTHROPIC.Bash" +_AT = "ANTHROPIC_TEXTEDITOR" +_ANTHROPICTE = "ANTHROPIC.TextEditor" +_AGSP = "ActionGroupSignatureParams" +_AIT = "ActionInvocationType" +_RESULT = "RESULT" +_UC = "USER_CONFIRMATION" +_UCAR = "USER_CONFIRMATION_AND_RESULT" +_AMRFK = "AdditionalModelRequestFieldsKey" +_AMRFV = "AdditionalModelRequestFieldsValue" +_AMRF = "AdditionalModelRequestFields" +_RN = "ResourceName" +_Pay = "Payload" +_SBN = "S3BucketName" +_SOK = "S3ObjectKey" +_SI = "S3Identifier" +_sBN = "s3BucketName" +_sOK = "s3ObjectKey" +_APIS = "APISchema" +_s_ = "s3" +_pa = "payload" +_RD = "ResourceDescription" +_FD = "FunctionDescription" +_PN = "ParameterName" +_PD = "ParameterDescription" +_PT = "ParameterType" +_STRING = "STRING" +_st = "string" +_NUMBER = "NUMBER" +_nu = "number" +_INTEGER = "INTEGER" +_i = "integer" +_BOOLEAN = "BOOLEAN" +_b = "boolean" +_ARRAY = "ARRAY" +_a = "array" +_PDa = "ParameterDetail" +_d = "description" +_smi = "smithy.api#required" +_r = "required" +_PM = "ParameterMap" +_RCe = "RequireConfirmation" +_ENABLED = "ENABLED" +_DISABLED = "DISABLED" +_FDu = "FunctionDefinition" +_rC = "requireConfirmation" +_Fu = "Functions" +_FS = "FunctionSchema" +_fu = "functions" +_AAG = "AgentActionGroup" +_pAGS = "parentActionGroupSignature" +_aGE = "actionGroupExecutor" +_aS = "apiSchema" +_fS = "functionSchema" +_pAGSP = "parentActionGroupSignatureParams" +_AAGg = "AgentActionGroups" +_AAA = "AgentAliasArn" +_AAI = "AgentAliasId" +_ACg = "AgentCollaboration" +_SUPERVISOR = "SUPERVISOR" +_SR = "SUPERVISOR_ROUTER" +_CS = "ConfirmationState" +_CONFIRM = "CONFIRM" +_DENY = "DENY" +_IIF = "ImageInputFormat" +_PNG = "PNG" +_pn = "png" +_JPEG = "JPEG" +_j = "jpeg" +_GIF = "GIF" +_g = "gif" +_WEBP = "WEBP" +_w = "webp" +_IIS = "ImageInputSource" +_by = "bytes" +_II = "ImageInput" +_fo = "format" +_so = "source" +_IIm = "ImageInputs" +_CB = "ContentBody" +_bo = "body" +_im = "images" +_RBe = "ResponseBody" +_RS = "ResponseState" +_FAILURE = "FAILURE" +_REPROMPT = "REPROMPT" +_AR = "ApiResult" +_aG = "actionGroup" +_hM = "httpMethod" +_cS = "confirmationState" +_rS = "responseState" +_hSC = "httpStatusCode" +_rBe = "responseBody" +_aI = "agentId" +_FR = "FunctionResult" +_IRM = "InvocationResultMember" +_aR = "apiResult" +_fR = "functionResult" +_RCIR = "ReturnControlInvocationResults" +_RCR = "ReturnControlResults" +_rCIR = "returnControlInvocationResults" +_ACPS = "AgentCollaboratorPayloadString" +_PTa = "PayloadType" +_TEXT = "TEXT" +_ACIP = "AgentCollaboratorInputPayload" +_rCR = "returnControlResults" +_ACII = "AgentCollaboratorInvocationInput" +_aCN = "agentCollaboratorName" +_aCAA = "agentCollaboratorAliasArn" +_in = "input" +_N = "Name" +_APp = "ApiParameter" +_APpi = "ApiParameters" +_PL = "ParameterList" +_PP = "PropertyParameters" +_pr = "properties" +_ACM = "ApiContentMap" +_ARB = "ApiRequestBody" +_AII = "ApiInvocationInput" +_aIT = "actionInvocationType" +_cN = "collaboratorName" +_FP = "FunctionParameter" +_FPu = "FunctionParameters" +_FII = "FunctionInvocationInput" +_IIM = "InvocationInputMember" +_aII = "apiInvocationInput" +_fII = "functionInvocationInput" +_IIn = "InvocationInputs" +_RCP = "ReturnControlPayload" +_iIn = "invocationInputs" +_ACOP = "AgentCollaboratorOutputPayload" +_rCP = "returnControlPayload" +_ACIO = "AgentCollaboratorInvocationOutput" +_o = "output" +_ACMAI = "AgentCoreMemoryActorId" +_ACMI = "AgentCoreMemoryId" +_ACMSI = "AgentCoreMemorySessionId" +_ARSR = "AgenticRetrieveSourceRetriever" +_id = "identifier" +_ARFDED = "AgenticRetrieveFullDocExpansionDetails" +_dI = "documentId" +_sR = "sourceRetriever" +_ARMC = "AgenticRetrieveMessageContent" +_ARMRD = "AgenticRetrieveMemoryRetrieveDetails" +_iQ = "inputQuery" +_mI = "memoryId" +_na = "namespace" +_nP = "namespacePath" +_sI = "strategyId" +_ARSRL = "AgenticRetrieveSourceRetrieverList" +_ARAD = "AgenticRetrieveActionDetails" +_sRo = "sourceRetrievers" +_ARA = "AgenticRetrieveAction" +_re = "retrieve" +_fDE = "fullDocumentExpansion" +_mR = "memoryRetrieve" +_ARAg = "AgenticRetrieveActions" +_ARBGC = "AgenticRetrieveBedrockGuardrailConfiguration" +_gI = "guardrailId" +_gV = "guardrailVersion" +_BMA = "BedrockModelArn" +_ARBRMC = "AgenticRetrieveBedrockRerankingModelConfiguration" +_mA = "modelArn" +_ARBRC = "AgenticRetrieveBedrockRerankingConfiguration" +_mC = "modelConfiguration" +_ARCR = "AgenticRetrieveCitationReference" +_rI = "resultIndex" +_ARCRL = "AgenticRetrieveCitationReferenceList" +_ARC = "AgenticRetrieveCitation" +_sIt = "startIndex" +_eI = "endIndex" +_ref = "references" +_ARCL = "AgenticRetrieveCitationList" +_BFMMC = "BedrockFoundationModelModelConfiguration" +_BFMC = "BedrockFoundationModelConfiguration" +_MPI = "MantleProjectId" +_MFMMC = "MantleFoundationModelModelConfiguration" +_pI = "projectId" +_MFMC = "MantleFoundationModelConfiguration" +_FMCT = "FoundationModelConfigurationType" +_BFM = "BEDROCK_FOUNDATION_MODEL" +_MFM = "MANTLE_FOUNDATION_MODEL" +_FMC = "FoundationModelConfiguration" +_bFMC = "bedrockFoundationModelConfiguration" +_mFMC = "mantleFoundationModelConfiguration" +_FMT = "FoundationModelType" +_CUSTOM = "CUSTOM" +_MANAGED = "MANAGED" +_ARRCT = "AgenticRetrieveRerankingConfigurationType" +_BRM = "BEDROCK_RERANKING_MODEL" +_ARRC = "AgenticRetrieveRerankingConfiguration" +_bRC = "bedrockRerankingConfiguration" +_ARRMT = "AgenticRetrieveRerankingModelType" +_NONE = "NONE" +_ARCg = "AgenticRetrieveConfiguration" +_fMT = "foundationModelType" +_smit = "smithy.api#default" +_fMC = "foundationModelConfiguration" +_rMT = "rerankingModelType" +_rCe = "rerankingConfiguration" +_mAI = "maxAgentIteration" +_ARF = "AgenticRetrieveFailure" +_ARFg = "AgenticRetrieveFailures" +_ARGR = "AgenticRetrieveGeneratedResponse" +_an = "answer" +_ci = "citations" +_GA = "GuardrailAction" +_INTERVENED = "INTERVENED" +_ARGW = "AgenticRetrieveGuardrailWarning" +_id_ = "id" +_ver = "version" +_ac = "action" +_ARMPM = "AgenticRetrieveMemoryPersistenceMode" +_DEFAULT = "DEFAULT" +_ARMMK = "AgenticRetrieveMemoryMetadataKey" +_ARMMFL = "AgenticRetrieveMemoryMetadataFilterLeft" +_mK = "metadataKey" +_ARMMFO = "AgenticRetrieveMemoryMetadataFilterOperator" +_ET_ = "EQUALS_TO" +_EXISTS = "EXISTS" +_NE = "NOT_EXISTS" +_BEFORE = "BEFORE" +_AFTER = "AFTER" +_CONTAINS = "CONTAINS" +_GT = "GREATER_THAN" +_GTOE = "GREATER_THAN_OR_EQUALS" +_LT = "LESS_THAN" +_LTOE = "LESS_THAN_OR_EQUALS" +_ARMMSLI = "AgenticRetrieveMemoryMetadataStringListItem" +_ARMMSL = "AgenticRetrieveMemoryMetadataStringList" +_ARMMSV = "AgenticRetrieveMemoryMetadataStringValue" +_ARMMV = "AgenticRetrieveMemoryMetadataValue" +_sVt = "stringValue" +_nV = "numberValue" +_sLV = "stringListValue" +_dTV = "dateTimeValue" +_ARMMFR = "AgenticRetrieveMemoryMetadataFilterRight" +_mV = "metadataValue" +_ARMMF = "AgenticRetrieveMemoryMetadataFilter" +_le = "left" +_op = "operator" +_ri = "right" +_ARMMFLg = "AgenticRetrieveMemoryMetadataFilterList" +_MN = "MemoryNamespace" +_MSI = "MemoryStrategyId" +_ARMRC = "AgenticRetrieveMemoryRetrievalConfig" +_mF = "metadataFilters" +_ARMRCL = "AgenticRetrieveMemoryRetrievalConfigList" +_ARMSB = "AgenticRetrieveMemorySessionBinding" +_aIc = "actorId" +_sIe = "sessionId" +_ARMCg = "AgenticRetrieveMemoryConfiguration" +_sB = "sessionBinding" +_rCet = "retrievalConfigs" +_pM = "persistenceMode" +_CR = "ConversationRole" +_USER = "USER" +_us = "user" +_ASSISTANT = "ASSISTANT" +_as = "assistant" +_ARM = "AgenticRetrieveMessage" +_ro = "role" +_ARMg = "AgenticRetrieveMessages" +_ARMge = "AgenticRetrieveMetadata" +_ARPC = "AgenticRetrievePolicyConfiguration" +_bGC = "bedrockGuardrailConfiguration" +_KBI = "KnowledgeBaseId" +_FK = "FilterKey" +_FV = "FilterValue" +_FA = "FilterAttribute" +_ARRE = "AgenticRetrieveResponseEvent" +_NT = "NextToken" +_MT = "MimeType" +_RCet = "RetrievalContent" +_bC = "byteContent" +_mT = "mimeType" +_ARRI = "AgenticRetrieveResultItem" +_ARR = "AgenticRetrieveResults" +_ARREg = "AgenticRetrieveResultEvent" +_res = "results" +_gR = "generatedResponse" +_nT = "nextToken" +_ART = "AgenticRetrieveType" +_BKB = "BEDROCK_KNOWLEDGE_BASE" +_BKBe = "BedrockKnowledgeBase" +_BACM = "BEDROCK_AGENT_CORE_MEMORY" +_BACMe = "BedrockAgentCoreMemory" +_ARSM = "AgenticRetrieveSourceMetadata" +_rT = "retrievalType" +_ARSML = "AgenticRetrieveSourceMetadataList" +_ARS = "AgenticRetrieveStatus" +_IP = "IN_PROGRESS" +_SUCCEEDED = "SUCCEEDED" +_FAILED = "FAILED" +_ARSg = "AgenticRetrieveStep" +_PLANNING = "PLANNING" +_Pl = "Planning" +_RETRIEVAL = "RETRIEVAL" +_R = "Retrieval" +_SR_ = "SPECULATIVE_RETRIEVAL" +_SRp = "SpeculativeRetrieval" +_FDE = "FULL_DOCUMENT_EXPANSION" +_FDEu = "FullDocumentExpansion" +_SHL = "SESSION_HISTORY_LOAD" +_SHLe = "SessionHistoryLoad" +_UCs = "UserContext" +_uI = "userId" +_BGE = "BadGatewayException" +_se = "server" +_rN = "resourceName" +_CE = "ConflictException" +_DFE = "DependencyFailedException" +_ISE = "InternalServerException" +_rea = "reason" +_RNFE = "ResourceNotFoundException" +_SQEE = "ServiceQuotaExceededException" +_TE = "ThrottlingException" +_ARTRI = "AgenticRetrieveTraceResultItem" +_ARTR = "AgenticRetrieveTraceResults" +_ARWM = "AgenticRetrieveWarningMessage" +_ARW = "AgenticRetrieveWarning" +_gu = "guardrail" +_ARWg = "AgenticRetrieveWarnings" +_ARTEA = "AgenticRetrieveTraceEventAttributes" +_ste = "step" +_sta = "status" +_act = "actions" +_wa = "warnings" +_fa = "failures" +_rM = "retrievalMetadata" +_rR = "retrievalResponse" +_ARTE = "AgenticRetrieveTraceEvent" +_ti = "timestamp" +_at = "attributes" +_VE = "ValidationException" +_ARSRO = "AgenticRetrieveStreamResponseOutput" +_smith = "smithy.api#streaming" +_resu = "result" +_tE = "traceEvent" +_rE = "responseEvent" +_iSE = "internalServerException" +_vE = "validationException" +_rNFE = "resourceNotFoundException" +_sQEE = "serviceQuotaExceededException" +_tEh = "throttlingException" +_aDE = "accessDeniedException" +_cE = "conflictException" +_dFE = "dependencyFailedException" +_bGE = "badGatewayException" +_ARSO = "AgenticRetrieveStreamOutput" +_sSI = "smithy.synthetic#originalShapeId" +_cARSR = "com.amazonaws.bedrockagentruntime#AgenticRetrieveStreamResponse" +_smithy = "smithy.api#output" +_str = "stream" +_sP = "smithy.api#httpPayload" +_AI = "AgentId" +_AV = "AgentVersion" +_C = "Caller" +_aAA = "agentAliasArn" +_CC = "CallerChain" +_SIe = "SessionId" +_COTE = "CustomOrchestrationTraceEvent" +_TI = "TraceId" +_COT = "CustomOrchestrationTrace" +_tI = "traceId" +_e = "event" +_FRS = "FailureReasonString" +_FT = "FailureTrace" +_fRa = "failureReason" +_fC = "failureCode" +_GCPA = "GuardrailContentPolicyAction" +_BLOCKED = "BLOCKED" +_GCFC = "GuardrailContentFilterConfidence" +_LOW = "LOW" +_MEDIUM = "MEDIUM" +_HIGH = "HIGH" +_GCFT = "GuardrailContentFilterType" +_INSULTS = "INSULTS" +_HATE = "HATE" +_SEXUAL = "SEXUAL" +_VIOLENCE = "VIOLENCE" +_MISCONDUCT = "MISCONDUCT" +_PA = "PROMPT_ATTACK" +_GCF = "GuardrailContentFilter" +_con = "confidence" +_GCFL = "GuardrailContentFilterList" +_GCPAu = "GuardrailContentPolicyAssessment" +_fi = "filters" +_GSIPA = "GuardrailSensitiveInformationPolicyAction" +_ANONYMIZED = "ANONYMIZED" +_GPET = "GuardrailPiiEntityType" +_ADDRESS = "ADDRESS" +_AGE_ = "AGE" +_AAK = "AWS_ACCESS_KEY" +_ASK = "AWS_SECRET_KEY" +_CHN = "CA_HEALTH_NUMBER" +_CSIN = "CA_SOCIAL_INSURANCE_NUMBER" +_CDCC = "CREDIT_DEBIT_CARD_CVV" +_CDCE = "CREDIT_DEBIT_CARD_EXPIRY" +_CDCN = "CREDIT_DEBIT_CARD_NUMBER" +_DI = "DRIVER_ID" +_EMAIL = "EMAIL" +_IBAN = "INTERNATIONAL_BANK_ACCOUNT_NUMBER" +_IA = "IP_ADDRESS" +_LP = "LICENSE_PLATE" +_MA = "MAC_ADDRESS" +_NAME = "NAME" +_PASSWORD = "PASSWORD" +_PHONE = "PHONE" +_PIN = "PIN" +_SC = "SWIFT_CODE" +_UNHSN = "UK_NATIONAL_HEALTH_SERVICE_NUMBER" +_UNIN = "UK_NATIONAL_INSURANCE_NUMBER" +_UUTRN = "UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER" +_URL = "URL" +_USERNAME = "USERNAME" +_UBAN = "US_BANK_ACCOUNT_NUMBER" +_UBRN = "US_BANK_ROUTING_NUMBER" +_UITIN = "US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER" +_UPN = "US_PASSPORT_NUMBER" +_USSN = "US_SOCIAL_SECURITY_NUMBER" +_VIN = "VEHICLE_IDENTIFICATION_NUMBER" +_GPEF = "GuardrailPiiEntityFilter" +_ma = "match" +_GPEFL = "GuardrailPiiEntityFilterList" +_GRF = "GuardrailRegexFilter" +_reg = "regex" +_GRFL = "GuardrailRegexFilterList" +_GSIPAu = "GuardrailSensitiveInformationPolicyAssessment" +_pE = "piiEntities" +_rege = "regexes" +_GTPA = "GuardrailTopicPolicyAction" +_GTT = "GuardrailTopicType" +_GTu = "GuardrailTopic" +_GTL = "GuardrailTopicList" +_GTPAu = "GuardrailTopicPolicyAssessment" +_to = "topics" +_GWPA = "GuardrailWordPolicyAction" +_GCW = "GuardrailCustomWord" +_GCWL = "GuardrailCustomWordList" +_GMWT = "GuardrailManagedWordType" +_PROFANITY = "PROFANITY" +_GMW = "GuardrailManagedWord" +_GMWL = "GuardrailManagedWordList" +_GWPAu = "GuardrailWordPolicyAssessment" +_cW = "customWords" +_mWL = "managedWordLists" +_GAu = "GuardrailAssessment" +_tP = "topicPolicy" +_cP = "contentPolicy" +_wP = "wordPolicy" +_sIP = "sensitiveInformationPolicy" +_GAL = "GuardrailAssessmentList" +_GTua = "GuardrailTrace" +_iA = "inputAssessments" +_oA = "outputAssessments" +_Fi = "Files" +_CIII = "CodeInterpreterInvocationInput" +_cod = "code" +_fil = "files" +_IT = "InvocationType" +_AG = "ACTION_GROUP" +_KB = "KNOWLEDGE_BASE" +_FINISH = "FINISH" +_AGCI = "ACTION_GROUP_CODE_INTERPRETER" +_AC__ = "AGENT_COLLABORATOR" +_TKBI = "TraceKnowledgeBaseId" +_KBLIS = "KnowledgeBaseLookupInputString" +_KBLI = "KnowledgeBaseLookupInput" +_kBI = "knowledgeBaseId" +_IInv = "InvocationInput" +_iTn = "invocationType" +_aGII = "actionGroupInvocationInput" +_kBLI = "knowledgeBaseLookupInput" +_cIII = "codeInterpreterInvocationInput" +_aCII = "agentCollaboratorInvocationInput" +_MI = "ModelIdentifier" +_ML = "MaximumLength" +_SS = "StopSequences" +_T = "Temperature" +_TK = "TopK" +_TP = "TopP" +_IC = "InferenceConfiguration" +_tem = "temperature" +_tPo = "topP" +_tK = "topK" +_mL = "maximumLength" +_sS = "stopSequences" +_LA = "LambdaArn" +_CMr = "CreationMode" +_OVERRIDDEN = "OVERRIDDEN" +_PTr = "PromptText" +_PTro = "PromptType" +_PP_ = "PRE_PROCESSING" +_ORCHESTRATION = "ORCHESTRATION" +_KBRG = "KNOWLEDGE_BASE_RESPONSE_GENERATION" +_PP__ = "POST_PROCESSING" +_RC_ = "ROUTING_CLASSIFIER" +_MII = "ModelInvocationInput" +_oL = "overrideLambda" +_pCM = "promptCreationMode" +_iC = "inferenceConfiguration" +_pMa = "parserMode" +_fM = "foundationModel" +_RR = "RawResponse" +_RTB = "ReasoningTextBlock" +_si = "signature" +_RCB = "ReasoningContentBlock" +_rTe = "reasoningText" +_rCed = "redactedContent" +_OMIO = "OrchestrationModelInvocationOutput" +_rRa = "rawResponse" +_rCea = "reasoningContent" +_CIIO = "CodeInterpreterInvocationOutput" +_eO = "executionOutput" +_eE = "executionError" +_eTx = "executionTimeout" +_FRSi = "FinalResponseString" +_FRi = "FinalResponse" +_AS = "AudioSegment" +_sU = "s3Uri" +_tr = "transcription" +_RRCCT = "RetrievalResultContentColumnType" +_BLOB = "BLOB" +_DOUBLE = "DOUBLE" +_NULL = "NULL" +_LONG = "LONG" +_RRCC = "RetrievalResultContentColumn" +_cNo = "columnName" +_cV = "columnValue" +_RRCR = "RetrievalResultContentRow" +_RRCT = "RetrievalResultContentType" +_IMAGE = "IMAGE" +_ROW = "ROW" +_AUDIO = "AUDIO" +_VIDEO = "VIDEO" +_VS = "VideoSegment" +_su = "summary" +_RRC = "RetrievalResultContent" +_v_ = "" +_vi = "video" +_au = "audio" +_row = "row" +_RRCL = "RetrievalResultConfluenceLocation" +_ur = "url" +_RRCDL = "RetrievalResultCustomDocumentLocation" +_RRGDL = "RetrievalResultGoogleDriveLocation" +_RRKDL = "RetrievalResultKendraDocumentLocation" +_uri = "uri" +_RRODL = "RetrievalResultOneDriveLocation" +_RRSL = "RetrievalResultS3Location" +_RRSLe = "RetrievalResultSalesforceLocation" +_RRSPL = "RetrievalResultSharePointLocation" +_RRSLet = "RetrievalResultSqlLocation" +_q = "query" +_RRLT = "RetrievalResultLocationType" +_S = "S3" +_WEB = "WEB" +_CONFLUENCE = "CONFLUENCE" +_SALESFORCE = "SALESFORCE" +_SHAREPOINT = "SHAREPOINT" +_KENDRA = "KENDRA" +_SQL = "SQL" +_ONEDRIVE = "ONEDRIVE" +_GOOGLEDRIVE = "GOOGLEDRIVE" +_RRWL = "RetrievalResultWebLocation" +_RRL = "RetrievalResultLocation" +_sL = "s3Location" +_wL = "webLocation" +_cL = "confluenceLocation" +_sLa = "salesforceLocation" +_sPL = "sharePointLocation" +_cDL = "customDocumentLocation" +_kDL = "kendraDocumentLocation" +_sLq = "sqlLocation" +_oDL = "oneDriveLocation" +_gDL = "googleDriveLocation" +_RRMK = "RetrievalResultMetadataKey" +_RRMV = "RetrievalResultMetadataValue" +_RRM = "RetrievalResultMetadata" +_RRe = "RetrievedReference" +_lo = "location" +_RRet = "RetrievedReferences" +_KBLO = "KnowledgeBaseLookupOutput" +_rRe = "retrievedReferences" +_So = "Source" +_PARSER = "PARSER" +_RRep = "RepromptResponse" +_Ty = "Type" +_AU_ = "ASK_USER" +_O = "Observation" +_aGIO = "actionGroupInvocationOutput" +_aCIO = "agentCollaboratorInvocationOutput" +_kBLO = "knowledgeBaseLookupOutput" +_fRi = "finalResponse" +_rRep = "repromptResponse" +_cIIO = "codeInterpreterInvocationOutput" +_RSa = "RationaleString" +_Ra = "Rationale" +_OT = "OrchestrationTrace" +_ra = "rationale" +_iInv = "invocationInput" +_ob = "observation" +_mII = "modelInvocationInput" +_mIO = "modelInvocationOutput" +_OS = "OutputString" +_PPPR = "PostProcessingParsedResponse" +_PPMIO = "PostProcessingModelInvocationOutput" +_pR = "parsedResponse" +_PPT = "PostProcessingTrace" +_PPPRr = "PreProcessingParsedResponse" +_iV = "isValid" +_PPMIOr = "PreProcessingModelInvocationOutput" +_PPTr = "PreProcessingTrace" +_RCMIO = "RoutingClassifierModelInvocationOutput" +_RCT = "RoutingClassifierTrace" +_Tr = "Trace" +_gT = "guardrailTrace" +_pPT = "preProcessingTrace" +_oTr = "orchestrationTrace" +_pPTo = "postProcessingTrace" +_rCT = "routingClassifierTrace" +_fT = "failureTrace" +_cOT = "customOrchestrationTrace" +_TPr = "TracePart" +_tra = "trace" +_cCa = "callerChain" +_eTv = "eventTime" +_aAI = "agentAliasId" +_aV = "agentVersion" +_ATg = "AgentTraces" +_DSI = "DataSourceId" +_DIo = "DocumentId" +_KBIn = "KnowledgeBaseIdentifier" +_CIDAI = "CheckIngestedDocumentAclInput" +_cCIDAR = "com.amazonaws.bedrockagentruntime#CheckIngestedDocumentAclRequest" +_smithya = "smithy.api#input" +_sLm = "smithy.api#httpLabel" +_dSI = "dataSourceId" +_uC = "userContext" +_CIDAO = "CheckIngestedDocumentAclOutput" +_cCIDARo = "com.amazonaws.bedrockagentruntime#CheckIngestedDocumentAclResponse" +_hA = "hasAccess" +_CIDA = "CheckIngestedDocumentAcl" +_smithyap = "smithy.api#http" +_FEI = "FlowExecutionIdentifier" +_FAI = "FlowAliasIdentifier" +_FI = "FlowIdentifier" +_GEFSI = "GetExecutionFlowSnapshotInput" +_cGEFSR = "com.amazonaws.bedrockagentruntime#GetExecutionFlowSnapshotRequest" +_fI = "flowIdentifier" +_fAI = "flowAliasIdentifier" +_eIx = "executionIdentifier" +_KKA = "KmsKeyArn" +_FERA = "FlowExecutionRoleArn" +_Ve = "Version" +_GEFSO = "GetExecutionFlowSnapshotOutput" +_cGEFSRo = "com.amazonaws.bedrockagentruntime#GetExecutionFlowSnapshotResponse" +_fV = "flowVersion" +_eRA = "executionRoleArn" +_de = "definition" +_cEKA = "customerEncryptionKeyArn" +_GEFS = "GetExecutionFlowSnapshot" +_GFEI = "GetFlowExecutionInput" +_cGFER = "com.amazonaws.bedrockagentruntime#GetFlowExecutionRequest" +_FEET = "FlowExecutionErrorType" +_TO = "TIMED_OUT" +_ETO = "ExecutionTimedOut" +_NN = "NodeName" +_FEE = "FlowExecutionError" +_nN = "nodeName" +_er = "error" +_FEEl = "FlowExecutionErrors" +_FES = "FlowExecutionStatus" +_RUNNING = "RUNNING" +_Ru = "Running" +_Su = "Succeeded" +_Fa = "Failed" +_TOi = "TimedOut" +_ABORTED = "ABORTED" +_A = "Aborted" +_GFEO = "GetFlowExecutionOutput" +_cGFERo = "com.amazonaws.bedrockagentruntime#GetFlowExecutionResponse" +_eA = "executionArn" +_sA = "startedAt" +_eAn = "endedAt" +_err = "errors" +_GFE = "GetFlowExecution" +_FEETl = "FlowExecutionEventType" +_NODE = "NODE" +_No = "Node" +_FLOW = "FLOW" +_Fl = "Flow" +_MR = "MaxResults" +_LFEEI = "ListFlowExecutionEventsInput" +_cLFEER = "com.amazonaws.bedrockagentruntime#ListFlowExecutionEventsRequest" +_mRa = "maxResults" +_sQ = "smithy.api#httpQuery" +_eTve = "eventType" +_SCa = "SatisfiedCondition" +_cNon = "conditionName" +_SCat = "SatisfiedConditions" +_CRE = "ConditionResultEvent" +_sC = "satisfiedConditions" +_FEC = "FlowErrorCode" +_VALIDATION = "VALIDATION" +_IS = "INTERNAL_SERVER" +_NEF = "NODE_EXECUTION_FAILED" +_FFE = "FlowFailureEvent" +_eC = "errorCode" +_eM = "errorMessage" +_FECl = "FlowExecutionContent" +_do = "document" +_NIN = "NodeInputName" +_FIF = "FlowInputField" +_FIFl = "FlowInputFields" +_FEIE = "FlowExecutionInputEvent" +_fie = "fields" +_NON = "NodeOutputName" +_FOF = "FlowOutputField" +_FOFl = "FlowOutputFields" +_FEOE = "FlowExecutionOutputEvent" +_NAE = "NodeActionEvent" +_rIe = "requestId" +_sN = "serviceName" +_oN = "operationName" +_oR = "operationRequest" +_oRp = "operationResponse" +_NTE = "NodeTraceElements" +_aT = "agentTraces" +_NDE = "NodeDependencyEvent" +_tEr = "traceElements" +_NEC = "NodeErrorCode" +_DF = "DEPENDENCY_FAILED" +_BG = "BAD_GATEWAY" +_NFE = "NodeFailureEvent" +_FNIC = "FlowNodeInputCategory" +_LC = "LOOP_CONDITION" +_LCo = "LoopCondition" +_RVTLS = "RETURN_VALUE_TO_LOOP_START" +_RVTLSe = "ReturnValueToLoopStart" +_EL = "EXIT_LOOP" +_ELx = "ExitLoop" +_NECo = "NodeExecutionContent" +_FCNT = "FlowControlNodeType" +_ITERATOR = "ITERATOR" +_I = "Iterator" +_LOOP = "LOOP" +_L = "Loop" +_NIECI = "NodeInputExecutionChainItem" +_ind = "index" +_NIEC = "NodeInputExecutionChain" +_FNIE = "FlowNodeInputExpression" +_FNON = "FlowNodeOutputName" +_NIS = "NodeInputSource" +_oFN = "outputFieldName" +_ex = "expression" +_FNIODT = "FlowNodeIODataType" +_St = "String" +_Nu = "Number" +_B = "Boolean" +_OBJECT = "OBJECT" +_Ob = "Object" +_Ar = "Array" +_NIF = "NodeInputField" +_ca = "category" +_eCx = "executionChain" +_NIFo = "NodeInputFields" +_NIE = "NodeInputEvent" +_FNIN = "FlowNodeInputName" +_NONo = "NodeOutputNext" +_iFN = "inputFieldName" +_NONL = "NodeOutputNextList" +_NOF = "NodeOutputField" +_ne = "next" +_NOFo = "NodeOutputFields" +_NOE = "NodeOutputEvent" +_FEElo = "FlowExecutionEvent" +_fIE = "flowInputEvent" +_fOE = "flowOutputEvent" +_nIE = "nodeInputEvent" +_nOE = "nodeOutputEvent" +_cRE = "conditionResultEvent" +_nFE = "nodeFailureEvent" +_fFE = "flowFailureEvent" +_nAE = "nodeActionEvent" +_nDE = "nodeDependencyEvent" +_FEElow = "FlowExecutionEvents" +_LFEEO = "ListFlowExecutionEventsOutput" +_cLFEERo = "com.amazonaws.bedrockagentruntime#ListFlowExecutionEventsResponse" +_fEE = "flowExecutionEvents" +_LFEE = "ListFlowExecutionEvents" +_LFEI = "ListFlowExecutionsInput" +_cLFER = "com.amazonaws.bedrockagentruntime#ListFlowExecutionsRequest" +_FESl = "FlowExecutionSummary" +_cA = "createdAt" +_FESlo = "FlowExecutionSummaries" +_LFEO = "ListFlowExecutionsOutput" +_cLFERo = "com.amazonaws.bedrockagentruntime#ListFlowExecutionsResponse" +_fES = "flowExecutionSummaries" +_LFE = "ListFlowExecutions" +_FEN = "FlowExecutionName" +_FIC = "FlowInputContent" +_FIl = "FlowInput" +_nON = "nodeOutputName" +_nIN = "nodeInputName" +_FIlo = "FlowInputs" +_PCL = "PerformanceConfigLatency" +_STANDARD = "STANDARD" +_stan = "standard" +_OPTIMIZED = "OPTIMIZED" +_opt = "optimized" +_PC = "PerformanceConfiguration" +_la = "latency" +_MPC = "ModelPerformanceConfiguration" +_pC = "performanceConfig" +_SFEI = "StartFlowExecutionInput" +_cSFER = "com.amazonaws.bedrockagentruntime#StartFlowExecutionRequest" +_fEN = "flowExecutionName" +_inp = "inputs" +_mPC = "modelPerformanceConfiguration" +_SFEO = "StartFlowExecutionOutput" +_cSFERo = "com.amazonaws.bedrockagentruntime#StartFlowExecutionResponse" +_SFE = "StartFlowExecution" +_SFEIt = "StopFlowExecutionInput" +_cSFERom = "com.amazonaws.bedrockagentruntime#StopFlowExecutionRequest" +_SFEOt = "StopFlowExecutionOutput" +_cSFERoma = "com.amazonaws.bedrockagentruntime#StopFlowExecutionResponse" +_SFEt = "StopFlowExecution" +_FEIl = "FlowExecutionId" +_IFI = "InvokeFlowInput" +_cIFR = "com.amazonaws.bedrockagentruntime#InvokeFlowRequest" +_eTna = "enableTrace" +_eIxe = "executionId" +_FCR = "FlowCompletionReason" +_SUCCESS = "SUCCESS" +_IR = "INPUT_REQUIRED" +_FCE = "FlowCompletionEvent" +_cR = "completionReason" +_FMTIC = "FlowMultiTurnInputContent" +_NTo = "NodeType" +_FIN = "FLOW_INPUT_NODE" +_FINl = "FlowInputNode" +_FON = "FLOW_OUTPUT_NODE" +_FONl = "FlowOutputNode" +_LFN = "LAMBDA_FUNCTION_NODE" +_LFNa = "LambdaFunctionNode" +_KBN = "KNOWLEDGE_BASE_NODE" +_KBNn = "KnowledgeBaseNode" +_PN_ = "PROMPT_NODE" +_PNr = "PromptNode" +_CN = "CONDITION_NODE" +_CNo = "ConditionNode" +_LN = "LEX_NODE" +_LNe = "LexNode" +_FMTIRE = "FlowMultiTurnInputRequestEvent" +_nTo = "nodeType" +_FOC = "FlowOutputContent" +_FOE = "FlowOutputEvent" +_FTC = "FlowTraceCondition" +_FTCl = "FlowTraceConditions" +_FTCNRE = "FlowTraceConditionNodeResultEvent" +_FTNAE = "FlowTraceNodeActionEvent" +_TEr = "TraceElements" +_FTDE = "FlowTraceDependencyEvent" +_FTNIC = "FlowTraceNodeInputContent" +_FTNIECI = "FlowTraceNodeInputExecutionChainItem" +_FTNIEC = "FlowTraceNodeInputExecutionChain" +_FTNIS = "FlowTraceNodeInputSource" +_FTNIF = "FlowTraceNodeInputField" +_FTNIFl = "FlowTraceNodeInputFields" +_FTNIE = "FlowTraceNodeInputEvent" +_FTNOC = "FlowTraceNodeOutputContent" +_FTNON = "FlowTraceNodeOutputNext" +_FTNONL = "FlowTraceNodeOutputNextList" +_FTNOF = "FlowTraceNodeOutputField" +_FTNOFl = "FlowTraceNodeOutputFields" +_FTNOE = "FlowTraceNodeOutputEvent" +_FTl = "FlowTrace" +_nIT = "nodeInputTrace" +_nOT = "nodeOutputTrace" +_cNRT = "conditionNodeResultTrace" +_nAT = "nodeActionTrace" +_nDT = "nodeDependencyTrace" +_FTE = "FlowTraceEvent" +_FRSl = "FlowResponseStream" +_fCE = "flowCompletionEvent" +_fTE = "flowTraceEvent" +_fMTIRE = "flowMultiTurnInputRequestEvent" +_IFO = "InvokeFlowOutput" +_cIFRo = "com.amazonaws.bedrockagentruntime#InvokeFlowResponse" +_rSe = "responseStream" +_sH = "smithy.api#httpHeader" +_xabfei = "x-amz-bedrock-flow-execution-id" +_IF = "InvokeFlow" +_IQT = "InputQueryType" +_QGI = "QueryGenerationInput" +_QTM = "QueryTransformationMode" +_TTS = "TEXT_TO_SQL" +_KBA = "KnowledgeBaseArn" +_TTSKBC = "TextToSqlKnowledgeBaseConfiguration" +_kBA = "knowledgeBaseArn" +_TTSCT = "TextToSqlConfigurationType" +_TTSC = "TextToSqlConfiguration" +_kBC = "knowledgeBaseConfiguration" +_TC = "TransformationConfiguration" +_mo = "mode" +_tTSC = "textToSqlConfiguration" +_GQI = "GenerateQueryInput" +_cGQR = "com.amazonaws.bedrockagentruntime#GenerateQueryRequest" +_qGI = "queryGenerationInput" +_tC = "transformationConfiguration" +_GQT = "GeneratedQueryType" +_RS_ = "REDSHIFT_SQL" +_GQ = "GeneratedQuery" +_sq = "sql" +_GQe = "GeneratedQueries" +_GQO = "GenerateQueryOutput" +_cGQRo = "com.amazonaws.bedrockagentruntime#GenerateQueryResponse" +_qu = "queries" +_GQen = "GenerateQuery" +_DOF = "DocumentOutputFormat" +_RAW = "RAW" +_EXTRACTED = "EXTRACTED" +_GDCI = "GetDocumentContentInput" +_cGDCR = "com.amazonaws.bedrockagentruntime#GetDocumentContentRequest" +_oF = "outputFormat" +_PU = "PresignedUrl" +_GDCO = "GetDocumentContentOutput" +_cGDCRo = "com.amazonaws.bedrockagentruntime#GetDocumentContentResponse" +_pU = "presignedUrl" +_dCL = "documentContentLength" +_GDC = "GetDocumentContent" +_GIDAI = "GetIngestedDocumentAclInput" +_cGIDAR = "com.amazonaws.bedrockagentruntime#GetIngestedDocumentAclRequest" +_DAMR = "DocumentAclMemberRelation" +_AND = "AND" +_OR = "OR" +_DAMT = "DocumentAclMembershipType" +_DS = "DATA_SOURCE" +_DAG = "DocumentAclGroup" +_DAGL = "DocumentAclGroupList" +_DAU = "DocumentAclUser" +_DAUL = "DocumentAclUserList" +_DAC = "DocumentAclCondition" +_cO = "conditionOperator" +_use = "users" +_gr = "groups" +_DACL = "DocumentAclConditionList" +_DAM = "DocumentAclMembership" +_mRe = "memberRelation" +_cond = "conditions" +_DA = "DocumentAcl" +_aL = "allowList" +_dL = "denyList" +_GIDAO = "GetIngestedDocumentAclOutput" +_cGIDARo = "com.amazonaws.bedrockagentruntime#GetIngestedDocumentAclResponse" +_dA = "documentAcl" +_GIDA = "GetIngestedDocumentAcl" +_BMC = "BedrockModelConfigurations" +_ITn = "InputText" +_MIe = "MemoryId" +_PCC = "PromptCreationConfigurations" +_pCTTI = "previousConversationTurnsToInclude" +_ePTS = "excludePreviousThinkingSteps" +_CBo = "ContentBlock" +_CBon = "ContentBlocks" +_Me = "Message" +_Mes = "Messages" +_CH = "ConversationHistory" +_mes = "messages" +_BCB = "ByteContentBlob" +_BCF = "ByteContentFile" +_mTe = "mediaType" +_da = "data" +_SU = "S3Uri" +_SOF = "S3ObjectFile" +_FST = "FileSourceType" +_BC = "BYTE_CONTENT" +_FSi = "FileSource" +_sTo = "sourceType" +_FUC = "FileUseCase" +_CI = "CODE_INTERPRETER" +_CHAT = "CHAT" +_IFn = "InputFile" +_uCs = "useCase" +_IFnp = "InputFiles" +_RMSM = "RerankingMetadataSelectionMode" +_SELECTIVE = "SELECTIVE" +_ALL = "ALL" +_FFR = "FieldForReranking" +_fN = "fieldName" +_FFRi = "FieldsForReranking" +_RMSMC = "RerankingMetadataSelectiveModeConfiguration" +_fTI = "fieldsToInclude" +_fTEi = "fieldsToExclude" +_MCFR = "MetadataConfigurationForReranking" +_sM = "selectionMode" +_sMC = "selectiveModeConfiguration" +_BRMA = "BedrockRerankingModelArn" +_MSBRMC = "ManagedSearchBedrockRerankingModelConfiguration" +_aMRF = "additionalModelRequestFields" +_MSBRC = "ManagedSearchBedrockRerankingConfiguration" +_nORR = "numberOfRerankedResults" +_mCe = "metadataConfiguration" +_MSRCT = "ManagedSearchRerankingConfigurationType" +_MSRC = "ManagedSearchRerankingConfiguration" +_RMT = "RerankingModelType" +_ATt = "AttributeType" +_SL = "STRING_LIST" +_MAS = "MetadataAttributeSchema" +_MASL = "MetadataAttributeSchemaList" +_IFC = "ImplicitFilterConfiguration" +_mAe = "metadataAttributes" +_ST = "SearchType" +_HYBRID = "HYBRID" +_SEMANTIC = "SEMANTIC" +_VSBRMC = "VectorSearchBedrockRerankingModelConfiguration" +_VSBRC = "VectorSearchBedrockRerankingConfiguration" +_VSRCT = "VectorSearchRerankingConfigurationType" +_VSRC = "VectorSearchRerankingConfiguration" +_PSAM = "PromptSessionAttributesMap" +_SAM = "SessionAttributesMap" +_AWSRARN = "AWSResourceARN" +_SCt = "StreamingConfigurations" +_sFR = "streamFinalResponse" +_aGI = "applyGuardrailInterval" +_Sp = "Span" +_star = "start" +_en = "end" +_TRP = "TextResponsePart" +_sp = "span" +_GRP = "GeneratedResponsePart" +_tRP = "textResponsePart" +_Ci = "Citation" +_gRP = "generatedResponsePart" +_Cit = "Citations" +_At = "Attribution" +_PB = "PartBody" +_PPa = "PayloadPart" +_att = "attribution" +_FB = "FileBody" +_OF = "OutputFile" +_OFu = "OutputFiles" +_FPi = "FilePart" +_MNRE = "ModelNotReadyException" +_RSe = "ResponseStream" +_ch = "chunk" +_rCetu = "returnControl" +_mNRE = "modelNotReadyException" +_IAO = "InvokeAgentOutput" +_cIAR = "com.amazonaws.bedrockagentruntime#InvokeAgentResponse" +_com = "completion" +_cT = "contentType" +_xabact = "x-amzn-bedrock-agent-content-type" +_xabasi = "x-amz-bedrock-agent-session-id" +_xabami = "x-amz-bedrock-agent-memory-id" +_IBMC = "InlineBedrockModelConfigurations" +_CIo = "CollaborationInstruction" +_RCH = "RelayConversationHistory" +_TC_ = "TO_COLLABORATOR" +_CCo = "CollaboratorConfiguration" +_cI = "collaboratorInstruction" +_rCH = "relayConversationHistory" +_CCol = "CollaboratorConfigurations" +_GIWA = "GuardrailIdentifierWithArn" +_GV = "GuardrailVersion" +_GCWA = "GuardrailConfigurationWithArn" +_gIu = "guardrailIdentifier" +_STTL = "SessionTTL" +_In = "Instruction" +_BPT = "BasePromptTemplate" +_PS = "PromptState" +_PCr = "PromptConfiguration" +_pT = "promptType" +_pS = "promptState" +_bPT = "basePromptTemplate" +_PCro = "PromptConfigurations" +_POC = "PromptOverrideConfiguration" +_pCr = "promptConfigurations" +_OE = "OrchestrationExecutor" +_CO = "CustomOrchestration" +_exe = "executor" +_ISS = "InlineSessionState" +_sAe = "sessionAttributes" +_pSA = "promptSessionAttributes" +_cH = "conversationHistory" +_OTr = "OrchestrationType" +_CO_ = "CUSTOM_ORCHESTRATION" +_IAPP = "InlineAgentPayloadPart" +_IAFP = "InlineAgentFilePart" +_IARCP = "InlineAgentReturnControlPayload" +_IATP = "InlineAgentTracePart" +_IARS = "InlineAgentResponseStream" +_IIAO = "InvokeInlineAgentOutput" +_cIIAR = "com.amazonaws.bedrockagentruntime#InvokeInlineAgentResponse" +_DAMI = "DeleteAgentMemoryInput" +_cDAMR = "com.amazonaws.bedrockagentruntime#DeleteAgentMemoryRequest" +_DAMO = "DeleteAgentMemoryOutput" +_cDAMRo = "com.amazonaws.bedrockagentruntime#DeleteAgentMemoryResponse" +_DAMe = "DeleteAgentMemory" +_MTe = "MemoryType" +_SS_ = "SESSION_SUMMARY" +_GAMI = "GetAgentMemoryInput" +_cGAMR = "com.amazonaws.bedrockagentruntime#GetAgentMemoryRequest" +_mIa = "maxItems" +_mTem = "memoryType" +_STu = "SummaryText" +_MSS = "MemorySessionSummary" +_sST = "sessionStartTime" +_sET = "sessionExpiryTime" +_sTu = "summaryText" +_Mem = "Memory" +_sSe = "sessionSummary" +_Memo = "Memories" +_GAMO = "GetAgentMemoryOutput" +_cGAMRo = "com.amazonaws.bedrockagentruntime#GetAgentMemoryResponse" +_mCem = "memoryContents" +_GAM = "GetAgentMemory" +_TPe = "TextPrompt" +_IPn = "InputPrompt" +_tPe = "textPrompt" +_OPI = "OptimizePromptInput" +_cOPR = "com.amazonaws.bedrockagentruntime#OptimizePromptRequest" +_tMI = "targetModelId" +_APE = "AnalyzePromptEvent" +_OP = "OptimizedPrompt" +_OPE = "OptimizedPromptEvent" +_oP = "optimizedPrompt" +_OPS = "OptimizedPromptStream" +_oPE = "optimizedPromptEvent" +_aPE = "analyzePromptEvent" +_OPO = "OptimizePromptOutput" +_cOPRo = "com.amazonaws.bedrockagentruntime#OptimizePromptResponse" +_OPp = "OptimizePrompt" +_RTD = "RerankTextDocument" +_RQCT = "RerankQueryContentType" +_RQ = "RerankQuery" +_tQ = "textQuery" +_RQL = "RerankQueriesList" +_BRMC = "BedrockRerankingModelConfiguration" +_BRC = "BedrockRerankingConfiguration" +_nOR = "numberOfResults" +_RCTe = "RerankingConfigurationType" +_RCer = "RerankingConfiguration" +_RDT = "RerankDocumentType" +_JSON = "JSON" +_RDe = "RerankDocument" +_tD = "textDocument" +_jD = "jsonDocument" +_RST = "RerankSourceType" +_INLINE = "INLINE" +_RSer = "RerankSource" +_iDS = "inlineDocumentSource" +_RSL = "RerankSourcesList" +_RI = "RerankInput" +_cRR = "com.amazonaws.bedrockagentruntime#RerankRequest" +_sou = "sources" +_RRer = "RerankResult" +_rSel = "relevanceScore" +_RRLe = "RerankResultsList" +_RO = "RerankOutput" +_cRRo = "com.amazonaws.bedrockagentruntime#RerankResponse" +_Re = "Rerank" +_RAGI = "RetrieveAndGenerateInput" +_GC = "GuardrailConfiguration" +_MTa = "MaxTokens" +_RAGSS = "RAGStopSequences" +_TIC = "TextInferenceConfig" +_mTa = "maxTokens" +_ICn = "InferenceConfig" +_tIC = "textInferenceConfig" +_TPT = "TextPromptTemplate" +_PTrom = "PromptTemplate" +_tPT = "textPromptTemplate" +_ESGC = "ExternalSourcesGenerationConfiguration" +_pTr = "promptTemplate" +_gC = "guardrailConfiguration" +_iCn = "inferenceConfig" +_CT = "ContentType" +_Id = "Identifier" +_BCD = "ByteContentDoc" +_SOD = "S3ObjectDoc" +_EST = "ExternalSourceType" +_ES = "ExternalSource" +_ESx = "ExternalSources" +_ESRAGC = "ExternalSourcesRetrieveAndGenerateConfiguration" +_gCe = "generationConfiguration" +_GCe = "GenerationConfiguration" +_QTT = "QueryTransformationType" +_QD = "QUERY_DECOMPOSITION" +_QTC = "QueryTransformationConfiguration" +_OC = "OrchestrationConfiguration" +_qTC = "queryTransformationConfiguration" +_RAGT = "RetrieveAndGenerateType" +_ES_ = "EXTERNAL_SOURCES" +_RAGSC = "RetrieveAndGenerateSessionConfiguration" +_kKA = "kmsKeyArn" +_GAua = "GuadrailAction" +_RAGO = "RetrieveAndGenerateOutput" +_RAGOO = "RetrieveAndGenerateOperationOutput" +_cRAGR = "com.amazonaws.bedrockagentruntime#RetrieveAndGenerateResponse" +_gA = "guardrailAction" +_CEi = "CitationEvent" +_cit = "citation" +_GE = "GuardrailEvent" +_RAGOE = "RetrieveAndGenerateOutputEvent" +_RAGSRO = "RetrieveAndGenerateStreamResponseOutput" +_RAGSO = "RetrieveAndGenerateStreamOutput" +_cRAGSR = "com.amazonaws.bedrockagentruntime#RetrieveAndGenerateStreamResponse" +_xabkbsi = "x-amzn-bedrock-knowledge-base-session-id" +_IIFn = "InputImageFormat" +_IInp = "InputImage" +_iCnl = "inlineContent" +_KBQT = "KnowledgeBaseQueryType" +_KBQ = "KnowledgeBaseQuery" +_ima = "image" +_KBRR = "KnowledgeBaseRetrievalResult" +_sc = "score" +_KBRRn = "KnowledgeBaseRetrievalResults" +_ROe = "RetrieveOutput" +_cRRom = "com.amazonaws.bedrockagentruntime#RetrieveResponse" +_rRet = "retrievalResults" +_SMK = "SessionMetadataKey" +_SMV = "SessionMetadataValue" +_SMM = "SessionMetadataMap" +_TKa = "TagKey" +_TV = "TagValue" +_TM = "TagsMap" +_CSI = "CreateSessionInput" +_cCSR = "com.amazonaws.bedrockagentruntime#CreateSessionRequest" +_sMe = "sessionMetadata" +_eKA = "encryptionKeyArn" +_ta = "tags" +_SA = "SessionArn" +_Uu = "Uuid" +_SSe = "SessionStatus" +_ACTIVE = "ACTIVE" +_EXPIRED = "EXPIRED" +_ENDED = "ENDED" +_CSO = "CreateSessionOutput" +_cCSRo = "com.amazonaws.bedrockagentruntime#CreateSessionResponse" +_sAes = "sessionArn" +_sSes = "sessionStatus" +_CSr = "CreateSession" +_SIes = "SessionIdentifier" +_DSIe = "DeleteSessionInput" +_cDSR = "com.amazonaws.bedrockagentruntime#DeleteSessionRequest" +_sIes = "sessionIdentifier" +_DSO = "DeleteSessionOutput" +_cDSRo = "com.amazonaws.bedrockagentruntime#DeleteSessionResponse" +_DSe = "DeleteSession" +_ESI = "EndSessionInput" +_cESR = "com.amazonaws.bedrockagentruntime#EndSessionRequest" +_ESO = "EndSessionOutput" +_cESRo = "com.amazonaws.bedrockagentruntime#EndSessionResponse" +_ESn = "EndSession" +_GSI = "GetSessionInput" +_cGSR = "com.amazonaws.bedrockagentruntime#GetSessionRequest" +_GSO = "GetSessionOutput" +_cGSRo = "com.amazonaws.bedrockagentruntime#GetSessionResponse" +_lUA = "lastUpdatedAt" +_GS = "GetSession" +_ID = "InvocationDescription" +_CII = "CreateInvocationInput" +_cCIR = "com.amazonaws.bedrockagentruntime#CreateInvocationRequest" +_CIO = "CreateInvocationOutput" +_cCIRo = "com.amazonaws.bedrockagentruntime#CreateInvocationResponse" +_CIr = "CreateInvocation" +_IInvo = "InvocationIdentifier" +_LII = "ListInvocationsInput" +_cLIR = "com.amazonaws.bedrockagentruntime#ListInvocationsRequest" +_ISn = "InvocationSummary" +_ISnv = "InvocationSummaries" +_LIO = "ListInvocationsOutput" +_cLIRo = "com.amazonaws.bedrockagentruntime#ListInvocationsResponse" +_iS = "invocationSummaries" +_LI = "ListInvocations" +_GISI = "GetInvocationStepInput" +_cGISR = "com.amazonaws.bedrockagentruntime#GetInvocationStepRequest" +_iInvo = "invocationIdentifier" +_iSI = "invocationStepId" +_IFm = "ImageFormat" +_SLo = "S3Location" +_ISm = "ImageSource" +_IB = "ImageBlock" +_BSCB = "BedrockSessionContentBlock" +_BSCBe = "BedrockSessionContentBlocks" +_ISP = "InvocationStepPayload" +_cB = "contentBlocks" +_ISnvo = "InvocationStep" +_iST = "invocationStepTime" +_GISO = "GetInvocationStepOutput" +_cGISRo = "com.amazonaws.bedrockagentruntime#GetInvocationStepResponse" +_iSn = "invocationStep" +_GIS = "GetInvocationStep" +_LISI = "ListInvocationStepsInput" +_cLISR = "com.amazonaws.bedrockagentruntime#ListInvocationStepsRequest" +_ISSn = "InvocationStepSummary" +_ISSnv = "InvocationStepSummaries" +_LISO = "ListInvocationStepsOutput" +_cLISRo = "com.amazonaws.bedrockagentruntime#ListInvocationStepsResponse" +_iSS = "invocationStepSummaries" +_LIS = "ListInvocationSteps" +_PISI = "PutInvocationStepInput" +_cPISR = "com.amazonaws.bedrockagentruntime#PutInvocationStepRequest" +_PISO = "PutInvocationStepOutput" +_cPISRo = "com.amazonaws.bedrockagentruntime#PutInvocationStepResponse" +_PIS = "PutInvocationStep" +_LSI = "ListSessionsInput" +_cLSR = "com.amazonaws.bedrockagentruntime#ListSessionsRequest" +_SSes = "SessionSummary" +_SSess = "SessionSummaries" +_LSO = "ListSessionsOutput" +_cLSRo = "com.amazonaws.bedrockagentruntime#ListSessionsResponse" +_sSess = "sessionSummaries" +_LS = "ListSessions" +_USI = "UpdateSessionInput" +_cUSR = "com.amazonaws.bedrockagentruntime#UpdateSessionRequest" +_USO = "UpdateSessionOutput" +_cUSRo = "com.amazonaws.bedrockagentruntime#UpdateSessionResponse" +_US = "UpdateSession" +_TRA = "TaggableResourcesArn" +_LTFRI = "ListTagsForResourceInput" +_cLTFRR = "com.amazonaws.bedrockagentruntime#ListTagsForResourceRequest" +_rA = "resourceArn" +_LTFRO = "ListTagsForResourceOutput" +_cLTFRRo = "com.amazonaws.bedrockagentruntime#ListTagsForResourceResponse" +_LTFR = "ListTagsForResource" +_TRI = "TagResourceInput" +_cTRR = "com.amazonaws.bedrockagentruntime#TagResourceRequest" +_TRO = "TagResourceOutput" +_cTRRo = "com.amazonaws.bedrockagentruntime#TagResourceResponse" +_TR = "TagResource" +_TKL = "TagKeyList" +_URI = "UntagResourceInput" +_cURR = "com.amazonaws.bedrockagentruntime#UntagResourceRequest" +_tKa = "tagKeys" +_URO = "UntagResourceOutput" +_cURRo = "com.amazonaws.bedrockagentruntime#UntagResourceResponse" +_UR = "UntagResource" +_RF = "RetrievalFilter" +_eq = "equals" +_nE = "notEquals" +_gTr = "greaterThan" +_gTOE = "greaterThanOrEquals" +_lT = "lessThan" +_lTOE = "lessThanOrEquals" +_in_ = "in" +_nI = "notIn" +_sW = "startsWith" +_lC = "listContains" +_sCt = "stringContains" +_aA = "andAll" +_oAr = "orAll" +_RFL = "RetrievalFilterList" +_KBVSC = "KnowledgeBaseVectorSearchConfiguration" +_oST = "overrideSearchType" +_filt = "filter" +_iFC = "implicitFilterConfiguration" +_MSC = "ManagedSearchConfiguration" +_ROet = "RetrievalOverrides" +_mNOR = "maxNumberOfResults" +_KBRC = "KnowledgeBaseRetrieverConfiguration" +_rO = "retrievalOverrides" +_RCetr = "RetrieverConfiguration" +_kB = "knowledgeBase" +_ARg = "AgenticRetriever" +_conf = "configuration" +_ARge = "AgenticRetrievers" +_ARSI = "AgenticRetrieveStreamInput" +_cARSRo = "com.amazonaws.bedrockagentruntime#AgenticRetrieveStreamRequest" +_ret = "retrievers" +_aRC = "agenticRetrieveConfiguration" +_pCo = "policyConfiguration" +_mCemo = "memoryConfiguration" +_gRe = "generateResponse" +_KBRCn = "KnowledgeBaseRetrievalConfiguration" +_vSC = "vectorSearchConfiguration" +_mSC = "managedSearchConfiguration" +_ARSge = "AgenticRetrieveStream" +_KBn = "KnowledgeBase" +_rCetr = "retrievalConfiguration" +_KBC = "KnowledgeBaseConfiguration" +_KBRAGC = "KnowledgeBaseRetrieveAndGenerateConfiguration" +_oC = "orchestrationConfiguration" +_RIe = "RetrieveInput" +_cRRoma = "com.amazonaws.bedrockagentruntime#RetrieveRequest" +_rQ = "retrievalQuery" +_Ret = "Retrieve" +_KBCn = "KnowledgeBaseConfigurations" +_KBno = "KnowledgeBases" +_RAGC = "RetrieveAndGenerateConfiguration" +_eSC = "externalSourcesConfiguration" +_Co = "Collaborator" +_ins = "instruction" +_iSTTLIS = "idleSessionTTLInSeconds" +_aGc = "actionGroups" +_kBn = "knowledgeBases" +_pOC = "promptOverrideConfiguration" +_aC = "agentCollaboration" +_cCo = "collaboratorConfigurations" +_aN = "agentName" +_RAGOI = "RetrieveAndGenerateOperationInput" +_cRAGRo = "com.amazonaws.bedrockagentruntime#RetrieveAndGenerateRequest" +_rAGC = "retrieveAndGenerateConfiguration" +_sCe = "sessionConfiguration" +_RAGSI = "RetrieveAndGenerateStreamInput" +_cRAGSRo = "com.amazonaws.bedrockagentruntime#RetrieveAndGenerateStreamRequest" +_SSessi = "SessionState" +_kBCn = "knowledgeBaseConfigurations" +_RAG = "RetrieveAndGenerate" +_RAGS = "RetrieveAndGenerateStream" +_Col = "Collaborators" +_IAI = "InvokeAgentInput" +_cIARo = "com.amazonaws.bedrockagentruntime#InvokeAgentRequest" +_sSessi = "sessionState" +_eS = "endSession" +_iTnp = "inputText" +_bMC = "bedrockModelConfigurations" +_sCtr = "streamingConfigurations" +_pCC = "promptCreationConfigurations" +_sAo = "sourceArn" +_xasa = "x-amz-source-arn" +_IAn = "InvokeAgent" +_IIAI = "InvokeInlineAgentInput" +_cIIARo = "com.amazonaws.bedrockagentruntime#InvokeInlineAgentRequest" +_iSSn = "inlineSessionState" +_col = "collaborators" +_oTrc = "orchestrationType" +_cOu = "customOrchestration" +_IIA = "InvokeInlineAgent" +_ABARTS = "AmazonBedrockAgentRunTimeService" +_aw = "aws.auth#sigv4" +_sBm = "smithy.rules#endpointBdd" +_aws = "aws.api#service" +_aJ = "aws.protocols#restJson1" + +NON_BLANK_STRING: StaticSchema = (3, n0, _NBS, 0) + +ACCESS_DENIED_EXCEPTION: StaticSchema = ( + 18, + n0, + _ADE, + {_s: _c, _sE: 403}, + (_m,), + ((NON_BLANK_STRING, 0),), +) + +CUSTOM_CONTROL_METHOD: StaticSchema = (14, n0, _CCM, 0, (_RC,), ((-1, {_sV: _RC}),)) + +LAMBDA_RESOURCE_ARN: StaticSchema = (3, n0, _LRA, 0) + +ACTION_GROUP_EXECUTOR: StaticSchema = ( + 19, + n0, + _AGE, + 0, + (_l, _cC), + ((LAMBDA_RESOURCE_ARN, 0), (CUSTOM_CONTROL_METHOD, 0)), +) + +ACTION_GROUP_NAME: StaticSchema = (3, n0, _AGN, 4) + +API_PATH: StaticSchema = (3, n0, _AP, 4) + +EXECUTION_TYPE: StaticSchema = ( + 14, + n0, + _ET, + 0, + (_LAMBDA, _RC), + ((-1, {_sV: _LAMBDA}), (-1, {_sV: _RC})), +) + +FUNCTION: StaticSchema = (3, n0, _F, 4) + +PARAMETER: StaticSchema = (18, n0, _P, 0, (_n, _t, _v), ((3, 0), (3, 0), (3, 0))) + +PARAMETERS: StaticSchema = (16, n0, _Pa, 0, (_me,), ((PARAMETER, 0),)) + +CONTENT_MAP: StaticSchema = (17, n0, _CM, 0, (_k, _v), ((3, 0), (PARAMETERS, 0))) + +REQUEST_BODY: StaticSchema = (18, n0, _RB, 0, (_co,), ((CONTENT_MAP, 0),)) + +VERB: StaticSchema = (3, n0, _V, 4) + +ACTION_GROUP_INVOCATION_INPUT: StaticSchema = ( + 18, + n0, + _AGII, + 0, + (_aGN, _ve, _aP, _p, _rB, _f, _eT, _iI), + ( + (ACTION_GROUP_NAME, 0), + (VERB, 0), + (API_PATH, 0), + (PARAMETERS, 0), + (REQUEST_BODY, 0), + (FUNCTION, 0), + (EXECUTION_TYPE, 0), + (3, 0), + ), ) -ACTION_GROUP_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#ActionGroupName"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) +DATE_TIMESTAMP: StaticSchema = (4, n0, _DT, {_sF: _dt}) -API_PATH = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#ApiPath"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) +USAGE: StaticSchema = (18, n0, _U, 4, (_iT, _oT), ((7, 0), (7, 0))) -EXECUTION_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ExecutionType"), - shape_type=ShapeType.ENUM, - members={"LAMBDA": {"target": UNIT}, "RETURN_CONTROL": {"target": UNIT}}, +METADATA: StaticSchema = ( + 18, + n0, + _M, + 4, + (_sT, _eTn, _tTM, _oTTM, _cRI, _u), + ( + (DATE_TIMESTAMP, {_sF: _dt}), + (DATE_TIMESTAMP, {_sF: _dt}), + (8, 0), + (8, 0), + (3, 0), + (USAGE, 0), + ), ) -FUNCTION = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#Function"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +ACTION_GROUP_OUTPUT_STRING: StaticSchema = (3, n0, _AGOS, 4) + +ACTION_GROUP_INVOCATION_OUTPUT: StaticSchema = ( + 18, + n0, + _AGIO, + 0, + (_te, _met), + ((ACTION_GROUP_OUTPUT_STRING, 0), (METADATA, 0)), +) + +ACTION_GROUP_SIGNATURE: StaticSchema = ( + 14, + n0, + _AGS, + 0, + (_AU, _AC, _AC_, _AB, _AT), + ( + (-1, {_sV: _AMAZONUI}), + (-1, {_sV: _AMAZONCI}), + (-1, {_sV: _ANTHROPICC}), + (-1, {_sV: _ANTHROPICB}), + (-1, {_sV: _ANTHROPICTE}), + ), ) -PARAMETER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#Parameter"), - members={ - "name": {"target": STRING}, - "type": {"target": STRING}, - "value": {"target": STRING}, - }, +ACTION_GROUP_SIGNATURE_PARAMS: StaticSchema = ( + 17, + n0, + _AGSP, + 0, + (_k, _v), + ((3, 0), (3, 0)), ) -PARAMETERS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#Parameters"), - shape_type=ShapeType.LIST, - members={"member": {"target": PARAMETER}}, +ACTION_INVOCATION_TYPE: StaticSchema = ( + 14, + n0, + _AIT, + 0, + (_RESULT, _UC, _UCAR), + ((-1, {_sV: _RESULT}), (-1, {_sV: _UC}), (-1, {_sV: _UCAR})), ) -CONTENT_MAP = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ContentMap"), - shape_type=ShapeType.MAP, - members={"key": {"target": STRING}, "value": {"target": PARAMETERS}}, -) +ADDITIONAL_MODEL_REQUEST_FIELDS_KEY: StaticSchema = (3, n0, _AMRFK, 0) -REQUEST_BODY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RequestBody"), - members={"content": {"target": CONTENT_MAP}}, -) +ADDITIONAL_MODEL_REQUEST_FIELDS_VALUE: StaticSchema = (13, n0, _AMRFV, 0) -VERB = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#Verb"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +ADDITIONAL_MODEL_REQUEST_FIELDS: StaticSchema = ( + 17, + n0, + _AMRF, + 0, + (_k, _v), + ( + (ADDITIONAL_MODEL_REQUEST_FIELDS_KEY, 0), + (ADDITIONAL_MODEL_REQUEST_FIELDS_VALUE, 0), + ), ) -ACTION_GROUP_INVOCATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ActionGroupInvocationInput"), - members={ - "actionGroupName": {"target": ACTION_GROUP_NAME}, - "verb": {"target": VERB}, - "apiPath": {"target": API_PATH}, - "parameters": {"target": PARAMETERS}, - "requestBody": {"target": REQUEST_BODY}, - "function": {"target": FUNCTION}, - "executionType": {"target": EXECUTION_TYPE}, - "invocationId": {"target": STRING}, - }, -) +RESOURCE_NAME: StaticSchema = (3, n0, _RN, 4) -DATE_TIMESTAMP = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#DateTimestamp"), - shape_type=ShapeType.TIMESTAMP, - traits=[Trait.new(id=ShapeID("smithy.api#timestampFormat"), value="date-time")], -) - -USAGE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#Usage"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"inputTokens": {"target": INTEGER}, "outputTokens": {"target": INTEGER}}, -) - -METADATA = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#Metadata"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "startTime": { - "target": DATE_TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#timestampFormat"), value="date-time") - ], - }, - "endTime": { - "target": DATE_TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#timestampFormat"), value="date-time") - ], - }, - "totalTimeMs": {"target": LONG}, - "operationTotalTimeMs": {"target": LONG}, - "clientRequestId": {"target": STRING}, - "usage": {"target": USAGE}, - }, -) +PAYLOAD: StaticSchema = (3, n0, _Pay, 4) -ACTION_GROUP_OUTPUT_STRING = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#ActionGroupOutputString"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) +S3_BUCKET_NAME: StaticSchema = (3, n0, _SBN, 0) -ACTION_GROUP_INVOCATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ActionGroupInvocationOutput"), - members={ - "text": {"target": ACTION_GROUP_OUTPUT_STRING}, - "metadata": {"target": METADATA}, - }, -) +S3_OBJECT_KEY: StaticSchema = (3, n0, _SOK, 0) -ACTION_GROUP_SIGNATURE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ActionGroupSignature"), - shape_type=ShapeType.ENUM, - members={ - "AMAZON_USERINPUT": {"target": UNIT}, - "AMAZON_CODEINTERPRETER": {"target": UNIT}, - "ANTHROPIC_COMPUTER": {"target": UNIT}, - "ANTHROPIC_BASH": {"target": UNIT}, - "ANTHROPIC_TEXTEDITOR": {"target": UNIT}, - }, +S3_IDENTIFIER: StaticSchema = ( + 18, + n0, + _SI, + 0, + (_sBN, _sOK), + ((S3_BUCKET_NAME, 0), (S3_OBJECT_KEY, 0)), ) -ACTION_GROUP_SIGNATURE_PARAMS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ActionGroupSignatureParams"), - shape_type=ShapeType.MAP, - members={"key": {"target": STRING}, "value": {"target": STRING}}, +API_SCHEMA: StaticSchema = ( + 19, + n0, + _APIS, + 0, + (_s_, _pa), + ((S3_IDENTIFIER, 0), (PAYLOAD, 0)), ) -ACTION_INVOCATION_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ActionInvocationType"), - shape_type=ShapeType.ENUM, - members={ - "RESULT": {"target": UNIT}, - "USER_CONFIRMATION": {"target": UNIT}, - "USER_CONFIRMATION_AND_RESULT": {"target": UNIT}, - }, -) +RESOURCE_DESCRIPTION: StaticSchema = (3, n0, _RD, 4) -ADDITIONAL_MODEL_REQUEST_FIELDS_KEY = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#AdditionalModelRequestFieldsKey"), - shape_type=ShapeType.STRING, -) +FUNCTION_DESCRIPTION: StaticSchema = (3, n0, _FD, 0) -ADDITIONAL_MODEL_REQUEST_FIELDS_VALUE = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#AdditionalModelRequestFieldsValue"), - shape_type=ShapeType.DOCUMENT, -) +PARAMETER_NAME: StaticSchema = (3, n0, _PN, 0) -ADDITIONAL_MODEL_REQUEST_FIELDS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AdditionalModelRequestFields"), - shape_type=ShapeType.MAP, - members={ - "key": {"target": ADDITIONAL_MODEL_REQUEST_FIELDS_KEY}, - "value": {"target": ADDITIONAL_MODEL_REQUEST_FIELDS_VALUE}, - }, -) +PARAMETER_DESCRIPTION: StaticSchema = (3, n0, _PD, 0) -RESOURCE_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#ResourceName"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +PARAMETER_TYPE: StaticSchema = ( + 14, + n0, + _PT, + 0, + (_STRING, _NUMBER, _INTEGER, _BOOLEAN, _ARRAY), + ( + (-1, {_sV: _st}), + (-1, {_sV: _nu}), + (-1, {_sV: _i}), + (-1, {_sV: _b}), + (-1, {_sV: _a}), + ), ) -PAYLOAD = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#Payload"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +PARAMETER_DETAIL: StaticSchema = ( + 18, + n0, + _PDa, + 0, + (_d, _t, _r), + ((PARAMETER_DESCRIPTION, 0), (PARAMETER_TYPE, 1), (2, 0)), +) + +PARAMETER_MAP: StaticSchema = ( + 17, + n0, + _PM, + 0, + (_k, _v), + ((PARAMETER_NAME, 0), (PARAMETER_DETAIL, 0)), +) + +REQUIRE_CONFIRMATION: StaticSchema = ( + 14, + n0, + _RCe, + 0, + (_ENABLED, _DISABLED), + ((-1, {_sV: _ENABLED}), (-1, {_sV: _DISABLED})), +) + +FUNCTION_DEFINITION: StaticSchema = ( + 18, + n0, + _FDu, + 0, + (_n, _d, _p, _rC), + ( + (RESOURCE_NAME, 1), + (FUNCTION_DESCRIPTION, 0), + (PARAMETER_MAP, 0), + (REQUIRE_CONFIRMATION, 0), + ), ) -S3_BUCKET_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#S3BucketName"), - shape_type=ShapeType.STRING, +FUNCTIONS: StaticSchema = (16, n0, _Fu, 0, (_me,), ((FUNCTION_DEFINITION, 0),)) + +FUNCTION_SCHEMA: StaticSchema = (19, n0, _FS, 0, (_fu,), ((FUNCTIONS, 0),)) + +AGENT_ACTION_GROUP: StaticSchema = ( + 18, + n0, + _AAG, + 0, + (_aGN, _d, _pAGS, _aGE, _aS, _fS, _pAGSP), + ( + (RESOURCE_NAME, 1), + (RESOURCE_DESCRIPTION, 0), + (ACTION_GROUP_SIGNATURE, 0), + (ACTION_GROUP_EXECUTOR, 0), + (API_SCHEMA, 0), + (FUNCTION_SCHEMA, 0), + (ACTION_GROUP_SIGNATURE_PARAMS, 0), + ), ) -S3_OBJECT_KEY = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#S3ObjectKey"), - shape_type=ShapeType.STRING, +AGENT_ACTION_GROUPS: StaticSchema = ( + 16, + n0, + _AAGg, + 0, + (_me,), + ((AGENT_ACTION_GROUP, 0),), ) -S3_IDENTIFIER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#S3Identifier"), - members={ - "s3BucketName": {"target": S3_BUCKET_NAME}, - "s3ObjectKey": {"target": S3_OBJECT_KEY}, - }, -) +AGENT_ALIAS_ARN: StaticSchema = (3, n0, _AAA, 0) -API_SCHEMA = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#APISchema"), - shape_type=ShapeType.UNION, - members={"s3": {"target": S3_IDENTIFIER}, "payload": {"target": PAYLOAD}}, -) +AGENT_ALIAS_ID: StaticSchema = (3, n0, _AAI, 0) -RESOURCE_DESCRIPTION = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#ResourceDescription"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +AGENT_COLLABORATION: StaticSchema = ( + 14, + n0, + _ACg, + 0, + (_SUPERVISOR, _SR, _DISABLED), + ((-1, {_sV: _SUPERVISOR}), (-1, {_sV: _SR}), (-1, {_sV: _DISABLED})), ) -FUNCTION_DESCRIPTION = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#FunctionDescription"), - shape_type=ShapeType.STRING, +CONFIRMATION_STATE: StaticSchema = ( + 14, + n0, + _CS, + 0, + (_CONFIRM, _DENY), + ((-1, {_sV: _CONFIRM}), (-1, {_sV: _DENY})), ) -PARAMETER_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#ParameterName"), - shape_type=ShapeType.STRING, +IMAGE_INPUT_FORMAT: StaticSchema = ( + 14, + n0, + _IIF, + 0, + (_PNG, _JPEG, _GIF, _WEBP), + ((-1, {_sV: _pn}), (-1, {_sV: _j}), (-1, {_sV: _g}), (-1, {_sV: _w})), ) -PARAMETER_DESCRIPTION = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#ParameterDescription"), - shape_type=ShapeType.STRING, -) +IMAGE_INPUT_SOURCE: StaticSchema = (19, n0, _IIS, 0, (_by,), ((1, 0),)) -PARAMETER_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ParameterType"), - shape_type=ShapeType.ENUM, - members={ - "STRING": {"target": UNIT}, - "NUMBER": {"target": UNIT}, - "INTEGER": {"target": UNIT}, - "BOOLEAN": {"target": UNIT}, - "ARRAY": {"target": UNIT}, - }, +IMAGE_INPUT: StaticSchema = ( + 18, + n0, + _II, + 0, + (_fo, _so), + ((IMAGE_INPUT_FORMAT, 1), (IMAGE_INPUT_SOURCE, 1)), ) -PARAMETER_DETAIL = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ParameterDetail"), - members={ - "description": {"target": PARAMETER_DESCRIPTION}, - "type": { - "target": PARAMETER_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "required": {"target": BOOLEAN}, - }, -) +IMAGE_INPUTS: StaticSchema = (16, n0, _IIm, 0, (_me,), ((IMAGE_INPUT, 0),)) -PARAMETER_MAP = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ParameterMap"), - shape_type=ShapeType.MAP, - members={"key": {"target": PARAMETER_NAME}, "value": {"target": PARAMETER_DETAIL}}, -) +CONTENT_BODY: StaticSchema = (18, n0, _CB, 0, (_bo, _im), ((3, 0), (IMAGE_INPUTS, 0))) -REQUIRE_CONFIRMATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RequireConfirmation"), - shape_type=ShapeType.ENUM, - members={"ENABLED": {"target": UNIT}, "DISABLED": {"target": UNIT}}, -) +RESPONSE_BODY: StaticSchema = (17, n0, _RBe, 0, (_k, _v), ((3, 0), (CONTENT_BODY, 0))) -FUNCTION_DEFINITION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FunctionDefinition"), - members={ - "name": { - "target": RESOURCE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": FUNCTION_DESCRIPTION}, - "parameters": {"target": PARAMETER_MAP}, - "requireConfirmation": {"target": REQUIRE_CONFIRMATION}, - }, +RESPONSE_STATE: StaticSchema = ( + 14, + n0, + _RS, + 0, + (_FAILURE, _REPROMPT), + ((-1, {_sV: _FAILURE}), (-1, {_sV: _REPROMPT})), ) -FUNCTIONS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#Functions"), - shape_type=ShapeType.LIST, - members={"member": {"target": FUNCTION_DEFINITION}}, +API_RESULT: StaticSchema = ( + 18, + n0, + _AR, + 0, + (_aG, _hM, _aP, _cS, _rS, _hSC, _rBe, _aI), + ( + (3, 1), + (3, 0), + (API_PATH, 0), + (CONFIRMATION_STATE, 0), + (RESPONSE_STATE, 0), + (7, 0), + (RESPONSE_BODY, 0), + (3, 0), + ), ) -FUNCTION_SCHEMA = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FunctionSchema"), - shape_type=ShapeType.UNION, - members={"functions": {"target": FUNCTIONS}}, +FUNCTION_RESULT: StaticSchema = ( + 18, + n0, + _FR, + 0, + (_aG, _cS, _f, _rBe, _rS, _aI), + ( + (3, 1), + (CONFIRMATION_STATE, 0), + (3, 0), + (RESPONSE_BODY, 0), + (RESPONSE_STATE, 0), + (3, 0), + ), ) -AGENT_ACTION_GROUP = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgentActionGroup"), - members={ - "actionGroupName": { - "target": RESOURCE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": RESOURCE_DESCRIPTION}, - "parentActionGroupSignature": {"target": ACTION_GROUP_SIGNATURE}, - "actionGroupExecutor": {"target": ACTION_GROUP_EXECUTOR}, - "apiSchema": {"target": API_SCHEMA}, - "functionSchema": {"target": FUNCTION_SCHEMA}, - "parentActionGroupSignatureParams": {"target": ACTION_GROUP_SIGNATURE_PARAMS}, - }, +INVOCATION_RESULT_MEMBER: StaticSchema = ( + 19, + n0, + _IRM, + 0, + (_aR, _fR), + ((API_RESULT, 0), (FUNCTION_RESULT, 0)), +) + +RETURN_CONTROL_INVOCATION_RESULTS: StaticSchema = ( + 16, + n0, + _RCIR, + 0, + (_me,), + ((INVOCATION_RESULT_MEMBER, 0),), +) + +RETURN_CONTROL_RESULTS: StaticSchema = ( + 18, + n0, + _RCR, + 0, + (_iI, _rCIR), + ((3, 0), (RETURN_CONTROL_INVOCATION_RESULTS, 0)), +) + +AGENT_COLLABORATOR_PAYLOAD_STRING: StaticSchema = (3, n0, _ACPS, 4) + +PAYLOAD_TYPE: StaticSchema = ( + 14, + n0, + _PTa, + 0, + (_TEXT, _RC), + ((-1, {_sV: _TEXT}), (-1, {_sV: _RC})), +) + +AGENT_COLLABORATOR_INPUT_PAYLOAD: StaticSchema = ( + 18, + n0, + _ACIP, + 0, + (_t, _te, _rCR), + ( + (PAYLOAD_TYPE, 0), + (AGENT_COLLABORATOR_PAYLOAD_STRING, 0), + (RETURN_CONTROL_RESULTS, 0), + ), ) -AGENT_ACTION_GROUPS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgentActionGroups"), - shape_type=ShapeType.LIST, - members={"member": {"target": AGENT_ACTION_GROUP}}, +AGENT_COLLABORATOR_INVOCATION_INPUT: StaticSchema = ( + 18, + n0, + _ACII, + 0, + (_aCN, _aCAA, _in), + ((3, 0), (AGENT_ALIAS_ARN, 0), (AGENT_COLLABORATOR_INPUT_PAYLOAD, 0)), ) -AGENT_ALIAS_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgentAliasArn"), - shape_type=ShapeType.STRING, -) +NAME: StaticSchema = (3, n0, _N, 4) -AGENT_ALIAS_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgentAliasId"), - shape_type=ShapeType.STRING, -) +API_PARAMETER: StaticSchema = (18, n0, _APp, 0, (_n, _t, _v), ((3, 0), (3, 0), (3, 0))) -AGENT_COLLABORATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgentCollaboration"), - shape_type=ShapeType.ENUM, - members={ - "SUPERVISOR": {"target": UNIT}, - "SUPERVISOR_ROUTER": {"target": UNIT}, - "DISABLED": {"target": UNIT}, - }, -) +API_PARAMETERS: StaticSchema = (16, n0, _APpi, 0, (_me,), ((API_PARAMETER, 0),)) -CONFIRMATION_STATE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ConfirmationState"), - shape_type=ShapeType.ENUM, - members={"CONFIRM": {"target": UNIT}, "DENY": {"target": UNIT}}, -) +PARAMETER_LIST: StaticSchema = (16, n0, _PL, 0, (_me,), ((PARAMETER, 0),)) -IMAGE_INPUT_FORMAT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ImageInputFormat"), - shape_type=ShapeType.ENUM, - members={ - "PNG": {"target": UNIT}, - "JPEG": {"target": UNIT}, - "GIF": {"target": UNIT}, - "WEBP": {"target": UNIT}, - }, -) +PROPERTY_PARAMETERS: StaticSchema = (18, n0, _PP, 0, (_pr,), ((PARAMETER_LIST, 0),)) -IMAGE_INPUT_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ImageInputSource"), - shape_type=ShapeType.UNION, - members={"bytes": {"target": BLOB}}, +API_CONTENT_MAP: StaticSchema = ( + 17, + n0, + _ACM, + 0, + (_k, _v), + ((3, 0), (PROPERTY_PARAMETERS, 0)), ) -IMAGE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ImageInput"), - members={ - "format": { - "target": IMAGE_INPUT_FORMAT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "source": { - "target": IMAGE_INPUT_SOURCE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +API_REQUEST_BODY: StaticSchema = (18, n0, _ARB, 0, (_co,), ((API_CONTENT_MAP, 0),)) -IMAGE_INPUTS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ImageInputs"), - shape_type=ShapeType.LIST, - members={"member": {"target": IMAGE_INPUT}}, +API_INVOCATION_INPUT: StaticSchema = ( + 18, + n0, + _AII, + 0, + (_aG, _hM, _aP, _p, _rB, _aIT, _aI, _cN), + ( + (3, 1), + (3, 0), + (API_PATH, 0), + (API_PARAMETERS, 0), + (API_REQUEST_BODY, 0), + (ACTION_INVOCATION_TYPE, 0), + (3, 0), + (NAME, 0), + ), ) -CONTENT_BODY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ContentBody"), - members={"body": {"target": STRING}, "images": {"target": IMAGE_INPUTS}}, +FUNCTION_PARAMETER: StaticSchema = ( + 18, + n0, + _FP, + 0, + (_n, _t, _v), + ((3, 0), (3, 0), (3, 0)), +) + +FUNCTION_PARAMETERS: StaticSchema = ( + 16, + n0, + _FPu, + 0, + (_me,), + ((FUNCTION_PARAMETER, 0),), +) + +FUNCTION_INVOCATION_INPUT: StaticSchema = ( + 18, + n0, + _FII, + 0, + (_aG, _p, _f, _aIT, _aI, _cN), + ( + (3, 1), + (FUNCTION_PARAMETERS, 0), + (3, 0), + (ACTION_INVOCATION_TYPE, 0), + (3, 0), + (NAME, 0), + ), ) -RESPONSE_BODY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ResponseBody"), - shape_type=ShapeType.MAP, - members={"key": {"target": STRING}, "value": {"target": CONTENT_BODY}}, +INVOCATION_INPUT_MEMBER: StaticSchema = ( + 19, + n0, + _IIM, + 0, + (_aII, _fII), + ((API_INVOCATION_INPUT, 0), (FUNCTION_INVOCATION_INPUT, 0)), +) + +INVOCATION_INPUTS: StaticSchema = ( + 16, + n0, + _IIn, + 0, + (_me,), + ((INVOCATION_INPUT_MEMBER, 0),), +) + +RETURN_CONTROL_PAYLOAD: StaticSchema = ( + 18, + n0, + _RCP, + 4, + (_iIn, _iI), + ((INVOCATION_INPUTS, 0), (3, 0)), +) + +AGENT_COLLABORATOR_OUTPUT_PAYLOAD: StaticSchema = ( + 18, + n0, + _ACOP, + 0, + (_t, _te, _rCP), + ( + (PAYLOAD_TYPE, 0), + (AGENT_COLLABORATOR_PAYLOAD_STRING, 0), + (RETURN_CONTROL_PAYLOAD, 0), + ), ) -RESPONSE_STATE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ResponseState"), - shape_type=ShapeType.ENUM, - members={"FAILURE": {"target": UNIT}, "REPROMPT": {"target": UNIT}}, +AGENT_COLLABORATOR_INVOCATION_OUTPUT: StaticSchema = ( + 18, + n0, + _ACIO, + 0, + (_aCN, _aCAA, _o, _met), + ( + (3, 0), + (AGENT_ALIAS_ARN, 0), + (AGENT_COLLABORATOR_OUTPUT_PAYLOAD, 0), + (METADATA, 0), + ), ) -API_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ApiResult"), - members={ - "actionGroup": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "httpMethod": {"target": STRING}, - "apiPath": {"target": API_PATH}, - "confirmationState": {"target": CONFIRMATION_STATE}, - "responseState": {"target": RESPONSE_STATE}, - "httpStatusCode": {"target": INTEGER}, - "responseBody": {"target": RESPONSE_BODY}, - "agentId": {"target": STRING}, - }, -) +AGENT_CORE_MEMORY_ACTOR_ID: StaticSchema = (3, n0, _ACMAI, 0) -FUNCTION_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FunctionResult"), - members={ - "actionGroup": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "confirmationState": {"target": CONFIRMATION_STATE}, - "function": {"target": STRING}, - "responseBody": {"target": RESPONSE_BODY}, - "responseState": {"target": RESPONSE_STATE}, - "agentId": {"target": STRING}, - }, +AGENT_CORE_MEMORY_ID: StaticSchema = (3, n0, _ACMI, 0) + +AGENT_CORE_MEMORY_SESSION_ID: StaticSchema = (3, n0, _ACMSI, 0) + +AGENTIC_RETRIEVE_SOURCE_RETRIEVER: StaticSchema = (18, n0, _ARSR, 0, (_id,), ((3, 1),)) + +AGENTIC_RETRIEVE_FULL_DOC_EXPANSION_DETAILS: StaticSchema = ( + 18, + n0, + _ARFDED, + 0, + (_dI, _sR), + ((3, 0), (AGENTIC_RETRIEVE_SOURCE_RETRIEVER, 0)), ) -INVOCATION_RESULT_MEMBER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#InvocationResultMember"), - shape_type=ShapeType.UNION, - members={ - "apiResult": {"target": API_RESULT}, - "functionResult": {"target": FUNCTION_RESULT}, - }, +AGENTIC_RETRIEVE_MESSAGE_CONTENT: StaticSchema = (18, n0, _ARMC, 4, (_te,), ((3, 0),)) + +AGENTIC_RETRIEVE_MEMORY_RETRIEVE_DETAILS: StaticSchema = ( + 18, + n0, + _ARMRD, + 0, + (_iQ, _mI, _na, _nP, _sI), + ((AGENTIC_RETRIEVE_MESSAGE_CONTENT, 1), (3, 1), (3, 0), (3, 0), (3, 0)), ) -RETURN_CONTROL_INVOCATION_RESULTS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ReturnControlInvocationResults"), - shape_type=ShapeType.LIST, - members={"member": {"target": INVOCATION_RESULT_MEMBER}}, +AGENTIC_RETRIEVE_SOURCE_RETRIEVER_LIST: StaticSchema = ( + 16, + n0, + _ARSRL, + 0, + (_me,), + ((AGENTIC_RETRIEVE_SOURCE_RETRIEVER, 0),), ) -RETURN_CONTROL_RESULTS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ReturnControlResults"), - members={ - "invocationId": {"target": STRING}, - "returnControlInvocationResults": {"target": RETURN_CONTROL_INVOCATION_RESULTS}, - }, +AGENTIC_RETRIEVE_ACTION_DETAILS: StaticSchema = ( + 18, + n0, + _ARAD, + 0, + (_iQ, _sRo), + ( + (AGENTIC_RETRIEVE_MESSAGE_CONTENT, 1), + (AGENTIC_RETRIEVE_SOURCE_RETRIEVER_LIST, 1), + ), ) -AGENT_COLLABORATOR_PAYLOAD_STRING = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgentCollaboratorPayloadString"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +AGENTIC_RETRIEVE_ACTION: StaticSchema = ( + 18, + n0, + _ARA, + 0, + (_re, _fDE, _mR), + ( + (AGENTIC_RETRIEVE_ACTION_DETAILS, 0), + (AGENTIC_RETRIEVE_FULL_DOC_EXPANSION_DETAILS, 0), + (AGENTIC_RETRIEVE_MEMORY_RETRIEVE_DETAILS, 0), + ), ) -PAYLOAD_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#PayloadType"), - shape_type=ShapeType.ENUM, - members={"TEXT": {"target": UNIT}, "RETURN_CONTROL": {"target": UNIT}}, +AGENTIC_RETRIEVE_ACTIONS: StaticSchema = ( + 16, + n0, + _ARAg, + 0, + (_me,), + ((AGENTIC_RETRIEVE_ACTION, 0),), +) + +AGENTIC_RETRIEVE_BEDROCK_GUARDRAIL_CONFIGURATION: StaticSchema = ( + 18, + n0, + _ARBGC, + 0, + (_gI, _gV), + ((3, 1), (3, 1)), +) + +BEDROCK_MODEL_ARN: StaticSchema = (3, n0, _BMA, 0) + +AGENTIC_RETRIEVE_BEDROCK_RERANKING_MODEL_CONFIGURATION: StaticSchema = ( + 18, + n0, + _ARBRMC, + 0, + (_mA,), + ((BEDROCK_MODEL_ARN, 1),), +) + +AGENTIC_RETRIEVE_BEDROCK_RERANKING_CONFIGURATION: StaticSchema = ( + 18, + n0, + _ARBRC, + 0, + (_mC,), + ((AGENTIC_RETRIEVE_BEDROCK_RERANKING_MODEL_CONFIGURATION, 1),), +) + +AGENTIC_RETRIEVE_CITATION_REFERENCE: StaticSchema = ( + 18, + n0, + _ARCR, + 0, + (_rI,), + ((7, 1),), +) + +AGENTIC_RETRIEVE_CITATION_REFERENCE_LIST: StaticSchema = ( + 16, + n0, + _ARCRL, + 0, + (_me,), + ((AGENTIC_RETRIEVE_CITATION_REFERENCE, 0),), +) + +AGENTIC_RETRIEVE_CITATION: StaticSchema = ( + 18, + n0, + _ARC, + 0, + (_sIt, _eI, _ref), + ((7, 1), (7, 1), (AGENTIC_RETRIEVE_CITATION_REFERENCE_LIST, 1)), +) + +AGENTIC_RETRIEVE_CITATION_LIST: StaticSchema = ( + 16, + n0, + _ARCL, + 0, + (_me,), + ((AGENTIC_RETRIEVE_CITATION, 0),), +) + +BEDROCK_FOUNDATION_MODEL_MODEL_CONFIGURATION: StaticSchema = ( + 18, + n0, + _BFMMC, + 0, + (_mA,), + ((BEDROCK_MODEL_ARN, 1),), +) + +BEDROCK_FOUNDATION_MODEL_CONFIGURATION: StaticSchema = ( + 18, + n0, + _BFMC, + 0, + (_mC,), + ((BEDROCK_FOUNDATION_MODEL_MODEL_CONFIGURATION, 1),), +) + +MANTLE_PROJECT_ID: StaticSchema = (3, n0, _MPI, 0) + +MANTLE_FOUNDATION_MODEL_MODEL_CONFIGURATION: StaticSchema = ( + 18, + n0, + _MFMMC, + 0, + (_mA, _pI), + ((BEDROCK_MODEL_ARN, 1), (MANTLE_PROJECT_ID, 0)), +) + +MANTLE_FOUNDATION_MODEL_CONFIGURATION: StaticSchema = ( + 18, + n0, + _MFMC, + 0, + (_mC,), + ((MANTLE_FOUNDATION_MODEL_MODEL_CONFIGURATION, 1),), +) + +FOUNDATION_MODEL_CONFIGURATION_TYPE: StaticSchema = ( + 14, + n0, + _FMCT, + 0, + (_BFM, _MFM), + ((-1, {_sV: _BFM}), (-1, {_sV: _MFM})), +) + +FOUNDATION_MODEL_CONFIGURATION: StaticSchema = ( + 18, + n0, + _FMC, + 0, + (_t, _bFMC, _mFMC), + ( + (FOUNDATION_MODEL_CONFIGURATION_TYPE, 1), + (BEDROCK_FOUNDATION_MODEL_CONFIGURATION, 0), + (MANTLE_FOUNDATION_MODEL_CONFIGURATION, 0), + ), ) -AGENT_COLLABORATOR_INPUT_PAYLOAD = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgentCollaboratorInputPayload"), - members={ - "type": {"target": PAYLOAD_TYPE}, - "text": {"target": AGENT_COLLABORATOR_PAYLOAD_STRING}, - "returnControlResults": {"target": RETURN_CONTROL_RESULTS}, - }, +FOUNDATION_MODEL_TYPE: StaticSchema = ( + 14, + n0, + _FMT, + 0, + (_CUSTOM, _MANAGED), + ((-1, {_sV: _CUSTOM}), (-1, {_sV: _MANAGED})), +) + +AGENTIC_RETRIEVE_RERANKING_CONFIGURATION_TYPE: StaticSchema = ( + 14, + n0, + _ARRCT, + 0, + (_BRM,), + ((-1, {_sV: _BRM}),), +) + +AGENTIC_RETRIEVE_RERANKING_CONFIGURATION: StaticSchema = ( + 18, + n0, + _ARRC, + 0, + (_t, _bRC), + ( + (AGENTIC_RETRIEVE_RERANKING_CONFIGURATION_TYPE, 1), + (AGENTIC_RETRIEVE_BEDROCK_RERANKING_CONFIGURATION, 0), + ), ) -AGENT_COLLABORATOR_INVOCATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgentCollaboratorInvocationInput"), - members={ - "agentCollaboratorName": {"target": STRING}, - "agentCollaboratorAliasArn": {"target": AGENT_ALIAS_ARN}, - "input": {"target": AGENT_COLLABORATOR_INPUT_PAYLOAD}, - }, +AGENTIC_RETRIEVE_RERANKING_MODEL_TYPE: StaticSchema = ( + 14, + n0, + _ARRMT, + 0, + (_CUSTOM, _MANAGED, _NONE), + ((-1, {_sV: _CUSTOM}), (-1, {_sV: _MANAGED}), (-1, {_sV: _NONE})), +) + +AGENTIC_RETRIEVE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _ARCg, + 0, + (_fMT, _fMC, _rMT, _rCe, _mAI), + ( + (FOUNDATION_MODEL_TYPE, {_smit: _MANAGED}), + (FOUNDATION_MODEL_CONFIGURATION, 0), + (AGENTIC_RETRIEVE_RERANKING_MODEL_TYPE, 0), + (AGENTIC_RETRIEVE_RERANKING_CONFIGURATION, 0), + (7, {_smit: 5}), + ), ) -NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#Name"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +AGENTIC_RETRIEVE_FAILURE: StaticSchema = (18, n0, _ARF, 0, (_m,), ((3, 1),)) + +AGENTIC_RETRIEVE_FAILURES: StaticSchema = ( + 16, + n0, + _ARFg, + 0, + (_me,), + ((AGENTIC_RETRIEVE_FAILURE, 0),), +) + +AGENTIC_RETRIEVE_GENERATED_RESPONSE: StaticSchema = ( + 18, + n0, + _ARGR, + 0, + (_an, _ci), + ((3, 1), (AGENTIC_RETRIEVE_CITATION_LIST, 0)), +) + +GUARDRAIL_ACTION: StaticSchema = ( + 14, + n0, + _GA, + 0, + (_INTERVENED, _NONE), + ((-1, {_sV: _INTERVENED}), (-1, {_sV: _NONE})), +) + +AGENTIC_RETRIEVE_GUARDRAIL_WARNING: StaticSchema = ( + 18, + n0, + _ARGW, + 0, + (_id_, _ver, _ac, _m), + ((3, 1), (3, 1), (GUARDRAIL_ACTION, 1), (3, 0)), +) + +AGENTIC_RETRIEVE_MEMORY_PERSISTENCE_MODE: StaticSchema = ( + 14, + n0, + _ARMPM, + 0, + (_DEFAULT, _NONE), + ((-1, {_sV: _DEFAULT}), (-1, {_sV: _NONE})), +) + +AGENTIC_RETRIEVE_MEMORY_METADATA_KEY: StaticSchema = (3, n0, _ARMMK, 0) + +AGENTIC_RETRIEVE_MEMORY_METADATA_FILTER_LEFT: StaticSchema = ( + 19, + n0, + _ARMMFL, + 0, + (_mK,), + ((AGENTIC_RETRIEVE_MEMORY_METADATA_KEY, 0),), +) + +AGENTIC_RETRIEVE_MEMORY_METADATA_FILTER_OPERATOR: StaticSchema = ( + 14, + n0, + _ARMMFO, + 0, + (_ET_, _EXISTS, _NE, _BEFORE, _AFTER, _CONTAINS, _GT, _GTOE, _LT, _LTOE), + ( + (-1, {_sV: _ET_}), + (-1, {_sV: _EXISTS}), + (-1, {_sV: _NE}), + (-1, {_sV: _BEFORE}), + (-1, {_sV: _AFTER}), + (-1, {_sV: _CONTAINS}), + (-1, {_sV: _GT}), + (-1, {_sV: _GTOE}), + (-1, {_sV: _LT}), + (-1, {_sV: _LTOE}), + ), ) -API_PARAMETER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ApiParameter"), - members={ - "name": {"target": STRING}, - "type": {"target": STRING}, - "value": {"target": STRING}, - }, +AGENTIC_RETRIEVE_MEMORY_METADATA_STRING_LIST_ITEM: StaticSchema = (3, n0, _ARMMSLI, 0) + +AGENTIC_RETRIEVE_MEMORY_METADATA_STRING_LIST: StaticSchema = ( + 16, + n0, + _ARMMSL, + 0, + (_me,), + ((AGENTIC_RETRIEVE_MEMORY_METADATA_STRING_LIST_ITEM, 0),), ) -API_PARAMETERS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ApiParameters"), - shape_type=ShapeType.LIST, - members={"member": {"target": API_PARAMETER}}, +AGENTIC_RETRIEVE_MEMORY_METADATA_STRING_VALUE: StaticSchema = (3, n0, _ARMMSV, 0) + +AGENTIC_RETRIEVE_MEMORY_METADATA_VALUE: StaticSchema = ( + 19, + n0, + _ARMMV, + 0, + (_sVt, _nV, _sLV, _dTV), + ( + (AGENTIC_RETRIEVE_MEMORY_METADATA_STRING_VALUE, 0), + (10, 0), + (AGENTIC_RETRIEVE_MEMORY_METADATA_STRING_LIST, 0), + (4, 0), + ), ) -PARAMETER_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ParameterList"), - shape_type=ShapeType.LIST, - members={"member": {"target": PARAMETER}}, +AGENTIC_RETRIEVE_MEMORY_METADATA_FILTER_RIGHT: StaticSchema = ( + 19, + n0, + _ARMMFR, + 0, + (_mV,), + ((AGENTIC_RETRIEVE_MEMORY_METADATA_VALUE, 0),), +) + +AGENTIC_RETRIEVE_MEMORY_METADATA_FILTER: StaticSchema = ( + 18, + n0, + _ARMMF, + 0, + (_le, _op, _ri), + ( + (AGENTIC_RETRIEVE_MEMORY_METADATA_FILTER_LEFT, 1), + (AGENTIC_RETRIEVE_MEMORY_METADATA_FILTER_OPERATOR, 1), + (AGENTIC_RETRIEVE_MEMORY_METADATA_FILTER_RIGHT, 0), + ), ) -PROPERTY_PARAMETERS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#PropertyParameters"), - members={"properties": {"target": PARAMETER_LIST}}, +AGENTIC_RETRIEVE_MEMORY_METADATA_FILTER_LIST: StaticSchema = ( + 16, + n0, + _ARMMFLg, + 0, + (_me,), + ((AGENTIC_RETRIEVE_MEMORY_METADATA_FILTER, 0),), ) -API_CONTENT_MAP = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ApiContentMap"), - shape_type=ShapeType.MAP, - members={"key": {"target": STRING}, "value": {"target": PROPERTY_PARAMETERS}}, +MEMORY_NAMESPACE: StaticSchema = (3, n0, _MN, 0) + +MEMORY_STRATEGY_ID: StaticSchema = (3, n0, _MSI, 0) + +AGENTIC_RETRIEVE_MEMORY_RETRIEVAL_CONFIG: StaticSchema = ( + 18, + n0, + _ARMRC, + 0, + (_na, _nP, _sI, _mF), + ( + (MEMORY_NAMESPACE, 0), + (MEMORY_NAMESPACE, 0), + (MEMORY_STRATEGY_ID, 0), + (AGENTIC_RETRIEVE_MEMORY_METADATA_FILTER_LIST, 0), + ), ) -API_REQUEST_BODY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ApiRequestBody"), - members={"content": {"target": API_CONTENT_MAP}}, +AGENTIC_RETRIEVE_MEMORY_RETRIEVAL_CONFIG_LIST: StaticSchema = ( + 16, + n0, + _ARMRCL, + 0, + (_me,), + ((AGENTIC_RETRIEVE_MEMORY_RETRIEVAL_CONFIG, 0),), +) + +AGENTIC_RETRIEVE_MEMORY_SESSION_BINDING: StaticSchema = ( + 18, + n0, + _ARMSB, + 0, + (_aIc, _sIe), + ((AGENT_CORE_MEMORY_ACTOR_ID, 1), (AGENT_CORE_MEMORY_SESSION_ID, 1)), +) + +AGENTIC_RETRIEVE_MEMORY_CONFIGURATION: StaticSchema = ( + 18, + n0, + _ARMCg, + 0, + (_mI, _sB, _rCet, _pM), + ( + (AGENT_CORE_MEMORY_ID, 1), + (AGENTIC_RETRIEVE_MEMORY_SESSION_BINDING, 0), + (AGENTIC_RETRIEVE_MEMORY_RETRIEVAL_CONFIG_LIST, 0), + (AGENTIC_RETRIEVE_MEMORY_PERSISTENCE_MODE, 0), + ), ) -API_INVOCATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ApiInvocationInput"), - members={ - "actionGroup": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "httpMethod": {"target": STRING}, - "apiPath": {"target": API_PATH}, - "parameters": {"target": API_PARAMETERS}, - "requestBody": {"target": API_REQUEST_BODY}, - "actionInvocationType": {"target": ACTION_INVOCATION_TYPE}, - "agentId": {"target": STRING}, - "collaboratorName": {"target": NAME}, - }, +CONVERSATION_ROLE: StaticSchema = ( + 14, + n0, + _CR, + 0, + (_USER, _ASSISTANT), + ((-1, {_sV: _us}), (-1, {_sV: _as})), ) -FUNCTION_PARAMETER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FunctionParameter"), - members={ - "name": {"target": STRING}, - "type": {"target": STRING}, - "value": {"target": STRING}, - }, +AGENTIC_RETRIEVE_MESSAGE: StaticSchema = ( + 18, + n0, + _ARM, + 0, + (_co, _ro), + ((AGENTIC_RETRIEVE_MESSAGE_CONTENT, 1), (CONVERSATION_ROLE, 1)), ) -FUNCTION_PARAMETERS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FunctionParameters"), - shape_type=ShapeType.LIST, - members={"member": {"target": FUNCTION_PARAMETER}}, -) - -FUNCTION_INVOCATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FunctionInvocationInput"), - members={ - "actionGroup": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "parameters": {"target": FUNCTION_PARAMETERS}, - "function": {"target": STRING}, - "actionInvocationType": {"target": ACTION_INVOCATION_TYPE}, - "agentId": {"target": STRING}, - "collaboratorName": {"target": NAME}, - }, +AGENTIC_RETRIEVE_MESSAGES: StaticSchema = ( + 16, + n0, + _ARMg, + 0, + (_me,), + ((AGENTIC_RETRIEVE_MESSAGE, 0),), ) -INVOCATION_INPUT_MEMBER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#InvocationInputMember"), - shape_type=ShapeType.UNION, - members={ - "apiInvocationInput": {"target": API_INVOCATION_INPUT}, - "functionInvocationInput": {"target": FUNCTION_INVOCATION_INPUT}, - }, +AGENTIC_RETRIEVE_METADATA: StaticSchema = ( + 17, + n0, + _ARMge, + 0, + (_k, _v), + ((3, 0), (13, 0)), ) -INVOCATION_INPUTS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#InvocationInputs"), - shape_type=ShapeType.LIST, - members={"member": {"target": INVOCATION_INPUT_MEMBER}}, +AGENTIC_RETRIEVE_POLICY_CONFIGURATION: StaticSchema = ( + 18, + n0, + _ARPC, + 0, + (_bGC,), + ((AGENTIC_RETRIEVE_BEDROCK_GUARDRAIL_CONFIGURATION, 0),), ) -RETURN_CONTROL_PAYLOAD = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ReturnControlPayload"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "invocationInputs": {"target": INVOCATION_INPUTS}, - "invocationId": {"target": STRING}, - }, +KNOWLEDGE_BASE_ID: StaticSchema = (3, n0, _KBI, 0) + +FILTER_KEY: StaticSchema = (3, n0, _FK, 0) + +FILTER_VALUE: StaticSchema = (13, n0, _FV, 0) + +FILTER_ATTRIBUTE: StaticSchema = ( + 18, + n0, + _FA, + 0, + (_k, _v), + ((FILTER_KEY, 1), (FILTER_VALUE, 1)), ) -AGENT_COLLABORATOR_OUTPUT_PAYLOAD = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgentCollaboratorOutputPayload"), - members={ - "type": {"target": PAYLOAD_TYPE}, - "text": {"target": AGENT_COLLABORATOR_PAYLOAD_STRING}, - "returnControlPayload": {"target": RETURN_CONTROL_PAYLOAD}, - }, +AGENTIC_RETRIEVE_RESPONSE_EVENT: StaticSchema = (18, n0, _ARRE, 0, (_te,), ((3, 1),)) + +NEXT_TOKEN: StaticSchema = (3, n0, _NT, 0) + +MIME_TYPE: StaticSchema = (3, n0, _MT, 0) + +RETRIEVAL_CONTENT: StaticSchema = ( + 18, + n0, + _RCet, + 0, + (_bC, _te, _mT), + ((1, 0), (3, 0), (MIME_TYPE, 1)), ) -AGENT_COLLABORATOR_INVOCATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgentCollaboratorInvocationOutput"), - members={ - "agentCollaboratorName": {"target": STRING}, - "agentCollaboratorAliasArn": {"target": AGENT_ALIAS_ARN}, - "output": {"target": AGENT_COLLABORATOR_OUTPUT_PAYLOAD}, - "metadata": {"target": METADATA}, - }, +AGENTIC_RETRIEVE_RESULT_ITEM: StaticSchema = ( + 18, + n0, + _ARRI, + 0, + (_co, _met, _sR), + ( + (RETRIEVAL_CONTENT, 1), + (AGENTIC_RETRIEVE_METADATA, 0), + (AGENTIC_RETRIEVE_SOURCE_RETRIEVER, 1), + ), ) -AGENT_CORE_MEMORY_ACTOR_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgentCoreMemoryActorId"), - shape_type=ShapeType.STRING, +AGENTIC_RETRIEVE_RESULTS: StaticSchema = ( + 16, + n0, + _ARR, + 0, + (_me,), + ((AGENTIC_RETRIEVE_RESULT_ITEM, 0),), +) + +AGENTIC_RETRIEVE_RESULT_EVENT: StaticSchema = ( + 18, + n0, + _ARREg, + 0, + (_res, _gR, _nT), + ( + (AGENTIC_RETRIEVE_RESULTS, 1), + (AGENTIC_RETRIEVE_GENERATED_RESPONSE, 0), + (NEXT_TOKEN, 0), + ), ) -AGENT_CORE_MEMORY_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgentCoreMemoryId"), - shape_type=ShapeType.STRING, +AGENTIC_RETRIEVE_TYPE: StaticSchema = ( + 14, + n0, + _ART, + 0, + (_BKB, _BACM), + ((-1, {_sV: _BKBe}), (-1, {_sV: _BACMe})), +) + +AGENTIC_RETRIEVE_SOURCE_METADATA: StaticSchema = ( + 18, + n0, + _ARSM, + 0, + (_id, _rT), + ((3, 0), (AGENTIC_RETRIEVE_TYPE, 0)), +) + +AGENTIC_RETRIEVE_SOURCE_METADATA_LIST: StaticSchema = ( + 16, + n0, + _ARSML, + 0, + (_me,), + ((AGENTIC_RETRIEVE_SOURCE_METADATA, 0),), +) + +AGENTIC_RETRIEVE_STATUS: StaticSchema = ( + 14, + n0, + _ARS, + 0, + (_IP, _SUCCEEDED, _FAILED), + ((-1, {_sV: _IP}), (-1, {_sV: _SUCCEEDED}), (-1, {_sV: _FAILED})), +) + +AGENTIC_RETRIEVE_STEP: StaticSchema = ( + 14, + n0, + _ARSg, + 0, + (_PLANNING, _RETRIEVAL, _SR_, _FDE, _SHL), + ( + (-1, {_sV: _Pl}), + (-1, {_sV: _R}), + (-1, {_sV: _SRp}), + (-1, {_sV: _FDEu}), + (-1, {_sV: _SHLe}), + ), ) -AGENT_CORE_MEMORY_SESSION_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgentCoreMemorySessionId"), - shape_type=ShapeType.STRING, +USER_CONTEXT: StaticSchema = (18, n0, _UCs, 4, (_uI,), ((3, 1),)) + +BAD_GATEWAY_EXCEPTION: StaticSchema = ( + 18, + n0, + _BGE, + {_s: _se, _sE: 502}, + (_m, _rN), + ((NON_BLANK_STRING, 0), (NON_BLANK_STRING, 0)), +) + +CONFLICT_EXCEPTION: StaticSchema = ( + 18, + n0, + _CE, + {_s: _c, _sE: 409}, + (_m,), + ((NON_BLANK_STRING, 0),), +) + +DEPENDENCY_FAILED_EXCEPTION: StaticSchema = ( + 18, + n0, + _DFE, + {_s: _c, _sE: 424}, + (_m, _rN), + ((NON_BLANK_STRING, 0), (NON_BLANK_STRING, 0)), +) + +INTERNAL_SERVER_EXCEPTION: StaticSchema = ( + 18, + n0, + _ISE, + {_s: _se, _sE: 500}, + (_m, _rea), + ((NON_BLANK_STRING, 0), (3, 0)), +) + +RESOURCE_NOT_FOUND_EXCEPTION: StaticSchema = ( + 18, + n0, + _RNFE, + {_s: _c, _sE: 404}, + (_m,), + ((NON_BLANK_STRING, 0),), +) + +SERVICE_QUOTA_EXCEEDED_EXCEPTION: StaticSchema = ( + 18, + n0, + _SQEE, + {_s: _c, _sE: 400}, + (_m,), + ((NON_BLANK_STRING, 0),), +) + +THROTTLING_EXCEPTION: StaticSchema = ( + 18, + n0, + _TE, + {_s: _c, _sE: 429}, + (_m,), + ((NON_BLANK_STRING, 0),), +) + +AGENTIC_RETRIEVE_TRACE_RESULT_ITEM: StaticSchema = ( + 18, + n0, + _ARTRI, + 0, + (_co, _met, _sR), + ( + (RETRIEVAL_CONTENT, 0), + (AGENTIC_RETRIEVE_METADATA, 0), + (AGENTIC_RETRIEVE_SOURCE_RETRIEVER, 0), + ), ) -AGENTIC_RETRIEVE_SOURCE_RETRIEVER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgenticRetrieveSourceRetriever"), - members={ - "identifier": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +AGENTIC_RETRIEVE_TRACE_RESULTS: StaticSchema = ( + 16, + n0, + _ARTR, + 0, + (_me,), + ((AGENTIC_RETRIEVE_TRACE_RESULT_ITEM, 0),), +) + +AGENTIC_RETRIEVE_WARNING_MESSAGE: StaticSchema = (18, n0, _ARWM, 0, (_m,), ((3, 1),)) + +AGENTIC_RETRIEVE_WARNING: StaticSchema = ( + 19, + n0, + _ARW, + 0, + (_m, _gu), + ((AGENTIC_RETRIEVE_WARNING_MESSAGE, 0), (AGENTIC_RETRIEVE_GUARDRAIL_WARNING, 0)), +) + +AGENTIC_RETRIEVE_WARNINGS: StaticSchema = ( + 16, + n0, + _ARWg, + 0, + (_me,), + ((AGENTIC_RETRIEVE_WARNING, 0),), +) + +AGENTIC_RETRIEVE_TRACE_EVENT_ATTRIBUTES: StaticSchema = ( + 18, + n0, + _ARTEA, + 0, + (_ste, _sta, _m, _act, _wa, _fa, _rM, _rR), + ( + (AGENTIC_RETRIEVE_STEP, 1), + (AGENTIC_RETRIEVE_STATUS, 1), + (3, 1), + (AGENTIC_RETRIEVE_ACTIONS, 0), + (AGENTIC_RETRIEVE_WARNINGS, 0), + (AGENTIC_RETRIEVE_FAILURES, 0), + (AGENTIC_RETRIEVE_SOURCE_METADATA_LIST, 0), + (AGENTIC_RETRIEVE_TRACE_RESULTS, 0), + ), ) -AGENTIC_RETRIEVE_FULL_DOC_EXPANSION_DETAILS = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentruntime#AgenticRetrieveFullDocExpansionDetails" +AGENTIC_RETRIEVE_TRACE_EVENT: StaticSchema = ( + 18, + n0, + _ARTE, + 0, + (_id_, _ti, _at), + ((3, 1), (8, 1), (AGENTIC_RETRIEVE_TRACE_EVENT_ATTRIBUTES, 1)), +) + +VALIDATION_EXCEPTION: StaticSchema = ( + 18, + n0, + _VE, + {_s: _c, _sE: 400}, + (_m,), + ((NON_BLANK_STRING, 0),), +) + +AGENTIC_RETRIEVE_STREAM_RESPONSE_OUTPUT: StaticSchema = ( + 19, + n0, + _ARSRO, + {_smith: None}, + (_resu, _tE, _rE, _iSE, _vE, _rNFE, _sQEE, _tEh, _aDE, _cE, _dFE, _bGE), + ( + (AGENTIC_RETRIEVE_RESULT_EVENT, 0), + (AGENTIC_RETRIEVE_TRACE_EVENT, 0), + (AGENTIC_RETRIEVE_RESPONSE_EVENT, 0), + (INTERNAL_SERVER_EXCEPTION, 0), + (VALIDATION_EXCEPTION, 0), + (RESOURCE_NOT_FOUND_EXCEPTION, 0), + (SERVICE_QUOTA_EXCEEDED_EXCEPTION, 0), + (THROTTLING_EXCEPTION, 0), + (ACCESS_DENIED_EXCEPTION, 0), + (CONFLICT_EXCEPTION, 0), + (DEPENDENCY_FAILED_EXCEPTION, 0), + (BAD_GATEWAY_EXCEPTION, 0), ), - members={ - "documentId": {"target": STRING}, - "sourceRetriever": {"target": AGENTIC_RETRIEVE_SOURCE_RETRIEVER}, - }, ) -AGENTIC_RETRIEVE_MESSAGE_CONTENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgenticRetrieveMessageContent"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"text": {"target": STRING}}, -) - -AGENTIC_RETRIEVE_MEMORY_RETRIEVE_DETAILS = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentruntime#AgenticRetrieveMemoryRetrieveDetails" - ), - members={ - "inputQuery": { - "target": AGENTIC_RETRIEVE_MESSAGE_CONTENT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "memoryId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "namespace": {"target": STRING}, - "namespacePath": {"target": STRING}, - "strategyId": {"target": STRING}, - }, +AGENTIC_RETRIEVE_STREAM_OUTPUT: StaticSchema = ( + 18, + n0, + _ARSO, + {_sSI: _cARSR, _smithy: None}, + (_str,), + ((AGENTIC_RETRIEVE_STREAM_RESPONSE_OUTPUT, 17),), ) -AGENTIC_RETRIEVE_SOURCE_RETRIEVER_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgenticRetrieveSourceRetrieverList"), - shape_type=ShapeType.LIST, - members={"member": {"target": AGENTIC_RETRIEVE_SOURCE_RETRIEVER}}, +AGENT_ID: StaticSchema = (3, n0, _AI, 0) + +AGENT_VERSION: StaticSchema = (3, n0, _AV, 0) + +CALLER: StaticSchema = (19, n0, _C, 0, (_aAA,), ((AGENT_ALIAS_ARN, 0),)) + +CALLER_CHAIN: StaticSchema = (16, n0, _CC, 0, (_me,), ((CALLER, 0),)) + +SESSION_ID: StaticSchema = (3, n0, _SIe, 0) + +CUSTOM_ORCHESTRATION_TRACE_EVENT: StaticSchema = (18, n0, _COTE, 4, (_te,), ((3, 0),)) + +TRACE_ID: StaticSchema = (3, n0, _TI, 0) + +CUSTOM_ORCHESTRATION_TRACE: StaticSchema = ( + 18, + n0, + _COT, + 4, + (_tI, _e), + ((TRACE_ID, 0), (CUSTOM_ORCHESTRATION_TRACE_EVENT, 0)), ) -AGENTIC_RETRIEVE_ACTION_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgenticRetrieveActionDetails"), - members={ - "inputQuery": { - "target": AGENTIC_RETRIEVE_MESSAGE_CONTENT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "sourceRetrievers": { - "target": AGENTIC_RETRIEVE_SOURCE_RETRIEVER_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +FAILURE_REASON_STRING: StaticSchema = (3, n0, _FRS, 4) + +FAILURE_TRACE: StaticSchema = ( + 18, + n0, + _FT, + 4, + (_tI, _fRa, _fC, _met), + ((TRACE_ID, 0), (FAILURE_REASON_STRING, 0), (7, 0), (METADATA, 0)), ) -AGENTIC_RETRIEVE_ACTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgenticRetrieveAction"), - members={ - "retrieve": {"target": AGENTIC_RETRIEVE_ACTION_DETAILS}, - "fullDocumentExpansion": { - "target": AGENTIC_RETRIEVE_FULL_DOC_EXPANSION_DETAILS - }, - "memoryRetrieve": {"target": AGENTIC_RETRIEVE_MEMORY_RETRIEVE_DETAILS}, - }, +GUARDRAIL_CONTENT_POLICY_ACTION: StaticSchema = ( + 14, + n0, + _GCPA, + 0, + (_BLOCKED,), + ((-1, {_sV: _BLOCKED}),), ) -AGENTIC_RETRIEVE_ACTIONS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgenticRetrieveActions"), - shape_type=ShapeType.LIST, - members={"member": {"target": AGENTIC_RETRIEVE_ACTION}}, +GUARDRAIL_CONTENT_FILTER_CONFIDENCE: StaticSchema = ( + 14, + n0, + _GCFC, + 0, + (_NONE, _LOW, _MEDIUM, _HIGH), + ((-1, {_sV: _NONE}), (-1, {_sV: _LOW}), (-1, {_sV: _MEDIUM}), (-1, {_sV: _HIGH})), ) -AGENTIC_RETRIEVE_BEDROCK_GUARDRAIL_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentruntime#AgenticRetrieveBedrockGuardrailConfiguration" +GUARDRAIL_CONTENT_FILTER_TYPE: StaticSchema = ( + 14, + n0, + _GCFT, + 0, + (_INSULTS, _HATE, _SEXUAL, _VIOLENCE, _MISCONDUCT, _PA), + ( + (-1, {_sV: _INSULTS}), + (-1, {_sV: _HATE}), + (-1, {_sV: _SEXUAL}), + (-1, {_sV: _VIOLENCE}), + (-1, {_sV: _MISCONDUCT}), + (-1, {_sV: _PA}), ), - members={ - "guardrailId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "guardrailVersion": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, ) -BEDROCK_MODEL_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#BedrockModelArn"), - shape_type=ShapeType.STRING, +GUARDRAIL_CONTENT_FILTER: StaticSchema = ( + 18, + n0, + _GCF, + 4, + (_t, _con, _ac), + ( + (GUARDRAIL_CONTENT_FILTER_TYPE, 0), + (GUARDRAIL_CONTENT_FILTER_CONFIDENCE, 0), + (GUARDRAIL_CONTENT_POLICY_ACTION, 0), + ), ) -AGENTIC_RETRIEVE_BEDROCK_RERANKING_MODEL_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentruntime#AgenticRetrieveBedrockRerankingModelConfiguration" +GUARDRAIL_CONTENT_FILTER_LIST: StaticSchema = ( + 16, + n0, + _GCFL, + 4, + (_me,), + ((GUARDRAIL_CONTENT_FILTER, 0),), +) + +GUARDRAIL_CONTENT_POLICY_ASSESSMENT: StaticSchema = ( + 18, + n0, + _GCPAu, + 4, + (_fi,), + ((GUARDRAIL_CONTENT_FILTER_LIST, 0),), +) + +GUARDRAIL_SENSITIVE_INFORMATION_POLICY_ACTION: StaticSchema = ( + 14, + n0, + _GSIPA, + 0, + (_BLOCKED, _ANONYMIZED), + ((-1, {_sV: _BLOCKED}), (-1, {_sV: _ANONYMIZED})), +) + +GUARDRAIL_PII_ENTITY_TYPE: StaticSchema = ( + 14, + n0, + _GPET, + 0, + ( + _ADDRESS, + _AGE_, + _AAK, + _ASK, + _CHN, + _CSIN, + _CDCC, + _CDCE, + _CDCN, + _DI, + _EMAIL, + _IBAN, + _IA, + _LP, + _MA, + _NAME, + _PASSWORD, + _PHONE, + _PIN, + _SC, + _UNHSN, + _UNIN, + _UUTRN, + _URL, + _USERNAME, + _UBAN, + _UBRN, + _UITIN, + _UPN, + _USSN, + _VIN, + ), + ( + (-1, {_sV: _ADDRESS}), + (-1, {_sV: _AGE_}), + (-1, {_sV: _AAK}), + (-1, {_sV: _ASK}), + (-1, {_sV: _CHN}), + (-1, {_sV: _CSIN}), + (-1, {_sV: _CDCC}), + (-1, {_sV: _CDCE}), + (-1, {_sV: _CDCN}), + (-1, {_sV: _DI}), + (-1, {_sV: _EMAIL}), + (-1, {_sV: _IBAN}), + (-1, {_sV: _IA}), + (-1, {_sV: _LP}), + (-1, {_sV: _MA}), + (-1, {_sV: _NAME}), + (-1, {_sV: _PASSWORD}), + (-1, {_sV: _PHONE}), + (-1, {_sV: _PIN}), + (-1, {_sV: _SC}), + (-1, {_sV: _UNHSN}), + (-1, {_sV: _UNIN}), + (-1, {_sV: _UUTRN}), + (-1, {_sV: _URL}), + (-1, {_sV: _USERNAME}), + (-1, {_sV: _UBAN}), + (-1, {_sV: _UBRN}), + (-1, {_sV: _UITIN}), + (-1, {_sV: _UPN}), + (-1, {_sV: _USSN}), + (-1, {_sV: _VIN}), ), - members={ - "modelArn": { - "target": BEDROCK_MODEL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, ) -AGENTIC_RETRIEVE_BEDROCK_RERANKING_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentruntime#AgenticRetrieveBedrockRerankingConfiguration" +GUARDRAIL_PII_ENTITY_FILTER: StaticSchema = ( + 18, + n0, + _GPEF, + 4, + (_t, _ma, _ac), + ( + (GUARDRAIL_PII_ENTITY_TYPE, 0), + (3, 0), + (GUARDRAIL_SENSITIVE_INFORMATION_POLICY_ACTION, 0), ), - members={ - "modelConfiguration": { - "target": AGENTIC_RETRIEVE_BEDROCK_RERANKING_MODEL_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, ) -AGENTIC_RETRIEVE_CITATION_REFERENCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgenticRetrieveCitationReference"), - members={ - "resultIndex": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +GUARDRAIL_PII_ENTITY_FILTER_LIST: StaticSchema = ( + 16, + n0, + _GPEFL, + 4, + (_me,), + ((GUARDRAIL_PII_ENTITY_FILTER, 0),), +) + +GUARDRAIL_REGEX_FILTER: StaticSchema = ( + 18, + n0, + _GRF, + 4, + (_n, _reg, _ma, _ac), + ((3, 0), (3, 0), (3, 0), (GUARDRAIL_SENSITIVE_INFORMATION_POLICY_ACTION, 0)), +) + +GUARDRAIL_REGEX_FILTER_LIST: StaticSchema = ( + 16, + n0, + _GRFL, + 4, + (_me,), + ((GUARDRAIL_REGEX_FILTER, 0),), +) + +GUARDRAIL_SENSITIVE_INFORMATION_POLICY_ASSESSMENT: StaticSchema = ( + 18, + n0, + _GSIPAu, + 4, + (_pE, _rege), + ((GUARDRAIL_PII_ENTITY_FILTER_LIST, 0), (GUARDRAIL_REGEX_FILTER_LIST, 0)), +) + +GUARDRAIL_TOPIC_POLICY_ACTION: StaticSchema = ( + 14, + n0, + _GTPA, + 0, + (_BLOCKED,), + ((-1, {_sV: _BLOCKED}),), +) + +GUARDRAIL_TOPIC_TYPE: StaticSchema = (14, n0, _GTT, 0, (_DENY,), ((-1, {_sV: _DENY}),)) + +GUARDRAIL_TOPIC: StaticSchema = ( + 18, + n0, + _GTu, + 4, + (_n, _t, _ac), + ((3, 0), (GUARDRAIL_TOPIC_TYPE, 0), (GUARDRAIL_TOPIC_POLICY_ACTION, 0)), +) + +GUARDRAIL_TOPIC_LIST: StaticSchema = (16, n0, _GTL, 4, (_me,), ((GUARDRAIL_TOPIC, 0),)) + +GUARDRAIL_TOPIC_POLICY_ASSESSMENT: StaticSchema = ( + 18, + n0, + _GTPAu, + 4, + (_to,), + ((GUARDRAIL_TOPIC_LIST, 0),), +) + +GUARDRAIL_WORD_POLICY_ACTION: StaticSchema = ( + 14, + n0, + _GWPA, + 0, + (_BLOCKED,), + ((-1, {_sV: _BLOCKED}),), +) + +GUARDRAIL_CUSTOM_WORD: StaticSchema = ( + 18, + n0, + _GCW, + 4, + (_ma, _ac), + ((3, 0), (GUARDRAIL_WORD_POLICY_ACTION, 0)), +) + +GUARDRAIL_CUSTOM_WORD_LIST: StaticSchema = ( + 16, + n0, + _GCWL, + 4, + (_me,), + ((GUARDRAIL_CUSTOM_WORD, 0),), +) + +GUARDRAIL_MANAGED_WORD_TYPE: StaticSchema = ( + 14, + n0, + _GMWT, + 0, + (_PROFANITY,), + ((-1, {_sV: _PROFANITY}),), +) + +GUARDRAIL_MANAGED_WORD: StaticSchema = ( + 18, + n0, + _GMW, + 4, + (_ma, _t, _ac), + ((3, 0), (GUARDRAIL_MANAGED_WORD_TYPE, 0), (GUARDRAIL_WORD_POLICY_ACTION, 0)), +) + +GUARDRAIL_MANAGED_WORD_LIST: StaticSchema = ( + 16, + n0, + _GMWL, + 4, + (_me,), + ((GUARDRAIL_MANAGED_WORD, 0),), +) + +GUARDRAIL_WORD_POLICY_ASSESSMENT: StaticSchema = ( + 18, + n0, + _GWPAu, + 4, + (_cW, _mWL), + ((GUARDRAIL_CUSTOM_WORD_LIST, 0), (GUARDRAIL_MANAGED_WORD_LIST, 0)), +) + +GUARDRAIL_ASSESSMENT: StaticSchema = ( + 18, + n0, + _GAu, + 4, + (_tP, _cP, _wP, _sIP), + ( + (GUARDRAIL_TOPIC_POLICY_ASSESSMENT, 0), + (GUARDRAIL_CONTENT_POLICY_ASSESSMENT, 0), + (GUARDRAIL_WORD_POLICY_ASSESSMENT, 0), + (GUARDRAIL_SENSITIVE_INFORMATION_POLICY_ASSESSMENT, 0), + ), ) -AGENTIC_RETRIEVE_CITATION_REFERENCE_LIST = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentruntime#AgenticRetrieveCitationReferenceList" - ), - shape_type=ShapeType.LIST, - members={"member": {"target": AGENTIC_RETRIEVE_CITATION_REFERENCE}}, -) - -AGENTIC_RETRIEVE_CITATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgenticRetrieveCitation"), - members={ - "startIndex": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "endIndex": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "references": { - "target": AGENTIC_RETRIEVE_CITATION_REFERENCE_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +GUARDRAIL_ASSESSMENT_LIST: StaticSchema = ( + 16, + n0, + _GAL, + 0, + (_me,), + ((GUARDRAIL_ASSESSMENT, 0),), +) + +GUARDRAIL_TRACE: StaticSchema = ( + 18, + n0, + _GTua, + 4, + (_ac, _tI, _iA, _oA, _met), + ( + (GUARDRAIL_ACTION, 0), + (TRACE_ID, 0), + (GUARDRAIL_ASSESSMENT_LIST, 0), + (GUARDRAIL_ASSESSMENT_LIST, 0), + (METADATA, 0), + ), ) -AGENTIC_RETRIEVE_CITATION_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgenticRetrieveCitationList"), - shape_type=ShapeType.LIST, - members={"member": {"target": AGENTIC_RETRIEVE_CITATION}}, +FILES: StaticSchema = (16, n0, _Fi, 0, (_me,), ((3, 0),)) + +CODE_INTERPRETER_INVOCATION_INPUT: StaticSchema = ( + 18, + n0, + _CIII, + 0, + (_cod, _fil), + ((3, 0), (FILES, 0)), +) + +INVOCATION_TYPE: StaticSchema = ( + 14, + n0, + _IT, + 0, + (_AG, _KB, _FINISH, _AGCI, _AC__), + ( + (-1, {_sV: _AG}), + (-1, {_sV: _KB}), + (-1, {_sV: _FINISH}), + (-1, {_sV: _AGCI}), + (-1, {_sV: _AC__}), + ), ) -BEDROCK_FOUNDATION_MODEL_MODEL_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentruntime#BedrockFoundationModelModelConfiguration" +TRACE_KNOWLEDGE_BASE_ID: StaticSchema = (3, n0, _TKBI, 4) + +KNOWLEDGE_BASE_LOOKUP_INPUT_STRING: StaticSchema = (3, n0, _KBLIS, 4) + +KNOWLEDGE_BASE_LOOKUP_INPUT: StaticSchema = ( + 18, + n0, + _KBLI, + 0, + (_te, _kBI), + ((KNOWLEDGE_BASE_LOOKUP_INPUT_STRING, 0), (TRACE_KNOWLEDGE_BASE_ID, 0)), +) + +INVOCATION_INPUT: StaticSchema = ( + 18, + n0, + _IInv, + 4, + (_tI, _iTn, _aGII, _kBLI, _cIII, _aCII), + ( + (TRACE_ID, 0), + (INVOCATION_TYPE, 0), + (ACTION_GROUP_INVOCATION_INPUT, 0), + (KNOWLEDGE_BASE_LOOKUP_INPUT, 0), + (CODE_INTERPRETER_INVOCATION_INPUT, 0), + (AGENT_COLLABORATOR_INVOCATION_INPUT, 0), ), - members={ - "modelArn": { - "target": BEDROCK_MODEL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, ) -BEDROCK_FOUNDATION_MODEL_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#BedrockFoundationModelConfiguration"), - members={ - "modelConfiguration": { - "target": BEDROCK_FOUNDATION_MODEL_MODEL_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +MODEL_IDENTIFIER: StaticSchema = (3, n0, _MI, 0) -MANTLE_PROJECT_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#MantleProjectId"), - shape_type=ShapeType.STRING, -) +MAXIMUM_LENGTH: StaticSchema = (7, n0, _ML, 0) -MANTLE_FOUNDATION_MODEL_MODEL_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentruntime#MantleFoundationModelModelConfiguration" - ), - members={ - "modelArn": { - "target": BEDROCK_MODEL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "projectId": {"target": MANTLE_PROJECT_ID}, - }, -) +STOP_SEQUENCES: StaticSchema = (16, n0, _SS, 0, (_me,), ((3, 0),)) -MANTLE_FOUNDATION_MODEL_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#MantleFoundationModelConfiguration"), - members={ - "modelConfiguration": { - "target": MANTLE_FOUNDATION_MODEL_MODEL_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +TEMPERATURE: StaticSchema = (9, n0, _T, 0) -FOUNDATION_MODEL_CONFIGURATION_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FoundationModelConfigurationType"), - shape_type=ShapeType.ENUM, - members={ - "BEDROCK_FOUNDATION_MODEL": {"target": UNIT}, - "MANTLE_FOUNDATION_MODEL": {"target": UNIT}, - }, -) +TOP_K: StaticSchema = (7, n0, _TK, 0) -FOUNDATION_MODEL_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FoundationModelConfiguration"), - members={ - "type": { - "target": FOUNDATION_MODEL_CONFIGURATION_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "bedrockFoundationModelConfiguration": { - "target": BEDROCK_FOUNDATION_MODEL_CONFIGURATION - }, - "mantleFoundationModelConfiguration": { - "target": MANTLE_FOUNDATION_MODEL_CONFIGURATION - }, - }, +TOP_P: StaticSchema = (9, n0, _TP, 0) + +INFERENCE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _IC, + 0, + (_tem, _tPo, _tK, _mL, _sS), + ( + (TEMPERATURE, 0), + (TOP_P, 0), + (TOP_K, 0), + (MAXIMUM_LENGTH, 0), + (STOP_SEQUENCES, 0), + ), ) -FOUNDATION_MODEL_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FoundationModelType"), - shape_type=ShapeType.ENUM, - members={"CUSTOM": {"target": UNIT}, "MANAGED": {"target": UNIT}}, +LAMBDA_ARN: StaticSchema = (3, n0, _LA, 0) + +CREATION_MODE: StaticSchema = ( + 14, + n0, + _CMr, + 0, + (_DEFAULT, _OVERRIDDEN), + ((-1, {_sV: _DEFAULT}), (-1, {_sV: _OVERRIDDEN})), ) -AGENTIC_RETRIEVE_RERANKING_CONFIGURATION_TYPE = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentruntime#AgenticRetrieveRerankingConfigurationType" +PROMPT_TEXT: StaticSchema = (3, n0, _PTr, 4) + +PROMPT_TYPE: StaticSchema = ( + 14, + n0, + _PTro, + 0, + (_PP_, _ORCHESTRATION, _KBRG, _PP__, _RC_), + ( + (-1, {_sV: _PP_}), + (-1, {_sV: _ORCHESTRATION}), + (-1, {_sV: _KBRG}), + (-1, {_sV: _PP__}), + (-1, {_sV: _RC_}), ), - shape_type=ShapeType.ENUM, - members={"BEDROCK_RERANKING_MODEL": {"target": UNIT}}, ) -AGENTIC_RETRIEVE_RERANKING_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentruntime#AgenticRetrieveRerankingConfiguration" +MODEL_INVOCATION_INPUT: StaticSchema = ( + 18, + n0, + _MII, + 4, + (_tI, _te, _t, _oL, _pCM, _iC, _pMa, _fM), + ( + (TRACE_ID, 0), + (PROMPT_TEXT, 0), + (PROMPT_TYPE, 0), + (LAMBDA_ARN, 0), + (CREATION_MODE, 0), + (INFERENCE_CONFIGURATION, 0), + (CREATION_MODE, 0), + (MODEL_IDENTIFIER, 0), ), - members={ - "type": { - "target": AGENTIC_RETRIEVE_RERANKING_CONFIGURATION_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "bedrockRerankingConfiguration": { - "target": AGENTIC_RETRIEVE_BEDROCK_RERANKING_CONFIGURATION - }, - }, ) -AGENTIC_RETRIEVE_RERANKING_MODEL_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgenticRetrieveRerankingModelType"), - shape_type=ShapeType.ENUM, - members={ - "CUSTOM": {"target": UNIT}, - "MANAGED": {"target": UNIT}, - "NONE": {"target": UNIT}, - }, -) +RAW_RESPONSE: StaticSchema = (18, n0, _RR, 4, (_co,), ((3, 0),)) -AGENTIC_RETRIEVE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgenticRetrieveConfiguration"), - members={ - "foundationModelType": { - "target": FOUNDATION_MODEL_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="MANAGED")], - }, - "foundationModelConfiguration": {"target": FOUNDATION_MODEL_CONFIGURATION}, - "rerankingModelType": {"target": AGENTIC_RETRIEVE_RERANKING_MODEL_TYPE}, - "rerankingConfiguration": {"target": AGENTIC_RETRIEVE_RERANKING_CONFIGURATION}, - "maxAgentIteration": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=5)], - }, - }, -) +REASONING_TEXT_BLOCK: StaticSchema = (18, n0, _RTB, 4, (_te, _si), ((3, 1), (3, 0))) -AGENTIC_RETRIEVE_FAILURE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgenticRetrieveFailure"), - members={ - "message": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +REASONING_CONTENT_BLOCK: StaticSchema = ( + 19, + n0, + _RCB, + 4, + (_rTe, _rCed), + ((REASONING_TEXT_BLOCK, 0), (1, 0)), ) -AGENTIC_RETRIEVE_FAILURES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgenticRetrieveFailures"), - shape_type=ShapeType.LIST, - members={"member": {"target": AGENTIC_RETRIEVE_FAILURE}}, +ORCHESTRATION_MODEL_INVOCATION_OUTPUT: StaticSchema = ( + 18, + n0, + _OMIO, + 4, + (_tI, _rRa, _met, _rCea), + ((TRACE_ID, 0), (RAW_RESPONSE, 0), (METADATA, 0), (REASONING_CONTENT_BLOCK, 0)), ) -AGENTIC_RETRIEVE_GENERATED_RESPONSE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgenticRetrieveGeneratedResponse"), - members={ - "answer": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "citations": {"target": AGENTIC_RETRIEVE_CITATION_LIST}, - }, +CODE_INTERPRETER_INVOCATION_OUTPUT: StaticSchema = ( + 18, + n0, + _CIIO, + 0, + (_eO, _eE, _fil, _eTx, _met), + ((3, 0), (3, 0), (FILES, 0), (2, 0), (METADATA, 0)), ) -GUARDRAIL_ACTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GuardrailAction"), - shape_type=ShapeType.ENUM, - members={"INTERVENED": {"target": UNIT}, "NONE": {"target": UNIT}}, -) - -AGENTIC_RETRIEVE_GUARDRAIL_WARNING = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgenticRetrieveGuardrailWarning"), - members={ - "id": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "version": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "action": { - "target": GUARDRAIL_ACTION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "message": {"target": STRING}, - }, -) +FINAL_RESPONSE_STRING: StaticSchema = (3, n0, _FRSi, 4) -AGENTIC_RETRIEVE_MEMORY_PERSISTENCE_MODE = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentruntime#AgenticRetrieveMemoryPersistenceMode" - ), - shape_type=ShapeType.ENUM, - members={"DEFAULT": {"target": UNIT}, "NONE": {"target": UNIT}}, +FINAL_RESPONSE: StaticSchema = ( + 18, + n0, + _FRi, + 0, + (_te, _met), + ((FINAL_RESPONSE_STRING, 0), (METADATA, 0)), ) -AGENTIC_RETRIEVE_MEMORY_METADATA_KEY = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgenticRetrieveMemoryMetadataKey"), - shape_type=ShapeType.STRING, -) +AUDIO_SEGMENT: StaticSchema = (18, n0, _AS, 0, (_sU, _tr), ((3, 1), (3, 0))) -AGENTIC_RETRIEVE_MEMORY_METADATA_FILTER_LEFT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentruntime#AgenticRetrieveMemoryMetadataFilterLeft" +RETRIEVAL_RESULT_CONTENT_COLUMN_TYPE: StaticSchema = ( + 14, + n0, + _RRCCT, + 0, + (_BLOB, _BOOLEAN, _DOUBLE, _NULL, _LONG, _STRING), + ( + (-1, {_sV: _BLOB}), + (-1, {_sV: _BOOLEAN}), + (-1, {_sV: _DOUBLE}), + (-1, {_sV: _NULL}), + (-1, {_sV: _LONG}), + (-1, {_sV: _STRING}), ), - shape_type=ShapeType.UNION, - members={"metadataKey": {"target": AGENTIC_RETRIEVE_MEMORY_METADATA_KEY}}, ) -AGENTIC_RETRIEVE_MEMORY_METADATA_FILTER_OPERATOR = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentruntime#AgenticRetrieveMemoryMetadataFilterOperator" +RETRIEVAL_RESULT_CONTENT_COLUMN: StaticSchema = ( + 18, + n0, + _RRCC, + 4, + (_cNo, _cV, _t), + ((3, 0), (3, 0), (RETRIEVAL_RESULT_CONTENT_COLUMN_TYPE, 0)), +) + +RETRIEVAL_RESULT_CONTENT_ROW: StaticSchema = ( + 16, + n0, + _RRCR, + 4, + (_me,), + ((RETRIEVAL_RESULT_CONTENT_COLUMN, 0),), +) + +RETRIEVAL_RESULT_CONTENT_TYPE: StaticSchema = ( + 14, + n0, + _RRCT, + 0, + (_TEXT, _IMAGE, _ROW, _AUDIO, _VIDEO), + ( + (-1, {_sV: _TEXT}), + (-1, {_sV: _IMAGE}), + (-1, {_sV: _ROW}), + (-1, {_sV: _AUDIO}), + (-1, {_sV: _VIDEO}), ), - shape_type=ShapeType.ENUM, - members={ - "EQUALS_TO": {"target": UNIT}, - "EXISTS": {"target": UNIT}, - "NOT_EXISTS": {"target": UNIT}, - "BEFORE": {"target": UNIT}, - "AFTER": {"target": UNIT}, - "CONTAINS": {"target": UNIT}, - "GREATER_THAN": {"target": UNIT}, - "GREATER_THAN_OR_EQUALS": {"target": UNIT}, - "LESS_THAN": {"target": UNIT}, - "LESS_THAN_OR_EQUALS": {"target": UNIT}, - }, ) -AGENTIC_RETRIEVE_MEMORY_METADATA_STRING_LIST_ITEM = Schema( - id=ShapeID( - "com.amazonaws.bedrockagentruntime#AgenticRetrieveMemoryMetadataStringListItem" +VIDEO_SEGMENT: StaticSchema = (18, n0, _VS, 0, (_sU, _su), ((3, 1), (3, 0))) + +RETRIEVAL_RESULT_CONTENT: StaticSchema = ( + 18, + n0, + _RRC, + 4, + (_t, _te, _bC, _vi, _au, _row), + ( + (RETRIEVAL_RESULT_CONTENT_TYPE, 0), + (3, {_smit: _v_}), + (3, 0), + (VIDEO_SEGMENT, 0), + (AUDIO_SEGMENT, 0), + (RETRIEVAL_RESULT_CONTENT_ROW, 0), ), - shape_type=ShapeType.STRING, ) -AGENTIC_RETRIEVE_MEMORY_METADATA_STRING_LIST = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentruntime#AgenticRetrieveMemoryMetadataStringList" +RETRIEVAL_RESULT_CONFLUENCE_LOCATION: StaticSchema = ( + 18, + n0, + _RRCL, + 0, + (_ur,), + ((3, 0),), +) + +RETRIEVAL_RESULT_CUSTOM_DOCUMENT_LOCATION: StaticSchema = ( + 18, + n0, + _RRCDL, + 0, + (_id_,), + ((3, 0),), +) + +RETRIEVAL_RESULT_GOOGLE_DRIVE_LOCATION: StaticSchema = ( + 18, + n0, + _RRGDL, + 0, + (_ur,), + ((3, 0),), +) + +RETRIEVAL_RESULT_KENDRA_DOCUMENT_LOCATION: StaticSchema = ( + 18, + n0, + _RRKDL, + 0, + (_uri,), + ((3, 0),), +) + +RETRIEVAL_RESULT_ONE_DRIVE_LOCATION: StaticSchema = ( + 18, + n0, + _RRODL, + 0, + (_ur,), + ((3, 0),), +) + +RETRIEVAL_RESULT_S3_LOCATION: StaticSchema = (18, n0, _RRSL, 0, (_uri,), ((3, 0),)) + +RETRIEVAL_RESULT_SALESFORCE_LOCATION: StaticSchema = ( + 18, + n0, + _RRSLe, + 0, + (_ur,), + ((3, 0),), +) + +RETRIEVAL_RESULT_SHARE_POINT_LOCATION: StaticSchema = ( + 18, + n0, + _RRSPL, + 0, + (_ur,), + ((3, 0),), +) + +RETRIEVAL_RESULT_SQL_LOCATION: StaticSchema = (18, n0, _RRSLet, 0, (_q,), ((3, 0),)) + +RETRIEVAL_RESULT_LOCATION_TYPE: StaticSchema = ( + 14, + n0, + _RRLT, + 0, + ( + _S, + _WEB, + _CONFLUENCE, + _SALESFORCE, + _SHAREPOINT, + _CUSTOM, + _KENDRA, + _SQL, + _ONEDRIVE, + _GOOGLEDRIVE, + ), + ( + (-1, {_sV: _S}), + (-1, {_sV: _WEB}), + (-1, {_sV: _CONFLUENCE}), + (-1, {_sV: _SALESFORCE}), + (-1, {_sV: _SHAREPOINT}), + (-1, {_sV: _CUSTOM}), + (-1, {_sV: _KENDRA}), + (-1, {_sV: _SQL}), + (-1, {_sV: _ONEDRIVE}), + (-1, {_sV: _GOOGLEDRIVE}), ), - shape_type=ShapeType.LIST, - members={"member": {"target": AGENTIC_RETRIEVE_MEMORY_METADATA_STRING_LIST_ITEM}}, ) -AGENTIC_RETRIEVE_MEMORY_METADATA_STRING_VALUE = Schema( - id=ShapeID( - "com.amazonaws.bedrockagentruntime#AgenticRetrieveMemoryMetadataStringValue" +RETRIEVAL_RESULT_WEB_LOCATION: StaticSchema = (18, n0, _RRWL, 0, (_ur,), ((3, 0),)) + +RETRIEVAL_RESULT_LOCATION: StaticSchema = ( + 18, + n0, + _RRL, + 4, + (_t, _sL, _wL, _cL, _sLa, _sPL, _cDL, _kDL, _sLq, _oDL, _gDL), + ( + (RETRIEVAL_RESULT_LOCATION_TYPE, 1), + (RETRIEVAL_RESULT_S3_LOCATION, 0), + (RETRIEVAL_RESULT_WEB_LOCATION, 0), + (RETRIEVAL_RESULT_CONFLUENCE_LOCATION, 0), + (RETRIEVAL_RESULT_SALESFORCE_LOCATION, 0), + (RETRIEVAL_RESULT_SHARE_POINT_LOCATION, 0), + (RETRIEVAL_RESULT_CUSTOM_DOCUMENT_LOCATION, 0), + (RETRIEVAL_RESULT_KENDRA_DOCUMENT_LOCATION, 0), + (RETRIEVAL_RESULT_SQL_LOCATION, 0), + (RETRIEVAL_RESULT_ONE_DRIVE_LOCATION, 0), + (RETRIEVAL_RESULT_GOOGLE_DRIVE_LOCATION, 0), ), - shape_type=ShapeType.STRING, ) -AGENTIC_RETRIEVE_MEMORY_METADATA_VALUE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgenticRetrieveMemoryMetadataValue"), - shape_type=ShapeType.UNION, - members={ - "stringValue": {"target": AGENTIC_RETRIEVE_MEMORY_METADATA_STRING_VALUE}, - "numberValue": {"target": DOUBLE}, - "stringListValue": {"target": AGENTIC_RETRIEVE_MEMORY_METADATA_STRING_LIST}, - "dateTimeValue": {"target": TIMESTAMP}, - }, +RETRIEVAL_RESULT_METADATA_KEY: StaticSchema = (3, n0, _RRMK, 0) + +RETRIEVAL_RESULT_METADATA_VALUE: StaticSchema = (13, n0, _RRMV, 0) + +RETRIEVAL_RESULT_METADATA: StaticSchema = ( + 17, + n0, + _RRM, + 4, + (_k, _v), + ((RETRIEVAL_RESULT_METADATA_KEY, 0), (RETRIEVAL_RESULT_METADATA_VALUE, 0)), ) -AGENTIC_RETRIEVE_MEMORY_METADATA_FILTER_RIGHT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentruntime#AgenticRetrieveMemoryMetadataFilterRight" +RETRIEVED_REFERENCE: StaticSchema = ( + 18, + n0, + _RRe, + 0, + (_co, _lo, _met), + ( + (RETRIEVAL_RESULT_CONTENT, 0), + (RETRIEVAL_RESULT_LOCATION, 0), + (RETRIEVAL_RESULT_METADATA, 0), ), - shape_type=ShapeType.UNION, - members={"metadataValue": {"target": AGENTIC_RETRIEVE_MEMORY_METADATA_VALUE}}, ) -AGENTIC_RETRIEVE_MEMORY_METADATA_FILTER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgenticRetrieveMemoryMetadataFilter"), - members={ - "left": { - "target": AGENTIC_RETRIEVE_MEMORY_METADATA_FILTER_LEFT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "operator": { - "target": AGENTIC_RETRIEVE_MEMORY_METADATA_FILTER_OPERATOR, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "right": {"target": AGENTIC_RETRIEVE_MEMORY_METADATA_FILTER_RIGHT}, - }, +RETRIEVED_REFERENCES: StaticSchema = ( + 16, + n0, + _RRet, + 0, + (_me,), + ((RETRIEVED_REFERENCE, 0),), +) + +KNOWLEDGE_BASE_LOOKUP_OUTPUT: StaticSchema = ( + 18, + n0, + _KBLO, + 0, + (_rRe, _met), + ((RETRIEVED_REFERENCES, 0), (METADATA, 0)), +) + +SOURCE: StaticSchema = ( + 14, + n0, + _So, + 4, + (_AG, _KB, _PARSER), + ((-1, {_sV: _AG}), (-1, {_sV: _KB}), (-1, {_sV: _PARSER})), +) + +REPROMPT_RESPONSE: StaticSchema = (18, n0, _RRep, 4, (_te, _so), ((3, 0), (SOURCE, 0))) + +TYPE: StaticSchema = ( + 14, + n0, + _Ty, + 0, + (_AG, _AC__, _KB, _FINISH, _AU_, _REPROMPT), + ( + (-1, {_sV: _AG}), + (-1, {_sV: _AC__}), + (-1, {_sV: _KB}), + (-1, {_sV: _FINISH}), + (-1, {_sV: _AU_}), + (-1, {_sV: _REPROMPT}), + ), ) -AGENTIC_RETRIEVE_MEMORY_METADATA_FILTER_LIST = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentruntime#AgenticRetrieveMemoryMetadataFilterList" +OBSERVATION: StaticSchema = ( + 18, + n0, + _O, + 4, + (_tI, _t, _aGIO, _aCIO, _kBLO, _fRi, _rRep, _cIIO), + ( + (TRACE_ID, 0), + (TYPE, 0), + (ACTION_GROUP_INVOCATION_OUTPUT, 0), + (AGENT_COLLABORATOR_INVOCATION_OUTPUT, 0), + (KNOWLEDGE_BASE_LOOKUP_OUTPUT, 0), + (FINAL_RESPONSE, 0), + (REPROMPT_RESPONSE, 0), + (CODE_INTERPRETER_INVOCATION_OUTPUT, 0), ), - shape_type=ShapeType.LIST, - members={"member": {"target": AGENTIC_RETRIEVE_MEMORY_METADATA_FILTER}}, ) -MEMORY_NAMESPACE = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#MemoryNamespace"), - shape_type=ShapeType.STRING, +RATIONALE_STRING: StaticSchema = (3, n0, _RSa, 4) + +RATIONALE: StaticSchema = ( + 18, + n0, + _Ra, + 4, + (_tI, _te), + ((TRACE_ID, 0), (RATIONALE_STRING, 0)), +) + +ORCHESTRATION_TRACE: StaticSchema = ( + 19, + n0, + _OT, + 4, + (_ra, _iInv, _ob, _mII, _mIO), + ( + (RATIONALE, 0), + (INVOCATION_INPUT, 0), + (OBSERVATION, 0), + (MODEL_INVOCATION_INPUT, 0), + (ORCHESTRATION_MODEL_INVOCATION_OUTPUT, 0), + ), ) -MEMORY_STRATEGY_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#MemoryStrategyId"), - shape_type=ShapeType.STRING, +OUTPUT_STRING: StaticSchema = (3, n0, _OS, 4) + +POST_PROCESSING_PARSED_RESPONSE: StaticSchema = ( + 18, + n0, + _PPPR, + 4, + (_te,), + ((OUTPUT_STRING, 0),), +) + +POST_PROCESSING_MODEL_INVOCATION_OUTPUT: StaticSchema = ( + 18, + n0, + _PPMIO, + 4, + (_tI, _pR, _rRa, _met, _rCea), + ( + (TRACE_ID, 0), + (POST_PROCESSING_PARSED_RESPONSE, 0), + (RAW_RESPONSE, 0), + (METADATA, 0), + (REASONING_CONTENT_BLOCK, 0), + ), ) -AGENTIC_RETRIEVE_MEMORY_RETRIEVAL_CONFIG = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentruntime#AgenticRetrieveMemoryRetrievalConfig" +POST_PROCESSING_TRACE: StaticSchema = ( + 19, + n0, + _PPT, + 4, + (_mII, _mIO), + ((MODEL_INVOCATION_INPUT, 0), (POST_PROCESSING_MODEL_INVOCATION_OUTPUT, 0)), +) + +PRE_PROCESSING_PARSED_RESPONSE: StaticSchema = ( + 18, + n0, + _PPPRr, + 4, + (_ra, _iV), + ((RATIONALE_STRING, 0), (2, 0)), +) + +PRE_PROCESSING_MODEL_INVOCATION_OUTPUT: StaticSchema = ( + 18, + n0, + _PPMIOr, + 4, + (_tI, _pR, _rRa, _met, _rCea), + ( + (TRACE_ID, 0), + (PRE_PROCESSING_PARSED_RESPONSE, 0), + (RAW_RESPONSE, 0), + (METADATA, 0), + (REASONING_CONTENT_BLOCK, 0), ), - members={ - "namespace": {"target": MEMORY_NAMESPACE}, - "namespacePath": {"target": MEMORY_NAMESPACE}, - "strategyId": {"target": MEMORY_STRATEGY_ID}, - "metadataFilters": {"target": AGENTIC_RETRIEVE_MEMORY_METADATA_FILTER_LIST}, - }, ) -AGENTIC_RETRIEVE_MEMORY_RETRIEVAL_CONFIG_LIST = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentruntime#AgenticRetrieveMemoryRetrievalConfigList" +PRE_PROCESSING_TRACE: StaticSchema = ( + 19, + n0, + _PPTr, + 4, + (_mII, _mIO), + ((MODEL_INVOCATION_INPUT, 0), (PRE_PROCESSING_MODEL_INVOCATION_OUTPUT, 0)), +) + +ROUTING_CLASSIFIER_MODEL_INVOCATION_OUTPUT: StaticSchema = ( + 18, + n0, + _RCMIO, + 4, + (_tI, _rRa, _met), + ((TRACE_ID, 0), (RAW_RESPONSE, 0), (METADATA, 0)), +) + +ROUTING_CLASSIFIER_TRACE: StaticSchema = ( + 19, + n0, + _RCT, + 4, + (_iInv, _ob, _mII, _mIO), + ( + (INVOCATION_INPUT, 0), + (OBSERVATION, 0), + (MODEL_INVOCATION_INPUT, 0), + (ROUTING_CLASSIFIER_MODEL_INVOCATION_OUTPUT, 0), ), - shape_type=ShapeType.LIST, - members={"member": {"target": AGENTIC_RETRIEVE_MEMORY_RETRIEVAL_CONFIG}}, ) -AGENTIC_RETRIEVE_MEMORY_SESSION_BINDING = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgenticRetrieveMemorySessionBinding"), - members={ - "actorId": { - "target": AGENT_CORE_MEMORY_ACTOR_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "sessionId": { - "target": AGENT_CORE_MEMORY_SESSION_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +TRACE: StaticSchema = ( + 19, + n0, + _Tr, + 4, + (_gT, _pPT, _oTr, _pPTo, _rCT, _fT, _cOT), + ( + (GUARDRAIL_TRACE, 0), + (PRE_PROCESSING_TRACE, 0), + (ORCHESTRATION_TRACE, 0), + (POST_PROCESSING_TRACE, 0), + (ROUTING_CLASSIFIER_TRACE, 0), + (FAILURE_TRACE, 0), + (CUSTOM_ORCHESTRATION_TRACE, 0), + ), ) -AGENTIC_RETRIEVE_MEMORY_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgenticRetrieveMemoryConfiguration"), - members={ - "memoryId": { - "target": AGENT_CORE_MEMORY_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "sessionBinding": {"target": AGENTIC_RETRIEVE_MEMORY_SESSION_BINDING}, - "retrievalConfigs": {"target": AGENTIC_RETRIEVE_MEMORY_RETRIEVAL_CONFIG_LIST}, - "persistenceMode": {"target": AGENTIC_RETRIEVE_MEMORY_PERSISTENCE_MODE}, - }, +TRACE_PART: StaticSchema = ( + 18, + n0, + _TPr, + 4, + (_sIe, _tra, _cCa, _eTv, _cN, _aI, _aAI, _aV), + ( + (SESSION_ID, 0), + (TRACE, 0), + (CALLER_CHAIN, 0), + (DATE_TIMESTAMP, {_sF: _dt}), + (NAME, 0), + (AGENT_ID, 0), + (AGENT_ALIAS_ID, 0), + (AGENT_VERSION, 0), + ), ) -CONVERSATION_ROLE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ConversationRole"), - shape_type=ShapeType.ENUM, - members={"USER": {"target": UNIT}, "ASSISTANT": {"target": UNIT}}, -) +AGENT_TRACES: StaticSchema = (16, n0, _ATg, 0, (_me,), ((TRACE_PART, 0),)) -AGENTIC_RETRIEVE_MESSAGE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgenticRetrieveMessage"), - members={ - "content": { - "target": AGENTIC_RETRIEVE_MESSAGE_CONTENT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "role": { - "target": CONVERSATION_ROLE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +DATA_SOURCE_ID: StaticSchema = (3, n0, _DSI, 0) -AGENTIC_RETRIEVE_MESSAGES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgenticRetrieveMessages"), - shape_type=ShapeType.LIST, - members={"member": {"target": AGENTIC_RETRIEVE_MESSAGE}}, -) +DOCUMENT_ID: StaticSchema = (3, n0, _DIo, 0) -AGENTIC_RETRIEVE_METADATA = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgenticRetrieveMetadata"), - shape_type=ShapeType.MAP, - members={"key": {"target": STRING}, "value": {"target": DOCUMENT}}, +KNOWLEDGE_BASE_IDENTIFIER: StaticSchema = (3, n0, _KBIn, 0) + +CHECK_INGESTED_DOCUMENT_ACL_INPUT: StaticSchema = ( + 18, + n0, + _CIDAI, + {_sSI: _cCIDAR, _smithya: None}, + (_kBI, _dSI, _dI, _uC), + ( + (KNOWLEDGE_BASE_IDENTIFIER, 9), + (DATA_SOURCE_ID, 9), + (DOCUMENT_ID, 1), + (USER_CONTEXT, 1), + ), ) -AGENTIC_RETRIEVE_POLICY_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgenticRetrievePolicyConfiguration"), - members={ - "bedrockGuardrailConfiguration": { - "target": AGENTIC_RETRIEVE_BEDROCK_GUARDRAIL_CONFIGURATION - } +CHECK_INGESTED_DOCUMENT_ACL_OUTPUT: StaticSchema = ( + 18, + n0, + _CIDAO, + {_sSI: _cCIDARo, _smithy: None}, + (_hA,), + ((2, 1),), +) + +CHECK_INGESTED_DOCUMENT_ACL: StaticOperationSchema = ( + 23, + n0, + _CIDA, + { + _smithyap: MappingProxyType( + { + "code": 200, + "method": "POST", + "uri": "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/check-ingested-document-acl", + } + ) }, + CHECK_INGESTED_DOCUMENT_ACL_INPUT, + CHECK_INGESTED_DOCUMENT_ACL_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -KNOWLEDGE_BASE_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#KnowledgeBaseId"), - shape_type=ShapeType.STRING, -) +FLOW_EXECUTION_IDENTIFIER: StaticSchema = (3, n0, _FEI, 0) -FILTER_KEY = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#FilterKey"), - shape_type=ShapeType.STRING, -) +FLOW_ALIAS_IDENTIFIER: StaticSchema = (3, n0, _FAI, 0) -FILTER_VALUE = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#FilterValue"), - shape_type=ShapeType.DOCUMENT, -) +FLOW_IDENTIFIER: StaticSchema = (3, n0, _FI, 0) -FILTER_ATTRIBUTE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FilterAttribute"), - members={ - "key": { - "target": FILTER_KEY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "value": { - "target": FILTER_VALUE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +GET_EXECUTION_FLOW_SNAPSHOT_INPUT: StaticSchema = ( + 18, + n0, + _GEFSI, + {_sSI: _cGEFSR, _smithya: None}, + (_fI, _fAI, _eIx), + ((FLOW_IDENTIFIER, 9), (FLOW_ALIAS_IDENTIFIER, 9), (FLOW_EXECUTION_IDENTIFIER, 9)), ) -AGENTIC_RETRIEVE_RESPONSE_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgenticRetrieveResponseEvent"), - members={ - "text": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +KMS_KEY_ARN: StaticSchema = (3, n0, _KKA, 0) -NEXT_TOKEN = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#NextToken"), - shape_type=ShapeType.STRING, -) +FLOW_EXECUTION_ROLE_ARN: StaticSchema = (3, n0, _FERA, 0) -MIME_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#MimeType"), - shape_type=ShapeType.STRING, -) +VERSION: StaticSchema = (3, n0, _Ve, 0) -RETRIEVAL_CONTENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RetrievalContent"), - members={ - "byteContent": {"target": BLOB}, - "text": {"target": STRING}, - "mimeType": { - "target": MIME_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +GET_EXECUTION_FLOW_SNAPSHOT_OUTPUT: StaticSchema = ( + 18, + n0, + _GEFSO, + {_sSI: _cGEFSRo, _smithy: None}, + (_fI, _fAI, _fV, _eRA, _de, _cEKA), + ( + (FLOW_IDENTIFIER, 1), + (FLOW_ALIAS_IDENTIFIER, 1), + (VERSION, 1), + (FLOW_EXECUTION_ROLE_ARN, 1), + (3, 1), + (KMS_KEY_ARN, 0), + ), ) -AGENTIC_RETRIEVE_RESULT_ITEM = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgenticRetrieveResultItem"), - members={ - "content": { - "target": RETRIEVAL_CONTENT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "metadata": {"target": AGENTIC_RETRIEVE_METADATA}, - "sourceRetriever": { - "target": AGENTIC_RETRIEVE_SOURCE_RETRIEVER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, +GET_EXECUTION_FLOW_SNAPSHOT: StaticOperationSchema = ( + 23, + n0, + _GEFS, + { + _smithyap: MappingProxyType( + { + "code": 200, + "method": "GET", + "uri": "/flows/{flowIdentifier}/aliases/{flowAliasIdentifier}/executions/{executionIdentifier}/flowsnapshot", + } + ) }, + GET_EXECUTION_FLOW_SNAPSHOT_INPUT, + GET_EXECUTION_FLOW_SNAPSHOT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AGENTIC_RETRIEVE_RESULTS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgenticRetrieveResults"), - shape_type=ShapeType.LIST, - members={"member": {"target": AGENTIC_RETRIEVE_RESULT_ITEM}}, +GET_FLOW_EXECUTION_INPUT: StaticSchema = ( + 18, + n0, + _GFEI, + {_sSI: _cGFER, _smithya: None}, + (_fI, _fAI, _eIx), + ((FLOW_IDENTIFIER, 9), (FLOW_ALIAS_IDENTIFIER, 9), (FLOW_EXECUTION_IDENTIFIER, 9)), +) + +FLOW_EXECUTION_ERROR_TYPE: StaticSchema = ( + 14, + n0, + _FEET, + 0, + (_TO,), + ((-1, {_sV: _ETO}),), +) + +NODE_NAME: StaticSchema = (3, n0, _NN, 0) + +FLOW_EXECUTION_ERROR: StaticSchema = ( + 18, + n0, + _FEE, + 0, + (_nN, _er, _m), + ((NODE_NAME, 0), (FLOW_EXECUTION_ERROR_TYPE, 0), (3, 0)), +) + +FLOW_EXECUTION_ERRORS: StaticSchema = ( + 16, + n0, + _FEEl, + 0, + (_me,), + ((FLOW_EXECUTION_ERROR, 0),), +) + +FLOW_EXECUTION_STATUS: StaticSchema = ( + 14, + n0, + _FES, + 0, + (_RUNNING, _SUCCEEDED, _FAILED, _TO, _ABORTED), + ( + (-1, {_sV: _Ru}), + (-1, {_sV: _Su}), + (-1, {_sV: _Fa}), + (-1, {_sV: _TOi}), + (-1, {_sV: _A}), + ), ) -AGENTIC_RETRIEVE_RESULT_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgenticRetrieveResultEvent"), - members={ - "results": { - "target": AGENTIC_RETRIEVE_RESULTS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "generatedResponse": {"target": AGENTIC_RETRIEVE_GENERATED_RESPONSE}, - "nextToken": {"target": NEXT_TOKEN}, - }, +GET_FLOW_EXECUTION_OUTPUT: StaticSchema = ( + 18, + n0, + _GFEO, + {_sSI: _cGFERo, _smithy: None}, + (_eA, _sta, _sA, _eAn, _err, _fAI, _fI, _fV), + ( + (FLOW_EXECUTION_IDENTIFIER, 1), + (FLOW_EXECUTION_STATUS, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 0), + (FLOW_EXECUTION_ERRORS, 0), + (FLOW_ALIAS_IDENTIFIER, 1), + (FLOW_IDENTIFIER, 1), + (VERSION, 1), + ), ) -AGENTIC_RETRIEVE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgenticRetrieveType"), - shape_type=ShapeType.ENUM, - members={ - "BEDROCK_KNOWLEDGE_BASE": {"target": UNIT}, - "BEDROCK_AGENT_CORE_MEMORY": {"target": UNIT}, +GET_FLOW_EXECUTION: StaticOperationSchema = ( + 23, + n0, + _GFE, + { + _smithyap: MappingProxyType( + { + "code": 200, + "method": "GET", + "uri": "/flows/{flowIdentifier}/aliases/{flowAliasIdentifier}/executions/{executionIdentifier}", + } + ) }, + GET_FLOW_EXECUTION_INPUT, + GET_FLOW_EXECUTION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AGENTIC_RETRIEVE_SOURCE_METADATA = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgenticRetrieveSourceMetadata"), - members={ - "identifier": {"target": STRING}, - "retrievalType": {"target": AGENTIC_RETRIEVE_TYPE}, - }, +FLOW_EXECUTION_EVENT_TYPE: StaticSchema = ( + 14, + n0, + _FEETl, + 0, + (_NODE, _FLOW), + ((-1, {_sV: _No}), (-1, {_sV: _Fl})), +) + +MAX_RESULTS: StaticSchema = (7, n0, _MR, 0) + +LIST_FLOW_EXECUTION_EVENTS_INPUT: StaticSchema = ( + 18, + n0, + _LFEEI, + {_sSI: _cLFEER, _smithya: None}, + (_fI, _fAI, _eIx, _mRa, _nT, _eTve), + ( + (FLOW_IDENTIFIER, 9), + (FLOW_ALIAS_IDENTIFIER, 9), + (FLOW_EXECUTION_IDENTIFIER, 9), + (MAX_RESULTS, {_sQ: _mRa}), + (NEXT_TOKEN, {_sQ: _nT}), + (FLOW_EXECUTION_EVENT_TYPE, {_sQ: _eTve, _smi: None}), + ), ) -AGENTIC_RETRIEVE_SOURCE_METADATA_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgenticRetrieveSourceMetadataList"), - shape_type=ShapeType.LIST, - members={"member": {"target": AGENTIC_RETRIEVE_SOURCE_METADATA}}, -) +SATISFIED_CONDITION: StaticSchema = (18, n0, _SCa, 4, (_cNon,), ((3, 1),)) -AGENTIC_RETRIEVE_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgenticRetrieveStatus"), - shape_type=ShapeType.ENUM, - members={ - "IN_PROGRESS": {"target": UNIT}, - "SUCCEEDED": {"target": UNIT}, - "FAILED": {"target": UNIT}, - }, +SATISFIED_CONDITIONS: StaticSchema = ( + 16, + n0, + _SCat, + 0, + (_me,), + ((SATISFIED_CONDITION, 0),), ) -AGENTIC_RETRIEVE_STEP = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgenticRetrieveStep"), - shape_type=ShapeType.ENUM, - members={ - "PLANNING": {"target": UNIT}, - "RETRIEVAL": {"target": UNIT}, - "SPECULATIVE_RETRIEVAL": {"target": UNIT}, - "FULL_DOCUMENT_EXPANSION": {"target": UNIT}, - "SESSION_HISTORY_LOAD": {"target": UNIT}, - }, +CONDITION_RESULT_EVENT: StaticSchema = ( + 18, + n0, + _CRE, + 4, + (_nN, _ti, _sC), + ((NODE_NAME, 1), (DATE_TIMESTAMP, 1), (SATISFIED_CONDITIONS, 1)), ) -USER_CONTEXT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#UserContext"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "userId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +FLOW_ERROR_CODE: StaticSchema = ( + 14, + n0, + _FEC, + 0, + (_VALIDATION, _IS, _NEF), + ((-1, {_sV: _VALIDATION}), (-1, {_sV: _IS}), (-1, {_sV: _NEF})), ) -BAD_GATEWAY_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#BadGatewayException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="server"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=502), - ], - members={ - "message": {"target": NON_BLANK_STRING}, - "resourceName": {"target": NON_BLANK_STRING}, - }, +FLOW_FAILURE_EVENT: StaticSchema = ( + 18, + n0, + _FFE, + 4, + (_ti, _eC, _eM), + ((DATE_TIMESTAMP, 1), (FLOW_ERROR_CODE, 1), (3, 1)), ) -CONFLICT_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ConflictException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=409), - ], - members={"message": {"target": NON_BLANK_STRING}}, -) - -DEPENDENCY_FAILED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#DependencyFailedException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=424), - ], - members={ - "message": {"target": NON_BLANK_STRING}, - "resourceName": {"target": NON_BLANK_STRING}, - }, -) +FLOW_EXECUTION_CONTENT: StaticSchema = (19, n0, _FECl, 4, (_do,), ((13, 0),)) -INTERNAL_SERVER_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#InternalServerException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="server"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=500), - ], - members={"message": {"target": NON_BLANK_STRING}, "reason": {"target": STRING}}, -) - -RESOURCE_NOT_FOUND_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ResourceNotFoundException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=404), - ], - members={"message": {"target": NON_BLANK_STRING}}, -) - -SERVICE_QUOTA_EXCEEDED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"message": {"target": NON_BLANK_STRING}}, -) - -THROTTLING_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ThrottlingException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=429), - ], - members={"message": {"target": NON_BLANK_STRING}}, -) - -AGENTIC_RETRIEVE_TRACE_RESULT_ITEM = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgenticRetrieveTraceResultItem"), - members={ - "content": {"target": RETRIEVAL_CONTENT}, - "metadata": {"target": AGENTIC_RETRIEVE_METADATA}, - "sourceRetriever": {"target": AGENTIC_RETRIEVE_SOURCE_RETRIEVER}, - }, -) +NODE_INPUT_NAME: StaticSchema = (3, n0, _NIN, 0) -AGENTIC_RETRIEVE_TRACE_RESULTS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgenticRetrieveTraceResults"), - shape_type=ShapeType.LIST, - members={"member": {"target": AGENTIC_RETRIEVE_TRACE_RESULT_ITEM}}, +FLOW_INPUT_FIELD: StaticSchema = ( + 18, + n0, + _FIF, + 4, + (_n, _co), + ((NODE_INPUT_NAME, 1), (FLOW_EXECUTION_CONTENT, 1)), ) -AGENTIC_RETRIEVE_WARNING_MESSAGE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgenticRetrieveWarningMessage"), - members={ - "message": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +FLOW_INPUT_FIELDS: StaticSchema = (16, n0, _FIFl, 0, (_me,), ((FLOW_INPUT_FIELD, 0),)) -AGENTIC_RETRIEVE_WARNING = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgenticRetrieveWarning"), - shape_type=ShapeType.UNION, - members={ - "message": {"target": AGENTIC_RETRIEVE_WARNING_MESSAGE}, - "guardrail": {"target": AGENTIC_RETRIEVE_GUARDRAIL_WARNING}, - }, +FLOW_EXECUTION_INPUT_EVENT: StaticSchema = ( + 18, + n0, + _FEIE, + 4, + (_nN, _ti, _fie), + ((NODE_NAME, 1), (DATE_TIMESTAMP, 1), (FLOW_INPUT_FIELDS, 1)), ) -AGENTIC_RETRIEVE_WARNINGS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgenticRetrieveWarnings"), - shape_type=ShapeType.LIST, - members={"member": {"target": AGENTIC_RETRIEVE_WARNING}}, -) - -AGENTIC_RETRIEVE_TRACE_EVENT_ATTRIBUTES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgenticRetrieveTraceEventAttributes"), - members={ - "step": { - "target": AGENTIC_RETRIEVE_STEP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": AGENTIC_RETRIEVE_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "message": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "actions": {"target": AGENTIC_RETRIEVE_ACTIONS}, - "warnings": {"target": AGENTIC_RETRIEVE_WARNINGS}, - "failures": {"target": AGENTIC_RETRIEVE_FAILURES}, - "retrievalMetadata": {"target": AGENTIC_RETRIEVE_SOURCE_METADATA_LIST}, - "retrievalResponse": {"target": AGENTIC_RETRIEVE_TRACE_RESULTS}, - }, -) +NODE_OUTPUT_NAME: StaticSchema = (3, n0, _NON, 0) -AGENTIC_RETRIEVE_TRACE_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgenticRetrieveTraceEvent"), - members={ - "id": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "timestamp": { - "target": LONG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "attributes": { - "target": AGENTIC_RETRIEVE_TRACE_EVENT_ATTRIBUTES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +FLOW_OUTPUT_FIELD: StaticSchema = ( + 18, + n0, + _FOF, + 4, + (_n, _co), + ((NODE_OUTPUT_NAME, 1), (FLOW_EXECUTION_CONTENT, 1)), ) -VALIDATION_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ValidationException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"message": {"target": NON_BLANK_STRING}}, -) - -AGENTIC_RETRIEVE_STREAM_RESPONSE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgenticRetrieveStreamResponseOutput"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#streaming"))], - members={ - "result": {"target": AGENTIC_RETRIEVE_RESULT_EVENT}, - "traceEvent": {"target": AGENTIC_RETRIEVE_TRACE_EVENT}, - "responseEvent": {"target": AGENTIC_RETRIEVE_RESPONSE_EVENT}, - "internalServerException": {"target": INTERNAL_SERVER_EXCEPTION}, - "validationException": {"target": VALIDATION_EXCEPTION}, - "resourceNotFoundException": {"target": RESOURCE_NOT_FOUND_EXCEPTION}, - "serviceQuotaExceededException": {"target": SERVICE_QUOTA_EXCEEDED_EXCEPTION}, - "throttlingException": {"target": THROTTLING_EXCEPTION}, - "accessDeniedException": {"target": ACCESS_DENIED_EXCEPTION}, - "conflictException": {"target": CONFLICT_EXCEPTION}, - "dependencyFailedException": {"target": DEPENDENCY_FAILED_EXCEPTION}, - "badGatewayException": {"target": BAD_GATEWAY_EXCEPTION}, - }, -) +FLOW_OUTPUT_FIELDS: StaticSchema = (16, n0, _FOFl, 0, (_me,), ((FLOW_OUTPUT_FIELD, 0),)) -AGENTIC_RETRIEVE_STREAM_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgenticRetrieveStreamOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#AgenticRetrieveStreamResponse", - ) - ], - members={ - "stream": { - "target": AGENTIC_RETRIEVE_STREAM_RESPONSE_OUTPUT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpPayload")), - ], - } - }, +FLOW_EXECUTION_OUTPUT_EVENT: StaticSchema = ( + 18, + n0, + _FEOE, + 4, + (_nN, _ti, _fie), + ((NODE_NAME, 1), (DATE_TIMESTAMP, 1), (FLOW_OUTPUT_FIELDS, 1)), ) -AGENT_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgentId"), shape_type=ShapeType.STRING +NODE_ACTION_EVENT: StaticSchema = ( + 18, + n0, + _NAE, + 4, + (_nN, _ti, _rIe, _sN, _oN, _oR, _oRp), + ((NODE_NAME, 1), (DATE_TIMESTAMP, 1), (3, 1), (3, 1), (3, 1), (13, 0), (13, 0)), ) -AGENT_VERSION = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgentVersion"), - shape_type=ShapeType.STRING, -) +NODE_TRACE_ELEMENTS: StaticSchema = (19, n0, _NTE, 4, (_aT,), ((AGENT_TRACES, 0),)) -CALLER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#Caller"), - shape_type=ShapeType.UNION, - members={"agentAliasArn": {"target": AGENT_ALIAS_ARN}}, +NODE_DEPENDENCY_EVENT: StaticSchema = ( + 18, + n0, + _NDE, + 4, + (_nN, _ti, _tEr), + ((NODE_NAME, 1), (DATE_TIMESTAMP, 1), (NODE_TRACE_ELEMENTS, 1)), +) + +NODE_ERROR_CODE: StaticSchema = ( + 14, + n0, + _NEC, + 0, + (_VALIDATION, _DF, _BG, _IS), + ((-1, {_sV: _VALIDATION}), (-1, {_sV: _DF}), (-1, {_sV: _BG}), (-1, {_sV: _IS})), +) + +NODE_FAILURE_EVENT: StaticSchema = ( + 18, + n0, + _NFE, + 4, + (_nN, _ti, _eC, _eM), + ((NODE_NAME, 1), (DATE_TIMESTAMP, 1), (NODE_ERROR_CODE, 1), (3, 1)), +) + +FLOW_NODE_INPUT_CATEGORY: StaticSchema = ( + 14, + n0, + _FNIC, + 0, + (_LC, _RVTLS, _EL), + ((-1, {_sV: _LCo}), (-1, {_sV: _RVTLSe}), (-1, {_sV: _ELx})), +) + +NODE_EXECUTION_CONTENT: StaticSchema = (19, n0, _NECo, 4, (_do,), ((13, 0),)) + +FLOW_CONTROL_NODE_TYPE: StaticSchema = ( + 14, + n0, + _FCNT, + 0, + (_ITERATOR, _LOOP), + ((-1, {_sV: _I}), (-1, {_sV: _L})), +) + +NODE_INPUT_EXECUTION_CHAIN_ITEM: StaticSchema = ( + 18, + n0, + _NIECI, + 0, + (_nN, _ind, _t), + ((NODE_NAME, 1), (7, 0), (FLOW_CONTROL_NODE_TYPE, 1)), +) + +NODE_INPUT_EXECUTION_CHAIN: StaticSchema = ( + 16, + n0, + _NIEC, + 0, + (_me,), + ((NODE_INPUT_EXECUTION_CHAIN_ITEM, 0),), +) + +FLOW_NODE_INPUT_EXPRESSION: StaticSchema = (3, n0, _FNIE, 4) + +FLOW_NODE_OUTPUT_NAME: StaticSchema = (3, n0, _FNON, 0) + +NODE_INPUT_SOURCE: StaticSchema = ( + 18, + n0, + _NIS, + 0, + (_nN, _oFN, _ex), + ((NODE_NAME, 1), (FLOW_NODE_OUTPUT_NAME, 1), (FLOW_NODE_INPUT_EXPRESSION, 1)), +) + +FLOW_NODE_IO_DATA_TYPE: StaticSchema = ( + 14, + n0, + _FNIODT, + 0, + (_STRING, _NUMBER, _BOOLEAN, _OBJECT, _ARRAY), + ( + (-1, {_sV: _St}), + (-1, {_sV: _Nu}), + (-1, {_sV: _B}), + (-1, {_sV: _Ob}), + (-1, {_sV: _Ar}), + ), ) -CALLER_CHAIN = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#CallerChain"), - shape_type=ShapeType.LIST, - members={"member": {"target": CALLER}}, +NODE_INPUT_FIELD: StaticSchema = ( + 18, + n0, + _NIF, + 4, + (_n, _co, _so, _t, _ca, _eCx), + ( + (NODE_INPUT_NAME, 1), + (NODE_EXECUTION_CONTENT, 1), + (NODE_INPUT_SOURCE, 0), + (FLOW_NODE_IO_DATA_TYPE, 0), + (FLOW_NODE_INPUT_CATEGORY, 0), + (NODE_INPUT_EXECUTION_CHAIN, 0), + ), ) -SESSION_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#SessionId"), - shape_type=ShapeType.STRING, +NODE_INPUT_FIELDS: StaticSchema = (16, n0, _NIFo, 0, (_me,), ((NODE_INPUT_FIELD, 0),)) + +NODE_INPUT_EVENT: StaticSchema = ( + 18, + n0, + _NIE, + 4, + (_nN, _ti, _fie), + ((NODE_NAME, 1), (DATE_TIMESTAMP, 1), (NODE_INPUT_FIELDS, 1)), +) + +FLOW_NODE_INPUT_NAME: StaticSchema = (3, n0, _FNIN, 0) + +NODE_OUTPUT_NEXT: StaticSchema = ( + 18, + n0, + _NONo, + 4, + (_nN, _iFN), + ((NODE_NAME, 1), (FLOW_NODE_INPUT_NAME, 1)), +) + +NODE_OUTPUT_NEXT_LIST: StaticSchema = ( + 16, + n0, + _NONL, + 0, + (_me,), + ((NODE_OUTPUT_NEXT, 0),), +) + +NODE_OUTPUT_FIELD: StaticSchema = ( + 18, + n0, + _NOF, + 4, + (_n, _co, _ne, _t), + ( + (NODE_OUTPUT_NAME, 1), + (NODE_EXECUTION_CONTENT, 1), + (NODE_OUTPUT_NEXT_LIST, 0), + (FLOW_NODE_IO_DATA_TYPE, 0), + ), ) -CUSTOM_ORCHESTRATION_TRACE_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#CustomOrchestrationTraceEvent"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"text": {"target": STRING}}, +NODE_OUTPUT_FIELDS: StaticSchema = (16, n0, _NOFo, 0, (_me,), ((NODE_OUTPUT_FIELD, 0),)) + +NODE_OUTPUT_EVENT: StaticSchema = ( + 18, + n0, + _NOE, + 4, + (_nN, _ti, _fie), + ((NODE_NAME, 1), (DATE_TIMESTAMP, 1), (NODE_OUTPUT_FIELDS, 1)), +) + +FLOW_EXECUTION_EVENT: StaticSchema = ( + 19, + n0, + _FEElo, + 0, + (_fIE, _fOE, _nIE, _nOE, _cRE, _nFE, _fFE, _nAE, _nDE), + ( + (FLOW_EXECUTION_INPUT_EVENT, 0), + (FLOW_EXECUTION_OUTPUT_EVENT, 0), + (NODE_INPUT_EVENT, 0), + (NODE_OUTPUT_EVENT, 0), + (CONDITION_RESULT_EVENT, 0), + (NODE_FAILURE_EVENT, 0), + (FLOW_FAILURE_EVENT, 0), + (NODE_ACTION_EVENT, 0), + (NODE_DEPENDENCY_EVENT, 0), + ), ) -TRACE_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#TraceId"), shape_type=ShapeType.STRING +FLOW_EXECUTION_EVENTS: StaticSchema = ( + 16, + n0, + _FEElow, + 0, + (_me,), + ((FLOW_EXECUTION_EVENT, 0),), +) + +LIST_FLOW_EXECUTION_EVENTS_OUTPUT: StaticSchema = ( + 18, + n0, + _LFEEO, + {_sSI: _cLFEERo, _smithy: None}, + (_fEE, _nT), + ((FLOW_EXECUTION_EVENTS, 1), (NEXT_TOKEN, 0)), +) + +LIST_FLOW_EXECUTION_EVENTS: StaticOperationSchema = ( + 23, + n0, + _LFEE, + { + _smithyap: MappingProxyType( + { + "code": 200, + "method": "GET", + "uri": "/flows/{flowIdentifier}/aliases/{flowAliasIdentifier}/executions/{executionIdentifier}/events", + } + ) + }, + LIST_FLOW_EXECUTION_EVENTS_INPUT, + LIST_FLOW_EXECUTION_EVENTS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CUSTOM_ORCHESTRATION_TRACE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#CustomOrchestrationTrace"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "traceId": {"target": TRACE_ID}, - "event": {"target": CUSTOM_ORCHESTRATION_TRACE_EVENT}, - }, +LIST_FLOW_EXECUTIONS_INPUT: StaticSchema = ( + 18, + n0, + _LFEI, + {_sSI: _cLFER, _smithya: None}, + (_fI, _fAI, _mRa, _nT), + ( + (FLOW_IDENTIFIER, 9), + (FLOW_ALIAS_IDENTIFIER, {_sQ: _fAI}), + (MAX_RESULTS, {_sQ: _mRa}), + (NEXT_TOKEN, {_sQ: _nT}), + ), ) -FAILURE_REASON_STRING = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#FailureReasonString"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +FLOW_EXECUTION_SUMMARY: StaticSchema = ( + 18, + n0, + _FESl, + 0, + (_eA, _fAI, _fI, _fV, _sta, _cA, _eAn), + ( + (FLOW_EXECUTION_IDENTIFIER, 1), + (FLOW_ALIAS_IDENTIFIER, 1), + (FLOW_IDENTIFIER, 1), + (VERSION, 1), + (FLOW_EXECUTION_STATUS, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 0), + ), ) -FAILURE_TRACE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FailureTrace"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "traceId": {"target": TRACE_ID}, - "failureReason": {"target": FAILURE_REASON_STRING}, - "failureCode": {"target": INTEGER}, - "metadata": {"target": METADATA}, - }, +FLOW_EXECUTION_SUMMARIES: StaticSchema = ( + 16, + n0, + _FESlo, + 0, + (_me,), + ((FLOW_EXECUTION_SUMMARY, 0),), ) -GUARDRAIL_CONTENT_POLICY_ACTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GuardrailContentPolicyAction"), - shape_type=ShapeType.ENUM, - members={"BLOCKED": {"target": UNIT}}, +LIST_FLOW_EXECUTIONS_OUTPUT: StaticSchema = ( + 18, + n0, + _LFEO, + {_sSI: _cLFERo, _smithy: None}, + (_fES, _nT), + ((FLOW_EXECUTION_SUMMARIES, 1), (NEXT_TOKEN, 0)), ) -GUARDRAIL_CONTENT_FILTER_CONFIDENCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GuardrailContentFilterConfidence"), - shape_type=ShapeType.ENUM, - members={ - "NONE": {"target": UNIT}, - "LOW": {"target": UNIT}, - "MEDIUM": {"target": UNIT}, - "HIGH": {"target": UNIT}, +LIST_FLOW_EXECUTIONS: StaticOperationSchema = ( + 23, + n0, + _LFE, + { + _smithyap: MappingProxyType( + {"code": 200, "method": "GET", "uri": "/flows/{flowIdentifier}/executions"} + ) }, + LIST_FLOW_EXECUTIONS_INPUT, + LIST_FLOW_EXECUTIONS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -GUARDRAIL_CONTENT_FILTER_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GuardrailContentFilterType"), - shape_type=ShapeType.ENUM, - members={ - "INSULTS": {"target": UNIT}, - "HATE": {"target": UNIT}, - "SEXUAL": {"target": UNIT}, - "VIOLENCE": {"target": UNIT}, - "MISCONDUCT": {"target": UNIT}, - "PROMPT_ATTACK": {"target": UNIT}, - }, +FLOW_EXECUTION_NAME: StaticSchema = (3, n0, _FEN, 0) + +FLOW_INPUT_CONTENT: StaticSchema = (19, n0, _FIC, 4, (_do,), ((13, 0),)) + +FLOW_INPUT: StaticSchema = ( + 18, + n0, + _FIl, + 0, + (_nN, _nON, _co, _nIN), + ( + (NODE_NAME, 1), + (NODE_OUTPUT_NAME, 0), + (FLOW_INPUT_CONTENT, 1), + (NODE_INPUT_NAME, 0), + ), ) -GUARDRAIL_CONTENT_FILTER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GuardrailContentFilter"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "type": {"target": GUARDRAIL_CONTENT_FILTER_TYPE}, - "confidence": {"target": GUARDRAIL_CONTENT_FILTER_CONFIDENCE}, - "action": {"target": GUARDRAIL_CONTENT_POLICY_ACTION}, - }, +FLOW_INPUTS: StaticSchema = (16, n0, _FIlo, 0, (_me,), ((FLOW_INPUT, 0),)) + +PERFORMANCE_CONFIG_LATENCY: StaticSchema = ( + 14, + n0, + _PCL, + 0, + (_STANDARD, _OPTIMIZED), + ((-1, {_sV: _stan}), (-1, {_sV: _opt})), +) + +PERFORMANCE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _PC, + 0, + (_la,), + ((PERFORMANCE_CONFIG_LATENCY, {_smit: _stan}),), +) + +MODEL_PERFORMANCE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _MPC, + 0, + (_pC,), + ((PERFORMANCE_CONFIGURATION, 0),), +) + +START_FLOW_EXECUTION_INPUT: StaticSchema = ( + 18, + n0, + _SFEI, + {_sSI: _cSFER, _smithya: None}, + (_fI, _fAI, _fEN, _inp, _mPC), + ( + (FLOW_IDENTIFIER, 9), + (FLOW_ALIAS_IDENTIFIER, 9), + (FLOW_EXECUTION_NAME, 0), + (FLOW_INPUTS, 1), + (MODEL_PERFORMANCE_CONFIGURATION, 0), + ), ) -GUARDRAIL_CONTENT_FILTER_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GuardrailContentFilterList"), - shape_type=ShapeType.LIST, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"member": {"target": GUARDRAIL_CONTENT_FILTER}}, -) - -GUARDRAIL_CONTENT_POLICY_ASSESSMENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GuardrailContentPolicyAssessment"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"filters": {"target": GUARDRAIL_CONTENT_FILTER_LIST}}, -) - -GUARDRAIL_SENSITIVE_INFORMATION_POLICY_ACTION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentruntime#GuardrailSensitiveInformationPolicyAction" - ), - shape_type=ShapeType.ENUM, - members={"BLOCKED": {"target": UNIT}, "ANONYMIZED": {"target": UNIT}}, -) - -GUARDRAIL_PII_ENTITY_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GuardrailPiiEntityType"), - shape_type=ShapeType.ENUM, - members={ - "ADDRESS": {"target": UNIT}, - "AGE": {"target": UNIT}, - "AWS_ACCESS_KEY": {"target": UNIT}, - "AWS_SECRET_KEY": {"target": UNIT}, - "CA_HEALTH_NUMBER": {"target": UNIT}, - "CA_SOCIAL_INSURANCE_NUMBER": {"target": UNIT}, - "CREDIT_DEBIT_CARD_CVV": {"target": UNIT}, - "CREDIT_DEBIT_CARD_EXPIRY": {"target": UNIT}, - "CREDIT_DEBIT_CARD_NUMBER": {"target": UNIT}, - "DRIVER_ID": {"target": UNIT}, - "EMAIL": {"target": UNIT}, - "INTERNATIONAL_BANK_ACCOUNT_NUMBER": {"target": UNIT}, - "IP_ADDRESS": {"target": UNIT}, - "LICENSE_PLATE": {"target": UNIT}, - "MAC_ADDRESS": {"target": UNIT}, - "NAME": {"target": UNIT}, - "PASSWORD": {"target": UNIT}, - "PHONE": {"target": UNIT}, - "PIN": {"target": UNIT}, - "SWIFT_CODE": {"target": UNIT}, - "UK_NATIONAL_HEALTH_SERVICE_NUMBER": {"target": UNIT}, - "UK_NATIONAL_INSURANCE_NUMBER": {"target": UNIT}, - "UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER": {"target": UNIT}, - "URL": {"target": UNIT}, - "USERNAME": {"target": UNIT}, - "US_BANK_ACCOUNT_NUMBER": {"target": UNIT}, - "US_BANK_ROUTING_NUMBER": {"target": UNIT}, - "US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER": {"target": UNIT}, - "US_PASSPORT_NUMBER": {"target": UNIT}, - "US_SOCIAL_SECURITY_NUMBER": {"target": UNIT}, - "VEHICLE_IDENTIFICATION_NUMBER": {"target": UNIT}, +START_FLOW_EXECUTION_OUTPUT: StaticSchema = ( + 18, + n0, + _SFEO, + {_sSI: _cSFERo, _smithy: None}, + (_eA,), + ((FLOW_EXECUTION_IDENTIFIER, 0),), +) + +START_FLOW_EXECUTION: StaticOperationSchema = ( + 23, + n0, + _SFE, + { + _smithyap: MappingProxyType( + { + "code": 200, + "method": "POST", + "uri": "/flows/{flowIdentifier}/aliases/{flowAliasIdentifier}/executions", + } + ) }, + START_FLOW_EXECUTION_INPUT, + START_FLOW_EXECUTION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + BAD_GATEWAY_EXCEPTION, + CONFLICT_EXCEPTION, + DEPENDENCY_FAILED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -GUARDRAIL_PII_ENTITY_FILTER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GuardrailPiiEntityFilter"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "type": {"target": GUARDRAIL_PII_ENTITY_TYPE}, - "match": {"target": STRING}, - "action": {"target": GUARDRAIL_SENSITIVE_INFORMATION_POLICY_ACTION}, +STOP_FLOW_EXECUTION_INPUT: StaticSchema = ( + 18, + n0, + _SFEIt, + {_sSI: _cSFERom, _smithya: None}, + (_fI, _fAI, _eIx), + ((FLOW_IDENTIFIER, 9), (FLOW_ALIAS_IDENTIFIER, 9), (FLOW_EXECUTION_IDENTIFIER, 9)), +) + +STOP_FLOW_EXECUTION_OUTPUT: StaticSchema = ( + 18, + n0, + _SFEOt, + {_sSI: _cSFERoma, _smithy: None}, + (_eA, _sta), + ((FLOW_EXECUTION_IDENTIFIER, 0), (FLOW_EXECUTION_STATUS, 1)), +) + +STOP_FLOW_EXECUTION: StaticOperationSchema = ( + 23, + n0, + _SFEt, + { + _smithyap: MappingProxyType( + { + "code": 200, + "method": "POST", + "uri": "/flows/{flowIdentifier}/aliases/{flowAliasIdentifier}/executions/{executionIdentifier}/stop", + } + ) }, + STOP_FLOW_EXECUTION_INPUT, + STOP_FLOW_EXECUTION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + BAD_GATEWAY_EXCEPTION, + CONFLICT_EXCEPTION, + DEPENDENCY_FAILED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -GUARDRAIL_PII_ENTITY_FILTER_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GuardrailPiiEntityFilterList"), - shape_type=ShapeType.LIST, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"member": {"target": GUARDRAIL_PII_ENTITY_FILTER}}, +FLOW_EXECUTION_ID: StaticSchema = (3, n0, _FEIl, 0) + +INVOKE_FLOW_INPUT: StaticSchema = ( + 18, + n0, + _IFI, + {_sSI: _cIFR, _smithya: None}, + (_fI, _fAI, _inp, _eTna, _mPC, _eIxe), + ( + (FLOW_IDENTIFIER, 9), + (FLOW_ALIAS_IDENTIFIER, 9), + (FLOW_INPUTS, 1), + (2, 0), + (MODEL_PERFORMANCE_CONFIGURATION, 0), + (FLOW_EXECUTION_ID, 0), + ), ) -GUARDRAIL_REGEX_FILTER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GuardrailRegexFilter"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "name": {"target": STRING}, - "regex": {"target": STRING}, - "match": {"target": STRING}, - "action": {"target": GUARDRAIL_SENSITIVE_INFORMATION_POLICY_ACTION}, - }, +FLOW_COMPLETION_REASON: StaticSchema = ( + 14, + n0, + _FCR, + 0, + (_SUCCESS, _IR), + ((-1, {_sV: _SUCCESS}), (-1, {_sV: _IR})), +) + +FLOW_COMPLETION_EVENT: StaticSchema = ( + 18, + n0, + _FCE, + 4, + (_cR,), + ((FLOW_COMPLETION_REASON, 1),), +) + +FLOW_MULTI_TURN_INPUT_CONTENT: StaticSchema = (19, n0, _FMTIC, 0, (_do,), ((13, 0),)) + +NODE_TYPE: StaticSchema = ( + 14, + n0, + _NTo, + 0, + (_FIN, _FON, _LFN, _KBN, _PN_, _CN, _LN), + ( + (-1, {_sV: _FINl}), + (-1, {_sV: _FONl}), + (-1, {_sV: _LFNa}), + (-1, {_sV: _KBNn}), + (-1, {_sV: _PNr}), + (-1, {_sV: _CNo}), + (-1, {_sV: _LNe}), + ), ) -GUARDRAIL_REGEX_FILTER_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GuardrailRegexFilterList"), - shape_type=ShapeType.LIST, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"member": {"target": GUARDRAIL_REGEX_FILTER}}, +FLOW_MULTI_TURN_INPUT_REQUEST_EVENT: StaticSchema = ( + 18, + n0, + _FMTIRE, + 4, + (_nN, _nTo, _co), + ((NODE_NAME, 1), (NODE_TYPE, 1), (FLOW_MULTI_TURN_INPUT_CONTENT, 1)), +) + +FLOW_OUTPUT_CONTENT: StaticSchema = (19, n0, _FOC, 0, (_do,), ((13, 0),)) + +FLOW_OUTPUT_EVENT: StaticSchema = ( + 18, + n0, + _FOE, + 4, + (_nN, _nTo, _co), + ((NODE_NAME, 1), (NODE_TYPE, 1), (FLOW_OUTPUT_CONTENT, 1)), +) + +FLOW_TRACE_CONDITION: StaticSchema = (18, n0, _FTC, 4, (_cNon,), ((3, 1),)) + +FLOW_TRACE_CONDITIONS: StaticSchema = ( + 16, + n0, + _FTCl, + 0, + (_me,), + ((FLOW_TRACE_CONDITION, 0),), +) + +FLOW_TRACE_CONDITION_NODE_RESULT_EVENT: StaticSchema = ( + 18, + n0, + _FTCNRE, + 4, + (_nN, _ti, _sC), + ((NODE_NAME, 1), (DATE_TIMESTAMP, 1), (FLOW_TRACE_CONDITIONS, 1)), +) + +FLOW_TRACE_NODE_ACTION_EVENT: StaticSchema = ( + 18, + n0, + _FTNAE, + 4, + (_nN, _ti, _rIe, _sN, _oN, _oR, _oRp), + ((NODE_NAME, 1), (DATE_TIMESTAMP, 1), (3, 1), (3, 1), (3, 1), (13, 0), (13, 0)), +) + +TRACE_ELEMENTS: StaticSchema = (19, n0, _TEr, 4, (_aT,), ((AGENT_TRACES, 0),)) + +FLOW_TRACE_DEPENDENCY_EVENT: StaticSchema = ( + 18, + n0, + _FTDE, + 4, + (_nN, _ti, _tEr), + ((NODE_NAME, 1), (DATE_TIMESTAMP, 1), (TRACE_ELEMENTS, 1)), +) + +FLOW_TRACE_NODE_INPUT_CONTENT: StaticSchema = (19, n0, _FTNIC, 4, (_do,), ((13, 0),)) + +FLOW_TRACE_NODE_INPUT_EXECUTION_CHAIN_ITEM: StaticSchema = ( + 18, + n0, + _FTNIECI, + 4, + (_nN, _ind, _t), + ((NODE_NAME, 1), (7, 0), (FLOW_CONTROL_NODE_TYPE, 1)), +) + +FLOW_TRACE_NODE_INPUT_EXECUTION_CHAIN: StaticSchema = ( + 16, + n0, + _FTNIEC, + 4, + (_me,), + ((FLOW_TRACE_NODE_INPUT_EXECUTION_CHAIN_ITEM, 0),), +) + +FLOW_TRACE_NODE_INPUT_SOURCE: StaticSchema = ( + 18, + n0, + _FTNIS, + 4, + (_nN, _oFN, _ex), + ((NODE_NAME, 1), (FLOW_NODE_OUTPUT_NAME, 1), (FLOW_NODE_INPUT_EXPRESSION, 1)), +) + +FLOW_TRACE_NODE_INPUT_FIELD: StaticSchema = ( + 18, + n0, + _FTNIF, + 4, + (_nIN, _co, _so, _t, _ca, _eCx), + ( + (NODE_INPUT_NAME, 1), + (FLOW_TRACE_NODE_INPUT_CONTENT, 1), + (FLOW_TRACE_NODE_INPUT_SOURCE, 0), + (FLOW_NODE_IO_DATA_TYPE, 0), + (FLOW_NODE_INPUT_CATEGORY, 0), + (FLOW_TRACE_NODE_INPUT_EXECUTION_CHAIN, 0), + ), ) -GUARDRAIL_SENSITIVE_INFORMATION_POLICY_ASSESSMENT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentruntime#GuardrailSensitiveInformationPolicyAssessment" +FLOW_TRACE_NODE_INPUT_FIELDS: StaticSchema = ( + 16, + n0, + _FTNIFl, + 0, + (_me,), + ((FLOW_TRACE_NODE_INPUT_FIELD, 0),), +) + +FLOW_TRACE_NODE_INPUT_EVENT: StaticSchema = ( + 18, + n0, + _FTNIE, + 4, + (_nN, _ti, _fie), + ((NODE_NAME, 1), (DATE_TIMESTAMP, 1), (FLOW_TRACE_NODE_INPUT_FIELDS, 1)), +) + +FLOW_TRACE_NODE_OUTPUT_CONTENT: StaticSchema = (19, n0, _FTNOC, 0, (_do,), ((13, 0),)) + +FLOW_TRACE_NODE_OUTPUT_NEXT: StaticSchema = ( + 18, + n0, + _FTNON, + 4, + (_nN, _iFN), + ((NODE_NAME, 1), (FLOW_NODE_INPUT_NAME, 1)), +) + +FLOW_TRACE_NODE_OUTPUT_NEXT_LIST: StaticSchema = ( + 16, + n0, + _FTNONL, + 0, + (_me,), + ((FLOW_TRACE_NODE_OUTPUT_NEXT, 0),), +) + +FLOW_TRACE_NODE_OUTPUT_FIELD: StaticSchema = ( + 18, + n0, + _FTNOF, + 4, + (_nON, _co, _ne, _t), + ( + (NODE_OUTPUT_NAME, 1), + (FLOW_TRACE_NODE_OUTPUT_CONTENT, 1), + (FLOW_TRACE_NODE_OUTPUT_NEXT_LIST, 0), + (FLOW_NODE_IO_DATA_TYPE, 0), ), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "piiEntities": {"target": GUARDRAIL_PII_ENTITY_FILTER_LIST}, - "regexes": {"target": GUARDRAIL_REGEX_FILTER_LIST}, - }, ) -GUARDRAIL_TOPIC_POLICY_ACTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GuardrailTopicPolicyAction"), - shape_type=ShapeType.ENUM, - members={"BLOCKED": {"target": UNIT}}, +FLOW_TRACE_NODE_OUTPUT_FIELDS: StaticSchema = ( + 16, + n0, + _FTNOFl, + 0, + (_me,), + ((FLOW_TRACE_NODE_OUTPUT_FIELD, 0),), +) + +FLOW_TRACE_NODE_OUTPUT_EVENT: StaticSchema = ( + 18, + n0, + _FTNOE, + 4, + (_nN, _ti, _fie), + ((NODE_NAME, 1), (DATE_TIMESTAMP, 1), (FLOW_TRACE_NODE_OUTPUT_FIELDS, 1)), +) + +FLOW_TRACE: StaticSchema = ( + 19, + n0, + _FTl, + 4, + (_nIT, _nOT, _cNRT, _nAT, _nDT), + ( + (FLOW_TRACE_NODE_INPUT_EVENT, 0), + (FLOW_TRACE_NODE_OUTPUT_EVENT, 0), + (FLOW_TRACE_CONDITION_NODE_RESULT_EVENT, 0), + (FLOW_TRACE_NODE_ACTION_EVENT, 0), + (FLOW_TRACE_DEPENDENCY_EVENT, 0), + ), ) -GUARDRAIL_TOPIC_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GuardrailTopicType"), - shape_type=ShapeType.ENUM, - members={"DENY": {"target": UNIT}}, +FLOW_TRACE_EVENT: StaticSchema = (18, n0, _FTE, 0, (_tra,), ((FLOW_TRACE, 1),)) + +FLOW_RESPONSE_STREAM: StaticSchema = ( + 19, + n0, + _FRSl, + {_smith: None}, + (_fOE, _fCE, _fTE, _iSE, _vE, _rNFE, _sQEE, _tEh, _aDE, _cE, _dFE, _bGE, _fMTIRE), + ( + (FLOW_OUTPUT_EVENT, 0), + (FLOW_COMPLETION_EVENT, 0), + (FLOW_TRACE_EVENT, 0), + (INTERNAL_SERVER_EXCEPTION, 0), + (VALIDATION_EXCEPTION, 0), + (RESOURCE_NOT_FOUND_EXCEPTION, 0), + (SERVICE_QUOTA_EXCEEDED_EXCEPTION, 0), + (THROTTLING_EXCEPTION, 0), + (ACCESS_DENIED_EXCEPTION, 0), + (CONFLICT_EXCEPTION, 0), + (DEPENDENCY_FAILED_EXCEPTION, 0), + (BAD_GATEWAY_EXCEPTION, 0), + (FLOW_MULTI_TURN_INPUT_REQUEST_EVENT, 0), + ), ) -GUARDRAIL_TOPIC = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GuardrailTopic"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "name": {"target": STRING}, - "type": {"target": GUARDRAIL_TOPIC_TYPE}, - "action": {"target": GUARDRAIL_TOPIC_POLICY_ACTION}, +INVOKE_FLOW_OUTPUT: StaticSchema = ( + 18, + n0, + _IFO, + {_sSI: _cIFRo, _smithy: None}, + (_rSe, _eIxe), + ((FLOW_RESPONSE_STREAM, 17), (FLOW_EXECUTION_ID, {_sH: _xabfei})), +) + +INVOKE_FLOW: StaticOperationSchema = ( + 23, + n0, + _IF, + { + _smithyap: MappingProxyType( + { + "code": 200, + "method": "POST", + "uri": "/flows/{flowIdentifier}/aliases/{flowAliasIdentifier}", + } + ) }, + INVOKE_FLOW_INPUT, + INVOKE_FLOW_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + BAD_GATEWAY_EXCEPTION, + CONFLICT_EXCEPTION, + DEPENDENCY_FAILED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -GUARDRAIL_TOPIC_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GuardrailTopicList"), - shape_type=ShapeType.LIST, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"member": {"target": GUARDRAIL_TOPIC}}, +INPUT_QUERY_TYPE: StaticSchema = (14, n0, _IQT, 0, (_TEXT,), ((-1, {_sV: _TEXT}),)) + +QUERY_GENERATION_INPUT: StaticSchema = ( + 18, + n0, + _QGI, + 4, + (_t, _te), + ((INPUT_QUERY_TYPE, 1), (3, 1)), ) -GUARDRAIL_TOPIC_POLICY_ASSESSMENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GuardrailTopicPolicyAssessment"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"topics": {"target": GUARDRAIL_TOPIC_LIST}}, +QUERY_TRANSFORMATION_MODE: StaticSchema = ( + 14, + n0, + _QTM, + 0, + (_TTS,), + ((-1, {_sV: _TTS}),), ) -GUARDRAIL_WORD_POLICY_ACTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GuardrailWordPolicyAction"), - shape_type=ShapeType.ENUM, - members={"BLOCKED": {"target": UNIT}}, +KNOWLEDGE_BASE_ARN: StaticSchema = (3, n0, _KBA, 0) + +TEXT_TO_SQL_KNOWLEDGE_BASE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _TTSKBC, + 0, + (_kBA,), + ((KNOWLEDGE_BASE_ARN, 1),), ) -GUARDRAIL_CUSTOM_WORD = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GuardrailCustomWord"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "match": {"target": STRING}, - "action": {"target": GUARDRAIL_WORD_POLICY_ACTION}, - }, +TEXT_TO_SQL_CONFIGURATION_TYPE: StaticSchema = ( + 14, + n0, + _TTSCT, + 0, + (_KB,), + ((-1, {_sV: _KB}),), ) -GUARDRAIL_CUSTOM_WORD_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GuardrailCustomWordList"), - shape_type=ShapeType.LIST, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"member": {"target": GUARDRAIL_CUSTOM_WORD}}, +TEXT_TO_SQL_CONFIGURATION: StaticSchema = ( + 18, + n0, + _TTSC, + 0, + (_t, _kBC), + ( + (TEXT_TO_SQL_CONFIGURATION_TYPE, 1), + (TEXT_TO_SQL_KNOWLEDGE_BASE_CONFIGURATION, 0), + ), ) -GUARDRAIL_MANAGED_WORD_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GuardrailManagedWordType"), - shape_type=ShapeType.ENUM, - members={"PROFANITY": {"target": UNIT}}, +TRANSFORMATION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _TC, + 0, + (_mo, _tTSC), + ((QUERY_TRANSFORMATION_MODE, 1), (TEXT_TO_SQL_CONFIGURATION, 0)), ) -GUARDRAIL_MANAGED_WORD = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GuardrailManagedWord"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "match": {"target": STRING}, - "type": {"target": GUARDRAIL_MANAGED_WORD_TYPE}, - "action": {"target": GUARDRAIL_WORD_POLICY_ACTION}, - }, +GENERATE_QUERY_INPUT: StaticSchema = ( + 18, + n0, + _GQI, + {_sSI: _cGQR, _smithya: None}, + (_qGI, _tC), + ((QUERY_GENERATION_INPUT, 1), (TRANSFORMATION_CONFIGURATION, 1)), ) -GUARDRAIL_MANAGED_WORD_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GuardrailManagedWordList"), - shape_type=ShapeType.LIST, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"member": {"target": GUARDRAIL_MANAGED_WORD}}, +GENERATED_QUERY_TYPE: StaticSchema = (14, n0, _GQT, 0, (_RS_,), ((-1, {_sV: _RS_}),)) + +GENERATED_QUERY: StaticSchema = ( + 18, + n0, + _GQ, + 4, + (_t, _sq), + ((GENERATED_QUERY_TYPE, 0), (3, 0)), ) -GUARDRAIL_WORD_POLICY_ASSESSMENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GuardrailWordPolicyAssessment"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "customWords": {"target": GUARDRAIL_CUSTOM_WORD_LIST}, - "managedWordLists": {"target": GUARDRAIL_MANAGED_WORD_LIST}, - }, +GENERATED_QUERIES: StaticSchema = (16, n0, _GQe, 0, (_me,), ((GENERATED_QUERY, 0),)) + +GENERATE_QUERY_OUTPUT: StaticSchema = ( + 18, + n0, + _GQO, + {_sSI: _cGQRo, _smithy: None}, + (_qu,), + ((GENERATED_QUERIES, 0),), ) -GUARDRAIL_ASSESSMENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GuardrailAssessment"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "topicPolicy": {"target": GUARDRAIL_TOPIC_POLICY_ASSESSMENT}, - "contentPolicy": {"target": GUARDRAIL_CONTENT_POLICY_ASSESSMENT}, - "wordPolicy": {"target": GUARDRAIL_WORD_POLICY_ASSESSMENT}, - "sensitiveInformationPolicy": { - "target": GUARDRAIL_SENSITIVE_INFORMATION_POLICY_ASSESSMENT - }, +GENERATE_QUERY: StaticOperationSchema = ( + 23, + n0, + _GQen, + { + _smithyap: MappingProxyType( + {"code": 200, "method": "POST", "uri": "/generateQuery"} + ) }, + GENERATE_QUERY_INPUT, + GENERATE_QUERY_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + BAD_GATEWAY_EXCEPTION, + CONFLICT_EXCEPTION, + DEPENDENCY_FAILED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -GUARDRAIL_ASSESSMENT_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GuardrailAssessmentList"), - shape_type=ShapeType.LIST, - members={"member": {"target": GUARDRAIL_ASSESSMENT}}, +DOCUMENT_OUTPUT_FORMAT: StaticSchema = ( + 14, + n0, + _DOF, + 0, + (_RAW, _EXTRACTED), + ((-1, {_sV: _RAW}), (-1, {_sV: _EXTRACTED})), +) + +GET_DOCUMENT_CONTENT_INPUT: StaticSchema = ( + 18, + n0, + _GDCI, + {_sSI: _cGDCR, _smithya: None}, + (_kBI, _dSI, _dI, _oF, _uC), + ( + (KNOWLEDGE_BASE_IDENTIFIER, 9), + (DATA_SOURCE_ID, 9), + (DOCUMENT_ID, 9), + (DOCUMENT_OUTPUT_FORMAT, 0), + (USER_CONTEXT, 0), + ), ) -GUARDRAIL_TRACE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GuardrailTrace"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "action": {"target": GUARDRAIL_ACTION}, - "traceId": {"target": TRACE_ID}, - "inputAssessments": {"target": GUARDRAIL_ASSESSMENT_LIST}, - "outputAssessments": {"target": GUARDRAIL_ASSESSMENT_LIST}, - "metadata": {"target": METADATA}, +PRESIGNED_URL: StaticSchema = (3, n0, _PU, 4) + +GET_DOCUMENT_CONTENT_OUTPUT: StaticSchema = ( + 18, + n0, + _GDCO, + {_sSI: _cGDCRo, _smithy: None}, + (_mT, _pU, _dCL), + ((3, 1), (PRESIGNED_URL, 1), (8, 0)), +) + +GET_DOCUMENT_CONTENT: StaticOperationSchema = ( + 23, + n0, + _GDC, + { + _smithyap: MappingProxyType( + { + "code": 200, + "method": "POST", + "uri": "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/documents/{documentId}/content", + } + ) }, + GET_DOCUMENT_CONTENT_INPUT, + GET_DOCUMENT_CONTENT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -FILES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#Files"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, +GET_INGESTED_DOCUMENT_ACL_INPUT: StaticSchema = ( + 18, + n0, + _GIDAI, + {_sSI: _cGIDAR, _smithya: None}, + (_kBI, _dSI, _dI), + ((KNOWLEDGE_BASE_IDENTIFIER, 9), (DATA_SOURCE_ID, 9), (DOCUMENT_ID, 1)), +) + +DOCUMENT_ACL_MEMBER_RELATION: StaticSchema = ( + 14, + n0, + _DAMR, + 0, + (_AND, _OR), + ((-1, {_sV: _AND}), (-1, {_sV: _OR})), +) + +DOCUMENT_ACL_MEMBERSHIP_TYPE: StaticSchema = ( + 14, + n0, + _DAMT, + 0, + (_KB, _DS), + ((-1, {_sV: _KB}), (-1, {_sV: _DS})), +) + +DOCUMENT_ACL_GROUP: StaticSchema = ( + 18, + n0, + _DAG, + 0, + (_id_, _t), + ((3, 1), (DOCUMENT_ACL_MEMBERSHIP_TYPE, 1)), +) + +DOCUMENT_ACL_GROUP_LIST: StaticSchema = ( + 16, + n0, + _DAGL, + 0, + (_me,), + ((DOCUMENT_ACL_GROUP, 0),), +) + +DOCUMENT_ACL_USER: StaticSchema = ( + 18, + n0, + _DAU, + 0, + (_id_, _t), + ((3, 1), (DOCUMENT_ACL_MEMBERSHIP_TYPE, 1)), +) + +DOCUMENT_ACL_USER_LIST: StaticSchema = ( + 16, + n0, + _DAUL, + 0, + (_me,), + ((DOCUMENT_ACL_USER, 0),), +) + +DOCUMENT_ACL_CONDITION: StaticSchema = ( + 18, + n0, + _DAC, + 0, + (_cO, _use, _gr), + ( + (DOCUMENT_ACL_MEMBER_RELATION, 0), + (DOCUMENT_ACL_USER_LIST, 0), + (DOCUMENT_ACL_GROUP_LIST, 0), + ), ) -CODE_INTERPRETER_INVOCATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#CodeInterpreterInvocationInput"), - members={"code": {"target": STRING}, "files": {"target": FILES}}, -) - -INVOCATION_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#InvocationType"), - shape_type=ShapeType.ENUM, - members={ - "ACTION_GROUP": {"target": UNIT}, - "KNOWLEDGE_BASE": {"target": UNIT}, - "FINISH": {"target": UNIT}, - "ACTION_GROUP_CODE_INTERPRETER": {"target": UNIT}, - "AGENT_COLLABORATOR": {"target": UNIT}, +DOCUMENT_ACL_CONDITION_LIST: StaticSchema = ( + 16, + n0, + _DACL, + 0, + (_me,), + ((DOCUMENT_ACL_CONDITION, 0),), +) + +DOCUMENT_ACL_MEMBERSHIP: StaticSchema = ( + 18, + n0, + _DAM, + 0, + (_mRe, _cond), + ((DOCUMENT_ACL_MEMBER_RELATION, 0), (DOCUMENT_ACL_CONDITION_LIST, 0)), +) + +DOCUMENT_ACL: StaticSchema = ( + 18, + n0, + _DA, + 4, + (_aL, _dL), + ((DOCUMENT_ACL_MEMBERSHIP, 0), (DOCUMENT_ACL_MEMBERSHIP, 0)), +) + +GET_INGESTED_DOCUMENT_ACL_OUTPUT: StaticSchema = ( + 18, + n0, + _GIDAO, + {_sSI: _cGIDARo, _smithy: None}, + (_dA,), + ((DOCUMENT_ACL, 1),), +) + +GET_INGESTED_DOCUMENT_ACL: StaticOperationSchema = ( + 23, + n0, + _GIDA, + { + _smithyap: MappingProxyType( + { + "code": 200, + "method": "POST", + "uri": "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/get-ingested-document-acl", + } + ) }, + GET_INGESTED_DOCUMENT_ACL_INPUT, + GET_INGESTED_DOCUMENT_ACL_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -TRACE_KNOWLEDGE_BASE_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#TraceKnowledgeBaseId"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +BEDROCK_MODEL_CONFIGURATIONS: StaticSchema = ( + 18, + n0, + _BMC, + 0, + (_pC,), + ((PERFORMANCE_CONFIGURATION, 0),), ) -KNOWLEDGE_BASE_LOOKUP_INPUT_STRING = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#KnowledgeBaseLookupInputString"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) +INPUT_TEXT: StaticSchema = (3, n0, _ITn, 4) -KNOWLEDGE_BASE_LOOKUP_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#KnowledgeBaseLookupInput"), - members={ - "text": {"target": KNOWLEDGE_BASE_LOOKUP_INPUT_STRING}, - "knowledgeBaseId": {"target": TRACE_KNOWLEDGE_BASE_ID}, - }, -) +MEMORY_ID: StaticSchema = (3, n0, _MIe, 0) -INVOCATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#InvocationInput"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "traceId": {"target": TRACE_ID}, - "invocationType": {"target": INVOCATION_TYPE}, - "actionGroupInvocationInput": {"target": ACTION_GROUP_INVOCATION_INPUT}, - "knowledgeBaseLookupInput": {"target": KNOWLEDGE_BASE_LOOKUP_INPUT}, - "codeInterpreterInvocationInput": {"target": CODE_INTERPRETER_INVOCATION_INPUT}, - "agentCollaboratorInvocationInput": { - "target": AGENT_COLLABORATOR_INVOCATION_INPUT - }, - }, +PROMPT_CREATION_CONFIGURATIONS: StaticSchema = ( + 18, + n0, + _PCC, + 0, + (_pCTTI, _ePTS), + ((7, 0), (2, {_smit: False})), ) -MODEL_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#ModelIdentifier"), - shape_type=ShapeType.STRING, -) +CONTENT_BLOCK: StaticSchema = (19, n0, _CBo, 4, (_te,), ((3, 0),)) -MAXIMUM_LENGTH = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#MaximumLength"), - shape_type=ShapeType.INTEGER, -) +CONTENT_BLOCKS: StaticSchema = (16, n0, _CBon, 0, (_me,), ((CONTENT_BLOCK, 0),)) -STOP_SEQUENCES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#StopSequences"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, +MESSAGE: StaticSchema = ( + 18, + n0, + _Me, + 0, + (_ro, _co), + ((CONVERSATION_ROLE, 1), (CONTENT_BLOCKS, 1)), ) -TEMPERATURE = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#Temperature"), - shape_type=ShapeType.FLOAT, -) +MESSAGES: StaticSchema = (16, n0, _Mes, 0, (_me,), ((MESSAGE, 0),)) -TOP_K = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#TopK"), shape_type=ShapeType.INTEGER -) +CONVERSATION_HISTORY: StaticSchema = (18, n0, _CH, 0, (_mes,), ((MESSAGES, 0),)) -TOP_P = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#TopP"), shape_type=ShapeType.FLOAT -) +BYTE_CONTENT_BLOB: StaticSchema = (1, n0, _BCB, 4) -INFERENCE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#InferenceConfiguration"), - members={ - "temperature": {"target": TEMPERATURE}, - "topP": {"target": TOP_P}, - "topK": {"target": TOP_K}, - "maximumLength": {"target": MAXIMUM_LENGTH}, - "stopSequences": {"target": STOP_SEQUENCES}, - }, +BYTE_CONTENT_FILE: StaticSchema = ( + 18, + n0, + _BCF, + 0, + (_mTe, _da), + ((MIME_TYPE, 1), (BYTE_CONTENT_BLOB, 1)), ) -LAMBDA_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#LambdaArn"), - shape_type=ShapeType.STRING, -) +S3_URI: StaticSchema = (3, n0, _SU, 0) -CREATION_MODE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#CreationMode"), - shape_type=ShapeType.ENUM, - members={"DEFAULT": {"target": UNIT}, "OVERRIDDEN": {"target": UNIT}}, -) +S3_OBJECT_FILE: StaticSchema = (18, n0, _SOF, 0, (_uri,), ((S3_URI, 1),)) -PROMPT_TEXT = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#PromptText"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +FILE_SOURCE_TYPE: StaticSchema = ( + 14, + n0, + _FST, + 0, + (_S, _BC), + ((-1, {_sV: _S}), (-1, {_sV: _BC})), ) -PROMPT_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#PromptType"), - shape_type=ShapeType.ENUM, - members={ - "PRE_PROCESSING": {"target": UNIT}, - "ORCHESTRATION": {"target": UNIT}, - "KNOWLEDGE_BASE_RESPONSE_GENERATION": {"target": UNIT}, - "POST_PROCESSING": {"target": UNIT}, - "ROUTING_CLASSIFIER": {"target": UNIT}, - }, +FILE_SOURCE: StaticSchema = ( + 18, + n0, + _FSi, + 0, + (_sTo, _sL, _bC), + ((FILE_SOURCE_TYPE, 1), (S3_OBJECT_FILE, 0), (BYTE_CONTENT_FILE, 0)), ) -MODEL_INVOCATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ModelInvocationInput"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "traceId": {"target": TRACE_ID}, - "text": {"target": PROMPT_TEXT}, - "type": {"target": PROMPT_TYPE}, - "overrideLambda": {"target": LAMBDA_ARN}, - "promptCreationMode": {"target": CREATION_MODE}, - "inferenceConfiguration": {"target": INFERENCE_CONFIGURATION}, - "parserMode": {"target": CREATION_MODE}, - "foundationModel": {"target": MODEL_IDENTIFIER}, - }, +FILE_USE_CASE: StaticSchema = ( + 14, + n0, + _FUC, + 0, + (_CI, _CHAT), + ((-1, {_sV: _CI}), (-1, {_sV: _CHAT})), ) -RAW_RESPONSE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RawResponse"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"content": {"target": STRING}}, +INPUT_FILE: StaticSchema = ( + 18, + n0, + _IFn, + 0, + (_n, _so, _uCs), + ((3, 1), (FILE_SOURCE, 1), (FILE_USE_CASE, 1)), ) -REASONING_TEXT_BLOCK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ReasoningTextBlock"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "text": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "signature": {"target": STRING}, - }, -) +INPUT_FILES: StaticSchema = (16, n0, _IFnp, 0, (_me,), ((INPUT_FILE, 0),)) -REASONING_CONTENT_BLOCK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ReasoningContentBlock"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "reasoningText": {"target": REASONING_TEXT_BLOCK}, - "redactedContent": {"target": BLOB}, - }, +RERANKING_METADATA_SELECTION_MODE: StaticSchema = ( + 14, + n0, + _RMSM, + 0, + (_SELECTIVE, _ALL), + ((-1, {_sV: _SELECTIVE}), (-1, {_sV: _ALL})), ) -ORCHESTRATION_MODEL_INVOCATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#OrchestrationModelInvocationOutput"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "traceId": {"target": TRACE_ID}, - "rawResponse": {"target": RAW_RESPONSE}, - "metadata": {"target": METADATA}, - "reasoningContent": {"target": REASONING_CONTENT_BLOCK}, - }, -) +FIELD_FOR_RERANKING: StaticSchema = (18, n0, _FFR, 0, (_fN,), ((3, 1),)) -CODE_INTERPRETER_INVOCATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#CodeInterpreterInvocationOutput"), - members={ - "executionOutput": {"target": STRING}, - "executionError": {"target": STRING}, - "files": {"target": FILES}, - "executionTimeout": {"target": BOOLEAN}, - "metadata": {"target": METADATA}, - }, +FIELDS_FOR_RERANKING: StaticSchema = ( + 16, + n0, + _FFRi, + 4, + (_me,), + ((FIELD_FOR_RERANKING, 0),), ) -FINAL_RESPONSE_STRING = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#FinalResponseString"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION: StaticSchema = ( + 19, + n0, + _RMSMC, + 0, + (_fTI, _fTEi), + ((FIELDS_FOR_RERANKING, 0), (FIELDS_FOR_RERANKING, 0)), ) -FINAL_RESPONSE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FinalResponse"), - members={ - "text": {"target": FINAL_RESPONSE_STRING}, - "metadata": {"target": METADATA}, - }, +METADATA_CONFIGURATION_FOR_RERANKING: StaticSchema = ( + 18, + n0, + _MCFR, + 0, + (_sM, _sMC), + ( + (RERANKING_METADATA_SELECTION_MODE, 1), + (RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION, 0), + ), ) -AUDIO_SEGMENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AudioSegment"), - members={ - "s3Uri": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "transcription": {"target": STRING}, - }, -) +BEDROCK_RERANKING_MODEL_ARN: StaticSchema = (3, n0, _BRMA, 0) -RETRIEVAL_RESULT_CONTENT_COLUMN_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RetrievalResultContentColumnType"), - shape_type=ShapeType.ENUM, - members={ - "BLOB": {"target": UNIT}, - "BOOLEAN": {"target": UNIT}, - "DOUBLE": {"target": UNIT}, - "NULL": {"target": UNIT}, - "LONG": {"target": UNIT}, - "STRING": {"target": UNIT}, - }, +MANAGED_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION: StaticSchema = ( + 18, + n0, + _MSBRMC, + 0, + (_mA, _aMRF), + ((BEDROCK_RERANKING_MODEL_ARN, 1), (ADDITIONAL_MODEL_REQUEST_FIELDS, 0)), ) -RETRIEVAL_RESULT_CONTENT_COLUMN = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RetrievalResultContentColumn"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "columnName": {"target": STRING}, - "columnValue": {"target": STRING}, - "type": {"target": RETRIEVAL_RESULT_CONTENT_COLUMN_TYPE}, - }, +MANAGED_SEARCH_BEDROCK_RERANKING_CONFIGURATION: StaticSchema = ( + 18, + n0, + _MSBRC, + 0, + (_mC, _nORR, _mCe), + ( + (MANAGED_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION, 1), + (7, 0), + (METADATA_CONFIGURATION_FOR_RERANKING, 0), + ), ) -RETRIEVAL_RESULT_CONTENT_ROW = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RetrievalResultContentRow"), - shape_type=ShapeType.LIST, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"member": {"target": RETRIEVAL_RESULT_CONTENT_COLUMN}}, +MANAGED_SEARCH_RERANKING_CONFIGURATION_TYPE: StaticSchema = ( + 14, + n0, + _MSRCT, + 0, + (_BRM,), + ((-1, {_sV: _BRM}),), +) + +MANAGED_SEARCH_RERANKING_CONFIGURATION: StaticSchema = ( + 18, + n0, + _MSRC, + 0, + (_t, _bRC), + ( + (MANAGED_SEARCH_RERANKING_CONFIGURATION_TYPE, 1), + (MANAGED_SEARCH_BEDROCK_RERANKING_CONFIGURATION, 0), + ), ) -RETRIEVAL_RESULT_CONTENT_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RetrievalResultContentType"), - shape_type=ShapeType.ENUM, - members={ - "TEXT": {"target": UNIT}, - "IMAGE": {"target": UNIT}, - "ROW": {"target": UNIT}, - "AUDIO": {"target": UNIT}, - "VIDEO": {"target": UNIT}, - }, +RERANKING_MODEL_TYPE: StaticSchema = ( + 14, + n0, + _RMT, + 0, + (_CUSTOM, _MANAGED, _NONE), + ((-1, {_sV: _CUSTOM}), (-1, {_sV: _MANAGED}), (-1, {_sV: _NONE})), +) + +ATTRIBUTE_TYPE: StaticSchema = ( + 14, + n0, + _ATt, + 0, + (_STRING, _NUMBER, _BOOLEAN, _SL), + ( + (-1, {_sV: _STRING}), + (-1, {_sV: _NUMBER}), + (-1, {_sV: _BOOLEAN}), + (-1, {_sV: _SL}), + ), ) -VIDEO_SEGMENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#VideoSegment"), - members={ - "s3Uri": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "summary": {"target": STRING}, - }, +METADATA_ATTRIBUTE_SCHEMA: StaticSchema = ( + 18, + n0, + _MAS, + 4, + (_k, _t, _d), + ((3, 1), (ATTRIBUTE_TYPE, 1), (3, 1)), +) + +METADATA_ATTRIBUTE_SCHEMA_LIST: StaticSchema = ( + 16, + n0, + _MASL, + 0, + (_me,), + ((METADATA_ATTRIBUTE_SCHEMA, 0),), +) + +IMPLICIT_FILTER_CONFIGURATION: StaticSchema = ( + 18, + n0, + _IFC, + 0, + (_mAe, _mA), + ((METADATA_ATTRIBUTE_SCHEMA_LIST, 1), (BEDROCK_MODEL_ARN, 1)), +) + +SEARCH_TYPE: StaticSchema = ( + 14, + n0, + _ST, + 0, + (_HYBRID, _SEMANTIC), + ((-1, {_sV: _HYBRID}), (-1, {_sV: _SEMANTIC})), +) + +VECTOR_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION: StaticSchema = ( + 18, + n0, + _VSBRMC, + 0, + (_mA, _aMRF), + ((BEDROCK_RERANKING_MODEL_ARN, 1), (ADDITIONAL_MODEL_REQUEST_FIELDS, 0)), +) + +VECTOR_SEARCH_BEDROCK_RERANKING_CONFIGURATION: StaticSchema = ( + 18, + n0, + _VSBRC, + 0, + (_mC, _nORR, _mCe), + ( + (VECTOR_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION, 1), + (7, 0), + (METADATA_CONFIGURATION_FOR_RERANKING, 0), + ), ) -RETRIEVAL_RESULT_CONTENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RetrievalResultContent"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "type": {"target": RETRIEVAL_RESULT_CONTENT_TYPE}, - "text": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="")], - }, - "byteContent": {"target": STRING}, - "video": {"target": VIDEO_SEGMENT}, - "audio": {"target": AUDIO_SEGMENT}, - "row": {"target": RETRIEVAL_RESULT_CONTENT_ROW}, - }, +VECTOR_SEARCH_RERANKING_CONFIGURATION_TYPE: StaticSchema = ( + 14, + n0, + _VSRCT, + 0, + (_BRM,), + ((-1, {_sV: _BRM}),), +) + +VECTOR_SEARCH_RERANKING_CONFIGURATION: StaticSchema = ( + 18, + n0, + _VSRC, + 0, + (_t, _bRC), + ( + (VECTOR_SEARCH_RERANKING_CONFIGURATION_TYPE, 1), + (VECTOR_SEARCH_BEDROCK_RERANKING_CONFIGURATION, 0), + ), ) -RETRIEVAL_RESULT_CONFLUENCE_LOCATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RetrievalResultConfluenceLocation"), - members={"url": {"target": STRING}}, +PROMPT_SESSION_ATTRIBUTES_MAP: StaticSchema = ( + 17, + n0, + _PSAM, + 0, + (_k, _v), + ((3, 0), (3, 0)), ) -RETRIEVAL_RESULT_CUSTOM_DOCUMENT_LOCATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentruntime#RetrievalResultCustomDocumentLocation" - ), - members={"id": {"target": STRING}}, -) +SESSION_ATTRIBUTES_MAP: StaticSchema = (17, n0, _SAM, 0, (_k, _v), ((3, 0), (3, 0))) -RETRIEVAL_RESULT_GOOGLE_DRIVE_LOCATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RetrievalResultGoogleDriveLocation"), - members={"url": {"target": STRING}}, -) +AWS_RESOURCE_ARN: StaticSchema = (3, n0, _AWSRARN, 0) -RETRIEVAL_RESULT_KENDRA_DOCUMENT_LOCATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentruntime#RetrievalResultKendraDocumentLocation" - ), - members={"uri": {"target": STRING}}, +STREAMING_CONFIGURATIONS: StaticSchema = ( + 18, + n0, + _SCt, + 0, + (_sFR, _aGI), + ((2, {_smit: False}), (7, 0)), ) -RETRIEVAL_RESULT_ONE_DRIVE_LOCATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RetrievalResultOneDriveLocation"), - members={"url": {"target": STRING}}, -) +SPAN: StaticSchema = (18, n0, _Sp, 0, (_star, _en), ((7, 0), (7, 0))) -RETRIEVAL_RESULT_S3_LOCATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RetrievalResultS3Location"), - members={"uri": {"target": STRING}}, -) +TEXT_RESPONSE_PART: StaticSchema = (18, n0, _TRP, 4, (_te, _sp), ((3, 0), (SPAN, 0))) -RETRIEVAL_RESULT_SALESFORCE_LOCATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RetrievalResultSalesforceLocation"), - members={"url": {"target": STRING}}, +GENERATED_RESPONSE_PART: StaticSchema = ( + 18, + n0, + _GRP, + 0, + (_tRP,), + ((TEXT_RESPONSE_PART, 0),), ) -RETRIEVAL_RESULT_SHARE_POINT_LOCATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RetrievalResultSharePointLocation"), - members={"url": {"target": STRING}}, +CITATION: StaticSchema = ( + 18, + n0, + _Ci, + 0, + (_gRP, _rRe), + ((GENERATED_RESPONSE_PART, 0), (RETRIEVED_REFERENCES, 0)), ) -RETRIEVAL_RESULT_SQL_LOCATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RetrievalResultSqlLocation"), - members={"query": {"target": STRING}}, -) +CITATIONS: StaticSchema = (16, n0, _Cit, 0, (_me,), ((CITATION, 0),)) -RETRIEVAL_RESULT_LOCATION_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RetrievalResultLocationType"), - shape_type=ShapeType.ENUM, - members={ - "S3": {"target": UNIT}, - "WEB": {"target": UNIT}, - "CONFLUENCE": {"target": UNIT}, - "SALESFORCE": {"target": UNIT}, - "SHAREPOINT": {"target": UNIT}, - "CUSTOM": {"target": UNIT}, - "KENDRA": {"target": UNIT}, - "SQL": {"target": UNIT}, - "ONEDRIVE": {"target": UNIT}, - "GOOGLEDRIVE": {"target": UNIT}, - }, -) +ATTRIBUTION: StaticSchema = (18, n0, _At, 0, (_ci,), ((CITATIONS, 0),)) -RETRIEVAL_RESULT_WEB_LOCATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RetrievalResultWebLocation"), - members={"url": {"target": STRING}}, -) - -RETRIEVAL_RESULT_LOCATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RetrievalResultLocation"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "type": { - "target": RETRIEVAL_RESULT_LOCATION_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "s3Location": {"target": RETRIEVAL_RESULT_S3_LOCATION}, - "webLocation": {"target": RETRIEVAL_RESULT_WEB_LOCATION}, - "confluenceLocation": {"target": RETRIEVAL_RESULT_CONFLUENCE_LOCATION}, - "salesforceLocation": {"target": RETRIEVAL_RESULT_SALESFORCE_LOCATION}, - "sharePointLocation": {"target": RETRIEVAL_RESULT_SHARE_POINT_LOCATION}, - "customDocumentLocation": {"target": RETRIEVAL_RESULT_CUSTOM_DOCUMENT_LOCATION}, - "kendraDocumentLocation": {"target": RETRIEVAL_RESULT_KENDRA_DOCUMENT_LOCATION}, - "sqlLocation": {"target": RETRIEVAL_RESULT_SQL_LOCATION}, - "oneDriveLocation": {"target": RETRIEVAL_RESULT_ONE_DRIVE_LOCATION}, - "googleDriveLocation": {"target": RETRIEVAL_RESULT_GOOGLE_DRIVE_LOCATION}, - }, -) +PART_BODY: StaticSchema = (1, n0, _PB, 4) -RETRIEVAL_RESULT_METADATA_KEY = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#RetrievalResultMetadataKey"), - shape_type=ShapeType.STRING, +PAYLOAD_PART: StaticSchema = ( + 18, + n0, + _PPa, + 4, + (_by, _att), + ((PART_BODY, 0), (ATTRIBUTION, 0)), ) -RETRIEVAL_RESULT_METADATA_VALUE = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#RetrievalResultMetadataValue"), - shape_type=ShapeType.DOCUMENT, -) +FILE_BODY: StaticSchema = (1, n0, _FB, 4) -RETRIEVAL_RESULT_METADATA = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RetrievalResultMetadata"), - shape_type=ShapeType.MAP, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "key": {"target": RETRIEVAL_RESULT_METADATA_KEY}, - "value": {"target": RETRIEVAL_RESULT_METADATA_VALUE}, - }, +OUTPUT_FILE: StaticSchema = ( + 18, + n0, + _OF, + 4, + (_n, _t, _by), + ((3, 0), (MIME_TYPE, 0), (FILE_BODY, 0)), ) -RETRIEVED_REFERENCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RetrievedReference"), - members={ - "content": {"target": RETRIEVAL_RESULT_CONTENT}, - "location": {"target": RETRIEVAL_RESULT_LOCATION}, - "metadata": {"target": RETRIEVAL_RESULT_METADATA}, - }, -) +OUTPUT_FILES: StaticSchema = (16, n0, _OFu, 0, (_me,), ((OUTPUT_FILE, 0),)) -RETRIEVED_REFERENCES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RetrievedReferences"), - shape_type=ShapeType.LIST, - members={"member": {"target": RETRIEVED_REFERENCE}}, -) +FILE_PART: StaticSchema = (18, n0, _FPi, 0, (_fil,), ((OUTPUT_FILES, 0),)) -KNOWLEDGE_BASE_LOOKUP_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#KnowledgeBaseLookupOutput"), - members={ - "retrievedReferences": {"target": RETRIEVED_REFERENCES}, - "metadata": {"target": METADATA}, - }, +MODEL_NOT_READY_EXCEPTION: StaticSchema = ( + 18, + n0, + _MNRE, + {_s: _c, _sE: 424}, + (_m,), + ((NON_BLANK_STRING, 0),), ) -SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#Source"), - shape_type=ShapeType.ENUM, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "ACTION_GROUP": {"target": UNIT}, - "KNOWLEDGE_BASE": {"target": UNIT}, - "PARSER": {"target": UNIT}, - }, +RESPONSE_STREAM: StaticSchema = ( + 19, + n0, + _RSe, + {_smith: None}, + ( + _ch, + _tra, + _rCetu, + _iSE, + _vE, + _rNFE, + _sQEE, + _tEh, + _aDE, + _cE, + _dFE, + _bGE, + _mNRE, + _fil, + ), + ( + (PAYLOAD_PART, 0), + (TRACE_PART, 0), + (RETURN_CONTROL_PAYLOAD, 0), + (INTERNAL_SERVER_EXCEPTION, 0), + (VALIDATION_EXCEPTION, 0), + (RESOURCE_NOT_FOUND_EXCEPTION, 0), + (SERVICE_QUOTA_EXCEEDED_EXCEPTION, 0), + (THROTTLING_EXCEPTION, 0), + (ACCESS_DENIED_EXCEPTION, 0), + (CONFLICT_EXCEPTION, 0), + (DEPENDENCY_FAILED_EXCEPTION, 0), + (BAD_GATEWAY_EXCEPTION, 0), + (MODEL_NOT_READY_EXCEPTION, 0), + (FILE_PART, 0), + ), ) -REPROMPT_RESPONSE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RepromptResponse"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"text": {"target": STRING}, "source": {"target": SOURCE}}, +INVOKE_AGENT_OUTPUT: StaticSchema = ( + 18, + n0, + _IAO, + {_sSI: _cIAR, _smithy: None}, + (_com, _cT, _sIe, _mI), + ( + (RESPONSE_STREAM, 17), + (MIME_TYPE, {_sH: _xabact, _smi: None}), + (SESSION_ID, {_sH: _xabasi, _smi: None}), + (MEMORY_ID, {_sH: _xabami}), + ), ) -TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#Type"), - shape_type=ShapeType.ENUM, - members={ - "ACTION_GROUP": {"target": UNIT}, - "AGENT_COLLABORATOR": {"target": UNIT}, - "KNOWLEDGE_BASE": {"target": UNIT}, - "FINISH": {"target": UNIT}, - "ASK_USER": {"target": UNIT}, - "REPROMPT": {"target": UNIT}, - }, +INLINE_BEDROCK_MODEL_CONFIGURATIONS: StaticSchema = ( + 18, + n0, + _IBMC, + 0, + (_pC,), + ((PERFORMANCE_CONFIGURATION, 0),), +) + +COLLABORATION_INSTRUCTION: StaticSchema = (3, n0, _CIo, 4) + +RELAY_CONVERSATION_HISTORY: StaticSchema = ( + 14, + n0, + _RCH, + 0, + (_TC_, _DISABLED), + ((-1, {_sV: _TC_}), (-1, {_sV: _DISABLED})), +) + +COLLABORATOR_CONFIGURATION: StaticSchema = ( + 18, + n0, + _CCo, + 0, + (_cN, _cI, _aAA, _rCH), + ( + (NAME, 1), + (COLLABORATION_INSTRUCTION, 1), + (AGENT_ALIAS_ARN, 0), + (RELAY_CONVERSATION_HISTORY, 0), + ), ) -OBSERVATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#Observation"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "traceId": {"target": TRACE_ID}, - "type": {"target": TYPE}, - "actionGroupInvocationOutput": {"target": ACTION_GROUP_INVOCATION_OUTPUT}, - "agentCollaboratorInvocationOutput": { - "target": AGENT_COLLABORATOR_INVOCATION_OUTPUT - }, - "knowledgeBaseLookupOutput": {"target": KNOWLEDGE_BASE_LOOKUP_OUTPUT}, - "finalResponse": {"target": FINAL_RESPONSE}, - "repromptResponse": {"target": REPROMPT_RESPONSE}, - "codeInterpreterInvocationOutput": { - "target": CODE_INTERPRETER_INVOCATION_OUTPUT - }, - }, +COLLABORATOR_CONFIGURATIONS: StaticSchema = ( + 16, + n0, + _CCol, + 0, + (_me,), + ((COLLABORATOR_CONFIGURATION, 0),), ) -RATIONALE_STRING = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#RationaleString"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) +GUARDRAIL_IDENTIFIER_WITH_ARN: StaticSchema = (3, n0, _GIWA, 0) -RATIONALE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#Rationale"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"traceId": {"target": TRACE_ID}, "text": {"target": RATIONALE_STRING}}, -) +GUARDRAIL_VERSION: StaticSchema = (3, n0, _GV, 0) -ORCHESTRATION_TRACE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#OrchestrationTrace"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "rationale": {"target": RATIONALE}, - "invocationInput": {"target": INVOCATION_INPUT}, - "observation": {"target": OBSERVATION}, - "modelInvocationInput": {"target": MODEL_INVOCATION_INPUT}, - "modelInvocationOutput": {"target": ORCHESTRATION_MODEL_INVOCATION_OUTPUT}, - }, +GUARDRAIL_CONFIGURATION_WITH_ARN: StaticSchema = ( + 18, + n0, + _GCWA, + 0, + (_gIu, _gV), + ((GUARDRAIL_IDENTIFIER_WITH_ARN, 1), (GUARDRAIL_VERSION, 1)), ) -OUTPUT_STRING = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#OutputString"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) +SESSION_TTL: StaticSchema = (7, n0, _STTL, 0) -POST_PROCESSING_PARSED_RESPONSE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#PostProcessingParsedResponse"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"text": {"target": OUTPUT_STRING}}, -) +INSTRUCTION: StaticSchema = (3, n0, _In, 4) -POST_PROCESSING_MODEL_INVOCATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#PostProcessingModelInvocationOutput"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "traceId": {"target": TRACE_ID}, - "parsedResponse": {"target": POST_PROCESSING_PARSED_RESPONSE}, - "rawResponse": {"target": RAW_RESPONSE}, - "metadata": {"target": METADATA}, - "reasoningContent": {"target": REASONING_CONTENT_BLOCK}, - }, -) +BASE_PROMPT_TEMPLATE: StaticSchema = (3, n0, _BPT, 4) -POST_PROCESSING_TRACE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#PostProcessingTrace"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "modelInvocationInput": {"target": MODEL_INVOCATION_INPUT}, - "modelInvocationOutput": {"target": POST_PROCESSING_MODEL_INVOCATION_OUTPUT}, - }, +PROMPT_STATE: StaticSchema = ( + 14, + n0, + _PS, + 0, + (_ENABLED, _DISABLED), + ((-1, {_sV: _ENABLED}), (-1, {_sV: _DISABLED})), ) -PRE_PROCESSING_PARSED_RESPONSE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#PreProcessingParsedResponse"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"rationale": {"target": RATIONALE_STRING}, "isValid": {"target": BOOLEAN}}, +PROMPT_CONFIGURATION: StaticSchema = ( + 18, + n0, + _PCr, + 0, + (_pT, _pCM, _pS, _bPT, _iC, _pMa, _fM, _aMRF), + ( + (PROMPT_TYPE, 0), + (CREATION_MODE, 0), + (PROMPT_STATE, 0), + (BASE_PROMPT_TEMPLATE, 0), + (INFERENCE_CONFIGURATION, 0), + (CREATION_MODE, 0), + (MODEL_IDENTIFIER, 0), + (13, 0), + ), ) -PRE_PROCESSING_MODEL_INVOCATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#PreProcessingModelInvocationOutput"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "traceId": {"target": TRACE_ID}, - "parsedResponse": {"target": PRE_PROCESSING_PARSED_RESPONSE}, - "rawResponse": {"target": RAW_RESPONSE}, - "metadata": {"target": METADATA}, - "reasoningContent": {"target": REASONING_CONTENT_BLOCK}, - }, +PROMPT_CONFIGURATIONS: StaticSchema = ( + 16, + n0, + _PCro, + 0, + (_me,), + ((PROMPT_CONFIGURATION, 0),), +) + +PROMPT_OVERRIDE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _POC, + 4, + (_pCr, _oL), + ((PROMPT_CONFIGURATIONS, 1), (LAMBDA_RESOURCE_ARN, 0)), +) + +ORCHESTRATION_EXECUTOR: StaticSchema = (19, n0, _OE, 0, (_l,), ((LAMBDA_ARN, 0),)) + +CUSTOM_ORCHESTRATION: StaticSchema = ( + 18, + n0, + _CO, + 0, + (_exe,), + ((ORCHESTRATION_EXECUTOR, 0),), +) + +INLINE_SESSION_STATE: StaticSchema = ( + 18, + n0, + _ISS, + 0, + (_sAe, _pSA, _rCIR, _iI, _fil, _cH), + ( + (SESSION_ATTRIBUTES_MAP, 0), + (PROMPT_SESSION_ATTRIBUTES_MAP, 0), + (RETURN_CONTROL_INVOCATION_RESULTS, 0), + (3, 0), + (INPUT_FILES, 0), + (CONVERSATION_HISTORY, 0), + ), ) -PRE_PROCESSING_TRACE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#PreProcessingTrace"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "modelInvocationInput": {"target": MODEL_INVOCATION_INPUT}, - "modelInvocationOutput": {"target": PRE_PROCESSING_MODEL_INVOCATION_OUTPUT}, - }, +ORCHESTRATION_TYPE: StaticSchema = ( + 14, + n0, + _OTr, + 0, + (_DEFAULT, _CO_), + ((-1, {_sV: _DEFAULT}), (-1, {_sV: _CO_})), +) + +INLINE_AGENT_PAYLOAD_PART: StaticSchema = ( + 18, + n0, + _IAPP, + 4, + (_by, _att), + ((PART_BODY, 0), (ATTRIBUTION, 0)), +) + +INLINE_AGENT_FILE_PART: StaticSchema = (18, n0, _IAFP, 0, (_fil,), ((OUTPUT_FILES, 0),)) + +INLINE_AGENT_RETURN_CONTROL_PAYLOAD: StaticSchema = ( + 18, + n0, + _IARCP, + 4, + (_iIn, _iI), + ((INVOCATION_INPUTS, 0), (3, 0)), +) + +INLINE_AGENT_TRACE_PART: StaticSchema = ( + 18, + n0, + _IATP, + 4, + (_sIe, _tra, _cCa, _eTv, _cN), + ( + (SESSION_ID, 0), + (TRACE, 0), + (CALLER_CHAIN, 0), + (DATE_TIMESTAMP, {_sF: _dt}), + (NAME, 0), + ), ) -ROUTING_CLASSIFIER_MODEL_INVOCATION_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentruntime#RoutingClassifierModelInvocationOutput" +INLINE_AGENT_RESPONSE_STREAM: StaticSchema = ( + 19, + n0, + _IARS, + {_smith: None}, + (_ch, _tra, _rCetu, _iSE, _vE, _rNFE, _sQEE, _tEh, _aDE, _cE, _dFE, _bGE, _fil), + ( + (INLINE_AGENT_PAYLOAD_PART, 0), + (INLINE_AGENT_TRACE_PART, 0), + (INLINE_AGENT_RETURN_CONTROL_PAYLOAD, 0), + (INTERNAL_SERVER_EXCEPTION, 0), + (VALIDATION_EXCEPTION, 0), + (RESOURCE_NOT_FOUND_EXCEPTION, 0), + (SERVICE_QUOTA_EXCEEDED_EXCEPTION, 0), + (THROTTLING_EXCEPTION, 0), + (ACCESS_DENIED_EXCEPTION, 0), + (CONFLICT_EXCEPTION, 0), + (DEPENDENCY_FAILED_EXCEPTION, 0), + (BAD_GATEWAY_EXCEPTION, 0), + (INLINE_AGENT_FILE_PART, 0), ), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "traceId": {"target": TRACE_ID}, - "rawResponse": {"target": RAW_RESPONSE}, - "metadata": {"target": METADATA}, - }, ) -ROUTING_CLASSIFIER_TRACE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RoutingClassifierTrace"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "invocationInput": {"target": INVOCATION_INPUT}, - "observation": {"target": OBSERVATION}, - "modelInvocationInput": {"target": MODEL_INVOCATION_INPUT}, - "modelInvocationOutput": {"target": ROUTING_CLASSIFIER_MODEL_INVOCATION_OUTPUT}, - }, +INVOKE_INLINE_AGENT_OUTPUT: StaticSchema = ( + 18, + n0, + _IIAO, + {_sSI: _cIIAR, _smithy: None}, + (_com, _cT, _sIe), + ( + (INLINE_AGENT_RESPONSE_STREAM, 17), + (MIME_TYPE, {_sH: _xabact, _smi: None}), + (SESSION_ID, {_sH: _xabasi, _smi: None}), + ), ) -TRACE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#Trace"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "guardrailTrace": {"target": GUARDRAIL_TRACE}, - "preProcessingTrace": {"target": PRE_PROCESSING_TRACE}, - "orchestrationTrace": {"target": ORCHESTRATION_TRACE}, - "postProcessingTrace": {"target": POST_PROCESSING_TRACE}, - "routingClassifierTrace": {"target": ROUTING_CLASSIFIER_TRACE}, - "failureTrace": {"target": FAILURE_TRACE}, - "customOrchestrationTrace": {"target": CUSTOM_ORCHESTRATION_TRACE}, - }, +DELETE_AGENT_MEMORY_INPUT: StaticSchema = ( + 18, + n0, + _DAMI, + {_sSI: _cDAMR, _smithya: None}, + (_aI, _aAI, _mI, _sIe), + ( + (AGENT_ID, 9), + (AGENT_ALIAS_ID, 9), + (MEMORY_ID, {_sQ: _mI}), + (SESSION_ID, {_sQ: _sIe}), + ), ) -TRACE_PART = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#TracePart"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "sessionId": {"target": SESSION_ID}, - "trace": {"target": TRACE}, - "callerChain": {"target": CALLER_CHAIN}, - "eventTime": { - "target": DATE_TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#timestampFormat"), value="date-time") - ], - }, - "collaboratorName": {"target": NAME}, - "agentId": {"target": AGENT_ID}, - "agentAliasId": {"target": AGENT_ALIAS_ID}, - "agentVersion": {"target": AGENT_VERSION}, +DELETE_AGENT_MEMORY_OUTPUT: StaticSchema = ( + 18, + n0, + _DAMO, + {_sSI: _cDAMRo, _smithy: None}, +) + +DELETE_AGENT_MEMORY: StaticOperationSchema = ( + 23, + n0, + _DAMe, + { + _smithyap: MappingProxyType( + { + "code": 202, + "method": "DELETE", + "uri": "/agents/{agentId}/agentAliases/{agentAliasId}/memories", + } + ) }, + DELETE_AGENT_MEMORY_INPUT, + DELETE_AGENT_MEMORY_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + BAD_GATEWAY_EXCEPTION, + CONFLICT_EXCEPTION, + DEPENDENCY_FAILED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AGENT_TRACES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgentTraces"), - shape_type=ShapeType.LIST, - members={"member": {"target": TRACE_PART}}, +MEMORY_TYPE: StaticSchema = (14, n0, _MTe, 0, (_SS_,), ((-1, {_sV: _SS_}),)) + +GET_AGENT_MEMORY_INPUT: StaticSchema = ( + 18, + n0, + _GAMI, + {_sSI: _cGAMR, _smithya: None}, + (_nT, _mIa, _aI, _aAI, _mTem, _mI), + ( + (NEXT_TOKEN, {_sQ: _nT}), + (MAX_RESULTS, {_sQ: _mIa}), + (AGENT_ID, 9), + (AGENT_ALIAS_ID, 9), + (MEMORY_TYPE, {_sQ: _mTem, _smi: None}), + (MEMORY_ID, {_sQ: _mI, _smi: None}), + ), ) -DATA_SOURCE_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#DataSourceId"), - shape_type=ShapeType.STRING, +SUMMARY_TEXT: StaticSchema = (3, n0, _STu, 0) + +MEMORY_SESSION_SUMMARY: StaticSchema = ( + 18, + n0, + _MSS, + 0, + (_mI, _sIe, _sST, _sET, _sTu), + ( + (MEMORY_ID, 0), + (SESSION_ID, 0), + (DATE_TIMESTAMP, 0), + (DATE_TIMESTAMP, 0), + (SUMMARY_TEXT, 0), + ), ) -DOCUMENT_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#DocumentId"), - shape_type=ShapeType.STRING, -) +MEMORY: StaticSchema = (19, n0, _Mem, 0, (_sSe,), ((MEMORY_SESSION_SUMMARY, 0),)) -KNOWLEDGE_BASE_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#KnowledgeBaseIdentifier"), - shape_type=ShapeType.STRING, -) +MEMORIES: StaticSchema = (16, n0, _Memo, 0, (_me,), ((MEMORY, 0),)) -CHECK_INGESTED_DOCUMENT_ACL_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#CheckIngestedDocumentAclInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#CheckIngestedDocumentAclRequest", - ) - ], - members={ - "knowledgeBaseId": { - "target": KNOWLEDGE_BASE_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "dataSourceId": { - "target": DATA_SOURCE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "documentId": { - "target": DOCUMENT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "userContext": { - "target": USER_CONTEXT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +GET_AGENT_MEMORY_OUTPUT: StaticSchema = ( + 18, + n0, + _GAMO, + {_sSI: _cGAMRo, _smithy: None}, + (_nT, _mCem), + ((NEXT_TOKEN, 0), (MEMORIES, 0)), ) -CHECK_INGESTED_DOCUMENT_ACL_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#CheckIngestedDocumentAclOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#CheckIngestedDocumentAclResponse", +GET_AGENT_MEMORY: StaticOperationSchema = ( + 23, + n0, + _GAM, + { + _smithyap: MappingProxyType( + { + "code": 200, + "method": "GET", + "uri": "/agents/{agentId}/agentAliases/{agentAliasId}/memories", + } ) - ], - members={ - "hasAccess": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } }, + GET_AGENT_MEMORY_INPUT, + GET_AGENT_MEMORY_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + BAD_GATEWAY_EXCEPTION, + CONFLICT_EXCEPTION, + DEPENDENCY_FAILED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CHECK_INGESTED_DOCUMENT_ACL = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#CheckIngestedDocumentAcl"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "POST", - "uri": "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/check-ingested-document-acl", - } - ), - ) - ], -) - -FLOW_EXECUTION_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowExecutionIdentifier"), - shape_type=ShapeType.STRING, -) - -FLOW_ALIAS_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowAliasIdentifier"), - shape_type=ShapeType.STRING, -) +TEXT_PROMPT: StaticSchema = (18, n0, _TPe, 4, (_te,), ((3, 1),)) -FLOW_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowIdentifier"), - shape_type=ShapeType.STRING, -) +INPUT_PROMPT: StaticSchema = (19, n0, _IPn, 0, (_tPe,), ((TEXT_PROMPT, 0),)) -GET_EXECUTION_FLOW_SNAPSHOT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GetExecutionFlowSnapshotInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#GetExecutionFlowSnapshotRequest", - ) - ], - members={ - "flowIdentifier": { - "target": FLOW_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "flowAliasIdentifier": { - "target": FLOW_ALIAS_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "executionIdentifier": { - "target": FLOW_EXECUTION_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, +OPTIMIZE_PROMPT_INPUT: StaticSchema = ( + 18, + n0, + _OPI, + {_sSI: _cOPR, _smithya: None}, + (_in, _tMI), + ((INPUT_PROMPT, 1), (3, 1)), ) -KMS_KEY_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#KmsKeyArn"), - shape_type=ShapeType.STRING, -) +ANALYZE_PROMPT_EVENT: StaticSchema = (18, n0, _APE, 4, (_m,), ((3, 0),)) -FLOW_EXECUTION_ROLE_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowExecutionRoleArn"), - shape_type=ShapeType.STRING, -) +OPTIMIZED_PROMPT: StaticSchema = (19, n0, _OP, 0, (_tPe,), ((TEXT_PROMPT, 0),)) -VERSION = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#Version"), shape_type=ShapeType.STRING +OPTIMIZED_PROMPT_EVENT: StaticSchema = ( + 18, + n0, + _OPE, + 4, + (_oP,), + ((OPTIMIZED_PROMPT, 0),), ) -GET_EXECUTION_FLOW_SNAPSHOT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GetExecutionFlowSnapshotOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#GetExecutionFlowSnapshotResponse", - ) - ], - members={ - "flowIdentifier": { - "target": FLOW_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "flowAliasIdentifier": { - "target": FLOW_ALIAS_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "flowVersion": { - "target": VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "executionRoleArn": { - "target": FLOW_EXECUTION_ROLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "definition": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "customerEncryptionKeyArn": {"target": KMS_KEY_ARN}, - }, +OPTIMIZED_PROMPT_STREAM: StaticSchema = ( + 19, + n0, + _OPS, + {_smith: None}, + (_oPE, _aPE, _iSE, _tEh, _vE, _dFE, _aDE, _bGE), + ( + (OPTIMIZED_PROMPT_EVENT, 0), + (ANALYZE_PROMPT_EVENT, 0), + (INTERNAL_SERVER_EXCEPTION, 0), + (THROTTLING_EXCEPTION, 0), + (VALIDATION_EXCEPTION, 0), + (DEPENDENCY_FAILED_EXCEPTION, 0), + (ACCESS_DENIED_EXCEPTION, 0), + (BAD_GATEWAY_EXCEPTION, 0), + ), ) -GET_EXECUTION_FLOW_SNAPSHOT = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#GetExecutionFlowSnapshot"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/flows/{flowIdentifier}/aliases/{flowAliasIdentifier}/executions/{executionIdentifier}/flowsnapshot", - } - ), - ) - ], +OPTIMIZE_PROMPT_OUTPUT: StaticSchema = ( + 18, + n0, + _OPO, + {_sSI: _cOPRo, _smithy: None}, + (_oP,), + ((OPTIMIZED_PROMPT_STREAM, 17),), ) -GET_FLOW_EXECUTION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GetFlowExecutionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#GetFlowExecutionRequest", +OPTIMIZE_PROMPT: StaticOperationSchema = ( + 23, + n0, + _OPp, + { + _smithyap: MappingProxyType( + {"code": 200, "method": "POST", "uri": "/optimize-prompt"} ) - ], - members={ - "flowIdentifier": { - "target": FLOW_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "flowAliasIdentifier": { - "target": FLOW_ALIAS_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "executionIdentifier": { - "target": FLOW_EXECUTION_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, }, + OPTIMIZE_PROMPT_INPUT, + OPTIMIZE_PROMPT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + BAD_GATEWAY_EXCEPTION, + DEPENDENCY_FAILED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -FLOW_EXECUTION_ERROR_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowExecutionErrorType"), - shape_type=ShapeType.ENUM, - members={"TIMED_OUT": {"target": UNIT}}, +RERANK_TEXT_DOCUMENT: StaticSchema = (18, n0, _RTD, 4, (_te,), ((3, 0),)) + +RERANK_QUERY_CONTENT_TYPE: StaticSchema = ( + 14, + n0, + _RQCT, + 0, + (_TEXT,), + ((-1, {_sV: _TEXT}),), +) + +RERANK_QUERY: StaticSchema = ( + 18, + n0, + _RQ, + 4, + (_t, _tQ), + ((RERANK_QUERY_CONTENT_TYPE, 1), (RERANK_TEXT_DOCUMENT, 1)), +) + +RERANK_QUERIES_LIST: StaticSchema = (16, n0, _RQL, 4, (_me,), ((RERANK_QUERY, 0),)) + +BEDROCK_RERANKING_MODEL_CONFIGURATION: StaticSchema = ( + 18, + n0, + _BRMC, + 0, + (_mA, _aMRF), + ((BEDROCK_MODEL_ARN, 1), (ADDITIONAL_MODEL_REQUEST_FIELDS, 0)), +) + +BEDROCK_RERANKING_CONFIGURATION: StaticSchema = ( + 18, + n0, + _BRC, + 0, + (_nOR, _mC), + ((7, 0), (BEDROCK_RERANKING_MODEL_CONFIGURATION, 1)), +) + +RERANKING_CONFIGURATION_TYPE: StaticSchema = ( + 14, + n0, + _RCTe, + 0, + (_BRM,), + ((-1, {_sV: _BRM}),), +) + +RERANKING_CONFIGURATION: StaticSchema = ( + 18, + n0, + _RCer, + 0, + (_t, _bRC), + ((RERANKING_CONFIGURATION_TYPE, 1), (BEDROCK_RERANKING_CONFIGURATION, 1)), +) + +RERANK_DOCUMENT_TYPE: StaticSchema = ( + 14, + n0, + _RDT, + 0, + (_TEXT, _JSON), + ((-1, {_sV: _TEXT}), (-1, {_sV: _JSON})), +) + +RERANK_DOCUMENT: StaticSchema = ( + 18, + n0, + _RDe, + 4, + (_t, _tD, _jD), + ((RERANK_DOCUMENT_TYPE, 1), (RERANK_TEXT_DOCUMENT, 0), (13, 0)), +) + +RERANK_SOURCE_TYPE: StaticSchema = ( + 14, + n0, + _RST, + 0, + (_INLINE,), + ((-1, {_sV: _INLINE}),), +) + +RERANK_SOURCE: StaticSchema = ( + 18, + n0, + _RSer, + 4, + (_t, _iDS), + ((RERANK_SOURCE_TYPE, 1), (RERANK_DOCUMENT, 1)), +) + +RERANK_SOURCES_LIST: StaticSchema = (16, n0, _RSL, 4, (_me,), ((RERANK_SOURCE, 0),)) + +RERANK_INPUT: StaticSchema = ( + 18, + n0, + _RI, + {_sSI: _cRR, _smithya: None}, + (_qu, _sou, _rCe, _nT), + ( + (RERANK_QUERIES_LIST, 1), + (RERANK_SOURCES_LIST, 1), + (RERANKING_CONFIGURATION, 1), + (NEXT_TOKEN, 0), + ), ) -NODE_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#NodeName"), - shape_type=ShapeType.STRING, +RERANK_RESULT: StaticSchema = ( + 18, + n0, + _RRer, + 0, + (_ind, _rSel, _do), + ((7, 1), (9, 1), (RERANK_DOCUMENT, 0)), +) + +RERANK_RESULTS_LIST: StaticSchema = (16, n0, _RRLe, 0, (_me,), ((RERANK_RESULT, 0),)) + +RERANK_OUTPUT: StaticSchema = ( + 18, + n0, + _RO, + {_sSI: _cRRo, _smithy: None}, + (_res, _nT), + ((RERANK_RESULTS_LIST, 1), (NEXT_TOKEN, 0)), +) + +RERANK: StaticOperationSchema = ( + 23, + n0, + _Re, + {_smithyap: MappingProxyType({"code": 200, "method": "POST", "uri": "/rerank"})}, + RERANK_INPUT, + RERANK_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + BAD_GATEWAY_EXCEPTION, + CONFLICT_EXCEPTION, + DEPENDENCY_FAILED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -FLOW_EXECUTION_ERROR = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowExecutionError"), - members={ - "nodeName": {"target": NODE_NAME}, - "error": {"target": FLOW_EXECUTION_ERROR_TYPE}, - "message": {"target": STRING}, - }, -) +RETRIEVE_AND_GENERATE_INPUT: StaticSchema = (18, n0, _RAGI, 4, (_te,), ((3, 1),)) -FLOW_EXECUTION_ERRORS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowExecutionErrors"), - shape_type=ShapeType.LIST, - members={"member": {"target": FLOW_EXECUTION_ERROR}}, -) +GUARDRAIL_CONFIGURATION: StaticSchema = (18, n0, _GC, 0, (_gI, _gV), ((3, 1), (3, 1))) -FLOW_EXECUTION_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowExecutionStatus"), - shape_type=ShapeType.ENUM, - members={ - "RUNNING": {"target": UNIT}, - "SUCCEEDED": {"target": UNIT}, - "FAILED": {"target": UNIT}, - "TIMED_OUT": {"target": UNIT}, - "ABORTED": {"target": UNIT}, - }, -) +MAX_TOKENS: StaticSchema = (7, n0, _MTa, 0) -GET_FLOW_EXECUTION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GetFlowExecutionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#GetFlowExecutionResponse", - ) - ], - members={ - "executionArn": { - "target": FLOW_EXECUTION_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": FLOW_EXECUTION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "startedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "endedAt": {"target": DATE_TIMESTAMP}, - "errors": {"target": FLOW_EXECUTION_ERRORS}, - "flowAliasIdentifier": { - "target": FLOW_ALIAS_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "flowIdentifier": { - "target": FLOW_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "flowVersion": { - "target": VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +RAG_STOP_SEQUENCES: StaticSchema = (16, n0, _RAGSS, 0, (_me,), ((3, 0),)) -GET_FLOW_EXECUTION = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#GetFlowExecution"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/flows/{flowIdentifier}/aliases/{flowAliasIdentifier}/executions/{executionIdentifier}", - } - ), - ) - ], +TEXT_INFERENCE_CONFIG: StaticSchema = ( + 18, + n0, + _TIC, + 0, + (_tem, _tPo, _mTa, _sS), + ((TEMPERATURE, 0), (TOP_P, 0), (MAX_TOKENS, 0), (RAG_STOP_SEQUENCES, 0)), ) -FLOW_EXECUTION_EVENT_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowExecutionEventType"), - shape_type=ShapeType.ENUM, - members={"NODE": {"target": UNIT}, "FLOW": {"target": UNIT}}, +INFERENCE_CONFIG: StaticSchema = ( + 18, + n0, + _ICn, + 0, + (_tIC,), + ((TEXT_INFERENCE_CONFIG, 0),), ) -MAX_RESULTS = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#MaxResults"), - shape_type=ShapeType.INTEGER, -) +TEXT_PROMPT_TEMPLATE: StaticSchema = (3, n0, _TPT, 4) -LIST_FLOW_EXECUTION_EVENTS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ListFlowExecutionEventsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#ListFlowExecutionEventsRequest", - ) - ], - members={ - "flowIdentifier": { - "target": FLOW_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "flowAliasIdentifier": { - "target": FLOW_ALIAS_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "executionIdentifier": { - "target": FLOW_EXECUTION_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "eventType": { - "target": FLOW_EXECUTION_EVENT_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="eventType"), - ], - }, - }, +PROMPT_TEMPLATE: StaticSchema = ( + 18, + n0, + _PTrom, + 0, + (_tPT,), + ((TEXT_PROMPT_TEMPLATE, 0),), ) -SATISFIED_CONDITION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#SatisfiedCondition"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "conditionName": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +EXTERNAL_SOURCES_GENERATION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _ESGC, + 0, + (_pTr, _gC, _iCn, _aMRF, _pC), + ( + (PROMPT_TEMPLATE, 0), + (GUARDRAIL_CONFIGURATION, 0), + (INFERENCE_CONFIG, 0), + (ADDITIONAL_MODEL_REQUEST_FIELDS, 0), + (PERFORMANCE_CONFIGURATION, 0), + ), ) -SATISFIED_CONDITIONS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#SatisfiedConditions"), - shape_type=ShapeType.LIST, - members={"member": {"target": SATISFIED_CONDITION}}, -) - -CONDITION_RESULT_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ConditionResultEvent"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "nodeName": { - "target": NODE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "timestamp": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "satisfiedConditions": { - "target": SATISFIED_CONDITIONS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +CONTENT_TYPE: StaticSchema = (3, n0, _CT, 0) -FLOW_ERROR_CODE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowErrorCode"), - shape_type=ShapeType.ENUM, - members={ - "VALIDATION": {"target": UNIT}, - "INTERNAL_SERVER": {"target": UNIT}, - "NODE_EXECUTION_FAILED": {"target": UNIT}, - }, -) +IDENTIFIER: StaticSchema = (3, n0, _Id, 4) -FLOW_FAILURE_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowFailureEvent"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "timestamp": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "errorCode": { - "target": FLOW_ERROR_CODE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "errorMessage": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +BYTE_CONTENT_DOC: StaticSchema = ( + 18, + n0, + _BCD, + 0, + (_id, _cT, _da), + ((IDENTIFIER, 1), (CONTENT_TYPE, 1), (BYTE_CONTENT_BLOB, 1)), ) -FLOW_EXECUTION_CONTENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowExecutionContent"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"document": {"target": DOCUMENT}}, -) +S3_OBJECT_DOC: StaticSchema = (18, n0, _SOD, 0, (_uri,), ((S3_URI, 1),)) -NODE_INPUT_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#NodeInputName"), - shape_type=ShapeType.STRING, +EXTERNAL_SOURCE_TYPE: StaticSchema = ( + 14, + n0, + _EST, + 0, + (_S, _BC), + ((-1, {_sV: _S}), (-1, {_sV: _BC})), ) -FLOW_INPUT_FIELD = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowInputField"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "name": { - "target": NODE_INPUT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "content": { - "target": FLOW_EXECUTION_CONTENT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +EXTERNAL_SOURCE: StaticSchema = ( + 18, + n0, + _ES, + 0, + (_sTo, _sL, _bC), + ((EXTERNAL_SOURCE_TYPE, 1), (S3_OBJECT_DOC, 0), (BYTE_CONTENT_DOC, 0)), ) -FLOW_INPUT_FIELDS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowInputFields"), - shape_type=ShapeType.LIST, - members={"member": {"target": FLOW_INPUT_FIELD}}, -) - -FLOW_EXECUTION_INPUT_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowExecutionInputEvent"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "nodeName": { - "target": NODE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "timestamp": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "fields": { - "target": FLOW_INPUT_FIELDS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +EXTERNAL_SOURCES: StaticSchema = (16, n0, _ESx, 0, (_me,), ((EXTERNAL_SOURCE, 0),)) -NODE_OUTPUT_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#NodeOutputName"), - shape_type=ShapeType.STRING, +EXTERNAL_SOURCES_RETRIEVE_AND_GENERATE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _ESRAGC, + 0, + (_mA, _sou, _gCe), + ( + (BEDROCK_MODEL_ARN, 1), + (EXTERNAL_SOURCES, 1), + (EXTERNAL_SOURCES_GENERATION_CONFIGURATION, 0), + ), ) -FLOW_OUTPUT_FIELD = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowOutputField"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "name": { - "target": NODE_OUTPUT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "content": { - "target": FLOW_EXECUTION_CONTENT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +GENERATION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _GCe, + 0, + (_pTr, _gC, _iCn, _aMRF, _pC), + ( + (PROMPT_TEMPLATE, 0), + (GUARDRAIL_CONFIGURATION, 0), + (INFERENCE_CONFIG, 0), + (ADDITIONAL_MODEL_REQUEST_FIELDS, 0), + (PERFORMANCE_CONFIGURATION, 0), + ), ) -FLOW_OUTPUT_FIELDS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowOutputFields"), - shape_type=ShapeType.LIST, - members={"member": {"target": FLOW_OUTPUT_FIELD}}, -) - -FLOW_EXECUTION_OUTPUT_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowExecutionOutputEvent"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "nodeName": { - "target": NODE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "timestamp": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "fields": { - "target": FLOW_OUTPUT_FIELDS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +QUERY_TRANSFORMATION_TYPE: StaticSchema = (14, n0, _QTT, 0, (_QD,), ((-1, {_sV: _QD}),)) + +QUERY_TRANSFORMATION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _QTC, + 0, + (_t,), + ((QUERY_TRANSFORMATION_TYPE, 1),), +) + +ORCHESTRATION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _OC, + 0, + (_pTr, _iCn, _aMRF, _qTC, _pC), + ( + (PROMPT_TEMPLATE, 0), + (INFERENCE_CONFIG, 0), + (ADDITIONAL_MODEL_REQUEST_FIELDS, 0), + (QUERY_TRANSFORMATION_CONFIGURATION, 0), + (PERFORMANCE_CONFIGURATION, 0), + ), ) -NODE_ACTION_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#NodeActionEvent"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "nodeName": { - "target": NODE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "timestamp": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "requestId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "serviceName": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "operationName": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "operationRequest": {"target": DOCUMENT}, - "operationResponse": {"target": DOCUMENT}, - }, +RETRIEVE_AND_GENERATE_TYPE: StaticSchema = ( + 14, + n0, + _RAGT, + 0, + (_KB, _ES_), + ((-1, {_sV: _KB}), (-1, {_sV: _ES_})), +) + +RETRIEVE_AND_GENERATE_SESSION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _RAGSC, + 0, + (_kKA,), + ((KMS_KEY_ARN, 1),), +) + +GUADRAIL_ACTION: StaticSchema = ( + 14, + n0, + _GAua, + 0, + (_INTERVENED, _NONE), + ((-1, {_sV: _INTERVENED}), (-1, {_sV: _NONE})), +) + +RETRIEVE_AND_GENERATE_OUTPUT: StaticSchema = (18, n0, _RAGO, 4, (_te,), ((3, 1),)) + +RETRIEVE_AND_GENERATE_OPERATION_OUTPUT: StaticSchema = ( + 18, + n0, + _RAGOO, + {_sSI: _cRAGR, _smithy: None}, + (_sIe, _o, _ci, _gA), + ( + (SESSION_ID, 1), + (RETRIEVE_AND_GENERATE_OUTPUT, 1), + (CITATIONS, 0), + (GUADRAIL_ACTION, 0), + ), ) -NODE_TRACE_ELEMENTS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#NodeTraceElements"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"agentTraces": {"target": AGENT_TRACES}}, -) - -NODE_DEPENDENCY_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#NodeDependencyEvent"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "nodeName": { - "target": NODE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "timestamp": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "traceElements": { - "target": NODE_TRACE_ELEMENTS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +CITATION_EVENT: StaticSchema = ( + 18, + n0, + _CEi, + 0, + (_cit, _gRP, _rRe), + ((CITATION, 0), (GENERATED_RESPONSE_PART, 0), (RETRIEVED_REFERENCES, 0)), +) + +GUARDRAIL_EVENT: StaticSchema = (18, n0, _GE, 0, (_ac,), ((GUADRAIL_ACTION, 0),)) + +RETRIEVE_AND_GENERATE_OUTPUT_EVENT: StaticSchema = ( + 18, + n0, + _RAGOE, + 4, + (_te,), + ((3, 1),), +) + +RETRIEVE_AND_GENERATE_STREAM_RESPONSE_OUTPUT: StaticSchema = ( + 19, + n0, + _RAGSRO, + {_smith: None}, + (_o, _cit, _gu, _iSE, _vE, _rNFE, _sQEE, _tEh, _aDE, _cE, _dFE, _bGE), + ( + (RETRIEVE_AND_GENERATE_OUTPUT_EVENT, 0), + (CITATION_EVENT, 0), + (GUARDRAIL_EVENT, 0), + (INTERNAL_SERVER_EXCEPTION, 0), + (VALIDATION_EXCEPTION, 0), + (RESOURCE_NOT_FOUND_EXCEPTION, 0), + (SERVICE_QUOTA_EXCEEDED_EXCEPTION, 0), + (THROTTLING_EXCEPTION, 0), + (ACCESS_DENIED_EXCEPTION, 0), + (CONFLICT_EXCEPTION, 0), + (DEPENDENCY_FAILED_EXCEPTION, 0), + (BAD_GATEWAY_EXCEPTION, 0), + ), ) -NODE_ERROR_CODE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#NodeErrorCode"), - shape_type=ShapeType.ENUM, - members={ - "VALIDATION": {"target": UNIT}, - "DEPENDENCY_FAILED": {"target": UNIT}, - "BAD_GATEWAY": {"target": UNIT}, - "INTERNAL_SERVER": {"target": UNIT}, - }, +RETRIEVE_AND_GENERATE_STREAM_OUTPUT: StaticSchema = ( + 18, + n0, + _RAGSO, + {_sSI: _cRAGSR, _smithy: None}, + (_str, _sIe), + ( + (RETRIEVE_AND_GENERATE_STREAM_RESPONSE_OUTPUT, 17), + (SESSION_ID, {_sH: _xabkbsi, _smi: None}), + ), ) -NODE_FAILURE_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#NodeFailureEvent"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "nodeName": { - "target": NODE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "timestamp": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "errorCode": { - "target": NODE_ERROR_CODE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "errorMessage": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +INPUT_IMAGE_FORMAT: StaticSchema = ( + 14, + n0, + _IIFn, + 0, + (_pn, _j, _g, _w), + ((-1, {_sV: _pn}), (-1, {_sV: _j}), (-1, {_sV: _g}), (-1, {_sV: _w})), +) + +INPUT_IMAGE: StaticSchema = ( + 18, + n0, + _IInp, + 0, + (_fo, _iCnl), + ((INPUT_IMAGE_FORMAT, 1), (BYTE_CONTENT_BLOB, 1)), +) + +KNOWLEDGE_BASE_QUERY_TYPE: StaticSchema = ( + 14, + n0, + _KBQT, + 0, + (_TEXT, _IMAGE), + ((-1, {_sV: _TEXT}), (-1, {_sV: _IMAGE})), +) + +KNOWLEDGE_BASE_QUERY: StaticSchema = ( + 18, + n0, + _KBQ, + 4, + (_t, _te, _ima), + ((KNOWLEDGE_BASE_QUERY_TYPE, {_smit: _TEXT}), (3, {_smit: _v_}), (INPUT_IMAGE, 0)), +) + +KNOWLEDGE_BASE_RETRIEVAL_RESULT: StaticSchema = ( + 18, + n0, + _KBRR, + 0, + (_co, _lo, _sc, _met, _dI), + ( + (RETRIEVAL_RESULT_CONTENT, 1), + (RETRIEVAL_RESULT_LOCATION, 0), + (10, 0), + (RETRIEVAL_RESULT_METADATA, 0), + (DOCUMENT_ID, 0), + ), ) -FLOW_NODE_INPUT_CATEGORY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowNodeInputCategory"), - shape_type=ShapeType.ENUM, - members={ - "LOOP_CONDITION": {"target": UNIT}, - "RETURN_VALUE_TO_LOOP_START": {"target": UNIT}, - "EXIT_LOOP": {"target": UNIT}, - }, +KNOWLEDGE_BASE_RETRIEVAL_RESULTS: StaticSchema = ( + 16, + n0, + _KBRRn, + 4, + (_me,), + ((KNOWLEDGE_BASE_RETRIEVAL_RESULT, 0),), ) -NODE_EXECUTION_CONTENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#NodeExecutionContent"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"document": {"target": DOCUMENT}}, +RETRIEVE_OUTPUT: StaticSchema = ( + 18, + n0, + _ROe, + {_sSI: _cRRom, _smithy: None}, + (_rRet, _gA, _nT), + ((KNOWLEDGE_BASE_RETRIEVAL_RESULTS, 1), (GUADRAIL_ACTION, 0), (NEXT_TOKEN, 0)), ) -FLOW_CONTROL_NODE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowControlNodeType"), - shape_type=ShapeType.ENUM, - members={"ITERATOR": {"target": UNIT}, "LOOP": {"target": UNIT}}, -) +SESSION_METADATA_KEY: StaticSchema = (3, n0, _SMK, 0) -NODE_INPUT_EXECUTION_CHAIN_ITEM = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#NodeInputExecutionChainItem"), - members={ - "nodeName": { - "target": NODE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "index": {"target": INTEGER}, - "type": { - "target": FLOW_CONTROL_NODE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +SESSION_METADATA_VALUE: StaticSchema = (3, n0, _SMV, 0) -NODE_INPUT_EXECUTION_CHAIN = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#NodeInputExecutionChain"), - shape_type=ShapeType.LIST, - members={"member": {"target": NODE_INPUT_EXECUTION_CHAIN_ITEM}}, +SESSION_METADATA_MAP: StaticSchema = ( + 17, + n0, + _SMM, + 0, + (_k, _v), + ((SESSION_METADATA_KEY, 0), (SESSION_METADATA_VALUE, 0)), ) -FLOW_NODE_INPUT_EXPRESSION = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowNodeInputExpression"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) +TAG_KEY: StaticSchema = (3, n0, _TKa, 0) -FLOW_NODE_OUTPUT_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowNodeOutputName"), - shape_type=ShapeType.STRING, -) +TAG_VALUE: StaticSchema = (3, n0, _TV, 0) -NODE_INPUT_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#NodeInputSource"), - members={ - "nodeName": { - "target": NODE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "outputFieldName": { - "target": FLOW_NODE_OUTPUT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "expression": { - "target": FLOW_NODE_INPUT_EXPRESSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +TAGS_MAP: StaticSchema = (17, n0, _TM, 0, (_k, _v), ((TAG_KEY, 0), (TAG_VALUE, 0))) -FLOW_NODE_IO_DATA_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowNodeIODataType"), - shape_type=ShapeType.ENUM, - members={ - "STRING": {"target": UNIT}, - "NUMBER": {"target": UNIT}, - "BOOLEAN": {"target": UNIT}, - "OBJECT": {"target": UNIT}, - "ARRAY": {"target": UNIT}, - }, +CREATE_SESSION_INPUT: StaticSchema = ( + 18, + n0, + _CSI, + {_sSI: _cCSR, _smithya: None}, + (_sMe, _eKA, _ta), + ((SESSION_METADATA_MAP, 0), (KMS_KEY_ARN, 0), (TAGS_MAP, 0)), ) -NODE_INPUT_FIELD = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#NodeInputField"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "name": { - "target": NODE_INPUT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "content": { - "target": NODE_EXECUTION_CONTENT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "source": {"target": NODE_INPUT_SOURCE}, - "type": {"target": FLOW_NODE_IO_DATA_TYPE}, - "category": {"target": FLOW_NODE_INPUT_CATEGORY}, - "executionChain": {"target": NODE_INPUT_EXECUTION_CHAIN}, - }, -) +SESSION_ARN: StaticSchema = (3, n0, _SA, 0) -NODE_INPUT_FIELDS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#NodeInputFields"), - shape_type=ShapeType.LIST, - members={"member": {"target": NODE_INPUT_FIELD}}, -) - -NODE_INPUT_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#NodeInputEvent"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "nodeName": { - "target": NODE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "timestamp": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "fields": { - "target": NODE_INPUT_FIELDS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +UUID: StaticSchema = (3, n0, _Uu, 0) -FLOW_NODE_INPUT_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowNodeInputName"), - shape_type=ShapeType.STRING, +SESSION_STATUS: StaticSchema = ( + 14, + n0, + _SSe, + 0, + (_ACTIVE, _EXPIRED, _ENDED), + ((-1, {_sV: _ACTIVE}), (-1, {_sV: _EXPIRED}), (-1, {_sV: _ENDED})), ) -NODE_OUTPUT_NEXT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#NodeOutputNext"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "nodeName": { - "target": NODE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "inputFieldName": { - "target": FLOW_NODE_INPUT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +CREATE_SESSION_OUTPUT: StaticSchema = ( + 18, + n0, + _CSO, + {_sSI: _cCSRo, _smithy: None}, + (_sIe, _sAes, _sSes, _cA), + ((UUID, 1), (SESSION_ARN, 1), (SESSION_STATUS, 1), (DATE_TIMESTAMP, 1)), ) -NODE_OUTPUT_NEXT_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#NodeOutputNextList"), - shape_type=ShapeType.LIST, - members={"member": {"target": NODE_OUTPUT_NEXT}}, -) - -NODE_OUTPUT_FIELD = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#NodeOutputField"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "name": { - "target": NODE_OUTPUT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "content": { - "target": NODE_EXECUTION_CONTENT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "next": {"target": NODE_OUTPUT_NEXT_LIST}, - "type": {"target": FLOW_NODE_IO_DATA_TYPE}, - }, +CREATE_SESSION: StaticOperationSchema = ( + 23, + n0, + _CSr, + {_smithyap: MappingProxyType({"code": 201, "method": "PUT", "uri": "/sessions/"})}, + CREATE_SESSION_INPUT, + CREATE_SESSION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -NODE_OUTPUT_FIELDS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#NodeOutputFields"), - shape_type=ShapeType.LIST, - members={"member": {"target": NODE_OUTPUT_FIELD}}, -) - -NODE_OUTPUT_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#NodeOutputEvent"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "nodeName": { - "target": NODE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "timestamp": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "fields": { - "target": NODE_OUTPUT_FIELDS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +SESSION_IDENTIFIER: StaticSchema = (3, n0, _SIes, 0) -FLOW_EXECUTION_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowExecutionEvent"), - shape_type=ShapeType.UNION, - members={ - "flowInputEvent": {"target": FLOW_EXECUTION_INPUT_EVENT}, - "flowOutputEvent": {"target": FLOW_EXECUTION_OUTPUT_EVENT}, - "nodeInputEvent": {"target": NODE_INPUT_EVENT}, - "nodeOutputEvent": {"target": NODE_OUTPUT_EVENT}, - "conditionResultEvent": {"target": CONDITION_RESULT_EVENT}, - "nodeFailureEvent": {"target": NODE_FAILURE_EVENT}, - "flowFailureEvent": {"target": FLOW_FAILURE_EVENT}, - "nodeActionEvent": {"target": NODE_ACTION_EVENT}, - "nodeDependencyEvent": {"target": NODE_DEPENDENCY_EVENT}, - }, +DELETE_SESSION_INPUT: StaticSchema = ( + 18, + n0, + _DSIe, + {_sSI: _cDSR, _smithya: None}, + (_sIes,), + ((SESSION_IDENTIFIER, 9),), ) -FLOW_EXECUTION_EVENTS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowExecutionEvents"), - shape_type=ShapeType.LIST, - members={"member": {"target": FLOW_EXECUTION_EVENT}}, -) +DELETE_SESSION_OUTPUT: StaticSchema = (18, n0, _DSO, {_sSI: _cDSRo, _smithy: None}) -LIST_FLOW_EXECUTION_EVENTS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ListFlowExecutionEventsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#ListFlowExecutionEventsResponse", +DELETE_SESSION: StaticOperationSchema = ( + 23, + n0, + _DSe, + { + _smithyap: MappingProxyType( + {"code": 200, "method": "DELETE", "uri": "/sessions/{sessionIdentifier}/"} ) - ], - members={ - "flowExecutionEvents": { - "target": FLOW_EXECUTION_EVENTS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": NEXT_TOKEN}, }, + DELETE_SESSION_INPUT, + DELETE_SESSION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -LIST_FLOW_EXECUTION_EVENTS = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#ListFlowExecutionEvents"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/flows/{flowIdentifier}/aliases/{flowAliasIdentifier}/executions/{executionIdentifier}/events", - } - ), - ) - ], +END_SESSION_INPUT: StaticSchema = ( + 18, + n0, + _ESI, + {_sSI: _cESR, _smithya: None}, + (_sIes,), + ((SESSION_IDENTIFIER, 9),), ) -LIST_FLOW_EXECUTIONS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ListFlowExecutionsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#ListFlowExecutionsRequest", - ) - ], - members={ - "flowIdentifier": { - "target": FLOW_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "flowAliasIdentifier": { - "target": FLOW_ALIAS_IDENTIFIER, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpQuery"), value="flowAliasIdentifier" - ) - ], - }, - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - }, +END_SESSION_OUTPUT: StaticSchema = ( + 18, + n0, + _ESO, + {_sSI: _cESRo, _smithy: None}, + (_sIe, _sAes, _sSes), + ((UUID, 1), (SESSION_ARN, 1), (SESSION_STATUS, 1)), ) -FLOW_EXECUTION_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowExecutionSummary"), - members={ - "executionArn": { - "target": FLOW_EXECUTION_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "flowAliasIdentifier": { - "target": FLOW_ALIAS_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "flowIdentifier": { - "target": FLOW_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "flowVersion": { - "target": VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": FLOW_EXECUTION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "endedAt": {"target": DATE_TIMESTAMP}, +END_SESSION: StaticOperationSchema = ( + 23, + n0, + _ESn, + { + _smithyap: MappingProxyType( + {"code": 200, "method": "PATCH", "uri": "/sessions/{sessionIdentifier}"} + ) }, + END_SESSION_INPUT, + END_SESSION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -FLOW_EXECUTION_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowExecutionSummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": FLOW_EXECUTION_SUMMARY}}, +GET_SESSION_INPUT: StaticSchema = ( + 18, + n0, + _GSI, + {_sSI: _cGSR, _smithya: None}, + (_sIes,), + ((SESSION_IDENTIFIER, 9),), +) + +GET_SESSION_OUTPUT: StaticSchema = ( + 18, + n0, + _GSO, + {_sSI: _cGSRo, _smithy: None}, + (_sIe, _sAes, _sSes, _cA, _lUA, _sMe, _eKA), + ( + (UUID, 1), + (SESSION_ARN, 1), + (SESSION_STATUS, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (SESSION_METADATA_MAP, 0), + (KMS_KEY_ARN, 0), + ), ) -LIST_FLOW_EXECUTIONS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ListFlowExecutionsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#ListFlowExecutionsResponse", +GET_SESSION: StaticOperationSchema = ( + 23, + n0, + _GS, + { + _smithyap: MappingProxyType( + {"code": 200, "method": "GET", "uri": "/sessions/{sessionIdentifier}/"} ) - ], - members={ - "flowExecutionSummaries": { - "target": FLOW_EXECUTION_SUMMARIES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": NEXT_TOKEN}, }, + GET_SESSION_INPUT, + GET_SESSION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -LIST_FLOW_EXECUTIONS = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#ListFlowExecutions"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/flows/{flowIdentifier}/executions", - } - ), +INVOCATION_DESCRIPTION: StaticSchema = (3, n0, _ID, 0) + +CREATE_INVOCATION_INPUT: StaticSchema = ( + 18, + n0, + _CII, + {_sSI: _cCIR, _smithya: None}, + (_iI, _d, _sIes), + ((UUID, 0), (INVOCATION_DESCRIPTION, 0), (SESSION_IDENTIFIER, 9)), +) + +CREATE_INVOCATION_OUTPUT: StaticSchema = ( + 18, + n0, + _CIO, + {_sSI: _cCIRo, _smithy: None}, + (_sIe, _iI, _cA), + ((UUID, 1), (UUID, 1), (DATE_TIMESTAMP, 1)), +) + +CREATE_INVOCATION: StaticOperationSchema = ( + 23, + n0, + _CIr, + { + _smithyap: MappingProxyType( + { + "code": 201, + "method": "PUT", + "uri": "/sessions/{sessionIdentifier}/invocations/", + } ) - ], -) - -FLOW_EXECUTION_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowExecutionName"), - shape_type=ShapeType.STRING, -) - -FLOW_INPUT_CONTENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowInputContent"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"document": {"target": DOCUMENT}}, -) - -FLOW_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowInput"), - members={ - "nodeName": { - "target": NODE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nodeOutputName": {"target": NODE_OUTPUT_NAME}, - "content": { - "target": FLOW_INPUT_CONTENT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nodeInputName": {"target": NODE_INPUT_NAME}, }, + CREATE_INVOCATION_INPUT, + CREATE_INVOCATION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -FLOW_INPUTS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowInputs"), - shape_type=ShapeType.LIST, - members={"member": {"target": FLOW_INPUT}}, -) - -PERFORMANCE_CONFIG_LATENCY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#PerformanceConfigLatency"), - shape_type=ShapeType.ENUM, - members={"STANDARD": {"target": UNIT}, "OPTIMIZED": {"target": UNIT}}, -) - -PERFORMANCE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#PerformanceConfiguration"), - members={ - "latency": { - "target": PERFORMANCE_CONFIG_LATENCY, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="standard")], - } - }, -) +INVOCATION_IDENTIFIER: StaticSchema = (3, n0, _IInvo, 0) -MODEL_PERFORMANCE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ModelPerformanceConfiguration"), - members={"performanceConfig": {"target": PERFORMANCE_CONFIGURATION}}, +LIST_INVOCATIONS_INPUT: StaticSchema = ( + 18, + n0, + _LII, + {_sSI: _cLIR, _smithya: None}, + (_nT, _mRa, _sIes), + ( + (NEXT_TOKEN, {_sQ: _nT}), + (MAX_RESULTS, {_smit: 10, _sQ: _mRa}), + (SESSION_IDENTIFIER, 9), + ), ) -START_FLOW_EXECUTION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#StartFlowExecutionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#StartFlowExecutionRequest", +INVOCATION_SUMMARY: StaticSchema = ( + 18, + n0, + _ISn, + 0, + (_sIe, _iI, _cA), + ((UUID, 1), (UUID, 1), (DATE_TIMESTAMP, 1)), +) + +INVOCATION_SUMMARIES: StaticSchema = ( + 16, + n0, + _ISnv, + 0, + (_me,), + ((INVOCATION_SUMMARY, 0),), +) + +LIST_INVOCATIONS_OUTPUT: StaticSchema = ( + 18, + n0, + _LIO, + {_sSI: _cLIRo, _smithy: None}, + (_iS, _nT), + ((INVOCATION_SUMMARIES, 1), (NEXT_TOKEN, 0)), +) + +LIST_INVOCATIONS: StaticOperationSchema = ( + 23, + n0, + _LI, + { + _smithyap: MappingProxyType( + { + "code": 200, + "method": "POST", + "uri": "/sessions/{sessionIdentifier}/invocations/", + } ) - ], - members={ - "flowIdentifier": { - "target": FLOW_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "flowAliasIdentifier": { - "target": FLOW_ALIAS_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "flowExecutionName": {"target": FLOW_EXECUTION_NAME}, - "inputs": { - "target": FLOW_INPUTS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelPerformanceConfiguration": {"target": MODEL_PERFORMANCE_CONFIGURATION}, }, + LIST_INVOCATIONS_INPUT, + LIST_INVOCATIONS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -START_FLOW_EXECUTION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#StartFlowExecutionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#StartFlowExecutionResponse", - ) - ], - members={"executionArn": {"target": FLOW_EXECUTION_IDENTIFIER}}, -) - -START_FLOW_EXECUTION = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#StartFlowExecution"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "POST", - "uri": "/flows/{flowIdentifier}/aliases/{flowAliasIdentifier}/executions", - } - ), - ) - ], +GET_INVOCATION_STEP_INPUT: StaticSchema = ( + 18, + n0, + _GISI, + {_sSI: _cGISR, _smithya: None}, + (_iInvo, _iSI, _sIes), + ((INVOCATION_IDENTIFIER, 1), (UUID, 9), (SESSION_IDENTIFIER, 9)), +) + +IMAGE_FORMAT: StaticSchema = ( + 14, + n0, + _IFm, + 0, + (_PNG, _JPEG, _GIF, _WEBP), + ((-1, {_sV: _pn}), (-1, {_sV: _j}), (-1, {_sV: _g}), (-1, {_sV: _w})), +) + +S3_LOCATION: StaticSchema = (18, n0, _SLo, 0, (_uri,), ((S3_URI, 1),)) + +IMAGE_SOURCE: StaticSchema = (19, n0, _ISm, 0, (_by, _sL), ((1, 0), (S3_LOCATION, 0))) + +IMAGE_BLOCK: StaticSchema = ( + 18, + n0, + _IB, + 0, + (_fo, _so), + ((IMAGE_FORMAT, 1), (IMAGE_SOURCE, 1)), +) + +BEDROCK_SESSION_CONTENT_BLOCK: StaticSchema = ( + 19, + n0, + _BSCB, + 4, + (_te, _ima), + ((3, 0), (IMAGE_BLOCK, 0)), +) + +BEDROCK_SESSION_CONTENT_BLOCKS: StaticSchema = ( + 16, + n0, + _BSCBe, + 0, + (_me,), + ((BEDROCK_SESSION_CONTENT_BLOCK, 0),), +) + +INVOCATION_STEP_PAYLOAD: StaticSchema = ( + 19, + n0, + _ISP, + 0, + (_cB,), + ((BEDROCK_SESSION_CONTENT_BLOCKS, 0),), +) + +INVOCATION_STEP: StaticSchema = ( + 18, + n0, + _ISnvo, + 0, + (_sIe, _iI, _iSI, _iST, _pa), + ( + (UUID, 1), + (UUID, 1), + (UUID, 1), + (DATE_TIMESTAMP, 1), + (INVOCATION_STEP_PAYLOAD, 1), + ), ) -STOP_FLOW_EXECUTION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#StopFlowExecutionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#StopFlowExecutionRequest", +GET_INVOCATION_STEP_OUTPUT: StaticSchema = ( + 18, + n0, + _GISO, + {_sSI: _cGISRo, _smithy: None}, + (_iSn,), + ((INVOCATION_STEP, 1),), +) + +GET_INVOCATION_STEP: StaticOperationSchema = ( + 23, + n0, + _GIS, + { + _smithyap: MappingProxyType( + { + "code": 200, + "method": "POST", + "uri": "/sessions/{sessionIdentifier}/invocationSteps/{invocationStepId}", + } ) - ], - members={ - "flowIdentifier": { - "target": FLOW_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "flowAliasIdentifier": { - "target": FLOW_ALIAS_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "executionIdentifier": { - "target": FLOW_EXECUTION_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, }, + GET_INVOCATION_STEP_INPUT, + GET_INVOCATION_STEP_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -STOP_FLOW_EXECUTION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#StopFlowExecutionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#StopFlowExecutionResponse", - ) - ], - members={ - "executionArn": {"target": FLOW_EXECUTION_IDENTIFIER}, - "status": { - "target": FLOW_EXECUTION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +LIST_INVOCATION_STEPS_INPUT: StaticSchema = ( + 18, + n0, + _LISI, + {_sSI: _cLISR, _smithya: None}, + (_iInvo, _nT, _mRa, _sIes), + ( + (INVOCATION_IDENTIFIER, 0), + (NEXT_TOKEN, {_sQ: _nT}), + (MAX_RESULTS, {_smit: 10, _sQ: _mRa}), + (SESSION_IDENTIFIER, 9), + ), ) -STOP_FLOW_EXECUTION = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#StopFlowExecution"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "POST", - "uri": "/flows/{flowIdentifier}/aliases/{flowAliasIdentifier}/executions/{executionIdentifier}/stop", - } - ), +INVOCATION_STEP_SUMMARY: StaticSchema = ( + 18, + n0, + _ISSn, + 0, + (_sIe, _iI, _iSI, _iST), + ((UUID, 1), (UUID, 1), (UUID, 1), (DATE_TIMESTAMP, 1)), +) + +INVOCATION_STEP_SUMMARIES: StaticSchema = ( + 16, + n0, + _ISSnv, + 0, + (_me,), + ((INVOCATION_STEP_SUMMARY, 0),), +) + +LIST_INVOCATION_STEPS_OUTPUT: StaticSchema = ( + 18, + n0, + _LISO, + {_sSI: _cLISRo, _smithy: None}, + (_iSS, _nT), + ((INVOCATION_STEP_SUMMARIES, 1), (NEXT_TOKEN, 0)), +) + +LIST_INVOCATION_STEPS: StaticOperationSchema = ( + 23, + n0, + _LIS, + { + _smithyap: MappingProxyType( + { + "code": 200, + "method": "POST", + "uri": "/sessions/{sessionIdentifier}/invocationSteps/", + } ) - ], + }, + LIST_INVOCATION_STEPS_INPUT, + LIST_INVOCATION_STEPS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -FLOW_EXECUTION_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowExecutionId"), - shape_type=ShapeType.STRING, +PUT_INVOCATION_STEP_INPUT: StaticSchema = ( + 18, + n0, + _PISI, + {_sSI: _cPISR, _smithya: None}, + (_sIes, _iInvo, _iST, _pa, _iSI), + ( + (SESSION_IDENTIFIER, 9), + (INVOCATION_IDENTIFIER, 1), + (DATE_TIMESTAMP, 1), + (INVOCATION_STEP_PAYLOAD, 1), + (UUID, 0), + ), ) -INVOKE_FLOW_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#InvokeFlowInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#InvokeFlowRequest", +PUT_INVOCATION_STEP_OUTPUT: StaticSchema = ( + 18, + n0, + _PISO, + {_sSI: _cPISRo, _smithy: None}, + (_iSI,), + ((UUID, 1),), +) + +PUT_INVOCATION_STEP: StaticOperationSchema = ( + 23, + n0, + _PIS, + { + _smithyap: MappingProxyType( + { + "code": 201, + "method": "PUT", + "uri": "/sessions/{sessionIdentifier}/invocationSteps/", + } ) - ], - members={ - "flowIdentifier": { - "target": FLOW_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "flowAliasIdentifier": { - "target": FLOW_ALIAS_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "inputs": { - "target": FLOW_INPUTS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "enableTrace": {"target": BOOLEAN}, - "modelPerformanceConfiguration": {"target": MODEL_PERFORMANCE_CONFIGURATION}, - "executionId": {"target": FLOW_EXECUTION_ID}, }, + PUT_INVOCATION_STEP_INPUT, + PUT_INVOCATION_STEP_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -FLOW_COMPLETION_REASON = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowCompletionReason"), - shape_type=ShapeType.ENUM, - members={"SUCCESS": {"target": UNIT}, "INPUT_REQUIRED": {"target": UNIT}}, +LIST_SESSIONS_INPUT: StaticSchema = ( + 18, + n0, + _LSI, + {_sSI: _cLSR, _smithya: None}, + (_mRa, _nT), + ((MAX_RESULTS, {_smit: 10, _sQ: _mRa}), (NEXT_TOKEN, {_sQ: _nT})), +) + +SESSION_SUMMARY: StaticSchema = ( + 18, + n0, + _SSes, + 0, + (_sIe, _sAes, _sSes, _cA, _lUA), + ( + (UUID, 1), + (SESSION_ARN, 1), + (SESSION_STATUS, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + ), ) -FLOW_COMPLETION_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowCompletionEvent"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "completionReason": { - "target": FLOW_COMPLETION_REASON, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +SESSION_SUMMARIES: StaticSchema = (16, n0, _SSess, 0, (_me,), ((SESSION_SUMMARY, 0),)) + +LIST_SESSIONS_OUTPUT: StaticSchema = ( + 18, + n0, + _LSO, + {_sSI: _cLSRo, _smithy: None}, + (_sSess, _nT), + ((SESSION_SUMMARIES, 1), (NEXT_TOKEN, 0)), +) + +LIST_SESSIONS: StaticOperationSchema = ( + 23, + n0, + _LS, + {_smithyap: MappingProxyType({"code": 200, "method": "POST", "uri": "/sessions/"})}, + LIST_SESSIONS_INPUT, + LIST_SESSIONS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -FLOW_MULTI_TURN_INPUT_CONTENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowMultiTurnInputContent"), - shape_type=ShapeType.UNION, - members={"document": {"target": DOCUMENT}}, +UPDATE_SESSION_INPUT: StaticSchema = ( + 18, + n0, + _USI, + {_sSI: _cUSR, _smithya: None}, + (_sMe, _sIes), + ((SESSION_METADATA_MAP, 0), (SESSION_IDENTIFIER, 9)), +) + +UPDATE_SESSION_OUTPUT: StaticSchema = ( + 18, + n0, + _USO, + {_sSI: _cUSRo, _smithy: None}, + (_sIe, _sAes, _sSes, _cA, _lUA), + ( + (UUID, 1), + (SESSION_ARN, 1), + (SESSION_STATUS, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + ), ) -NODE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#NodeType"), - shape_type=ShapeType.ENUM, - members={ - "FLOW_INPUT_NODE": {"target": UNIT}, - "FLOW_OUTPUT_NODE": {"target": UNIT}, - "LAMBDA_FUNCTION_NODE": {"target": UNIT}, - "KNOWLEDGE_BASE_NODE": {"target": UNIT}, - "PROMPT_NODE": {"target": UNIT}, - "CONDITION_NODE": {"target": UNIT}, - "LEX_NODE": {"target": UNIT}, +UPDATE_SESSION: StaticOperationSchema = ( + 23, + n0, + _US, + { + _smithyap: MappingProxyType( + {"code": 200, "method": "PUT", "uri": "/sessions/{sessionIdentifier}/"} + ) }, + UPDATE_SESSION_INPUT, + UPDATE_SESSION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -FLOW_MULTI_TURN_INPUT_REQUEST_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowMultiTurnInputRequestEvent"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "nodeName": { - "target": NODE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nodeType": { - "target": NODE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "content": { - "target": FLOW_MULTI_TURN_INPUT_CONTENT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +TAGGABLE_RESOURCES_ARN: StaticSchema = (3, n0, _TRA, 0) -FLOW_OUTPUT_CONTENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowOutputContent"), - shape_type=ShapeType.UNION, - members={"document": {"target": DOCUMENT}}, -) - -FLOW_OUTPUT_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowOutputEvent"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "nodeName": { - "target": NODE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nodeType": { - "target": NODE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "content": { - "target": FLOW_OUTPUT_CONTENT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +LIST_TAGS_FOR_RESOURCE_INPUT: StaticSchema = ( + 18, + n0, + _LTFRI, + {_sSI: _cLTFRR, _smithya: None}, + (_rA,), + ((TAGGABLE_RESOURCES_ARN, 9),), ) -FLOW_TRACE_CONDITION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowTraceCondition"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "conditionName": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +LIST_TAGS_FOR_RESOURCE_OUTPUT: StaticSchema = ( + 18, + n0, + _LTFRO, + {_sSI: _cLTFRRo, _smithy: None}, + (_ta,), + ((TAGS_MAP, 0),), ) -FLOW_TRACE_CONDITIONS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowTraceConditions"), - shape_type=ShapeType.LIST, - members={"member": {"target": FLOW_TRACE_CONDITION}}, -) - -FLOW_TRACE_CONDITION_NODE_RESULT_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowTraceConditionNodeResultEvent"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "nodeName": { - "target": NODE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "timestamp": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "satisfiedConditions": { - "target": FLOW_TRACE_CONDITIONS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, +LIST_TAGS_FOR_RESOURCE: StaticOperationSchema = ( + 23, + n0, + _LTFR, + { + _smithyap: MappingProxyType( + {"code": 200, "method": "GET", "uri": "/tags/{resourceArn}"} + ) }, + LIST_TAGS_FOR_RESOURCE_INPUT, + LIST_TAGS_FOR_RESOURCE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -FLOW_TRACE_NODE_ACTION_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowTraceNodeActionEvent"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "nodeName": { - "target": NODE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "timestamp": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "requestId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "serviceName": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "operationName": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "operationRequest": {"target": DOCUMENT}, - "operationResponse": {"target": DOCUMENT}, - }, +TAG_RESOURCE_INPUT: StaticSchema = ( + 18, + n0, + _TRI, + {_sSI: _cTRR, _smithya: None}, + (_rA, _ta), + ((TAGGABLE_RESOURCES_ARN, 9), (TAGS_MAP, 1)), ) -TRACE_ELEMENTS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#TraceElements"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"agentTraces": {"target": AGENT_TRACES}}, -) - -FLOW_TRACE_DEPENDENCY_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowTraceDependencyEvent"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "nodeName": { - "target": NODE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "timestamp": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "traceElements": { - "target": TRACE_ELEMENTS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +TAG_RESOURCE_OUTPUT: StaticSchema = (18, n0, _TRO, {_sSI: _cTRRo, _smithy: None}) -FLOW_TRACE_NODE_INPUT_CONTENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowTraceNodeInputContent"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"document": {"target": DOCUMENT}}, -) - -FLOW_TRACE_NODE_INPUT_EXECUTION_CHAIN_ITEM = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentruntime#FlowTraceNodeInputExecutionChainItem" - ), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "nodeName": { - "target": NODE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "index": {"target": INTEGER}, - "type": { - "target": FLOW_CONTROL_NODE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, +TAG_RESOURCE: StaticOperationSchema = ( + 23, + n0, + _TR, + { + _smithyap: MappingProxyType( + {"code": 200, "method": "POST", "uri": "/tags/{resourceArn}"} + ) }, + TAG_RESOURCE_INPUT, + TAG_RESOURCE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -FLOW_TRACE_NODE_INPUT_EXECUTION_CHAIN = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowTraceNodeInputExecutionChain"), - shape_type=ShapeType.LIST, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"member": {"target": FLOW_TRACE_NODE_INPUT_EXECUTION_CHAIN_ITEM}}, -) - -FLOW_TRACE_NODE_INPUT_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowTraceNodeInputSource"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "nodeName": { - "target": NODE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "outputFieldName": { - "target": FLOW_NODE_OUTPUT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "expression": { - "target": FLOW_NODE_INPUT_EXPRESSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +TAG_KEY_LIST: StaticSchema = (16, n0, _TKL, 0, (_me,), ((TAG_KEY, 0),)) -FLOW_TRACE_NODE_INPUT_FIELD = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowTraceNodeInputField"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "nodeInputName": { - "target": NODE_INPUT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "content": { - "target": FLOW_TRACE_NODE_INPUT_CONTENT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "source": {"target": FLOW_TRACE_NODE_INPUT_SOURCE}, - "type": {"target": FLOW_NODE_IO_DATA_TYPE}, - "category": {"target": FLOW_NODE_INPUT_CATEGORY}, - "executionChain": {"target": FLOW_TRACE_NODE_INPUT_EXECUTION_CHAIN}, - }, +UNTAG_RESOURCE_INPUT: StaticSchema = ( + 18, + n0, + _URI, + {_sSI: _cURR, _smithya: None}, + (_rA, _tKa), + ((TAGGABLE_RESOURCES_ARN, 9), (TAG_KEY_LIST, {_sQ: _tKa, _smi: None})), ) -FLOW_TRACE_NODE_INPUT_FIELDS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowTraceNodeInputFields"), - shape_type=ShapeType.LIST, - members={"member": {"target": FLOW_TRACE_NODE_INPUT_FIELD}}, -) - -FLOW_TRACE_NODE_INPUT_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowTraceNodeInputEvent"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "nodeName": { - "target": NODE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "timestamp": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "fields": { - "target": FLOW_TRACE_NODE_INPUT_FIELDS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +UNTAG_RESOURCE_OUTPUT: StaticSchema = (18, n0, _URO, {_sSI: _cURRo, _smithy: None}) -FLOW_TRACE_NODE_OUTPUT_CONTENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowTraceNodeOutputContent"), - shape_type=ShapeType.UNION, - members={"document": {"target": DOCUMENT}}, -) - -FLOW_TRACE_NODE_OUTPUT_NEXT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowTraceNodeOutputNext"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "nodeName": { - "target": NODE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "inputFieldName": { - "target": FLOW_NODE_INPUT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, +UNTAG_RESOURCE: StaticOperationSchema = ( + 23, + n0, + _UR, + { + _smithyap: MappingProxyType( + {"code": 200, "method": "DELETE", "uri": "/tags/{resourceArn}"} + ) }, + UNTAG_RESOURCE_INPUT, + UNTAG_RESOURCE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -FLOW_TRACE_NODE_OUTPUT_NEXT_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowTraceNodeOutputNextList"), - shape_type=ShapeType.LIST, - members={"member": {"target": FLOW_TRACE_NODE_OUTPUT_NEXT}}, -) - -FLOW_TRACE_NODE_OUTPUT_FIELD = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowTraceNodeOutputField"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "nodeOutputName": { - "target": NODE_OUTPUT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "content": { - "target": FLOW_TRACE_NODE_OUTPUT_CONTENT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "next": {"target": FLOW_TRACE_NODE_OUTPUT_NEXT_LIST}, - "type": {"target": FLOW_NODE_IO_DATA_TYPE}, - }, +RETRIEVAL_FILTER: StaticSchema = ( + 19, + n0, + _RF, + 4, + (_eq, _nE, _gTr, _gTOE, _lT, _lTOE, _in_, _nI, _sW, _lC, _sCt, _aA, _oAr), + ( + (FILTER_ATTRIBUTE, 0), + (FILTER_ATTRIBUTE, 0), + (FILTER_ATTRIBUTE, 0), + (FILTER_ATTRIBUTE, 0), + (FILTER_ATTRIBUTE, 0), + (FILTER_ATTRIBUTE, 0), + (FILTER_ATTRIBUTE, 0), + (FILTER_ATTRIBUTE, 0), + (FILTER_ATTRIBUTE, 0), + (FILTER_ATTRIBUTE, 0), + (FILTER_ATTRIBUTE, 0), + (lambda: RETRIEVAL_FILTER_LIST, 0), + (lambda: RETRIEVAL_FILTER_LIST, 0), + ), ) -FLOW_TRACE_NODE_OUTPUT_FIELDS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowTraceNodeOutputFields"), - shape_type=ShapeType.LIST, - members={"member": {"target": FLOW_TRACE_NODE_OUTPUT_FIELD}}, -) - -FLOW_TRACE_NODE_OUTPUT_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowTraceNodeOutputEvent"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "nodeName": { - "target": NODE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "timestamp": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "fields": { - "target": FLOW_TRACE_NODE_OUTPUT_FIELDS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +RETRIEVAL_FILTER_LIST: StaticSchema = ( + 16, + n0, + _RFL, + 0, + (_me,), + ((RETRIEVAL_FILTER, 0),), +) + +KNOWLEDGE_BASE_VECTOR_SEARCH_CONFIGURATION: StaticSchema = ( + 18, + n0, + _KBVSC, + 0, + (_nOR, _oST, _filt, _rCe, _iFC), + ( + (7, {_smit: 5}), + (SEARCH_TYPE, 0), + (RETRIEVAL_FILTER, 0), + (VECTOR_SEARCH_RERANKING_CONFIGURATION, 0), + (IMPLICIT_FILTER_CONFIGURATION, 0), + ), ) -FLOW_TRACE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowTrace"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "nodeInputTrace": {"target": FLOW_TRACE_NODE_INPUT_EVENT}, - "nodeOutputTrace": {"target": FLOW_TRACE_NODE_OUTPUT_EVENT}, - "conditionNodeResultTrace": {"target": FLOW_TRACE_CONDITION_NODE_RESULT_EVENT}, - "nodeActionTrace": {"target": FLOW_TRACE_NODE_ACTION_EVENT}, - "nodeDependencyTrace": {"target": FLOW_TRACE_DEPENDENCY_EVENT}, - }, +MANAGED_SEARCH_CONFIGURATION: StaticSchema = ( + 18, + n0, + _MSC, + 0, + (_nOR, _filt, _rMT, _rCe), + ( + (7, 0), + (RETRIEVAL_FILTER, 0), + (RERANKING_MODEL_TYPE, 0), + (MANAGED_SEARCH_RERANKING_CONFIGURATION, 0), + ), ) -FLOW_TRACE_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowTraceEvent"), - members={ - "trace": { - "target": FLOW_TRACE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +RETRIEVAL_OVERRIDES: StaticSchema = ( + 18, + n0, + _ROet, + 0, + (_filt, _mNOR), + ((RETRIEVAL_FILTER, 0), (7, 0)), +) + +KNOWLEDGE_BASE_RETRIEVER_CONFIGURATION: StaticSchema = ( + 18, + n0, + _KBRC, + 0, + (_kBI, _rO), + ((KNOWLEDGE_BASE_ID, 1), (RETRIEVAL_OVERRIDES, 0)), +) + +RETRIEVER_CONFIGURATION: StaticSchema = ( + 19, + n0, + _RCetr, + 0, + (_kB,), + ((KNOWLEDGE_BASE_RETRIEVER_CONFIGURATION, 0),), +) + +AGENTIC_RETRIEVER: StaticSchema = ( + 18, + n0, + _ARg, + 0, + (_d, _conf), + ((3, 0), (RETRIEVER_CONFIGURATION, 1)), +) + +AGENTIC_RETRIEVERS: StaticSchema = (16, n0, _ARge, 0, (_me,), ((AGENTIC_RETRIEVER, 0),)) + +AGENTIC_RETRIEVE_STREAM_INPUT: StaticSchema = ( + 18, + n0, + _ARSI, + {_sSI: _cARSRo, _smithya: None}, + (_mes, _ret, _aRC, _pCo, _nT, _uC, _mCemo, _gRe), + ( + (AGENTIC_RETRIEVE_MESSAGES, 1), + (AGENTIC_RETRIEVERS, 1), + (AGENTIC_RETRIEVE_CONFIGURATION, 1), + (AGENTIC_RETRIEVE_POLICY_CONFIGURATION, 0), + (NEXT_TOKEN, 0), + (USER_CONTEXT, 0), + (AGENTIC_RETRIEVE_MEMORY_CONFIGURATION, 0), + (2, {_smit: True}), + ), ) -FLOW_RESPONSE_STREAM = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FlowResponseStream"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#streaming"))], - members={ - "flowOutputEvent": {"target": FLOW_OUTPUT_EVENT}, - "flowCompletionEvent": {"target": FLOW_COMPLETION_EVENT}, - "flowTraceEvent": {"target": FLOW_TRACE_EVENT}, - "internalServerException": {"target": INTERNAL_SERVER_EXCEPTION}, - "validationException": {"target": VALIDATION_EXCEPTION}, - "resourceNotFoundException": {"target": RESOURCE_NOT_FOUND_EXCEPTION}, - "serviceQuotaExceededException": {"target": SERVICE_QUOTA_EXCEEDED_EXCEPTION}, - "throttlingException": {"target": THROTTLING_EXCEPTION}, - "accessDeniedException": {"target": ACCESS_DENIED_EXCEPTION}, - "conflictException": {"target": CONFLICT_EXCEPTION}, - "dependencyFailedException": {"target": DEPENDENCY_FAILED_EXCEPTION}, - "badGatewayException": {"target": BAD_GATEWAY_EXCEPTION}, - "flowMultiTurnInputRequestEvent": { - "target": FLOW_MULTI_TURN_INPUT_REQUEST_EVENT - }, - }, +KNOWLEDGE_BASE_RETRIEVAL_CONFIGURATION: StaticSchema = ( + 18, + n0, + _KBRCn, + 0, + (_vSC, _mSC), + ( + (KNOWLEDGE_BASE_VECTOR_SEARCH_CONFIGURATION, 0), + (MANAGED_SEARCH_CONFIGURATION, 0), + ), ) -INVOKE_FLOW_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#InvokeFlowOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#InvokeFlowResponse", +AGENTIC_RETRIEVE_STREAM: StaticOperationSchema = ( + 23, + n0, + _ARSge, + { + _smithyap: MappingProxyType( + {"code": 200, "method": "POST", "uri": "/agenticRetrieveStream"} ) - ], - members={ - "responseStream": { - "target": FLOW_RESPONSE_STREAM, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpPayload")), - ], - }, - "executionId": { - "target": FLOW_EXECUTION_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amz-bedrock-flow-execution-id", - ) - ], - }, }, + AGENTIC_RETRIEVE_STREAM_INPUT, + AGENTIC_RETRIEVE_STREAM_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + BAD_GATEWAY_EXCEPTION, + CONFLICT_EXCEPTION, + DEPENDENCY_FAILED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -INVOKE_FLOW = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#InvokeFlow"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "POST", - "uri": "/flows/{flowIdentifier}/aliases/{flowAliasIdentifier}", - } - ), - ) - ], -) - -INPUT_QUERY_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#InputQueryType"), - shape_type=ShapeType.ENUM, - members={"TEXT": {"target": UNIT}}, -) - -QUERY_GENERATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#QueryGenerationInput"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "type": { - "target": INPUT_QUERY_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "text": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +KNOWLEDGE_BASE: StaticSchema = ( + 18, + n0, + _KBn, + 0, + (_kBI, _d, _rCetr), + ( + (KNOWLEDGE_BASE_ID, 1), + (RESOURCE_DESCRIPTION, 1), + (KNOWLEDGE_BASE_RETRIEVAL_CONFIGURATION, 0), + ), ) -QUERY_TRANSFORMATION_MODE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#QueryTransformationMode"), - shape_type=ShapeType.ENUM, - members={"TEXT_TO_SQL": {"target": UNIT}}, +KNOWLEDGE_BASE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _KBC, + 0, + (_kBI, _rCetr), + ((KNOWLEDGE_BASE_ID, 1), (KNOWLEDGE_BASE_RETRIEVAL_CONFIGURATION, 1)), +) + +KNOWLEDGE_BASE_RETRIEVE_AND_GENERATE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _KBRAGC, + 0, + (_kBI, _mA, _rCetr, _gCe, _oC), + ( + (KNOWLEDGE_BASE_ID, 1), + (BEDROCK_MODEL_ARN, 1), + (KNOWLEDGE_BASE_RETRIEVAL_CONFIGURATION, 0), + (GENERATION_CONFIGURATION, 0), + (ORCHESTRATION_CONFIGURATION, 0), + ), ) -KNOWLEDGE_BASE_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#KnowledgeBaseArn"), - shape_type=ShapeType.STRING, +RETRIEVE_INPUT: StaticSchema = ( + 18, + n0, + _RIe, + {_sSI: _cRRoma, _smithya: None}, + (_kBI, _rQ, _rCetr, _gC, _nT, _uC), + ( + (KNOWLEDGE_BASE_IDENTIFIER, 9), + (KNOWLEDGE_BASE_QUERY, 1), + (KNOWLEDGE_BASE_RETRIEVAL_CONFIGURATION, 0), + (GUARDRAIL_CONFIGURATION, 0), + (NEXT_TOKEN, 0), + (USER_CONTEXT, 0), + ), ) -TEXT_TO_SQL_KNOWLEDGE_BASE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#TextToSqlKnowledgeBaseConfiguration"), - members={ - "knowledgeBaseArn": { - "target": KNOWLEDGE_BASE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } +RETRIEVE: StaticOperationSchema = ( + 23, + n0, + _Ret, + { + _smithyap: MappingProxyType( + { + "code": 200, + "method": "POST", + "uri": "/knowledgebases/{knowledgeBaseId}/retrieve", + } + ) }, + RETRIEVE_INPUT, + RETRIEVE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + BAD_GATEWAY_EXCEPTION, + CONFLICT_EXCEPTION, + DEPENDENCY_FAILED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -TEXT_TO_SQL_CONFIGURATION_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#TextToSqlConfigurationType"), - shape_type=ShapeType.ENUM, - members={"KNOWLEDGE_BASE": {"target": UNIT}}, +KNOWLEDGE_BASE_CONFIGURATIONS: StaticSchema = ( + 16, + n0, + _KBCn, + 0, + (_me,), + ((KNOWLEDGE_BASE_CONFIGURATION, 0),), ) -TEXT_TO_SQL_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#TextToSqlConfiguration"), - members={ - "type": { - "target": TEXT_TO_SQL_CONFIGURATION_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "knowledgeBaseConfiguration": { - "target": TEXT_TO_SQL_KNOWLEDGE_BASE_CONFIGURATION - }, - }, -) +KNOWLEDGE_BASES: StaticSchema = (16, n0, _KBno, 0, (_me,), ((KNOWLEDGE_BASE, 0),)) -TRANSFORMATION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#TransformationConfiguration"), - members={ - "mode": { - "target": QUERY_TRANSFORMATION_MODE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "textToSqlConfiguration": {"target": TEXT_TO_SQL_CONFIGURATION}, - }, +RETRIEVE_AND_GENERATE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _RAGC, + 0, + (_t, _kBC, _eSC), + ( + (RETRIEVE_AND_GENERATE_TYPE, 1), + (KNOWLEDGE_BASE_RETRIEVE_AND_GENERATE_CONFIGURATION, 0), + (EXTERNAL_SOURCES_RETRIEVE_AND_GENERATE_CONFIGURATION, 0), + ), ) -GENERATE_QUERY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GenerateQueryInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#GenerateQueryRequest", - ) - ], - members={ - "queryGenerationInput": { - "target": QUERY_GENERATION_INPUT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "transformationConfiguration": { - "target": TRANSFORMATION_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +COLLABORATOR: StaticSchema = ( + 18, + n0, + _Co, + 0, + (_cEKA, _fM, _ins, _iSTTLIS, _aGc, _kBn, _gC, _pOC, _aC, _cCo, _aN), + ( + (KMS_KEY_ARN, 0), + (MODEL_IDENTIFIER, 1), + (INSTRUCTION, 1), + (SESSION_TTL, 0), + (AGENT_ACTION_GROUPS, 0), + (KNOWLEDGE_BASES, 0), + (GUARDRAIL_CONFIGURATION_WITH_ARN, 0), + (PROMPT_OVERRIDE_CONFIGURATION, 0), + (AGENT_COLLABORATION, 0), + (COLLABORATOR_CONFIGURATIONS, 0), + (NAME, 0), + ), ) -GENERATED_QUERY_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GeneratedQueryType"), - shape_type=ShapeType.ENUM, - members={"REDSHIFT_SQL": {"target": UNIT}}, +RETRIEVE_AND_GENERATE_OPERATION_INPUT: StaticSchema = ( + 18, + n0, + _RAGOI, + {_sSI: _cRAGRo, _smithya: None}, + (_sIe, _in, _rAGC, _sCe, _uC), + ( + (SESSION_ID, 0), + (RETRIEVE_AND_GENERATE_INPUT, 1), + (RETRIEVE_AND_GENERATE_CONFIGURATION, 0), + (RETRIEVE_AND_GENERATE_SESSION_CONFIGURATION, 0), + (USER_CONTEXT, 0), + ), ) -GENERATED_QUERY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GeneratedQuery"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"type": {"target": GENERATED_QUERY_TYPE}, "sql": {"target": STRING}}, +RETRIEVE_AND_GENERATE_STREAM_INPUT: StaticSchema = ( + 18, + n0, + _RAGSI, + {_sSI: _cRAGSRo, _smithya: None}, + (_sIe, _in, _rAGC, _sCe, _uC), + ( + (SESSION_ID, 0), + (RETRIEVE_AND_GENERATE_INPUT, 1), + (RETRIEVE_AND_GENERATE_CONFIGURATION, 0), + (RETRIEVE_AND_GENERATE_SESSION_CONFIGURATION, 0), + (USER_CONTEXT, 0), + ), ) -GENERATED_QUERIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GeneratedQueries"), - shape_type=ShapeType.LIST, - members={"member": {"target": GENERATED_QUERY}}, +SESSION_STATE: StaticSchema = ( + 18, + n0, + _SSessi, + 0, + (_sAe, _pSA, _rCIR, _iI, _fil, _kBCn, _cH), + ( + (SESSION_ATTRIBUTES_MAP, 0), + (PROMPT_SESSION_ATTRIBUTES_MAP, 0), + (RETURN_CONTROL_INVOCATION_RESULTS, 0), + (3, 0), + (INPUT_FILES, 0), + (KNOWLEDGE_BASE_CONFIGURATIONS, 0), + (CONVERSATION_HISTORY, 0), + ), ) -GENERATE_QUERY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GenerateQueryOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#GenerateQueryResponse", +RETRIEVE_AND_GENERATE: StaticOperationSchema = ( + 23, + n0, + _RAG, + { + _smithyap: MappingProxyType( + {"code": 200, "method": "POST", "uri": "/retrieveAndGenerate"} ) - ], - members={"queries": {"target": GENERATED_QUERIES}}, -) - -GENERATE_QUERY = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#GenerateQuery"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "POST", "uri": "/generateQuery"} - ), - ) - ], -) - -DOCUMENT_OUTPUT_FORMAT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#DocumentOutputFormat"), - shape_type=ShapeType.ENUM, - members={"RAW": {"target": UNIT}, "EXTRACTED": {"target": UNIT}}, + }, + RETRIEVE_AND_GENERATE_OPERATION_INPUT, + RETRIEVE_AND_GENERATE_OPERATION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + BAD_GATEWAY_EXCEPTION, + CONFLICT_EXCEPTION, + DEPENDENCY_FAILED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -GET_DOCUMENT_CONTENT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GetDocumentContentInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#GetDocumentContentRequest", +RETRIEVE_AND_GENERATE_STREAM: StaticOperationSchema = ( + 23, + n0, + _RAGS, + { + _smithyap: MappingProxyType( + {"code": 200, "method": "POST", "uri": "/retrieveAndGenerateStream"} ) - ], - members={ - "knowledgeBaseId": { - "target": KNOWLEDGE_BASE_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "dataSourceId": { - "target": DATA_SOURCE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "documentId": { - "target": DOCUMENT_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "outputFormat": {"target": DOCUMENT_OUTPUT_FORMAT}, - "userContext": {"target": USER_CONTEXT}, }, + RETRIEVE_AND_GENERATE_STREAM_INPUT, + RETRIEVE_AND_GENERATE_STREAM_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + BAD_GATEWAY_EXCEPTION, + CONFLICT_EXCEPTION, + DEPENDENCY_FAILED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -PRESIGNED_URL = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#PresignedUrl"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +COLLABORATORS: StaticSchema = (16, n0, _Col, 0, (_me,), ((COLLABORATOR, 0),)) + +INVOKE_AGENT_INPUT: StaticSchema = ( + 18, + n0, + _IAI, + {_sSI: _cIARo, _smithya: None}, + (_sSessi, _aI, _aAI, _sIe, _eS, _eTna, _iTnp, _mI, _bMC, _sCtr, _pCC, _sAo), + ( + (SESSION_STATE, 0), + (AGENT_ID, 9), + (AGENT_ALIAS_ID, 9), + (SESSION_ID, 9), + (2, 0), + (2, 0), + (INPUT_TEXT, 0), + (MEMORY_ID, 0), + (BEDROCK_MODEL_CONFIGURATIONS, 0), + (STREAMING_CONFIGURATIONS, 0), + (PROMPT_CREATION_CONFIGURATIONS, 0), + (AWS_RESOURCE_ARN, {_sH: _xasa}), + ), ) -GET_DOCUMENT_CONTENT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GetDocumentContentOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#GetDocumentContentResponse", +INVOKE_AGENT: StaticOperationSchema = ( + 23, + n0, + _IAn, + { + _smithyap: MappingProxyType( + { + "code": 200, + "method": "POST", + "uri": "/agents/{agentId}/agentAliases/{agentAliasId}/sessions/{sessionId}/text", + } ) - ], - members={ - "mimeType": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "presignedUrl": { - "target": PRESIGNED_URL, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "documentContentLength": {"target": LONG}, }, + INVOKE_AGENT_INPUT, + INVOKE_AGENT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + BAD_GATEWAY_EXCEPTION, + CONFLICT_EXCEPTION, + DEPENDENCY_FAILED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + MODEL_NOT_READY_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -GET_DOCUMENT_CONTENT = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#GetDocumentContent"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "POST", - "uri": "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/documents/{documentId}/content", - } - ), - ) - ], +INVOKE_INLINE_AGENT_INPUT: StaticSchema = ( + 18, + n0, + _IIAI, + {_sSI: _cIIARo, _smithya: None}, + ( + _cEKA, + _fM, + _ins, + _iSTTLIS, + _aGc, + _kBn, + _gC, + _pOC, + _aC, + _cCo, + _aN, + _sIe, + _eS, + _eTna, + _iTnp, + _sCtr, + _pCC, + _iSSn, + _col, + _bMC, + _oTrc, + _cOu, + ), + ( + (KMS_KEY_ARN, 0), + (MODEL_IDENTIFIER, 1), + (INSTRUCTION, 1), + (SESSION_TTL, 0), + (AGENT_ACTION_GROUPS, 0), + (KNOWLEDGE_BASES, 0), + (GUARDRAIL_CONFIGURATION_WITH_ARN, 0), + (PROMPT_OVERRIDE_CONFIGURATION, 0), + (AGENT_COLLABORATION, 0), + (COLLABORATOR_CONFIGURATIONS, 0), + (NAME, 0), + (SESSION_ID, 9), + (2, 0), + (2, 0), + (INPUT_TEXT, 0), + (STREAMING_CONFIGURATIONS, 0), + (PROMPT_CREATION_CONFIGURATIONS, 0), + (INLINE_SESSION_STATE, 0), + (COLLABORATORS, 0), + (INLINE_BEDROCK_MODEL_CONFIGURATIONS, 0), + (ORCHESTRATION_TYPE, 0), + (CUSTOM_ORCHESTRATION, 0), + ), ) -GET_INGESTED_DOCUMENT_ACL_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GetIngestedDocumentAclInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#GetIngestedDocumentAclRequest", +INVOKE_INLINE_AGENT: StaticOperationSchema = ( + 23, + n0, + _IIA, + { + _smithyap: MappingProxyType( + {"code": 200, "method": "POST", "uri": "/agents/{sessionId}"} ) - ], - members={ - "knowledgeBaseId": { - "target": KNOWLEDGE_BASE_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "dataSourceId": { - "target": DATA_SOURCE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "documentId": { - "target": DOCUMENT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, }, + INVOKE_INLINE_AGENT_INPUT, + INVOKE_INLINE_AGENT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + BAD_GATEWAY_EXCEPTION, + CONFLICT_EXCEPTION, + DEPENDENCY_FAILED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -DOCUMENT_ACL_MEMBER_RELATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#DocumentAclMemberRelation"), - shape_type=ShapeType.ENUM, - members={"AND": {"target": UNIT}, "OR": {"target": UNIT}}, -) - -DOCUMENT_ACL_MEMBERSHIP_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#DocumentAclMembershipType"), - shape_type=ShapeType.ENUM, - members={"KNOWLEDGE_BASE": {"target": UNIT}, "DATA_SOURCE": {"target": UNIT}}, -) - -DOCUMENT_ACL_GROUP = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#DocumentAclGroup"), - members={ - "id": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "type": { - "target": DOCUMENT_ACL_MEMBERSHIP_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -DOCUMENT_ACL_GROUP_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#DocumentAclGroupList"), - shape_type=ShapeType.LIST, - members={"member": {"target": DOCUMENT_ACL_GROUP}}, -) - -DOCUMENT_ACL_USER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#DocumentAclUser"), - members={ - "id": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "type": { - "target": DOCUMENT_ACL_MEMBERSHIP_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -DOCUMENT_ACL_USER_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#DocumentAclUserList"), - shape_type=ShapeType.LIST, - members={"member": {"target": DOCUMENT_ACL_USER}}, -) - -DOCUMENT_ACL_CONDITION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#DocumentAclCondition"), - members={ - "conditionOperator": {"target": DOCUMENT_ACL_MEMBER_RELATION}, - "users": {"target": DOCUMENT_ACL_USER_LIST}, - "groups": {"target": DOCUMENT_ACL_GROUP_LIST}, - }, -) - -DOCUMENT_ACL_CONDITION_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#DocumentAclConditionList"), - shape_type=ShapeType.LIST, - members={"member": {"target": DOCUMENT_ACL_CONDITION}}, -) - -DOCUMENT_ACL_MEMBERSHIP = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#DocumentAclMembership"), - members={ - "memberRelation": {"target": DOCUMENT_ACL_MEMBER_RELATION}, - "conditions": {"target": DOCUMENT_ACL_CONDITION_LIST}, - }, -) - -DOCUMENT_ACL = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#DocumentAcl"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "allowList": {"target": DOCUMENT_ACL_MEMBERSHIP}, - "denyList": {"target": DOCUMENT_ACL_MEMBERSHIP}, - }, -) - -GET_INGESTED_DOCUMENT_ACL_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GetIngestedDocumentAclOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#GetIngestedDocumentAclResponse", - ) - ], - members={ - "documentAcl": { - "target": DOCUMENT_ACL, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -GET_INGESTED_DOCUMENT_ACL = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#GetIngestedDocumentAcl"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "POST", - "uri": "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/get-ingested-document-acl", - } - ), - ) - ], -) - -BEDROCK_MODEL_CONFIGURATIONS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#BedrockModelConfigurations"), - members={"performanceConfig": {"target": PERFORMANCE_CONFIGURATION}}, -) - -INPUT_TEXT = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#InputText"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -MEMORY_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#MemoryId"), - shape_type=ShapeType.STRING, -) - -PROMPT_CREATION_CONFIGURATIONS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#PromptCreationConfigurations"), - members={ - "previousConversationTurnsToInclude": {"target": INTEGER}, - "excludePreviousThinkingSteps": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - }, -) - -CONTENT_BLOCK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ContentBlock"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"text": {"target": STRING}}, -) - -CONTENT_BLOCKS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ContentBlocks"), - shape_type=ShapeType.LIST, - members={"member": {"target": CONTENT_BLOCK}}, -) - -MESSAGE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#Message"), - members={ - "role": { - "target": CONVERSATION_ROLE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "content": { - "target": CONTENT_BLOCKS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -MESSAGES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#Messages"), - shape_type=ShapeType.LIST, - members={"member": {"target": MESSAGE}}, -) - -CONVERSATION_HISTORY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ConversationHistory"), - members={"messages": {"target": MESSAGES}}, -) - -BYTE_CONTENT_BLOB = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#ByteContentBlob"), - shape_type=ShapeType.BLOB, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -BYTE_CONTENT_FILE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ByteContentFile"), - members={ - "mediaType": { - "target": MIME_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "data": { - "target": BYTE_CONTENT_BLOB, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -S3_URI = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#S3Uri"), shape_type=ShapeType.STRING -) - -S3_OBJECT_FILE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#S3ObjectFile"), - members={ - "uri": { - "target": S3_URI, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -FILE_SOURCE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FileSourceType"), - shape_type=ShapeType.ENUM, - members={"S3": {"target": UNIT}, "BYTE_CONTENT": {"target": UNIT}}, -) - -FILE_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FileSource"), - members={ - "sourceType": { - "target": FILE_SOURCE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "s3Location": {"target": S3_OBJECT_FILE}, - "byteContent": {"target": BYTE_CONTENT_FILE}, - }, -) - -FILE_USE_CASE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FileUseCase"), - shape_type=ShapeType.ENUM, - members={"CODE_INTERPRETER": {"target": UNIT}, "CHAT": {"target": UNIT}}, -) - -INPUT_FILE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#InputFile"), - members={ - "name": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "source": { - "target": FILE_SOURCE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "useCase": { - "target": FILE_USE_CASE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -INPUT_FILES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#InputFiles"), - shape_type=ShapeType.LIST, - members={"member": {"target": INPUT_FILE}}, -) - -RERANKING_METADATA_SELECTION_MODE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RerankingMetadataSelectionMode"), - shape_type=ShapeType.ENUM, - members={"SELECTIVE": {"target": UNIT}, "ALL": {"target": UNIT}}, -) - -FIELD_FOR_RERANKING = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FieldForReranking"), - members={ - "fieldName": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -FIELDS_FOR_RERANKING = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FieldsForReranking"), - shape_type=ShapeType.LIST, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"member": {"target": FIELD_FOR_RERANKING}}, -) - -RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentruntime#RerankingMetadataSelectiveModeConfiguration" - ), - shape_type=ShapeType.UNION, - members={ - "fieldsToInclude": {"target": FIELDS_FOR_RERANKING}, - "fieldsToExclude": {"target": FIELDS_FOR_RERANKING}, - }, -) - -METADATA_CONFIGURATION_FOR_RERANKING = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#MetadataConfigurationForReranking"), - members={ - "selectionMode": { - "target": RERANKING_METADATA_SELECTION_MODE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "selectiveModeConfiguration": { - "target": RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION - }, - }, -) - -BEDROCK_RERANKING_MODEL_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#BedrockRerankingModelArn"), - shape_type=ShapeType.STRING, -) - -MANAGED_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentruntime#ManagedSearchBedrockRerankingModelConfiguration" - ), - members={ - "modelArn": { - "target": BEDROCK_RERANKING_MODEL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "additionalModelRequestFields": {"target": ADDITIONAL_MODEL_REQUEST_FIELDS}, - }, -) - -MANAGED_SEARCH_BEDROCK_RERANKING_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentruntime#ManagedSearchBedrockRerankingConfiguration" - ), - members={ - "modelConfiguration": { - "target": MANAGED_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "numberOfRerankedResults": {"target": INTEGER}, - "metadataConfiguration": {"target": METADATA_CONFIGURATION_FOR_RERANKING}, - }, -) - -MANAGED_SEARCH_RERANKING_CONFIGURATION_TYPE = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentruntime#ManagedSearchRerankingConfigurationType" - ), - shape_type=ShapeType.ENUM, - members={"BEDROCK_RERANKING_MODEL": {"target": UNIT}}, -) - -MANAGED_SEARCH_RERANKING_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ManagedSearchRerankingConfiguration"), - members={ - "type": { - "target": MANAGED_SEARCH_RERANKING_CONFIGURATION_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "bedrockRerankingConfiguration": { - "target": MANAGED_SEARCH_BEDROCK_RERANKING_CONFIGURATION - }, - }, -) - -RERANKING_MODEL_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RerankingModelType"), - shape_type=ShapeType.ENUM, - members={ - "CUSTOM": {"target": UNIT}, - "MANAGED": {"target": UNIT}, - "NONE": {"target": UNIT}, - }, -) - -ATTRIBUTE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AttributeType"), - shape_type=ShapeType.ENUM, - members={ - "STRING": {"target": UNIT}, - "NUMBER": {"target": UNIT}, - "BOOLEAN": {"target": UNIT}, - "STRING_LIST": {"target": UNIT}, - }, -) - -METADATA_ATTRIBUTE_SCHEMA = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#MetadataAttributeSchema"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "key": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "type": { - "target": ATTRIBUTE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -METADATA_ATTRIBUTE_SCHEMA_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#MetadataAttributeSchemaList"), - shape_type=ShapeType.LIST, - members={"member": {"target": METADATA_ATTRIBUTE_SCHEMA}}, -) - -IMPLICIT_FILTER_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ImplicitFilterConfiguration"), - members={ - "metadataAttributes": { - "target": METADATA_ATTRIBUTE_SCHEMA_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelArn": { - "target": BEDROCK_MODEL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -SEARCH_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#SearchType"), - shape_type=ShapeType.ENUM, - members={"HYBRID": {"target": UNIT}, "SEMANTIC": {"target": UNIT}}, -) - -VECTOR_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentruntime#VectorSearchBedrockRerankingModelConfiguration" - ), - members={ - "modelArn": { - "target": BEDROCK_RERANKING_MODEL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "additionalModelRequestFields": {"target": ADDITIONAL_MODEL_REQUEST_FIELDS}, - }, -) - -VECTOR_SEARCH_BEDROCK_RERANKING_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentruntime#VectorSearchBedrockRerankingConfiguration" - ), - members={ - "modelConfiguration": { - "target": VECTOR_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "numberOfRerankedResults": {"target": INTEGER}, - "metadataConfiguration": {"target": METADATA_CONFIGURATION_FOR_RERANKING}, - }, -) - -VECTOR_SEARCH_RERANKING_CONFIGURATION_TYPE = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentruntime#VectorSearchRerankingConfigurationType" - ), - shape_type=ShapeType.ENUM, - members={"BEDROCK_RERANKING_MODEL": {"target": UNIT}}, -) - -VECTOR_SEARCH_RERANKING_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#VectorSearchRerankingConfiguration"), - members={ - "type": { - "target": VECTOR_SEARCH_RERANKING_CONFIGURATION_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "bedrockRerankingConfiguration": { - "target": VECTOR_SEARCH_BEDROCK_RERANKING_CONFIGURATION - }, - }, -) - -PROMPT_SESSION_ATTRIBUTES_MAP = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#PromptSessionAttributesMap"), - shape_type=ShapeType.MAP, - members={"key": {"target": STRING}, "value": {"target": STRING}}, -) - -SESSION_ATTRIBUTES_MAP = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#SessionAttributesMap"), - shape_type=ShapeType.MAP, - members={"key": {"target": STRING}, "value": {"target": STRING}}, -) - -AWS_RESOURCE_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#AWSResourceARN"), - shape_type=ShapeType.STRING, -) - -STREAMING_CONFIGURATIONS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#StreamingConfigurations"), - members={ - "streamFinalResponse": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "applyGuardrailInterval": {"target": INTEGER}, - }, -) - -SPAN = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#Span"), - members={"start": {"target": INTEGER}, "end": {"target": INTEGER}}, -) - -TEXT_RESPONSE_PART = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#TextResponsePart"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"text": {"target": STRING}, "span": {"target": SPAN}}, -) - -GENERATED_RESPONSE_PART = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GeneratedResponsePart"), - members={"textResponsePart": {"target": TEXT_RESPONSE_PART}}, -) - -CITATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#Citation"), - members={ - "generatedResponsePart": {"target": GENERATED_RESPONSE_PART}, - "retrievedReferences": {"target": RETRIEVED_REFERENCES}, - }, -) - -CITATIONS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#Citations"), - shape_type=ShapeType.LIST, - members={"member": {"target": CITATION}}, -) - -ATTRIBUTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#Attribution"), - members={"citations": {"target": CITATIONS}}, -) - -PART_BODY = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#PartBody"), - shape_type=ShapeType.BLOB, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -PAYLOAD_PART = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#PayloadPart"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"bytes": {"target": PART_BODY}, "attribution": {"target": ATTRIBUTION}}, -) - -FILE_BODY = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#FileBody"), - shape_type=ShapeType.BLOB, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -OUTPUT_FILE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#OutputFile"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "name": {"target": STRING}, - "type": {"target": MIME_TYPE}, - "bytes": {"target": FILE_BODY}, - }, -) - -OUTPUT_FILES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#OutputFiles"), - shape_type=ShapeType.LIST, - members={"member": {"target": OUTPUT_FILE}}, -) - -FILE_PART = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#FilePart"), - members={"files": {"target": OUTPUT_FILES}}, -) - -MODEL_NOT_READY_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ModelNotReadyException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=424), - ], - members={"message": {"target": NON_BLANK_STRING}}, -) - -RESPONSE_STREAM = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ResponseStream"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#streaming"))], - members={ - "chunk": {"target": PAYLOAD_PART}, - "trace": {"target": TRACE_PART}, - "returnControl": {"target": RETURN_CONTROL_PAYLOAD}, - "internalServerException": {"target": INTERNAL_SERVER_EXCEPTION}, - "validationException": {"target": VALIDATION_EXCEPTION}, - "resourceNotFoundException": {"target": RESOURCE_NOT_FOUND_EXCEPTION}, - "serviceQuotaExceededException": {"target": SERVICE_QUOTA_EXCEEDED_EXCEPTION}, - "throttlingException": {"target": THROTTLING_EXCEPTION}, - "accessDeniedException": {"target": ACCESS_DENIED_EXCEPTION}, - "conflictException": {"target": CONFLICT_EXCEPTION}, - "dependencyFailedException": {"target": DEPENDENCY_FAILED_EXCEPTION}, - "badGatewayException": {"target": BAD_GATEWAY_EXCEPTION}, - "modelNotReadyException": {"target": MODEL_NOT_READY_EXCEPTION}, - "files": {"target": FILE_PART}, - }, -) - -INVOKE_AGENT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#InvokeAgentOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#InvokeAgentResponse", - ) - ], - members={ - "completion": { - "target": RESPONSE_STREAM, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpPayload")), - ], - }, - "contentType": { - "target": MIME_TYPE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-bedrock-agent-content-type", - ), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "sessionId": { - "target": SESSION_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amz-bedrock-agent-session-id", - ), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "memoryId": { - "target": MEMORY_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amz-bedrock-agent-memory-id", - ) - ], - }, - }, -) - -INLINE_BEDROCK_MODEL_CONFIGURATIONS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#InlineBedrockModelConfigurations"), - members={"performanceConfig": {"target": PERFORMANCE_CONFIGURATION}}, -) - -COLLABORATION_INSTRUCTION = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#CollaborationInstruction"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -RELAY_CONVERSATION_HISTORY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RelayConversationHistory"), - shape_type=ShapeType.ENUM, - members={"TO_COLLABORATOR": {"target": UNIT}, "DISABLED": {"target": UNIT}}, -) - -COLLABORATOR_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#CollaboratorConfiguration"), - members={ - "collaboratorName": { - "target": NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "collaboratorInstruction": { - "target": COLLABORATION_INSTRUCTION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentAliasArn": {"target": AGENT_ALIAS_ARN}, - "relayConversationHistory": {"target": RELAY_CONVERSATION_HISTORY}, - }, -) - -COLLABORATOR_CONFIGURATIONS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#CollaboratorConfigurations"), - shape_type=ShapeType.LIST, - members={"member": {"target": COLLABORATOR_CONFIGURATION}}, -) - -GUARDRAIL_IDENTIFIER_WITH_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#GuardrailIdentifierWithArn"), - shape_type=ShapeType.STRING, -) - -GUARDRAIL_VERSION = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#GuardrailVersion"), - shape_type=ShapeType.STRING, -) - -GUARDRAIL_CONFIGURATION_WITH_ARN = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GuardrailConfigurationWithArn"), - members={ - "guardrailIdentifier": { - "target": GUARDRAIL_IDENTIFIER_WITH_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "guardrailVersion": { - "target": GUARDRAIL_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -SESSION_TTL = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#SessionTTL"), - shape_type=ShapeType.INTEGER, -) - -INSTRUCTION = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#Instruction"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -BASE_PROMPT_TEMPLATE = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#BasePromptTemplate"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -PROMPT_STATE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#PromptState"), - shape_type=ShapeType.ENUM, - members={"ENABLED": {"target": UNIT}, "DISABLED": {"target": UNIT}}, -) - -PROMPT_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#PromptConfiguration"), - members={ - "promptType": {"target": PROMPT_TYPE}, - "promptCreationMode": {"target": CREATION_MODE}, - "promptState": {"target": PROMPT_STATE}, - "basePromptTemplate": {"target": BASE_PROMPT_TEMPLATE}, - "inferenceConfiguration": {"target": INFERENCE_CONFIGURATION}, - "parserMode": {"target": CREATION_MODE}, - "foundationModel": {"target": MODEL_IDENTIFIER}, - "additionalModelRequestFields": {"target": DOCUMENT}, - }, -) - -PROMPT_CONFIGURATIONS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#PromptConfigurations"), - shape_type=ShapeType.LIST, - members={"member": {"target": PROMPT_CONFIGURATION}}, -) - -PROMPT_OVERRIDE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#PromptOverrideConfiguration"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "promptConfigurations": { - "target": PROMPT_CONFIGURATIONS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "overrideLambda": {"target": LAMBDA_RESOURCE_ARN}, - }, -) - -ORCHESTRATION_EXECUTOR = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#OrchestrationExecutor"), - shape_type=ShapeType.UNION, - members={"lambda": {"target": LAMBDA_ARN}}, -) - -CUSTOM_ORCHESTRATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#CustomOrchestration"), - members={"executor": {"target": ORCHESTRATION_EXECUTOR}}, -) - -INLINE_SESSION_STATE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#InlineSessionState"), - members={ - "sessionAttributes": {"target": SESSION_ATTRIBUTES_MAP}, - "promptSessionAttributes": {"target": PROMPT_SESSION_ATTRIBUTES_MAP}, - "returnControlInvocationResults": {"target": RETURN_CONTROL_INVOCATION_RESULTS}, - "invocationId": {"target": STRING}, - "files": {"target": INPUT_FILES}, - "conversationHistory": {"target": CONVERSATION_HISTORY}, - }, -) - -ORCHESTRATION_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#OrchestrationType"), - shape_type=ShapeType.ENUM, - members={"DEFAULT": {"target": UNIT}, "CUSTOM_ORCHESTRATION": {"target": UNIT}}, -) - -INLINE_AGENT_PAYLOAD_PART = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#InlineAgentPayloadPart"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"bytes": {"target": PART_BODY}, "attribution": {"target": ATTRIBUTION}}, -) - -INLINE_AGENT_FILE_PART = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#InlineAgentFilePart"), - members={"files": {"target": OUTPUT_FILES}}, -) - -INLINE_AGENT_RETURN_CONTROL_PAYLOAD = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#InlineAgentReturnControlPayload"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "invocationInputs": {"target": INVOCATION_INPUTS}, - "invocationId": {"target": STRING}, - }, -) - -INLINE_AGENT_TRACE_PART = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#InlineAgentTracePart"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "sessionId": {"target": SESSION_ID}, - "trace": {"target": TRACE}, - "callerChain": {"target": CALLER_CHAIN}, - "eventTime": { - "target": DATE_TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#timestampFormat"), value="date-time") - ], - }, - "collaboratorName": {"target": NAME}, - }, -) - -INLINE_AGENT_RESPONSE_STREAM = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#InlineAgentResponseStream"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#streaming"))], - members={ - "chunk": {"target": INLINE_AGENT_PAYLOAD_PART}, - "trace": {"target": INLINE_AGENT_TRACE_PART}, - "returnControl": {"target": INLINE_AGENT_RETURN_CONTROL_PAYLOAD}, - "internalServerException": {"target": INTERNAL_SERVER_EXCEPTION}, - "validationException": {"target": VALIDATION_EXCEPTION}, - "resourceNotFoundException": {"target": RESOURCE_NOT_FOUND_EXCEPTION}, - "serviceQuotaExceededException": {"target": SERVICE_QUOTA_EXCEEDED_EXCEPTION}, - "throttlingException": {"target": THROTTLING_EXCEPTION}, - "accessDeniedException": {"target": ACCESS_DENIED_EXCEPTION}, - "conflictException": {"target": CONFLICT_EXCEPTION}, - "dependencyFailedException": {"target": DEPENDENCY_FAILED_EXCEPTION}, - "badGatewayException": {"target": BAD_GATEWAY_EXCEPTION}, - "files": {"target": INLINE_AGENT_FILE_PART}, - }, -) - -INVOKE_INLINE_AGENT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#InvokeInlineAgentOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#InvokeInlineAgentResponse", - ) - ], - members={ - "completion": { - "target": INLINE_AGENT_RESPONSE_STREAM, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpPayload")), - ], - }, - "contentType": { - "target": MIME_TYPE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-bedrock-agent-content-type", - ), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "sessionId": { - "target": SESSION_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amz-bedrock-agent-session-id", - ), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - }, -) - -DELETE_AGENT_MEMORY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#DeleteAgentMemoryInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#DeleteAgentMemoryRequest", - ) - ], - members={ - "agentId": { - "target": AGENT_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "agentAliasId": { - "target": AGENT_ALIAS_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "memoryId": { - "target": MEMORY_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="memoryId")], - }, - "sessionId": { - "target": SESSION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="sessionId") - ], - }, - }, -) - -DELETE_AGENT_MEMORY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#DeleteAgentMemoryOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#DeleteAgentMemoryResponse", - ) - ], -) - -DELETE_AGENT_MEMORY = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#DeleteAgentMemory"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 202, - "method": "DELETE", - "uri": "/agents/{agentId}/agentAliases/{agentAliasId}/memories", - } - ), - ) - ], -) - -MEMORY_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#MemoryType"), - shape_type=ShapeType.ENUM, - members={"SESSION_SUMMARY": {"target": UNIT}}, -) - -GET_AGENT_MEMORY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GetAgentMemoryInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#GetAgentMemoryRequest", - ) - ], - members={ - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "maxItems": { - "target": MAX_RESULTS, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxItems")], - }, - "agentId": { - "target": AGENT_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "agentAliasId": { - "target": AGENT_ALIAS_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "memoryType": { - "target": MEMORY_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="memoryType"), - ], - }, - "memoryId": { - "target": MEMORY_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="memoryId"), - ], - }, - }, -) - -SUMMARY_TEXT = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#SummaryText"), - shape_type=ShapeType.STRING, -) - -MEMORY_SESSION_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#MemorySessionSummary"), - members={ - "memoryId": {"target": MEMORY_ID}, - "sessionId": {"target": SESSION_ID}, - "sessionStartTime": {"target": DATE_TIMESTAMP}, - "sessionExpiryTime": {"target": DATE_TIMESTAMP}, - "summaryText": {"target": SUMMARY_TEXT}, - }, -) - -MEMORY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#Memory"), - shape_type=ShapeType.UNION, - members={"sessionSummary": {"target": MEMORY_SESSION_SUMMARY}}, -) - -MEMORIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#Memories"), - shape_type=ShapeType.LIST, - members={"member": {"target": MEMORY}}, -) - -GET_AGENT_MEMORY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GetAgentMemoryOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#GetAgentMemoryResponse", - ) - ], - members={ - "nextToken": {"target": NEXT_TOKEN}, - "memoryContents": {"target": MEMORIES}, - }, -) - -GET_AGENT_MEMORY = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#GetAgentMemory"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/agents/{agentId}/agentAliases/{agentAliasId}/memories", - } - ), - ) - ], -) - -TEXT_PROMPT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#TextPrompt"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "text": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -INPUT_PROMPT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#InputPrompt"), - shape_type=ShapeType.UNION, - members={"textPrompt": {"target": TEXT_PROMPT}}, -) - -OPTIMIZE_PROMPT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#OptimizePromptInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#OptimizePromptRequest", - ) - ], - members={ - "input": { - "target": INPUT_PROMPT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "targetModelId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -ANALYZE_PROMPT_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AnalyzePromptEvent"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"message": {"target": STRING}}, -) - -OPTIMIZED_PROMPT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#OptimizedPrompt"), - shape_type=ShapeType.UNION, - members={"textPrompt": {"target": TEXT_PROMPT}}, -) - -OPTIMIZED_PROMPT_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#OptimizedPromptEvent"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"optimizedPrompt": {"target": OPTIMIZED_PROMPT}}, -) - -OPTIMIZED_PROMPT_STREAM = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#OptimizedPromptStream"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#streaming"))], - members={ - "optimizedPromptEvent": {"target": OPTIMIZED_PROMPT_EVENT}, - "analyzePromptEvent": {"target": ANALYZE_PROMPT_EVENT}, - "internalServerException": {"target": INTERNAL_SERVER_EXCEPTION}, - "throttlingException": {"target": THROTTLING_EXCEPTION}, - "validationException": {"target": VALIDATION_EXCEPTION}, - "dependencyFailedException": {"target": DEPENDENCY_FAILED_EXCEPTION}, - "accessDeniedException": {"target": ACCESS_DENIED_EXCEPTION}, - "badGatewayException": {"target": BAD_GATEWAY_EXCEPTION}, - }, -) - -OPTIMIZE_PROMPT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#OptimizePromptOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#OptimizePromptResponse", - ) - ], - members={ - "optimizedPrompt": { - "target": OPTIMIZED_PROMPT_STREAM, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpPayload")), - ], - } - }, -) - -OPTIMIZE_PROMPT = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#OptimizePrompt"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "POST", "uri": "/optimize-prompt"} - ), - ) - ], -) - -RERANK_TEXT_DOCUMENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RerankTextDocument"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"text": {"target": STRING}}, -) - -RERANK_QUERY_CONTENT_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RerankQueryContentType"), - shape_type=ShapeType.ENUM, - members={"TEXT": {"target": UNIT}}, -) - -RERANK_QUERY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RerankQuery"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "type": { - "target": RERANK_QUERY_CONTENT_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "textQuery": { - "target": RERANK_TEXT_DOCUMENT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -RERANK_QUERIES_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RerankQueriesList"), - shape_type=ShapeType.LIST, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"member": {"target": RERANK_QUERY}}, -) - -BEDROCK_RERANKING_MODEL_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#BedrockRerankingModelConfiguration"), - members={ - "modelArn": { - "target": BEDROCK_MODEL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "additionalModelRequestFields": {"target": ADDITIONAL_MODEL_REQUEST_FIELDS}, - }, -) - -BEDROCK_RERANKING_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#BedrockRerankingConfiguration"), - members={ - "numberOfResults": {"target": INTEGER}, - "modelConfiguration": { - "target": BEDROCK_RERANKING_MODEL_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -RERANKING_CONFIGURATION_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RerankingConfigurationType"), - shape_type=ShapeType.ENUM, - members={"BEDROCK_RERANKING_MODEL": {"target": UNIT}}, -) - -RERANKING_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RerankingConfiguration"), - members={ - "type": { - "target": RERANKING_CONFIGURATION_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "bedrockRerankingConfiguration": { - "target": BEDROCK_RERANKING_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -RERANK_DOCUMENT_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RerankDocumentType"), - shape_type=ShapeType.ENUM, - members={"TEXT": {"target": UNIT}, "JSON": {"target": UNIT}}, -) - -RERANK_DOCUMENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RerankDocument"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "type": { - "target": RERANK_DOCUMENT_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "textDocument": {"target": RERANK_TEXT_DOCUMENT}, - "jsonDocument": {"target": DOCUMENT}, - }, -) - -RERANK_SOURCE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RerankSourceType"), - shape_type=ShapeType.ENUM, - members={"INLINE": {"target": UNIT}}, -) - -RERANK_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RerankSource"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "type": { - "target": RERANK_SOURCE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "inlineDocumentSource": { - "target": RERANK_DOCUMENT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -RERANK_SOURCES_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RerankSourcesList"), - shape_type=ShapeType.LIST, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"member": {"target": RERANK_SOURCE}}, -) - -RERANK_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RerankInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#RerankRequest", - ) - ], - members={ - "queries": { - "target": RERANK_QUERIES_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "sources": { - "target": RERANK_SOURCES_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "rerankingConfiguration": { - "target": RERANKING_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": NEXT_TOKEN}, - }, -) - -RERANK_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RerankResult"), - members={ - "index": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "relevanceScore": { - "target": FLOAT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "document": {"target": RERANK_DOCUMENT}, - }, -) - -RERANK_RESULTS_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RerankResultsList"), - shape_type=ShapeType.LIST, - members={"member": {"target": RERANK_RESULT}}, -) - -RERANK_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RerankOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#RerankResponse", - ) - ], - members={ - "results": { - "target": RERANK_RESULTS_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": NEXT_TOKEN}, - }, -) - -RERANK = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#Rerank"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType({"code": 200, "method": "POST", "uri": "/rerank"}), - ) - ], -) - -RETRIEVE_AND_GENERATE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RetrieveAndGenerateInput"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "text": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -GUARDRAIL_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GuardrailConfiguration"), - members={ - "guardrailId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "guardrailVersion": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -MAX_TOKENS = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#MaxTokens"), - shape_type=ShapeType.INTEGER, -) - -RAG_STOP_SEQUENCES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RAGStopSequences"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, -) - -TEXT_INFERENCE_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#TextInferenceConfig"), - members={ - "temperature": {"target": TEMPERATURE}, - "topP": {"target": TOP_P}, - "maxTokens": {"target": MAX_TOKENS}, - "stopSequences": {"target": RAG_STOP_SEQUENCES}, - }, -) - -INFERENCE_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#InferenceConfig"), - members={"textInferenceConfig": {"target": TEXT_INFERENCE_CONFIG}}, -) - -TEXT_PROMPT_TEMPLATE = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#TextPromptTemplate"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -PROMPT_TEMPLATE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#PromptTemplate"), - members={"textPromptTemplate": {"target": TEXT_PROMPT_TEMPLATE}}, -) - -EXTERNAL_SOURCES_GENERATION_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentruntime#ExternalSourcesGenerationConfiguration" - ), - members={ - "promptTemplate": {"target": PROMPT_TEMPLATE}, - "guardrailConfiguration": {"target": GUARDRAIL_CONFIGURATION}, - "inferenceConfig": {"target": INFERENCE_CONFIG}, - "additionalModelRequestFields": {"target": ADDITIONAL_MODEL_REQUEST_FIELDS}, - "performanceConfig": {"target": PERFORMANCE_CONFIGURATION}, - }, -) - -CONTENT_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#ContentType"), - shape_type=ShapeType.STRING, -) - -IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#Identifier"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -BYTE_CONTENT_DOC = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ByteContentDoc"), - members={ - "identifier": { - "target": IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "contentType": { - "target": CONTENT_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "data": { - "target": BYTE_CONTENT_BLOB, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -S3_OBJECT_DOC = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#S3ObjectDoc"), - members={ - "uri": { - "target": S3_URI, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -EXTERNAL_SOURCE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ExternalSourceType"), - shape_type=ShapeType.ENUM, - members={"S3": {"target": UNIT}, "BYTE_CONTENT": {"target": UNIT}}, -) - -EXTERNAL_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ExternalSource"), - members={ - "sourceType": { - "target": EXTERNAL_SOURCE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "s3Location": {"target": S3_OBJECT_DOC}, - "byteContent": {"target": BYTE_CONTENT_DOC}, - }, -) - -EXTERNAL_SOURCES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ExternalSources"), - shape_type=ShapeType.LIST, - members={"member": {"target": EXTERNAL_SOURCE}}, -) - -EXTERNAL_SOURCES_RETRIEVE_AND_GENERATE_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentruntime#ExternalSourcesRetrieveAndGenerateConfiguration" - ), - members={ - "modelArn": { - "target": BEDROCK_MODEL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "sources": { - "target": EXTERNAL_SOURCES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "generationConfiguration": { - "target": EXTERNAL_SOURCES_GENERATION_CONFIGURATION - }, - }, -) - -GENERATION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GenerationConfiguration"), - members={ - "promptTemplate": {"target": PROMPT_TEMPLATE}, - "guardrailConfiguration": {"target": GUARDRAIL_CONFIGURATION}, - "inferenceConfig": {"target": INFERENCE_CONFIG}, - "additionalModelRequestFields": {"target": ADDITIONAL_MODEL_REQUEST_FIELDS}, - "performanceConfig": {"target": PERFORMANCE_CONFIGURATION}, - }, -) - -QUERY_TRANSFORMATION_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#QueryTransformationType"), - shape_type=ShapeType.ENUM, - members={"QUERY_DECOMPOSITION": {"target": UNIT}}, -) - -QUERY_TRANSFORMATION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#QueryTransformationConfiguration"), - members={ - "type": { - "target": QUERY_TRANSFORMATION_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -ORCHESTRATION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#OrchestrationConfiguration"), - members={ - "promptTemplate": {"target": PROMPT_TEMPLATE}, - "inferenceConfig": {"target": INFERENCE_CONFIG}, - "additionalModelRequestFields": {"target": ADDITIONAL_MODEL_REQUEST_FIELDS}, - "queryTransformationConfiguration": { - "target": QUERY_TRANSFORMATION_CONFIGURATION - }, - "performanceConfig": {"target": PERFORMANCE_CONFIGURATION}, - }, -) - -RETRIEVE_AND_GENERATE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RetrieveAndGenerateType"), - shape_type=ShapeType.ENUM, - members={"KNOWLEDGE_BASE": {"target": UNIT}, "EXTERNAL_SOURCES": {"target": UNIT}}, -) - -RETRIEVE_AND_GENERATE_SESSION_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentruntime#RetrieveAndGenerateSessionConfiguration" - ), - members={ - "kmsKeyArn": { - "target": KMS_KEY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -GUADRAIL_ACTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GuadrailAction"), - shape_type=ShapeType.ENUM, - members={"INTERVENED": {"target": UNIT}, "NONE": {"target": UNIT}}, -) - -RETRIEVE_AND_GENERATE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RetrieveAndGenerateOutput"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "text": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -RETRIEVE_AND_GENERATE_OPERATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RetrieveAndGenerateOperationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#RetrieveAndGenerateResponse", - ) - ], - members={ - "sessionId": { - "target": SESSION_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "output": { - "target": RETRIEVE_AND_GENERATE_OUTPUT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "citations": {"target": CITATIONS}, - "guardrailAction": {"target": GUADRAIL_ACTION}, - }, -) - -CITATION_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#CitationEvent"), - members={ - "citation": {"target": CITATION}, - "generatedResponsePart": {"target": GENERATED_RESPONSE_PART}, - "retrievedReferences": {"target": RETRIEVED_REFERENCES}, - }, -) - -GUARDRAIL_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GuardrailEvent"), - members={"action": {"target": GUADRAIL_ACTION}}, -) - -RETRIEVE_AND_GENERATE_OUTPUT_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RetrieveAndGenerateOutputEvent"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "text": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -RETRIEVE_AND_GENERATE_STREAM_RESPONSE_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentruntime#RetrieveAndGenerateStreamResponseOutput" - ), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#streaming"))], - members={ - "output": {"target": RETRIEVE_AND_GENERATE_OUTPUT_EVENT}, - "citation": {"target": CITATION_EVENT}, - "guardrail": {"target": GUARDRAIL_EVENT}, - "internalServerException": {"target": INTERNAL_SERVER_EXCEPTION}, - "validationException": {"target": VALIDATION_EXCEPTION}, - "resourceNotFoundException": {"target": RESOURCE_NOT_FOUND_EXCEPTION}, - "serviceQuotaExceededException": {"target": SERVICE_QUOTA_EXCEEDED_EXCEPTION}, - "throttlingException": {"target": THROTTLING_EXCEPTION}, - "accessDeniedException": {"target": ACCESS_DENIED_EXCEPTION}, - "conflictException": {"target": CONFLICT_EXCEPTION}, - "dependencyFailedException": {"target": DEPENDENCY_FAILED_EXCEPTION}, - "badGatewayException": {"target": BAD_GATEWAY_EXCEPTION}, - }, -) - -RETRIEVE_AND_GENERATE_STREAM_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RetrieveAndGenerateStreamOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#RetrieveAndGenerateStreamResponse", - ) - ], - members={ - "stream": { - "target": RETRIEVE_AND_GENERATE_STREAM_RESPONSE_OUTPUT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpPayload")), - ], - }, - "sessionId": { - "target": SESSION_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-bedrock-knowledge-base-session-id", - ), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - }, -) - -INPUT_IMAGE_FORMAT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#InputImageFormat"), - shape_type=ShapeType.ENUM, - members={ - "png": {"target": UNIT}, - "jpeg": {"target": UNIT}, - "gif": {"target": UNIT}, - "webp": {"target": UNIT}, - }, -) - -INPUT_IMAGE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#InputImage"), - members={ - "format": { - "target": INPUT_IMAGE_FORMAT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "inlineContent": { - "target": BYTE_CONTENT_BLOB, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -KNOWLEDGE_BASE_QUERY_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#KnowledgeBaseQueryType"), - shape_type=ShapeType.ENUM, - members={"TEXT": {"target": UNIT}, "IMAGE": {"target": UNIT}}, -) - -KNOWLEDGE_BASE_QUERY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#KnowledgeBaseQuery"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "type": { - "target": KNOWLEDGE_BASE_QUERY_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="TEXT")], - }, - "text": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="")], - }, - "image": {"target": INPUT_IMAGE}, - }, -) - -KNOWLEDGE_BASE_RETRIEVAL_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#KnowledgeBaseRetrievalResult"), - members={ - "content": { - "target": RETRIEVAL_RESULT_CONTENT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "location": {"target": RETRIEVAL_RESULT_LOCATION}, - "score": {"target": DOUBLE}, - "metadata": {"target": RETRIEVAL_RESULT_METADATA}, - "documentId": {"target": DOCUMENT_ID}, - }, -) - -KNOWLEDGE_BASE_RETRIEVAL_RESULTS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#KnowledgeBaseRetrievalResults"), - shape_type=ShapeType.LIST, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"member": {"target": KNOWLEDGE_BASE_RETRIEVAL_RESULT}}, -) - -RETRIEVE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RetrieveOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#RetrieveResponse", - ) - ], - members={ - "retrievalResults": { - "target": KNOWLEDGE_BASE_RETRIEVAL_RESULTS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "guardrailAction": {"target": GUADRAIL_ACTION}, - "nextToken": {"target": NEXT_TOKEN}, - }, -) - -SESSION_METADATA_KEY = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#SessionMetadataKey"), - shape_type=ShapeType.STRING, -) - -SESSION_METADATA_VALUE = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#SessionMetadataValue"), - shape_type=ShapeType.STRING, -) - -SESSION_METADATA_MAP = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#SessionMetadataMap"), - shape_type=ShapeType.MAP, - members={ - "key": {"target": SESSION_METADATA_KEY}, - "value": {"target": SESSION_METADATA_VALUE}, - }, -) - -TAG_KEY = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#TagKey"), shape_type=ShapeType.STRING -) - -TAG_VALUE = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#TagValue"), - shape_type=ShapeType.STRING, -) - -TAGS_MAP = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#TagsMap"), - shape_type=ShapeType.MAP, - members={"key": {"target": TAG_KEY}, "value": {"target": TAG_VALUE}}, -) - -CREATE_SESSION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#CreateSessionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#CreateSessionRequest", - ) - ], - members={ - "sessionMetadata": {"target": SESSION_METADATA_MAP}, - "encryptionKeyArn": {"target": KMS_KEY_ARN}, - "tags": {"target": TAGS_MAP}, - }, -) - -SESSION_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#SessionArn"), - shape_type=ShapeType.STRING, -) - -UUID = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#Uuid"), shape_type=ShapeType.STRING -) - -SESSION_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#SessionStatus"), - shape_type=ShapeType.ENUM, - members={ - "ACTIVE": {"target": UNIT}, - "EXPIRED": {"target": UNIT}, - "ENDED": {"target": UNIT}, - }, -) - -CREATE_SESSION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#CreateSessionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#CreateSessionResponse", - ) - ], - members={ - "sessionId": { - "target": UUID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "sessionArn": { - "target": SESSION_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "sessionStatus": { - "target": SESSION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -CREATE_SESSION = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#CreateSession"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType({"code": 201, "method": "PUT", "uri": "/sessions/"}), - ) - ], -) - -SESSION_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#SessionIdentifier"), - shape_type=ShapeType.STRING, -) - -DELETE_SESSION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#DeleteSessionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#DeleteSessionRequest", - ) - ], - members={ - "sessionIdentifier": { - "target": SESSION_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -DELETE_SESSION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#DeleteSessionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#DeleteSessionResponse", - ) - ], -) - -DELETE_SESSION = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#DeleteSession"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "DELETE", - "uri": "/sessions/{sessionIdentifier}/", - } - ), - ) - ], -) - -END_SESSION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#EndSessionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#EndSessionRequest", - ) - ], - members={ - "sessionIdentifier": { - "target": SESSION_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -END_SESSION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#EndSessionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#EndSessionResponse", - ) - ], - members={ - "sessionId": { - "target": UUID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "sessionArn": { - "target": SESSION_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "sessionStatus": { - "target": SESSION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -END_SESSION = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#EndSession"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "PATCH", "uri": "/sessions/{sessionIdentifier}"} - ), - ) - ], -) - -GET_SESSION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GetSessionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#GetSessionRequest", - ) - ], - members={ - "sessionIdentifier": { - "target": SESSION_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -GET_SESSION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GetSessionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#GetSessionResponse", - ) - ], - members={ - "sessionId": { - "target": UUID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "sessionArn": { - "target": SESSION_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "sessionStatus": { - "target": SESSION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastUpdatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "sessionMetadata": {"target": SESSION_METADATA_MAP}, - "encryptionKeyArn": {"target": KMS_KEY_ARN}, - }, -) - -GET_SESSION = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#GetSession"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "GET", "uri": "/sessions/{sessionIdentifier}/"} - ), - ) - ], -) - -INVOCATION_DESCRIPTION = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#InvocationDescription"), - shape_type=ShapeType.STRING, -) - -CREATE_INVOCATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#CreateInvocationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#CreateInvocationRequest", - ) - ], - members={ - "invocationId": {"target": UUID}, - "description": {"target": INVOCATION_DESCRIPTION}, - "sessionIdentifier": { - "target": SESSION_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -CREATE_INVOCATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#CreateInvocationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#CreateInvocationResponse", - ) - ], - members={ - "sessionId": { - "target": UUID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "invocationId": { - "target": UUID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -CREATE_INVOCATION = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#CreateInvocation"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 201, - "method": "PUT", - "uri": "/sessions/{sessionIdentifier}/invocations/", - } - ), - ) - ], -) - -INVOCATION_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#InvocationIdentifier"), - shape_type=ShapeType.STRING, -) - -LIST_INVOCATIONS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ListInvocationsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#ListInvocationsRequest", - ) - ], - members={ - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=10), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults"), - ], - }, - "sessionIdentifier": { - "target": SESSION_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -INVOCATION_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#InvocationSummary"), - members={ - "sessionId": { - "target": UUID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "invocationId": { - "target": UUID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -INVOCATION_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#InvocationSummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": INVOCATION_SUMMARY}}, -) - -LIST_INVOCATIONS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ListInvocationsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#ListInvocationsResponse", - ) - ], - members={ - "invocationSummaries": { - "target": INVOCATION_SUMMARIES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": NEXT_TOKEN}, - }, -) - -LIST_INVOCATIONS = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#ListInvocations"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "POST", - "uri": "/sessions/{sessionIdentifier}/invocations/", - } - ), - ) - ], -) - -GET_INVOCATION_STEP_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GetInvocationStepInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#GetInvocationStepRequest", - ) - ], - members={ - "invocationIdentifier": { - "target": INVOCATION_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "invocationStepId": { - "target": UUID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "sessionIdentifier": { - "target": SESSION_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -IMAGE_FORMAT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ImageFormat"), - shape_type=ShapeType.ENUM, - members={ - "PNG": {"target": UNIT}, - "JPEG": {"target": UNIT}, - "GIF": {"target": UNIT}, - "WEBP": {"target": UNIT}, - }, -) - -S3_LOCATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#S3Location"), - members={ - "uri": { - "target": S3_URI, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -IMAGE_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ImageSource"), - shape_type=ShapeType.UNION, - members={"bytes": {"target": BLOB}, "s3Location": {"target": S3_LOCATION}}, -) - -IMAGE_BLOCK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ImageBlock"), - members={ - "format": { - "target": IMAGE_FORMAT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "source": { - "target": IMAGE_SOURCE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -BEDROCK_SESSION_CONTENT_BLOCK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#BedrockSessionContentBlock"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"text": {"target": STRING}, "image": {"target": IMAGE_BLOCK}}, -) - -BEDROCK_SESSION_CONTENT_BLOCKS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#BedrockSessionContentBlocks"), - shape_type=ShapeType.LIST, - members={"member": {"target": BEDROCK_SESSION_CONTENT_BLOCK}}, -) - -INVOCATION_STEP_PAYLOAD = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#InvocationStepPayload"), - shape_type=ShapeType.UNION, - members={"contentBlocks": {"target": BEDROCK_SESSION_CONTENT_BLOCKS}}, -) - -INVOCATION_STEP = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#InvocationStep"), - members={ - "sessionId": { - "target": UUID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "invocationId": { - "target": UUID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "invocationStepId": { - "target": UUID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "invocationStepTime": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "payload": { - "target": INVOCATION_STEP_PAYLOAD, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -GET_INVOCATION_STEP_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#GetInvocationStepOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#GetInvocationStepResponse", - ) - ], - members={ - "invocationStep": { - "target": INVOCATION_STEP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -GET_INVOCATION_STEP = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#GetInvocationStep"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "POST", - "uri": "/sessions/{sessionIdentifier}/invocationSteps/{invocationStepId}", - } - ), - ) - ], -) - -LIST_INVOCATION_STEPS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ListInvocationStepsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#ListInvocationStepsRequest", - ) - ], - members={ - "invocationIdentifier": {"target": INVOCATION_IDENTIFIER}, - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=10), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults"), - ], - }, - "sessionIdentifier": { - "target": SESSION_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -INVOCATION_STEP_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#InvocationStepSummary"), - members={ - "sessionId": { - "target": UUID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "invocationId": { - "target": UUID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "invocationStepId": { - "target": UUID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "invocationStepTime": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -INVOCATION_STEP_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#InvocationStepSummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": INVOCATION_STEP_SUMMARY}}, -) - -LIST_INVOCATION_STEPS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ListInvocationStepsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#ListInvocationStepsResponse", - ) - ], - members={ - "invocationStepSummaries": { - "target": INVOCATION_STEP_SUMMARIES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": NEXT_TOKEN}, - }, -) - -LIST_INVOCATION_STEPS = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#ListInvocationSteps"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "POST", - "uri": "/sessions/{sessionIdentifier}/invocationSteps/", - } - ), - ) - ], -) - -PUT_INVOCATION_STEP_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#PutInvocationStepInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#PutInvocationStepRequest", - ) - ], - members={ - "sessionIdentifier": { - "target": SESSION_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "invocationIdentifier": { - "target": INVOCATION_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "invocationStepTime": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "payload": { - "target": INVOCATION_STEP_PAYLOAD, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "invocationStepId": {"target": UUID}, - }, -) - -PUT_INVOCATION_STEP_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#PutInvocationStepOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#PutInvocationStepResponse", - ) - ], - members={ - "invocationStepId": { - "target": UUID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -PUT_INVOCATION_STEP = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#PutInvocationStep"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 201, - "method": "PUT", - "uri": "/sessions/{sessionIdentifier}/invocationSteps/", - } - ), - ) - ], -) - -LIST_SESSIONS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ListSessionsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#ListSessionsRequest", - ) - ], - members={ - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=10), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults"), - ], - }, - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - }, -) - -SESSION_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#SessionSummary"), - members={ - "sessionId": { - "target": UUID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "sessionArn": { - "target": SESSION_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "sessionStatus": { - "target": SESSION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastUpdatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -SESSION_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#SessionSummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": SESSION_SUMMARY}}, -) - -LIST_SESSIONS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ListSessionsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#ListSessionsResponse", - ) - ], - members={ - "sessionSummaries": { - "target": SESSION_SUMMARIES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": NEXT_TOKEN}, - }, -) - -LIST_SESSIONS = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#ListSessions"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "POST", "uri": "/sessions/"} - ), - ) - ], -) - -UPDATE_SESSION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#UpdateSessionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#UpdateSessionRequest", - ) - ], - members={ - "sessionMetadata": {"target": SESSION_METADATA_MAP}, - "sessionIdentifier": { - "target": SESSION_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -UPDATE_SESSION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#UpdateSessionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#UpdateSessionResponse", - ) - ], - members={ - "sessionId": { - "target": UUID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "sessionArn": { - "target": SESSION_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "sessionStatus": { - "target": SESSION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastUpdatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -UPDATE_SESSION = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#UpdateSession"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "PUT", "uri": "/sessions/{sessionIdentifier}/"} - ), - ) - ], -) - -TAGGABLE_RESOURCES_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#TaggableResourcesArn"), - shape_type=ShapeType.STRING, -) - -LIST_TAGS_FOR_RESOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ListTagsForResourceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#ListTagsForResourceRequest", - ) - ], - members={ - "resourceArn": { - "target": TAGGABLE_RESOURCES_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -LIST_TAGS_FOR_RESOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ListTagsForResourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#ListTagsForResourceResponse", - ) - ], - members={"tags": {"target": TAGS_MAP}}, -) - -LIST_TAGS_FOR_RESOURCE = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#ListTagsForResource"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "GET", "uri": "/tags/{resourceArn}"} - ), - ) - ], -) - -TAG_RESOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#TagResourceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#TagResourceRequest", - ) - ], - members={ - "resourceArn": { - "target": TAGGABLE_RESOURCES_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "tags": { - "target": TAGS_MAP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -TAG_RESOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#TagResourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#TagResourceResponse", - ) - ], -) - -TAG_RESOURCE = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#TagResource"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "POST", "uri": "/tags/{resourceArn}"} - ), - ) - ], -) - -TAG_KEY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#TagKeyList"), - shape_type=ShapeType.LIST, - members={"member": {"target": TAG_KEY}}, -) - -UNTAG_RESOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#UntagResourceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#UntagResourceRequest", - ) - ], - members={ - "resourceArn": { - "target": TAGGABLE_RESOURCES_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "tagKeys": { - "target": TAG_KEY_LIST, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="tagKeys"), - ], - }, - }, -) - -UNTAG_RESOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#UntagResourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#UntagResourceResponse", - ) - ], -) - -UNTAG_RESOURCE = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#UntagResource"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "DELETE", "uri": "/tags/{resourceArn}"} - ), - ) - ], -) - -RETRIEVAL_FILTER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RetrievalFilter"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "equals": {"target": FILTER_ATTRIBUTE}, - "notEquals": {"target": FILTER_ATTRIBUTE}, - "greaterThan": {"target": FILTER_ATTRIBUTE}, - "greaterThanOrEquals": {"target": FILTER_ATTRIBUTE}, - "lessThan": {"target": FILTER_ATTRIBUTE}, - "lessThanOrEquals": {"target": FILTER_ATTRIBUTE}, - "in": {"target": FILTER_ATTRIBUTE}, - "notIn": {"target": FILTER_ATTRIBUTE}, - "startsWith": {"target": FILTER_ATTRIBUTE}, - "listContains": {"target": FILTER_ATTRIBUTE}, - "stringContains": {"target": FILTER_ATTRIBUTE}, - # This needs to reference a schema that isn't defined yet. - # It will be populated with a non-null value at the end of the file. - "andAll": None, - # This needs to reference a schema that isn't defined yet. - # It will be populated with a non-null value at the end of the file. - "orAll": None, - }, -) - -RETRIEVAL_FILTER_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RetrievalFilterList"), - shape_type=ShapeType.LIST, - members={"member": {"target": RETRIEVAL_FILTER}}, -) - -KNOWLEDGE_BASE_VECTOR_SEARCH_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentruntime#KnowledgeBaseVectorSearchConfiguration" - ), - members={ - "numberOfResults": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=5)], - }, - "overrideSearchType": {"target": SEARCH_TYPE}, - "filter": {"target": RETRIEVAL_FILTER}, - "rerankingConfiguration": {"target": VECTOR_SEARCH_RERANKING_CONFIGURATION}, - "implicitFilterConfiguration": {"target": IMPLICIT_FILTER_CONFIGURATION}, - }, -) - -MANAGED_SEARCH_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#ManagedSearchConfiguration"), - members={ - "numberOfResults": {"target": INTEGER}, - "filter": {"target": RETRIEVAL_FILTER}, - "rerankingModelType": {"target": RERANKING_MODEL_TYPE}, - "rerankingConfiguration": {"target": MANAGED_SEARCH_RERANKING_CONFIGURATION}, - }, -) - -RETRIEVAL_OVERRIDES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RetrievalOverrides"), - members={ - "filter": {"target": RETRIEVAL_FILTER}, - "maxNumberOfResults": {"target": INTEGER}, - }, -) - -KNOWLEDGE_BASE_RETRIEVER_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#KnowledgeBaseRetrieverConfiguration"), - members={ - "knowledgeBaseId": { - "target": KNOWLEDGE_BASE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "retrievalOverrides": {"target": RETRIEVAL_OVERRIDES}, - }, -) - -RETRIEVER_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RetrieverConfiguration"), - shape_type=ShapeType.UNION, - members={"knowledgeBase": {"target": KNOWLEDGE_BASE_RETRIEVER_CONFIGURATION}}, -) - -AGENTIC_RETRIEVER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgenticRetriever"), - members={ - "description": {"target": STRING}, - "configuration": { - "target": RETRIEVER_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -AGENTIC_RETRIEVERS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgenticRetrievers"), - shape_type=ShapeType.LIST, - members={"member": {"target": AGENTIC_RETRIEVER}}, -) - -AGENTIC_RETRIEVE_STREAM_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgenticRetrieveStreamInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#AgenticRetrieveStreamRequest", - ) - ], - members={ - "messages": { - "target": AGENTIC_RETRIEVE_MESSAGES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "retrievers": { - "target": AGENTIC_RETRIEVERS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agenticRetrieveConfiguration": { - "target": AGENTIC_RETRIEVE_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "policyConfiguration": {"target": AGENTIC_RETRIEVE_POLICY_CONFIGURATION}, - "nextToken": {"target": NEXT_TOKEN}, - "userContext": {"target": USER_CONTEXT}, - "memoryConfiguration": {"target": AGENTIC_RETRIEVE_MEMORY_CONFIGURATION}, - "generateResponse": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=True)], - }, - }, -) - -KNOWLEDGE_BASE_RETRIEVAL_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#KnowledgeBaseRetrievalConfiguration"), - members={ - "vectorSearchConfiguration": { - "target": KNOWLEDGE_BASE_VECTOR_SEARCH_CONFIGURATION - }, - "managedSearchConfiguration": {"target": MANAGED_SEARCH_CONFIGURATION}, - }, -) - -AGENTIC_RETRIEVE_STREAM = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#AgenticRetrieveStream"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "POST", "uri": "/agenticRetrieveStream"} - ), - ) - ], -) - -KNOWLEDGE_BASE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#KnowledgeBase"), - members={ - "knowledgeBaseId": { - "target": KNOWLEDGE_BASE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": { - "target": RESOURCE_DESCRIPTION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "retrievalConfiguration": {"target": KNOWLEDGE_BASE_RETRIEVAL_CONFIGURATION}, - }, -) - -KNOWLEDGE_BASE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#KnowledgeBaseConfiguration"), - members={ - "knowledgeBaseId": { - "target": KNOWLEDGE_BASE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "retrievalConfiguration": { - "target": KNOWLEDGE_BASE_RETRIEVAL_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -KNOWLEDGE_BASE_RETRIEVE_AND_GENERATE_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentruntime#KnowledgeBaseRetrieveAndGenerateConfiguration" - ), - members={ - "knowledgeBaseId": { - "target": KNOWLEDGE_BASE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelArn": { - "target": BEDROCK_MODEL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "retrievalConfiguration": {"target": KNOWLEDGE_BASE_RETRIEVAL_CONFIGURATION}, - "generationConfiguration": {"target": GENERATION_CONFIGURATION}, - "orchestrationConfiguration": {"target": ORCHESTRATION_CONFIGURATION}, - }, -) - -RETRIEVE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RetrieveInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#RetrieveRequest", - ) - ], - members={ - "knowledgeBaseId": { - "target": KNOWLEDGE_BASE_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "retrievalQuery": { - "target": KNOWLEDGE_BASE_QUERY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "retrievalConfiguration": {"target": KNOWLEDGE_BASE_RETRIEVAL_CONFIGURATION}, - "guardrailConfiguration": {"target": GUARDRAIL_CONFIGURATION}, - "nextToken": {"target": NEXT_TOKEN}, - "userContext": {"target": USER_CONTEXT}, - }, -) - -RETRIEVE = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#Retrieve"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "POST", - "uri": "/knowledgebases/{knowledgeBaseId}/retrieve", - } - ), - ) - ], -) - -KNOWLEDGE_BASE_CONFIGURATIONS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#KnowledgeBaseConfigurations"), - shape_type=ShapeType.LIST, - members={"member": {"target": KNOWLEDGE_BASE_CONFIGURATION}}, -) - -KNOWLEDGE_BASES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#KnowledgeBases"), - shape_type=ShapeType.LIST, - members={"member": {"target": KNOWLEDGE_BASE}}, -) - -RETRIEVE_AND_GENERATE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RetrieveAndGenerateConfiguration"), - members={ - "type": { - "target": RETRIEVE_AND_GENERATE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "knowledgeBaseConfiguration": { - "target": KNOWLEDGE_BASE_RETRIEVE_AND_GENERATE_CONFIGURATION - }, - "externalSourcesConfiguration": { - "target": EXTERNAL_SOURCES_RETRIEVE_AND_GENERATE_CONFIGURATION - }, - }, -) - -COLLABORATOR = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#Collaborator"), - members={ - "customerEncryptionKeyArn": {"target": KMS_KEY_ARN}, - "foundationModel": { - "target": MODEL_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "instruction": { - "target": INSTRUCTION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "idleSessionTTLInSeconds": {"target": SESSION_TTL}, - "actionGroups": {"target": AGENT_ACTION_GROUPS}, - "knowledgeBases": {"target": KNOWLEDGE_BASES}, - "guardrailConfiguration": {"target": GUARDRAIL_CONFIGURATION_WITH_ARN}, - "promptOverrideConfiguration": {"target": PROMPT_OVERRIDE_CONFIGURATION}, - "agentCollaboration": {"target": AGENT_COLLABORATION}, - "collaboratorConfigurations": {"target": COLLABORATOR_CONFIGURATIONS}, - "agentName": {"target": NAME}, - }, -) - -RETRIEVE_AND_GENERATE_OPERATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RetrieveAndGenerateOperationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#RetrieveAndGenerateRequest", - ) - ], - members={ - "sessionId": {"target": SESSION_ID}, - "input": { - "target": RETRIEVE_AND_GENERATE_INPUT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "retrieveAndGenerateConfiguration": { - "target": RETRIEVE_AND_GENERATE_CONFIGURATION - }, - "sessionConfiguration": {"target": RETRIEVE_AND_GENERATE_SESSION_CONFIGURATION}, - "userContext": {"target": USER_CONTEXT}, - }, -) - -RETRIEVE_AND_GENERATE_STREAM_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#RetrieveAndGenerateStreamInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#RetrieveAndGenerateStreamRequest", - ) - ], - members={ - "sessionId": {"target": SESSION_ID}, - "input": { - "target": RETRIEVE_AND_GENERATE_INPUT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "retrieveAndGenerateConfiguration": { - "target": RETRIEVE_AND_GENERATE_CONFIGURATION - }, - "sessionConfiguration": {"target": RETRIEVE_AND_GENERATE_SESSION_CONFIGURATION}, - "userContext": {"target": USER_CONTEXT}, - }, -) - -SESSION_STATE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#SessionState"), - members={ - "sessionAttributes": {"target": SESSION_ATTRIBUTES_MAP}, - "promptSessionAttributes": {"target": PROMPT_SESSION_ATTRIBUTES_MAP}, - "returnControlInvocationResults": {"target": RETURN_CONTROL_INVOCATION_RESULTS}, - "invocationId": {"target": STRING}, - "files": {"target": INPUT_FILES}, - "knowledgeBaseConfigurations": {"target": KNOWLEDGE_BASE_CONFIGURATIONS}, - "conversationHistory": {"target": CONVERSATION_HISTORY}, - }, -) - -RETRIEVE_AND_GENERATE = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#RetrieveAndGenerate"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "POST", "uri": "/retrieveAndGenerate"} - ), - ) - ], -) - -RETRIEVE_AND_GENERATE_STREAM = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#RetrieveAndGenerateStream"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "POST", "uri": "/retrieveAndGenerateStream"} - ), - ) - ], -) - -COLLABORATORS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#Collaborators"), - shape_type=ShapeType.LIST, - members={"member": {"target": COLLABORATOR}}, -) - -INVOKE_AGENT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#InvokeAgentInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#InvokeAgentRequest", - ) - ], - members={ - "sessionState": {"target": SESSION_STATE}, - "agentId": { - "target": AGENT_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "agentAliasId": { - "target": AGENT_ALIAS_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "sessionId": { - "target": SESSION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "endSession": {"target": BOOLEAN}, - "enableTrace": {"target": BOOLEAN}, - "inputText": {"target": INPUT_TEXT}, - "memoryId": {"target": MEMORY_ID}, - "bedrockModelConfigurations": {"target": BEDROCK_MODEL_CONFIGURATIONS}, - "streamingConfigurations": {"target": STREAMING_CONFIGURATIONS}, - "promptCreationConfigurations": {"target": PROMPT_CREATION_CONFIGURATIONS}, - "sourceArn": { - "target": AWS_RESOURCE_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="x-amz-source-arn") - ], - }, - }, -) - -INVOKE_AGENT = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#InvokeAgent"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "POST", - "uri": "/agents/{agentId}/agentAliases/{agentAliasId}/sessions/{sessionId}/text", - } - ), - ) - ], -) - -INVOKE_INLINE_AGENT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentruntime#InvokeInlineAgentInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentruntime#InvokeInlineAgentRequest", - ) - ], - members={ - "customerEncryptionKeyArn": {"target": KMS_KEY_ARN}, - "foundationModel": { - "target": MODEL_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "instruction": { - "target": INSTRUCTION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "idleSessionTTLInSeconds": {"target": SESSION_TTL}, - "actionGroups": {"target": AGENT_ACTION_GROUPS}, - "knowledgeBases": {"target": KNOWLEDGE_BASES}, - "guardrailConfiguration": {"target": GUARDRAIL_CONFIGURATION_WITH_ARN}, - "promptOverrideConfiguration": {"target": PROMPT_OVERRIDE_CONFIGURATION}, - "agentCollaboration": {"target": AGENT_COLLABORATION}, - "collaboratorConfigurations": {"target": COLLABORATOR_CONFIGURATIONS}, - "agentName": {"target": NAME}, - "sessionId": { - "target": SESSION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "endSession": {"target": BOOLEAN}, - "enableTrace": {"target": BOOLEAN}, - "inputText": {"target": INPUT_TEXT}, - "streamingConfigurations": {"target": STREAMING_CONFIGURATIONS}, - "promptCreationConfigurations": {"target": PROMPT_CREATION_CONFIGURATIONS}, - "inlineSessionState": {"target": INLINE_SESSION_STATE}, - "collaborators": {"target": COLLABORATORS}, - "bedrockModelConfigurations": {"target": INLINE_BEDROCK_MODEL_CONFIGURATIONS}, - "orchestrationType": {"target": ORCHESTRATION_TYPE}, - "customOrchestration": {"target": CUSTOM_ORCHESTRATION}, - }, -) - -INVOKE_INLINE_AGENT = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#InvokeInlineAgent"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "POST", "uri": "/agents/{sessionId}"} - ), - ) - ], -) - -AMAZON_BEDROCK_AGENT_RUN_TIME_SERVICE = Schema( - id=ShapeID("com.amazonaws.bedrockagentruntime#AmazonBedrockAgentRunTimeService"), - shape_type=ShapeType.SERVICE, - traits=[ - Trait.new( - id=ShapeID("aws.auth#sigv4"), value=MappingProxyType({"name": "bedrock"}) - ), - Trait.new( - id=ShapeID("smithy.rules#endpointBdd"), - value=MappingProxyType( - { - "version": "1.1", - "parameters": MappingProxyType( - { - "Region": MappingProxyType( - { - "builtIn": "AWS::Region", - "required": False, - "documentation": "The AWS region used to dispatch the request.", - "type": "string", - } - ), - "UseDualStack": MappingProxyType( - { - "builtIn": "AWS::UseDualStack", - "required": True, - "default": False, - "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", - "type": "boolean", - } - ), - "UseFIPS": MappingProxyType( - { - "builtIn": "AWS::UseFIPS", - "required": True, - "default": False, - "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", - "type": "boolean", - } - ), - "Endpoint": MappingProxyType( - { - "builtIn": "SDK::Endpoint", - "required": False, - "documentation": "Override the endpoint used to send this request", - "type": "string", - } - ), - } - ), - "conditions": ( - MappingProxyType( - { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "Endpoint"}),), - } - ), - MappingProxyType( - { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "Region"}),), - } - ), - MappingProxyType( - { - "fn": "aws.partition", - "argv": (MappingProxyType({"ref": "Region"}),), - "assign": "PartitionResult", - } - ), - MappingProxyType( +AMAZON_BEDROCK_AGENT_RUN_TIME_SERVICE: StaticSchema = ( + 21, + n0, + _ABARTS, + { + _aw: MappingProxyType({"name": "bedrock"}), + _sBm: MappingProxyType( + { + "version": "1.1", + "parameters": MappingProxyType( + { + "Region": MappingProxyType( { - "fn": "booleanEquals", - "argv": (MappingProxyType({"ref": "UseFIPS"}), True), + "builtIn": "AWS::Region", + "required": False, + "documentation": "The AWS region used to dispatch the request.", + "type": "string", } ), - MappingProxyType( + "UseDualStack": MappingProxyType( { - "fn": "booleanEquals", - "argv": ( - MappingProxyType({"ref": "UseDualStack"}), - True, - ), + "builtIn": "AWS::UseDualStack", + "required": True, + "default": False, + "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", + "type": "boolean", } ), - MappingProxyType( + "UseFIPS": MappingProxyType( { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "supportsDualStack", - ), - } - ), - True, - ), + "builtIn": "AWS::UseFIPS", + "required": True, + "default": False, + "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", + "type": "boolean", } ), - MappingProxyType( + "Endpoint": MappingProxyType( { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "supportsFIPS", - ), - } - ), - True, - ), + "builtIn": "SDK::Endpoint", + "required": False, + "documentation": "Override the endpoint used to send this request", + "type": "string", } ), + } + ), + "conditions": ( + MappingProxyType( + { + "fn": "isSet", + "argv": (MappingProxyType({"ref": "Endpoint"}),), + } ), - "results": ( - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: FIPS and custom endpoint are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": MappingProxyType({"ref": "Endpoint"}), - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://bedrock-agent-runtime-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "FIPS and DualStack are enabled, but this partition does not support one or both", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://bedrock-agent-runtime-fips.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "FIPS is enabled but this partition does not support FIPS", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + MappingProxyType( + {"fn": "isSet", "argv": (MappingProxyType({"ref": "Region"}),)} + ), + MappingProxyType( + { + "fn": "aws.partition", + "argv": (MappingProxyType({"ref": "Region"}),), + "assign": "PartitionResult", + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": (MappingProxyType({"ref": "UseFIPS"}), True), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": (MappingProxyType({"ref": "UseDualStack"}), True), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( { - "url": "https://bedrock-agent-runtime.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "supportsDualStack", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "DualStack is enabled but this partition does not support DualStack", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + True, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( { - "url": "https://bedrock-agent-runtime.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "supportsFIPS", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: Missing Region", - "type": "error", - } - ), + True, + ), + } + ), + ), + "results": ( + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: FIPS and custom endpoint are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": MappingProxyType({"ref": "Endpoint"}), + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://bedrock-agent-runtime-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS and DualStack are enabled, but this partition does not support one or both", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://bedrock-agent-runtime-fips.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS is enabled but this partition does not support FIPS", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://bedrock-agent-runtime.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "DualStack is enabled but this partition does not support DualStack", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://bedrock-agent-runtime.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Missing Region", + "type": "error", + } ), - "root": 2, - "nodeCount": 13, - "nodes": "/////wAAAAH/////AAAAAAAAAAwAAAADAAAAAQAAAAQF9eELAAAAAgAAAAUF9eELAAAAAwAAAAgAAAAGAAAABAAAAAcF9eEKAAAABQX14QgF9eEJAAAABAAAAAoAAAAJAAAABgX14QYF9eEHAAAABQAAAAsF9eEFAAAABgX14QQF9eEFAAAAAwX14QEAAAANAAAABAX14QIF9eED", - } - ), + ), + "root": 2, + "nodeCount": 13, + "nodes": "/////wAAAAH/////AAAAAAAAAAwAAAADAAAAAQAAAAQF9eELAAAAAgAAAAUF9eELAAAAAwAAAAgAAAAGAAAABAAAAAcF9eEKAAAABQX14QgF9eEJAAAABAAAAAoAAAAJAAAABgX14QYF9eEHAAAABQAAAAsF9eEFAAAABgX14QQF9eEFAAAAAwX14QEAAAANAAAABAX14QIF9eED", + } ), - Trait.new( - id=ShapeID("aws.api#service"), - value=MappingProxyType( - { - "sdkId": "Bedrock Agent Runtime", - "arnNamespace": "bedrock", - "endpointPrefix": "bedrock-agent-runtime", - "cloudTrailEventSource": "bedrock.amazonaws.com", - } - ), + _aws: MappingProxyType( + { + "sdkId": "Bedrock Agent Runtime", + "arnNamespace": "bedrock", + "endpointPrefix": "bedrock-agent-runtime", + "cloudTrailEventSource": "bedrock.amazonaws.com", + } ), - Trait.new( - id=ShapeID("aws.protocols#restJson1"), - value=MappingProxyType( - {"http": ("h2", "http/1.1"), "eventStreamHttp": ("h2", "http/1.1")} - ), + _aJ: MappingProxyType( + {"http": ("h2", "http/1.1"), "eventStreamHttp": ("h2", "http/1.1")} ), - ], -) - -RETRIEVAL_FILTER.members["andAll"] = Schema.member( - id=RETRIEVAL_FILTER.id.with_member("andAll"), target=RETRIEVAL_FILTER_LIST, index=11 -) - -RETRIEVAL_FILTER.members["orAll"] = Schema.member( - id=RETRIEVAL_FILTER.id.with_member("orAll"), target=RETRIEVAL_FILTER_LIST, index=12 + }, ) diff --git a/clients/aws-sdk-bedrock-agent-runtime/src/aws_sdk_bedrock_agent_runtime/client.py b/clients/aws-sdk-bedrock-agent-runtime/src/aws_sdk_bedrock_agent_runtime/client.py index fbce0714..f080814d 100644 --- a/clients/aws-sdk-bedrock-agent-runtime/src/aws_sdk_bedrock_agent_runtime/client.py +++ b/clients/aws-sdk-bedrock-agent-runtime/src/aws_sdk_bedrock_agent_runtime/client.py @@ -1,19 +1,21 @@ # Code generated by smithy-python-codegen DO NOT EDIT. +from __future__ import annotations + from copy import deepcopy import logging from typing import Any, cast +from smithy_aws_core.aio.identity.chain import AsyncIdentityChain from smithy_aws_core.config import ConfigSource from smithy_aws_core.identity import AWSCredentialsIdentity -from smithy_aws_core.identity.chain import IdentityChain -from smithy_core.aio.client import AsyncClient, ClientCall, RequestPipeline -from smithy_core.aio.eventstream import OutputEventStream +from smithy_core.aio.client import AsyncClient, AsyncClientCall, AsyncRequestPipeline +from smithy_core.aio.eventstream import AsyncOutputEventStream from smithy_core.deserializers import DeserializeableShape from smithy_core.exceptions import ExpectationNotMetError from smithy_core.schemas import APIOperation from smithy_core.serializers import SerializeableShape -from smithy_http.aio.interfaces import HTTPClient +from smithy_http.aio.interfaces import AsyncHTTPClient from smithy_http.plugins import user_agent_plugin from .config import AsyncBedrockAgentRuntimeConfig, Plugin @@ -25,21 +27,9 @@ CHECK_INGESTED_DOCUMENT_ACL, CREATE_INVOCATION, CREATE_SESSION, - CheckIngestedDocumentAclInput, - CheckIngestedDocumentAclOutput, - CreateInvocationInput, - CreateInvocationOutput, - CreateSessionInput, - CreateSessionOutput, DELETE_AGENT_MEMORY, DELETE_SESSION, - DeleteAgentMemoryInput, - DeleteAgentMemoryOutput, - DeleteSessionInput, - DeleteSessionOutput, END_SESSION, - EndSessionInput, - EndSessionOutput, FlowResponseStream, GENERATE_QUERY, GET_AGENT_MEMORY, @@ -49,22 +39,6 @@ GET_INGESTED_DOCUMENT_ACL, GET_INVOCATION_STEP, GET_SESSION, - GenerateQueryInput, - GenerateQueryOutput, - GetAgentMemoryInput, - GetAgentMemoryOutput, - GetDocumentContentInput, - GetDocumentContentOutput, - GetExecutionFlowSnapshotInput, - GetExecutionFlowSnapshotOutput, - GetFlowExecutionInput, - GetFlowExecutionOutput, - GetIngestedDocumentAclInput, - GetIngestedDocumentAclOutput, - GetInvocationStepInput, - GetInvocationStepOutput, - GetSessionInput, - GetSessionOutput, INVOKE_AGENT, INVOKE_FLOW, INVOKE_INLINE_AGENT, @@ -81,54 +55,24 @@ LIST_INVOCATION_STEPS, LIST_SESSIONS, LIST_TAGS_FOR_RESOURCE, - ListFlowExecutionEventsInput, - ListFlowExecutionEventsOutput, - ListFlowExecutionsInput, - ListFlowExecutionsOutput, - ListInvocationStepsInput, - ListInvocationStepsOutput, - ListInvocationsInput, - ListInvocationsOutput, - ListSessionsInput, - ListSessionsOutput, - ListTagsForResourceInput, - ListTagsForResourceOutput, OPTIMIZE_PROMPT, OptimizePromptInput, OptimizePromptOutput, OptimizedPromptStream, PUT_INVOCATION_STEP, - PutInvocationStepInput, - PutInvocationStepOutput, RERANK, RETRIEVE, RETRIEVE_AND_GENERATE, RETRIEVE_AND_GENERATE_STREAM, - RerankInput, - RerankOutput, ResponseStream, - RetrieveAndGenerateOperationInput, - RetrieveAndGenerateOperationOutput, RetrieveAndGenerateStreamInput, RetrieveAndGenerateStreamOutput, RetrieveAndGenerateStreamResponseOutput, - RetrieveInput, - RetrieveOutput, START_FLOW_EXECUTION, STOP_FLOW_EXECUTION, - StartFlowExecutionInput, - StartFlowExecutionOutput, - StopFlowExecutionInput, - StopFlowExecutionOutput, TAG_RESOURCE, - TagResourceInput, - TagResourceOutput, UNTAG_RESOURCE, UPDATE_SESSION, - UntagResourceInput, - UntagResourceOutput, - UpdateSessionInput, - UpdateSessionOutput, _AgenticRetrieveStreamResponseOutputDeserializer, _FlowResponseStreamDeserializer, _InlineAgentResponseStreamDeserializer, @@ -138,6 +82,70 @@ ) from .user_agent import aws_user_agent_plugin +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .models import ( + CheckIngestedDocumentAclInput, + CheckIngestedDocumentAclOutput, + CreateInvocationInput, + CreateInvocationOutput, + CreateSessionInput, + CreateSessionOutput, + DeleteAgentMemoryInput, + DeleteAgentMemoryOutput, + DeleteSessionInput, + DeleteSessionOutput, + EndSessionInput, + EndSessionOutput, + GenerateQueryInput, + GenerateQueryOutput, + GetAgentMemoryInput, + GetAgentMemoryOutput, + GetDocumentContentInput, + GetDocumentContentOutput, + GetExecutionFlowSnapshotInput, + GetExecutionFlowSnapshotOutput, + GetFlowExecutionInput, + GetFlowExecutionOutput, + GetIngestedDocumentAclInput, + GetIngestedDocumentAclOutput, + GetInvocationStepInput, + GetInvocationStepOutput, + GetSessionInput, + GetSessionOutput, + ListFlowExecutionEventsInput, + ListFlowExecutionEventsOutput, + ListFlowExecutionsInput, + ListFlowExecutionsOutput, + ListInvocationStepsInput, + ListInvocationStepsOutput, + ListInvocationsInput, + ListInvocationsOutput, + ListSessionsInput, + ListSessionsOutput, + ListTagsForResourceInput, + ListTagsForResourceOutput, + PutInvocationStepInput, + PutInvocationStepOutput, + RerankInput, + RerankOutput, + RetrieveAndGenerateOperationInput, + RetrieveAndGenerateOperationOutput, + RetrieveInput, + RetrieveOutput, + StartFlowExecutionInput, + StartFlowExecutionOutput, + StopFlowExecutionInput, + StopFlowExecutionOutput, + TagResourceInput, + TagResourceOutput, + UntagResourceInput, + UntagResourceOutput, + UpdateSessionInput, + UpdateSessionOutput, + ) + logger = logging.getLogger(__name__) @@ -214,12 +222,12 @@ async def _post_setup(self, config: AsyncBedrockAgentRuntimeConfig) -> None: config_file = await config_context.parsed_profiles() if config_context.profile_source is ConfigSource.OVERRIDE: profile_name = config_context.profile_name - config.aws_credentials_identity_resolver = await IdentityChain.create( + config.aws_credentials_identity_resolver = await AsyncIdentityChain.create( AWSCredentialsIdentity, config_file=config_file, profile_name=profile_name, region_override=config.region, - http_client=cast(HTTPClient | None, config.transport), + http_client=cast(AsyncHTTPClient | None, config.transport), ) async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( @@ -228,7 +236,7 @@ async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( operation: APIOperation[I, O], default_plugins: list[Plugin], plugins: list[Plugin] | None, - ) -> tuple[RequestPipeline[Any, Any], ClientCall[I, O]]: + ) -> tuple[AsyncRequestPipeline[Any, Any], AsyncClientCall[I, O]]: if self._closed: raise RuntimeError( "Cannot invoke an operation on a client that has been closed." @@ -264,7 +272,7 @@ async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( async def agentic_retrieve_stream( self, input: AgenticRetrieveStreamInput, plugins: list[Plugin] | None = None - ) -> OutputEventStream[ + ) -> AsyncOutputEventStream[ AgenticRetrieveStreamResponseOutput, AgenticRetrieveStreamOutput ]: """ @@ -290,7 +298,7 @@ async def agentic_retrieve_stream( invocations. Returns: - An `OutputEventStream` for server-to-client streaming. + An `AsyncOutputEventStream` for server-to-client streaming. """ pipeline, call = await self._prepare_call( input, AGENTIC_RETRIEVE_STREAM, [], plugins @@ -690,7 +698,7 @@ async def get_session( async def invoke_agent( self, input: InvokeAgentInput, plugins: list[Plugin] | None = None - ) -> OutputEventStream[ResponseStream, InvokeAgentOutput]: + ) -> AsyncOutputEventStream[ResponseStream, InvokeAgentOutput]: """ Note: Amazon Bedrock Agents (now Amazon Bedrock Agents Classic) is no longer @@ -745,7 +753,7 @@ async def invoke_agent( invocations. Returns: - An `OutputEventStream` for server-to-client streaming. + An `AsyncOutputEventStream` for server-to-client streaming. """ pipeline, call = await self._prepare_call(input, INVOKE_AGENT, [], plugins) return await pipeline.output_stream( @@ -754,7 +762,7 @@ async def invoke_agent( async def invoke_flow( self, input: InvokeFlowInput, plugins: list[Plugin] | None = None - ) -> OutputEventStream[FlowResponseStream, InvokeFlowOutput]: + ) -> AsyncOutputEventStream[FlowResponseStream, InvokeFlowOutput]: """ Invokes an alias of a flow to run the inputs that you specify and return the output of each node as a stream. If there's an error, the error is @@ -777,7 +785,7 @@ async def invoke_flow( invocations. Returns: - An `OutputEventStream` for server-to-client streaming. + An `AsyncOutputEventStream` for server-to-client streaming. """ pipeline, call = await self._prepare_call(input, INVOKE_FLOW, [], plugins) return await pipeline.output_stream( @@ -786,7 +794,7 @@ async def invoke_flow( async def invoke_inline_agent( self, input: InvokeInlineAgentInput, plugins: list[Plugin] | None = None - ) -> OutputEventStream[InlineAgentResponseStream, InvokeInlineAgentOutput]: + ) -> AsyncOutputEventStream[InlineAgentResponseStream, InvokeInlineAgentOutput]: """ Invokes an inline Amazon Bedrock agent using the configurations you provide with the request. @@ -822,7 +830,7 @@ async def invoke_inline_agent( invocations. Returns: - An `OutputEventStream` for server-to-client streaming. + An `AsyncOutputEventStream` for server-to-client streaming. """ pipeline, call = await self._prepare_call( input, INVOKE_INLINE_AGENT, [], plugins @@ -991,7 +999,7 @@ async def list_tags_for_resource( async def optimize_prompt( self, input: OptimizePromptInput, plugins: list[Plugin] | None = None - ) -> OutputEventStream[OptimizedPromptStream, OptimizePromptOutput]: + ) -> AsyncOutputEventStream[OptimizedPromptStream, OptimizePromptOutput]: """ Optimizes a prompt for the task that you specify. For more information, see [Optimize a @@ -1009,7 +1017,7 @@ async def optimize_prompt( invocations. Returns: - An `OutputEventStream` for server-to-client streaming. + An `AsyncOutputEventStream` for server-to-client streaming. """ pipeline, call = await self._prepare_call(input, OPTIMIZE_PROMPT, [], plugins) return await pipeline.output_stream( @@ -1136,7 +1144,7 @@ async def retrieve_and_generate( async def retrieve_and_generate_stream( self, input: RetrieveAndGenerateStreamInput, plugins: list[Plugin] | None = None - ) -> OutputEventStream[ + ) -> AsyncOutputEventStream[ RetrieveAndGenerateStreamResponseOutput, RetrieveAndGenerateStreamOutput ]: """ @@ -1166,7 +1174,7 @@ async def retrieve_and_generate_stream( invocations. Returns: - An `OutputEventStream` for server-to-client streaming. + An `AsyncOutputEventStream` for server-to-client streaming. """ pipeline, call = await self._prepare_call( input, RETRIEVE_AND_GENERATE_STREAM, [], plugins diff --git a/clients/aws-sdk-bedrock-agent-runtime/src/aws_sdk_bedrock_agent_runtime/config.py b/clients/aws-sdk-bedrock-agent-runtime/src/aws_sdk_bedrock_agent_runtime/config.py index 321892bb..f3bb94ba 100644 --- a/clients/aws-sdk-bedrock-agent-runtime/src/aws_sdk_bedrock_agent_runtime/config.py +++ b/clients/aws-sdk-bedrock-agent-runtime/src/aws_sdk_bedrock_agent_runtime/config.py @@ -1,163 +1,184 @@ # Code generated by smithy-python-codegen DO NOT EDIT. from dataclasses import dataclass, field -from typing import Any, Callable, ClassVar, Self, TypeAlias, Union, Unpack +from typing import ( + Any, + Callable, + ClassVar, + Self, + TYPE_CHECKING, + TypeAlias, + Union, + Unpack, +) -from smithy_aws_core.aio.protocols import RestJsonClientProtocol -from smithy_aws_core.auth import SigV4AuthScheme -from smithy_aws_core.config import AwsConfigOverrides, FileSystem -from smithy_aws_core.config.aws_config import AsyncAwsConfig -from smithy_aws_core.config.resolvers import EndpointUriResolver -from smithy_aws_core.config.types import FieldSpec -from smithy_aws_core.endpoints.standard_regional import ( - StandardRegionalEndpointsResolver, +from smithy_aws_core.aio.auth.sigv4 import AsyncSigV4AuthScheme +from smithy_aws_core.aio.config import AsyncFileSystem +from smithy_aws_core.aio.config.aws_config import AsyncAwsConfig, AwsConfigOverrides +from smithy_aws_core.aio.config.resolvers import EndpointUriResolver +from smithy_aws_core.aio.endpoints.standard_regional import ( + AsyncStandardRegionalEndpointsResolver, ) +from smithy_aws_core.aio.protocols import AsyncRestJsonClientProtocol +from smithy_aws_core.config.types import FieldSpec from smithy_aws_core.identity import AWSCredentialsIdentity, AWSIdentityProperties -from smithy_core.aio.interfaces import ( - ClientProtocol, - EndpointResolver, - ProtocolConstructor, - ProtocolSettings, -) -from smithy_core.aio.interfaces.auth import AuthScheme -from smithy_core.aio.interfaces.identity import IdentityResolver -from smithy_core.interceptors import Interceptor +from smithy_core.aio.interfaces import AsyncClientProtocol, AsyncEndpointResolver +from smithy_core.aio.interfaces.auth import AsyncAuthScheme +from smithy_core.aio.interfaces.identity import AsyncIdentityResolver +from smithy_core.interfaces import ProtocolConstructor, ProtocolSettings from smithy_core.interfaces.auth import AuthSchemeResolver from smithy_core.shapes import ShapeID from smithy_http.aio.aiohttp import AIOHTTPClient +from ._private.schemas import AMAZON_BEDROCK_AGENT_RUN_TIME_SERVICE from .auth import HTTPAuthSchemeResolver -from .models import ( - AgenticRetrieveStreamInput, - AgenticRetrieveStreamOutput, - CheckIngestedDocumentAclInput, - CheckIngestedDocumentAclOutput, - CreateInvocationInput, - CreateInvocationOutput, - CreateSessionInput, - CreateSessionOutput, - DeleteAgentMemoryInput, - DeleteAgentMemoryOutput, - DeleteSessionInput, - DeleteSessionOutput, - EndSessionInput, - EndSessionOutput, - GenerateQueryInput, - GenerateQueryOutput, - GetAgentMemoryInput, - GetAgentMemoryOutput, - GetDocumentContentInput, - GetDocumentContentOutput, - GetExecutionFlowSnapshotInput, - GetExecutionFlowSnapshotOutput, - GetFlowExecutionInput, - GetFlowExecutionOutput, - GetIngestedDocumentAclInput, - GetIngestedDocumentAclOutput, - GetInvocationStepInput, - GetInvocationStepOutput, - GetSessionInput, - GetSessionOutput, - InvokeAgentInput, - InvokeAgentOutput, - InvokeFlowInput, - InvokeFlowOutput, - InvokeInlineAgentInput, - InvokeInlineAgentOutput, - ListFlowExecutionEventsInput, - ListFlowExecutionEventsOutput, - ListFlowExecutionsInput, - ListFlowExecutionsOutput, - ListInvocationStepsInput, - ListInvocationStepsOutput, - ListInvocationsInput, - ListInvocationsOutput, - ListSessionsInput, - ListSessionsOutput, - ListTagsForResourceInput, - ListTagsForResourceOutput, - OptimizePromptInput, - OptimizePromptOutput, - PutInvocationStepInput, - PutInvocationStepOutput, - RerankInput, - RerankOutput, - RetrieveAndGenerateOperationInput, - RetrieveAndGenerateOperationOutput, - RetrieveAndGenerateStreamInput, - RetrieveAndGenerateStreamOutput, - RetrieveInput, - RetrieveOutput, - StartFlowExecutionInput, - StartFlowExecutionOutput, - StopFlowExecutionInput, - StopFlowExecutionOutput, - TagResourceInput, - TagResourceOutput, - UntagResourceInput, - UntagResourceOutput, - UpdateSessionInput, - UpdateSessionOutput, -) -_ServiceInterceptor = Union[ - Interceptor[AgenticRetrieveStreamInput, AgenticRetrieveStreamOutput, Any, Any], - Interceptor[ - CheckIngestedDocumentAclInput, CheckIngestedDocumentAclOutput, Any, Any - ], - Interceptor[CreateInvocationInput, CreateInvocationOutput, Any, Any], - Interceptor[CreateSessionInput, CreateSessionOutput, Any, Any], - Interceptor[DeleteAgentMemoryInput, DeleteAgentMemoryOutput, Any, Any], - Interceptor[DeleteSessionInput, DeleteSessionOutput, Any, Any], - Interceptor[EndSessionInput, EndSessionOutput, Any, Any], - Interceptor[GenerateQueryInput, GenerateQueryOutput, Any, Any], - Interceptor[GetAgentMemoryInput, GetAgentMemoryOutput, Any, Any], - Interceptor[GetDocumentContentInput, GetDocumentContentOutput, Any, Any], - Interceptor[ - GetExecutionFlowSnapshotInput, GetExecutionFlowSnapshotOutput, Any, Any - ], - Interceptor[GetFlowExecutionInput, GetFlowExecutionOutput, Any, Any], - Interceptor[GetIngestedDocumentAclInput, GetIngestedDocumentAclOutput, Any, Any], - Interceptor[GetInvocationStepInput, GetInvocationStepOutput, Any, Any], - Interceptor[GetSessionInput, GetSessionOutput, Any, Any], - Interceptor[InvokeAgentInput, InvokeAgentOutput, Any, Any], - Interceptor[InvokeFlowInput, InvokeFlowOutput, Any, Any], - Interceptor[InvokeInlineAgentInput, InvokeInlineAgentOutput, Any, Any], - Interceptor[ListFlowExecutionEventsInput, ListFlowExecutionEventsOutput, Any, Any], - Interceptor[ListFlowExecutionsInput, ListFlowExecutionsOutput, Any, Any], - Interceptor[ListInvocationsInput, ListInvocationsOutput, Any, Any], - Interceptor[ListInvocationStepsInput, ListInvocationStepsOutput, Any, Any], - Interceptor[ListSessionsInput, ListSessionsOutput, Any, Any], - Interceptor[ListTagsForResourceInput, ListTagsForResourceOutput, Any, Any], - Interceptor[OptimizePromptInput, OptimizePromptOutput, Any, Any], - Interceptor[PutInvocationStepInput, PutInvocationStepOutput, Any, Any], - Interceptor[RerankInput, RerankOutput, Any, Any], - Interceptor[RetrieveInput, RetrieveOutput, Any, Any], - Interceptor[ - RetrieveAndGenerateOperationInput, RetrieveAndGenerateOperationOutput, Any, Any - ], - Interceptor[ - RetrieveAndGenerateStreamInput, RetrieveAndGenerateStreamOutput, Any, Any - ], - Interceptor[StartFlowExecutionInput, StartFlowExecutionOutput, Any, Any], - Interceptor[StopFlowExecutionInput, StopFlowExecutionOutput, Any, Any], - Interceptor[TagResourceInput, TagResourceOutput, Any, Any], - Interceptor[UntagResourceInput, UntagResourceOutput, Any, Any], - Interceptor[UpdateSessionInput, UpdateSessionOutput, Any, Any], -] +if TYPE_CHECKING: + from smithy_core.interceptors import Interceptor + from .models import ( + AgenticRetrieveStreamInput, + AgenticRetrieveStreamOutput, + CheckIngestedDocumentAclInput, + CheckIngestedDocumentAclOutput, + CreateInvocationInput, + CreateInvocationOutput, + CreateSessionInput, + CreateSessionOutput, + DeleteAgentMemoryInput, + DeleteAgentMemoryOutput, + DeleteSessionInput, + DeleteSessionOutput, + EndSessionInput, + EndSessionOutput, + GenerateQueryInput, + GenerateQueryOutput, + GetAgentMemoryInput, + GetAgentMemoryOutput, + GetDocumentContentInput, + GetDocumentContentOutput, + GetExecutionFlowSnapshotInput, + GetExecutionFlowSnapshotOutput, + GetFlowExecutionInput, + GetFlowExecutionOutput, + GetIngestedDocumentAclInput, + GetIngestedDocumentAclOutput, + GetInvocationStepInput, + GetInvocationStepOutput, + GetSessionInput, + GetSessionOutput, + InvokeAgentInput, + InvokeAgentOutput, + InvokeFlowInput, + InvokeFlowOutput, + InvokeInlineAgentInput, + InvokeInlineAgentOutput, + ListFlowExecutionEventsInput, + ListFlowExecutionEventsOutput, + ListFlowExecutionsInput, + ListFlowExecutionsOutput, + ListInvocationStepsInput, + ListInvocationStepsOutput, + ListInvocationsInput, + ListInvocationsOutput, + ListSessionsInput, + ListSessionsOutput, + ListTagsForResourceInput, + ListTagsForResourceOutput, + OptimizePromptInput, + OptimizePromptOutput, + PutInvocationStepInput, + PutInvocationStepOutput, + RerankInput, + RerankOutput, + RetrieveAndGenerateOperationInput, + RetrieveAndGenerateOperationOutput, + RetrieveAndGenerateStreamInput, + RetrieveAndGenerateStreamOutput, + RetrieveInput, + RetrieveOutput, + StartFlowExecutionInput, + StartFlowExecutionOutput, + StopFlowExecutionInput, + StopFlowExecutionOutput, + TagResourceInput, + TagResourceOutput, + UntagResourceInput, + UntagResourceOutput, + UpdateSessionInput, + UpdateSessionOutput, + ) + + _ServiceInterceptor = Union[ + Interceptor[AgenticRetrieveStreamInput, AgenticRetrieveStreamOutput, Any, Any], + Interceptor[ + CheckIngestedDocumentAclInput, CheckIngestedDocumentAclOutput, Any, Any + ], + Interceptor[CreateInvocationInput, CreateInvocationOutput, Any, Any], + Interceptor[CreateSessionInput, CreateSessionOutput, Any, Any], + Interceptor[DeleteAgentMemoryInput, DeleteAgentMemoryOutput, Any, Any], + Interceptor[DeleteSessionInput, DeleteSessionOutput, Any, Any], + Interceptor[EndSessionInput, EndSessionOutput, Any, Any], + Interceptor[GenerateQueryInput, GenerateQueryOutput, Any, Any], + Interceptor[GetAgentMemoryInput, GetAgentMemoryOutput, Any, Any], + Interceptor[GetDocumentContentInput, GetDocumentContentOutput, Any, Any], + Interceptor[ + GetExecutionFlowSnapshotInput, GetExecutionFlowSnapshotOutput, Any, Any + ], + Interceptor[GetFlowExecutionInput, GetFlowExecutionOutput, Any, Any], + Interceptor[ + GetIngestedDocumentAclInput, GetIngestedDocumentAclOutput, Any, Any + ], + Interceptor[GetInvocationStepInput, GetInvocationStepOutput, Any, Any], + Interceptor[GetSessionInput, GetSessionOutput, Any, Any], + Interceptor[InvokeAgentInput, InvokeAgentOutput, Any, Any], + Interceptor[InvokeFlowInput, InvokeFlowOutput, Any, Any], + Interceptor[InvokeInlineAgentInput, InvokeInlineAgentOutput, Any, Any], + Interceptor[ + ListFlowExecutionEventsInput, ListFlowExecutionEventsOutput, Any, Any + ], + Interceptor[ListFlowExecutionsInput, ListFlowExecutionsOutput, Any, Any], + Interceptor[ListInvocationsInput, ListInvocationsOutput, Any, Any], + Interceptor[ListInvocationStepsInput, ListInvocationStepsOutput, Any, Any], + Interceptor[ListSessionsInput, ListSessionsOutput, Any, Any], + Interceptor[ListTagsForResourceInput, ListTagsForResourceOutput, Any, Any], + Interceptor[OptimizePromptInput, OptimizePromptOutput, Any, Any], + Interceptor[PutInvocationStepInput, PutInvocationStepOutput, Any, Any], + Interceptor[RerankInput, RerankOutput, Any, Any], + Interceptor[RetrieveInput, RetrieveOutput, Any, Any], + Interceptor[ + RetrieveAndGenerateOperationInput, + RetrieveAndGenerateOperationOutput, + Any, + Any, + ], + Interceptor[ + RetrieveAndGenerateStreamInput, RetrieveAndGenerateStreamOutput, Any, Any + ], + Interceptor[StartFlowExecutionInput, StartFlowExecutionOutput, Any, Any], + Interceptor[StopFlowExecutionInput, StopFlowExecutionOutput, Any, Any], + Interceptor[TagResourceInput, TagResourceOutput, Any, Any], + Interceptor[UntagResourceInput, UntagResourceOutput, Any, Any], + Interceptor[UpdateSessionInput, UpdateSessionOutput, Any, Any], + ] +else: + _ServiceInterceptor = Any + _PROTOCOL_SETTINGS = ProtocolSettings( namespace="com.amazonaws.bedrockagentruntime", service_target="AmazonBedrockAgentRunTimeService", + service_schema=AMAZON_BEDROCK_AGENT_RUN_TIME_SERVICE, ) class _AsyncBedrockAgentRuntimeConfigOverrides(AwsConfigOverrides, total=False): - endpoint_resolver: EndpointResolver | None + endpoint_resolver: AsyncEndpointResolver | None protocol: ( - ClientProtocol[Any, Any] | ProtocolConstructor[ClientProtocol[Any, Any]] | None + AsyncClientProtocol[Any, Any] + | ProtocolConstructor[AsyncClientProtocol[Any, Any]] + | None ) - auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None + auth_schemes: dict[ShapeID, AsyncAuthScheme[Any, Any, Any, Any]] | None auth_scheme_resolver: AuthSchemeResolver | None @@ -165,17 +186,17 @@ class _AsyncBedrockAgentRuntimeConfigOverrides(AwsConfigOverrides, total=False): class AsyncBedrockAgentRuntimeConfig(AsyncAwsConfig): """Bedrock Agent Runtime configuration (async-resolved).""" - endpoint_resolver: EndpointResolver | None = None + endpoint_resolver: AsyncEndpointResolver | None = None """ The endpoint resolver used to resolve the final endpoint per-operation based on the configuration. """ - protocol: ClientProtocol[Any, Any] | None = None + protocol: AsyncClientProtocol[Any, Any] | None = None """ Pass a protocol class reference from smithy_aws_core.aio.protocols to - select the protocol, e.g. protocol=AwsJson10ClientProtocol. For custom - protocols a protocol instance may also be passed. + select the protocol, e.g. protocol=AsyncAwsJson10ClientProtocol. For + custom protocols a protocol instance may also be passed. """ interceptors: list[_ServiceInterceptor] = field(default_factory=lambda: []) @@ -184,7 +205,7 @@ class AsyncBedrockAgentRuntimeConfig(AsyncAwsConfig): execution of a request. """ - auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None = None + auth_schemes: dict[ShapeID, AsyncAuthScheme[Any, Any, Any, Any]] | None = None """A map of auth scheme ids to auth schemes.""" auth_scheme_resolver: AuthSchemeResolver | None = None @@ -194,7 +215,7 @@ class AsyncBedrockAgentRuntimeConfig(AsyncAwsConfig): """ aws_credentials_identity_resolver: ( - IdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None + AsyncIdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None ) = None """Resolves AWS Credentials. Required for operations that use Sigv4 Auth.""" @@ -235,24 +256,24 @@ class AsyncBedrockAgentRuntimeConfig(AsyncAwsConfig): default=None, resolver=EndpointUriResolver("bedrock_agent_runtime") ), "endpoint_resolver": FieldSpec( - default_factory=lambda: StandardRegionalEndpointsResolver( + default_factory=lambda: AsyncStandardRegionalEndpointsResolver( endpoint_prefix="bedrock-agent-runtime" ) ), "protocol": FieldSpec( - default_factory=lambda: RestJsonClientProtocol(_PROTOCOL_SETTINGS), + default_factory=lambda: AsyncRestJsonClientProtocol(_PROTOCOL_SETTINGS), converter=lambda p: p(_PROTOCOL_SETTINGS) if isinstance(p, type) else p, ), "auth_schemes": FieldSpec( default_factory=lambda: { - ShapeID("aws.auth#sigv4"): SigV4AuthScheme(service="bedrock") + ShapeID("aws.auth#sigv4"): AsyncSigV4AuthScheme(service="bedrock") } ), "auth_scheme_resolver": FieldSpec(default_factory=HTTPAuthSchemeResolver), "transport": FieldSpec(default_factory=lambda: AIOHTTPClient()), } - def set_auth_scheme(self, scheme: AuthScheme[Any, Any, Any, Any]) -> None: + def set_auth_scheme(self, scheme: AsyncAuthScheme[Any, Any, Any, Any]) -> None: """ Set an auth scheme implementation using its scheme ID. :param scheme: The auth scheme to add or replace. @@ -266,7 +287,7 @@ async def resolve( # pyright: ignore[reportIncompatibleMethodOverride] cls, *, profile: str | None = None, - fs: FileSystem | None = None, + fs: AsyncFileSystem | None = None, config_file_path: str | None = None, credentials_file_path: str | None = None, **overrides: Unpack[_AsyncBedrockAgentRuntimeConfigOverrides], diff --git a/clients/aws-sdk-bedrock-agent-runtime/src/aws_sdk_bedrock_agent_runtime/models.py b/clients/aws-sdk-bedrock-agent-runtime/src/aws_sdk_bedrock_agent_runtime/models.py index 0f83f727..17ebdc25 100644 --- a/clients/aws-sdk-bedrock-agent-runtime/src/aws_sdk_bedrock_agent_runtime/models.py +++ b/clients/aws-sdk-bedrock-agent-runtime/src/aws_sdk_bedrock_agent_runtime/models.py @@ -1,36711 +1,1829 @@ # Code generated by smithy-python-codegen DO NOT EDIT. -from dataclasses import dataclass, field -from datetime import datetime, timezone -from enum import StrEnum -import logging -from typing import Any, Literal, Self, Union +from __future__ import annotations -from smithy_core.deserializers import ShapeDeserializer -from smithy_core.documents import Document, TypeRegistry -from smithy_core.exceptions import ModeledError, SerializationError -from smithy_core.response import EMPTY_RESPONSE_METADATA, ResponseMetadata -from smithy_core.schemas import APIOperation, Schema -from smithy_core.serializers import ShapeSerializer +from ._private import schemas as _schemas +from smithy_core._dynamic_models import ModelRegistry +from smithy_core.exceptions import ModeledError +from smithy_core.schemas import APIOperation from smithy_core.shapes import ShapeID -from smithy_core.types import UnknownEnumMixin from ._private.schemas import ( - ACCESS_DENIED_EXCEPTION as _SCHEMA_ACCESS_DENIED_EXCEPTION, - ACTION_GROUP_EXECUTOR as _SCHEMA_ACTION_GROUP_EXECUTOR, - ACTION_GROUP_INVOCATION_INPUT as _SCHEMA_ACTION_GROUP_INVOCATION_INPUT, - ACTION_GROUP_INVOCATION_OUTPUT as _SCHEMA_ACTION_GROUP_INVOCATION_OUTPUT, - AGENTIC_RETRIEVER as _SCHEMA_AGENTIC_RETRIEVER, - AGENTIC_RETRIEVE_ACTION as _SCHEMA_AGENTIC_RETRIEVE_ACTION, - AGENTIC_RETRIEVE_ACTION_DETAILS as _SCHEMA_AGENTIC_RETRIEVE_ACTION_DETAILS, - AGENTIC_RETRIEVE_BEDROCK_GUARDRAIL_CONFIGURATION as _SCHEMA_AGENTIC_RETRIEVE_BEDROCK_GUARDRAIL_CONFIGURATION, - AGENTIC_RETRIEVE_BEDROCK_RERANKING_CONFIGURATION as _SCHEMA_AGENTIC_RETRIEVE_BEDROCK_RERANKING_CONFIGURATION, - AGENTIC_RETRIEVE_BEDROCK_RERANKING_MODEL_CONFIGURATION as _SCHEMA_AGENTIC_RETRIEVE_BEDROCK_RERANKING_MODEL_CONFIGURATION, - AGENTIC_RETRIEVE_CITATION as _SCHEMA_AGENTIC_RETRIEVE_CITATION, - AGENTIC_RETRIEVE_CITATION_REFERENCE as _SCHEMA_AGENTIC_RETRIEVE_CITATION_REFERENCE, - AGENTIC_RETRIEVE_CONFIGURATION as _SCHEMA_AGENTIC_RETRIEVE_CONFIGURATION, - AGENTIC_RETRIEVE_FAILURE as _SCHEMA_AGENTIC_RETRIEVE_FAILURE, - AGENTIC_RETRIEVE_FULL_DOC_EXPANSION_DETAILS as _SCHEMA_AGENTIC_RETRIEVE_FULL_DOC_EXPANSION_DETAILS, - AGENTIC_RETRIEVE_GENERATED_RESPONSE as _SCHEMA_AGENTIC_RETRIEVE_GENERATED_RESPONSE, - AGENTIC_RETRIEVE_GUARDRAIL_WARNING as _SCHEMA_AGENTIC_RETRIEVE_GUARDRAIL_WARNING, - AGENTIC_RETRIEVE_MEMORY_CONFIGURATION as _SCHEMA_AGENTIC_RETRIEVE_MEMORY_CONFIGURATION, - AGENTIC_RETRIEVE_MEMORY_METADATA_FILTER as _SCHEMA_AGENTIC_RETRIEVE_MEMORY_METADATA_FILTER, - AGENTIC_RETRIEVE_MEMORY_METADATA_FILTER_LEFT as _SCHEMA_AGENTIC_RETRIEVE_MEMORY_METADATA_FILTER_LEFT, - AGENTIC_RETRIEVE_MEMORY_METADATA_FILTER_RIGHT as _SCHEMA_AGENTIC_RETRIEVE_MEMORY_METADATA_FILTER_RIGHT, - AGENTIC_RETRIEVE_MEMORY_METADATA_VALUE as _SCHEMA_AGENTIC_RETRIEVE_MEMORY_METADATA_VALUE, - AGENTIC_RETRIEVE_MEMORY_RETRIEVAL_CONFIG as _SCHEMA_AGENTIC_RETRIEVE_MEMORY_RETRIEVAL_CONFIG, - AGENTIC_RETRIEVE_MEMORY_RETRIEVE_DETAILS as _SCHEMA_AGENTIC_RETRIEVE_MEMORY_RETRIEVE_DETAILS, - AGENTIC_RETRIEVE_MEMORY_SESSION_BINDING as _SCHEMA_AGENTIC_RETRIEVE_MEMORY_SESSION_BINDING, - AGENTIC_RETRIEVE_MESSAGE as _SCHEMA_AGENTIC_RETRIEVE_MESSAGE, - AGENTIC_RETRIEVE_MESSAGE_CONTENT as _SCHEMA_AGENTIC_RETRIEVE_MESSAGE_CONTENT, - AGENTIC_RETRIEVE_POLICY_CONFIGURATION as _SCHEMA_AGENTIC_RETRIEVE_POLICY_CONFIGURATION, - AGENTIC_RETRIEVE_RERANKING_CONFIGURATION as _SCHEMA_AGENTIC_RETRIEVE_RERANKING_CONFIGURATION, - AGENTIC_RETRIEVE_RESPONSE_EVENT as _SCHEMA_AGENTIC_RETRIEVE_RESPONSE_EVENT, - AGENTIC_RETRIEVE_RESULT_EVENT as _SCHEMA_AGENTIC_RETRIEVE_RESULT_EVENT, - AGENTIC_RETRIEVE_RESULT_ITEM as _SCHEMA_AGENTIC_RETRIEVE_RESULT_ITEM, - AGENTIC_RETRIEVE_SOURCE_METADATA as _SCHEMA_AGENTIC_RETRIEVE_SOURCE_METADATA, - AGENTIC_RETRIEVE_SOURCE_RETRIEVER as _SCHEMA_AGENTIC_RETRIEVE_SOURCE_RETRIEVER, AGENTIC_RETRIEVE_STREAM as _SCHEMA_AGENTIC_RETRIEVE_STREAM, - AGENTIC_RETRIEVE_STREAM_INPUT as _SCHEMA_AGENTIC_RETRIEVE_STREAM_INPUT, - AGENTIC_RETRIEVE_STREAM_OUTPUT as _SCHEMA_AGENTIC_RETRIEVE_STREAM_OUTPUT, - AGENTIC_RETRIEVE_STREAM_RESPONSE_OUTPUT as _SCHEMA_AGENTIC_RETRIEVE_STREAM_RESPONSE_OUTPUT, - AGENTIC_RETRIEVE_TRACE_EVENT as _SCHEMA_AGENTIC_RETRIEVE_TRACE_EVENT, - AGENTIC_RETRIEVE_TRACE_EVENT_ATTRIBUTES as _SCHEMA_AGENTIC_RETRIEVE_TRACE_EVENT_ATTRIBUTES, - AGENTIC_RETRIEVE_TRACE_RESULT_ITEM as _SCHEMA_AGENTIC_RETRIEVE_TRACE_RESULT_ITEM, - AGENTIC_RETRIEVE_WARNING as _SCHEMA_AGENTIC_RETRIEVE_WARNING, - AGENTIC_RETRIEVE_WARNING_MESSAGE as _SCHEMA_AGENTIC_RETRIEVE_WARNING_MESSAGE, - AGENT_ACTION_GROUP as _SCHEMA_AGENT_ACTION_GROUP, - AGENT_COLLABORATOR_INPUT_PAYLOAD as _SCHEMA_AGENT_COLLABORATOR_INPUT_PAYLOAD, - AGENT_COLLABORATOR_INVOCATION_INPUT as _SCHEMA_AGENT_COLLABORATOR_INVOCATION_INPUT, - AGENT_COLLABORATOR_INVOCATION_OUTPUT as _SCHEMA_AGENT_COLLABORATOR_INVOCATION_OUTPUT, - AGENT_COLLABORATOR_OUTPUT_PAYLOAD as _SCHEMA_AGENT_COLLABORATOR_OUTPUT_PAYLOAD, - ANALYZE_PROMPT_EVENT as _SCHEMA_ANALYZE_PROMPT_EVENT, - API_INVOCATION_INPUT as _SCHEMA_API_INVOCATION_INPUT, - API_PARAMETER as _SCHEMA_API_PARAMETER, - API_REQUEST_BODY as _SCHEMA_API_REQUEST_BODY, - API_RESULT as _SCHEMA_API_RESULT, - API_SCHEMA as _SCHEMA_API_SCHEMA, - ATTRIBUTION as _SCHEMA_ATTRIBUTION, - AUDIO_SEGMENT as _SCHEMA_AUDIO_SEGMENT, - BAD_GATEWAY_EXCEPTION as _SCHEMA_BAD_GATEWAY_EXCEPTION, - BEDROCK_FOUNDATION_MODEL_CONFIGURATION as _SCHEMA_BEDROCK_FOUNDATION_MODEL_CONFIGURATION, - BEDROCK_FOUNDATION_MODEL_MODEL_CONFIGURATION as _SCHEMA_BEDROCK_FOUNDATION_MODEL_MODEL_CONFIGURATION, - BEDROCK_MODEL_CONFIGURATIONS as _SCHEMA_BEDROCK_MODEL_CONFIGURATIONS, - BEDROCK_RERANKING_CONFIGURATION as _SCHEMA_BEDROCK_RERANKING_CONFIGURATION, - BEDROCK_RERANKING_MODEL_CONFIGURATION as _SCHEMA_BEDROCK_RERANKING_MODEL_CONFIGURATION, - BEDROCK_SESSION_CONTENT_BLOCK as _SCHEMA_BEDROCK_SESSION_CONTENT_BLOCK, - BYTE_CONTENT_DOC as _SCHEMA_BYTE_CONTENT_DOC, - BYTE_CONTENT_FILE as _SCHEMA_BYTE_CONTENT_FILE, - CALLER as _SCHEMA_CALLER, CHECK_INGESTED_DOCUMENT_ACL as _SCHEMA_CHECK_INGESTED_DOCUMENT_ACL, - CHECK_INGESTED_DOCUMENT_ACL_INPUT as _SCHEMA_CHECK_INGESTED_DOCUMENT_ACL_INPUT, - CHECK_INGESTED_DOCUMENT_ACL_OUTPUT as _SCHEMA_CHECK_INGESTED_DOCUMENT_ACL_OUTPUT, - CITATION as _SCHEMA_CITATION, - CITATION_EVENT as _SCHEMA_CITATION_EVENT, - CODE_INTERPRETER_INVOCATION_INPUT as _SCHEMA_CODE_INTERPRETER_INVOCATION_INPUT, - CODE_INTERPRETER_INVOCATION_OUTPUT as _SCHEMA_CODE_INTERPRETER_INVOCATION_OUTPUT, - COLLABORATOR as _SCHEMA_COLLABORATOR, - COLLABORATOR_CONFIGURATION as _SCHEMA_COLLABORATOR_CONFIGURATION, - CONDITION_RESULT_EVENT as _SCHEMA_CONDITION_RESULT_EVENT, - CONFLICT_EXCEPTION as _SCHEMA_CONFLICT_EXCEPTION, - CONTENT_BLOCK as _SCHEMA_CONTENT_BLOCK, - CONTENT_BODY as _SCHEMA_CONTENT_BODY, - CONVERSATION_HISTORY as _SCHEMA_CONVERSATION_HISTORY, CREATE_INVOCATION as _SCHEMA_CREATE_INVOCATION, - CREATE_INVOCATION_INPUT as _SCHEMA_CREATE_INVOCATION_INPUT, - CREATE_INVOCATION_OUTPUT as _SCHEMA_CREATE_INVOCATION_OUTPUT, CREATE_SESSION as _SCHEMA_CREATE_SESSION, - CREATE_SESSION_INPUT as _SCHEMA_CREATE_SESSION_INPUT, - CREATE_SESSION_OUTPUT as _SCHEMA_CREATE_SESSION_OUTPUT, - CUSTOM_ORCHESTRATION as _SCHEMA_CUSTOM_ORCHESTRATION, - CUSTOM_ORCHESTRATION_TRACE as _SCHEMA_CUSTOM_ORCHESTRATION_TRACE, - CUSTOM_ORCHESTRATION_TRACE_EVENT as _SCHEMA_CUSTOM_ORCHESTRATION_TRACE_EVENT, DELETE_AGENT_MEMORY as _SCHEMA_DELETE_AGENT_MEMORY, - DELETE_AGENT_MEMORY_INPUT as _SCHEMA_DELETE_AGENT_MEMORY_INPUT, - DELETE_AGENT_MEMORY_OUTPUT as _SCHEMA_DELETE_AGENT_MEMORY_OUTPUT, DELETE_SESSION as _SCHEMA_DELETE_SESSION, - DELETE_SESSION_INPUT as _SCHEMA_DELETE_SESSION_INPUT, - DELETE_SESSION_OUTPUT as _SCHEMA_DELETE_SESSION_OUTPUT, - DEPENDENCY_FAILED_EXCEPTION as _SCHEMA_DEPENDENCY_FAILED_EXCEPTION, - DOCUMENT_ACL as _SCHEMA_DOCUMENT_ACL, - DOCUMENT_ACL_CONDITION as _SCHEMA_DOCUMENT_ACL_CONDITION, - DOCUMENT_ACL_GROUP as _SCHEMA_DOCUMENT_ACL_GROUP, - DOCUMENT_ACL_MEMBERSHIP as _SCHEMA_DOCUMENT_ACL_MEMBERSHIP, - DOCUMENT_ACL_USER as _SCHEMA_DOCUMENT_ACL_USER, END_SESSION as _SCHEMA_END_SESSION, - END_SESSION_INPUT as _SCHEMA_END_SESSION_INPUT, - END_SESSION_OUTPUT as _SCHEMA_END_SESSION_OUTPUT, - EXTERNAL_SOURCE as _SCHEMA_EXTERNAL_SOURCE, - EXTERNAL_SOURCES_GENERATION_CONFIGURATION as _SCHEMA_EXTERNAL_SOURCES_GENERATION_CONFIGURATION, - EXTERNAL_SOURCES_RETRIEVE_AND_GENERATE_CONFIGURATION as _SCHEMA_EXTERNAL_SOURCES_RETRIEVE_AND_GENERATE_CONFIGURATION, - FAILURE_TRACE as _SCHEMA_FAILURE_TRACE, - FIELD_FOR_RERANKING as _SCHEMA_FIELD_FOR_RERANKING, - FILE_PART as _SCHEMA_FILE_PART, - FILE_SOURCE as _SCHEMA_FILE_SOURCE, - FILTER_ATTRIBUTE as _SCHEMA_FILTER_ATTRIBUTE, - FINAL_RESPONSE as _SCHEMA_FINAL_RESPONSE, - FLOW_COMPLETION_EVENT as _SCHEMA_FLOW_COMPLETION_EVENT, - FLOW_EXECUTION_CONTENT as _SCHEMA_FLOW_EXECUTION_CONTENT, - FLOW_EXECUTION_ERROR as _SCHEMA_FLOW_EXECUTION_ERROR, - FLOW_EXECUTION_EVENT as _SCHEMA_FLOW_EXECUTION_EVENT, - FLOW_EXECUTION_INPUT_EVENT as _SCHEMA_FLOW_EXECUTION_INPUT_EVENT, - FLOW_EXECUTION_OUTPUT_EVENT as _SCHEMA_FLOW_EXECUTION_OUTPUT_EVENT, - FLOW_EXECUTION_SUMMARY as _SCHEMA_FLOW_EXECUTION_SUMMARY, - FLOW_FAILURE_EVENT as _SCHEMA_FLOW_FAILURE_EVENT, - FLOW_INPUT as _SCHEMA_FLOW_INPUT, - FLOW_INPUT_CONTENT as _SCHEMA_FLOW_INPUT_CONTENT, - FLOW_INPUT_FIELD as _SCHEMA_FLOW_INPUT_FIELD, - FLOW_MULTI_TURN_INPUT_CONTENT as _SCHEMA_FLOW_MULTI_TURN_INPUT_CONTENT, - FLOW_MULTI_TURN_INPUT_REQUEST_EVENT as _SCHEMA_FLOW_MULTI_TURN_INPUT_REQUEST_EVENT, - FLOW_OUTPUT_CONTENT as _SCHEMA_FLOW_OUTPUT_CONTENT, - FLOW_OUTPUT_EVENT as _SCHEMA_FLOW_OUTPUT_EVENT, - FLOW_OUTPUT_FIELD as _SCHEMA_FLOW_OUTPUT_FIELD, - FLOW_RESPONSE_STREAM as _SCHEMA_FLOW_RESPONSE_STREAM, - FLOW_TRACE as _SCHEMA_FLOW_TRACE, - FLOW_TRACE_CONDITION as _SCHEMA_FLOW_TRACE_CONDITION, - FLOW_TRACE_CONDITION_NODE_RESULT_EVENT as _SCHEMA_FLOW_TRACE_CONDITION_NODE_RESULT_EVENT, - FLOW_TRACE_DEPENDENCY_EVENT as _SCHEMA_FLOW_TRACE_DEPENDENCY_EVENT, - FLOW_TRACE_EVENT as _SCHEMA_FLOW_TRACE_EVENT, - FLOW_TRACE_NODE_ACTION_EVENT as _SCHEMA_FLOW_TRACE_NODE_ACTION_EVENT, - FLOW_TRACE_NODE_INPUT_CONTENT as _SCHEMA_FLOW_TRACE_NODE_INPUT_CONTENT, - FLOW_TRACE_NODE_INPUT_EVENT as _SCHEMA_FLOW_TRACE_NODE_INPUT_EVENT, - FLOW_TRACE_NODE_INPUT_EXECUTION_CHAIN_ITEM as _SCHEMA_FLOW_TRACE_NODE_INPUT_EXECUTION_CHAIN_ITEM, - FLOW_TRACE_NODE_INPUT_FIELD as _SCHEMA_FLOW_TRACE_NODE_INPUT_FIELD, - FLOW_TRACE_NODE_INPUT_SOURCE as _SCHEMA_FLOW_TRACE_NODE_INPUT_SOURCE, - FLOW_TRACE_NODE_OUTPUT_CONTENT as _SCHEMA_FLOW_TRACE_NODE_OUTPUT_CONTENT, - FLOW_TRACE_NODE_OUTPUT_EVENT as _SCHEMA_FLOW_TRACE_NODE_OUTPUT_EVENT, - FLOW_TRACE_NODE_OUTPUT_FIELD as _SCHEMA_FLOW_TRACE_NODE_OUTPUT_FIELD, - FLOW_TRACE_NODE_OUTPUT_NEXT as _SCHEMA_FLOW_TRACE_NODE_OUTPUT_NEXT, - FOUNDATION_MODEL_CONFIGURATION as _SCHEMA_FOUNDATION_MODEL_CONFIGURATION, - FUNCTION_DEFINITION as _SCHEMA_FUNCTION_DEFINITION, - FUNCTION_INVOCATION_INPUT as _SCHEMA_FUNCTION_INVOCATION_INPUT, - FUNCTION_PARAMETER as _SCHEMA_FUNCTION_PARAMETER, - FUNCTION_RESULT as _SCHEMA_FUNCTION_RESULT, - FUNCTION_SCHEMA as _SCHEMA_FUNCTION_SCHEMA, - GENERATED_QUERY as _SCHEMA_GENERATED_QUERY, - GENERATED_RESPONSE_PART as _SCHEMA_GENERATED_RESPONSE_PART, GENERATE_QUERY as _SCHEMA_GENERATE_QUERY, - GENERATE_QUERY_INPUT as _SCHEMA_GENERATE_QUERY_INPUT, - GENERATE_QUERY_OUTPUT as _SCHEMA_GENERATE_QUERY_OUTPUT, - GENERATION_CONFIGURATION as _SCHEMA_GENERATION_CONFIGURATION, GET_AGENT_MEMORY as _SCHEMA_GET_AGENT_MEMORY, - GET_AGENT_MEMORY_INPUT as _SCHEMA_GET_AGENT_MEMORY_INPUT, - GET_AGENT_MEMORY_OUTPUT as _SCHEMA_GET_AGENT_MEMORY_OUTPUT, GET_DOCUMENT_CONTENT as _SCHEMA_GET_DOCUMENT_CONTENT, - GET_DOCUMENT_CONTENT_INPUT as _SCHEMA_GET_DOCUMENT_CONTENT_INPUT, - GET_DOCUMENT_CONTENT_OUTPUT as _SCHEMA_GET_DOCUMENT_CONTENT_OUTPUT, GET_EXECUTION_FLOW_SNAPSHOT as _SCHEMA_GET_EXECUTION_FLOW_SNAPSHOT, - GET_EXECUTION_FLOW_SNAPSHOT_INPUT as _SCHEMA_GET_EXECUTION_FLOW_SNAPSHOT_INPUT, - GET_EXECUTION_FLOW_SNAPSHOT_OUTPUT as _SCHEMA_GET_EXECUTION_FLOW_SNAPSHOT_OUTPUT, GET_FLOW_EXECUTION as _SCHEMA_GET_FLOW_EXECUTION, - GET_FLOW_EXECUTION_INPUT as _SCHEMA_GET_FLOW_EXECUTION_INPUT, - GET_FLOW_EXECUTION_OUTPUT as _SCHEMA_GET_FLOW_EXECUTION_OUTPUT, GET_INGESTED_DOCUMENT_ACL as _SCHEMA_GET_INGESTED_DOCUMENT_ACL, - GET_INGESTED_DOCUMENT_ACL_INPUT as _SCHEMA_GET_INGESTED_DOCUMENT_ACL_INPUT, - GET_INGESTED_DOCUMENT_ACL_OUTPUT as _SCHEMA_GET_INGESTED_DOCUMENT_ACL_OUTPUT, GET_INVOCATION_STEP as _SCHEMA_GET_INVOCATION_STEP, - GET_INVOCATION_STEP_INPUT as _SCHEMA_GET_INVOCATION_STEP_INPUT, - GET_INVOCATION_STEP_OUTPUT as _SCHEMA_GET_INVOCATION_STEP_OUTPUT, GET_SESSION as _SCHEMA_GET_SESSION, - GET_SESSION_INPUT as _SCHEMA_GET_SESSION_INPUT, - GET_SESSION_OUTPUT as _SCHEMA_GET_SESSION_OUTPUT, - GUARDRAIL_ASSESSMENT as _SCHEMA_GUARDRAIL_ASSESSMENT, - GUARDRAIL_CONFIGURATION as _SCHEMA_GUARDRAIL_CONFIGURATION, - GUARDRAIL_CONFIGURATION_WITH_ARN as _SCHEMA_GUARDRAIL_CONFIGURATION_WITH_ARN, - GUARDRAIL_CONTENT_FILTER as _SCHEMA_GUARDRAIL_CONTENT_FILTER, - GUARDRAIL_CONTENT_POLICY_ASSESSMENT as _SCHEMA_GUARDRAIL_CONTENT_POLICY_ASSESSMENT, - GUARDRAIL_CUSTOM_WORD as _SCHEMA_GUARDRAIL_CUSTOM_WORD, - GUARDRAIL_EVENT as _SCHEMA_GUARDRAIL_EVENT, - GUARDRAIL_MANAGED_WORD as _SCHEMA_GUARDRAIL_MANAGED_WORD, - GUARDRAIL_PII_ENTITY_FILTER as _SCHEMA_GUARDRAIL_PII_ENTITY_FILTER, - GUARDRAIL_REGEX_FILTER as _SCHEMA_GUARDRAIL_REGEX_FILTER, - GUARDRAIL_SENSITIVE_INFORMATION_POLICY_ASSESSMENT as _SCHEMA_GUARDRAIL_SENSITIVE_INFORMATION_POLICY_ASSESSMENT, - GUARDRAIL_TOPIC as _SCHEMA_GUARDRAIL_TOPIC, - GUARDRAIL_TOPIC_POLICY_ASSESSMENT as _SCHEMA_GUARDRAIL_TOPIC_POLICY_ASSESSMENT, - GUARDRAIL_TRACE as _SCHEMA_GUARDRAIL_TRACE, - GUARDRAIL_WORD_POLICY_ASSESSMENT as _SCHEMA_GUARDRAIL_WORD_POLICY_ASSESSMENT, - IMAGE_BLOCK as _SCHEMA_IMAGE_BLOCK, - IMAGE_INPUT as _SCHEMA_IMAGE_INPUT, - IMAGE_INPUT_SOURCE as _SCHEMA_IMAGE_INPUT_SOURCE, - IMAGE_SOURCE as _SCHEMA_IMAGE_SOURCE, - IMPLICIT_FILTER_CONFIGURATION as _SCHEMA_IMPLICIT_FILTER_CONFIGURATION, - INFERENCE_CONFIG as _SCHEMA_INFERENCE_CONFIG, - INFERENCE_CONFIGURATION as _SCHEMA_INFERENCE_CONFIGURATION, - INLINE_AGENT_FILE_PART as _SCHEMA_INLINE_AGENT_FILE_PART, - INLINE_AGENT_PAYLOAD_PART as _SCHEMA_INLINE_AGENT_PAYLOAD_PART, - INLINE_AGENT_RESPONSE_STREAM as _SCHEMA_INLINE_AGENT_RESPONSE_STREAM, - INLINE_AGENT_RETURN_CONTROL_PAYLOAD as _SCHEMA_INLINE_AGENT_RETURN_CONTROL_PAYLOAD, - INLINE_AGENT_TRACE_PART as _SCHEMA_INLINE_AGENT_TRACE_PART, - INLINE_BEDROCK_MODEL_CONFIGURATIONS as _SCHEMA_INLINE_BEDROCK_MODEL_CONFIGURATIONS, - INLINE_SESSION_STATE as _SCHEMA_INLINE_SESSION_STATE, - INPUT_FILE as _SCHEMA_INPUT_FILE, - INPUT_IMAGE as _SCHEMA_INPUT_IMAGE, - INPUT_PROMPT as _SCHEMA_INPUT_PROMPT, - INTERNAL_SERVER_EXCEPTION as _SCHEMA_INTERNAL_SERVER_EXCEPTION, - INVOCATION_INPUT as _SCHEMA_INVOCATION_INPUT, - INVOCATION_INPUT_MEMBER as _SCHEMA_INVOCATION_INPUT_MEMBER, - INVOCATION_RESULT_MEMBER as _SCHEMA_INVOCATION_RESULT_MEMBER, - INVOCATION_STEP as _SCHEMA_INVOCATION_STEP, - INVOCATION_STEP_PAYLOAD as _SCHEMA_INVOCATION_STEP_PAYLOAD, - INVOCATION_STEP_SUMMARY as _SCHEMA_INVOCATION_STEP_SUMMARY, - INVOCATION_SUMMARY as _SCHEMA_INVOCATION_SUMMARY, INVOKE_AGENT as _SCHEMA_INVOKE_AGENT, - INVOKE_AGENT_INPUT as _SCHEMA_INVOKE_AGENT_INPUT, - INVOKE_AGENT_OUTPUT as _SCHEMA_INVOKE_AGENT_OUTPUT, INVOKE_FLOW as _SCHEMA_INVOKE_FLOW, - INVOKE_FLOW_INPUT as _SCHEMA_INVOKE_FLOW_INPUT, - INVOKE_FLOW_OUTPUT as _SCHEMA_INVOKE_FLOW_OUTPUT, INVOKE_INLINE_AGENT as _SCHEMA_INVOKE_INLINE_AGENT, - INVOKE_INLINE_AGENT_INPUT as _SCHEMA_INVOKE_INLINE_AGENT_INPUT, - INVOKE_INLINE_AGENT_OUTPUT as _SCHEMA_INVOKE_INLINE_AGENT_OUTPUT, - KNOWLEDGE_BASE as _SCHEMA_KNOWLEDGE_BASE, - KNOWLEDGE_BASE_CONFIGURATION as _SCHEMA_KNOWLEDGE_BASE_CONFIGURATION, - KNOWLEDGE_BASE_LOOKUP_INPUT as _SCHEMA_KNOWLEDGE_BASE_LOOKUP_INPUT, - KNOWLEDGE_BASE_LOOKUP_OUTPUT as _SCHEMA_KNOWLEDGE_BASE_LOOKUP_OUTPUT, - KNOWLEDGE_BASE_QUERY as _SCHEMA_KNOWLEDGE_BASE_QUERY, - KNOWLEDGE_BASE_RETRIEVAL_CONFIGURATION as _SCHEMA_KNOWLEDGE_BASE_RETRIEVAL_CONFIGURATION, - KNOWLEDGE_BASE_RETRIEVAL_RESULT as _SCHEMA_KNOWLEDGE_BASE_RETRIEVAL_RESULT, - KNOWLEDGE_BASE_RETRIEVER_CONFIGURATION as _SCHEMA_KNOWLEDGE_BASE_RETRIEVER_CONFIGURATION, - KNOWLEDGE_BASE_RETRIEVE_AND_GENERATE_CONFIGURATION as _SCHEMA_KNOWLEDGE_BASE_RETRIEVE_AND_GENERATE_CONFIGURATION, - KNOWLEDGE_BASE_VECTOR_SEARCH_CONFIGURATION as _SCHEMA_KNOWLEDGE_BASE_VECTOR_SEARCH_CONFIGURATION, LIST_FLOW_EXECUTIONS as _SCHEMA_LIST_FLOW_EXECUTIONS, - LIST_FLOW_EXECUTIONS_INPUT as _SCHEMA_LIST_FLOW_EXECUTIONS_INPUT, - LIST_FLOW_EXECUTIONS_OUTPUT as _SCHEMA_LIST_FLOW_EXECUTIONS_OUTPUT, LIST_FLOW_EXECUTION_EVENTS as _SCHEMA_LIST_FLOW_EXECUTION_EVENTS, - LIST_FLOW_EXECUTION_EVENTS_INPUT as _SCHEMA_LIST_FLOW_EXECUTION_EVENTS_INPUT, - LIST_FLOW_EXECUTION_EVENTS_OUTPUT as _SCHEMA_LIST_FLOW_EXECUTION_EVENTS_OUTPUT, LIST_INVOCATIONS as _SCHEMA_LIST_INVOCATIONS, - LIST_INVOCATIONS_INPUT as _SCHEMA_LIST_INVOCATIONS_INPUT, - LIST_INVOCATIONS_OUTPUT as _SCHEMA_LIST_INVOCATIONS_OUTPUT, LIST_INVOCATION_STEPS as _SCHEMA_LIST_INVOCATION_STEPS, - LIST_INVOCATION_STEPS_INPUT as _SCHEMA_LIST_INVOCATION_STEPS_INPUT, - LIST_INVOCATION_STEPS_OUTPUT as _SCHEMA_LIST_INVOCATION_STEPS_OUTPUT, LIST_SESSIONS as _SCHEMA_LIST_SESSIONS, - LIST_SESSIONS_INPUT as _SCHEMA_LIST_SESSIONS_INPUT, - LIST_SESSIONS_OUTPUT as _SCHEMA_LIST_SESSIONS_OUTPUT, LIST_TAGS_FOR_RESOURCE as _SCHEMA_LIST_TAGS_FOR_RESOURCE, - LIST_TAGS_FOR_RESOURCE_INPUT as _SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT, - LIST_TAGS_FOR_RESOURCE_OUTPUT as _SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT, - MANAGED_SEARCH_BEDROCK_RERANKING_CONFIGURATION as _SCHEMA_MANAGED_SEARCH_BEDROCK_RERANKING_CONFIGURATION, - MANAGED_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION as _SCHEMA_MANAGED_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION, - MANAGED_SEARCH_CONFIGURATION as _SCHEMA_MANAGED_SEARCH_CONFIGURATION, - MANAGED_SEARCH_RERANKING_CONFIGURATION as _SCHEMA_MANAGED_SEARCH_RERANKING_CONFIGURATION, - MANTLE_FOUNDATION_MODEL_CONFIGURATION as _SCHEMA_MANTLE_FOUNDATION_MODEL_CONFIGURATION, - MANTLE_FOUNDATION_MODEL_MODEL_CONFIGURATION as _SCHEMA_MANTLE_FOUNDATION_MODEL_MODEL_CONFIGURATION, - MEMORY as _SCHEMA_MEMORY, - MEMORY_SESSION_SUMMARY as _SCHEMA_MEMORY_SESSION_SUMMARY, - MESSAGE as _SCHEMA_MESSAGE, - METADATA as _SCHEMA_METADATA, - METADATA_ATTRIBUTE_SCHEMA as _SCHEMA_METADATA_ATTRIBUTE_SCHEMA, - METADATA_CONFIGURATION_FOR_RERANKING as _SCHEMA_METADATA_CONFIGURATION_FOR_RERANKING, - MODEL_INVOCATION_INPUT as _SCHEMA_MODEL_INVOCATION_INPUT, - MODEL_NOT_READY_EXCEPTION as _SCHEMA_MODEL_NOT_READY_EXCEPTION, - MODEL_PERFORMANCE_CONFIGURATION as _SCHEMA_MODEL_PERFORMANCE_CONFIGURATION, - NODE_ACTION_EVENT as _SCHEMA_NODE_ACTION_EVENT, - NODE_DEPENDENCY_EVENT as _SCHEMA_NODE_DEPENDENCY_EVENT, - NODE_EXECUTION_CONTENT as _SCHEMA_NODE_EXECUTION_CONTENT, - NODE_FAILURE_EVENT as _SCHEMA_NODE_FAILURE_EVENT, - NODE_INPUT_EVENT as _SCHEMA_NODE_INPUT_EVENT, - NODE_INPUT_EXECUTION_CHAIN_ITEM as _SCHEMA_NODE_INPUT_EXECUTION_CHAIN_ITEM, - NODE_INPUT_FIELD as _SCHEMA_NODE_INPUT_FIELD, - NODE_INPUT_SOURCE as _SCHEMA_NODE_INPUT_SOURCE, - NODE_OUTPUT_EVENT as _SCHEMA_NODE_OUTPUT_EVENT, - NODE_OUTPUT_FIELD as _SCHEMA_NODE_OUTPUT_FIELD, - NODE_OUTPUT_NEXT as _SCHEMA_NODE_OUTPUT_NEXT, - NODE_TRACE_ELEMENTS as _SCHEMA_NODE_TRACE_ELEMENTS, - OBSERVATION as _SCHEMA_OBSERVATION, - OPTIMIZED_PROMPT as _SCHEMA_OPTIMIZED_PROMPT, - OPTIMIZED_PROMPT_EVENT as _SCHEMA_OPTIMIZED_PROMPT_EVENT, - OPTIMIZED_PROMPT_STREAM as _SCHEMA_OPTIMIZED_PROMPT_STREAM, OPTIMIZE_PROMPT as _SCHEMA_OPTIMIZE_PROMPT, - OPTIMIZE_PROMPT_INPUT as _SCHEMA_OPTIMIZE_PROMPT_INPUT, - OPTIMIZE_PROMPT_OUTPUT as _SCHEMA_OPTIMIZE_PROMPT_OUTPUT, - ORCHESTRATION_CONFIGURATION as _SCHEMA_ORCHESTRATION_CONFIGURATION, - ORCHESTRATION_EXECUTOR as _SCHEMA_ORCHESTRATION_EXECUTOR, - ORCHESTRATION_MODEL_INVOCATION_OUTPUT as _SCHEMA_ORCHESTRATION_MODEL_INVOCATION_OUTPUT, - ORCHESTRATION_TRACE as _SCHEMA_ORCHESTRATION_TRACE, - OUTPUT_FILE as _SCHEMA_OUTPUT_FILE, - PARAMETER as _SCHEMA_PARAMETER, - PARAMETER_DETAIL as _SCHEMA_PARAMETER_DETAIL, - PAYLOAD_PART as _SCHEMA_PAYLOAD_PART, - PERFORMANCE_CONFIGURATION as _SCHEMA_PERFORMANCE_CONFIGURATION, - POST_PROCESSING_MODEL_INVOCATION_OUTPUT as _SCHEMA_POST_PROCESSING_MODEL_INVOCATION_OUTPUT, - POST_PROCESSING_PARSED_RESPONSE as _SCHEMA_POST_PROCESSING_PARSED_RESPONSE, - POST_PROCESSING_TRACE as _SCHEMA_POST_PROCESSING_TRACE, - PRE_PROCESSING_MODEL_INVOCATION_OUTPUT as _SCHEMA_PRE_PROCESSING_MODEL_INVOCATION_OUTPUT, - PRE_PROCESSING_PARSED_RESPONSE as _SCHEMA_PRE_PROCESSING_PARSED_RESPONSE, - PRE_PROCESSING_TRACE as _SCHEMA_PRE_PROCESSING_TRACE, - PROMPT_CONFIGURATION as _SCHEMA_PROMPT_CONFIGURATION, - PROMPT_CREATION_CONFIGURATIONS as _SCHEMA_PROMPT_CREATION_CONFIGURATIONS, - PROMPT_OVERRIDE_CONFIGURATION as _SCHEMA_PROMPT_OVERRIDE_CONFIGURATION, - PROMPT_TEMPLATE as _SCHEMA_PROMPT_TEMPLATE, - PROPERTY_PARAMETERS as _SCHEMA_PROPERTY_PARAMETERS, PUT_INVOCATION_STEP as _SCHEMA_PUT_INVOCATION_STEP, - PUT_INVOCATION_STEP_INPUT as _SCHEMA_PUT_INVOCATION_STEP_INPUT, - PUT_INVOCATION_STEP_OUTPUT as _SCHEMA_PUT_INVOCATION_STEP_OUTPUT, - QUERY_GENERATION_INPUT as _SCHEMA_QUERY_GENERATION_INPUT, - QUERY_TRANSFORMATION_CONFIGURATION as _SCHEMA_QUERY_TRANSFORMATION_CONFIGURATION, - RATIONALE as _SCHEMA_RATIONALE, - RAW_RESPONSE as _SCHEMA_RAW_RESPONSE, - REASONING_CONTENT_BLOCK as _SCHEMA_REASONING_CONTENT_BLOCK, - REASONING_TEXT_BLOCK as _SCHEMA_REASONING_TEXT_BLOCK, - REPROMPT_RESPONSE as _SCHEMA_REPROMPT_RESPONSE, - REQUEST_BODY as _SCHEMA_REQUEST_BODY, RERANK as _SCHEMA_RERANK, - RERANKING_CONFIGURATION as _SCHEMA_RERANKING_CONFIGURATION, - RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION as _SCHEMA_RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION, - RERANK_DOCUMENT as _SCHEMA_RERANK_DOCUMENT, - RERANK_INPUT as _SCHEMA_RERANK_INPUT, - RERANK_OUTPUT as _SCHEMA_RERANK_OUTPUT, - RERANK_QUERY as _SCHEMA_RERANK_QUERY, - RERANK_RESULT as _SCHEMA_RERANK_RESULT, - RERANK_SOURCE as _SCHEMA_RERANK_SOURCE, - RERANK_TEXT_DOCUMENT as _SCHEMA_RERANK_TEXT_DOCUMENT, - RESOURCE_NOT_FOUND_EXCEPTION as _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - RESPONSE_STREAM as _SCHEMA_RESPONSE_STREAM, - RETRIEVAL_CONTENT as _SCHEMA_RETRIEVAL_CONTENT, - RETRIEVAL_FILTER as _SCHEMA_RETRIEVAL_FILTER, - RETRIEVAL_OVERRIDES as _SCHEMA_RETRIEVAL_OVERRIDES, - RETRIEVAL_RESULT_CONFLUENCE_LOCATION as _SCHEMA_RETRIEVAL_RESULT_CONFLUENCE_LOCATION, - RETRIEVAL_RESULT_CONTENT as _SCHEMA_RETRIEVAL_RESULT_CONTENT, - RETRIEVAL_RESULT_CONTENT_COLUMN as _SCHEMA_RETRIEVAL_RESULT_CONTENT_COLUMN, - RETRIEVAL_RESULT_CUSTOM_DOCUMENT_LOCATION as _SCHEMA_RETRIEVAL_RESULT_CUSTOM_DOCUMENT_LOCATION, - RETRIEVAL_RESULT_GOOGLE_DRIVE_LOCATION as _SCHEMA_RETRIEVAL_RESULT_GOOGLE_DRIVE_LOCATION, - RETRIEVAL_RESULT_KENDRA_DOCUMENT_LOCATION as _SCHEMA_RETRIEVAL_RESULT_KENDRA_DOCUMENT_LOCATION, - RETRIEVAL_RESULT_LOCATION as _SCHEMA_RETRIEVAL_RESULT_LOCATION, - RETRIEVAL_RESULT_ONE_DRIVE_LOCATION as _SCHEMA_RETRIEVAL_RESULT_ONE_DRIVE_LOCATION, - RETRIEVAL_RESULT_S3_LOCATION as _SCHEMA_RETRIEVAL_RESULT_S3_LOCATION, - RETRIEVAL_RESULT_SALESFORCE_LOCATION as _SCHEMA_RETRIEVAL_RESULT_SALESFORCE_LOCATION, - RETRIEVAL_RESULT_SHARE_POINT_LOCATION as _SCHEMA_RETRIEVAL_RESULT_SHARE_POINT_LOCATION, - RETRIEVAL_RESULT_SQL_LOCATION as _SCHEMA_RETRIEVAL_RESULT_SQL_LOCATION, - RETRIEVAL_RESULT_WEB_LOCATION as _SCHEMA_RETRIEVAL_RESULT_WEB_LOCATION, RETRIEVE as _SCHEMA_RETRIEVE, - RETRIEVED_REFERENCE as _SCHEMA_RETRIEVED_REFERENCE, - RETRIEVER_CONFIGURATION as _SCHEMA_RETRIEVER_CONFIGURATION, RETRIEVE_AND_GENERATE as _SCHEMA_RETRIEVE_AND_GENERATE, - RETRIEVE_AND_GENERATE_CONFIGURATION as _SCHEMA_RETRIEVE_AND_GENERATE_CONFIGURATION, - RETRIEVE_AND_GENERATE_INPUT as _SCHEMA_RETRIEVE_AND_GENERATE_INPUT, - RETRIEVE_AND_GENERATE_OPERATION_INPUT as _SCHEMA_RETRIEVE_AND_GENERATE_OPERATION_INPUT, - RETRIEVE_AND_GENERATE_OPERATION_OUTPUT as _SCHEMA_RETRIEVE_AND_GENERATE_OPERATION_OUTPUT, - RETRIEVE_AND_GENERATE_OUTPUT as _SCHEMA_RETRIEVE_AND_GENERATE_OUTPUT, - RETRIEVE_AND_GENERATE_OUTPUT_EVENT as _SCHEMA_RETRIEVE_AND_GENERATE_OUTPUT_EVENT, - RETRIEVE_AND_GENERATE_SESSION_CONFIGURATION as _SCHEMA_RETRIEVE_AND_GENERATE_SESSION_CONFIGURATION, RETRIEVE_AND_GENERATE_STREAM as _SCHEMA_RETRIEVE_AND_GENERATE_STREAM, - RETRIEVE_AND_GENERATE_STREAM_INPUT as _SCHEMA_RETRIEVE_AND_GENERATE_STREAM_INPUT, - RETRIEVE_AND_GENERATE_STREAM_OUTPUT as _SCHEMA_RETRIEVE_AND_GENERATE_STREAM_OUTPUT, - RETRIEVE_AND_GENERATE_STREAM_RESPONSE_OUTPUT as _SCHEMA_RETRIEVE_AND_GENERATE_STREAM_RESPONSE_OUTPUT, - RETRIEVE_INPUT as _SCHEMA_RETRIEVE_INPUT, - RETRIEVE_OUTPUT as _SCHEMA_RETRIEVE_OUTPUT, - RETURN_CONTROL_PAYLOAD as _SCHEMA_RETURN_CONTROL_PAYLOAD, - RETURN_CONTROL_RESULTS as _SCHEMA_RETURN_CONTROL_RESULTS, - ROUTING_CLASSIFIER_MODEL_INVOCATION_OUTPUT as _SCHEMA_ROUTING_CLASSIFIER_MODEL_INVOCATION_OUTPUT, - ROUTING_CLASSIFIER_TRACE as _SCHEMA_ROUTING_CLASSIFIER_TRACE, - S3_IDENTIFIER as _SCHEMA_S3_IDENTIFIER, - S3_LOCATION as _SCHEMA_S3_LOCATION, - S3_OBJECT_DOC as _SCHEMA_S3_OBJECT_DOC, - S3_OBJECT_FILE as _SCHEMA_S3_OBJECT_FILE, - SATISFIED_CONDITION as _SCHEMA_SATISFIED_CONDITION, - SERVICE_QUOTA_EXCEEDED_EXCEPTION as _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - SESSION_STATE as _SCHEMA_SESSION_STATE, - SESSION_SUMMARY as _SCHEMA_SESSION_SUMMARY, - SPAN as _SCHEMA_SPAN, START_FLOW_EXECUTION as _SCHEMA_START_FLOW_EXECUTION, - START_FLOW_EXECUTION_INPUT as _SCHEMA_START_FLOW_EXECUTION_INPUT, - START_FLOW_EXECUTION_OUTPUT as _SCHEMA_START_FLOW_EXECUTION_OUTPUT, STOP_FLOW_EXECUTION as _SCHEMA_STOP_FLOW_EXECUTION, - STOP_FLOW_EXECUTION_INPUT as _SCHEMA_STOP_FLOW_EXECUTION_INPUT, - STOP_FLOW_EXECUTION_OUTPUT as _SCHEMA_STOP_FLOW_EXECUTION_OUTPUT, - STREAMING_CONFIGURATIONS as _SCHEMA_STREAMING_CONFIGURATIONS, TAG_RESOURCE as _SCHEMA_TAG_RESOURCE, - TAG_RESOURCE_INPUT as _SCHEMA_TAG_RESOURCE_INPUT, - TAG_RESOURCE_OUTPUT as _SCHEMA_TAG_RESOURCE_OUTPUT, - TEXT_INFERENCE_CONFIG as _SCHEMA_TEXT_INFERENCE_CONFIG, - TEXT_PROMPT as _SCHEMA_TEXT_PROMPT, - TEXT_RESPONSE_PART as _SCHEMA_TEXT_RESPONSE_PART, - TEXT_TO_SQL_CONFIGURATION as _SCHEMA_TEXT_TO_SQL_CONFIGURATION, - TEXT_TO_SQL_KNOWLEDGE_BASE_CONFIGURATION as _SCHEMA_TEXT_TO_SQL_KNOWLEDGE_BASE_CONFIGURATION, - THROTTLING_EXCEPTION as _SCHEMA_THROTTLING_EXCEPTION, - TRACE as _SCHEMA_TRACE, - TRACE_ELEMENTS as _SCHEMA_TRACE_ELEMENTS, - TRACE_PART as _SCHEMA_TRACE_PART, - TRANSFORMATION_CONFIGURATION as _SCHEMA_TRANSFORMATION_CONFIGURATION, UNTAG_RESOURCE as _SCHEMA_UNTAG_RESOURCE, - UNTAG_RESOURCE_INPUT as _SCHEMA_UNTAG_RESOURCE_INPUT, - UNTAG_RESOURCE_OUTPUT as _SCHEMA_UNTAG_RESOURCE_OUTPUT, UPDATE_SESSION as _SCHEMA_UPDATE_SESSION, - UPDATE_SESSION_INPUT as _SCHEMA_UPDATE_SESSION_INPUT, - UPDATE_SESSION_OUTPUT as _SCHEMA_UPDATE_SESSION_OUTPUT, - USAGE as _SCHEMA_USAGE, - USER_CONTEXT as _SCHEMA_USER_CONTEXT, - VALIDATION_EXCEPTION as _SCHEMA_VALIDATION_EXCEPTION, - VECTOR_SEARCH_BEDROCK_RERANKING_CONFIGURATION as _SCHEMA_VECTOR_SEARCH_BEDROCK_RERANKING_CONFIGURATION, - VECTOR_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION as _SCHEMA_VECTOR_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION, - VECTOR_SEARCH_RERANKING_CONFIGURATION as _SCHEMA_VECTOR_SEARCH_RERANKING_CONFIGURATION, - VIDEO_SEGMENT as _SCHEMA_VIDEO_SEGMENT, ) +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .models import ( + AgenticRetrieveStreamInput, + AgenticRetrieveStreamOutput, + CheckIngestedDocumentAclInput, + CheckIngestedDocumentAclOutput, + CreateInvocationInput, + CreateInvocationOutput, + CreateSessionInput, + CreateSessionOutput, + DeleteAgentMemoryInput, + DeleteAgentMemoryOutput, + DeleteSessionInput, + DeleteSessionOutput, + EndSessionInput, + EndSessionOutput, + GenerateQueryInput, + GenerateQueryOutput, + GetAgentMemoryInput, + GetAgentMemoryOutput, + GetDocumentContentInput, + GetDocumentContentOutput, + GetExecutionFlowSnapshotInput, + GetExecutionFlowSnapshotOutput, + GetFlowExecutionInput, + GetFlowExecutionOutput, + GetIngestedDocumentAclInput, + GetIngestedDocumentAclOutput, + GetInvocationStepInput, + GetInvocationStepOutput, + GetSessionInput, + GetSessionOutput, + InvokeAgentInput, + InvokeAgentOutput, + InvokeFlowInput, + InvokeFlowOutput, + InvokeInlineAgentInput, + InvokeInlineAgentOutput, + ListFlowExecutionEventsInput, + ListFlowExecutionEventsOutput, + ListFlowExecutionsInput, + ListFlowExecutionsOutput, + ListInvocationStepsInput, + ListInvocationStepsOutput, + ListInvocationsInput, + ListInvocationsOutput, + ListSessionsInput, + ListSessionsOutput, + ListTagsForResourceInput, + ListTagsForResourceOutput, + OptimizePromptInput, + OptimizePromptOutput, + PutInvocationStepInput, + PutInvocationStepOutput, + RerankInput, + RerankOutput, + RetrieveAndGenerateOperationInput, + RetrieveAndGenerateOperationOutput, + RetrieveAndGenerateStreamInput, + RetrieveAndGenerateStreamOutput, + RetrieveInput, + RetrieveOutput, + StartFlowExecutionInput, + StartFlowExecutionOutput, + StopFlowExecutionInput, + StopFlowExecutionOutput, + TagResourceInput, + TagResourceOutput, + UntagResourceInput, + UntagResourceOutput, + UpdateSessionInput, + UpdateSessionOutput, + ) -logger = logging.getLogger(__name__) - - -class ServiceError(ModeledError): - """ - Base error for all errors in the service. - - Some exceptions do not extend from this class, including - synthetic, implicit, and shared exception types. - """ - - -@dataclass(kw_only=True) -class AccessDeniedException(ServiceError): - """ - The request is denied because of missing access permissions. Check your - permissions and retry your request. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACCESS_DENIED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_ACCESS_DENIED_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_ACCESS_DENIED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ACCESS_DENIED_EXCEPTION, consumer=_consumer) - return kwargs - - -class CustomControlMethod(UnknownEnumMixin, StrEnum): - RETURN_CONTROL = "RETURN_CONTROL" - - -@dataclass -class ActionGroupExecutorLambda: - """ - The Amazon Resource Name (ARN) of the Lambda function containing the - business logic that is carried out upon invoking the action. - """ - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACTION_GROUP_EXECUTOR, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_ACTION_GROUP_EXECUTOR.members["lambda"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string( - _SCHEMA_ACTION_GROUP_EXECUTOR.members["lambda"] - ) - ) - - -@dataclass -class ActionGroupExecutorCustomControl: - """ - To return the action group invocation results directly in the - `InvokeInlineAgent` response, specify `RETURN_CONTROL`. - """ - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACTION_GROUP_EXECUTOR, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_ACTION_GROUP_EXECUTOR.members["customControl"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=CustomControlMethod( - deserializer.read_string( - _SCHEMA_ACTION_GROUP_EXECUTOR.members["customControl"] - ) - ) - ) - - -@dataclass -class ActionGroupExecutorUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ActionGroupExecutor = Union[ - ActionGroupExecutorLambda - | ActionGroupExecutorCustomControl - | ActionGroupExecutorUnknown -] -""" -Contains details about the Lambda function containing the business logic -that is carried out upon invoking the action or the custom control -method for handling the information elicited from the user. -""" - - -class _ActionGroupExecutorDeserializer: - _result: ActionGroupExecutor | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> ActionGroupExecutor: - self._result = None - deserializer.read_struct(_SCHEMA_ACTION_GROUP_EXECUTOR, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(ActionGroupExecutorLambda.deserialize(de)) - - case 1: - self._set_result(ActionGroupExecutorCustomControl.deserialize(de)) - - case _: - self._set_result( - ActionGroupExecutorUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: ActionGroupExecutor) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class ExecutionType(UnknownEnumMixin, StrEnum): - LAMBDA_ = "LAMBDA" - RETURN_CONTROL = "RETURN_CONTROL" - - -@dataclass(kw_only=True) -class Parameter: - """A parameter for the API request or function.""" - - name: str | None = None - """The name of the parameter.""" - - type: str | None = None - """The type of the parameter.""" - - value: str | None = None - """The value of the parameter.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PARAMETER, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string(_SCHEMA_PARAMETER.members["name"], self.name) - - if self.type is not None: - serializer.write_string(_SCHEMA_PARAMETER.members["type"], self.type) - - if self.value is not None: - serializer.write_string(_SCHEMA_PARAMETER.members["value"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string(_SCHEMA_PARAMETER.members["name"]) - - case 1: - kwargs["type"] = de.read_string(_SCHEMA_PARAMETER.members["type"]) - - case 2: - kwargs["value"] = de.read_string(_SCHEMA_PARAMETER.members["value"]) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PARAMETER, consumer=_consumer) - return kwargs - - -def _serialize_parameters( - serializer: ShapeSerializer, schema: Schema, value: list[Parameter] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_parameters( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Parameter]: - result: list[Parameter] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Parameter.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_content_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, list[Parameter]] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: _serialize_parameters(vs, value_schema, v)) - - -def _deserialize_content_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, list[Parameter]]: - result: dict[str, list[Parameter]] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = _deserialize_parameters(d, value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class RequestBody: - """The parameters in the API request body.""" - - content: dict[str, list[Parameter]] | None = None - """The content in the request body.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REQUEST_BODY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.content is not None: - _serialize_content_map( - serializer, _SCHEMA_REQUEST_BODY.members["content"], self.content - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["content"] = _deserialize_content_map( - de, _SCHEMA_REQUEST_BODY.members["content"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_REQUEST_BODY, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ActionGroupInvocationInput: - """ - Contains information about the action group being invoked. For more - information about the possible structures, see the InvocationInput tab - in - [OrchestrationTrace](https://docs.aws.amazon.com/bedrock/latest/userguide/trace-orchestration.html) - in the [Amazon Bedrock User - Guide](https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html). - """ - - action_group_name: str | None = field(repr=False, default=None) - """The name of the action group.""" - - verb: str | None = field(repr=False, default=None) - """The API method being used, based off the action group.""" - - api_path: str | None = field(repr=False, default=None) - """The path to the API to call, based off the action group.""" - - parameters: list[Parameter] | None = None - """The parameters in the Lambda input event.""" - - request_body: RequestBody | None = None - """The parameters in the request body for the Lambda input event.""" - - function: str | None = field(repr=False, default=None) - """The function in the action group to call.""" - - execution_type: str | None = None - """ - How fulfillment of the action is handled. For more information, see - [Handling fulfillment of the - action](https://docs.aws.amazon.com/bedrock/latest/userguide/action-handle.html). - """ - - invocation_id: str | None = None - """ - The unique identifier of the invocation. Only returned if the - `executionType` is `RETURN_CONTROL`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACTION_GROUP_INVOCATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.action_group_name is not None: - serializer.write_string( - _SCHEMA_ACTION_GROUP_INVOCATION_INPUT.members["actionGroupName"], - self.action_group_name, - ) - - if self.verb is not None: - serializer.write_string( - _SCHEMA_ACTION_GROUP_INVOCATION_INPUT.members["verb"], self.verb - ) - - if self.api_path is not None: - serializer.write_string( - _SCHEMA_ACTION_GROUP_INVOCATION_INPUT.members["apiPath"], self.api_path - ) - - if self.parameters is not None: - _serialize_parameters( - serializer, - _SCHEMA_ACTION_GROUP_INVOCATION_INPUT.members["parameters"], - self.parameters, - ) - - if self.request_body is not None: - serializer.write_struct( - _SCHEMA_ACTION_GROUP_INVOCATION_INPUT.members["requestBody"], - self.request_body, - ) - - if self.function is not None: - serializer.write_string( - _SCHEMA_ACTION_GROUP_INVOCATION_INPUT.members["function"], self.function - ) - - if self.execution_type is not None: - serializer.write_string( - _SCHEMA_ACTION_GROUP_INVOCATION_INPUT.members["executionType"], - self.execution_type, - ) - - if self.invocation_id is not None: - serializer.write_string( - _SCHEMA_ACTION_GROUP_INVOCATION_INPUT.members["invocationId"], - self.invocation_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["action_group_name"] = de.read_string( - _SCHEMA_ACTION_GROUP_INVOCATION_INPUT.members["actionGroupName"] - ) - - case 1: - kwargs["verb"] = de.read_string( - _SCHEMA_ACTION_GROUP_INVOCATION_INPUT.members["verb"] - ) - - case 2: - kwargs["api_path"] = de.read_string( - _SCHEMA_ACTION_GROUP_INVOCATION_INPUT.members["apiPath"] - ) - - case 3: - kwargs["parameters"] = _deserialize_parameters( - de, _SCHEMA_ACTION_GROUP_INVOCATION_INPUT.members["parameters"] - ) - - case 4: - kwargs["request_body"] = RequestBody.deserialize(de) - - case 5: - kwargs["function"] = de.read_string( - _SCHEMA_ACTION_GROUP_INVOCATION_INPUT.members["function"] - ) - - case 6: - kwargs["execution_type"] = ExecutionType( - de.read_string( - _SCHEMA_ACTION_GROUP_INVOCATION_INPUT.members[ - "executionType" - ] - ) - ) - - case 7: - kwargs["invocation_id"] = de.read_string( - _SCHEMA_ACTION_GROUP_INVOCATION_INPUT.members["invocationId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ACTION_GROUP_INVOCATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class Usage: - """Contains information of the usage of the foundation model.""" - - input_tokens: int | None = None - """ - Contains information about the input tokens from the foundation model - usage. - """ - - output_tokens: int | None = None - """ - Contains information about the output tokens from the foundation model - usage. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_USAGE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.input_tokens is not None: - serializer.write_integer( - _SCHEMA_USAGE.members["inputTokens"], self.input_tokens - ) - - if self.output_tokens is not None: - serializer.write_integer( - _SCHEMA_USAGE.members["outputTokens"], self.output_tokens - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["input_tokens"] = de.read_integer( - _SCHEMA_USAGE.members["inputTokens"] - ) - - case 1: - kwargs["output_tokens"] = de.read_integer( - _SCHEMA_USAGE.members["outputTokens"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_USAGE, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Metadata: - """ - Provides information about the execution process for different types of - invocations, such as model invocation, knowledge base invocation, agent - collaborator invocation, guardrail invocation, and code interpreter - Invocation. - """ - - start_time: datetime | None = None - """ - In the final response, `startTime` is the start time of the agent - invocation operation. - """ - - end_time: datetime | None = None - """ - In the final response, `endTime` is the end time of the agent invocation - operation. - """ - - total_time_ms: int | None = None - """ - The total execution time for the specific invocation being processed - (model, knowledge base, guardrail, agent collaborator, or code - interpreter). It represents how long the individual invocation took. - """ - - operation_total_time_ms: int | None = None - """ - The total time it took for the agent to complete execution. This field - is only set for the final response. - """ - - client_request_id: str | None = None - """ - A unique identifier associated with the downstream invocation. This ID - can be used for tracing, debugging, and identifying specific invocations - in customer logs or systems. - """ - - usage: Usage | None = field(repr=False, default=None) - """ - Specific to model invocation and contains details about the usage of a - foundation model. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_METADATA, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.start_time is not None: - serializer.write_timestamp( - _SCHEMA_METADATA.members["startTime"], self.start_time - ) - - if self.end_time is not None: - serializer.write_timestamp( - _SCHEMA_METADATA.members["endTime"], self.end_time - ) - - if self.total_time_ms is not None: - serializer.write_long( - _SCHEMA_METADATA.members["totalTimeMs"], self.total_time_ms - ) - - if self.operation_total_time_ms is not None: - serializer.write_long( - _SCHEMA_METADATA.members["operationTotalTimeMs"], - self.operation_total_time_ms, - ) - - if self.client_request_id is not None: - serializer.write_string( - _SCHEMA_METADATA.members["clientRequestId"], self.client_request_id - ) - - if self.usage is not None: - serializer.write_struct(_SCHEMA_METADATA.members["usage"], self.usage) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["start_time"] = de.read_timestamp( - _SCHEMA_METADATA.members["startTime"] - ) - - case 1: - kwargs["end_time"] = de.read_timestamp( - _SCHEMA_METADATA.members["endTime"] - ) - - case 2: - kwargs["total_time_ms"] = de.read_long( - _SCHEMA_METADATA.members["totalTimeMs"] - ) - - case 3: - kwargs["operation_total_time_ms"] = de.read_long( - _SCHEMA_METADATA.members["operationTotalTimeMs"] - ) - - case 4: - kwargs["client_request_id"] = de.read_string( - _SCHEMA_METADATA.members["clientRequestId"] - ) - - case 5: - kwargs["usage"] = Usage.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_METADATA, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ActionGroupInvocationOutput: - """ - Contains the JSON-formatted string returned by the API invoked by the - action group. - """ - - text: str | None = field(repr=False, default=None) - """ - The JSON-formatted string returned by the API invoked by the action - group. - """ - - metadata: Metadata | None = field(repr=False, default=None) - """Contains information about the action group output.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACTION_GROUP_INVOCATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.text is not None: - serializer.write_string( - _SCHEMA_ACTION_GROUP_INVOCATION_OUTPUT.members["text"], self.text - ) - - if self.metadata is not None: - serializer.write_struct( - _SCHEMA_ACTION_GROUP_INVOCATION_OUTPUT.members["metadata"], - self.metadata, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["text"] = de.read_string( - _SCHEMA_ACTION_GROUP_INVOCATION_OUTPUT.members["text"] - ) - - case 1: - kwargs["metadata"] = Metadata.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ACTION_GROUP_INVOCATION_OUTPUT, consumer=_consumer - ) - return kwargs - - -class ActionGroupSignature(UnknownEnumMixin, StrEnum): - AMAZON_USERINPUT = "AMAZON.UserInput" - AMAZON_CODEINTERPRETER = "AMAZON.CodeInterpreter" - ANTHROPIC_COMPUTER = "ANTHROPIC.Computer" - ANTHROPIC_BASH = "ANTHROPIC.Bash" - ANTHROPIC_TEXTEDITOR = "ANTHROPIC.TextEditor" - - -def _serialize_action_group_signature_params( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_action_group_signature_params( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -class ActionInvocationType(UnknownEnumMixin, StrEnum): - RESULT = "RESULT" - USER_CONFIRMATION = "USER_CONFIRMATION" - USER_CONFIRMATION_AND_RESULT = "USER_CONFIRMATION_AND_RESULT" - - -def _serialize_additional_model_request_fields( - serializer: ShapeSerializer, schema: Schema, value: dict[str, Document] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_document(value_schema, v)) - - -def _deserialize_additional_model_request_fields( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, Document]: - result: dict[str, Document] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_document(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class S3Identifier: - """The identifier information for an Amazon S3 bucket.""" - - s3_bucket_name: str | None = None - """The name of the S3 bucket.""" - - s3_object_key: str | None = None - """The S3 object key for the S3 resource.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_S3_IDENTIFIER, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.s3_bucket_name is not None: - serializer.write_string( - _SCHEMA_S3_IDENTIFIER.members["s3BucketName"], self.s3_bucket_name - ) - - if self.s3_object_key is not None: - serializer.write_string( - _SCHEMA_S3_IDENTIFIER.members["s3ObjectKey"], self.s3_object_key - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["s3_bucket_name"] = de.read_string( - _SCHEMA_S3_IDENTIFIER.members["s3BucketName"] - ) - - case 1: - kwargs["s3_object_key"] = de.read_string( - _SCHEMA_S3_IDENTIFIER.members["s3ObjectKey"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_S3_IDENTIFIER, consumer=_consumer) - return kwargs - - -@dataclass -class APISchemaS3: - """ - Contains details about the S3 object containing the OpenAPI schema for - the action group. - """ - - value: S3Identifier - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_API_SCHEMA, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_API_SCHEMA.members["s3"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=S3Identifier.deserialize(deserializer)) - - -@dataclass -class APISchemaPayload: - """ - The JSON or YAML-formatted payload defining the OpenAPI schema for the - action group. - """ - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_API_SCHEMA, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_API_SCHEMA.members["payload"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string(_SCHEMA_API_SCHEMA.members["payload"]) - ) - - -@dataclass -class APISchemaUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -APISchema = Union[APISchemaS3 | APISchemaPayload | APISchemaUnknown] -""" -Contains details about the OpenAPI schema for the action group. For more -information, see [Action group OpenAPI -schemas](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-api-schema.html). -You can either include the schema directly in the payload field or you -can upload it to an S3 bucket and specify the S3 bucket location in the -s3 field. -""" - - -class _APISchemaDeserializer: - _result: APISchema | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> APISchema: - self._result = None - deserializer.read_struct(_SCHEMA_API_SCHEMA, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(APISchemaS3.deserialize(de)) - - case 1: - self._set_result(APISchemaPayload.deserialize(de)) - - case _: - self._set_result(APISchemaUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: APISchema) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class ParameterType(UnknownEnumMixin, StrEnum): - STRING = "string" - NUMBER = "number" - INTEGER = "integer" - BOOLEAN = "boolean" - ARRAY = "array" - - -@dataclass(kw_only=True) -class ParameterDetail: - """Contains details about a parameter in a function for an action group.""" - - type: str - """The data type of the parameter.""" - - description: str | None = None - """ - A description of the parameter. Helps the foundation model determine how - to elicit the parameters from the user. - """ - - required: bool | None = None - """ - Whether the parameter is required for the agent to complete the function - for action group invocation. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PARAMETER_DETAIL, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.description is not None: - serializer.write_string( - _SCHEMA_PARAMETER_DETAIL.members["description"], self.description - ) - - serializer.write_string(_SCHEMA_PARAMETER_DETAIL.members["type"], self.type) - if self.required is not None: - serializer.write_boolean( - _SCHEMA_PARAMETER_DETAIL.members["required"], self.required - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["description"] = de.read_string( - _SCHEMA_PARAMETER_DETAIL.members["description"] - ) - - case 1: - kwargs["type"] = ParameterType( - de.read_string(_SCHEMA_PARAMETER_DETAIL.members["type"]) - ) - - case 2: - kwargs["required"] = de.read_boolean( - _SCHEMA_PARAMETER_DETAIL.members["required"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PARAMETER_DETAIL, consumer=_consumer) - if "type" not in kwargs: - kwargs["type"] = ParameterType._corrected("") - return kwargs - - -def _serialize_parameter_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, ParameterDetail] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_struct(value_schema, v)) - - -def _deserialize_parameter_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, ParameterDetail]: - result: dict[str, ParameterDetail] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = ParameterDetail.deserialize(d) - - deserializer.read_map(schema, _read_value) - return result - - -class RequireConfirmation(UnknownEnumMixin, StrEnum): - ENABLED = "ENABLED" - DISABLED = "DISABLED" - - -@dataclass(kw_only=True) -class FunctionDefinition: - """ - Defines parameters that the agent needs to invoke from the user to - complete the function. Corresponds to an action in an action group. - """ - - name: str = field(repr=False) - """A name for the function.""" - - description: str | None = None - """A description of the function and its purpose.""" - - parameters: dict[str, ParameterDetail] | None = None - """ - The parameters that the agent elicits from the user to fulfill the - function. - """ - - require_confirmation: str | None = None - """ - Contains information if user confirmation is required to invoke the - function. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FUNCTION_DEFINITION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_FUNCTION_DEFINITION.members["name"], self.name) - if self.description is not None: - serializer.write_string( - _SCHEMA_FUNCTION_DEFINITION.members["description"], self.description - ) - - if self.parameters is not None: - _serialize_parameter_map( - serializer, - _SCHEMA_FUNCTION_DEFINITION.members["parameters"], - self.parameters, - ) - - if self.require_confirmation is not None: - serializer.write_string( - _SCHEMA_FUNCTION_DEFINITION.members["requireConfirmation"], - self.require_confirmation, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_FUNCTION_DEFINITION.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_FUNCTION_DEFINITION.members["description"] - ) - - case 2: - kwargs["parameters"] = _deserialize_parameter_map( - de, _SCHEMA_FUNCTION_DEFINITION.members["parameters"] - ) - - case 3: - kwargs["require_confirmation"] = RequireConfirmation( - de.read_string( - _SCHEMA_FUNCTION_DEFINITION.members["requireConfirmation"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FUNCTION_DEFINITION, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - return kwargs - - -def _serialize_functions( - serializer: ShapeSerializer, schema: Schema, value: list[FunctionDefinition] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_functions( - deserializer: ShapeDeserializer, schema: Schema -) -> list[FunctionDefinition]: - result: list[FunctionDefinition] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(FunctionDefinition.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass -class FunctionSchemaFunctions: - """A list of functions that each define an action in the action group.""" - - value: list[FunctionDefinition] - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FUNCTION_SCHEMA, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_functions( - serializer, _SCHEMA_FUNCTION_SCHEMA.members["functions"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_deserialize_functions( - deserializer, _SCHEMA_FUNCTION_SCHEMA.members["functions"] - ) - ) - - -@dataclass -class FunctionSchemaUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -FunctionSchema = Union[FunctionSchemaFunctions | FunctionSchemaUnknown] -""" -Contains details about the function schema for the action group or the -JSON or YAML-formatted payload defining the schema. -""" - - -class _FunctionSchemaDeserializer: - _result: FunctionSchema | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> FunctionSchema: - self._result = None - deserializer.read_struct(_SCHEMA_FUNCTION_SCHEMA, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(FunctionSchemaFunctions.deserialize(de)) - - case _: - self._set_result(FunctionSchemaUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: FunctionSchema) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class AgentActionGroup: - """Contains details of the inline agent's action group.""" - - action_group_name: str = field(repr=False) - """The name of the action group.""" - - description: str | None = field(repr=False, default=None) - """A description of the action group.""" - - parent_action_group_signature: str | None = None - """ - Specify a built-in or computer use action for this action group. If you - specify a value, you must leave the `description`, `apiSchema`, and - `actionGroupExecutor` fields empty for this action group. - - - To allow your agent to request the user for additional information - when trying to complete a task, set this field to `AMAZON.UserInput`. - - - To allow your agent to generate, run, and troubleshoot code when - trying to complete a task, set this field to `AMAZON.CodeInterpreter`. - - - To allow your agent to use an Anthropic computer use tool, specify one - of the following values. - - Warning: - Computer use is a new Anthropic Claude model capability (in beta) - available with Anthropic Claude 3.7 Sonnet and Claude 3.5 Sonnet v2 - only. When operating computer use functionality, we recommend taking - additional security precautions, such as executing computer actions in - virtual environments with restricted data access and limited internet - connectivity. For more information, see [Configure an Amazon Bedrock - Agent to complete tasks with computer use - tools](https://docs.aws.amazon.com/bedrock/latest/userguide/agent-computer-use.html). - - - `ANTHROPIC.Computer` - Gives the agent permission to use the mouse - and keyboard and take screenshots. - - - `ANTHROPIC.TextEditor` - Gives the agent permission to view, create - and edit files. - - - `ANTHROPIC.Bash` - Gives the agent permission to run commands in a - bash shell. - """ - - action_group_executor: ActionGroupExecutor | None = None - """ - The Amazon Resource Name (ARN) of the Lambda function containing the - business logic that is carried out upon invoking the action or the - custom control method for handling the information elicited from the - user. - """ - - api_schema: APISchema | None = None - """ - Contains either details about the S3 object containing the OpenAPI - schema for the action group or the JSON or YAML-formatted payload - defining the schema. For more information, see [Action group OpenAPI - schemas](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-api-schema.html). - """ - - function_schema: FunctionSchema | None = None - """ - Contains details about the function schema for the action group or the - JSON or YAML-formatted payload defining the schema. - """ - - parent_action_group_signature_params: dict[str, str] | None = None - """ - The configuration settings for a computer use action. - - Warning: - Computer use is a new Anthropic Claude model capability (in beta) - available with Claude 3.7 Sonnet and Claude 3.5 Sonnet v2 only. For more - information, see [Configure an Amazon Bedrock Agent to complete tasks - with computer use - tools](https://docs.aws.amazon.com/bedrock/latest/userguide/agent-computer-use.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENT_ACTION_GROUP, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AGENT_ACTION_GROUP.members["actionGroupName"], - self.action_group_name, - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_AGENT_ACTION_GROUP.members["description"], self.description - ) - - if self.parent_action_group_signature is not None: - serializer.write_string( - _SCHEMA_AGENT_ACTION_GROUP.members["parentActionGroupSignature"], - self.parent_action_group_signature, - ) - - if self.action_group_executor is not None: - serializer.write_struct( - _SCHEMA_AGENT_ACTION_GROUP.members["actionGroupExecutor"], - self.action_group_executor, - ) - - if self.api_schema is not None: - serializer.write_struct( - _SCHEMA_AGENT_ACTION_GROUP.members["apiSchema"], self.api_schema - ) - - if self.function_schema is not None: - serializer.write_struct( - _SCHEMA_AGENT_ACTION_GROUP.members["functionSchema"], - self.function_schema, - ) - - if self.parent_action_group_signature_params is not None: - _serialize_action_group_signature_params( - serializer, - _SCHEMA_AGENT_ACTION_GROUP.members["parentActionGroupSignatureParams"], - self.parent_action_group_signature_params, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["action_group_name"] = de.read_string( - _SCHEMA_AGENT_ACTION_GROUP.members["actionGroupName"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_AGENT_ACTION_GROUP.members["description"] - ) - - case 2: - kwargs["parent_action_group_signature"] = ActionGroupSignature( - de.read_string( - _SCHEMA_AGENT_ACTION_GROUP.members[ - "parentActionGroupSignature" - ] - ) - ) - - case 3: - kwargs["action_group_executor"] = ( - _ActionGroupExecutorDeserializer().deserialize(de) - ) - - case 4: - kwargs["api_schema"] = _APISchemaDeserializer().deserialize(de) - - case 5: - kwargs["function_schema"] = ( - _FunctionSchemaDeserializer().deserialize(de) - ) - - case 6: - kwargs["parent_action_group_signature_params"] = ( - _deserialize_action_group_signature_params( - de, - _SCHEMA_AGENT_ACTION_GROUP.members[ - "parentActionGroupSignatureParams" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AGENT_ACTION_GROUP, consumer=_consumer) - if "action_group_name" not in kwargs: - kwargs["action_group_name"] = "" - return kwargs - - -def _serialize_agent_action_groups( - serializer: ShapeSerializer, schema: Schema, value: list[AgentActionGroup] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_agent_action_groups( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AgentActionGroup]: - result: list[AgentActionGroup] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AgentActionGroup.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class AgentCollaboration(UnknownEnumMixin, StrEnum): - SUPERVISOR = "SUPERVISOR" - SUPERVISOR_ROUTER = "SUPERVISOR_ROUTER" - DISABLED = "DISABLED" - - -class ConfirmationState(UnknownEnumMixin, StrEnum): - CONFIRM = "CONFIRM" - DENY = "DENY" - - -class ImageInputFormat(UnknownEnumMixin, StrEnum): - PNG = "png" - JPEG = "jpeg" - GIF = "gif" - WEBP = "webp" - - -@dataclass -class ImageInputSourceBytes: - """ - The raw image bytes for the image. If you use an Amazon Web Services - SDK, you don't need to encode the image bytes in base64. - """ - - value: bytes - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IMAGE_INPUT_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_blob(_SCHEMA_IMAGE_INPUT_SOURCE.members["bytes"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_blob(_SCHEMA_IMAGE_INPUT_SOURCE.members["bytes"]) - ) - - -@dataclass -class ImageInputSourceUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ImageInputSource = Union[ImageInputSourceBytes | ImageInputSourceUnknown] -""" -Details about the source of an input image in the result from a function -in the action group invocation. -""" - - -class _ImageInputSourceDeserializer: - _result: ImageInputSource | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> ImageInputSource: - self._result = None - deserializer.read_struct(_SCHEMA_IMAGE_INPUT_SOURCE, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(ImageInputSourceBytes.deserialize(de)) - - case _: - self._set_result( - ImageInputSourceUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: ImageInputSource) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class ImageInput: - """ - Details about an image in the result from a function in the action group - invocation. You can specify images only when the function is a computer - use action. For more information, see [Configure an Amazon Bedrock Agent - to complete tasks with computer use - tools](https://docs.aws.amazon.com/bedrock/latest/userguide/agent-computer-use.html). - """ - - format: str - """The type of image in the result.""" - - source: ImageInputSource - """The source of the image in the result.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IMAGE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_IMAGE_INPUT.members["format"], self.format) - serializer.write_struct(_SCHEMA_IMAGE_INPUT.members["source"], self.source) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["format"] = ImageInputFormat( - de.read_string(_SCHEMA_IMAGE_INPUT.members["format"]) - ) - - case 1: - kwargs["source"] = _ImageInputSourceDeserializer().deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_IMAGE_INPUT, consumer=_consumer) - if "format" not in kwargs: - kwargs["format"] = ImageInputFormat._corrected("") - if "source" not in kwargs: - kwargs["source"] = ImageInputSourceUnknown(tag="") - return kwargs - - -def _serialize_image_inputs( - serializer: ShapeSerializer, schema: Schema, value: list[ImageInput] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_image_inputs( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ImageInput]: - result: list[ImageInput] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ImageInput.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ContentBody: - """ - Contains the body of the API response. - - This data type is used in the following API operations: - - - In the `returnControlInvocationResults` field of the [InvokeAgent - request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_RequestSyntax) - """ - - body: str | None = None - """The body of the API response.""" - - images: list[ImageInput] | None = None - """ - Lists details, including format and source, for the image in the - response from the function call. You can specify only one image and the - function in the `returnControlInvocationResults` must be a computer use - action. For more information, see [Configure an Amazon Bedrock Agent to - complete tasks with computer use - tools](https://docs.aws.amazon.com/bedrock/latest/userguide/agent-computer-use.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT_BODY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.body is not None: - serializer.write_string(_SCHEMA_CONTENT_BODY.members["body"], self.body) - - if self.images is not None: - _serialize_image_inputs( - serializer, _SCHEMA_CONTENT_BODY.members["images"], self.images - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["body"] = de.read_string( - _SCHEMA_CONTENT_BODY.members["body"] - ) - - case 1: - kwargs["images"] = _deserialize_image_inputs( - de, _SCHEMA_CONTENT_BODY.members["images"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONTENT_BODY, consumer=_consumer) - return kwargs - - -def _serialize_response_body( - serializer: ShapeSerializer, schema: Schema, value: dict[str, ContentBody] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_struct(value_schema, v)) - - -def _deserialize_response_body( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, ContentBody]: - result: dict[str, ContentBody] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = ContentBody.deserialize(d) - - deserializer.read_map(schema, _read_value) - return result - - -class ResponseState(UnknownEnumMixin, StrEnum): - FAILURE = "FAILURE" - REPROMPT = "REPROMPT" - - -@dataclass(kw_only=True) -class ApiResult: - """ - Contains information about the API operation that was called from the - action group and the response body that was returned. - - This data type is used in the following API operations: - - - In the `returnControlInvocationResults` of the [InvokeAgent - request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_RequestSyntax) - """ - - action_group: str - """The action group that the API operation belongs to.""" - - http_method: str | None = None - """The HTTP method for the API operation.""" - - api_path: str | None = field(repr=False, default=None) - """The path to the API operation.""" - - confirmation_state: str | None = None - """ - Controls the API operations or functions to invoke based on the user - confirmation. - """ - - response_state: str | None = None - """ - Controls the final response state returned to end user when API/Function - execution failed. When this state is FAILURE, the request would fail - with dependency failure exception. When this state is REPROMPT, the - API/function response will be sent to model for re-prompt - """ - - http_status_code: int | None = None - """ - http status code from API execution response (for example: 200, 400, - 500). - """ - - response_body: dict[str, ContentBody] | None = None - """ - The response body from the API operation. The key of the object is the - content type (currently, only `TEXT` is supported). The response may be - returned directly or from the Lambda function. - """ - - agent_id: str | None = None - """The agent's ID.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_API_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_API_RESULT.members["actionGroup"], self.action_group - ) - if self.http_method is not None: - serializer.write_string( - _SCHEMA_API_RESULT.members["httpMethod"], self.http_method - ) - - if self.api_path is not None: - serializer.write_string( - _SCHEMA_API_RESULT.members["apiPath"], self.api_path - ) - - if self.confirmation_state is not None: - serializer.write_string( - _SCHEMA_API_RESULT.members["confirmationState"], self.confirmation_state - ) - - if self.response_state is not None: - serializer.write_string( - _SCHEMA_API_RESULT.members["responseState"], self.response_state - ) - - if self.http_status_code is not None: - serializer.write_integer( - _SCHEMA_API_RESULT.members["httpStatusCode"], self.http_status_code - ) - - if self.response_body is not None: - _serialize_response_body( - serializer, - _SCHEMA_API_RESULT.members["responseBody"], - self.response_body, - ) - - if self.agent_id is not None: - serializer.write_string( - _SCHEMA_API_RESULT.members["agentId"], self.agent_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["action_group"] = de.read_string( - _SCHEMA_API_RESULT.members["actionGroup"] - ) - - case 1: - kwargs["http_method"] = de.read_string( - _SCHEMA_API_RESULT.members["httpMethod"] - ) - - case 2: - kwargs["api_path"] = de.read_string( - _SCHEMA_API_RESULT.members["apiPath"] - ) - - case 3: - kwargs["confirmation_state"] = ConfirmationState( - de.read_string(_SCHEMA_API_RESULT.members["confirmationState"]) - ) - - case 4: - kwargs["response_state"] = ResponseState( - de.read_string(_SCHEMA_API_RESULT.members["responseState"]) - ) - - case 5: - kwargs["http_status_code"] = de.read_integer( - _SCHEMA_API_RESULT.members["httpStatusCode"] - ) - - case 6: - kwargs["response_body"] = _deserialize_response_body( - de, _SCHEMA_API_RESULT.members["responseBody"] - ) - - case 7: - kwargs["agent_id"] = de.read_string( - _SCHEMA_API_RESULT.members["agentId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_API_RESULT, consumer=_consumer) - if "action_group" not in kwargs: - kwargs["action_group"] = "" - return kwargs - - -@dataclass(kw_only=True) -class FunctionResult: - """ - Contains information about the function that was called from the action - group and the response that was returned. - - This data type is used in the following API operations: - - - In the `returnControlInvocationResults` of the [InvokeAgent - request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_RequestSyntax) - """ - - action_group: str - """The action group that the function belongs to.""" - - confirmation_state: str | None = None - """ - Contains the user confirmation information about the function that was - called. - """ - - function: str | None = None - """The name of the function that was called.""" - - response_body: dict[str, ContentBody] | None = None - """ - The response from the function call using the parameters. The response - might be returned directly or from the Lambda function. Specify `TEXT` - or `IMAGES`. The key of the object is the content type. You can only - specify one type. If you specify `IMAGES`, you can specify only one - image. You can specify images only when the function in the - `returnControlInvocationResults` is a computer use action. For more - information, see [Configure an Amazon Bedrock Agent to complete tasks - with computer use - tools](https://docs.aws.amazon.com/bedrock/latest/userguide/agent-computer-use.html). - """ - - response_state: str | None = None - """ - Controls the final response state returned to end user when API/Function - execution failed. When this state is FAILURE, the request would fail - with dependency failure exception. When this state is REPROMPT, the - API/function response will be sent to model for re-prompt - """ - - agent_id: str | None = None - """The agent's ID.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FUNCTION_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_FUNCTION_RESULT.members["actionGroup"], self.action_group - ) - if self.confirmation_state is not None: - serializer.write_string( - _SCHEMA_FUNCTION_RESULT.members["confirmationState"], - self.confirmation_state, - ) - - if self.function is not None: - serializer.write_string( - _SCHEMA_FUNCTION_RESULT.members["function"], self.function - ) - - if self.response_body is not None: - _serialize_response_body( - serializer, - _SCHEMA_FUNCTION_RESULT.members["responseBody"], - self.response_body, - ) - - if self.response_state is not None: - serializer.write_string( - _SCHEMA_FUNCTION_RESULT.members["responseState"], self.response_state - ) - - if self.agent_id is not None: - serializer.write_string( - _SCHEMA_FUNCTION_RESULT.members["agentId"], self.agent_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["action_group"] = de.read_string( - _SCHEMA_FUNCTION_RESULT.members["actionGroup"] - ) - - case 1: - kwargs["confirmation_state"] = ConfirmationState( - de.read_string( - _SCHEMA_FUNCTION_RESULT.members["confirmationState"] - ) - ) - - case 2: - kwargs["function"] = de.read_string( - _SCHEMA_FUNCTION_RESULT.members["function"] - ) - - case 3: - kwargs["response_body"] = _deserialize_response_body( - de, _SCHEMA_FUNCTION_RESULT.members["responseBody"] - ) - - case 4: - kwargs["response_state"] = ResponseState( - de.read_string(_SCHEMA_FUNCTION_RESULT.members["responseState"]) - ) - - case 5: - kwargs["agent_id"] = de.read_string( - _SCHEMA_FUNCTION_RESULT.members["agentId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FUNCTION_RESULT, consumer=_consumer) - if "action_group" not in kwargs: - kwargs["action_group"] = "" - return kwargs - - -@dataclass -class InvocationResultMemberApiResult: - """The result from the API response from the action group invocation.""" - - value: ApiResult - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOCATION_RESULT_MEMBER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOCATION_RESULT_MEMBER.members["apiResult"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ApiResult.deserialize(deserializer)) - - -@dataclass -class InvocationResultMemberFunctionResult: - """The result from the function from the action group invocation.""" - - value: FunctionResult - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOCATION_RESULT_MEMBER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOCATION_RESULT_MEMBER.members["functionResult"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=FunctionResult.deserialize(deserializer)) - - -@dataclass -class InvocationResultMemberUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -InvocationResultMember = Union[ - InvocationResultMemberApiResult - | InvocationResultMemberFunctionResult - | InvocationResultMemberUnknown -] -""" -A result from the invocation of an action. For more information, see -[Return control to the agent -developer](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-returncontrol.html) -and [Control session -context](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-session-state.html). - -This data type is used in the following API operations: - -- [InvokeAgent - request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_RequestSyntax) -""" - - -class _InvocationResultMemberDeserializer: - _result: InvocationResultMember | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> InvocationResultMember: - self._result = None - deserializer.read_struct(_SCHEMA_INVOCATION_RESULT_MEMBER, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(InvocationResultMemberApiResult.deserialize(de)) - - case 1: - self._set_result(InvocationResultMemberFunctionResult.deserialize(de)) - - case _: - self._set_result( - InvocationResultMemberUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: InvocationResultMember) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_return_control_invocation_results( - serializer: ShapeSerializer, schema: Schema, value: list[InvocationResultMember] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_return_control_invocation_results( - deserializer: ShapeDeserializer, schema: Schema -) -> list[InvocationResultMember]: - result: list[InvocationResultMember] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_InvocationResultMemberDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ReturnControlResults: - """An action invocation result.""" - - invocation_id: str | None = None - """The action's invocation ID.""" - - return_control_invocation_results: list[InvocationResultMember] | None = None - """The action invocation result.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETURN_CONTROL_RESULTS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.invocation_id is not None: - serializer.write_string( - _SCHEMA_RETURN_CONTROL_RESULTS.members["invocationId"], - self.invocation_id, - ) - - if self.return_control_invocation_results is not None: - _serialize_return_control_invocation_results( - serializer, - _SCHEMA_RETURN_CONTROL_RESULTS.members[ - "returnControlInvocationResults" - ], - self.return_control_invocation_results, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["invocation_id"] = de.read_string( - _SCHEMA_RETURN_CONTROL_RESULTS.members["invocationId"] - ) - - case 1: - kwargs["return_control_invocation_results"] = ( - _deserialize_return_control_invocation_results( - de, - _SCHEMA_RETURN_CONTROL_RESULTS.members[ - "returnControlInvocationResults" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RETURN_CONTROL_RESULTS, consumer=_consumer) - return kwargs - - -class PayloadType(UnknownEnumMixin, StrEnum): - TEXT = "TEXT" - RETURN_CONTROL = "RETURN_CONTROL" - - -@dataclass(kw_only=True) -class AgentCollaboratorInputPayload: - """ - Input for an agent collaborator. The input can be text or an action - invocation result. - """ - - type: str | None = None - """The input type.""" - - text: str | None = field(repr=False, default=None) - """Input text.""" - - return_control_results: ReturnControlResults | None = None - """An action invocation result.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENT_COLLABORATOR_INPUT_PAYLOAD, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_AGENT_COLLABORATOR_INPUT_PAYLOAD.members["type"], self.type - ) - - if self.text is not None: - serializer.write_string( - _SCHEMA_AGENT_COLLABORATOR_INPUT_PAYLOAD.members["text"], self.text - ) - - if self.return_control_results is not None: - serializer.write_struct( - _SCHEMA_AGENT_COLLABORATOR_INPUT_PAYLOAD.members[ - "returnControlResults" - ], - self.return_control_results, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = PayloadType( - de.read_string( - _SCHEMA_AGENT_COLLABORATOR_INPUT_PAYLOAD.members["type"] - ) - ) - - case 1: - kwargs["text"] = de.read_string( - _SCHEMA_AGENT_COLLABORATOR_INPUT_PAYLOAD.members["text"] - ) - - case 2: - kwargs["return_control_results"] = ReturnControlResults.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AGENT_COLLABORATOR_INPUT_PAYLOAD, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class AgentCollaboratorInvocationInput: - """An agent collaborator invocation input.""" - - agent_collaborator_name: str | None = None - """The collaborator's name.""" - - agent_collaborator_alias_arn: str | None = None - """The collaborator's alias ARN.""" - - input: AgentCollaboratorInputPayload | None = None - """Text or action invocation result input for the collaborator.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENT_COLLABORATOR_INVOCATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.agent_collaborator_name is not None: - serializer.write_string( - _SCHEMA_AGENT_COLLABORATOR_INVOCATION_INPUT.members[ - "agentCollaboratorName" - ], - self.agent_collaborator_name, - ) - - if self.agent_collaborator_alias_arn is not None: - serializer.write_string( - _SCHEMA_AGENT_COLLABORATOR_INVOCATION_INPUT.members[ - "agentCollaboratorAliasArn" - ], - self.agent_collaborator_alias_arn, - ) - - if self.input is not None: - serializer.write_struct( - _SCHEMA_AGENT_COLLABORATOR_INVOCATION_INPUT.members["input"], self.input - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_collaborator_name"] = de.read_string( - _SCHEMA_AGENT_COLLABORATOR_INVOCATION_INPUT.members[ - "agentCollaboratorName" - ] - ) - - case 1: - kwargs["agent_collaborator_alias_arn"] = de.read_string( - _SCHEMA_AGENT_COLLABORATOR_INVOCATION_INPUT.members[ - "agentCollaboratorAliasArn" - ] - ) - - case 2: - kwargs["input"] = AgentCollaboratorInputPayload.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AGENT_COLLABORATOR_INVOCATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ApiParameter: - """ - Information about a parameter to provide to the API request. - - This data type is used in the following API operations: - - - [InvokeAgent - response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax) - """ - - name: str | None = None - """The name of the parameter.""" - - type: str | None = None - """The data type for the parameter.""" - - value: str | None = None - """The value of the parameter.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_API_PARAMETER, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string(_SCHEMA_API_PARAMETER.members["name"], self.name) - - if self.type is not None: - serializer.write_string(_SCHEMA_API_PARAMETER.members["type"], self.type) - - if self.value is not None: - serializer.write_string(_SCHEMA_API_PARAMETER.members["value"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_API_PARAMETER.members["name"] - ) - - case 1: - kwargs["type"] = de.read_string( - _SCHEMA_API_PARAMETER.members["type"] - ) - - case 2: - kwargs["value"] = de.read_string( - _SCHEMA_API_PARAMETER.members["value"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_API_PARAMETER, consumer=_consumer) - return kwargs - - -def _serialize_api_parameters( - serializer: ShapeSerializer, schema: Schema, value: list[ApiParameter] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_api_parameters( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ApiParameter]: - result: list[ApiParameter] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ApiParameter.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_parameter_list( - serializer: ShapeSerializer, schema: Schema, value: list[Parameter] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_parameter_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Parameter]: - result: list[Parameter] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Parameter.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class PropertyParameters: - """Contains the parameters in the request body.""" - - properties: list[Parameter] | None = None - """A list of parameters in the request body.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PROPERTY_PARAMETERS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.properties is not None: - _serialize_parameter_list( - serializer, - _SCHEMA_PROPERTY_PARAMETERS.members["properties"], - self.properties, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["properties"] = _deserialize_parameter_list( - de, _SCHEMA_PROPERTY_PARAMETERS.members["properties"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PROPERTY_PARAMETERS, consumer=_consumer) - return kwargs - - -def _serialize_api_content_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, PropertyParameters] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_struct(value_schema, v)) - - -def _deserialize_api_content_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, PropertyParameters]: - result: dict[str, PropertyParameters] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = PropertyParameters.deserialize(d) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ApiRequestBody: - """ - The request body to provide for the API request, as the agent elicited - from the user. - - This data type is used in the following API operations: - - - [InvokeAgent - response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax) - """ - - content: dict[str, PropertyParameters] | None = None - """ - The content of the request body. The key of the object in this field is - a media type defining the format of the request body. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_API_REQUEST_BODY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.content is not None: - _serialize_api_content_map( - serializer, _SCHEMA_API_REQUEST_BODY.members["content"], self.content - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["content"] = _deserialize_api_content_map( - de, _SCHEMA_API_REQUEST_BODY.members["content"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_API_REQUEST_BODY, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ApiInvocationInput: - """ - Contains information about the API operation that the agent predicts - should be called. - - This data type is used in the following API operations: - - - In the `returnControl` field of the [InvokeAgent - response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax) - """ - - action_group: str - """The action group that the API operation belongs to.""" - - http_method: str | None = None - """The HTTP method of the API operation.""" - - api_path: str | None = field(repr=False, default=None) - """The path to the API operation.""" - - parameters: list[ApiParameter] | None = None - """ - The parameters to provide for the API request, as the agent elicited - from the user. - """ - - request_body: ApiRequestBody | None = None - """ - The request body to provide for the API request, as the agent elicited - from the user. - """ - - action_invocation_type: str | None = None - """Contains information about the API operation to invoke.""" - - agent_id: str | None = None - """The agent's ID.""" - - collaborator_name: str | None = field(repr=False, default=None) - """The agent collaborator's name.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_API_INVOCATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_API_INVOCATION_INPUT.members["actionGroup"], self.action_group - ) - if self.http_method is not None: - serializer.write_string( - _SCHEMA_API_INVOCATION_INPUT.members["httpMethod"], self.http_method - ) - - if self.api_path is not None: - serializer.write_string( - _SCHEMA_API_INVOCATION_INPUT.members["apiPath"], self.api_path - ) - - if self.parameters is not None: - _serialize_api_parameters( - serializer, - _SCHEMA_API_INVOCATION_INPUT.members["parameters"], - self.parameters, - ) - - if self.request_body is not None: - serializer.write_struct( - _SCHEMA_API_INVOCATION_INPUT.members["requestBody"], self.request_body - ) - - if self.action_invocation_type is not None: - serializer.write_string( - _SCHEMA_API_INVOCATION_INPUT.members["actionInvocationType"], - self.action_invocation_type, - ) - - if self.agent_id is not None: - serializer.write_string( - _SCHEMA_API_INVOCATION_INPUT.members["agentId"], self.agent_id - ) - - if self.collaborator_name is not None: - serializer.write_string( - _SCHEMA_API_INVOCATION_INPUT.members["collaboratorName"], - self.collaborator_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["action_group"] = de.read_string( - _SCHEMA_API_INVOCATION_INPUT.members["actionGroup"] - ) - - case 1: - kwargs["http_method"] = de.read_string( - _SCHEMA_API_INVOCATION_INPUT.members["httpMethod"] - ) - - case 2: - kwargs["api_path"] = de.read_string( - _SCHEMA_API_INVOCATION_INPUT.members["apiPath"] - ) - - case 3: - kwargs["parameters"] = _deserialize_api_parameters( - de, _SCHEMA_API_INVOCATION_INPUT.members["parameters"] - ) - - case 4: - kwargs["request_body"] = ApiRequestBody.deserialize(de) - - case 5: - kwargs["action_invocation_type"] = ActionInvocationType( - de.read_string( - _SCHEMA_API_INVOCATION_INPUT.members["actionInvocationType"] - ) - ) - - case 6: - kwargs["agent_id"] = de.read_string( - _SCHEMA_API_INVOCATION_INPUT.members["agentId"] - ) - - case 7: - kwargs["collaborator_name"] = de.read_string( - _SCHEMA_API_INVOCATION_INPUT.members["collaboratorName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_API_INVOCATION_INPUT, consumer=_consumer) - if "action_group" not in kwargs: - kwargs["action_group"] = "" - return kwargs - - -@dataclass(kw_only=True) -class FunctionParameter: - """ - Contains information about a parameter of the function. - - This data type is used in the following API operations: - - - In the `returnControl` field of the [InvokeAgent - response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax) - """ - - name: str | None = None - """The name of the parameter.""" - - type: str | None = None - """The data type of the parameter.""" - - value: str | None = None - """The value of the parameter.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FUNCTION_PARAMETER, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_FUNCTION_PARAMETER.members["name"], self.name - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_FUNCTION_PARAMETER.members["type"], self.type - ) - - if self.value is not None: - serializer.write_string( - _SCHEMA_FUNCTION_PARAMETER.members["value"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_FUNCTION_PARAMETER.members["name"] - ) - - case 1: - kwargs["type"] = de.read_string( - _SCHEMA_FUNCTION_PARAMETER.members["type"] - ) - - case 2: - kwargs["value"] = de.read_string( - _SCHEMA_FUNCTION_PARAMETER.members["value"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FUNCTION_PARAMETER, consumer=_consumer) - return kwargs - - -def _serialize_function_parameters( - serializer: ShapeSerializer, schema: Schema, value: list[FunctionParameter] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_function_parameters( - deserializer: ShapeDeserializer, schema: Schema -) -> list[FunctionParameter]: - result: list[FunctionParameter] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(FunctionParameter.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class FunctionInvocationInput: - """ - Contains information about the function that the agent predicts should - be called. - - This data type is used in the following API operations: - - - In the `returnControl` field of the [InvokeAgent - response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax) - """ - - action_group: str - """The action group that the function belongs to.""" - - parameters: list[FunctionParameter] | None = None - """A list of parameters of the function.""" - - function: str | None = None - """The name of the function.""" - - action_invocation_type: str | None = None - """Contains information about the function to invoke,""" - - agent_id: str | None = None - """The agent's ID.""" - - collaborator_name: str | None = field(repr=False, default=None) - """The collaborator's name.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FUNCTION_INVOCATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_FUNCTION_INVOCATION_INPUT.members["actionGroup"], self.action_group - ) - if self.parameters is not None: - _serialize_function_parameters( - serializer, - _SCHEMA_FUNCTION_INVOCATION_INPUT.members["parameters"], - self.parameters, - ) - - if self.function is not None: - serializer.write_string( - _SCHEMA_FUNCTION_INVOCATION_INPUT.members["function"], self.function - ) - - if self.action_invocation_type is not None: - serializer.write_string( - _SCHEMA_FUNCTION_INVOCATION_INPUT.members["actionInvocationType"], - self.action_invocation_type, - ) - - if self.agent_id is not None: - serializer.write_string( - _SCHEMA_FUNCTION_INVOCATION_INPUT.members["agentId"], self.agent_id - ) - - if self.collaborator_name is not None: - serializer.write_string( - _SCHEMA_FUNCTION_INVOCATION_INPUT.members["collaboratorName"], - self.collaborator_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["action_group"] = de.read_string( - _SCHEMA_FUNCTION_INVOCATION_INPUT.members["actionGroup"] - ) - - case 1: - kwargs["parameters"] = _deserialize_function_parameters( - de, _SCHEMA_FUNCTION_INVOCATION_INPUT.members["parameters"] - ) - - case 2: - kwargs["function"] = de.read_string( - _SCHEMA_FUNCTION_INVOCATION_INPUT.members["function"] - ) - - case 3: - kwargs["action_invocation_type"] = ActionInvocationType( - de.read_string( - _SCHEMA_FUNCTION_INVOCATION_INPUT.members[ - "actionInvocationType" - ] - ) - ) - - case 4: - kwargs["agent_id"] = de.read_string( - _SCHEMA_FUNCTION_INVOCATION_INPUT.members["agentId"] - ) - - case 5: - kwargs["collaborator_name"] = de.read_string( - _SCHEMA_FUNCTION_INVOCATION_INPUT.members["collaboratorName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FUNCTION_INVOCATION_INPUT, consumer=_consumer) - if "action_group" not in kwargs: - kwargs["action_group"] = "" - return kwargs - - -@dataclass -class InvocationInputMemberApiInvocationInput: - """ - Contains information about the API operation that the agent predicts - should be called. - """ - - value: ApiInvocationInput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOCATION_INPUT_MEMBER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOCATION_INPUT_MEMBER.members["apiInvocationInput"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ApiInvocationInput.deserialize(deserializer)) - - -@dataclass -class InvocationInputMemberFunctionInvocationInput: - """ - Contains information about the function that the agent predicts should - be called. - """ - - value: FunctionInvocationInput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOCATION_INPUT_MEMBER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOCATION_INPUT_MEMBER.members["functionInvocationInput"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=FunctionInvocationInput.deserialize(deserializer)) - - -@dataclass -class InvocationInputMemberUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -InvocationInputMember = Union[ - InvocationInputMemberApiInvocationInput - | InvocationInputMemberFunctionInvocationInput - | InvocationInputMemberUnknown -] -""" -Contains details about the API operation or function that the agent -predicts should be called. - -This data type is used in the following API operations: - -- In the `returnControl` field of the [InvokeAgent - response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax) -""" - - -class _InvocationInputMemberDeserializer: - _result: InvocationInputMember | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> InvocationInputMember: - self._result = None - deserializer.read_struct(_SCHEMA_INVOCATION_INPUT_MEMBER, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - InvocationInputMemberApiInvocationInput.deserialize(de) - ) - - case 1: - self._set_result( - InvocationInputMemberFunctionInvocationInput.deserialize(de) - ) - - case _: - self._set_result( - InvocationInputMemberUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: InvocationInputMember) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_invocation_inputs( - serializer: ShapeSerializer, schema: Schema, value: list[InvocationInputMember] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_invocation_inputs( - deserializer: ShapeDeserializer, schema: Schema -) -> list[InvocationInputMember]: - result: list[InvocationInputMember] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_InvocationInputMemberDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ReturnControlPayload: - """ - Contains information to return from the action group that the agent has - predicted to invoke. - - This data type is used in the following API operations: - - - [InvokeAgent - response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax) - """ - - invocation_inputs: list[InvocationInputMember] | None = None - """ - A list of objects that contain information about the parameters and - inputs that need to be sent into the API operation or function, based on - what the agent determines from its session with the user. - """ - - invocation_id: str | None = None - """The identifier of the action group invocation.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETURN_CONTROL_PAYLOAD, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.invocation_inputs is not None: - _serialize_invocation_inputs( - serializer, - _SCHEMA_RETURN_CONTROL_PAYLOAD.members["invocationInputs"], - self.invocation_inputs, - ) - - if self.invocation_id is not None: - serializer.write_string( - _SCHEMA_RETURN_CONTROL_PAYLOAD.members["invocationId"], - self.invocation_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["invocation_inputs"] = _deserialize_invocation_inputs( - de, _SCHEMA_RETURN_CONTROL_PAYLOAD.members["invocationInputs"] - ) - - case 1: - kwargs["invocation_id"] = de.read_string( - _SCHEMA_RETURN_CONTROL_PAYLOAD.members["invocationId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RETURN_CONTROL_PAYLOAD, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class AgentCollaboratorOutputPayload: - """ - Output from an agent collaborator. The output can be text or an action - invocation result. - """ - - type: str | None = None - """The type of output.""" - - text: str | None = field(repr=False, default=None) - """Text output.""" - - return_control_payload: ReturnControlPayload | None = field( - repr=False, default=None - ) - """An action invocation result.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENT_COLLABORATOR_OUTPUT_PAYLOAD, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_AGENT_COLLABORATOR_OUTPUT_PAYLOAD.members["type"], self.type - ) - - if self.text is not None: - serializer.write_string( - _SCHEMA_AGENT_COLLABORATOR_OUTPUT_PAYLOAD.members["text"], self.text - ) - - if self.return_control_payload is not None: - serializer.write_struct( - _SCHEMA_AGENT_COLLABORATOR_OUTPUT_PAYLOAD.members[ - "returnControlPayload" - ], - self.return_control_payload, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = PayloadType( - de.read_string( - _SCHEMA_AGENT_COLLABORATOR_OUTPUT_PAYLOAD.members["type"] - ) - ) - - case 1: - kwargs["text"] = de.read_string( - _SCHEMA_AGENT_COLLABORATOR_OUTPUT_PAYLOAD.members["text"] - ) - - case 2: - kwargs["return_control_payload"] = ReturnControlPayload.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AGENT_COLLABORATOR_OUTPUT_PAYLOAD, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class AgentCollaboratorInvocationOutput: - """Output from an agent collaborator.""" - - agent_collaborator_name: str | None = None - """The output's agent collaborator name.""" - - agent_collaborator_alias_arn: str | None = None - """The output's agent collaborator alias ARN.""" - - output: AgentCollaboratorOutputPayload | None = None - """The output's output.""" - - metadata: Metadata | None = field(repr=False, default=None) - """Contains information about the output from the agent collaborator.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENT_COLLABORATOR_INVOCATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.agent_collaborator_name is not None: - serializer.write_string( - _SCHEMA_AGENT_COLLABORATOR_INVOCATION_OUTPUT.members[ - "agentCollaboratorName" - ], - self.agent_collaborator_name, - ) - - if self.agent_collaborator_alias_arn is not None: - serializer.write_string( - _SCHEMA_AGENT_COLLABORATOR_INVOCATION_OUTPUT.members[ - "agentCollaboratorAliasArn" - ], - self.agent_collaborator_alias_arn, - ) - - if self.output is not None: - serializer.write_struct( - _SCHEMA_AGENT_COLLABORATOR_INVOCATION_OUTPUT.members["output"], - self.output, - ) - - if self.metadata is not None: - serializer.write_struct( - _SCHEMA_AGENT_COLLABORATOR_INVOCATION_OUTPUT.members["metadata"], - self.metadata, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_collaborator_name"] = de.read_string( - _SCHEMA_AGENT_COLLABORATOR_INVOCATION_OUTPUT.members[ - "agentCollaboratorName" - ] - ) - - case 1: - kwargs["agent_collaborator_alias_arn"] = de.read_string( - _SCHEMA_AGENT_COLLABORATOR_INVOCATION_OUTPUT.members[ - "agentCollaboratorAliasArn" - ] - ) - - case 2: - kwargs["output"] = AgentCollaboratorOutputPayload.deserialize(de) - - case 3: - kwargs["metadata"] = Metadata.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AGENT_COLLABORATOR_INVOCATION_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class AgenticRetrieveSourceRetriever: - """A source retriever that produced retrieval results.""" - - identifier: str - """The unique identifier of the source retriever.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENTIC_RETRIEVE_SOURCE_RETRIEVER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AGENTIC_RETRIEVE_SOURCE_RETRIEVER.members["identifier"], - self.identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["identifier"] = de.read_string( - _SCHEMA_AGENTIC_RETRIEVE_SOURCE_RETRIEVER.members["identifier"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AGENTIC_RETRIEVE_SOURCE_RETRIEVER, consumer=_consumer - ) - if "identifier" not in kwargs: - kwargs["identifier"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(identifier="") - - -@dataclass(kw_only=True) -class AgenticRetrieveFullDocExpansionDetails: - """Details of a full document expansion action.""" - - document_id: str | None = None - """The identifier of the document to expand.""" - - source_retriever: AgenticRetrieveSourceRetriever | None = None - """The source retriever associated with the document.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AGENTIC_RETRIEVE_FULL_DOC_EXPANSION_DETAILS, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.document_id is not None: - serializer.write_string( - _SCHEMA_AGENTIC_RETRIEVE_FULL_DOC_EXPANSION_DETAILS.members[ - "documentId" - ], - self.document_id, - ) - - if self.source_retriever is not None: - serializer.write_struct( - _SCHEMA_AGENTIC_RETRIEVE_FULL_DOC_EXPANSION_DETAILS.members[ - "sourceRetriever" - ], - self.source_retriever, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["document_id"] = de.read_string( - _SCHEMA_AGENTIC_RETRIEVE_FULL_DOC_EXPANSION_DETAILS.members[ - "documentId" - ] - ) - - case 1: - kwargs["source_retriever"] = ( - AgenticRetrieveSourceRetriever.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AGENTIC_RETRIEVE_FULL_DOC_EXPANSION_DETAILS, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class AgenticRetrieveMessageContent: - """The content of an agentic retrieval message.""" - - text: str | None = None - """The text content of the message.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENTIC_RETRIEVE_MESSAGE_CONTENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.text is not None: - serializer.write_string( - _SCHEMA_AGENTIC_RETRIEVE_MESSAGE_CONTENT.members["text"], self.text - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["text"] = de.read_string( - _SCHEMA_AGENTIC_RETRIEVE_MESSAGE_CONTENT.members["text"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AGENTIC_RETRIEVE_MESSAGE_CONTENT, consumer=_consumer - ) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls() - - -@dataclass(kw_only=True) -class AgenticRetrieveMemoryRetrieveDetails: - """ - A long-term memory retrieval that the agent chose to perform. The record - reports the query and the namespace. The corresponding Retrieval step - reports the results. - """ - - input_query: AgenticRetrieveMessageContent = field(repr=False) - """The query that the agent composed.""" - - memory_id: str - """The identifier of the AgentCore Memory resource retrieved from.""" - - namespace: str | None = None - """ - The namespace prefix retrieved from, as supplied in the request. This - field is present when the request specified namespace. - """ - - namespace_path: str | None = None - """ - The parent namespace retrieved from hierarchically, as supplied in the - request. This field is present when the request specified namespacePath. - """ - - strategy_id: str | None = None - """ - The extraction strategy that restricted retrieval, if the request - specified one. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENTIC_RETRIEVE_MEMORY_RETRIEVE_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_RETRIEVE_DETAILS.members["inputQuery"], - self.input_query, - ) - serializer.write_string( - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_RETRIEVE_DETAILS.members["memoryId"], - self.memory_id, - ) - if self.namespace is not None: - serializer.write_string( - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_RETRIEVE_DETAILS.members["namespace"], - self.namespace, - ) - - if self.namespace_path is not None: - serializer.write_string( - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_RETRIEVE_DETAILS.members[ - "namespacePath" - ], - self.namespace_path, - ) - - if self.strategy_id is not None: - serializer.write_string( - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_RETRIEVE_DETAILS.members["strategyId"], - self.strategy_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["input_query"] = AgenticRetrieveMessageContent.deserialize( - de - ) - - case 1: - kwargs["memory_id"] = de.read_string( - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_RETRIEVE_DETAILS.members[ - "memoryId" - ] - ) - - case 2: - kwargs["namespace"] = de.read_string( - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_RETRIEVE_DETAILS.members[ - "namespace" - ] - ) - - case 3: - kwargs["namespace_path"] = de.read_string( - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_RETRIEVE_DETAILS.members[ - "namespacePath" - ] - ) - - case 4: - kwargs["strategy_id"] = de.read_string( - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_RETRIEVE_DETAILS.members[ - "strategyId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_RETRIEVE_DETAILS, consumer=_consumer - ) - if "input_query" not in kwargs: - kwargs["input_query"] = AgenticRetrieveMessageContent._smithy_default() - if "memory_id" not in kwargs: - kwargs["memory_id"] = "" - return kwargs - - -def _serialize_agentic_retrieve_source_retriever_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[AgenticRetrieveSourceRetriever], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_agentic_retrieve_source_retriever_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AgenticRetrieveSourceRetriever]: - result: list[AgenticRetrieveSourceRetriever] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AgenticRetrieveSourceRetriever.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AgenticRetrieveActionDetails: - """Details of a retrieve action including the query and target retrievers.""" - - input_query: AgenticRetrieveMessageContent = field(repr=False) - """The input query used for retrieval.""" - - source_retrievers: list[AgenticRetrieveSourceRetriever] - """The list of source retrievers targeted by this action.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENTIC_RETRIEVE_ACTION_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AGENTIC_RETRIEVE_ACTION_DETAILS.members["inputQuery"], - self.input_query, - ) - _serialize_agentic_retrieve_source_retriever_list( - serializer, - _SCHEMA_AGENTIC_RETRIEVE_ACTION_DETAILS.members["sourceRetrievers"], - self.source_retrievers, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["input_query"] = AgenticRetrieveMessageContent.deserialize( - de - ) - - case 1: - kwargs["source_retrievers"] = ( - _deserialize_agentic_retrieve_source_retriever_list( - de, - _SCHEMA_AGENTIC_RETRIEVE_ACTION_DETAILS.members[ - "sourceRetrievers" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AGENTIC_RETRIEVE_ACTION_DETAILS, consumer=_consumer - ) - if "input_query" not in kwargs: - kwargs["input_query"] = AgenticRetrieveMessageContent._smithy_default() - if "source_retrievers" not in kwargs: - kwargs["source_retrievers"] = [] - return kwargs - - -@dataclass(kw_only=True) -class AgenticRetrieveAction: - """An action taken during agentic retrieval.""" - - retrieve: AgenticRetrieveActionDetails | None = None - """Details of the retrieve action.""" - - full_document_expansion: AgenticRetrieveFullDocExpansionDetails | None = None - """Details of a full document expansion action.""" - - memory_retrieve: AgenticRetrieveMemoryRetrieveDetails | None = None - """ - The details of a long-term memory retrieval that the agent chose to - perform. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENTIC_RETRIEVE_ACTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.retrieve is not None: - serializer.write_struct( - _SCHEMA_AGENTIC_RETRIEVE_ACTION.members["retrieve"], self.retrieve - ) - - if self.full_document_expansion is not None: - serializer.write_struct( - _SCHEMA_AGENTIC_RETRIEVE_ACTION.members["fullDocumentExpansion"], - self.full_document_expansion, - ) - - if self.memory_retrieve is not None: - serializer.write_struct( - _SCHEMA_AGENTIC_RETRIEVE_ACTION.members["memoryRetrieve"], - self.memory_retrieve, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["retrieve"] = AgenticRetrieveActionDetails.deserialize(de) - - case 1: - kwargs["full_document_expansion"] = ( - AgenticRetrieveFullDocExpansionDetails.deserialize(de) - ) - - case 2: - kwargs["memory_retrieve"] = ( - AgenticRetrieveMemoryRetrieveDetails.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AGENTIC_RETRIEVE_ACTION, consumer=_consumer) - return kwargs - - -def _serialize_agentic_retrieve_actions( - serializer: ShapeSerializer, schema: Schema, value: list[AgenticRetrieveAction] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_agentic_retrieve_actions( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AgenticRetrieveAction]: - result: list[AgenticRetrieveAction] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AgenticRetrieveAction.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AgenticRetrieveBedrockGuardrailConfiguration: - """Configuration for a Bedrock guardrail applied during agentic retrieval.""" - - guardrail_id: str - """The unique identifier of the guardrail.""" - - guardrail_version: str - """The version of the guardrail to use.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AGENTIC_RETRIEVE_BEDROCK_GUARDRAIL_CONFIGURATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AGENTIC_RETRIEVE_BEDROCK_GUARDRAIL_CONFIGURATION.members[ - "guardrailId" - ], - self.guardrail_id, - ) - serializer.write_string( - _SCHEMA_AGENTIC_RETRIEVE_BEDROCK_GUARDRAIL_CONFIGURATION.members[ - "guardrailVersion" - ], - self.guardrail_version, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["guardrail_id"] = de.read_string( - _SCHEMA_AGENTIC_RETRIEVE_BEDROCK_GUARDRAIL_CONFIGURATION.members[ - "guardrailId" - ] - ) - - case 1: - kwargs["guardrail_version"] = de.read_string( - _SCHEMA_AGENTIC_RETRIEVE_BEDROCK_GUARDRAIL_CONFIGURATION.members[ - "guardrailVersion" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AGENTIC_RETRIEVE_BEDROCK_GUARDRAIL_CONFIGURATION, consumer=_consumer - ) - if "guardrail_id" not in kwargs: - kwargs["guardrail_id"] = "" - if "guardrail_version" not in kwargs: - kwargs["guardrail_version"] = "" - return kwargs - - -@dataclass(kw_only=True) -class AgenticRetrieveBedrockRerankingModelConfiguration: - """Model configuration for a Bedrock reranking model.""" - - model_arn: str - """The ARN of the Bedrock reranking model.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AGENTIC_RETRIEVE_BEDROCK_RERANKING_MODEL_CONFIGURATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AGENTIC_RETRIEVE_BEDROCK_RERANKING_MODEL_CONFIGURATION.members[ - "modelArn" - ], - self.model_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_arn"] = de.read_string( - _SCHEMA_AGENTIC_RETRIEVE_BEDROCK_RERANKING_MODEL_CONFIGURATION.members[ - "modelArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AGENTIC_RETRIEVE_BEDROCK_RERANKING_MODEL_CONFIGURATION, - consumer=_consumer, - ) - if "model_arn" not in kwargs: - kwargs["model_arn"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(model_arn="") - - -@dataclass(kw_only=True) -class AgenticRetrieveBedrockRerankingConfiguration: - """Configuration for a Bedrock reranking model.""" - - model_configuration: AgenticRetrieveBedrockRerankingModelConfiguration - """The model configuration containing the model ARN.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AGENTIC_RETRIEVE_BEDROCK_RERANKING_CONFIGURATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AGENTIC_RETRIEVE_BEDROCK_RERANKING_CONFIGURATION.members[ - "modelConfiguration" - ], - self.model_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_configuration"] = ( - AgenticRetrieveBedrockRerankingModelConfiguration.deserialize( - de - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AGENTIC_RETRIEVE_BEDROCK_RERANKING_CONFIGURATION, consumer=_consumer - ) - if "model_configuration" not in kwargs: - kwargs["model_configuration"] = ( - AgenticRetrieveBedrockRerankingModelConfiguration._smithy_default() - ) - return kwargs - - -@dataclass(kw_only=True) -class AgenticRetrieveCitationReference: - """A reference to a specific result item.""" - - result_index: int - """Index into the results array on the same event.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENTIC_RETRIEVE_CITATION_REFERENCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer( - _SCHEMA_AGENTIC_RETRIEVE_CITATION_REFERENCE.members["resultIndex"], - self.result_index, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["result_index"] = de.read_integer( - _SCHEMA_AGENTIC_RETRIEVE_CITATION_REFERENCE.members[ - "resultIndex" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AGENTIC_RETRIEVE_CITATION_REFERENCE, consumer=_consumer - ) - if "result_index" not in kwargs: - kwargs["result_index"] = 0 - return kwargs - - -def _serialize_agentic_retrieve_citation_reference_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[AgenticRetrieveCitationReference], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_agentic_retrieve_citation_reference_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AgenticRetrieveCitationReference]: - result: list[AgenticRetrieveCitationReference] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AgenticRetrieveCitationReference.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AgenticRetrieveCitation: - """A citation mapping a span of the generated answer to supporting results.""" - - start_index: int - """Character offset start in the answer text.""" - - end_index: int - """Character offset end (exclusive) in the answer text.""" - - references: list[AgenticRetrieveCitationReference] - """References to results that support this span.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENTIC_RETRIEVE_CITATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer( - _SCHEMA_AGENTIC_RETRIEVE_CITATION.members["startIndex"], self.start_index - ) - serializer.write_integer( - _SCHEMA_AGENTIC_RETRIEVE_CITATION.members["endIndex"], self.end_index - ) - _serialize_agentic_retrieve_citation_reference_list( - serializer, - _SCHEMA_AGENTIC_RETRIEVE_CITATION.members["references"], - self.references, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["start_index"] = de.read_integer( - _SCHEMA_AGENTIC_RETRIEVE_CITATION.members["startIndex"] - ) - - case 1: - kwargs["end_index"] = de.read_integer( - _SCHEMA_AGENTIC_RETRIEVE_CITATION.members["endIndex"] - ) - - case 2: - kwargs["references"] = ( - _deserialize_agentic_retrieve_citation_reference_list( - de, _SCHEMA_AGENTIC_RETRIEVE_CITATION.members["references"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AGENTIC_RETRIEVE_CITATION, consumer=_consumer) - if "start_index" not in kwargs: - kwargs["start_index"] = 0 - if "end_index" not in kwargs: - kwargs["end_index"] = 0 - if "references" not in kwargs: - kwargs["references"] = [] - return kwargs - - -def _serialize_agentic_retrieve_citation_list( - serializer: ShapeSerializer, schema: Schema, value: list[AgenticRetrieveCitation] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_agentic_retrieve_citation_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AgenticRetrieveCitation]: - result: list[AgenticRetrieveCitation] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AgenticRetrieveCitation.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class BedrockFoundationModelModelConfiguration: - """Model configuration for a Bedrock foundation model.""" - - model_arn: str - """The ARN of the Bedrock foundation model.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_BEDROCK_FOUNDATION_MODEL_MODEL_CONFIGURATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_BEDROCK_FOUNDATION_MODEL_MODEL_CONFIGURATION.members["modelArn"], - self.model_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_arn"] = de.read_string( - _SCHEMA_BEDROCK_FOUNDATION_MODEL_MODEL_CONFIGURATION.members[ - "modelArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_BEDROCK_FOUNDATION_MODEL_MODEL_CONFIGURATION, consumer=_consumer - ) - if "model_arn" not in kwargs: - kwargs["model_arn"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(model_arn="") - - -@dataclass(kw_only=True) -class BedrockFoundationModelConfiguration: - """Configuration for a Bedrock foundation model.""" - - model_configuration: BedrockFoundationModelModelConfiguration - """The model configuration containing the model ARN.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BEDROCK_FOUNDATION_MODEL_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_BEDROCK_FOUNDATION_MODEL_CONFIGURATION.members[ - "modelConfiguration" - ], - self.model_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_configuration"] = ( - BedrockFoundationModelModelConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_BEDROCK_FOUNDATION_MODEL_CONFIGURATION, consumer=_consumer - ) - if "model_configuration" not in kwargs: - kwargs["model_configuration"] = ( - BedrockFoundationModelModelConfiguration._smithy_default() - ) - return kwargs - - -@dataclass(kw_only=True) -class MantleFoundationModelModelConfiguration: - """Model configuration for a Mantle foundation model.""" - - model_arn: str - """The ARN of the Mantle foundation model.""" - - project_id: str | None = None - """ - The Amazon Bedrock project ID used for billing and usage attribution. If - you don't specify a value, the service uses the default project. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MANTLE_FOUNDATION_MODEL_MODEL_CONFIGURATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MANTLE_FOUNDATION_MODEL_MODEL_CONFIGURATION.members["modelArn"], - self.model_arn, - ) - if self.project_id is not None: - serializer.write_string( - _SCHEMA_MANTLE_FOUNDATION_MODEL_MODEL_CONFIGURATION.members[ - "projectId" - ], - self.project_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_arn"] = de.read_string( - _SCHEMA_MANTLE_FOUNDATION_MODEL_MODEL_CONFIGURATION.members[ - "modelArn" - ] - ) - - case 1: - kwargs["project_id"] = de.read_string( - _SCHEMA_MANTLE_FOUNDATION_MODEL_MODEL_CONFIGURATION.members[ - "projectId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MANTLE_FOUNDATION_MODEL_MODEL_CONFIGURATION, consumer=_consumer - ) - if "model_arn" not in kwargs: - kwargs["model_arn"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(model_arn="") - - -@dataclass(kw_only=True) -class MantleFoundationModelConfiguration: - """Configuration for a Mantle foundation model.""" - - model_configuration: MantleFoundationModelModelConfiguration - """The model configuration containing the model ARN and project ID.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MANTLE_FOUNDATION_MODEL_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MANTLE_FOUNDATION_MODEL_CONFIGURATION.members["modelConfiguration"], - self.model_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_configuration"] = ( - MantleFoundationModelModelConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MANTLE_FOUNDATION_MODEL_CONFIGURATION, consumer=_consumer - ) - if "model_configuration" not in kwargs: - kwargs["model_configuration"] = ( - MantleFoundationModelModelConfiguration._smithy_default() - ) - return kwargs - - -class FoundationModelConfigurationType(UnknownEnumMixin, StrEnum): - """The type of foundation model configuration.""" - - BEDROCK_FOUNDATION_MODEL = "BEDROCK_FOUNDATION_MODEL" - MANTLE_FOUNDATION_MODEL = "MANTLE_FOUNDATION_MODEL" - - -@dataclass(kw_only=True) -class FoundationModelConfiguration: - """Configuration for the foundation model.""" - - type: str - """The type of foundation model configuration.""" - - bedrock_foundation_model_configuration: ( - BedrockFoundationModelConfiguration | None - ) = None - """The Bedrock foundation model configuration.""" - - mantle_foundation_model_configuration: MantleFoundationModelConfiguration | None = ( - None - ) - """The Mantle foundation model configuration.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FOUNDATION_MODEL_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_FOUNDATION_MODEL_CONFIGURATION.members["type"], self.type - ) - if self.bedrock_foundation_model_configuration is not None: - serializer.write_struct( - _SCHEMA_FOUNDATION_MODEL_CONFIGURATION.members[ - "bedrockFoundationModelConfiguration" - ], - self.bedrock_foundation_model_configuration, - ) - - if self.mantle_foundation_model_configuration is not None: - serializer.write_struct( - _SCHEMA_FOUNDATION_MODEL_CONFIGURATION.members[ - "mantleFoundationModelConfiguration" - ], - self.mantle_foundation_model_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = FoundationModelConfigurationType( - de.read_string( - _SCHEMA_FOUNDATION_MODEL_CONFIGURATION.members["type"] - ) - ) - - case 1: - kwargs["bedrock_foundation_model_configuration"] = ( - BedrockFoundationModelConfiguration.deserialize(de) - ) - - case 2: - kwargs["mantle_foundation_model_configuration"] = ( - MantleFoundationModelConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_FOUNDATION_MODEL_CONFIGURATION, consumer=_consumer - ) - if "type" not in kwargs: - kwargs["type"] = FoundationModelConfigurationType._corrected("") - return kwargs - - -class FoundationModelType(UnknownEnumMixin, StrEnum): - """The type of foundation model.""" - - CUSTOM = "CUSTOM" - MANAGED = "MANAGED" - - -class AgenticRetrieveRerankingConfigurationType(UnknownEnumMixin, StrEnum): - """The type of reranking configuration.""" - - BEDROCK_RERANKING_MODEL = "BEDROCK_RERANKING_MODEL" - - -@dataclass(kw_only=True) -class AgenticRetrieveRerankingConfiguration: - """Configuration for the reranking model.""" - - type: str - """The type of reranking configuration.""" - - bedrock_reranking_configuration: ( - AgenticRetrieveBedrockRerankingConfiguration | None - ) = None - """The Bedrock reranking model configuration.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENTIC_RETRIEVE_RERANKING_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AGENTIC_RETRIEVE_RERANKING_CONFIGURATION.members["type"], self.type - ) - if self.bedrock_reranking_configuration is not None: - serializer.write_struct( - _SCHEMA_AGENTIC_RETRIEVE_RERANKING_CONFIGURATION.members[ - "bedrockRerankingConfiguration" - ], - self.bedrock_reranking_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = AgenticRetrieveRerankingConfigurationType( - de.read_string( - _SCHEMA_AGENTIC_RETRIEVE_RERANKING_CONFIGURATION.members[ - "type" - ] - ) - ) - - case 1: - kwargs["bedrock_reranking_configuration"] = ( - AgenticRetrieveBedrockRerankingConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AGENTIC_RETRIEVE_RERANKING_CONFIGURATION, consumer=_consumer - ) - if "type" not in kwargs: - kwargs["type"] = AgenticRetrieveRerankingConfigurationType._corrected("") - return kwargs - - -class AgenticRetrieveRerankingModelType(UnknownEnumMixin, StrEnum): - """The type of reranking model.""" - - CUSTOM = "CUSTOM" - MANAGED = "MANAGED" - NONE = "NONE" - - -@dataclass(kw_only=True) -class AgenticRetrieveConfiguration: - """Configuration settings for the agentic retrieval operation.""" - - foundation_model_type: str = FoundationModelType("MANAGED") - """ - The type of foundation model to use. CUSTOM uses a specified model, - MANAGED uses the service default. - """ - - foundation_model_configuration: FoundationModelConfiguration | None = None - """ - The foundation model configuration. Required when foundationModelType is - CUSTOM. - """ - - reranking_model_type: str | None = None - """ - The type of reranking model to use. CUSTOM uses a specified model, - MANAGED uses the service default. If not specified, defaults to MANAGED - for managed embedding knowledge bases and NONE for custom embedding - knowledge bases. - """ - - reranking_configuration: AgenticRetrieveRerankingConfiguration | None = None - """ - The reranking model configuration. Required when rerankingModelType is - CUSTOM. - """ - - max_agent_iteration: int = 5 - """The maximum number of agent iterations for retrieval.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENTIC_RETRIEVE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AGENTIC_RETRIEVE_CONFIGURATION.members["foundationModelType"], - self.foundation_model_type, - ) - if self.foundation_model_configuration is not None: - serializer.write_struct( - _SCHEMA_AGENTIC_RETRIEVE_CONFIGURATION.members[ - "foundationModelConfiguration" - ], - self.foundation_model_configuration, - ) - - if self.reranking_model_type is not None: - serializer.write_string( - _SCHEMA_AGENTIC_RETRIEVE_CONFIGURATION.members["rerankingModelType"], - self.reranking_model_type, - ) - - if self.reranking_configuration is not None: - serializer.write_struct( - _SCHEMA_AGENTIC_RETRIEVE_CONFIGURATION.members[ - "rerankingConfiguration" - ], - self.reranking_configuration, - ) - - serializer.write_integer( - _SCHEMA_AGENTIC_RETRIEVE_CONFIGURATION.members["maxAgentIteration"], - self.max_agent_iteration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["foundation_model_type"] = FoundationModelType( - de.read_string( - _SCHEMA_AGENTIC_RETRIEVE_CONFIGURATION.members[ - "foundationModelType" - ] - ) - ) - - case 1: - kwargs["foundation_model_configuration"] = ( - FoundationModelConfiguration.deserialize(de) - ) - - case 2: - kwargs["reranking_model_type"] = AgenticRetrieveRerankingModelType( - de.read_string( - _SCHEMA_AGENTIC_RETRIEVE_CONFIGURATION.members[ - "rerankingModelType" - ] - ) - ) - - case 3: - kwargs["reranking_configuration"] = ( - AgenticRetrieveRerankingConfiguration.deserialize(de) - ) - - case 4: - kwargs["max_agent_iteration"] = de.read_integer( - _SCHEMA_AGENTIC_RETRIEVE_CONFIGURATION.members[ - "maxAgentIteration" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AGENTIC_RETRIEVE_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class AgenticRetrieveFailure: - """A failure that occurred during agentic retrieval.""" - - message: str - """A message describing the failure.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENTIC_RETRIEVE_FAILURE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AGENTIC_RETRIEVE_FAILURE.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_AGENTIC_RETRIEVE_FAILURE.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AGENTIC_RETRIEVE_FAILURE, consumer=_consumer) - if "message" not in kwargs: - kwargs["message"] = "" - return kwargs - - -def _serialize_agentic_retrieve_failures( - serializer: ShapeSerializer, schema: Schema, value: list[AgenticRetrieveFailure] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_agentic_retrieve_failures( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AgenticRetrieveFailure]: - result: list[AgenticRetrieveFailure] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AgenticRetrieveFailure.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AgenticRetrieveGeneratedResponse: - """The generated response synthesized from retrieved results.""" - - answer: str - """The generated answer text.""" - - citations: list[AgenticRetrieveCitation] | None = None - """Citations mapping spans of the answer to supporting results.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENTIC_RETRIEVE_GENERATED_RESPONSE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AGENTIC_RETRIEVE_GENERATED_RESPONSE.members["answer"], self.answer - ) - if self.citations is not None: - _serialize_agentic_retrieve_citation_list( - serializer, - _SCHEMA_AGENTIC_RETRIEVE_GENERATED_RESPONSE.members["citations"], - self.citations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["answer"] = de.read_string( - _SCHEMA_AGENTIC_RETRIEVE_GENERATED_RESPONSE.members["answer"] - ) - - case 1: - kwargs["citations"] = _deserialize_agentic_retrieve_citation_list( - de, - _SCHEMA_AGENTIC_RETRIEVE_GENERATED_RESPONSE.members[ - "citations" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AGENTIC_RETRIEVE_GENERATED_RESPONSE, consumer=_consumer - ) - if "answer" not in kwargs: - kwargs["answer"] = "" - return kwargs - - -class GuardrailAction(UnknownEnumMixin, StrEnum): - INTERVENED = "INTERVENED" - NONE = "NONE" - - -@dataclass(kw_only=True) -class AgenticRetrieveGuardrailWarning: - """A warning generated by a guardrail during agentic retrieval.""" - - id: str - """The unique identifier of the guardrail.""" - - version: str - """The version of the guardrail.""" - - action: str - """The action taken by the guardrail.""" - - message: str | None = None - """A message describing the guardrail evaluation result.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENTIC_RETRIEVE_GUARDRAIL_WARNING, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AGENTIC_RETRIEVE_GUARDRAIL_WARNING.members["id"], self.id - ) - serializer.write_string( - _SCHEMA_AGENTIC_RETRIEVE_GUARDRAIL_WARNING.members["version"], self.version - ) - serializer.write_string( - _SCHEMA_AGENTIC_RETRIEVE_GUARDRAIL_WARNING.members["action"], self.action - ) - if self.message is not None: - serializer.write_string( - _SCHEMA_AGENTIC_RETRIEVE_GUARDRAIL_WARNING.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_AGENTIC_RETRIEVE_GUARDRAIL_WARNING.members["id"] - ) - - case 1: - kwargs["version"] = de.read_string( - _SCHEMA_AGENTIC_RETRIEVE_GUARDRAIL_WARNING.members["version"] - ) - - case 2: - kwargs["action"] = GuardrailAction( - de.read_string( - _SCHEMA_AGENTIC_RETRIEVE_GUARDRAIL_WARNING.members["action"] - ) - ) - - case 3: - kwargs["message"] = de.read_string( - _SCHEMA_AGENTIC_RETRIEVE_GUARDRAIL_WARNING.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AGENTIC_RETRIEVE_GUARDRAIL_WARNING, consumer=_consumer - ) - if "id" not in kwargs: - kwargs["id"] = "" - if "version" not in kwargs: - kwargs["version"] = "" - if "action" not in kwargs: - kwargs["action"] = GuardrailAction._corrected("") - return kwargs - - -class AgenticRetrieveMemoryPersistenceMode(UnknownEnumMixin, StrEnum): - """ - Specifies whether the agent-generated answer is written back to a - short-term memory session. - """ - - DEFAULT = "DEFAULT" - """ - Specifies that the question and the agent-generated answer are persisted - to the session. This is the default when persistenceMode is omitted. - """ - NONE = "NONE" - """Specifies that the session is left unchanged.""" - - -@dataclass -class AgenticRetrieveMemoryMetadataFilterLeftMetadataKey: - """The metadata key to filter on.""" - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_METADATA_FILTER_LEFT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_METADATA_FILTER_LEFT.members["metadataKey"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string( - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_METADATA_FILTER_LEFT.members[ - "metadataKey" - ] - ) - ) - - -@dataclass -class AgenticRetrieveMemoryMetadataFilterLeftUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -AgenticRetrieveMemoryMetadataFilterLeft = Union[ - AgenticRetrieveMemoryMetadataFilterLeftMetadataKey - | AgenticRetrieveMemoryMetadataFilterLeftUnknown -] -""" -The left operand of a metadata filter expression. Set exactly one -member. -""" - - -class _AgenticRetrieveMemoryMetadataFilterLeftDeserializer: - _result: AgenticRetrieveMemoryMetadataFilterLeft | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> AgenticRetrieveMemoryMetadataFilterLeft: - self._result = None - deserializer.read_struct( - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_METADATA_FILTER_LEFT, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - AgenticRetrieveMemoryMetadataFilterLeftMetadataKey.deserialize(de) - ) - - case _: - self._set_result( - AgenticRetrieveMemoryMetadataFilterLeftUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: AgenticRetrieveMemoryMetadataFilterLeft) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class AgenticRetrieveMemoryMetadataFilterOperator(UnknownEnumMixin, StrEnum): - """ - Specifies the relationship that a metadata key and value must have for a - memory record to match a filter expression. - """ - - EQUALS_TO = "EQUALS_TO" - """ - The EQUALS_TO operator matches memory records whose metadata value - equals the supplied value. - """ - EXISTS = "EXISTS" - """ - The EXISTS operator matches memory records that carry the metadata key, - whatever its value. This operator takes no right operand. - """ - NOT_EXISTS = "NOT_EXISTS" - """ - The NOT_EXISTS operator matches memory records that do not carry the - metadata key. This operator takes no right operand. - """ - BEFORE = "BEFORE" - """ - The BEFORE operator matches memory records whose timestamp metadata - value falls before the supplied value. - """ - AFTER = "AFTER" - """ - The AFTER operator matches memory records whose timestamp metadata value - falls after the supplied value. - """ - CONTAINS = "CONTAINS" - """ - The CONTAINS operator matches memory records whose metadata value - contains the supplied value. - """ - GREATER_THAN = "GREATER_THAN" - """ - The GREATER_THAN operator matches memory records whose numeric metadata - value is greater than the supplied value. - """ - GREATER_THAN_OR_EQUALS = "GREATER_THAN_OR_EQUALS" - """ - The GREATER_THAN_OR_EQUALS operator matches memory records whose numeric - metadata value is greater than or equal to the supplied value. - """ - LESS_THAN = "LESS_THAN" - """ - The LESS_THAN operator matches memory records whose numeric metadata - value is less than the supplied value. - """ - LESS_THAN_OR_EQUALS = "LESS_THAN_OR_EQUALS" - """ - The LESS_THAN_OR_EQUALS operator matches memory records whose numeric - metadata value is less than or equal to the supplied value. - """ - - -def _serialize_agentic_retrieve_memory_metadata_string_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_agentic_retrieve_memory_metadata_string_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass -class AgenticRetrieveMemoryMetadataValueStringValue: - """A string value.""" - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENTIC_RETRIEVE_MEMORY_METADATA_VALUE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_METADATA_VALUE.members["stringValue"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string( - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_METADATA_VALUE.members["stringValue"] - ) - ) - - -@dataclass -class AgenticRetrieveMemoryMetadataValueNumberValue: - """A numeric value.""" - - value: float - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENTIC_RETRIEVE_MEMORY_METADATA_VALUE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_double( - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_METADATA_VALUE.members["numberValue"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_double( - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_METADATA_VALUE.members["numberValue"] - ) - ) - - -@dataclass -class AgenticRetrieveMemoryMetadataValueStringListValue: - """A list of string values.""" - - value: list[str] - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENTIC_RETRIEVE_MEMORY_METADATA_VALUE, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_agentic_retrieve_memory_metadata_string_list( - serializer, - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_METADATA_VALUE.members["stringListValue"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_deserialize_agentic_retrieve_memory_metadata_string_list( - deserializer, - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_METADATA_VALUE.members[ - "stringListValue" - ], - ) - ) - - -@dataclass -class AgenticRetrieveMemoryMetadataValueDateTimeValue: - """A timestamp value in ISO 8601 UTC format.""" - - value: datetime - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENTIC_RETRIEVE_MEMORY_METADATA_VALUE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_timestamp( - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_METADATA_VALUE.members["dateTimeValue"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_timestamp( - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_METADATA_VALUE.members["dateTimeValue"] - ) - ) - - -@dataclass -class AgenticRetrieveMemoryMetadataValueUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -AgenticRetrieveMemoryMetadataValue = Union[ - AgenticRetrieveMemoryMetadataValueStringValue - | AgenticRetrieveMemoryMetadataValueNumberValue - | AgenticRetrieveMemoryMetadataValueStringListValue - | AgenticRetrieveMemoryMetadataValueDateTimeValue - | AgenticRetrieveMemoryMetadataValueUnknown -] -""" -A metadata value that a filter expression compares against. Set exactly -one member. -""" - - -class _AgenticRetrieveMemoryMetadataValueDeserializer: - _result: AgenticRetrieveMemoryMetadataValue | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> AgenticRetrieveMemoryMetadataValue: - self._result = None - deserializer.read_struct( - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_METADATA_VALUE, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - AgenticRetrieveMemoryMetadataValueStringValue.deserialize(de) - ) - - case 1: - self._set_result( - AgenticRetrieveMemoryMetadataValueNumberValue.deserialize(de) - ) - - case 2: - self._set_result( - AgenticRetrieveMemoryMetadataValueStringListValue.deserialize(de) - ) - - case 3: - self._set_result( - AgenticRetrieveMemoryMetadataValueDateTimeValue.deserialize(de) - ) - - case _: - self._set_result( - AgenticRetrieveMemoryMetadataValueUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: AgenticRetrieveMemoryMetadataValue) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass -class AgenticRetrieveMemoryMetadataFilterRightMetadataValue: - """The value to compare the metadata key against.""" - - value: AgenticRetrieveMemoryMetadataValue - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_METADATA_FILTER_RIGHT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_METADATA_FILTER_RIGHT.members[ - "metadataValue" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_AgenticRetrieveMemoryMetadataValueDeserializer().deserialize( - deserializer - ) - ) - - -@dataclass -class AgenticRetrieveMemoryMetadataFilterRightUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -AgenticRetrieveMemoryMetadataFilterRight = Union[ - AgenticRetrieveMemoryMetadataFilterRightMetadataValue - | AgenticRetrieveMemoryMetadataFilterRightUnknown -] -""" -The right operand of a metadata filter expression. Set exactly one -member. -""" - - -class _AgenticRetrieveMemoryMetadataFilterRightDeserializer: - _result: AgenticRetrieveMemoryMetadataFilterRight | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> AgenticRetrieveMemoryMetadataFilterRight: - self._result = None - deserializer.read_struct( - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_METADATA_FILTER_RIGHT, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - AgenticRetrieveMemoryMetadataFilterRightMetadataValue.deserialize( - de - ) - ) - - case _: - self._set_result( - AgenticRetrieveMemoryMetadataFilterRightUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: AgenticRetrieveMemoryMetadataFilterRight) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class AgenticRetrieveMemoryMetadataFilter: - """ - A metadata filter expression, in the form accepted by the AgentCore - Memory RetrieveMemoryRecords operation. The expression has a left - operand that names the metadata key, an operator, and a right operand. - For the EXISTS and NOT_EXISTS operators, omit the right operand. - """ - - left: AgenticRetrieveMemoryMetadataFilterLeft - """The metadata key that the expression evaluates.""" - - operator: str - """ - The relationship that the metadata key and value must have for a memory - record to match. - """ - - right: AgenticRetrieveMemoryMetadataFilterRight | None = None - """ - The value that the expression compares the metadata key against. Supply - this value for every operator except EXISTS and NOT_EXISTS. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENTIC_RETRIEVE_MEMORY_METADATA_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_METADATA_FILTER.members["left"], self.left - ) - serializer.write_string( - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_METADATA_FILTER.members["operator"], - self.operator, - ) - if self.right is not None: - serializer.write_struct( - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_METADATA_FILTER.members["right"], - self.right, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["left"] = ( - _AgenticRetrieveMemoryMetadataFilterLeftDeserializer().deserialize( - de - ) - ) - - case 1: - kwargs["operator"] = AgenticRetrieveMemoryMetadataFilterOperator( - de.read_string( - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_METADATA_FILTER.members[ - "operator" - ] - ) - ) - - case 2: - kwargs["right"] = ( - _AgenticRetrieveMemoryMetadataFilterRightDeserializer().deserialize( - de - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_METADATA_FILTER, consumer=_consumer - ) - if "left" not in kwargs: - kwargs["left"] = AgenticRetrieveMemoryMetadataFilterLeftUnknown(tag="") - if "operator" not in kwargs: - kwargs["operator"] = AgenticRetrieveMemoryMetadataFilterOperator._corrected( - "" - ) - return kwargs - - -def _serialize_agentic_retrieve_memory_metadata_filter_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[AgenticRetrieveMemoryMetadataFilter], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_agentic_retrieve_memory_metadata_filter_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AgenticRetrieveMemoryMetadataFilter]: - result: list[AgenticRetrieveMemoryMetadataFilter] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AgenticRetrieveMemoryMetadataFilter.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AgenticRetrieveMemoryRetrievalConfig: - """ - The long-term memory namespace that the agent might retrieve memory - records from, and the filters applied to that retrieval. You must - specify either namespace or namespacePath. - """ - - namespace: str | None = None - """ - The namespace prefix to filter memory records by. The agent retrieves - memory records in namespaces that start with the provided prefix. You - must specify either namespace or namespacePath. - """ - - namespace_path: str | None = None - """ - The parent namespace to use for hierarchical retrievals. The agent - retrieves all memory records whose namespace falls under the same parent - hierarchy. You must specify either namespace or namespacePath. - """ - - strategy_id: str | None = None - """ - The extraction strategy ID that restricts retrieval to memory records - produced by a single strategy. Omit this parameter to retrieve records - from every strategy on the memory resource. - """ - - metadata_filters: list[AgenticRetrieveMemoryMetadataFilter] | None = None - """ - The metadata filter expressions that restrict retrieval to matching - memory records. You can specify a maximum of 5 expressions. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENTIC_RETRIEVE_MEMORY_RETRIEVAL_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.namespace is not None: - serializer.write_string( - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_RETRIEVAL_CONFIG.members["namespace"], - self.namespace, - ) - - if self.namespace_path is not None: - serializer.write_string( - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_RETRIEVAL_CONFIG.members[ - "namespacePath" - ], - self.namespace_path, - ) - - if self.strategy_id is not None: - serializer.write_string( - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_RETRIEVAL_CONFIG.members["strategyId"], - self.strategy_id, - ) - - if self.metadata_filters is not None: - _serialize_agentic_retrieve_memory_metadata_filter_list( - serializer, - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_RETRIEVAL_CONFIG.members[ - "metadataFilters" - ], - self.metadata_filters, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["namespace"] = de.read_string( - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_RETRIEVAL_CONFIG.members[ - "namespace" - ] - ) - - case 1: - kwargs["namespace_path"] = de.read_string( - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_RETRIEVAL_CONFIG.members[ - "namespacePath" - ] - ) - - case 2: - kwargs["strategy_id"] = de.read_string( - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_RETRIEVAL_CONFIG.members[ - "strategyId" - ] - ) - - case 3: - kwargs["metadata_filters"] = ( - _deserialize_agentic_retrieve_memory_metadata_filter_list( - de, - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_RETRIEVAL_CONFIG.members[ - "metadataFilters" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_RETRIEVAL_CONFIG, consumer=_consumer - ) - return kwargs - - -def _serialize_agentic_retrieve_memory_retrieval_config_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[AgenticRetrieveMemoryRetrievalConfig], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_agentic_retrieve_memory_retrieval_config_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AgenticRetrieveMemoryRetrievalConfig]: - result: list[AgenticRetrieveMemoryRetrievalConfig] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AgenticRetrieveMemoryRetrievalConfig.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AgenticRetrieveMemorySessionBinding: - """ - The short-term memory session that this retrieval reads from and writes - to. - """ - - actor_id: str - """ - The identifier of the end user or agent that the session belongs to. - This identifier scopes session history so that one actor's history is - never returned for another. You are responsible for sending the correct - actor value. - """ - - session_id: str - """ - The identifier of the session to restore and continue. You are - responsible for sending the correct session value. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENTIC_RETRIEVE_MEMORY_SESSION_BINDING, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_SESSION_BINDING.members["actorId"], - self.actor_id, - ) - serializer.write_string( - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_SESSION_BINDING.members["sessionId"], - self.session_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["actor_id"] = de.read_string( - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_SESSION_BINDING.members[ - "actorId" - ] - ) - - case 1: - kwargs["session_id"] = de.read_string( - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_SESSION_BINDING.members[ - "sessionId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_SESSION_BINDING, consumer=_consumer - ) - if "actor_id" not in kwargs: - kwargs["actor_id"] = "" - if "session_id" not in kwargs: - kwargs["session_id"] = "" - return kwargs - - -@dataclass(kw_only=True) -class AgenticRetrieveMemoryConfiguration: - """ - Specifies an AgentCore Memory resource and how this retrieval uses it. - Set sessionBinding to restore and continue a session. Set - retrievalConfigs to let the agent retrieve from long-term memory. You - must specify at least one of the two. - """ - - memory_id: str - """ - The identifier of the AgentCore Memory resource to use. The resource - must exist in your account and be in the ACTIVE state. - """ - - session_binding: AgenticRetrieveMemorySessionBinding | None = None - """ - The short-term memory session whose history is restored for this - retrieval. To persist the agent-generated answer to the session, omit - persistenceMode or set it to DEFAULT. To leave the session unchanged, - set persistenceMode to NONE. Supply session history through the existing - messages parameter or through short-term memory, but not both. - """ - - retrieval_configs: list[AgenticRetrieveMemoryRetrievalConfig] | None = None - """ - Specifies the long-term memory configuration the agent can retrieve - from. The agent decides whether to retrieve and composes its own query. - This field currently accepts at most one entry. - """ - - persistence_mode: str | None = None - """ - Specifies whether the agent-generated answer is written back to the - given short-term memory session, and applies only when sessionBinding is - set. Valid values: - - - `DEFAULT` (default) -- Specifies that the question and the - agent-generated answer are persisted to the session as a single event. - This value requires generateResponse to be true. - - - `NONE` -- Specifies that the session is left unchanged. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENTIC_RETRIEVE_MEMORY_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_CONFIGURATION.members["memoryId"], - self.memory_id, - ) - if self.session_binding is not None: - serializer.write_struct( - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_CONFIGURATION.members["sessionBinding"], - self.session_binding, - ) - - if self.retrieval_configs is not None: - _serialize_agentic_retrieve_memory_retrieval_config_list( - serializer, - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_CONFIGURATION.members[ - "retrievalConfigs" - ], - self.retrieval_configs, - ) - - if self.persistence_mode is not None: - serializer.write_string( - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_CONFIGURATION.members[ - "persistenceMode" - ], - self.persistence_mode, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["memory_id"] = de.read_string( - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_CONFIGURATION.members[ - "memoryId" - ] - ) - - case 1: - kwargs["session_binding"] = ( - AgenticRetrieveMemorySessionBinding.deserialize(de) - ) - - case 2: - kwargs["retrieval_configs"] = ( - _deserialize_agentic_retrieve_memory_retrieval_config_list( - de, - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_CONFIGURATION.members[ - "retrievalConfigs" - ], - ) - ) - - case 3: - kwargs["persistence_mode"] = AgenticRetrieveMemoryPersistenceMode( - de.read_string( - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_CONFIGURATION.members[ - "persistenceMode" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AGENTIC_RETRIEVE_MEMORY_CONFIGURATION, consumer=_consumer - ) - if "memory_id" not in kwargs: - kwargs["memory_id"] = "" - return kwargs - - -class ConversationRole(UnknownEnumMixin, StrEnum): - USER = "user" - ASSISTANT = "assistant" - - -@dataclass(kw_only=True) -class AgenticRetrieveMessage: - """A message in the agentic retrieval conversation.""" - - content: AgenticRetrieveMessageContent = field(repr=False) - """The content of the message.""" - - role: str - """The role of the message sender (e.g., user or assistant).""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENTIC_RETRIEVE_MESSAGE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AGENTIC_RETRIEVE_MESSAGE.members["content"], self.content - ) - serializer.write_string( - _SCHEMA_AGENTIC_RETRIEVE_MESSAGE.members["role"], self.role - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["content"] = AgenticRetrieveMessageContent.deserialize(de) - - case 1: - kwargs["role"] = ConversationRole( - de.read_string(_SCHEMA_AGENTIC_RETRIEVE_MESSAGE.members["role"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AGENTIC_RETRIEVE_MESSAGE, consumer=_consumer) - if "content" not in kwargs: - kwargs["content"] = AgenticRetrieveMessageContent._smithy_default() - if "role" not in kwargs: - kwargs["role"] = ConversationRole._corrected("") - return kwargs - - -def _serialize_agentic_retrieve_messages( - serializer: ShapeSerializer, schema: Schema, value: list[AgenticRetrieveMessage] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_agentic_retrieve_messages( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AgenticRetrieveMessage]: - result: list[AgenticRetrieveMessage] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AgenticRetrieveMessage.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_agentic_retrieve_metadata( - serializer: ShapeSerializer, schema: Schema, value: dict[str, Document] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_document(value_schema, v)) - - -def _deserialize_agentic_retrieve_metadata( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, Document]: - result: dict[str, Document] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_document(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AgenticRetrievePolicyConfiguration: - """Policy configuration for agentic retrieval.""" - - bedrock_guardrail_configuration: ( - AgenticRetrieveBedrockGuardrailConfiguration | None - ) = None - """Configuration for Bedrock guardrails to apply during retrieval.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENTIC_RETRIEVE_POLICY_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.bedrock_guardrail_configuration is not None: - serializer.write_struct( - _SCHEMA_AGENTIC_RETRIEVE_POLICY_CONFIGURATION.members[ - "bedrockGuardrailConfiguration" - ], - self.bedrock_guardrail_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bedrock_guardrail_configuration"] = ( - AgenticRetrieveBedrockGuardrailConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AGENTIC_RETRIEVE_POLICY_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class FilterAttribute: - """ - Specifies the name that the metadata attribute must match and the value - to which to compare the value of the metadata attribute. For more - information, see [Query - configurations](https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html). - - This data type is used in the following API operations: - - - [RetrieveAndGenerate - request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_RequestSyntax) - """ - - key: str - """The name that the metadata attribute must match.""" - - value: Document - """The value to which to compare the value of the metadata attribute.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FILTER_ATTRIBUTE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_FILTER_ATTRIBUTE.members["key"], self.key) - serializer.write_document(_SCHEMA_FILTER_ATTRIBUTE.members["value"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["key"] = de.read_string( - _SCHEMA_FILTER_ATTRIBUTE.members["key"] - ) - - case 1: - kwargs["value"] = de.read_document( - _SCHEMA_FILTER_ATTRIBUTE.members["value"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FILTER_ATTRIBUTE, consumer=_consumer) - if "key" not in kwargs: - kwargs["key"] = "" - if "value" not in kwargs: - kwargs["value"] = Document(None) - return kwargs - - -@dataclass(kw_only=True) -class AgenticRetrieveResponseEvent: - """A chunk of the generated answer text.""" - - text: str - """The generated text chunk.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENTIC_RETRIEVE_RESPONSE_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AGENTIC_RETRIEVE_RESPONSE_EVENT.members["text"], self.text - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["text"] = de.read_string( - _SCHEMA_AGENTIC_RETRIEVE_RESPONSE_EVENT.members["text"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AGENTIC_RETRIEVE_RESPONSE_EVENT, consumer=_consumer - ) - if "text" not in kwargs: - kwargs["text"] = "" - return kwargs - - -@dataclass(kw_only=True) -class RetrievalContent: - """The content retrieved from a knowledge source.""" - - mime_type: str - """The MIME type of the retrieved content.""" - - byte_content: bytes | None = None - """The binary content of the retrieved item.""" - - text: str | None = None - """The text content of the retrieved item.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVAL_CONTENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.byte_content is not None: - serializer.write_blob( - _SCHEMA_RETRIEVAL_CONTENT.members["byteContent"], self.byte_content - ) - - if self.text is not None: - serializer.write_string( - _SCHEMA_RETRIEVAL_CONTENT.members["text"], self.text - ) - - serializer.write_string( - _SCHEMA_RETRIEVAL_CONTENT.members["mimeType"], self.mime_type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["byte_content"] = de.read_blob( - _SCHEMA_RETRIEVAL_CONTENT.members["byteContent"] - ) - - case 1: - kwargs["text"] = de.read_string( - _SCHEMA_RETRIEVAL_CONTENT.members["text"] - ) - - case 2: - kwargs["mime_type"] = de.read_string( - _SCHEMA_RETRIEVAL_CONTENT.members["mimeType"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RETRIEVAL_CONTENT, consumer=_consumer) - if "mime_type" not in kwargs: - kwargs["mime_type"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(mime_type="") - - -@dataclass(kw_only=True) -class AgenticRetrieveResultItem: - """A single item from the agentic retrieval results.""" - - content: RetrievalContent - """The retrieved content.""" - - source_retriever: AgenticRetrieveSourceRetriever - """The source retriever that produced this result.""" - - metadata: dict[str, Document] | None = None - """Metadata associated with the retrieved item.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENTIC_RETRIEVE_RESULT_ITEM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AGENTIC_RETRIEVE_RESULT_ITEM.members["content"], self.content - ) - if self.metadata is not None: - _serialize_agentic_retrieve_metadata( - serializer, - _SCHEMA_AGENTIC_RETRIEVE_RESULT_ITEM.members["metadata"], - self.metadata, - ) - - serializer.write_struct( - _SCHEMA_AGENTIC_RETRIEVE_RESULT_ITEM.members["sourceRetriever"], - self.source_retriever, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["content"] = RetrievalContent.deserialize(de) - - case 1: - kwargs["metadata"] = _deserialize_agentic_retrieve_metadata( - de, _SCHEMA_AGENTIC_RETRIEVE_RESULT_ITEM.members["metadata"] - ) - - case 2: - kwargs["source_retriever"] = ( - AgenticRetrieveSourceRetriever.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AGENTIC_RETRIEVE_RESULT_ITEM, consumer=_consumer - ) - if "content" not in kwargs: - kwargs["content"] = RetrievalContent._smithy_default() - if "source_retriever" not in kwargs: - kwargs["source_retriever"] = ( - AgenticRetrieveSourceRetriever._smithy_default() - ) - return kwargs - - -def _serialize_agentic_retrieve_results( - serializer: ShapeSerializer, schema: Schema, value: list[AgenticRetrieveResultItem] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_agentic_retrieve_results( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AgenticRetrieveResultItem]: - result: list[AgenticRetrieveResultItem] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AgenticRetrieveResultItem.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AgenticRetrieveResultEvent: - """An event containing agentic retrieval results.""" - - results: list[AgenticRetrieveResultItem] - """The list of retrieved result items.""" - - generated_response: AgenticRetrieveGeneratedResponse | None = None - """The generated response. Present only when generateResponse is true.""" - - next_token: str | None = None - """Opaque continuation token for paginated results.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENTIC_RETRIEVE_RESULT_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_agentic_retrieve_results( - serializer, - _SCHEMA_AGENTIC_RETRIEVE_RESULT_EVENT.members["results"], - self.results, - ) - if self.generated_response is not None: - serializer.write_struct( - _SCHEMA_AGENTIC_RETRIEVE_RESULT_EVENT.members["generatedResponse"], - self.generated_response, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_AGENTIC_RETRIEVE_RESULT_EVENT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["results"] = _deserialize_agentic_retrieve_results( - de, _SCHEMA_AGENTIC_RETRIEVE_RESULT_EVENT.members["results"] - ) - - case 1: - kwargs["generated_response"] = ( - AgenticRetrieveGeneratedResponse.deserialize(de) - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_AGENTIC_RETRIEVE_RESULT_EVENT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AGENTIC_RETRIEVE_RESULT_EVENT, consumer=_consumer - ) - if "results" not in kwargs: - kwargs["results"] = [] - return kwargs - - -class AgenticRetrieveType(UnknownEnumMixin, StrEnum): - """The type of retrieval source.""" - - BEDROCK_KNOWLEDGE_BASE = "BedrockKnowledgeBase" - """A Bedrock knowledge base retrieval source.""" - BEDROCK_AGENT_CORE_MEMORY = "BedrockAgentCoreMemory" - """ - An AgentCore Memory resource. Long-term memory retrievals report under - the Retrieval step with this source type. - """ - - -@dataclass(kw_only=True) -class AgenticRetrieveSourceMetadata: - """Metadata about a retrieval source.""" - - identifier: str | None = None - """The identifier of the retrieval source.""" - - retrieval_type: str | None = None - """The type of retrieval source.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENTIC_RETRIEVE_SOURCE_METADATA, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.identifier is not None: - serializer.write_string( - _SCHEMA_AGENTIC_RETRIEVE_SOURCE_METADATA.members["identifier"], - self.identifier, - ) - - if self.retrieval_type is not None: - serializer.write_string( - _SCHEMA_AGENTIC_RETRIEVE_SOURCE_METADATA.members["retrievalType"], - self.retrieval_type, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["identifier"] = de.read_string( - _SCHEMA_AGENTIC_RETRIEVE_SOURCE_METADATA.members["identifier"] - ) - - case 1: - kwargs["retrieval_type"] = AgenticRetrieveType( - de.read_string( - _SCHEMA_AGENTIC_RETRIEVE_SOURCE_METADATA.members[ - "retrievalType" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AGENTIC_RETRIEVE_SOURCE_METADATA, consumer=_consumer - ) - return kwargs - - -def _serialize_agentic_retrieve_source_metadata_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[AgenticRetrieveSourceMetadata], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_agentic_retrieve_source_metadata_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AgenticRetrieveSourceMetadata]: - result: list[AgenticRetrieveSourceMetadata] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AgenticRetrieveSourceMetadata.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class AgenticRetrieveStatus(UnknownEnumMixin, StrEnum): - """The status of an agentic retrieval step.""" - - IN_PROGRESS = "IN_PROGRESS" - """The step is currently in progress.""" - SUCCEEDED = "SUCCEEDED" - """The step completed successfully.""" - FAILED = "FAILED" - """The step failed.""" - - -class AgenticRetrieveStep(UnknownEnumMixin, StrEnum): - """The step in the agentic retrieval process.""" - - PLANNING = "Planning" - """The planning phase of retrieval.""" - RETRIEVAL = "Retrieval" - """The retrieval phase where data is fetched.""" - SPECULATIVE_RETRIEVAL = "SpeculativeRetrieval" - """A speculative retrieval phase for optimization.""" - FULL_DOCUMENT_EXPANSION = "FullDocumentExpansion" - """The full document expansion phase.""" - SESSION_HISTORY_LOAD = "SessionHistoryLoad" - """ - The phase that restores prior session history from AgentCore Memory - short-term memory, before the agent begins work. - """ - - -@dataclass(kw_only=True) -class UserContext: - """ - Contains information about the user making the request. Use this to pass - user identity information for access control filtering, so that - retrieval results only include documents the user is authorized to - access. - """ - - user_id: str - """The identifier of the user making the retrieval request.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_USER_CONTEXT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_USER_CONTEXT.members["userId"], self.user_id) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["user_id"] = de.read_string( - _SCHEMA_USER_CONTEXT.members["userId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_USER_CONTEXT, consumer=_consumer) - if "user_id" not in kwargs: - kwargs["user_id"] = "" - return kwargs - - -@dataclass(kw_only=True) -class BadGatewayException(ServiceError): - """ - There was an issue with a dependency due to a server issue. Retry your - request. - """ - - fault: Literal["client", "server"] | None = "server" - - resource_name: str | None = None - """ - The name of the dependency that caused the issue, such as Amazon - Bedrock, Lambda, or STS. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BAD_GATEWAY_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_BAD_GATEWAY_EXCEPTION.members["message"], self.message - ) - - if self.resource_name is not None: - serializer.write_string( - _SCHEMA_BAD_GATEWAY_EXCEPTION.members["resourceName"], - self.resource_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_BAD_GATEWAY_EXCEPTION.members["message"] - ) - - case 1: - kwargs["resource_name"] = de.read_string( - _SCHEMA_BAD_GATEWAY_EXCEPTION.members["resourceName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BAD_GATEWAY_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ConflictException(ServiceError): - """ - There was a conflict performing an operation. Resolve the conflict and - retry your request. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONFLICT_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_CONFLICT_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_CONFLICT_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONFLICT_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DependencyFailedException(ServiceError): - """ - There was an issue with a dependency. Check the resource configurations - and retry the request. - """ - - fault: Literal["client", "server"] | None = "client" - - resource_name: str | None = None - """ - The name of the dependency that caused the issue, such as Amazon - Bedrock, Lambda, or STS. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DEPENDENCY_FAILED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_DEPENDENCY_FAILED_EXCEPTION.members["message"], self.message - ) - - if self.resource_name is not None: - serializer.write_string( - _SCHEMA_DEPENDENCY_FAILED_EXCEPTION.members["resourceName"], - self.resource_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_DEPENDENCY_FAILED_EXCEPTION.members["message"] - ) - - case 1: - kwargs["resource_name"] = de.read_string( - _SCHEMA_DEPENDENCY_FAILED_EXCEPTION.members["resourceName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DEPENDENCY_FAILED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InternalServerException(ServiceError): - """An internal server error occurred. Retry your request.""" - - fault: Literal["client", "server"] | None = "server" - - reason: str | None = None - """ - The reason for the exception. If the reason is - `BEDROCK_MODEL_INVOCATION_SERVICE_UNAVAILABLE`, the model invocation - service is unavailable. Retry your request. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INTERNAL_SERVER_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INTERNAL_SERVER_EXCEPTION.members["message"], self.message - ) - - if self.reason is not None: - serializer.write_string( - _SCHEMA_INTERNAL_SERVER_EXCEPTION.members["reason"], self.reason - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INTERNAL_SERVER_EXCEPTION.members["message"] - ) - - case 1: - kwargs["reason"] = de.read_string( - _SCHEMA_INTERNAL_SERVER_EXCEPTION.members["reason"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INTERNAL_SERVER_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ResourceNotFoundException(ServiceError): - """ - The specified resource Amazon Resource Name (ARN) was not found. Check - the Amazon Resource Name (ARN) and try your request again. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ServiceQuotaExceededException(ServiceError): - """ - The number of requests exceeds the service quota. Resubmit your request - later. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ThrottlingException(ServiceError): - """The number of requests exceeds the limit. Resubmit your request later.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_THROTTLING_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_THROTTLING_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_THROTTLING_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_THROTTLING_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class AgenticRetrieveTraceResultItem: - """A result item from an agentic retrieval trace.""" - - content: RetrievalContent | None = None - """The retrieved content.""" - - metadata: dict[str, Document] | None = None - """Metadata associated with the retrieved item.""" - - source_retriever: AgenticRetrieveSourceRetriever | None = None - """The source retriever that produced this result.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENTIC_RETRIEVE_TRACE_RESULT_ITEM, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.content is not None: - serializer.write_struct( - _SCHEMA_AGENTIC_RETRIEVE_TRACE_RESULT_ITEM.members["content"], - self.content, - ) - - if self.metadata is not None: - _serialize_agentic_retrieve_metadata( - serializer, - _SCHEMA_AGENTIC_RETRIEVE_TRACE_RESULT_ITEM.members["metadata"], - self.metadata, - ) - - if self.source_retriever is not None: - serializer.write_struct( - _SCHEMA_AGENTIC_RETRIEVE_TRACE_RESULT_ITEM.members["sourceRetriever"], - self.source_retriever, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["content"] = RetrievalContent.deserialize(de) - - case 1: - kwargs["metadata"] = _deserialize_agentic_retrieve_metadata( - de, - _SCHEMA_AGENTIC_RETRIEVE_TRACE_RESULT_ITEM.members["metadata"], - ) - - case 2: - kwargs["source_retriever"] = ( - AgenticRetrieveSourceRetriever.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AGENTIC_RETRIEVE_TRACE_RESULT_ITEM, consumer=_consumer - ) - return kwargs - - -def _serialize_agentic_retrieve_trace_results( - serializer: ShapeSerializer, - schema: Schema, - value: list[AgenticRetrieveTraceResultItem], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_agentic_retrieve_trace_results( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AgenticRetrieveTraceResultItem]: - result: list[AgenticRetrieveTraceResultItem] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AgenticRetrieveTraceResultItem.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AgenticRetrieveWarningMessage: - """A general warning message from agentic retrieval.""" - - message: str - """The warning message text.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENTIC_RETRIEVE_WARNING_MESSAGE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AGENTIC_RETRIEVE_WARNING_MESSAGE.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_AGENTIC_RETRIEVE_WARNING_MESSAGE.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AGENTIC_RETRIEVE_WARNING_MESSAGE, consumer=_consumer - ) - if "message" not in kwargs: - kwargs["message"] = "" - return kwargs - - -@dataclass -class AgenticRetrieveWarning_Message: - """A general warning message.""" - - value: AgenticRetrieveWarningMessage - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENTIC_RETRIEVE_WARNING, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AGENTIC_RETRIEVE_WARNING.members["message"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=AgenticRetrieveWarningMessage.deserialize(deserializer)) - - -@dataclass -class AgenticRetrieveWarningGuardrail: - """A warning from a guardrail evaluation.""" - - value: AgenticRetrieveGuardrailWarning - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENTIC_RETRIEVE_WARNING, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AGENTIC_RETRIEVE_WARNING.members["guardrail"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=AgenticRetrieveGuardrailWarning.deserialize(deserializer)) - - -@dataclass -class AgenticRetrieveWarningUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -AgenticRetrieveWarning = Union[ - AgenticRetrieveWarning_Message - | AgenticRetrieveWarningGuardrail - | AgenticRetrieveWarningUnknown -] -"""A warning generated during agentic retrieval.""" - - -class _AgenticRetrieveWarningDeserializer: - _result: AgenticRetrieveWarning | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> AgenticRetrieveWarning: - self._result = None - deserializer.read_struct(_SCHEMA_AGENTIC_RETRIEVE_WARNING, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(AgenticRetrieveWarning_Message.deserialize(de)) - - case 1: - self._set_result(AgenticRetrieveWarningGuardrail.deserialize(de)) - - case _: - self._set_result( - AgenticRetrieveWarningUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: AgenticRetrieveWarning) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_agentic_retrieve_warnings( - serializer: ShapeSerializer, schema: Schema, value: list[AgenticRetrieveWarning] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_agentic_retrieve_warnings( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AgenticRetrieveWarning]: - result: list[AgenticRetrieveWarning] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_AgenticRetrieveWarningDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AgenticRetrieveTraceEventAttributes: - """Attributes describing the details of an agentic retrieval trace event.""" - - step: str - """The current step in the retrieval process.""" - - status: str - """The status of the current step.""" - - message: str - """A human-readable message describing the trace event.""" - - actions: list[AgenticRetrieveAction] | None = None - """The list of actions taken during this step.""" - - warnings: list[AgenticRetrieveWarning] | None = None - """Warnings generated during this step.""" - - failures: list[AgenticRetrieveFailure] | None = None - """Failures that occurred during this step.""" - - retrieval_metadata: list[AgenticRetrieveSourceMetadata] | None = None - """Metadata about the retrieval sources used.""" - - retrieval_response: list[AgenticRetrieveTraceResultItem] | None = None - """The retrieval results from this step.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENTIC_RETRIEVE_TRACE_EVENT_ATTRIBUTES, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AGENTIC_RETRIEVE_TRACE_EVENT_ATTRIBUTES.members["step"], self.step - ) - serializer.write_string( - _SCHEMA_AGENTIC_RETRIEVE_TRACE_EVENT_ATTRIBUTES.members["status"], - self.status, - ) - serializer.write_string( - _SCHEMA_AGENTIC_RETRIEVE_TRACE_EVENT_ATTRIBUTES.members["message"], - self.message, - ) - if self.actions is not None: - _serialize_agentic_retrieve_actions( - serializer, - _SCHEMA_AGENTIC_RETRIEVE_TRACE_EVENT_ATTRIBUTES.members["actions"], - self.actions, - ) - - if self.warnings is not None: - _serialize_agentic_retrieve_warnings( - serializer, - _SCHEMA_AGENTIC_RETRIEVE_TRACE_EVENT_ATTRIBUTES.members["warnings"], - self.warnings, - ) - - if self.failures is not None: - _serialize_agentic_retrieve_failures( - serializer, - _SCHEMA_AGENTIC_RETRIEVE_TRACE_EVENT_ATTRIBUTES.members["failures"], - self.failures, - ) - - if self.retrieval_metadata is not None: - _serialize_agentic_retrieve_source_metadata_list( - serializer, - _SCHEMA_AGENTIC_RETRIEVE_TRACE_EVENT_ATTRIBUTES.members[ - "retrievalMetadata" - ], - self.retrieval_metadata, - ) - - if self.retrieval_response is not None: - _serialize_agentic_retrieve_trace_results( - serializer, - _SCHEMA_AGENTIC_RETRIEVE_TRACE_EVENT_ATTRIBUTES.members[ - "retrievalResponse" - ], - self.retrieval_response, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["step"] = AgenticRetrieveStep( - de.read_string( - _SCHEMA_AGENTIC_RETRIEVE_TRACE_EVENT_ATTRIBUTES.members[ - "step" - ] - ) - ) - - case 1: - kwargs["status"] = AgenticRetrieveStatus( - de.read_string( - _SCHEMA_AGENTIC_RETRIEVE_TRACE_EVENT_ATTRIBUTES.members[ - "status" - ] - ) - ) - - case 2: - kwargs["message"] = de.read_string( - _SCHEMA_AGENTIC_RETRIEVE_TRACE_EVENT_ATTRIBUTES.members[ - "message" - ] - ) - - case 3: - kwargs["actions"] = _deserialize_agentic_retrieve_actions( - de, - _SCHEMA_AGENTIC_RETRIEVE_TRACE_EVENT_ATTRIBUTES.members[ - "actions" - ], - ) - - case 4: - kwargs["warnings"] = _deserialize_agentic_retrieve_warnings( - de, - _SCHEMA_AGENTIC_RETRIEVE_TRACE_EVENT_ATTRIBUTES.members[ - "warnings" - ], - ) - - case 5: - kwargs["failures"] = _deserialize_agentic_retrieve_failures( - de, - _SCHEMA_AGENTIC_RETRIEVE_TRACE_EVENT_ATTRIBUTES.members[ - "failures" - ], - ) - - case 6: - kwargs["retrieval_metadata"] = ( - _deserialize_agentic_retrieve_source_metadata_list( - de, - _SCHEMA_AGENTIC_RETRIEVE_TRACE_EVENT_ATTRIBUTES.members[ - "retrievalMetadata" - ], - ) - ) - - case 7: - kwargs["retrieval_response"] = ( - _deserialize_agentic_retrieve_trace_results( - de, - _SCHEMA_AGENTIC_RETRIEVE_TRACE_EVENT_ATTRIBUTES.members[ - "retrievalResponse" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AGENTIC_RETRIEVE_TRACE_EVENT_ATTRIBUTES, consumer=_consumer - ) - if "step" not in kwargs: - kwargs["step"] = AgenticRetrieveStep._corrected("") - if "status" not in kwargs: - kwargs["status"] = AgenticRetrieveStatus._corrected("") - if "message" not in kwargs: - kwargs["message"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls( - step=AgenticRetrieveStep._corrected(""), - status=AgenticRetrieveStatus._corrected(""), - message="", - ) - - -@dataclass(kw_only=True) -class AgenticRetrieveTraceEvent: - """A trace event providing visibility into the agentic retrieval process.""" - - id: str - """The unique identifier of the trace event.""" - - timestamp: int - """The timestamp when the trace event occurred.""" - - attributes: AgenticRetrieveTraceEventAttributes - """The attributes describing the trace event details.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENTIC_RETRIEVE_TRACE_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AGENTIC_RETRIEVE_TRACE_EVENT.members["id"], self.id - ) - serializer.write_long( - _SCHEMA_AGENTIC_RETRIEVE_TRACE_EVENT.members["timestamp"], self.timestamp - ) - serializer.write_struct( - _SCHEMA_AGENTIC_RETRIEVE_TRACE_EVENT.members["attributes"], self.attributes - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_AGENTIC_RETRIEVE_TRACE_EVENT.members["id"] - ) - - case 1: - kwargs["timestamp"] = de.read_long( - _SCHEMA_AGENTIC_RETRIEVE_TRACE_EVENT.members["timestamp"] - ) - - case 2: - kwargs["attributes"] = ( - AgenticRetrieveTraceEventAttributes.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AGENTIC_RETRIEVE_TRACE_EVENT, consumer=_consumer - ) - if "id" not in kwargs: - kwargs["id"] = "" - if "timestamp" not in kwargs: - kwargs["timestamp"] = 0 - if "attributes" not in kwargs: - kwargs["attributes"] = AgenticRetrieveTraceEventAttributes._smithy_default() - return kwargs - - -@dataclass(kw_only=True) -class ValidationException(ServiceError): - """ - Input validation failed. Check your request parameters and retry the - request. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VALIDATION_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_VALIDATION_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_VALIDATION_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VALIDATION_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass -class AgenticRetrieveStreamResponseOutputResult: - """A retrieval result event containing the retrieved items.""" - - value: AgenticRetrieveResultEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENTIC_RETRIEVE_STREAM_RESPONSE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AGENTIC_RETRIEVE_STREAM_RESPONSE_OUTPUT.members["result"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=AgenticRetrieveResultEvent.deserialize(deserializer)) - - -@dataclass -class AgenticRetrieveStreamResponseOutputTraceEvent: - """A trace event providing visibility into the retrieval process.""" - - value: AgenticRetrieveTraceEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENTIC_RETRIEVE_STREAM_RESPONSE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AGENTIC_RETRIEVE_STREAM_RESPONSE_OUTPUT.members["traceEvent"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=AgenticRetrieveTraceEvent.deserialize(deserializer)) - - -@dataclass -class AgenticRetrieveStreamResponseOutputResponseEvent: - """ - A chunk of the generated answer. Emitted only when generateResponse is - true. - """ - - value: AgenticRetrieveResponseEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENTIC_RETRIEVE_STREAM_RESPONSE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AGENTIC_RETRIEVE_STREAM_RESPONSE_OUTPUT.members["responseEvent"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=AgenticRetrieveResponseEvent.deserialize(deserializer)) - - -@dataclass -class AgenticRetrieveStreamResponseOutputInternalServerException: - """An internal server error occurred.""" - - value: InternalServerException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENTIC_RETRIEVE_STREAM_RESPONSE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AGENTIC_RETRIEVE_STREAM_RESPONSE_OUTPUT.members[ - "internalServerException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=InternalServerException.deserialize(deserializer)) - - -@dataclass -class AgenticRetrieveStreamResponseOutputValidationException: - """The request validation failed.""" - - value: ValidationException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENTIC_RETRIEVE_STREAM_RESPONSE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AGENTIC_RETRIEVE_STREAM_RESPONSE_OUTPUT.members[ - "validationException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ValidationException.deserialize(deserializer)) - - -@dataclass -class AgenticRetrieveStreamResponseOutputResourceNotFoundException: - """The specified resource was not found.""" - - value: ResourceNotFoundException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENTIC_RETRIEVE_STREAM_RESPONSE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AGENTIC_RETRIEVE_STREAM_RESPONSE_OUTPUT.members[ - "resourceNotFoundException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ResourceNotFoundException.deserialize(deserializer)) - - -@dataclass -class AgenticRetrieveStreamResponseOutputServiceQuotaExceededException: - """The service quota has been exceeded.""" - - value: ServiceQuotaExceededException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENTIC_RETRIEVE_STREAM_RESPONSE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AGENTIC_RETRIEVE_STREAM_RESPONSE_OUTPUT.members[ - "serviceQuotaExceededException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ServiceQuotaExceededException.deserialize(deserializer)) - - -@dataclass -class AgenticRetrieveStreamResponseOutputThrottlingException: - """The request was throttled.""" - - value: ThrottlingException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENTIC_RETRIEVE_STREAM_RESPONSE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AGENTIC_RETRIEVE_STREAM_RESPONSE_OUTPUT.members[ - "throttlingException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ThrottlingException.deserialize(deserializer)) - - -@dataclass -class AgenticRetrieveStreamResponseOutputAccessDeniedException: - """Access to the resource was denied.""" - - value: AccessDeniedException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENTIC_RETRIEVE_STREAM_RESPONSE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AGENTIC_RETRIEVE_STREAM_RESPONSE_OUTPUT.members[ - "accessDeniedException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=AccessDeniedException.deserialize(deserializer)) - - -@dataclass -class AgenticRetrieveStreamResponseOutputConflictException: - """A conflict occurred with the current state of the resource.""" - - value: ConflictException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENTIC_RETRIEVE_STREAM_RESPONSE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AGENTIC_RETRIEVE_STREAM_RESPONSE_OUTPUT.members[ - "conflictException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ConflictException.deserialize(deserializer)) - - -@dataclass -class AgenticRetrieveStreamResponseOutputDependencyFailedException: - """A dependency failed during the operation.""" - - value: DependencyFailedException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENTIC_RETRIEVE_STREAM_RESPONSE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AGENTIC_RETRIEVE_STREAM_RESPONSE_OUTPUT.members[ - "dependencyFailedException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=DependencyFailedException.deserialize(deserializer)) - - -@dataclass -class AgenticRetrieveStreamResponseOutputBadGatewayException: - """A bad gateway error occurred.""" - - value: BadGatewayException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENTIC_RETRIEVE_STREAM_RESPONSE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AGENTIC_RETRIEVE_STREAM_RESPONSE_OUTPUT.members[ - "badGatewayException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=BadGatewayException.deserialize(deserializer)) - - -@dataclass -class AgenticRetrieveStreamResponseOutputUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -AgenticRetrieveStreamResponseOutput = Union[ - AgenticRetrieveStreamResponseOutputResult - | AgenticRetrieveStreamResponseOutputTraceEvent - | AgenticRetrieveStreamResponseOutputResponseEvent - | AgenticRetrieveStreamResponseOutputInternalServerException - | AgenticRetrieveStreamResponseOutputValidationException - | AgenticRetrieveStreamResponseOutputResourceNotFoundException - | AgenticRetrieveStreamResponseOutputServiceQuotaExceededException - | AgenticRetrieveStreamResponseOutputThrottlingException - | AgenticRetrieveStreamResponseOutputAccessDeniedException - | AgenticRetrieveStreamResponseOutputConflictException - | AgenticRetrieveStreamResponseOutputDependencyFailedException - | AgenticRetrieveStreamResponseOutputBadGatewayException - | AgenticRetrieveStreamResponseOutputUnknown -] -""" -The streaming output for agentic retrieval, containing results, traces, -and errors. -""" - - -class _AgenticRetrieveStreamResponseOutputDeserializer: - _result: AgenticRetrieveStreamResponseOutput | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> AgenticRetrieveStreamResponseOutput: - self._result = None - deserializer.read_struct( - _SCHEMA_AGENTIC_RETRIEVE_STREAM_RESPONSE_OUTPUT, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - AgenticRetrieveStreamResponseOutputResult.deserialize(de) - ) - - case 1: - self._set_result( - AgenticRetrieveStreamResponseOutputTraceEvent.deserialize(de) - ) - - case 2: - self._set_result( - AgenticRetrieveStreamResponseOutputResponseEvent.deserialize(de) - ) - - case 3: - self._set_result( - AgenticRetrieveStreamResponseOutputInternalServerException.deserialize( - de - ) - ) - - case 4: - self._set_result( - AgenticRetrieveStreamResponseOutputValidationException.deserialize( - de - ) - ) - - case 5: - self._set_result( - AgenticRetrieveStreamResponseOutputResourceNotFoundException.deserialize( - de - ) - ) - - case 6: - self._set_result( - AgenticRetrieveStreamResponseOutputServiceQuotaExceededException.deserialize( - de - ) - ) - - case 7: - self._set_result( - AgenticRetrieveStreamResponseOutputThrottlingException.deserialize( - de - ) - ) - - case 8: - self._set_result( - AgenticRetrieveStreamResponseOutputAccessDeniedException.deserialize( - de - ) - ) - - case 9: - self._set_result( - AgenticRetrieveStreamResponseOutputConflictException.deserialize(de) - ) - - case 10: - self._set_result( - AgenticRetrieveStreamResponseOutputDependencyFailedException.deserialize( - de - ) - ) - - case 11: - self._set_result( - AgenticRetrieveStreamResponseOutputBadGatewayException.deserialize( - de - ) - ) - - case _: - self._set_result( - AgenticRetrieveStreamResponseOutputUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: AgenticRetrieveStreamResponseOutput) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class AgenticRetrieveStreamOutput: - """Response structure for the agentic retrieve stream operation.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENTIC_RETRIEVE_STREAM_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AGENTIC_RETRIEVE_STREAM_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass -class CallerAgentAliasArn: - """The caller's agent alias ARN.""" - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CALLER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_CALLER.members["agentAliasArn"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string(_SCHEMA_CALLER.members["agentAliasArn"]) - ) - - -@dataclass -class CallerUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -Caller = Union[CallerAgentAliasArn | CallerUnknown] -"""Details about a caller.""" - - -class _CallerDeserializer: - _result: Caller | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> Caller: - self._result = None - deserializer.read_struct(_SCHEMA_CALLER, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(CallerAgentAliasArn.deserialize(de)) - - case _: - self._set_result(CallerUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: Caller) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_caller_chain( - serializer: ShapeSerializer, schema: Schema, value: list[Caller] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_caller_chain( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Caller]: - result: list[Caller] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_CallerDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CustomOrchestrationTraceEvent: - """ - The event in the custom orchestration sequence. Events are the responses - which the custom orchestration Lambda function sends as response to the - agent. - """ - - text: str | None = None - """The text that prompted the event at this step.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOM_ORCHESTRATION_TRACE_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.text is not None: - serializer.write_string( - _SCHEMA_CUSTOM_ORCHESTRATION_TRACE_EVENT.members["text"], self.text - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["text"] = de.read_string( - _SCHEMA_CUSTOM_ORCHESTRATION_TRACE_EVENT.members["text"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CUSTOM_ORCHESTRATION_TRACE_EVENT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CustomOrchestrationTrace: - """The trace behavior for the custom orchestration.""" - - trace_id: str | None = None - """The unique identifier of the trace.""" - - event: CustomOrchestrationTraceEvent | None = field(repr=False, default=None) - """The event details used with the custom orchestration.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOM_ORCHESTRATION_TRACE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.trace_id is not None: - serializer.write_string( - _SCHEMA_CUSTOM_ORCHESTRATION_TRACE.members["traceId"], self.trace_id - ) - - if self.event is not None: - serializer.write_struct( - _SCHEMA_CUSTOM_ORCHESTRATION_TRACE.members["event"], self.event - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["trace_id"] = de.read_string( - _SCHEMA_CUSTOM_ORCHESTRATION_TRACE.members["traceId"] - ) - - case 1: - kwargs["event"] = CustomOrchestrationTraceEvent.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CUSTOM_ORCHESTRATION_TRACE, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class FailureTrace: - """Contains information about the failure of the interaction.""" - - trace_id: str | None = None - """The unique identifier of the trace.""" - - failure_reason: str | None = field(repr=False, default=None) - """The reason the interaction failed.""" - - failure_code: int | None = None - """The failure code for the trace.""" - - metadata: Metadata | None = field(repr=False, default=None) - """Information about the failure that occurred.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FAILURE_TRACE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.trace_id is not None: - serializer.write_string( - _SCHEMA_FAILURE_TRACE.members["traceId"], self.trace_id - ) - - if self.failure_reason is not None: - serializer.write_string( - _SCHEMA_FAILURE_TRACE.members["failureReason"], self.failure_reason - ) - - if self.failure_code is not None: - serializer.write_integer( - _SCHEMA_FAILURE_TRACE.members["failureCode"], self.failure_code - ) - - if self.metadata is not None: - serializer.write_struct( - _SCHEMA_FAILURE_TRACE.members["metadata"], self.metadata - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["trace_id"] = de.read_string( - _SCHEMA_FAILURE_TRACE.members["traceId"] - ) - - case 1: - kwargs["failure_reason"] = de.read_string( - _SCHEMA_FAILURE_TRACE.members["failureReason"] - ) - - case 2: - kwargs["failure_code"] = de.read_integer( - _SCHEMA_FAILURE_TRACE.members["failureCode"] - ) - - case 3: - kwargs["metadata"] = Metadata.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FAILURE_TRACE, consumer=_consumer) - return kwargs - - -class GuardrailContentPolicyAction(UnknownEnumMixin, StrEnum): - BLOCKED = "BLOCKED" - - -class GuardrailContentFilterConfidence(UnknownEnumMixin, StrEnum): - NONE = "NONE" - LOW = "LOW" - MEDIUM = "MEDIUM" - HIGH = "HIGH" - - -class GuardrailContentFilterType(UnknownEnumMixin, StrEnum): - INSULTS = "INSULTS" - HATE = "HATE" - SEXUAL = "SEXUAL" - VIOLENCE = "VIOLENCE" - MISCONDUCT = "MISCONDUCT" - PROMPT_ATTACK = "PROMPT_ATTACK" - - -@dataclass(kw_only=True) -class GuardrailContentFilter: - """Details of the content filter used in the Guardrail.""" - - type: str | None = None - """The type of content detected in the filter by the Guardrail.""" - - confidence: str | None = None - """ - The confidence level regarding the content detected in the filter by the - Guardrail. - """ - - action: str | None = None - """The action placed on the content by the Guardrail filter.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_CONTENT_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_CONTENT_FILTER.members["type"], self.type - ) - - if self.confidence is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_CONTENT_FILTER.members["confidence"], self.confidence - ) - - if self.action is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_CONTENT_FILTER.members["action"], self.action - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = GuardrailContentFilterType( - de.read_string(_SCHEMA_GUARDRAIL_CONTENT_FILTER.members["type"]) - ) - - case 1: - kwargs["confidence"] = GuardrailContentFilterConfidence( - de.read_string( - _SCHEMA_GUARDRAIL_CONTENT_FILTER.members["confidence"] - ) - ) - - case 2: - kwargs["action"] = GuardrailContentPolicyAction( - de.read_string( - _SCHEMA_GUARDRAIL_CONTENT_FILTER.members["action"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GUARDRAIL_CONTENT_FILTER, consumer=_consumer) - return kwargs - - -def _serialize_guardrail_content_filter_list( - serializer: ShapeSerializer, schema: Schema, value: list[GuardrailContentFilter] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_guardrail_content_filter_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GuardrailContentFilter]: - result: list[GuardrailContentFilter] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GuardrailContentFilter.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GuardrailContentPolicyAssessment: - """The details of the policy assessment in the Guardrails filter.""" - - filters: list[GuardrailContentFilter] | None = field(repr=False, default=None) - """ - The filter details of the policy assessment used in the Guardrails - filter. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_CONTENT_POLICY_ASSESSMENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.filters is not None: - _serialize_guardrail_content_filter_list( - serializer, - _SCHEMA_GUARDRAIL_CONTENT_POLICY_ASSESSMENT.members["filters"], - self.filters, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["filters"] = _deserialize_guardrail_content_filter_list( - de, - _SCHEMA_GUARDRAIL_CONTENT_POLICY_ASSESSMENT.members["filters"], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_CONTENT_POLICY_ASSESSMENT, consumer=_consumer - ) - return kwargs - - -class GuardrailSensitiveInformationPolicyAction(UnknownEnumMixin, StrEnum): - BLOCKED = "BLOCKED" - ANONYMIZED = "ANONYMIZED" - - -class GuardrailPiiEntityType(UnknownEnumMixin, StrEnum): - ADDRESS = "ADDRESS" - AGE = "AGE" - AWS_ACCESS_KEY = "AWS_ACCESS_KEY" - AWS_SECRET_KEY = "AWS_SECRET_KEY" - CA_HEALTH_NUMBER = "CA_HEALTH_NUMBER" - CA_SOCIAL_INSURANCE_NUMBER = "CA_SOCIAL_INSURANCE_NUMBER" - CREDIT_DEBIT_CARD_CVV = "CREDIT_DEBIT_CARD_CVV" - CREDIT_DEBIT_CARD_EXPIRY = "CREDIT_DEBIT_CARD_EXPIRY" - CREDIT_DEBIT_CARD_NUMBER = "CREDIT_DEBIT_CARD_NUMBER" - DRIVER_ID = "DRIVER_ID" - EMAIL = "EMAIL" - INTERNATIONAL_BANK_ACCOUNT_NUMBER = "INTERNATIONAL_BANK_ACCOUNT_NUMBER" - IP_ADDRESS = "IP_ADDRESS" - LICENSE_PLATE = "LICENSE_PLATE" - MAC_ADDRESS = "MAC_ADDRESS" - NAME = "NAME" - PASSWORD = "PASSWORD" - PHONE = "PHONE" - PIN = "PIN" - SWIFT_CODE = "SWIFT_CODE" - UK_NATIONAL_HEALTH_SERVICE_NUMBER = "UK_NATIONAL_HEALTH_SERVICE_NUMBER" - UK_NATIONAL_INSURANCE_NUMBER = "UK_NATIONAL_INSURANCE_NUMBER" - UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER = "UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER" - URL = "URL" - USERNAME = "USERNAME" - US_BANK_ACCOUNT_NUMBER = "US_BANK_ACCOUNT_NUMBER" - US_BANK_ROUTING_NUMBER = "US_BANK_ROUTING_NUMBER" - US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER = "US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER" - US_PASSPORT_NUMBER = "US_PASSPORT_NUMBER" - US_SOCIAL_SECURITY_NUMBER = "US_SOCIAL_SECURITY_NUMBER" - VEHICLE_IDENTIFICATION_NUMBER = "VEHICLE_IDENTIFICATION_NUMBER" - - -@dataclass(kw_only=True) -class GuardrailPiiEntityFilter: - """ - The Guardrail filter to identify and remove personally identifiable - information (PII). - """ - - type: str | None = None - """The type of PII the Guardrail filter has identified and removed.""" - - match: str | None = None - """ - The match to settings in the Guardrail filter to identify and remove - PII. - """ - - action: str | None = None - """The action of the Guardrail filter to identify and remove PII.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_PII_ENTITY_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_PII_ENTITY_FILTER.members["type"], self.type - ) - - if self.match is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_PII_ENTITY_FILTER.members["match"], self.match - ) - - if self.action is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_PII_ENTITY_FILTER.members["action"], self.action - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = GuardrailPiiEntityType( - de.read_string( - _SCHEMA_GUARDRAIL_PII_ENTITY_FILTER.members["type"] - ) - ) - - case 1: - kwargs["match"] = de.read_string( - _SCHEMA_GUARDRAIL_PII_ENTITY_FILTER.members["match"] - ) - - case 2: - kwargs["action"] = GuardrailSensitiveInformationPolicyAction( - de.read_string( - _SCHEMA_GUARDRAIL_PII_ENTITY_FILTER.members["action"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_PII_ENTITY_FILTER, consumer=_consumer - ) - return kwargs - - -def _serialize_guardrail_pii_entity_filter_list( - serializer: ShapeSerializer, schema: Schema, value: list[GuardrailPiiEntityFilter] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_guardrail_pii_entity_filter_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GuardrailPiiEntityFilter]: - result: list[GuardrailPiiEntityFilter] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GuardrailPiiEntityFilter.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GuardrailRegexFilter: - """The details for the regex filter used in the Guardrail.""" - - name: str | None = None - """The name details for the regex filter used in the Guardrail.""" - - regex: str | None = None - """The regex details for the regex filter used in the Guardrail.""" - - match: str | None = None - """The match details for the regex filter used in the Guardrail.""" - - action: str | None = None - """The action details for the regex filter used in the Guardrail.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_REGEX_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_REGEX_FILTER.members["name"], self.name - ) - - if self.regex is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_REGEX_FILTER.members["regex"], self.regex - ) - - if self.match is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_REGEX_FILTER.members["match"], self.match - ) - - if self.action is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_REGEX_FILTER.members["action"], self.action - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_GUARDRAIL_REGEX_FILTER.members["name"] - ) - - case 1: - kwargs["regex"] = de.read_string( - _SCHEMA_GUARDRAIL_REGEX_FILTER.members["regex"] - ) - - case 2: - kwargs["match"] = de.read_string( - _SCHEMA_GUARDRAIL_REGEX_FILTER.members["match"] - ) - - case 3: - kwargs["action"] = GuardrailSensitiveInformationPolicyAction( - de.read_string(_SCHEMA_GUARDRAIL_REGEX_FILTER.members["action"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GUARDRAIL_REGEX_FILTER, consumer=_consumer) - return kwargs - - -def _serialize_guardrail_regex_filter_list( - serializer: ShapeSerializer, schema: Schema, value: list[GuardrailRegexFilter] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_guardrail_regex_filter_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GuardrailRegexFilter]: - result: list[GuardrailRegexFilter] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GuardrailRegexFilter.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GuardrailSensitiveInformationPolicyAssessment: - """The details of the sensitive policy assessment used in the Guardrail.""" - - pii_entities: list[GuardrailPiiEntityFilter] | None = field( - repr=False, default=None - ) - """ - The details of the PII entities used in the sensitive policy assessment - for the Guardrail. - """ - - regexes: list[GuardrailRegexFilter] | None = field(repr=False, default=None) - """ - The details of the regexes used in the sensitive policy assessment for - the Guardrail. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GUARDRAIL_SENSITIVE_INFORMATION_POLICY_ASSESSMENT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.pii_entities is not None: - _serialize_guardrail_pii_entity_filter_list( - serializer, - _SCHEMA_GUARDRAIL_SENSITIVE_INFORMATION_POLICY_ASSESSMENT.members[ - "piiEntities" - ], - self.pii_entities, - ) - - if self.regexes is not None: - _serialize_guardrail_regex_filter_list( - serializer, - _SCHEMA_GUARDRAIL_SENSITIVE_INFORMATION_POLICY_ASSESSMENT.members[ - "regexes" - ], - self.regexes, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["pii_entities"] = ( - _deserialize_guardrail_pii_entity_filter_list( - de, - _SCHEMA_GUARDRAIL_SENSITIVE_INFORMATION_POLICY_ASSESSMENT.members[ - "piiEntities" - ], - ) - ) - - case 1: - kwargs["regexes"] = _deserialize_guardrail_regex_filter_list( - de, - _SCHEMA_GUARDRAIL_SENSITIVE_INFORMATION_POLICY_ASSESSMENT.members[ - "regexes" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_SENSITIVE_INFORMATION_POLICY_ASSESSMENT, - consumer=_consumer, - ) - return kwargs - - -class GuardrailTopicPolicyAction(UnknownEnumMixin, StrEnum): - BLOCKED = "BLOCKED" - - -class GuardrailTopicType(UnknownEnumMixin, StrEnum): - DENY = "DENY" - - -@dataclass(kw_only=True) -class GuardrailTopic: - """The details for a specific topic defined in the Guardrail.""" - - name: str | None = None - """The name details on a specific topic in the Guardrail.""" - - type: str | None = None - """The type details on a specific topic in the Guardrail.""" - - action: str | None = None - """The action details on a specific topic in the Guardrail.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_TOPIC, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string(_SCHEMA_GUARDRAIL_TOPIC.members["name"], self.name) - - if self.type is not None: - serializer.write_string(_SCHEMA_GUARDRAIL_TOPIC.members["type"], self.type) - - if self.action is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_TOPIC.members["action"], self.action - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_GUARDRAIL_TOPIC.members["name"] - ) - - case 1: - kwargs["type"] = GuardrailTopicType( - de.read_string(_SCHEMA_GUARDRAIL_TOPIC.members["type"]) - ) - - case 2: - kwargs["action"] = GuardrailTopicPolicyAction( - de.read_string(_SCHEMA_GUARDRAIL_TOPIC.members["action"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GUARDRAIL_TOPIC, consumer=_consumer) - return kwargs - - -def _serialize_guardrail_topic_list( - serializer: ShapeSerializer, schema: Schema, value: list[GuardrailTopic] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_guardrail_topic_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GuardrailTopic]: - result: list[GuardrailTopic] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GuardrailTopic.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GuardrailTopicPolicyAssessment: - """The details of the policy assessment used in the Guardrail.""" - - topics: list[GuardrailTopic] | None = field(repr=False, default=None) - """The topic details of the policy assessment used in the Guardrail.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_TOPIC_POLICY_ASSESSMENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.topics is not None: - _serialize_guardrail_topic_list( - serializer, - _SCHEMA_GUARDRAIL_TOPIC_POLICY_ASSESSMENT.members["topics"], - self.topics, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["topics"] = _deserialize_guardrail_topic_list( - de, _SCHEMA_GUARDRAIL_TOPIC_POLICY_ASSESSMENT.members["topics"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_TOPIC_POLICY_ASSESSMENT, consumer=_consumer - ) - return kwargs - - -class GuardrailWordPolicyAction(UnknownEnumMixin, StrEnum): - BLOCKED = "BLOCKED" - - -@dataclass(kw_only=True) -class GuardrailCustomWord: - """The custom word details for the filter in the Guardrail.""" - - match: str | None = None - """The match details for the custom word filter in the Guardrail.""" - - action: str | None = None - """The action details for the custom word filter in the Guardrail.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_CUSTOM_WORD, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.match is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_CUSTOM_WORD.members["match"], self.match - ) - - if self.action is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_CUSTOM_WORD.members["action"], self.action - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["match"] = de.read_string( - _SCHEMA_GUARDRAIL_CUSTOM_WORD.members["match"] - ) - - case 1: - kwargs["action"] = GuardrailWordPolicyAction( - de.read_string(_SCHEMA_GUARDRAIL_CUSTOM_WORD.members["action"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GUARDRAIL_CUSTOM_WORD, consumer=_consumer) - return kwargs - - -def _serialize_guardrail_custom_word_list( - serializer: ShapeSerializer, schema: Schema, value: list[GuardrailCustomWord] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_guardrail_custom_word_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GuardrailCustomWord]: - result: list[GuardrailCustomWord] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GuardrailCustomWord.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class GuardrailManagedWordType(UnknownEnumMixin, StrEnum): - PROFANITY = "PROFANITY" - - -@dataclass(kw_only=True) -class GuardrailManagedWord: - """The managed word details for the filter in the Guardrail.""" - - match: str | None = None - """The match details for the managed word filter in the Guardrail.""" - - type: str | None = None - """The type details for the managed word filter in the Guardrail.""" - - action: str | None = None - """The action details for the managed word filter in the Guardrail.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_MANAGED_WORD, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.match is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_MANAGED_WORD.members["match"], self.match - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_MANAGED_WORD.members["type"], self.type - ) - - if self.action is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_MANAGED_WORD.members["action"], self.action - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["match"] = de.read_string( - _SCHEMA_GUARDRAIL_MANAGED_WORD.members["match"] - ) - - case 1: - kwargs["type"] = GuardrailManagedWordType( - de.read_string(_SCHEMA_GUARDRAIL_MANAGED_WORD.members["type"]) - ) - - case 2: - kwargs["action"] = GuardrailWordPolicyAction( - de.read_string(_SCHEMA_GUARDRAIL_MANAGED_WORD.members["action"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GUARDRAIL_MANAGED_WORD, consumer=_consumer) - return kwargs - - -def _serialize_guardrail_managed_word_list( - serializer: ShapeSerializer, schema: Schema, value: list[GuardrailManagedWord] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_guardrail_managed_word_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GuardrailManagedWord]: - result: list[GuardrailManagedWord] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GuardrailManagedWord.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GuardrailWordPolicyAssessment: - """The assessment details for words defined in the Guardrail filter.""" - - custom_words: list[GuardrailCustomWord] | None = field(repr=False, default=None) - """The custom word details for words defined in the Guardrail filter.""" - - managed_word_lists: list[GuardrailManagedWord] | None = field( - repr=False, default=None - ) - """The managed word lists for words defined in the Guardrail filter.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_WORD_POLICY_ASSESSMENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.custom_words is not None: - _serialize_guardrail_custom_word_list( - serializer, - _SCHEMA_GUARDRAIL_WORD_POLICY_ASSESSMENT.members["customWords"], - self.custom_words, - ) - - if self.managed_word_lists is not None: - _serialize_guardrail_managed_word_list( - serializer, - _SCHEMA_GUARDRAIL_WORD_POLICY_ASSESSMENT.members["managedWordLists"], - self.managed_word_lists, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["custom_words"] = _deserialize_guardrail_custom_word_list( - de, - _SCHEMA_GUARDRAIL_WORD_POLICY_ASSESSMENT.members["customWords"], - ) - - case 1: - kwargs["managed_word_lists"] = ( - _deserialize_guardrail_managed_word_list( - de, - _SCHEMA_GUARDRAIL_WORD_POLICY_ASSESSMENT.members[ - "managedWordLists" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_WORD_POLICY_ASSESSMENT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GuardrailAssessment: - """Assessment details of the content analyzed by Guardrails.""" - - topic_policy: GuardrailTopicPolicyAssessment | None = field( - repr=False, default=None - ) - """Topic policy details of the Guardrail.""" - - content_policy: GuardrailContentPolicyAssessment | None = field( - repr=False, default=None - ) - """Content policy details of the Guardrail.""" - - word_policy: GuardrailWordPolicyAssessment | None = field(repr=False, default=None) - """Word policy details of the Guardrail.""" - - sensitive_information_policy: ( - GuardrailSensitiveInformationPolicyAssessment | None - ) = field(repr=False, default=None) - """Sensitive Information policy details of Guardrail.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_ASSESSMENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.topic_policy is not None: - serializer.write_struct( - _SCHEMA_GUARDRAIL_ASSESSMENT.members["topicPolicy"], self.topic_policy - ) - - if self.content_policy is not None: - serializer.write_struct( - _SCHEMA_GUARDRAIL_ASSESSMENT.members["contentPolicy"], - self.content_policy, - ) - - if self.word_policy is not None: - serializer.write_struct( - _SCHEMA_GUARDRAIL_ASSESSMENT.members["wordPolicy"], self.word_policy - ) - - if self.sensitive_information_policy is not None: - serializer.write_struct( - _SCHEMA_GUARDRAIL_ASSESSMENT.members["sensitiveInformationPolicy"], - self.sensitive_information_policy, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["topic_policy"] = GuardrailTopicPolicyAssessment.deserialize( - de - ) - - case 1: - kwargs["content_policy"] = ( - GuardrailContentPolicyAssessment.deserialize(de) - ) - - case 2: - kwargs["word_policy"] = GuardrailWordPolicyAssessment.deserialize( - de - ) - - case 3: - kwargs["sensitive_information_policy"] = ( - GuardrailSensitiveInformationPolicyAssessment.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GUARDRAIL_ASSESSMENT, consumer=_consumer) - return kwargs - - -def _serialize_guardrail_assessment_list( - serializer: ShapeSerializer, schema: Schema, value: list[GuardrailAssessment] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_guardrail_assessment_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GuardrailAssessment]: - result: list[GuardrailAssessment] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GuardrailAssessment.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GuardrailTrace: - """The trace details used in the Guardrail.""" - - action: str | None = None - """The trace action details used with the Guardrail.""" - - trace_id: str | None = None - """The details of the trace Id used in the Guardrail Trace.""" - - input_assessments: list[GuardrailAssessment] | None = None - """The details of the input assessments used in the Guardrail Trace.""" - - output_assessments: list[GuardrailAssessment] | None = None - """The details of the output assessments used in the Guardrail Trace.""" - - metadata: Metadata | None = field(repr=False, default=None) - """Contains information about the Guardrail output.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_TRACE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.action is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_TRACE.members["action"], self.action - ) - - if self.trace_id is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_TRACE.members["traceId"], self.trace_id - ) - - if self.input_assessments is not None: - _serialize_guardrail_assessment_list( - serializer, - _SCHEMA_GUARDRAIL_TRACE.members["inputAssessments"], - self.input_assessments, - ) - - if self.output_assessments is not None: - _serialize_guardrail_assessment_list( - serializer, - _SCHEMA_GUARDRAIL_TRACE.members["outputAssessments"], - self.output_assessments, - ) - - if self.metadata is not None: - serializer.write_struct( - _SCHEMA_GUARDRAIL_TRACE.members["metadata"], self.metadata - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["action"] = GuardrailAction( - de.read_string(_SCHEMA_GUARDRAIL_TRACE.members["action"]) - ) - - case 1: - kwargs["trace_id"] = de.read_string( - _SCHEMA_GUARDRAIL_TRACE.members["traceId"] - ) - - case 2: - kwargs["input_assessments"] = ( - _deserialize_guardrail_assessment_list( - de, _SCHEMA_GUARDRAIL_TRACE.members["inputAssessments"] - ) - ) - - case 3: - kwargs["output_assessments"] = ( - _deserialize_guardrail_assessment_list( - de, _SCHEMA_GUARDRAIL_TRACE.members["outputAssessments"] - ) - ) - - case 4: - kwargs["metadata"] = Metadata.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GUARDRAIL_TRACE, consumer=_consumer) - return kwargs - - -def _serialize_files( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_files(deserializer: ShapeDeserializer, schema: Schema) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CodeInterpreterInvocationInput: - """Contains information about the code interpreter being invoked.""" - - code: str | None = None - """The code for the code interpreter to use.""" - - files: list[str] | None = None - """Files that are uploaded for code interpreter to use.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CODE_INTERPRETER_INVOCATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.code is not None: - serializer.write_string( - _SCHEMA_CODE_INTERPRETER_INVOCATION_INPUT.members["code"], self.code - ) - - if self.files is not None: - _serialize_files( - serializer, - _SCHEMA_CODE_INTERPRETER_INVOCATION_INPUT.members["files"], - self.files, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["code"] = de.read_string( - _SCHEMA_CODE_INTERPRETER_INVOCATION_INPUT.members["code"] - ) - - case 1: - kwargs["files"] = _deserialize_files( - de, _SCHEMA_CODE_INTERPRETER_INVOCATION_INPUT.members["files"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CODE_INTERPRETER_INVOCATION_INPUT, consumer=_consumer - ) - return kwargs - - -class InvocationType(UnknownEnumMixin, StrEnum): - ACTION_GROUP = "ACTION_GROUP" - KNOWLEDGE_BASE = "KNOWLEDGE_BASE" - FINISH = "FINISH" - ACTION_GROUP_CODE_INTERPRETER = "ACTION_GROUP_CODE_INTERPRETER" - AGENT_COLLABORATOR = "AGENT_COLLABORATOR" - - -@dataclass(kw_only=True) -class KnowledgeBaseLookupInput: - """ - Contains details about the knowledge base to look up and the query to be - made. - """ - - text: str | None = field(repr=False, default=None) - """The query made to the knowledge base.""" - - knowledge_base_id: str | None = field(repr=False, default=None) - """The unique identifier of the knowledge base to look up.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KNOWLEDGE_BASE_LOOKUP_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.text is not None: - serializer.write_string( - _SCHEMA_KNOWLEDGE_BASE_LOOKUP_INPUT.members["text"], self.text - ) - - if self.knowledge_base_id is not None: - serializer.write_string( - _SCHEMA_KNOWLEDGE_BASE_LOOKUP_INPUT.members["knowledgeBaseId"], - self.knowledge_base_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["text"] = de.read_string( - _SCHEMA_KNOWLEDGE_BASE_LOOKUP_INPUT.members["text"] - ) - - case 1: - kwargs["knowledge_base_id"] = de.read_string( - _SCHEMA_KNOWLEDGE_BASE_LOOKUP_INPUT.members["knowledgeBaseId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_KNOWLEDGE_BASE_LOOKUP_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InvocationInput: - """ - Contains information pertaining to the action group or knowledge base - that is being invoked. - """ - - trace_id: str | None = None - """The unique identifier of the trace.""" - - invocation_type: str | None = None - """ - Specifies whether the agent is invoking an action group or a knowledge - base. - """ - - action_group_invocation_input: ActionGroupInvocationInput | None = None - """Contains information about the action group to be invoked.""" - - knowledge_base_lookup_input: KnowledgeBaseLookupInput | None = None - """ - Contains details about the knowledge base to look up and the query to be - made. - """ - - code_interpreter_invocation_input: CodeInterpreterInvocationInput | None = None - """Contains information about the code interpreter to be invoked.""" - - agent_collaborator_invocation_input: AgentCollaboratorInvocationInput | None = None - """The collaborator's invocation input.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOCATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.trace_id is not None: - serializer.write_string( - _SCHEMA_INVOCATION_INPUT.members["traceId"], self.trace_id - ) - - if self.invocation_type is not None: - serializer.write_string( - _SCHEMA_INVOCATION_INPUT.members["invocationType"], self.invocation_type - ) - - if self.action_group_invocation_input is not None: - serializer.write_struct( - _SCHEMA_INVOCATION_INPUT.members["actionGroupInvocationInput"], - self.action_group_invocation_input, - ) - - if self.knowledge_base_lookup_input is not None: - serializer.write_struct( - _SCHEMA_INVOCATION_INPUT.members["knowledgeBaseLookupInput"], - self.knowledge_base_lookup_input, - ) - - if self.code_interpreter_invocation_input is not None: - serializer.write_struct( - _SCHEMA_INVOCATION_INPUT.members["codeInterpreterInvocationInput"], - self.code_interpreter_invocation_input, - ) - - if self.agent_collaborator_invocation_input is not None: - serializer.write_struct( - _SCHEMA_INVOCATION_INPUT.members["agentCollaboratorInvocationInput"], - self.agent_collaborator_invocation_input, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["trace_id"] = de.read_string( - _SCHEMA_INVOCATION_INPUT.members["traceId"] - ) - - case 1: - kwargs["invocation_type"] = InvocationType( - de.read_string( - _SCHEMA_INVOCATION_INPUT.members["invocationType"] - ) - ) - - case 2: - kwargs["action_group_invocation_input"] = ( - ActionGroupInvocationInput.deserialize(de) - ) - - case 3: - kwargs["knowledge_base_lookup_input"] = ( - KnowledgeBaseLookupInput.deserialize(de) - ) - - case 4: - kwargs["code_interpreter_invocation_input"] = ( - CodeInterpreterInvocationInput.deserialize(de) - ) - - case 5: - kwargs["agent_collaborator_invocation_input"] = ( - AgentCollaboratorInvocationInput.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INVOCATION_INPUT, consumer=_consumer) - return kwargs - - -def _serialize_stop_sequences( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_stop_sequences( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class InferenceConfiguration: - """ - Specifications about the inference parameters that were provided - alongside the prompt. These are specified in the - [PromptOverrideConfiguration](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptOverrideConfiguration.html) - object that was set when the agent was created or updated. For more - information, see [Inference parameters for foundation - models](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). - """ - - temperature: float | None = None - """ - The likelihood of the model selecting higher-probability options while - generating a response. A lower value makes the model more likely to - choose higher-probability options, while a higher value makes the model - more likely to choose lower-probability options. - """ - - top_p: float | None = None - """ - While generating a response, the model determines the probability of the - following token at each point of generation. The value that you set for - `Top P` determines the number of most-likely candidates from which the - model chooses the next token in the sequence. For example, if you set - `topP` to 0.8, the model only selects the next token from the top 80% of - the probability distribution of next tokens. - """ - - top_k: int | None = None - """ - While generating a response, the model determines the probability of the - following token at each point of generation. The value that you set for - `topK` is the number of most-likely candidates from which the model - chooses the next token in the sequence. For example, if you set `topK` - to 50, the model selects the next token from among the top 50 most - likely choices. - """ - - maximum_length: int | None = None - """The maximum number of tokens allowed in the generated response.""" - - stop_sequences: list[str] | None = None - """ - A list of stop sequences. A stop sequence is a sequence of characters - that causes the model to stop generating the response. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INFERENCE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.temperature is not None: - serializer.write_float( - _SCHEMA_INFERENCE_CONFIGURATION.members["temperature"], self.temperature - ) - - if self.top_p is not None: - serializer.write_float( - _SCHEMA_INFERENCE_CONFIGURATION.members["topP"], self.top_p - ) - - if self.top_k is not None: - serializer.write_integer( - _SCHEMA_INFERENCE_CONFIGURATION.members["topK"], self.top_k - ) - - if self.maximum_length is not None: - serializer.write_integer( - _SCHEMA_INFERENCE_CONFIGURATION.members["maximumLength"], - self.maximum_length, - ) - - if self.stop_sequences is not None: - _serialize_stop_sequences( - serializer, - _SCHEMA_INFERENCE_CONFIGURATION.members["stopSequences"], - self.stop_sequences, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["temperature"] = de.read_float( - _SCHEMA_INFERENCE_CONFIGURATION.members["temperature"] - ) - - case 1: - kwargs["top_p"] = de.read_float( - _SCHEMA_INFERENCE_CONFIGURATION.members["topP"] - ) - - case 2: - kwargs["top_k"] = de.read_integer( - _SCHEMA_INFERENCE_CONFIGURATION.members["topK"] - ) - - case 3: - kwargs["maximum_length"] = de.read_integer( - _SCHEMA_INFERENCE_CONFIGURATION.members["maximumLength"] - ) - - case 4: - kwargs["stop_sequences"] = _deserialize_stop_sequences( - de, _SCHEMA_INFERENCE_CONFIGURATION.members["stopSequences"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INFERENCE_CONFIGURATION, consumer=_consumer) - return kwargs - - -class CreationMode(UnknownEnumMixin, StrEnum): - DEFAULT = "DEFAULT" - OVERRIDDEN = "OVERRIDDEN" - - -class PromptType(UnknownEnumMixin, StrEnum): - PRE_PROCESSING = "PRE_PROCESSING" - ORCHESTRATION = "ORCHESTRATION" - KNOWLEDGE_BASE_RESPONSE_GENERATION = "KNOWLEDGE_BASE_RESPONSE_GENERATION" - POST_PROCESSING = "POST_PROCESSING" - ROUTING_CLASSIFIER = "ROUTING_CLASSIFIER" - - -@dataclass(kw_only=True) -class ModelInvocationInput: - """ - The input for the pre-processing step. - - - The `type` matches the agent step. - - - The `text` contains the prompt. - - - The `inferenceConfiguration`, `parserMode`, and `overrideLambda` - values are set in the - [PromptOverrideConfiguration](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptOverrideConfiguration.html) - object that was set when the agent was created or updated. - """ - - trace_id: str | None = None - """The unique identifier of the trace.""" - - text: str | None = field(repr=False, default=None) - """The text that prompted the agent at this step.""" - - type: str | None = None - """The step in the agent sequence.""" - - override_lambda: str | None = None - """ - The ARN of the Lambda function to use when parsing the raw foundation - model output in parts of the agent sequence. - """ - - prompt_creation_mode: str | None = None - """ - Specifies whether the default prompt template was `OVERRIDDEN`. If it - was, the `basePromptTemplate` that was set in the - [PromptOverrideConfiguration](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptOverrideConfiguration.html) - object when the agent was created or updated is used instead. - """ - - inference_configuration: InferenceConfiguration | None = None - """ - Specifications about the inference parameters that were provided - alongside the prompt. These are specified in the - [PromptOverrideConfiguration](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptOverrideConfiguration.html) - object that was set when the agent was created or updated. For more - information, see [Inference parameters for foundation - models](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). - """ - - parser_mode: str | None = None - """ - Specifies whether to override the default parser Lambda function when - parsing the raw foundation model output in the part of the agent - sequence defined by the `promptType`. - """ - - foundation_model: str | None = None - """The identifier of a foundation model.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MODEL_INVOCATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.trace_id is not None: - serializer.write_string( - _SCHEMA_MODEL_INVOCATION_INPUT.members["traceId"], self.trace_id - ) - - if self.text is not None: - serializer.write_string( - _SCHEMA_MODEL_INVOCATION_INPUT.members["text"], self.text - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_MODEL_INVOCATION_INPUT.members["type"], self.type - ) - - if self.override_lambda is not None: - serializer.write_string( - _SCHEMA_MODEL_INVOCATION_INPUT.members["overrideLambda"], - self.override_lambda, - ) - - if self.prompt_creation_mode is not None: - serializer.write_string( - _SCHEMA_MODEL_INVOCATION_INPUT.members["promptCreationMode"], - self.prompt_creation_mode, - ) - - if self.inference_configuration is not None: - serializer.write_struct( - _SCHEMA_MODEL_INVOCATION_INPUT.members["inferenceConfiguration"], - self.inference_configuration, - ) - - if self.parser_mode is not None: - serializer.write_string( - _SCHEMA_MODEL_INVOCATION_INPUT.members["parserMode"], self.parser_mode - ) - - if self.foundation_model is not None: - serializer.write_string( - _SCHEMA_MODEL_INVOCATION_INPUT.members["foundationModel"], - self.foundation_model, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["trace_id"] = de.read_string( - _SCHEMA_MODEL_INVOCATION_INPUT.members["traceId"] - ) - - case 1: - kwargs["text"] = de.read_string( - _SCHEMA_MODEL_INVOCATION_INPUT.members["text"] - ) - - case 2: - kwargs["type"] = PromptType( - de.read_string(_SCHEMA_MODEL_INVOCATION_INPUT.members["type"]) - ) - - case 3: - kwargs["override_lambda"] = de.read_string( - _SCHEMA_MODEL_INVOCATION_INPUT.members["overrideLambda"] - ) - - case 4: - kwargs["prompt_creation_mode"] = CreationMode( - de.read_string( - _SCHEMA_MODEL_INVOCATION_INPUT.members["promptCreationMode"] - ) - ) - - case 5: - kwargs["inference_configuration"] = ( - InferenceConfiguration.deserialize(de) - ) - - case 6: - kwargs["parser_mode"] = CreationMode( - de.read_string( - _SCHEMA_MODEL_INVOCATION_INPUT.members["parserMode"] - ) - ) - - case 7: - kwargs["foundation_model"] = de.read_string( - _SCHEMA_MODEL_INVOCATION_INPUT.members["foundationModel"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MODEL_INVOCATION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class RawResponse: - """Contains the raw output from the foundation model.""" - - content: str | None = None - """The foundation model's raw output content.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RAW_RESPONSE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.content is not None: - serializer.write_string( - _SCHEMA_RAW_RESPONSE.members["content"], self.content - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["content"] = de.read_string( - _SCHEMA_RAW_RESPONSE.members["content"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RAW_RESPONSE, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ReasoningTextBlock: - """ - Contains information about the reasoning that the model used to return - the content in the content block. - """ - - text: str - """ - Text describing the reasoning that the model used to return the content - in the content block. - """ - - signature: str | None = None - """ - A hash of all the messages in the conversation to ensure that the - content in the reasoning text block isn't tampered with. You must - submit the signature in subsequent `Converse` requests, in addition to - the previous messages. If the previous messages are tampered with, the - response throws an error. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REASONING_TEXT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_REASONING_TEXT_BLOCK.members["text"], self.text) - if self.signature is not None: - serializer.write_string( - _SCHEMA_REASONING_TEXT_BLOCK.members["signature"], self.signature - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["text"] = de.read_string( - _SCHEMA_REASONING_TEXT_BLOCK.members["text"] - ) - - case 1: - kwargs["signature"] = de.read_string( - _SCHEMA_REASONING_TEXT_BLOCK.members["signature"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_REASONING_TEXT_BLOCK, consumer=_consumer) - if "text" not in kwargs: - kwargs["text"] = "" - return kwargs - - -@dataclass -class ReasoningContentBlockReasoningText: - """ - Contains information about the reasoning that the model used to return - the content in the content block. - """ - - value: ReasoningTextBlock - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REASONING_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_REASONING_CONTENT_BLOCK.members["reasoningText"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ReasoningTextBlock.deserialize(deserializer)) - - -@dataclass -class ReasoningContentBlockRedactedContent: - """ - The content in the reasoning that was encrypted by the model provider - for trust and safety reasons. - """ - - value: bytes - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REASONING_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_blob( - _SCHEMA_REASONING_CONTENT_BLOCK.members["redactedContent"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_blob( - _SCHEMA_REASONING_CONTENT_BLOCK.members["redactedContent"] - ) - ) - - -@dataclass -class ReasoningContentBlockUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ReasoningContentBlock = Union[ - ReasoningContentBlockReasoningText - | ReasoningContentBlockRedactedContent - | ReasoningContentBlockUnknown -] -""" -Contains content regarding the reasoning that the foundation model made -with respect to the content in the content block. Reasoning refers to a -Chain of Thought (CoT) that the model generates to enhance the accuracy -of its final response. -""" - - -class _ReasoningContentBlockDeserializer: - _result: ReasoningContentBlock | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> ReasoningContentBlock: - self._result = None - deserializer.read_struct(_SCHEMA_REASONING_CONTENT_BLOCK, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(ReasoningContentBlockReasoningText.deserialize(de)) - - case 1: - self._set_result(ReasoningContentBlockRedactedContent.deserialize(de)) - - case _: - self._set_result( - ReasoningContentBlockUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: ReasoningContentBlock) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class OrchestrationModelInvocationOutput: - """The foundation model output from the orchestration step.""" - - trace_id: str | None = None - """The unique identifier of the trace.""" - - raw_response: RawResponse | None = field(repr=False, default=None) - """Contains details of the raw response from the foundation model output.""" - - metadata: Metadata | None = field(repr=False, default=None) - """ - Contains information about the foundation model output from the - orchestration step. - """ - - reasoning_content: ReasoningContentBlock | None = field(repr=False, default=None) - """ - Contains content about the reasoning that the model made during the - orchestration step. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ORCHESTRATION_MODEL_INVOCATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.trace_id is not None: - serializer.write_string( - _SCHEMA_ORCHESTRATION_MODEL_INVOCATION_OUTPUT.members["traceId"], - self.trace_id, - ) - - if self.raw_response is not None: - serializer.write_struct( - _SCHEMA_ORCHESTRATION_MODEL_INVOCATION_OUTPUT.members["rawResponse"], - self.raw_response, - ) - - if self.metadata is not None: - serializer.write_struct( - _SCHEMA_ORCHESTRATION_MODEL_INVOCATION_OUTPUT.members["metadata"], - self.metadata, - ) - - if self.reasoning_content is not None: - serializer.write_struct( - _SCHEMA_ORCHESTRATION_MODEL_INVOCATION_OUTPUT.members[ - "reasoningContent" - ], - self.reasoning_content, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["trace_id"] = de.read_string( - _SCHEMA_ORCHESTRATION_MODEL_INVOCATION_OUTPUT.members["traceId"] - ) - - case 1: - kwargs["raw_response"] = RawResponse.deserialize(de) - - case 2: - kwargs["metadata"] = Metadata.deserialize(de) - - case 3: - kwargs["reasoning_content"] = ( - _ReasoningContentBlockDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ORCHESTRATION_MODEL_INVOCATION_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CodeInterpreterInvocationOutput: - """ - Contains the JSON-formatted string returned by the API invoked by the - code interpreter. - """ - - execution_output: str | None = None - """Contains the successful output returned from code execution""" - - execution_error: str | None = None - """Contains the error returned from code execution.""" - - files: list[str] | None = None - """Contains output files, if generated by code execution.""" - - execution_timeout: bool | None = None - """Indicates if the execution of the code timed out.""" - - metadata: Metadata | None = field(repr=False, default=None) - """Contains information about the output from the code interpreter.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CODE_INTERPRETER_INVOCATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.execution_output is not None: - serializer.write_string( - _SCHEMA_CODE_INTERPRETER_INVOCATION_OUTPUT.members["executionOutput"], - self.execution_output, - ) - - if self.execution_error is not None: - serializer.write_string( - _SCHEMA_CODE_INTERPRETER_INVOCATION_OUTPUT.members["executionError"], - self.execution_error, - ) - - if self.files is not None: - _serialize_files( - serializer, - _SCHEMA_CODE_INTERPRETER_INVOCATION_OUTPUT.members["files"], - self.files, - ) - - if self.execution_timeout is not None: - serializer.write_boolean( - _SCHEMA_CODE_INTERPRETER_INVOCATION_OUTPUT.members["executionTimeout"], - self.execution_timeout, - ) - - if self.metadata is not None: - serializer.write_struct( - _SCHEMA_CODE_INTERPRETER_INVOCATION_OUTPUT.members["metadata"], - self.metadata, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["execution_output"] = de.read_string( - _SCHEMA_CODE_INTERPRETER_INVOCATION_OUTPUT.members[ - "executionOutput" - ] - ) - - case 1: - kwargs["execution_error"] = de.read_string( - _SCHEMA_CODE_INTERPRETER_INVOCATION_OUTPUT.members[ - "executionError" - ] - ) - - case 2: - kwargs["files"] = _deserialize_files( - de, _SCHEMA_CODE_INTERPRETER_INVOCATION_OUTPUT.members["files"] - ) - - case 3: - kwargs["execution_timeout"] = de.read_boolean( - _SCHEMA_CODE_INTERPRETER_INVOCATION_OUTPUT.members[ - "executionTimeout" - ] - ) - - case 4: - kwargs["metadata"] = Metadata.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CODE_INTERPRETER_INVOCATION_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class FinalResponse: - """Contains details about the response to the user.""" - - text: str | None = field(repr=False, default=None) - """The text in the response to the user.""" - - metadata: Metadata | None = field(repr=False, default=None) - """Contains information about the invoke agent operation.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FINAL_RESPONSE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.text is not None: - serializer.write_string(_SCHEMA_FINAL_RESPONSE.members["text"], self.text) - - if self.metadata is not None: - serializer.write_struct( - _SCHEMA_FINAL_RESPONSE.members["metadata"], self.metadata - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["text"] = de.read_string( - _SCHEMA_FINAL_RESPONSE.members["text"] - ) - - case 1: - kwargs["metadata"] = Metadata.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FINAL_RESPONSE, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class AudioSegment: - """ - Contains information about an audio segment retrieved from a knowledge - base, including its location and transcription. - - This data type is used in the following API operations: - - - [Retrieve - response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax) - -- in the `audio` field - """ - - s3_uri: str - """ - The S3 URI where this specific audio segment is stored in the multimodal - storage destination. - """ - - transcription: str | None = None - """The text transcription of the audio segment content.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUDIO_SEGMENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_AUDIO_SEGMENT.members["s3Uri"], self.s3_uri) - if self.transcription is not None: - serializer.write_string( - _SCHEMA_AUDIO_SEGMENT.members["transcription"], self.transcription - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["s3_uri"] = de.read_string( - _SCHEMA_AUDIO_SEGMENT.members["s3Uri"] - ) - - case 1: - kwargs["transcription"] = de.read_string( - _SCHEMA_AUDIO_SEGMENT.members["transcription"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AUDIO_SEGMENT, consumer=_consumer) - if "s3_uri" not in kwargs: - kwargs["s3_uri"] = "" - return kwargs - - -class RetrievalResultContentColumnType(UnknownEnumMixin, StrEnum): - BLOB = "BLOB" - BOOLEAN = "BOOLEAN" - DOUBLE = "DOUBLE" - NULL = "NULL" - LONG = "LONG" - STRING = "STRING" - - -@dataclass(kw_only=True) -class RetrievalResultContentColumn: - """Contains information about a column with a cell to return in retrieval.""" - - column_name: str | None = None - """The name of the column.""" - - column_value: str | None = None - """The value in the column.""" - - type: str | None = None - """The data type of the value.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVAL_RESULT_CONTENT_COLUMN, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.column_name is not None: - serializer.write_string( - _SCHEMA_RETRIEVAL_RESULT_CONTENT_COLUMN.members["columnName"], - self.column_name, - ) - - if self.column_value is not None: - serializer.write_string( - _SCHEMA_RETRIEVAL_RESULT_CONTENT_COLUMN.members["columnValue"], - self.column_value, - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_RETRIEVAL_RESULT_CONTENT_COLUMN.members["type"], self.type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["column_name"] = de.read_string( - _SCHEMA_RETRIEVAL_RESULT_CONTENT_COLUMN.members["columnName"] - ) - - case 1: - kwargs["column_value"] = de.read_string( - _SCHEMA_RETRIEVAL_RESULT_CONTENT_COLUMN.members["columnValue"] - ) - - case 2: - kwargs["type"] = RetrievalResultContentColumnType( - de.read_string( - _SCHEMA_RETRIEVAL_RESULT_CONTENT_COLUMN.members["type"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RETRIEVAL_RESULT_CONTENT_COLUMN, consumer=_consumer - ) - return kwargs - - -def _serialize_retrieval_result_content_row( - serializer: ShapeSerializer, - schema: Schema, - value: list[RetrievalResultContentColumn], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_retrieval_result_content_row( - deserializer: ShapeDeserializer, schema: Schema -) -> list[RetrievalResultContentColumn]: - result: list[RetrievalResultContentColumn] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(RetrievalResultContentColumn.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class RetrievalResultContentType(UnknownEnumMixin, StrEnum): - TEXT = "TEXT" - IMAGE = "IMAGE" - ROW = "ROW" - AUDIO = "AUDIO" - VIDEO = "VIDEO" - - -@dataclass(kw_only=True) -class VideoSegment: - """ - Contains information about a video segment retrieved from a knowledge - base, including its location and summary. - - This data type is used in the following API operations: - - - [Retrieve - response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax) - -- in the `video` field - """ - - s3_uri: str - """ - The S3 URI where this specific video segment is stored in the multimodal - storage destination. - """ - - summary: str | None = None - """A text summary describing the content of the video segment.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VIDEO_SEGMENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_VIDEO_SEGMENT.members["s3Uri"], self.s3_uri) - if self.summary is not None: - serializer.write_string( - _SCHEMA_VIDEO_SEGMENT.members["summary"], self.summary - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["s3_uri"] = de.read_string( - _SCHEMA_VIDEO_SEGMENT.members["s3Uri"] - ) - - case 1: - kwargs["summary"] = de.read_string( - _SCHEMA_VIDEO_SEGMENT.members["summary"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VIDEO_SEGMENT, consumer=_consumer) - if "s3_uri" not in kwargs: - kwargs["s3_uri"] = "" - return kwargs - - -@dataclass(kw_only=True) -class RetrievalResultContent: - """ - Contains information about a chunk of text from a data source in the - knowledge base. If the result is from a structured data source, the cell - in the database and the type of the value is also identified. - - This data type is used in the following API operations: - - - [Retrieve - response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax) - -- in the `content` field - - - [RetrieveAndGenerate - response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax) - -- in the `content` field - - - [InvokeAgent - response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax) - -- in the `content` field - """ - - type: str | None = None - """The type of content in the retrieval result.""" - - text: str = "" - """The cited text from the data source.""" - - byte_content: str | None = None - """ - A data URI with base64-encoded content from the data source. The URI is - in the following format: returned in the following format: - `data:image/jpeg;base64,${base64-encoded string}`. - """ - - video: VideoSegment | None = None - """ - Video segment information when the retrieval result contains video - content. - """ - - audio: AudioSegment | None = None - """ - Audio segment information when the retrieval result contains audio - content. - """ - - row: list[RetrievalResultContentColumn] | None = field(repr=False, default=None) - """ - Specifies information about the rows with the cells to return in - retrieval. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVAL_RESULT_CONTENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_RETRIEVAL_RESULT_CONTENT.members["type"], self.type - ) - - serializer.write_string( - _SCHEMA_RETRIEVAL_RESULT_CONTENT.members["text"], self.text - ) - if self.byte_content is not None: - serializer.write_string( - _SCHEMA_RETRIEVAL_RESULT_CONTENT.members["byteContent"], - self.byte_content, - ) - - if self.video is not None: - serializer.write_struct( - _SCHEMA_RETRIEVAL_RESULT_CONTENT.members["video"], self.video - ) - - if self.audio is not None: - serializer.write_struct( - _SCHEMA_RETRIEVAL_RESULT_CONTENT.members["audio"], self.audio - ) - - if self.row is not None: - _serialize_retrieval_result_content_row( - serializer, _SCHEMA_RETRIEVAL_RESULT_CONTENT.members["row"], self.row - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = RetrievalResultContentType( - de.read_string(_SCHEMA_RETRIEVAL_RESULT_CONTENT.members["type"]) - ) - - case 1: - kwargs["text"] = de.read_string( - _SCHEMA_RETRIEVAL_RESULT_CONTENT.members["text"] - ) - - case 2: - kwargs["byte_content"] = de.read_string( - _SCHEMA_RETRIEVAL_RESULT_CONTENT.members["byteContent"] - ) - - case 3: - kwargs["video"] = VideoSegment.deserialize(de) - - case 4: - kwargs["audio"] = AudioSegment.deserialize(de) - - case 5: - kwargs["row"] = _deserialize_retrieval_result_content_row( - de, _SCHEMA_RETRIEVAL_RESULT_CONTENT.members["row"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RETRIEVAL_RESULT_CONTENT, consumer=_consumer) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls() - - -@dataclass(kw_only=True) -class RetrievalResultConfluenceLocation: - """The Confluence data source location.""" - - url: str | None = None - """The Confluence host URL for the data source location.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVAL_RESULT_CONFLUENCE_LOCATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.url is not None: - serializer.write_string( - _SCHEMA_RETRIEVAL_RESULT_CONFLUENCE_LOCATION.members["url"], self.url - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["url"] = de.read_string( - _SCHEMA_RETRIEVAL_RESULT_CONFLUENCE_LOCATION.members["url"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RETRIEVAL_RESULT_CONFLUENCE_LOCATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class RetrievalResultCustomDocumentLocation: - """ - Contains information about the location of a document in a custom data - source. - """ - - id: str | None = None - """The ID of the document.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVAL_RESULT_CUSTOM_DOCUMENT_LOCATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string( - _SCHEMA_RETRIEVAL_RESULT_CUSTOM_DOCUMENT_LOCATION.members["id"], self.id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_RETRIEVAL_RESULT_CUSTOM_DOCUMENT_LOCATION.members["id"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RETRIEVAL_RESULT_CUSTOM_DOCUMENT_LOCATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class RetrievalResultGoogleDriveLocation: - """The Google Drive location of a retrieval result.""" - - url: str | None = None - """The Google Drive URL for the data source location.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVAL_RESULT_GOOGLE_DRIVE_LOCATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.url is not None: - serializer.write_string( - _SCHEMA_RETRIEVAL_RESULT_GOOGLE_DRIVE_LOCATION.members["url"], self.url - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["url"] = de.read_string( - _SCHEMA_RETRIEVAL_RESULT_GOOGLE_DRIVE_LOCATION.members["url"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RETRIEVAL_RESULT_GOOGLE_DRIVE_LOCATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class RetrievalResultKendraDocumentLocation: - """The location of a result in Amazon Kendra.""" - - uri: str | None = None - """The document's uri.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVAL_RESULT_KENDRA_DOCUMENT_LOCATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.uri is not None: - serializer.write_string( - _SCHEMA_RETRIEVAL_RESULT_KENDRA_DOCUMENT_LOCATION.members["uri"], - self.uri, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["uri"] = de.read_string( - _SCHEMA_RETRIEVAL_RESULT_KENDRA_DOCUMENT_LOCATION.members["uri"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RETRIEVAL_RESULT_KENDRA_DOCUMENT_LOCATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class RetrievalResultOneDriveLocation: - """The Microsoft OneDrive location of a retrieval result.""" - - url: str | None = None - """The OneDrive URL for the data source location.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVAL_RESULT_ONE_DRIVE_LOCATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.url is not None: - serializer.write_string( - _SCHEMA_RETRIEVAL_RESULT_ONE_DRIVE_LOCATION.members["url"], self.url - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["url"] = de.read_string( - _SCHEMA_RETRIEVAL_RESULT_ONE_DRIVE_LOCATION.members["url"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RETRIEVAL_RESULT_ONE_DRIVE_LOCATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class RetrievalResultS3Location: - """ - The S3 data source location. - - This data type is used in the following API operations: - - - [Retrieve - response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax) - -- in the `s3Location` field - - - [RetrieveAndGenerate - response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax) - -- in the `s3Location` field - - - [InvokeAgent - response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax) - -- in the `s3Location` field - """ - - uri: str | None = None - """The S3 URI for the data source location.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVAL_RESULT_S3_LOCATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.uri is not None: - serializer.write_string( - _SCHEMA_RETRIEVAL_RESULT_S3_LOCATION.members["uri"], self.uri - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["uri"] = de.read_string( - _SCHEMA_RETRIEVAL_RESULT_S3_LOCATION.members["uri"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RETRIEVAL_RESULT_S3_LOCATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class RetrievalResultSalesforceLocation: - """The Salesforce data source location.""" - - url: str | None = None - """The Salesforce host URL for the data source location.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVAL_RESULT_SALESFORCE_LOCATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.url is not None: - serializer.write_string( - _SCHEMA_RETRIEVAL_RESULT_SALESFORCE_LOCATION.members["url"], self.url - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["url"] = de.read_string( - _SCHEMA_RETRIEVAL_RESULT_SALESFORCE_LOCATION.members["url"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RETRIEVAL_RESULT_SALESFORCE_LOCATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class RetrievalResultSharePointLocation: - """The SharePoint data source location.""" - - url: str | None = None - """The SharePoint site URL for the data source location.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVAL_RESULT_SHARE_POINT_LOCATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.url is not None: - serializer.write_string( - _SCHEMA_RETRIEVAL_RESULT_SHARE_POINT_LOCATION.members["url"], self.url - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["url"] = de.read_string( - _SCHEMA_RETRIEVAL_RESULT_SHARE_POINT_LOCATION.members["url"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RETRIEVAL_RESULT_SHARE_POINT_LOCATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class RetrievalResultSqlLocation: - """Contains information about the SQL query used to retrieve the result.""" - - query: str | None = None - """The SQL query used to retrieve the result.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVAL_RESULT_SQL_LOCATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.query is not None: - serializer.write_string( - _SCHEMA_RETRIEVAL_RESULT_SQL_LOCATION.members["query"], self.query - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["query"] = de.read_string( - _SCHEMA_RETRIEVAL_RESULT_SQL_LOCATION.members["query"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RETRIEVAL_RESULT_SQL_LOCATION, consumer=_consumer - ) - return kwargs - - -class RetrievalResultLocationType(UnknownEnumMixin, StrEnum): - S3 = "S3" - WEB = "WEB" - CONFLUENCE = "CONFLUENCE" - SALESFORCE = "SALESFORCE" - SHAREPOINT = "SHAREPOINT" - CUSTOM = "CUSTOM" - KENDRA = "KENDRA" - SQL = "SQL" - ONEDRIVE = "ONEDRIVE" - GOOGLEDRIVE = "GOOGLEDRIVE" - - -@dataclass(kw_only=True) -class RetrievalResultWebLocation: - """The web URL/URLs data source location.""" - - url: str | None = None - """The web URL/URLs for the data source location.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVAL_RESULT_WEB_LOCATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.url is not None: - serializer.write_string( - _SCHEMA_RETRIEVAL_RESULT_WEB_LOCATION.members["url"], self.url - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["url"] = de.read_string( - _SCHEMA_RETRIEVAL_RESULT_WEB_LOCATION.members["url"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RETRIEVAL_RESULT_WEB_LOCATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class RetrievalResultLocation: - """ - Contains information about the data source location. - - This data type is used in the following API operations: - - - [Retrieve - response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax) - -- in the `location` field - - - [RetrieveAndGenerate - response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax) - -- in the `location` field - - - [InvokeAgent - response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax) - -- in the `location` field - """ - - type: str - """The type of data source location.""" - - s3_location: RetrievalResultS3Location | None = None - """The S3 data source location.""" - - web_location: RetrievalResultWebLocation | None = None - """The web URL/URLs data source location.""" - - confluence_location: RetrievalResultConfluenceLocation | None = None - """The Confluence data source location.""" - - salesforce_location: RetrievalResultSalesforceLocation | None = None - """The Salesforce data source location.""" - - share_point_location: RetrievalResultSharePointLocation | None = None - """The SharePoint data source location.""" - - custom_document_location: RetrievalResultCustomDocumentLocation | None = None - """Specifies the location of a document in a custom data source.""" - - kendra_document_location: RetrievalResultKendraDocumentLocation | None = None - """The location of a document in Amazon Kendra.""" - - sql_location: RetrievalResultSqlLocation | None = None - """Specifies information about the SQL query used to retrieve the result.""" - - one_drive_location: RetrievalResultOneDriveLocation | None = None - """The Microsoft OneDrive data source location.""" - - google_drive_location: RetrievalResultGoogleDriveLocation | None = None - """The Google Drive data source location.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVAL_RESULT_LOCATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_RETRIEVAL_RESULT_LOCATION.members["type"], self.type - ) - if self.s3_location is not None: - serializer.write_struct( - _SCHEMA_RETRIEVAL_RESULT_LOCATION.members["s3Location"], - self.s3_location, - ) - - if self.web_location is not None: - serializer.write_struct( - _SCHEMA_RETRIEVAL_RESULT_LOCATION.members["webLocation"], - self.web_location, - ) - - if self.confluence_location is not None: - serializer.write_struct( - _SCHEMA_RETRIEVAL_RESULT_LOCATION.members["confluenceLocation"], - self.confluence_location, - ) - - if self.salesforce_location is not None: - serializer.write_struct( - _SCHEMA_RETRIEVAL_RESULT_LOCATION.members["salesforceLocation"], - self.salesforce_location, - ) - - if self.share_point_location is not None: - serializer.write_struct( - _SCHEMA_RETRIEVAL_RESULT_LOCATION.members["sharePointLocation"], - self.share_point_location, - ) - - if self.custom_document_location is not None: - serializer.write_struct( - _SCHEMA_RETRIEVAL_RESULT_LOCATION.members["customDocumentLocation"], - self.custom_document_location, - ) - - if self.kendra_document_location is not None: - serializer.write_struct( - _SCHEMA_RETRIEVAL_RESULT_LOCATION.members["kendraDocumentLocation"], - self.kendra_document_location, - ) - - if self.sql_location is not None: - serializer.write_struct( - _SCHEMA_RETRIEVAL_RESULT_LOCATION.members["sqlLocation"], - self.sql_location, - ) - - if self.one_drive_location is not None: - serializer.write_struct( - _SCHEMA_RETRIEVAL_RESULT_LOCATION.members["oneDriveLocation"], - self.one_drive_location, - ) - - if self.google_drive_location is not None: - serializer.write_struct( - _SCHEMA_RETRIEVAL_RESULT_LOCATION.members["googleDriveLocation"], - self.google_drive_location, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = RetrievalResultLocationType( - de.read_string( - _SCHEMA_RETRIEVAL_RESULT_LOCATION.members["type"] - ) - ) - - case 1: - kwargs["s3_location"] = RetrievalResultS3Location.deserialize(de) - - case 2: - kwargs["web_location"] = RetrievalResultWebLocation.deserialize(de) - - case 3: - kwargs["confluence_location"] = ( - RetrievalResultConfluenceLocation.deserialize(de) - ) - - case 4: - kwargs["salesforce_location"] = ( - RetrievalResultSalesforceLocation.deserialize(de) - ) - - case 5: - kwargs["share_point_location"] = ( - RetrievalResultSharePointLocation.deserialize(de) - ) - - case 6: - kwargs["custom_document_location"] = ( - RetrievalResultCustomDocumentLocation.deserialize(de) - ) - - case 7: - kwargs["kendra_document_location"] = ( - RetrievalResultKendraDocumentLocation.deserialize(de) - ) - - case 8: - kwargs["sql_location"] = RetrievalResultSqlLocation.deserialize(de) - - case 9: - kwargs["one_drive_location"] = ( - RetrievalResultOneDriveLocation.deserialize(de) - ) - - case 10: - kwargs["google_drive_location"] = ( - RetrievalResultGoogleDriveLocation.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RETRIEVAL_RESULT_LOCATION, consumer=_consumer) - if "type" not in kwargs: - kwargs["type"] = RetrievalResultLocationType._corrected("") - return kwargs - - -def _serialize_retrieval_result_metadata( - serializer: ShapeSerializer, schema: Schema, value: dict[str, Document] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_document(value_schema, v)) - - -def _deserialize_retrieval_result_metadata( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, Document]: - result: dict[str, Document] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_document(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class RetrievedReference: - """ - Contains metadata about a source cited for the generated response. - - This data type is used in the following API operations: - - - [RetrieveAndGenerate - response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax) - -- in the `retrievedReferences` field - - - [InvokeAgent - response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax) - -- in the `retrievedReferences` field - """ - - content: RetrievalResultContent | None = field(repr=False, default=None) - """Contains the cited text from the data source.""" - - location: RetrievalResultLocation | None = field(repr=False, default=None) - """Contains information about the location of the data source.""" - - metadata: dict[str, Document] | None = field(repr=False, default=None) - """ - Contains metadata attributes and their values for the file in the data - source. For more information, see [Metadata and - filtering](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-ds.html#kb-ds-metadata). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVED_REFERENCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.content is not None: - serializer.write_struct( - _SCHEMA_RETRIEVED_REFERENCE.members["content"], self.content - ) - - if self.location is not None: - serializer.write_struct( - _SCHEMA_RETRIEVED_REFERENCE.members["location"], self.location - ) - - if self.metadata is not None: - _serialize_retrieval_result_metadata( - serializer, - _SCHEMA_RETRIEVED_REFERENCE.members["metadata"], - self.metadata, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["content"] = RetrievalResultContent.deserialize(de) - - case 1: - kwargs["location"] = RetrievalResultLocation.deserialize(de) - - case 2: - kwargs["metadata"] = _deserialize_retrieval_result_metadata( - de, _SCHEMA_RETRIEVED_REFERENCE.members["metadata"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RETRIEVED_REFERENCE, consumer=_consumer) - return kwargs - - -def _serialize_retrieved_references( - serializer: ShapeSerializer, schema: Schema, value: list[RetrievedReference] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_retrieved_references( - deserializer: ShapeDeserializer, schema: Schema -) -> list[RetrievedReference]: - result: list[RetrievedReference] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(RetrievedReference.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class KnowledgeBaseLookupOutput: - """Contains details about the results from looking up the knowledge base.""" - - retrieved_references: list[RetrievedReference] | None = None - """Contains metadata about the sources cited for the generated response.""" - - metadata: Metadata | None = field(repr=False, default=None) - """Contains information about the knowledge base output.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KNOWLEDGE_BASE_LOOKUP_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.retrieved_references is not None: - _serialize_retrieved_references( - serializer, - _SCHEMA_KNOWLEDGE_BASE_LOOKUP_OUTPUT.members["retrievedReferences"], - self.retrieved_references, - ) - - if self.metadata is not None: - serializer.write_struct( - _SCHEMA_KNOWLEDGE_BASE_LOOKUP_OUTPUT.members["metadata"], self.metadata - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["retrieved_references"] = _deserialize_retrieved_references( - de, - _SCHEMA_KNOWLEDGE_BASE_LOOKUP_OUTPUT.members[ - "retrievedReferences" - ], - ) - - case 1: - kwargs["metadata"] = Metadata.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_KNOWLEDGE_BASE_LOOKUP_OUTPUT, consumer=_consumer - ) - return kwargs - - -class Source(UnknownEnumMixin, StrEnum): - ACTION_GROUP = "ACTION_GROUP" - KNOWLEDGE_BASE = "KNOWLEDGE_BASE" - PARSER = "PARSER" - - -@dataclass(kw_only=True) -class RepromptResponse: - """Contains details about the agent's response to reprompt the input.""" - - text: str | None = None - """The text reprompting the input.""" - - source: str | None = field(repr=False, default=None) - """Specifies what output is prompting the agent to reprompt the input.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REPROMPT_RESPONSE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.text is not None: - serializer.write_string( - _SCHEMA_REPROMPT_RESPONSE.members["text"], self.text - ) - - if self.source is not None: - serializer.write_string( - _SCHEMA_REPROMPT_RESPONSE.members["source"], self.source - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["text"] = de.read_string( - _SCHEMA_REPROMPT_RESPONSE.members["text"] - ) - - case 1: - kwargs["source"] = Source( - de.read_string(_SCHEMA_REPROMPT_RESPONSE.members["source"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_REPROMPT_RESPONSE, consumer=_consumer) - return kwargs - - -class Type(UnknownEnumMixin, StrEnum): - ACTION_GROUP = "ACTION_GROUP" - AGENT_COLLABORATOR = "AGENT_COLLABORATOR" - KNOWLEDGE_BASE = "KNOWLEDGE_BASE" - FINISH = "FINISH" - ASK_USER = "ASK_USER" - REPROMPT = "REPROMPT" - - -@dataclass(kw_only=True) -class Observation: - """ - Contains the result or output of an action group or knowledge base, or - the response to the user. - """ - - trace_id: str | None = None - """The unique identifier of the trace.""" - - type: str | None = None - """ - Specifies what kind of information the agent returns in the observation. - The following values are possible. - - - `ACTION_GROUP` -- The agent returns the result of an action group. - - - `KNOWLEDGE_BASE` -- The agent returns information from a knowledge - base. - - - `FINISH` -- The agent returns a final response to the user with no - follow-up. - - - `ASK_USER` -- The agent asks the user a question. - - - `REPROMPT` -- The agent prompts the user again for the same - information. - """ - - action_group_invocation_output: ActionGroupInvocationOutput | None = None - """ - Contains the JSON-formatted string returned by the API invoked by the - action group. - """ - - agent_collaborator_invocation_output: AgentCollaboratorInvocationOutput | None = ( - None - ) - """A collaborator's invocation output.""" - - knowledge_base_lookup_output: KnowledgeBaseLookupOutput | None = None - """Contains details about the results from looking up the knowledge base.""" - - final_response: FinalResponse | None = None - """Contains details about the response to the user.""" - - reprompt_response: RepromptResponse | None = field(repr=False, default=None) - """Contains details about the response to reprompt the input.""" - - code_interpreter_invocation_output: CodeInterpreterInvocationOutput | None = None - """ - Contains the JSON-formatted string returned by the API invoked by the - code interpreter. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OBSERVATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.trace_id is not None: - serializer.write_string( - _SCHEMA_OBSERVATION.members["traceId"], self.trace_id - ) - - if self.type is not None: - serializer.write_string(_SCHEMA_OBSERVATION.members["type"], self.type) - - if self.action_group_invocation_output is not None: - serializer.write_struct( - _SCHEMA_OBSERVATION.members["actionGroupInvocationOutput"], - self.action_group_invocation_output, - ) - - if self.agent_collaborator_invocation_output is not None: - serializer.write_struct( - _SCHEMA_OBSERVATION.members["agentCollaboratorInvocationOutput"], - self.agent_collaborator_invocation_output, - ) - - if self.knowledge_base_lookup_output is not None: - serializer.write_struct( - _SCHEMA_OBSERVATION.members["knowledgeBaseLookupOutput"], - self.knowledge_base_lookup_output, - ) - - if self.final_response is not None: - serializer.write_struct( - _SCHEMA_OBSERVATION.members["finalResponse"], self.final_response - ) - - if self.reprompt_response is not None: - serializer.write_struct( - _SCHEMA_OBSERVATION.members["repromptResponse"], self.reprompt_response - ) - - if self.code_interpreter_invocation_output is not None: - serializer.write_struct( - _SCHEMA_OBSERVATION.members["codeInterpreterInvocationOutput"], - self.code_interpreter_invocation_output, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["trace_id"] = de.read_string( - _SCHEMA_OBSERVATION.members["traceId"] - ) - - case 1: - kwargs["type"] = Type( - de.read_string(_SCHEMA_OBSERVATION.members["type"]) - ) - - case 2: - kwargs["action_group_invocation_output"] = ( - ActionGroupInvocationOutput.deserialize(de) - ) - - case 3: - kwargs["agent_collaborator_invocation_output"] = ( - AgentCollaboratorInvocationOutput.deserialize(de) - ) - - case 4: - kwargs["knowledge_base_lookup_output"] = ( - KnowledgeBaseLookupOutput.deserialize(de) - ) - - case 5: - kwargs["final_response"] = FinalResponse.deserialize(de) - - case 6: - kwargs["reprompt_response"] = RepromptResponse.deserialize(de) - - case 7: - kwargs["code_interpreter_invocation_output"] = ( - CodeInterpreterInvocationOutput.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_OBSERVATION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Rationale: - """ - Contains the reasoning, based on the input, that the agent uses to - justify carrying out an action group or getting information from a - knowledge base. - """ - - trace_id: str | None = None - """The unique identifier of the trace step.""" - - text: str | None = field(repr=False, default=None) - """The reasoning or thought process of the agent, based on the input.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RATIONALE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.trace_id is not None: - serializer.write_string(_SCHEMA_RATIONALE.members["traceId"], self.trace_id) - - if self.text is not None: - serializer.write_string(_SCHEMA_RATIONALE.members["text"], self.text) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["trace_id"] = de.read_string( - _SCHEMA_RATIONALE.members["traceId"] - ) - - case 1: - kwargs["text"] = de.read_string(_SCHEMA_RATIONALE.members["text"]) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RATIONALE, consumer=_consumer) - return kwargs - - -@dataclass -class OrchestrationTraceRationale: - """ - Details about the reasoning, based on the input, that the agent uses to - justify carrying out an action group or getting information from a - knowledge base. - """ - - value: Rationale - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ORCHESTRATION_TRACE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_ORCHESTRATION_TRACE.members["rationale"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=Rationale.deserialize(deserializer)) - - -@dataclass -class OrchestrationTraceInvocationInput: - """ - Contains information pertaining to the action group or knowledge base - that is being invoked. - """ - - value: InvocationInput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ORCHESTRATION_TRACE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_ORCHESTRATION_TRACE.members["invocationInput"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=InvocationInput.deserialize(deserializer)) - - -@dataclass -class OrchestrationTraceObservation: - """ - Details about the observation (the output of the action group Lambda or - knowledge base) made by the agent. - """ - - value: Observation - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ORCHESTRATION_TRACE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_ORCHESTRATION_TRACE.members["observation"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=Observation.deserialize(deserializer)) - - -@dataclass -class OrchestrationTraceModelInvocationInput: - """ - The input for the orchestration step. - - - The `type` is `ORCHESTRATION`. - - - The `text` contains the prompt. - - - The `inferenceConfiguration`, `parserMode`, and `overrideLambda` - values are set in the - [PromptOverrideConfiguration](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptOverrideConfiguration.html) - object that was set when the agent was created or updated. - """ - - value: ModelInvocationInput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ORCHESTRATION_TRACE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_ORCHESTRATION_TRACE.members["modelInvocationInput"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ModelInvocationInput.deserialize(deserializer)) - - -@dataclass -class OrchestrationTraceModelInvocationOutput: - """ - Contains information pertaining to the output from the foundation model - that is being invoked. - """ - - value: OrchestrationModelInvocationOutput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ORCHESTRATION_TRACE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_ORCHESTRATION_TRACE.members["modelInvocationOutput"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=OrchestrationModelInvocationOutput.deserialize(deserializer)) - - -@dataclass -class OrchestrationTraceUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -OrchestrationTrace = Union[ - OrchestrationTraceRationale - | OrchestrationTraceInvocationInput - | OrchestrationTraceObservation - | OrchestrationTraceModelInvocationInput - | OrchestrationTraceModelInvocationOutput - | OrchestrationTraceUnknown -] -""" -Details about the orchestration step, in which the agent determines the -order in which actions are executed and which knowledge bases are -retrieved. -""" - - -class _OrchestrationTraceDeserializer: - _result: OrchestrationTrace | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> OrchestrationTrace: - self._result = None - deserializer.read_struct(_SCHEMA_ORCHESTRATION_TRACE, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(OrchestrationTraceRationale.deserialize(de)) - - case 1: - self._set_result(OrchestrationTraceInvocationInput.deserialize(de)) - - case 2: - self._set_result(OrchestrationTraceObservation.deserialize(de)) - - case 3: - self._set_result(OrchestrationTraceModelInvocationInput.deserialize(de)) - - case 4: - self._set_result( - OrchestrationTraceModelInvocationOutput.deserialize(de) - ) - - case _: - self._set_result( - OrchestrationTraceUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: OrchestrationTrace) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class PostProcessingParsedResponse: - """ - Details about the response from the Lambda parsing of the output from - the post-processing step. - """ - - text: str | None = field(repr=False, default=None) - """The text returned by the parser.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_POST_PROCESSING_PARSED_RESPONSE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.text is not None: - serializer.write_string( - _SCHEMA_POST_PROCESSING_PARSED_RESPONSE.members["text"], self.text - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["text"] = de.read_string( - _SCHEMA_POST_PROCESSING_PARSED_RESPONSE.members["text"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_POST_PROCESSING_PARSED_RESPONSE, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class PostProcessingModelInvocationOutput: - """The foundation model output from the post-processing step.""" - - trace_id: str | None = None - """The unique identifier of the trace.""" - - parsed_response: PostProcessingParsedResponse | None = field( - repr=False, default=None - ) - """ - Details about the response from the Lambda parsing of the output of the - post-processing step. - """ - - raw_response: RawResponse | None = field(repr=False, default=None) - """Details of the raw response from the foundation model output.""" - - metadata: Metadata | None = field(repr=False, default=None) - """ - Contains information about the foundation model output from the - post-processing step. - """ - - reasoning_content: ReasoningContentBlock | None = field(repr=False, default=None) - """ - Contains content about the reasoning that the model made during the - post-processing step. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_POST_PROCESSING_MODEL_INVOCATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.trace_id is not None: - serializer.write_string( - _SCHEMA_POST_PROCESSING_MODEL_INVOCATION_OUTPUT.members["traceId"], - self.trace_id, - ) - - if self.parsed_response is not None: - serializer.write_struct( - _SCHEMA_POST_PROCESSING_MODEL_INVOCATION_OUTPUT.members[ - "parsedResponse" - ], - self.parsed_response, - ) - - if self.raw_response is not None: - serializer.write_struct( - _SCHEMA_POST_PROCESSING_MODEL_INVOCATION_OUTPUT.members["rawResponse"], - self.raw_response, - ) - - if self.metadata is not None: - serializer.write_struct( - _SCHEMA_POST_PROCESSING_MODEL_INVOCATION_OUTPUT.members["metadata"], - self.metadata, - ) - - if self.reasoning_content is not None: - serializer.write_struct( - _SCHEMA_POST_PROCESSING_MODEL_INVOCATION_OUTPUT.members[ - "reasoningContent" - ], - self.reasoning_content, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["trace_id"] = de.read_string( - _SCHEMA_POST_PROCESSING_MODEL_INVOCATION_OUTPUT.members[ - "traceId" - ] - ) - - case 1: - kwargs["parsed_response"] = ( - PostProcessingParsedResponse.deserialize(de) - ) - - case 2: - kwargs["raw_response"] = RawResponse.deserialize(de) - - case 3: - kwargs["metadata"] = Metadata.deserialize(de) - - case 4: - kwargs["reasoning_content"] = ( - _ReasoningContentBlockDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_POST_PROCESSING_MODEL_INVOCATION_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass -class PostProcessingTraceModelInvocationInput: - """ - The input for the post-processing step. - - - The `type` is `POST_PROCESSING`. - - - The `text` contains the prompt. - - - The `inferenceConfiguration`, `parserMode`, and `overrideLambda` - values are set in the - [PromptOverrideConfiguration](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptOverrideConfiguration.html) - object that was set when the agent was created or updated. - """ - - value: ModelInvocationInput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_POST_PROCESSING_TRACE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_POST_PROCESSING_TRACE.members["modelInvocationInput"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ModelInvocationInput.deserialize(deserializer)) - - -@dataclass -class PostProcessingTraceModelInvocationOutput: - """The foundation model output from the post-processing step.""" - - value: PostProcessingModelInvocationOutput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_POST_PROCESSING_TRACE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_POST_PROCESSING_TRACE.members["modelInvocationOutput"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=PostProcessingModelInvocationOutput.deserialize(deserializer)) - - -@dataclass -class PostProcessingTraceUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -PostProcessingTrace = Union[ - PostProcessingTraceModelInvocationInput - | PostProcessingTraceModelInvocationOutput - | PostProcessingTraceUnknown -] -""" -Details about the post-processing step, in which the agent shapes the -response. -""" - - -class _PostProcessingTraceDeserializer: - _result: PostProcessingTrace | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> PostProcessingTrace: - self._result = None - deserializer.read_struct(_SCHEMA_POST_PROCESSING_TRACE, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - PostProcessingTraceModelInvocationInput.deserialize(de) - ) - - case 1: - self._set_result( - PostProcessingTraceModelInvocationOutput.deserialize(de) - ) - - case _: - self._set_result( - PostProcessingTraceUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: PostProcessingTrace) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class PreProcessingParsedResponse: - """ - Details about the response from the Lambda parsing of the output from - the pre-processing step. - """ - - rationale: str | None = field(repr=False, default=None) - """ - The text returned by the parsing of the pre-processing step, explaining - the steps that the agent plans to take in orchestration, if the user - input is valid. - """ - - is_valid: bool | None = None - """ - Whether the user input is valid or not. If `false`, the agent doesn't - proceed to orchestration. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PRE_PROCESSING_PARSED_RESPONSE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rationale is not None: - serializer.write_string( - _SCHEMA_PRE_PROCESSING_PARSED_RESPONSE.members["rationale"], - self.rationale, - ) - - if self.is_valid is not None: - serializer.write_boolean( - _SCHEMA_PRE_PROCESSING_PARSED_RESPONSE.members["isValid"], self.is_valid - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rationale"] = de.read_string( - _SCHEMA_PRE_PROCESSING_PARSED_RESPONSE.members["rationale"] - ) - - case 1: - kwargs["is_valid"] = de.read_boolean( - _SCHEMA_PRE_PROCESSING_PARSED_RESPONSE.members["isValid"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PRE_PROCESSING_PARSED_RESPONSE, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class PreProcessingModelInvocationOutput: - """The foundation model output from the pre-processing step.""" - - trace_id: str | None = None - """The unique identifier of the trace.""" - - parsed_response: PreProcessingParsedResponse | None = field( - repr=False, default=None - ) - """ - Details about the response from the Lambda parsing of the output of the - pre-processing step. - """ - - raw_response: RawResponse | None = field(repr=False, default=None) - """Details of the raw response from the foundation model output.""" - - metadata: Metadata | None = field(repr=False, default=None) - """ - Contains information about the foundation model output from the - pre-processing step. - """ - - reasoning_content: ReasoningContentBlock | None = field(repr=False, default=None) - """ - Contains content about the reasoning that the model made during the - pre-processing step. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PRE_PROCESSING_MODEL_INVOCATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.trace_id is not None: - serializer.write_string( - _SCHEMA_PRE_PROCESSING_MODEL_INVOCATION_OUTPUT.members["traceId"], - self.trace_id, - ) - - if self.parsed_response is not None: - serializer.write_struct( - _SCHEMA_PRE_PROCESSING_MODEL_INVOCATION_OUTPUT.members[ - "parsedResponse" - ], - self.parsed_response, - ) - - if self.raw_response is not None: - serializer.write_struct( - _SCHEMA_PRE_PROCESSING_MODEL_INVOCATION_OUTPUT.members["rawResponse"], - self.raw_response, - ) - - if self.metadata is not None: - serializer.write_struct( - _SCHEMA_PRE_PROCESSING_MODEL_INVOCATION_OUTPUT.members["metadata"], - self.metadata, - ) - - if self.reasoning_content is not None: - serializer.write_struct( - _SCHEMA_PRE_PROCESSING_MODEL_INVOCATION_OUTPUT.members[ - "reasoningContent" - ], - self.reasoning_content, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["trace_id"] = de.read_string( - _SCHEMA_PRE_PROCESSING_MODEL_INVOCATION_OUTPUT.members[ - "traceId" - ] - ) - - case 1: - kwargs["parsed_response"] = PreProcessingParsedResponse.deserialize( - de - ) - - case 2: - kwargs["raw_response"] = RawResponse.deserialize(de) - - case 3: - kwargs["metadata"] = Metadata.deserialize(de) - - case 4: - kwargs["reasoning_content"] = ( - _ReasoningContentBlockDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PRE_PROCESSING_MODEL_INVOCATION_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass -class PreProcessingTraceModelInvocationInput: - """ - The input for the pre-processing step. - - - The `type` is `PRE_PROCESSING`. - - - The `text` contains the prompt. - - - The `inferenceConfiguration`, `parserMode`, and `overrideLambda` - values are set in the - [PromptOverrideConfiguration](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptOverrideConfiguration.html) - object that was set when the agent was created or updated. - """ - - value: ModelInvocationInput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PRE_PROCESSING_TRACE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_PRE_PROCESSING_TRACE.members["modelInvocationInput"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ModelInvocationInput.deserialize(deserializer)) - - -@dataclass -class PreProcessingTraceModelInvocationOutput: - """The foundation model output from the pre-processing step.""" - - value: PreProcessingModelInvocationOutput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PRE_PROCESSING_TRACE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_PRE_PROCESSING_TRACE.members["modelInvocationOutput"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=PreProcessingModelInvocationOutput.deserialize(deserializer)) - - -@dataclass -class PreProcessingTraceUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -PreProcessingTrace = Union[ - PreProcessingTraceModelInvocationInput - | PreProcessingTraceModelInvocationOutput - | PreProcessingTraceUnknown -] -""" -Details about the pre-processing step, in which the agent contextualizes -and categorizes user inputs. -""" - - -class _PreProcessingTraceDeserializer: - _result: PreProcessingTrace | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> PreProcessingTrace: - self._result = None - deserializer.read_struct(_SCHEMA_PRE_PROCESSING_TRACE, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(PreProcessingTraceModelInvocationInput.deserialize(de)) - - case 1: - self._set_result( - PreProcessingTraceModelInvocationOutput.deserialize(de) - ) - - case _: - self._set_result( - PreProcessingTraceUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: PreProcessingTrace) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class RoutingClassifierModelInvocationOutput: - """Invocation output from a routing classifier model.""" - - trace_id: str | None = None - """The invocation's trace ID.""" - - raw_response: RawResponse | None = field(repr=False, default=None) - """The invocation's raw response.""" - - metadata: Metadata | None = field(repr=False, default=None) - """The invocation's metadata.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_ROUTING_CLASSIFIER_MODEL_INVOCATION_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.trace_id is not None: - serializer.write_string( - _SCHEMA_ROUTING_CLASSIFIER_MODEL_INVOCATION_OUTPUT.members["traceId"], - self.trace_id, - ) - - if self.raw_response is not None: - serializer.write_struct( - _SCHEMA_ROUTING_CLASSIFIER_MODEL_INVOCATION_OUTPUT.members[ - "rawResponse" - ], - self.raw_response, - ) - - if self.metadata is not None: - serializer.write_struct( - _SCHEMA_ROUTING_CLASSIFIER_MODEL_INVOCATION_OUTPUT.members["metadata"], - self.metadata, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["trace_id"] = de.read_string( - _SCHEMA_ROUTING_CLASSIFIER_MODEL_INVOCATION_OUTPUT.members[ - "traceId" - ] - ) - - case 1: - kwargs["raw_response"] = RawResponse.deserialize(de) - - case 2: - kwargs["metadata"] = Metadata.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ROUTING_CLASSIFIER_MODEL_INVOCATION_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass -class RoutingClassifierTraceInvocationInput: - """The classifier's invocation input.""" - - value: InvocationInput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ROUTING_CLASSIFIER_TRACE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_ROUTING_CLASSIFIER_TRACE.members["invocationInput"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=InvocationInput.deserialize(deserializer)) - - -@dataclass -class RoutingClassifierTraceObservation: - """The classifier's observation.""" - - value: Observation - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ROUTING_CLASSIFIER_TRACE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_ROUTING_CLASSIFIER_TRACE.members["observation"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=Observation.deserialize(deserializer)) - - -@dataclass -class RoutingClassifierTraceModelInvocationInput: - """The classifier's model invocation input.""" - - value: ModelInvocationInput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ROUTING_CLASSIFIER_TRACE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_ROUTING_CLASSIFIER_TRACE.members["modelInvocationInput"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ModelInvocationInput.deserialize(deserializer)) - - -@dataclass -class RoutingClassifierTraceModelInvocationOutput: - """The classifier's model invocation output.""" - - value: RoutingClassifierModelInvocationOutput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ROUTING_CLASSIFIER_TRACE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_ROUTING_CLASSIFIER_TRACE.members["modelInvocationOutput"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=RoutingClassifierModelInvocationOutput.deserialize(deserializer) - ) - - -@dataclass -class RoutingClassifierTraceUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -RoutingClassifierTrace = Union[ - RoutingClassifierTraceInvocationInput - | RoutingClassifierTraceObservation - | RoutingClassifierTraceModelInvocationInput - | RoutingClassifierTraceModelInvocationOutput - | RoutingClassifierTraceUnknown -] -"""A trace for a routing classifier.""" - - -class _RoutingClassifierTraceDeserializer: - _result: RoutingClassifierTrace | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> RoutingClassifierTrace: - self._result = None - deserializer.read_struct(_SCHEMA_ROUTING_CLASSIFIER_TRACE, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(RoutingClassifierTraceInvocationInput.deserialize(de)) - - case 1: - self._set_result(RoutingClassifierTraceObservation.deserialize(de)) - - case 2: - self._set_result( - RoutingClassifierTraceModelInvocationInput.deserialize(de) - ) - - case 3: - self._set_result( - RoutingClassifierTraceModelInvocationOutput.deserialize(de) - ) - - case _: - self._set_result( - RoutingClassifierTraceUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: RoutingClassifierTrace) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass -class TraceGuardrailTrace: - """The trace details for a trace defined in the Guardrail filter.""" - - value: GuardrailTrace - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRACE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRACE.members["guardrailTrace"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=GuardrailTrace.deserialize(deserializer)) - - -@dataclass -class TracePreProcessingTrace: - """ - Details about the pre-processing step, in which the agent contextualizes - and categorizes user inputs. - """ - - value: PreProcessingTrace - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRACE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRACE.members["preProcessingTrace"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=_PreProcessingTraceDeserializer().deserialize(deserializer)) - - -@dataclass -class TraceOrchestrationTrace: - """ - Details about the orchestration step, in which the agent determines the - order in which actions are executed and which knowledge bases are - retrieved. - """ - - value: OrchestrationTrace - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRACE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRACE.members["orchestrationTrace"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=_OrchestrationTraceDeserializer().deserialize(deserializer)) - - -@dataclass -class TracePostProcessingTrace: - """ - Details about the post-processing step, in which the agent shapes the - response.. - """ - - value: PostProcessingTrace - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRACE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_TRACE.members["postProcessingTrace"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=_PostProcessingTraceDeserializer().deserialize(deserializer)) - - -@dataclass -class TraceRoutingClassifierTrace: - """A routing classifier's trace.""" - - value: RoutingClassifierTrace - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRACE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_TRACE.members["routingClassifierTrace"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_RoutingClassifierTraceDeserializer().deserialize(deserializer) - ) - - -@dataclass -class TraceFailureTrace: - """Contains information about the failure of the interaction.""" - - value: FailureTrace - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRACE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRACE.members["failureTrace"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=FailureTrace.deserialize(deserializer)) - - -@dataclass -class TraceCustomOrchestrationTrace: - """ - Details about the custom orchestration step in which the agent - determines the order in which actions are executed. - """ - - value: CustomOrchestrationTrace - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRACE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_TRACE.members["customOrchestrationTrace"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=CustomOrchestrationTrace.deserialize(deserializer)) - - -@dataclass -class TraceUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -Trace = Union[ - TraceGuardrailTrace - | TracePreProcessingTrace - | TraceOrchestrationTrace - | TracePostProcessingTrace - | TraceRoutingClassifierTrace - | TraceFailureTrace - | TraceCustomOrchestrationTrace - | TraceUnknown -] -""" -Contains one part of the agent's reasoning process and results from -calling API actions and querying knowledge bases. You can use the trace -to understand how the agent arrived at the response it provided the -customer. For more information, see [Trace -enablement](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-test.html#trace-enablement). -""" - - -class _TraceDeserializer: - _result: Trace | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> Trace: - self._result = None - deserializer.read_struct(_SCHEMA_TRACE, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(TraceGuardrailTrace.deserialize(de)) - - case 1: - self._set_result(TracePreProcessingTrace.deserialize(de)) - - case 2: - self._set_result(TraceOrchestrationTrace.deserialize(de)) - - case 3: - self._set_result(TracePostProcessingTrace.deserialize(de)) - - case 4: - self._set_result(TraceRoutingClassifierTrace.deserialize(de)) - - case 5: - self._set_result(TraceFailureTrace.deserialize(de)) - - case 6: - self._set_result(TraceCustomOrchestrationTrace.deserialize(de)) - - case _: - self._set_result(TraceUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: Trace) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class TracePart: - """ - Contains information about the agent and session, alongside the agent's - reasoning process and results from calling API actions and querying - knowledge bases and metadata about the trace. You can use the trace to - understand how the agent arrived at the response it provided the - customer. For more information, see [Trace - enablement](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-test.html#trace-enablement). - """ - - session_id: str | None = None - """The unique identifier of the session with the agent.""" - - trace: Trace | None = field(repr=False, default=None) - """ - Contains one part of the agent's reasoning process and results from - calling API actions and querying knowledge bases. You can use the trace - to understand how the agent arrived at the response it provided the - customer. For more information, see [Trace - enablement](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-test.html#trace-enablement). - """ - - caller_chain: list[Caller] | None = None - """The part's caller chain.""" - - event_time: datetime | None = None - """The time of the trace.""" - - collaborator_name: str | None = field(repr=False, default=None) - """The part's collaborator name.""" - - agent_id: str | None = None - """The unique identifier of the agent.""" - - agent_alias_id: str | None = None - """The unique identifier of the alias of the agent.""" - - agent_version: str | None = None - """The version of the agent.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRACE_PART, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.session_id is not None: - serializer.write_string( - _SCHEMA_TRACE_PART.members["sessionId"], self.session_id - ) - - if self.trace is not None: - serializer.write_struct(_SCHEMA_TRACE_PART.members["trace"], self.trace) - - if self.caller_chain is not None: - _serialize_caller_chain( - serializer, _SCHEMA_TRACE_PART.members["callerChain"], self.caller_chain - ) - - if self.event_time is not None: - serializer.write_timestamp( - _SCHEMA_TRACE_PART.members["eventTime"], self.event_time - ) - - if self.collaborator_name is not None: - serializer.write_string( - _SCHEMA_TRACE_PART.members["collaboratorName"], self.collaborator_name - ) - - if self.agent_id is not None: - serializer.write_string( - _SCHEMA_TRACE_PART.members["agentId"], self.agent_id - ) - - if self.agent_alias_id is not None: - serializer.write_string( - _SCHEMA_TRACE_PART.members["agentAliasId"], self.agent_alias_id - ) - - if self.agent_version is not None: - serializer.write_string( - _SCHEMA_TRACE_PART.members["agentVersion"], self.agent_version - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["session_id"] = de.read_string( - _SCHEMA_TRACE_PART.members["sessionId"] - ) - - case 1: - kwargs["trace"] = _TraceDeserializer().deserialize(de) - - case 2: - kwargs["caller_chain"] = _deserialize_caller_chain( - de, _SCHEMA_TRACE_PART.members["callerChain"] - ) - - case 3: - kwargs["event_time"] = de.read_timestamp( - _SCHEMA_TRACE_PART.members["eventTime"] - ) - - case 4: - kwargs["collaborator_name"] = de.read_string( - _SCHEMA_TRACE_PART.members["collaboratorName"] - ) - - case 5: - kwargs["agent_id"] = de.read_string( - _SCHEMA_TRACE_PART.members["agentId"] - ) - - case 6: - kwargs["agent_alias_id"] = de.read_string( - _SCHEMA_TRACE_PART.members["agentAliasId"] - ) - - case 7: - kwargs["agent_version"] = de.read_string( - _SCHEMA_TRACE_PART.members["agentVersion"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TRACE_PART, consumer=_consumer) - return kwargs - - -def _serialize_agent_traces( - serializer: ShapeSerializer, schema: Schema, value: list[TracePart] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_agent_traces( - deserializer: ShapeDeserializer, schema: Schema -) -> list[TracePart]: - result: list[TracePart] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(TracePart.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CheckIngestedDocumentAclInput: - """Dataclass for CheckIngestedDocumentAclInput structure.""" - - knowledge_base_id: str | None = None - """The unique identifier of the knowledge base that contains the document.""" - - data_source_id: str | None = None - """The unique identifier of the data source that contains the document.""" - - document_id: str | None = None - """The unique identifier of the document to check access for.""" - - user_context: UserContext | None = field(repr=False, default=None) - """ - The context object containing identity information for access control - filtering, including user ID and optional group memberships used to - evaluate the document access control list (ACL). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CHECK_INGESTED_DOCUMENT_ACL_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.knowledge_base_id is not None: - serializer.write_string( - _SCHEMA_CHECK_INGESTED_DOCUMENT_ACL_INPUT.members["knowledgeBaseId"], - self.knowledge_base_id, - ) - - if self.data_source_id is not None: - serializer.write_string( - _SCHEMA_CHECK_INGESTED_DOCUMENT_ACL_INPUT.members["dataSourceId"], - self.data_source_id, - ) - - if self.document_id is not None: - serializer.write_string( - _SCHEMA_CHECK_INGESTED_DOCUMENT_ACL_INPUT.members["documentId"], - self.document_id, - ) - - if self.user_context is not None: - serializer.write_struct( - _SCHEMA_CHECK_INGESTED_DOCUMENT_ACL_INPUT.members["userContext"], - self.user_context, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["knowledge_base_id"] = de.read_string( - _SCHEMA_CHECK_INGESTED_DOCUMENT_ACL_INPUT.members[ - "knowledgeBaseId" - ] - ) - - case 1: - kwargs["data_source_id"] = de.read_string( - _SCHEMA_CHECK_INGESTED_DOCUMENT_ACL_INPUT.members[ - "dataSourceId" - ] - ) - - case 2: - kwargs["document_id"] = de.read_string( - _SCHEMA_CHECK_INGESTED_DOCUMENT_ACL_INPUT.members["documentId"] - ) - - case 3: - kwargs["user_context"] = UserContext.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CHECK_INGESTED_DOCUMENT_ACL_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CheckIngestedDocumentAclOutput: - """Dataclass for CheckIngestedDocumentAclOutput structure.""" - - has_access: bool - """ - Specifies whether the user has access to the document based on the - ingested access control list (ACL). Returns `true` if the user is - allowed access, and `false` otherwise. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CHECK_INGESTED_DOCUMENT_ACL_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_boolean( - _SCHEMA_CHECK_INGESTED_DOCUMENT_ACL_OUTPUT.members["hasAccess"], - self.has_access, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["has_access"] = de.read_boolean( - _SCHEMA_CHECK_INGESTED_DOCUMENT_ACL_OUTPUT.members["hasAccess"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CHECK_INGESTED_DOCUMENT_ACL_OUTPUT, consumer=_consumer - ) - if "has_access" not in kwargs: - kwargs["has_access"] = False - return kwargs - - -CHECK_INGESTED_DOCUMENT_ACL = APIOperation( - input=CheckIngestedDocumentAclInput, - output=CheckIngestedDocumentAclOutput, - schema=_SCHEMA_CHECK_INGESTED_DOCUMENT_ACL, - input_schema=_SCHEMA_CHECK_INGESTED_DOCUMENT_ACL_INPUT, - output_schema=_SCHEMA_CHECK_INGESTED_DOCUMENT_ACL_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetExecutionFlowSnapshotInput: - """Dataclass for GetExecutionFlowSnapshotInput structure.""" - - flow_identifier: str | None = None - """The unique identifier of the flow.""" - - flow_alias_identifier: str | None = None - """The unique identifier of the flow alias used for the flow execution.""" - - execution_identifier: str | None = None - """The unique identifier of the flow execution.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_EXECUTION_FLOW_SNAPSHOT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.flow_identifier is not None: - serializer.write_string( - _SCHEMA_GET_EXECUTION_FLOW_SNAPSHOT_INPUT.members["flowIdentifier"], - self.flow_identifier, - ) - - if self.flow_alias_identifier is not None: - serializer.write_string( - _SCHEMA_GET_EXECUTION_FLOW_SNAPSHOT_INPUT.members[ - "flowAliasIdentifier" - ], - self.flow_alias_identifier, - ) - - if self.execution_identifier is not None: - serializer.write_string( - _SCHEMA_GET_EXECUTION_FLOW_SNAPSHOT_INPUT.members[ - "executionIdentifier" - ], - self.execution_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["flow_identifier"] = de.read_string( - _SCHEMA_GET_EXECUTION_FLOW_SNAPSHOT_INPUT.members[ - "flowIdentifier" - ] - ) - - case 1: - kwargs["flow_alias_identifier"] = de.read_string( - _SCHEMA_GET_EXECUTION_FLOW_SNAPSHOT_INPUT.members[ - "flowAliasIdentifier" - ] - ) - - case 2: - kwargs["execution_identifier"] = de.read_string( - _SCHEMA_GET_EXECUTION_FLOW_SNAPSHOT_INPUT.members[ - "executionIdentifier" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_EXECUTION_FLOW_SNAPSHOT_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetExecutionFlowSnapshotOutput: - """Dataclass for GetExecutionFlowSnapshotOutput structure.""" - - flow_identifier: str - """The unique identifier of the flow.""" - - flow_alias_identifier: str - """The unique identifier of the flow alias used for the flow execution.""" - - flow_version: str - """The version of the flow used for the flow execution.""" - - execution_role_arn: str - """ - The Amazon Resource Name (ARN) of the IAM service role that's used by - the flow execution. - """ - - definition: str - """ - The flow definition used for the flow execution, including the nodes, - connections, and configuration at the time when the execution started. - - The definition returns as a string that follows the structure of a - [FlowDefinition](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_FlowDefinition.html) - object. - """ - - customer_encryption_key_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the customer managed KMS key that's - used to encrypt the flow snapshot. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_EXECUTION_FLOW_SNAPSHOT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_EXECUTION_FLOW_SNAPSHOT_OUTPUT.members["flowIdentifier"], - self.flow_identifier, - ) - serializer.write_string( - _SCHEMA_GET_EXECUTION_FLOW_SNAPSHOT_OUTPUT.members["flowAliasIdentifier"], - self.flow_alias_identifier, - ) - serializer.write_string( - _SCHEMA_GET_EXECUTION_FLOW_SNAPSHOT_OUTPUT.members["flowVersion"], - self.flow_version, - ) - serializer.write_string( - _SCHEMA_GET_EXECUTION_FLOW_SNAPSHOT_OUTPUT.members["executionRoleArn"], - self.execution_role_arn, - ) - serializer.write_string( - _SCHEMA_GET_EXECUTION_FLOW_SNAPSHOT_OUTPUT.members["definition"], - self.definition, - ) - if self.customer_encryption_key_arn is not None: - serializer.write_string( - _SCHEMA_GET_EXECUTION_FLOW_SNAPSHOT_OUTPUT.members[ - "customerEncryptionKeyArn" - ], - self.customer_encryption_key_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["flow_identifier"] = de.read_string( - _SCHEMA_GET_EXECUTION_FLOW_SNAPSHOT_OUTPUT.members[ - "flowIdentifier" - ] - ) - - case 1: - kwargs["flow_alias_identifier"] = de.read_string( - _SCHEMA_GET_EXECUTION_FLOW_SNAPSHOT_OUTPUT.members[ - "flowAliasIdentifier" - ] - ) - - case 2: - kwargs["flow_version"] = de.read_string( - _SCHEMA_GET_EXECUTION_FLOW_SNAPSHOT_OUTPUT.members[ - "flowVersion" - ] - ) - - case 3: - kwargs["execution_role_arn"] = de.read_string( - _SCHEMA_GET_EXECUTION_FLOW_SNAPSHOT_OUTPUT.members[ - "executionRoleArn" - ] - ) - - case 4: - kwargs["definition"] = de.read_string( - _SCHEMA_GET_EXECUTION_FLOW_SNAPSHOT_OUTPUT.members["definition"] - ) - - case 5: - kwargs["customer_encryption_key_arn"] = de.read_string( - _SCHEMA_GET_EXECUTION_FLOW_SNAPSHOT_OUTPUT.members[ - "customerEncryptionKeyArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_EXECUTION_FLOW_SNAPSHOT_OUTPUT, consumer=_consumer - ) - if "flow_identifier" not in kwargs: - kwargs["flow_identifier"] = "" - if "flow_alias_identifier" not in kwargs: - kwargs["flow_alias_identifier"] = "" - if "flow_version" not in kwargs: - kwargs["flow_version"] = "" - if "execution_role_arn" not in kwargs: - kwargs["execution_role_arn"] = "" - if "definition" not in kwargs: - kwargs["definition"] = "" - return kwargs - - -GET_EXECUTION_FLOW_SNAPSHOT = APIOperation( - input=GetExecutionFlowSnapshotInput, - output=GetExecutionFlowSnapshotOutput, - schema=_SCHEMA_GET_EXECUTION_FLOW_SNAPSHOT, - input_schema=_SCHEMA_GET_EXECUTION_FLOW_SNAPSHOT_INPUT, - output_schema=_SCHEMA_GET_EXECUTION_FLOW_SNAPSHOT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetFlowExecutionInput: - """Dataclass for GetFlowExecutionInput structure.""" - - flow_identifier: str | None = None - """The unique identifier of the flow.""" - - flow_alias_identifier: str | None = None - """The unique identifier of the flow alias used for the execution.""" - - execution_identifier: str | None = None - """The unique identifier of the flow execution to retrieve.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_FLOW_EXECUTION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.flow_identifier is not None: - serializer.write_string( - _SCHEMA_GET_FLOW_EXECUTION_INPUT.members["flowIdentifier"], - self.flow_identifier, - ) - - if self.flow_alias_identifier is not None: - serializer.write_string( - _SCHEMA_GET_FLOW_EXECUTION_INPUT.members["flowAliasIdentifier"], - self.flow_alias_identifier, - ) - - if self.execution_identifier is not None: - serializer.write_string( - _SCHEMA_GET_FLOW_EXECUTION_INPUT.members["executionIdentifier"], - self.execution_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["flow_identifier"] = de.read_string( - _SCHEMA_GET_FLOW_EXECUTION_INPUT.members["flowIdentifier"] - ) - - case 1: - kwargs["flow_alias_identifier"] = de.read_string( - _SCHEMA_GET_FLOW_EXECUTION_INPUT.members["flowAliasIdentifier"] - ) - - case 2: - kwargs["execution_identifier"] = de.read_string( - _SCHEMA_GET_FLOW_EXECUTION_INPUT.members["executionIdentifier"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_FLOW_EXECUTION_INPUT, consumer=_consumer) - return kwargs - - -class FlowExecutionErrorType(UnknownEnumMixin, StrEnum): - TIMED_OUT = "ExecutionTimedOut" - - -@dataclass(kw_only=True) -class FlowExecutionError: - """ - Contains information about an error that occurred during an flow - execution. - - Note: - Flow executions is in preview release for Amazon Bedrock and is subject - to change. - """ - - node_name: str | None = None - """ - The name of the node in the flow where the error occurred (if - applicable). - """ - - error: str | None = None - """The error code for the type of error that occurred.""" - - message: str | None = None - """A descriptive message that provides details about the error.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_EXECUTION_ERROR, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.node_name is not None: - serializer.write_string( - _SCHEMA_FLOW_EXECUTION_ERROR.members["nodeName"], self.node_name - ) - - if self.error is not None: - serializer.write_string( - _SCHEMA_FLOW_EXECUTION_ERROR.members["error"], self.error - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_FLOW_EXECUTION_ERROR.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["node_name"] = de.read_string( - _SCHEMA_FLOW_EXECUTION_ERROR.members["nodeName"] - ) - - case 1: - kwargs["error"] = FlowExecutionErrorType( - de.read_string(_SCHEMA_FLOW_EXECUTION_ERROR.members["error"]) - ) - - case 2: - kwargs["message"] = de.read_string( - _SCHEMA_FLOW_EXECUTION_ERROR.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FLOW_EXECUTION_ERROR, consumer=_consumer) - return kwargs - - -def _serialize_flow_execution_errors( - serializer: ShapeSerializer, schema: Schema, value: list[FlowExecutionError] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_flow_execution_errors( - deserializer: ShapeDeserializer, schema: Schema -) -> list[FlowExecutionError]: - result: list[FlowExecutionError] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(FlowExecutionError.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class FlowExecutionStatus(UnknownEnumMixin, StrEnum): - RUNNING = "Running" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - TIMED_OUT = "TimedOut" - ABORTED = "Aborted" - - -@dataclass(kw_only=True) -class GetFlowExecutionOutput: - """Dataclass for GetFlowExecutionOutput structure.""" - - execution_arn: str - """ - The Amazon Resource Name (ARN) that uniquely identifies the flow - execution. - """ - - status: str - """ - The current status of the flow execution. - - Flow executions time out after 24 hours. - """ - - started_at: datetime - """The timestamp when the flow execution started.""" - - flow_alias_identifier: str - """The unique identifier of the flow alias used for the execution.""" - - flow_identifier: str - """The unique identifier of the flow.""" - - flow_version: str - """The version of the flow used for the execution.""" - - ended_at: datetime | None = None - """ - The timestamp when the flow execution ended. This field is only - populated when the execution has completed, failed, timed out, or been - aborted. - """ - - errors: list[FlowExecutionError] | None = None - """ - A list of errors that occurred during the flow execution. Each error - includes an error code, message, and the node where the error occurred, - if applicable. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_FLOW_EXECUTION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_FLOW_EXECUTION_OUTPUT.members["executionArn"], - self.execution_arn, - ) - serializer.write_string( - _SCHEMA_GET_FLOW_EXECUTION_OUTPUT.members["status"], self.status - ) - serializer.write_timestamp( - _SCHEMA_GET_FLOW_EXECUTION_OUTPUT.members["startedAt"], self.started_at - ) - if self.ended_at is not None: - serializer.write_timestamp( - _SCHEMA_GET_FLOW_EXECUTION_OUTPUT.members["endedAt"], self.ended_at - ) - - if self.errors is not None: - _serialize_flow_execution_errors( - serializer, - _SCHEMA_GET_FLOW_EXECUTION_OUTPUT.members["errors"], - self.errors, - ) - - serializer.write_string( - _SCHEMA_GET_FLOW_EXECUTION_OUTPUT.members["flowAliasIdentifier"], - self.flow_alias_identifier, - ) - serializer.write_string( - _SCHEMA_GET_FLOW_EXECUTION_OUTPUT.members["flowIdentifier"], - self.flow_identifier, - ) - serializer.write_string( - _SCHEMA_GET_FLOW_EXECUTION_OUTPUT.members["flowVersion"], self.flow_version - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["execution_arn"] = de.read_string( - _SCHEMA_GET_FLOW_EXECUTION_OUTPUT.members["executionArn"] - ) - - case 1: - kwargs["status"] = FlowExecutionStatus( - de.read_string( - _SCHEMA_GET_FLOW_EXECUTION_OUTPUT.members["status"] - ) - ) - - case 2: - kwargs["started_at"] = de.read_timestamp( - _SCHEMA_GET_FLOW_EXECUTION_OUTPUT.members["startedAt"] - ) - - case 3: - kwargs["ended_at"] = de.read_timestamp( - _SCHEMA_GET_FLOW_EXECUTION_OUTPUT.members["endedAt"] - ) - - case 4: - kwargs["errors"] = _deserialize_flow_execution_errors( - de, _SCHEMA_GET_FLOW_EXECUTION_OUTPUT.members["errors"] - ) - - case 5: - kwargs["flow_alias_identifier"] = de.read_string( - _SCHEMA_GET_FLOW_EXECUTION_OUTPUT.members["flowAliasIdentifier"] - ) - - case 6: - kwargs["flow_identifier"] = de.read_string( - _SCHEMA_GET_FLOW_EXECUTION_OUTPUT.members["flowIdentifier"] - ) - - case 7: - kwargs["flow_version"] = de.read_string( - _SCHEMA_GET_FLOW_EXECUTION_OUTPUT.members["flowVersion"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_FLOW_EXECUTION_OUTPUT, consumer=_consumer) - if "execution_arn" not in kwargs: - kwargs["execution_arn"] = "" - if "status" not in kwargs: - kwargs["status"] = FlowExecutionStatus._corrected("") - if "started_at" not in kwargs: - kwargs["started_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "flow_alias_identifier" not in kwargs: - kwargs["flow_alias_identifier"] = "" - if "flow_identifier" not in kwargs: - kwargs["flow_identifier"] = "" - if "flow_version" not in kwargs: - kwargs["flow_version"] = "" - return kwargs - - -GET_FLOW_EXECUTION = APIOperation( - input=GetFlowExecutionInput, - output=GetFlowExecutionOutput, - schema=_SCHEMA_GET_FLOW_EXECUTION, - input_schema=_SCHEMA_GET_FLOW_EXECUTION_INPUT, - output_schema=_SCHEMA_GET_FLOW_EXECUTION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class FlowExecutionEventType(UnknownEnumMixin, StrEnum): - NODE = "Node" - FLOW = "Flow" - - -@dataclass(kw_only=True) -class ListFlowExecutionEventsInput: - """Dataclass for ListFlowExecutionEventsInput structure.""" - - flow_identifier: str | None = None - """The unique identifier of the flow.""" - - flow_alias_identifier: str | None = None - """The unique identifier of the flow alias used for the execution.""" - - execution_identifier: str | None = None - """The unique identifier of the flow execution.""" - - max_results: int | None = None - """ - The maximum number of events to return in a single response. If more - events exist than the specified maxResults value, a token is included in - the response so that the remaining results can be retrieved. - """ - - next_token: str | None = None - """ - A token to retrieve the next set of results. This value is returned in - the response if more results are available. - """ - - event_type: str | None = None - """ - The type of events to retrieve. Specify `Node` for node-level events or - `Flow` for flow-level events. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_FLOW_EXECUTION_EVENTS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.flow_identifier is not None: - serializer.write_string( - _SCHEMA_LIST_FLOW_EXECUTION_EVENTS_INPUT.members["flowIdentifier"], - self.flow_identifier, - ) - - if self.flow_alias_identifier is not None: - serializer.write_string( - _SCHEMA_LIST_FLOW_EXECUTION_EVENTS_INPUT.members["flowAliasIdentifier"], - self.flow_alias_identifier, - ) - - if self.execution_identifier is not None: - serializer.write_string( - _SCHEMA_LIST_FLOW_EXECUTION_EVENTS_INPUT.members["executionIdentifier"], - self.execution_identifier, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_FLOW_EXECUTION_EVENTS_INPUT.members["maxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_FLOW_EXECUTION_EVENTS_INPUT.members["nextToken"], - self.next_token, - ) - - if self.event_type is not None: - serializer.write_string( - _SCHEMA_LIST_FLOW_EXECUTION_EVENTS_INPUT.members["eventType"], - self.event_type, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["flow_identifier"] = de.read_string( - _SCHEMA_LIST_FLOW_EXECUTION_EVENTS_INPUT.members[ - "flowIdentifier" - ] - ) - - case 1: - kwargs["flow_alias_identifier"] = de.read_string( - _SCHEMA_LIST_FLOW_EXECUTION_EVENTS_INPUT.members[ - "flowAliasIdentifier" - ] - ) - - case 2: - kwargs["execution_identifier"] = de.read_string( - _SCHEMA_LIST_FLOW_EXECUTION_EVENTS_INPUT.members[ - "executionIdentifier" - ] - ) - - case 3: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_FLOW_EXECUTION_EVENTS_INPUT.members["maxResults"] - ) - - case 4: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_FLOW_EXECUTION_EVENTS_INPUT.members["nextToken"] - ) - - case 5: - kwargs["event_type"] = FlowExecutionEventType( - de.read_string( - _SCHEMA_LIST_FLOW_EXECUTION_EVENTS_INPUT.members[ - "eventType" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_FLOW_EXECUTION_EVENTS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class SatisfiedCondition: - """ - Represents a condition that was satisfied during a condition node - evaluation in a flow execution. - - Note: - Flow executions is in preview release for Amazon Bedrock and is subject - to change. - """ - - condition_name: str - """The name of the condition that was satisfied.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SATISFIED_CONDITION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SATISFIED_CONDITION.members["conditionName"], self.condition_name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["condition_name"] = de.read_string( - _SCHEMA_SATISFIED_CONDITION.members["conditionName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SATISFIED_CONDITION, consumer=_consumer) - if "condition_name" not in kwargs: - kwargs["condition_name"] = "" - return kwargs - - -def _serialize_satisfied_conditions( - serializer: ShapeSerializer, schema: Schema, value: list[SatisfiedCondition] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_satisfied_conditions( - deserializer: ShapeDeserializer, schema: Schema -) -> list[SatisfiedCondition]: - result: list[SatisfiedCondition] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(SatisfiedCondition.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ConditionResultEvent: - """ - Contains information about a condition evaluation result during a flow - execution. This event is generated when a condition node in the flow - evaluates its conditions. - - Note: - Flow executions is in preview release for Amazon Bedrock and is subject - to change. - """ - - node_name: str - """The name of the condition node that evaluated the conditions.""" - - timestamp: datetime - """The timestamp when the condition evaluation occurred.""" - - satisfied_conditions: list[SatisfiedCondition] - """A list of conditions that were satisfied during the evaluation.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONDITION_RESULT_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CONDITION_RESULT_EVENT.members["nodeName"], self.node_name - ) - serializer.write_timestamp( - _SCHEMA_CONDITION_RESULT_EVENT.members["timestamp"], self.timestamp - ) - _serialize_satisfied_conditions( - serializer, - _SCHEMA_CONDITION_RESULT_EVENT.members["satisfiedConditions"], - self.satisfied_conditions, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["node_name"] = de.read_string( - _SCHEMA_CONDITION_RESULT_EVENT.members["nodeName"] - ) - - case 1: - kwargs["timestamp"] = de.read_timestamp( - _SCHEMA_CONDITION_RESULT_EVENT.members["timestamp"] - ) - - case 2: - kwargs["satisfied_conditions"] = _deserialize_satisfied_conditions( - de, - _SCHEMA_CONDITION_RESULT_EVENT.members["satisfiedConditions"], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONDITION_RESULT_EVENT, consumer=_consumer) - if "node_name" not in kwargs: - kwargs["node_name"] = "" - if "timestamp" not in kwargs: - kwargs["timestamp"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "satisfied_conditions" not in kwargs: - kwargs["satisfied_conditions"] = [] - return kwargs - - -class FlowErrorCode(UnknownEnumMixin, StrEnum): - VALIDATION = "VALIDATION" - INTERNAL_SERVER = "INTERNAL_SERVER" - NODE_EXECUTION_FAILED = "NODE_EXECUTION_FAILED" - - -@dataclass(kw_only=True) -class FlowFailureEvent: - """ - Contains information about a failure that occurred at the flow level - during a flow execution. - - Note: - Flow executions is in preview release for Amazon Bedrock and is subject - to change. - """ - - timestamp: datetime - """The timestamp when the failure occurred.""" - - error_code: str - """The error code that identifies the type of failure that occurred.""" - - error_message: str - """A descriptive message that provides details about the failure.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_FAILURE_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_timestamp( - _SCHEMA_FLOW_FAILURE_EVENT.members["timestamp"], self.timestamp - ) - serializer.write_string( - _SCHEMA_FLOW_FAILURE_EVENT.members["errorCode"], self.error_code - ) - serializer.write_string( - _SCHEMA_FLOW_FAILURE_EVENT.members["errorMessage"], self.error_message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["timestamp"] = de.read_timestamp( - _SCHEMA_FLOW_FAILURE_EVENT.members["timestamp"] - ) - - case 1: - kwargs["error_code"] = FlowErrorCode( - de.read_string(_SCHEMA_FLOW_FAILURE_EVENT.members["errorCode"]) - ) - - case 2: - kwargs["error_message"] = de.read_string( - _SCHEMA_FLOW_FAILURE_EVENT.members["errorMessage"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FLOW_FAILURE_EVENT, consumer=_consumer) - if "timestamp" not in kwargs: - kwargs["timestamp"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "error_code" not in kwargs: - kwargs["error_code"] = FlowErrorCode._corrected("") - if "error_message" not in kwargs: - kwargs["error_message"] = "" - return kwargs - - -@dataclass -class FlowExecutionContentDocument: - """ - The document content of the field, which can contain text or structured - data. - """ - - value: Document - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_EXECUTION_CONTENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_document( - _SCHEMA_FLOW_EXECUTION_CONTENT.members["document"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_document( - _SCHEMA_FLOW_EXECUTION_CONTENT.members["document"] - ) - ) - - -@dataclass -class FlowExecutionContentUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -FlowExecutionContent = Union[FlowExecutionContentDocument | FlowExecutionContentUnknown] -""" -Contains the content of an flow execution input or output field. - -Note: - Flow executions is in preview release for Amazon Bedrock and is subject - to change. -""" - - -class _FlowExecutionContentDeserializer: - _result: FlowExecutionContent | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> FlowExecutionContent: - self._result = None - deserializer.read_struct(_SCHEMA_FLOW_EXECUTION_CONTENT, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(FlowExecutionContentDocument.deserialize(de)) - - case _: - self._set_result( - FlowExecutionContentUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: FlowExecutionContent) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class FlowInputField: - """ - Represents an input field provided to a flow during a flow execution. - - Note: - Flow executions is in preview release for Amazon Bedrock and is subject - to change. - """ - - name: str - """The name of the input field as defined in the flow's input schema.""" - - content: FlowExecutionContent = field(repr=False) - """ - The content of the input field, which can contain text or structured - data. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_INPUT_FIELD, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_FLOW_INPUT_FIELD.members["name"], self.name) - serializer.write_struct( - _SCHEMA_FLOW_INPUT_FIELD.members["content"], self.content - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_FLOW_INPUT_FIELD.members["name"] - ) - - case 1: - kwargs["content"] = _FlowExecutionContentDeserializer().deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FLOW_INPUT_FIELD, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "content" not in kwargs: - kwargs["content"] = FlowExecutionContentUnknown(tag="") - return kwargs - - -def _serialize_flow_input_fields( - serializer: ShapeSerializer, schema: Schema, value: list[FlowInputField] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_flow_input_fields( - deserializer: ShapeDeserializer, schema: Schema -) -> list[FlowInputField]: - result: list[FlowInputField] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(FlowInputField.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class FlowExecutionInputEvent: - """ - Contains information about the inputs provided to the flow at the start - of a flow execution. - - Note: - Flow executions is in preview release for Amazon Bedrock and is subject - to change. - """ - - node_name: str - """The name of the node that receives the inputs.""" - - timestamp: datetime - """The timestamp when the inputs are provided.""" - - fields: list[FlowInputField] - """A list of input fields provided to the flow.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_EXECUTION_INPUT_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_FLOW_EXECUTION_INPUT_EVENT.members["nodeName"], self.node_name - ) - serializer.write_timestamp( - _SCHEMA_FLOW_EXECUTION_INPUT_EVENT.members["timestamp"], self.timestamp - ) - _serialize_flow_input_fields( - serializer, - _SCHEMA_FLOW_EXECUTION_INPUT_EVENT.members["fields"], - self.fields, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["node_name"] = de.read_string( - _SCHEMA_FLOW_EXECUTION_INPUT_EVENT.members["nodeName"] - ) - - case 1: - kwargs["timestamp"] = de.read_timestamp( - _SCHEMA_FLOW_EXECUTION_INPUT_EVENT.members["timestamp"] - ) - - case 2: - kwargs["fields"] = _deserialize_flow_input_fields( - de, _SCHEMA_FLOW_EXECUTION_INPUT_EVENT.members["fields"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FLOW_EXECUTION_INPUT_EVENT, consumer=_consumer) - if "node_name" not in kwargs: - kwargs["node_name"] = "" - if "timestamp" not in kwargs: - kwargs["timestamp"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "fields" not in kwargs: - kwargs["fields"] = [] - return kwargs - - -@dataclass(kw_only=True) -class FlowOutputField: - """ - Represents an output field produced by a flow during a flow execution. - - Note: - Flow executions is in preview release for Amazon Bedrock and is subject - to change. - """ - - name: str - """The name of the output field as defined in the flow's output schema.""" - - content: FlowExecutionContent = field(repr=False) - """ - The content of the output field, which can contain text or structured - data. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_OUTPUT_FIELD, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_FLOW_OUTPUT_FIELD.members["name"], self.name) - serializer.write_struct( - _SCHEMA_FLOW_OUTPUT_FIELD.members["content"], self.content - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_FLOW_OUTPUT_FIELD.members["name"] - ) - - case 1: - kwargs["content"] = _FlowExecutionContentDeserializer().deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FLOW_OUTPUT_FIELD, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "content" not in kwargs: - kwargs["content"] = FlowExecutionContentUnknown(tag="") - return kwargs - - -def _serialize_flow_output_fields( - serializer: ShapeSerializer, schema: Schema, value: list[FlowOutputField] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_flow_output_fields( - deserializer: ShapeDeserializer, schema: Schema -) -> list[FlowOutputField]: - result: list[FlowOutputField] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(FlowOutputField.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class FlowExecutionOutputEvent: - """ - Contains information about the outputs produced by the flow during a - flow execution. - - Note: - Flow executions is in preview release for Amazon Bedrock and is subject - to change. - """ - - node_name: str - """The name of the node that produces the outputs.""" - - timestamp: datetime - """The timestamp when the outputs are produced.""" - - fields: list[FlowOutputField] - """A list of output fields produced by the flow.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_EXECUTION_OUTPUT_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_FLOW_EXECUTION_OUTPUT_EVENT.members["nodeName"], self.node_name - ) - serializer.write_timestamp( - _SCHEMA_FLOW_EXECUTION_OUTPUT_EVENT.members["timestamp"], self.timestamp - ) - _serialize_flow_output_fields( - serializer, - _SCHEMA_FLOW_EXECUTION_OUTPUT_EVENT.members["fields"], - self.fields, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["node_name"] = de.read_string( - _SCHEMA_FLOW_EXECUTION_OUTPUT_EVENT.members["nodeName"] - ) - - case 1: - kwargs["timestamp"] = de.read_timestamp( - _SCHEMA_FLOW_EXECUTION_OUTPUT_EVENT.members["timestamp"] - ) - - case 2: - kwargs["fields"] = _deserialize_flow_output_fields( - de, _SCHEMA_FLOW_EXECUTION_OUTPUT_EVENT.members["fields"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_FLOW_EXECUTION_OUTPUT_EVENT, consumer=_consumer - ) - if "node_name" not in kwargs: - kwargs["node_name"] = "" - if "timestamp" not in kwargs: - kwargs["timestamp"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "fields" not in kwargs: - kwargs["fields"] = [] - return kwargs - - -@dataclass(kw_only=True) -class NodeActionEvent: - """ - Contains information about an action (operation) called by a node during - execution. - """ - - node_name: str - """The name of the node that called the operation.""" - - timestamp: datetime - """The date and time that the operation was called.""" - - request_id: str - """The ID of the request that the node made to the operation.""" - - service_name: str - """The name of the service that the node called.""" - - operation_name: str - """The name of the operation that the node called.""" - - operation_request: Document | None = None - """The request payload sent to the downstream service.""" - - operation_response: Document | None = None - """The response payload received from the downstream service.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_NODE_ACTION_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_NODE_ACTION_EVENT.members["nodeName"], self.node_name - ) - serializer.write_timestamp( - _SCHEMA_NODE_ACTION_EVENT.members["timestamp"], self.timestamp - ) - serializer.write_string( - _SCHEMA_NODE_ACTION_EVENT.members["requestId"], self.request_id - ) - serializer.write_string( - _SCHEMA_NODE_ACTION_EVENT.members["serviceName"], self.service_name - ) - serializer.write_string( - _SCHEMA_NODE_ACTION_EVENT.members["operationName"], self.operation_name - ) - if self.operation_request is not None: - serializer.write_document( - _SCHEMA_NODE_ACTION_EVENT.members["operationRequest"], - self.operation_request, - ) - - if self.operation_response is not None: - serializer.write_document( - _SCHEMA_NODE_ACTION_EVENT.members["operationResponse"], - self.operation_response, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["node_name"] = de.read_string( - _SCHEMA_NODE_ACTION_EVENT.members["nodeName"] - ) - - case 1: - kwargs["timestamp"] = de.read_timestamp( - _SCHEMA_NODE_ACTION_EVENT.members["timestamp"] - ) - - case 2: - kwargs["request_id"] = de.read_string( - _SCHEMA_NODE_ACTION_EVENT.members["requestId"] - ) - - case 3: - kwargs["service_name"] = de.read_string( - _SCHEMA_NODE_ACTION_EVENT.members["serviceName"] - ) - - case 4: - kwargs["operation_name"] = de.read_string( - _SCHEMA_NODE_ACTION_EVENT.members["operationName"] - ) - - case 5: - kwargs["operation_request"] = de.read_document( - _SCHEMA_NODE_ACTION_EVENT.members["operationRequest"] - ) - - case 6: - kwargs["operation_response"] = de.read_document( - _SCHEMA_NODE_ACTION_EVENT.members["operationResponse"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_NODE_ACTION_EVENT, consumer=_consumer) - if "node_name" not in kwargs: - kwargs["node_name"] = "" - if "timestamp" not in kwargs: - kwargs["timestamp"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "request_id" not in kwargs: - kwargs["request_id"] = "" - if "service_name" not in kwargs: - kwargs["service_name"] = "" - if "operation_name" not in kwargs: - kwargs["operation_name"] = "" - return kwargs - - -@dataclass -class NodeTraceElementsAgentTraces: - """Agent trace information for the node execution.""" - - value: list[TracePart] - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_NODE_TRACE_ELEMENTS, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_agent_traces( - serializer, _SCHEMA_NODE_TRACE_ELEMENTS.members["agentTraces"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_deserialize_agent_traces( - deserializer, _SCHEMA_NODE_TRACE_ELEMENTS.members["agentTraces"] - ) - ) - - -@dataclass -class NodeTraceElementsUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -NodeTraceElements = Union[NodeTraceElementsAgentTraces | NodeTraceElementsUnknown] -"""Contains trace elements for node execution tracking.""" - - -class _NodeTraceElementsDeserializer: - _result: NodeTraceElements | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> NodeTraceElements: - self._result = None - deserializer.read_struct(_SCHEMA_NODE_TRACE_ELEMENTS, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(NodeTraceElementsAgentTraces.deserialize(de)) - - case _: - self._set_result( - NodeTraceElementsUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: NodeTraceElements) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class NodeDependencyEvent: - """ - Contains information about an internal trace of a specific node during - execution. - """ - - node_name: str - """The name of the node that generated the dependency trace.""" - - timestamp: datetime - """The date and time that the dependency trace was generated.""" - - trace_elements: NodeTraceElements = field(repr=False) - """ - The trace elements containing detailed information about the node - execution. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_NODE_DEPENDENCY_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_NODE_DEPENDENCY_EVENT.members["nodeName"], self.node_name - ) - serializer.write_timestamp( - _SCHEMA_NODE_DEPENDENCY_EVENT.members["timestamp"], self.timestamp - ) - serializer.write_struct( - _SCHEMA_NODE_DEPENDENCY_EVENT.members["traceElements"], self.trace_elements - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["node_name"] = de.read_string( - _SCHEMA_NODE_DEPENDENCY_EVENT.members["nodeName"] - ) - - case 1: - kwargs["timestamp"] = de.read_timestamp( - _SCHEMA_NODE_DEPENDENCY_EVENT.members["timestamp"] - ) - - case 2: - kwargs["trace_elements"] = ( - _NodeTraceElementsDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_NODE_DEPENDENCY_EVENT, consumer=_consumer) - if "node_name" not in kwargs: - kwargs["node_name"] = "" - if "timestamp" not in kwargs: - kwargs["timestamp"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "trace_elements" not in kwargs: - kwargs["trace_elements"] = NodeTraceElementsUnknown(tag="") - return kwargs - - -class NodeErrorCode(UnknownEnumMixin, StrEnum): - VALIDATION = "VALIDATION" - DEPENDENCY_FAILED = "DEPENDENCY_FAILED" - BAD_GATEWAY = "BAD_GATEWAY" - INTERNAL_SERVER = "INTERNAL_SERVER" - - -@dataclass(kw_only=True) -class NodeFailureEvent: - """ - Contains information about a failure that occurred at a specific node - during a flow execution. - - Note: - Flow executions is in preview release for Amazon Bedrock and is subject - to change. - """ - - node_name: str - """The name of the node where the failure occurred.""" - - timestamp: datetime - """The timestamp when the node failure occurred.""" - - error_code: str - """ - The error code that identifies the type of failure that occurred at the - node. - """ - - error_message: str - """A descriptive message that provides details about the node failure.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_NODE_FAILURE_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_NODE_FAILURE_EVENT.members["nodeName"], self.node_name - ) - serializer.write_timestamp( - _SCHEMA_NODE_FAILURE_EVENT.members["timestamp"], self.timestamp - ) - serializer.write_string( - _SCHEMA_NODE_FAILURE_EVENT.members["errorCode"], self.error_code - ) - serializer.write_string( - _SCHEMA_NODE_FAILURE_EVENT.members["errorMessage"], self.error_message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["node_name"] = de.read_string( - _SCHEMA_NODE_FAILURE_EVENT.members["nodeName"] - ) - - case 1: - kwargs["timestamp"] = de.read_timestamp( - _SCHEMA_NODE_FAILURE_EVENT.members["timestamp"] - ) - - case 2: - kwargs["error_code"] = NodeErrorCode( - de.read_string(_SCHEMA_NODE_FAILURE_EVENT.members["errorCode"]) - ) - - case 3: - kwargs["error_message"] = de.read_string( - _SCHEMA_NODE_FAILURE_EVENT.members["errorMessage"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_NODE_FAILURE_EVENT, consumer=_consumer) - if "node_name" not in kwargs: - kwargs["node_name"] = "" - if "timestamp" not in kwargs: - kwargs["timestamp"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "error_code" not in kwargs: - kwargs["error_code"] = NodeErrorCode._corrected("") - if "error_message" not in kwargs: - kwargs["error_message"] = "" - return kwargs - - -class FlowNodeInputCategory(UnknownEnumMixin, StrEnum): - LOOP_CONDITION = "LoopCondition" - RETURN_VALUE_TO_LOOP_START = "ReturnValueToLoopStart" - EXIT_LOOP = "ExitLoop" - - -@dataclass -class NodeExecutionContentDocument: - """ - The document content of the field, which can contain text or structured - data. - """ - - value: Document - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_NODE_EXECUTION_CONTENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_document( - _SCHEMA_NODE_EXECUTION_CONTENT.members["document"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_document( - _SCHEMA_NODE_EXECUTION_CONTENT.members["document"] - ) - ) - - -@dataclass -class NodeExecutionContentUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -NodeExecutionContent = Union[NodeExecutionContentDocument | NodeExecutionContentUnknown] -""" -Contains the content of a flow node's input or output field for a flow -execution. - -Note: - Flow executions is in preview release for Amazon Bedrock and is subject - to change. -""" - - -class _NodeExecutionContentDeserializer: - _result: NodeExecutionContent | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> NodeExecutionContent: - self._result = None - deserializer.read_struct(_SCHEMA_NODE_EXECUTION_CONTENT, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(NodeExecutionContentDocument.deserialize(de)) - - case _: - self._set_result( - NodeExecutionContentUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: NodeExecutionContent) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class FlowControlNodeType(UnknownEnumMixin, StrEnum): - ITERATOR = "Iterator" - LOOP = "Loop" - - -@dataclass(kw_only=True) -class NodeInputExecutionChainItem: - """Represents an item in the execution chain for node input tracking.""" - - node_name: str - """The name of the node in the execution chain.""" - - type: str - """ - The type of execution chain item. Supported values are Iterator and - Loop. - """ - - index: int | None = None - """The index position of this item in the execution chain.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_NODE_INPUT_EXECUTION_CHAIN_ITEM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_NODE_INPUT_EXECUTION_CHAIN_ITEM.members["nodeName"], self.node_name - ) - if self.index is not None: - serializer.write_integer( - _SCHEMA_NODE_INPUT_EXECUTION_CHAIN_ITEM.members["index"], self.index - ) - - serializer.write_string( - _SCHEMA_NODE_INPUT_EXECUTION_CHAIN_ITEM.members["type"], self.type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["node_name"] = de.read_string( - _SCHEMA_NODE_INPUT_EXECUTION_CHAIN_ITEM.members["nodeName"] - ) - - case 1: - kwargs["index"] = de.read_integer( - _SCHEMA_NODE_INPUT_EXECUTION_CHAIN_ITEM.members["index"] - ) - - case 2: - kwargs["type"] = FlowControlNodeType( - de.read_string( - _SCHEMA_NODE_INPUT_EXECUTION_CHAIN_ITEM.members["type"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_NODE_INPUT_EXECUTION_CHAIN_ITEM, consumer=_consumer - ) - if "node_name" not in kwargs: - kwargs["node_name"] = "" - if "type" not in kwargs: - kwargs["type"] = FlowControlNodeType._corrected("") - return kwargs - - -def _serialize_node_input_execution_chain( - serializer: ShapeSerializer, - schema: Schema, - value: list[NodeInputExecutionChainItem], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_node_input_execution_chain( - deserializer: ShapeDeserializer, schema: Schema -) -> list[NodeInputExecutionChainItem]: - result: list[NodeInputExecutionChainItem] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(NodeInputExecutionChainItem.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class NodeInputSource: - """Represents the source of input data for a node field.""" - - node_name: str - """The name of the source node that provides the input data.""" - - output_field_name: str - """The name of the output field from the source node.""" - - expression: str = field(repr=False) - """The expression used to extract data from the source.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_NODE_INPUT_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_NODE_INPUT_SOURCE.members["nodeName"], self.node_name - ) - serializer.write_string( - _SCHEMA_NODE_INPUT_SOURCE.members["outputFieldName"], self.output_field_name - ) - serializer.write_string( - _SCHEMA_NODE_INPUT_SOURCE.members["expression"], self.expression - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["node_name"] = de.read_string( - _SCHEMA_NODE_INPUT_SOURCE.members["nodeName"] - ) - - case 1: - kwargs["output_field_name"] = de.read_string( - _SCHEMA_NODE_INPUT_SOURCE.members["outputFieldName"] - ) - - case 2: - kwargs["expression"] = de.read_string( - _SCHEMA_NODE_INPUT_SOURCE.members["expression"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_NODE_INPUT_SOURCE, consumer=_consumer) - if "node_name" not in kwargs: - kwargs["node_name"] = "" - if "output_field_name" not in kwargs: - kwargs["output_field_name"] = "" - if "expression" not in kwargs: - kwargs["expression"] = "" - return kwargs - - -class FlowNodeIODataType(UnknownEnumMixin, StrEnum): - STRING = "String" - NUMBER = "Number" - BOOLEAN = "Boolean" - OBJECT = "Object" - ARRAY = "Array" - - -@dataclass(kw_only=True) -class NodeInputField: - """Represents an input field provided to a node during a flow execution.""" - - name: str - """The name of the input field as defined in the node's input schema.""" - - content: NodeExecutionContent = field(repr=False) - """ - The content of the input field, which can contain text or structured - data. - """ - - source: NodeInputSource | None = None - """The source node that provides input data to this field.""" - - type: str | None = None - """The data type of the input field for compatibility validation.""" - - category: str | None = None - """The category of the input field.""" - - execution_chain: list[NodeInputExecutionChainItem] | None = None - """The execution path through nested nodes like iterators and loops.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_NODE_INPUT_FIELD, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_NODE_INPUT_FIELD.members["name"], self.name) - serializer.write_struct( - _SCHEMA_NODE_INPUT_FIELD.members["content"], self.content - ) - if self.source is not None: - serializer.write_struct( - _SCHEMA_NODE_INPUT_FIELD.members["source"], self.source - ) - - if self.type is not None: - serializer.write_string(_SCHEMA_NODE_INPUT_FIELD.members["type"], self.type) - - if self.category is not None: - serializer.write_string( - _SCHEMA_NODE_INPUT_FIELD.members["category"], self.category - ) - - if self.execution_chain is not None: - _serialize_node_input_execution_chain( - serializer, - _SCHEMA_NODE_INPUT_FIELD.members["executionChain"], - self.execution_chain, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_NODE_INPUT_FIELD.members["name"] - ) - - case 1: - kwargs["content"] = _NodeExecutionContentDeserializer().deserialize( - de - ) - - case 2: - kwargs["source"] = NodeInputSource.deserialize(de) - - case 3: - kwargs["type"] = FlowNodeIODataType( - de.read_string(_SCHEMA_NODE_INPUT_FIELD.members["type"]) - ) - - case 4: - kwargs["category"] = FlowNodeInputCategory( - de.read_string(_SCHEMA_NODE_INPUT_FIELD.members["category"]) - ) - - case 5: - kwargs["execution_chain"] = _deserialize_node_input_execution_chain( - de, _SCHEMA_NODE_INPUT_FIELD.members["executionChain"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_NODE_INPUT_FIELD, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "content" not in kwargs: - kwargs["content"] = NodeExecutionContentUnknown(tag="") - return kwargs - - -def _serialize_node_input_fields( - serializer: ShapeSerializer, schema: Schema, value: list[NodeInputField] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_node_input_fields( - deserializer: ShapeDeserializer, schema: Schema -) -> list[NodeInputField]: - result: list[NodeInputField] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(NodeInputField.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class NodeInputEvent: - """ - Contains information about the inputs provided to a specific node during - a flow execution. - - Note: - Flow executions is in preview release for Amazon Bedrock and is subject - to change. - """ - - node_name: str - """The name of the node that received the inputs.""" - - timestamp: datetime - """The timestamp when the inputs were provided to the node.""" - - fields: list[NodeInputField] - """A list of input fields provided to the node.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_NODE_INPUT_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_NODE_INPUT_EVENT.members["nodeName"], self.node_name - ) - serializer.write_timestamp( - _SCHEMA_NODE_INPUT_EVENT.members["timestamp"], self.timestamp - ) - _serialize_node_input_fields( - serializer, _SCHEMA_NODE_INPUT_EVENT.members["fields"], self.fields - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["node_name"] = de.read_string( - _SCHEMA_NODE_INPUT_EVENT.members["nodeName"] - ) - - case 1: - kwargs["timestamp"] = de.read_timestamp( - _SCHEMA_NODE_INPUT_EVENT.members["timestamp"] - ) - - case 2: - kwargs["fields"] = _deserialize_node_input_fields( - de, _SCHEMA_NODE_INPUT_EVENT.members["fields"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_NODE_INPUT_EVENT, consumer=_consumer) - if "node_name" not in kwargs: - kwargs["node_name"] = "" - if "timestamp" not in kwargs: - kwargs["timestamp"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "fields" not in kwargs: - kwargs["fields"] = [] - return kwargs - - -@dataclass(kw_only=True) -class NodeOutputNext: - """Represents the next node that receives output data.""" - - node_name: str - """The name of the next node that receives the output data.""" - - input_field_name: str - """The name of the input field in the next node that receives the data.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_NODE_OUTPUT_NEXT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_NODE_OUTPUT_NEXT.members["nodeName"], self.node_name - ) - serializer.write_string( - _SCHEMA_NODE_OUTPUT_NEXT.members["inputFieldName"], self.input_field_name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["node_name"] = de.read_string( - _SCHEMA_NODE_OUTPUT_NEXT.members["nodeName"] - ) - - case 1: - kwargs["input_field_name"] = de.read_string( - _SCHEMA_NODE_OUTPUT_NEXT.members["inputFieldName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_NODE_OUTPUT_NEXT, consumer=_consumer) - if "node_name" not in kwargs: - kwargs["node_name"] = "" - if "input_field_name" not in kwargs: - kwargs["input_field_name"] = "" - return kwargs - - -def _serialize_node_output_next_list( - serializer: ShapeSerializer, schema: Schema, value: list[NodeOutputNext] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_node_output_next_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[NodeOutputNext]: - result: list[NodeOutputNext] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(NodeOutputNext.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class NodeOutputField: - """ - Represents an output field produced by a node during a flow execution. - - Note: - Flow executions is in preview release for Amazon Bedrock and is subject - to change. - """ - - name: str - """The name of the output field as defined in the node's output schema.""" - - content: NodeExecutionContent = field(repr=False) - """ - The content of the output field, which can contain text or structured - data. - """ - - next: list[NodeOutputNext] | None = None - """The next node that receives output data from this field.""" - - type: str | None = None - """The data type of the output field for compatibility validation.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_NODE_OUTPUT_FIELD, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_NODE_OUTPUT_FIELD.members["name"], self.name) - serializer.write_struct( - _SCHEMA_NODE_OUTPUT_FIELD.members["content"], self.content - ) - if self.next is not None: - _serialize_node_output_next_list( - serializer, _SCHEMA_NODE_OUTPUT_FIELD.members["next"], self.next - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_NODE_OUTPUT_FIELD.members["type"], self.type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_NODE_OUTPUT_FIELD.members["name"] - ) - - case 1: - kwargs["content"] = _NodeExecutionContentDeserializer().deserialize( - de - ) - - case 2: - kwargs["next"] = _deserialize_node_output_next_list( - de, _SCHEMA_NODE_OUTPUT_FIELD.members["next"] - ) - - case 3: - kwargs["type"] = FlowNodeIODataType( - de.read_string(_SCHEMA_NODE_OUTPUT_FIELD.members["type"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_NODE_OUTPUT_FIELD, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "content" not in kwargs: - kwargs["content"] = NodeExecutionContentUnknown(tag="") - return kwargs - - -def _serialize_node_output_fields( - serializer: ShapeSerializer, schema: Schema, value: list[NodeOutputField] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_node_output_fields( - deserializer: ShapeDeserializer, schema: Schema -) -> list[NodeOutputField]: - result: list[NodeOutputField] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(NodeOutputField.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class NodeOutputEvent: - """ - Contains information about the outputs produced by a specific node - during a flow execution. - - Note: - Flow executions is in preview release for Amazon Bedrock and is subject - to change. - """ - - node_name: str - """The name of the node that produced the outputs.""" - - timestamp: datetime - """The timestamp when the outputs were produced by the node.""" - - fields: list[NodeOutputField] - """A list of output fields produced by the node.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_NODE_OUTPUT_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_NODE_OUTPUT_EVENT.members["nodeName"], self.node_name - ) - serializer.write_timestamp( - _SCHEMA_NODE_OUTPUT_EVENT.members["timestamp"], self.timestamp - ) - _serialize_node_output_fields( - serializer, _SCHEMA_NODE_OUTPUT_EVENT.members["fields"], self.fields - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["node_name"] = de.read_string( - _SCHEMA_NODE_OUTPUT_EVENT.members["nodeName"] - ) - - case 1: - kwargs["timestamp"] = de.read_timestamp( - _SCHEMA_NODE_OUTPUT_EVENT.members["timestamp"] - ) - - case 2: - kwargs["fields"] = _deserialize_node_output_fields( - de, _SCHEMA_NODE_OUTPUT_EVENT.members["fields"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_NODE_OUTPUT_EVENT, consumer=_consumer) - if "node_name" not in kwargs: - kwargs["node_name"] = "" - if "timestamp" not in kwargs: - kwargs["timestamp"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "fields" not in kwargs: - kwargs["fields"] = [] - return kwargs - - -@dataclass -class FlowExecutionEventFlowInputEvent: - """ - Contains information about the inputs provided to the flow at the start - of execution. - """ - - value: FlowExecutionInputEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_EXECUTION_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_EXECUTION_EVENT.members["flowInputEvent"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=FlowExecutionInputEvent.deserialize(deserializer)) - - -@dataclass -class FlowExecutionEventFlowOutputEvent: - """ - Contains information about the outputs produced by the flow at the end - of execution. - """ - - value: FlowExecutionOutputEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_EXECUTION_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_EXECUTION_EVENT.members["flowOutputEvent"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=FlowExecutionOutputEvent.deserialize(deserializer)) - - -@dataclass -class FlowExecutionEventNodeInputEvent: - """ - Contains information about the inputs provided to a specific node during - execution. - """ - - value: NodeInputEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_EXECUTION_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_EXECUTION_EVENT.members["nodeInputEvent"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=NodeInputEvent.deserialize(deserializer)) - - -@dataclass -class FlowExecutionEventNodeOutputEvent: - """ - Contains information about the outputs produced by a specific node - during execution. - """ - - value: NodeOutputEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_EXECUTION_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_EXECUTION_EVENT.members["nodeOutputEvent"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=NodeOutputEvent.deserialize(deserializer)) - - -@dataclass -class FlowExecutionEventConditionResultEvent: - """ - Contains information about a condition evaluation result during the flow - execution. This event is generated when a condition node in the flow - evaluates its conditions. - """ - - value: ConditionResultEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_EXECUTION_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_EXECUTION_EVENT.members["conditionResultEvent"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ConditionResultEvent.deserialize(deserializer)) - - -@dataclass -class FlowExecutionEventNodeFailureEvent: - """ - Contains information about a failure that occurred at a specific node - during execution. - """ - - value: NodeFailureEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_EXECUTION_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_EXECUTION_EVENT.members["nodeFailureEvent"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=NodeFailureEvent.deserialize(deserializer)) - - -@dataclass -class FlowExecutionEventFlowFailureEvent: - """ - Contains information about a failure that occurred at the flow level - during execution. - """ - - value: FlowFailureEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_EXECUTION_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_EXECUTION_EVENT.members["flowFailureEvent"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=FlowFailureEvent.deserialize(deserializer)) - - -@dataclass -class FlowExecutionEventNodeActionEvent: - """ - Contains information about an action (operation) called by a node during - execution. - """ - - value: NodeActionEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_EXECUTION_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_EXECUTION_EVENT.members["nodeActionEvent"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=NodeActionEvent.deserialize(deserializer)) - - -@dataclass -class FlowExecutionEventNodeDependencyEvent: - """ - Contains information about an internal trace of a specific node during - execution. - """ - - value: NodeDependencyEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_EXECUTION_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_EXECUTION_EVENT.members["nodeDependencyEvent"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=NodeDependencyEvent.deserialize(deserializer)) - - -@dataclass -class FlowExecutionEventUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -FlowExecutionEvent = Union[ - FlowExecutionEventFlowInputEvent - | FlowExecutionEventFlowOutputEvent - | FlowExecutionEventNodeInputEvent - | FlowExecutionEventNodeOutputEvent - | FlowExecutionEventConditionResultEvent - | FlowExecutionEventNodeFailureEvent - | FlowExecutionEventFlowFailureEvent - | FlowExecutionEventNodeActionEvent - | FlowExecutionEventNodeDependencyEvent - | FlowExecutionEventUnknown -] -""" -Represents an event that occurred during an flow execution. This is a -union type that can contain one of several event types, such as node -input and output events; flow input and output events; condition node -result events, or failure events. - -Note: - Flow executions is in preview release for Amazon Bedrock and is subject - to change. -""" - - -class _FlowExecutionEventDeserializer: - _result: FlowExecutionEvent | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> FlowExecutionEvent: - self._result = None - deserializer.read_struct(_SCHEMA_FLOW_EXECUTION_EVENT, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(FlowExecutionEventFlowInputEvent.deserialize(de)) - - case 1: - self._set_result(FlowExecutionEventFlowOutputEvent.deserialize(de)) - - case 2: - self._set_result(FlowExecutionEventNodeInputEvent.deserialize(de)) - - case 3: - self._set_result(FlowExecutionEventNodeOutputEvent.deserialize(de)) - - case 4: - self._set_result(FlowExecutionEventConditionResultEvent.deserialize(de)) - - case 5: - self._set_result(FlowExecutionEventNodeFailureEvent.deserialize(de)) - - case 6: - self._set_result(FlowExecutionEventFlowFailureEvent.deserialize(de)) - - case 7: - self._set_result(FlowExecutionEventNodeActionEvent.deserialize(de)) - - case 8: - self._set_result(FlowExecutionEventNodeDependencyEvent.deserialize(de)) - - case _: - self._set_result( - FlowExecutionEventUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: FlowExecutionEvent) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_flow_execution_events( - serializer: ShapeSerializer, schema: Schema, value: list[FlowExecutionEvent] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_flow_execution_events( - deserializer: ShapeDeserializer, schema: Schema -) -> list[FlowExecutionEvent]: - result: list[FlowExecutionEvent] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_FlowExecutionEventDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListFlowExecutionEventsOutput: - """Dataclass for ListFlowExecutionEventsOutput structure.""" - - flow_execution_events: list[FlowExecutionEvent] - """ - A list of events that occurred during the flow execution. Events can - include node inputs and outputs, flow inputs and outputs, condition - results, and failure events. - """ - - next_token: str | None = None - """ - A token to retrieve the next set of results. This value is returned if - more results are available. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_FLOW_EXECUTION_EVENTS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_flow_execution_events( - serializer, - _SCHEMA_LIST_FLOW_EXECUTION_EVENTS_OUTPUT.members["flowExecutionEvents"], - self.flow_execution_events, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_FLOW_EXECUTION_EVENTS_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["flow_execution_events"] = ( - _deserialize_flow_execution_events( - de, - _SCHEMA_LIST_FLOW_EXECUTION_EVENTS_OUTPUT.members[ - "flowExecutionEvents" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_FLOW_EXECUTION_EVENTS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_FLOW_EXECUTION_EVENTS_OUTPUT, consumer=_consumer - ) - if "flow_execution_events" not in kwargs: - kwargs["flow_execution_events"] = [] - return kwargs - - -LIST_FLOW_EXECUTION_EVENTS = APIOperation( - input=ListFlowExecutionEventsInput, - output=ListFlowExecutionEventsOutput, - schema=_SCHEMA_LIST_FLOW_EXECUTION_EVENTS, - input_schema=_SCHEMA_LIST_FLOW_EXECUTION_EVENTS_INPUT, - output_schema=_SCHEMA_LIST_FLOW_EXECUTION_EVENTS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListFlowExecutionsInput: - """Dataclass for ListFlowExecutionsInput structure.""" - - flow_identifier: str | None = None - """The unique identifier of the flow to list executions for.""" - - flow_alias_identifier: str | None = None - """The unique identifier of the flow alias to list executions for.""" - - max_results: int | None = None - """ - The maximum number of flow executions to return in a single response. If - more executions exist than the specified `maxResults` value, a token is - included in the response so that the remaining results can be retrieved. - """ - - next_token: str | None = None - """ - A token to retrieve the next set of results. This value is returned in - the response if more results are available. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_FLOW_EXECUTIONS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.flow_identifier is not None: - serializer.write_string( - _SCHEMA_LIST_FLOW_EXECUTIONS_INPUT.members["flowIdentifier"], - self.flow_identifier, - ) - - if self.flow_alias_identifier is not None: - serializer.write_string( - _SCHEMA_LIST_FLOW_EXECUTIONS_INPUT.members["flowAliasIdentifier"], - self.flow_alias_identifier, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_FLOW_EXECUTIONS_INPUT.members["maxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_FLOW_EXECUTIONS_INPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["flow_identifier"] = de.read_string( - _SCHEMA_LIST_FLOW_EXECUTIONS_INPUT.members["flowIdentifier"] - ) - - case 1: - kwargs["flow_alias_identifier"] = de.read_string( - _SCHEMA_LIST_FLOW_EXECUTIONS_INPUT.members[ - "flowAliasIdentifier" - ] - ) - - case 2: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_FLOW_EXECUTIONS_INPUT.members["maxResults"] - ) - - case 3: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_FLOW_EXECUTIONS_INPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_FLOW_EXECUTIONS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class FlowExecutionSummary: - """ - Contains summary information about a flow execution, including its - status, timestamps, and identifiers. - - Note: - Flow executions is in preview release for Amazon Bedrock and is subject - to change. - """ - - execution_arn: str - """ - The Amazon Resource Name (ARN) that uniquely identifies the flow - execution. - """ - - flow_alias_identifier: str - """The unique identifier of the flow alias used for the execution.""" - - flow_identifier: str - """The unique identifier of the flow.""" - - flow_version: str - """The version of the flow used for the execution.""" - - status: str - """ - The current status of the flow execution. - - Flow executions time out after 24 hours. - """ - - created_at: datetime - """The timestamp when the flow execution was created.""" - - ended_at: datetime | None = None - """ - The timestamp when the flow execution ended. This field is only - populated when the execution has completed, failed, timed out, or been - aborted. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_EXECUTION_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_FLOW_EXECUTION_SUMMARY.members["executionArn"], self.execution_arn - ) - serializer.write_string( - _SCHEMA_FLOW_EXECUTION_SUMMARY.members["flowAliasIdentifier"], - self.flow_alias_identifier, - ) - serializer.write_string( - _SCHEMA_FLOW_EXECUTION_SUMMARY.members["flowIdentifier"], - self.flow_identifier, - ) - serializer.write_string( - _SCHEMA_FLOW_EXECUTION_SUMMARY.members["flowVersion"], self.flow_version - ) - serializer.write_string( - _SCHEMA_FLOW_EXECUTION_SUMMARY.members["status"], self.status - ) - serializer.write_timestamp( - _SCHEMA_FLOW_EXECUTION_SUMMARY.members["createdAt"], self.created_at - ) - if self.ended_at is not None: - serializer.write_timestamp( - _SCHEMA_FLOW_EXECUTION_SUMMARY.members["endedAt"], self.ended_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["execution_arn"] = de.read_string( - _SCHEMA_FLOW_EXECUTION_SUMMARY.members["executionArn"] - ) - - case 1: - kwargs["flow_alias_identifier"] = de.read_string( - _SCHEMA_FLOW_EXECUTION_SUMMARY.members["flowAliasIdentifier"] - ) - - case 2: - kwargs["flow_identifier"] = de.read_string( - _SCHEMA_FLOW_EXECUTION_SUMMARY.members["flowIdentifier"] - ) - - case 3: - kwargs["flow_version"] = de.read_string( - _SCHEMA_FLOW_EXECUTION_SUMMARY.members["flowVersion"] - ) - - case 4: - kwargs["status"] = FlowExecutionStatus( - de.read_string(_SCHEMA_FLOW_EXECUTION_SUMMARY.members["status"]) - ) - - case 5: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_FLOW_EXECUTION_SUMMARY.members["createdAt"] - ) - - case 6: - kwargs["ended_at"] = de.read_timestamp( - _SCHEMA_FLOW_EXECUTION_SUMMARY.members["endedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FLOW_EXECUTION_SUMMARY, consumer=_consumer) - if "execution_arn" not in kwargs: - kwargs["execution_arn"] = "" - if "flow_alias_identifier" not in kwargs: - kwargs["flow_alias_identifier"] = "" - if "flow_identifier" not in kwargs: - kwargs["flow_identifier"] = "" - if "flow_version" not in kwargs: - kwargs["flow_version"] = "" - if "status" not in kwargs: - kwargs["status"] = FlowExecutionStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_flow_execution_summaries( - serializer: ShapeSerializer, schema: Schema, value: list[FlowExecutionSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_flow_execution_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[FlowExecutionSummary]: - result: list[FlowExecutionSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(FlowExecutionSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListFlowExecutionsOutput: - """Dataclass for ListFlowExecutionsOutput structure.""" - - flow_execution_summaries: list[FlowExecutionSummary] - """ - A list of flow execution summaries. Each summary includes the execution - ARN, flow identifier, flow alias identifier, flow version, status, and - timestamps. - """ - - next_token: str | None = None - """ - A token to retrieve the next set of results. This value is returned if - more results are available. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_FLOW_EXECUTIONS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_flow_execution_summaries( - serializer, - _SCHEMA_LIST_FLOW_EXECUTIONS_OUTPUT.members["flowExecutionSummaries"], - self.flow_execution_summaries, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_FLOW_EXECUTIONS_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["flow_execution_summaries"] = ( - _deserialize_flow_execution_summaries( - de, - _SCHEMA_LIST_FLOW_EXECUTIONS_OUTPUT.members[ - "flowExecutionSummaries" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_FLOW_EXECUTIONS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_FLOW_EXECUTIONS_OUTPUT, consumer=_consumer - ) - if "flow_execution_summaries" not in kwargs: - kwargs["flow_execution_summaries"] = [] - return kwargs - - -LIST_FLOW_EXECUTIONS = APIOperation( - input=ListFlowExecutionsInput, - output=ListFlowExecutionsOutput, - schema=_SCHEMA_LIST_FLOW_EXECUTIONS, - input_schema=_SCHEMA_LIST_FLOW_EXECUTIONS_INPUT, - output_schema=_SCHEMA_LIST_FLOW_EXECUTIONS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass -class FlowInputContentDocument: - """The input to send to the prompt flow input node.""" - - value: Document - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_INPUT_CONTENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_document( - _SCHEMA_FLOW_INPUT_CONTENT.members["document"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_document( - _SCHEMA_FLOW_INPUT_CONTENT.members["document"] - ) - ) - - -@dataclass -class FlowInputContentUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -FlowInputContent = Union[FlowInputContentDocument | FlowInputContentUnknown] -"""Contains information about an input into the flow.""" - - -class _FlowInputContentDeserializer: - _result: FlowInputContent | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> FlowInputContent: - self._result = None - deserializer.read_struct(_SCHEMA_FLOW_INPUT_CONTENT, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(FlowInputContentDocument.deserialize(de)) - - case _: - self._set_result( - FlowInputContentUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: FlowInputContent) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class FlowInput: - """ - Contains information about an input into the prompt flow and where to - send it. - """ - - node_name: str - """The name of the flow input node that begins the prompt flow.""" - - content: FlowInputContent = field(repr=False) - """Contains information about an input into the prompt flow.""" - - node_output_name: str | None = None - """ - The name of the output from the flow input node that begins the prompt - flow. - """ - - node_input_name: str | None = None - """The name of the input from the flow input node.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_FLOW_INPUT.members["nodeName"], self.node_name) - if self.node_output_name is not None: - serializer.write_string( - _SCHEMA_FLOW_INPUT.members["nodeOutputName"], self.node_output_name - ) - - serializer.write_struct(_SCHEMA_FLOW_INPUT.members["content"], self.content) - if self.node_input_name is not None: - serializer.write_string( - _SCHEMA_FLOW_INPUT.members["nodeInputName"], self.node_input_name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["node_name"] = de.read_string( - _SCHEMA_FLOW_INPUT.members["nodeName"] - ) - - case 1: - kwargs["node_output_name"] = de.read_string( - _SCHEMA_FLOW_INPUT.members["nodeOutputName"] - ) - - case 2: - kwargs["content"] = _FlowInputContentDeserializer().deserialize(de) - - case 3: - kwargs["node_input_name"] = de.read_string( - _SCHEMA_FLOW_INPUT.members["nodeInputName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FLOW_INPUT, consumer=_consumer) - if "node_name" not in kwargs: - kwargs["node_name"] = "" - if "content" not in kwargs: - kwargs["content"] = FlowInputContentUnknown(tag="") - return kwargs - - -def _serialize_flow_inputs( - serializer: ShapeSerializer, schema: Schema, value: list[FlowInput] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_flow_inputs( - deserializer: ShapeDeserializer, schema: Schema -) -> list[FlowInput]: - result: list[FlowInput] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(FlowInput.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class PerformanceConfigLatency(UnknownEnumMixin, StrEnum): - STANDARD = "standard" - OPTIMIZED = "optimized" - - -@dataclass(kw_only=True) -class PerformanceConfiguration: - """Performance settings for a model.""" - - latency: str = PerformanceConfigLatency("standard") - """To use a latency-optimized version of the model, set to `optimized`.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PERFORMANCE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_PERFORMANCE_CONFIGURATION.members["latency"], self.latency - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["latency"] = PerformanceConfigLatency( - de.read_string( - _SCHEMA_PERFORMANCE_CONFIGURATION.members["latency"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PERFORMANCE_CONFIGURATION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ModelPerformanceConfiguration: - """The performance configuration for a model called with InvokeFlow.""" - - performance_config: PerformanceConfiguration | None = None - """The latency configuration for the model.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MODEL_PERFORMANCE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.performance_config is not None: - serializer.write_struct( - _SCHEMA_MODEL_PERFORMANCE_CONFIGURATION.members["performanceConfig"], - self.performance_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["performance_config"] = PerformanceConfiguration.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MODEL_PERFORMANCE_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class StartFlowExecutionInput: - """Dataclass for StartFlowExecutionInput structure.""" - - flow_identifier: str | None = None - """The unique identifier of the flow to execute.""" - - flow_alias_identifier: str | None = None - """The unique identifier of the flow alias to use for the flow execution.""" - - flow_execution_name: str | None = None - """ - The unique name for the flow execution. If you don't provide one, a - system-generated name is used. - """ - - inputs: list[FlowInput] | None = None - """ - The input data required for the flow execution. This must match the - input schema defined in the flow. - """ - - model_performance_configuration: ModelPerformanceConfiguration | None = None - """ - The performance settings for the foundation model used in the flow - execution. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_FLOW_EXECUTION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.flow_identifier is not None: - serializer.write_string( - _SCHEMA_START_FLOW_EXECUTION_INPUT.members["flowIdentifier"], - self.flow_identifier, - ) - - if self.flow_alias_identifier is not None: - serializer.write_string( - _SCHEMA_START_FLOW_EXECUTION_INPUT.members["flowAliasIdentifier"], - self.flow_alias_identifier, - ) - - if self.flow_execution_name is not None: - serializer.write_string( - _SCHEMA_START_FLOW_EXECUTION_INPUT.members["flowExecutionName"], - self.flow_execution_name, - ) - - if self.inputs is not None: - _serialize_flow_inputs( - serializer, - _SCHEMA_START_FLOW_EXECUTION_INPUT.members["inputs"], - self.inputs, - ) - - if self.model_performance_configuration is not None: - serializer.write_struct( - _SCHEMA_START_FLOW_EXECUTION_INPUT.members[ - "modelPerformanceConfiguration" - ], - self.model_performance_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["flow_identifier"] = de.read_string( - _SCHEMA_START_FLOW_EXECUTION_INPUT.members["flowIdentifier"] - ) - - case 1: - kwargs["flow_alias_identifier"] = de.read_string( - _SCHEMA_START_FLOW_EXECUTION_INPUT.members[ - "flowAliasIdentifier" - ] - ) - - case 2: - kwargs["flow_execution_name"] = de.read_string( - _SCHEMA_START_FLOW_EXECUTION_INPUT.members["flowExecutionName"] - ) - - case 3: - kwargs["inputs"] = _deserialize_flow_inputs( - de, _SCHEMA_START_FLOW_EXECUTION_INPUT.members["inputs"] - ) - - case 4: - kwargs["model_performance_configuration"] = ( - ModelPerformanceConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_START_FLOW_EXECUTION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class StartFlowExecutionOutput: - """Dataclass for StartFlowExecutionOutput structure.""" - - execution_arn: str | None = None - """ - The Amazon Resource Name (ARN) that uniquely identifies the flow - execution. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_FLOW_EXECUTION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.execution_arn is not None: - serializer.write_string( - _SCHEMA_START_FLOW_EXECUTION_OUTPUT.members["executionArn"], - self.execution_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["execution_arn"] = de.read_string( - _SCHEMA_START_FLOW_EXECUTION_OUTPUT.members["executionArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_START_FLOW_EXECUTION_OUTPUT, consumer=_consumer - ) - return kwargs - - -START_FLOW_EXECUTION = APIOperation( - input=StartFlowExecutionInput, - output=StartFlowExecutionOutput, - schema=_SCHEMA_START_FLOW_EXECUTION, - input_schema=_SCHEMA_START_FLOW_EXECUTION_INPUT, - output_schema=_SCHEMA_START_FLOW_EXECUTION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentruntime#BadGatewayException" - ): BadGatewayException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentruntime#DependencyFailedException" - ): DependencyFailedException, - ShapeID( - "com.amazonaws.bedrockagentruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_BAD_GATEWAY_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_DEPENDENCY_FAILED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class StopFlowExecutionInput: - """Dataclass for StopFlowExecutionInput structure.""" - - flow_identifier: str | None = None - """The unique identifier of the flow.""" - - flow_alias_identifier: str | None = None - """The unique identifier of the flow alias used for the execution.""" - - execution_identifier: str | None = None - """The unique identifier of the flow execution to stop.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STOP_FLOW_EXECUTION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.flow_identifier is not None: - serializer.write_string( - _SCHEMA_STOP_FLOW_EXECUTION_INPUT.members["flowIdentifier"], - self.flow_identifier, - ) - - if self.flow_alias_identifier is not None: - serializer.write_string( - _SCHEMA_STOP_FLOW_EXECUTION_INPUT.members["flowAliasIdentifier"], - self.flow_alias_identifier, - ) - - if self.execution_identifier is not None: - serializer.write_string( - _SCHEMA_STOP_FLOW_EXECUTION_INPUT.members["executionIdentifier"], - self.execution_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["flow_identifier"] = de.read_string( - _SCHEMA_STOP_FLOW_EXECUTION_INPUT.members["flowIdentifier"] - ) - - case 1: - kwargs["flow_alias_identifier"] = de.read_string( - _SCHEMA_STOP_FLOW_EXECUTION_INPUT.members["flowAliasIdentifier"] - ) - - case 2: - kwargs["execution_identifier"] = de.read_string( - _SCHEMA_STOP_FLOW_EXECUTION_INPUT.members["executionIdentifier"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_STOP_FLOW_EXECUTION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class StopFlowExecutionOutput: - """Dataclass for StopFlowExecutionOutput structure.""" - - status: str - """ - The updated status of the flow execution after the stop request. This - will typically be ABORTED if the execution was successfully stopped. - """ - - execution_arn: str | None = None - """ - The Amazon Resource Name (ARN) that uniquely identifies the flow - execution that was stopped. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STOP_FLOW_EXECUTION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.execution_arn is not None: - serializer.write_string( - _SCHEMA_STOP_FLOW_EXECUTION_OUTPUT.members["executionArn"], - self.execution_arn, - ) - - serializer.write_string( - _SCHEMA_STOP_FLOW_EXECUTION_OUTPUT.members["status"], self.status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["execution_arn"] = de.read_string( - _SCHEMA_STOP_FLOW_EXECUTION_OUTPUT.members["executionArn"] - ) - - case 1: - kwargs["status"] = FlowExecutionStatus( - de.read_string( - _SCHEMA_STOP_FLOW_EXECUTION_OUTPUT.members["status"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_STOP_FLOW_EXECUTION_OUTPUT, consumer=_consumer) - if "status" not in kwargs: - kwargs["status"] = FlowExecutionStatus._corrected("") - return kwargs - - -STOP_FLOW_EXECUTION = APIOperation( - input=StopFlowExecutionInput, - output=StopFlowExecutionOutput, - schema=_SCHEMA_STOP_FLOW_EXECUTION, - input_schema=_SCHEMA_STOP_FLOW_EXECUTION_INPUT, - output_schema=_SCHEMA_STOP_FLOW_EXECUTION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentruntime#BadGatewayException" - ): BadGatewayException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentruntime#DependencyFailedException" - ): DependencyFailedException, - ShapeID( - "com.amazonaws.bedrockagentruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_BAD_GATEWAY_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_DEPENDENCY_FAILED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class InvokeFlowInput: - """Dataclass for InvokeFlowInput structure.""" - - flow_identifier: str | None = None - """The unique identifier of the flow.""" - - flow_alias_identifier: str | None = None - """The unique identifier of the flow alias.""" - - inputs: list[FlowInput] | None = None - """ - A list of objects, each containing information about an input into the - flow. - """ - - enable_trace: bool | None = None - """ - Specifies whether to return the trace for the flow or not. Traces track - inputs and outputs for nodes in the flow. For more information, see - [Track each step in your prompt flow by viewing its trace in Amazon - Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-trace.html). - """ - - model_performance_configuration: ModelPerformanceConfiguration | None = None - """Model performance settings for the request.""" - - execution_id: str | None = None - """ - The unique identifier for the current flow execution. If you don't - provide a value, Amazon Bedrock creates the identifier for you. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOKE_FLOW_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.flow_identifier is not None: - serializer.write_string( - _SCHEMA_INVOKE_FLOW_INPUT.members["flowIdentifier"], - self.flow_identifier, - ) - - if self.flow_alias_identifier is not None: - serializer.write_string( - _SCHEMA_INVOKE_FLOW_INPUT.members["flowAliasIdentifier"], - self.flow_alias_identifier, - ) - - if self.inputs is not None: - _serialize_flow_inputs( - serializer, _SCHEMA_INVOKE_FLOW_INPUT.members["inputs"], self.inputs - ) - - if self.enable_trace is not None: - serializer.write_boolean( - _SCHEMA_INVOKE_FLOW_INPUT.members["enableTrace"], self.enable_trace - ) - - if self.model_performance_configuration is not None: - serializer.write_struct( - _SCHEMA_INVOKE_FLOW_INPUT.members["modelPerformanceConfiguration"], - self.model_performance_configuration, - ) - - if self.execution_id is not None: - serializer.write_string( - _SCHEMA_INVOKE_FLOW_INPUT.members["executionId"], self.execution_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["flow_identifier"] = de.read_string( - _SCHEMA_INVOKE_FLOW_INPUT.members["flowIdentifier"] - ) - - case 1: - kwargs["flow_alias_identifier"] = de.read_string( - _SCHEMA_INVOKE_FLOW_INPUT.members["flowAliasIdentifier"] - ) - - case 2: - kwargs["inputs"] = _deserialize_flow_inputs( - de, _SCHEMA_INVOKE_FLOW_INPUT.members["inputs"] - ) - - case 3: - kwargs["enable_trace"] = de.read_boolean( - _SCHEMA_INVOKE_FLOW_INPUT.members["enableTrace"] - ) - - case 4: - kwargs["model_performance_configuration"] = ( - ModelPerformanceConfiguration.deserialize(de) - ) - - case 5: - kwargs["execution_id"] = de.read_string( - _SCHEMA_INVOKE_FLOW_INPUT.members["executionId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INVOKE_FLOW_INPUT, consumer=_consumer) - return kwargs - - -class FlowCompletionReason(UnknownEnumMixin, StrEnum): - SUCCESS = "SUCCESS" - INPUT_REQUIRED = "INPUT_REQUIRED" - - -@dataclass(kw_only=True) -class FlowCompletionEvent: - """Contains information about why a flow completed.""" - - completion_reason: str - """The reason that the flow completed.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_COMPLETION_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_FLOW_COMPLETION_EVENT.members["completionReason"], - self.completion_reason, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["completion_reason"] = FlowCompletionReason( - de.read_string( - _SCHEMA_FLOW_COMPLETION_EVENT.members["completionReason"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FLOW_COMPLETION_EVENT, consumer=_consumer) - if "completion_reason" not in kwargs: - kwargs["completion_reason"] = FlowCompletionReason._corrected("") - return kwargs - - -@dataclass -class FlowMultiTurnInputContentDocument: - """The requested additional input to send back to the multi-turn flow node.""" - - value: Document - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_MULTI_TURN_INPUT_CONTENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_document( - _SCHEMA_FLOW_MULTI_TURN_INPUT_CONTENT.members["document"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_document( - _SCHEMA_FLOW_MULTI_TURN_INPUT_CONTENT.members["document"] - ) - ) - - -@dataclass -class FlowMultiTurnInputContentUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -FlowMultiTurnInputContent = Union[ - FlowMultiTurnInputContentDocument | FlowMultiTurnInputContentUnknown -] -""" -The content structure containing input information for multi-turn flow -interactions. -""" - - -class _FlowMultiTurnInputContentDeserializer: - _result: FlowMultiTurnInputContent | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> FlowMultiTurnInputContent: - self._result = None - deserializer.read_struct(_SCHEMA_FLOW_MULTI_TURN_INPUT_CONTENT, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(FlowMultiTurnInputContentDocument.deserialize(de)) - - case _: - self._set_result( - FlowMultiTurnInputContentUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: FlowMultiTurnInputContent) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class NodeType(UnknownEnumMixin, StrEnum): - FLOW_INPUT_NODE = "FlowInputNode" - FLOW_OUTPUT_NODE = "FlowOutputNode" - LAMBDA_FUNCTION_NODE = "LambdaFunctionNode" - KNOWLEDGE_BASE_NODE = "KnowledgeBaseNode" - PROMPT_NODE = "PromptNode" - CONDITION_NODE = "ConditionNode" - LEX_NODE = "LexNode" - - -@dataclass(kw_only=True) -class FlowMultiTurnInputRequestEvent: - """ - Response object from the flow multi-turn node requesting additional - information. - """ - - node_name: str - """The name of the node in the flow that is requesting the input.""" - - node_type: str - """The type of the node in the flow that is requesting the input.""" - - content: FlowMultiTurnInputContent - """ - The content payload containing the input request details for the - multi-turn interaction. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_MULTI_TURN_INPUT_REQUEST_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_FLOW_MULTI_TURN_INPUT_REQUEST_EVENT.members["nodeName"], - self.node_name, - ) - serializer.write_string( - _SCHEMA_FLOW_MULTI_TURN_INPUT_REQUEST_EVENT.members["nodeType"], - self.node_type, - ) - serializer.write_struct( - _SCHEMA_FLOW_MULTI_TURN_INPUT_REQUEST_EVENT.members["content"], self.content - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["node_name"] = de.read_string( - _SCHEMA_FLOW_MULTI_TURN_INPUT_REQUEST_EVENT.members["nodeName"] - ) - - case 1: - kwargs["node_type"] = NodeType( - de.read_string( - _SCHEMA_FLOW_MULTI_TURN_INPUT_REQUEST_EVENT.members[ - "nodeType" - ] - ) - ) - - case 2: - kwargs["content"] = ( - _FlowMultiTurnInputContentDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_FLOW_MULTI_TURN_INPUT_REQUEST_EVENT, consumer=_consumer - ) - if "node_name" not in kwargs: - kwargs["node_name"] = "" - if "node_type" not in kwargs: - kwargs["node_type"] = NodeType._corrected("") - if "content" not in kwargs: - kwargs["content"] = FlowMultiTurnInputContentUnknown(tag="") - return kwargs - - -@dataclass -class FlowOutputContentDocument: - """The content in the output.""" - - value: Document - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_OUTPUT_CONTENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_document( - _SCHEMA_FLOW_OUTPUT_CONTENT.members["document"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_document( - _SCHEMA_FLOW_OUTPUT_CONTENT.members["document"] - ) - ) - - -@dataclass -class FlowOutputContentUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -FlowOutputContent = Union[FlowOutputContentDocument | FlowOutputContentUnknown] -""" -Contains information about the content in an output from prompt flow -invocation. -""" - - -class _FlowOutputContentDeserializer: - _result: FlowOutputContent | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> FlowOutputContent: - self._result = None - deserializer.read_struct(_SCHEMA_FLOW_OUTPUT_CONTENT, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(FlowOutputContentDocument.deserialize(de)) - - case _: - self._set_result( - FlowOutputContentUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: FlowOutputContent) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class FlowOutputEvent: - """Contains information about an output from prompt flow invoction.""" - - node_name: str - """The name of the flow output node that the output is from.""" - - node_type: str - """The type of the node that the output is from.""" - - content: FlowOutputContent - """The content in the output.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_OUTPUT_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_FLOW_OUTPUT_EVENT.members["nodeName"], self.node_name - ) - serializer.write_string( - _SCHEMA_FLOW_OUTPUT_EVENT.members["nodeType"], self.node_type - ) - serializer.write_struct( - _SCHEMA_FLOW_OUTPUT_EVENT.members["content"], self.content - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["node_name"] = de.read_string( - _SCHEMA_FLOW_OUTPUT_EVENT.members["nodeName"] - ) - - case 1: - kwargs["node_type"] = NodeType( - de.read_string(_SCHEMA_FLOW_OUTPUT_EVENT.members["nodeType"]) - ) - - case 2: - kwargs["content"] = _FlowOutputContentDeserializer().deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FLOW_OUTPUT_EVENT, consumer=_consumer) - if "node_name" not in kwargs: - kwargs["node_name"] = "" - if "node_type" not in kwargs: - kwargs["node_type"] = NodeType._corrected("") - if "content" not in kwargs: - kwargs["content"] = FlowOutputContentUnknown(tag="") - return kwargs - - -@dataclass(kw_only=True) -class FlowTraceCondition: - """ - Contains information about a condition that was satisfied. For more - information, see [Track each step in your prompt flow by viewing its - trace in Amazon - Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-trace.html). - """ - - condition_name: str - """The name of the condition.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_TRACE_CONDITION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_FLOW_TRACE_CONDITION.members["conditionName"], self.condition_name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["condition_name"] = de.read_string( - _SCHEMA_FLOW_TRACE_CONDITION.members["conditionName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FLOW_TRACE_CONDITION, consumer=_consumer) - if "condition_name" not in kwargs: - kwargs["condition_name"] = "" - return kwargs - - -def _serialize_flow_trace_conditions( - serializer: ShapeSerializer, schema: Schema, value: list[FlowTraceCondition] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_flow_trace_conditions( - deserializer: ShapeDeserializer, schema: Schema -) -> list[FlowTraceCondition]: - result: list[FlowTraceCondition] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(FlowTraceCondition.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class FlowTraceConditionNodeResultEvent: - """ - Contains information about an output from a condition node. For more - information, see [Track each step in your prompt flow by viewing its - trace in Amazon - Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-trace.html). - """ - - node_name: str - """The name of the condition node.""" - - timestamp: datetime - """The date and time that the trace was returned.""" - - satisfied_conditions: list[FlowTraceCondition] - """ - An array of objects containing information about the conditions that - were satisfied. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_TRACE_CONDITION_NODE_RESULT_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_FLOW_TRACE_CONDITION_NODE_RESULT_EVENT.members["nodeName"], - self.node_name, - ) - serializer.write_timestamp( - _SCHEMA_FLOW_TRACE_CONDITION_NODE_RESULT_EVENT.members["timestamp"], - self.timestamp, - ) - _serialize_flow_trace_conditions( - serializer, - _SCHEMA_FLOW_TRACE_CONDITION_NODE_RESULT_EVENT.members[ - "satisfiedConditions" - ], - self.satisfied_conditions, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["node_name"] = de.read_string( - _SCHEMA_FLOW_TRACE_CONDITION_NODE_RESULT_EVENT.members[ - "nodeName" - ] - ) - - case 1: - kwargs["timestamp"] = de.read_timestamp( - _SCHEMA_FLOW_TRACE_CONDITION_NODE_RESULT_EVENT.members[ - "timestamp" - ] - ) - - case 2: - kwargs["satisfied_conditions"] = _deserialize_flow_trace_conditions( - de, - _SCHEMA_FLOW_TRACE_CONDITION_NODE_RESULT_EVENT.members[ - "satisfiedConditions" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_FLOW_TRACE_CONDITION_NODE_RESULT_EVENT, consumer=_consumer - ) - if "node_name" not in kwargs: - kwargs["node_name"] = "" - if "timestamp" not in kwargs: - kwargs["timestamp"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "satisfied_conditions" not in kwargs: - kwargs["satisfied_conditions"] = [] - return kwargs - - -@dataclass(kw_only=True) -class FlowTraceNodeActionEvent: - """ - Contains information about an action (operation) called by a node in an - Amazon Bedrock flow. The service generates action events for calls made - by prompt nodes, agent nodes, and Amazon Web Services Lambda nodes. - """ - - node_name: str - """The name of the node that called the operation.""" - - timestamp: datetime - """The date and time that the operation was called.""" - - request_id: str - """The ID of the request that the node made to the operation.""" - - service_name: str - """The name of the service that the node called.""" - - operation_name: str - """The name of the operation that the node called.""" - - operation_request: Document | None = None - """The request payload sent to the downstream service.""" - - operation_response: Document | None = None - """The response payload received from the downstream service.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_TRACE_NODE_ACTION_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_FLOW_TRACE_NODE_ACTION_EVENT.members["nodeName"], self.node_name - ) - serializer.write_timestamp( - _SCHEMA_FLOW_TRACE_NODE_ACTION_EVENT.members["timestamp"], self.timestamp - ) - serializer.write_string( - _SCHEMA_FLOW_TRACE_NODE_ACTION_EVENT.members["requestId"], self.request_id - ) - serializer.write_string( - _SCHEMA_FLOW_TRACE_NODE_ACTION_EVENT.members["serviceName"], - self.service_name, - ) - serializer.write_string( - _SCHEMA_FLOW_TRACE_NODE_ACTION_EVENT.members["operationName"], - self.operation_name, - ) - if self.operation_request is not None: - serializer.write_document( - _SCHEMA_FLOW_TRACE_NODE_ACTION_EVENT.members["operationRequest"], - self.operation_request, - ) - - if self.operation_response is not None: - serializer.write_document( - _SCHEMA_FLOW_TRACE_NODE_ACTION_EVENT.members["operationResponse"], - self.operation_response, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["node_name"] = de.read_string( - _SCHEMA_FLOW_TRACE_NODE_ACTION_EVENT.members["nodeName"] - ) - - case 1: - kwargs["timestamp"] = de.read_timestamp( - _SCHEMA_FLOW_TRACE_NODE_ACTION_EVENT.members["timestamp"] - ) - - case 2: - kwargs["request_id"] = de.read_string( - _SCHEMA_FLOW_TRACE_NODE_ACTION_EVENT.members["requestId"] - ) - - case 3: - kwargs["service_name"] = de.read_string( - _SCHEMA_FLOW_TRACE_NODE_ACTION_EVENT.members["serviceName"] - ) - - case 4: - kwargs["operation_name"] = de.read_string( - _SCHEMA_FLOW_TRACE_NODE_ACTION_EVENT.members["operationName"] - ) - - case 5: - kwargs["operation_request"] = de.read_document( - _SCHEMA_FLOW_TRACE_NODE_ACTION_EVENT.members["operationRequest"] - ) - - case 6: - kwargs["operation_response"] = de.read_document( - _SCHEMA_FLOW_TRACE_NODE_ACTION_EVENT.members[ - "operationResponse" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_FLOW_TRACE_NODE_ACTION_EVENT, consumer=_consumer - ) - if "node_name" not in kwargs: - kwargs["node_name"] = "" - if "timestamp" not in kwargs: - kwargs["timestamp"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "request_id" not in kwargs: - kwargs["request_id"] = "" - if "service_name" not in kwargs: - kwargs["service_name"] = "" - if "operation_name" not in kwargs: - kwargs["operation_name"] = "" - return kwargs - - -@dataclass -class TraceElementsAgentTraces: - """Agent trace information for the flow execution.""" - - value: list[TracePart] - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRACE_ELEMENTS, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_agent_traces( - serializer, _SCHEMA_TRACE_ELEMENTS.members["agentTraces"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_deserialize_agent_traces( - deserializer, _SCHEMA_TRACE_ELEMENTS.members["agentTraces"] - ) - ) - - -@dataclass -class TraceElementsUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -TraceElements = Union[TraceElementsAgentTraces | TraceElementsUnknown] -"""Contains trace elements for flow execution tracking.""" - - -class _TraceElementsDeserializer: - _result: TraceElements | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> TraceElements: - self._result = None - deserializer.read_struct(_SCHEMA_TRACE_ELEMENTS, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(TraceElementsAgentTraces.deserialize(de)) - - case _: - self._set_result(TraceElementsUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: TraceElements) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class FlowTraceDependencyEvent: - """Contains information about a dependency trace event in the flow.""" - - node_name: str - """The name of the node that generated the dependency trace.""" - - timestamp: datetime - """The date and time that the dependency trace was generated.""" - - trace_elements: TraceElements = field(repr=False) - """The trace elements containing detailed information about the dependency.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_TRACE_DEPENDENCY_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_FLOW_TRACE_DEPENDENCY_EVENT.members["nodeName"], self.node_name - ) - serializer.write_timestamp( - _SCHEMA_FLOW_TRACE_DEPENDENCY_EVENT.members["timestamp"], self.timestamp - ) - serializer.write_struct( - _SCHEMA_FLOW_TRACE_DEPENDENCY_EVENT.members["traceElements"], - self.trace_elements, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["node_name"] = de.read_string( - _SCHEMA_FLOW_TRACE_DEPENDENCY_EVENT.members["nodeName"] - ) - - case 1: - kwargs["timestamp"] = de.read_timestamp( - _SCHEMA_FLOW_TRACE_DEPENDENCY_EVENT.members["timestamp"] - ) - - case 2: - kwargs["trace_elements"] = _TraceElementsDeserializer().deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_FLOW_TRACE_DEPENDENCY_EVENT, consumer=_consumer - ) - if "node_name" not in kwargs: - kwargs["node_name"] = "" - if "timestamp" not in kwargs: - kwargs["timestamp"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "trace_elements" not in kwargs: - kwargs["trace_elements"] = TraceElementsUnknown(tag="") - return kwargs - - -@dataclass -class FlowTraceNodeInputContentDocument: - """The content of the node input.""" - - value: Document - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_TRACE_NODE_INPUT_CONTENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_document( - _SCHEMA_FLOW_TRACE_NODE_INPUT_CONTENT.members["document"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_document( - _SCHEMA_FLOW_TRACE_NODE_INPUT_CONTENT.members["document"] - ) - ) - - -@dataclass -class FlowTraceNodeInputContentUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -FlowTraceNodeInputContent = Union[ - FlowTraceNodeInputContentDocument | FlowTraceNodeInputContentUnknown -] -""" -Contains the content of the node input. For more information, see [Track -each step in your prompt flow by viewing its trace in Amazon -Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-trace.html). -""" - - -class _FlowTraceNodeInputContentDeserializer: - _result: FlowTraceNodeInputContent | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> FlowTraceNodeInputContent: - self._result = None - deserializer.read_struct(_SCHEMA_FLOW_TRACE_NODE_INPUT_CONTENT, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(FlowTraceNodeInputContentDocument.deserialize(de)) - - case _: - self._set_result( - FlowTraceNodeInputContentUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: FlowTraceNodeInputContent) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class FlowTraceNodeInputExecutionChainItem: - """ - Represents an item in the execution chain for flow trace node input - tracking. - """ - - node_name: str - """The name of the node in the execution chain.""" - - type: str - """ - The type of execution chain item. Supported values are Iterator and - Loop. - """ - - index: int | None = None - """The index position of this item in the execution chain.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_TRACE_NODE_INPUT_EXECUTION_CHAIN_ITEM, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_FLOW_TRACE_NODE_INPUT_EXECUTION_CHAIN_ITEM.members["nodeName"], - self.node_name, - ) - if self.index is not None: - serializer.write_integer( - _SCHEMA_FLOW_TRACE_NODE_INPUT_EXECUTION_CHAIN_ITEM.members["index"], - self.index, - ) - - serializer.write_string( - _SCHEMA_FLOW_TRACE_NODE_INPUT_EXECUTION_CHAIN_ITEM.members["type"], - self.type, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["node_name"] = de.read_string( - _SCHEMA_FLOW_TRACE_NODE_INPUT_EXECUTION_CHAIN_ITEM.members[ - "nodeName" - ] - ) - - case 1: - kwargs["index"] = de.read_integer( - _SCHEMA_FLOW_TRACE_NODE_INPUT_EXECUTION_CHAIN_ITEM.members[ - "index" - ] - ) - - case 2: - kwargs["type"] = FlowControlNodeType( - de.read_string( - _SCHEMA_FLOW_TRACE_NODE_INPUT_EXECUTION_CHAIN_ITEM.members[ - "type" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_FLOW_TRACE_NODE_INPUT_EXECUTION_CHAIN_ITEM, consumer=_consumer - ) - if "node_name" not in kwargs: - kwargs["node_name"] = "" - if "type" not in kwargs: - kwargs["type"] = FlowControlNodeType._corrected("") - return kwargs - - -def _serialize_flow_trace_node_input_execution_chain( - serializer: ShapeSerializer, - schema: Schema, - value: list[FlowTraceNodeInputExecutionChainItem], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_flow_trace_node_input_execution_chain( - deserializer: ShapeDeserializer, schema: Schema -) -> list[FlowTraceNodeInputExecutionChainItem]: - result: list[FlowTraceNodeInputExecutionChainItem] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(FlowTraceNodeInputExecutionChainItem.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class FlowTraceNodeInputSource: - """Represents the source of input data for a flow trace node field.""" - - node_name: str - """The name of the source node that provides the input data.""" - - output_field_name: str - """The name of the output field from the source node.""" - - expression: str = field(repr=False) - """The expression used to extract data from the source.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_TRACE_NODE_INPUT_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_FLOW_TRACE_NODE_INPUT_SOURCE.members["nodeName"], self.node_name - ) - serializer.write_string( - _SCHEMA_FLOW_TRACE_NODE_INPUT_SOURCE.members["outputFieldName"], - self.output_field_name, - ) - serializer.write_string( - _SCHEMA_FLOW_TRACE_NODE_INPUT_SOURCE.members["expression"], self.expression - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["node_name"] = de.read_string( - _SCHEMA_FLOW_TRACE_NODE_INPUT_SOURCE.members["nodeName"] - ) - - case 1: - kwargs["output_field_name"] = de.read_string( - _SCHEMA_FLOW_TRACE_NODE_INPUT_SOURCE.members["outputFieldName"] - ) - - case 2: - kwargs["expression"] = de.read_string( - _SCHEMA_FLOW_TRACE_NODE_INPUT_SOURCE.members["expression"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_FLOW_TRACE_NODE_INPUT_SOURCE, consumer=_consumer - ) - if "node_name" not in kwargs: - kwargs["node_name"] = "" - if "output_field_name" not in kwargs: - kwargs["output_field_name"] = "" - if "expression" not in kwargs: - kwargs["expression"] = "" - return kwargs - - -@dataclass(kw_only=True) -class FlowTraceNodeInputField: - """ - Contains information about a field in the input into a node. For more - information, see [Track each step in your prompt flow by viewing its - trace in Amazon - Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-trace.html). - """ - - node_input_name: str - """The name of the node input.""" - - content: FlowTraceNodeInputContent = field(repr=False) - """The content of the node input.""" - - source: FlowTraceNodeInputSource | None = field(repr=False, default=None) - """The source node that provides input data to this field.""" - - type: str | None = None - """The data type of the input field for compatibility validation.""" - - category: str | None = None - """The category of the input field.""" - - execution_chain: list[FlowTraceNodeInputExecutionChainItem] | None = field( - repr=False, default=None - ) - """The execution path through nested nodes like iterators and loops.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_TRACE_NODE_INPUT_FIELD, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_FLOW_TRACE_NODE_INPUT_FIELD.members["nodeInputName"], - self.node_input_name, - ) - serializer.write_struct( - _SCHEMA_FLOW_TRACE_NODE_INPUT_FIELD.members["content"], self.content - ) - if self.source is not None: - serializer.write_struct( - _SCHEMA_FLOW_TRACE_NODE_INPUT_FIELD.members["source"], self.source - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_FLOW_TRACE_NODE_INPUT_FIELD.members["type"], self.type - ) - - if self.category is not None: - serializer.write_string( - _SCHEMA_FLOW_TRACE_NODE_INPUT_FIELD.members["category"], self.category - ) - - if self.execution_chain is not None: - _serialize_flow_trace_node_input_execution_chain( - serializer, - _SCHEMA_FLOW_TRACE_NODE_INPUT_FIELD.members["executionChain"], - self.execution_chain, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["node_input_name"] = de.read_string( - _SCHEMA_FLOW_TRACE_NODE_INPUT_FIELD.members["nodeInputName"] - ) - - case 1: - kwargs["content"] = ( - _FlowTraceNodeInputContentDeserializer().deserialize(de) - ) - - case 2: - kwargs["source"] = FlowTraceNodeInputSource.deserialize(de) - - case 3: - kwargs["type"] = FlowNodeIODataType( - de.read_string( - _SCHEMA_FLOW_TRACE_NODE_INPUT_FIELD.members["type"] - ) - ) - - case 4: - kwargs["category"] = FlowNodeInputCategory( - de.read_string( - _SCHEMA_FLOW_TRACE_NODE_INPUT_FIELD.members["category"] - ) - ) - - case 5: - kwargs["execution_chain"] = ( - _deserialize_flow_trace_node_input_execution_chain( - de, - _SCHEMA_FLOW_TRACE_NODE_INPUT_FIELD.members[ - "executionChain" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_FLOW_TRACE_NODE_INPUT_FIELD, consumer=_consumer - ) - if "node_input_name" not in kwargs: - kwargs["node_input_name"] = "" - if "content" not in kwargs: - kwargs["content"] = FlowTraceNodeInputContentUnknown(tag="") - return kwargs - - -def _serialize_flow_trace_node_input_fields( - serializer: ShapeSerializer, schema: Schema, value: list[FlowTraceNodeInputField] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_flow_trace_node_input_fields( - deserializer: ShapeDeserializer, schema: Schema -) -> list[FlowTraceNodeInputField]: - result: list[FlowTraceNodeInputField] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(FlowTraceNodeInputField.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class FlowTraceNodeInputEvent: - """ - Contains information about the input into a node. For more information, - see [Track each step in your prompt flow by viewing its trace in Amazon - Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-trace.html). - """ - - node_name: str - """The name of the node that received the input.""" - - timestamp: datetime - """The date and time that the trace was returned.""" - - fields: list[FlowTraceNodeInputField] - """ - An array of objects containing information about each field in the - input. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_TRACE_NODE_INPUT_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_FLOW_TRACE_NODE_INPUT_EVENT.members["nodeName"], self.node_name - ) - serializer.write_timestamp( - _SCHEMA_FLOW_TRACE_NODE_INPUT_EVENT.members["timestamp"], self.timestamp - ) - _serialize_flow_trace_node_input_fields( - serializer, - _SCHEMA_FLOW_TRACE_NODE_INPUT_EVENT.members["fields"], - self.fields, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["node_name"] = de.read_string( - _SCHEMA_FLOW_TRACE_NODE_INPUT_EVENT.members["nodeName"] - ) - - case 1: - kwargs["timestamp"] = de.read_timestamp( - _SCHEMA_FLOW_TRACE_NODE_INPUT_EVENT.members["timestamp"] - ) - - case 2: - kwargs["fields"] = _deserialize_flow_trace_node_input_fields( - de, _SCHEMA_FLOW_TRACE_NODE_INPUT_EVENT.members["fields"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_FLOW_TRACE_NODE_INPUT_EVENT, consumer=_consumer - ) - if "node_name" not in kwargs: - kwargs["node_name"] = "" - if "timestamp" not in kwargs: - kwargs["timestamp"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "fields" not in kwargs: - kwargs["fields"] = [] - return kwargs - - -@dataclass -class FlowTraceNodeOutputContentDocument: - """The content of the node output.""" - - value: Document - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_TRACE_NODE_OUTPUT_CONTENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_document( - _SCHEMA_FLOW_TRACE_NODE_OUTPUT_CONTENT.members["document"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_document( - _SCHEMA_FLOW_TRACE_NODE_OUTPUT_CONTENT.members["document"] - ) - ) - - -@dataclass -class FlowTraceNodeOutputContentUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -FlowTraceNodeOutputContent = Union[ - FlowTraceNodeOutputContentDocument | FlowTraceNodeOutputContentUnknown -] -""" -Contains the content of the node output. For more information, see -[Track each step in your prompt flow by viewing its trace in Amazon -Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-trace.html). -""" - - -class _FlowTraceNodeOutputContentDeserializer: - _result: FlowTraceNodeOutputContent | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> FlowTraceNodeOutputContent: - self._result = None - deserializer.read_struct(_SCHEMA_FLOW_TRACE_NODE_OUTPUT_CONTENT, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(FlowTraceNodeOutputContentDocument.deserialize(de)) - - case _: - self._set_result( - FlowTraceNodeOutputContentUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: FlowTraceNodeOutputContent) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class FlowTraceNodeOutputNext: - """Represents the next node that receives output data from a flow trace.""" - - node_name: str - """The name of the next node that receives the output data.""" - - input_field_name: str - """The name of the input field in the next node that receives the data.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_TRACE_NODE_OUTPUT_NEXT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_FLOW_TRACE_NODE_OUTPUT_NEXT.members["nodeName"], self.node_name - ) - serializer.write_string( - _SCHEMA_FLOW_TRACE_NODE_OUTPUT_NEXT.members["inputFieldName"], - self.input_field_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["node_name"] = de.read_string( - _SCHEMA_FLOW_TRACE_NODE_OUTPUT_NEXT.members["nodeName"] - ) - - case 1: - kwargs["input_field_name"] = de.read_string( - _SCHEMA_FLOW_TRACE_NODE_OUTPUT_NEXT.members["inputFieldName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_FLOW_TRACE_NODE_OUTPUT_NEXT, consumer=_consumer - ) - if "node_name" not in kwargs: - kwargs["node_name"] = "" - if "input_field_name" not in kwargs: - kwargs["input_field_name"] = "" - return kwargs - - -def _serialize_flow_trace_node_output_next_list( - serializer: ShapeSerializer, schema: Schema, value: list[FlowTraceNodeOutputNext] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_flow_trace_node_output_next_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[FlowTraceNodeOutputNext]: - result: list[FlowTraceNodeOutputNext] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(FlowTraceNodeOutputNext.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class FlowTraceNodeOutputField: - """ - Contains information about a field in the output from a node. For more - information, see [Track each step in your prompt flow by viewing its - trace in Amazon - Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-trace.html). - """ - - node_output_name: str - """The name of the node output.""" - - content: FlowTraceNodeOutputContent - """The content of the node output.""" - - next: list[FlowTraceNodeOutputNext] | None = None - """The next node that receives output data from this field.""" - - type: str | None = None - """The data type of the output field for compatibility validation.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_TRACE_NODE_OUTPUT_FIELD, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_FLOW_TRACE_NODE_OUTPUT_FIELD.members["nodeOutputName"], - self.node_output_name, - ) - serializer.write_struct( - _SCHEMA_FLOW_TRACE_NODE_OUTPUT_FIELD.members["content"], self.content - ) - if self.next is not None: - _serialize_flow_trace_node_output_next_list( - serializer, - _SCHEMA_FLOW_TRACE_NODE_OUTPUT_FIELD.members["next"], - self.next, - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_FLOW_TRACE_NODE_OUTPUT_FIELD.members["type"], self.type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["node_output_name"] = de.read_string( - _SCHEMA_FLOW_TRACE_NODE_OUTPUT_FIELD.members["nodeOutputName"] - ) - - case 1: - kwargs["content"] = ( - _FlowTraceNodeOutputContentDeserializer().deserialize(de) - ) - - case 2: - kwargs["next"] = _deserialize_flow_trace_node_output_next_list( - de, _SCHEMA_FLOW_TRACE_NODE_OUTPUT_FIELD.members["next"] - ) - - case 3: - kwargs["type"] = FlowNodeIODataType( - de.read_string( - _SCHEMA_FLOW_TRACE_NODE_OUTPUT_FIELD.members["type"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_FLOW_TRACE_NODE_OUTPUT_FIELD, consumer=_consumer - ) - if "node_output_name" not in kwargs: - kwargs["node_output_name"] = "" - if "content" not in kwargs: - kwargs["content"] = FlowTraceNodeOutputContentUnknown(tag="") - return kwargs - - -def _serialize_flow_trace_node_output_fields( - serializer: ShapeSerializer, schema: Schema, value: list[FlowTraceNodeOutputField] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_flow_trace_node_output_fields( - deserializer: ShapeDeserializer, schema: Schema -) -> list[FlowTraceNodeOutputField]: - result: list[FlowTraceNodeOutputField] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(FlowTraceNodeOutputField.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class FlowTraceNodeOutputEvent: - """ - Contains information about the output from a node. For more information, - see [Track each step in your prompt flow by viewing its trace in Amazon - Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-trace.html). - """ - - node_name: str - """The name of the node that yielded the output.""" - - timestamp: datetime - """The date and time that the trace was returned.""" - - fields: list[FlowTraceNodeOutputField] - """ - An array of objects containing information about each field in the - output. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_TRACE_NODE_OUTPUT_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_FLOW_TRACE_NODE_OUTPUT_EVENT.members["nodeName"], self.node_name - ) - serializer.write_timestamp( - _SCHEMA_FLOW_TRACE_NODE_OUTPUT_EVENT.members["timestamp"], self.timestamp - ) - _serialize_flow_trace_node_output_fields( - serializer, - _SCHEMA_FLOW_TRACE_NODE_OUTPUT_EVENT.members["fields"], - self.fields, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["node_name"] = de.read_string( - _SCHEMA_FLOW_TRACE_NODE_OUTPUT_EVENT.members["nodeName"] - ) - - case 1: - kwargs["timestamp"] = de.read_timestamp( - _SCHEMA_FLOW_TRACE_NODE_OUTPUT_EVENT.members["timestamp"] - ) - - case 2: - kwargs["fields"] = _deserialize_flow_trace_node_output_fields( - de, _SCHEMA_FLOW_TRACE_NODE_OUTPUT_EVENT.members["fields"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_FLOW_TRACE_NODE_OUTPUT_EVENT, consumer=_consumer - ) - if "node_name" not in kwargs: - kwargs["node_name"] = "" - if "timestamp" not in kwargs: - kwargs["timestamp"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "fields" not in kwargs: - kwargs["fields"] = [] - return kwargs - - -@dataclass -class FlowTraceNodeInputTrace: - """Contains information about the input into a node.""" - - value: FlowTraceNodeInputEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_TRACE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_TRACE.members["nodeInputTrace"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=FlowTraceNodeInputEvent.deserialize(deserializer)) - - -@dataclass -class FlowTraceNodeOutputTrace: - """Contains information about the output from a node.""" - - value: FlowTraceNodeOutputEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_TRACE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_TRACE.members["nodeOutputTrace"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=FlowTraceNodeOutputEvent.deserialize(deserializer)) - - -@dataclass -class FlowTraceConditionNodeResultTrace: - """Contains information about an output from a condition node.""" - - value: FlowTraceConditionNodeResultEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_TRACE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_TRACE.members["conditionNodeResultTrace"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=FlowTraceConditionNodeResultEvent.deserialize(deserializer)) - - -@dataclass -class FlowTraceNodeActionTrace: - """Contains information about an action (operation) called by a node.""" - - value: FlowTraceNodeActionEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_TRACE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_TRACE.members["nodeActionTrace"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=FlowTraceNodeActionEvent.deserialize(deserializer)) - - -@dataclass -class FlowTraceNodeDependencyTrace: - """Contains information about an internal trace of a node.""" - - value: FlowTraceDependencyEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_TRACE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_TRACE.members["nodeDependencyTrace"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=FlowTraceDependencyEvent.deserialize(deserializer)) - - -@dataclass -class FlowTraceUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -FlowTrace = Union[ - FlowTraceNodeInputTrace - | FlowTraceNodeOutputTrace - | FlowTraceConditionNodeResultTrace - | FlowTraceNodeActionTrace - | FlowTraceNodeDependencyTrace - | FlowTraceUnknown -] -""" -Contains information about an input or output for a node in the flow. -For more information, see [Track each step in your prompt flow by -viewing its trace in Amazon -Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-trace.html). -""" - - -class _FlowTraceDeserializer: - _result: FlowTrace | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> FlowTrace: - self._result = None - deserializer.read_struct(_SCHEMA_FLOW_TRACE, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(FlowTraceNodeInputTrace.deserialize(de)) - - case 1: - self._set_result(FlowTraceNodeOutputTrace.deserialize(de)) - - case 2: - self._set_result(FlowTraceConditionNodeResultTrace.deserialize(de)) - - case 3: - self._set_result(FlowTraceNodeActionTrace.deserialize(de)) - - case 4: - self._set_result(FlowTraceNodeDependencyTrace.deserialize(de)) - - case _: - self._set_result(FlowTraceUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: FlowTrace) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class FlowTraceEvent: - """ - Contains information about a trace, which tracks an input or output for - a node in the flow. For more information, see [Track each step in your - prompt flow by viewing its trace in Amazon - Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-trace.html). - """ - - trace: FlowTrace = field(repr=False) - """ - The trace object containing information about an input or output for a - node in the flow. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_TRACE_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_TRACE_EVENT.members["trace"], self.trace) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["trace"] = _FlowTraceDeserializer().deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FLOW_TRACE_EVENT, consumer=_consumer) - if "trace" not in kwargs: - kwargs["trace"] = FlowTraceUnknown(tag="") - return kwargs - - -@dataclass -class FlowResponseStreamFlowOutputEvent: - """Contains information about an output from flow invocation.""" - - value: FlowOutputEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_RESPONSE_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_RESPONSE_STREAM.members["flowOutputEvent"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=FlowOutputEvent.deserialize(deserializer)) - - -@dataclass -class FlowResponseStreamFlowCompletionEvent: - """Contains information about why the flow completed.""" - - value: FlowCompletionEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_RESPONSE_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_RESPONSE_STREAM.members["flowCompletionEvent"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=FlowCompletionEvent.deserialize(deserializer)) - - -@dataclass -class FlowResponseStreamFlowTraceEvent: - """ - Contains information about a trace, which tracks an input or output for - a node in the flow. - """ - - value: FlowTraceEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_RESPONSE_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_RESPONSE_STREAM.members["flowTraceEvent"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=FlowTraceEvent.deserialize(deserializer)) - - -@dataclass -class FlowResponseStreamInternalServerException: - """An internal server error occurred. Retry your request.""" - - value: InternalServerException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_RESPONSE_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_RESPONSE_STREAM.members["internalServerException"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=InternalServerException.deserialize(deserializer)) - - -@dataclass -class FlowResponseStreamValidationException: - """ - Input validation failed. Check your request parameters and retry the - request. - """ - - value: ValidationException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_RESPONSE_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_RESPONSE_STREAM.members["validationException"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ValidationException.deserialize(deserializer)) - - -@dataclass -class FlowResponseStreamResourceNotFoundException: - """ - The specified resource Amazon Resource Name (ARN) was not found. Check - the Amazon Resource Name (ARN) and try your request again. - """ - - value: ResourceNotFoundException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_RESPONSE_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_RESPONSE_STREAM.members["resourceNotFoundException"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ResourceNotFoundException.deserialize(deserializer)) - - -@dataclass -class FlowResponseStreamServiceQuotaExceededException: - """ - The number of requests exceeds the service quota. Resubmit your request - later. - """ - - value: ServiceQuotaExceededException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_RESPONSE_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_RESPONSE_STREAM.members["serviceQuotaExceededException"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ServiceQuotaExceededException.deserialize(deserializer)) - - -@dataclass -class FlowResponseStreamThrottlingException: - """The number of requests exceeds the limit. Resubmit your request later.""" - - value: ThrottlingException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_RESPONSE_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_RESPONSE_STREAM.members["throttlingException"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ThrottlingException.deserialize(deserializer)) - - -@dataclass -class FlowResponseStreamAccessDeniedException: - """ - The request is denied because of missing access permissions. Check your - permissions and retry your request. - """ - - value: AccessDeniedException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_RESPONSE_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_RESPONSE_STREAM.members["accessDeniedException"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=AccessDeniedException.deserialize(deserializer)) - - -@dataclass -class FlowResponseStreamConflictException: - """ - There was a conflict performing an operation. Resolve the conflict and - retry your request. - """ - - value: ConflictException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_RESPONSE_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_RESPONSE_STREAM.members["conflictException"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ConflictException.deserialize(deserializer)) - - -@dataclass -class FlowResponseStreamDependencyFailedException: - """ - There was an issue with a dependency. Check the resource configurations - and retry the request. - """ - - value: DependencyFailedException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_RESPONSE_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_RESPONSE_STREAM.members["dependencyFailedException"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=DependencyFailedException.deserialize(deserializer)) - - -@dataclass -class FlowResponseStreamBadGatewayException: - """ - There was an issue with a dependency due to a server issue. Retry your - request. - """ - - value: BadGatewayException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_RESPONSE_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_RESPONSE_STREAM.members["badGatewayException"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=BadGatewayException.deserialize(deserializer)) - - -@dataclass -class FlowResponseStreamFlowMultiTurnInputRequestEvent: - """ - The event stream containing the multi-turn input request information - from the flow. - """ - - value: FlowMultiTurnInputRequestEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_RESPONSE_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_RESPONSE_STREAM.members["flowMultiTurnInputRequestEvent"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=FlowMultiTurnInputRequestEvent.deserialize(deserializer)) - - -@dataclass -class FlowResponseStreamUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -FlowResponseStream = Union[ - FlowResponseStreamFlowOutputEvent - | FlowResponseStreamFlowCompletionEvent - | FlowResponseStreamFlowTraceEvent - | FlowResponseStreamInternalServerException - | FlowResponseStreamValidationException - | FlowResponseStreamResourceNotFoundException - | FlowResponseStreamServiceQuotaExceededException - | FlowResponseStreamThrottlingException - | FlowResponseStreamAccessDeniedException - | FlowResponseStreamConflictException - | FlowResponseStreamDependencyFailedException - | FlowResponseStreamBadGatewayException - | FlowResponseStreamFlowMultiTurnInputRequestEvent - | FlowResponseStreamUnknown -] -"""The output of the flow.""" - - -class _FlowResponseStreamDeserializer: - _result: FlowResponseStream | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> FlowResponseStream: - self._result = None - deserializer.read_struct(_SCHEMA_FLOW_RESPONSE_STREAM, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(FlowResponseStreamFlowOutputEvent.deserialize(de)) - - case 1: - self._set_result(FlowResponseStreamFlowCompletionEvent.deserialize(de)) - - case 2: - self._set_result(FlowResponseStreamFlowTraceEvent.deserialize(de)) - - case 3: - self._set_result( - FlowResponseStreamInternalServerException.deserialize(de) - ) - - case 4: - self._set_result(FlowResponseStreamValidationException.deserialize(de)) - - case 5: - self._set_result( - FlowResponseStreamResourceNotFoundException.deserialize(de) - ) - - case 6: - self._set_result( - FlowResponseStreamServiceQuotaExceededException.deserialize(de) - ) - - case 7: - self._set_result(FlowResponseStreamThrottlingException.deserialize(de)) - - case 8: - self._set_result( - FlowResponseStreamAccessDeniedException.deserialize(de) - ) - - case 9: - self._set_result(FlowResponseStreamConflictException.deserialize(de)) - - case 10: - self._set_result( - FlowResponseStreamDependencyFailedException.deserialize(de) - ) - - case 11: - self._set_result(FlowResponseStreamBadGatewayException.deserialize(de)) - - case 12: - self._set_result( - FlowResponseStreamFlowMultiTurnInputRequestEvent.deserialize(de) - ) - - case _: - self._set_result( - FlowResponseStreamUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: FlowResponseStream) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class InvokeFlowOutput: - """Dataclass for InvokeFlowOutput structure.""" - - execution_id: str | None = None - """The unique identifier for the current flow execution.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOKE_FLOW_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.execution_id is not None: - serializer.write_string( - _SCHEMA_INVOKE_FLOW_OUTPUT.members["executionId"], self.execution_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 1: - kwargs["execution_id"] = de.read_string( - _SCHEMA_INVOKE_FLOW_OUTPUT.members["executionId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INVOKE_FLOW_OUTPUT, consumer=_consumer) - return kwargs - - -INVOKE_FLOW = APIOperation( - input=InvokeFlowInput, - output=InvokeFlowOutput, - schema=_SCHEMA_INVOKE_FLOW, - input_schema=_SCHEMA_INVOKE_FLOW_INPUT, - output_schema=_SCHEMA_INVOKE_FLOW_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentruntime#BadGatewayException" - ): BadGatewayException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentruntime#DependencyFailedException" - ): DependencyFailedException, - ShapeID( - "com.amazonaws.bedrockagentruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_BAD_GATEWAY_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_DEPENDENCY_FAILED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class InputQueryType(UnknownEnumMixin, StrEnum): - TEXT = "TEXT" - - -@dataclass(kw_only=True) -class QueryGenerationInput: - """ - Contains information about a natural language query to transform into - SQL. - """ - - type: str - """The type of the query.""" - - text: str - """The text of the query.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_QUERY_GENERATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_QUERY_GENERATION_INPUT.members["type"], self.type - ) - serializer.write_string( - _SCHEMA_QUERY_GENERATION_INPUT.members["text"], self.text - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = InputQueryType( - de.read_string(_SCHEMA_QUERY_GENERATION_INPUT.members["type"]) - ) - - case 1: - kwargs["text"] = de.read_string( - _SCHEMA_QUERY_GENERATION_INPUT.members["text"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_QUERY_GENERATION_INPUT, consumer=_consumer) - if "type" not in kwargs: - kwargs["type"] = InputQueryType._corrected("") - if "text" not in kwargs: - kwargs["text"] = "" - return kwargs - - -class QueryTransformationMode(UnknownEnumMixin, StrEnum): - TEXT_TO_SQL = "TEXT_TO_SQL" - - -@dataclass(kw_only=True) -class TextToSqlKnowledgeBaseConfiguration: - """Contains configurations for a knowledge base to use in transformation.""" - - knowledge_base_arn: str - """The ARN of the knowledge base""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TEXT_TO_SQL_KNOWLEDGE_BASE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_TEXT_TO_SQL_KNOWLEDGE_BASE_CONFIGURATION.members[ - "knowledgeBaseArn" - ], - self.knowledge_base_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["knowledge_base_arn"] = de.read_string( - _SCHEMA_TEXT_TO_SQL_KNOWLEDGE_BASE_CONFIGURATION.members[ - "knowledgeBaseArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_TEXT_TO_SQL_KNOWLEDGE_BASE_CONFIGURATION, consumer=_consumer - ) - if "knowledge_base_arn" not in kwargs: - kwargs["knowledge_base_arn"] = "" - return kwargs - - -class TextToSqlConfigurationType(UnknownEnumMixin, StrEnum): - KNOWLEDGE_BASE = "KNOWLEDGE_BASE" - - -@dataclass(kw_only=True) -class TextToSqlConfiguration: - """Contains configurations for transforming text to SQL.""" - - type: str - """The type of resource to use in transformation.""" - - knowledge_base_configuration: TextToSqlKnowledgeBaseConfiguration | None = None - """Specifies configurations for a knowledge base to use in transformation.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TEXT_TO_SQL_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_TEXT_TO_SQL_CONFIGURATION.members["type"], self.type - ) - if self.knowledge_base_configuration is not None: - serializer.write_struct( - _SCHEMA_TEXT_TO_SQL_CONFIGURATION.members["knowledgeBaseConfiguration"], - self.knowledge_base_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = TextToSqlConfigurationType( - de.read_string( - _SCHEMA_TEXT_TO_SQL_CONFIGURATION.members["type"] - ) - ) - - case 1: - kwargs["knowledge_base_configuration"] = ( - TextToSqlKnowledgeBaseConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TEXT_TO_SQL_CONFIGURATION, consumer=_consumer) - if "type" not in kwargs: - kwargs["type"] = TextToSqlConfigurationType._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class TransformationConfiguration: - """ - Contains configurations for transforming the natural language query into - SQL. - """ - - mode: str - """The mode of the transformation.""" - - text_to_sql_configuration: TextToSqlConfiguration | None = None - """Specifies configurations for transforming text to SQL.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRANSFORMATION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_TRANSFORMATION_CONFIGURATION.members["mode"], self.mode - ) - if self.text_to_sql_configuration is not None: - serializer.write_struct( - _SCHEMA_TRANSFORMATION_CONFIGURATION.members["textToSqlConfiguration"], - self.text_to_sql_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["mode"] = QueryTransformationMode( - de.read_string( - _SCHEMA_TRANSFORMATION_CONFIGURATION.members["mode"] - ) - ) - - case 1: - kwargs["text_to_sql_configuration"] = ( - TextToSqlConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_TRANSFORMATION_CONFIGURATION, consumer=_consumer - ) - if "mode" not in kwargs: - kwargs["mode"] = QueryTransformationMode._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class GenerateQueryInput: - """Dataclass for GenerateQueryInput structure.""" - - query_generation_input: QueryGenerationInput | None = field( - repr=False, default=None - ) - """ - Specifies information about a natural language query to transform into - SQL. - """ - - transformation_configuration: TransformationConfiguration | None = None - """ - Specifies configurations for transforming the natural language query - into SQL. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GENERATE_QUERY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.query_generation_input is not None: - serializer.write_struct( - _SCHEMA_GENERATE_QUERY_INPUT.members["queryGenerationInput"], - self.query_generation_input, - ) - - if self.transformation_configuration is not None: - serializer.write_struct( - _SCHEMA_GENERATE_QUERY_INPUT.members["transformationConfiguration"], - self.transformation_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["query_generation_input"] = QueryGenerationInput.deserialize( - de - ) - - case 1: - kwargs["transformation_configuration"] = ( - TransformationConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GENERATE_QUERY_INPUT, consumer=_consumer) - return kwargs - - -class GeneratedQueryType(UnknownEnumMixin, StrEnum): - REDSHIFT_SQL = "REDSHIFT_SQL" - - -@dataclass(kw_only=True) -class GeneratedQuery: - """ - Contains information about a query generated for a natural language - query. - """ - - type: str | None = None - """The type of transformed query.""" - - sql: str | None = None - """An SQL query that corresponds to the natural language query.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GENERATED_QUERY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string(_SCHEMA_GENERATED_QUERY.members["type"], self.type) - - if self.sql is not None: - serializer.write_string(_SCHEMA_GENERATED_QUERY.members["sql"], self.sql) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = GeneratedQueryType( - de.read_string(_SCHEMA_GENERATED_QUERY.members["type"]) - ) - - case 1: - kwargs["sql"] = de.read_string( - _SCHEMA_GENERATED_QUERY.members["sql"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GENERATED_QUERY, consumer=_consumer) - return kwargs - - -def _serialize_generated_queries( - serializer: ShapeSerializer, schema: Schema, value: list[GeneratedQuery] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_generated_queries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GeneratedQuery]: - result: list[GeneratedQuery] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GeneratedQuery.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GenerateQueryOutput: - """Dataclass for GenerateQueryOutput structure.""" - - queries: list[GeneratedQuery] | None = None - """ - A list of objects, each of which defines a generated query that can - correspond to the natural language queries. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GENERATE_QUERY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.queries is not None: - _serialize_generated_queries( - serializer, - _SCHEMA_GENERATE_QUERY_OUTPUT.members["queries"], - self.queries, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["queries"] = _deserialize_generated_queries( - de, _SCHEMA_GENERATE_QUERY_OUTPUT.members["queries"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GENERATE_QUERY_OUTPUT, consumer=_consumer) - return kwargs - - -GENERATE_QUERY = APIOperation( - input=GenerateQueryInput, - output=GenerateQueryOutput, - schema=_SCHEMA_GENERATE_QUERY, - input_schema=_SCHEMA_GENERATE_QUERY_INPUT, - output_schema=_SCHEMA_GENERATE_QUERY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentruntime#BadGatewayException" - ): BadGatewayException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentruntime#DependencyFailedException" - ): DependencyFailedException, - ShapeID( - "com.amazonaws.bedrockagentruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_BAD_GATEWAY_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_DEPENDENCY_FAILED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class DocumentOutputFormat(UnknownEnumMixin, StrEnum): - RAW = "RAW" - EXTRACTED = "EXTRACTED" - - -@dataclass(kw_only=True) -class GetDocumentContentInput: - """Dataclass for GetDocumentContentInput structure.""" - - knowledge_base_id: str | None = None - """The unique identifier of the knowledge base that contains the document.""" - - data_source_id: str | None = None - """The unique identifier of the data source that contains the document.""" - - document_id: str | None = None - """The unique identifier of the document to retrieve content for.""" - - output_format: str | None = None - """ - The output format for the document content. `RAW` returns the original - file. `EXTRACTED` returns parsed text as JSON. Defaults to `RAW`. - """ - - user_context: UserContext | None = field(repr=False, default=None) - """ - Contains information about the user making the request. This is used for - access control filtering to ensure that results only include documents - the user is authorized to access. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DOCUMENT_CONTENT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.knowledge_base_id is not None: - serializer.write_string( - _SCHEMA_GET_DOCUMENT_CONTENT_INPUT.members["knowledgeBaseId"], - self.knowledge_base_id, - ) - - if self.data_source_id is not None: - serializer.write_string( - _SCHEMA_GET_DOCUMENT_CONTENT_INPUT.members["dataSourceId"], - self.data_source_id, - ) - - if self.document_id is not None: - serializer.write_string( - _SCHEMA_GET_DOCUMENT_CONTENT_INPUT.members["documentId"], - self.document_id, - ) - - if self.output_format is not None: - serializer.write_string( - _SCHEMA_GET_DOCUMENT_CONTENT_INPUT.members["outputFormat"], - self.output_format, - ) - - if self.user_context is not None: - serializer.write_struct( - _SCHEMA_GET_DOCUMENT_CONTENT_INPUT.members["userContext"], - self.user_context, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["knowledge_base_id"] = de.read_string( - _SCHEMA_GET_DOCUMENT_CONTENT_INPUT.members["knowledgeBaseId"] - ) - - case 1: - kwargs["data_source_id"] = de.read_string( - _SCHEMA_GET_DOCUMENT_CONTENT_INPUT.members["dataSourceId"] - ) - - case 2: - kwargs["document_id"] = de.read_string( - _SCHEMA_GET_DOCUMENT_CONTENT_INPUT.members["documentId"] - ) - - case 3: - kwargs["output_format"] = DocumentOutputFormat( - de.read_string( - _SCHEMA_GET_DOCUMENT_CONTENT_INPUT.members["outputFormat"] - ) - ) - - case 4: - kwargs["user_context"] = UserContext.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_DOCUMENT_CONTENT_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetDocumentContentOutput: - """Dataclass for GetDocumentContentOutput structure.""" - - mime_type: str - """ - The MIME type of the document content. For `RAW` format, this is the - original file type (for example, `application/pdf`). For `EXTRACTED` - format, this is always `application/json`. - """ - - presigned_url: str = field(repr=False) - """ - A pre-signed URL for downloading the document content. The URL expires - after 5 minutes. - """ - - document_content_length: int | None = None - """ - The size of the document content in bytes available at the pre-signed - URL. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DOCUMENT_CONTENT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_DOCUMENT_CONTENT_OUTPUT.members["mimeType"], self.mime_type - ) - serializer.write_string( - _SCHEMA_GET_DOCUMENT_CONTENT_OUTPUT.members["presignedUrl"], - self.presigned_url, - ) - if self.document_content_length is not None: - serializer.write_long( - _SCHEMA_GET_DOCUMENT_CONTENT_OUTPUT.members["documentContentLength"], - self.document_content_length, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["mime_type"] = de.read_string( - _SCHEMA_GET_DOCUMENT_CONTENT_OUTPUT.members["mimeType"] - ) - - case 1: - kwargs["presigned_url"] = de.read_string( - _SCHEMA_GET_DOCUMENT_CONTENT_OUTPUT.members["presignedUrl"] - ) - - case 2: - kwargs["document_content_length"] = de.read_long( - _SCHEMA_GET_DOCUMENT_CONTENT_OUTPUT.members[ - "documentContentLength" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_DOCUMENT_CONTENT_OUTPUT, consumer=_consumer - ) - if "mime_type" not in kwargs: - kwargs["mime_type"] = "" - if "presigned_url" not in kwargs: - kwargs["presigned_url"] = "" - return kwargs - - -GET_DOCUMENT_CONTENT = APIOperation( - input=GetDocumentContentInput, - output=GetDocumentContentOutput, - schema=_SCHEMA_GET_DOCUMENT_CONTENT, - input_schema=_SCHEMA_GET_DOCUMENT_CONTENT_INPUT, - output_schema=_SCHEMA_GET_DOCUMENT_CONTENT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetIngestedDocumentAclInput: - """Dataclass for GetIngestedDocumentAclInput structure.""" - - knowledge_base_id: str | None = None - """The unique identifier of the knowledge base that contains the document.""" - - data_source_id: str | None = None - """The unique identifier of the data source that contains the document.""" - - document_id: str | None = None - """ - The unique identifier of the document to retrieve the ingested access - control list (ACL) for. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_INGESTED_DOCUMENT_ACL_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.knowledge_base_id is not None: - serializer.write_string( - _SCHEMA_GET_INGESTED_DOCUMENT_ACL_INPUT.members["knowledgeBaseId"], - self.knowledge_base_id, - ) - - if self.data_source_id is not None: - serializer.write_string( - _SCHEMA_GET_INGESTED_DOCUMENT_ACL_INPUT.members["dataSourceId"], - self.data_source_id, - ) - - if self.document_id is not None: - serializer.write_string( - _SCHEMA_GET_INGESTED_DOCUMENT_ACL_INPUT.members["documentId"], - self.document_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["knowledge_base_id"] = de.read_string( - _SCHEMA_GET_INGESTED_DOCUMENT_ACL_INPUT.members[ - "knowledgeBaseId" - ] - ) - - case 1: - kwargs["data_source_id"] = de.read_string( - _SCHEMA_GET_INGESTED_DOCUMENT_ACL_INPUT.members["dataSourceId"] - ) - - case 2: - kwargs["document_id"] = de.read_string( - _SCHEMA_GET_INGESTED_DOCUMENT_ACL_INPUT.members["documentId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_INGESTED_DOCUMENT_ACL_INPUT, consumer=_consumer - ) - return kwargs - - -class DocumentAclMemberRelation(UnknownEnumMixin, StrEnum): - """ - The logical relation for combining access control list (ACL) membership - conditions. - """ - - AND_ = "AND" - OR_ = "OR" - - -class DocumentAclMembershipType(UnknownEnumMixin, StrEnum): - """ - The scope type for a document access control list (ACL) membership - condition. Valid values: `KNOWLEDGE_BASE` -- The entry applies at the - knowledge base level. `DATA_SOURCE` -- The entry applies at the data - source level. - """ - - KNOWLEDGE_BASE = "KNOWLEDGE_BASE" - DATA_SOURCE = "DATA_SOURCE" - - -@dataclass(kw_only=True) -class DocumentAclGroup: - """A group entry within a document access control list (ACL) condition.""" - - id: str - """The identifier of the group.""" - - type: str - """The membership type indicating the scope of the group entry.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_ACL_GROUP, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_DOCUMENT_ACL_GROUP.members["id"], self.id) - serializer.write_string(_SCHEMA_DOCUMENT_ACL_GROUP.members["type"], self.type) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_DOCUMENT_ACL_GROUP.members["id"] - ) - - case 1: - kwargs["type"] = DocumentAclMembershipType( - de.read_string(_SCHEMA_DOCUMENT_ACL_GROUP.members["type"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DOCUMENT_ACL_GROUP, consumer=_consumer) - if "id" not in kwargs: - kwargs["id"] = "" - if "type" not in kwargs: - kwargs["type"] = DocumentAclMembershipType._corrected("") - return kwargs - - -def _serialize_document_acl_group_list( - serializer: ShapeSerializer, schema: Schema, value: list[DocumentAclGroup] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_document_acl_group_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[DocumentAclGroup]: - result: list[DocumentAclGroup] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(DocumentAclGroup.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class DocumentAclUser: - """A user entry within a document access control list (ACL) condition.""" - - id: str - """The identifier of the user.""" - - type: str - """The membership type indicating the scope of the user entry.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_ACL_USER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_DOCUMENT_ACL_USER.members["id"], self.id) - serializer.write_string(_SCHEMA_DOCUMENT_ACL_USER.members["type"], self.type) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_DOCUMENT_ACL_USER.members["id"] - ) - - case 1: - kwargs["type"] = DocumentAclMembershipType( - de.read_string(_SCHEMA_DOCUMENT_ACL_USER.members["type"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DOCUMENT_ACL_USER, consumer=_consumer) - if "id" not in kwargs: - kwargs["id"] = "" - if "type" not in kwargs: - kwargs["type"] = DocumentAclMembershipType._corrected("") - return kwargs - - -def _serialize_document_acl_user_list( - serializer: ShapeSerializer, schema: Schema, value: list[DocumentAclUser] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_document_acl_user_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[DocumentAclUser]: - result: list[DocumentAclUser] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(DocumentAclUser.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class DocumentAclCondition: - """ - A condition within a document access control list (ACL) membership, - specifying users and groups that are evaluated together. - """ - - condition_operator: str | None = None - """ - The logical operator for combining users and groups within this - condition. Valid values: `AND` -- Both a user match and a group match - are required. `OR` -- Either a user match or a group match is - sufficient. - """ - - users: list[DocumentAclUser] | None = None - """The list of user entries in this condition.""" - - groups: list[DocumentAclGroup] | None = None - """The list of group entries in this condition.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_ACL_CONDITION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.condition_operator is not None: - serializer.write_string( - _SCHEMA_DOCUMENT_ACL_CONDITION.members["conditionOperator"], - self.condition_operator, - ) - - if self.users is not None: - _serialize_document_acl_user_list( - serializer, _SCHEMA_DOCUMENT_ACL_CONDITION.members["users"], self.users - ) - - if self.groups is not None: - _serialize_document_acl_group_list( - serializer, - _SCHEMA_DOCUMENT_ACL_CONDITION.members["groups"], - self.groups, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["condition_operator"] = DocumentAclMemberRelation( - de.read_string( - _SCHEMA_DOCUMENT_ACL_CONDITION.members["conditionOperator"] - ) - ) - - case 1: - kwargs["users"] = _deserialize_document_acl_user_list( - de, _SCHEMA_DOCUMENT_ACL_CONDITION.members["users"] - ) - - case 2: - kwargs["groups"] = _deserialize_document_acl_group_list( - de, _SCHEMA_DOCUMENT_ACL_CONDITION.members["groups"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DOCUMENT_ACL_CONDITION, consumer=_consumer) - return kwargs - - -def _serialize_document_acl_condition_list( - serializer: ShapeSerializer, schema: Schema, value: list[DocumentAclCondition] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_document_acl_condition_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[DocumentAclCondition]: - result: list[DocumentAclCondition] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(DocumentAclCondition.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class DocumentAclMembership: - """ - The membership entry for a document access control list (ACL), - containing conditions and their logical relation. - """ - - member_relation: str | None = None - """ - The logical relation between conditions. Valid values: `AND` -- All - conditions must match. `OR` -- At least one condition must match. - """ - - conditions: list[DocumentAclCondition] | None = None - """The list of conditions that determine membership.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_ACL_MEMBERSHIP, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.member_relation is not None: - serializer.write_string( - _SCHEMA_DOCUMENT_ACL_MEMBERSHIP.members["memberRelation"], - self.member_relation, - ) - - if self.conditions is not None: - _serialize_document_acl_condition_list( - serializer, - _SCHEMA_DOCUMENT_ACL_MEMBERSHIP.members["conditions"], - self.conditions, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["member_relation"] = DocumentAclMemberRelation( - de.read_string( - _SCHEMA_DOCUMENT_ACL_MEMBERSHIP.members["memberRelation"] - ) - ) - - case 1: - kwargs["conditions"] = _deserialize_document_acl_condition_list( - de, _SCHEMA_DOCUMENT_ACL_MEMBERSHIP.members["conditions"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DOCUMENT_ACL_MEMBERSHIP, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DocumentAcl: - """ - The access control list for a document, containing allow and deny - membership lists. Each list specifies conditions that determine which - users and groups are granted or denied access. - """ - - allow_list: DocumentAclMembership | None = None - """The list of principals allowed access to the document.""" - - deny_list: DocumentAclMembership | None = None - """The list of principals denied access to the document.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_ACL, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.allow_list is not None: - serializer.write_struct( - _SCHEMA_DOCUMENT_ACL.members["allowList"], self.allow_list - ) - - if self.deny_list is not None: - serializer.write_struct( - _SCHEMA_DOCUMENT_ACL.members["denyList"], self.deny_list - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["allow_list"] = DocumentAclMembership.deserialize(de) - - case 1: - kwargs["deny_list"] = DocumentAclMembership.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DOCUMENT_ACL, consumer=_consumer) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls() - - -@dataclass(kw_only=True) -class GetIngestedDocumentAclOutput: - """Dataclass for GetIngestedDocumentAclOutput structure.""" - - document_acl: DocumentAcl = field(repr=False) - """ - The ingested document access control list (ACL) containing allow and - deny membership information. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_INGESTED_DOCUMENT_ACL_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_INGESTED_DOCUMENT_ACL_OUTPUT.members["documentAcl"], - self.document_acl, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["document_acl"] = DocumentAcl.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_INGESTED_DOCUMENT_ACL_OUTPUT, consumer=_consumer - ) - if "document_acl" not in kwargs: - kwargs["document_acl"] = DocumentAcl._smithy_default() - return kwargs - - -GET_INGESTED_DOCUMENT_ACL = APIOperation( - input=GetIngestedDocumentAclInput, - output=GetIngestedDocumentAclOutput, - schema=_SCHEMA_GET_INGESTED_DOCUMENT_ACL, - input_schema=_SCHEMA_GET_INGESTED_DOCUMENT_ACL_INPUT, - output_schema=_SCHEMA_GET_INGESTED_DOCUMENT_ACL_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class BedrockModelConfigurations: - """Settings for a model called with InvokeAgent.""" - - performance_config: PerformanceConfiguration | None = None - """The performance configuration for the model.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BEDROCK_MODEL_CONFIGURATIONS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.performance_config is not None: - serializer.write_struct( - _SCHEMA_BEDROCK_MODEL_CONFIGURATIONS.members["performanceConfig"], - self.performance_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["performance_config"] = PerformanceConfiguration.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_BEDROCK_MODEL_CONFIGURATIONS, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class PromptCreationConfigurations: - """ - Specifies parameters that control how the service populates the agent - prompt for an `InvokeAgent` or `InvokeInlineAgent` request. You can - control which aspects of previous invocations in the same agent session - the service uses to populate the agent prompt. This gives you more - granular control over the contextual history that is used to process the - current request. - """ - - previous_conversation_turns_to_include: int | None = None - """ - The number of previous conversations from the ongoing agent session to - include in the conversation history of the agent prompt, during the - current invocation. This gives you more granular control over the - context that the model is made aware of, and helps the model remove - older context which is no longer useful during the ongoing agent - session. - """ - - exclude_previous_thinking_steps: bool = False - """ - If `true`, the service removes any content between `` tags - from previous conversations in an agent session. The service will only - remove content from already processed turns. This helps you remove - content which might not be useful for current and subsequent - invocations. This can reduce the input token count and potentially save - costs. The default value is `false`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PROMPT_CREATION_CONFIGURATIONS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.previous_conversation_turns_to_include is not None: - serializer.write_integer( - _SCHEMA_PROMPT_CREATION_CONFIGURATIONS.members[ - "previousConversationTurnsToInclude" - ], - self.previous_conversation_turns_to_include, - ) - - serializer.write_boolean( - _SCHEMA_PROMPT_CREATION_CONFIGURATIONS.members[ - "excludePreviousThinkingSteps" - ], - self.exclude_previous_thinking_steps, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["previous_conversation_turns_to_include"] = de.read_integer( - _SCHEMA_PROMPT_CREATION_CONFIGURATIONS.members[ - "previousConversationTurnsToInclude" - ] - ) - - case 1: - kwargs["exclude_previous_thinking_steps"] = de.read_boolean( - _SCHEMA_PROMPT_CREATION_CONFIGURATIONS.members[ - "excludePreviousThinkingSteps" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PROMPT_CREATION_CONFIGURATIONS, consumer=_consumer - ) - return kwargs - - -@dataclass -class ContentBlockText: - """The block's text.""" - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_CONTENT_BLOCK.members["text"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string(_SCHEMA_CONTENT_BLOCK.members["text"]) - ) - - -@dataclass -class ContentBlockUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ContentBlock = Union[ContentBlockText | ContentBlockUnknown] -"""A content block.""" - - -class _ContentBlockDeserializer: - _result: ContentBlock | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> ContentBlock: - self._result = None - deserializer.read_struct(_SCHEMA_CONTENT_BLOCK, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(ContentBlockText.deserialize(de)) - - case _: - self._set_result(ContentBlockUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: ContentBlock) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_content_blocks( - serializer: ShapeSerializer, schema: Schema, value: list[ContentBlock] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_content_blocks( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ContentBlock]: - result: list[ContentBlock] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_ContentBlockDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class Message: - """Details about a message.""" - - role: str - """The message's role.""" - - content: list[ContentBlock] - """The message's content.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MESSAGE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_MESSAGE.members["role"], self.role) - _serialize_content_blocks( - serializer, _SCHEMA_MESSAGE.members["content"], self.content - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["role"] = ConversationRole( - de.read_string(_SCHEMA_MESSAGE.members["role"]) - ) - - case 1: - kwargs["content"] = _deserialize_content_blocks( - de, _SCHEMA_MESSAGE.members["content"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MESSAGE, consumer=_consumer) - if "role" not in kwargs: - kwargs["role"] = ConversationRole._corrected("") - if "content" not in kwargs: - kwargs["content"] = [] - return kwargs - - -def _serialize_messages( - serializer: ShapeSerializer, schema: Schema, value: list[Message] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_messages( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Message]: - result: list[Message] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Message.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ConversationHistory: - """A conversation history.""" - - messages: list[Message] | None = None - """The conversation's messages.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONVERSATION_HISTORY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.messages is not None: - _serialize_messages( - serializer, - _SCHEMA_CONVERSATION_HISTORY.members["messages"], - self.messages, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["messages"] = _deserialize_messages( - de, _SCHEMA_CONVERSATION_HISTORY.members["messages"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONVERSATION_HISTORY, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ByteContentFile: - """The property contains the file to chat with, along with its attributes.""" - - media_type: str - """The MIME type of data contained in the file used for chat.""" - - data: bytes = field(repr=False) - """ - The raw bytes of the file to attach. The maximum size of all files that - is attached is 10MB. You can attach a maximum of 5 files. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BYTE_CONTENT_FILE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_BYTE_CONTENT_FILE.members["mediaType"], self.media_type - ) - serializer.write_blob(_SCHEMA_BYTE_CONTENT_FILE.members["data"], self.data) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["media_type"] = de.read_string( - _SCHEMA_BYTE_CONTENT_FILE.members["mediaType"] - ) - - case 1: - kwargs["data"] = de.read_blob( - _SCHEMA_BYTE_CONTENT_FILE.members["data"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BYTE_CONTENT_FILE, consumer=_consumer) - if "media_type" not in kwargs: - kwargs["media_type"] = "" - if "data" not in kwargs: - kwargs["data"] = b"" - return kwargs - - -@dataclass(kw_only=True) -class S3ObjectFile: - """Contains details of the s3 object where the source file is located.""" - - uri: str - """The uri of the s3 object.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_S3_OBJECT_FILE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_S3_OBJECT_FILE.members["uri"], self.uri) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["uri"] = de.read_string( - _SCHEMA_S3_OBJECT_FILE.members["uri"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_S3_OBJECT_FILE, consumer=_consumer) - if "uri" not in kwargs: - kwargs["uri"] = "" - return kwargs - - -class FileSourceType(UnknownEnumMixin, StrEnum): - S3 = "S3" - BYTE_CONTENT = "BYTE_CONTENT" - - -@dataclass(kw_only=True) -class FileSource: - """The source file of the content contained in the wrapper object.""" - - source_type: str - """The source type of the files to attach.""" - - s3_location: S3ObjectFile | None = None - """The s3 location of the files to attach.""" - - byte_content: ByteContentFile | None = None - """The data and the text of the attached files.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FILE_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_FILE_SOURCE.members["sourceType"], self.source_type - ) - if self.s3_location is not None: - serializer.write_struct( - _SCHEMA_FILE_SOURCE.members["s3Location"], self.s3_location - ) - - if self.byte_content is not None: - serializer.write_struct( - _SCHEMA_FILE_SOURCE.members["byteContent"], self.byte_content - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["source_type"] = FileSourceType( - de.read_string(_SCHEMA_FILE_SOURCE.members["sourceType"]) - ) - - case 1: - kwargs["s3_location"] = S3ObjectFile.deserialize(de) - - case 2: - kwargs["byte_content"] = ByteContentFile.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FILE_SOURCE, consumer=_consumer) - if "source_type" not in kwargs: - kwargs["source_type"] = FileSourceType._corrected("") - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(source_type=FileSourceType._corrected("")) - - -class FileUseCase(UnknownEnumMixin, StrEnum): - CODE_INTERPRETER = "CODE_INTERPRETER" - CHAT = "CHAT" - - -@dataclass(kw_only=True) -class InputFile: - """Contains details of the source files.""" - - name: str - """The name of the source file.""" - - source: FileSource - """Specifies where the files are located.""" - - use_case: str - """Specifies how the source files will be used by the code interpreter.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INPUT_FILE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_INPUT_FILE.members["name"], self.name) - serializer.write_struct(_SCHEMA_INPUT_FILE.members["source"], self.source) - serializer.write_string(_SCHEMA_INPUT_FILE.members["useCase"], self.use_case) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string(_SCHEMA_INPUT_FILE.members["name"]) - - case 1: - kwargs["source"] = FileSource.deserialize(de) - - case 2: - kwargs["use_case"] = FileUseCase( - de.read_string(_SCHEMA_INPUT_FILE.members["useCase"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INPUT_FILE, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "source" not in kwargs: - kwargs["source"] = FileSource._smithy_default() - if "use_case" not in kwargs: - kwargs["use_case"] = FileUseCase._corrected("") - return kwargs - - -def _serialize_input_files( - serializer: ShapeSerializer, schema: Schema, value: list[InputFile] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_input_files( - deserializer: ShapeDeserializer, schema: Schema -) -> list[InputFile]: - result: list[InputFile] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(InputFile.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class RerankingMetadataSelectionMode(UnknownEnumMixin, StrEnum): - SELECTIVE = "SELECTIVE" - ALL = "ALL" - - -@dataclass(kw_only=True) -class FieldForReranking: - """ - Contains information for a metadata field to include in or exclude from - consideration when reranking. - """ - - field_name: str - """ - The name of a metadata field to include in or exclude from consideration - when reranking. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FIELD_FOR_RERANKING, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_FIELD_FOR_RERANKING.members["fieldName"], self.field_name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["field_name"] = de.read_string( - _SCHEMA_FIELD_FOR_RERANKING.members["fieldName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FIELD_FOR_RERANKING, consumer=_consumer) - if "field_name" not in kwargs: - kwargs["field_name"] = "" - return kwargs - - -def _serialize_fields_for_reranking( - serializer: ShapeSerializer, schema: Schema, value: list[FieldForReranking] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_fields_for_reranking( - deserializer: ShapeDeserializer, schema: Schema -) -> list[FieldForReranking]: - result: list[FieldForReranking] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(FieldForReranking.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass -class RerankingMetadataSelectiveModeConfigurationFieldsToInclude: - """ - An array of objects, each of which specifies a metadata field to include - in consideration when reranking. The remaining metadata fields are - ignored. - """ - - value: list[FieldForReranking] - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_fields_for_reranking( - serializer, - _SCHEMA_RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION.members[ - "fieldsToInclude" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_deserialize_fields_for_reranking( - deserializer, - _SCHEMA_RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION.members[ - "fieldsToInclude" - ], - ) - ) - - -@dataclass -class RerankingMetadataSelectiveModeConfigurationFieldsToExclude: - """ - An array of objects, each of which specifies a metadata field to exclude - from consideration when reranking. - """ - - value: list[FieldForReranking] - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_fields_for_reranking( - serializer, - _SCHEMA_RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION.members[ - "fieldsToExclude" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_deserialize_fields_for_reranking( - deserializer, - _SCHEMA_RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION.members[ - "fieldsToExclude" - ], - ) - ) - - -@dataclass -class RerankingMetadataSelectiveModeConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -RerankingMetadataSelectiveModeConfiguration = Union[ - RerankingMetadataSelectiveModeConfigurationFieldsToInclude - | RerankingMetadataSelectiveModeConfigurationFieldsToExclude - | RerankingMetadataSelectiveModeConfigurationUnknown -] -""" -Contains configurations for the metadata fields to include or exclude -when considering reranking. If you include the `fieldsToExclude` field, -the reranker ignores all the metadata fields that you specify. If you -include the `fieldsToInclude` field, the reranker uses only the metadata -fields that you specify and ignores all others. You can include only one -of these fields. -""" - - -class _RerankingMetadataSelectiveModeConfigurationDeserializer: - _result: RerankingMetadataSelectiveModeConfiguration | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> RerankingMetadataSelectiveModeConfiguration: - self._result = None - deserializer.read_struct( - _SCHEMA_RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - RerankingMetadataSelectiveModeConfigurationFieldsToInclude.deserialize( - de - ) - ) - - case 1: - self._set_result( - RerankingMetadataSelectiveModeConfigurationFieldsToExclude.deserialize( - de - ) - ) - - case _: - self._set_result( - RerankingMetadataSelectiveModeConfigurationUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: RerankingMetadataSelectiveModeConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class MetadataConfigurationForReranking: - """Contains configurations for the metadata to use in reranking.""" - - selection_mode: str - """ - Specifies whether to consider all metadata when reranking, or only the - metadata that you select. If you specify `SELECTIVE`, include the - `selectiveModeConfiguration` field. - """ - - selective_mode_configuration: RerankingMetadataSelectiveModeConfiguration | None = ( - None - ) - """ - Contains configurations for the metadata fields to include or exclude - when considering reranking. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_METADATA_CONFIGURATION_FOR_RERANKING, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_METADATA_CONFIGURATION_FOR_RERANKING.members["selectionMode"], - self.selection_mode, - ) - if self.selective_mode_configuration is not None: - serializer.write_struct( - _SCHEMA_METADATA_CONFIGURATION_FOR_RERANKING.members[ - "selectiveModeConfiguration" - ], - self.selective_mode_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["selection_mode"] = RerankingMetadataSelectionMode( - de.read_string( - _SCHEMA_METADATA_CONFIGURATION_FOR_RERANKING.members[ - "selectionMode" - ] - ) - ) - - case 1: - kwargs["selective_mode_configuration"] = ( - _RerankingMetadataSelectiveModeConfigurationDeserializer().deserialize( - de - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_METADATA_CONFIGURATION_FOR_RERANKING, consumer=_consumer - ) - if "selection_mode" not in kwargs: - kwargs["selection_mode"] = RerankingMetadataSelectionMode._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class ManagedSearchBedrockRerankingModelConfiguration: - """ - Model configuration for a Bedrock reranking model used in managed - search. - """ - - model_arn: str - """The ARN of the Bedrock reranking model.""" - - additional_model_request_fields: dict[str, Document] | None = None - """Additional request fields to pass to the reranking model.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MANAGED_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MANAGED_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION.members[ - "modelArn" - ], - self.model_arn, - ) - if self.additional_model_request_fields is not None: - _serialize_additional_model_request_fields( - serializer, - _SCHEMA_MANAGED_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION.members[ - "additionalModelRequestFields" - ], - self.additional_model_request_fields, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_arn"] = de.read_string( - _SCHEMA_MANAGED_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION.members[ - "modelArn" - ] - ) - - case 1: - kwargs["additional_model_request_fields"] = ( - _deserialize_additional_model_request_fields( - de, - _SCHEMA_MANAGED_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION.members[ - "additionalModelRequestFields" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MANAGED_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION, - consumer=_consumer, - ) - if "model_arn" not in kwargs: - kwargs["model_arn"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(model_arn="") - - -@dataclass(kw_only=True) -class ManagedSearchBedrockRerankingConfiguration: - """Configuration for a Bedrock reranking model used in managed search.""" - - model_configuration: ManagedSearchBedrockRerankingModelConfiguration - """The model configuration containing the model ARN for reranking.""" - - number_of_reranked_results: int | None = None - """The number of results to return after reranking.""" - - metadata_configuration: MetadataConfigurationForReranking | None = None - """The metadata configuration for reranking.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MANAGED_SEARCH_BEDROCK_RERANKING_CONFIGURATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MANAGED_SEARCH_BEDROCK_RERANKING_CONFIGURATION.members[ - "modelConfiguration" - ], - self.model_configuration, - ) - if self.number_of_reranked_results is not None: - serializer.write_integer( - _SCHEMA_MANAGED_SEARCH_BEDROCK_RERANKING_CONFIGURATION.members[ - "numberOfRerankedResults" - ], - self.number_of_reranked_results, - ) - - if self.metadata_configuration is not None: - serializer.write_struct( - _SCHEMA_MANAGED_SEARCH_BEDROCK_RERANKING_CONFIGURATION.members[ - "metadataConfiguration" - ], - self.metadata_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_configuration"] = ( - ManagedSearchBedrockRerankingModelConfiguration.deserialize(de) - ) - - case 1: - kwargs["number_of_reranked_results"] = de.read_integer( - _SCHEMA_MANAGED_SEARCH_BEDROCK_RERANKING_CONFIGURATION.members[ - "numberOfRerankedResults" - ] - ) - - case 2: - kwargs["metadata_configuration"] = ( - MetadataConfigurationForReranking.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MANAGED_SEARCH_BEDROCK_RERANKING_CONFIGURATION, consumer=_consumer - ) - if "model_configuration" not in kwargs: - kwargs["model_configuration"] = ( - ManagedSearchBedrockRerankingModelConfiguration._smithy_default() - ) - return kwargs - - -class ManagedSearchRerankingConfigurationType(UnknownEnumMixin, StrEnum): - """The type of reranking configuration for managed search.""" - - BEDROCK_RERANKING_MODEL = "BEDROCK_RERANKING_MODEL" - - -@dataclass(kw_only=True) -class ManagedSearchRerankingConfiguration: - """Configuration for the reranking model used in managed search.""" - - type: str - """The type of reranking configuration.""" - - bedrock_reranking_configuration: ( - ManagedSearchBedrockRerankingConfiguration | None - ) = None - """The Bedrock reranking model configuration for managed search.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MANAGED_SEARCH_RERANKING_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MANAGED_SEARCH_RERANKING_CONFIGURATION.members["type"], self.type - ) - if self.bedrock_reranking_configuration is not None: - serializer.write_struct( - _SCHEMA_MANAGED_SEARCH_RERANKING_CONFIGURATION.members[ - "bedrockRerankingConfiguration" - ], - self.bedrock_reranking_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = ManagedSearchRerankingConfigurationType( - de.read_string( - _SCHEMA_MANAGED_SEARCH_RERANKING_CONFIGURATION.members[ - "type" - ] - ) - ) - - case 1: - kwargs["bedrock_reranking_configuration"] = ( - ManagedSearchBedrockRerankingConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MANAGED_SEARCH_RERANKING_CONFIGURATION, consumer=_consumer - ) - if "type" not in kwargs: - kwargs["type"] = ManagedSearchRerankingConfigurationType._corrected("") - return kwargs - - -class RerankingModelType(UnknownEnumMixin, StrEnum): - CUSTOM = "CUSTOM" - MANAGED = "MANAGED" - NONE = "NONE" - - -class AttributeType(UnknownEnumMixin, StrEnum): - STRING = "STRING" - NUMBER = "NUMBER" - BOOLEAN = "BOOLEAN" - STRING_LIST = "STRING_LIST" - - -@dataclass(kw_only=True) -class MetadataAttributeSchema: - """Details about a metadata attribute.""" - - key: str - """The attribute's key.""" - - type: str - """The attribute's type.""" - - description: str - """The attribute's description.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_METADATA_ATTRIBUTE_SCHEMA, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_METADATA_ATTRIBUTE_SCHEMA.members["key"], self.key - ) - serializer.write_string( - _SCHEMA_METADATA_ATTRIBUTE_SCHEMA.members["type"], self.type - ) - serializer.write_string( - _SCHEMA_METADATA_ATTRIBUTE_SCHEMA.members["description"], self.description - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["key"] = de.read_string( - _SCHEMA_METADATA_ATTRIBUTE_SCHEMA.members["key"] - ) - - case 1: - kwargs["type"] = AttributeType( - de.read_string( - _SCHEMA_METADATA_ATTRIBUTE_SCHEMA.members["type"] - ) - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_METADATA_ATTRIBUTE_SCHEMA.members["description"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_METADATA_ATTRIBUTE_SCHEMA, consumer=_consumer) - if "key" not in kwargs: - kwargs["key"] = "" - if "type" not in kwargs: - kwargs["type"] = AttributeType._corrected("") - if "description" not in kwargs: - kwargs["description"] = "" - return kwargs - - -def _serialize_metadata_attribute_schema_list( - serializer: ShapeSerializer, schema: Schema, value: list[MetadataAttributeSchema] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_metadata_attribute_schema_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[MetadataAttributeSchema]: - result: list[MetadataAttributeSchema] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(MetadataAttributeSchema.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ImplicitFilterConfiguration: - """ - Settings for implicit filtering, where a model generates a metadata - filter based on the prompt. - """ - - metadata_attributes: list[MetadataAttributeSchema] - """Metadata that can be used in a filter.""" - - model_arn: str - """The model that generates the filter.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IMPLICIT_FILTER_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_metadata_attribute_schema_list( - serializer, - _SCHEMA_IMPLICIT_FILTER_CONFIGURATION.members["metadataAttributes"], - self.metadata_attributes, - ) - serializer.write_string( - _SCHEMA_IMPLICIT_FILTER_CONFIGURATION.members["modelArn"], self.model_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["metadata_attributes"] = ( - _deserialize_metadata_attribute_schema_list( - de, - _SCHEMA_IMPLICIT_FILTER_CONFIGURATION.members[ - "metadataAttributes" - ], - ) - ) - - case 1: - kwargs["model_arn"] = de.read_string( - _SCHEMA_IMPLICIT_FILTER_CONFIGURATION.members["modelArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_IMPLICIT_FILTER_CONFIGURATION, consumer=_consumer - ) - if "metadata_attributes" not in kwargs: - kwargs["metadata_attributes"] = [] - if "model_arn" not in kwargs: - kwargs["model_arn"] = "" - return kwargs - - -class SearchType(UnknownEnumMixin, StrEnum): - HYBRID = "HYBRID" - SEMANTIC = "SEMANTIC" - - -@dataclass(kw_only=True) -class VectorSearchBedrockRerankingModelConfiguration: - """Contains configurations for an Amazon Bedrock reranker model.""" - - model_arn: str - """The ARN of the reranker model to use.""" - - additional_model_request_fields: dict[str, Document] | None = None - """ - A JSON object whose keys are request fields for the model and whose - values are values for those fields. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_VECTOR_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_VECTOR_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION.members[ - "modelArn" - ], - self.model_arn, - ) - if self.additional_model_request_fields is not None: - _serialize_additional_model_request_fields( - serializer, - _SCHEMA_VECTOR_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION.members[ - "additionalModelRequestFields" - ], - self.additional_model_request_fields, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_arn"] = de.read_string( - _SCHEMA_VECTOR_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION.members[ - "modelArn" - ] - ) - - case 1: - kwargs["additional_model_request_fields"] = ( - _deserialize_additional_model_request_fields( - de, - _SCHEMA_VECTOR_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION.members[ - "additionalModelRequestFields" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_VECTOR_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION, - consumer=_consumer, - ) - if "model_arn" not in kwargs: - kwargs["model_arn"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(model_arn="") - - -@dataclass(kw_only=True) -class VectorSearchBedrockRerankingConfiguration: - """ - Contains configurations for reranking with an Amazon Bedrock reranker - model. - """ - - model_configuration: VectorSearchBedrockRerankingModelConfiguration - """Contains configurations for the reranker model.""" - - number_of_reranked_results: int | None = None - """The number of results to return after reranking.""" - - metadata_configuration: MetadataConfigurationForReranking | None = None - """Contains configurations for the metadata to use in reranking.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_VECTOR_SEARCH_BEDROCK_RERANKING_CONFIGURATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_VECTOR_SEARCH_BEDROCK_RERANKING_CONFIGURATION.members[ - "modelConfiguration" - ], - self.model_configuration, - ) - if self.number_of_reranked_results is not None: - serializer.write_integer( - _SCHEMA_VECTOR_SEARCH_BEDROCK_RERANKING_CONFIGURATION.members[ - "numberOfRerankedResults" - ], - self.number_of_reranked_results, - ) - - if self.metadata_configuration is not None: - serializer.write_struct( - _SCHEMA_VECTOR_SEARCH_BEDROCK_RERANKING_CONFIGURATION.members[ - "metadataConfiguration" - ], - self.metadata_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_configuration"] = ( - VectorSearchBedrockRerankingModelConfiguration.deserialize(de) - ) - - case 1: - kwargs["number_of_reranked_results"] = de.read_integer( - _SCHEMA_VECTOR_SEARCH_BEDROCK_RERANKING_CONFIGURATION.members[ - "numberOfRerankedResults" - ] - ) - - case 2: - kwargs["metadata_configuration"] = ( - MetadataConfigurationForReranking.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_VECTOR_SEARCH_BEDROCK_RERANKING_CONFIGURATION, consumer=_consumer - ) - if "model_configuration" not in kwargs: - kwargs["model_configuration"] = ( - VectorSearchBedrockRerankingModelConfiguration._smithy_default() - ) - return kwargs - - -class VectorSearchRerankingConfigurationType(UnknownEnumMixin, StrEnum): - BEDROCK_RERANKING_MODEL = "BEDROCK_RERANKING_MODEL" - - -@dataclass(kw_only=True) -class VectorSearchRerankingConfiguration: - """Contains configurations for reranking the retrieved results.""" - - type: str - """The type of reranker model.""" - - bedrock_reranking_configuration: ( - VectorSearchBedrockRerankingConfiguration | None - ) = None - """Contains configurations for an Amazon Bedrock reranker model.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VECTOR_SEARCH_RERANKING_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_VECTOR_SEARCH_RERANKING_CONFIGURATION.members["type"], self.type - ) - if self.bedrock_reranking_configuration is not None: - serializer.write_struct( - _SCHEMA_VECTOR_SEARCH_RERANKING_CONFIGURATION.members[ - "bedrockRerankingConfiguration" - ], - self.bedrock_reranking_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = VectorSearchRerankingConfigurationType( - de.read_string( - _SCHEMA_VECTOR_SEARCH_RERANKING_CONFIGURATION.members[ - "type" - ] - ) - ) - - case 1: - kwargs["bedrock_reranking_configuration"] = ( - VectorSearchBedrockRerankingConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_VECTOR_SEARCH_RERANKING_CONFIGURATION, consumer=_consumer - ) - if "type" not in kwargs: - kwargs["type"] = VectorSearchRerankingConfigurationType._corrected("") - return kwargs - - -def _serialize_prompt_session_attributes_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_prompt_session_attributes_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -def _serialize_session_attributes_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_session_attributes_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class StreamingConfigurations: - """Configurations for streaming.""" - - stream_final_response: bool = False - """ - Specifies whether to enable streaming for the final response. This is - set to `false` by default. - """ - - apply_guardrail_interval: int | None = None - """ - The guardrail interval to apply as response is generated. By default, - the guardrail interval is set to 50 characters. If a larger interval is - specified, the response will be generated in larger chunks with fewer - `ApplyGuardrail` calls. The following examples show the response - generated for *Hello, I am an agent* input string. - - **Example response in chunks: Interval set to 3 characters** - - `'Hel', 'lo, ','I am', ' an', ' Age', 'nt'` - - Each chunk has at least 3 characters except for the last chunk - - **Example response in chunks: Interval set to 20 or more characters** - - `Hello, I am an Agent` - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STREAMING_CONFIGURATIONS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_boolean( - _SCHEMA_STREAMING_CONFIGURATIONS.members["streamFinalResponse"], - self.stream_final_response, - ) - if self.apply_guardrail_interval is not None: - serializer.write_integer( - _SCHEMA_STREAMING_CONFIGURATIONS.members["applyGuardrailInterval"], - self.apply_guardrail_interval, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["stream_final_response"] = de.read_boolean( - _SCHEMA_STREAMING_CONFIGURATIONS.members["streamFinalResponse"] - ) - - case 1: - kwargs["apply_guardrail_interval"] = de.read_integer( - _SCHEMA_STREAMING_CONFIGURATIONS.members[ - "applyGuardrailInterval" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_STREAMING_CONFIGURATIONS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Span: - """ - Contains information about where the text with a citation begins and - ends in the generated output. - - This data type is used in the following API operations: - - - [RetrieveAndGenerate - response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax) - -- in the `span` field - - - [InvokeAgent - response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax) - -- in the `span` field - """ - - start: int | None = None - """Where the text with a citation starts in the generated output.""" - - end: int | None = None - """Where the text with a citation ends in the generated output.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SPAN, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.start is not None: - serializer.write_integer(_SCHEMA_SPAN.members["start"], self.start) - - if self.end is not None: - serializer.write_integer(_SCHEMA_SPAN.members["end"], self.end) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["start"] = de.read_integer(_SCHEMA_SPAN.members["start"]) - - case 1: - kwargs["end"] = de.read_integer(_SCHEMA_SPAN.members["end"]) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SPAN, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class TextResponsePart: - """ - Contains the part of the generated text that contains a citation, - alongside where it begins and ends. - - This data type is used in the following API operations: - - - [RetrieveAndGenerate - response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax) - -- in the `textResponsePart` field - - - [InvokeAgent - response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax) - -- in the `textResponsePart` field - """ - - text: str | None = None - """The part of the generated text that contains a citation.""" - - span: Span | None = None - """ - Contains information about where the text with a citation begins and - ends in the generated output. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TEXT_RESPONSE_PART, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.text is not None: - serializer.write_string( - _SCHEMA_TEXT_RESPONSE_PART.members["text"], self.text - ) - - if self.span is not None: - serializer.write_struct( - _SCHEMA_TEXT_RESPONSE_PART.members["span"], self.span - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["text"] = de.read_string( - _SCHEMA_TEXT_RESPONSE_PART.members["text"] - ) - - case 1: - kwargs["span"] = Span.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TEXT_RESPONSE_PART, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GeneratedResponsePart: - """ - Contains metadata about a part of the generated response that is - accompanied by a citation. - - This data type is used in the following API operations: - - - [InvokeAgent - response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax) - -- in the `generatedResponsePart` field - - - [RetrieveAndGenerate - response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax) - -- in the `generatedResponsePart` field - """ - - text_response_part: TextResponsePart | None = field(repr=False, default=None) - """ - Contains metadata about a textual part of the generated response that is - accompanied by a citation. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GENERATED_RESPONSE_PART, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.text_response_part is not None: - serializer.write_struct( - _SCHEMA_GENERATED_RESPONSE_PART.members["textResponsePart"], - self.text_response_part, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["text_response_part"] = TextResponsePart.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GENERATED_RESPONSE_PART, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Citation: - """ - An object containing a segment of the generated response that is based - on a source in the knowledge base, alongside information about the - source. - - This data type is used in the following API operations: - - - [InvokeAgent - response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax) - -- in the `citations` field - - - [RetrieveAndGenerate - response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax) - -- in the `citations` field - """ - - generated_response_part: GeneratedResponsePart | None = None - """Contains the generated response and metadata""" - - retrieved_references: list[RetrievedReference] | None = None - """Contains metadata about the sources cited for the generated response.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CITATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.generated_response_part is not None: - serializer.write_struct( - _SCHEMA_CITATION.members["generatedResponsePart"], - self.generated_response_part, - ) - - if self.retrieved_references is not None: - _serialize_retrieved_references( - serializer, - _SCHEMA_CITATION.members["retrievedReferences"], - self.retrieved_references, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["generated_response_part"] = ( - GeneratedResponsePart.deserialize(de) - ) - - case 1: - kwargs["retrieved_references"] = _deserialize_retrieved_references( - de, _SCHEMA_CITATION.members["retrievedReferences"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CITATION, consumer=_consumer) - return kwargs - - -def _serialize_citations( - serializer: ShapeSerializer, schema: Schema, value: list[Citation] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_citations( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Citation]: - result: list[Citation] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Citation.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class Attribution: - """Contains citations for a part of an agent response.""" - - citations: list[Citation] | None = None - """ - A list of citations and related information for a part of an agent - response. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ATTRIBUTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.citations is not None: - _serialize_citations( - serializer, _SCHEMA_ATTRIBUTION.members["citations"], self.citations - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["citations"] = _deserialize_citations( - de, _SCHEMA_ATTRIBUTION.members["citations"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ATTRIBUTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class PayloadPart: - """Contains a part of an agent response and citations for it.""" - - bytes_: bytes | None = field(repr=False, default=None) - """A part of the agent response in bytes.""" - - attribution: Attribution | None = None - """Contains citations for a part of an agent response.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PAYLOAD_PART, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.bytes_ is not None: - serializer.write_blob(_SCHEMA_PAYLOAD_PART.members["bytes"], self.bytes_) - - if self.attribution is not None: - serializer.write_struct( - _SCHEMA_PAYLOAD_PART.members["attribution"], self.attribution - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bytes_"] = de.read_blob( - _SCHEMA_PAYLOAD_PART.members["bytes"] - ) - - case 1: - kwargs["attribution"] = Attribution.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PAYLOAD_PART, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class OutputFile: - """Contains details of the response from code interpreter.""" - - name: str | None = None - """The name of the file containing response from code interpreter.""" - - type: str | None = None - """The type of file that contains response from the code interpreter.""" - - bytes_: bytes | None = field(repr=False, default=None) - """The byte count of files that contains response from code interpreter.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OUTPUT_FILE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string(_SCHEMA_OUTPUT_FILE.members["name"], self.name) - - if self.type is not None: - serializer.write_string(_SCHEMA_OUTPUT_FILE.members["type"], self.type) - - if self.bytes_ is not None: - serializer.write_blob(_SCHEMA_OUTPUT_FILE.members["bytes"], self.bytes_) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string(_SCHEMA_OUTPUT_FILE.members["name"]) - - case 1: - kwargs["type"] = de.read_string(_SCHEMA_OUTPUT_FILE.members["type"]) - - case 2: - kwargs["bytes_"] = de.read_blob( - _SCHEMA_OUTPUT_FILE.members["bytes"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_OUTPUT_FILE, consumer=_consumer) - return kwargs - - -def _serialize_output_files( - serializer: ShapeSerializer, schema: Schema, value: list[OutputFile] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_output_files( - deserializer: ShapeDeserializer, schema: Schema -) -> list[OutputFile]: - result: list[OutputFile] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(OutputFile.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class FilePart: - """ - Contains intermediate response for code interpreter if any files have - been generated. - """ - - files: list[OutputFile] | None = None - """Files containing intermediate response for the user.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FILE_PART, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.files is not None: - _serialize_output_files( - serializer, _SCHEMA_FILE_PART.members["files"], self.files - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["files"] = _deserialize_output_files( - de, _SCHEMA_FILE_PART.members["files"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FILE_PART, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ModelNotReadyException(ServiceError): - """ - The model specified in the request is not ready to serve inference - requests. The AWS SDK will automatically retry the operation up to 5 - times. For information about configuring automatic retries, see [Retry - behavior](https://docs.aws.amazon.com/sdkref/latest/guide/feature-retry-behavior.html) - in the *AWS SDKs and Tools* reference guide. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MODEL_NOT_READY_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_MODEL_NOT_READY_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_MODEL_NOT_READY_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MODEL_NOT_READY_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass -class ResponseStreamChunk: - """Contains a part of an agent response and citations for it.""" - - value: PayloadPart - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESPONSE_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESPONSE_STREAM.members["chunk"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=PayloadPart.deserialize(deserializer)) - - -@dataclass -class ResponseStreamTrace: - """ - Contains information about the agent and session, alongside the agent's - reasoning process and results from calling actions and querying - knowledge bases and metadata about the trace. You can use the trace to - understand how the agent arrived at the response it provided the - customer. For more information, see [Trace - events](https://docs.aws.amazon.com/bedrock/latest/userguide/trace-events.html). - """ - - value: TracePart - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESPONSE_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESPONSE_STREAM.members["trace"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=TracePart.deserialize(deserializer)) - - -@dataclass -class ResponseStreamReturnControl: - """ - Contains the parameters and information that the agent elicited from the - customer to carry out an action. This information is returned to the - system and can be used in your own setup for fulfilling the action. - """ - - value: ReturnControlPayload - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESPONSE_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RESPONSE_STREAM.members["returnControl"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ReturnControlPayload.deserialize(deserializer)) - - -@dataclass -class ResponseStreamInternalServerException: - """An internal server error occurred. Retry your request.""" - - value: InternalServerException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESPONSE_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RESPONSE_STREAM.members["internalServerException"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=InternalServerException.deserialize(deserializer)) - - -@dataclass -class ResponseStreamValidationException: - """ - Input validation failed. Check your request parameters and retry the - request. - """ - - value: ValidationException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESPONSE_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RESPONSE_STREAM.members["validationException"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ValidationException.deserialize(deserializer)) - - -@dataclass -class ResponseStreamResourceNotFoundException: - """ - The specified resource Amazon Resource Name (ARN) was not found. Check - the Amazon Resource Name (ARN) and try your request again. - """ - - value: ResourceNotFoundException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESPONSE_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RESPONSE_STREAM.members["resourceNotFoundException"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ResourceNotFoundException.deserialize(deserializer)) - - -@dataclass -class ResponseStreamServiceQuotaExceededException: - """ - The number of requests exceeds the service quota. Resubmit your request - later. - """ - - value: ServiceQuotaExceededException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESPONSE_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RESPONSE_STREAM.members["serviceQuotaExceededException"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ServiceQuotaExceededException.deserialize(deserializer)) - - -@dataclass -class ResponseStreamThrottlingException: - """The number of requests exceeds the limit. Resubmit your request later.""" - - value: ThrottlingException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESPONSE_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RESPONSE_STREAM.members["throttlingException"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ThrottlingException.deserialize(deserializer)) - - -@dataclass -class ResponseStreamAccessDeniedException: - """ - The request is denied because of missing access permissions. Check your - permissions and retry your request. - """ - - value: AccessDeniedException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESPONSE_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RESPONSE_STREAM.members["accessDeniedException"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=AccessDeniedException.deserialize(deserializer)) - - -@dataclass -class ResponseStreamConflictException: - """ - There was a conflict performing an operation. Resolve the conflict and - retry your request. - """ - - value: ConflictException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESPONSE_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RESPONSE_STREAM.members["conflictException"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ConflictException.deserialize(deserializer)) - - -@dataclass -class ResponseStreamDependencyFailedException: - """ - There was an issue with a dependency. Check the resource configurations - and retry the request. - """ - - value: DependencyFailedException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESPONSE_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RESPONSE_STREAM.members["dependencyFailedException"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=DependencyFailedException.deserialize(deserializer)) - - -@dataclass -class ResponseStreamBadGatewayException: - """ - There was an issue with a dependency due to a server issue. Retry your - request. - """ - - value: BadGatewayException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESPONSE_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RESPONSE_STREAM.members["badGatewayException"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=BadGatewayException.deserialize(deserializer)) - - -@dataclass -class ResponseStreamModelNotReadyException: - """ - The model specified in the request is not ready to serve Inference - requests. The AWS SDK will automatically retry the operation up to 5 - times. For information about configuring automatic retries, see [Retry - behavior](https://docs.aws.amazon.com/sdkref/latest/guide/feature-retry-behavior.html) - in the *AWS SDKs and Tools* reference guide. - """ - - value: ModelNotReadyException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESPONSE_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RESPONSE_STREAM.members["modelNotReadyException"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ModelNotReadyException.deserialize(deserializer)) - - -@dataclass -class ResponseStreamFiles: - """ - Contains intermediate response for code interpreter if any files have - been generated. - """ - - value: FilePart - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESPONSE_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESPONSE_STREAM.members["files"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=FilePart.deserialize(deserializer)) - - -@dataclass -class ResponseStreamUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ResponseStream = Union[ - ResponseStreamChunk - | ResponseStreamTrace - | ResponseStreamReturnControl - | ResponseStreamInternalServerException - | ResponseStreamValidationException - | ResponseStreamResourceNotFoundException - | ResponseStreamServiceQuotaExceededException - | ResponseStreamThrottlingException - | ResponseStreamAccessDeniedException - | ResponseStreamConflictException - | ResponseStreamDependencyFailedException - | ResponseStreamBadGatewayException - | ResponseStreamModelNotReadyException - | ResponseStreamFiles - | ResponseStreamUnknown -] -""" -The response from invoking the agent and associated citations and trace -information. -""" - - -class _ResponseStreamDeserializer: - _result: ResponseStream | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> ResponseStream: - self._result = None - deserializer.read_struct(_SCHEMA_RESPONSE_STREAM, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(ResponseStreamChunk.deserialize(de)) - - case 1: - self._set_result(ResponseStreamTrace.deserialize(de)) - - case 2: - self._set_result(ResponseStreamReturnControl.deserialize(de)) - - case 3: - self._set_result(ResponseStreamInternalServerException.deserialize(de)) - - case 4: - self._set_result(ResponseStreamValidationException.deserialize(de)) - - case 5: - self._set_result( - ResponseStreamResourceNotFoundException.deserialize(de) - ) - - case 6: - self._set_result( - ResponseStreamServiceQuotaExceededException.deserialize(de) - ) - - case 7: - self._set_result(ResponseStreamThrottlingException.deserialize(de)) - - case 8: - self._set_result(ResponseStreamAccessDeniedException.deserialize(de)) - - case 9: - self._set_result(ResponseStreamConflictException.deserialize(de)) - - case 10: - self._set_result( - ResponseStreamDependencyFailedException.deserialize(de) - ) - - case 11: - self._set_result(ResponseStreamBadGatewayException.deserialize(de)) - - case 12: - self._set_result(ResponseStreamModelNotReadyException.deserialize(de)) - - case 13: - self._set_result(ResponseStreamFiles.deserialize(de)) - - case _: - self._set_result(ResponseStreamUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: ResponseStream) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class InvokeAgentOutput: - """Dataclass for InvokeAgentOutput structure.""" - - content_type: str - """ - The MIME type of the input data in the request. The default value is - `application/json`. - """ - - session_id: str - """The unique identifier of the session with the agent.""" - - memory_id: str | None = None - """The unique identifier of the agent memory.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOKE_AGENT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_INVOKE_AGENT_OUTPUT.members["contentType"], self.content_type - ) - serializer.write_string( - _SCHEMA_INVOKE_AGENT_OUTPUT.members["sessionId"], self.session_id - ) - if self.memory_id is not None: - serializer.write_string( - _SCHEMA_INVOKE_AGENT_OUTPUT.members["memoryId"], self.memory_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 1: - kwargs["content_type"] = de.read_string( - _SCHEMA_INVOKE_AGENT_OUTPUT.members["contentType"] - ) - - case 2: - kwargs["session_id"] = de.read_string( - _SCHEMA_INVOKE_AGENT_OUTPUT.members["sessionId"] - ) - - case 3: - kwargs["memory_id"] = de.read_string( - _SCHEMA_INVOKE_AGENT_OUTPUT.members["memoryId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INVOKE_AGENT_OUTPUT, consumer=_consumer) - if "content_type" not in kwargs: - kwargs["content_type"] = "" - if "session_id" not in kwargs: - kwargs["session_id"] = "" - return kwargs - - -@dataclass(kw_only=True) -class InlineBedrockModelConfigurations: - """Settings for a model called with InvokeInlineAgent.""" - - performance_config: PerformanceConfiguration | None = None - """The latency configuration for the model.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INLINE_BEDROCK_MODEL_CONFIGURATIONS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.performance_config is not None: - serializer.write_struct( - _SCHEMA_INLINE_BEDROCK_MODEL_CONFIGURATIONS.members[ - "performanceConfig" - ], - self.performance_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["performance_config"] = PerformanceConfiguration.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INLINE_BEDROCK_MODEL_CONFIGURATIONS, consumer=_consumer - ) - return kwargs - - -class RelayConversationHistory(UnknownEnumMixin, StrEnum): - TO_COLLABORATOR = "TO_COLLABORATOR" - DISABLED = "DISABLED" - - -@dataclass(kw_only=True) -class CollaboratorConfiguration: - """Settings of an inline collaborator agent.""" - - collaborator_name: str = field(repr=False) - """ - Name of the inline collaborator agent which must be the same name as - specified for `agentName`. - """ - - collaborator_instruction: str = field(repr=False) - """ - Instructions that tell the inline collaborator agent what it should do - and how it should interact with users. - """ - - agent_alias_arn: str | None = None - """The Amazon Resource Name (ARN) of the inline collaborator agent.""" - - relay_conversation_history: str | None = None - """A relay conversation history for the inline collaborator agent.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_COLLABORATOR_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_COLLABORATOR_CONFIGURATION.members["collaboratorName"], - self.collaborator_name, - ) - serializer.write_string( - _SCHEMA_COLLABORATOR_CONFIGURATION.members["collaboratorInstruction"], - self.collaborator_instruction, - ) - if self.agent_alias_arn is not None: - serializer.write_string( - _SCHEMA_COLLABORATOR_CONFIGURATION.members["agentAliasArn"], - self.agent_alias_arn, - ) - - if self.relay_conversation_history is not None: - serializer.write_string( - _SCHEMA_COLLABORATOR_CONFIGURATION.members["relayConversationHistory"], - self.relay_conversation_history, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["collaborator_name"] = de.read_string( - _SCHEMA_COLLABORATOR_CONFIGURATION.members["collaboratorName"] - ) - - case 1: - kwargs["collaborator_instruction"] = de.read_string( - _SCHEMA_COLLABORATOR_CONFIGURATION.members[ - "collaboratorInstruction" - ] - ) - - case 2: - kwargs["agent_alias_arn"] = de.read_string( - _SCHEMA_COLLABORATOR_CONFIGURATION.members["agentAliasArn"] - ) - - case 3: - kwargs["relay_conversation_history"] = RelayConversationHistory( - de.read_string( - _SCHEMA_COLLABORATOR_CONFIGURATION.members[ - "relayConversationHistory" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_COLLABORATOR_CONFIGURATION, consumer=_consumer) - if "collaborator_name" not in kwargs: - kwargs["collaborator_name"] = "" - if "collaborator_instruction" not in kwargs: - kwargs["collaborator_instruction"] = "" - return kwargs - - -def _serialize_collaborator_configurations( - serializer: ShapeSerializer, schema: Schema, value: list[CollaboratorConfiguration] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_collaborator_configurations( - deserializer: ShapeDeserializer, schema: Schema -) -> list[CollaboratorConfiguration]: - result: list[CollaboratorConfiguration] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(CollaboratorConfiguration.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GuardrailConfigurationWithArn: - """The configuration details for the guardrail.""" - - guardrail_identifier: str - """The unique identifier for the guardrail.""" - - guardrail_version: str - """The version of the guardrail.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_CONFIGURATION_WITH_ARN, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GUARDRAIL_CONFIGURATION_WITH_ARN.members["guardrailIdentifier"], - self.guardrail_identifier, - ) - serializer.write_string( - _SCHEMA_GUARDRAIL_CONFIGURATION_WITH_ARN.members["guardrailVersion"], - self.guardrail_version, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["guardrail_identifier"] = de.read_string( - _SCHEMA_GUARDRAIL_CONFIGURATION_WITH_ARN.members[ - "guardrailIdentifier" - ] - ) - - case 1: - kwargs["guardrail_version"] = de.read_string( - _SCHEMA_GUARDRAIL_CONFIGURATION_WITH_ARN.members[ - "guardrailVersion" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_CONFIGURATION_WITH_ARN, consumer=_consumer - ) - if "guardrail_identifier" not in kwargs: - kwargs["guardrail_identifier"] = "" - if "guardrail_version" not in kwargs: - kwargs["guardrail_version"] = "" - return kwargs - - -class PromptState(UnknownEnumMixin, StrEnum): - ENABLED = "ENABLED" - DISABLED = "DISABLED" - - -@dataclass(kw_only=True) -class PromptConfiguration: - """ - Contains configurations to override a prompt template in one part of an - agent sequence. For more information, see [Advanced - prompts](https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts.html). - """ - - prompt_type: str | None = None - """ - The step in the agent sequence that this prompt configuration applies - to. - """ - - prompt_creation_mode: str | None = None - """ - Specifies whether to override the default prompt template for this - `promptType`. Set this value to `OVERRIDDEN` to use the prompt that you - provide in the `basePromptTemplate`. If you leave it as `DEFAULT`, the - agent uses a default prompt template. - """ - - prompt_state: str | None = None - """ - Specifies whether to allow the inline agent to carry out the step - specified in the `promptType`. If you set this value to `DISABLED`, the - agent skips that step. The default state for each `promptType` is as - follows. - - - `PRE_PROCESSING` -- `ENABLED` - - - `ORCHESTRATION` -- `ENABLED` - - - `KNOWLEDGE_BASE_RESPONSE_GENERATION` -- `ENABLED` - - - `POST_PROCESSING` -- `DISABLED` - """ - - base_prompt_template: str | None = field(repr=False, default=None) - """ - Defines the prompt template with which to replace the default prompt - template. You can use placeholder variables in the base prompt template - to customize the prompt. For more information, see [Prompt template - placeholder - variables](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-placeholders.html). - For more information, see [Configure the prompt - templates](https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts-configure.html). - """ - - inference_configuration: InferenceConfiguration | None = None - """ - Contains inference parameters to use when the agent invokes a foundation - model in the part of the agent sequence defined by the `promptType`. For - more information, see [Inference parameters for foundation - models](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). - """ - - parser_mode: str | None = None - """ - Specifies whether to override the default parser Lambda function when - parsing the raw foundation model output in the part of the agent - sequence defined by the `promptType`. If you set the field as - `OVERRIDDEN`, the `overrideLambda` field in the - [PromptOverrideConfiguration](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptOverrideConfiguration.html) - must be specified with the ARN of a Lambda function. - """ - - foundation_model: str | None = None - """The foundation model to use.""" - - additional_model_request_fields: Document | None = None - """ - If the Converse or ConverseStream operations support the model, - `additionalModelRequestFields` contains additional inference parameters, - beyond the base set of inference parameters in the - `inferenceConfiguration` field. - - For more information, see *Inference request parameters and response - fields for foundation models* in the Amazon Bedrock user guide. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PROMPT_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.prompt_type is not None: - serializer.write_string( - _SCHEMA_PROMPT_CONFIGURATION.members["promptType"], self.prompt_type - ) - - if self.prompt_creation_mode is not None: - serializer.write_string( - _SCHEMA_PROMPT_CONFIGURATION.members["promptCreationMode"], - self.prompt_creation_mode, - ) - - if self.prompt_state is not None: - serializer.write_string( - _SCHEMA_PROMPT_CONFIGURATION.members["promptState"], self.prompt_state - ) - - if self.base_prompt_template is not None: - serializer.write_string( - _SCHEMA_PROMPT_CONFIGURATION.members["basePromptTemplate"], - self.base_prompt_template, - ) - - if self.inference_configuration is not None: - serializer.write_struct( - _SCHEMA_PROMPT_CONFIGURATION.members["inferenceConfiguration"], - self.inference_configuration, - ) - - if self.parser_mode is not None: - serializer.write_string( - _SCHEMA_PROMPT_CONFIGURATION.members["parserMode"], self.parser_mode - ) - - if self.foundation_model is not None: - serializer.write_string( - _SCHEMA_PROMPT_CONFIGURATION.members["foundationModel"], - self.foundation_model, - ) - - if self.additional_model_request_fields is not None: - serializer.write_document( - _SCHEMA_PROMPT_CONFIGURATION.members["additionalModelRequestFields"], - self.additional_model_request_fields, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["prompt_type"] = PromptType( - de.read_string( - _SCHEMA_PROMPT_CONFIGURATION.members["promptType"] - ) - ) - - case 1: - kwargs["prompt_creation_mode"] = CreationMode( - de.read_string( - _SCHEMA_PROMPT_CONFIGURATION.members["promptCreationMode"] - ) - ) - - case 2: - kwargs["prompt_state"] = PromptState( - de.read_string( - _SCHEMA_PROMPT_CONFIGURATION.members["promptState"] - ) - ) - - case 3: - kwargs["base_prompt_template"] = de.read_string( - _SCHEMA_PROMPT_CONFIGURATION.members["basePromptTemplate"] - ) - - case 4: - kwargs["inference_configuration"] = ( - InferenceConfiguration.deserialize(de) - ) - - case 5: - kwargs["parser_mode"] = CreationMode( - de.read_string( - _SCHEMA_PROMPT_CONFIGURATION.members["parserMode"] - ) - ) - - case 6: - kwargs["foundation_model"] = de.read_string( - _SCHEMA_PROMPT_CONFIGURATION.members["foundationModel"] - ) - - case 7: - kwargs["additional_model_request_fields"] = de.read_document( - _SCHEMA_PROMPT_CONFIGURATION.members[ - "additionalModelRequestFields" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PROMPT_CONFIGURATION, consumer=_consumer) - return kwargs - - -def _serialize_prompt_configurations( - serializer: ShapeSerializer, schema: Schema, value: list[PromptConfiguration] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_prompt_configurations( - deserializer: ShapeDeserializer, schema: Schema -) -> list[PromptConfiguration]: - result: list[PromptConfiguration] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(PromptConfiguration.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class PromptOverrideConfiguration: - """ - Contains configurations to override prompts in different parts of an - agent sequence. For more information, see [Advanced - prompts](https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts.html). - """ - - prompt_configurations: list[PromptConfiguration] - """ - Contains configurations to override a prompt template in one part of an - agent sequence. For more information, see [Advanced - prompts](https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts.html). - """ - - override_lambda: str | None = None - """ - The ARN of the Lambda function to use when parsing the raw foundation - model output in parts of the agent sequence. If you specify this field, - at least one of the `promptConfigurations` must contain a `parserMode` - value that is set to `OVERRIDDEN`. For more information, see [Parser - Lambda function in Amazon Bedrock - Agents](https://docs.aws.amazon.com/bedrock/latest/userguide/lambda-parser.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PROMPT_OVERRIDE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_prompt_configurations( - serializer, - _SCHEMA_PROMPT_OVERRIDE_CONFIGURATION.members["promptConfigurations"], - self.prompt_configurations, - ) - if self.override_lambda is not None: - serializer.write_string( - _SCHEMA_PROMPT_OVERRIDE_CONFIGURATION.members["overrideLambda"], - self.override_lambda, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["prompt_configurations"] = ( - _deserialize_prompt_configurations( - de, - _SCHEMA_PROMPT_OVERRIDE_CONFIGURATION.members[ - "promptConfigurations" - ], - ) - ) - - case 1: - kwargs["override_lambda"] = de.read_string( - _SCHEMA_PROMPT_OVERRIDE_CONFIGURATION.members["overrideLambda"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PROMPT_OVERRIDE_CONFIGURATION, consumer=_consumer - ) - if "prompt_configurations" not in kwargs: - kwargs["prompt_configurations"] = [] - return kwargs - - -@dataclass -class OrchestrationExecutorLambda: - """ - The Amazon Resource Name (ARN) of the Lambda function containing the - business logic that is carried out upon invoking the action. - """ - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ORCHESTRATION_EXECUTOR, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_ORCHESTRATION_EXECUTOR.members["lambda"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string( - _SCHEMA_ORCHESTRATION_EXECUTOR.members["lambda"] - ) - ) - - -@dataclass -class OrchestrationExecutorUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -OrchestrationExecutor = Union[ - OrchestrationExecutorLambda | OrchestrationExecutorUnknown -] -""" -The structure of the executor invoking the actions in custom -orchestration. -""" - - -class _OrchestrationExecutorDeserializer: - _result: OrchestrationExecutor | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> OrchestrationExecutor: - self._result = None - deserializer.read_struct(_SCHEMA_ORCHESTRATION_EXECUTOR, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(OrchestrationExecutorLambda.deserialize(de)) - - case _: - self._set_result( - OrchestrationExecutorUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: OrchestrationExecutor) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class CustomOrchestration: - """Contains details of the custom orchestration configured for the agent.""" - - executor: OrchestrationExecutor | None = None - """ - The structure of the executor invoking the actions in custom - orchestration. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOM_ORCHESTRATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.executor is not None: - serializer.write_struct( - _SCHEMA_CUSTOM_ORCHESTRATION.members["executor"], self.executor - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["executor"] = ( - _OrchestrationExecutorDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CUSTOM_ORCHESTRATION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class InlineSessionState: - """ - Contains parameters that specify various attributes that persist across - a session or prompt. You can define session state attributes as - key-value pairs when writing a [Lambda - function](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-lambda.html) - for an action group or pass them when making an `InvokeInlineAgent` - request. Use session state attributes to control and provide - conversational context for your inline agent and to help customize your - agent's behavior. For more information, see [Control session - context](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-session-state.html) - """ - - session_attributes: dict[str, str] | None = None - """ - Contains attributes that persist across a session and the values of - those attributes. - """ - - prompt_session_attributes: dict[str, str] | None = None - """ - Contains attributes that persist across a session and the values of - those attributes. - """ - - return_control_invocation_results: list[InvocationResultMember] | None = None - """ - Contains information about the results from the action group invocation. - For more information, see [Return control to the agent - developer](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-returncontrol.html). - - Note: - If you include this field in the `sessionState` field, the `inputText` - field will be ignored. - """ - - invocation_id: str | None = None - """ - The identifier of the invocation of an action. This value must match the - `invocationId` returned in the `InvokeInlineAgent` response for the - action whose results are provided in the - `returnControlInvocationResults` field. For more information, see - [Return control to the agent - developer](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-returncontrol.html). - """ - - files: list[InputFile] | None = None - """Contains information about the files used by code interpreter.""" - - conversation_history: ConversationHistory | None = None - """Contains the conversation history that persist across sessions.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INLINE_SESSION_STATE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.session_attributes is not None: - _serialize_session_attributes_map( - serializer, - _SCHEMA_INLINE_SESSION_STATE.members["sessionAttributes"], - self.session_attributes, - ) - - if self.prompt_session_attributes is not None: - _serialize_prompt_session_attributes_map( - serializer, - _SCHEMA_INLINE_SESSION_STATE.members["promptSessionAttributes"], - self.prompt_session_attributes, - ) - - if self.return_control_invocation_results is not None: - _serialize_return_control_invocation_results( - serializer, - _SCHEMA_INLINE_SESSION_STATE.members["returnControlInvocationResults"], - self.return_control_invocation_results, - ) - - if self.invocation_id is not None: - serializer.write_string( - _SCHEMA_INLINE_SESSION_STATE.members["invocationId"], self.invocation_id - ) - - if self.files is not None: - _serialize_input_files( - serializer, _SCHEMA_INLINE_SESSION_STATE.members["files"], self.files - ) - - if self.conversation_history is not None: - serializer.write_struct( - _SCHEMA_INLINE_SESSION_STATE.members["conversationHistory"], - self.conversation_history, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["session_attributes"] = _deserialize_session_attributes_map( - de, _SCHEMA_INLINE_SESSION_STATE.members["sessionAttributes"] - ) - - case 1: - kwargs["prompt_session_attributes"] = ( - _deserialize_prompt_session_attributes_map( - de, - _SCHEMA_INLINE_SESSION_STATE.members[ - "promptSessionAttributes" - ], - ) - ) - - case 2: - kwargs["return_control_invocation_results"] = ( - _deserialize_return_control_invocation_results( - de, - _SCHEMA_INLINE_SESSION_STATE.members[ - "returnControlInvocationResults" - ], - ) - ) - - case 3: - kwargs["invocation_id"] = de.read_string( - _SCHEMA_INLINE_SESSION_STATE.members["invocationId"] - ) - - case 4: - kwargs["files"] = _deserialize_input_files( - de, _SCHEMA_INLINE_SESSION_STATE.members["files"] - ) - - case 5: - kwargs["conversation_history"] = ConversationHistory.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INLINE_SESSION_STATE, consumer=_consumer) - return kwargs - - -class OrchestrationType(UnknownEnumMixin, StrEnum): - DEFAULT = "DEFAULT" - CUSTOM_ORCHESTRATION = "CUSTOM_ORCHESTRATION" - - -@dataclass(kw_only=True) -class InlineAgentPayloadPart: - """Contains a part of an agent response and citations for it.""" - - bytes_: bytes | None = field(repr=False, default=None) - """A part of the agent response in bytes.""" - - attribution: Attribution | None = None - """Contains citations for a part of an agent response.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INLINE_AGENT_PAYLOAD_PART, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.bytes_ is not None: - serializer.write_blob( - _SCHEMA_INLINE_AGENT_PAYLOAD_PART.members["bytes"], self.bytes_ - ) - - if self.attribution is not None: - serializer.write_struct( - _SCHEMA_INLINE_AGENT_PAYLOAD_PART.members["attribution"], - self.attribution, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bytes_"] = de.read_blob( - _SCHEMA_INLINE_AGENT_PAYLOAD_PART.members["bytes"] - ) - - case 1: - kwargs["attribution"] = Attribution.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INLINE_AGENT_PAYLOAD_PART, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class InlineAgentFilePart: - """ - Contains intermediate response for code interpreter if any files have - been generated. - """ - - files: list[OutputFile] | None = None - """Files containing intermediate response for the user.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INLINE_AGENT_FILE_PART, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.files is not None: - _serialize_output_files( - serializer, _SCHEMA_INLINE_AGENT_FILE_PART.members["files"], self.files - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["files"] = _deserialize_output_files( - de, _SCHEMA_INLINE_AGENT_FILE_PART.members["files"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INLINE_AGENT_FILE_PART, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class InlineAgentReturnControlPayload: - """ - Contains information to return from the action group that the agent has - predicted to invoke. - - This data type is used in the [InvokeAgent - response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax) - API operation. - """ - - invocation_inputs: list[InvocationInputMember] | None = None - """ - A list of objects that contain information about the parameters and - inputs that need to be sent into the API operation or function, based on - what the agent determines from its session with the user. - """ - - invocation_id: str | None = None - """The identifier of the action group invocation.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INLINE_AGENT_RETURN_CONTROL_PAYLOAD, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.invocation_inputs is not None: - _serialize_invocation_inputs( - serializer, - _SCHEMA_INLINE_AGENT_RETURN_CONTROL_PAYLOAD.members["invocationInputs"], - self.invocation_inputs, - ) - - if self.invocation_id is not None: - serializer.write_string( - _SCHEMA_INLINE_AGENT_RETURN_CONTROL_PAYLOAD.members["invocationId"], - self.invocation_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["invocation_inputs"] = _deserialize_invocation_inputs( - de, - _SCHEMA_INLINE_AGENT_RETURN_CONTROL_PAYLOAD.members[ - "invocationInputs" - ], - ) - - case 1: - kwargs["invocation_id"] = de.read_string( - _SCHEMA_INLINE_AGENT_RETURN_CONTROL_PAYLOAD.members[ - "invocationId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INLINE_AGENT_RETURN_CONTROL_PAYLOAD, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InlineAgentTracePart: - """ - Contains information about the agent and session, alongside the agent's - reasoning process and results from calling API actions and querying - knowledge bases and metadata about the trace. You can use the trace to - understand how the agent arrived at the response it provided the - customer. For more information, see [Trace - enablement](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-test.html#trace-enablement). - """ - - session_id: str | None = None - """The unique identifier of the session with the agent.""" - - trace: Trace | None = field(repr=False, default=None) - """ - Contains one part of the agent's reasoning process and results from - calling API actions and querying knowledge bases. You can use the trace - to understand how the agent arrived at the response it provided the - customer. For more information, see [Trace - enablement](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-test.html#trace-enablement). - """ - - caller_chain: list[Caller] | None = None - """The caller chain for the trace part.""" - - event_time: datetime | None = None - """The time that trace occurred.""" - - collaborator_name: str | None = field(repr=False, default=None) - """The collaborator name for the trace part.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INLINE_AGENT_TRACE_PART, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.session_id is not None: - serializer.write_string( - _SCHEMA_INLINE_AGENT_TRACE_PART.members["sessionId"], self.session_id - ) - - if self.trace is not None: - serializer.write_struct( - _SCHEMA_INLINE_AGENT_TRACE_PART.members["trace"], self.trace - ) - - if self.caller_chain is not None: - _serialize_caller_chain( - serializer, - _SCHEMA_INLINE_AGENT_TRACE_PART.members["callerChain"], - self.caller_chain, - ) - - if self.event_time is not None: - serializer.write_timestamp( - _SCHEMA_INLINE_AGENT_TRACE_PART.members["eventTime"], self.event_time - ) - - if self.collaborator_name is not None: - serializer.write_string( - _SCHEMA_INLINE_AGENT_TRACE_PART.members["collaboratorName"], - self.collaborator_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["session_id"] = de.read_string( - _SCHEMA_INLINE_AGENT_TRACE_PART.members["sessionId"] - ) - - case 1: - kwargs["trace"] = _TraceDeserializer().deserialize(de) - - case 2: - kwargs["caller_chain"] = _deserialize_caller_chain( - de, _SCHEMA_INLINE_AGENT_TRACE_PART.members["callerChain"] - ) - - case 3: - kwargs["event_time"] = de.read_timestamp( - _SCHEMA_INLINE_AGENT_TRACE_PART.members["eventTime"] - ) - - case 4: - kwargs["collaborator_name"] = de.read_string( - _SCHEMA_INLINE_AGENT_TRACE_PART.members["collaboratorName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INLINE_AGENT_TRACE_PART, consumer=_consumer) - return kwargs - - -@dataclass -class InlineAgentResponseStreamChunk: - """Contains a part of an agent response and citations for it.""" - - value: InlineAgentPayloadPart - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INLINE_AGENT_RESPONSE_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INLINE_AGENT_RESPONSE_STREAM.members["chunk"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=InlineAgentPayloadPart.deserialize(deserializer)) - - -@dataclass -class InlineAgentResponseStreamTrace: - """ - Contains information about the agent and session, alongside the agent's - reasoning process and results from calling actions and querying - knowledge bases and metadata about the trace. You can use the trace to - understand how the agent arrived at the response it provided the - customer. For more information, see [Trace - events](https://docs.aws.amazon.com/bedrock/latest/userguide/trace-events.html). - """ - - value: InlineAgentTracePart - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INLINE_AGENT_RESPONSE_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INLINE_AGENT_RESPONSE_STREAM.members["trace"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=InlineAgentTracePart.deserialize(deserializer)) - - -@dataclass -class InlineAgentResponseStreamReturnControl: - """ - Contains the parameters and information that the agent elicited from the - customer to carry out an action. This information is returned to the - system and can be used in your own setup for fulfilling the action. - """ - - value: InlineAgentReturnControlPayload - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INLINE_AGENT_RESPONSE_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INLINE_AGENT_RESPONSE_STREAM.members["returnControl"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=InlineAgentReturnControlPayload.deserialize(deserializer)) - - -@dataclass -class InlineAgentResponseStreamInternalServerException: - """An internal server error occurred. Retry your request.""" - - value: InternalServerException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INLINE_AGENT_RESPONSE_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INLINE_AGENT_RESPONSE_STREAM.members["internalServerException"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=InternalServerException.deserialize(deserializer)) - - -@dataclass -class InlineAgentResponseStreamValidationException: - """ - Input validation failed. Check your request parameters and retry the - request. - """ - - value: ValidationException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INLINE_AGENT_RESPONSE_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INLINE_AGENT_RESPONSE_STREAM.members["validationException"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ValidationException.deserialize(deserializer)) - - -@dataclass -class InlineAgentResponseStreamResourceNotFoundException: - """ - The specified resource Amazon Resource Name (ARN) was not found. Check - the Amazon Resource Name (ARN) and try your request again. - """ - - value: ResourceNotFoundException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INLINE_AGENT_RESPONSE_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INLINE_AGENT_RESPONSE_STREAM.members["resourceNotFoundException"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ResourceNotFoundException.deserialize(deserializer)) - - -@dataclass -class InlineAgentResponseStreamServiceQuotaExceededException: - """ - The number of requests exceeds the service quota. Resubmit your request - later. - """ - - value: ServiceQuotaExceededException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INLINE_AGENT_RESPONSE_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INLINE_AGENT_RESPONSE_STREAM.members[ - "serviceQuotaExceededException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ServiceQuotaExceededException.deserialize(deserializer)) - - -@dataclass -class InlineAgentResponseStreamThrottlingException: - """The number of requests exceeds the limit. Resubmit your request later.""" - - value: ThrottlingException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INLINE_AGENT_RESPONSE_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INLINE_AGENT_RESPONSE_STREAM.members["throttlingException"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ThrottlingException.deserialize(deserializer)) - - -@dataclass -class InlineAgentResponseStreamAccessDeniedException: - """ - The request is denied because of missing access permissions. Check your - permissions and retry your request. - """ - - value: AccessDeniedException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INLINE_AGENT_RESPONSE_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INLINE_AGENT_RESPONSE_STREAM.members["accessDeniedException"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=AccessDeniedException.deserialize(deserializer)) - - -@dataclass -class InlineAgentResponseStreamConflictException: - """ - There was a conflict performing an operation. Resolve the conflict and - retry your request. - """ - - value: ConflictException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INLINE_AGENT_RESPONSE_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INLINE_AGENT_RESPONSE_STREAM.members["conflictException"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ConflictException.deserialize(deserializer)) - - -@dataclass -class InlineAgentResponseStreamDependencyFailedException: - """ - There was an issue with a dependency. Check the resource configurations - and retry the request. - """ - - value: DependencyFailedException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INLINE_AGENT_RESPONSE_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INLINE_AGENT_RESPONSE_STREAM.members["dependencyFailedException"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=DependencyFailedException.deserialize(deserializer)) - - -@dataclass -class InlineAgentResponseStreamBadGatewayException: - """ - There was an issue with a dependency due to a server issue. Retry your - request. - """ - - value: BadGatewayException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INLINE_AGENT_RESPONSE_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INLINE_AGENT_RESPONSE_STREAM.members["badGatewayException"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=BadGatewayException.deserialize(deserializer)) - - -@dataclass -class InlineAgentResponseStreamFiles: - """ - Contains intermediate response for code interpreter if any files have - been generated. - """ - - value: InlineAgentFilePart - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INLINE_AGENT_RESPONSE_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INLINE_AGENT_RESPONSE_STREAM.members["files"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=InlineAgentFilePart.deserialize(deserializer)) - - -@dataclass -class InlineAgentResponseStreamUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -InlineAgentResponseStream = Union[ - InlineAgentResponseStreamChunk - | InlineAgentResponseStreamTrace - | InlineAgentResponseStreamReturnControl - | InlineAgentResponseStreamInternalServerException - | InlineAgentResponseStreamValidationException - | InlineAgentResponseStreamResourceNotFoundException - | InlineAgentResponseStreamServiceQuotaExceededException - | InlineAgentResponseStreamThrottlingException - | InlineAgentResponseStreamAccessDeniedException - | InlineAgentResponseStreamConflictException - | InlineAgentResponseStreamDependencyFailedException - | InlineAgentResponseStreamBadGatewayException - | InlineAgentResponseStreamFiles - | InlineAgentResponseStreamUnknown -] -""" -The response from invoking the agent and associated citations and trace -information. -""" - - -class _InlineAgentResponseStreamDeserializer: - _result: InlineAgentResponseStream | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> InlineAgentResponseStream: - self._result = None - deserializer.read_struct(_SCHEMA_INLINE_AGENT_RESPONSE_STREAM, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(InlineAgentResponseStreamChunk.deserialize(de)) - - case 1: - self._set_result(InlineAgentResponseStreamTrace.deserialize(de)) - - case 2: - self._set_result(InlineAgentResponseStreamReturnControl.deserialize(de)) - - case 3: - self._set_result( - InlineAgentResponseStreamInternalServerException.deserialize(de) - ) - - case 4: - self._set_result( - InlineAgentResponseStreamValidationException.deserialize(de) - ) - - case 5: - self._set_result( - InlineAgentResponseStreamResourceNotFoundException.deserialize(de) - ) - - case 6: - self._set_result( - InlineAgentResponseStreamServiceQuotaExceededException.deserialize( - de - ) - ) - - case 7: - self._set_result( - InlineAgentResponseStreamThrottlingException.deserialize(de) - ) - - case 8: - self._set_result( - InlineAgentResponseStreamAccessDeniedException.deserialize(de) - ) - - case 9: - self._set_result( - InlineAgentResponseStreamConflictException.deserialize(de) - ) - - case 10: - self._set_result( - InlineAgentResponseStreamDependencyFailedException.deserialize(de) - ) - - case 11: - self._set_result( - InlineAgentResponseStreamBadGatewayException.deserialize(de) - ) - - case 12: - self._set_result(InlineAgentResponseStreamFiles.deserialize(de)) - - case _: - self._set_result( - InlineAgentResponseStreamUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: InlineAgentResponseStream) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class InvokeInlineAgentOutput: - """Dataclass for InvokeInlineAgentOutput structure.""" - - content_type: str - """ - The MIME type of the input data in the request. The default value is - application/json. - """ - - session_id: str - """The unique identifier of the session with the agent.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOKE_INLINE_AGENT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_INVOKE_INLINE_AGENT_OUTPUT.members["contentType"], self.content_type - ) - serializer.write_string( - _SCHEMA_INVOKE_INLINE_AGENT_OUTPUT.members["sessionId"], self.session_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 1: - kwargs["content_type"] = de.read_string( - _SCHEMA_INVOKE_INLINE_AGENT_OUTPUT.members["contentType"] - ) - - case 2: - kwargs["session_id"] = de.read_string( - _SCHEMA_INVOKE_INLINE_AGENT_OUTPUT.members["sessionId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INVOKE_INLINE_AGENT_OUTPUT, consumer=_consumer) - if "content_type" not in kwargs: - kwargs["content_type"] = "" - if "session_id" not in kwargs: - kwargs["session_id"] = "" - return kwargs - - -@dataclass(kw_only=True) -class DeleteAgentMemoryInput: - """Dataclass for DeleteAgentMemoryInput structure.""" - - agent_id: str | None = None - """The unique identifier of the agent to which the alias belongs.""" - - agent_alias_id: str | None = None - """The unique identifier of an alias of an agent.""" - - memory_id: str | None = None - """The unique identifier of the memory.""" - - session_id: str | None = None - """The unique session identifier of the memory.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_AGENT_MEMORY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.agent_id is not None: - serializer.write_string( - _SCHEMA_DELETE_AGENT_MEMORY_INPUT.members["agentId"], self.agent_id - ) - - if self.agent_alias_id is not None: - serializer.write_string( - _SCHEMA_DELETE_AGENT_MEMORY_INPUT.members["agentAliasId"], - self.agent_alias_id, - ) - - if self.memory_id is not None: - serializer.write_string( - _SCHEMA_DELETE_AGENT_MEMORY_INPUT.members["memoryId"], self.memory_id - ) - - if self.session_id is not None: - serializer.write_string( - _SCHEMA_DELETE_AGENT_MEMORY_INPUT.members["sessionId"], self.session_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_id"] = de.read_string( - _SCHEMA_DELETE_AGENT_MEMORY_INPUT.members["agentId"] - ) - - case 1: - kwargs["agent_alias_id"] = de.read_string( - _SCHEMA_DELETE_AGENT_MEMORY_INPUT.members["agentAliasId"] - ) - - case 2: - kwargs["memory_id"] = de.read_string( - _SCHEMA_DELETE_AGENT_MEMORY_INPUT.members["memoryId"] - ) - - case 3: - kwargs["session_id"] = de.read_string( - _SCHEMA_DELETE_AGENT_MEMORY_INPUT.members["sessionId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_AGENT_MEMORY_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteAgentMemoryOutput: - """Dataclass for DeleteAgentMemoryOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_AGENT_MEMORY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_AGENT_MEMORY_OUTPUT, consumer=_consumer) - return kwargs - - -DELETE_AGENT_MEMORY = APIOperation( - input=DeleteAgentMemoryInput, - output=DeleteAgentMemoryOutput, - schema=_SCHEMA_DELETE_AGENT_MEMORY, - input_schema=_SCHEMA_DELETE_AGENT_MEMORY_INPUT, - output_schema=_SCHEMA_DELETE_AGENT_MEMORY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentruntime#BadGatewayException" - ): BadGatewayException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentruntime#DependencyFailedException" - ): DependencyFailedException, - ShapeID( - "com.amazonaws.bedrockagentruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_BAD_GATEWAY_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_DEPENDENCY_FAILED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class MemoryType(UnknownEnumMixin, StrEnum): - SESSION_SUMMARY = "SESSION_SUMMARY" - - -@dataclass(kw_only=True) -class GetAgentMemoryInput: - """Dataclass for GetAgentMemoryInput structure.""" - - next_token: str | None = None - """ - If the total number of results is greater than the maxItems value - provided in the request, enter the token returned in the `nextToken` - field in the response in this field to return the next batch of results. - """ - - max_items: int | None = None - """ - The maximum number of items to return in the response. If the total - number of results is greater than this value, use the token returned in - the response in the `nextToken` field when making another request to - return the next batch of results. - """ - - agent_id: str | None = None - """The unique identifier of the agent to which the alias belongs.""" - - agent_alias_id: str | None = None - """The unique identifier of an alias of an agent.""" - - memory_type: str | None = None - """The type of memory.""" - - memory_id: str | None = None - """The unique identifier of the memory.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_AGENT_MEMORY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_GET_AGENT_MEMORY_INPUT.members["nextToken"], self.next_token - ) - - if self.max_items is not None: - serializer.write_integer( - _SCHEMA_GET_AGENT_MEMORY_INPUT.members["maxItems"], self.max_items - ) - - if self.agent_id is not None: - serializer.write_string( - _SCHEMA_GET_AGENT_MEMORY_INPUT.members["agentId"], self.agent_id - ) - - if self.agent_alias_id is not None: - serializer.write_string( - _SCHEMA_GET_AGENT_MEMORY_INPUT.members["agentAliasId"], - self.agent_alias_id, - ) - - if self.memory_type is not None: - serializer.write_string( - _SCHEMA_GET_AGENT_MEMORY_INPUT.members["memoryType"], self.memory_type - ) - - if self.memory_id is not None: - serializer.write_string( - _SCHEMA_GET_AGENT_MEMORY_INPUT.members["memoryId"], self.memory_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_GET_AGENT_MEMORY_INPUT.members["nextToken"] - ) - - case 1: - kwargs["max_items"] = de.read_integer( - _SCHEMA_GET_AGENT_MEMORY_INPUT.members["maxItems"] - ) - - case 2: - kwargs["agent_id"] = de.read_string( - _SCHEMA_GET_AGENT_MEMORY_INPUT.members["agentId"] - ) - - case 3: - kwargs["agent_alias_id"] = de.read_string( - _SCHEMA_GET_AGENT_MEMORY_INPUT.members["agentAliasId"] - ) - - case 4: - kwargs["memory_type"] = MemoryType( - de.read_string( - _SCHEMA_GET_AGENT_MEMORY_INPUT.members["memoryType"] - ) - ) - - case 5: - kwargs["memory_id"] = de.read_string( - _SCHEMA_GET_AGENT_MEMORY_INPUT.members["memoryId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_AGENT_MEMORY_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class MemorySessionSummary: - """Contains details of a session summary.""" - - memory_id: str | None = None - """The unique identifier of the memory where the session summary is stored.""" - - session_id: str | None = None - """The identifier for this session.""" - - session_start_time: datetime | None = None - """The start time for this session.""" - - session_expiry_time: datetime | None = None - """The time when the memory duration for the session is set to end.""" - - summary_text: str | None = None - """The summarized text for this session.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEMORY_SESSION_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.memory_id is not None: - serializer.write_string( - _SCHEMA_MEMORY_SESSION_SUMMARY.members["memoryId"], self.memory_id - ) - - if self.session_id is not None: - serializer.write_string( - _SCHEMA_MEMORY_SESSION_SUMMARY.members["sessionId"], self.session_id - ) - - if self.session_start_time is not None: - serializer.write_timestamp( - _SCHEMA_MEMORY_SESSION_SUMMARY.members["sessionStartTime"], - self.session_start_time, - ) - - if self.session_expiry_time is not None: - serializer.write_timestamp( - _SCHEMA_MEMORY_SESSION_SUMMARY.members["sessionExpiryTime"], - self.session_expiry_time, - ) - - if self.summary_text is not None: - serializer.write_string( - _SCHEMA_MEMORY_SESSION_SUMMARY.members["summaryText"], self.summary_text - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["memory_id"] = de.read_string( - _SCHEMA_MEMORY_SESSION_SUMMARY.members["memoryId"] - ) - - case 1: - kwargs["session_id"] = de.read_string( - _SCHEMA_MEMORY_SESSION_SUMMARY.members["sessionId"] - ) - - case 2: - kwargs["session_start_time"] = de.read_timestamp( - _SCHEMA_MEMORY_SESSION_SUMMARY.members["sessionStartTime"] - ) - - case 3: - kwargs["session_expiry_time"] = de.read_timestamp( - _SCHEMA_MEMORY_SESSION_SUMMARY.members["sessionExpiryTime"] - ) - - case 4: - kwargs["summary_text"] = de.read_string( - _SCHEMA_MEMORY_SESSION_SUMMARY.members["summaryText"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MEMORY_SESSION_SUMMARY, consumer=_consumer) - return kwargs - - -@dataclass -class Memory_SessionSummary: - """Contains summary of a session.""" - - value: MemorySessionSummary - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEMORY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEMORY.members["sessionSummary"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=MemorySessionSummary.deserialize(deserializer)) - - -@dataclass -class MemoryUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -Memory = Union[Memory_SessionSummary | MemoryUnknown] -"""Contains sessions summaries.""" - - -class _MemoryDeserializer: - _result: Memory | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> Memory: - self._result = None - deserializer.read_struct(_SCHEMA_MEMORY, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(Memory_SessionSummary.deserialize(de)) - - case _: - self._set_result(MemoryUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: Memory) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_memories( - serializer: ShapeSerializer, schema: Schema, value: list[Memory] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_memories( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Memory]: - result: list[Memory] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_MemoryDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GetAgentMemoryOutput: - """Dataclass for GetAgentMemoryOutput structure.""" - - next_token: str | None = None - """ - If the total number of results is greater than the maxItems value - provided in the request, use this token when making another request in - the `nextToken` field to return the next batch of results. - """ - - memory_contents: list[Memory] | None = None - """Contains details of the sessions stored in the memory""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_AGENT_MEMORY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_GET_AGENT_MEMORY_OUTPUT.members["nextToken"], self.next_token - ) - - if self.memory_contents is not None: - _serialize_memories( - serializer, - _SCHEMA_GET_AGENT_MEMORY_OUTPUT.members["memoryContents"], - self.memory_contents, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_GET_AGENT_MEMORY_OUTPUT.members["nextToken"] - ) - - case 1: - kwargs["memory_contents"] = _deserialize_memories( - de, _SCHEMA_GET_AGENT_MEMORY_OUTPUT.members["memoryContents"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_AGENT_MEMORY_OUTPUT, consumer=_consumer) - return kwargs - - -GET_AGENT_MEMORY = APIOperation( - input=GetAgentMemoryInput, - output=GetAgentMemoryOutput, - schema=_SCHEMA_GET_AGENT_MEMORY, - input_schema=_SCHEMA_GET_AGENT_MEMORY_INPUT, - output_schema=_SCHEMA_GET_AGENT_MEMORY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentruntime#BadGatewayException" - ): BadGatewayException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentruntime#DependencyFailedException" - ): DependencyFailedException, - ShapeID( - "com.amazonaws.bedrockagentruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_BAD_GATEWAY_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_DEPENDENCY_FAILED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class TextPrompt: - """Contains information about the text prompt to optimize.""" - - text: str - """The text in the text prompt to optimize.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TEXT_PROMPT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_TEXT_PROMPT.members["text"], self.text) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["text"] = de.read_string(_SCHEMA_TEXT_PROMPT.members["text"]) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TEXT_PROMPT, consumer=_consumer) - if "text" not in kwargs: - kwargs["text"] = "" - return kwargs - - -@dataclass -class InputPromptTextPrompt: - """Contains information about the text prompt to optimize.""" - - value: TextPrompt - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INPUT_PROMPT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INPUT_PROMPT.members["textPrompt"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=TextPrompt.deserialize(deserializer)) - - -@dataclass -class InputPromptUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -InputPrompt = Union[InputPromptTextPrompt | InputPromptUnknown] -"""Contains information about the prompt to optimize.""" - - -class _InputPromptDeserializer: - _result: InputPrompt | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> InputPrompt: - self._result = None - deserializer.read_struct(_SCHEMA_INPUT_PROMPT, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(InputPromptTextPrompt.deserialize(de)) - - case _: - self._set_result(InputPromptUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: InputPrompt) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class OptimizePromptInput: - """Dataclass for OptimizePromptInput structure.""" - - input: InputPrompt | None = None - """Contains the prompt to optimize.""" - - target_model_id: str | None = None - """ - The unique identifier of the model that you want to optimize the prompt - for. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OPTIMIZE_PROMPT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.input is not None: - serializer.write_struct( - _SCHEMA_OPTIMIZE_PROMPT_INPUT.members["input"], self.input - ) - - if self.target_model_id is not None: - serializer.write_string( - _SCHEMA_OPTIMIZE_PROMPT_INPUT.members["targetModelId"], - self.target_model_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["input"] = _InputPromptDeserializer().deserialize(de) - - case 1: - kwargs["target_model_id"] = de.read_string( - _SCHEMA_OPTIMIZE_PROMPT_INPUT.members["targetModelId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_OPTIMIZE_PROMPT_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class AnalyzePromptEvent: - """ - An event in which the prompt was analyzed in preparation for - optimization. - """ - - message: str | None = None - """A message describing the analysis of the prompt.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ANALYZE_PROMPT_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_ANALYZE_PROMPT_EVENT.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_ANALYZE_PROMPT_EVENT.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ANALYZE_PROMPT_EVENT, consumer=_consumer) - return kwargs - - -@dataclass -class OptimizedPromptTextPrompt: - """Contains information about the text in the prompt that was optimized.""" - - value: TextPrompt - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OPTIMIZED_PROMPT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_OPTIMIZED_PROMPT.members["textPrompt"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=TextPrompt.deserialize(deserializer)) - - -@dataclass -class OptimizedPromptUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -OptimizedPrompt = Union[OptimizedPromptTextPrompt | OptimizedPromptUnknown] -"""Contains information about the optimized prompt.""" - - -class _OptimizedPromptDeserializer: - _result: OptimizedPrompt | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> OptimizedPrompt: - self._result = None - deserializer.read_struct(_SCHEMA_OPTIMIZED_PROMPT, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(OptimizedPromptTextPrompt.deserialize(de)) - - case _: - self._set_result( - OptimizedPromptUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: OptimizedPrompt) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class OptimizedPromptEvent: - """An event in which the prompt was optimized.""" - - optimized_prompt: OptimizedPrompt | None = None - """Contains information about the optimized prompt.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OPTIMIZED_PROMPT_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.optimized_prompt is not None: - serializer.write_struct( - _SCHEMA_OPTIMIZED_PROMPT_EVENT.members["optimizedPrompt"], - self.optimized_prompt, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["optimized_prompt"] = ( - _OptimizedPromptDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_OPTIMIZED_PROMPT_EVENT, consumer=_consumer) - return kwargs - - -@dataclass -class OptimizedPromptStreamOptimizedPromptEvent: - """An event in which the prompt was optimized.""" - - value: OptimizedPromptEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OPTIMIZED_PROMPT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_OPTIMIZED_PROMPT_STREAM.members["optimizedPromptEvent"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=OptimizedPromptEvent.deserialize(deserializer)) - - -@dataclass -class OptimizedPromptStreamAnalyzePromptEvent: - """ - An event in which the prompt was analyzed in preparation for - optimization. - """ - - value: AnalyzePromptEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OPTIMIZED_PROMPT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_OPTIMIZED_PROMPT_STREAM.members["analyzePromptEvent"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=AnalyzePromptEvent.deserialize(deserializer)) - - -@dataclass -class OptimizedPromptStreamInternalServerException: - """An internal server error occurred. Retry your request.""" - - value: InternalServerException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OPTIMIZED_PROMPT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_OPTIMIZED_PROMPT_STREAM.members["internalServerException"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=InternalServerException.deserialize(deserializer)) - - -@dataclass -class OptimizedPromptStreamThrottlingException: - """ - Your request was throttled because of service-wide limitations. Resubmit - your request later or in a different region. You can also purchase - [Provisioned - Throughput](https://docs.aws.amazon.com/bedrock/latest/userguide/prov-throughput.html) - to increase the rate or number of tokens you can process. - """ - - value: ThrottlingException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OPTIMIZED_PROMPT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_OPTIMIZED_PROMPT_STREAM.members["throttlingException"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ThrottlingException.deserialize(deserializer)) - - -@dataclass -class OptimizedPromptStreamValidationException: - """ - Input validation failed. Check your request parameters and retry the - request. - """ - - value: ValidationException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OPTIMIZED_PROMPT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_OPTIMIZED_PROMPT_STREAM.members["validationException"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ValidationException.deserialize(deserializer)) - - -@dataclass -class OptimizedPromptStreamDependencyFailedException: - """ - There was an issue with a dependency. Check the resource configurations - and retry the request. - """ - - value: DependencyFailedException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OPTIMIZED_PROMPT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_OPTIMIZED_PROMPT_STREAM.members["dependencyFailedException"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=DependencyFailedException.deserialize(deserializer)) - - -@dataclass -class OptimizedPromptStreamAccessDeniedException: - """ - The request is denied because of missing access permissions. Check your - permissions and retry your request. - """ - - value: AccessDeniedException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OPTIMIZED_PROMPT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_OPTIMIZED_PROMPT_STREAM.members["accessDeniedException"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=AccessDeniedException.deserialize(deserializer)) - - -@dataclass -class OptimizedPromptStreamBadGatewayException: - """ - There was an issue with a dependency due to a server issue. Retry your - request. - """ - - value: BadGatewayException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OPTIMIZED_PROMPT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_OPTIMIZED_PROMPT_STREAM.members["badGatewayException"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=BadGatewayException.deserialize(deserializer)) - - -@dataclass -class OptimizedPromptStreamUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -OptimizedPromptStream = Union[ - OptimizedPromptStreamOptimizedPromptEvent - | OptimizedPromptStreamAnalyzePromptEvent - | OptimizedPromptStreamInternalServerException - | OptimizedPromptStreamThrottlingException - | OptimizedPromptStreamValidationException - | OptimizedPromptStreamDependencyFailedException - | OptimizedPromptStreamAccessDeniedException - | OptimizedPromptStreamBadGatewayException - | OptimizedPromptStreamUnknown -] -"""The stream containing events in the prompt optimization process.""" - - -class _OptimizedPromptStreamDeserializer: - _result: OptimizedPromptStream | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> OptimizedPromptStream: - self._result = None - deserializer.read_struct(_SCHEMA_OPTIMIZED_PROMPT_STREAM, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - OptimizedPromptStreamOptimizedPromptEvent.deserialize(de) - ) - - case 1: - self._set_result( - OptimizedPromptStreamAnalyzePromptEvent.deserialize(de) - ) - - case 2: - self._set_result( - OptimizedPromptStreamInternalServerException.deserialize(de) - ) - - case 3: - self._set_result( - OptimizedPromptStreamThrottlingException.deserialize(de) - ) - - case 4: - self._set_result( - OptimizedPromptStreamValidationException.deserialize(de) - ) - - case 5: - self._set_result( - OptimizedPromptStreamDependencyFailedException.deserialize(de) - ) - - case 6: - self._set_result( - OptimizedPromptStreamAccessDeniedException.deserialize(de) - ) - - case 7: - self._set_result( - OptimizedPromptStreamBadGatewayException.deserialize(de) - ) - - case _: - self._set_result( - OptimizedPromptStreamUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: OptimizedPromptStream) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class OptimizePromptOutput: - """Dataclass for OptimizePromptOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OPTIMIZE_PROMPT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_OPTIMIZE_PROMPT_OUTPUT, consumer=_consumer) - return kwargs - - -OPTIMIZE_PROMPT = APIOperation( - input=OptimizePromptInput, - output=OptimizePromptOutput, - schema=_SCHEMA_OPTIMIZE_PROMPT, - input_schema=_SCHEMA_OPTIMIZE_PROMPT_INPUT, - output_schema=_SCHEMA_OPTIMIZE_PROMPT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentruntime#BadGatewayException" - ): BadGatewayException, - ShapeID( - "com.amazonaws.bedrockagentruntime#DependencyFailedException" - ): DependencyFailedException, - ShapeID( - "com.amazonaws.bedrockagentruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_BAD_GATEWAY_EXCEPTION, - _SCHEMA_DEPENDENCY_FAILED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class RerankTextDocument: - """Contains information about a text document to rerank.""" - - text: str | None = None - """The text of the document.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RERANK_TEXT_DOCUMENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.text is not None: - serializer.write_string( - _SCHEMA_RERANK_TEXT_DOCUMENT.members["text"], self.text - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["text"] = de.read_string( - _SCHEMA_RERANK_TEXT_DOCUMENT.members["text"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RERANK_TEXT_DOCUMENT, consumer=_consumer) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls() - - -class RerankQueryContentType(UnknownEnumMixin, StrEnum): - TEXT = "TEXT" - - -@dataclass(kw_only=True) -class RerankQuery: - """Contains information about a query to submit to the reranker model.""" - - type: str - """The type of the query.""" - - text_query: RerankTextDocument = field(repr=False) - """Contains information about a text query.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RERANK_QUERY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_RERANK_QUERY.members["type"], self.type) - serializer.write_struct( - _SCHEMA_RERANK_QUERY.members["textQuery"], self.text_query - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = RerankQueryContentType( - de.read_string(_SCHEMA_RERANK_QUERY.members["type"]) - ) - - case 1: - kwargs["text_query"] = RerankTextDocument.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RERANK_QUERY, consumer=_consumer) - if "type" not in kwargs: - kwargs["type"] = RerankQueryContentType._corrected("") - if "text_query" not in kwargs: - kwargs["text_query"] = RerankTextDocument._smithy_default() - return kwargs - - -def _serialize_rerank_queries_list( - serializer: ShapeSerializer, schema: Schema, value: list[RerankQuery] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_rerank_queries_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[RerankQuery]: - result: list[RerankQuery] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(RerankQuery.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class BedrockRerankingModelConfiguration: - """Contains configurations for a reranker model.""" - - model_arn: str - """The ARN of the reranker model.""" - - additional_model_request_fields: dict[str, Document] | None = None - """ - A JSON object whose keys are request fields for the model and whose - values are values for those fields. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BEDROCK_RERANKING_MODEL_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_BEDROCK_RERANKING_MODEL_CONFIGURATION.members["modelArn"], - self.model_arn, - ) - if self.additional_model_request_fields is not None: - _serialize_additional_model_request_fields( - serializer, - _SCHEMA_BEDROCK_RERANKING_MODEL_CONFIGURATION.members[ - "additionalModelRequestFields" - ], - self.additional_model_request_fields, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_arn"] = de.read_string( - _SCHEMA_BEDROCK_RERANKING_MODEL_CONFIGURATION.members[ - "modelArn" - ] - ) - - case 1: - kwargs["additional_model_request_fields"] = ( - _deserialize_additional_model_request_fields( - de, - _SCHEMA_BEDROCK_RERANKING_MODEL_CONFIGURATION.members[ - "additionalModelRequestFields" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_BEDROCK_RERANKING_MODEL_CONFIGURATION, consumer=_consumer - ) - if "model_arn" not in kwargs: - kwargs["model_arn"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(model_arn="") - - -@dataclass(kw_only=True) -class BedrockRerankingConfiguration: - """Contains configurations for an Amazon Bedrock reranker model.""" - - model_configuration: BedrockRerankingModelConfiguration - """Contains configurations for a reranker model.""" - - number_of_results: int | None = None - """The number of results to return after reranking.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BEDROCK_RERANKING_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.number_of_results is not None: - serializer.write_integer( - _SCHEMA_BEDROCK_RERANKING_CONFIGURATION.members["numberOfResults"], - self.number_of_results, - ) - - serializer.write_struct( - _SCHEMA_BEDROCK_RERANKING_CONFIGURATION.members["modelConfiguration"], - self.model_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["number_of_results"] = de.read_integer( - _SCHEMA_BEDROCK_RERANKING_CONFIGURATION.members[ - "numberOfResults" - ] - ) - - case 1: - kwargs["model_configuration"] = ( - BedrockRerankingModelConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_BEDROCK_RERANKING_CONFIGURATION, consumer=_consumer - ) - if "model_configuration" not in kwargs: - kwargs["model_configuration"] = ( - BedrockRerankingModelConfiguration._smithy_default() - ) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls( - model_configuration=BedrockRerankingModelConfiguration._smithy_default() - ) - - -class RerankingConfigurationType(UnknownEnumMixin, StrEnum): - BEDROCK_RERANKING_MODEL = "BEDROCK_RERANKING_MODEL" - - -@dataclass(kw_only=True) -class RerankingConfiguration: - """Contains configurations for reranking.""" - - type: str - """The type of reranker that the configurations apply to.""" - - bedrock_reranking_configuration: BedrockRerankingConfiguration - """Contains configurations for an Amazon Bedrock reranker.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RERANKING_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_RERANKING_CONFIGURATION.members["type"], self.type - ) - serializer.write_struct( - _SCHEMA_RERANKING_CONFIGURATION.members["bedrockRerankingConfiguration"], - self.bedrock_reranking_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = RerankingConfigurationType( - de.read_string(_SCHEMA_RERANKING_CONFIGURATION.members["type"]) - ) - - case 1: - kwargs["bedrock_reranking_configuration"] = ( - BedrockRerankingConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RERANKING_CONFIGURATION, consumer=_consumer) - if "type" not in kwargs: - kwargs["type"] = RerankingConfigurationType._corrected("") - if "bedrock_reranking_configuration" not in kwargs: - kwargs["bedrock_reranking_configuration"] = ( - BedrockRerankingConfiguration._smithy_default() - ) - return kwargs - - -class RerankDocumentType(UnknownEnumMixin, StrEnum): - TEXT = "TEXT" - JSON = "JSON" - - -@dataclass(kw_only=True) -class RerankDocument: - """ - Contains information about a document to rerank. Choose the `type` to - define and include the field that corresponds to the type. - """ - - type: str - """The type of document to rerank.""" - - text_document: RerankTextDocument | None = field(repr=False, default=None) - """Contains information about a text document to rerank.""" - - json_document: Document | None = None - """Contains a JSON document to rerank.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RERANK_DOCUMENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_RERANK_DOCUMENT.members["type"], self.type) - if self.text_document is not None: - serializer.write_struct( - _SCHEMA_RERANK_DOCUMENT.members["textDocument"], self.text_document - ) - - if self.json_document is not None: - serializer.write_document( - _SCHEMA_RERANK_DOCUMENT.members["jsonDocument"], self.json_document - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = RerankDocumentType( - de.read_string(_SCHEMA_RERANK_DOCUMENT.members["type"]) - ) - - case 1: - kwargs["text_document"] = RerankTextDocument.deserialize(de) - - case 2: - kwargs["json_document"] = de.read_document( - _SCHEMA_RERANK_DOCUMENT.members["jsonDocument"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RERANK_DOCUMENT, consumer=_consumer) - if "type" not in kwargs: - kwargs["type"] = RerankDocumentType._corrected("") - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(type=RerankDocumentType._corrected("")) - - -class RerankSourceType(UnknownEnumMixin, StrEnum): - INLINE = "INLINE" - - -@dataclass(kw_only=True) -class RerankSource: - """Contains information about a source for reranking.""" - - type: str - """The type of the source.""" - - inline_document_source: RerankDocument = field(repr=False) - """Contains an inline definition of a source for reranking.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RERANK_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_RERANK_SOURCE.members["type"], self.type) - serializer.write_struct( - _SCHEMA_RERANK_SOURCE.members["inlineDocumentSource"], - self.inline_document_source, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = RerankSourceType( - de.read_string(_SCHEMA_RERANK_SOURCE.members["type"]) - ) - - case 1: - kwargs["inline_document_source"] = RerankDocument.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RERANK_SOURCE, consumer=_consumer) - if "type" not in kwargs: - kwargs["type"] = RerankSourceType._corrected("") - if "inline_document_source" not in kwargs: - kwargs["inline_document_source"] = RerankDocument._smithy_default() - return kwargs - - -def _serialize_rerank_sources_list( - serializer: ShapeSerializer, schema: Schema, value: list[RerankSource] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_rerank_sources_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[RerankSource]: - result: list[RerankSource] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(RerankSource.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class RerankInput: - """Dataclass for RerankInput structure.""" - - queries: list[RerankQuery] | None = field(repr=False, default=None) - """ - An array of objects, each of which contains information about a query to - submit to the reranker model. - """ - - sources: list[RerankSource] | None = field(repr=False, default=None) - """ - An array of objects, each of which contains information about the - sources to rerank. - """ - - reranking_configuration: RerankingConfiguration | None = None - """Contains configurations for reranking.""" - - next_token: str | None = None - """ - If the total number of results was greater than could fit in a response, - a token is returned in the `nextToken` field. You can enter that token - in this field to return the next batch of results. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RERANK_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.queries is not None: - _serialize_rerank_queries_list( - serializer, _SCHEMA_RERANK_INPUT.members["queries"], self.queries - ) - - if self.sources is not None: - _serialize_rerank_sources_list( - serializer, _SCHEMA_RERANK_INPUT.members["sources"], self.sources - ) - - if self.reranking_configuration is not None: - serializer.write_struct( - _SCHEMA_RERANK_INPUT.members["rerankingConfiguration"], - self.reranking_configuration, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_RERANK_INPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["queries"] = _deserialize_rerank_queries_list( - de, _SCHEMA_RERANK_INPUT.members["queries"] - ) - - case 1: - kwargs["sources"] = _deserialize_rerank_sources_list( - de, _SCHEMA_RERANK_INPUT.members["sources"] - ) - - case 2: - kwargs["reranking_configuration"] = ( - RerankingConfiguration.deserialize(de) - ) - - case 3: - kwargs["next_token"] = de.read_string( - _SCHEMA_RERANK_INPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RERANK_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class RerankResult: - """Contains information about a document that was reranked.""" - - index: int - """The original index of the document from the input sources array.""" - - relevance_score: float - """The relevance score of the document.""" - - document: RerankDocument | None = field(repr=False, default=None) - """Contains information about the document.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RERANK_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer(_SCHEMA_RERANK_RESULT.members["index"], self.index) - serializer.write_float( - _SCHEMA_RERANK_RESULT.members["relevanceScore"], self.relevance_score - ) - if self.document is not None: - serializer.write_struct( - _SCHEMA_RERANK_RESULT.members["document"], self.document - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["index"] = de.read_integer( - _SCHEMA_RERANK_RESULT.members["index"] - ) - - case 1: - kwargs["relevance_score"] = de.read_float( - _SCHEMA_RERANK_RESULT.members["relevanceScore"] - ) - - case 2: - kwargs["document"] = RerankDocument.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RERANK_RESULT, consumer=_consumer) - if "index" not in kwargs: - kwargs["index"] = 0 - if "relevance_score" not in kwargs: - kwargs["relevance_score"] = 0.0 - return kwargs - - -def _serialize_rerank_results_list( - serializer: ShapeSerializer, schema: Schema, value: list[RerankResult] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_rerank_results_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[RerankResult]: - result: list[RerankResult] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(RerankResult.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class RerankOutput: - """Dataclass for RerankOutput structure.""" - - results: list[RerankResult] - """ - An array of objects, each of which contains information about the - results of reranking. - """ - - next_token: str | None = None - """ - If the total number of results is greater than can fit in the response, - use this token in the `nextToken` field when making another request to - return the next batch of results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RERANK_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_rerank_results_list( - serializer, _SCHEMA_RERANK_OUTPUT.members["results"], self.results - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_RERANK_OUTPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["results"] = _deserialize_rerank_results_list( - de, _SCHEMA_RERANK_OUTPUT.members["results"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_RERANK_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RERANK_OUTPUT, consumer=_consumer) - if "results" not in kwargs: - kwargs["results"] = [] - return kwargs - - -RERANK = APIOperation( - input=RerankInput, - output=RerankOutput, - schema=_SCHEMA_RERANK, - input_schema=_SCHEMA_RERANK_INPUT, - output_schema=_SCHEMA_RERANK_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentruntime#BadGatewayException" - ): BadGatewayException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentruntime#DependencyFailedException" - ): DependencyFailedException, - ShapeID( - "com.amazonaws.bedrockagentruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_BAD_GATEWAY_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_DEPENDENCY_FAILED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class RetrieveAndGenerateInput: - """ - Contains the query made to the knowledge base. - - This data type is used in the following API operations: - - - [RetrieveAndGenerate - request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_RequestSyntax) - -- in the `input` field - """ - - text: str - """The query made to the knowledge base, in characters.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVE_AND_GENERATE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_RETRIEVE_AND_GENERATE_INPUT.members["text"], self.text - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["text"] = de.read_string( - _SCHEMA_RETRIEVE_AND_GENERATE_INPUT.members["text"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RETRIEVE_AND_GENERATE_INPUT, consumer=_consumer - ) - if "text" not in kwargs: - kwargs["text"] = "" - return kwargs - - -@dataclass(kw_only=True) -class GuardrailConfiguration: - """The configuration details for the guardrail.""" - - guardrail_id: str - """The unique identifier for the guardrail.""" - - guardrail_version: str - """The version of the guardrail.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GUARDRAIL_CONFIGURATION.members["guardrailId"], self.guardrail_id - ) - serializer.write_string( - _SCHEMA_GUARDRAIL_CONFIGURATION.members["guardrailVersion"], - self.guardrail_version, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["guardrail_id"] = de.read_string( - _SCHEMA_GUARDRAIL_CONFIGURATION.members["guardrailId"] - ) - - case 1: - kwargs["guardrail_version"] = de.read_string( - _SCHEMA_GUARDRAIL_CONFIGURATION.members["guardrailVersion"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GUARDRAIL_CONFIGURATION, consumer=_consumer) - if "guardrail_id" not in kwargs: - kwargs["guardrail_id"] = "" - if "guardrail_version" not in kwargs: - kwargs["guardrail_version"] = "" - return kwargs - - -def _serialize_rag_stop_sequences( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_rag_stop_sequences( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class TextInferenceConfig: - """ - Configuration settings for text generation using a language model via - the RetrieveAndGenerate operation. Includes parameters like temperature, - top-p, maximum token count, and stop sequences. - - Note: - The valid range of `maxTokens` depends on the accepted values for your - chosen model's inference parameters. To see the inference parameters - for your model, see [Inference parameters for foundation - models.](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html) - """ - - temperature: float | None = None - """ - Controls the random-ness of text generated by the language model, - influencing how much the model sticks to the most predictable next words - versus exploring more surprising options. A lower temperature value - (e.g. 0.2 or 0.3) makes model outputs more deterministic or predictable, - while a higher temperature (e.g. 0.8 or 0.9) makes the outputs more - creative or unpredictable. - """ - - top_p: float | None = None - """ - A probability distribution threshold which controls what the model - considers for the set of possible next tokens. The model will only - consider the top p% of the probability distribution when generating the - next token. - """ - - max_tokens: int | None = None - """ - The maximum number of tokens to generate in the output text. Do not use - the minimum of 0 or the maximum of 65536. The limit values described - here are arbitary values, for actual values consult the limits defined - by your specific model. - """ - - stop_sequences: list[str] | None = None - """ - A list of sequences of characters that, if generated, will cause the - model to stop generating further tokens. Do not use a minimum length of - 1 or a maximum length of 1000. The limit values described here are - arbitary values, for actual values consult the limits defined by your - specific model. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TEXT_INFERENCE_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.temperature is not None: - serializer.write_float( - _SCHEMA_TEXT_INFERENCE_CONFIG.members["temperature"], self.temperature - ) - - if self.top_p is not None: - serializer.write_float( - _SCHEMA_TEXT_INFERENCE_CONFIG.members["topP"], self.top_p - ) - - if self.max_tokens is not None: - serializer.write_integer( - _SCHEMA_TEXT_INFERENCE_CONFIG.members["maxTokens"], self.max_tokens - ) - - if self.stop_sequences is not None: - _serialize_rag_stop_sequences( - serializer, - _SCHEMA_TEXT_INFERENCE_CONFIG.members["stopSequences"], - self.stop_sequences, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["temperature"] = de.read_float( - _SCHEMA_TEXT_INFERENCE_CONFIG.members["temperature"] - ) - - case 1: - kwargs["top_p"] = de.read_float( - _SCHEMA_TEXT_INFERENCE_CONFIG.members["topP"] - ) - - case 2: - kwargs["max_tokens"] = de.read_integer( - _SCHEMA_TEXT_INFERENCE_CONFIG.members["maxTokens"] - ) - - case 3: - kwargs["stop_sequences"] = _deserialize_rag_stop_sequences( - de, _SCHEMA_TEXT_INFERENCE_CONFIG.members["stopSequences"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TEXT_INFERENCE_CONFIG, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class InferenceConfig: - """ - The configuration for inference settings when generating responses using - RetrieveAndGenerate. - """ - - text_inference_config: TextInferenceConfig | None = None - """ - Configuration settings specific to text generation while generating - responses using RetrieveAndGenerate. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INFERENCE_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.text_inference_config is not None: - serializer.write_struct( - _SCHEMA_INFERENCE_CONFIG.members["textInferenceConfig"], - self.text_inference_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["text_inference_config"] = TextInferenceConfig.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INFERENCE_CONFIG, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class PromptTemplate: - """ - Contains the template for the prompt that's sent to the model for - response generation. For more information, see [Knowledge base prompt - templates](https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html#kb-test-config-sysprompt). - - This data type is used in the following API operations: - - - [RetrieveAndGenerate - request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_RequestSyntax) - -- in the `filter` field - """ - - text_prompt_template: str | None = field(repr=False, default=None) - """ - The template for the prompt that's sent to the model for response - generation. You can include prompt placeholders, which become replaced - before the prompt is sent to the model to provide instructions and - context to the model. In addition, you can include XML tags to delineate - meaningful sections of the prompt template. - - For more information, see the following resources: - - - [Knowledge base prompt - templates](https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html#kb-test-config-sysprompt) - - - [Use XML tags with Anthropic Claude - models](https://docs.claude.com/en/docs/build-with-claude/prompt-engineering/use-xml-tags) - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PROMPT_TEMPLATE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.text_prompt_template is not None: - serializer.write_string( - _SCHEMA_PROMPT_TEMPLATE.members["textPromptTemplate"], - self.text_prompt_template, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["text_prompt_template"] = de.read_string( - _SCHEMA_PROMPT_TEMPLATE.members["textPromptTemplate"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PROMPT_TEMPLATE, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ExternalSourcesGenerationConfiguration: - """ - Contains the generation configuration of the external source wrapper - object. - """ - - prompt_template: PromptTemplate | None = None - """ - Contain the textPromptTemplate string for the external source wrapper - object. - """ - - guardrail_configuration: GuardrailConfiguration | None = None - """The configuration details for the guardrail.""" - - inference_config: InferenceConfig | None = None - """ - Configuration settings for inference when using RetrieveAndGenerate to - generate responses while using an external source. - """ - - additional_model_request_fields: dict[str, Document] | None = None - """ - Additional model parameters and their corresponding values not included - in the textInferenceConfig structure for an external source. Takes in - custom model parameters specific to the language model being used. - """ - - performance_config: PerformanceConfiguration | None = None - """The latency configuration for the model.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EXTERNAL_SOURCES_GENERATION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.prompt_template is not None: - serializer.write_struct( - _SCHEMA_EXTERNAL_SOURCES_GENERATION_CONFIGURATION.members[ - "promptTemplate" - ], - self.prompt_template, - ) - - if self.guardrail_configuration is not None: - serializer.write_struct( - _SCHEMA_EXTERNAL_SOURCES_GENERATION_CONFIGURATION.members[ - "guardrailConfiguration" - ], - self.guardrail_configuration, - ) - - if self.inference_config is not None: - serializer.write_struct( - _SCHEMA_EXTERNAL_SOURCES_GENERATION_CONFIGURATION.members[ - "inferenceConfig" - ], - self.inference_config, - ) - - if self.additional_model_request_fields is not None: - _serialize_additional_model_request_fields( - serializer, - _SCHEMA_EXTERNAL_SOURCES_GENERATION_CONFIGURATION.members[ - "additionalModelRequestFields" - ], - self.additional_model_request_fields, - ) - - if self.performance_config is not None: - serializer.write_struct( - _SCHEMA_EXTERNAL_SOURCES_GENERATION_CONFIGURATION.members[ - "performanceConfig" - ], - self.performance_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["prompt_template"] = PromptTemplate.deserialize(de) - - case 1: - kwargs["guardrail_configuration"] = ( - GuardrailConfiguration.deserialize(de) - ) - - case 2: - kwargs["inference_config"] = InferenceConfig.deserialize(de) - - case 3: - kwargs["additional_model_request_fields"] = ( - _deserialize_additional_model_request_fields( - de, - _SCHEMA_EXTERNAL_SOURCES_GENERATION_CONFIGURATION.members[ - "additionalModelRequestFields" - ], - ) - ) - - case 4: - kwargs["performance_config"] = PerformanceConfiguration.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EXTERNAL_SOURCES_GENERATION_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ByteContentDoc: - """ - This property contains the document to chat with, along with its - attributes. - """ - - identifier: str = field(repr=False) - """The file name of the document contained in the wrapper object.""" - - content_type: str - """The MIME type of the document contained in the wrapper object.""" - - data: bytes = field(repr=False) - """The byte value of the file to upload, encoded as a Base-64 string.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BYTE_CONTENT_DOC, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_BYTE_CONTENT_DOC.members["identifier"], self.identifier - ) - serializer.write_string( - _SCHEMA_BYTE_CONTENT_DOC.members["contentType"], self.content_type - ) - serializer.write_blob(_SCHEMA_BYTE_CONTENT_DOC.members["data"], self.data) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["identifier"] = de.read_string( - _SCHEMA_BYTE_CONTENT_DOC.members["identifier"] - ) - - case 1: - kwargs["content_type"] = de.read_string( - _SCHEMA_BYTE_CONTENT_DOC.members["contentType"] - ) - - case 2: - kwargs["data"] = de.read_blob( - _SCHEMA_BYTE_CONTENT_DOC.members["data"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BYTE_CONTENT_DOC, consumer=_consumer) - if "identifier" not in kwargs: - kwargs["identifier"] = "" - if "content_type" not in kwargs: - kwargs["content_type"] = "" - if "data" not in kwargs: - kwargs["data"] = b"" - return kwargs - - -@dataclass(kw_only=True) -class S3ObjectDoc: - """The unique wrapper object of the document from the S3 location.""" - - uri: str - """The file location of the S3 wrapper object.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_S3_OBJECT_DOC, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_S3_OBJECT_DOC.members["uri"], self.uri) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["uri"] = de.read_string(_SCHEMA_S3_OBJECT_DOC.members["uri"]) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_S3_OBJECT_DOC, consumer=_consumer) - if "uri" not in kwargs: - kwargs["uri"] = "" - return kwargs - - -class ExternalSourceType(UnknownEnumMixin, StrEnum): - S3 = "S3" - BYTE_CONTENT = "BYTE_CONTENT" - - -@dataclass(kw_only=True) -class ExternalSource: - """ - The unique external source of the content contained in the wrapper - object. - """ - - source_type: str - """The source type of the external source wrapper object.""" - - s3_location: S3ObjectDoc | None = None - """The S3 location of the external source wrapper object.""" - - byte_content: ByteContentDoc | None = None - """ - The identifier, contentType, and data of the external source wrapper - object. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EXTERNAL_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_EXTERNAL_SOURCE.members["sourceType"], self.source_type - ) - if self.s3_location is not None: - serializer.write_struct( - _SCHEMA_EXTERNAL_SOURCE.members["s3Location"], self.s3_location - ) - - if self.byte_content is not None: - serializer.write_struct( - _SCHEMA_EXTERNAL_SOURCE.members["byteContent"], self.byte_content - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["source_type"] = ExternalSourceType( - de.read_string(_SCHEMA_EXTERNAL_SOURCE.members["sourceType"]) - ) - - case 1: - kwargs["s3_location"] = S3ObjectDoc.deserialize(de) - - case 2: - kwargs["byte_content"] = ByteContentDoc.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EXTERNAL_SOURCE, consumer=_consumer) - if "source_type" not in kwargs: - kwargs["source_type"] = ExternalSourceType._corrected("") - return kwargs - - -def _serialize_external_sources( - serializer: ShapeSerializer, schema: Schema, value: list[ExternalSource] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_external_sources( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ExternalSource]: - result: list[ExternalSource] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ExternalSource.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ExternalSourcesRetrieveAndGenerateConfiguration: - """ - The configurations of the external source wrapper object in the - `retrieveAndGenerate` function. - """ - - model_arn: str - """ - The model Amazon Resource Name (ARN) for the external source wrapper - object in the `retrieveAndGenerate` function. - """ - - sources: list[ExternalSource] - """ - The document for the external source wrapper object in the - `retrieveAndGenerate` function. - """ - - generation_configuration: ExternalSourcesGenerationConfiguration | None = None - """ - The prompt used with the external source wrapper object with the - `retrieveAndGenerate` function. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_EXTERNAL_SOURCES_RETRIEVE_AND_GENERATE_CONFIGURATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_EXTERNAL_SOURCES_RETRIEVE_AND_GENERATE_CONFIGURATION.members[ - "modelArn" - ], - self.model_arn, - ) - _serialize_external_sources( - serializer, - _SCHEMA_EXTERNAL_SOURCES_RETRIEVE_AND_GENERATE_CONFIGURATION.members[ - "sources" - ], - self.sources, - ) - if self.generation_configuration is not None: - serializer.write_struct( - _SCHEMA_EXTERNAL_SOURCES_RETRIEVE_AND_GENERATE_CONFIGURATION.members[ - "generationConfiguration" - ], - self.generation_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_arn"] = de.read_string( - _SCHEMA_EXTERNAL_SOURCES_RETRIEVE_AND_GENERATE_CONFIGURATION.members[ - "modelArn" - ] - ) - - case 1: - kwargs["sources"] = _deserialize_external_sources( - de, - _SCHEMA_EXTERNAL_SOURCES_RETRIEVE_AND_GENERATE_CONFIGURATION.members[ - "sources" - ], - ) - - case 2: - kwargs["generation_configuration"] = ( - ExternalSourcesGenerationConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EXTERNAL_SOURCES_RETRIEVE_AND_GENERATE_CONFIGURATION, - consumer=_consumer, - ) - if "model_arn" not in kwargs: - kwargs["model_arn"] = "" - if "sources" not in kwargs: - kwargs["sources"] = [] - return kwargs - - -@dataclass(kw_only=True) -class GenerationConfiguration: - """ - Contains configurations for response generation based on the knowledge - base query results. - - This data type is used in the following API operations: - - - [RetrieveAndGenerate - request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_RequestSyntax) - """ - - prompt_template: PromptTemplate | None = None - """ - Contains the template for the prompt that's sent to the model for - response generation. Generation prompts must include the - `$search_results$` variable. For more information, see [Use placeholder - variables](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-placeholders.html) - in the user guide. - """ - - guardrail_configuration: GuardrailConfiguration | None = None - """The configuration details for the guardrail.""" - - inference_config: InferenceConfig | None = None - """ - Configuration settings for inference when using RetrieveAndGenerate to - generate responses while using a knowledge base as a source. - """ - - additional_model_request_fields: dict[str, Document] | None = None - """ - Additional model parameters and corresponding values not included in the - textInferenceConfig structure for a knowledge base. This allows users to - provide custom model parameters specific to the language model being - used. - """ - - performance_config: PerformanceConfiguration | None = None - """The latency configuration for the model.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GENERATION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.prompt_template is not None: - serializer.write_struct( - _SCHEMA_GENERATION_CONFIGURATION.members["promptTemplate"], - self.prompt_template, - ) - - if self.guardrail_configuration is not None: - serializer.write_struct( - _SCHEMA_GENERATION_CONFIGURATION.members["guardrailConfiguration"], - self.guardrail_configuration, - ) - - if self.inference_config is not None: - serializer.write_struct( - _SCHEMA_GENERATION_CONFIGURATION.members["inferenceConfig"], - self.inference_config, - ) - - if self.additional_model_request_fields is not None: - _serialize_additional_model_request_fields( - serializer, - _SCHEMA_GENERATION_CONFIGURATION.members[ - "additionalModelRequestFields" - ], - self.additional_model_request_fields, - ) - - if self.performance_config is not None: - serializer.write_struct( - _SCHEMA_GENERATION_CONFIGURATION.members["performanceConfig"], - self.performance_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["prompt_template"] = PromptTemplate.deserialize(de) - - case 1: - kwargs["guardrail_configuration"] = ( - GuardrailConfiguration.deserialize(de) - ) - - case 2: - kwargs["inference_config"] = InferenceConfig.deserialize(de) - - case 3: - kwargs["additional_model_request_fields"] = ( - _deserialize_additional_model_request_fields( - de, - _SCHEMA_GENERATION_CONFIGURATION.members[ - "additionalModelRequestFields" - ], - ) - ) - - case 4: - kwargs["performance_config"] = PerformanceConfiguration.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GENERATION_CONFIGURATION, consumer=_consumer) - return kwargs - - -class QueryTransformationType(UnknownEnumMixin, StrEnum): - QUERY_DECOMPOSITION = "QUERY_DECOMPOSITION" - - -@dataclass(kw_only=True) -class QueryTransformationConfiguration: - """ - To split up the prompt and retrieve multiple sources, set the - transformation type to `QUERY_DECOMPOSITION`. - """ - - type: str - """The type of transformation to apply to the prompt.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_QUERY_TRANSFORMATION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_QUERY_TRANSFORMATION_CONFIGURATION.members["type"], self.type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = QueryTransformationType( - de.read_string( - _SCHEMA_QUERY_TRANSFORMATION_CONFIGURATION.members["type"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_QUERY_TRANSFORMATION_CONFIGURATION, consumer=_consumer - ) - if "type" not in kwargs: - kwargs["type"] = QueryTransformationType._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class OrchestrationConfiguration: - """ - Settings for how the model processes the prompt prior to retrieval and - generation. - """ - - prompt_template: PromptTemplate | None = None - """ - Contains the template for the prompt that's sent to the model. - Orchestration prompts must include the `$conversation_history$` and - `$output_format_instructions$` variables. For more information, see [Use - placeholder - variables](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-placeholders.html) - in the user guide. - """ - - inference_config: InferenceConfig | None = None - """ - Configuration settings for inference when using RetrieveAndGenerate to - generate responses while using a knowledge base as a source. - """ - - additional_model_request_fields: dict[str, Document] | None = None - """ - Additional model parameters and corresponding values not included in the - textInferenceConfig structure for a knowledge base. This allows users to - provide custom model parameters specific to the language model being - used. - """ - - query_transformation_configuration: QueryTransformationConfiguration | None = None - """ - To split up the prompt and retrieve multiple sources, set the - transformation type to `QUERY_DECOMPOSITION`. - """ - - performance_config: PerformanceConfiguration | None = None - """The latency configuration for the model.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ORCHESTRATION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.prompt_template is not None: - serializer.write_struct( - _SCHEMA_ORCHESTRATION_CONFIGURATION.members["promptTemplate"], - self.prompt_template, - ) - - if self.inference_config is not None: - serializer.write_struct( - _SCHEMA_ORCHESTRATION_CONFIGURATION.members["inferenceConfig"], - self.inference_config, - ) - - if self.additional_model_request_fields is not None: - _serialize_additional_model_request_fields( - serializer, - _SCHEMA_ORCHESTRATION_CONFIGURATION.members[ - "additionalModelRequestFields" - ], - self.additional_model_request_fields, - ) - - if self.query_transformation_configuration is not None: - serializer.write_struct( - _SCHEMA_ORCHESTRATION_CONFIGURATION.members[ - "queryTransformationConfiguration" - ], - self.query_transformation_configuration, - ) - - if self.performance_config is not None: - serializer.write_struct( - _SCHEMA_ORCHESTRATION_CONFIGURATION.members["performanceConfig"], - self.performance_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["prompt_template"] = PromptTemplate.deserialize(de) - - case 1: - kwargs["inference_config"] = InferenceConfig.deserialize(de) - - case 2: - kwargs["additional_model_request_fields"] = ( - _deserialize_additional_model_request_fields( - de, - _SCHEMA_ORCHESTRATION_CONFIGURATION.members[ - "additionalModelRequestFields" - ], - ) - ) - - case 3: - kwargs["query_transformation_configuration"] = ( - QueryTransformationConfiguration.deserialize(de) - ) - - case 4: - kwargs["performance_config"] = PerformanceConfiguration.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ORCHESTRATION_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -class RetrieveAndGenerateType(UnknownEnumMixin, StrEnum): - KNOWLEDGE_BASE = "KNOWLEDGE_BASE" - EXTERNAL_SOURCES = "EXTERNAL_SOURCES" - - -@dataclass(kw_only=True) -class RetrieveAndGenerateSessionConfiguration: - """ - Contains configuration about the session with the knowledge base. - - This data type is used in the following API operations: - - - [RetrieveAndGenerate - request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_RequestSyntax) - -- in the `sessionConfiguration` field - """ - - kms_key_arn: str - """The ARN of the KMS key encrypting the session.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RETRIEVE_AND_GENERATE_SESSION_CONFIGURATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_RETRIEVE_AND_GENERATE_SESSION_CONFIGURATION.members["kmsKeyArn"], - self.kms_key_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_RETRIEVE_AND_GENERATE_SESSION_CONFIGURATION.members[ - "kmsKeyArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RETRIEVE_AND_GENERATE_SESSION_CONFIGURATION, consumer=_consumer - ) - if "kms_key_arn" not in kwargs: - kwargs["kms_key_arn"] = "" - return kwargs - - -class GuadrailAction(UnknownEnumMixin, StrEnum): - INTERVENED = "INTERVENED" - NONE = "NONE" - - -@dataclass(kw_only=True) -class RetrieveAndGenerateOutput: - """ - Contains the response generated from querying the knowledge base. - - This data type is used in the following API operations: - - - [RetrieveAndGenerate - response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax) - -- in the `output` field - """ - - text: str - """The response generated from querying the knowledge base.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVE_AND_GENERATE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_RETRIEVE_AND_GENERATE_OUTPUT.members["text"], self.text - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["text"] = de.read_string( - _SCHEMA_RETRIEVE_AND_GENERATE_OUTPUT.members["text"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RETRIEVE_AND_GENERATE_OUTPUT, consumer=_consumer - ) - if "text" not in kwargs: - kwargs["text"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(text="") - - -@dataclass(kw_only=True) -class RetrieveAndGenerateOperationOutput: - """Dataclass for RetrieveAndGenerateOperationOutput structure.""" - - session_id: str - """ - The unique identifier of the session. When you first make a - `RetrieveAndGenerate` request, Amazon Bedrock automatically generates - this value. You must reuse this value for all subsequent requests in the - same conversational session. This value allows Amazon Bedrock to - maintain context and knowledge from previous interactions. You can't - explicitly set the `sessionId` yourself. - """ - - output: RetrieveAndGenerateOutput = field(repr=False) - """Contains the response generated from querying the knowledge base.""" - - citations: list[Citation] | None = None - """ - A list of segments of the generated response that are based on sources - in the knowledge base, alongside information about the sources. - """ - - guardrail_action: str | None = None - """Specifies if there is a guardrail intervention in the response.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVE_AND_GENERATE_OPERATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_RETRIEVE_AND_GENERATE_OPERATION_OUTPUT.members["sessionId"], - self.session_id, - ) - serializer.write_struct( - _SCHEMA_RETRIEVE_AND_GENERATE_OPERATION_OUTPUT.members["output"], - self.output, - ) - if self.citations is not None: - _serialize_citations( - serializer, - _SCHEMA_RETRIEVE_AND_GENERATE_OPERATION_OUTPUT.members["citations"], - self.citations, - ) - - if self.guardrail_action is not None: - serializer.write_string( - _SCHEMA_RETRIEVE_AND_GENERATE_OPERATION_OUTPUT.members[ - "guardrailAction" - ], - self.guardrail_action, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["session_id"] = de.read_string( - _SCHEMA_RETRIEVE_AND_GENERATE_OPERATION_OUTPUT.members[ - "sessionId" - ] - ) - - case 1: - kwargs["output"] = RetrieveAndGenerateOutput.deserialize(de) - - case 2: - kwargs["citations"] = _deserialize_citations( - de, - _SCHEMA_RETRIEVE_AND_GENERATE_OPERATION_OUTPUT.members[ - "citations" - ], - ) - - case 3: - kwargs["guardrail_action"] = GuadrailAction( - de.read_string( - _SCHEMA_RETRIEVE_AND_GENERATE_OPERATION_OUTPUT.members[ - "guardrailAction" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RETRIEVE_AND_GENERATE_OPERATION_OUTPUT, consumer=_consumer - ) - if "session_id" not in kwargs: - kwargs["session_id"] = "" - if "output" not in kwargs: - kwargs["output"] = RetrieveAndGenerateOutput._smithy_default() - return kwargs - - -@dataclass(kw_only=True) -class CitationEvent: - """A citation event.""" - - citation: Citation | None = None - """The citation.""" - - generated_response_part: GeneratedResponsePart | None = None - """The generated response to the citation event.""" - - retrieved_references: list[RetrievedReference] | None = None - """The retrieved references of the citation event.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CITATION_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.citation is not None: - serializer.write_struct( - _SCHEMA_CITATION_EVENT.members["citation"], self.citation - ) - - if self.generated_response_part is not None: - serializer.write_struct( - _SCHEMA_CITATION_EVENT.members["generatedResponsePart"], - self.generated_response_part, - ) - - if self.retrieved_references is not None: - _serialize_retrieved_references( - serializer, - _SCHEMA_CITATION_EVENT.members["retrievedReferences"], - self.retrieved_references, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["citation"] = Citation.deserialize(de) - - case 1: - kwargs["generated_response_part"] = ( - GeneratedResponsePart.deserialize(de) - ) - - case 2: - kwargs["retrieved_references"] = _deserialize_retrieved_references( - de, _SCHEMA_CITATION_EVENT.members["retrievedReferences"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CITATION_EVENT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GuardrailEvent: - """A guardrail event.""" - - action: str | None = None - """The guardrail action.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.action is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_EVENT.members["action"], self.action - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["action"] = GuadrailAction( - de.read_string(_SCHEMA_GUARDRAIL_EVENT.members["action"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GUARDRAIL_EVENT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class RetrieveAndGenerateOutputEvent: - """A retrieve and generate output event.""" - - text: str - """A text response.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVE_AND_GENERATE_OUTPUT_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_RETRIEVE_AND_GENERATE_OUTPUT_EVENT.members["text"], self.text - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["text"] = de.read_string( - _SCHEMA_RETRIEVE_AND_GENERATE_OUTPUT_EVENT.members["text"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RETRIEVE_AND_GENERATE_OUTPUT_EVENT, consumer=_consumer - ) - if "text" not in kwargs: - kwargs["text"] = "" - return kwargs - - -@dataclass -class RetrieveAndGenerateStreamResponseOutputOutput: - """An output event.""" - - value: RetrieveAndGenerateOutputEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RETRIEVE_AND_GENERATE_STREAM_RESPONSE_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RETRIEVE_AND_GENERATE_STREAM_RESPONSE_OUTPUT.members["output"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=RetrieveAndGenerateOutputEvent.deserialize(deserializer)) - - -@dataclass -class RetrieveAndGenerateStreamResponseOutputCitation: - """A citation event.""" - - value: CitationEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RETRIEVE_AND_GENERATE_STREAM_RESPONSE_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RETRIEVE_AND_GENERATE_STREAM_RESPONSE_OUTPUT.members["citation"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=CitationEvent.deserialize(deserializer)) - - -@dataclass -class RetrieveAndGenerateStreamResponseOutputGuardrail: - """A guardrail event.""" - - value: GuardrailEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RETRIEVE_AND_GENERATE_STREAM_RESPONSE_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RETRIEVE_AND_GENERATE_STREAM_RESPONSE_OUTPUT.members["guardrail"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=GuardrailEvent.deserialize(deserializer)) - - -@dataclass -class RetrieveAndGenerateStreamResponseOutputInternalServerException: - """An internal server error occurred. Retry your request.""" - - value: InternalServerException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RETRIEVE_AND_GENERATE_STREAM_RESPONSE_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RETRIEVE_AND_GENERATE_STREAM_RESPONSE_OUTPUT.members[ - "internalServerException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=InternalServerException.deserialize(deserializer)) - - -@dataclass -class RetrieveAndGenerateStreamResponseOutputValidationException: - """ - The input fails to satisfy the constraints specified by *Amazon - Bedrock*. For troubleshooting this error, see - [ValidationError](https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-validation-error) - in the Amazon Bedrock User Guide. - """ - - value: ValidationException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RETRIEVE_AND_GENERATE_STREAM_RESPONSE_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RETRIEVE_AND_GENERATE_STREAM_RESPONSE_OUTPUT.members[ - "validationException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ValidationException.deserialize(deserializer)) - - -@dataclass -class RetrieveAndGenerateStreamResponseOutputResourceNotFoundException: - """ - The specified resource ARN was not found. For troubleshooting this - error, see - [ResourceNotFound](https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-resource-not-found) - in the Amazon Bedrock User Guide. - """ - - value: ResourceNotFoundException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RETRIEVE_AND_GENERATE_STREAM_RESPONSE_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RETRIEVE_AND_GENERATE_STREAM_RESPONSE_OUTPUT.members[ - "resourceNotFoundException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ResourceNotFoundException.deserialize(deserializer)) - - -@dataclass -class RetrieveAndGenerateStreamResponseOutputServiceQuotaExceededException: - """ - Your request exceeds the service quota for your account. You can view - your quotas at [Viewing service - quotas](https://docs.aws.amazon.com/servicequotas/latest/userguide/gs-request-quota.html). - You can resubmit your request later. - """ - - value: ServiceQuotaExceededException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RETRIEVE_AND_GENERATE_STREAM_RESPONSE_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RETRIEVE_AND_GENERATE_STREAM_RESPONSE_OUTPUT.members[ - "serviceQuotaExceededException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ServiceQuotaExceededException.deserialize(deserializer)) - - -@dataclass -class RetrieveAndGenerateStreamResponseOutputThrottlingException: - """ - Your request was denied due to exceeding the account quotas for *Amazon - Bedrock*. For troubleshooting this error, see - [ThrottlingException](https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-throttling-exception) - in the Amazon Bedrock User Guide. - """ - - value: ThrottlingException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RETRIEVE_AND_GENERATE_STREAM_RESPONSE_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RETRIEVE_AND_GENERATE_STREAM_RESPONSE_OUTPUT.members[ - "throttlingException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ThrottlingException.deserialize(deserializer)) - - -@dataclass -class RetrieveAndGenerateStreamResponseOutputAccessDeniedException: - """ - The request is denied because you do not have sufficient permissions to - perform the requested action. For troubleshooting this error, see - [AccessDeniedException](https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-access-denied) - in the Amazon Bedrock User Guide. - """ - - value: AccessDeniedException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RETRIEVE_AND_GENERATE_STREAM_RESPONSE_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RETRIEVE_AND_GENERATE_STREAM_RESPONSE_OUTPUT.members[ - "accessDeniedException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=AccessDeniedException.deserialize(deserializer)) - - -@dataclass -class RetrieveAndGenerateStreamResponseOutputConflictException: - """Error occurred because of a conflict while performing an operation.""" - - value: ConflictException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RETRIEVE_AND_GENERATE_STREAM_RESPONSE_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RETRIEVE_AND_GENERATE_STREAM_RESPONSE_OUTPUT.members[ - "conflictException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ConflictException.deserialize(deserializer)) - - -@dataclass -class RetrieveAndGenerateStreamResponseOutputDependencyFailedException: - """The request failed due to a dependency error.""" - - value: DependencyFailedException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RETRIEVE_AND_GENERATE_STREAM_RESPONSE_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RETRIEVE_AND_GENERATE_STREAM_RESPONSE_OUTPUT.members[ - "dependencyFailedException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=DependencyFailedException.deserialize(deserializer)) - - -@dataclass -class RetrieveAndGenerateStreamResponseOutputBadGatewayException: - """The request failed due to a bad gateway error.""" - - value: BadGatewayException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RETRIEVE_AND_GENERATE_STREAM_RESPONSE_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RETRIEVE_AND_GENERATE_STREAM_RESPONSE_OUTPUT.members[ - "badGatewayException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=BadGatewayException.deserialize(deserializer)) - - -@dataclass -class RetrieveAndGenerateStreamResponseOutputUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -RetrieveAndGenerateStreamResponseOutput = Union[ - RetrieveAndGenerateStreamResponseOutputOutput - | RetrieveAndGenerateStreamResponseOutputCitation - | RetrieveAndGenerateStreamResponseOutputGuardrail - | RetrieveAndGenerateStreamResponseOutputInternalServerException - | RetrieveAndGenerateStreamResponseOutputValidationException - | RetrieveAndGenerateStreamResponseOutputResourceNotFoundException - | RetrieveAndGenerateStreamResponseOutputServiceQuotaExceededException - | RetrieveAndGenerateStreamResponseOutputThrottlingException - | RetrieveAndGenerateStreamResponseOutputAccessDeniedException - | RetrieveAndGenerateStreamResponseOutputConflictException - | RetrieveAndGenerateStreamResponseOutputDependencyFailedException - | RetrieveAndGenerateStreamResponseOutputBadGatewayException - | RetrieveAndGenerateStreamResponseOutputUnknown -] -"""A retrieve and generate stream response output.""" - - -class _RetrieveAndGenerateStreamResponseOutputDeserializer: - _result: RetrieveAndGenerateStreamResponseOutput | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> RetrieveAndGenerateStreamResponseOutput: - self._result = None - deserializer.read_struct( - _SCHEMA_RETRIEVE_AND_GENERATE_STREAM_RESPONSE_OUTPUT, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - RetrieveAndGenerateStreamResponseOutputOutput.deserialize(de) - ) - - case 1: - self._set_result( - RetrieveAndGenerateStreamResponseOutputCitation.deserialize(de) - ) - - case 2: - self._set_result( - RetrieveAndGenerateStreamResponseOutputGuardrail.deserialize(de) - ) - - case 3: - self._set_result( - RetrieveAndGenerateStreamResponseOutputInternalServerException.deserialize( - de - ) - ) - - case 4: - self._set_result( - RetrieveAndGenerateStreamResponseOutputValidationException.deserialize( - de - ) - ) - - case 5: - self._set_result( - RetrieveAndGenerateStreamResponseOutputResourceNotFoundException.deserialize( - de - ) - ) - - case 6: - self._set_result( - RetrieveAndGenerateStreamResponseOutputServiceQuotaExceededException.deserialize( - de - ) - ) - - case 7: - self._set_result( - RetrieveAndGenerateStreamResponseOutputThrottlingException.deserialize( - de - ) - ) - - case 8: - self._set_result( - RetrieveAndGenerateStreamResponseOutputAccessDeniedException.deserialize( - de - ) - ) - - case 9: - self._set_result( - RetrieveAndGenerateStreamResponseOutputConflictException.deserialize( - de - ) - ) - - case 10: - self._set_result( - RetrieveAndGenerateStreamResponseOutputDependencyFailedException.deserialize( - de - ) - ) - - case 11: - self._set_result( - RetrieveAndGenerateStreamResponseOutputBadGatewayException.deserialize( - de - ) - ) - - case _: - self._set_result( - RetrieveAndGenerateStreamResponseOutputUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: RetrieveAndGenerateStreamResponseOutput) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class RetrieveAndGenerateStreamOutput: - """Dataclass for RetrieveAndGenerateStreamOutput structure.""" - - session_id: str - """The session ID.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVE_AND_GENERATE_STREAM_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_RETRIEVE_AND_GENERATE_STREAM_OUTPUT.members["sessionId"], - self.session_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 1: - kwargs["session_id"] = de.read_string( - _SCHEMA_RETRIEVE_AND_GENERATE_STREAM_OUTPUT.members["sessionId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RETRIEVE_AND_GENERATE_STREAM_OUTPUT, consumer=_consumer - ) - if "session_id" not in kwargs: - kwargs["session_id"] = "" - return kwargs - - -class InputImageFormat(UnknownEnumMixin, StrEnum): - PNG = "png" - JPEG = "jpeg" - GIF = "gif" - WEBP = "webp" - - -@dataclass(kw_only=True) -class InputImage: - """ - Contains the image data for multimodal knowledge base queries, including - format and content. - - This data type is used in the following API operations: - - - [Retrieve - request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_RequestSyntax) - -- in the `image` field - """ - - format: str - """ - The format of the input image. Supported formats include png, gif, jpeg, - and webp. - """ - - inline_content: bytes = field(repr=False) - """ - The base64-encoded image data for inline image content. Maximum size is - 5MB. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INPUT_IMAGE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_INPUT_IMAGE.members["format"], self.format) - serializer.write_blob( - _SCHEMA_INPUT_IMAGE.members["inlineContent"], self.inline_content - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["format"] = InputImageFormat( - de.read_string(_SCHEMA_INPUT_IMAGE.members["format"]) - ) - - case 1: - kwargs["inline_content"] = de.read_blob( - _SCHEMA_INPUT_IMAGE.members["inlineContent"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INPUT_IMAGE, consumer=_consumer) - if "format" not in kwargs: - kwargs["format"] = InputImageFormat._corrected("") - if "inline_content" not in kwargs: - kwargs["inline_content"] = b"" - return kwargs - - -class KnowledgeBaseQueryType(UnknownEnumMixin, StrEnum): - TEXT = "TEXT" - IMAGE = "IMAGE" - - -@dataclass(kw_only=True) -class KnowledgeBaseQuery: - """ - Contains the query made to the knowledge base. - - This data type is used in the following API operations: - - - [Retrieve - request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_RequestSyntax) - -- in the `retrievalQuery` field - """ - - type: str = KnowledgeBaseQueryType("TEXT") - """The type of query being performed.""" - - text: str = "" - """The text of the query made to the knowledge base.""" - - image: InputImage | None = None - """ - An image to include in the knowledge base query for multimodal - retrieval. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KNOWLEDGE_BASE_QUERY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_KNOWLEDGE_BASE_QUERY.members["type"], self.type) - serializer.write_string(_SCHEMA_KNOWLEDGE_BASE_QUERY.members["text"], self.text) - if self.image is not None: - serializer.write_struct( - _SCHEMA_KNOWLEDGE_BASE_QUERY.members["image"], self.image - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = KnowledgeBaseQueryType( - de.read_string(_SCHEMA_KNOWLEDGE_BASE_QUERY.members["type"]) - ) - - case 1: - kwargs["text"] = de.read_string( - _SCHEMA_KNOWLEDGE_BASE_QUERY.members["text"] - ) - - case 2: - kwargs["image"] = InputImage.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_KNOWLEDGE_BASE_QUERY, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class KnowledgeBaseRetrievalResult: - """ - Details about a result from querying the knowledge base. - - This data type is used in the following API operations: - - - [Retrieve - response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax) - -- in the `retrievalResults` field - """ - - content: RetrievalResultContent = field(repr=False) - """Contains information about the content of the chunk.""" - - location: RetrievalResultLocation | None = field(repr=False, default=None) - """Contains information about the location of the data source.""" - - score: float | None = None - """The level of relevance of the result to the query.""" - - metadata: dict[str, Document] | None = field(repr=False, default=None) - """ - Contains metadata attributes and their values for the file in the data - source. For more information, see [Metadata and - filtering](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-ds.html#kb-ds-metadata). - """ - - document_id: str | None = None - """ - The unique identifier of the document. Use with `GetDocumentContent` to - retrieve the full document. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KNOWLEDGE_BASE_RETRIEVAL_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_KNOWLEDGE_BASE_RETRIEVAL_RESULT.members["content"], self.content - ) - if self.location is not None: - serializer.write_struct( - _SCHEMA_KNOWLEDGE_BASE_RETRIEVAL_RESULT.members["location"], - self.location, - ) - - if self.score is not None: - serializer.write_double( - _SCHEMA_KNOWLEDGE_BASE_RETRIEVAL_RESULT.members["score"], self.score - ) - - if self.metadata is not None: - _serialize_retrieval_result_metadata( - serializer, - _SCHEMA_KNOWLEDGE_BASE_RETRIEVAL_RESULT.members["metadata"], - self.metadata, - ) - - if self.document_id is not None: - serializer.write_string( - _SCHEMA_KNOWLEDGE_BASE_RETRIEVAL_RESULT.members["documentId"], - self.document_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["content"] = RetrievalResultContent.deserialize(de) - - case 1: - kwargs["location"] = RetrievalResultLocation.deserialize(de) - - case 2: - kwargs["score"] = de.read_double( - _SCHEMA_KNOWLEDGE_BASE_RETRIEVAL_RESULT.members["score"] - ) - - case 3: - kwargs["metadata"] = _deserialize_retrieval_result_metadata( - de, _SCHEMA_KNOWLEDGE_BASE_RETRIEVAL_RESULT.members["metadata"] - ) - - case 4: - kwargs["document_id"] = de.read_string( - _SCHEMA_KNOWLEDGE_BASE_RETRIEVAL_RESULT.members["documentId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_KNOWLEDGE_BASE_RETRIEVAL_RESULT, consumer=_consumer - ) - if "content" not in kwargs: - kwargs["content"] = RetrievalResultContent._smithy_default() - return kwargs - - -def _serialize_knowledge_base_retrieval_results( - serializer: ShapeSerializer, - schema: Schema, - value: list[KnowledgeBaseRetrievalResult], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_knowledge_base_retrieval_results( - deserializer: ShapeDeserializer, schema: Schema -) -> list[KnowledgeBaseRetrievalResult]: - result: list[KnowledgeBaseRetrievalResult] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(KnowledgeBaseRetrievalResult.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class RetrieveOutput: - """Dataclass for RetrieveOutput structure.""" - - retrieval_results: list[KnowledgeBaseRetrievalResult] = field(repr=False) - """A list of results from querying the knowledge base.""" - - guardrail_action: str | None = None - """Specifies if there is a guardrail intervention in the response.""" - - next_token: str | None = None - """ - If there are more results than can fit in the response, the response - returns a `nextToken`. Use this token in the `nextToken` field of - another request to retrieve the next batch of results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_knowledge_base_retrieval_results( - serializer, - _SCHEMA_RETRIEVE_OUTPUT.members["retrievalResults"], - self.retrieval_results, - ) - if self.guardrail_action is not None: - serializer.write_string( - _SCHEMA_RETRIEVE_OUTPUT.members["guardrailAction"], - self.guardrail_action, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_RETRIEVE_OUTPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["retrieval_results"] = ( - _deserialize_knowledge_base_retrieval_results( - de, _SCHEMA_RETRIEVE_OUTPUT.members["retrievalResults"] - ) - ) - - case 1: - kwargs["guardrail_action"] = GuadrailAction( - de.read_string( - _SCHEMA_RETRIEVE_OUTPUT.members["guardrailAction"] - ) - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_RETRIEVE_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RETRIEVE_OUTPUT, consumer=_consumer) - if "retrieval_results" not in kwargs: - kwargs["retrieval_results"] = [] - return kwargs - - -def _serialize_session_metadata_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_session_metadata_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -def _serialize_tags_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_tags_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CreateSessionInput: - """Dataclass for CreateSessionInput structure.""" - - session_metadata: dict[str, str] | None = None - """ - A map of key-value pairs containing attributes to be persisted across - the session. For example, the user's ID, their language preference, and - the type of device they are using. - """ - - encryption_key_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the KMS key to use to encrypt the - session data. The user or role creating the session must have permission - to use the key. For more information, see [Amazon Bedrock session - encryption](https://docs.aws.amazon.com/bedrock/latest/userguide/session-encryption.html). - """ - - tags: dict[str, str] | None = None - """ - Specify the key-value pairs for the tags that you want to attach to the - session. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_SESSION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.session_metadata is not None: - _serialize_session_metadata_map( - serializer, - _SCHEMA_CREATE_SESSION_INPUT.members["sessionMetadata"], - self.session_metadata, - ) - - if self.encryption_key_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_SESSION_INPUT.members["encryptionKeyArn"], - self.encryption_key_arn, - ) - - if self.tags is not None: - _serialize_tags_map( - serializer, _SCHEMA_CREATE_SESSION_INPUT.members["tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["session_metadata"] = _deserialize_session_metadata_map( - de, _SCHEMA_CREATE_SESSION_INPUT.members["sessionMetadata"] - ) - - case 1: - kwargs["encryption_key_arn"] = de.read_string( - _SCHEMA_CREATE_SESSION_INPUT.members["encryptionKeyArn"] - ) - - case 2: - kwargs["tags"] = _deserialize_tags_map( - de, _SCHEMA_CREATE_SESSION_INPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_SESSION_INPUT, consumer=_consumer) - return kwargs - - -class SessionStatus(UnknownEnumMixin, StrEnum): - ACTIVE = "ACTIVE" - EXPIRED = "EXPIRED" - ENDED = "ENDED" - - -@dataclass(kw_only=True) -class CreateSessionOutput: - """Dataclass for CreateSessionOutput structure.""" - - session_id: str - """The unique identifier for the session.""" - - session_arn: str - """The Amazon Resource Name (ARN) of the created session.""" - - session_status: str - """The current status of the session.""" - - created_at: datetime - """The timestamp for when the session was created.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_SESSION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_SESSION_OUTPUT.members["sessionId"], self.session_id - ) - serializer.write_string( - _SCHEMA_CREATE_SESSION_OUTPUT.members["sessionArn"], self.session_arn - ) - serializer.write_string( - _SCHEMA_CREATE_SESSION_OUTPUT.members["sessionStatus"], self.session_status - ) - serializer.write_timestamp( - _SCHEMA_CREATE_SESSION_OUTPUT.members["createdAt"], self.created_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["session_id"] = de.read_string( - _SCHEMA_CREATE_SESSION_OUTPUT.members["sessionId"] - ) - - case 1: - kwargs["session_arn"] = de.read_string( - _SCHEMA_CREATE_SESSION_OUTPUT.members["sessionArn"] - ) - - case 2: - kwargs["session_status"] = SessionStatus( - de.read_string( - _SCHEMA_CREATE_SESSION_OUTPUT.members["sessionStatus"] - ) - ) - - case 3: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_CREATE_SESSION_OUTPUT.members["createdAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_SESSION_OUTPUT, consumer=_consumer) - if "session_id" not in kwargs: - kwargs["session_id"] = "" - if "session_arn" not in kwargs: - kwargs["session_arn"] = "" - if "session_status" not in kwargs: - kwargs["session_status"] = SessionStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -CREATE_SESSION = APIOperation( - input=CreateSessionInput, - output=CreateSessionOutput, - schema=_SCHEMA_CREATE_SESSION, - input_schema=_SCHEMA_CREATE_SESSION_INPUT, - output_schema=_SCHEMA_CREATE_SESSION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteSessionInput: - """Dataclass for DeleteSessionInput structure.""" - - session_identifier: str | None = None - """ - The unique identifier for the session to be deleted. You can specify - either the session's `sessionId` or its Amazon Resource Name (ARN). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_SESSION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.session_identifier is not None: - serializer.write_string( - _SCHEMA_DELETE_SESSION_INPUT.members["sessionIdentifier"], - self.session_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["session_identifier"] = de.read_string( - _SCHEMA_DELETE_SESSION_INPUT.members["sessionIdentifier"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_SESSION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteSessionOutput: - """Dataclass for DeleteSessionOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_SESSION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_SESSION_OUTPUT, consumer=_consumer) - return kwargs - - -DELETE_SESSION = APIOperation( - input=DeleteSessionInput, - output=DeleteSessionOutput, - schema=_SCHEMA_DELETE_SESSION, - input_schema=_SCHEMA_DELETE_SESSION_INPUT, - output_schema=_SCHEMA_DELETE_SESSION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class EndSessionInput: - """Dataclass for EndSessionInput structure.""" - - session_identifier: str | None = None - """ - The unique identifier for the session to end. You can specify either the - session's `sessionId` or its Amazon Resource Name (ARN). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_END_SESSION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.session_identifier is not None: - serializer.write_string( - _SCHEMA_END_SESSION_INPUT.members["sessionIdentifier"], - self.session_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["session_identifier"] = de.read_string( - _SCHEMA_END_SESSION_INPUT.members["sessionIdentifier"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_END_SESSION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class EndSessionOutput: - """Dataclass for EndSessionOutput structure.""" - - session_id: str - """The unique identifier of the session you ended.""" - - session_arn: str - """The Amazon Resource Name (ARN) of the session you ended.""" - - session_status: str - """The current status of the session you ended.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_END_SESSION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_END_SESSION_OUTPUT.members["sessionId"], self.session_id - ) - serializer.write_string( - _SCHEMA_END_SESSION_OUTPUT.members["sessionArn"], self.session_arn - ) - serializer.write_string( - _SCHEMA_END_SESSION_OUTPUT.members["sessionStatus"], self.session_status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["session_id"] = de.read_string( - _SCHEMA_END_SESSION_OUTPUT.members["sessionId"] - ) - - case 1: - kwargs["session_arn"] = de.read_string( - _SCHEMA_END_SESSION_OUTPUT.members["sessionArn"] - ) - - case 2: - kwargs["session_status"] = SessionStatus( - de.read_string( - _SCHEMA_END_SESSION_OUTPUT.members["sessionStatus"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_END_SESSION_OUTPUT, consumer=_consumer) - if "session_id" not in kwargs: - kwargs["session_id"] = "" - if "session_arn" not in kwargs: - kwargs["session_arn"] = "" - if "session_status" not in kwargs: - kwargs["session_status"] = SessionStatus._corrected("") - return kwargs - - -END_SESSION = APIOperation( - input=EndSessionInput, - output=EndSessionOutput, - schema=_SCHEMA_END_SESSION, - input_schema=_SCHEMA_END_SESSION_INPUT, - output_schema=_SCHEMA_END_SESSION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetSessionInput: - """Dataclass for GetSessionInput structure.""" - - session_identifier: str | None = None - """ - A unique identifier for the session to retrieve. You can specify either - the session's `sessionId` or its Amazon Resource Name (ARN). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_SESSION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.session_identifier is not None: - serializer.write_string( - _SCHEMA_GET_SESSION_INPUT.members["sessionIdentifier"], - self.session_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["session_identifier"] = de.read_string( - _SCHEMA_GET_SESSION_INPUT.members["sessionIdentifier"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_SESSION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetSessionOutput: - """Dataclass for GetSessionOutput structure.""" - - session_id: str - """The unique identifier for the session in UUID format.""" - - session_arn: str - """The Amazon Resource Name (ARN) of the session.""" - - session_status: str - """The current status of the session.""" - - created_at: datetime - """The timestamp for when the session was created.""" - - last_updated_at: datetime - """The timestamp for when the session was last modified.""" - - session_metadata: dict[str, str] | None = None - """ - A map of key-value pairs containing attributes persisted across the - session. - """ - - encryption_key_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the Key Management Service key used to - encrypt the session data. For more information, see [Amazon Bedrock - session - encryption](https://docs.aws.amazon.com/bedrock/latest/userguide/session-encryption.html). - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_SESSION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_SESSION_OUTPUT.members["sessionId"], self.session_id - ) - serializer.write_string( - _SCHEMA_GET_SESSION_OUTPUT.members["sessionArn"], self.session_arn - ) - serializer.write_string( - _SCHEMA_GET_SESSION_OUTPUT.members["sessionStatus"], self.session_status - ) - serializer.write_timestamp( - _SCHEMA_GET_SESSION_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_GET_SESSION_OUTPUT.members["lastUpdatedAt"], self.last_updated_at - ) - if self.session_metadata is not None: - _serialize_session_metadata_map( - serializer, - _SCHEMA_GET_SESSION_OUTPUT.members["sessionMetadata"], - self.session_metadata, - ) - - if self.encryption_key_arn is not None: - serializer.write_string( - _SCHEMA_GET_SESSION_OUTPUT.members["encryptionKeyArn"], - self.encryption_key_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["session_id"] = de.read_string( - _SCHEMA_GET_SESSION_OUTPUT.members["sessionId"] - ) - - case 1: - kwargs["session_arn"] = de.read_string( - _SCHEMA_GET_SESSION_OUTPUT.members["sessionArn"] - ) - - case 2: - kwargs["session_status"] = SessionStatus( - de.read_string( - _SCHEMA_GET_SESSION_OUTPUT.members["sessionStatus"] - ) - ) - - case 3: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_SESSION_OUTPUT.members["createdAt"] - ) - - case 4: - kwargs["last_updated_at"] = de.read_timestamp( - _SCHEMA_GET_SESSION_OUTPUT.members["lastUpdatedAt"] - ) - - case 5: - kwargs["session_metadata"] = _deserialize_session_metadata_map( - de, _SCHEMA_GET_SESSION_OUTPUT.members["sessionMetadata"] - ) - - case 6: - kwargs["encryption_key_arn"] = de.read_string( - _SCHEMA_GET_SESSION_OUTPUT.members["encryptionKeyArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_SESSION_OUTPUT, consumer=_consumer) - if "session_id" not in kwargs: - kwargs["session_id"] = "" - if "session_arn" not in kwargs: - kwargs["session_arn"] = "" - if "session_status" not in kwargs: - kwargs["session_status"] = SessionStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "last_updated_at" not in kwargs: - kwargs["last_updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -GET_SESSION = APIOperation( - input=GetSessionInput, - output=GetSessionOutput, - schema=_SCHEMA_GET_SESSION, - input_schema=_SCHEMA_GET_SESSION_INPUT, - output_schema=_SCHEMA_GET_SESSION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class CreateInvocationInput: - """Dataclass for CreateInvocationInput structure.""" - - invocation_id: str | None = None - """A unique identifier for the invocation in UUID format.""" - - description: str | None = None - """ - A description for the interactions in the invocation. For example, - \"User asking about weather in Seattle\". - """ - - session_identifier: str | None = None - """ - The unique identifier for the associated session for the invocation. You - can specify either the session's `sessionId` or its Amazon Resource - Name (ARN). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_INVOCATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.invocation_id is not None: - serializer.write_string( - _SCHEMA_CREATE_INVOCATION_INPUT.members["invocationId"], - self.invocation_id, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_INVOCATION_INPUT.members["description"], self.description - ) - - if self.session_identifier is not None: - serializer.write_string( - _SCHEMA_CREATE_INVOCATION_INPUT.members["sessionIdentifier"], - self.session_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["invocation_id"] = de.read_string( - _SCHEMA_CREATE_INVOCATION_INPUT.members["invocationId"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_INVOCATION_INPUT.members["description"] - ) - - case 2: - kwargs["session_identifier"] = de.read_string( - _SCHEMA_CREATE_INVOCATION_INPUT.members["sessionIdentifier"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_INVOCATION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CreateInvocationOutput: - """Dataclass for CreateInvocationOutput structure.""" - - session_id: str - """The unique identifier for the session associated with the invocation.""" - - invocation_id: str - """The unique identifier for the invocation.""" - - created_at: datetime - """The timestamp for when the invocation was created.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_INVOCATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_INVOCATION_OUTPUT.members["sessionId"], self.session_id - ) - serializer.write_string( - _SCHEMA_CREATE_INVOCATION_OUTPUT.members["invocationId"], self.invocation_id - ) - serializer.write_timestamp( - _SCHEMA_CREATE_INVOCATION_OUTPUT.members["createdAt"], self.created_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["session_id"] = de.read_string( - _SCHEMA_CREATE_INVOCATION_OUTPUT.members["sessionId"] - ) - - case 1: - kwargs["invocation_id"] = de.read_string( - _SCHEMA_CREATE_INVOCATION_OUTPUT.members["invocationId"] - ) - - case 2: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_CREATE_INVOCATION_OUTPUT.members["createdAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_INVOCATION_OUTPUT, consumer=_consumer) - if "session_id" not in kwargs: - kwargs["session_id"] = "" - if "invocation_id" not in kwargs: - kwargs["invocation_id"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -CREATE_INVOCATION = APIOperation( - input=CreateInvocationInput, - output=CreateInvocationOutput, - schema=_SCHEMA_CREATE_INVOCATION, - input_schema=_SCHEMA_CREATE_INVOCATION_INPUT, - output_schema=_SCHEMA_CREATE_INVOCATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListInvocationsInput: - """Dataclass for ListInvocationsInput structure.""" - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, enter the token returned in the `nextToken` - field in the response in this field to return the next batch of results. - """ - - max_results: int = 10 - """ - The maximum number of results to return in the response. If the total - number of results is greater than this value, use the token returned in - the response in the `nextToken` field when making another request to - return the next batch of results. - """ - - session_identifier: str | None = None - """ - The unique identifier for the session to list invocations for. You can - specify either the session's `sessionId` or its Amazon Resource Name - (ARN). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_INVOCATIONS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_INVOCATIONS_INPUT.members["nextToken"], self.next_token - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_INVOCATIONS_INPUT.members["maxResults"], self.max_results - ) - - if self.session_identifier is not None: - serializer.write_string( - _SCHEMA_LIST_INVOCATIONS_INPUT.members["sessionIdentifier"], - self.session_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_INVOCATIONS_INPUT.members["nextToken"] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_INVOCATIONS_INPUT.members["maxResults"] - ) - - case 2: - kwargs["session_identifier"] = de.read_string( - _SCHEMA_LIST_INVOCATIONS_INPUT.members["sessionIdentifier"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_INVOCATIONS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class InvocationSummary: - """ - Contains details about an invocation in a session. For more information - about sessions, see [Store and retrieve conversation history and context - with Amazon Bedrock - sessions](https://docs.aws.amazon.com/bedrock/latest/userguide/sessions.html). - """ - - session_id: str - """The unique identifier for the session associated with the invocation.""" - - invocation_id: str - """A unique identifier for the invocation in UUID format.""" - - created_at: datetime - """The timestamp for when the invocation was created.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOCATION_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_INVOCATION_SUMMARY.members["sessionId"], self.session_id - ) - serializer.write_string( - _SCHEMA_INVOCATION_SUMMARY.members["invocationId"], self.invocation_id - ) - serializer.write_timestamp( - _SCHEMA_INVOCATION_SUMMARY.members["createdAt"], self.created_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["session_id"] = de.read_string( - _SCHEMA_INVOCATION_SUMMARY.members["sessionId"] - ) - - case 1: - kwargs["invocation_id"] = de.read_string( - _SCHEMA_INVOCATION_SUMMARY.members["invocationId"] - ) - - case 2: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_INVOCATION_SUMMARY.members["createdAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INVOCATION_SUMMARY, consumer=_consumer) - if "session_id" not in kwargs: - kwargs["session_id"] = "" - if "invocation_id" not in kwargs: - kwargs["invocation_id"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_invocation_summaries( - serializer: ShapeSerializer, schema: Schema, value: list[InvocationSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_invocation_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[InvocationSummary]: - result: list[InvocationSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(InvocationSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListInvocationsOutput: - """Dataclass for ListInvocationsOutput structure.""" - - invocation_summaries: list[InvocationSummary] - """A list of invocation summaries associated with the session.""" - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, use this token when making another request in - the `nextToken` field to return the next batch of results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_INVOCATIONS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_invocation_summaries( - serializer, - _SCHEMA_LIST_INVOCATIONS_OUTPUT.members["invocationSummaries"], - self.invocation_summaries, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_INVOCATIONS_OUTPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["invocation_summaries"] = _deserialize_invocation_summaries( - de, - _SCHEMA_LIST_INVOCATIONS_OUTPUT.members["invocationSummaries"], - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_INVOCATIONS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_INVOCATIONS_OUTPUT, consumer=_consumer) - if "invocation_summaries" not in kwargs: - kwargs["invocation_summaries"] = [] - return kwargs - - -LIST_INVOCATIONS = APIOperation( - input=ListInvocationsInput, - output=ListInvocationsOutput, - schema=_SCHEMA_LIST_INVOCATIONS, - input_schema=_SCHEMA_LIST_INVOCATIONS_INPUT, - output_schema=_SCHEMA_LIST_INVOCATIONS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetInvocationStepInput: - """Dataclass for GetInvocationStepInput structure.""" - - invocation_identifier: str | None = None - """The unique identifier for the invocation in UUID format.""" - - invocation_step_id: str | None = None - """ - The unique identifier (in UUID format) for the specific invocation step - to retrieve. - """ - - session_identifier: str | None = None - """ - The unique identifier for the invocation step's associated session. You - can specify either the session's `sessionId` or its Amazon Resource - Name (ARN). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_INVOCATION_STEP_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.invocation_identifier is not None: - serializer.write_string( - _SCHEMA_GET_INVOCATION_STEP_INPUT.members["invocationIdentifier"], - self.invocation_identifier, - ) - - if self.invocation_step_id is not None: - serializer.write_string( - _SCHEMA_GET_INVOCATION_STEP_INPUT.members["invocationStepId"], - self.invocation_step_id, - ) - - if self.session_identifier is not None: - serializer.write_string( - _SCHEMA_GET_INVOCATION_STEP_INPUT.members["sessionIdentifier"], - self.session_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["invocation_identifier"] = de.read_string( - _SCHEMA_GET_INVOCATION_STEP_INPUT.members[ - "invocationIdentifier" - ] - ) - - case 1: - kwargs["invocation_step_id"] = de.read_string( - _SCHEMA_GET_INVOCATION_STEP_INPUT.members["invocationStepId"] - ) - - case 2: - kwargs["session_identifier"] = de.read_string( - _SCHEMA_GET_INVOCATION_STEP_INPUT.members["sessionIdentifier"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_INVOCATION_STEP_INPUT, consumer=_consumer) - return kwargs - - -class ImageFormat(UnknownEnumMixin, StrEnum): - PNG = "png" - JPEG = "jpeg" - GIF = "gif" - WEBP = "webp" - - -@dataclass(kw_only=True) -class S3Location: - """Information about the Amazon S3 bucket where the image is stored.""" - - uri: str - """The path to the Amazon S3 bucket where the image is stored.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_S3_LOCATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_S3_LOCATION.members["uri"], self.uri) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["uri"] = de.read_string(_SCHEMA_S3_LOCATION.members["uri"]) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_S3_LOCATION, consumer=_consumer) - if "uri" not in kwargs: - kwargs["uri"] = "" - return kwargs - - -@dataclass -class ImageSourceBytes: - """ - The raw image bytes for the image. If you use an Amazon Web Services - SDK, you don't need to encode the image bytes in base64. - """ - - value: bytes - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IMAGE_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_blob(_SCHEMA_IMAGE_SOURCE.members["bytes"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=deserializer.read_blob(_SCHEMA_IMAGE_SOURCE.members["bytes"])) - - -@dataclass -class ImageSourceS3Location: - """The path to the Amazon S3 bucket where the image is stored.""" - - value: S3Location - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IMAGE_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IMAGE_SOURCE.members["s3Location"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=S3Location.deserialize(deserializer)) - - -@dataclass -class ImageSourceUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ImageSource = Union[ImageSourceBytes | ImageSourceS3Location | ImageSourceUnknown] -"""The source for an image.""" - - -class _ImageSourceDeserializer: - _result: ImageSource | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> ImageSource: - self._result = None - deserializer.read_struct(_SCHEMA_IMAGE_SOURCE, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(ImageSourceBytes.deserialize(de)) - - case 1: - self._set_result(ImageSourceS3Location.deserialize(de)) - - case _: - self._set_result(ImageSourceUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: ImageSource) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class ImageBlock: - """Image content for an invocation step.""" - - format: str - """The format of the image.""" - - source: ImageSource - """The source for the image.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IMAGE_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_IMAGE_BLOCK.members["format"], self.format) - serializer.write_struct(_SCHEMA_IMAGE_BLOCK.members["source"], self.source) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["format"] = ImageFormat( - de.read_string(_SCHEMA_IMAGE_BLOCK.members["format"]) - ) - - case 1: - kwargs["source"] = _ImageSourceDeserializer().deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_IMAGE_BLOCK, consumer=_consumer) - if "format" not in kwargs: - kwargs["format"] = ImageFormat._corrected("") - if "source" not in kwargs: - kwargs["source"] = ImageSourceUnknown(tag="") - return kwargs - - -@dataclass -class BedrockSessionContentBlockText: - """The text in the invocation step.""" - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BEDROCK_SESSION_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_BEDROCK_SESSION_CONTENT_BLOCK.members["text"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string( - _SCHEMA_BEDROCK_SESSION_CONTENT_BLOCK.members["text"] - ) - ) - - -@dataclass -class BedrockSessionContentBlockImage: - """The image in the invocation step.""" - - value: ImageBlock - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BEDROCK_SESSION_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_BEDROCK_SESSION_CONTENT_BLOCK.members["image"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ImageBlock.deserialize(deserializer)) - - -@dataclass -class BedrockSessionContentBlockUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -BedrockSessionContentBlock = Union[ - BedrockSessionContentBlockText - | BedrockSessionContentBlockImage - | BedrockSessionContentBlockUnknown -] -""" -A block of content that you pass to, or receive from, a Amazon Bedrock -session in an invocation step. You pass the content to a session in the -`payLoad` of the -[PutInvocationStep](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_PutInvocationStep.html) -API operation. You retrieve the content with the -[GetInvocationStep](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_GetInvocationStep.html) -API operation. - -For more information about sessions, see [Store and retrieve -conversation history and context with Amazon Bedrock -sessions](https://docs.aws.amazon.com/bedrock/latest/userguide/sessions.html). -""" - - -class _BedrockSessionContentBlockDeserializer: - _result: BedrockSessionContentBlock | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> BedrockSessionContentBlock: - self._result = None - deserializer.read_struct(_SCHEMA_BEDROCK_SESSION_CONTENT_BLOCK, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(BedrockSessionContentBlockText.deserialize(de)) - - case 1: - self._set_result(BedrockSessionContentBlockImage.deserialize(de)) - - case _: - self._set_result( - BedrockSessionContentBlockUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: BedrockSessionContentBlock) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_bedrock_session_content_blocks( - serializer: ShapeSerializer, schema: Schema, value: list[BedrockSessionContentBlock] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_bedrock_session_content_blocks( - deserializer: ShapeDeserializer, schema: Schema -) -> list[BedrockSessionContentBlock]: - result: list[BedrockSessionContentBlock] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_BedrockSessionContentBlockDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass -class InvocationStepPayloadContentBlocks: - """The content for the invocation step.""" - - value: list[BedrockSessionContentBlock] - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOCATION_STEP_PAYLOAD, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_bedrock_session_content_blocks( - serializer, - _SCHEMA_INVOCATION_STEP_PAYLOAD.members["contentBlocks"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_deserialize_bedrock_session_content_blocks( - deserializer, _SCHEMA_INVOCATION_STEP_PAYLOAD.members["contentBlocks"] - ) - ) - - -@dataclass -class InvocationStepPayloadUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -InvocationStepPayload = Union[ - InvocationStepPayloadContentBlocks | InvocationStepPayloadUnknown -] -"""Payload content, such as text and images, for the invocation step.""" - - -class _InvocationStepPayloadDeserializer: - _result: InvocationStepPayload | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> InvocationStepPayload: - self._result = None - deserializer.read_struct(_SCHEMA_INVOCATION_STEP_PAYLOAD, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(InvocationStepPayloadContentBlocks.deserialize(de)) - - case _: - self._set_result( - InvocationStepPayloadUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: InvocationStepPayload) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class InvocationStep: - """ - Stores fine-grained state checkpoints, including text and images, for - each interaction in an invocation in a session. For more information - about sessions, see [Store and retrieve conversation history and context - with Amazon Bedrock - sessions](https://docs.aws.amazon.com/bedrock/latest/userguide/sessions.html). - """ - - session_id: str - """The unique identifier of the session containing the invocation step.""" - - invocation_id: str - """ - The unique identifier (in UUID format) for the invocation that includes - the invocation step. - """ - - invocation_step_id: str - """The unique identifier (in UUID format) for the invocation step.""" - - invocation_step_time: datetime - """The timestamp for when the invocation step was created.""" - - payload: InvocationStepPayload - """Payload content, such as text and images, for the invocation step.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOCATION_STEP, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_INVOCATION_STEP.members["sessionId"], self.session_id - ) - serializer.write_string( - _SCHEMA_INVOCATION_STEP.members["invocationId"], self.invocation_id - ) - serializer.write_string( - _SCHEMA_INVOCATION_STEP.members["invocationStepId"], self.invocation_step_id - ) - serializer.write_timestamp( - _SCHEMA_INVOCATION_STEP.members["invocationStepTime"], - self.invocation_step_time, - ) - serializer.write_struct( - _SCHEMA_INVOCATION_STEP.members["payload"], self.payload - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["session_id"] = de.read_string( - _SCHEMA_INVOCATION_STEP.members["sessionId"] - ) - - case 1: - kwargs["invocation_id"] = de.read_string( - _SCHEMA_INVOCATION_STEP.members["invocationId"] - ) - - case 2: - kwargs["invocation_step_id"] = de.read_string( - _SCHEMA_INVOCATION_STEP.members["invocationStepId"] - ) - - case 3: - kwargs["invocation_step_time"] = de.read_timestamp( - _SCHEMA_INVOCATION_STEP.members["invocationStepTime"] - ) - - case 4: - kwargs["payload"] = ( - _InvocationStepPayloadDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INVOCATION_STEP, consumer=_consumer) - if "session_id" not in kwargs: - kwargs["session_id"] = "" - if "invocation_id" not in kwargs: - kwargs["invocation_id"] = "" - if "invocation_step_id" not in kwargs: - kwargs["invocation_step_id"] = "" - if "invocation_step_time" not in kwargs: - kwargs["invocation_step_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "payload" not in kwargs: - kwargs["payload"] = InvocationStepPayloadUnknown(tag="") - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls( - session_id="", - invocation_id="", - invocation_step_id="", - invocation_step_time=datetime.fromtimestamp(0, tz=timezone.utc), - payload=InvocationStepPayloadUnknown(tag=""), - ) - - -@dataclass(kw_only=True) -class GetInvocationStepOutput: - """Dataclass for GetInvocationStepOutput structure.""" - - invocation_step: InvocationStep - """The complete details of the requested invocation step.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_INVOCATION_STEP_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_INVOCATION_STEP_OUTPUT.members["invocationStep"], - self.invocation_step, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["invocation_step"] = InvocationStep.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_INVOCATION_STEP_OUTPUT, consumer=_consumer) - if "invocation_step" not in kwargs: - kwargs["invocation_step"] = InvocationStep._smithy_default() - return kwargs - - -GET_INVOCATION_STEP = APIOperation( - input=GetInvocationStepInput, - output=GetInvocationStepOutput, - schema=_SCHEMA_GET_INVOCATION_STEP, - input_schema=_SCHEMA_GET_INVOCATION_STEP_INPUT, - output_schema=_SCHEMA_GET_INVOCATION_STEP_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListInvocationStepsInput: - """Dataclass for ListInvocationStepsInput structure.""" - - invocation_identifier: str | None = None - """ - The unique identifier (in UUID format) for the invocation to list - invocation steps for. - """ - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, enter the token returned in the `nextToken` - field in the response in this field to return the next batch of results. - """ - - max_results: int = 10 - """ - The maximum number of results to return in the response. If the total - number of results is greater than this value, use the token returned in - the response in the `nextToken` field when making another request to - return the next batch of results. - """ - - session_identifier: str | None = None - """ - The unique identifier for the session associated with the invocation - steps. You can specify either the session's `sessionId` or its Amazon - Resource Name (ARN). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_INVOCATION_STEPS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.invocation_identifier is not None: - serializer.write_string( - _SCHEMA_LIST_INVOCATION_STEPS_INPUT.members["invocationIdentifier"], - self.invocation_identifier, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_INVOCATION_STEPS_INPUT.members["nextToken"], - self.next_token, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_INVOCATION_STEPS_INPUT.members["maxResults"], - self.max_results, - ) - - if self.session_identifier is not None: - serializer.write_string( - _SCHEMA_LIST_INVOCATION_STEPS_INPUT.members["sessionIdentifier"], - self.session_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["invocation_identifier"] = de.read_string( - _SCHEMA_LIST_INVOCATION_STEPS_INPUT.members[ - "invocationIdentifier" - ] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_INVOCATION_STEPS_INPUT.members["nextToken"] - ) - - case 2: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_INVOCATION_STEPS_INPUT.members["maxResults"] - ) - - case 3: - kwargs["session_identifier"] = de.read_string( - _SCHEMA_LIST_INVOCATION_STEPS_INPUT.members["sessionIdentifier"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_INVOCATION_STEPS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InvocationStepSummary: - """ - Contains details about an invocation step within an invocation in a - session. For more information about sessions, see [Store and retrieve - conversation history and context with Amazon Bedrock - sessions](https://docs.aws.amazon.com/bedrock/latest/userguide/sessions.html). - """ - - session_id: str - """ - The unique identifier for the session associated with the invocation - step. - """ - - invocation_id: str - """A unique identifier for the invocation in UUID format.""" - - invocation_step_id: str - """The unique identifier (in UUID format) for the invocation step.""" - - invocation_step_time: datetime - """The timestamp for when the invocation step was created.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOCATION_STEP_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_INVOCATION_STEP_SUMMARY.members["sessionId"], self.session_id - ) - serializer.write_string( - _SCHEMA_INVOCATION_STEP_SUMMARY.members["invocationId"], self.invocation_id - ) - serializer.write_string( - _SCHEMA_INVOCATION_STEP_SUMMARY.members["invocationStepId"], - self.invocation_step_id, - ) - serializer.write_timestamp( - _SCHEMA_INVOCATION_STEP_SUMMARY.members["invocationStepTime"], - self.invocation_step_time, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["session_id"] = de.read_string( - _SCHEMA_INVOCATION_STEP_SUMMARY.members["sessionId"] - ) - - case 1: - kwargs["invocation_id"] = de.read_string( - _SCHEMA_INVOCATION_STEP_SUMMARY.members["invocationId"] - ) - - case 2: - kwargs["invocation_step_id"] = de.read_string( - _SCHEMA_INVOCATION_STEP_SUMMARY.members["invocationStepId"] - ) - - case 3: - kwargs["invocation_step_time"] = de.read_timestamp( - _SCHEMA_INVOCATION_STEP_SUMMARY.members["invocationStepTime"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INVOCATION_STEP_SUMMARY, consumer=_consumer) - if "session_id" not in kwargs: - kwargs["session_id"] = "" - if "invocation_id" not in kwargs: - kwargs["invocation_id"] = "" - if "invocation_step_id" not in kwargs: - kwargs["invocation_step_id"] = "" - if "invocation_step_time" not in kwargs: - kwargs["invocation_step_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_invocation_step_summaries( - serializer: ShapeSerializer, schema: Schema, value: list[InvocationStepSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_invocation_step_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[InvocationStepSummary]: - result: list[InvocationStepSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(InvocationStepSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListInvocationStepsOutput: - """Dataclass for ListInvocationStepsOutput structure.""" - - invocation_step_summaries: list[InvocationStepSummary] - """ - A list of summaries for each invocation step associated with a session - and if you specified it, an invocation within the session. - """ - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, use this token when making another request in - the `nextToken` field to return the next batch of results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_INVOCATION_STEPS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_invocation_step_summaries( - serializer, - _SCHEMA_LIST_INVOCATION_STEPS_OUTPUT.members["invocationStepSummaries"], - self.invocation_step_summaries, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_INVOCATION_STEPS_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["invocation_step_summaries"] = ( - _deserialize_invocation_step_summaries( - de, - _SCHEMA_LIST_INVOCATION_STEPS_OUTPUT.members[ - "invocationStepSummaries" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_INVOCATION_STEPS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_INVOCATION_STEPS_OUTPUT, consumer=_consumer - ) - if "invocation_step_summaries" not in kwargs: - kwargs["invocation_step_summaries"] = [] - return kwargs - - -LIST_INVOCATION_STEPS = APIOperation( - input=ListInvocationStepsInput, - output=ListInvocationStepsOutput, - schema=_SCHEMA_LIST_INVOCATION_STEPS, - input_schema=_SCHEMA_LIST_INVOCATION_STEPS_INPUT, - output_schema=_SCHEMA_LIST_INVOCATION_STEPS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class PutInvocationStepInput: - """Dataclass for PutInvocationStepInput structure.""" - - session_identifier: str | None = None - """ - The unique identifier for the session to add the invocation step to. You - can specify either the session's `sessionId` or its Amazon Resource - Name (ARN). - """ - - invocation_identifier: str | None = None - """ - The unique identifier (in UUID format) of the invocation to add the - invocation step to. - """ - - invocation_step_time: datetime | None = None - """The timestamp for when the invocation step occurred.""" - - payload: InvocationStepPayload | None = None - """ - The payload for the invocation step, including text and images for the - interaction. - """ - - invocation_step_id: str | None = None - """The unique identifier of the invocation step in UUID format.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_INVOCATION_STEP_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.session_identifier is not None: - serializer.write_string( - _SCHEMA_PUT_INVOCATION_STEP_INPUT.members["sessionIdentifier"], - self.session_identifier, - ) - - if self.invocation_identifier is not None: - serializer.write_string( - _SCHEMA_PUT_INVOCATION_STEP_INPUT.members["invocationIdentifier"], - self.invocation_identifier, - ) - - if self.invocation_step_time is not None: - serializer.write_timestamp( - _SCHEMA_PUT_INVOCATION_STEP_INPUT.members["invocationStepTime"], - self.invocation_step_time, - ) - - if self.payload is not None: - serializer.write_struct( - _SCHEMA_PUT_INVOCATION_STEP_INPUT.members["payload"], self.payload - ) - - if self.invocation_step_id is not None: - serializer.write_string( - _SCHEMA_PUT_INVOCATION_STEP_INPUT.members["invocationStepId"], - self.invocation_step_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["session_identifier"] = de.read_string( - _SCHEMA_PUT_INVOCATION_STEP_INPUT.members["sessionIdentifier"] - ) - - case 1: - kwargs["invocation_identifier"] = de.read_string( - _SCHEMA_PUT_INVOCATION_STEP_INPUT.members[ - "invocationIdentifier" - ] - ) - - case 2: - kwargs["invocation_step_time"] = de.read_timestamp( - _SCHEMA_PUT_INVOCATION_STEP_INPUT.members["invocationStepTime"] - ) - - case 3: - kwargs["payload"] = ( - _InvocationStepPayloadDeserializer().deserialize(de) - ) - - case 4: - kwargs["invocation_step_id"] = de.read_string( - _SCHEMA_PUT_INVOCATION_STEP_INPUT.members["invocationStepId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUT_INVOCATION_STEP_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class PutInvocationStepOutput: - """Dataclass for PutInvocationStepOutput structure.""" - - invocation_step_id: str - """The unique identifier of the invocation step in UUID format.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_INVOCATION_STEP_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_PUT_INVOCATION_STEP_OUTPUT.members["invocationStepId"], - self.invocation_step_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["invocation_step_id"] = de.read_string( - _SCHEMA_PUT_INVOCATION_STEP_OUTPUT.members["invocationStepId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUT_INVOCATION_STEP_OUTPUT, consumer=_consumer) - if "invocation_step_id" not in kwargs: - kwargs["invocation_step_id"] = "" - return kwargs - - -PUT_INVOCATION_STEP = APIOperation( - input=PutInvocationStepInput, - output=PutInvocationStepOutput, - schema=_SCHEMA_PUT_INVOCATION_STEP, - input_schema=_SCHEMA_PUT_INVOCATION_STEP_INPUT, - output_schema=_SCHEMA_PUT_INVOCATION_STEP_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListSessionsInput: - """Dataclass for ListSessionsInput structure.""" - - max_results: int = 10 - """ - The maximum number of results to return in the response. If the total - number of results is greater than this value, use the token returned in - the response in the `nextToken` field when making another request to - return the next batch of results. - """ - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, enter the token returned in the `nextToken` - field in the response in this field to return the next batch of results. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_SESSIONS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_SESSIONS_INPUT.members["maxResults"], self.max_results - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_SESSIONS_INPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_SESSIONS_INPUT.members["maxResults"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_SESSIONS_INPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_SESSIONS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class SessionSummary: - """ - Contains details about a session. For more information about sessions, - see [Store and retrieve conversation history and context with Amazon - Bedrock - sessions](https://docs.aws.amazon.com/bedrock/latest/userguide/sessions.html). - """ - - session_id: str - """The unique identifier for the session.""" - - session_arn: str - """The Amazon Resource Name (ARN) of the session.""" - - session_status: str - """The current status of the session.""" - - created_at: datetime - """The timestamp for when the session was created.""" - - last_updated_at: datetime - """The timestamp for when the session was last modified.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SESSION_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SESSION_SUMMARY.members["sessionId"], self.session_id - ) - serializer.write_string( - _SCHEMA_SESSION_SUMMARY.members["sessionArn"], self.session_arn - ) - serializer.write_string( - _SCHEMA_SESSION_SUMMARY.members["sessionStatus"], self.session_status - ) - serializer.write_timestamp( - _SCHEMA_SESSION_SUMMARY.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_SESSION_SUMMARY.members["lastUpdatedAt"], self.last_updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["session_id"] = de.read_string( - _SCHEMA_SESSION_SUMMARY.members["sessionId"] - ) - - case 1: - kwargs["session_arn"] = de.read_string( - _SCHEMA_SESSION_SUMMARY.members["sessionArn"] - ) - - case 2: - kwargs["session_status"] = SessionStatus( - de.read_string(_SCHEMA_SESSION_SUMMARY.members["sessionStatus"]) - ) - - case 3: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_SESSION_SUMMARY.members["createdAt"] - ) - - case 4: - kwargs["last_updated_at"] = de.read_timestamp( - _SCHEMA_SESSION_SUMMARY.members["lastUpdatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SESSION_SUMMARY, consumer=_consumer) - if "session_id" not in kwargs: - kwargs["session_id"] = "" - if "session_arn" not in kwargs: - kwargs["session_arn"] = "" - if "session_status" not in kwargs: - kwargs["session_status"] = SessionStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "last_updated_at" not in kwargs: - kwargs["last_updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_session_summaries( - serializer: ShapeSerializer, schema: Schema, value: list[SessionSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_session_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[SessionSummary]: - result: list[SessionSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(SessionSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListSessionsOutput: - """Dataclass for ListSessionsOutput structure.""" - - session_summaries: list[SessionSummary] - """ - A list of summaries for each session in your Amazon Web Services - account. - """ - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, use this token when making another request in - the `nextToken` field to return the next batch of results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_SESSIONS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_session_summaries( - serializer, - _SCHEMA_LIST_SESSIONS_OUTPUT.members["sessionSummaries"], - self.session_summaries, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_SESSIONS_OUTPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["session_summaries"] = _deserialize_session_summaries( - de, _SCHEMA_LIST_SESSIONS_OUTPUT.members["sessionSummaries"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_SESSIONS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_SESSIONS_OUTPUT, consumer=_consumer) - if "session_summaries" not in kwargs: - kwargs["session_summaries"] = [] - return kwargs - - -LIST_SESSIONS = APIOperation( - input=ListSessionsInput, - output=ListSessionsOutput, - schema=_SCHEMA_LIST_SESSIONS, - input_schema=_SCHEMA_LIST_SESSIONS_INPUT, - output_schema=_SCHEMA_LIST_SESSIONS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateSessionInput: - """Dataclass for UpdateSessionInput structure.""" - - session_metadata: dict[str, str] | None = None - """ - A map of key-value pairs containing attributes to be persisted across - the session. For example the user's ID, their language preference, and - the type of device they are using. - """ - - session_identifier: str | None = None - """ - The unique identifier of the session to modify. You can specify either - the session's `sessionId` or its Amazon Resource Name (ARN). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_SESSION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.session_metadata is not None: - _serialize_session_metadata_map( - serializer, - _SCHEMA_UPDATE_SESSION_INPUT.members["sessionMetadata"], - self.session_metadata, - ) - - if self.session_identifier is not None: - serializer.write_string( - _SCHEMA_UPDATE_SESSION_INPUT.members["sessionIdentifier"], - self.session_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["session_metadata"] = _deserialize_session_metadata_map( - de, _SCHEMA_UPDATE_SESSION_INPUT.members["sessionMetadata"] - ) - - case 1: - kwargs["session_identifier"] = de.read_string( - _SCHEMA_UPDATE_SESSION_INPUT.members["sessionIdentifier"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_SESSION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateSessionOutput: - """Dataclass for UpdateSessionOutput structure.""" - - session_id: str - """The unique identifier of the session you updated.""" - - session_arn: str - """The Amazon Resource Name (ARN) of the session that was updated.""" - - session_status: str - """The status of the session you updated.""" - - created_at: datetime - """The timestamp for when the session was created.""" - - last_updated_at: datetime - """The timestamp for when the session was last modified.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_SESSION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_UPDATE_SESSION_OUTPUT.members["sessionId"], self.session_id - ) - serializer.write_string( - _SCHEMA_UPDATE_SESSION_OUTPUT.members["sessionArn"], self.session_arn - ) - serializer.write_string( - _SCHEMA_UPDATE_SESSION_OUTPUT.members["sessionStatus"], self.session_status - ) - serializer.write_timestamp( - _SCHEMA_UPDATE_SESSION_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_UPDATE_SESSION_OUTPUT.members["lastUpdatedAt"], self.last_updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["session_id"] = de.read_string( - _SCHEMA_UPDATE_SESSION_OUTPUT.members["sessionId"] - ) - - case 1: - kwargs["session_arn"] = de.read_string( - _SCHEMA_UPDATE_SESSION_OUTPUT.members["sessionArn"] - ) - - case 2: - kwargs["session_status"] = SessionStatus( - de.read_string( - _SCHEMA_UPDATE_SESSION_OUTPUT.members["sessionStatus"] - ) - ) - - case 3: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_UPDATE_SESSION_OUTPUT.members["createdAt"] - ) - - case 4: - kwargs["last_updated_at"] = de.read_timestamp( - _SCHEMA_UPDATE_SESSION_OUTPUT.members["lastUpdatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_SESSION_OUTPUT, consumer=_consumer) - if "session_id" not in kwargs: - kwargs["session_id"] = "" - if "session_arn" not in kwargs: - kwargs["session_arn"] = "" - if "session_status" not in kwargs: - kwargs["session_status"] = SessionStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "last_updated_at" not in kwargs: - kwargs["last_updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -UPDATE_SESSION = APIOperation( - input=UpdateSessionInput, - output=UpdateSessionOutput, - schema=_SCHEMA_UPDATE_SESSION, - input_schema=_SCHEMA_UPDATE_SESSION_INPUT, - output_schema=_SCHEMA_UPDATE_SESSION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListTagsForResourceInput: - """Dataclass for ListTagsForResourceInput structure.""" - - resource_arn: str | None = None - """The Amazon Resource Name (ARN) of the resource for which to list tags.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT.members["resourceArn"], - self.resource_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT.members["resourceArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ListTagsForResourceOutput: - """Dataclass for ListTagsForResourceOutput structure.""" - - tags: dict[str, str] | None = None - """The key-value pairs for the tags associated with the resource.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.tags is not None: - _serialize_tags_map( - serializer, - _SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT.members["tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["tags"] = _deserialize_tags_map( - de, _SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_TAGS_FOR_RESOURCE = APIOperation( - input=ListTagsForResourceInput, - output=ListTagsForResourceOutput, - schema=_SCHEMA_LIST_TAGS_FOR_RESOURCE, - input_schema=_SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT, - output_schema=_SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class TagResourceInput: - """Dataclass for TagResourceInput structure.""" - - resource_arn: str | None = None - """The Amazon Resource Name (ARN) of the resource to tag.""" - - tags: dict[str, str] | None = None - """ - An object containing key-value pairs that define the tags to attach to - the resource. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TAG_RESOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_TAG_RESOURCE_INPUT.members["resourceArn"], self.resource_arn - ) - - if self.tags is not None: - _serialize_tags_map( - serializer, _SCHEMA_TAG_RESOURCE_INPUT.members["tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_TAG_RESOURCE_INPUT.members["resourceArn"] - ) - - case 1: - kwargs["tags"] = _deserialize_tags_map( - de, _SCHEMA_TAG_RESOURCE_INPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TAG_RESOURCE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class TagResourceOutput: - """Dataclass for TagResourceOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TAG_RESOURCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TAG_RESOURCE_OUTPUT, consumer=_consumer) - return kwargs - - -TAG_RESOURCE = APIOperation( - input=TagResourceInput, - output=TagResourceOutput, - schema=_SCHEMA_TAG_RESOURCE, - input_schema=_SCHEMA_TAG_RESOURCE_INPUT, - output_schema=_SCHEMA_TAG_RESOURCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -def _serialize_tag_key_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_tag_key_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class UntagResourceInput: - """Dataclass for UntagResourceInput structure.""" - - resource_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the resource from which to remove - tags. - """ - - tag_keys: list[str] | None = None - """A list of keys of the tags to remove from the resource.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNTAG_RESOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_UNTAG_RESOURCE_INPUT.members["resourceArn"], self.resource_arn - ) - - if self.tag_keys is not None: - _serialize_tag_key_list( - serializer, - _SCHEMA_UNTAG_RESOURCE_INPUT.members["tagKeys"], - self.tag_keys, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_UNTAG_RESOURCE_INPUT.members["resourceArn"] - ) - - case 1: - kwargs["tag_keys"] = _deserialize_tag_key_list( - de, _SCHEMA_UNTAG_RESOURCE_INPUT.members["tagKeys"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UNTAG_RESOURCE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UntagResourceOutput: - """Dataclass for UntagResourceOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNTAG_RESOURCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UNTAG_RESOURCE_OUTPUT, consumer=_consumer) - return kwargs - - -UNTAG_RESOURCE = APIOperation( - input=UntagResourceInput, - output=UntagResourceOutput, - schema=_SCHEMA_UNTAG_RESOURCE, - input_schema=_SCHEMA_UNTAG_RESOURCE_INPUT, - output_schema=_SCHEMA_UNTAG_RESOURCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass -class RetrievalFilterEquals: - """ - Knowledge base data sources are returned if they contain a metadata - attribute whose name matches the `key` and whose value matches the - `value` in this object. - - The following example would return data sources with an `animal` - attribute whose value is `cat`: - - `"equals": { "key": "animal", "value": "cat" }` - """ - - value: FilterAttribute - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVAL_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVAL_FILTER.members["equals"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=FilterAttribute.deserialize(deserializer)) - - -@dataclass -class RetrievalFilterNotEquals: - """ - Knowledge base data sources are returned when: - - - It contains a metadata attribute whose name matches the `key` and - whose value doesn't match the `value` in this object. - - - The key is not present in the document. - - The following example would return data sources that don't contain an - `animal` attribute whose value is `cat`. - - `"notEquals": { "key": "animal", "value": "cat" }` - """ - - value: FilterAttribute - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVAL_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RETRIEVAL_FILTER.members["notEquals"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=FilterAttribute.deserialize(deserializer)) - - -@dataclass -class RetrievalFilterGreaterThan: - """ - Knowledge base data sources are returned if they contain a metadata - attribute whose name matches the `key` and whose value is greater than - the `value` in this object. - - The following example would return data sources with an `year` attribute - whose value is greater than `1989`: - - `"greaterThan": { "key": "year", "value": 1989 }` - """ - - value: FilterAttribute - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVAL_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RETRIEVAL_FILTER.members["greaterThan"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=FilterAttribute.deserialize(deserializer)) - - -@dataclass -class RetrievalFilterGreaterThanOrEquals: - """ - Knowledge base data sources are returned if they contain a metadata - attribute whose name matches the `key` and whose value is greater than - or equal to the `value` in this object. - - The following example would return data sources with an `year` attribute - whose value is greater than or equal to `1989`: - - `"greaterThanOrEquals": { "key": "year", "value": 1989 }` - """ - - value: FilterAttribute - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVAL_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RETRIEVAL_FILTER.members["greaterThanOrEquals"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=FilterAttribute.deserialize(deserializer)) - - -@dataclass -class RetrievalFilterLessThan: - """ - Knowledge base data sources are returned if they contain a metadata - attribute whose name matches the `key` and whose value is less than the - `value` in this object. - - The following example would return data sources with an `year` attribute - whose value is less than to `1989`. - - `"lessThan": { "key": "year", "value": 1989 }` - """ - - value: FilterAttribute - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVAL_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RETRIEVAL_FILTER.members["lessThan"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=FilterAttribute.deserialize(deserializer)) - - -@dataclass -class RetrievalFilterLessThanOrEquals: - """ - Knowledge base data sources are returned if they contain a metadata - attribute whose name matches the `key` and whose value is less than or - equal to the `value` in this object. - - The following example would return data sources with an `year` attribute - whose value is less than or equal to `1989`. - - `"lessThanOrEquals": { "key": "year", "value": 1989 }` - """ - - value: FilterAttribute - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVAL_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RETRIEVAL_FILTER.members["lessThanOrEquals"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=FilterAttribute.deserialize(deserializer)) - - -@dataclass -class RetrievalFilterIn: - """ - Knowledge base data sources are returned if they contain a metadata - attribute whose name matches the `key` and whose value is in the list - specified in the `value` in this object. - - The following example would return data sources with an `animal` - attribute that is either `cat` or `dog`: - - `"in": { "key": "animal", "value": ["cat", "dog"] }` - """ - - value: FilterAttribute - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVAL_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVAL_FILTER.members["in"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=FilterAttribute.deserialize(deserializer)) - - -@dataclass -class RetrievalFilterNotIn: - """ - Knowledge base data sources are returned if they contain a metadata - attribute whose name matches the `key` and whose value isn't in the - list specified in the `value` in this object. - - The following example would return data sources whose `animal` attribute - is neither `cat` nor `dog`. - - `"notIn": { "key": "animal", "value": ["cat", "dog"] }` - """ - - value: FilterAttribute - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVAL_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVAL_FILTER.members["notIn"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=FilterAttribute.deserialize(deserializer)) - - -@dataclass -class RetrievalFilterStartsWith: - """ - Knowledge base data sources are returned if they contain a metadata - attribute whose name matches the `key` and whose value starts with the - `value` in this object. This filter is currently only supported for - Amazon OpenSearch Serverless vector stores. - - The following example would return data sources with an `animal` - attribute starts with `ca` (for example, `cat` or `camel`). - - `"startsWith": { "key": "animal", "value": "ca" }` - """ - - value: FilterAttribute - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVAL_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RETRIEVAL_FILTER.members["startsWith"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=FilterAttribute.deserialize(deserializer)) - - -@dataclass -class RetrievalFilterListContains: - """ - Knowledge base data sources are returned if they contain a metadata - attribute whose name matches the `key` and whose value is a list that - contains the `value` as one of its members. - - The following example would return data sources with an `animals` - attribute that is a list containing a `cat` member (for example - `["dog", "cat"]`). - - `"listContains": { "key": "animals", "value": "cat" }` - """ - - value: FilterAttribute - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVAL_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RETRIEVAL_FILTER.members["listContains"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=FilterAttribute.deserialize(deserializer)) - - -@dataclass -class RetrievalFilterStringContains: - """ - Knowledge base data sources are returned if they contain a metadata - attribute whose name matches the `key` and whose value is one of the - following: - - - A string that contains the `value` as a substring. The following - example would return data sources with an `animal` attribute that - contains the substring `at` (for example `cat`). - - `"stringContains": { "key": "animal", "value": "at" }` - - - A list with a member that contains the `value` as a substring. The - following example would return data sources with an `animals` - attribute that is a list containing a member that contains the - substring `at` (for example `["dog", "cat"]`). - - `"stringContains": { "key": "animals", "value": "at" }` - """ - - value: FilterAttribute - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVAL_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RETRIEVAL_FILTER.members["stringContains"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=FilterAttribute.deserialize(deserializer)) - - -@dataclass -class RetrievalFilterAndAll: - """ - Knowledge base data sources are returned if their metadata attributes - fulfill all the filter conditions inside this list. - """ - - value: "list[RetrievalFilter]" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVAL_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_retrieval_filter_list( - serializer, _SCHEMA_RETRIEVAL_FILTER.members["andAll"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_deserialize_retrieval_filter_list( - deserializer, _SCHEMA_RETRIEVAL_FILTER.members["andAll"] - ) - ) - - -@dataclass -class RetrievalFilterOrAll: - """ - Knowledge base data sources are returned if their metadata attributes - fulfill at least one of the filter conditions inside this list. - """ - - value: "list[RetrievalFilter]" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVAL_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_retrieval_filter_list( - serializer, _SCHEMA_RETRIEVAL_FILTER.members["orAll"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_deserialize_retrieval_filter_list( - deserializer, _SCHEMA_RETRIEVAL_FILTER.members["orAll"] - ) - ) - - -@dataclass -class RetrievalFilterUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -RetrievalFilter = Union[ - RetrievalFilterEquals - | RetrievalFilterNotEquals - | RetrievalFilterGreaterThan - | RetrievalFilterGreaterThanOrEquals - | RetrievalFilterLessThan - | RetrievalFilterLessThanOrEquals - | RetrievalFilterIn - | RetrievalFilterNotIn - | RetrievalFilterStartsWith - | RetrievalFilterListContains - | RetrievalFilterStringContains - | RetrievalFilterAndAll - | RetrievalFilterOrAll - | RetrievalFilterUnknown -] -""" -Specifies the filters to use on the metadata attributes in the knowledge -base data sources before returning results. For more information, see -[Query -configurations](https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html). -See the examples below to see how to use these filters. - -This data type is used in the following API operations: - -- [Retrieve - request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_RequestSyntax) - -- in the `filter` field - -- [RetrieveAndGenerate - request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_RequestSyntax) - -- in the `filter` field -""" - - -class _RetrievalFilterDeserializer: - _result: RetrievalFilter | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> RetrievalFilter: - self._result = None - deserializer.read_struct(_SCHEMA_RETRIEVAL_FILTER, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(RetrievalFilterEquals.deserialize(de)) - - case 1: - self._set_result(RetrievalFilterNotEquals.deserialize(de)) - - case 2: - self._set_result(RetrievalFilterGreaterThan.deserialize(de)) - - case 3: - self._set_result(RetrievalFilterGreaterThanOrEquals.deserialize(de)) - - case 4: - self._set_result(RetrievalFilterLessThan.deserialize(de)) - - case 5: - self._set_result(RetrievalFilterLessThanOrEquals.deserialize(de)) - - case 6: - self._set_result(RetrievalFilterIn.deserialize(de)) - - case 7: - self._set_result(RetrievalFilterNotIn.deserialize(de)) - - case 8: - self._set_result(RetrievalFilterStartsWith.deserialize(de)) - - case 9: - self._set_result(RetrievalFilterListContains.deserialize(de)) - - case 10: - self._set_result(RetrievalFilterStringContains.deserialize(de)) - - case 11: - self._set_result(RetrievalFilterAndAll.deserialize(de)) - - case 12: - self._set_result(RetrievalFilterOrAll.deserialize(de)) - - case _: - self._set_result( - RetrievalFilterUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: RetrievalFilter) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_retrieval_filter_list( - serializer: ShapeSerializer, schema: Schema, value: list[RetrievalFilter] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_retrieval_filter_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[RetrievalFilter]: - result: list[RetrievalFilter] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_RetrievalFilterDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class KnowledgeBaseVectorSearchConfiguration: - """ - Configurations for how to perform the search query and return results. - For more information, see [Query - configurations](https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html). - - This data type is used in the following API operations: - - - [Retrieve - request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_RequestSyntax) - -- in the `vectorSearchConfiguration` field - - - [RetrieveAndGenerate - request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_RequestSyntax) - -- in the `vectorSearchConfiguration` field - """ - - number_of_results: int = 5 - """The number of source chunks to retrieve.""" - - override_search_type: str | None = None - """ - By default, Amazon Bedrock decides a search strategy for you. If you're - using an Amazon OpenSearch Serverless vector store that contains a - filterable text field, you can specify whether to query the knowledge - base with a `HYBRID` search using both vector embeddings and raw text, - or `SEMANTIC` search using only vector embeddings. For other vector - store configurations, only `SEMANTIC` search is available. For more - information, see [Test a knowledge - base](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-test.html). - """ - - filter: "RetrievalFilter | None" = field(repr=False, default=None) - """ - Specifies the filters to use on the metadata in the knowledge base data - sources before returning results. For more information, see [Query - configurations](https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html). - """ - - reranking_configuration: VectorSearchRerankingConfiguration | None = None - """ - Contains configurations for reranking the retrieved results. For more - information, see [Improve the relevance of query responses with a - reranker - model](https://docs.aws.amazon.com/bedrock/latest/userguide/rerank.html). - """ - - implicit_filter_configuration: ImplicitFilterConfiguration | None = None - """Settings for implicit filtering.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_KNOWLEDGE_BASE_VECTOR_SEARCH_CONFIGURATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer( - _SCHEMA_KNOWLEDGE_BASE_VECTOR_SEARCH_CONFIGURATION.members[ - "numberOfResults" - ], - self.number_of_results, - ) - if self.override_search_type is not None: - serializer.write_string( - _SCHEMA_KNOWLEDGE_BASE_VECTOR_SEARCH_CONFIGURATION.members[ - "overrideSearchType" - ], - self.override_search_type, - ) - - if self.filter is not None: - serializer.write_struct( - _SCHEMA_KNOWLEDGE_BASE_VECTOR_SEARCH_CONFIGURATION.members["filter"], - self.filter, - ) - - if self.reranking_configuration is not None: - serializer.write_struct( - _SCHEMA_KNOWLEDGE_BASE_VECTOR_SEARCH_CONFIGURATION.members[ - "rerankingConfiguration" - ], - self.reranking_configuration, - ) - - if self.implicit_filter_configuration is not None: - serializer.write_struct( - _SCHEMA_KNOWLEDGE_BASE_VECTOR_SEARCH_CONFIGURATION.members[ - "implicitFilterConfiguration" - ], - self.implicit_filter_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["number_of_results"] = de.read_integer( - _SCHEMA_KNOWLEDGE_BASE_VECTOR_SEARCH_CONFIGURATION.members[ - "numberOfResults" - ] - ) - - case 1: - kwargs["override_search_type"] = SearchType( - de.read_string( - _SCHEMA_KNOWLEDGE_BASE_VECTOR_SEARCH_CONFIGURATION.members[ - "overrideSearchType" - ] - ) - ) - - case 2: - kwargs["filter"] = _RetrievalFilterDeserializer().deserialize(de) - - case 3: - kwargs["reranking_configuration"] = ( - VectorSearchRerankingConfiguration.deserialize(de) - ) - - case 4: - kwargs["implicit_filter_configuration"] = ( - ImplicitFilterConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_KNOWLEDGE_BASE_VECTOR_SEARCH_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ManagedSearchConfiguration: - """ - Configuration for managed search in a knowledge base. Managed search - automatically determines the best search strategy based on your data - store configuration. - """ - - number_of_results: int | None = None - """The number of results to retrieve.""" - - filter: "RetrievalFilter | None" = field(repr=False, default=None) - """ - Filters the metadata of the retrieved results so that Amazon Bedrock - returns only results that match the filter. - """ - - reranking_model_type: str | None = None - """ - The type of reranking model to use when reranking results retrieved from - the managed search. Use `CUSTOM` to specify a model, `MANAGED` to use - the service default, or `NONE` to disable reranking. - """ - - reranking_configuration: ManagedSearchRerankingConfiguration | None = None - """ - Contains configurations for reranking the results retrieved from the - managed search. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MANAGED_SEARCH_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.number_of_results is not None: - serializer.write_integer( - _SCHEMA_MANAGED_SEARCH_CONFIGURATION.members["numberOfResults"], - self.number_of_results, - ) - - if self.filter is not None: - serializer.write_struct( - _SCHEMA_MANAGED_SEARCH_CONFIGURATION.members["filter"], self.filter - ) - - if self.reranking_model_type is not None: - serializer.write_string( - _SCHEMA_MANAGED_SEARCH_CONFIGURATION.members["rerankingModelType"], - self.reranking_model_type, - ) - - if self.reranking_configuration is not None: - serializer.write_struct( - _SCHEMA_MANAGED_SEARCH_CONFIGURATION.members["rerankingConfiguration"], - self.reranking_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["number_of_results"] = de.read_integer( - _SCHEMA_MANAGED_SEARCH_CONFIGURATION.members["numberOfResults"] - ) - - case 1: - kwargs["filter"] = _RetrievalFilterDeserializer().deserialize(de) - - case 2: - kwargs["reranking_model_type"] = RerankingModelType( - de.read_string( - _SCHEMA_MANAGED_SEARCH_CONFIGURATION.members[ - "rerankingModelType" - ] - ) - ) - - case 3: - kwargs["reranking_configuration"] = ( - ManagedSearchRerankingConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MANAGED_SEARCH_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class RetrievalOverrides: - """Overrides for retrieval behavior.""" - - filter: "RetrievalFilter | None" = field(repr=False, default=None) - """A filter to apply to the retrieval results.""" - - max_number_of_results: int | None = None - """The maximum number of results to return.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVAL_OVERRIDES, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.filter is not None: - serializer.write_struct( - _SCHEMA_RETRIEVAL_OVERRIDES.members["filter"], self.filter - ) - - if self.max_number_of_results is not None: - serializer.write_integer( - _SCHEMA_RETRIEVAL_OVERRIDES.members["maxNumberOfResults"], - self.max_number_of_results, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["filter"] = _RetrievalFilterDeserializer().deserialize(de) - - case 1: - kwargs["max_number_of_results"] = de.read_integer( - _SCHEMA_RETRIEVAL_OVERRIDES.members["maxNumberOfResults"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RETRIEVAL_OVERRIDES, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class KnowledgeBaseRetrieverConfiguration: - """Configuration for retrieving from a Bedrock knowledge base.""" - - knowledge_base_id: str - """The unique identifier of the knowledge base.""" - - retrieval_overrides: "RetrievalOverrides | None" = None - """Overrides for retrieval behavior such as filters and result limits.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KNOWLEDGE_BASE_RETRIEVER_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_KNOWLEDGE_BASE_RETRIEVER_CONFIGURATION.members["knowledgeBaseId"], - self.knowledge_base_id, - ) - if self.retrieval_overrides is not None: - serializer.write_struct( - _SCHEMA_KNOWLEDGE_BASE_RETRIEVER_CONFIGURATION.members[ - "retrievalOverrides" - ], - self.retrieval_overrides, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["knowledge_base_id"] = de.read_string( - _SCHEMA_KNOWLEDGE_BASE_RETRIEVER_CONFIGURATION.members[ - "knowledgeBaseId" - ] - ) - - case 1: - kwargs["retrieval_overrides"] = RetrievalOverrides.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_KNOWLEDGE_BASE_RETRIEVER_CONFIGURATION, consumer=_consumer - ) - if "knowledge_base_id" not in kwargs: - kwargs["knowledge_base_id"] = "" - return kwargs - - -@dataclass -class RetrieverConfigurationKnowledgeBase: - """Configuration for a knowledge base retriever.""" - - value: "KnowledgeBaseRetrieverConfiguration" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVER_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RETRIEVER_CONFIGURATION.members["knowledgeBase"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=KnowledgeBaseRetrieverConfiguration.deserialize(deserializer)) - - -@dataclass -class RetrieverConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -RetrieverConfiguration = Union[ - RetrieverConfigurationKnowledgeBase | RetrieverConfigurationUnknown -] -"""Configuration for a retriever, specified as a union of retriever types.""" - - -class _RetrieverConfigurationDeserializer: - _result: RetrieverConfiguration | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> RetrieverConfiguration: - self._result = None - deserializer.read_struct(_SCHEMA_RETRIEVER_CONFIGURATION, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(RetrieverConfigurationKnowledgeBase.deserialize(de)) - - case _: - self._set_result( - RetrieverConfigurationUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: RetrieverConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class AgenticRetriever: - """A retriever used in agentic retrieval.""" - - configuration: "RetrieverConfiguration" - """The configuration for this retriever.""" - - description: str | None = None - """A description of the retriever's purpose.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENTIC_RETRIEVER, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.description is not None: - serializer.write_string( - _SCHEMA_AGENTIC_RETRIEVER.members["description"], self.description - ) - - serializer.write_struct( - _SCHEMA_AGENTIC_RETRIEVER.members["configuration"], self.configuration - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["description"] = de.read_string( - _SCHEMA_AGENTIC_RETRIEVER.members["description"] - ) - - case 1: - kwargs["configuration"] = ( - _RetrieverConfigurationDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AGENTIC_RETRIEVER, consumer=_consumer) - if "configuration" not in kwargs: - kwargs["configuration"] = RetrieverConfigurationUnknown(tag="") - return kwargs - - -def _serialize_agentic_retrievers( - serializer: ShapeSerializer, schema: Schema, value: list[AgenticRetriever] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_agentic_retrievers( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AgenticRetriever]: - result: list[AgenticRetriever] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AgenticRetriever.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AgenticRetrieveStreamInput: - """Request structure for the agentic retrieve stream operation.""" - - messages: list[AgenticRetrieveMessage] | None = None - """The list of messages for the agentic retrieval conversation.""" - - retrievers: "list[AgenticRetriever] | None" = None - """The list of retrievers to use for agentic retrieval.""" - - agentic_retrieve_configuration: AgenticRetrieveConfiguration | None = None - """Configuration settings for the agentic retrieval operation.""" - - policy_configuration: AgenticRetrievePolicyConfiguration | None = None - """Policy configuration for guardrails and content filtering.""" - - next_token: str | None = None - """Opaque continuation token for paginated results.""" - - user_context: UserContext | None = field(repr=False, default=None) - """ - Contains information about the user making the request. This is used for - access control filtering to ensure that retrieval results only include - documents the user is authorized to access. - """ - - memory_configuration: AgenticRetrieveMemoryConfiguration | None = None - """ - The configuration for using an Amazon Bedrock AgentCore Memory resource - with this retrieval. - """ - - generate_response: bool = True - """Whether to generate a response based on the retrieved results.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENTIC_RETRIEVE_STREAM_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.messages is not None: - _serialize_agentic_retrieve_messages( - serializer, - _SCHEMA_AGENTIC_RETRIEVE_STREAM_INPUT.members["messages"], - self.messages, - ) - - if self.retrievers is not None: - _serialize_agentic_retrievers( - serializer, - _SCHEMA_AGENTIC_RETRIEVE_STREAM_INPUT.members["retrievers"], - self.retrievers, - ) - - if self.agentic_retrieve_configuration is not None: - serializer.write_struct( - _SCHEMA_AGENTIC_RETRIEVE_STREAM_INPUT.members[ - "agenticRetrieveConfiguration" - ], - self.agentic_retrieve_configuration, - ) - - if self.policy_configuration is not None: - serializer.write_struct( - _SCHEMA_AGENTIC_RETRIEVE_STREAM_INPUT.members["policyConfiguration"], - self.policy_configuration, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_AGENTIC_RETRIEVE_STREAM_INPUT.members["nextToken"], - self.next_token, - ) - - if self.user_context is not None: - serializer.write_struct( - _SCHEMA_AGENTIC_RETRIEVE_STREAM_INPUT.members["userContext"], - self.user_context, - ) - - if self.memory_configuration is not None: - serializer.write_struct( - _SCHEMA_AGENTIC_RETRIEVE_STREAM_INPUT.members["memoryConfiguration"], - self.memory_configuration, - ) - - if self.generate_response is not None: - serializer.write_boolean( - _SCHEMA_AGENTIC_RETRIEVE_STREAM_INPUT.members["generateResponse"], - self.generate_response, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["messages"] = _deserialize_agentic_retrieve_messages( - de, _SCHEMA_AGENTIC_RETRIEVE_STREAM_INPUT.members["messages"] - ) - - case 1: - kwargs["retrievers"] = _deserialize_agentic_retrievers( - de, _SCHEMA_AGENTIC_RETRIEVE_STREAM_INPUT.members["retrievers"] - ) - - case 2: - kwargs["agentic_retrieve_configuration"] = ( - AgenticRetrieveConfiguration.deserialize(de) - ) - - case 3: - kwargs["policy_configuration"] = ( - AgenticRetrievePolicyConfiguration.deserialize(de) - ) - - case 4: - kwargs["next_token"] = de.read_string( - _SCHEMA_AGENTIC_RETRIEVE_STREAM_INPUT.members["nextToken"] - ) - - case 5: - kwargs["user_context"] = UserContext.deserialize(de) - - case 6: - kwargs["memory_configuration"] = ( - AgenticRetrieveMemoryConfiguration.deserialize(de) - ) - - case 7: - kwargs["generate_response"] = de.read_boolean( - _SCHEMA_AGENTIC_RETRIEVE_STREAM_INPUT.members[ - "generateResponse" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AGENTIC_RETRIEVE_STREAM_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class KnowledgeBaseRetrievalConfiguration: - """ - Contains configurations for knowledge base query. For more information, - see [Query - configurations](https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html). - - This data type is used in the following API operations: - - - [Retrieve - request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_RequestSyntax) - -- in the `retrievalConfiguration` field - - - [RetrieveAndGenerate - request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_RequestSyntax) - -- in the `retrievalConfiguration` field - """ - - vector_search_configuration: "KnowledgeBaseVectorSearchConfiguration | None" = None - """ - Contains details about how the results from the vector search should be - returned. For more information, see [Query - configurations](https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html). - """ - - managed_search_configuration: "ManagedSearchConfiguration | None" = None - """ - Contains configurations for managed search. For more information, see - [Query - configurations](https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KNOWLEDGE_BASE_RETRIEVAL_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.vector_search_configuration is not None: - serializer.write_struct( - _SCHEMA_KNOWLEDGE_BASE_RETRIEVAL_CONFIGURATION.members[ - "vectorSearchConfiguration" - ], - self.vector_search_configuration, - ) - - if self.managed_search_configuration is not None: - serializer.write_struct( - _SCHEMA_KNOWLEDGE_BASE_RETRIEVAL_CONFIGURATION.members[ - "managedSearchConfiguration" - ], - self.managed_search_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["vector_search_configuration"] = ( - KnowledgeBaseVectorSearchConfiguration.deserialize(de) - ) - - case 1: - kwargs["managed_search_configuration"] = ( - ManagedSearchConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_KNOWLEDGE_BASE_RETRIEVAL_CONFIGURATION, consumer=_consumer - ) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls() - - -AGENTIC_RETRIEVE_STREAM = APIOperation( - input=AgenticRetrieveStreamInput, - output=AgenticRetrieveStreamOutput, - schema=_SCHEMA_AGENTIC_RETRIEVE_STREAM, - input_schema=_SCHEMA_AGENTIC_RETRIEVE_STREAM_INPUT, - output_schema=_SCHEMA_AGENTIC_RETRIEVE_STREAM_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentruntime#BadGatewayException" - ): BadGatewayException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentruntime#DependencyFailedException" - ): DependencyFailedException, - ShapeID( - "com.amazonaws.bedrockagentruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_BAD_GATEWAY_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_DEPENDENCY_FAILED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class KnowledgeBase: - """Details of the knowledge base associated withe inline agent.""" - - knowledge_base_id: str - """ - The unique identifier for a knowledge base associated with the inline - agent. - """ - - description: str = field(repr=False) - """The description of the knowledge base associated with the inline agent.""" - - retrieval_configuration: "KnowledgeBaseRetrievalConfiguration | None" = None - """ - The configurations to apply to the knowledge base during query. For more - information, see [Query - configurations](https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KNOWLEDGE_BASE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_KNOWLEDGE_BASE.members["knowledgeBaseId"], self.knowledge_base_id - ) - serializer.write_string( - _SCHEMA_KNOWLEDGE_BASE.members["description"], self.description - ) - if self.retrieval_configuration is not None: - serializer.write_struct( - _SCHEMA_KNOWLEDGE_BASE.members["retrievalConfiguration"], - self.retrieval_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["knowledge_base_id"] = de.read_string( - _SCHEMA_KNOWLEDGE_BASE.members["knowledgeBaseId"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_KNOWLEDGE_BASE.members["description"] - ) - - case 2: - kwargs["retrieval_configuration"] = ( - KnowledgeBaseRetrievalConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_KNOWLEDGE_BASE, consumer=_consumer) - if "knowledge_base_id" not in kwargs: - kwargs["knowledge_base_id"] = "" - if "description" not in kwargs: - kwargs["description"] = "" - return kwargs - - -@dataclass(kw_only=True) -class KnowledgeBaseConfiguration: - """ - Configurations to apply to a knowledge base attached to the agent during - query. For more information, see [Knowledge base retrieval - configurations](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-session-state.html#session-state-kb). - """ - - knowledge_base_id: str - """The unique identifier for a knowledge base attached to the agent.""" - - retrieval_configuration: "KnowledgeBaseRetrievalConfiguration" - """ - The configurations to apply to the knowledge base during query. For more - information, see [Query - configurations](https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KNOWLEDGE_BASE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_KNOWLEDGE_BASE_CONFIGURATION.members["knowledgeBaseId"], - self.knowledge_base_id, - ) - serializer.write_struct( - _SCHEMA_KNOWLEDGE_BASE_CONFIGURATION.members["retrievalConfiguration"], - self.retrieval_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["knowledge_base_id"] = de.read_string( - _SCHEMA_KNOWLEDGE_BASE_CONFIGURATION.members["knowledgeBaseId"] - ) - - case 1: - kwargs["retrieval_configuration"] = ( - KnowledgeBaseRetrievalConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_KNOWLEDGE_BASE_CONFIGURATION, consumer=_consumer - ) - if "knowledge_base_id" not in kwargs: - kwargs["knowledge_base_id"] = "" - if "retrieval_configuration" not in kwargs: - kwargs["retrieval_configuration"] = ( - KnowledgeBaseRetrievalConfiguration._smithy_default() - ) - return kwargs - - -@dataclass(kw_only=True) -class KnowledgeBaseRetrieveAndGenerateConfiguration: - """ - Contains details about the resource being queried. - - This data type is used in the following API operations: - - - [Retrieve - request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_RequestSyntax) - -- in the `knowledgeBaseConfiguration` field - - - [RetrieveAndGenerate - request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_RequestSyntax) - -- in the `knowledgeBaseConfiguration` field - """ - - knowledge_base_id: str - """The unique identifier of the knowledge base that is queried.""" - - model_arn: str - """ - The ARN of the foundation model or [inference - profile](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html) - used to generate a response. - """ - - retrieval_configuration: "KnowledgeBaseRetrievalConfiguration | None" = None - """ - Contains configurations for how to retrieve and return the knowledge - base query. - """ - - generation_configuration: GenerationConfiguration | None = None - """ - Contains configurations for response generation based on the knowledge - base query results. - """ - - orchestration_configuration: OrchestrationConfiguration | None = None - """ - Settings for how the model processes the prompt prior to retrieval and - generation. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_KNOWLEDGE_BASE_RETRIEVE_AND_GENERATE_CONFIGURATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_KNOWLEDGE_BASE_RETRIEVE_AND_GENERATE_CONFIGURATION.members[ - "knowledgeBaseId" - ], - self.knowledge_base_id, - ) - serializer.write_string( - _SCHEMA_KNOWLEDGE_BASE_RETRIEVE_AND_GENERATE_CONFIGURATION.members[ - "modelArn" - ], - self.model_arn, - ) - if self.retrieval_configuration is not None: - serializer.write_struct( - _SCHEMA_KNOWLEDGE_BASE_RETRIEVE_AND_GENERATE_CONFIGURATION.members[ - "retrievalConfiguration" - ], - self.retrieval_configuration, - ) - - if self.generation_configuration is not None: - serializer.write_struct( - _SCHEMA_KNOWLEDGE_BASE_RETRIEVE_AND_GENERATE_CONFIGURATION.members[ - "generationConfiguration" - ], - self.generation_configuration, - ) - - if self.orchestration_configuration is not None: - serializer.write_struct( - _SCHEMA_KNOWLEDGE_BASE_RETRIEVE_AND_GENERATE_CONFIGURATION.members[ - "orchestrationConfiguration" - ], - self.orchestration_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["knowledge_base_id"] = de.read_string( - _SCHEMA_KNOWLEDGE_BASE_RETRIEVE_AND_GENERATE_CONFIGURATION.members[ - "knowledgeBaseId" - ] - ) - - case 1: - kwargs["model_arn"] = de.read_string( - _SCHEMA_KNOWLEDGE_BASE_RETRIEVE_AND_GENERATE_CONFIGURATION.members[ - "modelArn" - ] - ) - - case 2: - kwargs["retrieval_configuration"] = ( - KnowledgeBaseRetrievalConfiguration.deserialize(de) - ) - - case 3: - kwargs["generation_configuration"] = ( - GenerationConfiguration.deserialize(de) - ) - - case 4: - kwargs["orchestration_configuration"] = ( - OrchestrationConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_KNOWLEDGE_BASE_RETRIEVE_AND_GENERATE_CONFIGURATION, - consumer=_consumer, - ) - if "knowledge_base_id" not in kwargs: - kwargs["knowledge_base_id"] = "" - if "model_arn" not in kwargs: - kwargs["model_arn"] = "" - return kwargs - - -@dataclass(kw_only=True) -class RetrieveInput: - """Dataclass for RetrieveInput structure.""" - - knowledge_base_id: str | None = None - """The unique identifier of the knowledge base to query.""" - - retrieval_query: KnowledgeBaseQuery | None = field(repr=False, default=None) - """Contains the query to send the knowledge base.""" - - retrieval_configuration: "KnowledgeBaseRetrievalConfiguration | None" = None - """ - Contains configurations for the knowledge base query and retrieval - process. For more information, see [Query - configurations](https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html). - """ - - guardrail_configuration: GuardrailConfiguration | None = None - """Guardrail settings.""" - - next_token: str | None = None - """ - If there are more results than can fit in the response, the response - returns a `nextToken`. Use this token in the `nextToken` field of - another request to retrieve the next batch of results. - """ - - user_context: UserContext | None = field(repr=False, default=None) - """ - Contains information about the user making the request. This is used for - access control filtering to ensure that retrieval results only include - documents the user is authorized to access. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.knowledge_base_id is not None: - serializer.write_string( - _SCHEMA_RETRIEVE_INPUT.members["knowledgeBaseId"], - self.knowledge_base_id, - ) - - if self.retrieval_query is not None: - serializer.write_struct( - _SCHEMA_RETRIEVE_INPUT.members["retrievalQuery"], self.retrieval_query - ) - - if self.retrieval_configuration is not None: - serializer.write_struct( - _SCHEMA_RETRIEVE_INPUT.members["retrievalConfiguration"], - self.retrieval_configuration, - ) - - if self.guardrail_configuration is not None: - serializer.write_struct( - _SCHEMA_RETRIEVE_INPUT.members["guardrailConfiguration"], - self.guardrail_configuration, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_RETRIEVE_INPUT.members["nextToken"], self.next_token - ) - - if self.user_context is not None: - serializer.write_struct( - _SCHEMA_RETRIEVE_INPUT.members["userContext"], self.user_context - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["knowledge_base_id"] = de.read_string( - _SCHEMA_RETRIEVE_INPUT.members["knowledgeBaseId"] - ) - - case 1: - kwargs["retrieval_query"] = KnowledgeBaseQuery.deserialize(de) - - case 2: - kwargs["retrieval_configuration"] = ( - KnowledgeBaseRetrievalConfiguration.deserialize(de) - ) - - case 3: - kwargs["guardrail_configuration"] = ( - GuardrailConfiguration.deserialize(de) - ) - - case 4: - kwargs["next_token"] = de.read_string( - _SCHEMA_RETRIEVE_INPUT.members["nextToken"] - ) - - case 5: - kwargs["user_context"] = UserContext.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RETRIEVE_INPUT, consumer=_consumer) - return kwargs - - -RETRIEVE = APIOperation( - input=RetrieveInput, - output=RetrieveOutput, - schema=_SCHEMA_RETRIEVE, - input_schema=_SCHEMA_RETRIEVE_INPUT, - output_schema=_SCHEMA_RETRIEVE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentruntime#BadGatewayException" - ): BadGatewayException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentruntime#DependencyFailedException" - ): DependencyFailedException, - ShapeID( - "com.amazonaws.bedrockagentruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_BAD_GATEWAY_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_DEPENDENCY_FAILED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -def _serialize_knowledge_base_configurations( - serializer: ShapeSerializer, schema: Schema, value: list[KnowledgeBaseConfiguration] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_knowledge_base_configurations( - deserializer: ShapeDeserializer, schema: Schema -) -> list[KnowledgeBaseConfiguration]: - result: list[KnowledgeBaseConfiguration] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(KnowledgeBaseConfiguration.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_knowledge_bases( - serializer: ShapeSerializer, schema: Schema, value: list[KnowledgeBase] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_knowledge_bases( - deserializer: ShapeDeserializer, schema: Schema -) -> list[KnowledgeBase]: - result: list[KnowledgeBase] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(KnowledgeBase.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class RetrieveAndGenerateConfiguration: - """ - Contains details about the resource being queried. - - This data type is used in the following API operations: - - - [RetrieveAndGenerate - request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_RequestSyntax) - -- in the `retrieveAndGenerateConfiguration` field - """ - - type: str - """ - The type of resource that contains your data for retrieving information - and generating responses. - - Note: - If you choose to use `EXTERNAL_SOURCES`, then currently only Anthropic - Claude 3 Sonnet models for knowledge bases are supported. - """ - - knowledge_base_configuration: "KnowledgeBaseRetrieveAndGenerateConfiguration | None" = None - """ - Contains details about the knowledge base for retrieving information and - generating responses. - """ - - external_sources_configuration: ( - ExternalSourcesRetrieveAndGenerateConfiguration | None - ) = None - """ - The configuration for the external source wrapper object in the - `retrieveAndGenerate` function. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVE_AND_GENERATE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_RETRIEVE_AND_GENERATE_CONFIGURATION.members["type"], self.type - ) - if self.knowledge_base_configuration is not None: - serializer.write_struct( - _SCHEMA_RETRIEVE_AND_GENERATE_CONFIGURATION.members[ - "knowledgeBaseConfiguration" - ], - self.knowledge_base_configuration, - ) - - if self.external_sources_configuration is not None: - serializer.write_struct( - _SCHEMA_RETRIEVE_AND_GENERATE_CONFIGURATION.members[ - "externalSourcesConfiguration" - ], - self.external_sources_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = RetrieveAndGenerateType( - de.read_string( - _SCHEMA_RETRIEVE_AND_GENERATE_CONFIGURATION.members["type"] - ) - ) - - case 1: - kwargs["knowledge_base_configuration"] = ( - KnowledgeBaseRetrieveAndGenerateConfiguration.deserialize(de) - ) - - case 2: - kwargs["external_sources_configuration"] = ( - ExternalSourcesRetrieveAndGenerateConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RETRIEVE_AND_GENERATE_CONFIGURATION, consumer=_consumer - ) - if "type" not in kwargs: - kwargs["type"] = RetrieveAndGenerateType._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class Collaborator: - """List of inline collaborators.""" - - foundation_model: str - """The foundation model used by the inline collaborator agent.""" - - instruction: str = field(repr=False) - """ - Instruction that tell the inline collaborator agent what it should do - and how it should interact with users. - """ - - customer_encryption_key_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the AWS KMS key that encrypts the - inline collaborator. - """ - - idle_session_ttl_in_seconds: int | None = None - """ - The number of seconds for which the Amazon Bedrock keeps information - about the user's conversation with the inline collaborator agent. - - A user interaction remains active for the amount of time specified. If - no conversation occurs during this time, the session expires and Amazon - Bedrock deletes any data provided before the timeout. - """ - - action_groups: list[AgentActionGroup] | None = None - """ - List of action groups with each action group defining tasks the inline - collaborator agent needs to carry out. - """ - - knowledge_bases: "list[KnowledgeBase] | None" = None - """Knowledge base associated with the inline collaborator agent.""" - - guardrail_configuration: GuardrailConfigurationWithArn | None = None - """Details of the guardwrail associated with the inline collaborator.""" - - prompt_override_configuration: PromptOverrideConfiguration | None = field( - repr=False, default=None - ) - """ - Contains configurations to override prompt templates in different parts - of an inline collaborator sequence. For more information, see [Advanced - prompts](https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts.html). - """ - - agent_collaboration: str | None = None - """ - Defines how the inline supervisor agent handles information across - multiple collaborator agents to coordinate a final response. - """ - - collaborator_configurations: list[CollaboratorConfiguration] | None = None - """Settings of the collaborator agent.""" - - agent_name: str | None = field(repr=False, default=None) - """ - Name of the inline collaborator agent which must be the same name as - specified for `collaboratorName`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_COLLABORATOR, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.customer_encryption_key_arn is not None: - serializer.write_string( - _SCHEMA_COLLABORATOR.members["customerEncryptionKeyArn"], - self.customer_encryption_key_arn, - ) - - serializer.write_string( - _SCHEMA_COLLABORATOR.members["foundationModel"], self.foundation_model - ) - serializer.write_string( - _SCHEMA_COLLABORATOR.members["instruction"], self.instruction - ) - if self.idle_session_ttl_in_seconds is not None: - serializer.write_integer( - _SCHEMA_COLLABORATOR.members["idleSessionTTLInSeconds"], - self.idle_session_ttl_in_seconds, - ) - - if self.action_groups is not None: - _serialize_agent_action_groups( - serializer, - _SCHEMA_COLLABORATOR.members["actionGroups"], - self.action_groups, - ) - - if self.knowledge_bases is not None: - _serialize_knowledge_bases( - serializer, - _SCHEMA_COLLABORATOR.members["knowledgeBases"], - self.knowledge_bases, - ) - - if self.guardrail_configuration is not None: - serializer.write_struct( - _SCHEMA_COLLABORATOR.members["guardrailConfiguration"], - self.guardrail_configuration, - ) - - if self.prompt_override_configuration is not None: - serializer.write_struct( - _SCHEMA_COLLABORATOR.members["promptOverrideConfiguration"], - self.prompt_override_configuration, - ) - - if self.agent_collaboration is not None: - serializer.write_string( - _SCHEMA_COLLABORATOR.members["agentCollaboration"], - self.agent_collaboration, - ) - - if self.collaborator_configurations is not None: - _serialize_collaborator_configurations( - serializer, - _SCHEMA_COLLABORATOR.members["collaboratorConfigurations"], - self.collaborator_configurations, - ) - - if self.agent_name is not None: - serializer.write_string( - _SCHEMA_COLLABORATOR.members["agentName"], self.agent_name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["customer_encryption_key_arn"] = de.read_string( - _SCHEMA_COLLABORATOR.members["customerEncryptionKeyArn"] - ) - - case 1: - kwargs["foundation_model"] = de.read_string( - _SCHEMA_COLLABORATOR.members["foundationModel"] - ) - - case 2: - kwargs["instruction"] = de.read_string( - _SCHEMA_COLLABORATOR.members["instruction"] - ) - - case 3: - kwargs["idle_session_ttl_in_seconds"] = de.read_integer( - _SCHEMA_COLLABORATOR.members["idleSessionTTLInSeconds"] - ) - - case 4: - kwargs["action_groups"] = _deserialize_agent_action_groups( - de, _SCHEMA_COLLABORATOR.members["actionGroups"] - ) - - case 5: - kwargs["knowledge_bases"] = _deserialize_knowledge_bases( - de, _SCHEMA_COLLABORATOR.members["knowledgeBases"] - ) - - case 6: - kwargs["guardrail_configuration"] = ( - GuardrailConfigurationWithArn.deserialize(de) - ) - - case 7: - kwargs["prompt_override_configuration"] = ( - PromptOverrideConfiguration.deserialize(de) - ) - - case 8: - kwargs["agent_collaboration"] = AgentCollaboration( - de.read_string( - _SCHEMA_COLLABORATOR.members["agentCollaboration"] - ) - ) - - case 9: - kwargs["collaborator_configurations"] = ( - _deserialize_collaborator_configurations( - de, - _SCHEMA_COLLABORATOR.members["collaboratorConfigurations"], - ) - ) - - case 10: - kwargs["agent_name"] = de.read_string( - _SCHEMA_COLLABORATOR.members["agentName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_COLLABORATOR, consumer=_consumer) - if "foundation_model" not in kwargs: - kwargs["foundation_model"] = "" - if "instruction" not in kwargs: - kwargs["instruction"] = "" - return kwargs - - -@dataclass(kw_only=True) -class RetrieveAndGenerateOperationInput: - """Dataclass for RetrieveAndGenerateOperationInput structure.""" - - session_id: str | None = None - """ - The unique identifier of the session. When you first make a - `RetrieveAndGenerate` request, Amazon Bedrock automatically generates - this value. You must reuse this value for all subsequent requests in the - same conversational session. This value allows Amazon Bedrock to - maintain context and knowledge from previous interactions. You can't - explicitly set the `sessionId` yourself. - """ - - input: RetrieveAndGenerateInput | None = field(repr=False, default=None) - """Contains the query to be made to the knowledge base.""" - - retrieve_and_generate_configuration: "RetrieveAndGenerateConfiguration | None" = ( - None - ) - """ - Contains configurations for the knowledge base query and retrieval - process. For more information, see [Query - configurations](https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html). - """ - - session_configuration: RetrieveAndGenerateSessionConfiguration | None = None - """Contains details about the session with the knowledge base.""" - - user_context: UserContext | None = field(repr=False, default=None) - """ - Contains information about the user making the request. This is used for - access control filtering to ensure that retrieval results only include - documents the user is authorized to access. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVE_AND_GENERATE_OPERATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.session_id is not None: - serializer.write_string( - _SCHEMA_RETRIEVE_AND_GENERATE_OPERATION_INPUT.members["sessionId"], - self.session_id, - ) - - if self.input is not None: - serializer.write_struct( - _SCHEMA_RETRIEVE_AND_GENERATE_OPERATION_INPUT.members["input"], - self.input, - ) - - if self.retrieve_and_generate_configuration is not None: - serializer.write_struct( - _SCHEMA_RETRIEVE_AND_GENERATE_OPERATION_INPUT.members[ - "retrieveAndGenerateConfiguration" - ], - self.retrieve_and_generate_configuration, - ) - - if self.session_configuration is not None: - serializer.write_struct( - _SCHEMA_RETRIEVE_AND_GENERATE_OPERATION_INPUT.members[ - "sessionConfiguration" - ], - self.session_configuration, - ) - - if self.user_context is not None: - serializer.write_struct( - _SCHEMA_RETRIEVE_AND_GENERATE_OPERATION_INPUT.members["userContext"], - self.user_context, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["session_id"] = de.read_string( - _SCHEMA_RETRIEVE_AND_GENERATE_OPERATION_INPUT.members[ - "sessionId" - ] - ) - - case 1: - kwargs["input"] = RetrieveAndGenerateInput.deserialize(de) - - case 2: - kwargs["retrieve_and_generate_configuration"] = ( - RetrieveAndGenerateConfiguration.deserialize(de) - ) - - case 3: - kwargs["session_configuration"] = ( - RetrieveAndGenerateSessionConfiguration.deserialize(de) - ) - - case 4: - kwargs["user_context"] = UserContext.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RETRIEVE_AND_GENERATE_OPERATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class RetrieveAndGenerateStreamInput: - """Dataclass for RetrieveAndGenerateStreamInput structure.""" - - session_id: str | None = None - """ - The unique identifier of the session. When you first make a - `RetrieveAndGenerate` request, Amazon Bedrock automatically generates - this value. You must reuse this value for all subsequent requests in the - same conversational session. This value allows Amazon Bedrock to - maintain context and knowledge from previous interactions. You can't - explicitly set the `sessionId` yourself. - """ - - input: RetrieveAndGenerateInput | None = field(repr=False, default=None) - """Contains the query to be made to the knowledge base.""" - - retrieve_and_generate_configuration: "RetrieveAndGenerateConfiguration | None" = ( - None - ) - """ - Contains configurations for the knowledge base query and retrieval - process. For more information, see [Query - configurations](https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html). - """ - - session_configuration: RetrieveAndGenerateSessionConfiguration | None = None - """Contains details about the session with the knowledge base.""" - - user_context: UserContext | None = field(repr=False, default=None) - """ - Contains information about the user making the request. This is used for - access control filtering to ensure that retrieval results only include - documents the user is authorized to access. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVE_AND_GENERATE_STREAM_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.session_id is not None: - serializer.write_string( - _SCHEMA_RETRIEVE_AND_GENERATE_STREAM_INPUT.members["sessionId"], - self.session_id, - ) - - if self.input is not None: - serializer.write_struct( - _SCHEMA_RETRIEVE_AND_GENERATE_STREAM_INPUT.members["input"], self.input - ) - - if self.retrieve_and_generate_configuration is not None: - serializer.write_struct( - _SCHEMA_RETRIEVE_AND_GENERATE_STREAM_INPUT.members[ - "retrieveAndGenerateConfiguration" - ], - self.retrieve_and_generate_configuration, - ) - - if self.session_configuration is not None: - serializer.write_struct( - _SCHEMA_RETRIEVE_AND_GENERATE_STREAM_INPUT.members[ - "sessionConfiguration" - ], - self.session_configuration, - ) - - if self.user_context is not None: - serializer.write_struct( - _SCHEMA_RETRIEVE_AND_GENERATE_STREAM_INPUT.members["userContext"], - self.user_context, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["session_id"] = de.read_string( - _SCHEMA_RETRIEVE_AND_GENERATE_STREAM_INPUT.members["sessionId"] - ) - - case 1: - kwargs["input"] = RetrieveAndGenerateInput.deserialize(de) - - case 2: - kwargs["retrieve_and_generate_configuration"] = ( - RetrieveAndGenerateConfiguration.deserialize(de) - ) - - case 3: - kwargs["session_configuration"] = ( - RetrieveAndGenerateSessionConfiguration.deserialize(de) - ) - - case 4: - kwargs["user_context"] = UserContext.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RETRIEVE_AND_GENERATE_STREAM_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class SessionState: - """ - Contains parameters that specify various attributes that persist across - a session or prompt. You can define session state attributes as - key-value pairs when writing a [Lambda - function](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-lambda.html) - for an action group or pass them when making an - [InvokeAgent](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html) - request. Use session state attributes to control and provide - conversational context for your agent and to help customize your - agent's behavior. For more information, see [Control session - context](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-session-state.html). - """ - - session_attributes: dict[str, str] | None = None - """ - Contains attributes that persist across a session and the values of - those attributes. If `sessionAttributes` are passed to a supervisor - agent in [multi-agent - collaboration](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-multi-agent-collaboration.html), - it will be forwarded to all agent collaborators. - """ - - prompt_session_attributes: dict[str, str] | None = None - """ - Contains attributes that persist across a prompt and the values of those - attributes. - - - In orchestration prompt template, these attributes replace the - $prompt_session_attributes$ placeholder variable. For more - information, see [Prompt template placeholder - variables](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-placeholders.html). - - - In [multi-agent - collaboration](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-multi-agent-collaboration.html), - the `promptSessionAttributes` will only be used by supervisor agent - when $prompt_session_attributes$ is present in prompt template. - """ - - return_control_invocation_results: list[InvocationResultMember] | None = None - """ - Contains information about the results from the action group invocation. - For more information, see [Return control to the agent - developer](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-returncontrol.html) - and [Control session - context](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-session-state.html). - - Note: - If you include this field, the `inputText` field will be ignored. - """ - - invocation_id: str | None = None - """ - The identifier of the invocation of an action. This value must match the - `invocationId` returned in the `InvokeAgent` response for the action - whose results are provided in the `returnControlInvocationResults` - field. For more information, see [Return control to the agent - developer](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-returncontrol.html) - and [Control session - context](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-session-state.html). - """ - - files: list[InputFile] | None = None - """Contains information about the files used by code interpreter.""" - - knowledge_base_configurations: "list[KnowledgeBaseConfiguration] | None" = None - """ - An array of configurations, each of which applies to a knowledge base - attached to the agent. - """ - - conversation_history: ConversationHistory | None = None - """The state's conversation history.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SESSION_STATE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.session_attributes is not None: - _serialize_session_attributes_map( - serializer, - _SCHEMA_SESSION_STATE.members["sessionAttributes"], - self.session_attributes, - ) - - if self.prompt_session_attributes is not None: - _serialize_prompt_session_attributes_map( - serializer, - _SCHEMA_SESSION_STATE.members["promptSessionAttributes"], - self.prompt_session_attributes, - ) - - if self.return_control_invocation_results is not None: - _serialize_return_control_invocation_results( - serializer, - _SCHEMA_SESSION_STATE.members["returnControlInvocationResults"], - self.return_control_invocation_results, - ) - - if self.invocation_id is not None: - serializer.write_string( - _SCHEMA_SESSION_STATE.members["invocationId"], self.invocation_id - ) - - if self.files is not None: - _serialize_input_files( - serializer, _SCHEMA_SESSION_STATE.members["files"], self.files - ) - - if self.knowledge_base_configurations is not None: - _serialize_knowledge_base_configurations( - serializer, - _SCHEMA_SESSION_STATE.members["knowledgeBaseConfigurations"], - self.knowledge_base_configurations, - ) - - if self.conversation_history is not None: - serializer.write_struct( - _SCHEMA_SESSION_STATE.members["conversationHistory"], - self.conversation_history, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["session_attributes"] = _deserialize_session_attributes_map( - de, _SCHEMA_SESSION_STATE.members["sessionAttributes"] - ) - - case 1: - kwargs["prompt_session_attributes"] = ( - _deserialize_prompt_session_attributes_map( - de, _SCHEMA_SESSION_STATE.members["promptSessionAttributes"] - ) - ) - - case 2: - kwargs["return_control_invocation_results"] = ( - _deserialize_return_control_invocation_results( - de, - _SCHEMA_SESSION_STATE.members[ - "returnControlInvocationResults" - ], - ) - ) - - case 3: - kwargs["invocation_id"] = de.read_string( - _SCHEMA_SESSION_STATE.members["invocationId"] - ) - - case 4: - kwargs["files"] = _deserialize_input_files( - de, _SCHEMA_SESSION_STATE.members["files"] - ) - - case 5: - kwargs["knowledge_base_configurations"] = ( - _deserialize_knowledge_base_configurations( - de, - _SCHEMA_SESSION_STATE.members[ - "knowledgeBaseConfigurations" - ], - ) - ) - - case 6: - kwargs["conversation_history"] = ConversationHistory.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SESSION_STATE, consumer=_consumer) - return kwargs - - -RETRIEVE_AND_GENERATE = APIOperation( - input=RetrieveAndGenerateOperationInput, - output=RetrieveAndGenerateOperationOutput, - schema=_SCHEMA_RETRIEVE_AND_GENERATE, - input_schema=_SCHEMA_RETRIEVE_AND_GENERATE_OPERATION_INPUT, - output_schema=_SCHEMA_RETRIEVE_AND_GENERATE_OPERATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentruntime#BadGatewayException" - ): BadGatewayException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentruntime#DependencyFailedException" - ): DependencyFailedException, - ShapeID( - "com.amazonaws.bedrockagentruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_BAD_GATEWAY_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_DEPENDENCY_FAILED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - -RETRIEVE_AND_GENERATE_STREAM = APIOperation( - input=RetrieveAndGenerateStreamInput, - output=RetrieveAndGenerateStreamOutput, - schema=_SCHEMA_RETRIEVE_AND_GENERATE_STREAM, - input_schema=_SCHEMA_RETRIEVE_AND_GENERATE_STREAM_INPUT, - output_schema=_SCHEMA_RETRIEVE_AND_GENERATE_STREAM_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentruntime#BadGatewayException" - ): BadGatewayException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentruntime#DependencyFailedException" - ): DependencyFailedException, - ShapeID( - "com.amazonaws.bedrockagentruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_BAD_GATEWAY_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_DEPENDENCY_FAILED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -def _serialize_collaborators( - serializer: ShapeSerializer, schema: Schema, value: list[Collaborator] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_collaborators( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Collaborator]: - result: list[Collaborator] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Collaborator.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class InvokeAgentInput: - """Dataclass for InvokeAgentInput structure.""" - - session_state: "SessionState | None" = None - """ - Contains parameters that specify various attributes of the session. For - more information, see [Control session - context](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-session-state.html). - - Note: - If you include `returnControlInvocationResults` in the `sessionState` - field, the `inputText` field will be ignored. - """ - - agent_id: str | None = None - """The unique identifier of the agent to use.""" - - agent_alias_id: str | None = None - """The alias of the agent to use.""" - - session_id: str | None = None - """ - The unique identifier of the session. Use the same value across requests - to continue the same conversation. - """ - - end_session: bool | None = None - """Specifies whether to end the session with the agent or not.""" - - enable_trace: bool | None = None - """ - Specifies whether to turn on the trace or not to track the agent's - reasoning process. For more information, see [Trace - enablement](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-test.html#trace-events). - """ - - input_text: str | None = field(repr=False, default=None) - """ - The prompt text to send the agent. - - Note: - If you include `returnControlInvocationResults` in the `sessionState` - field, the `inputText` field will be ignored. - """ - - memory_id: str | None = None - """The unique identifier of the agent memory.""" - - bedrock_model_configurations: BedrockModelConfigurations | None = None - """Model performance settings for the request.""" - - streaming_configurations: StreamingConfigurations | None = None - """ - Specifies the configurations for streaming. - Note: - To use agent streaming, you need permissions to perform the - `bedrock:InvokeModelWithResponseStream` action. +class ServiceError(ModeledError): """ + Base error for all errors in the service. - prompt_creation_configurations: PromptCreationConfigurations | None = None - """ - Specifies parameters that control how the service populates the agent - prompt for an `InvokeAgent` request. You can control which aspects of - previous invocations in the same agent session the service uses to - populate the agent prompt. This gives you more granular control over the - contextual history that is used to process the current request. + Some exceptions do not extend from this class, including + synthetic, implicit, and shared exception types. """ - source_arn: str | None = None - """The ARN of the resource making the request.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOKE_AGENT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.session_state is not None: - serializer.write_struct( - _SCHEMA_INVOKE_AGENT_INPUT.members["sessionState"], self.session_state - ) - - if self.agent_id is not None: - serializer.write_string( - _SCHEMA_INVOKE_AGENT_INPUT.members["agentId"], self.agent_id - ) - - if self.agent_alias_id is not None: - serializer.write_string( - _SCHEMA_INVOKE_AGENT_INPUT.members["agentAliasId"], self.agent_alias_id - ) - - if self.session_id is not None: - serializer.write_string( - _SCHEMA_INVOKE_AGENT_INPUT.members["sessionId"], self.session_id - ) - - if self.end_session is not None: - serializer.write_boolean( - _SCHEMA_INVOKE_AGENT_INPUT.members["endSession"], self.end_session - ) - - if self.enable_trace is not None: - serializer.write_boolean( - _SCHEMA_INVOKE_AGENT_INPUT.members["enableTrace"], self.enable_trace - ) - - if self.input_text is not None: - serializer.write_string( - _SCHEMA_INVOKE_AGENT_INPUT.members["inputText"], self.input_text - ) - - if self.memory_id is not None: - serializer.write_string( - _SCHEMA_INVOKE_AGENT_INPUT.members["memoryId"], self.memory_id - ) - - if self.bedrock_model_configurations is not None: - serializer.write_struct( - _SCHEMA_INVOKE_AGENT_INPUT.members["bedrockModelConfigurations"], - self.bedrock_model_configurations, - ) - - if self.streaming_configurations is not None: - serializer.write_struct( - _SCHEMA_INVOKE_AGENT_INPUT.members["streamingConfigurations"], - self.streaming_configurations, - ) - - if self.prompt_creation_configurations is not None: - serializer.write_struct( - _SCHEMA_INVOKE_AGENT_INPUT.members["promptCreationConfigurations"], - self.prompt_creation_configurations, - ) - if self.source_arn is not None: - serializer.write_string( - _SCHEMA_INVOKE_AGENT_INPUT.members["sourceArn"], self.source_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["session_state"] = SessionState.deserialize(de) - - case 1: - kwargs["agent_id"] = de.read_string( - _SCHEMA_INVOKE_AGENT_INPUT.members["agentId"] - ) - - case 2: - kwargs["agent_alias_id"] = de.read_string( - _SCHEMA_INVOKE_AGENT_INPUT.members["agentAliasId"] - ) - - case 3: - kwargs["session_id"] = de.read_string( - _SCHEMA_INVOKE_AGENT_INPUT.members["sessionId"] - ) - - case 4: - kwargs["end_session"] = de.read_boolean( - _SCHEMA_INVOKE_AGENT_INPUT.members["endSession"] - ) - - case 5: - kwargs["enable_trace"] = de.read_boolean( - _SCHEMA_INVOKE_AGENT_INPUT.members["enableTrace"] - ) - - case 6: - kwargs["input_text"] = de.read_string( - _SCHEMA_INVOKE_AGENT_INPUT.members["inputText"] - ) - - case 7: - kwargs["memory_id"] = de.read_string( - _SCHEMA_INVOKE_AGENT_INPUT.members["memoryId"] - ) - - case 8: - kwargs["bedrock_model_configurations"] = ( - BedrockModelConfigurations.deserialize(de) - ) - - case 9: - kwargs["streaming_configurations"] = ( - StreamingConfigurations.deserialize(de) - ) - - case 10: - kwargs["prompt_creation_configurations"] = ( - PromptCreationConfigurations.deserialize(de) - ) - - case 11: - kwargs["source_arn"] = de.read_string( - _SCHEMA_INVOKE_AGENT_INPUT.members["sourceArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INVOKE_AGENT_INPUT, consumer=_consumer) - return kwargs - - -INVOKE_AGENT = APIOperation( - input=InvokeAgentInput, - output=InvokeAgentOutput, - schema=_SCHEMA_INVOKE_AGENT, - input_schema=_SCHEMA_INVOKE_AGENT_INPUT, - output_schema=_SCHEMA_INVOKE_AGENT_OUTPUT, - error_registry=TypeRegistry( +_registry = ModelRegistry( + _schemas, + renames={}, + index={ + "AccessDeniedException": "ACCESS_DENIED_EXCEPTION", + "ActionGroupExecutor": "ACTION_GROUP_EXECUTOR", + "ActionGroupExecutorLambda": "ACTION_GROUP_EXECUTOR", + "ActionGroupExecutorCustomControl": "ACTION_GROUP_EXECUTOR", + "ActionGroupExecutorUnknown": "ACTION_GROUP_EXECUTOR", + "ActionGroupInvocationInput": "ACTION_GROUP_INVOCATION_INPUT", + "ActionGroupInvocationOutput": "ACTION_GROUP_INVOCATION_OUTPUT", + "ActionGroupSignature": "ACTION_GROUP_SIGNATURE", + "ActionInvocationType": "ACTION_INVOCATION_TYPE", + "AgentActionGroup": "AGENT_ACTION_GROUP", + "AgentCollaboration": "AGENT_COLLABORATION", + "AgentCollaboratorInputPayload": "AGENT_COLLABORATOR_INPUT_PAYLOAD", + "AgentCollaboratorInvocationInput": "AGENT_COLLABORATOR_INVOCATION_INPUT", + "AgentCollaboratorInvocationOutput": "AGENT_COLLABORATOR_INVOCATION_OUTPUT", + "AgentCollaboratorOutputPayload": "AGENT_COLLABORATOR_OUTPUT_PAYLOAD", + "AgenticRetrieveAction": "AGENTIC_RETRIEVE_ACTION", + "AgenticRetrieveActionDetails": "AGENTIC_RETRIEVE_ACTION_DETAILS", + "AgenticRetrieveBedrockGuardrailConfiguration": "AGENTIC_RETRIEVE_BEDROCK_GUARDRAIL_CONFIGURATION", + "AgenticRetrieveBedrockRerankingConfiguration": "AGENTIC_RETRIEVE_BEDROCK_RERANKING_CONFIGURATION", + "AgenticRetrieveBedrockRerankingModelConfiguration": "AGENTIC_RETRIEVE_BEDROCK_RERANKING_MODEL_CONFIGURATION", + "AgenticRetrieveCitation": "AGENTIC_RETRIEVE_CITATION", + "AgenticRetrieveCitationReference": "AGENTIC_RETRIEVE_CITATION_REFERENCE", + "AgenticRetrieveConfiguration": "AGENTIC_RETRIEVE_CONFIGURATION", + "AgenticRetrieveFailure": "AGENTIC_RETRIEVE_FAILURE", + "AgenticRetrieveFullDocExpansionDetails": "AGENTIC_RETRIEVE_FULL_DOC_EXPANSION_DETAILS", + "AgenticRetrieveGeneratedResponse": "AGENTIC_RETRIEVE_GENERATED_RESPONSE", + "AgenticRetrieveGuardrailWarning": "AGENTIC_RETRIEVE_GUARDRAIL_WARNING", + "AgenticRetrieveMemoryConfiguration": "AGENTIC_RETRIEVE_MEMORY_CONFIGURATION", + "AgenticRetrieveMemoryMetadataFilter": "AGENTIC_RETRIEVE_MEMORY_METADATA_FILTER", + "AgenticRetrieveMemoryMetadataFilterLeft": "AGENTIC_RETRIEVE_MEMORY_METADATA_FILTER_LEFT", + "AgenticRetrieveMemoryMetadataFilterLeftMetadataKey": "AGENTIC_RETRIEVE_MEMORY_METADATA_FILTER_LEFT", + "AgenticRetrieveMemoryMetadataFilterLeftUnknown": "AGENTIC_RETRIEVE_MEMORY_METADATA_FILTER_LEFT", + "AgenticRetrieveMemoryMetadataFilterOperator": "AGENTIC_RETRIEVE_MEMORY_METADATA_FILTER_OPERATOR", + "AgenticRetrieveMemoryMetadataFilterRight": "AGENTIC_RETRIEVE_MEMORY_METADATA_FILTER_RIGHT", + "AgenticRetrieveMemoryMetadataFilterRightMetadataValue": "AGENTIC_RETRIEVE_MEMORY_METADATA_FILTER_RIGHT", + "AgenticRetrieveMemoryMetadataFilterRightUnknown": "AGENTIC_RETRIEVE_MEMORY_METADATA_FILTER_RIGHT", + "AgenticRetrieveMemoryMetadataValue": "AGENTIC_RETRIEVE_MEMORY_METADATA_VALUE", + "AgenticRetrieveMemoryMetadataValueStringValue": "AGENTIC_RETRIEVE_MEMORY_METADATA_VALUE", + "AgenticRetrieveMemoryMetadataValueNumberValue": "AGENTIC_RETRIEVE_MEMORY_METADATA_VALUE", + "AgenticRetrieveMemoryMetadataValueStringListValue": "AGENTIC_RETRIEVE_MEMORY_METADATA_VALUE", + "AgenticRetrieveMemoryMetadataValueDateTimeValue": "AGENTIC_RETRIEVE_MEMORY_METADATA_VALUE", + "AgenticRetrieveMemoryMetadataValueUnknown": "AGENTIC_RETRIEVE_MEMORY_METADATA_VALUE", + "AgenticRetrieveMemoryPersistenceMode": "AGENTIC_RETRIEVE_MEMORY_PERSISTENCE_MODE", + "AgenticRetrieveMemoryRetrievalConfig": "AGENTIC_RETRIEVE_MEMORY_RETRIEVAL_CONFIG", + "AgenticRetrieveMemoryRetrieveDetails": "AGENTIC_RETRIEVE_MEMORY_RETRIEVE_DETAILS", + "AgenticRetrieveMemorySessionBinding": "AGENTIC_RETRIEVE_MEMORY_SESSION_BINDING", + "AgenticRetrieveMessage": "AGENTIC_RETRIEVE_MESSAGE", + "AgenticRetrieveMessageContent": "AGENTIC_RETRIEVE_MESSAGE_CONTENT", + "AgenticRetrievePolicyConfiguration": "AGENTIC_RETRIEVE_POLICY_CONFIGURATION", + "AgenticRetriever": "AGENTIC_RETRIEVER", + "AgenticRetrieveRerankingConfiguration": "AGENTIC_RETRIEVE_RERANKING_CONFIGURATION", + "AgenticRetrieveRerankingConfigurationType": "AGENTIC_RETRIEVE_RERANKING_CONFIGURATION_TYPE", + "AgenticRetrieveRerankingModelType": "AGENTIC_RETRIEVE_RERANKING_MODEL_TYPE", + "AgenticRetrieveResponseEvent": "AGENTIC_RETRIEVE_RESPONSE_EVENT", + "AgenticRetrieveResultEvent": "AGENTIC_RETRIEVE_RESULT_EVENT", + "AgenticRetrieveResultItem": "AGENTIC_RETRIEVE_RESULT_ITEM", + "AgenticRetrieveSourceMetadata": "AGENTIC_RETRIEVE_SOURCE_METADATA", + "AgenticRetrieveSourceRetriever": "AGENTIC_RETRIEVE_SOURCE_RETRIEVER", + "AgenticRetrieveStatus": "AGENTIC_RETRIEVE_STATUS", + "AgenticRetrieveStep": "AGENTIC_RETRIEVE_STEP", + "AgenticRetrieveStreamInput": "AGENTIC_RETRIEVE_STREAM_INPUT", + "AgenticRetrieveStreamOutput": "AGENTIC_RETRIEVE_STREAM_OUTPUT", + "AgenticRetrieveStreamResponseOutput": "AGENTIC_RETRIEVE_STREAM_RESPONSE_OUTPUT", + "AgenticRetrieveStreamResponseOutputResult": "AGENTIC_RETRIEVE_STREAM_RESPONSE_OUTPUT", + "AgenticRetrieveStreamResponseOutputTraceEvent": "AGENTIC_RETRIEVE_STREAM_RESPONSE_OUTPUT", + "AgenticRetrieveStreamResponseOutputResponseEvent": "AGENTIC_RETRIEVE_STREAM_RESPONSE_OUTPUT", + "AgenticRetrieveStreamResponseOutputInternalServerException": "AGENTIC_RETRIEVE_STREAM_RESPONSE_OUTPUT", + "AgenticRetrieveStreamResponseOutputValidationException": "AGENTIC_RETRIEVE_STREAM_RESPONSE_OUTPUT", + "AgenticRetrieveStreamResponseOutputResourceNotFoundException": "AGENTIC_RETRIEVE_STREAM_RESPONSE_OUTPUT", + "AgenticRetrieveStreamResponseOutputServiceQuotaExceededException": "AGENTIC_RETRIEVE_STREAM_RESPONSE_OUTPUT", + "AgenticRetrieveStreamResponseOutputThrottlingException": "AGENTIC_RETRIEVE_STREAM_RESPONSE_OUTPUT", + "AgenticRetrieveStreamResponseOutputAccessDeniedException": "AGENTIC_RETRIEVE_STREAM_RESPONSE_OUTPUT", + "AgenticRetrieveStreamResponseOutputConflictException": "AGENTIC_RETRIEVE_STREAM_RESPONSE_OUTPUT", + "AgenticRetrieveStreamResponseOutputDependencyFailedException": "AGENTIC_RETRIEVE_STREAM_RESPONSE_OUTPUT", + "AgenticRetrieveStreamResponseOutputBadGatewayException": "AGENTIC_RETRIEVE_STREAM_RESPONSE_OUTPUT", + "AgenticRetrieveStreamResponseOutputUnknown": "AGENTIC_RETRIEVE_STREAM_RESPONSE_OUTPUT", + "AgenticRetrieveTraceEvent": "AGENTIC_RETRIEVE_TRACE_EVENT", + "AgenticRetrieveTraceEventAttributes": "AGENTIC_RETRIEVE_TRACE_EVENT_ATTRIBUTES", + "AgenticRetrieveTraceResultItem": "AGENTIC_RETRIEVE_TRACE_RESULT_ITEM", + "AgenticRetrieveType": "AGENTIC_RETRIEVE_TYPE", + "AgenticRetrieveWarning": "AGENTIC_RETRIEVE_WARNING", + "AgenticRetrieveWarning_Message": "AGENTIC_RETRIEVE_WARNING", + "AgenticRetrieveWarningGuardrail": "AGENTIC_RETRIEVE_WARNING", + "AgenticRetrieveWarningUnknown": "AGENTIC_RETRIEVE_WARNING", + "AgenticRetrieveWarningMessage": "AGENTIC_RETRIEVE_WARNING_MESSAGE", + "AnalyzePromptEvent": "ANALYZE_PROMPT_EVENT", + "ApiInvocationInput": "API_INVOCATION_INPUT", + "ApiParameter": "API_PARAMETER", + "ApiRequestBody": "API_REQUEST_BODY", + "ApiResult": "API_RESULT", + "APISchema": "API_SCHEMA", + "APISchemaS3": "API_SCHEMA", + "APISchemaPayload": "API_SCHEMA", + "APISchemaUnknown": "API_SCHEMA", + "AttributeType": "ATTRIBUTE_TYPE", + "Attribution": "ATTRIBUTION", + "AudioSegment": "AUDIO_SEGMENT", + "BadGatewayException": "BAD_GATEWAY_EXCEPTION", + "BedrockFoundationModelConfiguration": "BEDROCK_FOUNDATION_MODEL_CONFIGURATION", + "BedrockFoundationModelModelConfiguration": "BEDROCK_FOUNDATION_MODEL_MODEL_CONFIGURATION", + "BedrockModelConfigurations": "BEDROCK_MODEL_CONFIGURATIONS", + "BedrockRerankingConfiguration": "BEDROCK_RERANKING_CONFIGURATION", + "BedrockRerankingModelConfiguration": "BEDROCK_RERANKING_MODEL_CONFIGURATION", + "BedrockSessionContentBlock": "BEDROCK_SESSION_CONTENT_BLOCK", + "BedrockSessionContentBlockText": "BEDROCK_SESSION_CONTENT_BLOCK", + "BedrockSessionContentBlockImage": "BEDROCK_SESSION_CONTENT_BLOCK", + "BedrockSessionContentBlockUnknown": "BEDROCK_SESSION_CONTENT_BLOCK", + "ByteContentDoc": "BYTE_CONTENT_DOC", + "ByteContentFile": "BYTE_CONTENT_FILE", + "Caller": "CALLER", + "CallerAgentAliasArn": "CALLER", + "CallerUnknown": "CALLER", + "CheckIngestedDocumentAclInput": "CHECK_INGESTED_DOCUMENT_ACL_INPUT", + "CheckIngestedDocumentAclOutput": "CHECK_INGESTED_DOCUMENT_ACL_OUTPUT", + "Citation": "CITATION", + "CitationEvent": "CITATION_EVENT", + "CodeInterpreterInvocationInput": "CODE_INTERPRETER_INVOCATION_INPUT", + "CodeInterpreterInvocationOutput": "CODE_INTERPRETER_INVOCATION_OUTPUT", + "Collaborator": "COLLABORATOR", + "CollaboratorConfiguration": "COLLABORATOR_CONFIGURATION", + "ConditionResultEvent": "CONDITION_RESULT_EVENT", + "ConfirmationState": "CONFIRMATION_STATE", + "ConflictException": "CONFLICT_EXCEPTION", + "ContentBlock": "CONTENT_BLOCK", + "ContentBlockText": "CONTENT_BLOCK", + "ContentBlockUnknown": "CONTENT_BLOCK", + "ContentBody": "CONTENT_BODY", + "ConversationHistory": "CONVERSATION_HISTORY", + "ConversationRole": "CONVERSATION_ROLE", + "CreateInvocationInput": "CREATE_INVOCATION_INPUT", + "CreateInvocationOutput": "CREATE_INVOCATION_OUTPUT", + "CreateSessionInput": "CREATE_SESSION_INPUT", + "CreateSessionOutput": "CREATE_SESSION_OUTPUT", + "CreationMode": "CREATION_MODE", + "CustomControlMethod": "CUSTOM_CONTROL_METHOD", + "CustomOrchestration": "CUSTOM_ORCHESTRATION", + "CustomOrchestrationTrace": "CUSTOM_ORCHESTRATION_TRACE", + "CustomOrchestrationTraceEvent": "CUSTOM_ORCHESTRATION_TRACE_EVENT", + "DeleteAgentMemoryInput": "DELETE_AGENT_MEMORY_INPUT", + "DeleteAgentMemoryOutput": "DELETE_AGENT_MEMORY_OUTPUT", + "DeleteSessionInput": "DELETE_SESSION_INPUT", + "DeleteSessionOutput": "DELETE_SESSION_OUTPUT", + "DependencyFailedException": "DEPENDENCY_FAILED_EXCEPTION", + "DocumentAcl": "DOCUMENT_ACL", + "DocumentAclCondition": "DOCUMENT_ACL_CONDITION", + "DocumentAclGroup": "DOCUMENT_ACL_GROUP", + "DocumentAclMemberRelation": "DOCUMENT_ACL_MEMBER_RELATION", + "DocumentAclMembership": "DOCUMENT_ACL_MEMBERSHIP", + "DocumentAclMembershipType": "DOCUMENT_ACL_MEMBERSHIP_TYPE", + "DocumentAclUser": "DOCUMENT_ACL_USER", + "DocumentOutputFormat": "DOCUMENT_OUTPUT_FORMAT", + "EndSessionInput": "END_SESSION_INPUT", + "EndSessionOutput": "END_SESSION_OUTPUT", + "ExecutionType": "EXECUTION_TYPE", + "ExternalSource": "EXTERNAL_SOURCE", + "ExternalSourcesGenerationConfiguration": "EXTERNAL_SOURCES_GENERATION_CONFIGURATION", + "ExternalSourcesRetrieveAndGenerateConfiguration": "EXTERNAL_SOURCES_RETRIEVE_AND_GENERATE_CONFIGURATION", + "ExternalSourceType": "EXTERNAL_SOURCE_TYPE", + "FailureTrace": "FAILURE_TRACE", + "FieldForReranking": "FIELD_FOR_RERANKING", + "FilePart": "FILE_PART", + "FileSource": "FILE_SOURCE", + "FileSourceType": "FILE_SOURCE_TYPE", + "FileUseCase": "FILE_USE_CASE", + "FilterAttribute": "FILTER_ATTRIBUTE", + "FinalResponse": "FINAL_RESPONSE", + "FlowCompletionEvent": "FLOW_COMPLETION_EVENT", + "FlowCompletionReason": "FLOW_COMPLETION_REASON", + "FlowControlNodeType": "FLOW_CONTROL_NODE_TYPE", + "FlowErrorCode": "FLOW_ERROR_CODE", + "FlowExecutionContent": "FLOW_EXECUTION_CONTENT", + "FlowExecutionContentDocument": "FLOW_EXECUTION_CONTENT", + "FlowExecutionContentUnknown": "FLOW_EXECUTION_CONTENT", + "FlowExecutionError": "FLOW_EXECUTION_ERROR", + "FlowExecutionErrorType": "FLOW_EXECUTION_ERROR_TYPE", + "FlowExecutionEvent": "FLOW_EXECUTION_EVENT", + "FlowExecutionEventFlowInputEvent": "FLOW_EXECUTION_EVENT", + "FlowExecutionEventFlowOutputEvent": "FLOW_EXECUTION_EVENT", + "FlowExecutionEventNodeInputEvent": "FLOW_EXECUTION_EVENT", + "FlowExecutionEventNodeOutputEvent": "FLOW_EXECUTION_EVENT", + "FlowExecutionEventConditionResultEvent": "FLOW_EXECUTION_EVENT", + "FlowExecutionEventNodeFailureEvent": "FLOW_EXECUTION_EVENT", + "FlowExecutionEventFlowFailureEvent": "FLOW_EXECUTION_EVENT", + "FlowExecutionEventNodeActionEvent": "FLOW_EXECUTION_EVENT", + "FlowExecutionEventNodeDependencyEvent": "FLOW_EXECUTION_EVENT", + "FlowExecutionEventUnknown": "FLOW_EXECUTION_EVENT", + "FlowExecutionEventType": "FLOW_EXECUTION_EVENT_TYPE", + "FlowExecutionInputEvent": "FLOW_EXECUTION_INPUT_EVENT", + "FlowExecutionOutputEvent": "FLOW_EXECUTION_OUTPUT_EVENT", + "FlowExecutionStatus": "FLOW_EXECUTION_STATUS", + "FlowExecutionSummary": "FLOW_EXECUTION_SUMMARY", + "FlowFailureEvent": "FLOW_FAILURE_EVENT", + "FlowInput": "FLOW_INPUT", + "FlowInputContent": "FLOW_INPUT_CONTENT", + "FlowInputContentDocument": "FLOW_INPUT_CONTENT", + "FlowInputContentUnknown": "FLOW_INPUT_CONTENT", + "FlowInputField": "FLOW_INPUT_FIELD", + "FlowMultiTurnInputContent": "FLOW_MULTI_TURN_INPUT_CONTENT", + "FlowMultiTurnInputContentDocument": "FLOW_MULTI_TURN_INPUT_CONTENT", + "FlowMultiTurnInputContentUnknown": "FLOW_MULTI_TURN_INPUT_CONTENT", + "FlowMultiTurnInputRequestEvent": "FLOW_MULTI_TURN_INPUT_REQUEST_EVENT", + "FlowNodeInputCategory": "FLOW_NODE_INPUT_CATEGORY", + "FlowNodeIODataType": "FLOW_NODE_IO_DATA_TYPE", + "FlowOutputContent": "FLOW_OUTPUT_CONTENT", + "FlowOutputContentDocument": "FLOW_OUTPUT_CONTENT", + "FlowOutputContentUnknown": "FLOW_OUTPUT_CONTENT", + "FlowOutputEvent": "FLOW_OUTPUT_EVENT", + "FlowOutputField": "FLOW_OUTPUT_FIELD", + "FlowResponseStream": "FLOW_RESPONSE_STREAM", + "FlowResponseStreamFlowOutputEvent": "FLOW_RESPONSE_STREAM", + "FlowResponseStreamFlowCompletionEvent": "FLOW_RESPONSE_STREAM", + "FlowResponseStreamFlowTraceEvent": "FLOW_RESPONSE_STREAM", + "FlowResponseStreamInternalServerException": "FLOW_RESPONSE_STREAM", + "FlowResponseStreamValidationException": "FLOW_RESPONSE_STREAM", + "FlowResponseStreamResourceNotFoundException": "FLOW_RESPONSE_STREAM", + "FlowResponseStreamServiceQuotaExceededException": "FLOW_RESPONSE_STREAM", + "FlowResponseStreamThrottlingException": "FLOW_RESPONSE_STREAM", + "FlowResponseStreamAccessDeniedException": "FLOW_RESPONSE_STREAM", + "FlowResponseStreamConflictException": "FLOW_RESPONSE_STREAM", + "FlowResponseStreamDependencyFailedException": "FLOW_RESPONSE_STREAM", + "FlowResponseStreamBadGatewayException": "FLOW_RESPONSE_STREAM", + "FlowResponseStreamFlowMultiTurnInputRequestEvent": "FLOW_RESPONSE_STREAM", + "FlowResponseStreamUnknown": "FLOW_RESPONSE_STREAM", + "FlowTrace": "FLOW_TRACE", + "FlowTraceNodeInputTrace": "FLOW_TRACE", + "FlowTraceNodeOutputTrace": "FLOW_TRACE", + "FlowTraceConditionNodeResultTrace": "FLOW_TRACE", + "FlowTraceNodeActionTrace": "FLOW_TRACE", + "FlowTraceNodeDependencyTrace": "FLOW_TRACE", + "FlowTraceUnknown": "FLOW_TRACE", + "FlowTraceCondition": "FLOW_TRACE_CONDITION", + "FlowTraceConditionNodeResultEvent": "FLOW_TRACE_CONDITION_NODE_RESULT_EVENT", + "FlowTraceDependencyEvent": "FLOW_TRACE_DEPENDENCY_EVENT", + "FlowTraceEvent": "FLOW_TRACE_EVENT", + "FlowTraceNodeActionEvent": "FLOW_TRACE_NODE_ACTION_EVENT", + "FlowTraceNodeInputContent": "FLOW_TRACE_NODE_INPUT_CONTENT", + "FlowTraceNodeInputContentDocument": "FLOW_TRACE_NODE_INPUT_CONTENT", + "FlowTraceNodeInputContentUnknown": "FLOW_TRACE_NODE_INPUT_CONTENT", + "FlowTraceNodeInputEvent": "FLOW_TRACE_NODE_INPUT_EVENT", + "FlowTraceNodeInputExecutionChainItem": "FLOW_TRACE_NODE_INPUT_EXECUTION_CHAIN_ITEM", + "FlowTraceNodeInputField": "FLOW_TRACE_NODE_INPUT_FIELD", + "FlowTraceNodeInputSource": "FLOW_TRACE_NODE_INPUT_SOURCE", + "FlowTraceNodeOutputContent": "FLOW_TRACE_NODE_OUTPUT_CONTENT", + "FlowTraceNodeOutputContentDocument": "FLOW_TRACE_NODE_OUTPUT_CONTENT", + "FlowTraceNodeOutputContentUnknown": "FLOW_TRACE_NODE_OUTPUT_CONTENT", + "FlowTraceNodeOutputEvent": "FLOW_TRACE_NODE_OUTPUT_EVENT", + "FlowTraceNodeOutputField": "FLOW_TRACE_NODE_OUTPUT_FIELD", + "FlowTraceNodeOutputNext": "FLOW_TRACE_NODE_OUTPUT_NEXT", + "FoundationModelConfiguration": "FOUNDATION_MODEL_CONFIGURATION", + "FoundationModelConfigurationType": "FOUNDATION_MODEL_CONFIGURATION_TYPE", + "FoundationModelType": "FOUNDATION_MODEL_TYPE", + "FunctionDefinition": "FUNCTION_DEFINITION", + "FunctionInvocationInput": "FUNCTION_INVOCATION_INPUT", + "FunctionParameter": "FUNCTION_PARAMETER", + "FunctionResult": "FUNCTION_RESULT", + "FunctionSchema": "FUNCTION_SCHEMA", + "FunctionSchemaFunctions": "FUNCTION_SCHEMA", + "FunctionSchemaUnknown": "FUNCTION_SCHEMA", + "GeneratedQuery": "GENERATED_QUERY", + "GeneratedQueryType": "GENERATED_QUERY_TYPE", + "GeneratedResponsePart": "GENERATED_RESPONSE_PART", + "GenerateQueryInput": "GENERATE_QUERY_INPUT", + "GenerateQueryOutput": "GENERATE_QUERY_OUTPUT", + "GenerationConfiguration": "GENERATION_CONFIGURATION", + "GetAgentMemoryInput": "GET_AGENT_MEMORY_INPUT", + "GetAgentMemoryOutput": "GET_AGENT_MEMORY_OUTPUT", + "GetDocumentContentInput": "GET_DOCUMENT_CONTENT_INPUT", + "GetDocumentContentOutput": "GET_DOCUMENT_CONTENT_OUTPUT", + "GetExecutionFlowSnapshotInput": "GET_EXECUTION_FLOW_SNAPSHOT_INPUT", + "GetExecutionFlowSnapshotOutput": "GET_EXECUTION_FLOW_SNAPSHOT_OUTPUT", + "GetFlowExecutionInput": "GET_FLOW_EXECUTION_INPUT", + "GetFlowExecutionOutput": "GET_FLOW_EXECUTION_OUTPUT", + "GetIngestedDocumentAclInput": "GET_INGESTED_DOCUMENT_ACL_INPUT", + "GetIngestedDocumentAclOutput": "GET_INGESTED_DOCUMENT_ACL_OUTPUT", + "GetInvocationStepInput": "GET_INVOCATION_STEP_INPUT", + "GetInvocationStepOutput": "GET_INVOCATION_STEP_OUTPUT", + "GetSessionInput": "GET_SESSION_INPUT", + "GetSessionOutput": "GET_SESSION_OUTPUT", + "GuadrailAction": "GUADRAIL_ACTION", + "GuardrailAction": "GUARDRAIL_ACTION", + "GuardrailAssessment": "GUARDRAIL_ASSESSMENT", + "GuardrailConfiguration": "GUARDRAIL_CONFIGURATION", + "GuardrailConfigurationWithArn": "GUARDRAIL_CONFIGURATION_WITH_ARN", + "GuardrailContentFilter": "GUARDRAIL_CONTENT_FILTER", + "GuardrailContentFilterConfidence": "GUARDRAIL_CONTENT_FILTER_CONFIDENCE", + "GuardrailContentFilterType": "GUARDRAIL_CONTENT_FILTER_TYPE", + "GuardrailContentPolicyAction": "GUARDRAIL_CONTENT_POLICY_ACTION", + "GuardrailContentPolicyAssessment": "GUARDRAIL_CONTENT_POLICY_ASSESSMENT", + "GuardrailCustomWord": "GUARDRAIL_CUSTOM_WORD", + "GuardrailEvent": "GUARDRAIL_EVENT", + "GuardrailManagedWord": "GUARDRAIL_MANAGED_WORD", + "GuardrailManagedWordType": "GUARDRAIL_MANAGED_WORD_TYPE", + "GuardrailPiiEntityFilter": "GUARDRAIL_PII_ENTITY_FILTER", + "GuardrailPiiEntityType": "GUARDRAIL_PII_ENTITY_TYPE", + "GuardrailRegexFilter": "GUARDRAIL_REGEX_FILTER", + "GuardrailSensitiveInformationPolicyAction": "GUARDRAIL_SENSITIVE_INFORMATION_POLICY_ACTION", + "GuardrailSensitiveInformationPolicyAssessment": "GUARDRAIL_SENSITIVE_INFORMATION_POLICY_ASSESSMENT", + "GuardrailTopic": "GUARDRAIL_TOPIC", + "GuardrailTopicPolicyAction": "GUARDRAIL_TOPIC_POLICY_ACTION", + "GuardrailTopicPolicyAssessment": "GUARDRAIL_TOPIC_POLICY_ASSESSMENT", + "GuardrailTopicType": "GUARDRAIL_TOPIC_TYPE", + "GuardrailTrace": "GUARDRAIL_TRACE", + "GuardrailWordPolicyAction": "GUARDRAIL_WORD_POLICY_ACTION", + "GuardrailWordPolicyAssessment": "GUARDRAIL_WORD_POLICY_ASSESSMENT", + "ImageBlock": "IMAGE_BLOCK", + "ImageFormat": "IMAGE_FORMAT", + "ImageInput": "IMAGE_INPUT", + "ImageInputFormat": "IMAGE_INPUT_FORMAT", + "ImageInputSource": "IMAGE_INPUT_SOURCE", + "ImageInputSourceBytes": "IMAGE_INPUT_SOURCE", + "ImageInputSourceUnknown": "IMAGE_INPUT_SOURCE", + "ImageSource": "IMAGE_SOURCE", + "ImageSourceBytes": "IMAGE_SOURCE", + "ImageSourceS3Location": "IMAGE_SOURCE", + "ImageSourceUnknown": "IMAGE_SOURCE", + "ImplicitFilterConfiguration": "IMPLICIT_FILTER_CONFIGURATION", + "InferenceConfig": "INFERENCE_CONFIG", + "InferenceConfiguration": "INFERENCE_CONFIGURATION", + "InlineAgentFilePart": "INLINE_AGENT_FILE_PART", + "InlineAgentPayloadPart": "INLINE_AGENT_PAYLOAD_PART", + "InlineAgentResponseStream": "INLINE_AGENT_RESPONSE_STREAM", + "InlineAgentResponseStreamChunk": "INLINE_AGENT_RESPONSE_STREAM", + "InlineAgentResponseStreamTrace": "INLINE_AGENT_RESPONSE_STREAM", + "InlineAgentResponseStreamReturnControl": "INLINE_AGENT_RESPONSE_STREAM", + "InlineAgentResponseStreamInternalServerException": "INLINE_AGENT_RESPONSE_STREAM", + "InlineAgentResponseStreamValidationException": "INLINE_AGENT_RESPONSE_STREAM", + "InlineAgentResponseStreamResourceNotFoundException": "INLINE_AGENT_RESPONSE_STREAM", + "InlineAgentResponseStreamServiceQuotaExceededException": "INLINE_AGENT_RESPONSE_STREAM", + "InlineAgentResponseStreamThrottlingException": "INLINE_AGENT_RESPONSE_STREAM", + "InlineAgentResponseStreamAccessDeniedException": "INLINE_AGENT_RESPONSE_STREAM", + "InlineAgentResponseStreamConflictException": "INLINE_AGENT_RESPONSE_STREAM", + "InlineAgentResponseStreamDependencyFailedException": "INLINE_AGENT_RESPONSE_STREAM", + "InlineAgentResponseStreamBadGatewayException": "INLINE_AGENT_RESPONSE_STREAM", + "InlineAgentResponseStreamFiles": "INLINE_AGENT_RESPONSE_STREAM", + "InlineAgentResponseStreamUnknown": "INLINE_AGENT_RESPONSE_STREAM", + "InlineAgentReturnControlPayload": "INLINE_AGENT_RETURN_CONTROL_PAYLOAD", + "InlineAgentTracePart": "INLINE_AGENT_TRACE_PART", + "InlineBedrockModelConfigurations": "INLINE_BEDROCK_MODEL_CONFIGURATIONS", + "InlineSessionState": "INLINE_SESSION_STATE", + "InputFile": "INPUT_FILE", + "InputImage": "INPUT_IMAGE", + "InputImageFormat": "INPUT_IMAGE_FORMAT", + "InputPrompt": "INPUT_PROMPT", + "InputPromptTextPrompt": "INPUT_PROMPT", + "InputPromptUnknown": "INPUT_PROMPT", + "InputQueryType": "INPUT_QUERY_TYPE", + "InternalServerException": "INTERNAL_SERVER_EXCEPTION", + "InvocationInput": "INVOCATION_INPUT", + "InvocationInputMember": "INVOCATION_INPUT_MEMBER", + "InvocationInputMemberApiInvocationInput": "INVOCATION_INPUT_MEMBER", + "InvocationInputMemberFunctionInvocationInput": "INVOCATION_INPUT_MEMBER", + "InvocationInputMemberUnknown": "INVOCATION_INPUT_MEMBER", + "InvocationResultMember": "INVOCATION_RESULT_MEMBER", + "InvocationResultMemberApiResult": "INVOCATION_RESULT_MEMBER", + "InvocationResultMemberFunctionResult": "INVOCATION_RESULT_MEMBER", + "InvocationResultMemberUnknown": "INVOCATION_RESULT_MEMBER", + "InvocationStep": "INVOCATION_STEP", + "InvocationStepPayload": "INVOCATION_STEP_PAYLOAD", + "InvocationStepPayloadContentBlocks": "INVOCATION_STEP_PAYLOAD", + "InvocationStepPayloadUnknown": "INVOCATION_STEP_PAYLOAD", + "InvocationStepSummary": "INVOCATION_STEP_SUMMARY", + "InvocationSummary": "INVOCATION_SUMMARY", + "InvocationType": "INVOCATION_TYPE", + "InvokeAgentInput": "INVOKE_AGENT_INPUT", + "InvokeAgentOutput": "INVOKE_AGENT_OUTPUT", + "InvokeFlowInput": "INVOKE_FLOW_INPUT", + "InvokeFlowOutput": "INVOKE_FLOW_OUTPUT", + "InvokeInlineAgentInput": "INVOKE_INLINE_AGENT_INPUT", + "InvokeInlineAgentOutput": "INVOKE_INLINE_AGENT_OUTPUT", + "KnowledgeBase": "KNOWLEDGE_BASE", + "KnowledgeBaseConfiguration": "KNOWLEDGE_BASE_CONFIGURATION", + "KnowledgeBaseLookupInput": "KNOWLEDGE_BASE_LOOKUP_INPUT", + "KnowledgeBaseLookupOutput": "KNOWLEDGE_BASE_LOOKUP_OUTPUT", + "KnowledgeBaseQuery": "KNOWLEDGE_BASE_QUERY", + "KnowledgeBaseQueryType": "KNOWLEDGE_BASE_QUERY_TYPE", + "KnowledgeBaseRetrievalConfiguration": "KNOWLEDGE_BASE_RETRIEVAL_CONFIGURATION", + "KnowledgeBaseRetrievalResult": "KNOWLEDGE_BASE_RETRIEVAL_RESULT", + "KnowledgeBaseRetrieveAndGenerateConfiguration": "KNOWLEDGE_BASE_RETRIEVE_AND_GENERATE_CONFIGURATION", + "KnowledgeBaseRetrieverConfiguration": "KNOWLEDGE_BASE_RETRIEVER_CONFIGURATION", + "KnowledgeBaseVectorSearchConfiguration": "KNOWLEDGE_BASE_VECTOR_SEARCH_CONFIGURATION", + "ListFlowExecutionEventsInput": "LIST_FLOW_EXECUTION_EVENTS_INPUT", + "ListFlowExecutionEventsOutput": "LIST_FLOW_EXECUTION_EVENTS_OUTPUT", + "ListFlowExecutionsInput": "LIST_FLOW_EXECUTIONS_INPUT", + "ListFlowExecutionsOutput": "LIST_FLOW_EXECUTIONS_OUTPUT", + "ListInvocationsInput": "LIST_INVOCATIONS_INPUT", + "ListInvocationsOutput": "LIST_INVOCATIONS_OUTPUT", + "ListInvocationStepsInput": "LIST_INVOCATION_STEPS_INPUT", + "ListInvocationStepsOutput": "LIST_INVOCATION_STEPS_OUTPUT", + "ListSessionsInput": "LIST_SESSIONS_INPUT", + "ListSessionsOutput": "LIST_SESSIONS_OUTPUT", + "ListTagsForResourceInput": "LIST_TAGS_FOR_RESOURCE_INPUT", + "ListTagsForResourceOutput": "LIST_TAGS_FOR_RESOURCE_OUTPUT", + "ManagedSearchBedrockRerankingConfiguration": "MANAGED_SEARCH_BEDROCK_RERANKING_CONFIGURATION", + "ManagedSearchBedrockRerankingModelConfiguration": "MANAGED_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION", + "ManagedSearchConfiguration": "MANAGED_SEARCH_CONFIGURATION", + "ManagedSearchRerankingConfiguration": "MANAGED_SEARCH_RERANKING_CONFIGURATION", + "ManagedSearchRerankingConfigurationType": "MANAGED_SEARCH_RERANKING_CONFIGURATION_TYPE", + "MantleFoundationModelConfiguration": "MANTLE_FOUNDATION_MODEL_CONFIGURATION", + "MantleFoundationModelModelConfiguration": "MANTLE_FOUNDATION_MODEL_MODEL_CONFIGURATION", + "Memory": "MEMORY", + "Memory_SessionSummary": "MEMORY", + "MemoryUnknown": "MEMORY", + "MemorySessionSummary": "MEMORY_SESSION_SUMMARY", + "MemoryType": "MEMORY_TYPE", + "Message": "MESSAGE", + "Metadata": "METADATA", + "MetadataAttributeSchema": "METADATA_ATTRIBUTE_SCHEMA", + "MetadataConfigurationForReranking": "METADATA_CONFIGURATION_FOR_RERANKING", + "ModelInvocationInput": "MODEL_INVOCATION_INPUT", + "ModelNotReadyException": "MODEL_NOT_READY_EXCEPTION", + "ModelPerformanceConfiguration": "MODEL_PERFORMANCE_CONFIGURATION", + "NodeActionEvent": "NODE_ACTION_EVENT", + "NodeDependencyEvent": "NODE_DEPENDENCY_EVENT", + "NodeErrorCode": "NODE_ERROR_CODE", + "NodeExecutionContent": "NODE_EXECUTION_CONTENT", + "NodeExecutionContentDocument": "NODE_EXECUTION_CONTENT", + "NodeExecutionContentUnknown": "NODE_EXECUTION_CONTENT", + "NodeFailureEvent": "NODE_FAILURE_EVENT", + "NodeInputEvent": "NODE_INPUT_EVENT", + "NodeInputExecutionChainItem": "NODE_INPUT_EXECUTION_CHAIN_ITEM", + "NodeInputField": "NODE_INPUT_FIELD", + "NodeInputSource": "NODE_INPUT_SOURCE", + "NodeOutputEvent": "NODE_OUTPUT_EVENT", + "NodeOutputField": "NODE_OUTPUT_FIELD", + "NodeOutputNext": "NODE_OUTPUT_NEXT", + "NodeTraceElements": "NODE_TRACE_ELEMENTS", + "NodeTraceElementsAgentTraces": "NODE_TRACE_ELEMENTS", + "NodeTraceElementsUnknown": "NODE_TRACE_ELEMENTS", + "NodeType": "NODE_TYPE", + "Observation": "OBSERVATION", + "OptimizedPrompt": "OPTIMIZED_PROMPT", + "OptimizedPromptTextPrompt": "OPTIMIZED_PROMPT", + "OptimizedPromptUnknown": "OPTIMIZED_PROMPT", + "OptimizedPromptEvent": "OPTIMIZED_PROMPT_EVENT", + "OptimizedPromptStream": "OPTIMIZED_PROMPT_STREAM", + "OptimizedPromptStreamOptimizedPromptEvent": "OPTIMIZED_PROMPT_STREAM", + "OptimizedPromptStreamAnalyzePromptEvent": "OPTIMIZED_PROMPT_STREAM", + "OptimizedPromptStreamInternalServerException": "OPTIMIZED_PROMPT_STREAM", + "OptimizedPromptStreamThrottlingException": "OPTIMIZED_PROMPT_STREAM", + "OptimizedPromptStreamValidationException": "OPTIMIZED_PROMPT_STREAM", + "OptimizedPromptStreamDependencyFailedException": "OPTIMIZED_PROMPT_STREAM", + "OptimizedPromptStreamAccessDeniedException": "OPTIMIZED_PROMPT_STREAM", + "OptimizedPromptStreamBadGatewayException": "OPTIMIZED_PROMPT_STREAM", + "OptimizedPromptStreamUnknown": "OPTIMIZED_PROMPT_STREAM", + "OptimizePromptInput": "OPTIMIZE_PROMPT_INPUT", + "OptimizePromptOutput": "OPTIMIZE_PROMPT_OUTPUT", + "OrchestrationConfiguration": "ORCHESTRATION_CONFIGURATION", + "OrchestrationExecutor": "ORCHESTRATION_EXECUTOR", + "OrchestrationExecutorLambda": "ORCHESTRATION_EXECUTOR", + "OrchestrationExecutorUnknown": "ORCHESTRATION_EXECUTOR", + "OrchestrationModelInvocationOutput": "ORCHESTRATION_MODEL_INVOCATION_OUTPUT", + "OrchestrationTrace": "ORCHESTRATION_TRACE", + "OrchestrationTraceRationale": "ORCHESTRATION_TRACE", + "OrchestrationTraceInvocationInput": "ORCHESTRATION_TRACE", + "OrchestrationTraceObservation": "ORCHESTRATION_TRACE", + "OrchestrationTraceModelInvocationInput": "ORCHESTRATION_TRACE", + "OrchestrationTraceModelInvocationOutput": "ORCHESTRATION_TRACE", + "OrchestrationTraceUnknown": "ORCHESTRATION_TRACE", + "OrchestrationType": "ORCHESTRATION_TYPE", + "OutputFile": "OUTPUT_FILE", + "Parameter": "PARAMETER", + "ParameterDetail": "PARAMETER_DETAIL", + "ParameterType": "PARAMETER_TYPE", + "PayloadPart": "PAYLOAD_PART", + "PayloadType": "PAYLOAD_TYPE", + "PerformanceConfigLatency": "PERFORMANCE_CONFIG_LATENCY", + "PerformanceConfiguration": "PERFORMANCE_CONFIGURATION", + "PostProcessingModelInvocationOutput": "POST_PROCESSING_MODEL_INVOCATION_OUTPUT", + "PostProcessingParsedResponse": "POST_PROCESSING_PARSED_RESPONSE", + "PostProcessingTrace": "POST_PROCESSING_TRACE", + "PostProcessingTraceModelInvocationInput": "POST_PROCESSING_TRACE", + "PostProcessingTraceModelInvocationOutput": "POST_PROCESSING_TRACE", + "PostProcessingTraceUnknown": "POST_PROCESSING_TRACE", + "PreProcessingModelInvocationOutput": "PRE_PROCESSING_MODEL_INVOCATION_OUTPUT", + "PreProcessingParsedResponse": "PRE_PROCESSING_PARSED_RESPONSE", + "PreProcessingTrace": "PRE_PROCESSING_TRACE", + "PreProcessingTraceModelInvocationInput": "PRE_PROCESSING_TRACE", + "PreProcessingTraceModelInvocationOutput": "PRE_PROCESSING_TRACE", + "PreProcessingTraceUnknown": "PRE_PROCESSING_TRACE", + "PromptConfiguration": "PROMPT_CONFIGURATION", + "PromptCreationConfigurations": "PROMPT_CREATION_CONFIGURATIONS", + "PromptOverrideConfiguration": "PROMPT_OVERRIDE_CONFIGURATION", + "PromptState": "PROMPT_STATE", + "PromptTemplate": "PROMPT_TEMPLATE", + "PromptType": "PROMPT_TYPE", + "PropertyParameters": "PROPERTY_PARAMETERS", + "PutInvocationStepInput": "PUT_INVOCATION_STEP_INPUT", + "PutInvocationStepOutput": "PUT_INVOCATION_STEP_OUTPUT", + "QueryGenerationInput": "QUERY_GENERATION_INPUT", + "QueryTransformationConfiguration": "QUERY_TRANSFORMATION_CONFIGURATION", + "QueryTransformationMode": "QUERY_TRANSFORMATION_MODE", + "QueryTransformationType": "QUERY_TRANSFORMATION_TYPE", + "Rationale": "RATIONALE", + "RawResponse": "RAW_RESPONSE", + "ReasoningContentBlock": "REASONING_CONTENT_BLOCK", + "ReasoningContentBlockReasoningText": "REASONING_CONTENT_BLOCK", + "ReasoningContentBlockRedactedContent": "REASONING_CONTENT_BLOCK", + "ReasoningContentBlockUnknown": "REASONING_CONTENT_BLOCK", + "ReasoningTextBlock": "REASONING_TEXT_BLOCK", + "RelayConversationHistory": "RELAY_CONVERSATION_HISTORY", + "RepromptResponse": "REPROMPT_RESPONSE", + "RequestBody": "REQUEST_BODY", + "RequireConfirmation": "REQUIRE_CONFIRMATION", + "RerankDocument": "RERANK_DOCUMENT", + "RerankDocumentType": "RERANK_DOCUMENT_TYPE", + "RerankingConfiguration": "RERANKING_CONFIGURATION", + "RerankingConfigurationType": "RERANKING_CONFIGURATION_TYPE", + "RerankingMetadataSelectionMode": "RERANKING_METADATA_SELECTION_MODE", + "RerankingMetadataSelectiveModeConfiguration": "RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION", + "RerankingMetadataSelectiveModeConfigurationFieldsToInclude": "RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION", + "RerankingMetadataSelectiveModeConfigurationFieldsToExclude": "RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION", + "RerankingMetadataSelectiveModeConfigurationUnknown": "RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION", + "RerankingModelType": "RERANKING_MODEL_TYPE", + "RerankInput": "RERANK_INPUT", + "RerankOutput": "RERANK_OUTPUT", + "RerankQuery": "RERANK_QUERY", + "RerankQueryContentType": "RERANK_QUERY_CONTENT_TYPE", + "RerankResult": "RERANK_RESULT", + "RerankSource": "RERANK_SOURCE", + "RerankSourceType": "RERANK_SOURCE_TYPE", + "RerankTextDocument": "RERANK_TEXT_DOCUMENT", + "ResourceNotFoundException": "RESOURCE_NOT_FOUND_EXCEPTION", + "ResponseState": "RESPONSE_STATE", + "ResponseStream": "RESPONSE_STREAM", + "ResponseStreamChunk": "RESPONSE_STREAM", + "ResponseStreamTrace": "RESPONSE_STREAM", + "ResponseStreamReturnControl": "RESPONSE_STREAM", + "ResponseStreamInternalServerException": "RESPONSE_STREAM", + "ResponseStreamValidationException": "RESPONSE_STREAM", + "ResponseStreamResourceNotFoundException": "RESPONSE_STREAM", + "ResponseStreamServiceQuotaExceededException": "RESPONSE_STREAM", + "ResponseStreamThrottlingException": "RESPONSE_STREAM", + "ResponseStreamAccessDeniedException": "RESPONSE_STREAM", + "ResponseStreamConflictException": "RESPONSE_STREAM", + "ResponseStreamDependencyFailedException": "RESPONSE_STREAM", + "ResponseStreamBadGatewayException": "RESPONSE_STREAM", + "ResponseStreamModelNotReadyException": "RESPONSE_STREAM", + "ResponseStreamFiles": "RESPONSE_STREAM", + "ResponseStreamUnknown": "RESPONSE_STREAM", + "RetrievalContent": "RETRIEVAL_CONTENT", + "RetrievalFilter": "RETRIEVAL_FILTER", + "RetrievalFilterEquals": "RETRIEVAL_FILTER", + "RetrievalFilterNotEquals": "RETRIEVAL_FILTER", + "RetrievalFilterGreaterThan": "RETRIEVAL_FILTER", + "RetrievalFilterGreaterThanOrEquals": "RETRIEVAL_FILTER", + "RetrievalFilterLessThan": "RETRIEVAL_FILTER", + "RetrievalFilterLessThanOrEquals": "RETRIEVAL_FILTER", + "RetrievalFilterIn": "RETRIEVAL_FILTER", + "RetrievalFilterNotIn": "RETRIEVAL_FILTER", + "RetrievalFilterStartsWith": "RETRIEVAL_FILTER", + "RetrievalFilterListContains": "RETRIEVAL_FILTER", + "RetrievalFilterStringContains": "RETRIEVAL_FILTER", + "RetrievalFilterAndAll": "RETRIEVAL_FILTER", + "RetrievalFilterOrAll": "RETRIEVAL_FILTER", + "RetrievalFilterUnknown": "RETRIEVAL_FILTER", + "RetrievalOverrides": "RETRIEVAL_OVERRIDES", + "RetrievalResultConfluenceLocation": "RETRIEVAL_RESULT_CONFLUENCE_LOCATION", + "RetrievalResultContent": "RETRIEVAL_RESULT_CONTENT", + "RetrievalResultContentColumn": "RETRIEVAL_RESULT_CONTENT_COLUMN", + "RetrievalResultContentColumnType": "RETRIEVAL_RESULT_CONTENT_COLUMN_TYPE", + "RetrievalResultContentType": "RETRIEVAL_RESULT_CONTENT_TYPE", + "RetrievalResultCustomDocumentLocation": "RETRIEVAL_RESULT_CUSTOM_DOCUMENT_LOCATION", + "RetrievalResultGoogleDriveLocation": "RETRIEVAL_RESULT_GOOGLE_DRIVE_LOCATION", + "RetrievalResultKendraDocumentLocation": "RETRIEVAL_RESULT_KENDRA_DOCUMENT_LOCATION", + "RetrievalResultLocation": "RETRIEVAL_RESULT_LOCATION", + "RetrievalResultLocationType": "RETRIEVAL_RESULT_LOCATION_TYPE", + "RetrievalResultOneDriveLocation": "RETRIEVAL_RESULT_ONE_DRIVE_LOCATION", + "RetrievalResultS3Location": "RETRIEVAL_RESULT_S3_LOCATION", + "RetrievalResultSalesforceLocation": "RETRIEVAL_RESULT_SALESFORCE_LOCATION", + "RetrievalResultSharePointLocation": "RETRIEVAL_RESULT_SHARE_POINT_LOCATION", + "RetrievalResultSqlLocation": "RETRIEVAL_RESULT_SQL_LOCATION", + "RetrievalResultWebLocation": "RETRIEVAL_RESULT_WEB_LOCATION", + "RetrieveAndGenerateConfiguration": "RETRIEVE_AND_GENERATE_CONFIGURATION", + "RetrieveAndGenerateInput": "RETRIEVE_AND_GENERATE_INPUT", + "RetrieveAndGenerateOperationInput": "RETRIEVE_AND_GENERATE_OPERATION_INPUT", + "RetrieveAndGenerateOperationOutput": "RETRIEVE_AND_GENERATE_OPERATION_OUTPUT", + "RetrieveAndGenerateOutput": "RETRIEVE_AND_GENERATE_OUTPUT", + "RetrieveAndGenerateOutputEvent": "RETRIEVE_AND_GENERATE_OUTPUT_EVENT", + "RetrieveAndGenerateSessionConfiguration": "RETRIEVE_AND_GENERATE_SESSION_CONFIGURATION", + "RetrieveAndGenerateStreamInput": "RETRIEVE_AND_GENERATE_STREAM_INPUT", + "RetrieveAndGenerateStreamOutput": "RETRIEVE_AND_GENERATE_STREAM_OUTPUT", + "RetrieveAndGenerateStreamResponseOutput": "RETRIEVE_AND_GENERATE_STREAM_RESPONSE_OUTPUT", + "RetrieveAndGenerateStreamResponseOutputOutput": "RETRIEVE_AND_GENERATE_STREAM_RESPONSE_OUTPUT", + "RetrieveAndGenerateStreamResponseOutputCitation": "RETRIEVE_AND_GENERATE_STREAM_RESPONSE_OUTPUT", + "RetrieveAndGenerateStreamResponseOutputGuardrail": "RETRIEVE_AND_GENERATE_STREAM_RESPONSE_OUTPUT", + "RetrieveAndGenerateStreamResponseOutputInternalServerException": "RETRIEVE_AND_GENERATE_STREAM_RESPONSE_OUTPUT", + "RetrieveAndGenerateStreamResponseOutputValidationException": "RETRIEVE_AND_GENERATE_STREAM_RESPONSE_OUTPUT", + "RetrieveAndGenerateStreamResponseOutputResourceNotFoundException": "RETRIEVE_AND_GENERATE_STREAM_RESPONSE_OUTPUT", + "RetrieveAndGenerateStreamResponseOutputServiceQuotaExceededException": "RETRIEVE_AND_GENERATE_STREAM_RESPONSE_OUTPUT", + "RetrieveAndGenerateStreamResponseOutputThrottlingException": "RETRIEVE_AND_GENERATE_STREAM_RESPONSE_OUTPUT", + "RetrieveAndGenerateStreamResponseOutputAccessDeniedException": "RETRIEVE_AND_GENERATE_STREAM_RESPONSE_OUTPUT", + "RetrieveAndGenerateStreamResponseOutputConflictException": "RETRIEVE_AND_GENERATE_STREAM_RESPONSE_OUTPUT", + "RetrieveAndGenerateStreamResponseOutputDependencyFailedException": "RETRIEVE_AND_GENERATE_STREAM_RESPONSE_OUTPUT", + "RetrieveAndGenerateStreamResponseOutputBadGatewayException": "RETRIEVE_AND_GENERATE_STREAM_RESPONSE_OUTPUT", + "RetrieveAndGenerateStreamResponseOutputUnknown": "RETRIEVE_AND_GENERATE_STREAM_RESPONSE_OUTPUT", + "RetrieveAndGenerateType": "RETRIEVE_AND_GENERATE_TYPE", + "RetrievedReference": "RETRIEVED_REFERENCE", + "RetrieveInput": "RETRIEVE_INPUT", + "RetrieveOutput": "RETRIEVE_OUTPUT", + "RetrieverConfiguration": "RETRIEVER_CONFIGURATION", + "RetrieverConfigurationKnowledgeBase": "RETRIEVER_CONFIGURATION", + "RetrieverConfigurationUnknown": "RETRIEVER_CONFIGURATION", + "ReturnControlPayload": "RETURN_CONTROL_PAYLOAD", + "ReturnControlResults": "RETURN_CONTROL_RESULTS", + "RoutingClassifierModelInvocationOutput": "ROUTING_CLASSIFIER_MODEL_INVOCATION_OUTPUT", + "RoutingClassifierTrace": "ROUTING_CLASSIFIER_TRACE", + "RoutingClassifierTraceInvocationInput": "ROUTING_CLASSIFIER_TRACE", + "RoutingClassifierTraceObservation": "ROUTING_CLASSIFIER_TRACE", + "RoutingClassifierTraceModelInvocationInput": "ROUTING_CLASSIFIER_TRACE", + "RoutingClassifierTraceModelInvocationOutput": "ROUTING_CLASSIFIER_TRACE", + "RoutingClassifierTraceUnknown": "ROUTING_CLASSIFIER_TRACE", + "S3Identifier": "S3_IDENTIFIER", + "S3Location": "S3_LOCATION", + "S3ObjectDoc": "S3_OBJECT_DOC", + "S3ObjectFile": "S3_OBJECT_FILE", + "SatisfiedCondition": "SATISFIED_CONDITION", + "SearchType": "SEARCH_TYPE", + "ServiceQuotaExceededException": "SERVICE_QUOTA_EXCEEDED_EXCEPTION", + "SessionState": "SESSION_STATE", + "SessionStatus": "SESSION_STATUS", + "SessionSummary": "SESSION_SUMMARY", + "Source": "SOURCE", + "Span": "SPAN", + "StartFlowExecutionInput": "START_FLOW_EXECUTION_INPUT", + "StartFlowExecutionOutput": "START_FLOW_EXECUTION_OUTPUT", + "StopFlowExecutionInput": "STOP_FLOW_EXECUTION_INPUT", + "StopFlowExecutionOutput": "STOP_FLOW_EXECUTION_OUTPUT", + "StreamingConfigurations": "STREAMING_CONFIGURATIONS", + "TagResourceInput": "TAG_RESOURCE_INPUT", + "TagResourceOutput": "TAG_RESOURCE_OUTPUT", + "TextInferenceConfig": "TEXT_INFERENCE_CONFIG", + "TextPrompt": "TEXT_PROMPT", + "TextResponsePart": "TEXT_RESPONSE_PART", + "TextToSqlConfiguration": "TEXT_TO_SQL_CONFIGURATION", + "TextToSqlConfigurationType": "TEXT_TO_SQL_CONFIGURATION_TYPE", + "TextToSqlKnowledgeBaseConfiguration": "TEXT_TO_SQL_KNOWLEDGE_BASE_CONFIGURATION", + "ThrottlingException": "THROTTLING_EXCEPTION", + "Trace": "TRACE", + "TraceGuardrailTrace": "TRACE", + "TracePreProcessingTrace": "TRACE", + "TraceOrchestrationTrace": "TRACE", + "TracePostProcessingTrace": "TRACE", + "TraceRoutingClassifierTrace": "TRACE", + "TraceFailureTrace": "TRACE", + "TraceCustomOrchestrationTrace": "TRACE", + "TraceUnknown": "TRACE", + "TraceElements": "TRACE_ELEMENTS", + "TraceElementsAgentTraces": "TRACE_ELEMENTS", + "TraceElementsUnknown": "TRACE_ELEMENTS", + "TracePart": "TRACE_PART", + "TransformationConfiguration": "TRANSFORMATION_CONFIGURATION", + "Type": "TYPE", + "UntagResourceInput": "UNTAG_RESOURCE_INPUT", + "UntagResourceOutput": "UNTAG_RESOURCE_OUTPUT", + "UpdateSessionInput": "UPDATE_SESSION_INPUT", + "UpdateSessionOutput": "UPDATE_SESSION_OUTPUT", + "Usage": "USAGE", + "UserContext": "USER_CONTEXT", + "ValidationException": "VALIDATION_EXCEPTION", + "VectorSearchBedrockRerankingConfiguration": "VECTOR_SEARCH_BEDROCK_RERANKING_CONFIGURATION", + "VectorSearchBedrockRerankingModelConfiguration": "VECTOR_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION", + "VectorSearchRerankingConfiguration": "VECTOR_SEARCH_RERANKING_CONFIGURATION", + "VectorSearchRerankingConfigurationType": "VECTOR_SEARCH_RERANKING_CONFIGURATION_TYPE", + "VideoSegment": "VIDEO_SEGMENT", + }, + shape_names=frozenset( { - ShapeID( - "com.amazonaws.bedrockagentruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentruntime#BadGatewayException" - ): BadGatewayException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentruntime#DependencyFailedException" - ): DependencyFailedException, - ShapeID( - "com.amazonaws.bedrockagentruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ModelNotReadyException" - ): ModelNotReadyException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ValidationException" - ): ValidationException, + "APISchema", + "AccessDeniedException", + "ActionGroupExecutor", + "ActionGroupInvocationInput", + "ActionGroupInvocationOutput", + "ActionGroupSignature", + "ActionInvocationType", + "AgentActionGroup", + "AgentCollaboration", + "AgentCollaboratorInputPayload", + "AgentCollaboratorInvocationInput", + "AgentCollaboratorInvocationOutput", + "AgentCollaboratorOutputPayload", + "AgenticRetrieveAction", + "AgenticRetrieveActionDetails", + "AgenticRetrieveBedrockGuardrailConfiguration", + "AgenticRetrieveBedrockRerankingConfiguration", + "AgenticRetrieveBedrockRerankingModelConfiguration", + "AgenticRetrieveCitation", + "AgenticRetrieveCitationReference", + "AgenticRetrieveConfiguration", + "AgenticRetrieveFailure", + "AgenticRetrieveFullDocExpansionDetails", + "AgenticRetrieveGeneratedResponse", + "AgenticRetrieveGuardrailWarning", + "AgenticRetrieveMemoryConfiguration", + "AgenticRetrieveMemoryMetadataFilter", + "AgenticRetrieveMemoryMetadataFilterLeft", + "AgenticRetrieveMemoryMetadataFilterOperator", + "AgenticRetrieveMemoryMetadataFilterRight", + "AgenticRetrieveMemoryMetadataValue", + "AgenticRetrieveMemoryPersistenceMode", + "AgenticRetrieveMemoryRetrievalConfig", + "AgenticRetrieveMemoryRetrieveDetails", + "AgenticRetrieveMemorySessionBinding", + "AgenticRetrieveMessage", + "AgenticRetrieveMessageContent", + "AgenticRetrievePolicyConfiguration", + "AgenticRetrieveRerankingConfiguration", + "AgenticRetrieveRerankingConfigurationType", + "AgenticRetrieveRerankingModelType", + "AgenticRetrieveResponseEvent", + "AgenticRetrieveResultEvent", + "AgenticRetrieveResultItem", + "AgenticRetrieveSourceMetadata", + "AgenticRetrieveSourceRetriever", + "AgenticRetrieveStatus", + "AgenticRetrieveStep", + "AgenticRetrieveStreamInput", + "AgenticRetrieveStreamOutput", + "AgenticRetrieveStreamResponseOutput", + "AgenticRetrieveTraceEvent", + "AgenticRetrieveTraceEventAttributes", + "AgenticRetrieveTraceResultItem", + "AgenticRetrieveType", + "AgenticRetrieveWarning", + "AgenticRetrieveWarningMessage", + "AgenticRetriever", + "AnalyzePromptEvent", + "ApiInvocationInput", + "ApiParameter", + "ApiRequestBody", + "ApiResult", + "AttributeType", + "Attribution", + "AudioSegment", + "BadGatewayException", + "BedrockFoundationModelConfiguration", + "BedrockFoundationModelModelConfiguration", + "BedrockModelConfigurations", + "BedrockRerankingConfiguration", + "BedrockRerankingModelConfiguration", + "BedrockSessionContentBlock", + "ByteContentDoc", + "ByteContentFile", + "Caller", + "CheckIngestedDocumentAclInput", + "CheckIngestedDocumentAclOutput", + "Citation", + "CitationEvent", + "CodeInterpreterInvocationInput", + "CodeInterpreterInvocationOutput", + "Collaborator", + "CollaboratorConfiguration", + "ConditionResultEvent", + "ConfirmationState", + "ConflictException", + "ContentBlock", + "ContentBody", + "ConversationHistory", + "ConversationRole", + "CreateInvocationInput", + "CreateInvocationOutput", + "CreateSessionInput", + "CreateSessionOutput", + "CreationMode", + "CustomControlMethod", + "CustomOrchestration", + "CustomOrchestrationTrace", + "CustomOrchestrationTraceEvent", + "DeleteAgentMemoryInput", + "DeleteAgentMemoryOutput", + "DeleteSessionInput", + "DeleteSessionOutput", + "DependencyFailedException", + "DocumentAcl", + "DocumentAclCondition", + "DocumentAclGroup", + "DocumentAclMemberRelation", + "DocumentAclMembership", + "DocumentAclMembershipType", + "DocumentAclUser", + "DocumentOutputFormat", + "EndSessionInput", + "EndSessionOutput", + "ExecutionType", + "ExternalSource", + "ExternalSourceType", + "ExternalSourcesGenerationConfiguration", + "ExternalSourcesRetrieveAndGenerateConfiguration", + "FailureTrace", + "FieldForReranking", + "FilePart", + "FileSource", + "FileSourceType", + "FileUseCase", + "FilterAttribute", + "FinalResponse", + "FlowCompletionEvent", + "FlowCompletionReason", + "FlowControlNodeType", + "FlowErrorCode", + "FlowExecutionContent", + "FlowExecutionError", + "FlowExecutionErrorType", + "FlowExecutionEvent", + "FlowExecutionEventType", + "FlowExecutionInputEvent", + "FlowExecutionOutputEvent", + "FlowExecutionStatus", + "FlowExecutionSummary", + "FlowFailureEvent", + "FlowInput", + "FlowInputContent", + "FlowInputField", + "FlowMultiTurnInputContent", + "FlowMultiTurnInputRequestEvent", + "FlowNodeIODataType", + "FlowNodeInputCategory", + "FlowOutputContent", + "FlowOutputEvent", + "FlowOutputField", + "FlowResponseStream", + "FlowTrace", + "FlowTraceCondition", + "FlowTraceConditionNodeResultEvent", + "FlowTraceDependencyEvent", + "FlowTraceEvent", + "FlowTraceNodeActionEvent", + "FlowTraceNodeInputContent", + "FlowTraceNodeInputEvent", + "FlowTraceNodeInputExecutionChainItem", + "FlowTraceNodeInputField", + "FlowTraceNodeInputSource", + "FlowTraceNodeOutputContent", + "FlowTraceNodeOutputEvent", + "FlowTraceNodeOutputField", + "FlowTraceNodeOutputNext", + "FoundationModelConfiguration", + "FoundationModelConfigurationType", + "FoundationModelType", + "FunctionDefinition", + "FunctionInvocationInput", + "FunctionParameter", + "FunctionResult", + "FunctionSchema", + "GenerateQueryInput", + "GenerateQueryOutput", + "GeneratedQuery", + "GeneratedQueryType", + "GeneratedResponsePart", + "GenerationConfiguration", + "GetAgentMemoryInput", + "GetAgentMemoryOutput", + "GetDocumentContentInput", + "GetDocumentContentOutput", + "GetExecutionFlowSnapshotInput", + "GetExecutionFlowSnapshotOutput", + "GetFlowExecutionInput", + "GetFlowExecutionOutput", + "GetIngestedDocumentAclInput", + "GetIngestedDocumentAclOutput", + "GetInvocationStepInput", + "GetInvocationStepOutput", + "GetSessionInput", + "GetSessionOutput", + "GuadrailAction", + "GuardrailAction", + "GuardrailAssessment", + "GuardrailConfiguration", + "GuardrailConfigurationWithArn", + "GuardrailContentFilter", + "GuardrailContentFilterConfidence", + "GuardrailContentFilterType", + "GuardrailContentPolicyAction", + "GuardrailContentPolicyAssessment", + "GuardrailCustomWord", + "GuardrailEvent", + "GuardrailManagedWord", + "GuardrailManagedWordType", + "GuardrailPiiEntityFilter", + "GuardrailPiiEntityType", + "GuardrailRegexFilter", + "GuardrailSensitiveInformationPolicyAction", + "GuardrailSensitiveInformationPolicyAssessment", + "GuardrailTopic", + "GuardrailTopicPolicyAction", + "GuardrailTopicPolicyAssessment", + "GuardrailTopicType", + "GuardrailTrace", + "GuardrailWordPolicyAction", + "GuardrailWordPolicyAssessment", + "ImageBlock", + "ImageFormat", + "ImageInput", + "ImageInputFormat", + "ImageInputSource", + "ImageSource", + "ImplicitFilterConfiguration", + "InferenceConfig", + "InferenceConfiguration", + "InlineAgentFilePart", + "InlineAgentPayloadPart", + "InlineAgentResponseStream", + "InlineAgentReturnControlPayload", + "InlineAgentTracePart", + "InlineBedrockModelConfigurations", + "InlineSessionState", + "InputFile", + "InputImage", + "InputImageFormat", + "InputPrompt", + "InputQueryType", + "InternalServerException", + "InvocationInput", + "InvocationInputMember", + "InvocationResultMember", + "InvocationStep", + "InvocationStepPayload", + "InvocationStepSummary", + "InvocationSummary", + "InvocationType", + "InvokeAgentInput", + "InvokeAgentOutput", + "InvokeFlowInput", + "InvokeFlowOutput", + "InvokeInlineAgentInput", + "InvokeInlineAgentOutput", + "KnowledgeBase", + "KnowledgeBaseConfiguration", + "KnowledgeBaseLookupInput", + "KnowledgeBaseLookupOutput", + "KnowledgeBaseQuery", + "KnowledgeBaseQueryType", + "KnowledgeBaseRetrievalConfiguration", + "KnowledgeBaseRetrievalResult", + "KnowledgeBaseRetrieveAndGenerateConfiguration", + "KnowledgeBaseRetrieverConfiguration", + "KnowledgeBaseVectorSearchConfiguration", + "ListFlowExecutionEventsInput", + "ListFlowExecutionEventsOutput", + "ListFlowExecutionsInput", + "ListFlowExecutionsOutput", + "ListInvocationStepsInput", + "ListInvocationStepsOutput", + "ListInvocationsInput", + "ListInvocationsOutput", + "ListSessionsInput", + "ListSessionsOutput", + "ListTagsForResourceInput", + "ListTagsForResourceOutput", + "ManagedSearchBedrockRerankingConfiguration", + "ManagedSearchBedrockRerankingModelConfiguration", + "ManagedSearchConfiguration", + "ManagedSearchRerankingConfiguration", + "ManagedSearchRerankingConfigurationType", + "MantleFoundationModelConfiguration", + "MantleFoundationModelModelConfiguration", + "Memory", + "MemorySessionSummary", + "MemoryType", + "Message", + "Metadata", + "MetadataAttributeSchema", + "MetadataConfigurationForReranking", + "ModelInvocationInput", + "ModelNotReadyException", + "ModelPerformanceConfiguration", + "NodeActionEvent", + "NodeDependencyEvent", + "NodeErrorCode", + "NodeExecutionContent", + "NodeFailureEvent", + "NodeInputEvent", + "NodeInputExecutionChainItem", + "NodeInputField", + "NodeInputSource", + "NodeOutputEvent", + "NodeOutputField", + "NodeOutputNext", + "NodeTraceElements", + "NodeType", + "Observation", + "OptimizePromptInput", + "OptimizePromptOutput", + "OptimizedPrompt", + "OptimizedPromptEvent", + "OptimizedPromptStream", + "OrchestrationConfiguration", + "OrchestrationExecutor", + "OrchestrationModelInvocationOutput", + "OrchestrationTrace", + "OrchestrationType", + "OutputFile", + "Parameter", + "ParameterDetail", + "ParameterType", + "PayloadPart", + "PayloadType", + "PerformanceConfigLatency", + "PerformanceConfiguration", + "PostProcessingModelInvocationOutput", + "PostProcessingParsedResponse", + "PostProcessingTrace", + "PreProcessingModelInvocationOutput", + "PreProcessingParsedResponse", + "PreProcessingTrace", + "PromptConfiguration", + "PromptCreationConfigurations", + "PromptOverrideConfiguration", + "PromptState", + "PromptTemplate", + "PromptType", + "PropertyParameters", + "PutInvocationStepInput", + "PutInvocationStepOutput", + "QueryGenerationInput", + "QueryTransformationConfiguration", + "QueryTransformationMode", + "QueryTransformationType", + "Rationale", + "RawResponse", + "ReasoningContentBlock", + "ReasoningTextBlock", + "RelayConversationHistory", + "RepromptResponse", + "RequestBody", + "RequireConfirmation", + "RerankDocument", + "RerankDocumentType", + "RerankInput", + "RerankOutput", + "RerankQuery", + "RerankQueryContentType", + "RerankResult", + "RerankSource", + "RerankSourceType", + "RerankTextDocument", + "RerankingConfiguration", + "RerankingConfigurationType", + "RerankingMetadataSelectionMode", + "RerankingMetadataSelectiveModeConfiguration", + "RerankingModelType", + "ResourceNotFoundException", + "ResponseState", + "ResponseStream", + "RetrievalContent", + "RetrievalFilter", + "RetrievalOverrides", + "RetrievalResultConfluenceLocation", + "RetrievalResultContent", + "RetrievalResultContentColumn", + "RetrievalResultContentColumnType", + "RetrievalResultContentType", + "RetrievalResultCustomDocumentLocation", + "RetrievalResultGoogleDriveLocation", + "RetrievalResultKendraDocumentLocation", + "RetrievalResultLocation", + "RetrievalResultLocationType", + "RetrievalResultOneDriveLocation", + "RetrievalResultS3Location", + "RetrievalResultSalesforceLocation", + "RetrievalResultSharePointLocation", + "RetrievalResultSqlLocation", + "RetrievalResultWebLocation", + "RetrieveAndGenerateConfiguration", + "RetrieveAndGenerateInput", + "RetrieveAndGenerateOperationInput", + "RetrieveAndGenerateOperationOutput", + "RetrieveAndGenerateOutput", + "RetrieveAndGenerateOutputEvent", + "RetrieveAndGenerateSessionConfiguration", + "RetrieveAndGenerateStreamInput", + "RetrieveAndGenerateStreamOutput", + "RetrieveAndGenerateStreamResponseOutput", + "RetrieveAndGenerateType", + "RetrieveInput", + "RetrieveOutput", + "RetrievedReference", + "RetrieverConfiguration", + "ReturnControlPayload", + "ReturnControlResults", + "RoutingClassifierModelInvocationOutput", + "RoutingClassifierTrace", + "S3Identifier", + "S3Location", + "S3ObjectDoc", + "S3ObjectFile", + "SatisfiedCondition", + "SearchType", + "ServiceQuotaExceededException", + "SessionState", + "SessionStatus", + "SessionSummary", + "Source", + "Span", + "StartFlowExecutionInput", + "StartFlowExecutionOutput", + "StopFlowExecutionInput", + "StopFlowExecutionOutput", + "StreamingConfigurations", + "TagResourceInput", + "TagResourceOutput", + "TextInferenceConfig", + "TextPrompt", + "TextResponsePart", + "TextToSqlConfiguration", + "TextToSqlConfigurationType", + "TextToSqlKnowledgeBaseConfiguration", + "ThrottlingException", + "Trace", + "TraceElements", + "TracePart", + "TransformationConfiguration", + "Type", + "UntagResourceInput", + "UntagResourceOutput", + "UpdateSessionInput", + "UpdateSessionOutput", + "Usage", + "UserContext", + "ValidationException", + "VectorSearchBedrockRerankingConfiguration", + "VectorSearchBedrockRerankingModelConfiguration", + "VectorSearchRerankingConfiguration", + "VectorSearchRerankingConfigurationType", + "VideoSegment", } ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_BAD_GATEWAY_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_DEPENDENCY_FAILED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_MODEL_NOT_READY_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], + service_error="ServiceError", ) -@dataclass(kw_only=True) -class InvokeInlineAgentInput: - """Dataclass for InvokeInlineAgentInput structure.""" - - customer_encryption_key_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the Amazon Web Services KMS key to use - to encrypt your inline agent. - """ - - foundation_model: str | None = None - """ - The [model identifier - (ID)](https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns) - of the model to use for orchestration by the inline agent. For example, - `meta.llama3-1-70b-instruct-v1:0`. - """ - - instruction: str | None = field(repr=False, default=None) - """ - The instructions that tell the inline agent what it should do and how it - should interact with users. - """ - - idle_session_ttl_in_seconds: int | None = None - """ - The number of seconds for which the inline agent should maintain session - information. After this time expires, the subsequent `InvokeInlineAgent` - request begins a new session. - - A user interaction remains active for the amount of time specified. If - no conversation occurs during this time, the session expires and the - data provided before the timeout is deleted. - """ +def __getattr__(name: str): + return _registry.build(name) - action_groups: list[AgentActionGroup] | None = None - """ - A list of action groups with each action group defining the action the - inline agent needs to carry out. - """ - knowledge_bases: "list[KnowledgeBase] | None" = None - """Contains information of the knowledge bases to associate with.""" +CHECK_INGESTED_DOCUMENT_ACL: APIOperation[ + CheckIngestedDocumentAclInput, CheckIngestedDocumentAclOutput +] = APIOperation( + static_schema=_SCHEMA_CHECK_INGESTED_DOCUMENT_ACL, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentruntime#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentruntime#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentruntime#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - guardrail_configuration: GuardrailConfigurationWithArn | None = None - """ - The - [guardrails](https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails.html) - to assign to the inline agent. - """ +GET_EXECUTION_FLOW_SNAPSHOT: APIOperation[ + GetExecutionFlowSnapshotInput, GetExecutionFlowSnapshotOutput +] = APIOperation( + static_schema=_SCHEMA_GET_EXECUTION_FLOW_SNAPSHOT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentruntime#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentruntime#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentruntime#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - prompt_override_configuration: PromptOverrideConfiguration | None = field( - repr=False, default=None +GET_FLOW_EXECUTION: APIOperation[GetFlowExecutionInput, GetFlowExecutionOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_FLOW_EXECUTION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentruntime#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentruntime#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentruntime#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) - """ - Configurations for advanced prompts used to override the default prompts - to enhance the accuracy of the inline agent. - """ - - agent_collaboration: str | None = None - """ - Defines how the inline collaborator agent handles information across - multiple collaborator agents to coordinate a final response. The inline - collaborator agent can also be the supervisor. - """ - - collaborator_configurations: list[CollaboratorConfiguration] | None = None - """ - Settings for an inline agent collaborator called with - [InvokeInlineAgent](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeInlineAgent.html). - """ - - agent_name: str | None = field(repr=False, default=None) - """The name for the agent.""" - - session_id: str | None = None - """ - The unique identifier of the session. Use the same value across requests - to continue the same conversation. - """ - - end_session: bool | None = None - """Specifies whether to end the session with the inline agent or not.""" - - enable_trace: bool | None = None - """ - Specifies whether to turn on the trace or not to track the agent's - reasoning process. For more information, see [Using - trace](https://docs.aws.amazon.com/bedrock/latest/userguide/trace-events.html). - """ - - input_text: str | None = field(repr=False, default=None) - """ - The prompt text to send to the agent. - - Note: - If you include `returnControlInvocationResults` in the `sessionState` - field, the `inputText` field will be ignored. - """ - - streaming_configurations: StreamingConfigurations | None = None - """ - Specifies the configurations for streaming. - - Note: - To use agent streaming, you need permissions to perform the - `bedrock:InvokeModelWithResponseStream` action. - """ - - prompt_creation_configurations: PromptCreationConfigurations | None = None - """ - Specifies parameters that control how the service populates the agent - prompt for an `InvokeInlineAgent` request. You can control which aspects - of previous invocations in the same agent session the service uses to - populate the agent prompt. This gives you more granular control over the - contextual history that is used to process the current request. - """ - - inline_session_state: InlineSessionState | None = None - """ - Parameters that specify the various attributes of a sessions. You can - include attributes for the session or prompt or, if you configured an - action group to return control, results from invocation of the action - group. For more information, see [Control session - context](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-session-state.html). - - Note: - If you include `returnControlInvocationResults` in the `sessionState` - field, the `inputText` field will be ignored. - """ - - collaborators: "list[Collaborator] | None" = None - """List of collaborator inline agents.""" - - bedrock_model_configurations: InlineBedrockModelConfigurations | None = None - """Model settings for the request.""" - - orchestration_type: str | None = None - """ - Specifies the type of orchestration strategy for the agent. This is set - to DEFAULT orchestration type, by default. - """ - - custom_orchestration: CustomOrchestration | None = None - """Contains details of the custom orchestration configured for the agent.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOKE_INLINE_AGENT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.customer_encryption_key_arn is not None: - serializer.write_string( - _SCHEMA_INVOKE_INLINE_AGENT_INPUT.members["customerEncryptionKeyArn"], - self.customer_encryption_key_arn, - ) - - if self.foundation_model is not None: - serializer.write_string( - _SCHEMA_INVOKE_INLINE_AGENT_INPUT.members["foundationModel"], - self.foundation_model, - ) - - if self.instruction is not None: - serializer.write_string( - _SCHEMA_INVOKE_INLINE_AGENT_INPUT.members["instruction"], - self.instruction, - ) - - if self.idle_session_ttl_in_seconds is not None: - serializer.write_integer( - _SCHEMA_INVOKE_INLINE_AGENT_INPUT.members["idleSessionTTLInSeconds"], - self.idle_session_ttl_in_seconds, - ) - - if self.action_groups is not None: - _serialize_agent_action_groups( - serializer, - _SCHEMA_INVOKE_INLINE_AGENT_INPUT.members["actionGroups"], - self.action_groups, - ) - - if self.knowledge_bases is not None: - _serialize_knowledge_bases( - serializer, - _SCHEMA_INVOKE_INLINE_AGENT_INPUT.members["knowledgeBases"], - self.knowledge_bases, - ) - - if self.guardrail_configuration is not None: - serializer.write_struct( - _SCHEMA_INVOKE_INLINE_AGENT_INPUT.members["guardrailConfiguration"], - self.guardrail_configuration, - ) - - if self.prompt_override_configuration is not None: - serializer.write_struct( - _SCHEMA_INVOKE_INLINE_AGENT_INPUT.members[ - "promptOverrideConfiguration" - ], - self.prompt_override_configuration, - ) - - if self.agent_collaboration is not None: - serializer.write_string( - _SCHEMA_INVOKE_INLINE_AGENT_INPUT.members["agentCollaboration"], - self.agent_collaboration, - ) - - if self.collaborator_configurations is not None: - _serialize_collaborator_configurations( - serializer, - _SCHEMA_INVOKE_INLINE_AGENT_INPUT.members["collaboratorConfigurations"], - self.collaborator_configurations, - ) - - if self.agent_name is not None: - serializer.write_string( - _SCHEMA_INVOKE_INLINE_AGENT_INPUT.members["agentName"], self.agent_name - ) - - if self.session_id is not None: - serializer.write_string( - _SCHEMA_INVOKE_INLINE_AGENT_INPUT.members["sessionId"], self.session_id - ) - - if self.end_session is not None: - serializer.write_boolean( - _SCHEMA_INVOKE_INLINE_AGENT_INPUT.members["endSession"], - self.end_session, - ) - - if self.enable_trace is not None: - serializer.write_boolean( - _SCHEMA_INVOKE_INLINE_AGENT_INPUT.members["enableTrace"], - self.enable_trace, - ) - - if self.input_text is not None: - serializer.write_string( - _SCHEMA_INVOKE_INLINE_AGENT_INPUT.members["inputText"], self.input_text - ) - - if self.streaming_configurations is not None: - serializer.write_struct( - _SCHEMA_INVOKE_INLINE_AGENT_INPUT.members["streamingConfigurations"], - self.streaming_configurations, - ) - - if self.prompt_creation_configurations is not None: - serializer.write_struct( - _SCHEMA_INVOKE_INLINE_AGENT_INPUT.members[ - "promptCreationConfigurations" - ], - self.prompt_creation_configurations, - ) - - if self.inline_session_state is not None: - serializer.write_struct( - _SCHEMA_INVOKE_INLINE_AGENT_INPUT.members["inlineSessionState"], - self.inline_session_state, - ) - - if self.collaborators is not None: - _serialize_collaborators( - serializer, - _SCHEMA_INVOKE_INLINE_AGENT_INPUT.members["collaborators"], - self.collaborators, - ) - - if self.bedrock_model_configurations is not None: - serializer.write_struct( - _SCHEMA_INVOKE_INLINE_AGENT_INPUT.members["bedrockModelConfigurations"], - self.bedrock_model_configurations, - ) +) - if self.orchestration_type is not None: - serializer.write_string( - _SCHEMA_INVOKE_INLINE_AGENT_INPUT.members["orchestrationType"], - self.orchestration_type, - ) +LIST_FLOW_EXECUTION_EVENTS: APIOperation[ + ListFlowExecutionEventsInput, ListFlowExecutionEventsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_FLOW_EXECUTION_EVENTS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentruntime#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentruntime#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentruntime#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - if self.custom_orchestration is not None: - serializer.write_struct( - _SCHEMA_INVOKE_INLINE_AGENT_INPUT.members["customOrchestration"], - self.custom_orchestration, - ) +LIST_FLOW_EXECUTIONS: APIOperation[ + ListFlowExecutionsInput, ListFlowExecutionsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_FLOW_EXECUTIONS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentruntime#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentruntime#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentruntime#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) +START_FLOW_EXECUTION: APIOperation[ + StartFlowExecutionInput, StartFlowExecutionOutput +] = APIOperation( + static_schema=_SCHEMA_START_FLOW_EXECUTION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentruntime#BadGatewayException"), + ShapeID("com.amazonaws.bedrockagentruntime#ConflictException"), + ShapeID("com.amazonaws.bedrockagentruntime#DependencyFailedException"), + ShapeID("com.amazonaws.bedrockagentruntime#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentruntime#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentruntime#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +STOP_FLOW_EXECUTION: APIOperation[StopFlowExecutionInput, StopFlowExecutionOutput] = ( + APIOperation( + static_schema=_SCHEMA_STOP_FLOW_EXECUTION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentruntime#BadGatewayException"), + ShapeID("com.amazonaws.bedrockagentruntime#ConflictException"), + ShapeID("com.amazonaws.bedrockagentruntime#DependencyFailedException"), + ShapeID("com.amazonaws.bedrockagentruntime#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentruntime#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentruntime#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["customer_encryption_key_arn"] = de.read_string( - _SCHEMA_INVOKE_INLINE_AGENT_INPUT.members[ - "customerEncryptionKeyArn" - ] - ) +INVOKE_FLOW: APIOperation[InvokeFlowInput, InvokeFlowOutput] = APIOperation( + static_schema=_SCHEMA_INVOKE_FLOW, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentruntime#BadGatewayException"), + ShapeID("com.amazonaws.bedrockagentruntime#ConflictException"), + ShapeID("com.amazonaws.bedrockagentruntime#DependencyFailedException"), + ShapeID("com.amazonaws.bedrockagentruntime#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentruntime#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentruntime#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 1: - kwargs["foundation_model"] = de.read_string( - _SCHEMA_INVOKE_INLINE_AGENT_INPUT.members["foundationModel"] - ) +GENERATE_QUERY: APIOperation[GenerateQueryInput, GenerateQueryOutput] = APIOperation( + static_schema=_SCHEMA_GENERATE_QUERY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentruntime#BadGatewayException"), + ShapeID("com.amazonaws.bedrockagentruntime#ConflictException"), + ShapeID("com.amazonaws.bedrockagentruntime#DependencyFailedException"), + ShapeID("com.amazonaws.bedrockagentruntime#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentruntime#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentruntime#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 2: - kwargs["instruction"] = de.read_string( - _SCHEMA_INVOKE_INLINE_AGENT_INPUT.members["instruction"] - ) +GET_DOCUMENT_CONTENT: APIOperation[ + GetDocumentContentInput, GetDocumentContentOutput +] = APIOperation( + static_schema=_SCHEMA_GET_DOCUMENT_CONTENT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentruntime#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentruntime#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentruntime#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 3: - kwargs["idle_session_ttl_in_seconds"] = de.read_integer( - _SCHEMA_INVOKE_INLINE_AGENT_INPUT.members[ - "idleSessionTTLInSeconds" - ] - ) +GET_INGESTED_DOCUMENT_ACL: APIOperation[ + GetIngestedDocumentAclInput, GetIngestedDocumentAclOutput +] = APIOperation( + static_schema=_SCHEMA_GET_INGESTED_DOCUMENT_ACL, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentruntime#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentruntime#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentruntime#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 4: - kwargs["action_groups"] = _deserialize_agent_action_groups( - de, _SCHEMA_INVOKE_INLINE_AGENT_INPUT.members["actionGroups"] - ) +DELETE_AGENT_MEMORY: APIOperation[DeleteAgentMemoryInput, DeleteAgentMemoryOutput] = ( + APIOperation( + static_schema=_SCHEMA_DELETE_AGENT_MEMORY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentruntime#BadGatewayException"), + ShapeID("com.amazonaws.bedrockagentruntime#ConflictException"), + ShapeID("com.amazonaws.bedrockagentruntime#DependencyFailedException"), + ShapeID("com.amazonaws.bedrockagentruntime#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentruntime#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentruntime#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - case 5: - kwargs["knowledge_bases"] = _deserialize_knowledge_bases( - de, _SCHEMA_INVOKE_INLINE_AGENT_INPUT.members["knowledgeBases"] - ) +GET_AGENT_MEMORY: APIOperation[GetAgentMemoryInput, GetAgentMemoryOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_AGENT_MEMORY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentruntime#BadGatewayException"), + ShapeID("com.amazonaws.bedrockagentruntime#ConflictException"), + ShapeID("com.amazonaws.bedrockagentruntime#DependencyFailedException"), + ShapeID("com.amazonaws.bedrockagentruntime#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentruntime#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentruntime#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - case 6: - kwargs["guardrail_configuration"] = ( - GuardrailConfigurationWithArn.deserialize(de) - ) +OPTIMIZE_PROMPT: APIOperation[OptimizePromptInput, OptimizePromptOutput] = APIOperation( + static_schema=_SCHEMA_OPTIMIZE_PROMPT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentruntime#BadGatewayException"), + ShapeID("com.amazonaws.bedrockagentruntime#DependencyFailedException"), + ShapeID("com.amazonaws.bedrockagentruntime#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentruntime#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 7: - kwargs["prompt_override_configuration"] = ( - PromptOverrideConfiguration.deserialize(de) - ) +RERANK: APIOperation[RerankInput, RerankOutput] = APIOperation( + static_schema=_SCHEMA_RERANK, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentruntime#BadGatewayException"), + ShapeID("com.amazonaws.bedrockagentruntime#ConflictException"), + ShapeID("com.amazonaws.bedrockagentruntime#DependencyFailedException"), + ShapeID("com.amazonaws.bedrockagentruntime#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentruntime#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentruntime#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 8: - kwargs["agent_collaboration"] = AgentCollaboration( - de.read_string( - _SCHEMA_INVOKE_INLINE_AGENT_INPUT.members[ - "agentCollaboration" - ] - ) - ) +CREATE_SESSION: APIOperation[CreateSessionInput, CreateSessionOutput] = APIOperation( + static_schema=_SCHEMA_CREATE_SESSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentruntime#ConflictException"), + ShapeID("com.amazonaws.bedrockagentruntime#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentruntime#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 9: - kwargs["collaborator_configurations"] = ( - _deserialize_collaborator_configurations( - de, - _SCHEMA_INVOKE_INLINE_AGENT_INPUT.members[ - "collaboratorConfigurations" - ], - ) - ) +DELETE_SESSION: APIOperation[DeleteSessionInput, DeleteSessionOutput] = APIOperation( + static_schema=_SCHEMA_DELETE_SESSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentruntime#ConflictException"), + ShapeID("com.amazonaws.bedrockagentruntime#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentruntime#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentruntime#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 10: - kwargs["agent_name"] = de.read_string( - _SCHEMA_INVOKE_INLINE_AGENT_INPUT.members["agentName"] - ) +END_SESSION: APIOperation[EndSessionInput, EndSessionOutput] = APIOperation( + static_schema=_SCHEMA_END_SESSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentruntime#ConflictException"), + ShapeID("com.amazonaws.bedrockagentruntime#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentruntime#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentruntime#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 11: - kwargs["session_id"] = de.read_string( - _SCHEMA_INVOKE_INLINE_AGENT_INPUT.members["sessionId"] - ) +GET_SESSION: APIOperation[GetSessionInput, GetSessionOutput] = APIOperation( + static_schema=_SCHEMA_GET_SESSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentruntime#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentruntime#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentruntime#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 12: - kwargs["end_session"] = de.read_boolean( - _SCHEMA_INVOKE_INLINE_AGENT_INPUT.members["endSession"] - ) +CREATE_INVOCATION: APIOperation[CreateInvocationInput, CreateInvocationOutput] = ( + APIOperation( + static_schema=_SCHEMA_CREATE_INVOCATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentruntime#ConflictException"), + ShapeID("com.amazonaws.bedrockagentruntime#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentruntime#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentruntime#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - case 13: - kwargs["enable_trace"] = de.read_boolean( - _SCHEMA_INVOKE_INLINE_AGENT_INPUT.members["enableTrace"] - ) +LIST_INVOCATIONS: APIOperation[ListInvocationsInput, ListInvocationsOutput] = ( + APIOperation( + static_schema=_SCHEMA_LIST_INVOCATIONS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentruntime#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentruntime#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentruntime#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - case 14: - kwargs["input_text"] = de.read_string( - _SCHEMA_INVOKE_INLINE_AGENT_INPUT.members["inputText"] - ) +GET_INVOCATION_STEP: APIOperation[GetInvocationStepInput, GetInvocationStepOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_INVOCATION_STEP, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentruntime#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentruntime#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentruntime#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - case 15: - kwargs["streaming_configurations"] = ( - StreamingConfigurations.deserialize(de) - ) +LIST_INVOCATION_STEPS: APIOperation[ + ListInvocationStepsInput, ListInvocationStepsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_INVOCATION_STEPS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentruntime#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentruntime#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentruntime#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 16: - kwargs["prompt_creation_configurations"] = ( - PromptCreationConfigurations.deserialize(de) - ) +PUT_INVOCATION_STEP: APIOperation[PutInvocationStepInput, PutInvocationStepOutput] = ( + APIOperation( + static_schema=_SCHEMA_PUT_INVOCATION_STEP, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentruntime#ConflictException"), + ShapeID("com.amazonaws.bedrockagentruntime#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentruntime#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentruntime#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - case 17: - kwargs["inline_session_state"] = InlineSessionState.deserialize(de) +LIST_SESSIONS: APIOperation[ListSessionsInput, ListSessionsOutput] = APIOperation( + static_schema=_SCHEMA_LIST_SESSIONS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentruntime#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentruntime#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 18: - kwargs["collaborators"] = _deserialize_collaborators( - de, _SCHEMA_INVOKE_INLINE_AGENT_INPUT.members["collaborators"] - ) +UPDATE_SESSION: APIOperation[UpdateSessionInput, UpdateSessionOutput] = APIOperation( + static_schema=_SCHEMA_UPDATE_SESSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentruntime#ConflictException"), + ShapeID("com.amazonaws.bedrockagentruntime#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentruntime#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentruntime#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 19: - kwargs["bedrock_model_configurations"] = ( - InlineBedrockModelConfigurations.deserialize(de) - ) +LIST_TAGS_FOR_RESOURCE: APIOperation[ + ListTagsForResourceInput, ListTagsForResourceOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_TAGS_FOR_RESOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentruntime#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentruntime#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentruntime#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 20: - kwargs["orchestration_type"] = OrchestrationType( - de.read_string( - _SCHEMA_INVOKE_INLINE_AGENT_INPUT.members[ - "orchestrationType" - ] - ) - ) +TAG_RESOURCE: APIOperation[TagResourceInput, TagResourceOutput] = APIOperation( + static_schema=_SCHEMA_TAG_RESOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentruntime#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentruntime#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentruntime#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 21: - kwargs["custom_orchestration"] = CustomOrchestration.deserialize(de) +UNTAG_RESOURCE: APIOperation[UntagResourceInput, UntagResourceOutput] = APIOperation( + static_schema=_SCHEMA_UNTAG_RESOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentruntime#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentruntime#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentruntime#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case _: - logger.debug("Unexpected member schema: %s", schema) +AGENTIC_RETRIEVE_STREAM: APIOperation[ + AgenticRetrieveStreamInput, AgenticRetrieveStreamOutput +] = APIOperation( + static_schema=_SCHEMA_AGENTIC_RETRIEVE_STREAM, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentruntime#BadGatewayException"), + ShapeID("com.amazonaws.bedrockagentruntime#ConflictException"), + ShapeID("com.amazonaws.bedrockagentruntime#DependencyFailedException"), + ShapeID("com.amazonaws.bedrockagentruntime#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentruntime#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentruntime#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - deserializer.read_struct(_SCHEMA_INVOKE_INLINE_AGENT_INPUT, consumer=_consumer) - return kwargs +RETRIEVE: APIOperation[RetrieveInput, RetrieveOutput] = APIOperation( + static_schema=_SCHEMA_RETRIEVE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentruntime#BadGatewayException"), + ShapeID("com.amazonaws.bedrockagentruntime#ConflictException"), + ShapeID("com.amazonaws.bedrockagentruntime#DependencyFailedException"), + ShapeID("com.amazonaws.bedrockagentruntime#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentruntime#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentruntime#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +RETRIEVE_AND_GENERATE: APIOperation[ + RetrieveAndGenerateOperationInput, RetrieveAndGenerateOperationOutput +] = APIOperation( + static_schema=_SCHEMA_RETRIEVE_AND_GENERATE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentruntime#BadGatewayException"), + ShapeID("com.amazonaws.bedrockagentruntime#ConflictException"), + ShapeID("com.amazonaws.bedrockagentruntime#DependencyFailedException"), + ShapeID("com.amazonaws.bedrockagentruntime#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentruntime#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentruntime#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -INVOKE_INLINE_AGENT = APIOperation( - input=InvokeInlineAgentInput, - output=InvokeInlineAgentOutput, - schema=_SCHEMA_INVOKE_INLINE_AGENT, - input_schema=_SCHEMA_INVOKE_INLINE_AGENT_INPUT, - output_schema=_SCHEMA_INVOKE_INLINE_AGENT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentruntime#BadGatewayException" - ): BadGatewayException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentruntime#DependencyFailedException" - ): DependencyFailedException, - ShapeID( - "com.amazonaws.bedrockagentruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentruntime#ValidationException" - ): ValidationException, - } - ), +RETRIEVE_AND_GENERATE_STREAM: APIOperation[ + RetrieveAndGenerateStreamInput, RetrieveAndGenerateStreamOutput +] = APIOperation( + static_schema=_SCHEMA_RETRIEVE_AND_GENERATE_STREAM, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentruntime#BadGatewayException"), + ShapeID("com.amazonaws.bedrockagentruntime#ConflictException"), + ShapeID("com.amazonaws.bedrockagentruntime#DependencyFailedException"), + ShapeID("com.amazonaws.bedrockagentruntime#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentruntime#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentruntime#ValidationException"), + ], effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_BAD_GATEWAY_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_DEPENDENCY_FAILED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, +) + +INVOKE_AGENT: APIOperation[InvokeAgentInput, InvokeAgentOutput] = APIOperation( + static_schema=_SCHEMA_INVOKE_AGENT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentruntime#BadGatewayException"), + ShapeID("com.amazonaws.bedrockagentruntime#ConflictException"), + ShapeID("com.amazonaws.bedrockagentruntime#DependencyFailedException"), + ShapeID("com.amazonaws.bedrockagentruntime#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentruntime#ModelNotReadyException"), + ShapeID("com.amazonaws.bedrockagentruntime#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentruntime#ValidationException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +INVOKE_INLINE_AGENT: APIOperation[InvokeInlineAgentInput, InvokeInlineAgentOutput] = ( + APIOperation( + static_schema=_SCHEMA_INVOKE_INLINE_AGENT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentruntime#BadGatewayException"), + ShapeID("com.amazonaws.bedrockagentruntime#ConflictException"), + ShapeID("com.amazonaws.bedrockagentruntime#DependencyFailedException"), + ShapeID("com.amazonaws.bedrockagentruntime#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentruntime#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentruntime#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentruntime#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) ) diff --git a/clients/aws-sdk-bedrock-agent-runtime/src/aws_sdk_bedrock_agent_runtime/models.pyi b/clients/aws-sdk-bedrock-agent-runtime/src/aws_sdk_bedrock_agent_runtime/models.pyi new file mode 100644 index 00000000..4e2c445c --- /dev/null +++ b/clients/aws-sdk-bedrock-agent-runtime/src/aws_sdk_bedrock_agent_runtime/models.pyi @@ -0,0 +1,9032 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. + +from dataclasses import dataclass +from datetime import datetime +from enum import StrEnum +from typing import Self, Union + +from smithy_core.deserializers import ShapeDeserializer +from smithy_core.documents import Document +from smithy_core.exceptions import ModeledError +from smithy_core.response import ResponseMetadata +from smithy_core.schemas import APIOperation +from smithy_core.serializers import ShapeSerializer +from smithy_core.types import UnknownEnumMixin + +class _SerdeShape: + def serialize(self, serializer: ShapeSerializer) -> None: ... + def serialize_members(self, serializer: ShapeSerializer) -> None: ... + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: ... + +class ServiceError(ModeledError): + """ + Base error for all errors in the service. + + Some exceptions do not extend from this class, including + synthetic, implicit, and shared exception types. + """ + +@dataclass(kw_only=True) +class AccessDeniedException(ServiceError, _SerdeShape): + """ + The request is denied because of missing access permissions. Check your + permissions and retry your request. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass +class ActionGroupExecutorLambda(_SerdeShape): + """ + The Amazon Resource Name (ARN) of the Lambda function containing the + business logic that is carried out upon invoking the action. + """ + + value: str + +@dataclass +class ActionGroupExecutorCustomControl(_SerdeShape): + """ + To return the action group invocation results directly in the + `InvokeInlineAgent` response, specify `RETURN_CONTROL`. + """ + + value: str + +@dataclass +class ActionGroupExecutorUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ActionGroupExecutor = Union[ + ActionGroupExecutorLambda + | ActionGroupExecutorCustomControl + | ActionGroupExecutorUnknown +] +""" +Contains details about the Lambda function containing the business logic +that is carried out upon invoking the action or the custom control +method for handling the information elicited from the user. +""" + +class _ActionGroupExecutorDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> ActionGroupExecutor: ... + +@dataclass(kw_only=True) +class ActionGroupInvocationInput(_SerdeShape): + """ + Contains information about the action group being invoked. For more + information about the possible structures, see the InvocationInput tab + in + [OrchestrationTrace](https://docs.aws.amazon.com/bedrock/latest/userguide/trace-orchestration.html) + in the [Amazon Bedrock User + Guide](https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html). + """ + + action_group_name: str | None = ... + """The name of the action group.""" + verb: str | None = ... + """The API method being used, based off the action group.""" + api_path: str | None = ... + """The path to the API to call, based off the action group.""" + parameters: list[Parameter] | None = ... + """The parameters in the Lambda input event.""" + request_body: RequestBody | None = ... + """The parameters in the request body for the Lambda input event.""" + function: str | None = ... + """The function in the action group to call.""" + execution_type: str | None = ... + """ + How fulfillment of the action is handled. For more information, see + [Handling fulfillment of the + action](https://docs.aws.amazon.com/bedrock/latest/userguide/action-handle.html). + """ + invocation_id: str | None = ... + """ + The unique identifier of the invocation. Only returned if the + `executionType` is `RETURN_CONTROL`. + """ + +@dataclass(kw_only=True) +class ActionGroupInvocationOutput(_SerdeShape): + """ + Contains the JSON-formatted string returned by the API invoked by the + action group. + """ + + text: str | None = ... + """ + The JSON-formatted string returned by the API invoked by the action + group. + """ + metadata: Metadata | None = ... + """Contains information about the action group output.""" + +class ActionGroupSignature(UnknownEnumMixin, StrEnum): + AMAZON_USERINPUT = "AMAZON.UserInput" + AMAZON_CODEINTERPRETER = "AMAZON.CodeInterpreter" + ANTHROPIC_COMPUTER = "ANTHROPIC.Computer" + ANTHROPIC_BASH = "ANTHROPIC.Bash" + ANTHROPIC_TEXTEDITOR = "ANTHROPIC.TextEditor" + +class ActionInvocationType(UnknownEnumMixin, StrEnum): + RESULT = "RESULT" + USER_CONFIRMATION = "USER_CONFIRMATION" + USER_CONFIRMATION_AND_RESULT = "USER_CONFIRMATION_AND_RESULT" + +@dataclass(kw_only=True) +class AgentActionGroup(_SerdeShape): + """Contains details of the inline agent's action group.""" + + action_group_name: str + """The name of the action group.""" + description: str | None = ... + """A description of the action group.""" + parent_action_group_signature: str | None = ... + """ + Specify a built-in or computer use action for this action group. If you + specify a value, you must leave the `description`, `apiSchema`, and + `actionGroupExecutor` fields empty for this action group. + + - To allow your agent to request the user for additional information + when trying to complete a task, set this field to `AMAZON.UserInput`. + + - To allow your agent to generate, run, and troubleshoot code when + trying to complete a task, set this field to `AMAZON.CodeInterpreter`. + + - To allow your agent to use an Anthropic computer use tool, specify one + of the following values. + + Warning: + Computer use is a new Anthropic Claude model capability (in beta) + available with Anthropic Claude 3.7 Sonnet and Claude 3.5 Sonnet v2 + only. When operating computer use functionality, we recommend taking + additional security precautions, such as executing computer actions in + virtual environments with restricted data access and limited internet + connectivity. For more information, see [Configure an Amazon Bedrock + Agent to complete tasks with computer use + tools](https://docs.aws.amazon.com/bedrock/latest/userguide/agent-computer-use.html). + + - `ANTHROPIC.Computer` - Gives the agent permission to use the mouse + and keyboard and take screenshots. + + - `ANTHROPIC.TextEditor` - Gives the agent permission to view, create + and edit files. + + - `ANTHROPIC.Bash` - Gives the agent permission to run commands in a + bash shell. + """ + action_group_executor: ActionGroupExecutor | None = ... + """ + The Amazon Resource Name (ARN) of the Lambda function containing the + business logic that is carried out upon invoking the action or the + custom control method for handling the information elicited from the + user. + """ + api_schema: APISchema | None = ... + """ + Contains either details about the S3 object containing the OpenAPI + schema for the action group or the JSON or YAML-formatted payload + defining the schema. For more information, see [Action group OpenAPI + schemas](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-api-schema.html). + """ + function_schema: FunctionSchema | None = ... + """ + Contains details about the function schema for the action group or the + JSON or YAML-formatted payload defining the schema. + """ + parent_action_group_signature_params: dict[str, str] | None = ... + """ + The configuration settings for a computer use action. + + Warning: + Computer use is a new Anthropic Claude model capability (in beta) + available with Claude 3.7 Sonnet and Claude 3.5 Sonnet v2 only. For more + information, see [Configure an Amazon Bedrock Agent to complete tasks + with computer use + tools](https://docs.aws.amazon.com/bedrock/latest/userguide/agent-computer-use.html). + """ + +class AgentCollaboration(UnknownEnumMixin, StrEnum): + SUPERVISOR = "SUPERVISOR" + SUPERVISOR_ROUTER = "SUPERVISOR_ROUTER" + DISABLED = "DISABLED" + +@dataclass(kw_only=True) +class AgentCollaboratorInputPayload(_SerdeShape): + """ + Input for an agent collaborator. The input can be text or an action + invocation result. + """ + + type: str | None = ... + """The input type.""" + text: str | None = ... + """Input text.""" + return_control_results: ReturnControlResults | None = ... + """An action invocation result.""" + +@dataclass(kw_only=True) +class AgentCollaboratorInvocationInput(_SerdeShape): + """An agent collaborator invocation input.""" + + agent_collaborator_name: str | None = ... + """The collaborator's name.""" + agent_collaborator_alias_arn: str | None = ... + """The collaborator's alias ARN.""" + input: AgentCollaboratorInputPayload | None = ... + """Text or action invocation result input for the collaborator.""" + +@dataclass(kw_only=True) +class AgentCollaboratorInvocationOutput(_SerdeShape): + """Output from an agent collaborator.""" + + agent_collaborator_name: str | None = ... + """The output's agent collaborator name.""" + agent_collaborator_alias_arn: str | None = ... + """The output's agent collaborator alias ARN.""" + output: AgentCollaboratorOutputPayload | None = ... + """The output's output.""" + metadata: Metadata | None = ... + """Contains information about the output from the agent collaborator.""" + +@dataclass(kw_only=True) +class AgentCollaboratorOutputPayload(_SerdeShape): + """ + Output from an agent collaborator. The output can be text or an action + invocation result. + """ + + type: str | None = ... + """The type of output.""" + text: str | None = ... + """Text output.""" + return_control_payload: ReturnControlPayload | None = ... + """An action invocation result.""" + +@dataclass(kw_only=True) +class AgenticRetrieveAction(_SerdeShape): + """An action taken during agentic retrieval.""" + + retrieve: AgenticRetrieveActionDetails | None = ... + """Details of the retrieve action.""" + full_document_expansion: AgenticRetrieveFullDocExpansionDetails | None = ... + """Details of a full document expansion action.""" + memory_retrieve: AgenticRetrieveMemoryRetrieveDetails | None = ... + """ + The details of a long-term memory retrieval that the agent chose to + perform. + """ + +@dataclass(kw_only=True) +class AgenticRetrieveActionDetails(_SerdeShape): + """Details of a retrieve action including the query and target retrievers.""" + + input_query: AgenticRetrieveMessageContent + """The input query used for retrieval.""" + source_retrievers: list[AgenticRetrieveSourceRetriever] + """The list of source retrievers targeted by this action.""" + +@dataclass(kw_only=True) +class AgenticRetrieveBedrockGuardrailConfiguration(_SerdeShape): + """Configuration for a Bedrock guardrail applied during agentic retrieval.""" + + guardrail_id: str + """The unique identifier of the guardrail.""" + guardrail_version: str + """The version of the guardrail to use.""" + +@dataclass(kw_only=True) +class AgenticRetrieveBedrockRerankingConfiguration(_SerdeShape): + """Configuration for a Bedrock reranking model.""" + + model_configuration: AgenticRetrieveBedrockRerankingModelConfiguration + """The model configuration containing the model ARN.""" + +@dataclass(kw_only=True) +class AgenticRetrieveBedrockRerankingModelConfiguration(_SerdeShape): + """Model configuration for a Bedrock reranking model.""" + + model_arn: str + """The ARN of the Bedrock reranking model.""" + +@dataclass(kw_only=True) +class AgenticRetrieveCitation(_SerdeShape): + """A citation mapping a span of the generated answer to supporting results.""" + + start_index: int + """Character offset start in the answer text.""" + end_index: int + """Character offset end (exclusive) in the answer text.""" + references: list[AgenticRetrieveCitationReference] + """References to results that support this span.""" + +@dataclass(kw_only=True) +class AgenticRetrieveCitationReference(_SerdeShape): + """A reference to a specific result item.""" + + result_index: int + """Index into the results array on the same event.""" + +@dataclass(kw_only=True) +class AgenticRetrieveConfiguration(_SerdeShape): + """Configuration settings for the agentic retrieval operation.""" + + foundation_model_type: str = ... + """ + The type of foundation model to use. CUSTOM uses a specified model, + MANAGED uses the service default. + """ + foundation_model_configuration: FoundationModelConfiguration | None = ... + """ + The foundation model configuration. Required when foundationModelType is + CUSTOM. + """ + reranking_model_type: str | None = ... + """ + The type of reranking model to use. CUSTOM uses a specified model, + MANAGED uses the service default. If not specified, defaults to MANAGED + for managed embedding knowledge bases and NONE for custom embedding + knowledge bases. + """ + reranking_configuration: AgenticRetrieveRerankingConfiguration | None = ... + """ + The reranking model configuration. Required when rerankingModelType is + CUSTOM. + """ + max_agent_iteration: int = ... + """The maximum number of agent iterations for retrieval.""" + +@dataclass(kw_only=True) +class AgenticRetrieveFailure(_SerdeShape): + """A failure that occurred during agentic retrieval.""" + + message: str + """A message describing the failure.""" + +@dataclass(kw_only=True) +class AgenticRetrieveFullDocExpansionDetails(_SerdeShape): + """Details of a full document expansion action.""" + + document_id: str | None = ... + """The identifier of the document to expand.""" + source_retriever: AgenticRetrieveSourceRetriever | None = ... + """The source retriever associated with the document.""" + +@dataclass(kw_only=True) +class AgenticRetrieveGeneratedResponse(_SerdeShape): + """The generated response synthesized from retrieved results.""" + + answer: str + """The generated answer text.""" + citations: list[AgenticRetrieveCitation] | None = ... + """Citations mapping spans of the answer to supporting results.""" + +@dataclass(kw_only=True) +class AgenticRetrieveGuardrailWarning(_SerdeShape): + """A warning generated by a guardrail during agentic retrieval.""" + + id: str + """The unique identifier of the guardrail.""" + version: str + """The version of the guardrail.""" + action: str + """The action taken by the guardrail.""" + message: str | None = ... + """A message describing the guardrail evaluation result.""" + +@dataclass(kw_only=True) +class AgenticRetrieveMemoryConfiguration(_SerdeShape): + """ + Specifies an AgentCore Memory resource and how this retrieval uses it. + Set sessionBinding to restore and continue a session. Set + retrievalConfigs to let the agent retrieve from long-term memory. You + must specify at least one of the two. + """ + + memory_id: str + """ + The identifier of the AgentCore Memory resource to use. The resource + must exist in your account and be in the ACTIVE state. + """ + session_binding: AgenticRetrieveMemorySessionBinding | None = ... + """ + The short-term memory session whose history is restored for this + retrieval. To persist the agent-generated answer to the session, omit + persistenceMode or set it to DEFAULT. To leave the session unchanged, + set persistenceMode to NONE. Supply session history through the existing + messages parameter or through short-term memory, but not both. + """ + retrieval_configs: list[AgenticRetrieveMemoryRetrievalConfig] | None = ... + """ + Specifies the long-term memory configuration the agent can retrieve + from. The agent decides whether to retrieve and composes its own query. + This field currently accepts at most one entry. + """ + persistence_mode: str | None = ... + """ + Specifies whether the agent-generated answer is written back to the + given short-term memory session, and applies only when sessionBinding is + set. Valid values: + + - `DEFAULT` (default) -- Specifies that the question and the + agent-generated answer are persisted to the session as a single event. + This value requires generateResponse to be true. + + - `NONE` -- Specifies that the session is left unchanged. + """ + +@dataclass(kw_only=True) +class AgenticRetrieveMemoryMetadataFilter(_SerdeShape): + """ + A metadata filter expression, in the form accepted by the AgentCore + Memory RetrieveMemoryRecords operation. The expression has a left + operand that names the metadata key, an operator, and a right operand. + For the EXISTS and NOT_EXISTS operators, omit the right operand. + """ + + left: AgenticRetrieveMemoryMetadataFilterLeft + """The metadata key that the expression evaluates.""" + operator: str + """ + The relationship that the metadata key and value must have for a memory + record to match. + """ + right: AgenticRetrieveMemoryMetadataFilterRight | None = ... + """ + The value that the expression compares the metadata key against. Supply + this value for every operator except EXISTS and NOT_EXISTS. + """ + +@dataclass +class AgenticRetrieveMemoryMetadataFilterLeftMetadataKey(_SerdeShape): + """The metadata key to filter on.""" + + value: str + +@dataclass +class AgenticRetrieveMemoryMetadataFilterLeftUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +AgenticRetrieveMemoryMetadataFilterLeft = Union[ + AgenticRetrieveMemoryMetadataFilterLeftMetadataKey + | AgenticRetrieveMemoryMetadataFilterLeftUnknown +] +""" +The left operand of a metadata filter expression. Set exactly one +member. +""" + +class _AgenticRetrieveMemoryMetadataFilterLeftDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> AgenticRetrieveMemoryMetadataFilterLeft: ... + +class AgenticRetrieveMemoryMetadataFilterOperator(UnknownEnumMixin, StrEnum): + """ + Specifies the relationship that a metadata key and value must have for a + memory record to match a filter expression. + """ + + EQUALS_TO = "EQUALS_TO" + """ + The EQUALS_TO operator matches memory records whose metadata value + equals the supplied value. + """ + EXISTS = "EXISTS" + """ + The EXISTS operator matches memory records that carry the metadata key, + whatever its value. This operator takes no right operand. + """ + NOT_EXISTS = "NOT_EXISTS" + """ + The NOT_EXISTS operator matches memory records that do not carry the + metadata key. This operator takes no right operand. + """ + BEFORE = "BEFORE" + """ + The BEFORE operator matches memory records whose timestamp metadata + value falls before the supplied value. + """ + AFTER = "AFTER" + """ + The AFTER operator matches memory records whose timestamp metadata value + falls after the supplied value. + """ + CONTAINS = "CONTAINS" + """ + The CONTAINS operator matches memory records whose metadata value + contains the supplied value. + """ + GREATER_THAN = "GREATER_THAN" + """ + The GREATER_THAN operator matches memory records whose numeric metadata + value is greater than the supplied value. + """ + GREATER_THAN_OR_EQUALS = "GREATER_THAN_OR_EQUALS" + """ + The GREATER_THAN_OR_EQUALS operator matches memory records whose numeric + metadata value is greater than or equal to the supplied value. + """ + LESS_THAN = "LESS_THAN" + """ + The LESS_THAN operator matches memory records whose numeric metadata + value is less than the supplied value. + """ + LESS_THAN_OR_EQUALS = "LESS_THAN_OR_EQUALS" + """ + The LESS_THAN_OR_EQUALS operator matches memory records whose numeric + metadata value is less than or equal to the supplied value. + """ + +@dataclass +class AgenticRetrieveMemoryMetadataFilterRightMetadataValue(_SerdeShape): + """The value to compare the metadata key against.""" + + value: AgenticRetrieveMemoryMetadataValue + +@dataclass +class AgenticRetrieveMemoryMetadataFilterRightUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +AgenticRetrieveMemoryMetadataFilterRight = Union[ + AgenticRetrieveMemoryMetadataFilterRightMetadataValue + | AgenticRetrieveMemoryMetadataFilterRightUnknown +] +""" +The right operand of a metadata filter expression. Set exactly one +member. +""" + +class _AgenticRetrieveMemoryMetadataFilterRightDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> AgenticRetrieveMemoryMetadataFilterRight: ... + +@dataclass +class AgenticRetrieveMemoryMetadataValueStringValue(_SerdeShape): + """A string value.""" + + value: str + +@dataclass +class AgenticRetrieveMemoryMetadataValueNumberValue(_SerdeShape): + """A numeric value.""" + + value: float + +@dataclass +class AgenticRetrieveMemoryMetadataValueStringListValue(_SerdeShape): + """A list of string values.""" + + value: list[str] + +@dataclass +class AgenticRetrieveMemoryMetadataValueDateTimeValue(_SerdeShape): + """A timestamp value in ISO 8601 UTC format.""" + + value: datetime + +@dataclass +class AgenticRetrieveMemoryMetadataValueUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +AgenticRetrieveMemoryMetadataValue = Union[ + AgenticRetrieveMemoryMetadataValueStringValue + | AgenticRetrieveMemoryMetadataValueNumberValue + | AgenticRetrieveMemoryMetadataValueStringListValue + | AgenticRetrieveMemoryMetadataValueDateTimeValue + | AgenticRetrieveMemoryMetadataValueUnknown +] +""" +A metadata value that a filter expression compares against. Set exactly +one member. +""" + +class _AgenticRetrieveMemoryMetadataValueDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> AgenticRetrieveMemoryMetadataValue: ... + +class AgenticRetrieveMemoryPersistenceMode(UnknownEnumMixin, StrEnum): + """ + Specifies whether the agent-generated answer is written back to a + short-term memory session. + """ + + DEFAULT = "DEFAULT" + """ + Specifies that the question and the agent-generated answer are persisted + to the session. This is the default when persistenceMode is omitted. + """ + NONE = "NONE" + """Specifies that the session is left unchanged.""" + +@dataclass(kw_only=True) +class AgenticRetrieveMemoryRetrievalConfig(_SerdeShape): + """ + The long-term memory namespace that the agent might retrieve memory + records from, and the filters applied to that retrieval. You must + specify either namespace or namespacePath. + """ + + namespace: str | None = ... + """ + The namespace prefix to filter memory records by. The agent retrieves + memory records in namespaces that start with the provided prefix. You + must specify either namespace or namespacePath. + """ + namespace_path: str | None = ... + """ + The parent namespace to use for hierarchical retrievals. The agent + retrieves all memory records whose namespace falls under the same parent + hierarchy. You must specify either namespace or namespacePath. + """ + strategy_id: str | None = ... + """ + The extraction strategy ID that restricts retrieval to memory records + produced by a single strategy. Omit this parameter to retrieve records + from every strategy on the memory resource. + """ + metadata_filters: list[AgenticRetrieveMemoryMetadataFilter] | None = ... + """ + The metadata filter expressions that restrict retrieval to matching + memory records. You can specify a maximum of 5 expressions. + """ + +@dataclass(kw_only=True) +class AgenticRetrieveMemoryRetrieveDetails(_SerdeShape): + """ + A long-term memory retrieval that the agent chose to perform. The record + reports the query and the namespace. The corresponding Retrieval step + reports the results. + """ + + input_query: AgenticRetrieveMessageContent + """The query that the agent composed.""" + memory_id: str + """The identifier of the AgentCore Memory resource retrieved from.""" + namespace: str | None = ... + """ + The namespace prefix retrieved from, as supplied in the request. This + field is present when the request specified namespace. + """ + namespace_path: str | None = ... + """ + The parent namespace retrieved from hierarchically, as supplied in the + request. This field is present when the request specified namespacePath. + """ + strategy_id: str | None = ... + """ + The extraction strategy that restricted retrieval, if the request + specified one. + """ + +@dataclass(kw_only=True) +class AgenticRetrieveMemorySessionBinding(_SerdeShape): + """ + The short-term memory session that this retrieval reads from and writes + to. + """ + + actor_id: str + """ + The identifier of the end user or agent that the session belongs to. + This identifier scopes session history so that one actor's history is + never returned for another. You are responsible for sending the correct + actor value. + """ + session_id: str + """ + The identifier of the session to restore and continue. You are + responsible for sending the correct session value. + """ + +@dataclass(kw_only=True) +class AgenticRetrieveMessage(_SerdeShape): + """A message in the agentic retrieval conversation.""" + + content: AgenticRetrieveMessageContent + """The content of the message.""" + role: str + """The role of the message sender (e.g., user or assistant).""" + +@dataclass(kw_only=True) +class AgenticRetrieveMessageContent(_SerdeShape): + """The content of an agentic retrieval message.""" + + text: str | None = ... + """The text content of the message.""" + +@dataclass(kw_only=True) +class AgenticRetrievePolicyConfiguration(_SerdeShape): + """Policy configuration for agentic retrieval.""" + + bedrock_guardrail_configuration: ( + AgenticRetrieveBedrockGuardrailConfiguration | None + ) = ... + """Configuration for Bedrock guardrails to apply during retrieval.""" + +@dataclass(kw_only=True) +class AgenticRetriever(_SerdeShape): + """A retriever used in agentic retrieval.""" + + description: str | None = ... + """A description of the retriever's purpose.""" + configuration: RetrieverConfiguration + """The configuration for this retriever.""" + +@dataclass(kw_only=True) +class AgenticRetrieveRerankingConfiguration(_SerdeShape): + """Configuration for the reranking model.""" + + type: str + """The type of reranking configuration.""" + bedrock_reranking_configuration: ( + AgenticRetrieveBedrockRerankingConfiguration | None + ) = ... + """The Bedrock reranking model configuration.""" + +class AgenticRetrieveRerankingConfigurationType(UnknownEnumMixin, StrEnum): + """The type of reranking configuration.""" + + BEDROCK_RERANKING_MODEL = "BEDROCK_RERANKING_MODEL" + +class AgenticRetrieveRerankingModelType(UnknownEnumMixin, StrEnum): + """The type of reranking model.""" + + CUSTOM = "CUSTOM" + MANAGED = "MANAGED" + NONE = "NONE" + +@dataclass(kw_only=True) +class AgenticRetrieveResponseEvent(_SerdeShape): + """A chunk of the generated answer text.""" + + text: str + """The generated text chunk.""" + +@dataclass(kw_only=True) +class AgenticRetrieveResultEvent(_SerdeShape): + """An event containing agentic retrieval results.""" + + results: list[AgenticRetrieveResultItem] + """The list of retrieved result items.""" + generated_response: AgenticRetrieveGeneratedResponse | None = ... + """The generated response. Present only when generateResponse is true.""" + next_token: str | None = ... + """Opaque continuation token for paginated results.""" + +@dataclass(kw_only=True) +class AgenticRetrieveResultItem(_SerdeShape): + """A single item from the agentic retrieval results.""" + + content: RetrievalContent + """The retrieved content.""" + metadata: dict[str, Document] | None = ... + """Metadata associated with the retrieved item.""" + source_retriever: AgenticRetrieveSourceRetriever + """The source retriever that produced this result.""" + +@dataclass(kw_only=True) +class AgenticRetrieveSourceMetadata(_SerdeShape): + """Metadata about a retrieval source.""" + + identifier: str | None = ... + """The identifier of the retrieval source.""" + retrieval_type: str | None = ... + """The type of retrieval source.""" + +@dataclass(kw_only=True) +class AgenticRetrieveSourceRetriever(_SerdeShape): + """A source retriever that produced retrieval results.""" + + identifier: str + """The unique identifier of the source retriever.""" + +class AgenticRetrieveStatus(UnknownEnumMixin, StrEnum): + """The status of an agentic retrieval step.""" + + IN_PROGRESS = "IN_PROGRESS" + """The step is currently in progress.""" + SUCCEEDED = "SUCCEEDED" + """The step completed successfully.""" + FAILED = "FAILED" + """The step failed.""" + +class AgenticRetrieveStep(UnknownEnumMixin, StrEnum): + """The step in the agentic retrieval process.""" + + PLANNING = "Planning" + """The planning phase of retrieval.""" + RETRIEVAL = "Retrieval" + """The retrieval phase where data is fetched.""" + SPECULATIVE_RETRIEVAL = "SpeculativeRetrieval" + """A speculative retrieval phase for optimization.""" + FULL_DOCUMENT_EXPANSION = "FullDocumentExpansion" + """The full document expansion phase.""" + SESSION_HISTORY_LOAD = "SessionHistoryLoad" + """ + The phase that restores prior session history from AgentCore Memory + short-term memory, before the agent begins work. + """ + +@dataclass(kw_only=True) +class AgenticRetrieveStreamInput(_SerdeShape): + """Request structure for the agentic retrieve stream operation.""" + + messages: list[AgenticRetrieveMessage] | None = ... + """The list of messages for the agentic retrieval conversation.""" + retrievers: list[AgenticRetriever] | None = ... + """The list of retrievers to use for agentic retrieval.""" + agentic_retrieve_configuration: AgenticRetrieveConfiguration | None = ... + """Configuration settings for the agentic retrieval operation.""" + policy_configuration: AgenticRetrievePolicyConfiguration | None = ... + """Policy configuration for guardrails and content filtering.""" + next_token: str | None = ... + """Opaque continuation token for paginated results.""" + user_context: UserContext | None = ... + """ + Contains information about the user making the request. This is used for + access control filtering to ensure that retrieval results only include + documents the user is authorized to access. + """ + memory_configuration: AgenticRetrieveMemoryConfiguration | None = ... + """ + The configuration for using an Amazon Bedrock AgentCore Memory resource + with this retrieval. + """ + generate_response: bool = ... + """Whether to generate a response based on the retrieved results.""" + +@dataclass(kw_only=True) +class AgenticRetrieveStreamOutput(_SerdeShape): + """Response structure for the agentic retrieve stream operation.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass +class AgenticRetrieveStreamResponseOutputResult(_SerdeShape): + """A retrieval result event containing the retrieved items.""" + + value: AgenticRetrieveResultEvent + +@dataclass +class AgenticRetrieveStreamResponseOutputTraceEvent(_SerdeShape): + """A trace event providing visibility into the retrieval process.""" + + value: AgenticRetrieveTraceEvent + +@dataclass +class AgenticRetrieveStreamResponseOutputResponseEvent(_SerdeShape): + """ + A chunk of the generated answer. Emitted only when generateResponse is + true. + """ + + value: AgenticRetrieveResponseEvent + +@dataclass +class AgenticRetrieveStreamResponseOutputInternalServerException(_SerdeShape): + """An internal server error occurred.""" + + value: InternalServerException + +@dataclass +class AgenticRetrieveStreamResponseOutputValidationException(_SerdeShape): + """The request validation failed.""" + + value: ValidationException + +@dataclass +class AgenticRetrieveStreamResponseOutputResourceNotFoundException(_SerdeShape): + """The specified resource was not found.""" + + value: ResourceNotFoundException + +@dataclass +class AgenticRetrieveStreamResponseOutputServiceQuotaExceededException(_SerdeShape): + """The service quota has been exceeded.""" + + value: ServiceQuotaExceededException + +@dataclass +class AgenticRetrieveStreamResponseOutputThrottlingException(_SerdeShape): + """The request was throttled.""" + + value: ThrottlingException + +@dataclass +class AgenticRetrieveStreamResponseOutputAccessDeniedException(_SerdeShape): + """Access to the resource was denied.""" + + value: AccessDeniedException + +@dataclass +class AgenticRetrieveStreamResponseOutputConflictException(_SerdeShape): + """A conflict occurred with the current state of the resource.""" + + value: ConflictException + +@dataclass +class AgenticRetrieveStreamResponseOutputDependencyFailedException(_SerdeShape): + """A dependency failed during the operation.""" + + value: DependencyFailedException + +@dataclass +class AgenticRetrieveStreamResponseOutputBadGatewayException(_SerdeShape): + """A bad gateway error occurred.""" + + value: BadGatewayException + +@dataclass +class AgenticRetrieveStreamResponseOutputUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +AgenticRetrieveStreamResponseOutput = Union[ + AgenticRetrieveStreamResponseOutputResult + | AgenticRetrieveStreamResponseOutputTraceEvent + | AgenticRetrieveStreamResponseOutputResponseEvent + | AgenticRetrieveStreamResponseOutputInternalServerException + | AgenticRetrieveStreamResponseOutputValidationException + | AgenticRetrieveStreamResponseOutputResourceNotFoundException + | AgenticRetrieveStreamResponseOutputServiceQuotaExceededException + | AgenticRetrieveStreamResponseOutputThrottlingException + | AgenticRetrieveStreamResponseOutputAccessDeniedException + | AgenticRetrieveStreamResponseOutputConflictException + | AgenticRetrieveStreamResponseOutputDependencyFailedException + | AgenticRetrieveStreamResponseOutputBadGatewayException + | AgenticRetrieveStreamResponseOutputUnknown +] +""" +The streaming output for agentic retrieval, containing results, traces, +and errors. +""" + +class _AgenticRetrieveStreamResponseOutputDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> AgenticRetrieveStreamResponseOutput: ... + +@dataclass(kw_only=True) +class AgenticRetrieveTraceEvent(_SerdeShape): + """A trace event providing visibility into the agentic retrieval process.""" + + id: str + """The unique identifier of the trace event.""" + timestamp: int + """The timestamp when the trace event occurred.""" + attributes: AgenticRetrieveTraceEventAttributes + """The attributes describing the trace event details.""" + +@dataclass(kw_only=True) +class AgenticRetrieveTraceEventAttributes(_SerdeShape): + """Attributes describing the details of an agentic retrieval trace event.""" + + step: str + """The current step in the retrieval process.""" + status: str + """The status of the current step.""" + message: str + """A human-readable message describing the trace event.""" + actions: list[AgenticRetrieveAction] | None = ... + """The list of actions taken during this step.""" + warnings: list[AgenticRetrieveWarning] | None = ... + """Warnings generated during this step.""" + failures: list[AgenticRetrieveFailure] | None = ... + """Failures that occurred during this step.""" + retrieval_metadata: list[AgenticRetrieveSourceMetadata] | None = ... + """Metadata about the retrieval sources used.""" + retrieval_response: list[AgenticRetrieveTraceResultItem] | None = ... + """The retrieval results from this step.""" + +@dataclass(kw_only=True) +class AgenticRetrieveTraceResultItem(_SerdeShape): + """A result item from an agentic retrieval trace.""" + + content: RetrievalContent | None = ... + """The retrieved content.""" + metadata: dict[str, Document] | None = ... + """Metadata associated with the retrieved item.""" + source_retriever: AgenticRetrieveSourceRetriever | None = ... + """The source retriever that produced this result.""" + +class AgenticRetrieveType(UnknownEnumMixin, StrEnum): + """The type of retrieval source.""" + + BEDROCK_KNOWLEDGE_BASE = "BedrockKnowledgeBase" + """A Bedrock knowledge base retrieval source.""" + BEDROCK_AGENT_CORE_MEMORY = "BedrockAgentCoreMemory" + """ + An AgentCore Memory resource. Long-term memory retrievals report under + the Retrieval step with this source type. + """ + +@dataclass +class AgenticRetrieveWarning_Message(_SerdeShape): + """A general warning message.""" + + value: AgenticRetrieveWarningMessage + +@dataclass +class AgenticRetrieveWarningGuardrail(_SerdeShape): + """A warning from a guardrail evaluation.""" + + value: AgenticRetrieveGuardrailWarning + +@dataclass +class AgenticRetrieveWarningUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +AgenticRetrieveWarning = Union[ + AgenticRetrieveWarning_Message + | AgenticRetrieveWarningGuardrail + | AgenticRetrieveWarningUnknown +] +"""A warning generated during agentic retrieval.""" + +class _AgenticRetrieveWarningDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> AgenticRetrieveWarning: ... + +@dataclass(kw_only=True) +class AgenticRetrieveWarningMessage(_SerdeShape): + """A general warning message from agentic retrieval.""" + + message: str + """The warning message text.""" + +@dataclass(kw_only=True) +class AnalyzePromptEvent(_SerdeShape): + """ + An event in which the prompt was analyzed in preparation for + optimization. + """ + + message: str | None = ... + """A message describing the analysis of the prompt.""" + +@dataclass(kw_only=True) +class ApiInvocationInput(_SerdeShape): + """ + Contains information about the API operation that the agent predicts + should be called. + + This data type is used in the following API operations: + + - In the `returnControl` field of the [InvokeAgent + response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax) + """ + + action_group: str + """The action group that the API operation belongs to.""" + http_method: str | None = ... + """The HTTP method of the API operation.""" + api_path: str | None = ... + """The path to the API operation.""" + parameters: list[ApiParameter] | None = ... + """ + The parameters to provide for the API request, as the agent elicited + from the user. + """ + request_body: ApiRequestBody | None = ... + """ + The request body to provide for the API request, as the agent elicited + from the user. + """ + action_invocation_type: str | None = ... + """Contains information about the API operation to invoke.""" + agent_id: str | None = ... + """The agent's ID.""" + collaborator_name: str | None = ... + """The agent collaborator's name.""" + +@dataclass(kw_only=True) +class ApiParameter(_SerdeShape): + """ + Information about a parameter to provide to the API request. + + This data type is used in the following API operations: + + - [InvokeAgent + response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax) + """ + + name: str | None = ... + """The name of the parameter.""" + type: str | None = ... + """The data type for the parameter.""" + value: str | None = ... + """The value of the parameter.""" + +@dataclass(kw_only=True) +class ApiRequestBody(_SerdeShape): + """ + The request body to provide for the API request, as the agent elicited + from the user. + + This data type is used in the following API operations: + + - [InvokeAgent + response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax) + """ + + content: dict[str, PropertyParameters] | None = ... + """ + The content of the request body. The key of the object in this field is + a media type defining the format of the request body. + """ + +@dataclass(kw_only=True) +class ApiResult(_SerdeShape): + """ + Contains information about the API operation that was called from the + action group and the response body that was returned. + + This data type is used in the following API operations: + + - In the `returnControlInvocationResults` of the [InvokeAgent + request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_RequestSyntax) + """ + + action_group: str + """The action group that the API operation belongs to.""" + http_method: str | None = ... + """The HTTP method for the API operation.""" + api_path: str | None = ... + """The path to the API operation.""" + confirmation_state: str | None = ... + """ + Controls the API operations or functions to invoke based on the user + confirmation. + """ + response_state: str | None = ... + """ + Controls the final response state returned to end user when API/Function + execution failed. When this state is FAILURE, the request would fail + with dependency failure exception. When this state is REPROMPT, the + API/function response will be sent to model for re-prompt + """ + http_status_code: int | None = ... + """ + http status code from API execution response (for example: 200, 400, + 500). + """ + response_body: dict[str, ContentBody] | None = ... + """ + The response body from the API operation. The key of the object is the + content type (currently, only `TEXT` is supported). The response may be + returned directly or from the Lambda function. + """ + agent_id: str | None = ... + """The agent's ID.""" + +@dataclass +class APISchemaS3(_SerdeShape): + """ + Contains details about the S3 object containing the OpenAPI schema for + the action group. + """ + + value: S3Identifier + +@dataclass +class APISchemaPayload(_SerdeShape): + """ + The JSON or YAML-formatted payload defining the OpenAPI schema for the + action group. + """ + + value: str + +@dataclass +class APISchemaUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +APISchema = Union[APISchemaS3 | APISchemaPayload | APISchemaUnknown] +""" +Contains details about the OpenAPI schema for the action group. For more +information, see [Action group OpenAPI +schemas](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-api-schema.html). +You can either include the schema directly in the payload field or you +can upload it to an S3 bucket and specify the S3 bucket location in the +s3 field. +""" + +class _APISchemaDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> APISchema: ... + +class AttributeType(UnknownEnumMixin, StrEnum): + STRING = "STRING" + NUMBER = "NUMBER" + BOOLEAN = "BOOLEAN" + STRING_LIST = "STRING_LIST" + +@dataclass(kw_only=True) +class Attribution(_SerdeShape): + """Contains citations for a part of an agent response.""" + + citations: list[Citation] | None = ... + """ + A list of citations and related information for a part of an agent + response. + """ + +@dataclass(kw_only=True) +class AudioSegment(_SerdeShape): + """ + Contains information about an audio segment retrieved from a knowledge + base, including its location and transcription. + + This data type is used in the following API operations: + + - [Retrieve + response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax) + -- in the `audio` field + """ + + s3_uri: str + """ + The S3 URI where this specific audio segment is stored in the multimodal + storage destination. + """ + transcription: str | None = ... + """The text transcription of the audio segment content.""" + +@dataclass(kw_only=True) +class BadGatewayException(ServiceError, _SerdeShape): + """ + There was an issue with a dependency due to a server issue. Retry your + request. + """ + + resource_name: str | None = ... + """ + The name of the dependency that caused the issue, such as Amazon + Bedrock, Lambda, or STS. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class BedrockFoundationModelConfiguration(_SerdeShape): + """Configuration for a Bedrock foundation model.""" + + model_configuration: BedrockFoundationModelModelConfiguration + """The model configuration containing the model ARN.""" + +@dataclass(kw_only=True) +class BedrockFoundationModelModelConfiguration(_SerdeShape): + """Model configuration for a Bedrock foundation model.""" + + model_arn: str + """The ARN of the Bedrock foundation model.""" + +@dataclass(kw_only=True) +class BedrockModelConfigurations(_SerdeShape): + """Settings for a model called with InvokeAgent.""" + + performance_config: PerformanceConfiguration | None = ... + """The performance configuration for the model.""" + +@dataclass(kw_only=True) +class BedrockRerankingConfiguration(_SerdeShape): + """Contains configurations for an Amazon Bedrock reranker model.""" + + number_of_results: int | None = ... + """The number of results to return after reranking.""" + model_configuration: BedrockRerankingModelConfiguration + """Contains configurations for a reranker model.""" + +@dataclass(kw_only=True) +class BedrockRerankingModelConfiguration(_SerdeShape): + """Contains configurations for a reranker model.""" + + model_arn: str + """The ARN of the reranker model.""" + additional_model_request_fields: dict[str, Document] | None = ... + """ + A JSON object whose keys are request fields for the model and whose + values are values for those fields. + """ + +@dataclass +class BedrockSessionContentBlockText(_SerdeShape): + """The text in the invocation step.""" + + value: str + +@dataclass +class BedrockSessionContentBlockImage(_SerdeShape): + """The image in the invocation step.""" + + value: ImageBlock + +@dataclass +class BedrockSessionContentBlockUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +BedrockSessionContentBlock = Union[ + BedrockSessionContentBlockText + | BedrockSessionContentBlockImage + | BedrockSessionContentBlockUnknown +] +""" +A block of content that you pass to, or receive from, a Amazon Bedrock +session in an invocation step. You pass the content to a session in the +`payLoad` of the +[PutInvocationStep](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_PutInvocationStep.html) +API operation. You retrieve the content with the +[GetInvocationStep](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_GetInvocationStep.html) +API operation. + +For more information about sessions, see [Store and retrieve +conversation history and context with Amazon Bedrock +sessions](https://docs.aws.amazon.com/bedrock/latest/userguide/sessions.html). +""" + +class _BedrockSessionContentBlockDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> BedrockSessionContentBlock: ... + +@dataclass(kw_only=True) +class ByteContentDoc(_SerdeShape): + """ + This property contains the document to chat with, along with its + attributes. + """ + + identifier: str + """The file name of the document contained in the wrapper object.""" + content_type: str + """The MIME type of the document contained in the wrapper object.""" + data: bytes + """The byte value of the file to upload, encoded as a Base-64 string.""" + +@dataclass(kw_only=True) +class ByteContentFile(_SerdeShape): + """The property contains the file to chat with, along with its attributes.""" + + media_type: str + """The MIME type of data contained in the file used for chat.""" + data: bytes + """ + The raw bytes of the file to attach. The maximum size of all files that + is attached is 10MB. You can attach a maximum of 5 files. + """ + +@dataclass +class CallerAgentAliasArn(_SerdeShape): + """The caller's agent alias ARN.""" + + value: str + +@dataclass +class CallerUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +Caller = Union[CallerAgentAliasArn | CallerUnknown] +"""Details about a caller.""" + +class _CallerDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> Caller: ... + +@dataclass(kw_only=True) +class CheckIngestedDocumentAclInput(_SerdeShape): + """Dataclass for CheckIngestedDocumentAclInput structure.""" + + knowledge_base_id: str | None = ... + """The unique identifier of the knowledge base that contains the document.""" + data_source_id: str | None = ... + """The unique identifier of the data source that contains the document.""" + document_id: str | None = ... + """The unique identifier of the document to check access for.""" + user_context: UserContext | None = ... + """ + The context object containing identity information for access control + filtering, including user ID and optional group memberships used to + evaluate the document access control list (ACL). + """ + +@dataclass(kw_only=True) +class CheckIngestedDocumentAclOutput(_SerdeShape): + """Dataclass for CheckIngestedDocumentAclOutput structure.""" + + has_access: bool + """ + Specifies whether the user has access to the document based on the + ingested access control list (ACL). Returns `true` if the user is + allowed access, and `false` otherwise. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class Citation(_SerdeShape): + """ + An object containing a segment of the generated response that is based + on a source in the knowledge base, alongside information about the + source. + + This data type is used in the following API operations: + + - [InvokeAgent + response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax) + -- in the `citations` field + + - [RetrieveAndGenerate + response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax) + -- in the `citations` field + """ + + generated_response_part: GeneratedResponsePart | None = ... + """Contains the generated response and metadata""" + retrieved_references: list[RetrievedReference] | None = ... + """Contains metadata about the sources cited for the generated response.""" + +@dataclass(kw_only=True) +class CitationEvent(_SerdeShape): + """A citation event.""" + + citation: Citation | None = ... + """The citation.""" + generated_response_part: GeneratedResponsePart | None = ... + """The generated response to the citation event.""" + retrieved_references: list[RetrievedReference] | None = ... + """The retrieved references of the citation event.""" + +@dataclass(kw_only=True) +class CodeInterpreterInvocationInput(_SerdeShape): + """Contains information about the code interpreter being invoked.""" + + code: str | None = ... + """The code for the code interpreter to use.""" + files: list[str] | None = ... + """Files that are uploaded for code interpreter to use.""" + +@dataclass(kw_only=True) +class CodeInterpreterInvocationOutput(_SerdeShape): + """ + Contains the JSON-formatted string returned by the API invoked by the + code interpreter. + """ + + execution_output: str | None = ... + """Contains the successful output returned from code execution""" + execution_error: str | None = ... + """Contains the error returned from code execution.""" + files: list[str] | None = ... + """Contains output files, if generated by code execution.""" + execution_timeout: bool | None = ... + """Indicates if the execution of the code timed out.""" + metadata: Metadata | None = ... + """Contains information about the output from the code interpreter.""" + +@dataclass(kw_only=True) +class Collaborator(_SerdeShape): + """List of inline collaborators.""" + + customer_encryption_key_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the AWS KMS key that encrypts the + inline collaborator. + """ + foundation_model: str + """The foundation model used by the inline collaborator agent.""" + instruction: str + """ + Instruction that tell the inline collaborator agent what it should do + and how it should interact with users. + """ + idle_session_ttl_in_seconds: int | None = ... + """ + The number of seconds for which the Amazon Bedrock keeps information + about the user's conversation with the inline collaborator agent. + + A user interaction remains active for the amount of time specified. If + no conversation occurs during this time, the session expires and Amazon + Bedrock deletes any data provided before the timeout. + """ + action_groups: list[AgentActionGroup] | None = ... + """ + List of action groups with each action group defining tasks the inline + collaborator agent needs to carry out. + """ + knowledge_bases: list[KnowledgeBase] | None = ... + """Knowledge base associated with the inline collaborator agent.""" + guardrail_configuration: GuardrailConfigurationWithArn | None = ... + """Details of the guardwrail associated with the inline collaborator.""" + prompt_override_configuration: PromptOverrideConfiguration | None = ... + """ + Contains configurations to override prompt templates in different parts + of an inline collaborator sequence. For more information, see [Advanced + prompts](https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts.html). + """ + agent_collaboration: str | None = ... + """ + Defines how the inline supervisor agent handles information across + multiple collaborator agents to coordinate a final response. + """ + collaborator_configurations: list[CollaboratorConfiguration] | None = ... + """Settings of the collaborator agent.""" + agent_name: str | None = ... + """ + Name of the inline collaborator agent which must be the same name as + specified for `collaboratorName`. + """ + +@dataclass(kw_only=True) +class CollaboratorConfiguration(_SerdeShape): + """Settings of an inline collaborator agent.""" + + collaborator_name: str + """ + Name of the inline collaborator agent which must be the same name as + specified for `agentName`. + """ + collaborator_instruction: str + """ + Instructions that tell the inline collaborator agent what it should do + and how it should interact with users. + """ + agent_alias_arn: str | None = ... + """The Amazon Resource Name (ARN) of the inline collaborator agent.""" + relay_conversation_history: str | None = ... + """A relay conversation history for the inline collaborator agent.""" + +@dataclass(kw_only=True) +class ConditionResultEvent(_SerdeShape): + """ + Contains information about a condition evaluation result during a flow + execution. This event is generated when a condition node in the flow + evaluates its conditions. + + Note: + Flow executions is in preview release for Amazon Bedrock and is subject + to change. + """ + + node_name: str + """The name of the condition node that evaluated the conditions.""" + timestamp: datetime + """The timestamp when the condition evaluation occurred.""" + satisfied_conditions: list[SatisfiedCondition] + """A list of conditions that were satisfied during the evaluation.""" + +class ConfirmationState(UnknownEnumMixin, StrEnum): + CONFIRM = "CONFIRM" + DENY = "DENY" + +@dataclass(kw_only=True) +class ConflictException(ServiceError, _SerdeShape): + """ + There was a conflict performing an operation. Resolve the conflict and + retry your request. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass +class ContentBlockText(_SerdeShape): + """The block's text.""" + + value: str + +@dataclass +class ContentBlockUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ContentBlock = Union[ContentBlockText | ContentBlockUnknown] +"""A content block.""" + +class _ContentBlockDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> ContentBlock: ... + +@dataclass(kw_only=True) +class ContentBody(_SerdeShape): + """ + Contains the body of the API response. + + This data type is used in the following API operations: + + - In the `returnControlInvocationResults` field of the [InvokeAgent + request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_RequestSyntax) + """ + + body: str | None = ... + """The body of the API response.""" + images: list[ImageInput] | None = ... + """ + Lists details, including format and source, for the image in the + response from the function call. You can specify only one image and the + function in the `returnControlInvocationResults` must be a computer use + action. For more information, see [Configure an Amazon Bedrock Agent to + complete tasks with computer use + tools](https://docs.aws.amazon.com/bedrock/latest/userguide/agent-computer-use.html). + """ + +@dataclass(kw_only=True) +class ConversationHistory(_SerdeShape): + """A conversation history.""" + + messages: list[Message] | None = ... + """The conversation's messages.""" + +class ConversationRole(UnknownEnumMixin, StrEnum): + USER = "user" + ASSISTANT = "assistant" + +@dataclass(kw_only=True) +class CreateInvocationInput(_SerdeShape): + """Dataclass for CreateInvocationInput structure.""" + + invocation_id: str | None = ... + """A unique identifier for the invocation in UUID format.""" + description: str | None = ... + """ + A description for the interactions in the invocation. For example, + \"User asking about weather in Seattle\". + """ + session_identifier: str | None = ... + """ + The unique identifier for the associated session for the invocation. You + can specify either the session's `sessionId` or its Amazon Resource + Name (ARN). + """ + +@dataclass(kw_only=True) +class CreateInvocationOutput(_SerdeShape): + """Dataclass for CreateInvocationOutput structure.""" + + session_id: str + """The unique identifier for the session associated with the invocation.""" + invocation_id: str + """The unique identifier for the invocation.""" + created_at: datetime + """The timestamp for when the invocation was created.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateSessionInput(_SerdeShape): + """Dataclass for CreateSessionInput structure.""" + + session_metadata: dict[str, str] | None = ... + """ + A map of key-value pairs containing attributes to be persisted across + the session. For example, the user's ID, their language preference, and + the type of device they are using. + """ + encryption_key_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the KMS key to use to encrypt the + session data. The user or role creating the session must have permission + to use the key. For more information, see [Amazon Bedrock session + encryption](https://docs.aws.amazon.com/bedrock/latest/userguide/session-encryption.html). + """ + tags: dict[str, str] | None = ... + """ + Specify the key-value pairs for the tags that you want to attach to the + session. + """ + +@dataclass(kw_only=True) +class CreateSessionOutput(_SerdeShape): + """Dataclass for CreateSessionOutput structure.""" + + session_id: str + """The unique identifier for the session.""" + session_arn: str + """The Amazon Resource Name (ARN) of the created session.""" + session_status: str + """The current status of the session.""" + created_at: datetime + """The timestamp for when the session was created.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class CreationMode(UnknownEnumMixin, StrEnum): + DEFAULT = "DEFAULT" + OVERRIDDEN = "OVERRIDDEN" + +class CustomControlMethod(UnknownEnumMixin, StrEnum): + RETURN_CONTROL = "RETURN_CONTROL" + +@dataclass(kw_only=True) +class CustomOrchestration(_SerdeShape): + """Contains details of the custom orchestration configured for the agent.""" + + executor: OrchestrationExecutor | None = ... + """ + The structure of the executor invoking the actions in custom + orchestration. + """ + +@dataclass(kw_only=True) +class CustomOrchestrationTrace(_SerdeShape): + """The trace behavior for the custom orchestration.""" + + trace_id: str | None = ... + """The unique identifier of the trace.""" + event: CustomOrchestrationTraceEvent | None = ... + """The event details used with the custom orchestration.""" + +@dataclass(kw_only=True) +class CustomOrchestrationTraceEvent(_SerdeShape): + """ + The event in the custom orchestration sequence. Events are the responses + which the custom orchestration Lambda function sends as response to the + agent. + """ + + text: str | None = ... + """The text that prompted the event at this step.""" + +@dataclass(kw_only=True) +class DeleteAgentMemoryInput(_SerdeShape): + """Dataclass for DeleteAgentMemoryInput structure.""" + + agent_id: str | None = ... + """The unique identifier of the agent to which the alias belongs.""" + agent_alias_id: str | None = ... + """The unique identifier of an alias of an agent.""" + memory_id: str | None = ... + """The unique identifier of the memory.""" + session_id: str | None = ... + """The unique session identifier of the memory.""" + +@dataclass(kw_only=True) +class DeleteAgentMemoryOutput(_SerdeShape): + """Dataclass for DeleteAgentMemoryOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteSessionInput(_SerdeShape): + """Dataclass for DeleteSessionInput structure.""" + + session_identifier: str | None = ... + """ + The unique identifier for the session to be deleted. You can specify + either the session's `sessionId` or its Amazon Resource Name (ARN). + """ + +@dataclass(kw_only=True) +class DeleteSessionOutput(_SerdeShape): + """Dataclass for DeleteSessionOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DependencyFailedException(ServiceError, _SerdeShape): + """ + There was an issue with a dependency. Check the resource configurations + and retry the request. + """ + + resource_name: str | None = ... + """ + The name of the dependency that caused the issue, such as Amazon + Bedrock, Lambda, or STS. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DocumentAcl(_SerdeShape): + """ + The access control list for a document, containing allow and deny + membership lists. Each list specifies conditions that determine which + users and groups are granted or denied access. + """ + + allow_list: DocumentAclMembership | None = ... + """The list of principals allowed access to the document.""" + deny_list: DocumentAclMembership | None = ... + """The list of principals denied access to the document.""" + +@dataclass(kw_only=True) +class DocumentAclCondition(_SerdeShape): + """ + A condition within a document access control list (ACL) membership, + specifying users and groups that are evaluated together. + """ + + condition_operator: str | None = ... + """ + The logical operator for combining users and groups within this + condition. Valid values: `AND` -- Both a user match and a group match + are required. `OR` -- Either a user match or a group match is + sufficient. + """ + users: list[DocumentAclUser] | None = ... + """The list of user entries in this condition.""" + groups: list[DocumentAclGroup] | None = ... + """The list of group entries in this condition.""" + +@dataclass(kw_only=True) +class DocumentAclGroup(_SerdeShape): + """A group entry within a document access control list (ACL) condition.""" + + id: str + """The identifier of the group.""" + type: str + """The membership type indicating the scope of the group entry.""" + +class DocumentAclMemberRelation(UnknownEnumMixin, StrEnum): + """ + The logical relation for combining access control list (ACL) membership + conditions. + """ + + AND_ = "AND" + OR_ = "OR" + +@dataclass(kw_only=True) +class DocumentAclMembership(_SerdeShape): + """ + The membership entry for a document access control list (ACL), + containing conditions and their logical relation. + """ + + member_relation: str | None = ... + """ + The logical relation between conditions. Valid values: `AND` -- All + conditions must match. `OR` -- At least one condition must match. + """ + conditions: list[DocumentAclCondition] | None = ... + """The list of conditions that determine membership.""" + +class DocumentAclMembershipType(UnknownEnumMixin, StrEnum): + """ + The scope type for a document access control list (ACL) membership + condition. Valid values: `KNOWLEDGE_BASE` -- The entry applies at the + knowledge base level. `DATA_SOURCE` -- The entry applies at the data + source level. + """ + + KNOWLEDGE_BASE = "KNOWLEDGE_BASE" + DATA_SOURCE = "DATA_SOURCE" + +@dataclass(kw_only=True) +class DocumentAclUser(_SerdeShape): + """A user entry within a document access control list (ACL) condition.""" + + id: str + """The identifier of the user.""" + type: str + """The membership type indicating the scope of the user entry.""" + +class DocumentOutputFormat(UnknownEnumMixin, StrEnum): + RAW = "RAW" + EXTRACTED = "EXTRACTED" + +@dataclass(kw_only=True) +class EndSessionInput(_SerdeShape): + """Dataclass for EndSessionInput structure.""" + + session_identifier: str | None = ... + """ + The unique identifier for the session to end. You can specify either the + session's `sessionId` or its Amazon Resource Name (ARN). + """ + +@dataclass(kw_only=True) +class EndSessionOutput(_SerdeShape): + """Dataclass for EndSessionOutput structure.""" + + session_id: str + """The unique identifier of the session you ended.""" + session_arn: str + """The Amazon Resource Name (ARN) of the session you ended.""" + session_status: str + """The current status of the session you ended.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class ExecutionType(UnknownEnumMixin, StrEnum): + LAMBDA_ = "LAMBDA" + RETURN_CONTROL = "RETURN_CONTROL" + +@dataclass(kw_only=True) +class ExternalSource(_SerdeShape): + """ + The unique external source of the content contained in the wrapper + object. + """ + + source_type: str + """The source type of the external source wrapper object.""" + s3_location: S3ObjectDoc | None = ... + """The S3 location of the external source wrapper object.""" + byte_content: ByteContentDoc | None = ... + """ + The identifier, contentType, and data of the external source wrapper + object. + """ + +@dataclass(kw_only=True) +class ExternalSourcesGenerationConfiguration(_SerdeShape): + """ + Contains the generation configuration of the external source wrapper + object. + """ + + prompt_template: PromptTemplate | None = ... + """ + Contain the textPromptTemplate string for the external source wrapper + object. + """ + guardrail_configuration: GuardrailConfiguration | None = ... + """The configuration details for the guardrail.""" + inference_config: InferenceConfig | None = ... + """ + Configuration settings for inference when using RetrieveAndGenerate to + generate responses while using an external source. + """ + additional_model_request_fields: dict[str, Document] | None = ... + """ + Additional model parameters and their corresponding values not included + in the textInferenceConfig structure for an external source. Takes in + custom model parameters specific to the language model being used. + """ + performance_config: PerformanceConfiguration | None = ... + """The latency configuration for the model.""" + +@dataclass(kw_only=True) +class ExternalSourcesRetrieveAndGenerateConfiguration(_SerdeShape): + """ + The configurations of the external source wrapper object in the + `retrieveAndGenerate` function. + """ + + model_arn: str + """ + The model Amazon Resource Name (ARN) for the external source wrapper + object in the `retrieveAndGenerate` function. + """ + sources: list[ExternalSource] + """ + The document for the external source wrapper object in the + `retrieveAndGenerate` function. + """ + generation_configuration: ExternalSourcesGenerationConfiguration | None = ... + """ + The prompt used with the external source wrapper object with the + `retrieveAndGenerate` function. + """ + +class ExternalSourceType(UnknownEnumMixin, StrEnum): + S3 = "S3" + BYTE_CONTENT = "BYTE_CONTENT" + +@dataclass(kw_only=True) +class FailureTrace(_SerdeShape): + """Contains information about the failure of the interaction.""" + + trace_id: str | None = ... + """The unique identifier of the trace.""" + failure_reason: str | None = ... + """The reason the interaction failed.""" + failure_code: int | None = ... + """The failure code for the trace.""" + metadata: Metadata | None = ... + """Information about the failure that occurred.""" + +@dataclass(kw_only=True) +class FieldForReranking(_SerdeShape): + """ + Contains information for a metadata field to include in or exclude from + consideration when reranking. + """ + + field_name: str + """ + The name of a metadata field to include in or exclude from consideration + when reranking. + """ + +@dataclass(kw_only=True) +class FilePart(_SerdeShape): + """ + Contains intermediate response for code interpreter if any files have + been generated. + """ + + files: list[OutputFile] | None = ... + """Files containing intermediate response for the user.""" + +@dataclass(kw_only=True) +class FileSource(_SerdeShape): + """The source file of the content contained in the wrapper object.""" + + source_type: str + """The source type of the files to attach.""" + s3_location: S3ObjectFile | None = ... + """The s3 location of the files to attach.""" + byte_content: ByteContentFile | None = ... + """The data and the text of the attached files.""" + +class FileSourceType(UnknownEnumMixin, StrEnum): + S3 = "S3" + BYTE_CONTENT = "BYTE_CONTENT" + +class FileUseCase(UnknownEnumMixin, StrEnum): + CODE_INTERPRETER = "CODE_INTERPRETER" + CHAT = "CHAT" + +@dataclass(kw_only=True) +class FilterAttribute(_SerdeShape): + """ + Specifies the name that the metadata attribute must match and the value + to which to compare the value of the metadata attribute. For more + information, see [Query + configurations](https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html). + + This data type is used in the following API operations: + + - [RetrieveAndGenerate + request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_RequestSyntax) + """ + + key: str + """The name that the metadata attribute must match.""" + value: Document + """The value to which to compare the value of the metadata attribute.""" + +@dataclass(kw_only=True) +class FinalResponse(_SerdeShape): + """Contains details about the response to the user.""" + + text: str | None = ... + """The text in the response to the user.""" + metadata: Metadata | None = ... + """Contains information about the invoke agent operation.""" + +@dataclass(kw_only=True) +class FlowCompletionEvent(_SerdeShape): + """Contains information about why a flow completed.""" + + completion_reason: str + """The reason that the flow completed.""" + +class FlowCompletionReason(UnknownEnumMixin, StrEnum): + SUCCESS = "SUCCESS" + INPUT_REQUIRED = "INPUT_REQUIRED" + +class FlowControlNodeType(UnknownEnumMixin, StrEnum): + ITERATOR = "Iterator" + LOOP = "Loop" + +class FlowErrorCode(UnknownEnumMixin, StrEnum): + VALIDATION = "VALIDATION" + INTERNAL_SERVER = "INTERNAL_SERVER" + NODE_EXECUTION_FAILED = "NODE_EXECUTION_FAILED" + +@dataclass +class FlowExecutionContentDocument(_SerdeShape): + """ + The document content of the field, which can contain text or structured + data. + """ + + value: Document + +@dataclass +class FlowExecutionContentUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +FlowExecutionContent = Union[FlowExecutionContentDocument | FlowExecutionContentUnknown] +""" +Contains the content of an flow execution input or output field. + +Note: + Flow executions is in preview release for Amazon Bedrock and is subject + to change. +""" + +class _FlowExecutionContentDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> FlowExecutionContent: ... + +@dataclass(kw_only=True) +class FlowExecutionError(_SerdeShape): + """ + Contains information about an error that occurred during an flow + execution. + + Note: + Flow executions is in preview release for Amazon Bedrock and is subject + to change. + """ + + node_name: str | None = ... + """ + The name of the node in the flow where the error occurred (if + applicable). + """ + error: str | None = ... + """The error code for the type of error that occurred.""" + message: str | None = ... + """A descriptive message that provides details about the error.""" + +class FlowExecutionErrorType(UnknownEnumMixin, StrEnum): + TIMED_OUT = "ExecutionTimedOut" + +@dataclass +class FlowExecutionEventFlowInputEvent(_SerdeShape): + """ + Contains information about the inputs provided to the flow at the start + of execution. + """ + + value: FlowExecutionInputEvent + +@dataclass +class FlowExecutionEventFlowOutputEvent(_SerdeShape): + """ + Contains information about the outputs produced by the flow at the end + of execution. + """ + + value: FlowExecutionOutputEvent + +@dataclass +class FlowExecutionEventNodeInputEvent(_SerdeShape): + """ + Contains information about the inputs provided to a specific node during + execution. + """ + + value: NodeInputEvent + +@dataclass +class FlowExecutionEventNodeOutputEvent(_SerdeShape): + """ + Contains information about the outputs produced by a specific node + during execution. + """ + + value: NodeOutputEvent + +@dataclass +class FlowExecutionEventConditionResultEvent(_SerdeShape): + """ + Contains information about a condition evaluation result during the flow + execution. This event is generated when a condition node in the flow + evaluates its conditions. + """ + + value: ConditionResultEvent + +@dataclass +class FlowExecutionEventNodeFailureEvent(_SerdeShape): + """ + Contains information about a failure that occurred at a specific node + during execution. + """ + + value: NodeFailureEvent + +@dataclass +class FlowExecutionEventFlowFailureEvent(_SerdeShape): + """ + Contains information about a failure that occurred at the flow level + during execution. + """ + + value: FlowFailureEvent + +@dataclass +class FlowExecutionEventNodeActionEvent(_SerdeShape): + """ + Contains information about an action (operation) called by a node during + execution. + """ + + value: NodeActionEvent + +@dataclass +class FlowExecutionEventNodeDependencyEvent(_SerdeShape): + """ + Contains information about an internal trace of a specific node during + execution. + """ + + value: NodeDependencyEvent + +@dataclass +class FlowExecutionEventUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +FlowExecutionEvent = Union[ + FlowExecutionEventFlowInputEvent + | FlowExecutionEventFlowOutputEvent + | FlowExecutionEventNodeInputEvent + | FlowExecutionEventNodeOutputEvent + | FlowExecutionEventConditionResultEvent + | FlowExecutionEventNodeFailureEvent + | FlowExecutionEventFlowFailureEvent + | FlowExecutionEventNodeActionEvent + | FlowExecutionEventNodeDependencyEvent + | FlowExecutionEventUnknown +] +""" +Represents an event that occurred during an flow execution. This is a +union type that can contain one of several event types, such as node +input and output events; flow input and output events; condition node +result events, or failure events. + +Note: + Flow executions is in preview release for Amazon Bedrock and is subject + to change. +""" + +class _FlowExecutionEventDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> FlowExecutionEvent: ... + +class FlowExecutionEventType(UnknownEnumMixin, StrEnum): + NODE = "Node" + FLOW = "Flow" + +@dataclass(kw_only=True) +class FlowExecutionInputEvent(_SerdeShape): + """ + Contains information about the inputs provided to the flow at the start + of a flow execution. + + Note: + Flow executions is in preview release for Amazon Bedrock and is subject + to change. + """ + + node_name: str + """The name of the node that receives the inputs.""" + timestamp: datetime + """The timestamp when the inputs are provided.""" + fields: list[FlowInputField] + """A list of input fields provided to the flow.""" + +@dataclass(kw_only=True) +class FlowExecutionOutputEvent(_SerdeShape): + """ + Contains information about the outputs produced by the flow during a + flow execution. + + Note: + Flow executions is in preview release for Amazon Bedrock and is subject + to change. + """ + + node_name: str + """The name of the node that produces the outputs.""" + timestamp: datetime + """The timestamp when the outputs are produced.""" + fields: list[FlowOutputField] + """A list of output fields produced by the flow.""" + +class FlowExecutionStatus(UnknownEnumMixin, StrEnum): + RUNNING = "Running" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + TIMED_OUT = "TimedOut" + ABORTED = "Aborted" + +@dataclass(kw_only=True) +class FlowExecutionSummary(_SerdeShape): + """ + Contains summary information about a flow execution, including its + status, timestamps, and identifiers. + + Note: + Flow executions is in preview release for Amazon Bedrock and is subject + to change. + """ + + execution_arn: str + """ + The Amazon Resource Name (ARN) that uniquely identifies the flow + execution. + """ + flow_alias_identifier: str + """The unique identifier of the flow alias used for the execution.""" + flow_identifier: str + """The unique identifier of the flow.""" + flow_version: str + """The version of the flow used for the execution.""" + status: str + """ + The current status of the flow execution. + + Flow executions time out after 24 hours. + """ + created_at: datetime + """The timestamp when the flow execution was created.""" + ended_at: datetime | None = ... + """ + The timestamp when the flow execution ended. This field is only + populated when the execution has completed, failed, timed out, or been + aborted. + """ + +@dataclass(kw_only=True) +class FlowFailureEvent(_SerdeShape): + """ + Contains information about a failure that occurred at the flow level + during a flow execution. + + Note: + Flow executions is in preview release for Amazon Bedrock and is subject + to change. + """ + + timestamp: datetime + """The timestamp when the failure occurred.""" + error_code: str + """The error code that identifies the type of failure that occurred.""" + error_message: str + """A descriptive message that provides details about the failure.""" + +@dataclass(kw_only=True) +class FlowInput(_SerdeShape): + """ + Contains information about an input into the prompt flow and where to + send it. + """ + + node_name: str + """The name of the flow input node that begins the prompt flow.""" + node_output_name: str | None = ... + """ + The name of the output from the flow input node that begins the prompt + flow. + """ + content: FlowInputContent + """Contains information about an input into the prompt flow.""" + node_input_name: str | None = ... + """The name of the input from the flow input node.""" + +@dataclass +class FlowInputContentDocument(_SerdeShape): + """The input to send to the prompt flow input node.""" + + value: Document + +@dataclass +class FlowInputContentUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +FlowInputContent = Union[FlowInputContentDocument | FlowInputContentUnknown] +"""Contains information about an input into the flow.""" + +class _FlowInputContentDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> FlowInputContent: ... + +@dataclass(kw_only=True) +class FlowInputField(_SerdeShape): + """ + Represents an input field provided to a flow during a flow execution. + + Note: + Flow executions is in preview release for Amazon Bedrock and is subject + to change. + """ + + name: str + """The name of the input field as defined in the flow's input schema.""" + content: FlowExecutionContent + """ + The content of the input field, which can contain text or structured + data. + """ + +@dataclass +class FlowMultiTurnInputContentDocument(_SerdeShape): + """The requested additional input to send back to the multi-turn flow node.""" + + value: Document + +@dataclass +class FlowMultiTurnInputContentUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +FlowMultiTurnInputContent = Union[ + FlowMultiTurnInputContentDocument | FlowMultiTurnInputContentUnknown +] +""" +The content structure containing input information for multi-turn flow +interactions. +""" + +class _FlowMultiTurnInputContentDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> FlowMultiTurnInputContent: ... + +@dataclass(kw_only=True) +class FlowMultiTurnInputRequestEvent(_SerdeShape): + """ + Response object from the flow multi-turn node requesting additional + information. + """ + + node_name: str + """The name of the node in the flow that is requesting the input.""" + node_type: str + """The type of the node in the flow that is requesting the input.""" + content: FlowMultiTurnInputContent + """ + The content payload containing the input request details for the + multi-turn interaction. + """ + +class FlowNodeInputCategory(UnknownEnumMixin, StrEnum): + LOOP_CONDITION = "LoopCondition" + RETURN_VALUE_TO_LOOP_START = "ReturnValueToLoopStart" + EXIT_LOOP = "ExitLoop" + +class FlowNodeIODataType(UnknownEnumMixin, StrEnum): + STRING = "String" + NUMBER = "Number" + BOOLEAN = "Boolean" + OBJECT = "Object" + ARRAY = "Array" + +@dataclass +class FlowOutputContentDocument(_SerdeShape): + """The content in the output.""" + + value: Document + +@dataclass +class FlowOutputContentUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +FlowOutputContent = Union[FlowOutputContentDocument | FlowOutputContentUnknown] +""" +Contains information about the content in an output from prompt flow +invocation. +""" + +class _FlowOutputContentDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> FlowOutputContent: ... + +@dataclass(kw_only=True) +class FlowOutputEvent(_SerdeShape): + """Contains information about an output from prompt flow invoction.""" + + node_name: str + """The name of the flow output node that the output is from.""" + node_type: str + """The type of the node that the output is from.""" + content: FlowOutputContent + """The content in the output.""" + +@dataclass(kw_only=True) +class FlowOutputField(_SerdeShape): + """ + Represents an output field produced by a flow during a flow execution. + + Note: + Flow executions is in preview release for Amazon Bedrock and is subject + to change. + """ + + name: str + """The name of the output field as defined in the flow's output schema.""" + content: FlowExecutionContent + """ + The content of the output field, which can contain text or structured + data. + """ + +@dataclass +class FlowResponseStreamFlowOutputEvent(_SerdeShape): + """Contains information about an output from flow invocation.""" + + value: FlowOutputEvent + +@dataclass +class FlowResponseStreamFlowCompletionEvent(_SerdeShape): + """Contains information about why the flow completed.""" + + value: FlowCompletionEvent + +@dataclass +class FlowResponseStreamFlowTraceEvent(_SerdeShape): + """ + Contains information about a trace, which tracks an input or output for + a node in the flow. + """ + + value: FlowTraceEvent + +@dataclass +class FlowResponseStreamInternalServerException(_SerdeShape): + """An internal server error occurred. Retry your request.""" + + value: InternalServerException + +@dataclass +class FlowResponseStreamValidationException(_SerdeShape): + """ + Input validation failed. Check your request parameters and retry the + request. + """ + + value: ValidationException + +@dataclass +class FlowResponseStreamResourceNotFoundException(_SerdeShape): + """ + The specified resource Amazon Resource Name (ARN) was not found. Check + the Amazon Resource Name (ARN) and try your request again. + """ + + value: ResourceNotFoundException + +@dataclass +class FlowResponseStreamServiceQuotaExceededException(_SerdeShape): + """ + The number of requests exceeds the service quota. Resubmit your request + later. + """ + + value: ServiceQuotaExceededException + +@dataclass +class FlowResponseStreamThrottlingException(_SerdeShape): + """The number of requests exceeds the limit. Resubmit your request later.""" + + value: ThrottlingException + +@dataclass +class FlowResponseStreamAccessDeniedException(_SerdeShape): + """ + The request is denied because of missing access permissions. Check your + permissions and retry your request. + """ + + value: AccessDeniedException + +@dataclass +class FlowResponseStreamConflictException(_SerdeShape): + """ + There was a conflict performing an operation. Resolve the conflict and + retry your request. + """ + + value: ConflictException + +@dataclass +class FlowResponseStreamDependencyFailedException(_SerdeShape): + """ + There was an issue with a dependency. Check the resource configurations + and retry the request. + """ + + value: DependencyFailedException + +@dataclass +class FlowResponseStreamBadGatewayException(_SerdeShape): + """ + There was an issue with a dependency due to a server issue. Retry your + request. + """ + + value: BadGatewayException + +@dataclass +class FlowResponseStreamFlowMultiTurnInputRequestEvent(_SerdeShape): + """ + The event stream containing the multi-turn input request information + from the flow. + """ + + value: FlowMultiTurnInputRequestEvent + +@dataclass +class FlowResponseStreamUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +FlowResponseStream = Union[ + FlowResponseStreamFlowOutputEvent + | FlowResponseStreamFlowCompletionEvent + | FlowResponseStreamFlowTraceEvent + | FlowResponseStreamInternalServerException + | FlowResponseStreamValidationException + | FlowResponseStreamResourceNotFoundException + | FlowResponseStreamServiceQuotaExceededException + | FlowResponseStreamThrottlingException + | FlowResponseStreamAccessDeniedException + | FlowResponseStreamConflictException + | FlowResponseStreamDependencyFailedException + | FlowResponseStreamBadGatewayException + | FlowResponseStreamFlowMultiTurnInputRequestEvent + | FlowResponseStreamUnknown +] +"""The output of the flow.""" + +class _FlowResponseStreamDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> FlowResponseStream: ... + +@dataclass +class FlowTraceNodeInputTrace(_SerdeShape): + """Contains information about the input into a node.""" + + value: FlowTraceNodeInputEvent + +@dataclass +class FlowTraceNodeOutputTrace(_SerdeShape): + """Contains information about the output from a node.""" + + value: FlowTraceNodeOutputEvent + +@dataclass +class FlowTraceConditionNodeResultTrace(_SerdeShape): + """Contains information about an output from a condition node.""" + + value: FlowTraceConditionNodeResultEvent + +@dataclass +class FlowTraceNodeActionTrace(_SerdeShape): + """Contains information about an action (operation) called by a node.""" + + value: FlowTraceNodeActionEvent + +@dataclass +class FlowTraceNodeDependencyTrace(_SerdeShape): + """Contains information about an internal trace of a node.""" + + value: FlowTraceDependencyEvent + +@dataclass +class FlowTraceUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +FlowTrace = Union[ + FlowTraceNodeInputTrace + | FlowTraceNodeOutputTrace + | FlowTraceConditionNodeResultTrace + | FlowTraceNodeActionTrace + | FlowTraceNodeDependencyTrace + | FlowTraceUnknown +] +""" +Contains information about an input or output for a node in the flow. +For more information, see [Track each step in your prompt flow by +viewing its trace in Amazon +Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-trace.html). +""" + +class _FlowTraceDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> FlowTrace: ... + +@dataclass(kw_only=True) +class FlowTraceCondition(_SerdeShape): + """ + Contains information about a condition that was satisfied. For more + information, see [Track each step in your prompt flow by viewing its + trace in Amazon + Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-trace.html). + """ + + condition_name: str + """The name of the condition.""" + +@dataclass(kw_only=True) +class FlowTraceConditionNodeResultEvent(_SerdeShape): + """ + Contains information about an output from a condition node. For more + information, see [Track each step in your prompt flow by viewing its + trace in Amazon + Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-trace.html). + """ + + node_name: str + """The name of the condition node.""" + timestamp: datetime + """The date and time that the trace was returned.""" + satisfied_conditions: list[FlowTraceCondition] + """ + An array of objects containing information about the conditions that + were satisfied. + """ + +@dataclass(kw_only=True) +class FlowTraceDependencyEvent(_SerdeShape): + """Contains information about a dependency trace event in the flow.""" + + node_name: str + """The name of the node that generated the dependency trace.""" + timestamp: datetime + """The date and time that the dependency trace was generated.""" + trace_elements: TraceElements + """The trace elements containing detailed information about the dependency.""" + +@dataclass(kw_only=True) +class FlowTraceEvent(_SerdeShape): + """ + Contains information about a trace, which tracks an input or output for + a node in the flow. For more information, see [Track each step in your + prompt flow by viewing its trace in Amazon + Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-trace.html). + """ + + trace: FlowTrace + """ + The trace object containing information about an input or output for a + node in the flow. + """ + +@dataclass(kw_only=True) +class FlowTraceNodeActionEvent(_SerdeShape): + """ + Contains information about an action (operation) called by a node in an + Amazon Bedrock flow. The service generates action events for calls made + by prompt nodes, agent nodes, and Amazon Web Services Lambda nodes. + """ + + node_name: str + """The name of the node that called the operation.""" + timestamp: datetime + """The date and time that the operation was called.""" + request_id: str + """The ID of the request that the node made to the operation.""" + service_name: str + """The name of the service that the node called.""" + operation_name: str + """The name of the operation that the node called.""" + operation_request: Document | None = ... + """The request payload sent to the downstream service.""" + operation_response: Document | None = ... + """The response payload received from the downstream service.""" + +@dataclass +class FlowTraceNodeInputContentDocument(_SerdeShape): + """The content of the node input.""" + + value: Document + +@dataclass +class FlowTraceNodeInputContentUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +FlowTraceNodeInputContent = Union[ + FlowTraceNodeInputContentDocument | FlowTraceNodeInputContentUnknown +] +""" +Contains the content of the node input. For more information, see [Track +each step in your prompt flow by viewing its trace in Amazon +Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-trace.html). +""" + +class _FlowTraceNodeInputContentDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> FlowTraceNodeInputContent: ... + +@dataclass(kw_only=True) +class FlowTraceNodeInputEvent(_SerdeShape): + """ + Contains information about the input into a node. For more information, + see [Track each step in your prompt flow by viewing its trace in Amazon + Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-trace.html). + """ + + node_name: str + """The name of the node that received the input.""" + timestamp: datetime + """The date and time that the trace was returned.""" + fields: list[FlowTraceNodeInputField] + """ + An array of objects containing information about each field in the + input. + """ + +@dataclass(kw_only=True) +class FlowTraceNodeInputExecutionChainItem(_SerdeShape): + """ + Represents an item in the execution chain for flow trace node input + tracking. + """ + + node_name: str + """The name of the node in the execution chain.""" + index: int | None = ... + """The index position of this item in the execution chain.""" + type: str + """ + The type of execution chain item. Supported values are Iterator and + Loop. + """ + +@dataclass(kw_only=True) +class FlowTraceNodeInputField(_SerdeShape): + """ + Contains information about a field in the input into a node. For more + information, see [Track each step in your prompt flow by viewing its + trace in Amazon + Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-trace.html). + """ + + node_input_name: str + """The name of the node input.""" + content: FlowTraceNodeInputContent + """The content of the node input.""" + source: FlowTraceNodeInputSource | None = ... + """The source node that provides input data to this field.""" + type: str | None = ... + """The data type of the input field for compatibility validation.""" + category: str | None = ... + """The category of the input field.""" + execution_chain: list[FlowTraceNodeInputExecutionChainItem] | None = ... + """The execution path through nested nodes like iterators and loops.""" + +@dataclass(kw_only=True) +class FlowTraceNodeInputSource(_SerdeShape): + """Represents the source of input data for a flow trace node field.""" + + node_name: str + """The name of the source node that provides the input data.""" + output_field_name: str + """The name of the output field from the source node.""" + expression: str + """The expression used to extract data from the source.""" + +@dataclass +class FlowTraceNodeOutputContentDocument(_SerdeShape): + """The content of the node output.""" + + value: Document + +@dataclass +class FlowTraceNodeOutputContentUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +FlowTraceNodeOutputContent = Union[ + FlowTraceNodeOutputContentDocument | FlowTraceNodeOutputContentUnknown +] +""" +Contains the content of the node output. For more information, see +[Track each step in your prompt flow by viewing its trace in Amazon +Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-trace.html). +""" + +class _FlowTraceNodeOutputContentDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> FlowTraceNodeOutputContent: ... + +@dataclass(kw_only=True) +class FlowTraceNodeOutputEvent(_SerdeShape): + """ + Contains information about the output from a node. For more information, + see [Track each step in your prompt flow by viewing its trace in Amazon + Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-trace.html). + """ + + node_name: str + """The name of the node that yielded the output.""" + timestamp: datetime + """The date and time that the trace was returned.""" + fields: list[FlowTraceNodeOutputField] + """ + An array of objects containing information about each field in the + output. + """ + +@dataclass(kw_only=True) +class FlowTraceNodeOutputField(_SerdeShape): + """ + Contains information about a field in the output from a node. For more + information, see [Track each step in your prompt flow by viewing its + trace in Amazon + Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-trace.html). + """ + + node_output_name: str + """The name of the node output.""" + content: FlowTraceNodeOutputContent + """The content of the node output.""" + next: list[FlowTraceNodeOutputNext] | None = ... + """The next node that receives output data from this field.""" + type: str | None = ... + """The data type of the output field for compatibility validation.""" + +@dataclass(kw_only=True) +class FlowTraceNodeOutputNext(_SerdeShape): + """Represents the next node that receives output data from a flow trace.""" + + node_name: str + """The name of the next node that receives the output data.""" + input_field_name: str + """The name of the input field in the next node that receives the data.""" + +@dataclass(kw_only=True) +class FoundationModelConfiguration(_SerdeShape): + """Configuration for the foundation model.""" + + type: str + """The type of foundation model configuration.""" + bedrock_foundation_model_configuration: ( + BedrockFoundationModelConfiguration | None + ) = ... + """The Bedrock foundation model configuration.""" + mantle_foundation_model_configuration: ( + MantleFoundationModelConfiguration | None + ) = ... + """The Mantle foundation model configuration.""" + +class FoundationModelConfigurationType(UnknownEnumMixin, StrEnum): + """The type of foundation model configuration.""" + + BEDROCK_FOUNDATION_MODEL = "BEDROCK_FOUNDATION_MODEL" + MANTLE_FOUNDATION_MODEL = "MANTLE_FOUNDATION_MODEL" + +class FoundationModelType(UnknownEnumMixin, StrEnum): + """The type of foundation model.""" + + CUSTOM = "CUSTOM" + MANAGED = "MANAGED" + +@dataclass(kw_only=True) +class FunctionDefinition(_SerdeShape): + """ + Defines parameters that the agent needs to invoke from the user to + complete the function. Corresponds to an action in an action group. + """ + + name: str + """A name for the function.""" + description: str | None = ... + """A description of the function and its purpose.""" + parameters: dict[str, ParameterDetail] | None = ... + """ + The parameters that the agent elicits from the user to fulfill the + function. + """ + require_confirmation: str | None = ... + """ + Contains information if user confirmation is required to invoke the + function. + """ + +@dataclass(kw_only=True) +class FunctionInvocationInput(_SerdeShape): + """ + Contains information about the function that the agent predicts should + be called. + + This data type is used in the following API operations: + + - In the `returnControl` field of the [InvokeAgent + response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax) + """ + + action_group: str + """The action group that the function belongs to.""" + parameters: list[FunctionParameter] | None = ... + """A list of parameters of the function.""" + function: str | None = ... + """The name of the function.""" + action_invocation_type: str | None = ... + """Contains information about the function to invoke,""" + agent_id: str | None = ... + """The agent's ID.""" + collaborator_name: str | None = ... + """The collaborator's name.""" + +@dataclass(kw_only=True) +class FunctionParameter(_SerdeShape): + """ + Contains information about a parameter of the function. + + This data type is used in the following API operations: + + - In the `returnControl` field of the [InvokeAgent + response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax) + """ + + name: str | None = ... + """The name of the parameter.""" + type: str | None = ... + """The data type of the parameter.""" + value: str | None = ... + """The value of the parameter.""" + +@dataclass(kw_only=True) +class FunctionResult(_SerdeShape): + """ + Contains information about the function that was called from the action + group and the response that was returned. + + This data type is used in the following API operations: + + - In the `returnControlInvocationResults` of the [InvokeAgent + request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_RequestSyntax) + """ + + action_group: str + """The action group that the function belongs to.""" + confirmation_state: str | None = ... + """ + Contains the user confirmation information about the function that was + called. + """ + function: str | None = ... + """The name of the function that was called.""" + response_body: dict[str, ContentBody] | None = ... + """ + The response from the function call using the parameters. The response + might be returned directly or from the Lambda function. Specify `TEXT` + or `IMAGES`. The key of the object is the content type. You can only + specify one type. If you specify `IMAGES`, you can specify only one + image. You can specify images only when the function in the + `returnControlInvocationResults` is a computer use action. For more + information, see [Configure an Amazon Bedrock Agent to complete tasks + with computer use + tools](https://docs.aws.amazon.com/bedrock/latest/userguide/agent-computer-use.html). + """ + response_state: str | None = ... + """ + Controls the final response state returned to end user when API/Function + execution failed. When this state is FAILURE, the request would fail + with dependency failure exception. When this state is REPROMPT, the + API/function response will be sent to model for re-prompt + """ + agent_id: str | None = ... + """The agent's ID.""" + +@dataclass +class FunctionSchemaFunctions(_SerdeShape): + """A list of functions that each define an action in the action group.""" + + value: list[FunctionDefinition] + +@dataclass +class FunctionSchemaUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +FunctionSchema = Union[FunctionSchemaFunctions | FunctionSchemaUnknown] +""" +Contains details about the function schema for the action group or the +JSON or YAML-formatted payload defining the schema. +""" + +class _FunctionSchemaDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> FunctionSchema: ... + +@dataclass(kw_only=True) +class GeneratedQuery(_SerdeShape): + """ + Contains information about a query generated for a natural language + query. + """ + + type: str | None = ... + """The type of transformed query.""" + sql: str | None = ... + """An SQL query that corresponds to the natural language query.""" + +class GeneratedQueryType(UnknownEnumMixin, StrEnum): + REDSHIFT_SQL = "REDSHIFT_SQL" + +@dataclass(kw_only=True) +class GeneratedResponsePart(_SerdeShape): + """ + Contains metadata about a part of the generated response that is + accompanied by a citation. + + This data type is used in the following API operations: + + - [InvokeAgent + response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax) + -- in the `generatedResponsePart` field + + - [RetrieveAndGenerate + response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax) + -- in the `generatedResponsePart` field + """ + + text_response_part: TextResponsePart | None = ... + """ + Contains metadata about a textual part of the generated response that is + accompanied by a citation. + """ + +@dataclass(kw_only=True) +class GenerateQueryInput(_SerdeShape): + """Dataclass for GenerateQueryInput structure.""" + + query_generation_input: QueryGenerationInput | None = ... + """ + Specifies information about a natural language query to transform into + SQL. + """ + transformation_configuration: TransformationConfiguration | None = ... + """ + Specifies configurations for transforming the natural language query + into SQL. + """ + +@dataclass(kw_only=True) +class GenerateQueryOutput(_SerdeShape): + """Dataclass for GenerateQueryOutput structure.""" + + queries: list[GeneratedQuery] | None = ... + """ + A list of objects, each of which defines a generated query that can + correspond to the natural language queries. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GenerationConfiguration(_SerdeShape): + """ + Contains configurations for response generation based on the knowledge + base query results. + + This data type is used in the following API operations: + + - [RetrieveAndGenerate + request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_RequestSyntax) + """ + + prompt_template: PromptTemplate | None = ... + """ + Contains the template for the prompt that's sent to the model for + response generation. Generation prompts must include the + `$search_results$` variable. For more information, see [Use placeholder + variables](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-placeholders.html) + in the user guide. + """ + guardrail_configuration: GuardrailConfiguration | None = ... + """The configuration details for the guardrail.""" + inference_config: InferenceConfig | None = ... + """ + Configuration settings for inference when using RetrieveAndGenerate to + generate responses while using a knowledge base as a source. + """ + additional_model_request_fields: dict[str, Document] | None = ... + """ + Additional model parameters and corresponding values not included in the + textInferenceConfig structure for a knowledge base. This allows users to + provide custom model parameters specific to the language model being + used. + """ + performance_config: PerformanceConfiguration | None = ... + """The latency configuration for the model.""" + +@dataclass(kw_only=True) +class GetAgentMemoryInput(_SerdeShape): + """Dataclass for GetAgentMemoryInput structure.""" + + next_token: str | None = ... + """ + If the total number of results is greater than the maxItems value + provided in the request, enter the token returned in the `nextToken` + field in the response in this field to return the next batch of results. + """ + max_items: int | None = ... + """ + The maximum number of items to return in the response. If the total + number of results is greater than this value, use the token returned in + the response in the `nextToken` field when making another request to + return the next batch of results. + """ + agent_id: str | None = ... + """The unique identifier of the agent to which the alias belongs.""" + agent_alias_id: str | None = ... + """The unique identifier of an alias of an agent.""" + memory_type: str | None = ... + """The type of memory.""" + memory_id: str | None = ... + """The unique identifier of the memory.""" + +@dataclass(kw_only=True) +class GetAgentMemoryOutput(_SerdeShape): + """Dataclass for GetAgentMemoryOutput structure.""" + + next_token: str | None = ... + """ + If the total number of results is greater than the maxItems value + provided in the request, use this token when making another request in + the `nextToken` field to return the next batch of results. + """ + memory_contents: list[Memory] | None = ... + """Contains details of the sessions stored in the memory""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetDocumentContentInput(_SerdeShape): + """Dataclass for GetDocumentContentInput structure.""" + + knowledge_base_id: str | None = ... + """The unique identifier of the knowledge base that contains the document.""" + data_source_id: str | None = ... + """The unique identifier of the data source that contains the document.""" + document_id: str | None = ... + """The unique identifier of the document to retrieve content for.""" + output_format: str | None = ... + """ + The output format for the document content. `RAW` returns the original + file. `EXTRACTED` returns parsed text as JSON. Defaults to `RAW`. + """ + user_context: UserContext | None = ... + """ + Contains information about the user making the request. This is used for + access control filtering to ensure that results only include documents + the user is authorized to access. + """ + +@dataclass(kw_only=True) +class GetDocumentContentOutput(_SerdeShape): + """Dataclass for GetDocumentContentOutput structure.""" + + mime_type: str + """ + The MIME type of the document content. For `RAW` format, this is the + original file type (for example, `application/pdf`). For `EXTRACTED` + format, this is always `application/json`. + """ + presigned_url: str + """ + A pre-signed URL for downloading the document content. The URL expires + after 5 minutes. + """ + document_content_length: int | None = ... + """ + The size of the document content in bytes available at the pre-signed + URL. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetExecutionFlowSnapshotInput(_SerdeShape): + """Dataclass for GetExecutionFlowSnapshotInput structure.""" + + flow_identifier: str | None = ... + """The unique identifier of the flow.""" + flow_alias_identifier: str | None = ... + """The unique identifier of the flow alias used for the flow execution.""" + execution_identifier: str | None = ... + """The unique identifier of the flow execution.""" + +@dataclass(kw_only=True) +class GetExecutionFlowSnapshotOutput(_SerdeShape): + """Dataclass for GetExecutionFlowSnapshotOutput structure.""" + + flow_identifier: str + """The unique identifier of the flow.""" + flow_alias_identifier: str + """The unique identifier of the flow alias used for the flow execution.""" + flow_version: str + """The version of the flow used for the flow execution.""" + execution_role_arn: str + """ + The Amazon Resource Name (ARN) of the IAM service role that's used by + the flow execution. + """ + definition: str + """ + The flow definition used for the flow execution, including the nodes, + connections, and configuration at the time when the execution started. + + The definition returns as a string that follows the structure of a + [FlowDefinition](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_FlowDefinition.html) + object. + """ + customer_encryption_key_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the customer managed KMS key that's + used to encrypt the flow snapshot. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetFlowExecutionInput(_SerdeShape): + """Dataclass for GetFlowExecutionInput structure.""" + + flow_identifier: str | None = ... + """The unique identifier of the flow.""" + flow_alias_identifier: str | None = ... + """The unique identifier of the flow alias used for the execution.""" + execution_identifier: str | None = ... + """The unique identifier of the flow execution to retrieve.""" + +@dataclass(kw_only=True) +class GetFlowExecutionOutput(_SerdeShape): + """Dataclass for GetFlowExecutionOutput structure.""" + + execution_arn: str + """ + The Amazon Resource Name (ARN) that uniquely identifies the flow + execution. + """ + status: str + """ + The current status of the flow execution. + + Flow executions time out after 24 hours. + """ + started_at: datetime + """The timestamp when the flow execution started.""" + ended_at: datetime | None = ... + """ + The timestamp when the flow execution ended. This field is only + populated when the execution has completed, failed, timed out, or been + aborted. + """ + errors: list[FlowExecutionError] | None = ... + """ + A list of errors that occurred during the flow execution. Each error + includes an error code, message, and the node where the error occurred, + if applicable. + """ + flow_alias_identifier: str + """The unique identifier of the flow alias used for the execution.""" + flow_identifier: str + """The unique identifier of the flow.""" + flow_version: str + """The version of the flow used for the execution.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetIngestedDocumentAclInput(_SerdeShape): + """Dataclass for GetIngestedDocumentAclInput structure.""" + + knowledge_base_id: str | None = ... + """The unique identifier of the knowledge base that contains the document.""" + data_source_id: str | None = ... + """The unique identifier of the data source that contains the document.""" + document_id: str | None = ... + """ + The unique identifier of the document to retrieve the ingested access + control list (ACL) for. + """ + +@dataclass(kw_only=True) +class GetIngestedDocumentAclOutput(_SerdeShape): + """Dataclass for GetIngestedDocumentAclOutput structure.""" + + document_acl: DocumentAcl + """ + The ingested document access control list (ACL) containing allow and + deny membership information. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetInvocationStepInput(_SerdeShape): + """Dataclass for GetInvocationStepInput structure.""" + + invocation_identifier: str | None = ... + """The unique identifier for the invocation in UUID format.""" + invocation_step_id: str | None = ... + """ + The unique identifier (in UUID format) for the specific invocation step + to retrieve. + """ + session_identifier: str | None = ... + """ + The unique identifier for the invocation step's associated session. You + can specify either the session's `sessionId` or its Amazon Resource + Name (ARN). + """ + +@dataclass(kw_only=True) +class GetInvocationStepOutput(_SerdeShape): + """Dataclass for GetInvocationStepOutput structure.""" + + invocation_step: InvocationStep + """The complete details of the requested invocation step.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetSessionInput(_SerdeShape): + """Dataclass for GetSessionInput structure.""" + + session_identifier: str | None = ... + """ + A unique identifier for the session to retrieve. You can specify either + the session's `sessionId` or its Amazon Resource Name (ARN). + """ + +@dataclass(kw_only=True) +class GetSessionOutput(_SerdeShape): + """Dataclass for GetSessionOutput structure.""" + + session_id: str + """The unique identifier for the session in UUID format.""" + session_arn: str + """The Amazon Resource Name (ARN) of the session.""" + session_status: str + """The current status of the session.""" + created_at: datetime + """The timestamp for when the session was created.""" + last_updated_at: datetime + """The timestamp for when the session was last modified.""" + session_metadata: dict[str, str] | None = ... + """ + A map of key-value pairs containing attributes persisted across the + session. + """ + encryption_key_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the Key Management Service key used to + encrypt the session data. For more information, see [Amazon Bedrock + session + encryption](https://docs.aws.amazon.com/bedrock/latest/userguide/session-encryption.html). + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class GuadrailAction(UnknownEnumMixin, StrEnum): + INTERVENED = "INTERVENED" + NONE = "NONE" + +class GuardrailAction(UnknownEnumMixin, StrEnum): + INTERVENED = "INTERVENED" + NONE = "NONE" + +@dataclass(kw_only=True) +class GuardrailAssessment(_SerdeShape): + """Assessment details of the content analyzed by Guardrails.""" + + topic_policy: GuardrailTopicPolicyAssessment | None = ... + """Topic policy details of the Guardrail.""" + content_policy: GuardrailContentPolicyAssessment | None = ... + """Content policy details of the Guardrail.""" + word_policy: GuardrailWordPolicyAssessment | None = ... + """Word policy details of the Guardrail.""" + sensitive_information_policy: ( + GuardrailSensitiveInformationPolicyAssessment | None + ) = ... + """Sensitive Information policy details of Guardrail.""" + +@dataclass(kw_only=True) +class GuardrailConfiguration(_SerdeShape): + """The configuration details for the guardrail.""" + + guardrail_id: str + """The unique identifier for the guardrail.""" + guardrail_version: str + """The version of the guardrail.""" + +@dataclass(kw_only=True) +class GuardrailConfigurationWithArn(_SerdeShape): + """The configuration details for the guardrail.""" + + guardrail_identifier: str + """The unique identifier for the guardrail.""" + guardrail_version: str + """The version of the guardrail.""" + +@dataclass(kw_only=True) +class GuardrailContentFilter(_SerdeShape): + """Details of the content filter used in the Guardrail.""" + + type: str | None = ... + """The type of content detected in the filter by the Guardrail.""" + confidence: str | None = ... + """ + The confidence level regarding the content detected in the filter by the + Guardrail. + """ + action: str | None = ... + """The action placed on the content by the Guardrail filter.""" + +class GuardrailContentFilterConfidence(UnknownEnumMixin, StrEnum): + NONE = "NONE" + LOW = "LOW" + MEDIUM = "MEDIUM" + HIGH = "HIGH" + +class GuardrailContentFilterType(UnknownEnumMixin, StrEnum): + INSULTS = "INSULTS" + HATE = "HATE" + SEXUAL = "SEXUAL" + VIOLENCE = "VIOLENCE" + MISCONDUCT = "MISCONDUCT" + PROMPT_ATTACK = "PROMPT_ATTACK" + +class GuardrailContentPolicyAction(UnknownEnumMixin, StrEnum): + BLOCKED = "BLOCKED" + +@dataclass(kw_only=True) +class GuardrailContentPolicyAssessment(_SerdeShape): + """The details of the policy assessment in the Guardrails filter.""" + + filters: list[GuardrailContentFilter] | None = ... + """ + The filter details of the policy assessment used in the Guardrails + filter. + """ + +@dataclass(kw_only=True) +class GuardrailCustomWord(_SerdeShape): + """The custom word details for the filter in the Guardrail.""" + + match: str | None = ... + """The match details for the custom word filter in the Guardrail.""" + action: str | None = ... + """The action details for the custom word filter in the Guardrail.""" + +@dataclass(kw_only=True) +class GuardrailEvent(_SerdeShape): + """A guardrail event.""" + + action: str | None = ... + """The guardrail action.""" + +@dataclass(kw_only=True) +class GuardrailManagedWord(_SerdeShape): + """The managed word details for the filter in the Guardrail.""" + + match: str | None = ... + """The match details for the managed word filter in the Guardrail.""" + type: str | None = ... + """The type details for the managed word filter in the Guardrail.""" + action: str | None = ... + """The action details for the managed word filter in the Guardrail.""" + +class GuardrailManagedWordType(UnknownEnumMixin, StrEnum): + PROFANITY = "PROFANITY" + +@dataclass(kw_only=True) +class GuardrailPiiEntityFilter(_SerdeShape): + """ + The Guardrail filter to identify and remove personally identifiable + information (PII). + """ + + type: str | None = ... + """The type of PII the Guardrail filter has identified and removed.""" + match: str | None = ... + """ + The match to settings in the Guardrail filter to identify and remove + PII. + """ + action: str | None = ... + """The action of the Guardrail filter to identify and remove PII.""" + +class GuardrailPiiEntityType(UnknownEnumMixin, StrEnum): + ADDRESS = "ADDRESS" + AGE = "AGE" + AWS_ACCESS_KEY = "AWS_ACCESS_KEY" + AWS_SECRET_KEY = "AWS_SECRET_KEY" + CA_HEALTH_NUMBER = "CA_HEALTH_NUMBER" + CA_SOCIAL_INSURANCE_NUMBER = "CA_SOCIAL_INSURANCE_NUMBER" + CREDIT_DEBIT_CARD_CVV = "CREDIT_DEBIT_CARD_CVV" + CREDIT_DEBIT_CARD_EXPIRY = "CREDIT_DEBIT_CARD_EXPIRY" + CREDIT_DEBIT_CARD_NUMBER = "CREDIT_DEBIT_CARD_NUMBER" + DRIVER_ID = "DRIVER_ID" + EMAIL = "EMAIL" + INTERNATIONAL_BANK_ACCOUNT_NUMBER = "INTERNATIONAL_BANK_ACCOUNT_NUMBER" + IP_ADDRESS = "IP_ADDRESS" + LICENSE_PLATE = "LICENSE_PLATE" + MAC_ADDRESS = "MAC_ADDRESS" + NAME = "NAME" + PASSWORD = "PASSWORD" + PHONE = "PHONE" + PIN = "PIN" + SWIFT_CODE = "SWIFT_CODE" + UK_NATIONAL_HEALTH_SERVICE_NUMBER = "UK_NATIONAL_HEALTH_SERVICE_NUMBER" + UK_NATIONAL_INSURANCE_NUMBER = "UK_NATIONAL_INSURANCE_NUMBER" + UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER = "UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER" + URL = "URL" + USERNAME = "USERNAME" + US_BANK_ACCOUNT_NUMBER = "US_BANK_ACCOUNT_NUMBER" + US_BANK_ROUTING_NUMBER = "US_BANK_ROUTING_NUMBER" + US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER = "US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER" + US_PASSPORT_NUMBER = "US_PASSPORT_NUMBER" + US_SOCIAL_SECURITY_NUMBER = "US_SOCIAL_SECURITY_NUMBER" + VEHICLE_IDENTIFICATION_NUMBER = "VEHICLE_IDENTIFICATION_NUMBER" + +@dataclass(kw_only=True) +class GuardrailRegexFilter(_SerdeShape): + """The details for the regex filter used in the Guardrail.""" + + name: str | None = ... + """The name details for the regex filter used in the Guardrail.""" + regex: str | None = ... + """The regex details for the regex filter used in the Guardrail.""" + match: str | None = ... + """The match details for the regex filter used in the Guardrail.""" + action: str | None = ... + """The action details for the regex filter used in the Guardrail.""" + +class GuardrailSensitiveInformationPolicyAction(UnknownEnumMixin, StrEnum): + BLOCKED = "BLOCKED" + ANONYMIZED = "ANONYMIZED" + +@dataclass(kw_only=True) +class GuardrailSensitiveInformationPolicyAssessment(_SerdeShape): + """The details of the sensitive policy assessment used in the Guardrail.""" + + pii_entities: list[GuardrailPiiEntityFilter] | None = ... + """ + The details of the PII entities used in the sensitive policy assessment + for the Guardrail. + """ + regexes: list[GuardrailRegexFilter] | None = ... + """ + The details of the regexes used in the sensitive policy assessment for + the Guardrail. + """ + +@dataclass(kw_only=True) +class GuardrailTopic(_SerdeShape): + """The details for a specific topic defined in the Guardrail.""" + + name: str | None = ... + """The name details on a specific topic in the Guardrail.""" + type: str | None = ... + """The type details on a specific topic in the Guardrail.""" + action: str | None = ... + """The action details on a specific topic in the Guardrail.""" + +class GuardrailTopicPolicyAction(UnknownEnumMixin, StrEnum): + BLOCKED = "BLOCKED" + +@dataclass(kw_only=True) +class GuardrailTopicPolicyAssessment(_SerdeShape): + """The details of the policy assessment used in the Guardrail.""" + + topics: list[GuardrailTopic] | None = ... + """The topic details of the policy assessment used in the Guardrail.""" + +class GuardrailTopicType(UnknownEnumMixin, StrEnum): + DENY = "DENY" + +@dataclass(kw_only=True) +class GuardrailTrace(_SerdeShape): + """The trace details used in the Guardrail.""" + + action: str | None = ... + """The trace action details used with the Guardrail.""" + trace_id: str | None = ... + """The details of the trace Id used in the Guardrail Trace.""" + input_assessments: list[GuardrailAssessment] | None = ... + """The details of the input assessments used in the Guardrail Trace.""" + output_assessments: list[GuardrailAssessment] | None = ... + """The details of the output assessments used in the Guardrail Trace.""" + metadata: Metadata | None = ... + """Contains information about the Guardrail output.""" + +class GuardrailWordPolicyAction(UnknownEnumMixin, StrEnum): + BLOCKED = "BLOCKED" + +@dataclass(kw_only=True) +class GuardrailWordPolicyAssessment(_SerdeShape): + """The assessment details for words defined in the Guardrail filter.""" + + custom_words: list[GuardrailCustomWord] | None = ... + """The custom word details for words defined in the Guardrail filter.""" + managed_word_lists: list[GuardrailManagedWord] | None = ... + """The managed word lists for words defined in the Guardrail filter.""" + +@dataclass(kw_only=True) +class ImageBlock(_SerdeShape): + """Image content for an invocation step.""" + + format: str + """The format of the image.""" + source: ImageSource + """The source for the image.""" + +class ImageFormat(UnknownEnumMixin, StrEnum): + PNG = "png" + JPEG = "jpeg" + GIF = "gif" + WEBP = "webp" + +@dataclass(kw_only=True) +class ImageInput(_SerdeShape): + """ + Details about an image in the result from a function in the action group + invocation. You can specify images only when the function is a computer + use action. For more information, see [Configure an Amazon Bedrock Agent + to complete tasks with computer use + tools](https://docs.aws.amazon.com/bedrock/latest/userguide/agent-computer-use.html). + """ + + format: str + """The type of image in the result.""" + source: ImageInputSource + """The source of the image in the result.""" + +class ImageInputFormat(UnknownEnumMixin, StrEnum): + PNG = "png" + JPEG = "jpeg" + GIF = "gif" + WEBP = "webp" + +@dataclass +class ImageInputSourceBytes(_SerdeShape): + """ + The raw image bytes for the image. If you use an Amazon Web Services + SDK, you don't need to encode the image bytes in base64. + """ + + value: bytes + +@dataclass +class ImageInputSourceUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ImageInputSource = Union[ImageInputSourceBytes | ImageInputSourceUnknown] +""" +Details about the source of an input image in the result from a function +in the action group invocation. +""" + +class _ImageInputSourceDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> ImageInputSource: ... + +@dataclass +class ImageSourceBytes(_SerdeShape): + """ + The raw image bytes for the image. If you use an Amazon Web Services + SDK, you don't need to encode the image bytes in base64. + """ + + value: bytes + +@dataclass +class ImageSourceS3Location(_SerdeShape): + """The path to the Amazon S3 bucket where the image is stored.""" + + value: S3Location + +@dataclass +class ImageSourceUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ImageSource = Union[ImageSourceBytes | ImageSourceS3Location | ImageSourceUnknown] +"""The source for an image.""" + +class _ImageSourceDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> ImageSource: ... + +@dataclass(kw_only=True) +class ImplicitFilterConfiguration(_SerdeShape): + """ + Settings for implicit filtering, where a model generates a metadata + filter based on the prompt. + """ + + metadata_attributes: list[MetadataAttributeSchema] + """Metadata that can be used in a filter.""" + model_arn: str + """The model that generates the filter.""" + +@dataclass(kw_only=True) +class InferenceConfig(_SerdeShape): + """ + The configuration for inference settings when generating responses using + RetrieveAndGenerate. + """ + + text_inference_config: TextInferenceConfig | None = ... + """ + Configuration settings specific to text generation while generating + responses using RetrieveAndGenerate. + """ + +@dataclass(kw_only=True) +class InferenceConfiguration(_SerdeShape): + """ + Specifications about the inference parameters that were provided + alongside the prompt. These are specified in the + [PromptOverrideConfiguration](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptOverrideConfiguration.html) + object that was set when the agent was created or updated. For more + information, see [Inference parameters for foundation + models](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). + """ + + temperature: float | None = ... + """ + The likelihood of the model selecting higher-probability options while + generating a response. A lower value makes the model more likely to + choose higher-probability options, while a higher value makes the model + more likely to choose lower-probability options. + """ + top_p: float | None = ... + """ + While generating a response, the model determines the probability of the + following token at each point of generation. The value that you set for + `Top P` determines the number of most-likely candidates from which the + model chooses the next token in the sequence. For example, if you set + `topP` to 0.8, the model only selects the next token from the top 80% of + the probability distribution of next tokens. + """ + top_k: int | None = ... + """ + While generating a response, the model determines the probability of the + following token at each point of generation. The value that you set for + `topK` is the number of most-likely candidates from which the model + chooses the next token in the sequence. For example, if you set `topK` + to 50, the model selects the next token from among the top 50 most + likely choices. + """ + maximum_length: int | None = ... + """The maximum number of tokens allowed in the generated response.""" + stop_sequences: list[str] | None = ... + """ + A list of stop sequences. A stop sequence is a sequence of characters + that causes the model to stop generating the response. + """ + +@dataclass(kw_only=True) +class InlineAgentFilePart(_SerdeShape): + """ + Contains intermediate response for code interpreter if any files have + been generated. + """ + + files: list[OutputFile] | None = ... + """Files containing intermediate response for the user.""" + +@dataclass(kw_only=True) +class InlineAgentPayloadPart(_SerdeShape): + """Contains a part of an agent response and citations for it.""" + + bytes_: bytes | None = ... + """A part of the agent response in bytes.""" + attribution: Attribution | None = ... + """Contains citations for a part of an agent response.""" + +@dataclass +class InlineAgentResponseStreamChunk(_SerdeShape): + """Contains a part of an agent response and citations for it.""" + + value: InlineAgentPayloadPart + +@dataclass +class InlineAgentResponseStreamTrace(_SerdeShape): + """ + Contains information about the agent and session, alongside the agent's + reasoning process and results from calling actions and querying + knowledge bases and metadata about the trace. You can use the trace to + understand how the agent arrived at the response it provided the + customer. For more information, see [Trace + events](https://docs.aws.amazon.com/bedrock/latest/userguide/trace-events.html). + """ + + value: InlineAgentTracePart + +@dataclass +class InlineAgentResponseStreamReturnControl(_SerdeShape): + """ + Contains the parameters and information that the agent elicited from the + customer to carry out an action. This information is returned to the + system and can be used in your own setup for fulfilling the action. + """ + + value: InlineAgentReturnControlPayload + +@dataclass +class InlineAgentResponseStreamInternalServerException(_SerdeShape): + """An internal server error occurred. Retry your request.""" + + value: InternalServerException + +@dataclass +class InlineAgentResponseStreamValidationException(_SerdeShape): + """ + Input validation failed. Check your request parameters and retry the + request. + """ + + value: ValidationException + +@dataclass +class InlineAgentResponseStreamResourceNotFoundException(_SerdeShape): + """ + The specified resource Amazon Resource Name (ARN) was not found. Check + the Amazon Resource Name (ARN) and try your request again. + """ + + value: ResourceNotFoundException + +@dataclass +class InlineAgentResponseStreamServiceQuotaExceededException(_SerdeShape): + """ + The number of requests exceeds the service quota. Resubmit your request + later. + """ + + value: ServiceQuotaExceededException + +@dataclass +class InlineAgentResponseStreamThrottlingException(_SerdeShape): + """The number of requests exceeds the limit. Resubmit your request later.""" + + value: ThrottlingException + +@dataclass +class InlineAgentResponseStreamAccessDeniedException(_SerdeShape): + """ + The request is denied because of missing access permissions. Check your + permissions and retry your request. + """ + + value: AccessDeniedException + +@dataclass +class InlineAgentResponseStreamConflictException(_SerdeShape): + """ + There was a conflict performing an operation. Resolve the conflict and + retry your request. + """ + + value: ConflictException + +@dataclass +class InlineAgentResponseStreamDependencyFailedException(_SerdeShape): + """ + There was an issue with a dependency. Check the resource configurations + and retry the request. + """ + + value: DependencyFailedException + +@dataclass +class InlineAgentResponseStreamBadGatewayException(_SerdeShape): + """ + There was an issue with a dependency due to a server issue. Retry your + request. + """ + + value: BadGatewayException + +@dataclass +class InlineAgentResponseStreamFiles(_SerdeShape): + """ + Contains intermediate response for code interpreter if any files have + been generated. + """ + + value: InlineAgentFilePart + +@dataclass +class InlineAgentResponseStreamUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +InlineAgentResponseStream = Union[ + InlineAgentResponseStreamChunk + | InlineAgentResponseStreamTrace + | InlineAgentResponseStreamReturnControl + | InlineAgentResponseStreamInternalServerException + | InlineAgentResponseStreamValidationException + | InlineAgentResponseStreamResourceNotFoundException + | InlineAgentResponseStreamServiceQuotaExceededException + | InlineAgentResponseStreamThrottlingException + | InlineAgentResponseStreamAccessDeniedException + | InlineAgentResponseStreamConflictException + | InlineAgentResponseStreamDependencyFailedException + | InlineAgentResponseStreamBadGatewayException + | InlineAgentResponseStreamFiles + | InlineAgentResponseStreamUnknown +] +""" +The response from invoking the agent and associated citations and trace +information. +""" + +class _InlineAgentResponseStreamDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> InlineAgentResponseStream: ... + +@dataclass(kw_only=True) +class InlineAgentReturnControlPayload(_SerdeShape): + """ + Contains information to return from the action group that the agent has + predicted to invoke. + + This data type is used in the [InvokeAgent + response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax) + API operation. + """ + + invocation_inputs: list[InvocationInputMember] | None = ... + """ + A list of objects that contain information about the parameters and + inputs that need to be sent into the API operation or function, based on + what the agent determines from its session with the user. + """ + invocation_id: str | None = ... + """The identifier of the action group invocation.""" + +@dataclass(kw_only=True) +class InlineAgentTracePart(_SerdeShape): + """ + Contains information about the agent and session, alongside the agent's + reasoning process and results from calling API actions and querying + knowledge bases and metadata about the trace. You can use the trace to + understand how the agent arrived at the response it provided the + customer. For more information, see [Trace + enablement](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-test.html#trace-enablement). + """ + + session_id: str | None = ... + """The unique identifier of the session with the agent.""" + trace: Trace | None = ... + """ + Contains one part of the agent's reasoning process and results from + calling API actions and querying knowledge bases. You can use the trace + to understand how the agent arrived at the response it provided the + customer. For more information, see [Trace + enablement](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-test.html#trace-enablement). + """ + caller_chain: list[Caller] | None = ... + """The caller chain for the trace part.""" + event_time: datetime | None = ... + """The time that trace occurred.""" + collaborator_name: str | None = ... + """The collaborator name for the trace part.""" + +@dataclass(kw_only=True) +class InlineBedrockModelConfigurations(_SerdeShape): + """Settings for a model called with InvokeInlineAgent.""" + + performance_config: PerformanceConfiguration | None = ... + """The latency configuration for the model.""" + +@dataclass(kw_only=True) +class InlineSessionState(_SerdeShape): + """ + Contains parameters that specify various attributes that persist across + a session or prompt. You can define session state attributes as + key-value pairs when writing a [Lambda + function](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-lambda.html) + for an action group or pass them when making an `InvokeInlineAgent` + request. Use session state attributes to control and provide + conversational context for your inline agent and to help customize your + agent's behavior. For more information, see [Control session + context](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-session-state.html) + """ + + session_attributes: dict[str, str] | None = ... + """ + Contains attributes that persist across a session and the values of + those attributes. + """ + prompt_session_attributes: dict[str, str] | None = ... + """ + Contains attributes that persist across a session and the values of + those attributes. + """ + return_control_invocation_results: list[InvocationResultMember] | None = ... + """ + Contains information about the results from the action group invocation. + For more information, see [Return control to the agent + developer](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-returncontrol.html). + + Note: + If you include this field in the `sessionState` field, the `inputText` + field will be ignored. + """ + invocation_id: str | None = ... + """ + The identifier of the invocation of an action. This value must match the + `invocationId` returned in the `InvokeInlineAgent` response for the + action whose results are provided in the + `returnControlInvocationResults` field. For more information, see + [Return control to the agent + developer](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-returncontrol.html). + """ + files: list[InputFile] | None = ... + """Contains information about the files used by code interpreter.""" + conversation_history: ConversationHistory | None = ... + """Contains the conversation history that persist across sessions.""" + +@dataclass(kw_only=True) +class InputFile(_SerdeShape): + """Contains details of the source files.""" + + name: str + """The name of the source file.""" + source: FileSource + """Specifies where the files are located.""" + use_case: str + """Specifies how the source files will be used by the code interpreter.""" + +@dataclass(kw_only=True) +class InputImage(_SerdeShape): + """ + Contains the image data for multimodal knowledge base queries, including + format and content. + + This data type is used in the following API operations: + + - [Retrieve + request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_RequestSyntax) + -- in the `image` field + """ + + format: str + """ + The format of the input image. Supported formats include png, gif, jpeg, + and webp. + """ + inline_content: bytes + """ + The base64-encoded image data for inline image content. Maximum size is + 5MB. + """ + +class InputImageFormat(UnknownEnumMixin, StrEnum): + PNG = "png" + JPEG = "jpeg" + GIF = "gif" + WEBP = "webp" + +@dataclass +class InputPromptTextPrompt(_SerdeShape): + """Contains information about the text prompt to optimize.""" + + value: TextPrompt + +@dataclass +class InputPromptUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +InputPrompt = Union[InputPromptTextPrompt | InputPromptUnknown] +"""Contains information about the prompt to optimize.""" + +class _InputPromptDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> InputPrompt: ... + +class InputQueryType(UnknownEnumMixin, StrEnum): + TEXT = "TEXT" + +@dataclass(kw_only=True) +class InternalServerException(ServiceError, _SerdeShape): + """An internal server error occurred. Retry your request.""" + + reason: str | None = ... + """ + The reason for the exception. If the reason is + `BEDROCK_MODEL_INVOCATION_SERVICE_UNAVAILABLE`, the model invocation + service is unavailable. Retry your request. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvocationInput(_SerdeShape): + """ + Contains information pertaining to the action group or knowledge base + that is being invoked. + """ + + trace_id: str | None = ... + """The unique identifier of the trace.""" + invocation_type: str | None = ... + """ + Specifies whether the agent is invoking an action group or a knowledge + base. + """ + action_group_invocation_input: ActionGroupInvocationInput | None = ... + """Contains information about the action group to be invoked.""" + knowledge_base_lookup_input: KnowledgeBaseLookupInput | None = ... + """ + Contains details about the knowledge base to look up and the query to be + made. + """ + code_interpreter_invocation_input: CodeInterpreterInvocationInput | None = ... + """Contains information about the code interpreter to be invoked.""" + agent_collaborator_invocation_input: AgentCollaboratorInvocationInput | None = ... + """The collaborator's invocation input.""" + +@dataclass +class InvocationInputMemberApiInvocationInput(_SerdeShape): + """ + Contains information about the API operation that the agent predicts + should be called. + """ + + value: ApiInvocationInput + +@dataclass +class InvocationInputMemberFunctionInvocationInput(_SerdeShape): + """ + Contains information about the function that the agent predicts should + be called. + """ + + value: FunctionInvocationInput + +@dataclass +class InvocationInputMemberUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +InvocationInputMember = Union[ + InvocationInputMemberApiInvocationInput + | InvocationInputMemberFunctionInvocationInput + | InvocationInputMemberUnknown +] +""" +Contains details about the API operation or function that the agent +predicts should be called. + +This data type is used in the following API operations: + +- In the `returnControl` field of the [InvokeAgent + response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax) +""" + +class _InvocationInputMemberDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> InvocationInputMember: ... + +@dataclass +class InvocationResultMemberApiResult(_SerdeShape): + """The result from the API response from the action group invocation.""" + + value: ApiResult + +@dataclass +class InvocationResultMemberFunctionResult(_SerdeShape): + """The result from the function from the action group invocation.""" + + value: FunctionResult + +@dataclass +class InvocationResultMemberUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +InvocationResultMember = Union[ + InvocationResultMemberApiResult + | InvocationResultMemberFunctionResult + | InvocationResultMemberUnknown +] +""" +A result from the invocation of an action. For more information, see +[Return control to the agent +developer](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-returncontrol.html) +and [Control session +context](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-session-state.html). + +This data type is used in the following API operations: + +- [InvokeAgent + request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_RequestSyntax) +""" + +class _InvocationResultMemberDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> InvocationResultMember: ... + +@dataclass(kw_only=True) +class InvocationStep(_SerdeShape): + """ + Stores fine-grained state checkpoints, including text and images, for + each interaction in an invocation in a session. For more information + about sessions, see [Store and retrieve conversation history and context + with Amazon Bedrock + sessions](https://docs.aws.amazon.com/bedrock/latest/userguide/sessions.html). + """ + + session_id: str + """The unique identifier of the session containing the invocation step.""" + invocation_id: str + """ + The unique identifier (in UUID format) for the invocation that includes + the invocation step. + """ + invocation_step_id: str + """The unique identifier (in UUID format) for the invocation step.""" + invocation_step_time: datetime + """The timestamp for when the invocation step was created.""" + payload: InvocationStepPayload + """Payload content, such as text and images, for the invocation step.""" + +@dataclass +class InvocationStepPayloadContentBlocks(_SerdeShape): + """The content for the invocation step.""" + + value: list[BedrockSessionContentBlock] + +@dataclass +class InvocationStepPayloadUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +InvocationStepPayload = Union[ + InvocationStepPayloadContentBlocks | InvocationStepPayloadUnknown +] +"""Payload content, such as text and images, for the invocation step.""" + +class _InvocationStepPayloadDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> InvocationStepPayload: ... + +@dataclass(kw_only=True) +class InvocationStepSummary(_SerdeShape): + """ + Contains details about an invocation step within an invocation in a + session. For more information about sessions, see [Store and retrieve + conversation history and context with Amazon Bedrock + sessions](https://docs.aws.amazon.com/bedrock/latest/userguide/sessions.html). + """ + + session_id: str + """ + The unique identifier for the session associated with the invocation + step. + """ + invocation_id: str + """A unique identifier for the invocation in UUID format.""" + invocation_step_id: str + """The unique identifier (in UUID format) for the invocation step.""" + invocation_step_time: datetime + """The timestamp for when the invocation step was created.""" + +@dataclass(kw_only=True) +class InvocationSummary(_SerdeShape): + """ + Contains details about an invocation in a session. For more information + about sessions, see [Store and retrieve conversation history and context + with Amazon Bedrock + sessions](https://docs.aws.amazon.com/bedrock/latest/userguide/sessions.html). + """ + + session_id: str + """The unique identifier for the session associated with the invocation.""" + invocation_id: str + """A unique identifier for the invocation in UUID format.""" + created_at: datetime + """The timestamp for when the invocation was created.""" + +class InvocationType(UnknownEnumMixin, StrEnum): + ACTION_GROUP = "ACTION_GROUP" + KNOWLEDGE_BASE = "KNOWLEDGE_BASE" + FINISH = "FINISH" + ACTION_GROUP_CODE_INTERPRETER = "ACTION_GROUP_CODE_INTERPRETER" + AGENT_COLLABORATOR = "AGENT_COLLABORATOR" + +@dataclass(kw_only=True) +class InvokeAgentInput(_SerdeShape): + """Dataclass for InvokeAgentInput structure.""" + + session_state: SessionState | None = ... + """ + Contains parameters that specify various attributes of the session. For + more information, see [Control session + context](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-session-state.html). + + Note: + If you include `returnControlInvocationResults` in the `sessionState` + field, the `inputText` field will be ignored. + """ + agent_id: str | None = ... + """The unique identifier of the agent to use.""" + agent_alias_id: str | None = ... + """The alias of the agent to use.""" + session_id: str | None = ... + """ + The unique identifier of the session. Use the same value across requests + to continue the same conversation. + """ + end_session: bool | None = ... + """Specifies whether to end the session with the agent or not.""" + enable_trace: bool | None = ... + """ + Specifies whether to turn on the trace or not to track the agent's + reasoning process. For more information, see [Trace + enablement](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-test.html#trace-events). + """ + input_text: str | None = ... + """ + The prompt text to send the agent. + + Note: + If you include `returnControlInvocationResults` in the `sessionState` + field, the `inputText` field will be ignored. + """ + memory_id: str | None = ... + """The unique identifier of the agent memory.""" + bedrock_model_configurations: BedrockModelConfigurations | None = ... + """Model performance settings for the request.""" + streaming_configurations: StreamingConfigurations | None = ... + """ + Specifies the configurations for streaming. + + Note: + To use agent streaming, you need permissions to perform the + `bedrock:InvokeModelWithResponseStream` action. + """ + prompt_creation_configurations: PromptCreationConfigurations | None = ... + """ + Specifies parameters that control how the service populates the agent + prompt for an `InvokeAgent` request. You can control which aspects of + previous invocations in the same agent session the service uses to + populate the agent prompt. This gives you more granular control over the + contextual history that is used to process the current request. + """ + source_arn: str | None = ... + """The ARN of the resource making the request.""" + +@dataclass(kw_only=True) +class InvokeAgentOutput(_SerdeShape): + """Dataclass for InvokeAgentOutput structure.""" + + content_type: str + """ + The MIME type of the input data in the request. The default value is + `application/json`. + """ + session_id: str + """The unique identifier of the session with the agent.""" + memory_id: str | None = ... + """The unique identifier of the agent memory.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvokeFlowInput(_SerdeShape): + """Dataclass for InvokeFlowInput structure.""" + + flow_identifier: str | None = ... + """The unique identifier of the flow.""" + flow_alias_identifier: str | None = ... + """The unique identifier of the flow alias.""" + inputs: list[FlowInput] | None = ... + """ + A list of objects, each containing information about an input into the + flow. + """ + enable_trace: bool | None = ... + """ + Specifies whether to return the trace for the flow or not. Traces track + inputs and outputs for nodes in the flow. For more information, see + [Track each step in your prompt flow by viewing its trace in Amazon + Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-trace.html). + """ + model_performance_configuration: ModelPerformanceConfiguration | None = ... + """Model performance settings for the request.""" + execution_id: str | None = ... + """ + The unique identifier for the current flow execution. If you don't + provide a value, Amazon Bedrock creates the identifier for you. + """ + +@dataclass(kw_only=True) +class InvokeFlowOutput(_SerdeShape): + """Dataclass for InvokeFlowOutput structure.""" + + execution_id: str | None = ... + """The unique identifier for the current flow execution.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvokeInlineAgentInput(_SerdeShape): + """Dataclass for InvokeInlineAgentInput structure.""" + + customer_encryption_key_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the Amazon Web Services KMS key to use + to encrypt your inline agent. + """ + foundation_model: str | None = ... + """ + The [model identifier + (ID)](https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns) + of the model to use for orchestration by the inline agent. For example, + `meta.llama3-1-70b-instruct-v1:0`. + """ + instruction: str | None = ... + """ + The instructions that tell the inline agent what it should do and how it + should interact with users. + """ + idle_session_ttl_in_seconds: int | None = ... + """ + The number of seconds for which the inline agent should maintain session + information. After this time expires, the subsequent `InvokeInlineAgent` + request begins a new session. + + A user interaction remains active for the amount of time specified. If + no conversation occurs during this time, the session expires and the + data provided before the timeout is deleted. + """ + action_groups: list[AgentActionGroup] | None = ... + """ + A list of action groups with each action group defining the action the + inline agent needs to carry out. + """ + knowledge_bases: list[KnowledgeBase] | None = ... + """Contains information of the knowledge bases to associate with.""" + guardrail_configuration: GuardrailConfigurationWithArn | None = ... + """ + The + [guardrails](https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails.html) + to assign to the inline agent. + """ + prompt_override_configuration: PromptOverrideConfiguration | None = ... + """ + Configurations for advanced prompts used to override the default prompts + to enhance the accuracy of the inline agent. + """ + agent_collaboration: str | None = ... + """ + Defines how the inline collaborator agent handles information across + multiple collaborator agents to coordinate a final response. The inline + collaborator agent can also be the supervisor. + """ + collaborator_configurations: list[CollaboratorConfiguration] | None = ... + """ + Settings for an inline agent collaborator called with + [InvokeInlineAgent](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeInlineAgent.html). + """ + agent_name: str | None = ... + """The name for the agent.""" + session_id: str | None = ... + """ + The unique identifier of the session. Use the same value across requests + to continue the same conversation. + """ + end_session: bool | None = ... + """Specifies whether to end the session with the inline agent or not.""" + enable_trace: bool | None = ... + """ + Specifies whether to turn on the trace or not to track the agent's + reasoning process. For more information, see [Using + trace](https://docs.aws.amazon.com/bedrock/latest/userguide/trace-events.html). + """ + input_text: str | None = ... + """ + The prompt text to send to the agent. + + Note: + If you include `returnControlInvocationResults` in the `sessionState` + field, the `inputText` field will be ignored. + """ + streaming_configurations: StreamingConfigurations | None = ... + """ + Specifies the configurations for streaming. + + Note: + To use agent streaming, you need permissions to perform the + `bedrock:InvokeModelWithResponseStream` action. + """ + prompt_creation_configurations: PromptCreationConfigurations | None = ... + """ + Specifies parameters that control how the service populates the agent + prompt for an `InvokeInlineAgent` request. You can control which aspects + of previous invocations in the same agent session the service uses to + populate the agent prompt. This gives you more granular control over the + contextual history that is used to process the current request. + """ + inline_session_state: InlineSessionState | None = ... + """ + Parameters that specify the various attributes of a sessions. You can + include attributes for the session or prompt or, if you configured an + action group to return control, results from invocation of the action + group. For more information, see [Control session + context](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-session-state.html). + + Note: + If you include `returnControlInvocationResults` in the `sessionState` + field, the `inputText` field will be ignored. + """ + collaborators: list[Collaborator] | None = ... + """List of collaborator inline agents.""" + bedrock_model_configurations: InlineBedrockModelConfigurations | None = ... + """Model settings for the request.""" + orchestration_type: str | None = ... + """ + Specifies the type of orchestration strategy for the agent. This is set + to DEFAULT orchestration type, by default. + """ + custom_orchestration: CustomOrchestration | None = ... + """Contains details of the custom orchestration configured for the agent.""" + +@dataclass(kw_only=True) +class InvokeInlineAgentOutput(_SerdeShape): + """Dataclass for InvokeInlineAgentOutput structure.""" + + content_type: str + """ + The MIME type of the input data in the request. The default value is + application/json. + """ + session_id: str + """The unique identifier of the session with the agent.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class KnowledgeBase(_SerdeShape): + """Details of the knowledge base associated withe inline agent.""" + + knowledge_base_id: str + """ + The unique identifier for a knowledge base associated with the inline + agent. + """ + description: str + """The description of the knowledge base associated with the inline agent.""" + retrieval_configuration: KnowledgeBaseRetrievalConfiguration | None = ... + """ + The configurations to apply to the knowledge base during query. For more + information, see [Query + configurations](https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html). + """ + +@dataclass(kw_only=True) +class KnowledgeBaseConfiguration(_SerdeShape): + """ + Configurations to apply to a knowledge base attached to the agent during + query. For more information, see [Knowledge base retrieval + configurations](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-session-state.html#session-state-kb). + """ + + knowledge_base_id: str + """The unique identifier for a knowledge base attached to the agent.""" + retrieval_configuration: KnowledgeBaseRetrievalConfiguration + """ + The configurations to apply to the knowledge base during query. For more + information, see [Query + configurations](https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html). + """ + +@dataclass(kw_only=True) +class KnowledgeBaseLookupInput(_SerdeShape): + """ + Contains details about the knowledge base to look up and the query to be + made. + """ + + text: str | None = ... + """The query made to the knowledge base.""" + knowledge_base_id: str | None = ... + """The unique identifier of the knowledge base to look up.""" + +@dataclass(kw_only=True) +class KnowledgeBaseLookupOutput(_SerdeShape): + """Contains details about the results from looking up the knowledge base.""" + + retrieved_references: list[RetrievedReference] | None = ... + """Contains metadata about the sources cited for the generated response.""" + metadata: Metadata | None = ... + """Contains information about the knowledge base output.""" + +@dataclass(kw_only=True) +class KnowledgeBaseQuery(_SerdeShape): + """ + Contains the query made to the knowledge base. + + This data type is used in the following API operations: + + - [Retrieve + request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_RequestSyntax) + -- in the `retrievalQuery` field + """ + + type: str = ... + """The type of query being performed.""" + text: str = ... + """The text of the query made to the knowledge base.""" + image: InputImage | None = ... + """ + An image to include in the knowledge base query for multimodal + retrieval. + """ + +class KnowledgeBaseQueryType(UnknownEnumMixin, StrEnum): + TEXT = "TEXT" + IMAGE = "IMAGE" + +@dataclass(kw_only=True) +class KnowledgeBaseRetrievalConfiguration(_SerdeShape): + """ + Contains configurations for knowledge base query. For more information, + see [Query + configurations](https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html). + + This data type is used in the following API operations: + + - [Retrieve + request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_RequestSyntax) + -- in the `retrievalConfiguration` field + + - [RetrieveAndGenerate + request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_RequestSyntax) + -- in the `retrievalConfiguration` field + """ + + vector_search_configuration: KnowledgeBaseVectorSearchConfiguration | None = ... + """ + Contains details about how the results from the vector search should be + returned. For more information, see [Query + configurations](https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html). + """ + managed_search_configuration: ManagedSearchConfiguration | None = ... + """ + Contains configurations for managed search. For more information, see + [Query + configurations](https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html). + """ + +@dataclass(kw_only=True) +class KnowledgeBaseRetrievalResult(_SerdeShape): + """ + Details about a result from querying the knowledge base. + + This data type is used in the following API operations: + + - [Retrieve + response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax) + -- in the `retrievalResults` field + """ + + content: RetrievalResultContent + """Contains information about the content of the chunk.""" + location: RetrievalResultLocation | None = ... + """Contains information about the location of the data source.""" + score: float | None = ... + """The level of relevance of the result to the query.""" + metadata: dict[str, Document] | None = ... + """ + Contains metadata attributes and their values for the file in the data + source. For more information, see [Metadata and + filtering](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-ds.html#kb-ds-metadata). + """ + document_id: str | None = ... + """ + The unique identifier of the document. Use with `GetDocumentContent` to + retrieve the full document. + """ + +@dataclass(kw_only=True) +class KnowledgeBaseRetrieveAndGenerateConfiguration(_SerdeShape): + """ + Contains details about the resource being queried. + + This data type is used in the following API operations: + + - [Retrieve + request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_RequestSyntax) + -- in the `knowledgeBaseConfiguration` field + + - [RetrieveAndGenerate + request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_RequestSyntax) + -- in the `knowledgeBaseConfiguration` field + """ + + knowledge_base_id: str + """The unique identifier of the knowledge base that is queried.""" + model_arn: str + """ + The ARN of the foundation model or [inference + profile](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html) + used to generate a response. + """ + retrieval_configuration: KnowledgeBaseRetrievalConfiguration | None = ... + """ + Contains configurations for how to retrieve and return the knowledge + base query. + """ + generation_configuration: GenerationConfiguration | None = ... + """ + Contains configurations for response generation based on the knowledge + base query results. + """ + orchestration_configuration: OrchestrationConfiguration | None = ... + """ + Settings for how the model processes the prompt prior to retrieval and + generation. + """ + +@dataclass(kw_only=True) +class KnowledgeBaseRetrieverConfiguration(_SerdeShape): + """Configuration for retrieving from a Bedrock knowledge base.""" + + knowledge_base_id: str + """The unique identifier of the knowledge base.""" + retrieval_overrides: RetrievalOverrides | None = ... + """Overrides for retrieval behavior such as filters and result limits.""" + +@dataclass(kw_only=True) +class KnowledgeBaseVectorSearchConfiguration(_SerdeShape): + """ + Configurations for how to perform the search query and return results. + For more information, see [Query + configurations](https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html). + + This data type is used in the following API operations: + + - [Retrieve + request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_RequestSyntax) + -- in the `vectorSearchConfiguration` field + + - [RetrieveAndGenerate + request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_RequestSyntax) + -- in the `vectorSearchConfiguration` field + """ + + number_of_results: int = ... + """The number of source chunks to retrieve.""" + override_search_type: str | None = ... + """ + By default, Amazon Bedrock decides a search strategy for you. If you're + using an Amazon OpenSearch Serverless vector store that contains a + filterable text field, you can specify whether to query the knowledge + base with a `HYBRID` search using both vector embeddings and raw text, + or `SEMANTIC` search using only vector embeddings. For other vector + store configurations, only `SEMANTIC` search is available. For more + information, see [Test a knowledge + base](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-test.html). + """ + filter: RetrievalFilter | None = ... + """ + Specifies the filters to use on the metadata in the knowledge base data + sources before returning results. For more information, see [Query + configurations](https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html). + """ + reranking_configuration: VectorSearchRerankingConfiguration | None = ... + """ + Contains configurations for reranking the retrieved results. For more + information, see [Improve the relevance of query responses with a + reranker + model](https://docs.aws.amazon.com/bedrock/latest/userguide/rerank.html). + """ + implicit_filter_configuration: ImplicitFilterConfiguration | None = ... + """Settings for implicit filtering.""" + +@dataclass(kw_only=True) +class ListFlowExecutionEventsInput(_SerdeShape): + """Dataclass for ListFlowExecutionEventsInput structure.""" + + flow_identifier: str | None = ... + """The unique identifier of the flow.""" + flow_alias_identifier: str | None = ... + """The unique identifier of the flow alias used for the execution.""" + execution_identifier: str | None = ... + """The unique identifier of the flow execution.""" + max_results: int | None = ... + """ + The maximum number of events to return in a single response. If more + events exist than the specified maxResults value, a token is included in + the response so that the remaining results can be retrieved. + """ + next_token: str | None = ... + """ + A token to retrieve the next set of results. This value is returned in + the response if more results are available. + """ + event_type: str | None = ... + """ + The type of events to retrieve. Specify `Node` for node-level events or + `Flow` for flow-level events. + """ + +@dataclass(kw_only=True) +class ListFlowExecutionEventsOutput(_SerdeShape): + """Dataclass for ListFlowExecutionEventsOutput structure.""" + + flow_execution_events: list[FlowExecutionEvent] + """ + A list of events that occurred during the flow execution. Events can + include node inputs and outputs, flow inputs and outputs, condition + results, and failure events. + """ + next_token: str | None = ... + """ + A token to retrieve the next set of results. This value is returned if + more results are available. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListFlowExecutionsInput(_SerdeShape): + """Dataclass for ListFlowExecutionsInput structure.""" + + flow_identifier: str | None = ... + """The unique identifier of the flow to list executions for.""" + flow_alias_identifier: str | None = ... + """The unique identifier of the flow alias to list executions for.""" + max_results: int | None = ... + """ + The maximum number of flow executions to return in a single response. If + more executions exist than the specified `maxResults` value, a token is + included in the response so that the remaining results can be retrieved. + """ + next_token: str | None = ... + """ + A token to retrieve the next set of results. This value is returned in + the response if more results are available. + """ + +@dataclass(kw_only=True) +class ListFlowExecutionsOutput(_SerdeShape): + """Dataclass for ListFlowExecutionsOutput structure.""" + + flow_execution_summaries: list[FlowExecutionSummary] + """ + A list of flow execution summaries. Each summary includes the execution + ARN, flow identifier, flow alias identifier, flow version, status, and + timestamps. + """ + next_token: str | None = ... + """ + A token to retrieve the next set of results. This value is returned if + more results are available. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListInvocationsInput(_SerdeShape): + """Dataclass for ListInvocationsInput structure.""" + + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, enter the token returned in the `nextToken` + field in the response in this field to return the next batch of results. + """ + max_results: int = ... + """ + The maximum number of results to return in the response. If the total + number of results is greater than this value, use the token returned in + the response in the `nextToken` field when making another request to + return the next batch of results. + """ + session_identifier: str | None = ... + """ + The unique identifier for the session to list invocations for. You can + specify either the session's `sessionId` or its Amazon Resource Name + (ARN). + """ + +@dataclass(kw_only=True) +class ListInvocationsOutput(_SerdeShape): + """Dataclass for ListInvocationsOutput structure.""" + + invocation_summaries: list[InvocationSummary] + """A list of invocation summaries associated with the session.""" + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, use this token when making another request in + the `nextToken` field to return the next batch of results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListInvocationStepsInput(_SerdeShape): + """Dataclass for ListInvocationStepsInput structure.""" + + invocation_identifier: str | None = ... + """ + The unique identifier (in UUID format) for the invocation to list + invocation steps for. + """ + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, enter the token returned in the `nextToken` + field in the response in this field to return the next batch of results. + """ + max_results: int = ... + """ + The maximum number of results to return in the response. If the total + number of results is greater than this value, use the token returned in + the response in the `nextToken` field when making another request to + return the next batch of results. + """ + session_identifier: str | None = ... + """ + The unique identifier for the session associated with the invocation + steps. You can specify either the session's `sessionId` or its Amazon + Resource Name (ARN). + """ + +@dataclass(kw_only=True) +class ListInvocationStepsOutput(_SerdeShape): + """Dataclass for ListInvocationStepsOutput structure.""" + + invocation_step_summaries: list[InvocationStepSummary] + """ + A list of summaries for each invocation step associated with a session + and if you specified it, an invocation within the session. + """ + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, use this token when making another request in + the `nextToken` field to return the next batch of results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListSessionsInput(_SerdeShape): + """Dataclass for ListSessionsInput structure.""" + + max_results: int = ... + """ + The maximum number of results to return in the response. If the total + number of results is greater than this value, use the token returned in + the response in the `nextToken` field when making another request to + return the next batch of results. + """ + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, enter the token returned in the `nextToken` + field in the response in this field to return the next batch of results. + """ + +@dataclass(kw_only=True) +class ListSessionsOutput(_SerdeShape): + """Dataclass for ListSessionsOutput structure.""" + + session_summaries: list[SessionSummary] + """ + A list of summaries for each session in your Amazon Web Services + account. + """ + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, use this token when making another request in + the `nextToken` field to return the next batch of results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListTagsForResourceInput(_SerdeShape): + """Dataclass for ListTagsForResourceInput structure.""" + + resource_arn: str | None = ... + """The Amazon Resource Name (ARN) of the resource for which to list tags.""" + +@dataclass(kw_only=True) +class ListTagsForResourceOutput(_SerdeShape): + """Dataclass for ListTagsForResourceOutput structure.""" + + tags: dict[str, str] | None = ... + """The key-value pairs for the tags associated with the resource.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ManagedSearchBedrockRerankingConfiguration(_SerdeShape): + """Configuration for a Bedrock reranking model used in managed search.""" + + model_configuration: ManagedSearchBedrockRerankingModelConfiguration + """The model configuration containing the model ARN for reranking.""" + number_of_reranked_results: int | None = ... + """The number of results to return after reranking.""" + metadata_configuration: MetadataConfigurationForReranking | None = ... + """The metadata configuration for reranking.""" + +@dataclass(kw_only=True) +class ManagedSearchBedrockRerankingModelConfiguration(_SerdeShape): + """ + Model configuration for a Bedrock reranking model used in managed + search. + """ + + model_arn: str + """The ARN of the Bedrock reranking model.""" + additional_model_request_fields: dict[str, Document] | None = ... + """Additional request fields to pass to the reranking model.""" + +@dataclass(kw_only=True) +class ManagedSearchConfiguration(_SerdeShape): + """ + Configuration for managed search in a knowledge base. Managed search + automatically determines the best search strategy based on your data + store configuration. + """ + + number_of_results: int | None = ... + """The number of results to retrieve.""" + filter: RetrievalFilter | None = ... + """ + Filters the metadata of the retrieved results so that Amazon Bedrock + returns only results that match the filter. + """ + reranking_model_type: str | None = ... + """ + The type of reranking model to use when reranking results retrieved from + the managed search. Use `CUSTOM` to specify a model, `MANAGED` to use + the service default, or `NONE` to disable reranking. + """ + reranking_configuration: ManagedSearchRerankingConfiguration | None = ... + """ + Contains configurations for reranking the results retrieved from the + managed search. + """ + +@dataclass(kw_only=True) +class ManagedSearchRerankingConfiguration(_SerdeShape): + """Configuration for the reranking model used in managed search.""" + + type: str + """The type of reranking configuration.""" + bedrock_reranking_configuration: ( + ManagedSearchBedrockRerankingConfiguration | None + ) = ... + """The Bedrock reranking model configuration for managed search.""" + +class ManagedSearchRerankingConfigurationType(UnknownEnumMixin, StrEnum): + """The type of reranking configuration for managed search.""" + + BEDROCK_RERANKING_MODEL = "BEDROCK_RERANKING_MODEL" + +@dataclass(kw_only=True) +class MantleFoundationModelConfiguration(_SerdeShape): + """Configuration for a Mantle foundation model.""" + + model_configuration: MantleFoundationModelModelConfiguration + """The model configuration containing the model ARN and project ID.""" + +@dataclass(kw_only=True) +class MantleFoundationModelModelConfiguration(_SerdeShape): + """Model configuration for a Mantle foundation model.""" + + model_arn: str + """The ARN of the Mantle foundation model.""" + project_id: str | None = ... + """ + The Amazon Bedrock project ID used for billing and usage attribution. If + you don't specify a value, the service uses the default project. + """ + +@dataclass +class Memory_SessionSummary(_SerdeShape): + """Contains summary of a session.""" + + value: MemorySessionSummary + +@dataclass +class MemoryUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +Memory = Union[Memory_SessionSummary | MemoryUnknown] +"""Contains sessions summaries.""" + +class _MemoryDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> Memory: ... + +@dataclass(kw_only=True) +class MemorySessionSummary(_SerdeShape): + """Contains details of a session summary.""" + + memory_id: str | None = ... + """The unique identifier of the memory where the session summary is stored.""" + session_id: str | None = ... + """The identifier for this session.""" + session_start_time: datetime | None = ... + """The start time for this session.""" + session_expiry_time: datetime | None = ... + """The time when the memory duration for the session is set to end.""" + summary_text: str | None = ... + """The summarized text for this session.""" + +class MemoryType(UnknownEnumMixin, StrEnum): + SESSION_SUMMARY = "SESSION_SUMMARY" + +@dataclass(kw_only=True) +class Message(_SerdeShape): + """Details about a message.""" + + role: str + """The message's role.""" + content: list[ContentBlock] + """The message's content.""" + +@dataclass(kw_only=True) +class Metadata(_SerdeShape): + """ + Provides information about the execution process for different types of + invocations, such as model invocation, knowledge base invocation, agent + collaborator invocation, guardrail invocation, and code interpreter + Invocation. + """ + + start_time: datetime | None = ... + """ + In the final response, `startTime` is the start time of the agent + invocation operation. + """ + end_time: datetime | None = ... + """ + In the final response, `endTime` is the end time of the agent invocation + operation. + """ + total_time_ms: int | None = ... + """ + The total execution time for the specific invocation being processed + (model, knowledge base, guardrail, agent collaborator, or code + interpreter). It represents how long the individual invocation took. + """ + operation_total_time_ms: int | None = ... + """ + The total time it took for the agent to complete execution. This field + is only set for the final response. + """ + client_request_id: str | None = ... + """ + A unique identifier associated with the downstream invocation. This ID + can be used for tracing, debugging, and identifying specific invocations + in customer logs or systems. + """ + usage: Usage | None = ... + """ + Specific to model invocation and contains details about the usage of a + foundation model. + """ + +@dataclass(kw_only=True) +class MetadataAttributeSchema(_SerdeShape): + """Details about a metadata attribute.""" + + key: str + """The attribute's key.""" + type: str + """The attribute's type.""" + description: str + """The attribute's description.""" + +@dataclass(kw_only=True) +class MetadataConfigurationForReranking(_SerdeShape): + """Contains configurations for the metadata to use in reranking.""" + + selection_mode: str + """ + Specifies whether to consider all metadata when reranking, or only the + metadata that you select. If you specify `SELECTIVE`, include the + `selectiveModeConfiguration` field. + """ + selective_mode_configuration: ( + RerankingMetadataSelectiveModeConfiguration | None + ) = ... + """ + Contains configurations for the metadata fields to include or exclude + when considering reranking. + """ + +@dataclass(kw_only=True) +class ModelInvocationInput(_SerdeShape): + """ + The input for the pre-processing step. + + - The `type` matches the agent step. + + - The `text` contains the prompt. + + - The `inferenceConfiguration`, `parserMode`, and `overrideLambda` + values are set in the + [PromptOverrideConfiguration](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptOverrideConfiguration.html) + object that was set when the agent was created or updated. + """ + + trace_id: str | None = ... + """The unique identifier of the trace.""" + text: str | None = ... + """The text that prompted the agent at this step.""" + type: str | None = ... + """The step in the agent sequence.""" + override_lambda: str | None = ... + """ + The ARN of the Lambda function to use when parsing the raw foundation + model output in parts of the agent sequence. + """ + prompt_creation_mode: str | None = ... + """ + Specifies whether the default prompt template was `OVERRIDDEN`. If it + was, the `basePromptTemplate` that was set in the + [PromptOverrideConfiguration](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptOverrideConfiguration.html) + object when the agent was created or updated is used instead. + """ + inference_configuration: InferenceConfiguration | None = ... + """ + Specifications about the inference parameters that were provided + alongside the prompt. These are specified in the + [PromptOverrideConfiguration](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptOverrideConfiguration.html) + object that was set when the agent was created or updated. For more + information, see [Inference parameters for foundation + models](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). + """ + parser_mode: str | None = ... + """ + Specifies whether to override the default parser Lambda function when + parsing the raw foundation model output in the part of the agent + sequence defined by the `promptType`. + """ + foundation_model: str | None = ... + """The identifier of a foundation model.""" + +@dataclass(kw_only=True) +class ModelNotReadyException(ServiceError, _SerdeShape): + """ + The model specified in the request is not ready to serve inference + requests. The AWS SDK will automatically retry the operation up to 5 + times. For information about configuring automatic retries, see [Retry + behavior](https://docs.aws.amazon.com/sdkref/latest/guide/feature-retry-behavior.html) + in the *AWS SDKs and Tools* reference guide. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ModelPerformanceConfiguration(_SerdeShape): + """The performance configuration for a model called with InvokeFlow.""" + + performance_config: PerformanceConfiguration | None = ... + """The latency configuration for the model.""" + +@dataclass(kw_only=True) +class NodeActionEvent(_SerdeShape): + """ + Contains information about an action (operation) called by a node during + execution. + """ + + node_name: str + """The name of the node that called the operation.""" + timestamp: datetime + """The date and time that the operation was called.""" + request_id: str + """The ID of the request that the node made to the operation.""" + service_name: str + """The name of the service that the node called.""" + operation_name: str + """The name of the operation that the node called.""" + operation_request: Document | None = ... + """The request payload sent to the downstream service.""" + operation_response: Document | None = ... + """The response payload received from the downstream service.""" + +@dataclass(kw_only=True) +class NodeDependencyEvent(_SerdeShape): + """ + Contains information about an internal trace of a specific node during + execution. + """ + + node_name: str + """The name of the node that generated the dependency trace.""" + timestamp: datetime + """The date and time that the dependency trace was generated.""" + trace_elements: NodeTraceElements + """ + The trace elements containing detailed information about the node + execution. + """ + +class NodeErrorCode(UnknownEnumMixin, StrEnum): + VALIDATION = "VALIDATION" + DEPENDENCY_FAILED = "DEPENDENCY_FAILED" + BAD_GATEWAY = "BAD_GATEWAY" + INTERNAL_SERVER = "INTERNAL_SERVER" + +@dataclass +class NodeExecutionContentDocument(_SerdeShape): + """ + The document content of the field, which can contain text or structured + data. + """ + + value: Document + +@dataclass +class NodeExecutionContentUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +NodeExecutionContent = Union[NodeExecutionContentDocument | NodeExecutionContentUnknown] +""" +Contains the content of a flow node's input or output field for a flow +execution. + +Note: + Flow executions is in preview release for Amazon Bedrock and is subject + to change. +""" + +class _NodeExecutionContentDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> NodeExecutionContent: ... + +@dataclass(kw_only=True) +class NodeFailureEvent(_SerdeShape): + """ + Contains information about a failure that occurred at a specific node + during a flow execution. + + Note: + Flow executions is in preview release for Amazon Bedrock and is subject + to change. + """ + + node_name: str + """The name of the node where the failure occurred.""" + timestamp: datetime + """The timestamp when the node failure occurred.""" + error_code: str + """ + The error code that identifies the type of failure that occurred at the + node. + """ + error_message: str + """A descriptive message that provides details about the node failure.""" + +@dataclass(kw_only=True) +class NodeInputEvent(_SerdeShape): + """ + Contains information about the inputs provided to a specific node during + a flow execution. + + Note: + Flow executions is in preview release for Amazon Bedrock and is subject + to change. + """ + + node_name: str + """The name of the node that received the inputs.""" + timestamp: datetime + """The timestamp when the inputs were provided to the node.""" + fields: list[NodeInputField] + """A list of input fields provided to the node.""" + +@dataclass(kw_only=True) +class NodeInputExecutionChainItem(_SerdeShape): + """Represents an item in the execution chain for node input tracking.""" + + node_name: str + """The name of the node in the execution chain.""" + index: int | None = ... + """The index position of this item in the execution chain.""" + type: str + """ + The type of execution chain item. Supported values are Iterator and + Loop. + """ + +@dataclass(kw_only=True) +class NodeInputField(_SerdeShape): + """Represents an input field provided to a node during a flow execution.""" + + name: str + """The name of the input field as defined in the node's input schema.""" + content: NodeExecutionContent + """ + The content of the input field, which can contain text or structured + data. + """ + source: NodeInputSource | None = ... + """The source node that provides input data to this field.""" + type: str | None = ... + """The data type of the input field for compatibility validation.""" + category: str | None = ... + """The category of the input field.""" + execution_chain: list[NodeInputExecutionChainItem] | None = ... + """The execution path through nested nodes like iterators and loops.""" + +@dataclass(kw_only=True) +class NodeInputSource(_SerdeShape): + """Represents the source of input data for a node field.""" + + node_name: str + """The name of the source node that provides the input data.""" + output_field_name: str + """The name of the output field from the source node.""" + expression: str + """The expression used to extract data from the source.""" + +@dataclass(kw_only=True) +class NodeOutputEvent(_SerdeShape): + """ + Contains information about the outputs produced by a specific node + during a flow execution. + + Note: + Flow executions is in preview release for Amazon Bedrock and is subject + to change. + """ + + node_name: str + """The name of the node that produced the outputs.""" + timestamp: datetime + """The timestamp when the outputs were produced by the node.""" + fields: list[NodeOutputField] + """A list of output fields produced by the node.""" + +@dataclass(kw_only=True) +class NodeOutputField(_SerdeShape): + """ + Represents an output field produced by a node during a flow execution. + + Note: + Flow executions is in preview release for Amazon Bedrock and is subject + to change. + """ + + name: str + """The name of the output field as defined in the node's output schema.""" + content: NodeExecutionContent + """ + The content of the output field, which can contain text or structured + data. + """ + next: list[NodeOutputNext] | None = ... + """The next node that receives output data from this field.""" + type: str | None = ... + """The data type of the output field for compatibility validation.""" + +@dataclass(kw_only=True) +class NodeOutputNext(_SerdeShape): + """Represents the next node that receives output data.""" + + node_name: str + """The name of the next node that receives the output data.""" + input_field_name: str + """The name of the input field in the next node that receives the data.""" + +@dataclass +class NodeTraceElementsAgentTraces(_SerdeShape): + """Agent trace information for the node execution.""" + + value: list[TracePart] + +@dataclass +class NodeTraceElementsUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +NodeTraceElements = Union[NodeTraceElementsAgentTraces | NodeTraceElementsUnknown] +"""Contains trace elements for node execution tracking.""" + +class _NodeTraceElementsDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> NodeTraceElements: ... + +class NodeType(UnknownEnumMixin, StrEnum): + FLOW_INPUT_NODE = "FlowInputNode" + FLOW_OUTPUT_NODE = "FlowOutputNode" + LAMBDA_FUNCTION_NODE = "LambdaFunctionNode" + KNOWLEDGE_BASE_NODE = "KnowledgeBaseNode" + PROMPT_NODE = "PromptNode" + CONDITION_NODE = "ConditionNode" + LEX_NODE = "LexNode" + +@dataclass(kw_only=True) +class Observation(_SerdeShape): + """ + Contains the result or output of an action group or knowledge base, or + the response to the user. + """ + + trace_id: str | None = ... + """The unique identifier of the trace.""" + type: str | None = ... + """ + Specifies what kind of information the agent returns in the observation. + The following values are possible. + + - `ACTION_GROUP` -- The agent returns the result of an action group. + + - `KNOWLEDGE_BASE` -- The agent returns information from a knowledge + base. + + - `FINISH` -- The agent returns a final response to the user with no + follow-up. + + - `ASK_USER` -- The agent asks the user a question. + + - `REPROMPT` -- The agent prompts the user again for the same + information. + """ + action_group_invocation_output: ActionGroupInvocationOutput | None = ... + """ + Contains the JSON-formatted string returned by the API invoked by the + action group. + """ + agent_collaborator_invocation_output: AgentCollaboratorInvocationOutput | None = ... + """A collaborator's invocation output.""" + knowledge_base_lookup_output: KnowledgeBaseLookupOutput | None = ... + """Contains details about the results from looking up the knowledge base.""" + final_response: FinalResponse | None = ... + """Contains details about the response to the user.""" + reprompt_response: RepromptResponse | None = ... + """Contains details about the response to reprompt the input.""" + code_interpreter_invocation_output: CodeInterpreterInvocationOutput | None = ... + """ + Contains the JSON-formatted string returned by the API invoked by the + code interpreter. + """ + +@dataclass +class OptimizedPromptTextPrompt(_SerdeShape): + """Contains information about the text in the prompt that was optimized.""" + + value: TextPrompt + +@dataclass +class OptimizedPromptUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +OptimizedPrompt = Union[OptimizedPromptTextPrompt | OptimizedPromptUnknown] +"""Contains information about the optimized prompt.""" + +class _OptimizedPromptDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> OptimizedPrompt: ... + +@dataclass(kw_only=True) +class OptimizedPromptEvent(_SerdeShape): + """An event in which the prompt was optimized.""" + + optimized_prompt: OptimizedPrompt | None = ... + """Contains information about the optimized prompt.""" + +@dataclass +class OptimizedPromptStreamOptimizedPromptEvent(_SerdeShape): + """An event in which the prompt was optimized.""" + + value: OptimizedPromptEvent + +@dataclass +class OptimizedPromptStreamAnalyzePromptEvent(_SerdeShape): + """ + An event in which the prompt was analyzed in preparation for + optimization. + """ + + value: AnalyzePromptEvent + +@dataclass +class OptimizedPromptStreamInternalServerException(_SerdeShape): + """An internal server error occurred. Retry your request.""" + + value: InternalServerException + +@dataclass +class OptimizedPromptStreamThrottlingException(_SerdeShape): + """ + Your request was throttled because of service-wide limitations. Resubmit + your request later or in a different region. You can also purchase + [Provisioned + Throughput](https://docs.aws.amazon.com/bedrock/latest/userguide/prov-throughput.html) + to increase the rate or number of tokens you can process. + """ + + value: ThrottlingException + +@dataclass +class OptimizedPromptStreamValidationException(_SerdeShape): + """ + Input validation failed. Check your request parameters and retry the + request. + """ + + value: ValidationException + +@dataclass +class OptimizedPromptStreamDependencyFailedException(_SerdeShape): + """ + There was an issue with a dependency. Check the resource configurations + and retry the request. + """ + + value: DependencyFailedException + +@dataclass +class OptimizedPromptStreamAccessDeniedException(_SerdeShape): + """ + The request is denied because of missing access permissions. Check your + permissions and retry your request. + """ + + value: AccessDeniedException + +@dataclass +class OptimizedPromptStreamBadGatewayException(_SerdeShape): + """ + There was an issue with a dependency due to a server issue. Retry your + request. + """ + + value: BadGatewayException + +@dataclass +class OptimizedPromptStreamUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +OptimizedPromptStream = Union[ + OptimizedPromptStreamOptimizedPromptEvent + | OptimizedPromptStreamAnalyzePromptEvent + | OptimizedPromptStreamInternalServerException + | OptimizedPromptStreamThrottlingException + | OptimizedPromptStreamValidationException + | OptimizedPromptStreamDependencyFailedException + | OptimizedPromptStreamAccessDeniedException + | OptimizedPromptStreamBadGatewayException + | OptimizedPromptStreamUnknown +] +"""The stream containing events in the prompt optimization process.""" + +class _OptimizedPromptStreamDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> OptimizedPromptStream: ... + +@dataclass(kw_only=True) +class OptimizePromptInput(_SerdeShape): + """Dataclass for OptimizePromptInput structure.""" + + input: InputPrompt | None = ... + """Contains the prompt to optimize.""" + target_model_id: str | None = ... + """ + The unique identifier of the model that you want to optimize the prompt + for. + """ + +@dataclass(kw_only=True) +class OptimizePromptOutput(_SerdeShape): + """Dataclass for OptimizePromptOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class OrchestrationConfiguration(_SerdeShape): + """ + Settings for how the model processes the prompt prior to retrieval and + generation. + """ + + prompt_template: PromptTemplate | None = ... + """ + Contains the template for the prompt that's sent to the model. + Orchestration prompts must include the `$conversation_history$` and + `$output_format_instructions$` variables. For more information, see [Use + placeholder + variables](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-placeholders.html) + in the user guide. + """ + inference_config: InferenceConfig | None = ... + """ + Configuration settings for inference when using RetrieveAndGenerate to + generate responses while using a knowledge base as a source. + """ + additional_model_request_fields: dict[str, Document] | None = ... + """ + Additional model parameters and corresponding values not included in the + textInferenceConfig structure for a knowledge base. This allows users to + provide custom model parameters specific to the language model being + used. + """ + query_transformation_configuration: QueryTransformationConfiguration | None = ... + """ + To split up the prompt and retrieve multiple sources, set the + transformation type to `QUERY_DECOMPOSITION`. + """ + performance_config: PerformanceConfiguration | None = ... + """The latency configuration for the model.""" + +@dataclass +class OrchestrationExecutorLambda(_SerdeShape): + """ + The Amazon Resource Name (ARN) of the Lambda function containing the + business logic that is carried out upon invoking the action. + """ + + value: str + +@dataclass +class OrchestrationExecutorUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +OrchestrationExecutor = Union[ + OrchestrationExecutorLambda | OrchestrationExecutorUnknown +] +""" +The structure of the executor invoking the actions in custom +orchestration. +""" + +class _OrchestrationExecutorDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> OrchestrationExecutor: ... + +@dataclass(kw_only=True) +class OrchestrationModelInvocationOutput(_SerdeShape): + """The foundation model output from the orchestration step.""" + + trace_id: str | None = ... + """The unique identifier of the trace.""" + raw_response: RawResponse | None = ... + """Contains details of the raw response from the foundation model output.""" + metadata: Metadata | None = ... + """ + Contains information about the foundation model output from the + orchestration step. + """ + reasoning_content: ReasoningContentBlock | None = ... + """ + Contains content about the reasoning that the model made during the + orchestration step. + """ + +@dataclass +class OrchestrationTraceRationale(_SerdeShape): + """ + Details about the reasoning, based on the input, that the agent uses to + justify carrying out an action group or getting information from a + knowledge base. + """ + + value: Rationale + +@dataclass +class OrchestrationTraceInvocationInput(_SerdeShape): + """ + Contains information pertaining to the action group or knowledge base + that is being invoked. + """ + + value: InvocationInput + +@dataclass +class OrchestrationTraceObservation(_SerdeShape): + """ + Details about the observation (the output of the action group Lambda or + knowledge base) made by the agent. + """ + + value: Observation + +@dataclass +class OrchestrationTraceModelInvocationInput(_SerdeShape): + """ + The input for the orchestration step. + + - The `type` is `ORCHESTRATION`. + + - The `text` contains the prompt. + + - The `inferenceConfiguration`, `parserMode`, and `overrideLambda` + values are set in the + [PromptOverrideConfiguration](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptOverrideConfiguration.html) + object that was set when the agent was created or updated. + """ + + value: ModelInvocationInput + +@dataclass +class OrchestrationTraceModelInvocationOutput(_SerdeShape): + """ + Contains information pertaining to the output from the foundation model + that is being invoked. + """ + + value: OrchestrationModelInvocationOutput + +@dataclass +class OrchestrationTraceUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +OrchestrationTrace = Union[ + OrchestrationTraceRationale + | OrchestrationTraceInvocationInput + | OrchestrationTraceObservation + | OrchestrationTraceModelInvocationInput + | OrchestrationTraceModelInvocationOutput + | OrchestrationTraceUnknown +] +""" +Details about the orchestration step, in which the agent determines the +order in which actions are executed and which knowledge bases are +retrieved. +""" + +class _OrchestrationTraceDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> OrchestrationTrace: ... + +class OrchestrationType(UnknownEnumMixin, StrEnum): + DEFAULT = "DEFAULT" + CUSTOM_ORCHESTRATION = "CUSTOM_ORCHESTRATION" + +@dataclass(kw_only=True) +class OutputFile(_SerdeShape): + """Contains details of the response from code interpreter.""" + + name: str | None = ... + """The name of the file containing response from code interpreter.""" + type: str | None = ... + """The type of file that contains response from the code interpreter.""" + bytes_: bytes | None = ... + """The byte count of files that contains response from code interpreter.""" + +@dataclass(kw_only=True) +class Parameter(_SerdeShape): + """A parameter for the API request or function.""" + + name: str | None = ... + """The name of the parameter.""" + type: str | None = ... + """The type of the parameter.""" + value: str | None = ... + """The value of the parameter.""" + +@dataclass(kw_only=True) +class ParameterDetail(_SerdeShape): + """Contains details about a parameter in a function for an action group.""" + + description: str | None = ... + """ + A description of the parameter. Helps the foundation model determine how + to elicit the parameters from the user. + """ + type: str + """The data type of the parameter.""" + required: bool | None = ... + """ + Whether the parameter is required for the agent to complete the function + for action group invocation. + """ + +class ParameterType(UnknownEnumMixin, StrEnum): + STRING = "string" + NUMBER = "number" + INTEGER = "integer" + BOOLEAN = "boolean" + ARRAY = "array" + +@dataclass(kw_only=True) +class PayloadPart(_SerdeShape): + """Contains a part of an agent response and citations for it.""" + + bytes_: bytes | None = ... + """A part of the agent response in bytes.""" + attribution: Attribution | None = ... + """Contains citations for a part of an agent response.""" + +class PayloadType(UnknownEnumMixin, StrEnum): + TEXT = "TEXT" + RETURN_CONTROL = "RETURN_CONTROL" + +class PerformanceConfigLatency(UnknownEnumMixin, StrEnum): + STANDARD = "standard" + OPTIMIZED = "optimized" + +@dataclass(kw_only=True) +class PerformanceConfiguration(_SerdeShape): + """Performance settings for a model.""" + + latency: str = ... + """To use a latency-optimized version of the model, set to `optimized`.""" + +@dataclass(kw_only=True) +class PostProcessingModelInvocationOutput(_SerdeShape): + """The foundation model output from the post-processing step.""" + + trace_id: str | None = ... + """The unique identifier of the trace.""" + parsed_response: PostProcessingParsedResponse | None = ... + """ + Details about the response from the Lambda parsing of the output of the + post-processing step. + """ + raw_response: RawResponse | None = ... + """Details of the raw response from the foundation model output.""" + metadata: Metadata | None = ... + """ + Contains information about the foundation model output from the + post-processing step. + """ + reasoning_content: ReasoningContentBlock | None = ... + """ + Contains content about the reasoning that the model made during the + post-processing step. + """ + +@dataclass(kw_only=True) +class PostProcessingParsedResponse(_SerdeShape): + """ + Details about the response from the Lambda parsing of the output from + the post-processing step. + """ + + text: str | None = ... + """The text returned by the parser.""" + +@dataclass +class PostProcessingTraceModelInvocationInput(_SerdeShape): + """ + The input for the post-processing step. + + - The `type` is `POST_PROCESSING`. + + - The `text` contains the prompt. + + - The `inferenceConfiguration`, `parserMode`, and `overrideLambda` + values are set in the + [PromptOverrideConfiguration](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptOverrideConfiguration.html) + object that was set when the agent was created or updated. + """ + + value: ModelInvocationInput + +@dataclass +class PostProcessingTraceModelInvocationOutput(_SerdeShape): + """The foundation model output from the post-processing step.""" + + value: PostProcessingModelInvocationOutput + +@dataclass +class PostProcessingTraceUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +PostProcessingTrace = Union[ + PostProcessingTraceModelInvocationInput + | PostProcessingTraceModelInvocationOutput + | PostProcessingTraceUnknown +] +""" +Details about the post-processing step, in which the agent shapes the +response. +""" + +class _PostProcessingTraceDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> PostProcessingTrace: ... + +@dataclass(kw_only=True) +class PreProcessingModelInvocationOutput(_SerdeShape): + """The foundation model output from the pre-processing step.""" + + trace_id: str | None = ... + """The unique identifier of the trace.""" + parsed_response: PreProcessingParsedResponse | None = ... + """ + Details about the response from the Lambda parsing of the output of the + pre-processing step. + """ + raw_response: RawResponse | None = ... + """Details of the raw response from the foundation model output.""" + metadata: Metadata | None = ... + """ + Contains information about the foundation model output from the + pre-processing step. + """ + reasoning_content: ReasoningContentBlock | None = ... + """ + Contains content about the reasoning that the model made during the + pre-processing step. + """ + +@dataclass(kw_only=True) +class PreProcessingParsedResponse(_SerdeShape): + """ + Details about the response from the Lambda parsing of the output from + the pre-processing step. + """ + + rationale: str | None = ... + """ + The text returned by the parsing of the pre-processing step, explaining + the steps that the agent plans to take in orchestration, if the user + input is valid. + """ + is_valid: bool | None = ... + """ + Whether the user input is valid or not. If `false`, the agent doesn't + proceed to orchestration. + """ + +@dataclass +class PreProcessingTraceModelInvocationInput(_SerdeShape): + """ + The input for the pre-processing step. + + - The `type` is `PRE_PROCESSING`. + + - The `text` contains the prompt. + + - The `inferenceConfiguration`, `parserMode`, and `overrideLambda` + values are set in the + [PromptOverrideConfiguration](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptOverrideConfiguration.html) + object that was set when the agent was created or updated. + """ + + value: ModelInvocationInput + +@dataclass +class PreProcessingTraceModelInvocationOutput(_SerdeShape): + """The foundation model output from the pre-processing step.""" + + value: PreProcessingModelInvocationOutput + +@dataclass +class PreProcessingTraceUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +PreProcessingTrace = Union[ + PreProcessingTraceModelInvocationInput + | PreProcessingTraceModelInvocationOutput + | PreProcessingTraceUnknown +] +""" +Details about the pre-processing step, in which the agent contextualizes +and categorizes user inputs. +""" + +class _PreProcessingTraceDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> PreProcessingTrace: ... + +@dataclass(kw_only=True) +class PromptConfiguration(_SerdeShape): + """ + Contains configurations to override a prompt template in one part of an + agent sequence. For more information, see [Advanced + prompts](https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts.html). + """ + + prompt_type: str | None = ... + """ + The step in the agent sequence that this prompt configuration applies + to. + """ + prompt_creation_mode: str | None = ... + """ + Specifies whether to override the default prompt template for this + `promptType`. Set this value to `OVERRIDDEN` to use the prompt that you + provide in the `basePromptTemplate`. If you leave it as `DEFAULT`, the + agent uses a default prompt template. + """ + prompt_state: str | None = ... + """ + Specifies whether to allow the inline agent to carry out the step + specified in the `promptType`. If you set this value to `DISABLED`, the + agent skips that step. The default state for each `promptType` is as + follows. + + - `PRE_PROCESSING` -- `ENABLED` + + - `ORCHESTRATION` -- `ENABLED` + + - `KNOWLEDGE_BASE_RESPONSE_GENERATION` -- `ENABLED` + + - `POST_PROCESSING` -- `DISABLED` + """ + base_prompt_template: str | None = ... + """ + Defines the prompt template with which to replace the default prompt + template. You can use placeholder variables in the base prompt template + to customize the prompt. For more information, see [Prompt template + placeholder + variables](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-placeholders.html). + For more information, see [Configure the prompt + templates](https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts-configure.html). + """ + inference_configuration: InferenceConfiguration | None = ... + """ + Contains inference parameters to use when the agent invokes a foundation + model in the part of the agent sequence defined by the `promptType`. For + more information, see [Inference parameters for foundation + models](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). + """ + parser_mode: str | None = ... + """ + Specifies whether to override the default parser Lambda function when + parsing the raw foundation model output in the part of the agent + sequence defined by the `promptType`. If you set the field as + `OVERRIDDEN`, the `overrideLambda` field in the + [PromptOverrideConfiguration](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptOverrideConfiguration.html) + must be specified with the ARN of a Lambda function. + """ + foundation_model: str | None = ... + """The foundation model to use.""" + additional_model_request_fields: Document | None = ... + """ + If the Converse or ConverseStream operations support the model, + `additionalModelRequestFields` contains additional inference parameters, + beyond the base set of inference parameters in the + `inferenceConfiguration` field. + + For more information, see *Inference request parameters and response + fields for foundation models* in the Amazon Bedrock user guide. + """ + +@dataclass(kw_only=True) +class PromptCreationConfigurations(_SerdeShape): + """ + Specifies parameters that control how the service populates the agent + prompt for an `InvokeAgent` or `InvokeInlineAgent` request. You can + control which aspects of previous invocations in the same agent session + the service uses to populate the agent prompt. This gives you more + granular control over the contextual history that is used to process the + current request. + """ + + previous_conversation_turns_to_include: int | None = ... + """ + The number of previous conversations from the ongoing agent session to + include in the conversation history of the agent prompt, during the + current invocation. This gives you more granular control over the + context that the model is made aware of, and helps the model remove + older context which is no longer useful during the ongoing agent + session. + """ + exclude_previous_thinking_steps: bool = ... + """ + If `true`, the service removes any content between `` tags + from previous conversations in an agent session. The service will only + remove content from already processed turns. This helps you remove + content which might not be useful for current and subsequent + invocations. This can reduce the input token count and potentially save + costs. The default value is `false`. + """ + +@dataclass(kw_only=True) +class PromptOverrideConfiguration(_SerdeShape): + """ + Contains configurations to override prompts in different parts of an + agent sequence. For more information, see [Advanced + prompts](https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts.html). + """ + + prompt_configurations: list[PromptConfiguration] + """ + Contains configurations to override a prompt template in one part of an + agent sequence. For more information, see [Advanced + prompts](https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts.html). + """ + override_lambda: str | None = ... + """ + The ARN of the Lambda function to use when parsing the raw foundation + model output in parts of the agent sequence. If you specify this field, + at least one of the `promptConfigurations` must contain a `parserMode` + value that is set to `OVERRIDDEN`. For more information, see [Parser + Lambda function in Amazon Bedrock + Agents](https://docs.aws.amazon.com/bedrock/latest/userguide/lambda-parser.html). + """ + +class PromptState(UnknownEnumMixin, StrEnum): + ENABLED = "ENABLED" + DISABLED = "DISABLED" + +@dataclass(kw_only=True) +class PromptTemplate(_SerdeShape): + """ + Contains the template for the prompt that's sent to the model for + response generation. For more information, see [Knowledge base prompt + templates](https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html#kb-test-config-sysprompt). + + This data type is used in the following API operations: + + - [RetrieveAndGenerate + request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_RequestSyntax) + -- in the `filter` field + """ + + text_prompt_template: str | None = ... + """ + The template for the prompt that's sent to the model for response + generation. You can include prompt placeholders, which become replaced + before the prompt is sent to the model to provide instructions and + context to the model. In addition, you can include XML tags to delineate + meaningful sections of the prompt template. + + For more information, see the following resources: + + - [Knowledge base prompt + templates](https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html#kb-test-config-sysprompt) + + - [Use XML tags with Anthropic Claude + models](https://docs.claude.com/en/docs/build-with-claude/prompt-engineering/use-xml-tags) + """ + +class PromptType(UnknownEnumMixin, StrEnum): + PRE_PROCESSING = "PRE_PROCESSING" + ORCHESTRATION = "ORCHESTRATION" + KNOWLEDGE_BASE_RESPONSE_GENERATION = "KNOWLEDGE_BASE_RESPONSE_GENERATION" + POST_PROCESSING = "POST_PROCESSING" + ROUTING_CLASSIFIER = "ROUTING_CLASSIFIER" + +@dataclass(kw_only=True) +class PropertyParameters(_SerdeShape): + """Contains the parameters in the request body.""" + + properties: list[Parameter] | None = ... + """A list of parameters in the request body.""" + +@dataclass(kw_only=True) +class PutInvocationStepInput(_SerdeShape): + """Dataclass for PutInvocationStepInput structure.""" + + session_identifier: str | None = ... + """ + The unique identifier for the session to add the invocation step to. You + can specify either the session's `sessionId` or its Amazon Resource + Name (ARN). + """ + invocation_identifier: str | None = ... + """ + The unique identifier (in UUID format) of the invocation to add the + invocation step to. + """ + invocation_step_time: datetime | None = ... + """The timestamp for when the invocation step occurred.""" + payload: InvocationStepPayload | None = ... + """ + The payload for the invocation step, including text and images for the + interaction. + """ + invocation_step_id: str | None = ... + """The unique identifier of the invocation step in UUID format.""" + +@dataclass(kw_only=True) +class PutInvocationStepOutput(_SerdeShape): + """Dataclass for PutInvocationStepOutput structure.""" + + invocation_step_id: str + """The unique identifier of the invocation step in UUID format.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class QueryGenerationInput(_SerdeShape): + """ + Contains information about a natural language query to transform into + SQL. + """ + + type: str + """The type of the query.""" + text: str + """The text of the query.""" + +@dataclass(kw_only=True) +class QueryTransformationConfiguration(_SerdeShape): + """ + To split up the prompt and retrieve multiple sources, set the + transformation type to `QUERY_DECOMPOSITION`. + """ + + type: str + """The type of transformation to apply to the prompt.""" + +class QueryTransformationMode(UnknownEnumMixin, StrEnum): + TEXT_TO_SQL = "TEXT_TO_SQL" + +class QueryTransformationType(UnknownEnumMixin, StrEnum): + QUERY_DECOMPOSITION = "QUERY_DECOMPOSITION" + +@dataclass(kw_only=True) +class Rationale(_SerdeShape): + """ + Contains the reasoning, based on the input, that the agent uses to + justify carrying out an action group or getting information from a + knowledge base. + """ + + trace_id: str | None = ... + """The unique identifier of the trace step.""" + text: str | None = ... + """The reasoning or thought process of the agent, based on the input.""" + +@dataclass(kw_only=True) +class RawResponse(_SerdeShape): + """Contains the raw output from the foundation model.""" + + content: str | None = ... + """The foundation model's raw output content.""" + +@dataclass +class ReasoningContentBlockReasoningText(_SerdeShape): + """ + Contains information about the reasoning that the model used to return + the content in the content block. + """ + + value: ReasoningTextBlock + +@dataclass +class ReasoningContentBlockRedactedContent(_SerdeShape): + """ + The content in the reasoning that was encrypted by the model provider + for trust and safety reasons. + """ + + value: bytes + +@dataclass +class ReasoningContentBlockUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ReasoningContentBlock = Union[ + ReasoningContentBlockReasoningText + | ReasoningContentBlockRedactedContent + | ReasoningContentBlockUnknown +] +""" +Contains content regarding the reasoning that the foundation model made +with respect to the content in the content block. Reasoning refers to a +Chain of Thought (CoT) that the model generates to enhance the accuracy +of its final response. +""" + +class _ReasoningContentBlockDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> ReasoningContentBlock: ... + +@dataclass(kw_only=True) +class ReasoningTextBlock(_SerdeShape): + """ + Contains information about the reasoning that the model used to return + the content in the content block. + """ + + text: str + """ + Text describing the reasoning that the model used to return the content + in the content block. + """ + signature: str | None = ... + """ + A hash of all the messages in the conversation to ensure that the + content in the reasoning text block isn't tampered with. You must + submit the signature in subsequent `Converse` requests, in addition to + the previous messages. If the previous messages are tampered with, the + response throws an error. + """ + +class RelayConversationHistory(UnknownEnumMixin, StrEnum): + TO_COLLABORATOR = "TO_COLLABORATOR" + DISABLED = "DISABLED" + +@dataclass(kw_only=True) +class RepromptResponse(_SerdeShape): + """Contains details about the agent's response to reprompt the input.""" + + text: str | None = ... + """The text reprompting the input.""" + source: str | None = ... + """Specifies what output is prompting the agent to reprompt the input.""" + +@dataclass(kw_only=True) +class RequestBody(_SerdeShape): + """The parameters in the API request body.""" + + content: dict[str, list[Parameter]] | None = ... + """The content in the request body.""" + +class RequireConfirmation(UnknownEnumMixin, StrEnum): + ENABLED = "ENABLED" + DISABLED = "DISABLED" + +@dataclass(kw_only=True) +class RerankDocument(_SerdeShape): + """ + Contains information about a document to rerank. Choose the `type` to + define and include the field that corresponds to the type. + """ + + type: str + """The type of document to rerank.""" + text_document: RerankTextDocument | None = ... + """Contains information about a text document to rerank.""" + json_document: Document | None = ... + """Contains a JSON document to rerank.""" + +class RerankDocumentType(UnknownEnumMixin, StrEnum): + TEXT = "TEXT" + JSON = "JSON" + +@dataclass(kw_only=True) +class RerankingConfiguration(_SerdeShape): + """Contains configurations for reranking.""" + + type: str + """The type of reranker that the configurations apply to.""" + bedrock_reranking_configuration: BedrockRerankingConfiguration + """Contains configurations for an Amazon Bedrock reranker.""" + +class RerankingConfigurationType(UnknownEnumMixin, StrEnum): + BEDROCK_RERANKING_MODEL = "BEDROCK_RERANKING_MODEL" + +class RerankingMetadataSelectionMode(UnknownEnumMixin, StrEnum): + SELECTIVE = "SELECTIVE" + ALL = "ALL" + +@dataclass +class RerankingMetadataSelectiveModeConfigurationFieldsToInclude(_SerdeShape): + """ + An array of objects, each of which specifies a metadata field to include + in consideration when reranking. The remaining metadata fields are + ignored. + """ + + value: list[FieldForReranking] + +@dataclass +class RerankingMetadataSelectiveModeConfigurationFieldsToExclude(_SerdeShape): + """ + An array of objects, each of which specifies a metadata field to exclude + from consideration when reranking. + """ + + value: list[FieldForReranking] + +@dataclass +class RerankingMetadataSelectiveModeConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +RerankingMetadataSelectiveModeConfiguration = Union[ + RerankingMetadataSelectiveModeConfigurationFieldsToInclude + | RerankingMetadataSelectiveModeConfigurationFieldsToExclude + | RerankingMetadataSelectiveModeConfigurationUnknown +] +""" +Contains configurations for the metadata fields to include or exclude +when considering reranking. If you include the `fieldsToExclude` field, +the reranker ignores all the metadata fields that you specify. If you +include the `fieldsToInclude` field, the reranker uses only the metadata +fields that you specify and ignores all others. You can include only one +of these fields. +""" + +class _RerankingMetadataSelectiveModeConfigurationDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> RerankingMetadataSelectiveModeConfiguration: ... + +class RerankingModelType(UnknownEnumMixin, StrEnum): + CUSTOM = "CUSTOM" + MANAGED = "MANAGED" + NONE = "NONE" + +@dataclass(kw_only=True) +class RerankInput(_SerdeShape): + """Dataclass for RerankInput structure.""" + + queries: list[RerankQuery] | None = ... + """ + An array of objects, each of which contains information about a query to + submit to the reranker model. + """ + sources: list[RerankSource] | None = ... + """ + An array of objects, each of which contains information about the + sources to rerank. + """ + reranking_configuration: RerankingConfiguration | None = ... + """Contains configurations for reranking.""" + next_token: str | None = ... + """ + If the total number of results was greater than could fit in a response, + a token is returned in the `nextToken` field. You can enter that token + in this field to return the next batch of results. + """ + +@dataclass(kw_only=True) +class RerankOutput(_SerdeShape): + """Dataclass for RerankOutput structure.""" + + results: list[RerankResult] + """ + An array of objects, each of which contains information about the + results of reranking. + """ + next_token: str | None = ... + """ + If the total number of results is greater than can fit in the response, + use this token in the `nextToken` field when making another request to + return the next batch of results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class RerankQuery(_SerdeShape): + """Contains information about a query to submit to the reranker model.""" + + type: str + """The type of the query.""" + text_query: RerankTextDocument + """Contains information about a text query.""" + +class RerankQueryContentType(UnknownEnumMixin, StrEnum): + TEXT = "TEXT" + +@dataclass(kw_only=True) +class RerankResult(_SerdeShape): + """Contains information about a document that was reranked.""" + + index: int + """The original index of the document from the input sources array.""" + relevance_score: float + """The relevance score of the document.""" + document: RerankDocument | None = ... + """Contains information about the document.""" + +@dataclass(kw_only=True) +class RerankSource(_SerdeShape): + """Contains information about a source for reranking.""" + + type: str + """The type of the source.""" + inline_document_source: RerankDocument + """Contains an inline definition of a source for reranking.""" + +class RerankSourceType(UnknownEnumMixin, StrEnum): + INLINE = "INLINE" + +@dataclass(kw_only=True) +class RerankTextDocument(_SerdeShape): + """Contains information about a text document to rerank.""" + + text: str | None = ... + """The text of the document.""" + +@dataclass(kw_only=True) +class ResourceNotFoundException(ServiceError, _SerdeShape): + """ + The specified resource Amazon Resource Name (ARN) was not found. Check + the Amazon Resource Name (ARN) and try your request again. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class ResponseState(UnknownEnumMixin, StrEnum): + FAILURE = "FAILURE" + REPROMPT = "REPROMPT" + +@dataclass +class ResponseStreamChunk(_SerdeShape): + """Contains a part of an agent response and citations for it.""" + + value: PayloadPart + +@dataclass +class ResponseStreamTrace(_SerdeShape): + """ + Contains information about the agent and session, alongside the agent's + reasoning process and results from calling actions and querying + knowledge bases and metadata about the trace. You can use the trace to + understand how the agent arrived at the response it provided the + customer. For more information, see [Trace + events](https://docs.aws.amazon.com/bedrock/latest/userguide/trace-events.html). + """ + + value: TracePart + +@dataclass +class ResponseStreamReturnControl(_SerdeShape): + """ + Contains the parameters and information that the agent elicited from the + customer to carry out an action. This information is returned to the + system and can be used in your own setup for fulfilling the action. + """ + + value: ReturnControlPayload + +@dataclass +class ResponseStreamInternalServerException(_SerdeShape): + """An internal server error occurred. Retry your request.""" + + value: InternalServerException + +@dataclass +class ResponseStreamValidationException(_SerdeShape): + """ + Input validation failed. Check your request parameters and retry the + request. + """ + + value: ValidationException + +@dataclass +class ResponseStreamResourceNotFoundException(_SerdeShape): + """ + The specified resource Amazon Resource Name (ARN) was not found. Check + the Amazon Resource Name (ARN) and try your request again. + """ + + value: ResourceNotFoundException + +@dataclass +class ResponseStreamServiceQuotaExceededException(_SerdeShape): + """ + The number of requests exceeds the service quota. Resubmit your request + later. + """ + + value: ServiceQuotaExceededException + +@dataclass +class ResponseStreamThrottlingException(_SerdeShape): + """The number of requests exceeds the limit. Resubmit your request later.""" + + value: ThrottlingException + +@dataclass +class ResponseStreamAccessDeniedException(_SerdeShape): + """ + The request is denied because of missing access permissions. Check your + permissions and retry your request. + """ + + value: AccessDeniedException + +@dataclass +class ResponseStreamConflictException(_SerdeShape): + """ + There was a conflict performing an operation. Resolve the conflict and + retry your request. + """ + + value: ConflictException + +@dataclass +class ResponseStreamDependencyFailedException(_SerdeShape): + """ + There was an issue with a dependency. Check the resource configurations + and retry the request. + """ + + value: DependencyFailedException + +@dataclass +class ResponseStreamBadGatewayException(_SerdeShape): + """ + There was an issue with a dependency due to a server issue. Retry your + request. + """ + + value: BadGatewayException + +@dataclass +class ResponseStreamModelNotReadyException(_SerdeShape): + """ + The model specified in the request is not ready to serve Inference + requests. The AWS SDK will automatically retry the operation up to 5 + times. For information about configuring automatic retries, see [Retry + behavior](https://docs.aws.amazon.com/sdkref/latest/guide/feature-retry-behavior.html) + in the *AWS SDKs and Tools* reference guide. + """ + + value: ModelNotReadyException + +@dataclass +class ResponseStreamFiles(_SerdeShape): + """ + Contains intermediate response for code interpreter if any files have + been generated. + """ + + value: FilePart + +@dataclass +class ResponseStreamUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ResponseStream = Union[ + ResponseStreamChunk + | ResponseStreamTrace + | ResponseStreamReturnControl + | ResponseStreamInternalServerException + | ResponseStreamValidationException + | ResponseStreamResourceNotFoundException + | ResponseStreamServiceQuotaExceededException + | ResponseStreamThrottlingException + | ResponseStreamAccessDeniedException + | ResponseStreamConflictException + | ResponseStreamDependencyFailedException + | ResponseStreamBadGatewayException + | ResponseStreamModelNotReadyException + | ResponseStreamFiles + | ResponseStreamUnknown +] +""" +The response from invoking the agent and associated citations and trace +information. +""" + +class _ResponseStreamDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> ResponseStream: ... + +@dataclass(kw_only=True) +class RetrievalContent(_SerdeShape): + """The content retrieved from a knowledge source.""" + + byte_content: bytes | None = ... + """The binary content of the retrieved item.""" + text: str | None = ... + """The text content of the retrieved item.""" + mime_type: str + """The MIME type of the retrieved content.""" + +@dataclass +class RetrievalFilterEquals(_SerdeShape): + """ + Knowledge base data sources are returned if they contain a metadata + attribute whose name matches the `key` and whose value matches the + `value` in this object. + + The following example would return data sources with an `animal` + attribute whose value is `cat`: + + `"equals": { "key": "animal", "value": "cat" }` + """ + + value: FilterAttribute + +@dataclass +class RetrievalFilterNotEquals(_SerdeShape): + """ + Knowledge base data sources are returned when: + + - It contains a metadata attribute whose name matches the `key` and + whose value doesn't match the `value` in this object. + + - The key is not present in the document. + + The following example would return data sources that don't contain an + `animal` attribute whose value is `cat`. + + `"notEquals": { "key": "animal", "value": "cat" }` + """ + + value: FilterAttribute + +@dataclass +class RetrievalFilterGreaterThan(_SerdeShape): + """ + Knowledge base data sources are returned if they contain a metadata + attribute whose name matches the `key` and whose value is greater than + the `value` in this object. + + The following example would return data sources with an `year` attribute + whose value is greater than `1989`: + + `"greaterThan": { "key": "year", "value": 1989 }` + """ + + value: FilterAttribute + +@dataclass +class RetrievalFilterGreaterThanOrEquals(_SerdeShape): + """ + Knowledge base data sources are returned if they contain a metadata + attribute whose name matches the `key` and whose value is greater than + or equal to the `value` in this object. + + The following example would return data sources with an `year` attribute + whose value is greater than or equal to `1989`: + + `"greaterThanOrEquals": { "key": "year", "value": 1989 }` + """ + + value: FilterAttribute + +@dataclass +class RetrievalFilterLessThan(_SerdeShape): + """ + Knowledge base data sources are returned if they contain a metadata + attribute whose name matches the `key` and whose value is less than the + `value` in this object. + + The following example would return data sources with an `year` attribute + whose value is less than to `1989`. + + `"lessThan": { "key": "year", "value": 1989 }` + """ + + value: FilterAttribute + +@dataclass +class RetrievalFilterLessThanOrEquals(_SerdeShape): + """ + Knowledge base data sources are returned if they contain a metadata + attribute whose name matches the `key` and whose value is less than or + equal to the `value` in this object. + + The following example would return data sources with an `year` attribute + whose value is less than or equal to `1989`. + + `"lessThanOrEquals": { "key": "year", "value": 1989 }` + """ + + value: FilterAttribute + +@dataclass +class RetrievalFilterIn(_SerdeShape): + """ + Knowledge base data sources are returned if they contain a metadata + attribute whose name matches the `key` and whose value is in the list + specified in the `value` in this object. + + The following example would return data sources with an `animal` + attribute that is either `cat` or `dog`: + + `"in": { "key": "animal", "value": ["cat", "dog"] }` + """ + + value: FilterAttribute + +@dataclass +class RetrievalFilterNotIn(_SerdeShape): + """ + Knowledge base data sources are returned if they contain a metadata + attribute whose name matches the `key` and whose value isn't in the + list specified in the `value` in this object. + + The following example would return data sources whose `animal` attribute + is neither `cat` nor `dog`. + + `"notIn": { "key": "animal", "value": ["cat", "dog"] }` + """ + + value: FilterAttribute + +@dataclass +class RetrievalFilterStartsWith(_SerdeShape): + """ + Knowledge base data sources are returned if they contain a metadata + attribute whose name matches the `key` and whose value starts with the + `value` in this object. This filter is currently only supported for + Amazon OpenSearch Serverless vector stores. + + The following example would return data sources with an `animal` + attribute starts with `ca` (for example, `cat` or `camel`). + + `"startsWith": { "key": "animal", "value": "ca" }` + """ + + value: FilterAttribute + +@dataclass +class RetrievalFilterListContains(_SerdeShape): + """ + Knowledge base data sources are returned if they contain a metadata + attribute whose name matches the `key` and whose value is a list that + contains the `value` as one of its members. + + The following example would return data sources with an `animals` + attribute that is a list containing a `cat` member (for example + `["dog", "cat"]`). + + `"listContains": { "key": "animals", "value": "cat" }` + """ + + value: FilterAttribute + +@dataclass +class RetrievalFilterStringContains(_SerdeShape): + """ + Knowledge base data sources are returned if they contain a metadata + attribute whose name matches the `key` and whose value is one of the + following: + + - A string that contains the `value` as a substring. The following + example would return data sources with an `animal` attribute that + contains the substring `at` (for example `cat`). + + `"stringContains": { "key": "animal", "value": "at" }` + + - A list with a member that contains the `value` as a substring. The + following example would return data sources with an `animals` + attribute that is a list containing a member that contains the + substring `at` (for example `["dog", "cat"]`). + + `"stringContains": { "key": "animals", "value": "at" }` + """ + + value: FilterAttribute + +@dataclass +class RetrievalFilterAndAll(_SerdeShape): + """ + Knowledge base data sources are returned if their metadata attributes + fulfill all the filter conditions inside this list. + """ + + value: list[RetrievalFilter] + +@dataclass +class RetrievalFilterOrAll(_SerdeShape): + """ + Knowledge base data sources are returned if their metadata attributes + fulfill at least one of the filter conditions inside this list. + """ + + value: list[RetrievalFilter] + +@dataclass +class RetrievalFilterUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +RetrievalFilter = Union[ + RetrievalFilterEquals + | RetrievalFilterNotEquals + | RetrievalFilterGreaterThan + | RetrievalFilterGreaterThanOrEquals + | RetrievalFilterLessThan + | RetrievalFilterLessThanOrEquals + | RetrievalFilterIn + | RetrievalFilterNotIn + | RetrievalFilterStartsWith + | RetrievalFilterListContains + | RetrievalFilterStringContains + | RetrievalFilterAndAll + | RetrievalFilterOrAll + | RetrievalFilterUnknown +] +""" +Specifies the filters to use on the metadata attributes in the knowledge +base data sources before returning results. For more information, see +[Query +configurations](https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html). +See the examples below to see how to use these filters. + +This data type is used in the following API operations: + +- [Retrieve + request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_RequestSyntax) + -- in the `filter` field + +- [RetrieveAndGenerate + request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_RequestSyntax) + -- in the `filter` field +""" + +class _RetrievalFilterDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> RetrievalFilter: ... + +@dataclass(kw_only=True) +class RetrievalOverrides(_SerdeShape): + """Overrides for retrieval behavior.""" + + filter: RetrievalFilter | None = ... + """A filter to apply to the retrieval results.""" + max_number_of_results: int | None = ... + """The maximum number of results to return.""" + +@dataclass(kw_only=True) +class RetrievalResultConfluenceLocation(_SerdeShape): + """The Confluence data source location.""" + + url: str | None = ... + """The Confluence host URL for the data source location.""" + +@dataclass(kw_only=True) +class RetrievalResultContent(_SerdeShape): + """ + Contains information about a chunk of text from a data source in the + knowledge base. If the result is from a structured data source, the cell + in the database and the type of the value is also identified. + + This data type is used in the following API operations: + + - [Retrieve + response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax) + -- in the `content` field + + - [RetrieveAndGenerate + response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax) + -- in the `content` field + + - [InvokeAgent + response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax) + -- in the `content` field + """ + + type: str | None = ... + """The type of content in the retrieval result.""" + text: str = ... + """The cited text from the data source.""" + byte_content: str | None = ... + """ + A data URI with base64-encoded content from the data source. The URI is + in the following format: returned in the following format: + `data:image/jpeg;base64,${base64-encoded string}`. + """ + video: VideoSegment | None = ... + """ + Video segment information when the retrieval result contains video + content. + """ + audio: AudioSegment | None = ... + """ + Audio segment information when the retrieval result contains audio + content. + """ + row: list[RetrievalResultContentColumn] | None = ... + """ + Specifies information about the rows with the cells to return in + retrieval. + """ + +@dataclass(kw_only=True) +class RetrievalResultContentColumn(_SerdeShape): + """Contains information about a column with a cell to return in retrieval.""" + + column_name: str | None = ... + """The name of the column.""" + column_value: str | None = ... + """The value in the column.""" + type: str | None = ... + """The data type of the value.""" + +class RetrievalResultContentColumnType(UnknownEnumMixin, StrEnum): + BLOB = "BLOB" + BOOLEAN = "BOOLEAN" + DOUBLE = "DOUBLE" + NULL = "NULL" + LONG = "LONG" + STRING = "STRING" + +class RetrievalResultContentType(UnknownEnumMixin, StrEnum): + TEXT = "TEXT" + IMAGE = "IMAGE" + ROW = "ROW" + AUDIO = "AUDIO" + VIDEO = "VIDEO" + +@dataclass(kw_only=True) +class RetrievalResultCustomDocumentLocation(_SerdeShape): + """ + Contains information about the location of a document in a custom data + source. + """ + + id: str | None = ... + """The ID of the document.""" + +@dataclass(kw_only=True) +class RetrievalResultGoogleDriveLocation(_SerdeShape): + """The Google Drive location of a retrieval result.""" + + url: str | None = ... + """The Google Drive URL for the data source location.""" + +@dataclass(kw_only=True) +class RetrievalResultKendraDocumentLocation(_SerdeShape): + """The location of a result in Amazon Kendra.""" + + uri: str | None = ... + """The document's uri.""" + +@dataclass(kw_only=True) +class RetrievalResultLocation(_SerdeShape): + """ + Contains information about the data source location. + + This data type is used in the following API operations: + + - [Retrieve + response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax) + -- in the `location` field + + - [RetrieveAndGenerate + response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax) + -- in the `location` field + + - [InvokeAgent + response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax) + -- in the `location` field + """ + + type: str + """The type of data source location.""" + s3_location: RetrievalResultS3Location | None = ... + """The S3 data source location.""" + web_location: RetrievalResultWebLocation | None = ... + """The web URL/URLs data source location.""" + confluence_location: RetrievalResultConfluenceLocation | None = ... + """The Confluence data source location.""" + salesforce_location: RetrievalResultSalesforceLocation | None = ... + """The Salesforce data source location.""" + share_point_location: RetrievalResultSharePointLocation | None = ... + """The SharePoint data source location.""" + custom_document_location: RetrievalResultCustomDocumentLocation | None = ... + """Specifies the location of a document in a custom data source.""" + kendra_document_location: RetrievalResultKendraDocumentLocation | None = ... + """The location of a document in Amazon Kendra.""" + sql_location: RetrievalResultSqlLocation | None = ... + """Specifies information about the SQL query used to retrieve the result.""" + one_drive_location: RetrievalResultOneDriveLocation | None = ... + """The Microsoft OneDrive data source location.""" + google_drive_location: RetrievalResultGoogleDriveLocation | None = ... + """The Google Drive data source location.""" + +class RetrievalResultLocationType(UnknownEnumMixin, StrEnum): + S3 = "S3" + WEB = "WEB" + CONFLUENCE = "CONFLUENCE" + SALESFORCE = "SALESFORCE" + SHAREPOINT = "SHAREPOINT" + CUSTOM = "CUSTOM" + KENDRA = "KENDRA" + SQL = "SQL" + ONEDRIVE = "ONEDRIVE" + GOOGLEDRIVE = "GOOGLEDRIVE" + +@dataclass(kw_only=True) +class RetrievalResultOneDriveLocation(_SerdeShape): + """The Microsoft OneDrive location of a retrieval result.""" + + url: str | None = ... + """The OneDrive URL for the data source location.""" + +@dataclass(kw_only=True) +class RetrievalResultS3Location(_SerdeShape): + """ + The S3 data source location. + + This data type is used in the following API operations: + + - [Retrieve + response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax) + -- in the `s3Location` field + + - [RetrieveAndGenerate + response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax) + -- in the `s3Location` field + + - [InvokeAgent + response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax) + -- in the `s3Location` field + """ + + uri: str | None = ... + """The S3 URI for the data source location.""" + +@dataclass(kw_only=True) +class RetrievalResultSalesforceLocation(_SerdeShape): + """The Salesforce data source location.""" + + url: str | None = ... + """The Salesforce host URL for the data source location.""" + +@dataclass(kw_only=True) +class RetrievalResultSharePointLocation(_SerdeShape): + """The SharePoint data source location.""" + + url: str | None = ... + """The SharePoint site URL for the data source location.""" + +@dataclass(kw_only=True) +class RetrievalResultSqlLocation(_SerdeShape): + """Contains information about the SQL query used to retrieve the result.""" + + query: str | None = ... + """The SQL query used to retrieve the result.""" + +@dataclass(kw_only=True) +class RetrievalResultWebLocation(_SerdeShape): + """The web URL/URLs data source location.""" + + url: str | None = ... + """The web URL/URLs for the data source location.""" + +@dataclass(kw_only=True) +class RetrieveAndGenerateConfiguration(_SerdeShape): + """ + Contains details about the resource being queried. + + This data type is used in the following API operations: + + - [RetrieveAndGenerate + request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_RequestSyntax) + -- in the `retrieveAndGenerateConfiguration` field + """ + + type: str + """ + The type of resource that contains your data for retrieving information + and generating responses. + + Note: + If you choose to use `EXTERNAL_SOURCES`, then currently only Anthropic + Claude 3 Sonnet models for knowledge bases are supported. + """ + knowledge_base_configuration: ( + KnowledgeBaseRetrieveAndGenerateConfiguration | None + ) = ... + """ + Contains details about the knowledge base for retrieving information and + generating responses. + """ + external_sources_configuration: ( + ExternalSourcesRetrieveAndGenerateConfiguration | None + ) = ... + """ + The configuration for the external source wrapper object in the + `retrieveAndGenerate` function. + """ + +@dataclass(kw_only=True) +class RetrieveAndGenerateInput(_SerdeShape): + """ + Contains the query made to the knowledge base. + + This data type is used in the following API operations: + + - [RetrieveAndGenerate + request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_RequestSyntax) + -- in the `input` field + """ + + text: str + """The query made to the knowledge base, in characters.""" + +@dataclass(kw_only=True) +class RetrieveAndGenerateOperationInput(_SerdeShape): + """Dataclass for RetrieveAndGenerateOperationInput structure.""" + + session_id: str | None = ... + """ + The unique identifier of the session. When you first make a + `RetrieveAndGenerate` request, Amazon Bedrock automatically generates + this value. You must reuse this value for all subsequent requests in the + same conversational session. This value allows Amazon Bedrock to + maintain context and knowledge from previous interactions. You can't + explicitly set the `sessionId` yourself. + """ + input: RetrieveAndGenerateInput | None = ... + """Contains the query to be made to the knowledge base.""" + retrieve_and_generate_configuration: RetrieveAndGenerateConfiguration | None = ... + """ + Contains configurations for the knowledge base query and retrieval + process. For more information, see [Query + configurations](https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html). + """ + session_configuration: RetrieveAndGenerateSessionConfiguration | None = ... + """Contains details about the session with the knowledge base.""" + user_context: UserContext | None = ... + """ + Contains information about the user making the request. This is used for + access control filtering to ensure that retrieval results only include + documents the user is authorized to access. + """ + +@dataclass(kw_only=True) +class RetrieveAndGenerateOperationOutput(_SerdeShape): + """Dataclass for RetrieveAndGenerateOperationOutput structure.""" + + session_id: str + """ + The unique identifier of the session. When you first make a + `RetrieveAndGenerate` request, Amazon Bedrock automatically generates + this value. You must reuse this value for all subsequent requests in the + same conversational session. This value allows Amazon Bedrock to + maintain context and knowledge from previous interactions. You can't + explicitly set the `sessionId` yourself. + """ + output: RetrieveAndGenerateOutput + """Contains the response generated from querying the knowledge base.""" + citations: list[Citation] | None = ... + """ + A list of segments of the generated response that are based on sources + in the knowledge base, alongside information about the sources. + """ + guardrail_action: str | None = ... + """Specifies if there is a guardrail intervention in the response.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class RetrieveAndGenerateOutput(_SerdeShape): + """ + Contains the response generated from querying the knowledge base. + + This data type is used in the following API operations: + + - [RetrieveAndGenerate + response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax) + -- in the `output` field + """ + + text: str + """The response generated from querying the knowledge base.""" + +@dataclass(kw_only=True) +class RetrieveAndGenerateOutputEvent(_SerdeShape): + """A retrieve and generate output event.""" + + text: str + """A text response.""" + +@dataclass(kw_only=True) +class RetrieveAndGenerateSessionConfiguration(_SerdeShape): + """ + Contains configuration about the session with the knowledge base. + + This data type is used in the following API operations: + + - [RetrieveAndGenerate + request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_RequestSyntax) + -- in the `sessionConfiguration` field + """ + + kms_key_arn: str + """The ARN of the KMS key encrypting the session.""" + +@dataclass(kw_only=True) +class RetrieveAndGenerateStreamInput(_SerdeShape): + """Dataclass for RetrieveAndGenerateStreamInput structure.""" + + session_id: str | None = ... + """ + The unique identifier of the session. When you first make a + `RetrieveAndGenerate` request, Amazon Bedrock automatically generates + this value. You must reuse this value for all subsequent requests in the + same conversational session. This value allows Amazon Bedrock to + maintain context and knowledge from previous interactions. You can't + explicitly set the `sessionId` yourself. + """ + input: RetrieveAndGenerateInput | None = ... + """Contains the query to be made to the knowledge base.""" + retrieve_and_generate_configuration: RetrieveAndGenerateConfiguration | None = ... + """ + Contains configurations for the knowledge base query and retrieval + process. For more information, see [Query + configurations](https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html). + """ + session_configuration: RetrieveAndGenerateSessionConfiguration | None = ... + """Contains details about the session with the knowledge base.""" + user_context: UserContext | None = ... + """ + Contains information about the user making the request. This is used for + access control filtering to ensure that retrieval results only include + documents the user is authorized to access. + """ + +@dataclass(kw_only=True) +class RetrieveAndGenerateStreamOutput(_SerdeShape): + """Dataclass for RetrieveAndGenerateStreamOutput structure.""" + + session_id: str + """The session ID.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass +class RetrieveAndGenerateStreamResponseOutputOutput(_SerdeShape): + """An output event.""" + + value: RetrieveAndGenerateOutputEvent + +@dataclass +class RetrieveAndGenerateStreamResponseOutputCitation(_SerdeShape): + """A citation event.""" + + value: CitationEvent + +@dataclass +class RetrieveAndGenerateStreamResponseOutputGuardrail(_SerdeShape): + """A guardrail event.""" + + value: GuardrailEvent + +@dataclass +class RetrieveAndGenerateStreamResponseOutputInternalServerException(_SerdeShape): + """An internal server error occurred. Retry your request.""" + + value: InternalServerException + +@dataclass +class RetrieveAndGenerateStreamResponseOutputValidationException(_SerdeShape): + """ + The input fails to satisfy the constraints specified by *Amazon + Bedrock*. For troubleshooting this error, see + [ValidationError](https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-validation-error) + in the Amazon Bedrock User Guide. + """ + + value: ValidationException + +@dataclass +class RetrieveAndGenerateStreamResponseOutputResourceNotFoundException(_SerdeShape): + """ + The specified resource ARN was not found. For troubleshooting this + error, see + [ResourceNotFound](https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-resource-not-found) + in the Amazon Bedrock User Guide. + """ + + value: ResourceNotFoundException + +@dataclass +class RetrieveAndGenerateStreamResponseOutputServiceQuotaExceededException(_SerdeShape): + """ + Your request exceeds the service quota for your account. You can view + your quotas at [Viewing service + quotas](https://docs.aws.amazon.com/servicequotas/latest/userguide/gs-request-quota.html). + You can resubmit your request later. + """ + + value: ServiceQuotaExceededException + +@dataclass +class RetrieveAndGenerateStreamResponseOutputThrottlingException(_SerdeShape): + """ + Your request was denied due to exceeding the account quotas for *Amazon + Bedrock*. For troubleshooting this error, see + [ThrottlingException](https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-throttling-exception) + in the Amazon Bedrock User Guide. + """ + + value: ThrottlingException + +@dataclass +class RetrieveAndGenerateStreamResponseOutputAccessDeniedException(_SerdeShape): + """ + The request is denied because you do not have sufficient permissions to + perform the requested action. For troubleshooting this error, see + [AccessDeniedException](https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-access-denied) + in the Amazon Bedrock User Guide. + """ + + value: AccessDeniedException + +@dataclass +class RetrieveAndGenerateStreamResponseOutputConflictException(_SerdeShape): + """Error occurred because of a conflict while performing an operation.""" + + value: ConflictException + +@dataclass +class RetrieveAndGenerateStreamResponseOutputDependencyFailedException(_SerdeShape): + """The request failed due to a dependency error.""" + + value: DependencyFailedException + +@dataclass +class RetrieveAndGenerateStreamResponseOutputBadGatewayException(_SerdeShape): + """The request failed due to a bad gateway error.""" + + value: BadGatewayException + +@dataclass +class RetrieveAndGenerateStreamResponseOutputUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +RetrieveAndGenerateStreamResponseOutput = Union[ + RetrieveAndGenerateStreamResponseOutputOutput + | RetrieveAndGenerateStreamResponseOutputCitation + | RetrieveAndGenerateStreamResponseOutputGuardrail + | RetrieveAndGenerateStreamResponseOutputInternalServerException + | RetrieveAndGenerateStreamResponseOutputValidationException + | RetrieveAndGenerateStreamResponseOutputResourceNotFoundException + | RetrieveAndGenerateStreamResponseOutputServiceQuotaExceededException + | RetrieveAndGenerateStreamResponseOutputThrottlingException + | RetrieveAndGenerateStreamResponseOutputAccessDeniedException + | RetrieveAndGenerateStreamResponseOutputConflictException + | RetrieveAndGenerateStreamResponseOutputDependencyFailedException + | RetrieveAndGenerateStreamResponseOutputBadGatewayException + | RetrieveAndGenerateStreamResponseOutputUnknown +] +"""A retrieve and generate stream response output.""" + +class _RetrieveAndGenerateStreamResponseOutputDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> RetrieveAndGenerateStreamResponseOutput: ... + +class RetrieveAndGenerateType(UnknownEnumMixin, StrEnum): + KNOWLEDGE_BASE = "KNOWLEDGE_BASE" + EXTERNAL_SOURCES = "EXTERNAL_SOURCES" + +@dataclass(kw_only=True) +class RetrievedReference(_SerdeShape): + """ + Contains metadata about a source cited for the generated response. + + This data type is used in the following API operations: + + - [RetrieveAndGenerate + response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax) + -- in the `retrievedReferences` field + + - [InvokeAgent + response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax) + -- in the `retrievedReferences` field + """ + + content: RetrievalResultContent | None = ... + """Contains the cited text from the data source.""" + location: RetrievalResultLocation | None = ... + """Contains information about the location of the data source.""" + metadata: dict[str, Document] | None = ... + """ + Contains metadata attributes and their values for the file in the data + source. For more information, see [Metadata and + filtering](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-ds.html#kb-ds-metadata). + """ + +@dataclass(kw_only=True) +class RetrieveInput(_SerdeShape): + """Dataclass for RetrieveInput structure.""" + + knowledge_base_id: str | None = ... + """The unique identifier of the knowledge base to query.""" + retrieval_query: KnowledgeBaseQuery | None = ... + """Contains the query to send the knowledge base.""" + retrieval_configuration: KnowledgeBaseRetrievalConfiguration | None = ... + """ + Contains configurations for the knowledge base query and retrieval + process. For more information, see [Query + configurations](https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html). + """ + guardrail_configuration: GuardrailConfiguration | None = ... + """Guardrail settings.""" + next_token: str | None = ... + """ + If there are more results than can fit in the response, the response + returns a `nextToken`. Use this token in the `nextToken` field of + another request to retrieve the next batch of results. + """ + user_context: UserContext | None = ... + """ + Contains information about the user making the request. This is used for + access control filtering to ensure that retrieval results only include + documents the user is authorized to access. + """ + +@dataclass(kw_only=True) +class RetrieveOutput(_SerdeShape): + """Dataclass for RetrieveOutput structure.""" + + retrieval_results: list[KnowledgeBaseRetrievalResult] + """A list of results from querying the knowledge base.""" + guardrail_action: str | None = ... + """Specifies if there is a guardrail intervention in the response.""" + next_token: str | None = ... + """ + If there are more results than can fit in the response, the response + returns a `nextToken`. Use this token in the `nextToken` field of + another request to retrieve the next batch of results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass +class RetrieverConfigurationKnowledgeBase(_SerdeShape): + """Configuration for a knowledge base retriever.""" + + value: KnowledgeBaseRetrieverConfiguration + +@dataclass +class RetrieverConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +RetrieverConfiguration = Union[ + RetrieverConfigurationKnowledgeBase | RetrieverConfigurationUnknown +] +"""Configuration for a retriever, specified as a union of retriever types.""" + +class _RetrieverConfigurationDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> RetrieverConfiguration: ... + +@dataclass(kw_only=True) +class ReturnControlPayload(_SerdeShape): + """ + Contains information to return from the action group that the agent has + predicted to invoke. + + This data type is used in the following API operations: + + - [InvokeAgent + response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax) + """ + + invocation_inputs: list[InvocationInputMember] | None = ... + """ + A list of objects that contain information about the parameters and + inputs that need to be sent into the API operation or function, based on + what the agent determines from its session with the user. + """ + invocation_id: str | None = ... + """The identifier of the action group invocation.""" + +@dataclass(kw_only=True) +class ReturnControlResults(_SerdeShape): + """An action invocation result.""" + + invocation_id: str | None = ... + """The action's invocation ID.""" + return_control_invocation_results: list[InvocationResultMember] | None = ... + """The action invocation result.""" + +@dataclass(kw_only=True) +class RoutingClassifierModelInvocationOutput(_SerdeShape): + """Invocation output from a routing classifier model.""" + + trace_id: str | None = ... + """The invocation's trace ID.""" + raw_response: RawResponse | None = ... + """The invocation's raw response.""" + metadata: Metadata | None = ... + """The invocation's metadata.""" + +@dataclass +class RoutingClassifierTraceInvocationInput(_SerdeShape): + """The classifier's invocation input.""" + + value: InvocationInput + +@dataclass +class RoutingClassifierTraceObservation(_SerdeShape): + """The classifier's observation.""" + + value: Observation + +@dataclass +class RoutingClassifierTraceModelInvocationInput(_SerdeShape): + """The classifier's model invocation input.""" + + value: ModelInvocationInput + +@dataclass +class RoutingClassifierTraceModelInvocationOutput(_SerdeShape): + """The classifier's model invocation output.""" + + value: RoutingClassifierModelInvocationOutput + +@dataclass +class RoutingClassifierTraceUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +RoutingClassifierTrace = Union[ + RoutingClassifierTraceInvocationInput + | RoutingClassifierTraceObservation + | RoutingClassifierTraceModelInvocationInput + | RoutingClassifierTraceModelInvocationOutput + | RoutingClassifierTraceUnknown +] +"""A trace for a routing classifier.""" + +class _RoutingClassifierTraceDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> RoutingClassifierTrace: ... + +@dataclass(kw_only=True) +class S3Identifier(_SerdeShape): + """The identifier information for an Amazon S3 bucket.""" + + s3_bucket_name: str | None = ... + """The name of the S3 bucket.""" + s3_object_key: str | None = ... + """The S3 object key for the S3 resource.""" + +@dataclass(kw_only=True) +class S3Location(_SerdeShape): + """Information about the Amazon S3 bucket where the image is stored.""" + + uri: str + """The path to the Amazon S3 bucket where the image is stored.""" + +@dataclass(kw_only=True) +class S3ObjectDoc(_SerdeShape): + """The unique wrapper object of the document from the S3 location.""" + + uri: str + """The file location of the S3 wrapper object.""" + +@dataclass(kw_only=True) +class S3ObjectFile(_SerdeShape): + """Contains details of the s3 object where the source file is located.""" + + uri: str + """The uri of the s3 object.""" + +@dataclass(kw_only=True) +class SatisfiedCondition(_SerdeShape): + """ + Represents a condition that was satisfied during a condition node + evaluation in a flow execution. + + Note: + Flow executions is in preview release for Amazon Bedrock and is subject + to change. + """ + + condition_name: str + """The name of the condition that was satisfied.""" + +class SearchType(UnknownEnumMixin, StrEnum): + HYBRID = "HYBRID" + SEMANTIC = "SEMANTIC" + +@dataclass(kw_only=True) +class ServiceQuotaExceededException(ServiceError, _SerdeShape): + """ + The number of requests exceeds the service quota. Resubmit your request + later. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class SessionState(_SerdeShape): + """ + Contains parameters that specify various attributes that persist across + a session or prompt. You can define session state attributes as + key-value pairs when writing a [Lambda + function](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-lambda.html) + for an action group or pass them when making an + [InvokeAgent](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html) + request. Use session state attributes to control and provide + conversational context for your agent and to help customize your + agent's behavior. For more information, see [Control session + context](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-session-state.html). + """ + + session_attributes: dict[str, str] | None = ... + """ + Contains attributes that persist across a session and the values of + those attributes. If `sessionAttributes` are passed to a supervisor + agent in [multi-agent + collaboration](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-multi-agent-collaboration.html), + it will be forwarded to all agent collaborators. + """ + prompt_session_attributes: dict[str, str] | None = ... + """ + Contains attributes that persist across a prompt and the values of those + attributes. + + - In orchestration prompt template, these attributes replace the + $prompt_session_attributes$ placeholder variable. For more + information, see [Prompt template placeholder + variables](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-placeholders.html). + + - In [multi-agent + collaboration](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-multi-agent-collaboration.html), + the `promptSessionAttributes` will only be used by supervisor agent + when $prompt_session_attributes$ is present in prompt template. + """ + return_control_invocation_results: list[InvocationResultMember] | None = ... + """ + Contains information about the results from the action group invocation. + For more information, see [Return control to the agent + developer](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-returncontrol.html) + and [Control session + context](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-session-state.html). + + Note: + If you include this field, the `inputText` field will be ignored. + """ + invocation_id: str | None = ... + """ + The identifier of the invocation of an action. This value must match the + `invocationId` returned in the `InvokeAgent` response for the action + whose results are provided in the `returnControlInvocationResults` + field. For more information, see [Return control to the agent + developer](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-returncontrol.html) + and [Control session + context](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-session-state.html). + """ + files: list[InputFile] | None = ... + """Contains information about the files used by code interpreter.""" + knowledge_base_configurations: list[KnowledgeBaseConfiguration] | None = ... + """ + An array of configurations, each of which applies to a knowledge base + attached to the agent. + """ + conversation_history: ConversationHistory | None = ... + """The state's conversation history.""" + +class SessionStatus(UnknownEnumMixin, StrEnum): + ACTIVE = "ACTIVE" + EXPIRED = "EXPIRED" + ENDED = "ENDED" + +@dataclass(kw_only=True) +class SessionSummary(_SerdeShape): + """ + Contains details about a session. For more information about sessions, + see [Store and retrieve conversation history and context with Amazon + Bedrock + sessions](https://docs.aws.amazon.com/bedrock/latest/userguide/sessions.html). + """ + + session_id: str + """The unique identifier for the session.""" + session_arn: str + """The Amazon Resource Name (ARN) of the session.""" + session_status: str + """The current status of the session.""" + created_at: datetime + """The timestamp for when the session was created.""" + last_updated_at: datetime + """The timestamp for when the session was last modified.""" + +class Source(UnknownEnumMixin, StrEnum): + ACTION_GROUP = "ACTION_GROUP" + KNOWLEDGE_BASE = "KNOWLEDGE_BASE" + PARSER = "PARSER" + +@dataclass(kw_only=True) +class Span(_SerdeShape): + """ + Contains information about where the text with a citation begins and + ends in the generated output. + + This data type is used in the following API operations: + + - [RetrieveAndGenerate + response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax) + -- in the `span` field + + - [InvokeAgent + response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax) + -- in the `span` field + """ + + start: int | None = ... + """Where the text with a citation starts in the generated output.""" + end: int | None = ... + """Where the text with a citation ends in the generated output.""" + +@dataclass(kw_only=True) +class StartFlowExecutionInput(_SerdeShape): + """Dataclass for StartFlowExecutionInput structure.""" + + flow_identifier: str | None = ... + """The unique identifier of the flow to execute.""" + flow_alias_identifier: str | None = ... + """The unique identifier of the flow alias to use for the flow execution.""" + flow_execution_name: str | None = ... + """ + The unique name for the flow execution. If you don't provide one, a + system-generated name is used. + """ + inputs: list[FlowInput] | None = ... + """ + The input data required for the flow execution. This must match the + input schema defined in the flow. + """ + model_performance_configuration: ModelPerformanceConfiguration | None = ... + """ + The performance settings for the foundation model used in the flow + execution. + """ + +@dataclass(kw_only=True) +class StartFlowExecutionOutput(_SerdeShape): + """Dataclass for StartFlowExecutionOutput structure.""" + + execution_arn: str | None = ... + """ + The Amazon Resource Name (ARN) that uniquely identifies the flow + execution. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class StopFlowExecutionInput(_SerdeShape): + """Dataclass for StopFlowExecutionInput structure.""" + + flow_identifier: str | None = ... + """The unique identifier of the flow.""" + flow_alias_identifier: str | None = ... + """The unique identifier of the flow alias used for the execution.""" + execution_identifier: str | None = ... + """The unique identifier of the flow execution to stop.""" + +@dataclass(kw_only=True) +class StopFlowExecutionOutput(_SerdeShape): + """Dataclass for StopFlowExecutionOutput structure.""" + + execution_arn: str | None = ... + """ + The Amazon Resource Name (ARN) that uniquely identifies the flow + execution that was stopped. + """ + status: str + """ + The updated status of the flow execution after the stop request. This + will typically be ABORTED if the execution was successfully stopped. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class StreamingConfigurations(_SerdeShape): + """Configurations for streaming.""" + + stream_final_response: bool = ... + """ + Specifies whether to enable streaming for the final response. This is + set to `false` by default. + """ + apply_guardrail_interval: int | None = ... + """ + The guardrail interval to apply as response is generated. By default, + the guardrail interval is set to 50 characters. If a larger interval is + specified, the response will be generated in larger chunks with fewer + `ApplyGuardrail` calls. The following examples show the response + generated for *Hello, I am an agent* input string. + + **Example response in chunks: Interval set to 3 characters** + + `'Hel', 'lo, ','I am', ' an', ' Age', 'nt'` + + Each chunk has at least 3 characters except for the last chunk + + **Example response in chunks: Interval set to 20 or more characters** + + `Hello, I am an Agent` + """ + +@dataclass(kw_only=True) +class TagResourceInput(_SerdeShape): + """Dataclass for TagResourceInput structure.""" + + resource_arn: str | None = ... + """The Amazon Resource Name (ARN) of the resource to tag.""" + tags: dict[str, str] | None = ... + """ + An object containing key-value pairs that define the tags to attach to + the resource. + """ + +@dataclass(kw_only=True) +class TagResourceOutput(_SerdeShape): + """Dataclass for TagResourceOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class TextInferenceConfig(_SerdeShape): + """ + Configuration settings for text generation using a language model via + the RetrieveAndGenerate operation. Includes parameters like temperature, + top-p, maximum token count, and stop sequences. + + Note: + The valid range of `maxTokens` depends on the accepted values for your + chosen model's inference parameters. To see the inference parameters + for your model, see [Inference parameters for foundation + models.](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html) + """ + + temperature: float | None = ... + """ + Controls the random-ness of text generated by the language model, + influencing how much the model sticks to the most predictable next words + versus exploring more surprising options. A lower temperature value + (e.g. 0.2 or 0.3) makes model outputs more deterministic or predictable, + while a higher temperature (e.g. 0.8 or 0.9) makes the outputs more + creative or unpredictable. + """ + top_p: float | None = ... + """ + A probability distribution threshold which controls what the model + considers for the set of possible next tokens. The model will only + consider the top p% of the probability distribution when generating the + next token. + """ + max_tokens: int | None = ... + """ + The maximum number of tokens to generate in the output text. Do not use + the minimum of 0 or the maximum of 65536. The limit values described + here are arbitary values, for actual values consult the limits defined + by your specific model. + """ + stop_sequences: list[str] | None = ... + """ + A list of sequences of characters that, if generated, will cause the + model to stop generating further tokens. Do not use a minimum length of + 1 or a maximum length of 1000. The limit values described here are + arbitary values, for actual values consult the limits defined by your + specific model. + """ + +@dataclass(kw_only=True) +class TextPrompt(_SerdeShape): + """Contains information about the text prompt to optimize.""" + + text: str + """The text in the text prompt to optimize.""" + +@dataclass(kw_only=True) +class TextResponsePart(_SerdeShape): + """ + Contains the part of the generated text that contains a citation, + alongside where it begins and ends. + + This data type is used in the following API operations: + + - [RetrieveAndGenerate + response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html#API_agent-runtime_RetrieveAndGenerate_ResponseSyntax) + -- in the `textResponsePart` field + + - [InvokeAgent + response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html#API_agent-runtime_InvokeAgent_ResponseSyntax) + -- in the `textResponsePart` field + """ + + text: str | None = ... + """The part of the generated text that contains a citation.""" + span: Span | None = ... + """ + Contains information about where the text with a citation begins and + ends in the generated output. + """ + +@dataclass(kw_only=True) +class TextToSqlConfiguration(_SerdeShape): + """Contains configurations for transforming text to SQL.""" + + type: str + """The type of resource to use in transformation.""" + knowledge_base_configuration: TextToSqlKnowledgeBaseConfiguration | None = ... + """Specifies configurations for a knowledge base to use in transformation.""" + +class TextToSqlConfigurationType(UnknownEnumMixin, StrEnum): + KNOWLEDGE_BASE = "KNOWLEDGE_BASE" + +@dataclass(kw_only=True) +class TextToSqlKnowledgeBaseConfiguration(_SerdeShape): + """Contains configurations for a knowledge base to use in transformation.""" + + knowledge_base_arn: str + """The ARN of the knowledge base""" + +@dataclass(kw_only=True) +class ThrottlingException(ServiceError, _SerdeShape): + """The number of requests exceeds the limit. Resubmit your request later.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass +class TraceGuardrailTrace(_SerdeShape): + """The trace details for a trace defined in the Guardrail filter.""" + + value: GuardrailTrace + +@dataclass +class TracePreProcessingTrace(_SerdeShape): + """ + Details about the pre-processing step, in which the agent contextualizes + and categorizes user inputs. + """ + + value: PreProcessingTrace + +@dataclass +class TraceOrchestrationTrace(_SerdeShape): + """ + Details about the orchestration step, in which the agent determines the + order in which actions are executed and which knowledge bases are + retrieved. + """ + + value: OrchestrationTrace + +@dataclass +class TracePostProcessingTrace(_SerdeShape): + """ + Details about the post-processing step, in which the agent shapes the + response.. + """ + + value: PostProcessingTrace + +@dataclass +class TraceRoutingClassifierTrace(_SerdeShape): + """A routing classifier's trace.""" + + value: RoutingClassifierTrace + +@dataclass +class TraceFailureTrace(_SerdeShape): + """Contains information about the failure of the interaction.""" + + value: FailureTrace + +@dataclass +class TraceCustomOrchestrationTrace(_SerdeShape): + """ + Details about the custom orchestration step in which the agent + determines the order in which actions are executed. + """ + + value: CustomOrchestrationTrace + +@dataclass +class TraceUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +Trace = Union[ + TraceGuardrailTrace + | TracePreProcessingTrace + | TraceOrchestrationTrace + | TracePostProcessingTrace + | TraceRoutingClassifierTrace + | TraceFailureTrace + | TraceCustomOrchestrationTrace + | TraceUnknown +] +""" +Contains one part of the agent's reasoning process and results from +calling API actions and querying knowledge bases. You can use the trace +to understand how the agent arrived at the response it provided the +customer. For more information, see [Trace +enablement](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-test.html#trace-enablement). +""" + +class _TraceDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> Trace: ... + +@dataclass +class TraceElementsAgentTraces(_SerdeShape): + """Agent trace information for the flow execution.""" + + value: list[TracePart] + +@dataclass +class TraceElementsUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +TraceElements = Union[TraceElementsAgentTraces | TraceElementsUnknown] +"""Contains trace elements for flow execution tracking.""" + +class _TraceElementsDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> TraceElements: ... + +@dataclass(kw_only=True) +class TracePart(_SerdeShape): + """ + Contains information about the agent and session, alongside the agent's + reasoning process and results from calling API actions and querying + knowledge bases and metadata about the trace. You can use the trace to + understand how the agent arrived at the response it provided the + customer. For more information, see [Trace + enablement](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-test.html#trace-enablement). + """ + + session_id: str | None = ... + """The unique identifier of the session with the agent.""" + trace: Trace | None = ... + """ + Contains one part of the agent's reasoning process and results from + calling API actions and querying knowledge bases. You can use the trace + to understand how the agent arrived at the response it provided the + customer. For more information, see [Trace + enablement](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-test.html#trace-enablement). + """ + caller_chain: list[Caller] | None = ... + """The part's caller chain.""" + event_time: datetime | None = ... + """The time of the trace.""" + collaborator_name: str | None = ... + """The part's collaborator name.""" + agent_id: str | None = ... + """The unique identifier of the agent.""" + agent_alias_id: str | None = ... + """The unique identifier of the alias of the agent.""" + agent_version: str | None = ... + """The version of the agent.""" + +@dataclass(kw_only=True) +class TransformationConfiguration(_SerdeShape): + """ + Contains configurations for transforming the natural language query into + SQL. + """ + + mode: str + """The mode of the transformation.""" + text_to_sql_configuration: TextToSqlConfiguration | None = ... + """Specifies configurations for transforming text to SQL.""" + +class Type(UnknownEnumMixin, StrEnum): + ACTION_GROUP = "ACTION_GROUP" + AGENT_COLLABORATOR = "AGENT_COLLABORATOR" + KNOWLEDGE_BASE = "KNOWLEDGE_BASE" + FINISH = "FINISH" + ASK_USER = "ASK_USER" + REPROMPT = "REPROMPT" + +@dataclass(kw_only=True) +class UntagResourceInput(_SerdeShape): + """Dataclass for UntagResourceInput structure.""" + + resource_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the resource from which to remove + tags. + """ + tag_keys: list[str] | None = ... + """A list of keys of the tags to remove from the resource.""" + +@dataclass(kw_only=True) +class UntagResourceOutput(_SerdeShape): + """Dataclass for UntagResourceOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateSessionInput(_SerdeShape): + """Dataclass for UpdateSessionInput structure.""" + + session_metadata: dict[str, str] | None = ... + """ + A map of key-value pairs containing attributes to be persisted across + the session. For example the user's ID, their language preference, and + the type of device they are using. + """ + session_identifier: str | None = ... + """ + The unique identifier of the session to modify. You can specify either + the session's `sessionId` or its Amazon Resource Name (ARN). + """ + +@dataclass(kw_only=True) +class UpdateSessionOutput(_SerdeShape): + """Dataclass for UpdateSessionOutput structure.""" + + session_id: str + """The unique identifier of the session you updated.""" + session_arn: str + """The Amazon Resource Name (ARN) of the session that was updated.""" + session_status: str + """The status of the session you updated.""" + created_at: datetime + """The timestamp for when the session was created.""" + last_updated_at: datetime + """The timestamp for when the session was last modified.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class Usage(_SerdeShape): + """Contains information of the usage of the foundation model.""" + + input_tokens: int | None = ... + """ + Contains information about the input tokens from the foundation model + usage. + """ + output_tokens: int | None = ... + """ + Contains information about the output tokens from the foundation model + usage. + """ + +@dataclass(kw_only=True) +class UserContext(_SerdeShape): + """ + Contains information about the user making the request. Use this to pass + user identity information for access control filtering, so that + retrieval results only include documents the user is authorized to + access. + """ + + user_id: str + """The identifier of the user making the retrieval request.""" + +@dataclass(kw_only=True) +class ValidationException(ServiceError, _SerdeShape): + """ + Input validation failed. Check your request parameters and retry the + request. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class VectorSearchBedrockRerankingConfiguration(_SerdeShape): + """ + Contains configurations for reranking with an Amazon Bedrock reranker + model. + """ + + model_configuration: VectorSearchBedrockRerankingModelConfiguration + """Contains configurations for the reranker model.""" + number_of_reranked_results: int | None = ... + """The number of results to return after reranking.""" + metadata_configuration: MetadataConfigurationForReranking | None = ... + """Contains configurations for the metadata to use in reranking.""" + +@dataclass(kw_only=True) +class VectorSearchBedrockRerankingModelConfiguration(_SerdeShape): + """Contains configurations for an Amazon Bedrock reranker model.""" + + model_arn: str + """The ARN of the reranker model to use.""" + additional_model_request_fields: dict[str, Document] | None = ... + """ + A JSON object whose keys are request fields for the model and whose + values are values for those fields. + """ + +@dataclass(kw_only=True) +class VectorSearchRerankingConfiguration(_SerdeShape): + """Contains configurations for reranking the retrieved results.""" + + type: str + """The type of reranker model.""" + bedrock_reranking_configuration: ( + VectorSearchBedrockRerankingConfiguration | None + ) = ... + """Contains configurations for an Amazon Bedrock reranker model.""" + +class VectorSearchRerankingConfigurationType(UnknownEnumMixin, StrEnum): + BEDROCK_RERANKING_MODEL = "BEDROCK_RERANKING_MODEL" + +@dataclass(kw_only=True) +class VideoSegment(_SerdeShape): + """ + Contains information about a video segment retrieved from a knowledge + base, including its location and summary. + + This data type is used in the following API operations: + + - [Retrieve + response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Retrieve.html#API_agent-runtime_Retrieve_ResponseSyntax) + -- in the `video` field + """ + + s3_uri: str + """ + The S3 URI where this specific video segment is stored in the multimodal + storage destination. + """ + summary: str | None = ... + """A text summary describing the content of the video segment.""" + +AGENTIC_RETRIEVE_STREAM: APIOperation[ + AgenticRetrieveStreamInput, AgenticRetrieveStreamOutput +] +CHECK_INGESTED_DOCUMENT_ACL: APIOperation[ + CheckIngestedDocumentAclInput, CheckIngestedDocumentAclOutput +] +CREATE_INVOCATION: APIOperation[CreateInvocationInput, CreateInvocationOutput] +CREATE_SESSION: APIOperation[CreateSessionInput, CreateSessionOutput] +DELETE_AGENT_MEMORY: APIOperation[DeleteAgentMemoryInput, DeleteAgentMemoryOutput] +DELETE_SESSION: APIOperation[DeleteSessionInput, DeleteSessionOutput] +END_SESSION: APIOperation[EndSessionInput, EndSessionOutput] +GENERATE_QUERY: APIOperation[GenerateQueryInput, GenerateQueryOutput] +GET_AGENT_MEMORY: APIOperation[GetAgentMemoryInput, GetAgentMemoryOutput] +GET_DOCUMENT_CONTENT: APIOperation[GetDocumentContentInput, GetDocumentContentOutput] +GET_EXECUTION_FLOW_SNAPSHOT: APIOperation[ + GetExecutionFlowSnapshotInput, GetExecutionFlowSnapshotOutput +] +GET_FLOW_EXECUTION: APIOperation[GetFlowExecutionInput, GetFlowExecutionOutput] +GET_INGESTED_DOCUMENT_ACL: APIOperation[ + GetIngestedDocumentAclInput, GetIngestedDocumentAclOutput +] +GET_INVOCATION_STEP: APIOperation[GetInvocationStepInput, GetInvocationStepOutput] +GET_SESSION: APIOperation[GetSessionInput, GetSessionOutput] +INVOKE_AGENT: APIOperation[InvokeAgentInput, InvokeAgentOutput] +INVOKE_FLOW: APIOperation[InvokeFlowInput, InvokeFlowOutput] +INVOKE_INLINE_AGENT: APIOperation[InvokeInlineAgentInput, InvokeInlineAgentOutput] +LIST_FLOW_EXECUTION_EVENTS: APIOperation[ + ListFlowExecutionEventsInput, ListFlowExecutionEventsOutput +] +LIST_FLOW_EXECUTIONS: APIOperation[ListFlowExecutionsInput, ListFlowExecutionsOutput] +LIST_INVOCATIONS: APIOperation[ListInvocationsInput, ListInvocationsOutput] +LIST_INVOCATION_STEPS: APIOperation[ListInvocationStepsInput, ListInvocationStepsOutput] +LIST_SESSIONS: APIOperation[ListSessionsInput, ListSessionsOutput] +LIST_TAGS_FOR_RESOURCE: APIOperation[ + ListTagsForResourceInput, ListTagsForResourceOutput +] +OPTIMIZE_PROMPT: APIOperation[OptimizePromptInput, OptimizePromptOutput] +PUT_INVOCATION_STEP: APIOperation[PutInvocationStepInput, PutInvocationStepOutput] +RERANK: APIOperation[RerankInput, RerankOutput] +RETRIEVE: APIOperation[RetrieveInput, RetrieveOutput] +RETRIEVE_AND_GENERATE: APIOperation[ + RetrieveAndGenerateOperationInput, RetrieveAndGenerateOperationOutput +] +RETRIEVE_AND_GENERATE_STREAM: APIOperation[ + RetrieveAndGenerateStreamInput, RetrieveAndGenerateStreamOutput +] +START_FLOW_EXECUTION: APIOperation[StartFlowExecutionInput, StartFlowExecutionOutput] +STOP_FLOW_EXECUTION: APIOperation[StopFlowExecutionInput, StopFlowExecutionOutput] +TAG_RESOURCE: APIOperation[TagResourceInput, TagResourceOutput] +UNTAG_RESOURCE: APIOperation[UntagResourceInput, UntagResourceOutput] +UPDATE_SESSION: APIOperation[UpdateSessionInput, UpdateSessionOutput] diff --git a/clients/aws-sdk-bedrock-agent/scripts/docs/generate_doc_stubs.py b/clients/aws-sdk-bedrock-agent/scripts/docs/generate_doc_stubs.py index 52d470bc..795f2e4b 100644 --- a/clients/aws-sdk-bedrock-agent/scripts/docs/generate_doc_stubs.py +++ b/clients/aws-sdk-bedrock-agent/scripts/docs/generate_doc_stubs.py @@ -126,7 +126,9 @@ class ClientInfo: class DocStubGenerator: """Generate markdown API Reference stubs for AWS SDK for Python v4 clients.""" - def __init__(self, client_dir: Path, output_dir: Path, service_name: str | None = None) -> None: + def __init__( + self, client_dir: Path, output_dir: Path, service_name: str | None = None + ) -> None: """ Initialize the documentation generator. @@ -190,7 +192,9 @@ def _analyze_client_package(self, package_name: str) -> ClientInfo: required = ("client", "config", "models") missing = [name for name in required if not package.modules.get(name)] if missing: - raise ValueError(f"Missing required modules in {package_name}: {', '.join(missing)}") + raise ValueError( + f"Missing required modules in {package_name}: {', '.join(missing)}" + ) # Parse submodules client_module = package.modules["client"] @@ -199,11 +203,15 @@ def _analyze_client_package(self, package_name: str) -> ClientInfo: client_class = self._find_class_with_suffix(client_module, "Client") if not client_class: - raise ValueError(f"No class ending with 'Client' found in {package_name}.client") + raise ValueError( + f"No class ending with 'Client' found in {package_name}.client" + ) config_class = self._find_class_with_suffix(config_module, "Config") if not config_class: - raise ValueError(f"No class ending with 'Config' found in {package_name}.config") + raise ValueError( + f"No class ending with 'Config' found in {package_name}.config" + ) plugin_alias = config_module.members.get("Plugin") if not plugin_alias: @@ -288,7 +296,9 @@ def _analyze_operation(self, operation: Function) -> OperationInfo: if output_type in stream_type_map: stream_type = stream_type_map[output_type] - stream_args = self._get_subscript_elements(returns, f"'{operation.name}' stream type") + stream_args = self._get_subscript_elements( + returns, f"'{operation.name}' stream type" + ) if stream_type in (StreamType.INPUT, StreamType.DUPLEX): event_input_type = stream_args[0].canonical_name @@ -316,7 +326,9 @@ def _analyze_operation(self, operation: Function) -> OperationInfo: def _get_expr(self, annotation: str | Expr | None, context: str) -> Expr: """Extract and validate an Expr from an annotation.""" if not isinstance(annotation, Expr): - raise TypeError(f"{context}: expected Expr, got {type(annotation).__name__}") + raise TypeError( + f"{context}: expected Expr, got {type(annotation).__name__}" + ) return annotation def _get_subscript_elements(self, expr: Expr, context: str) -> list[Expr]: @@ -330,7 +342,9 @@ def _get_subscript_elements(self, expr: Expr, context: str) -> list[Expr]: return [el for el in slice_expr.elements if isinstance(el, Expr)] return [slice_expr] - def _extract_models(self, models_module: Module, operations: list[OperationInfo]) -> ModelsInfo: + def _extract_models( + self, models_module: Module, operations: list[OperationInfo] + ) -> ModelsInfo: """Extract structures, unions, enums, and errors from models module.""" structures, unions, enums, errors = [], [], [], [] @@ -356,14 +370,16 @@ def _extract_models(self, models_module: Module, operations: list[OperationInfo] duplicates = [] for structure in structures: - if self._is_operation_io_type(structure.name, operations) or self._is_union_member( - structure.name, unions - ): + if self._is_operation_io_type( + structure.name, operations + ) or self._is_union_member(structure.name, unions): duplicates.append(structure) structures = [struct for struct in structures if struct not in duplicates] - return ModelsInfo(structures=structures, unions=unions, enums=enums, errors=errors) + return ModelsInfo( + structures=structures, unions=unions, enums=enums, errors=errors + ) def _is_union(self, member: Object | Alias) -> TypeGuard[Attribute]: """Check if a module member is a union type.""" @@ -399,7 +415,9 @@ def _extract_union_members( for name in member_names: if not (member_object := models_module.members.get(name)): raise ValueError(f"Union member '{name}' not found in models module") - members.append(TypeInfo(name=member_object.name, module_path=member_object.path)) + members.append( + TypeInfo(name=member_object.name, module_path=member_object.path) + ) return members @@ -408,7 +426,8 @@ def _is_enum(self, member: Object | Alias) -> TypeGuard[Class]: if not isinstance(member, Class): return False return any( - isinstance(base, ExprName) and base.name in ENUM_BASE_CLASSES for base in member.bases + isinstance(base, ExprName) and base.name in ENUM_BASE_CLASSES + for base in member.bases ) def _is_error(self, member: Object | Alias) -> TypeGuard[Class]: @@ -416,10 +435,13 @@ def _is_error(self, member: Object | Alias) -> TypeGuard[Class]: if not isinstance(member, Class): return False return any( - isinstance(base, ExprName) and base.name in ERROR_BASE_CLASSES for base in member.bases + isinstance(base, ExprName) and base.name in ERROR_BASE_CLASSES + for base in member.bases ) - def _is_operation_io_type(self, type_name: str, operations: list[OperationInfo]) -> bool: + def _is_operation_io_type( + self, type_name: str, operations: list[OperationInfo] + ) -> bool: """Check if a type is used as operation input/output.""" return any(type_name in (op.input.name, op.output.name) for op in operations) @@ -437,8 +459,12 @@ def _generate_client_docs(self, client_info: ClientInfo) -> bool: self._generate_type_stubs( client_info.models.structures, "structures", "Structure Class" ) - self._generate_type_stubs(client_info.models.errors, "errors", "Error Class") - self._generate_type_stubs(client_info.models.enums, "enums", "Enum Class", members=True) + self._generate_type_stubs( + client_info.models.errors, "errors", "Error Class" + ) + self._generate_type_stubs( + client_info.models.enums, "enums", "Enum Class", members=True + ) self._generate_union_stubs(client_info.models.unions) except OSError as e: logger.error(f"Failed to write documentation files: {e}") @@ -470,7 +496,9 @@ def _generate_index(self, client_info: ClientInfo) -> None: ] for method in sorted(client_info.client_methods, key=lambda x: x.name): - lines.extend([*self._mkdocs_directive(method.module_path, heading_level=4), ""]) + lines.extend( + [*self._mkdocs_directive(method.module_path, heading_level=4), ""] + ) # Operations section if client_info.operations: @@ -578,7 +606,9 @@ def _generate_operation_stubs(self, operations: list[OperationInfo]) -> None: output_path = self.output_dir / "operations" / f"{op.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb("Operations", op.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb("Operations", op.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(operations)} operation file(s)") @@ -600,7 +630,9 @@ def _generate_type_stubs( output_path = self.output_dir / category / f"{item.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb(category.title(), item.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb(category.title(), item.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(items)} {category} file(s)") @@ -624,7 +656,9 @@ def _generate_union_stubs(self, unions: list[UnionInfo]) -> None: output_path = self.output_dir / "unions" / f"{union.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb("Unions", union.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb("Unions", union.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(unions)} union file(s)") diff --git a/clients/aws-sdk-bedrock-agent/src/aws_sdk_bedrock_agent/_private/schemas.py b/clients/aws-sdk-bedrock-agent/src/aws_sdk_bedrock_agent/_private/schemas.py index 4497bb84..d56a61ad 100644 --- a/clients/aws-sdk-bedrock-agent/src/aws_sdk_bedrock_agent/_private/schemas.py +++ b/clients/aws-sdk-bedrock-agent/src/aws_sdk_bedrock_agent/_private/schemas.py @@ -2,11167 +2,9994 @@ from types import MappingProxyType -from smithy_core.prelude import BOOLEAN, DOCUMENT, INTEGER, PRIMITIVE_LONG, STRING, UNIT -from smithy_core.schemas import Schema -from smithy_core.shapes import ShapeID, ShapeType -from smithy_core.traits import Trait +from smithy_core._schema_compact import StaticOperationSchema, StaticSchema + + +n0 = "com.amazonaws.bedrockagent" +_ACA = "AccessControlAccess" +_ALLOW = "ALLOW" +_sV = "smithy.api#enumValue" +_DENY = "DENY" +_ACPT = "AccessControlPrincipalType" +_USER = "USER" +_NBS = "NonBlankString" +_ADE = "AccessDeniedException" +_s = "smithy.api#error" +_c = "client" +_sE = "smithy.api#httpError" +_m = "message" +_CCM = "CustomControlMethod" +_RC = "RETURN_CONTROL" +_LA = "LambdaArn" +_AGE = "ActionGroupExecutor" +_l = "lambda" +_cC = "customControl" +_CE = "ConflictException" +_N = "Name" +_AGS = "ActionGroupState" +_ENABLED = "ENABLED" +_DISABLED = "DISABLED" +_I = "Id" +_DV = "DraftVersion" +_P = "Payload" +_sm = "smithy.api#sensitive" +_SBN = "S3BucketName" +_SOK = "S3ObjectKey" +_SI = "S3Identifier" +_sBN = "s3BucketName" +_sOK = "s3ObjectKey" +_APIS = "APISchema" +_s_ = "s3" +_p = "payload" +_CT = "ClientToken" +_D = "Description" +_FD = "FunctionDescription" +_PD = "ParameterDescription" +_T = "Type" +_STRING = "STRING" +_st = "string" +_NUMBER = "NUMBER" +_n = "number" +_INTEGER = "INTEGER" +_i = "integer" +_BOOLEAN = "BOOLEAN" +_b = "boolean" +_ARRAY = "ARRAY" +_a = "array" +_PDa = "ParameterDetail" +_d = "description" +_t = "type" +_smi = "smithy.api#required" +_r = "required" +_PM = "ParameterMap" +_k = "key" +_v = "value" +_RCe = "RequireConfirmation" +_F = "Function" +_na = "name" +_pa = "parameters" +_rC = "requireConfirmation" +_Fu = "Functions" +_me = "member" +_FS = "FunctionSchema" +_f = "functions" +_AGSc = "ActionGroupSignature" +_AU = "AMAZON_USERINPUT" +_AMAZONUI = "AMAZON.UserInput" +_AC = "AMAZON_CODEINTERPRETER" +_AMAZONCI = "AMAZON.CodeInterpreter" +_AC_ = "ANTHROPIC_COMPUTER" +_ANTHROPICC = "ANTHROPIC.Computer" +_AB = "ANTHROPIC_BASH" +_ANTHROPICB = "ANTHROPIC.Bash" +_AT = "ANTHROPIC_TEXTEDITOR" +_ANTHROPICTE = "ANTHROPIC.TextEditor" +_AGSP = "ActionGroupSignatureParams" +_CAAGI = "CreateAgentActionGroupInput" +_sSI = "smithy.synthetic#originalShapeId" +_cCAAGR = "com.amazonaws.bedrockagent#CreateAgentActionGroupRequest" +_smit = "smithy.api#input" +_aI = "agentId" +_sL = "smithy.api#httpLabel" +_aV = "agentVersion" +_aGN = "actionGroupName" +_cT = "clientToken" +_sT = "smithy.api#idempotencyToken" +_pAGS = "parentActionGroupSignature" +_pAGSP = "parentActionGroupSignatureParams" +_aGE = "actionGroupExecutor" +_aS = "apiSchema" +_aGS = "actionGroupState" +_fS = "functionSchema" +_V = "Version" +_DT = "DateTimestamp" +_sF = "smithy.api#timestampFormat" +_dt = "date-time" +_AAG = "AgentActionGroup" +_aGI = "actionGroupId" +_cA = "createdAt" +_uA = "updatedAt" +_pAS = "parentActionSignature" +_CAAGO = "CreateAgentActionGroupOutput" +_cCAAGRo = "com.amazonaws.bedrockagent#CreateAgentActionGroupResponse" +_smith = "smithy.api#output" +_aAG = "agentActionGroup" +_ISE = "InternalServerException" +_se = "server" +_RNFE = "ResourceNotFoundException" +_SQEE = "ServiceQuotaExceededException" +_TE = "ThrottlingException" +_VEF = "ValidationExceptionField" +_VEFL = "ValidationExceptionFieldList" +_VE = "ValidationException" +_fL = "fieldList" +_CAAG = "CreateAgentActionGroup" +_smithy = "smithy.api#http" +_DAAGI = "DeleteAgentActionGroupInput" +_cDAAGR = "com.amazonaws.bedrockagent#DeleteAgentActionGroupRequest" +_sRIUC = "skipResourceInUseCheck" +_smithya = "smithy.api#default" +_sQ = "smithy.api#httpQuery" +_DAAGO = "DeleteAgentActionGroupOutput" +_cDAAGRo = "com.amazonaws.bedrockagent#DeleteAgentActionGroupResponse" +_DAAG = "DeleteAgentActionGroup" +_GAAGI = "GetAgentActionGroupInput" +_cGAAGR = "com.amazonaws.bedrockagent#GetAgentActionGroupRequest" +_GAAGO = "GetAgentActionGroupOutput" +_cGAAGRo = "com.amazonaws.bedrockagent#GetAgentActionGroupResponse" +_GAAG = "GetAgentActionGroup" +_MR = "MaxResults" +_NT = "NextToken" +_LAAGI = "ListAgentActionGroupsInput" +_cLAAGR = "com.amazonaws.bedrockagent#ListAgentActionGroupsRequest" +_mR = "maxResults" +_nT = "nextToken" +_AGSct = "ActionGroupSummary" +_AGScti = "ActionGroupSummaries" +_LAAGO = "ListAgentActionGroupsOutput" +_cLAAGRo = "com.amazonaws.bedrockagent#ListAgentActionGroupsResponse" +_aGSc = "actionGroupSummaries" +_LAAG = "ListAgentActionGroups" +_UAAGI = "UpdateAgentActionGroupInput" +_cUAAGR = "com.amazonaws.bedrockagent#UpdateAgentActionGroupRequest" +_UAAGO = "UpdateAgentActionGroupOutput" +_cUAAGRo = "com.amazonaws.bedrockagent#UpdateAgentActionGroupResponse" +_UAAG = "UpdateAgentActionGroup" +_AMRFK = "AdditionalModelRequestFieldsKey" +_AMRFV = "AdditionalModelRequestFieldsValue" +_AMRF = "AdditionalModelRequestFields" +_AA = "AgentArn" +_ACg = "AgentCollaboration" +_SUPERVISOR = "SUPERVISOR" +_SR = "SUPERVISOR_ROUTER" +_ARA = "AgentRoleArn" +_AS = "AgentStatus" +_CREATING = "CREATING" +_PREPARING = "PREPARING" +_PREPARED = "PREPARED" +_NP = "NOT_PREPARED" +_DELETING = "DELETING" +_FAILED = "FAILED" +_VERSIONING = "VERSIONING" +_UPDATING = "UPDATING" +_KKA = "KmsKeyArn" +_OE = "OrchestrationExecutor" +_CO = "CustomOrchestration" +_e = "executor" +_FR = "FailureReason" +_FRa = "FailureReasons" +_MI = "ModelIdentifier" +_GI = "GuardrailIdentifier" +_GV = "GuardrailVersion" +_GC = "GuardrailConfiguration" +_gI = "guardrailIdentifier" +_gV = "guardrailVersion" +_STTL = "SessionTTL" +_In = "Instruction" +_MT = "MemoryType" +_SS = "SESSION_SUMMARY" +_EMT = "EnabledMemoryTypes" +_MRS = "MaxRecentSessions" +_SSC = "SessionSummaryConfiguration" +_mRS = "maxRecentSessions" +_SD = "StorageDays" +_MC = "MemoryConfiguration" +_eMT = "enabledMemoryTypes" +_sD = "storageDays" +_sSC = "sessionSummaryConfiguration" +_OT = "OrchestrationType" +_DEFAULT = "DEFAULT" +_CO_ = "CUSTOM_ORCHESTRATION" +_BPT = "BasePromptTemplate" +_ML = "MaximumLength" +_SSt = "StopSequences" +_Te = "Temperature" +_TK = "TopK" +_TP = "TopP" +_IC = "InferenceConfiguration" +_te = "temperature" +_tP = "topP" +_tK = "topK" +_mL = "maximumLength" +_sS = "stopSequences" +_CM = "CreationMode" +_OVERRIDDEN = "OVERRIDDEN" +_PS = "PromptState" +_PT = "PromptType" +_PP = "PRE_PROCESSING" +_ORCHESTRATION = "ORCHESTRATION" +_PP_ = "POST_PROCESSING" +_KBRG = "KNOWLEDGE_BASE_RESPONSE_GENERATION" +_MS = "MEMORY_SUMMARIZATION" +_PC = "PromptConfiguration" +_pT = "promptType" +_pCM = "promptCreationMode" +_pS = "promptState" +_bPT = "basePromptTemplate" +_iC = "inferenceConfiguration" +_pM = "parserMode" +_fM = "foundationModel" +_aMRF = "additionalModelRequestFields" +_PCr = "PromptConfigurations" +_POC = "PromptOverrideConfiguration" +_pC = "promptConfigurations" +_oL = "overrideLambda" +_RA = "RecommendedAction" +_RAe = "RecommendedActions" +_A = "Agent" +_aN = "agentName" +_aA = "agentArn" +_in = "instruction" +_aSg = "agentStatus" +_oT = "orchestrationType" +_cO = "customOrchestration" +_iSTTLIS = "idleSessionTTLInSeconds" +_aRRA = "agentResourceRoleArn" +_cEKA = "customerEncryptionKeyArn" +_pA = "preparedAt" +_fR = "failureReasons" +_rA = "recommendedActions" +_pOC = "promptOverrideConfiguration" +_gC = "guardrailConfiguration" +_mC = "memoryConfiguration" +_aC = "agentCollaboration" +_AAA = "AgentAliasArn" +_PMI = "ProvisionedModelIdentifier" +_AARCLI = "AgentAliasRoutingConfigurationListItem" +_pTr = "provisionedThroughput" +_AARC = "AgentAliasRoutingConfiguration" +_AAHE = "AgentAliasHistoryEvent" +_rCo = "routingConfiguration" +_eD = "endDate" +_sDt = "startDate" +_AAHEg = "AgentAliasHistoryEvents" +_AAI = "AgentAliasId" +_AAS = "AgentAliasStatus" +_DISSOCIATED = "DISSOCIATED" +_AIS = "AliasInvocationState" +_AI = "ACCEPT_INVOCATIONS" +_RI = "REJECT_INVOCATIONS" +_AAg = "AgentAlias" +_aAI = "agentAliasId" +_aAN = "agentAliasName" +_aAA = "agentAliasArn" +_aAHE = "agentAliasHistoryEvents" +_aAS = "agentAliasStatus" +_aIS = "aliasInvocationState" +_AASg = "AgentAliasSummary" +_AASge = "AgentAliasSummaries" +_AD = "AgentDescriptor" +_aAl = "aliasArn" +_CI = "CollaborationInstruction" +_RCH = "RelayConversationHistory" +_TC = "TO_COLLABORATOR" +_ACge = "AgentCollaborator" +_aD = "agentDescriptor" +_cI = "collaboratorId" +_cIo = "collaborationInstruction" +_cN = "collaboratorName" +_lUA = "lastUpdatedAt" +_rCH = "relayConversationHistory" +_AACI = "AssociateAgentCollaboratorInput" +_cAACR = "com.amazonaws.bedrockagent#AssociateAgentCollaboratorRequest" +_AACO = "AssociateAgentCollaboratorOutput" +_cAACRo = "com.amazonaws.bedrockagent#AssociateAgentCollaboratorResponse" +_aCg = "agentCollaborator" +_AAC = "AssociateAgentCollaborator" +_DACI = "DisassociateAgentCollaboratorInput" +_cDACR = "com.amazonaws.bedrockagent#DisassociateAgentCollaboratorRequest" +_DACO = "DisassociateAgentCollaboratorOutput" +_cDACRo = "com.amazonaws.bedrockagent#DisassociateAgentCollaboratorResponse" +_DAC = "DisassociateAgentCollaborator" +_GACI = "GetAgentCollaboratorInput" +_cGACR = "com.amazonaws.bedrockagent#GetAgentCollaboratorRequest" +_GACO = "GetAgentCollaboratorOutput" +_cGACRo = "com.amazonaws.bedrockagent#GetAgentCollaboratorResponse" +_GAC = "GetAgentCollaborator" +_LACI = "ListAgentCollaboratorsInput" +_cLACR = "com.amazonaws.bedrockagent#ListAgentCollaboratorsRequest" +_ACS = "AgentCollaboratorSummary" +_ACSg = "AgentCollaboratorSummaries" +_LACO = "ListAgentCollaboratorsOutput" +_cLACRo = "com.amazonaws.bedrockagent#ListAgentCollaboratorsResponse" +_aCS = "agentCollaboratorSummaries" +_LAC = "ListAgentCollaborators" +_UACI = "UpdateAgentCollaboratorInput" +_cUACR = "com.amazonaws.bedrockagent#UpdateAgentCollaboratorRequest" +_UACO = "UpdateAgentCollaboratorOutput" +_cUACRo = "com.amazonaws.bedrockagent#UpdateAgentCollaboratorResponse" +_UAC = "UpdateAgentCollaborator" +_FAAA = "FlowAgentAliasArn" +_AFNC = "AgentFlowNodeConfiguration" +_v_ = "" +_KBS = "KnowledgeBaseState" +_AKB = "AgentKnowledgeBase" +_kBI = "knowledgeBaseId" +_kBS = "knowledgeBaseState" +_AKBS = "AgentKnowledgeBaseSummary" +_AKBSg = "AgentKnowledgeBaseSummaries" +_TKa = "TagKey" +_TV = "TagValue" +_TM = "TagsMap" +_CAI = "CreateAgentInput" +_cCAR = "com.amazonaws.bedrockagent#CreateAgentRequest" +_ta = "tags" +_CAO = "CreateAgentOutput" +_cCARo = "com.amazonaws.bedrockagent#CreateAgentResponse" +_ag = "agent" +_CA = "CreateAgent" +_DAI = "DeleteAgentInput" +_cDAR = "com.amazonaws.bedrockagent#DeleteAgentRequest" +_DAO = "DeleteAgentOutput" +_cDARo = "com.amazonaws.bedrockagent#DeleteAgentResponse" +_DA = "DeleteAgent" +_GAI = "GetAgentInput" +_cGAR = "com.amazonaws.bedrockagent#GetAgentRequest" +_GAO = "GetAgentOutput" +_cGARo = "com.amazonaws.bedrockagent#GetAgentResponse" +_GA = "GetAgent" +_LAI = "ListAgentsInput" +_cLAR = "com.amazonaws.bedrockagent#ListAgentsRequest" +_ASg = "AgentSummary" +_lAV = "latestAgentVersion" +_ASge = "AgentSummaries" +_LAO = "ListAgentsOutput" +_cLARo = "com.amazonaws.bedrockagent#ListAgentsResponse" +_aSge = "agentSummaries" +_LAi = "ListAgents" +_PAI = "PrepareAgentInput" +_cPAR = "com.amazonaws.bedrockagent#PrepareAgentRequest" +_PAO = "PrepareAgentOutput" +_cPARo = "com.amazonaws.bedrockagent#PrepareAgentResponse" +_PA = "PrepareAgent" +_UAI = "UpdateAgentInput" +_cUAR = "com.amazonaws.bedrockagent#UpdateAgentRequest" +_UAO = "UpdateAgentOutput" +_cUARo = "com.amazonaws.bedrockagent#UpdateAgentResponse" +_UA = "UpdateAgent" +_NV = "NumericalVersion" +_AV = "AgentVersion" +_ve = "version" +_AVS = "AgentVersionSummary" +_AVSg = "AgentVersionSummaries" +_CAAI = "CreateAgentAliasInput" +_cCAAR = "com.amazonaws.bedrockagent#CreateAgentAliasRequest" +_CAAO = "CreateAgentAliasOutput" +_cCAARo = "com.amazonaws.bedrockagent#CreateAgentAliasResponse" +_aAg = "agentAlias" +_CAA = "CreateAgentAlias" +_DAAI = "DeleteAgentAliasInput" +_cDAAR = "com.amazonaws.bedrockagent#DeleteAgentAliasRequest" +_DAAO = "DeleteAgentAliasOutput" +_cDAARo = "com.amazonaws.bedrockagent#DeleteAgentAliasResponse" +_DAA = "DeleteAgentAlias" +_GAAI = "GetAgentAliasInput" +_cGAAR = "com.amazonaws.bedrockagent#GetAgentAliasRequest" +_GAAO = "GetAgentAliasOutput" +_cGAARo = "com.amazonaws.bedrockagent#GetAgentAliasResponse" +_GAA = "GetAgentAlias" +_LAAI = "ListAgentAliasesInput" +_cLAAR = "com.amazonaws.bedrockagent#ListAgentAliasesRequest" +_LAAO = "ListAgentAliasesOutput" +_cLAARo = "com.amazonaws.bedrockagent#ListAgentAliasesResponse" +_aASg = "agentAliasSummaries" +_LAA = "ListAgentAliases" +_UAAI = "UpdateAgentAliasInput" +_cUAAR = "com.amazonaws.bedrockagent#UpdateAgentAliasRequest" +_UAAO = "UpdateAgentAliasOutput" +_cUAARo = "com.amazonaws.bedrockagent#UpdateAgentAliasResponse" +_UAA = "UpdateAgentAlias" +_VCD = "VpcConfigurationDescription" +_HH = "HostHeader" +_VCN = "VpcConfigurationName" +_Po = "Port" +_VP = "VpcProtocol" +_HTTP = "HTTP" +_HTTPS = "HTTPS" +_VRM = "VpcResolutionMode" +_PUBLIC = "PUBLIC" +_IV = "IN_VPC" +_RT = "ResourceTarget" +_SIu = "SubnetId" +_SIL = "SubnetIdList" +_TSN = "TlsServerName" +_VI = "VpcId" +_CVCI = "CreateVpcConfigurationInput" +_cCVCR = "com.amazonaws.bedrockagent#CreateVpcConfigurationRequest" +_vI = "vpcId" +_sI = "subnetIds" +_rT = "resourceTarget" +_po = "port" +_pr = "protocol" +_rM = "resolutionMode" +_hH = "hostHeader" +_tSN = "tlsServerName" +_VCS = "VpcConfigurationStatus" +_CREATED = "CREATED" +_CF = "CREATE_FAILED" +_DF = "DELETE_FAILED" +_VCI = "VpcConfigurationId" +_CVCO = "CreateVpcConfigurationOutput" +_cCVCRo = "com.amazonaws.bedrockagent#CreateVpcConfigurationResponse" +_vCI = "vpcConfigurationId" +_sta = "status" +_CVC = "CreateVpcConfiguration" +_DDP = "DataDeletionPolicy" +_RETAIN = "RETAIN" +_DELETE = "DELETE" +_FP = "FilterPattern" +_FL = "FilterList" +_FOT = "FilteredObjectType" +_POF = "PatternObjectFilter" +_oTb = "objectType" +_iF = "inclusionFilters" +_eF = "exclusionFilters" +_POFL = "PatternObjectFilterList" +_POFC = "PatternObjectFilterConfiguration" +_fi = "filters" +_CFCT = "CrawlFilterConfigurationType" +_PATTERN = "PATTERN" +_CFC = "CrawlFilterConfiguration" +_pOF = "patternObjectFilter" +_CCC = "ConfluenceCrawlerConfiguration" +_fC = "filterConfiguration" +_CAT = "ConfluenceAuthType" +_BASIC = "BASIC" +_OCC = "OAUTH2_CLIENT_CREDENTIALS" +_SA = "SecretArn" +_CHT = "ConfluenceHostType" +_SAAS = "SAAS" +_HU = "HttpsUrl" +_CSC = "ConfluenceSourceConfiguration" +_hU = "hostUrl" +_hT = "hostType" +_aT = "authType" +_cSA = "credentialsSecretArn" +_CDSC = "ConfluenceDataSourceConfiguration" +_sC = "sourceConfiguration" +_cCr = "crawlerConfiguration" +_EODS = "EnabledOrDisabledState" +_DPC = "DeletionProtectionConfiguration" +_dPS = "deletionProtectionStatus" +_dPT = "deletionProtectionThreshold" +_AEC = "AudioExtractionConfiguration" +_aES = "audioExtractionStatus" +_IEC = "ImageExtractionConfiguration" +_iES = "imageExtractionStatus" +_VEC = "VideoExtractionConfiguration" +_vES = "videoExtractionStatus" +_MEC = "MediaExtractionConfiguration" +_iEC = "imageExtractionConfiguration" +_aEC = "audioExtractionConfiguration" +_vEC = "videoExtractionConfiguration" +_DS = "DailySchedule" +_DOMN = "DayOfMonthNumber" +_LDOM = "LastDayOfMonth" +_DOM = "DayOfMonth" +_dN = "dayNumber" +_lDOM = "lastDayOfMonth" +_MSo = "MonthlySchedule" +_dOM = "dayOfMonth" +_DOW = "DayOfWeek" +_SUNDAY = "SUNDAY" +_MONDAY = "MONDAY" +_TUESDAY = "TUESDAY" +_WEDNESDAY = "WEDNESDAY" +_THURSDAY = "THURSDAY" +_FRIDAY = "FRIDAY" +_SATURDAY = "SATURDAY" +_WS = "WeeklySchedule" +_dOW = "dayOfWeek" +_SSy = "SyncSchedule" +_da = "daily" +_w = "weekly" +_mo = "monthly" +_MKBCC = "ManagedKnowledgeBaseConnectorConfiguration" +_dPC = "deletionProtectionConfiguration" +_mEC = "mediaExtractionConfiguration" +_cP = "connectorParameters" +_sSy = "syncSchedule" +_SBA = "S3BucketArn" +_BOAI = "BucketOwnerAccountId" +_SP = "S3Prefix" +_SPr = "S3Prefixes" +_SDSC = "S3DataSourceConfiguration" +_bA = "bucketArn" +_iP = "inclusionPrefixes" +_bOAI = "bucketOwnerAccountId" +_SCC = "SalesforceCrawlerConfiguration" +_SAT = "SalesforceAuthType" +_SSCa = "SalesforceSourceConfiguration" +_SDSCa = "SalesforceDataSourceConfiguration" +_SPCC = "SharePointCrawlerConfiguration" +_SPAT = "SharePointAuthType" +_OSAOCC = "OAUTH2_SHAREPOINT_APP_ONLY_CLIENT_CREDENTIALS" +_SPD = "SharePointDomain" +_SPHT = "SharePointHostType" +_ONLINE = "ONLINE" +_SPSU = "SharePointSiteUrls" +_MTI = "Microsoft365TenantId" +_SPSC = "SharePointSourceConfiguration" +_tI = "tenantId" +_do = "domain" +_sU = "siteUrls" +_SPDSC = "SharePointDataSourceConfiguration" +_DST = "DataSourceType" +_S = "S3" +_WEB = "WEB" +_CONFLUENCE = "CONFLUENCE" +_SALESFORCE = "SALESFORCE" +_SHAREPOINT = "SHAREPOINT" +_CUSTOM = "CUSTOM" +_RM = "REDSHIFT_METADATA" +_MKBC = "MANAGED_KNOWLEDGE_BASE_CONNECTOR" +_WCL = "WebCrawlerLimits" +_rL = "rateLimit" +_mP = "maxPages" +_WST = "WebScopeType" +_HO = "HOST_ONLY" +_SUBDOMAINS = "SUBDOMAINS" +_UAs = "UserAgent" +_UAH = "UserAgentHeader" +_WCC = "WebCrawlerConfiguration" +_cL = "crawlerLimits" +_sc = "scope" +_uAs = "userAgent" +_uAH = "userAgentHeader" +_U = "Url" +_SU = "SeedUrl" +_u = "url" +_SUe = "SeedUrls" +_UC = "UrlConfiguration" +_sUe = "seedUrls" +_WSC = "WebSourceConfiguration" +_uC = "urlConfiguration" +_WDSC = "WebDataSourceConfiguration" +_DSC = "DataSourceConfiguration" +_mKBCC = "managedKnowledgeBaseConnectorConfiguration" +_sCo = "s3Configuration" +_wC = "webConfiguration" +_cCo = "confluenceConfiguration" +_sCa = "salesforceConfiguration" +_sPC = "sharePointConfiguration" +_SSEC = "ServerSideEncryptionConfiguration" +_kKA = "kmsKeyArn" +_CS = "ChunkingStrategy" +_FS_ = "FIXED_SIZE" +_NONE = "NONE" +_HIERARCHICAL = "HIERARCHICAL" +_SEMANTIC = "SEMANTIC" +_FSCC = "FixedSizeChunkingConfiguration" +_mT = "maxTokens" +_oP = "overlapPercentage" +_HCLC = "HierarchicalChunkingLevelConfiguration" +_HCLCi = "HierarchicalChunkingLevelConfigurations" +_HCC = "HierarchicalChunkingConfiguration" +_lC = "levelConfigurations" +_oTv = "overlapTokens" +_SCCe = "SemanticChunkingConfiguration" +_bS = "bufferSize" +_bPTr = "breakpointPercentileThreshold" +_CC = "ChunkingConfiguration" +_cS = "chunkingStrategy" +_fSCC = "fixedSizeChunkingConfiguration" +_hCC = "hierarchicalChunkingConfiguration" +_sCC = "semanticChunkingConfiguration" +_ESM = "EnrichmentStrategyMethod" +_CEE = "CHUNK_ENTITY_EXTRACTION" +_ESC = "EnrichmentStrategyConfiguration" +_met = "method" +_BMA = "BedrockModelArn" +_BFMCEC = "BedrockFoundationModelContextEnrichmentConfiguration" +_eSC = "enrichmentStrategyConfiguration" +_mA = "modelArn" +_CET = "ContextEnrichmentType" +_BFM = "BEDROCK_FOUNDATION_MODEL" +_CEC = "ContextEnrichmentConfiguration" +_bFMC = "bedrockFoundationModelConfiguration" +_SBU = "S3BucketUri" +_SL = "S3Location" +_ur = "uri" +_IS = "IntermediateStorage" +_sLo = "s3Location" +_ST = "StepType" +_PC_ = "POST_CHUNKING" +_TLC = "TransformationLambdaConfiguration" +_lA = "lambdaArn" +_TF = "TransformationFunction" +_tLC = "transformationLambdaConfiguration" +_Tr = "Transformation" +_tF = "transformationFunction" +_sTA = "stepToApply" +_Tra = "Transformations" +_CTC = "CustomTransformationConfiguration" +_iS = "intermediateStorage" +_tr = "transformations" +_PMa = "ParsingModality" +_MULTIMODAL = "MULTIMODAL" +_BDAC = "BedrockDataAutomationConfiguration" +_pMa = "parsingModality" +_PPT = "ParsingPromptText" +_PPa = "ParsingPrompt" +_pPT = "parsingPromptText" +_BFMC = "BedrockFoundationModelConfiguration" +_pP = "parsingPrompt" +_PSa = "ParsingStrategy" +_BDA = "BEDROCK_DATA_AUTOMATION" +_SP_ = "SMART_PARSING" +_MME = "MULTI_MODAL_EMBEDDINGS" +_PCa = "ParsingConfiguration" +_pSa = "parsingStrategy" +_bDAC = "bedrockDataAutomationConfiguration" +_VIC = "VectorIngestionConfiguration" +_cCh = "chunkingConfiguration" +_cTC = "customTransformationConfiguration" +_pCa = "parsingConfiguration" +_cEC = "contextEnrichmentConfiguration" +_CDSI = "CreateDataSourceInput" +_cCDSR = "com.amazonaws.bedrockagent#CreateDataSourceRequest" +_dSC = "dataSourceConfiguration" +_dDP = "dataDeletionPolicy" +_sSEC = "serverSideEncryptionConfiguration" +_vIC = "vectorIngestionConfiguration" +_DSS = "DataSourceStatus" +_AVAILABLE = "AVAILABLE" +_DU = "DELETE_UNSUCCESSFUL" +_DSa = "DataSource" +_dSI = "dataSourceId" +_CDSO = "CreateDataSourceOutput" +_cCDSRo = "com.amazonaws.bedrockagent#CreateDataSourceResponse" +_dS = "dataSource" +_CDS = "CreateDataSource" +_DDSI = "DeleteDataSourceInput" +_cDDSR = "com.amazonaws.bedrockagent#DeleteDataSourceRequest" +_DDSO = "DeleteDataSourceOutput" +_cDDSRo = "com.amazonaws.bedrockagent#DeleteDataSourceResponse" +_DDS = "DeleteDataSource" +_GDSI = "GetDataSourceInput" +_cGDSR = "com.amazonaws.bedrockagent#GetDataSourceRequest" +_GDSO = "GetDataSourceOutput" +_cGDSRo = "com.amazonaws.bedrockagent#GetDataSourceResponse" +_GDS = "GetDataSource" +_LDSI = "ListDataSourcesInput" +_cLDSR = "com.amazonaws.bedrockagent#ListDataSourcesRequest" +_DSSa = "DataSourceSummary" +_DSSat = "DataSourceSummaries" +_LDSO = "ListDataSourcesOutput" +_cLDSRo = "com.amazonaws.bedrockagent#ListDataSourcesResponse" +_dSS = "dataSourceSummaries" +_LDS = "ListDataSources" +_UDSI = "UpdateDataSourceInput" +_cUDSR = "com.amazonaws.bedrockagent#UpdateDataSourceRequest" +_UDSO = "UpdateDataSourceOutput" +_cUDSRo = "com.amazonaws.bedrockagent#UpdateDataSourceResponse" +_UDS = "UpdateDataSource" +_RIe = "RevisionId" +_RAes = "ResourceArn" +_DRPI = "DeleteResourcePolicyInput" +_cDRPR = "com.amazonaws.bedrockagent#DeleteResourcePolicyRequest" +_rAe = "resourceArn" +_eRI = "expectedRevisionId" +_DRPO = "DeleteResourcePolicyOutput" +_cDRPRo = "com.amazonaws.bedrockagent#DeleteResourcePolicyResponse" +_rI = "revisionId" +_DRP = "DeleteResourcePolicy" +_DVCI = "DeleteVpcConfigurationInput" +_cDVCR = "com.amazonaws.bedrockagent#DeleteVpcConfigurationRequest" +_DVCO = "DeleteVpcConfigurationOutput" +_cDVCRo = "com.amazonaws.bedrockagent#DeleteVpcConfigurationResponse" +_DVC = "DeleteVpcConfiguration" +_FCN = "FlowConditionName" +_FCCC = "FlowConditionalConnectionConfiguration" +_co = "condition" +_FNON = "FlowNodeOutputName" +_FNIN = "FlowNodeInputName" +_FDCC = "FlowDataConnectionConfiguration" +_sO = "sourceOutput" +_tIa = "targetInput" +_FCC = "FlowConnectionConfiguration" +_dat = "data" +_con = "conditional" +_FCNl = "FlowConnectionName" +_FNN = "FlowNodeName" +_FCT = "FlowConnectionType" +_DATA = "DATA" +_Da = "Data" +_CONDITIONAL = "CONDITIONAL" +_C = "Conditional" +_FC = "FlowConnection" +_so = "source" +_tar = "target" +_conf = "configuration" +_FCl = "FlowConnections" +_CFNC = "CollectorFlowNodeConfiguration" +_FCE = "FlowConditionExpression" +_FClo = "FlowCondition" +_ex = "expression" +_FClow = "FlowConditions" +_CFNCo = "ConditionFlowNodeConfiguration" +_cond = "conditions" +_ICn = "InlineCode" +_SLu = "SupportedLanguages" +_P_ = "PYTHON_3" +_P__ = "Python_3" +_ICFNC = "InlineCodeFlowNodeConfiguration" +_cod = "code" +_la = "language" +_IFNC = "InputFlowNodeConfiguration" +_IFNCt = "IteratorFlowNodeConfiguration" +_PMIC = "PromptModelInferenceConfiguration" +_PIC = "PromptInferenceConfiguration" +_tex = "text" +_FKBI = "FlowKnowledgeBaseId" +_KBMI = "KnowledgeBaseModelIdentifier" +_PCL = "PerformanceConfigLatency" +_STANDARD = "STANDARD" +_stan = "standard" +_OPTIMIZED = "OPTIMIZED" +_o = "optimized" +_PCe = "PerformanceConfiguration" +_lat = "latency" +_KBTP = "KnowledgeBaseTextPrompt" +_KBPT = "KnowledgeBasePromptTemplate" +_tPT = "textPromptTemplate" +_KBOC = "KnowledgeBaseOrchestrationConfiguration" +_pTro = "promptTemplate" +_iCn = "inferenceConfig" +_pCe = "performanceConfig" +_RMSM = "RerankingMetadataSelectionMode" +_SELECTIVE = "SELECTIVE" +_ALL = "ALL" +_FFR = "FieldForReranking" +_fN = "fieldName" +_FFRi = "FieldsForReranking" +_RMSMC = "RerankingMetadataSelectiveModeConfiguration" +_fTI = "fieldsToInclude" +_fTE = "fieldsToExclude" +_MCFR = "MetadataConfigurationForReranking" +_sM = "selectionMode" +_sMC = "selectiveModeConfiguration" +_BRMA = "BedrockRerankingModelArn" +_VSBRMC = "VectorSearchBedrockRerankingModelConfiguration" +_VSBRC = "VectorSearchBedrockRerankingConfiguration" +_mCo = "modelConfiguration" +_nORR = "numberOfRerankedResults" +_mCe = "metadataConfiguration" +_VSRCT = "VectorSearchRerankingConfigurationType" +_BRM = "BEDROCK_RERANKING_MODEL" +_VSRC = "VectorSearchRerankingConfiguration" +_bRC = "bedrockRerankingConfiguration" +_KBFNC = "KnowledgeBaseFlowNodeConfiguration" +_mI = "modelId" +_nOR = "numberOfResults" +_rCe = "rerankingConfiguration" +_oC = "orchestrationConfiguration" +_FLA = "FlowLambdaArn" +_LFFNC = "LambdaFunctionFlowNodeConfiguration" +_FLBAA = "FlowLexBotAliasArn" +_FLBLI = "FlowLexBotLocaleId" +_LFNC = "LexFlowNodeConfiguration" +_bAA = "botAliasArn" +_lI = "localeId" +_LCFNC = "LoopControllerFlowNodeConfiguration" +_cCon = "continueCondition" +_mIa = "maxIterations" +_LIFNC = "LoopInputFlowNodeConfiguration" +_OFNC = "OutputFlowNodeConfiguration" +_FPMI = "FlowPromptModelIdentifier" +_PIVN = "PromptInputVariableName" +_PIV = "PromptInputVariable" +_PIVL = "PromptInputVariablesList" +_CPT = "CachePointType" +_de = "default" +_CPB = "CachePointBlock" +_CB = "ContentBlock" +_cPa = "cachePoint" +_CBo = "ContentBlocks" +_CR = "ConversationRole" +_us = "user" +_ASSISTANT = "ASSISTANT" +_as = "assistant" +_M = "Message" +_ro = "role" +_cont = "content" +_Me = "Messages" +_NES = "NonEmptyString" +_SCB = "SystemContentBlock" +_SCBy = "SystemContentBlocks" +_ATC = "AnyToolChoice" +_ATCu = "AutoToolChoice" +_TN = "ToolName" +_STC = "SpecificToolChoice" +_TCo = "ToolChoice" +_au = "auto" +_an = "any" +_to = "tool" +_TIS = "ToolInputSchema" +_j = "json" +_TS = "ToolSpecification" +_iSn = "inputSchema" +_str = "strict" +_To = "Tool" +_tS = "toolSpec" +_Too = "Tools" +_TCoo = "ToolConfiguration" +_too = "tools" +_tC = "toolChoice" +_CPTC = "ChatPromptTemplateConfiguration" +_mes = "messages" +_sy = "system" +_iV = "inputVariables" +_tCo = "toolConfiguration" +_TPe = "TextPrompt" +_TPTC = "TextPromptTemplateConfiguration" +_PTC = "PromptTemplateConfiguration" +_ch = "chat" +_PTT = "PromptTemplateType" +_TEXT = "TEXT" +_CHAT = "CHAT" +_PFNIC = "PromptFlowNodeInlineConfiguration" +_tT = "templateType" +_tCe = "templateConfiguration" +_FPA = "FlowPromptArn" +_PFNRC = "PromptFlowNodeResourceConfiguration" +_pAr = "promptArn" +_PFNSC = "PromptFlowNodeSourceConfiguration" +_re = "resource" +_inl = "inline" +_PFNC = "PromptFlowNodeConfiguration" +_FSBN = "FlowS3BucketName" +_RFNSC = "RetrievalFlowNodeS3Configuration" +_bN = "bucketName" +_RFNSCe = "RetrievalFlowNodeServiceConfiguration" +_RFNC = "RetrievalFlowNodeConfiguration" +_sCe = "serviceConfiguration" +_SFNSC = "StorageFlowNodeS3Configuration" +_SFNSCt = "StorageFlowNodeServiceConfiguration" +_SFNC = "StorageFlowNodeConfiguration" +_FNIC = "FlowNodeInputCategory" +_LC = "LOOP_CONDITION" +_LCo = "LoopCondition" +_RVTLS = "RETURN_VALUE_TO_LOOP_START" +_RVTLSe = "ReturnValueToLoopStart" +_EL = "EXIT_LOOP" +_ELx = "ExitLoop" +_FNIE = "FlowNodeInputExpression" +_FNIODT = "FlowNodeIODataType" +_St = "String" +_Nu = "Number" +_B = "Boolean" +_OBJECT = "OBJECT" +_O = "Object" +_Ar = "Array" +_FNI = "FlowNodeInput" +_ca = "category" +_FNIl = "FlowNodeInputs" +_FNO = "FlowNodeOutput" +_FNOl = "FlowNodeOutputs" +_FNT = "FlowNodeType" +_INPUT = "INPUT" +_Inp = "Input" +_OUTPUT = "OUTPUT" +_Ou = "Output" +_KB = "KNOWLEDGE_BASE" +_KBn = "KnowledgeBase" +_CONDITION = "CONDITION" +_Co = "Condition" +_LEX = "LEX" +_L = "Lex" +_PROMPT = "PROMPT" +_Pr = "Prompt" +_LF = "LAMBDA_FUNCTION" +_LFa = "LambdaFunction" +_STORAGE = "STORAGE" +_Sto = "Storage" +_AGENT = "AGENT" +_RETRIEVAL = "RETRIEVAL" +_R = "Retrieval" +_ITERATOR = "ITERATOR" +_It = "Iterator" +_COLLECTOR = "COLLECTOR" +_Col = "Collector" +_IC_ = "INLINE_CODE" +_LOOP = "LOOP" +_Lo = "Loop" +_LI = "LOOP_INPUT" +_LIo = "LoopInput" +_LC_ = "LOOP_CONTROLLER" +_LCoo = "LoopController" +_FDl = "FlowDescription" +_FERA = "FlowExecutionRoleArn" +_FN = "FlowName" +_FA = "FlowArn" +_FI = "FlowId" +_FSl = "FlowStatus" +_Fa = "Failed" +_Pre = "Prepared" +_Prep = "Preparing" +_NPo = "NotPrepared" +_FIl = "FlowIdentifier" +_DFI = "DeleteFlowInput" +_cDFR = "com.amazonaws.bedrockagent#DeleteFlowRequest" +_fI = "flowIdentifier" +_DFO = "DeleteFlowOutput" +_cDFRo = "com.amazonaws.bedrockagent#DeleteFlowResponse" +_id = "id" +_DFe = "DeleteFlow" +_CTo = "ConcurrencyType" +_AUTOMATIC = "AUTOMATIC" +_Au = "Automatic" +_MANUAL = "MANUAL" +_Ma = "Manual" +_FACC = "FlowAliasConcurrencyConfiguration" +_mCa = "maxConcurrency" +_FARCLI = "FlowAliasRoutingConfigurationListItem" +_fV = "flowVersion" +_FARC = "FlowAliasRoutingConfiguration" +_CFAI = "CreateFlowAliasInput" +_cCFAR = "com.amazonaws.bedrockagent#CreateFlowAliasRequest" +_cConc = "concurrencyConfiguration" +_FAA = "FlowAliasArn" +_FAI = "FlowAliasId" +_CFAO = "CreateFlowAliasOutput" +_cCFARo = "com.amazonaws.bedrockagent#CreateFlowAliasResponse" +_fIl = "flowId" +_ar = "arn" +_CFA = "CreateFlowAlias" +_FAIl = "FlowAliasIdentifier" +_DFAI = "DeleteFlowAliasInput" +_cDFAR = "com.amazonaws.bedrockagent#DeleteFlowAliasRequest" +_aIl = "aliasIdentifier" +_DFAO = "DeleteFlowAliasOutput" +_cDFARo = "com.amazonaws.bedrockagent#DeleteFlowAliasResponse" +_DFA = "DeleteFlowAlias" +_GFAI = "GetFlowAliasInput" +_cGFAR = "com.amazonaws.bedrockagent#GetFlowAliasRequest" +_GFAO = "GetFlowAliasOutput" +_cGFARo = "com.amazonaws.bedrockagent#GetFlowAliasResponse" +_GFA = "GetFlowAlias" +_LFAI = "ListFlowAliasesInput" +_cLFAR = "com.amazonaws.bedrockagent#ListFlowAliasesRequest" +_FAS = "FlowAliasSummary" +_FASl = "FlowAliasSummaries" +_LFAO = "ListFlowAliasesOutput" +_cLFARo = "com.amazonaws.bedrockagent#ListFlowAliasesResponse" +_fAS = "flowAliasSummaries" +_LFA = "ListFlowAliases" +_UFAI = "UpdateFlowAliasInput" +_cUFAR = "com.amazonaws.bedrockagent#UpdateFlowAliasRequest" +_UFAO = "UpdateFlowAliasOutput" +_cUFARo = "com.amazonaws.bedrockagent#UpdateFlowAliasResponse" +_UFA = "UpdateFlowAlias" +_CFVI = "CreateFlowVersionInput" +_cCFVR = "com.amazonaws.bedrockagent#CreateFlowVersionRequest" +_DFVI = "DeleteFlowVersionInput" +_cDFVR = "com.amazonaws.bedrockagent#DeleteFlowVersionRequest" +_DFVO = "DeleteFlowVersionOutput" +_cDFVRo = "com.amazonaws.bedrockagent#DeleteFlowVersionResponse" +_DFV = "DeleteFlowVersion" +_ID = "IncludedData" +_AD_ = "ALL_DATA" +_MO = "METADATA_ONLY" +_GFVI = "GetFlowVersionInput" +_cGFVR = "com.amazonaws.bedrockagent#GetFlowVersionRequest" +_iD = "includedData" +_LFVI = "ListFlowVersionsInput" +_cLFVR = "com.amazonaws.bedrockagent#ListFlowVersionsRequest" +_FVS = "FlowVersionSummary" +_FVSl = "FlowVersionSummaries" +_LFVO = "ListFlowVersionsOutput" +_cLFVRo = "com.amazonaws.bedrockagent#ListFlowVersionsResponse" +_fVS = "flowVersionSummaries" +_LFV = "ListFlowVersions" +_GFI = "GetFlowInput" +_cGFR = "com.amazonaws.bedrockagent#GetFlowRequest" +_CCFVD = "CyclicConnectionFlowValidationDetails" +_conn = "connection" +_DCEFVD = "DuplicateConditionExpressionFlowValidationDetails" +_no = "node" +_DCFVD = "DuplicateConnectionsFlowValidationDetails" +_ICDTFVD = "IncompatibleConnectionDataTypeFlowValidationDetails" +_ILBFVD = "InvalidLoopBoundaryFlowValidationDetails" +_ILNT = "IncompatibleLoopNodeType" +_LINTFVD = "LoopIncompatibleNodeTypeFlowValidationDetails" +_iNT = "incompatibleNodeType" +_iNN = "incompatibleNodeName" +_EM = "ErrorMessage" +_MCEFVD = "MalformedConditionExpressionFlowValidationDetails" +_cau = "cause" +_MNIEFVD = "MalformedNodeInputExpressionFlowValidationDetails" +_inp = "input" +_MNITFVD = "MismatchedNodeInputTypeFlowValidationDetails" +_eT = "expectedType" +_MNOTFVD = "MismatchedNodeOutputTypeFlowValidationDetails" +_ou = "output" +_MCCFVD = "MissingConnectionConfigurationFlowValidationDetails" +_MDCFVD = "MissingDefaultConditionFlowValidationDetails" +_MENFVD = "MissingEndingNodesFlowValidationDetails" +_MLCNFVD = "MissingLoopControllerNodeFlowValidationDetails" +_lN = "loopNode" +_MLINFVD = "MissingLoopInputNodeFlowValidationDetails" +_MNCFVD = "MissingNodeConfigurationFlowValidationDetails" +_MNIFVD = "MissingNodeInputFlowValidationDetails" +_MNOFVD = "MissingNodeOutputFlowValidationDetails" +_MSNFVD = "MissingStartingNodesFlowValidationDetails" +_MLCNFVDu = "MultipleLoopControllerNodesFlowValidationDetails" +_MLINFVDu = "MultipleLoopInputNodesFlowValidationDetails" +_MNICFVD = "MultipleNodeInputConnectionsFlowValidationDetails" +_UNIFVD = "UnfulfilledNodeInputFlowValidationDetails" +_UCCFVD = "UnknownConnectionConditionFlowValidationDetails" +_UCSFVD = "UnknownConnectionSourceFlowValidationDetails" +_UCSOFVD = "UnknownConnectionSourceOutputFlowValidationDetails" +_UCTFVD = "UnknownConnectionTargetFlowValidationDetails" +_UCTIFVD = "UnknownConnectionTargetInputFlowValidationDetails" +_UNIFVDn = "UnknownNodeInputFlowValidationDetails" +_UNOFVD = "UnknownNodeOutputFlowValidationDetails" +_UNFVD = "UnreachableNodeFlowValidationDetails" +_UCCFVDn = "UnsatisfiedConnectionConditionsFlowValidationDetails" +_UFVD = "UnspecifiedFlowValidationDetails" +_FVD = "FlowValidationDetails" +_cCy = "cyclicConnection" +_dC = "duplicateConnections" +_dCE = "duplicateConditionExpression" +_uN = "unreachableNode" +_uCS = "unknownConnectionSource" +_uCSO = "unknownConnectionSourceOutput" +_uCT = "unknownConnectionTarget" +_uCTI = "unknownConnectionTargetInput" +_uCC = "unknownConnectionCondition" +_mCE = "malformedConditionExpression" +_mNIE = "malformedNodeInputExpression" +_mNIT = "mismatchedNodeInputType" +_mNOT = "mismatchedNodeOutputType" +_iCDT = "incompatibleConnectionDataType" +_mCC = "missingConnectionConfiguration" +_mDC = "missingDefaultCondition" +_mEN = "missingEndingNodes" +_mNC = "missingNodeConfiguration" +_mNI = "missingNodeInput" +_mNO = "missingNodeOutput" +_mSN = "missingStartingNodes" +_mNIC = "multipleNodeInputConnections" +_uNI = "unfulfilledNodeInput" +_uCCn = "unsatisfiedConnectionConditions" +_un = "unspecified" +_uNIn = "unknownNodeInput" +_uNO = "unknownNodeOutput" +_mLIN = "missingLoopInputNode" +_mLCN = "missingLoopControllerNode" +_mLINu = "multipleLoopInputNodes" +_mLCNu = "multipleLoopControllerNodes" +_lINT = "loopIncompatibleNodeType" +_iLB = "invalidLoopBoundary" +_FVSlo = "FlowValidationSeverity" +_WARNING = "WARNING" +_W = "Warning" +_ERROR = "ERROR" +_E = "Error" +_FVT = "FlowValidationType" +_CC_ = "CYCLIC_CONNECTION" +_CCy = "CyclicConnection" +_DC = "DUPLICATE_CONNECTIONS" +_DCu = "DuplicateConnections" +_DCE = "DUPLICATE_CONDITION_EXPRESSION" +_DCEu = "DuplicateConditionExpression" +_UN = "UNREACHABLE_NODE" +_UNn = "UnreachableNode" +_UCS = "UNKNOWN_CONNECTION_SOURCE" +_UCSn = "UnknownConnectionSource" +_UCSO = "UNKNOWN_CONNECTION_SOURCE_OUTPUT" +_UCSOn = "UnknownConnectionSourceOutput" +_UCT = "UNKNOWN_CONNECTION_TARGET" +_UCTn = "UnknownConnectionTarget" +_UCTI = "UNKNOWN_CONNECTION_TARGET_INPUT" +_UCTIn = "UnknownConnectionTargetInput" +_UCC = "UNKNOWN_CONNECTION_CONDITION" +_UCCn = "UnknownConnectionCondition" +_MCE = "MALFORMED_CONDITION_EXPRESSION" +_MCEa = "MalformedConditionExpression" +_MNIE = "MALFORMED_NODE_INPUT_EXPRESSION" +_MNIEa = "MalformedNodeInputExpression" +_MNIT = "MISMATCHED_NODE_INPUT_TYPE" +_MNITi = "MismatchedNodeInputType" +_MNOT = "MISMATCHED_NODE_OUTPUT_TYPE" +_MNOTi = "MismatchedNodeOutputType" +_ICDT = "INCOMPATIBLE_CONNECTION_DATA_TYPE" +_ICDTn = "IncompatibleConnectionDataType" +_MCC = "MISSING_CONNECTION_CONFIGURATION" +_MCCi = "MissingConnectionConfiguration" +_MDC = "MISSING_DEFAULT_CONDITION" +_MDCi = "MissingDefaultCondition" +_MEN = "MISSING_ENDING_NODES" +_MENi = "MissingEndingNodes" +_MNC = "MISSING_NODE_CONFIGURATION" +_MNCi = "MissingNodeConfiguration" +_MNI = "MISSING_NODE_INPUT" +_MNIi = "MissingNodeInput" +_MNO = "MISSING_NODE_OUTPUT" +_MNOi = "MissingNodeOutput" +_MSN = "MISSING_STARTING_NODES" +_MSNi = "MissingStartingNodes" +_MNIC = "MULTIPLE_NODE_INPUT_CONNECTIONS" +_MNICu = "MultipleNodeInputConnections" +_UNI = "UNFULFILLED_NODE_INPUT" +_UNIn = "UnfulfilledNodeInput" +_UCC_ = "UNSATISFIED_CONNECTION_CONDITIONS" +_UCCns = "UnsatisfiedConnectionConditions" +_UNSPECIFIED = "UNSPECIFIED" +_Un = "Unspecified" +_UNI_ = "UNKNOWN_NODE_INPUT" +_UNInk = "UnknownNodeInput" +_UNO = "UNKNOWN_NODE_OUTPUT" +_UNOn = "UnknownNodeOutput" +_MLIN = "MISSING_LOOP_INPUT_NODE" +_MLINi = "MissingLoopInputNode" +_MLCN = "MISSING_LOOP_CONTROLLER_NODE" +_MLCNi = "MissingLoopControllerNode" +_MLIN_ = "MULTIPLE_LOOP_INPUT_NODES" +_MLINu = "MultipleLoopInputNodes" +_MLCN_ = "MULTIPLE_LOOP_CONTROLLER_NODES" +_MLCNu = "MultipleLoopControllerNodes" +_LINT = "LOOP_INCOMPATIBLE_NODE_TYPE" +_LINTo = "LoopIncompatibleNodeType" +_ILB = "INVALID_LOOP_BOUNDARY" +_ILBn = "InvalidLoopBoundary" +_FV = "FlowValidation" +_sev = "severity" +_det = "details" +_FVl = "FlowValidations" +_LFI = "ListFlowsInput" +_cLFR = "com.amazonaws.bedrockagent#ListFlowsRequest" +_FSlo = "FlowSummary" +_FSlow = "FlowSummaries" +_LFO = "ListFlowsOutput" +_cLFRo = "com.amazonaws.bedrockagent#ListFlowsResponse" +_fSl = "flowSummaries" +_LFi = "ListFlows" +_PFI = "PrepareFlowInput" +_cPFR = "com.amazonaws.bedrockagent#PrepareFlowRequest" +_PFO = "PrepareFlowOutput" +_cPFRo = "com.amazonaws.bedrockagent#PrepareFlowResponse" +_PF = "PrepareFlow" +_GRPI = "GetResourcePolicyInput" +_cGRPR = "com.amazonaws.bedrockagent#GetResourcePolicyRequest" +_RP = "ResourcePolicy" +_sTm = "smithy.api#mediaType" +_ap = "application/json" +_GRPO = "GetResourcePolicyOutput" +_cGRPRo = "com.amazonaws.bedrockagent#GetResourcePolicyResponse" +_pol = "policy" +_GRP = "GetResourcePolicy" +_GVCI = "GetVpcConfigurationInput" +_cGVCR = "com.amazonaws.bedrockagent#GetVpcConfigurationRequest" +_VCSM = "VpcConfigurationStatusMessage" +_VC = "VpcConfiguration" +_sMt = "statusMessage" +_GVCO = "GetVpcConfigurationOutput" +_cGVCRo = "com.amazonaws.bedrockagent#GetVpcConfigurationResponse" +_vC = "vpcConfiguration" +_GVC = "GetVpcConfiguration" +_GIJI = "GetIngestionJobInput" +_cGIJR = "com.amazonaws.bedrockagent#GetIngestionJobRequest" +_iJI = "ingestionJobId" +_IJS = "IngestionJobStatistics" +_nODS = "numberOfDocumentsScanned" +_nOMDS = "numberOfMetadataDocumentsScanned" +_nONDI = "numberOfNewDocumentsIndexed" +_nOMDI = "numberOfModifiedDocumentsIndexed" +_nOMDM = "numberOfMetadataDocumentsModified" +_nODD = "numberOfDocumentsDeleted" +_nODF = "numberOfDocumentsFailed" +_nODSu = "numberOfDocumentsSkipped" +_IJSn = "IngestionJobStatus" +_STARTING = "STARTING" +_IP = "IN_PROGRESS" +_COMPLETE = "COMPLETE" +_STOPPING = "STOPPING" +_STOPPED = "STOPPED" +_IJ = "IngestionJob" +_stat = "statistics" +_sA = "startedAt" +_tRA = "textReadyAt" +_GIJO = "GetIngestionJobOutput" +_cGIJRo = "com.amazonaws.bedrockagent#GetIngestionJobResponse" +_iJ = "ingestionJob" +_GIJ = "GetIngestionJob" +_IJFA = "IngestionJobFilterAttribute" +_STATUS = "STATUS" +_IJFO = "IngestionJobFilterOperator" +_EQ = "EQ" +_IJFV = "IngestionJobFilterValue" +_IJFVn = "IngestionJobFilterValues" +_IJF = "IngestionJobFilter" +_at = "attribute" +_op = "operator" +_va = "values" +_IJFn = "IngestionJobFilters" +_IJSBA = "IngestionJobSortByAttribute" +_SA_ = "STARTED_AT" +_SO = "SortOrder" +_ASCENDING = "ASCENDING" +_DESCENDING = "DESCENDING" +_IJSB = "IngestionJobSortBy" +_or = "order" +_LIJI = "ListIngestionJobsInput" +_cLIJR = "com.amazonaws.bedrockagent#ListIngestionJobsRequest" +_sB = "sortBy" +_IJSng = "IngestionJobSummary" +_IJSnge = "IngestionJobSummaries" +_LIJO = "ListIngestionJobsOutput" +_cLIJRo = "com.amazonaws.bedrockagent#ListIngestionJobsResponse" +_iJS = "ingestionJobSummaries" +_LIJ = "ListIngestionJobs" +_SIJI = "StartIngestionJobInput" +_cSIJR = "com.amazonaws.bedrockagent#StartIngestionJobRequest" +_SIJO = "StartIngestionJobOutput" +_cSIJRo = "com.amazonaws.bedrockagent#StartIngestionJobResponse" +_SIJ = "StartIngestionJob" +_SIJIt = "StopIngestionJobInput" +_cSIJRom = "com.amazonaws.bedrockagent#StopIngestionJobRequest" +_SIJOt = "StopIngestionJobOutput" +_cSIJRoma = "com.amazonaws.bedrockagent#StopIngestionJobResponse" +_SIJt = "StopIngestionJob" +_CDI = "CustomDocumentIdentifier" +_CDST = "ContentDataSourceType" +_DI = "DocumentIdentifier" +_dST = "dataSourceType" +_cu = "custom" +_DIo = "DocumentIdentifiers" +_DKBDI = "DeleteKnowledgeBaseDocumentsInput" +_cDKBDR = "com.amazonaws.bedrockagent#DeleteKnowledgeBaseDocumentsRequest" +_dI = "documentIdentifiers" +_DSo = "DocumentStatus" +_INDEXED = "INDEXED" +_PI = "PARTIALLY_INDEXED" +_PENDING = "PENDING" +_MPI = "METADATA_PARTIALLY_INDEXED" +_MUF = "METADATA_UPDATE_FAILED" +_IGNORED = "IGNORED" +_NF = "NOT_FOUND" +_DIP = "DELETE_IN_PROGRESS" +_KBDD = "KnowledgeBaseDocumentDetail" +_ide = "identifier" +_sR = "statusReason" +_KBDDn = "KnowledgeBaseDocumentDetails" +_DKBDO = "DeleteKnowledgeBaseDocumentsOutput" +_cDKBDRo = "com.amazonaws.bedrockagent#DeleteKnowledgeBaseDocumentsResponse" +_dD = "documentDetails" +_DKBD = "DeleteKnowledgeBaseDocuments" +_GKBDI = "GetKnowledgeBaseDocumentsInput" +_cGKBDR = "com.amazonaws.bedrockagent#GetKnowledgeBaseDocumentsRequest" +_GKBDO = "GetKnowledgeBaseDocumentsOutput" +_cGKBDRo = "com.amazonaws.bedrockagent#GetKnowledgeBaseDocumentsResponse" +_GKBD = "GetKnowledgeBaseDocuments" +_BCB = "ByteContentBlob" +_BCD = "ByteContentDoc" +_mTi = "mimeType" +_TCD = "TextContentDoc" +_ICT = "InlineContentType" +_BYTE = "BYTE" +_ICnl = "InlineContent" +_bC = "byteContent" +_tCex = "textContent" +_SOU = "S3ObjectUri" +_CSL = "CustomS3Location" +_CST = "CustomSourceType" +_IL = "IN_LINE" +_SL_ = "S3_LOCATION" +_CCu = "CustomContent" +_cDI = "customDocumentIdentifier" +_sTo = "sourceType" +_iCnl = "inlineContent" +_SC = "S3Content" +_DCo = "DocumentContent" +_DACE = "DocumentAccessControlEntry" +_ac = "access" +_DACL = "DocumentAccessControlList" +_K = "Key" +_NVu = "NumberValue" +_SV = "StringValue" +_SLV = "StringListValue" +_MVT = "MetadataValueType" +_SL__ = "STRING_LIST" +_MAV = "MetadataAttributeValue" +_nV = "numberValue" +_bV = "booleanValue" +_sVt = "stringValue" +_sLV = "stringListValue" +_MA = "MetadataAttribute" +_MAe = "MetadataAttributes" +_MST = "MetadataSourceType" +_ILA = "IN_LINE_ATTRIBUTE" +_DM = "DocumentMetadata" +_iA = "inlineAttributes" +_aCL = "accessControlList" +_KBD = "KnowledgeBaseDocument" +_meta = "metadata" +_KBDn = "KnowledgeBaseDocuments" +_IKBDI = "IngestKnowledgeBaseDocumentsInput" +_cIKBDR = "com.amazonaws.bedrockagent#IngestKnowledgeBaseDocumentsRequest" +_doc = "documents" +_IKBDO = "IngestKnowledgeBaseDocumentsOutput" +_cIKBDRo = "com.amazonaws.bedrockagent#IngestKnowledgeBaseDocumentsResponse" +_IKBD = "IngestKnowledgeBaseDocuments" +_LKBDI = "ListKnowledgeBaseDocumentsInput" +_cLKBDR = "com.amazonaws.bedrockagent#ListKnowledgeBaseDocumentsRequest" +_LKBDO = "ListKnowledgeBaseDocumentsOutput" +_cLKBDRo = "com.amazonaws.bedrockagent#ListKnowledgeBaseDocumentsResponse" +_LKBD = "ListKnowledgeBaseDocuments" +_AAKBI = "AssociateAgentKnowledgeBaseInput" +_cAAKBR = "com.amazonaws.bedrockagent#AssociateAgentKnowledgeBaseRequest" +_AAKBO = "AssociateAgentKnowledgeBaseOutput" +_cAAKBRo = "com.amazonaws.bedrockagent#AssociateAgentKnowledgeBaseResponse" +_aKB = "agentKnowledgeBase" +_AAKB = "AssociateAgentKnowledgeBase" +_KIA = "KendraIndexArn" +_KKBC = "KendraKnowledgeBaseConfiguration" +_kIA = "kendraIndexArn" +_BEMA = "BedrockEmbeddingModelArn" +_ASC = "AudioSegmentationConfiguration" +_fLD = "fixedLengthDuration" +_ACu = "AudioConfiguration" +_sCeg = "segmentationConfiguration" +_ACud = "AudioConfigurations" +_Di = "Dimensions" +_EDT = "EmbeddingDataType" +_FLOAT = "FLOAT32" +_BINARY = "BINARY" +_VSC = "VideoSegmentationConfiguration" +_VCi = "VideoConfiguration" +_VCid = "VideoConfigurations" +_BEMC = "BedrockEmbeddingModelConfiguration" +_di = "dimensions" +_eDT = "embeddingDataType" +_aud = "audio" +_vi = "video" +_EMC = "EmbeddingModelConfiguration" +_bEMC = "bedrockEmbeddingModelConfiguration" +_EMTm = "EmbeddingModelType" +_MANAGED = "MANAGED" +_SDSLT = "SupplementalDataStorageLocationType" +_SDSL = "SupplementalDataStorageLocation" +_SDSLu = "SupplementalDataStorageLocations" +_SDSCu = "SupplementalDataStorageConfiguration" +_sLt = "storageLocations" +_MKBCa = "ManagedKnowledgeBaseConfiguration" +_eMTm = "embeddingModelType" +_eMA = "embeddingModelArn" +_eMC = "embeddingModelConfiguration" +_sDSC = "supplementalDataStorageConfiguration" +_RPAT = "RedshiftProvisionedAuthType" +_IAM = "IAM" +_UP = "USERNAME_PASSWORD" +_USERNAME = "USERNAME" +_RPAC = "RedshiftProvisionedAuthConfiguration" +_dU = "databaseUser" +_uPSA = "usernamePasswordSecretArn" +_RCI = "RedshiftClusterIdentifier" +_RPC = "RedshiftProvisionedConfiguration" +_cIl = "clusterIdentifier" +_aCu = "authConfiguration" +_RSAT = "RedshiftServerlessAuthType" +_RSAC = "RedshiftServerlessAuthConfiguration" +_WA = "WorkgroupArn" +_RSC = "RedshiftServerlessConfiguration" +_wA = "workgroupArn" +_RQET = "RedshiftQueryEngineType" +_SERVERLESS = "SERVERLESS" +_PROVISIONED = "PROVISIONED" +_RQEC = "RedshiftQueryEngineConfiguration" +_sCer = "serverlessConfiguration" +_pCr = "provisionedConfiguration" +_QETS = "QueryExecutionTimeoutSeconds" +_NLS = "NaturalLanguageString" +_SSq = "SqlString" +_CQ = "CuratedQuery" +_nL = "naturalLanguage" +_sq = "sql" +_CQu = "CuratedQueries" +_DSe = "DescriptionString" +_IE = "IncludeExclude" +_INCLUDE = "INCLUDE" +_EXCLUDE = "EXCLUDE" +_QGCN = "QueryGenerationColumnName" +_QGC = "QueryGenerationColumn" +_inc = "inclusion" +_QGCu = "QueryGenerationColumns" +_QGTN = "QueryGenerationTableName" +_QGT = "QueryGenerationTable" +_col = "columns" +_QGTu = "QueryGenerationTables" +_QGCue = "QueryGenerationContext" +_tab = "tables" +_cQ = "curatedQueries" +_QGCuer = "QueryGenerationConfiguration" +_eTS = "executionTimeoutSeconds" +_gCe = "generationContext" +_ADCTN = "AwsDataCatalogTableName" +_ADCTNw = "AwsDataCatalogTableNames" +_RQEADCSC = "RedshiftQueryEngineAwsDataCatalogStorageConfiguration" +_tN = "tableNames" +_RD = "RedshiftDatabase" +_RQERSC = "RedshiftQueryEngineRedshiftStorageConfiguration" +_dNa = "databaseName" +_RQEST = "RedshiftQueryEngineStorageType" +_REDSHIFT = "REDSHIFT" +_ADC = "AWS_DATA_CATALOG" +_RQESC = "RedshiftQueryEngineStorageConfiguration" +_aDCC = "awsDataCatalogConfiguration" +_rCed = "redshiftConfiguration" +_RQESCe = "RedshiftQueryEngineStorageConfigurations" +_RCed = "RedshiftConfiguration" +_sCt = "storageConfigurations" +_qEC = "queryEngineConfiguration" +_qGC = "queryGenerationConfiguration" +_QET = "QueryEngineType" +_SKBC = "SqlKnowledgeBaseConfiguration" +_KBT = "KnowledgeBaseType" +_VECTOR = "VECTOR" +_KENDRA = "KENDRA" +_SQL = "SQL" +_VKBC = "VectorKnowledgeBaseConfiguration" +_KBC = "KnowledgeBaseConfiguration" +_vKBC = "vectorKnowledgeBaseConfiguration" +_mKBC = "managedKnowledgeBaseConfiguration" +_kKBC = "kendraKnowledgeBaseConfiguration" +_sKBC = "sqlKnowledgeBaseConfiguration" +_KBRA = "KnowledgeBaseRoleArn" +_MDACN = "MongoDbAtlasCollectionName" +_MDADN = "MongoDbAtlasDatabaseName" +_MDAE = "MongoDbAtlasEndpoint" +_MDAESN = "MongoDbAtlasEndpointServiceName" +_FNi = "FieldName" +_MDAFM = "MongoDbAtlasFieldMapping" +_vF = "vectorField" +_tFe = "textField" +_mF = "metadataField" +_MDAIN = "MongoDbAtlasIndexName" +_MDAC = "MongoDbAtlasConfiguration" +_en = "endpoint" +_cNo = "collectionName" +_vIN = "vectorIndexName" +_fMi = "fieldMapping" +_eSN = "endpointServiceName" +_tIN = "textIndexName" +_NAFM = "NeptuneAnalyticsFieldMapping" +_GAr = "GraphArn" +_NAC = "NeptuneAnalyticsConfiguration" +_gA = "graphArn" +_OSMCDA = "OpenSearchManagedClusterDomainArn" +_OSMCDE = "OpenSearchManagedClusterDomainEndpoint" +_OSMCFM = "OpenSearchManagedClusterFieldMapping" +_OSMCIN = "OpenSearchManagedClusterIndexName" +_OSMCC = "OpenSearchManagedClusterConfiguration" +_dE = "domainEndpoint" +_dA = "domainArn" +_OSSCA = "OpenSearchServerlessCollectionArn" +_OSSFM = "OpenSearchServerlessFieldMapping" +_OSSIN = "OpenSearchServerlessIndexName" +_OSSC = "OpenSearchServerlessConfiguration" +_cAo = "collectionArn" +_PCS = "PineconeConnectionString" +_PFM = "PineconeFieldMapping" +_PN = "PineconeNamespace" +_PCi = "PineconeConfiguration" +_cSo = "connectionString" +_nam = "namespace" +_RDN = "RdsDatabaseName" +_CN = "ColumnName" +_RFM = "RdsFieldMapping" +_pKF = "primaryKeyField" +_cMF = "customMetadataField" +_RAd = "RdsArn" +_RTN = "RdsTableName" +_RCd = "RdsConfiguration" +_tNa = "tableName" +_RECE = "RedisEnterpriseCloudEndpoint" +_RECFM = "RedisEnterpriseCloudFieldMapping" +_RECIN = "RedisEnterpriseCloudIndexName" +_RECC = "RedisEnterpriseCloudConfiguration" +_IA = "IndexArn" +_IN = "IndexName" +_VBA = "VectorBucketArn" +_SVC = "S3VectorsConfiguration" +_vBA = "vectorBucketArn" +_iAn = "indexArn" +_iN = "indexName" +_KBST = "KnowledgeBaseStorageType" +_OS = "OPENSEARCH_SERVERLESS" +_PINECONE = "PINECONE" +_REC = "REDIS_ENTERPRISE_CLOUD" +_RDS = "RDS" +_MDA = "MONGO_DB_ATLAS" +_NA = "NEPTUNE_ANALYTICS" +_OMC = "OPENSEARCH_MANAGED_CLUSTER" +_SV_ = "S3_VECTORS" +_SCt = "StorageConfiguration" +_oSC = "opensearchServerlessConfiguration" +_oMCC = "opensearchManagedClusterConfiguration" +_pCi = "pineconeConfiguration" +_rECC = "redisEnterpriseCloudConfiguration" +_rCd = "rdsConfiguration" +_mDAC = "mongoDbAtlasConfiguration" +_nAC = "neptuneAnalyticsConfiguration" +_sVC = "s3VectorsConfiguration" +_CKBI = "CreateKnowledgeBaseInput" +_cCKBR = "com.amazonaws.bedrockagent#CreateKnowledgeBaseRequest" +_rAo = "roleArn" +_kBC = "knowledgeBaseConfiguration" +_sCto = "storageConfiguration" +_KBA = "KnowledgeBaseArn" +_KBSn = "KnowledgeBaseStatus" +_ACTIVE = "ACTIVE" +_UU = "UPDATE_UNSUCCESSFUL" +_kBA = "knowledgeBaseArn" +_CKBO = "CreateKnowledgeBaseOutput" +_cCKBRo = "com.amazonaws.bedrockagent#CreateKnowledgeBaseResponse" +_kB = "knowledgeBase" +_CKB = "CreateKnowledgeBase" +_DKBI = "DeleteKnowledgeBaseInput" +_cDKBR = "com.amazonaws.bedrockagent#DeleteKnowledgeBaseRequest" +_DKBO = "DeleteKnowledgeBaseOutput" +_cDKBRo = "com.amazonaws.bedrockagent#DeleteKnowledgeBaseResponse" +_DKB = "DeleteKnowledgeBase" +_DAKBI = "DisassociateAgentKnowledgeBaseInput" +_cDAKBR = "com.amazonaws.bedrockagent#DisassociateAgentKnowledgeBaseRequest" +_DAKBO = "DisassociateAgentKnowledgeBaseOutput" +_cDAKBRo = "com.amazonaws.bedrockagent#DisassociateAgentKnowledgeBaseResponse" +_DAKB = "DisassociateAgentKnowledgeBase" +_GAKBI = "GetAgentKnowledgeBaseInput" +_cGAKBR = "com.amazonaws.bedrockagent#GetAgentKnowledgeBaseRequest" +_GAKBO = "GetAgentKnowledgeBaseOutput" +_cGAKBRo = "com.amazonaws.bedrockagent#GetAgentKnowledgeBaseResponse" +_GAKB = "GetAgentKnowledgeBase" +_GKBI = "GetKnowledgeBaseInput" +_cGKBR = "com.amazonaws.bedrockagent#GetKnowledgeBaseRequest" +_GKBO = "GetKnowledgeBaseOutput" +_cGKBRo = "com.amazonaws.bedrockagent#GetKnowledgeBaseResponse" +_GKB = "GetKnowledgeBase" +_LAKBI = "ListAgentKnowledgeBasesInput" +_cLAKBR = "com.amazonaws.bedrockagent#ListAgentKnowledgeBasesRequest" +_LAKBO = "ListAgentKnowledgeBasesOutput" +_cLAKBRo = "com.amazonaws.bedrockagent#ListAgentKnowledgeBasesResponse" +_aKBS = "agentKnowledgeBaseSummaries" +_LAKB = "ListAgentKnowledgeBases" +_LKBI = "ListKnowledgeBasesInput" +_cLKBR = "com.amazonaws.bedrockagent#ListKnowledgeBasesRequest" +_KBSno = "KnowledgeBaseSummary" +_KBSnow = "KnowledgeBaseSummaries" +_LKBO = "ListKnowledgeBasesOutput" +_cLKBRo = "com.amazonaws.bedrockagent#ListKnowledgeBasesResponse" +_kBSn = "knowledgeBaseSummaries" +_LKB = "ListKnowledgeBases" +_UAKBI = "UpdateAgentKnowledgeBaseInput" +_cUAKBR = "com.amazonaws.bedrockagent#UpdateAgentKnowledgeBaseRequest" +_UAKBO = "UpdateAgentKnowledgeBaseOutput" +_cUAKBRo = "com.amazonaws.bedrockagent#UpdateAgentKnowledgeBaseResponse" +_UAKB = "UpdateAgentKnowledgeBase" +_UKBI = "UpdateKnowledgeBaseInput" +_cUKBR = "com.amazonaws.bedrockagent#UpdateKnowledgeBaseRequest" +_UKBO = "UpdateKnowledgeBaseOutput" +_cUKBRo = "com.amazonaws.bedrockagent#UpdateKnowledgeBaseResponse" +_UKB = "UpdateKnowledgeBase" +_LVCI = "ListVpcConfigurationsInput" +_cLVCR = "com.amazonaws.bedrockagent#ListVpcConfigurationsRequest" +_sFt = "statusFilter" +_VCSp = "VpcConfigurationSummary" +_VCSL = "VpcConfigurationSummaryList" +_LVCO = "ListVpcConfigurationsOutput" +_cLVCRo = "com.amazonaws.bedrockagent#ListVpcConfigurationsResponse" +_it = "items" +_LVC = "ListVpcConfigurations" +_PVN = "PromptVariantName" +_PDr = "PromptDescription" +_PNr = "PromptName" +_PAR = "PromptAgentResource" +_aIg = "agentIdentifier" +_PGAR = "PromptGenAiResource" +_PMK = "PromptMetadataKey" +_PMV = "PromptMetadataValue" +_PME = "PromptMetadataEntry" +_PML = "PromptMetadataList" +_PMIr = "PromptModelIdentifier" +_PV = "PromptVariant" +_gAR = "genAiResource" +_PVL = "PromptVariantList" +_CPI = "CreatePromptInput" +_cCPR = "com.amazonaws.bedrockagent#CreatePromptRequest" +_dV = "defaultVariant" +_var = "variants" +_PAr = "PromptArn" +_PIr = "PromptId" +_CPO = "CreatePromptOutput" +_cCPRo = "com.amazonaws.bedrockagent#CreatePromptResponse" +_CP = "CreatePrompt" +_PIro = "PromptIdentifier" +_CPVI = "CreatePromptVersionInput" +_cCPVR = "com.amazonaws.bedrockagent#CreatePromptVersionRequest" +_pI = "promptIdentifier" +_CPVO = "CreatePromptVersionOutput" +_cCPVRo = "com.amazonaws.bedrockagent#CreatePromptVersionResponse" +_CPV = "CreatePromptVersion" +_DPI = "DeletePromptInput" +_cDPR = "com.amazonaws.bedrockagent#DeletePromptRequest" +_pV = "promptVersion" +_DPO = "DeletePromptOutput" +_cDPRo = "com.amazonaws.bedrockagent#DeletePromptResponse" +_DP = "DeletePrompt" +_GPI = "GetPromptInput" +_cGPR = "com.amazonaws.bedrockagent#GetPromptRequest" +_GPO = "GetPromptOutput" +_cGPRo = "com.amazonaws.bedrockagent#GetPromptResponse" +_GP = "GetPrompt" +_LPI = "ListPromptsInput" +_cLPR = "com.amazonaws.bedrockagent#ListPromptsRequest" +_PSr = "PromptSummary" +_PSro = "PromptSummaries" +_LPO = "ListPromptsOutput" +_cLPRo = "com.amazonaws.bedrockagent#ListPromptsResponse" +_pSr = "promptSummaries" +_LP = "ListPrompts" +_UPI = "UpdatePromptInput" +_cUPR = "com.amazonaws.bedrockagent#UpdatePromptRequest" +_UPO = "UpdatePromptOutput" +_cUPRo = "com.amazonaws.bedrockagent#UpdatePromptResponse" +_UPp = "UpdatePrompt" +_PRPI = "PutResourcePolicyInput" +_cPRPR = "com.amazonaws.bedrockagent#PutResourcePolicyRequest" +_PRPO = "PutResourcePolicyOutput" +_cPRPRo = "com.amazonaws.bedrockagent#PutResourcePolicyResponse" +_PRP = "PutResourcePolicy" +_TRA = "TaggableResourcesArn" +_LTFRI = "ListTagsForResourceInput" +_cLTFRR = "com.amazonaws.bedrockagent#ListTagsForResourceRequest" +_LTFRO = "ListTagsForResourceOutput" +_cLTFRRo = "com.amazonaws.bedrockagent#ListTagsForResourceResponse" +_LTFR = "ListTagsForResource" +_TRI = "TagResourceInput" +_cTRR = "com.amazonaws.bedrockagent#TagResourceRequest" +_TRO = "TagResourceOutput" +_cTRRo = "com.amazonaws.bedrockagent#TagResourceResponse" +_TR = "TagResource" +_TKL = "TagKeyList" +_URI = "UntagResourceInput" +_cURR = "com.amazonaws.bedrockagent#UntagResourceRequest" +_tKa = "tagKeys" +_URO = "UntagResourceOutput" +_cURRo = "com.amazonaws.bedrockagent#UntagResourceResponse" +_UR = "UntagResource" +_VFDO = "ValidateFlowDefinitionOutput" +_cVFDR = "com.amazonaws.bedrockagent#ValidateFlowDefinitionResponse" +_val = "validations" +_DAVI = "DeleteAgentVersionInput" +_cDAVR = "com.amazonaws.bedrockagent#DeleteAgentVersionRequest" +_DAVO = "DeleteAgentVersionOutput" +_cDAVRo = "com.amazonaws.bedrockagent#DeleteAgentVersionResponse" +_DAV = "DeleteAgentVersion" +_GAVI = "GetAgentVersionInput" +_cGAVR = "com.amazonaws.bedrockagent#GetAgentVersionRequest" +_GAVO = "GetAgentVersionOutput" +_cGAVRo = "com.amazonaws.bedrockagent#GetAgentVersionResponse" +_GAV = "GetAgentVersion" +_LAVI = "ListAgentVersionsInput" +_cLAVR = "com.amazonaws.bedrockagent#ListAgentVersionsRequest" +_LAVO = "ListAgentVersionsOutput" +_cLAVRo = "com.amazonaws.bedrockagent#ListAgentVersionsResponse" +_aVS = "agentVersionSummaries" +_LAV = "ListAgentVersions" +_FDlo = "FlowDefinition" +_nod = "nodes" +_conne = "connections" +_FNl = "FlowNode" +_inpu = "inputs" +_out = "outputs" +_FNC = "FlowNodeConfiguration" +_le = "lex" +_pro = "prompt" +_lF = "lambdaFunction" +_sto = "storage" +_ret = "retrieval" +_ite = "iterator" +_coll = "collector" +_iCnli = "inlineCode" +_lo = "loop" +_lIo = "loopInput" +_lCo = "loopController" +_FNlo = "FlowNodes" +_LFNCo = "LoopFlowNodeConfiguration" +_def = "definition" +_CFI = "CreateFlowInput" +_cCFR = "com.amazonaws.bedrockagent#CreateFlowRequest" +_eRA = "executionRoleArn" +_CFO = "CreateFlowOutput" +_cCFRo = "com.amazonaws.bedrockagent#CreateFlowResponse" +_CFVO = "CreateFlowVersionOutput" +_cCFVRo = "com.amazonaws.bedrockagent#CreateFlowVersionResponse" +_GFO = "GetFlowOutput" +_cGFRo = "com.amazonaws.bedrockagent#GetFlowResponse" +_GFVO = "GetFlowVersionOutput" +_cGFVRo = "com.amazonaws.bedrockagent#GetFlowVersionResponse" +_UFI = "UpdateFlowInput" +_cUFR = "com.amazonaws.bedrockagent#UpdateFlowRequest" +_UFO = "UpdateFlowOutput" +_cUFRo = "com.amazonaws.bedrockagent#UpdateFlowResponse" +_VFDI = "ValidateFlowDefinitionInput" +_cVFDRo = "com.amazonaws.bedrockagent#ValidateFlowDefinitionRequest" +_CFV = "CreateFlowVersion" +_GF = "GetFlow" +_GFV = "GetFlowVersion" +_VFD = "ValidateFlowDefinition" +_CFr = "CreateFlow" +_UF = "UpdateFlow" +_ABABTL = "AmazonBedrockAgentBuildTimeLambda" +_aw = "aws.auth#sigv4" +_sBm = "smithy.rules#endpointBdd" +_aws = "aws.api#service" +_aJ = "aws.protocols#restJson1" +_smithyap = "smithy.api#cors" + +ACCESS_CONTROL_ACCESS: StaticSchema = ( + 14, + n0, + _ACA, + 0, + (_ALLOW, _DENY), + ((-1, {_sV: _ALLOW}), (-1, {_sV: _DENY})), +) + +ACCESS_CONTROL_PRINCIPAL_TYPE: StaticSchema = ( + 14, + n0, + _ACPT, + 0, + (_USER,), + ((-1, {_sV: _USER}),), +) + +NON_BLANK_STRING: StaticSchema = (3, n0, _NBS, 0) + +ACCESS_DENIED_EXCEPTION: StaticSchema = ( + 18, + n0, + _ADE, + {_s: _c, _sE: 403}, + (_m,), + ((NON_BLANK_STRING, 0),), +) + +CUSTOM_CONTROL_METHOD: StaticSchema = (14, n0, _CCM, 0, (_RC,), ((-1, {_sV: _RC}),)) + +LAMBDA_ARN: StaticSchema = (3, n0, _LA, 0) + +ACTION_GROUP_EXECUTOR: StaticSchema = ( + 19, + n0, + _AGE, + 0, + (_l, _cC), + ((LAMBDA_ARN, 0), (CUSTOM_CONTROL_METHOD, 0)), +) + +CONFLICT_EXCEPTION: StaticSchema = ( + 18, + n0, + _CE, + {_s: _c, _sE: 409}, + (_m,), + ((NON_BLANK_STRING, 0),), +) + +NAME: StaticSchema = (3, n0, _N, 0) + +ACTION_GROUP_STATE: StaticSchema = ( + 14, + n0, + _AGS, + 0, + (_ENABLED, _DISABLED), + ((-1, {_sV: _ENABLED}), (-1, {_sV: _DISABLED})), +) + +ID: StaticSchema = (3, n0, _I, 0) + +DRAFT_VERSION: StaticSchema = (3, n0, _DV, 0) + +PAYLOAD: StaticSchema = (3, n0, _P, 4) + +S3_BUCKET_NAME: StaticSchema = (3, n0, _SBN, 0) + +S3_OBJECT_KEY: StaticSchema = (3, n0, _SOK, 0) + +S3_IDENTIFIER: StaticSchema = ( + 18, + n0, + _SI, + 0, + (_sBN, _sOK), + ((S3_BUCKET_NAME, 0), (S3_OBJECT_KEY, 0)), +) + +API_SCHEMA: StaticSchema = ( + 19, + n0, + _APIS, + 0, + (_s_, _p), + ((S3_IDENTIFIER, 0), (PAYLOAD, 0)), +) +CLIENT_TOKEN: StaticSchema = (3, n0, _CT, 0) -ACCESS_CONTROL_ACCESS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#AccessControlAccess"), - shape_type=ShapeType.ENUM, - members={"ALLOW": {"target": UNIT}, "DENY": {"target": UNIT}}, -) +DESCRIPTION: StaticSchema = (3, n0, _D, 0) -ACCESS_CONTROL_PRINCIPAL_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#AccessControlPrincipalType"), - shape_type=ShapeType.ENUM, - members={"USER": {"target": UNIT}}, -) +FUNCTION_DESCRIPTION: StaticSchema = (3, n0, _FD, 0) + +PARAMETER_DESCRIPTION: StaticSchema = (3, n0, _PD, 0) -NON_BLANK_STRING = Schema( - id=ShapeID("com.amazonaws.bedrockagent#NonBlankString"), shape_type=ShapeType.STRING +TYPE: StaticSchema = ( + 14, + n0, + _T, + 0, + (_STRING, _NUMBER, _INTEGER, _BOOLEAN, _ARRAY), + ( + (-1, {_sV: _st}), + (-1, {_sV: _n}), + (-1, {_sV: _i}), + (-1, {_sV: _b}), + (-1, {_sV: _a}), + ), ) -ACCESS_DENIED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=403), - ], - members={"message": {"target": NON_BLANK_STRING}}, +PARAMETER_DETAIL: StaticSchema = ( + 18, + n0, + _PDa, + 0, + (_d, _t, _r), + ((PARAMETER_DESCRIPTION, 0), (TYPE, 1), (2, 0)), +) + +PARAMETER_MAP: StaticSchema = ( + 17, + n0, + _PM, + 0, + (_k, _v), + ((NAME, 0), (PARAMETER_DETAIL, 0)), +) + +REQUIRE_CONFIRMATION: StaticSchema = ( + 14, + n0, + _RCe, + 0, + (_ENABLED, _DISABLED), + ((-1, {_sV: _ENABLED}), (-1, {_sV: _DISABLED})), +) + +FUNCTION: StaticSchema = ( + 18, + n0, + _F, + 0, + (_na, _d, _pa, _rC), + ( + (NAME, 1), + (FUNCTION_DESCRIPTION, 0), + (PARAMETER_MAP, 0), + (REQUIRE_CONFIRMATION, 0), + ), ) -CUSTOM_CONTROL_METHOD = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#CustomControlMethod"), - shape_type=ShapeType.ENUM, - members={"RETURN_CONTROL": {"target": UNIT}}, +FUNCTIONS: StaticSchema = (16, n0, _Fu, 0, (_me,), ((FUNCTION, 0),)) + +FUNCTION_SCHEMA: StaticSchema = (19, n0, _FS, 0, (_f,), ((FUNCTIONS, 0),)) + +ACTION_GROUP_SIGNATURE: StaticSchema = ( + 14, + n0, + _AGSc, + 0, + (_AU, _AC, _AC_, _AB, _AT), + ( + (-1, {_sV: _AMAZONUI}), + (-1, {_sV: _AMAZONCI}), + (-1, {_sV: _ANTHROPICC}), + (-1, {_sV: _ANTHROPICB}), + (-1, {_sV: _ANTHROPICTE}), + ), ) -LAMBDA_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagent#LambdaArn"), shape_type=ShapeType.STRING +ACTION_GROUP_SIGNATURE_PARAMS: StaticSchema = ( + 17, + n0, + _AGSP, + 0, + (_k, _v), + ((3, 0), (3, 0)), +) + +CREATE_AGENT_ACTION_GROUP_INPUT: StaticSchema = ( + 18, + n0, + _CAAGI, + {_sSI: _cCAAGR, _smit: None}, + (_aI, _aV, _aGN, _cT, _d, _pAGS, _pAGSP, _aGE, _aS, _aGS, _fS), + ( + (ID, 9), + (DRAFT_VERSION, 9), + (NAME, 1), + (CLIENT_TOKEN, 2), + (DESCRIPTION, 0), + (ACTION_GROUP_SIGNATURE, 0), + (ACTION_GROUP_SIGNATURE_PARAMS, 0), + (ACTION_GROUP_EXECUTOR, 0), + (API_SCHEMA, 0), + (ACTION_GROUP_STATE, 0), + (FUNCTION_SCHEMA, 0), + ), ) -ACTION_GROUP_EXECUTOR = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ActionGroupExecutor"), - shape_type=ShapeType.UNION, - members={ - "lambda": {"target": LAMBDA_ARN}, - "customControl": {"target": CUSTOM_CONTROL_METHOD}, - }, +VERSION: StaticSchema = (3, n0, _V, 0) + +DATE_TIMESTAMP: StaticSchema = (4, n0, _DT, {_sF: _dt}) + +AGENT_ACTION_GROUP: StaticSchema = ( + 18, + n0, + _AAG, + 0, + (_aI, _aV, _aGI, _aGN, _cT, _d, _cA, _uA, _pAS, _pAGSP, _aGE, _aS, _fS, _aGS), + ( + (ID, 1), + (VERSION, 1), + (ID, 1), + (NAME, 1), + (CLIENT_TOKEN, 0), + (DESCRIPTION, 0), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (ACTION_GROUP_SIGNATURE, 0), + (ACTION_GROUP_SIGNATURE_PARAMS, 0), + (ACTION_GROUP_EXECUTOR, 0), + (API_SCHEMA, 0), + (FUNCTION_SCHEMA, 0), + (ACTION_GROUP_STATE, 1), + ), ) -CONFLICT_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ConflictException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=409), - ], - members={"message": {"target": NON_BLANK_STRING}}, +CREATE_AGENT_ACTION_GROUP_OUTPUT: StaticSchema = ( + 18, + n0, + _CAAGO, + {_sSI: _cCAAGRo, _smith: None}, + (_aAG,), + ((AGENT_ACTION_GROUP, 1),), +) + +INTERNAL_SERVER_EXCEPTION: StaticSchema = ( + 18, + n0, + _ISE, + {_s: _se, _sE: 500}, + (_m,), + ((NON_BLANK_STRING, 0),), +) + +RESOURCE_NOT_FOUND_EXCEPTION: StaticSchema = ( + 18, + n0, + _RNFE, + {_s: _c, _sE: 404}, + (_m,), + ((NON_BLANK_STRING, 0),), +) + +SERVICE_QUOTA_EXCEEDED_EXCEPTION: StaticSchema = ( + 18, + n0, + _SQEE, + {_s: _c, _sE: 402}, + (_m,), + ((NON_BLANK_STRING, 0),), +) + +THROTTLING_EXCEPTION: StaticSchema = ( + 18, + n0, + _TE, + {_s: _c, _sE: 429}, + (_m,), + ((NON_BLANK_STRING, 0),), +) + +VALIDATION_EXCEPTION_FIELD: StaticSchema = ( + 18, + n0, + _VEF, + 0, + (_na, _m), + ((NON_BLANK_STRING, 1), (NON_BLANK_STRING, 1)), +) + +VALIDATION_EXCEPTION_FIELD_LIST: StaticSchema = ( + 16, + n0, + _VEFL, + 0, + (_me,), + ((VALIDATION_EXCEPTION_FIELD, 0),), +) + +VALIDATION_EXCEPTION: StaticSchema = ( + 18, + n0, + _VE, + {_s: _c, _sE: 400}, + (_m, _fL), + ((NON_BLANK_STRING, 0), (VALIDATION_EXCEPTION_FIELD_LIST, 0)), +) + +CREATE_AGENT_ACTION_GROUP: StaticOperationSchema = ( + 23, + n0, + _CAAG, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "PUT", + "uri": "/agents/{agentId}/agentversions/{agentVersion}/actiongroups/", + } + ) + }, + CREATE_AGENT_ACTION_GROUP_INPUT, + CREATE_AGENT_ACTION_GROUP_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagent#Name"), shape_type=ShapeType.STRING +DELETE_AGENT_ACTION_GROUP_INPUT: StaticSchema = ( + 18, + n0, + _DAAGI, + {_sSI: _cDAAGR, _smit: None}, + (_aI, _aV, _aGI, _sRIUC), + ((ID, 9), (DRAFT_VERSION, 9), (ID, 9), (2, {_smithya: False, _sQ: _sRIUC})), +) + +DELETE_AGENT_ACTION_GROUP_OUTPUT: StaticSchema = ( + 18, + n0, + _DAAGO, + {_sSI: _cDAAGRo, _smith: None}, +) + +DELETE_AGENT_ACTION_GROUP: StaticOperationSchema = ( + 23, + n0, + _DAAG, + { + _smithy: MappingProxyType( + { + "code": 204, + "method": "DELETE", + "uri": "/agents/{agentId}/agentversions/{agentVersion}/actiongroups/{actionGroupId}/", + } + ) + }, + DELETE_AGENT_ACTION_GROUP_INPUT, + DELETE_AGENT_ACTION_GROUP_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -ACTION_GROUP_STATE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ActionGroupState"), - shape_type=ShapeType.ENUM, - members={"ENABLED": {"target": UNIT}, "DISABLED": {"target": UNIT}}, +GET_AGENT_ACTION_GROUP_INPUT: StaticSchema = ( + 18, + n0, + _GAAGI, + {_sSI: _cGAAGR, _smit: None}, + (_aI, _aV, _aGI), + ((ID, 9), (VERSION, 9), (ID, 9)), +) + +GET_AGENT_ACTION_GROUP_OUTPUT: StaticSchema = ( + 18, + n0, + _GAAGO, + {_sSI: _cGAAGRo, _smith: None}, + (_aAG,), + ((AGENT_ACTION_GROUP, 1),), +) + +GET_AGENT_ACTION_GROUP: StaticOperationSchema = ( + 23, + n0, + _GAAG, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "GET", + "uri": "/agents/{agentId}/agentversions/{agentVersion}/actiongroups/{actionGroupId}/", + } + ) + }, + GET_AGENT_ACTION_GROUP_INPUT, + GET_AGENT_ACTION_GROUP_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -ID = Schema(id=ShapeID("com.amazonaws.bedrockagent#Id"), shape_type=ShapeType.STRING) +MAX_RESULTS: StaticSchema = (7, n0, _MR, 0) -DRAFT_VERSION = Schema( - id=ShapeID("com.amazonaws.bedrockagent#DraftVersion"), shape_type=ShapeType.STRING -) +NEXT_TOKEN: StaticSchema = (3, n0, _NT, 0) -PAYLOAD = Schema( - id=ShapeID("com.amazonaws.bedrockagent#Payload"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +LIST_AGENT_ACTION_GROUPS_INPUT: StaticSchema = ( + 18, + n0, + _LAAGI, + {_sSI: _cLAAGR, _smit: None}, + (_aI, _aV, _mR, _nT), + ((ID, 9), (VERSION, 9), (MAX_RESULTS, 0), (NEXT_TOKEN, 0)), ) -S3_BUCKET_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagent#S3BucketName"), shape_type=ShapeType.STRING +ACTION_GROUP_SUMMARY: StaticSchema = ( + 18, + n0, + _AGSct, + 0, + (_aGI, _aGN, _aGS, _d, _uA), + ( + (ID, 1), + (NAME, 1), + (ACTION_GROUP_STATE, 1), + (DESCRIPTION, 0), + (DATE_TIMESTAMP, 1), + ), ) -S3_OBJECT_KEY = Schema( - id=ShapeID("com.amazonaws.bedrockagent#S3ObjectKey"), shape_type=ShapeType.STRING +ACTION_GROUP_SUMMARIES: StaticSchema = ( + 16, + n0, + _AGScti, + 0, + (_me,), + ((ACTION_GROUP_SUMMARY, 0),), +) + +LIST_AGENT_ACTION_GROUPS_OUTPUT: StaticSchema = ( + 18, + n0, + _LAAGO, + {_sSI: _cLAAGRo, _smith: None}, + (_aGSc, _nT), + ((ACTION_GROUP_SUMMARIES, 1), (NEXT_TOKEN, 0)), +) + +LIST_AGENT_ACTION_GROUPS: StaticOperationSchema = ( + 23, + n0, + _LAAG, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "POST", + "uri": "/agents/{agentId}/agentversions/{agentVersion}/actiongroups/", + } + ) + }, + LIST_AGENT_ACTION_GROUPS_INPUT, + LIST_AGENT_ACTION_GROUPS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -S3_IDENTIFIER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#S3Identifier"), - members={ - "s3BucketName": {"target": S3_BUCKET_NAME}, - "s3ObjectKey": {"target": S3_OBJECT_KEY}, - }, +UPDATE_AGENT_ACTION_GROUP_INPUT: StaticSchema = ( + 18, + n0, + _UAAGI, + {_sSI: _cUAAGR, _smit: None}, + (_aI, _aV, _aGI, _aGN, _d, _pAGS, _pAGSP, _aGE, _aGS, _aS, _fS), + ( + (ID, 9), + (DRAFT_VERSION, 9), + (ID, 9), + (NAME, 1), + (DESCRIPTION, 0), + (ACTION_GROUP_SIGNATURE, 0), + (ACTION_GROUP_SIGNATURE_PARAMS, 0), + (ACTION_GROUP_EXECUTOR, 0), + (ACTION_GROUP_STATE, 0), + (API_SCHEMA, 0), + (FUNCTION_SCHEMA, 0), + ), ) -API_SCHEMA = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#APISchema"), - shape_type=ShapeType.UNION, - members={"s3": {"target": S3_IDENTIFIER}, "payload": {"target": PAYLOAD}}, +UPDATE_AGENT_ACTION_GROUP_OUTPUT: StaticSchema = ( + 18, + n0, + _UAAGO, + {_sSI: _cUAAGRo, _smith: None}, + (_aAG,), + ((AGENT_ACTION_GROUP, 1),), +) + +UPDATE_AGENT_ACTION_GROUP: StaticOperationSchema = ( + 23, + n0, + _UAAG, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "PUT", + "uri": "/agents/{agentId}/agentversions/{agentVersion}/actiongroups/{actionGroupId}/", + } + ) + }, + UPDATE_AGENT_ACTION_GROUP_INPUT, + UPDATE_AGENT_ACTION_GROUP_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CLIENT_TOKEN = Schema( - id=ShapeID("com.amazonaws.bedrockagent#ClientToken"), shape_type=ShapeType.STRING -) +ADDITIONAL_MODEL_REQUEST_FIELDS_KEY: StaticSchema = (3, n0, _AMRFK, 0) -DESCRIPTION = Schema( - id=ShapeID("com.amazonaws.bedrockagent#Description"), shape_type=ShapeType.STRING -) +ADDITIONAL_MODEL_REQUEST_FIELDS_VALUE: StaticSchema = (13, n0, _AMRFV, 0) -FUNCTION_DESCRIPTION = Schema( - id=ShapeID("com.amazonaws.bedrockagent#FunctionDescription"), - shape_type=ShapeType.STRING, +ADDITIONAL_MODEL_REQUEST_FIELDS: StaticSchema = ( + 17, + n0, + _AMRF, + 0, + (_k, _v), + ( + (ADDITIONAL_MODEL_REQUEST_FIELDS_KEY, 0), + (ADDITIONAL_MODEL_REQUEST_FIELDS_VALUE, 0), + ), ) -PARAMETER_DESCRIPTION = Schema( - id=ShapeID("com.amazonaws.bedrockagent#ParameterDescription"), - shape_type=ShapeType.STRING, +AGENT_ARN: StaticSchema = (3, n0, _AA, 0) + +AGENT_COLLABORATION: StaticSchema = ( + 14, + n0, + _ACg, + 0, + (_SUPERVISOR, _SR, _DISABLED), + ((-1, {_sV: _SUPERVISOR}), (-1, {_sV: _SR}), (-1, {_sV: _DISABLED})), +) + +AGENT_ROLE_ARN: StaticSchema = (3, n0, _ARA, 0) + +AGENT_STATUS: StaticSchema = ( + 14, + n0, + _AS, + 0, + (_CREATING, _PREPARING, _PREPARED, _NP, _DELETING, _FAILED, _VERSIONING, _UPDATING), + ( + (-1, {_sV: _CREATING}), + (-1, {_sV: _PREPARING}), + (-1, {_sV: _PREPARED}), + (-1, {_sV: _NP}), + (-1, {_sV: _DELETING}), + (-1, {_sV: _FAILED}), + (-1, {_sV: _VERSIONING}), + (-1, {_sV: _UPDATING}), + ), ) -TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#Type"), - shape_type=ShapeType.ENUM, - members={ - "STRING": {"target": UNIT}, - "NUMBER": {"target": UNIT}, - "INTEGER": {"target": UNIT}, - "BOOLEAN": {"target": UNIT}, - "ARRAY": {"target": UNIT}, - }, -) +KMS_KEY_ARN: StaticSchema = (3, n0, _KKA, 0) -PARAMETER_DETAIL = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ParameterDetail"), - members={ - "description": {"target": PARAMETER_DESCRIPTION}, - "type": { - "target": TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "required": {"target": BOOLEAN}, - }, -) +ORCHESTRATION_EXECUTOR: StaticSchema = (19, n0, _OE, 0, (_l,), ((LAMBDA_ARN, 0),)) -PARAMETER_MAP = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ParameterMap"), - shape_type=ShapeType.MAP, - members={"key": {"target": NAME}, "value": {"target": PARAMETER_DETAIL}}, +CUSTOM_ORCHESTRATION: StaticSchema = ( + 18, + n0, + _CO, + 0, + (_e,), + ((ORCHESTRATION_EXECUTOR, 0),), ) -REQUIRE_CONFIRMATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#RequireConfirmation"), - shape_type=ShapeType.ENUM, - members={"ENABLED": {"target": UNIT}, "DISABLED": {"target": UNIT}}, -) +FAILURE_REASON: StaticSchema = (3, n0, _FR, 0) -FUNCTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#Function"), - members={ - "name": { - "target": NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": FUNCTION_DESCRIPTION}, - "parameters": {"target": PARAMETER_MAP}, - "requireConfirmation": {"target": REQUIRE_CONFIRMATION}, - }, -) +FAILURE_REASONS: StaticSchema = (16, n0, _FRa, 0, (_me,), ((FAILURE_REASON, 0),)) -FUNCTIONS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#Functions"), - shape_type=ShapeType.LIST, - members={"member": {"target": FUNCTION}}, -) +MODEL_IDENTIFIER: StaticSchema = (3, n0, _MI, 0) -FUNCTION_SCHEMA = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#FunctionSchema"), - shape_type=ShapeType.UNION, - members={"functions": {"target": FUNCTIONS}}, -) +GUARDRAIL_IDENTIFIER: StaticSchema = (3, n0, _GI, 0) -ACTION_GROUP_SIGNATURE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ActionGroupSignature"), - shape_type=ShapeType.ENUM, - members={ - "AMAZON_USERINPUT": {"target": UNIT}, - "AMAZON_CODEINTERPRETER": {"target": UNIT}, - "ANTHROPIC_COMPUTER": {"target": UNIT}, - "ANTHROPIC_BASH": {"target": UNIT}, - "ANTHROPIC_TEXTEDITOR": {"target": UNIT}, - }, -) +GUARDRAIL_VERSION: StaticSchema = (3, n0, _GV, 0) -ACTION_GROUP_SIGNATURE_PARAMS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ActionGroupSignatureParams"), - shape_type=ShapeType.MAP, - members={"key": {"target": STRING}, "value": {"target": STRING}}, +GUARDRAIL_CONFIGURATION: StaticSchema = ( + 18, + n0, + _GC, + 0, + (_gI, _gV), + ((GUARDRAIL_IDENTIFIER, 0), (GUARDRAIL_VERSION, 0)), ) -CREATE_AGENT_ACTION_GROUP_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#CreateAgentActionGroupInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#CreateAgentActionGroupRequest", - ) - ], - members={ - "agentId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "agentVersion": { - "target": DRAFT_VERSION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "actionGroupName": { - "target": NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "description": {"target": DESCRIPTION}, - "parentActionGroupSignature": {"target": ACTION_GROUP_SIGNATURE}, - "parentActionGroupSignatureParams": {"target": ACTION_GROUP_SIGNATURE_PARAMS}, - "actionGroupExecutor": {"target": ACTION_GROUP_EXECUTOR}, - "apiSchema": {"target": API_SCHEMA}, - "actionGroupState": {"target": ACTION_GROUP_STATE}, - "functionSchema": {"target": FUNCTION_SCHEMA}, - }, -) +SESSION_TTL: StaticSchema = (7, n0, _STTL, 0) -VERSION = Schema( - id=ShapeID("com.amazonaws.bedrockagent#Version"), shape_type=ShapeType.STRING -) - -DATE_TIMESTAMP = Schema( - id=ShapeID("com.amazonaws.bedrockagent#DateTimestamp"), - shape_type=ShapeType.TIMESTAMP, - traits=[Trait.new(id=ShapeID("smithy.api#timestampFormat"), value="date-time")], -) - -AGENT_ACTION_GROUP = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#AgentActionGroup"), - members={ - "agentId": { - "target": ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentVersion": { - "target": VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "actionGroupId": { - "target": ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "actionGroupName": { - "target": NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientToken": {"target": CLIENT_TOKEN}, - "description": {"target": DESCRIPTION}, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "parentActionSignature": {"target": ACTION_GROUP_SIGNATURE}, - "parentActionGroupSignatureParams": {"target": ACTION_GROUP_SIGNATURE_PARAMS}, - "actionGroupExecutor": {"target": ACTION_GROUP_EXECUTOR}, - "apiSchema": {"target": API_SCHEMA}, - "functionSchema": {"target": FUNCTION_SCHEMA}, - "actionGroupState": { - "target": ACTION_GROUP_STATE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +INSTRUCTION: StaticSchema = (3, n0, _In, 4) -CREATE_AGENT_ACTION_GROUP_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#CreateAgentActionGroupOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#CreateAgentActionGroupResponse", - ) - ], - members={ - "agentActionGroup": { - "target": AGENT_ACTION_GROUP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +MEMORY_TYPE: StaticSchema = (14, n0, _MT, 0, (_SS,), ((-1, {_sV: _SS}),)) -INTERNAL_SERVER_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#InternalServerException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="server"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=500), - ], - members={"message": {"target": NON_BLANK_STRING}}, -) - -RESOURCE_NOT_FOUND_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=404), - ], - members={"message": {"target": NON_BLANK_STRING}}, -) - -SERVICE_QUOTA_EXCEEDED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ServiceQuotaExceededException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=402), - ], - members={"message": {"target": NON_BLANK_STRING}}, -) - -THROTTLING_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=429), - ], - members={"message": {"target": NON_BLANK_STRING}}, -) - -VALIDATION_EXCEPTION_FIELD = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ValidationExceptionField"), - members={ - "name": { - "target": NON_BLANK_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "message": { - "target": NON_BLANK_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +ENABLED_MEMORY_TYPES: StaticSchema = (16, n0, _EMT, 0, (_me,), ((MEMORY_TYPE, 0),)) -VALIDATION_EXCEPTION_FIELD_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ValidationExceptionFieldList"), - shape_type=ShapeType.LIST, - members={"member": {"target": VALIDATION_EXCEPTION_FIELD}}, -) +MAX_RECENT_SESSIONS: StaticSchema = (7, n0, _MRS, 0) -VALIDATION_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ValidationException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={ - "message": {"target": NON_BLANK_STRING}, - "fieldList": {"target": VALIDATION_EXCEPTION_FIELD_LIST}, - }, +SESSION_SUMMARY_CONFIGURATION: StaticSchema = ( + 18, + n0, + _SSC, + 0, + (_mRS,), + ((MAX_RECENT_SESSIONS, {_smithya: None}),), ) -CREATE_AGENT_ACTION_GROUP = Schema( - id=ShapeID("com.amazonaws.bedrockagent#CreateAgentActionGroup"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "PUT", - "uri": "/agents/{agentId}/agentversions/{agentVersion}/actiongroups/", - } - ), - ) - ], +STORAGE_DAYS: StaticSchema = (7, n0, _SD, {_smithya: 30}) + +MEMORY_CONFIGURATION: StaticSchema = ( + 18, + n0, + _MC, + 0, + (_eMT, _sD, _sSC), + ( + (ENABLED_MEMORY_TYPES, 1), + (STORAGE_DAYS, {_smithya: 30}), + (SESSION_SUMMARY_CONFIGURATION, 0), + ), ) -DELETE_AGENT_ACTION_GROUP_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#DeleteAgentActionGroupInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#DeleteAgentActionGroupRequest", - ) - ], - members={ - "agentId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "agentVersion": { - "target": DRAFT_VERSION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "actionGroupId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "skipResourceInUseCheck": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=False), - Trait.new( - id=ShapeID("smithy.api#httpQuery"), value="skipResourceInUseCheck" - ), - ], - }, - }, +ORCHESTRATION_TYPE: StaticSchema = ( + 14, + n0, + _OT, + 0, + (_DEFAULT, _CO_), + ((-1, {_sV: _DEFAULT}), (-1, {_sV: _CO_})), ) -DELETE_AGENT_ACTION_GROUP_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#DeleteAgentActionGroupOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#DeleteAgentActionGroupResponse", - ) - ], -) - -DELETE_AGENT_ACTION_GROUP = Schema( - id=ShapeID("com.amazonaws.bedrockagent#DeleteAgentActionGroup"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 204, - "method": "DELETE", - "uri": "/agents/{agentId}/agentversions/{agentVersion}/actiongroups/{actionGroupId}/", - } - ), - ) - ], +BASE_PROMPT_TEMPLATE: StaticSchema = (3, n0, _BPT, 4) + +MAXIMUM_LENGTH: StaticSchema = (7, n0, _ML, 0) + +STOP_SEQUENCES: StaticSchema = (16, n0, _SSt, 0, (_me,), ((3, 0),)) + +TEMPERATURE: StaticSchema = (9, n0, _Te, 0) + +TOP_K: StaticSchema = (7, n0, _TK, 0) + +TOP_P: StaticSchema = (9, n0, _TP, 0) + +INFERENCE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _IC, + 0, + (_te, _tP, _tK, _mL, _sS), + ( + (TEMPERATURE, 0), + (TOP_P, 0), + (TOP_K, 0), + (MAXIMUM_LENGTH, 0), + (STOP_SEQUENCES, 0), + ), ) -GET_AGENT_ACTION_GROUP_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#GetAgentActionGroupInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#GetAgentActionGroupRequest", - ) - ], - members={ - "agentId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "agentVersion": { - "target": VERSION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "actionGroupId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, +CREATION_MODE: StaticSchema = ( + 14, + n0, + _CM, + 0, + (_DEFAULT, _OVERRIDDEN), + ((-1, {_sV: _DEFAULT}), (-1, {_sV: _OVERRIDDEN})), +) + +PROMPT_STATE: StaticSchema = ( + 14, + n0, + _PS, + 0, + (_ENABLED, _DISABLED), + ((-1, {_sV: _ENABLED}), (-1, {_sV: _DISABLED})), +) + +PROMPT_TYPE: StaticSchema = ( + 14, + n0, + _PT, + 0, + (_PP, _ORCHESTRATION, _PP_, _KBRG, _MS), + ( + (-1, {_sV: _PP}), + (-1, {_sV: _ORCHESTRATION}), + (-1, {_sV: _PP_}), + (-1, {_sV: _KBRG}), + (-1, {_sV: _MS}), + ), ) -GET_AGENT_ACTION_GROUP_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#GetAgentActionGroupOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#GetAgentActionGroupResponse", - ) - ], - members={ - "agentActionGroup": { - "target": AGENT_ACTION_GROUP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +PROMPT_CONFIGURATION: StaticSchema = ( + 18, + n0, + _PC, + 0, + (_pT, _pCM, _pS, _bPT, _iC, _pM, _fM, _aMRF), + ( + (PROMPT_TYPE, 0), + (CREATION_MODE, 0), + (PROMPT_STATE, 0), + (BASE_PROMPT_TEMPLATE, 0), + (INFERENCE_CONFIGURATION, 0), + (CREATION_MODE, 0), + (MODEL_IDENTIFIER, 0), + (13, 0), + ), ) -GET_AGENT_ACTION_GROUP = Schema( - id=ShapeID("com.amazonaws.bedrockagent#GetAgentActionGroup"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/agents/{agentId}/agentversions/{agentVersion}/actiongroups/{actionGroupId}/", - } - ), - ) - ], +PROMPT_CONFIGURATIONS: StaticSchema = ( + 16, + n0, + _PCr, + 0, + (_me,), + ((PROMPT_CONFIGURATION, 0),), +) + +PROMPT_OVERRIDE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _POC, + 4, + (_pC, _oL), + ((PROMPT_CONFIGURATIONS, 1), (LAMBDA_ARN, 0)), +) + +RECOMMENDED_ACTION: StaticSchema = (3, n0, _RA, 0) + +RECOMMENDED_ACTIONS: StaticSchema = ( + 16, + n0, + _RAe, + 0, + (_me,), + ((RECOMMENDED_ACTION, 0),), +) + +AGENT: StaticSchema = ( + 18, + n0, + _A, + 0, + ( + _aI, + _aN, + _aA, + _aV, + _cT, + _in, + _aSg, + _fM, + _d, + _oT, + _cO, + _iSTTLIS, + _aRRA, + _cEKA, + _cA, + _uA, + _pA, + _fR, + _rA, + _pOC, + _gC, + _mC, + _aC, + ), + ( + (ID, 1), + (NAME, 1), + (AGENT_ARN, 1), + (DRAFT_VERSION, 1), + (CLIENT_TOKEN, 0), + (INSTRUCTION, 0), + (AGENT_STATUS, 1), + (MODEL_IDENTIFIER, 0), + (DESCRIPTION, 0), + (ORCHESTRATION_TYPE, 0), + (CUSTOM_ORCHESTRATION, 0), + (SESSION_TTL, 1), + (AGENT_ROLE_ARN, 1), + (KMS_KEY_ARN, 0), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 0), + (FAILURE_REASONS, 0), + (RECOMMENDED_ACTIONS, 0), + (PROMPT_OVERRIDE_CONFIGURATION, 0), + (GUARDRAIL_CONFIGURATION, 0), + (MEMORY_CONFIGURATION, 0), + (AGENT_COLLABORATION, 0), + ), ) -MAX_RESULTS = Schema( - id=ShapeID("com.amazonaws.bedrockagent#MaxResults"), shape_type=ShapeType.INTEGER +AGENT_ALIAS_ARN: StaticSchema = (3, n0, _AAA, 0) + +PROVISIONED_MODEL_IDENTIFIER: StaticSchema = (3, n0, _PMI, 0) + +AGENT_ALIAS_ROUTING_CONFIGURATION_LIST_ITEM: StaticSchema = ( + 18, + n0, + _AARCLI, + 0, + (_aV, _pTr), + ((VERSION, 0), (PROVISIONED_MODEL_IDENTIFIER, 0)), +) + +AGENT_ALIAS_ROUTING_CONFIGURATION: StaticSchema = ( + 16, + n0, + _AARC, + 0, + (_me,), + ((AGENT_ALIAS_ROUTING_CONFIGURATION_LIST_ITEM, 0),), +) + +AGENT_ALIAS_HISTORY_EVENT: StaticSchema = ( + 18, + n0, + _AAHE, + 0, + (_rCo, _eD, _sDt), + ((AGENT_ALIAS_ROUTING_CONFIGURATION, 0), (DATE_TIMESTAMP, 0), (DATE_TIMESTAMP, 0)), +) + +AGENT_ALIAS_HISTORY_EVENTS: StaticSchema = ( + 16, + n0, + _AAHEg, + 0, + (_me,), + ((AGENT_ALIAS_HISTORY_EVENT, 0),), +) + +AGENT_ALIAS_ID: StaticSchema = (3, n0, _AAI, 0) + +AGENT_ALIAS_STATUS: StaticSchema = ( + 14, + n0, + _AAS, + 0, + (_CREATING, _PREPARED, _FAILED, _UPDATING, _DELETING, _DISSOCIATED), + ( + (-1, {_sV: _CREATING}), + (-1, {_sV: _PREPARED}), + (-1, {_sV: _FAILED}), + (-1, {_sV: _UPDATING}), + (-1, {_sV: _DELETING}), + (-1, {_sV: _DISSOCIATED}), + ), ) -NEXT_TOKEN = Schema( - id=ShapeID("com.amazonaws.bedrockagent#NextToken"), shape_type=ShapeType.STRING +ALIAS_INVOCATION_STATE: StaticSchema = ( + 14, + n0, + _AIS, + 0, + (_AI, _RI), + ((-1, {_sV: _AI}), (-1, {_sV: _RI})), +) + +AGENT_ALIAS: StaticSchema = ( + 18, + n0, + _AAg, + 0, + (_aI, _aAI, _aAN, _aAA, _cT, _d, _rCo, _cA, _uA, _aAHE, _aAS, _fR, _aIS), + ( + (ID, 1), + (AGENT_ALIAS_ID, 1), + (NAME, 1), + (AGENT_ALIAS_ARN, 1), + (CLIENT_TOKEN, 0), + (DESCRIPTION, 0), + (AGENT_ALIAS_ROUTING_CONFIGURATION, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (AGENT_ALIAS_HISTORY_EVENTS, 0), + (AGENT_ALIAS_STATUS, 1), + (FAILURE_REASONS, 0), + (ALIAS_INVOCATION_STATE, 0), + ), ) -LIST_AGENT_ACTION_GROUPS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ListAgentActionGroupsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#ListAgentActionGroupsRequest", - ) - ], - members={ - "agentId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "agentVersion": { - "target": VERSION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "maxResults": {"target": MAX_RESULTS}, - "nextToken": {"target": NEXT_TOKEN}, - }, +AGENT_ALIAS_SUMMARY: StaticSchema = ( + 18, + n0, + _AASg, + 0, + (_aAI, _aAN, _d, _rCo, _aAS, _cA, _uA, _aIS), + ( + (AGENT_ALIAS_ID, 1), + (NAME, 1), + (DESCRIPTION, 0), + (AGENT_ALIAS_ROUTING_CONFIGURATION, 0), + (AGENT_ALIAS_STATUS, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (ALIAS_INVOCATION_STATE, 0), + ), ) -ACTION_GROUP_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ActionGroupSummary"), - members={ - "actionGroupId": { - "target": ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "actionGroupName": { - "target": NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "actionGroupState": { - "target": ACTION_GROUP_STATE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +AGENT_ALIAS_SUMMARIES: StaticSchema = ( + 16, + n0, + _AASge, + 0, + (_me,), + ((AGENT_ALIAS_SUMMARY, 0),), +) + +AGENT_DESCRIPTOR: StaticSchema = (18, n0, _AD, 0, (_aAl,), ((AGENT_ALIAS_ARN, 0),)) + +COLLABORATION_INSTRUCTION: StaticSchema = (3, n0, _CI, 4) + +RELAY_CONVERSATION_HISTORY: StaticSchema = ( + 14, + n0, + _RCH, + 0, + (_TC, _DISABLED), + ((-1, {_sV: _TC}), (-1, {_sV: _DISABLED})), +) + +AGENT_COLLABORATOR: StaticSchema = ( + 18, + n0, + _ACge, + 0, + (_aI, _aV, _aD, _cI, _cIo, _cN, _cA, _lUA, _rCH, _cT), + ( + (ID, 1), + (VERSION, 1), + (AGENT_DESCRIPTOR, 1), + (ID, 1), + (COLLABORATION_INSTRUCTION, 1), + (NAME, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (RELAY_CONVERSATION_HISTORY, 0), + (CLIENT_TOKEN, 0), + ), ) -ACTION_GROUP_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ActionGroupSummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": ACTION_GROUP_SUMMARY}}, +ASSOCIATE_AGENT_COLLABORATOR_INPUT: StaticSchema = ( + 18, + n0, + _AACI, + {_sSI: _cAACR, _smit: None}, + (_aI, _aV, _aD, _cN, _cIo, _rCH, _cT), + ( + (ID, 9), + (DRAFT_VERSION, 9), + (AGENT_DESCRIPTOR, 1), + (NAME, 1), + (COLLABORATION_INSTRUCTION, 1), + (RELAY_CONVERSATION_HISTORY, 0), + (CLIENT_TOKEN, 2), + ), ) -LIST_AGENT_ACTION_GROUPS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ListAgentActionGroupsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#ListAgentActionGroupsResponse", - ) - ], - members={ - "actionGroupSummaries": { - "target": ACTION_GROUP_SUMMARIES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": NEXT_TOKEN}, - }, +ASSOCIATE_AGENT_COLLABORATOR_OUTPUT: StaticSchema = ( + 18, + n0, + _AACO, + {_sSI: _cAACRo, _smith: None}, + (_aCg,), + ((AGENT_COLLABORATOR, 1),), +) + +ASSOCIATE_AGENT_COLLABORATOR: StaticOperationSchema = ( + 23, + n0, + _AAC, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "PUT", + "uri": "/agents/{agentId}/agentversions/{agentVersion}/agentcollaborators/", + } + ) + }, + ASSOCIATE_AGENT_COLLABORATOR_INPUT, + ASSOCIATE_AGENT_COLLABORATOR_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -LIST_AGENT_ACTION_GROUPS = Schema( - id=ShapeID("com.amazonaws.bedrockagent#ListAgentActionGroups"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "POST", - "uri": "/agents/{agentId}/agentversions/{agentVersion}/actiongroups/", - } - ), - ) - ], +DISASSOCIATE_AGENT_COLLABORATOR_INPUT: StaticSchema = ( + 18, + n0, + _DACI, + {_sSI: _cDACR, _smit: None}, + (_aI, _aV, _cI), + ((ID, 9), (DRAFT_VERSION, 9), (ID, 9)), +) + +DISASSOCIATE_AGENT_COLLABORATOR_OUTPUT: StaticSchema = ( + 18, + n0, + _DACO, + {_sSI: _cDACRo, _smith: None}, +) + +DISASSOCIATE_AGENT_COLLABORATOR: StaticOperationSchema = ( + 23, + n0, + _DAC, + { + _smithy: MappingProxyType( + { + "code": 204, + "method": "DELETE", + "uri": "/agents/{agentId}/agentversions/{agentVersion}/agentcollaborators/{collaboratorId}/", + } + ) + }, + DISASSOCIATE_AGENT_COLLABORATOR_INPUT, + DISASSOCIATE_AGENT_COLLABORATOR_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -UPDATE_AGENT_ACTION_GROUP_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#UpdateAgentActionGroupInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#UpdateAgentActionGroupRequest", - ) - ], - members={ - "agentId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "agentVersion": { - "target": DRAFT_VERSION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "actionGroupId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "actionGroupName": { - "target": NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "parentActionGroupSignature": {"target": ACTION_GROUP_SIGNATURE}, - "parentActionGroupSignatureParams": {"target": ACTION_GROUP_SIGNATURE_PARAMS}, - "actionGroupExecutor": {"target": ACTION_GROUP_EXECUTOR}, - "actionGroupState": {"target": ACTION_GROUP_STATE}, - "apiSchema": {"target": API_SCHEMA}, - "functionSchema": {"target": FUNCTION_SCHEMA}, - }, +GET_AGENT_COLLABORATOR_INPUT: StaticSchema = ( + 18, + n0, + _GACI, + {_sSI: _cGACR, _smit: None}, + (_aI, _aV, _cI), + ((ID, 9), (VERSION, 9), (ID, 9)), +) + +GET_AGENT_COLLABORATOR_OUTPUT: StaticSchema = ( + 18, + n0, + _GACO, + {_sSI: _cGACRo, _smith: None}, + (_aCg,), + ((AGENT_COLLABORATOR, 1),), +) + +GET_AGENT_COLLABORATOR: StaticOperationSchema = ( + 23, + n0, + _GAC, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "GET", + "uri": "/agents/{agentId}/agentversions/{agentVersion}/agentcollaborators/{collaboratorId}/", + } + ) + }, + GET_AGENT_COLLABORATOR_INPUT, + GET_AGENT_COLLABORATOR_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -UPDATE_AGENT_ACTION_GROUP_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#UpdateAgentActionGroupOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#UpdateAgentActionGroupResponse", - ) - ], - members={ - "agentActionGroup": { - "target": AGENT_ACTION_GROUP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +LIST_AGENT_COLLABORATORS_INPUT: StaticSchema = ( + 18, + n0, + _LACI, + {_sSI: _cLACR, _smit: None}, + (_aI, _aV, _mR, _nT), + ((ID, 9), (VERSION, 9), (MAX_RESULTS, 0), (NEXT_TOKEN, 0)), +) + +AGENT_COLLABORATOR_SUMMARY: StaticSchema = ( + 18, + n0, + _ACS, + 0, + (_aI, _aV, _cI, _aD, _cIo, _rCH, _cN, _cA, _lUA), + ( + (ID, 1), + (VERSION, 1), + (ID, 1), + (AGENT_DESCRIPTOR, 1), + (COLLABORATION_INSTRUCTION, 1), + (RELAY_CONVERSATION_HISTORY, 1), + (NAME, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + ), ) -UPDATE_AGENT_ACTION_GROUP = Schema( - id=ShapeID("com.amazonaws.bedrockagent#UpdateAgentActionGroup"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "PUT", - "uri": "/agents/{agentId}/agentversions/{agentVersion}/actiongroups/{actionGroupId}/", - } - ), - ) - ], +AGENT_COLLABORATOR_SUMMARIES: StaticSchema = ( + 16, + n0, + _ACSg, + 0, + (_me,), + ((AGENT_COLLABORATOR_SUMMARY, 0),), +) + +LIST_AGENT_COLLABORATORS_OUTPUT: StaticSchema = ( + 18, + n0, + _LACO, + {_sSI: _cLACRo, _smith: None}, + (_aCS, _nT), + ((AGENT_COLLABORATOR_SUMMARIES, 1), (NEXT_TOKEN, 0)), +) + +LIST_AGENT_COLLABORATORS: StaticOperationSchema = ( + 23, + n0, + _LAC, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "POST", + "uri": "/agents/{agentId}/agentversions/{agentVersion}/agentcollaborators/", + } + ) + }, + LIST_AGENT_COLLABORATORS_INPUT, + LIST_AGENT_COLLABORATORS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -ADDITIONAL_MODEL_REQUEST_FIELDS_KEY = Schema( - id=ShapeID("com.amazonaws.bedrockagent#AdditionalModelRequestFieldsKey"), - shape_type=ShapeType.STRING, +UPDATE_AGENT_COLLABORATOR_INPUT: StaticSchema = ( + 18, + n0, + _UACI, + {_sSI: _cUACR, _smit: None}, + (_aI, _aV, _cI, _aD, _cN, _cIo, _rCH), + ( + (ID, 9), + (DRAFT_VERSION, 9), + (ID, 9), + (AGENT_DESCRIPTOR, 1), + (NAME, 1), + (COLLABORATION_INSTRUCTION, 1), + (RELAY_CONVERSATION_HISTORY, 0), + ), ) -ADDITIONAL_MODEL_REQUEST_FIELDS_VALUE = Schema( - id=ShapeID("com.amazonaws.bedrockagent#AdditionalModelRequestFieldsValue"), - shape_type=ShapeType.DOCUMENT, +UPDATE_AGENT_COLLABORATOR_OUTPUT: StaticSchema = ( + 18, + n0, + _UACO, + {_sSI: _cUACRo, _smith: None}, + (_aCg,), + ((AGENT_COLLABORATOR, 1),), +) + +UPDATE_AGENT_COLLABORATOR: StaticOperationSchema = ( + 23, + n0, + _UAC, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "PUT", + "uri": "/agents/{agentId}/agentversions/{agentVersion}/agentcollaborators/{collaboratorId}/", + } + ) + }, + UPDATE_AGENT_COLLABORATOR_INPUT, + UPDATE_AGENT_COLLABORATOR_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -ADDITIONAL_MODEL_REQUEST_FIELDS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#AdditionalModelRequestFields"), - shape_type=ShapeType.MAP, - members={ - "key": {"target": ADDITIONAL_MODEL_REQUEST_FIELDS_KEY}, - "value": {"target": ADDITIONAL_MODEL_REQUEST_FIELDS_VALUE}, - }, +FLOW_AGENT_ALIAS_ARN: StaticSchema = (3, n0, _FAAA, 0) + +AGENT_FLOW_NODE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _AFNC, + 0, + (_aAA,), + ((FLOW_AGENT_ALIAS_ARN, {_smithya: _v_, _smi: None}),), +) + +KNOWLEDGE_BASE_STATE: StaticSchema = ( + 14, + n0, + _KBS, + 0, + (_ENABLED, _DISABLED), + ((-1, {_sV: _ENABLED}), (-1, {_sV: _DISABLED})), +) + +AGENT_KNOWLEDGE_BASE: StaticSchema = ( + 18, + n0, + _AKB, + 0, + (_aI, _aV, _kBI, _d, _cA, _uA, _kBS), + ( + (ID, 1), + (VERSION, 1), + (ID, 1), + (DESCRIPTION, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (KNOWLEDGE_BASE_STATE, 1), + ), ) -AGENT_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagent#AgentArn"), shape_type=ShapeType.STRING +AGENT_KNOWLEDGE_BASE_SUMMARY: StaticSchema = ( + 18, + n0, + _AKBS, + 0, + (_kBI, _d, _kBS, _uA), + ((ID, 1), (DESCRIPTION, 0), (KNOWLEDGE_BASE_STATE, 1), (DATE_TIMESTAMP, 1)), +) + +AGENT_KNOWLEDGE_BASE_SUMMARIES: StaticSchema = ( + 16, + n0, + _AKBSg, + 0, + (_me,), + ((AGENT_KNOWLEDGE_BASE_SUMMARY, 0),), +) + +TAG_KEY: StaticSchema = (3, n0, _TKa, 0) + +TAG_VALUE: StaticSchema = (3, n0, _TV, 0) + +TAGS_MAP: StaticSchema = (17, n0, _TM, 0, (_k, _v), ((TAG_KEY, 0), (TAG_VALUE, 0))) + +CREATE_AGENT_INPUT: StaticSchema = ( + 18, + n0, + _CAI, + {_sSI: _cCAR, _smit: None}, + ( + _aN, + _cT, + _in, + _fM, + _d, + _oT, + _cO, + _iSTTLIS, + _aRRA, + _cEKA, + _ta, + _pOC, + _gC, + _mC, + _aC, + ), + ( + (NAME, 1), + (CLIENT_TOKEN, 2), + (INSTRUCTION, 0), + (MODEL_IDENTIFIER, 0), + (DESCRIPTION, 0), + (ORCHESTRATION_TYPE, 0), + (CUSTOM_ORCHESTRATION, 0), + (SESSION_TTL, 0), + (AGENT_ROLE_ARN, 0), + (KMS_KEY_ARN, 0), + (TAGS_MAP, 0), + (PROMPT_OVERRIDE_CONFIGURATION, 0), + (GUARDRAIL_CONFIGURATION, 0), + (MEMORY_CONFIGURATION, 0), + (AGENT_COLLABORATION, 0), + ), ) -AGENT_COLLABORATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#AgentCollaboration"), - shape_type=ShapeType.ENUM, - members={ - "SUPERVISOR": {"target": UNIT}, - "SUPERVISOR_ROUTER": {"target": UNIT}, - "DISABLED": {"target": UNIT}, - }, +CREATE_AGENT_OUTPUT: StaticSchema = ( + 18, + n0, + _CAO, + {_sSI: _cCARo, _smith: None}, + (_ag,), + ((AGENT, 1),), +) + +CREATE_AGENT: StaticOperationSchema = ( + 23, + n0, + _CA, + {_smithy: MappingProxyType({"code": 202, "method": "PUT", "uri": "/agents/"})}, + CREATE_AGENT_INPUT, + CREATE_AGENT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AGENT_ROLE_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagent#AgentRoleArn"), shape_type=ShapeType.STRING +DELETE_AGENT_INPUT: StaticSchema = ( + 18, + n0, + _DAI, + {_sSI: _cDAR, _smit: None}, + (_aI, _sRIUC), + ((ID, 9), (2, {_smithya: False, _sQ: _sRIUC})), +) + +DELETE_AGENT_OUTPUT: StaticSchema = ( + 18, + n0, + _DAO, + {_sSI: _cDARo, _smith: None}, + (_aI, _aSg), + ((ID, 1), (AGENT_STATUS, 1)), +) + +DELETE_AGENT: StaticOperationSchema = ( + 23, + n0, + _DA, + { + _smithy: MappingProxyType( + {"code": 202, "method": "DELETE", "uri": "/agents/{agentId}/"} + ) + }, + DELETE_AGENT_INPUT, + DELETE_AGENT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AGENT_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#AgentStatus"), - shape_type=ShapeType.ENUM, - members={ - "CREATING": {"target": UNIT}, - "PREPARING": {"target": UNIT}, - "PREPARED": {"target": UNIT}, - "NOT_PREPARED": {"target": UNIT}, - "DELETING": {"target": UNIT}, - "FAILED": {"target": UNIT}, - "VERSIONING": {"target": UNIT}, - "UPDATING": {"target": UNIT}, - }, +GET_AGENT_INPUT: StaticSchema = ( + 18, + n0, + _GAI, + {_sSI: _cGAR, _smit: None}, + (_aI,), + ((ID, 9),), +) + +GET_AGENT_OUTPUT: StaticSchema = ( + 18, + n0, + _GAO, + {_sSI: _cGARo, _smith: None}, + (_ag,), + ((AGENT, 1),), +) + +GET_AGENT: StaticOperationSchema = ( + 23, + n0, + _GA, + { + _smithy: MappingProxyType( + {"code": 200, "method": "GET", "uri": "/agents/{agentId}/"} + ) + }, + GET_AGENT_INPUT, + GET_AGENT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -KMS_KEY_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagent#KmsKeyArn"), shape_type=ShapeType.STRING +LIST_AGENTS_INPUT: StaticSchema = ( + 18, + n0, + _LAI, + {_sSI: _cLAR, _smit: None}, + (_mR, _nT), + ((MAX_RESULTS, 0), (NEXT_TOKEN, 0)), +) + +AGENT_SUMMARY: StaticSchema = ( + 18, + n0, + _ASg, + 0, + (_aI, _aN, _aSg, _d, _uA, _lAV, _gC), + ( + (ID, 1), + (NAME, 1), + (AGENT_STATUS, 1), + (DESCRIPTION, 0), + (DATE_TIMESTAMP, 1), + (VERSION, 0), + (GUARDRAIL_CONFIGURATION, 0), + ), ) -ORCHESTRATION_EXECUTOR = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#OrchestrationExecutor"), - shape_type=ShapeType.UNION, - members={"lambda": {"target": LAMBDA_ARN}}, +AGENT_SUMMARIES: StaticSchema = (16, n0, _ASge, 0, (_me,), ((AGENT_SUMMARY, 0),)) + +LIST_AGENTS_OUTPUT: StaticSchema = ( + 18, + n0, + _LAO, + {_sSI: _cLARo, _smith: None}, + (_aSge, _nT), + ((AGENT_SUMMARIES, 1), (NEXT_TOKEN, 0)), +) + +LIST_AGENTS: StaticOperationSchema = ( + 23, + n0, + _LAi, + {_smithy: MappingProxyType({"code": 200, "method": "POST", "uri": "/agents/"})}, + LIST_AGENTS_INPUT, + LIST_AGENTS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CUSTOM_ORCHESTRATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#CustomOrchestration"), - members={"executor": {"target": ORCHESTRATION_EXECUTOR}}, +PREPARE_AGENT_INPUT: StaticSchema = ( + 18, + n0, + _PAI, + {_sSI: _cPAR, _smit: None}, + (_aI,), + ((ID, 9),), +) + +PREPARE_AGENT_OUTPUT: StaticSchema = ( + 18, + n0, + _PAO, + {_sSI: _cPARo, _smith: None}, + (_aI, _aSg, _aV, _pA), + ((ID, 1), (AGENT_STATUS, 1), (VERSION, 1), (DATE_TIMESTAMP, 1)), +) + +PREPARE_AGENT: StaticOperationSchema = ( + 23, + n0, + _PA, + { + _smithy: MappingProxyType( + {"code": 202, "method": "POST", "uri": "/agents/{agentId}/"} + ) + }, + PREPARE_AGENT_INPUT, + PREPARE_AGENT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -FAILURE_REASON = Schema( - id=ShapeID("com.amazonaws.bedrockagent#FailureReason"), shape_type=ShapeType.STRING +UPDATE_AGENT_INPUT: StaticSchema = ( + 18, + n0, + _UAI, + {_sSI: _cUAR, _smit: None}, + (_aI, _aN, _in, _fM, _d, _oT, _cO, _iSTTLIS, _aRRA, _cEKA, _pOC, _gC, _mC, _aC), + ( + (ID, 9), + (NAME, 1), + (INSTRUCTION, 0), + (MODEL_IDENTIFIER, 1), + (DESCRIPTION, 0), + (ORCHESTRATION_TYPE, 0), + (CUSTOM_ORCHESTRATION, 0), + (SESSION_TTL, 0), + (AGENT_ROLE_ARN, 1), + (KMS_KEY_ARN, 0), + (PROMPT_OVERRIDE_CONFIGURATION, 0), + (GUARDRAIL_CONFIGURATION, 0), + (MEMORY_CONFIGURATION, 0), + (AGENT_COLLABORATION, 0), + ), ) -FAILURE_REASONS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#FailureReasons"), - shape_type=ShapeType.LIST, - members={"member": {"target": FAILURE_REASON}}, +UPDATE_AGENT_OUTPUT: StaticSchema = ( + 18, + n0, + _UAO, + {_sSI: _cUARo, _smith: None}, + (_ag,), + ((AGENT, 1),), +) + +UPDATE_AGENT: StaticOperationSchema = ( + 23, + n0, + _UA, + { + _smithy: MappingProxyType( + {"code": 202, "method": "PUT", "uri": "/agents/{agentId}/"} + ) + }, + UPDATE_AGENT_INPUT, + UPDATE_AGENT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -MODEL_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrockagent#ModelIdentifier"), - shape_type=ShapeType.STRING, +NUMERICAL_VERSION: StaticSchema = (3, n0, _NV, 0) + +AGENT_VERSION: StaticSchema = ( + 18, + n0, + _AV, + 0, + ( + _aI, + _aN, + _aA, + _ve, + _in, + _aSg, + _fM, + _d, + _iSTTLIS, + _aRRA, + _cEKA, + _cA, + _uA, + _fR, + _rA, + _pOC, + _gC, + _mC, + _aC, + ), + ( + (ID, 1), + (NAME, 1), + (AGENT_ARN, 1), + (NUMERICAL_VERSION, 1), + (INSTRUCTION, 0), + (AGENT_STATUS, 1), + (MODEL_IDENTIFIER, 0), + (DESCRIPTION, 0), + (SESSION_TTL, 1), + (AGENT_ROLE_ARN, 1), + (KMS_KEY_ARN, 0), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (FAILURE_REASONS, 0), + (RECOMMENDED_ACTIONS, 0), + (PROMPT_OVERRIDE_CONFIGURATION, 0), + (GUARDRAIL_CONFIGURATION, 0), + (MEMORY_CONFIGURATION, 0), + (AGENT_COLLABORATION, 0), + ), ) -GUARDRAIL_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrockagent#GuardrailIdentifier"), - shape_type=ShapeType.STRING, +AGENT_VERSION_SUMMARY: StaticSchema = ( + 18, + n0, + _AVS, + 0, + (_aN, _aSg, _aV, _cA, _uA, _d, _gC), + ( + (NAME, 1), + (AGENT_STATUS, 1), + (VERSION, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (DESCRIPTION, 0), + (GUARDRAIL_CONFIGURATION, 0), + ), ) -GUARDRAIL_VERSION = Schema( - id=ShapeID("com.amazonaws.bedrockagent#GuardrailVersion"), - shape_type=ShapeType.STRING, +AGENT_VERSION_SUMMARIES: StaticSchema = ( + 16, + n0, + _AVSg, + 0, + (_me,), + ((AGENT_VERSION_SUMMARY, 0),), +) + +CREATE_AGENT_ALIAS_INPUT: StaticSchema = ( + 18, + n0, + _CAAI, + {_sSI: _cCAAR, _smit: None}, + (_aI, _aAN, _cT, _d, _rCo, _ta), + ( + (ID, 9), + (NAME, 1), + (CLIENT_TOKEN, 2), + (DESCRIPTION, 0), + (AGENT_ALIAS_ROUTING_CONFIGURATION, 0), + (TAGS_MAP, 0), + ), ) -GUARDRAIL_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#GuardrailConfiguration"), - members={ - "guardrailIdentifier": {"target": GUARDRAIL_IDENTIFIER}, - "guardrailVersion": {"target": GUARDRAIL_VERSION}, - }, +CREATE_AGENT_ALIAS_OUTPUT: StaticSchema = ( + 18, + n0, + _CAAO, + {_sSI: _cCAARo, _smith: None}, + (_aAg,), + ((AGENT_ALIAS, 1),), +) + +CREATE_AGENT_ALIAS: StaticOperationSchema = ( + 23, + n0, + _CAA, + { + _smithy: MappingProxyType( + {"code": 202, "method": "PUT", "uri": "/agents/{agentId}/agentaliases/"} + ) + }, + CREATE_AGENT_ALIAS_INPUT, + CREATE_AGENT_ALIAS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -SESSION_TTL = Schema( - id=ShapeID("com.amazonaws.bedrockagent#SessionTTL"), shape_type=ShapeType.INTEGER +DELETE_AGENT_ALIAS_INPUT: StaticSchema = ( + 18, + n0, + _DAAI, + {_sSI: _cDAAR, _smit: None}, + (_aI, _aAI), + ((ID, 9), (AGENT_ALIAS_ID, 9)), +) + +DELETE_AGENT_ALIAS_OUTPUT: StaticSchema = ( + 18, + n0, + _DAAO, + {_sSI: _cDAARo, _smith: None}, + (_aI, _aAI, _aAS), + ((ID, 1), (AGENT_ALIAS_ID, 1), (AGENT_ALIAS_STATUS, 1)), +) + +DELETE_AGENT_ALIAS: StaticOperationSchema = ( + 23, + n0, + _DAA, + { + _smithy: MappingProxyType( + { + "code": 202, + "method": "DELETE", + "uri": "/agents/{agentId}/agentaliases/{agentAliasId}/", + } + ) + }, + DELETE_AGENT_ALIAS_INPUT, + DELETE_AGENT_ALIAS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -INSTRUCTION = Schema( - id=ShapeID("com.amazonaws.bedrockagent#Instruction"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +GET_AGENT_ALIAS_INPUT: StaticSchema = ( + 18, + n0, + _GAAI, + {_sSI: _cGAAR, _smit: None}, + (_aI, _aAI), + ((ID, 9), (AGENT_ALIAS_ID, 9)), +) + +GET_AGENT_ALIAS_OUTPUT: StaticSchema = ( + 18, + n0, + _GAAO, + {_sSI: _cGAARo, _smith: None}, + (_aAg,), + ((AGENT_ALIAS, 1),), +) + +GET_AGENT_ALIAS: StaticOperationSchema = ( + 23, + n0, + _GAA, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "GET", + "uri": "/agents/{agentId}/agentaliases/{agentAliasId}/", + } + ) + }, + GET_AGENT_ALIAS_INPUT, + GET_AGENT_ALIAS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -MEMORY_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#MemoryType"), - shape_type=ShapeType.ENUM, - members={"SESSION_SUMMARY": {"target": UNIT}}, +LIST_AGENT_ALIASES_INPUT: StaticSchema = ( + 18, + n0, + _LAAI, + {_sSI: _cLAAR, _smit: None}, + (_aI, _mR, _nT), + ((ID, 9), (MAX_RESULTS, 0), (NEXT_TOKEN, 0)), +) + +LIST_AGENT_ALIASES_OUTPUT: StaticSchema = ( + 18, + n0, + _LAAO, + {_sSI: _cLAARo, _smith: None}, + (_aASg, _nT), + ((AGENT_ALIAS_SUMMARIES, 1), (NEXT_TOKEN, 0)), +) + +LIST_AGENT_ALIASES: StaticOperationSchema = ( + 23, + n0, + _LAA, + { + _smithy: MappingProxyType( + {"code": 200, "method": "POST", "uri": "/agents/{agentId}/agentaliases/"} + ) + }, + LIST_AGENT_ALIASES_INPUT, + LIST_AGENT_ALIASES_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -ENABLED_MEMORY_TYPES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#EnabledMemoryTypes"), - shape_type=ShapeType.LIST, - members={"member": {"target": MEMORY_TYPE}}, +UPDATE_AGENT_ALIAS_INPUT: StaticSchema = ( + 18, + n0, + _UAAI, + {_sSI: _cUAAR, _smit: None}, + (_aI, _aAI, _aAN, _d, _rCo, _aIS), + ( + (ID, 9), + (AGENT_ALIAS_ID, 9), + (NAME, 1), + (DESCRIPTION, 0), + (AGENT_ALIAS_ROUTING_CONFIGURATION, 0), + (ALIAS_INVOCATION_STATE, 0), + ), ) -MAX_RECENT_SESSIONS = Schema( - id=ShapeID("com.amazonaws.bedrockagent#MaxRecentSessions"), - shape_type=ShapeType.INTEGER, +UPDATE_AGENT_ALIAS_OUTPUT: StaticSchema = ( + 18, + n0, + _UAAO, + {_sSI: _cUAARo, _smith: None}, + (_aAg,), + ((AGENT_ALIAS, 1),), +) + +UPDATE_AGENT_ALIAS: StaticOperationSchema = ( + 23, + n0, + _UAA, + { + _smithy: MappingProxyType( + { + "code": 202, + "method": "PUT", + "uri": "/agents/{agentId}/agentaliases/{agentAliasId}/", + } + ) + }, + UPDATE_AGENT_ALIAS_INPUT, + UPDATE_AGENT_ALIAS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -SESSION_SUMMARY_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#SessionSummaryConfiguration"), - members={ - "maxRecentSessions": { - "target": MAX_RECENT_SESSIONS, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=None)], - } - }, +VPC_CONFIGURATION_DESCRIPTION: StaticSchema = (3, n0, _VCD, 0) + +HOST_HEADER: StaticSchema = (3, n0, _HH, 0) + +VPC_CONFIGURATION_NAME: StaticSchema = (3, n0, _VCN, 0) + +PORT: StaticSchema = (7, n0, _Po, 0) + +VPC_PROTOCOL: StaticSchema = ( + 14, + n0, + _VP, + 0, + (_HTTP, _HTTPS), + ((-1, {_sV: _HTTP}), (-1, {_sV: _HTTPS})), ) -STORAGE_DAYS = Schema( - id=ShapeID("com.amazonaws.bedrockagent#StorageDays"), - shape_type=ShapeType.INTEGER, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=30)], -) - -MEMORY_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#MemoryConfiguration"), - members={ - "enabledMemoryTypes": { - "target": ENABLED_MEMORY_TYPES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "storageDays": { - "target": STORAGE_DAYS, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=30)], - }, - "sessionSummaryConfiguration": {"target": SESSION_SUMMARY_CONFIGURATION}, - }, +VPC_RESOLUTION_MODE: StaticSchema = ( + 14, + n0, + _VRM, + 0, + (_PUBLIC, _IV), + ((-1, {_sV: _PUBLIC}), (-1, {_sV: _IV})), ) -ORCHESTRATION_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#OrchestrationType"), - shape_type=ShapeType.ENUM, - members={"DEFAULT": {"target": UNIT}, "CUSTOM_ORCHESTRATION": {"target": UNIT}}, +RESOURCE_TARGET: StaticSchema = (3, n0, _RT, 0) + +SUBNET_ID: StaticSchema = (3, n0, _SIu, 0) + +SUBNET_ID_LIST: StaticSchema = (16, n0, _SIL, 0, (_me,), ((SUBNET_ID, 0),)) + +TLS_SERVER_NAME: StaticSchema = (3, n0, _TSN, 0) + +VPC_ID: StaticSchema = (3, n0, _VI, 0) + +CREATE_VPC_CONFIGURATION_INPUT: StaticSchema = ( + 18, + n0, + _CVCI, + {_sSI: _cCVCR, _smit: None}, + (_kBI, _cT, _vI, _sI, _rT, _po, _pr, _rM, _hH, _tSN, _na, _d), + ( + (ID, 9), + (CLIENT_TOKEN, 2), + (VPC_ID, 1), + (SUBNET_ID_LIST, 1), + (RESOURCE_TARGET, 1), + (PORT, 1), + (VPC_PROTOCOL, 1), + (VPC_RESOLUTION_MODE, 1), + (HOST_HEADER, 0), + (TLS_SERVER_NAME, 0), + (VPC_CONFIGURATION_NAME, 0), + (VPC_CONFIGURATION_DESCRIPTION, 0), + ), ) -BASE_PROMPT_TEMPLATE = Schema( - id=ShapeID("com.amazonaws.bedrockagent#BasePromptTemplate"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +VPC_CONFIGURATION_STATUS: StaticSchema = ( + 14, + n0, + _VCS, + 0, + (_CREATING, _CREATED, _DELETING, _CF, _DF), + ( + (-1, {_sV: _CREATING}), + (-1, {_sV: _CREATED}), + (-1, {_sV: _DELETING}), + (-1, {_sV: _CF}), + (-1, {_sV: _DF}), + ), ) -MAXIMUM_LENGTH = Schema( - id=ShapeID("com.amazonaws.bedrockagent#MaximumLength"), shape_type=ShapeType.INTEGER +VPC_CONFIGURATION_ID: StaticSchema = (3, n0, _VCI, 0) + +CREATE_VPC_CONFIGURATION_OUTPUT: StaticSchema = ( + 18, + n0, + _CVCO, + {_sSI: _cCVCRo, _smith: None}, + (_vCI, _sta), + ((VPC_CONFIGURATION_ID, 1), (VPC_CONFIGURATION_STATUS, 1)), +) + +CREATE_VPC_CONFIGURATION: StaticOperationSchema = ( + 23, + n0, + _CVC, + { + _smithy: MappingProxyType( + { + "code": 202, + "method": "POST", + "uri": "/knowledgebases/{knowledgeBaseId}/vpcconfigurations/", + } + ) + }, + CREATE_VPC_CONFIGURATION_INPUT, + CREATE_VPC_CONFIGURATION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -STOP_SEQUENCES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#StopSequences"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, +DATA_DELETION_POLICY: StaticSchema = ( + 14, + n0, + _DDP, + 0, + (_RETAIN, _DELETE), + ((-1, {_sV: _RETAIN}), (-1, {_sV: _DELETE})), ) -TEMPERATURE = Schema( - id=ShapeID("com.amazonaws.bedrockagent#Temperature"), shape_type=ShapeType.FLOAT +FILTER_PATTERN: StaticSchema = (3, n0, _FP, 4) + +FILTER_LIST: StaticSchema = (16, n0, _FL, 4, (_me,), ((FILTER_PATTERN, 0),)) + +FILTERED_OBJECT_TYPE: StaticSchema = (3, n0, _FOT, 4) + +PATTERN_OBJECT_FILTER: StaticSchema = ( + 18, + n0, + _POF, + 0, + (_oTb, _iF, _eF), + ((FILTERED_OBJECT_TYPE, 1), (FILTER_LIST, 0), (FILTER_LIST, 0)), ) -TOP_K = Schema( - id=ShapeID("com.amazonaws.bedrockagent#TopK"), shape_type=ShapeType.INTEGER +PATTERN_OBJECT_FILTER_LIST: StaticSchema = ( + 16, + n0, + _POFL, + 4, + (_me,), + ((PATTERN_OBJECT_FILTER, 0),), ) -TOP_P = Schema( - id=ShapeID("com.amazonaws.bedrockagent#TopP"), shape_type=ShapeType.FLOAT +PATTERN_OBJECT_FILTER_CONFIGURATION: StaticSchema = ( + 18, + n0, + _POFC, + 0, + (_fi,), + ((PATTERN_OBJECT_FILTER_LIST, 1),), ) -INFERENCE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#InferenceConfiguration"), - members={ - "temperature": {"target": TEMPERATURE}, - "topP": {"target": TOP_P}, - "topK": {"target": TOP_K}, - "maximumLength": {"target": MAXIMUM_LENGTH}, - "stopSequences": {"target": STOP_SEQUENCES}, - }, +CRAWL_FILTER_CONFIGURATION_TYPE: StaticSchema = ( + 14, + n0, + _CFCT, + 0, + (_PATTERN,), + ((-1, {_sV: _PATTERN}),), ) -CREATION_MODE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#CreationMode"), - shape_type=ShapeType.ENUM, - members={"DEFAULT": {"target": UNIT}, "OVERRIDDEN": {"target": UNIT}}, +CRAWL_FILTER_CONFIGURATION: StaticSchema = ( + 18, + n0, + _CFC, + 0, + (_t, _pOF), + ((CRAWL_FILTER_CONFIGURATION_TYPE, 1), (PATTERN_OBJECT_FILTER_CONFIGURATION, 0)), ) -PROMPT_STATE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#PromptState"), - shape_type=ShapeType.ENUM, - members={"ENABLED": {"target": UNIT}, "DISABLED": {"target": UNIT}}, +CONFLUENCE_CRAWLER_CONFIGURATION: StaticSchema = ( + 18, + n0, + _CCC, + 0, + (_fC,), + ((CRAWL_FILTER_CONFIGURATION, 0),), ) -PROMPT_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#PromptType"), - shape_type=ShapeType.ENUM, - members={ - "PRE_PROCESSING": {"target": UNIT}, - "ORCHESTRATION": {"target": UNIT}, - "POST_PROCESSING": {"target": UNIT}, - "KNOWLEDGE_BASE_RESPONSE_GENERATION": {"target": UNIT}, - "MEMORY_SUMMARIZATION": {"target": UNIT}, - }, +CONFLUENCE_AUTH_TYPE: StaticSchema = ( + 14, + n0, + _CAT, + 0, + (_BASIC, _OCC), + ((-1, {_sV: _BASIC}), (-1, {_sV: _OCC})), ) -PROMPT_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#PromptConfiguration"), - members={ - "promptType": {"target": PROMPT_TYPE}, - "promptCreationMode": {"target": CREATION_MODE}, - "promptState": {"target": PROMPT_STATE}, - "basePromptTemplate": {"target": BASE_PROMPT_TEMPLATE}, - "inferenceConfiguration": {"target": INFERENCE_CONFIGURATION}, - "parserMode": {"target": CREATION_MODE}, - "foundationModel": {"target": MODEL_IDENTIFIER}, - "additionalModelRequestFields": {"target": DOCUMENT}, - }, +SECRET_ARN: StaticSchema = (3, n0, _SA, 0) + +CONFLUENCE_HOST_TYPE: StaticSchema = (14, n0, _CHT, 0, (_SAAS,), ((-1, {_sV: _SAAS}),)) + +HTTPS_URL: StaticSchema = (3, n0, _HU, 0) + +CONFLUENCE_SOURCE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _CSC, + 0, + (_hU, _hT, _aT, _cSA), + ( + (HTTPS_URL, 1), + (CONFLUENCE_HOST_TYPE, 1), + (CONFLUENCE_AUTH_TYPE, 1), + (SECRET_ARN, 1), + ), ) -PROMPT_CONFIGURATIONS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#PromptConfigurations"), - shape_type=ShapeType.LIST, - members={"member": {"target": PROMPT_CONFIGURATION}}, +CONFLUENCE_DATA_SOURCE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _CDSC, + 0, + (_sC, _cCr), + ((CONFLUENCE_SOURCE_CONFIGURATION, 1), (CONFLUENCE_CRAWLER_CONFIGURATION, 0)), +) + +ENABLED_OR_DISABLED_STATE: StaticSchema = ( + 14, + n0, + _EODS, + 0, + (_ENABLED, _DISABLED), + ((-1, {_sV: _ENABLED}), (-1, {_sV: _DISABLED})), +) + +DELETION_PROTECTION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _DPC, + 0, + (_dPS, _dPT), + ((ENABLED_OR_DISABLED_STATE, 1), (7, {_smithya: 15})), +) + +AUDIO_EXTRACTION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _AEC, + 0, + (_aES,), + ((ENABLED_OR_DISABLED_STATE, 1),), +) + +IMAGE_EXTRACTION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _IEC, + 0, + (_iES,), + ((ENABLED_OR_DISABLED_STATE, 1),), +) + +VIDEO_EXTRACTION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _VEC, + 0, + (_vES,), + ((ENABLED_OR_DISABLED_STATE, 1),), +) + +MEDIA_EXTRACTION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _MEC, + 0, + (_iEC, _aEC, _vEC), + ( + (IMAGE_EXTRACTION_CONFIGURATION, 0), + (AUDIO_EXTRACTION_CONFIGURATION, 0), + (VIDEO_EXTRACTION_CONFIGURATION, 0), + ), ) -PROMPT_OVERRIDE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#PromptOverrideConfiguration"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "promptConfigurations": { - "target": PROMPT_CONFIGURATIONS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "overrideLambda": {"target": LAMBDA_ARN}, - }, +DAILY_SCHEDULE: StaticSchema = (18, n0, _DS, 0) + +DAY_OF_MONTH_NUMBER: StaticSchema = (7, n0, _DOMN, 0) + +LAST_DAY_OF_MONTH: StaticSchema = (18, n0, _LDOM, 0) + +DAY_OF_MONTH: StaticSchema = ( + 19, + n0, + _DOM, + 0, + (_dN, _lDOM), + ((DAY_OF_MONTH_NUMBER, 0), (LAST_DAY_OF_MONTH, 0)), ) -RECOMMENDED_ACTION = Schema( - id=ShapeID("com.amazonaws.bedrockagent#RecommendedAction"), - shape_type=ShapeType.STRING, -) - -RECOMMENDED_ACTIONS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#RecommendedActions"), - shape_type=ShapeType.LIST, - members={"member": {"target": RECOMMENDED_ACTION}}, -) - -AGENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#Agent"), - members={ - "agentId": { - "target": ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentName": { - "target": NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentArn": { - "target": AGENT_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentVersion": { - "target": DRAFT_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientToken": {"target": CLIENT_TOKEN}, - "instruction": {"target": INSTRUCTION}, - "agentStatus": { - "target": AGENT_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "foundationModel": {"target": MODEL_IDENTIFIER}, - "description": {"target": DESCRIPTION}, - "orchestrationType": {"target": ORCHESTRATION_TYPE}, - "customOrchestration": {"target": CUSTOM_ORCHESTRATION}, - "idleSessionTTLInSeconds": { - "target": SESSION_TTL, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentResourceRoleArn": { - "target": AGENT_ROLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "customerEncryptionKeyArn": {"target": KMS_KEY_ARN}, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "preparedAt": {"target": DATE_TIMESTAMP}, - "failureReasons": {"target": FAILURE_REASONS}, - "recommendedActions": {"target": RECOMMENDED_ACTIONS}, - "promptOverrideConfiguration": {"target": PROMPT_OVERRIDE_CONFIGURATION}, - "guardrailConfiguration": {"target": GUARDRAIL_CONFIGURATION}, - "memoryConfiguration": {"target": MEMORY_CONFIGURATION}, - "agentCollaboration": {"target": AGENT_COLLABORATION}, - }, +MONTHLY_SCHEDULE: StaticSchema = (18, n0, _MSo, 0, (_dOM,), ((DAY_OF_MONTH, 1),)) + +DAY_OF_WEEK: StaticSchema = ( + 14, + n0, + _DOW, + 0, + (_SUNDAY, _MONDAY, _TUESDAY, _WEDNESDAY, _THURSDAY, _FRIDAY, _SATURDAY), + ( + (-1, {_sV: _SUNDAY}), + (-1, {_sV: _MONDAY}), + (-1, {_sV: _TUESDAY}), + (-1, {_sV: _WEDNESDAY}), + (-1, {_sV: _THURSDAY}), + (-1, {_sV: _FRIDAY}), + (-1, {_sV: _SATURDAY}), + ), ) -AGENT_ALIAS_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagent#AgentAliasArn"), shape_type=ShapeType.STRING +WEEKLY_SCHEDULE: StaticSchema = (18, n0, _WS, 0, (_dOW,), ((DAY_OF_WEEK, 1),)) + +SYNC_SCHEDULE: StaticSchema = ( + 19, + n0, + _SSy, + 0, + (_da, _w, _mo), + ((DAILY_SCHEDULE, 0), (WEEKLY_SCHEDULE, 0), (MONTHLY_SCHEDULE, 0)), +) + +MANAGED_KNOWLEDGE_BASE_CONNECTOR_CONFIGURATION: StaticSchema = ( + 18, + n0, + _MKBCC, + 0, + (_dPC, _mEC, _cP, _sSy), + ( + (DELETION_PROTECTION_CONFIGURATION, 0), + (MEDIA_EXTRACTION_CONFIGURATION, 0), + (13, 0), + (SYNC_SCHEDULE, 0), + ), ) -PROVISIONED_MODEL_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrockagent#ProvisionedModelIdentifier"), - shape_type=ShapeType.STRING, +S3_BUCKET_ARN: StaticSchema = (3, n0, _SBA, 0) + +BUCKET_OWNER_ACCOUNT_ID: StaticSchema = (3, n0, _BOAI, 0) + +S3_PREFIX: StaticSchema = (3, n0, _SP, 4) + +S3_PREFIXES: StaticSchema = (16, n0, _SPr, 0, (_me,), ((S3_PREFIX, 0),)) + +S3_DATA_SOURCE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _SDSC, + 0, + (_bA, _iP, _bOAI), + ((S3_BUCKET_ARN, 1), (S3_PREFIXES, 0), (BUCKET_OWNER_ACCOUNT_ID, 0)), ) -AGENT_ALIAS_ROUTING_CONFIGURATION_LIST_ITEM = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#AgentAliasRoutingConfigurationListItem"), - members={ - "agentVersion": {"target": VERSION}, - "provisionedThroughput": {"target": PROVISIONED_MODEL_IDENTIFIER}, - }, +SALESFORCE_CRAWLER_CONFIGURATION: StaticSchema = ( + 18, + n0, + _SCC, + 0, + (_fC,), + ((CRAWL_FILTER_CONFIGURATION, 0),), ) -AGENT_ALIAS_ROUTING_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#AgentAliasRoutingConfiguration"), - shape_type=ShapeType.LIST, - members={"member": {"target": AGENT_ALIAS_ROUTING_CONFIGURATION_LIST_ITEM}}, +SALESFORCE_AUTH_TYPE: StaticSchema = (14, n0, _SAT, 0, (_OCC,), ((-1, {_sV: _OCC}),)) + +SALESFORCE_SOURCE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _SSCa, + 0, + (_hU, _aT, _cSA), + ((HTTPS_URL, 1), (SALESFORCE_AUTH_TYPE, 1), (SECRET_ARN, 1)), ) -AGENT_ALIAS_HISTORY_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#AgentAliasHistoryEvent"), - members={ - "routingConfiguration": {"target": AGENT_ALIAS_ROUTING_CONFIGURATION}, - "endDate": {"target": DATE_TIMESTAMP}, - "startDate": {"target": DATE_TIMESTAMP}, - }, +SALESFORCE_DATA_SOURCE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _SDSCa, + 0, + (_sC, _cCr), + ((SALESFORCE_SOURCE_CONFIGURATION, 1), (SALESFORCE_CRAWLER_CONFIGURATION, 0)), ) -AGENT_ALIAS_HISTORY_EVENTS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#AgentAliasHistoryEvents"), - shape_type=ShapeType.LIST, - members={"member": {"target": AGENT_ALIAS_HISTORY_EVENT}}, +SHARE_POINT_CRAWLER_CONFIGURATION: StaticSchema = ( + 18, + n0, + _SPCC, + 0, + (_fC,), + ((CRAWL_FILTER_CONFIGURATION, 0),), ) -AGENT_ALIAS_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagent#AgentAliasId"), shape_type=ShapeType.STRING +SHARE_POINT_AUTH_TYPE: StaticSchema = ( + 14, + n0, + _SPAT, + 0, + (_OCC, _OSAOCC), + ((-1, {_sV: _OCC}), (-1, {_sV: _OSAOCC})), ) -AGENT_ALIAS_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#AgentAliasStatus"), - shape_type=ShapeType.ENUM, - members={ - "CREATING": {"target": UNIT}, - "PREPARED": {"target": UNIT}, - "FAILED": {"target": UNIT}, - "UPDATING": {"target": UNIT}, - "DELETING": {"target": UNIT}, - "DISSOCIATED": {"target": UNIT}, - }, +SHARE_POINT_DOMAIN: StaticSchema = (3, n0, _SPD, 0) + +SHARE_POINT_HOST_TYPE: StaticSchema = ( + 14, + n0, + _SPHT, + 0, + (_ONLINE,), + ((-1, {_sV: _ONLINE}),), ) -ALIAS_INVOCATION_STATE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#AliasInvocationState"), - shape_type=ShapeType.ENUM, - members={ - "ACCEPT_INVOCATIONS": {"target": UNIT}, - "REJECT_INVOCATIONS": {"target": UNIT}, - }, +SHARE_POINT_SITE_URLS: StaticSchema = (16, n0, _SPSU, 0, (_me,), ((HTTPS_URL, 0),)) + +MICROSOFT365_TENANT_ID: StaticSchema = (3, n0, _MTI, 0) + +SHARE_POINT_SOURCE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _SPSC, + 0, + (_tI, _do, _sU, _hT, _aT, _cSA), + ( + (MICROSOFT365_TENANT_ID, 0), + (SHARE_POINT_DOMAIN, 1), + (SHARE_POINT_SITE_URLS, 1), + (SHARE_POINT_HOST_TYPE, 1), + (SHARE_POINT_AUTH_TYPE, 1), + (SECRET_ARN, 1), + ), ) -AGENT_ALIAS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#AgentAlias"), - members={ - "agentId": { - "target": ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentAliasId": { - "target": AGENT_ALIAS_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentAliasName": { - "target": NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentAliasArn": { - "target": AGENT_ALIAS_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientToken": {"target": CLIENT_TOKEN}, - "description": {"target": DESCRIPTION}, - "routingConfiguration": { - "target": AGENT_ALIAS_ROUTING_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentAliasHistoryEvents": {"target": AGENT_ALIAS_HISTORY_EVENTS}, - "agentAliasStatus": { - "target": AGENT_ALIAS_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "failureReasons": {"target": FAILURE_REASONS}, - "aliasInvocationState": {"target": ALIAS_INVOCATION_STATE}, - }, +SHARE_POINT_DATA_SOURCE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _SPDSC, + 0, + (_sC, _cCr), + ((SHARE_POINT_SOURCE_CONFIGURATION, 1), (SHARE_POINT_CRAWLER_CONFIGURATION, 0)), +) + +DATA_SOURCE_TYPE: StaticSchema = ( + 14, + n0, + _DST, + 0, + (_S, _WEB, _CONFLUENCE, _SALESFORCE, _SHAREPOINT, _CUSTOM, _RM, _MKBC), + ( + (-1, {_sV: _S}), + (-1, {_sV: _WEB}), + (-1, {_sV: _CONFLUENCE}), + (-1, {_sV: _SALESFORCE}), + (-1, {_sV: _SHAREPOINT}), + (-1, {_sV: _CUSTOM}), + (-1, {_sV: _RM}), + (-1, {_sV: _MKBC}), + ), ) -AGENT_ALIAS_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#AgentAliasSummary"), - members={ - "agentAliasId": { - "target": AGENT_ALIAS_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentAliasName": { - "target": NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "routingConfiguration": {"target": AGENT_ALIAS_ROUTING_CONFIGURATION}, - "agentAliasStatus": { - "target": AGENT_ALIAS_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "aliasInvocationState": {"target": ALIAS_INVOCATION_STATE}, - }, +WEB_CRAWLER_LIMITS: StaticSchema = (18, n0, _WCL, 0, (_rL, _mP), ((7, 0), (7, 0))) + +WEB_SCOPE_TYPE: StaticSchema = ( + 14, + n0, + _WST, + 0, + (_HO, _SUBDOMAINS), + ((-1, {_sV: _HO}), (-1, {_sV: _SUBDOMAINS})), ) -AGENT_ALIAS_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#AgentAliasSummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": AGENT_ALIAS_SUMMARY}}, -) - -AGENT_DESCRIPTOR = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#AgentDescriptor"), - members={"aliasArn": {"target": AGENT_ALIAS_ARN}}, -) - -COLLABORATION_INSTRUCTION = Schema( - id=ShapeID("com.amazonaws.bedrockagent#CollaborationInstruction"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -RELAY_CONVERSATION_HISTORY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#RelayConversationHistory"), - shape_type=ShapeType.ENUM, - members={"TO_COLLABORATOR": {"target": UNIT}, "DISABLED": {"target": UNIT}}, -) - -AGENT_COLLABORATOR = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#AgentCollaborator"), - members={ - "agentId": { - "target": ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentVersion": { - "target": VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentDescriptor": { - "target": AGENT_DESCRIPTOR, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "collaboratorId": { - "target": ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "collaborationInstruction": { - "target": COLLABORATION_INSTRUCTION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "collaboratorName": { - "target": NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastUpdatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "relayConversationHistory": {"target": RELAY_CONVERSATION_HISTORY}, - "clientToken": {"target": CLIENT_TOKEN}, - }, +USER_AGENT: StaticSchema = (3, n0, _UAs, 4) + +USER_AGENT_HEADER: StaticSchema = (3, n0, _UAH, 4) + +WEB_CRAWLER_CONFIGURATION: StaticSchema = ( + 18, + n0, + _WCC, + 0, + (_cL, _iF, _eF, _sc, _uAs, _uAH), + ( + (WEB_CRAWLER_LIMITS, 0), + (FILTER_LIST, 0), + (FILTER_LIST, 0), + (WEB_SCOPE_TYPE, 0), + (USER_AGENT, 0), + (USER_AGENT_HEADER, 0), + ), ) -ASSOCIATE_AGENT_COLLABORATOR_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#AssociateAgentCollaboratorInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#AssociateAgentCollaboratorRequest", - ) - ], - members={ - "agentId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "agentVersion": { - "target": DRAFT_VERSION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "agentDescriptor": { - "target": AGENT_DESCRIPTOR, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "collaboratorName": { - "target": NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "collaborationInstruction": { - "target": COLLABORATION_INSTRUCTION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "relayConversationHistory": {"target": RELAY_CONVERSATION_HISTORY}, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - }, +URL: StaticSchema = (3, n0, _U, 0) + +SEED_URL: StaticSchema = (18, n0, _SU, 0, (_u,), ((URL, 0),)) + +SEED_URLS: StaticSchema = (16, n0, _SUe, 0, (_me,), ((SEED_URL, 0),)) + +URL_CONFIGURATION: StaticSchema = (18, n0, _UC, 0, (_sUe,), ((SEED_URLS, 0),)) + +WEB_SOURCE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _WSC, + 0, + (_uC,), + ((URL_CONFIGURATION, 1),), ) -ASSOCIATE_AGENT_COLLABORATOR_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#AssociateAgentCollaboratorOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#AssociateAgentCollaboratorResponse", - ) - ], - members={ - "agentCollaborator": { - "target": AGENT_COLLABORATOR, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +WEB_DATA_SOURCE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _WDSC, + 0, + (_sC, _cCr), + ((WEB_SOURCE_CONFIGURATION, 1), (WEB_CRAWLER_CONFIGURATION, 0)), ) -ASSOCIATE_AGENT_COLLABORATOR = Schema( - id=ShapeID("com.amazonaws.bedrockagent#AssociateAgentCollaborator"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "PUT", - "uri": "/agents/{agentId}/agentversions/{agentVersion}/agentcollaborators/", - } - ), - ) - ], +DATA_SOURCE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _DSC, + 0, + (_t, _mKBCC, _sCo, _wC, _cCo, _sCa, _sPC), + ( + (DATA_SOURCE_TYPE, 1), + (MANAGED_KNOWLEDGE_BASE_CONNECTOR_CONFIGURATION, 0), + (S3_DATA_SOURCE_CONFIGURATION, 0), + (WEB_DATA_SOURCE_CONFIGURATION, 0), + (CONFLUENCE_DATA_SOURCE_CONFIGURATION, 0), + (SALESFORCE_DATA_SOURCE_CONFIGURATION, 0), + (SHARE_POINT_DATA_SOURCE_CONFIGURATION, 0), + ), ) -DISASSOCIATE_AGENT_COLLABORATOR_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#DisassociateAgentCollaboratorInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#DisassociateAgentCollaboratorRequest", - ) - ], - members={ - "agentId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "agentVersion": { - "target": DRAFT_VERSION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "collaboratorId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, +SERVER_SIDE_ENCRYPTION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _SSEC, + 0, + (_kKA,), + ((KMS_KEY_ARN, 0),), +) + +CHUNKING_STRATEGY: StaticSchema = ( + 14, + n0, + _CS, + 0, + (_FS_, _NONE, _HIERARCHICAL, _SEMANTIC), + ( + (-1, {_sV: _FS_}), + (-1, {_sV: _NONE}), + (-1, {_sV: _HIERARCHICAL}), + (-1, {_sV: _SEMANTIC}), + ), ) -DISASSOCIATE_AGENT_COLLABORATOR_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#DisassociateAgentCollaboratorOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#DisassociateAgentCollaboratorResponse", - ) - ], -) - -DISASSOCIATE_AGENT_COLLABORATOR = Schema( - id=ShapeID("com.amazonaws.bedrockagent#DisassociateAgentCollaborator"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 204, - "method": "DELETE", - "uri": "/agents/{agentId}/agentversions/{agentVersion}/agentcollaborators/{collaboratorId}/", - } - ), - ) - ], +FIXED_SIZE_CHUNKING_CONFIGURATION: StaticSchema = ( + 18, + n0, + _FSCC, + 0, + (_mT, _oP), + ((7, 1), (7, 1)), +) + +HIERARCHICAL_CHUNKING_LEVEL_CONFIGURATION: StaticSchema = ( + 18, + n0, + _HCLC, + 0, + (_mT,), + ((7, 1),), +) + +HIERARCHICAL_CHUNKING_LEVEL_CONFIGURATIONS: StaticSchema = ( + 16, + n0, + _HCLCi, + 0, + (_me,), + ((HIERARCHICAL_CHUNKING_LEVEL_CONFIGURATION, 0),), +) + +HIERARCHICAL_CHUNKING_CONFIGURATION: StaticSchema = ( + 18, + n0, + _HCC, + 0, + (_lC, _oTv), + ((HIERARCHICAL_CHUNKING_LEVEL_CONFIGURATIONS, 1), (7, 1)), +) + +SEMANTIC_CHUNKING_CONFIGURATION: StaticSchema = ( + 18, + n0, + _SCCe, + 0, + (_mT, _bS, _bPTr), + ((7, 1), (7, 1), (7, 1)), +) + +CHUNKING_CONFIGURATION: StaticSchema = ( + 18, + n0, + _CC, + 0, + (_cS, _fSCC, _hCC, _sCC), + ( + (CHUNKING_STRATEGY, 1), + (FIXED_SIZE_CHUNKING_CONFIGURATION, 0), + (HIERARCHICAL_CHUNKING_CONFIGURATION, 0), + (SEMANTIC_CHUNKING_CONFIGURATION, 0), + ), ) -GET_AGENT_COLLABORATOR_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#GetAgentCollaboratorInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#GetAgentCollaboratorRequest", - ) - ], - members={ - "agentId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "agentVersion": { - "target": VERSION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "collaboratorId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, +ENRICHMENT_STRATEGY_METHOD: StaticSchema = ( + 14, + n0, + _ESM, + 0, + (_CEE,), + ((-1, {_sV: _CEE}),), ) -GET_AGENT_COLLABORATOR_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#GetAgentCollaboratorOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#GetAgentCollaboratorResponse", - ) - ], - members={ - "agentCollaborator": { - "target": AGENT_COLLABORATOR, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +ENRICHMENT_STRATEGY_CONFIGURATION: StaticSchema = ( + 18, + n0, + _ESC, + 0, + (_met,), + ((ENRICHMENT_STRATEGY_METHOD, 1),), ) -GET_AGENT_COLLABORATOR = Schema( - id=ShapeID("com.amazonaws.bedrockagent#GetAgentCollaborator"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/agents/{agentId}/agentversions/{agentVersion}/agentcollaborators/{collaboratorId}/", - } - ), - ) - ], +BEDROCK_MODEL_ARN: StaticSchema = (3, n0, _BMA, 0) + +BEDROCK_FOUNDATION_MODEL_CONTEXT_ENRICHMENT_CONFIGURATION: StaticSchema = ( + 18, + n0, + _BFMCEC, + 0, + (_eSC, _mA), + ((ENRICHMENT_STRATEGY_CONFIGURATION, 1), (BEDROCK_MODEL_ARN, 1)), ) -LIST_AGENT_COLLABORATORS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ListAgentCollaboratorsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#ListAgentCollaboratorsRequest", - ) - ], - members={ - "agentId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "agentVersion": { - "target": VERSION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "maxResults": {"target": MAX_RESULTS}, - "nextToken": {"target": NEXT_TOKEN}, - }, +CONTEXT_ENRICHMENT_TYPE: StaticSchema = (14, n0, _CET, 0, (_BFM,), ((-1, {_sV: _BFM}),)) + +CONTEXT_ENRICHMENT_CONFIGURATION: StaticSchema = ( + 18, + n0, + _CEC, + 0, + (_t, _bFMC), + ( + (CONTEXT_ENRICHMENT_TYPE, 1), + (BEDROCK_FOUNDATION_MODEL_CONTEXT_ENRICHMENT_CONFIGURATION, 0), + ), ) -AGENT_COLLABORATOR_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#AgentCollaboratorSummary"), - members={ - "agentId": { - "target": ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentVersion": { - "target": VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "collaboratorId": { - "target": ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentDescriptor": { - "target": AGENT_DESCRIPTOR, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "collaborationInstruction": { - "target": COLLABORATION_INSTRUCTION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "relayConversationHistory": { - "target": RELAY_CONVERSATION_HISTORY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "collaboratorName": { - "target": NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastUpdatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +S3_BUCKET_URI: StaticSchema = (3, n0, _SBU, 0) + +S3_LOCATION: StaticSchema = (18, n0, _SL, 0, (_ur,), ((S3_BUCKET_URI, 1),)) + +INTERMEDIATE_STORAGE: StaticSchema = (18, n0, _IS, 0, (_sLo,), ((S3_LOCATION, 1),)) + +STEP_TYPE: StaticSchema = (14, n0, _ST, 0, (_PC_,), ((-1, {_sV: _PC_}),)) + +TRANSFORMATION_LAMBDA_CONFIGURATION: StaticSchema = ( + 18, + n0, + _TLC, + 0, + (_lA,), + ((LAMBDA_ARN, 1),), ) -AGENT_COLLABORATOR_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#AgentCollaboratorSummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": AGENT_COLLABORATOR_SUMMARY}}, +TRANSFORMATION_FUNCTION: StaticSchema = ( + 18, + n0, + _TF, + 0, + (_tLC,), + ((TRANSFORMATION_LAMBDA_CONFIGURATION, 1),), ) -LIST_AGENT_COLLABORATORS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ListAgentCollaboratorsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#ListAgentCollaboratorsResponse", - ) - ], - members={ - "agentCollaboratorSummaries": { - "target": AGENT_COLLABORATOR_SUMMARIES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": NEXT_TOKEN}, - }, +TRANSFORMATION: StaticSchema = ( + 18, + n0, + _Tr, + 0, + (_tF, _sTA), + ((TRANSFORMATION_FUNCTION, 1), (STEP_TYPE, 1)), ) -LIST_AGENT_COLLABORATORS = Schema( - id=ShapeID("com.amazonaws.bedrockagent#ListAgentCollaborators"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "POST", - "uri": "/agents/{agentId}/agentversions/{agentVersion}/agentcollaborators/", - } - ), - ) - ], +TRANSFORMATIONS: StaticSchema = (16, n0, _Tra, 0, (_me,), ((TRANSFORMATION, 0),)) + +CUSTOM_TRANSFORMATION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _CTC, + 0, + (_iS, _tr), + ((INTERMEDIATE_STORAGE, 1), (TRANSFORMATIONS, 1)), ) -UPDATE_AGENT_COLLABORATOR_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#UpdateAgentCollaboratorInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#UpdateAgentCollaboratorRequest", - ) - ], - members={ - "agentId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "agentVersion": { - "target": DRAFT_VERSION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "collaboratorId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "agentDescriptor": { - "target": AGENT_DESCRIPTOR, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "collaboratorName": { - "target": NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "collaborationInstruction": { - "target": COLLABORATION_INSTRUCTION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "relayConversationHistory": {"target": RELAY_CONVERSATION_HISTORY}, - }, +PARSING_MODALITY: StaticSchema = ( + 14, + n0, + _PMa, + 0, + (_MULTIMODAL,), + ((-1, {_sV: _MULTIMODAL}),), ) -UPDATE_AGENT_COLLABORATOR_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#UpdateAgentCollaboratorOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#UpdateAgentCollaboratorResponse", - ) - ], - members={ - "agentCollaborator": { - "target": AGENT_COLLABORATOR, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +BEDROCK_DATA_AUTOMATION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _BDAC, + 0, + (_pMa,), + ((PARSING_MODALITY, 0),), ) -UPDATE_AGENT_COLLABORATOR = Schema( - id=ShapeID("com.amazonaws.bedrockagent#UpdateAgentCollaborator"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "PUT", - "uri": "/agents/{agentId}/agentversions/{agentVersion}/agentcollaborators/{collaboratorId}/", - } - ), - ) - ], +PARSING_PROMPT_TEXT: StaticSchema = (3, n0, _PPT, 0) + +PARSING_PROMPT: StaticSchema = (18, n0, _PPa, 0, (_pPT,), ((PARSING_PROMPT_TEXT, 1),)) + +BEDROCK_FOUNDATION_MODEL_CONFIGURATION: StaticSchema = ( + 18, + n0, + _BFMC, + 0, + (_mA, _pP, _pMa), + ((BEDROCK_MODEL_ARN, 1), (PARSING_PROMPT, 0), (PARSING_MODALITY, 0)), ) -FLOW_AGENT_ALIAS_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagent#FlowAgentAliasArn"), - shape_type=ShapeType.STRING, +PARSING_STRATEGY: StaticSchema = ( + 14, + n0, + _PSa, + 0, + (_BFM, _BDA, _SP_, _MME), + ((-1, {_sV: _BFM}), (-1, {_sV: _BDA}), (-1, {_sV: _SP_}), (-1, {_sV: _MME})), ) -AGENT_FLOW_NODE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#AgentFlowNodeConfiguration"), - members={ - "agentAliasArn": { - "target": FLOW_AGENT_ALIAS_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=""), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, +PARSING_CONFIGURATION: StaticSchema = ( + 18, + n0, + _PCa, + 0, + (_pSa, _bFMC, _bDAC), + ( + (PARSING_STRATEGY, 1), + (BEDROCK_FOUNDATION_MODEL_CONFIGURATION, 0), + (BEDROCK_DATA_AUTOMATION_CONFIGURATION, 0), + ), ) -KNOWLEDGE_BASE_STATE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#KnowledgeBaseState"), - shape_type=ShapeType.ENUM, - members={"ENABLED": {"target": UNIT}, "DISABLED": {"target": UNIT}}, -) - -AGENT_KNOWLEDGE_BASE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#AgentKnowledgeBase"), - members={ - "agentId": { - "target": ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentVersion": { - "target": VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "knowledgeBaseId": { - "target": ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": { - "target": DESCRIPTION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "knowledgeBaseState": { - "target": KNOWLEDGE_BASE_STATE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +VECTOR_INGESTION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _VIC, + 0, + (_cCh, _cTC, _pCa, _cEC), + ( + (CHUNKING_CONFIGURATION, 0), + (CUSTOM_TRANSFORMATION_CONFIGURATION, 0), + (PARSING_CONFIGURATION, 0), + (CONTEXT_ENRICHMENT_CONFIGURATION, 0), + ), ) -AGENT_KNOWLEDGE_BASE_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#AgentKnowledgeBaseSummary"), - members={ - "knowledgeBaseId": { - "target": ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "knowledgeBaseState": { - "target": KNOWLEDGE_BASE_STATE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +CREATE_DATA_SOURCE_INPUT: StaticSchema = ( + 18, + n0, + _CDSI, + {_sSI: _cCDSR, _smit: None}, + (_kBI, _cT, _na, _d, _dSC, _dDP, _sSEC, _vIC), + ( + (ID, 9), + (CLIENT_TOKEN, 2), + (NAME, 1), + (DESCRIPTION, 0), + (DATA_SOURCE_CONFIGURATION, 1), + (DATA_DELETION_POLICY, 0), + (SERVER_SIDE_ENCRYPTION_CONFIGURATION, 0), + (VECTOR_INGESTION_CONFIGURATION, 0), + ), ) -AGENT_KNOWLEDGE_BASE_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#AgentKnowledgeBaseSummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": AGENT_KNOWLEDGE_BASE_SUMMARY}}, +DATA_SOURCE_STATUS: StaticSchema = ( + 14, + n0, + _DSS, + 0, + (_AVAILABLE, _DELETING, _DU, _CREATING, _UPDATING, _FAILED), + ( + (-1, {_sV: _AVAILABLE}), + (-1, {_sV: _DELETING}), + (-1, {_sV: _DU}), + (-1, {_sV: _CREATING}), + (-1, {_sV: _UPDATING}), + (-1, {_sV: _FAILED}), + ), ) -TAG_KEY = Schema( - id=ShapeID("com.amazonaws.bedrockagent#TagKey"), shape_type=ShapeType.STRING +DATA_SOURCE: StaticSchema = ( + 18, + n0, + _DSa, + 0, + (_kBI, _dSI, _na, _sta, _d, _dSC, _sSEC, _vIC, _dDP, _cA, _uA, _fR), + ( + (ID, 1), + (ID, 1), + (NAME, 1), + (DATA_SOURCE_STATUS, 1), + (DESCRIPTION, 0), + (DATA_SOURCE_CONFIGURATION, 1), + (SERVER_SIDE_ENCRYPTION_CONFIGURATION, 0), + (VECTOR_INGESTION_CONFIGURATION, 0), + (DATA_DELETION_POLICY, 0), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (FAILURE_REASONS, 0), + ), ) -TAG_VALUE = Schema( - id=ShapeID("com.amazonaws.bedrockagent#TagValue"), shape_type=ShapeType.STRING +CREATE_DATA_SOURCE_OUTPUT: StaticSchema = ( + 18, + n0, + _CDSO, + {_sSI: _cCDSRo, _smith: None}, + (_dS,), + ((DATA_SOURCE, 1),), +) + +CREATE_DATA_SOURCE: StaticOperationSchema = ( + 23, + n0, + _CDS, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "PUT", + "uri": "/knowledgebases/{knowledgeBaseId}/datasources/", + } + ) + }, + CREATE_DATA_SOURCE_INPUT, + CREATE_DATA_SOURCE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -TAGS_MAP = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#TagsMap"), - shape_type=ShapeType.MAP, - members={"key": {"target": TAG_KEY}, "value": {"target": TAG_VALUE}}, +DELETE_DATA_SOURCE_INPUT: StaticSchema = ( + 18, + n0, + _DDSI, + {_sSI: _cDDSR, _smit: None}, + (_kBI, _dSI), + ((ID, 9), (ID, 9)), +) + +DELETE_DATA_SOURCE_OUTPUT: StaticSchema = ( + 18, + n0, + _DDSO, + {_sSI: _cDDSRo, _smith: None}, + (_kBI, _dSI, _sta), + ((ID, 1), (ID, 1), (DATA_SOURCE_STATUS, 1)), +) + +DELETE_DATA_SOURCE: StaticOperationSchema = ( + 23, + n0, + _DDS, + { + _smithy: MappingProxyType( + { + "code": 202, + "method": "DELETE", + "uri": "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}", + } + ) + }, + DELETE_DATA_SOURCE_INPUT, + DELETE_DATA_SOURCE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CREATE_AGENT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#CreateAgentInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#CreateAgentRequest", - ) - ], - members={ - "agentName": { - "target": NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "instruction": {"target": INSTRUCTION}, - "foundationModel": {"target": MODEL_IDENTIFIER}, - "description": {"target": DESCRIPTION}, - "orchestrationType": {"target": ORCHESTRATION_TYPE}, - "customOrchestration": {"target": CUSTOM_ORCHESTRATION}, - "idleSessionTTLInSeconds": {"target": SESSION_TTL}, - "agentResourceRoleArn": {"target": AGENT_ROLE_ARN}, - "customerEncryptionKeyArn": {"target": KMS_KEY_ARN}, - "tags": {"target": TAGS_MAP}, - "promptOverrideConfiguration": {"target": PROMPT_OVERRIDE_CONFIGURATION}, - "guardrailConfiguration": {"target": GUARDRAIL_CONFIGURATION}, - "memoryConfiguration": {"target": MEMORY_CONFIGURATION}, - "agentCollaboration": {"target": AGENT_COLLABORATION}, - }, +GET_DATA_SOURCE_INPUT: StaticSchema = ( + 18, + n0, + _GDSI, + {_sSI: _cGDSR, _smit: None}, + (_kBI, _dSI), + ((ID, 9), (ID, 9)), +) + +GET_DATA_SOURCE_OUTPUT: StaticSchema = ( + 18, + n0, + _GDSO, + {_sSI: _cGDSRo, _smith: None}, + (_dS,), + ((DATA_SOURCE, 1),), +) + +GET_DATA_SOURCE: StaticOperationSchema = ( + 23, + n0, + _GDS, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "GET", + "uri": "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}", + } + ) + }, + GET_DATA_SOURCE_INPUT, + GET_DATA_SOURCE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CREATE_AGENT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#CreateAgentOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#CreateAgentResponse", - ) - ], - members={ - "agent": { - "target": AGENT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +LIST_DATA_SOURCES_INPUT: StaticSchema = ( + 18, + n0, + _LDSI, + {_sSI: _cLDSR, _smit: None}, + (_kBI, _mR, _nT), + ((ID, 9), (MAX_RESULTS, 0), (NEXT_TOKEN, 0)), +) + +DATA_SOURCE_SUMMARY: StaticSchema = ( + 18, + n0, + _DSSa, + 0, + (_kBI, _dSI, _na, _sta, _d, _uA), + ( + (ID, 1), + (ID, 1), + (NAME, 1), + (DATA_SOURCE_STATUS, 1), + (DESCRIPTION, 0), + (DATE_TIMESTAMP, 1), + ), ) -CREATE_AGENT = Schema( - id=ShapeID("com.amazonaws.bedrockagent#CreateAgent"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType({"code": 202, "method": "PUT", "uri": "/agents/"}), - ) - ], +DATA_SOURCE_SUMMARIES: StaticSchema = ( + 16, + n0, + _DSSat, + 0, + (_me,), + ((DATA_SOURCE_SUMMARY, 0),), +) + +LIST_DATA_SOURCES_OUTPUT: StaticSchema = ( + 18, + n0, + _LDSO, + {_sSI: _cLDSRo, _smith: None}, + (_dSS, _nT), + ((DATA_SOURCE_SUMMARIES, 1), (NEXT_TOKEN, 0)), +) + +LIST_DATA_SOURCES: StaticOperationSchema = ( + 23, + n0, + _LDS, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "POST", + "uri": "/knowledgebases/{knowledgeBaseId}/datasources/", + } + ) + }, + LIST_DATA_SOURCES_INPUT, + LIST_DATA_SOURCES_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -DELETE_AGENT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#DeleteAgentInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#DeleteAgentRequest", - ) - ], - members={ - "agentId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "skipResourceInUseCheck": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=False), - Trait.new( - id=ShapeID("smithy.api#httpQuery"), value="skipResourceInUseCheck" - ), - ], - }, - }, +UPDATE_DATA_SOURCE_INPUT: StaticSchema = ( + 18, + n0, + _UDSI, + {_sSI: _cUDSR, _smit: None}, + (_kBI, _dSI, _na, _d, _dSC, _dDP, _sSEC, _vIC), + ( + (ID, 9), + (ID, 9), + (NAME, 1), + (DESCRIPTION, 0), + (DATA_SOURCE_CONFIGURATION, 1), + (DATA_DELETION_POLICY, 0), + (SERVER_SIDE_ENCRYPTION_CONFIGURATION, 0), + (VECTOR_INGESTION_CONFIGURATION, 0), + ), ) -DELETE_AGENT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#DeleteAgentOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#DeleteAgentResponse", - ) - ], - members={ - "agentId": { - "target": ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentStatus": { - "target": AGENT_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +UPDATE_DATA_SOURCE_OUTPUT: StaticSchema = ( + 18, + n0, + _UDSO, + {_sSI: _cUDSRo, _smith: None}, + (_dS,), + ((DATA_SOURCE, 1),), +) + +UPDATE_DATA_SOURCE: StaticOperationSchema = ( + 23, + n0, + _UDS, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "PUT", + "uri": "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}", + } + ) + }, + UPDATE_DATA_SOURCE_INPUT, + UPDATE_DATA_SOURCE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -DELETE_AGENT = Schema( - id=ShapeID("com.amazonaws.bedrockagent#DeleteAgent"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 202, "method": "DELETE", "uri": "/agents/{agentId}/"} - ), - ) - ], +REVISION_ID: StaticSchema = (3, n0, _RIe, 0) + +RESOURCE_ARN: StaticSchema = (3, n0, _RAes, 0) + +DELETE_RESOURCE_POLICY_INPUT: StaticSchema = ( + 18, + n0, + _DRPI, + {_sSI: _cDRPR, _smit: None}, + (_rAe, _eRI), + ((RESOURCE_ARN, 9), (REVISION_ID, {_sQ: _eRI})), ) -GET_AGENT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#GetAgentInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#GetAgentRequest", - ) - ], - members={ - "agentId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, +DELETE_RESOURCE_POLICY_OUTPUT: StaticSchema = ( + 18, + n0, + _DRPO, + {_sSI: _cDRPRo, _smith: None}, + (_rAe, _rI), + ((RESOURCE_ARN, 1), (REVISION_ID, 0)), ) -GET_AGENT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#GetAgentOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#GetAgentResponse", +DELETE_RESOURCE_POLICY: StaticOperationSchema = ( + 23, + n0, + _DRP, + { + _smithy: MappingProxyType( + {"code": 200, "method": "DELETE", "uri": "/resourcepolicy/{resourceArn}"} ) - ], - members={ - "agent": { - "target": AGENT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } }, + DELETE_RESOURCE_POLICY_INPUT, + DELETE_RESOURCE_POLICY_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -GET_AGENT = Schema( - id=ShapeID("com.amazonaws.bedrockagent#GetAgent"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "GET", "uri": "/agents/{agentId}/"} - ), - ) - ], +DELETE_VPC_CONFIGURATION_INPUT: StaticSchema = ( + 18, + n0, + _DVCI, + {_sSI: _cDVCR, _smit: None}, + (_kBI, _vCI), + ((ID, 9), (VPC_CONFIGURATION_ID, 9)), +) + +DELETE_VPC_CONFIGURATION_OUTPUT: StaticSchema = ( + 18, + n0, + _DVCO, + {_sSI: _cDVCRo, _smith: None}, + (_vCI, _sta), + ((VPC_CONFIGURATION_ID, 1), (VPC_CONFIGURATION_STATUS, 1)), +) + +DELETE_VPC_CONFIGURATION: StaticOperationSchema = ( + 23, + n0, + _DVC, + { + _smithy: MappingProxyType( + { + "code": 202, + "method": "DELETE", + "uri": "/knowledgebases/{knowledgeBaseId}/vpcconfigurations/{vpcConfigurationId}", + } + ) + }, + DELETE_VPC_CONFIGURATION_INPUT, + DELETE_VPC_CONFIGURATION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -LIST_AGENTS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ListAgentsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#ListAgentsRequest", - ) - ], - members={ - "maxResults": {"target": MAX_RESULTS}, - "nextToken": {"target": NEXT_TOKEN}, - }, +FLOW_CONDITION_NAME: StaticSchema = (3, n0, _FCN, 0) + +FLOW_CONDITIONAL_CONNECTION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _FCCC, + 0, + (_co,), + ((FLOW_CONDITION_NAME, 1),), ) -AGENT_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#AgentSummary"), - members={ - "agentId": { - "target": ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentName": { - "target": NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentStatus": { - "target": AGENT_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "latestAgentVersion": {"target": VERSION}, - "guardrailConfiguration": {"target": GUARDRAIL_CONFIGURATION}, - }, +FLOW_NODE_OUTPUT_NAME: StaticSchema = (3, n0, _FNON, 0) + +FLOW_NODE_INPUT_NAME: StaticSchema = (3, n0, _FNIN, 0) + +FLOW_DATA_CONNECTION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _FDCC, + 0, + (_sO, _tIa), + ((FLOW_NODE_OUTPUT_NAME, 1), (FLOW_NODE_INPUT_NAME, 1)), ) -AGENT_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#AgentSummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": AGENT_SUMMARY}}, +FLOW_CONNECTION_CONFIGURATION: StaticSchema = ( + 19, + n0, + _FCC, + 0, + (_dat, _con), + ( + (FLOW_DATA_CONNECTION_CONFIGURATION, 0), + (FLOW_CONDITIONAL_CONNECTION_CONFIGURATION, 0), + ), ) -LIST_AGENTS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ListAgentsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#ListAgentsResponse", - ) - ], - members={ - "agentSummaries": { - "target": AGENT_SUMMARIES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": NEXT_TOKEN}, - }, -) +FLOW_CONNECTION_NAME: StaticSchema = (3, n0, _FCNl, 0) -LIST_AGENTS = Schema( - id=ShapeID("com.amazonaws.bedrockagent#ListAgents"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType({"code": 200, "method": "POST", "uri": "/agents/"}), - ) - ], -) +FLOW_NODE_NAME: StaticSchema = (3, n0, _FNN, 0) -PREPARE_AGENT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#PrepareAgentInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#PrepareAgentRequest", - ) - ], - members={ - "agentId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, +FLOW_CONNECTION_TYPE: StaticSchema = ( + 14, + n0, + _FCT, + 0, + (_DATA, _CONDITIONAL), + ((-1, {_sV: _Da}), (-1, {_sV: _C})), ) -PREPARE_AGENT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#PrepareAgentOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#PrepareAgentResponse", - ) - ], - members={ - "agentId": { - "target": ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentStatus": { - "target": AGENT_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentVersion": { - "target": VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "preparedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +FLOW_CONNECTION: StaticSchema = ( + 18, + n0, + _FC, + 0, + (_t, _na, _so, _tar, _conf), + ( + (FLOW_CONNECTION_TYPE, 1), + (FLOW_CONNECTION_NAME, 1), + (FLOW_NODE_NAME, 1), + (FLOW_NODE_NAME, 1), + (FLOW_CONNECTION_CONFIGURATION, 0), + ), ) -PREPARE_AGENT = Schema( - id=ShapeID("com.amazonaws.bedrockagent#PrepareAgent"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 202, "method": "POST", "uri": "/agents/{agentId}/"} - ), - ) - ], -) +FLOW_CONNECTIONS: StaticSchema = (16, n0, _FCl, 0, (_me,), ((FLOW_CONNECTION, 0),)) -UPDATE_AGENT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#UpdateAgentInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#UpdateAgentRequest", - ) - ], - members={ - "agentId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "agentName": { - "target": NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "instruction": {"target": INSTRUCTION}, - "foundationModel": { - "target": MODEL_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "orchestrationType": {"target": ORCHESTRATION_TYPE}, - "customOrchestration": {"target": CUSTOM_ORCHESTRATION}, - "idleSessionTTLInSeconds": {"target": SESSION_TTL}, - "agentResourceRoleArn": { - "target": AGENT_ROLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "customerEncryptionKeyArn": {"target": KMS_KEY_ARN}, - "promptOverrideConfiguration": {"target": PROMPT_OVERRIDE_CONFIGURATION}, - "guardrailConfiguration": {"target": GUARDRAIL_CONFIGURATION}, - "memoryConfiguration": {"target": MEMORY_CONFIGURATION}, - "agentCollaboration": {"target": AGENT_COLLABORATION}, - }, -) +COLLECTOR_FLOW_NODE_CONFIGURATION: StaticSchema = (18, n0, _CFNC, 0) -UPDATE_AGENT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#UpdateAgentOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#UpdateAgentResponse", - ) - ], - members={ - "agent": { - "target": AGENT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +FLOW_CONDITION_EXPRESSION: StaticSchema = (3, n0, _FCE, 4) -UPDATE_AGENT = Schema( - id=ShapeID("com.amazonaws.bedrockagent#UpdateAgent"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 202, "method": "PUT", "uri": "/agents/{agentId}/"} - ), - ) - ], -) - -NUMERICAL_VERSION = Schema( - id=ShapeID("com.amazonaws.bedrockagent#NumericalVersion"), - shape_type=ShapeType.STRING, -) - -AGENT_VERSION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#AgentVersion"), - members={ - "agentId": { - "target": ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentName": { - "target": NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentArn": { - "target": AGENT_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "version": { - "target": NUMERICAL_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "instruction": {"target": INSTRUCTION}, - "agentStatus": { - "target": AGENT_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "foundationModel": {"target": MODEL_IDENTIFIER}, - "description": {"target": DESCRIPTION}, - "idleSessionTTLInSeconds": { - "target": SESSION_TTL, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentResourceRoleArn": { - "target": AGENT_ROLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "customerEncryptionKeyArn": {"target": KMS_KEY_ARN}, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "failureReasons": {"target": FAILURE_REASONS}, - "recommendedActions": {"target": RECOMMENDED_ACTIONS}, - "promptOverrideConfiguration": {"target": PROMPT_OVERRIDE_CONFIGURATION}, - "guardrailConfiguration": {"target": GUARDRAIL_CONFIGURATION}, - "memoryConfiguration": {"target": MEMORY_CONFIGURATION}, - "agentCollaboration": {"target": AGENT_COLLABORATION}, - }, +FLOW_CONDITION: StaticSchema = ( + 18, + n0, + _FClo, + 0, + (_na, _ex), + ((FLOW_CONDITION_NAME, 1), (FLOW_CONDITION_EXPRESSION, 0)), ) -AGENT_VERSION_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#AgentVersionSummary"), - members={ - "agentName": { - "target": NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentStatus": { - "target": AGENT_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentVersion": { - "target": VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "guardrailConfiguration": {"target": GUARDRAIL_CONFIGURATION}, - }, -) +FLOW_CONDITIONS: StaticSchema = (16, n0, _FClow, 0, (_me,), ((FLOW_CONDITION, 0),)) -AGENT_VERSION_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#AgentVersionSummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": AGENT_VERSION_SUMMARY}}, +CONDITION_FLOW_NODE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _CFNCo, + 0, + (_cond,), + ((FLOW_CONDITIONS, 1),), ) -CREATE_AGENT_ALIAS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#CreateAgentAliasInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#CreateAgentAliasRequest", - ) - ], - members={ - "agentId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "agentAliasName": { - "target": NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "description": {"target": DESCRIPTION}, - "routingConfiguration": {"target": AGENT_ALIAS_ROUTING_CONFIGURATION}, - "tags": {"target": TAGS_MAP}, - }, -) +INLINE_CODE: StaticSchema = (3, n0, _ICn, 4) -CREATE_AGENT_ALIAS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#CreateAgentAliasOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#CreateAgentAliasResponse", - ) - ], - members={ - "agentAlias": { - "target": AGENT_ALIAS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +SUPPORTED_LANGUAGES: StaticSchema = (14, n0, _SLu, 0, (_P_,), ((-1, {_sV: _P__}),)) -CREATE_AGENT_ALIAS = Schema( - id=ShapeID("com.amazonaws.bedrockagent#CreateAgentAlias"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 202, "method": "PUT", "uri": "/agents/{agentId}/agentaliases/"} - ), - ) - ], +INLINE_CODE_FLOW_NODE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _ICFNC, + 0, + (_cod, _la), + ( + (INLINE_CODE, {_smithya: _v_, _smi: None}), + (SUPPORTED_LANGUAGES, {_smithya: _P__, _smi: None}), + ), ) -DELETE_AGENT_ALIAS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#DeleteAgentAliasInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#DeleteAgentAliasRequest", - ) - ], - members={ - "agentId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "agentAliasId": { - "target": AGENT_ALIAS_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) +INPUT_FLOW_NODE_CONFIGURATION: StaticSchema = (18, n0, _IFNC, 0) -DELETE_AGENT_ALIAS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#DeleteAgentAliasOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#DeleteAgentAliasResponse", - ) - ], - members={ - "agentId": { - "target": ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentAliasId": { - "target": AGENT_ALIAS_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentAliasStatus": { - "target": AGENT_ALIAS_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +ITERATOR_FLOW_NODE_CONFIGURATION: StaticSchema = (18, n0, _IFNCt, 0) -DELETE_AGENT_ALIAS = Schema( - id=ShapeID("com.amazonaws.bedrockagent#DeleteAgentAlias"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 202, - "method": "DELETE", - "uri": "/agents/{agentId}/agentaliases/{agentAliasId}/", - } - ), - ) - ], +PROMPT_MODEL_INFERENCE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _PMIC, + 0, + (_te, _tP, _mT, _sS), + ((TEMPERATURE, 0), (TOP_P, 0), (MAXIMUM_LENGTH, 0), (STOP_SEQUENCES, 0)), ) -GET_AGENT_ALIAS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#GetAgentAliasInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#GetAgentAliasRequest", - ) - ], - members={ - "agentId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "agentAliasId": { - "target": AGENT_ALIAS_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, +PROMPT_INFERENCE_CONFIGURATION: StaticSchema = ( + 19, + n0, + _PIC, + 0, + (_tex,), + ((PROMPT_MODEL_INFERENCE_CONFIGURATION, 0),), ) -GET_AGENT_ALIAS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#GetAgentAliasOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#GetAgentAliasResponse", - ) - ], - members={ - "agentAlias": { - "target": AGENT_ALIAS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +FLOW_KNOWLEDGE_BASE_ID: StaticSchema = (3, n0, _FKBI, 0) -GET_AGENT_ALIAS = Schema( - id=ShapeID("com.amazonaws.bedrockagent#GetAgentAlias"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/agents/{agentId}/agentaliases/{agentAliasId}/", - } - ), - ) - ], -) +KNOWLEDGE_BASE_MODEL_IDENTIFIER: StaticSchema = (3, n0, _KBMI, 0) -LIST_AGENT_ALIASES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ListAgentAliasesInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#ListAgentAliasesRequest", - ) - ], - members={ - "agentId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "maxResults": {"target": MAX_RESULTS}, - "nextToken": {"target": NEXT_TOKEN}, - }, +PERFORMANCE_CONFIG_LATENCY: StaticSchema = ( + 14, + n0, + _PCL, + 0, + (_STANDARD, _OPTIMIZED), + ((-1, {_sV: _stan}), (-1, {_sV: _o})), ) -LIST_AGENT_ALIASES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ListAgentAliasesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#ListAgentAliasesResponse", - ) - ], - members={ - "agentAliasSummaries": { - "target": AGENT_ALIAS_SUMMARIES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": NEXT_TOKEN}, - }, +PERFORMANCE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _PCe, + 0, + (_lat,), + ((PERFORMANCE_CONFIG_LATENCY, {_smithya: _stan}),), ) -LIST_AGENT_ALIASES = Schema( - id=ShapeID("com.amazonaws.bedrockagent#ListAgentAliases"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "POST", - "uri": "/agents/{agentId}/agentaliases/", - } - ), - ) - ], -) +KNOWLEDGE_BASE_TEXT_PROMPT: StaticSchema = (3, n0, _KBTP, 4) -UPDATE_AGENT_ALIAS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#UpdateAgentAliasInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#UpdateAgentAliasRequest", - ) - ], - members={ - "agentId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "agentAliasId": { - "target": AGENT_ALIAS_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "agentAliasName": { - "target": NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "routingConfiguration": {"target": AGENT_ALIAS_ROUTING_CONFIGURATION}, - "aliasInvocationState": {"target": ALIAS_INVOCATION_STATE}, - }, +KNOWLEDGE_BASE_PROMPT_TEMPLATE: StaticSchema = ( + 18, + n0, + _KBPT, + 0, + (_tPT,), + ((KNOWLEDGE_BASE_TEXT_PROMPT, 0),), ) -UPDATE_AGENT_ALIAS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#UpdateAgentAliasOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#UpdateAgentAliasResponse", - ) - ], - members={ - "agentAlias": { - "target": AGENT_ALIAS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +KNOWLEDGE_BASE_ORCHESTRATION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _KBOC, + 0, + (_pTro, _iCn, _aMRF, _pCe), + ( + (KNOWLEDGE_BASE_PROMPT_TEMPLATE, 0), + (PROMPT_INFERENCE_CONFIGURATION, 0), + (ADDITIONAL_MODEL_REQUEST_FIELDS, 0), + (PERFORMANCE_CONFIGURATION, 0), + ), ) -UPDATE_AGENT_ALIAS = Schema( - id=ShapeID("com.amazonaws.bedrockagent#UpdateAgentAlias"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 202, - "method": "PUT", - "uri": "/agents/{agentId}/agentaliases/{agentAliasId}/", - } - ), - ) - ], +RERANKING_METADATA_SELECTION_MODE: StaticSchema = ( + 14, + n0, + _RMSM, + 0, + (_SELECTIVE, _ALL), + ((-1, {_sV: _SELECTIVE}), (-1, {_sV: _ALL})), +) + +FIELD_FOR_RERANKING: StaticSchema = (18, n0, _FFR, 0, (_fN,), ((3, 1),)) + +FIELDS_FOR_RERANKING: StaticSchema = ( + 16, + n0, + _FFRi, + 4, + (_me,), + ((FIELD_FOR_RERANKING, 0),), +) + +RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION: StaticSchema = ( + 19, + n0, + _RMSMC, + 0, + (_fTI, _fTE), + ((FIELDS_FOR_RERANKING, 0), (FIELDS_FOR_RERANKING, 0)), +) + +METADATA_CONFIGURATION_FOR_RERANKING: StaticSchema = ( + 18, + n0, + _MCFR, + 0, + (_sM, _sMC), + ( + (RERANKING_METADATA_SELECTION_MODE, 1), + (RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION, 0), + ), ) -VPC_CONFIGURATION_DESCRIPTION = Schema( - id=ShapeID("com.amazonaws.bedrockagent#VpcConfigurationDescription"), - shape_type=ShapeType.STRING, -) +BEDROCK_RERANKING_MODEL_ARN: StaticSchema = (3, n0, _BRMA, 0) -HOST_HEADER = Schema( - id=ShapeID("com.amazonaws.bedrockagent#HostHeader"), shape_type=ShapeType.STRING +VECTOR_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION: StaticSchema = ( + 18, + n0, + _VSBRMC, + 0, + (_mA, _aMRF), + ((BEDROCK_RERANKING_MODEL_ARN, 1), (ADDITIONAL_MODEL_REQUEST_FIELDS, 0)), ) -VPC_CONFIGURATION_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagent#VpcConfigurationName"), - shape_type=ShapeType.STRING, +VECTOR_SEARCH_BEDROCK_RERANKING_CONFIGURATION: StaticSchema = ( + 18, + n0, + _VSBRC, + 0, + (_mCo, _nORR, _mCe), + ( + (VECTOR_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION, 1), + (7, 0), + (METADATA_CONFIGURATION_FOR_RERANKING, 0), + ), ) -PORT = Schema( - id=ShapeID("com.amazonaws.bedrockagent#Port"), shape_type=ShapeType.INTEGER +VECTOR_SEARCH_RERANKING_CONFIGURATION_TYPE: StaticSchema = ( + 14, + n0, + _VSRCT, + 0, + (_BRM,), + ((-1, {_sV: _BRM}),), +) + +VECTOR_SEARCH_RERANKING_CONFIGURATION: StaticSchema = ( + 18, + n0, + _VSRC, + 0, + (_t, _bRC), + ( + (VECTOR_SEARCH_RERANKING_CONFIGURATION_TYPE, 1), + (VECTOR_SEARCH_BEDROCK_RERANKING_CONFIGURATION, 0), + ), ) -VPC_PROTOCOL = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#VpcProtocol"), - shape_type=ShapeType.ENUM, - members={"HTTP": {"target": UNIT}, "HTTPS": {"target": UNIT}}, +KNOWLEDGE_BASE_FLOW_NODE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _KBFNC, + 0, + (_kBI, _mI, _gC, _nOR, _pTro, _iC, _rCe, _oC), + ( + (FLOW_KNOWLEDGE_BASE_ID, {_smithya: _v_, _smi: None}), + (KNOWLEDGE_BASE_MODEL_IDENTIFIER, 0), + (GUARDRAIL_CONFIGURATION, 0), + (7, 0), + (KNOWLEDGE_BASE_PROMPT_TEMPLATE, 0), + (PROMPT_INFERENCE_CONFIGURATION, 0), + (VECTOR_SEARCH_RERANKING_CONFIGURATION, 0), + (KNOWLEDGE_BASE_ORCHESTRATION_CONFIGURATION, 0), + ), ) -VPC_RESOLUTION_MODE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#VpcResolutionMode"), - shape_type=ShapeType.ENUM, - members={"PUBLIC": {"target": UNIT}, "IN_VPC": {"target": UNIT}}, -) +FLOW_LAMBDA_ARN: StaticSchema = (3, n0, _FLA, 0) -RESOURCE_TARGET = Schema( - id=ShapeID("com.amazonaws.bedrockagent#ResourceTarget"), shape_type=ShapeType.STRING +LAMBDA_FUNCTION_FLOW_NODE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _LFFNC, + 0, + (_lA,), + ((FLOW_LAMBDA_ARN, {_smithya: _v_, _smi: None}),), ) -SUBNET_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagent#SubnetId"), shape_type=ShapeType.STRING -) +FLOW_LEX_BOT_ALIAS_ARN: StaticSchema = (3, n0, _FLBAA, 0) -SUBNET_ID_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#SubnetIdList"), - shape_type=ShapeType.LIST, - members={"member": {"target": SUBNET_ID}}, -) +FLOW_LEX_BOT_LOCALE_ID: StaticSchema = (3, n0, _FLBLI, 0) -TLS_SERVER_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagent#TlsServerName"), shape_type=ShapeType.STRING +LEX_FLOW_NODE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _LFNC, + 0, + (_bAA, _lI), + ( + (FLOW_LEX_BOT_ALIAS_ARN, {_smithya: _v_, _smi: None}), + (FLOW_LEX_BOT_LOCALE_ID, {_smithya: _v_, _smi: None}), + ), ) -VPC_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagent#VpcId"), shape_type=ShapeType.STRING +LOOP_CONTROLLER_FLOW_NODE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _LCFNC, + 0, + (_cCon, _mIa), + ((FLOW_CONDITION, 1), (7, {_smithya: 10})), ) -CREATE_VPC_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#CreateVpcConfigurationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#CreateVpcConfigurationRequest", - ) - ], - members={ - "knowledgeBaseId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "vpcId": { - "target": VPC_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "subnetIds": { - "target": SUBNET_ID_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "resourceTarget": { - "target": RESOURCE_TARGET, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "port": { - "target": PORT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "protocol": { - "target": VPC_PROTOCOL, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "resolutionMode": { - "target": VPC_RESOLUTION_MODE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "hostHeader": {"target": HOST_HEADER}, - "tlsServerName": {"target": TLS_SERVER_NAME}, - "name": {"target": VPC_CONFIGURATION_NAME}, - "description": {"target": VPC_CONFIGURATION_DESCRIPTION}, - }, -) +LOOP_INPUT_FLOW_NODE_CONFIGURATION: StaticSchema = (18, n0, _LIFNC, 0) -VPC_CONFIGURATION_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#VpcConfigurationStatus"), - shape_type=ShapeType.ENUM, - members={ - "CREATING": {"target": UNIT}, - "CREATED": {"target": UNIT}, - "DELETING": {"target": UNIT}, - "CREATE_FAILED": {"target": UNIT}, - "DELETE_FAILED": {"target": UNIT}, - }, -) +OUTPUT_FLOW_NODE_CONFIGURATION: StaticSchema = (18, n0, _OFNC, 0) -VPC_CONFIGURATION_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagent#VpcConfigurationId"), - shape_type=ShapeType.STRING, -) +FLOW_PROMPT_MODEL_IDENTIFIER: StaticSchema = (3, n0, _FPMI, 0) -CREATE_VPC_CONFIGURATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#CreateVpcConfigurationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#CreateVpcConfigurationResponse", - ) - ], - members={ - "vpcConfigurationId": { - "target": VPC_CONFIGURATION_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": VPC_CONFIGURATION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +PROMPT_INPUT_VARIABLE_NAME: StaticSchema = (3, n0, _PIVN, 0) -CREATE_VPC_CONFIGURATION = Schema( - id=ShapeID("com.amazonaws.bedrockagent#CreateVpcConfiguration"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 202, - "method": "POST", - "uri": "/knowledgebases/{knowledgeBaseId}/vpcconfigurations/", - } - ), - ) - ], +PROMPT_INPUT_VARIABLE: StaticSchema = ( + 18, + n0, + _PIV, + 0, + (_na,), + ((PROMPT_INPUT_VARIABLE_NAME, 0),), ) -DATA_DELETION_POLICY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#DataDeletionPolicy"), - shape_type=ShapeType.ENUM, - members={"RETAIN": {"target": UNIT}, "DELETE": {"target": UNIT}}, +PROMPT_INPUT_VARIABLES_LIST: StaticSchema = ( + 16, + n0, + _PIVL, + 4, + (_me,), + ((PROMPT_INPUT_VARIABLE, 0),), ) -FILTER_PATTERN = Schema( - id=ShapeID("com.amazonaws.bedrockagent#FilterPattern"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) +CACHE_POINT_TYPE: StaticSchema = (14, n0, _CPT, 0, (_DEFAULT,), ((-1, {_sV: _de}),)) -FILTER_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#FilterList"), - shape_type=ShapeType.LIST, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"member": {"target": FILTER_PATTERN}}, -) +CACHE_POINT_BLOCK: StaticSchema = (18, n0, _CPB, 0, (_t,), ((CACHE_POINT_TYPE, 1),)) -FILTERED_OBJECT_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagent#FilteredObjectType"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +CONTENT_BLOCK: StaticSchema = ( + 19, + n0, + _CB, + 4, + (_tex, _cPa), + ((3, 0), (CACHE_POINT_BLOCK, 0)), ) -PATTERN_OBJECT_FILTER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#PatternObjectFilter"), - members={ - "objectType": { - "target": FILTERED_OBJECT_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "inclusionFilters": {"target": FILTER_LIST}, - "exclusionFilters": {"target": FILTER_LIST}, - }, -) +CONTENT_BLOCKS: StaticSchema = (16, n0, _CBo, 0, (_me,), ((CONTENT_BLOCK, 0),)) -PATTERN_OBJECT_FILTER_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#PatternObjectFilterList"), - shape_type=ShapeType.LIST, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"member": {"target": PATTERN_OBJECT_FILTER}}, +CONVERSATION_ROLE: StaticSchema = ( + 14, + n0, + _CR, + 0, + (_USER, _ASSISTANT), + ((-1, {_sV: _us}), (-1, {_sV: _as})), ) -PATTERN_OBJECT_FILTER_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#PatternObjectFilterConfiguration"), - members={ - "filters": { - "target": PATTERN_OBJECT_FILTER_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +MESSAGE: StaticSchema = ( + 18, + n0, + _M, + 0, + (_ro, _cont), + ((CONVERSATION_ROLE, 1), (CONTENT_BLOCKS, 1)), ) -CRAWL_FILTER_CONFIGURATION_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#CrawlFilterConfigurationType"), - shape_type=ShapeType.ENUM, - members={"PATTERN": {"target": UNIT}}, -) +MESSAGES: StaticSchema = (16, n0, _Me, 0, (_me,), ((MESSAGE, 0),)) -CRAWL_FILTER_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#CrawlFilterConfiguration"), - members={ - "type": { - "target": CRAWL_FILTER_CONFIGURATION_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "patternObjectFilter": {"target": PATTERN_OBJECT_FILTER_CONFIGURATION}, - }, -) +NON_EMPTY_STRING: StaticSchema = (3, n0, _NES, 0) -CONFLUENCE_CRAWLER_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ConfluenceCrawlerConfiguration"), - members={"filterConfiguration": {"target": CRAWL_FILTER_CONFIGURATION}}, +SYSTEM_CONTENT_BLOCK: StaticSchema = ( + 19, + n0, + _SCB, + 4, + (_tex, _cPa), + ((NON_EMPTY_STRING, 0), (CACHE_POINT_BLOCK, 0)), ) -CONFLUENCE_AUTH_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ConfluenceAuthType"), - shape_type=ShapeType.ENUM, - members={"BASIC": {"target": UNIT}, "OAUTH2_CLIENT_CREDENTIALS": {"target": UNIT}}, +SYSTEM_CONTENT_BLOCKS: StaticSchema = ( + 16, + n0, + _SCBy, + 0, + (_me,), + ((SYSTEM_CONTENT_BLOCK, 0),), ) -SECRET_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagent#SecretArn"), shape_type=ShapeType.STRING -) +ANY_TOOL_CHOICE: StaticSchema = (18, n0, _ATC, 0) -CONFLUENCE_HOST_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ConfluenceHostType"), - shape_type=ShapeType.ENUM, - members={"SAAS": {"target": UNIT}}, -) +AUTO_TOOL_CHOICE: StaticSchema = (18, n0, _ATCu, 0) -HTTPS_URL = Schema( - id=ShapeID("com.amazonaws.bedrockagent#HttpsUrl"), shape_type=ShapeType.STRING -) +TOOL_NAME: StaticSchema = (3, n0, _TN, 0) -CONFLUENCE_SOURCE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ConfluenceSourceConfiguration"), - members={ - "hostUrl": { - "target": HTTPS_URL, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "hostType": { - "target": CONFLUENCE_HOST_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "authType": { - "target": CONFLUENCE_AUTH_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "credentialsSecretArn": { - "target": SECRET_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +SPECIFIC_TOOL_CHOICE: StaticSchema = (18, n0, _STC, 0, (_na,), ((TOOL_NAME, 1),)) -CONFLUENCE_DATA_SOURCE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ConfluenceDataSourceConfiguration"), - members={ - "sourceConfiguration": { - "target": CONFLUENCE_SOURCE_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "crawlerConfiguration": {"target": CONFLUENCE_CRAWLER_CONFIGURATION}, - }, +TOOL_CHOICE: StaticSchema = ( + 19, + n0, + _TCo, + 4, + (_au, _an, _to), + ((AUTO_TOOL_CHOICE, 0), (ANY_TOOL_CHOICE, 0), (SPECIFIC_TOOL_CHOICE, 0)), ) -ENABLED_OR_DISABLED_STATE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#EnabledOrDisabledState"), - shape_type=ShapeType.ENUM, - members={"ENABLED": {"target": UNIT}, "DISABLED": {"target": UNIT}}, -) +TOOL_INPUT_SCHEMA: StaticSchema = (19, n0, _TIS, 0, (_j,), ((13, 0),)) -DELETION_PROTECTION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#DeletionProtectionConfiguration"), - members={ - "deletionProtectionStatus": { - "target": ENABLED_OR_DISABLED_STATE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "deletionProtectionThreshold": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=15)], - }, - }, +TOOL_SPECIFICATION: StaticSchema = ( + 18, + n0, + _TS, + 0, + (_na, _d, _iSn, _str), + ((TOOL_NAME, 1), (NON_EMPTY_STRING, 0), (TOOL_INPUT_SCHEMA, 1), (2, 0)), ) -AUDIO_EXTRACTION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#AudioExtractionConfiguration"), - members={ - "audioExtractionStatus": { - "target": ENABLED_OR_DISABLED_STATE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +TOOL: StaticSchema = ( + 19, + n0, + _To, + 0, + (_tS, _cPa), + ((TOOL_SPECIFICATION, 0), (CACHE_POINT_BLOCK, 0)), ) -IMAGE_EXTRACTION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ImageExtractionConfiguration"), - members={ - "imageExtractionStatus": { - "target": ENABLED_OR_DISABLED_STATE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +TOOLS: StaticSchema = (16, n0, _Too, 4, (_me,), ((TOOL, 0),)) -VIDEO_EXTRACTION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#VideoExtractionConfiguration"), - members={ - "videoExtractionStatus": { - "target": ENABLED_OR_DISABLED_STATE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +TOOL_CONFIGURATION: StaticSchema = ( + 18, + n0, + _TCoo, + 0, + (_too, _tC), + ((TOOLS, 1), (TOOL_CHOICE, 0)), ) -MEDIA_EXTRACTION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#MediaExtractionConfiguration"), - members={ - "imageExtractionConfiguration": {"target": IMAGE_EXTRACTION_CONFIGURATION}, - "audioExtractionConfiguration": {"target": AUDIO_EXTRACTION_CONFIGURATION}, - "videoExtractionConfiguration": {"target": VIDEO_EXTRACTION_CONFIGURATION}, - }, +CHAT_PROMPT_TEMPLATE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _CPTC, + 4, + (_mes, _sy, _iV, _tCo), + ( + (MESSAGES, 1), + (SYSTEM_CONTENT_BLOCKS, 0), + (PROMPT_INPUT_VARIABLES_LIST, 0), + (TOOL_CONFIGURATION, 0), + ), ) -DAILY_SCHEDULE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#DailySchedule") +TEXT_PROMPT: StaticSchema = (3, n0, _TPe, 4) + +TEXT_PROMPT_TEMPLATE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _TPTC, + 4, + (_tex, _cPa, _iV), + ((TEXT_PROMPT, 1), (CACHE_POINT_BLOCK, 0), (PROMPT_INPUT_VARIABLES_LIST, 0)), +) + +PROMPT_TEMPLATE_CONFIGURATION: StaticSchema = ( + 19, + n0, + _PTC, + 0, + (_tex, _ch), + ((TEXT_PROMPT_TEMPLATE_CONFIGURATION, 0), (CHAT_PROMPT_TEMPLATE_CONFIGURATION, 0)), +) + +PROMPT_TEMPLATE_TYPE: StaticSchema = ( + 14, + n0, + _PTT, + 0, + (_TEXT, _CHAT), + ((-1, {_sV: _TEXT}), (-1, {_sV: _CHAT})), +) + +PROMPT_FLOW_NODE_INLINE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _PFNIC, + 0, + (_tT, _tCe, _mI, _iC, _aMRF), + ( + (PROMPT_TEMPLATE_TYPE, {_smithya: _TEXT, _smi: None}), + (PROMPT_TEMPLATE_CONFIGURATION, 1), + (FLOW_PROMPT_MODEL_IDENTIFIER, {_smithya: _v_, _smi: None}), + (PROMPT_INFERENCE_CONFIGURATION, 0), + (13, 0), + ), ) -DAY_OF_MONTH_NUMBER = Schema( - id=ShapeID("com.amazonaws.bedrockagent#DayOfMonthNumber"), - shape_type=ShapeType.INTEGER, -) +FLOW_PROMPT_ARN: StaticSchema = (3, n0, _FPA, 0) -LAST_DAY_OF_MONTH = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#LastDayOfMonth") +PROMPT_FLOW_NODE_RESOURCE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _PFNRC, + 0, + (_pAr,), + ((FLOW_PROMPT_ARN, {_smithya: _v_, _smi: None}),), ) -DAY_OF_MONTH = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#DayOfMonth"), - shape_type=ShapeType.UNION, - members={ - "dayNumber": {"target": DAY_OF_MONTH_NUMBER}, - "lastDayOfMonth": {"target": LAST_DAY_OF_MONTH}, - }, +PROMPT_FLOW_NODE_SOURCE_CONFIGURATION: StaticSchema = ( + 19, + n0, + _PFNSC, + 0, + (_re, _inl), + ( + (PROMPT_FLOW_NODE_RESOURCE_CONFIGURATION, 0), + (PROMPT_FLOW_NODE_INLINE_CONFIGURATION, 0), + ), ) -MONTHLY_SCHEDULE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#MonthlySchedule"), - members={ - "dayOfMonth": { - "target": DAY_OF_MONTH, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +PROMPT_FLOW_NODE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _PFNC, + 0, + (_sC, _gC), + ((PROMPT_FLOW_NODE_SOURCE_CONFIGURATION, 1), (GUARDRAIL_CONFIGURATION, 0)), +) + +FLOW_S3_BUCKET_NAME: StaticSchema = (3, n0, _FSBN, 0) + +RETRIEVAL_FLOW_NODE_S3_CONFIGURATION: StaticSchema = ( + 18, + n0, + _RFNSC, + 0, + (_bN,), + ((FLOW_S3_BUCKET_NAME, {_smithya: _v_, _smi: None}),), +) + +RETRIEVAL_FLOW_NODE_SERVICE_CONFIGURATION: StaticSchema = ( + 19, + n0, + _RFNSCe, + 0, + (_s_,), + ((RETRIEVAL_FLOW_NODE_S3_CONFIGURATION, 0),), +) + +RETRIEVAL_FLOW_NODE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _RFNC, + 0, + (_sCe,), + ((RETRIEVAL_FLOW_NODE_SERVICE_CONFIGURATION, 1),), +) + +STORAGE_FLOW_NODE_S3_CONFIGURATION: StaticSchema = ( + 18, + n0, + _SFNSC, + 0, + (_bN,), + ((FLOW_S3_BUCKET_NAME, {_smithya: _v_, _smi: None}),), +) + +STORAGE_FLOW_NODE_SERVICE_CONFIGURATION: StaticSchema = ( + 19, + n0, + _SFNSCt, + 0, + (_s_,), + ((STORAGE_FLOW_NODE_S3_CONFIGURATION, 0),), +) + +STORAGE_FLOW_NODE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _SFNC, + 0, + (_sCe,), + ((STORAGE_FLOW_NODE_SERVICE_CONFIGURATION, 1),), +) + +FLOW_NODE_INPUT_CATEGORY: StaticSchema = ( + 14, + n0, + _FNIC, + 0, + (_LC, _RVTLS, _EL), + ((-1, {_sV: _LCo}), (-1, {_sV: _RVTLSe}), (-1, {_sV: _ELx})), +) + +FLOW_NODE_INPUT_EXPRESSION: StaticSchema = (3, n0, _FNIE, 4) + +FLOW_NODE_IO_DATA_TYPE: StaticSchema = ( + 14, + n0, + _FNIODT, + 0, + (_STRING, _NUMBER, _BOOLEAN, _OBJECT, _ARRAY), + ( + (-1, {_sV: _St}), + (-1, {_sV: _Nu}), + (-1, {_sV: _B}), + (-1, {_sV: _O}), + (-1, {_sV: _Ar}), + ), ) -DAY_OF_WEEK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#DayOfWeek"), - shape_type=ShapeType.ENUM, - members={ - "SUNDAY": {"target": UNIT}, - "MONDAY": {"target": UNIT}, - "TUESDAY": {"target": UNIT}, - "WEDNESDAY": {"target": UNIT}, - "THURSDAY": {"target": UNIT}, - "FRIDAY": {"target": UNIT}, - "SATURDAY": {"target": UNIT}, - }, +FLOW_NODE_INPUT: StaticSchema = ( + 18, + n0, + _FNI, + 0, + (_na, _t, _ex, _ca), + ( + (FLOW_NODE_INPUT_NAME, 1), + (FLOW_NODE_IO_DATA_TYPE, 1), + (FLOW_NODE_INPUT_EXPRESSION, 1), + (FLOW_NODE_INPUT_CATEGORY, 0), + ), ) -WEEKLY_SCHEDULE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#WeeklySchedule"), - members={ - "dayOfWeek": { - "target": DAY_OF_WEEK, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +FLOW_NODE_INPUTS: StaticSchema = (16, n0, _FNIl, 0, (_me,), ((FLOW_NODE_INPUT, 0),)) + +FLOW_NODE_OUTPUT: StaticSchema = ( + 18, + n0, + _FNO, + 0, + (_na, _t), + ((FLOW_NODE_OUTPUT_NAME, 1), (FLOW_NODE_IO_DATA_TYPE, 1)), +) + +FLOW_NODE_OUTPUTS: StaticSchema = (16, n0, _FNOl, 0, (_me,), ((FLOW_NODE_OUTPUT, 0),)) + +FLOW_NODE_TYPE: StaticSchema = ( + 14, + n0, + _FNT, + 0, + ( + _INPUT, + _OUTPUT, + _KB, + _CONDITION, + _LEX, + _PROMPT, + _LF, + _STORAGE, + _AGENT, + _RETRIEVAL, + _ITERATOR, + _COLLECTOR, + _IC_, + _LOOP, + _LI, + _LC_, + ), + ( + (-1, {_sV: _Inp}), + (-1, {_sV: _Ou}), + (-1, {_sV: _KBn}), + (-1, {_sV: _Co}), + (-1, {_sV: _L}), + (-1, {_sV: _Pr}), + (-1, {_sV: _LFa}), + (-1, {_sV: _Sto}), + (-1, {_sV: _A}), + (-1, {_sV: _R}), + (-1, {_sV: _It}), + (-1, {_sV: _Col}), + (-1, {_sV: _ICn}), + (-1, {_sV: _Lo}), + (-1, {_sV: _LIo}), + (-1, {_sV: _LCoo}), + ), ) -SYNC_SCHEDULE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#SyncSchedule"), - shape_type=ShapeType.UNION, - members={ - "daily": {"target": DAILY_SCHEDULE}, - "weekly": {"target": WEEKLY_SCHEDULE}, - "monthly": {"target": MONTHLY_SCHEDULE}, - }, -) +FLOW_DESCRIPTION: StaticSchema = (3, n0, _FDl, 0) -MANAGED_KNOWLEDGE_BASE_CONNECTOR_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ManagedKnowledgeBaseConnectorConfiguration"), - members={ - "deletionProtectionConfiguration": { - "target": DELETION_PROTECTION_CONFIGURATION - }, - "mediaExtractionConfiguration": {"target": MEDIA_EXTRACTION_CONFIGURATION}, - "connectorParameters": {"target": DOCUMENT}, - "syncSchedule": {"target": SYNC_SCHEDULE}, - }, -) +FLOW_EXECUTION_ROLE_ARN: StaticSchema = (3, n0, _FERA, 0) -S3_BUCKET_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagent#S3BucketArn"), shape_type=ShapeType.STRING -) +FLOW_NAME: StaticSchema = (3, n0, _FN, 0) -BUCKET_OWNER_ACCOUNT_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagent#BucketOwnerAccountId"), - shape_type=ShapeType.STRING, -) +FLOW_ARN: StaticSchema = (3, n0, _FA, 0) -S3_PREFIX = Schema( - id=ShapeID("com.amazonaws.bedrockagent#S3Prefix"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) +FLOW_ID: StaticSchema = (3, n0, _FI, 0) -S3_PREFIXES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#S3Prefixes"), - shape_type=ShapeType.LIST, - members={"member": {"target": S3_PREFIX}}, +FLOW_STATUS: StaticSchema = ( + 14, + n0, + _FSl, + 0, + (_FAILED, _PREPARED, _PREPARING, _NP), + ((-1, {_sV: _Fa}), (-1, {_sV: _Pre}), (-1, {_sV: _Prep}), (-1, {_sV: _NPo})), ) -S3_DATA_SOURCE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#S3DataSourceConfiguration"), - members={ - "bucketArn": { - "target": S3_BUCKET_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "inclusionPrefixes": {"target": S3_PREFIXES}, - "bucketOwnerAccountId": {"target": BUCKET_OWNER_ACCOUNT_ID}, - }, +FLOW_IDENTIFIER: StaticSchema = (3, n0, _FIl, 0) + +DELETE_FLOW_INPUT: StaticSchema = ( + 18, + n0, + _DFI, + {_sSI: _cDFR, _smit: None}, + (_fI, _sRIUC), + ((FLOW_IDENTIFIER, 9), (2, {_smithya: False, _sQ: _sRIUC})), ) -SALESFORCE_CRAWLER_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#SalesforceCrawlerConfiguration"), - members={"filterConfiguration": {"target": CRAWL_FILTER_CONFIGURATION}}, -) - -SALESFORCE_AUTH_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#SalesforceAuthType"), - shape_type=ShapeType.ENUM, - members={"OAUTH2_CLIENT_CREDENTIALS": {"target": UNIT}}, -) - -SALESFORCE_SOURCE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#SalesforceSourceConfiguration"), - members={ - "hostUrl": { - "target": HTTPS_URL, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "authType": { - "target": SALESFORCE_AUTH_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "credentialsSecretArn": { - "target": SECRET_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +DELETE_FLOW_OUTPUT: StaticSchema = ( + 18, + n0, + _DFO, + {_sSI: _cDFRo, _smith: None}, + (_id,), + ((FLOW_ID, 1),), ) -SALESFORCE_DATA_SOURCE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#SalesforceDataSourceConfiguration"), - members={ - "sourceConfiguration": { - "target": SALESFORCE_SOURCE_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "crawlerConfiguration": {"target": SALESFORCE_CRAWLER_CONFIGURATION}, +DELETE_FLOW: StaticOperationSchema = ( + 23, + n0, + _DFe, + { + _smithy: MappingProxyType( + {"code": 200, "method": "DELETE", "uri": "/flows/{flowIdentifier}/"} + ) }, + DELETE_FLOW_INPUT, + DELETE_FLOW_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -SHARE_POINT_CRAWLER_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#SharePointCrawlerConfiguration"), - members={"filterConfiguration": {"target": CRAWL_FILTER_CONFIGURATION}}, +CONCURRENCY_TYPE: StaticSchema = ( + 14, + n0, + _CTo, + 0, + (_AUTOMATIC, _MANUAL), + ((-1, {_sV: _Au}), (-1, {_sV: _Ma})), +) + +FLOW_ALIAS_CONCURRENCY_CONFIGURATION: StaticSchema = ( + 18, + n0, + _FACC, + 0, + (_t, _mCa), + ((CONCURRENCY_TYPE, 1), (7, 0)), +) + +FLOW_ALIAS_ROUTING_CONFIGURATION_LIST_ITEM: StaticSchema = ( + 18, + n0, + _FARCLI, + 0, + (_fV,), + ((VERSION, 0),), +) + +FLOW_ALIAS_ROUTING_CONFIGURATION: StaticSchema = ( + 16, + n0, + _FARC, + 0, + (_me,), + ((FLOW_ALIAS_ROUTING_CONFIGURATION_LIST_ITEM, 0),), +) + +CREATE_FLOW_ALIAS_INPUT: StaticSchema = ( + 18, + n0, + _CFAI, + {_sSI: _cCFAR, _smit: None}, + (_na, _d, _rCo, _cConc, _fI, _cT, _ta), + ( + (NAME, 1), + (DESCRIPTION, 0), + (FLOW_ALIAS_ROUTING_CONFIGURATION, 1), + (FLOW_ALIAS_CONCURRENCY_CONFIGURATION, 0), + (FLOW_IDENTIFIER, 9), + (CLIENT_TOKEN, 2), + (TAGS_MAP, 0), + ), ) -SHARE_POINT_AUTH_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#SharePointAuthType"), - shape_type=ShapeType.ENUM, - members={ - "OAUTH2_CLIENT_CREDENTIALS": {"target": UNIT}, - "OAUTH2_SHAREPOINT_APP_ONLY_CLIENT_CREDENTIALS": {"target": UNIT}, - }, +FLOW_ALIAS_ARN: StaticSchema = (3, n0, _FAA, 0) + +FLOW_ALIAS_ID: StaticSchema = (3, n0, _FAI, 0) + +CREATE_FLOW_ALIAS_OUTPUT: StaticSchema = ( + 18, + n0, + _CFAO, + {_sSI: _cCFARo, _smith: None}, + (_na, _d, _rCo, _cConc, _fIl, _id, _ar, _cA, _uA), + ( + (NAME, 1), + (DESCRIPTION, 0), + (FLOW_ALIAS_ROUTING_CONFIGURATION, 1), + (FLOW_ALIAS_CONCURRENCY_CONFIGURATION, 0), + (FLOW_ID, 1), + (FLOW_ALIAS_ID, 1), + (FLOW_ALIAS_ARN, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + ), ) -SHARE_POINT_DOMAIN = Schema( - id=ShapeID("com.amazonaws.bedrockagent#SharePointDomain"), - shape_type=ShapeType.STRING, -) - -SHARE_POINT_HOST_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#SharePointHostType"), - shape_type=ShapeType.ENUM, - members={"ONLINE": {"target": UNIT}}, -) - -SHARE_POINT_SITE_URLS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#SharePointSiteUrls"), - shape_type=ShapeType.LIST, - members={"member": {"target": HTTPS_URL}}, -) - -MICROSOFT365_TENANT_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagent#Microsoft365TenantId"), - shape_type=ShapeType.STRING, -) - -SHARE_POINT_SOURCE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#SharePointSourceConfiguration"), - members={ - "tenantId": {"target": MICROSOFT365_TENANT_ID}, - "domain": { - "target": SHARE_POINT_DOMAIN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "siteUrls": { - "target": SHARE_POINT_SITE_URLS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "hostType": { - "target": SHARE_POINT_HOST_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "authType": { - "target": SHARE_POINT_AUTH_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "credentialsSecretArn": { - "target": SECRET_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +CREATE_FLOW_ALIAS: StaticOperationSchema = ( + 23, + n0, + _CFA, + { + _smithy: MappingProxyType( + {"code": 201, "method": "POST", "uri": "/flows/{flowIdentifier}/aliases"} + ) + }, + CREATE_FLOW_ALIAS_INPUT, + CREATE_FLOW_ALIAS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -SHARE_POINT_DATA_SOURCE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#SharePointDataSourceConfiguration"), - members={ - "sourceConfiguration": { - "target": SHARE_POINT_SOURCE_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "crawlerConfiguration": {"target": SHARE_POINT_CRAWLER_CONFIGURATION}, - }, +FLOW_ALIAS_IDENTIFIER: StaticSchema = (3, n0, _FAIl, 0) + +DELETE_FLOW_ALIAS_INPUT: StaticSchema = ( + 18, + n0, + _DFAI, + {_sSI: _cDFAR, _smit: None}, + (_fI, _aIl), + ((FLOW_IDENTIFIER, 9), (FLOW_ALIAS_IDENTIFIER, 9)), +) + +DELETE_FLOW_ALIAS_OUTPUT: StaticSchema = ( + 18, + n0, + _DFAO, + {_sSI: _cDFARo, _smith: None}, + (_fIl, _id), + ((FLOW_ID, 1), (FLOW_ALIAS_ID, 1)), +) + +DELETE_FLOW_ALIAS: StaticOperationSchema = ( + 23, + n0, + _DFA, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "DELETE", + "uri": "/flows/{flowIdentifier}/aliases/{aliasIdentifier}", + } + ) + }, + DELETE_FLOW_ALIAS_INPUT, + DELETE_FLOW_ALIAS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -DATA_SOURCE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#DataSourceType"), - shape_type=ShapeType.ENUM, - members={ - "S3": {"target": UNIT}, - "WEB": {"target": UNIT}, - "CONFLUENCE": {"target": UNIT}, - "SALESFORCE": {"target": UNIT}, - "SHAREPOINT": {"target": UNIT}, - "CUSTOM": {"target": UNIT}, - "REDSHIFT_METADATA": {"target": UNIT}, - "MANAGED_KNOWLEDGE_BASE_CONNECTOR": {"target": UNIT}, - }, +GET_FLOW_ALIAS_INPUT: StaticSchema = ( + 18, + n0, + _GFAI, + {_sSI: _cGFAR, _smit: None}, + (_fI, _aIl), + ((FLOW_IDENTIFIER, 9), (FLOW_ALIAS_IDENTIFIER, 9)), +) + +GET_FLOW_ALIAS_OUTPUT: StaticSchema = ( + 18, + n0, + _GFAO, + {_sSI: _cGFARo, _smith: None}, + (_na, _d, _rCo, _cConc, _fIl, _id, _ar, _cA, _uA), + ( + (NAME, 1), + (DESCRIPTION, 0), + (FLOW_ALIAS_ROUTING_CONFIGURATION, 1), + (FLOW_ALIAS_CONCURRENCY_CONFIGURATION, 0), + (FLOW_ID, 1), + (FLOW_ALIAS_ID, 1), + (FLOW_ALIAS_ARN, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + ), ) -WEB_CRAWLER_LIMITS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#WebCrawlerLimits"), - members={"rateLimit": {"target": INTEGER}, "maxPages": {"target": INTEGER}}, +GET_FLOW_ALIAS: StaticOperationSchema = ( + 23, + n0, + _GFA, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "GET", + "uri": "/flows/{flowIdentifier}/aliases/{aliasIdentifier}", + } + ) + }, + GET_FLOW_ALIAS_INPUT, + GET_FLOW_ALIAS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -WEB_SCOPE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#WebScopeType"), - shape_type=ShapeType.ENUM, - members={"HOST_ONLY": {"target": UNIT}, "SUBDOMAINS": {"target": UNIT}}, +LIST_FLOW_ALIASES_INPUT: StaticSchema = ( + 18, + n0, + _LFAI, + {_sSI: _cLFAR, _smit: None}, + (_fI, _mR, _nT), + ((FLOW_IDENTIFIER, 9), (MAX_RESULTS, {_sQ: _mR}), (NEXT_TOKEN, {_sQ: _nT})), +) + +FLOW_ALIAS_SUMMARY: StaticSchema = ( + 18, + n0, + _FAS, + 0, + (_na, _d, _rCo, _cConc, _fIl, _id, _ar, _cA, _uA), + ( + (NAME, 1), + (DESCRIPTION, 0), + (FLOW_ALIAS_ROUTING_CONFIGURATION, 1), + (FLOW_ALIAS_CONCURRENCY_CONFIGURATION, 0), + (FLOW_ID, 1), + (FLOW_ALIAS_ID, 1), + (FLOW_ALIAS_ARN, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + ), ) -USER_AGENT = Schema( - id=ShapeID("com.amazonaws.bedrockagent#UserAgent"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +FLOW_ALIAS_SUMMARIES: StaticSchema = ( + 16, + n0, + _FASl, + 0, + (_me,), + ((FLOW_ALIAS_SUMMARY, 0),), +) + +LIST_FLOW_ALIASES_OUTPUT: StaticSchema = ( + 18, + n0, + _LFAO, + {_sSI: _cLFARo, _smith: None}, + (_fAS, _nT), + ((FLOW_ALIAS_SUMMARIES, 1), (NEXT_TOKEN, 0)), +) + +LIST_FLOW_ALIASES: StaticOperationSchema = ( + 23, + n0, + _LFA, + { + _smithy: MappingProxyType( + {"code": 200, "method": "GET", "uri": "/flows/{flowIdentifier}/aliases"} + ) + }, + LIST_FLOW_ALIASES_INPUT, + LIST_FLOW_ALIASES_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -USER_AGENT_HEADER = Schema( - id=ShapeID("com.amazonaws.bedrockagent#UserAgentHeader"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +UPDATE_FLOW_ALIAS_INPUT: StaticSchema = ( + 18, + n0, + _UFAI, + {_sSI: _cUFAR, _smit: None}, + (_na, _d, _rCo, _cConc, _fI, _aIl), + ( + (NAME, 1), + (DESCRIPTION, 0), + (FLOW_ALIAS_ROUTING_CONFIGURATION, 1), + (FLOW_ALIAS_CONCURRENCY_CONFIGURATION, 0), + (FLOW_IDENTIFIER, 9), + (FLOW_ALIAS_IDENTIFIER, 9), + ), ) -WEB_CRAWLER_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#WebCrawlerConfiguration"), - members={ - "crawlerLimits": {"target": WEB_CRAWLER_LIMITS}, - "inclusionFilters": {"target": FILTER_LIST}, - "exclusionFilters": {"target": FILTER_LIST}, - "scope": {"target": WEB_SCOPE_TYPE}, - "userAgent": {"target": USER_AGENT}, - "userAgentHeader": {"target": USER_AGENT_HEADER}, - }, +UPDATE_FLOW_ALIAS_OUTPUT: StaticSchema = ( + 18, + n0, + _UFAO, + {_sSI: _cUFARo, _smith: None}, + (_na, _d, _rCo, _cConc, _fIl, _id, _ar, _cA, _uA), + ( + (NAME, 1), + (DESCRIPTION, 0), + (FLOW_ALIAS_ROUTING_CONFIGURATION, 1), + (FLOW_ALIAS_CONCURRENCY_CONFIGURATION, 0), + (FLOW_ID, 1), + (FLOW_ALIAS_ID, 1), + (FLOW_ALIAS_ARN, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + ), ) -URL = Schema(id=ShapeID("com.amazonaws.bedrockagent#Url"), shape_type=ShapeType.STRING) - -SEED_URL = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#SeedUrl"), members={"url": {"target": URL}} +UPDATE_FLOW_ALIAS: StaticOperationSchema = ( + 23, + n0, + _UFA, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "PUT", + "uri": "/flows/{flowIdentifier}/aliases/{aliasIdentifier}", + } + ) + }, + UPDATE_FLOW_ALIAS_INPUT, + UPDATE_FLOW_ALIAS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -SEED_URLS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#SeedUrls"), - shape_type=ShapeType.LIST, - members={"member": {"target": SEED_URL}}, +CREATE_FLOW_VERSION_INPUT: StaticSchema = ( + 18, + n0, + _CFVI, + {_sSI: _cCFVR, _smit: None}, + (_fI, _d, _cT), + ((FLOW_IDENTIFIER, 9), (FLOW_DESCRIPTION, 0), (CLIENT_TOKEN, 2)), +) + +DELETE_FLOW_VERSION_INPUT: StaticSchema = ( + 18, + n0, + _DFVI, + {_sSI: _cDFVR, _smit: None}, + (_fI, _fV, _sRIUC), + ((FLOW_IDENTIFIER, 9), (NUMERICAL_VERSION, 9), (2, {_smithya: False, _sQ: _sRIUC})), +) + +DELETE_FLOW_VERSION_OUTPUT: StaticSchema = ( + 18, + n0, + _DFVO, + {_sSI: _cDFVRo, _smith: None}, + (_id, _ve), + ((ID, 1), (NUMERICAL_VERSION, 1)), +) + +DELETE_FLOW_VERSION: StaticOperationSchema = ( + 23, + n0, + _DFV, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "DELETE", + "uri": "/flows/{flowIdentifier}/versions/{flowVersion}/", + } + ) + }, + DELETE_FLOW_VERSION_INPUT, + DELETE_FLOW_VERSION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -URL_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#UrlConfiguration"), - members={"seedUrls": {"target": SEED_URLS}}, +INCLUDED_DATA: StaticSchema = ( + 14, + n0, + _ID, + 0, + (_AD_, _MO), + ((-1, {_sV: _AD_}), (-1, {_sV: _MO})), +) + +GET_FLOW_VERSION_INPUT: StaticSchema = ( + 18, + n0, + _GFVI, + {_sSI: _cGFVR, _smit: None}, + (_fI, _fV, _iD), + ((FLOW_IDENTIFIER, 9), (NUMERICAL_VERSION, 9), (INCLUDED_DATA, {_sQ: _iD})), +) + +LIST_FLOW_VERSIONS_INPUT: StaticSchema = ( + 18, + n0, + _LFVI, + {_sSI: _cLFVR, _smit: None}, + (_fI, _mR, _nT), + ((FLOW_IDENTIFIER, 9), (MAX_RESULTS, {_sQ: _mR}), (NEXT_TOKEN, {_sQ: _nT})), +) + +FLOW_VERSION_SUMMARY: StaticSchema = ( + 18, + n0, + _FVS, + 0, + (_id, _ar, _sta, _cA, _ve), + ( + (FLOW_ID, 1), + (FLOW_ARN, 1), + (FLOW_STATUS, 1), + (DATE_TIMESTAMP, 1), + (NUMERICAL_VERSION, 1), + ), ) -WEB_SOURCE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#WebSourceConfiguration"), - members={ - "urlConfiguration": { - "target": URL_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +FLOW_VERSION_SUMMARIES: StaticSchema = ( + 16, + n0, + _FVSl, + 0, + (_me,), + ((FLOW_VERSION_SUMMARY, 0),), +) + +LIST_FLOW_VERSIONS_OUTPUT: StaticSchema = ( + 18, + n0, + _LFVO, + {_sSI: _cLFVRo, _smith: None}, + (_fVS, _nT), + ((FLOW_VERSION_SUMMARIES, 1), (NEXT_TOKEN, 0)), +) + +LIST_FLOW_VERSIONS: StaticOperationSchema = ( + 23, + n0, + _LFV, + { + _smithy: MappingProxyType( + {"code": 200, "method": "GET", "uri": "/flows/{flowIdentifier}/versions"} + ) + }, + LIST_FLOW_VERSIONS_INPUT, + LIST_FLOW_VERSIONS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -WEB_DATA_SOURCE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#WebDataSourceConfiguration"), - members={ - "sourceConfiguration": { - "target": WEB_SOURCE_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "crawlerConfiguration": {"target": WEB_CRAWLER_CONFIGURATION}, - }, +GET_FLOW_INPUT: StaticSchema = ( + 18, + n0, + _GFI, + {_sSI: _cGFR, _smit: None}, + (_fI, _iD), + ((FLOW_IDENTIFIER, 9), (INCLUDED_DATA, {_sQ: _iD})), +) + +CYCLIC_CONNECTION_FLOW_VALIDATION_DETAILS: StaticSchema = ( + 18, + n0, + _CCFVD, + 0, + (_conn,), + ((FLOW_CONNECTION_NAME, 1),), +) + +DUPLICATE_CONDITION_EXPRESSION_FLOW_VALIDATION_DETAILS: StaticSchema = ( + 18, + n0, + _DCEFVD, + 0, + (_no, _ex), + ((FLOW_NODE_NAME, 1), (FLOW_CONDITION_EXPRESSION, 1)), +) + +DUPLICATE_CONNECTIONS_FLOW_VALIDATION_DETAILS: StaticSchema = ( + 18, + n0, + _DCFVD, + 0, + (_so, _tar), + ((FLOW_NODE_NAME, 1), (FLOW_NODE_NAME, 1)), +) + +INCOMPATIBLE_CONNECTION_DATA_TYPE_FLOW_VALIDATION_DETAILS: StaticSchema = ( + 18, + n0, + _ICDTFVD, + 0, + (_conn,), + ((FLOW_CONNECTION_NAME, 1),), +) + +INVALID_LOOP_BOUNDARY_FLOW_VALIDATION_DETAILS: StaticSchema = ( + 18, + n0, + _ILBFVD, + 0, + (_conn, _so, _tar), + ((FLOW_CONNECTION_NAME, 1), (FLOW_NODE_NAME, 1), (FLOW_NODE_NAME, 1)), +) + +INCOMPATIBLE_LOOP_NODE_TYPE: StaticSchema = ( + 14, + n0, + _ILNT, + 0, + (_INPUT, _CONDITION, _ITERATOR, _COLLECTOR), + ((-1, {_sV: _Inp}), (-1, {_sV: _Co}), (-1, {_sV: _It}), (-1, {_sV: _Col})), +) + +LOOP_INCOMPATIBLE_NODE_TYPE_FLOW_VALIDATION_DETAILS: StaticSchema = ( + 18, + n0, + _LINTFVD, + 0, + (_no, _iNT, _iNN), + ((FLOW_NODE_NAME, 1), (INCOMPATIBLE_LOOP_NODE_TYPE, 1), (FLOW_NODE_NAME, 1)), +) + +ERROR_MESSAGE: StaticSchema = (3, n0, _EM, 0) + +MALFORMED_CONDITION_EXPRESSION_FLOW_VALIDATION_DETAILS: StaticSchema = ( + 18, + n0, + _MCEFVD, + 0, + (_no, _co, _cau), + ((FLOW_NODE_NAME, 1), (FLOW_CONDITION_NAME, 1), (ERROR_MESSAGE, 1)), +) + +MALFORMED_NODE_INPUT_EXPRESSION_FLOW_VALIDATION_DETAILS: StaticSchema = ( + 18, + n0, + _MNIEFVD, + 0, + (_no, _inp, _cau), + ((FLOW_NODE_NAME, 1), (FLOW_NODE_INPUT_NAME, 1), (ERROR_MESSAGE, 1)), +) + +MISMATCHED_NODE_INPUT_TYPE_FLOW_VALIDATION_DETAILS: StaticSchema = ( + 18, + n0, + _MNITFVD, + 0, + (_no, _inp, _eT), + ((FLOW_NODE_NAME, 1), (FLOW_NODE_INPUT_NAME, 1), (FLOW_NODE_IO_DATA_TYPE, 1)), +) + +MISMATCHED_NODE_OUTPUT_TYPE_FLOW_VALIDATION_DETAILS: StaticSchema = ( + 18, + n0, + _MNOTFVD, + 0, + (_no, _ou, _eT), + ((FLOW_NODE_NAME, 1), (FLOW_NODE_OUTPUT_NAME, 1), (FLOW_NODE_IO_DATA_TYPE, 1)), +) + +MISSING_CONNECTION_CONFIGURATION_FLOW_VALIDATION_DETAILS: StaticSchema = ( + 18, + n0, + _MCCFVD, + 0, + (_conn,), + ((FLOW_CONNECTION_NAME, 1),), +) + +MISSING_DEFAULT_CONDITION_FLOW_VALIDATION_DETAILS: StaticSchema = ( + 18, + n0, + _MDCFVD, + 0, + (_no,), + ((FLOW_NODE_NAME, 1),), +) + +MISSING_ENDING_NODES_FLOW_VALIDATION_DETAILS: StaticSchema = (18, n0, _MENFVD, 0) + +MISSING_LOOP_CONTROLLER_NODE_FLOW_VALIDATION_DETAILS: StaticSchema = ( + 18, + n0, + _MLCNFVD, + 0, + (_lN,), + ((FLOW_NODE_NAME, 1),), +) + +MISSING_LOOP_INPUT_NODE_FLOW_VALIDATION_DETAILS: StaticSchema = ( + 18, + n0, + _MLINFVD, + 0, + (_lN,), + ((FLOW_NODE_NAME, 1),), +) + +MISSING_NODE_CONFIGURATION_FLOW_VALIDATION_DETAILS: StaticSchema = ( + 18, + n0, + _MNCFVD, + 0, + (_no,), + ((FLOW_NODE_NAME, 1),), +) + +MISSING_NODE_INPUT_FLOW_VALIDATION_DETAILS: StaticSchema = ( + 18, + n0, + _MNIFVD, + 0, + (_no, _inp), + ((FLOW_NODE_NAME, 1), (FLOW_NODE_INPUT_NAME, 1)), +) + +MISSING_NODE_OUTPUT_FLOW_VALIDATION_DETAILS: StaticSchema = ( + 18, + n0, + _MNOFVD, + 0, + (_no, _ou), + ((FLOW_NODE_NAME, 1), (FLOW_NODE_OUTPUT_NAME, 1)), +) + +MISSING_STARTING_NODES_FLOW_VALIDATION_DETAILS: StaticSchema = (18, n0, _MSNFVD, 0) + +MULTIPLE_LOOP_CONTROLLER_NODES_FLOW_VALIDATION_DETAILS: StaticSchema = ( + 18, + n0, + _MLCNFVDu, + 0, + (_lN,), + ((FLOW_NODE_NAME, 1),), +) + +MULTIPLE_LOOP_INPUT_NODES_FLOW_VALIDATION_DETAILS: StaticSchema = ( + 18, + n0, + _MLINFVDu, + 0, + (_lN,), + ((FLOW_NODE_NAME, 1),), +) + +MULTIPLE_NODE_INPUT_CONNECTIONS_FLOW_VALIDATION_DETAILS: StaticSchema = ( + 18, + n0, + _MNICFVD, + 0, + (_no, _inp), + ((FLOW_NODE_NAME, 1), (FLOW_NODE_INPUT_NAME, 1)), +) + +UNFULFILLED_NODE_INPUT_FLOW_VALIDATION_DETAILS: StaticSchema = ( + 18, + n0, + _UNIFVD, + 0, + (_no, _inp), + ((FLOW_NODE_NAME, 1), (FLOW_NODE_INPUT_NAME, 1)), +) + +UNKNOWN_CONNECTION_CONDITION_FLOW_VALIDATION_DETAILS: StaticSchema = ( + 18, + n0, + _UCCFVD, + 0, + (_conn,), + ((FLOW_CONNECTION_NAME, 1),), +) + +UNKNOWN_CONNECTION_SOURCE_FLOW_VALIDATION_DETAILS: StaticSchema = ( + 18, + n0, + _UCSFVD, + 0, + (_conn,), + ((FLOW_CONNECTION_NAME, 1),), +) + +UNKNOWN_CONNECTION_SOURCE_OUTPUT_FLOW_VALIDATION_DETAILS: StaticSchema = ( + 18, + n0, + _UCSOFVD, + 0, + (_conn,), + ((FLOW_CONNECTION_NAME, 1),), +) + +UNKNOWN_CONNECTION_TARGET_FLOW_VALIDATION_DETAILS: StaticSchema = ( + 18, + n0, + _UCTFVD, + 0, + (_conn,), + ((FLOW_CONNECTION_NAME, 1),), +) + +UNKNOWN_CONNECTION_TARGET_INPUT_FLOW_VALIDATION_DETAILS: StaticSchema = ( + 18, + n0, + _UCTIFVD, + 0, + (_conn,), + ((FLOW_CONNECTION_NAME, 1),), +) + +UNKNOWN_NODE_INPUT_FLOW_VALIDATION_DETAILS: StaticSchema = ( + 18, + n0, + _UNIFVDn, + 0, + (_no, _inp), + ((FLOW_NODE_NAME, 1), (FLOW_NODE_INPUT_NAME, 1)), +) + +UNKNOWN_NODE_OUTPUT_FLOW_VALIDATION_DETAILS: StaticSchema = ( + 18, + n0, + _UNOFVD, + 0, + (_no, _ou), + ((FLOW_NODE_NAME, 1), (FLOW_NODE_OUTPUT_NAME, 1)), +) + +UNREACHABLE_NODE_FLOW_VALIDATION_DETAILS: StaticSchema = ( + 18, + n0, + _UNFVD, + 0, + (_no,), + ((FLOW_NODE_NAME, 1),), +) + +UNSATISFIED_CONNECTION_CONDITIONS_FLOW_VALIDATION_DETAILS: StaticSchema = ( + 18, + n0, + _UCCFVDn, + 0, + (_conn,), + ((FLOW_CONNECTION_NAME, 1),), +) + +UNSPECIFIED_FLOW_VALIDATION_DETAILS: StaticSchema = (18, n0, _UFVD, 0) + +FLOW_VALIDATION_DETAILS: StaticSchema = ( + 19, + n0, + _FVD, + 0, + ( + _cCy, + _dC, + _dCE, + _uN, + _uCS, + _uCSO, + _uCT, + _uCTI, + _uCC, + _mCE, + _mNIE, + _mNIT, + _mNOT, + _iCDT, + _mCC, + _mDC, + _mEN, + _mNC, + _mNI, + _mNO, + _mSN, + _mNIC, + _uNI, + _uCCn, + _un, + _uNIn, + _uNO, + _mLIN, + _mLCN, + _mLINu, + _mLCNu, + _lINT, + _iLB, + ), + ( + (CYCLIC_CONNECTION_FLOW_VALIDATION_DETAILS, 0), + (DUPLICATE_CONNECTIONS_FLOW_VALIDATION_DETAILS, 0), + (DUPLICATE_CONDITION_EXPRESSION_FLOW_VALIDATION_DETAILS, 0), + (UNREACHABLE_NODE_FLOW_VALIDATION_DETAILS, 0), + (UNKNOWN_CONNECTION_SOURCE_FLOW_VALIDATION_DETAILS, 0), + (UNKNOWN_CONNECTION_SOURCE_OUTPUT_FLOW_VALIDATION_DETAILS, 0), + (UNKNOWN_CONNECTION_TARGET_FLOW_VALIDATION_DETAILS, 0), + (UNKNOWN_CONNECTION_TARGET_INPUT_FLOW_VALIDATION_DETAILS, 0), + (UNKNOWN_CONNECTION_CONDITION_FLOW_VALIDATION_DETAILS, 0), + (MALFORMED_CONDITION_EXPRESSION_FLOW_VALIDATION_DETAILS, 0), + (MALFORMED_NODE_INPUT_EXPRESSION_FLOW_VALIDATION_DETAILS, 0), + (MISMATCHED_NODE_INPUT_TYPE_FLOW_VALIDATION_DETAILS, 0), + (MISMATCHED_NODE_OUTPUT_TYPE_FLOW_VALIDATION_DETAILS, 0), + (INCOMPATIBLE_CONNECTION_DATA_TYPE_FLOW_VALIDATION_DETAILS, 0), + (MISSING_CONNECTION_CONFIGURATION_FLOW_VALIDATION_DETAILS, 0), + (MISSING_DEFAULT_CONDITION_FLOW_VALIDATION_DETAILS, 0), + (MISSING_ENDING_NODES_FLOW_VALIDATION_DETAILS, 0), + (MISSING_NODE_CONFIGURATION_FLOW_VALIDATION_DETAILS, 0), + (MISSING_NODE_INPUT_FLOW_VALIDATION_DETAILS, 0), + (MISSING_NODE_OUTPUT_FLOW_VALIDATION_DETAILS, 0), + (MISSING_STARTING_NODES_FLOW_VALIDATION_DETAILS, 0), + (MULTIPLE_NODE_INPUT_CONNECTIONS_FLOW_VALIDATION_DETAILS, 0), + (UNFULFILLED_NODE_INPUT_FLOW_VALIDATION_DETAILS, 0), + (UNSATISFIED_CONNECTION_CONDITIONS_FLOW_VALIDATION_DETAILS, 0), + (UNSPECIFIED_FLOW_VALIDATION_DETAILS, 0), + (UNKNOWN_NODE_INPUT_FLOW_VALIDATION_DETAILS, 0), + (UNKNOWN_NODE_OUTPUT_FLOW_VALIDATION_DETAILS, 0), + (MISSING_LOOP_INPUT_NODE_FLOW_VALIDATION_DETAILS, 0), + (MISSING_LOOP_CONTROLLER_NODE_FLOW_VALIDATION_DETAILS, 0), + (MULTIPLE_LOOP_INPUT_NODES_FLOW_VALIDATION_DETAILS, 0), + (MULTIPLE_LOOP_CONTROLLER_NODES_FLOW_VALIDATION_DETAILS, 0), + (LOOP_INCOMPATIBLE_NODE_TYPE_FLOW_VALIDATION_DETAILS, 0), + (INVALID_LOOP_BOUNDARY_FLOW_VALIDATION_DETAILS, 0), + ), ) -DATA_SOURCE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#DataSourceConfiguration"), - members={ - "type": { - "target": DATA_SOURCE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "managedKnowledgeBaseConnectorConfiguration": { - "target": MANAGED_KNOWLEDGE_BASE_CONNECTOR_CONFIGURATION - }, - "s3Configuration": {"target": S3_DATA_SOURCE_CONFIGURATION}, - "webConfiguration": {"target": WEB_DATA_SOURCE_CONFIGURATION}, - "confluenceConfiguration": {"target": CONFLUENCE_DATA_SOURCE_CONFIGURATION}, - "salesforceConfiguration": {"target": SALESFORCE_DATA_SOURCE_CONFIGURATION}, - "sharePointConfiguration": {"target": SHARE_POINT_DATA_SOURCE_CONFIGURATION}, - }, +FLOW_VALIDATION_SEVERITY: StaticSchema = ( + 14, + n0, + _FVSlo, + 0, + (_WARNING, _ERROR), + ((-1, {_sV: _W}), (-1, {_sV: _E})), +) + +FLOW_VALIDATION_TYPE: StaticSchema = ( + 14, + n0, + _FVT, + 0, + ( + _CC_, + _DC, + _DCE, + _UN, + _UCS, + _UCSO, + _UCT, + _UCTI, + _UCC, + _MCE, + _MNIE, + _MNIT, + _MNOT, + _ICDT, + _MCC, + _MDC, + _MEN, + _MNC, + _MNI, + _MNO, + _MSN, + _MNIC, + _UNI, + _UCC_, + _UNSPECIFIED, + _UNI_, + _UNO, + _MLIN, + _MLCN, + _MLIN_, + _MLCN_, + _LINT, + _ILB, + ), + ( + (-1, {_sV: _CCy}), + (-1, {_sV: _DCu}), + (-1, {_sV: _DCEu}), + (-1, {_sV: _UNn}), + (-1, {_sV: _UCSn}), + (-1, {_sV: _UCSOn}), + (-1, {_sV: _UCTn}), + (-1, {_sV: _UCTIn}), + (-1, {_sV: _UCCn}), + (-1, {_sV: _MCEa}), + (-1, {_sV: _MNIEa}), + (-1, {_sV: _MNITi}), + (-1, {_sV: _MNOTi}), + (-1, {_sV: _ICDTn}), + (-1, {_sV: _MCCi}), + (-1, {_sV: _MDCi}), + (-1, {_sV: _MENi}), + (-1, {_sV: _MNCi}), + (-1, {_sV: _MNIi}), + (-1, {_sV: _MNOi}), + (-1, {_sV: _MSNi}), + (-1, {_sV: _MNICu}), + (-1, {_sV: _UNIn}), + (-1, {_sV: _UCCns}), + (-1, {_sV: _Un}), + (-1, {_sV: _UNInk}), + (-1, {_sV: _UNOn}), + (-1, {_sV: _MLINi}), + (-1, {_sV: _MLCNi}), + (-1, {_sV: _MLINu}), + (-1, {_sV: _MLCNu}), + (-1, {_sV: _LINTo}), + (-1, {_sV: _ILBn}), + ), ) -SERVER_SIDE_ENCRYPTION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ServerSideEncryptionConfiguration"), - members={"kmsKeyArn": {"target": KMS_KEY_ARN}}, +FLOW_VALIDATION: StaticSchema = ( + 18, + n0, + _FV, + 0, + (_m, _sev, _det, _t), + ( + (NON_BLANK_STRING, 1), + (FLOW_VALIDATION_SEVERITY, 1), + (FLOW_VALIDATION_DETAILS, 0), + (FLOW_VALIDATION_TYPE, 0), + ), ) -CHUNKING_STRATEGY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ChunkingStrategy"), - shape_type=ShapeType.ENUM, - members={ - "FIXED_SIZE": {"target": UNIT}, - "NONE": {"target": UNIT}, - "HIERARCHICAL": {"target": UNIT}, - "SEMANTIC": {"target": UNIT}, - }, +FLOW_VALIDATIONS: StaticSchema = (16, n0, _FVl, 0, (_me,), ((FLOW_VALIDATION, 0),)) + +LIST_FLOWS_INPUT: StaticSchema = ( + 18, + n0, + _LFI, + {_sSI: _cLFR, _smit: None}, + (_mR, _nT), + ((MAX_RESULTS, {_sQ: _mR}), (NEXT_TOKEN, {_sQ: _nT})), +) + +FLOW_SUMMARY: StaticSchema = ( + 18, + n0, + _FSlo, + 0, + (_na, _d, _id, _ar, _sta, _cA, _uA, _ve), + ( + (FLOW_NAME, 1), + (FLOW_DESCRIPTION, 0), + (FLOW_ID, 1), + (FLOW_ARN, 1), + (FLOW_STATUS, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (DRAFT_VERSION, 1), + ), ) -FIXED_SIZE_CHUNKING_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#FixedSizeChunkingConfiguration"), - members={ - "maxTokens": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "overlapPercentage": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +FLOW_SUMMARIES: StaticSchema = (16, n0, _FSlow, 0, (_me,), ((FLOW_SUMMARY, 0),)) + +LIST_FLOWS_OUTPUT: StaticSchema = ( + 18, + n0, + _LFO, + {_sSI: _cLFRo, _smith: None}, + (_fSl, _nT), + ((FLOW_SUMMARIES, 1), (NEXT_TOKEN, 0)), +) + +LIST_FLOWS: StaticOperationSchema = ( + 23, + n0, + _LFi, + {_smithy: MappingProxyType({"code": 200, "method": "GET", "uri": "/flows/"})}, + LIST_FLOWS_INPUT, + LIST_FLOWS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -HIERARCHICAL_CHUNKING_LEVEL_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#HierarchicalChunkingLevelConfiguration"), - members={ - "maxTokens": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +PREPARE_FLOW_INPUT: StaticSchema = ( + 18, + n0, + _PFI, + {_sSI: _cPFR, _smit: None}, + (_fI,), + ((FLOW_IDENTIFIER, 9),), +) + +PREPARE_FLOW_OUTPUT: StaticSchema = ( + 18, + n0, + _PFO, + {_sSI: _cPFRo, _smith: None}, + (_id, _sta), + ((FLOW_ID, 1), (FLOW_STATUS, 1)), +) + +PREPARE_FLOW: StaticOperationSchema = ( + 23, + n0, + _PF, + { + _smithy: MappingProxyType( + {"code": 202, "method": "POST", "uri": "/flows/{flowIdentifier}/"} + ) + }, + PREPARE_FLOW_INPUT, + PREPARE_FLOW_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -HIERARCHICAL_CHUNKING_LEVEL_CONFIGURATIONS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#HierarchicalChunkingLevelConfigurations"), - shape_type=ShapeType.LIST, - members={"member": {"target": HIERARCHICAL_CHUNKING_LEVEL_CONFIGURATION}}, +GET_RESOURCE_POLICY_INPUT: StaticSchema = ( + 18, + n0, + _GRPI, + {_sSI: _cGRPR, _smit: None}, + (_rAe,), + ((RESOURCE_ARN, 9),), ) -HIERARCHICAL_CHUNKING_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#HierarchicalChunkingConfiguration"), - members={ - "levelConfigurations": { - "target": HIERARCHICAL_CHUNKING_LEVEL_CONFIGURATIONS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "overlapTokens": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +RESOURCE_POLICY: StaticSchema = (3, n0, _RP, {_sTm: _ap}) -SEMANTIC_CHUNKING_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#SemanticChunkingConfiguration"), - members={ - "maxTokens": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "bufferSize": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "breakpointPercentileThreshold": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +GET_RESOURCE_POLICY_OUTPUT: StaticSchema = ( + 18, + n0, + _GRPO, + {_sSI: _cGRPRo, _smith: None}, + (_rAe, _pol, _rI), + ((RESOURCE_ARN, 1), (RESOURCE_POLICY, 1), (REVISION_ID, 1)), ) -CHUNKING_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ChunkingConfiguration"), - members={ - "chunkingStrategy": { - "target": CHUNKING_STRATEGY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "fixedSizeChunkingConfiguration": {"target": FIXED_SIZE_CHUNKING_CONFIGURATION}, - "hierarchicalChunkingConfiguration": { - "target": HIERARCHICAL_CHUNKING_CONFIGURATION - }, - "semanticChunkingConfiguration": {"target": SEMANTIC_CHUNKING_CONFIGURATION}, +GET_RESOURCE_POLICY: StaticOperationSchema = ( + 23, + n0, + _GRP, + { + _smithy: MappingProxyType( + {"code": 200, "method": "GET", "uri": "/resourcepolicy/{resourceArn}"} + ) }, + GET_RESOURCE_POLICY_INPUT, + GET_RESOURCE_POLICY_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -ENRICHMENT_STRATEGY_METHOD = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#EnrichmentStrategyMethod"), - shape_type=ShapeType.ENUM, - members={"CHUNK_ENTITY_EXTRACTION": {"target": UNIT}}, +GET_VPC_CONFIGURATION_INPUT: StaticSchema = ( + 18, + n0, + _GVCI, + {_sSI: _cGVCR, _smit: None}, + (_kBI, _vCI), + ((ID, 9), (VPC_CONFIGURATION_ID, 9)), +) + +VPC_CONFIGURATION_STATUS_MESSAGE: StaticSchema = (3, n0, _VCSM, 0) + +VPC_CONFIGURATION: StaticSchema = ( + 18, + n0, + _VC, + 0, + (_vCI, _sta, _sMt, _vI, _sI, _rT, _po, _pr, _rM, _hH, _tSN, _na, _d, _cA, _uA), + ( + (VPC_CONFIGURATION_ID, 1), + (VPC_CONFIGURATION_STATUS, 1), + (VPC_CONFIGURATION_STATUS_MESSAGE, 0), + (VPC_ID, 1), + (SUBNET_ID_LIST, 1), + (RESOURCE_TARGET, 1), + (PORT, 1), + (VPC_PROTOCOL, 1), + (VPC_RESOLUTION_MODE, 1), + (HOST_HEADER, 0), + (TLS_SERVER_NAME, 0), + (VPC_CONFIGURATION_NAME, 0), + (VPC_CONFIGURATION_DESCRIPTION, 0), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + ), ) -ENRICHMENT_STRATEGY_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#EnrichmentStrategyConfiguration"), - members={ - "method": { - "target": ENRICHMENT_STRATEGY_METHOD, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +GET_VPC_CONFIGURATION_OUTPUT: StaticSchema = ( + 18, + n0, + _GVCO, + {_sSI: _cGVCRo, _smith: None}, + (_vC,), + ((VPC_CONFIGURATION, 1),), +) + +GET_VPC_CONFIGURATION: StaticOperationSchema = ( + 23, + n0, + _GVC, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "GET", + "uri": "/knowledgebases/{knowledgeBaseId}/vpcconfigurations/{vpcConfigurationId}", + } + ) + }, + GET_VPC_CONFIGURATION_INPUT, + GET_VPC_CONFIGURATION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -BEDROCK_MODEL_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagent#BedrockModelArn"), - shape_type=ShapeType.STRING, +GET_INGESTION_JOB_INPUT: StaticSchema = ( + 18, + n0, + _GIJI, + {_sSI: _cGIJR, _smit: None}, + (_kBI, _dSI, _iJI), + ((ID, 9), (ID, 9), (ID, 9)), +) + +INGESTION_JOB_STATISTICS: StaticSchema = ( + 18, + n0, + _IJS, + 0, + (_nODS, _nOMDS, _nONDI, _nOMDI, _nOMDM, _nODD, _nODF, _nODSu), + ( + (8, {_smithya: 0}), + (8, {_smithya: 0}), + (8, {_smithya: 0}), + (8, {_smithya: 0}), + (8, {_smithya: 0}), + (8, {_smithya: 0}), + (8, {_smithya: 0}), + (8, {_smithya: 0}), + ), ) -BEDROCK_FOUNDATION_MODEL_CONTEXT_ENRICHMENT_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagent#BedrockFoundationModelContextEnrichmentConfiguration" +INGESTION_JOB_STATUS: StaticSchema = ( + 14, + n0, + _IJSn, + 0, + (_STARTING, _IP, _COMPLETE, _FAILED, _STOPPING, _STOPPED), + ( + (-1, {_sV: _STARTING}), + (-1, {_sV: _IP}), + (-1, {_sV: _COMPLETE}), + (-1, {_sV: _FAILED}), + (-1, {_sV: _STOPPING}), + (-1, {_sV: _STOPPED}), ), - members={ - "enrichmentStrategyConfiguration": { - "target": ENRICHMENT_STRATEGY_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelArn": { - "target": BEDROCK_MODEL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, ) -CONTEXT_ENRICHMENT_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ContextEnrichmentType"), - shape_type=ShapeType.ENUM, - members={"BEDROCK_FOUNDATION_MODEL": {"target": UNIT}}, +INGESTION_JOB: StaticSchema = ( + 18, + n0, + _IJ, + 0, + (_kBI, _dSI, _iJI, _d, _sta, _stat, _fR, _sA, _uA, _tRA), + ( + (ID, 1), + (ID, 1), + (ID, 1), + (DESCRIPTION, 0), + (INGESTION_JOB_STATUS, 1), + (INGESTION_JOB_STATISTICS, 0), + (FAILURE_REASONS, 0), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 0), + ), ) -CONTEXT_ENRICHMENT_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ContextEnrichmentConfiguration"), - members={ - "type": { - "target": CONTEXT_ENRICHMENT_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "bedrockFoundationModelConfiguration": { - "target": BEDROCK_FOUNDATION_MODEL_CONTEXT_ENRICHMENT_CONFIGURATION - }, - }, +GET_INGESTION_JOB_OUTPUT: StaticSchema = ( + 18, + n0, + _GIJO, + {_sSI: _cGIJRo, _smith: None}, + (_iJ,), + ((INGESTION_JOB, 1),), +) + +GET_INGESTION_JOB: StaticOperationSchema = ( + 23, + n0, + _GIJ, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "GET", + "uri": "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/ingestionjobs/{ingestionJobId}", + } + ) + }, + GET_INGESTION_JOB_INPUT, + GET_INGESTION_JOB_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -S3_BUCKET_URI = Schema( - id=ShapeID("com.amazonaws.bedrockagent#S3BucketUri"), shape_type=ShapeType.STRING +INGESTION_JOB_FILTER_ATTRIBUTE: StaticSchema = ( + 14, + n0, + _IJFA, + 0, + (_STATUS,), + ((-1, {_sV: _STATUS}),), +) + +INGESTION_JOB_FILTER_OPERATOR: StaticSchema = ( + 14, + n0, + _IJFO, + 0, + (_EQ,), + ((-1, {_sV: _EQ}),), +) + +INGESTION_JOB_FILTER_VALUE: StaticSchema = (3, n0, _IJFV, 0) + +INGESTION_JOB_FILTER_VALUES: StaticSchema = ( + 16, + n0, + _IJFVn, + 0, + (_me,), + ((INGESTION_JOB_FILTER_VALUE, 0),), +) + +INGESTION_JOB_FILTER: StaticSchema = ( + 18, + n0, + _IJF, + 0, + (_at, _op, _va), + ( + (INGESTION_JOB_FILTER_ATTRIBUTE, 1), + (INGESTION_JOB_FILTER_OPERATOR, 1), + (INGESTION_JOB_FILTER_VALUES, 1), + ), ) -S3_LOCATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#S3Location"), - members={ - "uri": { - "target": S3_BUCKET_URI, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +INGESTION_JOB_FILTERS: StaticSchema = ( + 16, + n0, + _IJFn, + 0, + (_me,), + ((INGESTION_JOB_FILTER, 0),), +) + +INGESTION_JOB_SORT_BY_ATTRIBUTE: StaticSchema = ( + 14, + n0, + _IJSBA, + 0, + (_STATUS, _SA_), + ((-1, {_sV: _STATUS}), (-1, {_sV: _SA_})), +) + +SORT_ORDER: StaticSchema = ( + 14, + n0, + _SO, + 0, + (_ASCENDING, _DESCENDING), + ((-1, {_sV: _ASCENDING}), (-1, {_sV: _DESCENDING})), +) + +INGESTION_JOB_SORT_BY: StaticSchema = ( + 18, + n0, + _IJSB, + 0, + (_at, _or), + ((INGESTION_JOB_SORT_BY_ATTRIBUTE, 1), (SORT_ORDER, 1)), +) + +LIST_INGESTION_JOBS_INPUT: StaticSchema = ( + 18, + n0, + _LIJI, + {_sSI: _cLIJR, _smit: None}, + (_kBI, _dSI, _fi, _sB, _mR, _nT), + ( + (ID, 9), + (ID, 9), + (INGESTION_JOB_FILTERS, 0), + (INGESTION_JOB_SORT_BY, 0), + (MAX_RESULTS, 0), + (NEXT_TOKEN, 0), + ), ) -INTERMEDIATE_STORAGE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#IntermediateStorage"), - members={ - "s3Location": { - "target": S3_LOCATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +INGESTION_JOB_SUMMARY: StaticSchema = ( + 18, + n0, + _IJSng, + 0, + (_kBI, _dSI, _iJI, _d, _sta, _sA, _uA, _tRA, _stat), + ( + (ID, 1), + (ID, 1), + (ID, 1), + (DESCRIPTION, 0), + (INGESTION_JOB_STATUS, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 0), + (INGESTION_JOB_STATISTICS, 0), + ), ) -STEP_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#StepType"), - shape_type=ShapeType.ENUM, - members={"POST_CHUNKING": {"target": UNIT}}, +INGESTION_JOB_SUMMARIES: StaticSchema = ( + 16, + n0, + _IJSnge, + 0, + (_me,), + ((INGESTION_JOB_SUMMARY, 0),), +) + +LIST_INGESTION_JOBS_OUTPUT: StaticSchema = ( + 18, + n0, + _LIJO, + {_sSI: _cLIJRo, _smith: None}, + (_iJS, _nT), + ((INGESTION_JOB_SUMMARIES, 1), (NEXT_TOKEN, 0)), +) + +LIST_INGESTION_JOBS: StaticOperationSchema = ( + 23, + n0, + _LIJ, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "POST", + "uri": "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/ingestionjobs/", + } + ) + }, + LIST_INGESTION_JOBS_INPUT, + LIST_INGESTION_JOBS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -TRANSFORMATION_LAMBDA_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#TransformationLambdaConfiguration"), - members={ - "lambdaArn": { - "target": LAMBDA_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +START_INGESTION_JOB_INPUT: StaticSchema = ( + 18, + n0, + _SIJI, + {_sSI: _cSIJR, _smit: None}, + (_kBI, _dSI, _cT, _d), + ((ID, 9), (ID, 9), (CLIENT_TOKEN, 2), (DESCRIPTION, 0)), +) + +START_INGESTION_JOB_OUTPUT: StaticSchema = ( + 18, + n0, + _SIJO, + {_sSI: _cSIJRo, _smith: None}, + (_iJ,), + ((INGESTION_JOB, 1),), +) + +START_INGESTION_JOB: StaticOperationSchema = ( + 23, + n0, + _SIJ, + { + _smithy: MappingProxyType( + { + "code": 202, + "method": "PUT", + "uri": "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/ingestionjobs/", + } + ) + }, + START_INGESTION_JOB_INPUT, + START_INGESTION_JOB_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -TRANSFORMATION_FUNCTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#TransformationFunction"), - members={ - "transformationLambdaConfiguration": { - "target": TRANSFORMATION_LAMBDA_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +STOP_INGESTION_JOB_INPUT: StaticSchema = ( + 18, + n0, + _SIJIt, + {_sSI: _cSIJRom, _smit: None}, + (_kBI, _dSI, _iJI), + ((ID, 9), (ID, 9), (ID, 9)), +) + +STOP_INGESTION_JOB_OUTPUT: StaticSchema = ( + 18, + n0, + _SIJOt, + {_sSI: _cSIJRoma, _smith: None}, + (_iJ,), + ((INGESTION_JOB, 1),), +) + +STOP_INGESTION_JOB: StaticOperationSchema = ( + 23, + n0, + _SIJt, + { + _smithy: MappingProxyType( + { + "code": 202, + "method": "POST", + "uri": "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/ingestionjobs/{ingestionJobId}/stop", + } + ) + }, + STOP_INGESTION_JOB_INPUT, + STOP_INGESTION_JOB_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -TRANSFORMATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#Transformation"), - members={ - "transformationFunction": { - "target": TRANSFORMATION_FUNCTION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "stepToApply": { - "target": STEP_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +CUSTOM_DOCUMENT_IDENTIFIER: StaticSchema = (18, n0, _CDI, 0, (_id,), ((3, 1),)) + +CONTENT_DATA_SOURCE_TYPE: StaticSchema = ( + 14, + n0, + _CDST, + 0, + (_CUSTOM, _S), + ((-1, {_sV: _CUSTOM}), (-1, {_sV: _S})), +) + +DOCUMENT_IDENTIFIER: StaticSchema = ( + 18, + n0, + _DI, + 0, + (_dST, _s_, _cu), + ((CONTENT_DATA_SOURCE_TYPE, 1), (S3_LOCATION, 0), (CUSTOM_DOCUMENT_IDENTIFIER, 0)), +) + +DOCUMENT_IDENTIFIERS: StaticSchema = ( + 16, + n0, + _DIo, + 0, + (_me,), + ((DOCUMENT_IDENTIFIER, 0),), +) + +DELETE_KNOWLEDGE_BASE_DOCUMENTS_INPUT: StaticSchema = ( + 18, + n0, + _DKBDI, + {_sSI: _cDKBDR, _smit: None}, + (_kBI, _dSI, _cT, _dI), + ((ID, 9), (ID, 9), (CLIENT_TOKEN, 2), (DOCUMENT_IDENTIFIERS, 1)), +) + +DOCUMENT_STATUS: StaticSchema = ( + 14, + n0, + _DSo, + 0, + ( + _INDEXED, + _PI, + _PENDING, + _FAILED, + _MPI, + _MUF, + _IGNORED, + _NF, + _STARTING, + _IP, + _DELETING, + _DIP, + ), + ( + (-1, {_sV: _INDEXED}), + (-1, {_sV: _PI}), + (-1, {_sV: _PENDING}), + (-1, {_sV: _FAILED}), + (-1, {_sV: _MPI}), + (-1, {_sV: _MUF}), + (-1, {_sV: _IGNORED}), + (-1, {_sV: _NF}), + (-1, {_sV: _STARTING}), + (-1, {_sV: _IP}), + (-1, {_sV: _DELETING}), + (-1, {_sV: _DIP}), + ), ) -TRANSFORMATIONS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#Transformations"), - shape_type=ShapeType.LIST, - members={"member": {"target": TRANSFORMATION}}, +KNOWLEDGE_BASE_DOCUMENT_DETAIL: StaticSchema = ( + 18, + n0, + _KBDD, + 0, + (_kBI, _dSI, _sta, _ide, _sR, _uA), + ( + (ID, 1), + (ID, 1), + (DOCUMENT_STATUS, 1), + (DOCUMENT_IDENTIFIER, 1), + (3, 0), + (DATE_TIMESTAMP, 0), + ), ) -CUSTOM_TRANSFORMATION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#CustomTransformationConfiguration"), - members={ - "intermediateStorage": { - "target": INTERMEDIATE_STORAGE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "transformations": { - "target": TRANSFORMATIONS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +KNOWLEDGE_BASE_DOCUMENT_DETAILS: StaticSchema = ( + 16, + n0, + _KBDDn, + 0, + (_me,), + ((KNOWLEDGE_BASE_DOCUMENT_DETAIL, 0),), +) + +DELETE_KNOWLEDGE_BASE_DOCUMENTS_OUTPUT: StaticSchema = ( + 18, + n0, + _DKBDO, + {_sSI: _cDKBDRo, _smith: None}, + (_dD,), + ((KNOWLEDGE_BASE_DOCUMENT_DETAILS, 0),), +) + +DELETE_KNOWLEDGE_BASE_DOCUMENTS: StaticOperationSchema = ( + 23, + n0, + _DKBD, + { + _smithy: MappingProxyType( + { + "code": 202, + "method": "POST", + "uri": "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/documents/deleteDocuments", + } + ) + }, + DELETE_KNOWLEDGE_BASE_DOCUMENTS_INPUT, + DELETE_KNOWLEDGE_BASE_DOCUMENTS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -PARSING_MODALITY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ParsingModality"), - shape_type=ShapeType.ENUM, - members={"MULTIMODAL": {"target": UNIT}}, +GET_KNOWLEDGE_BASE_DOCUMENTS_INPUT: StaticSchema = ( + 18, + n0, + _GKBDI, + {_sSI: _cGKBDR, _smit: None}, + (_kBI, _dSI, _dI), + ((ID, 9), (ID, 9), (DOCUMENT_IDENTIFIERS, 1)), +) + +GET_KNOWLEDGE_BASE_DOCUMENTS_OUTPUT: StaticSchema = ( + 18, + n0, + _GKBDO, + {_sSI: _cGKBDRo, _smith: None}, + (_dD,), + ((KNOWLEDGE_BASE_DOCUMENT_DETAILS, 0),), +) + +GET_KNOWLEDGE_BASE_DOCUMENTS: StaticOperationSchema = ( + 23, + n0, + _GKBD, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "POST", + "uri": "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/documents/getDocuments", + } + ) + }, + GET_KNOWLEDGE_BASE_DOCUMENTS_INPUT, + GET_KNOWLEDGE_BASE_DOCUMENTS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -BEDROCK_DATA_AUTOMATION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#BedrockDataAutomationConfiguration"), - members={"parsingModality": {"target": PARSING_MODALITY}}, -) +BYTE_CONTENT_BLOB: StaticSchema = (1, n0, _BCB, 4) -PARSING_PROMPT_TEXT = Schema( - id=ShapeID("com.amazonaws.bedrockagent#ParsingPromptText"), - shape_type=ShapeType.STRING, +BYTE_CONTENT_DOC: StaticSchema = ( + 18, + n0, + _BCD, + 0, + (_mTi, _dat), + ((3, 1), (BYTE_CONTENT_BLOB, 1)), ) -PARSING_PROMPT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ParsingPrompt"), - members={ - "parsingPromptText": { - "target": PARSING_PROMPT_TEXT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +DATA: StaticSchema = (3, n0, _Da, 4) -BEDROCK_FOUNDATION_MODEL_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#BedrockFoundationModelConfiguration"), - members={ - "modelArn": { - "target": BEDROCK_MODEL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "parsingPrompt": {"target": PARSING_PROMPT}, - "parsingModality": {"target": PARSING_MODALITY}, - }, -) +TEXT_CONTENT_DOC: StaticSchema = (18, n0, _TCD, 0, (_dat,), ((DATA, 1),)) -PARSING_STRATEGY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ParsingStrategy"), - shape_type=ShapeType.ENUM, - members={ - "BEDROCK_FOUNDATION_MODEL": {"target": UNIT}, - "BEDROCK_DATA_AUTOMATION": {"target": UNIT}, - "SMART_PARSING": {"target": UNIT}, - "MULTI_MODAL_EMBEDDINGS": {"target": UNIT}, - }, +INLINE_CONTENT_TYPE: StaticSchema = ( + 14, + n0, + _ICT, + 0, + (_BYTE, _TEXT), + ((-1, {_sV: _BYTE}), (-1, {_sV: _TEXT})), ) -PARSING_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ParsingConfiguration"), - members={ - "parsingStrategy": { - "target": PARSING_STRATEGY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "bedrockFoundationModelConfiguration": { - "target": BEDROCK_FOUNDATION_MODEL_CONFIGURATION - }, - "bedrockDataAutomationConfiguration": { - "target": BEDROCK_DATA_AUTOMATION_CONFIGURATION - }, - }, +INLINE_CONTENT: StaticSchema = ( + 18, + n0, + _ICnl, + 0, + (_t, _bC, _tCex), + ((INLINE_CONTENT_TYPE, 1), (BYTE_CONTENT_DOC, 0), (TEXT_CONTENT_DOC, 0)), ) -VECTOR_INGESTION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#VectorIngestionConfiguration"), - members={ - "chunkingConfiguration": {"target": CHUNKING_CONFIGURATION}, - "customTransformationConfiguration": { - "target": CUSTOM_TRANSFORMATION_CONFIGURATION - }, - "parsingConfiguration": {"target": PARSING_CONFIGURATION}, - "contextEnrichmentConfiguration": {"target": CONTEXT_ENRICHMENT_CONFIGURATION}, - }, -) +S3_OBJECT_URI: StaticSchema = (3, n0, _SOU, 0) -CREATE_DATA_SOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#CreateDataSourceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#CreateDataSourceRequest", - ) - ], - members={ - "knowledgeBaseId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "name": { - "target": NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "dataSourceConfiguration": { - "target": DATA_SOURCE_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "dataDeletionPolicy": {"target": DATA_DELETION_POLICY}, - "serverSideEncryptionConfiguration": { - "target": SERVER_SIDE_ENCRYPTION_CONFIGURATION - }, - "vectorIngestionConfiguration": {"target": VECTOR_INGESTION_CONFIGURATION}, - }, +CUSTOM_S3_LOCATION: StaticSchema = ( + 18, + n0, + _CSL, + 0, + (_ur, _bOAI), + ((S3_OBJECT_URI, 1), (BUCKET_OWNER_ACCOUNT_ID, 0)), ) -DATA_SOURCE_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#DataSourceStatus"), - shape_type=ShapeType.ENUM, - members={ - "AVAILABLE": {"target": UNIT}, - "DELETING": {"target": UNIT}, - "DELETE_UNSUCCESSFUL": {"target": UNIT}, - "CREATING": {"target": UNIT}, - "UPDATING": {"target": UNIT}, - "FAILED": {"target": UNIT}, - }, +CUSTOM_SOURCE_TYPE: StaticSchema = ( + 14, + n0, + _CST, + 0, + (_IL, _SL_), + ((-1, {_sV: _IL}), (-1, {_sV: _SL_})), ) -DATA_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#DataSource"), - members={ - "knowledgeBaseId": { - "target": ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "dataSourceId": { - "target": ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": DATA_SOURCE_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "dataSourceConfiguration": { - "target": DATA_SOURCE_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "serverSideEncryptionConfiguration": { - "target": SERVER_SIDE_ENCRYPTION_CONFIGURATION - }, - "vectorIngestionConfiguration": {"target": VECTOR_INGESTION_CONFIGURATION}, - "dataDeletionPolicy": {"target": DATA_DELETION_POLICY}, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "failureReasons": {"target": FAILURE_REASONS}, - }, +CUSTOM_CONTENT: StaticSchema = ( + 18, + n0, + _CCu, + 0, + (_cDI, _sTo, _sLo, _iCnl), + ( + (CUSTOM_DOCUMENT_IDENTIFIER, 1), + (CUSTOM_SOURCE_TYPE, 1), + (CUSTOM_S3_LOCATION, 0), + (INLINE_CONTENT, 0), + ), ) -CREATE_DATA_SOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#CreateDataSourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#CreateDataSourceResponse", - ) - ], - members={ - "dataSource": { - "target": DATA_SOURCE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +S3_CONTENT: StaticSchema = (18, n0, _SC, 0, (_sLo,), ((S3_LOCATION, 1),)) -CREATE_DATA_SOURCE = Schema( - id=ShapeID("com.amazonaws.bedrockagent#CreateDataSource"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "PUT", - "uri": "/knowledgebases/{knowledgeBaseId}/datasources/", - } - ), - ) - ], +DOCUMENT_CONTENT: StaticSchema = ( + 18, + n0, + _DCo, + 0, + (_dST, _cu, _s_), + ((CONTENT_DATA_SOURCE_TYPE, 1), (CUSTOM_CONTENT, 0), (S3_CONTENT, 0)), ) -DELETE_DATA_SOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#DeleteDataSourceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#DeleteDataSourceRequest", - ) - ], - members={ - "knowledgeBaseId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "dataSourceId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, +DOCUMENT_ACCESS_CONTROL_ENTRY: StaticSchema = ( + 18, + n0, + _DACE, + 4, + (_na, _t, _ac), + ((3, 1), (ACCESS_CONTROL_PRINCIPAL_TYPE, 1), (ACCESS_CONTROL_ACCESS, 1)), ) -DELETE_DATA_SOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#DeleteDataSourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#DeleteDataSourceResponse", - ) - ], - members={ - "knowledgeBaseId": { - "target": ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "dataSourceId": { - "target": ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": DATA_SOURCE_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +DOCUMENT_ACCESS_CONTROL_LIST: StaticSchema = ( + 16, + n0, + _DACL, + 0, + (_me,), + ((DOCUMENT_ACCESS_CONTROL_ENTRY, 0),), ) -DELETE_DATA_SOURCE = Schema( - id=ShapeID("com.amazonaws.bedrockagent#DeleteDataSource"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 202, - "method": "DELETE", - "uri": "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}", - } - ), - ) - ], -) +KEY: StaticSchema = (3, n0, _K, 4) -GET_DATA_SOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#GetDataSourceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#GetDataSourceRequest", - ) - ], - members={ - "knowledgeBaseId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "dataSourceId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) +NUMBER_VALUE: StaticSchema = (10, n0, _NVu, 4) -GET_DATA_SOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#GetDataSourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#GetDataSourceResponse", - ) - ], - members={ - "dataSource": { - "target": DATA_SOURCE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +STRING_VALUE: StaticSchema = (3, n0, _SV, 4) -GET_DATA_SOURCE = Schema( - id=ShapeID("com.amazonaws.bedrockagent#GetDataSource"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}", - } - ), - ) - ], -) +STRING_LIST_VALUE: StaticSchema = (16, n0, _SLV, 0, (_me,), ((STRING_VALUE, 0),)) -LIST_DATA_SOURCES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ListDataSourcesInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#ListDataSourcesRequest", - ) - ], - members={ - "knowledgeBaseId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "maxResults": {"target": MAX_RESULTS}, - "nextToken": {"target": NEXT_TOKEN}, - }, +METADATA_VALUE_TYPE: StaticSchema = ( + 14, + n0, + _MVT, + 0, + (_BOOLEAN, _NUMBER, _STRING, _SL__), + ( + (-1, {_sV: _BOOLEAN}), + (-1, {_sV: _NUMBER}), + (-1, {_sV: _STRING}), + (-1, {_sV: _SL__}), + ), ) -DATA_SOURCE_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#DataSourceSummary"), - members={ - "knowledgeBaseId": { - "target": ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "dataSourceId": { - "target": ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": DATA_SOURCE_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +METADATA_ATTRIBUTE_VALUE: StaticSchema = ( + 18, + n0, + _MAV, + 0, + (_t, _nV, _bV, _sVt, _sLV), + ( + (METADATA_VALUE_TYPE, 1), + (NUMBER_VALUE, 0), + (2, 0), + (STRING_VALUE, 0), + (STRING_LIST_VALUE, 0), + ), ) -DATA_SOURCE_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#DataSourceSummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": DATA_SOURCE_SUMMARY}}, +METADATA_ATTRIBUTE: StaticSchema = ( + 18, + n0, + _MA, + 0, + (_k, _v), + ((KEY, 1), (METADATA_ATTRIBUTE_VALUE, 1)), +) + +METADATA_ATTRIBUTES: StaticSchema = ( + 16, + n0, + _MAe, + 0, + (_me,), + ((METADATA_ATTRIBUTE, 0),), +) + +METADATA_SOURCE_TYPE: StaticSchema = ( + 14, + n0, + _MST, + 0, + (_ILA, _SL_), + ((-1, {_sV: _ILA}), (-1, {_sV: _SL_})), +) + +DOCUMENT_METADATA: StaticSchema = ( + 18, + n0, + _DM, + 0, + (_t, _iA, _sLo, _aCL), + ( + (METADATA_SOURCE_TYPE, 1), + (METADATA_ATTRIBUTES, 0), + (CUSTOM_S3_LOCATION, 0), + (DOCUMENT_ACCESS_CONTROL_LIST, 0), + ), ) -LIST_DATA_SOURCES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ListDataSourcesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#ListDataSourcesResponse", - ) - ], - members={ - "dataSourceSummaries": { - "target": DATA_SOURCE_SUMMARIES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": NEXT_TOKEN}, - }, +KNOWLEDGE_BASE_DOCUMENT: StaticSchema = ( + 18, + n0, + _KBD, + 0, + (_meta, _cont), + ((DOCUMENT_METADATA, 0), (DOCUMENT_CONTENT, 1)), +) + +KNOWLEDGE_BASE_DOCUMENTS: StaticSchema = ( + 16, + n0, + _KBDn, + 0, + (_me,), + ((KNOWLEDGE_BASE_DOCUMENT, 0),), +) + +INGEST_KNOWLEDGE_BASE_DOCUMENTS_INPUT: StaticSchema = ( + 18, + n0, + _IKBDI, + {_sSI: _cIKBDR, _smit: None}, + (_kBI, _dSI, _cT, _doc), + ((ID, 9), (ID, 9), (CLIENT_TOKEN, 2), (KNOWLEDGE_BASE_DOCUMENTS, 1)), +) + +INGEST_KNOWLEDGE_BASE_DOCUMENTS_OUTPUT: StaticSchema = ( + 18, + n0, + _IKBDO, + {_sSI: _cIKBDRo, _smith: None}, + (_dD,), + ((KNOWLEDGE_BASE_DOCUMENT_DETAILS, 0),), +) + +INGEST_KNOWLEDGE_BASE_DOCUMENTS: StaticOperationSchema = ( + 23, + n0, + _IKBD, + { + _smithy: MappingProxyType( + { + "code": 202, + "method": "PUT", + "uri": "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/documents", + } + ) + }, + INGEST_KNOWLEDGE_BASE_DOCUMENTS_INPUT, + INGEST_KNOWLEDGE_BASE_DOCUMENTS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -LIST_DATA_SOURCES = Schema( - id=ShapeID("com.amazonaws.bedrockagent#ListDataSources"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "POST", - "uri": "/knowledgebases/{knowledgeBaseId}/datasources/", - } - ), - ) - ], +LIST_KNOWLEDGE_BASE_DOCUMENTS_INPUT: StaticSchema = ( + 18, + n0, + _LKBDI, + {_sSI: _cLKBDR, _smit: None}, + (_kBI, _dSI, _mR, _nT), + ((ID, 9), (ID, 9), (MAX_RESULTS, 0), (NEXT_TOKEN, 0)), +) + +LIST_KNOWLEDGE_BASE_DOCUMENTS_OUTPUT: StaticSchema = ( + 18, + n0, + _LKBDO, + {_sSI: _cLKBDRo, _smith: None}, + (_dD, _nT), + ((KNOWLEDGE_BASE_DOCUMENT_DETAILS, 1), (3, 0)), +) + +LIST_KNOWLEDGE_BASE_DOCUMENTS: StaticOperationSchema = ( + 23, + n0, + _LKBD, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "POST", + "uri": "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/documents", + } + ) + }, + LIST_KNOWLEDGE_BASE_DOCUMENTS_INPUT, + LIST_KNOWLEDGE_BASE_DOCUMENTS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -UPDATE_DATA_SOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#UpdateDataSourceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#UpdateDataSourceRequest", - ) - ], - members={ - "knowledgeBaseId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "dataSourceId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "name": { - "target": NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "dataSourceConfiguration": { - "target": DATA_SOURCE_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "dataDeletionPolicy": {"target": DATA_DELETION_POLICY}, - "serverSideEncryptionConfiguration": { - "target": SERVER_SIDE_ENCRYPTION_CONFIGURATION - }, - "vectorIngestionConfiguration": {"target": VECTOR_INGESTION_CONFIGURATION}, - }, +ASSOCIATE_AGENT_KNOWLEDGE_BASE_INPUT: StaticSchema = ( + 18, + n0, + _AAKBI, + {_sSI: _cAAKBR, _smit: None}, + (_aI, _aV, _kBI, _d, _kBS), + ((ID, 9), (DRAFT_VERSION, 9), (ID, 1), (DESCRIPTION, 1), (KNOWLEDGE_BASE_STATE, 0)), +) + +ASSOCIATE_AGENT_KNOWLEDGE_BASE_OUTPUT: StaticSchema = ( + 18, + n0, + _AAKBO, + {_sSI: _cAAKBRo, _smith: None}, + (_aKB,), + ((AGENT_KNOWLEDGE_BASE, 1),), +) + +ASSOCIATE_AGENT_KNOWLEDGE_BASE: StaticOperationSchema = ( + 23, + n0, + _AAKB, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "PUT", + "uri": "/agents/{agentId}/agentversions/{agentVersion}/knowledgebases/", + } + ) + }, + ASSOCIATE_AGENT_KNOWLEDGE_BASE_INPUT, + ASSOCIATE_AGENT_KNOWLEDGE_BASE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -UPDATE_DATA_SOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#UpdateDataSourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#UpdateDataSourceResponse", - ) - ], - members={ - "dataSource": { - "target": DATA_SOURCE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +KENDRA_INDEX_ARN: StaticSchema = (3, n0, _KIA, 0) -UPDATE_DATA_SOURCE = Schema( - id=ShapeID("com.amazonaws.bedrockagent#UpdateDataSource"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "PUT", - "uri": "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}", - } - ), - ) - ], +KENDRA_KNOWLEDGE_BASE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _KKBC, + 0, + (_kIA,), + ((KENDRA_INDEX_ARN, 1),), ) -REVISION_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagent#RevisionId"), shape_type=ShapeType.STRING -) +BEDROCK_EMBEDDING_MODEL_ARN: StaticSchema = (3, n0, _BEMA, 0) -RESOURCE_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagent#ResourceArn"), shape_type=ShapeType.STRING -) +AUDIO_SEGMENTATION_CONFIGURATION: StaticSchema = (18, n0, _ASC, 0, (_fLD,), ((7, 1),)) -DELETE_RESOURCE_POLICY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#DeleteResourcePolicyInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#DeleteResourcePolicyRequest", - ) - ], - members={ - "resourceArn": { - "target": RESOURCE_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "expectedRevisionId": { - "target": REVISION_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpQuery"), value="expectedRevisionId" - ) - ], - }, - }, +AUDIO_CONFIGURATION: StaticSchema = ( + 18, + n0, + _ACu, + 0, + (_sCeg,), + ((AUDIO_SEGMENTATION_CONFIGURATION, 1),), ) -DELETE_RESOURCE_POLICY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#DeleteResourcePolicyOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#DeleteResourcePolicyResponse", - ) - ], - members={ - "resourceArn": { - "target": RESOURCE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "revisionId": {"target": REVISION_ID}, - }, +AUDIO_CONFIGURATIONS: StaticSchema = ( + 16, + n0, + _ACud, + 0, + (_me,), + ((AUDIO_CONFIGURATION, 0),), ) -DELETE_RESOURCE_POLICY = Schema( - id=ShapeID("com.amazonaws.bedrockagent#DeleteResourcePolicy"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "DELETE", - "uri": "/resourcepolicy/{resourceArn}", - } - ), - ) - ], -) +DIMENSIONS: StaticSchema = (7, n0, _Di, 0) -DELETE_VPC_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#DeleteVpcConfigurationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#DeleteVpcConfigurationRequest", - ) - ], - members={ - "knowledgeBaseId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "vpcConfigurationId": { - "target": VPC_CONFIGURATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, +EMBEDDING_DATA_TYPE: StaticSchema = ( + 14, + n0, + _EDT, + 0, + (_FLOAT, _BINARY), + ((-1, {_sV: _FLOAT}), (-1, {_sV: _BINARY})), ) -DELETE_VPC_CONFIGURATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#DeleteVpcConfigurationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#DeleteVpcConfigurationResponse", - ) - ], - members={ - "vpcConfigurationId": { - "target": VPC_CONFIGURATION_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": VPC_CONFIGURATION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +VIDEO_SEGMENTATION_CONFIGURATION: StaticSchema = (18, n0, _VSC, 0, (_fLD,), ((7, 1),)) -DELETE_VPC_CONFIGURATION = Schema( - id=ShapeID("com.amazonaws.bedrockagent#DeleteVpcConfiguration"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 202, - "method": "DELETE", - "uri": "/knowledgebases/{knowledgeBaseId}/vpcconfigurations/{vpcConfigurationId}", - } - ), - ) - ], +VIDEO_CONFIGURATION: StaticSchema = ( + 18, + n0, + _VCi, + 0, + (_sCeg,), + ((VIDEO_SEGMENTATION_CONFIGURATION, 1),), ) -FLOW_CONDITION_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagent#FlowConditionName"), - shape_type=ShapeType.STRING, +VIDEO_CONFIGURATIONS: StaticSchema = ( + 16, + n0, + _VCid, + 0, + (_me,), + ((VIDEO_CONFIGURATION, 0),), ) -FLOW_CONDITIONAL_CONNECTION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#FlowConditionalConnectionConfiguration"), - members={ - "condition": { - "target": FLOW_CONDITION_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +BEDROCK_EMBEDDING_MODEL_CONFIGURATION: StaticSchema = ( + 18, + n0, + _BEMC, + 0, + (_di, _eDT, _aud, _vi, _mCo), + ( + (DIMENSIONS, 0), + (EMBEDDING_DATA_TYPE, 0), + (AUDIO_CONFIGURATIONS, 0), + (VIDEO_CONFIGURATIONS, 0), + (13, 0), + ), ) -FLOW_NODE_OUTPUT_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagent#FlowNodeOutputName"), - shape_type=ShapeType.STRING, +EMBEDDING_MODEL_CONFIGURATION: StaticSchema = ( + 18, + n0, + _EMC, + 0, + (_bEMC,), + ((BEDROCK_EMBEDDING_MODEL_CONFIGURATION, 0),), +) + +EMBEDDING_MODEL_TYPE: StaticSchema = ( + 14, + n0, + _EMTm, + 0, + (_CUSTOM, _MANAGED), + ((-1, {_sV: _CUSTOM}), (-1, {_sV: _MANAGED})), +) + +SUPPLEMENTAL_DATA_STORAGE_LOCATION_TYPE: StaticSchema = ( + 14, + n0, + _SDSLT, + 0, + (_S,), + ((-1, {_sV: _S}),), +) + +SUPPLEMENTAL_DATA_STORAGE_LOCATION: StaticSchema = ( + 18, + n0, + _SDSL, + 0, + (_t, _sLo), + ((SUPPLEMENTAL_DATA_STORAGE_LOCATION_TYPE, 1), (S3_LOCATION, 0)), +) + +SUPPLEMENTAL_DATA_STORAGE_LOCATIONS: StaticSchema = ( + 16, + n0, + _SDSLu, + 0, + (_me,), + ((SUPPLEMENTAL_DATA_STORAGE_LOCATION, 0),), +) + +SUPPLEMENTAL_DATA_STORAGE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _SDSCu, + 0, + (_sLt,), + ((SUPPLEMENTAL_DATA_STORAGE_LOCATIONS, 1),), +) + +MANAGED_KNOWLEDGE_BASE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _MKBCa, + 0, + (_eMTm, _eMA, _eMC, _sSEC, _sDSC), + ( + (EMBEDDING_MODEL_TYPE, 0), + (BEDROCK_EMBEDDING_MODEL_ARN, 0), + (EMBEDDING_MODEL_CONFIGURATION, 0), + (SERVER_SIDE_ENCRYPTION_CONFIGURATION, 0), + (SUPPLEMENTAL_DATA_STORAGE_CONFIGURATION, 0), + ), ) -FLOW_NODE_INPUT_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagent#FlowNodeInputName"), - shape_type=ShapeType.STRING, +REDSHIFT_PROVISIONED_AUTH_TYPE: StaticSchema = ( + 14, + n0, + _RPAT, + 0, + (_IAM, _UP, _USERNAME), + ((-1, {_sV: _IAM}), (-1, {_sV: _UP}), (-1, {_sV: _USERNAME})), +) + +REDSHIFT_PROVISIONED_AUTH_CONFIGURATION: StaticSchema = ( + 18, + n0, + _RPAC, + 0, + (_t, _dU, _uPSA), + ((REDSHIFT_PROVISIONED_AUTH_TYPE, 1), (3, 0), (SECRET_ARN, 0)), +) + +REDSHIFT_CLUSTER_IDENTIFIER: StaticSchema = (3, n0, _RCI, 0) + +REDSHIFT_PROVISIONED_CONFIGURATION: StaticSchema = ( + 18, + n0, + _RPC, + 0, + (_cIl, _aCu), + ((REDSHIFT_CLUSTER_IDENTIFIER, 1), (REDSHIFT_PROVISIONED_AUTH_CONFIGURATION, 1)), +) + +REDSHIFT_SERVERLESS_AUTH_TYPE: StaticSchema = ( + 14, + n0, + _RSAT, + 0, + (_IAM, _UP), + ((-1, {_sV: _IAM}), (-1, {_sV: _UP})), +) + +REDSHIFT_SERVERLESS_AUTH_CONFIGURATION: StaticSchema = ( + 18, + n0, + _RSAC, + 0, + (_t, _uPSA), + ((REDSHIFT_SERVERLESS_AUTH_TYPE, 1), (SECRET_ARN, 0)), +) + +WORKGROUP_ARN: StaticSchema = (3, n0, _WA, 0) + +REDSHIFT_SERVERLESS_CONFIGURATION: StaticSchema = ( + 18, + n0, + _RSC, + 0, + (_wA, _aCu), + ((WORKGROUP_ARN, 1), (REDSHIFT_SERVERLESS_AUTH_CONFIGURATION, 1)), +) + +REDSHIFT_QUERY_ENGINE_TYPE: StaticSchema = ( + 14, + n0, + _RQET, + 0, + (_SERVERLESS, _PROVISIONED), + ((-1, {_sV: _SERVERLESS}), (-1, {_sV: _PROVISIONED})), +) + +REDSHIFT_QUERY_ENGINE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _RQEC, + 0, + (_t, _sCer, _pCr), + ( + (REDSHIFT_QUERY_ENGINE_TYPE, 1), + (REDSHIFT_SERVERLESS_CONFIGURATION, 0), + (REDSHIFT_PROVISIONED_CONFIGURATION, 0), + ), ) -FLOW_DATA_CONNECTION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#FlowDataConnectionConfiguration"), - members={ - "sourceOutput": { - "target": FLOW_NODE_OUTPUT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "targetInput": { - "target": FLOW_NODE_INPUT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +QUERY_EXECUTION_TIMEOUT_SECONDS: StaticSchema = (7, n0, _QETS, 0) -FLOW_CONNECTION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#FlowConnectionConfiguration"), - shape_type=ShapeType.UNION, - members={ - "data": {"target": FLOW_DATA_CONNECTION_CONFIGURATION}, - "conditional": {"target": FLOW_CONDITIONAL_CONNECTION_CONFIGURATION}, - }, -) +NATURAL_LANGUAGE_STRING: StaticSchema = (3, n0, _NLS, 0) -FLOW_CONNECTION_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagent#FlowConnectionName"), - shape_type=ShapeType.STRING, -) - -FLOW_NODE_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagent#FlowNodeName"), shape_type=ShapeType.STRING -) - -FLOW_CONNECTION_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#FlowConnectionType"), - shape_type=ShapeType.ENUM, - members={"DATA": {"target": UNIT}, "CONDITIONAL": {"target": UNIT}}, -) - -FLOW_CONNECTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#FlowConnection"), - members={ - "type": { - "target": FLOW_CONNECTION_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": FLOW_CONNECTION_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "source": { - "target": FLOW_NODE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "target": { - "target": FLOW_NODE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "configuration": {"target": FLOW_CONNECTION_CONFIGURATION}, - }, -) - -FLOW_CONNECTIONS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#FlowConnections"), - shape_type=ShapeType.LIST, - members={"member": {"target": FLOW_CONNECTION}}, -) - -COLLECTOR_FLOW_NODE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#CollectorFlowNodeConfiguration") -) - -FLOW_CONDITION_EXPRESSION = Schema( - id=ShapeID("com.amazonaws.bedrockagent#FlowConditionExpression"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -FLOW_CONDITION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#FlowCondition"), - members={ - "name": { - "target": FLOW_CONDITION_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "expression": {"target": FLOW_CONDITION_EXPRESSION}, - }, -) - -FLOW_CONDITIONS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#FlowConditions"), - shape_type=ShapeType.LIST, - members={"member": {"target": FLOW_CONDITION}}, -) - -CONDITION_FLOW_NODE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ConditionFlowNodeConfiguration"), - members={ - "conditions": { - "target": FLOW_CONDITIONS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -INLINE_CODE = Schema( - id=ShapeID("com.amazonaws.bedrockagent#InlineCode"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -SUPPORTED_LANGUAGES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#SupportedLanguages"), - shape_type=ShapeType.ENUM, - members={"PYTHON_3": {"target": UNIT}}, -) - -INLINE_CODE_FLOW_NODE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#InlineCodeFlowNodeConfiguration"), - members={ - "code": { - "target": INLINE_CODE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=""), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "language": { - "target": SUPPORTED_LANGUAGES, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value="Python_3"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - }, -) - -INPUT_FLOW_NODE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#InputFlowNodeConfiguration") -) - -ITERATOR_FLOW_NODE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#IteratorFlowNodeConfiguration") -) - -PROMPT_MODEL_INFERENCE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#PromptModelInferenceConfiguration"), - members={ - "temperature": {"target": TEMPERATURE}, - "topP": {"target": TOP_P}, - "maxTokens": {"target": MAXIMUM_LENGTH}, - "stopSequences": {"target": STOP_SEQUENCES}, - }, -) - -PROMPT_INFERENCE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#PromptInferenceConfiguration"), - shape_type=ShapeType.UNION, - members={"text": {"target": PROMPT_MODEL_INFERENCE_CONFIGURATION}}, -) - -FLOW_KNOWLEDGE_BASE_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagent#FlowKnowledgeBaseId"), - shape_type=ShapeType.STRING, -) - -KNOWLEDGE_BASE_MODEL_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrockagent#KnowledgeBaseModelIdentifier"), - shape_type=ShapeType.STRING, -) +SQL_STRING: StaticSchema = (3, n0, _SSq, 0) -PERFORMANCE_CONFIG_LATENCY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#PerformanceConfigLatency"), - shape_type=ShapeType.ENUM, - members={"STANDARD": {"target": UNIT}, "OPTIMIZED": {"target": UNIT}}, +CURATED_QUERY: StaticSchema = ( + 18, + n0, + _CQ, + 0, + (_nL, _sq), + ((NATURAL_LANGUAGE_STRING, 1), (SQL_STRING, 1)), ) -PERFORMANCE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#PerformanceConfiguration"), - members={ - "latency": { - "target": PERFORMANCE_CONFIG_LATENCY, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="standard")], - } - }, -) +CURATED_QUERIES: StaticSchema = (16, n0, _CQu, 0, (_me,), ((CURATED_QUERY, 0),)) -KNOWLEDGE_BASE_TEXT_PROMPT = Schema( - id=ShapeID("com.amazonaws.bedrockagent#KnowledgeBaseTextPrompt"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) +DESCRIPTION_STRING: StaticSchema = (3, n0, _DSe, 0) -KNOWLEDGE_BASE_PROMPT_TEMPLATE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#KnowledgeBasePromptTemplate"), - members={"textPromptTemplate": {"target": KNOWLEDGE_BASE_TEXT_PROMPT}}, +INCLUDE_EXCLUDE: StaticSchema = ( + 14, + n0, + _IE, + 0, + (_INCLUDE, _EXCLUDE), + ((-1, {_sV: _INCLUDE}), (-1, {_sV: _EXCLUDE})), ) -KNOWLEDGE_BASE_ORCHESTRATION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#KnowledgeBaseOrchestrationConfiguration"), - members={ - "promptTemplate": {"target": KNOWLEDGE_BASE_PROMPT_TEMPLATE}, - "inferenceConfig": {"target": PROMPT_INFERENCE_CONFIGURATION}, - "additionalModelRequestFields": {"target": ADDITIONAL_MODEL_REQUEST_FIELDS}, - "performanceConfig": {"target": PERFORMANCE_CONFIGURATION}, - }, -) +QUERY_GENERATION_COLUMN_NAME: StaticSchema = (3, n0, _QGCN, 0) -RERANKING_METADATA_SELECTION_MODE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#RerankingMetadataSelectionMode"), - shape_type=ShapeType.ENUM, - members={"SELECTIVE": {"target": UNIT}, "ALL": {"target": UNIT}}, +QUERY_GENERATION_COLUMN: StaticSchema = ( + 18, + n0, + _QGC, + 0, + (_na, _d, _inc), + ((QUERY_GENERATION_COLUMN_NAME, 0), (DESCRIPTION_STRING, 0), (INCLUDE_EXCLUDE, 0)), ) -FIELD_FOR_RERANKING = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#FieldForReranking"), - members={ - "fieldName": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +QUERY_GENERATION_COLUMNS: StaticSchema = ( + 16, + n0, + _QGCu, + 0, + (_me,), + ((QUERY_GENERATION_COLUMN, 0),), ) -FIELDS_FOR_RERANKING = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#FieldsForReranking"), - shape_type=ShapeType.LIST, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"member": {"target": FIELD_FOR_RERANKING}}, -) +QUERY_GENERATION_TABLE_NAME: StaticSchema = (3, n0, _QGTN, 0) -RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagent#RerankingMetadataSelectiveModeConfiguration" +QUERY_GENERATION_TABLE: StaticSchema = ( + 18, + n0, + _QGT, + 0, + (_na, _d, _inc, _col), + ( + (QUERY_GENERATION_TABLE_NAME, 1), + (DESCRIPTION_STRING, 0), + (INCLUDE_EXCLUDE, 0), + (QUERY_GENERATION_COLUMNS, 0), ), - shape_type=ShapeType.UNION, - members={ - "fieldsToInclude": {"target": FIELDS_FOR_RERANKING}, - "fieldsToExclude": {"target": FIELDS_FOR_RERANKING}, - }, ) -METADATA_CONFIGURATION_FOR_RERANKING = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#MetadataConfigurationForReranking"), - members={ - "selectionMode": { - "target": RERANKING_METADATA_SELECTION_MODE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "selectiveModeConfiguration": { - "target": RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION - }, - }, -) - -BEDROCK_RERANKING_MODEL_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagent#BedrockRerankingModelArn"), - shape_type=ShapeType.STRING, -) - -VECTOR_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagent#VectorSearchBedrockRerankingModelConfiguration" +QUERY_GENERATION_TABLES: StaticSchema = ( + 16, + n0, + _QGTu, + 0, + (_me,), + ((QUERY_GENERATION_TABLE, 0),), +) + +QUERY_GENERATION_CONTEXT: StaticSchema = ( + 18, + n0, + _QGCue, + 4, + (_tab, _cQ), + ((QUERY_GENERATION_TABLES, 0), (CURATED_QUERIES, 0)), +) + +QUERY_GENERATION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _QGCuer, + 0, + (_eTS, _gCe), + ((QUERY_EXECUTION_TIMEOUT_SECONDS, 0), (QUERY_GENERATION_CONTEXT, 0)), +) + +AWS_DATA_CATALOG_TABLE_NAME: StaticSchema = (3, n0, _ADCTN, 0) + +AWS_DATA_CATALOG_TABLE_NAMES: StaticSchema = ( + 16, + n0, + _ADCTNw, + 0, + (_me,), + ((AWS_DATA_CATALOG_TABLE_NAME, 0),), +) + +REDSHIFT_QUERY_ENGINE_AWS_DATA_CATALOG_STORAGE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _RQEADCSC, + 0, + (_tN,), + ((AWS_DATA_CATALOG_TABLE_NAMES, 1),), +) + +REDSHIFT_DATABASE: StaticSchema = (3, n0, _RD, 0) + +REDSHIFT_QUERY_ENGINE_REDSHIFT_STORAGE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _RQERSC, + 0, + (_dNa,), + ((REDSHIFT_DATABASE, 1),), +) + +REDSHIFT_QUERY_ENGINE_STORAGE_TYPE: StaticSchema = ( + 14, + n0, + _RQEST, + 0, + (_REDSHIFT, _ADC), + ((-1, {_sV: _REDSHIFT}), (-1, {_sV: _ADC})), +) + +REDSHIFT_QUERY_ENGINE_STORAGE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _RQESC, + 0, + (_t, _aDCC, _rCed), + ( + (REDSHIFT_QUERY_ENGINE_STORAGE_TYPE, 1), + (REDSHIFT_QUERY_ENGINE_AWS_DATA_CATALOG_STORAGE_CONFIGURATION, 0), + (REDSHIFT_QUERY_ENGINE_REDSHIFT_STORAGE_CONFIGURATION, 0), ), - members={ - "modelArn": { - "target": BEDROCK_RERANKING_MODEL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "additionalModelRequestFields": {"target": ADDITIONAL_MODEL_REQUEST_FIELDS}, - }, -) - -VECTOR_SEARCH_BEDROCK_RERANKING_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#VectorSearchBedrockRerankingConfiguration"), - members={ - "modelConfiguration": { - "target": VECTOR_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "numberOfRerankedResults": {"target": INTEGER}, - "metadataConfiguration": {"target": METADATA_CONFIGURATION_FOR_RERANKING}, - }, -) - -VECTOR_SEARCH_RERANKING_CONFIGURATION_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#VectorSearchRerankingConfigurationType"), - shape_type=ShapeType.ENUM, - members={"BEDROCK_RERANKING_MODEL": {"target": UNIT}}, -) - -VECTOR_SEARCH_RERANKING_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#VectorSearchRerankingConfiguration"), - members={ - "type": { - "target": VECTOR_SEARCH_RERANKING_CONFIGURATION_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "bedrockRerankingConfiguration": { - "target": VECTOR_SEARCH_BEDROCK_RERANKING_CONFIGURATION - }, - }, -) - -KNOWLEDGE_BASE_FLOW_NODE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#KnowledgeBaseFlowNodeConfiguration"), - members={ - "knowledgeBaseId": { - "target": FLOW_KNOWLEDGE_BASE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=""), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "modelId": {"target": KNOWLEDGE_BASE_MODEL_IDENTIFIER}, - "guardrailConfiguration": {"target": GUARDRAIL_CONFIGURATION}, - "numberOfResults": {"target": INTEGER}, - "promptTemplate": {"target": KNOWLEDGE_BASE_PROMPT_TEMPLATE}, - "inferenceConfiguration": {"target": PROMPT_INFERENCE_CONFIGURATION}, - "rerankingConfiguration": {"target": VECTOR_SEARCH_RERANKING_CONFIGURATION}, - "orchestrationConfiguration": { - "target": KNOWLEDGE_BASE_ORCHESTRATION_CONFIGURATION - }, - }, ) -FLOW_LAMBDA_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagent#FlowLambdaArn"), shape_type=ShapeType.STRING +REDSHIFT_QUERY_ENGINE_STORAGE_CONFIGURATIONS: StaticSchema = ( + 16, + n0, + _RQESCe, + 0, + (_me,), + ((REDSHIFT_QUERY_ENGINE_STORAGE_CONFIGURATION, 0),), +) + +REDSHIFT_CONFIGURATION: StaticSchema = ( + 18, + n0, + _RCed, + 0, + (_sCt, _qEC, _qGC), + ( + (REDSHIFT_QUERY_ENGINE_STORAGE_CONFIGURATIONS, 1), + (REDSHIFT_QUERY_ENGINE_CONFIGURATION, 1), + (QUERY_GENERATION_CONFIGURATION, 0), + ), ) -LAMBDA_FUNCTION_FLOW_NODE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#LambdaFunctionFlowNodeConfiguration"), - members={ - "lambdaArn": { - "target": FLOW_LAMBDA_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=""), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, +QUERY_ENGINE_TYPE: StaticSchema = ( + 14, + n0, + _QET, + 0, + (_REDSHIFT,), + ((-1, {_sV: _REDSHIFT}),), +) + +SQL_KNOWLEDGE_BASE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _SKBC, + 0, + (_t, _rCed), + ((QUERY_ENGINE_TYPE, 1), (REDSHIFT_CONFIGURATION, 0)), +) + +KNOWLEDGE_BASE_TYPE: StaticSchema = ( + 14, + n0, + _KBT, + 0, + (_VECTOR, _KENDRA, _SQL, _MANAGED), + ( + (-1, {_sV: _VECTOR}), + (-1, {_sV: _KENDRA}), + (-1, {_sV: _SQL}), + (-1, {_sV: _MANAGED}), + ), ) -FLOW_LEX_BOT_ALIAS_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagent#FlowLexBotAliasArn"), - shape_type=ShapeType.STRING, -) - -FLOW_LEX_BOT_LOCALE_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagent#FlowLexBotLocaleId"), - shape_type=ShapeType.STRING, -) - -LEX_FLOW_NODE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#LexFlowNodeConfiguration"), - members={ - "botAliasArn": { - "target": FLOW_LEX_BOT_ALIAS_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=""), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "localeId": { - "target": FLOW_LEX_BOT_LOCALE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=""), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - }, +VECTOR_KNOWLEDGE_BASE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _VKBC, + 0, + (_eMA, _eMC, _sDSC), + ( + (BEDROCK_EMBEDDING_MODEL_ARN, 1), + (EMBEDDING_MODEL_CONFIGURATION, 0), + (SUPPLEMENTAL_DATA_STORAGE_CONFIGURATION, 0), + ), ) -LOOP_CONTROLLER_FLOW_NODE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#LoopControllerFlowNodeConfiguration"), - members={ - "continueCondition": { - "target": FLOW_CONDITION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "maxIterations": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=10)], - }, - }, +KNOWLEDGE_BASE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _KBC, + 0, + (_t, _vKBC, _mKBC, _kKBC, _sKBC), + ( + (KNOWLEDGE_BASE_TYPE, 1), + (VECTOR_KNOWLEDGE_BASE_CONFIGURATION, 0), + (MANAGED_KNOWLEDGE_BASE_CONFIGURATION, 0), + (KENDRA_KNOWLEDGE_BASE_CONFIGURATION, 0), + (SQL_KNOWLEDGE_BASE_CONFIGURATION, 0), + ), ) -LOOP_INPUT_FLOW_NODE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#LoopInputFlowNodeConfiguration") -) +KNOWLEDGE_BASE_ROLE_ARN: StaticSchema = (3, n0, _KBRA, 0) -OUTPUT_FLOW_NODE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#OutputFlowNodeConfiguration") -) +MONGO_DB_ATLAS_COLLECTION_NAME: StaticSchema = (3, n0, _MDACN, 0) -FLOW_PROMPT_MODEL_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrockagent#FlowPromptModelIdentifier"), - shape_type=ShapeType.STRING, -) +MONGO_DB_ATLAS_DATABASE_NAME: StaticSchema = (3, n0, _MDADN, 0) -PROMPT_INPUT_VARIABLE_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagent#PromptInputVariableName"), - shape_type=ShapeType.STRING, -) +MONGO_DB_ATLAS_ENDPOINT: StaticSchema = (3, n0, _MDAE, 0) -PROMPT_INPUT_VARIABLE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#PromptInputVariable"), - members={"name": {"target": PROMPT_INPUT_VARIABLE_NAME}}, -) +MONGO_DB_ATLAS_ENDPOINT_SERVICE_NAME: StaticSchema = (3, n0, _MDAESN, 0) -PROMPT_INPUT_VARIABLES_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#PromptInputVariablesList"), - shape_type=ShapeType.LIST, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"member": {"target": PROMPT_INPUT_VARIABLE}}, -) +FIELD_NAME: StaticSchema = (3, n0, _FNi, 0) -CACHE_POINT_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#CachePointType"), - shape_type=ShapeType.ENUM, - members={"DEFAULT": {"target": UNIT}}, +MONGO_DB_ATLAS_FIELD_MAPPING: StaticSchema = ( + 18, + n0, + _MDAFM, + 0, + (_vF, _tFe, _mF), + ((FIELD_NAME, 1), (FIELD_NAME, 1), (FIELD_NAME, 1)), ) -CACHE_POINT_BLOCK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#CachePointBlock"), - members={ - "type": { - "target": CACHE_POINT_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +MONGO_DB_ATLAS_INDEX_NAME: StaticSchema = (3, n0, _MDAIN, 0) -CONTENT_BLOCK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ContentBlock"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"text": {"target": STRING}, "cachePoint": {"target": CACHE_POINT_BLOCK}}, +MONGO_DB_ATLAS_CONFIGURATION: StaticSchema = ( + 18, + n0, + _MDAC, + 0, + (_en, _dNa, _cNo, _vIN, _cSA, _fMi, _eSN, _tIN), + ( + (MONGO_DB_ATLAS_ENDPOINT, 1), + (MONGO_DB_ATLAS_DATABASE_NAME, 1), + (MONGO_DB_ATLAS_COLLECTION_NAME, 1), + (MONGO_DB_ATLAS_INDEX_NAME, 1), + (SECRET_ARN, 1), + (MONGO_DB_ATLAS_FIELD_MAPPING, 1), + (MONGO_DB_ATLAS_ENDPOINT_SERVICE_NAME, 0), + (MONGO_DB_ATLAS_INDEX_NAME, 0), + ), ) -CONTENT_BLOCKS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ContentBlocks"), - shape_type=ShapeType.LIST, - members={"member": {"target": CONTENT_BLOCK}}, +NEPTUNE_ANALYTICS_FIELD_MAPPING: StaticSchema = ( + 18, + n0, + _NAFM, + 0, + (_tFe, _mF), + ((FIELD_NAME, 1), (FIELD_NAME, 1)), ) -CONVERSATION_ROLE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ConversationRole"), - shape_type=ShapeType.ENUM, - members={"USER": {"target": UNIT}, "ASSISTANT": {"target": UNIT}}, -) +GRAPH_ARN: StaticSchema = (3, n0, _GAr, 4) -MESSAGE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#Message"), - members={ - "role": { - "target": CONVERSATION_ROLE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "content": { - "target": CONTENT_BLOCKS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +NEPTUNE_ANALYTICS_CONFIGURATION: StaticSchema = ( + 18, + n0, + _NAC, + 0, + (_gA, _fMi), + ((GRAPH_ARN, 1), (NEPTUNE_ANALYTICS_FIELD_MAPPING, 1)), ) -MESSAGES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#Messages"), - shape_type=ShapeType.LIST, - members={"member": {"target": MESSAGE}}, -) +OPEN_SEARCH_MANAGED_CLUSTER_DOMAIN_ARN: StaticSchema = (3, n0, _OSMCDA, 0) -NON_EMPTY_STRING = Schema( - id=ShapeID("com.amazonaws.bedrockagent#NonEmptyString"), shape_type=ShapeType.STRING -) +OPEN_SEARCH_MANAGED_CLUSTER_DOMAIN_ENDPOINT: StaticSchema = (3, n0, _OSMCDE, 0) -SYSTEM_CONTENT_BLOCK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#SystemContentBlock"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "text": {"target": NON_EMPTY_STRING}, - "cachePoint": {"target": CACHE_POINT_BLOCK}, - }, +OPEN_SEARCH_MANAGED_CLUSTER_FIELD_MAPPING: StaticSchema = ( + 18, + n0, + _OSMCFM, + 0, + (_vF, _tFe, _mF), + ((FIELD_NAME, 1), (FIELD_NAME, 1), (FIELD_NAME, 1)), ) -SYSTEM_CONTENT_BLOCKS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#SystemContentBlocks"), - shape_type=ShapeType.LIST, - members={"member": {"target": SYSTEM_CONTENT_BLOCK}}, -) +OPEN_SEARCH_MANAGED_CLUSTER_INDEX_NAME: StaticSchema = (3, n0, _OSMCIN, 4) -ANY_TOOL_CHOICE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#AnyToolChoice") +OPEN_SEARCH_MANAGED_CLUSTER_CONFIGURATION: StaticSchema = ( + 18, + n0, + _OSMCC, + 0, + (_dE, _dA, _vIN, _fMi), + ( + (OPEN_SEARCH_MANAGED_CLUSTER_DOMAIN_ENDPOINT, 1), + (OPEN_SEARCH_MANAGED_CLUSTER_DOMAIN_ARN, 1), + (OPEN_SEARCH_MANAGED_CLUSTER_INDEX_NAME, 1), + (OPEN_SEARCH_MANAGED_CLUSTER_FIELD_MAPPING, 1), + ), ) -AUTO_TOOL_CHOICE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#AutoToolChoice") -) +OPEN_SEARCH_SERVERLESS_COLLECTION_ARN: StaticSchema = (3, n0, _OSSCA, 0) -TOOL_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagent#ToolName"), shape_type=ShapeType.STRING +OPEN_SEARCH_SERVERLESS_FIELD_MAPPING: StaticSchema = ( + 18, + n0, + _OSSFM, + 0, + (_vF, _tFe, _mF), + ((FIELD_NAME, 1), (FIELD_NAME, 1), (FIELD_NAME, 1)), ) -SPECIFIC_TOOL_CHOICE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#SpecificToolChoice"), - members={ - "name": { - "target": TOOL_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +OPEN_SEARCH_SERVERLESS_INDEX_NAME: StaticSchema = (3, n0, _OSSIN, 0) -TOOL_CHOICE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ToolChoice"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "auto": {"target": AUTO_TOOL_CHOICE}, - "any": {"target": ANY_TOOL_CHOICE}, - "tool": {"target": SPECIFIC_TOOL_CHOICE}, - }, +OPEN_SEARCH_SERVERLESS_CONFIGURATION: StaticSchema = ( + 18, + n0, + _OSSC, + 0, + (_cAo, _vIN, _fMi), + ( + (OPEN_SEARCH_SERVERLESS_COLLECTION_ARN, 1), + (OPEN_SEARCH_SERVERLESS_INDEX_NAME, 1), + (OPEN_SEARCH_SERVERLESS_FIELD_MAPPING, 1), + ), ) -TOOL_INPUT_SCHEMA = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ToolInputSchema"), - shape_type=ShapeType.UNION, - members={"json": {"target": DOCUMENT}}, -) - -TOOL_SPECIFICATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ToolSpecification"), - members={ - "name": { - "target": TOOL_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": NON_EMPTY_STRING}, - "inputSchema": { - "target": TOOL_INPUT_SCHEMA, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "strict": {"target": BOOLEAN}, - }, -) +PINECONE_CONNECTION_STRING: StaticSchema = (3, n0, _PCS, 0) -TOOL = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#Tool"), - shape_type=ShapeType.UNION, - members={ - "toolSpec": {"target": TOOL_SPECIFICATION}, - "cachePoint": {"target": CACHE_POINT_BLOCK}, - }, +PINECONE_FIELD_MAPPING: StaticSchema = ( + 18, + n0, + _PFM, + 0, + (_tFe, _mF), + ((FIELD_NAME, 1), (FIELD_NAME, 1)), ) -TOOLS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#Tools"), - shape_type=ShapeType.LIST, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"member": {"target": TOOL}}, -) +PINECONE_NAMESPACE: StaticSchema = (3, n0, _PN, 0) -TOOL_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ToolConfiguration"), - members={ - "tools": { - "target": TOOLS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "toolChoice": {"target": TOOL_CHOICE}, - }, +PINECONE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _PCi, + 0, + (_cSo, _cSA, _nam, _fMi), + ( + (PINECONE_CONNECTION_STRING, 1), + (SECRET_ARN, 1), + (PINECONE_NAMESPACE, 0), + (PINECONE_FIELD_MAPPING, 1), + ), ) -CHAT_PROMPT_TEMPLATE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ChatPromptTemplateConfiguration"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "messages": { - "target": MESSAGES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "system": {"target": SYSTEM_CONTENT_BLOCKS}, - "inputVariables": {"target": PROMPT_INPUT_VARIABLES_LIST}, - "toolConfiguration": {"target": TOOL_CONFIGURATION}, - }, -) +RDS_DATABASE_NAME: StaticSchema = (3, n0, _RDN, 0) -TEXT_PROMPT = Schema( - id=ShapeID("com.amazonaws.bedrockagent#TextPrompt"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) +COLUMN_NAME: StaticSchema = (3, n0, _CN, 0) -TEXT_PROMPT_TEMPLATE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#TextPromptTemplateConfiguration"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "text": { - "target": TEXT_PROMPT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "cachePoint": {"target": CACHE_POINT_BLOCK}, - "inputVariables": {"target": PROMPT_INPUT_VARIABLES_LIST}, - }, +RDS_FIELD_MAPPING: StaticSchema = ( + 18, + n0, + _RFM, + 0, + (_pKF, _vF, _tFe, _mF, _cMF), + ( + (COLUMN_NAME, 1), + (COLUMN_NAME, 1), + (COLUMN_NAME, 1), + (COLUMN_NAME, 1), + (COLUMN_NAME, 0), + ), ) -PROMPT_TEMPLATE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#PromptTemplateConfiguration"), - shape_type=ShapeType.UNION, - members={ - "text": {"target": TEXT_PROMPT_TEMPLATE_CONFIGURATION}, - "chat": {"target": CHAT_PROMPT_TEMPLATE_CONFIGURATION}, - }, -) +RDS_ARN: StaticSchema = (3, n0, _RAd, 0) -PROMPT_TEMPLATE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#PromptTemplateType"), - shape_type=ShapeType.ENUM, - members={"TEXT": {"target": UNIT}, "CHAT": {"target": UNIT}}, -) - -PROMPT_FLOW_NODE_INLINE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#PromptFlowNodeInlineConfiguration"), - members={ - "templateType": { - "target": PROMPT_TEMPLATE_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value="TEXT"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "templateConfiguration": { - "target": PROMPT_TEMPLATE_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelId": { - "target": FLOW_PROMPT_MODEL_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=""), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "inferenceConfiguration": {"target": PROMPT_INFERENCE_CONFIGURATION}, - "additionalModelRequestFields": {"target": DOCUMENT}, - }, -) +RDS_TABLE_NAME: StaticSchema = (3, n0, _RTN, 0) -FLOW_PROMPT_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagent#FlowPromptArn"), shape_type=ShapeType.STRING +RDS_CONFIGURATION: StaticSchema = ( + 18, + n0, + _RCd, + 0, + (_rAe, _cSA, _dNa, _tNa, _fMi), + ( + (RDS_ARN, 1), + (SECRET_ARN, 1), + (RDS_DATABASE_NAME, 1), + (RDS_TABLE_NAME, 1), + (RDS_FIELD_MAPPING, 1), + ), ) -PROMPT_FLOW_NODE_RESOURCE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#PromptFlowNodeResourceConfiguration"), - members={ - "promptArn": { - "target": FLOW_PROMPT_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=""), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, -) +REDIS_ENTERPRISE_CLOUD_ENDPOINT: StaticSchema = (3, n0, _RECE, 0) -PROMPT_FLOW_NODE_SOURCE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#PromptFlowNodeSourceConfiguration"), - shape_type=ShapeType.UNION, - members={ - "resource": {"target": PROMPT_FLOW_NODE_RESOURCE_CONFIGURATION}, - "inline": {"target": PROMPT_FLOW_NODE_INLINE_CONFIGURATION}, - }, +REDIS_ENTERPRISE_CLOUD_FIELD_MAPPING: StaticSchema = ( + 18, + n0, + _RECFM, + 0, + (_vF, _tFe, _mF), + ((FIELD_NAME, 1), (FIELD_NAME, 1), (FIELD_NAME, 1)), ) -PROMPT_FLOW_NODE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#PromptFlowNodeConfiguration"), - members={ - "sourceConfiguration": { - "target": PROMPT_FLOW_NODE_SOURCE_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "guardrailConfiguration": {"target": GUARDRAIL_CONFIGURATION}, - }, -) +REDIS_ENTERPRISE_CLOUD_INDEX_NAME: StaticSchema = (3, n0, _RECIN, 0) -FLOW_S3_BUCKET_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagent#FlowS3BucketName"), - shape_type=ShapeType.STRING, +REDIS_ENTERPRISE_CLOUD_CONFIGURATION: StaticSchema = ( + 18, + n0, + _RECC, + 0, + (_en, _vIN, _cSA, _fMi), + ( + (REDIS_ENTERPRISE_CLOUD_ENDPOINT, 1), + (REDIS_ENTERPRISE_CLOUD_INDEX_NAME, 1), + (SECRET_ARN, 1), + (REDIS_ENTERPRISE_CLOUD_FIELD_MAPPING, 1), + ), ) -RETRIEVAL_FLOW_NODE_S3_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#RetrievalFlowNodeS3Configuration"), - members={ - "bucketName": { - "target": FLOW_S3_BUCKET_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=""), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, +INDEX_ARN: StaticSchema = (3, n0, _IA, 4) + +INDEX_NAME: StaticSchema = (3, n0, _IN, 4) + +VECTOR_BUCKET_ARN: StaticSchema = (3, n0, _VBA, 4) + +S3_VECTORS_CONFIGURATION: StaticSchema = ( + 18, + n0, + _SVC, + 0, + (_vBA, _iAn, _iN), + ((VECTOR_BUCKET_ARN, 0), (INDEX_ARN, 0), (INDEX_NAME, 0)), +) + +KNOWLEDGE_BASE_STORAGE_TYPE: StaticSchema = ( + 14, + n0, + _KBST, + 0, + (_OS, _PINECONE, _REC, _RDS, _MDA, _NA, _OMC, _SV_), + ( + (-1, {_sV: _OS}), + (-1, {_sV: _PINECONE}), + (-1, {_sV: _REC}), + (-1, {_sV: _RDS}), + (-1, {_sV: _MDA}), + (-1, {_sV: _NA}), + (-1, {_sV: _OMC}), + (-1, {_sV: _SV_}), + ), ) -RETRIEVAL_FLOW_NODE_SERVICE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#RetrievalFlowNodeServiceConfiguration"), - shape_type=ShapeType.UNION, - members={"s3": {"target": RETRIEVAL_FLOW_NODE_S3_CONFIGURATION}}, +STORAGE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _SCt, + 0, + (_t, _oSC, _oMCC, _pCi, _rECC, _rCd, _mDAC, _nAC, _sVC), + ( + (KNOWLEDGE_BASE_STORAGE_TYPE, 1), + (OPEN_SEARCH_SERVERLESS_CONFIGURATION, 0), + (OPEN_SEARCH_MANAGED_CLUSTER_CONFIGURATION, 0), + (PINECONE_CONFIGURATION, 0), + (REDIS_ENTERPRISE_CLOUD_CONFIGURATION, 0), + (RDS_CONFIGURATION, 0), + (MONGO_DB_ATLAS_CONFIGURATION, 0), + (NEPTUNE_ANALYTICS_CONFIGURATION, 0), + (S3_VECTORS_CONFIGURATION, 0), + ), ) -RETRIEVAL_FLOW_NODE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#RetrievalFlowNodeConfiguration"), - members={ - "serviceConfiguration": { - "target": RETRIEVAL_FLOW_NODE_SERVICE_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +CREATE_KNOWLEDGE_BASE_INPUT: StaticSchema = ( + 18, + n0, + _CKBI, + {_sSI: _cCKBR, _smit: None}, + (_cT, _na, _d, _rAo, _kBC, _sCto, _ta), + ( + (CLIENT_TOKEN, 2), + (NAME, 1), + (DESCRIPTION, 0), + (KNOWLEDGE_BASE_ROLE_ARN, 1), + (KNOWLEDGE_BASE_CONFIGURATION, 1), + (STORAGE_CONFIGURATION, 0), + (TAGS_MAP, 0), + ), ) -STORAGE_FLOW_NODE_S3_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#StorageFlowNodeS3Configuration"), - members={ - "bucketName": { - "target": FLOW_S3_BUCKET_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=""), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, +KNOWLEDGE_BASE_ARN: StaticSchema = (3, n0, _KBA, 0) + +KNOWLEDGE_BASE_STATUS: StaticSchema = ( + 14, + n0, + _KBSn, + 0, + (_CREATING, _ACTIVE, _DELETING, _UPDATING, _FAILED, _DU, _UU), + ( + (-1, {_sV: _CREATING}), + (-1, {_sV: _ACTIVE}), + (-1, {_sV: _DELETING}), + (-1, {_sV: _UPDATING}), + (-1, {_sV: _FAILED}), + (-1, {_sV: _DU}), + (-1, {_sV: _UU}), + ), ) -STORAGE_FLOW_NODE_SERVICE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#StorageFlowNodeServiceConfiguration"), - shape_type=ShapeType.UNION, - members={"s3": {"target": STORAGE_FLOW_NODE_S3_CONFIGURATION}}, +KNOWLEDGE_BASE: StaticSchema = ( + 18, + n0, + _KBn, + 0, + (_kBI, _na, _kBA, _d, _rAo, _kBC, _sCto, _sta, _cA, _uA, _fR), + ( + (ID, 1), + (NAME, 1), + (KNOWLEDGE_BASE_ARN, 1), + (DESCRIPTION, 0), + (KNOWLEDGE_BASE_ROLE_ARN, 1), + (KNOWLEDGE_BASE_CONFIGURATION, 1), + (STORAGE_CONFIGURATION, 0), + (KNOWLEDGE_BASE_STATUS, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (FAILURE_REASONS, 0), + ), ) -STORAGE_FLOW_NODE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#StorageFlowNodeConfiguration"), - members={ - "serviceConfiguration": { - "target": STORAGE_FLOW_NODE_SERVICE_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +CREATE_KNOWLEDGE_BASE_OUTPUT: StaticSchema = ( + 18, + n0, + _CKBO, + {_sSI: _cCKBRo, _smith: None}, + (_kB,), + ((KNOWLEDGE_BASE, 1),), +) + +CREATE_KNOWLEDGE_BASE: StaticOperationSchema = ( + 23, + n0, + _CKB, + { + _smithy: MappingProxyType( + {"code": 202, "method": "PUT", "uri": "/knowledgebases/"} + ) + }, + CREATE_KNOWLEDGE_BASE_INPUT, + CREATE_KNOWLEDGE_BASE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -FLOW_NODE_INPUT_CATEGORY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#FlowNodeInputCategory"), - shape_type=ShapeType.ENUM, - members={ - "LOOP_CONDITION": {"target": UNIT}, - "RETURN_VALUE_TO_LOOP_START": {"target": UNIT}, - "EXIT_LOOP": {"target": UNIT}, - }, +DELETE_KNOWLEDGE_BASE_INPUT: StaticSchema = ( + 18, + n0, + _DKBI, + {_sSI: _cDKBR, _smit: None}, + (_kBI,), + ((ID, 9),), +) + +DELETE_KNOWLEDGE_BASE_OUTPUT: StaticSchema = ( + 18, + n0, + _DKBO, + {_sSI: _cDKBRo, _smith: None}, + (_kBI, _sta), + ((ID, 1), (KNOWLEDGE_BASE_STATUS, 1)), +) + +DELETE_KNOWLEDGE_BASE: StaticOperationSchema = ( + 23, + n0, + _DKB, + { + _smithy: MappingProxyType( + { + "code": 202, + "method": "DELETE", + "uri": "/knowledgebases/{knowledgeBaseId}", + } + ) + }, + DELETE_KNOWLEDGE_BASE_INPUT, + DELETE_KNOWLEDGE_BASE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -FLOW_NODE_INPUT_EXPRESSION = Schema( - id=ShapeID("com.amazonaws.bedrockagent#FlowNodeInputExpression"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +DISASSOCIATE_AGENT_KNOWLEDGE_BASE_INPUT: StaticSchema = ( + 18, + n0, + _DAKBI, + {_sSI: _cDAKBR, _smit: None}, + (_aI, _aV, _kBI), + ((ID, 9), (DRAFT_VERSION, 9), (ID, 9)), +) + +DISASSOCIATE_AGENT_KNOWLEDGE_BASE_OUTPUT: StaticSchema = ( + 18, + n0, + _DAKBO, + {_sSI: _cDAKBRo, _smith: None}, +) + +DISASSOCIATE_AGENT_KNOWLEDGE_BASE: StaticOperationSchema = ( + 23, + n0, + _DAKB, + { + _smithy: MappingProxyType( + { + "code": 204, + "method": "DELETE", + "uri": "/agents/{agentId}/agentversions/{agentVersion}/knowledgebases/{knowledgeBaseId}/", + } + ) + }, + DISASSOCIATE_AGENT_KNOWLEDGE_BASE_INPUT, + DISASSOCIATE_AGENT_KNOWLEDGE_BASE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -FLOW_NODE_IO_DATA_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#FlowNodeIODataType"), - shape_type=ShapeType.ENUM, - members={ - "STRING": {"target": UNIT}, - "NUMBER": {"target": UNIT}, - "BOOLEAN": {"target": UNIT}, - "OBJECT": {"target": UNIT}, - "ARRAY": {"target": UNIT}, - }, +GET_AGENT_KNOWLEDGE_BASE_INPUT: StaticSchema = ( + 18, + n0, + _GAKBI, + {_sSI: _cGAKBR, _smit: None}, + (_aI, _aV, _kBI), + ((ID, 9), (VERSION, 9), (ID, 9)), +) + +GET_AGENT_KNOWLEDGE_BASE_OUTPUT: StaticSchema = ( + 18, + n0, + _GAKBO, + {_sSI: _cGAKBRo, _smith: None}, + (_aKB,), + ((AGENT_KNOWLEDGE_BASE, 1),), +) + +GET_AGENT_KNOWLEDGE_BASE: StaticOperationSchema = ( + 23, + n0, + _GAKB, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "GET", + "uri": "/agents/{agentId}/agentversions/{agentVersion}/knowledgebases/{knowledgeBaseId}/", + } + ) + }, + GET_AGENT_KNOWLEDGE_BASE_INPUT, + GET_AGENT_KNOWLEDGE_BASE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -FLOW_NODE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#FlowNodeInput"), - members={ - "name": { - "target": FLOW_NODE_INPUT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "type": { - "target": FLOW_NODE_IO_DATA_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "expression": { - "target": FLOW_NODE_INPUT_EXPRESSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "category": {"target": FLOW_NODE_INPUT_CATEGORY}, - }, +GET_KNOWLEDGE_BASE_INPUT: StaticSchema = ( + 18, + n0, + _GKBI, + {_sSI: _cGKBR, _smit: None}, + (_kBI,), + ((ID, 9),), +) + +GET_KNOWLEDGE_BASE_OUTPUT: StaticSchema = ( + 18, + n0, + _GKBO, + {_sSI: _cGKBRo, _smith: None}, + (_kB,), + ((KNOWLEDGE_BASE, 1),), +) + +GET_KNOWLEDGE_BASE: StaticOperationSchema = ( + 23, + n0, + _GKB, + { + _smithy: MappingProxyType( + {"code": 200, "method": "GET", "uri": "/knowledgebases/{knowledgeBaseId}"} + ) + }, + GET_KNOWLEDGE_BASE_INPUT, + GET_KNOWLEDGE_BASE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -FLOW_NODE_INPUTS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#FlowNodeInputs"), - shape_type=ShapeType.LIST, - members={"member": {"target": FLOW_NODE_INPUT}}, +LIST_AGENT_KNOWLEDGE_BASES_INPUT: StaticSchema = ( + 18, + n0, + _LAKBI, + {_sSI: _cLAKBR, _smit: None}, + (_aI, _aV, _mR, _nT), + ((ID, 9), (VERSION, 9), (MAX_RESULTS, 0), (NEXT_TOKEN, 0)), +) + +LIST_AGENT_KNOWLEDGE_BASES_OUTPUT: StaticSchema = ( + 18, + n0, + _LAKBO, + {_sSI: _cLAKBRo, _smith: None}, + (_aKBS, _nT), + ((AGENT_KNOWLEDGE_BASE_SUMMARIES, 1), (NEXT_TOKEN, 0)), +) + +LIST_AGENT_KNOWLEDGE_BASES: StaticOperationSchema = ( + 23, + n0, + _LAKB, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "POST", + "uri": "/agents/{agentId}/agentversions/{agentVersion}/knowledgebases/", + } + ) + }, + LIST_AGENT_KNOWLEDGE_BASES_INPUT, + LIST_AGENT_KNOWLEDGE_BASES_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -FLOW_NODE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#FlowNodeOutput"), - members={ - "name": { - "target": FLOW_NODE_OUTPUT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "type": { - "target": FLOW_NODE_IO_DATA_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +LIST_KNOWLEDGE_BASES_INPUT: StaticSchema = ( + 18, + n0, + _LKBI, + {_sSI: _cLKBR, _smit: None}, + (_mR, _nT), + ((MAX_RESULTS, 0), (NEXT_TOKEN, 0)), +) + +KNOWLEDGE_BASE_SUMMARY: StaticSchema = ( + 18, + n0, + _KBSno, + 0, + (_kBI, _na, _d, _sta, _uA), + ( + (ID, 1), + (NAME, 1), + (DESCRIPTION, 0), + (KNOWLEDGE_BASE_STATUS, 1), + (DATE_TIMESTAMP, 1), + ), ) -FLOW_NODE_OUTPUTS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#FlowNodeOutputs"), - shape_type=ShapeType.LIST, - members={"member": {"target": FLOW_NODE_OUTPUT}}, -) - -FLOW_NODE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#FlowNodeType"), - shape_type=ShapeType.ENUM, - members={ - "INPUT": {"target": UNIT}, - "OUTPUT": {"target": UNIT}, - "KNOWLEDGE_BASE": {"target": UNIT}, - "CONDITION": {"target": UNIT}, - "LEX": {"target": UNIT}, - "PROMPT": {"target": UNIT}, - "LAMBDA_FUNCTION": {"target": UNIT}, - "STORAGE": {"target": UNIT}, - "AGENT": {"target": UNIT}, - "RETRIEVAL": {"target": UNIT}, - "ITERATOR": {"target": UNIT}, - "COLLECTOR": {"target": UNIT}, - "INLINE_CODE": {"target": UNIT}, - "LOOP": {"target": UNIT}, - "LOOP_INPUT": {"target": UNIT}, - "LOOP_CONTROLLER": {"target": UNIT}, - }, +KNOWLEDGE_BASE_SUMMARIES: StaticSchema = ( + 16, + n0, + _KBSnow, + 0, + (_me,), + ((KNOWLEDGE_BASE_SUMMARY, 0),), +) + +LIST_KNOWLEDGE_BASES_OUTPUT: StaticSchema = ( + 18, + n0, + _LKBO, + {_sSI: _cLKBRo, _smith: None}, + (_kBSn, _nT), + ((KNOWLEDGE_BASE_SUMMARIES, 1), (NEXT_TOKEN, 0)), +) + +LIST_KNOWLEDGE_BASES: StaticOperationSchema = ( + 23, + n0, + _LKB, + { + _smithy: MappingProxyType( + {"code": 200, "method": "POST", "uri": "/knowledgebases/"} + ) + }, + LIST_KNOWLEDGE_BASES_INPUT, + LIST_KNOWLEDGE_BASES_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -FLOW_DESCRIPTION = Schema( - id=ShapeID("com.amazonaws.bedrockagent#FlowDescription"), - shape_type=ShapeType.STRING, +UPDATE_AGENT_KNOWLEDGE_BASE_INPUT: StaticSchema = ( + 18, + n0, + _UAKBI, + {_sSI: _cUAKBR, _smit: None}, + (_aI, _aV, _kBI, _d, _kBS), + ((ID, 9), (DRAFT_VERSION, 9), (ID, 9), (DESCRIPTION, 0), (KNOWLEDGE_BASE_STATE, 0)), +) + +UPDATE_AGENT_KNOWLEDGE_BASE_OUTPUT: StaticSchema = ( + 18, + n0, + _UAKBO, + {_sSI: _cUAKBRo, _smith: None}, + (_aKB,), + ((AGENT_KNOWLEDGE_BASE, 1),), +) + +UPDATE_AGENT_KNOWLEDGE_BASE: StaticOperationSchema = ( + 23, + n0, + _UAKB, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "PUT", + "uri": "/agents/{agentId}/agentversions/{agentVersion}/knowledgebases/{knowledgeBaseId}/", + } + ) + }, + UPDATE_AGENT_KNOWLEDGE_BASE_INPUT, + UPDATE_AGENT_KNOWLEDGE_BASE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -FLOW_EXECUTION_ROLE_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagent#FlowExecutionRoleArn"), - shape_type=ShapeType.STRING, +UPDATE_KNOWLEDGE_BASE_INPUT: StaticSchema = ( + 18, + n0, + _UKBI, + {_sSI: _cUKBR, _smit: None}, + (_kBI, _na, _d, _rAo, _kBC, _sCto), + ( + (ID, 9), + (NAME, 1), + (DESCRIPTION, 0), + (KNOWLEDGE_BASE_ROLE_ARN, 1), + (KNOWLEDGE_BASE_CONFIGURATION, 1), + (STORAGE_CONFIGURATION, 0), + ), ) -FLOW_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagent#FlowName"), shape_type=ShapeType.STRING +UPDATE_KNOWLEDGE_BASE_OUTPUT: StaticSchema = ( + 18, + n0, + _UKBO, + {_sSI: _cUKBRo, _smith: None}, + (_kB,), + ((KNOWLEDGE_BASE, 1),), +) + +UPDATE_KNOWLEDGE_BASE: StaticOperationSchema = ( + 23, + n0, + _UKB, + { + _smithy: MappingProxyType( + {"code": 202, "method": "PUT", "uri": "/knowledgebases/{knowledgeBaseId}"} + ) + }, + UPDATE_KNOWLEDGE_BASE_INPUT, + UPDATE_KNOWLEDGE_BASE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -FLOW_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagent#FlowArn"), shape_type=ShapeType.STRING +LIST_VPC_CONFIGURATIONS_INPUT: StaticSchema = ( + 18, + n0, + _LVCI, + {_sSI: _cLVCR, _smit: None}, + (_kBI, _sFt, _mR, _nT), + ( + (ID, 9), + (VPC_CONFIGURATION_STATUS, {_sQ: _sta}), + (MAX_RESULTS, {_sQ: _mR}), + (NEXT_TOKEN, {_sQ: _nT}), + ), ) -FLOW_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagent#FlowId"), shape_type=ShapeType.STRING +VPC_CONFIGURATION_SUMMARY: StaticSchema = ( + 18, + n0, + _VCSp, + 0, + (_vCI, _sta, _sMt, _vI, _rT, _po, _pr, _rM, _hH, _tSN, _na, _d, _cA), + ( + (VPC_CONFIGURATION_ID, 1), + (VPC_CONFIGURATION_STATUS, 1), + (VPC_CONFIGURATION_STATUS_MESSAGE, 0), + (VPC_ID, 1), + (RESOURCE_TARGET, 1), + (PORT, 1), + (VPC_PROTOCOL, 1), + (VPC_RESOLUTION_MODE, 1), + (HOST_HEADER, 0), + (TLS_SERVER_NAME, 0), + (VPC_CONFIGURATION_NAME, 0), + (VPC_CONFIGURATION_DESCRIPTION, 0), + (DATE_TIMESTAMP, 1), + ), ) -FLOW_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#FlowStatus"), - shape_type=ShapeType.ENUM, - members={ - "FAILED": {"target": UNIT}, - "PREPARED": {"target": UNIT}, - "PREPARING": {"target": UNIT}, - "NOT_PREPARED": {"target": UNIT}, - }, +VPC_CONFIGURATION_SUMMARY_LIST: StaticSchema = ( + 16, + n0, + _VCSL, + 0, + (_me,), + ((VPC_CONFIGURATION_SUMMARY, 0),), +) + +LIST_VPC_CONFIGURATIONS_OUTPUT: StaticSchema = ( + 18, + n0, + _LVCO, + {_sSI: _cLVCRo, _smith: None}, + (_it, _nT), + ((VPC_CONFIGURATION_SUMMARY_LIST, 1), (NEXT_TOKEN, 0)), +) + +LIST_VPC_CONFIGURATIONS: StaticOperationSchema = ( + 23, + n0, + _LVC, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "GET", + "uri": "/knowledgebases/{knowledgeBaseId}/vpcconfigurations/", + } + ) + }, + LIST_VPC_CONFIGURATIONS_INPUT, + LIST_VPC_CONFIGURATIONS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -FLOW_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrockagent#FlowIdentifier"), shape_type=ShapeType.STRING -) +PROMPT_VARIANT_NAME: StaticSchema = (3, n0, _PVN, 0) -DELETE_FLOW_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#DeleteFlowInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#DeleteFlowRequest", - ) - ], - members={ - "flowIdentifier": { - "target": FLOW_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "skipResourceInUseCheck": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=False), - Trait.new( - id=ShapeID("smithy.api#httpQuery"), value="skipResourceInUseCheck" - ), - ], - }, - }, -) +PROMPT_DESCRIPTION: StaticSchema = (3, n0, _PDr, 0) -DELETE_FLOW_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#DeleteFlowOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#DeleteFlowResponse", - ) - ], - members={ - "id": { - "target": FLOW_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +PROMPT_NAME: StaticSchema = (3, n0, _PNr, 0) -DELETE_FLOW = Schema( - id=ShapeID("com.amazonaws.bedrockagent#DeleteFlow"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "DELETE", "uri": "/flows/{flowIdentifier}/"} - ), - ) - ], +PROMPT_AGENT_RESOURCE: StaticSchema = ( + 18, + n0, + _PAR, + 4, + (_aIg,), + ((AGENT_ALIAS_ARN, 1),), ) -CONCURRENCY_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ConcurrencyType"), - shape_type=ShapeType.ENUM, - members={"AUTOMATIC": {"target": UNIT}, "MANUAL": {"target": UNIT}}, +PROMPT_GEN_AI_RESOURCE: StaticSchema = ( + 19, + n0, + _PGAR, + 4, + (_ag,), + ((PROMPT_AGENT_RESOURCE, 0),), ) -FLOW_ALIAS_CONCURRENCY_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#FlowAliasConcurrencyConfiguration"), - members={ - "type": { - "target": CONCURRENCY_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "maxConcurrency": {"target": INTEGER}, - }, -) +PROMPT_METADATA_KEY: StaticSchema = (3, n0, _PMK, 4) -FLOW_ALIAS_ROUTING_CONFIGURATION_LIST_ITEM = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#FlowAliasRoutingConfigurationListItem"), - members={"flowVersion": {"target": VERSION}}, -) +PROMPT_METADATA_VALUE: StaticSchema = (3, n0, _PMV, 4) -FLOW_ALIAS_ROUTING_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#FlowAliasRoutingConfiguration"), - shape_type=ShapeType.LIST, - members={"member": {"target": FLOW_ALIAS_ROUTING_CONFIGURATION_LIST_ITEM}}, +PROMPT_METADATA_ENTRY: StaticSchema = ( + 18, + n0, + _PME, + 4, + (_k, _v), + ((PROMPT_METADATA_KEY, 1), (PROMPT_METADATA_VALUE, 1)), ) -CREATE_FLOW_ALIAS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#CreateFlowAliasInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#CreateFlowAliasRequest", - ) - ], - members={ - "name": { - "target": NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "routingConfiguration": { - "target": FLOW_ALIAS_ROUTING_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "concurrencyConfiguration": {"target": FLOW_ALIAS_CONCURRENCY_CONFIGURATION}, - "flowIdentifier": { - "target": FLOW_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "tags": {"target": TAGS_MAP}, - }, +PROMPT_METADATA_LIST: StaticSchema = ( + 16, + n0, + _PML, + 4, + (_me,), + ((PROMPT_METADATA_ENTRY, 0),), ) -FLOW_ALIAS_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagent#FlowAliasArn"), shape_type=ShapeType.STRING -) +PROMPT_MODEL_IDENTIFIER: StaticSchema = (3, n0, _PMIr, 0) -FLOW_ALIAS_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagent#FlowAliasId"), shape_type=ShapeType.STRING +PROMPT_VARIANT: StaticSchema = ( + 18, + n0, + _PV, + 4, + (_na, _tT, _tCe, _mI, _iC, _meta, _aMRF, _gAR), + ( + (PROMPT_VARIANT_NAME, 1), + (PROMPT_TEMPLATE_TYPE, 1), + (PROMPT_TEMPLATE_CONFIGURATION, 1), + (PROMPT_MODEL_IDENTIFIER, 0), + (PROMPT_INFERENCE_CONFIGURATION, 0), + (PROMPT_METADATA_LIST, 0), + (13, 0), + (PROMPT_GEN_AI_RESOURCE, 0), + ), ) -CREATE_FLOW_ALIAS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#CreateFlowAliasOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#CreateFlowAliasResponse", - ) - ], - members={ - "name": { - "target": NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "routingConfiguration": { - "target": FLOW_ALIAS_ROUTING_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "concurrencyConfiguration": {"target": FLOW_ALIAS_CONCURRENCY_CONFIGURATION}, - "flowId": { - "target": FLOW_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "id": { - "target": FLOW_ALIAS_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "arn": { - "target": FLOW_ALIAS_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +PROMPT_VARIANT_LIST: StaticSchema = (16, n0, _PVL, 4, (_me,), ((PROMPT_VARIANT, 0),)) + +CREATE_PROMPT_INPUT: StaticSchema = ( + 18, + n0, + _CPI, + {_sSI: _cCPR, _smit: None}, + (_na, _d, _cEKA, _dV, _var, _cT, _ta), + ( + (PROMPT_NAME, 1), + (PROMPT_DESCRIPTION, 0), + (KMS_KEY_ARN, 0), + (PROMPT_VARIANT_NAME, 0), + (PROMPT_VARIANT_LIST, 0), + (CLIENT_TOKEN, 2), + (TAGS_MAP, 0), + ), ) -CREATE_FLOW_ALIAS = Schema( - id=ShapeID("com.amazonaws.bedrockagent#CreateFlowAlias"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 201, - "method": "POST", - "uri": "/flows/{flowIdentifier}/aliases", - } - ), - ) - ], +PROMPT_ARN: StaticSchema = (3, n0, _PAr, 0) + +PROMPT_ID: StaticSchema = (3, n0, _PIr, 0) + +CREATE_PROMPT_OUTPUT: StaticSchema = ( + 18, + n0, + _CPO, + {_sSI: _cCPRo, _smith: None}, + (_na, _d, _cEKA, _dV, _var, _id, _ar, _ve, _cA, _uA), + ( + (PROMPT_NAME, 1), + (PROMPT_DESCRIPTION, 0), + (KMS_KEY_ARN, 0), + (PROMPT_VARIANT_NAME, 0), + (PROMPT_VARIANT_LIST, 0), + (PROMPT_ID, 1), + (PROMPT_ARN, 1), + (VERSION, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + ), ) -FLOW_ALIAS_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrockagent#FlowAliasIdentifier"), - shape_type=ShapeType.STRING, +CREATE_PROMPT: StaticOperationSchema = ( + 23, + n0, + _CP, + {_smithy: MappingProxyType({"code": 201, "method": "POST", "uri": "/prompts/"})}, + CREATE_PROMPT_INPUT, + CREATE_PROMPT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -DELETE_FLOW_ALIAS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#DeleteFlowAliasInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#DeleteFlowAliasRequest", - ) - ], - members={ - "flowIdentifier": { - "target": FLOW_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "aliasIdentifier": { - "target": FLOW_ALIAS_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, +PROMPT_IDENTIFIER: StaticSchema = (3, n0, _PIro, 0) + +CREATE_PROMPT_VERSION_INPUT: StaticSchema = ( + 18, + n0, + _CPVI, + {_sSI: _cCPVR, _smit: None}, + (_pI, _d, _cT, _ta), + ((PROMPT_IDENTIFIER, 9), (PROMPT_DESCRIPTION, 0), (CLIENT_TOKEN, 2), (TAGS_MAP, 0)), +) + +CREATE_PROMPT_VERSION_OUTPUT: StaticSchema = ( + 18, + n0, + _CPVO, + {_sSI: _cCPVRo, _smith: None}, + (_na, _d, _cEKA, _dV, _var, _id, _ar, _ve, _cA, _uA), + ( + (PROMPT_NAME, 1), + (PROMPT_DESCRIPTION, 0), + (KMS_KEY_ARN, 0), + (PROMPT_VARIANT_NAME, 0), + (PROMPT_VARIANT_LIST, 0), + (PROMPT_ID, 1), + (PROMPT_ARN, 1), + (VERSION, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + ), ) -DELETE_FLOW_ALIAS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#DeleteFlowAliasOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#DeleteFlowAliasResponse", - ) - ], - members={ - "flowId": { - "target": FLOW_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "id": { - "target": FLOW_ALIAS_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +CREATE_PROMPT_VERSION: StaticOperationSchema = ( + 23, + n0, + _CPV, + { + _smithy: MappingProxyType( + { + "code": 201, + "method": "POST", + "uri": "/prompts/{promptIdentifier}/versions", + } + ) + }, + CREATE_PROMPT_VERSION_INPUT, + CREATE_PROMPT_VERSION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -DELETE_FLOW_ALIAS = Schema( - id=ShapeID("com.amazonaws.bedrockagent#DeleteFlowAlias"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "DELETE", - "uri": "/flows/{flowIdentifier}/aliases/{aliasIdentifier}", - } - ), - ) - ], +DELETE_PROMPT_INPUT: StaticSchema = ( + 18, + n0, + _DPI, + {_sSI: _cDPR, _smit: None}, + (_pI, _pV), + ((PROMPT_IDENTIFIER, 9), (NUMERICAL_VERSION, {_sQ: _pV})), +) + +DELETE_PROMPT_OUTPUT: StaticSchema = ( + 18, + n0, + _DPO, + {_sSI: _cDPRo, _smith: None}, + (_id, _ve), + ((PROMPT_ID, 1), (NUMERICAL_VERSION, 0)), +) + +DELETE_PROMPT: StaticOperationSchema = ( + 23, + n0, + _DP, + { + _smithy: MappingProxyType( + {"code": 200, "method": "DELETE", "uri": "/prompts/{promptIdentifier}/"} + ) + }, + DELETE_PROMPT_INPUT, + DELETE_PROMPT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -GET_FLOW_ALIAS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#GetFlowAliasInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#GetFlowAliasRequest", - ) - ], - members={ - "flowIdentifier": { - "target": FLOW_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "aliasIdentifier": { - "target": FLOW_ALIAS_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, +GET_PROMPT_INPUT: StaticSchema = ( + 18, + n0, + _GPI, + {_sSI: _cGPR, _smit: None}, + (_pI, _pV, _iD), + ((PROMPT_IDENTIFIER, 9), (VERSION, {_sQ: _pV}), (INCLUDED_DATA, {_sQ: _iD})), +) + +GET_PROMPT_OUTPUT: StaticSchema = ( + 18, + n0, + _GPO, + {_sSI: _cGPRo, _smith: None}, + (_na, _d, _cEKA, _dV, _var, _id, _ar, _ve, _cA, _uA), + ( + (PROMPT_NAME, 1), + (PROMPT_DESCRIPTION, 0), + (KMS_KEY_ARN, 0), + (PROMPT_VARIANT_NAME, 0), + (PROMPT_VARIANT_LIST, 0), + (PROMPT_ID, 1), + (PROMPT_ARN, 1), + (VERSION, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + ), ) -GET_FLOW_ALIAS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#GetFlowAliasOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#GetFlowAliasResponse", +GET_PROMPT: StaticOperationSchema = ( + 23, + n0, + _GP, + { + _smithy: MappingProxyType( + {"code": 200, "method": "GET", "uri": "/prompts/{promptIdentifier}/"} ) - ], - members={ - "name": { - "target": NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "routingConfiguration": { - "target": FLOW_ALIAS_ROUTING_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "concurrencyConfiguration": {"target": FLOW_ALIAS_CONCURRENCY_CONFIGURATION}, - "flowId": { - "target": FLOW_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "id": { - "target": FLOW_ALIAS_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "arn": { - "target": FLOW_ALIAS_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, }, + GET_PROMPT_INPUT, + GET_PROMPT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -GET_FLOW_ALIAS = Schema( - id=ShapeID("com.amazonaws.bedrockagent#GetFlowAlias"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/flows/{flowIdentifier}/aliases/{aliasIdentifier}", - } - ), - ) - ], -) - -LIST_FLOW_ALIASES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ListFlowAliasesInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#ListFlowAliasesRequest", - ) - ], - members={ - "flowIdentifier": { - "target": FLOW_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - }, +LIST_PROMPTS_INPUT: StaticSchema = ( + 18, + n0, + _LPI, + {_sSI: _cLPR, _smit: None}, + (_pI, _mR, _nT), + ( + (PROMPT_IDENTIFIER, {_sQ: _pI}), + (MAX_RESULTS, {_sQ: _mR}), + (NEXT_TOKEN, {_sQ: _nT}), + ), ) -FLOW_ALIAS_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#FlowAliasSummary"), - members={ - "name": { - "target": NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "routingConfiguration": { - "target": FLOW_ALIAS_ROUTING_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "concurrencyConfiguration": {"target": FLOW_ALIAS_CONCURRENCY_CONFIGURATION}, - "flowId": { - "target": FLOW_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "id": { - "target": FLOW_ALIAS_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "arn": { - "target": FLOW_ALIAS_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +PROMPT_SUMMARY: StaticSchema = ( + 18, + n0, + _PSr, + 0, + (_na, _d, _id, _ar, _ve, _cA, _uA), + ( + (PROMPT_NAME, 1), + (PROMPT_DESCRIPTION, 0), + (PROMPT_ID, 1), + (PROMPT_ARN, 1), + (VERSION, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + ), ) -FLOW_ALIAS_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#FlowAliasSummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": FLOW_ALIAS_SUMMARY}}, +PROMPT_SUMMARIES: StaticSchema = (16, n0, _PSro, 0, (_me,), ((PROMPT_SUMMARY, 0),)) + +LIST_PROMPTS_OUTPUT: StaticSchema = ( + 18, + n0, + _LPO, + {_sSI: _cLPRo, _smith: None}, + (_pSr, _nT), + ((PROMPT_SUMMARIES, 1), (NEXT_TOKEN, 0)), +) + +LIST_PROMPTS: StaticOperationSchema = ( + 23, + n0, + _LP, + {_smithy: MappingProxyType({"code": 200, "method": "GET", "uri": "/prompts/"})}, + LIST_PROMPTS_INPUT, + LIST_PROMPTS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -LIST_FLOW_ALIASES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ListFlowAliasesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#ListFlowAliasesResponse", - ) - ], - members={ - "flowAliasSummaries": { - "target": FLOW_ALIAS_SUMMARIES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": NEXT_TOKEN}, - }, +UPDATE_PROMPT_INPUT: StaticSchema = ( + 18, + n0, + _UPI, + {_sSI: _cUPR, _smit: None}, + (_na, _d, _cEKA, _dV, _var, _pI), + ( + (PROMPT_NAME, 1), + (PROMPT_DESCRIPTION, 0), + (KMS_KEY_ARN, 0), + (PROMPT_VARIANT_NAME, 0), + (PROMPT_VARIANT_LIST, 0), + (PROMPT_IDENTIFIER, 9), + ), ) -LIST_FLOW_ALIASES = Schema( - id=ShapeID("com.amazonaws.bedrockagent#ListFlowAliases"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "GET", "uri": "/flows/{flowIdentifier}/aliases"} - ), - ) - ], +UPDATE_PROMPT_OUTPUT: StaticSchema = ( + 18, + n0, + _UPO, + {_sSI: _cUPRo, _smith: None}, + (_na, _d, _cEKA, _dV, _var, _id, _ar, _ve, _cA, _uA), + ( + (PROMPT_NAME, 1), + (PROMPT_DESCRIPTION, 0), + (KMS_KEY_ARN, 0), + (PROMPT_VARIANT_NAME, 0), + (PROMPT_VARIANT_LIST, 0), + (PROMPT_ID, 1), + (PROMPT_ARN, 1), + (VERSION, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + ), ) -UPDATE_FLOW_ALIAS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#UpdateFlowAliasInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#UpdateFlowAliasRequest", - ) - ], - members={ - "name": { - "target": NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "routingConfiguration": { - "target": FLOW_ALIAS_ROUTING_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "concurrencyConfiguration": {"target": FLOW_ALIAS_CONCURRENCY_CONFIGURATION}, - "flowIdentifier": { - "target": FLOW_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "aliasIdentifier": { - "target": FLOW_ALIAS_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, +UPDATE_PROMPT: StaticOperationSchema = ( + 23, + n0, + _UPp, + { + _smithy: MappingProxyType( + {"code": 200, "method": "PUT", "uri": "/prompts/{promptIdentifier}/"} + ) + }, + UPDATE_PROMPT_INPUT, + UPDATE_PROMPT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -UPDATE_FLOW_ALIAS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#UpdateFlowAliasOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#UpdateFlowAliasResponse", - ) - ], - members={ - "name": { - "target": NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "routingConfiguration": { - "target": FLOW_ALIAS_ROUTING_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "concurrencyConfiguration": {"target": FLOW_ALIAS_CONCURRENCY_CONFIGURATION}, - "flowId": { - "target": FLOW_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "id": { - "target": FLOW_ALIAS_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "arn": { - "target": FLOW_ALIAS_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +PUT_RESOURCE_POLICY_INPUT: StaticSchema = ( + 18, + n0, + _PRPI, + {_sSI: _cPRPR, _smit: None}, + (_rAe, _pol, _eRI), + ((RESOURCE_ARN, 9), (RESOURCE_POLICY, 1), (REVISION_ID, 0)), +) + +PUT_RESOURCE_POLICY_OUTPUT: StaticSchema = ( + 18, + n0, + _PRPO, + {_sSI: _cPRPRo, _smith: None}, + (_rAe, _rI), + ((RESOURCE_ARN, 1), (REVISION_ID, 1)), +) + +PUT_RESOURCE_POLICY: StaticOperationSchema = ( + 23, + n0, + _PRP, + { + _smithy: MappingProxyType( + {"code": 200, "method": "PUT", "uri": "/resourcepolicy/{resourceArn}"} + ) + }, + PUT_RESOURCE_POLICY_INPUT, + PUT_RESOURCE_POLICY_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -UPDATE_FLOW_ALIAS = Schema( - id=ShapeID("com.amazonaws.bedrockagent#UpdateFlowAlias"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "PUT", - "uri": "/flows/{flowIdentifier}/aliases/{aliasIdentifier}", - } - ), - ) - ], -) +TAGGABLE_RESOURCES_ARN: StaticSchema = (3, n0, _TRA, 0) -CREATE_FLOW_VERSION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#CreateFlowVersionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#CreateFlowVersionRequest", - ) - ], - members={ - "flowIdentifier": { - "target": FLOW_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "description": {"target": FLOW_DESCRIPTION}, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - }, +LIST_TAGS_FOR_RESOURCE_INPUT: StaticSchema = ( + 18, + n0, + _LTFRI, + {_sSI: _cLTFRR, _smit: None}, + (_rAe,), + ((TAGGABLE_RESOURCES_ARN, 9),), ) -DELETE_FLOW_VERSION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#DeleteFlowVersionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#DeleteFlowVersionRequest", - ) - ], - members={ - "flowIdentifier": { - "target": FLOW_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "flowVersion": { - "target": NUMERICAL_VERSION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "skipResourceInUseCheck": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=False), - Trait.new( - id=ShapeID("smithy.api#httpQuery"), value="skipResourceInUseCheck" - ), - ], - }, - }, +LIST_TAGS_FOR_RESOURCE_OUTPUT: StaticSchema = ( + 18, + n0, + _LTFRO, + {_sSI: _cLTFRRo, _smith: None}, + (_ta,), + ((TAGS_MAP, 0),), ) -DELETE_FLOW_VERSION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#DeleteFlowVersionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#DeleteFlowVersionResponse", +LIST_TAGS_FOR_RESOURCE: StaticOperationSchema = ( + 23, + n0, + _LTFR, + { + _smithy: MappingProxyType( + {"code": 200, "method": "GET", "uri": "/tags/{resourceArn}"} ) - ], - members={ - "id": {"target": ID, "traits": [Trait.new(id=ShapeID("smithy.api#required"))]}, - "version": { - "target": NUMERICAL_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, }, + LIST_TAGS_FOR_RESOURCE_INPUT, + LIST_TAGS_FOR_RESOURCE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -DELETE_FLOW_VERSION = Schema( - id=ShapeID("com.amazonaws.bedrockagent#DeleteFlowVersion"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "DELETE", - "uri": "/flows/{flowIdentifier}/versions/{flowVersion}/", - } - ), - ) - ], -) - -INCLUDED_DATA = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#IncludedData"), - shape_type=ShapeType.ENUM, - members={"ALL_DATA": {"target": UNIT}, "METADATA_ONLY": {"target": UNIT}}, +TAG_RESOURCE_INPUT: StaticSchema = ( + 18, + n0, + _TRI, + {_sSI: _cTRR, _smit: None}, + (_rAe, _ta), + ((TAGGABLE_RESOURCES_ARN, 9), (TAGS_MAP, 1)), ) -GET_FLOW_VERSION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#GetFlowVersionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#GetFlowVersionRequest", - ) - ], - members={ - "flowIdentifier": { - "target": FLOW_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "flowVersion": { - "target": NUMERICAL_VERSION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "includedData": { - "target": INCLUDED_DATA, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="includedData") - ], - }, - }, -) +TAG_RESOURCE_OUTPUT: StaticSchema = (18, n0, _TRO, {_sSI: _cTRRo, _smith: None}) -LIST_FLOW_VERSIONS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ListFlowVersionsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#ListFlowVersionsRequest", +TAG_RESOURCE: StaticOperationSchema = ( + 23, + n0, + _TR, + { + _smithy: MappingProxyType( + {"code": 200, "method": "POST", "uri": "/tags/{resourceArn}"} ) - ], - members={ - "flowIdentifier": { - "target": FLOW_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - }, -) - -FLOW_VERSION_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#FlowVersionSummary"), - members={ - "id": { - "target": FLOW_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "arn": { - "target": FLOW_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": FLOW_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "version": { - "target": NUMERICAL_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, }, + TAG_RESOURCE_INPUT, + TAG_RESOURCE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -FLOW_VERSION_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#FlowVersionSummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": FLOW_VERSION_SUMMARY}}, -) +TAG_KEY_LIST: StaticSchema = (16, n0, _TKL, 0, (_me,), ((TAG_KEY, 0),)) -LIST_FLOW_VERSIONS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ListFlowVersionsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#ListFlowVersionsResponse", - ) - ], - members={ - "flowVersionSummaries": { - "target": FLOW_VERSION_SUMMARIES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": NEXT_TOKEN}, - }, +UNTAG_RESOURCE_INPUT: StaticSchema = ( + 18, + n0, + _URI, + {_sSI: _cURR, _smit: None}, + (_rAe, _tKa), + ((TAGGABLE_RESOURCES_ARN, 9), (TAG_KEY_LIST, {_sQ: _tKa, _smi: None})), ) -LIST_FLOW_VERSIONS = Schema( - id=ShapeID("com.amazonaws.bedrockagent#ListFlowVersions"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/flows/{flowIdentifier}/versions", - } - ), - ) - ], -) +UNTAG_RESOURCE_OUTPUT: StaticSchema = (18, n0, _URO, {_sSI: _cURRo, _smith: None}) -GET_FLOW_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#GetFlowInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#GetFlowRequest", +UNTAG_RESOURCE: StaticOperationSchema = ( + 23, + n0, + _UR, + { + _smithy: MappingProxyType( + {"code": 200, "method": "DELETE", "uri": "/tags/{resourceArn}"} ) - ], - members={ - "flowIdentifier": { - "target": FLOW_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "includedData": { - "target": INCLUDED_DATA, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="includedData") - ], - }, - }, -) - -CYCLIC_CONNECTION_FLOW_VALIDATION_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#CyclicConnectionFlowValidationDetails"), - members={ - "connection": { - "target": FLOW_CONNECTION_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } }, -) - -DUPLICATE_CONDITION_EXPRESSION_FLOW_VALIDATION_DETAILS = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagent#DuplicateConditionExpressionFlowValidationDetails" + UNTAG_RESOURCE_INPUT, + UNTAG_RESOURCE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, ), - members={ - "node": { - "target": FLOW_NODE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "expression": { - "target": FLOW_CONDITION_EXPRESSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -DUPLICATE_CONNECTIONS_FLOW_VALIDATION_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#DuplicateConnectionsFlowValidationDetails"), - members={ - "source": { - "target": FLOW_NODE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "target": { - "target": FLOW_NODE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, ) -INCOMPATIBLE_CONNECTION_DATA_TYPE_FLOW_VALIDATION_DETAILS = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagent#IncompatibleConnectionDataTypeFlowValidationDetails" +VALIDATE_FLOW_DEFINITION_OUTPUT: StaticSchema = ( + 18, + n0, + _VFDO, + {_sSI: _cVFDR, _smith: None}, + (_val,), + ((FLOW_VALIDATIONS, 1),), +) + +DELETE_AGENT_VERSION_INPUT: StaticSchema = ( + 18, + n0, + _DAVI, + {_sSI: _cDAVR, _smit: None}, + (_aI, _aV, _sRIUC), + ((ID, 9), (NUMERICAL_VERSION, 9), (2, {_smithya: False, _sQ: _sRIUC})), +) + +DELETE_AGENT_VERSION_OUTPUT: StaticSchema = ( + 18, + n0, + _DAVO, + {_sSI: _cDAVRo, _smith: None}, + (_aI, _aV, _aSg), + ((ID, 1), (NUMERICAL_VERSION, 1), (AGENT_STATUS, 1)), +) + +DELETE_AGENT_VERSION: StaticOperationSchema = ( + 23, + n0, + _DAV, + { + _smithy: MappingProxyType( + { + "code": 202, + "method": "DELETE", + "uri": "/agents/{agentId}/agentversions/{agentVersion}/", + } + ) + }, + DELETE_AGENT_VERSION_INPUT, + DELETE_AGENT_VERSION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, ), - members={ - "connection": { - "target": FLOW_CONNECTION_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, ) -INVALID_LOOP_BOUNDARY_FLOW_VALIDATION_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#InvalidLoopBoundaryFlowValidationDetails"), - members={ - "connection": { - "target": FLOW_CONNECTION_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "source": { - "target": FLOW_NODE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "target": { - "target": FLOW_NODE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +GET_AGENT_VERSION_INPUT: StaticSchema = ( + 18, + n0, + _GAVI, + {_sSI: _cGAVR, _smit: None}, + (_aI, _aV), + ((ID, 9), (NUMERICAL_VERSION, 9)), +) + +GET_AGENT_VERSION_OUTPUT: StaticSchema = ( + 18, + n0, + _GAVO, + {_sSI: _cGAVRo, _smith: None}, + (_aV,), + ((AGENT_VERSION, 1),), +) + +GET_AGENT_VERSION: StaticOperationSchema = ( + 23, + n0, + _GAV, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "GET", + "uri": "/agents/{agentId}/agentversions/{agentVersion}/", + } + ) + }, + GET_AGENT_VERSION_INPUT, + GET_AGENT_VERSION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -INCOMPATIBLE_LOOP_NODE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#IncompatibleLoopNodeType"), - shape_type=ShapeType.ENUM, - members={ - "INPUT": {"target": UNIT}, - "CONDITION": {"target": UNIT}, - "ITERATOR": {"target": UNIT}, - "COLLECTOR": {"target": UNIT}, - }, +LIST_AGENT_VERSIONS_INPUT: StaticSchema = ( + 18, + n0, + _LAVI, + {_sSI: _cLAVR, _smit: None}, + (_aI, _mR, _nT), + ((ID, 9), (MAX_RESULTS, 0), (NEXT_TOKEN, 0)), +) + +LIST_AGENT_VERSIONS_OUTPUT: StaticSchema = ( + 18, + n0, + _LAVO, + {_sSI: _cLAVRo, _smith: None}, + (_aVS, _nT), + ((AGENT_VERSION_SUMMARIES, 1), (NEXT_TOKEN, 0)), +) + +LIST_AGENT_VERSIONS: StaticOperationSchema = ( + 23, + n0, + _LAV, + { + _smithy: MappingProxyType( + {"code": 200, "method": "POST", "uri": "/agents/{agentId}/agentversions/"} + ) + }, + LIST_AGENT_VERSIONS_INPUT, + LIST_AGENT_VERSIONS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -LOOP_INCOMPATIBLE_NODE_TYPE_FLOW_VALIDATION_DETAILS = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagent#LoopIncompatibleNodeTypeFlowValidationDetails" - ), - members={ - "node": { - "target": FLOW_NODE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "incompatibleNodeType": { - "target": INCOMPATIBLE_LOOP_NODE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "incompatibleNodeName": { - "target": FLOW_NODE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +FLOW_DEFINITION: StaticSchema = ( + 18, + n0, + _FDlo, + 4, + (_nod, _conne), + ((lambda: FLOW_NODES, 0), (FLOW_CONNECTIONS, 0)), +) + +FLOW_NODE: StaticSchema = ( + 18, + n0, + _FNl, + 0, + (_na, _t, _conf, _inpu, _out), + ( + (FLOW_NODE_NAME, 1), + (FLOW_NODE_TYPE, 1), + (lambda: FLOW_NODE_CONFIGURATION, 0), + (FLOW_NODE_INPUTS, 0), + (FLOW_NODE_OUTPUTS, 0), + ), ) -ERROR_MESSAGE = Schema( - id=ShapeID("com.amazonaws.bedrockagent#ErrorMessage"), shape_type=ShapeType.STRING +FLOW_NODE_CONFIGURATION: StaticSchema = ( + 19, + n0, + _FNC, + 0, + ( + _inp, + _ou, + _kB, + _co, + _le, + _pro, + _lF, + _sto, + _ag, + _ret, + _ite, + _coll, + _iCnli, + _lo, + _lIo, + _lCo, + ), + ( + (INPUT_FLOW_NODE_CONFIGURATION, 0), + (OUTPUT_FLOW_NODE_CONFIGURATION, 0), + (KNOWLEDGE_BASE_FLOW_NODE_CONFIGURATION, 0), + (CONDITION_FLOW_NODE_CONFIGURATION, 0), + (LEX_FLOW_NODE_CONFIGURATION, 0), + (PROMPT_FLOW_NODE_CONFIGURATION, 0), + (LAMBDA_FUNCTION_FLOW_NODE_CONFIGURATION, 0), + (STORAGE_FLOW_NODE_CONFIGURATION, 0), + (AGENT_FLOW_NODE_CONFIGURATION, 0), + (RETRIEVAL_FLOW_NODE_CONFIGURATION, 0), + (ITERATOR_FLOW_NODE_CONFIGURATION, 0), + (COLLECTOR_FLOW_NODE_CONFIGURATION, 0), + (INLINE_CODE_FLOW_NODE_CONFIGURATION, 0), + (lambda: LOOP_FLOW_NODE_CONFIGURATION, 0), + (LOOP_INPUT_FLOW_NODE_CONFIGURATION, 0), + (LOOP_CONTROLLER_FLOW_NODE_CONFIGURATION, 0), + ), ) -MALFORMED_CONDITION_EXPRESSION_FLOW_VALIDATION_DETAILS = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagent#MalformedConditionExpressionFlowValidationDetails" +FLOW_NODES: StaticSchema = (16, n0, _FNlo, 0, (_me,), ((FLOW_NODE, 0),)) + +LOOP_FLOW_NODE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _LFNCo, + 0, + (_def,), + ((FLOW_DEFINITION, 1),), +) + +CREATE_FLOW_INPUT: StaticSchema = ( + 18, + n0, + _CFI, + {_sSI: _cCFR, _smit: None}, + (_na, _d, _eRA, _cEKA, _def, _cT, _ta), + ( + (FLOW_NAME, 1), + (FLOW_DESCRIPTION, 0), + (FLOW_EXECUTION_ROLE_ARN, 1), + (KMS_KEY_ARN, 0), + (FLOW_DEFINITION, 0), + (CLIENT_TOKEN, 2), + (TAGS_MAP, 0), ), - members={ - "node": { - "target": FLOW_NODE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "condition": { - "target": FLOW_CONDITION_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "cause": { - "target": ERROR_MESSAGE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, ) -MALFORMED_NODE_INPUT_EXPRESSION_FLOW_VALIDATION_DETAILS = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagent#MalformedNodeInputExpressionFlowValidationDetails" - ), - members={ - "node": { - "target": FLOW_NODE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "input": { - "target": FLOW_NODE_INPUT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "cause": { - "target": ERROR_MESSAGE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +CREATE_FLOW_OUTPUT: StaticSchema = ( + 18, + n0, + _CFO, + {_sSI: _cCFRo, _smith: None}, + (_na, _d, _eRA, _cEKA, _id, _ar, _sta, _cA, _uA, _ve, _def), + ( + (FLOW_NAME, 1), + (FLOW_DESCRIPTION, 0), + (FLOW_EXECUTION_ROLE_ARN, 1), + (KMS_KEY_ARN, 0), + (FLOW_ID, 1), + (FLOW_ARN, 1), + (FLOW_STATUS, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (DRAFT_VERSION, 1), + (FLOW_DEFINITION, 0), + ), ) -MISMATCHED_NODE_INPUT_TYPE_FLOW_VALIDATION_DETAILS = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagent#MismatchedNodeInputTypeFlowValidationDetails" - ), - members={ - "node": { - "target": FLOW_NODE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "input": { - "target": FLOW_NODE_INPUT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "expectedType": { - "target": FLOW_NODE_IO_DATA_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +CREATE_FLOW_VERSION_OUTPUT: StaticSchema = ( + 18, + n0, + _CFVO, + {_sSI: _cCFVRo, _smith: None}, + (_na, _d, _eRA, _cEKA, _id, _ar, _sta, _cA, _ve, _def), + ( + (FLOW_NAME, 1), + (FLOW_DESCRIPTION, 0), + (FLOW_EXECUTION_ROLE_ARN, 1), + (KMS_KEY_ARN, 0), + (FLOW_ID, 1), + (FLOW_ARN, 1), + (FLOW_STATUS, 1), + (DATE_TIMESTAMP, 1), + (NUMERICAL_VERSION, 1), + (FLOW_DEFINITION, 0), + ), ) -MISMATCHED_NODE_OUTPUT_TYPE_FLOW_VALIDATION_DETAILS = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagent#MismatchedNodeOutputTypeFlowValidationDetails" - ), - members={ - "node": { - "target": FLOW_NODE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "output": { - "target": FLOW_NODE_OUTPUT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "expectedType": { - "target": FLOW_NODE_IO_DATA_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +GET_FLOW_OUTPUT: StaticSchema = ( + 18, + n0, + _GFO, + {_sSI: _cGFRo, _smith: None}, + (_na, _d, _eRA, _cEKA, _id, _ar, _sta, _cA, _uA, _ve, _def, _val), + ( + (FLOW_NAME, 1), + (FLOW_DESCRIPTION, 0), + (FLOW_EXECUTION_ROLE_ARN, 1), + (KMS_KEY_ARN, 0), + (FLOW_ID, 1), + (FLOW_ARN, 1), + (FLOW_STATUS, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (DRAFT_VERSION, 1), + (FLOW_DEFINITION, 0), + (FLOW_VALIDATIONS, 0), + ), ) -MISSING_CONNECTION_CONFIGURATION_FLOW_VALIDATION_DETAILS = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagent#MissingConnectionConfigurationFlowValidationDetails" +GET_FLOW_VERSION_OUTPUT: StaticSchema = ( + 18, + n0, + _GFVO, + {_sSI: _cGFVRo, _smith: None}, + (_na, _d, _eRA, _cEKA, _id, _ar, _sta, _cA, _ve, _def), + ( + (FLOW_NAME, 1), + (FLOW_DESCRIPTION, 0), + (FLOW_EXECUTION_ROLE_ARN, 1), + (KMS_KEY_ARN, 0), + (FLOW_ID, 1), + (FLOW_ARN, 1), + (FLOW_STATUS, 1), + (DATE_TIMESTAMP, 1), + (NUMERICAL_VERSION, 1), + (FLOW_DEFINITION, 0), ), - members={ - "connection": { - "target": FLOW_CONNECTION_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, ) -MISSING_DEFAULT_CONDITION_FLOW_VALIDATION_DETAILS = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagent#MissingDefaultConditionFlowValidationDetails" +UPDATE_FLOW_INPUT: StaticSchema = ( + 18, + n0, + _UFI, + {_sSI: _cUFR, _smit: None}, + (_na, _d, _eRA, _cEKA, _def, _fI), + ( + (FLOW_NAME, 1), + (FLOW_DESCRIPTION, 0), + (FLOW_EXECUTION_ROLE_ARN, 1), + (KMS_KEY_ARN, 0), + (FLOW_DEFINITION, 0), + (FLOW_IDENTIFIER, 9), ), - members={ - "node": { - "target": FLOW_NODE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, ) -MISSING_ENDING_NODES_FLOW_VALIDATION_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#MissingEndingNodesFlowValidationDetails") +UPDATE_FLOW_OUTPUT: StaticSchema = ( + 18, + n0, + _UFO, + {_sSI: _cUFRo, _smith: None}, + (_na, _d, _eRA, _cEKA, _id, _ar, _sta, _cA, _uA, _ve, _def), + ( + (FLOW_NAME, 1), + (FLOW_DESCRIPTION, 0), + (FLOW_EXECUTION_ROLE_ARN, 1), + (KMS_KEY_ARN, 0), + (FLOW_ID, 1), + (FLOW_ARN, 1), + (FLOW_STATUS, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (DRAFT_VERSION, 1), + (FLOW_DEFINITION, 0), + ), ) -MISSING_LOOP_CONTROLLER_NODE_FLOW_VALIDATION_DETAILS = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagent#MissingLoopControllerNodeFlowValidationDetails" +VALIDATE_FLOW_DEFINITION_INPUT: StaticSchema = ( + 18, + n0, + _VFDI, + {_sSI: _cVFDRo, _smit: None}, + (_def,), + ((FLOW_DEFINITION, 1),), +) + +CREATE_FLOW_VERSION: StaticOperationSchema = ( + 23, + n0, + _CFV, + { + _smithy: MappingProxyType( + {"code": 201, "method": "POST", "uri": "/flows/{flowIdentifier}/versions"} + ) + }, + CREATE_FLOW_VERSION_INPUT, + CREATE_FLOW_VERSION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, ), - members={ - "loopNode": { - "target": FLOW_NODE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, ) -MISSING_LOOP_INPUT_NODE_FLOW_VALIDATION_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#MissingLoopInputNodeFlowValidationDetails"), - members={ - "loopNode": { - "target": FLOW_NODE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } +GET_FLOW: StaticOperationSchema = ( + 23, + n0, + _GF, + { + _smithy: MappingProxyType( + {"code": 200, "method": "GET", "uri": "/flows/{flowIdentifier}/"} + ) }, -) - -MISSING_NODE_CONFIGURATION_FLOW_VALIDATION_DETAILS = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagent#MissingNodeConfigurationFlowValidationDetails" + GET_FLOW_INPUT, + GET_FLOW_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, ), - members={ - "node": { - "target": FLOW_NODE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, ) -MISSING_NODE_INPUT_FLOW_VALIDATION_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#MissingNodeInputFlowValidationDetails"), - members={ - "node": { - "target": FLOW_NODE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "input": { - "target": FLOW_NODE_INPUT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +GET_FLOW_VERSION: StaticOperationSchema = ( + 23, + n0, + _GFV, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "GET", + "uri": "/flows/{flowIdentifier}/versions/{flowVersion}/", + } + ) + }, + GET_FLOW_VERSION_INPUT, + GET_FLOW_VERSION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -MISSING_NODE_OUTPUT_FLOW_VALIDATION_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#MissingNodeOutputFlowValidationDetails"), - members={ - "node": { - "target": FLOW_NODE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "output": { - "target": FLOW_NODE_OUTPUT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, +VALIDATE_FLOW_DEFINITION: StaticOperationSchema = ( + 23, + n0, + _VFD, + { + _smithy: MappingProxyType( + {"code": 200, "method": "POST", "uri": "/flows/validate-definition"} + ) }, -) - -MISSING_STARTING_NODES_FLOW_VALIDATION_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#MissingStartingNodesFlowValidationDetails") -) - -MULTIPLE_LOOP_CONTROLLER_NODES_FLOW_VALIDATION_DETAILS = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagent#MultipleLoopControllerNodesFlowValidationDetails" + VALIDATE_FLOW_DEFINITION_INPUT, + VALIDATE_FLOW_DEFINITION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, ), - members={ - "loopNode": { - "target": FLOW_NODE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, ) -MULTIPLE_LOOP_INPUT_NODES_FLOW_VALIDATION_DETAILS = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagent#MultipleLoopInputNodesFlowValidationDetails" +CREATE_FLOW: StaticOperationSchema = ( + 23, + n0, + _CFr, + {_smithy: MappingProxyType({"code": 201, "method": "POST", "uri": "/flows/"})}, + CREATE_FLOW_INPUT, + CREATE_FLOW_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, ), - members={ - "loopNode": { - "target": FLOW_NODE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, ) -MULTIPLE_NODE_INPUT_CONNECTIONS_FLOW_VALIDATION_DETAILS = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagent#MultipleNodeInputConnectionsFlowValidationDetails" +UPDATE_FLOW: StaticOperationSchema = ( + 23, + n0, + _UF, + { + _smithy: MappingProxyType( + {"code": 200, "method": "PUT", "uri": "/flows/{flowIdentifier}/"} + ) + }, + UPDATE_FLOW_INPUT, + UPDATE_FLOW_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, ), - members={ - "node": { - "target": FLOW_NODE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "input": { - "target": FLOW_NODE_INPUT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, ) -UNFULFILLED_NODE_INPUT_FLOW_VALIDATION_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#UnfulfilledNodeInputFlowValidationDetails"), - members={ - "node": { - "target": FLOW_NODE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "input": { - "target": FLOW_NODE_INPUT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -UNKNOWN_CONNECTION_CONDITION_FLOW_VALIDATION_DETAILS = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagent#UnknownConnectionConditionFlowValidationDetails" - ), - members={ - "connection": { - "target": FLOW_CONNECTION_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -UNKNOWN_CONNECTION_SOURCE_FLOW_VALIDATION_DETAILS = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagent#UnknownConnectionSourceFlowValidationDetails" - ), - members={ - "connection": { - "target": FLOW_CONNECTION_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -UNKNOWN_CONNECTION_SOURCE_OUTPUT_FLOW_VALIDATION_DETAILS = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagent#UnknownConnectionSourceOutputFlowValidationDetails" - ), - members={ - "connection": { - "target": FLOW_CONNECTION_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -UNKNOWN_CONNECTION_TARGET_FLOW_VALIDATION_DETAILS = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagent#UnknownConnectionTargetFlowValidationDetails" - ), - members={ - "connection": { - "target": FLOW_CONNECTION_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -UNKNOWN_CONNECTION_TARGET_INPUT_FLOW_VALIDATION_DETAILS = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagent#UnknownConnectionTargetInputFlowValidationDetails" - ), - members={ - "connection": { - "target": FLOW_CONNECTION_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -UNKNOWN_NODE_INPUT_FLOW_VALIDATION_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#UnknownNodeInputFlowValidationDetails"), - members={ - "node": { - "target": FLOW_NODE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "input": { - "target": FLOW_NODE_INPUT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -UNKNOWN_NODE_OUTPUT_FLOW_VALIDATION_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#UnknownNodeOutputFlowValidationDetails"), - members={ - "node": { - "target": FLOW_NODE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "output": { - "target": FLOW_NODE_OUTPUT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -UNREACHABLE_NODE_FLOW_VALIDATION_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#UnreachableNodeFlowValidationDetails"), - members={ - "node": { - "target": FLOW_NODE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -UNSATISFIED_CONNECTION_CONDITIONS_FLOW_VALIDATION_DETAILS = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagent#UnsatisfiedConnectionConditionsFlowValidationDetails" - ), - members={ - "connection": { - "target": FLOW_CONNECTION_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -UNSPECIFIED_FLOW_VALIDATION_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#UnspecifiedFlowValidationDetails") -) - -FLOW_VALIDATION_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#FlowValidationDetails"), - shape_type=ShapeType.UNION, - members={ - "cyclicConnection": {"target": CYCLIC_CONNECTION_FLOW_VALIDATION_DETAILS}, - "duplicateConnections": { - "target": DUPLICATE_CONNECTIONS_FLOW_VALIDATION_DETAILS - }, - "duplicateConditionExpression": { - "target": DUPLICATE_CONDITION_EXPRESSION_FLOW_VALIDATION_DETAILS - }, - "unreachableNode": {"target": UNREACHABLE_NODE_FLOW_VALIDATION_DETAILS}, - "unknownConnectionSource": { - "target": UNKNOWN_CONNECTION_SOURCE_FLOW_VALIDATION_DETAILS - }, - "unknownConnectionSourceOutput": { - "target": UNKNOWN_CONNECTION_SOURCE_OUTPUT_FLOW_VALIDATION_DETAILS - }, - "unknownConnectionTarget": { - "target": UNKNOWN_CONNECTION_TARGET_FLOW_VALIDATION_DETAILS - }, - "unknownConnectionTargetInput": { - "target": UNKNOWN_CONNECTION_TARGET_INPUT_FLOW_VALIDATION_DETAILS - }, - "unknownConnectionCondition": { - "target": UNKNOWN_CONNECTION_CONDITION_FLOW_VALIDATION_DETAILS - }, - "malformedConditionExpression": { - "target": MALFORMED_CONDITION_EXPRESSION_FLOW_VALIDATION_DETAILS - }, - "malformedNodeInputExpression": { - "target": MALFORMED_NODE_INPUT_EXPRESSION_FLOW_VALIDATION_DETAILS - }, - "mismatchedNodeInputType": { - "target": MISMATCHED_NODE_INPUT_TYPE_FLOW_VALIDATION_DETAILS - }, - "mismatchedNodeOutputType": { - "target": MISMATCHED_NODE_OUTPUT_TYPE_FLOW_VALIDATION_DETAILS - }, - "incompatibleConnectionDataType": { - "target": INCOMPATIBLE_CONNECTION_DATA_TYPE_FLOW_VALIDATION_DETAILS - }, - "missingConnectionConfiguration": { - "target": MISSING_CONNECTION_CONFIGURATION_FLOW_VALIDATION_DETAILS - }, - "missingDefaultCondition": { - "target": MISSING_DEFAULT_CONDITION_FLOW_VALIDATION_DETAILS - }, - "missingEndingNodes": {"target": MISSING_ENDING_NODES_FLOW_VALIDATION_DETAILS}, - "missingNodeConfiguration": { - "target": MISSING_NODE_CONFIGURATION_FLOW_VALIDATION_DETAILS - }, - "missingNodeInput": {"target": MISSING_NODE_INPUT_FLOW_VALIDATION_DETAILS}, - "missingNodeOutput": {"target": MISSING_NODE_OUTPUT_FLOW_VALIDATION_DETAILS}, - "missingStartingNodes": { - "target": MISSING_STARTING_NODES_FLOW_VALIDATION_DETAILS - }, - "multipleNodeInputConnections": { - "target": MULTIPLE_NODE_INPUT_CONNECTIONS_FLOW_VALIDATION_DETAILS - }, - "unfulfilledNodeInput": { - "target": UNFULFILLED_NODE_INPUT_FLOW_VALIDATION_DETAILS - }, - "unsatisfiedConnectionConditions": { - "target": UNSATISFIED_CONNECTION_CONDITIONS_FLOW_VALIDATION_DETAILS - }, - "unspecified": {"target": UNSPECIFIED_FLOW_VALIDATION_DETAILS}, - "unknownNodeInput": {"target": UNKNOWN_NODE_INPUT_FLOW_VALIDATION_DETAILS}, - "unknownNodeOutput": {"target": UNKNOWN_NODE_OUTPUT_FLOW_VALIDATION_DETAILS}, - "missingLoopInputNode": { - "target": MISSING_LOOP_INPUT_NODE_FLOW_VALIDATION_DETAILS - }, - "missingLoopControllerNode": { - "target": MISSING_LOOP_CONTROLLER_NODE_FLOW_VALIDATION_DETAILS - }, - "multipleLoopInputNodes": { - "target": MULTIPLE_LOOP_INPUT_NODES_FLOW_VALIDATION_DETAILS - }, - "multipleLoopControllerNodes": { - "target": MULTIPLE_LOOP_CONTROLLER_NODES_FLOW_VALIDATION_DETAILS - }, - "loopIncompatibleNodeType": { - "target": LOOP_INCOMPATIBLE_NODE_TYPE_FLOW_VALIDATION_DETAILS - }, - "invalidLoopBoundary": { - "target": INVALID_LOOP_BOUNDARY_FLOW_VALIDATION_DETAILS - }, - }, -) - -FLOW_VALIDATION_SEVERITY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#FlowValidationSeverity"), - shape_type=ShapeType.ENUM, - members={"WARNING": {"target": UNIT}, "ERROR": {"target": UNIT}}, -) - -FLOW_VALIDATION_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#FlowValidationType"), - shape_type=ShapeType.ENUM, - members={ - "CYCLIC_CONNECTION": {"target": UNIT}, - "DUPLICATE_CONNECTIONS": {"target": UNIT}, - "DUPLICATE_CONDITION_EXPRESSION": {"target": UNIT}, - "UNREACHABLE_NODE": {"target": UNIT}, - "UNKNOWN_CONNECTION_SOURCE": {"target": UNIT}, - "UNKNOWN_CONNECTION_SOURCE_OUTPUT": {"target": UNIT}, - "UNKNOWN_CONNECTION_TARGET": {"target": UNIT}, - "UNKNOWN_CONNECTION_TARGET_INPUT": {"target": UNIT}, - "UNKNOWN_CONNECTION_CONDITION": {"target": UNIT}, - "MALFORMED_CONDITION_EXPRESSION": {"target": UNIT}, - "MALFORMED_NODE_INPUT_EXPRESSION": {"target": UNIT}, - "MISMATCHED_NODE_INPUT_TYPE": {"target": UNIT}, - "MISMATCHED_NODE_OUTPUT_TYPE": {"target": UNIT}, - "INCOMPATIBLE_CONNECTION_DATA_TYPE": {"target": UNIT}, - "MISSING_CONNECTION_CONFIGURATION": {"target": UNIT}, - "MISSING_DEFAULT_CONDITION": {"target": UNIT}, - "MISSING_ENDING_NODES": {"target": UNIT}, - "MISSING_NODE_CONFIGURATION": {"target": UNIT}, - "MISSING_NODE_INPUT": {"target": UNIT}, - "MISSING_NODE_OUTPUT": {"target": UNIT}, - "MISSING_STARTING_NODES": {"target": UNIT}, - "MULTIPLE_NODE_INPUT_CONNECTIONS": {"target": UNIT}, - "UNFULFILLED_NODE_INPUT": {"target": UNIT}, - "UNSATISFIED_CONNECTION_CONDITIONS": {"target": UNIT}, - "UNSPECIFIED": {"target": UNIT}, - "UNKNOWN_NODE_INPUT": {"target": UNIT}, - "UNKNOWN_NODE_OUTPUT": {"target": UNIT}, - "MISSING_LOOP_INPUT_NODE": {"target": UNIT}, - "MISSING_LOOP_CONTROLLER_NODE": {"target": UNIT}, - "MULTIPLE_LOOP_INPUT_NODES": {"target": UNIT}, - "MULTIPLE_LOOP_CONTROLLER_NODES": {"target": UNIT}, - "LOOP_INCOMPATIBLE_NODE_TYPE": {"target": UNIT}, - "INVALID_LOOP_BOUNDARY": {"target": UNIT}, - }, -) - -FLOW_VALIDATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#FlowValidation"), - members={ - "message": { - "target": NON_BLANK_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "severity": { - "target": FLOW_VALIDATION_SEVERITY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "details": {"target": FLOW_VALIDATION_DETAILS}, - "type": {"target": FLOW_VALIDATION_TYPE}, - }, -) - -FLOW_VALIDATIONS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#FlowValidations"), - shape_type=ShapeType.LIST, - members={"member": {"target": FLOW_VALIDATION}}, -) - -LIST_FLOWS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ListFlowsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#ListFlowsRequest", - ) - ], - members={ - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - }, -) - -FLOW_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#FlowSummary"), - members={ - "name": { - "target": FLOW_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": FLOW_DESCRIPTION}, - "id": { - "target": FLOW_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "arn": { - "target": FLOW_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": FLOW_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "version": { - "target": DRAFT_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -FLOW_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#FlowSummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": FLOW_SUMMARY}}, -) - -LIST_FLOWS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ListFlowsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#ListFlowsResponse", - ) - ], - members={ - "flowSummaries": { - "target": FLOW_SUMMARIES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": NEXT_TOKEN}, - }, -) - -LIST_FLOWS = Schema( - id=ShapeID("com.amazonaws.bedrockagent#ListFlows"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType({"code": 200, "method": "GET", "uri": "/flows/"}), - ) - ], -) - -PREPARE_FLOW_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#PrepareFlowInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#PrepareFlowRequest", - ) - ], - members={ - "flowIdentifier": { - "target": FLOW_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -PREPARE_FLOW_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#PrepareFlowOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#PrepareFlowResponse", - ) - ], - members={ - "id": { - "target": FLOW_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": FLOW_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -PREPARE_FLOW = Schema( - id=ShapeID("com.amazonaws.bedrockagent#PrepareFlow"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 202, "method": "POST", "uri": "/flows/{flowIdentifier}/"} - ), - ) - ], -) - -GET_RESOURCE_POLICY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#GetResourcePolicyInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#GetResourcePolicyRequest", - ) - ], - members={ - "resourceArn": { - "target": RESOURCE_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -RESOURCE_POLICY = Schema( - id=ShapeID("com.amazonaws.bedrockagent#ResourcePolicy"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#mediaType"), value="application/json")], -) - -GET_RESOURCE_POLICY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#GetResourcePolicyOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#GetResourcePolicyResponse", - ) - ], - members={ - "resourceArn": { - "target": RESOURCE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "policy": { - "target": RESOURCE_POLICY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "revisionId": { - "target": REVISION_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -GET_RESOURCE_POLICY = Schema( - id=ShapeID("com.amazonaws.bedrockagent#GetResourcePolicy"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "GET", "uri": "/resourcepolicy/{resourceArn}"} - ), - ) - ], -) - -GET_VPC_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#GetVpcConfigurationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#GetVpcConfigurationRequest", - ) - ], - members={ - "knowledgeBaseId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "vpcConfigurationId": { - "target": VPC_CONFIGURATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -VPC_CONFIGURATION_STATUS_MESSAGE = Schema( - id=ShapeID("com.amazonaws.bedrockagent#VpcConfigurationStatusMessage"), - shape_type=ShapeType.STRING, -) - -VPC_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#VpcConfiguration"), - members={ - "vpcConfigurationId": { - "target": VPC_CONFIGURATION_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": VPC_CONFIGURATION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "statusMessage": {"target": VPC_CONFIGURATION_STATUS_MESSAGE}, - "vpcId": { - "target": VPC_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "subnetIds": { - "target": SUBNET_ID_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "resourceTarget": { - "target": RESOURCE_TARGET, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "port": { - "target": PORT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "protocol": { - "target": VPC_PROTOCOL, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "resolutionMode": { - "target": VPC_RESOLUTION_MODE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "hostHeader": {"target": HOST_HEADER}, - "tlsServerName": {"target": TLS_SERVER_NAME}, - "name": {"target": VPC_CONFIGURATION_NAME}, - "description": {"target": VPC_CONFIGURATION_DESCRIPTION}, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -GET_VPC_CONFIGURATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#GetVpcConfigurationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#GetVpcConfigurationResponse", - ) - ], - members={ - "vpcConfiguration": { - "target": VPC_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -GET_VPC_CONFIGURATION = Schema( - id=ShapeID("com.amazonaws.bedrockagent#GetVpcConfiguration"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/knowledgebases/{knowledgeBaseId}/vpcconfigurations/{vpcConfigurationId}", - } - ), - ) - ], -) - -GET_INGESTION_JOB_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#GetIngestionJobInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#GetIngestionJobRequest", - ) - ], - members={ - "knowledgeBaseId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "dataSourceId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "ingestionJobId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -INGESTION_JOB_STATISTICS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#IngestionJobStatistics"), - members={ - "numberOfDocumentsScanned": { - "target": PRIMITIVE_LONG, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "numberOfMetadataDocumentsScanned": { - "target": PRIMITIVE_LONG, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "numberOfNewDocumentsIndexed": { - "target": PRIMITIVE_LONG, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "numberOfModifiedDocumentsIndexed": { - "target": PRIMITIVE_LONG, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "numberOfMetadataDocumentsModified": { - "target": PRIMITIVE_LONG, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "numberOfDocumentsDeleted": { - "target": PRIMITIVE_LONG, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "numberOfDocumentsFailed": { - "target": PRIMITIVE_LONG, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "numberOfDocumentsSkipped": { - "target": PRIMITIVE_LONG, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - }, -) - -INGESTION_JOB_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#IngestionJobStatus"), - shape_type=ShapeType.ENUM, - members={ - "STARTING": {"target": UNIT}, - "IN_PROGRESS": {"target": UNIT}, - "COMPLETE": {"target": UNIT}, - "FAILED": {"target": UNIT}, - "STOPPING": {"target": UNIT}, - "STOPPED": {"target": UNIT}, - }, -) - -INGESTION_JOB = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#IngestionJob"), - members={ - "knowledgeBaseId": { - "target": ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "dataSourceId": { - "target": ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ingestionJobId": { - "target": ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "status": { - "target": INGESTION_JOB_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "statistics": {"target": INGESTION_JOB_STATISTICS}, - "failureReasons": {"target": FAILURE_REASONS}, - "startedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "textReadyAt": {"target": DATE_TIMESTAMP}, - }, -) - -GET_INGESTION_JOB_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#GetIngestionJobOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#GetIngestionJobResponse", - ) - ], - members={ - "ingestionJob": { - "target": INGESTION_JOB, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -GET_INGESTION_JOB = Schema( - id=ShapeID("com.amazonaws.bedrockagent#GetIngestionJob"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/ingestionjobs/{ingestionJobId}", - } - ), - ) - ], -) - -INGESTION_JOB_FILTER_ATTRIBUTE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#IngestionJobFilterAttribute"), - shape_type=ShapeType.ENUM, - members={"STATUS": {"target": UNIT}}, -) - -INGESTION_JOB_FILTER_OPERATOR = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#IngestionJobFilterOperator"), - shape_type=ShapeType.ENUM, - members={"EQ": {"target": UNIT}}, -) - -INGESTION_JOB_FILTER_VALUE = Schema( - id=ShapeID("com.amazonaws.bedrockagent#IngestionJobFilterValue"), - shape_type=ShapeType.STRING, -) - -INGESTION_JOB_FILTER_VALUES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#IngestionJobFilterValues"), - shape_type=ShapeType.LIST, - members={"member": {"target": INGESTION_JOB_FILTER_VALUE}}, -) - -INGESTION_JOB_FILTER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#IngestionJobFilter"), - members={ - "attribute": { - "target": INGESTION_JOB_FILTER_ATTRIBUTE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "operator": { - "target": INGESTION_JOB_FILTER_OPERATOR, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "values": { - "target": INGESTION_JOB_FILTER_VALUES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -INGESTION_JOB_FILTERS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#IngestionJobFilters"), - shape_type=ShapeType.LIST, - members={"member": {"target": INGESTION_JOB_FILTER}}, -) - -INGESTION_JOB_SORT_BY_ATTRIBUTE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#IngestionJobSortByAttribute"), - shape_type=ShapeType.ENUM, - members={"STATUS": {"target": UNIT}, "STARTED_AT": {"target": UNIT}}, -) - -SORT_ORDER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#SortOrder"), - shape_type=ShapeType.ENUM, - members={"ASCENDING": {"target": UNIT}, "DESCENDING": {"target": UNIT}}, -) - -INGESTION_JOB_SORT_BY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#IngestionJobSortBy"), - members={ - "attribute": { - "target": INGESTION_JOB_SORT_BY_ATTRIBUTE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "order": { - "target": SORT_ORDER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -LIST_INGESTION_JOBS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ListIngestionJobsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#ListIngestionJobsRequest", - ) - ], - members={ - "knowledgeBaseId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "dataSourceId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "filters": {"target": INGESTION_JOB_FILTERS}, - "sortBy": {"target": INGESTION_JOB_SORT_BY}, - "maxResults": {"target": MAX_RESULTS}, - "nextToken": {"target": NEXT_TOKEN}, - }, -) - -INGESTION_JOB_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#IngestionJobSummary"), - members={ - "knowledgeBaseId": { - "target": ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "dataSourceId": { - "target": ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ingestionJobId": { - "target": ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "status": { - "target": INGESTION_JOB_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "startedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "textReadyAt": {"target": DATE_TIMESTAMP}, - "statistics": {"target": INGESTION_JOB_STATISTICS}, - }, -) - -INGESTION_JOB_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#IngestionJobSummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": INGESTION_JOB_SUMMARY}}, -) - -LIST_INGESTION_JOBS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ListIngestionJobsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#ListIngestionJobsResponse", - ) - ], - members={ - "ingestionJobSummaries": { - "target": INGESTION_JOB_SUMMARIES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": NEXT_TOKEN}, - }, -) - -LIST_INGESTION_JOBS = Schema( - id=ShapeID("com.amazonaws.bedrockagent#ListIngestionJobs"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "POST", - "uri": "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/ingestionjobs/", - } - ), - ) - ], -) - -START_INGESTION_JOB_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#StartIngestionJobInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#StartIngestionJobRequest", - ) - ], - members={ - "knowledgeBaseId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "dataSourceId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "description": {"target": DESCRIPTION}, - }, -) - -START_INGESTION_JOB_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#StartIngestionJobOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#StartIngestionJobResponse", - ) - ], - members={ - "ingestionJob": { - "target": INGESTION_JOB, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -START_INGESTION_JOB = Schema( - id=ShapeID("com.amazonaws.bedrockagent#StartIngestionJob"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 202, - "method": "PUT", - "uri": "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/ingestionjobs/", - } - ), - ) - ], -) - -STOP_INGESTION_JOB_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#StopIngestionJobInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#StopIngestionJobRequest", - ) - ], - members={ - "knowledgeBaseId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "dataSourceId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "ingestionJobId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -STOP_INGESTION_JOB_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#StopIngestionJobOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#StopIngestionJobResponse", - ) - ], - members={ - "ingestionJob": { - "target": INGESTION_JOB, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -STOP_INGESTION_JOB = Schema( - id=ShapeID("com.amazonaws.bedrockagent#StopIngestionJob"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 202, - "method": "POST", - "uri": "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/ingestionjobs/{ingestionJobId}/stop", - } - ), - ) - ], -) - -CUSTOM_DOCUMENT_IDENTIFIER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#CustomDocumentIdentifier"), - members={ - "id": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -CONTENT_DATA_SOURCE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ContentDataSourceType"), - shape_type=ShapeType.ENUM, - members={"CUSTOM": {"target": UNIT}, "S3": {"target": UNIT}}, -) - -DOCUMENT_IDENTIFIER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#DocumentIdentifier"), - members={ - "dataSourceType": { - "target": CONTENT_DATA_SOURCE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "s3": {"target": S3_LOCATION}, - "custom": {"target": CUSTOM_DOCUMENT_IDENTIFIER}, - }, -) - -DOCUMENT_IDENTIFIERS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#DocumentIdentifiers"), - shape_type=ShapeType.LIST, - members={"member": {"target": DOCUMENT_IDENTIFIER}}, -) - -DELETE_KNOWLEDGE_BASE_DOCUMENTS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#DeleteKnowledgeBaseDocumentsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#DeleteKnowledgeBaseDocumentsRequest", - ) - ], - members={ - "knowledgeBaseId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "dataSourceId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "documentIdentifiers": { - "target": DOCUMENT_IDENTIFIERS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -DOCUMENT_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#DocumentStatus"), - shape_type=ShapeType.ENUM, - members={ - "INDEXED": {"target": UNIT}, - "PARTIALLY_INDEXED": {"target": UNIT}, - "PENDING": {"target": UNIT}, - "FAILED": {"target": UNIT}, - "METADATA_PARTIALLY_INDEXED": {"target": UNIT}, - "METADATA_UPDATE_FAILED": {"target": UNIT}, - "IGNORED": {"target": UNIT}, - "NOT_FOUND": {"target": UNIT}, - "STARTING": {"target": UNIT}, - "IN_PROGRESS": {"target": UNIT}, - "DELETING": {"target": UNIT}, - "DELETE_IN_PROGRESS": {"target": UNIT}, - }, -) - -KNOWLEDGE_BASE_DOCUMENT_DETAIL = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#KnowledgeBaseDocumentDetail"), - members={ - "knowledgeBaseId": { - "target": ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "dataSourceId": { - "target": ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": DOCUMENT_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "identifier": { - "target": DOCUMENT_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "statusReason": {"target": STRING}, - "updatedAt": {"target": DATE_TIMESTAMP}, - }, -) - -KNOWLEDGE_BASE_DOCUMENT_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#KnowledgeBaseDocumentDetails"), - shape_type=ShapeType.LIST, - members={"member": {"target": KNOWLEDGE_BASE_DOCUMENT_DETAIL}}, -) - -DELETE_KNOWLEDGE_BASE_DOCUMENTS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#DeleteKnowledgeBaseDocumentsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#DeleteKnowledgeBaseDocumentsResponse", - ) - ], - members={"documentDetails": {"target": KNOWLEDGE_BASE_DOCUMENT_DETAILS}}, -) - -DELETE_KNOWLEDGE_BASE_DOCUMENTS = Schema( - id=ShapeID("com.amazonaws.bedrockagent#DeleteKnowledgeBaseDocuments"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 202, - "method": "POST", - "uri": "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/documents/deleteDocuments", - } - ), - ) - ], -) - -GET_KNOWLEDGE_BASE_DOCUMENTS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#GetKnowledgeBaseDocumentsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#GetKnowledgeBaseDocumentsRequest", - ) - ], - members={ - "knowledgeBaseId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "dataSourceId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "documentIdentifiers": { - "target": DOCUMENT_IDENTIFIERS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -GET_KNOWLEDGE_BASE_DOCUMENTS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#GetKnowledgeBaseDocumentsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#GetKnowledgeBaseDocumentsResponse", - ) - ], - members={"documentDetails": {"target": KNOWLEDGE_BASE_DOCUMENT_DETAILS}}, -) - -GET_KNOWLEDGE_BASE_DOCUMENTS = Schema( - id=ShapeID("com.amazonaws.bedrockagent#GetKnowledgeBaseDocuments"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "POST", - "uri": "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/documents/getDocuments", - } - ), - ) - ], -) - -BYTE_CONTENT_BLOB = Schema( - id=ShapeID("com.amazonaws.bedrockagent#ByteContentBlob"), - shape_type=ShapeType.BLOB, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -BYTE_CONTENT_DOC = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ByteContentDoc"), - members={ - "mimeType": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "data": { - "target": BYTE_CONTENT_BLOB, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -DATA = Schema( - id=ShapeID("com.amazonaws.bedrockagent#Data"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -TEXT_CONTENT_DOC = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#TextContentDoc"), - members={ - "data": { - "target": DATA, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -INLINE_CONTENT_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#InlineContentType"), - shape_type=ShapeType.ENUM, - members={"BYTE": {"target": UNIT}, "TEXT": {"target": UNIT}}, -) - -INLINE_CONTENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#InlineContent"), - members={ - "type": { - "target": INLINE_CONTENT_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "byteContent": {"target": BYTE_CONTENT_DOC}, - "textContent": {"target": TEXT_CONTENT_DOC}, - }, -) - -S3_OBJECT_URI = Schema( - id=ShapeID("com.amazonaws.bedrockagent#S3ObjectUri"), shape_type=ShapeType.STRING -) - -CUSTOM_S3_LOCATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#CustomS3Location"), - members={ - "uri": { - "target": S3_OBJECT_URI, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "bucketOwnerAccountId": {"target": BUCKET_OWNER_ACCOUNT_ID}, - }, -) - -CUSTOM_SOURCE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#CustomSourceType"), - shape_type=ShapeType.ENUM, - members={"IN_LINE": {"target": UNIT}, "S3_LOCATION": {"target": UNIT}}, -) - -CUSTOM_CONTENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#CustomContent"), - members={ - "customDocumentIdentifier": { - "target": CUSTOM_DOCUMENT_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "sourceType": { - "target": CUSTOM_SOURCE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "s3Location": {"target": CUSTOM_S3_LOCATION}, - "inlineContent": {"target": INLINE_CONTENT}, - }, -) - -S3_CONTENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#S3Content"), - members={ - "s3Location": { - "target": S3_LOCATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -DOCUMENT_CONTENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#DocumentContent"), - members={ - "dataSourceType": { - "target": CONTENT_DATA_SOURCE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "custom": {"target": CUSTOM_CONTENT}, - "s3": {"target": S3_CONTENT}, - }, -) - -DOCUMENT_ACCESS_CONTROL_ENTRY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#DocumentAccessControlEntry"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "name": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "type": { - "target": ACCESS_CONTROL_PRINCIPAL_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "access": { - "target": ACCESS_CONTROL_ACCESS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -DOCUMENT_ACCESS_CONTROL_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#DocumentAccessControlList"), - shape_type=ShapeType.LIST, - members={"member": {"target": DOCUMENT_ACCESS_CONTROL_ENTRY}}, -) - -KEY = Schema( - id=ShapeID("com.amazonaws.bedrockagent#Key"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -NUMBER_VALUE = Schema( - id=ShapeID("com.amazonaws.bedrockagent#NumberValue"), - shape_type=ShapeType.DOUBLE, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -STRING_VALUE = Schema( - id=ShapeID("com.amazonaws.bedrockagent#StringValue"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -STRING_LIST_VALUE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#StringListValue"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING_VALUE}}, -) - -METADATA_VALUE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#MetadataValueType"), - shape_type=ShapeType.ENUM, - members={ - "BOOLEAN": {"target": UNIT}, - "NUMBER": {"target": UNIT}, - "STRING": {"target": UNIT}, - "STRING_LIST": {"target": UNIT}, - }, -) - -METADATA_ATTRIBUTE_VALUE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#MetadataAttributeValue"), - members={ - "type": { - "target": METADATA_VALUE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "numberValue": {"target": NUMBER_VALUE}, - "booleanValue": {"target": BOOLEAN}, - "stringValue": {"target": STRING_VALUE}, - "stringListValue": {"target": STRING_LIST_VALUE}, - }, -) - -METADATA_ATTRIBUTE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#MetadataAttribute"), - members={ - "key": { - "target": KEY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "value": { - "target": METADATA_ATTRIBUTE_VALUE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -METADATA_ATTRIBUTES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#MetadataAttributes"), - shape_type=ShapeType.LIST, - members={"member": {"target": METADATA_ATTRIBUTE}}, -) - -METADATA_SOURCE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#MetadataSourceType"), - shape_type=ShapeType.ENUM, - members={"IN_LINE_ATTRIBUTE": {"target": UNIT}, "S3_LOCATION": {"target": UNIT}}, -) - -DOCUMENT_METADATA = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#DocumentMetadata"), - members={ - "type": { - "target": METADATA_SOURCE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "inlineAttributes": {"target": METADATA_ATTRIBUTES}, - "s3Location": {"target": CUSTOM_S3_LOCATION}, - "accessControlList": {"target": DOCUMENT_ACCESS_CONTROL_LIST}, - }, -) - -KNOWLEDGE_BASE_DOCUMENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#KnowledgeBaseDocument"), - members={ - "metadata": {"target": DOCUMENT_METADATA}, - "content": { - "target": DOCUMENT_CONTENT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -KNOWLEDGE_BASE_DOCUMENTS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#KnowledgeBaseDocuments"), - shape_type=ShapeType.LIST, - members={"member": {"target": KNOWLEDGE_BASE_DOCUMENT}}, -) - -INGEST_KNOWLEDGE_BASE_DOCUMENTS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#IngestKnowledgeBaseDocumentsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#IngestKnowledgeBaseDocumentsRequest", - ) - ], - members={ - "knowledgeBaseId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "dataSourceId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "documents": { - "target": KNOWLEDGE_BASE_DOCUMENTS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -INGEST_KNOWLEDGE_BASE_DOCUMENTS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#IngestKnowledgeBaseDocumentsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#IngestKnowledgeBaseDocumentsResponse", - ) - ], - members={"documentDetails": {"target": KNOWLEDGE_BASE_DOCUMENT_DETAILS}}, -) - -INGEST_KNOWLEDGE_BASE_DOCUMENTS = Schema( - id=ShapeID("com.amazonaws.bedrockagent#IngestKnowledgeBaseDocuments"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 202, - "method": "PUT", - "uri": "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/documents", - } - ), - ) - ], -) - -LIST_KNOWLEDGE_BASE_DOCUMENTS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ListKnowledgeBaseDocumentsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#ListKnowledgeBaseDocumentsRequest", - ) - ], - members={ - "knowledgeBaseId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "dataSourceId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "maxResults": {"target": MAX_RESULTS}, - "nextToken": {"target": NEXT_TOKEN}, - }, -) - -LIST_KNOWLEDGE_BASE_DOCUMENTS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ListKnowledgeBaseDocumentsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#ListKnowledgeBaseDocumentsResponse", - ) - ], - members={ - "documentDetails": { - "target": KNOWLEDGE_BASE_DOCUMENT_DETAILS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": STRING}, - }, -) - -LIST_KNOWLEDGE_BASE_DOCUMENTS = Schema( - id=ShapeID("com.amazonaws.bedrockagent#ListKnowledgeBaseDocuments"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "POST", - "uri": "/knowledgebases/{knowledgeBaseId}/datasources/{dataSourceId}/documents", - } - ), - ) - ], -) - -ASSOCIATE_AGENT_KNOWLEDGE_BASE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#AssociateAgentKnowledgeBaseInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#AssociateAgentKnowledgeBaseRequest", - ) - ], - members={ - "agentId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "agentVersion": { - "target": DRAFT_VERSION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "knowledgeBaseId": { - "target": ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": { - "target": DESCRIPTION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "knowledgeBaseState": {"target": KNOWLEDGE_BASE_STATE}, - }, -) - -ASSOCIATE_AGENT_KNOWLEDGE_BASE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#AssociateAgentKnowledgeBaseOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#AssociateAgentKnowledgeBaseResponse", - ) - ], - members={ - "agentKnowledgeBase": { - "target": AGENT_KNOWLEDGE_BASE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -ASSOCIATE_AGENT_KNOWLEDGE_BASE = Schema( - id=ShapeID("com.amazonaws.bedrockagent#AssociateAgentKnowledgeBase"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "PUT", - "uri": "/agents/{agentId}/agentversions/{agentVersion}/knowledgebases/", - } - ), - ) - ], -) - -KENDRA_INDEX_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagent#KendraIndexArn"), shape_type=ShapeType.STRING -) - -KENDRA_KNOWLEDGE_BASE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#KendraKnowledgeBaseConfiguration"), - members={ - "kendraIndexArn": { - "target": KENDRA_INDEX_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -BEDROCK_EMBEDDING_MODEL_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagent#BedrockEmbeddingModelArn"), - shape_type=ShapeType.STRING, -) - -AUDIO_SEGMENTATION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#AudioSegmentationConfiguration"), - members={ - "fixedLengthDuration": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -AUDIO_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#AudioConfiguration"), - members={ - "segmentationConfiguration": { - "target": AUDIO_SEGMENTATION_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -AUDIO_CONFIGURATIONS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#AudioConfigurations"), - shape_type=ShapeType.LIST, - members={"member": {"target": AUDIO_CONFIGURATION}}, -) - -DIMENSIONS = Schema( - id=ShapeID("com.amazonaws.bedrockagent#Dimensions"), shape_type=ShapeType.INTEGER -) - -EMBEDDING_DATA_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#EmbeddingDataType"), - shape_type=ShapeType.ENUM, - members={"FLOAT32": {"target": UNIT}, "BINARY": {"target": UNIT}}, -) - -VIDEO_SEGMENTATION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#VideoSegmentationConfiguration"), - members={ - "fixedLengthDuration": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -VIDEO_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#VideoConfiguration"), - members={ - "segmentationConfiguration": { - "target": VIDEO_SEGMENTATION_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -VIDEO_CONFIGURATIONS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#VideoConfigurations"), - shape_type=ShapeType.LIST, - members={"member": {"target": VIDEO_CONFIGURATION}}, -) - -BEDROCK_EMBEDDING_MODEL_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#BedrockEmbeddingModelConfiguration"), - members={ - "dimensions": {"target": DIMENSIONS}, - "embeddingDataType": {"target": EMBEDDING_DATA_TYPE}, - "audio": {"target": AUDIO_CONFIGURATIONS}, - "video": {"target": VIDEO_CONFIGURATIONS}, - "modelConfiguration": {"target": DOCUMENT}, - }, -) - -EMBEDDING_MODEL_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#EmbeddingModelConfiguration"), - members={ - "bedrockEmbeddingModelConfiguration": { - "target": BEDROCK_EMBEDDING_MODEL_CONFIGURATION - } - }, -) - -EMBEDDING_MODEL_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#EmbeddingModelType"), - shape_type=ShapeType.ENUM, - members={"CUSTOM": {"target": UNIT}, "MANAGED": {"target": UNIT}}, -) - -SUPPLEMENTAL_DATA_STORAGE_LOCATION_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#SupplementalDataStorageLocationType"), - shape_type=ShapeType.ENUM, - members={"S3": {"target": UNIT}}, -) - -SUPPLEMENTAL_DATA_STORAGE_LOCATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#SupplementalDataStorageLocation"), - members={ - "type": { - "target": SUPPLEMENTAL_DATA_STORAGE_LOCATION_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "s3Location": {"target": S3_LOCATION}, - }, -) - -SUPPLEMENTAL_DATA_STORAGE_LOCATIONS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#SupplementalDataStorageLocations"), - shape_type=ShapeType.LIST, - members={"member": {"target": SUPPLEMENTAL_DATA_STORAGE_LOCATION}}, -) - -SUPPLEMENTAL_DATA_STORAGE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#SupplementalDataStorageConfiguration"), - members={ - "storageLocations": { - "target": SUPPLEMENTAL_DATA_STORAGE_LOCATIONS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -MANAGED_KNOWLEDGE_BASE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ManagedKnowledgeBaseConfiguration"), - members={ - "embeddingModelType": {"target": EMBEDDING_MODEL_TYPE}, - "embeddingModelArn": {"target": BEDROCK_EMBEDDING_MODEL_ARN}, - "embeddingModelConfiguration": {"target": EMBEDDING_MODEL_CONFIGURATION}, - "serverSideEncryptionConfiguration": { - "target": SERVER_SIDE_ENCRYPTION_CONFIGURATION - }, - "supplementalDataStorageConfiguration": { - "target": SUPPLEMENTAL_DATA_STORAGE_CONFIGURATION - }, - }, -) - -REDSHIFT_PROVISIONED_AUTH_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#RedshiftProvisionedAuthType"), - shape_type=ShapeType.ENUM, - members={ - "IAM": {"target": UNIT}, - "USERNAME_PASSWORD": {"target": UNIT}, - "USERNAME": {"target": UNIT}, - }, -) - -REDSHIFT_PROVISIONED_AUTH_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#RedshiftProvisionedAuthConfiguration"), - members={ - "type": { - "target": REDSHIFT_PROVISIONED_AUTH_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "databaseUser": {"target": STRING}, - "usernamePasswordSecretArn": {"target": SECRET_ARN}, - }, -) - -REDSHIFT_CLUSTER_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrockagent#RedshiftClusterIdentifier"), - shape_type=ShapeType.STRING, -) - -REDSHIFT_PROVISIONED_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#RedshiftProvisionedConfiguration"), - members={ - "clusterIdentifier": { - "target": REDSHIFT_CLUSTER_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "authConfiguration": { - "target": REDSHIFT_PROVISIONED_AUTH_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -REDSHIFT_SERVERLESS_AUTH_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#RedshiftServerlessAuthType"), - shape_type=ShapeType.ENUM, - members={"IAM": {"target": UNIT}, "USERNAME_PASSWORD": {"target": UNIT}}, -) - -REDSHIFT_SERVERLESS_AUTH_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#RedshiftServerlessAuthConfiguration"), - members={ - "type": { - "target": REDSHIFT_SERVERLESS_AUTH_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "usernamePasswordSecretArn": {"target": SECRET_ARN}, - }, -) - -WORKGROUP_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagent#WorkgroupArn"), shape_type=ShapeType.STRING -) - -REDSHIFT_SERVERLESS_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#RedshiftServerlessConfiguration"), - members={ - "workgroupArn": { - "target": WORKGROUP_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "authConfiguration": { - "target": REDSHIFT_SERVERLESS_AUTH_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -REDSHIFT_QUERY_ENGINE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#RedshiftQueryEngineType"), - shape_type=ShapeType.ENUM, - members={"SERVERLESS": {"target": UNIT}, "PROVISIONED": {"target": UNIT}}, -) - -REDSHIFT_QUERY_ENGINE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#RedshiftQueryEngineConfiguration"), - members={ - "type": { - "target": REDSHIFT_QUERY_ENGINE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "serverlessConfiguration": {"target": REDSHIFT_SERVERLESS_CONFIGURATION}, - "provisionedConfiguration": {"target": REDSHIFT_PROVISIONED_CONFIGURATION}, - }, -) - -QUERY_EXECUTION_TIMEOUT_SECONDS = Schema( - id=ShapeID("com.amazonaws.bedrockagent#QueryExecutionTimeoutSeconds"), - shape_type=ShapeType.INTEGER, -) - -NATURAL_LANGUAGE_STRING = Schema( - id=ShapeID("com.amazonaws.bedrockagent#NaturalLanguageString"), - shape_type=ShapeType.STRING, -) - -SQL_STRING = Schema( - id=ShapeID("com.amazonaws.bedrockagent#SqlString"), shape_type=ShapeType.STRING -) - -CURATED_QUERY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#CuratedQuery"), - members={ - "naturalLanguage": { - "target": NATURAL_LANGUAGE_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "sql": { - "target": SQL_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -CURATED_QUERIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#CuratedQueries"), - shape_type=ShapeType.LIST, - members={"member": {"target": CURATED_QUERY}}, -) - -DESCRIPTION_STRING = Schema( - id=ShapeID("com.amazonaws.bedrockagent#DescriptionString"), - shape_type=ShapeType.STRING, -) - -INCLUDE_EXCLUDE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#IncludeExclude"), - shape_type=ShapeType.ENUM, - members={"INCLUDE": {"target": UNIT}, "EXCLUDE": {"target": UNIT}}, -) - -QUERY_GENERATION_COLUMN_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagent#QueryGenerationColumnName"), - shape_type=ShapeType.STRING, -) - -QUERY_GENERATION_COLUMN = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#QueryGenerationColumn"), - members={ - "name": {"target": QUERY_GENERATION_COLUMN_NAME}, - "description": {"target": DESCRIPTION_STRING}, - "inclusion": {"target": INCLUDE_EXCLUDE}, - }, -) - -QUERY_GENERATION_COLUMNS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#QueryGenerationColumns"), - shape_type=ShapeType.LIST, - members={"member": {"target": QUERY_GENERATION_COLUMN}}, -) - -QUERY_GENERATION_TABLE_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagent#QueryGenerationTableName"), - shape_type=ShapeType.STRING, -) - -QUERY_GENERATION_TABLE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#QueryGenerationTable"), - members={ - "name": { - "target": QUERY_GENERATION_TABLE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION_STRING}, - "inclusion": {"target": INCLUDE_EXCLUDE}, - "columns": {"target": QUERY_GENERATION_COLUMNS}, - }, -) - -QUERY_GENERATION_TABLES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#QueryGenerationTables"), - shape_type=ShapeType.LIST, - members={"member": {"target": QUERY_GENERATION_TABLE}}, -) - -QUERY_GENERATION_CONTEXT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#QueryGenerationContext"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "tables": {"target": QUERY_GENERATION_TABLES}, - "curatedQueries": {"target": CURATED_QUERIES}, - }, -) - -QUERY_GENERATION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#QueryGenerationConfiguration"), - members={ - "executionTimeoutSeconds": {"target": QUERY_EXECUTION_TIMEOUT_SECONDS}, - "generationContext": {"target": QUERY_GENERATION_CONTEXT}, - }, -) - -AWS_DATA_CATALOG_TABLE_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagent#AwsDataCatalogTableName"), - shape_type=ShapeType.STRING, -) - -AWS_DATA_CATALOG_TABLE_NAMES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#AwsDataCatalogTableNames"), - shape_type=ShapeType.LIST, - members={"member": {"target": AWS_DATA_CATALOG_TABLE_NAME}}, -) - -REDSHIFT_QUERY_ENGINE_AWS_DATA_CATALOG_STORAGE_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagent#RedshiftQueryEngineAwsDataCatalogStorageConfiguration" - ), - members={ - "tableNames": { - "target": AWS_DATA_CATALOG_TABLE_NAMES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -REDSHIFT_DATABASE = Schema( - id=ShapeID("com.amazonaws.bedrockagent#RedshiftDatabase"), - shape_type=ShapeType.STRING, -) - -REDSHIFT_QUERY_ENGINE_REDSHIFT_STORAGE_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagent#RedshiftQueryEngineRedshiftStorageConfiguration" - ), - members={ - "databaseName": { - "target": REDSHIFT_DATABASE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -REDSHIFT_QUERY_ENGINE_STORAGE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#RedshiftQueryEngineStorageType"), - shape_type=ShapeType.ENUM, - members={"REDSHIFT": {"target": UNIT}, "AWS_DATA_CATALOG": {"target": UNIT}}, -) - -REDSHIFT_QUERY_ENGINE_STORAGE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#RedshiftQueryEngineStorageConfiguration"), - members={ - "type": { - "target": REDSHIFT_QUERY_ENGINE_STORAGE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "awsDataCatalogConfiguration": { - "target": REDSHIFT_QUERY_ENGINE_AWS_DATA_CATALOG_STORAGE_CONFIGURATION - }, - "redshiftConfiguration": { - "target": REDSHIFT_QUERY_ENGINE_REDSHIFT_STORAGE_CONFIGURATION - }, - }, -) - -REDSHIFT_QUERY_ENGINE_STORAGE_CONFIGURATIONS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#RedshiftQueryEngineStorageConfigurations"), - shape_type=ShapeType.LIST, - members={"member": {"target": REDSHIFT_QUERY_ENGINE_STORAGE_CONFIGURATION}}, -) - -REDSHIFT_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#RedshiftConfiguration"), - members={ - "storageConfigurations": { - "target": REDSHIFT_QUERY_ENGINE_STORAGE_CONFIGURATIONS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "queryEngineConfiguration": { - "target": REDSHIFT_QUERY_ENGINE_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "queryGenerationConfiguration": {"target": QUERY_GENERATION_CONFIGURATION}, - }, -) - -QUERY_ENGINE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#QueryEngineType"), - shape_type=ShapeType.ENUM, - members={"REDSHIFT": {"target": UNIT}}, -) - -SQL_KNOWLEDGE_BASE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#SqlKnowledgeBaseConfiguration"), - members={ - "type": { - "target": QUERY_ENGINE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "redshiftConfiguration": {"target": REDSHIFT_CONFIGURATION}, - }, -) - -KNOWLEDGE_BASE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#KnowledgeBaseType"), - shape_type=ShapeType.ENUM, - members={ - "VECTOR": {"target": UNIT}, - "KENDRA": {"target": UNIT}, - "SQL": {"target": UNIT}, - "MANAGED": {"target": UNIT}, - }, -) - -VECTOR_KNOWLEDGE_BASE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#VectorKnowledgeBaseConfiguration"), - members={ - "embeddingModelArn": { - "target": BEDROCK_EMBEDDING_MODEL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "embeddingModelConfiguration": {"target": EMBEDDING_MODEL_CONFIGURATION}, - "supplementalDataStorageConfiguration": { - "target": SUPPLEMENTAL_DATA_STORAGE_CONFIGURATION - }, - }, -) - -KNOWLEDGE_BASE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#KnowledgeBaseConfiguration"), - members={ - "type": { - "target": KNOWLEDGE_BASE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "vectorKnowledgeBaseConfiguration": { - "target": VECTOR_KNOWLEDGE_BASE_CONFIGURATION - }, - "managedKnowledgeBaseConfiguration": { - "target": MANAGED_KNOWLEDGE_BASE_CONFIGURATION - }, - "kendraKnowledgeBaseConfiguration": { - "target": KENDRA_KNOWLEDGE_BASE_CONFIGURATION - }, - "sqlKnowledgeBaseConfiguration": {"target": SQL_KNOWLEDGE_BASE_CONFIGURATION}, - }, -) - -KNOWLEDGE_BASE_ROLE_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagent#KnowledgeBaseRoleArn"), - shape_type=ShapeType.STRING, -) - -MONGO_DB_ATLAS_COLLECTION_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagent#MongoDbAtlasCollectionName"), - shape_type=ShapeType.STRING, -) - -MONGO_DB_ATLAS_DATABASE_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagent#MongoDbAtlasDatabaseName"), - shape_type=ShapeType.STRING, -) - -MONGO_DB_ATLAS_ENDPOINT = Schema( - id=ShapeID("com.amazonaws.bedrockagent#MongoDbAtlasEndpoint"), - shape_type=ShapeType.STRING, -) - -MONGO_DB_ATLAS_ENDPOINT_SERVICE_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagent#MongoDbAtlasEndpointServiceName"), - shape_type=ShapeType.STRING, -) - -FIELD_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagent#FieldName"), shape_type=ShapeType.STRING -) - -MONGO_DB_ATLAS_FIELD_MAPPING = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#MongoDbAtlasFieldMapping"), - members={ - "vectorField": { - "target": FIELD_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "textField": { - "target": FIELD_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "metadataField": { - "target": FIELD_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -MONGO_DB_ATLAS_INDEX_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagent#MongoDbAtlasIndexName"), - shape_type=ShapeType.STRING, -) - -MONGO_DB_ATLAS_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#MongoDbAtlasConfiguration"), - members={ - "endpoint": { - "target": MONGO_DB_ATLAS_ENDPOINT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "databaseName": { - "target": MONGO_DB_ATLAS_DATABASE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "collectionName": { - "target": MONGO_DB_ATLAS_COLLECTION_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "vectorIndexName": { - "target": MONGO_DB_ATLAS_INDEX_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "credentialsSecretArn": { - "target": SECRET_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "fieldMapping": { - "target": MONGO_DB_ATLAS_FIELD_MAPPING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "endpointServiceName": {"target": MONGO_DB_ATLAS_ENDPOINT_SERVICE_NAME}, - "textIndexName": {"target": MONGO_DB_ATLAS_INDEX_NAME}, - }, -) - -NEPTUNE_ANALYTICS_FIELD_MAPPING = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#NeptuneAnalyticsFieldMapping"), - members={ - "textField": { - "target": FIELD_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "metadataField": { - "target": FIELD_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -GRAPH_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagent#GraphArn"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -NEPTUNE_ANALYTICS_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#NeptuneAnalyticsConfiguration"), - members={ - "graphArn": { - "target": GRAPH_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "fieldMapping": { - "target": NEPTUNE_ANALYTICS_FIELD_MAPPING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -OPEN_SEARCH_MANAGED_CLUSTER_DOMAIN_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagent#OpenSearchManagedClusterDomainArn"), - shape_type=ShapeType.STRING, -) - -OPEN_SEARCH_MANAGED_CLUSTER_DOMAIN_ENDPOINT = Schema( - id=ShapeID("com.amazonaws.bedrockagent#OpenSearchManagedClusterDomainEndpoint"), - shape_type=ShapeType.STRING, -) - -OPEN_SEARCH_MANAGED_CLUSTER_FIELD_MAPPING = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#OpenSearchManagedClusterFieldMapping"), - members={ - "vectorField": { - "target": FIELD_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "textField": { - "target": FIELD_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "metadataField": { - "target": FIELD_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -OPEN_SEARCH_MANAGED_CLUSTER_INDEX_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagent#OpenSearchManagedClusterIndexName"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -OPEN_SEARCH_MANAGED_CLUSTER_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#OpenSearchManagedClusterConfiguration"), - members={ - "domainEndpoint": { - "target": OPEN_SEARCH_MANAGED_CLUSTER_DOMAIN_ENDPOINT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "domainArn": { - "target": OPEN_SEARCH_MANAGED_CLUSTER_DOMAIN_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "vectorIndexName": { - "target": OPEN_SEARCH_MANAGED_CLUSTER_INDEX_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "fieldMapping": { - "target": OPEN_SEARCH_MANAGED_CLUSTER_FIELD_MAPPING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -OPEN_SEARCH_SERVERLESS_COLLECTION_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagent#OpenSearchServerlessCollectionArn"), - shape_type=ShapeType.STRING, -) - -OPEN_SEARCH_SERVERLESS_FIELD_MAPPING = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#OpenSearchServerlessFieldMapping"), - members={ - "vectorField": { - "target": FIELD_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "textField": { - "target": FIELD_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "metadataField": { - "target": FIELD_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -OPEN_SEARCH_SERVERLESS_INDEX_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagent#OpenSearchServerlessIndexName"), - shape_type=ShapeType.STRING, -) - -OPEN_SEARCH_SERVERLESS_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#OpenSearchServerlessConfiguration"), - members={ - "collectionArn": { - "target": OPEN_SEARCH_SERVERLESS_COLLECTION_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "vectorIndexName": { - "target": OPEN_SEARCH_SERVERLESS_INDEX_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "fieldMapping": { - "target": OPEN_SEARCH_SERVERLESS_FIELD_MAPPING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -PINECONE_CONNECTION_STRING = Schema( - id=ShapeID("com.amazonaws.bedrockagent#PineconeConnectionString"), - shape_type=ShapeType.STRING, -) - -PINECONE_FIELD_MAPPING = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#PineconeFieldMapping"), - members={ - "textField": { - "target": FIELD_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "metadataField": { - "target": FIELD_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -PINECONE_NAMESPACE = Schema( - id=ShapeID("com.amazonaws.bedrockagent#PineconeNamespace"), - shape_type=ShapeType.STRING, -) - -PINECONE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#PineconeConfiguration"), - members={ - "connectionString": { - "target": PINECONE_CONNECTION_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "credentialsSecretArn": { - "target": SECRET_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "namespace": {"target": PINECONE_NAMESPACE}, - "fieldMapping": { - "target": PINECONE_FIELD_MAPPING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -RDS_DATABASE_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagent#RdsDatabaseName"), - shape_type=ShapeType.STRING, -) - -COLUMN_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagent#ColumnName"), shape_type=ShapeType.STRING -) - -RDS_FIELD_MAPPING = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#RdsFieldMapping"), - members={ - "primaryKeyField": { - "target": COLUMN_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "vectorField": { - "target": COLUMN_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "textField": { - "target": COLUMN_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "metadataField": { - "target": COLUMN_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "customMetadataField": {"target": COLUMN_NAME}, - }, -) - -RDS_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagent#RdsArn"), shape_type=ShapeType.STRING -) - -RDS_TABLE_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagent#RdsTableName"), shape_type=ShapeType.STRING -) - -RDS_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#RdsConfiguration"), - members={ - "resourceArn": { - "target": RDS_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "credentialsSecretArn": { - "target": SECRET_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "databaseName": { - "target": RDS_DATABASE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "tableName": { - "target": RDS_TABLE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "fieldMapping": { - "target": RDS_FIELD_MAPPING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -REDIS_ENTERPRISE_CLOUD_ENDPOINT = Schema( - id=ShapeID("com.amazonaws.bedrockagent#RedisEnterpriseCloudEndpoint"), - shape_type=ShapeType.STRING, -) - -REDIS_ENTERPRISE_CLOUD_FIELD_MAPPING = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#RedisEnterpriseCloudFieldMapping"), - members={ - "vectorField": { - "target": FIELD_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "textField": { - "target": FIELD_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "metadataField": { - "target": FIELD_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -REDIS_ENTERPRISE_CLOUD_INDEX_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagent#RedisEnterpriseCloudIndexName"), - shape_type=ShapeType.STRING, -) - -REDIS_ENTERPRISE_CLOUD_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#RedisEnterpriseCloudConfiguration"), - members={ - "endpoint": { - "target": REDIS_ENTERPRISE_CLOUD_ENDPOINT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "vectorIndexName": { - "target": REDIS_ENTERPRISE_CLOUD_INDEX_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "credentialsSecretArn": { - "target": SECRET_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "fieldMapping": { - "target": REDIS_ENTERPRISE_CLOUD_FIELD_MAPPING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -INDEX_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagent#IndexArn"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -INDEX_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagent#IndexName"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -VECTOR_BUCKET_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagent#VectorBucketArn"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -S3_VECTORS_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#S3VectorsConfiguration"), - members={ - "vectorBucketArn": {"target": VECTOR_BUCKET_ARN}, - "indexArn": {"target": INDEX_ARN}, - "indexName": {"target": INDEX_NAME}, - }, -) - -KNOWLEDGE_BASE_STORAGE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#KnowledgeBaseStorageType"), - shape_type=ShapeType.ENUM, - members={ - "OPENSEARCH_SERVERLESS": {"target": UNIT}, - "PINECONE": {"target": UNIT}, - "REDIS_ENTERPRISE_CLOUD": {"target": UNIT}, - "RDS": {"target": UNIT}, - "MONGO_DB_ATLAS": {"target": UNIT}, - "NEPTUNE_ANALYTICS": {"target": UNIT}, - "OPENSEARCH_MANAGED_CLUSTER": {"target": UNIT}, - "S3_VECTORS": {"target": UNIT}, - }, -) - -STORAGE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#StorageConfiguration"), - members={ - "type": { - "target": KNOWLEDGE_BASE_STORAGE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "opensearchServerlessConfiguration": { - "target": OPEN_SEARCH_SERVERLESS_CONFIGURATION - }, - "opensearchManagedClusterConfiguration": { - "target": OPEN_SEARCH_MANAGED_CLUSTER_CONFIGURATION - }, - "pineconeConfiguration": {"target": PINECONE_CONFIGURATION}, - "redisEnterpriseCloudConfiguration": { - "target": REDIS_ENTERPRISE_CLOUD_CONFIGURATION - }, - "rdsConfiguration": {"target": RDS_CONFIGURATION}, - "mongoDbAtlasConfiguration": {"target": MONGO_DB_ATLAS_CONFIGURATION}, - "neptuneAnalyticsConfiguration": {"target": NEPTUNE_ANALYTICS_CONFIGURATION}, - "s3VectorsConfiguration": {"target": S3_VECTORS_CONFIGURATION}, - }, -) - -CREATE_KNOWLEDGE_BASE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#CreateKnowledgeBaseInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#CreateKnowledgeBaseRequest", - ) - ], - members={ - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "name": { - "target": NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "roleArn": { - "target": KNOWLEDGE_BASE_ROLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "knowledgeBaseConfiguration": { - "target": KNOWLEDGE_BASE_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "storageConfiguration": {"target": STORAGE_CONFIGURATION}, - "tags": {"target": TAGS_MAP}, - }, -) - -KNOWLEDGE_BASE_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagent#KnowledgeBaseArn"), - shape_type=ShapeType.STRING, -) - -KNOWLEDGE_BASE_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#KnowledgeBaseStatus"), - shape_type=ShapeType.ENUM, - members={ - "CREATING": {"target": UNIT}, - "ACTIVE": {"target": UNIT}, - "DELETING": {"target": UNIT}, - "UPDATING": {"target": UNIT}, - "FAILED": {"target": UNIT}, - "DELETE_UNSUCCESSFUL": {"target": UNIT}, - "UPDATE_UNSUCCESSFUL": {"target": UNIT}, - }, -) - -KNOWLEDGE_BASE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#KnowledgeBase"), - members={ - "knowledgeBaseId": { - "target": ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "knowledgeBaseArn": { - "target": KNOWLEDGE_BASE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "roleArn": { - "target": KNOWLEDGE_BASE_ROLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "knowledgeBaseConfiguration": { - "target": KNOWLEDGE_BASE_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "storageConfiguration": {"target": STORAGE_CONFIGURATION}, - "status": { - "target": KNOWLEDGE_BASE_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "failureReasons": {"target": FAILURE_REASONS}, - }, -) - -CREATE_KNOWLEDGE_BASE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#CreateKnowledgeBaseOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#CreateKnowledgeBaseResponse", - ) - ], - members={ - "knowledgeBase": { - "target": KNOWLEDGE_BASE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -CREATE_KNOWLEDGE_BASE = Schema( - id=ShapeID("com.amazonaws.bedrockagent#CreateKnowledgeBase"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 202, "method": "PUT", "uri": "/knowledgebases/"} - ), - ) - ], -) - -DELETE_KNOWLEDGE_BASE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#DeleteKnowledgeBaseInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#DeleteKnowledgeBaseRequest", - ) - ], - members={ - "knowledgeBaseId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -DELETE_KNOWLEDGE_BASE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#DeleteKnowledgeBaseOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#DeleteKnowledgeBaseResponse", - ) - ], - members={ - "knowledgeBaseId": { - "target": ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": KNOWLEDGE_BASE_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -DELETE_KNOWLEDGE_BASE = Schema( - id=ShapeID("com.amazonaws.bedrockagent#DeleteKnowledgeBase"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 202, - "method": "DELETE", - "uri": "/knowledgebases/{knowledgeBaseId}", - } - ), - ) - ], -) - -DISASSOCIATE_AGENT_KNOWLEDGE_BASE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#DisassociateAgentKnowledgeBaseInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#DisassociateAgentKnowledgeBaseRequest", - ) - ], - members={ - "agentId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "agentVersion": { - "target": DRAFT_VERSION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "knowledgeBaseId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -DISASSOCIATE_AGENT_KNOWLEDGE_BASE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#DisassociateAgentKnowledgeBaseOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#DisassociateAgentKnowledgeBaseResponse", - ) - ], -) - -DISASSOCIATE_AGENT_KNOWLEDGE_BASE = Schema( - id=ShapeID("com.amazonaws.bedrockagent#DisassociateAgentKnowledgeBase"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 204, - "method": "DELETE", - "uri": "/agents/{agentId}/agentversions/{agentVersion}/knowledgebases/{knowledgeBaseId}/", - } - ), - ) - ], -) - -GET_AGENT_KNOWLEDGE_BASE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#GetAgentKnowledgeBaseInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#GetAgentKnowledgeBaseRequest", - ) - ], - members={ - "agentId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "agentVersion": { - "target": VERSION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "knowledgeBaseId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -GET_AGENT_KNOWLEDGE_BASE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#GetAgentKnowledgeBaseOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#GetAgentKnowledgeBaseResponse", - ) - ], - members={ - "agentKnowledgeBase": { - "target": AGENT_KNOWLEDGE_BASE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -GET_AGENT_KNOWLEDGE_BASE = Schema( - id=ShapeID("com.amazonaws.bedrockagent#GetAgentKnowledgeBase"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/agents/{agentId}/agentversions/{agentVersion}/knowledgebases/{knowledgeBaseId}/", - } - ), - ) - ], -) - -GET_KNOWLEDGE_BASE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#GetKnowledgeBaseInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#GetKnowledgeBaseRequest", - ) - ], - members={ - "knowledgeBaseId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -GET_KNOWLEDGE_BASE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#GetKnowledgeBaseOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#GetKnowledgeBaseResponse", - ) - ], - members={ - "knowledgeBase": { - "target": KNOWLEDGE_BASE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -GET_KNOWLEDGE_BASE = Schema( - id=ShapeID("com.amazonaws.bedrockagent#GetKnowledgeBase"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/knowledgebases/{knowledgeBaseId}", - } - ), - ) - ], -) - -LIST_AGENT_KNOWLEDGE_BASES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ListAgentKnowledgeBasesInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#ListAgentKnowledgeBasesRequest", - ) - ], - members={ - "agentId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "agentVersion": { - "target": VERSION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "maxResults": {"target": MAX_RESULTS}, - "nextToken": {"target": NEXT_TOKEN}, - }, -) - -LIST_AGENT_KNOWLEDGE_BASES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ListAgentKnowledgeBasesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#ListAgentKnowledgeBasesResponse", - ) - ], - members={ - "agentKnowledgeBaseSummaries": { - "target": AGENT_KNOWLEDGE_BASE_SUMMARIES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": NEXT_TOKEN}, - }, -) - -LIST_AGENT_KNOWLEDGE_BASES = Schema( - id=ShapeID("com.amazonaws.bedrockagent#ListAgentKnowledgeBases"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "POST", - "uri": "/agents/{agentId}/agentversions/{agentVersion}/knowledgebases/", - } - ), - ) - ], -) - -LIST_KNOWLEDGE_BASES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ListKnowledgeBasesInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#ListKnowledgeBasesRequest", - ) - ], - members={ - "maxResults": {"target": MAX_RESULTS}, - "nextToken": {"target": NEXT_TOKEN}, - }, -) - -KNOWLEDGE_BASE_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#KnowledgeBaseSummary"), - members={ - "knowledgeBaseId": { - "target": ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "status": { - "target": KNOWLEDGE_BASE_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -KNOWLEDGE_BASE_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#KnowledgeBaseSummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": KNOWLEDGE_BASE_SUMMARY}}, -) - -LIST_KNOWLEDGE_BASES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ListKnowledgeBasesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#ListKnowledgeBasesResponse", - ) - ], - members={ - "knowledgeBaseSummaries": { - "target": KNOWLEDGE_BASE_SUMMARIES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": NEXT_TOKEN}, - }, -) - -LIST_KNOWLEDGE_BASES = Schema( - id=ShapeID("com.amazonaws.bedrockagent#ListKnowledgeBases"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "POST", "uri": "/knowledgebases/"} - ), - ) - ], -) - -UPDATE_AGENT_KNOWLEDGE_BASE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#UpdateAgentKnowledgeBaseInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#UpdateAgentKnowledgeBaseRequest", - ) - ], - members={ - "agentId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "agentVersion": { - "target": DRAFT_VERSION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "knowledgeBaseId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "description": {"target": DESCRIPTION}, - "knowledgeBaseState": {"target": KNOWLEDGE_BASE_STATE}, - }, -) - -UPDATE_AGENT_KNOWLEDGE_BASE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#UpdateAgentKnowledgeBaseOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#UpdateAgentKnowledgeBaseResponse", - ) - ], - members={ - "agentKnowledgeBase": { - "target": AGENT_KNOWLEDGE_BASE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -UPDATE_AGENT_KNOWLEDGE_BASE = Schema( - id=ShapeID("com.amazonaws.bedrockagent#UpdateAgentKnowledgeBase"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "PUT", - "uri": "/agents/{agentId}/agentversions/{agentVersion}/knowledgebases/{knowledgeBaseId}/", - } - ), - ) - ], -) - -UPDATE_KNOWLEDGE_BASE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#UpdateKnowledgeBaseInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#UpdateKnowledgeBaseRequest", - ) - ], - members={ - "knowledgeBaseId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "name": { - "target": NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "roleArn": { - "target": KNOWLEDGE_BASE_ROLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "knowledgeBaseConfiguration": { - "target": KNOWLEDGE_BASE_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "storageConfiguration": {"target": STORAGE_CONFIGURATION}, - }, -) - -UPDATE_KNOWLEDGE_BASE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#UpdateKnowledgeBaseOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#UpdateKnowledgeBaseResponse", - ) - ], - members={ - "knowledgeBase": { - "target": KNOWLEDGE_BASE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -UPDATE_KNOWLEDGE_BASE = Schema( - id=ShapeID("com.amazonaws.bedrockagent#UpdateKnowledgeBase"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 202, - "method": "PUT", - "uri": "/knowledgebases/{knowledgeBaseId}", - } - ), - ) - ], -) - -LIST_VPC_CONFIGURATIONS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ListVpcConfigurationsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#ListVpcConfigurationsRequest", - ) - ], - members={ - "knowledgeBaseId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "statusFilter": { - "target": VPC_CONFIGURATION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="status")], - }, - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - }, -) - -VPC_CONFIGURATION_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#VpcConfigurationSummary"), - members={ - "vpcConfigurationId": { - "target": VPC_CONFIGURATION_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": VPC_CONFIGURATION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "statusMessage": {"target": VPC_CONFIGURATION_STATUS_MESSAGE}, - "vpcId": { - "target": VPC_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "resourceTarget": { - "target": RESOURCE_TARGET, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "port": { - "target": PORT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "protocol": { - "target": VPC_PROTOCOL, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "resolutionMode": { - "target": VPC_RESOLUTION_MODE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "hostHeader": {"target": HOST_HEADER}, - "tlsServerName": {"target": TLS_SERVER_NAME}, - "name": {"target": VPC_CONFIGURATION_NAME}, - "description": {"target": VPC_CONFIGURATION_DESCRIPTION}, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -VPC_CONFIGURATION_SUMMARY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#VpcConfigurationSummaryList"), - shape_type=ShapeType.LIST, - members={"member": {"target": VPC_CONFIGURATION_SUMMARY}}, -) - -LIST_VPC_CONFIGURATIONS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ListVpcConfigurationsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#ListVpcConfigurationsResponse", - ) - ], - members={ - "items": { - "target": VPC_CONFIGURATION_SUMMARY_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": NEXT_TOKEN}, - }, -) - -LIST_VPC_CONFIGURATIONS = Schema( - id=ShapeID("com.amazonaws.bedrockagent#ListVpcConfigurations"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/knowledgebases/{knowledgeBaseId}/vpcconfigurations/", - } - ), - ) - ], -) - -PROMPT_VARIANT_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagent#PromptVariantName"), - shape_type=ShapeType.STRING, -) - -PROMPT_DESCRIPTION = Schema( - id=ShapeID("com.amazonaws.bedrockagent#PromptDescription"), - shape_type=ShapeType.STRING, -) - -PROMPT_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagent#PromptName"), shape_type=ShapeType.STRING -) - -PROMPT_AGENT_RESOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#PromptAgentResource"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "agentIdentifier": { - "target": AGENT_ALIAS_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -PROMPT_GEN_AI_RESOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#PromptGenAiResource"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"agent": {"target": PROMPT_AGENT_RESOURCE}}, -) - -PROMPT_METADATA_KEY = Schema( - id=ShapeID("com.amazonaws.bedrockagent#PromptMetadataKey"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -PROMPT_METADATA_VALUE = Schema( - id=ShapeID("com.amazonaws.bedrockagent#PromptMetadataValue"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -PROMPT_METADATA_ENTRY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#PromptMetadataEntry"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "key": { - "target": PROMPT_METADATA_KEY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "value": { - "target": PROMPT_METADATA_VALUE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -PROMPT_METADATA_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#PromptMetadataList"), - shape_type=ShapeType.LIST, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"member": {"target": PROMPT_METADATA_ENTRY}}, -) - -PROMPT_MODEL_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrockagent#PromptModelIdentifier"), - shape_type=ShapeType.STRING, -) - -PROMPT_VARIANT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#PromptVariant"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "name": { - "target": PROMPT_VARIANT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "templateType": { - "target": PROMPT_TEMPLATE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "templateConfiguration": { - "target": PROMPT_TEMPLATE_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelId": {"target": PROMPT_MODEL_IDENTIFIER}, - "inferenceConfiguration": {"target": PROMPT_INFERENCE_CONFIGURATION}, - "metadata": {"target": PROMPT_METADATA_LIST}, - "additionalModelRequestFields": {"target": DOCUMENT}, - "genAiResource": {"target": PROMPT_GEN_AI_RESOURCE}, - }, -) - -PROMPT_VARIANT_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#PromptVariantList"), - shape_type=ShapeType.LIST, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"member": {"target": PROMPT_VARIANT}}, -) - -CREATE_PROMPT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#CreatePromptInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#CreatePromptRequest", - ) - ], - members={ - "name": { - "target": PROMPT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": PROMPT_DESCRIPTION}, - "customerEncryptionKeyArn": {"target": KMS_KEY_ARN}, - "defaultVariant": {"target": PROMPT_VARIANT_NAME}, - "variants": {"target": PROMPT_VARIANT_LIST}, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "tags": {"target": TAGS_MAP}, - }, -) - -PROMPT_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagent#PromptArn"), shape_type=ShapeType.STRING -) - -PROMPT_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagent#PromptId"), shape_type=ShapeType.STRING -) - -CREATE_PROMPT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#CreatePromptOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#CreatePromptResponse", - ) - ], - members={ - "name": { - "target": PROMPT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": PROMPT_DESCRIPTION}, - "customerEncryptionKeyArn": {"target": KMS_KEY_ARN}, - "defaultVariant": {"target": PROMPT_VARIANT_NAME}, - "variants": {"target": PROMPT_VARIANT_LIST}, - "id": { - "target": PROMPT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "arn": { - "target": PROMPT_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "version": { - "target": VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -CREATE_PROMPT = Schema( - id=ShapeID("com.amazonaws.bedrockagent#CreatePrompt"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType({"code": 201, "method": "POST", "uri": "/prompts/"}), - ) - ], -) - -PROMPT_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrockagent#PromptIdentifier"), - shape_type=ShapeType.STRING, -) - -CREATE_PROMPT_VERSION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#CreatePromptVersionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#CreatePromptVersionRequest", - ) - ], - members={ - "promptIdentifier": { - "target": PROMPT_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "description": {"target": PROMPT_DESCRIPTION}, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "tags": {"target": TAGS_MAP}, - }, -) - -CREATE_PROMPT_VERSION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#CreatePromptVersionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#CreatePromptVersionResponse", - ) - ], - members={ - "name": { - "target": PROMPT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": PROMPT_DESCRIPTION}, - "customerEncryptionKeyArn": {"target": KMS_KEY_ARN}, - "defaultVariant": {"target": PROMPT_VARIANT_NAME}, - "variants": {"target": PROMPT_VARIANT_LIST}, - "id": { - "target": PROMPT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "arn": { - "target": PROMPT_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "version": { - "target": VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -CREATE_PROMPT_VERSION = Schema( - id=ShapeID("com.amazonaws.bedrockagent#CreatePromptVersion"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 201, - "method": "POST", - "uri": "/prompts/{promptIdentifier}/versions", - } - ), - ) - ], -) - -DELETE_PROMPT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#DeletePromptInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#DeletePromptRequest", - ) - ], - members={ - "promptIdentifier": { - "target": PROMPT_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "promptVersion": { - "target": NUMERICAL_VERSION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="promptVersion") - ], - }, - }, -) - -DELETE_PROMPT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#DeletePromptOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#DeletePromptResponse", - ) - ], - members={ - "id": { - "target": PROMPT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "version": {"target": NUMERICAL_VERSION}, - }, -) - -DELETE_PROMPT = Schema( - id=ShapeID("com.amazonaws.bedrockagent#DeletePrompt"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "DELETE", "uri": "/prompts/{promptIdentifier}/"} - ), - ) - ], -) - -GET_PROMPT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#GetPromptInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#GetPromptRequest", - ) - ], - members={ - "promptIdentifier": { - "target": PROMPT_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "promptVersion": { - "target": VERSION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="promptVersion") - ], - }, - "includedData": { - "target": INCLUDED_DATA, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="includedData") - ], - }, - }, -) - -GET_PROMPT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#GetPromptOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#GetPromptResponse", - ) - ], - members={ - "name": { - "target": PROMPT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": PROMPT_DESCRIPTION}, - "customerEncryptionKeyArn": {"target": KMS_KEY_ARN}, - "defaultVariant": {"target": PROMPT_VARIANT_NAME}, - "variants": {"target": PROMPT_VARIANT_LIST}, - "id": { - "target": PROMPT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "arn": { - "target": PROMPT_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "version": { - "target": VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -GET_PROMPT = Schema( - id=ShapeID("com.amazonaws.bedrockagent#GetPrompt"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "GET", "uri": "/prompts/{promptIdentifier}/"} - ), - ) - ], -) - -LIST_PROMPTS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ListPromptsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#ListPromptsRequest", - ) - ], - members={ - "promptIdentifier": { - "target": PROMPT_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="promptIdentifier") - ], - }, - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - }, -) - -PROMPT_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#PromptSummary"), - members={ - "name": { - "target": PROMPT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": PROMPT_DESCRIPTION}, - "id": { - "target": PROMPT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "arn": { - "target": PROMPT_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "version": { - "target": VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -PROMPT_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#PromptSummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": PROMPT_SUMMARY}}, -) - -LIST_PROMPTS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ListPromptsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#ListPromptsResponse", - ) - ], - members={ - "promptSummaries": { - "target": PROMPT_SUMMARIES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": NEXT_TOKEN}, - }, -) - -LIST_PROMPTS = Schema( - id=ShapeID("com.amazonaws.bedrockagent#ListPrompts"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType({"code": 200, "method": "GET", "uri": "/prompts/"}), - ) - ], -) - -UPDATE_PROMPT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#UpdatePromptInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#UpdatePromptRequest", - ) - ], - members={ - "name": { - "target": PROMPT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": PROMPT_DESCRIPTION}, - "customerEncryptionKeyArn": {"target": KMS_KEY_ARN}, - "defaultVariant": {"target": PROMPT_VARIANT_NAME}, - "variants": {"target": PROMPT_VARIANT_LIST}, - "promptIdentifier": { - "target": PROMPT_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -UPDATE_PROMPT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#UpdatePromptOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#UpdatePromptResponse", - ) - ], - members={ - "name": { - "target": PROMPT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": PROMPT_DESCRIPTION}, - "customerEncryptionKeyArn": {"target": KMS_KEY_ARN}, - "defaultVariant": {"target": PROMPT_VARIANT_NAME}, - "variants": {"target": PROMPT_VARIANT_LIST}, - "id": { - "target": PROMPT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "arn": { - "target": PROMPT_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "version": { - "target": VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -UPDATE_PROMPT = Schema( - id=ShapeID("com.amazonaws.bedrockagent#UpdatePrompt"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "PUT", "uri": "/prompts/{promptIdentifier}/"} - ), - ) - ], -) - -PUT_RESOURCE_POLICY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#PutResourcePolicyInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#PutResourcePolicyRequest", - ) - ], - members={ - "resourceArn": { - "target": RESOURCE_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "policy": { - "target": RESOURCE_POLICY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "expectedRevisionId": {"target": REVISION_ID}, - }, -) - -PUT_RESOURCE_POLICY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#PutResourcePolicyOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#PutResourcePolicyResponse", - ) - ], - members={ - "resourceArn": { - "target": RESOURCE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "revisionId": { - "target": REVISION_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -PUT_RESOURCE_POLICY = Schema( - id=ShapeID("com.amazonaws.bedrockagent#PutResourcePolicy"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "PUT", "uri": "/resourcepolicy/{resourceArn}"} - ), - ) - ], -) - -TAGGABLE_RESOURCES_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagent#TaggableResourcesArn"), - shape_type=ShapeType.STRING, -) - -LIST_TAGS_FOR_RESOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ListTagsForResourceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#ListTagsForResourceRequest", - ) - ], - members={ - "resourceArn": { - "target": TAGGABLE_RESOURCES_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -LIST_TAGS_FOR_RESOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ListTagsForResourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#ListTagsForResourceResponse", - ) - ], - members={"tags": {"target": TAGS_MAP}}, -) - -LIST_TAGS_FOR_RESOURCE = Schema( - id=ShapeID("com.amazonaws.bedrockagent#ListTagsForResource"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "GET", "uri": "/tags/{resourceArn}"} - ), - ) - ], -) - -TAG_RESOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#TagResourceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#TagResourceRequest", - ) - ], - members={ - "resourceArn": { - "target": TAGGABLE_RESOURCES_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "tags": { - "target": TAGS_MAP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -TAG_RESOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#TagResourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#TagResourceResponse", - ) - ], -) - -TAG_RESOURCE = Schema( - id=ShapeID("com.amazonaws.bedrockagent#TagResource"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "POST", "uri": "/tags/{resourceArn}"} - ), - ) - ], -) - -TAG_KEY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#TagKeyList"), - shape_type=ShapeType.LIST, - members={"member": {"target": TAG_KEY}}, -) - -UNTAG_RESOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#UntagResourceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#UntagResourceRequest", - ) - ], - members={ - "resourceArn": { - "target": TAGGABLE_RESOURCES_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "tagKeys": { - "target": TAG_KEY_LIST, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="tagKeys"), - ], - }, - }, -) - -UNTAG_RESOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#UntagResourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#UntagResourceResponse", - ) - ], -) - -UNTAG_RESOURCE = Schema( - id=ShapeID("com.amazonaws.bedrockagent#UntagResource"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "DELETE", "uri": "/tags/{resourceArn}"} - ), - ) - ], -) - -VALIDATE_FLOW_DEFINITION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ValidateFlowDefinitionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#ValidateFlowDefinitionResponse", - ) - ], - members={ - "validations": { - "target": FLOW_VALIDATIONS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -DELETE_AGENT_VERSION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#DeleteAgentVersionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#DeleteAgentVersionRequest", - ) - ], - members={ - "agentId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "agentVersion": { - "target": NUMERICAL_VERSION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "skipResourceInUseCheck": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=False), - Trait.new( - id=ShapeID("smithy.api#httpQuery"), value="skipResourceInUseCheck" - ), - ], - }, - }, -) - -DELETE_AGENT_VERSION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#DeleteAgentVersionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#DeleteAgentVersionResponse", - ) - ], - members={ - "agentId": { - "target": ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentVersion": { - "target": NUMERICAL_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentStatus": { - "target": AGENT_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -DELETE_AGENT_VERSION = Schema( - id=ShapeID("com.amazonaws.bedrockagent#DeleteAgentVersion"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 202, - "method": "DELETE", - "uri": "/agents/{agentId}/agentversions/{agentVersion}/", - } - ), - ) - ], -) - -GET_AGENT_VERSION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#GetAgentVersionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#GetAgentVersionRequest", - ) - ], - members={ - "agentId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "agentVersion": { - "target": NUMERICAL_VERSION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -GET_AGENT_VERSION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#GetAgentVersionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#GetAgentVersionResponse", - ) - ], - members={ - "agentVersion": { - "target": AGENT_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -GET_AGENT_VERSION = Schema( - id=ShapeID("com.amazonaws.bedrockagent#GetAgentVersion"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/agents/{agentId}/agentversions/{agentVersion}/", - } - ), - ) - ], -) - -LIST_AGENT_VERSIONS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ListAgentVersionsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#ListAgentVersionsRequest", - ) - ], - members={ - "agentId": { - "target": ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "maxResults": {"target": MAX_RESULTS}, - "nextToken": {"target": NEXT_TOKEN}, - }, -) - -LIST_AGENT_VERSIONS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ListAgentVersionsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#ListAgentVersionsResponse", - ) - ], - members={ - "agentVersionSummaries": { - "target": AGENT_VERSION_SUMMARIES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": NEXT_TOKEN}, - }, -) - -LIST_AGENT_VERSIONS = Schema( - id=ShapeID("com.amazonaws.bedrockagent#ListAgentVersions"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "POST", - "uri": "/agents/{agentId}/agentversions/", - } - ), - ) - ], -) - -FLOW_DEFINITION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#FlowDefinition"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - # This needs to reference a schema that isn't defined yet. - # It will be populated with a non-null value at the end of the file. - "nodes": None, - "connections": {"target": FLOW_CONNECTIONS}, - }, -) - -FLOW_NODE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#FlowNode"), - members={ - "name": { - "target": FLOW_NODE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "type": { - "target": FLOW_NODE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - # This needs to reference a schema that isn't defined yet. - # It will be populated with a non-null value at the end of the file. - "configuration": None, - "inputs": {"target": FLOW_NODE_INPUTS}, - "outputs": {"target": FLOW_NODE_OUTPUTS}, - }, -) - -FLOW_NODE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#FlowNodeConfiguration"), - shape_type=ShapeType.UNION, - members={ - "input": {"target": INPUT_FLOW_NODE_CONFIGURATION}, - "output": {"target": OUTPUT_FLOW_NODE_CONFIGURATION}, - "knowledgeBase": {"target": KNOWLEDGE_BASE_FLOW_NODE_CONFIGURATION}, - "condition": {"target": CONDITION_FLOW_NODE_CONFIGURATION}, - "lex": {"target": LEX_FLOW_NODE_CONFIGURATION}, - "prompt": {"target": PROMPT_FLOW_NODE_CONFIGURATION}, - "lambdaFunction": {"target": LAMBDA_FUNCTION_FLOW_NODE_CONFIGURATION}, - "storage": {"target": STORAGE_FLOW_NODE_CONFIGURATION}, - "agent": {"target": AGENT_FLOW_NODE_CONFIGURATION}, - "retrieval": {"target": RETRIEVAL_FLOW_NODE_CONFIGURATION}, - "iterator": {"target": ITERATOR_FLOW_NODE_CONFIGURATION}, - "collector": {"target": COLLECTOR_FLOW_NODE_CONFIGURATION}, - "inlineCode": {"target": INLINE_CODE_FLOW_NODE_CONFIGURATION}, - # This needs to reference a schema that isn't defined yet. - # It will be populated with a non-null value at the end of the file. - "loop": None, - "loopInput": {"target": LOOP_INPUT_FLOW_NODE_CONFIGURATION}, - "loopController": {"target": LOOP_CONTROLLER_FLOW_NODE_CONFIGURATION}, - }, -) - -FLOW_NODES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#FlowNodes"), - shape_type=ShapeType.LIST, - members={"member": {"target": FLOW_NODE}}, -) - -LOOP_FLOW_NODE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#LoopFlowNodeConfiguration"), - members={ - "definition": { - "target": FLOW_DEFINITION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -CREATE_FLOW_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#CreateFlowInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#CreateFlowRequest", - ) - ], - members={ - "name": { - "target": FLOW_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": FLOW_DESCRIPTION}, - "executionRoleArn": { - "target": FLOW_EXECUTION_ROLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "customerEncryptionKeyArn": {"target": KMS_KEY_ARN}, - "definition": {"target": FLOW_DEFINITION}, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "tags": {"target": TAGS_MAP}, - }, -) - -CREATE_FLOW_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#CreateFlowOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#CreateFlowResponse", - ) - ], - members={ - "name": { - "target": FLOW_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": FLOW_DESCRIPTION}, - "executionRoleArn": { - "target": FLOW_EXECUTION_ROLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "customerEncryptionKeyArn": {"target": KMS_KEY_ARN}, - "id": { - "target": FLOW_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "arn": { - "target": FLOW_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": FLOW_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "version": { - "target": DRAFT_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "definition": {"target": FLOW_DEFINITION}, - }, -) - -CREATE_FLOW_VERSION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#CreateFlowVersionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#CreateFlowVersionResponse", - ) - ], - members={ - "name": { - "target": FLOW_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": FLOW_DESCRIPTION}, - "executionRoleArn": { - "target": FLOW_EXECUTION_ROLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "customerEncryptionKeyArn": {"target": KMS_KEY_ARN}, - "id": { - "target": FLOW_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "arn": { - "target": FLOW_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": FLOW_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "version": { - "target": NUMERICAL_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "definition": {"target": FLOW_DEFINITION}, - }, -) - -GET_FLOW_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#GetFlowOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#GetFlowResponse", - ) - ], - members={ - "name": { - "target": FLOW_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": FLOW_DESCRIPTION}, - "executionRoleArn": { - "target": FLOW_EXECUTION_ROLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "customerEncryptionKeyArn": {"target": KMS_KEY_ARN}, - "id": { - "target": FLOW_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "arn": { - "target": FLOW_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": FLOW_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "version": { - "target": DRAFT_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "definition": {"target": FLOW_DEFINITION}, - "validations": {"target": FLOW_VALIDATIONS}, - }, -) - -GET_FLOW_VERSION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#GetFlowVersionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#GetFlowVersionResponse", - ) - ], - members={ - "name": { - "target": FLOW_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": FLOW_DESCRIPTION}, - "executionRoleArn": { - "target": FLOW_EXECUTION_ROLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "customerEncryptionKeyArn": {"target": KMS_KEY_ARN}, - "id": { - "target": FLOW_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "arn": { - "target": FLOW_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": FLOW_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "version": { - "target": NUMERICAL_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "definition": {"target": FLOW_DEFINITION}, - }, -) - -UPDATE_FLOW_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#UpdateFlowInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#UpdateFlowRequest", - ) - ], - members={ - "name": { - "target": FLOW_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": FLOW_DESCRIPTION}, - "executionRoleArn": { - "target": FLOW_EXECUTION_ROLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "customerEncryptionKeyArn": {"target": KMS_KEY_ARN}, - "definition": {"target": FLOW_DEFINITION}, - "flowIdentifier": { - "target": FLOW_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -UPDATE_FLOW_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#UpdateFlowOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#UpdateFlowResponse", - ) - ], - members={ - "name": { - "target": FLOW_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": FLOW_DESCRIPTION}, - "executionRoleArn": { - "target": FLOW_EXECUTION_ROLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "customerEncryptionKeyArn": {"target": KMS_KEY_ARN}, - "id": { - "target": FLOW_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "arn": { - "target": FLOW_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": FLOW_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "version": { - "target": DRAFT_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "definition": {"target": FLOW_DEFINITION}, - }, -) - -VALIDATE_FLOW_DEFINITION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagent#ValidateFlowDefinitionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagent#ValidateFlowDefinitionRequest", - ) - ], - members={ - "definition": { - "target": FLOW_DEFINITION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -CREATE_FLOW_VERSION = Schema( - id=ShapeID("com.amazonaws.bedrockagent#CreateFlowVersion"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 201, - "method": "POST", - "uri": "/flows/{flowIdentifier}/versions", - } - ), - ) - ], -) - -GET_FLOW = Schema( - id=ShapeID("com.amazonaws.bedrockagent#GetFlow"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "GET", "uri": "/flows/{flowIdentifier}/"} - ), - ) - ], -) - -GET_FLOW_VERSION = Schema( - id=ShapeID("com.amazonaws.bedrockagent#GetFlowVersion"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/flows/{flowIdentifier}/versions/{flowVersion}/", - } - ), - ) - ], -) - -VALIDATE_FLOW_DEFINITION = Schema( - id=ShapeID("com.amazonaws.bedrockagent#ValidateFlowDefinition"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "POST", "uri": "/flows/validate-definition"} - ), - ) - ], -) - -CREATE_FLOW = Schema( - id=ShapeID("com.amazonaws.bedrockagent#CreateFlow"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType({"code": 201, "method": "POST", "uri": "/flows/"}), - ) - ], -) - -UPDATE_FLOW = Schema( - id=ShapeID("com.amazonaws.bedrockagent#UpdateFlow"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "PUT", "uri": "/flows/{flowIdentifier}/"} - ), - ) - ], -) - -AMAZON_BEDROCK_AGENT_BUILD_TIME_LAMBDA = Schema( - id=ShapeID("com.amazonaws.bedrockagent#AmazonBedrockAgentBuildTimeLambda"), - shape_type=ShapeType.SERVICE, - traits=[ - Trait.new( - id=ShapeID("aws.auth#sigv4"), value=MappingProxyType({"name": "bedrock"}) - ), - Trait.new( - id=ShapeID("smithy.rules#endpointBdd"), - value=MappingProxyType( - { - "version": "1.1", - "parameters": MappingProxyType( - { - "Region": MappingProxyType( - { - "builtIn": "AWS::Region", - "required": False, - "documentation": "The AWS region used to dispatch the request.", - "type": "string", - } - ), - "UseDualStack": MappingProxyType( - { - "builtIn": "AWS::UseDualStack", - "required": True, - "default": False, - "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", - "type": "boolean", - } - ), - "UseFIPS": MappingProxyType( - { - "builtIn": "AWS::UseFIPS", - "required": True, - "default": False, - "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", - "type": "boolean", - } - ), - "Endpoint": MappingProxyType( - { - "builtIn": "SDK::Endpoint", - "required": False, - "documentation": "Override the endpoint used to send this request", - "type": "string", - } - ), - } - ), - "conditions": ( - MappingProxyType( - { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "Endpoint"}),), - } - ), - MappingProxyType( +AMAZON_BEDROCK_AGENT_BUILD_TIME_LAMBDA: StaticSchema = ( + 21, + n0, + _ABABTL, + { + _aw: MappingProxyType({"name": "bedrock"}), + _sBm: MappingProxyType( + { + "version": "1.1", + "parameters": MappingProxyType( + { + "Region": MappingProxyType( { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "Region"}),), + "builtIn": "AWS::Region", + "required": False, + "documentation": "The AWS region used to dispatch the request.", + "type": "string", } ), - MappingProxyType( + "UseDualStack": MappingProxyType( { - "fn": "aws.partition", - "argv": (MappingProxyType({"ref": "Region"}),), - "assign": "PartitionResult", + "builtIn": "AWS::UseDualStack", + "required": True, + "default": False, + "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", + "type": "boolean", } ), - MappingProxyType( + "UseFIPS": MappingProxyType( { - "fn": "booleanEquals", - "argv": (MappingProxyType({"ref": "UseFIPS"}), True), - } - ), - MappingProxyType( - { - "fn": "booleanEquals", - "argv": ( - MappingProxyType({"ref": "UseDualStack"}), - True, - ), - } - ), - MappingProxyType( - { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "supportsDualStack", - ), - } - ), - True, - ), + "builtIn": "AWS::UseFIPS", + "required": True, + "default": False, + "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", + "type": "boolean", } ), - MappingProxyType( + "Endpoint": MappingProxyType( { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "supportsFIPS", - ), - } - ), - True, - ), + "builtIn": "SDK::Endpoint", + "required": False, + "documentation": "Override the endpoint used to send this request", + "type": "string", } ), + } + ), + "conditions": ( + MappingProxyType( + { + "fn": "isSet", + "argv": (MappingProxyType({"ref": "Endpoint"}),), + } ), - "results": ( - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: FIPS and custom endpoint are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": MappingProxyType({"ref": "Endpoint"}), - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://bedrock-agent-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "FIPS and DualStack are enabled, but this partition does not support one or both", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://bedrock-agent-fips.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "FIPS is enabled but this partition does not support FIPS", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + MappingProxyType( + {"fn": "isSet", "argv": (MappingProxyType({"ref": "Region"}),)} + ), + MappingProxyType( + { + "fn": "aws.partition", + "argv": (MappingProxyType({"ref": "Region"}),), + "assign": "PartitionResult", + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": (MappingProxyType({"ref": "UseFIPS"}), True), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": (MappingProxyType({"ref": "UseDualStack"}), True), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( { - "url": "https://bedrock-agent.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "supportsDualStack", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "DualStack is enabled but this partition does not support DualStack", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + True, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( { - "url": "https://bedrock-agent.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "supportsFIPS", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: Missing Region", - "type": "error", - } - ), + True, + ), + } ), - "root": 2, - "nodeCount": 13, - "nodes": "/////wAAAAH/////AAAAAAAAAAwAAAADAAAAAQAAAAQF9eELAAAAAgAAAAUF9eELAAAAAwAAAAgAAAAGAAAABAAAAAcF9eEKAAAABQX14QgF9eEJAAAABAAAAAoAAAAJAAAABgX14QYF9eEHAAAABQAAAAsF9eEFAAAABgX14QQF9eEFAAAAAwX14QEAAAANAAAABAX14QIF9eED", - } - ), - ), - Trait.new( - id=ShapeID("aws.api#service"), - value=MappingProxyType( - { - "sdkId": "Bedrock Agent", - "arnNamespace": "bedrock", - "endpointPrefix": "bedrock-agent", - "cloudTrailEventSource": "bedrock.amazonaws.com", - } - ), - ), - Trait.new(id=ShapeID("aws.protocols#restJson1")), - Trait.new( - id=ShapeID("smithy.api#cors"), - value=MappingProxyType( - { - "additionalAllowedHeaders": ( - "*", - "content-type", - "x-amz-content-sha256", - "x-amz-user-agent", - "x-amzn-platform-id", - "x-amzn-trace-id", + ), + "results": ( + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: FIPS and custom endpoint are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": MappingProxyType({"ref": "Endpoint"}), + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://bedrock-agent-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS and DualStack are enabled, but this partition does not support one or both", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://bedrock-agent-fips.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } ), - "additionalExposedHeaders": ( - "x-amzn-errortype", - "x-amzn-requestid", - "x-amzn-trace-id", + MappingProxyType( + { + "conditions": (), + "error": "FIPS is enabled but this partition does not support FIPS", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://bedrock-agent.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "DualStack is enabled but this partition does not support DualStack", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://bedrock-agent.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Missing Region", + "type": "error", + } ), - "maxAge": 86400, - } - ), + ), + "root": 2, + "nodeCount": 13, + "nodes": "/////wAAAAH/////AAAAAAAAAAwAAAADAAAAAQAAAAQF9eELAAAAAgAAAAUF9eELAAAAAwAAAAgAAAAGAAAABAAAAAcF9eEKAAAABQX14QgF9eEJAAAABAAAAAoAAAAJAAAABgX14QYF9eEHAAAABQAAAAsF9eEFAAAABgX14QQF9eEFAAAAAwX14QEAAAANAAAABAX14QIF9eED", + } ), - ], -) - -FLOW_DEFINITION.members["nodes"] = Schema.member( - id=FLOW_DEFINITION.id.with_member("nodes"), target=FLOW_NODES, index=0 -) - -FLOW_NODE.members["configuration"] = Schema.member( - id=FLOW_NODE.id.with_member("configuration"), - target=FLOW_NODE_CONFIGURATION, - index=2, -) - -FLOW_NODE_CONFIGURATION.members["loop"] = Schema.member( - id=FLOW_NODE_CONFIGURATION.id.with_member("loop"), - target=LOOP_FLOW_NODE_CONFIGURATION, - index=13, + _aws: MappingProxyType( + { + "sdkId": "Bedrock Agent", + "arnNamespace": "bedrock", + "endpointPrefix": "bedrock-agent", + "cloudTrailEventSource": "bedrock.amazonaws.com", + } + ), + _aJ: None, + _smithyap: MappingProxyType( + { + "additionalAllowedHeaders": ( + "*", + "content-type", + "x-amz-content-sha256", + "x-amz-user-agent", + "x-amzn-platform-id", + "x-amzn-trace-id", + ), + "additionalExposedHeaders": ( + "x-amzn-errortype", + "x-amzn-requestid", + "x-amzn-trace-id", + ), + "maxAge": 86400, + } + ), + }, ) diff --git a/clients/aws-sdk-bedrock-agent/src/aws_sdk_bedrock_agent/client.py b/clients/aws-sdk-bedrock-agent/src/aws_sdk_bedrock_agent/client.py index 04aa816a..bdf62f89 100644 --- a/clients/aws-sdk-bedrock-agent/src/aws_sdk_bedrock_agent/client.py +++ b/clients/aws-sdk-bedrock-agent/src/aws_sdk_bedrock_agent/client.py @@ -1,28 +1,26 @@ # Code generated by smithy-python-codegen DO NOT EDIT. +from __future__ import annotations + from copy import deepcopy import logging from typing import Any, cast +from smithy_aws_core.aio.identity.chain import AsyncIdentityChain from smithy_aws_core.config import ConfigSource from smithy_aws_core.identity import AWSCredentialsIdentity -from smithy_aws_core.identity.chain import IdentityChain -from smithy_core.aio.client import AsyncClient, ClientCall, RequestPipeline +from smithy_core.aio.client import AsyncClient, AsyncClientCall, AsyncRequestPipeline from smithy_core.deserializers import DeserializeableShape from smithy_core.exceptions import ExpectationNotMetError from smithy_core.schemas import APIOperation from smithy_core.serializers import SerializeableShape -from smithy_http.aio.interfaces import HTTPClient +from smithy_http.aio.interfaces import AsyncHTTPClient from smithy_http.plugins import user_agent_plugin from .config import AsyncBedrockAgentConfig, Plugin from .models import ( ASSOCIATE_AGENT_COLLABORATOR, ASSOCIATE_AGENT_KNOWLEDGE_BASE, - AssociateAgentCollaboratorInput, - AssociateAgentCollaboratorOutput, - AssociateAgentKnowledgeBaseInput, - AssociateAgentKnowledgeBaseOutput, CREATE_AGENT, CREATE_AGENT_ACTION_GROUP, CREATE_AGENT_ALIAS, @@ -34,28 +32,6 @@ CREATE_PROMPT, CREATE_PROMPT_VERSION, CREATE_VPC_CONFIGURATION, - CreateAgentActionGroupInput, - CreateAgentActionGroupOutput, - CreateAgentAliasInput, - CreateAgentAliasOutput, - CreateAgentInput, - CreateAgentOutput, - CreateDataSourceInput, - CreateDataSourceOutput, - CreateFlowAliasInput, - CreateFlowAliasOutput, - CreateFlowInput, - CreateFlowOutput, - CreateFlowVersionInput, - CreateFlowVersionOutput, - CreateKnowledgeBaseInput, - CreateKnowledgeBaseOutput, - CreatePromptInput, - CreatePromptOutput, - CreatePromptVersionInput, - CreatePromptVersionOutput, - CreateVpcConfigurationInput, - CreateVpcConfigurationOutput, DELETE_AGENT, DELETE_AGENT_ACTION_GROUP, DELETE_AGENT_ALIAS, @@ -71,36 +47,6 @@ DELETE_VPC_CONFIGURATION, DISASSOCIATE_AGENT_COLLABORATOR, DISASSOCIATE_AGENT_KNOWLEDGE_BASE, - DeleteAgentActionGroupInput, - DeleteAgentActionGroupOutput, - DeleteAgentAliasInput, - DeleteAgentAliasOutput, - DeleteAgentInput, - DeleteAgentOutput, - DeleteAgentVersionInput, - DeleteAgentVersionOutput, - DeleteDataSourceInput, - DeleteDataSourceOutput, - DeleteFlowAliasInput, - DeleteFlowAliasOutput, - DeleteFlowInput, - DeleteFlowOutput, - DeleteFlowVersionInput, - DeleteFlowVersionOutput, - DeleteKnowledgeBaseDocumentsInput, - DeleteKnowledgeBaseDocumentsOutput, - DeleteKnowledgeBaseInput, - DeleteKnowledgeBaseOutput, - DeletePromptInput, - DeletePromptOutput, - DeleteResourcePolicyInput, - DeleteResourcePolicyOutput, - DeleteVpcConfigurationInput, - DeleteVpcConfigurationOutput, - DisassociateAgentCollaboratorInput, - DisassociateAgentCollaboratorOutput, - DisassociateAgentKnowledgeBaseInput, - DisassociateAgentKnowledgeBaseOutput, GET_AGENT, GET_AGENT_ACTION_GROUP, GET_AGENT_ALIAS, @@ -117,41 +63,7 @@ GET_PROMPT, GET_RESOURCE_POLICY, GET_VPC_CONFIGURATION, - GetAgentActionGroupInput, - GetAgentActionGroupOutput, - GetAgentAliasInput, - GetAgentAliasOutput, - GetAgentCollaboratorInput, - GetAgentCollaboratorOutput, - GetAgentInput, - GetAgentKnowledgeBaseInput, - GetAgentKnowledgeBaseOutput, - GetAgentOutput, - GetAgentVersionInput, - GetAgentVersionOutput, - GetDataSourceInput, - GetDataSourceOutput, - GetFlowAliasInput, - GetFlowAliasOutput, - GetFlowInput, - GetFlowOutput, - GetFlowVersionInput, - GetFlowVersionOutput, - GetIngestionJobInput, - GetIngestionJobOutput, - GetKnowledgeBaseDocumentsInput, - GetKnowledgeBaseDocumentsOutput, - GetKnowledgeBaseInput, - GetKnowledgeBaseOutput, - GetPromptInput, - GetPromptOutput, - GetResourcePolicyInput, - GetResourcePolicyOutput, - GetVpcConfigurationInput, - GetVpcConfigurationOutput, INGEST_KNOWLEDGE_BASE_DOCUMENTS, - IngestKnowledgeBaseDocumentsInput, - IngestKnowledgeBaseDocumentsOutput, LIST_AGENTS, LIST_AGENT_ACTION_GROUPS, LIST_AGENT_ALIASES, @@ -168,56 +80,12 @@ LIST_PROMPTS, LIST_TAGS_FOR_RESOURCE, LIST_VPC_CONFIGURATIONS, - ListAgentActionGroupsInput, - ListAgentActionGroupsOutput, - ListAgentAliasesInput, - ListAgentAliasesOutput, - ListAgentCollaboratorsInput, - ListAgentCollaboratorsOutput, - ListAgentKnowledgeBasesInput, - ListAgentKnowledgeBasesOutput, - ListAgentVersionsInput, - ListAgentVersionsOutput, - ListAgentsInput, - ListAgentsOutput, - ListDataSourcesInput, - ListDataSourcesOutput, - ListFlowAliasesInput, - ListFlowAliasesOutput, - ListFlowVersionsInput, - ListFlowVersionsOutput, - ListFlowsInput, - ListFlowsOutput, - ListIngestionJobsInput, - ListIngestionJobsOutput, - ListKnowledgeBaseDocumentsInput, - ListKnowledgeBaseDocumentsOutput, - ListKnowledgeBasesInput, - ListKnowledgeBasesOutput, - ListPromptsInput, - ListPromptsOutput, - ListTagsForResourceInput, - ListTagsForResourceOutput, - ListVpcConfigurationsInput, - ListVpcConfigurationsOutput, PREPARE_AGENT, PREPARE_FLOW, PUT_RESOURCE_POLICY, - PrepareAgentInput, - PrepareAgentOutput, - PrepareFlowInput, - PrepareFlowOutput, - PutResourcePolicyInput, - PutResourcePolicyOutput, START_INGESTION_JOB, STOP_INGESTION_JOB, - StartIngestionJobInput, - StartIngestionJobOutput, - StopIngestionJobInput, - StopIngestionJobOutput, TAG_RESOURCE, - TagResourceInput, - TagResourceOutput, UNTAG_RESOURCE, UPDATE_AGENT, UPDATE_AGENT_ACTION_GROUP, @@ -229,34 +97,174 @@ UPDATE_FLOW_ALIAS, UPDATE_KNOWLEDGE_BASE, UPDATE_PROMPT, - UntagResourceInput, - UntagResourceOutput, - UpdateAgentActionGroupInput, - UpdateAgentActionGroupOutput, - UpdateAgentAliasInput, - UpdateAgentAliasOutput, - UpdateAgentCollaboratorInput, - UpdateAgentCollaboratorOutput, - UpdateAgentInput, - UpdateAgentKnowledgeBaseInput, - UpdateAgentKnowledgeBaseOutput, - UpdateAgentOutput, - UpdateDataSourceInput, - UpdateDataSourceOutput, - UpdateFlowAliasInput, - UpdateFlowAliasOutput, - UpdateFlowInput, - UpdateFlowOutput, - UpdateKnowledgeBaseInput, - UpdateKnowledgeBaseOutput, - UpdatePromptInput, - UpdatePromptOutput, VALIDATE_FLOW_DEFINITION, - ValidateFlowDefinitionInput, - ValidateFlowDefinitionOutput, ) from .user_agent import aws_user_agent_plugin +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .models import ( + AssociateAgentCollaboratorInput, + AssociateAgentCollaboratorOutput, + AssociateAgentKnowledgeBaseInput, + AssociateAgentKnowledgeBaseOutput, + CreateAgentActionGroupInput, + CreateAgentActionGroupOutput, + CreateAgentAliasInput, + CreateAgentAliasOutput, + CreateAgentInput, + CreateAgentOutput, + CreateDataSourceInput, + CreateDataSourceOutput, + CreateFlowAliasInput, + CreateFlowAliasOutput, + CreateFlowInput, + CreateFlowOutput, + CreateFlowVersionInput, + CreateFlowVersionOutput, + CreateKnowledgeBaseInput, + CreateKnowledgeBaseOutput, + CreatePromptInput, + CreatePromptOutput, + CreatePromptVersionInput, + CreatePromptVersionOutput, + CreateVpcConfigurationInput, + CreateVpcConfigurationOutput, + DeleteAgentActionGroupInput, + DeleteAgentActionGroupOutput, + DeleteAgentAliasInput, + DeleteAgentAliasOutput, + DeleteAgentInput, + DeleteAgentOutput, + DeleteAgentVersionInput, + DeleteAgentVersionOutput, + DeleteDataSourceInput, + DeleteDataSourceOutput, + DeleteFlowAliasInput, + DeleteFlowAliasOutput, + DeleteFlowInput, + DeleteFlowOutput, + DeleteFlowVersionInput, + DeleteFlowVersionOutput, + DeleteKnowledgeBaseDocumentsInput, + DeleteKnowledgeBaseDocumentsOutput, + DeleteKnowledgeBaseInput, + DeleteKnowledgeBaseOutput, + DeletePromptInput, + DeletePromptOutput, + DeleteResourcePolicyInput, + DeleteResourcePolicyOutput, + DeleteVpcConfigurationInput, + DeleteVpcConfigurationOutput, + DisassociateAgentCollaboratorInput, + DisassociateAgentCollaboratorOutput, + DisassociateAgentKnowledgeBaseInput, + DisassociateAgentKnowledgeBaseOutput, + GetAgentActionGroupInput, + GetAgentActionGroupOutput, + GetAgentAliasInput, + GetAgentAliasOutput, + GetAgentCollaboratorInput, + GetAgentCollaboratorOutput, + GetAgentInput, + GetAgentKnowledgeBaseInput, + GetAgentKnowledgeBaseOutput, + GetAgentOutput, + GetAgentVersionInput, + GetAgentVersionOutput, + GetDataSourceInput, + GetDataSourceOutput, + GetFlowAliasInput, + GetFlowAliasOutput, + GetFlowInput, + GetFlowOutput, + GetFlowVersionInput, + GetFlowVersionOutput, + GetIngestionJobInput, + GetIngestionJobOutput, + GetKnowledgeBaseDocumentsInput, + GetKnowledgeBaseDocumentsOutput, + GetKnowledgeBaseInput, + GetKnowledgeBaseOutput, + GetPromptInput, + GetPromptOutput, + GetResourcePolicyInput, + GetResourcePolicyOutput, + GetVpcConfigurationInput, + GetVpcConfigurationOutput, + IngestKnowledgeBaseDocumentsInput, + IngestKnowledgeBaseDocumentsOutput, + ListAgentActionGroupsInput, + ListAgentActionGroupsOutput, + ListAgentAliasesInput, + ListAgentAliasesOutput, + ListAgentCollaboratorsInput, + ListAgentCollaboratorsOutput, + ListAgentKnowledgeBasesInput, + ListAgentKnowledgeBasesOutput, + ListAgentVersionsInput, + ListAgentVersionsOutput, + ListAgentsInput, + ListAgentsOutput, + ListDataSourcesInput, + ListDataSourcesOutput, + ListFlowAliasesInput, + ListFlowAliasesOutput, + ListFlowVersionsInput, + ListFlowVersionsOutput, + ListFlowsInput, + ListFlowsOutput, + ListIngestionJobsInput, + ListIngestionJobsOutput, + ListKnowledgeBaseDocumentsInput, + ListKnowledgeBaseDocumentsOutput, + ListKnowledgeBasesInput, + ListKnowledgeBasesOutput, + ListPromptsInput, + ListPromptsOutput, + ListTagsForResourceInput, + ListTagsForResourceOutput, + ListVpcConfigurationsInput, + ListVpcConfigurationsOutput, + PrepareAgentInput, + PrepareAgentOutput, + PrepareFlowInput, + PrepareFlowOutput, + PutResourcePolicyInput, + PutResourcePolicyOutput, + StartIngestionJobInput, + StartIngestionJobOutput, + StopIngestionJobInput, + StopIngestionJobOutput, + TagResourceInput, + TagResourceOutput, + UntagResourceInput, + UntagResourceOutput, + UpdateAgentActionGroupInput, + UpdateAgentActionGroupOutput, + UpdateAgentAliasInput, + UpdateAgentAliasOutput, + UpdateAgentCollaboratorInput, + UpdateAgentCollaboratorOutput, + UpdateAgentInput, + UpdateAgentKnowledgeBaseInput, + UpdateAgentKnowledgeBaseOutput, + UpdateAgentOutput, + UpdateDataSourceInput, + UpdateDataSourceOutput, + UpdateFlowAliasInput, + UpdateFlowAliasOutput, + UpdateFlowInput, + UpdateFlowOutput, + UpdateKnowledgeBaseInput, + UpdateKnowledgeBaseOutput, + UpdatePromptInput, + UpdatePromptOutput, + ValidateFlowDefinitionInput, + ValidateFlowDefinitionOutput, + ) + logger = logging.getLogger(__name__) @@ -333,12 +341,12 @@ async def _post_setup(self, config: AsyncBedrockAgentConfig) -> None: config_file = await config_context.parsed_profiles() if config_context.profile_source is ConfigSource.OVERRIDE: profile_name = config_context.profile_name - config.aws_credentials_identity_resolver = await IdentityChain.create( + config.aws_credentials_identity_resolver = await AsyncIdentityChain.create( AWSCredentialsIdentity, config_file=config_file, profile_name=profile_name, region_override=config.region, - http_client=cast(HTTPClient | None, config.transport), + http_client=cast(AsyncHTTPClient | None, config.transport), ) async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( @@ -347,7 +355,7 @@ async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( operation: APIOperation[I, O], default_plugins: list[Plugin], plugins: list[Plugin] | None, - ) -> tuple[RequestPipeline[Any, Any], ClientCall[I, O]]: + ) -> tuple[AsyncRequestPipeline[Any, Any], AsyncClientCall[I, O]]: if self._closed: raise RuntimeError( "Cannot invoke an operation on a client that has been closed." diff --git a/clients/aws-sdk-bedrock-agent/src/aws_sdk_bedrock_agent/config.py b/clients/aws-sdk-bedrock-agent/src/aws_sdk_bedrock_agent/config.py index cbdc1338..4e632824 100644 --- a/clients/aws-sdk-bedrock-agent/src/aws_sdk_bedrock_agent/config.py +++ b/clients/aws-sdk-bedrock-agent/src/aws_sdk_bedrock_agent/config.py @@ -1,311 +1,352 @@ # Code generated by smithy-python-codegen DO NOT EDIT. from dataclasses import dataclass, field -from typing import Any, Callable, ClassVar, Self, TypeAlias, Union, Unpack +from typing import ( + Any, + Callable, + ClassVar, + Self, + TYPE_CHECKING, + TypeAlias, + Union, + Unpack, +) -from smithy_aws_core.aio.protocols import RestJsonClientProtocol -from smithy_aws_core.auth import SigV4AuthScheme -from smithy_aws_core.config import AwsConfigOverrides, FileSystem -from smithy_aws_core.config.aws_config import AsyncAwsConfig -from smithy_aws_core.config.resolvers import EndpointUriResolver -from smithy_aws_core.config.types import FieldSpec -from smithy_aws_core.endpoints.standard_regional import ( - StandardRegionalEndpointsResolver, +from smithy_aws_core.aio.auth.sigv4 import AsyncSigV4AuthScheme +from smithy_aws_core.aio.config import AsyncFileSystem +from smithy_aws_core.aio.config.aws_config import AsyncAwsConfig, AwsConfigOverrides +from smithy_aws_core.aio.config.resolvers import EndpointUriResolver +from smithy_aws_core.aio.endpoints.standard_regional import ( + AsyncStandardRegionalEndpointsResolver, ) +from smithy_aws_core.aio.protocols import AsyncRestJsonClientProtocol +from smithy_aws_core.config.types import FieldSpec from smithy_aws_core.identity import AWSCredentialsIdentity, AWSIdentityProperties -from smithy_core.aio.interfaces import ( - ClientProtocol, - EndpointResolver, - ProtocolConstructor, - ProtocolSettings, -) -from smithy_core.aio.interfaces.auth import AuthScheme -from smithy_core.aio.interfaces.identity import IdentityResolver -from smithy_core.interceptors import Interceptor +from smithy_core.aio.interfaces import AsyncClientProtocol, AsyncEndpointResolver +from smithy_core.aio.interfaces.auth import AsyncAuthScheme +from smithy_core.aio.interfaces.identity import AsyncIdentityResolver +from smithy_core.interfaces import ProtocolConstructor, ProtocolSettings from smithy_core.interfaces.auth import AuthSchemeResolver from smithy_core.shapes import ShapeID from smithy_http.aio.aiohttp import AIOHTTPClient +from ._private.schemas import AMAZON_BEDROCK_AGENT_BUILD_TIME_LAMBDA from .auth import HTTPAuthSchemeResolver -from .models import ( - AssociateAgentCollaboratorInput, - AssociateAgentCollaboratorOutput, - AssociateAgentKnowledgeBaseInput, - AssociateAgentKnowledgeBaseOutput, - CreateAgentActionGroupInput, - CreateAgentActionGroupOutput, - CreateAgentAliasInput, - CreateAgentAliasOutput, - CreateAgentInput, - CreateAgentOutput, - CreateDataSourceInput, - CreateDataSourceOutput, - CreateFlowAliasInput, - CreateFlowAliasOutput, - CreateFlowInput, - CreateFlowOutput, - CreateFlowVersionInput, - CreateFlowVersionOutput, - CreateKnowledgeBaseInput, - CreateKnowledgeBaseOutput, - CreatePromptInput, - CreatePromptOutput, - CreatePromptVersionInput, - CreatePromptVersionOutput, - CreateVpcConfigurationInput, - CreateVpcConfigurationOutput, - DeleteAgentActionGroupInput, - DeleteAgentActionGroupOutput, - DeleteAgentAliasInput, - DeleteAgentAliasOutput, - DeleteAgentInput, - DeleteAgentOutput, - DeleteAgentVersionInput, - DeleteAgentVersionOutput, - DeleteDataSourceInput, - DeleteDataSourceOutput, - DeleteFlowAliasInput, - DeleteFlowAliasOutput, - DeleteFlowInput, - DeleteFlowOutput, - DeleteFlowVersionInput, - DeleteFlowVersionOutput, - DeleteKnowledgeBaseDocumentsInput, - DeleteKnowledgeBaseDocumentsOutput, - DeleteKnowledgeBaseInput, - DeleteKnowledgeBaseOutput, - DeletePromptInput, - DeletePromptOutput, - DeleteResourcePolicyInput, - DeleteResourcePolicyOutput, - DeleteVpcConfigurationInput, - DeleteVpcConfigurationOutput, - DisassociateAgentCollaboratorInput, - DisassociateAgentCollaboratorOutput, - DisassociateAgentKnowledgeBaseInput, - DisassociateAgentKnowledgeBaseOutput, - GetAgentActionGroupInput, - GetAgentActionGroupOutput, - GetAgentAliasInput, - GetAgentAliasOutput, - GetAgentCollaboratorInput, - GetAgentCollaboratorOutput, - GetAgentInput, - GetAgentKnowledgeBaseInput, - GetAgentKnowledgeBaseOutput, - GetAgentOutput, - GetAgentVersionInput, - GetAgentVersionOutput, - GetDataSourceInput, - GetDataSourceOutput, - GetFlowAliasInput, - GetFlowAliasOutput, - GetFlowInput, - GetFlowOutput, - GetFlowVersionInput, - GetFlowVersionOutput, - GetIngestionJobInput, - GetIngestionJobOutput, - GetKnowledgeBaseDocumentsInput, - GetKnowledgeBaseDocumentsOutput, - GetKnowledgeBaseInput, - GetKnowledgeBaseOutput, - GetPromptInput, - GetPromptOutput, - GetResourcePolicyInput, - GetResourcePolicyOutput, - GetVpcConfigurationInput, - GetVpcConfigurationOutput, - IngestKnowledgeBaseDocumentsInput, - IngestKnowledgeBaseDocumentsOutput, - ListAgentActionGroupsInput, - ListAgentActionGroupsOutput, - ListAgentAliasesInput, - ListAgentAliasesOutput, - ListAgentCollaboratorsInput, - ListAgentCollaboratorsOutput, - ListAgentKnowledgeBasesInput, - ListAgentKnowledgeBasesOutput, - ListAgentVersionsInput, - ListAgentVersionsOutput, - ListAgentsInput, - ListAgentsOutput, - ListDataSourcesInput, - ListDataSourcesOutput, - ListFlowAliasesInput, - ListFlowAliasesOutput, - ListFlowVersionsInput, - ListFlowVersionsOutput, - ListFlowsInput, - ListFlowsOutput, - ListIngestionJobsInput, - ListIngestionJobsOutput, - ListKnowledgeBaseDocumentsInput, - ListKnowledgeBaseDocumentsOutput, - ListKnowledgeBasesInput, - ListKnowledgeBasesOutput, - ListPromptsInput, - ListPromptsOutput, - ListTagsForResourceInput, - ListTagsForResourceOutput, - ListVpcConfigurationsInput, - ListVpcConfigurationsOutput, - PrepareAgentInput, - PrepareAgentOutput, - PrepareFlowInput, - PrepareFlowOutput, - PutResourcePolicyInput, - PutResourcePolicyOutput, - StartIngestionJobInput, - StartIngestionJobOutput, - StopIngestionJobInput, - StopIngestionJobOutput, - TagResourceInput, - TagResourceOutput, - UntagResourceInput, - UntagResourceOutput, - UpdateAgentActionGroupInput, - UpdateAgentActionGroupOutput, - UpdateAgentAliasInput, - UpdateAgentAliasOutput, - UpdateAgentCollaboratorInput, - UpdateAgentCollaboratorOutput, - UpdateAgentInput, - UpdateAgentKnowledgeBaseInput, - UpdateAgentKnowledgeBaseOutput, - UpdateAgentOutput, - UpdateDataSourceInput, - UpdateDataSourceOutput, - UpdateFlowAliasInput, - UpdateFlowAliasOutput, - UpdateFlowInput, - UpdateFlowOutput, - UpdateKnowledgeBaseInput, - UpdateKnowledgeBaseOutput, - UpdatePromptInput, - UpdatePromptOutput, - ValidateFlowDefinitionInput, - ValidateFlowDefinitionOutput, -) -_ServiceInterceptor = Union[ - Interceptor[ - AssociateAgentCollaboratorInput, AssociateAgentCollaboratorOutput, Any, Any - ], - Interceptor[ - AssociateAgentKnowledgeBaseInput, AssociateAgentKnowledgeBaseOutput, Any, Any - ], - Interceptor[CreateAgentInput, CreateAgentOutput, Any, Any], - Interceptor[CreateAgentActionGroupInput, CreateAgentActionGroupOutput, Any, Any], - Interceptor[CreateAgentAliasInput, CreateAgentAliasOutput, Any, Any], - Interceptor[CreateDataSourceInput, CreateDataSourceOutput, Any, Any], - Interceptor[CreateFlowInput, CreateFlowOutput, Any, Any], - Interceptor[CreateFlowAliasInput, CreateFlowAliasOutput, Any, Any], - Interceptor[CreateFlowVersionInput, CreateFlowVersionOutput, Any, Any], - Interceptor[CreateKnowledgeBaseInput, CreateKnowledgeBaseOutput, Any, Any], - Interceptor[CreatePromptInput, CreatePromptOutput, Any, Any], - Interceptor[CreatePromptVersionInput, CreatePromptVersionOutput, Any, Any], - Interceptor[CreateVpcConfigurationInput, CreateVpcConfigurationOutput, Any, Any], - Interceptor[DeleteAgentInput, DeleteAgentOutput, Any, Any], - Interceptor[DeleteAgentActionGroupInput, DeleteAgentActionGroupOutput, Any, Any], - Interceptor[DeleteAgentAliasInput, DeleteAgentAliasOutput, Any, Any], - Interceptor[DeleteAgentVersionInput, DeleteAgentVersionOutput, Any, Any], - Interceptor[DeleteDataSourceInput, DeleteDataSourceOutput, Any, Any], - Interceptor[DeleteFlowInput, DeleteFlowOutput, Any, Any], - Interceptor[DeleteFlowAliasInput, DeleteFlowAliasOutput, Any, Any], - Interceptor[DeleteFlowVersionInput, DeleteFlowVersionOutput, Any, Any], - Interceptor[DeleteKnowledgeBaseInput, DeleteKnowledgeBaseOutput, Any, Any], - Interceptor[ - DeleteKnowledgeBaseDocumentsInput, DeleteKnowledgeBaseDocumentsOutput, Any, Any - ], - Interceptor[DeletePromptInput, DeletePromptOutput, Any, Any], - Interceptor[DeleteResourcePolicyInput, DeleteResourcePolicyOutput, Any, Any], - Interceptor[DeleteVpcConfigurationInput, DeleteVpcConfigurationOutput, Any, Any], - Interceptor[ +if TYPE_CHECKING: + from smithy_core.interceptors import Interceptor + from .models import ( + AssociateAgentCollaboratorInput, + AssociateAgentCollaboratorOutput, + AssociateAgentKnowledgeBaseInput, + AssociateAgentKnowledgeBaseOutput, + CreateAgentActionGroupInput, + CreateAgentActionGroupOutput, + CreateAgentAliasInput, + CreateAgentAliasOutput, + CreateAgentInput, + CreateAgentOutput, + CreateDataSourceInput, + CreateDataSourceOutput, + CreateFlowAliasInput, + CreateFlowAliasOutput, + CreateFlowInput, + CreateFlowOutput, + CreateFlowVersionInput, + CreateFlowVersionOutput, + CreateKnowledgeBaseInput, + CreateKnowledgeBaseOutput, + CreatePromptInput, + CreatePromptOutput, + CreatePromptVersionInput, + CreatePromptVersionOutput, + CreateVpcConfigurationInput, + CreateVpcConfigurationOutput, + DeleteAgentActionGroupInput, + DeleteAgentActionGroupOutput, + DeleteAgentAliasInput, + DeleteAgentAliasOutput, + DeleteAgentInput, + DeleteAgentOutput, + DeleteAgentVersionInput, + DeleteAgentVersionOutput, + DeleteDataSourceInput, + DeleteDataSourceOutput, + DeleteFlowAliasInput, + DeleteFlowAliasOutput, + DeleteFlowInput, + DeleteFlowOutput, + DeleteFlowVersionInput, + DeleteFlowVersionOutput, + DeleteKnowledgeBaseDocumentsInput, + DeleteKnowledgeBaseDocumentsOutput, + DeleteKnowledgeBaseInput, + DeleteKnowledgeBaseOutput, + DeletePromptInput, + DeletePromptOutput, + DeleteResourcePolicyInput, + DeleteResourcePolicyOutput, + DeleteVpcConfigurationInput, + DeleteVpcConfigurationOutput, DisassociateAgentCollaboratorInput, DisassociateAgentCollaboratorOutput, - Any, - Any, - ], - Interceptor[ DisassociateAgentKnowledgeBaseInput, DisassociateAgentKnowledgeBaseOutput, - Any, - Any, - ], - Interceptor[GetAgentInput, GetAgentOutput, Any, Any], - Interceptor[GetAgentActionGroupInput, GetAgentActionGroupOutput, Any, Any], - Interceptor[GetAgentAliasInput, GetAgentAliasOutput, Any, Any], - Interceptor[GetAgentCollaboratorInput, GetAgentCollaboratorOutput, Any, Any], - Interceptor[GetAgentKnowledgeBaseInput, GetAgentKnowledgeBaseOutput, Any, Any], - Interceptor[GetAgentVersionInput, GetAgentVersionOutput, Any, Any], - Interceptor[GetDataSourceInput, GetDataSourceOutput, Any, Any], - Interceptor[GetFlowInput, GetFlowOutput, Any, Any], - Interceptor[GetFlowAliasInput, GetFlowAliasOutput, Any, Any], - Interceptor[GetFlowVersionInput, GetFlowVersionOutput, Any, Any], - Interceptor[GetIngestionJobInput, GetIngestionJobOutput, Any, Any], - Interceptor[GetKnowledgeBaseInput, GetKnowledgeBaseOutput, Any, Any], - Interceptor[ - GetKnowledgeBaseDocumentsInput, GetKnowledgeBaseDocumentsOutput, Any, Any - ], - Interceptor[GetPromptInput, GetPromptOutput, Any, Any], - Interceptor[GetResourcePolicyInput, GetResourcePolicyOutput, Any, Any], - Interceptor[GetVpcConfigurationInput, GetVpcConfigurationOutput, Any, Any], - Interceptor[ - IngestKnowledgeBaseDocumentsInput, IngestKnowledgeBaseDocumentsOutput, Any, Any - ], - Interceptor[ListAgentActionGroupsInput, ListAgentActionGroupsOutput, Any, Any], - Interceptor[ListAgentAliasesInput, ListAgentAliasesOutput, Any, Any], - Interceptor[ListAgentCollaboratorsInput, ListAgentCollaboratorsOutput, Any, Any], - Interceptor[ListAgentKnowledgeBasesInput, ListAgentKnowledgeBasesOutput, Any, Any], - Interceptor[ListAgentsInput, ListAgentsOutput, Any, Any], - Interceptor[ListAgentVersionsInput, ListAgentVersionsOutput, Any, Any], - Interceptor[ListDataSourcesInput, ListDataSourcesOutput, Any, Any], - Interceptor[ListFlowAliasesInput, ListFlowAliasesOutput, Any, Any], - Interceptor[ListFlowsInput, ListFlowsOutput, Any, Any], - Interceptor[ListFlowVersionsInput, ListFlowVersionsOutput, Any, Any], - Interceptor[ListIngestionJobsInput, ListIngestionJobsOutput, Any, Any], - Interceptor[ - ListKnowledgeBaseDocumentsInput, ListKnowledgeBaseDocumentsOutput, Any, Any - ], - Interceptor[ListKnowledgeBasesInput, ListKnowledgeBasesOutput, Any, Any], - Interceptor[ListPromptsInput, ListPromptsOutput, Any, Any], - Interceptor[ListTagsForResourceInput, ListTagsForResourceOutput, Any, Any], - Interceptor[ListVpcConfigurationsInput, ListVpcConfigurationsOutput, Any, Any], - Interceptor[PrepareAgentInput, PrepareAgentOutput, Any, Any], - Interceptor[PrepareFlowInput, PrepareFlowOutput, Any, Any], - Interceptor[PutResourcePolicyInput, PutResourcePolicyOutput, Any, Any], - Interceptor[StartIngestionJobInput, StartIngestionJobOutput, Any, Any], - Interceptor[StopIngestionJobInput, StopIngestionJobOutput, Any, Any], - Interceptor[TagResourceInput, TagResourceOutput, Any, Any], - Interceptor[UntagResourceInput, UntagResourceOutput, Any, Any], - Interceptor[UpdateAgentInput, UpdateAgentOutput, Any, Any], - Interceptor[UpdateAgentActionGroupInput, UpdateAgentActionGroupOutput, Any, Any], - Interceptor[UpdateAgentAliasInput, UpdateAgentAliasOutput, Any, Any], - Interceptor[UpdateAgentCollaboratorInput, UpdateAgentCollaboratorOutput, Any, Any], - Interceptor[ - UpdateAgentKnowledgeBaseInput, UpdateAgentKnowledgeBaseOutput, Any, Any - ], - Interceptor[UpdateDataSourceInput, UpdateDataSourceOutput, Any, Any], - Interceptor[UpdateFlowInput, UpdateFlowOutput, Any, Any], - Interceptor[UpdateFlowAliasInput, UpdateFlowAliasOutput, Any, Any], - Interceptor[UpdateKnowledgeBaseInput, UpdateKnowledgeBaseOutput, Any, Any], - Interceptor[UpdatePromptInput, UpdatePromptOutput, Any, Any], - Interceptor[ValidateFlowDefinitionInput, ValidateFlowDefinitionOutput, Any, Any], -] + GetAgentActionGroupInput, + GetAgentActionGroupOutput, + GetAgentAliasInput, + GetAgentAliasOutput, + GetAgentCollaboratorInput, + GetAgentCollaboratorOutput, + GetAgentInput, + GetAgentKnowledgeBaseInput, + GetAgentKnowledgeBaseOutput, + GetAgentOutput, + GetAgentVersionInput, + GetAgentVersionOutput, + GetDataSourceInput, + GetDataSourceOutput, + GetFlowAliasInput, + GetFlowAliasOutput, + GetFlowInput, + GetFlowOutput, + GetFlowVersionInput, + GetFlowVersionOutput, + GetIngestionJobInput, + GetIngestionJobOutput, + GetKnowledgeBaseDocumentsInput, + GetKnowledgeBaseDocumentsOutput, + GetKnowledgeBaseInput, + GetKnowledgeBaseOutput, + GetPromptInput, + GetPromptOutput, + GetResourcePolicyInput, + GetResourcePolicyOutput, + GetVpcConfigurationInput, + GetVpcConfigurationOutput, + IngestKnowledgeBaseDocumentsInput, + IngestKnowledgeBaseDocumentsOutput, + ListAgentActionGroupsInput, + ListAgentActionGroupsOutput, + ListAgentAliasesInput, + ListAgentAliasesOutput, + ListAgentCollaboratorsInput, + ListAgentCollaboratorsOutput, + ListAgentKnowledgeBasesInput, + ListAgentKnowledgeBasesOutput, + ListAgentVersionsInput, + ListAgentVersionsOutput, + ListAgentsInput, + ListAgentsOutput, + ListDataSourcesInput, + ListDataSourcesOutput, + ListFlowAliasesInput, + ListFlowAliasesOutput, + ListFlowVersionsInput, + ListFlowVersionsOutput, + ListFlowsInput, + ListFlowsOutput, + ListIngestionJobsInput, + ListIngestionJobsOutput, + ListKnowledgeBaseDocumentsInput, + ListKnowledgeBaseDocumentsOutput, + ListKnowledgeBasesInput, + ListKnowledgeBasesOutput, + ListPromptsInput, + ListPromptsOutput, + ListTagsForResourceInput, + ListTagsForResourceOutput, + ListVpcConfigurationsInput, + ListVpcConfigurationsOutput, + PrepareAgentInput, + PrepareAgentOutput, + PrepareFlowInput, + PrepareFlowOutput, + PutResourcePolicyInput, + PutResourcePolicyOutput, + StartIngestionJobInput, + StartIngestionJobOutput, + StopIngestionJobInput, + StopIngestionJobOutput, + TagResourceInput, + TagResourceOutput, + UntagResourceInput, + UntagResourceOutput, + UpdateAgentActionGroupInput, + UpdateAgentActionGroupOutput, + UpdateAgentAliasInput, + UpdateAgentAliasOutput, + UpdateAgentCollaboratorInput, + UpdateAgentCollaboratorOutput, + UpdateAgentInput, + UpdateAgentKnowledgeBaseInput, + UpdateAgentKnowledgeBaseOutput, + UpdateAgentOutput, + UpdateDataSourceInput, + UpdateDataSourceOutput, + UpdateFlowAliasInput, + UpdateFlowAliasOutput, + UpdateFlowInput, + UpdateFlowOutput, + UpdateKnowledgeBaseInput, + UpdateKnowledgeBaseOutput, + UpdatePromptInput, + UpdatePromptOutput, + ValidateFlowDefinitionInput, + ValidateFlowDefinitionOutput, + ) + + _ServiceInterceptor = Union[ + Interceptor[ + AssociateAgentCollaboratorInput, AssociateAgentCollaboratorOutput, Any, Any + ], + Interceptor[ + AssociateAgentKnowledgeBaseInput, + AssociateAgentKnowledgeBaseOutput, + Any, + Any, + ], + Interceptor[CreateAgentInput, CreateAgentOutput, Any, Any], + Interceptor[ + CreateAgentActionGroupInput, CreateAgentActionGroupOutput, Any, Any + ], + Interceptor[CreateAgentAliasInput, CreateAgentAliasOutput, Any, Any], + Interceptor[CreateDataSourceInput, CreateDataSourceOutput, Any, Any], + Interceptor[CreateFlowInput, CreateFlowOutput, Any, Any], + Interceptor[CreateFlowAliasInput, CreateFlowAliasOutput, Any, Any], + Interceptor[CreateFlowVersionInput, CreateFlowVersionOutput, Any, Any], + Interceptor[CreateKnowledgeBaseInput, CreateKnowledgeBaseOutput, Any, Any], + Interceptor[CreatePromptInput, CreatePromptOutput, Any, Any], + Interceptor[CreatePromptVersionInput, CreatePromptVersionOutput, Any, Any], + Interceptor[ + CreateVpcConfigurationInput, CreateVpcConfigurationOutput, Any, Any + ], + Interceptor[DeleteAgentInput, DeleteAgentOutput, Any, Any], + Interceptor[ + DeleteAgentActionGroupInput, DeleteAgentActionGroupOutput, Any, Any + ], + Interceptor[DeleteAgentAliasInput, DeleteAgentAliasOutput, Any, Any], + Interceptor[DeleteAgentVersionInput, DeleteAgentVersionOutput, Any, Any], + Interceptor[DeleteDataSourceInput, DeleteDataSourceOutput, Any, Any], + Interceptor[DeleteFlowInput, DeleteFlowOutput, Any, Any], + Interceptor[DeleteFlowAliasInput, DeleteFlowAliasOutput, Any, Any], + Interceptor[DeleteFlowVersionInput, DeleteFlowVersionOutput, Any, Any], + Interceptor[DeleteKnowledgeBaseInput, DeleteKnowledgeBaseOutput, Any, Any], + Interceptor[ + DeleteKnowledgeBaseDocumentsInput, + DeleteKnowledgeBaseDocumentsOutput, + Any, + Any, + ], + Interceptor[DeletePromptInput, DeletePromptOutput, Any, Any], + Interceptor[DeleteResourcePolicyInput, DeleteResourcePolicyOutput, Any, Any], + Interceptor[ + DeleteVpcConfigurationInput, DeleteVpcConfigurationOutput, Any, Any + ], + Interceptor[ + DisassociateAgentCollaboratorInput, + DisassociateAgentCollaboratorOutput, + Any, + Any, + ], + Interceptor[ + DisassociateAgentKnowledgeBaseInput, + DisassociateAgentKnowledgeBaseOutput, + Any, + Any, + ], + Interceptor[GetAgentInput, GetAgentOutput, Any, Any], + Interceptor[GetAgentActionGroupInput, GetAgentActionGroupOutput, Any, Any], + Interceptor[GetAgentAliasInput, GetAgentAliasOutput, Any, Any], + Interceptor[GetAgentCollaboratorInput, GetAgentCollaboratorOutput, Any, Any], + Interceptor[GetAgentKnowledgeBaseInput, GetAgentKnowledgeBaseOutput, Any, Any], + Interceptor[GetAgentVersionInput, GetAgentVersionOutput, Any, Any], + Interceptor[GetDataSourceInput, GetDataSourceOutput, Any, Any], + Interceptor[GetFlowInput, GetFlowOutput, Any, Any], + Interceptor[GetFlowAliasInput, GetFlowAliasOutput, Any, Any], + Interceptor[GetFlowVersionInput, GetFlowVersionOutput, Any, Any], + Interceptor[GetIngestionJobInput, GetIngestionJobOutput, Any, Any], + Interceptor[GetKnowledgeBaseInput, GetKnowledgeBaseOutput, Any, Any], + Interceptor[ + GetKnowledgeBaseDocumentsInput, GetKnowledgeBaseDocumentsOutput, Any, Any + ], + Interceptor[GetPromptInput, GetPromptOutput, Any, Any], + Interceptor[GetResourcePolicyInput, GetResourcePolicyOutput, Any, Any], + Interceptor[GetVpcConfigurationInput, GetVpcConfigurationOutput, Any, Any], + Interceptor[ + IngestKnowledgeBaseDocumentsInput, + IngestKnowledgeBaseDocumentsOutput, + Any, + Any, + ], + Interceptor[ListAgentActionGroupsInput, ListAgentActionGroupsOutput, Any, Any], + Interceptor[ListAgentAliasesInput, ListAgentAliasesOutput, Any, Any], + Interceptor[ + ListAgentCollaboratorsInput, ListAgentCollaboratorsOutput, Any, Any + ], + Interceptor[ + ListAgentKnowledgeBasesInput, ListAgentKnowledgeBasesOutput, Any, Any + ], + Interceptor[ListAgentsInput, ListAgentsOutput, Any, Any], + Interceptor[ListAgentVersionsInput, ListAgentVersionsOutput, Any, Any], + Interceptor[ListDataSourcesInput, ListDataSourcesOutput, Any, Any], + Interceptor[ListFlowAliasesInput, ListFlowAliasesOutput, Any, Any], + Interceptor[ListFlowsInput, ListFlowsOutput, Any, Any], + Interceptor[ListFlowVersionsInput, ListFlowVersionsOutput, Any, Any], + Interceptor[ListIngestionJobsInput, ListIngestionJobsOutput, Any, Any], + Interceptor[ + ListKnowledgeBaseDocumentsInput, ListKnowledgeBaseDocumentsOutput, Any, Any + ], + Interceptor[ListKnowledgeBasesInput, ListKnowledgeBasesOutput, Any, Any], + Interceptor[ListPromptsInput, ListPromptsOutput, Any, Any], + Interceptor[ListTagsForResourceInput, ListTagsForResourceOutput, Any, Any], + Interceptor[ListVpcConfigurationsInput, ListVpcConfigurationsOutput, Any, Any], + Interceptor[PrepareAgentInput, PrepareAgentOutput, Any, Any], + Interceptor[PrepareFlowInput, PrepareFlowOutput, Any, Any], + Interceptor[PutResourcePolicyInput, PutResourcePolicyOutput, Any, Any], + Interceptor[StartIngestionJobInput, StartIngestionJobOutput, Any, Any], + Interceptor[StopIngestionJobInput, StopIngestionJobOutput, Any, Any], + Interceptor[TagResourceInput, TagResourceOutput, Any, Any], + Interceptor[UntagResourceInput, UntagResourceOutput, Any, Any], + Interceptor[UpdateAgentInput, UpdateAgentOutput, Any, Any], + Interceptor[ + UpdateAgentActionGroupInput, UpdateAgentActionGroupOutput, Any, Any + ], + Interceptor[UpdateAgentAliasInput, UpdateAgentAliasOutput, Any, Any], + Interceptor[ + UpdateAgentCollaboratorInput, UpdateAgentCollaboratorOutput, Any, Any + ], + Interceptor[ + UpdateAgentKnowledgeBaseInput, UpdateAgentKnowledgeBaseOutput, Any, Any + ], + Interceptor[UpdateDataSourceInput, UpdateDataSourceOutput, Any, Any], + Interceptor[UpdateFlowInput, UpdateFlowOutput, Any, Any], + Interceptor[UpdateFlowAliasInput, UpdateFlowAliasOutput, Any, Any], + Interceptor[UpdateKnowledgeBaseInput, UpdateKnowledgeBaseOutput, Any, Any], + Interceptor[UpdatePromptInput, UpdatePromptOutput, Any, Any], + Interceptor[ + ValidateFlowDefinitionInput, ValidateFlowDefinitionOutput, Any, Any + ], + ] +else: + _ServiceInterceptor = Any + _PROTOCOL_SETTINGS = ProtocolSettings( namespace="com.amazonaws.bedrockagent", service_target="AmazonBedrockAgentBuildTimeLambda", + service_schema=AMAZON_BEDROCK_AGENT_BUILD_TIME_LAMBDA, ) class _AsyncBedrockAgentConfigOverrides(AwsConfigOverrides, total=False): - endpoint_resolver: EndpointResolver | None + endpoint_resolver: AsyncEndpointResolver | None protocol: ( - ClientProtocol[Any, Any] | ProtocolConstructor[ClientProtocol[Any, Any]] | None + AsyncClientProtocol[Any, Any] + | ProtocolConstructor[AsyncClientProtocol[Any, Any]] + | None ) - auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None + auth_schemes: dict[ShapeID, AsyncAuthScheme[Any, Any, Any, Any]] | None auth_scheme_resolver: AuthSchemeResolver | None @@ -313,17 +354,17 @@ class _AsyncBedrockAgentConfigOverrides(AwsConfigOverrides, total=False): class AsyncBedrockAgentConfig(AsyncAwsConfig): """Bedrock Agent configuration (async-resolved).""" - endpoint_resolver: EndpointResolver | None = None + endpoint_resolver: AsyncEndpointResolver | None = None """ The endpoint resolver used to resolve the final endpoint per-operation based on the configuration. """ - protocol: ClientProtocol[Any, Any] | None = None + protocol: AsyncClientProtocol[Any, Any] | None = None """ Pass a protocol class reference from smithy_aws_core.aio.protocols to - select the protocol, e.g. protocol=AwsJson10ClientProtocol. For custom - protocols a protocol instance may also be passed. + select the protocol, e.g. protocol=AsyncAwsJson10ClientProtocol. For + custom protocols a protocol instance may also be passed. """ interceptors: list[_ServiceInterceptor] = field(default_factory=lambda: []) @@ -332,7 +373,7 @@ class AsyncBedrockAgentConfig(AsyncAwsConfig): execution of a request. """ - auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None = None + auth_schemes: dict[ShapeID, AsyncAuthScheme[Any, Any, Any, Any]] | None = None """A map of auth scheme ids to auth schemes.""" auth_scheme_resolver: AuthSchemeResolver | None = None @@ -342,7 +383,7 @@ class AsyncBedrockAgentConfig(AsyncAwsConfig): """ aws_credentials_identity_resolver: ( - IdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None + AsyncIdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None ) = None """Resolves AWS Credentials. Required for operations that use Sigv4 Auth.""" @@ -383,24 +424,24 @@ class AsyncBedrockAgentConfig(AsyncAwsConfig): default=None, resolver=EndpointUriResolver("bedrock_agent") ), "endpoint_resolver": FieldSpec( - default_factory=lambda: StandardRegionalEndpointsResolver( + default_factory=lambda: AsyncStandardRegionalEndpointsResolver( endpoint_prefix="bedrock-agent" ) ), "protocol": FieldSpec( - default_factory=lambda: RestJsonClientProtocol(_PROTOCOL_SETTINGS), + default_factory=lambda: AsyncRestJsonClientProtocol(_PROTOCOL_SETTINGS), converter=lambda p: p(_PROTOCOL_SETTINGS) if isinstance(p, type) else p, ), "auth_schemes": FieldSpec( default_factory=lambda: { - ShapeID("aws.auth#sigv4"): SigV4AuthScheme(service="bedrock") + ShapeID("aws.auth#sigv4"): AsyncSigV4AuthScheme(service="bedrock") } ), "auth_scheme_resolver": FieldSpec(default_factory=HTTPAuthSchemeResolver), "transport": FieldSpec(default_factory=lambda: AIOHTTPClient()), } - def set_auth_scheme(self, scheme: AuthScheme[Any, Any, Any, Any]) -> None: + def set_auth_scheme(self, scheme: AsyncAuthScheme[Any, Any, Any, Any]) -> None: """ Set an auth scheme implementation using its scheme ID. :param scheme: The auth scheme to add or replace. @@ -414,7 +455,7 @@ async def resolve( # pyright: ignore[reportIncompatibleMethodOverride] cls, *, profile: str | None = None, - fs: FileSystem | None = None, + fs: AsyncFileSystem | None = None, config_file_path: str | None = None, credentials_file_path: str | None = None, **overrides: Unpack[_AsyncBedrockAgentConfigOverrides], diff --git a/clients/aws-sdk-bedrock-agent/src/aws_sdk_bedrock_agent/models.py b/clients/aws-sdk-bedrock-agent/src/aws_sdk_bedrock_agent/models.py index dcb8464d..584f33fb 100644 --- a/clients/aws-sdk-bedrock-agent/src/aws_sdk_bedrock_agent/models.py +++ b/clients/aws-sdk-bedrock-agent/src/aws_sdk_bedrock_agent/models.py @@ -1,42035 +1,2587 @@ # Code generated by smithy-python-codegen DO NOT EDIT. -from dataclasses import dataclass, field -from datetime import datetime, timezone -from enum import StrEnum -import logging -from typing import Any, Literal, Self, Union +from __future__ import annotations -from smithy_core.deserializers import ShapeDeserializer -from smithy_core.documents import Document, TypeRegistry -from smithy_core.exceptions import ModeledError, SerializationError -from smithy_core.response import EMPTY_RESPONSE_METADATA, ResponseMetadata -from smithy_core.schemas import APIOperation, Schema -from smithy_core.serializers import ShapeSerializer +from ._private import schemas as _schemas +from smithy_core._dynamic_models import ModelRegistry +from smithy_core.exceptions import ModeledError +from smithy_core.schemas import APIOperation from smithy_core.shapes import ShapeID -from smithy_core.types import JsonString, UnknownEnumMixin from ._private.schemas import ( - ACCESS_DENIED_EXCEPTION as _SCHEMA_ACCESS_DENIED_EXCEPTION, - ACTION_GROUP_EXECUTOR as _SCHEMA_ACTION_GROUP_EXECUTOR, - ACTION_GROUP_SUMMARY as _SCHEMA_ACTION_GROUP_SUMMARY, - AGENT as _SCHEMA_AGENT, - AGENT_ACTION_GROUP as _SCHEMA_AGENT_ACTION_GROUP, - AGENT_ALIAS as _SCHEMA_AGENT_ALIAS, - AGENT_ALIAS_HISTORY_EVENT as _SCHEMA_AGENT_ALIAS_HISTORY_EVENT, - AGENT_ALIAS_ROUTING_CONFIGURATION_LIST_ITEM as _SCHEMA_AGENT_ALIAS_ROUTING_CONFIGURATION_LIST_ITEM, - AGENT_ALIAS_SUMMARY as _SCHEMA_AGENT_ALIAS_SUMMARY, - AGENT_COLLABORATOR as _SCHEMA_AGENT_COLLABORATOR, - AGENT_COLLABORATOR_SUMMARY as _SCHEMA_AGENT_COLLABORATOR_SUMMARY, - AGENT_DESCRIPTOR as _SCHEMA_AGENT_DESCRIPTOR, - AGENT_FLOW_NODE_CONFIGURATION as _SCHEMA_AGENT_FLOW_NODE_CONFIGURATION, - AGENT_KNOWLEDGE_BASE as _SCHEMA_AGENT_KNOWLEDGE_BASE, - AGENT_KNOWLEDGE_BASE_SUMMARY as _SCHEMA_AGENT_KNOWLEDGE_BASE_SUMMARY, - AGENT_SUMMARY as _SCHEMA_AGENT_SUMMARY, - AGENT_VERSION as _SCHEMA_AGENT_VERSION, - AGENT_VERSION_SUMMARY as _SCHEMA_AGENT_VERSION_SUMMARY, - ANY_TOOL_CHOICE as _SCHEMA_ANY_TOOL_CHOICE, - API_SCHEMA as _SCHEMA_API_SCHEMA, ASSOCIATE_AGENT_COLLABORATOR as _SCHEMA_ASSOCIATE_AGENT_COLLABORATOR, - ASSOCIATE_AGENT_COLLABORATOR_INPUT as _SCHEMA_ASSOCIATE_AGENT_COLLABORATOR_INPUT, - ASSOCIATE_AGENT_COLLABORATOR_OUTPUT as _SCHEMA_ASSOCIATE_AGENT_COLLABORATOR_OUTPUT, ASSOCIATE_AGENT_KNOWLEDGE_BASE as _SCHEMA_ASSOCIATE_AGENT_KNOWLEDGE_BASE, - ASSOCIATE_AGENT_KNOWLEDGE_BASE_INPUT as _SCHEMA_ASSOCIATE_AGENT_KNOWLEDGE_BASE_INPUT, - ASSOCIATE_AGENT_KNOWLEDGE_BASE_OUTPUT as _SCHEMA_ASSOCIATE_AGENT_KNOWLEDGE_BASE_OUTPUT, - AUDIO_CONFIGURATION as _SCHEMA_AUDIO_CONFIGURATION, - AUDIO_EXTRACTION_CONFIGURATION as _SCHEMA_AUDIO_EXTRACTION_CONFIGURATION, - AUDIO_SEGMENTATION_CONFIGURATION as _SCHEMA_AUDIO_SEGMENTATION_CONFIGURATION, - AUTO_TOOL_CHOICE as _SCHEMA_AUTO_TOOL_CHOICE, - BEDROCK_DATA_AUTOMATION_CONFIGURATION as _SCHEMA_BEDROCK_DATA_AUTOMATION_CONFIGURATION, - BEDROCK_EMBEDDING_MODEL_CONFIGURATION as _SCHEMA_BEDROCK_EMBEDDING_MODEL_CONFIGURATION, - BEDROCK_FOUNDATION_MODEL_CONFIGURATION as _SCHEMA_BEDROCK_FOUNDATION_MODEL_CONFIGURATION, - BEDROCK_FOUNDATION_MODEL_CONTEXT_ENRICHMENT_CONFIGURATION as _SCHEMA_BEDROCK_FOUNDATION_MODEL_CONTEXT_ENRICHMENT_CONFIGURATION, - BYTE_CONTENT_DOC as _SCHEMA_BYTE_CONTENT_DOC, - CACHE_POINT_BLOCK as _SCHEMA_CACHE_POINT_BLOCK, - CHAT_PROMPT_TEMPLATE_CONFIGURATION as _SCHEMA_CHAT_PROMPT_TEMPLATE_CONFIGURATION, - CHUNKING_CONFIGURATION as _SCHEMA_CHUNKING_CONFIGURATION, - COLLECTOR_FLOW_NODE_CONFIGURATION as _SCHEMA_COLLECTOR_FLOW_NODE_CONFIGURATION, - CONDITION_FLOW_NODE_CONFIGURATION as _SCHEMA_CONDITION_FLOW_NODE_CONFIGURATION, - CONFLICT_EXCEPTION as _SCHEMA_CONFLICT_EXCEPTION, - CONFLUENCE_CRAWLER_CONFIGURATION as _SCHEMA_CONFLUENCE_CRAWLER_CONFIGURATION, - CONFLUENCE_DATA_SOURCE_CONFIGURATION as _SCHEMA_CONFLUENCE_DATA_SOURCE_CONFIGURATION, - CONFLUENCE_SOURCE_CONFIGURATION as _SCHEMA_CONFLUENCE_SOURCE_CONFIGURATION, - CONTENT_BLOCK as _SCHEMA_CONTENT_BLOCK, - CONTEXT_ENRICHMENT_CONFIGURATION as _SCHEMA_CONTEXT_ENRICHMENT_CONFIGURATION, - CRAWL_FILTER_CONFIGURATION as _SCHEMA_CRAWL_FILTER_CONFIGURATION, CREATE_AGENT as _SCHEMA_CREATE_AGENT, CREATE_AGENT_ACTION_GROUP as _SCHEMA_CREATE_AGENT_ACTION_GROUP, - CREATE_AGENT_ACTION_GROUP_INPUT as _SCHEMA_CREATE_AGENT_ACTION_GROUP_INPUT, - CREATE_AGENT_ACTION_GROUP_OUTPUT as _SCHEMA_CREATE_AGENT_ACTION_GROUP_OUTPUT, CREATE_AGENT_ALIAS as _SCHEMA_CREATE_AGENT_ALIAS, - CREATE_AGENT_ALIAS_INPUT as _SCHEMA_CREATE_AGENT_ALIAS_INPUT, - CREATE_AGENT_ALIAS_OUTPUT as _SCHEMA_CREATE_AGENT_ALIAS_OUTPUT, - CREATE_AGENT_INPUT as _SCHEMA_CREATE_AGENT_INPUT, - CREATE_AGENT_OUTPUT as _SCHEMA_CREATE_AGENT_OUTPUT, CREATE_DATA_SOURCE as _SCHEMA_CREATE_DATA_SOURCE, - CREATE_DATA_SOURCE_INPUT as _SCHEMA_CREATE_DATA_SOURCE_INPUT, - CREATE_DATA_SOURCE_OUTPUT as _SCHEMA_CREATE_DATA_SOURCE_OUTPUT, CREATE_FLOW as _SCHEMA_CREATE_FLOW, CREATE_FLOW_ALIAS as _SCHEMA_CREATE_FLOW_ALIAS, - CREATE_FLOW_ALIAS_INPUT as _SCHEMA_CREATE_FLOW_ALIAS_INPUT, - CREATE_FLOW_ALIAS_OUTPUT as _SCHEMA_CREATE_FLOW_ALIAS_OUTPUT, - CREATE_FLOW_INPUT as _SCHEMA_CREATE_FLOW_INPUT, - CREATE_FLOW_OUTPUT as _SCHEMA_CREATE_FLOW_OUTPUT, CREATE_FLOW_VERSION as _SCHEMA_CREATE_FLOW_VERSION, - CREATE_FLOW_VERSION_INPUT as _SCHEMA_CREATE_FLOW_VERSION_INPUT, - CREATE_FLOW_VERSION_OUTPUT as _SCHEMA_CREATE_FLOW_VERSION_OUTPUT, CREATE_KNOWLEDGE_BASE as _SCHEMA_CREATE_KNOWLEDGE_BASE, - CREATE_KNOWLEDGE_BASE_INPUT as _SCHEMA_CREATE_KNOWLEDGE_BASE_INPUT, - CREATE_KNOWLEDGE_BASE_OUTPUT as _SCHEMA_CREATE_KNOWLEDGE_BASE_OUTPUT, CREATE_PROMPT as _SCHEMA_CREATE_PROMPT, - CREATE_PROMPT_INPUT as _SCHEMA_CREATE_PROMPT_INPUT, - CREATE_PROMPT_OUTPUT as _SCHEMA_CREATE_PROMPT_OUTPUT, CREATE_PROMPT_VERSION as _SCHEMA_CREATE_PROMPT_VERSION, - CREATE_PROMPT_VERSION_INPUT as _SCHEMA_CREATE_PROMPT_VERSION_INPUT, - CREATE_PROMPT_VERSION_OUTPUT as _SCHEMA_CREATE_PROMPT_VERSION_OUTPUT, CREATE_VPC_CONFIGURATION as _SCHEMA_CREATE_VPC_CONFIGURATION, - CREATE_VPC_CONFIGURATION_INPUT as _SCHEMA_CREATE_VPC_CONFIGURATION_INPUT, - CREATE_VPC_CONFIGURATION_OUTPUT as _SCHEMA_CREATE_VPC_CONFIGURATION_OUTPUT, - CURATED_QUERY as _SCHEMA_CURATED_QUERY, - CUSTOM_CONTENT as _SCHEMA_CUSTOM_CONTENT, - CUSTOM_DOCUMENT_IDENTIFIER as _SCHEMA_CUSTOM_DOCUMENT_IDENTIFIER, - CUSTOM_ORCHESTRATION as _SCHEMA_CUSTOM_ORCHESTRATION, - CUSTOM_S3_LOCATION as _SCHEMA_CUSTOM_S3_LOCATION, - CUSTOM_TRANSFORMATION_CONFIGURATION as _SCHEMA_CUSTOM_TRANSFORMATION_CONFIGURATION, - CYCLIC_CONNECTION_FLOW_VALIDATION_DETAILS as _SCHEMA_CYCLIC_CONNECTION_FLOW_VALIDATION_DETAILS, - DAILY_SCHEDULE as _SCHEMA_DAILY_SCHEDULE, - DATA_SOURCE as _SCHEMA_DATA_SOURCE, - DATA_SOURCE_CONFIGURATION as _SCHEMA_DATA_SOURCE_CONFIGURATION, - DATA_SOURCE_SUMMARY as _SCHEMA_DATA_SOURCE_SUMMARY, - DAY_OF_MONTH as _SCHEMA_DAY_OF_MONTH, DELETE_AGENT as _SCHEMA_DELETE_AGENT, DELETE_AGENT_ACTION_GROUP as _SCHEMA_DELETE_AGENT_ACTION_GROUP, - DELETE_AGENT_ACTION_GROUP_INPUT as _SCHEMA_DELETE_AGENT_ACTION_GROUP_INPUT, - DELETE_AGENT_ACTION_GROUP_OUTPUT as _SCHEMA_DELETE_AGENT_ACTION_GROUP_OUTPUT, DELETE_AGENT_ALIAS as _SCHEMA_DELETE_AGENT_ALIAS, - DELETE_AGENT_ALIAS_INPUT as _SCHEMA_DELETE_AGENT_ALIAS_INPUT, - DELETE_AGENT_ALIAS_OUTPUT as _SCHEMA_DELETE_AGENT_ALIAS_OUTPUT, - DELETE_AGENT_INPUT as _SCHEMA_DELETE_AGENT_INPUT, - DELETE_AGENT_OUTPUT as _SCHEMA_DELETE_AGENT_OUTPUT, DELETE_AGENT_VERSION as _SCHEMA_DELETE_AGENT_VERSION, - DELETE_AGENT_VERSION_INPUT as _SCHEMA_DELETE_AGENT_VERSION_INPUT, - DELETE_AGENT_VERSION_OUTPUT as _SCHEMA_DELETE_AGENT_VERSION_OUTPUT, DELETE_DATA_SOURCE as _SCHEMA_DELETE_DATA_SOURCE, - DELETE_DATA_SOURCE_INPUT as _SCHEMA_DELETE_DATA_SOURCE_INPUT, - DELETE_DATA_SOURCE_OUTPUT as _SCHEMA_DELETE_DATA_SOURCE_OUTPUT, DELETE_FLOW as _SCHEMA_DELETE_FLOW, DELETE_FLOW_ALIAS as _SCHEMA_DELETE_FLOW_ALIAS, - DELETE_FLOW_ALIAS_INPUT as _SCHEMA_DELETE_FLOW_ALIAS_INPUT, - DELETE_FLOW_ALIAS_OUTPUT as _SCHEMA_DELETE_FLOW_ALIAS_OUTPUT, - DELETE_FLOW_INPUT as _SCHEMA_DELETE_FLOW_INPUT, - DELETE_FLOW_OUTPUT as _SCHEMA_DELETE_FLOW_OUTPUT, DELETE_FLOW_VERSION as _SCHEMA_DELETE_FLOW_VERSION, - DELETE_FLOW_VERSION_INPUT as _SCHEMA_DELETE_FLOW_VERSION_INPUT, - DELETE_FLOW_VERSION_OUTPUT as _SCHEMA_DELETE_FLOW_VERSION_OUTPUT, DELETE_KNOWLEDGE_BASE as _SCHEMA_DELETE_KNOWLEDGE_BASE, DELETE_KNOWLEDGE_BASE_DOCUMENTS as _SCHEMA_DELETE_KNOWLEDGE_BASE_DOCUMENTS, - DELETE_KNOWLEDGE_BASE_DOCUMENTS_INPUT as _SCHEMA_DELETE_KNOWLEDGE_BASE_DOCUMENTS_INPUT, - DELETE_KNOWLEDGE_BASE_DOCUMENTS_OUTPUT as _SCHEMA_DELETE_KNOWLEDGE_BASE_DOCUMENTS_OUTPUT, - DELETE_KNOWLEDGE_BASE_INPUT as _SCHEMA_DELETE_KNOWLEDGE_BASE_INPUT, - DELETE_KNOWLEDGE_BASE_OUTPUT as _SCHEMA_DELETE_KNOWLEDGE_BASE_OUTPUT, DELETE_PROMPT as _SCHEMA_DELETE_PROMPT, - DELETE_PROMPT_INPUT as _SCHEMA_DELETE_PROMPT_INPUT, - DELETE_PROMPT_OUTPUT as _SCHEMA_DELETE_PROMPT_OUTPUT, DELETE_RESOURCE_POLICY as _SCHEMA_DELETE_RESOURCE_POLICY, - DELETE_RESOURCE_POLICY_INPUT as _SCHEMA_DELETE_RESOURCE_POLICY_INPUT, - DELETE_RESOURCE_POLICY_OUTPUT as _SCHEMA_DELETE_RESOURCE_POLICY_OUTPUT, DELETE_VPC_CONFIGURATION as _SCHEMA_DELETE_VPC_CONFIGURATION, - DELETE_VPC_CONFIGURATION_INPUT as _SCHEMA_DELETE_VPC_CONFIGURATION_INPUT, - DELETE_VPC_CONFIGURATION_OUTPUT as _SCHEMA_DELETE_VPC_CONFIGURATION_OUTPUT, - DELETION_PROTECTION_CONFIGURATION as _SCHEMA_DELETION_PROTECTION_CONFIGURATION, DISASSOCIATE_AGENT_COLLABORATOR as _SCHEMA_DISASSOCIATE_AGENT_COLLABORATOR, - DISASSOCIATE_AGENT_COLLABORATOR_INPUT as _SCHEMA_DISASSOCIATE_AGENT_COLLABORATOR_INPUT, - DISASSOCIATE_AGENT_COLLABORATOR_OUTPUT as _SCHEMA_DISASSOCIATE_AGENT_COLLABORATOR_OUTPUT, DISASSOCIATE_AGENT_KNOWLEDGE_BASE as _SCHEMA_DISASSOCIATE_AGENT_KNOWLEDGE_BASE, - DISASSOCIATE_AGENT_KNOWLEDGE_BASE_INPUT as _SCHEMA_DISASSOCIATE_AGENT_KNOWLEDGE_BASE_INPUT, - DISASSOCIATE_AGENT_KNOWLEDGE_BASE_OUTPUT as _SCHEMA_DISASSOCIATE_AGENT_KNOWLEDGE_BASE_OUTPUT, - DOCUMENT_ACCESS_CONTROL_ENTRY as _SCHEMA_DOCUMENT_ACCESS_CONTROL_ENTRY, - DOCUMENT_CONTENT as _SCHEMA_DOCUMENT_CONTENT, - DOCUMENT_IDENTIFIER as _SCHEMA_DOCUMENT_IDENTIFIER, - DOCUMENT_METADATA as _SCHEMA_DOCUMENT_METADATA, - DUPLICATE_CONDITION_EXPRESSION_FLOW_VALIDATION_DETAILS as _SCHEMA_DUPLICATE_CONDITION_EXPRESSION_FLOW_VALIDATION_DETAILS, - DUPLICATE_CONNECTIONS_FLOW_VALIDATION_DETAILS as _SCHEMA_DUPLICATE_CONNECTIONS_FLOW_VALIDATION_DETAILS, - EMBEDDING_MODEL_CONFIGURATION as _SCHEMA_EMBEDDING_MODEL_CONFIGURATION, - ENRICHMENT_STRATEGY_CONFIGURATION as _SCHEMA_ENRICHMENT_STRATEGY_CONFIGURATION, - FIELD_FOR_RERANKING as _SCHEMA_FIELD_FOR_RERANKING, - FIXED_SIZE_CHUNKING_CONFIGURATION as _SCHEMA_FIXED_SIZE_CHUNKING_CONFIGURATION, - FLOW_ALIAS_CONCURRENCY_CONFIGURATION as _SCHEMA_FLOW_ALIAS_CONCURRENCY_CONFIGURATION, - FLOW_ALIAS_ROUTING_CONFIGURATION_LIST_ITEM as _SCHEMA_FLOW_ALIAS_ROUTING_CONFIGURATION_LIST_ITEM, - FLOW_ALIAS_SUMMARY as _SCHEMA_FLOW_ALIAS_SUMMARY, - FLOW_CONDITION as _SCHEMA_FLOW_CONDITION, - FLOW_CONDITIONAL_CONNECTION_CONFIGURATION as _SCHEMA_FLOW_CONDITIONAL_CONNECTION_CONFIGURATION, - FLOW_CONNECTION as _SCHEMA_FLOW_CONNECTION, - FLOW_CONNECTION_CONFIGURATION as _SCHEMA_FLOW_CONNECTION_CONFIGURATION, - FLOW_DATA_CONNECTION_CONFIGURATION as _SCHEMA_FLOW_DATA_CONNECTION_CONFIGURATION, - FLOW_DEFINITION as _SCHEMA_FLOW_DEFINITION, - FLOW_NODE as _SCHEMA_FLOW_NODE, - FLOW_NODE_CONFIGURATION as _SCHEMA_FLOW_NODE_CONFIGURATION, - FLOW_NODE_INPUT as _SCHEMA_FLOW_NODE_INPUT, - FLOW_NODE_OUTPUT as _SCHEMA_FLOW_NODE_OUTPUT, - FLOW_SUMMARY as _SCHEMA_FLOW_SUMMARY, - FLOW_VALIDATION as _SCHEMA_FLOW_VALIDATION, - FLOW_VALIDATION_DETAILS as _SCHEMA_FLOW_VALIDATION_DETAILS, - FLOW_VERSION_SUMMARY as _SCHEMA_FLOW_VERSION_SUMMARY, - FUNCTION as _SCHEMA_FUNCTION, - FUNCTION_SCHEMA as _SCHEMA_FUNCTION_SCHEMA, GET_AGENT as _SCHEMA_GET_AGENT, GET_AGENT_ACTION_GROUP as _SCHEMA_GET_AGENT_ACTION_GROUP, - GET_AGENT_ACTION_GROUP_INPUT as _SCHEMA_GET_AGENT_ACTION_GROUP_INPUT, - GET_AGENT_ACTION_GROUP_OUTPUT as _SCHEMA_GET_AGENT_ACTION_GROUP_OUTPUT, GET_AGENT_ALIAS as _SCHEMA_GET_AGENT_ALIAS, - GET_AGENT_ALIAS_INPUT as _SCHEMA_GET_AGENT_ALIAS_INPUT, - GET_AGENT_ALIAS_OUTPUT as _SCHEMA_GET_AGENT_ALIAS_OUTPUT, GET_AGENT_COLLABORATOR as _SCHEMA_GET_AGENT_COLLABORATOR, - GET_AGENT_COLLABORATOR_INPUT as _SCHEMA_GET_AGENT_COLLABORATOR_INPUT, - GET_AGENT_COLLABORATOR_OUTPUT as _SCHEMA_GET_AGENT_COLLABORATOR_OUTPUT, - GET_AGENT_INPUT as _SCHEMA_GET_AGENT_INPUT, GET_AGENT_KNOWLEDGE_BASE as _SCHEMA_GET_AGENT_KNOWLEDGE_BASE, - GET_AGENT_KNOWLEDGE_BASE_INPUT as _SCHEMA_GET_AGENT_KNOWLEDGE_BASE_INPUT, - GET_AGENT_KNOWLEDGE_BASE_OUTPUT as _SCHEMA_GET_AGENT_KNOWLEDGE_BASE_OUTPUT, - GET_AGENT_OUTPUT as _SCHEMA_GET_AGENT_OUTPUT, GET_AGENT_VERSION as _SCHEMA_GET_AGENT_VERSION, - GET_AGENT_VERSION_INPUT as _SCHEMA_GET_AGENT_VERSION_INPUT, - GET_AGENT_VERSION_OUTPUT as _SCHEMA_GET_AGENT_VERSION_OUTPUT, GET_DATA_SOURCE as _SCHEMA_GET_DATA_SOURCE, - GET_DATA_SOURCE_INPUT as _SCHEMA_GET_DATA_SOURCE_INPUT, - GET_DATA_SOURCE_OUTPUT as _SCHEMA_GET_DATA_SOURCE_OUTPUT, GET_FLOW as _SCHEMA_GET_FLOW, GET_FLOW_ALIAS as _SCHEMA_GET_FLOW_ALIAS, - GET_FLOW_ALIAS_INPUT as _SCHEMA_GET_FLOW_ALIAS_INPUT, - GET_FLOW_ALIAS_OUTPUT as _SCHEMA_GET_FLOW_ALIAS_OUTPUT, - GET_FLOW_INPUT as _SCHEMA_GET_FLOW_INPUT, - GET_FLOW_OUTPUT as _SCHEMA_GET_FLOW_OUTPUT, GET_FLOW_VERSION as _SCHEMA_GET_FLOW_VERSION, - GET_FLOW_VERSION_INPUT as _SCHEMA_GET_FLOW_VERSION_INPUT, - GET_FLOW_VERSION_OUTPUT as _SCHEMA_GET_FLOW_VERSION_OUTPUT, GET_INGESTION_JOB as _SCHEMA_GET_INGESTION_JOB, - GET_INGESTION_JOB_INPUT as _SCHEMA_GET_INGESTION_JOB_INPUT, - GET_INGESTION_JOB_OUTPUT as _SCHEMA_GET_INGESTION_JOB_OUTPUT, GET_KNOWLEDGE_BASE as _SCHEMA_GET_KNOWLEDGE_BASE, GET_KNOWLEDGE_BASE_DOCUMENTS as _SCHEMA_GET_KNOWLEDGE_BASE_DOCUMENTS, - GET_KNOWLEDGE_BASE_DOCUMENTS_INPUT as _SCHEMA_GET_KNOWLEDGE_BASE_DOCUMENTS_INPUT, - GET_KNOWLEDGE_BASE_DOCUMENTS_OUTPUT as _SCHEMA_GET_KNOWLEDGE_BASE_DOCUMENTS_OUTPUT, - GET_KNOWLEDGE_BASE_INPUT as _SCHEMA_GET_KNOWLEDGE_BASE_INPUT, - GET_KNOWLEDGE_BASE_OUTPUT as _SCHEMA_GET_KNOWLEDGE_BASE_OUTPUT, GET_PROMPT as _SCHEMA_GET_PROMPT, - GET_PROMPT_INPUT as _SCHEMA_GET_PROMPT_INPUT, - GET_PROMPT_OUTPUT as _SCHEMA_GET_PROMPT_OUTPUT, GET_RESOURCE_POLICY as _SCHEMA_GET_RESOURCE_POLICY, - GET_RESOURCE_POLICY_INPUT as _SCHEMA_GET_RESOURCE_POLICY_INPUT, - GET_RESOURCE_POLICY_OUTPUT as _SCHEMA_GET_RESOURCE_POLICY_OUTPUT, GET_VPC_CONFIGURATION as _SCHEMA_GET_VPC_CONFIGURATION, - GET_VPC_CONFIGURATION_INPUT as _SCHEMA_GET_VPC_CONFIGURATION_INPUT, - GET_VPC_CONFIGURATION_OUTPUT as _SCHEMA_GET_VPC_CONFIGURATION_OUTPUT, - GUARDRAIL_CONFIGURATION as _SCHEMA_GUARDRAIL_CONFIGURATION, - HIERARCHICAL_CHUNKING_CONFIGURATION as _SCHEMA_HIERARCHICAL_CHUNKING_CONFIGURATION, - HIERARCHICAL_CHUNKING_LEVEL_CONFIGURATION as _SCHEMA_HIERARCHICAL_CHUNKING_LEVEL_CONFIGURATION, - IMAGE_EXTRACTION_CONFIGURATION as _SCHEMA_IMAGE_EXTRACTION_CONFIGURATION, - INCOMPATIBLE_CONNECTION_DATA_TYPE_FLOW_VALIDATION_DETAILS as _SCHEMA_INCOMPATIBLE_CONNECTION_DATA_TYPE_FLOW_VALIDATION_DETAILS, - INFERENCE_CONFIGURATION as _SCHEMA_INFERENCE_CONFIGURATION, - INGESTION_JOB as _SCHEMA_INGESTION_JOB, - INGESTION_JOB_FILTER as _SCHEMA_INGESTION_JOB_FILTER, - INGESTION_JOB_SORT_BY as _SCHEMA_INGESTION_JOB_SORT_BY, - INGESTION_JOB_STATISTICS as _SCHEMA_INGESTION_JOB_STATISTICS, - INGESTION_JOB_SUMMARY as _SCHEMA_INGESTION_JOB_SUMMARY, INGEST_KNOWLEDGE_BASE_DOCUMENTS as _SCHEMA_INGEST_KNOWLEDGE_BASE_DOCUMENTS, - INGEST_KNOWLEDGE_BASE_DOCUMENTS_INPUT as _SCHEMA_INGEST_KNOWLEDGE_BASE_DOCUMENTS_INPUT, - INGEST_KNOWLEDGE_BASE_DOCUMENTS_OUTPUT as _SCHEMA_INGEST_KNOWLEDGE_BASE_DOCUMENTS_OUTPUT, - INLINE_CODE_FLOW_NODE_CONFIGURATION as _SCHEMA_INLINE_CODE_FLOW_NODE_CONFIGURATION, - INLINE_CONTENT as _SCHEMA_INLINE_CONTENT, - INPUT_FLOW_NODE_CONFIGURATION as _SCHEMA_INPUT_FLOW_NODE_CONFIGURATION, - INTERMEDIATE_STORAGE as _SCHEMA_INTERMEDIATE_STORAGE, - INTERNAL_SERVER_EXCEPTION as _SCHEMA_INTERNAL_SERVER_EXCEPTION, - INVALID_LOOP_BOUNDARY_FLOW_VALIDATION_DETAILS as _SCHEMA_INVALID_LOOP_BOUNDARY_FLOW_VALIDATION_DETAILS, - ITERATOR_FLOW_NODE_CONFIGURATION as _SCHEMA_ITERATOR_FLOW_NODE_CONFIGURATION, - KENDRA_KNOWLEDGE_BASE_CONFIGURATION as _SCHEMA_KENDRA_KNOWLEDGE_BASE_CONFIGURATION, - KNOWLEDGE_BASE as _SCHEMA_KNOWLEDGE_BASE, - KNOWLEDGE_BASE_CONFIGURATION as _SCHEMA_KNOWLEDGE_BASE_CONFIGURATION, - KNOWLEDGE_BASE_DOCUMENT as _SCHEMA_KNOWLEDGE_BASE_DOCUMENT, - KNOWLEDGE_BASE_DOCUMENT_DETAIL as _SCHEMA_KNOWLEDGE_BASE_DOCUMENT_DETAIL, - KNOWLEDGE_BASE_FLOW_NODE_CONFIGURATION as _SCHEMA_KNOWLEDGE_BASE_FLOW_NODE_CONFIGURATION, - KNOWLEDGE_BASE_ORCHESTRATION_CONFIGURATION as _SCHEMA_KNOWLEDGE_BASE_ORCHESTRATION_CONFIGURATION, - KNOWLEDGE_BASE_PROMPT_TEMPLATE as _SCHEMA_KNOWLEDGE_BASE_PROMPT_TEMPLATE, - KNOWLEDGE_BASE_SUMMARY as _SCHEMA_KNOWLEDGE_BASE_SUMMARY, - LAMBDA_FUNCTION_FLOW_NODE_CONFIGURATION as _SCHEMA_LAMBDA_FUNCTION_FLOW_NODE_CONFIGURATION, - LAST_DAY_OF_MONTH as _SCHEMA_LAST_DAY_OF_MONTH, - LEX_FLOW_NODE_CONFIGURATION as _SCHEMA_LEX_FLOW_NODE_CONFIGURATION, LIST_AGENTS as _SCHEMA_LIST_AGENTS, - LIST_AGENTS_INPUT as _SCHEMA_LIST_AGENTS_INPUT, - LIST_AGENTS_OUTPUT as _SCHEMA_LIST_AGENTS_OUTPUT, LIST_AGENT_ACTION_GROUPS as _SCHEMA_LIST_AGENT_ACTION_GROUPS, - LIST_AGENT_ACTION_GROUPS_INPUT as _SCHEMA_LIST_AGENT_ACTION_GROUPS_INPUT, - LIST_AGENT_ACTION_GROUPS_OUTPUT as _SCHEMA_LIST_AGENT_ACTION_GROUPS_OUTPUT, LIST_AGENT_ALIASES as _SCHEMA_LIST_AGENT_ALIASES, - LIST_AGENT_ALIASES_INPUT as _SCHEMA_LIST_AGENT_ALIASES_INPUT, - LIST_AGENT_ALIASES_OUTPUT as _SCHEMA_LIST_AGENT_ALIASES_OUTPUT, LIST_AGENT_COLLABORATORS as _SCHEMA_LIST_AGENT_COLLABORATORS, - LIST_AGENT_COLLABORATORS_INPUT as _SCHEMA_LIST_AGENT_COLLABORATORS_INPUT, - LIST_AGENT_COLLABORATORS_OUTPUT as _SCHEMA_LIST_AGENT_COLLABORATORS_OUTPUT, LIST_AGENT_KNOWLEDGE_BASES as _SCHEMA_LIST_AGENT_KNOWLEDGE_BASES, - LIST_AGENT_KNOWLEDGE_BASES_INPUT as _SCHEMA_LIST_AGENT_KNOWLEDGE_BASES_INPUT, - LIST_AGENT_KNOWLEDGE_BASES_OUTPUT as _SCHEMA_LIST_AGENT_KNOWLEDGE_BASES_OUTPUT, LIST_AGENT_VERSIONS as _SCHEMA_LIST_AGENT_VERSIONS, - LIST_AGENT_VERSIONS_INPUT as _SCHEMA_LIST_AGENT_VERSIONS_INPUT, - LIST_AGENT_VERSIONS_OUTPUT as _SCHEMA_LIST_AGENT_VERSIONS_OUTPUT, LIST_DATA_SOURCES as _SCHEMA_LIST_DATA_SOURCES, - LIST_DATA_SOURCES_INPUT as _SCHEMA_LIST_DATA_SOURCES_INPUT, - LIST_DATA_SOURCES_OUTPUT as _SCHEMA_LIST_DATA_SOURCES_OUTPUT, LIST_FLOWS as _SCHEMA_LIST_FLOWS, - LIST_FLOWS_INPUT as _SCHEMA_LIST_FLOWS_INPUT, - LIST_FLOWS_OUTPUT as _SCHEMA_LIST_FLOWS_OUTPUT, LIST_FLOW_ALIASES as _SCHEMA_LIST_FLOW_ALIASES, - LIST_FLOW_ALIASES_INPUT as _SCHEMA_LIST_FLOW_ALIASES_INPUT, - LIST_FLOW_ALIASES_OUTPUT as _SCHEMA_LIST_FLOW_ALIASES_OUTPUT, LIST_FLOW_VERSIONS as _SCHEMA_LIST_FLOW_VERSIONS, - LIST_FLOW_VERSIONS_INPUT as _SCHEMA_LIST_FLOW_VERSIONS_INPUT, - LIST_FLOW_VERSIONS_OUTPUT as _SCHEMA_LIST_FLOW_VERSIONS_OUTPUT, LIST_INGESTION_JOBS as _SCHEMA_LIST_INGESTION_JOBS, - LIST_INGESTION_JOBS_INPUT as _SCHEMA_LIST_INGESTION_JOBS_INPUT, - LIST_INGESTION_JOBS_OUTPUT as _SCHEMA_LIST_INGESTION_JOBS_OUTPUT, LIST_KNOWLEDGE_BASES as _SCHEMA_LIST_KNOWLEDGE_BASES, - LIST_KNOWLEDGE_BASES_INPUT as _SCHEMA_LIST_KNOWLEDGE_BASES_INPUT, - LIST_KNOWLEDGE_BASES_OUTPUT as _SCHEMA_LIST_KNOWLEDGE_BASES_OUTPUT, LIST_KNOWLEDGE_BASE_DOCUMENTS as _SCHEMA_LIST_KNOWLEDGE_BASE_DOCUMENTS, - LIST_KNOWLEDGE_BASE_DOCUMENTS_INPUT as _SCHEMA_LIST_KNOWLEDGE_BASE_DOCUMENTS_INPUT, - LIST_KNOWLEDGE_BASE_DOCUMENTS_OUTPUT as _SCHEMA_LIST_KNOWLEDGE_BASE_DOCUMENTS_OUTPUT, LIST_PROMPTS as _SCHEMA_LIST_PROMPTS, - LIST_PROMPTS_INPUT as _SCHEMA_LIST_PROMPTS_INPUT, - LIST_PROMPTS_OUTPUT as _SCHEMA_LIST_PROMPTS_OUTPUT, LIST_TAGS_FOR_RESOURCE as _SCHEMA_LIST_TAGS_FOR_RESOURCE, - LIST_TAGS_FOR_RESOURCE_INPUT as _SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT, - LIST_TAGS_FOR_RESOURCE_OUTPUT as _SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT, LIST_VPC_CONFIGURATIONS as _SCHEMA_LIST_VPC_CONFIGURATIONS, - LIST_VPC_CONFIGURATIONS_INPUT as _SCHEMA_LIST_VPC_CONFIGURATIONS_INPUT, - LIST_VPC_CONFIGURATIONS_OUTPUT as _SCHEMA_LIST_VPC_CONFIGURATIONS_OUTPUT, - LOOP_CONTROLLER_FLOW_NODE_CONFIGURATION as _SCHEMA_LOOP_CONTROLLER_FLOW_NODE_CONFIGURATION, - LOOP_FLOW_NODE_CONFIGURATION as _SCHEMA_LOOP_FLOW_NODE_CONFIGURATION, - LOOP_INCOMPATIBLE_NODE_TYPE_FLOW_VALIDATION_DETAILS as _SCHEMA_LOOP_INCOMPATIBLE_NODE_TYPE_FLOW_VALIDATION_DETAILS, - LOOP_INPUT_FLOW_NODE_CONFIGURATION as _SCHEMA_LOOP_INPUT_FLOW_NODE_CONFIGURATION, - MALFORMED_CONDITION_EXPRESSION_FLOW_VALIDATION_DETAILS as _SCHEMA_MALFORMED_CONDITION_EXPRESSION_FLOW_VALIDATION_DETAILS, - MALFORMED_NODE_INPUT_EXPRESSION_FLOW_VALIDATION_DETAILS as _SCHEMA_MALFORMED_NODE_INPUT_EXPRESSION_FLOW_VALIDATION_DETAILS, - MANAGED_KNOWLEDGE_BASE_CONFIGURATION as _SCHEMA_MANAGED_KNOWLEDGE_BASE_CONFIGURATION, - MANAGED_KNOWLEDGE_BASE_CONNECTOR_CONFIGURATION as _SCHEMA_MANAGED_KNOWLEDGE_BASE_CONNECTOR_CONFIGURATION, - MEDIA_EXTRACTION_CONFIGURATION as _SCHEMA_MEDIA_EXTRACTION_CONFIGURATION, - MEMORY_CONFIGURATION as _SCHEMA_MEMORY_CONFIGURATION, - MESSAGE as _SCHEMA_MESSAGE, - METADATA_ATTRIBUTE as _SCHEMA_METADATA_ATTRIBUTE, - METADATA_ATTRIBUTE_VALUE as _SCHEMA_METADATA_ATTRIBUTE_VALUE, - METADATA_CONFIGURATION_FOR_RERANKING as _SCHEMA_METADATA_CONFIGURATION_FOR_RERANKING, - MISMATCHED_NODE_INPUT_TYPE_FLOW_VALIDATION_DETAILS as _SCHEMA_MISMATCHED_NODE_INPUT_TYPE_FLOW_VALIDATION_DETAILS, - MISMATCHED_NODE_OUTPUT_TYPE_FLOW_VALIDATION_DETAILS as _SCHEMA_MISMATCHED_NODE_OUTPUT_TYPE_FLOW_VALIDATION_DETAILS, - MISSING_CONNECTION_CONFIGURATION_FLOW_VALIDATION_DETAILS as _SCHEMA_MISSING_CONNECTION_CONFIGURATION_FLOW_VALIDATION_DETAILS, - MISSING_DEFAULT_CONDITION_FLOW_VALIDATION_DETAILS as _SCHEMA_MISSING_DEFAULT_CONDITION_FLOW_VALIDATION_DETAILS, - MISSING_ENDING_NODES_FLOW_VALIDATION_DETAILS as _SCHEMA_MISSING_ENDING_NODES_FLOW_VALIDATION_DETAILS, - MISSING_LOOP_CONTROLLER_NODE_FLOW_VALIDATION_DETAILS as _SCHEMA_MISSING_LOOP_CONTROLLER_NODE_FLOW_VALIDATION_DETAILS, - MISSING_LOOP_INPUT_NODE_FLOW_VALIDATION_DETAILS as _SCHEMA_MISSING_LOOP_INPUT_NODE_FLOW_VALIDATION_DETAILS, - MISSING_NODE_CONFIGURATION_FLOW_VALIDATION_DETAILS as _SCHEMA_MISSING_NODE_CONFIGURATION_FLOW_VALIDATION_DETAILS, - MISSING_NODE_INPUT_FLOW_VALIDATION_DETAILS as _SCHEMA_MISSING_NODE_INPUT_FLOW_VALIDATION_DETAILS, - MISSING_NODE_OUTPUT_FLOW_VALIDATION_DETAILS as _SCHEMA_MISSING_NODE_OUTPUT_FLOW_VALIDATION_DETAILS, - MISSING_STARTING_NODES_FLOW_VALIDATION_DETAILS as _SCHEMA_MISSING_STARTING_NODES_FLOW_VALIDATION_DETAILS, - MONGO_DB_ATLAS_CONFIGURATION as _SCHEMA_MONGO_DB_ATLAS_CONFIGURATION, - MONGO_DB_ATLAS_FIELD_MAPPING as _SCHEMA_MONGO_DB_ATLAS_FIELD_MAPPING, - MONTHLY_SCHEDULE as _SCHEMA_MONTHLY_SCHEDULE, - MULTIPLE_LOOP_CONTROLLER_NODES_FLOW_VALIDATION_DETAILS as _SCHEMA_MULTIPLE_LOOP_CONTROLLER_NODES_FLOW_VALIDATION_DETAILS, - MULTIPLE_LOOP_INPUT_NODES_FLOW_VALIDATION_DETAILS as _SCHEMA_MULTIPLE_LOOP_INPUT_NODES_FLOW_VALIDATION_DETAILS, - MULTIPLE_NODE_INPUT_CONNECTIONS_FLOW_VALIDATION_DETAILS as _SCHEMA_MULTIPLE_NODE_INPUT_CONNECTIONS_FLOW_VALIDATION_DETAILS, - NEPTUNE_ANALYTICS_CONFIGURATION as _SCHEMA_NEPTUNE_ANALYTICS_CONFIGURATION, - NEPTUNE_ANALYTICS_FIELD_MAPPING as _SCHEMA_NEPTUNE_ANALYTICS_FIELD_MAPPING, - OPEN_SEARCH_MANAGED_CLUSTER_CONFIGURATION as _SCHEMA_OPEN_SEARCH_MANAGED_CLUSTER_CONFIGURATION, - OPEN_SEARCH_MANAGED_CLUSTER_FIELD_MAPPING as _SCHEMA_OPEN_SEARCH_MANAGED_CLUSTER_FIELD_MAPPING, - OPEN_SEARCH_SERVERLESS_CONFIGURATION as _SCHEMA_OPEN_SEARCH_SERVERLESS_CONFIGURATION, - OPEN_SEARCH_SERVERLESS_FIELD_MAPPING as _SCHEMA_OPEN_SEARCH_SERVERLESS_FIELD_MAPPING, - ORCHESTRATION_EXECUTOR as _SCHEMA_ORCHESTRATION_EXECUTOR, - OUTPUT_FLOW_NODE_CONFIGURATION as _SCHEMA_OUTPUT_FLOW_NODE_CONFIGURATION, - PARAMETER_DETAIL as _SCHEMA_PARAMETER_DETAIL, - PARSING_CONFIGURATION as _SCHEMA_PARSING_CONFIGURATION, - PARSING_PROMPT as _SCHEMA_PARSING_PROMPT, - PATTERN_OBJECT_FILTER as _SCHEMA_PATTERN_OBJECT_FILTER, - PATTERN_OBJECT_FILTER_CONFIGURATION as _SCHEMA_PATTERN_OBJECT_FILTER_CONFIGURATION, - PERFORMANCE_CONFIGURATION as _SCHEMA_PERFORMANCE_CONFIGURATION, - PINECONE_CONFIGURATION as _SCHEMA_PINECONE_CONFIGURATION, - PINECONE_FIELD_MAPPING as _SCHEMA_PINECONE_FIELD_MAPPING, PREPARE_AGENT as _SCHEMA_PREPARE_AGENT, - PREPARE_AGENT_INPUT as _SCHEMA_PREPARE_AGENT_INPUT, - PREPARE_AGENT_OUTPUT as _SCHEMA_PREPARE_AGENT_OUTPUT, PREPARE_FLOW as _SCHEMA_PREPARE_FLOW, - PREPARE_FLOW_INPUT as _SCHEMA_PREPARE_FLOW_INPUT, - PREPARE_FLOW_OUTPUT as _SCHEMA_PREPARE_FLOW_OUTPUT, - PROMPT_AGENT_RESOURCE as _SCHEMA_PROMPT_AGENT_RESOURCE, - PROMPT_CONFIGURATION as _SCHEMA_PROMPT_CONFIGURATION, - PROMPT_FLOW_NODE_CONFIGURATION as _SCHEMA_PROMPT_FLOW_NODE_CONFIGURATION, - PROMPT_FLOW_NODE_INLINE_CONFIGURATION as _SCHEMA_PROMPT_FLOW_NODE_INLINE_CONFIGURATION, - PROMPT_FLOW_NODE_RESOURCE_CONFIGURATION as _SCHEMA_PROMPT_FLOW_NODE_RESOURCE_CONFIGURATION, - PROMPT_FLOW_NODE_SOURCE_CONFIGURATION as _SCHEMA_PROMPT_FLOW_NODE_SOURCE_CONFIGURATION, - PROMPT_GEN_AI_RESOURCE as _SCHEMA_PROMPT_GEN_AI_RESOURCE, - PROMPT_INFERENCE_CONFIGURATION as _SCHEMA_PROMPT_INFERENCE_CONFIGURATION, - PROMPT_INPUT_VARIABLE as _SCHEMA_PROMPT_INPUT_VARIABLE, - PROMPT_METADATA_ENTRY as _SCHEMA_PROMPT_METADATA_ENTRY, - PROMPT_MODEL_INFERENCE_CONFIGURATION as _SCHEMA_PROMPT_MODEL_INFERENCE_CONFIGURATION, - PROMPT_OVERRIDE_CONFIGURATION as _SCHEMA_PROMPT_OVERRIDE_CONFIGURATION, - PROMPT_SUMMARY as _SCHEMA_PROMPT_SUMMARY, - PROMPT_TEMPLATE_CONFIGURATION as _SCHEMA_PROMPT_TEMPLATE_CONFIGURATION, - PROMPT_VARIANT as _SCHEMA_PROMPT_VARIANT, PUT_RESOURCE_POLICY as _SCHEMA_PUT_RESOURCE_POLICY, - PUT_RESOURCE_POLICY_INPUT as _SCHEMA_PUT_RESOURCE_POLICY_INPUT, - PUT_RESOURCE_POLICY_OUTPUT as _SCHEMA_PUT_RESOURCE_POLICY_OUTPUT, - QUERY_GENERATION_COLUMN as _SCHEMA_QUERY_GENERATION_COLUMN, - QUERY_GENERATION_CONFIGURATION as _SCHEMA_QUERY_GENERATION_CONFIGURATION, - QUERY_GENERATION_CONTEXT as _SCHEMA_QUERY_GENERATION_CONTEXT, - QUERY_GENERATION_TABLE as _SCHEMA_QUERY_GENERATION_TABLE, - RDS_CONFIGURATION as _SCHEMA_RDS_CONFIGURATION, - RDS_FIELD_MAPPING as _SCHEMA_RDS_FIELD_MAPPING, - REDIS_ENTERPRISE_CLOUD_CONFIGURATION as _SCHEMA_REDIS_ENTERPRISE_CLOUD_CONFIGURATION, - REDIS_ENTERPRISE_CLOUD_FIELD_MAPPING as _SCHEMA_REDIS_ENTERPRISE_CLOUD_FIELD_MAPPING, - REDSHIFT_CONFIGURATION as _SCHEMA_REDSHIFT_CONFIGURATION, - REDSHIFT_PROVISIONED_AUTH_CONFIGURATION as _SCHEMA_REDSHIFT_PROVISIONED_AUTH_CONFIGURATION, - REDSHIFT_PROVISIONED_CONFIGURATION as _SCHEMA_REDSHIFT_PROVISIONED_CONFIGURATION, - REDSHIFT_QUERY_ENGINE_AWS_DATA_CATALOG_STORAGE_CONFIGURATION as _SCHEMA_REDSHIFT_QUERY_ENGINE_AWS_DATA_CATALOG_STORAGE_CONFIGURATION, - REDSHIFT_QUERY_ENGINE_CONFIGURATION as _SCHEMA_REDSHIFT_QUERY_ENGINE_CONFIGURATION, - REDSHIFT_QUERY_ENGINE_REDSHIFT_STORAGE_CONFIGURATION as _SCHEMA_REDSHIFT_QUERY_ENGINE_REDSHIFT_STORAGE_CONFIGURATION, - REDSHIFT_QUERY_ENGINE_STORAGE_CONFIGURATION as _SCHEMA_REDSHIFT_QUERY_ENGINE_STORAGE_CONFIGURATION, - REDSHIFT_SERVERLESS_AUTH_CONFIGURATION as _SCHEMA_REDSHIFT_SERVERLESS_AUTH_CONFIGURATION, - REDSHIFT_SERVERLESS_CONFIGURATION as _SCHEMA_REDSHIFT_SERVERLESS_CONFIGURATION, - RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION as _SCHEMA_RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION, - RESOURCE_NOT_FOUND_EXCEPTION as _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - RETRIEVAL_FLOW_NODE_CONFIGURATION as _SCHEMA_RETRIEVAL_FLOW_NODE_CONFIGURATION, - RETRIEVAL_FLOW_NODE_S3_CONFIGURATION as _SCHEMA_RETRIEVAL_FLOW_NODE_S3_CONFIGURATION, - RETRIEVAL_FLOW_NODE_SERVICE_CONFIGURATION as _SCHEMA_RETRIEVAL_FLOW_NODE_SERVICE_CONFIGURATION, - S3_CONTENT as _SCHEMA_S3_CONTENT, - S3_DATA_SOURCE_CONFIGURATION as _SCHEMA_S3_DATA_SOURCE_CONFIGURATION, - S3_IDENTIFIER as _SCHEMA_S3_IDENTIFIER, - S3_LOCATION as _SCHEMA_S3_LOCATION, - S3_VECTORS_CONFIGURATION as _SCHEMA_S3_VECTORS_CONFIGURATION, - SALESFORCE_CRAWLER_CONFIGURATION as _SCHEMA_SALESFORCE_CRAWLER_CONFIGURATION, - SALESFORCE_DATA_SOURCE_CONFIGURATION as _SCHEMA_SALESFORCE_DATA_SOURCE_CONFIGURATION, - SALESFORCE_SOURCE_CONFIGURATION as _SCHEMA_SALESFORCE_SOURCE_CONFIGURATION, - SEED_URL as _SCHEMA_SEED_URL, - SEMANTIC_CHUNKING_CONFIGURATION as _SCHEMA_SEMANTIC_CHUNKING_CONFIGURATION, - SERVER_SIDE_ENCRYPTION_CONFIGURATION as _SCHEMA_SERVER_SIDE_ENCRYPTION_CONFIGURATION, - SERVICE_QUOTA_EXCEEDED_EXCEPTION as _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - SESSION_SUMMARY_CONFIGURATION as _SCHEMA_SESSION_SUMMARY_CONFIGURATION, - SHARE_POINT_CRAWLER_CONFIGURATION as _SCHEMA_SHARE_POINT_CRAWLER_CONFIGURATION, - SHARE_POINT_DATA_SOURCE_CONFIGURATION as _SCHEMA_SHARE_POINT_DATA_SOURCE_CONFIGURATION, - SHARE_POINT_SOURCE_CONFIGURATION as _SCHEMA_SHARE_POINT_SOURCE_CONFIGURATION, - SPECIFIC_TOOL_CHOICE as _SCHEMA_SPECIFIC_TOOL_CHOICE, - SQL_KNOWLEDGE_BASE_CONFIGURATION as _SCHEMA_SQL_KNOWLEDGE_BASE_CONFIGURATION, START_INGESTION_JOB as _SCHEMA_START_INGESTION_JOB, - START_INGESTION_JOB_INPUT as _SCHEMA_START_INGESTION_JOB_INPUT, - START_INGESTION_JOB_OUTPUT as _SCHEMA_START_INGESTION_JOB_OUTPUT, STOP_INGESTION_JOB as _SCHEMA_STOP_INGESTION_JOB, - STOP_INGESTION_JOB_INPUT as _SCHEMA_STOP_INGESTION_JOB_INPUT, - STOP_INGESTION_JOB_OUTPUT as _SCHEMA_STOP_INGESTION_JOB_OUTPUT, - STORAGE_CONFIGURATION as _SCHEMA_STORAGE_CONFIGURATION, - STORAGE_FLOW_NODE_CONFIGURATION as _SCHEMA_STORAGE_FLOW_NODE_CONFIGURATION, - STORAGE_FLOW_NODE_S3_CONFIGURATION as _SCHEMA_STORAGE_FLOW_NODE_S3_CONFIGURATION, - STORAGE_FLOW_NODE_SERVICE_CONFIGURATION as _SCHEMA_STORAGE_FLOW_NODE_SERVICE_CONFIGURATION, - SUPPLEMENTAL_DATA_STORAGE_CONFIGURATION as _SCHEMA_SUPPLEMENTAL_DATA_STORAGE_CONFIGURATION, - SUPPLEMENTAL_DATA_STORAGE_LOCATION as _SCHEMA_SUPPLEMENTAL_DATA_STORAGE_LOCATION, - SYNC_SCHEDULE as _SCHEMA_SYNC_SCHEDULE, - SYSTEM_CONTENT_BLOCK as _SCHEMA_SYSTEM_CONTENT_BLOCK, TAG_RESOURCE as _SCHEMA_TAG_RESOURCE, - TAG_RESOURCE_INPUT as _SCHEMA_TAG_RESOURCE_INPUT, - TAG_RESOURCE_OUTPUT as _SCHEMA_TAG_RESOURCE_OUTPUT, - TEXT_CONTENT_DOC as _SCHEMA_TEXT_CONTENT_DOC, - TEXT_PROMPT_TEMPLATE_CONFIGURATION as _SCHEMA_TEXT_PROMPT_TEMPLATE_CONFIGURATION, - THROTTLING_EXCEPTION as _SCHEMA_THROTTLING_EXCEPTION, - TOOL as _SCHEMA_TOOL, - TOOL_CHOICE as _SCHEMA_TOOL_CHOICE, - TOOL_CONFIGURATION as _SCHEMA_TOOL_CONFIGURATION, - TOOL_INPUT_SCHEMA as _SCHEMA_TOOL_INPUT_SCHEMA, - TOOL_SPECIFICATION as _SCHEMA_TOOL_SPECIFICATION, - TRANSFORMATION as _SCHEMA_TRANSFORMATION, - TRANSFORMATION_FUNCTION as _SCHEMA_TRANSFORMATION_FUNCTION, - TRANSFORMATION_LAMBDA_CONFIGURATION as _SCHEMA_TRANSFORMATION_LAMBDA_CONFIGURATION, - UNFULFILLED_NODE_INPUT_FLOW_VALIDATION_DETAILS as _SCHEMA_UNFULFILLED_NODE_INPUT_FLOW_VALIDATION_DETAILS, - UNKNOWN_CONNECTION_CONDITION_FLOW_VALIDATION_DETAILS as _SCHEMA_UNKNOWN_CONNECTION_CONDITION_FLOW_VALIDATION_DETAILS, - UNKNOWN_CONNECTION_SOURCE_FLOW_VALIDATION_DETAILS as _SCHEMA_UNKNOWN_CONNECTION_SOURCE_FLOW_VALIDATION_DETAILS, - UNKNOWN_CONNECTION_SOURCE_OUTPUT_FLOW_VALIDATION_DETAILS as _SCHEMA_UNKNOWN_CONNECTION_SOURCE_OUTPUT_FLOW_VALIDATION_DETAILS, - UNKNOWN_CONNECTION_TARGET_FLOW_VALIDATION_DETAILS as _SCHEMA_UNKNOWN_CONNECTION_TARGET_FLOW_VALIDATION_DETAILS, - UNKNOWN_CONNECTION_TARGET_INPUT_FLOW_VALIDATION_DETAILS as _SCHEMA_UNKNOWN_CONNECTION_TARGET_INPUT_FLOW_VALIDATION_DETAILS, - UNKNOWN_NODE_INPUT_FLOW_VALIDATION_DETAILS as _SCHEMA_UNKNOWN_NODE_INPUT_FLOW_VALIDATION_DETAILS, - UNKNOWN_NODE_OUTPUT_FLOW_VALIDATION_DETAILS as _SCHEMA_UNKNOWN_NODE_OUTPUT_FLOW_VALIDATION_DETAILS, - UNREACHABLE_NODE_FLOW_VALIDATION_DETAILS as _SCHEMA_UNREACHABLE_NODE_FLOW_VALIDATION_DETAILS, - UNSATISFIED_CONNECTION_CONDITIONS_FLOW_VALIDATION_DETAILS as _SCHEMA_UNSATISFIED_CONNECTION_CONDITIONS_FLOW_VALIDATION_DETAILS, - UNSPECIFIED_FLOW_VALIDATION_DETAILS as _SCHEMA_UNSPECIFIED_FLOW_VALIDATION_DETAILS, UNTAG_RESOURCE as _SCHEMA_UNTAG_RESOURCE, - UNTAG_RESOURCE_INPUT as _SCHEMA_UNTAG_RESOURCE_INPUT, - UNTAG_RESOURCE_OUTPUT as _SCHEMA_UNTAG_RESOURCE_OUTPUT, UPDATE_AGENT as _SCHEMA_UPDATE_AGENT, UPDATE_AGENT_ACTION_GROUP as _SCHEMA_UPDATE_AGENT_ACTION_GROUP, - UPDATE_AGENT_ACTION_GROUP_INPUT as _SCHEMA_UPDATE_AGENT_ACTION_GROUP_INPUT, - UPDATE_AGENT_ACTION_GROUP_OUTPUT as _SCHEMA_UPDATE_AGENT_ACTION_GROUP_OUTPUT, UPDATE_AGENT_ALIAS as _SCHEMA_UPDATE_AGENT_ALIAS, - UPDATE_AGENT_ALIAS_INPUT as _SCHEMA_UPDATE_AGENT_ALIAS_INPUT, - UPDATE_AGENT_ALIAS_OUTPUT as _SCHEMA_UPDATE_AGENT_ALIAS_OUTPUT, UPDATE_AGENT_COLLABORATOR as _SCHEMA_UPDATE_AGENT_COLLABORATOR, - UPDATE_AGENT_COLLABORATOR_INPUT as _SCHEMA_UPDATE_AGENT_COLLABORATOR_INPUT, - UPDATE_AGENT_COLLABORATOR_OUTPUT as _SCHEMA_UPDATE_AGENT_COLLABORATOR_OUTPUT, - UPDATE_AGENT_INPUT as _SCHEMA_UPDATE_AGENT_INPUT, UPDATE_AGENT_KNOWLEDGE_BASE as _SCHEMA_UPDATE_AGENT_KNOWLEDGE_BASE, - UPDATE_AGENT_KNOWLEDGE_BASE_INPUT as _SCHEMA_UPDATE_AGENT_KNOWLEDGE_BASE_INPUT, - UPDATE_AGENT_KNOWLEDGE_BASE_OUTPUT as _SCHEMA_UPDATE_AGENT_KNOWLEDGE_BASE_OUTPUT, - UPDATE_AGENT_OUTPUT as _SCHEMA_UPDATE_AGENT_OUTPUT, UPDATE_DATA_SOURCE as _SCHEMA_UPDATE_DATA_SOURCE, - UPDATE_DATA_SOURCE_INPUT as _SCHEMA_UPDATE_DATA_SOURCE_INPUT, - UPDATE_DATA_SOURCE_OUTPUT as _SCHEMA_UPDATE_DATA_SOURCE_OUTPUT, UPDATE_FLOW as _SCHEMA_UPDATE_FLOW, UPDATE_FLOW_ALIAS as _SCHEMA_UPDATE_FLOW_ALIAS, - UPDATE_FLOW_ALIAS_INPUT as _SCHEMA_UPDATE_FLOW_ALIAS_INPUT, - UPDATE_FLOW_ALIAS_OUTPUT as _SCHEMA_UPDATE_FLOW_ALIAS_OUTPUT, - UPDATE_FLOW_INPUT as _SCHEMA_UPDATE_FLOW_INPUT, - UPDATE_FLOW_OUTPUT as _SCHEMA_UPDATE_FLOW_OUTPUT, UPDATE_KNOWLEDGE_BASE as _SCHEMA_UPDATE_KNOWLEDGE_BASE, - UPDATE_KNOWLEDGE_BASE_INPUT as _SCHEMA_UPDATE_KNOWLEDGE_BASE_INPUT, - UPDATE_KNOWLEDGE_BASE_OUTPUT as _SCHEMA_UPDATE_KNOWLEDGE_BASE_OUTPUT, UPDATE_PROMPT as _SCHEMA_UPDATE_PROMPT, - UPDATE_PROMPT_INPUT as _SCHEMA_UPDATE_PROMPT_INPUT, - UPDATE_PROMPT_OUTPUT as _SCHEMA_UPDATE_PROMPT_OUTPUT, - URL_CONFIGURATION as _SCHEMA_URL_CONFIGURATION, VALIDATE_FLOW_DEFINITION as _SCHEMA_VALIDATE_FLOW_DEFINITION, - VALIDATE_FLOW_DEFINITION_INPUT as _SCHEMA_VALIDATE_FLOW_DEFINITION_INPUT, - VALIDATE_FLOW_DEFINITION_OUTPUT as _SCHEMA_VALIDATE_FLOW_DEFINITION_OUTPUT, - VALIDATION_EXCEPTION as _SCHEMA_VALIDATION_EXCEPTION, - VALIDATION_EXCEPTION_FIELD as _SCHEMA_VALIDATION_EXCEPTION_FIELD, - VECTOR_INGESTION_CONFIGURATION as _SCHEMA_VECTOR_INGESTION_CONFIGURATION, - VECTOR_KNOWLEDGE_BASE_CONFIGURATION as _SCHEMA_VECTOR_KNOWLEDGE_BASE_CONFIGURATION, - VECTOR_SEARCH_BEDROCK_RERANKING_CONFIGURATION as _SCHEMA_VECTOR_SEARCH_BEDROCK_RERANKING_CONFIGURATION, - VECTOR_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION as _SCHEMA_VECTOR_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION, - VECTOR_SEARCH_RERANKING_CONFIGURATION as _SCHEMA_VECTOR_SEARCH_RERANKING_CONFIGURATION, - VIDEO_CONFIGURATION as _SCHEMA_VIDEO_CONFIGURATION, - VIDEO_EXTRACTION_CONFIGURATION as _SCHEMA_VIDEO_EXTRACTION_CONFIGURATION, - VIDEO_SEGMENTATION_CONFIGURATION as _SCHEMA_VIDEO_SEGMENTATION_CONFIGURATION, - VPC_CONFIGURATION as _SCHEMA_VPC_CONFIGURATION, - VPC_CONFIGURATION_SUMMARY as _SCHEMA_VPC_CONFIGURATION_SUMMARY, - WEB_CRAWLER_CONFIGURATION as _SCHEMA_WEB_CRAWLER_CONFIGURATION, - WEB_CRAWLER_LIMITS as _SCHEMA_WEB_CRAWLER_LIMITS, - WEB_DATA_SOURCE_CONFIGURATION as _SCHEMA_WEB_DATA_SOURCE_CONFIGURATION, - WEB_SOURCE_CONFIGURATION as _SCHEMA_WEB_SOURCE_CONFIGURATION, - WEEKLY_SCHEDULE as _SCHEMA_WEEKLY_SCHEDULE, ) - -logger = logging.getLogger(__name__) - - -class ServiceError(ModeledError): - """ - Base error for all errors in the service. - - Some exceptions do not extend from this class, including - synthetic, implicit, and shared exception types. - """ - - -class AccessControlAccess(UnknownEnumMixin, StrEnum): - """The access level for an access control entry.""" - - ALLOW = "ALLOW" - DENY = "DENY" - - -class AccessControlPrincipalType(UnknownEnumMixin, StrEnum): - """The type of principal in an access control entry.""" - - USER = "USER" - - -@dataclass(kw_only=True) -class AccessDeniedException(ServiceError): - """The request is denied because of missing access permissions.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACCESS_DENIED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_ACCESS_DENIED_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_ACCESS_DENIED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ACCESS_DENIED_EXCEPTION, consumer=_consumer) - return kwargs - - -class CustomControlMethod(UnknownEnumMixin, StrEnum): - RETURN_CONTROL = "RETURN_CONTROL" - - -@dataclass -class ActionGroupExecutorLambda: - """ - The Amazon Resource Name (ARN) of the Lambda function containing the - business logic that is carried out upon invoking the action. - """ - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACTION_GROUP_EXECUTOR, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_ACTION_GROUP_EXECUTOR.members["lambda"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string( - _SCHEMA_ACTION_GROUP_EXECUTOR.members["lambda"] - ) - ) - - -@dataclass -class ActionGroupExecutorCustomControl: - """ - To return the action group invocation results directly in the - `InvokeAgent` response, specify `RETURN_CONTROL`. - """ - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACTION_GROUP_EXECUTOR, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_ACTION_GROUP_EXECUTOR.members["customControl"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=CustomControlMethod( - deserializer.read_string( - _SCHEMA_ACTION_GROUP_EXECUTOR.members["customControl"] - ) - ) - ) - - -@dataclass -class ActionGroupExecutorUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ActionGroupExecutor = Union[ - ActionGroupExecutorLambda - | ActionGroupExecutorCustomControl - | ActionGroupExecutorUnknown -] -""" -Contains details about the Lambda function containing the business logic -that is carried out upon invoking the action or the custom control -method for handling the information elicited from the user. -""" - - -class _ActionGroupExecutorDeserializer: - _result: ActionGroupExecutor | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> ActionGroupExecutor: - self._result = None - deserializer.read_struct(_SCHEMA_ACTION_GROUP_EXECUTOR, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(ActionGroupExecutorLambda.deserialize(de)) - - case 1: - self._set_result(ActionGroupExecutorCustomControl.deserialize(de)) - - case _: - self._set_result( - ActionGroupExecutorUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: ActionGroupExecutor) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class ConflictException(ServiceError): - """There was a conflict performing an operation.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONFLICT_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_CONFLICT_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_CONFLICT_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONFLICT_EXCEPTION, consumer=_consumer) - return kwargs - - -class ActionGroupState(UnknownEnumMixin, StrEnum): - ENABLED = "ENABLED" - DISABLED = "DISABLED" - - -@dataclass(kw_only=True) -class S3Identifier: - """The identifier information for an Amazon S3 bucket.""" - - s3_bucket_name: str | None = None - """The name of the S3 bucket.""" - - s3_object_key: str | None = None - """The S3 object key for the S3 resource.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_S3_IDENTIFIER, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.s3_bucket_name is not None: - serializer.write_string( - _SCHEMA_S3_IDENTIFIER.members["s3BucketName"], self.s3_bucket_name - ) - - if self.s3_object_key is not None: - serializer.write_string( - _SCHEMA_S3_IDENTIFIER.members["s3ObjectKey"], self.s3_object_key - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["s3_bucket_name"] = de.read_string( - _SCHEMA_S3_IDENTIFIER.members["s3BucketName"] - ) - - case 1: - kwargs["s3_object_key"] = de.read_string( - _SCHEMA_S3_IDENTIFIER.members["s3ObjectKey"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_S3_IDENTIFIER, consumer=_consumer) - return kwargs - - -@dataclass -class APISchemaS3: - """ - Contains details about the S3 object containing the OpenAPI schema for - the action group. For more information, see [Action group OpenAPI - schemas](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-api-schema.html). - """ - - value: S3Identifier - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_API_SCHEMA, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_API_SCHEMA.members["s3"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=S3Identifier.deserialize(deserializer)) - - -@dataclass -class APISchemaPayload: - """ - The JSON or YAML-formatted payload defining the OpenAPI schema for the - action group. For more information, see [Action group OpenAPI - schemas](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-api-schema.html). - """ - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_API_SCHEMA, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_API_SCHEMA.members["payload"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string(_SCHEMA_API_SCHEMA.members["payload"]) - ) - - -@dataclass -class APISchemaUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -APISchema = Union[APISchemaS3 | APISchemaPayload | APISchemaUnknown] -""" -Contains details about the OpenAPI schema for the action group. For more -information, see [Action group OpenAPI -schemas](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-api-schema.html). -You can either include the schema directly in the `payload` field or you -can upload it to an S3 bucket and specify the S3 bucket location in the -`s3` field. -""" - - -class _APISchemaDeserializer: - _result: APISchema | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> APISchema: - self._result = None - deserializer.read_struct(_SCHEMA_API_SCHEMA, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(APISchemaS3.deserialize(de)) - - case 1: - self._set_result(APISchemaPayload.deserialize(de)) - - case _: - self._set_result(APISchemaUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: APISchema) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class Type(UnknownEnumMixin, StrEnum): - STRING = "string" - NUMBER = "number" - INTEGER = "integer" - BOOLEAN = "boolean" - ARRAY = "array" - - -@dataclass(kw_only=True) -class ParameterDetail: - """ - Contains details about a parameter in a function for an action group. - - This data type is used in the following API operations: - - - [CreateAgentActionGroup - request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_CreateAgentActionGroup.html#API_agent_CreateAgentActionGroup_RequestSyntax) - - - [CreateAgentActionGroup - response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_CreateAgentActionGroup.html#API_agent_CreateAgentActionGroup_ResponseSyntax) - - - [UpdateAgentActionGroup - request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_UpdateAgentActionGroup.html#API_agent_UpdateAgentActionGroup_RequestSyntax) - - - [UpdateAgentActionGroup - response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_UpdateAgentActionGroup.html#API_agent_UpdateAgentActionGroup_ResponseSyntax) - - - [GetAgentActionGroup - response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_GetAgentActionGroup.html#API_agent_GetAgentActionGroup_ResponseSyntax) - """ - - type: str - """The data type of the parameter.""" - - description: str | None = None - """ - A description of the parameter. Helps the foundation model determine how - to elicit the parameters from the user. - """ - - required: bool | None = None - """ - Whether the parameter is required for the agent to complete the function - for action group invocation. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PARAMETER_DETAIL, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.description is not None: - serializer.write_string( - _SCHEMA_PARAMETER_DETAIL.members["description"], self.description - ) - - serializer.write_string(_SCHEMA_PARAMETER_DETAIL.members["type"], self.type) - if self.required is not None: - serializer.write_boolean( - _SCHEMA_PARAMETER_DETAIL.members["required"], self.required - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["description"] = de.read_string( - _SCHEMA_PARAMETER_DETAIL.members["description"] - ) - - case 1: - kwargs["type"] = Type( - de.read_string(_SCHEMA_PARAMETER_DETAIL.members["type"]) - ) - - case 2: - kwargs["required"] = de.read_boolean( - _SCHEMA_PARAMETER_DETAIL.members["required"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PARAMETER_DETAIL, consumer=_consumer) - if "type" not in kwargs: - kwargs["type"] = Type._corrected("") - return kwargs - - -def _serialize_parameter_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, ParameterDetail] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_struct(value_schema, v)) - - -def _deserialize_parameter_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, ParameterDetail]: - result: dict[str, ParameterDetail] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = ParameterDetail.deserialize(d) - - deserializer.read_map(schema, _read_value) - return result - - -class RequireConfirmation(UnknownEnumMixin, StrEnum): - """Whether the action requires user confirmation.""" - - ENABLED = "ENABLED" - DISABLED = "DISABLED" - - -@dataclass(kw_only=True) -class Function: - """ - Defines parameters that the agent needs to invoke from the user to - complete the function. Corresponds to an action in an action group. - - This data type is used in the following API operations: - - - [CreateAgentActionGroup - request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_CreateAgentActionGroup.html#API_agent_CreateAgentActionGroup_RequestSyntax) - - - [CreateAgentActionGroup - response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_CreateAgentActionGroup.html#API_agent_CreateAgentActionGroup_ResponseSyntax) - - - [UpdateAgentActionGroup - request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_UpdateAgentActionGroup.html#API_agent_UpdateAgentActionGroup_RequestSyntax) - - - [UpdateAgentActionGroup - response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_UpdateAgentActionGroup.html#API_agent_UpdateAgentActionGroup_ResponseSyntax) - - - [GetAgentActionGroup - response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_GetAgentActionGroup.html#API_agent_GetAgentActionGroup_ResponseSyntax) - """ - - name: str - """A name for the function.""" - - description: str | None = None - """A description of the function and its purpose.""" - - parameters: dict[str, ParameterDetail] | None = None - """ - The parameters that the agent elicits from the user to fulfill the - function. - """ - - require_confirmation: str | None = None - """ - Contains information if user confirmation is required to invoke the - function. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FUNCTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_FUNCTION.members["name"], self.name) - if self.description is not None: - serializer.write_string( - _SCHEMA_FUNCTION.members["description"], self.description - ) - - if self.parameters is not None: - _serialize_parameter_map( - serializer, _SCHEMA_FUNCTION.members["parameters"], self.parameters - ) - - if self.require_confirmation is not None: - serializer.write_string( - _SCHEMA_FUNCTION.members["requireConfirmation"], - self.require_confirmation, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string(_SCHEMA_FUNCTION.members["name"]) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_FUNCTION.members["description"] - ) - - case 2: - kwargs["parameters"] = _deserialize_parameter_map( - de, _SCHEMA_FUNCTION.members["parameters"] - ) - - case 3: - kwargs["require_confirmation"] = RequireConfirmation( - de.read_string(_SCHEMA_FUNCTION.members["requireConfirmation"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FUNCTION, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - return kwargs - - -def _serialize_functions( - serializer: ShapeSerializer, schema: Schema, value: list[Function] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_functions( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Function]: - result: list[Function] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Function.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass -class FunctionSchemaFunctions: - """A list of functions that each define an action in the action group.""" - - value: list[Function] - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FUNCTION_SCHEMA, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_functions( - serializer, _SCHEMA_FUNCTION_SCHEMA.members["functions"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_deserialize_functions( - deserializer, _SCHEMA_FUNCTION_SCHEMA.members["functions"] - ) - ) - - -@dataclass -class FunctionSchemaUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -FunctionSchema = Union[FunctionSchemaFunctions | FunctionSchemaUnknown] -""" -Defines functions that each define parameters that the agent needs to -invoke from the user. Each function represents an action in an action -group. - -This data type is used in the following API operations: - -- [CreateAgentActionGroup - request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_CreateAgentActionGroup.html#API_agent_CreateAgentActionGroup_RequestSyntax) - -- [CreateAgentActionGroup - response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_CreateAgentActionGroup.html#API_agent_CreateAgentActionGroup_ResponseSyntax) - -- [UpdateAgentActionGroup - request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_UpdateAgentActionGroup.html#API_agent_UpdateAgentActionGroup_RequestSyntax) - -- [UpdateAgentActionGroup - response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_UpdateAgentActionGroup.html#API_agent_UpdateAgentActionGroup_ResponseSyntax) - -- [GetAgentActionGroup - response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_GetAgentActionGroup.html#API_agent_GetAgentActionGroup_ResponseSyntax) -""" - - -class _FunctionSchemaDeserializer: - _result: FunctionSchema | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> FunctionSchema: - self._result = None - deserializer.read_struct(_SCHEMA_FUNCTION_SCHEMA, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(FunctionSchemaFunctions.deserialize(de)) - - case _: - self._set_result(FunctionSchemaUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: FunctionSchema) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class ActionGroupSignature(UnknownEnumMixin, StrEnum): - AMAZON_USERINPUT = "AMAZON.UserInput" - AMAZON_CODEINTERPRETER = "AMAZON.CodeInterpreter" - ANTHROPIC_COMPUTER = "ANTHROPIC.Computer" - ANTHROPIC_BASH = "ANTHROPIC.Bash" - ANTHROPIC_TEXTEDITOR = "ANTHROPIC.TextEditor" - - -def _serialize_action_group_signature_params( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_action_group_signature_params( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CreateAgentActionGroupInput: - """Dataclass for CreateAgentActionGroupInput structure.""" - - agent_id: str | None = None - """The unique identifier of the agent for which to create the action group.""" - - agent_version: str | None = None - """The version of the agent for which to create the action group.""" - - action_group_name: str | None = None - """The name to give the action group.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If this token matches a previous - request, Amazon Bedrock ignores the request, but does not return an - error. For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - description: str | None = None - """A description of the action group.""" - - parent_action_group_signature: str | None = None - """ - Specify a built-in or computer use action for this action group. If you - specify a value, you must leave the `description`, `apiSchema`, and - `actionGroupExecutor` fields empty for this action group. - - - To allow your agent to request the user for additional information - when trying to complete a task, set this field to `AMAZON.UserInput`. - - - To allow your agent to generate, run, and troubleshoot code when - trying to complete a task, set this field to `AMAZON.CodeInterpreter`. - - - To allow your agent to use an Anthropic computer use tool, specify one - of the following values. - - Warning: - Computer use is a new Anthropic Claude model capability (in beta) - available with Anthropic Claude 3.7 Sonnet and Claude 3.5 Sonnet v2 - only. When operating computer use functionality, we recommend taking - additional security precautions, such as executing computer actions in - virtual environments with restricted data access and limited internet - connectivity. For more information, see [Configure an Amazon Bedrock - Agent to complete tasks with computer use - tools](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-computer-use.html). - - - `ANTHROPIC.Computer` - Gives the agent permission to use the mouse - and keyboard and take screenshots. - - - `ANTHROPIC.TextEditor` - Gives the agent permission to view, create - and edit files. - - - `ANTHROPIC.Bash` - Gives the agent permission to run commands in a - bash shell. - """ - - parent_action_group_signature_params: dict[str, str] | None = None - """ - The configuration settings for a computer use action. - - Warning: - Computer use is a new Anthropic Claude model capability (in beta) - available with Anthropic Claude 3.7 Sonnet and Claude 3.5 Sonnet v2 - only. For more information, see [Configure an Amazon Bedrock Agent to - complete tasks with computer use - tools](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-computer-use.html). - """ - - action_group_executor: ActionGroupExecutor | None = None - """ - The Amazon Resource Name (ARN) of the Lambda function containing the - business logic that is carried out upon invoking the action or the - custom control method for handling the information elicited from the - user. - """ - - api_schema: APISchema | None = None - """ - Contains either details about the S3 object containing the OpenAPI - schema for the action group or the JSON or YAML-formatted payload - defining the schema. For more information, see [Action group OpenAPI - schemas](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-api-schema.html). - """ - - action_group_state: str | None = None - """ - Specifies whether the action group is available for the agent to invoke - or not when sending an - [InvokeAgent](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html) - request. - """ - - function_schema: FunctionSchema | None = None - """ - Contains details about the function schema for the action group or the - JSON or YAML-formatted payload defining the schema. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_AGENT_ACTION_GROUP_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.agent_id is not None: - serializer.write_string( - _SCHEMA_CREATE_AGENT_ACTION_GROUP_INPUT.members["agentId"], - self.agent_id, - ) - - if self.agent_version is not None: - serializer.write_string( - _SCHEMA_CREATE_AGENT_ACTION_GROUP_INPUT.members["agentVersion"], - self.agent_version, - ) - - if self.action_group_name is not None: - serializer.write_string( - _SCHEMA_CREATE_AGENT_ACTION_GROUP_INPUT.members["actionGroupName"], - self.action_group_name, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_AGENT_ACTION_GROUP_INPUT.members["clientToken"], - self.client_token, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_AGENT_ACTION_GROUP_INPUT.members["description"], - self.description, - ) - - if self.parent_action_group_signature is not None: - serializer.write_string( - _SCHEMA_CREATE_AGENT_ACTION_GROUP_INPUT.members[ - "parentActionGroupSignature" - ], - self.parent_action_group_signature, - ) - - if self.parent_action_group_signature_params is not None: - _serialize_action_group_signature_params( - serializer, - _SCHEMA_CREATE_AGENT_ACTION_GROUP_INPUT.members[ - "parentActionGroupSignatureParams" - ], - self.parent_action_group_signature_params, - ) - - if self.action_group_executor is not None: - serializer.write_struct( - _SCHEMA_CREATE_AGENT_ACTION_GROUP_INPUT.members["actionGroupExecutor"], - self.action_group_executor, - ) - - if self.api_schema is not None: - serializer.write_struct( - _SCHEMA_CREATE_AGENT_ACTION_GROUP_INPUT.members["apiSchema"], - self.api_schema, - ) - - if self.action_group_state is not None: - serializer.write_string( - _SCHEMA_CREATE_AGENT_ACTION_GROUP_INPUT.members["actionGroupState"], - self.action_group_state, - ) - - if self.function_schema is not None: - serializer.write_struct( - _SCHEMA_CREATE_AGENT_ACTION_GROUP_INPUT.members["functionSchema"], - self.function_schema, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_id"] = de.read_string( - _SCHEMA_CREATE_AGENT_ACTION_GROUP_INPUT.members["agentId"] - ) - - case 1: - kwargs["agent_version"] = de.read_string( - _SCHEMA_CREATE_AGENT_ACTION_GROUP_INPUT.members["agentVersion"] - ) - - case 2: - kwargs["action_group_name"] = de.read_string( - _SCHEMA_CREATE_AGENT_ACTION_GROUP_INPUT.members[ - "actionGroupName" - ] - ) - - case 3: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_AGENT_ACTION_GROUP_INPUT.members["clientToken"] - ) - - case 4: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_AGENT_ACTION_GROUP_INPUT.members["description"] - ) - - case 5: - kwargs["parent_action_group_signature"] = ActionGroupSignature( - de.read_string( - _SCHEMA_CREATE_AGENT_ACTION_GROUP_INPUT.members[ - "parentActionGroupSignature" - ] - ) - ) - - case 6: - kwargs["parent_action_group_signature_params"] = ( - _deserialize_action_group_signature_params( - de, - _SCHEMA_CREATE_AGENT_ACTION_GROUP_INPUT.members[ - "parentActionGroupSignatureParams" - ], - ) - ) - - case 7: - kwargs["action_group_executor"] = ( - _ActionGroupExecutorDeserializer().deserialize(de) - ) - - case 8: - kwargs["api_schema"] = _APISchemaDeserializer().deserialize(de) - - case 9: - kwargs["action_group_state"] = ActionGroupState( - de.read_string( - _SCHEMA_CREATE_AGENT_ACTION_GROUP_INPUT.members[ - "actionGroupState" - ] - ) - ) - - case 10: - kwargs["function_schema"] = ( - _FunctionSchemaDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_AGENT_ACTION_GROUP_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class AgentActionGroup: - """Contains details about an action group.""" - - agent_id: str - """The unique identifier of the agent to which the action group belongs.""" - - agent_version: str - """The version of the agent to which the action group belongs.""" - - action_group_id: str - """The unique identifier of the action group.""" - - action_group_name: str - """The name of the action group.""" - - created_at: datetime - """The time at which the action group was created.""" - - updated_at: datetime - """The time at which the action group was last updated.""" - - action_group_state: str - """ - Specifies whether the action group is available for the agent to invoke - or not when sending an - [InvokeAgent](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html) - request. - """ - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If this token matches a previous - request, Amazon Bedrock ignores the request, but does not return an - error. For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - description: str | None = None - """The description of the action group.""" - - parent_action_signature: str | None = None - """ - If this field is set as `AMAZON.UserInput`, the agent can request the - user for additional information when trying to complete a task. The - `description`, `apiSchema`, and `actionGroupExecutor` fields must be - blank for this action group. - - During orchestration, if the agent determines that it needs to invoke an - API in an action group, but doesn't have enough information to complete - the API request, it will invoke this action group instead and return an - [Observation](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Observation.html) - reprompting the user for more information. - """ - - parent_action_group_signature_params: dict[str, str] | None = None - """ - The configuration settings for a computer use action. - - Warning: - Computer use is a new Anthropic Claude model capability (in beta) - available with Claude 3.7 Sonnet and Claude 3.5 Sonnet v2 only. For more - information, see [Configure an Amazon Bedrock Agent to complete tasks - with computer use - tools](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-computer-use.html). - """ - - action_group_executor: ActionGroupExecutor | None = None - """ - The Amazon Resource Name (ARN) of the Lambda function containing the - business logic that is carried out upon invoking the action or the - custom control method for handling the information elicited from the - user. - """ - - api_schema: APISchema | None = None - """ - Contains either details about the S3 object containing the OpenAPI - schema for the action group or the JSON or YAML-formatted payload - defining the schema. For more information, see [Action group OpenAPI - schemas](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-api-schema.html). - """ - - function_schema: FunctionSchema | None = None - """ - Defines functions that each define parameters that the agent needs to - invoke from the user. Each function represents an action in an action - group. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENT_ACTION_GROUP, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AGENT_ACTION_GROUP.members["agentId"], self.agent_id - ) - serializer.write_string( - _SCHEMA_AGENT_ACTION_GROUP.members["agentVersion"], self.agent_version - ) - serializer.write_string( - _SCHEMA_AGENT_ACTION_GROUP.members["actionGroupId"], self.action_group_id - ) - serializer.write_string( - _SCHEMA_AGENT_ACTION_GROUP.members["actionGroupName"], - self.action_group_name, - ) - if self.client_token is not None: - serializer.write_string( - _SCHEMA_AGENT_ACTION_GROUP.members["clientToken"], self.client_token - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_AGENT_ACTION_GROUP.members["description"], self.description - ) - - serializer.write_timestamp( - _SCHEMA_AGENT_ACTION_GROUP.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_AGENT_ACTION_GROUP.members["updatedAt"], self.updated_at - ) - if self.parent_action_signature is not None: - serializer.write_string( - _SCHEMA_AGENT_ACTION_GROUP.members["parentActionSignature"], - self.parent_action_signature, - ) - - if self.parent_action_group_signature_params is not None: - _serialize_action_group_signature_params( - serializer, - _SCHEMA_AGENT_ACTION_GROUP.members["parentActionGroupSignatureParams"], - self.parent_action_group_signature_params, - ) - - if self.action_group_executor is not None: - serializer.write_struct( - _SCHEMA_AGENT_ACTION_GROUP.members["actionGroupExecutor"], - self.action_group_executor, - ) - - if self.api_schema is not None: - serializer.write_struct( - _SCHEMA_AGENT_ACTION_GROUP.members["apiSchema"], self.api_schema - ) - - if self.function_schema is not None: - serializer.write_struct( - _SCHEMA_AGENT_ACTION_GROUP.members["functionSchema"], - self.function_schema, - ) - - serializer.write_string( - _SCHEMA_AGENT_ACTION_GROUP.members["actionGroupState"], - self.action_group_state, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_id"] = de.read_string( - _SCHEMA_AGENT_ACTION_GROUP.members["agentId"] - ) - - case 1: - kwargs["agent_version"] = de.read_string( - _SCHEMA_AGENT_ACTION_GROUP.members["agentVersion"] - ) - - case 2: - kwargs["action_group_id"] = de.read_string( - _SCHEMA_AGENT_ACTION_GROUP.members["actionGroupId"] - ) - - case 3: - kwargs["action_group_name"] = de.read_string( - _SCHEMA_AGENT_ACTION_GROUP.members["actionGroupName"] - ) - - case 4: - kwargs["client_token"] = de.read_string( - _SCHEMA_AGENT_ACTION_GROUP.members["clientToken"] - ) - - case 5: - kwargs["description"] = de.read_string( - _SCHEMA_AGENT_ACTION_GROUP.members["description"] - ) - - case 6: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_AGENT_ACTION_GROUP.members["createdAt"] - ) - - case 7: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_AGENT_ACTION_GROUP.members["updatedAt"] - ) - - case 8: - kwargs["parent_action_signature"] = ActionGroupSignature( - de.read_string( - _SCHEMA_AGENT_ACTION_GROUP.members["parentActionSignature"] - ) - ) - - case 9: - kwargs["parent_action_group_signature_params"] = ( - _deserialize_action_group_signature_params( - de, - _SCHEMA_AGENT_ACTION_GROUP.members[ - "parentActionGroupSignatureParams" - ], - ) - ) - - case 10: - kwargs["action_group_executor"] = ( - _ActionGroupExecutorDeserializer().deserialize(de) - ) - - case 11: - kwargs["api_schema"] = _APISchemaDeserializer().deserialize(de) - - case 12: - kwargs["function_schema"] = ( - _FunctionSchemaDeserializer().deserialize(de) - ) - - case 13: - kwargs["action_group_state"] = ActionGroupState( - de.read_string( - _SCHEMA_AGENT_ACTION_GROUP.members["actionGroupState"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AGENT_ACTION_GROUP, consumer=_consumer) - if "agent_id" not in kwargs: - kwargs["agent_id"] = "" - if "agent_version" not in kwargs: - kwargs["agent_version"] = "" - if "action_group_id" not in kwargs: - kwargs["action_group_id"] = "" - if "action_group_name" not in kwargs: - kwargs["action_group_name"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "action_group_state" not in kwargs: - kwargs["action_group_state"] = ActionGroupState._corrected("") - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls( - agent_id="", - agent_version="", - action_group_id="", - action_group_name="", - created_at=datetime.fromtimestamp(0, tz=timezone.utc), - updated_at=datetime.fromtimestamp(0, tz=timezone.utc), - action_group_state=ActionGroupState._corrected(""), - ) - - -@dataclass(kw_only=True) -class CreateAgentActionGroupOutput: - """Dataclass for CreateAgentActionGroupOutput structure.""" - - agent_action_group: AgentActionGroup - """Contains details about the action group that was created.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_AGENT_ACTION_GROUP_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CREATE_AGENT_ACTION_GROUP_OUTPUT.members["agentActionGroup"], - self.agent_action_group, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_action_group"] = AgentActionGroup.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_AGENT_ACTION_GROUP_OUTPUT, consumer=_consumer - ) - if "agent_action_group" not in kwargs: - kwargs["agent_action_group"] = AgentActionGroup._smithy_default() - return kwargs - - -@dataclass(kw_only=True) -class InternalServerException(ServiceError): - """An internal server error occurred. Retry your request.""" - - fault: Literal["client", "server"] | None = "server" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INTERNAL_SERVER_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INTERNAL_SERVER_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INTERNAL_SERVER_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INTERNAL_SERVER_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ResourceNotFoundException(ServiceError): - """ - The specified resource Amazon Resource Name (ARN) was not found. Check - the Amazon Resource Name (ARN) and try your request again. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ServiceQuotaExceededException(ServiceError): - """ - The number of requests exceeds the service quota. Resubmit your request - later. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ThrottlingException(ServiceError): - """The number of requests exceeds the limit. Resubmit your request later.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_THROTTLING_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_THROTTLING_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_THROTTLING_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_THROTTLING_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ValidationExceptionField: - """ - Stores information about a field passed inside a request that resulted - in an validation error. - """ - - name: str - """The name of the field.""" - - message: str - """A message describing why this field failed validation.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VALIDATION_EXCEPTION_FIELD, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_VALIDATION_EXCEPTION_FIELD.members["name"], self.name - ) - serializer.write_string( - _SCHEMA_VALIDATION_EXCEPTION_FIELD.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_VALIDATION_EXCEPTION_FIELD.members["name"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_VALIDATION_EXCEPTION_FIELD.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VALIDATION_EXCEPTION_FIELD, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "message" not in kwargs: - kwargs["message"] = "" - return kwargs - - -def _serialize_validation_exception_field_list( - serializer: ShapeSerializer, schema: Schema, value: list[ValidationExceptionField] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_validation_exception_field_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ValidationExceptionField]: - result: list[ValidationExceptionField] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ValidationExceptionField.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ValidationException(ServiceError): - """ - Input validation failed. Check your request parameters and retry the - request. - """ - - fault: Literal["client", "server"] | None = "client" - - field_list: list[ValidationExceptionField] | None = None - """ - A list of objects containing fields that caused validation errors and - their corresponding validation error messages. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VALIDATION_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_VALIDATION_EXCEPTION.members["message"], self.message - ) - - if self.field_list is not None: - _serialize_validation_exception_field_list( - serializer, - _SCHEMA_VALIDATION_EXCEPTION.members["fieldList"], - self.field_list, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_VALIDATION_EXCEPTION.members["message"] - ) - - case 1: - kwargs["field_list"] = _deserialize_validation_exception_field_list( - de, _SCHEMA_VALIDATION_EXCEPTION.members["fieldList"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VALIDATION_EXCEPTION, consumer=_consumer) - return kwargs - - -CREATE_AGENT_ACTION_GROUP = APIOperation( - input=CreateAgentActionGroupInput, - output=CreateAgentActionGroupOutput, - schema=_SCHEMA_CREATE_AGENT_ACTION_GROUP, - input_schema=_SCHEMA_CREATE_AGENT_ACTION_GROUP_INPUT, - output_schema=_SCHEMA_CREATE_AGENT_ACTION_GROUP_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrockagent#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteAgentActionGroupInput: - """Dataclass for DeleteAgentActionGroupInput structure.""" - - agent_id: str | None = None - """The unique identifier of the agent that the action group belongs to.""" - - agent_version: str | None = None - """The version of the agent that the action group belongs to.""" - - action_group_id: str | None = None - """The unique identifier of the action group to delete.""" - - skip_resource_in_use_check: bool = False - """ - By default, this value is `false` and deletion is stopped if the - resource is in use. If you set it to `true`, the resource will be - deleted even if the resource is in use. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_AGENT_ACTION_GROUP_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.agent_id is not None: - serializer.write_string( - _SCHEMA_DELETE_AGENT_ACTION_GROUP_INPUT.members["agentId"], - self.agent_id, - ) - - if self.agent_version is not None: - serializer.write_string( - _SCHEMA_DELETE_AGENT_ACTION_GROUP_INPUT.members["agentVersion"], - self.agent_version, - ) - - if self.action_group_id is not None: - serializer.write_string( - _SCHEMA_DELETE_AGENT_ACTION_GROUP_INPUT.members["actionGroupId"], - self.action_group_id, - ) - - if self.skip_resource_in_use_check is not None: - serializer.write_boolean( - _SCHEMA_DELETE_AGENT_ACTION_GROUP_INPUT.members[ - "skipResourceInUseCheck" - ], - self.skip_resource_in_use_check, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_id"] = de.read_string( - _SCHEMA_DELETE_AGENT_ACTION_GROUP_INPUT.members["agentId"] - ) - - case 1: - kwargs["agent_version"] = de.read_string( - _SCHEMA_DELETE_AGENT_ACTION_GROUP_INPUT.members["agentVersion"] - ) - - case 2: - kwargs["action_group_id"] = de.read_string( - _SCHEMA_DELETE_AGENT_ACTION_GROUP_INPUT.members["actionGroupId"] - ) - - case 3: - kwargs["skip_resource_in_use_check"] = de.read_boolean( - _SCHEMA_DELETE_AGENT_ACTION_GROUP_INPUT.members[ - "skipResourceInUseCheck" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_AGENT_ACTION_GROUP_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteAgentActionGroupOutput: - """Dataclass for DeleteAgentActionGroupOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_AGENT_ACTION_GROUP_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_AGENT_ACTION_GROUP_OUTPUT, consumer=_consumer - ) - return kwargs - - -DELETE_AGENT_ACTION_GROUP = APIOperation( - input=DeleteAgentActionGroupInput, - output=DeleteAgentActionGroupOutput, - schema=_SCHEMA_DELETE_AGENT_ACTION_GROUP, - input_schema=_SCHEMA_DELETE_AGENT_ACTION_GROUP_INPUT, - output_schema=_SCHEMA_DELETE_AGENT_ACTION_GROUP_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrockagent#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetAgentActionGroupInput: - """Dataclass for GetAgentActionGroupInput structure.""" - - agent_id: str | None = None - """The unique identifier of the agent that the action group belongs to.""" - - agent_version: str | None = None - """The version of the agent that the action group belongs to.""" - - action_group_id: str | None = None - """The unique identifier of the action group for which to get information.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_AGENT_ACTION_GROUP_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.agent_id is not None: - serializer.write_string( - _SCHEMA_GET_AGENT_ACTION_GROUP_INPUT.members["agentId"], self.agent_id - ) - - if self.agent_version is not None: - serializer.write_string( - _SCHEMA_GET_AGENT_ACTION_GROUP_INPUT.members["agentVersion"], - self.agent_version, - ) - - if self.action_group_id is not None: - serializer.write_string( - _SCHEMA_GET_AGENT_ACTION_GROUP_INPUT.members["actionGroupId"], - self.action_group_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_id"] = de.read_string( - _SCHEMA_GET_AGENT_ACTION_GROUP_INPUT.members["agentId"] - ) - - case 1: - kwargs["agent_version"] = de.read_string( - _SCHEMA_GET_AGENT_ACTION_GROUP_INPUT.members["agentVersion"] - ) - - case 2: - kwargs["action_group_id"] = de.read_string( - _SCHEMA_GET_AGENT_ACTION_GROUP_INPUT.members["actionGroupId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_AGENT_ACTION_GROUP_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetAgentActionGroupOutput: - """Dataclass for GetAgentActionGroupOutput structure.""" - - agent_action_group: AgentActionGroup - """Contains details about the action group.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_AGENT_ACTION_GROUP_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_AGENT_ACTION_GROUP_OUTPUT.members["agentActionGroup"], - self.agent_action_group, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_action_group"] = AgentActionGroup.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_AGENT_ACTION_GROUP_OUTPUT, consumer=_consumer - ) - if "agent_action_group" not in kwargs: - kwargs["agent_action_group"] = AgentActionGroup._smithy_default() - return kwargs - - -GET_AGENT_ACTION_GROUP = APIOperation( - input=GetAgentActionGroupInput, - output=GetAgentActionGroupOutput, - schema=_SCHEMA_GET_AGENT_ACTION_GROUP, - input_schema=_SCHEMA_GET_AGENT_ACTION_GROUP_INPUT, - output_schema=_SCHEMA_GET_AGENT_ACTION_GROUP_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListAgentActionGroupsInput: - """Dataclass for ListAgentActionGroupsInput structure.""" - - agent_id: str | None = None - """The unique identifier of the agent.""" - - agent_version: str | None = None - """The version of the agent.""" - - max_results: int | None = None - """ - The maximum number of results to return in the response. If the total - number of results is greater than this value, use the token returned in - the response in the `nextToken` field when making another request to - return the next batch of results. - """ - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, enter the token returned in the `nextToken` - field in the response in this field to return the next batch of results. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_AGENT_ACTION_GROUPS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.agent_id is not None: - serializer.write_string( - _SCHEMA_LIST_AGENT_ACTION_GROUPS_INPUT.members["agentId"], self.agent_id - ) - - if self.agent_version is not None: - serializer.write_string( - _SCHEMA_LIST_AGENT_ACTION_GROUPS_INPUT.members["agentVersion"], - self.agent_version, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_AGENT_ACTION_GROUPS_INPUT.members["maxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_AGENT_ACTION_GROUPS_INPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_id"] = de.read_string( - _SCHEMA_LIST_AGENT_ACTION_GROUPS_INPUT.members["agentId"] - ) - - case 1: - kwargs["agent_version"] = de.read_string( - _SCHEMA_LIST_AGENT_ACTION_GROUPS_INPUT.members["agentVersion"] - ) - - case 2: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_AGENT_ACTION_GROUPS_INPUT.members["maxResults"] - ) - - case 3: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_AGENT_ACTION_GROUPS_INPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_AGENT_ACTION_GROUPS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ActionGroupSummary: - """Contains details about an action group.""" - - action_group_id: str - """The unique identifier of the action group.""" - - action_group_name: str - """The name of the action group.""" - - action_group_state: str - """ - Specifies whether the action group is available for the agent to invoke - or not when sending an - [InvokeAgent](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html) - request. - """ - - updated_at: datetime - """The time at which the action group was last updated.""" - - description: str | None = None - """The description of the action group.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACTION_GROUP_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_ACTION_GROUP_SUMMARY.members["actionGroupId"], self.action_group_id - ) - serializer.write_string( - _SCHEMA_ACTION_GROUP_SUMMARY.members["actionGroupName"], - self.action_group_name, - ) - serializer.write_string( - _SCHEMA_ACTION_GROUP_SUMMARY.members["actionGroupState"], - self.action_group_state, - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_ACTION_GROUP_SUMMARY.members["description"], self.description - ) - - serializer.write_timestamp( - _SCHEMA_ACTION_GROUP_SUMMARY.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["action_group_id"] = de.read_string( - _SCHEMA_ACTION_GROUP_SUMMARY.members["actionGroupId"] - ) - - case 1: - kwargs["action_group_name"] = de.read_string( - _SCHEMA_ACTION_GROUP_SUMMARY.members["actionGroupName"] - ) - - case 2: - kwargs["action_group_state"] = ActionGroupState( - de.read_string( - _SCHEMA_ACTION_GROUP_SUMMARY.members["actionGroupState"] - ) - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_ACTION_GROUP_SUMMARY.members["description"] - ) - - case 4: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_ACTION_GROUP_SUMMARY.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ACTION_GROUP_SUMMARY, consumer=_consumer) - if "action_group_id" not in kwargs: - kwargs["action_group_id"] = "" - if "action_group_name" not in kwargs: - kwargs["action_group_name"] = "" - if "action_group_state" not in kwargs: - kwargs["action_group_state"] = ActionGroupState._corrected("") - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_action_group_summaries( - serializer: ShapeSerializer, schema: Schema, value: list[ActionGroupSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_action_group_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ActionGroupSummary]: - result: list[ActionGroupSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ActionGroupSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListAgentActionGroupsOutput: - """Dataclass for ListAgentActionGroupsOutput structure.""" - - action_group_summaries: list[ActionGroupSummary] - """ - A list of objects, each of which contains information about an action - group. - """ - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, use this token when making another request in - the `nextToken` field to return the next batch of results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_AGENT_ACTION_GROUPS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_action_group_summaries( - serializer, - _SCHEMA_LIST_AGENT_ACTION_GROUPS_OUTPUT.members["actionGroupSummaries"], - self.action_group_summaries, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_AGENT_ACTION_GROUPS_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["action_group_summaries"] = ( - _deserialize_action_group_summaries( - de, - _SCHEMA_LIST_AGENT_ACTION_GROUPS_OUTPUT.members[ - "actionGroupSummaries" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_AGENT_ACTION_GROUPS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_AGENT_ACTION_GROUPS_OUTPUT, consumer=_consumer - ) - if "action_group_summaries" not in kwargs: - kwargs["action_group_summaries"] = [] - return kwargs - - -LIST_AGENT_ACTION_GROUPS = APIOperation( - input=ListAgentActionGroupsInput, - output=ListAgentActionGroupsOutput, - schema=_SCHEMA_LIST_AGENT_ACTION_GROUPS, - input_schema=_SCHEMA_LIST_AGENT_ACTION_GROUPS_INPUT, - output_schema=_SCHEMA_LIST_AGENT_ACTION_GROUPS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateAgentActionGroupInput: - """Dataclass for UpdateAgentActionGroupInput structure.""" - - agent_id: str | None = None - """The unique identifier of the agent for which to update the action group.""" - - agent_version: str | None = None - """ - The unique identifier of the agent version for which to update the - action group. - """ - - action_group_id: str | None = None - """The unique identifier of the action group.""" - - action_group_name: str | None = None - """Specifies a new name for the action group.""" - - description: str | None = None - """Specifies a new name for the action group.""" - - parent_action_group_signature: str | None = None - """ - Update the built-in or computer use action for this action group. If you - specify a value, you must leave the `description`, `apiSchema`, and - `actionGroupExecutor` fields empty for this action group. - - - To allow your agent to request the user for additional information - when trying to complete a task, set this field to `AMAZON.UserInput`. - - - To allow your agent to generate, run, and troubleshoot code when - trying to complete a task, set this field to `AMAZON.CodeInterpreter`. - - - To allow your agent to use an Anthropic computer use tool, specify one - of the following values. - - Warning: - Computer use is a new Anthropic Claude model capability (in beta) - available with Anthropic Claude 3.7 Sonnet and Claude 3.5 Sonnet v2 - only. When operating computer use functionality, we recommend taking - additional security precautions, such as executing computer actions in - virtual environments with restricted data access and limited internet - connectivity. For more information, see [Configure an Amazon Bedrock - Agent to complete tasks with computer use - tools](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-computer-use.html). - - - `ANTHROPIC.Computer` - Gives the agent permission to use the mouse - and keyboard and take screenshots. - - - `ANTHROPIC.TextEditor` - Gives the agent permission to view, create - and edit files. - - - `ANTHROPIC.Bash` - Gives the agent permission to run commands in a - bash shell. - - During orchestration, if your agent determines that it needs to invoke - an API in an action group, but doesn't have enough information to - complete the API request, it will invoke this action group instead and - return an - [Observation](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Observation.html) - reprompting the user for more information. - """ - - parent_action_group_signature_params: dict[str, str] | None = None - """ - The configuration settings for a computer use action. - - Warning: - Computer use is a new Anthropic Claude model capability (in beta) - available with Claude 3.7 Sonnet and Claude 3.5 Sonnet v2 only. For more - information, see [Configure an Amazon Bedrock Agent to complete tasks - with computer use - tools](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-computer-use.html). - """ - - action_group_executor: ActionGroupExecutor | None = None - """ - The Amazon Resource Name (ARN) of the Lambda function containing the - business logic that is carried out upon invoking the action. - """ - - action_group_state: str | None = None - """ - Specifies whether the action group is available for the agent to invoke - or not when sending an - [InvokeAgent](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html) - request. - """ - - api_schema: APISchema | None = None - """ - Contains either details about the S3 object containing the OpenAPI - schema for the action group or the JSON or YAML-formatted payload - defining the schema. For more information, see [Action group OpenAPI - schemas](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-api-schema.html). - """ - - function_schema: FunctionSchema | None = None - """ - Contains details about the function schema for the action group or the - JSON or YAML-formatted payload defining the schema. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_AGENT_ACTION_GROUP_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.agent_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_AGENT_ACTION_GROUP_INPUT.members["agentId"], - self.agent_id, - ) - - if self.agent_version is not None: - serializer.write_string( - _SCHEMA_UPDATE_AGENT_ACTION_GROUP_INPUT.members["agentVersion"], - self.agent_version, - ) - - if self.action_group_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_AGENT_ACTION_GROUP_INPUT.members["actionGroupId"], - self.action_group_id, - ) - - if self.action_group_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_AGENT_ACTION_GROUP_INPUT.members["actionGroupName"], - self.action_group_name, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_AGENT_ACTION_GROUP_INPUT.members["description"], - self.description, - ) - - if self.parent_action_group_signature is not None: - serializer.write_string( - _SCHEMA_UPDATE_AGENT_ACTION_GROUP_INPUT.members[ - "parentActionGroupSignature" - ], - self.parent_action_group_signature, - ) - - if self.parent_action_group_signature_params is not None: - _serialize_action_group_signature_params( - serializer, - _SCHEMA_UPDATE_AGENT_ACTION_GROUP_INPUT.members[ - "parentActionGroupSignatureParams" - ], - self.parent_action_group_signature_params, - ) - - if self.action_group_executor is not None: - serializer.write_struct( - _SCHEMA_UPDATE_AGENT_ACTION_GROUP_INPUT.members["actionGroupExecutor"], - self.action_group_executor, - ) - - if self.action_group_state is not None: - serializer.write_string( - _SCHEMA_UPDATE_AGENT_ACTION_GROUP_INPUT.members["actionGroupState"], - self.action_group_state, - ) - - if self.api_schema is not None: - serializer.write_struct( - _SCHEMA_UPDATE_AGENT_ACTION_GROUP_INPUT.members["apiSchema"], - self.api_schema, - ) - - if self.function_schema is not None: - serializer.write_struct( - _SCHEMA_UPDATE_AGENT_ACTION_GROUP_INPUT.members["functionSchema"], - self.function_schema, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_id"] = de.read_string( - _SCHEMA_UPDATE_AGENT_ACTION_GROUP_INPUT.members["agentId"] - ) - - case 1: - kwargs["agent_version"] = de.read_string( - _SCHEMA_UPDATE_AGENT_ACTION_GROUP_INPUT.members["agentVersion"] - ) - - case 2: - kwargs["action_group_id"] = de.read_string( - _SCHEMA_UPDATE_AGENT_ACTION_GROUP_INPUT.members["actionGroupId"] - ) - - case 3: - kwargs["action_group_name"] = de.read_string( - _SCHEMA_UPDATE_AGENT_ACTION_GROUP_INPUT.members[ - "actionGroupName" - ] - ) - - case 4: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_AGENT_ACTION_GROUP_INPUT.members["description"] - ) - - case 5: - kwargs["parent_action_group_signature"] = ActionGroupSignature( - de.read_string( - _SCHEMA_UPDATE_AGENT_ACTION_GROUP_INPUT.members[ - "parentActionGroupSignature" - ] - ) - ) - - case 6: - kwargs["parent_action_group_signature_params"] = ( - _deserialize_action_group_signature_params( - de, - _SCHEMA_UPDATE_AGENT_ACTION_GROUP_INPUT.members[ - "parentActionGroupSignatureParams" - ], - ) - ) - - case 7: - kwargs["action_group_executor"] = ( - _ActionGroupExecutorDeserializer().deserialize(de) - ) - - case 8: - kwargs["action_group_state"] = ActionGroupState( - de.read_string( - _SCHEMA_UPDATE_AGENT_ACTION_GROUP_INPUT.members[ - "actionGroupState" - ] - ) - ) - - case 9: - kwargs["api_schema"] = _APISchemaDeserializer().deserialize(de) - - case 10: - kwargs["function_schema"] = ( - _FunctionSchemaDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_AGENT_ACTION_GROUP_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateAgentActionGroupOutput: - """Dataclass for UpdateAgentActionGroupOutput structure.""" - - agent_action_group: AgentActionGroup - """Contains details about the action group that was updated.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_AGENT_ACTION_GROUP_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_UPDATE_AGENT_ACTION_GROUP_OUTPUT.members["agentActionGroup"], - self.agent_action_group, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_action_group"] = AgentActionGroup.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_AGENT_ACTION_GROUP_OUTPUT, consumer=_consumer - ) - if "agent_action_group" not in kwargs: - kwargs["agent_action_group"] = AgentActionGroup._smithy_default() - return kwargs - - -UPDATE_AGENT_ACTION_GROUP = APIOperation( - input=UpdateAgentActionGroupInput, - output=UpdateAgentActionGroupOutput, - schema=_SCHEMA_UPDATE_AGENT_ACTION_GROUP, - input_schema=_SCHEMA_UPDATE_AGENT_ACTION_GROUP_INPUT, - output_schema=_SCHEMA_UPDATE_AGENT_ACTION_GROUP_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrockagent#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -def _serialize_additional_model_request_fields( - serializer: ShapeSerializer, schema: Schema, value: dict[str, Document] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_document(value_schema, v)) - - -def _deserialize_additional_model_request_fields( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, Document]: - result: dict[str, Document] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_document(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -class AgentCollaboration(UnknownEnumMixin, StrEnum): - SUPERVISOR = "SUPERVISOR" - SUPERVISOR_ROUTER = "SUPERVISOR_ROUTER" - DISABLED = "DISABLED" - - -class AgentStatus(UnknownEnumMixin, StrEnum): - CREATING = "CREATING" - PREPARING = "PREPARING" - PREPARED = "PREPARED" - NOT_PREPARED = "NOT_PREPARED" - DELETING = "DELETING" - FAILED = "FAILED" - VERSIONING = "VERSIONING" - UPDATING = "UPDATING" - - -@dataclass -class OrchestrationExecutorLambda: - """ - The Amazon Resource Name (ARN) of the Lambda function containing the - business logic that is carried out upon invoking the action. - """ - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ORCHESTRATION_EXECUTOR, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_ORCHESTRATION_EXECUTOR.members["lambda"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string( - _SCHEMA_ORCHESTRATION_EXECUTOR.members["lambda"] - ) - ) - - -@dataclass -class OrchestrationExecutorUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -OrchestrationExecutor = Union[ - OrchestrationExecutorLambda | OrchestrationExecutorUnknown -] -""" -Contains details about the Lambda function containing the orchestration -logic carried out upon invoking the custom orchestration. -""" - - -class _OrchestrationExecutorDeserializer: - _result: OrchestrationExecutor | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> OrchestrationExecutor: - self._result = None - deserializer.read_struct(_SCHEMA_ORCHESTRATION_EXECUTOR, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(OrchestrationExecutorLambda.deserialize(de)) - - case _: - self._set_result( - OrchestrationExecutorUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: OrchestrationExecutor) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class CustomOrchestration: - """Details of custom orchestration.""" - - executor: OrchestrationExecutor | None = None - """ - The structure of the executor invoking the actions in custom - orchestration. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOM_ORCHESTRATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.executor is not None: - serializer.write_struct( - _SCHEMA_CUSTOM_ORCHESTRATION.members["executor"], self.executor - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["executor"] = ( - _OrchestrationExecutorDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CUSTOM_ORCHESTRATION, consumer=_consumer) - return kwargs - - -def _serialize_failure_reasons( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_failure_reasons( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GuardrailConfiguration: - """Details about a guardrail associated with a resource.""" - - guardrail_identifier: str | None = None - """The unique identifier of the guardrail.""" - - guardrail_version: str | None = None - """The version of the guardrail.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.guardrail_identifier is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_CONFIGURATION.members["guardrailIdentifier"], - self.guardrail_identifier, - ) - - if self.guardrail_version is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_CONFIGURATION.members["guardrailVersion"], - self.guardrail_version, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["guardrail_identifier"] = de.read_string( - _SCHEMA_GUARDRAIL_CONFIGURATION.members["guardrailIdentifier"] - ) - - case 1: - kwargs["guardrail_version"] = de.read_string( - _SCHEMA_GUARDRAIL_CONFIGURATION.members["guardrailVersion"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GUARDRAIL_CONFIGURATION, consumer=_consumer) - return kwargs - - -class MemoryType(UnknownEnumMixin, StrEnum): - SESSION_SUMMARY = "SESSION_SUMMARY" - - -def _serialize_enabled_memory_types( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_enabled_memory_types( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(MemoryType(d.read_string(member_schema))) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class SessionSummaryConfiguration: - """Configuration for SESSION_SUMMARY memory type enabled for the agent.""" - - max_recent_sessions: int | None = None - """ - Maximum number of recent session summaries to include in the agent's - prompt context. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SESSION_SUMMARY_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.max_recent_sessions is not None: - serializer.write_integer( - _SCHEMA_SESSION_SUMMARY_CONFIGURATION.members["maxRecentSessions"], - self.max_recent_sessions, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["max_recent_sessions"] = de.read_integer( - _SCHEMA_SESSION_SUMMARY_CONFIGURATION.members[ - "maxRecentSessions" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SESSION_SUMMARY_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class MemoryConfiguration: - """Details of the memory configuration.""" - - enabled_memory_types: list[str] - """The type of memory that is stored.""" - - storage_days: int = 30 - """ - The number of days the agent is configured to retain the conversational - context. - """ - - session_summary_configuration: SessionSummaryConfiguration | None = None - """ - Contains the configuration for SESSION_SUMMARY memory type enabled for - the agent. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEMORY_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_enabled_memory_types( - serializer, - _SCHEMA_MEMORY_CONFIGURATION.members["enabledMemoryTypes"], - self.enabled_memory_types, - ) - serializer.write_integer( - _SCHEMA_MEMORY_CONFIGURATION.members["storageDays"], self.storage_days - ) - if self.session_summary_configuration is not None: - serializer.write_struct( - _SCHEMA_MEMORY_CONFIGURATION.members["sessionSummaryConfiguration"], - self.session_summary_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["enabled_memory_types"] = _deserialize_enabled_memory_types( - de, _SCHEMA_MEMORY_CONFIGURATION.members["enabledMemoryTypes"] - ) - - case 1: - kwargs["storage_days"] = de.read_integer( - _SCHEMA_MEMORY_CONFIGURATION.members["storageDays"] - ) - - case 2: - kwargs["session_summary_configuration"] = ( - SessionSummaryConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MEMORY_CONFIGURATION, consumer=_consumer) - if "enabled_memory_types" not in kwargs: - kwargs["enabled_memory_types"] = [] - return kwargs - - -class OrchestrationType(UnknownEnumMixin, StrEnum): - DEFAULT = "DEFAULT" - CUSTOM_ORCHESTRATION = "CUSTOM_ORCHESTRATION" - - -def _serialize_stop_sequences( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_stop_sequences( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class InferenceConfiguration: - """ - Contains inference parameters to use when the agent invokes a foundation - model in the part of the agent sequence defined by the `promptType`. For - more information, see [Inference parameters for foundation - models](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). - """ - - temperature: float | None = None - """ - The likelihood of the model selecting higher-probability options while - generating a response. A lower value makes the model more likely to - choose higher-probability options, while a higher value makes the model - more likely to choose lower-probability options. - """ - - top_p: float | None = None - """ - While generating a response, the model determines the probability of the - following token at each point of generation. The value that you set for - `Top P` determines the number of most-likely candidates from which the - model chooses the next token in the sequence. For example, if you set - `topP` to 0.8, the model only selects the next token from the top 80% of - the probability distribution of next tokens. - """ - - top_k: int | None = None - """ - While generating a response, the model determines the probability of the - following token at each point of generation. The value that you set for - `topK` is the number of most-likely candidates from which the model - chooses the next token in the sequence. For example, if you set `topK` - to 50, the model selects the next token from among the top 50 most - likely choices. - """ - - maximum_length: int | None = None - """The maximum number of tokens to allow in the generated response.""" - - stop_sequences: list[str] | None = None - """ - A list of stop sequences. A stop sequence is a sequence of characters - that causes the model to stop generating the response. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INFERENCE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.temperature is not None: - serializer.write_float( - _SCHEMA_INFERENCE_CONFIGURATION.members["temperature"], self.temperature - ) - - if self.top_p is not None: - serializer.write_float( - _SCHEMA_INFERENCE_CONFIGURATION.members["topP"], self.top_p - ) - - if self.top_k is not None: - serializer.write_integer( - _SCHEMA_INFERENCE_CONFIGURATION.members["topK"], self.top_k - ) - - if self.maximum_length is not None: - serializer.write_integer( - _SCHEMA_INFERENCE_CONFIGURATION.members["maximumLength"], - self.maximum_length, - ) - - if self.stop_sequences is not None: - _serialize_stop_sequences( - serializer, - _SCHEMA_INFERENCE_CONFIGURATION.members["stopSequences"], - self.stop_sequences, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["temperature"] = de.read_float( - _SCHEMA_INFERENCE_CONFIGURATION.members["temperature"] - ) - - case 1: - kwargs["top_p"] = de.read_float( - _SCHEMA_INFERENCE_CONFIGURATION.members["topP"] - ) - - case 2: - kwargs["top_k"] = de.read_integer( - _SCHEMA_INFERENCE_CONFIGURATION.members["topK"] - ) - - case 3: - kwargs["maximum_length"] = de.read_integer( - _SCHEMA_INFERENCE_CONFIGURATION.members["maximumLength"] - ) - - case 4: - kwargs["stop_sequences"] = _deserialize_stop_sequences( - de, _SCHEMA_INFERENCE_CONFIGURATION.members["stopSequences"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INFERENCE_CONFIGURATION, consumer=_consumer) - return kwargs - - -class CreationMode(UnknownEnumMixin, StrEnum): - DEFAULT = "DEFAULT" - OVERRIDDEN = "OVERRIDDEN" - - -class PromptState(UnknownEnumMixin, StrEnum): - ENABLED = "ENABLED" - DISABLED = "DISABLED" - - -class PromptType(UnknownEnumMixin, StrEnum): - PRE_PROCESSING = "PRE_PROCESSING" - ORCHESTRATION = "ORCHESTRATION" - POST_PROCESSING = "POST_PROCESSING" - KNOWLEDGE_BASE_RESPONSE_GENERATION = "KNOWLEDGE_BASE_RESPONSE_GENERATION" - MEMORY_SUMMARIZATION = "MEMORY_SUMMARIZATION" - - -@dataclass(kw_only=True) -class PromptConfiguration: - """ - Contains configurations to override a prompt template in one part of an - agent sequence. For more information, see [Advanced - prompts](https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts.html). - """ - - prompt_type: str | None = None - """ - The step in the agent sequence that this prompt configuration applies - to. - """ - - prompt_creation_mode: str | None = None - """ - Specifies whether to override the default prompt template for this - `promptType`. Set this value to `OVERRIDDEN` to use the prompt that you - provide in the `basePromptTemplate`. If you leave it as `DEFAULT`, the - agent uses a default prompt template. - """ - - prompt_state: str | None = None - """ - Specifies whether to allow the agent to carry out the step specified in - the `promptType`. If you set this value to `DISABLED`, the agent skips - that step. The default state for each `promptType` is as follows. - - - `PRE_PROCESSING` -- `DISABLED` - - - `ORCHESTRATION` -- `ENABLED` - - - `KNOWLEDGE_BASE_RESPONSE_GENERATION` -- `ENABLED` - - - `POST_PROCESSING` -- `DISABLED` - """ - - base_prompt_template: str | None = field(repr=False, default=None) - """ - Defines the prompt template with which to replace the default prompt - template. You can use placeholder variables in the base prompt template - to customize the prompt. For more information, see [Prompt template - placeholder - variables](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-placeholders.html). - For more information, see [Configure the prompt - templates](https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts-configure.html). - """ - - inference_configuration: InferenceConfiguration | None = None - """ - Contains inference parameters to use when the agent invokes a foundation - model in the part of the agent sequence defined by the `promptType`. For - more information, see [Inference parameters for foundation - models](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). - """ - - parser_mode: str | None = None - """ - Specifies whether to override the default parser Lambda function when - parsing the raw foundation model output in the part of the agent - sequence defined by the `promptType`. If you set the field as - `OVERRIDDEN`, the `overrideLambda` field in the - [PromptOverrideConfiguration](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptOverrideConfiguration.html) - must be specified with the ARN of a Lambda function. - """ - - foundation_model: str | None = None - """The agent's foundation model.""" - - additional_model_request_fields: Document | None = None - """ - If the Converse or ConverseStream operations support the model, - `additionalModelRequestFields` contains additional inference parameters, - beyond the base set of inference parameters in the - `inferenceConfiguration` field. - - For more information, see *Inference request parameters and response - fields for foundation models* in the Amazon Bedrock user guide. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PROMPT_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.prompt_type is not None: - serializer.write_string( - _SCHEMA_PROMPT_CONFIGURATION.members["promptType"], self.prompt_type - ) - - if self.prompt_creation_mode is not None: - serializer.write_string( - _SCHEMA_PROMPT_CONFIGURATION.members["promptCreationMode"], - self.prompt_creation_mode, - ) - - if self.prompt_state is not None: - serializer.write_string( - _SCHEMA_PROMPT_CONFIGURATION.members["promptState"], self.prompt_state - ) - - if self.base_prompt_template is not None: - serializer.write_string( - _SCHEMA_PROMPT_CONFIGURATION.members["basePromptTemplate"], - self.base_prompt_template, - ) - - if self.inference_configuration is not None: - serializer.write_struct( - _SCHEMA_PROMPT_CONFIGURATION.members["inferenceConfiguration"], - self.inference_configuration, - ) - - if self.parser_mode is not None: - serializer.write_string( - _SCHEMA_PROMPT_CONFIGURATION.members["parserMode"], self.parser_mode - ) - - if self.foundation_model is not None: - serializer.write_string( - _SCHEMA_PROMPT_CONFIGURATION.members["foundationModel"], - self.foundation_model, - ) - - if self.additional_model_request_fields is not None: - serializer.write_document( - _SCHEMA_PROMPT_CONFIGURATION.members["additionalModelRequestFields"], - self.additional_model_request_fields, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["prompt_type"] = PromptType( - de.read_string( - _SCHEMA_PROMPT_CONFIGURATION.members["promptType"] - ) - ) - - case 1: - kwargs["prompt_creation_mode"] = CreationMode( - de.read_string( - _SCHEMA_PROMPT_CONFIGURATION.members["promptCreationMode"] - ) - ) - - case 2: - kwargs["prompt_state"] = PromptState( - de.read_string( - _SCHEMA_PROMPT_CONFIGURATION.members["promptState"] - ) - ) - - case 3: - kwargs["base_prompt_template"] = de.read_string( - _SCHEMA_PROMPT_CONFIGURATION.members["basePromptTemplate"] - ) - - case 4: - kwargs["inference_configuration"] = ( - InferenceConfiguration.deserialize(de) - ) - - case 5: - kwargs["parser_mode"] = CreationMode( - de.read_string( - _SCHEMA_PROMPT_CONFIGURATION.members["parserMode"] - ) - ) - - case 6: - kwargs["foundation_model"] = de.read_string( - _SCHEMA_PROMPT_CONFIGURATION.members["foundationModel"] - ) - - case 7: - kwargs["additional_model_request_fields"] = de.read_document( - _SCHEMA_PROMPT_CONFIGURATION.members[ - "additionalModelRequestFields" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PROMPT_CONFIGURATION, consumer=_consumer) - return kwargs - - -def _serialize_prompt_configurations( - serializer: ShapeSerializer, schema: Schema, value: list[PromptConfiguration] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_prompt_configurations( - deserializer: ShapeDeserializer, schema: Schema -) -> list[PromptConfiguration]: - result: list[PromptConfiguration] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(PromptConfiguration.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class PromptOverrideConfiguration: - """ - Contains configurations to override prompts in different parts of an - agent sequence. For more information, see [Advanced - prompts](https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts.html). - """ - - prompt_configurations: list[PromptConfiguration] - """ - Contains configurations to override a prompt template in one part of an - agent sequence. For more information, see [Advanced - prompts](https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts.html). - """ - - override_lambda: str | None = None - """ - The ARN of the Lambda function to use when parsing the raw foundation - model output in parts of the agent sequence. If you specify this field, - at least one of the `promptConfigurations` must contain a `parserMode` - value that is set to `OVERRIDDEN`. For more information, see [Parser - Lambda function in Amazon Bedrock - Agents](https://docs.aws.amazon.com/bedrock/latest/userguide/lambda-parser.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PROMPT_OVERRIDE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_prompt_configurations( - serializer, - _SCHEMA_PROMPT_OVERRIDE_CONFIGURATION.members["promptConfigurations"], - self.prompt_configurations, - ) - if self.override_lambda is not None: - serializer.write_string( - _SCHEMA_PROMPT_OVERRIDE_CONFIGURATION.members["overrideLambda"], - self.override_lambda, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["prompt_configurations"] = ( - _deserialize_prompt_configurations( - de, - _SCHEMA_PROMPT_OVERRIDE_CONFIGURATION.members[ - "promptConfigurations" - ], - ) - ) - - case 1: - kwargs["override_lambda"] = de.read_string( - _SCHEMA_PROMPT_OVERRIDE_CONFIGURATION.members["overrideLambda"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PROMPT_OVERRIDE_CONFIGURATION, consumer=_consumer - ) - if "prompt_configurations" not in kwargs: - kwargs["prompt_configurations"] = [] - return kwargs - - -def _serialize_recommended_actions( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_recommended_actions( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class Agent: - """Contains details about an agent.""" - - agent_id: str - """The unique identifier of the agent.""" - - agent_name: str - """The name of the agent.""" - - agent_arn: str - """The Amazon Resource Name (ARN) of the agent.""" - - agent_version: str - """The version of the agent.""" - - agent_status: str - """ - The status of the agent and whether it is ready for use. The following - statuses are possible: - - - CREATING -- The agent is being created. - - - PREPARING -- The agent is being prepared. - - - PREPARED -- The agent is prepared and ready to be invoked. - - - NOT_PREPARED -- The agent has been created but not yet prepared. - - - FAILED -- The agent API operation failed. - - - UPDATING -- The agent is being updated. - - - DELETING -- The agent is being deleted. - """ - - idle_session_ttl_in_seconds: int - """ - The number of seconds for which Amazon Bedrock keeps information about a - user's conversation with the agent. - - A user interaction remains active for the amount of time specified. If - no conversation occurs during this time, the session expires and Amazon - Bedrock deletes any data provided before the timeout. - """ - - agent_resource_role_arn: str - """ - The Amazon Resource Name (ARN) of the IAM role with permissions to - invoke API operations on the agent. - """ - - created_at: datetime - """The time at which the agent was created.""" - - updated_at: datetime - """The time at which the agent was last updated.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If this token matches a previous - request, Amazon Bedrock ignores the request, but does not return an - error. For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - instruction: str | None = field(repr=False, default=None) - """ - Instructions that tell the agent what it should do and how it should - interact with users. - """ - - foundation_model: str | None = None - """The foundation model used for orchestration by the agent.""" - - description: str | None = None - """The description of the agent.""" - - orchestration_type: str | None = None - """Specifies the orchestration strategy for the agent.""" - - custom_orchestration: CustomOrchestration | None = None - """Contains custom orchestration configurations for the agent.""" - - customer_encryption_key_arn: str | None = None - """The Amazon Resource Name (ARN) of the KMS key that encrypts the agent.""" - - prepared_at: datetime | None = None - """The time at which the agent was last prepared.""" - - failure_reasons: list[str] | None = None - """Contains reasons that the agent-related API that you invoked failed.""" - - recommended_actions: list[str] | None = None - """ - Contains recommended actions to take for the agent-related API that you - invoked to succeed. - """ - - prompt_override_configuration: PromptOverrideConfiguration | None = field( - repr=False, default=None - ) - """ - Contains configurations to override prompt templates in different parts - of an agent sequence. For more information, see [Advanced - prompts](https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts.html). - """ - - guardrail_configuration: GuardrailConfiguration | None = None - """Details about the guardrail associated with the agent.""" - - memory_configuration: MemoryConfiguration | None = None - """Contains memory configuration for the agent.""" - - agent_collaboration: str | None = None - """The agent's collaboration settings.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_AGENT.members["agentId"], self.agent_id) - serializer.write_string(_SCHEMA_AGENT.members["agentName"], self.agent_name) - serializer.write_string(_SCHEMA_AGENT.members["agentArn"], self.agent_arn) - serializer.write_string( - _SCHEMA_AGENT.members["agentVersion"], self.agent_version - ) - if self.client_token is not None: - serializer.write_string( - _SCHEMA_AGENT.members["clientToken"], self.client_token - ) - - if self.instruction is not None: - serializer.write_string( - _SCHEMA_AGENT.members["instruction"], self.instruction - ) - - serializer.write_string(_SCHEMA_AGENT.members["agentStatus"], self.agent_status) - if self.foundation_model is not None: - serializer.write_string( - _SCHEMA_AGENT.members["foundationModel"], self.foundation_model - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_AGENT.members["description"], self.description - ) - - if self.orchestration_type is not None: - serializer.write_string( - _SCHEMA_AGENT.members["orchestrationType"], self.orchestration_type - ) - - if self.custom_orchestration is not None: - serializer.write_struct( - _SCHEMA_AGENT.members["customOrchestration"], self.custom_orchestration - ) - - serializer.write_integer( - _SCHEMA_AGENT.members["idleSessionTTLInSeconds"], - self.idle_session_ttl_in_seconds, - ) - serializer.write_string( - _SCHEMA_AGENT.members["agentResourceRoleArn"], self.agent_resource_role_arn - ) - if self.customer_encryption_key_arn is not None: - serializer.write_string( - _SCHEMA_AGENT.members["customerEncryptionKeyArn"], - self.customer_encryption_key_arn, - ) - - serializer.write_timestamp(_SCHEMA_AGENT.members["createdAt"], self.created_at) - serializer.write_timestamp(_SCHEMA_AGENT.members["updatedAt"], self.updated_at) - if self.prepared_at is not None: - serializer.write_timestamp( - _SCHEMA_AGENT.members["preparedAt"], self.prepared_at - ) - - if self.failure_reasons is not None: - _serialize_failure_reasons( - serializer, - _SCHEMA_AGENT.members["failureReasons"], - self.failure_reasons, - ) - - if self.recommended_actions is not None: - _serialize_recommended_actions( - serializer, - _SCHEMA_AGENT.members["recommendedActions"], - self.recommended_actions, - ) - - if self.prompt_override_configuration is not None: - serializer.write_struct( - _SCHEMA_AGENT.members["promptOverrideConfiguration"], - self.prompt_override_configuration, - ) - - if self.guardrail_configuration is not None: - serializer.write_struct( - _SCHEMA_AGENT.members["guardrailConfiguration"], - self.guardrail_configuration, - ) - - if self.memory_configuration is not None: - serializer.write_struct( - _SCHEMA_AGENT.members["memoryConfiguration"], self.memory_configuration - ) - - if self.agent_collaboration is not None: - serializer.write_string( - _SCHEMA_AGENT.members["agentCollaboration"], self.agent_collaboration - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_id"] = de.read_string( - _SCHEMA_AGENT.members["agentId"] - ) - - case 1: - kwargs["agent_name"] = de.read_string( - _SCHEMA_AGENT.members["agentName"] - ) - - case 2: - kwargs["agent_arn"] = de.read_string( - _SCHEMA_AGENT.members["agentArn"] - ) - - case 3: - kwargs["agent_version"] = de.read_string( - _SCHEMA_AGENT.members["agentVersion"] - ) - - case 4: - kwargs["client_token"] = de.read_string( - _SCHEMA_AGENT.members["clientToken"] - ) - - case 5: - kwargs["instruction"] = de.read_string( - _SCHEMA_AGENT.members["instruction"] - ) - - case 6: - kwargs["agent_status"] = AgentStatus( - de.read_string(_SCHEMA_AGENT.members["agentStatus"]) - ) - - case 7: - kwargs["foundation_model"] = de.read_string( - _SCHEMA_AGENT.members["foundationModel"] - ) - - case 8: - kwargs["description"] = de.read_string( - _SCHEMA_AGENT.members["description"] - ) - - case 9: - kwargs["orchestration_type"] = OrchestrationType( - de.read_string(_SCHEMA_AGENT.members["orchestrationType"]) - ) - - case 10: - kwargs["custom_orchestration"] = CustomOrchestration.deserialize(de) - - case 11: - kwargs["idle_session_ttl_in_seconds"] = de.read_integer( - _SCHEMA_AGENT.members["idleSessionTTLInSeconds"] - ) - - case 12: - kwargs["agent_resource_role_arn"] = de.read_string( - _SCHEMA_AGENT.members["agentResourceRoleArn"] - ) - - case 13: - kwargs["customer_encryption_key_arn"] = de.read_string( - _SCHEMA_AGENT.members["customerEncryptionKeyArn"] - ) - - case 14: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_AGENT.members["createdAt"] - ) - - case 15: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_AGENT.members["updatedAt"] - ) - - case 16: - kwargs["prepared_at"] = de.read_timestamp( - _SCHEMA_AGENT.members["preparedAt"] - ) - - case 17: - kwargs["failure_reasons"] = _deserialize_failure_reasons( - de, _SCHEMA_AGENT.members["failureReasons"] - ) - - case 18: - kwargs["recommended_actions"] = _deserialize_recommended_actions( - de, _SCHEMA_AGENT.members["recommendedActions"] - ) - - case 19: - kwargs["prompt_override_configuration"] = ( - PromptOverrideConfiguration.deserialize(de) - ) - - case 20: - kwargs["guardrail_configuration"] = ( - GuardrailConfiguration.deserialize(de) - ) - - case 21: - kwargs["memory_configuration"] = MemoryConfiguration.deserialize(de) - - case 22: - kwargs["agent_collaboration"] = AgentCollaboration( - de.read_string(_SCHEMA_AGENT.members["agentCollaboration"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AGENT, consumer=_consumer) - if "agent_id" not in kwargs: - kwargs["agent_id"] = "" - if "agent_name" not in kwargs: - kwargs["agent_name"] = "" - if "agent_arn" not in kwargs: - kwargs["agent_arn"] = "" - if "agent_version" not in kwargs: - kwargs["agent_version"] = "" - if "agent_status" not in kwargs: - kwargs["agent_status"] = AgentStatus._corrected("") - if "idle_session_ttl_in_seconds" not in kwargs: - kwargs["idle_session_ttl_in_seconds"] = 0 - if "agent_resource_role_arn" not in kwargs: - kwargs["agent_resource_role_arn"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls( - agent_id="", - agent_name="", - agent_arn="", - agent_version="", - agent_status=AgentStatus._corrected(""), - idle_session_ttl_in_seconds=0, - agent_resource_role_arn="", - created_at=datetime.fromtimestamp(0, tz=timezone.utc), - updated_at=datetime.fromtimestamp(0, tz=timezone.utc), - ) - - -@dataclass(kw_only=True) -class AgentAliasRoutingConfigurationListItem: - """Contains details about the routing configuration of the alias.""" - - agent_version: str | None = None - """The version of the agent with which the alias is associated.""" - - provisioned_throughput: str | None = None - """Information on the Provisioned Throughput assigned to an agent alias.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AGENT_ALIAS_ROUTING_CONFIGURATION_LIST_ITEM, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.agent_version is not None: - serializer.write_string( - _SCHEMA_AGENT_ALIAS_ROUTING_CONFIGURATION_LIST_ITEM.members[ - "agentVersion" - ], - self.agent_version, - ) - - if self.provisioned_throughput is not None: - serializer.write_string( - _SCHEMA_AGENT_ALIAS_ROUTING_CONFIGURATION_LIST_ITEM.members[ - "provisionedThroughput" - ], - self.provisioned_throughput, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_version"] = de.read_string( - _SCHEMA_AGENT_ALIAS_ROUTING_CONFIGURATION_LIST_ITEM.members[ - "agentVersion" - ] - ) - - case 1: - kwargs["provisioned_throughput"] = de.read_string( - _SCHEMA_AGENT_ALIAS_ROUTING_CONFIGURATION_LIST_ITEM.members[ - "provisionedThroughput" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AGENT_ALIAS_ROUTING_CONFIGURATION_LIST_ITEM, consumer=_consumer - ) - return kwargs - - -def _serialize_agent_alias_routing_configuration( - serializer: ShapeSerializer, - schema: Schema, - value: list[AgentAliasRoutingConfigurationListItem], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_agent_alias_routing_configuration( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AgentAliasRoutingConfigurationListItem]: - result: list[AgentAliasRoutingConfigurationListItem] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AgentAliasRoutingConfigurationListItem.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AgentAliasHistoryEvent: - """Contains details about the history of the alias.""" - - routing_configuration: list[AgentAliasRoutingConfigurationListItem] | None = None - """ - Contains details about the version of the agent with which the alias is - associated. - """ - - end_date: datetime | None = None - """ - The date that the alias stopped being associated to the version in the - `routingConfiguration` object - """ - - start_date: datetime | None = None - """ - The date that the alias began being associated to the version in the - `routingConfiguration` object. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENT_ALIAS_HISTORY_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.routing_configuration is not None: - _serialize_agent_alias_routing_configuration( - serializer, - _SCHEMA_AGENT_ALIAS_HISTORY_EVENT.members["routingConfiguration"], - self.routing_configuration, - ) - - if self.end_date is not None: - serializer.write_timestamp( - _SCHEMA_AGENT_ALIAS_HISTORY_EVENT.members["endDate"], self.end_date - ) - - if self.start_date is not None: - serializer.write_timestamp( - _SCHEMA_AGENT_ALIAS_HISTORY_EVENT.members["startDate"], self.start_date - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["routing_configuration"] = ( - _deserialize_agent_alias_routing_configuration( - de, - _SCHEMA_AGENT_ALIAS_HISTORY_EVENT.members[ - "routingConfiguration" - ], - ) - ) - - case 1: - kwargs["end_date"] = de.read_timestamp( - _SCHEMA_AGENT_ALIAS_HISTORY_EVENT.members["endDate"] - ) - - case 2: - kwargs["start_date"] = de.read_timestamp( - _SCHEMA_AGENT_ALIAS_HISTORY_EVENT.members["startDate"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AGENT_ALIAS_HISTORY_EVENT, consumer=_consumer) - return kwargs - - -def _serialize_agent_alias_history_events( - serializer: ShapeSerializer, schema: Schema, value: list[AgentAliasHistoryEvent] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_agent_alias_history_events( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AgentAliasHistoryEvent]: - result: list[AgentAliasHistoryEvent] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AgentAliasHistoryEvent.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class AgentAliasStatus(UnknownEnumMixin, StrEnum): - CREATING = "CREATING" - PREPARED = "PREPARED" - FAILED = "FAILED" - UPDATING = "UPDATING" - DELETING = "DELETING" - DISSOCIATED = "DISSOCIATED" - - -class AliasInvocationState(UnknownEnumMixin, StrEnum): - """Enum representing the invocation state of an agent alias""" - - ACCEPT_INVOCATIONS = "ACCEPT_INVOCATIONS" - """Agent is actively processing requests""" - REJECT_INVOCATIONS = "REJECT_INVOCATIONS" - """Agent is paused and will not accept new requests""" - - -@dataclass(kw_only=True) -class AgentAlias: - """Contains details about an alias of an agent.""" - - agent_id: str - """The unique identifier of the agent.""" - - agent_alias_id: str - """The unique identifier of the alias of the agent.""" - - agent_alias_name: str - """The name of the alias of the agent.""" - - agent_alias_arn: str - """The Amazon Resource Name (ARN) of the alias of the agent.""" - - routing_configuration: list[AgentAliasRoutingConfigurationListItem] - """Contains details about the routing configuration of the alias.""" - - created_at: datetime - """The time at which the alias of the agent was created.""" - - updated_at: datetime - """The time at which the alias was last updated.""" - - agent_alias_status: str - """ - The status of the alias of the agent and whether it is ready for use. - The following statuses are possible: - - - CREATING -- The agent alias is being created. - - - PREPARED -- The agent alias is finished being created or updated and - is ready to be invoked. - - - FAILED -- The agent alias API operation failed. - - - UPDATING -- The agent alias is being updated. - - - DELETING -- The agent alias is being deleted. - - - DISSOCIATED - The agent alias has no version associated with it. - """ - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If this token matches a previous - request, Amazon Bedrock ignores the request, but does not return an - error. For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - description: str | None = None - """The description of the alias of the agent.""" - - agent_alias_history_events: list[AgentAliasHistoryEvent] | None = None - """Contains details about the history of the alias.""" - - failure_reasons: list[str] | None = None - """ - Information on the failure of Provisioned Throughput assigned to an - agent alias. - """ - - alias_invocation_state: str | None = None - """ - The invocation state for the agent alias. If the agent alias is running, - the value is `ACCEPT_INVOCATIONS`. If the agent alias is paused, the - value is `REJECT_INVOCATIONS`. Use the `UpdateAgentAlias` operation to - change the invocation state. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENT_ALIAS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_AGENT_ALIAS.members["agentId"], self.agent_id) - serializer.write_string( - _SCHEMA_AGENT_ALIAS.members["agentAliasId"], self.agent_alias_id - ) - serializer.write_string( - _SCHEMA_AGENT_ALIAS.members["agentAliasName"], self.agent_alias_name - ) - serializer.write_string( - _SCHEMA_AGENT_ALIAS.members["agentAliasArn"], self.agent_alias_arn - ) - if self.client_token is not None: - serializer.write_string( - _SCHEMA_AGENT_ALIAS.members["clientToken"], self.client_token - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_AGENT_ALIAS.members["description"], self.description - ) - - _serialize_agent_alias_routing_configuration( - serializer, - _SCHEMA_AGENT_ALIAS.members["routingConfiguration"], - self.routing_configuration, - ) - serializer.write_timestamp( - _SCHEMA_AGENT_ALIAS.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_AGENT_ALIAS.members["updatedAt"], self.updated_at - ) - if self.agent_alias_history_events is not None: - _serialize_agent_alias_history_events( - serializer, - _SCHEMA_AGENT_ALIAS.members["agentAliasHistoryEvents"], - self.agent_alias_history_events, - ) - - serializer.write_string( - _SCHEMA_AGENT_ALIAS.members["agentAliasStatus"], self.agent_alias_status - ) - if self.failure_reasons is not None: - _serialize_failure_reasons( - serializer, - _SCHEMA_AGENT_ALIAS.members["failureReasons"], - self.failure_reasons, - ) - - if self.alias_invocation_state is not None: - serializer.write_string( - _SCHEMA_AGENT_ALIAS.members["aliasInvocationState"], - self.alias_invocation_state, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_id"] = de.read_string( - _SCHEMA_AGENT_ALIAS.members["agentId"] - ) - - case 1: - kwargs["agent_alias_id"] = de.read_string( - _SCHEMA_AGENT_ALIAS.members["agentAliasId"] - ) - - case 2: - kwargs["agent_alias_name"] = de.read_string( - _SCHEMA_AGENT_ALIAS.members["agentAliasName"] - ) - - case 3: - kwargs["agent_alias_arn"] = de.read_string( - _SCHEMA_AGENT_ALIAS.members["agentAliasArn"] - ) - - case 4: - kwargs["client_token"] = de.read_string( - _SCHEMA_AGENT_ALIAS.members["clientToken"] - ) - - case 5: - kwargs["description"] = de.read_string( - _SCHEMA_AGENT_ALIAS.members["description"] - ) - - case 6: - kwargs["routing_configuration"] = ( - _deserialize_agent_alias_routing_configuration( - de, _SCHEMA_AGENT_ALIAS.members["routingConfiguration"] - ) - ) - - case 7: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_AGENT_ALIAS.members["createdAt"] - ) - - case 8: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_AGENT_ALIAS.members["updatedAt"] - ) - - case 9: - kwargs["agent_alias_history_events"] = ( - _deserialize_agent_alias_history_events( - de, _SCHEMA_AGENT_ALIAS.members["agentAliasHistoryEvents"] - ) - ) - - case 10: - kwargs["agent_alias_status"] = AgentAliasStatus( - de.read_string(_SCHEMA_AGENT_ALIAS.members["agentAliasStatus"]) - ) - - case 11: - kwargs["failure_reasons"] = _deserialize_failure_reasons( - de, _SCHEMA_AGENT_ALIAS.members["failureReasons"] - ) - - case 12: - kwargs["alias_invocation_state"] = AliasInvocationState( - de.read_string( - _SCHEMA_AGENT_ALIAS.members["aliasInvocationState"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AGENT_ALIAS, consumer=_consumer) - if "agent_id" not in kwargs: - kwargs["agent_id"] = "" - if "agent_alias_id" not in kwargs: - kwargs["agent_alias_id"] = "" - if "agent_alias_name" not in kwargs: - kwargs["agent_alias_name"] = "" - if "agent_alias_arn" not in kwargs: - kwargs["agent_alias_arn"] = "" - if "routing_configuration" not in kwargs: - kwargs["routing_configuration"] = [] - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "agent_alias_status" not in kwargs: - kwargs["agent_alias_status"] = AgentAliasStatus._corrected("") - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls( - agent_id="", - agent_alias_id="", - agent_alias_name="", - agent_alias_arn="", - routing_configuration=[], - created_at=datetime.fromtimestamp(0, tz=timezone.utc), - updated_at=datetime.fromtimestamp(0, tz=timezone.utc), - agent_alias_status=AgentAliasStatus._corrected(""), - ) - - -@dataclass(kw_only=True) -class AgentAliasSummary: - """Contains details about an alias of an agent.""" - - agent_alias_id: str - """Contains details about""" - - agent_alias_name: str - """The name of the alias.""" - - agent_alias_status: str - """The status of the alias.""" - - created_at: datetime - """The time at which the alias of the agent was created.""" - - updated_at: datetime - """The time at which the alias was last updated.""" - - description: str | None = None - """The description of the alias.""" - - routing_configuration: list[AgentAliasRoutingConfigurationListItem] | None = None - """ - Contains details about the version of the agent with which the alias is - associated. - """ - - alias_invocation_state: str | None = None - """ - The invocation state for the agent alias. If the agent alias is running, - the value is `ACCEPT_INVOCATIONS`. If the agent alias is paused, the - value is `REJECT_INVOCATIONS`. Use the `UpdateAgentAlias` operation to - change the invocation state. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENT_ALIAS_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AGENT_ALIAS_SUMMARY.members["agentAliasId"], self.agent_alias_id - ) - serializer.write_string( - _SCHEMA_AGENT_ALIAS_SUMMARY.members["agentAliasName"], self.agent_alias_name - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_AGENT_ALIAS_SUMMARY.members["description"], self.description - ) - - if self.routing_configuration is not None: - _serialize_agent_alias_routing_configuration( - serializer, - _SCHEMA_AGENT_ALIAS_SUMMARY.members["routingConfiguration"], - self.routing_configuration, - ) - - serializer.write_string( - _SCHEMA_AGENT_ALIAS_SUMMARY.members["agentAliasStatus"], - self.agent_alias_status, - ) - serializer.write_timestamp( - _SCHEMA_AGENT_ALIAS_SUMMARY.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_AGENT_ALIAS_SUMMARY.members["updatedAt"], self.updated_at - ) - if self.alias_invocation_state is not None: - serializer.write_string( - _SCHEMA_AGENT_ALIAS_SUMMARY.members["aliasInvocationState"], - self.alias_invocation_state, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_alias_id"] = de.read_string( - _SCHEMA_AGENT_ALIAS_SUMMARY.members["agentAliasId"] - ) - - case 1: - kwargs["agent_alias_name"] = de.read_string( - _SCHEMA_AGENT_ALIAS_SUMMARY.members["agentAliasName"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_AGENT_ALIAS_SUMMARY.members["description"] - ) - - case 3: - kwargs["routing_configuration"] = ( - _deserialize_agent_alias_routing_configuration( - de, - _SCHEMA_AGENT_ALIAS_SUMMARY.members["routingConfiguration"], - ) - ) - - case 4: - kwargs["agent_alias_status"] = AgentAliasStatus( - de.read_string( - _SCHEMA_AGENT_ALIAS_SUMMARY.members["agentAliasStatus"] - ) - ) - - case 5: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_AGENT_ALIAS_SUMMARY.members["createdAt"] - ) - - case 6: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_AGENT_ALIAS_SUMMARY.members["updatedAt"] - ) - - case 7: - kwargs["alias_invocation_state"] = AliasInvocationState( - de.read_string( - _SCHEMA_AGENT_ALIAS_SUMMARY.members["aliasInvocationState"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AGENT_ALIAS_SUMMARY, consumer=_consumer) - if "agent_alias_id" not in kwargs: - kwargs["agent_alias_id"] = "" - if "agent_alias_name" not in kwargs: - kwargs["agent_alias_name"] = "" - if "agent_alias_status" not in kwargs: - kwargs["agent_alias_status"] = AgentAliasStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_agent_alias_summaries( - serializer: ShapeSerializer, schema: Schema, value: list[AgentAliasSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_agent_alias_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AgentAliasSummary]: - result: list[AgentAliasSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AgentAliasSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AgentDescriptor: - """An agent descriptor.""" - - alias_arn: str | None = None - """The agent's alias ARN.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENT_DESCRIPTOR, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.alias_arn is not None: - serializer.write_string( - _SCHEMA_AGENT_DESCRIPTOR.members["aliasArn"], self.alias_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["alias_arn"] = de.read_string( - _SCHEMA_AGENT_DESCRIPTOR.members["aliasArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AGENT_DESCRIPTOR, consumer=_consumer) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls() - - -class RelayConversationHistory(UnknownEnumMixin, StrEnum): - TO_COLLABORATOR = "TO_COLLABORATOR" - DISABLED = "DISABLED" - - -@dataclass(kw_only=True) -class AgentCollaborator: - """An agent collaborator.""" - - agent_id: str - """The collaborator's agent ID.""" - - agent_version: str - """The collaborator's agent version.""" - - agent_descriptor: AgentDescriptor - """The collaborator's agent descriptor.""" - - collaborator_id: str - """The collaborator's collaborator ID.""" - - collaboration_instruction: str = field(repr=False) - """The collaborator's instructions.""" - - collaborator_name: str - """The collaborator's collaborator name.""" - - created_at: datetime - """When the collaborator was created.""" - - last_updated_at: datetime - """When the collaborator was updated.""" - - relay_conversation_history: str | None = None - """The collaborator's relay conversation history.""" - - client_token: str | None = None - """The collaborator's client token.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENT_COLLABORATOR, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AGENT_COLLABORATOR.members["agentId"], self.agent_id - ) - serializer.write_string( - _SCHEMA_AGENT_COLLABORATOR.members["agentVersion"], self.agent_version - ) - serializer.write_struct( - _SCHEMA_AGENT_COLLABORATOR.members["agentDescriptor"], self.agent_descriptor - ) - serializer.write_string( - _SCHEMA_AGENT_COLLABORATOR.members["collaboratorId"], self.collaborator_id - ) - serializer.write_string( - _SCHEMA_AGENT_COLLABORATOR.members["collaborationInstruction"], - self.collaboration_instruction, - ) - serializer.write_string( - _SCHEMA_AGENT_COLLABORATOR.members["collaboratorName"], - self.collaborator_name, - ) - serializer.write_timestamp( - _SCHEMA_AGENT_COLLABORATOR.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_AGENT_COLLABORATOR.members["lastUpdatedAt"], self.last_updated_at - ) - if self.relay_conversation_history is not None: - serializer.write_string( - _SCHEMA_AGENT_COLLABORATOR.members["relayConversationHistory"], - self.relay_conversation_history, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_AGENT_COLLABORATOR.members["clientToken"], self.client_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_id"] = de.read_string( - _SCHEMA_AGENT_COLLABORATOR.members["agentId"] - ) - - case 1: - kwargs["agent_version"] = de.read_string( - _SCHEMA_AGENT_COLLABORATOR.members["agentVersion"] - ) - - case 2: - kwargs["agent_descriptor"] = AgentDescriptor.deserialize(de) - - case 3: - kwargs["collaborator_id"] = de.read_string( - _SCHEMA_AGENT_COLLABORATOR.members["collaboratorId"] - ) - - case 4: - kwargs["collaboration_instruction"] = de.read_string( - _SCHEMA_AGENT_COLLABORATOR.members["collaborationInstruction"] - ) - - case 5: - kwargs["collaborator_name"] = de.read_string( - _SCHEMA_AGENT_COLLABORATOR.members["collaboratorName"] - ) - - case 6: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_AGENT_COLLABORATOR.members["createdAt"] - ) - - case 7: - kwargs["last_updated_at"] = de.read_timestamp( - _SCHEMA_AGENT_COLLABORATOR.members["lastUpdatedAt"] - ) - - case 8: - kwargs["relay_conversation_history"] = RelayConversationHistory( - de.read_string( - _SCHEMA_AGENT_COLLABORATOR.members[ - "relayConversationHistory" - ] - ) - ) - - case 9: - kwargs["client_token"] = de.read_string( - _SCHEMA_AGENT_COLLABORATOR.members["clientToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AGENT_COLLABORATOR, consumer=_consumer) - if "agent_id" not in kwargs: - kwargs["agent_id"] = "" - if "agent_version" not in kwargs: - kwargs["agent_version"] = "" - if "agent_descriptor" not in kwargs: - kwargs["agent_descriptor"] = AgentDescriptor._smithy_default() - if "collaborator_id" not in kwargs: - kwargs["collaborator_id"] = "" - if "collaboration_instruction" not in kwargs: - kwargs["collaboration_instruction"] = "" - if "collaborator_name" not in kwargs: - kwargs["collaborator_name"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "last_updated_at" not in kwargs: - kwargs["last_updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls( - agent_id="", - agent_version="", - agent_descriptor=AgentDescriptor._smithy_default(), - collaborator_id="", - collaboration_instruction="", - collaborator_name="", - created_at=datetime.fromtimestamp(0, tz=timezone.utc), - last_updated_at=datetime.fromtimestamp(0, tz=timezone.utc), - ) - - -@dataclass(kw_only=True) -class AssociateAgentCollaboratorInput: - """Dataclass for AssociateAgentCollaboratorInput structure.""" - - agent_id: str | None = None - """The agent's ID.""" - - agent_version: str | None = None - """An agent version.""" - - agent_descriptor: AgentDescriptor | None = None - """The alias of the collaborator agent.""" - - collaborator_name: str | None = None - """A name for the collaborator.""" - - collaboration_instruction: str | None = field(repr=False, default=None) - """Instruction for the collaborator.""" - - relay_conversation_history: str | None = None - """A relay conversation history for the collaborator.""" - - client_token: str | None = None - """A client token.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ASSOCIATE_AGENT_COLLABORATOR_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.agent_id is not None: - serializer.write_string( - _SCHEMA_ASSOCIATE_AGENT_COLLABORATOR_INPUT.members["agentId"], - self.agent_id, - ) - - if self.agent_version is not None: - serializer.write_string( - _SCHEMA_ASSOCIATE_AGENT_COLLABORATOR_INPUT.members["agentVersion"], - self.agent_version, - ) - - if self.agent_descriptor is not None: - serializer.write_struct( - _SCHEMA_ASSOCIATE_AGENT_COLLABORATOR_INPUT.members["agentDescriptor"], - self.agent_descriptor, - ) - - if self.collaborator_name is not None: - serializer.write_string( - _SCHEMA_ASSOCIATE_AGENT_COLLABORATOR_INPUT.members["collaboratorName"], - self.collaborator_name, - ) - - if self.collaboration_instruction is not None: - serializer.write_string( - _SCHEMA_ASSOCIATE_AGENT_COLLABORATOR_INPUT.members[ - "collaborationInstruction" - ], - self.collaboration_instruction, - ) - - if self.relay_conversation_history is not None: - serializer.write_string( - _SCHEMA_ASSOCIATE_AGENT_COLLABORATOR_INPUT.members[ - "relayConversationHistory" - ], - self.relay_conversation_history, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_ASSOCIATE_AGENT_COLLABORATOR_INPUT.members["clientToken"], - self.client_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_id"] = de.read_string( - _SCHEMA_ASSOCIATE_AGENT_COLLABORATOR_INPUT.members["agentId"] - ) - - case 1: - kwargs["agent_version"] = de.read_string( - _SCHEMA_ASSOCIATE_AGENT_COLLABORATOR_INPUT.members[ - "agentVersion" - ] - ) - - case 2: - kwargs["agent_descriptor"] = AgentDescriptor.deserialize(de) - - case 3: - kwargs["collaborator_name"] = de.read_string( - _SCHEMA_ASSOCIATE_AGENT_COLLABORATOR_INPUT.members[ - "collaboratorName" - ] - ) - - case 4: - kwargs["collaboration_instruction"] = de.read_string( - _SCHEMA_ASSOCIATE_AGENT_COLLABORATOR_INPUT.members[ - "collaborationInstruction" - ] - ) - - case 5: - kwargs["relay_conversation_history"] = RelayConversationHistory( - de.read_string( - _SCHEMA_ASSOCIATE_AGENT_COLLABORATOR_INPUT.members[ - "relayConversationHistory" - ] - ) - ) - - case 6: - kwargs["client_token"] = de.read_string( - _SCHEMA_ASSOCIATE_AGENT_COLLABORATOR_INPUT.members[ - "clientToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ASSOCIATE_AGENT_COLLABORATOR_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class AssociateAgentCollaboratorOutput: - """Dataclass for AssociateAgentCollaboratorOutput structure.""" - - agent_collaborator: AgentCollaborator - """Details about the collaborator.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ASSOCIATE_AGENT_COLLABORATOR_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_ASSOCIATE_AGENT_COLLABORATOR_OUTPUT.members["agentCollaborator"], - self.agent_collaborator, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_collaborator"] = AgentCollaborator.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ASSOCIATE_AGENT_COLLABORATOR_OUTPUT, consumer=_consumer - ) - if "agent_collaborator" not in kwargs: - kwargs["agent_collaborator"] = AgentCollaborator._smithy_default() - return kwargs - - -ASSOCIATE_AGENT_COLLABORATOR = APIOperation( - input=AssociateAgentCollaboratorInput, - output=AssociateAgentCollaboratorOutput, - schema=_SCHEMA_ASSOCIATE_AGENT_COLLABORATOR, - input_schema=_SCHEMA_ASSOCIATE_AGENT_COLLABORATOR_INPUT, - output_schema=_SCHEMA_ASSOCIATE_AGENT_COLLABORATOR_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrockagent#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DisassociateAgentCollaboratorInput: - """Dataclass for DisassociateAgentCollaboratorInput structure.""" - - agent_id: str | None = None - """An agent ID.""" - - agent_version: str | None = None - """The agent's version.""" - - collaborator_id: str | None = None - """The collaborator's ID.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DISASSOCIATE_AGENT_COLLABORATOR_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.agent_id is not None: - serializer.write_string( - _SCHEMA_DISASSOCIATE_AGENT_COLLABORATOR_INPUT.members["agentId"], - self.agent_id, - ) - - if self.agent_version is not None: - serializer.write_string( - _SCHEMA_DISASSOCIATE_AGENT_COLLABORATOR_INPUT.members["agentVersion"], - self.agent_version, - ) - - if self.collaborator_id is not None: - serializer.write_string( - _SCHEMA_DISASSOCIATE_AGENT_COLLABORATOR_INPUT.members["collaboratorId"], - self.collaborator_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_id"] = de.read_string( - _SCHEMA_DISASSOCIATE_AGENT_COLLABORATOR_INPUT.members["agentId"] - ) - - case 1: - kwargs["agent_version"] = de.read_string( - _SCHEMA_DISASSOCIATE_AGENT_COLLABORATOR_INPUT.members[ - "agentVersion" - ] - ) - - case 2: - kwargs["collaborator_id"] = de.read_string( - _SCHEMA_DISASSOCIATE_AGENT_COLLABORATOR_INPUT.members[ - "collaboratorId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DISASSOCIATE_AGENT_COLLABORATOR_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DisassociateAgentCollaboratorOutput: - """Dataclass for DisassociateAgentCollaboratorOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DISASSOCIATE_AGENT_COLLABORATOR_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DISASSOCIATE_AGENT_COLLABORATOR_OUTPUT, consumer=_consumer - ) - return kwargs - - -DISASSOCIATE_AGENT_COLLABORATOR = APIOperation( - input=DisassociateAgentCollaboratorInput, - output=DisassociateAgentCollaboratorOutput, - schema=_SCHEMA_DISASSOCIATE_AGENT_COLLABORATOR, - input_schema=_SCHEMA_DISASSOCIATE_AGENT_COLLABORATOR_INPUT, - output_schema=_SCHEMA_DISASSOCIATE_AGENT_COLLABORATOR_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrockagent#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetAgentCollaboratorInput: - """Dataclass for GetAgentCollaboratorInput structure.""" - - agent_id: str | None = None - """The agent's ID.""" - - agent_version: str | None = None - """The agent's version.""" - - collaborator_id: str | None = None - """The collaborator's ID.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_AGENT_COLLABORATOR_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.agent_id is not None: - serializer.write_string( - _SCHEMA_GET_AGENT_COLLABORATOR_INPUT.members["agentId"], self.agent_id - ) - - if self.agent_version is not None: - serializer.write_string( - _SCHEMA_GET_AGENT_COLLABORATOR_INPUT.members["agentVersion"], - self.agent_version, - ) - - if self.collaborator_id is not None: - serializer.write_string( - _SCHEMA_GET_AGENT_COLLABORATOR_INPUT.members["collaboratorId"], - self.collaborator_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_id"] = de.read_string( - _SCHEMA_GET_AGENT_COLLABORATOR_INPUT.members["agentId"] - ) - - case 1: - kwargs["agent_version"] = de.read_string( - _SCHEMA_GET_AGENT_COLLABORATOR_INPUT.members["agentVersion"] - ) - - case 2: - kwargs["collaborator_id"] = de.read_string( - _SCHEMA_GET_AGENT_COLLABORATOR_INPUT.members["collaboratorId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_AGENT_COLLABORATOR_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetAgentCollaboratorOutput: - """Dataclass for GetAgentCollaboratorOutput structure.""" - - agent_collaborator: AgentCollaborator - """Details about the collaborator.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_AGENT_COLLABORATOR_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_AGENT_COLLABORATOR_OUTPUT.members["agentCollaborator"], - self.agent_collaborator, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_collaborator"] = AgentCollaborator.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_AGENT_COLLABORATOR_OUTPUT, consumer=_consumer - ) - if "agent_collaborator" not in kwargs: - kwargs["agent_collaborator"] = AgentCollaborator._smithy_default() - return kwargs - - -GET_AGENT_COLLABORATOR = APIOperation( - input=GetAgentCollaboratorInput, - output=GetAgentCollaboratorOutput, - schema=_SCHEMA_GET_AGENT_COLLABORATOR, - input_schema=_SCHEMA_GET_AGENT_COLLABORATOR_INPUT, - output_schema=_SCHEMA_GET_AGENT_COLLABORATOR_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListAgentCollaboratorsInput: - """Dataclass for ListAgentCollaboratorsInput structure.""" - - agent_id: str | None = None - """The agent's ID.""" - - agent_version: str | None = None - """The agent's version.""" - - max_results: int | None = None - """ - The maximum number of agent collaborators to return in one page of - results. - """ - - next_token: str | None = None - """ - Specify the pagination token from a previous request to retrieve the - next page of results. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_AGENT_COLLABORATORS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.agent_id is not None: - serializer.write_string( - _SCHEMA_LIST_AGENT_COLLABORATORS_INPUT.members["agentId"], self.agent_id - ) - - if self.agent_version is not None: - serializer.write_string( - _SCHEMA_LIST_AGENT_COLLABORATORS_INPUT.members["agentVersion"], - self.agent_version, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_AGENT_COLLABORATORS_INPUT.members["maxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_AGENT_COLLABORATORS_INPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_id"] = de.read_string( - _SCHEMA_LIST_AGENT_COLLABORATORS_INPUT.members["agentId"] - ) - - case 1: - kwargs["agent_version"] = de.read_string( - _SCHEMA_LIST_AGENT_COLLABORATORS_INPUT.members["agentVersion"] - ) - - case 2: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_AGENT_COLLABORATORS_INPUT.members["maxResults"] - ) - - case 3: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_AGENT_COLLABORATORS_INPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_AGENT_COLLABORATORS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class AgentCollaboratorSummary: - """An agent collaborator summary.""" - - agent_id: str - """The collaborator's agent ID.""" - - agent_version: str - """The collaborator's agent version.""" - - collaborator_id: str - """The collaborator's ID.""" - - agent_descriptor: AgentDescriptor - """The collaborator's agent descriptor.""" - - collaboration_instruction: str = field(repr=False) - """The collaborator's collaboration instruction.""" - - relay_conversation_history: str - """The collaborator's relay conversation history.""" - - collaborator_name: str - """The collaborator's name.""" - - created_at: datetime - """When the collaborator was created.""" - - last_updated_at: datetime - """When the collaborator was last updated.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENT_COLLABORATOR_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AGENT_COLLABORATOR_SUMMARY.members["agentId"], self.agent_id - ) - serializer.write_string( - _SCHEMA_AGENT_COLLABORATOR_SUMMARY.members["agentVersion"], - self.agent_version, - ) - serializer.write_string( - _SCHEMA_AGENT_COLLABORATOR_SUMMARY.members["collaboratorId"], - self.collaborator_id, - ) - serializer.write_struct( - _SCHEMA_AGENT_COLLABORATOR_SUMMARY.members["agentDescriptor"], - self.agent_descriptor, - ) - serializer.write_string( - _SCHEMA_AGENT_COLLABORATOR_SUMMARY.members["collaborationInstruction"], - self.collaboration_instruction, - ) - serializer.write_string( - _SCHEMA_AGENT_COLLABORATOR_SUMMARY.members["relayConversationHistory"], - self.relay_conversation_history, - ) - serializer.write_string( - _SCHEMA_AGENT_COLLABORATOR_SUMMARY.members["collaboratorName"], - self.collaborator_name, - ) - serializer.write_timestamp( - _SCHEMA_AGENT_COLLABORATOR_SUMMARY.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_AGENT_COLLABORATOR_SUMMARY.members["lastUpdatedAt"], - self.last_updated_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_id"] = de.read_string( - _SCHEMA_AGENT_COLLABORATOR_SUMMARY.members["agentId"] - ) - - case 1: - kwargs["agent_version"] = de.read_string( - _SCHEMA_AGENT_COLLABORATOR_SUMMARY.members["agentVersion"] - ) - - case 2: - kwargs["collaborator_id"] = de.read_string( - _SCHEMA_AGENT_COLLABORATOR_SUMMARY.members["collaboratorId"] - ) - - case 3: - kwargs["agent_descriptor"] = AgentDescriptor.deserialize(de) - - case 4: - kwargs["collaboration_instruction"] = de.read_string( - _SCHEMA_AGENT_COLLABORATOR_SUMMARY.members[ - "collaborationInstruction" - ] - ) - - case 5: - kwargs["relay_conversation_history"] = RelayConversationHistory( - de.read_string( - _SCHEMA_AGENT_COLLABORATOR_SUMMARY.members[ - "relayConversationHistory" - ] - ) - ) - - case 6: - kwargs["collaborator_name"] = de.read_string( - _SCHEMA_AGENT_COLLABORATOR_SUMMARY.members["collaboratorName"] - ) - - case 7: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_AGENT_COLLABORATOR_SUMMARY.members["createdAt"] - ) - - case 8: - kwargs["last_updated_at"] = de.read_timestamp( - _SCHEMA_AGENT_COLLABORATOR_SUMMARY.members["lastUpdatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AGENT_COLLABORATOR_SUMMARY, consumer=_consumer) - if "agent_id" not in kwargs: - kwargs["agent_id"] = "" - if "agent_version" not in kwargs: - kwargs["agent_version"] = "" - if "collaborator_id" not in kwargs: - kwargs["collaborator_id"] = "" - if "agent_descriptor" not in kwargs: - kwargs["agent_descriptor"] = AgentDescriptor._smithy_default() - if "collaboration_instruction" not in kwargs: - kwargs["collaboration_instruction"] = "" - if "relay_conversation_history" not in kwargs: - kwargs["relay_conversation_history"] = RelayConversationHistory._corrected( - "" - ) - if "collaborator_name" not in kwargs: - kwargs["collaborator_name"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "last_updated_at" not in kwargs: - kwargs["last_updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_agent_collaborator_summaries( - serializer: ShapeSerializer, schema: Schema, value: list[AgentCollaboratorSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_agent_collaborator_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AgentCollaboratorSummary]: - result: list[AgentCollaboratorSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AgentCollaboratorSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListAgentCollaboratorsOutput: - """Dataclass for ListAgentCollaboratorsOutput structure.""" - - agent_collaborator_summaries: list[AgentCollaboratorSummary] - """A list of collaborator summaries.""" - - next_token: str | None = None - """ - Specify the pagination token from a previous request to retrieve the - next page of results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_AGENT_COLLABORATORS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_agent_collaborator_summaries( - serializer, - _SCHEMA_LIST_AGENT_COLLABORATORS_OUTPUT.members[ - "agentCollaboratorSummaries" - ], - self.agent_collaborator_summaries, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_AGENT_COLLABORATORS_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_collaborator_summaries"] = ( - _deserialize_agent_collaborator_summaries( - de, - _SCHEMA_LIST_AGENT_COLLABORATORS_OUTPUT.members[ - "agentCollaboratorSummaries" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_AGENT_COLLABORATORS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_AGENT_COLLABORATORS_OUTPUT, consumer=_consumer - ) - if "agent_collaborator_summaries" not in kwargs: - kwargs["agent_collaborator_summaries"] = [] - return kwargs - - -LIST_AGENT_COLLABORATORS = APIOperation( - input=ListAgentCollaboratorsInput, - output=ListAgentCollaboratorsOutput, - schema=_SCHEMA_LIST_AGENT_COLLABORATORS, - input_schema=_SCHEMA_LIST_AGENT_COLLABORATORS_INPUT, - output_schema=_SCHEMA_LIST_AGENT_COLLABORATORS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateAgentCollaboratorInput: - """Dataclass for UpdateAgentCollaboratorInput structure.""" - - agent_id: str | None = None - """The agent's ID.""" - - agent_version: str | None = None - """The agent's version.""" - - collaborator_id: str | None = None - """The collaborator's ID.""" - - agent_descriptor: AgentDescriptor | None = None - """An agent descriptor for the agent collaborator.""" - - collaborator_name: str | None = None - """The collaborator's name.""" - - collaboration_instruction: str | None = field(repr=False, default=None) - """Instruction for the collaborator.""" - - relay_conversation_history: str | None = None - """A relay conversation history for the collaborator.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_AGENT_COLLABORATOR_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.agent_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_AGENT_COLLABORATOR_INPUT.members["agentId"], - self.agent_id, - ) - - if self.agent_version is not None: - serializer.write_string( - _SCHEMA_UPDATE_AGENT_COLLABORATOR_INPUT.members["agentVersion"], - self.agent_version, - ) - - if self.collaborator_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_AGENT_COLLABORATOR_INPUT.members["collaboratorId"], - self.collaborator_id, - ) - - if self.agent_descriptor is not None: - serializer.write_struct( - _SCHEMA_UPDATE_AGENT_COLLABORATOR_INPUT.members["agentDescriptor"], - self.agent_descriptor, - ) - - if self.collaborator_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_AGENT_COLLABORATOR_INPUT.members["collaboratorName"], - self.collaborator_name, - ) - - if self.collaboration_instruction is not None: - serializer.write_string( - _SCHEMA_UPDATE_AGENT_COLLABORATOR_INPUT.members[ - "collaborationInstruction" - ], - self.collaboration_instruction, - ) - - if self.relay_conversation_history is not None: - serializer.write_string( - _SCHEMA_UPDATE_AGENT_COLLABORATOR_INPUT.members[ - "relayConversationHistory" - ], - self.relay_conversation_history, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_id"] = de.read_string( - _SCHEMA_UPDATE_AGENT_COLLABORATOR_INPUT.members["agentId"] - ) - - case 1: - kwargs["agent_version"] = de.read_string( - _SCHEMA_UPDATE_AGENT_COLLABORATOR_INPUT.members["agentVersion"] - ) - - case 2: - kwargs["collaborator_id"] = de.read_string( - _SCHEMA_UPDATE_AGENT_COLLABORATOR_INPUT.members[ - "collaboratorId" - ] - ) - - case 3: - kwargs["agent_descriptor"] = AgentDescriptor.deserialize(de) - - case 4: - kwargs["collaborator_name"] = de.read_string( - _SCHEMA_UPDATE_AGENT_COLLABORATOR_INPUT.members[ - "collaboratorName" - ] - ) - - case 5: - kwargs["collaboration_instruction"] = de.read_string( - _SCHEMA_UPDATE_AGENT_COLLABORATOR_INPUT.members[ - "collaborationInstruction" - ] - ) - - case 6: - kwargs["relay_conversation_history"] = RelayConversationHistory( - de.read_string( - _SCHEMA_UPDATE_AGENT_COLLABORATOR_INPUT.members[ - "relayConversationHistory" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_AGENT_COLLABORATOR_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateAgentCollaboratorOutput: - """Dataclass for UpdateAgentCollaboratorOutput structure.""" - - agent_collaborator: AgentCollaborator - """Details about the collaborator.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_AGENT_COLLABORATOR_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_UPDATE_AGENT_COLLABORATOR_OUTPUT.members["agentCollaborator"], - self.agent_collaborator, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_collaborator"] = AgentCollaborator.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_AGENT_COLLABORATOR_OUTPUT, consumer=_consumer - ) - if "agent_collaborator" not in kwargs: - kwargs["agent_collaborator"] = AgentCollaborator._smithy_default() - return kwargs - - -UPDATE_AGENT_COLLABORATOR = APIOperation( - input=UpdateAgentCollaboratorInput, - output=UpdateAgentCollaboratorOutput, - schema=_SCHEMA_UPDATE_AGENT_COLLABORATOR, - input_schema=_SCHEMA_UPDATE_AGENT_COLLABORATOR_INPUT, - output_schema=_SCHEMA_UPDATE_AGENT_COLLABORATOR_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrockagent#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class AgentFlowNodeConfiguration: - """ - Defines an agent node in your flow. You specify the agent to invoke at - this point in the flow. For more information, see [Node types in a - flow](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-nodes.html) - in the Amazon Bedrock User Guide. - """ - - agent_alias_arn: str = "" - """The Amazon Resource Name (ARN) of the alias of the agent to invoke.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENT_FLOW_NODE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AGENT_FLOW_NODE_CONFIGURATION.members["agentAliasArn"], - self.agent_alias_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_alias_arn"] = de.read_string( - _SCHEMA_AGENT_FLOW_NODE_CONFIGURATION.members["agentAliasArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AGENT_FLOW_NODE_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -class KnowledgeBaseState(UnknownEnumMixin, StrEnum): - ENABLED = "ENABLED" - DISABLED = "DISABLED" - - -@dataclass(kw_only=True) -class AgentKnowledgeBase: - """ - Contains details about a knowledge base that is associated with an - agent. - """ - - agent_id: str - """ - The unique identifier of the agent with which the knowledge base is - associated. - """ - - agent_version: str - """The version of the agent with which the knowledge base is associated.""" - - knowledge_base_id: str - """ - The unique identifier of the association between the agent and the - knowledge base. - """ - - description: str - """ - The description of the association between the agent and the knowledge - base. - """ - - created_at: datetime - """ - The time at which the association between the agent and the knowledge - base was created. - """ - - updated_at: datetime - """ - The time at which the association between the agent and the knowledge - base was last updated. - """ - - knowledge_base_state: str - """ - Specifies whether to use the knowledge base or not when sending an - [InvokeAgent](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html) - request. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENT_KNOWLEDGE_BASE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AGENT_KNOWLEDGE_BASE.members["agentId"], self.agent_id - ) - serializer.write_string( - _SCHEMA_AGENT_KNOWLEDGE_BASE.members["agentVersion"], self.agent_version - ) - serializer.write_string( - _SCHEMA_AGENT_KNOWLEDGE_BASE.members["knowledgeBaseId"], - self.knowledge_base_id, - ) - serializer.write_string( - _SCHEMA_AGENT_KNOWLEDGE_BASE.members["description"], self.description - ) - serializer.write_timestamp( - _SCHEMA_AGENT_KNOWLEDGE_BASE.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_AGENT_KNOWLEDGE_BASE.members["updatedAt"], self.updated_at - ) - serializer.write_string( - _SCHEMA_AGENT_KNOWLEDGE_BASE.members["knowledgeBaseState"], - self.knowledge_base_state, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_id"] = de.read_string( - _SCHEMA_AGENT_KNOWLEDGE_BASE.members["agentId"] - ) - - case 1: - kwargs["agent_version"] = de.read_string( - _SCHEMA_AGENT_KNOWLEDGE_BASE.members["agentVersion"] - ) - - case 2: - kwargs["knowledge_base_id"] = de.read_string( - _SCHEMA_AGENT_KNOWLEDGE_BASE.members["knowledgeBaseId"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_AGENT_KNOWLEDGE_BASE.members["description"] - ) - - case 4: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_AGENT_KNOWLEDGE_BASE.members["createdAt"] - ) - - case 5: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_AGENT_KNOWLEDGE_BASE.members["updatedAt"] - ) - - case 6: - kwargs["knowledge_base_state"] = KnowledgeBaseState( - de.read_string( - _SCHEMA_AGENT_KNOWLEDGE_BASE.members["knowledgeBaseState"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AGENT_KNOWLEDGE_BASE, consumer=_consumer) - if "agent_id" not in kwargs: - kwargs["agent_id"] = "" - if "agent_version" not in kwargs: - kwargs["agent_version"] = "" - if "knowledge_base_id" not in kwargs: - kwargs["knowledge_base_id"] = "" - if "description" not in kwargs: - kwargs["description"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "knowledge_base_state" not in kwargs: - kwargs["knowledge_base_state"] = KnowledgeBaseState._corrected("") - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls( - agent_id="", - agent_version="", - knowledge_base_id="", - description="", - created_at=datetime.fromtimestamp(0, tz=timezone.utc), - updated_at=datetime.fromtimestamp(0, tz=timezone.utc), - knowledge_base_state=KnowledgeBaseState._corrected(""), - ) - - -@dataclass(kw_only=True) -class AgentKnowledgeBaseSummary: - """Contains details about a knowledge base associated with an agent.""" - - knowledge_base_id: str - """The unique identifier of the knowledge base associated with an agent.""" - - knowledge_base_state: str - """ - Specifies whether the agent uses the knowledge base or not when sending - an - [InvokeAgent](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html) - request. - """ - - updated_at: datetime - """ - The time at which the knowledge base associated with an agent was last - updated. - """ - - description: str | None = None - """The description of the knowledge base associated with an agent.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENT_KNOWLEDGE_BASE_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AGENT_KNOWLEDGE_BASE_SUMMARY.members["knowledgeBaseId"], - self.knowledge_base_id, - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_AGENT_KNOWLEDGE_BASE_SUMMARY.members["description"], - self.description, - ) - - serializer.write_string( - _SCHEMA_AGENT_KNOWLEDGE_BASE_SUMMARY.members["knowledgeBaseState"], - self.knowledge_base_state, - ) - serializer.write_timestamp( - _SCHEMA_AGENT_KNOWLEDGE_BASE_SUMMARY.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["knowledge_base_id"] = de.read_string( - _SCHEMA_AGENT_KNOWLEDGE_BASE_SUMMARY.members["knowledgeBaseId"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_AGENT_KNOWLEDGE_BASE_SUMMARY.members["description"] - ) - - case 2: - kwargs["knowledge_base_state"] = KnowledgeBaseState( - de.read_string( - _SCHEMA_AGENT_KNOWLEDGE_BASE_SUMMARY.members[ - "knowledgeBaseState" - ] - ) - ) - - case 3: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_AGENT_KNOWLEDGE_BASE_SUMMARY.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AGENT_KNOWLEDGE_BASE_SUMMARY, consumer=_consumer - ) - if "knowledge_base_id" not in kwargs: - kwargs["knowledge_base_id"] = "" - if "knowledge_base_state" not in kwargs: - kwargs["knowledge_base_state"] = KnowledgeBaseState._corrected("") - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_agent_knowledge_base_summaries( - serializer: ShapeSerializer, schema: Schema, value: list[AgentKnowledgeBaseSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_agent_knowledge_base_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AgentKnowledgeBaseSummary]: - result: list[AgentKnowledgeBaseSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AgentKnowledgeBaseSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_tags_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_tags_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CreateAgentInput: - """Dataclass for CreateAgentInput structure.""" - - agent_name: str | None = None - """A name for the agent that you create.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If this token matches a previous - request, Amazon Bedrock ignores the request, but does not return an - error. For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - instruction: str | None = field(repr=False, default=None) - """ - Instructions that tell the agent what it should do and how it should - interact with users. - """ - - foundation_model: str | None = None - """ - The identifier for the model that you want to be used for orchestration - by the agent you create. - - The `modelId` to provide depends on the type of model or throughput that - you use: - - - If you use a base model, specify the model ID or its ARN. For a list - of model IDs for base models, see [Amazon Bedrock base model IDs - (on-demand - throughput)](https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns) - in the Amazon Bedrock User Guide. - - - If you use an inference profile, specify the inference profile ID or - its ARN. For a list of inference profile IDs, see [Supported Regions - and models for cross-region - inference](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference-support.html) - in the Amazon Bedrock User Guide. - - - If you use a provisioned model, specify the ARN of the Provisioned - Throughput. For more information, see [Run inference using a - Provisioned - Throughput](https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html) - in the Amazon Bedrock User Guide. - - - If you use a custom model, first purchase Provisioned Throughput for - it. Then specify the ARN of the resulting provisioned model. For more - information, see [Use a custom model in Amazon - Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html) - in the Amazon Bedrock User Guide. - - - If you use an [imported - model](https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-import-model.html), - specify the ARN of the imported model. You can get the model ARN from - a successful call to - [CreateModelImportJob](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_CreateModelImportJob.html) - or from the Imported models page in the Amazon Bedrock console. - """ - - description: str | None = None - """A description of the agent.""" - - orchestration_type: str | None = None - """ - Specifies the type of orchestration strategy for the agent. This is set - to `DEFAULT` orchestration type, by default. - """ - - custom_orchestration: CustomOrchestration | None = None - """Contains details of the custom orchestration configured for the agent.""" - - idle_session_ttl_in_seconds: int | None = None - """ - The number of seconds for which Amazon Bedrock keeps information about a - user's conversation with the agent. - - A user interaction remains active for the amount of time specified. If - no conversation occurs during this time, the session expires and Amazon - Bedrock deletes any data provided before the timeout. - """ - - agent_resource_role_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the IAM role with permissions to - invoke API operations on the agent. - """ - - customer_encryption_key_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the KMS key with which to encrypt the - agent. - """ - - tags: dict[str, str] | None = None - """Any tags that you want to attach to the agent.""" - - prompt_override_configuration: PromptOverrideConfiguration | None = field( - repr=False, default=None - ) - """ - Contains configurations to override prompts in different parts of an - agent sequence. For more information, see [Advanced - prompts](https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts.html). - """ - - guardrail_configuration: GuardrailConfiguration | None = None - """ - The unique Guardrail configuration assigned to the agent when it is - created. - """ - - memory_configuration: MemoryConfiguration | None = None - """Contains the details of the memory configured for the agent.""" - - agent_collaboration: str | None = None - """The agent's collaboration role.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_AGENT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.agent_name is not None: - serializer.write_string( - _SCHEMA_CREATE_AGENT_INPUT.members["agentName"], self.agent_name - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_AGENT_INPUT.members["clientToken"], self.client_token - ) - - if self.instruction is not None: - serializer.write_string( - _SCHEMA_CREATE_AGENT_INPUT.members["instruction"], self.instruction - ) - - if self.foundation_model is not None: - serializer.write_string( - _SCHEMA_CREATE_AGENT_INPUT.members["foundationModel"], - self.foundation_model, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_AGENT_INPUT.members["description"], self.description - ) - - if self.orchestration_type is not None: - serializer.write_string( - _SCHEMA_CREATE_AGENT_INPUT.members["orchestrationType"], - self.orchestration_type, - ) - - if self.custom_orchestration is not None: - serializer.write_struct( - _SCHEMA_CREATE_AGENT_INPUT.members["customOrchestration"], - self.custom_orchestration, - ) - - if self.idle_session_ttl_in_seconds is not None: - serializer.write_integer( - _SCHEMA_CREATE_AGENT_INPUT.members["idleSessionTTLInSeconds"], - self.idle_session_ttl_in_seconds, - ) - - if self.agent_resource_role_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_AGENT_INPUT.members["agentResourceRoleArn"], - self.agent_resource_role_arn, - ) - - if self.customer_encryption_key_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_AGENT_INPUT.members["customerEncryptionKeyArn"], - self.customer_encryption_key_arn, - ) - - if self.tags is not None: - _serialize_tags_map( - serializer, _SCHEMA_CREATE_AGENT_INPUT.members["tags"], self.tags - ) - - if self.prompt_override_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_AGENT_INPUT.members["promptOverrideConfiguration"], - self.prompt_override_configuration, - ) - - if self.guardrail_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_AGENT_INPUT.members["guardrailConfiguration"], - self.guardrail_configuration, - ) - - if self.memory_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_AGENT_INPUT.members["memoryConfiguration"], - self.memory_configuration, - ) - - if self.agent_collaboration is not None: - serializer.write_string( - _SCHEMA_CREATE_AGENT_INPUT.members["agentCollaboration"], - self.agent_collaboration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_name"] = de.read_string( - _SCHEMA_CREATE_AGENT_INPUT.members["agentName"] - ) - - case 1: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_AGENT_INPUT.members["clientToken"] - ) - - case 2: - kwargs["instruction"] = de.read_string( - _SCHEMA_CREATE_AGENT_INPUT.members["instruction"] - ) - - case 3: - kwargs["foundation_model"] = de.read_string( - _SCHEMA_CREATE_AGENT_INPUT.members["foundationModel"] - ) - - case 4: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_AGENT_INPUT.members["description"] - ) - - case 5: - kwargs["orchestration_type"] = OrchestrationType( - de.read_string( - _SCHEMA_CREATE_AGENT_INPUT.members["orchestrationType"] - ) - ) - - case 6: - kwargs["custom_orchestration"] = CustomOrchestration.deserialize(de) - - case 7: - kwargs["idle_session_ttl_in_seconds"] = de.read_integer( - _SCHEMA_CREATE_AGENT_INPUT.members["idleSessionTTLInSeconds"] - ) - - case 8: - kwargs["agent_resource_role_arn"] = de.read_string( - _SCHEMA_CREATE_AGENT_INPUT.members["agentResourceRoleArn"] - ) - - case 9: - kwargs["customer_encryption_key_arn"] = de.read_string( - _SCHEMA_CREATE_AGENT_INPUT.members["customerEncryptionKeyArn"] - ) - - case 10: - kwargs["tags"] = _deserialize_tags_map( - de, _SCHEMA_CREATE_AGENT_INPUT.members["tags"] - ) - - case 11: - kwargs["prompt_override_configuration"] = ( - PromptOverrideConfiguration.deserialize(de) - ) - - case 12: - kwargs["guardrail_configuration"] = ( - GuardrailConfiguration.deserialize(de) - ) - - case 13: - kwargs["memory_configuration"] = MemoryConfiguration.deserialize(de) - - case 14: - kwargs["agent_collaboration"] = AgentCollaboration( - de.read_string( - _SCHEMA_CREATE_AGENT_INPUT.members["agentCollaboration"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_AGENT_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CreateAgentOutput: - """Dataclass for CreateAgentOutput structure.""" - - agent: Agent - """Contains details about the agent created.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_AGENT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CREATE_AGENT_OUTPUT.members["agent"], self.agent - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent"] = Agent.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_AGENT_OUTPUT, consumer=_consumer) - if "agent" not in kwargs: - kwargs["agent"] = Agent._smithy_default() - return kwargs - - -CREATE_AGENT = APIOperation( - input=CreateAgentInput, - output=CreateAgentOutput, - schema=_SCHEMA_CREATE_AGENT, - input_schema=_SCHEMA_CREATE_AGENT_INPUT, - output_schema=_SCHEMA_CREATE_AGENT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrockagent#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteAgentInput: - """Dataclass for DeleteAgentInput structure.""" - - agent_id: str | None = None - """The unique identifier of the agent to delete.""" - - skip_resource_in_use_check: bool = False - """ - By default, this value is `false` and deletion is stopped if the - resource is in use. If you set it to `true`, the resource will be - deleted even if the resource is in use. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_AGENT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.agent_id is not None: - serializer.write_string( - _SCHEMA_DELETE_AGENT_INPUT.members["agentId"], self.agent_id - ) - - if self.skip_resource_in_use_check is not None: - serializer.write_boolean( - _SCHEMA_DELETE_AGENT_INPUT.members["skipResourceInUseCheck"], - self.skip_resource_in_use_check, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_id"] = de.read_string( - _SCHEMA_DELETE_AGENT_INPUT.members["agentId"] - ) - - case 1: - kwargs["skip_resource_in_use_check"] = de.read_boolean( - _SCHEMA_DELETE_AGENT_INPUT.members["skipResourceInUseCheck"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_AGENT_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteAgentOutput: - """Dataclass for DeleteAgentOutput structure.""" - - agent_id: str - """The unique identifier of the agent that was deleted.""" - - agent_status: str - """The status of the agent.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_AGENT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DELETE_AGENT_OUTPUT.members["agentId"], self.agent_id - ) - serializer.write_string( - _SCHEMA_DELETE_AGENT_OUTPUT.members["agentStatus"], self.agent_status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_id"] = de.read_string( - _SCHEMA_DELETE_AGENT_OUTPUT.members["agentId"] - ) - - case 1: - kwargs["agent_status"] = AgentStatus( - de.read_string( - _SCHEMA_DELETE_AGENT_OUTPUT.members["agentStatus"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_AGENT_OUTPUT, consumer=_consumer) - if "agent_id" not in kwargs: - kwargs["agent_id"] = "" - if "agent_status" not in kwargs: - kwargs["agent_status"] = AgentStatus._corrected("") - return kwargs - - -DELETE_AGENT = APIOperation( - input=DeleteAgentInput, - output=DeleteAgentOutput, - schema=_SCHEMA_DELETE_AGENT, - input_schema=_SCHEMA_DELETE_AGENT_INPUT, - output_schema=_SCHEMA_DELETE_AGENT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrockagent#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetAgentInput: - """Dataclass for GetAgentInput structure.""" - - agent_id: str | None = None - """The unique identifier of the agent.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_AGENT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.agent_id is not None: - serializer.write_string( - _SCHEMA_GET_AGENT_INPUT.members["agentId"], self.agent_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_id"] = de.read_string( - _SCHEMA_GET_AGENT_INPUT.members["agentId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_AGENT_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetAgentOutput: - """Dataclass for GetAgentOutput structure.""" - - agent: Agent - """Contains details about the agent.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_AGENT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_AGENT_OUTPUT.members["agent"], self.agent) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent"] = Agent.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_AGENT_OUTPUT, consumer=_consumer) - if "agent" not in kwargs: - kwargs["agent"] = Agent._smithy_default() - return kwargs - - -GET_AGENT = APIOperation( - input=GetAgentInput, - output=GetAgentOutput, - schema=_SCHEMA_GET_AGENT, - input_schema=_SCHEMA_GET_AGENT_INPUT, - output_schema=_SCHEMA_GET_AGENT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListAgentsInput: - """Dataclass for ListAgentsInput structure.""" - - max_results: int | None = None - """ - The maximum number of results to return in the response. If the total - number of results is greater than this value, use the token returned in - the response in the `nextToken` field when making another request to - return the next batch of results. - """ - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, enter the token returned in the `nextToken` - field in the response in this field to return the next batch of results. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_AGENTS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_AGENTS_INPUT.members["maxResults"], self.max_results - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_AGENTS_INPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_AGENTS_INPUT.members["maxResults"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_AGENTS_INPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_AGENTS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class AgentSummary: - """Contains details about an agent.""" - - agent_id: str - """The unique identifier of the agent.""" - - agent_name: str - """The name of the agent.""" - - agent_status: str - """The status of the agent.""" - - updated_at: datetime - """The time at which the agent was last updated.""" - - description: str | None = None - """The description of the agent.""" - - latest_agent_version: str | None = None - """The latest version of the agent.""" - - guardrail_configuration: GuardrailConfiguration | None = None - """Details about the guardrail associated with the agent.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENT_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_AGENT_SUMMARY.members["agentId"], self.agent_id) - serializer.write_string( - _SCHEMA_AGENT_SUMMARY.members["agentName"], self.agent_name - ) - serializer.write_string( - _SCHEMA_AGENT_SUMMARY.members["agentStatus"], self.agent_status - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_AGENT_SUMMARY.members["description"], self.description - ) - - serializer.write_timestamp( - _SCHEMA_AGENT_SUMMARY.members["updatedAt"], self.updated_at - ) - if self.latest_agent_version is not None: - serializer.write_string( - _SCHEMA_AGENT_SUMMARY.members["latestAgentVersion"], - self.latest_agent_version, - ) - - if self.guardrail_configuration is not None: - serializer.write_struct( - _SCHEMA_AGENT_SUMMARY.members["guardrailConfiguration"], - self.guardrail_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_id"] = de.read_string( - _SCHEMA_AGENT_SUMMARY.members["agentId"] - ) - - case 1: - kwargs["agent_name"] = de.read_string( - _SCHEMA_AGENT_SUMMARY.members["agentName"] - ) - - case 2: - kwargs["agent_status"] = AgentStatus( - de.read_string(_SCHEMA_AGENT_SUMMARY.members["agentStatus"]) - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_AGENT_SUMMARY.members["description"] - ) - - case 4: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_AGENT_SUMMARY.members["updatedAt"] - ) - - case 5: - kwargs["latest_agent_version"] = de.read_string( - _SCHEMA_AGENT_SUMMARY.members["latestAgentVersion"] - ) - - case 6: - kwargs["guardrail_configuration"] = ( - GuardrailConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AGENT_SUMMARY, consumer=_consumer) - if "agent_id" not in kwargs: - kwargs["agent_id"] = "" - if "agent_name" not in kwargs: - kwargs["agent_name"] = "" - if "agent_status" not in kwargs: - kwargs["agent_status"] = AgentStatus._corrected("") - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_agent_summaries( - serializer: ShapeSerializer, schema: Schema, value: list[AgentSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_agent_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AgentSummary]: - result: list[AgentSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AgentSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListAgentsOutput: - """Dataclass for ListAgentsOutput structure.""" - - agent_summaries: list[AgentSummary] - """A list of objects, each of which contains information about an agent.""" - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, use this token when making another request in - the `nextToken` field to return the next batch of results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_AGENTS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_agent_summaries( - serializer, - _SCHEMA_LIST_AGENTS_OUTPUT.members["agentSummaries"], - self.agent_summaries, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_AGENTS_OUTPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_summaries"] = _deserialize_agent_summaries( - de, _SCHEMA_LIST_AGENTS_OUTPUT.members["agentSummaries"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_AGENTS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_AGENTS_OUTPUT, consumer=_consumer) - if "agent_summaries" not in kwargs: - kwargs["agent_summaries"] = [] - return kwargs - - -LIST_AGENTS = APIOperation( - input=ListAgentsInput, - output=ListAgentsOutput, - schema=_SCHEMA_LIST_AGENTS, - input_schema=_SCHEMA_LIST_AGENTS_INPUT, - output_schema=_SCHEMA_LIST_AGENTS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class PrepareAgentInput: - """Dataclass for PrepareAgentInput structure.""" - - agent_id: str | None = None - """ - The unique identifier of the agent for which to create a `DRAFT` - version. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PREPARE_AGENT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.agent_id is not None: - serializer.write_string( - _SCHEMA_PREPARE_AGENT_INPUT.members["agentId"], self.agent_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_id"] = de.read_string( - _SCHEMA_PREPARE_AGENT_INPUT.members["agentId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PREPARE_AGENT_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class PrepareAgentOutput: - """Dataclass for PrepareAgentOutput structure.""" - - agent_id: str - """ - The unique identifier of the agent for which the `DRAFT` version was - created. - """ - - agent_status: str - """The status of the `DRAFT` version and whether it is ready for use.""" - - agent_version: str - """The version of the agent.""" - - prepared_at: datetime - """The time at which the `DRAFT` version of the agent was last prepared.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PREPARE_AGENT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_PREPARE_AGENT_OUTPUT.members["agentId"], self.agent_id - ) - serializer.write_string( - _SCHEMA_PREPARE_AGENT_OUTPUT.members["agentStatus"], self.agent_status - ) - serializer.write_string( - _SCHEMA_PREPARE_AGENT_OUTPUT.members["agentVersion"], self.agent_version - ) - serializer.write_timestamp( - _SCHEMA_PREPARE_AGENT_OUTPUT.members["preparedAt"], self.prepared_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_id"] = de.read_string( - _SCHEMA_PREPARE_AGENT_OUTPUT.members["agentId"] - ) - - case 1: - kwargs["agent_status"] = AgentStatus( - de.read_string( - _SCHEMA_PREPARE_AGENT_OUTPUT.members["agentStatus"] - ) - ) - - case 2: - kwargs["agent_version"] = de.read_string( - _SCHEMA_PREPARE_AGENT_OUTPUT.members["agentVersion"] - ) - - case 3: - kwargs["prepared_at"] = de.read_timestamp( - _SCHEMA_PREPARE_AGENT_OUTPUT.members["preparedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PREPARE_AGENT_OUTPUT, consumer=_consumer) - if "agent_id" not in kwargs: - kwargs["agent_id"] = "" - if "agent_status" not in kwargs: - kwargs["agent_status"] = AgentStatus._corrected("") - if "agent_version" not in kwargs: - kwargs["agent_version"] = "" - if "prepared_at" not in kwargs: - kwargs["prepared_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -PREPARE_AGENT = APIOperation( - input=PrepareAgentInput, - output=PrepareAgentOutput, - schema=_SCHEMA_PREPARE_AGENT, - input_schema=_SCHEMA_PREPARE_AGENT_INPUT, - output_schema=_SCHEMA_PREPARE_AGENT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrockagent#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateAgentInput: - """Dataclass for UpdateAgentInput structure.""" - - agent_id: str | None = None - """The unique identifier of the agent.""" - - agent_name: str | None = None - """Specifies a new name for the agent.""" - - instruction: str | None = field(repr=False, default=None) - """ - Specifies new instructions that tell the agent what it should do and how - it should interact with users. - """ - - foundation_model: str | None = None - """ - The identifier for the model that you want to be used for orchestration - by the agent you create. - - The `modelId` to provide depends on the type of model or throughput that - you use: - - - If you use a base model, specify the model ID or its ARN. For a list - of model IDs for base models, see [Amazon Bedrock base model IDs - (on-demand - throughput)](https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns) - in the Amazon Bedrock User Guide. - - - If you use an inference profile, specify the inference profile ID or - its ARN. For a list of inference profile IDs, see [Supported Regions - and models for cross-region - inference](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference-support.html) - in the Amazon Bedrock User Guide. - - - If you use a provisioned model, specify the ARN of the Provisioned - Throughput. For more information, see [Run inference using a - Provisioned - Throughput](https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html) - in the Amazon Bedrock User Guide. - - - If you use a custom model, first purchase Provisioned Throughput for - it. Then specify the ARN of the resulting provisioned model. For more - information, see [Use a custom model in Amazon - Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html) - in the Amazon Bedrock User Guide. - - - If you use an [imported - model](https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-import-model.html), - specify the ARN of the imported model. You can get the model ARN from - a successful call to - [CreateModelImportJob](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_CreateModelImportJob.html) - or from the Imported models page in the Amazon Bedrock console. - """ - - description: str | None = None - """Specifies a new description of the agent.""" - - orchestration_type: str | None = None - """ - Specifies the type of orchestration strategy for the agent. This is set - to `DEFAULT` orchestration type, by default. - """ - - custom_orchestration: CustomOrchestration | None = None - """Contains details of the custom orchestration configured for the agent.""" - - idle_session_ttl_in_seconds: int | None = None - """ - The number of seconds for which Amazon Bedrock keeps information about a - user's conversation with the agent. - - A user interaction remains active for the amount of time specified. If - no conversation occurs during this time, the session expires and Amazon - Bedrock deletes any data provided before the timeout. - """ - - agent_resource_role_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the IAM role with permissions to - invoke API operations on the agent. - """ - - customer_encryption_key_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the KMS key with which to encrypt the - agent. - """ - - prompt_override_configuration: PromptOverrideConfiguration | None = field( - repr=False, default=None - ) - """ - Contains configurations to override prompts in different parts of an - agent sequence. For more information, see [Advanced - prompts](https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts.html). - """ - - guardrail_configuration: GuardrailConfiguration | None = None - """ - The unique Guardrail configuration assigned to the agent when it is - updated. - """ - - memory_configuration: MemoryConfiguration | None = None - """Specifies the new memory configuration for the agent.""" - - agent_collaboration: str | None = None - """The agent's collaboration role.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_AGENT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.agent_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_AGENT_INPUT.members["agentId"], self.agent_id - ) - - if self.agent_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_AGENT_INPUT.members["agentName"], self.agent_name - ) - - if self.instruction is not None: - serializer.write_string( - _SCHEMA_UPDATE_AGENT_INPUT.members["instruction"], self.instruction - ) - - if self.foundation_model is not None: - serializer.write_string( - _SCHEMA_UPDATE_AGENT_INPUT.members["foundationModel"], - self.foundation_model, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_AGENT_INPUT.members["description"], self.description - ) - - if self.orchestration_type is not None: - serializer.write_string( - _SCHEMA_UPDATE_AGENT_INPUT.members["orchestrationType"], - self.orchestration_type, - ) - - if self.custom_orchestration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_AGENT_INPUT.members["customOrchestration"], - self.custom_orchestration, - ) - - if self.idle_session_ttl_in_seconds is not None: - serializer.write_integer( - _SCHEMA_UPDATE_AGENT_INPUT.members["idleSessionTTLInSeconds"], - self.idle_session_ttl_in_seconds, - ) - - if self.agent_resource_role_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_AGENT_INPUT.members["agentResourceRoleArn"], - self.agent_resource_role_arn, - ) - - if self.customer_encryption_key_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_AGENT_INPUT.members["customerEncryptionKeyArn"], - self.customer_encryption_key_arn, - ) - - if self.prompt_override_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_AGENT_INPUT.members["promptOverrideConfiguration"], - self.prompt_override_configuration, - ) - - if self.guardrail_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_AGENT_INPUT.members["guardrailConfiguration"], - self.guardrail_configuration, - ) - - if self.memory_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_AGENT_INPUT.members["memoryConfiguration"], - self.memory_configuration, - ) - - if self.agent_collaboration is not None: - serializer.write_string( - _SCHEMA_UPDATE_AGENT_INPUT.members["agentCollaboration"], - self.agent_collaboration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_id"] = de.read_string( - _SCHEMA_UPDATE_AGENT_INPUT.members["agentId"] - ) - - case 1: - kwargs["agent_name"] = de.read_string( - _SCHEMA_UPDATE_AGENT_INPUT.members["agentName"] - ) - - case 2: - kwargs["instruction"] = de.read_string( - _SCHEMA_UPDATE_AGENT_INPUT.members["instruction"] - ) - - case 3: - kwargs["foundation_model"] = de.read_string( - _SCHEMA_UPDATE_AGENT_INPUT.members["foundationModel"] - ) - - case 4: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_AGENT_INPUT.members["description"] - ) - - case 5: - kwargs["orchestration_type"] = OrchestrationType( - de.read_string( - _SCHEMA_UPDATE_AGENT_INPUT.members["orchestrationType"] - ) - ) - - case 6: - kwargs["custom_orchestration"] = CustomOrchestration.deserialize(de) - - case 7: - kwargs["idle_session_ttl_in_seconds"] = de.read_integer( - _SCHEMA_UPDATE_AGENT_INPUT.members["idleSessionTTLInSeconds"] - ) - - case 8: - kwargs["agent_resource_role_arn"] = de.read_string( - _SCHEMA_UPDATE_AGENT_INPUT.members["agentResourceRoleArn"] - ) - - case 9: - kwargs["customer_encryption_key_arn"] = de.read_string( - _SCHEMA_UPDATE_AGENT_INPUT.members["customerEncryptionKeyArn"] - ) - - case 10: - kwargs["prompt_override_configuration"] = ( - PromptOverrideConfiguration.deserialize(de) - ) - - case 11: - kwargs["guardrail_configuration"] = ( - GuardrailConfiguration.deserialize(de) - ) - - case 12: - kwargs["memory_configuration"] = MemoryConfiguration.deserialize(de) - - case 13: - kwargs["agent_collaboration"] = AgentCollaboration( - de.read_string( - _SCHEMA_UPDATE_AGENT_INPUT.members["agentCollaboration"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_AGENT_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateAgentOutput: - """Dataclass for UpdateAgentOutput structure.""" - - agent: Agent - """Contains details about the agent that was updated.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_AGENT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_UPDATE_AGENT_OUTPUT.members["agent"], self.agent - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent"] = Agent.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_AGENT_OUTPUT, consumer=_consumer) - if "agent" not in kwargs: - kwargs["agent"] = Agent._smithy_default() - return kwargs - - -UPDATE_AGENT = APIOperation( - input=UpdateAgentInput, - output=UpdateAgentOutput, - schema=_SCHEMA_UPDATE_AGENT, - input_schema=_SCHEMA_UPDATE_AGENT_INPUT, - output_schema=_SCHEMA_UPDATE_AGENT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrockagent#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class AgentVersion: - """Contains details about a version of an agent.""" - - agent_id: str - """The unique identifier of the agent that the version belongs to.""" - - agent_name: str - """The name of the agent that the version belongs to.""" - - agent_arn: str - """The Amazon Resource Name (ARN) of the agent that the version belongs to.""" - - version: str - """The version number.""" - - agent_status: str - """The status of the agent that the version belongs to.""" - - idle_session_ttl_in_seconds: int - """ - The number of seconds for which Amazon Bedrock keeps information about a - user's conversation with the agent. - - A user interaction remains active for the amount of time specified. If - no conversation occurs during this time, the session expires and Amazon - Bedrock deletes any data provided before the timeout. - """ - - agent_resource_role_arn: str - """ - The Amazon Resource Name (ARN) of the IAM role with permissions to - invoke API operations on the agent. - """ - - created_at: datetime - """The time at which the version was created.""" - - updated_at: datetime - """The time at which the version was last updated.""" - - instruction: str | None = field(repr=False, default=None) - """The instructions provided to the agent.""" - - foundation_model: str | None = None - """The foundation model that the version invokes.""" - - description: str | None = None - """The description of the version.""" - - customer_encryption_key_arn: str | None = None - """The Amazon Resource Name (ARN) of the KMS key that encrypts the agent.""" - - failure_reasons: list[str] | None = None - """A list of reasons that the API operation on the version failed.""" - - recommended_actions: list[str] | None = None - """ - A list of recommended actions to take for the failed API operation on - the version to succeed. - """ - - prompt_override_configuration: PromptOverrideConfiguration | None = field( - repr=False, default=None - ) - """ - Contains configurations to override prompt templates in different parts - of an agent sequence. For more information, see [Advanced - prompts](https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts.html). - """ - - guardrail_configuration: GuardrailConfiguration | None = None - """Details about the guardrail associated with the agent.""" - - memory_configuration: MemoryConfiguration | None = None - """ - Contains details of the memory configuration on the version of the - agent. - """ - - agent_collaboration: str | None = None - """The agent's collaboration settings.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENT_VERSION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_AGENT_VERSION.members["agentId"], self.agent_id) - serializer.write_string( - _SCHEMA_AGENT_VERSION.members["agentName"], self.agent_name - ) - serializer.write_string( - _SCHEMA_AGENT_VERSION.members["agentArn"], self.agent_arn - ) - serializer.write_string(_SCHEMA_AGENT_VERSION.members["version"], self.version) - if self.instruction is not None: - serializer.write_string( - _SCHEMA_AGENT_VERSION.members["instruction"], self.instruction - ) - - serializer.write_string( - _SCHEMA_AGENT_VERSION.members["agentStatus"], self.agent_status - ) - if self.foundation_model is not None: - serializer.write_string( - _SCHEMA_AGENT_VERSION.members["foundationModel"], self.foundation_model - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_AGENT_VERSION.members["description"], self.description - ) - - serializer.write_integer( - _SCHEMA_AGENT_VERSION.members["idleSessionTTLInSeconds"], - self.idle_session_ttl_in_seconds, - ) - serializer.write_string( - _SCHEMA_AGENT_VERSION.members["agentResourceRoleArn"], - self.agent_resource_role_arn, - ) - if self.customer_encryption_key_arn is not None: - serializer.write_string( - _SCHEMA_AGENT_VERSION.members["customerEncryptionKeyArn"], - self.customer_encryption_key_arn, - ) - - serializer.write_timestamp( - _SCHEMA_AGENT_VERSION.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_AGENT_VERSION.members["updatedAt"], self.updated_at - ) - if self.failure_reasons is not None: - _serialize_failure_reasons( - serializer, - _SCHEMA_AGENT_VERSION.members["failureReasons"], - self.failure_reasons, - ) - - if self.recommended_actions is not None: - _serialize_recommended_actions( - serializer, - _SCHEMA_AGENT_VERSION.members["recommendedActions"], - self.recommended_actions, - ) - - if self.prompt_override_configuration is not None: - serializer.write_struct( - _SCHEMA_AGENT_VERSION.members["promptOverrideConfiguration"], - self.prompt_override_configuration, - ) - - if self.guardrail_configuration is not None: - serializer.write_struct( - _SCHEMA_AGENT_VERSION.members["guardrailConfiguration"], - self.guardrail_configuration, - ) - - if self.memory_configuration is not None: - serializer.write_struct( - _SCHEMA_AGENT_VERSION.members["memoryConfiguration"], - self.memory_configuration, - ) - - if self.agent_collaboration is not None: - serializer.write_string( - _SCHEMA_AGENT_VERSION.members["agentCollaboration"], - self.agent_collaboration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_id"] = de.read_string( - _SCHEMA_AGENT_VERSION.members["agentId"] - ) - - case 1: - kwargs["agent_name"] = de.read_string( - _SCHEMA_AGENT_VERSION.members["agentName"] - ) - - case 2: - kwargs["agent_arn"] = de.read_string( - _SCHEMA_AGENT_VERSION.members["agentArn"] - ) - - case 3: - kwargs["version"] = de.read_string( - _SCHEMA_AGENT_VERSION.members["version"] - ) - - case 4: - kwargs["instruction"] = de.read_string( - _SCHEMA_AGENT_VERSION.members["instruction"] - ) - - case 5: - kwargs["agent_status"] = AgentStatus( - de.read_string(_SCHEMA_AGENT_VERSION.members["agentStatus"]) - ) - - case 6: - kwargs["foundation_model"] = de.read_string( - _SCHEMA_AGENT_VERSION.members["foundationModel"] - ) - - case 7: - kwargs["description"] = de.read_string( - _SCHEMA_AGENT_VERSION.members["description"] - ) - - case 8: - kwargs["idle_session_ttl_in_seconds"] = de.read_integer( - _SCHEMA_AGENT_VERSION.members["idleSessionTTLInSeconds"] - ) - - case 9: - kwargs["agent_resource_role_arn"] = de.read_string( - _SCHEMA_AGENT_VERSION.members["agentResourceRoleArn"] - ) - - case 10: - kwargs["customer_encryption_key_arn"] = de.read_string( - _SCHEMA_AGENT_VERSION.members["customerEncryptionKeyArn"] - ) - - case 11: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_AGENT_VERSION.members["createdAt"] - ) - - case 12: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_AGENT_VERSION.members["updatedAt"] - ) - - case 13: - kwargs["failure_reasons"] = _deserialize_failure_reasons( - de, _SCHEMA_AGENT_VERSION.members["failureReasons"] - ) - - case 14: - kwargs["recommended_actions"] = _deserialize_recommended_actions( - de, _SCHEMA_AGENT_VERSION.members["recommendedActions"] - ) - - case 15: - kwargs["prompt_override_configuration"] = ( - PromptOverrideConfiguration.deserialize(de) - ) - - case 16: - kwargs["guardrail_configuration"] = ( - GuardrailConfiguration.deserialize(de) - ) - - case 17: - kwargs["memory_configuration"] = MemoryConfiguration.deserialize(de) - - case 18: - kwargs["agent_collaboration"] = AgentCollaboration( - de.read_string( - _SCHEMA_AGENT_VERSION.members["agentCollaboration"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AGENT_VERSION, consumer=_consumer) - if "agent_id" not in kwargs: - kwargs["agent_id"] = "" - if "agent_name" not in kwargs: - kwargs["agent_name"] = "" - if "agent_arn" not in kwargs: - kwargs["agent_arn"] = "" - if "version" not in kwargs: - kwargs["version"] = "" - if "agent_status" not in kwargs: - kwargs["agent_status"] = AgentStatus._corrected("") - if "idle_session_ttl_in_seconds" not in kwargs: - kwargs["idle_session_ttl_in_seconds"] = 0 - if "agent_resource_role_arn" not in kwargs: - kwargs["agent_resource_role_arn"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls( - agent_id="", - agent_name="", - agent_arn="", - version="", - agent_status=AgentStatus._corrected(""), - idle_session_ttl_in_seconds=0, - agent_resource_role_arn="", - created_at=datetime.fromtimestamp(0, tz=timezone.utc), - updated_at=datetime.fromtimestamp(0, tz=timezone.utc), - ) - - -@dataclass(kw_only=True) -class AgentVersionSummary: - """Contains details about a version of an agent.""" - - agent_name: str - """The name of the agent to which the version belongs.""" - - agent_status: str - """The status of the agent to which the version belongs.""" - - agent_version: str - """The version of the agent.""" - - created_at: datetime - """The time at which the version was created.""" - - updated_at: datetime - """The time at which the version was last updated.""" - - description: str | None = None - """The description of the version of the agent.""" - - guardrail_configuration: GuardrailConfiguration | None = None - """Details about the guardrail associated with the agent.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENT_VERSION_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AGENT_VERSION_SUMMARY.members["agentName"], self.agent_name - ) - serializer.write_string( - _SCHEMA_AGENT_VERSION_SUMMARY.members["agentStatus"], self.agent_status - ) - serializer.write_string( - _SCHEMA_AGENT_VERSION_SUMMARY.members["agentVersion"], self.agent_version - ) - serializer.write_timestamp( - _SCHEMA_AGENT_VERSION_SUMMARY.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_AGENT_VERSION_SUMMARY.members["updatedAt"], self.updated_at - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_AGENT_VERSION_SUMMARY.members["description"], self.description - ) - - if self.guardrail_configuration is not None: - serializer.write_struct( - _SCHEMA_AGENT_VERSION_SUMMARY.members["guardrailConfiguration"], - self.guardrail_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_name"] = de.read_string( - _SCHEMA_AGENT_VERSION_SUMMARY.members["agentName"] - ) - - case 1: - kwargs["agent_status"] = AgentStatus( - de.read_string( - _SCHEMA_AGENT_VERSION_SUMMARY.members["agentStatus"] - ) - ) - - case 2: - kwargs["agent_version"] = de.read_string( - _SCHEMA_AGENT_VERSION_SUMMARY.members["agentVersion"] - ) - - case 3: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_AGENT_VERSION_SUMMARY.members["createdAt"] - ) - - case 4: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_AGENT_VERSION_SUMMARY.members["updatedAt"] - ) - - case 5: - kwargs["description"] = de.read_string( - _SCHEMA_AGENT_VERSION_SUMMARY.members["description"] - ) - - case 6: - kwargs["guardrail_configuration"] = ( - GuardrailConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AGENT_VERSION_SUMMARY, consumer=_consumer) - if "agent_name" not in kwargs: - kwargs["agent_name"] = "" - if "agent_status" not in kwargs: - kwargs["agent_status"] = AgentStatus._corrected("") - if "agent_version" not in kwargs: - kwargs["agent_version"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_agent_version_summaries( - serializer: ShapeSerializer, schema: Schema, value: list[AgentVersionSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_agent_version_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AgentVersionSummary]: - result: list[AgentVersionSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AgentVersionSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CreateAgentAliasInput: - """Dataclass for CreateAgentAliasInput structure.""" - - agent_id: str | None = None - """The unique identifier of the agent.""" - - agent_alias_name: str | None = None - """The name of the alias.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If this token matches a previous - request, Amazon Bedrock ignores the request, but does not return an - error. For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - description: str | None = None - """A description of the alias of the agent.""" - - routing_configuration: list[AgentAliasRoutingConfigurationListItem] | None = None - """Contains details about the routing configuration of the alias.""" - - tags: dict[str, str] | None = None - """Any tags that you want to attach to the alias of the agent.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_AGENT_ALIAS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.agent_id is not None: - serializer.write_string( - _SCHEMA_CREATE_AGENT_ALIAS_INPUT.members["agentId"], self.agent_id - ) - - if self.agent_alias_name is not None: - serializer.write_string( - _SCHEMA_CREATE_AGENT_ALIAS_INPUT.members["agentAliasName"], - self.agent_alias_name, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_AGENT_ALIAS_INPUT.members["clientToken"], - self.client_token, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_AGENT_ALIAS_INPUT.members["description"], - self.description, - ) - - if self.routing_configuration is not None: - _serialize_agent_alias_routing_configuration( - serializer, - _SCHEMA_CREATE_AGENT_ALIAS_INPUT.members["routingConfiguration"], - self.routing_configuration, - ) - - if self.tags is not None: - _serialize_tags_map( - serializer, _SCHEMA_CREATE_AGENT_ALIAS_INPUT.members["tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_id"] = de.read_string( - _SCHEMA_CREATE_AGENT_ALIAS_INPUT.members["agentId"] - ) - - case 1: - kwargs["agent_alias_name"] = de.read_string( - _SCHEMA_CREATE_AGENT_ALIAS_INPUT.members["agentAliasName"] - ) - - case 2: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_AGENT_ALIAS_INPUT.members["clientToken"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_AGENT_ALIAS_INPUT.members["description"] - ) - - case 4: - kwargs["routing_configuration"] = ( - _deserialize_agent_alias_routing_configuration( - de, - _SCHEMA_CREATE_AGENT_ALIAS_INPUT.members[ - "routingConfiguration" - ], - ) - ) - - case 5: - kwargs["tags"] = _deserialize_tags_map( - de, _SCHEMA_CREATE_AGENT_ALIAS_INPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_AGENT_ALIAS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CreateAgentAliasOutput: - """Dataclass for CreateAgentAliasOutput structure.""" - - agent_alias: AgentAlias - """Contains details about the alias that was created.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_AGENT_ALIAS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CREATE_AGENT_ALIAS_OUTPUT.members["agentAlias"], self.agent_alias - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_alias"] = AgentAlias.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_AGENT_ALIAS_OUTPUT, consumer=_consumer) - if "agent_alias" not in kwargs: - kwargs["agent_alias"] = AgentAlias._smithy_default() - return kwargs - - -CREATE_AGENT_ALIAS = APIOperation( - input=CreateAgentAliasInput, - output=CreateAgentAliasOutput, - schema=_SCHEMA_CREATE_AGENT_ALIAS, - input_schema=_SCHEMA_CREATE_AGENT_ALIAS_INPUT, - output_schema=_SCHEMA_CREATE_AGENT_ALIAS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrockagent#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteAgentAliasInput: - """Dataclass for DeleteAgentAliasInput structure.""" - - agent_id: str | None = None - """The unique identifier of the agent that the alias belongs to.""" - - agent_alias_id: str | None = None - """The unique identifier of the alias to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_AGENT_ALIAS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.agent_id is not None: - serializer.write_string( - _SCHEMA_DELETE_AGENT_ALIAS_INPUT.members["agentId"], self.agent_id - ) - - if self.agent_alias_id is not None: - serializer.write_string( - _SCHEMA_DELETE_AGENT_ALIAS_INPUT.members["agentAliasId"], - self.agent_alias_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_id"] = de.read_string( - _SCHEMA_DELETE_AGENT_ALIAS_INPUT.members["agentId"] - ) - - case 1: - kwargs["agent_alias_id"] = de.read_string( - _SCHEMA_DELETE_AGENT_ALIAS_INPUT.members["agentAliasId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_AGENT_ALIAS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteAgentAliasOutput: - """Dataclass for DeleteAgentAliasOutput structure.""" - - agent_id: str - """The unique identifier of the agent that the alias belongs to.""" - - agent_alias_id: str - """The unique identifier of the alias that was deleted.""" - - agent_alias_status: str - """The status of the alias.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_AGENT_ALIAS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DELETE_AGENT_ALIAS_OUTPUT.members["agentId"], self.agent_id - ) - serializer.write_string( - _SCHEMA_DELETE_AGENT_ALIAS_OUTPUT.members["agentAliasId"], - self.agent_alias_id, - ) - serializer.write_string( - _SCHEMA_DELETE_AGENT_ALIAS_OUTPUT.members["agentAliasStatus"], - self.agent_alias_status, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_id"] = de.read_string( - _SCHEMA_DELETE_AGENT_ALIAS_OUTPUT.members["agentId"] - ) - - case 1: - kwargs["agent_alias_id"] = de.read_string( - _SCHEMA_DELETE_AGENT_ALIAS_OUTPUT.members["agentAliasId"] - ) - - case 2: - kwargs["agent_alias_status"] = AgentAliasStatus( - de.read_string( - _SCHEMA_DELETE_AGENT_ALIAS_OUTPUT.members[ - "agentAliasStatus" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_AGENT_ALIAS_OUTPUT, consumer=_consumer) - if "agent_id" not in kwargs: - kwargs["agent_id"] = "" - if "agent_alias_id" not in kwargs: - kwargs["agent_alias_id"] = "" - if "agent_alias_status" not in kwargs: - kwargs["agent_alias_status"] = AgentAliasStatus._corrected("") - return kwargs - - -DELETE_AGENT_ALIAS = APIOperation( - input=DeleteAgentAliasInput, - output=DeleteAgentAliasOutput, - schema=_SCHEMA_DELETE_AGENT_ALIAS, - input_schema=_SCHEMA_DELETE_AGENT_ALIAS_INPUT, - output_schema=_SCHEMA_DELETE_AGENT_ALIAS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetAgentAliasInput: - """Dataclass for GetAgentAliasInput structure.""" - - agent_id: str | None = None - """ - The unique identifier of the agent to which the alias to get information - belongs. - """ - - agent_alias_id: str | None = None - """The unique identifier of the alias for which to get information.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_AGENT_ALIAS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.agent_id is not None: - serializer.write_string( - _SCHEMA_GET_AGENT_ALIAS_INPUT.members["agentId"], self.agent_id - ) - - if self.agent_alias_id is not None: - serializer.write_string( - _SCHEMA_GET_AGENT_ALIAS_INPUT.members["agentAliasId"], - self.agent_alias_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_id"] = de.read_string( - _SCHEMA_GET_AGENT_ALIAS_INPUT.members["agentId"] - ) - - case 1: - kwargs["agent_alias_id"] = de.read_string( - _SCHEMA_GET_AGENT_ALIAS_INPUT.members["agentAliasId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_AGENT_ALIAS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetAgentAliasOutput: - """Dataclass for GetAgentAliasOutput structure.""" - - agent_alias: AgentAlias - """Contains information about the alias.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_AGENT_ALIAS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_AGENT_ALIAS_OUTPUT.members["agentAlias"], self.agent_alias - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_alias"] = AgentAlias.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_AGENT_ALIAS_OUTPUT, consumer=_consumer) - if "agent_alias" not in kwargs: - kwargs["agent_alias"] = AgentAlias._smithy_default() - return kwargs - - -GET_AGENT_ALIAS = APIOperation( - input=GetAgentAliasInput, - output=GetAgentAliasOutput, - schema=_SCHEMA_GET_AGENT_ALIAS, - input_schema=_SCHEMA_GET_AGENT_ALIAS_INPUT, - output_schema=_SCHEMA_GET_AGENT_ALIAS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListAgentAliasesInput: - """Dataclass for ListAgentAliasesInput structure.""" - - agent_id: str | None = None - """The unique identifier of the agent.""" - - max_results: int | None = None - """ - The maximum number of results to return in the response. If the total - number of results is greater than this value, use the token returned in - the response in the `nextToken` field when making another request to - return the next batch of results. - """ - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, enter the token returned in the `nextToken` - field in the response in this field to return the next batch of results. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_AGENT_ALIASES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.agent_id is not None: - serializer.write_string( - _SCHEMA_LIST_AGENT_ALIASES_INPUT.members["agentId"], self.agent_id - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_AGENT_ALIASES_INPUT.members["maxResults"], self.max_results - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_AGENT_ALIASES_INPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_id"] = de.read_string( - _SCHEMA_LIST_AGENT_ALIASES_INPUT.members["agentId"] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_AGENT_ALIASES_INPUT.members["maxResults"] - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_AGENT_ALIASES_INPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_AGENT_ALIASES_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ListAgentAliasesOutput: - """Dataclass for ListAgentAliasesOutput structure.""" - - agent_alias_summaries: list[AgentAliasSummary] - """ - A list of objects, each of which contains information about an alias of - the agent. - """ - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, use this token when making another request in - the `nextToken` field to return the next batch of results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_AGENT_ALIASES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_agent_alias_summaries( - serializer, - _SCHEMA_LIST_AGENT_ALIASES_OUTPUT.members["agentAliasSummaries"], - self.agent_alias_summaries, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_AGENT_ALIASES_OUTPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_alias_summaries"] = ( - _deserialize_agent_alias_summaries( - de, - _SCHEMA_LIST_AGENT_ALIASES_OUTPUT.members[ - "agentAliasSummaries" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_AGENT_ALIASES_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_AGENT_ALIASES_OUTPUT, consumer=_consumer) - if "agent_alias_summaries" not in kwargs: - kwargs["agent_alias_summaries"] = [] - return kwargs - - -LIST_AGENT_ALIASES = APIOperation( - input=ListAgentAliasesInput, - output=ListAgentAliasesOutput, - schema=_SCHEMA_LIST_AGENT_ALIASES, - input_schema=_SCHEMA_LIST_AGENT_ALIASES_INPUT, - output_schema=_SCHEMA_LIST_AGENT_ALIASES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateAgentAliasInput: - """Dataclass for UpdateAgentAliasInput structure.""" - - agent_id: str | None = None - """The unique identifier of the agent.""" - - agent_alias_id: str | None = None - """The unique identifier of the alias.""" - - agent_alias_name: str | None = None - """Specifies a new name for the alias.""" - - description: str | None = None - """Specifies a new description for the alias.""" - - routing_configuration: list[AgentAliasRoutingConfigurationListItem] | None = None - """Contains details about the routing configuration of the alias.""" - - alias_invocation_state: str | None = None - """ - The invocation state for the agent alias. To pause the agent alias, set - the value to `REJECT_INVOCATIONS`. To start the agent alias running - again, set the value to `ACCEPT_INVOCATIONS`. Use the `GetAgentAlias`, - or `ListAgentAliases`, operation to get the invocation state of an agent - alias. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_AGENT_ALIAS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.agent_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_AGENT_ALIAS_INPUT.members["agentId"], self.agent_id - ) - - if self.agent_alias_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_AGENT_ALIAS_INPUT.members["agentAliasId"], - self.agent_alias_id, - ) - - if self.agent_alias_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_AGENT_ALIAS_INPUT.members["agentAliasName"], - self.agent_alias_name, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_AGENT_ALIAS_INPUT.members["description"], - self.description, - ) - - if self.routing_configuration is not None: - _serialize_agent_alias_routing_configuration( - serializer, - _SCHEMA_UPDATE_AGENT_ALIAS_INPUT.members["routingConfiguration"], - self.routing_configuration, - ) - - if self.alias_invocation_state is not None: - serializer.write_string( - _SCHEMA_UPDATE_AGENT_ALIAS_INPUT.members["aliasInvocationState"], - self.alias_invocation_state, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_id"] = de.read_string( - _SCHEMA_UPDATE_AGENT_ALIAS_INPUT.members["agentId"] - ) - - case 1: - kwargs["agent_alias_id"] = de.read_string( - _SCHEMA_UPDATE_AGENT_ALIAS_INPUT.members["agentAliasId"] - ) - - case 2: - kwargs["agent_alias_name"] = de.read_string( - _SCHEMA_UPDATE_AGENT_ALIAS_INPUT.members["agentAliasName"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_AGENT_ALIAS_INPUT.members["description"] - ) - - case 4: - kwargs["routing_configuration"] = ( - _deserialize_agent_alias_routing_configuration( - de, - _SCHEMA_UPDATE_AGENT_ALIAS_INPUT.members[ - "routingConfiguration" - ], - ) - ) - - case 5: - kwargs["alias_invocation_state"] = AliasInvocationState( - de.read_string( - _SCHEMA_UPDATE_AGENT_ALIAS_INPUT.members[ - "aliasInvocationState" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_AGENT_ALIAS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateAgentAliasOutput: - """Dataclass for UpdateAgentAliasOutput structure.""" - - agent_alias: AgentAlias - """Contains details about the alias that was updated.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_AGENT_ALIAS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_UPDATE_AGENT_ALIAS_OUTPUT.members["agentAlias"], self.agent_alias - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_alias"] = AgentAlias.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_AGENT_ALIAS_OUTPUT, consumer=_consumer) - if "agent_alias" not in kwargs: - kwargs["agent_alias"] = AgentAlias._smithy_default() - return kwargs - - -UPDATE_AGENT_ALIAS = APIOperation( - input=UpdateAgentAliasInput, - output=UpdateAgentAliasOutput, - schema=_SCHEMA_UPDATE_AGENT_ALIAS, - input_schema=_SCHEMA_UPDATE_AGENT_ALIAS_INPUT, - output_schema=_SCHEMA_UPDATE_AGENT_ALIAS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrockagent#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class VpcProtocol(UnknownEnumMixin, StrEnum): - """ - The protocol used to connect to the resource. Valid values: - - - `HTTP` -- Connect over plaintext HTTP. - - - `HTTPS` -- Connect over TLS. - """ - - HTTP = "HTTP" - HTTPS = "HTTPS" - - -class VpcResolutionMode(UnknownEnumMixin, StrEnum): - """ - Controls how a domain-name resource target is resolved. This applies - only when the target is a domain name; it has no effect for IP-address - targets. In all cases the resolved address must be reachable from inside - the VPC. Valid values: - - - `IN_VPC` (default, recommended) -- The target domain name is resolved - privately, using the DNS resolvers of the VPC. - - - `PUBLIC` -- The target domain name is resolved against public DNS - resolvers, for the uncommon case where the name must resolve through - public DNS but the resulting address remains reachable from the VPC. - """ - - PUBLIC = "PUBLIC" - IN_VPC = "IN_VPC" - - -def _serialize_subnet_id_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_subnet_id_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CreateVpcConfigurationInput: - """Dataclass for CreateVpcConfigurationInput structure.""" - - knowledge_base_id: str | None = None - """ - The unique identifier of the knowledge base to associate this VPC - configuration with. - """ - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the operation - completes no more than one time. If this token matches a previous - request, the service ignores the request but does not return an error. - """ - - vpc_id: str | None = None - """ - The identifier of the VPC that the knowledge base connects through to - reach the resource. - """ - - subnet_ids: list[str] | None = None - """ - The subnets, in the VPC identified by `vpcId`, that the knowledge base - uses to connect to the resource. - """ - - resource_target: str | None = None - """ - The private IPv4 address or DNS name of the resource you want the - knowledge base to reach. The target must be privately reachable from - inside your VPC, such as an internal load balancer or a private IP. The - following are not supported: - - - Internet-facing endpoints - - - Loopback addresses - - - Link-local addresses - - - Wildcard addresses - - - Multicast addresses - - - IPv6 literals - """ - - port: int | None = None - """The port on which to reach the resource.""" - - protocol: str | None = None - """ - The protocol used to connect to the resource. Specify `HTTP` for - plaintext or `HTTPS` for TLS. When you specify `HTTPS`, you must also - provide `tlsServerName`. - """ - - resolution_mode: str | None = None - """ - Controls how a domain-name `resourceTarget` is resolved. This applies - only when the target is a domain name; it has no effect for IP-address - targets, which have no name to resolve. In all cases the resolved - address must be reachable from inside your VPC. Valid values: - - - `IN_VPC` (default, recommended) -- The target domain name is resolved - privately, using the DNS resolvers of the VPC, such as private Route - 53 hosted zones or on-premises DNS reachable from the VPC. Use this - for targets that are private to your VPC, such as internal load - balancers, private hosted-zone names, or on-premises hosts. - - - `PUBLIC` -- The target domain name is resolved against public DNS - resolvers. Select this only when the target's domain name must be - resolved through public DNS and the resulting address is still - reachable from the VPC, an uncommon split-horizon configuration. If - you are unsure, use `IN_VPC`. - """ - - host_header: str | None = None - """ - An optional HTTP `Host` header value to send when invoking the resource. - Set this only if your resource (or an upstream router or ingress) routes - by the `Host` header and that host differs from the target. This setting - is independent of `tlsServerName`. - """ - - tls_server_name: str | None = None - """ - The expected TLS server name. The service matches this value against the - Subject Alternative Names on your resource's TLS certificate during - invocation. This field is required when `protocol` is `HTTPS`. Set it to - a hostname on your certificate, such as `app.internal.example.com`. You - can use a single leftmost wildcard, such as `*.example.com`. The value - must be a hostname without a port. - """ - - name: str | None = None - """ - An optional human-readable name for the VPC configuration. If you don't - specify a name, the VPC configuration has no name. - """ - - description: str | None = None - """ - An optional description of the VPC configuration. If you don't specify - a description, the VPC configuration has no description. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_VPC_CONFIGURATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.knowledge_base_id is not None: - serializer.write_string( - _SCHEMA_CREATE_VPC_CONFIGURATION_INPUT.members["knowledgeBaseId"], - self.knowledge_base_id, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_VPC_CONFIGURATION_INPUT.members["clientToken"], - self.client_token, - ) - - if self.vpc_id is not None: - serializer.write_string( - _SCHEMA_CREATE_VPC_CONFIGURATION_INPUT.members["vpcId"], self.vpc_id - ) - - if self.subnet_ids is not None: - _serialize_subnet_id_list( - serializer, - _SCHEMA_CREATE_VPC_CONFIGURATION_INPUT.members["subnetIds"], - self.subnet_ids, - ) - - if self.resource_target is not None: - serializer.write_string( - _SCHEMA_CREATE_VPC_CONFIGURATION_INPUT.members["resourceTarget"], - self.resource_target, - ) - - if self.port is not None: - serializer.write_integer( - _SCHEMA_CREATE_VPC_CONFIGURATION_INPUT.members["port"], self.port - ) - - if self.protocol is not None: - serializer.write_string( - _SCHEMA_CREATE_VPC_CONFIGURATION_INPUT.members["protocol"], - self.protocol, - ) - - if self.resolution_mode is not None: - serializer.write_string( - _SCHEMA_CREATE_VPC_CONFIGURATION_INPUT.members["resolutionMode"], - self.resolution_mode, - ) - - if self.host_header is not None: - serializer.write_string( - _SCHEMA_CREATE_VPC_CONFIGURATION_INPUT.members["hostHeader"], - self.host_header, - ) - - if self.tls_server_name is not None: - serializer.write_string( - _SCHEMA_CREATE_VPC_CONFIGURATION_INPUT.members["tlsServerName"], - self.tls_server_name, - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_VPC_CONFIGURATION_INPUT.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_VPC_CONFIGURATION_INPUT.members["description"], - self.description, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["knowledge_base_id"] = de.read_string( - _SCHEMA_CREATE_VPC_CONFIGURATION_INPUT.members[ - "knowledgeBaseId" - ] - ) - - case 1: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_VPC_CONFIGURATION_INPUT.members["clientToken"] - ) - - case 2: - kwargs["vpc_id"] = de.read_string( - _SCHEMA_CREATE_VPC_CONFIGURATION_INPUT.members["vpcId"] - ) - - case 3: - kwargs["subnet_ids"] = _deserialize_subnet_id_list( - de, _SCHEMA_CREATE_VPC_CONFIGURATION_INPUT.members["subnetIds"] - ) - - case 4: - kwargs["resource_target"] = de.read_string( - _SCHEMA_CREATE_VPC_CONFIGURATION_INPUT.members["resourceTarget"] - ) - - case 5: - kwargs["port"] = de.read_integer( - _SCHEMA_CREATE_VPC_CONFIGURATION_INPUT.members["port"] - ) - - case 6: - kwargs["protocol"] = VpcProtocol( - de.read_string( - _SCHEMA_CREATE_VPC_CONFIGURATION_INPUT.members["protocol"] - ) - ) - - case 7: - kwargs["resolution_mode"] = VpcResolutionMode( - de.read_string( - _SCHEMA_CREATE_VPC_CONFIGURATION_INPUT.members[ - "resolutionMode" - ] - ) - ) - - case 8: - kwargs["host_header"] = de.read_string( - _SCHEMA_CREATE_VPC_CONFIGURATION_INPUT.members["hostHeader"] - ) - - case 9: - kwargs["tls_server_name"] = de.read_string( - _SCHEMA_CREATE_VPC_CONFIGURATION_INPUT.members["tlsServerName"] - ) - - case 10: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_VPC_CONFIGURATION_INPUT.members["name"] - ) - - case 11: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_VPC_CONFIGURATION_INPUT.members["description"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_VPC_CONFIGURATION_INPUT, consumer=_consumer - ) - return kwargs - - -class VpcConfigurationStatus(UnknownEnumMixin, StrEnum): - """ - The lifecycle status of a VPC configuration. Valid values: - - - `CREATING` -- The configuration is being created. - - - `CREATED` -- The configuration is ready to use. - - - `DELETING` -- The configuration is being deleted. - - - `CREATE_FAILED` -- Creation failed. See `statusMessage` for the cause. - - - `DELETE_FAILED` -- Deletion failed. See `statusMessage` for the cause. - """ - - CREATING = "CREATING" - CREATED = "CREATED" - DELETING = "DELETING" - CREATE_FAILED = "CREATE_FAILED" - DELETE_FAILED = "DELETE_FAILED" - - -@dataclass(kw_only=True) -class CreateVpcConfigurationOutput: - """Dataclass for CreateVpcConfigurationOutput structure.""" - - vpc_configuration_id: str - """The unique identifier of the VPC configuration that was created.""" - - status: str - """ - The current status of the VPC configuration. Immediately after creation - this is `CREATING`. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_VPC_CONFIGURATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_VPC_CONFIGURATION_OUTPUT.members["vpcConfigurationId"], - self.vpc_configuration_id, - ) - serializer.write_string( - _SCHEMA_CREATE_VPC_CONFIGURATION_OUTPUT.members["status"], self.status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["vpc_configuration_id"] = de.read_string( - _SCHEMA_CREATE_VPC_CONFIGURATION_OUTPUT.members[ - "vpcConfigurationId" - ] - ) - - case 1: - kwargs["status"] = VpcConfigurationStatus( - de.read_string( - _SCHEMA_CREATE_VPC_CONFIGURATION_OUTPUT.members["status"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_VPC_CONFIGURATION_OUTPUT, consumer=_consumer - ) - if "vpc_configuration_id" not in kwargs: - kwargs["vpc_configuration_id"] = "" - if "status" not in kwargs: - kwargs["status"] = VpcConfigurationStatus._corrected("") - return kwargs - - -CREATE_VPC_CONFIGURATION = APIOperation( - input=CreateVpcConfigurationInput, - output=CreateVpcConfigurationOutput, - schema=_SCHEMA_CREATE_VPC_CONFIGURATION, - input_schema=_SCHEMA_CREATE_VPC_CONFIGURATION_INPUT, - output_schema=_SCHEMA_CREATE_VPC_CONFIGURATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrockagent#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class DataDeletionPolicy(UnknownEnumMixin, StrEnum): - RETAIN = "RETAIN" - DELETE = "DELETE" - - -def _serialize_filter_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_filter_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class PatternObjectFilter: - """ - The specific filters applied to your data source content. You can filter - out or include certain content. - """ - - object_type: str = field(repr=False) - """The supported object type or content type of the data source.""" - - inclusion_filters: list[str] | None = field(repr=False, default=None) - """ - A list of one or more inclusion regular expression patterns to include - certain object types that adhere to the pattern. If you specify an - inclusion and exclusion filter/pattern and both match a document, the - exclusion filter takes precedence and the document isn't crawled. - """ - - exclusion_filters: list[str] | None = field(repr=False, default=None) - """ - A list of one or more exclusion regular expression patterns to exclude - certain object types that adhere to the pattern. If you specify an - inclusion and exclusion filter/pattern and both match a document, the - exclusion filter takes precedence and the document isn't crawled. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PATTERN_OBJECT_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_PATTERN_OBJECT_FILTER.members["objectType"], self.object_type - ) - if self.inclusion_filters is not None: - _serialize_filter_list( - serializer, - _SCHEMA_PATTERN_OBJECT_FILTER.members["inclusionFilters"], - self.inclusion_filters, - ) - - if self.exclusion_filters is not None: - _serialize_filter_list( - serializer, - _SCHEMA_PATTERN_OBJECT_FILTER.members["exclusionFilters"], - self.exclusion_filters, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["object_type"] = de.read_string( - _SCHEMA_PATTERN_OBJECT_FILTER.members["objectType"] - ) - - case 1: - kwargs["inclusion_filters"] = _deserialize_filter_list( - de, _SCHEMA_PATTERN_OBJECT_FILTER.members["inclusionFilters"] - ) - - case 2: - kwargs["exclusion_filters"] = _deserialize_filter_list( - de, _SCHEMA_PATTERN_OBJECT_FILTER.members["exclusionFilters"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PATTERN_OBJECT_FILTER, consumer=_consumer) - if "object_type" not in kwargs: - kwargs["object_type"] = "" - return kwargs - - -def _serialize_pattern_object_filter_list( - serializer: ShapeSerializer, schema: Schema, value: list[PatternObjectFilter] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_pattern_object_filter_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[PatternObjectFilter]: - result: list[PatternObjectFilter] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(PatternObjectFilter.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class PatternObjectFilterConfiguration: - """ - The configuration of filtering certain objects or content types of the - data source. - """ - - filters: list[PatternObjectFilter] = field(repr=False) - """ - The configuration of specific filters applied to your data source - content. You can filter out or include certain content. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PATTERN_OBJECT_FILTER_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_pattern_object_filter_list( - serializer, - _SCHEMA_PATTERN_OBJECT_FILTER_CONFIGURATION.members["filters"], - self.filters, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["filters"] = _deserialize_pattern_object_filter_list( - de, - _SCHEMA_PATTERN_OBJECT_FILTER_CONFIGURATION.members["filters"], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PATTERN_OBJECT_FILTER_CONFIGURATION, consumer=_consumer - ) - if "filters" not in kwargs: - kwargs["filters"] = [] - return kwargs - - -class CrawlFilterConfigurationType(UnknownEnumMixin, StrEnum): - PATTERN = "PATTERN" - - -@dataclass(kw_only=True) -class CrawlFilterConfiguration: - """ - The configuration of filtering the data source content. For example, - configuring regular expression patterns to include or exclude certain - content. - """ - - type: str - """ - The type of filtering that you want to apply to certain objects or - content of the data source. For example, the `PATTERN` type is regular - expression patterns you can apply to filter your content. - """ - - pattern_object_filter: PatternObjectFilterConfiguration | None = None - """ - The configuration of filtering certain objects or content types of the - data source. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CRAWL_FILTER_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CRAWL_FILTER_CONFIGURATION.members["type"], self.type - ) - if self.pattern_object_filter is not None: - serializer.write_struct( - _SCHEMA_CRAWL_FILTER_CONFIGURATION.members["patternObjectFilter"], - self.pattern_object_filter, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = CrawlFilterConfigurationType( - de.read_string( - _SCHEMA_CRAWL_FILTER_CONFIGURATION.members["type"] - ) - ) - - case 1: - kwargs["pattern_object_filter"] = ( - PatternObjectFilterConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CRAWL_FILTER_CONFIGURATION, consumer=_consumer) - if "type" not in kwargs: - kwargs["type"] = CrawlFilterConfigurationType._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class ConfluenceCrawlerConfiguration: - """ - The configuration of the Confluence content. For example, configuring - specific types of Confluence content. - """ - - filter_configuration: CrawlFilterConfiguration | None = None - """ - The configuration of filtering the Confluence content. For example, - configuring regular expression patterns to include or exclude certain - content. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONFLUENCE_CRAWLER_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.filter_configuration is not None: - serializer.write_struct( - _SCHEMA_CONFLUENCE_CRAWLER_CONFIGURATION.members["filterConfiguration"], - self.filter_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["filter_configuration"] = ( - CrawlFilterConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CONFLUENCE_CRAWLER_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -class ConfluenceAuthType(UnknownEnumMixin, StrEnum): - BASIC = "BASIC" - OAUTH2_CLIENT_CREDENTIALS = "OAUTH2_CLIENT_CREDENTIALS" - - -class ConfluenceHostType(UnknownEnumMixin, StrEnum): - SAAS = "SAAS" - - -@dataclass(kw_only=True) -class ConfluenceSourceConfiguration: - """The endpoint information to connect to your Confluence data source.""" - - host_url: str - """The Confluence host URL or instance URL.""" - - host_type: str - """The supported host type, whether online/cloud or server/on-premises.""" - - auth_type: str - """ - The supported authentication type to authenticate and connect to your - Confluence instance. - """ - - credentials_secret_arn: str - """ - The Amazon Resource Name of an Secrets Manager secret that stores your - authentication credentials for your Confluence instance URL. For more - information on the key-value pairs that must be included in your secret, - depending on your authentication type, see [Confluence connection - configuration](https://docs.aws.amazon.com/bedrock/latest/userguide/confluence-data-source-connector.html#configuration-confluence-connector). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONFLUENCE_SOURCE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CONFLUENCE_SOURCE_CONFIGURATION.members["hostUrl"], self.host_url - ) - serializer.write_string( - _SCHEMA_CONFLUENCE_SOURCE_CONFIGURATION.members["hostType"], self.host_type - ) - serializer.write_string( - _SCHEMA_CONFLUENCE_SOURCE_CONFIGURATION.members["authType"], self.auth_type - ) - serializer.write_string( - _SCHEMA_CONFLUENCE_SOURCE_CONFIGURATION.members["credentialsSecretArn"], - self.credentials_secret_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["host_url"] = de.read_string( - _SCHEMA_CONFLUENCE_SOURCE_CONFIGURATION.members["hostUrl"] - ) - - case 1: - kwargs["host_type"] = ConfluenceHostType( - de.read_string( - _SCHEMA_CONFLUENCE_SOURCE_CONFIGURATION.members["hostType"] - ) - ) - - case 2: - kwargs["auth_type"] = ConfluenceAuthType( - de.read_string( - _SCHEMA_CONFLUENCE_SOURCE_CONFIGURATION.members["authType"] - ) - ) - - case 3: - kwargs["credentials_secret_arn"] = de.read_string( - _SCHEMA_CONFLUENCE_SOURCE_CONFIGURATION.members[ - "credentialsSecretArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CONFLUENCE_SOURCE_CONFIGURATION, consumer=_consumer - ) - if "host_url" not in kwargs: - kwargs["host_url"] = "" - if "host_type" not in kwargs: - kwargs["host_type"] = ConfluenceHostType._corrected("") - if "auth_type" not in kwargs: - kwargs["auth_type"] = ConfluenceAuthType._corrected("") - if "credentials_secret_arn" not in kwargs: - kwargs["credentials_secret_arn"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls( - host_url="", - host_type=ConfluenceHostType._corrected(""), - auth_type=ConfluenceAuthType._corrected(""), - credentials_secret_arn="", - ) - - -@dataclass(kw_only=True) -class ConfluenceDataSourceConfiguration: - """ - The configuration information to connect to Confluence as your data - source for self-managed knowledge bases. - """ - - source_configuration: ConfluenceSourceConfiguration - """The endpoint information to connect to your Confluence data source.""" - - crawler_configuration: ConfluenceCrawlerConfiguration | None = None - """ - The configuration of the Confluence content. For example, configuring - specific types of Confluence content. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONFLUENCE_DATA_SOURCE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CONFLUENCE_DATA_SOURCE_CONFIGURATION.members["sourceConfiguration"], - self.source_configuration, - ) - if self.crawler_configuration is not None: - serializer.write_struct( - _SCHEMA_CONFLUENCE_DATA_SOURCE_CONFIGURATION.members[ - "crawlerConfiguration" - ], - self.crawler_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["source_configuration"] = ( - ConfluenceSourceConfiguration.deserialize(de) - ) - - case 1: - kwargs["crawler_configuration"] = ( - ConfluenceCrawlerConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CONFLUENCE_DATA_SOURCE_CONFIGURATION, consumer=_consumer - ) - if "source_configuration" not in kwargs: - kwargs["source_configuration"] = ( - ConfluenceSourceConfiguration._smithy_default() - ) - return kwargs - - -class EnabledOrDisabledState(UnknownEnumMixin, StrEnum): - ENABLED = "ENABLED" - DISABLED = "DISABLED" - - -@dataclass(kw_only=True) -class DeletionProtectionConfiguration: - """Configuration for deletion protection.""" - - deletion_protection_status: str - """Enable or disable deletion protection for the connector.""" - - deletion_protection_threshold: int = 15 - """ - The threshold is the maximum percentage of documents that a sync job can - delete from your index. If a sync would delete more than this - percentage, the sync skips its delete phase, leaving your indexed - documents in place. Not supported for the Custom connector. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETION_PROTECTION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DELETION_PROTECTION_CONFIGURATION.members[ - "deletionProtectionStatus" - ], - self.deletion_protection_status, - ) - serializer.write_integer( - _SCHEMA_DELETION_PROTECTION_CONFIGURATION.members[ - "deletionProtectionThreshold" - ], - self.deletion_protection_threshold, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["deletion_protection_status"] = EnabledOrDisabledState( - de.read_string( - _SCHEMA_DELETION_PROTECTION_CONFIGURATION.members[ - "deletionProtectionStatus" - ] - ) - ) - - case 1: - kwargs["deletion_protection_threshold"] = de.read_integer( - _SCHEMA_DELETION_PROTECTION_CONFIGURATION.members[ - "deletionProtectionThreshold" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETION_PROTECTION_CONFIGURATION, consumer=_consumer - ) - if "deletion_protection_status" not in kwargs: - kwargs["deletion_protection_status"] = EnabledOrDisabledState._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class AudioExtractionConfiguration: - """Configuration for audio extraction.""" - - audio_extraction_status: str - """Whether audio extraction is enabled or disabled.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUDIO_EXTRACTION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AUDIO_EXTRACTION_CONFIGURATION.members["audioExtractionStatus"], - self.audio_extraction_status, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["audio_extraction_status"] = EnabledOrDisabledState( - de.read_string( - _SCHEMA_AUDIO_EXTRACTION_CONFIGURATION.members[ - "audioExtractionStatus" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUDIO_EXTRACTION_CONFIGURATION, consumer=_consumer - ) - if "audio_extraction_status" not in kwargs: - kwargs["audio_extraction_status"] = EnabledOrDisabledState._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class ImageExtractionConfiguration: - """Configuration for image extraction.""" - - image_extraction_status: str - """Whether image extraction is enabled or disabled.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IMAGE_EXTRACTION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_IMAGE_EXTRACTION_CONFIGURATION.members["imageExtractionStatus"], - self.image_extraction_status, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["image_extraction_status"] = EnabledOrDisabledState( - de.read_string( - _SCHEMA_IMAGE_EXTRACTION_CONFIGURATION.members[ - "imageExtractionStatus" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_IMAGE_EXTRACTION_CONFIGURATION, consumer=_consumer - ) - if "image_extraction_status" not in kwargs: - kwargs["image_extraction_status"] = EnabledOrDisabledState._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class VideoExtractionConfiguration: - """Configuration for video extraction.""" - - video_extraction_status: str - """Whether video extraction is enabled or disabled.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VIDEO_EXTRACTION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_VIDEO_EXTRACTION_CONFIGURATION.members["videoExtractionStatus"], - self.video_extraction_status, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["video_extraction_status"] = EnabledOrDisabledState( - de.read_string( - _SCHEMA_VIDEO_EXTRACTION_CONFIGURATION.members[ - "videoExtractionStatus" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_VIDEO_EXTRACTION_CONFIGURATION, consumer=_consumer - ) - if "video_extraction_status" not in kwargs: - kwargs["video_extraction_status"] = EnabledOrDisabledState._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class MediaExtractionConfiguration: - """Configuration for media extraction settings.""" - - image_extraction_configuration: ImageExtractionConfiguration | None = None - """Configuration for image extraction.""" - - audio_extraction_configuration: AudioExtractionConfiguration | None = None - """Configuration for audio extraction.""" - - video_extraction_configuration: VideoExtractionConfiguration | None = None - """Configuration for video extraction.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDIA_EXTRACTION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.image_extraction_configuration is not None: - serializer.write_struct( - _SCHEMA_MEDIA_EXTRACTION_CONFIGURATION.members[ - "imageExtractionConfiguration" - ], - self.image_extraction_configuration, - ) - - if self.audio_extraction_configuration is not None: - serializer.write_struct( - _SCHEMA_MEDIA_EXTRACTION_CONFIGURATION.members[ - "audioExtractionConfiguration" - ], - self.audio_extraction_configuration, - ) - - if self.video_extraction_configuration is not None: - serializer.write_struct( - _SCHEMA_MEDIA_EXTRACTION_CONFIGURATION.members[ - "videoExtractionConfiguration" - ], - self.video_extraction_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["image_extraction_configuration"] = ( - ImageExtractionConfiguration.deserialize(de) - ) - - case 1: - kwargs["audio_extraction_configuration"] = ( - AudioExtractionConfiguration.deserialize(de) - ) - - case 2: - kwargs["video_extraction_configuration"] = ( - VideoExtractionConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MEDIA_EXTRACTION_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DailySchedule: - """ - A daily sync. The run time is system-chosen (off-peak) and not - configurable. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DAILY_SCHEDULE, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DAILY_SCHEDULE, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class LastDayOfMonth: - """ - The option to run the monthly sync on the last calendar day of each - month. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LAST_DAY_OF_MONTH, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LAST_DAY_OF_MONTH, consumer=_consumer) - return kwargs - - -@dataclass -class DayOfMonthDayNumber: - """ - A specific day of the month, from 1 to 28. Values are capped at 28, so a - monthly sync runs in every month, including February. - """ - - value: int - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DAY_OF_MONTH, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer(_SCHEMA_DAY_OF_MONTH.members["dayNumber"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_integer(_SCHEMA_DAY_OF_MONTH.members["dayNumber"]) - ) - - -@dataclass -class DayOfMonthLastDayOfMonth: - """ - Set this option to run the monthly sync on the last calendar day of each - month. - """ - - value: LastDayOfMonth - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DAY_OF_MONTH, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DAY_OF_MONTH.members["lastDayOfMonth"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=LastDayOfMonth.deserialize(deserializer)) - - -@dataclass -class DayOfMonthUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -DayOfMonth = Union[DayOfMonthDayNumber | DayOfMonthLastDayOfMonth | DayOfMonthUnknown] -""" -The day of the month on which a monthly sync runs. Specify exactly one -of `dayNumber` or `lastDayOfMonth`. -""" - - -class _DayOfMonthDeserializer: - _result: DayOfMonth | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> DayOfMonth: - self._result = None - deserializer.read_struct(_SCHEMA_DAY_OF_MONTH, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(DayOfMonthDayNumber.deserialize(de)) - - case 1: - self._set_result(DayOfMonthLastDayOfMonth.deserialize(de)) - - case _: - self._set_result(DayOfMonthUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: DayOfMonth) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class MonthlySchedule: - """A monthly sync on a specified day of the month.""" - - day_of_month: DayOfMonth - """The day of the month on which the monthly sync runs.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MONTHLY_SCHEDULE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MONTHLY_SCHEDULE.members["dayOfMonth"], self.day_of_month - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["day_of_month"] = _DayOfMonthDeserializer().deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MONTHLY_SCHEDULE, consumer=_consumer) - if "day_of_month" not in kwargs: - kwargs["day_of_month"] = DayOfMonthUnknown(tag="") - return kwargs - - -class DayOfWeek(UnknownEnumMixin, StrEnum): - """ - The day of the week on which a weekly sync runs. Valid values are the - standard English day names, for example, MONDAY or TUESDAY. - """ - - SUNDAY = "SUNDAY" - MONDAY = "MONDAY" - TUESDAY = "TUESDAY" - WEDNESDAY = "WEDNESDAY" - THURSDAY = "THURSDAY" - FRIDAY = "FRIDAY" - SATURDAY = "SATURDAY" - - -@dataclass(kw_only=True) -class WeeklySchedule: - """A weekly sync on a specified day of the week.""" - - day_of_week: str - """The day of the week on which the weekly sync runs.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_WEEKLY_SCHEDULE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_WEEKLY_SCHEDULE.members["dayOfWeek"], self.day_of_week - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["day_of_week"] = DayOfWeek( - de.read_string(_SCHEMA_WEEKLY_SCHEDULE.members["dayOfWeek"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_WEEKLY_SCHEDULE, consumer=_consumer) - if "day_of_week" not in kwargs: - kwargs["day_of_week"] = DayOfWeek._corrected("") - return kwargs - - -@dataclass -class SyncScheduleDaily: - """ - A daily sync that runs once a day at a system-chosen off-peak time. The - run time is not configurable. - """ - - value: DailySchedule - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SYNC_SCHEDULE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SYNC_SCHEDULE.members["daily"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=DailySchedule.deserialize(deserializer)) - - -@dataclass -class SyncScheduleWeekly: - """A weekly sync that runs once a week on the specified day of the week.""" - - value: WeeklySchedule - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SYNC_SCHEDULE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SYNC_SCHEDULE.members["weekly"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=WeeklySchedule.deserialize(deserializer)) - - -@dataclass -class SyncScheduleMonthly: - """A monthly sync that runs once a month on the specified day of the month.""" - - value: MonthlySchedule - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SYNC_SCHEDULE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SYNC_SCHEDULE.members["monthly"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=MonthlySchedule.deserialize(deserializer)) - - -@dataclass -class SyncScheduleUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -SyncSchedule = Union[ - SyncScheduleDaily | SyncScheduleWeekly | SyncScheduleMonthly | SyncScheduleUnknown -] -""" -The recurring schedule on which a managed knowledge base connector -automatically syncs its data source. Specify exactly one of `daily`, -`weekly`, or `monthly`. -""" - - -class _SyncScheduleDeserializer: - _result: SyncSchedule | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> SyncSchedule: - self._result = None - deserializer.read_struct(_SCHEMA_SYNC_SCHEDULE, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(SyncScheduleDaily.deserialize(de)) - - case 1: - self._set_result(SyncScheduleWeekly.deserialize(de)) - - case 2: - self._set_result(SyncScheduleMonthly.deserialize(de)) - - case _: - self._set_result(SyncScheduleUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: SyncSchedule) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class ManagedKnowledgeBaseConnectorConfiguration: - """Configuration for managed knowledge base connector data sources.""" - - deletion_protection_configuration: DeletionProtectionConfiguration | None = None - """A safeguard against accidental bulk deletion of indexed content.""" - - media_extraction_configuration: MediaExtractionConfiguration | None = None - """ - Configuration for extracting media (images, audio, video) from data - source files. - """ - - connector_parameters: Document | None = None - """ - Connector-specific parameters. For more information, see [Connect a data - source](https://docs.aws.amazon.com/bedrock/latest/userguide/kb-managed-connect-ds.html). - """ - - sync_schedule: SyncSchedule | None = None - """ - The recurring schedule on which the connector automatically syncs this - data source. If not specified, the data source is not synced - automatically and you start each sync yourself. Not supported for the - Custom connector. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MANAGED_KNOWLEDGE_BASE_CONNECTOR_CONFIGURATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.deletion_protection_configuration is not None: - serializer.write_struct( - _SCHEMA_MANAGED_KNOWLEDGE_BASE_CONNECTOR_CONFIGURATION.members[ - "deletionProtectionConfiguration" - ], - self.deletion_protection_configuration, - ) - - if self.media_extraction_configuration is not None: - serializer.write_struct( - _SCHEMA_MANAGED_KNOWLEDGE_BASE_CONNECTOR_CONFIGURATION.members[ - "mediaExtractionConfiguration" - ], - self.media_extraction_configuration, - ) - - if self.connector_parameters is not None: - serializer.write_document( - _SCHEMA_MANAGED_KNOWLEDGE_BASE_CONNECTOR_CONFIGURATION.members[ - "connectorParameters" - ], - self.connector_parameters, - ) - - if self.sync_schedule is not None: - serializer.write_struct( - _SCHEMA_MANAGED_KNOWLEDGE_BASE_CONNECTOR_CONFIGURATION.members[ - "syncSchedule" - ], - self.sync_schedule, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["deletion_protection_configuration"] = ( - DeletionProtectionConfiguration.deserialize(de) - ) - - case 1: - kwargs["media_extraction_configuration"] = ( - MediaExtractionConfiguration.deserialize(de) - ) - - case 2: - kwargs["connector_parameters"] = de.read_document( - _SCHEMA_MANAGED_KNOWLEDGE_BASE_CONNECTOR_CONFIGURATION.members[ - "connectorParameters" - ] - ) - - case 3: - kwargs["sync_schedule"] = _SyncScheduleDeserializer().deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MANAGED_KNOWLEDGE_BASE_CONNECTOR_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -def _serialize_s3_prefixes( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_s3_prefixes( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class S3DataSourceConfiguration: - """ - The configuration information to connect to Amazon S3 as your data - source for self-managed knowledge bases. To configure this data source - for managed knowledge bases, use - [managedKnowledgeBaseConnectorConfiguration](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_ManagedKnowledgeBaseConnectorConfiguration.html). - """ - - bucket_arn: str - """The Amazon Resource Name (ARN) of the S3 bucket that contains your data.""" - - inclusion_prefixes: list[str] | None = None - """ - A list of S3 prefixes to include certain files or content. For more - information, see [Organizing objects using - prefixes](https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-prefixes.html). - """ - - bucket_owner_account_id: str | None = None - """The account ID for the owner of the S3 bucket.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_S3_DATA_SOURCE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_S3_DATA_SOURCE_CONFIGURATION.members["bucketArn"], self.bucket_arn - ) - if self.inclusion_prefixes is not None: - _serialize_s3_prefixes( - serializer, - _SCHEMA_S3_DATA_SOURCE_CONFIGURATION.members["inclusionPrefixes"], - self.inclusion_prefixes, - ) - - if self.bucket_owner_account_id is not None: - serializer.write_string( - _SCHEMA_S3_DATA_SOURCE_CONFIGURATION.members["bucketOwnerAccountId"], - self.bucket_owner_account_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bucket_arn"] = de.read_string( - _SCHEMA_S3_DATA_SOURCE_CONFIGURATION.members["bucketArn"] - ) - - case 1: - kwargs["inclusion_prefixes"] = _deserialize_s3_prefixes( - de, - _SCHEMA_S3_DATA_SOURCE_CONFIGURATION.members[ - "inclusionPrefixes" - ], - ) - - case 2: - kwargs["bucket_owner_account_id"] = de.read_string( - _SCHEMA_S3_DATA_SOURCE_CONFIGURATION.members[ - "bucketOwnerAccountId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_S3_DATA_SOURCE_CONFIGURATION, consumer=_consumer - ) - if "bucket_arn" not in kwargs: - kwargs["bucket_arn"] = "" - return kwargs - - -@dataclass(kw_only=True) -class SalesforceCrawlerConfiguration: - """ - The configuration of the Salesforce content. For example, configuring - specific types of Salesforce content. - """ - - filter_configuration: CrawlFilterConfiguration | None = None - """ - The configuration of filtering the Salesforce content. For example, - configuring regular expression patterns to include or exclude certain - content. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SALESFORCE_CRAWLER_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.filter_configuration is not None: - serializer.write_struct( - _SCHEMA_SALESFORCE_CRAWLER_CONFIGURATION.members["filterConfiguration"], - self.filter_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["filter_configuration"] = ( - CrawlFilterConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SALESFORCE_CRAWLER_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -class SalesforceAuthType(UnknownEnumMixin, StrEnum): - OAUTH2_CLIENT_CREDENTIALS = "OAUTH2_CLIENT_CREDENTIALS" - - -@dataclass(kw_only=True) -class SalesforceSourceConfiguration: - """The endpoint information to connect to your Salesforce data source.""" - - host_url: str - """The Salesforce host URL or instance URL.""" - - auth_type: str - """ - The supported authentication type to authenticate and connect to your - Salesforce instance. - """ - - credentials_secret_arn: str - """ - The Amazon Resource Name of an Secrets Manager secret that stores your - authentication credentials for your Salesforce instance URL. For more - information on the key-value pairs that must be included in your secret, - depending on your authentication type, see [Salesforce connection - configuration](https://docs.aws.amazon.com/bedrock/latest/userguide/salesforce-data-source-connector.html#configuration-salesforce-connector). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SALESFORCE_SOURCE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SALESFORCE_SOURCE_CONFIGURATION.members["hostUrl"], self.host_url - ) - serializer.write_string( - _SCHEMA_SALESFORCE_SOURCE_CONFIGURATION.members["authType"], self.auth_type - ) - serializer.write_string( - _SCHEMA_SALESFORCE_SOURCE_CONFIGURATION.members["credentialsSecretArn"], - self.credentials_secret_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["host_url"] = de.read_string( - _SCHEMA_SALESFORCE_SOURCE_CONFIGURATION.members["hostUrl"] - ) - - case 1: - kwargs["auth_type"] = SalesforceAuthType( - de.read_string( - _SCHEMA_SALESFORCE_SOURCE_CONFIGURATION.members["authType"] - ) - ) - - case 2: - kwargs["credentials_secret_arn"] = de.read_string( - _SCHEMA_SALESFORCE_SOURCE_CONFIGURATION.members[ - "credentialsSecretArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SALESFORCE_SOURCE_CONFIGURATION, consumer=_consumer - ) - if "host_url" not in kwargs: - kwargs["host_url"] = "" - if "auth_type" not in kwargs: - kwargs["auth_type"] = SalesforceAuthType._corrected("") - if "credentials_secret_arn" not in kwargs: - kwargs["credentials_secret_arn"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls( - host_url="", - auth_type=SalesforceAuthType._corrected(""), - credentials_secret_arn="", - ) - - -@dataclass(kw_only=True) -class SalesforceDataSourceConfiguration: - """ - The configuration information to connect to Salesforce as your data - source. - """ - - source_configuration: SalesforceSourceConfiguration - """The endpoint information to connect to your Salesforce data source.""" - - crawler_configuration: SalesforceCrawlerConfiguration | None = None - """ - The configuration of the Salesforce content. For example, configuring - specific types of Salesforce content. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SALESFORCE_DATA_SOURCE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_SALESFORCE_DATA_SOURCE_CONFIGURATION.members["sourceConfiguration"], - self.source_configuration, - ) - if self.crawler_configuration is not None: - serializer.write_struct( - _SCHEMA_SALESFORCE_DATA_SOURCE_CONFIGURATION.members[ - "crawlerConfiguration" - ], - self.crawler_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["source_configuration"] = ( - SalesforceSourceConfiguration.deserialize(de) - ) - - case 1: - kwargs["crawler_configuration"] = ( - SalesforceCrawlerConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SALESFORCE_DATA_SOURCE_CONFIGURATION, consumer=_consumer - ) - if "source_configuration" not in kwargs: - kwargs["source_configuration"] = ( - SalesforceSourceConfiguration._smithy_default() - ) - return kwargs - - -@dataclass(kw_only=True) -class SharePointCrawlerConfiguration: - """ - The configuration of the SharePoint content. For example, configuring - specific types of SharePoint content. - """ - - filter_configuration: CrawlFilterConfiguration | None = None - """ - The configuration of filtering the SharePoint content. For example, - configuring regular expression patterns to include or exclude certain - content. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SHARE_POINT_CRAWLER_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.filter_configuration is not None: - serializer.write_struct( - _SCHEMA_SHARE_POINT_CRAWLER_CONFIGURATION.members[ - "filterConfiguration" - ], - self.filter_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["filter_configuration"] = ( - CrawlFilterConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SHARE_POINT_CRAWLER_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -class SharePointAuthType(UnknownEnumMixin, StrEnum): - OAUTH2_CLIENT_CREDENTIALS = "OAUTH2_CLIENT_CREDENTIALS" - OAUTH2_SHAREPOINT_APP_ONLY_CLIENT_CREDENTIALS = ( - "OAUTH2_SHAREPOINT_APP_ONLY_CLIENT_CREDENTIALS" - ) - - -class SharePointHostType(UnknownEnumMixin, StrEnum): - ONLINE = "ONLINE" - - -def _serialize_share_point_site_urls( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_share_point_site_urls( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class SharePointSourceConfiguration: - """The endpoint information to connect to your SharePoint data source.""" - - domain: str - """The domain of your SharePoint instance or site URL/URLs.""" - - site_urls: list[str] - """A list of one or more SharePoint site URLs.""" - - host_type: str - """The supported host type, whether online/cloud or server/on-premises.""" - - auth_type: str - """ - The supported authentication type to authenticate and connect to your - SharePoint site/sites. - """ - - credentials_secret_arn: str - """ - The Amazon Resource Name of an Secrets Manager secret that stores your - authentication credentials for your SharePoint site/sites. For more - information on the key-value pairs that must be included in your secret, - depending on your authentication type, see [SharePoint connection - configuration](https://docs.aws.amazon.com/bedrock/latest/userguide/sharepoint-data-source-connector.html#configuration-sharepoint-connector). - """ - - tenant_id: str | None = None - """The identifier of your Microsoft 365 tenant.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SHARE_POINT_SOURCE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.tenant_id is not None: - serializer.write_string( - _SCHEMA_SHARE_POINT_SOURCE_CONFIGURATION.members["tenantId"], - self.tenant_id, - ) - - serializer.write_string( - _SCHEMA_SHARE_POINT_SOURCE_CONFIGURATION.members["domain"], self.domain - ) - _serialize_share_point_site_urls( - serializer, - _SCHEMA_SHARE_POINT_SOURCE_CONFIGURATION.members["siteUrls"], - self.site_urls, - ) - serializer.write_string( - _SCHEMA_SHARE_POINT_SOURCE_CONFIGURATION.members["hostType"], self.host_type - ) - serializer.write_string( - _SCHEMA_SHARE_POINT_SOURCE_CONFIGURATION.members["authType"], self.auth_type - ) - serializer.write_string( - _SCHEMA_SHARE_POINT_SOURCE_CONFIGURATION.members["credentialsSecretArn"], - self.credentials_secret_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["tenant_id"] = de.read_string( - _SCHEMA_SHARE_POINT_SOURCE_CONFIGURATION.members["tenantId"] - ) - - case 1: - kwargs["domain"] = de.read_string( - _SCHEMA_SHARE_POINT_SOURCE_CONFIGURATION.members["domain"] - ) - - case 2: - kwargs["site_urls"] = _deserialize_share_point_site_urls( - de, _SCHEMA_SHARE_POINT_SOURCE_CONFIGURATION.members["siteUrls"] - ) - - case 3: - kwargs["host_type"] = SharePointHostType( - de.read_string( - _SCHEMA_SHARE_POINT_SOURCE_CONFIGURATION.members["hostType"] - ) - ) - - case 4: - kwargs["auth_type"] = SharePointAuthType( - de.read_string( - _SCHEMA_SHARE_POINT_SOURCE_CONFIGURATION.members["authType"] - ) - ) - - case 5: - kwargs["credentials_secret_arn"] = de.read_string( - _SCHEMA_SHARE_POINT_SOURCE_CONFIGURATION.members[ - "credentialsSecretArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SHARE_POINT_SOURCE_CONFIGURATION, consumer=_consumer - ) - if "domain" not in kwargs: - kwargs["domain"] = "" - if "site_urls" not in kwargs: - kwargs["site_urls"] = [] - if "host_type" not in kwargs: - kwargs["host_type"] = SharePointHostType._corrected("") - if "auth_type" not in kwargs: - kwargs["auth_type"] = SharePointAuthType._corrected("") - if "credentials_secret_arn" not in kwargs: - kwargs["credentials_secret_arn"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls( - domain="", - site_urls=[], - host_type=SharePointHostType._corrected(""), - auth_type=SharePointAuthType._corrected(""), - credentials_secret_arn="", - ) - - -@dataclass(kw_only=True) -class SharePointDataSourceConfiguration: - """ - The configuration information to connect to SharePoint as your data - source for self-managed knowledge bases. - """ - - source_configuration: SharePointSourceConfiguration - """The endpoint information to connect to your SharePoint data source.""" - - crawler_configuration: SharePointCrawlerConfiguration | None = None - """ - The configuration of the SharePoint content. For example, configuring - specific types of SharePoint content. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SHARE_POINT_DATA_SOURCE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_SHARE_POINT_DATA_SOURCE_CONFIGURATION.members[ - "sourceConfiguration" - ], - self.source_configuration, - ) - if self.crawler_configuration is not None: - serializer.write_struct( - _SCHEMA_SHARE_POINT_DATA_SOURCE_CONFIGURATION.members[ - "crawlerConfiguration" - ], - self.crawler_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["source_configuration"] = ( - SharePointSourceConfiguration.deserialize(de) - ) - - case 1: - kwargs["crawler_configuration"] = ( - SharePointCrawlerConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SHARE_POINT_DATA_SOURCE_CONFIGURATION, consumer=_consumer - ) - if "source_configuration" not in kwargs: - kwargs["source_configuration"] = ( - SharePointSourceConfiguration._smithy_default() - ) - return kwargs - - -class DataSourceType(UnknownEnumMixin, StrEnum): - S3 = "S3" - WEB = "WEB" - CONFLUENCE = "CONFLUENCE" - SALESFORCE = "SALESFORCE" - SHAREPOINT = "SHAREPOINT" - CUSTOM = "CUSTOM" - REDSHIFT_METADATA = "REDSHIFT_METADATA" - MANAGED_KNOWLEDGE_BASE_CONNECTOR = "MANAGED_KNOWLEDGE_BASE_CONNECTOR" - - -@dataclass(kw_only=True) -class WebCrawlerLimits: - """ - The rate limits for the URLs that you want to crawl. You should be - authorized to crawl the URLs. - """ - - rate_limit: int | None = None - """The max rate at which pages are crawled, up to 300 per minute per host.""" - - max_pages: int | None = None - """ - The max number of web pages crawled from your source URLs, up to 25,000 - pages. If the web pages exceed this limit, the data source sync will - fail and no web pages will be ingested. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_WEB_CRAWLER_LIMITS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rate_limit is not None: - serializer.write_integer( - _SCHEMA_WEB_CRAWLER_LIMITS.members["rateLimit"], self.rate_limit - ) - - if self.max_pages is not None: - serializer.write_integer( - _SCHEMA_WEB_CRAWLER_LIMITS.members["maxPages"], self.max_pages - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rate_limit"] = de.read_integer( - _SCHEMA_WEB_CRAWLER_LIMITS.members["rateLimit"] - ) - - case 1: - kwargs["max_pages"] = de.read_integer( - _SCHEMA_WEB_CRAWLER_LIMITS.members["maxPages"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_WEB_CRAWLER_LIMITS, consumer=_consumer) - return kwargs - - -class WebScopeType(UnknownEnumMixin, StrEnum): - HOST_ONLY = "HOST_ONLY" - SUBDOMAINS = "SUBDOMAINS" - - -@dataclass(kw_only=True) -class WebCrawlerConfiguration: - """ - The configuration of web URLs that you want to crawl. You should be - authorized to crawl the URLs. - """ - - crawler_limits: WebCrawlerLimits | None = None - """The configuration of crawl limits for the web URLs.""" - - inclusion_filters: list[str] | None = field(repr=False, default=None) - """ - A list of one or more inclusion regular expression patterns to include - certain URLs. If you specify an inclusion and exclusion filter/pattern - and both match a URL, the exclusion filter takes precedence and the web - content of the URL isn't crawled. - """ - - exclusion_filters: list[str] | None = field(repr=False, default=None) - """ - A list of one or more exclusion regular expression patterns to exclude - certain URLs. If you specify an inclusion and exclusion filter/pattern - and both match a URL, the exclusion filter takes precedence and the web - content of the URL isn't crawled. - """ - - scope: str | None = None - """ - The scope of what is crawled for your URLs. - - You can choose to crawl only web pages that belong to the same host or - primary domain. For example, only web pages that contain the seed URL - \"https://docs.aws.amazon.com/bedrock/latest/userguide/\" and no other - domains. You can choose to include sub domains in addition to the host - or primary domain. For example, web pages that contain - \"aws.amazon.com\" can also include sub domain \"docs.aws.amazon.com\". - """ - - user_agent: str | None = field(repr=False, default=None) - """Returns the user agent suffix for your web crawler.""" - - user_agent_header: str | None = field(repr=False, default=None) - """ - A string used for identifying the crawler or bot when it accesses a web - server. The user agent header value consists of the `bedrockbot`, UUID, - and a user agent suffix for your crawler (if one is provided). By - default, it is set to `bedrockbot_UUID`. You can optionally append a - custom suffix to `bedrockbot_UUID` to allowlist a specific user agent - permitted to access your source URLs. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_WEB_CRAWLER_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.crawler_limits is not None: - serializer.write_struct( - _SCHEMA_WEB_CRAWLER_CONFIGURATION.members["crawlerLimits"], - self.crawler_limits, - ) - - if self.inclusion_filters is not None: - _serialize_filter_list( - serializer, - _SCHEMA_WEB_CRAWLER_CONFIGURATION.members["inclusionFilters"], - self.inclusion_filters, - ) - - if self.exclusion_filters is not None: - _serialize_filter_list( - serializer, - _SCHEMA_WEB_CRAWLER_CONFIGURATION.members["exclusionFilters"], - self.exclusion_filters, - ) - - if self.scope is not None: - serializer.write_string( - _SCHEMA_WEB_CRAWLER_CONFIGURATION.members["scope"], self.scope - ) - - if self.user_agent is not None: - serializer.write_string( - _SCHEMA_WEB_CRAWLER_CONFIGURATION.members["userAgent"], self.user_agent - ) - - if self.user_agent_header is not None: - serializer.write_string( - _SCHEMA_WEB_CRAWLER_CONFIGURATION.members["userAgentHeader"], - self.user_agent_header, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["crawler_limits"] = WebCrawlerLimits.deserialize(de) - - case 1: - kwargs["inclusion_filters"] = _deserialize_filter_list( - de, - _SCHEMA_WEB_CRAWLER_CONFIGURATION.members["inclusionFilters"], - ) - - case 2: - kwargs["exclusion_filters"] = _deserialize_filter_list( - de, - _SCHEMA_WEB_CRAWLER_CONFIGURATION.members["exclusionFilters"], - ) - - case 3: - kwargs["scope"] = WebScopeType( - de.read_string( - _SCHEMA_WEB_CRAWLER_CONFIGURATION.members["scope"] - ) - ) - - case 4: - kwargs["user_agent"] = de.read_string( - _SCHEMA_WEB_CRAWLER_CONFIGURATION.members["userAgent"] - ) - - case 5: - kwargs["user_agent_header"] = de.read_string( - _SCHEMA_WEB_CRAWLER_CONFIGURATION.members["userAgentHeader"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_WEB_CRAWLER_CONFIGURATION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class SeedUrl: - """ - The seed or starting point URL. You should be authorized to crawl the - URL. - """ - - url: str | None = None - """A seed or starting point URL.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SEED_URL, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.url is not None: - serializer.write_string(_SCHEMA_SEED_URL.members["url"], self.url) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["url"] = de.read_string(_SCHEMA_SEED_URL.members["url"]) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SEED_URL, consumer=_consumer) - return kwargs - - -def _serialize_seed_urls( - serializer: ShapeSerializer, schema: Schema, value: list[SeedUrl] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_seed_urls( - deserializer: ShapeDeserializer, schema: Schema -) -> list[SeedUrl]: - result: list[SeedUrl] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(SeedUrl.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class UrlConfiguration: - """ - The configuration of web URLs that you want to crawl. You should be - authorized to crawl the URLs. - """ - - seed_urls: list[SeedUrl] | None = None - """One or more seed or starting point URLs.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_URL_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.seed_urls is not None: - _serialize_seed_urls( - serializer, - _SCHEMA_URL_CONFIGURATION.members["seedUrls"], - self.seed_urls, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["seed_urls"] = _deserialize_seed_urls( - de, _SCHEMA_URL_CONFIGURATION.members["seedUrls"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_URL_CONFIGURATION, consumer=_consumer) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls() - - -@dataclass(kw_only=True) -class WebSourceConfiguration: - """ - The configuration of the URL/URLs for the web content that you want to - crawl. You should be authorized to crawl the URLs. - """ - - url_configuration: UrlConfiguration - """The configuration of the URL/URLs.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_WEB_SOURCE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_WEB_SOURCE_CONFIGURATION.members["urlConfiguration"], - self.url_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["url_configuration"] = UrlConfiguration.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_WEB_SOURCE_CONFIGURATION, consumer=_consumer) - if "url_configuration" not in kwargs: - kwargs["url_configuration"] = UrlConfiguration._smithy_default() - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(url_configuration=UrlConfiguration._smithy_default()) - - -@dataclass(kw_only=True) -class WebDataSourceConfiguration: - """The configuration details for the web data source.""" - - source_configuration: WebSourceConfiguration - """The source configuration details for the web data source.""" - - crawler_configuration: WebCrawlerConfiguration | None = None - """The Web Crawler configuration details for the web data source.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_WEB_DATA_SOURCE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_WEB_DATA_SOURCE_CONFIGURATION.members["sourceConfiguration"], - self.source_configuration, - ) - if self.crawler_configuration is not None: - serializer.write_struct( - _SCHEMA_WEB_DATA_SOURCE_CONFIGURATION.members["crawlerConfiguration"], - self.crawler_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["source_configuration"] = WebSourceConfiguration.deserialize( - de - ) - - case 1: - kwargs["crawler_configuration"] = ( - WebCrawlerConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_WEB_DATA_SOURCE_CONFIGURATION, consumer=_consumer - ) - if "source_configuration" not in kwargs: - kwargs["source_configuration"] = WebSourceConfiguration._smithy_default() - return kwargs - - -@dataclass(kw_only=True) -class DataSourceConfiguration: - """The connection configuration for the data source.""" - - type: str - """The type of data source.""" - - managed_knowledge_base_connector_configuration: ( - ManagedKnowledgeBaseConnectorConfiguration | None - ) = None - """ - Contains the configuration for a data source that connects a managed - knowledge base to a supported data source connector. Specify this object - when the data source type is `MANAGED_KNOWLEDGE_BASE_CONNECTOR`. - """ - - s3_configuration: S3DataSourceConfiguration | None = None - """ - The configuration information to connect to Amazon S3 as your data - source for self-managed knowledge bases. To configure this data source - for managed knowledge bases, use - [managedKnowledgeBaseConnectorConfiguration](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_ManagedKnowledgeBaseConnectorConfiguration.html). - """ - - web_configuration: WebDataSourceConfiguration | None = None - """ - The configuration of web URLs to crawl for your data source. You should - be authorized to crawl the URLs. - - Note: - To configure this data source for managed knowledge bases, use - [managedKnowledgeBaseConnectorConfiguration](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_ManagedKnowledgeBaseConnectorConfiguration.html). - Web crawler data source connector for self-managed knowledge bases is in - preview release and is subject to change. - """ - - confluence_configuration: ConfluenceDataSourceConfiguration | None = None - """ - The configuration information to connect to Confluence as your data - source for self-managed knowledge bases. - - Note: - To configure this data source for managed knowledge bases, use - [managedKnowledgeBaseConnectorConfiguration](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_ManagedKnowledgeBaseConnectorConfiguration.html). - Confluence data source connector for self-managed knowledge bases is in - preview release and is subject to change. - """ - - salesforce_configuration: SalesforceDataSourceConfiguration | None = None - """ - The configuration information to connect to Salesforce as your data - source. - - Note: - Salesforce data source connector for self-managed knowledge bases is in - preview release and is subject to change. - """ - - share_point_configuration: SharePointDataSourceConfiguration | None = None - """ - The configuration information to connect to SharePoint as your data - source for self-managed knowledge bases. - - Note: - To configure this data source for managed knowledge bases, use - [managedKnowledgeBaseConnectorConfiguration](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_ManagedKnowledgeBaseConnectorConfiguration.html). - SharePoint data source connector for self-managed knowledge bases is in - preview release and is subject to change. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DATA_SOURCE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DATA_SOURCE_CONFIGURATION.members["type"], self.type - ) - if self.managed_knowledge_base_connector_configuration is not None: - serializer.write_struct( - _SCHEMA_DATA_SOURCE_CONFIGURATION.members[ - "managedKnowledgeBaseConnectorConfiguration" - ], - self.managed_knowledge_base_connector_configuration, - ) - - if self.s3_configuration is not None: - serializer.write_struct( - _SCHEMA_DATA_SOURCE_CONFIGURATION.members["s3Configuration"], - self.s3_configuration, - ) - - if self.web_configuration is not None: - serializer.write_struct( - _SCHEMA_DATA_SOURCE_CONFIGURATION.members["webConfiguration"], - self.web_configuration, - ) - - if self.confluence_configuration is not None: - serializer.write_struct( - _SCHEMA_DATA_SOURCE_CONFIGURATION.members["confluenceConfiguration"], - self.confluence_configuration, - ) - - if self.salesforce_configuration is not None: - serializer.write_struct( - _SCHEMA_DATA_SOURCE_CONFIGURATION.members["salesforceConfiguration"], - self.salesforce_configuration, - ) - - if self.share_point_configuration is not None: - serializer.write_struct( - _SCHEMA_DATA_SOURCE_CONFIGURATION.members["sharePointConfiguration"], - self.share_point_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = DataSourceType( - de.read_string( - _SCHEMA_DATA_SOURCE_CONFIGURATION.members["type"] - ) - ) - - case 1: - kwargs["managed_knowledge_base_connector_configuration"] = ( - ManagedKnowledgeBaseConnectorConfiguration.deserialize(de) - ) - - case 2: - kwargs["s3_configuration"] = S3DataSourceConfiguration.deserialize( - de - ) - - case 3: - kwargs["web_configuration"] = ( - WebDataSourceConfiguration.deserialize(de) - ) - - case 4: - kwargs["confluence_configuration"] = ( - ConfluenceDataSourceConfiguration.deserialize(de) - ) - - case 5: - kwargs["salesforce_configuration"] = ( - SalesforceDataSourceConfiguration.deserialize(de) - ) - - case 6: - kwargs["share_point_configuration"] = ( - SharePointDataSourceConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DATA_SOURCE_CONFIGURATION, consumer=_consumer) - if "type" not in kwargs: - kwargs["type"] = DataSourceType._corrected("") - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(type=DataSourceType._corrected("")) - - -@dataclass(kw_only=True) -class ServerSideEncryptionConfiguration: - """ - Contains the configuration for server-side encryption for your managed - knowledge base. - """ - - kms_key_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the KMS key used to encrypt the - resource. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SERVER_SIDE_ENCRYPTION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_SERVER_SIDE_ENCRYPTION_CONFIGURATION.members["kmsKeyArn"], - self.kms_key_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_SERVER_SIDE_ENCRYPTION_CONFIGURATION.members[ - "kmsKeyArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SERVER_SIDE_ENCRYPTION_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -class ChunkingStrategy(UnknownEnumMixin, StrEnum): - FIXED_SIZE = "FIXED_SIZE" - NONE = "NONE" - HIERARCHICAL = "HIERARCHICAL" - SEMANTIC = "SEMANTIC" - - -@dataclass(kw_only=True) -class FixedSizeChunkingConfiguration: - """ - Configurations for when you choose fixed-size chunking. If you set the - `chunkingStrategy` as `NONE`, exclude this field. - """ - - max_tokens: int - """The maximum number of tokens to include in a chunk.""" - - overlap_percentage: int - """The percentage of overlap between adjacent chunks of a data source.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FIXED_SIZE_CHUNKING_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer( - _SCHEMA_FIXED_SIZE_CHUNKING_CONFIGURATION.members["maxTokens"], - self.max_tokens, - ) - serializer.write_integer( - _SCHEMA_FIXED_SIZE_CHUNKING_CONFIGURATION.members["overlapPercentage"], - self.overlap_percentage, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["max_tokens"] = de.read_integer( - _SCHEMA_FIXED_SIZE_CHUNKING_CONFIGURATION.members["maxTokens"] - ) - - case 1: - kwargs["overlap_percentage"] = de.read_integer( - _SCHEMA_FIXED_SIZE_CHUNKING_CONFIGURATION.members[ - "overlapPercentage" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_FIXED_SIZE_CHUNKING_CONFIGURATION, consumer=_consumer - ) - if "max_tokens" not in kwargs: - kwargs["max_tokens"] = 0 - if "overlap_percentage" not in kwargs: - kwargs["overlap_percentage"] = 0 - return kwargs - - -@dataclass(kw_only=True) -class HierarchicalChunkingLevelConfiguration: - """Token settings for a layer in a hierarchical chunking configuration.""" - - max_tokens: int - """The maximum number of tokens that a chunk can contain in this layer.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HIERARCHICAL_CHUNKING_LEVEL_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer( - _SCHEMA_HIERARCHICAL_CHUNKING_LEVEL_CONFIGURATION.members["maxTokens"], - self.max_tokens, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["max_tokens"] = de.read_integer( - _SCHEMA_HIERARCHICAL_CHUNKING_LEVEL_CONFIGURATION.members[ - "maxTokens" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_HIERARCHICAL_CHUNKING_LEVEL_CONFIGURATION, consumer=_consumer - ) - if "max_tokens" not in kwargs: - kwargs["max_tokens"] = 0 - return kwargs - - -def _serialize_hierarchical_chunking_level_configurations( - serializer: ShapeSerializer, - schema: Schema, - value: list[HierarchicalChunkingLevelConfiguration], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_hierarchical_chunking_level_configurations( - deserializer: ShapeDeserializer, schema: Schema -) -> list[HierarchicalChunkingLevelConfiguration]: - result: list[HierarchicalChunkingLevelConfiguration] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(HierarchicalChunkingLevelConfiguration.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class HierarchicalChunkingConfiguration: - """ - Settings for hierarchical document chunking for a data source. - Hierarchical chunking splits documents into layers of chunks where the - first layer contains large chunks, and the second layer contains smaller - chunks derived from the first layer. - - You configure the number of tokens to overlap, or repeat across adjacent - chunks. For example, if you set overlap tokens to 60, the last 60 tokens - in the first chunk are also included at the beginning of the second - chunk. For each layer, you must also configure the maximum number of - tokens in a chunk. - """ - - level_configurations: list[HierarchicalChunkingLevelConfiguration] - """Token settings for each layer.""" - - overlap_tokens: int - """The number of tokens to repeat across chunks in the same layer.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HIERARCHICAL_CHUNKING_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_hierarchical_chunking_level_configurations( - serializer, - _SCHEMA_HIERARCHICAL_CHUNKING_CONFIGURATION.members["levelConfigurations"], - self.level_configurations, - ) - serializer.write_integer( - _SCHEMA_HIERARCHICAL_CHUNKING_CONFIGURATION.members["overlapTokens"], - self.overlap_tokens, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["level_configurations"] = ( - _deserialize_hierarchical_chunking_level_configurations( - de, - _SCHEMA_HIERARCHICAL_CHUNKING_CONFIGURATION.members[ - "levelConfigurations" - ], - ) - ) - - case 1: - kwargs["overlap_tokens"] = de.read_integer( - _SCHEMA_HIERARCHICAL_CHUNKING_CONFIGURATION.members[ - "overlapTokens" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_HIERARCHICAL_CHUNKING_CONFIGURATION, consumer=_consumer - ) - if "level_configurations" not in kwargs: - kwargs["level_configurations"] = [] - if "overlap_tokens" not in kwargs: - kwargs["overlap_tokens"] = 0 - return kwargs - - -@dataclass(kw_only=True) -class SemanticChunkingConfiguration: - """ - Settings for semantic document chunking for a data source. Semantic - chunking splits a document into into smaller documents based on groups - of similar content derived from the text with natural language - processing. - - With semantic chunking, each sentence is compared to the next to - determine how similar they are. You specify a threshold in the form of a - percentile, where adjacent sentences that are less similar than that - percentage of sentence pairs are divided into separate chunks. For - example, if you set the threshold to 90, then the 10 percent of sentence - pairs that are least similar are split. So if you have 101 sentences, - 100 sentence pairs are compared, and the 10 with the least similarity - are split, creating 11 chunks. These chunks are further split if they - exceed the max token size. - - You must also specify a buffer size, which determines whether sentences - are compared in isolation, or within a moving context window that - includes the previous and following sentence. For example, if you set - the buffer size to `1`, the embedding for sentence 10 is derived from - sentences 9, 10, and 11 combined. - """ - - max_tokens: int - """The maximum number of tokens that a chunk can contain.""" - - buffer_size: int - """The buffer size.""" - - breakpoint_percentile_threshold: int - """The dissimilarity threshold for splitting chunks.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SEMANTIC_CHUNKING_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer( - _SCHEMA_SEMANTIC_CHUNKING_CONFIGURATION.members["maxTokens"], - self.max_tokens, - ) - serializer.write_integer( - _SCHEMA_SEMANTIC_CHUNKING_CONFIGURATION.members["bufferSize"], - self.buffer_size, - ) - serializer.write_integer( - _SCHEMA_SEMANTIC_CHUNKING_CONFIGURATION.members[ - "breakpointPercentileThreshold" - ], - self.breakpoint_percentile_threshold, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["max_tokens"] = de.read_integer( - _SCHEMA_SEMANTIC_CHUNKING_CONFIGURATION.members["maxTokens"] - ) - - case 1: - kwargs["buffer_size"] = de.read_integer( - _SCHEMA_SEMANTIC_CHUNKING_CONFIGURATION.members["bufferSize"] - ) - - case 2: - kwargs["breakpoint_percentile_threshold"] = de.read_integer( - _SCHEMA_SEMANTIC_CHUNKING_CONFIGURATION.members[ - "breakpointPercentileThreshold" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SEMANTIC_CHUNKING_CONFIGURATION, consumer=_consumer - ) - if "max_tokens" not in kwargs: - kwargs["max_tokens"] = 0 - if "buffer_size" not in kwargs: - kwargs["buffer_size"] = 0 - if "breakpoint_percentile_threshold" not in kwargs: - kwargs["breakpoint_percentile_threshold"] = 0 - return kwargs - - -@dataclass(kw_only=True) -class ChunkingConfiguration: - """ - Details about how to chunk the documents in the data source. A *chunk* - refers to an excerpt from a data source that is returned when the - knowledge base that it belongs to is queried. - """ - - chunking_strategy: str - """ - Knowledge base can split your source data into chunks. A *chunk* refers - to an excerpt from a data source that is returned when the knowledge - base that it belongs to is queried. You have the following options for - chunking your data. If you opt for `NONE`, then you may want to - pre-process your files by splitting them up such that each file - corresponds to a chunk. - - - `FIXED_SIZE` -- Amazon Bedrock splits your source data into chunks of - the approximate size that you set in the - `fixedSizeChunkingConfiguration`. - - - `HIERARCHICAL` -- Split documents into layers of chunks where the - first layer contains large chunks, and the second layer contains - smaller chunks derived from the first layer. - - - `SEMANTIC` -- Split documents into chunks based on groups of similar - content derived with natural language processing. - - - `NONE` -- Amazon Bedrock treats each file as one chunk. If you choose - this option, you may want to pre-process your documents by splitting - them into separate files. - """ - - fixed_size_chunking_configuration: FixedSizeChunkingConfiguration | None = None - """ - Configurations for when you choose fixed-size chunking. If you set the - `chunkingStrategy` as `NONE`, exclude this field. - """ - - hierarchical_chunking_configuration: HierarchicalChunkingConfiguration | None = None - """ - Settings for hierarchical document chunking for a data source. - Hierarchical chunking splits documents into layers of chunks where the - first layer contains large chunks, and the second layer contains smaller - chunks derived from the first layer. - """ - - semantic_chunking_configuration: SemanticChunkingConfiguration | None = None - """ - Settings for semantic document chunking for a data source. Semantic - chunking splits a document into into smaller documents based on groups - of similar content derived from the text with natural language - processing. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CHUNKING_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CHUNKING_CONFIGURATION.members["chunkingStrategy"], - self.chunking_strategy, - ) - if self.fixed_size_chunking_configuration is not None: - serializer.write_struct( - _SCHEMA_CHUNKING_CONFIGURATION.members[ - "fixedSizeChunkingConfiguration" - ], - self.fixed_size_chunking_configuration, - ) - - if self.hierarchical_chunking_configuration is not None: - serializer.write_struct( - _SCHEMA_CHUNKING_CONFIGURATION.members[ - "hierarchicalChunkingConfiguration" - ], - self.hierarchical_chunking_configuration, - ) - - if self.semantic_chunking_configuration is not None: - serializer.write_struct( - _SCHEMA_CHUNKING_CONFIGURATION.members["semanticChunkingConfiguration"], - self.semantic_chunking_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["chunking_strategy"] = ChunkingStrategy( - de.read_string( - _SCHEMA_CHUNKING_CONFIGURATION.members["chunkingStrategy"] - ) - ) - - case 1: - kwargs["fixed_size_chunking_configuration"] = ( - FixedSizeChunkingConfiguration.deserialize(de) - ) - - case 2: - kwargs["hierarchical_chunking_configuration"] = ( - HierarchicalChunkingConfiguration.deserialize(de) - ) - - case 3: - kwargs["semantic_chunking_configuration"] = ( - SemanticChunkingConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CHUNKING_CONFIGURATION, consumer=_consumer) - if "chunking_strategy" not in kwargs: - kwargs["chunking_strategy"] = ChunkingStrategy._corrected("") - return kwargs - - -class EnrichmentStrategyMethod(UnknownEnumMixin, StrEnum): - CHUNK_ENTITY_EXTRACTION = "CHUNK_ENTITY_EXTRACTION" - - -@dataclass(kw_only=True) -class EnrichmentStrategyConfiguration: - """The strategy used for performing context enrichment.""" - - method: str - """The method used for the context enrichment strategy.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ENRICHMENT_STRATEGY_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_ENRICHMENT_STRATEGY_CONFIGURATION.members["method"], self.method - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["method"] = EnrichmentStrategyMethod( - de.read_string( - _SCHEMA_ENRICHMENT_STRATEGY_CONFIGURATION.members["method"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ENRICHMENT_STRATEGY_CONFIGURATION, consumer=_consumer - ) - if "method" not in kwargs: - kwargs["method"] = EnrichmentStrategyMethod._corrected("") - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(method=EnrichmentStrategyMethod._corrected("")) - - -@dataclass(kw_only=True) -class BedrockFoundationModelContextEnrichmentConfiguration: - """ - Context enrichment configuration is used to provide additional context - to the RAG application using Amazon Bedrock foundation models. - """ - - enrichment_strategy_configuration: EnrichmentStrategyConfiguration - """ - The enrichment stategy used to provide additional context. For example, - Neptune GraphRAG uses Amazon Bedrock foundation models to perform chunk - entity extraction. - """ - - model_arn: str - """ - The Amazon Resource Name (ARN) of the model used to create vector - embeddings for the knowledge base. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_BEDROCK_FOUNDATION_MODEL_CONTEXT_ENRICHMENT_CONFIGURATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_BEDROCK_FOUNDATION_MODEL_CONTEXT_ENRICHMENT_CONFIGURATION.members[ - "enrichmentStrategyConfiguration" - ], - self.enrichment_strategy_configuration, - ) - serializer.write_string( - _SCHEMA_BEDROCK_FOUNDATION_MODEL_CONTEXT_ENRICHMENT_CONFIGURATION.members[ - "modelArn" - ], - self.model_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["enrichment_strategy_configuration"] = ( - EnrichmentStrategyConfiguration.deserialize(de) - ) - - case 1: - kwargs["model_arn"] = de.read_string( - _SCHEMA_BEDROCK_FOUNDATION_MODEL_CONTEXT_ENRICHMENT_CONFIGURATION.members[ - "modelArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_BEDROCK_FOUNDATION_MODEL_CONTEXT_ENRICHMENT_CONFIGURATION, - consumer=_consumer, - ) - if "enrichment_strategy_configuration" not in kwargs: - kwargs["enrichment_strategy_configuration"] = ( - EnrichmentStrategyConfiguration._smithy_default() - ) - if "model_arn" not in kwargs: - kwargs["model_arn"] = "" - return kwargs - - -class ContextEnrichmentType(UnknownEnumMixin, StrEnum): - BEDROCK_FOUNDATION_MODEL = "BEDROCK_FOUNDATION_MODEL" - - -@dataclass(kw_only=True) -class ContextEnrichmentConfiguration: - """ - Context enrichment configuration is used to provide additional context - to the RAG application. - """ - - type: str - """ - The method used for context enrichment. It must be Amazon Bedrock - foundation models. - """ - - bedrock_foundation_model_configuration: ( - BedrockFoundationModelContextEnrichmentConfiguration | None - ) = None - """ - The configuration of the Amazon Bedrock foundation model used for - context enrichment. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTEXT_ENRICHMENT_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CONTEXT_ENRICHMENT_CONFIGURATION.members["type"], self.type - ) - if self.bedrock_foundation_model_configuration is not None: - serializer.write_struct( - _SCHEMA_CONTEXT_ENRICHMENT_CONFIGURATION.members[ - "bedrockFoundationModelConfiguration" - ], - self.bedrock_foundation_model_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = ContextEnrichmentType( - de.read_string( - _SCHEMA_CONTEXT_ENRICHMENT_CONFIGURATION.members["type"] - ) - ) - - case 1: - kwargs["bedrock_foundation_model_configuration"] = ( - BedrockFoundationModelContextEnrichmentConfiguration.deserialize( - de - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CONTEXT_ENRICHMENT_CONFIGURATION, consumer=_consumer - ) - if "type" not in kwargs: - kwargs["type"] = ContextEnrichmentType._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class S3Location: - """An Amazon S3 location.""" - - uri: str - """The location's URI. For example, `s3://my-bucket/chunk-processor/`.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_S3_LOCATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_S3_LOCATION.members["uri"], self.uri) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["uri"] = de.read_string(_SCHEMA_S3_LOCATION.members["uri"]) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_S3_LOCATION, consumer=_consumer) - if "uri" not in kwargs: - kwargs["uri"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(uri="") - - -@dataclass(kw_only=True) -class IntermediateStorage: - """ - A location for storing content from data sources temporarily as it is - processed by custom components in the ingestion pipeline. - """ - - s3_location: S3Location - """An S3 bucket path.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INTERMEDIATE_STORAGE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INTERMEDIATE_STORAGE.members["s3Location"], self.s3_location - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["s3_location"] = S3Location.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INTERMEDIATE_STORAGE, consumer=_consumer) - if "s3_location" not in kwargs: - kwargs["s3_location"] = S3Location._smithy_default() - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(s3_location=S3Location._smithy_default()) - - -class StepType(UnknownEnumMixin, StrEnum): - POST_CHUNKING = "POST_CHUNKING" - - -@dataclass(kw_only=True) -class TransformationLambdaConfiguration: - """A Lambda function that processes documents.""" - - lambda_arn: str - """The function's ARN identifier.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRANSFORMATION_LAMBDA_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_TRANSFORMATION_LAMBDA_CONFIGURATION.members["lambdaArn"], - self.lambda_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["lambda_arn"] = de.read_string( - _SCHEMA_TRANSFORMATION_LAMBDA_CONFIGURATION.members["lambdaArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_TRANSFORMATION_LAMBDA_CONFIGURATION, consumer=_consumer - ) - if "lambda_arn" not in kwargs: - kwargs["lambda_arn"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(lambda_arn="") - - -@dataclass(kw_only=True) -class TransformationFunction: - """A Lambda function that processes documents.""" - - transformation_lambda_configuration: TransformationLambdaConfiguration - """The Lambda function.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRANSFORMATION_FUNCTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_TRANSFORMATION_FUNCTION.members[ - "transformationLambdaConfiguration" - ], - self.transformation_lambda_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["transformation_lambda_configuration"] = ( - TransformationLambdaConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TRANSFORMATION_FUNCTION, consumer=_consumer) - if "transformation_lambda_configuration" not in kwargs: - kwargs["transformation_lambda_configuration"] = ( - TransformationLambdaConfiguration._smithy_default() - ) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls( - transformation_lambda_configuration=TransformationLambdaConfiguration._smithy_default() - ) - - -@dataclass(kw_only=True) -class Transformation: - """ - A custom processing step for documents moving through a data source - ingestion pipeline. To process documents after they have been converted - into chunks, set the step to apply to `POST_CHUNKING`. - """ - - transformation_function: TransformationFunction - """A Lambda function that processes documents.""" - - step_to_apply: str - """When the service applies the transformation.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRANSFORMATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_TRANSFORMATION.members["transformationFunction"], - self.transformation_function, - ) - serializer.write_string( - _SCHEMA_TRANSFORMATION.members["stepToApply"], self.step_to_apply - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["transformation_function"] = ( - TransformationFunction.deserialize(de) - ) - - case 1: - kwargs["step_to_apply"] = StepType( - de.read_string(_SCHEMA_TRANSFORMATION.members["stepToApply"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TRANSFORMATION, consumer=_consumer) - if "transformation_function" not in kwargs: - kwargs["transformation_function"] = TransformationFunction._smithy_default() - if "step_to_apply" not in kwargs: - kwargs["step_to_apply"] = StepType._corrected("") - return kwargs - - -def _serialize_transformations( - serializer: ShapeSerializer, schema: Schema, value: list[Transformation] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_transformations( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Transformation]: - result: list[Transformation] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Transformation.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CustomTransformationConfiguration: - """ - Settings for customizing steps in the data source content ingestion - pipeline. - - You can configure the data source to process documents with a Lambda - function after they are parsed and converted into chunks. When you add a - post-chunking transformation, the service stores chunked documents in an - S3 bucket and invokes a Lambda function to process them. - - To process chunked documents with a Lambda function, define an S3 bucket - path for input and output objects, and a transformation that specifies - the Lambda function to invoke. You can use the Lambda function to - customize how chunks are split, and the metadata for each chunk. - """ - - intermediate_storage: IntermediateStorage - """An S3 bucket path for input and output objects.""" - - transformations: list[Transformation] - """A Lambda function that processes documents.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOM_TRANSFORMATION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CUSTOM_TRANSFORMATION_CONFIGURATION.members["intermediateStorage"], - self.intermediate_storage, - ) - _serialize_transformations( - serializer, - _SCHEMA_CUSTOM_TRANSFORMATION_CONFIGURATION.members["transformations"], - self.transformations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["intermediate_storage"] = IntermediateStorage.deserialize(de) - - case 1: - kwargs["transformations"] = _deserialize_transformations( - de, - _SCHEMA_CUSTOM_TRANSFORMATION_CONFIGURATION.members[ - "transformations" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CUSTOM_TRANSFORMATION_CONFIGURATION, consumer=_consumer - ) - if "intermediate_storage" not in kwargs: - kwargs["intermediate_storage"] = IntermediateStorage._smithy_default() - if "transformations" not in kwargs: - kwargs["transformations"] = [] - return kwargs - - -class ParsingModality(UnknownEnumMixin, StrEnum): - MULTIMODAL = "MULTIMODAL" - - -@dataclass(kw_only=True) -class BedrockDataAutomationConfiguration: - """ - Contains configurations for using Amazon Bedrock Data Automation as the - parser for ingesting your data sources. - """ - - parsing_modality: str | None = None - """ - Specifies whether to enable parsing of multimodal data, including both - text and/or images. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BEDROCK_DATA_AUTOMATION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.parsing_modality is not None: - serializer.write_string( - _SCHEMA_BEDROCK_DATA_AUTOMATION_CONFIGURATION.members[ - "parsingModality" - ], - self.parsing_modality, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["parsing_modality"] = ParsingModality( - de.read_string( - _SCHEMA_BEDROCK_DATA_AUTOMATION_CONFIGURATION.members[ - "parsingModality" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_BEDROCK_DATA_AUTOMATION_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ParsingPrompt: - """Instructions for interpreting the contents of a document.""" - - parsing_prompt_text: str - """Instructions for interpreting the contents of a document.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PARSING_PROMPT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_PARSING_PROMPT.members["parsingPromptText"], - self.parsing_prompt_text, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["parsing_prompt_text"] = de.read_string( - _SCHEMA_PARSING_PROMPT.members["parsingPromptText"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PARSING_PROMPT, consumer=_consumer) - if "parsing_prompt_text" not in kwargs: - kwargs["parsing_prompt_text"] = "" - return kwargs - - -@dataclass(kw_only=True) -class BedrockFoundationModelConfiguration: - """ - Settings for a foundation model used to parse documents for a data - source. - """ - - model_arn: str - """The ARN of the foundation model to use for parsing.""" - - parsing_prompt: ParsingPrompt | None = None - """Instructions for interpreting the contents of a document.""" - - parsing_modality: str | None = None - """ - Specifies whether to enable parsing of multimodal data, including both - text and/or images. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BEDROCK_FOUNDATION_MODEL_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_BEDROCK_FOUNDATION_MODEL_CONFIGURATION.members["modelArn"], - self.model_arn, - ) - if self.parsing_prompt is not None: - serializer.write_struct( - _SCHEMA_BEDROCK_FOUNDATION_MODEL_CONFIGURATION.members["parsingPrompt"], - self.parsing_prompt, - ) - - if self.parsing_modality is not None: - serializer.write_string( - _SCHEMA_BEDROCK_FOUNDATION_MODEL_CONFIGURATION.members[ - "parsingModality" - ], - self.parsing_modality, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_arn"] = de.read_string( - _SCHEMA_BEDROCK_FOUNDATION_MODEL_CONFIGURATION.members[ - "modelArn" - ] - ) - - case 1: - kwargs["parsing_prompt"] = ParsingPrompt.deserialize(de) - - case 2: - kwargs["parsing_modality"] = ParsingModality( - de.read_string( - _SCHEMA_BEDROCK_FOUNDATION_MODEL_CONFIGURATION.members[ - "parsingModality" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_BEDROCK_FOUNDATION_MODEL_CONFIGURATION, consumer=_consumer - ) - if "model_arn" not in kwargs: - kwargs["model_arn"] = "" - return kwargs - - -class ParsingStrategy(UnknownEnumMixin, StrEnum): - BEDROCK_FOUNDATION_MODEL = "BEDROCK_FOUNDATION_MODEL" - BEDROCK_DATA_AUTOMATION = "BEDROCK_DATA_AUTOMATION" - SMART_PARSING = "SMART_PARSING" - MULTI_MODAL_EMBEDDINGS = "MULTI_MODAL_EMBEDDINGS" - - -@dataclass(kw_only=True) -class ParsingConfiguration: - """ - Settings for parsing document contents. If you exclude this field, the - default parser converts the contents of each document into text before - splitting it into chunks. Specify the parsing strategy to use in the - `parsingStrategy` field and include the relevant configuration, or omit - it to use the Amazon Bedrock default parser. For more information, see - [Parsing options for your data - source](https://docs.aws.amazon.com/bedrock/latest/userguide/kb-advanced-parsing.html). - - Note: - If you specify `BEDROCK_DATA_AUTOMATION` or `BEDROCK_FOUNDATION_MODEL` - and it fails to parse a file, the Amazon Bedrock default parser will be - used instead. - """ - - parsing_strategy: str - """ - The parsing strategy for the data source. - - For managed knowledge bases, the strategy that you can select depends on - the embedding model that your knowledge base uses: - - - If your knowledge base uses a native multimodal embedding model, - specify `MULTI_MODAL_EMBEDDINGS`. With this strategy, files are sent - directly to the embedding model instead of being parsed into text. - This is the only strategy that is supported for these knowledge bases. - - - Otherwise, specify `SMART_PARSING`. - - For more information, see [Customize ingestion for managed knowledge - bases](https://docs.aws.amazon.com/bedrock/latest/userguide/kb-managed-customize-ingestion.html). - """ - - bedrock_foundation_model_configuration: ( - BedrockFoundationModelConfiguration | None - ) = None - """ - If you specify `BEDROCK_FOUNDATION_MODEL` as the parsing strategy for - ingesting your data source, use this object to modify configurations for - using a foundation model to parse documents. - """ - - bedrock_data_automation_configuration: BedrockDataAutomationConfiguration | None = ( - None - ) - """ - If you specify `BEDROCK_DATA_AUTOMATION` as the parsing strategy for - ingesting your data source, use this object to modify configurations for - using the Amazon Bedrock Data Automation parser. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PARSING_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_PARSING_CONFIGURATION.members["parsingStrategy"], - self.parsing_strategy, - ) - if self.bedrock_foundation_model_configuration is not None: - serializer.write_struct( - _SCHEMA_PARSING_CONFIGURATION.members[ - "bedrockFoundationModelConfiguration" - ], - self.bedrock_foundation_model_configuration, - ) - - if self.bedrock_data_automation_configuration is not None: - serializer.write_struct( - _SCHEMA_PARSING_CONFIGURATION.members[ - "bedrockDataAutomationConfiguration" - ], - self.bedrock_data_automation_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["parsing_strategy"] = ParsingStrategy( - de.read_string( - _SCHEMA_PARSING_CONFIGURATION.members["parsingStrategy"] - ) - ) - - case 1: - kwargs["bedrock_foundation_model_configuration"] = ( - BedrockFoundationModelConfiguration.deserialize(de) - ) - - case 2: - kwargs["bedrock_data_automation_configuration"] = ( - BedrockDataAutomationConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PARSING_CONFIGURATION, consumer=_consumer) - if "parsing_strategy" not in kwargs: - kwargs["parsing_strategy"] = ParsingStrategy._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class VectorIngestionConfiguration: - """Contains details about how to ingest the documents in a data source.""" - - chunking_configuration: ChunkingConfiguration | None = None - """ - Details about how to chunk the documents in the data source. A *chunk* - refers to an excerpt from a data source that is returned when the - knowledge base that it belongs to is queried. - """ - - custom_transformation_configuration: CustomTransformationConfiguration | None = None - """A custom document transformer for parsed data source documents.""" - - parsing_configuration: ParsingConfiguration | None = None - """ - Configurations for a parser to use for parsing documents in your data - source. If you exclude this field, the default parser will be used. - """ - - context_enrichment_configuration: ContextEnrichmentConfiguration | None = None - """ - The context enrichment configuration used for ingestion of the data into - the vector store. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VECTOR_INGESTION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.chunking_configuration is not None: - serializer.write_struct( - _SCHEMA_VECTOR_INGESTION_CONFIGURATION.members["chunkingConfiguration"], - self.chunking_configuration, - ) - - if self.custom_transformation_configuration is not None: - serializer.write_struct( - _SCHEMA_VECTOR_INGESTION_CONFIGURATION.members[ - "customTransformationConfiguration" - ], - self.custom_transformation_configuration, - ) - - if self.parsing_configuration is not None: - serializer.write_struct( - _SCHEMA_VECTOR_INGESTION_CONFIGURATION.members["parsingConfiguration"], - self.parsing_configuration, - ) - - if self.context_enrichment_configuration is not None: - serializer.write_struct( - _SCHEMA_VECTOR_INGESTION_CONFIGURATION.members[ - "contextEnrichmentConfiguration" - ], - self.context_enrichment_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["chunking_configuration"] = ( - ChunkingConfiguration.deserialize(de) - ) - - case 1: - kwargs["custom_transformation_configuration"] = ( - CustomTransformationConfiguration.deserialize(de) - ) - - case 2: - kwargs["parsing_configuration"] = ParsingConfiguration.deserialize( - de - ) - - case 3: - kwargs["context_enrichment_configuration"] = ( - ContextEnrichmentConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_VECTOR_INGESTION_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CreateDataSourceInput: - """Dataclass for CreateDataSourceInput structure.""" - - knowledge_base_id: str | None = None - """ - The unique identifier of the knowledge base to which to add the data - source. - """ - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If this token matches a previous - request, Amazon Bedrock ignores the request, but does not return an - error. For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - name: str | None = None - """The name of the data source.""" - - description: str | None = None - """A description of the data source.""" - - data_source_configuration: DataSourceConfiguration | None = None - """The connection configuration for the data source.""" - - data_deletion_policy: str | None = None - """ - The data deletion policy for the data source. - - You can set the data deletion policy to: - - - DELETE: Deletes all data from your data source that's converted into - vector embeddings upon deletion of a knowledge base or data source - resource. Note that the **vector store itself is not deleted**, only - the data. This flag is ignored if an Amazon Web Services account is - deleted. - - - RETAIN: Retains all data from your data source that's converted into - vector embeddings upon deletion of a knowledge base or data source - resource. Note that the **vector store itself is not deleted** if you - delete a knowledge base or data source resource. - - Note: - For managed knowledge bases, the only supported option is `DELETE`, - which is also the default. - """ - - server_side_encryption_configuration: ServerSideEncryptionConfiguration | None = ( - None - ) - """Contains details about the server-side encryption for the data source.""" - - vector_ingestion_configuration: VectorIngestionConfiguration | None = None - """Contains details about how to ingest the documents in the data source.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_DATA_SOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.knowledge_base_id is not None: - serializer.write_string( - _SCHEMA_CREATE_DATA_SOURCE_INPUT.members["knowledgeBaseId"], - self.knowledge_base_id, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_DATA_SOURCE_INPUT.members["clientToken"], - self.client_token, - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_DATA_SOURCE_INPUT.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_DATA_SOURCE_INPUT.members["description"], - self.description, - ) - - if self.data_source_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_DATA_SOURCE_INPUT.members["dataSourceConfiguration"], - self.data_source_configuration, - ) - - if self.data_deletion_policy is not None: - serializer.write_string( - _SCHEMA_CREATE_DATA_SOURCE_INPUT.members["dataDeletionPolicy"], - self.data_deletion_policy, - ) - - if self.server_side_encryption_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_DATA_SOURCE_INPUT.members[ - "serverSideEncryptionConfiguration" - ], - self.server_side_encryption_configuration, - ) - - if self.vector_ingestion_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_DATA_SOURCE_INPUT.members[ - "vectorIngestionConfiguration" - ], - self.vector_ingestion_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["knowledge_base_id"] = de.read_string( - _SCHEMA_CREATE_DATA_SOURCE_INPUT.members["knowledgeBaseId"] - ) - - case 1: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_DATA_SOURCE_INPUT.members["clientToken"] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_DATA_SOURCE_INPUT.members["name"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_DATA_SOURCE_INPUT.members["description"] - ) - - case 4: - kwargs["data_source_configuration"] = ( - DataSourceConfiguration.deserialize(de) - ) - - case 5: - kwargs["data_deletion_policy"] = DataDeletionPolicy( - de.read_string( - _SCHEMA_CREATE_DATA_SOURCE_INPUT.members[ - "dataDeletionPolicy" - ] - ) - ) - - case 6: - kwargs["server_side_encryption_configuration"] = ( - ServerSideEncryptionConfiguration.deserialize(de) - ) - - case 7: - kwargs["vector_ingestion_configuration"] = ( - VectorIngestionConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_DATA_SOURCE_INPUT, consumer=_consumer) - return kwargs - - -class DataSourceStatus(UnknownEnumMixin, StrEnum): - AVAILABLE = "AVAILABLE" - DELETING = "DELETING" - DELETE_UNSUCCESSFUL = "DELETE_UNSUCCESSFUL" - CREATING = "CREATING" - UPDATING = "UPDATING" - FAILED = "FAILED" - - -@dataclass(kw_only=True) -class DataSource: - """Contains details about a data source.""" - - knowledge_base_id: str - """ - The unique identifier of the knowledge base to which the data source - belongs. - """ - - data_source_id: str - """The unique identifier of the data source.""" - - name: str - """The name of the data source.""" - - status: str - """ - The status of the data source. The following statuses are possible: - - - Available -- The data source has been created and is ready for - ingestion into the knowledge base. - - - Deleting -- The data source is being deleted. - """ - - data_source_configuration: DataSourceConfiguration - """The connection configuration for the data source.""" - - created_at: datetime - """The time at which the data source was created.""" - - updated_at: datetime - """The time at which the data source was last updated.""" - - description: str | None = None - """The description of the data source.""" - - server_side_encryption_configuration: ServerSideEncryptionConfiguration | None = ( - None - ) - """Contains details about the configuration of the server-side encryption.""" - - vector_ingestion_configuration: VectorIngestionConfiguration | None = None - """Contains details about how to ingest the documents in the data source.""" - - data_deletion_policy: str | None = None - """The data deletion policy for the data source.""" - - failure_reasons: list[str] | None = None - """The detailed reasons on the failure to delete a data source.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DATA_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DATA_SOURCE.members["knowledgeBaseId"], self.knowledge_base_id - ) - serializer.write_string( - _SCHEMA_DATA_SOURCE.members["dataSourceId"], self.data_source_id - ) - serializer.write_string(_SCHEMA_DATA_SOURCE.members["name"], self.name) - serializer.write_string(_SCHEMA_DATA_SOURCE.members["status"], self.status) - if self.description is not None: - serializer.write_string( - _SCHEMA_DATA_SOURCE.members["description"], self.description - ) - - serializer.write_struct( - _SCHEMA_DATA_SOURCE.members["dataSourceConfiguration"], - self.data_source_configuration, - ) - if self.server_side_encryption_configuration is not None: - serializer.write_struct( - _SCHEMA_DATA_SOURCE.members["serverSideEncryptionConfiguration"], - self.server_side_encryption_configuration, - ) - - if self.vector_ingestion_configuration is not None: - serializer.write_struct( - _SCHEMA_DATA_SOURCE.members["vectorIngestionConfiguration"], - self.vector_ingestion_configuration, - ) - - if self.data_deletion_policy is not None: - serializer.write_string( - _SCHEMA_DATA_SOURCE.members["dataDeletionPolicy"], - self.data_deletion_policy, - ) - - serializer.write_timestamp( - _SCHEMA_DATA_SOURCE.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_DATA_SOURCE.members["updatedAt"], self.updated_at - ) - if self.failure_reasons is not None: - _serialize_failure_reasons( - serializer, - _SCHEMA_DATA_SOURCE.members["failureReasons"], - self.failure_reasons, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["knowledge_base_id"] = de.read_string( - _SCHEMA_DATA_SOURCE.members["knowledgeBaseId"] - ) - - case 1: - kwargs["data_source_id"] = de.read_string( - _SCHEMA_DATA_SOURCE.members["dataSourceId"] - ) - - case 2: - kwargs["name"] = de.read_string(_SCHEMA_DATA_SOURCE.members["name"]) - - case 3: - kwargs["status"] = DataSourceStatus( - de.read_string(_SCHEMA_DATA_SOURCE.members["status"]) - ) - - case 4: - kwargs["description"] = de.read_string( - _SCHEMA_DATA_SOURCE.members["description"] - ) - - case 5: - kwargs["data_source_configuration"] = ( - DataSourceConfiguration.deserialize(de) - ) - - case 6: - kwargs["server_side_encryption_configuration"] = ( - ServerSideEncryptionConfiguration.deserialize(de) - ) - - case 7: - kwargs["vector_ingestion_configuration"] = ( - VectorIngestionConfiguration.deserialize(de) - ) - - case 8: - kwargs["data_deletion_policy"] = DataDeletionPolicy( - de.read_string( - _SCHEMA_DATA_SOURCE.members["dataDeletionPolicy"] - ) - ) - - case 9: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_DATA_SOURCE.members["createdAt"] - ) - - case 10: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_DATA_SOURCE.members["updatedAt"] - ) - - case 11: - kwargs["failure_reasons"] = _deserialize_failure_reasons( - de, _SCHEMA_DATA_SOURCE.members["failureReasons"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DATA_SOURCE, consumer=_consumer) - if "knowledge_base_id" not in kwargs: - kwargs["knowledge_base_id"] = "" - if "data_source_id" not in kwargs: - kwargs["data_source_id"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "status" not in kwargs: - kwargs["status"] = DataSourceStatus._corrected("") - if "data_source_configuration" not in kwargs: - kwargs["data_source_configuration"] = ( - DataSourceConfiguration._smithy_default() - ) - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls( - knowledge_base_id="", - data_source_id="", - name="", - status=DataSourceStatus._corrected(""), - data_source_configuration=DataSourceConfiguration._smithy_default(), - created_at=datetime.fromtimestamp(0, tz=timezone.utc), - updated_at=datetime.fromtimestamp(0, tz=timezone.utc), - ) - - -@dataclass(kw_only=True) -class CreateDataSourceOutput: - """Dataclass for CreateDataSourceOutput structure.""" - - data_source: DataSource - """Contains details about the data source.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_DATA_SOURCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CREATE_DATA_SOURCE_OUTPUT.members["dataSource"], self.data_source - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["data_source"] = DataSource.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_DATA_SOURCE_OUTPUT, consumer=_consumer) - if "data_source" not in kwargs: - kwargs["data_source"] = DataSource._smithy_default() - return kwargs - - -CREATE_DATA_SOURCE = APIOperation( - input=CreateDataSourceInput, - output=CreateDataSourceOutput, - schema=_SCHEMA_CREATE_DATA_SOURCE, - input_schema=_SCHEMA_CREATE_DATA_SOURCE_INPUT, - output_schema=_SCHEMA_CREATE_DATA_SOURCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrockagent#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteDataSourceInput: - """Dataclass for DeleteDataSourceInput structure.""" - - knowledge_base_id: str | None = None - """ - The unique identifier of the knowledge base from which to delete the - data source. - """ - - data_source_id: str | None = None - """The unique identifier of the data source to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_DATA_SOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.knowledge_base_id is not None: - serializer.write_string( - _SCHEMA_DELETE_DATA_SOURCE_INPUT.members["knowledgeBaseId"], - self.knowledge_base_id, - ) - - if self.data_source_id is not None: - serializer.write_string( - _SCHEMA_DELETE_DATA_SOURCE_INPUT.members["dataSourceId"], - self.data_source_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["knowledge_base_id"] = de.read_string( - _SCHEMA_DELETE_DATA_SOURCE_INPUT.members["knowledgeBaseId"] - ) - - case 1: - kwargs["data_source_id"] = de.read_string( - _SCHEMA_DELETE_DATA_SOURCE_INPUT.members["dataSourceId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_DATA_SOURCE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteDataSourceOutput: - """Dataclass for DeleteDataSourceOutput structure.""" - - knowledge_base_id: str - """ - The unique identifier of the knowledge base to which the data source - that was deleted belonged. - """ - - data_source_id: str - """The unique identifier of the data source that was deleted.""" - - status: str - """The status of the data source.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_DATA_SOURCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DELETE_DATA_SOURCE_OUTPUT.members["knowledgeBaseId"], - self.knowledge_base_id, - ) - serializer.write_string( - _SCHEMA_DELETE_DATA_SOURCE_OUTPUT.members["dataSourceId"], - self.data_source_id, - ) - serializer.write_string( - _SCHEMA_DELETE_DATA_SOURCE_OUTPUT.members["status"], self.status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["knowledge_base_id"] = de.read_string( - _SCHEMA_DELETE_DATA_SOURCE_OUTPUT.members["knowledgeBaseId"] - ) - - case 1: - kwargs["data_source_id"] = de.read_string( - _SCHEMA_DELETE_DATA_SOURCE_OUTPUT.members["dataSourceId"] - ) - - case 2: - kwargs["status"] = DataSourceStatus( - de.read_string( - _SCHEMA_DELETE_DATA_SOURCE_OUTPUT.members["status"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_DATA_SOURCE_OUTPUT, consumer=_consumer) - if "knowledge_base_id" not in kwargs: - kwargs["knowledge_base_id"] = "" - if "data_source_id" not in kwargs: - kwargs["data_source_id"] = "" - if "status" not in kwargs: - kwargs["status"] = DataSourceStatus._corrected("") - return kwargs - - -DELETE_DATA_SOURCE = APIOperation( - input=DeleteDataSourceInput, - output=DeleteDataSourceOutput, - schema=_SCHEMA_DELETE_DATA_SOURCE, - input_schema=_SCHEMA_DELETE_DATA_SOURCE_INPUT, - output_schema=_SCHEMA_DELETE_DATA_SOURCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrockagent#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetDataSourceInput: - """Dataclass for GetDataSourceInput structure.""" - - knowledge_base_id: str | None = None - """The unique identifier of the knowledge base for the data source.""" - - data_source_id: str | None = None - """The unique identifier of the data source.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DATA_SOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.knowledge_base_id is not None: - serializer.write_string( - _SCHEMA_GET_DATA_SOURCE_INPUT.members["knowledgeBaseId"], - self.knowledge_base_id, - ) - - if self.data_source_id is not None: - serializer.write_string( - _SCHEMA_GET_DATA_SOURCE_INPUT.members["dataSourceId"], - self.data_source_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["knowledge_base_id"] = de.read_string( - _SCHEMA_GET_DATA_SOURCE_INPUT.members["knowledgeBaseId"] - ) - - case 1: - kwargs["data_source_id"] = de.read_string( - _SCHEMA_GET_DATA_SOURCE_INPUT.members["dataSourceId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_DATA_SOURCE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetDataSourceOutput: - """Dataclass for GetDataSourceOutput structure.""" - - data_source: DataSource - """Contains details about the data source.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DATA_SOURCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["dataSource"], self.data_source - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["data_source"] = DataSource.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_DATA_SOURCE_OUTPUT, consumer=_consumer) - if "data_source" not in kwargs: - kwargs["data_source"] = DataSource._smithy_default() - return kwargs - - -GET_DATA_SOURCE = APIOperation( - input=GetDataSourceInput, - output=GetDataSourceOutput, - schema=_SCHEMA_GET_DATA_SOURCE, - input_schema=_SCHEMA_GET_DATA_SOURCE_INPUT, - output_schema=_SCHEMA_GET_DATA_SOURCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListDataSourcesInput: - """Dataclass for ListDataSourcesInput structure.""" - - knowledge_base_id: str | None = None - """ - The unique identifier of the knowledge base for which to return a list - of information. - """ - - max_results: int | None = None - """ - The maximum number of results to return in the response. If the total - number of results is greater than this value, use the token returned in - the response in the `nextToken` field when making another request to - return the next batch of results. - """ - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, enter the token returned in the `nextToken` - field in the response in this field to return the next batch of results. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_DATA_SOURCES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.knowledge_base_id is not None: - serializer.write_string( - _SCHEMA_LIST_DATA_SOURCES_INPUT.members["knowledgeBaseId"], - self.knowledge_base_id, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_DATA_SOURCES_INPUT.members["maxResults"], self.max_results - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_DATA_SOURCES_INPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["knowledge_base_id"] = de.read_string( - _SCHEMA_LIST_DATA_SOURCES_INPUT.members["knowledgeBaseId"] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_DATA_SOURCES_INPUT.members["maxResults"] - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_DATA_SOURCES_INPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_DATA_SOURCES_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DataSourceSummary: - """Contains details about a data source.""" - - knowledge_base_id: str - """ - The unique identifier of the knowledge base to which the data source - belongs. - """ - - data_source_id: str - """The unique identifier of the data source.""" - - name: str - """The name of the data source.""" - - status: str - """The status of the data source.""" - - updated_at: datetime - """The time at which the data source was last updated.""" - - description: str | None = None - """The description of the data source.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DATA_SOURCE_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DATA_SOURCE_SUMMARY.members["knowledgeBaseId"], - self.knowledge_base_id, - ) - serializer.write_string( - _SCHEMA_DATA_SOURCE_SUMMARY.members["dataSourceId"], self.data_source_id - ) - serializer.write_string(_SCHEMA_DATA_SOURCE_SUMMARY.members["name"], self.name) - serializer.write_string( - _SCHEMA_DATA_SOURCE_SUMMARY.members["status"], self.status - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_DATA_SOURCE_SUMMARY.members["description"], self.description - ) - - serializer.write_timestamp( - _SCHEMA_DATA_SOURCE_SUMMARY.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["knowledge_base_id"] = de.read_string( - _SCHEMA_DATA_SOURCE_SUMMARY.members["knowledgeBaseId"] - ) - - case 1: - kwargs["data_source_id"] = de.read_string( - _SCHEMA_DATA_SOURCE_SUMMARY.members["dataSourceId"] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_DATA_SOURCE_SUMMARY.members["name"] - ) - - case 3: - kwargs["status"] = DataSourceStatus( - de.read_string(_SCHEMA_DATA_SOURCE_SUMMARY.members["status"]) - ) - - case 4: - kwargs["description"] = de.read_string( - _SCHEMA_DATA_SOURCE_SUMMARY.members["description"] - ) - - case 5: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_DATA_SOURCE_SUMMARY.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DATA_SOURCE_SUMMARY, consumer=_consumer) - if "knowledge_base_id" not in kwargs: - kwargs["knowledge_base_id"] = "" - if "data_source_id" not in kwargs: - kwargs["data_source_id"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "status" not in kwargs: - kwargs["status"] = DataSourceStatus._corrected("") - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_data_source_summaries( - serializer: ShapeSerializer, schema: Schema, value: list[DataSourceSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_data_source_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[DataSourceSummary]: - result: list[DataSourceSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(DataSourceSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListDataSourcesOutput: - """Dataclass for ListDataSourcesOutput structure.""" - - data_source_summaries: list[DataSourceSummary] - """ - A list of objects, each of which contains information about a data - source. - """ - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, use this token when making another request in - the `nextToken` field to return the next batch of results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_DATA_SOURCES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_data_source_summaries( - serializer, - _SCHEMA_LIST_DATA_SOURCES_OUTPUT.members["dataSourceSummaries"], - self.data_source_summaries, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_DATA_SOURCES_OUTPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["data_source_summaries"] = ( - _deserialize_data_source_summaries( - de, - _SCHEMA_LIST_DATA_SOURCES_OUTPUT.members[ - "dataSourceSummaries" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_DATA_SOURCES_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_DATA_SOURCES_OUTPUT, consumer=_consumer) - if "data_source_summaries" not in kwargs: - kwargs["data_source_summaries"] = [] - return kwargs - - -LIST_DATA_SOURCES = APIOperation( - input=ListDataSourcesInput, - output=ListDataSourcesOutput, - schema=_SCHEMA_LIST_DATA_SOURCES, - input_schema=_SCHEMA_LIST_DATA_SOURCES_INPUT, - output_schema=_SCHEMA_LIST_DATA_SOURCES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateDataSourceInput: - """Dataclass for UpdateDataSourceInput structure.""" - - knowledge_base_id: str | None = None - """The unique identifier of the knowledge base for the data source.""" - - data_source_id: str | None = None - """The unique identifier of the data source.""" - - name: str | None = None - """Specifies a new name for the data source.""" - - description: str | None = None - """Specifies a new description for the data source.""" - - data_source_configuration: DataSourceConfiguration | None = None - """ - The connection configuration for the data source that you want to - update. - """ - - data_deletion_policy: str | None = None - """The data deletion policy for the data source that you want to update.""" - - server_side_encryption_configuration: ServerSideEncryptionConfiguration | None = ( - None - ) - """Contains details about server-side encryption of the data source.""" - - vector_ingestion_configuration: VectorIngestionConfiguration | None = None - """Contains details about how to ingest the documents in the data source.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_DATA_SOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.knowledge_base_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members["knowledgeBaseId"], - self.knowledge_base_id, - ) - - if self.data_source_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members["dataSourceId"], - self.data_source_id, - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members["description"], - self.description, - ) - - if self.data_source_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members["dataSourceConfiguration"], - self.data_source_configuration, - ) - - if self.data_deletion_policy is not None: - serializer.write_string( - _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members["dataDeletionPolicy"], - self.data_deletion_policy, - ) - - if self.server_side_encryption_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members[ - "serverSideEncryptionConfiguration" - ], - self.server_side_encryption_configuration, - ) - - if self.vector_ingestion_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members[ - "vectorIngestionConfiguration" - ], - self.vector_ingestion_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["knowledge_base_id"] = de.read_string( - _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members["knowledgeBaseId"] - ) - - case 1: - kwargs["data_source_id"] = de.read_string( - _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members["dataSourceId"] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members["name"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members["description"] - ) - - case 4: - kwargs["data_source_configuration"] = ( - DataSourceConfiguration.deserialize(de) - ) - - case 5: - kwargs["data_deletion_policy"] = DataDeletionPolicy( - de.read_string( - _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members[ - "dataDeletionPolicy" - ] - ) - ) - - case 6: - kwargs["server_side_encryption_configuration"] = ( - ServerSideEncryptionConfiguration.deserialize(de) - ) - - case 7: - kwargs["vector_ingestion_configuration"] = ( - VectorIngestionConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_DATA_SOURCE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateDataSourceOutput: - """Dataclass for UpdateDataSourceOutput structure.""" - - data_source: DataSource - """Contains details about the data source.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_DATA_SOURCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_UPDATE_DATA_SOURCE_OUTPUT.members["dataSource"], self.data_source - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["data_source"] = DataSource.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_DATA_SOURCE_OUTPUT, consumer=_consumer) - if "data_source" not in kwargs: - kwargs["data_source"] = DataSource._smithy_default() - return kwargs - - -UPDATE_DATA_SOURCE = APIOperation( - input=UpdateDataSourceInput, - output=UpdateDataSourceOutput, - schema=_SCHEMA_UPDATE_DATA_SOURCE, - input_schema=_SCHEMA_UPDATE_DATA_SOURCE_INPUT, - output_schema=_SCHEMA_UPDATE_DATA_SOURCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrockagent#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteResourcePolicyInput: - """Dataclass for DeleteResourcePolicyInput structure.""" - - resource_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the knowledge base to remove the - resource policy from. - """ - - expected_revision_id: str | None = None - """ - The expected revision identifier of the resource policy. Use this to - prevent conflicts when multiple users update the same policy - concurrently. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_RESOURCE_POLICY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_DELETE_RESOURCE_POLICY_INPUT.members["resourceArn"], - self.resource_arn, - ) - - if self.expected_revision_id is not None: - serializer.write_string( - _SCHEMA_DELETE_RESOURCE_POLICY_INPUT.members["expectedRevisionId"], - self.expected_revision_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_DELETE_RESOURCE_POLICY_INPUT.members["resourceArn"] - ) - - case 1: - kwargs["expected_revision_id"] = de.read_string( - _SCHEMA_DELETE_RESOURCE_POLICY_INPUT.members[ - "expectedRevisionId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_RESOURCE_POLICY_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteResourcePolicyOutput: - """Dataclass for DeleteResourcePolicyOutput structure.""" - - resource_arn: str - """The ARN of the knowledge base that the resource policy was removed from.""" - - revision_id: str | None = None - """The revision identifier after the resource policy was deleted.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_RESOURCE_POLICY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DELETE_RESOURCE_POLICY_OUTPUT.members["resourceArn"], - self.resource_arn, - ) - if self.revision_id is not None: - serializer.write_string( - _SCHEMA_DELETE_RESOURCE_POLICY_OUTPUT.members["revisionId"], - self.revision_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_DELETE_RESOURCE_POLICY_OUTPUT.members["resourceArn"] - ) - - case 1: - kwargs["revision_id"] = de.read_string( - _SCHEMA_DELETE_RESOURCE_POLICY_OUTPUT.members["revisionId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_RESOURCE_POLICY_OUTPUT, consumer=_consumer - ) - if "resource_arn" not in kwargs: - kwargs["resource_arn"] = "" - return kwargs - - -DELETE_RESOURCE_POLICY = APIOperation( - input=DeleteResourcePolicyInput, - output=DeleteResourcePolicyOutput, - schema=_SCHEMA_DELETE_RESOURCE_POLICY, - input_schema=_SCHEMA_DELETE_RESOURCE_POLICY_INPUT, - output_schema=_SCHEMA_DELETE_RESOURCE_POLICY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrockagent#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteVpcConfigurationInput: - """Dataclass for DeleteVpcConfigurationInput structure.""" - - knowledge_base_id: str | None = None - """ - The unique identifier of the knowledge base that owns the VPC - configuration. - """ - - vpc_configuration_id: str | None = None - """The unique identifier of the VPC configuration to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_VPC_CONFIGURATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.knowledge_base_id is not None: - serializer.write_string( - _SCHEMA_DELETE_VPC_CONFIGURATION_INPUT.members["knowledgeBaseId"], - self.knowledge_base_id, - ) - - if self.vpc_configuration_id is not None: - serializer.write_string( - _SCHEMA_DELETE_VPC_CONFIGURATION_INPUT.members["vpcConfigurationId"], - self.vpc_configuration_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["knowledge_base_id"] = de.read_string( - _SCHEMA_DELETE_VPC_CONFIGURATION_INPUT.members[ - "knowledgeBaseId" - ] - ) - - case 1: - kwargs["vpc_configuration_id"] = de.read_string( - _SCHEMA_DELETE_VPC_CONFIGURATION_INPUT.members[ - "vpcConfigurationId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_VPC_CONFIGURATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteVpcConfigurationOutput: - """Dataclass for DeleteVpcConfigurationOutput structure.""" - - vpc_configuration_id: str - """The unique identifier of the VPC configuration being deleted.""" - - status: str - """ - The current status of the VPC configuration. Immediately after a delete - request this is `DELETING`. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_VPC_CONFIGURATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DELETE_VPC_CONFIGURATION_OUTPUT.members["vpcConfigurationId"], - self.vpc_configuration_id, - ) - serializer.write_string( - _SCHEMA_DELETE_VPC_CONFIGURATION_OUTPUT.members["status"], self.status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["vpc_configuration_id"] = de.read_string( - _SCHEMA_DELETE_VPC_CONFIGURATION_OUTPUT.members[ - "vpcConfigurationId" - ] - ) - - case 1: - kwargs["status"] = VpcConfigurationStatus( - de.read_string( - _SCHEMA_DELETE_VPC_CONFIGURATION_OUTPUT.members["status"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_VPC_CONFIGURATION_OUTPUT, consumer=_consumer - ) - if "vpc_configuration_id" not in kwargs: - kwargs["vpc_configuration_id"] = "" - if "status" not in kwargs: - kwargs["status"] = VpcConfigurationStatus._corrected("") - return kwargs - - -DELETE_VPC_CONFIGURATION = APIOperation( - input=DeleteVpcConfigurationInput, - output=DeleteVpcConfigurationOutput, - schema=_SCHEMA_DELETE_VPC_CONFIGURATION, - input_schema=_SCHEMA_DELETE_VPC_CONFIGURATION_INPUT, - output_schema=_SCHEMA_DELETE_VPC_CONFIGURATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrockagent#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class FlowConditionalConnectionConfiguration: - """ - The configuration of a connection between a condition node and another - node. - """ - - condition: str - """ - The condition that triggers this connection. For more information about - how to write conditions, see the **Condition** node type in the [Node - types](https://docs.aws.amazon.com/bedrock/latest/userguide/node-types.html) - topic in the Amazon Bedrock User Guide. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_CONDITIONAL_CONNECTION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_FLOW_CONDITIONAL_CONNECTION_CONFIGURATION.members["condition"], - self.condition, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["condition"] = de.read_string( - _SCHEMA_FLOW_CONDITIONAL_CONNECTION_CONFIGURATION.members[ - "condition" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_FLOW_CONDITIONAL_CONNECTION_CONFIGURATION, consumer=_consumer - ) - if "condition" not in kwargs: - kwargs["condition"] = "" - return kwargs - - -@dataclass(kw_only=True) -class FlowDataConnectionConfiguration: - """ - The configuration of a connection originating from a node that isn't a - Condition node. - """ - - source_output: str - """ - The name of the output in the source node that the connection begins - from. - """ - - target_input: str - """The name of the input in the target node that the connection ends at.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_DATA_CONNECTION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_FLOW_DATA_CONNECTION_CONFIGURATION.members["sourceOutput"], - self.source_output, - ) - serializer.write_string( - _SCHEMA_FLOW_DATA_CONNECTION_CONFIGURATION.members["targetInput"], - self.target_input, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["source_output"] = de.read_string( - _SCHEMA_FLOW_DATA_CONNECTION_CONFIGURATION.members[ - "sourceOutput" - ] - ) - - case 1: - kwargs["target_input"] = de.read_string( - _SCHEMA_FLOW_DATA_CONNECTION_CONFIGURATION.members[ - "targetInput" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_FLOW_DATA_CONNECTION_CONFIGURATION, consumer=_consumer - ) - if "source_output" not in kwargs: - kwargs["source_output"] = "" - if "target_input" not in kwargs: - kwargs["target_input"] = "" - return kwargs - - -@dataclass -class FlowConnectionConfigurationData: - """ - The configuration of a connection originating from a node that isn't a - Condition node. - """ - - value: FlowDataConnectionConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_CONNECTION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_CONNECTION_CONFIGURATION.members["data"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=FlowDataConnectionConfiguration.deserialize(deserializer)) - - -@dataclass -class FlowConnectionConfigurationConditional: - """The configuration of a connection originating from a Condition node.""" - - value: FlowConditionalConnectionConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_CONNECTION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_CONNECTION_CONFIGURATION.members["conditional"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=FlowConditionalConnectionConfiguration.deserialize(deserializer) - ) - - -@dataclass -class FlowConnectionConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -FlowConnectionConfiguration = Union[ - FlowConnectionConfigurationData - | FlowConnectionConfigurationConditional - | FlowConnectionConfigurationUnknown -] -"""The configuration of the connection.""" - - -class _FlowConnectionConfigurationDeserializer: - _result: FlowConnectionConfiguration | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> FlowConnectionConfiguration: - self._result = None - deserializer.read_struct(_SCHEMA_FLOW_CONNECTION_CONFIGURATION, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(FlowConnectionConfigurationData.deserialize(de)) - - case 1: - self._set_result(FlowConnectionConfigurationConditional.deserialize(de)) - - case _: - self._set_result( - FlowConnectionConfigurationUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: FlowConnectionConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class FlowConnectionType(UnknownEnumMixin, StrEnum): - DATA = "Data" - CONDITIONAL = "Conditional" - - -@dataclass(kw_only=True) -class FlowConnection: - """Contains information about a connection between two nodes in the flow.""" - - type: str - """ - Whether the source node that the connection begins from is a condition - node (`Conditional`) or not (`Data`). - """ - - name: str - """A name for the connection that you can reference.""" - - source: str - """The node that the connection starts at.""" - - target: str - """The node that the connection ends at.""" - - configuration: FlowConnectionConfiguration | None = None - """The configuration of the connection.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_CONNECTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_FLOW_CONNECTION.members["type"], self.type) - serializer.write_string(_SCHEMA_FLOW_CONNECTION.members["name"], self.name) - serializer.write_string(_SCHEMA_FLOW_CONNECTION.members["source"], self.source) - serializer.write_string(_SCHEMA_FLOW_CONNECTION.members["target"], self.target) - if self.configuration is not None: - serializer.write_struct( - _SCHEMA_FLOW_CONNECTION.members["configuration"], self.configuration - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = FlowConnectionType( - de.read_string(_SCHEMA_FLOW_CONNECTION.members["type"]) - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_FLOW_CONNECTION.members["name"] - ) - - case 2: - kwargs["source"] = de.read_string( - _SCHEMA_FLOW_CONNECTION.members["source"] - ) - - case 3: - kwargs["target"] = de.read_string( - _SCHEMA_FLOW_CONNECTION.members["target"] - ) - - case 4: - kwargs["configuration"] = ( - _FlowConnectionConfigurationDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FLOW_CONNECTION, consumer=_consumer) - if "type" not in kwargs: - kwargs["type"] = FlowConnectionType._corrected("") - if "name" not in kwargs: - kwargs["name"] = "" - if "source" not in kwargs: - kwargs["source"] = "" - if "target" not in kwargs: - kwargs["target"] = "" - return kwargs - - -def _serialize_flow_connections( - serializer: ShapeSerializer, schema: Schema, value: list[FlowConnection] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_flow_connections( - deserializer: ShapeDeserializer, schema: Schema -) -> list[FlowConnection]: - result: list[FlowConnection] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(FlowConnection.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CollectorFlowNodeConfiguration: - """ - Defines a collector node in your flow. This node takes an iteration of - inputs and consolidates them into an array in the output. For more - information, see [Node types in a - flow](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-nodes.html) - in the Amazon Bedrock User Guide. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_COLLECTOR_FLOW_NODE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_COLLECTOR_FLOW_NODE_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class FlowCondition: - """Defines a condition in the condition node.""" - - name: str - """A name for the condition that you can reference.""" - - expression: str | None = field(repr=False, default=None) - """ - Defines the condition. You must refer to at least one of the inputs in - the condition. For more information, expand the Condition node section - in [Node types in prompt - flows](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-how-it-works.html#flows-nodes). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_CONDITION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_FLOW_CONDITION.members["name"], self.name) - if self.expression is not None: - serializer.write_string( - _SCHEMA_FLOW_CONDITION.members["expression"], self.expression - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_FLOW_CONDITION.members["name"] - ) - - case 1: - kwargs["expression"] = de.read_string( - _SCHEMA_FLOW_CONDITION.members["expression"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FLOW_CONDITION, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(name="") - - -def _serialize_flow_conditions( - serializer: ShapeSerializer, schema: Schema, value: list[FlowCondition] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_flow_conditions( - deserializer: ShapeDeserializer, schema: Schema -) -> list[FlowCondition]: - result: list[FlowCondition] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(FlowCondition.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ConditionFlowNodeConfiguration: - """ - Defines a condition node in your flow. You can specify conditions that - determine which node comes next in the flow. For more information, see - [Node types in a - flow](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-nodes.html) - in the Amazon Bedrock User Guide. - """ - - conditions: list[FlowCondition] - """ - An array of conditions. Each member contains the name of a condition and - an expression that defines the condition. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONDITION_FLOW_NODE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_flow_conditions( - serializer, - _SCHEMA_CONDITION_FLOW_NODE_CONFIGURATION.members["conditions"], - self.conditions, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["conditions"] = _deserialize_flow_conditions( - de, - _SCHEMA_CONDITION_FLOW_NODE_CONFIGURATION.members["conditions"], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CONDITION_FLOW_NODE_CONFIGURATION, consumer=_consumer - ) - if "conditions" not in kwargs: - kwargs["conditions"] = [] - return kwargs - - -class SupportedLanguages(UnknownEnumMixin, StrEnum): - PYTHON_3 = "Python_3" - - -@dataclass(kw_only=True) -class InlineCodeFlowNodeConfiguration: - """ - Contains configurations for an inline code node in your flow. Inline - code nodes let you write and execute code directly within your flow, - enabling data transformations, custom logic, and integrations without - needing an external Lambda function. - """ - - code: str = field(repr=False, default="") - """ - The code that's executed in your inline code node. The code can access - input data from previous nodes in the flow, perform operations on that - data, and produce output that can be used by other nodes in your flow. - - The code must be valid in the programming `language` that you specify. - """ - - language: str = SupportedLanguages("Python_3") - """ - The programming language used by your inline code node. - - The code must be valid in the programming `language` that you specify. - Currently, only Python 3 (`Python_3`) is supported. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INLINE_CODE_FLOW_NODE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_INLINE_CODE_FLOW_NODE_CONFIGURATION.members["code"], self.code - ) - serializer.write_string( - _SCHEMA_INLINE_CODE_FLOW_NODE_CONFIGURATION.members["language"], - self.language, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["code"] = de.read_string( - _SCHEMA_INLINE_CODE_FLOW_NODE_CONFIGURATION.members["code"] - ) - - case 1: - kwargs["language"] = SupportedLanguages( - de.read_string( - _SCHEMA_INLINE_CODE_FLOW_NODE_CONFIGURATION.members[ - "language" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INLINE_CODE_FLOW_NODE_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InputFlowNodeConfiguration: - """ - Contains configurations for the input flow node for a flow. This node - takes the input from flow invocation and passes it to the next node in - the data type that you specify. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INPUT_FLOW_NODE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INPUT_FLOW_NODE_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class IteratorFlowNodeConfiguration: - """ - Contains configurations for an iterator node in a flow. Takes an input - that is an array and iteratively sends each item of the array as an - output to the following node. The size of the array is also returned in - the output. - - The output flow node at the end of the flow iteration will return a - response for each member of the array. To return only one response, you - can include a collector node downstream from the iterator node. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ITERATOR_FLOW_NODE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ITERATOR_FLOW_NODE_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class PromptModelInferenceConfiguration: - """ - Contains inference configurations related to model inference for a - prompt. For more information, see [Inference - parameters](https://docs.aws.amazon.com/bedrock/latest/userguide/inference-parameters.html). - """ - - temperature: float | None = None - """ - Controls the randomness of the response. Choose a lower value for more - predictable outputs and a higher value for more surprising outputs. - """ - - top_p: float | None = None - """ - The percentage of most-likely candidates that the model considers for - the next token. - """ - - max_tokens: int | None = None - """The maximum number of tokens to return in the response.""" - - stop_sequences: list[str] | None = None - """ - A list of strings that define sequences after which the model will stop - generating. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PROMPT_MODEL_INFERENCE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.temperature is not None: - serializer.write_float( - _SCHEMA_PROMPT_MODEL_INFERENCE_CONFIGURATION.members["temperature"], - self.temperature, - ) - - if self.top_p is not None: - serializer.write_float( - _SCHEMA_PROMPT_MODEL_INFERENCE_CONFIGURATION.members["topP"], self.top_p - ) - - if self.max_tokens is not None: - serializer.write_integer( - _SCHEMA_PROMPT_MODEL_INFERENCE_CONFIGURATION.members["maxTokens"], - self.max_tokens, - ) - - if self.stop_sequences is not None: - _serialize_stop_sequences( - serializer, - _SCHEMA_PROMPT_MODEL_INFERENCE_CONFIGURATION.members["stopSequences"], - self.stop_sequences, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["temperature"] = de.read_float( - _SCHEMA_PROMPT_MODEL_INFERENCE_CONFIGURATION.members[ - "temperature" - ] - ) - - case 1: - kwargs["top_p"] = de.read_float( - _SCHEMA_PROMPT_MODEL_INFERENCE_CONFIGURATION.members["topP"] - ) - - case 2: - kwargs["max_tokens"] = de.read_integer( - _SCHEMA_PROMPT_MODEL_INFERENCE_CONFIGURATION.members[ - "maxTokens" - ] - ) - - case 3: - kwargs["stop_sequences"] = _deserialize_stop_sequences( - de, - _SCHEMA_PROMPT_MODEL_INFERENCE_CONFIGURATION.members[ - "stopSequences" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PROMPT_MODEL_INFERENCE_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass -class PromptInferenceConfigurationText: - """Contains inference configurations for a text prompt.""" - - value: PromptModelInferenceConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PROMPT_INFERENCE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_PROMPT_INFERENCE_CONFIGURATION.members["text"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=PromptModelInferenceConfiguration.deserialize(deserializer)) - - -@dataclass -class PromptInferenceConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -PromptInferenceConfiguration = Union[ - PromptInferenceConfigurationText | PromptInferenceConfigurationUnknown -] -"""Contains inference configurations for the prompt.""" - - -class _PromptInferenceConfigurationDeserializer: - _result: PromptInferenceConfiguration | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> PromptInferenceConfiguration: - self._result = None - deserializer.read_struct(_SCHEMA_PROMPT_INFERENCE_CONFIGURATION, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(PromptInferenceConfigurationText.deserialize(de)) - - case _: - self._set_result( - PromptInferenceConfigurationUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: PromptInferenceConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class PerformanceConfigLatency(UnknownEnumMixin, StrEnum): - STANDARD = "standard" - OPTIMIZED = "optimized" - - -@dataclass(kw_only=True) -class PerformanceConfiguration: - """ - The performance-related configuration options for the knowledge base - retrieval and generation process. - """ - - latency: str = PerformanceConfigLatency("standard") - """The latency optimization setting.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PERFORMANCE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_PERFORMANCE_CONFIGURATION.members["latency"], self.latency - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["latency"] = PerformanceConfigLatency( - de.read_string( - _SCHEMA_PERFORMANCE_CONFIGURATION.members["latency"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PERFORMANCE_CONFIGURATION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class KnowledgeBasePromptTemplate: - """ - Defines a custom prompt template for orchestrating the retrieval and - generation process. - """ - - text_prompt_template: str | None = field(repr=False, default=None) - """The text of the prompt template.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KNOWLEDGE_BASE_PROMPT_TEMPLATE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.text_prompt_template is not None: - serializer.write_string( - _SCHEMA_KNOWLEDGE_BASE_PROMPT_TEMPLATE.members["textPromptTemplate"], - self.text_prompt_template, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["text_prompt_template"] = de.read_string( - _SCHEMA_KNOWLEDGE_BASE_PROMPT_TEMPLATE.members[ - "textPromptTemplate" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_KNOWLEDGE_BASE_PROMPT_TEMPLATE, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class KnowledgeBaseOrchestrationConfiguration: - """ - Configures how the knowledge base orchestrates the retrieval and - generation process, allowing for customization of prompts, inference - parameters, and performance settings. - """ - - prompt_template: KnowledgeBasePromptTemplate | None = None - """ - A custom prompt template for orchestrating the retrieval and generation - process. - """ - - inference_config: PromptInferenceConfiguration | None = None - """Contains inference configurations for the prompt.""" - - additional_model_request_fields: dict[str, Document] | None = None - """ - The additional model-specific request parameters as key-value pairs to - be included in the request to the foundation model. - """ - - performance_config: PerformanceConfiguration | None = None - """ - The performance configuration options for the knowledge base retrieval - and generation process. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_KNOWLEDGE_BASE_ORCHESTRATION_CONFIGURATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.prompt_template is not None: - serializer.write_struct( - _SCHEMA_KNOWLEDGE_BASE_ORCHESTRATION_CONFIGURATION.members[ - "promptTemplate" - ], - self.prompt_template, - ) - - if self.inference_config is not None: - serializer.write_struct( - _SCHEMA_KNOWLEDGE_BASE_ORCHESTRATION_CONFIGURATION.members[ - "inferenceConfig" - ], - self.inference_config, - ) - - if self.additional_model_request_fields is not None: - _serialize_additional_model_request_fields( - serializer, - _SCHEMA_KNOWLEDGE_BASE_ORCHESTRATION_CONFIGURATION.members[ - "additionalModelRequestFields" - ], - self.additional_model_request_fields, - ) - - if self.performance_config is not None: - serializer.write_struct( - _SCHEMA_KNOWLEDGE_BASE_ORCHESTRATION_CONFIGURATION.members[ - "performanceConfig" - ], - self.performance_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["prompt_template"] = KnowledgeBasePromptTemplate.deserialize( - de - ) - - case 1: - kwargs["inference_config"] = ( - _PromptInferenceConfigurationDeserializer().deserialize(de) - ) - - case 2: - kwargs["additional_model_request_fields"] = ( - _deserialize_additional_model_request_fields( - de, - _SCHEMA_KNOWLEDGE_BASE_ORCHESTRATION_CONFIGURATION.members[ - "additionalModelRequestFields" - ], - ) - ) - - case 3: - kwargs["performance_config"] = PerformanceConfiguration.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_KNOWLEDGE_BASE_ORCHESTRATION_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -class RerankingMetadataSelectionMode(UnknownEnumMixin, StrEnum): - SELECTIVE = "SELECTIVE" - ALL = "ALL" - - -@dataclass(kw_only=True) -class FieldForReranking: - """ - Specifies a metadata field to include or exclude during the reranking - process. - """ - - field_name: str - """The name of the metadata field to include or exclude during reranking.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FIELD_FOR_RERANKING, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_FIELD_FOR_RERANKING.members["fieldName"], self.field_name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["field_name"] = de.read_string( - _SCHEMA_FIELD_FOR_RERANKING.members["fieldName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FIELD_FOR_RERANKING, consumer=_consumer) - if "field_name" not in kwargs: - kwargs["field_name"] = "" - return kwargs - - -def _serialize_fields_for_reranking( - serializer: ShapeSerializer, schema: Schema, value: list[FieldForReranking] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_fields_for_reranking( - deserializer: ShapeDeserializer, schema: Schema -) -> list[FieldForReranking]: - result: list[FieldForReranking] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(FieldForReranking.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass -class RerankingMetadataSelectiveModeConfigurationFieldsToInclude: - """Specifies the metadata fields to include in the reranking process.""" - - value: list[FieldForReranking] - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_fields_for_reranking( - serializer, - _SCHEMA_RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION.members[ - "fieldsToInclude" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_deserialize_fields_for_reranking( - deserializer, - _SCHEMA_RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION.members[ - "fieldsToInclude" - ], - ) - ) - - -@dataclass -class RerankingMetadataSelectiveModeConfigurationFieldsToExclude: - """Specifies the metadata fields to exclude from the reranking process.""" - - value: list[FieldForReranking] - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_fields_for_reranking( - serializer, - _SCHEMA_RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION.members[ - "fieldsToExclude" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_deserialize_fields_for_reranking( - deserializer, - _SCHEMA_RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION.members[ - "fieldsToExclude" - ], - ) - ) - - -@dataclass -class RerankingMetadataSelectiveModeConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -RerankingMetadataSelectiveModeConfiguration = Union[ - RerankingMetadataSelectiveModeConfigurationFieldsToInclude - | RerankingMetadataSelectiveModeConfigurationFieldsToExclude - | RerankingMetadataSelectiveModeConfigurationUnknown -] -""" -Configures the metadata fields to include or exclude during the -reranking process when using selective mode. -""" - - -class _RerankingMetadataSelectiveModeConfigurationDeserializer: - _result: RerankingMetadataSelectiveModeConfiguration | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> RerankingMetadataSelectiveModeConfiguration: - self._result = None - deserializer.read_struct( - _SCHEMA_RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - RerankingMetadataSelectiveModeConfigurationFieldsToInclude.deserialize( - de - ) - ) - - case 1: - self._set_result( - RerankingMetadataSelectiveModeConfigurationFieldsToExclude.deserialize( - de - ) - ) - - case _: - self._set_result( - RerankingMetadataSelectiveModeConfigurationUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: RerankingMetadataSelectiveModeConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class MetadataConfigurationForReranking: - """ - Specifies how metadata fields should be handled during the reranking - process. - """ - - selection_mode: str - """The mode for selecting metadata fields for reranking.""" - - selective_mode_configuration: RerankingMetadataSelectiveModeConfiguration | None = ( - None - ) - """ - The configuration for selective metadata field inclusion or exclusion - during reranking. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_METADATA_CONFIGURATION_FOR_RERANKING, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_METADATA_CONFIGURATION_FOR_RERANKING.members["selectionMode"], - self.selection_mode, - ) - if self.selective_mode_configuration is not None: - serializer.write_struct( - _SCHEMA_METADATA_CONFIGURATION_FOR_RERANKING.members[ - "selectiveModeConfiguration" - ], - self.selective_mode_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["selection_mode"] = RerankingMetadataSelectionMode( - de.read_string( - _SCHEMA_METADATA_CONFIGURATION_FOR_RERANKING.members[ - "selectionMode" - ] - ) - ) - - case 1: - kwargs["selective_mode_configuration"] = ( - _RerankingMetadataSelectiveModeConfigurationDeserializer().deserialize( - de - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_METADATA_CONFIGURATION_FOR_RERANKING, consumer=_consumer - ) - if "selection_mode" not in kwargs: - kwargs["selection_mode"] = RerankingMetadataSelectionMode._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class VectorSearchBedrockRerankingModelConfiguration: - """ - Configures the Amazon Bedrock model used for reranking retrieved - results. - """ - - model_arn: str - """The Amazon Resource Name (ARN) of the Amazon Bedrock reranker model.""" - - additional_model_request_fields: dict[str, Document] | None = None - """ - Specifies additional model-specific request parameters as key-value - pairs that are included in the request to the Amazon Bedrock reranker - model. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_VECTOR_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_VECTOR_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION.members[ - "modelArn" - ], - self.model_arn, - ) - if self.additional_model_request_fields is not None: - _serialize_additional_model_request_fields( - serializer, - _SCHEMA_VECTOR_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION.members[ - "additionalModelRequestFields" - ], - self.additional_model_request_fields, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_arn"] = de.read_string( - _SCHEMA_VECTOR_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION.members[ - "modelArn" - ] - ) - - case 1: - kwargs["additional_model_request_fields"] = ( - _deserialize_additional_model_request_fields( - de, - _SCHEMA_VECTOR_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION.members[ - "additionalModelRequestFields" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_VECTOR_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION, - consumer=_consumer, - ) - if "model_arn" not in kwargs: - kwargs["model_arn"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(model_arn="") - - -@dataclass(kw_only=True) -class VectorSearchBedrockRerankingConfiguration: - """ - Configures the Amazon Bedrock reranker model to improve the relevance of - retrieved results. - """ - - model_configuration: VectorSearchBedrockRerankingModelConfiguration - """Specifies the configuration for the Amazon Bedrock reranker model.""" - - number_of_reranked_results: int | None = None - """Specifies the number of results to return after reranking.""" - - metadata_configuration: MetadataConfigurationForReranking | None = None - """ - Specifies how metadata fields should be handled during the reranking - process. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_VECTOR_SEARCH_BEDROCK_RERANKING_CONFIGURATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_VECTOR_SEARCH_BEDROCK_RERANKING_CONFIGURATION.members[ - "modelConfiguration" - ], - self.model_configuration, - ) - if self.number_of_reranked_results is not None: - serializer.write_integer( - _SCHEMA_VECTOR_SEARCH_BEDROCK_RERANKING_CONFIGURATION.members[ - "numberOfRerankedResults" - ], - self.number_of_reranked_results, - ) - - if self.metadata_configuration is not None: - serializer.write_struct( - _SCHEMA_VECTOR_SEARCH_BEDROCK_RERANKING_CONFIGURATION.members[ - "metadataConfiguration" - ], - self.metadata_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_configuration"] = ( - VectorSearchBedrockRerankingModelConfiguration.deserialize(de) - ) - - case 1: - kwargs["number_of_reranked_results"] = de.read_integer( - _SCHEMA_VECTOR_SEARCH_BEDROCK_RERANKING_CONFIGURATION.members[ - "numberOfRerankedResults" - ] - ) - - case 2: - kwargs["metadata_configuration"] = ( - MetadataConfigurationForReranking.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_VECTOR_SEARCH_BEDROCK_RERANKING_CONFIGURATION, consumer=_consumer - ) - if "model_configuration" not in kwargs: - kwargs["model_configuration"] = ( - VectorSearchBedrockRerankingModelConfiguration._smithy_default() - ) - return kwargs - - -class VectorSearchRerankingConfigurationType(UnknownEnumMixin, StrEnum): - BEDROCK_RERANKING_MODEL = "BEDROCK_RERANKING_MODEL" - - -@dataclass(kw_only=True) -class VectorSearchRerankingConfiguration: - """ - Specifies how retrieved results from a knowledge base are reranked to - improve relevance. - """ - - type: str - """ - Specifies the type of reranking model to use. Currently, the only - supported value is `BEDROCK_RERANKING_MODEL`. - """ - - bedrock_reranking_configuration: ( - VectorSearchBedrockRerankingConfiguration | None - ) = None - """ - Specifies the configuration for using an Amazon Bedrock reranker model - to rerank retrieved results. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VECTOR_SEARCH_RERANKING_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_VECTOR_SEARCH_RERANKING_CONFIGURATION.members["type"], self.type - ) - if self.bedrock_reranking_configuration is not None: - serializer.write_struct( - _SCHEMA_VECTOR_SEARCH_RERANKING_CONFIGURATION.members[ - "bedrockRerankingConfiguration" - ], - self.bedrock_reranking_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = VectorSearchRerankingConfigurationType( - de.read_string( - _SCHEMA_VECTOR_SEARCH_RERANKING_CONFIGURATION.members[ - "type" - ] - ) - ) - - case 1: - kwargs["bedrock_reranking_configuration"] = ( - VectorSearchBedrockRerankingConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_VECTOR_SEARCH_RERANKING_CONFIGURATION, consumer=_consumer - ) - if "type" not in kwargs: - kwargs["type"] = VectorSearchRerankingConfigurationType._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class KnowledgeBaseFlowNodeConfiguration: - """ - Contains configurations for a knowledge base node in a flow. This node - takes a query as the input and returns, as the output, the retrieved - responses directly (as an array) or a response generated based on the - retrieved responses. For more information, see [Node types in a - flow](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-nodes.html) - in the Amazon Bedrock User Guide. - """ - - knowledge_base_id: str = "" - """The unique identifier of the knowledge base to query.""" - - model_id: str | None = None - """ - The unique identifier of the model or [inference - profile](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html) - to use to generate a response from the query results. Omit this field if - you want to return the retrieved results as an array. - """ - - guardrail_configuration: GuardrailConfiguration | None = None - """ - Contains configurations for a guardrail to apply during query and - response generation for the knowledge base in this configuration. - """ - - number_of_results: int | None = None - """The number of results to retrieve from the knowledge base.""" - - prompt_template: KnowledgeBasePromptTemplate | None = None - """ - A custom prompt template to use with the knowledge base for generating - responses. - """ - - inference_configuration: PromptInferenceConfiguration | None = None - """Contains inference configurations for the prompt.""" - - reranking_configuration: VectorSearchRerankingConfiguration | None = None - """ - The configuration for reranking the retrieved results from the knowledge - base to improve relevance. - """ - - orchestration_configuration: KnowledgeBaseOrchestrationConfiguration | None = None - """ - The configuration for orchestrating the retrieval and generation process - in the knowledge base node. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KNOWLEDGE_BASE_FLOW_NODE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_KNOWLEDGE_BASE_FLOW_NODE_CONFIGURATION.members["knowledgeBaseId"], - self.knowledge_base_id, - ) - if self.model_id is not None: - serializer.write_string( - _SCHEMA_KNOWLEDGE_BASE_FLOW_NODE_CONFIGURATION.members["modelId"], - self.model_id, - ) - - if self.guardrail_configuration is not None: - serializer.write_struct( - _SCHEMA_KNOWLEDGE_BASE_FLOW_NODE_CONFIGURATION.members[ - "guardrailConfiguration" - ], - self.guardrail_configuration, - ) - - if self.number_of_results is not None: - serializer.write_integer( - _SCHEMA_KNOWLEDGE_BASE_FLOW_NODE_CONFIGURATION.members[ - "numberOfResults" - ], - self.number_of_results, - ) - - if self.prompt_template is not None: - serializer.write_struct( - _SCHEMA_KNOWLEDGE_BASE_FLOW_NODE_CONFIGURATION.members[ - "promptTemplate" - ], - self.prompt_template, - ) - - if self.inference_configuration is not None: - serializer.write_struct( - _SCHEMA_KNOWLEDGE_BASE_FLOW_NODE_CONFIGURATION.members[ - "inferenceConfiguration" - ], - self.inference_configuration, - ) - - if self.reranking_configuration is not None: - serializer.write_struct( - _SCHEMA_KNOWLEDGE_BASE_FLOW_NODE_CONFIGURATION.members[ - "rerankingConfiguration" - ], - self.reranking_configuration, - ) - - if self.orchestration_configuration is not None: - serializer.write_struct( - _SCHEMA_KNOWLEDGE_BASE_FLOW_NODE_CONFIGURATION.members[ - "orchestrationConfiguration" - ], - self.orchestration_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["knowledge_base_id"] = de.read_string( - _SCHEMA_KNOWLEDGE_BASE_FLOW_NODE_CONFIGURATION.members[ - "knowledgeBaseId" - ] - ) - - case 1: - kwargs["model_id"] = de.read_string( - _SCHEMA_KNOWLEDGE_BASE_FLOW_NODE_CONFIGURATION.members[ - "modelId" - ] - ) - - case 2: - kwargs["guardrail_configuration"] = ( - GuardrailConfiguration.deserialize(de) - ) - - case 3: - kwargs["number_of_results"] = de.read_integer( - _SCHEMA_KNOWLEDGE_BASE_FLOW_NODE_CONFIGURATION.members[ - "numberOfResults" - ] - ) - - case 4: - kwargs["prompt_template"] = KnowledgeBasePromptTemplate.deserialize( - de - ) - - case 5: - kwargs["inference_configuration"] = ( - _PromptInferenceConfigurationDeserializer().deserialize(de) - ) - - case 6: - kwargs["reranking_configuration"] = ( - VectorSearchRerankingConfiguration.deserialize(de) - ) - - case 7: - kwargs["orchestration_configuration"] = ( - KnowledgeBaseOrchestrationConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_KNOWLEDGE_BASE_FLOW_NODE_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class LambdaFunctionFlowNodeConfiguration: - """ - Contains configurations for a Lambda function node in the flow. You - specify the Lambda function to invoke and the inputs into the function. - The output is the response that is defined in the Lambda function. For - more information, see [Node types in a - flow](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-nodes.html) - in the Amazon Bedrock User Guide. - """ - - lambda_arn: str = "" - """The Amazon Resource Name (ARN) of the Lambda function to invoke.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LAMBDA_FUNCTION_FLOW_NODE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_LAMBDA_FUNCTION_FLOW_NODE_CONFIGURATION.members["lambdaArn"], - self.lambda_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["lambda_arn"] = de.read_string( - _SCHEMA_LAMBDA_FUNCTION_FLOW_NODE_CONFIGURATION.members[ - "lambdaArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LAMBDA_FUNCTION_FLOW_NODE_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class LexFlowNodeConfiguration: - """ - Contains configurations for a Lex node in the flow. You specify a Amazon - Lex bot to invoke. This node takes an utterance as the input and returns - as the output the intent identified by the Amazon Lex bot. For more - information, see [Node types in a - flow](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-nodes.html) - in the Amazon Bedrock User Guide. - """ - - bot_alias_arn: str = "" - """The Amazon Resource Name (ARN) of the Amazon Lex bot alias to invoke.""" - - locale_id: str = "" - """The Region to invoke the Amazon Lex bot in.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LEX_FLOW_NODE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_LEX_FLOW_NODE_CONFIGURATION.members["botAliasArn"], - self.bot_alias_arn, - ) - serializer.write_string( - _SCHEMA_LEX_FLOW_NODE_CONFIGURATION.members["localeId"], self.locale_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bot_alias_arn"] = de.read_string( - _SCHEMA_LEX_FLOW_NODE_CONFIGURATION.members["botAliasArn"] - ) - - case 1: - kwargs["locale_id"] = de.read_string( - _SCHEMA_LEX_FLOW_NODE_CONFIGURATION.members["localeId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LEX_FLOW_NODE_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class LoopControllerFlowNodeConfiguration: - """ - Contains configurations for the controller node of a DoWhile loop in the - flow. - """ - - continue_condition: FlowCondition - """ - Specifies the condition that determines when the flow exits the DoWhile - loop. The loop executes until this condition evaluates to true. - """ - - max_iterations: int = 10 - """ - Specifies the maximum number of times the DoWhile loop can iterate - before the flow exits the loop. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LOOP_CONTROLLER_FLOW_NODE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_LOOP_CONTROLLER_FLOW_NODE_CONFIGURATION.members[ - "continueCondition" - ], - self.continue_condition, - ) - serializer.write_integer( - _SCHEMA_LOOP_CONTROLLER_FLOW_NODE_CONFIGURATION.members["maxIterations"], - self.max_iterations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["continue_condition"] = FlowCondition.deserialize(de) - - case 1: - kwargs["max_iterations"] = de.read_integer( - _SCHEMA_LOOP_CONTROLLER_FLOW_NODE_CONFIGURATION.members[ - "maxIterations" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LOOP_CONTROLLER_FLOW_NODE_CONFIGURATION, consumer=_consumer - ) - if "continue_condition" not in kwargs: - kwargs["continue_condition"] = FlowCondition._smithy_default() - return kwargs - - -@dataclass(kw_only=True) -class LoopInputFlowNodeConfiguration: - """ - Contains configurations for the input node of a DoWhile loop in the - flow. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LOOP_INPUT_FLOW_NODE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LOOP_INPUT_FLOW_NODE_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class OutputFlowNodeConfiguration: - """ - Contains configurations for an output flow node in the flow. You specify - the data type expected for the input into the node in the `type` field - and how to return the final output in the `expression` field. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OUTPUT_FLOW_NODE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_OUTPUT_FLOW_NODE_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class PromptInputVariable: - """Contains information about a variable in the prompt.""" - - name: str | None = None - """The name of the variable.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PROMPT_INPUT_VARIABLE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_PROMPT_INPUT_VARIABLE.members["name"], self.name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_PROMPT_INPUT_VARIABLE.members["name"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PROMPT_INPUT_VARIABLE, consumer=_consumer) - return kwargs - - -def _serialize_prompt_input_variables_list( - serializer: ShapeSerializer, schema: Schema, value: list[PromptInputVariable] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_prompt_input_variables_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[PromptInputVariable]: - result: list[PromptInputVariable] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(PromptInputVariable.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class CachePointType(UnknownEnumMixin, StrEnum): - DEFAULT = "default" - - -@dataclass(kw_only=True) -class CachePointBlock: - """ - Indicates where a cache checkpoint is located. All information before - this checkpoint is cached to be accessed on subsequent requests. - """ - - type: str - """Indicates that the CachePointBlock is of the default type""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CACHE_POINT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_CACHE_POINT_BLOCK.members["type"], self.type) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = CachePointType( - de.read_string(_SCHEMA_CACHE_POINT_BLOCK.members["type"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CACHE_POINT_BLOCK, consumer=_consumer) - if "type" not in kwargs: - kwargs["type"] = CachePointType._corrected("") - return kwargs - - -@dataclass -class ContentBlockText: - """The text in the message.""" - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_CONTENT_BLOCK.members["text"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string(_SCHEMA_CONTENT_BLOCK.members["text"]) - ) - - -@dataclass -class ContentBlockCachePoint: - """Creates a cache checkpoint within a message.""" - - value: CachePointBlock - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT_BLOCK.members["cachePoint"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=CachePointBlock.deserialize(deserializer)) - - -@dataclass -class ContentBlockUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ContentBlock = Union[ContentBlockText | ContentBlockCachePoint | ContentBlockUnknown] -""" -Contains the content for the message you pass to, or receive from a -model. For more information, see [Create a prompt using Prompt -management](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-create.html). -""" - - -class _ContentBlockDeserializer: - _result: ContentBlock | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> ContentBlock: - self._result = None - deserializer.read_struct(_SCHEMA_CONTENT_BLOCK, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(ContentBlockText.deserialize(de)) - - case 1: - self._set_result(ContentBlockCachePoint.deserialize(de)) - - case _: - self._set_result(ContentBlockUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: ContentBlock) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_content_blocks( - serializer: ShapeSerializer, schema: Schema, value: list[ContentBlock] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_content_blocks( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ContentBlock]: - result: list[ContentBlock] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_ContentBlockDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class ConversationRole(UnknownEnumMixin, StrEnum): - USER = "user" - ASSISTANT = "assistant" - - -@dataclass(kw_only=True) -class Message: - """ - A message input or response from a model. For more information, see - [Create a prompt using Prompt - management](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-create.html). - """ - - role: str - """The role that the message belongs to.""" - - content: list[ContentBlock] - """The content in the message.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MESSAGE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_MESSAGE.members["role"], self.role) - _serialize_content_blocks( - serializer, _SCHEMA_MESSAGE.members["content"], self.content - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["role"] = ConversationRole( - de.read_string(_SCHEMA_MESSAGE.members["role"]) - ) - - case 1: - kwargs["content"] = _deserialize_content_blocks( - de, _SCHEMA_MESSAGE.members["content"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MESSAGE, consumer=_consumer) - if "role" not in kwargs: - kwargs["role"] = ConversationRole._corrected("") - if "content" not in kwargs: - kwargs["content"] = [] - return kwargs - - -def _serialize_messages( - serializer: ShapeSerializer, schema: Schema, value: list[Message] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_messages( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Message]: - result: list[Message] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Message.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass -class SystemContentBlockText: - """The text in the system prompt.""" - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SYSTEM_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SYSTEM_CONTENT_BLOCK.members["text"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string(_SCHEMA_SYSTEM_CONTENT_BLOCK.members["text"]) - ) - - -@dataclass -class SystemContentBlockCachePoint: - """Creates a cache checkpoint within a tool designation""" - - value: CachePointBlock - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SYSTEM_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_SYSTEM_CONTENT_BLOCK.members["cachePoint"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=CachePointBlock.deserialize(deserializer)) - - -@dataclass -class SystemContentBlockUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -SystemContentBlock = Union[ - SystemContentBlockText | SystemContentBlockCachePoint | SystemContentBlockUnknown -] -""" -Contains a system prompt to provide context to the model or to describe -how it should behave. For more information, see [Create a prompt using -Prompt -management](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-create.html). -""" - - -class _SystemContentBlockDeserializer: - _result: SystemContentBlock | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> SystemContentBlock: - self._result = None - deserializer.read_struct(_SCHEMA_SYSTEM_CONTENT_BLOCK, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(SystemContentBlockText.deserialize(de)) - - case 1: - self._set_result(SystemContentBlockCachePoint.deserialize(de)) - - case _: - self._set_result( - SystemContentBlockUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: SystemContentBlock) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_system_content_blocks( - serializer: ShapeSerializer, schema: Schema, value: list[SystemContentBlock] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_system_content_blocks( - deserializer: ShapeDeserializer, schema: Schema -) -> list[SystemContentBlock]: - result: list[SystemContentBlock] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_SystemContentBlockDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AnyToolChoice: - """ - Defines tools, at least one of which must be requested by the model. No - text is generated but the results of tool use are sent back to the model - to help generate a response. For more information, see [Use a tool to - complete an Amazon Bedrock model - response](https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ANY_TOOL_CHOICE, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ANY_TOOL_CHOICE, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class AutoToolChoice: - """ - Defines tools. The model automatically decides whether to call a tool or - to generate text instead. For more information, see [Use a tool to - complete an Amazon Bedrock model - response](https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTO_TOOL_CHOICE, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AUTO_TOOL_CHOICE, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class SpecificToolChoice: - """ - Defines a specific tool that the model must request. No text is - generated but the results of tool use are sent back to the model to help - generate a response. For more information, see [Use a tool to complete - an Amazon Bedrock model - response](https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html). - """ - - name: str - """The name of the tool.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SPECIFIC_TOOL_CHOICE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_SPECIFIC_TOOL_CHOICE.members["name"], self.name) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_SPECIFIC_TOOL_CHOICE.members["name"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SPECIFIC_TOOL_CHOICE, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - return kwargs - - -@dataclass -class ToolChoiceAuto: - """ - Defines tools. The model automatically decides whether to call a tool or - to generate text instead. - """ - - value: AutoToolChoice - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_CHOICE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_CHOICE.members["auto"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=AutoToolChoice.deserialize(deserializer)) - - -@dataclass -class ToolChoiceAny: - """ - Defines tools, at least one of which must be requested by the model. No - text is generated but the results of tool use are sent back to the model - to help generate a response. - """ - - value: AnyToolChoice - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_CHOICE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_CHOICE.members["any"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=AnyToolChoice.deserialize(deserializer)) - - -@dataclass -class ToolChoiceTool: - """ - Defines a specific tool that the model must request. No text is - generated but the results of tool use are sent back to the model to help - generate a response. - """ - - value: SpecificToolChoice - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_CHOICE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_CHOICE.members["tool"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=SpecificToolChoice.deserialize(deserializer)) - - -@dataclass -class ToolChoiceUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ToolChoice = Union[ToolChoiceAuto | ToolChoiceAny | ToolChoiceTool | ToolChoiceUnknown] -""" -Defines which tools the model should request when invoked. For more -information, see [Use a tool to complete an Amazon Bedrock model -response](https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html). -""" - - -class _ToolChoiceDeserializer: - _result: ToolChoice | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> ToolChoice: - self._result = None - deserializer.read_struct(_SCHEMA_TOOL_CHOICE, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(ToolChoiceAuto.deserialize(de)) - - case 1: - self._set_result(ToolChoiceAny.deserialize(de)) - - case 2: - self._set_result(ToolChoiceTool.deserialize(de)) - - case _: - self._set_result(ToolChoiceUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: ToolChoice) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass -class ToolInputSchemaJson: - """A JSON object defining the input schema for the tool.""" - - value: Document - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_INPUT_SCHEMA, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_document(_SCHEMA_TOOL_INPUT_SCHEMA.members["json"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_document(_SCHEMA_TOOL_INPUT_SCHEMA.members["json"]) - ) - - -@dataclass -class ToolInputSchemaUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ToolInputSchema = Union[ToolInputSchemaJson | ToolInputSchemaUnknown] -""" -The input schema for the tool. For more information, see [Use a tool to -complete an Amazon Bedrock model -response](https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html). -""" - - -class _ToolInputSchemaDeserializer: - _result: ToolInputSchema | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> ToolInputSchema: - self._result = None - deserializer.read_struct(_SCHEMA_TOOL_INPUT_SCHEMA, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(ToolInputSchemaJson.deserialize(de)) - - case _: - self._set_result( - ToolInputSchemaUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: ToolInputSchema) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class ToolSpecification: - """ - Contains a specification for a tool. For more information, see [Use a - tool to complete an Amazon Bedrock model - response](https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html). - """ - - name: str - """The name of the tool.""" - - input_schema: ToolInputSchema - """The input schema for the tool.""" - - description: str | None = None - """The description of the tool.""" - - strict: bool | None = None - """Whether the tool schema is strictly enforced.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_SPECIFICATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_TOOL_SPECIFICATION.members["name"], self.name) - if self.description is not None: - serializer.write_string( - _SCHEMA_TOOL_SPECIFICATION.members["description"], self.description - ) - - serializer.write_struct( - _SCHEMA_TOOL_SPECIFICATION.members["inputSchema"], self.input_schema - ) - if self.strict is not None: - serializer.write_boolean( - _SCHEMA_TOOL_SPECIFICATION.members["strict"], self.strict - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_TOOL_SPECIFICATION.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_TOOL_SPECIFICATION.members["description"] - ) - - case 2: - kwargs["input_schema"] = _ToolInputSchemaDeserializer().deserialize( - de - ) - - case 3: - kwargs["strict"] = de.read_boolean( - _SCHEMA_TOOL_SPECIFICATION.members["strict"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TOOL_SPECIFICATION, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "input_schema" not in kwargs: - kwargs["input_schema"] = ToolInputSchemaUnknown(tag="") - return kwargs - - -@dataclass -class ToolToolSpec: - """The specification for the tool.""" - - value: ToolSpecification - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL.members["toolSpec"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ToolSpecification.deserialize(deserializer)) - - -@dataclass -class ToolCachePoint: - """Creates a cache checkpoint within a tool designation""" - - value: CachePointBlock - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL.members["cachePoint"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=CachePointBlock.deserialize(deserializer)) - - -@dataclass -class ToolUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -Tool = Union[ToolToolSpec | ToolCachePoint | ToolUnknown] -""" -Contains configurations for a tool that a model can use when generating -a response. For more information, see [Use a tool to complete an Amazon -Bedrock model -response](https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html). -""" - - -class _ToolDeserializer: - _result: Tool | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> Tool: - self._result = None - deserializer.read_struct(_SCHEMA_TOOL, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(ToolToolSpec.deserialize(de)) - - case 1: - self._set_result(ToolCachePoint.deserialize(de)) - - case _: - self._set_result(ToolUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: Tool) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_tools( - serializer: ShapeSerializer, schema: Schema, value: list[Tool] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_tools(deserializer: ShapeDeserializer, schema: Schema) -> list[Tool]: - result: list[Tool] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_ToolDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ToolConfiguration: - """ - Configuration information for the tools that the model can use when - generating a response. For more information, see [Use a tool to complete - an Amazon Bedrock model - response](https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html). - """ - - tools: list[Tool] = field(repr=False) - """An array of tools to pass to a model.""" - - tool_choice: ToolChoice | None = field(repr=False, default=None) - """Defines which tools the model should request when invoked.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_tools( - serializer, _SCHEMA_TOOL_CONFIGURATION.members["tools"], self.tools - ) - if self.tool_choice is not None: - serializer.write_struct( - _SCHEMA_TOOL_CONFIGURATION.members["toolChoice"], self.tool_choice - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["tools"] = _deserialize_tools( - de, _SCHEMA_TOOL_CONFIGURATION.members["tools"] - ) - - case 1: - kwargs["tool_choice"] = _ToolChoiceDeserializer().deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TOOL_CONFIGURATION, consumer=_consumer) - if "tools" not in kwargs: - kwargs["tools"] = [] - return kwargs - - -@dataclass(kw_only=True) -class ChatPromptTemplateConfiguration: - """ - Contains configurations to use a prompt in a conversational format. For - more information, see [Create a prompt using Prompt - management](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-create.html). - """ - - messages: list[Message] - """Contains messages in the chat for the prompt.""" - - system: list[SystemContentBlock] | None = None - """ - Contains system prompts to provide context to the model or to describe - how it should behave. - """ - - input_variables: list[PromptInputVariable] | None = field(repr=False, default=None) - """An array of the variables in the prompt template.""" - - tool_configuration: ToolConfiguration | None = None - """ - Configuration information for the tools that the model can use when - generating a response. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CHAT_PROMPT_TEMPLATE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_messages( - serializer, - _SCHEMA_CHAT_PROMPT_TEMPLATE_CONFIGURATION.members["messages"], - self.messages, - ) - if self.system is not None: - _serialize_system_content_blocks( - serializer, - _SCHEMA_CHAT_PROMPT_TEMPLATE_CONFIGURATION.members["system"], - self.system, - ) - - if self.input_variables is not None: - _serialize_prompt_input_variables_list( - serializer, - _SCHEMA_CHAT_PROMPT_TEMPLATE_CONFIGURATION.members["inputVariables"], - self.input_variables, - ) - - if self.tool_configuration is not None: - serializer.write_struct( - _SCHEMA_CHAT_PROMPT_TEMPLATE_CONFIGURATION.members["toolConfiguration"], - self.tool_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["messages"] = _deserialize_messages( - de, - _SCHEMA_CHAT_PROMPT_TEMPLATE_CONFIGURATION.members["messages"], - ) - - case 1: - kwargs["system"] = _deserialize_system_content_blocks( - de, _SCHEMA_CHAT_PROMPT_TEMPLATE_CONFIGURATION.members["system"] - ) - - case 2: - kwargs["input_variables"] = ( - _deserialize_prompt_input_variables_list( - de, - _SCHEMA_CHAT_PROMPT_TEMPLATE_CONFIGURATION.members[ - "inputVariables" - ], - ) - ) - - case 3: - kwargs["tool_configuration"] = ToolConfiguration.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CHAT_PROMPT_TEMPLATE_CONFIGURATION, consumer=_consumer - ) - if "messages" not in kwargs: - kwargs["messages"] = [] - return kwargs - - -@dataclass(kw_only=True) -class TextPromptTemplateConfiguration: - """ - Contains configurations for a text prompt template. To include a - variable, enclose a word in double curly braces as in `{{variable}}`. - """ - - text: str = field(repr=False) - """The message for the prompt.""" - - cache_point: CachePointBlock | None = None - """A cache checkpoint within a template configuration.""" - - input_variables: list[PromptInputVariable] | None = field(repr=False, default=None) - """An array of the variables in the prompt template.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TEXT_PROMPT_TEMPLATE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_TEXT_PROMPT_TEMPLATE_CONFIGURATION.members["text"], self.text - ) - if self.cache_point is not None: - serializer.write_struct( - _SCHEMA_TEXT_PROMPT_TEMPLATE_CONFIGURATION.members["cachePoint"], - self.cache_point, - ) - - if self.input_variables is not None: - _serialize_prompt_input_variables_list( - serializer, - _SCHEMA_TEXT_PROMPT_TEMPLATE_CONFIGURATION.members["inputVariables"], - self.input_variables, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["text"] = de.read_string( - _SCHEMA_TEXT_PROMPT_TEMPLATE_CONFIGURATION.members["text"] - ) - - case 1: - kwargs["cache_point"] = CachePointBlock.deserialize(de) - - case 2: - kwargs["input_variables"] = ( - _deserialize_prompt_input_variables_list( - de, - _SCHEMA_TEXT_PROMPT_TEMPLATE_CONFIGURATION.members[ - "inputVariables" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_TEXT_PROMPT_TEMPLATE_CONFIGURATION, consumer=_consumer - ) - if "text" not in kwargs: - kwargs["text"] = "" - return kwargs - - -@dataclass -class PromptTemplateConfigurationText: - """Contains configurations for the text in a message for a prompt.""" - - value: TextPromptTemplateConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PROMPT_TEMPLATE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_PROMPT_TEMPLATE_CONFIGURATION.members["text"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=TextPromptTemplateConfiguration.deserialize(deserializer)) - - -@dataclass -class PromptTemplateConfigurationChat: - """Contains configurations to use the prompt in a conversational format.""" - - value: ChatPromptTemplateConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PROMPT_TEMPLATE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_PROMPT_TEMPLATE_CONFIGURATION.members["chat"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ChatPromptTemplateConfiguration.deserialize(deserializer)) - - -@dataclass -class PromptTemplateConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -PromptTemplateConfiguration = Union[ - PromptTemplateConfigurationText - | PromptTemplateConfigurationChat - | PromptTemplateConfigurationUnknown -] -""" -Contains the message for a prompt. For more information, see [Construct -and store reusable prompts with Prompt management in Amazon -Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management.html). -""" - - -class _PromptTemplateConfigurationDeserializer: - _result: PromptTemplateConfiguration | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> PromptTemplateConfiguration: - self._result = None - deserializer.read_struct(_SCHEMA_PROMPT_TEMPLATE_CONFIGURATION, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(PromptTemplateConfigurationText.deserialize(de)) - - case 1: - self._set_result(PromptTemplateConfigurationChat.deserialize(de)) - - case _: - self._set_result( - PromptTemplateConfigurationUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: PromptTemplateConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class PromptTemplateType(UnknownEnumMixin, StrEnum): - TEXT = "TEXT" - CHAT = "CHAT" - - -@dataclass(kw_only=True) -class PromptFlowNodeInlineConfiguration: - """Contains configurations for a prompt defined inline in the node.""" - - template_configuration: PromptTemplateConfiguration - """ - Contains a prompt and variables in the prompt that can be replaced with - values at runtime. - """ - - template_type: str = PromptTemplateType("TEXT") - """The type of prompt template.""" - - model_id: str = "" - """ - The unique identifier of the model or [inference - profile](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html) - to run inference with. - """ - - inference_configuration: PromptInferenceConfiguration | None = None - """Contains inference configurations for the prompt.""" - - additional_model_request_fields: Document | None = None - """ - Additional fields to be included in the model request for the Prompt - node. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PROMPT_FLOW_NODE_INLINE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_PROMPT_FLOW_NODE_INLINE_CONFIGURATION.members["templateType"], - self.template_type, - ) - serializer.write_struct( - _SCHEMA_PROMPT_FLOW_NODE_INLINE_CONFIGURATION.members[ - "templateConfiguration" - ], - self.template_configuration, - ) - serializer.write_string( - _SCHEMA_PROMPT_FLOW_NODE_INLINE_CONFIGURATION.members["modelId"], - self.model_id, - ) - if self.inference_configuration is not None: - serializer.write_struct( - _SCHEMA_PROMPT_FLOW_NODE_INLINE_CONFIGURATION.members[ - "inferenceConfiguration" - ], - self.inference_configuration, - ) - - if self.additional_model_request_fields is not None: - serializer.write_document( - _SCHEMA_PROMPT_FLOW_NODE_INLINE_CONFIGURATION.members[ - "additionalModelRequestFields" - ], - self.additional_model_request_fields, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["template_type"] = PromptTemplateType( - de.read_string( - _SCHEMA_PROMPT_FLOW_NODE_INLINE_CONFIGURATION.members[ - "templateType" - ] - ) - ) - - case 1: - kwargs["template_configuration"] = ( - _PromptTemplateConfigurationDeserializer().deserialize(de) - ) - - case 2: - kwargs["model_id"] = de.read_string( - _SCHEMA_PROMPT_FLOW_NODE_INLINE_CONFIGURATION.members["modelId"] - ) - - case 3: - kwargs["inference_configuration"] = ( - _PromptInferenceConfigurationDeserializer().deserialize(de) - ) - - case 4: - kwargs["additional_model_request_fields"] = de.read_document( - _SCHEMA_PROMPT_FLOW_NODE_INLINE_CONFIGURATION.members[ - "additionalModelRequestFields" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PROMPT_FLOW_NODE_INLINE_CONFIGURATION, consumer=_consumer - ) - if "template_configuration" not in kwargs: - kwargs["template_configuration"] = PromptTemplateConfigurationUnknown( - tag="" - ) - return kwargs - - -@dataclass(kw_only=True) -class PromptFlowNodeResourceConfiguration: - """ - Contains configurations for a prompt from Prompt management to use in a - node. - """ - - prompt_arn: str = "" - """The Amazon Resource Name (ARN) of the prompt from Prompt management.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PROMPT_FLOW_NODE_RESOURCE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_PROMPT_FLOW_NODE_RESOURCE_CONFIGURATION.members["promptArn"], - self.prompt_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["prompt_arn"] = de.read_string( - _SCHEMA_PROMPT_FLOW_NODE_RESOURCE_CONFIGURATION.members[ - "promptArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PROMPT_FLOW_NODE_RESOURCE_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass -class PromptFlowNodeSourceConfigurationResource: - """Contains configurations for a prompt from Prompt management.""" - - value: PromptFlowNodeResourceConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PROMPT_FLOW_NODE_SOURCE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_PROMPT_FLOW_NODE_SOURCE_CONFIGURATION.members["resource"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=PromptFlowNodeResourceConfiguration.deserialize(deserializer)) - - -@dataclass -class PromptFlowNodeSourceConfigurationInline: - """Contains configurations for a prompt that is defined inline""" - - value: PromptFlowNodeInlineConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PROMPT_FLOW_NODE_SOURCE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_PROMPT_FLOW_NODE_SOURCE_CONFIGURATION.members["inline"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=PromptFlowNodeInlineConfiguration.deserialize(deserializer)) - - -@dataclass -class PromptFlowNodeSourceConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -PromptFlowNodeSourceConfiguration = Union[ - PromptFlowNodeSourceConfigurationResource - | PromptFlowNodeSourceConfigurationInline - | PromptFlowNodeSourceConfigurationUnknown -] -""" -Contains configurations for a prompt and whether it is from Prompt -management or defined inline. -""" - - -class _PromptFlowNodeSourceConfigurationDeserializer: - _result: PromptFlowNodeSourceConfiguration | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> PromptFlowNodeSourceConfiguration: - self._result = None - deserializer.read_struct( - _SCHEMA_PROMPT_FLOW_NODE_SOURCE_CONFIGURATION, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - PromptFlowNodeSourceConfigurationResource.deserialize(de) - ) - - case 1: - self._set_result( - PromptFlowNodeSourceConfigurationInline.deserialize(de) - ) - - case _: - self._set_result( - PromptFlowNodeSourceConfigurationUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: PromptFlowNodeSourceConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class PromptFlowNodeConfiguration: - """ - Contains configurations for a prompt node in the flow. You can use a - prompt from Prompt management or you can define one in this node. If the - prompt contains variables, the inputs into this node will fill in the - variables. The output from this node is the response generated by the - model. For more information, see [Node types in a - flow](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-nodes.html) - in the Amazon Bedrock User Guide. - """ - - source_configuration: PromptFlowNodeSourceConfiguration - """ - Specifies whether the prompt is from Prompt management or defined - inline. - """ - - guardrail_configuration: GuardrailConfiguration | None = None - """ - Contains configurations for a guardrail to apply to the prompt in this - node and the response generated from it. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PROMPT_FLOW_NODE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_PROMPT_FLOW_NODE_CONFIGURATION.members["sourceConfiguration"], - self.source_configuration, - ) - if self.guardrail_configuration is not None: - serializer.write_struct( - _SCHEMA_PROMPT_FLOW_NODE_CONFIGURATION.members[ - "guardrailConfiguration" - ], - self.guardrail_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["source_configuration"] = ( - _PromptFlowNodeSourceConfigurationDeserializer().deserialize(de) - ) - - case 1: - kwargs["guardrail_configuration"] = ( - GuardrailConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PROMPT_FLOW_NODE_CONFIGURATION, consumer=_consumer - ) - if "source_configuration" not in kwargs: - kwargs["source_configuration"] = PromptFlowNodeSourceConfigurationUnknown( - tag="" - ) - return kwargs - - -@dataclass(kw_only=True) -class RetrievalFlowNodeS3Configuration: - """ - Contains configurations for the Amazon S3 location from which to - retrieve data to return as the output from the node. - """ - - bucket_name: str = "" - """The name of the Amazon S3 bucket from which to retrieve data.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVAL_FLOW_NODE_S3_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_RETRIEVAL_FLOW_NODE_S3_CONFIGURATION.members["bucketName"], - self.bucket_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bucket_name"] = de.read_string( - _SCHEMA_RETRIEVAL_FLOW_NODE_S3_CONFIGURATION.members[ - "bucketName" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RETRIEVAL_FLOW_NODE_S3_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass -class RetrievalFlowNodeServiceConfigurationS3: - """ - Contains configurations for the Amazon S3 location from which to - retrieve data to return as the output from the node. - """ - - value: RetrievalFlowNodeS3Configuration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVAL_FLOW_NODE_SERVICE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RETRIEVAL_FLOW_NODE_SERVICE_CONFIGURATION.members["s3"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=RetrievalFlowNodeS3Configuration.deserialize(deserializer)) - - -@dataclass -class RetrievalFlowNodeServiceConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -RetrievalFlowNodeServiceConfiguration = Union[ - RetrievalFlowNodeServiceConfigurationS3 - | RetrievalFlowNodeServiceConfigurationUnknown -] -""" -Contains configurations for the service to use for retrieving data to -return as the output from the node. -""" - - -class _RetrievalFlowNodeServiceConfigurationDeserializer: - _result: RetrievalFlowNodeServiceConfiguration | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> RetrievalFlowNodeServiceConfiguration: - self._result = None - deserializer.read_struct( - _SCHEMA_RETRIEVAL_FLOW_NODE_SERVICE_CONFIGURATION, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - RetrievalFlowNodeServiceConfigurationS3.deserialize(de) - ) - - case _: - self._set_result( - RetrievalFlowNodeServiceConfigurationUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: RetrievalFlowNodeServiceConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class RetrievalFlowNodeConfiguration: - """ - Contains configurations for a Retrieval node in a flow. This node - retrieves data from the Amazon S3 location that you specify and returns - it as the output. - """ - - service_configuration: RetrievalFlowNodeServiceConfiguration - """ - Contains configurations for the service to use for retrieving data to - return as the output from the node. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVAL_FLOW_NODE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RETRIEVAL_FLOW_NODE_CONFIGURATION.members["serviceConfiguration"], - self.service_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["service_configuration"] = ( - _RetrievalFlowNodeServiceConfigurationDeserializer().deserialize( - de - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RETRIEVAL_FLOW_NODE_CONFIGURATION, consumer=_consumer - ) - if "service_configuration" not in kwargs: - kwargs["service_configuration"] = ( - RetrievalFlowNodeServiceConfigurationUnknown(tag="") - ) - return kwargs - - -@dataclass(kw_only=True) -class StorageFlowNodeS3Configuration: - """ - Contains configurations for the Amazon S3 location in which to store the - input into the node. - """ - - bucket_name: str = "" - """ - The name of the Amazon S3 bucket in which to store the input into the - node. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STORAGE_FLOW_NODE_S3_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_STORAGE_FLOW_NODE_S3_CONFIGURATION.members["bucketName"], - self.bucket_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bucket_name"] = de.read_string( - _SCHEMA_STORAGE_FLOW_NODE_S3_CONFIGURATION.members["bucketName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_STORAGE_FLOW_NODE_S3_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass -class StorageFlowNodeServiceConfigurationS3: - """ - Contains configurations for the Amazon S3 location in which to store the - input into the node. - """ - - value: StorageFlowNodeS3Configuration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STORAGE_FLOW_NODE_SERVICE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_STORAGE_FLOW_NODE_SERVICE_CONFIGURATION.members["s3"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=StorageFlowNodeS3Configuration.deserialize(deserializer)) - - -@dataclass -class StorageFlowNodeServiceConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -StorageFlowNodeServiceConfiguration = Union[ - StorageFlowNodeServiceConfigurationS3 | StorageFlowNodeServiceConfigurationUnknown -] -""" -Contains configurations for the service to use for storing the input -into the node. -""" - - -class _StorageFlowNodeServiceConfigurationDeserializer: - _result: StorageFlowNodeServiceConfiguration | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> StorageFlowNodeServiceConfiguration: - self._result = None - deserializer.read_struct( - _SCHEMA_STORAGE_FLOW_NODE_SERVICE_CONFIGURATION, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(StorageFlowNodeServiceConfigurationS3.deserialize(de)) - - case _: - self._set_result( - StorageFlowNodeServiceConfigurationUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: StorageFlowNodeServiceConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class StorageFlowNodeConfiguration: - """ - Contains configurations for a Storage node in a flow. This node stores - the input in an Amazon S3 location that you specify. - """ - - service_configuration: StorageFlowNodeServiceConfiguration - """ - Contains configurations for the service to use for storing the input - into the node. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STORAGE_FLOW_NODE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_STORAGE_FLOW_NODE_CONFIGURATION.members["serviceConfiguration"], - self.service_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["service_configuration"] = ( - _StorageFlowNodeServiceConfigurationDeserializer().deserialize( - de - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_STORAGE_FLOW_NODE_CONFIGURATION, consumer=_consumer - ) - if "service_configuration" not in kwargs: - kwargs["service_configuration"] = ( - StorageFlowNodeServiceConfigurationUnknown(tag="") - ) - return kwargs - - -class FlowNodeInputCategory(UnknownEnumMixin, StrEnum): - LOOP_CONDITION = "LoopCondition" - RETURN_VALUE_TO_LOOP_START = "ReturnValueToLoopStart" - EXIT_LOOP = "ExitLoop" - - -class FlowNodeIODataType(UnknownEnumMixin, StrEnum): - STRING = "String" - NUMBER = "Number" - BOOLEAN = "Boolean" - OBJECT = "Object" - ARRAY = "Array" - - -@dataclass(kw_only=True) -class FlowNodeInput: - """Contains configurations for an input in an Amazon Bedrock Flows node.""" - - name: str - """Specifies a name for the input that you can reference.""" - - type: str - """ - Specifies the data type of the input. If the input doesn't match this - type at runtime, a validation error will be thrown. - """ - - expression: str = field(repr=False) - """ - An expression that formats the input for the node. For an explanation of - how to create expressions, see [Expressions in Prompt flows in Amazon - Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-expressions.html). - """ - - category: str | None = None - """ - Specifies how input data flows between iterations in a DoWhile loop. - - - `LoopCondition` - Controls whether the loop continues by evaluating - condition expressions against the input data. Use this category to - define the condition that determines if the loop should continue. - - - `ReturnValueToLoopStart` - Defines data to pass back to the start of - the loop's next iteration. Use this category for variables that you - want to update for each loop iteration. - - - `ExitLoop` - Defines the value that's available once the loop ends. - Use this category to expose loop results to nodes outside the loop. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_NODE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_FLOW_NODE_INPUT.members["name"], self.name) - serializer.write_string(_SCHEMA_FLOW_NODE_INPUT.members["type"], self.type) - serializer.write_string( - _SCHEMA_FLOW_NODE_INPUT.members["expression"], self.expression - ) - if self.category is not None: - serializer.write_string( - _SCHEMA_FLOW_NODE_INPUT.members["category"], self.category - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_FLOW_NODE_INPUT.members["name"] - ) - - case 1: - kwargs["type"] = FlowNodeIODataType( - de.read_string(_SCHEMA_FLOW_NODE_INPUT.members["type"]) - ) - - case 2: - kwargs["expression"] = de.read_string( - _SCHEMA_FLOW_NODE_INPUT.members["expression"] - ) - - case 3: - kwargs["category"] = FlowNodeInputCategory( - de.read_string(_SCHEMA_FLOW_NODE_INPUT.members["category"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FLOW_NODE_INPUT, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "type" not in kwargs: - kwargs["type"] = FlowNodeIODataType._corrected("") - if "expression" not in kwargs: - kwargs["expression"] = "" - return kwargs - - -def _serialize_flow_node_inputs( - serializer: ShapeSerializer, schema: Schema, value: list[FlowNodeInput] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_flow_node_inputs( - deserializer: ShapeDeserializer, schema: Schema -) -> list[FlowNodeInput]: - result: list[FlowNodeInput] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(FlowNodeInput.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class FlowNodeOutput: - """Contains configurations for an output from a node.""" - - name: str - """A name for the output that you can reference.""" - - type: str - """ - The data type of the output. If the output doesn't match this type at - runtime, a validation error will be thrown. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_NODE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_FLOW_NODE_OUTPUT.members["name"], self.name) - serializer.write_string(_SCHEMA_FLOW_NODE_OUTPUT.members["type"], self.type) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_FLOW_NODE_OUTPUT.members["name"] - ) - - case 1: - kwargs["type"] = FlowNodeIODataType( - de.read_string(_SCHEMA_FLOW_NODE_OUTPUT.members["type"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FLOW_NODE_OUTPUT, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "type" not in kwargs: - kwargs["type"] = FlowNodeIODataType._corrected("") - return kwargs - - -def _serialize_flow_node_outputs( - serializer: ShapeSerializer, schema: Schema, value: list[FlowNodeOutput] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_flow_node_outputs( - deserializer: ShapeDeserializer, schema: Schema -) -> list[FlowNodeOutput]: - result: list[FlowNodeOutput] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(FlowNodeOutput.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class FlowNodeType(UnknownEnumMixin, StrEnum): - INPUT = "Input" - OUTPUT = "Output" - KNOWLEDGE_BASE = "KnowledgeBase" - CONDITION = "Condition" - LEX = "Lex" - PROMPT = "Prompt" - LAMBDA_FUNCTION = "LambdaFunction" - STORAGE = "Storage" - AGENT = "Agent" - RETRIEVAL = "Retrieval" - ITERATOR = "Iterator" - COLLECTOR = "Collector" - INLINE_CODE = "InlineCode" - LOOP = "Loop" - LOOP_INPUT = "LoopInput" - LOOP_CONTROLLER = "LoopController" - - -class FlowStatus(UnknownEnumMixin, StrEnum): - FAILED = "Failed" - PREPARED = "Prepared" - PREPARING = "Preparing" - NOT_PREPARED = "NotPrepared" - - -@dataclass(kw_only=True) -class DeleteFlowInput: - """Dataclass for DeleteFlowInput structure.""" - - flow_identifier: str | None = None - """The unique identifier of the flow.""" - - skip_resource_in_use_check: bool = False - """ - By default, this value is `false` and deletion is stopped if the - resource is in use. If you set it to `true`, the resource will be - deleted even if the resource is in use. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_FLOW_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.flow_identifier is not None: - serializer.write_string( - _SCHEMA_DELETE_FLOW_INPUT.members["flowIdentifier"], - self.flow_identifier, - ) - - if self.skip_resource_in_use_check is not None: - serializer.write_boolean( - _SCHEMA_DELETE_FLOW_INPUT.members["skipResourceInUseCheck"], - self.skip_resource_in_use_check, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["flow_identifier"] = de.read_string( - _SCHEMA_DELETE_FLOW_INPUT.members["flowIdentifier"] - ) - - case 1: - kwargs["skip_resource_in_use_check"] = de.read_boolean( - _SCHEMA_DELETE_FLOW_INPUT.members["skipResourceInUseCheck"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_FLOW_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteFlowOutput: - """Dataclass for DeleteFlowOutput structure.""" - - id: str - """The unique identifier of the flow.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_FLOW_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_DELETE_FLOW_OUTPUT.members["id"], self.id) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_DELETE_FLOW_OUTPUT.members["id"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_FLOW_OUTPUT, consumer=_consumer) - if "id" not in kwargs: - kwargs["id"] = "" - return kwargs - - -DELETE_FLOW = APIOperation( - input=DeleteFlowInput, - output=DeleteFlowOutput, - schema=_SCHEMA_DELETE_FLOW, - input_schema=_SCHEMA_DELETE_FLOW_INPUT, - output_schema=_SCHEMA_DELETE_FLOW_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrockagent#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class ConcurrencyType(UnknownEnumMixin, StrEnum): - AUTOMATIC = "Automatic" - MANUAL = "Manual" - - -@dataclass(kw_only=True) -class FlowAliasConcurrencyConfiguration: - """ - Determines how multiple nodes in a flow can run in parallel. Running - nodes concurrently can improve your flow's performance. - """ - - type: str - """ - The type of concurrency to use for parallel node execution. Specify one - of the following options: - - - `Automatic` - Amazon Bedrock determines which nodes can be executed in - parallel based on the flow definition and its dependencies. - - - `Manual` - You specify which nodes can be executed in parallel. - """ - - max_concurrency: int | None = None - """ - The maximum number of nodes that can be executed concurrently in the - flow. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_ALIAS_CONCURRENCY_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_FLOW_ALIAS_CONCURRENCY_CONFIGURATION.members["type"], self.type - ) - if self.max_concurrency is not None: - serializer.write_integer( - _SCHEMA_FLOW_ALIAS_CONCURRENCY_CONFIGURATION.members["maxConcurrency"], - self.max_concurrency, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = ConcurrencyType( - de.read_string( - _SCHEMA_FLOW_ALIAS_CONCURRENCY_CONFIGURATION.members["type"] - ) - ) - - case 1: - kwargs["max_concurrency"] = de.read_integer( - _SCHEMA_FLOW_ALIAS_CONCURRENCY_CONFIGURATION.members[ - "maxConcurrency" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_FLOW_ALIAS_CONCURRENCY_CONFIGURATION, consumer=_consumer - ) - if "type" not in kwargs: - kwargs["type"] = ConcurrencyType._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class FlowAliasRoutingConfigurationListItem: - """Contains information about a version that the alias maps to.""" - - flow_version: str | None = None - """The version that the alias maps to.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_ALIAS_ROUTING_CONFIGURATION_LIST_ITEM, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.flow_version is not None: - serializer.write_string( - _SCHEMA_FLOW_ALIAS_ROUTING_CONFIGURATION_LIST_ITEM.members[ - "flowVersion" - ], - self.flow_version, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["flow_version"] = de.read_string( - _SCHEMA_FLOW_ALIAS_ROUTING_CONFIGURATION_LIST_ITEM.members[ - "flowVersion" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_FLOW_ALIAS_ROUTING_CONFIGURATION_LIST_ITEM, consumer=_consumer - ) - return kwargs - - -def _serialize_flow_alias_routing_configuration( - serializer: ShapeSerializer, - schema: Schema, - value: list[FlowAliasRoutingConfigurationListItem], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_flow_alias_routing_configuration( - deserializer: ShapeDeserializer, schema: Schema -) -> list[FlowAliasRoutingConfigurationListItem]: - result: list[FlowAliasRoutingConfigurationListItem] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(FlowAliasRoutingConfigurationListItem.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CreateFlowAliasInput: - """Dataclass for CreateFlowAliasInput structure.""" - - name: str | None = None - """A name for the alias.""" - - description: str | None = None - """A description for the alias.""" - - routing_configuration: list[FlowAliasRoutingConfigurationListItem] | None = None - """Contains information about the version to which to map the alias.""" - - concurrency_configuration: FlowAliasConcurrencyConfiguration | None = None - """ - The configuration that specifies how nodes in the flow are executed in - parallel. - """ - - flow_identifier: str | None = None - """The unique identifier of the flow for which to create an alias.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If this token matches a previous - request, Amazon Bedrock ignores the request, but does not return an - error. For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - tags: dict[str, str] | None = None - """ - Any tags that you want to attach to the alias of the flow. For more - information, see [Tagging resources in Amazon - Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/tagging.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_FLOW_ALIAS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_FLOW_ALIAS_INPUT.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_FLOW_ALIAS_INPUT.members["description"], self.description - ) - - if self.routing_configuration is not None: - _serialize_flow_alias_routing_configuration( - serializer, - _SCHEMA_CREATE_FLOW_ALIAS_INPUT.members["routingConfiguration"], - self.routing_configuration, - ) - - if self.concurrency_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_FLOW_ALIAS_INPUT.members["concurrencyConfiguration"], - self.concurrency_configuration, - ) - - if self.flow_identifier is not None: - serializer.write_string( - _SCHEMA_CREATE_FLOW_ALIAS_INPUT.members["flowIdentifier"], - self.flow_identifier, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_FLOW_ALIAS_INPUT.members["clientToken"], - self.client_token, - ) - - if self.tags is not None: - _serialize_tags_map( - serializer, _SCHEMA_CREATE_FLOW_ALIAS_INPUT.members["tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_FLOW_ALIAS_INPUT.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_FLOW_ALIAS_INPUT.members["description"] - ) - - case 2: - kwargs["routing_configuration"] = ( - _deserialize_flow_alias_routing_configuration( - de, - _SCHEMA_CREATE_FLOW_ALIAS_INPUT.members[ - "routingConfiguration" - ], - ) - ) - - case 3: - kwargs["concurrency_configuration"] = ( - FlowAliasConcurrencyConfiguration.deserialize(de) - ) - - case 4: - kwargs["flow_identifier"] = de.read_string( - _SCHEMA_CREATE_FLOW_ALIAS_INPUT.members["flowIdentifier"] - ) - - case 5: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_FLOW_ALIAS_INPUT.members["clientToken"] - ) - - case 6: - kwargs["tags"] = _deserialize_tags_map( - de, _SCHEMA_CREATE_FLOW_ALIAS_INPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_FLOW_ALIAS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CreateFlowAliasOutput: - """Dataclass for CreateFlowAliasOutput structure.""" - - name: str - """The name of the alias.""" - - routing_configuration: list[FlowAliasRoutingConfigurationListItem] - """Contains information about the version that the alias is mapped to.""" - - flow_id: str - """The unique identifier of the flow that the alias belongs to.""" - - id: str - """The unique identifier of the alias.""" - - arn: str - """The Amazon Resource Name (ARN) of the alias.""" - - created_at: datetime - """The time at which the alias was created.""" - - updated_at: datetime - """The time at which the alias of the flow was last updated.""" - - description: str | None = None - """The description of the alias.""" - - concurrency_configuration: FlowAliasConcurrencyConfiguration | None = None - """ - The configuration that specifies how nodes in the flow are executed in - parallel. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_FLOW_ALIAS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_FLOW_ALIAS_OUTPUT.members["name"], self.name - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_FLOW_ALIAS_OUTPUT.members["description"], - self.description, - ) - - _serialize_flow_alias_routing_configuration( - serializer, - _SCHEMA_CREATE_FLOW_ALIAS_OUTPUT.members["routingConfiguration"], - self.routing_configuration, - ) - if self.concurrency_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_FLOW_ALIAS_OUTPUT.members["concurrencyConfiguration"], - self.concurrency_configuration, - ) - - serializer.write_string( - _SCHEMA_CREATE_FLOW_ALIAS_OUTPUT.members["flowId"], self.flow_id - ) - serializer.write_string(_SCHEMA_CREATE_FLOW_ALIAS_OUTPUT.members["id"], self.id) - serializer.write_string( - _SCHEMA_CREATE_FLOW_ALIAS_OUTPUT.members["arn"], self.arn - ) - serializer.write_timestamp( - _SCHEMA_CREATE_FLOW_ALIAS_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_CREATE_FLOW_ALIAS_OUTPUT.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_FLOW_ALIAS_OUTPUT.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_FLOW_ALIAS_OUTPUT.members["description"] - ) - - case 2: - kwargs["routing_configuration"] = ( - _deserialize_flow_alias_routing_configuration( - de, - _SCHEMA_CREATE_FLOW_ALIAS_OUTPUT.members[ - "routingConfiguration" - ], - ) - ) - - case 3: - kwargs["concurrency_configuration"] = ( - FlowAliasConcurrencyConfiguration.deserialize(de) - ) - - case 4: - kwargs["flow_id"] = de.read_string( - _SCHEMA_CREATE_FLOW_ALIAS_OUTPUT.members["flowId"] - ) - - case 5: - kwargs["id"] = de.read_string( - _SCHEMA_CREATE_FLOW_ALIAS_OUTPUT.members["id"] - ) - - case 6: - kwargs["arn"] = de.read_string( - _SCHEMA_CREATE_FLOW_ALIAS_OUTPUT.members["arn"] - ) - - case 7: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_CREATE_FLOW_ALIAS_OUTPUT.members["createdAt"] - ) - - case 8: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_CREATE_FLOW_ALIAS_OUTPUT.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_FLOW_ALIAS_OUTPUT, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "routing_configuration" not in kwargs: - kwargs["routing_configuration"] = [] - if "flow_id" not in kwargs: - kwargs["flow_id"] = "" - if "id" not in kwargs: - kwargs["id"] = "" - if "arn" not in kwargs: - kwargs["arn"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -CREATE_FLOW_ALIAS = APIOperation( - input=CreateFlowAliasInput, - output=CreateFlowAliasOutput, - schema=_SCHEMA_CREATE_FLOW_ALIAS, - input_schema=_SCHEMA_CREATE_FLOW_ALIAS_INPUT, - output_schema=_SCHEMA_CREATE_FLOW_ALIAS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrockagent#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteFlowAliasInput: - """Dataclass for DeleteFlowAliasInput structure.""" - - flow_identifier: str | None = None - """The unique identifier of the flow that the alias belongs to.""" - - alias_identifier: str | None = None - """The unique identifier of the alias to be deleted.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_FLOW_ALIAS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.flow_identifier is not None: - serializer.write_string( - _SCHEMA_DELETE_FLOW_ALIAS_INPUT.members["flowIdentifier"], - self.flow_identifier, - ) - - if self.alias_identifier is not None: - serializer.write_string( - _SCHEMA_DELETE_FLOW_ALIAS_INPUT.members["aliasIdentifier"], - self.alias_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["flow_identifier"] = de.read_string( - _SCHEMA_DELETE_FLOW_ALIAS_INPUT.members["flowIdentifier"] - ) - - case 1: - kwargs["alias_identifier"] = de.read_string( - _SCHEMA_DELETE_FLOW_ALIAS_INPUT.members["aliasIdentifier"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_FLOW_ALIAS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteFlowAliasOutput: - """Dataclass for DeleteFlowAliasOutput structure.""" - - flow_id: str - """The unique identifier of the flow that the alias belongs to.""" - - id: str - """The unique identifier of the flow.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_FLOW_ALIAS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DELETE_FLOW_ALIAS_OUTPUT.members["flowId"], self.flow_id - ) - serializer.write_string(_SCHEMA_DELETE_FLOW_ALIAS_OUTPUT.members["id"], self.id) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["flow_id"] = de.read_string( - _SCHEMA_DELETE_FLOW_ALIAS_OUTPUT.members["flowId"] - ) - - case 1: - kwargs["id"] = de.read_string( - _SCHEMA_DELETE_FLOW_ALIAS_OUTPUT.members["id"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_FLOW_ALIAS_OUTPUT, consumer=_consumer) - if "flow_id" not in kwargs: - kwargs["flow_id"] = "" - if "id" not in kwargs: - kwargs["id"] = "" - return kwargs - - -DELETE_FLOW_ALIAS = APIOperation( - input=DeleteFlowAliasInput, - output=DeleteFlowAliasOutput, - schema=_SCHEMA_DELETE_FLOW_ALIAS, - input_schema=_SCHEMA_DELETE_FLOW_ALIAS_INPUT, - output_schema=_SCHEMA_DELETE_FLOW_ALIAS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrockagent#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetFlowAliasInput: - """Dataclass for GetFlowAliasInput structure.""" - - flow_identifier: str | None = None - """The unique identifier of the flow that the alias belongs to.""" - - alias_identifier: str | None = None - """The unique identifier of the alias for which to retrieve information.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_FLOW_ALIAS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.flow_identifier is not None: - serializer.write_string( - _SCHEMA_GET_FLOW_ALIAS_INPUT.members["flowIdentifier"], - self.flow_identifier, - ) - - if self.alias_identifier is not None: - serializer.write_string( - _SCHEMA_GET_FLOW_ALIAS_INPUT.members["aliasIdentifier"], - self.alias_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["flow_identifier"] = de.read_string( - _SCHEMA_GET_FLOW_ALIAS_INPUT.members["flowIdentifier"] - ) - - case 1: - kwargs["alias_identifier"] = de.read_string( - _SCHEMA_GET_FLOW_ALIAS_INPUT.members["aliasIdentifier"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_FLOW_ALIAS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetFlowAliasOutput: - """Dataclass for GetFlowAliasOutput structure.""" - - name: str - """The name of the alias.""" - - routing_configuration: list[FlowAliasRoutingConfigurationListItem] - """Contains information about the version that the alias is mapped to.""" - - flow_id: str - """The unique identifier of the flow that the alias belongs to.""" - - id: str - """The unique identifier of the alias of the flow.""" - - arn: str - """The Amazon Resource Name (ARN) of the flow.""" - - created_at: datetime - """The time at which the flow was created.""" - - updated_at: datetime - """The time at which the alias was last updated.""" - - description: str | None = None - """The description of the flow.""" - - concurrency_configuration: FlowAliasConcurrencyConfiguration | None = None - """ - The configuration that specifies how nodes in the flow are executed in - parallel. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_FLOW_ALIAS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_FLOW_ALIAS_OUTPUT.members["name"], self.name - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_FLOW_ALIAS_OUTPUT.members["description"], self.description - ) - - _serialize_flow_alias_routing_configuration( - serializer, - _SCHEMA_GET_FLOW_ALIAS_OUTPUT.members["routingConfiguration"], - self.routing_configuration, - ) - if self.concurrency_configuration is not None: - serializer.write_struct( - _SCHEMA_GET_FLOW_ALIAS_OUTPUT.members["concurrencyConfiguration"], - self.concurrency_configuration, - ) - - serializer.write_string( - _SCHEMA_GET_FLOW_ALIAS_OUTPUT.members["flowId"], self.flow_id - ) - serializer.write_string(_SCHEMA_GET_FLOW_ALIAS_OUTPUT.members["id"], self.id) - serializer.write_string(_SCHEMA_GET_FLOW_ALIAS_OUTPUT.members["arn"], self.arn) - serializer.write_timestamp( - _SCHEMA_GET_FLOW_ALIAS_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_GET_FLOW_ALIAS_OUTPUT.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_GET_FLOW_ALIAS_OUTPUT.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_GET_FLOW_ALIAS_OUTPUT.members["description"] - ) - - case 2: - kwargs["routing_configuration"] = ( - _deserialize_flow_alias_routing_configuration( - de, - _SCHEMA_GET_FLOW_ALIAS_OUTPUT.members[ - "routingConfiguration" - ], - ) - ) - - case 3: - kwargs["concurrency_configuration"] = ( - FlowAliasConcurrencyConfiguration.deserialize(de) - ) - - case 4: - kwargs["flow_id"] = de.read_string( - _SCHEMA_GET_FLOW_ALIAS_OUTPUT.members["flowId"] - ) - - case 5: - kwargs["id"] = de.read_string( - _SCHEMA_GET_FLOW_ALIAS_OUTPUT.members["id"] - ) - - case 6: - kwargs["arn"] = de.read_string( - _SCHEMA_GET_FLOW_ALIAS_OUTPUT.members["arn"] - ) - - case 7: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_FLOW_ALIAS_OUTPUT.members["createdAt"] - ) - - case 8: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_GET_FLOW_ALIAS_OUTPUT.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_FLOW_ALIAS_OUTPUT, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "routing_configuration" not in kwargs: - kwargs["routing_configuration"] = [] - if "flow_id" not in kwargs: - kwargs["flow_id"] = "" - if "id" not in kwargs: - kwargs["id"] = "" - if "arn" not in kwargs: - kwargs["arn"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -GET_FLOW_ALIAS = APIOperation( - input=GetFlowAliasInput, - output=GetFlowAliasOutput, - schema=_SCHEMA_GET_FLOW_ALIAS, - input_schema=_SCHEMA_GET_FLOW_ALIAS_INPUT, - output_schema=_SCHEMA_GET_FLOW_ALIAS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListFlowAliasesInput: - """Dataclass for ListFlowAliasesInput structure.""" - - flow_identifier: str | None = None - """The unique identifier of the flow for which aliases are being returned.""" - - max_results: int | None = None - """ - The maximum number of results to return in the response. If the total - number of results is greater than this value, use the token returned in - the response in the `nextToken` field when making another request to - return the next batch of results. - """ - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, enter the token returned in the `nextToken` - field in the response in this field to return the next batch of results. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_FLOW_ALIASES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.flow_identifier is not None: - serializer.write_string( - _SCHEMA_LIST_FLOW_ALIASES_INPUT.members["flowIdentifier"], - self.flow_identifier, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_FLOW_ALIASES_INPUT.members["maxResults"], self.max_results - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_FLOW_ALIASES_INPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["flow_identifier"] = de.read_string( - _SCHEMA_LIST_FLOW_ALIASES_INPUT.members["flowIdentifier"] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_FLOW_ALIASES_INPUT.members["maxResults"] - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_FLOW_ALIASES_INPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_FLOW_ALIASES_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class FlowAliasSummary: - """ - Contains information about an alias of a flow. - - This data type is used in the following API operations: - - - [ListFlowAliases - response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_ListFlowAliases.html#API_agent_ListFlowAliases_ResponseSyntax) - """ - - name: str - """The name of the alias.""" - - routing_configuration: list[FlowAliasRoutingConfigurationListItem] - """ - A list of configurations about the versions that the alias maps to. - Currently, you can only specify one. - """ - - flow_id: str - """The unique identifier of the flow.""" - - id: str - """The unique identifier of the alias of the flow.""" - - arn: str - """The Amazon Resource Name (ARN) of the alias.""" - - created_at: datetime - """The time at which the alias was created.""" - - updated_at: datetime - """The time at which the alias was last updated.""" - - description: str | None = None - """A description of the alias.""" - - concurrency_configuration: FlowAliasConcurrencyConfiguration | None = None - """ - The configuration that specifies how nodes in the flow are executed - concurrently. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_ALIAS_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_FLOW_ALIAS_SUMMARY.members["name"], self.name) - if self.description is not None: - serializer.write_string( - _SCHEMA_FLOW_ALIAS_SUMMARY.members["description"], self.description - ) - - _serialize_flow_alias_routing_configuration( - serializer, - _SCHEMA_FLOW_ALIAS_SUMMARY.members["routingConfiguration"], - self.routing_configuration, - ) - if self.concurrency_configuration is not None: - serializer.write_struct( - _SCHEMA_FLOW_ALIAS_SUMMARY.members["concurrencyConfiguration"], - self.concurrency_configuration, - ) - - serializer.write_string( - _SCHEMA_FLOW_ALIAS_SUMMARY.members["flowId"], self.flow_id - ) - serializer.write_string(_SCHEMA_FLOW_ALIAS_SUMMARY.members["id"], self.id) - serializer.write_string(_SCHEMA_FLOW_ALIAS_SUMMARY.members["arn"], self.arn) - serializer.write_timestamp( - _SCHEMA_FLOW_ALIAS_SUMMARY.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_FLOW_ALIAS_SUMMARY.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_FLOW_ALIAS_SUMMARY.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_FLOW_ALIAS_SUMMARY.members["description"] - ) - - case 2: - kwargs["routing_configuration"] = ( - _deserialize_flow_alias_routing_configuration( - de, - _SCHEMA_FLOW_ALIAS_SUMMARY.members["routingConfiguration"], - ) - ) - - case 3: - kwargs["concurrency_configuration"] = ( - FlowAliasConcurrencyConfiguration.deserialize(de) - ) - - case 4: - kwargs["flow_id"] = de.read_string( - _SCHEMA_FLOW_ALIAS_SUMMARY.members["flowId"] - ) - - case 5: - kwargs["id"] = de.read_string( - _SCHEMA_FLOW_ALIAS_SUMMARY.members["id"] - ) - - case 6: - kwargs["arn"] = de.read_string( - _SCHEMA_FLOW_ALIAS_SUMMARY.members["arn"] - ) - - case 7: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_FLOW_ALIAS_SUMMARY.members["createdAt"] - ) - - case 8: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_FLOW_ALIAS_SUMMARY.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FLOW_ALIAS_SUMMARY, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "routing_configuration" not in kwargs: - kwargs["routing_configuration"] = [] - if "flow_id" not in kwargs: - kwargs["flow_id"] = "" - if "id" not in kwargs: - kwargs["id"] = "" - if "arn" not in kwargs: - kwargs["arn"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_flow_alias_summaries( - serializer: ShapeSerializer, schema: Schema, value: list[FlowAliasSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_flow_alias_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[FlowAliasSummary]: - result: list[FlowAliasSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(FlowAliasSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListFlowAliasesOutput: - """Dataclass for ListFlowAliasesOutput structure.""" - - flow_alias_summaries: list[FlowAliasSummary] - """A list, each member of which contains information about an alias.""" - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, use this token when making another request in - the `nextToken` field to return the next batch of results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_FLOW_ALIASES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_flow_alias_summaries( - serializer, - _SCHEMA_LIST_FLOW_ALIASES_OUTPUT.members["flowAliasSummaries"], - self.flow_alias_summaries, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_FLOW_ALIASES_OUTPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["flow_alias_summaries"] = _deserialize_flow_alias_summaries( - de, - _SCHEMA_LIST_FLOW_ALIASES_OUTPUT.members["flowAliasSummaries"], - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_FLOW_ALIASES_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_FLOW_ALIASES_OUTPUT, consumer=_consumer) - if "flow_alias_summaries" not in kwargs: - kwargs["flow_alias_summaries"] = [] - return kwargs - - -LIST_FLOW_ALIASES = APIOperation( - input=ListFlowAliasesInput, - output=ListFlowAliasesOutput, - schema=_SCHEMA_LIST_FLOW_ALIASES, - input_schema=_SCHEMA_LIST_FLOW_ALIASES_INPUT, - output_schema=_SCHEMA_LIST_FLOW_ALIASES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateFlowAliasInput: - """Dataclass for UpdateFlowAliasInput structure.""" - - name: str | None = None - """The name of the alias.""" - - description: str | None = None - """A description for the alias.""" - - routing_configuration: list[FlowAliasRoutingConfigurationListItem] | None = None - """Contains information about the version to which to map the alias.""" - - concurrency_configuration: FlowAliasConcurrencyConfiguration | None = None - """ - The configuration that specifies how nodes in the flow are executed in - parallel. - """ - - flow_identifier: str | None = None - """The unique identifier of the flow.""" - - alias_identifier: str | None = None - """The unique identifier of the alias.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_FLOW_ALIAS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_UPDATE_FLOW_ALIAS_INPUT.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_FLOW_ALIAS_INPUT.members["description"], self.description - ) - - if self.routing_configuration is not None: - _serialize_flow_alias_routing_configuration( - serializer, - _SCHEMA_UPDATE_FLOW_ALIAS_INPUT.members["routingConfiguration"], - self.routing_configuration, - ) - - if self.concurrency_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_FLOW_ALIAS_INPUT.members["concurrencyConfiguration"], - self.concurrency_configuration, - ) - - if self.flow_identifier is not None: - serializer.write_string( - _SCHEMA_UPDATE_FLOW_ALIAS_INPUT.members["flowIdentifier"], - self.flow_identifier, - ) - - if self.alias_identifier is not None: - serializer.write_string( - _SCHEMA_UPDATE_FLOW_ALIAS_INPUT.members["aliasIdentifier"], - self.alias_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_FLOW_ALIAS_INPUT.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_FLOW_ALIAS_INPUT.members["description"] - ) - - case 2: - kwargs["routing_configuration"] = ( - _deserialize_flow_alias_routing_configuration( - de, - _SCHEMA_UPDATE_FLOW_ALIAS_INPUT.members[ - "routingConfiguration" - ], - ) - ) - - case 3: - kwargs["concurrency_configuration"] = ( - FlowAliasConcurrencyConfiguration.deserialize(de) - ) - - case 4: - kwargs["flow_identifier"] = de.read_string( - _SCHEMA_UPDATE_FLOW_ALIAS_INPUT.members["flowIdentifier"] - ) - - case 5: - kwargs["alias_identifier"] = de.read_string( - _SCHEMA_UPDATE_FLOW_ALIAS_INPUT.members["aliasIdentifier"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_FLOW_ALIAS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateFlowAliasOutput: - """Dataclass for UpdateFlowAliasOutput structure.""" - - name: str - """The name of the alias.""" - - routing_configuration: list[FlowAliasRoutingConfigurationListItem] - """Contains information about the version that the alias is mapped to.""" - - flow_id: str - """The unique identifier of the flow.""" - - id: str - """The unique identifier of the alias.""" - - arn: str - """The Amazon Resource Name (ARN) of the flow.""" - - created_at: datetime - """The time at which the flow was created.""" - - updated_at: datetime - """The time at which the alias was last updated.""" - - description: str | None = None - """The description of the flow.""" - - concurrency_configuration: FlowAliasConcurrencyConfiguration | None = None - """ - The configuration that specifies how nodes in the flow are executed in - parallel. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_FLOW_ALIAS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_UPDATE_FLOW_ALIAS_OUTPUT.members["name"], self.name - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_FLOW_ALIAS_OUTPUT.members["description"], - self.description, - ) - - _serialize_flow_alias_routing_configuration( - serializer, - _SCHEMA_UPDATE_FLOW_ALIAS_OUTPUT.members["routingConfiguration"], - self.routing_configuration, - ) - if self.concurrency_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_FLOW_ALIAS_OUTPUT.members["concurrencyConfiguration"], - self.concurrency_configuration, - ) - - serializer.write_string( - _SCHEMA_UPDATE_FLOW_ALIAS_OUTPUT.members["flowId"], self.flow_id - ) - serializer.write_string(_SCHEMA_UPDATE_FLOW_ALIAS_OUTPUT.members["id"], self.id) - serializer.write_string( - _SCHEMA_UPDATE_FLOW_ALIAS_OUTPUT.members["arn"], self.arn - ) - serializer.write_timestamp( - _SCHEMA_UPDATE_FLOW_ALIAS_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_UPDATE_FLOW_ALIAS_OUTPUT.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_FLOW_ALIAS_OUTPUT.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_FLOW_ALIAS_OUTPUT.members["description"] - ) - - case 2: - kwargs["routing_configuration"] = ( - _deserialize_flow_alias_routing_configuration( - de, - _SCHEMA_UPDATE_FLOW_ALIAS_OUTPUT.members[ - "routingConfiguration" - ], - ) - ) - - case 3: - kwargs["concurrency_configuration"] = ( - FlowAliasConcurrencyConfiguration.deserialize(de) - ) - - case 4: - kwargs["flow_id"] = de.read_string( - _SCHEMA_UPDATE_FLOW_ALIAS_OUTPUT.members["flowId"] - ) - - case 5: - kwargs["id"] = de.read_string( - _SCHEMA_UPDATE_FLOW_ALIAS_OUTPUT.members["id"] - ) - - case 6: - kwargs["arn"] = de.read_string( - _SCHEMA_UPDATE_FLOW_ALIAS_OUTPUT.members["arn"] - ) - - case 7: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_UPDATE_FLOW_ALIAS_OUTPUT.members["createdAt"] - ) - - case 8: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_UPDATE_FLOW_ALIAS_OUTPUT.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_FLOW_ALIAS_OUTPUT, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "routing_configuration" not in kwargs: - kwargs["routing_configuration"] = [] - if "flow_id" not in kwargs: - kwargs["flow_id"] = "" - if "id" not in kwargs: - kwargs["id"] = "" - if "arn" not in kwargs: - kwargs["arn"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -UPDATE_FLOW_ALIAS = APIOperation( - input=UpdateFlowAliasInput, - output=UpdateFlowAliasOutput, - schema=_SCHEMA_UPDATE_FLOW_ALIAS, - input_schema=_SCHEMA_UPDATE_FLOW_ALIAS_INPUT, - output_schema=_SCHEMA_UPDATE_FLOW_ALIAS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrockagent#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class CreateFlowVersionInput: - """Dataclass for CreateFlowVersionInput structure.""" - - flow_identifier: str | None = None - """The unique identifier of the flow that you want to create a version of.""" - - description: str | None = None - """A description of the version of the flow.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If this token matches a previous - request, Amazon Bedrock ignores the request, but does not return an - error. For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_FLOW_VERSION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.flow_identifier is not None: - serializer.write_string( - _SCHEMA_CREATE_FLOW_VERSION_INPUT.members["flowIdentifier"], - self.flow_identifier, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_FLOW_VERSION_INPUT.members["description"], - self.description, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_FLOW_VERSION_INPUT.members["clientToken"], - self.client_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["flow_identifier"] = de.read_string( - _SCHEMA_CREATE_FLOW_VERSION_INPUT.members["flowIdentifier"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_FLOW_VERSION_INPUT.members["description"] - ) - - case 2: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_FLOW_VERSION_INPUT.members["clientToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_FLOW_VERSION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteFlowVersionInput: - """Dataclass for DeleteFlowVersionInput structure.""" - - flow_identifier: str | None = None - """The unique identifier of the flow whose version that you want to delete""" - - flow_version: str | None = None - """The version of the flow that you want to delete.""" - - skip_resource_in_use_check: bool = False - """ - By default, this value is `false` and deletion is stopped if the - resource is in use. If you set it to `true`, the resource will be - deleted even if the resource is in use. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_FLOW_VERSION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.flow_identifier is not None: - serializer.write_string( - _SCHEMA_DELETE_FLOW_VERSION_INPUT.members["flowIdentifier"], - self.flow_identifier, - ) - - if self.flow_version is not None: - serializer.write_string( - _SCHEMA_DELETE_FLOW_VERSION_INPUT.members["flowVersion"], - self.flow_version, - ) - - if self.skip_resource_in_use_check is not None: - serializer.write_boolean( - _SCHEMA_DELETE_FLOW_VERSION_INPUT.members["skipResourceInUseCheck"], - self.skip_resource_in_use_check, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["flow_identifier"] = de.read_string( - _SCHEMA_DELETE_FLOW_VERSION_INPUT.members["flowIdentifier"] - ) - - case 1: - kwargs["flow_version"] = de.read_string( - _SCHEMA_DELETE_FLOW_VERSION_INPUT.members["flowVersion"] - ) - - case 2: - kwargs["skip_resource_in_use_check"] = de.read_boolean( - _SCHEMA_DELETE_FLOW_VERSION_INPUT.members[ - "skipResourceInUseCheck" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_FLOW_VERSION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteFlowVersionOutput: - """Dataclass for DeleteFlowVersionOutput structure.""" - - id: str - """The unique identifier of the flow.""" - - version: str - """The version of the flow being deleted.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_FLOW_VERSION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DELETE_FLOW_VERSION_OUTPUT.members["id"], self.id - ) - serializer.write_string( - _SCHEMA_DELETE_FLOW_VERSION_OUTPUT.members["version"], self.version - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_DELETE_FLOW_VERSION_OUTPUT.members["id"] - ) - - case 1: - kwargs["version"] = de.read_string( - _SCHEMA_DELETE_FLOW_VERSION_OUTPUT.members["version"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_FLOW_VERSION_OUTPUT, consumer=_consumer) - if "id" not in kwargs: - kwargs["id"] = "" - if "version" not in kwargs: - kwargs["version"] = "" - return kwargs - - -DELETE_FLOW_VERSION = APIOperation( - input=DeleteFlowVersionInput, - output=DeleteFlowVersionOutput, - schema=_SCHEMA_DELETE_FLOW_VERSION, - input_schema=_SCHEMA_DELETE_FLOW_VERSION_INPUT, - output_schema=_SCHEMA_DELETE_FLOW_VERSION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrockagent#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class IncludedData(UnknownEnumMixin, StrEnum): - ALL_DATA = "ALL_DATA" - METADATA_ONLY = "METADATA_ONLY" - - -@dataclass(kw_only=True) -class GetFlowVersionInput: - """Dataclass for GetFlowVersionInput structure.""" - - flow_identifier: str | None = None - """The unique identifier of the flow for which to get information.""" - - flow_version: str | None = None - """The version of the flow for which to get information.""" - - included_data: str | None = None - """ - Controls the scope of data returned. Set to `METADATA_ONLY` to return - only resource metadata. Set to `ALL_DATA` or omit this field to return - the full response. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_FLOW_VERSION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.flow_identifier is not None: - serializer.write_string( - _SCHEMA_GET_FLOW_VERSION_INPUT.members["flowIdentifier"], - self.flow_identifier, - ) - - if self.flow_version is not None: - serializer.write_string( - _SCHEMA_GET_FLOW_VERSION_INPUT.members["flowVersion"], self.flow_version - ) - - if self.included_data is not None: - serializer.write_string( - _SCHEMA_GET_FLOW_VERSION_INPUT.members["includedData"], - self.included_data, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["flow_identifier"] = de.read_string( - _SCHEMA_GET_FLOW_VERSION_INPUT.members["flowIdentifier"] - ) - - case 1: - kwargs["flow_version"] = de.read_string( - _SCHEMA_GET_FLOW_VERSION_INPUT.members["flowVersion"] - ) - - case 2: - kwargs["included_data"] = IncludedData( - de.read_string( - _SCHEMA_GET_FLOW_VERSION_INPUT.members["includedData"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_FLOW_VERSION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ListFlowVersionsInput: - """Dataclass for ListFlowVersionsInput structure.""" - - flow_identifier: str | None = None - """The unique identifier of the flow.""" - - max_results: int | None = None - """ - The maximum number of results to return in the response. If the total - number of results is greater than this value, use the token returned in - the response in the `nextToken` field when making another request to - return the next batch of results. - """ - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, enter the token returned in the `nextToken` - field in the response in this field to return the next batch of results. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_FLOW_VERSIONS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.flow_identifier is not None: - serializer.write_string( - _SCHEMA_LIST_FLOW_VERSIONS_INPUT.members["flowIdentifier"], - self.flow_identifier, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_FLOW_VERSIONS_INPUT.members["maxResults"], self.max_results - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_FLOW_VERSIONS_INPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["flow_identifier"] = de.read_string( - _SCHEMA_LIST_FLOW_VERSIONS_INPUT.members["flowIdentifier"] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_FLOW_VERSIONS_INPUT.members["maxResults"] - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_FLOW_VERSIONS_INPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_FLOW_VERSIONS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class FlowVersionSummary: - """ - Contains information about a version of a flow. - - This data type is used in the following API operations: - - - [ListFlowVersions - response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_ListFlowVersions.html#API_agent_ListFlowVersions_ResponseSyntax) - """ - - id: str - """The unique identifier of the flow.""" - - arn: str - """The Amazon Resource Name (ARN) of the flow that the version belongs to.""" - - status: str - """The status of the flow.""" - - created_at: datetime - """The time at the version was created.""" - - version: str - """The version of the flow.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_VERSION_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_FLOW_VERSION_SUMMARY.members["id"], self.id) - serializer.write_string(_SCHEMA_FLOW_VERSION_SUMMARY.members["arn"], self.arn) - serializer.write_string( - _SCHEMA_FLOW_VERSION_SUMMARY.members["status"], self.status - ) - serializer.write_timestamp( - _SCHEMA_FLOW_VERSION_SUMMARY.members["createdAt"], self.created_at - ) - serializer.write_string( - _SCHEMA_FLOW_VERSION_SUMMARY.members["version"], self.version - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_FLOW_VERSION_SUMMARY.members["id"] - ) - - case 1: - kwargs["arn"] = de.read_string( - _SCHEMA_FLOW_VERSION_SUMMARY.members["arn"] - ) - - case 2: - kwargs["status"] = FlowStatus( - de.read_string(_SCHEMA_FLOW_VERSION_SUMMARY.members["status"]) - ) - - case 3: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_FLOW_VERSION_SUMMARY.members["createdAt"] - ) - - case 4: - kwargs["version"] = de.read_string( - _SCHEMA_FLOW_VERSION_SUMMARY.members["version"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FLOW_VERSION_SUMMARY, consumer=_consumer) - if "id" not in kwargs: - kwargs["id"] = "" - if "arn" not in kwargs: - kwargs["arn"] = "" - if "status" not in kwargs: - kwargs["status"] = FlowStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "version" not in kwargs: - kwargs["version"] = "" - return kwargs - - -def _serialize_flow_version_summaries( - serializer: ShapeSerializer, schema: Schema, value: list[FlowVersionSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_flow_version_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[FlowVersionSummary]: - result: list[FlowVersionSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(FlowVersionSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListFlowVersionsOutput: - """Dataclass for ListFlowVersionsOutput structure.""" - - flow_version_summaries: list[FlowVersionSummary] - """A list, each member of which contains information about a flow.""" - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, use this token when making another request in - the `nextToken` field to return the next batch of results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_FLOW_VERSIONS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_flow_version_summaries( - serializer, - _SCHEMA_LIST_FLOW_VERSIONS_OUTPUT.members["flowVersionSummaries"], - self.flow_version_summaries, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_FLOW_VERSIONS_OUTPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["flow_version_summaries"] = ( - _deserialize_flow_version_summaries( - de, - _SCHEMA_LIST_FLOW_VERSIONS_OUTPUT.members[ - "flowVersionSummaries" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_FLOW_VERSIONS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_FLOW_VERSIONS_OUTPUT, consumer=_consumer) - if "flow_version_summaries" not in kwargs: - kwargs["flow_version_summaries"] = [] - return kwargs - - -LIST_FLOW_VERSIONS = APIOperation( - input=ListFlowVersionsInput, - output=ListFlowVersionsOutput, - schema=_SCHEMA_LIST_FLOW_VERSIONS, - input_schema=_SCHEMA_LIST_FLOW_VERSIONS_INPUT, - output_schema=_SCHEMA_LIST_FLOW_VERSIONS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetFlowInput: - """Dataclass for GetFlowInput structure.""" - - flow_identifier: str | None = None - """The unique identifier of the flow.""" - - included_data: str | None = None - """ - Controls the scope of data returned. Set to `METADATA_ONLY` to return - only resource metadata. Set to `ALL_DATA` or omit this field to return - the full response. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_FLOW_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.flow_identifier is not None: - serializer.write_string( - _SCHEMA_GET_FLOW_INPUT.members["flowIdentifier"], self.flow_identifier - ) - - if self.included_data is not None: - serializer.write_string( - _SCHEMA_GET_FLOW_INPUT.members["includedData"], self.included_data - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["flow_identifier"] = de.read_string( - _SCHEMA_GET_FLOW_INPUT.members["flowIdentifier"] - ) - - case 1: - kwargs["included_data"] = IncludedData( - de.read_string(_SCHEMA_GET_FLOW_INPUT.members["includedData"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_FLOW_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CyclicConnectionFlowValidationDetails: - """Details about a cyclic connection detected in the flow.""" - - connection: str - """The name of the connection that causes the cycle in the flow.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CYCLIC_CONNECTION_FLOW_VALIDATION_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CYCLIC_CONNECTION_FLOW_VALIDATION_DETAILS.members["connection"], - self.connection, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["connection"] = de.read_string( - _SCHEMA_CYCLIC_CONNECTION_FLOW_VALIDATION_DETAILS.members[ - "connection" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CYCLIC_CONNECTION_FLOW_VALIDATION_DETAILS, consumer=_consumer - ) - if "connection" not in kwargs: - kwargs["connection"] = "" - return kwargs - - -@dataclass(kw_only=True) -class DuplicateConditionExpressionFlowValidationDetails: - """Details about duplicate condition expressions found in a condition node.""" - - node: str - """The name of the node containing the duplicate condition expressions.""" - - expression: str = field(repr=False) - """The duplicated condition expression.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DUPLICATE_CONDITION_EXPRESSION_FLOW_VALIDATION_DETAILS, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DUPLICATE_CONDITION_EXPRESSION_FLOW_VALIDATION_DETAILS.members[ - "node" - ], - self.node, - ) - serializer.write_string( - _SCHEMA_DUPLICATE_CONDITION_EXPRESSION_FLOW_VALIDATION_DETAILS.members[ - "expression" - ], - self.expression, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["node"] = de.read_string( - _SCHEMA_DUPLICATE_CONDITION_EXPRESSION_FLOW_VALIDATION_DETAILS.members[ - "node" - ] - ) - - case 1: - kwargs["expression"] = de.read_string( - _SCHEMA_DUPLICATE_CONDITION_EXPRESSION_FLOW_VALIDATION_DETAILS.members[ - "expression" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DUPLICATE_CONDITION_EXPRESSION_FLOW_VALIDATION_DETAILS, - consumer=_consumer, - ) - if "node" not in kwargs: - kwargs["node"] = "" - if "expression" not in kwargs: - kwargs["expression"] = "" - return kwargs - - -@dataclass(kw_only=True) -class DuplicateConnectionsFlowValidationDetails: - """Details about duplicate connections found between two nodes in the flow.""" - - source: str - """The name of the source node where the duplicate connection starts.""" - - target: str - """The name of the target node where the duplicate connection ends.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DUPLICATE_CONNECTIONS_FLOW_VALIDATION_DETAILS, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DUPLICATE_CONNECTIONS_FLOW_VALIDATION_DETAILS.members["source"], - self.source, - ) - serializer.write_string( - _SCHEMA_DUPLICATE_CONNECTIONS_FLOW_VALIDATION_DETAILS.members["target"], - self.target, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["source"] = de.read_string( - _SCHEMA_DUPLICATE_CONNECTIONS_FLOW_VALIDATION_DETAILS.members[ - "source" - ] - ) - - case 1: - kwargs["target"] = de.read_string( - _SCHEMA_DUPLICATE_CONNECTIONS_FLOW_VALIDATION_DETAILS.members[ - "target" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DUPLICATE_CONNECTIONS_FLOW_VALIDATION_DETAILS, consumer=_consumer - ) - if "source" not in kwargs: - kwargs["source"] = "" - if "target" not in kwargs: - kwargs["target"] = "" - return kwargs - - -@dataclass(kw_only=True) -class IncompatibleConnectionDataTypeFlowValidationDetails: - """Details about incompatible data types in a connection between nodes.""" - - connection: str - """The name of the connection with incompatible data types.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INCOMPATIBLE_CONNECTION_DATA_TYPE_FLOW_VALIDATION_DETAILS, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_INCOMPATIBLE_CONNECTION_DATA_TYPE_FLOW_VALIDATION_DETAILS.members[ - "connection" - ], - self.connection, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["connection"] = de.read_string( - _SCHEMA_INCOMPATIBLE_CONNECTION_DATA_TYPE_FLOW_VALIDATION_DETAILS.members[ - "connection" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INCOMPATIBLE_CONNECTION_DATA_TYPE_FLOW_VALIDATION_DETAILS, - consumer=_consumer, - ) - if "connection" not in kwargs: - kwargs["connection"] = "" - return kwargs - - -@dataclass(kw_only=True) -class InvalidLoopBoundaryFlowValidationDetails: - """ - Details about a flow that contains connections that violate loop - boundary rules. - """ - - connection: str - """The name of the connection that violates loop boundary rules.""" - - source: str - """ - The source node of the connection that violates DoWhile loop boundary - rules. - """ - - target: str - """ - The target node of the connection that violates DoWhile loop boundary - rules. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVALID_LOOP_BOUNDARY_FLOW_VALIDATION_DETAILS, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_INVALID_LOOP_BOUNDARY_FLOW_VALIDATION_DETAILS.members["connection"], - self.connection, - ) - serializer.write_string( - _SCHEMA_INVALID_LOOP_BOUNDARY_FLOW_VALIDATION_DETAILS.members["source"], - self.source, - ) - serializer.write_string( - _SCHEMA_INVALID_LOOP_BOUNDARY_FLOW_VALIDATION_DETAILS.members["target"], - self.target, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["connection"] = de.read_string( - _SCHEMA_INVALID_LOOP_BOUNDARY_FLOW_VALIDATION_DETAILS.members[ - "connection" - ] - ) - - case 1: - kwargs["source"] = de.read_string( - _SCHEMA_INVALID_LOOP_BOUNDARY_FLOW_VALIDATION_DETAILS.members[ - "source" - ] - ) - - case 2: - kwargs["target"] = de.read_string( - _SCHEMA_INVALID_LOOP_BOUNDARY_FLOW_VALIDATION_DETAILS.members[ - "target" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVALID_LOOP_BOUNDARY_FLOW_VALIDATION_DETAILS, consumer=_consumer - ) - if "connection" not in kwargs: - kwargs["connection"] = "" - if "source" not in kwargs: - kwargs["source"] = "" - if "target" not in kwargs: - kwargs["target"] = "" - return kwargs - - -class IncompatibleLoopNodeType(UnknownEnumMixin, StrEnum): - INPUT = "Input" - CONDITION = "Condition" - ITERATOR = "Iterator" - COLLECTOR = "Collector" - - -@dataclass(kw_only=True) -class LoopIncompatibleNodeTypeFlowValidationDetails: - """ - Details about a flow that contains an incompatible node in a DoWhile - loop. - """ - - node: str - """The `Loop` container node that contains an incompatible node.""" - - incompatible_node_type: str - """ - The node type of the incompatible node in the DoWhile loop. Some node - types, like a condition node, aren't allowed in a DoWhile loop. - """ - - incompatible_node_name: str - """The node that's incompatible in the DoWhile loop.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_LOOP_INCOMPATIBLE_NODE_TYPE_FLOW_VALIDATION_DETAILS, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_LOOP_INCOMPATIBLE_NODE_TYPE_FLOW_VALIDATION_DETAILS.members["node"], - self.node, - ) - serializer.write_string( - _SCHEMA_LOOP_INCOMPATIBLE_NODE_TYPE_FLOW_VALIDATION_DETAILS.members[ - "incompatibleNodeType" - ], - self.incompatible_node_type, - ) - serializer.write_string( - _SCHEMA_LOOP_INCOMPATIBLE_NODE_TYPE_FLOW_VALIDATION_DETAILS.members[ - "incompatibleNodeName" - ], - self.incompatible_node_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["node"] = de.read_string( - _SCHEMA_LOOP_INCOMPATIBLE_NODE_TYPE_FLOW_VALIDATION_DETAILS.members[ - "node" - ] - ) - - case 1: - kwargs["incompatible_node_type"] = IncompatibleLoopNodeType( - de.read_string( - _SCHEMA_LOOP_INCOMPATIBLE_NODE_TYPE_FLOW_VALIDATION_DETAILS.members[ - "incompatibleNodeType" - ] - ) - ) - - case 2: - kwargs["incompatible_node_name"] = de.read_string( - _SCHEMA_LOOP_INCOMPATIBLE_NODE_TYPE_FLOW_VALIDATION_DETAILS.members[ - "incompatibleNodeName" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LOOP_INCOMPATIBLE_NODE_TYPE_FLOW_VALIDATION_DETAILS, - consumer=_consumer, - ) - if "node" not in kwargs: - kwargs["node"] = "" - if "incompatible_node_type" not in kwargs: - kwargs["incompatible_node_type"] = IncompatibleLoopNodeType._corrected("") - if "incompatible_node_name" not in kwargs: - kwargs["incompatible_node_name"] = "" - return kwargs - - -@dataclass(kw_only=True) -class MalformedConditionExpressionFlowValidationDetails: - """Details about a malformed condition expression in a node.""" - - node: str - """The name of the node containing the malformed condition expression.""" - - condition: str - """The name of the malformed condition.""" - - cause: str - """The error message describing why the condition expression is malformed.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MALFORMED_CONDITION_EXPRESSION_FLOW_VALIDATION_DETAILS, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MALFORMED_CONDITION_EXPRESSION_FLOW_VALIDATION_DETAILS.members[ - "node" - ], - self.node, - ) - serializer.write_string( - _SCHEMA_MALFORMED_CONDITION_EXPRESSION_FLOW_VALIDATION_DETAILS.members[ - "condition" - ], - self.condition, - ) - serializer.write_string( - _SCHEMA_MALFORMED_CONDITION_EXPRESSION_FLOW_VALIDATION_DETAILS.members[ - "cause" - ], - self.cause, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["node"] = de.read_string( - _SCHEMA_MALFORMED_CONDITION_EXPRESSION_FLOW_VALIDATION_DETAILS.members[ - "node" - ] - ) - - case 1: - kwargs["condition"] = de.read_string( - _SCHEMA_MALFORMED_CONDITION_EXPRESSION_FLOW_VALIDATION_DETAILS.members[ - "condition" - ] - ) - - case 2: - kwargs["cause"] = de.read_string( - _SCHEMA_MALFORMED_CONDITION_EXPRESSION_FLOW_VALIDATION_DETAILS.members[ - "cause" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MALFORMED_CONDITION_EXPRESSION_FLOW_VALIDATION_DETAILS, - consumer=_consumer, - ) - if "node" not in kwargs: - kwargs["node"] = "" - if "condition" not in kwargs: - kwargs["condition"] = "" - if "cause" not in kwargs: - kwargs["cause"] = "" - return kwargs - - -@dataclass(kw_only=True) -class MalformedNodeInputExpressionFlowValidationDetails: - """Details about a malformed input expression in a node.""" - - node: str - """The name of the node containing the malformed input expression.""" - - input: str - """The name of the input with the malformed expression.""" - - cause: str - """The error message describing why the input expression is malformed.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MALFORMED_NODE_INPUT_EXPRESSION_FLOW_VALIDATION_DETAILS, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MALFORMED_NODE_INPUT_EXPRESSION_FLOW_VALIDATION_DETAILS.members[ - "node" - ], - self.node, - ) - serializer.write_string( - _SCHEMA_MALFORMED_NODE_INPUT_EXPRESSION_FLOW_VALIDATION_DETAILS.members[ - "input" - ], - self.input, - ) - serializer.write_string( - _SCHEMA_MALFORMED_NODE_INPUT_EXPRESSION_FLOW_VALIDATION_DETAILS.members[ - "cause" - ], - self.cause, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["node"] = de.read_string( - _SCHEMA_MALFORMED_NODE_INPUT_EXPRESSION_FLOW_VALIDATION_DETAILS.members[ - "node" - ] - ) - - case 1: - kwargs["input"] = de.read_string( - _SCHEMA_MALFORMED_NODE_INPUT_EXPRESSION_FLOW_VALIDATION_DETAILS.members[ - "input" - ] - ) - - case 2: - kwargs["cause"] = de.read_string( - _SCHEMA_MALFORMED_NODE_INPUT_EXPRESSION_FLOW_VALIDATION_DETAILS.members[ - "cause" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MALFORMED_NODE_INPUT_EXPRESSION_FLOW_VALIDATION_DETAILS, - consumer=_consumer, - ) - if "node" not in kwargs: - kwargs["node"] = "" - if "input" not in kwargs: - kwargs["input"] = "" - if "cause" not in kwargs: - kwargs["cause"] = "" - return kwargs - - -@dataclass(kw_only=True) -class MismatchedNodeInputTypeFlowValidationDetails: - """Details about mismatched input data types in a node.""" - - node: str - """The name of the node containing the input with the mismatched data type.""" - - input: str - """The name of the input with the mismatched data type.""" - - expected_type: str - """The expected data type for the node input.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MISMATCHED_NODE_INPUT_TYPE_FLOW_VALIDATION_DETAILS, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MISMATCHED_NODE_INPUT_TYPE_FLOW_VALIDATION_DETAILS.members["node"], - self.node, - ) - serializer.write_string( - _SCHEMA_MISMATCHED_NODE_INPUT_TYPE_FLOW_VALIDATION_DETAILS.members["input"], - self.input, - ) - serializer.write_string( - _SCHEMA_MISMATCHED_NODE_INPUT_TYPE_FLOW_VALIDATION_DETAILS.members[ - "expectedType" - ], - self.expected_type, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["node"] = de.read_string( - _SCHEMA_MISMATCHED_NODE_INPUT_TYPE_FLOW_VALIDATION_DETAILS.members[ - "node" - ] - ) - - case 1: - kwargs["input"] = de.read_string( - _SCHEMA_MISMATCHED_NODE_INPUT_TYPE_FLOW_VALIDATION_DETAILS.members[ - "input" - ] - ) - - case 2: - kwargs["expected_type"] = FlowNodeIODataType( - de.read_string( - _SCHEMA_MISMATCHED_NODE_INPUT_TYPE_FLOW_VALIDATION_DETAILS.members[ - "expectedType" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MISMATCHED_NODE_INPUT_TYPE_FLOW_VALIDATION_DETAILS, - consumer=_consumer, - ) - if "node" not in kwargs: - kwargs["node"] = "" - if "input" not in kwargs: - kwargs["input"] = "" - if "expected_type" not in kwargs: - kwargs["expected_type"] = FlowNodeIODataType._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class MismatchedNodeOutputTypeFlowValidationDetails: - """Details about mismatched output data types in a node.""" - - node: str - """ - The name of the node containing the output with the mismatched data - type. - """ - - output: str - """The name of the output with the mismatched data type.""" - - expected_type: str - """The expected data type for the node output.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MISMATCHED_NODE_OUTPUT_TYPE_FLOW_VALIDATION_DETAILS, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MISMATCHED_NODE_OUTPUT_TYPE_FLOW_VALIDATION_DETAILS.members["node"], - self.node, - ) - serializer.write_string( - _SCHEMA_MISMATCHED_NODE_OUTPUT_TYPE_FLOW_VALIDATION_DETAILS.members[ - "output" - ], - self.output, - ) - serializer.write_string( - _SCHEMA_MISMATCHED_NODE_OUTPUT_TYPE_FLOW_VALIDATION_DETAILS.members[ - "expectedType" - ], - self.expected_type, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["node"] = de.read_string( - _SCHEMA_MISMATCHED_NODE_OUTPUT_TYPE_FLOW_VALIDATION_DETAILS.members[ - "node" - ] - ) - - case 1: - kwargs["output"] = de.read_string( - _SCHEMA_MISMATCHED_NODE_OUTPUT_TYPE_FLOW_VALIDATION_DETAILS.members[ - "output" - ] - ) - - case 2: - kwargs["expected_type"] = FlowNodeIODataType( - de.read_string( - _SCHEMA_MISMATCHED_NODE_OUTPUT_TYPE_FLOW_VALIDATION_DETAILS.members[ - "expectedType" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MISMATCHED_NODE_OUTPUT_TYPE_FLOW_VALIDATION_DETAILS, - consumer=_consumer, - ) - if "node" not in kwargs: - kwargs["node"] = "" - if "output" not in kwargs: - kwargs["output"] = "" - if "expected_type" not in kwargs: - kwargs["expected_type"] = FlowNodeIODataType._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class MissingConnectionConfigurationFlowValidationDetails: - """Details about a connection missing required configuration.""" - - connection: str - """The name of the connection missing configuration.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MISSING_CONNECTION_CONFIGURATION_FLOW_VALIDATION_DETAILS, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MISSING_CONNECTION_CONFIGURATION_FLOW_VALIDATION_DETAILS.members[ - "connection" - ], - self.connection, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["connection"] = de.read_string( - _SCHEMA_MISSING_CONNECTION_CONFIGURATION_FLOW_VALIDATION_DETAILS.members[ - "connection" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MISSING_CONNECTION_CONFIGURATION_FLOW_VALIDATION_DETAILS, - consumer=_consumer, - ) - if "connection" not in kwargs: - kwargs["connection"] = "" - return kwargs - - -@dataclass(kw_only=True) -class MissingDefaultConditionFlowValidationDetails: - """Details about a missing default condition in a conditional node.""" - - node: str - """The name of the node missing the default condition.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MISSING_DEFAULT_CONDITION_FLOW_VALIDATION_DETAILS, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MISSING_DEFAULT_CONDITION_FLOW_VALIDATION_DETAILS.members["node"], - self.node, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["node"] = de.read_string( - _SCHEMA_MISSING_DEFAULT_CONDITION_FLOW_VALIDATION_DETAILS.members[ - "node" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MISSING_DEFAULT_CONDITION_FLOW_VALIDATION_DETAILS, - consumer=_consumer, - ) - if "node" not in kwargs: - kwargs["node"] = "" - return kwargs - - -@dataclass(kw_only=True) -class MissingEndingNodesFlowValidationDetails: - """Details about missing ending nodes (such as FlowOutputNode) in the flow.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MISSING_ENDING_NODES_FLOW_VALIDATION_DETAILS, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MISSING_ENDING_NODES_FLOW_VALIDATION_DETAILS, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class MissingLoopControllerNodeFlowValidationDetails: - """ - Details about a flow that's missing a required `LoopController` node in - a DoWhile loop. - """ - - loop_node: str - """ - The DoWhile loop in a flow that's missing a required `LoopController` - node. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MISSING_LOOP_CONTROLLER_NODE_FLOW_VALIDATION_DETAILS, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MISSING_LOOP_CONTROLLER_NODE_FLOW_VALIDATION_DETAILS.members[ - "loopNode" - ], - self.loop_node, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["loop_node"] = de.read_string( - _SCHEMA_MISSING_LOOP_CONTROLLER_NODE_FLOW_VALIDATION_DETAILS.members[ - "loopNode" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MISSING_LOOP_CONTROLLER_NODE_FLOW_VALIDATION_DETAILS, - consumer=_consumer, - ) - if "loop_node" not in kwargs: - kwargs["loop_node"] = "" - return kwargs - - -@dataclass(kw_only=True) -class MissingLoopInputNodeFlowValidationDetails: - """ - Details about a flow that's missing a required `LoopInput` node in a - DoWhile loop. - """ - - loop_node: str - """The DoWhile loop in a flow that's missing a required `LoopInput` node.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MISSING_LOOP_INPUT_NODE_FLOW_VALIDATION_DETAILS, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MISSING_LOOP_INPUT_NODE_FLOW_VALIDATION_DETAILS.members["loopNode"], - self.loop_node, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["loop_node"] = de.read_string( - _SCHEMA_MISSING_LOOP_INPUT_NODE_FLOW_VALIDATION_DETAILS.members[ - "loopNode" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MISSING_LOOP_INPUT_NODE_FLOW_VALIDATION_DETAILS, consumer=_consumer - ) - if "loop_node" not in kwargs: - kwargs["loop_node"] = "" - return kwargs - - -@dataclass(kw_only=True) -class MissingNodeConfigurationFlowValidationDetails: - """Details about a node missing a required configuration.""" - - node: str - """The name of the node missing a required configuration.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MISSING_NODE_CONFIGURATION_FLOW_VALIDATION_DETAILS, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MISSING_NODE_CONFIGURATION_FLOW_VALIDATION_DETAILS.members["node"], - self.node, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["node"] = de.read_string( - _SCHEMA_MISSING_NODE_CONFIGURATION_FLOW_VALIDATION_DETAILS.members[ - "node" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MISSING_NODE_CONFIGURATION_FLOW_VALIDATION_DETAILS, - consumer=_consumer, - ) - if "node" not in kwargs: - kwargs["node"] = "" - return kwargs - - -@dataclass(kw_only=True) -class MissingNodeInputFlowValidationDetails: - """Details about a missing required input in a node.""" - - node: str - """The name of the node missing the required input.""" - - input: str - """The name of the missing input.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MISSING_NODE_INPUT_FLOW_VALIDATION_DETAILS, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MISSING_NODE_INPUT_FLOW_VALIDATION_DETAILS.members["node"], - self.node, - ) - serializer.write_string( - _SCHEMA_MISSING_NODE_INPUT_FLOW_VALIDATION_DETAILS.members["input"], - self.input, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["node"] = de.read_string( - _SCHEMA_MISSING_NODE_INPUT_FLOW_VALIDATION_DETAILS.members[ - "node" - ] - ) - - case 1: - kwargs["input"] = de.read_string( - _SCHEMA_MISSING_NODE_INPUT_FLOW_VALIDATION_DETAILS.members[ - "input" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MISSING_NODE_INPUT_FLOW_VALIDATION_DETAILS, consumer=_consumer - ) - if "node" not in kwargs: - kwargs["node"] = "" - if "input" not in kwargs: - kwargs["input"] = "" - return kwargs - - -@dataclass(kw_only=True) -class MissingNodeOutputFlowValidationDetails: - """Details about a missing required output in a node.""" - - node: str - """The name of the node missing the required output.""" - - output: str - """The name of the missing output.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MISSING_NODE_OUTPUT_FLOW_VALIDATION_DETAILS, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MISSING_NODE_OUTPUT_FLOW_VALIDATION_DETAILS.members["node"], - self.node, - ) - serializer.write_string( - _SCHEMA_MISSING_NODE_OUTPUT_FLOW_VALIDATION_DETAILS.members["output"], - self.output, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["node"] = de.read_string( - _SCHEMA_MISSING_NODE_OUTPUT_FLOW_VALIDATION_DETAILS.members[ - "node" - ] - ) - - case 1: - kwargs["output"] = de.read_string( - _SCHEMA_MISSING_NODE_OUTPUT_FLOW_VALIDATION_DETAILS.members[ - "output" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MISSING_NODE_OUTPUT_FLOW_VALIDATION_DETAILS, consumer=_consumer - ) - if "node" not in kwargs: - kwargs["node"] = "" - if "output" not in kwargs: - kwargs["output"] = "" - return kwargs - - -@dataclass(kw_only=True) -class MissingStartingNodesFlowValidationDetails: - """ - Details about missing starting nodes (such as FlowInputNode) in the - flow. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MISSING_STARTING_NODES_FLOW_VALIDATION_DETAILS, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MISSING_STARTING_NODES_FLOW_VALIDATION_DETAILS, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class MultipleLoopControllerNodesFlowValidationDetails: - """ - Details about a flow that contains multiple `LoopController` nodes in a - DoWhile loop. - """ - - loop_node: str - """ - The DoWhile loop in a flow that contains multiple `LoopController` - nodes. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MULTIPLE_LOOP_CONTROLLER_NODES_FLOW_VALIDATION_DETAILS, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MULTIPLE_LOOP_CONTROLLER_NODES_FLOW_VALIDATION_DETAILS.members[ - "loopNode" - ], - self.loop_node, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["loop_node"] = de.read_string( - _SCHEMA_MULTIPLE_LOOP_CONTROLLER_NODES_FLOW_VALIDATION_DETAILS.members[ - "loopNode" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MULTIPLE_LOOP_CONTROLLER_NODES_FLOW_VALIDATION_DETAILS, - consumer=_consumer, - ) - if "loop_node" not in kwargs: - kwargs["loop_node"] = "" - return kwargs - - -@dataclass(kw_only=True) -class MultipleLoopInputNodesFlowValidationDetails: - """ - Details about a flow that contains multiple `LoopInput` nodes in a - DoWhile loop. - """ - - loop_node: str - """The DoWhile loop in a flow that contains multiple `LoopInput` nodes.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MULTIPLE_LOOP_INPUT_NODES_FLOW_VALIDATION_DETAILS, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MULTIPLE_LOOP_INPUT_NODES_FLOW_VALIDATION_DETAILS.members[ - "loopNode" - ], - self.loop_node, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["loop_node"] = de.read_string( - _SCHEMA_MULTIPLE_LOOP_INPUT_NODES_FLOW_VALIDATION_DETAILS.members[ - "loopNode" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MULTIPLE_LOOP_INPUT_NODES_FLOW_VALIDATION_DETAILS, - consumer=_consumer, - ) - if "loop_node" not in kwargs: - kwargs["loop_node"] = "" - return kwargs - - -@dataclass(kw_only=True) -class MultipleNodeInputConnectionsFlowValidationDetails: - """Details about multiple connections to a single node input.""" - - node: str - """The name of the node containing the input with multiple connections.""" - - input: str - """The name of the input with multiple connections to it.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MULTIPLE_NODE_INPUT_CONNECTIONS_FLOW_VALIDATION_DETAILS, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MULTIPLE_NODE_INPUT_CONNECTIONS_FLOW_VALIDATION_DETAILS.members[ - "node" - ], - self.node, - ) - serializer.write_string( - _SCHEMA_MULTIPLE_NODE_INPUT_CONNECTIONS_FLOW_VALIDATION_DETAILS.members[ - "input" - ], - self.input, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["node"] = de.read_string( - _SCHEMA_MULTIPLE_NODE_INPUT_CONNECTIONS_FLOW_VALIDATION_DETAILS.members[ - "node" - ] - ) - - case 1: - kwargs["input"] = de.read_string( - _SCHEMA_MULTIPLE_NODE_INPUT_CONNECTIONS_FLOW_VALIDATION_DETAILS.members[ - "input" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MULTIPLE_NODE_INPUT_CONNECTIONS_FLOW_VALIDATION_DETAILS, - consumer=_consumer, - ) - if "node" not in kwargs: - kwargs["node"] = "" - if "input" not in kwargs: - kwargs["input"] = "" - return kwargs - - -@dataclass(kw_only=True) -class UnfulfilledNodeInputFlowValidationDetails: - """Details about an unfulfilled node input with no valid connections.""" - - node: str - """The name of the node containing the unfulfilled input.""" - - input: str - """ - The name of the unfulfilled input. An input is unfulfilled if there are - no data connections to it. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_UNFULFILLED_NODE_INPUT_FLOW_VALIDATION_DETAILS, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_UNFULFILLED_NODE_INPUT_FLOW_VALIDATION_DETAILS.members["node"], - self.node, - ) - serializer.write_string( - _SCHEMA_UNFULFILLED_NODE_INPUT_FLOW_VALIDATION_DETAILS.members["input"], - self.input, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["node"] = de.read_string( - _SCHEMA_UNFULFILLED_NODE_INPUT_FLOW_VALIDATION_DETAILS.members[ - "node" - ] - ) - - case 1: - kwargs["input"] = de.read_string( - _SCHEMA_UNFULFILLED_NODE_INPUT_FLOW_VALIDATION_DETAILS.members[ - "input" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UNFULFILLED_NODE_INPUT_FLOW_VALIDATION_DETAILS, consumer=_consumer - ) - if "node" not in kwargs: - kwargs["node"] = "" - if "input" not in kwargs: - kwargs["input"] = "" - return kwargs - - -@dataclass(kw_only=True) -class UnknownConnectionConditionFlowValidationDetails: - """Details about an unknown condition for a connection.""" - - connection: str - """The name of the connection with the unknown condition.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_UNKNOWN_CONNECTION_CONDITION_FLOW_VALIDATION_DETAILS, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_UNKNOWN_CONNECTION_CONDITION_FLOW_VALIDATION_DETAILS.members[ - "connection" - ], - self.connection, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["connection"] = de.read_string( - _SCHEMA_UNKNOWN_CONNECTION_CONDITION_FLOW_VALIDATION_DETAILS.members[ - "connection" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UNKNOWN_CONNECTION_CONDITION_FLOW_VALIDATION_DETAILS, - consumer=_consumer, - ) - if "connection" not in kwargs: - kwargs["connection"] = "" - return kwargs - - -@dataclass(kw_only=True) -class UnknownConnectionSourceFlowValidationDetails: - """Details about an unknown source node for a connection.""" - - connection: str - """The name of the connection with the unknown source.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_UNKNOWN_CONNECTION_SOURCE_FLOW_VALIDATION_DETAILS, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_UNKNOWN_CONNECTION_SOURCE_FLOW_VALIDATION_DETAILS.members[ - "connection" - ], - self.connection, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["connection"] = de.read_string( - _SCHEMA_UNKNOWN_CONNECTION_SOURCE_FLOW_VALIDATION_DETAILS.members[ - "connection" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UNKNOWN_CONNECTION_SOURCE_FLOW_VALIDATION_DETAILS, - consumer=_consumer, - ) - if "connection" not in kwargs: - kwargs["connection"] = "" - return kwargs - - -@dataclass(kw_only=True) -class UnknownConnectionSourceOutputFlowValidationDetails: - """Details about an unknown source output for a connection.""" - - connection: str - """The name of the connection with the unknown source output.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_UNKNOWN_CONNECTION_SOURCE_OUTPUT_FLOW_VALIDATION_DETAILS, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_UNKNOWN_CONNECTION_SOURCE_OUTPUT_FLOW_VALIDATION_DETAILS.members[ - "connection" - ], - self.connection, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["connection"] = de.read_string( - _SCHEMA_UNKNOWN_CONNECTION_SOURCE_OUTPUT_FLOW_VALIDATION_DETAILS.members[ - "connection" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UNKNOWN_CONNECTION_SOURCE_OUTPUT_FLOW_VALIDATION_DETAILS, - consumer=_consumer, - ) - if "connection" not in kwargs: - kwargs["connection"] = "" - return kwargs - - -@dataclass(kw_only=True) -class UnknownConnectionTargetFlowValidationDetails: - """Details about an unknown target node for a connection.""" - - connection: str - """The name of the connection with the unknown target.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_UNKNOWN_CONNECTION_TARGET_FLOW_VALIDATION_DETAILS, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_UNKNOWN_CONNECTION_TARGET_FLOW_VALIDATION_DETAILS.members[ - "connection" - ], - self.connection, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["connection"] = de.read_string( - _SCHEMA_UNKNOWN_CONNECTION_TARGET_FLOW_VALIDATION_DETAILS.members[ - "connection" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UNKNOWN_CONNECTION_TARGET_FLOW_VALIDATION_DETAILS, - consumer=_consumer, - ) - if "connection" not in kwargs: - kwargs["connection"] = "" - return kwargs - - -@dataclass(kw_only=True) -class UnknownConnectionTargetInputFlowValidationDetails: - """Details about an unknown target input for a connection.""" - - connection: str - """The name of the connection with the unknown target input.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_UNKNOWN_CONNECTION_TARGET_INPUT_FLOW_VALIDATION_DETAILS, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_UNKNOWN_CONNECTION_TARGET_INPUT_FLOW_VALIDATION_DETAILS.members[ - "connection" - ], - self.connection, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["connection"] = de.read_string( - _SCHEMA_UNKNOWN_CONNECTION_TARGET_INPUT_FLOW_VALIDATION_DETAILS.members[ - "connection" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UNKNOWN_CONNECTION_TARGET_INPUT_FLOW_VALIDATION_DETAILS, - consumer=_consumer, - ) - if "connection" not in kwargs: - kwargs["connection"] = "" - return kwargs - - -@dataclass(kw_only=True) -class UnknownNodeInputFlowValidationDetails: - """Details about an unknown input for a node.""" - - node: str - """The name of the unknown input.""" - - input: str - """The name of the node with the unknown input.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_UNKNOWN_NODE_INPUT_FLOW_VALIDATION_DETAILS, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_UNKNOWN_NODE_INPUT_FLOW_VALIDATION_DETAILS.members["node"], - self.node, - ) - serializer.write_string( - _SCHEMA_UNKNOWN_NODE_INPUT_FLOW_VALIDATION_DETAILS.members["input"], - self.input, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["node"] = de.read_string( - _SCHEMA_UNKNOWN_NODE_INPUT_FLOW_VALIDATION_DETAILS.members[ - "node" - ] - ) - - case 1: - kwargs["input"] = de.read_string( - _SCHEMA_UNKNOWN_NODE_INPUT_FLOW_VALIDATION_DETAILS.members[ - "input" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UNKNOWN_NODE_INPUT_FLOW_VALIDATION_DETAILS, consumer=_consumer - ) - if "node" not in kwargs: - kwargs["node"] = "" - if "input" not in kwargs: - kwargs["input"] = "" - return kwargs - - -@dataclass(kw_only=True) -class UnknownNodeOutputFlowValidationDetails: - """Details about an unknown output for a node.""" - - node: str - """The name of the node with the unknown output.""" - - output: str - """The name of the unknown output.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_UNKNOWN_NODE_OUTPUT_FLOW_VALIDATION_DETAILS, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_UNKNOWN_NODE_OUTPUT_FLOW_VALIDATION_DETAILS.members["node"], - self.node, - ) - serializer.write_string( - _SCHEMA_UNKNOWN_NODE_OUTPUT_FLOW_VALIDATION_DETAILS.members["output"], - self.output, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["node"] = de.read_string( - _SCHEMA_UNKNOWN_NODE_OUTPUT_FLOW_VALIDATION_DETAILS.members[ - "node" - ] - ) - - case 1: - kwargs["output"] = de.read_string( - _SCHEMA_UNKNOWN_NODE_OUTPUT_FLOW_VALIDATION_DETAILS.members[ - "output" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UNKNOWN_NODE_OUTPUT_FLOW_VALIDATION_DETAILS, consumer=_consumer - ) - if "node" not in kwargs: - kwargs["node"] = "" - if "output" not in kwargs: - kwargs["output"] = "" - return kwargs - - -@dataclass(kw_only=True) -class UnreachableNodeFlowValidationDetails: - """ - Details about an unreachable node in the flow. A node is unreachable - when there are no paths to it from any starting node. - """ - - node: str - """The name of the unreachable node.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNREACHABLE_NODE_FLOW_VALIDATION_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_UNREACHABLE_NODE_FLOW_VALIDATION_DETAILS.members["node"], self.node - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["node"] = de.read_string( - _SCHEMA_UNREACHABLE_NODE_FLOW_VALIDATION_DETAILS.members["node"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UNREACHABLE_NODE_FLOW_VALIDATION_DETAILS, consumer=_consumer - ) - if "node" not in kwargs: - kwargs["node"] = "" - return kwargs - - -@dataclass(kw_only=True) -class UnsatisfiedConnectionConditionsFlowValidationDetails: - """ - Details about unsatisfied conditions for a connection. A condition is - unsatisfied if it can never be true, for example two branches of - condition node cannot be simultaneously true. - """ - - connection: str - """The name of the connection with unsatisfied conditions.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_UNSATISFIED_CONNECTION_CONDITIONS_FLOW_VALIDATION_DETAILS, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_UNSATISFIED_CONNECTION_CONDITIONS_FLOW_VALIDATION_DETAILS.members[ - "connection" - ], - self.connection, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["connection"] = de.read_string( - _SCHEMA_UNSATISFIED_CONNECTION_CONDITIONS_FLOW_VALIDATION_DETAILS.members[ - "connection" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UNSATISFIED_CONNECTION_CONDITIONS_FLOW_VALIDATION_DETAILS, - consumer=_consumer, - ) - if "connection" not in kwargs: - kwargs["connection"] = "" - return kwargs - - -@dataclass(kw_only=True) -class UnspecifiedFlowValidationDetails: - """ - Details about an unspecified validation that doesn't fit other - categories. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNSPECIFIED_FLOW_VALIDATION_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UNSPECIFIED_FLOW_VALIDATION_DETAILS, consumer=_consumer - ) - return kwargs - - -@dataclass -class FlowValidationDetailsCyclicConnection: - """Details about a cyclic connection in the flow.""" - - value: CyclicConnectionFlowValidationDetails - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_VALIDATION_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_VALIDATION_DETAILS.members["cyclicConnection"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=CyclicConnectionFlowValidationDetails.deserialize(deserializer) - ) - - -@dataclass -class FlowValidationDetailsDuplicateConnections: - """Details about duplicate connections between nodes.""" - - value: DuplicateConnectionsFlowValidationDetails - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_VALIDATION_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_VALIDATION_DETAILS.members["duplicateConnections"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=DuplicateConnectionsFlowValidationDetails.deserialize(deserializer) - ) - - -@dataclass -class FlowValidationDetailsDuplicateConditionExpression: - """Details about duplicate condition expressions in a node.""" - - value: DuplicateConditionExpressionFlowValidationDetails - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_VALIDATION_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_VALIDATION_DETAILS.members["duplicateConditionExpression"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=DuplicateConditionExpressionFlowValidationDetails.deserialize( - deserializer - ) - ) - - -@dataclass -class FlowValidationDetailsUnreachableNode: - """Details about an unreachable node in the flow.""" - - value: UnreachableNodeFlowValidationDetails - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_VALIDATION_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_VALIDATION_DETAILS.members["unreachableNode"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=UnreachableNodeFlowValidationDetails.deserialize(deserializer)) - - -@dataclass -class FlowValidationDetailsUnknownConnectionSource: - """Details about an unknown source node for a connection.""" - - value: UnknownConnectionSourceFlowValidationDetails - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_VALIDATION_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_VALIDATION_DETAILS.members["unknownConnectionSource"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=UnknownConnectionSourceFlowValidationDetails.deserialize(deserializer) - ) - - -@dataclass -class FlowValidationDetailsUnknownConnectionSourceOutput: - """Details about an unknown source output for a connection.""" - - value: UnknownConnectionSourceOutputFlowValidationDetails - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_VALIDATION_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_VALIDATION_DETAILS.members["unknownConnectionSourceOutput"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=UnknownConnectionSourceOutputFlowValidationDetails.deserialize( - deserializer - ) - ) - - -@dataclass -class FlowValidationDetailsUnknownConnectionTarget: - """Details about an unknown target node for a connection.""" - - value: UnknownConnectionTargetFlowValidationDetails - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_VALIDATION_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_VALIDATION_DETAILS.members["unknownConnectionTarget"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=UnknownConnectionTargetFlowValidationDetails.deserialize(deserializer) - ) - - -@dataclass -class FlowValidationDetailsUnknownConnectionTargetInput: - """Details about an unknown target input for a connection.""" - - value: UnknownConnectionTargetInputFlowValidationDetails - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_VALIDATION_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_VALIDATION_DETAILS.members["unknownConnectionTargetInput"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=UnknownConnectionTargetInputFlowValidationDetails.deserialize( - deserializer - ) - ) - - -@dataclass -class FlowValidationDetailsUnknownConnectionCondition: - """Details about an unknown condition for a connection.""" - - value: UnknownConnectionConditionFlowValidationDetails - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_VALIDATION_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_VALIDATION_DETAILS.members["unknownConnectionCondition"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=UnknownConnectionConditionFlowValidationDetails.deserialize( - deserializer - ) - ) - - -@dataclass -class FlowValidationDetailsMalformedConditionExpression: - """Details about a malformed condition expression in a node.""" - - value: MalformedConditionExpressionFlowValidationDetails - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_VALIDATION_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_VALIDATION_DETAILS.members["malformedConditionExpression"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=MalformedConditionExpressionFlowValidationDetails.deserialize( - deserializer - ) - ) - - -@dataclass -class FlowValidationDetailsMalformedNodeInputExpression: - """Details about a malformed input expression in a node.""" - - value: MalformedNodeInputExpressionFlowValidationDetails - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_VALIDATION_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_VALIDATION_DETAILS.members["malformedNodeInputExpression"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=MalformedNodeInputExpressionFlowValidationDetails.deserialize( - deserializer - ) - ) - - -@dataclass -class FlowValidationDetailsMismatchedNodeInputType: - """Details about mismatched input data types in a node.""" - - value: MismatchedNodeInputTypeFlowValidationDetails - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_VALIDATION_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_VALIDATION_DETAILS.members["mismatchedNodeInputType"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=MismatchedNodeInputTypeFlowValidationDetails.deserialize(deserializer) - ) - - -@dataclass -class FlowValidationDetailsMismatchedNodeOutputType: - """Details about mismatched output data types in a node.""" - - value: MismatchedNodeOutputTypeFlowValidationDetails - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_VALIDATION_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_VALIDATION_DETAILS.members["mismatchedNodeOutputType"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=MismatchedNodeOutputTypeFlowValidationDetails.deserialize( - deserializer - ) - ) - - -@dataclass -class FlowValidationDetailsIncompatibleConnectionDataType: - """Details about incompatible data types in a connection.""" - - value: IncompatibleConnectionDataTypeFlowValidationDetails - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_VALIDATION_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_VALIDATION_DETAILS.members["incompatibleConnectionDataType"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=IncompatibleConnectionDataTypeFlowValidationDetails.deserialize( - deserializer - ) - ) - - -@dataclass -class FlowValidationDetailsMissingConnectionConfiguration: - """Details about missing configuration for a connection.""" - - value: MissingConnectionConfigurationFlowValidationDetails - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_VALIDATION_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_VALIDATION_DETAILS.members["missingConnectionConfiguration"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=MissingConnectionConfigurationFlowValidationDetails.deserialize( - deserializer - ) - ) - - -@dataclass -class FlowValidationDetailsMissingDefaultCondition: - """Details about a missing default condition in a conditional node.""" - - value: MissingDefaultConditionFlowValidationDetails - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_VALIDATION_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_VALIDATION_DETAILS.members["missingDefaultCondition"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=MissingDefaultConditionFlowValidationDetails.deserialize(deserializer) - ) - - -@dataclass -class FlowValidationDetailsMissingEndingNodes: - """Details about missing ending nodes in the flow.""" - - value: MissingEndingNodesFlowValidationDetails - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_VALIDATION_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_VALIDATION_DETAILS.members["missingEndingNodes"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=MissingEndingNodesFlowValidationDetails.deserialize(deserializer) - ) - - -@dataclass -class FlowValidationDetailsMissingNodeConfiguration: - """Details about missing configuration for a node.""" - - value: MissingNodeConfigurationFlowValidationDetails - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_VALIDATION_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_VALIDATION_DETAILS.members["missingNodeConfiguration"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=MissingNodeConfigurationFlowValidationDetails.deserialize( - deserializer - ) - ) - - -@dataclass -class FlowValidationDetailsMissingNodeInput: - """Details about a missing required input in a node.""" - - value: MissingNodeInputFlowValidationDetails - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_VALIDATION_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_VALIDATION_DETAILS.members["missingNodeInput"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=MissingNodeInputFlowValidationDetails.deserialize(deserializer) - ) - - -@dataclass -class FlowValidationDetailsMissingNodeOutput: - """Details about a missing required output in a node.""" - - value: MissingNodeOutputFlowValidationDetails - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_VALIDATION_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_VALIDATION_DETAILS.members["missingNodeOutput"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=MissingNodeOutputFlowValidationDetails.deserialize(deserializer) - ) - - -@dataclass -class FlowValidationDetailsMissingStartingNodes: - """Details about missing starting nodes in the flow.""" - - value: MissingStartingNodesFlowValidationDetails - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_VALIDATION_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_VALIDATION_DETAILS.members["missingStartingNodes"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=MissingStartingNodesFlowValidationDetails.deserialize(deserializer) - ) - - -@dataclass -class FlowValidationDetailsMultipleNodeInputConnections: - """Details about multiple connections to a single node input.""" - - value: MultipleNodeInputConnectionsFlowValidationDetails - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_VALIDATION_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_VALIDATION_DETAILS.members["multipleNodeInputConnections"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=MultipleNodeInputConnectionsFlowValidationDetails.deserialize( - deserializer - ) - ) - - -@dataclass -class FlowValidationDetailsUnfulfilledNodeInput: - """Details about an unfulfilled node input with no valid connections.""" - - value: UnfulfilledNodeInputFlowValidationDetails - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_VALIDATION_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_VALIDATION_DETAILS.members["unfulfilledNodeInput"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=UnfulfilledNodeInputFlowValidationDetails.deserialize(deserializer) - ) - - -@dataclass -class FlowValidationDetailsUnsatisfiedConnectionConditions: - """Details about unsatisfied conditions for a connection.""" - - value: UnsatisfiedConnectionConditionsFlowValidationDetails - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_VALIDATION_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_VALIDATION_DETAILS.members["unsatisfiedConnectionConditions"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=UnsatisfiedConnectionConditionsFlowValidationDetails.deserialize( - deserializer - ) - ) - - -@dataclass -class FlowValidationDetailsUnspecified: - """Details about an unspecified validation.""" - - value: UnspecifiedFlowValidationDetails - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_VALIDATION_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_VALIDATION_DETAILS.members["unspecified"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=UnspecifiedFlowValidationDetails.deserialize(deserializer)) - - -@dataclass -class FlowValidationDetailsUnknownNodeInput: - """Details about an unknown input for a node.""" - - value: UnknownNodeInputFlowValidationDetails - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_VALIDATION_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_VALIDATION_DETAILS.members["unknownNodeInput"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=UnknownNodeInputFlowValidationDetails.deserialize(deserializer) - ) - - -@dataclass -class FlowValidationDetailsUnknownNodeOutput: - """Details about an unknown output for a node.""" - - value: UnknownNodeOutputFlowValidationDetails - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_VALIDATION_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_VALIDATION_DETAILS.members["unknownNodeOutput"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=UnknownNodeOutputFlowValidationDetails.deserialize(deserializer) - ) - - -@dataclass -class FlowValidationDetailsMissingLoopInputNode: - """ - Details about a flow that's missing a required `LoopInput` node in a - DoWhile loop. - """ - - value: MissingLoopInputNodeFlowValidationDetails - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_VALIDATION_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_VALIDATION_DETAILS.members["missingLoopInputNode"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=MissingLoopInputNodeFlowValidationDetails.deserialize(deserializer) - ) - - -@dataclass -class FlowValidationDetailsMissingLoopControllerNode: - """ - Details about a flow that's missing a required `LoopController` node in - a DoWhile loop. - """ - - value: MissingLoopControllerNodeFlowValidationDetails - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_VALIDATION_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_VALIDATION_DETAILS.members["missingLoopControllerNode"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=MissingLoopControllerNodeFlowValidationDetails.deserialize( - deserializer - ) - ) - - -@dataclass -class FlowValidationDetailsMultipleLoopInputNodes: - """ - Details about a flow that contains multiple `LoopInput` nodes in a - DoWhile loop. - """ - - value: MultipleLoopInputNodesFlowValidationDetails - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_VALIDATION_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_VALIDATION_DETAILS.members["multipleLoopInputNodes"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=MultipleLoopInputNodesFlowValidationDetails.deserialize(deserializer) - ) - - -@dataclass -class FlowValidationDetailsMultipleLoopControllerNodes: - """ - Details about a flow that contains multiple `LoopController` nodes in a - DoWhile loop. - """ - - value: MultipleLoopControllerNodesFlowValidationDetails - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_VALIDATION_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_VALIDATION_DETAILS.members["multipleLoopControllerNodes"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=MultipleLoopControllerNodesFlowValidationDetails.deserialize( - deserializer - ) - ) - - -@dataclass -class FlowValidationDetailsLoopIncompatibleNodeType: - """ - Details about a flow that includes incompatible node types in a DoWhile - loop. - """ - - value: LoopIncompatibleNodeTypeFlowValidationDetails - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_VALIDATION_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_VALIDATION_DETAILS.members["loopIncompatibleNodeType"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=LoopIncompatibleNodeTypeFlowValidationDetails.deserialize( - deserializer - ) - ) - - -@dataclass -class FlowValidationDetailsInvalidLoopBoundary: - """ - Details about a flow that includes connections that violate loop - boundary rules. - """ - - value: InvalidLoopBoundaryFlowValidationDetails - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_VALIDATION_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_VALIDATION_DETAILS.members["invalidLoopBoundary"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=InvalidLoopBoundaryFlowValidationDetails.deserialize(deserializer) - ) - - -@dataclass -class FlowValidationDetailsUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -FlowValidationDetails = Union[ - FlowValidationDetailsCyclicConnection - | FlowValidationDetailsDuplicateConnections - | FlowValidationDetailsDuplicateConditionExpression - | FlowValidationDetailsUnreachableNode - | FlowValidationDetailsUnknownConnectionSource - | FlowValidationDetailsUnknownConnectionSourceOutput - | FlowValidationDetailsUnknownConnectionTarget - | FlowValidationDetailsUnknownConnectionTargetInput - | FlowValidationDetailsUnknownConnectionCondition - | FlowValidationDetailsMalformedConditionExpression - | FlowValidationDetailsMalformedNodeInputExpression - | FlowValidationDetailsMismatchedNodeInputType - | FlowValidationDetailsMismatchedNodeOutputType - | FlowValidationDetailsIncompatibleConnectionDataType - | FlowValidationDetailsMissingConnectionConfiguration - | FlowValidationDetailsMissingDefaultCondition - | FlowValidationDetailsMissingEndingNodes - | FlowValidationDetailsMissingNodeConfiguration - | FlowValidationDetailsMissingNodeInput - | FlowValidationDetailsMissingNodeOutput - | FlowValidationDetailsMissingStartingNodes - | FlowValidationDetailsMultipleNodeInputConnections - | FlowValidationDetailsUnfulfilledNodeInput - | FlowValidationDetailsUnsatisfiedConnectionConditions - | FlowValidationDetailsUnspecified - | FlowValidationDetailsUnknownNodeInput - | FlowValidationDetailsUnknownNodeOutput - | FlowValidationDetailsMissingLoopInputNode - | FlowValidationDetailsMissingLoopControllerNode - | FlowValidationDetailsMultipleLoopInputNodes - | FlowValidationDetailsMultipleLoopControllerNodes - | FlowValidationDetailsLoopIncompatibleNodeType - | FlowValidationDetailsInvalidLoopBoundary - | FlowValidationDetailsUnknown -] -"""A union type containing various possible validation issues in the flow.""" - - -class _FlowValidationDetailsDeserializer: - _result: FlowValidationDetails | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> FlowValidationDetails: - self._result = None - deserializer.read_struct(_SCHEMA_FLOW_VALIDATION_DETAILS, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(FlowValidationDetailsCyclicConnection.deserialize(de)) - - case 1: - self._set_result( - FlowValidationDetailsDuplicateConnections.deserialize(de) - ) - - case 2: - self._set_result( - FlowValidationDetailsDuplicateConditionExpression.deserialize(de) - ) - - case 3: - self._set_result(FlowValidationDetailsUnreachableNode.deserialize(de)) - - case 4: - self._set_result( - FlowValidationDetailsUnknownConnectionSource.deserialize(de) - ) - - case 5: - self._set_result( - FlowValidationDetailsUnknownConnectionSourceOutput.deserialize(de) - ) - - case 6: - self._set_result( - FlowValidationDetailsUnknownConnectionTarget.deserialize(de) - ) - - case 7: - self._set_result( - FlowValidationDetailsUnknownConnectionTargetInput.deserialize(de) - ) - - case 8: - self._set_result( - FlowValidationDetailsUnknownConnectionCondition.deserialize(de) - ) - - case 9: - self._set_result( - FlowValidationDetailsMalformedConditionExpression.deserialize(de) - ) - - case 10: - self._set_result( - FlowValidationDetailsMalformedNodeInputExpression.deserialize(de) - ) - - case 11: - self._set_result( - FlowValidationDetailsMismatchedNodeInputType.deserialize(de) - ) - - case 12: - self._set_result( - FlowValidationDetailsMismatchedNodeOutputType.deserialize(de) - ) - - case 13: - self._set_result( - FlowValidationDetailsIncompatibleConnectionDataType.deserialize(de) - ) - - case 14: - self._set_result( - FlowValidationDetailsMissingConnectionConfiguration.deserialize(de) - ) - - case 15: - self._set_result( - FlowValidationDetailsMissingDefaultCondition.deserialize(de) - ) - - case 16: - self._set_result( - FlowValidationDetailsMissingEndingNodes.deserialize(de) - ) - - case 17: - self._set_result( - FlowValidationDetailsMissingNodeConfiguration.deserialize(de) - ) - - case 18: - self._set_result(FlowValidationDetailsMissingNodeInput.deserialize(de)) - - case 19: - self._set_result(FlowValidationDetailsMissingNodeOutput.deserialize(de)) - - case 20: - self._set_result( - FlowValidationDetailsMissingStartingNodes.deserialize(de) - ) - - case 21: - self._set_result( - FlowValidationDetailsMultipleNodeInputConnections.deserialize(de) - ) - - case 22: - self._set_result( - FlowValidationDetailsUnfulfilledNodeInput.deserialize(de) - ) - - case 23: - self._set_result( - FlowValidationDetailsUnsatisfiedConnectionConditions.deserialize(de) - ) - - case 24: - self._set_result(FlowValidationDetailsUnspecified.deserialize(de)) - - case 25: - self._set_result(FlowValidationDetailsUnknownNodeInput.deserialize(de)) - - case 26: - self._set_result(FlowValidationDetailsUnknownNodeOutput.deserialize(de)) - - case 27: - self._set_result( - FlowValidationDetailsMissingLoopInputNode.deserialize(de) - ) - - case 28: - self._set_result( - FlowValidationDetailsMissingLoopControllerNode.deserialize(de) - ) - - case 29: - self._set_result( - FlowValidationDetailsMultipleLoopInputNodes.deserialize(de) - ) - - case 30: - self._set_result( - FlowValidationDetailsMultipleLoopControllerNodes.deserialize(de) - ) - - case 31: - self._set_result( - FlowValidationDetailsLoopIncompatibleNodeType.deserialize(de) - ) - - case 32: - self._set_result( - FlowValidationDetailsInvalidLoopBoundary.deserialize(de) - ) - - case _: - self._set_result( - FlowValidationDetailsUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: FlowValidationDetails) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class FlowValidationSeverity(UnknownEnumMixin, StrEnum): - WARNING = "Warning" - ERROR = "Error" - - -class FlowValidationType(UnknownEnumMixin, StrEnum): - CYCLIC_CONNECTION = "CyclicConnection" - DUPLICATE_CONNECTIONS = "DuplicateConnections" - DUPLICATE_CONDITION_EXPRESSION = "DuplicateConditionExpression" - UNREACHABLE_NODE = "UnreachableNode" - UNKNOWN_CONNECTION_SOURCE = "UnknownConnectionSource" - UNKNOWN_CONNECTION_SOURCE_OUTPUT = "UnknownConnectionSourceOutput" - UNKNOWN_CONNECTION_TARGET = "UnknownConnectionTarget" - UNKNOWN_CONNECTION_TARGET_INPUT = "UnknownConnectionTargetInput" - UNKNOWN_CONNECTION_CONDITION = "UnknownConnectionCondition" - MALFORMED_CONDITION_EXPRESSION = "MalformedConditionExpression" - MALFORMED_NODE_INPUT_EXPRESSION = "MalformedNodeInputExpression" - MISMATCHED_NODE_INPUT_TYPE = "MismatchedNodeInputType" - MISMATCHED_NODE_OUTPUT_TYPE = "MismatchedNodeOutputType" - INCOMPATIBLE_CONNECTION_DATA_TYPE = "IncompatibleConnectionDataType" - MISSING_CONNECTION_CONFIGURATION = "MissingConnectionConfiguration" - MISSING_DEFAULT_CONDITION = "MissingDefaultCondition" - MISSING_ENDING_NODES = "MissingEndingNodes" - MISSING_NODE_CONFIGURATION = "MissingNodeConfiguration" - MISSING_NODE_INPUT = "MissingNodeInput" - MISSING_NODE_OUTPUT = "MissingNodeOutput" - MISSING_STARTING_NODES = "MissingStartingNodes" - MULTIPLE_NODE_INPUT_CONNECTIONS = "MultipleNodeInputConnections" - UNFULFILLED_NODE_INPUT = "UnfulfilledNodeInput" - UNSATISFIED_CONNECTION_CONDITIONS = "UnsatisfiedConnectionConditions" - UNSPECIFIED = "Unspecified" - UNKNOWN_NODE_INPUT = "UnknownNodeInput" - UNKNOWN_NODE_OUTPUT = "UnknownNodeOutput" - MISSING_LOOP_INPUT_NODE = "MissingLoopInputNode" - MISSING_LOOP_CONTROLLER_NODE = "MissingLoopControllerNode" - MULTIPLE_LOOP_INPUT_NODES = "MultipleLoopInputNodes" - MULTIPLE_LOOP_CONTROLLER_NODES = "MultipleLoopControllerNodes" - LOOP_INCOMPATIBLE_NODE_TYPE = "LoopIncompatibleNodeType" - INVALID_LOOP_BOUNDARY = "InvalidLoopBoundary" - - -@dataclass(kw_only=True) -class FlowValidation: - """ - Contains information about validation of the flow. - - This data type is used in the following API operations: - - - [GetFlow - response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_GetFlow.html#API_agent_GetFlow_ResponseSyntax) - - - [GetFlowVersion - response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_GetFlowVersion.html#API_agent_GetFlowVersion_ResponseSyntax) - """ - - message: str - """A message describing the validation error.""" - - severity: str - """The severity of the issue described in the message.""" - - details: FlowValidationDetails | None = None - """Specific details about the validation issue encountered in the flow.""" - - type: str | None = None - """The type of validation issue encountered in the flow.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_VALIDATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_FLOW_VALIDATION.members["message"], self.message - ) - serializer.write_string( - _SCHEMA_FLOW_VALIDATION.members["severity"], self.severity - ) - if self.details is not None: - serializer.write_struct( - _SCHEMA_FLOW_VALIDATION.members["details"], self.details - ) - - if self.type is not None: - serializer.write_string(_SCHEMA_FLOW_VALIDATION.members["type"], self.type) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_FLOW_VALIDATION.members["message"] - ) - - case 1: - kwargs["severity"] = FlowValidationSeverity( - de.read_string(_SCHEMA_FLOW_VALIDATION.members["severity"]) - ) - - case 2: - kwargs["details"] = ( - _FlowValidationDetailsDeserializer().deserialize(de) - ) - - case 3: - kwargs["type"] = FlowValidationType( - de.read_string(_SCHEMA_FLOW_VALIDATION.members["type"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FLOW_VALIDATION, consumer=_consumer) - if "message" not in kwargs: - kwargs["message"] = "" - if "severity" not in kwargs: - kwargs["severity"] = FlowValidationSeverity._corrected("") - return kwargs - - -def _serialize_flow_validations( - serializer: ShapeSerializer, schema: Schema, value: list[FlowValidation] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_flow_validations( - deserializer: ShapeDeserializer, schema: Schema -) -> list[FlowValidation]: - result: list[FlowValidation] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(FlowValidation.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListFlowsInput: - """Dataclass for ListFlowsInput structure.""" - - max_results: int | None = None - """ - The maximum number of results to return in the response. If the total - number of results is greater than this value, use the token returned in - the response in the `nextToken` field when making another request to - return the next batch of results. - """ - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, enter the token returned in the `nextToken` - field in the response in this field to return the next batch of results. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_FLOWS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_FLOWS_INPUT.members["maxResults"], self.max_results - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_FLOWS_INPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_FLOWS_INPUT.members["maxResults"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_FLOWS_INPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_FLOWS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class FlowSummary: - """Contains the definition of a flow.""" - - name: str - """The name of the flow.""" - - id: str - """The unique identifier of the flow.""" - - arn: str - """The Amazon Resource Name (ARN) of the flow.""" - - status: str - """ - The status of the flow. The following statuses are possible: - - - NotPrepared -- The flow has been created or updated, but hasn't been - prepared. If you just created the flow, you can't test it. If you - updated the flow, the `DRAFT` version won't contain the latest - changes for testing. Send a - [PrepareFlow](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PrepareFlow.html) - request to package the latest changes into the `DRAFT` version. - - - Preparing -- The flow is being prepared so that the `DRAFT` version - contains the latest changes for testing. - - - Prepared -- The flow is prepared and the `DRAFT` version contains the - latest changes for testing. - - - Failed -- The last API operation that you invoked on the flow failed. - Send a - [GetFlow](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_GetFlow.html) - request and check the error message in the `validations` field. - """ - - created_at: datetime - """The time at which the flow was created.""" - - updated_at: datetime - """The time at which the flow was last updated.""" - - version: str - """The latest version of the flow.""" - - description: str | None = None - """A description of the flow.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_FLOW_SUMMARY.members["name"], self.name) - if self.description is not None: - serializer.write_string( - _SCHEMA_FLOW_SUMMARY.members["description"], self.description - ) - - serializer.write_string(_SCHEMA_FLOW_SUMMARY.members["id"], self.id) - serializer.write_string(_SCHEMA_FLOW_SUMMARY.members["arn"], self.arn) - serializer.write_string(_SCHEMA_FLOW_SUMMARY.members["status"], self.status) - serializer.write_timestamp( - _SCHEMA_FLOW_SUMMARY.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_FLOW_SUMMARY.members["updatedAt"], self.updated_at - ) - serializer.write_string(_SCHEMA_FLOW_SUMMARY.members["version"], self.version) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_FLOW_SUMMARY.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_FLOW_SUMMARY.members["description"] - ) - - case 2: - kwargs["id"] = de.read_string(_SCHEMA_FLOW_SUMMARY.members["id"]) - - case 3: - kwargs["arn"] = de.read_string(_SCHEMA_FLOW_SUMMARY.members["arn"]) - - case 4: - kwargs["status"] = FlowStatus( - de.read_string(_SCHEMA_FLOW_SUMMARY.members["status"]) - ) - - case 5: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_FLOW_SUMMARY.members["createdAt"] - ) - - case 6: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_FLOW_SUMMARY.members["updatedAt"] - ) - - case 7: - kwargs["version"] = de.read_string( - _SCHEMA_FLOW_SUMMARY.members["version"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FLOW_SUMMARY, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "id" not in kwargs: - kwargs["id"] = "" - if "arn" not in kwargs: - kwargs["arn"] = "" - if "status" not in kwargs: - kwargs["status"] = FlowStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "version" not in kwargs: - kwargs["version"] = "" - return kwargs - - -def _serialize_flow_summaries( - serializer: ShapeSerializer, schema: Schema, value: list[FlowSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_flow_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[FlowSummary]: - result: list[FlowSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(FlowSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListFlowsOutput: - """Dataclass for ListFlowsOutput structure.""" - - flow_summaries: list[FlowSummary] - """A list, each member of which contains information about a flow.""" - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, use this token when making another request in - the `nextToken` field to return the next batch of results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_FLOWS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_flow_summaries( - serializer, - _SCHEMA_LIST_FLOWS_OUTPUT.members["flowSummaries"], - self.flow_summaries, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_FLOWS_OUTPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["flow_summaries"] = _deserialize_flow_summaries( - de, _SCHEMA_LIST_FLOWS_OUTPUT.members["flowSummaries"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_FLOWS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_FLOWS_OUTPUT, consumer=_consumer) - if "flow_summaries" not in kwargs: - kwargs["flow_summaries"] = [] - return kwargs - - -LIST_FLOWS = APIOperation( - input=ListFlowsInput, - output=ListFlowsOutput, - schema=_SCHEMA_LIST_FLOWS, - input_schema=_SCHEMA_LIST_FLOWS_INPUT, - output_schema=_SCHEMA_LIST_FLOWS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class PrepareFlowInput: - """Dataclass for PrepareFlowInput structure.""" - - flow_identifier: str | None = None - """The unique identifier of the flow.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PREPARE_FLOW_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.flow_identifier is not None: - serializer.write_string( - _SCHEMA_PREPARE_FLOW_INPUT.members["flowIdentifier"], - self.flow_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["flow_identifier"] = de.read_string( - _SCHEMA_PREPARE_FLOW_INPUT.members["flowIdentifier"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PREPARE_FLOW_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class PrepareFlowOutput: - """Dataclass for PrepareFlowOutput structure.""" - - id: str - """The unique identifier of the flow.""" - - status: str - """ - The status of the flow. When you submit this request, the status will be - `NotPrepared`. If preparation succeeds, the status becomes `Prepared`. - If it fails, the status becomes `FAILED`. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PREPARE_FLOW_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_PREPARE_FLOW_OUTPUT.members["id"], self.id) - serializer.write_string( - _SCHEMA_PREPARE_FLOW_OUTPUT.members["status"], self.status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_PREPARE_FLOW_OUTPUT.members["id"] - ) - - case 1: - kwargs["status"] = FlowStatus( - de.read_string(_SCHEMA_PREPARE_FLOW_OUTPUT.members["status"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PREPARE_FLOW_OUTPUT, consumer=_consumer) - if "id" not in kwargs: - kwargs["id"] = "" - if "status" not in kwargs: - kwargs["status"] = FlowStatus._corrected("") - return kwargs - - -PREPARE_FLOW = APIOperation( - input=PrepareFlowInput, - output=PrepareFlowOutput, - schema=_SCHEMA_PREPARE_FLOW, - input_schema=_SCHEMA_PREPARE_FLOW_INPUT, - output_schema=_SCHEMA_PREPARE_FLOW_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrockagent#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetResourcePolicyInput: - """Dataclass for GetResourcePolicyInput structure.""" - - resource_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the knowledge base to retrieve the - resource policy for. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_RESOURCE_POLICY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_GET_RESOURCE_POLICY_INPUT.members["resourceArn"], - self.resource_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_GET_RESOURCE_POLICY_INPUT.members["resourceArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_RESOURCE_POLICY_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetResourcePolicyOutput: - """Dataclass for GetResourcePolicyOutput structure.""" - - resource_arn: str - """ - The ARN of the knowledge base that the resource policy is associated - with. - """ - - policy: str | JsonString - """The JSON-formatted resource policy associated with the knowledge base.""" - - revision_id: str - """The revision identifier of the resource policy.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_RESOURCE_POLICY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_RESOURCE_POLICY_OUTPUT.members["resourceArn"], self.resource_arn - ) - serializer.write_string( - _SCHEMA_GET_RESOURCE_POLICY_OUTPUT.members["policy"], self.policy - ) - serializer.write_string( - _SCHEMA_GET_RESOURCE_POLICY_OUTPUT.members["revisionId"], self.revision_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_GET_RESOURCE_POLICY_OUTPUT.members["resourceArn"] - ) - - case 1: - kwargs["policy"] = de.read_string( - _SCHEMA_GET_RESOURCE_POLICY_OUTPUT.members["policy"] - ) - - case 2: - kwargs["revision_id"] = de.read_string( - _SCHEMA_GET_RESOURCE_POLICY_OUTPUT.members["revisionId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_RESOURCE_POLICY_OUTPUT, consumer=_consumer) - if "resource_arn" not in kwargs: - kwargs["resource_arn"] = "" - if "policy" not in kwargs: - kwargs["policy"] = "" - if "revision_id" not in kwargs: - kwargs["revision_id"] = "" - return kwargs - - -GET_RESOURCE_POLICY = APIOperation( - input=GetResourcePolicyInput, - output=GetResourcePolicyOutput, - schema=_SCHEMA_GET_RESOURCE_POLICY, - input_schema=_SCHEMA_GET_RESOURCE_POLICY_INPUT, - output_schema=_SCHEMA_GET_RESOURCE_POLICY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetVpcConfigurationInput: - """Dataclass for GetVpcConfigurationInput structure.""" - - knowledge_base_id: str | None = None - """ - The unique identifier of the knowledge base that owns the VPC - configuration. - """ - - vpc_configuration_id: str | None = None - """The unique identifier of the VPC configuration to retrieve.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_VPC_CONFIGURATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.knowledge_base_id is not None: - serializer.write_string( - _SCHEMA_GET_VPC_CONFIGURATION_INPUT.members["knowledgeBaseId"], - self.knowledge_base_id, - ) - - if self.vpc_configuration_id is not None: - serializer.write_string( - _SCHEMA_GET_VPC_CONFIGURATION_INPUT.members["vpcConfigurationId"], - self.vpc_configuration_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["knowledge_base_id"] = de.read_string( - _SCHEMA_GET_VPC_CONFIGURATION_INPUT.members["knowledgeBaseId"] - ) - - case 1: - kwargs["vpc_configuration_id"] = de.read_string( - _SCHEMA_GET_VPC_CONFIGURATION_INPUT.members[ - "vpcConfigurationId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_VPC_CONFIGURATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class VpcConfiguration: - """ - Contains the details of a VPC configuration, including its connection - settings, resolution mode, and current lifecycle status. - """ - - vpc_configuration_id: str - """The unique identifier of the VPC configuration.""" - - status: str - """The current lifecycle status of the VPC configuration.""" - - vpc_id: str - """ - The identifier of the VPC that the knowledge base connects through to - reach the resource. - """ - - subnet_ids: list[str] - """The subnets that the knowledge base uses to connect to the resource.""" - - resource_target: str - """The private IPv4 address or DNS name of the resource.""" - - port: int - """The port on which the resource is reached.""" - - protocol: str - """The protocol used to connect to the resource.""" - - resolution_mode: str - """Specifies how the resource target is resolved.""" - - created_at: datetime - """The time at which the VPC configuration was created.""" - - updated_at: datetime - """The time at which the VPC configuration was last updated.""" - - status_message: str | None = None - """ - Additional detail about the current status, such as the cause of a - `CREATE_FAILED` or `DELETE_FAILED` status. - """ - - host_header: str | None = None - """ - The HTTP `Host` header value sent when invoking the resource, if - configured. - """ - - tls_server_name: str | None = None - """ - The expected TLS server name that the service matches against the - Subject Alternative Names on the resource's TLS certificate. Present - when `protocol` is `HTTPS`. - """ - - name: str | None = None - """The human-readable name of the VPC configuration, if provided.""" - - description: str | None = None - """The description of the VPC configuration, if provided.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VPC_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_VPC_CONFIGURATION.members["vpcConfigurationId"], - self.vpc_configuration_id, - ) - serializer.write_string( - _SCHEMA_VPC_CONFIGURATION.members["status"], self.status - ) - if self.status_message is not None: - serializer.write_string( - _SCHEMA_VPC_CONFIGURATION.members["statusMessage"], self.status_message - ) - - serializer.write_string(_SCHEMA_VPC_CONFIGURATION.members["vpcId"], self.vpc_id) - _serialize_subnet_id_list( - serializer, _SCHEMA_VPC_CONFIGURATION.members["subnetIds"], self.subnet_ids - ) - serializer.write_string( - _SCHEMA_VPC_CONFIGURATION.members["resourceTarget"], self.resource_target - ) - serializer.write_integer(_SCHEMA_VPC_CONFIGURATION.members["port"], self.port) - serializer.write_string( - _SCHEMA_VPC_CONFIGURATION.members["protocol"], self.protocol - ) - serializer.write_string( - _SCHEMA_VPC_CONFIGURATION.members["resolutionMode"], self.resolution_mode - ) - if self.host_header is not None: - serializer.write_string( - _SCHEMA_VPC_CONFIGURATION.members["hostHeader"], self.host_header - ) - - if self.tls_server_name is not None: - serializer.write_string( - _SCHEMA_VPC_CONFIGURATION.members["tlsServerName"], self.tls_server_name - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_VPC_CONFIGURATION.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_VPC_CONFIGURATION.members["description"], self.description - ) - - serializer.write_timestamp( - _SCHEMA_VPC_CONFIGURATION.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_VPC_CONFIGURATION.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["vpc_configuration_id"] = de.read_string( - _SCHEMA_VPC_CONFIGURATION.members["vpcConfigurationId"] - ) - - case 1: - kwargs["status"] = VpcConfigurationStatus( - de.read_string(_SCHEMA_VPC_CONFIGURATION.members["status"]) - ) - - case 2: - kwargs["status_message"] = de.read_string( - _SCHEMA_VPC_CONFIGURATION.members["statusMessage"] - ) - - case 3: - kwargs["vpc_id"] = de.read_string( - _SCHEMA_VPC_CONFIGURATION.members["vpcId"] - ) - - case 4: - kwargs["subnet_ids"] = _deserialize_subnet_id_list( - de, _SCHEMA_VPC_CONFIGURATION.members["subnetIds"] - ) - - case 5: - kwargs["resource_target"] = de.read_string( - _SCHEMA_VPC_CONFIGURATION.members["resourceTarget"] - ) - - case 6: - kwargs["port"] = de.read_integer( - _SCHEMA_VPC_CONFIGURATION.members["port"] - ) - - case 7: - kwargs["protocol"] = VpcProtocol( - de.read_string(_SCHEMA_VPC_CONFIGURATION.members["protocol"]) - ) - - case 8: - kwargs["resolution_mode"] = VpcResolutionMode( - de.read_string( - _SCHEMA_VPC_CONFIGURATION.members["resolutionMode"] - ) - ) - - case 9: - kwargs["host_header"] = de.read_string( - _SCHEMA_VPC_CONFIGURATION.members["hostHeader"] - ) - - case 10: - kwargs["tls_server_name"] = de.read_string( - _SCHEMA_VPC_CONFIGURATION.members["tlsServerName"] - ) - - case 11: - kwargs["name"] = de.read_string( - _SCHEMA_VPC_CONFIGURATION.members["name"] - ) - - case 12: - kwargs["description"] = de.read_string( - _SCHEMA_VPC_CONFIGURATION.members["description"] - ) - - case 13: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_VPC_CONFIGURATION.members["createdAt"] - ) - - case 14: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_VPC_CONFIGURATION.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VPC_CONFIGURATION, consumer=_consumer) - if "vpc_configuration_id" not in kwargs: - kwargs["vpc_configuration_id"] = "" - if "status" not in kwargs: - kwargs["status"] = VpcConfigurationStatus._corrected("") - if "vpc_id" not in kwargs: - kwargs["vpc_id"] = "" - if "subnet_ids" not in kwargs: - kwargs["subnet_ids"] = [] - if "resource_target" not in kwargs: - kwargs["resource_target"] = "" - if "port" not in kwargs: - kwargs["port"] = 0 - if "protocol" not in kwargs: - kwargs["protocol"] = VpcProtocol._corrected("") - if "resolution_mode" not in kwargs: - kwargs["resolution_mode"] = VpcResolutionMode._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls( - vpc_configuration_id="", - status=VpcConfigurationStatus._corrected(""), - vpc_id="", - subnet_ids=[], - resource_target="", - port=0, - protocol=VpcProtocol._corrected(""), - resolution_mode=VpcResolutionMode._corrected(""), - created_at=datetime.fromtimestamp(0, tz=timezone.utc), - updated_at=datetime.fromtimestamp(0, tz=timezone.utc), - ) - - -@dataclass(kw_only=True) -class GetVpcConfigurationOutput: - """Dataclass for GetVpcConfigurationOutput structure.""" - - vpc_configuration: VpcConfiguration - """ - The VPC configuration, including its connection settings, resolution - mode, and current lifecycle status. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_VPC_CONFIGURATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_VPC_CONFIGURATION_OUTPUT.members["vpcConfiguration"], - self.vpc_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["vpc_configuration"] = VpcConfiguration.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_VPC_CONFIGURATION_OUTPUT, consumer=_consumer - ) - if "vpc_configuration" not in kwargs: - kwargs["vpc_configuration"] = VpcConfiguration._smithy_default() - return kwargs - - -GET_VPC_CONFIGURATION = APIOperation( - input=GetVpcConfigurationInput, - output=GetVpcConfigurationOutput, - schema=_SCHEMA_GET_VPC_CONFIGURATION, - input_schema=_SCHEMA_GET_VPC_CONFIGURATION_INPUT, - output_schema=_SCHEMA_GET_VPC_CONFIGURATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetIngestionJobInput: - """Dataclass for GetIngestionJobInput structure.""" - - knowledge_base_id: str | None = None - """ - The unique identifier of the knowledge base for the data ingestion job - you want to get information on. - """ - - data_source_id: str | None = None - """ - The unique identifier of the data source for the data ingestion job you - want to get information on. - """ - - ingestion_job_id: str | None = None - """ - The unique identifier of the data ingestion job you want to get - information on. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_INGESTION_JOB_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.knowledge_base_id is not None: - serializer.write_string( - _SCHEMA_GET_INGESTION_JOB_INPUT.members["knowledgeBaseId"], - self.knowledge_base_id, - ) - - if self.data_source_id is not None: - serializer.write_string( - _SCHEMA_GET_INGESTION_JOB_INPUT.members["dataSourceId"], - self.data_source_id, - ) - - if self.ingestion_job_id is not None: - serializer.write_string( - _SCHEMA_GET_INGESTION_JOB_INPUT.members["ingestionJobId"], - self.ingestion_job_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["knowledge_base_id"] = de.read_string( - _SCHEMA_GET_INGESTION_JOB_INPUT.members["knowledgeBaseId"] - ) - - case 1: - kwargs["data_source_id"] = de.read_string( - _SCHEMA_GET_INGESTION_JOB_INPUT.members["dataSourceId"] - ) - - case 2: - kwargs["ingestion_job_id"] = de.read_string( - _SCHEMA_GET_INGESTION_JOB_INPUT.members["ingestionJobId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_INGESTION_JOB_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class IngestionJobStatistics: - """Contains the statistics for the data ingestion job.""" - - number_of_documents_scanned: int = 0 - """ - The total number of source documents that were scanned. Includes new, - updated, and unchanged documents. - """ - - number_of_metadata_documents_scanned: int = 0 - """ - The total number of metadata files that were scanned. Includes new, - updated, and unchanged files. - """ - - number_of_new_documents_indexed: int = 0 - """ - The number of new source documents in the data source that were - successfully indexed. - """ - - number_of_modified_documents_indexed: int = 0 - """ - The number of modified source documents in the data source that were - successfully indexed. - """ - - number_of_metadata_documents_modified: int = 0 - """The number of metadata files that were updated or deleted.""" - - number_of_documents_deleted: int = 0 - """The number of source documents that were deleted.""" - - number_of_documents_failed: int = 0 - """The number of source documents that failed to be ingested.""" - - number_of_documents_skipped: int = 0 - """The number of source documents that were skipped during ingestion.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INGESTION_JOB_STATISTICS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_long( - _SCHEMA_INGESTION_JOB_STATISTICS.members["numberOfDocumentsScanned"], - self.number_of_documents_scanned, - ) - serializer.write_long( - _SCHEMA_INGESTION_JOB_STATISTICS.members[ - "numberOfMetadataDocumentsScanned" - ], - self.number_of_metadata_documents_scanned, - ) - serializer.write_long( - _SCHEMA_INGESTION_JOB_STATISTICS.members["numberOfNewDocumentsIndexed"], - self.number_of_new_documents_indexed, - ) - serializer.write_long( - _SCHEMA_INGESTION_JOB_STATISTICS.members[ - "numberOfModifiedDocumentsIndexed" - ], - self.number_of_modified_documents_indexed, - ) - serializer.write_long( - _SCHEMA_INGESTION_JOB_STATISTICS.members[ - "numberOfMetadataDocumentsModified" - ], - self.number_of_metadata_documents_modified, - ) - serializer.write_long( - _SCHEMA_INGESTION_JOB_STATISTICS.members["numberOfDocumentsDeleted"], - self.number_of_documents_deleted, - ) - serializer.write_long( - _SCHEMA_INGESTION_JOB_STATISTICS.members["numberOfDocumentsFailed"], - self.number_of_documents_failed, - ) - serializer.write_long( - _SCHEMA_INGESTION_JOB_STATISTICS.members["numberOfDocumentsSkipped"], - self.number_of_documents_skipped, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["number_of_documents_scanned"] = de.read_long( - _SCHEMA_INGESTION_JOB_STATISTICS.members[ - "numberOfDocumentsScanned" - ] - ) - - case 1: - kwargs["number_of_metadata_documents_scanned"] = de.read_long( - _SCHEMA_INGESTION_JOB_STATISTICS.members[ - "numberOfMetadataDocumentsScanned" - ] - ) - - case 2: - kwargs["number_of_new_documents_indexed"] = de.read_long( - _SCHEMA_INGESTION_JOB_STATISTICS.members[ - "numberOfNewDocumentsIndexed" - ] - ) - - case 3: - kwargs["number_of_modified_documents_indexed"] = de.read_long( - _SCHEMA_INGESTION_JOB_STATISTICS.members[ - "numberOfModifiedDocumentsIndexed" - ] - ) - - case 4: - kwargs["number_of_metadata_documents_modified"] = de.read_long( - _SCHEMA_INGESTION_JOB_STATISTICS.members[ - "numberOfMetadataDocumentsModified" - ] - ) - - case 5: - kwargs["number_of_documents_deleted"] = de.read_long( - _SCHEMA_INGESTION_JOB_STATISTICS.members[ - "numberOfDocumentsDeleted" - ] - ) - - case 6: - kwargs["number_of_documents_failed"] = de.read_long( - _SCHEMA_INGESTION_JOB_STATISTICS.members[ - "numberOfDocumentsFailed" - ] - ) - - case 7: - kwargs["number_of_documents_skipped"] = de.read_long( - _SCHEMA_INGESTION_JOB_STATISTICS.members[ - "numberOfDocumentsSkipped" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INGESTION_JOB_STATISTICS, consumer=_consumer) - return kwargs - - -class IngestionJobStatus(UnknownEnumMixin, StrEnum): - STARTING = "STARTING" - IN_PROGRESS = "IN_PROGRESS" - COMPLETE = "COMPLETE" - FAILED = "FAILED" - STOPPING = "STOPPING" - STOPPED = "STOPPED" - - -@dataclass(kw_only=True) -class IngestionJob: - """ - Contains details about a data ingestion job. Data sources are ingested - into a knowledge base so that Large Language Models (LLMs) can use your - data. - - This data type is used in the following API operations: - - - [StartIngestionJob - response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_StartIngestionJob.html#API_agent_StartIngestionJob_ResponseSyntax) - - - [GetIngestionJob - response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_GetIngestionJob.html#API_agent_GetIngestionJob_ResponseSyntax) - - - [ListIngestionJob - response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_ListIngestionJobs.html#API_agent_ListIngestionJobs_ResponseSyntax) - """ - - knowledge_base_id: str - """The unique identifier of the knowledge for the data ingestion job.""" - - data_source_id: str - """The unique identifier of the data source for the data ingestion job.""" - - ingestion_job_id: str - """The unique identifier of the data ingestion job.""" - - status: str - """The status of the data ingestion job.""" - - started_at: datetime - """ - The time the data ingestion job started. - - If you stop a data ingestion job, the `startedAt` time is the time the - job was started before the job was stopped. - """ - - updated_at: datetime - """ - The time the data ingestion job was last updated. - - If you stop a data ingestion job, the `updatedAt` time is the time the - job was stopped. - """ - - description: str | None = None - """The description of the data ingestion job.""" - - statistics: IngestionJobStatistics | None = None - """Contains statistics about the data ingestion job.""" - - failure_reasons: list[str] | None = None - """A list of reasons that the data ingestion job failed.""" - - text_ready_at: datetime | None = None - """ - The time at which all text content in the data ingestion job finished - extraction and became available to query. - - This time isn't returned until text extraction is complete for all the - documents in the job. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INGESTION_JOB, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_INGESTION_JOB.members["knowledgeBaseId"], self.knowledge_base_id - ) - serializer.write_string( - _SCHEMA_INGESTION_JOB.members["dataSourceId"], self.data_source_id - ) - serializer.write_string( - _SCHEMA_INGESTION_JOB.members["ingestionJobId"], self.ingestion_job_id - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_INGESTION_JOB.members["description"], self.description - ) - - serializer.write_string(_SCHEMA_INGESTION_JOB.members["status"], self.status) - if self.statistics is not None: - serializer.write_struct( - _SCHEMA_INGESTION_JOB.members["statistics"], self.statistics - ) - - if self.failure_reasons is not None: - _serialize_failure_reasons( - serializer, - _SCHEMA_INGESTION_JOB.members["failureReasons"], - self.failure_reasons, - ) - - serializer.write_timestamp( - _SCHEMA_INGESTION_JOB.members["startedAt"], self.started_at - ) - serializer.write_timestamp( - _SCHEMA_INGESTION_JOB.members["updatedAt"], self.updated_at - ) - if self.text_ready_at is not None: - serializer.write_timestamp( - _SCHEMA_INGESTION_JOB.members["textReadyAt"], self.text_ready_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["knowledge_base_id"] = de.read_string( - _SCHEMA_INGESTION_JOB.members["knowledgeBaseId"] - ) - - case 1: - kwargs["data_source_id"] = de.read_string( - _SCHEMA_INGESTION_JOB.members["dataSourceId"] - ) - - case 2: - kwargs["ingestion_job_id"] = de.read_string( - _SCHEMA_INGESTION_JOB.members["ingestionJobId"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_INGESTION_JOB.members["description"] - ) - - case 4: - kwargs["status"] = IngestionJobStatus( - de.read_string(_SCHEMA_INGESTION_JOB.members["status"]) - ) - - case 5: - kwargs["statistics"] = IngestionJobStatistics.deserialize(de) - - case 6: - kwargs["failure_reasons"] = _deserialize_failure_reasons( - de, _SCHEMA_INGESTION_JOB.members["failureReasons"] - ) - - case 7: - kwargs["started_at"] = de.read_timestamp( - _SCHEMA_INGESTION_JOB.members["startedAt"] - ) - - case 8: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_INGESTION_JOB.members["updatedAt"] - ) - - case 9: - kwargs["text_ready_at"] = de.read_timestamp( - _SCHEMA_INGESTION_JOB.members["textReadyAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INGESTION_JOB, consumer=_consumer) - if "knowledge_base_id" not in kwargs: - kwargs["knowledge_base_id"] = "" - if "data_source_id" not in kwargs: - kwargs["data_source_id"] = "" - if "ingestion_job_id" not in kwargs: - kwargs["ingestion_job_id"] = "" - if "status" not in kwargs: - kwargs["status"] = IngestionJobStatus._corrected("") - if "started_at" not in kwargs: - kwargs["started_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls( - knowledge_base_id="", - data_source_id="", - ingestion_job_id="", - status=IngestionJobStatus._corrected(""), - started_at=datetime.fromtimestamp(0, tz=timezone.utc), - updated_at=datetime.fromtimestamp(0, tz=timezone.utc), - ) - - -@dataclass(kw_only=True) -class GetIngestionJobOutput: - """Dataclass for GetIngestionJobOutput structure.""" - - ingestion_job: IngestionJob - """Contains details about the data ingestion job.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_INGESTION_JOB_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_INGESTION_JOB_OUTPUT.members["ingestionJob"], self.ingestion_job - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["ingestion_job"] = IngestionJob.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_INGESTION_JOB_OUTPUT, consumer=_consumer) - if "ingestion_job" not in kwargs: - kwargs["ingestion_job"] = IngestionJob._smithy_default() - return kwargs - - -GET_INGESTION_JOB = APIOperation( - input=GetIngestionJobInput, - output=GetIngestionJobOutput, - schema=_SCHEMA_GET_INGESTION_JOB, - input_schema=_SCHEMA_GET_INGESTION_JOB_INPUT, - output_schema=_SCHEMA_GET_INGESTION_JOB_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class IngestionJobFilterAttribute(UnknownEnumMixin, StrEnum): - STATUS = "STATUS" - - -class IngestionJobFilterOperator(UnknownEnumMixin, StrEnum): - EQ = "EQ" - - -def _serialize_ingestion_job_filter_values( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_ingestion_job_filter_values( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class IngestionJobFilter: - """The definition of a filter to filter the data.""" - - attribute: str - """The name of field or attribute to apply the filter.""" - - operator: str - """The operation to apply to the field or attribute.""" - - values: list[str] - """A list of values that belong to the field or attribute.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INGESTION_JOB_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_INGESTION_JOB_FILTER.members["attribute"], self.attribute - ) - serializer.write_string( - _SCHEMA_INGESTION_JOB_FILTER.members["operator"], self.operator - ) - _serialize_ingestion_job_filter_values( - serializer, _SCHEMA_INGESTION_JOB_FILTER.members["values"], self.values - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["attribute"] = IngestionJobFilterAttribute( - de.read_string( - _SCHEMA_INGESTION_JOB_FILTER.members["attribute"] - ) - ) - - case 1: - kwargs["operator"] = IngestionJobFilterOperator( - de.read_string(_SCHEMA_INGESTION_JOB_FILTER.members["operator"]) - ) - - case 2: - kwargs["values"] = _deserialize_ingestion_job_filter_values( - de, _SCHEMA_INGESTION_JOB_FILTER.members["values"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INGESTION_JOB_FILTER, consumer=_consumer) - if "attribute" not in kwargs: - kwargs["attribute"] = IngestionJobFilterAttribute._corrected("") - if "operator" not in kwargs: - kwargs["operator"] = IngestionJobFilterOperator._corrected("") - if "values" not in kwargs: - kwargs["values"] = [] - return kwargs - - -def _serialize_ingestion_job_filters( - serializer: ShapeSerializer, schema: Schema, value: list[IngestionJobFilter] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_ingestion_job_filters( - deserializer: ShapeDeserializer, schema: Schema -) -> list[IngestionJobFilter]: - result: list[IngestionJobFilter] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(IngestionJobFilter.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class IngestionJobSortByAttribute(UnknownEnumMixin, StrEnum): - STATUS = "STATUS" - STARTED_AT = "STARTED_AT" - - -class SortOrder(UnknownEnumMixin, StrEnum): - ASCENDING = "ASCENDING" - DESCENDING = "DESCENDING" - - -@dataclass(kw_only=True) -class IngestionJobSortBy: - """The parameters of sorting the data.""" - - attribute: str - """The name of field or attribute to apply sorting of data.""" - - order: str - """The order for sorting the data.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INGESTION_JOB_SORT_BY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_INGESTION_JOB_SORT_BY.members["attribute"], self.attribute - ) - serializer.write_string( - _SCHEMA_INGESTION_JOB_SORT_BY.members["order"], self.order - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["attribute"] = IngestionJobSortByAttribute( - de.read_string( - _SCHEMA_INGESTION_JOB_SORT_BY.members["attribute"] - ) - ) - - case 1: - kwargs["order"] = SortOrder( - de.read_string(_SCHEMA_INGESTION_JOB_SORT_BY.members["order"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INGESTION_JOB_SORT_BY, consumer=_consumer) - if "attribute" not in kwargs: - kwargs["attribute"] = IngestionJobSortByAttribute._corrected("") - if "order" not in kwargs: - kwargs["order"] = SortOrder._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class ListIngestionJobsInput: - """Dataclass for ListIngestionJobsInput structure.""" - - knowledge_base_id: str | None = None - """ - The unique identifier of the knowledge base for the list of data - ingestion jobs. - """ - - data_source_id: str | None = None - """ - The unique identifier of the data source for the list of data ingestion - jobs. - """ - - filters: list[IngestionJobFilter] | None = None - """Contains information about the filters for filtering the data.""" - - sort_by: IngestionJobSortBy | None = None - """Contains details about how to sort the data.""" - - max_results: int | None = None - """ - The maximum number of results to return in the response. If the total - number of results is greater than this value, use the token returned in - the response in the `nextToken` field when making another request to - return the next batch of results. - """ - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, enter the token returned in the `nextToken` - field in the response in this field to return the next batch of results. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_INGESTION_JOBS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.knowledge_base_id is not None: - serializer.write_string( - _SCHEMA_LIST_INGESTION_JOBS_INPUT.members["knowledgeBaseId"], - self.knowledge_base_id, - ) - - if self.data_source_id is not None: - serializer.write_string( - _SCHEMA_LIST_INGESTION_JOBS_INPUT.members["dataSourceId"], - self.data_source_id, - ) - - if self.filters is not None: - _serialize_ingestion_job_filters( - serializer, - _SCHEMA_LIST_INGESTION_JOBS_INPUT.members["filters"], - self.filters, - ) - - if self.sort_by is not None: - serializer.write_struct( - _SCHEMA_LIST_INGESTION_JOBS_INPUT.members["sortBy"], self.sort_by - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_INGESTION_JOBS_INPUT.members["maxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_INGESTION_JOBS_INPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["knowledge_base_id"] = de.read_string( - _SCHEMA_LIST_INGESTION_JOBS_INPUT.members["knowledgeBaseId"] - ) - - case 1: - kwargs["data_source_id"] = de.read_string( - _SCHEMA_LIST_INGESTION_JOBS_INPUT.members["dataSourceId"] - ) - - case 2: - kwargs["filters"] = _deserialize_ingestion_job_filters( - de, _SCHEMA_LIST_INGESTION_JOBS_INPUT.members["filters"] - ) - - case 3: - kwargs["sort_by"] = IngestionJobSortBy.deserialize(de) - - case 4: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_INGESTION_JOBS_INPUT.members["maxResults"] - ) - - case 5: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_INGESTION_JOBS_INPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_INGESTION_JOBS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class IngestionJobSummary: - """Contains details about a data ingestion job.""" - - knowledge_base_id: str - """The unique identifier of the knowledge base for the data ingestion job.""" - - data_source_id: str - """The unique identifier of the data source for the data ingestion job.""" - - ingestion_job_id: str - """The unique identifier of the data ingestion job.""" - - status: str - """The status of the data ingestion job.""" - - started_at: datetime - """The time the data ingestion job started.""" - - updated_at: datetime - """The time the data ingestion job was last updated.""" - - description: str | None = None - """The description of the data ingestion job.""" - - text_ready_at: datetime | None = None - """ - The time at which all text content in the data ingestion job finished - extraction and became available to query. - - This time isn't returned until text extraction is complete for all the - documents in the job. - """ - - statistics: IngestionJobStatistics | None = None - """Contains statistics for the data ingestion job.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INGESTION_JOB_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_INGESTION_JOB_SUMMARY.members["knowledgeBaseId"], - self.knowledge_base_id, - ) - serializer.write_string( - _SCHEMA_INGESTION_JOB_SUMMARY.members["dataSourceId"], self.data_source_id - ) - serializer.write_string( - _SCHEMA_INGESTION_JOB_SUMMARY.members["ingestionJobId"], - self.ingestion_job_id, - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_INGESTION_JOB_SUMMARY.members["description"], self.description - ) - - serializer.write_string( - _SCHEMA_INGESTION_JOB_SUMMARY.members["status"], self.status - ) - serializer.write_timestamp( - _SCHEMA_INGESTION_JOB_SUMMARY.members["startedAt"], self.started_at - ) - serializer.write_timestamp( - _SCHEMA_INGESTION_JOB_SUMMARY.members["updatedAt"], self.updated_at - ) - if self.text_ready_at is not None: - serializer.write_timestamp( - _SCHEMA_INGESTION_JOB_SUMMARY.members["textReadyAt"], self.text_ready_at - ) - - if self.statistics is not None: - serializer.write_struct( - _SCHEMA_INGESTION_JOB_SUMMARY.members["statistics"], self.statistics - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["knowledge_base_id"] = de.read_string( - _SCHEMA_INGESTION_JOB_SUMMARY.members["knowledgeBaseId"] - ) - - case 1: - kwargs["data_source_id"] = de.read_string( - _SCHEMA_INGESTION_JOB_SUMMARY.members["dataSourceId"] - ) - - case 2: - kwargs["ingestion_job_id"] = de.read_string( - _SCHEMA_INGESTION_JOB_SUMMARY.members["ingestionJobId"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_INGESTION_JOB_SUMMARY.members["description"] - ) - - case 4: - kwargs["status"] = IngestionJobStatus( - de.read_string(_SCHEMA_INGESTION_JOB_SUMMARY.members["status"]) - ) - - case 5: - kwargs["started_at"] = de.read_timestamp( - _SCHEMA_INGESTION_JOB_SUMMARY.members["startedAt"] - ) - - case 6: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_INGESTION_JOB_SUMMARY.members["updatedAt"] - ) - - case 7: - kwargs["text_ready_at"] = de.read_timestamp( - _SCHEMA_INGESTION_JOB_SUMMARY.members["textReadyAt"] - ) - - case 8: - kwargs["statistics"] = IngestionJobStatistics.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INGESTION_JOB_SUMMARY, consumer=_consumer) - if "knowledge_base_id" not in kwargs: - kwargs["knowledge_base_id"] = "" - if "data_source_id" not in kwargs: - kwargs["data_source_id"] = "" - if "ingestion_job_id" not in kwargs: - kwargs["ingestion_job_id"] = "" - if "status" not in kwargs: - kwargs["status"] = IngestionJobStatus._corrected("") - if "started_at" not in kwargs: - kwargs["started_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_ingestion_job_summaries( - serializer: ShapeSerializer, schema: Schema, value: list[IngestionJobSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_ingestion_job_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[IngestionJobSummary]: - result: list[IngestionJobSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(IngestionJobSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListIngestionJobsOutput: - """Dataclass for ListIngestionJobsOutput structure.""" - - ingestion_job_summaries: list[IngestionJobSummary] - """A list of data ingestion jobs with information about each job.""" - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, use this token when making another request in - the `nextToken` field to return the next batch of results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_INGESTION_JOBS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_ingestion_job_summaries( - serializer, - _SCHEMA_LIST_INGESTION_JOBS_OUTPUT.members["ingestionJobSummaries"], - self.ingestion_job_summaries, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_INGESTION_JOBS_OUTPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["ingestion_job_summaries"] = ( - _deserialize_ingestion_job_summaries( - de, - _SCHEMA_LIST_INGESTION_JOBS_OUTPUT.members[ - "ingestionJobSummaries" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_INGESTION_JOBS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_INGESTION_JOBS_OUTPUT, consumer=_consumer) - if "ingestion_job_summaries" not in kwargs: - kwargs["ingestion_job_summaries"] = [] - return kwargs - - -LIST_INGESTION_JOBS = APIOperation( - input=ListIngestionJobsInput, - output=ListIngestionJobsOutput, - schema=_SCHEMA_LIST_INGESTION_JOBS, - input_schema=_SCHEMA_LIST_INGESTION_JOBS_INPUT, - output_schema=_SCHEMA_LIST_INGESTION_JOBS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class StartIngestionJobInput: - """Dataclass for StartIngestionJobInput structure.""" - - knowledge_base_id: str | None = None - """The unique identifier of the knowledge base for the data ingestion job.""" - - data_source_id: str | None = None - """ - The unique identifier of the data source you want to ingest into your - knowledge base. - """ - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If this token matches a previous - request, Amazon Bedrock ignores the request, but does not return an - error. For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - description: str | None = None - """A description of the data ingestion job.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_INGESTION_JOB_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.knowledge_base_id is not None: - serializer.write_string( - _SCHEMA_START_INGESTION_JOB_INPUT.members["knowledgeBaseId"], - self.knowledge_base_id, - ) - - if self.data_source_id is not None: - serializer.write_string( - _SCHEMA_START_INGESTION_JOB_INPUT.members["dataSourceId"], - self.data_source_id, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_START_INGESTION_JOB_INPUT.members["clientToken"], - self.client_token, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_START_INGESTION_JOB_INPUT.members["description"], - self.description, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["knowledge_base_id"] = de.read_string( - _SCHEMA_START_INGESTION_JOB_INPUT.members["knowledgeBaseId"] - ) - - case 1: - kwargs["data_source_id"] = de.read_string( - _SCHEMA_START_INGESTION_JOB_INPUT.members["dataSourceId"] - ) - - case 2: - kwargs["client_token"] = de.read_string( - _SCHEMA_START_INGESTION_JOB_INPUT.members["clientToken"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_START_INGESTION_JOB_INPUT.members["description"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_START_INGESTION_JOB_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class StartIngestionJobOutput: - """Dataclass for StartIngestionJobOutput structure.""" - - ingestion_job: IngestionJob - """Contains information about the data ingestion job.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_INGESTION_JOB_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_START_INGESTION_JOB_OUTPUT.members["ingestionJob"], - self.ingestion_job, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["ingestion_job"] = IngestionJob.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_START_INGESTION_JOB_OUTPUT, consumer=_consumer) - if "ingestion_job" not in kwargs: - kwargs["ingestion_job"] = IngestionJob._smithy_default() - return kwargs - - -START_INGESTION_JOB = APIOperation( - input=StartIngestionJobInput, - output=StartIngestionJobOutput, - schema=_SCHEMA_START_INGESTION_JOB, - input_schema=_SCHEMA_START_INGESTION_JOB_INPUT, - output_schema=_SCHEMA_START_INGESTION_JOB_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrockagent#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class StopIngestionJobInput: - """Dataclass for StopIngestionJobInput structure.""" - - knowledge_base_id: str | None = None - """ - The unique identifier of the knowledge base for the data ingestion job - you want to stop. - """ - - data_source_id: str | None = None - """ - The unique identifier of the data source for the data ingestion job you - want to stop. - """ - - ingestion_job_id: str | None = None - """The unique identifier of the data ingestion job you want to stop.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STOP_INGESTION_JOB_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.knowledge_base_id is not None: - serializer.write_string( - _SCHEMA_STOP_INGESTION_JOB_INPUT.members["knowledgeBaseId"], - self.knowledge_base_id, - ) - - if self.data_source_id is not None: - serializer.write_string( - _SCHEMA_STOP_INGESTION_JOB_INPUT.members["dataSourceId"], - self.data_source_id, - ) - - if self.ingestion_job_id is not None: - serializer.write_string( - _SCHEMA_STOP_INGESTION_JOB_INPUT.members["ingestionJobId"], - self.ingestion_job_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["knowledge_base_id"] = de.read_string( - _SCHEMA_STOP_INGESTION_JOB_INPUT.members["knowledgeBaseId"] - ) - - case 1: - kwargs["data_source_id"] = de.read_string( - _SCHEMA_STOP_INGESTION_JOB_INPUT.members["dataSourceId"] - ) - - case 2: - kwargs["ingestion_job_id"] = de.read_string( - _SCHEMA_STOP_INGESTION_JOB_INPUT.members["ingestionJobId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_STOP_INGESTION_JOB_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class StopIngestionJobOutput: - """Dataclass for StopIngestionJobOutput structure.""" - - ingestion_job: IngestionJob - """Contains information about the stopped data ingestion job.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STOP_INGESTION_JOB_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_STOP_INGESTION_JOB_OUTPUT.members["ingestionJob"], - self.ingestion_job, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["ingestion_job"] = IngestionJob.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_STOP_INGESTION_JOB_OUTPUT, consumer=_consumer) - if "ingestion_job" not in kwargs: - kwargs["ingestion_job"] = IngestionJob._smithy_default() - return kwargs - - -STOP_INGESTION_JOB = APIOperation( - input=StopIngestionJobInput, - output=StopIngestionJobOutput, - schema=_SCHEMA_STOP_INGESTION_JOB, - input_schema=_SCHEMA_STOP_INGESTION_JOB_INPUT, - output_schema=_SCHEMA_STOP_INGESTION_JOB_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrockagent#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class CustomDocumentIdentifier: - """ - Contains information about the identifier of the document to ingest into - a custom data source. - """ - - id: str - """The identifier of the document to ingest into a custom data source.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOM_DOCUMENT_IDENTIFIER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CUSTOM_DOCUMENT_IDENTIFIER.members["id"], self.id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_CUSTOM_DOCUMENT_IDENTIFIER.members["id"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CUSTOM_DOCUMENT_IDENTIFIER, consumer=_consumer) - if "id" not in kwargs: - kwargs["id"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(id="") - - -class ContentDataSourceType(UnknownEnumMixin, StrEnum): - CUSTOM = "CUSTOM" - S3 = "S3" - - -@dataclass(kw_only=True) -class DocumentIdentifier: - """Contains information that identifies the document.""" - - data_source_type: str - """ - The type of data source connected to the knowledge base that contains - the document. - """ - - s3: S3Location | None = None - """Contains information that identifies the document in an S3 data source.""" - - custom: CustomDocumentIdentifier | None = None - """ - Contains information that identifies the document in a custom data - source. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_IDENTIFIER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DOCUMENT_IDENTIFIER.members["dataSourceType"], self.data_source_type - ) - if self.s3 is not None: - serializer.write_struct(_SCHEMA_DOCUMENT_IDENTIFIER.members["s3"], self.s3) - - if self.custom is not None: - serializer.write_struct( - _SCHEMA_DOCUMENT_IDENTIFIER.members["custom"], self.custom - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["data_source_type"] = ContentDataSourceType( - de.read_string( - _SCHEMA_DOCUMENT_IDENTIFIER.members["dataSourceType"] - ) - ) - - case 1: - kwargs["s3"] = S3Location.deserialize(de) - - case 2: - kwargs["custom"] = CustomDocumentIdentifier.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DOCUMENT_IDENTIFIER, consumer=_consumer) - if "data_source_type" not in kwargs: - kwargs["data_source_type"] = ContentDataSourceType._corrected("") - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(data_source_type=ContentDataSourceType._corrected("")) - - -def _serialize_document_identifiers( - serializer: ShapeSerializer, schema: Schema, value: list[DocumentIdentifier] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_document_identifiers( - deserializer: ShapeDeserializer, schema: Schema -) -> list[DocumentIdentifier]: - result: list[DocumentIdentifier] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(DocumentIdentifier.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class DeleteKnowledgeBaseDocumentsInput: - """Dataclass for DeleteKnowledgeBaseDocumentsInput structure.""" - - knowledge_base_id: str | None = None - """ - The unique identifier of the knowledge base that is connected to the - data source. - """ - - data_source_id: str | None = None - """The unique identifier of the data source that contains the documents.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If this token matches a previous - request, Amazon Bedrock ignores the request, but does not return an - error. For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - document_identifiers: list[DocumentIdentifier] | None = None - """ - A list of objects, each of which contains information to identify a - document to delete. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_KNOWLEDGE_BASE_DOCUMENTS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.knowledge_base_id is not None: - serializer.write_string( - _SCHEMA_DELETE_KNOWLEDGE_BASE_DOCUMENTS_INPUT.members[ - "knowledgeBaseId" - ], - self.knowledge_base_id, - ) - - if self.data_source_id is not None: - serializer.write_string( - _SCHEMA_DELETE_KNOWLEDGE_BASE_DOCUMENTS_INPUT.members["dataSourceId"], - self.data_source_id, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_DELETE_KNOWLEDGE_BASE_DOCUMENTS_INPUT.members["clientToken"], - self.client_token, - ) - - if self.document_identifiers is not None: - _serialize_document_identifiers( - serializer, - _SCHEMA_DELETE_KNOWLEDGE_BASE_DOCUMENTS_INPUT.members[ - "documentIdentifiers" - ], - self.document_identifiers, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["knowledge_base_id"] = de.read_string( - _SCHEMA_DELETE_KNOWLEDGE_BASE_DOCUMENTS_INPUT.members[ - "knowledgeBaseId" - ] - ) - - case 1: - kwargs["data_source_id"] = de.read_string( - _SCHEMA_DELETE_KNOWLEDGE_BASE_DOCUMENTS_INPUT.members[ - "dataSourceId" - ] - ) - - case 2: - kwargs["client_token"] = de.read_string( - _SCHEMA_DELETE_KNOWLEDGE_BASE_DOCUMENTS_INPUT.members[ - "clientToken" - ] - ) - - case 3: - kwargs["document_identifiers"] = _deserialize_document_identifiers( - de, - _SCHEMA_DELETE_KNOWLEDGE_BASE_DOCUMENTS_INPUT.members[ - "documentIdentifiers" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_KNOWLEDGE_BASE_DOCUMENTS_INPUT, consumer=_consumer - ) - return kwargs - - -class DocumentStatus(UnknownEnumMixin, StrEnum): - INDEXED = "INDEXED" - PARTIALLY_INDEXED = "PARTIALLY_INDEXED" - PENDING = "PENDING" - FAILED = "FAILED" - METADATA_PARTIALLY_INDEXED = "METADATA_PARTIALLY_INDEXED" - METADATA_UPDATE_FAILED = "METADATA_UPDATE_FAILED" - IGNORED = "IGNORED" - NOT_FOUND = "NOT_FOUND" - STARTING = "STARTING" - IN_PROGRESS = "IN_PROGRESS" - DELETING = "DELETING" - DELETE_IN_PROGRESS = "DELETE_IN_PROGRESS" - - -@dataclass(kw_only=True) -class KnowledgeBaseDocumentDetail: - """Contains the details for a document that was ingested or deleted.""" - - knowledge_base_id: str - """ - The identifier of the knowledge base that the document was ingested into - or deleted from. - """ - - data_source_id: str - """ - The identifier of the data source connected to the knowledge base that - the document was ingested into or deleted from. - """ - - status: str - """ - The ingestion status of the document. The following statuses are - possible: - - - STARTING -- You submitted the ingestion job containing the document. - - - PENDING -- The document is waiting to be ingested. - - - IN_PROGRESS -- The document is being ingested. - - - INDEXED -- The document was successfully indexed. - - - PARTIALLY_INDEXED -- The document was partially indexed. - - - METADATA_PARTIALLY_INDEXED -- You submitted metadata for an existing - document and it was partially indexed. - - - METADATA_UPDATE_FAILED -- You submitted a metadata update for an - existing document but it failed. - - - FAILED -- The document failed to be ingested. - - - NOT_FOUND -- The document wasn't found. - - - IGNORED -- The document was ignored during ingestion. - - - DELETING -- You submitted the delete job containing the document. - - - DELETE_IN_PROGRESS -- The document is being deleted. - """ - - identifier: DocumentIdentifier - """Contains information that identifies the document.""" - - status_reason: str | None = None - """The reason for the status. Appears alongside the status `IGNORED`.""" - - updated_at: datetime | None = None - """The date and time at which the document was last updated.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KNOWLEDGE_BASE_DOCUMENT_DETAIL, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_KNOWLEDGE_BASE_DOCUMENT_DETAIL.members["knowledgeBaseId"], - self.knowledge_base_id, - ) - serializer.write_string( - _SCHEMA_KNOWLEDGE_BASE_DOCUMENT_DETAIL.members["dataSourceId"], - self.data_source_id, - ) - serializer.write_string( - _SCHEMA_KNOWLEDGE_BASE_DOCUMENT_DETAIL.members["status"], self.status - ) - serializer.write_struct( - _SCHEMA_KNOWLEDGE_BASE_DOCUMENT_DETAIL.members["identifier"], - self.identifier, - ) - if self.status_reason is not None: - serializer.write_string( - _SCHEMA_KNOWLEDGE_BASE_DOCUMENT_DETAIL.members["statusReason"], - self.status_reason, - ) - - if self.updated_at is not None: - serializer.write_timestamp( - _SCHEMA_KNOWLEDGE_BASE_DOCUMENT_DETAIL.members["updatedAt"], - self.updated_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["knowledge_base_id"] = de.read_string( - _SCHEMA_KNOWLEDGE_BASE_DOCUMENT_DETAIL.members[ - "knowledgeBaseId" - ] - ) - - case 1: - kwargs["data_source_id"] = de.read_string( - _SCHEMA_KNOWLEDGE_BASE_DOCUMENT_DETAIL.members["dataSourceId"] - ) - - case 2: - kwargs["status"] = DocumentStatus( - de.read_string( - _SCHEMA_KNOWLEDGE_BASE_DOCUMENT_DETAIL.members["status"] - ) - ) - - case 3: - kwargs["identifier"] = DocumentIdentifier.deserialize(de) - - case 4: - kwargs["status_reason"] = de.read_string( - _SCHEMA_KNOWLEDGE_BASE_DOCUMENT_DETAIL.members["statusReason"] - ) - - case 5: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_KNOWLEDGE_BASE_DOCUMENT_DETAIL.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_KNOWLEDGE_BASE_DOCUMENT_DETAIL, consumer=_consumer - ) - if "knowledge_base_id" not in kwargs: - kwargs["knowledge_base_id"] = "" - if "data_source_id" not in kwargs: - kwargs["data_source_id"] = "" - if "status" not in kwargs: - kwargs["status"] = DocumentStatus._corrected("") - if "identifier" not in kwargs: - kwargs["identifier"] = DocumentIdentifier._smithy_default() - return kwargs - - -def _serialize_knowledge_base_document_details( - serializer: ShapeSerializer, - schema: Schema, - value: list[KnowledgeBaseDocumentDetail], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_knowledge_base_document_details( - deserializer: ShapeDeserializer, schema: Schema -) -> list[KnowledgeBaseDocumentDetail]: - result: list[KnowledgeBaseDocumentDetail] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(KnowledgeBaseDocumentDetail.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class DeleteKnowledgeBaseDocumentsOutput: - """Dataclass for DeleteKnowledgeBaseDocumentsOutput structure.""" - - document_details: list[KnowledgeBaseDocumentDetail] | None = None - """ - A list of objects, each of which contains information about the - documents that were deleted. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_KNOWLEDGE_BASE_DOCUMENTS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.document_details is not None: - _serialize_knowledge_base_document_details( - serializer, - _SCHEMA_DELETE_KNOWLEDGE_BASE_DOCUMENTS_OUTPUT.members[ - "documentDetails" - ], - self.document_details, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["document_details"] = ( - _deserialize_knowledge_base_document_details( - de, - _SCHEMA_DELETE_KNOWLEDGE_BASE_DOCUMENTS_OUTPUT.members[ - "documentDetails" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_KNOWLEDGE_BASE_DOCUMENTS_OUTPUT, consumer=_consumer - ) - return kwargs - - -DELETE_KNOWLEDGE_BASE_DOCUMENTS = APIOperation( - input=DeleteKnowledgeBaseDocumentsInput, - output=DeleteKnowledgeBaseDocumentsOutput, - schema=_SCHEMA_DELETE_KNOWLEDGE_BASE_DOCUMENTS, - input_schema=_SCHEMA_DELETE_KNOWLEDGE_BASE_DOCUMENTS_INPUT, - output_schema=_SCHEMA_DELETE_KNOWLEDGE_BASE_DOCUMENTS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetKnowledgeBaseDocumentsInput: - """Dataclass for GetKnowledgeBaseDocumentsInput structure.""" - - knowledge_base_id: str | None = None - """ - The unique identifier of the knowledge base that is connected to the - data source. - """ - - data_source_id: str | None = None - """The unique identifier of the data source that contains the documents.""" - - document_identifiers: list[DocumentIdentifier] | None = None - """ - A list of objects, each of which contains information to identify a - document for which to retrieve information. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_KNOWLEDGE_BASE_DOCUMENTS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.knowledge_base_id is not None: - serializer.write_string( - _SCHEMA_GET_KNOWLEDGE_BASE_DOCUMENTS_INPUT.members["knowledgeBaseId"], - self.knowledge_base_id, - ) - - if self.data_source_id is not None: - serializer.write_string( - _SCHEMA_GET_KNOWLEDGE_BASE_DOCUMENTS_INPUT.members["dataSourceId"], - self.data_source_id, - ) - - if self.document_identifiers is not None: - _serialize_document_identifiers( - serializer, - _SCHEMA_GET_KNOWLEDGE_BASE_DOCUMENTS_INPUT.members[ - "documentIdentifiers" - ], - self.document_identifiers, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["knowledge_base_id"] = de.read_string( - _SCHEMA_GET_KNOWLEDGE_BASE_DOCUMENTS_INPUT.members[ - "knowledgeBaseId" - ] - ) - - case 1: - kwargs["data_source_id"] = de.read_string( - _SCHEMA_GET_KNOWLEDGE_BASE_DOCUMENTS_INPUT.members[ - "dataSourceId" - ] - ) - - case 2: - kwargs["document_identifiers"] = _deserialize_document_identifiers( - de, - _SCHEMA_GET_KNOWLEDGE_BASE_DOCUMENTS_INPUT.members[ - "documentIdentifiers" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_KNOWLEDGE_BASE_DOCUMENTS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetKnowledgeBaseDocumentsOutput: - """Dataclass for GetKnowledgeBaseDocumentsOutput structure.""" - - document_details: list[KnowledgeBaseDocumentDetail] | None = None - """ - A list of objects, each of which contains information about the - documents that were retrieved. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_KNOWLEDGE_BASE_DOCUMENTS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.document_details is not None: - _serialize_knowledge_base_document_details( - serializer, - _SCHEMA_GET_KNOWLEDGE_BASE_DOCUMENTS_OUTPUT.members["documentDetails"], - self.document_details, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["document_details"] = ( - _deserialize_knowledge_base_document_details( - de, - _SCHEMA_GET_KNOWLEDGE_BASE_DOCUMENTS_OUTPUT.members[ - "documentDetails" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_KNOWLEDGE_BASE_DOCUMENTS_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_KNOWLEDGE_BASE_DOCUMENTS = APIOperation( - input=GetKnowledgeBaseDocumentsInput, - output=GetKnowledgeBaseDocumentsOutput, - schema=_SCHEMA_GET_KNOWLEDGE_BASE_DOCUMENTS, - input_schema=_SCHEMA_GET_KNOWLEDGE_BASE_DOCUMENTS_INPUT, - output_schema=_SCHEMA_GET_KNOWLEDGE_BASE_DOCUMENTS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ByteContentDoc: - """Contains information about content defined inline in bytes.""" - - mime_type: str - """ - The MIME type of the content. For a list of MIME types, see [Media - Types](https://www.iana.org/assignments/media-types/media-types.xhtml). - The following MIME types are supported: - - - text/plain - - - text/html - - - text/csv - - - text/vtt - - - message/rfc822 - - - application/xhtml+xml - - - application/pdf - - - application/msword - - - application/vnd.ms-word.document.macroenabled.12 - - - application/vnd.ms-word.template.macroenabled.12 - - - application/vnd.ms-excel - - - application/vnd.ms-excel.addin.macroenabled.12 - - - application/vnd.ms-excel.sheet.macroenabled.12 - - - application/vnd.ms-excel.template.macroenabled.12 - - - application/vnd.ms-excel.sheet.binary.macroenabled.12 - - - application/vnd.ms-spreadsheetml - - - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet - - - application/vnd.openxmlformats-officedocument.spreadsheetml.template - - - application/vnd.openxmlformats-officedocument.wordprocessingml.document - - - application/vnd.openxmlformats-officedocument.wordprocessingml.template - """ - - data: bytes = field(repr=False) - """The base64-encoded string of the content.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BYTE_CONTENT_DOC, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_BYTE_CONTENT_DOC.members["mimeType"], self.mime_type - ) - serializer.write_blob(_SCHEMA_BYTE_CONTENT_DOC.members["data"], self.data) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["mime_type"] = de.read_string( - _SCHEMA_BYTE_CONTENT_DOC.members["mimeType"] - ) - - case 1: - kwargs["data"] = de.read_blob( - _SCHEMA_BYTE_CONTENT_DOC.members["data"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BYTE_CONTENT_DOC, consumer=_consumer) - if "mime_type" not in kwargs: - kwargs["mime_type"] = "" - if "data" not in kwargs: - kwargs["data"] = b"" - return kwargs - - -@dataclass(kw_only=True) -class TextContentDoc: - """Contains information about content defined inline in text.""" - - data: str = field(repr=False) - """The text of the content.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TEXT_CONTENT_DOC, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_TEXT_CONTENT_DOC.members["data"], self.data) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["data"] = de.read_string( - _SCHEMA_TEXT_CONTENT_DOC.members["data"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TEXT_CONTENT_DOC, consumer=_consumer) - if "data" not in kwargs: - kwargs["data"] = "" - return kwargs - - -class InlineContentType(UnknownEnumMixin, StrEnum): - BYTE = "BYTE" - TEXT = "TEXT" - - -@dataclass(kw_only=True) -class InlineContent: - """ - Contains information about content defined inline to ingest into a data - source. Choose a `type` and include the field that corresponds to it. - """ - - type: str - """The type of inline content to define.""" - - byte_content: ByteContentDoc | None = None - """Contains information about content defined inline in bytes.""" - - text_content: TextContentDoc | None = None - """Contains information about content defined inline in text.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INLINE_CONTENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_INLINE_CONTENT.members["type"], self.type) - if self.byte_content is not None: - serializer.write_struct( - _SCHEMA_INLINE_CONTENT.members["byteContent"], self.byte_content - ) - - if self.text_content is not None: - serializer.write_struct( - _SCHEMA_INLINE_CONTENT.members["textContent"], self.text_content - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = InlineContentType( - de.read_string(_SCHEMA_INLINE_CONTENT.members["type"]) - ) - - case 1: - kwargs["byte_content"] = ByteContentDoc.deserialize(de) - - case 2: - kwargs["text_content"] = TextContentDoc.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INLINE_CONTENT, consumer=_consumer) - if "type" not in kwargs: - kwargs["type"] = InlineContentType._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class CustomS3Location: - """ - Contains information about the Amazon S3 location of the file containing - the content to ingest into a knowledge base connected to a custom data - source. - """ - - uri: str - """The S3 URI of the file containing the content to ingest.""" - - bucket_owner_account_id: str | None = None - """ - The identifier of the Amazon Web Services account that owns the S3 - bucket containing the content to ingest. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOM_S3_LOCATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_CUSTOM_S3_LOCATION.members["uri"], self.uri) - if self.bucket_owner_account_id is not None: - serializer.write_string( - _SCHEMA_CUSTOM_S3_LOCATION.members["bucketOwnerAccountId"], - self.bucket_owner_account_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["uri"] = de.read_string( - _SCHEMA_CUSTOM_S3_LOCATION.members["uri"] - ) - - case 1: - kwargs["bucket_owner_account_id"] = de.read_string( - _SCHEMA_CUSTOM_S3_LOCATION.members["bucketOwnerAccountId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CUSTOM_S3_LOCATION, consumer=_consumer) - if "uri" not in kwargs: - kwargs["uri"] = "" - return kwargs - - -class CustomSourceType(UnknownEnumMixin, StrEnum): - IN_LINE = "IN_LINE" - S3_LOCATION = "S3_LOCATION" - - -@dataclass(kw_only=True) -class CustomContent: - """ - Contains information about the content to ingest into a knowledge base - connected to a custom data source. Choose a `sourceType` and include the - field that corresponds to it. - """ - - custom_document_identifier: CustomDocumentIdentifier - """A unique identifier for the document.""" - - source_type: str - """The source of the data to ingest.""" - - s3_location: CustomS3Location | None = None - """ - Contains information about the Amazon S3 location of the file from which - to ingest data. - """ - - inline_content: InlineContent | None = None - """ - Contains information about content defined inline to ingest into a - knowledge base. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOM_CONTENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CUSTOM_CONTENT.members["customDocumentIdentifier"], - self.custom_document_identifier, - ) - serializer.write_string( - _SCHEMA_CUSTOM_CONTENT.members["sourceType"], self.source_type - ) - if self.s3_location is not None: - serializer.write_struct( - _SCHEMA_CUSTOM_CONTENT.members["s3Location"], self.s3_location - ) - - if self.inline_content is not None: - serializer.write_struct( - _SCHEMA_CUSTOM_CONTENT.members["inlineContent"], self.inline_content - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["custom_document_identifier"] = ( - CustomDocumentIdentifier.deserialize(de) - ) - - case 1: - kwargs["source_type"] = CustomSourceType( - de.read_string(_SCHEMA_CUSTOM_CONTENT.members["sourceType"]) - ) - - case 2: - kwargs["s3_location"] = CustomS3Location.deserialize(de) - - case 3: - kwargs["inline_content"] = InlineContent.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CUSTOM_CONTENT, consumer=_consumer) - if "custom_document_identifier" not in kwargs: - kwargs["custom_document_identifier"] = ( - CustomDocumentIdentifier._smithy_default() - ) - if "source_type" not in kwargs: - kwargs["source_type"] = CustomSourceType._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class S3Content: - """ - Contains information about the content to ingest into a knowledge base - connected to an Amazon S3 data source. - """ - - s3_location: S3Location - """The S3 location of the file containing the content to ingest.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_S3_CONTENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_S3_CONTENT.members["s3Location"], self.s3_location - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["s3_location"] = S3Location.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_S3_CONTENT, consumer=_consumer) - if "s3_location" not in kwargs: - kwargs["s3_location"] = S3Location._smithy_default() - return kwargs - - -@dataclass(kw_only=True) -class DocumentContent: - """ - Contains information about the content of a document. Choose a - `dataSourceType` and include the field that corresponds to it. - """ - - data_source_type: str - """ - The type of data source that is connected to the knowledge base to which - to ingest this document. - """ - - custom: CustomContent | None = None - """ - Contains information about the content to ingest into a knowledge base - connected to a custom data source. - """ - - s3: S3Content | None = None - """ - Contains information about the content to ingest into a knowledge base - connected to an Amazon S3 data source - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_CONTENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DOCUMENT_CONTENT.members["dataSourceType"], self.data_source_type - ) - if self.custom is not None: - serializer.write_struct( - _SCHEMA_DOCUMENT_CONTENT.members["custom"], self.custom - ) - - if self.s3 is not None: - serializer.write_struct(_SCHEMA_DOCUMENT_CONTENT.members["s3"], self.s3) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["data_source_type"] = ContentDataSourceType( - de.read_string( - _SCHEMA_DOCUMENT_CONTENT.members["dataSourceType"] - ) - ) - - case 1: - kwargs["custom"] = CustomContent.deserialize(de) - - case 2: - kwargs["s3"] = S3Content.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DOCUMENT_CONTENT, consumer=_consumer) - if "data_source_type" not in kwargs: - kwargs["data_source_type"] = ContentDataSourceType._corrected("") - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(data_source_type=ContentDataSourceType._corrected("")) - - -@dataclass(kw_only=True) -class DocumentAccessControlEntry: - """An access control entry specifying a principal and their access level.""" - - name: str - """The user identifier.""" - - type: str - """The type of principal.""" - - access: str - """Whether to allow or deny access.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_ACCESS_CONTROL_ENTRY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DOCUMENT_ACCESS_CONTROL_ENTRY.members["name"], self.name - ) - serializer.write_string( - _SCHEMA_DOCUMENT_ACCESS_CONTROL_ENTRY.members["type"], self.type - ) - serializer.write_string( - _SCHEMA_DOCUMENT_ACCESS_CONTROL_ENTRY.members["access"], self.access - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_DOCUMENT_ACCESS_CONTROL_ENTRY.members["name"] - ) - - case 1: - kwargs["type"] = AccessControlPrincipalType( - de.read_string( - _SCHEMA_DOCUMENT_ACCESS_CONTROL_ENTRY.members["type"] - ) - ) - - case 2: - kwargs["access"] = AccessControlAccess( - de.read_string( - _SCHEMA_DOCUMENT_ACCESS_CONTROL_ENTRY.members["access"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DOCUMENT_ACCESS_CONTROL_ENTRY, consumer=_consumer - ) - if "name" not in kwargs: - kwargs["name"] = "" - if "type" not in kwargs: - kwargs["type"] = AccessControlPrincipalType._corrected("") - if "access" not in kwargs: - kwargs["access"] = AccessControlAccess._corrected("") - return kwargs - - -def _serialize_document_access_control_list( - serializer: ShapeSerializer, schema: Schema, value: list[DocumentAccessControlEntry] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_document_access_control_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[DocumentAccessControlEntry]: - result: list[DocumentAccessControlEntry] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(DocumentAccessControlEntry.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_string_list_value( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_string_list_value( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -class MetadataValueType(UnknownEnumMixin, StrEnum): - BOOLEAN = "BOOLEAN" - NUMBER = "NUMBER" - STRING = "STRING" - STRING_LIST = "STRING_LIST" - - -@dataclass(kw_only=True) -class MetadataAttributeValue: - """ - Contains the value of the metadata attribute. Choose a `type` and - include the field that corresponds to it. - """ - - type: str - """The type of the metadata attribute.""" - - number_value: float | None = field(repr=False, default=None) - """The value of the numeric metadata attribute.""" - - boolean_value: bool | None = None - """The value of the Boolean metadata attribute.""" - - string_value: str | None = field(repr=False, default=None) - """The value of the string metadata attribute.""" - - string_list_value: list[str] | None = None - """An array of strings that define the value of the metadata attribute.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_METADATA_ATTRIBUTE_VALUE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_METADATA_ATTRIBUTE_VALUE.members["type"], self.type - ) - if self.number_value is not None: - serializer.write_double( - _SCHEMA_METADATA_ATTRIBUTE_VALUE.members["numberValue"], - self.number_value, - ) - - if self.boolean_value is not None: - serializer.write_boolean( - _SCHEMA_METADATA_ATTRIBUTE_VALUE.members["booleanValue"], - self.boolean_value, - ) - - if self.string_value is not None: - serializer.write_string( - _SCHEMA_METADATA_ATTRIBUTE_VALUE.members["stringValue"], - self.string_value, - ) - - if self.string_list_value is not None: - _serialize_string_list_value( - serializer, - _SCHEMA_METADATA_ATTRIBUTE_VALUE.members["stringListValue"], - self.string_list_value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = MetadataValueType( - de.read_string(_SCHEMA_METADATA_ATTRIBUTE_VALUE.members["type"]) - ) - - case 1: - kwargs["number_value"] = de.read_double( - _SCHEMA_METADATA_ATTRIBUTE_VALUE.members["numberValue"] - ) - - case 2: - kwargs["boolean_value"] = de.read_boolean( - _SCHEMA_METADATA_ATTRIBUTE_VALUE.members["booleanValue"] - ) - - case 3: - kwargs["string_value"] = de.read_string( - _SCHEMA_METADATA_ATTRIBUTE_VALUE.members["stringValue"] - ) - - case 4: - kwargs["string_list_value"] = _deserialize_string_list_value( - de, _SCHEMA_METADATA_ATTRIBUTE_VALUE.members["stringListValue"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_METADATA_ATTRIBUTE_VALUE, consumer=_consumer) - if "type" not in kwargs: - kwargs["type"] = MetadataValueType._corrected("") - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(type=MetadataValueType._corrected("")) - - -@dataclass(kw_only=True) -class MetadataAttribute: - """Contains information about a metadata attribute.""" - - key: str = field(repr=False) - """The key of the metadata attribute.""" - - value: MetadataAttributeValue - """Contains the value of the metadata attribute.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_METADATA_ATTRIBUTE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_METADATA_ATTRIBUTE.members["key"], self.key) - serializer.write_struct(_SCHEMA_METADATA_ATTRIBUTE.members["value"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["key"] = de.read_string( - _SCHEMA_METADATA_ATTRIBUTE.members["key"] - ) - - case 1: - kwargs["value"] = MetadataAttributeValue.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_METADATA_ATTRIBUTE, consumer=_consumer) - if "key" not in kwargs: - kwargs["key"] = "" - if "value" not in kwargs: - kwargs["value"] = MetadataAttributeValue._smithy_default() - return kwargs - - -def _serialize_metadata_attributes( - serializer: ShapeSerializer, schema: Schema, value: list[MetadataAttribute] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_metadata_attributes( - deserializer: ShapeDeserializer, schema: Schema -) -> list[MetadataAttribute]: - result: list[MetadataAttribute] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(MetadataAttribute.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class MetadataSourceType(UnknownEnumMixin, StrEnum): - IN_LINE_ATTRIBUTE = "IN_LINE_ATTRIBUTE" - S3_LOCATION = "S3_LOCATION" - - -@dataclass(kw_only=True) -class DocumentMetadata: - """ - Contains information about the metadata associate with the content to - ingest into a knowledge base. Choose a `type` and include the field that - corresponds to it. - """ - - type: str - """The type of the source source from which to add metadata.""" - - inline_attributes: list[MetadataAttribute] | None = None - """ - An array of objects, each of which defines a metadata attribute to - associate with the content to ingest. You define the attributes inline. - """ - - s3_location: CustomS3Location | None = None - """ - The Amazon S3 location of the file containing metadata to associate with - the content to ingest. - """ - - access_control_list: list[DocumentAccessControlEntry] | None = None - """ - Access control list for the document. Used when metadata type is - IN_LINE_ATTRIBUTE. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_METADATA, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_DOCUMENT_METADATA.members["type"], self.type) - if self.inline_attributes is not None: - _serialize_metadata_attributes( - serializer, - _SCHEMA_DOCUMENT_METADATA.members["inlineAttributes"], - self.inline_attributes, - ) - - if self.s3_location is not None: - serializer.write_struct( - _SCHEMA_DOCUMENT_METADATA.members["s3Location"], self.s3_location - ) - - if self.access_control_list is not None: - _serialize_document_access_control_list( - serializer, - _SCHEMA_DOCUMENT_METADATA.members["accessControlList"], - self.access_control_list, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = MetadataSourceType( - de.read_string(_SCHEMA_DOCUMENT_METADATA.members["type"]) - ) - - case 1: - kwargs["inline_attributes"] = _deserialize_metadata_attributes( - de, _SCHEMA_DOCUMENT_METADATA.members["inlineAttributes"] - ) - - case 2: - kwargs["s3_location"] = CustomS3Location.deserialize(de) - - case 3: - kwargs["access_control_list"] = ( - _deserialize_document_access_control_list( - de, _SCHEMA_DOCUMENT_METADATA.members["accessControlList"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DOCUMENT_METADATA, consumer=_consumer) - if "type" not in kwargs: - kwargs["type"] = MetadataSourceType._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class KnowledgeBaseDocument: - """ - Contains information about a document to ingest into a knowledge base - and metadata to associate with it. - """ - - content: DocumentContent - """Contains the content of the document.""" - - metadata: DocumentMetadata | None = None - """Contains the metadata to associate with the document.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KNOWLEDGE_BASE_DOCUMENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.metadata is not None: - serializer.write_struct( - _SCHEMA_KNOWLEDGE_BASE_DOCUMENT.members["metadata"], self.metadata - ) - - serializer.write_struct( - _SCHEMA_KNOWLEDGE_BASE_DOCUMENT.members["content"], self.content - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["metadata"] = DocumentMetadata.deserialize(de) - - case 1: - kwargs["content"] = DocumentContent.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_KNOWLEDGE_BASE_DOCUMENT, consumer=_consumer) - if "content" not in kwargs: - kwargs["content"] = DocumentContent._smithy_default() - return kwargs - - -def _serialize_knowledge_base_documents( - serializer: ShapeSerializer, schema: Schema, value: list[KnowledgeBaseDocument] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_knowledge_base_documents( - deserializer: ShapeDeserializer, schema: Schema -) -> list[KnowledgeBaseDocument]: - result: list[KnowledgeBaseDocument] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(KnowledgeBaseDocument.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class IngestKnowledgeBaseDocumentsInput: - """Dataclass for IngestKnowledgeBaseDocumentsInput structure.""" - - knowledge_base_id: str | None = None - """ - The unique identifier of the knowledge base to ingest the documents - into. - """ - - data_source_id: str | None = None - """ - The unique identifier of the data source connected to the knowledge base - that you're adding documents to. - """ - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If this token matches a previous - request, Amazon Bedrock ignores the request, but does not return an - error. For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - documents: list[KnowledgeBaseDocument] | None = None - """ - A list of objects, each of which contains information about the - documents to add. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INGEST_KNOWLEDGE_BASE_DOCUMENTS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.knowledge_base_id is not None: - serializer.write_string( - _SCHEMA_INGEST_KNOWLEDGE_BASE_DOCUMENTS_INPUT.members[ - "knowledgeBaseId" - ], - self.knowledge_base_id, - ) - - if self.data_source_id is not None: - serializer.write_string( - _SCHEMA_INGEST_KNOWLEDGE_BASE_DOCUMENTS_INPUT.members["dataSourceId"], - self.data_source_id, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_INGEST_KNOWLEDGE_BASE_DOCUMENTS_INPUT.members["clientToken"], - self.client_token, - ) - - if self.documents is not None: - _serialize_knowledge_base_documents( - serializer, - _SCHEMA_INGEST_KNOWLEDGE_BASE_DOCUMENTS_INPUT.members["documents"], - self.documents, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["knowledge_base_id"] = de.read_string( - _SCHEMA_INGEST_KNOWLEDGE_BASE_DOCUMENTS_INPUT.members[ - "knowledgeBaseId" - ] - ) - - case 1: - kwargs["data_source_id"] = de.read_string( - _SCHEMA_INGEST_KNOWLEDGE_BASE_DOCUMENTS_INPUT.members[ - "dataSourceId" - ] - ) - - case 2: - kwargs["client_token"] = de.read_string( - _SCHEMA_INGEST_KNOWLEDGE_BASE_DOCUMENTS_INPUT.members[ - "clientToken" - ] - ) - - case 3: - kwargs["documents"] = _deserialize_knowledge_base_documents( - de, - _SCHEMA_INGEST_KNOWLEDGE_BASE_DOCUMENTS_INPUT.members[ - "documents" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INGEST_KNOWLEDGE_BASE_DOCUMENTS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class IngestKnowledgeBaseDocumentsOutput: - """Dataclass for IngestKnowledgeBaseDocumentsOutput structure.""" - - document_details: list[KnowledgeBaseDocumentDetail] | None = None - """ - A list of objects, each of which contains information about the - documents that were ingested. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INGEST_KNOWLEDGE_BASE_DOCUMENTS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.document_details is not None: - _serialize_knowledge_base_document_details( - serializer, - _SCHEMA_INGEST_KNOWLEDGE_BASE_DOCUMENTS_OUTPUT.members[ - "documentDetails" - ], - self.document_details, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["document_details"] = ( - _deserialize_knowledge_base_document_details( - de, - _SCHEMA_INGEST_KNOWLEDGE_BASE_DOCUMENTS_OUTPUT.members[ - "documentDetails" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INGEST_KNOWLEDGE_BASE_DOCUMENTS_OUTPUT, consumer=_consumer - ) - return kwargs - - -INGEST_KNOWLEDGE_BASE_DOCUMENTS = APIOperation( - input=IngestKnowledgeBaseDocumentsInput, - output=IngestKnowledgeBaseDocumentsOutput, - schema=_SCHEMA_INGEST_KNOWLEDGE_BASE_DOCUMENTS, - input_schema=_SCHEMA_INGEST_KNOWLEDGE_BASE_DOCUMENTS_INPUT, - output_schema=_SCHEMA_INGEST_KNOWLEDGE_BASE_DOCUMENTS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListKnowledgeBaseDocumentsInput: - """Dataclass for ListKnowledgeBaseDocumentsInput structure.""" - - knowledge_base_id: str | None = None - """ - The unique identifier of the knowledge base that is connected to the - data source. - """ - - data_source_id: str | None = None - """The unique identifier of the data source that contains the documents.""" - - max_results: int | None = None - """ - The maximum number of results to return in the response. If the total - number of results is greater than this value, use the token returned in - the response in the `nextToken` field when making another request to - return the next batch of results. - """ - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, enter the token returned in the `nextToken` - field in the response in this field to return the next batch of results. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_KNOWLEDGE_BASE_DOCUMENTS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.knowledge_base_id is not None: - serializer.write_string( - _SCHEMA_LIST_KNOWLEDGE_BASE_DOCUMENTS_INPUT.members["knowledgeBaseId"], - self.knowledge_base_id, - ) - - if self.data_source_id is not None: - serializer.write_string( - _SCHEMA_LIST_KNOWLEDGE_BASE_DOCUMENTS_INPUT.members["dataSourceId"], - self.data_source_id, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_KNOWLEDGE_BASE_DOCUMENTS_INPUT.members["maxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_KNOWLEDGE_BASE_DOCUMENTS_INPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["knowledge_base_id"] = de.read_string( - _SCHEMA_LIST_KNOWLEDGE_BASE_DOCUMENTS_INPUT.members[ - "knowledgeBaseId" - ] - ) - - case 1: - kwargs["data_source_id"] = de.read_string( - _SCHEMA_LIST_KNOWLEDGE_BASE_DOCUMENTS_INPUT.members[ - "dataSourceId" - ] - ) - - case 2: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_KNOWLEDGE_BASE_DOCUMENTS_INPUT.members[ - "maxResults" - ] - ) - - case 3: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_KNOWLEDGE_BASE_DOCUMENTS_INPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_KNOWLEDGE_BASE_DOCUMENTS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ListKnowledgeBaseDocumentsOutput: - """Dataclass for ListKnowledgeBaseDocumentsOutput structure.""" - - document_details: list[KnowledgeBaseDocumentDetail] - """ - A list of objects, each of which contains information about the - documents that were retrieved. - """ - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, use this token when making another request in - the `nextToken` field to return the next batch of results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_KNOWLEDGE_BASE_DOCUMENTS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_knowledge_base_document_details( - serializer, - _SCHEMA_LIST_KNOWLEDGE_BASE_DOCUMENTS_OUTPUT.members["documentDetails"], - self.document_details, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_KNOWLEDGE_BASE_DOCUMENTS_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["document_details"] = ( - _deserialize_knowledge_base_document_details( - de, - _SCHEMA_LIST_KNOWLEDGE_BASE_DOCUMENTS_OUTPUT.members[ - "documentDetails" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_KNOWLEDGE_BASE_DOCUMENTS_OUTPUT.members[ - "nextToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_KNOWLEDGE_BASE_DOCUMENTS_OUTPUT, consumer=_consumer - ) - if "document_details" not in kwargs: - kwargs["document_details"] = [] - return kwargs - - -LIST_KNOWLEDGE_BASE_DOCUMENTS = APIOperation( - input=ListKnowledgeBaseDocumentsInput, - output=ListKnowledgeBaseDocumentsOutput, - schema=_SCHEMA_LIST_KNOWLEDGE_BASE_DOCUMENTS, - input_schema=_SCHEMA_LIST_KNOWLEDGE_BASE_DOCUMENTS_INPUT, - output_schema=_SCHEMA_LIST_KNOWLEDGE_BASE_DOCUMENTS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class AssociateAgentKnowledgeBaseInput: - """Dataclass for AssociateAgentKnowledgeBaseInput structure.""" - - agent_id: str | None = None - """ - The unique identifier of the agent with which you want to associate the - knowledge base. - """ - - agent_version: str | None = None - """ - The version of the agent with which you want to associate the knowledge - base. - """ - - knowledge_base_id: str | None = None - """The unique identifier of the knowledge base to associate with the agent.""" - - description: str | None = None - """A description of what the agent should use the knowledge base for.""" - - knowledge_base_state: str | None = None - """ - Specifies whether to use the knowledge base or not when sending an - [InvokeAgent](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html) - request. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ASSOCIATE_AGENT_KNOWLEDGE_BASE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.agent_id is not None: - serializer.write_string( - _SCHEMA_ASSOCIATE_AGENT_KNOWLEDGE_BASE_INPUT.members["agentId"], - self.agent_id, - ) - - if self.agent_version is not None: - serializer.write_string( - _SCHEMA_ASSOCIATE_AGENT_KNOWLEDGE_BASE_INPUT.members["agentVersion"], - self.agent_version, - ) - - if self.knowledge_base_id is not None: - serializer.write_string( - _SCHEMA_ASSOCIATE_AGENT_KNOWLEDGE_BASE_INPUT.members["knowledgeBaseId"], - self.knowledge_base_id, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_ASSOCIATE_AGENT_KNOWLEDGE_BASE_INPUT.members["description"], - self.description, - ) - - if self.knowledge_base_state is not None: - serializer.write_string( - _SCHEMA_ASSOCIATE_AGENT_KNOWLEDGE_BASE_INPUT.members[ - "knowledgeBaseState" - ], - self.knowledge_base_state, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_id"] = de.read_string( - _SCHEMA_ASSOCIATE_AGENT_KNOWLEDGE_BASE_INPUT.members["agentId"] - ) - - case 1: - kwargs["agent_version"] = de.read_string( - _SCHEMA_ASSOCIATE_AGENT_KNOWLEDGE_BASE_INPUT.members[ - "agentVersion" - ] - ) - - case 2: - kwargs["knowledge_base_id"] = de.read_string( - _SCHEMA_ASSOCIATE_AGENT_KNOWLEDGE_BASE_INPUT.members[ - "knowledgeBaseId" - ] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_ASSOCIATE_AGENT_KNOWLEDGE_BASE_INPUT.members[ - "description" - ] - ) - - case 4: - kwargs["knowledge_base_state"] = KnowledgeBaseState( - de.read_string( - _SCHEMA_ASSOCIATE_AGENT_KNOWLEDGE_BASE_INPUT.members[ - "knowledgeBaseState" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ASSOCIATE_AGENT_KNOWLEDGE_BASE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class AssociateAgentKnowledgeBaseOutput: - """Dataclass for AssociateAgentKnowledgeBaseOutput structure.""" - - agent_knowledge_base: AgentKnowledgeBase - """ - Contains details about the knowledge base that has been associated with - the agent. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ASSOCIATE_AGENT_KNOWLEDGE_BASE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_ASSOCIATE_AGENT_KNOWLEDGE_BASE_OUTPUT.members["agentKnowledgeBase"], - self.agent_knowledge_base, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_knowledge_base"] = AgentKnowledgeBase.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ASSOCIATE_AGENT_KNOWLEDGE_BASE_OUTPUT, consumer=_consumer - ) - if "agent_knowledge_base" not in kwargs: - kwargs["agent_knowledge_base"] = AgentKnowledgeBase._smithy_default() - return kwargs - - -ASSOCIATE_AGENT_KNOWLEDGE_BASE = APIOperation( - input=AssociateAgentKnowledgeBaseInput, - output=AssociateAgentKnowledgeBaseOutput, - schema=_SCHEMA_ASSOCIATE_AGENT_KNOWLEDGE_BASE, - input_schema=_SCHEMA_ASSOCIATE_AGENT_KNOWLEDGE_BASE_INPUT, - output_schema=_SCHEMA_ASSOCIATE_AGENT_KNOWLEDGE_BASE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrockagent#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class KendraKnowledgeBaseConfiguration: - """Settings for an Amazon Kendra knowledge base.""" - - kendra_index_arn: str - """The ARN of the Amazon Kendra index.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KENDRA_KNOWLEDGE_BASE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_KENDRA_KNOWLEDGE_BASE_CONFIGURATION.members["kendraIndexArn"], - self.kendra_index_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["kendra_index_arn"] = de.read_string( - _SCHEMA_KENDRA_KNOWLEDGE_BASE_CONFIGURATION.members[ - "kendraIndexArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_KENDRA_KNOWLEDGE_BASE_CONFIGURATION, consumer=_consumer - ) - if "kendra_index_arn" not in kwargs: - kwargs["kendra_index_arn"] = "" - return kwargs - - -@dataclass(kw_only=True) -class AudioSegmentationConfiguration: - """ - Configuration for segmenting audio content during multimodal knowledge - base ingestion. Determines how audio files are divided into chunks for - processing. - """ - - fixed_length_duration: int - """ - The duration in seconds for each audio segment. Audio files will be - divided into chunks of this length for processing. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUDIO_SEGMENTATION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer( - _SCHEMA_AUDIO_SEGMENTATION_CONFIGURATION.members["fixedLengthDuration"], - self.fixed_length_duration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["fixed_length_duration"] = de.read_integer( - _SCHEMA_AUDIO_SEGMENTATION_CONFIGURATION.members[ - "fixedLengthDuration" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUDIO_SEGMENTATION_CONFIGURATION, consumer=_consumer - ) - if "fixed_length_duration" not in kwargs: - kwargs["fixed_length_duration"] = 0 - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(fixed_length_duration=0) - - -@dataclass(kw_only=True) -class AudioConfiguration: - """ - Configuration settings for processing audio content in multimodal - knowledge bases. - """ - - segmentation_configuration: AudioSegmentationConfiguration - """Configuration for segmenting audio content during processing.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUDIO_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUDIO_CONFIGURATION.members["segmentationConfiguration"], - self.segmentation_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["segmentation_configuration"] = ( - AudioSegmentationConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AUDIO_CONFIGURATION, consumer=_consumer) - if "segmentation_configuration" not in kwargs: - kwargs["segmentation_configuration"] = ( - AudioSegmentationConfiguration._smithy_default() - ) - return kwargs - - -def _serialize_audio_configurations( - serializer: ShapeSerializer, schema: Schema, value: list[AudioConfiguration] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_audio_configurations( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AudioConfiguration]: - result: list[AudioConfiguration] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AudioConfiguration.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class EmbeddingDataType(UnknownEnumMixin, StrEnum): - """Bedrock models embedding data type. Can be either float32 or binary.""" - - FLOAT32 = "FLOAT32" - BINARY = "BINARY" - - -@dataclass(kw_only=True) -class VideoSegmentationConfiguration: - """ - Configuration for segmenting video content during multimodal knowledge - base ingestion. Determines how video files are divided into chunks for - processing. - """ - - fixed_length_duration: int - """ - The duration in seconds for each video segment. Video files will be - divided into chunks of this length for processing. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VIDEO_SEGMENTATION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer( - _SCHEMA_VIDEO_SEGMENTATION_CONFIGURATION.members["fixedLengthDuration"], - self.fixed_length_duration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["fixed_length_duration"] = de.read_integer( - _SCHEMA_VIDEO_SEGMENTATION_CONFIGURATION.members[ - "fixedLengthDuration" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_VIDEO_SEGMENTATION_CONFIGURATION, consumer=_consumer - ) - if "fixed_length_duration" not in kwargs: - kwargs["fixed_length_duration"] = 0 - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(fixed_length_duration=0) - - -@dataclass(kw_only=True) -class VideoConfiguration: - """ - Configuration settings for processing video content in multimodal - knowledge bases. - """ - - segmentation_configuration: VideoSegmentationConfiguration - """Configuration for segmenting video content during processing.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VIDEO_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_VIDEO_CONFIGURATION.members["segmentationConfiguration"], - self.segmentation_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["segmentation_configuration"] = ( - VideoSegmentationConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VIDEO_CONFIGURATION, consumer=_consumer) - if "segmentation_configuration" not in kwargs: - kwargs["segmentation_configuration"] = ( - VideoSegmentationConfiguration._smithy_default() - ) - return kwargs - - -def _serialize_video_configurations( - serializer: ShapeSerializer, schema: Schema, value: list[VideoConfiguration] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_video_configurations( - deserializer: ShapeDeserializer, schema: Schema -) -> list[VideoConfiguration]: - result: list[VideoConfiguration] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(VideoConfiguration.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class BedrockEmbeddingModelConfiguration: - """The vector configuration details for the Bedrock embeddings model.""" - - dimensions: int | None = None - """ - The dimensions details for the vector configuration used on the Bedrock - embeddings model. - """ - - embedding_data_type: str | None = None - """ - The data type for the vectors when using a model to convert text into - vector embeddings. The model must support the specified data type for - vector embeddings. Floating-point (float32) is the default data type, - and is supported by most models for vector embeddings. See [Supported - embeddings - models](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-supported.html) - for information on the available models and their vector data types. - """ - - audio: list[AudioConfiguration] | None = None - """ - Configuration settings for processing audio content in multimodal - knowledge bases. - - Warning: - This field is deprecated. Use `modelConfiguration` instead. - """ - - video: list[VideoConfiguration] | None = None - """ - Configuration settings for processing video content in multimodal - knowledge bases. - - Warning: - This field is deprecated. Use `modelConfiguration` instead. - """ - - model_configuration: Document | None = None - """ - Model-specific configuration for the embedding model, provided as a JSON - object. Use this field to specify settings that apply to the embedding - model that you selected, such as how audio and video files are divided - into segments. - - The fields that this object accepts depend on the embedding model. For - the settings that each model accepts, see the documentation for that - model. - - For an example of a - [CreateKnowledgeBase](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_CreateKnowledgeBase.html) - request that uses this field to configure a multimodal embedding model, - see the - [Examples](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_CreateKnowledgeBase.html#API_agent_CreateKnowledgeBase_Examples) - section of - [CreateKnowledgeBase](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_CreateKnowledgeBase.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BEDROCK_EMBEDDING_MODEL_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.dimensions is not None: - serializer.write_integer( - _SCHEMA_BEDROCK_EMBEDDING_MODEL_CONFIGURATION.members["dimensions"], - self.dimensions, - ) - - if self.embedding_data_type is not None: - serializer.write_string( - _SCHEMA_BEDROCK_EMBEDDING_MODEL_CONFIGURATION.members[ - "embeddingDataType" - ], - self.embedding_data_type, - ) - - if self.audio is not None: - _serialize_audio_configurations( - serializer, - _SCHEMA_BEDROCK_EMBEDDING_MODEL_CONFIGURATION.members["audio"], - self.audio, - ) - - if self.video is not None: - _serialize_video_configurations( - serializer, - _SCHEMA_BEDROCK_EMBEDDING_MODEL_CONFIGURATION.members["video"], - self.video, - ) - - if self.model_configuration is not None: - serializer.write_document( - _SCHEMA_BEDROCK_EMBEDDING_MODEL_CONFIGURATION.members[ - "modelConfiguration" - ], - self.model_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["dimensions"] = de.read_integer( - _SCHEMA_BEDROCK_EMBEDDING_MODEL_CONFIGURATION.members[ - "dimensions" - ] - ) - - case 1: - kwargs["embedding_data_type"] = EmbeddingDataType( - de.read_string( - _SCHEMA_BEDROCK_EMBEDDING_MODEL_CONFIGURATION.members[ - "embeddingDataType" - ] - ) - ) - - case 2: - kwargs["audio"] = _deserialize_audio_configurations( - de, - _SCHEMA_BEDROCK_EMBEDDING_MODEL_CONFIGURATION.members["audio"], - ) - - case 3: - kwargs["video"] = _deserialize_video_configurations( - de, - _SCHEMA_BEDROCK_EMBEDDING_MODEL_CONFIGURATION.members["video"], - ) - - case 4: - kwargs["model_configuration"] = de.read_document( - _SCHEMA_BEDROCK_EMBEDDING_MODEL_CONFIGURATION.members[ - "modelConfiguration" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_BEDROCK_EMBEDDING_MODEL_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class EmbeddingModelConfiguration: - """The configuration details for the embeddings model.""" - - bedrock_embedding_model_configuration: BedrockEmbeddingModelConfiguration | None = ( - None - ) - """The vector configuration details on the Bedrock embeddings model.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EMBEDDING_MODEL_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.bedrock_embedding_model_configuration is not None: - serializer.write_struct( - _SCHEMA_EMBEDDING_MODEL_CONFIGURATION.members[ - "bedrockEmbeddingModelConfiguration" - ], - self.bedrock_embedding_model_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bedrock_embedding_model_configuration"] = ( - BedrockEmbeddingModelConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EMBEDDING_MODEL_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -class EmbeddingModelType(UnknownEnumMixin, StrEnum): - """ - Choose `CUSTOM` to provide your own Bedrock embedding model ARN. Choose - `MANAGED` to use a service-managed embedding model. For more - information, see [Embedding model - options](https://docs.aws.amazon.com/bedrock/latest/userguide/kb-managed-create.html#kb-managed-embedding-models). - """ - - CUSTOM = "CUSTOM" - MANAGED = "MANAGED" - - -class SupplementalDataStorageLocationType(UnknownEnumMixin, StrEnum): - S3 = "S3" - - -@dataclass(kw_only=True) -class SupplementalDataStorageLocation: - """ - Contains information about a storage location for multimedia content - (images, audio, and video) extracted from multimodal documents in your - data source. - """ - - type: str - """Specifies the storage service used for this location.""" - - s3_location: S3Location | None = None - """ - Contains information about the Amazon S3 location for the extracted - multimedia content. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SUPPLEMENTAL_DATA_STORAGE_LOCATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SUPPLEMENTAL_DATA_STORAGE_LOCATION.members["type"], self.type - ) - if self.s3_location is not None: - serializer.write_struct( - _SCHEMA_SUPPLEMENTAL_DATA_STORAGE_LOCATION.members["s3Location"], - self.s3_location, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = SupplementalDataStorageLocationType( - de.read_string( - _SCHEMA_SUPPLEMENTAL_DATA_STORAGE_LOCATION.members["type"] - ) - ) - - case 1: - kwargs["s3_location"] = S3Location.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SUPPLEMENTAL_DATA_STORAGE_LOCATION, consumer=_consumer - ) - if "type" not in kwargs: - kwargs["type"] = SupplementalDataStorageLocationType._corrected("") - return kwargs - - -def _serialize_supplemental_data_storage_locations( - serializer: ShapeSerializer, - schema: Schema, - value: list[SupplementalDataStorageLocation], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_supplemental_data_storage_locations( - deserializer: ShapeDeserializer, schema: Schema -) -> list[SupplementalDataStorageLocation]: - result: list[SupplementalDataStorageLocation] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(SupplementalDataStorageLocation.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class SupplementalDataStorageConfiguration: - """ - Specifies configurations for the storage location of multimedia content - (images, audio, and video) extracted from multimodal documents in your - data source. This content can be retrieved and returned to the end user - with timestamp references for audio and video segments. - """ - - storage_locations: list[SupplementalDataStorageLocation] - """ - A list of objects specifying storage locations for multimedia content - (images, audio, and video) extracted from multimodal documents in your - data source. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SUPPLEMENTAL_DATA_STORAGE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_supplemental_data_storage_locations( - serializer, - _SCHEMA_SUPPLEMENTAL_DATA_STORAGE_CONFIGURATION.members["storageLocations"], - self.storage_locations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["storage_locations"] = ( - _deserialize_supplemental_data_storage_locations( - de, - _SCHEMA_SUPPLEMENTAL_DATA_STORAGE_CONFIGURATION.members[ - "storageLocations" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SUPPLEMENTAL_DATA_STORAGE_CONFIGURATION, consumer=_consumer - ) - if "storage_locations" not in kwargs: - kwargs["storage_locations"] = [] - return kwargs - - -@dataclass(kw_only=True) -class ManagedKnowledgeBaseConfiguration: - """Configurations for a managed knowledge base.""" - - embedding_model_type: str | None = None - """ - Choose CUSTOM to provide your own Bedrock embedding model ARN. Choose - MANAGED to use a service-managed embedding model. - """ - - embedding_model_arn: str | None = None - """The ARN for the embeddings model.""" - - embedding_model_configuration: EmbeddingModelConfiguration | None = None - """ - The configuration details for the embeddings model. Not required when - choosing the MANAGED embeddingModelType. - """ - - server_side_encryption_configuration: ServerSideEncryptionConfiguration | None = ( - None - ) - """ - Contains the configuration for server-side encryption for your managed - knowledge base. - """ - - supplemental_data_storage_configuration: ( - SupplementalDataStorageConfiguration | None - ) = None - """ - Use this object to specify the Amazon S3 location that the knowledge - base uses to process and ingest multimodal content. This field is - required when you use a native multimodal embedding model. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MANAGED_KNOWLEDGE_BASE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.embedding_model_type is not None: - serializer.write_string( - _SCHEMA_MANAGED_KNOWLEDGE_BASE_CONFIGURATION.members[ - "embeddingModelType" - ], - self.embedding_model_type, - ) - - if self.embedding_model_arn is not None: - serializer.write_string( - _SCHEMA_MANAGED_KNOWLEDGE_BASE_CONFIGURATION.members[ - "embeddingModelArn" - ], - self.embedding_model_arn, - ) - - if self.embedding_model_configuration is not None: - serializer.write_struct( - _SCHEMA_MANAGED_KNOWLEDGE_BASE_CONFIGURATION.members[ - "embeddingModelConfiguration" - ], - self.embedding_model_configuration, - ) - - if self.server_side_encryption_configuration is not None: - serializer.write_struct( - _SCHEMA_MANAGED_KNOWLEDGE_BASE_CONFIGURATION.members[ - "serverSideEncryptionConfiguration" - ], - self.server_side_encryption_configuration, - ) - - if self.supplemental_data_storage_configuration is not None: - serializer.write_struct( - _SCHEMA_MANAGED_KNOWLEDGE_BASE_CONFIGURATION.members[ - "supplementalDataStorageConfiguration" - ], - self.supplemental_data_storage_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["embedding_model_type"] = EmbeddingModelType( - de.read_string( - _SCHEMA_MANAGED_KNOWLEDGE_BASE_CONFIGURATION.members[ - "embeddingModelType" - ] - ) - ) - - case 1: - kwargs["embedding_model_arn"] = de.read_string( - _SCHEMA_MANAGED_KNOWLEDGE_BASE_CONFIGURATION.members[ - "embeddingModelArn" - ] - ) - - case 2: - kwargs["embedding_model_configuration"] = ( - EmbeddingModelConfiguration.deserialize(de) - ) - - case 3: - kwargs["server_side_encryption_configuration"] = ( - ServerSideEncryptionConfiguration.deserialize(de) - ) - - case 4: - kwargs["supplemental_data_storage_configuration"] = ( - SupplementalDataStorageConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MANAGED_KNOWLEDGE_BASE_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -class RedshiftProvisionedAuthType(UnknownEnumMixin, StrEnum): - IAM = "IAM" - USERNAME_PASSWORD = "USERNAME_PASSWORD" - USERNAME = "USERNAME" - - -@dataclass(kw_only=True) -class RedshiftProvisionedAuthConfiguration: - """ - Contains configurations for authentication to an Amazon Redshift - provisioned data warehouse. Specify the type of authentication to use in - the `type` field and include the corresponding field. If you specify IAM - authentication, you don't need to include another field. - """ - - type: str - """The type of authentication to use.""" - - database_user: str | None = None - """ - The database username for authentication to an Amazon Redshift - provisioned data warehouse. - """ - - username_password_secret_arn: str | None = None - """The ARN of an Secrets Manager secret for authentication.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REDSHIFT_PROVISIONED_AUTH_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_REDSHIFT_PROVISIONED_AUTH_CONFIGURATION.members["type"], self.type - ) - if self.database_user is not None: - serializer.write_string( - _SCHEMA_REDSHIFT_PROVISIONED_AUTH_CONFIGURATION.members["databaseUser"], - self.database_user, - ) - - if self.username_password_secret_arn is not None: - serializer.write_string( - _SCHEMA_REDSHIFT_PROVISIONED_AUTH_CONFIGURATION.members[ - "usernamePasswordSecretArn" - ], - self.username_password_secret_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = RedshiftProvisionedAuthType( - de.read_string( - _SCHEMA_REDSHIFT_PROVISIONED_AUTH_CONFIGURATION.members[ - "type" - ] - ) - ) - - case 1: - kwargs["database_user"] = de.read_string( - _SCHEMA_REDSHIFT_PROVISIONED_AUTH_CONFIGURATION.members[ - "databaseUser" - ] - ) - - case 2: - kwargs["username_password_secret_arn"] = de.read_string( - _SCHEMA_REDSHIFT_PROVISIONED_AUTH_CONFIGURATION.members[ - "usernamePasswordSecretArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_REDSHIFT_PROVISIONED_AUTH_CONFIGURATION, consumer=_consumer - ) - if "type" not in kwargs: - kwargs["type"] = RedshiftProvisionedAuthType._corrected("") - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(type=RedshiftProvisionedAuthType._corrected("")) - - -@dataclass(kw_only=True) -class RedshiftProvisionedConfiguration: - """Contains configurations for a provisioned Amazon Redshift query engine.""" - - cluster_identifier: str - """The ID of the Amazon Redshift cluster.""" - - auth_configuration: RedshiftProvisionedAuthConfiguration - """Specifies configurations for authentication to Amazon Redshift.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REDSHIFT_PROVISIONED_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_REDSHIFT_PROVISIONED_CONFIGURATION.members["clusterIdentifier"], - self.cluster_identifier, - ) - serializer.write_struct( - _SCHEMA_REDSHIFT_PROVISIONED_CONFIGURATION.members["authConfiguration"], - self.auth_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["cluster_identifier"] = de.read_string( - _SCHEMA_REDSHIFT_PROVISIONED_CONFIGURATION.members[ - "clusterIdentifier" - ] - ) - - case 1: - kwargs["auth_configuration"] = ( - RedshiftProvisionedAuthConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_REDSHIFT_PROVISIONED_CONFIGURATION, consumer=_consumer - ) - if "cluster_identifier" not in kwargs: - kwargs["cluster_identifier"] = "" - if "auth_configuration" not in kwargs: - kwargs["auth_configuration"] = ( - RedshiftProvisionedAuthConfiguration._smithy_default() - ) - return kwargs - - -class RedshiftServerlessAuthType(UnknownEnumMixin, StrEnum): - IAM = "IAM" - USERNAME_PASSWORD = "USERNAME_PASSWORD" - - -@dataclass(kw_only=True) -class RedshiftServerlessAuthConfiguration: - """ - Specifies configurations for authentication to a Redshift Serverless. - Specify the type of authentication to use in the `type` field and - include the corresponding field. If you specify IAM authentication, you - don't need to include another field. - """ - - type: str - """The type of authentication to use.""" - - username_password_secret_arn: str | None = None - """The ARN of an Secrets Manager secret for authentication.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REDSHIFT_SERVERLESS_AUTH_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_REDSHIFT_SERVERLESS_AUTH_CONFIGURATION.members["type"], self.type - ) - if self.username_password_secret_arn is not None: - serializer.write_string( - _SCHEMA_REDSHIFT_SERVERLESS_AUTH_CONFIGURATION.members[ - "usernamePasswordSecretArn" - ], - self.username_password_secret_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = RedshiftServerlessAuthType( - de.read_string( - _SCHEMA_REDSHIFT_SERVERLESS_AUTH_CONFIGURATION.members[ - "type" - ] - ) - ) - - case 1: - kwargs["username_password_secret_arn"] = de.read_string( - _SCHEMA_REDSHIFT_SERVERLESS_AUTH_CONFIGURATION.members[ - "usernamePasswordSecretArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_REDSHIFT_SERVERLESS_AUTH_CONFIGURATION, consumer=_consumer - ) - if "type" not in kwargs: - kwargs["type"] = RedshiftServerlessAuthType._corrected("") - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(type=RedshiftServerlessAuthType._corrected("")) - - -@dataclass(kw_only=True) -class RedshiftServerlessConfiguration: - """ - Contains configurations for authentication to Amazon Redshift - Serverless. - """ - - workgroup_arn: str - """The ARN of the Amazon Redshift workgroup.""" - - auth_configuration: RedshiftServerlessAuthConfiguration - """ - Specifies configurations for authentication to an Amazon Redshift - provisioned data warehouse. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REDSHIFT_SERVERLESS_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_REDSHIFT_SERVERLESS_CONFIGURATION.members["workgroupArn"], - self.workgroup_arn, - ) - serializer.write_struct( - _SCHEMA_REDSHIFT_SERVERLESS_CONFIGURATION.members["authConfiguration"], - self.auth_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["workgroup_arn"] = de.read_string( - _SCHEMA_REDSHIFT_SERVERLESS_CONFIGURATION.members[ - "workgroupArn" - ] - ) - - case 1: - kwargs["auth_configuration"] = ( - RedshiftServerlessAuthConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_REDSHIFT_SERVERLESS_CONFIGURATION, consumer=_consumer - ) - if "workgroup_arn" not in kwargs: - kwargs["workgroup_arn"] = "" - if "auth_configuration" not in kwargs: - kwargs["auth_configuration"] = ( - RedshiftServerlessAuthConfiguration._smithy_default() - ) - return kwargs - - -class RedshiftQueryEngineType(UnknownEnumMixin, StrEnum): - SERVERLESS = "SERVERLESS" - PROVISIONED = "PROVISIONED" - - -@dataclass(kw_only=True) -class RedshiftQueryEngineConfiguration: - """ - Contains configurations for an Amazon Redshift query engine. Specify the - type of query engine in `type` and include the corresponding field. For - more information, see [Build a knowledge base by connecting to a - structured data - source](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-build-structured.html) - in the Amazon Bedrock User Guide. - """ - - type: str - """The type of query engine.""" - - serverless_configuration: RedshiftServerlessConfiguration | None = None - """Specifies configurations for a serverless Amazon Redshift query engine.""" - - provisioned_configuration: RedshiftProvisionedConfiguration | None = None - """Specifies configurations for a provisioned Amazon Redshift query engine.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REDSHIFT_QUERY_ENGINE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_REDSHIFT_QUERY_ENGINE_CONFIGURATION.members["type"], self.type - ) - if self.serverless_configuration is not None: - serializer.write_struct( - _SCHEMA_REDSHIFT_QUERY_ENGINE_CONFIGURATION.members[ - "serverlessConfiguration" - ], - self.serverless_configuration, - ) - - if self.provisioned_configuration is not None: - serializer.write_struct( - _SCHEMA_REDSHIFT_QUERY_ENGINE_CONFIGURATION.members[ - "provisionedConfiguration" - ], - self.provisioned_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = RedshiftQueryEngineType( - de.read_string( - _SCHEMA_REDSHIFT_QUERY_ENGINE_CONFIGURATION.members["type"] - ) - ) - - case 1: - kwargs["serverless_configuration"] = ( - RedshiftServerlessConfiguration.deserialize(de) - ) - - case 2: - kwargs["provisioned_configuration"] = ( - RedshiftProvisionedConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_REDSHIFT_QUERY_ENGINE_CONFIGURATION, consumer=_consumer - ) - if "type" not in kwargs: - kwargs["type"] = RedshiftQueryEngineType._corrected("") - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(type=RedshiftQueryEngineType._corrected("")) - - -@dataclass(kw_only=True) -class CuratedQuery: - """ - Contains configurations for a query, each of which defines information - about example queries to help the query engine generate appropriate SQL - queries. - """ - - natural_language: str - """An example natural language query.""" - - sql: str - """The SQL equivalent of the natural language query.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CURATED_QUERY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CURATED_QUERY.members["naturalLanguage"], self.natural_language - ) - serializer.write_string(_SCHEMA_CURATED_QUERY.members["sql"], self.sql) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["natural_language"] = de.read_string( - _SCHEMA_CURATED_QUERY.members["naturalLanguage"] - ) - - case 1: - kwargs["sql"] = de.read_string(_SCHEMA_CURATED_QUERY.members["sql"]) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CURATED_QUERY, consumer=_consumer) - if "natural_language" not in kwargs: - kwargs["natural_language"] = "" - if "sql" not in kwargs: - kwargs["sql"] = "" - return kwargs - - -def _serialize_curated_queries( - serializer: ShapeSerializer, schema: Schema, value: list[CuratedQuery] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_curated_queries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[CuratedQuery]: - result: list[CuratedQuery] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(CuratedQuery.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class IncludeExclude(UnknownEnumMixin, StrEnum): - INCLUDE = "INCLUDE" - EXCLUDE = "EXCLUDE" - - -@dataclass(kw_only=True) -class QueryGenerationColumn: - """ - Contains information about a column in the current table for the query - engine to consider. - """ - - name: str | None = None - """The name of the column for which the other fields in this object apply.""" - - description: str | None = None - """ - A description of the column that helps the query engine understand the - contents of the column. - """ - - inclusion: str | None = None - """ - Specifies whether to include or exclude the column during query - generation. If you specify `EXCLUDE`, the column will be ignored. If you - specify `INCLUDE`, all other columns in the table will be ignored. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_QUERY_GENERATION_COLUMN, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_QUERY_GENERATION_COLUMN.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_QUERY_GENERATION_COLUMN.members["description"], self.description - ) - - if self.inclusion is not None: - serializer.write_string( - _SCHEMA_QUERY_GENERATION_COLUMN.members["inclusion"], self.inclusion - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_QUERY_GENERATION_COLUMN.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_QUERY_GENERATION_COLUMN.members["description"] - ) - - case 2: - kwargs["inclusion"] = IncludeExclude( - de.read_string( - _SCHEMA_QUERY_GENERATION_COLUMN.members["inclusion"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_QUERY_GENERATION_COLUMN, consumer=_consumer) - return kwargs - - -def _serialize_query_generation_columns( - serializer: ShapeSerializer, schema: Schema, value: list[QueryGenerationColumn] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_query_generation_columns( - deserializer: ShapeDeserializer, schema: Schema -) -> list[QueryGenerationColumn]: - result: list[QueryGenerationColumn] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(QueryGenerationColumn.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class QueryGenerationTable: - """Contains information about a table for the query engine to consider.""" - - name: str - """The name of the table for which the other fields in this object apply.""" - - description: str | None = None - """ - A description of the table that helps the query engine understand the - contents of the table. - """ - - inclusion: str | None = None - """ - Specifies whether to include or exclude the table during query - generation. If you specify `EXCLUDE`, the table will be ignored. If you - specify `INCLUDE`, all other tables will be ignored. - """ - - columns: list[QueryGenerationColumn] | None = None - """ - An array of objects, each of which defines information about a column in - the table. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_QUERY_GENERATION_TABLE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_QUERY_GENERATION_TABLE.members["name"], self.name - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_QUERY_GENERATION_TABLE.members["description"], self.description - ) - - if self.inclusion is not None: - serializer.write_string( - _SCHEMA_QUERY_GENERATION_TABLE.members["inclusion"], self.inclusion - ) - - if self.columns is not None: - _serialize_query_generation_columns( - serializer, - _SCHEMA_QUERY_GENERATION_TABLE.members["columns"], - self.columns, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_QUERY_GENERATION_TABLE.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_QUERY_GENERATION_TABLE.members["description"] - ) - - case 2: - kwargs["inclusion"] = IncludeExclude( - de.read_string( - _SCHEMA_QUERY_GENERATION_TABLE.members["inclusion"] - ) - ) - - case 3: - kwargs["columns"] = _deserialize_query_generation_columns( - de, _SCHEMA_QUERY_GENERATION_TABLE.members["columns"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_QUERY_GENERATION_TABLE, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - return kwargs - - -def _serialize_query_generation_tables( - serializer: ShapeSerializer, schema: Schema, value: list[QueryGenerationTable] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_query_generation_tables( - deserializer: ShapeDeserializer, schema: Schema -) -> list[QueryGenerationTable]: - result: list[QueryGenerationTable] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(QueryGenerationTable.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class QueryGenerationContext: - """>Contains configurations for context to use during query generation.""" - - tables: list[QueryGenerationTable] | None = None - """ - An array of objects, each of which defines information about a table in - the database. - """ - - curated_queries: list[CuratedQuery] | None = None - """ - An array of objects, each of which defines information about example - queries to help the query engine generate appropriate SQL queries. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_QUERY_GENERATION_CONTEXT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.tables is not None: - _serialize_query_generation_tables( - serializer, - _SCHEMA_QUERY_GENERATION_CONTEXT.members["tables"], - self.tables, - ) - - if self.curated_queries is not None: - _serialize_curated_queries( - serializer, - _SCHEMA_QUERY_GENERATION_CONTEXT.members["curatedQueries"], - self.curated_queries, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["tables"] = _deserialize_query_generation_tables( - de, _SCHEMA_QUERY_GENERATION_CONTEXT.members["tables"] - ) - - case 1: - kwargs["curated_queries"] = _deserialize_curated_queries( - de, _SCHEMA_QUERY_GENERATION_CONTEXT.members["curatedQueries"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_QUERY_GENERATION_CONTEXT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class QueryGenerationConfiguration: - """ - Contains configurations for query generation. For more information, see - [Build a knowledge base by connecting to a structured data - source](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-build-structured.html) - in the Amazon Bedrock User Guide.. - """ - - execution_timeout_seconds: int | None = None - """The time after which query generation will time out.""" - - generation_context: QueryGenerationContext | None = field(repr=False, default=None) - """Specifies configurations for context to use during query generation.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_QUERY_GENERATION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.execution_timeout_seconds is not None: - serializer.write_integer( - _SCHEMA_QUERY_GENERATION_CONFIGURATION.members[ - "executionTimeoutSeconds" - ], - self.execution_timeout_seconds, - ) - - if self.generation_context is not None: - serializer.write_struct( - _SCHEMA_QUERY_GENERATION_CONFIGURATION.members["generationContext"], - self.generation_context, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["execution_timeout_seconds"] = de.read_integer( - _SCHEMA_QUERY_GENERATION_CONFIGURATION.members[ - "executionTimeoutSeconds" - ] - ) - - case 1: - kwargs["generation_context"] = QueryGenerationContext.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_QUERY_GENERATION_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -def _serialize_aws_data_catalog_table_names( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_aws_data_catalog_table_names( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class RedshiftQueryEngineAwsDataCatalogStorageConfiguration: - """Contains configurations for storage in Glue Data Catalog.""" - - table_names: list[str] - """A list of names of the tables to use.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_REDSHIFT_QUERY_ENGINE_AWS_DATA_CATALOG_STORAGE_CONFIGURATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_aws_data_catalog_table_names( - serializer, - _SCHEMA_REDSHIFT_QUERY_ENGINE_AWS_DATA_CATALOG_STORAGE_CONFIGURATION.members[ - "tableNames" - ], - self.table_names, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["table_names"] = _deserialize_aws_data_catalog_table_names( - de, - _SCHEMA_REDSHIFT_QUERY_ENGINE_AWS_DATA_CATALOG_STORAGE_CONFIGURATION.members[ - "tableNames" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_REDSHIFT_QUERY_ENGINE_AWS_DATA_CATALOG_STORAGE_CONFIGURATION, - consumer=_consumer, - ) - if "table_names" not in kwargs: - kwargs["table_names"] = [] - return kwargs - - -@dataclass(kw_only=True) -class RedshiftQueryEngineRedshiftStorageConfiguration: - """Contains configurations for storage in Amazon Redshift.""" - - database_name: str - """The name of the Amazon Redshift database.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_REDSHIFT_QUERY_ENGINE_REDSHIFT_STORAGE_CONFIGURATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_REDSHIFT_QUERY_ENGINE_REDSHIFT_STORAGE_CONFIGURATION.members[ - "databaseName" - ], - self.database_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["database_name"] = de.read_string( - _SCHEMA_REDSHIFT_QUERY_ENGINE_REDSHIFT_STORAGE_CONFIGURATION.members[ - "databaseName" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_REDSHIFT_QUERY_ENGINE_REDSHIFT_STORAGE_CONFIGURATION, - consumer=_consumer, - ) - if "database_name" not in kwargs: - kwargs["database_name"] = "" - return kwargs - - -class RedshiftQueryEngineStorageType(UnknownEnumMixin, StrEnum): - REDSHIFT = "REDSHIFT" - AWS_DATA_CATALOG = "AWS_DATA_CATALOG" - - -@dataclass(kw_only=True) -class RedshiftQueryEngineStorageConfiguration: - """ - Contains configurations for Amazon Redshift data storage. Specify the - data storage service to use in the `type` field and include the - corresponding field. For more information, see [Build a knowledge base - by connecting to a structured data - source](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-build-structured.html) - in the Amazon Bedrock User Guide. - """ - - type: str - """The data storage service to use.""" - - aws_data_catalog_configuration: ( - RedshiftQueryEngineAwsDataCatalogStorageConfiguration | None - ) = None - """Specifies configurations for storage in Glue Data Catalog.""" - - redshift_configuration: RedshiftQueryEngineRedshiftStorageConfiguration | None = ( - None - ) - """Specifies configurations for storage in Amazon Redshift.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_REDSHIFT_QUERY_ENGINE_STORAGE_CONFIGURATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_REDSHIFT_QUERY_ENGINE_STORAGE_CONFIGURATION.members["type"], - self.type, - ) - if self.aws_data_catalog_configuration is not None: - serializer.write_struct( - _SCHEMA_REDSHIFT_QUERY_ENGINE_STORAGE_CONFIGURATION.members[ - "awsDataCatalogConfiguration" - ], - self.aws_data_catalog_configuration, - ) - - if self.redshift_configuration is not None: - serializer.write_struct( - _SCHEMA_REDSHIFT_QUERY_ENGINE_STORAGE_CONFIGURATION.members[ - "redshiftConfiguration" - ], - self.redshift_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = RedshiftQueryEngineStorageType( - de.read_string( - _SCHEMA_REDSHIFT_QUERY_ENGINE_STORAGE_CONFIGURATION.members[ - "type" - ] - ) - ) - - case 1: - kwargs["aws_data_catalog_configuration"] = ( - RedshiftQueryEngineAwsDataCatalogStorageConfiguration.deserialize( - de - ) - ) - - case 2: - kwargs["redshift_configuration"] = ( - RedshiftQueryEngineRedshiftStorageConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_REDSHIFT_QUERY_ENGINE_STORAGE_CONFIGURATION, consumer=_consumer - ) - if "type" not in kwargs: - kwargs["type"] = RedshiftQueryEngineStorageType._corrected("") - return kwargs - - -def _serialize_redshift_query_engine_storage_configurations( - serializer: ShapeSerializer, - schema: Schema, - value: list[RedshiftQueryEngineStorageConfiguration], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_redshift_query_engine_storage_configurations( - deserializer: ShapeDeserializer, schema: Schema -) -> list[RedshiftQueryEngineStorageConfiguration]: - result: list[RedshiftQueryEngineStorageConfiguration] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(RedshiftQueryEngineStorageConfiguration.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class RedshiftConfiguration: - """ - Contains configurations for an Amazon Redshift database. For more - information, see [Build a knowledge base by connecting to a structured - data - source](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-build-structured.html) - in the Amazon Bedrock User Guide. - """ - - storage_configurations: list[RedshiftQueryEngineStorageConfiguration] - """Specifies configurations for Amazon Redshift database storage.""" - - query_engine_configuration: RedshiftQueryEngineConfiguration - """Specifies configurations for an Amazon Redshift query engine.""" - - query_generation_configuration: QueryGenerationConfiguration | None = None - """Specifies configurations for generating queries.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REDSHIFT_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_redshift_query_engine_storage_configurations( - serializer, - _SCHEMA_REDSHIFT_CONFIGURATION.members["storageConfigurations"], - self.storage_configurations, - ) - serializer.write_struct( - _SCHEMA_REDSHIFT_CONFIGURATION.members["queryEngineConfiguration"], - self.query_engine_configuration, - ) - if self.query_generation_configuration is not None: - serializer.write_struct( - _SCHEMA_REDSHIFT_CONFIGURATION.members["queryGenerationConfiguration"], - self.query_generation_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["storage_configurations"] = ( - _deserialize_redshift_query_engine_storage_configurations( - de, - _SCHEMA_REDSHIFT_CONFIGURATION.members[ - "storageConfigurations" - ], - ) - ) - - case 1: - kwargs["query_engine_configuration"] = ( - RedshiftQueryEngineConfiguration.deserialize(de) - ) - - case 2: - kwargs["query_generation_configuration"] = ( - QueryGenerationConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_REDSHIFT_CONFIGURATION, consumer=_consumer) - if "storage_configurations" not in kwargs: - kwargs["storage_configurations"] = [] - if "query_engine_configuration" not in kwargs: - kwargs["query_engine_configuration"] = ( - RedshiftQueryEngineConfiguration._smithy_default() - ) - return kwargs - - -class QueryEngineType(UnknownEnumMixin, StrEnum): - REDSHIFT = "REDSHIFT" - - -@dataclass(kw_only=True) -class SqlKnowledgeBaseConfiguration: - """ - Contains configurations for a knowledge base connected to an SQL - database. Specify the SQL database type in the `type` field and include - the corresponding field. For more information, see [Build a knowledge - base by connecting to a structured data - source](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-build-structured.html) - in the Amazon Bedrock User Guide. - """ - - type: str - """The type of SQL database to connect to the knowledge base.""" - - redshift_configuration: RedshiftConfiguration | None = None - """ - Specifies configurations for a knowledge base connected to an Amazon - Redshift database. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SQL_KNOWLEDGE_BASE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SQL_KNOWLEDGE_BASE_CONFIGURATION.members["type"], self.type - ) - if self.redshift_configuration is not None: - serializer.write_struct( - _SCHEMA_SQL_KNOWLEDGE_BASE_CONFIGURATION.members[ - "redshiftConfiguration" - ], - self.redshift_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = QueryEngineType( - de.read_string( - _SCHEMA_SQL_KNOWLEDGE_BASE_CONFIGURATION.members["type"] - ) - ) - - case 1: - kwargs["redshift_configuration"] = ( - RedshiftConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SQL_KNOWLEDGE_BASE_CONFIGURATION, consumer=_consumer - ) - if "type" not in kwargs: - kwargs["type"] = QueryEngineType._corrected("") - return kwargs - - -class KnowledgeBaseType(UnknownEnumMixin, StrEnum): - """The type of a knowledge base.""" - - VECTOR = "VECTOR" - KENDRA = "KENDRA" - SQL = "SQL" - MANAGED = "MANAGED" - - -@dataclass(kw_only=True) -class VectorKnowledgeBaseConfiguration: - """ - Contains details about the model used to create vector embeddings for - the knowledge base. - """ - - embedding_model_arn: str - """ - The Amazon Resource Name (ARN) of the model used to create vector - embeddings for the knowledge base. - """ - - embedding_model_configuration: EmbeddingModelConfiguration | None = None - """ - The embeddings model configuration details for the vector model used in - Knowledge Base. - """ - - supplemental_data_storage_configuration: ( - SupplementalDataStorageConfiguration | None - ) = None - """ - If you include multimodal data from your data source, use this object to - specify configurations for the storage location of the images extracted - from your documents. These images can be retrieved and returned to the - end user. They can also be used in generation when using - [RetrieveAndGenerate](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VECTOR_KNOWLEDGE_BASE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_VECTOR_KNOWLEDGE_BASE_CONFIGURATION.members["embeddingModelArn"], - self.embedding_model_arn, - ) - if self.embedding_model_configuration is not None: - serializer.write_struct( - _SCHEMA_VECTOR_KNOWLEDGE_BASE_CONFIGURATION.members[ - "embeddingModelConfiguration" - ], - self.embedding_model_configuration, - ) - - if self.supplemental_data_storage_configuration is not None: - serializer.write_struct( - _SCHEMA_VECTOR_KNOWLEDGE_BASE_CONFIGURATION.members[ - "supplementalDataStorageConfiguration" - ], - self.supplemental_data_storage_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["embedding_model_arn"] = de.read_string( - _SCHEMA_VECTOR_KNOWLEDGE_BASE_CONFIGURATION.members[ - "embeddingModelArn" - ] - ) - - case 1: - kwargs["embedding_model_configuration"] = ( - EmbeddingModelConfiguration.deserialize(de) - ) - - case 2: - kwargs["supplemental_data_storage_configuration"] = ( - SupplementalDataStorageConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_VECTOR_KNOWLEDGE_BASE_CONFIGURATION, consumer=_consumer - ) - if "embedding_model_arn" not in kwargs: - kwargs["embedding_model_arn"] = "" - return kwargs - - -@dataclass(kw_only=True) -class KnowledgeBaseConfiguration: - """ - Contains details about the vector embeddings configuration of the - knowledge base. - """ - - type: str - """ - The type of data that the data source is converted into for the - knowledge base. Choose `MANAGED` to create a managed knowledge base. - """ - - vector_knowledge_base_configuration: VectorKnowledgeBaseConfiguration | None = None - """ - Contains details about the model that's used to convert the data source - into vector embeddings. - """ - - managed_knowledge_base_configuration: ManagedKnowledgeBaseConfiguration | None = ( - None - ) - """ - Contains configuration details for a knowledge base that uses a vector - store fully managed by Amazon Bedrock. Specify this object when the - knowledge base type is MANAGED. - """ - - kendra_knowledge_base_configuration: KendraKnowledgeBaseConfiguration | None = None - """Settings for an Amazon Kendra knowledge base.""" - - sql_knowledge_base_configuration: SqlKnowledgeBaseConfiguration | None = None - """ - Specifies configurations for a knowledge base connected to an SQL - database. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KNOWLEDGE_BASE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_KNOWLEDGE_BASE_CONFIGURATION.members["type"], self.type - ) - if self.vector_knowledge_base_configuration is not None: - serializer.write_struct( - _SCHEMA_KNOWLEDGE_BASE_CONFIGURATION.members[ - "vectorKnowledgeBaseConfiguration" - ], - self.vector_knowledge_base_configuration, - ) - - if self.managed_knowledge_base_configuration is not None: - serializer.write_struct( - _SCHEMA_KNOWLEDGE_BASE_CONFIGURATION.members[ - "managedKnowledgeBaseConfiguration" - ], - self.managed_knowledge_base_configuration, - ) - - if self.kendra_knowledge_base_configuration is not None: - serializer.write_struct( - _SCHEMA_KNOWLEDGE_BASE_CONFIGURATION.members[ - "kendraKnowledgeBaseConfiguration" - ], - self.kendra_knowledge_base_configuration, - ) - - if self.sql_knowledge_base_configuration is not None: - serializer.write_struct( - _SCHEMA_KNOWLEDGE_BASE_CONFIGURATION.members[ - "sqlKnowledgeBaseConfiguration" - ], - self.sql_knowledge_base_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = KnowledgeBaseType( - de.read_string( - _SCHEMA_KNOWLEDGE_BASE_CONFIGURATION.members["type"] - ) - ) - - case 1: - kwargs["vector_knowledge_base_configuration"] = ( - VectorKnowledgeBaseConfiguration.deserialize(de) - ) - - case 2: - kwargs["managed_knowledge_base_configuration"] = ( - ManagedKnowledgeBaseConfiguration.deserialize(de) - ) - - case 3: - kwargs["kendra_knowledge_base_configuration"] = ( - KendraKnowledgeBaseConfiguration.deserialize(de) - ) - - case 4: - kwargs["sql_knowledge_base_configuration"] = ( - SqlKnowledgeBaseConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_KNOWLEDGE_BASE_CONFIGURATION, consumer=_consumer - ) - if "type" not in kwargs: - kwargs["type"] = KnowledgeBaseType._corrected("") - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(type=KnowledgeBaseType._corrected("")) - - -@dataclass(kw_only=True) -class MongoDbAtlasFieldMapping: - """ - Contains the names of the fields to which to map information about the - vector store. - """ - - vector_field: str - """ - The name of the field in which Amazon Bedrock stores the vector - embeddings for your data sources. - """ - - text_field: str - """ - The name of the field in which Amazon Bedrock stores the raw text from - your data. The text is split according to the chunking strategy you - choose. - """ - - metadata_field: str - """ - The name of the field in which Amazon Bedrock stores metadata about the - vector store. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MONGO_DB_ATLAS_FIELD_MAPPING, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MONGO_DB_ATLAS_FIELD_MAPPING.members["vectorField"], - self.vector_field, - ) - serializer.write_string( - _SCHEMA_MONGO_DB_ATLAS_FIELD_MAPPING.members["textField"], self.text_field - ) - serializer.write_string( - _SCHEMA_MONGO_DB_ATLAS_FIELD_MAPPING.members["metadataField"], - self.metadata_field, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["vector_field"] = de.read_string( - _SCHEMA_MONGO_DB_ATLAS_FIELD_MAPPING.members["vectorField"] - ) - - case 1: - kwargs["text_field"] = de.read_string( - _SCHEMA_MONGO_DB_ATLAS_FIELD_MAPPING.members["textField"] - ) - - case 2: - kwargs["metadata_field"] = de.read_string( - _SCHEMA_MONGO_DB_ATLAS_FIELD_MAPPING.members["metadataField"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MONGO_DB_ATLAS_FIELD_MAPPING, consumer=_consumer - ) - if "vector_field" not in kwargs: - kwargs["vector_field"] = "" - if "text_field" not in kwargs: - kwargs["text_field"] = "" - if "metadata_field" not in kwargs: - kwargs["metadata_field"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(vector_field="", text_field="", metadata_field="") - - -@dataclass(kw_only=True) -class MongoDbAtlasConfiguration: - """ - Contains details about the storage configuration of the knowledge base - in MongoDB Atlas. - """ - - endpoint: str - """The endpoint URL of your MongoDB Atlas cluster for your knowledge base.""" - - database_name: str - """The database name in your MongoDB Atlas cluster for your knowledge base.""" - - collection_name: str - """The collection name of the knowledge base in MongoDB Atlas.""" - - vector_index_name: str - """The name of the MongoDB Atlas vector search index.""" - - credentials_secret_arn: str - """ - The Amazon Resource Name (ARN) of the secret that you created in Secrets - Manager that contains user credentials for your MongoDB Atlas cluster. - """ - - field_mapping: MongoDbAtlasFieldMapping - """ - Contains the names of the fields to which to map information about the - vector store. - """ - - endpoint_service_name: str | None = None - """ - The name of the VPC endpoint service in your account that is connected - to your MongoDB Atlas cluster. - """ - - text_index_name: str | None = None - """ - The name of the text search index in the MongoDB collection. This is - required for using the hybrid search feature. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MONGO_DB_ATLAS_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MONGO_DB_ATLAS_CONFIGURATION.members["endpoint"], self.endpoint - ) - serializer.write_string( - _SCHEMA_MONGO_DB_ATLAS_CONFIGURATION.members["databaseName"], - self.database_name, - ) - serializer.write_string( - _SCHEMA_MONGO_DB_ATLAS_CONFIGURATION.members["collectionName"], - self.collection_name, - ) - serializer.write_string( - _SCHEMA_MONGO_DB_ATLAS_CONFIGURATION.members["vectorIndexName"], - self.vector_index_name, - ) - serializer.write_string( - _SCHEMA_MONGO_DB_ATLAS_CONFIGURATION.members["credentialsSecretArn"], - self.credentials_secret_arn, - ) - serializer.write_struct( - _SCHEMA_MONGO_DB_ATLAS_CONFIGURATION.members["fieldMapping"], - self.field_mapping, - ) - if self.endpoint_service_name is not None: - serializer.write_string( - _SCHEMA_MONGO_DB_ATLAS_CONFIGURATION.members["endpointServiceName"], - self.endpoint_service_name, - ) - - if self.text_index_name is not None: - serializer.write_string( - _SCHEMA_MONGO_DB_ATLAS_CONFIGURATION.members["textIndexName"], - self.text_index_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["endpoint"] = de.read_string( - _SCHEMA_MONGO_DB_ATLAS_CONFIGURATION.members["endpoint"] - ) - - case 1: - kwargs["database_name"] = de.read_string( - _SCHEMA_MONGO_DB_ATLAS_CONFIGURATION.members["databaseName"] - ) - - case 2: - kwargs["collection_name"] = de.read_string( - _SCHEMA_MONGO_DB_ATLAS_CONFIGURATION.members["collectionName"] - ) - - case 3: - kwargs["vector_index_name"] = de.read_string( - _SCHEMA_MONGO_DB_ATLAS_CONFIGURATION.members["vectorIndexName"] - ) - - case 4: - kwargs["credentials_secret_arn"] = de.read_string( - _SCHEMA_MONGO_DB_ATLAS_CONFIGURATION.members[ - "credentialsSecretArn" - ] - ) - - case 5: - kwargs["field_mapping"] = MongoDbAtlasFieldMapping.deserialize(de) - - case 6: - kwargs["endpoint_service_name"] = de.read_string( - _SCHEMA_MONGO_DB_ATLAS_CONFIGURATION.members[ - "endpointServiceName" - ] - ) - - case 7: - kwargs["text_index_name"] = de.read_string( - _SCHEMA_MONGO_DB_ATLAS_CONFIGURATION.members["textIndexName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MONGO_DB_ATLAS_CONFIGURATION, consumer=_consumer - ) - if "endpoint" not in kwargs: - kwargs["endpoint"] = "" - if "database_name" not in kwargs: - kwargs["database_name"] = "" - if "collection_name" not in kwargs: - kwargs["collection_name"] = "" - if "vector_index_name" not in kwargs: - kwargs["vector_index_name"] = "" - if "credentials_secret_arn" not in kwargs: - kwargs["credentials_secret_arn"] = "" - if "field_mapping" not in kwargs: - kwargs["field_mapping"] = MongoDbAtlasFieldMapping._smithy_default() - return kwargs - - -@dataclass(kw_only=True) -class NeptuneAnalyticsFieldMapping: - """ - Contains the names of the fields to which to map information about the - vector store. - """ - - text_field: str - """ - The name of the field in which Amazon Bedrock stores the raw text from - your data. The text is split according to the chunking strategy you - choose. - """ - - metadata_field: str - """ - The name of the field in which Amazon Bedrock stores metadata about the - vector store. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_NEPTUNE_ANALYTICS_FIELD_MAPPING, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_NEPTUNE_ANALYTICS_FIELD_MAPPING.members["textField"], - self.text_field, - ) - serializer.write_string( - _SCHEMA_NEPTUNE_ANALYTICS_FIELD_MAPPING.members["metadataField"], - self.metadata_field, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["text_field"] = de.read_string( - _SCHEMA_NEPTUNE_ANALYTICS_FIELD_MAPPING.members["textField"] - ) - - case 1: - kwargs["metadata_field"] = de.read_string( - _SCHEMA_NEPTUNE_ANALYTICS_FIELD_MAPPING.members["metadataField"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_NEPTUNE_ANALYTICS_FIELD_MAPPING, consumer=_consumer - ) - if "text_field" not in kwargs: - kwargs["text_field"] = "" - if "metadata_field" not in kwargs: - kwargs["metadata_field"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(text_field="", metadata_field="") - - -@dataclass(kw_only=True) -class NeptuneAnalyticsConfiguration: - """ - Contains details about the storage configuration of the knowledge base - in Amazon Neptune Analytics. For more information, see [Create a vector - index in Amazon Neptune - Analytics](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-setup-neptune.html). - """ - - graph_arn: str = field(repr=False) - """The Amazon Resource Name (ARN) of the Neptune Analytics vector store.""" - - field_mapping: NeptuneAnalyticsFieldMapping - """ - Contains the names of the fields to which to map information about the - vector store. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_NEPTUNE_ANALYTICS_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_NEPTUNE_ANALYTICS_CONFIGURATION.members["graphArn"], self.graph_arn - ) - serializer.write_struct( - _SCHEMA_NEPTUNE_ANALYTICS_CONFIGURATION.members["fieldMapping"], - self.field_mapping, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["graph_arn"] = de.read_string( - _SCHEMA_NEPTUNE_ANALYTICS_CONFIGURATION.members["graphArn"] - ) - - case 1: - kwargs["field_mapping"] = NeptuneAnalyticsFieldMapping.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_NEPTUNE_ANALYTICS_CONFIGURATION, consumer=_consumer - ) - if "graph_arn" not in kwargs: - kwargs["graph_arn"] = "" - if "field_mapping" not in kwargs: - kwargs["field_mapping"] = NeptuneAnalyticsFieldMapping._smithy_default() - return kwargs - - -@dataclass(kw_only=True) -class OpenSearchManagedClusterFieldMapping: - """ - Contains the names of the fields to which to map information about the - vector store. - """ - - vector_field: str - """ - The name of the field in which Amazon Bedrock stores the vector - embeddings for your data sources. - """ - - text_field: str - """ - The name of the field in which Amazon Bedrock stores the raw text from - your data. The text is split according to the chunking strategy you - choose. - """ - - metadata_field: str - """ - The name of the field in which Amazon Bedrock stores metadata about the - vector store. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OPEN_SEARCH_MANAGED_CLUSTER_FIELD_MAPPING, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_OPEN_SEARCH_MANAGED_CLUSTER_FIELD_MAPPING.members["vectorField"], - self.vector_field, - ) - serializer.write_string( - _SCHEMA_OPEN_SEARCH_MANAGED_CLUSTER_FIELD_MAPPING.members["textField"], - self.text_field, - ) - serializer.write_string( - _SCHEMA_OPEN_SEARCH_MANAGED_CLUSTER_FIELD_MAPPING.members["metadataField"], - self.metadata_field, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["vector_field"] = de.read_string( - _SCHEMA_OPEN_SEARCH_MANAGED_CLUSTER_FIELD_MAPPING.members[ - "vectorField" - ] - ) - - case 1: - kwargs["text_field"] = de.read_string( - _SCHEMA_OPEN_SEARCH_MANAGED_CLUSTER_FIELD_MAPPING.members[ - "textField" - ] - ) - - case 2: - kwargs["metadata_field"] = de.read_string( - _SCHEMA_OPEN_SEARCH_MANAGED_CLUSTER_FIELD_MAPPING.members[ - "metadataField" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_OPEN_SEARCH_MANAGED_CLUSTER_FIELD_MAPPING, consumer=_consumer - ) - if "vector_field" not in kwargs: - kwargs["vector_field"] = "" - if "text_field" not in kwargs: - kwargs["text_field"] = "" - if "metadata_field" not in kwargs: - kwargs["metadata_field"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(vector_field="", text_field="", metadata_field="") - - -@dataclass(kw_only=True) -class OpenSearchManagedClusterConfiguration: - """ - Contains details about the Managed Cluster configuration of the - knowledge base in Amazon OpenSearch Service. For more information, see - [Create a vector index in OpenSearch Managed - Cluster](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-setup-osm.html). - """ - - domain_endpoint: str - """The endpoint URL the OpenSearch domain.""" - - domain_arn: str - """The Amazon Resource Name (ARN) of the OpenSearch domain.""" - - vector_index_name: str = field(repr=False) - """The name of the vector store.""" - - field_mapping: OpenSearchManagedClusterFieldMapping - """ - Contains the names of the fields to which to map information about the - vector store. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OPEN_SEARCH_MANAGED_CLUSTER_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_OPEN_SEARCH_MANAGED_CLUSTER_CONFIGURATION.members["domainEndpoint"], - self.domain_endpoint, - ) - serializer.write_string( - _SCHEMA_OPEN_SEARCH_MANAGED_CLUSTER_CONFIGURATION.members["domainArn"], - self.domain_arn, - ) - serializer.write_string( - _SCHEMA_OPEN_SEARCH_MANAGED_CLUSTER_CONFIGURATION.members[ - "vectorIndexName" - ], - self.vector_index_name, - ) - serializer.write_struct( - _SCHEMA_OPEN_SEARCH_MANAGED_CLUSTER_CONFIGURATION.members["fieldMapping"], - self.field_mapping, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["domain_endpoint"] = de.read_string( - _SCHEMA_OPEN_SEARCH_MANAGED_CLUSTER_CONFIGURATION.members[ - "domainEndpoint" - ] - ) - - case 1: - kwargs["domain_arn"] = de.read_string( - _SCHEMA_OPEN_SEARCH_MANAGED_CLUSTER_CONFIGURATION.members[ - "domainArn" - ] - ) - - case 2: - kwargs["vector_index_name"] = de.read_string( - _SCHEMA_OPEN_SEARCH_MANAGED_CLUSTER_CONFIGURATION.members[ - "vectorIndexName" - ] - ) - - case 3: - kwargs["field_mapping"] = ( - OpenSearchManagedClusterFieldMapping.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_OPEN_SEARCH_MANAGED_CLUSTER_CONFIGURATION, consumer=_consumer - ) - if "domain_endpoint" not in kwargs: - kwargs["domain_endpoint"] = "" - if "domain_arn" not in kwargs: - kwargs["domain_arn"] = "" - if "vector_index_name" not in kwargs: - kwargs["vector_index_name"] = "" - if "field_mapping" not in kwargs: - kwargs["field_mapping"] = ( - OpenSearchManagedClusterFieldMapping._smithy_default() - ) - return kwargs - - -@dataclass(kw_only=True) -class OpenSearchServerlessFieldMapping: - """ - Contains the names of the fields to which to map information about the - vector store. - """ - - vector_field: str - """ - The name of the field in which Amazon Bedrock stores the vector - embeddings for your data sources. - """ - - text_field: str - """ - The name of the field in which Amazon Bedrock stores the raw text from - your data. The text is split according to the chunking strategy you - choose. - """ - - metadata_field: str - """ - The name of the field in which Amazon Bedrock stores metadata about the - vector store. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OPEN_SEARCH_SERVERLESS_FIELD_MAPPING, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_OPEN_SEARCH_SERVERLESS_FIELD_MAPPING.members["vectorField"], - self.vector_field, - ) - serializer.write_string( - _SCHEMA_OPEN_SEARCH_SERVERLESS_FIELD_MAPPING.members["textField"], - self.text_field, - ) - serializer.write_string( - _SCHEMA_OPEN_SEARCH_SERVERLESS_FIELD_MAPPING.members["metadataField"], - self.metadata_field, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["vector_field"] = de.read_string( - _SCHEMA_OPEN_SEARCH_SERVERLESS_FIELD_MAPPING.members[ - "vectorField" - ] - ) - - case 1: - kwargs["text_field"] = de.read_string( - _SCHEMA_OPEN_SEARCH_SERVERLESS_FIELD_MAPPING.members[ - "textField" - ] - ) - - case 2: - kwargs["metadata_field"] = de.read_string( - _SCHEMA_OPEN_SEARCH_SERVERLESS_FIELD_MAPPING.members[ - "metadataField" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_OPEN_SEARCH_SERVERLESS_FIELD_MAPPING, consumer=_consumer - ) - if "vector_field" not in kwargs: - kwargs["vector_field"] = "" - if "text_field" not in kwargs: - kwargs["text_field"] = "" - if "metadata_field" not in kwargs: - kwargs["metadata_field"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(vector_field="", text_field="", metadata_field="") - - -@dataclass(kw_only=True) -class OpenSearchServerlessConfiguration: - """ - Contains details about the storage configuration of the knowledge base - in Amazon OpenSearch Service. For more information, see [Create a vector - index in Amazon OpenSearch - Service](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-setup-oss.html). - """ - - collection_arn: str - """The Amazon Resource Name (ARN) of the OpenSearch Service vector store.""" - - vector_index_name: str - """The name of the vector store.""" - - field_mapping: OpenSearchServerlessFieldMapping - """ - Contains the names of the fields to which to map information about the - vector store. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OPEN_SEARCH_SERVERLESS_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_OPEN_SEARCH_SERVERLESS_CONFIGURATION.members["collectionArn"], - self.collection_arn, - ) - serializer.write_string( - _SCHEMA_OPEN_SEARCH_SERVERLESS_CONFIGURATION.members["vectorIndexName"], - self.vector_index_name, - ) - serializer.write_struct( - _SCHEMA_OPEN_SEARCH_SERVERLESS_CONFIGURATION.members["fieldMapping"], - self.field_mapping, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["collection_arn"] = de.read_string( - _SCHEMA_OPEN_SEARCH_SERVERLESS_CONFIGURATION.members[ - "collectionArn" - ] - ) - - case 1: - kwargs["vector_index_name"] = de.read_string( - _SCHEMA_OPEN_SEARCH_SERVERLESS_CONFIGURATION.members[ - "vectorIndexName" - ] - ) - - case 2: - kwargs["field_mapping"] = ( - OpenSearchServerlessFieldMapping.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_OPEN_SEARCH_SERVERLESS_CONFIGURATION, consumer=_consumer - ) - if "collection_arn" not in kwargs: - kwargs["collection_arn"] = "" - if "vector_index_name" not in kwargs: - kwargs["vector_index_name"] = "" - if "field_mapping" not in kwargs: - kwargs["field_mapping"] = OpenSearchServerlessFieldMapping._smithy_default() - return kwargs - - -@dataclass(kw_only=True) -class PineconeFieldMapping: - """ - Contains the names of the fields to which to map information about the - vector store. - """ - - text_field: str - """ - The name of the field in which Amazon Bedrock stores the raw text from - your data. The text is split according to the chunking strategy you - choose. - """ - - metadata_field: str - """ - The name of the field in which Amazon Bedrock stores metadata about the - vector store. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PINECONE_FIELD_MAPPING, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_PINECONE_FIELD_MAPPING.members["textField"], self.text_field - ) - serializer.write_string( - _SCHEMA_PINECONE_FIELD_MAPPING.members["metadataField"], self.metadata_field - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["text_field"] = de.read_string( - _SCHEMA_PINECONE_FIELD_MAPPING.members["textField"] - ) - - case 1: - kwargs["metadata_field"] = de.read_string( - _SCHEMA_PINECONE_FIELD_MAPPING.members["metadataField"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PINECONE_FIELD_MAPPING, consumer=_consumer) - if "text_field" not in kwargs: - kwargs["text_field"] = "" - if "metadata_field" not in kwargs: - kwargs["metadata_field"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(text_field="", metadata_field="") - - -@dataclass(kw_only=True) -class PineconeConfiguration: - """ - Contains details about the storage configuration of the knowledge base - in Pinecone. For more information, see [Create a vector index in - Pinecone](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-setup-pinecone.html). - """ - - connection_string: str - """The endpoint URL for your index management page.""" - - credentials_secret_arn: str - """ - The Amazon Resource Name (ARN) of the secret that you created in Secrets - Manager that is linked to your Pinecone API key. - """ - - field_mapping: PineconeFieldMapping - """ - Contains the names of the fields to which to map information about the - vector store. - """ - - namespace: str | None = None - """The namespace to be used to write new data to your database.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PINECONE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_PINECONE_CONFIGURATION.members["connectionString"], - self.connection_string, - ) - serializer.write_string( - _SCHEMA_PINECONE_CONFIGURATION.members["credentialsSecretArn"], - self.credentials_secret_arn, - ) - if self.namespace is not None: - serializer.write_string( - _SCHEMA_PINECONE_CONFIGURATION.members["namespace"], self.namespace - ) - - serializer.write_struct( - _SCHEMA_PINECONE_CONFIGURATION.members["fieldMapping"], self.field_mapping - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["connection_string"] = de.read_string( - _SCHEMA_PINECONE_CONFIGURATION.members["connectionString"] - ) - - case 1: - kwargs["credentials_secret_arn"] = de.read_string( - _SCHEMA_PINECONE_CONFIGURATION.members["credentialsSecretArn"] - ) - - case 2: - kwargs["namespace"] = de.read_string( - _SCHEMA_PINECONE_CONFIGURATION.members["namespace"] - ) - - case 3: - kwargs["field_mapping"] = PineconeFieldMapping.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PINECONE_CONFIGURATION, consumer=_consumer) - if "connection_string" not in kwargs: - kwargs["connection_string"] = "" - if "credentials_secret_arn" not in kwargs: - kwargs["credentials_secret_arn"] = "" - if "field_mapping" not in kwargs: - kwargs["field_mapping"] = PineconeFieldMapping._smithy_default() - return kwargs - - -@dataclass(kw_only=True) -class RdsFieldMapping: - """ - Contains the names of the fields to which to map information about the - vector store. - """ - - primary_key_field: str - """ - The name of the field in which Amazon Bedrock stores the ID for each - entry. - """ - - vector_field: str - """ - The name of the field in which Amazon Bedrock stores the vector - embeddings for your data sources. - """ - - text_field: str - """ - The name of the field in which Amazon Bedrock stores the raw text from - your data. The text is split according to the chunking strategy you - choose. - """ - - metadata_field: str - """ - The name of the field in which Amazon Bedrock stores metadata about the - vector store. - """ - - custom_metadata_field: str | None = None - """ - Provide a name for the universal metadata field where Amazon Bedrock - will store any custom metadata from your data source. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RDS_FIELD_MAPPING, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_RDS_FIELD_MAPPING.members["primaryKeyField"], self.primary_key_field - ) - serializer.write_string( - _SCHEMA_RDS_FIELD_MAPPING.members["vectorField"], self.vector_field - ) - serializer.write_string( - _SCHEMA_RDS_FIELD_MAPPING.members["textField"], self.text_field - ) - serializer.write_string( - _SCHEMA_RDS_FIELD_MAPPING.members["metadataField"], self.metadata_field - ) - if self.custom_metadata_field is not None: - serializer.write_string( - _SCHEMA_RDS_FIELD_MAPPING.members["customMetadataField"], - self.custom_metadata_field, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["primary_key_field"] = de.read_string( - _SCHEMA_RDS_FIELD_MAPPING.members["primaryKeyField"] - ) - - case 1: - kwargs["vector_field"] = de.read_string( - _SCHEMA_RDS_FIELD_MAPPING.members["vectorField"] - ) - - case 2: - kwargs["text_field"] = de.read_string( - _SCHEMA_RDS_FIELD_MAPPING.members["textField"] - ) - - case 3: - kwargs["metadata_field"] = de.read_string( - _SCHEMA_RDS_FIELD_MAPPING.members["metadataField"] - ) - - case 4: - kwargs["custom_metadata_field"] = de.read_string( - _SCHEMA_RDS_FIELD_MAPPING.members["customMetadataField"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RDS_FIELD_MAPPING, consumer=_consumer) - if "primary_key_field" not in kwargs: - kwargs["primary_key_field"] = "" - if "vector_field" not in kwargs: - kwargs["vector_field"] = "" - if "text_field" not in kwargs: - kwargs["text_field"] = "" - if "metadata_field" not in kwargs: - kwargs["metadata_field"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls( - primary_key_field="", vector_field="", text_field="", metadata_field="" - ) - - -@dataclass(kw_only=True) -class RdsConfiguration: - """ - Contains details about the storage configuration of the knowledge base - in Amazon RDS. For more information, see [Create a vector index in - Amazon - RDS](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-setup-rds.html). - """ - - resource_arn: str - """The Amazon Resource Name (ARN) of the vector store.""" - - credentials_secret_arn: str - """ - The Amazon Resource Name (ARN) of the secret that you created in Secrets - Manager that is linked to your Amazon RDS database. - """ - - database_name: str - """The name of your Amazon RDS database.""" - - table_name: str - """The name of the table in the database.""" - - field_mapping: RdsFieldMapping - """ - Contains the names of the fields to which to map information about the - vector store. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RDS_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_RDS_CONFIGURATION.members["resourceArn"], self.resource_arn - ) - serializer.write_string( - _SCHEMA_RDS_CONFIGURATION.members["credentialsSecretArn"], - self.credentials_secret_arn, - ) - serializer.write_string( - _SCHEMA_RDS_CONFIGURATION.members["databaseName"], self.database_name - ) - serializer.write_string( - _SCHEMA_RDS_CONFIGURATION.members["tableName"], self.table_name - ) - serializer.write_struct( - _SCHEMA_RDS_CONFIGURATION.members["fieldMapping"], self.field_mapping - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_RDS_CONFIGURATION.members["resourceArn"] - ) - - case 1: - kwargs["credentials_secret_arn"] = de.read_string( - _SCHEMA_RDS_CONFIGURATION.members["credentialsSecretArn"] - ) - - case 2: - kwargs["database_name"] = de.read_string( - _SCHEMA_RDS_CONFIGURATION.members["databaseName"] - ) - - case 3: - kwargs["table_name"] = de.read_string( - _SCHEMA_RDS_CONFIGURATION.members["tableName"] - ) - - case 4: - kwargs["field_mapping"] = RdsFieldMapping.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RDS_CONFIGURATION, consumer=_consumer) - if "resource_arn" not in kwargs: - kwargs["resource_arn"] = "" - if "credentials_secret_arn" not in kwargs: - kwargs["credentials_secret_arn"] = "" - if "database_name" not in kwargs: - kwargs["database_name"] = "" - if "table_name" not in kwargs: - kwargs["table_name"] = "" - if "field_mapping" not in kwargs: - kwargs["field_mapping"] = RdsFieldMapping._smithy_default() - return kwargs - - -@dataclass(kw_only=True) -class RedisEnterpriseCloudFieldMapping: - """ - Contains the names of the fields to which to map information about the - vector store. - """ - - vector_field: str - """ - The name of the field in which Amazon Bedrock stores the vector - embeddings for your data sources. - """ - - text_field: str - """ - The name of the field in which Amazon Bedrock stores the raw text from - your data. The text is split according to the chunking strategy you - choose. - """ - - metadata_field: str - """ - The name of the field in which Amazon Bedrock stores metadata about the - vector store. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REDIS_ENTERPRISE_CLOUD_FIELD_MAPPING, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_REDIS_ENTERPRISE_CLOUD_FIELD_MAPPING.members["vectorField"], - self.vector_field, - ) - serializer.write_string( - _SCHEMA_REDIS_ENTERPRISE_CLOUD_FIELD_MAPPING.members["textField"], - self.text_field, - ) - serializer.write_string( - _SCHEMA_REDIS_ENTERPRISE_CLOUD_FIELD_MAPPING.members["metadataField"], - self.metadata_field, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["vector_field"] = de.read_string( - _SCHEMA_REDIS_ENTERPRISE_CLOUD_FIELD_MAPPING.members[ - "vectorField" - ] - ) - - case 1: - kwargs["text_field"] = de.read_string( - _SCHEMA_REDIS_ENTERPRISE_CLOUD_FIELD_MAPPING.members[ - "textField" - ] - ) - - case 2: - kwargs["metadata_field"] = de.read_string( - _SCHEMA_REDIS_ENTERPRISE_CLOUD_FIELD_MAPPING.members[ - "metadataField" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_REDIS_ENTERPRISE_CLOUD_FIELD_MAPPING, consumer=_consumer - ) - if "vector_field" not in kwargs: - kwargs["vector_field"] = "" - if "text_field" not in kwargs: - kwargs["text_field"] = "" - if "metadata_field" not in kwargs: - kwargs["metadata_field"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(vector_field="", text_field="", metadata_field="") - - -@dataclass(kw_only=True) -class RedisEnterpriseCloudConfiguration: - """ - Contains details about the storage configuration of the knowledge base - in Redis Enterprise Cloud. For more information, see [Create a vector - index in Redis Enterprise - Cloud](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-setup-oss.html). - """ - - endpoint: str - """The endpoint URL of the Redis Enterprise Cloud database.""" - - vector_index_name: str - """The name of the vector index.""" - - credentials_secret_arn: str - """ - The Amazon Resource Name (ARN) of the secret that you created in Secrets - Manager that is linked to your Redis Enterprise Cloud database. - """ - - field_mapping: RedisEnterpriseCloudFieldMapping - """ - Contains the names of the fields to which to map information about the - vector store. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REDIS_ENTERPRISE_CLOUD_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_REDIS_ENTERPRISE_CLOUD_CONFIGURATION.members["endpoint"], - self.endpoint, - ) - serializer.write_string( - _SCHEMA_REDIS_ENTERPRISE_CLOUD_CONFIGURATION.members["vectorIndexName"], - self.vector_index_name, - ) - serializer.write_string( - _SCHEMA_REDIS_ENTERPRISE_CLOUD_CONFIGURATION.members[ - "credentialsSecretArn" - ], - self.credentials_secret_arn, - ) - serializer.write_struct( - _SCHEMA_REDIS_ENTERPRISE_CLOUD_CONFIGURATION.members["fieldMapping"], - self.field_mapping, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["endpoint"] = de.read_string( - _SCHEMA_REDIS_ENTERPRISE_CLOUD_CONFIGURATION.members["endpoint"] - ) - - case 1: - kwargs["vector_index_name"] = de.read_string( - _SCHEMA_REDIS_ENTERPRISE_CLOUD_CONFIGURATION.members[ - "vectorIndexName" - ] - ) - - case 2: - kwargs["credentials_secret_arn"] = de.read_string( - _SCHEMA_REDIS_ENTERPRISE_CLOUD_CONFIGURATION.members[ - "credentialsSecretArn" - ] - ) - - case 3: - kwargs["field_mapping"] = ( - RedisEnterpriseCloudFieldMapping.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_REDIS_ENTERPRISE_CLOUD_CONFIGURATION, consumer=_consumer - ) - if "endpoint" not in kwargs: - kwargs["endpoint"] = "" - if "vector_index_name" not in kwargs: - kwargs["vector_index_name"] = "" - if "credentials_secret_arn" not in kwargs: - kwargs["credentials_secret_arn"] = "" - if "field_mapping" not in kwargs: - kwargs["field_mapping"] = RedisEnterpriseCloudFieldMapping._smithy_default() - return kwargs - - -@dataclass(kw_only=True) -class S3VectorsConfiguration: - """Contains the storage configuration of the knowledge base for S3 vectors.""" - - vector_bucket_arn: str | None = field(repr=False, default=None) - """ - The Amazon Resource Name (ARN) of the S3 bucket where vector embeddings - are stored. This bucket contains the vector data used by the knowledge - base. - """ - - index_arn: str | None = field(repr=False, default=None) - """ - The Amazon Resource Name (ARN) of the vector index used for the - knowledge base. This ARN identifies the specific vector index resource - within Amazon Bedrock. - """ - - index_name: str | None = field(repr=False, default=None) - """ - The name of the vector index used for the knowledge base. This name - identifies the vector index within the Amazon Bedrock service. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_S3_VECTORS_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.vector_bucket_arn is not None: - serializer.write_string( - _SCHEMA_S3_VECTORS_CONFIGURATION.members["vectorBucketArn"], - self.vector_bucket_arn, - ) - - if self.index_arn is not None: - serializer.write_string( - _SCHEMA_S3_VECTORS_CONFIGURATION.members["indexArn"], self.index_arn - ) - - if self.index_name is not None: - serializer.write_string( - _SCHEMA_S3_VECTORS_CONFIGURATION.members["indexName"], self.index_name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["vector_bucket_arn"] = de.read_string( - _SCHEMA_S3_VECTORS_CONFIGURATION.members["vectorBucketArn"] - ) - - case 1: - kwargs["index_arn"] = de.read_string( - _SCHEMA_S3_VECTORS_CONFIGURATION.members["indexArn"] - ) - - case 2: - kwargs["index_name"] = de.read_string( - _SCHEMA_S3_VECTORS_CONFIGURATION.members["indexName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_S3_VECTORS_CONFIGURATION, consumer=_consumer) - return kwargs - - -class KnowledgeBaseStorageType(UnknownEnumMixin, StrEnum): - """The storage type of a knowledge base.""" - - OPENSEARCH_SERVERLESS = "OPENSEARCH_SERVERLESS" - PINECONE = "PINECONE" - REDIS_ENTERPRISE_CLOUD = "REDIS_ENTERPRISE_CLOUD" - RDS = "RDS" - MONGO_DB_ATLAS = "MONGO_DB_ATLAS" - NEPTUNE_ANALYTICS = "NEPTUNE_ANALYTICS" - OPENSEARCH_MANAGED_CLUSTER = "OPENSEARCH_MANAGED_CLUSTER" - S3_VECTORS = "S3_VECTORS" - - -@dataclass(kw_only=True) -class StorageConfiguration: - """Contains the storage configuration of the knowledge base.""" - - type: str - """The vector store service in which the knowledge base is stored.""" - - opensearch_serverless_configuration: OpenSearchServerlessConfiguration | None = None - """ - Contains the storage configuration of the knowledge base in Amazon - OpenSearch Service. - """ - - opensearch_managed_cluster_configuration: ( - OpenSearchManagedClusterConfiguration | None - ) = None - """ - Contains details about the storage configuration of the knowledge base - in OpenSearch Managed Cluster. For more information, see [Create a - vector index in Amazon OpenSearch - Service](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-setup-osm.html). - """ - - pinecone_configuration: PineconeConfiguration | None = None - """Contains the storage configuration of the knowledge base in Pinecone.""" - - redis_enterprise_cloud_configuration: RedisEnterpriseCloudConfiguration | None = ( - None - ) - """ - Contains the storage configuration of the knowledge base in Redis - Enterprise Cloud. - """ - - rds_configuration: RdsConfiguration | None = None - """ - Contains details about the storage configuration of the knowledge base - in Amazon RDS. For more information, see [Create a vector index in - Amazon - RDS](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-setup-rds.html). - """ - - mongo_db_atlas_configuration: MongoDbAtlasConfiguration | None = None - """ - Contains the storage configuration of the knowledge base in MongoDB - Atlas. - """ - - neptune_analytics_configuration: NeptuneAnalyticsConfiguration | None = None - """ - Contains details about the Neptune Analytics configuration of the - knowledge base in Amazon Neptune. For more information, see [Create a - vector index in Amazon Neptune - Analytics.](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-setup-neptune.html). - """ - - s3_vectors_configuration: S3VectorsConfiguration | None = None - """ - The configuration settings for storing knowledge base data using S3 - vectors. This includes vector index information and S3 bucket details - for vector storage. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STORAGE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_STORAGE_CONFIGURATION.members["type"], self.type - ) - if self.opensearch_serverless_configuration is not None: - serializer.write_struct( - _SCHEMA_STORAGE_CONFIGURATION.members[ - "opensearchServerlessConfiguration" - ], - self.opensearch_serverless_configuration, - ) - - if self.opensearch_managed_cluster_configuration is not None: - serializer.write_struct( - _SCHEMA_STORAGE_CONFIGURATION.members[ - "opensearchManagedClusterConfiguration" - ], - self.opensearch_managed_cluster_configuration, - ) - - if self.pinecone_configuration is not None: - serializer.write_struct( - _SCHEMA_STORAGE_CONFIGURATION.members["pineconeConfiguration"], - self.pinecone_configuration, - ) - - if self.redis_enterprise_cloud_configuration is not None: - serializer.write_struct( - _SCHEMA_STORAGE_CONFIGURATION.members[ - "redisEnterpriseCloudConfiguration" - ], - self.redis_enterprise_cloud_configuration, - ) - - if self.rds_configuration is not None: - serializer.write_struct( - _SCHEMA_STORAGE_CONFIGURATION.members["rdsConfiguration"], - self.rds_configuration, - ) - - if self.mongo_db_atlas_configuration is not None: - serializer.write_struct( - _SCHEMA_STORAGE_CONFIGURATION.members["mongoDbAtlasConfiguration"], - self.mongo_db_atlas_configuration, - ) - - if self.neptune_analytics_configuration is not None: - serializer.write_struct( - _SCHEMA_STORAGE_CONFIGURATION.members["neptuneAnalyticsConfiguration"], - self.neptune_analytics_configuration, - ) - - if self.s3_vectors_configuration is not None: - serializer.write_struct( - _SCHEMA_STORAGE_CONFIGURATION.members["s3VectorsConfiguration"], - self.s3_vectors_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = KnowledgeBaseStorageType( - de.read_string(_SCHEMA_STORAGE_CONFIGURATION.members["type"]) - ) - - case 1: - kwargs["opensearch_serverless_configuration"] = ( - OpenSearchServerlessConfiguration.deserialize(de) - ) - - case 2: - kwargs["opensearch_managed_cluster_configuration"] = ( - OpenSearchManagedClusterConfiguration.deserialize(de) - ) - - case 3: - kwargs["pinecone_configuration"] = ( - PineconeConfiguration.deserialize(de) - ) - - case 4: - kwargs["redis_enterprise_cloud_configuration"] = ( - RedisEnterpriseCloudConfiguration.deserialize(de) - ) - - case 5: - kwargs["rds_configuration"] = RdsConfiguration.deserialize(de) - - case 6: - kwargs["mongo_db_atlas_configuration"] = ( - MongoDbAtlasConfiguration.deserialize(de) - ) - - case 7: - kwargs["neptune_analytics_configuration"] = ( - NeptuneAnalyticsConfiguration.deserialize(de) - ) - - case 8: - kwargs["s3_vectors_configuration"] = ( - S3VectorsConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_STORAGE_CONFIGURATION, consumer=_consumer) - if "type" not in kwargs: - kwargs["type"] = KnowledgeBaseStorageType._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class CreateKnowledgeBaseInput: - """Dataclass for CreateKnowledgeBaseInput structure.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If this token matches a previous - request, Amazon Bedrock ignores the request, but does not return an - error. For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - name: str | None = None - """A name for the knowledge base.""" - - description: str | None = None - """A description of the knowledge base.""" - - role_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the IAM role with permissions to - invoke API operations on the knowledge base. - """ - - knowledge_base_configuration: KnowledgeBaseConfiguration | None = None - """Contains details about the embeddings model used for the knowledge base.""" - - storage_configuration: StorageConfiguration | None = None - """ - Contains details about the configuration of the vector database used for - the knowledge base. - """ - - tags: dict[str, str] | None = None - """ - Specify the key-value pairs for the tags that you want to attach to your - knowledge base in this object. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_KNOWLEDGE_BASE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_KNOWLEDGE_BASE_INPUT.members["clientToken"], - self.client_token, - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_KNOWLEDGE_BASE_INPUT.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_KNOWLEDGE_BASE_INPUT.members["description"], - self.description, - ) - - if self.role_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_KNOWLEDGE_BASE_INPUT.members["roleArn"], self.role_arn - ) - - if self.knowledge_base_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_KNOWLEDGE_BASE_INPUT.members[ - "knowledgeBaseConfiguration" - ], - self.knowledge_base_configuration, - ) - - if self.storage_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_KNOWLEDGE_BASE_INPUT.members["storageConfiguration"], - self.storage_configuration, - ) - - if self.tags is not None: - _serialize_tags_map( - serializer, - _SCHEMA_CREATE_KNOWLEDGE_BASE_INPUT.members["tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_KNOWLEDGE_BASE_INPUT.members["clientToken"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_KNOWLEDGE_BASE_INPUT.members["name"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_KNOWLEDGE_BASE_INPUT.members["description"] - ) - - case 3: - kwargs["role_arn"] = de.read_string( - _SCHEMA_CREATE_KNOWLEDGE_BASE_INPUT.members["roleArn"] - ) - - case 4: - kwargs["knowledge_base_configuration"] = ( - KnowledgeBaseConfiguration.deserialize(de) - ) - - case 5: - kwargs["storage_configuration"] = StorageConfiguration.deserialize( - de - ) - - case 6: - kwargs["tags"] = _deserialize_tags_map( - de, _SCHEMA_CREATE_KNOWLEDGE_BASE_INPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_KNOWLEDGE_BASE_INPUT, consumer=_consumer - ) - return kwargs - - -class KnowledgeBaseStatus(UnknownEnumMixin, StrEnum): - CREATING = "CREATING" - ACTIVE = "ACTIVE" - DELETING = "DELETING" - UPDATING = "UPDATING" - FAILED = "FAILED" - DELETE_UNSUCCESSFUL = "DELETE_UNSUCCESSFUL" - UPDATE_UNSUCCESSFUL = "UPDATE_UNSUCCESSFUL" - - -@dataclass(kw_only=True) -class KnowledgeBase: - """Contains information about a knowledge base.""" - - knowledge_base_id: str - """The unique identifier of the knowledge base.""" - - name: str - """The name of the knowledge base.""" - - knowledge_base_arn: str - """The Amazon Resource Name (ARN) of the knowledge base.""" - - role_arn: str - """ - The Amazon Resource Name (ARN) of the IAM role with permissions to - invoke API operations on the knowledge base. - """ - - knowledge_base_configuration: KnowledgeBaseConfiguration - """ - Contains details about the embeddings configuration of the knowledge - base. - """ - - status: str - """ - The status of the knowledge base. The following statuses are possible: - - - CREATING -- The knowledge base is being created. - - - ACTIVE -- The knowledge base is ready to be queried. - - - DELETING -- The knowledge base is being deleted. - - - UPDATING -- The knowledge base is being updated. - - - FAILED -- The knowledge base API operation failed. - """ - - created_at: datetime - """The time the knowledge base was created.""" - - updated_at: datetime - """The time the knowledge base was last updated.""" - - description: str | None = None - """The description of the knowledge base.""" - - storage_configuration: StorageConfiguration | None = None - """Contains details about the storage configuration of the knowledge base.""" - - failure_reasons: list[str] | None = None - """A list of reasons that the API operation on the knowledge base failed.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KNOWLEDGE_BASE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_KNOWLEDGE_BASE.members["knowledgeBaseId"], self.knowledge_base_id - ) - serializer.write_string(_SCHEMA_KNOWLEDGE_BASE.members["name"], self.name) - serializer.write_string( - _SCHEMA_KNOWLEDGE_BASE.members["knowledgeBaseArn"], self.knowledge_base_arn - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_KNOWLEDGE_BASE.members["description"], self.description - ) - - serializer.write_string( - _SCHEMA_KNOWLEDGE_BASE.members["roleArn"], self.role_arn - ) - serializer.write_struct( - _SCHEMA_KNOWLEDGE_BASE.members["knowledgeBaseConfiguration"], - self.knowledge_base_configuration, - ) - if self.storage_configuration is not None: - serializer.write_struct( - _SCHEMA_KNOWLEDGE_BASE.members["storageConfiguration"], - self.storage_configuration, - ) - - serializer.write_string(_SCHEMA_KNOWLEDGE_BASE.members["status"], self.status) - serializer.write_timestamp( - _SCHEMA_KNOWLEDGE_BASE.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_KNOWLEDGE_BASE.members["updatedAt"], self.updated_at - ) - if self.failure_reasons is not None: - _serialize_failure_reasons( - serializer, - _SCHEMA_KNOWLEDGE_BASE.members["failureReasons"], - self.failure_reasons, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["knowledge_base_id"] = de.read_string( - _SCHEMA_KNOWLEDGE_BASE.members["knowledgeBaseId"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_KNOWLEDGE_BASE.members["name"] - ) - - case 2: - kwargs["knowledge_base_arn"] = de.read_string( - _SCHEMA_KNOWLEDGE_BASE.members["knowledgeBaseArn"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_KNOWLEDGE_BASE.members["description"] - ) - - case 4: - kwargs["role_arn"] = de.read_string( - _SCHEMA_KNOWLEDGE_BASE.members["roleArn"] - ) - - case 5: - kwargs["knowledge_base_configuration"] = ( - KnowledgeBaseConfiguration.deserialize(de) - ) - - case 6: - kwargs["storage_configuration"] = StorageConfiguration.deserialize( - de - ) - - case 7: - kwargs["status"] = KnowledgeBaseStatus( - de.read_string(_SCHEMA_KNOWLEDGE_BASE.members["status"]) - ) - - case 8: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_KNOWLEDGE_BASE.members["createdAt"] - ) - - case 9: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_KNOWLEDGE_BASE.members["updatedAt"] - ) - - case 10: - kwargs["failure_reasons"] = _deserialize_failure_reasons( - de, _SCHEMA_KNOWLEDGE_BASE.members["failureReasons"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_KNOWLEDGE_BASE, consumer=_consumer) - if "knowledge_base_id" not in kwargs: - kwargs["knowledge_base_id"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "knowledge_base_arn" not in kwargs: - kwargs["knowledge_base_arn"] = "" - if "role_arn" not in kwargs: - kwargs["role_arn"] = "" - if "knowledge_base_configuration" not in kwargs: - kwargs["knowledge_base_configuration"] = ( - KnowledgeBaseConfiguration._smithy_default() - ) - if "status" not in kwargs: - kwargs["status"] = KnowledgeBaseStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls( - knowledge_base_id="", - name="", - knowledge_base_arn="", - role_arn="", - knowledge_base_configuration=KnowledgeBaseConfiguration._smithy_default(), - status=KnowledgeBaseStatus._corrected(""), - created_at=datetime.fromtimestamp(0, tz=timezone.utc), - updated_at=datetime.fromtimestamp(0, tz=timezone.utc), - ) - - -@dataclass(kw_only=True) -class CreateKnowledgeBaseOutput: - """Dataclass for CreateKnowledgeBaseOutput structure.""" - - knowledge_base: KnowledgeBase - """Contains details about the knowledge base.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_KNOWLEDGE_BASE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CREATE_KNOWLEDGE_BASE_OUTPUT.members["knowledgeBase"], - self.knowledge_base, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["knowledge_base"] = KnowledgeBase.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_KNOWLEDGE_BASE_OUTPUT, consumer=_consumer - ) - if "knowledge_base" not in kwargs: - kwargs["knowledge_base"] = KnowledgeBase._smithy_default() - return kwargs - - -CREATE_KNOWLEDGE_BASE = APIOperation( - input=CreateKnowledgeBaseInput, - output=CreateKnowledgeBaseOutput, - schema=_SCHEMA_CREATE_KNOWLEDGE_BASE, - input_schema=_SCHEMA_CREATE_KNOWLEDGE_BASE_INPUT, - output_schema=_SCHEMA_CREATE_KNOWLEDGE_BASE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrockagent#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteKnowledgeBaseInput: - """Dataclass for DeleteKnowledgeBaseInput structure.""" - - knowledge_base_id: str | None = None - """The unique identifier of the knowledge base to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_KNOWLEDGE_BASE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.knowledge_base_id is not None: - serializer.write_string( - _SCHEMA_DELETE_KNOWLEDGE_BASE_INPUT.members["knowledgeBaseId"], - self.knowledge_base_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["knowledge_base_id"] = de.read_string( - _SCHEMA_DELETE_KNOWLEDGE_BASE_INPUT.members["knowledgeBaseId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_KNOWLEDGE_BASE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteKnowledgeBaseOutput: - """Dataclass for DeleteKnowledgeBaseOutput structure.""" - - knowledge_base_id: str - """The unique identifier of the knowledge base that was deleted.""" - - status: str - """ - The status of the knowledge base and whether it has been successfully - deleted. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_KNOWLEDGE_BASE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DELETE_KNOWLEDGE_BASE_OUTPUT.members["knowledgeBaseId"], - self.knowledge_base_id, - ) - serializer.write_string( - _SCHEMA_DELETE_KNOWLEDGE_BASE_OUTPUT.members["status"], self.status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["knowledge_base_id"] = de.read_string( - _SCHEMA_DELETE_KNOWLEDGE_BASE_OUTPUT.members["knowledgeBaseId"] - ) - - case 1: - kwargs["status"] = KnowledgeBaseStatus( - de.read_string( - _SCHEMA_DELETE_KNOWLEDGE_BASE_OUTPUT.members["status"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_KNOWLEDGE_BASE_OUTPUT, consumer=_consumer - ) - if "knowledge_base_id" not in kwargs: - kwargs["knowledge_base_id"] = "" - if "status" not in kwargs: - kwargs["status"] = KnowledgeBaseStatus._corrected("") - return kwargs - - -DELETE_KNOWLEDGE_BASE = APIOperation( - input=DeleteKnowledgeBaseInput, - output=DeleteKnowledgeBaseOutput, - schema=_SCHEMA_DELETE_KNOWLEDGE_BASE, - input_schema=_SCHEMA_DELETE_KNOWLEDGE_BASE_INPUT, - output_schema=_SCHEMA_DELETE_KNOWLEDGE_BASE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrockagent#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DisassociateAgentKnowledgeBaseInput: - """Dataclass for DisassociateAgentKnowledgeBaseInput structure.""" - - agent_id: str | None = None - """ - The unique identifier of the agent from which to disassociate the - knowledge base. - """ - - agent_version: str | None = None - """The version of the agent from which to disassociate the knowledge base.""" - - knowledge_base_id: str | None = None - """The unique identifier of the knowledge base to disassociate.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DISASSOCIATE_AGENT_KNOWLEDGE_BASE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.agent_id is not None: - serializer.write_string( - _SCHEMA_DISASSOCIATE_AGENT_KNOWLEDGE_BASE_INPUT.members["agentId"], - self.agent_id, - ) - - if self.agent_version is not None: - serializer.write_string( - _SCHEMA_DISASSOCIATE_AGENT_KNOWLEDGE_BASE_INPUT.members["agentVersion"], - self.agent_version, - ) - - if self.knowledge_base_id is not None: - serializer.write_string( - _SCHEMA_DISASSOCIATE_AGENT_KNOWLEDGE_BASE_INPUT.members[ - "knowledgeBaseId" - ], - self.knowledge_base_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_id"] = de.read_string( - _SCHEMA_DISASSOCIATE_AGENT_KNOWLEDGE_BASE_INPUT.members[ - "agentId" - ] - ) - - case 1: - kwargs["agent_version"] = de.read_string( - _SCHEMA_DISASSOCIATE_AGENT_KNOWLEDGE_BASE_INPUT.members[ - "agentVersion" - ] - ) - - case 2: - kwargs["knowledge_base_id"] = de.read_string( - _SCHEMA_DISASSOCIATE_AGENT_KNOWLEDGE_BASE_INPUT.members[ - "knowledgeBaseId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DISASSOCIATE_AGENT_KNOWLEDGE_BASE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DisassociateAgentKnowledgeBaseOutput: - """Dataclass for DisassociateAgentKnowledgeBaseOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DISASSOCIATE_AGENT_KNOWLEDGE_BASE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DISASSOCIATE_AGENT_KNOWLEDGE_BASE_OUTPUT, consumer=_consumer - ) - return kwargs - - -DISASSOCIATE_AGENT_KNOWLEDGE_BASE = APIOperation( - input=DisassociateAgentKnowledgeBaseInput, - output=DisassociateAgentKnowledgeBaseOutput, - schema=_SCHEMA_DISASSOCIATE_AGENT_KNOWLEDGE_BASE, - input_schema=_SCHEMA_DISASSOCIATE_AGENT_KNOWLEDGE_BASE_INPUT, - output_schema=_SCHEMA_DISASSOCIATE_AGENT_KNOWLEDGE_BASE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrockagent#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetAgentKnowledgeBaseInput: - """Dataclass for GetAgentKnowledgeBaseInput structure.""" - - agent_id: str | None = None - """ - The unique identifier of the agent with which the knowledge base is - associated. - """ - - agent_version: str | None = None - """The version of the agent with which the knowledge base is associated.""" - - knowledge_base_id: str | None = None - """The unique identifier of the knowledge base associated with the agent.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_AGENT_KNOWLEDGE_BASE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.agent_id is not None: - serializer.write_string( - _SCHEMA_GET_AGENT_KNOWLEDGE_BASE_INPUT.members["agentId"], self.agent_id - ) - - if self.agent_version is not None: - serializer.write_string( - _SCHEMA_GET_AGENT_KNOWLEDGE_BASE_INPUT.members["agentVersion"], - self.agent_version, - ) - - if self.knowledge_base_id is not None: - serializer.write_string( - _SCHEMA_GET_AGENT_KNOWLEDGE_BASE_INPUT.members["knowledgeBaseId"], - self.knowledge_base_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_id"] = de.read_string( - _SCHEMA_GET_AGENT_KNOWLEDGE_BASE_INPUT.members["agentId"] - ) - - case 1: - kwargs["agent_version"] = de.read_string( - _SCHEMA_GET_AGENT_KNOWLEDGE_BASE_INPUT.members["agentVersion"] - ) - - case 2: - kwargs["knowledge_base_id"] = de.read_string( - _SCHEMA_GET_AGENT_KNOWLEDGE_BASE_INPUT.members[ - "knowledgeBaseId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_AGENT_KNOWLEDGE_BASE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetAgentKnowledgeBaseOutput: - """Dataclass for GetAgentKnowledgeBaseOutput structure.""" - - agent_knowledge_base: AgentKnowledgeBase - """Contains details about a knowledge base attached to an agent.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_AGENT_KNOWLEDGE_BASE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_AGENT_KNOWLEDGE_BASE_OUTPUT.members["agentKnowledgeBase"], - self.agent_knowledge_base, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_knowledge_base"] = AgentKnowledgeBase.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_AGENT_KNOWLEDGE_BASE_OUTPUT, consumer=_consumer - ) - if "agent_knowledge_base" not in kwargs: - kwargs["agent_knowledge_base"] = AgentKnowledgeBase._smithy_default() - return kwargs - - -GET_AGENT_KNOWLEDGE_BASE = APIOperation( - input=GetAgentKnowledgeBaseInput, - output=GetAgentKnowledgeBaseOutput, - schema=_SCHEMA_GET_AGENT_KNOWLEDGE_BASE, - input_schema=_SCHEMA_GET_AGENT_KNOWLEDGE_BASE_INPUT, - output_schema=_SCHEMA_GET_AGENT_KNOWLEDGE_BASE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetKnowledgeBaseInput: - """Dataclass for GetKnowledgeBaseInput structure.""" - - knowledge_base_id: str | None = None - """ - The unique identifier of the knowledge base you want to get information - on. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_KNOWLEDGE_BASE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.knowledge_base_id is not None: - serializer.write_string( - _SCHEMA_GET_KNOWLEDGE_BASE_INPUT.members["knowledgeBaseId"], - self.knowledge_base_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["knowledge_base_id"] = de.read_string( - _SCHEMA_GET_KNOWLEDGE_BASE_INPUT.members["knowledgeBaseId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_KNOWLEDGE_BASE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetKnowledgeBaseOutput: - """Dataclass for GetKnowledgeBaseOutput structure.""" - - knowledge_base: KnowledgeBase - """Contains details about the knowledge base.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_KNOWLEDGE_BASE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_KNOWLEDGE_BASE_OUTPUT.members["knowledgeBase"], - self.knowledge_base, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["knowledge_base"] = KnowledgeBase.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_KNOWLEDGE_BASE_OUTPUT, consumer=_consumer) - if "knowledge_base" not in kwargs: - kwargs["knowledge_base"] = KnowledgeBase._smithy_default() - return kwargs - - -GET_KNOWLEDGE_BASE = APIOperation( - input=GetKnowledgeBaseInput, - output=GetKnowledgeBaseOutput, - schema=_SCHEMA_GET_KNOWLEDGE_BASE, - input_schema=_SCHEMA_GET_KNOWLEDGE_BASE_INPUT, - output_schema=_SCHEMA_GET_KNOWLEDGE_BASE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListAgentKnowledgeBasesInput: - """Dataclass for ListAgentKnowledgeBasesInput structure.""" - - agent_id: str | None = None - """ - The unique identifier of the agent for which to return information about - knowledge bases associated with it. - """ - - agent_version: str | None = None - """ - The version of the agent for which to return information about knowledge - bases associated with it. - """ - - max_results: int | None = None - """ - The maximum number of results to return in the response. If the total - number of results is greater than this value, use the token returned in - the response in the `nextToken` field when making another request to - return the next batch of results. - """ - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, enter the token returned in the `nextToken` - field in the response in this field to return the next batch of results. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_AGENT_KNOWLEDGE_BASES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.agent_id is not None: - serializer.write_string( - _SCHEMA_LIST_AGENT_KNOWLEDGE_BASES_INPUT.members["agentId"], - self.agent_id, - ) - - if self.agent_version is not None: - serializer.write_string( - _SCHEMA_LIST_AGENT_KNOWLEDGE_BASES_INPUT.members["agentVersion"], - self.agent_version, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_AGENT_KNOWLEDGE_BASES_INPUT.members["maxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_AGENT_KNOWLEDGE_BASES_INPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_id"] = de.read_string( - _SCHEMA_LIST_AGENT_KNOWLEDGE_BASES_INPUT.members["agentId"] - ) - - case 1: - kwargs["agent_version"] = de.read_string( - _SCHEMA_LIST_AGENT_KNOWLEDGE_BASES_INPUT.members["agentVersion"] - ) - - case 2: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_AGENT_KNOWLEDGE_BASES_INPUT.members["maxResults"] - ) - - case 3: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_AGENT_KNOWLEDGE_BASES_INPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_AGENT_KNOWLEDGE_BASES_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ListAgentKnowledgeBasesOutput: - """Dataclass for ListAgentKnowledgeBasesOutput structure.""" - - agent_knowledge_base_summaries: list[AgentKnowledgeBaseSummary] - """ - A list of objects, each of which contains information about a knowledge - base associated with the agent. - """ - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, use this token when making another request in - the `nextToken` field to return the next batch of results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_AGENT_KNOWLEDGE_BASES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_agent_knowledge_base_summaries( - serializer, - _SCHEMA_LIST_AGENT_KNOWLEDGE_BASES_OUTPUT.members[ - "agentKnowledgeBaseSummaries" - ], - self.agent_knowledge_base_summaries, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_AGENT_KNOWLEDGE_BASES_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_knowledge_base_summaries"] = ( - _deserialize_agent_knowledge_base_summaries( - de, - _SCHEMA_LIST_AGENT_KNOWLEDGE_BASES_OUTPUT.members[ - "agentKnowledgeBaseSummaries" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_AGENT_KNOWLEDGE_BASES_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_AGENT_KNOWLEDGE_BASES_OUTPUT, consumer=_consumer - ) - if "agent_knowledge_base_summaries" not in kwargs: - kwargs["agent_knowledge_base_summaries"] = [] - return kwargs - - -LIST_AGENT_KNOWLEDGE_BASES = APIOperation( - input=ListAgentKnowledgeBasesInput, - output=ListAgentKnowledgeBasesOutput, - schema=_SCHEMA_LIST_AGENT_KNOWLEDGE_BASES, - input_schema=_SCHEMA_LIST_AGENT_KNOWLEDGE_BASES_INPUT, - output_schema=_SCHEMA_LIST_AGENT_KNOWLEDGE_BASES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListKnowledgeBasesInput: - """Dataclass for ListKnowledgeBasesInput structure.""" - - max_results: int | None = None - """ - The maximum number of results to return in the response. If the total - number of results is greater than this value, use the token returned in - the response in the `nextToken` field when making another request to - return the next batch of results. - """ - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, enter the token returned in the `nextToken` - field in the response in this field to return the next batch of results. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_KNOWLEDGE_BASES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_KNOWLEDGE_BASES_INPUT.members["maxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_KNOWLEDGE_BASES_INPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_KNOWLEDGE_BASES_INPUT.members["maxResults"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_KNOWLEDGE_BASES_INPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_KNOWLEDGE_BASES_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class KnowledgeBaseSummary: - """Contains details about a knowledge base.""" - - knowledge_base_id: str - """The unique identifier of the knowledge base.""" - - name: str - """The name of the knowledge base.""" - - status: str - """The status of the knowledge base.""" - - updated_at: datetime - """The time the knowledge base was last updated.""" - - description: str | None = None - """The description of the knowledge base.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KNOWLEDGE_BASE_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_KNOWLEDGE_BASE_SUMMARY.members["knowledgeBaseId"], - self.knowledge_base_id, - ) - serializer.write_string( - _SCHEMA_KNOWLEDGE_BASE_SUMMARY.members["name"], self.name - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_KNOWLEDGE_BASE_SUMMARY.members["description"], self.description - ) - - serializer.write_string( - _SCHEMA_KNOWLEDGE_BASE_SUMMARY.members["status"], self.status - ) - serializer.write_timestamp( - _SCHEMA_KNOWLEDGE_BASE_SUMMARY.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["knowledge_base_id"] = de.read_string( - _SCHEMA_KNOWLEDGE_BASE_SUMMARY.members["knowledgeBaseId"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_KNOWLEDGE_BASE_SUMMARY.members["name"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_KNOWLEDGE_BASE_SUMMARY.members["description"] - ) - - case 3: - kwargs["status"] = KnowledgeBaseStatus( - de.read_string(_SCHEMA_KNOWLEDGE_BASE_SUMMARY.members["status"]) - ) - - case 4: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_KNOWLEDGE_BASE_SUMMARY.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_KNOWLEDGE_BASE_SUMMARY, consumer=_consumer) - if "knowledge_base_id" not in kwargs: - kwargs["knowledge_base_id"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "status" not in kwargs: - kwargs["status"] = KnowledgeBaseStatus._corrected("") - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_knowledge_base_summaries( - serializer: ShapeSerializer, schema: Schema, value: list[KnowledgeBaseSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_knowledge_base_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[KnowledgeBaseSummary]: - result: list[KnowledgeBaseSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(KnowledgeBaseSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListKnowledgeBasesOutput: - """Dataclass for ListKnowledgeBasesOutput structure.""" - - knowledge_base_summaries: list[KnowledgeBaseSummary] - """A list of knowledge bases with information about each knowledge base.""" - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, use this token when making another request in - the `nextToken` field to return the next batch of results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_KNOWLEDGE_BASES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_knowledge_base_summaries( - serializer, - _SCHEMA_LIST_KNOWLEDGE_BASES_OUTPUT.members["knowledgeBaseSummaries"], - self.knowledge_base_summaries, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_KNOWLEDGE_BASES_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["knowledge_base_summaries"] = ( - _deserialize_knowledge_base_summaries( - de, - _SCHEMA_LIST_KNOWLEDGE_BASES_OUTPUT.members[ - "knowledgeBaseSummaries" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_KNOWLEDGE_BASES_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_KNOWLEDGE_BASES_OUTPUT, consumer=_consumer - ) - if "knowledge_base_summaries" not in kwargs: - kwargs["knowledge_base_summaries"] = [] - return kwargs - - -LIST_KNOWLEDGE_BASES = APIOperation( - input=ListKnowledgeBasesInput, - output=ListKnowledgeBasesOutput, - schema=_SCHEMA_LIST_KNOWLEDGE_BASES, - input_schema=_SCHEMA_LIST_KNOWLEDGE_BASES_INPUT, - output_schema=_SCHEMA_LIST_KNOWLEDGE_BASES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateAgentKnowledgeBaseInput: - """Dataclass for UpdateAgentKnowledgeBaseInput structure.""" - - agent_id: str | None = None - """ - The unique identifier of the agent associated with the knowledge base - that you want to update. - """ - - agent_version: str | None = None - """ - The version of the agent associated with the knowledge base that you - want to update. - """ - - knowledge_base_id: str | None = None - """ - The unique identifier of the knowledge base that has been associated - with an agent. - """ - - description: str | None = None - """ - Specifies a new description for the knowledge base associated with an - agent. - """ - - knowledge_base_state: str | None = None - """ - Specifies whether the agent uses the knowledge base or not when sending - an - [InvokeAgent](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html) - request. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_AGENT_KNOWLEDGE_BASE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.agent_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_AGENT_KNOWLEDGE_BASE_INPUT.members["agentId"], - self.agent_id, - ) - - if self.agent_version is not None: - serializer.write_string( - _SCHEMA_UPDATE_AGENT_KNOWLEDGE_BASE_INPUT.members["agentVersion"], - self.agent_version, - ) - - if self.knowledge_base_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_AGENT_KNOWLEDGE_BASE_INPUT.members["knowledgeBaseId"], - self.knowledge_base_id, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_AGENT_KNOWLEDGE_BASE_INPUT.members["description"], - self.description, - ) - - if self.knowledge_base_state is not None: - serializer.write_string( - _SCHEMA_UPDATE_AGENT_KNOWLEDGE_BASE_INPUT.members["knowledgeBaseState"], - self.knowledge_base_state, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_id"] = de.read_string( - _SCHEMA_UPDATE_AGENT_KNOWLEDGE_BASE_INPUT.members["agentId"] - ) - - case 1: - kwargs["agent_version"] = de.read_string( - _SCHEMA_UPDATE_AGENT_KNOWLEDGE_BASE_INPUT.members[ - "agentVersion" - ] - ) - - case 2: - kwargs["knowledge_base_id"] = de.read_string( - _SCHEMA_UPDATE_AGENT_KNOWLEDGE_BASE_INPUT.members[ - "knowledgeBaseId" - ] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_AGENT_KNOWLEDGE_BASE_INPUT.members["description"] - ) - - case 4: - kwargs["knowledge_base_state"] = KnowledgeBaseState( - de.read_string( - _SCHEMA_UPDATE_AGENT_KNOWLEDGE_BASE_INPUT.members[ - "knowledgeBaseState" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_AGENT_KNOWLEDGE_BASE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateAgentKnowledgeBaseOutput: - """Dataclass for UpdateAgentKnowledgeBaseOutput structure.""" - - agent_knowledge_base: AgentKnowledgeBase - """ - Contains details about the knowledge base that has been associated with - an agent. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_AGENT_KNOWLEDGE_BASE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_UPDATE_AGENT_KNOWLEDGE_BASE_OUTPUT.members["agentKnowledgeBase"], - self.agent_knowledge_base, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_knowledge_base"] = AgentKnowledgeBase.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_AGENT_KNOWLEDGE_BASE_OUTPUT, consumer=_consumer - ) - if "agent_knowledge_base" not in kwargs: - kwargs["agent_knowledge_base"] = AgentKnowledgeBase._smithy_default() - return kwargs - - -UPDATE_AGENT_KNOWLEDGE_BASE = APIOperation( - input=UpdateAgentKnowledgeBaseInput, - output=UpdateAgentKnowledgeBaseOutput, - schema=_SCHEMA_UPDATE_AGENT_KNOWLEDGE_BASE, - input_schema=_SCHEMA_UPDATE_AGENT_KNOWLEDGE_BASE_INPUT, - output_schema=_SCHEMA_UPDATE_AGENT_KNOWLEDGE_BASE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrockagent#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateKnowledgeBaseInput: - """Dataclass for UpdateKnowledgeBaseInput structure.""" - - knowledge_base_id: str | None = None - """The unique identifier of the knowledge base to update.""" - - name: str | None = None - """Specifies a new name for the knowledge base.""" - - description: str | None = None - """Specifies a new description for the knowledge base.""" - - role_arn: str | None = None - """ - Specifies a different Amazon Resource Name (ARN) of the IAM role with - permissions to invoke API operations on the knowledge base. - """ - - knowledge_base_configuration: KnowledgeBaseConfiguration | None = None - """ - Specifies the configuration for the embeddings model used for the - knowledge base. You must use the same configuration as when the - knowledge base was created. - """ - - storage_configuration: StorageConfiguration | None = None - """ - Specifies the configuration for the vector store used for the knowledge - base. You must use the same configuration as when the knowledge base was - created. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_KNOWLEDGE_BASE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.knowledge_base_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_KNOWLEDGE_BASE_INPUT.members["knowledgeBaseId"], - self.knowledge_base_id, - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_UPDATE_KNOWLEDGE_BASE_INPUT.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_KNOWLEDGE_BASE_INPUT.members["description"], - self.description, - ) - - if self.role_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_KNOWLEDGE_BASE_INPUT.members["roleArn"], self.role_arn - ) - - if self.knowledge_base_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_KNOWLEDGE_BASE_INPUT.members[ - "knowledgeBaseConfiguration" - ], - self.knowledge_base_configuration, - ) - - if self.storage_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_KNOWLEDGE_BASE_INPUT.members["storageConfiguration"], - self.storage_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["knowledge_base_id"] = de.read_string( - _SCHEMA_UPDATE_KNOWLEDGE_BASE_INPUT.members["knowledgeBaseId"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_KNOWLEDGE_BASE_INPUT.members["name"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_KNOWLEDGE_BASE_INPUT.members["description"] - ) - - case 3: - kwargs["role_arn"] = de.read_string( - _SCHEMA_UPDATE_KNOWLEDGE_BASE_INPUT.members["roleArn"] - ) - - case 4: - kwargs["knowledge_base_configuration"] = ( - KnowledgeBaseConfiguration.deserialize(de) - ) - - case 5: - kwargs["storage_configuration"] = StorageConfiguration.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_KNOWLEDGE_BASE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateKnowledgeBaseOutput: - """Dataclass for UpdateKnowledgeBaseOutput structure.""" - - knowledge_base: KnowledgeBase - """Contains details about the knowledge base.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_KNOWLEDGE_BASE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_UPDATE_KNOWLEDGE_BASE_OUTPUT.members["knowledgeBase"], - self.knowledge_base, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["knowledge_base"] = KnowledgeBase.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_KNOWLEDGE_BASE_OUTPUT, consumer=_consumer - ) - if "knowledge_base" not in kwargs: - kwargs["knowledge_base"] = KnowledgeBase._smithy_default() - return kwargs - - -UPDATE_KNOWLEDGE_BASE = APIOperation( - input=UpdateKnowledgeBaseInput, - output=UpdateKnowledgeBaseOutput, - schema=_SCHEMA_UPDATE_KNOWLEDGE_BASE, - input_schema=_SCHEMA_UPDATE_KNOWLEDGE_BASE_INPUT, - output_schema=_SCHEMA_UPDATE_KNOWLEDGE_BASE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrockagent#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListVpcConfigurationsInput: - """Dataclass for ListVpcConfigurationsInput structure.""" - - knowledge_base_id: str | None = None - """ - The unique identifier of the knowledge base whose VPC configurations you - want to list. - """ - - status_filter: str | None = None - """ - The status to filter the results by. Only VPC configurations with the - specified status are returned. - """ - - max_results: int | None = None - """ - The maximum number of results to return in the response. If more results - are available, the response returns a `nextToken`. - """ - - next_token: str | None = None - """ - A pagination token to retrieve the next page of results, returned in a - previous response when more results are available. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_VPC_CONFIGURATIONS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.knowledge_base_id is not None: - serializer.write_string( - _SCHEMA_LIST_VPC_CONFIGURATIONS_INPUT.members["knowledgeBaseId"], - self.knowledge_base_id, - ) - - if self.status_filter is not None: - serializer.write_string( - _SCHEMA_LIST_VPC_CONFIGURATIONS_INPUT.members["statusFilter"], - self.status_filter, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_VPC_CONFIGURATIONS_INPUT.members["maxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_VPC_CONFIGURATIONS_INPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["knowledge_base_id"] = de.read_string( - _SCHEMA_LIST_VPC_CONFIGURATIONS_INPUT.members["knowledgeBaseId"] - ) - - case 1: - kwargs["status_filter"] = VpcConfigurationStatus( - de.read_string( - _SCHEMA_LIST_VPC_CONFIGURATIONS_INPUT.members[ - "statusFilter" - ] - ) - ) - - case 2: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_VPC_CONFIGURATIONS_INPUT.members["maxResults"] - ) - - case 3: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_VPC_CONFIGURATIONS_INPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_VPC_CONFIGURATIONS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class VpcConfigurationSummary: - """A summary of a VPC configuration returned by `ListVpcConfigurations`.""" - - vpc_configuration_id: str - """The unique identifier of the VPC configuration.""" - - status: str - """The current lifecycle status of the VPC configuration.""" - - vpc_id: str - """ - The identifier of the VPC that the knowledge base connects through to - reach the resource. - """ - - resource_target: str - """The private IPv4 address or DNS name of the resource.""" - - port: int - """The port on which the resource is reached.""" - - protocol: str - """The protocol used to connect to the resource.""" - - resolution_mode: str - """Specifies how the resource target is resolved.""" - - created_at: datetime - """The time at which the VPC configuration was created.""" - - status_message: str | None = None - """ - Additional detail about the current status, such as the cause of a - failure. - """ - - host_header: str | None = None - """ - The HTTP `Host` header value sent when invoking the resource, if - configured. - """ - - tls_server_name: str | None = None - """ - The expected TLS server name that the service matches against the - Subject Alternative Names on the resource's TLS certificate. Present - when `protocol` is `HTTPS`. - """ - - name: str | None = None - """The human-readable name of the VPC configuration, if provided.""" - - description: str | None = None - """The description of the VPC configuration, if provided.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VPC_CONFIGURATION_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_VPC_CONFIGURATION_SUMMARY.members["vpcConfigurationId"], - self.vpc_configuration_id, - ) - serializer.write_string( - _SCHEMA_VPC_CONFIGURATION_SUMMARY.members["status"], self.status - ) - if self.status_message is not None: - serializer.write_string( - _SCHEMA_VPC_CONFIGURATION_SUMMARY.members["statusMessage"], - self.status_message, - ) - - serializer.write_string( - _SCHEMA_VPC_CONFIGURATION_SUMMARY.members["vpcId"], self.vpc_id - ) - serializer.write_string( - _SCHEMA_VPC_CONFIGURATION_SUMMARY.members["resourceTarget"], - self.resource_target, - ) - serializer.write_integer( - _SCHEMA_VPC_CONFIGURATION_SUMMARY.members["port"], self.port - ) - serializer.write_string( - _SCHEMA_VPC_CONFIGURATION_SUMMARY.members["protocol"], self.protocol - ) - serializer.write_string( - _SCHEMA_VPC_CONFIGURATION_SUMMARY.members["resolutionMode"], - self.resolution_mode, - ) - if self.host_header is not None: - serializer.write_string( - _SCHEMA_VPC_CONFIGURATION_SUMMARY.members["hostHeader"], - self.host_header, - ) - - if self.tls_server_name is not None: - serializer.write_string( - _SCHEMA_VPC_CONFIGURATION_SUMMARY.members["tlsServerName"], - self.tls_server_name, - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_VPC_CONFIGURATION_SUMMARY.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_VPC_CONFIGURATION_SUMMARY.members["description"], - self.description, - ) - - serializer.write_timestamp( - _SCHEMA_VPC_CONFIGURATION_SUMMARY.members["createdAt"], self.created_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["vpc_configuration_id"] = de.read_string( - _SCHEMA_VPC_CONFIGURATION_SUMMARY.members["vpcConfigurationId"] - ) - - case 1: - kwargs["status"] = VpcConfigurationStatus( - de.read_string( - _SCHEMA_VPC_CONFIGURATION_SUMMARY.members["status"] - ) - ) - - case 2: - kwargs["status_message"] = de.read_string( - _SCHEMA_VPC_CONFIGURATION_SUMMARY.members["statusMessage"] - ) - - case 3: - kwargs["vpc_id"] = de.read_string( - _SCHEMA_VPC_CONFIGURATION_SUMMARY.members["vpcId"] - ) - - case 4: - kwargs["resource_target"] = de.read_string( - _SCHEMA_VPC_CONFIGURATION_SUMMARY.members["resourceTarget"] - ) - - case 5: - kwargs["port"] = de.read_integer( - _SCHEMA_VPC_CONFIGURATION_SUMMARY.members["port"] - ) - - case 6: - kwargs["protocol"] = VpcProtocol( - de.read_string( - _SCHEMA_VPC_CONFIGURATION_SUMMARY.members["protocol"] - ) - ) - - case 7: - kwargs["resolution_mode"] = VpcResolutionMode( - de.read_string( - _SCHEMA_VPC_CONFIGURATION_SUMMARY.members["resolutionMode"] - ) - ) - - case 8: - kwargs["host_header"] = de.read_string( - _SCHEMA_VPC_CONFIGURATION_SUMMARY.members["hostHeader"] - ) - - case 9: - kwargs["tls_server_name"] = de.read_string( - _SCHEMA_VPC_CONFIGURATION_SUMMARY.members["tlsServerName"] - ) - - case 10: - kwargs["name"] = de.read_string( - _SCHEMA_VPC_CONFIGURATION_SUMMARY.members["name"] - ) - - case 11: - kwargs["description"] = de.read_string( - _SCHEMA_VPC_CONFIGURATION_SUMMARY.members["description"] - ) - - case 12: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_VPC_CONFIGURATION_SUMMARY.members["createdAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VPC_CONFIGURATION_SUMMARY, consumer=_consumer) - if "vpc_configuration_id" not in kwargs: - kwargs["vpc_configuration_id"] = "" - if "status" not in kwargs: - kwargs["status"] = VpcConfigurationStatus._corrected("") - if "vpc_id" not in kwargs: - kwargs["vpc_id"] = "" - if "resource_target" not in kwargs: - kwargs["resource_target"] = "" - if "port" not in kwargs: - kwargs["port"] = 0 - if "protocol" not in kwargs: - kwargs["protocol"] = VpcProtocol._corrected("") - if "resolution_mode" not in kwargs: - kwargs["resolution_mode"] = VpcResolutionMode._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_vpc_configuration_summary_list( - serializer: ShapeSerializer, schema: Schema, value: list[VpcConfigurationSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_vpc_configuration_summary_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[VpcConfigurationSummary]: - result: list[VpcConfigurationSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(VpcConfigurationSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListVpcConfigurationsOutput: - """Dataclass for ListVpcConfigurationsOutput structure.""" - - items: list[VpcConfigurationSummary] - """A list of VPC configuration summaries.""" - - next_token: str | None = None - """ - A pagination token to retrieve the next page of results, present when - the total number of results exceeds the maximum number of results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_VPC_CONFIGURATIONS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_vpc_configuration_summary_list( - serializer, - _SCHEMA_LIST_VPC_CONFIGURATIONS_OUTPUT.members["items"], - self.items, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_VPC_CONFIGURATIONS_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["items"] = _deserialize_vpc_configuration_summary_list( - de, _SCHEMA_LIST_VPC_CONFIGURATIONS_OUTPUT.members["items"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_VPC_CONFIGURATIONS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_VPC_CONFIGURATIONS_OUTPUT, consumer=_consumer - ) - if "items" not in kwargs: - kwargs["items"] = [] - return kwargs - - -LIST_VPC_CONFIGURATIONS = APIOperation( - input=ListVpcConfigurationsInput, - output=ListVpcConfigurationsOutput, - schema=_SCHEMA_LIST_VPC_CONFIGURATIONS, - input_schema=_SCHEMA_LIST_VPC_CONFIGURATIONS_INPUT, - output_schema=_SCHEMA_LIST_VPC_CONFIGURATIONS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class PromptAgentResource: - """ - Contains specifications for an Amazon Bedrock agent with which to use - the prompt. For more information, see [Create a prompt using Prompt - management](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-create.html) - and [Automate tasks in your application using conversational - agents](https://docs.aws.amazon.com/bedrock/latest/userguide/agents.html). - """ - - agent_identifier: str - """The ARN of the agent with which to use the prompt.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PROMPT_AGENT_RESOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_PROMPT_AGENT_RESOURCE.members["agentIdentifier"], - self.agent_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_identifier"] = de.read_string( - _SCHEMA_PROMPT_AGENT_RESOURCE.members["agentIdentifier"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PROMPT_AGENT_RESOURCE, consumer=_consumer) - if "agent_identifier" not in kwargs: - kwargs["agent_identifier"] = "" - return kwargs - - -@dataclass -class PromptGenAiResourceAgent: - """Specifies an Amazon Bedrock agent with which to use the prompt.""" - - value: PromptAgentResource - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PROMPT_GEN_AI_RESOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_PROMPT_GEN_AI_RESOURCE.members["agent"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=PromptAgentResource.deserialize(deserializer)) - - -@dataclass -class PromptGenAiResourceUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -PromptGenAiResource = Union[PromptGenAiResourceAgent | PromptGenAiResourceUnknown] -""" -Contains specifications for a generative AI resource with which to use -the prompt. For more information, see [Create a prompt using Prompt -management](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-create.html). -""" - - -class _PromptGenAiResourceDeserializer: - _result: PromptGenAiResource | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> PromptGenAiResource: - self._result = None - deserializer.read_struct(_SCHEMA_PROMPT_GEN_AI_RESOURCE, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(PromptGenAiResourceAgent.deserialize(de)) - - case _: - self._set_result( - PromptGenAiResourceUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: PromptGenAiResource) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class PromptMetadataEntry: - """ - Contains a key-value pair that defines a metadata tag and value to - attach to a prompt variant. For more information, see [Create a prompt - using Prompt - management](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-create.html). - """ - - key: str = field(repr=False) - """The key of a metadata tag for a prompt variant.""" - - value: str = field(repr=False) - """The value of a metadata tag for a prompt variant.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PROMPT_METADATA_ENTRY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_PROMPT_METADATA_ENTRY.members["key"], self.key) - serializer.write_string( - _SCHEMA_PROMPT_METADATA_ENTRY.members["value"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["key"] = de.read_string( - _SCHEMA_PROMPT_METADATA_ENTRY.members["key"] - ) - - case 1: - kwargs["value"] = de.read_string( - _SCHEMA_PROMPT_METADATA_ENTRY.members["value"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PROMPT_METADATA_ENTRY, consumer=_consumer) - if "key" not in kwargs: - kwargs["key"] = "" - if "value" not in kwargs: - kwargs["value"] = "" - return kwargs - - -def _serialize_prompt_metadata_list( - serializer: ShapeSerializer, schema: Schema, value: list[PromptMetadataEntry] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_prompt_metadata_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[PromptMetadataEntry]: - result: list[PromptMetadataEntry] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(PromptMetadataEntry.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class PromptVariant: - """Contains details about a variant of the prompt.""" - - name: str - """The name of the prompt variant.""" - - template_type: str - """The type of prompt template to use.""" - - template_configuration: PromptTemplateConfiguration - """Contains configurations for the prompt template.""" - - model_id: str | None = None - """ - The unique identifier of the model or [inference - profile](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html) - with which to run inference on the prompt. - """ - - inference_configuration: PromptInferenceConfiguration | None = None - """Contains inference configurations for the prompt variant.""" - - metadata: list[PromptMetadataEntry] | None = field(repr=False, default=None) - """ - An array of objects, each containing a key-value pair that defines a - metadata tag and value to attach to a prompt variant. - """ - - additional_model_request_fields: Document | None = None - """ - Contains model-specific inference configurations that aren't in the - `inferenceConfiguration` field. To see model-specific inference - parameters, see [Inference request parameters and response fields for - foundation - models](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). - """ - - gen_ai_resource: PromptGenAiResource | None = field(repr=False, default=None) - """Specifies a generative AI resource with which to use the prompt.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PROMPT_VARIANT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_PROMPT_VARIANT.members["name"], self.name) - serializer.write_string( - _SCHEMA_PROMPT_VARIANT.members["templateType"], self.template_type - ) - serializer.write_struct( - _SCHEMA_PROMPT_VARIANT.members["templateConfiguration"], - self.template_configuration, - ) - if self.model_id is not None: - serializer.write_string( - _SCHEMA_PROMPT_VARIANT.members["modelId"], self.model_id - ) - - if self.inference_configuration is not None: - serializer.write_struct( - _SCHEMA_PROMPT_VARIANT.members["inferenceConfiguration"], - self.inference_configuration, - ) - - if self.metadata is not None: - _serialize_prompt_metadata_list( - serializer, _SCHEMA_PROMPT_VARIANT.members["metadata"], self.metadata - ) - - if self.additional_model_request_fields is not None: - serializer.write_document( - _SCHEMA_PROMPT_VARIANT.members["additionalModelRequestFields"], - self.additional_model_request_fields, - ) - - if self.gen_ai_resource is not None: - serializer.write_struct( - _SCHEMA_PROMPT_VARIANT.members["genAiResource"], self.gen_ai_resource - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_PROMPT_VARIANT.members["name"] - ) - - case 1: - kwargs["template_type"] = PromptTemplateType( - de.read_string(_SCHEMA_PROMPT_VARIANT.members["templateType"]) - ) - - case 2: - kwargs["template_configuration"] = ( - _PromptTemplateConfigurationDeserializer().deserialize(de) - ) - - case 3: - kwargs["model_id"] = de.read_string( - _SCHEMA_PROMPT_VARIANT.members["modelId"] - ) - - case 4: - kwargs["inference_configuration"] = ( - _PromptInferenceConfigurationDeserializer().deserialize(de) - ) - - case 5: - kwargs["metadata"] = _deserialize_prompt_metadata_list( - de, _SCHEMA_PROMPT_VARIANT.members["metadata"] - ) - - case 6: - kwargs["additional_model_request_fields"] = de.read_document( - _SCHEMA_PROMPT_VARIANT.members["additionalModelRequestFields"] - ) - - case 7: - kwargs["gen_ai_resource"] = ( - _PromptGenAiResourceDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PROMPT_VARIANT, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "template_type" not in kwargs: - kwargs["template_type"] = PromptTemplateType._corrected("") - if "template_configuration" not in kwargs: - kwargs["template_configuration"] = PromptTemplateConfigurationUnknown( - tag="" - ) - return kwargs - - -def _serialize_prompt_variant_list( - serializer: ShapeSerializer, schema: Schema, value: list[PromptVariant] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_prompt_variant_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[PromptVariant]: - result: list[PromptVariant] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(PromptVariant.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CreatePromptInput: - """Dataclass for CreatePromptInput structure.""" - - name: str | None = None - """A name for the prompt.""" - - description: str | None = None - """A description for the prompt.""" - - customer_encryption_key_arn: str | None = None - """The Amazon Resource Name (ARN) of the KMS key to encrypt the prompt.""" - - default_variant: str | None = None - """ - The name of the default variant for the prompt. This value must match - the `name` field in the relevant - [PromptVariant](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptVariant.html) - object. - """ - - variants: list[PromptVariant] | None = field(repr=False, default=None) - """ - A list of objects, each containing details about a variant of the - prompt. - """ - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If this token matches a previous - request, Amazon Bedrock ignores the request, but does not return an - error. For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - tags: dict[str, str] | None = None - """ - Any tags that you want to attach to the prompt. For more information, - see [Tagging resources in Amazon - Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/tagging.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_PROMPT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_PROMPT_INPUT.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_PROMPT_INPUT.members["description"], self.description - ) - - if self.customer_encryption_key_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_PROMPT_INPUT.members["customerEncryptionKeyArn"], - self.customer_encryption_key_arn, - ) - - if self.default_variant is not None: - serializer.write_string( - _SCHEMA_CREATE_PROMPT_INPUT.members["defaultVariant"], - self.default_variant, - ) - - if self.variants is not None: - _serialize_prompt_variant_list( - serializer, - _SCHEMA_CREATE_PROMPT_INPUT.members["variants"], - self.variants, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_PROMPT_INPUT.members["clientToken"], self.client_token - ) - - if self.tags is not None: - _serialize_tags_map( - serializer, _SCHEMA_CREATE_PROMPT_INPUT.members["tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_PROMPT_INPUT.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_PROMPT_INPUT.members["description"] - ) - - case 2: - kwargs["customer_encryption_key_arn"] = de.read_string( - _SCHEMA_CREATE_PROMPT_INPUT.members["customerEncryptionKeyArn"] - ) - - case 3: - kwargs["default_variant"] = de.read_string( - _SCHEMA_CREATE_PROMPT_INPUT.members["defaultVariant"] - ) - - case 4: - kwargs["variants"] = _deserialize_prompt_variant_list( - de, _SCHEMA_CREATE_PROMPT_INPUT.members["variants"] - ) - - case 5: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_PROMPT_INPUT.members["clientToken"] - ) - - case 6: - kwargs["tags"] = _deserialize_tags_map( - de, _SCHEMA_CREATE_PROMPT_INPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_PROMPT_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CreatePromptOutput: - """Dataclass for CreatePromptOutput structure.""" - - name: str - """The name of the prompt.""" - - id: str - """The unique identifier of the prompt.""" - - arn: str - """The Amazon Resource Name (ARN) of the prompt.""" - - version: str - """ - The version of the prompt. When you create a prompt, the version created - is the `DRAFT` version. - """ - - created_at: datetime - """The time at which the prompt was created.""" - - updated_at: datetime - """The time at which the prompt was last updated.""" - - description: str | None = None - """The description of the prompt.""" - - customer_encryption_key_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the KMS key that you encrypted the - prompt with. - """ - - default_variant: str | None = None - """The name of the default variant for your prompt.""" - - variants: list[PromptVariant] | None = field(repr=False, default=None) - """ - A list of objects, each containing details about a variant of the - prompt. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_PROMPT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_CREATE_PROMPT_OUTPUT.members["name"], self.name) - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_PROMPT_OUTPUT.members["description"], self.description - ) - - if self.customer_encryption_key_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_PROMPT_OUTPUT.members["customerEncryptionKeyArn"], - self.customer_encryption_key_arn, - ) - - if self.default_variant is not None: - serializer.write_string( - _SCHEMA_CREATE_PROMPT_OUTPUT.members["defaultVariant"], - self.default_variant, - ) - - if self.variants is not None: - _serialize_prompt_variant_list( - serializer, - _SCHEMA_CREATE_PROMPT_OUTPUT.members["variants"], - self.variants, - ) - - serializer.write_string(_SCHEMA_CREATE_PROMPT_OUTPUT.members["id"], self.id) - serializer.write_string(_SCHEMA_CREATE_PROMPT_OUTPUT.members["arn"], self.arn) - serializer.write_string( - _SCHEMA_CREATE_PROMPT_OUTPUT.members["version"], self.version - ) - serializer.write_timestamp( - _SCHEMA_CREATE_PROMPT_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_CREATE_PROMPT_OUTPUT.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_PROMPT_OUTPUT.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_PROMPT_OUTPUT.members["description"] - ) - - case 2: - kwargs["customer_encryption_key_arn"] = de.read_string( - _SCHEMA_CREATE_PROMPT_OUTPUT.members["customerEncryptionKeyArn"] - ) - - case 3: - kwargs["default_variant"] = de.read_string( - _SCHEMA_CREATE_PROMPT_OUTPUT.members["defaultVariant"] - ) - - case 4: - kwargs["variants"] = _deserialize_prompt_variant_list( - de, _SCHEMA_CREATE_PROMPT_OUTPUT.members["variants"] - ) - - case 5: - kwargs["id"] = de.read_string( - _SCHEMA_CREATE_PROMPT_OUTPUT.members["id"] - ) - - case 6: - kwargs["arn"] = de.read_string( - _SCHEMA_CREATE_PROMPT_OUTPUT.members["arn"] - ) - - case 7: - kwargs["version"] = de.read_string( - _SCHEMA_CREATE_PROMPT_OUTPUT.members["version"] - ) - - case 8: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_CREATE_PROMPT_OUTPUT.members["createdAt"] - ) - - case 9: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_CREATE_PROMPT_OUTPUT.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_PROMPT_OUTPUT, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "id" not in kwargs: - kwargs["id"] = "" - if "arn" not in kwargs: - kwargs["arn"] = "" - if "version" not in kwargs: - kwargs["version"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -CREATE_PROMPT = APIOperation( - input=CreatePromptInput, - output=CreatePromptOutput, - schema=_SCHEMA_CREATE_PROMPT, - input_schema=_SCHEMA_CREATE_PROMPT_INPUT, - output_schema=_SCHEMA_CREATE_PROMPT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrockagent#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class CreatePromptVersionInput: - """Dataclass for CreatePromptVersionInput structure.""" - - prompt_identifier: str | None = None - """ - The unique identifier of the prompt that you want to create a version - of. - """ - - description: str | None = None - """A description for the version of the prompt.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If this token matches a previous - request, Amazon Bedrock ignores the request, but does not return an - error. For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - tags: dict[str, str] | None = None - """ - Any tags that you want to attach to the version of the prompt. For more - information, see [Tagging resources in Amazon - Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/tagging.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_PROMPT_VERSION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.prompt_identifier is not None: - serializer.write_string( - _SCHEMA_CREATE_PROMPT_VERSION_INPUT.members["promptIdentifier"], - self.prompt_identifier, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_PROMPT_VERSION_INPUT.members["description"], - self.description, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_PROMPT_VERSION_INPUT.members["clientToken"], - self.client_token, - ) - - if self.tags is not None: - _serialize_tags_map( - serializer, - _SCHEMA_CREATE_PROMPT_VERSION_INPUT.members["tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["prompt_identifier"] = de.read_string( - _SCHEMA_CREATE_PROMPT_VERSION_INPUT.members["promptIdentifier"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_PROMPT_VERSION_INPUT.members["description"] - ) - - case 2: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_PROMPT_VERSION_INPUT.members["clientToken"] - ) - - case 3: - kwargs["tags"] = _deserialize_tags_map( - de, _SCHEMA_CREATE_PROMPT_VERSION_INPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_PROMPT_VERSION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CreatePromptVersionOutput: - """Dataclass for CreatePromptVersionOutput structure.""" - - name: str - """The name of the prompt.""" - - id: str - """The unique identifier of the prompt.""" - - arn: str - """The Amazon Resource Name (ARN) of the version of the prompt.""" - - version: str - """ - The version of the prompt that was created. Versions are numbered - incrementally, starting from 1. - """ - - created_at: datetime - """The time at which the prompt was created.""" - - updated_at: datetime - """The time at which the prompt was last updated.""" - - description: str | None = None - """A description for the version.""" - - customer_encryption_key_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the KMS key to encrypt the version of - the prompt. - """ - - default_variant: str | None = None - """ - The name of the default variant for the prompt. This value must match - the `name` field in the relevant - [PromptVariant](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptVariant.html) - object. - """ - - variants: list[PromptVariant] | None = field(repr=False, default=None) - """ - A list of objects, each containing details about a variant of the - prompt. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_PROMPT_VERSION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_PROMPT_VERSION_OUTPUT.members["name"], self.name - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_PROMPT_VERSION_OUTPUT.members["description"], - self.description, - ) - - if self.customer_encryption_key_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_PROMPT_VERSION_OUTPUT.members[ - "customerEncryptionKeyArn" - ], - self.customer_encryption_key_arn, - ) - - if self.default_variant is not None: - serializer.write_string( - _SCHEMA_CREATE_PROMPT_VERSION_OUTPUT.members["defaultVariant"], - self.default_variant, - ) - - if self.variants is not None: - _serialize_prompt_variant_list( - serializer, - _SCHEMA_CREATE_PROMPT_VERSION_OUTPUT.members["variants"], - self.variants, - ) - - serializer.write_string( - _SCHEMA_CREATE_PROMPT_VERSION_OUTPUT.members["id"], self.id - ) - serializer.write_string( - _SCHEMA_CREATE_PROMPT_VERSION_OUTPUT.members["arn"], self.arn - ) - serializer.write_string( - _SCHEMA_CREATE_PROMPT_VERSION_OUTPUT.members["version"], self.version - ) - serializer.write_timestamp( - _SCHEMA_CREATE_PROMPT_VERSION_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_CREATE_PROMPT_VERSION_OUTPUT.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_PROMPT_VERSION_OUTPUT.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_PROMPT_VERSION_OUTPUT.members["description"] - ) - - case 2: - kwargs["customer_encryption_key_arn"] = de.read_string( - _SCHEMA_CREATE_PROMPT_VERSION_OUTPUT.members[ - "customerEncryptionKeyArn" - ] - ) - - case 3: - kwargs["default_variant"] = de.read_string( - _SCHEMA_CREATE_PROMPT_VERSION_OUTPUT.members["defaultVariant"] - ) - - case 4: - kwargs["variants"] = _deserialize_prompt_variant_list( - de, _SCHEMA_CREATE_PROMPT_VERSION_OUTPUT.members["variants"] - ) - - case 5: - kwargs["id"] = de.read_string( - _SCHEMA_CREATE_PROMPT_VERSION_OUTPUT.members["id"] - ) - - case 6: - kwargs["arn"] = de.read_string( - _SCHEMA_CREATE_PROMPT_VERSION_OUTPUT.members["arn"] - ) - - case 7: - kwargs["version"] = de.read_string( - _SCHEMA_CREATE_PROMPT_VERSION_OUTPUT.members["version"] - ) - - case 8: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_CREATE_PROMPT_VERSION_OUTPUT.members["createdAt"] - ) - - case 9: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_CREATE_PROMPT_VERSION_OUTPUT.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_PROMPT_VERSION_OUTPUT, consumer=_consumer - ) - if "name" not in kwargs: - kwargs["name"] = "" - if "id" not in kwargs: - kwargs["id"] = "" - if "arn" not in kwargs: - kwargs["arn"] = "" - if "version" not in kwargs: - kwargs["version"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -CREATE_PROMPT_VERSION = APIOperation( - input=CreatePromptVersionInput, - output=CreatePromptVersionOutput, - schema=_SCHEMA_CREATE_PROMPT_VERSION, - input_schema=_SCHEMA_CREATE_PROMPT_VERSION_INPUT, - output_schema=_SCHEMA_CREATE_PROMPT_VERSION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrockagent#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeletePromptInput: - """Dataclass for DeletePromptInput structure.""" - - prompt_identifier: str | None = None - """The unique identifier of the prompt.""" - - prompt_version: str | None = None - """ - The version of the prompt to delete. To delete the prompt, omit this - field. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_PROMPT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.prompt_identifier is not None: - serializer.write_string( - _SCHEMA_DELETE_PROMPT_INPUT.members["promptIdentifier"], - self.prompt_identifier, - ) - - if self.prompt_version is not None: - serializer.write_string( - _SCHEMA_DELETE_PROMPT_INPUT.members["promptVersion"], - self.prompt_version, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["prompt_identifier"] = de.read_string( - _SCHEMA_DELETE_PROMPT_INPUT.members["promptIdentifier"] - ) - - case 1: - kwargs["prompt_version"] = de.read_string( - _SCHEMA_DELETE_PROMPT_INPUT.members["promptVersion"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_PROMPT_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeletePromptOutput: - """Dataclass for DeletePromptOutput structure.""" - - id: str - """The unique identifier of the prompt that was deleted.""" - - version: str | None = None - """The version of the prompt that was deleted.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_PROMPT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_DELETE_PROMPT_OUTPUT.members["id"], self.id) - if self.version is not None: - serializer.write_string( - _SCHEMA_DELETE_PROMPT_OUTPUT.members["version"], self.version - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_DELETE_PROMPT_OUTPUT.members["id"] - ) - - case 1: - kwargs["version"] = de.read_string( - _SCHEMA_DELETE_PROMPT_OUTPUT.members["version"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_PROMPT_OUTPUT, consumer=_consumer) - if "id" not in kwargs: - kwargs["id"] = "" - return kwargs - - -DELETE_PROMPT = APIOperation( - input=DeletePromptInput, - output=DeletePromptOutput, - schema=_SCHEMA_DELETE_PROMPT, - input_schema=_SCHEMA_DELETE_PROMPT_INPUT, - output_schema=_SCHEMA_DELETE_PROMPT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrockagent#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetPromptInput: - """Dataclass for GetPromptInput structure.""" - - prompt_identifier: str | None = None - """The unique identifier of the prompt.""" - - prompt_version: str | None = None - """ - The version of the prompt about which you want to retrieve information. - Omit this field to return information about the working draft of the - prompt. - """ - - included_data: str | None = None - """ - Controls the scope of data returned. Set to `METADATA_ONLY` to return - only resource metadata. Set to `ALL_DATA` or omit this field to return - the full response. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_PROMPT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.prompt_identifier is not None: - serializer.write_string( - _SCHEMA_GET_PROMPT_INPUT.members["promptIdentifier"], - self.prompt_identifier, - ) - - if self.prompt_version is not None: - serializer.write_string( - _SCHEMA_GET_PROMPT_INPUT.members["promptVersion"], self.prompt_version - ) - - if self.included_data is not None: - serializer.write_string( - _SCHEMA_GET_PROMPT_INPUT.members["includedData"], self.included_data - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["prompt_identifier"] = de.read_string( - _SCHEMA_GET_PROMPT_INPUT.members["promptIdentifier"] - ) - - case 1: - kwargs["prompt_version"] = de.read_string( - _SCHEMA_GET_PROMPT_INPUT.members["promptVersion"] - ) - - case 2: - kwargs["included_data"] = IncludedData( - de.read_string(_SCHEMA_GET_PROMPT_INPUT.members["includedData"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_PROMPT_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetPromptOutput: - """Dataclass for GetPromptOutput structure.""" - - name: str - """The name of the prompt.""" - - id: str - """The unique identifier of the prompt.""" - - arn: str - """ - The Amazon Resource Name (ARN) of the prompt or the prompt version (if - you specified a version in the request). - """ - - version: str - """The version of the prompt.""" - - created_at: datetime - """The time at which the prompt was created.""" - - updated_at: datetime - """The time at which the prompt was last updated.""" - - description: str | None = None - """The descriptino of the prompt.""" - - customer_encryption_key_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the KMS key that the prompt is - encrypted with. - """ - - default_variant: str | None = None - """ - The name of the default variant for the prompt. This value must match - the `name` field in the relevant - [PromptVariant](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptVariant.html) - object. - """ - - variants: list[PromptVariant] | None = field(repr=False, default=None) - """ - A list of objects, each containing details about a variant of the - prompt. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_PROMPT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_GET_PROMPT_OUTPUT.members["name"], self.name) - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_PROMPT_OUTPUT.members["description"], self.description - ) - - if self.customer_encryption_key_arn is not None: - serializer.write_string( - _SCHEMA_GET_PROMPT_OUTPUT.members["customerEncryptionKeyArn"], - self.customer_encryption_key_arn, - ) - - if self.default_variant is not None: - serializer.write_string( - _SCHEMA_GET_PROMPT_OUTPUT.members["defaultVariant"], - self.default_variant, - ) - - if self.variants is not None: - _serialize_prompt_variant_list( - serializer, _SCHEMA_GET_PROMPT_OUTPUT.members["variants"], self.variants - ) - - serializer.write_string(_SCHEMA_GET_PROMPT_OUTPUT.members["id"], self.id) - serializer.write_string(_SCHEMA_GET_PROMPT_OUTPUT.members["arn"], self.arn) - serializer.write_string( - _SCHEMA_GET_PROMPT_OUTPUT.members["version"], self.version - ) - serializer.write_timestamp( - _SCHEMA_GET_PROMPT_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_GET_PROMPT_OUTPUT.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_GET_PROMPT_OUTPUT.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_GET_PROMPT_OUTPUT.members["description"] - ) - - case 2: - kwargs["customer_encryption_key_arn"] = de.read_string( - _SCHEMA_GET_PROMPT_OUTPUT.members["customerEncryptionKeyArn"] - ) - - case 3: - kwargs["default_variant"] = de.read_string( - _SCHEMA_GET_PROMPT_OUTPUT.members["defaultVariant"] - ) - - case 4: - kwargs["variants"] = _deserialize_prompt_variant_list( - de, _SCHEMA_GET_PROMPT_OUTPUT.members["variants"] - ) - - case 5: - kwargs["id"] = de.read_string( - _SCHEMA_GET_PROMPT_OUTPUT.members["id"] - ) - - case 6: - kwargs["arn"] = de.read_string( - _SCHEMA_GET_PROMPT_OUTPUT.members["arn"] - ) - - case 7: - kwargs["version"] = de.read_string( - _SCHEMA_GET_PROMPT_OUTPUT.members["version"] - ) - - case 8: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_PROMPT_OUTPUT.members["createdAt"] - ) - - case 9: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_GET_PROMPT_OUTPUT.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_PROMPT_OUTPUT, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "id" not in kwargs: - kwargs["id"] = "" - if "arn" not in kwargs: - kwargs["arn"] = "" - if "version" not in kwargs: - kwargs["version"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -GET_PROMPT = APIOperation( - input=GetPromptInput, - output=GetPromptOutput, - schema=_SCHEMA_GET_PROMPT, - input_schema=_SCHEMA_GET_PROMPT_INPUT, - output_schema=_SCHEMA_GET_PROMPT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListPromptsInput: - """Dataclass for ListPromptsInput structure.""" - - prompt_identifier: str | None = None - """ - The unique identifier of the prompt for whose versions you want to - return information. Omit this field to list information about all - prompts in an account. - """ - - max_results: int | None = None - """ - The maximum number of results to return in the response. If the total - number of results is greater than this value, use the token returned in - the response in the `nextToken` field when making another request to - return the next batch of results. - """ - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, enter the token returned in the `nextToken` - field in the response in this field to return the next batch of results. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_PROMPTS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.prompt_identifier is not None: - serializer.write_string( - _SCHEMA_LIST_PROMPTS_INPUT.members["promptIdentifier"], - self.prompt_identifier, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_PROMPTS_INPUT.members["maxResults"], self.max_results - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_PROMPTS_INPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["prompt_identifier"] = de.read_string( - _SCHEMA_LIST_PROMPTS_INPUT.members["promptIdentifier"] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_PROMPTS_INPUT.members["maxResults"] - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_PROMPTS_INPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_PROMPTS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class PromptSummary: - """ - Contains information about a prompt in your Prompt management tool. - - This data type is used in the following API operations: - - - [ListPrompts - response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_ListPrompts.html#API_agent_ListPrompts_ResponseSyntax) - """ - - name: str - """The name of the prompt.""" - - id: str - """The unique identifier of the prompt.""" - - arn: str - """ - The Amazon Resource Name (ARN) of the prompt or the prompt version (if - you specified a version in the request). - """ - - version: str - """The version of the prompt that this summary applies to.""" - - created_at: datetime - """The time at which the prompt was created.""" - - updated_at: datetime - """The time at which the prompt was last updated.""" - - description: str | None = None - """The description of the prompt.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PROMPT_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_PROMPT_SUMMARY.members["name"], self.name) - if self.description is not None: - serializer.write_string( - _SCHEMA_PROMPT_SUMMARY.members["description"], self.description - ) - - serializer.write_string(_SCHEMA_PROMPT_SUMMARY.members["id"], self.id) - serializer.write_string(_SCHEMA_PROMPT_SUMMARY.members["arn"], self.arn) - serializer.write_string(_SCHEMA_PROMPT_SUMMARY.members["version"], self.version) - serializer.write_timestamp( - _SCHEMA_PROMPT_SUMMARY.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_PROMPT_SUMMARY.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_PROMPT_SUMMARY.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_PROMPT_SUMMARY.members["description"] - ) - - case 2: - kwargs["id"] = de.read_string(_SCHEMA_PROMPT_SUMMARY.members["id"]) - - case 3: - kwargs["arn"] = de.read_string( - _SCHEMA_PROMPT_SUMMARY.members["arn"] - ) - - case 4: - kwargs["version"] = de.read_string( - _SCHEMA_PROMPT_SUMMARY.members["version"] - ) - - case 5: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_PROMPT_SUMMARY.members["createdAt"] - ) - - case 6: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_PROMPT_SUMMARY.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PROMPT_SUMMARY, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "id" not in kwargs: - kwargs["id"] = "" - if "arn" not in kwargs: - kwargs["arn"] = "" - if "version" not in kwargs: - kwargs["version"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_prompt_summaries( - serializer: ShapeSerializer, schema: Schema, value: list[PromptSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_prompt_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[PromptSummary]: - result: list[PromptSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(PromptSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListPromptsOutput: - """Dataclass for ListPromptsOutput structure.""" - - prompt_summaries: list[PromptSummary] - """ - A list, each member of which contains information about a prompt using - Prompt management. - """ - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, use this token when making another request in - the `nextToken` field to return the next batch of results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_PROMPTS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_prompt_summaries( - serializer, - _SCHEMA_LIST_PROMPTS_OUTPUT.members["promptSummaries"], - self.prompt_summaries, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_PROMPTS_OUTPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["prompt_summaries"] = _deserialize_prompt_summaries( - de, _SCHEMA_LIST_PROMPTS_OUTPUT.members["promptSummaries"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_PROMPTS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_PROMPTS_OUTPUT, consumer=_consumer) - if "prompt_summaries" not in kwargs: - kwargs["prompt_summaries"] = [] - return kwargs - - -LIST_PROMPTS = APIOperation( - input=ListPromptsInput, - output=ListPromptsOutput, - schema=_SCHEMA_LIST_PROMPTS, - input_schema=_SCHEMA_LIST_PROMPTS_INPUT, - output_schema=_SCHEMA_LIST_PROMPTS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdatePromptInput: - """Dataclass for UpdatePromptInput structure.""" - - name: str | None = None - """A name for the prompt.""" - - description: str | None = None - """A description for the prompt.""" - - customer_encryption_key_arn: str | None = None - """The Amazon Resource Name (ARN) of the KMS key to encrypt the prompt.""" - - default_variant: str | None = None - """ - The name of the default variant for the prompt. This value must match - the `name` field in the relevant - [PromptVariant](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptVariant.html) - object. - """ - - variants: list[PromptVariant] | None = field(repr=False, default=None) - """ - A list of objects, each containing details about a variant of the - prompt. - """ - - prompt_identifier: str | None = None - """The unique identifier of the prompt.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_PROMPT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_UPDATE_PROMPT_INPUT.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_PROMPT_INPUT.members["description"], self.description - ) - - if self.customer_encryption_key_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_PROMPT_INPUT.members["customerEncryptionKeyArn"], - self.customer_encryption_key_arn, - ) - - if self.default_variant is not None: - serializer.write_string( - _SCHEMA_UPDATE_PROMPT_INPUT.members["defaultVariant"], - self.default_variant, - ) - - if self.variants is not None: - _serialize_prompt_variant_list( - serializer, - _SCHEMA_UPDATE_PROMPT_INPUT.members["variants"], - self.variants, - ) - - if self.prompt_identifier is not None: - serializer.write_string( - _SCHEMA_UPDATE_PROMPT_INPUT.members["promptIdentifier"], - self.prompt_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_PROMPT_INPUT.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_PROMPT_INPUT.members["description"] - ) - - case 2: - kwargs["customer_encryption_key_arn"] = de.read_string( - _SCHEMA_UPDATE_PROMPT_INPUT.members["customerEncryptionKeyArn"] - ) - - case 3: - kwargs["default_variant"] = de.read_string( - _SCHEMA_UPDATE_PROMPT_INPUT.members["defaultVariant"] - ) - - case 4: - kwargs["variants"] = _deserialize_prompt_variant_list( - de, _SCHEMA_UPDATE_PROMPT_INPUT.members["variants"] - ) - - case 5: - kwargs["prompt_identifier"] = de.read_string( - _SCHEMA_UPDATE_PROMPT_INPUT.members["promptIdentifier"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_PROMPT_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdatePromptOutput: - """Dataclass for UpdatePromptOutput structure.""" - - name: str - """The name of the prompt.""" - - id: str - """The unique identifier of the prompt.""" - - arn: str - """The Amazon Resource Name (ARN) of the prompt.""" - - version: str - """ - The version of the prompt. When you update a prompt, the version updated - is the `DRAFT` version. - """ - - created_at: datetime - """The time at which the prompt was created.""" - - updated_at: datetime - """The time at which the prompt was last updated.""" - - description: str | None = None - """The description of the prompt.""" - - customer_encryption_key_arn: str | None = None - """The Amazon Resource Name (ARN) of the KMS key to encrypt the prompt.""" - - default_variant: str | None = None - """ - The name of the default variant for the prompt. This value must match - the `name` field in the relevant - [PromptVariant](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptVariant.html) - object. - """ - - variants: list[PromptVariant] | None = field(repr=False, default=None) - """ - A list of objects, each containing details about a variant of the - prompt. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_PROMPT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_UPDATE_PROMPT_OUTPUT.members["name"], self.name) - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_PROMPT_OUTPUT.members["description"], self.description - ) - - if self.customer_encryption_key_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_PROMPT_OUTPUT.members["customerEncryptionKeyArn"], - self.customer_encryption_key_arn, - ) - - if self.default_variant is not None: - serializer.write_string( - _SCHEMA_UPDATE_PROMPT_OUTPUT.members["defaultVariant"], - self.default_variant, - ) - - if self.variants is not None: - _serialize_prompt_variant_list( - serializer, - _SCHEMA_UPDATE_PROMPT_OUTPUT.members["variants"], - self.variants, - ) - - serializer.write_string(_SCHEMA_UPDATE_PROMPT_OUTPUT.members["id"], self.id) - serializer.write_string(_SCHEMA_UPDATE_PROMPT_OUTPUT.members["arn"], self.arn) - serializer.write_string( - _SCHEMA_UPDATE_PROMPT_OUTPUT.members["version"], self.version - ) - serializer.write_timestamp( - _SCHEMA_UPDATE_PROMPT_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_UPDATE_PROMPT_OUTPUT.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_PROMPT_OUTPUT.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_PROMPT_OUTPUT.members["description"] - ) - - case 2: - kwargs["customer_encryption_key_arn"] = de.read_string( - _SCHEMA_UPDATE_PROMPT_OUTPUT.members["customerEncryptionKeyArn"] - ) - - case 3: - kwargs["default_variant"] = de.read_string( - _SCHEMA_UPDATE_PROMPT_OUTPUT.members["defaultVariant"] - ) - - case 4: - kwargs["variants"] = _deserialize_prompt_variant_list( - de, _SCHEMA_UPDATE_PROMPT_OUTPUT.members["variants"] - ) - - case 5: - kwargs["id"] = de.read_string( - _SCHEMA_UPDATE_PROMPT_OUTPUT.members["id"] - ) - - case 6: - kwargs["arn"] = de.read_string( - _SCHEMA_UPDATE_PROMPT_OUTPUT.members["arn"] - ) - - case 7: - kwargs["version"] = de.read_string( - _SCHEMA_UPDATE_PROMPT_OUTPUT.members["version"] - ) - - case 8: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_UPDATE_PROMPT_OUTPUT.members["createdAt"] - ) - - case 9: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_UPDATE_PROMPT_OUTPUT.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_PROMPT_OUTPUT, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "id" not in kwargs: - kwargs["id"] = "" - if "arn" not in kwargs: - kwargs["arn"] = "" - if "version" not in kwargs: - kwargs["version"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -UPDATE_PROMPT = APIOperation( - input=UpdatePromptInput, - output=UpdatePromptOutput, - schema=_SCHEMA_UPDATE_PROMPT, - input_schema=_SCHEMA_UPDATE_PROMPT_INPUT, - output_schema=_SCHEMA_UPDATE_PROMPT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrockagent#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class PutResourcePolicyInput: - """Dataclass for PutResourcePolicyInput structure.""" - - resource_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the knowledge base to attach the - resource policy to. - """ - - policy: str | JsonString | None = None - """The JSON-formatted resource policy to associate with the knowledge base.""" - - expected_revision_id: str | None = None - """ - The expected revision identifier of the resource policy. Use this to - prevent conflicts when multiple users update the same policy - concurrently. Specify the `revisionId` from the most recent - `GetResourcePolicy` or `PutResourcePolicy` response. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_RESOURCE_POLICY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_PUT_RESOURCE_POLICY_INPUT.members["resourceArn"], - self.resource_arn, - ) - - if self.policy is not None: - serializer.write_string( - _SCHEMA_PUT_RESOURCE_POLICY_INPUT.members["policy"], self.policy - ) - - if self.expected_revision_id is not None: - serializer.write_string( - _SCHEMA_PUT_RESOURCE_POLICY_INPUT.members["expectedRevisionId"], - self.expected_revision_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_PUT_RESOURCE_POLICY_INPUT.members["resourceArn"] - ) - - case 1: - kwargs["policy"] = de.read_string( - _SCHEMA_PUT_RESOURCE_POLICY_INPUT.members["policy"] - ) - - case 2: - kwargs["expected_revision_id"] = de.read_string( - _SCHEMA_PUT_RESOURCE_POLICY_INPUT.members["expectedRevisionId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUT_RESOURCE_POLICY_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class PutResourcePolicyOutput: - """Dataclass for PutResourcePolicyOutput structure.""" - - resource_arn: str - """The ARN of the knowledge base that the resource policy was attached to.""" - - revision_id: str - """ - The revision identifier of the resource policy. Use this value in the - `expectedRevisionId` field of a subsequent `PutResourcePolicy` or - `DeleteResourcePolicy` request. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_RESOURCE_POLICY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_PUT_RESOURCE_POLICY_OUTPUT.members["resourceArn"], self.resource_arn - ) - serializer.write_string( - _SCHEMA_PUT_RESOURCE_POLICY_OUTPUT.members["revisionId"], self.revision_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_PUT_RESOURCE_POLICY_OUTPUT.members["resourceArn"] - ) - - case 1: - kwargs["revision_id"] = de.read_string( - _SCHEMA_PUT_RESOURCE_POLICY_OUTPUT.members["revisionId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUT_RESOURCE_POLICY_OUTPUT, consumer=_consumer) - if "resource_arn" not in kwargs: - kwargs["resource_arn"] = "" - if "revision_id" not in kwargs: - kwargs["revision_id"] = "" - return kwargs - - -PUT_RESOURCE_POLICY = APIOperation( - input=PutResourcePolicyInput, - output=PutResourcePolicyOutput, - schema=_SCHEMA_PUT_RESOURCE_POLICY, - input_schema=_SCHEMA_PUT_RESOURCE_POLICY_INPUT, - output_schema=_SCHEMA_PUT_RESOURCE_POLICY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrockagent#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListTagsForResourceInput: - """Dataclass for ListTagsForResourceInput structure.""" - - resource_arn: str | None = None - """The Amazon Resource Name (ARN) of the resource for which to list tags.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT.members["resourceArn"], - self.resource_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT.members["resourceArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ListTagsForResourceOutput: - """Dataclass for ListTagsForResourceOutput structure.""" - - tags: dict[str, str] | None = None - """The key-value pairs for the tags associated with the resource.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.tags is not None: - _serialize_tags_map( - serializer, - _SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT.members["tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["tags"] = _deserialize_tags_map( - de, _SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_TAGS_FOR_RESOURCE = APIOperation( - input=ListTagsForResourceInput, - output=ListTagsForResourceOutput, - schema=_SCHEMA_LIST_TAGS_FOR_RESOURCE, - input_schema=_SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT, - output_schema=_SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class TagResourceInput: - """Dataclass for TagResourceInput structure.""" - - resource_arn: str | None = None - """The Amazon Resource Name (ARN) of the resource to tag.""" - - tags: dict[str, str] | None = None - """ - An object containing key-value pairs that define the tags to attach to - the resource. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TAG_RESOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_TAG_RESOURCE_INPUT.members["resourceArn"], self.resource_arn - ) - - if self.tags is not None: - _serialize_tags_map( - serializer, _SCHEMA_TAG_RESOURCE_INPUT.members["tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_TAG_RESOURCE_INPUT.members["resourceArn"] - ) - - case 1: - kwargs["tags"] = _deserialize_tags_map( - de, _SCHEMA_TAG_RESOURCE_INPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TAG_RESOURCE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class TagResourceOutput: - """Dataclass for TagResourceOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TAG_RESOURCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TAG_RESOURCE_OUTPUT, consumer=_consumer) - return kwargs - - -TAG_RESOURCE = APIOperation( - input=TagResourceInput, - output=TagResourceOutput, - schema=_SCHEMA_TAG_RESOURCE, - input_schema=_SCHEMA_TAG_RESOURCE_INPUT, - output_schema=_SCHEMA_TAG_RESOURCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -def _serialize_tag_key_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_tag_key_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class UntagResourceInput: - """Dataclass for UntagResourceInput structure.""" - - resource_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the resource from which to remove - tags. - """ - - tag_keys: list[str] | None = None - """A list of keys of the tags to remove from the resource.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNTAG_RESOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_UNTAG_RESOURCE_INPUT.members["resourceArn"], self.resource_arn - ) - - if self.tag_keys is not None: - _serialize_tag_key_list( - serializer, - _SCHEMA_UNTAG_RESOURCE_INPUT.members["tagKeys"], - self.tag_keys, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_UNTAG_RESOURCE_INPUT.members["resourceArn"] - ) - - case 1: - kwargs["tag_keys"] = _deserialize_tag_key_list( - de, _SCHEMA_UNTAG_RESOURCE_INPUT.members["tagKeys"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UNTAG_RESOURCE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UntagResourceOutput: - """Dataclass for UntagResourceOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNTAG_RESOURCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UNTAG_RESOURCE_OUTPUT, consumer=_consumer) - return kwargs - - -UNTAG_RESOURCE = APIOperation( - input=UntagResourceInput, - output=UntagResourceOutput, - schema=_SCHEMA_UNTAG_RESOURCE, - input_schema=_SCHEMA_UNTAG_RESOURCE_INPUT, - output_schema=_SCHEMA_UNTAG_RESOURCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ValidateFlowDefinitionOutput: - """Dataclass for ValidateFlowDefinitionOutput structure.""" - - validations: list[FlowValidation] - """ - Contains an array of objects, each of which contains an error identified - by validation. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VALIDATE_FLOW_DEFINITION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_flow_validations( - serializer, - _SCHEMA_VALIDATE_FLOW_DEFINITION_OUTPUT.members["validations"], - self.validations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["validations"] = _deserialize_flow_validations( - de, - _SCHEMA_VALIDATE_FLOW_DEFINITION_OUTPUT.members["validations"], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_VALIDATE_FLOW_DEFINITION_OUTPUT, consumer=_consumer - ) - if "validations" not in kwargs: - kwargs["validations"] = [] - return kwargs - - -@dataclass(kw_only=True) -class DeleteAgentVersionInput: - """Dataclass for DeleteAgentVersionInput structure.""" - - agent_id: str | None = None - """The unique identifier of the agent that the version belongs to.""" - - agent_version: str | None = None - """The version of the agent to delete.""" - - skip_resource_in_use_check: bool = False - """ - By default, this value is `false` and deletion is stopped if the - resource is in use. If you set it to `true`, the resource will be - deleted even if the resource is in use. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_AGENT_VERSION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.agent_id is not None: - serializer.write_string( - _SCHEMA_DELETE_AGENT_VERSION_INPUT.members["agentId"], self.agent_id - ) - - if self.agent_version is not None: - serializer.write_string( - _SCHEMA_DELETE_AGENT_VERSION_INPUT.members["agentVersion"], - self.agent_version, - ) - - if self.skip_resource_in_use_check is not None: - serializer.write_boolean( - _SCHEMA_DELETE_AGENT_VERSION_INPUT.members["skipResourceInUseCheck"], - self.skip_resource_in_use_check, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_id"] = de.read_string( - _SCHEMA_DELETE_AGENT_VERSION_INPUT.members["agentId"] - ) - - case 1: - kwargs["agent_version"] = de.read_string( - _SCHEMA_DELETE_AGENT_VERSION_INPUT.members["agentVersion"] - ) - - case 2: - kwargs["skip_resource_in_use_check"] = de.read_boolean( - _SCHEMA_DELETE_AGENT_VERSION_INPUT.members[ - "skipResourceInUseCheck" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_AGENT_VERSION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteAgentVersionOutput: - """Dataclass for DeleteAgentVersionOutput structure.""" - - agent_id: str - """The unique identifier of the agent that the version belongs to.""" - - agent_version: str - """The version that was deleted.""" - - agent_status: str - """The status of the agent version.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_AGENT_VERSION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DELETE_AGENT_VERSION_OUTPUT.members["agentId"], self.agent_id - ) - serializer.write_string( - _SCHEMA_DELETE_AGENT_VERSION_OUTPUT.members["agentVersion"], - self.agent_version, - ) - serializer.write_string( - _SCHEMA_DELETE_AGENT_VERSION_OUTPUT.members["agentStatus"], - self.agent_status, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_id"] = de.read_string( - _SCHEMA_DELETE_AGENT_VERSION_OUTPUT.members["agentId"] - ) - - case 1: - kwargs["agent_version"] = de.read_string( - _SCHEMA_DELETE_AGENT_VERSION_OUTPUT.members["agentVersion"] - ) - - case 2: - kwargs["agent_status"] = AgentStatus( - de.read_string( - _SCHEMA_DELETE_AGENT_VERSION_OUTPUT.members["agentStatus"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_AGENT_VERSION_OUTPUT, consumer=_consumer - ) - if "agent_id" not in kwargs: - kwargs["agent_id"] = "" - if "agent_version" not in kwargs: - kwargs["agent_version"] = "" - if "agent_status" not in kwargs: - kwargs["agent_status"] = AgentStatus._corrected("") - return kwargs - - -DELETE_AGENT_VERSION = APIOperation( - input=DeleteAgentVersionInput, - output=DeleteAgentVersionOutput, - schema=_SCHEMA_DELETE_AGENT_VERSION, - input_schema=_SCHEMA_DELETE_AGENT_VERSION_INPUT, - output_schema=_SCHEMA_DELETE_AGENT_VERSION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrockagent#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetAgentVersionInput: - """Dataclass for GetAgentVersionInput structure.""" - - agent_id: str | None = None - """The unique identifier of the agent.""" - - agent_version: str | None = None - """The version of the agent.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_AGENT_VERSION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.agent_id is not None: - serializer.write_string( - _SCHEMA_GET_AGENT_VERSION_INPUT.members["agentId"], self.agent_id - ) - - if self.agent_version is not None: - serializer.write_string( - _SCHEMA_GET_AGENT_VERSION_INPUT.members["agentVersion"], - self.agent_version, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_id"] = de.read_string( - _SCHEMA_GET_AGENT_VERSION_INPUT.members["agentId"] - ) - - case 1: - kwargs["agent_version"] = de.read_string( - _SCHEMA_GET_AGENT_VERSION_INPUT.members["agentVersion"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_AGENT_VERSION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetAgentVersionOutput: - """Dataclass for GetAgentVersionOutput structure.""" - - agent_version: AgentVersion - """Contains details about the version of the agent.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_AGENT_VERSION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_AGENT_VERSION_OUTPUT.members["agentVersion"], self.agent_version - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_version"] = AgentVersion.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_AGENT_VERSION_OUTPUT, consumer=_consumer) - if "agent_version" not in kwargs: - kwargs["agent_version"] = AgentVersion._smithy_default() - return kwargs - - -GET_AGENT_VERSION = APIOperation( - input=GetAgentVersionInput, - output=GetAgentVersionOutput, - schema=_SCHEMA_GET_AGENT_VERSION, - input_schema=_SCHEMA_GET_AGENT_VERSION_INPUT, - output_schema=_SCHEMA_GET_AGENT_VERSION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListAgentVersionsInput: - """Dataclass for ListAgentVersionsInput structure.""" - - agent_id: str | None = None - """The unique identifier of the agent.""" - - max_results: int | None = None - """ - The maximum number of results to return in the response. If the total - number of results is greater than this value, use the token returned in - the response in the `nextToken` field when making another request to - return the next batch of results. - """ - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, enter the token returned in the `nextToken` - field in the response in this field to return the next batch of results. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_AGENT_VERSIONS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.agent_id is not None: - serializer.write_string( - _SCHEMA_LIST_AGENT_VERSIONS_INPUT.members["agentId"], self.agent_id - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_AGENT_VERSIONS_INPUT.members["maxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_AGENT_VERSIONS_INPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_id"] = de.read_string( - _SCHEMA_LIST_AGENT_VERSIONS_INPUT.members["agentId"] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_AGENT_VERSIONS_INPUT.members["maxResults"] - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_AGENT_VERSIONS_INPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_AGENT_VERSIONS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ListAgentVersionsOutput: - """Dataclass for ListAgentVersionsOutput structure.""" - - agent_version_summaries: list[AgentVersionSummary] - """ - A list of objects, each of which contains information about a version of - the agent. - """ - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, use this token when making another request in - the `nextToken` field to return the next batch of results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_AGENT_VERSIONS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_agent_version_summaries( - serializer, - _SCHEMA_LIST_AGENT_VERSIONS_OUTPUT.members["agentVersionSummaries"], - self.agent_version_summaries, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_AGENT_VERSIONS_OUTPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_version_summaries"] = ( - _deserialize_agent_version_summaries( - de, - _SCHEMA_LIST_AGENT_VERSIONS_OUTPUT.members[ - "agentVersionSummaries" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_AGENT_VERSIONS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_AGENT_VERSIONS_OUTPUT, consumer=_consumer) - if "agent_version_summaries" not in kwargs: - kwargs["agent_version_summaries"] = [] - return kwargs - - -LIST_AGENT_VERSIONS = APIOperation( - input=ListAgentVersionsInput, - output=ListAgentVersionsOutput, - schema=_SCHEMA_LIST_AGENT_VERSIONS, - input_schema=_SCHEMA_LIST_AGENT_VERSIONS_INPUT, - output_schema=_SCHEMA_LIST_AGENT_VERSIONS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class FlowDefinition: - """The definition of the nodes and connections between nodes in the flow.""" - - nodes: "list[FlowNode] | None" = None - """An array of node definitions in the flow.""" - - connections: list[FlowConnection] | None = None - """An array of connection definitions in the flow.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_DEFINITION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.nodes is not None: - _serialize_flow_nodes( - serializer, _SCHEMA_FLOW_DEFINITION.members["nodes"], self.nodes - ) - - if self.connections is not None: - _serialize_flow_connections( - serializer, - _SCHEMA_FLOW_DEFINITION.members["connections"], - self.connections, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["nodes"] = _deserialize_flow_nodes( - de, _SCHEMA_FLOW_DEFINITION.members["nodes"] - ) - - case 1: - kwargs["connections"] = _deserialize_flow_connections( - de, _SCHEMA_FLOW_DEFINITION.members["connections"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FLOW_DEFINITION, consumer=_consumer) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls() - - -@dataclass(kw_only=True) -class FlowNode: - """Contains configurations about a node in the flow.""" - - name: str - """A name for the node.""" - - type: str - """ - The type of node. This value must match the name of the key that you - provide in the configuration you provide in the `FlowNodeConfiguration` - field. - """ - - configuration: "FlowNodeConfiguration | None" = None - """Contains configurations for the node.""" - - inputs: list[FlowNodeInput] | None = None - """ - An array of objects, each of which contains information about an input - into the node. - """ - - outputs: list[FlowNodeOutput] | None = None - """ - A list of objects, each of which contains information about an output - from the node. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_NODE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_FLOW_NODE.members["name"], self.name) - serializer.write_string(_SCHEMA_FLOW_NODE.members["type"], self.type) - if self.configuration is not None: - serializer.write_struct( - _SCHEMA_FLOW_NODE.members["configuration"], self.configuration - ) - - if self.inputs is not None: - _serialize_flow_node_inputs( - serializer, _SCHEMA_FLOW_NODE.members["inputs"], self.inputs - ) - - if self.outputs is not None: - _serialize_flow_node_outputs( - serializer, _SCHEMA_FLOW_NODE.members["outputs"], self.outputs - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string(_SCHEMA_FLOW_NODE.members["name"]) - - case 1: - kwargs["type"] = FlowNodeType( - de.read_string(_SCHEMA_FLOW_NODE.members["type"]) - ) - - case 2: - kwargs["configuration"] = ( - _FlowNodeConfigurationDeserializer().deserialize(de) - ) - - case 3: - kwargs["inputs"] = _deserialize_flow_node_inputs( - de, _SCHEMA_FLOW_NODE.members["inputs"] - ) - - case 4: - kwargs["outputs"] = _deserialize_flow_node_outputs( - de, _SCHEMA_FLOW_NODE.members["outputs"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FLOW_NODE, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "type" not in kwargs: - kwargs["type"] = FlowNodeType._corrected("") - return kwargs - - -@dataclass -class FlowNodeConfigurationInput: - """ - Contains configurations for an input flow node in your flow. The first - node in the flow. `inputs` can't be specified for this node. - """ - - value: InputFlowNodeConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_NODE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_NODE_CONFIGURATION.members["input"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=InputFlowNodeConfiguration.deserialize(deserializer)) - - -@dataclass -class FlowNodeConfigurationOutput: - """ - Contains configurations for an output flow node in your flow. The last - node in the flow. `outputs` can't be specified for this node. - """ - - value: OutputFlowNodeConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_NODE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_NODE_CONFIGURATION.members["output"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=OutputFlowNodeConfiguration.deserialize(deserializer)) - - -@dataclass -class FlowNodeConfigurationKnowledgeBase: - """ - Contains configurations for a knowledge base node in your flow. Queries - a knowledge base and returns the retrieved results or generated - response. - """ - - value: KnowledgeBaseFlowNodeConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_NODE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_NODE_CONFIGURATION.members["knowledgeBase"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=KnowledgeBaseFlowNodeConfiguration.deserialize(deserializer)) - - -@dataclass -class FlowNodeConfigurationCondition: - """ - Contains configurations for a condition node in your flow. Defines - conditions that lead to different branches of the flow. - """ - - value: ConditionFlowNodeConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_NODE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_NODE_CONFIGURATION.members["condition"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ConditionFlowNodeConfiguration.deserialize(deserializer)) - - -@dataclass -class FlowNodeConfigurationLex: - """ - Contains configurations for a Lex node in your flow. Invokes an Amazon - Lex bot to identify the intent of the input and return the intent as the - output. - """ - - value: LexFlowNodeConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_NODE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_NODE_CONFIGURATION.members["lex"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=LexFlowNodeConfiguration.deserialize(deserializer)) - - -@dataclass -class FlowNodeConfigurationPrompt: - """ - Contains configurations for a prompt node in your flow. Runs a prompt - and generates the model response as the output. You can use a prompt - from Prompt management or you can configure one in this node. - """ - - value: PromptFlowNodeConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_NODE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_NODE_CONFIGURATION.members["prompt"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=PromptFlowNodeConfiguration.deserialize(deserializer)) - - -@dataclass -class FlowNodeConfigurationLambdaFunction: - """ - Contains configurations for a Lambda function node in your flow. Invokes - an Lambda function. - """ - - value: LambdaFunctionFlowNodeConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_NODE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_NODE_CONFIGURATION.members["lambdaFunction"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=LambdaFunctionFlowNodeConfiguration.deserialize(deserializer)) - - -@dataclass -class FlowNodeConfigurationStorage: - """ - Contains configurations for a storage node in your flow. Stores an input - in an Amazon S3 location. - """ - - value: StorageFlowNodeConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_NODE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_NODE_CONFIGURATION.members["storage"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=StorageFlowNodeConfiguration.deserialize(deserializer)) - - -@dataclass -class FlowNodeConfigurationAgent: - """ - Contains configurations for an agent node in your flow. Invokes an alias - of an agent and returns the response. - """ - - value: AgentFlowNodeConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_NODE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_NODE_CONFIGURATION.members["agent"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=AgentFlowNodeConfiguration.deserialize(deserializer)) - - -@dataclass -class FlowNodeConfigurationRetrieval: - """ - Contains configurations for a retrieval node in your flow. Retrieves - data from an Amazon S3 location and returns it as the output. - """ - - value: RetrievalFlowNodeConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_NODE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_NODE_CONFIGURATION.members["retrieval"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=RetrievalFlowNodeConfiguration.deserialize(deserializer)) - - -@dataclass -class FlowNodeConfigurationIterator: - """ - Contains configurations for an iterator node in your flow. Takes an - input that is an array and iteratively sends each item of the array as - an output to the following node. The size of the array is also returned - in the output. - - The output flow node at the end of the flow iteration will return a - response for each member of the array. To return only one response, you - can include a collector node downstream from the iterator node. - """ - - value: IteratorFlowNodeConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_NODE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_NODE_CONFIGURATION.members["iterator"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=IteratorFlowNodeConfiguration.deserialize(deserializer)) - - -@dataclass -class FlowNodeConfigurationCollector: - """ - Contains configurations for a collector node in your flow. Collects an - iteration of inputs and consolidates them into an array of outputs. - """ - - value: CollectorFlowNodeConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_NODE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_NODE_CONFIGURATION.members["collector"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=CollectorFlowNodeConfiguration.deserialize(deserializer)) - - -@dataclass -class FlowNodeConfigurationInlineCode: - """ - Contains configurations for an inline code node in your flow. Inline - code nodes let you write and execute code directly within your flow, - enabling data transformations, custom logic, and integrations without - needing an external Lambda function. - """ - - value: InlineCodeFlowNodeConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_NODE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_NODE_CONFIGURATION.members["inlineCode"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=InlineCodeFlowNodeConfiguration.deserialize(deserializer)) - - -@dataclass -class FlowNodeConfigurationLoop: - """Contains configurations for a DoWhile loop in your flow.""" - - value: "LoopFlowNodeConfiguration" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_NODE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_NODE_CONFIGURATION.members["loop"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=LoopFlowNodeConfiguration.deserialize(deserializer)) - - -@dataclass -class FlowNodeConfigurationLoopInput: - """Contains input node configurations for a DoWhile loop in your flow.""" - - value: LoopInputFlowNodeConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_NODE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_NODE_CONFIGURATION.members["loopInput"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=LoopInputFlowNodeConfiguration.deserialize(deserializer)) - - -@dataclass -class FlowNodeConfigurationLoopController: - """Contains controller node configurations for a DoWhile loop in your flow.""" - - value: LoopControllerFlowNodeConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_NODE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FLOW_NODE_CONFIGURATION.members["loopController"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=LoopControllerFlowNodeConfiguration.deserialize(deserializer)) - - -@dataclass -class FlowNodeConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -FlowNodeConfiguration = Union[ - FlowNodeConfigurationInput - | FlowNodeConfigurationOutput - | FlowNodeConfigurationKnowledgeBase - | FlowNodeConfigurationCondition - | FlowNodeConfigurationLex - | FlowNodeConfigurationPrompt - | FlowNodeConfigurationLambdaFunction - | FlowNodeConfigurationStorage - | FlowNodeConfigurationAgent - | FlowNodeConfigurationRetrieval - | FlowNodeConfigurationIterator - | FlowNodeConfigurationCollector - | FlowNodeConfigurationInlineCode - | FlowNodeConfigurationLoop - | FlowNodeConfigurationLoopInput - | FlowNodeConfigurationLoopController - | FlowNodeConfigurationUnknown -] -""" -Contains configurations for a node in your flow. For more information, -see [Node types in a -flow](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-nodes.html) -in the Amazon Bedrock User Guide. -""" - - -class _FlowNodeConfigurationDeserializer: - _result: FlowNodeConfiguration | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> FlowNodeConfiguration: - self._result = None - deserializer.read_struct(_SCHEMA_FLOW_NODE_CONFIGURATION, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(FlowNodeConfigurationInput.deserialize(de)) - - case 1: - self._set_result(FlowNodeConfigurationOutput.deserialize(de)) - - case 2: - self._set_result(FlowNodeConfigurationKnowledgeBase.deserialize(de)) - - case 3: - self._set_result(FlowNodeConfigurationCondition.deserialize(de)) - - case 4: - self._set_result(FlowNodeConfigurationLex.deserialize(de)) - - case 5: - self._set_result(FlowNodeConfigurationPrompt.deserialize(de)) - - case 6: - self._set_result(FlowNodeConfigurationLambdaFunction.deserialize(de)) - - case 7: - self._set_result(FlowNodeConfigurationStorage.deserialize(de)) - - case 8: - self._set_result(FlowNodeConfigurationAgent.deserialize(de)) - - case 9: - self._set_result(FlowNodeConfigurationRetrieval.deserialize(de)) - - case 10: - self._set_result(FlowNodeConfigurationIterator.deserialize(de)) - - case 11: - self._set_result(FlowNodeConfigurationCollector.deserialize(de)) - - case 12: - self._set_result(FlowNodeConfigurationInlineCode.deserialize(de)) - - case 13: - self._set_result(FlowNodeConfigurationLoop.deserialize(de)) - - case 14: - self._set_result(FlowNodeConfigurationLoopInput.deserialize(de)) - - case 15: - self._set_result(FlowNodeConfigurationLoopController.deserialize(de)) - - case _: - self._set_result( - FlowNodeConfigurationUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: FlowNodeConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_flow_nodes( - serializer: ShapeSerializer, schema: Schema, value: list[FlowNode] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_flow_nodes( - deserializer: ShapeDeserializer, schema: Schema -) -> list[FlowNode]: - result: list[FlowNode] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(FlowNode.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class LoopFlowNodeConfiguration: - """ - Contains configurations for the nodes of a DoWhile loop in your flow. - - A DoWhile loop is made up of the following nodes: - - - `Loop` - The container node that holds the loop's flow definition. - This node encompasses the entire loop structure. - - - `LoopInput` - The entry point node for the loop. This node receives - inputs from nodes outside the loop and from previous loop iterations. - - - Body nodes - The processing nodes that execute within each loop - iteration. These can be nodes for handling data in your flow, such as - a prompt or Lambda function nodes. Some node types aren't supported - inside a DoWhile loop body. For more information, see - [LoopIncompatibleNodeTypeFlowValidationDetails](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_LoopIncompatibleNodeTypeFlowValidationDetails.html). - - - `LoopController` - The node that evaluates whether the loop should - continue or exit based on a condition. - - These nodes work together to create a loop that runs at least once and - continues until a specified condition is met or a maximum number of - iterations is reached. - """ - - definition: "FlowDefinition" = field(repr=False) - """ - The definition of the DoWhile loop nodes and connections between nodes - in the flow. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LOOP_FLOW_NODE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_LOOP_FLOW_NODE_CONFIGURATION.members["definition"], self.definition - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["definition"] = FlowDefinition.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LOOP_FLOW_NODE_CONFIGURATION, consumer=_consumer - ) - if "definition" not in kwargs: - kwargs["definition"] = FlowDefinition._smithy_default() - return kwargs - - -@dataclass(kw_only=True) -class CreateFlowInput: - """Dataclass for CreateFlowInput structure.""" - - name: str | None = None - """A name for the flow.""" - - description: str | None = None - """A description for the flow.""" - - execution_role_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the service role with permissions to - create and manage a flow. For more information, see [Create a service - role for flows in Amazon - Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-permissions.html) - in the Amazon Bedrock User Guide. - """ - - customer_encryption_key_arn: str | None = None - """The Amazon Resource Name (ARN) of the KMS key to encrypt the flow.""" - - definition: "FlowDefinition | None" = field(repr=False, default=None) - """A definition of the nodes and connections between nodes in the flow.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If this token matches a previous - request, Amazon Bedrock ignores the request, but does not return an - error. For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - tags: dict[str, str] | None = None - """ - Any tags that you want to attach to the flow. For more information, see - [Tagging resources in Amazon - Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/tagging.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_FLOW_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_FLOW_INPUT.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_FLOW_INPUT.members["description"], self.description - ) - - if self.execution_role_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_FLOW_INPUT.members["executionRoleArn"], - self.execution_role_arn, - ) - - if self.customer_encryption_key_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_FLOW_INPUT.members["customerEncryptionKeyArn"], - self.customer_encryption_key_arn, - ) - - if self.definition is not None: - serializer.write_struct( - _SCHEMA_CREATE_FLOW_INPUT.members["definition"], self.definition - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_FLOW_INPUT.members["clientToken"], self.client_token - ) - - if self.tags is not None: - _serialize_tags_map( - serializer, _SCHEMA_CREATE_FLOW_INPUT.members["tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_FLOW_INPUT.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_FLOW_INPUT.members["description"] - ) - - case 2: - kwargs["execution_role_arn"] = de.read_string( - _SCHEMA_CREATE_FLOW_INPUT.members["executionRoleArn"] - ) - - case 3: - kwargs["customer_encryption_key_arn"] = de.read_string( - _SCHEMA_CREATE_FLOW_INPUT.members["customerEncryptionKeyArn"] - ) - - case 4: - kwargs["definition"] = FlowDefinition.deserialize(de) - - case 5: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_FLOW_INPUT.members["clientToken"] - ) - - case 6: - kwargs["tags"] = _deserialize_tags_map( - de, _SCHEMA_CREATE_FLOW_INPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_FLOW_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CreateFlowOutput: - """Dataclass for CreateFlowOutput structure.""" - - name: str - """The name of the flow.""" - - execution_role_arn: str - """ - The Amazon Resource Name (ARN) of the service role with permissions to - create a flow. For more information, see [Create a service role for - flows in Amazon - Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-permissions.html) - in the Amazon Bedrock User Guide. - """ - - id: str - """The unique identifier of the flow.""" - - arn: str - """The Amazon Resource Name (ARN) of the flow.""" - - status: str - """ - The status of the flow. When you submit this request, the status will be - `NotPrepared`. If creation fails, the status becomes `Failed`. - """ - - created_at: datetime - """The time at which the flow was created.""" - - updated_at: datetime - """The time at which the flow was last updated.""" - - version: str - """ - The version of the flow. When you create a flow, the version created is - the `DRAFT` version. - """ - - description: str | None = None - """The description of the flow.""" - - customer_encryption_key_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the KMS key that you encrypted the - flow with. - """ - - definition: "FlowDefinition | None" = field(repr=False, default=None) - """A definition of the nodes and connections between nodes in the flow.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_FLOW_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_CREATE_FLOW_OUTPUT.members["name"], self.name) - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_FLOW_OUTPUT.members["description"], self.description - ) - - serializer.write_string( - _SCHEMA_CREATE_FLOW_OUTPUT.members["executionRoleArn"], - self.execution_role_arn, - ) - if self.customer_encryption_key_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_FLOW_OUTPUT.members["customerEncryptionKeyArn"], - self.customer_encryption_key_arn, - ) - - serializer.write_string(_SCHEMA_CREATE_FLOW_OUTPUT.members["id"], self.id) - serializer.write_string(_SCHEMA_CREATE_FLOW_OUTPUT.members["arn"], self.arn) - serializer.write_string( - _SCHEMA_CREATE_FLOW_OUTPUT.members["status"], self.status - ) - serializer.write_timestamp( - _SCHEMA_CREATE_FLOW_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_CREATE_FLOW_OUTPUT.members["updatedAt"], self.updated_at - ) - serializer.write_string( - _SCHEMA_CREATE_FLOW_OUTPUT.members["version"], self.version - ) - if self.definition is not None: - serializer.write_struct( - _SCHEMA_CREATE_FLOW_OUTPUT.members["definition"], self.definition - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_FLOW_OUTPUT.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_FLOW_OUTPUT.members["description"] - ) - - case 2: - kwargs["execution_role_arn"] = de.read_string( - _SCHEMA_CREATE_FLOW_OUTPUT.members["executionRoleArn"] - ) - - case 3: - kwargs["customer_encryption_key_arn"] = de.read_string( - _SCHEMA_CREATE_FLOW_OUTPUT.members["customerEncryptionKeyArn"] - ) - - case 4: - kwargs["id"] = de.read_string( - _SCHEMA_CREATE_FLOW_OUTPUT.members["id"] - ) - - case 5: - kwargs["arn"] = de.read_string( - _SCHEMA_CREATE_FLOW_OUTPUT.members["arn"] - ) - - case 6: - kwargs["status"] = FlowStatus( - de.read_string(_SCHEMA_CREATE_FLOW_OUTPUT.members["status"]) - ) - - case 7: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_CREATE_FLOW_OUTPUT.members["createdAt"] - ) - - case 8: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_CREATE_FLOW_OUTPUT.members["updatedAt"] - ) - - case 9: - kwargs["version"] = de.read_string( - _SCHEMA_CREATE_FLOW_OUTPUT.members["version"] - ) - - case 10: - kwargs["definition"] = FlowDefinition.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_FLOW_OUTPUT, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "execution_role_arn" not in kwargs: - kwargs["execution_role_arn"] = "" - if "id" not in kwargs: - kwargs["id"] = "" - if "arn" not in kwargs: - kwargs["arn"] = "" - if "status" not in kwargs: - kwargs["status"] = FlowStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "version" not in kwargs: - kwargs["version"] = "" - return kwargs - - -@dataclass(kw_only=True) -class CreateFlowVersionOutput: - """Dataclass for CreateFlowVersionOutput structure.""" - - name: str - """The name of the version.""" - - execution_role_arn: str - """ - The Amazon Resource Name (ARN) of the service role with permissions to - create a flow. For more information, see [Create a service role for - flows in Amazon - Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-permissions.html) - in the Amazon Bedrock User Guide. - """ - - id: str - """The unique identifier of the flow.""" - - arn: str - """The Amazon Resource Name (ARN) of the flow.""" - - status: str - """The status of the flow.""" - - created_at: datetime - """The time at which the flow was created.""" - - version: str - """ - The version of the flow that was created. Versions are numbered - incrementally, starting from 1. - """ - - description: str | None = None - """The description of the version.""" - - customer_encryption_key_arn: str | None = None - """The KMS key that the flow is encrypted with.""" - - definition: "FlowDefinition | None" = field(repr=False, default=None) - """A definition of the nodes and connections in the flow.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_FLOW_VERSION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_FLOW_VERSION_OUTPUT.members["name"], self.name - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_FLOW_VERSION_OUTPUT.members["description"], - self.description, - ) - - serializer.write_string( - _SCHEMA_CREATE_FLOW_VERSION_OUTPUT.members["executionRoleArn"], - self.execution_role_arn, - ) - if self.customer_encryption_key_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_FLOW_VERSION_OUTPUT.members["customerEncryptionKeyArn"], - self.customer_encryption_key_arn, - ) - - serializer.write_string( - _SCHEMA_CREATE_FLOW_VERSION_OUTPUT.members["id"], self.id - ) - serializer.write_string( - _SCHEMA_CREATE_FLOW_VERSION_OUTPUT.members["arn"], self.arn - ) - serializer.write_string( - _SCHEMA_CREATE_FLOW_VERSION_OUTPUT.members["status"], self.status - ) - serializer.write_timestamp( - _SCHEMA_CREATE_FLOW_VERSION_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_string( - _SCHEMA_CREATE_FLOW_VERSION_OUTPUT.members["version"], self.version - ) - if self.definition is not None: - serializer.write_struct( - _SCHEMA_CREATE_FLOW_VERSION_OUTPUT.members["definition"], - self.definition, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_FLOW_VERSION_OUTPUT.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_FLOW_VERSION_OUTPUT.members["description"] - ) - - case 2: - kwargs["execution_role_arn"] = de.read_string( - _SCHEMA_CREATE_FLOW_VERSION_OUTPUT.members["executionRoleArn"] - ) - - case 3: - kwargs["customer_encryption_key_arn"] = de.read_string( - _SCHEMA_CREATE_FLOW_VERSION_OUTPUT.members[ - "customerEncryptionKeyArn" - ] - ) - - case 4: - kwargs["id"] = de.read_string( - _SCHEMA_CREATE_FLOW_VERSION_OUTPUT.members["id"] - ) - - case 5: - kwargs["arn"] = de.read_string( - _SCHEMA_CREATE_FLOW_VERSION_OUTPUT.members["arn"] - ) - - case 6: - kwargs["status"] = FlowStatus( - de.read_string( - _SCHEMA_CREATE_FLOW_VERSION_OUTPUT.members["status"] - ) - ) - - case 7: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_CREATE_FLOW_VERSION_OUTPUT.members["createdAt"] - ) - - case 8: - kwargs["version"] = de.read_string( - _SCHEMA_CREATE_FLOW_VERSION_OUTPUT.members["version"] - ) - - case 9: - kwargs["definition"] = FlowDefinition.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_FLOW_VERSION_OUTPUT, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "execution_role_arn" not in kwargs: - kwargs["execution_role_arn"] = "" - if "id" not in kwargs: - kwargs["id"] = "" - if "arn" not in kwargs: - kwargs["arn"] = "" - if "status" not in kwargs: - kwargs["status"] = FlowStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "version" not in kwargs: - kwargs["version"] = "" - return kwargs - - -@dataclass(kw_only=True) -class GetFlowOutput: - """Dataclass for GetFlowOutput structure.""" - - name: str - """The name of the flow.""" - - execution_role_arn: str - """ - The Amazon Resource Name (ARN) of the service role with permissions to - create a flow. For more information, see [Create a service row for - flows](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-permissions.html) - in the Amazon Bedrock User Guide. - """ - - id: str - """The unique identifier of the flow.""" - - arn: str - """The Amazon Resource Name (ARN) of the flow.""" - - status: str - """ - The status of the flow. The following statuses are possible: - - - NotPrepared -- The flow has been created or updated, but hasn't been - prepared. If you just created the flow, you can't test it. If you - updated the flow, the `DRAFT` version won't contain the latest - changes for testing. Send a - [PrepareFlow](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PrepareFlow.html) - request to package the latest changes into the `DRAFT` version. - - - Preparing -- The flow is being prepared so that the `DRAFT` version - contains the latest changes for testing. - - - Prepared -- The flow is prepared and the `DRAFT` version contains the - latest changes for testing. - - - Failed -- The last API operation that you invoked on the flow failed. - Send a - [GetFlow](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_GetFlow.html) - request and check the error message in the `validations` field. - """ - - created_at: datetime - """The time at which the flow was created.""" - - updated_at: datetime - """The time at which the flow was last updated.""" - - version: str - """The version of the flow for which information was retrieved.""" - - description: str | None = None - """The description of the flow.""" - - customer_encryption_key_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the KMS key that the flow is encrypted - with. - """ - - definition: "FlowDefinition | None" = field(repr=False, default=None) - """ - The definition of the nodes and connections between the nodes in the - flow. - """ - - validations: list[FlowValidation] | None = None - """ - A list of validation error messages related to the last failed operation - on the flow. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_FLOW_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_GET_FLOW_OUTPUT.members["name"], self.name) - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_FLOW_OUTPUT.members["description"], self.description - ) - - serializer.write_string( - _SCHEMA_GET_FLOW_OUTPUT.members["executionRoleArn"], self.execution_role_arn - ) - if self.customer_encryption_key_arn is not None: - serializer.write_string( - _SCHEMA_GET_FLOW_OUTPUT.members["customerEncryptionKeyArn"], - self.customer_encryption_key_arn, - ) - - serializer.write_string(_SCHEMA_GET_FLOW_OUTPUT.members["id"], self.id) - serializer.write_string(_SCHEMA_GET_FLOW_OUTPUT.members["arn"], self.arn) - serializer.write_string(_SCHEMA_GET_FLOW_OUTPUT.members["status"], self.status) - serializer.write_timestamp( - _SCHEMA_GET_FLOW_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_GET_FLOW_OUTPUT.members["updatedAt"], self.updated_at - ) - serializer.write_string( - _SCHEMA_GET_FLOW_OUTPUT.members["version"], self.version - ) - if self.definition is not None: - serializer.write_struct( - _SCHEMA_GET_FLOW_OUTPUT.members["definition"], self.definition - ) - - if self.validations is not None: - _serialize_flow_validations( - serializer, - _SCHEMA_GET_FLOW_OUTPUT.members["validations"], - self.validations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_GET_FLOW_OUTPUT.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_GET_FLOW_OUTPUT.members["description"] - ) - - case 2: - kwargs["execution_role_arn"] = de.read_string( - _SCHEMA_GET_FLOW_OUTPUT.members["executionRoleArn"] - ) - - case 3: - kwargs["customer_encryption_key_arn"] = de.read_string( - _SCHEMA_GET_FLOW_OUTPUT.members["customerEncryptionKeyArn"] - ) - - case 4: - kwargs["id"] = de.read_string(_SCHEMA_GET_FLOW_OUTPUT.members["id"]) - - case 5: - kwargs["arn"] = de.read_string( - _SCHEMA_GET_FLOW_OUTPUT.members["arn"] - ) - - case 6: - kwargs["status"] = FlowStatus( - de.read_string(_SCHEMA_GET_FLOW_OUTPUT.members["status"]) - ) - - case 7: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_FLOW_OUTPUT.members["createdAt"] - ) - - case 8: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_GET_FLOW_OUTPUT.members["updatedAt"] - ) - - case 9: - kwargs["version"] = de.read_string( - _SCHEMA_GET_FLOW_OUTPUT.members["version"] - ) - - case 10: - kwargs["definition"] = FlowDefinition.deserialize(de) - - case 11: - kwargs["validations"] = _deserialize_flow_validations( - de, _SCHEMA_GET_FLOW_OUTPUT.members["validations"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_FLOW_OUTPUT, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "execution_role_arn" not in kwargs: - kwargs["execution_role_arn"] = "" - if "id" not in kwargs: - kwargs["id"] = "" - if "arn" not in kwargs: - kwargs["arn"] = "" - if "status" not in kwargs: - kwargs["status"] = FlowStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "version" not in kwargs: - kwargs["version"] = "" - return kwargs - - -@dataclass(kw_only=True) -class GetFlowVersionOutput: - """Dataclass for GetFlowVersionOutput structure.""" - - name: str - """The name of the version.""" - - execution_role_arn: str - """ - The Amazon Resource Name (ARN) of the service role with permissions to - create a flow. For more information, see [Create a service role for - flows in Amazon - Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-permissions.html) - in the Amazon Bedrock User Guide. - """ - - id: str - """The unique identifier of the flow.""" - - arn: str - """The Amazon Resource Name (ARN) of the flow.""" - - status: str - """The status of the flow.""" - - created_at: datetime - """The time at which the flow was created.""" - - version: str - """The version of the flow for which information was retrieved.""" - - description: str | None = None - """The description of the flow.""" - - customer_encryption_key_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the KMS key that the version of the - flow is encrypted with. - """ - - definition: "FlowDefinition | None" = field(repr=False, default=None) - """The definition of the nodes and connections between nodes in the flow.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .models import ( + AssociateAgentCollaboratorInput, + AssociateAgentCollaboratorOutput, + AssociateAgentKnowledgeBaseInput, + AssociateAgentKnowledgeBaseOutput, + CreateAgentActionGroupInput, + CreateAgentActionGroupOutput, + CreateAgentAliasInput, + CreateAgentAliasOutput, + CreateAgentInput, + CreateAgentOutput, + CreateDataSourceInput, + CreateDataSourceOutput, + CreateFlowAliasInput, + CreateFlowAliasOutput, + CreateFlowInput, + CreateFlowOutput, + CreateFlowVersionInput, + CreateFlowVersionOutput, + CreateKnowledgeBaseInput, + CreateKnowledgeBaseOutput, + CreatePromptInput, + CreatePromptOutput, + CreatePromptVersionInput, + CreatePromptVersionOutput, + CreateVpcConfigurationInput, + CreateVpcConfigurationOutput, + DeleteAgentActionGroupInput, + DeleteAgentActionGroupOutput, + DeleteAgentAliasInput, + DeleteAgentAliasOutput, + DeleteAgentInput, + DeleteAgentOutput, + DeleteAgentVersionInput, + DeleteAgentVersionOutput, + DeleteDataSourceInput, + DeleteDataSourceOutput, + DeleteFlowAliasInput, + DeleteFlowAliasOutput, + DeleteFlowInput, + DeleteFlowOutput, + DeleteFlowVersionInput, + DeleteFlowVersionOutput, + DeleteKnowledgeBaseDocumentsInput, + DeleteKnowledgeBaseDocumentsOutput, + DeleteKnowledgeBaseInput, + DeleteKnowledgeBaseOutput, + DeletePromptInput, + DeletePromptOutput, + DeleteResourcePolicyInput, + DeleteResourcePolicyOutput, + DeleteVpcConfigurationInput, + DeleteVpcConfigurationOutput, + DisassociateAgentCollaboratorInput, + DisassociateAgentCollaboratorOutput, + DisassociateAgentKnowledgeBaseInput, + DisassociateAgentKnowledgeBaseOutput, + GetAgentActionGroupInput, + GetAgentActionGroupOutput, + GetAgentAliasInput, + GetAgentAliasOutput, + GetAgentCollaboratorInput, + GetAgentCollaboratorOutput, + GetAgentInput, + GetAgentKnowledgeBaseInput, + GetAgentKnowledgeBaseOutput, + GetAgentOutput, + GetAgentVersionInput, + GetAgentVersionOutput, + GetDataSourceInput, + GetDataSourceOutput, + GetFlowAliasInput, + GetFlowAliasOutput, + GetFlowInput, + GetFlowOutput, + GetFlowVersionInput, + GetFlowVersionOutput, + GetIngestionJobInput, + GetIngestionJobOutput, + GetKnowledgeBaseDocumentsInput, + GetKnowledgeBaseDocumentsOutput, + GetKnowledgeBaseInput, + GetKnowledgeBaseOutput, + GetPromptInput, + GetPromptOutput, + GetResourcePolicyInput, + GetResourcePolicyOutput, + GetVpcConfigurationInput, + GetVpcConfigurationOutput, + IngestKnowledgeBaseDocumentsInput, + IngestKnowledgeBaseDocumentsOutput, + ListAgentActionGroupsInput, + ListAgentActionGroupsOutput, + ListAgentAliasesInput, + ListAgentAliasesOutput, + ListAgentCollaboratorsInput, + ListAgentCollaboratorsOutput, + ListAgentKnowledgeBasesInput, + ListAgentKnowledgeBasesOutput, + ListAgentVersionsInput, + ListAgentVersionsOutput, + ListAgentsInput, + ListAgentsOutput, + ListDataSourcesInput, + ListDataSourcesOutput, + ListFlowAliasesInput, + ListFlowAliasesOutput, + ListFlowVersionsInput, + ListFlowVersionsOutput, + ListFlowsInput, + ListFlowsOutput, + ListIngestionJobsInput, + ListIngestionJobsOutput, + ListKnowledgeBaseDocumentsInput, + ListKnowledgeBaseDocumentsOutput, + ListKnowledgeBasesInput, + ListKnowledgeBasesOutput, + ListPromptsInput, + ListPromptsOutput, + ListTagsForResourceInput, + ListTagsForResourceOutput, + ListVpcConfigurationsInput, + ListVpcConfigurationsOutput, + PrepareAgentInput, + PrepareAgentOutput, + PrepareFlowInput, + PrepareFlowOutput, + PutResourcePolicyInput, + PutResourcePolicyOutput, + StartIngestionJobInput, + StartIngestionJobOutput, + StopIngestionJobInput, + StopIngestionJobOutput, + TagResourceInput, + TagResourceOutput, + UntagResourceInput, + UntagResourceOutput, + UpdateAgentActionGroupInput, + UpdateAgentActionGroupOutput, + UpdateAgentAliasInput, + UpdateAgentAliasOutput, + UpdateAgentCollaboratorInput, + UpdateAgentCollaboratorOutput, + UpdateAgentInput, + UpdateAgentKnowledgeBaseInput, + UpdateAgentKnowledgeBaseOutput, + UpdateAgentOutput, + UpdateDataSourceInput, + UpdateDataSourceOutput, + UpdateFlowAliasInput, + UpdateFlowAliasOutput, + UpdateFlowInput, + UpdateFlowOutput, + UpdateKnowledgeBaseInput, + UpdateKnowledgeBaseOutput, + UpdatePromptInput, + UpdatePromptOutput, + ValidateFlowDefinitionInput, + ValidateFlowDefinitionOutput, ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_FLOW_VERSION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_FLOW_VERSION_OUTPUT.members["name"], self.name - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_FLOW_VERSION_OUTPUT.members["description"], self.description - ) - - serializer.write_string( - _SCHEMA_GET_FLOW_VERSION_OUTPUT.members["executionRoleArn"], - self.execution_role_arn, - ) - if self.customer_encryption_key_arn is not None: - serializer.write_string( - _SCHEMA_GET_FLOW_VERSION_OUTPUT.members["customerEncryptionKeyArn"], - self.customer_encryption_key_arn, - ) - - serializer.write_string(_SCHEMA_GET_FLOW_VERSION_OUTPUT.members["id"], self.id) - serializer.write_string( - _SCHEMA_GET_FLOW_VERSION_OUTPUT.members["arn"], self.arn - ) - serializer.write_string( - _SCHEMA_GET_FLOW_VERSION_OUTPUT.members["status"], self.status - ) - serializer.write_timestamp( - _SCHEMA_GET_FLOW_VERSION_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_string( - _SCHEMA_GET_FLOW_VERSION_OUTPUT.members["version"], self.version - ) - if self.definition is not None: - serializer.write_struct( - _SCHEMA_GET_FLOW_VERSION_OUTPUT.members["definition"], self.definition - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_GET_FLOW_VERSION_OUTPUT.members["name"] - ) - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_GET_FLOW_VERSION_OUTPUT.members["description"] - ) - - case 2: - kwargs["execution_role_arn"] = de.read_string( - _SCHEMA_GET_FLOW_VERSION_OUTPUT.members["executionRoleArn"] - ) - - case 3: - kwargs["customer_encryption_key_arn"] = de.read_string( - _SCHEMA_GET_FLOW_VERSION_OUTPUT.members[ - "customerEncryptionKeyArn" - ] - ) - - case 4: - kwargs["id"] = de.read_string( - _SCHEMA_GET_FLOW_VERSION_OUTPUT.members["id"] - ) - - case 5: - kwargs["arn"] = de.read_string( - _SCHEMA_GET_FLOW_VERSION_OUTPUT.members["arn"] - ) - - case 6: - kwargs["status"] = FlowStatus( - de.read_string( - _SCHEMA_GET_FLOW_VERSION_OUTPUT.members["status"] - ) - ) - - case 7: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_FLOW_VERSION_OUTPUT.members["createdAt"] - ) - - case 8: - kwargs["version"] = de.read_string( - _SCHEMA_GET_FLOW_VERSION_OUTPUT.members["version"] - ) - - case 9: - kwargs["definition"] = FlowDefinition.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_FLOW_VERSION_OUTPUT, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "execution_role_arn" not in kwargs: - kwargs["execution_role_arn"] = "" - if "id" not in kwargs: - kwargs["id"] = "" - if "arn" not in kwargs: - kwargs["arn"] = "" - if "status" not in kwargs: - kwargs["status"] = FlowStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "version" not in kwargs: - kwargs["version"] = "" - return kwargs - - -@dataclass(kw_only=True) -class UpdateFlowInput: - """Dataclass for UpdateFlowInput structure.""" - - name: str | None = None - """A name for the flow.""" - - description: str | None = None - """A description for the flow.""" - - execution_role_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the service role with permissions to - create and manage a flow. For more information, see [Create a service - role for flows in Amazon - Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-permissions.html) - in the Amazon Bedrock User Guide. +class ServiceError(ModeledError): """ + Base error for all errors in the service. - customer_encryption_key_arn: str | None = None - """The Amazon Resource Name (ARN) of the KMS key to encrypt the flow.""" - - definition: "FlowDefinition | None" = field(repr=False, default=None) - """ - A definition of the nodes and the connections between the nodes in the - flow. + Some exceptions do not extend from this class, including + synthetic, implicit, and shared exception types. """ - flow_identifier: str | None = None - """The unique identifier of the flow.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_FLOW_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_UPDATE_FLOW_INPUT.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_FLOW_INPUT.members["description"], self.description - ) - - if self.execution_role_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_FLOW_INPUT.members["executionRoleArn"], - self.execution_role_arn, - ) - - if self.customer_encryption_key_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_FLOW_INPUT.members["customerEncryptionKeyArn"], - self.customer_encryption_key_arn, - ) - - if self.definition is not None: - serializer.write_struct( - _SCHEMA_UPDATE_FLOW_INPUT.members["definition"], self.definition - ) - - if self.flow_identifier is not None: - serializer.write_string( - _SCHEMA_UPDATE_FLOW_INPUT.members["flowIdentifier"], - self.flow_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_FLOW_INPUT.members["name"] - ) - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_FLOW_INPUT.members["description"] - ) - - case 2: - kwargs["execution_role_arn"] = de.read_string( - _SCHEMA_UPDATE_FLOW_INPUT.members["executionRoleArn"] - ) - - case 3: - kwargs["customer_encryption_key_arn"] = de.read_string( - _SCHEMA_UPDATE_FLOW_INPUT.members["customerEncryptionKeyArn"] - ) - - case 4: - kwargs["definition"] = FlowDefinition.deserialize(de) - - case 5: - kwargs["flow_identifier"] = de.read_string( - _SCHEMA_UPDATE_FLOW_INPUT.members["flowIdentifier"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_FLOW_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateFlowOutput: - """Dataclass for UpdateFlowOutput structure.""" - - name: str - """The name of the flow.""" - - execution_role_arn: str - """ - The Amazon Resource Name (ARN) of the service role with permissions to - create a flow. For more information, see [Create a service role for - flows in Amazon - Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-permissions.html) - in the Amazon Bedrock User Guide. - """ +_registry = ModelRegistry( + _schemas, + renames={}, + index={ + "AccessControlAccess": "ACCESS_CONTROL_ACCESS", + "AccessControlPrincipalType": "ACCESS_CONTROL_PRINCIPAL_TYPE", + "AccessDeniedException": "ACCESS_DENIED_EXCEPTION", + "ActionGroupExecutor": "ACTION_GROUP_EXECUTOR", + "ActionGroupExecutorLambda": "ACTION_GROUP_EXECUTOR", + "ActionGroupExecutorCustomControl": "ACTION_GROUP_EXECUTOR", + "ActionGroupExecutorUnknown": "ACTION_GROUP_EXECUTOR", + "ActionGroupSignature": "ACTION_GROUP_SIGNATURE", + "ActionGroupState": "ACTION_GROUP_STATE", + "ActionGroupSummary": "ACTION_GROUP_SUMMARY", + "Agent": "AGENT", + "AgentActionGroup": "AGENT_ACTION_GROUP", + "AgentAlias": "AGENT_ALIAS", + "AgentAliasHistoryEvent": "AGENT_ALIAS_HISTORY_EVENT", + "AgentAliasRoutingConfigurationListItem": "AGENT_ALIAS_ROUTING_CONFIGURATION_LIST_ITEM", + "AgentAliasStatus": "AGENT_ALIAS_STATUS", + "AgentAliasSummary": "AGENT_ALIAS_SUMMARY", + "AgentCollaboration": "AGENT_COLLABORATION", + "AgentCollaborator": "AGENT_COLLABORATOR", + "AgentCollaboratorSummary": "AGENT_COLLABORATOR_SUMMARY", + "AgentDescriptor": "AGENT_DESCRIPTOR", + "AgentFlowNodeConfiguration": "AGENT_FLOW_NODE_CONFIGURATION", + "AgentKnowledgeBase": "AGENT_KNOWLEDGE_BASE", + "AgentKnowledgeBaseSummary": "AGENT_KNOWLEDGE_BASE_SUMMARY", + "AgentStatus": "AGENT_STATUS", + "AgentSummary": "AGENT_SUMMARY", + "AgentVersion": "AGENT_VERSION", + "AgentVersionSummary": "AGENT_VERSION_SUMMARY", + "AliasInvocationState": "ALIAS_INVOCATION_STATE", + "AnyToolChoice": "ANY_TOOL_CHOICE", + "APISchema": "API_SCHEMA", + "APISchemaS3": "API_SCHEMA", + "APISchemaPayload": "API_SCHEMA", + "APISchemaUnknown": "API_SCHEMA", + "AssociateAgentCollaboratorInput": "ASSOCIATE_AGENT_COLLABORATOR_INPUT", + "AssociateAgentCollaboratorOutput": "ASSOCIATE_AGENT_COLLABORATOR_OUTPUT", + "AssociateAgentKnowledgeBaseInput": "ASSOCIATE_AGENT_KNOWLEDGE_BASE_INPUT", + "AssociateAgentKnowledgeBaseOutput": "ASSOCIATE_AGENT_KNOWLEDGE_BASE_OUTPUT", + "AudioConfiguration": "AUDIO_CONFIGURATION", + "AudioExtractionConfiguration": "AUDIO_EXTRACTION_CONFIGURATION", + "AudioSegmentationConfiguration": "AUDIO_SEGMENTATION_CONFIGURATION", + "AutoToolChoice": "AUTO_TOOL_CHOICE", + "BedrockDataAutomationConfiguration": "BEDROCK_DATA_AUTOMATION_CONFIGURATION", + "BedrockEmbeddingModelConfiguration": "BEDROCK_EMBEDDING_MODEL_CONFIGURATION", + "BedrockFoundationModelConfiguration": "BEDROCK_FOUNDATION_MODEL_CONFIGURATION", + "BedrockFoundationModelContextEnrichmentConfiguration": "BEDROCK_FOUNDATION_MODEL_CONTEXT_ENRICHMENT_CONFIGURATION", + "ByteContentDoc": "BYTE_CONTENT_DOC", + "CachePointBlock": "CACHE_POINT_BLOCK", + "CachePointType": "CACHE_POINT_TYPE", + "ChatPromptTemplateConfiguration": "CHAT_PROMPT_TEMPLATE_CONFIGURATION", + "ChunkingConfiguration": "CHUNKING_CONFIGURATION", + "ChunkingStrategy": "CHUNKING_STRATEGY", + "CollectorFlowNodeConfiguration": "COLLECTOR_FLOW_NODE_CONFIGURATION", + "ConcurrencyType": "CONCURRENCY_TYPE", + "ConditionFlowNodeConfiguration": "CONDITION_FLOW_NODE_CONFIGURATION", + "ConflictException": "CONFLICT_EXCEPTION", + "ConfluenceAuthType": "CONFLUENCE_AUTH_TYPE", + "ConfluenceCrawlerConfiguration": "CONFLUENCE_CRAWLER_CONFIGURATION", + "ConfluenceDataSourceConfiguration": "CONFLUENCE_DATA_SOURCE_CONFIGURATION", + "ConfluenceHostType": "CONFLUENCE_HOST_TYPE", + "ConfluenceSourceConfiguration": "CONFLUENCE_SOURCE_CONFIGURATION", + "ContentBlock": "CONTENT_BLOCK", + "ContentBlockText": "CONTENT_BLOCK", + "ContentBlockCachePoint": "CONTENT_BLOCK", + "ContentBlockUnknown": "CONTENT_BLOCK", + "ContentDataSourceType": "CONTENT_DATA_SOURCE_TYPE", + "ContextEnrichmentConfiguration": "CONTEXT_ENRICHMENT_CONFIGURATION", + "ContextEnrichmentType": "CONTEXT_ENRICHMENT_TYPE", + "ConversationRole": "CONVERSATION_ROLE", + "CrawlFilterConfiguration": "CRAWL_FILTER_CONFIGURATION", + "CrawlFilterConfigurationType": "CRAWL_FILTER_CONFIGURATION_TYPE", + "CreateAgentActionGroupInput": "CREATE_AGENT_ACTION_GROUP_INPUT", + "CreateAgentActionGroupOutput": "CREATE_AGENT_ACTION_GROUP_OUTPUT", + "CreateAgentAliasInput": "CREATE_AGENT_ALIAS_INPUT", + "CreateAgentAliasOutput": "CREATE_AGENT_ALIAS_OUTPUT", + "CreateAgentInput": "CREATE_AGENT_INPUT", + "CreateAgentOutput": "CREATE_AGENT_OUTPUT", + "CreateDataSourceInput": "CREATE_DATA_SOURCE_INPUT", + "CreateDataSourceOutput": "CREATE_DATA_SOURCE_OUTPUT", + "CreateFlowAliasInput": "CREATE_FLOW_ALIAS_INPUT", + "CreateFlowAliasOutput": "CREATE_FLOW_ALIAS_OUTPUT", + "CreateFlowInput": "CREATE_FLOW_INPUT", + "CreateFlowOutput": "CREATE_FLOW_OUTPUT", + "CreateFlowVersionInput": "CREATE_FLOW_VERSION_INPUT", + "CreateFlowVersionOutput": "CREATE_FLOW_VERSION_OUTPUT", + "CreateKnowledgeBaseInput": "CREATE_KNOWLEDGE_BASE_INPUT", + "CreateKnowledgeBaseOutput": "CREATE_KNOWLEDGE_BASE_OUTPUT", + "CreatePromptInput": "CREATE_PROMPT_INPUT", + "CreatePromptOutput": "CREATE_PROMPT_OUTPUT", + "CreatePromptVersionInput": "CREATE_PROMPT_VERSION_INPUT", + "CreatePromptVersionOutput": "CREATE_PROMPT_VERSION_OUTPUT", + "CreateVpcConfigurationInput": "CREATE_VPC_CONFIGURATION_INPUT", + "CreateVpcConfigurationOutput": "CREATE_VPC_CONFIGURATION_OUTPUT", + "CreationMode": "CREATION_MODE", + "CuratedQuery": "CURATED_QUERY", + "CustomContent": "CUSTOM_CONTENT", + "CustomControlMethod": "CUSTOM_CONTROL_METHOD", + "CustomDocumentIdentifier": "CUSTOM_DOCUMENT_IDENTIFIER", + "CustomOrchestration": "CUSTOM_ORCHESTRATION", + "CustomS3Location": "CUSTOM_S3_LOCATION", + "CustomSourceType": "CUSTOM_SOURCE_TYPE", + "CustomTransformationConfiguration": "CUSTOM_TRANSFORMATION_CONFIGURATION", + "CyclicConnectionFlowValidationDetails": "CYCLIC_CONNECTION_FLOW_VALIDATION_DETAILS", + "DailySchedule": "DAILY_SCHEDULE", + "DataDeletionPolicy": "DATA_DELETION_POLICY", + "DataSource": "DATA_SOURCE", + "DataSourceConfiguration": "DATA_SOURCE_CONFIGURATION", + "DataSourceStatus": "DATA_SOURCE_STATUS", + "DataSourceSummary": "DATA_SOURCE_SUMMARY", + "DataSourceType": "DATA_SOURCE_TYPE", + "DayOfMonth": "DAY_OF_MONTH", + "DayOfMonthDayNumber": "DAY_OF_MONTH", + "DayOfMonthLastDayOfMonth": "DAY_OF_MONTH", + "DayOfMonthUnknown": "DAY_OF_MONTH", + "DayOfWeek": "DAY_OF_WEEK", + "DeleteAgentActionGroupInput": "DELETE_AGENT_ACTION_GROUP_INPUT", + "DeleteAgentActionGroupOutput": "DELETE_AGENT_ACTION_GROUP_OUTPUT", + "DeleteAgentAliasInput": "DELETE_AGENT_ALIAS_INPUT", + "DeleteAgentAliasOutput": "DELETE_AGENT_ALIAS_OUTPUT", + "DeleteAgentInput": "DELETE_AGENT_INPUT", + "DeleteAgentOutput": "DELETE_AGENT_OUTPUT", + "DeleteAgentVersionInput": "DELETE_AGENT_VERSION_INPUT", + "DeleteAgentVersionOutput": "DELETE_AGENT_VERSION_OUTPUT", + "DeleteDataSourceInput": "DELETE_DATA_SOURCE_INPUT", + "DeleteDataSourceOutput": "DELETE_DATA_SOURCE_OUTPUT", + "DeleteFlowAliasInput": "DELETE_FLOW_ALIAS_INPUT", + "DeleteFlowAliasOutput": "DELETE_FLOW_ALIAS_OUTPUT", + "DeleteFlowInput": "DELETE_FLOW_INPUT", + "DeleteFlowOutput": "DELETE_FLOW_OUTPUT", + "DeleteFlowVersionInput": "DELETE_FLOW_VERSION_INPUT", + "DeleteFlowVersionOutput": "DELETE_FLOW_VERSION_OUTPUT", + "DeleteKnowledgeBaseDocumentsInput": "DELETE_KNOWLEDGE_BASE_DOCUMENTS_INPUT", + "DeleteKnowledgeBaseDocumentsOutput": "DELETE_KNOWLEDGE_BASE_DOCUMENTS_OUTPUT", + "DeleteKnowledgeBaseInput": "DELETE_KNOWLEDGE_BASE_INPUT", + "DeleteKnowledgeBaseOutput": "DELETE_KNOWLEDGE_BASE_OUTPUT", + "DeletePromptInput": "DELETE_PROMPT_INPUT", + "DeletePromptOutput": "DELETE_PROMPT_OUTPUT", + "DeleteResourcePolicyInput": "DELETE_RESOURCE_POLICY_INPUT", + "DeleteResourcePolicyOutput": "DELETE_RESOURCE_POLICY_OUTPUT", + "DeleteVpcConfigurationInput": "DELETE_VPC_CONFIGURATION_INPUT", + "DeleteVpcConfigurationOutput": "DELETE_VPC_CONFIGURATION_OUTPUT", + "DeletionProtectionConfiguration": "DELETION_PROTECTION_CONFIGURATION", + "DisassociateAgentCollaboratorInput": "DISASSOCIATE_AGENT_COLLABORATOR_INPUT", + "DisassociateAgentCollaboratorOutput": "DISASSOCIATE_AGENT_COLLABORATOR_OUTPUT", + "DisassociateAgentKnowledgeBaseInput": "DISASSOCIATE_AGENT_KNOWLEDGE_BASE_INPUT", + "DisassociateAgentKnowledgeBaseOutput": "DISASSOCIATE_AGENT_KNOWLEDGE_BASE_OUTPUT", + "DocumentAccessControlEntry": "DOCUMENT_ACCESS_CONTROL_ENTRY", + "DocumentContent": "DOCUMENT_CONTENT", + "DocumentIdentifier": "DOCUMENT_IDENTIFIER", + "DocumentMetadata": "DOCUMENT_METADATA", + "DocumentStatus": "DOCUMENT_STATUS", + "DuplicateConditionExpressionFlowValidationDetails": "DUPLICATE_CONDITION_EXPRESSION_FLOW_VALIDATION_DETAILS", + "DuplicateConnectionsFlowValidationDetails": "DUPLICATE_CONNECTIONS_FLOW_VALIDATION_DETAILS", + "EmbeddingDataType": "EMBEDDING_DATA_TYPE", + "EmbeddingModelConfiguration": "EMBEDDING_MODEL_CONFIGURATION", + "EmbeddingModelType": "EMBEDDING_MODEL_TYPE", + "EnabledOrDisabledState": "ENABLED_OR_DISABLED_STATE", + "EnrichmentStrategyConfiguration": "ENRICHMENT_STRATEGY_CONFIGURATION", + "EnrichmentStrategyMethod": "ENRICHMENT_STRATEGY_METHOD", + "FieldForReranking": "FIELD_FOR_RERANKING", + "FixedSizeChunkingConfiguration": "FIXED_SIZE_CHUNKING_CONFIGURATION", + "FlowAliasConcurrencyConfiguration": "FLOW_ALIAS_CONCURRENCY_CONFIGURATION", + "FlowAliasRoutingConfigurationListItem": "FLOW_ALIAS_ROUTING_CONFIGURATION_LIST_ITEM", + "FlowAliasSummary": "FLOW_ALIAS_SUMMARY", + "FlowCondition": "FLOW_CONDITION", + "FlowConditionalConnectionConfiguration": "FLOW_CONDITIONAL_CONNECTION_CONFIGURATION", + "FlowConnection": "FLOW_CONNECTION", + "FlowConnectionConfiguration": "FLOW_CONNECTION_CONFIGURATION", + "FlowConnectionConfigurationData": "FLOW_CONNECTION_CONFIGURATION", + "FlowConnectionConfigurationConditional": "FLOW_CONNECTION_CONFIGURATION", + "FlowConnectionConfigurationUnknown": "FLOW_CONNECTION_CONFIGURATION", + "FlowConnectionType": "FLOW_CONNECTION_TYPE", + "FlowDataConnectionConfiguration": "FLOW_DATA_CONNECTION_CONFIGURATION", + "FlowDefinition": "FLOW_DEFINITION", + "FlowNode": "FLOW_NODE", + "FlowNodeConfiguration": "FLOW_NODE_CONFIGURATION", + "FlowNodeConfigurationInput": "FLOW_NODE_CONFIGURATION", + "FlowNodeConfigurationOutput": "FLOW_NODE_CONFIGURATION", + "FlowNodeConfigurationKnowledgeBase": "FLOW_NODE_CONFIGURATION", + "FlowNodeConfigurationCondition": "FLOW_NODE_CONFIGURATION", + "FlowNodeConfigurationLex": "FLOW_NODE_CONFIGURATION", + "FlowNodeConfigurationPrompt": "FLOW_NODE_CONFIGURATION", + "FlowNodeConfigurationLambdaFunction": "FLOW_NODE_CONFIGURATION", + "FlowNodeConfigurationStorage": "FLOW_NODE_CONFIGURATION", + "FlowNodeConfigurationAgent": "FLOW_NODE_CONFIGURATION", + "FlowNodeConfigurationRetrieval": "FLOW_NODE_CONFIGURATION", + "FlowNodeConfigurationIterator": "FLOW_NODE_CONFIGURATION", + "FlowNodeConfigurationCollector": "FLOW_NODE_CONFIGURATION", + "FlowNodeConfigurationInlineCode": "FLOW_NODE_CONFIGURATION", + "FlowNodeConfigurationLoop": "FLOW_NODE_CONFIGURATION", + "FlowNodeConfigurationLoopInput": "FLOW_NODE_CONFIGURATION", + "FlowNodeConfigurationLoopController": "FLOW_NODE_CONFIGURATION", + "FlowNodeConfigurationUnknown": "FLOW_NODE_CONFIGURATION", + "FlowNodeInput": "FLOW_NODE_INPUT", + "FlowNodeInputCategory": "FLOW_NODE_INPUT_CATEGORY", + "FlowNodeIODataType": "FLOW_NODE_IO_DATA_TYPE", + "FlowNodeOutput": "FLOW_NODE_OUTPUT", + "FlowNodeType": "FLOW_NODE_TYPE", + "FlowStatus": "FLOW_STATUS", + "FlowSummary": "FLOW_SUMMARY", + "FlowValidation": "FLOW_VALIDATION", + "FlowValidationDetails": "FLOW_VALIDATION_DETAILS", + "FlowValidationDetailsCyclicConnection": "FLOW_VALIDATION_DETAILS", + "FlowValidationDetailsDuplicateConnections": "FLOW_VALIDATION_DETAILS", + "FlowValidationDetailsDuplicateConditionExpression": "FLOW_VALIDATION_DETAILS", + "FlowValidationDetailsUnreachableNode": "FLOW_VALIDATION_DETAILS", + "FlowValidationDetailsUnknownConnectionSource": "FLOW_VALIDATION_DETAILS", + "FlowValidationDetailsUnknownConnectionSourceOutput": "FLOW_VALIDATION_DETAILS", + "FlowValidationDetailsUnknownConnectionTarget": "FLOW_VALIDATION_DETAILS", + "FlowValidationDetailsUnknownConnectionTargetInput": "FLOW_VALIDATION_DETAILS", + "FlowValidationDetailsUnknownConnectionCondition": "FLOW_VALIDATION_DETAILS", + "FlowValidationDetailsMalformedConditionExpression": "FLOW_VALIDATION_DETAILS", + "FlowValidationDetailsMalformedNodeInputExpression": "FLOW_VALIDATION_DETAILS", + "FlowValidationDetailsMismatchedNodeInputType": "FLOW_VALIDATION_DETAILS", + "FlowValidationDetailsMismatchedNodeOutputType": "FLOW_VALIDATION_DETAILS", + "FlowValidationDetailsIncompatibleConnectionDataType": "FLOW_VALIDATION_DETAILS", + "FlowValidationDetailsMissingConnectionConfiguration": "FLOW_VALIDATION_DETAILS", + "FlowValidationDetailsMissingDefaultCondition": "FLOW_VALIDATION_DETAILS", + "FlowValidationDetailsMissingEndingNodes": "FLOW_VALIDATION_DETAILS", + "FlowValidationDetailsMissingNodeConfiguration": "FLOW_VALIDATION_DETAILS", + "FlowValidationDetailsMissingNodeInput": "FLOW_VALIDATION_DETAILS", + "FlowValidationDetailsMissingNodeOutput": "FLOW_VALIDATION_DETAILS", + "FlowValidationDetailsMissingStartingNodes": "FLOW_VALIDATION_DETAILS", + "FlowValidationDetailsMultipleNodeInputConnections": "FLOW_VALIDATION_DETAILS", + "FlowValidationDetailsUnfulfilledNodeInput": "FLOW_VALIDATION_DETAILS", + "FlowValidationDetailsUnsatisfiedConnectionConditions": "FLOW_VALIDATION_DETAILS", + "FlowValidationDetailsUnspecified": "FLOW_VALIDATION_DETAILS", + "FlowValidationDetailsUnknownNodeInput": "FLOW_VALIDATION_DETAILS", + "FlowValidationDetailsUnknownNodeOutput": "FLOW_VALIDATION_DETAILS", + "FlowValidationDetailsMissingLoopInputNode": "FLOW_VALIDATION_DETAILS", + "FlowValidationDetailsMissingLoopControllerNode": "FLOW_VALIDATION_DETAILS", + "FlowValidationDetailsMultipleLoopInputNodes": "FLOW_VALIDATION_DETAILS", + "FlowValidationDetailsMultipleLoopControllerNodes": "FLOW_VALIDATION_DETAILS", + "FlowValidationDetailsLoopIncompatibleNodeType": "FLOW_VALIDATION_DETAILS", + "FlowValidationDetailsInvalidLoopBoundary": "FLOW_VALIDATION_DETAILS", + "FlowValidationDetailsUnknown": "FLOW_VALIDATION_DETAILS", + "FlowValidationSeverity": "FLOW_VALIDATION_SEVERITY", + "FlowValidationType": "FLOW_VALIDATION_TYPE", + "FlowVersionSummary": "FLOW_VERSION_SUMMARY", + "Function": "FUNCTION", + "FunctionSchema": "FUNCTION_SCHEMA", + "FunctionSchemaFunctions": "FUNCTION_SCHEMA", + "FunctionSchemaUnknown": "FUNCTION_SCHEMA", + "GetAgentActionGroupInput": "GET_AGENT_ACTION_GROUP_INPUT", + "GetAgentActionGroupOutput": "GET_AGENT_ACTION_GROUP_OUTPUT", + "GetAgentAliasInput": "GET_AGENT_ALIAS_INPUT", + "GetAgentAliasOutput": "GET_AGENT_ALIAS_OUTPUT", + "GetAgentCollaboratorInput": "GET_AGENT_COLLABORATOR_INPUT", + "GetAgentCollaboratorOutput": "GET_AGENT_COLLABORATOR_OUTPUT", + "GetAgentInput": "GET_AGENT_INPUT", + "GetAgentKnowledgeBaseInput": "GET_AGENT_KNOWLEDGE_BASE_INPUT", + "GetAgentKnowledgeBaseOutput": "GET_AGENT_KNOWLEDGE_BASE_OUTPUT", + "GetAgentOutput": "GET_AGENT_OUTPUT", + "GetAgentVersionInput": "GET_AGENT_VERSION_INPUT", + "GetAgentVersionOutput": "GET_AGENT_VERSION_OUTPUT", + "GetDataSourceInput": "GET_DATA_SOURCE_INPUT", + "GetDataSourceOutput": "GET_DATA_SOURCE_OUTPUT", + "GetFlowAliasInput": "GET_FLOW_ALIAS_INPUT", + "GetFlowAliasOutput": "GET_FLOW_ALIAS_OUTPUT", + "GetFlowInput": "GET_FLOW_INPUT", + "GetFlowOutput": "GET_FLOW_OUTPUT", + "GetFlowVersionInput": "GET_FLOW_VERSION_INPUT", + "GetFlowVersionOutput": "GET_FLOW_VERSION_OUTPUT", + "GetIngestionJobInput": "GET_INGESTION_JOB_INPUT", + "GetIngestionJobOutput": "GET_INGESTION_JOB_OUTPUT", + "GetKnowledgeBaseDocumentsInput": "GET_KNOWLEDGE_BASE_DOCUMENTS_INPUT", + "GetKnowledgeBaseDocumentsOutput": "GET_KNOWLEDGE_BASE_DOCUMENTS_OUTPUT", + "GetKnowledgeBaseInput": "GET_KNOWLEDGE_BASE_INPUT", + "GetKnowledgeBaseOutput": "GET_KNOWLEDGE_BASE_OUTPUT", + "GetPromptInput": "GET_PROMPT_INPUT", + "GetPromptOutput": "GET_PROMPT_OUTPUT", + "GetResourcePolicyInput": "GET_RESOURCE_POLICY_INPUT", + "GetResourcePolicyOutput": "GET_RESOURCE_POLICY_OUTPUT", + "GetVpcConfigurationInput": "GET_VPC_CONFIGURATION_INPUT", + "GetVpcConfigurationOutput": "GET_VPC_CONFIGURATION_OUTPUT", + "GuardrailConfiguration": "GUARDRAIL_CONFIGURATION", + "HierarchicalChunkingConfiguration": "HIERARCHICAL_CHUNKING_CONFIGURATION", + "HierarchicalChunkingLevelConfiguration": "HIERARCHICAL_CHUNKING_LEVEL_CONFIGURATION", + "ImageExtractionConfiguration": "IMAGE_EXTRACTION_CONFIGURATION", + "IncludedData": "INCLUDED_DATA", + "IncludeExclude": "INCLUDE_EXCLUDE", + "IncompatibleConnectionDataTypeFlowValidationDetails": "INCOMPATIBLE_CONNECTION_DATA_TYPE_FLOW_VALIDATION_DETAILS", + "IncompatibleLoopNodeType": "INCOMPATIBLE_LOOP_NODE_TYPE", + "InferenceConfiguration": "INFERENCE_CONFIGURATION", + "IngestionJob": "INGESTION_JOB", + "IngestionJobFilter": "INGESTION_JOB_FILTER", + "IngestionJobFilterAttribute": "INGESTION_JOB_FILTER_ATTRIBUTE", + "IngestionJobFilterOperator": "INGESTION_JOB_FILTER_OPERATOR", + "IngestionJobSortBy": "INGESTION_JOB_SORT_BY", + "IngestionJobSortByAttribute": "INGESTION_JOB_SORT_BY_ATTRIBUTE", + "IngestionJobStatistics": "INGESTION_JOB_STATISTICS", + "IngestionJobStatus": "INGESTION_JOB_STATUS", + "IngestionJobSummary": "INGESTION_JOB_SUMMARY", + "IngestKnowledgeBaseDocumentsInput": "INGEST_KNOWLEDGE_BASE_DOCUMENTS_INPUT", + "IngestKnowledgeBaseDocumentsOutput": "INGEST_KNOWLEDGE_BASE_DOCUMENTS_OUTPUT", + "InlineCodeFlowNodeConfiguration": "INLINE_CODE_FLOW_NODE_CONFIGURATION", + "InlineContent": "INLINE_CONTENT", + "InlineContentType": "INLINE_CONTENT_TYPE", + "InputFlowNodeConfiguration": "INPUT_FLOW_NODE_CONFIGURATION", + "IntermediateStorage": "INTERMEDIATE_STORAGE", + "InternalServerException": "INTERNAL_SERVER_EXCEPTION", + "InvalidLoopBoundaryFlowValidationDetails": "INVALID_LOOP_BOUNDARY_FLOW_VALIDATION_DETAILS", + "IteratorFlowNodeConfiguration": "ITERATOR_FLOW_NODE_CONFIGURATION", + "KendraKnowledgeBaseConfiguration": "KENDRA_KNOWLEDGE_BASE_CONFIGURATION", + "KnowledgeBase": "KNOWLEDGE_BASE", + "KnowledgeBaseConfiguration": "KNOWLEDGE_BASE_CONFIGURATION", + "KnowledgeBaseDocument": "KNOWLEDGE_BASE_DOCUMENT", + "KnowledgeBaseDocumentDetail": "KNOWLEDGE_BASE_DOCUMENT_DETAIL", + "KnowledgeBaseFlowNodeConfiguration": "KNOWLEDGE_BASE_FLOW_NODE_CONFIGURATION", + "KnowledgeBaseOrchestrationConfiguration": "KNOWLEDGE_BASE_ORCHESTRATION_CONFIGURATION", + "KnowledgeBasePromptTemplate": "KNOWLEDGE_BASE_PROMPT_TEMPLATE", + "KnowledgeBaseState": "KNOWLEDGE_BASE_STATE", + "KnowledgeBaseStatus": "KNOWLEDGE_BASE_STATUS", + "KnowledgeBaseStorageType": "KNOWLEDGE_BASE_STORAGE_TYPE", + "KnowledgeBaseSummary": "KNOWLEDGE_BASE_SUMMARY", + "KnowledgeBaseType": "KNOWLEDGE_BASE_TYPE", + "LambdaFunctionFlowNodeConfiguration": "LAMBDA_FUNCTION_FLOW_NODE_CONFIGURATION", + "LastDayOfMonth": "LAST_DAY_OF_MONTH", + "LexFlowNodeConfiguration": "LEX_FLOW_NODE_CONFIGURATION", + "ListAgentActionGroupsInput": "LIST_AGENT_ACTION_GROUPS_INPUT", + "ListAgentActionGroupsOutput": "LIST_AGENT_ACTION_GROUPS_OUTPUT", + "ListAgentAliasesInput": "LIST_AGENT_ALIASES_INPUT", + "ListAgentAliasesOutput": "LIST_AGENT_ALIASES_OUTPUT", + "ListAgentCollaboratorsInput": "LIST_AGENT_COLLABORATORS_INPUT", + "ListAgentCollaboratorsOutput": "LIST_AGENT_COLLABORATORS_OUTPUT", + "ListAgentKnowledgeBasesInput": "LIST_AGENT_KNOWLEDGE_BASES_INPUT", + "ListAgentKnowledgeBasesOutput": "LIST_AGENT_KNOWLEDGE_BASES_OUTPUT", + "ListAgentsInput": "LIST_AGENTS_INPUT", + "ListAgentsOutput": "LIST_AGENTS_OUTPUT", + "ListAgentVersionsInput": "LIST_AGENT_VERSIONS_INPUT", + "ListAgentVersionsOutput": "LIST_AGENT_VERSIONS_OUTPUT", + "ListDataSourcesInput": "LIST_DATA_SOURCES_INPUT", + "ListDataSourcesOutput": "LIST_DATA_SOURCES_OUTPUT", + "ListFlowAliasesInput": "LIST_FLOW_ALIASES_INPUT", + "ListFlowAliasesOutput": "LIST_FLOW_ALIASES_OUTPUT", + "ListFlowsInput": "LIST_FLOWS_INPUT", + "ListFlowsOutput": "LIST_FLOWS_OUTPUT", + "ListFlowVersionsInput": "LIST_FLOW_VERSIONS_INPUT", + "ListFlowVersionsOutput": "LIST_FLOW_VERSIONS_OUTPUT", + "ListIngestionJobsInput": "LIST_INGESTION_JOBS_INPUT", + "ListIngestionJobsOutput": "LIST_INGESTION_JOBS_OUTPUT", + "ListKnowledgeBaseDocumentsInput": "LIST_KNOWLEDGE_BASE_DOCUMENTS_INPUT", + "ListKnowledgeBaseDocumentsOutput": "LIST_KNOWLEDGE_BASE_DOCUMENTS_OUTPUT", + "ListKnowledgeBasesInput": "LIST_KNOWLEDGE_BASES_INPUT", + "ListKnowledgeBasesOutput": "LIST_KNOWLEDGE_BASES_OUTPUT", + "ListPromptsInput": "LIST_PROMPTS_INPUT", + "ListPromptsOutput": "LIST_PROMPTS_OUTPUT", + "ListTagsForResourceInput": "LIST_TAGS_FOR_RESOURCE_INPUT", + "ListTagsForResourceOutput": "LIST_TAGS_FOR_RESOURCE_OUTPUT", + "ListVpcConfigurationsInput": "LIST_VPC_CONFIGURATIONS_INPUT", + "ListVpcConfigurationsOutput": "LIST_VPC_CONFIGURATIONS_OUTPUT", + "LoopControllerFlowNodeConfiguration": "LOOP_CONTROLLER_FLOW_NODE_CONFIGURATION", + "LoopFlowNodeConfiguration": "LOOP_FLOW_NODE_CONFIGURATION", + "LoopIncompatibleNodeTypeFlowValidationDetails": "LOOP_INCOMPATIBLE_NODE_TYPE_FLOW_VALIDATION_DETAILS", + "LoopInputFlowNodeConfiguration": "LOOP_INPUT_FLOW_NODE_CONFIGURATION", + "MalformedConditionExpressionFlowValidationDetails": "MALFORMED_CONDITION_EXPRESSION_FLOW_VALIDATION_DETAILS", + "MalformedNodeInputExpressionFlowValidationDetails": "MALFORMED_NODE_INPUT_EXPRESSION_FLOW_VALIDATION_DETAILS", + "ManagedKnowledgeBaseConfiguration": "MANAGED_KNOWLEDGE_BASE_CONFIGURATION", + "ManagedKnowledgeBaseConnectorConfiguration": "MANAGED_KNOWLEDGE_BASE_CONNECTOR_CONFIGURATION", + "MediaExtractionConfiguration": "MEDIA_EXTRACTION_CONFIGURATION", + "MemoryConfiguration": "MEMORY_CONFIGURATION", + "MemoryType": "MEMORY_TYPE", + "Message": "MESSAGE", + "MetadataAttribute": "METADATA_ATTRIBUTE", + "MetadataAttributeValue": "METADATA_ATTRIBUTE_VALUE", + "MetadataConfigurationForReranking": "METADATA_CONFIGURATION_FOR_RERANKING", + "MetadataSourceType": "METADATA_SOURCE_TYPE", + "MetadataValueType": "METADATA_VALUE_TYPE", + "MismatchedNodeInputTypeFlowValidationDetails": "MISMATCHED_NODE_INPUT_TYPE_FLOW_VALIDATION_DETAILS", + "MismatchedNodeOutputTypeFlowValidationDetails": "MISMATCHED_NODE_OUTPUT_TYPE_FLOW_VALIDATION_DETAILS", + "MissingConnectionConfigurationFlowValidationDetails": "MISSING_CONNECTION_CONFIGURATION_FLOW_VALIDATION_DETAILS", + "MissingDefaultConditionFlowValidationDetails": "MISSING_DEFAULT_CONDITION_FLOW_VALIDATION_DETAILS", + "MissingEndingNodesFlowValidationDetails": "MISSING_ENDING_NODES_FLOW_VALIDATION_DETAILS", + "MissingLoopControllerNodeFlowValidationDetails": "MISSING_LOOP_CONTROLLER_NODE_FLOW_VALIDATION_DETAILS", + "MissingLoopInputNodeFlowValidationDetails": "MISSING_LOOP_INPUT_NODE_FLOW_VALIDATION_DETAILS", + "MissingNodeConfigurationFlowValidationDetails": "MISSING_NODE_CONFIGURATION_FLOW_VALIDATION_DETAILS", + "MissingNodeInputFlowValidationDetails": "MISSING_NODE_INPUT_FLOW_VALIDATION_DETAILS", + "MissingNodeOutputFlowValidationDetails": "MISSING_NODE_OUTPUT_FLOW_VALIDATION_DETAILS", + "MissingStartingNodesFlowValidationDetails": "MISSING_STARTING_NODES_FLOW_VALIDATION_DETAILS", + "MongoDbAtlasConfiguration": "MONGO_DB_ATLAS_CONFIGURATION", + "MongoDbAtlasFieldMapping": "MONGO_DB_ATLAS_FIELD_MAPPING", + "MonthlySchedule": "MONTHLY_SCHEDULE", + "MultipleLoopControllerNodesFlowValidationDetails": "MULTIPLE_LOOP_CONTROLLER_NODES_FLOW_VALIDATION_DETAILS", + "MultipleLoopInputNodesFlowValidationDetails": "MULTIPLE_LOOP_INPUT_NODES_FLOW_VALIDATION_DETAILS", + "MultipleNodeInputConnectionsFlowValidationDetails": "MULTIPLE_NODE_INPUT_CONNECTIONS_FLOW_VALIDATION_DETAILS", + "NeptuneAnalyticsConfiguration": "NEPTUNE_ANALYTICS_CONFIGURATION", + "NeptuneAnalyticsFieldMapping": "NEPTUNE_ANALYTICS_FIELD_MAPPING", + "OpenSearchManagedClusterConfiguration": "OPEN_SEARCH_MANAGED_CLUSTER_CONFIGURATION", + "OpenSearchManagedClusterFieldMapping": "OPEN_SEARCH_MANAGED_CLUSTER_FIELD_MAPPING", + "OpenSearchServerlessConfiguration": "OPEN_SEARCH_SERVERLESS_CONFIGURATION", + "OpenSearchServerlessFieldMapping": "OPEN_SEARCH_SERVERLESS_FIELD_MAPPING", + "OrchestrationExecutor": "ORCHESTRATION_EXECUTOR", + "OrchestrationExecutorLambda": "ORCHESTRATION_EXECUTOR", + "OrchestrationExecutorUnknown": "ORCHESTRATION_EXECUTOR", + "OrchestrationType": "ORCHESTRATION_TYPE", + "OutputFlowNodeConfiguration": "OUTPUT_FLOW_NODE_CONFIGURATION", + "ParameterDetail": "PARAMETER_DETAIL", + "ParsingConfiguration": "PARSING_CONFIGURATION", + "ParsingModality": "PARSING_MODALITY", + "ParsingPrompt": "PARSING_PROMPT", + "ParsingStrategy": "PARSING_STRATEGY", + "PatternObjectFilter": "PATTERN_OBJECT_FILTER", + "PatternObjectFilterConfiguration": "PATTERN_OBJECT_FILTER_CONFIGURATION", + "PerformanceConfigLatency": "PERFORMANCE_CONFIG_LATENCY", + "PerformanceConfiguration": "PERFORMANCE_CONFIGURATION", + "PineconeConfiguration": "PINECONE_CONFIGURATION", + "PineconeFieldMapping": "PINECONE_FIELD_MAPPING", + "PrepareAgentInput": "PREPARE_AGENT_INPUT", + "PrepareAgentOutput": "PREPARE_AGENT_OUTPUT", + "PrepareFlowInput": "PREPARE_FLOW_INPUT", + "PrepareFlowOutput": "PREPARE_FLOW_OUTPUT", + "PromptAgentResource": "PROMPT_AGENT_RESOURCE", + "PromptConfiguration": "PROMPT_CONFIGURATION", + "PromptFlowNodeConfiguration": "PROMPT_FLOW_NODE_CONFIGURATION", + "PromptFlowNodeInlineConfiguration": "PROMPT_FLOW_NODE_INLINE_CONFIGURATION", + "PromptFlowNodeResourceConfiguration": "PROMPT_FLOW_NODE_RESOURCE_CONFIGURATION", + "PromptFlowNodeSourceConfiguration": "PROMPT_FLOW_NODE_SOURCE_CONFIGURATION", + "PromptFlowNodeSourceConfigurationResource": "PROMPT_FLOW_NODE_SOURCE_CONFIGURATION", + "PromptFlowNodeSourceConfigurationInline": "PROMPT_FLOW_NODE_SOURCE_CONFIGURATION", + "PromptFlowNodeSourceConfigurationUnknown": "PROMPT_FLOW_NODE_SOURCE_CONFIGURATION", + "PromptGenAiResource": "PROMPT_GEN_AI_RESOURCE", + "PromptGenAiResourceAgent": "PROMPT_GEN_AI_RESOURCE", + "PromptGenAiResourceUnknown": "PROMPT_GEN_AI_RESOURCE", + "PromptInferenceConfiguration": "PROMPT_INFERENCE_CONFIGURATION", + "PromptInferenceConfigurationText": "PROMPT_INFERENCE_CONFIGURATION", + "PromptInferenceConfigurationUnknown": "PROMPT_INFERENCE_CONFIGURATION", + "PromptInputVariable": "PROMPT_INPUT_VARIABLE", + "PromptMetadataEntry": "PROMPT_METADATA_ENTRY", + "PromptModelInferenceConfiguration": "PROMPT_MODEL_INFERENCE_CONFIGURATION", + "PromptOverrideConfiguration": "PROMPT_OVERRIDE_CONFIGURATION", + "PromptState": "PROMPT_STATE", + "PromptSummary": "PROMPT_SUMMARY", + "PromptTemplateConfiguration": "PROMPT_TEMPLATE_CONFIGURATION", + "PromptTemplateConfigurationText": "PROMPT_TEMPLATE_CONFIGURATION", + "PromptTemplateConfigurationChat": "PROMPT_TEMPLATE_CONFIGURATION", + "PromptTemplateConfigurationUnknown": "PROMPT_TEMPLATE_CONFIGURATION", + "PromptTemplateType": "PROMPT_TEMPLATE_TYPE", + "PromptType": "PROMPT_TYPE", + "PromptVariant": "PROMPT_VARIANT", + "PutResourcePolicyInput": "PUT_RESOURCE_POLICY_INPUT", + "PutResourcePolicyOutput": "PUT_RESOURCE_POLICY_OUTPUT", + "QueryEngineType": "QUERY_ENGINE_TYPE", + "QueryGenerationColumn": "QUERY_GENERATION_COLUMN", + "QueryGenerationConfiguration": "QUERY_GENERATION_CONFIGURATION", + "QueryGenerationContext": "QUERY_GENERATION_CONTEXT", + "QueryGenerationTable": "QUERY_GENERATION_TABLE", + "RdsConfiguration": "RDS_CONFIGURATION", + "RdsFieldMapping": "RDS_FIELD_MAPPING", + "RedisEnterpriseCloudConfiguration": "REDIS_ENTERPRISE_CLOUD_CONFIGURATION", + "RedisEnterpriseCloudFieldMapping": "REDIS_ENTERPRISE_CLOUD_FIELD_MAPPING", + "RedshiftConfiguration": "REDSHIFT_CONFIGURATION", + "RedshiftProvisionedAuthConfiguration": "REDSHIFT_PROVISIONED_AUTH_CONFIGURATION", + "RedshiftProvisionedAuthType": "REDSHIFT_PROVISIONED_AUTH_TYPE", + "RedshiftProvisionedConfiguration": "REDSHIFT_PROVISIONED_CONFIGURATION", + "RedshiftQueryEngineAwsDataCatalogStorageConfiguration": "REDSHIFT_QUERY_ENGINE_AWS_DATA_CATALOG_STORAGE_CONFIGURATION", + "RedshiftQueryEngineConfiguration": "REDSHIFT_QUERY_ENGINE_CONFIGURATION", + "RedshiftQueryEngineRedshiftStorageConfiguration": "REDSHIFT_QUERY_ENGINE_REDSHIFT_STORAGE_CONFIGURATION", + "RedshiftQueryEngineStorageConfiguration": "REDSHIFT_QUERY_ENGINE_STORAGE_CONFIGURATION", + "RedshiftQueryEngineStorageType": "REDSHIFT_QUERY_ENGINE_STORAGE_TYPE", + "RedshiftQueryEngineType": "REDSHIFT_QUERY_ENGINE_TYPE", + "RedshiftServerlessAuthConfiguration": "REDSHIFT_SERVERLESS_AUTH_CONFIGURATION", + "RedshiftServerlessAuthType": "REDSHIFT_SERVERLESS_AUTH_TYPE", + "RedshiftServerlessConfiguration": "REDSHIFT_SERVERLESS_CONFIGURATION", + "RelayConversationHistory": "RELAY_CONVERSATION_HISTORY", + "RequireConfirmation": "REQUIRE_CONFIRMATION", + "RerankingMetadataSelectionMode": "RERANKING_METADATA_SELECTION_MODE", + "RerankingMetadataSelectiveModeConfiguration": "RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION", + "RerankingMetadataSelectiveModeConfigurationFieldsToInclude": "RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION", + "RerankingMetadataSelectiveModeConfigurationFieldsToExclude": "RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION", + "RerankingMetadataSelectiveModeConfigurationUnknown": "RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION", + "ResourceNotFoundException": "RESOURCE_NOT_FOUND_EXCEPTION", + "RetrievalFlowNodeConfiguration": "RETRIEVAL_FLOW_NODE_CONFIGURATION", + "RetrievalFlowNodeS3Configuration": "RETRIEVAL_FLOW_NODE_S3_CONFIGURATION", + "RetrievalFlowNodeServiceConfiguration": "RETRIEVAL_FLOW_NODE_SERVICE_CONFIGURATION", + "RetrievalFlowNodeServiceConfigurationS3": "RETRIEVAL_FLOW_NODE_SERVICE_CONFIGURATION", + "RetrievalFlowNodeServiceConfigurationUnknown": "RETRIEVAL_FLOW_NODE_SERVICE_CONFIGURATION", + "S3Content": "S3_CONTENT", + "S3DataSourceConfiguration": "S3_DATA_SOURCE_CONFIGURATION", + "S3Identifier": "S3_IDENTIFIER", + "S3Location": "S3_LOCATION", + "S3VectorsConfiguration": "S3_VECTORS_CONFIGURATION", + "SalesforceAuthType": "SALESFORCE_AUTH_TYPE", + "SalesforceCrawlerConfiguration": "SALESFORCE_CRAWLER_CONFIGURATION", + "SalesforceDataSourceConfiguration": "SALESFORCE_DATA_SOURCE_CONFIGURATION", + "SalesforceSourceConfiguration": "SALESFORCE_SOURCE_CONFIGURATION", + "SeedUrl": "SEED_URL", + "SemanticChunkingConfiguration": "SEMANTIC_CHUNKING_CONFIGURATION", + "ServerSideEncryptionConfiguration": "SERVER_SIDE_ENCRYPTION_CONFIGURATION", + "ServiceQuotaExceededException": "SERVICE_QUOTA_EXCEEDED_EXCEPTION", + "SessionSummaryConfiguration": "SESSION_SUMMARY_CONFIGURATION", + "SharePointAuthType": "SHARE_POINT_AUTH_TYPE", + "SharePointCrawlerConfiguration": "SHARE_POINT_CRAWLER_CONFIGURATION", + "SharePointDataSourceConfiguration": "SHARE_POINT_DATA_SOURCE_CONFIGURATION", + "SharePointHostType": "SHARE_POINT_HOST_TYPE", + "SharePointSourceConfiguration": "SHARE_POINT_SOURCE_CONFIGURATION", + "SortOrder": "SORT_ORDER", + "SpecificToolChoice": "SPECIFIC_TOOL_CHOICE", + "SqlKnowledgeBaseConfiguration": "SQL_KNOWLEDGE_BASE_CONFIGURATION", + "StartIngestionJobInput": "START_INGESTION_JOB_INPUT", + "StartIngestionJobOutput": "START_INGESTION_JOB_OUTPUT", + "StepType": "STEP_TYPE", + "StopIngestionJobInput": "STOP_INGESTION_JOB_INPUT", + "StopIngestionJobOutput": "STOP_INGESTION_JOB_OUTPUT", + "StorageConfiguration": "STORAGE_CONFIGURATION", + "StorageFlowNodeConfiguration": "STORAGE_FLOW_NODE_CONFIGURATION", + "StorageFlowNodeS3Configuration": "STORAGE_FLOW_NODE_S3_CONFIGURATION", + "StorageFlowNodeServiceConfiguration": "STORAGE_FLOW_NODE_SERVICE_CONFIGURATION", + "StorageFlowNodeServiceConfigurationS3": "STORAGE_FLOW_NODE_SERVICE_CONFIGURATION", + "StorageFlowNodeServiceConfigurationUnknown": "STORAGE_FLOW_NODE_SERVICE_CONFIGURATION", + "SupplementalDataStorageConfiguration": "SUPPLEMENTAL_DATA_STORAGE_CONFIGURATION", + "SupplementalDataStorageLocation": "SUPPLEMENTAL_DATA_STORAGE_LOCATION", + "SupplementalDataStorageLocationType": "SUPPLEMENTAL_DATA_STORAGE_LOCATION_TYPE", + "SupportedLanguages": "SUPPORTED_LANGUAGES", + "SyncSchedule": "SYNC_SCHEDULE", + "SyncScheduleDaily": "SYNC_SCHEDULE", + "SyncScheduleWeekly": "SYNC_SCHEDULE", + "SyncScheduleMonthly": "SYNC_SCHEDULE", + "SyncScheduleUnknown": "SYNC_SCHEDULE", + "SystemContentBlock": "SYSTEM_CONTENT_BLOCK", + "SystemContentBlockText": "SYSTEM_CONTENT_BLOCK", + "SystemContentBlockCachePoint": "SYSTEM_CONTENT_BLOCK", + "SystemContentBlockUnknown": "SYSTEM_CONTENT_BLOCK", + "TagResourceInput": "TAG_RESOURCE_INPUT", + "TagResourceOutput": "TAG_RESOURCE_OUTPUT", + "TextContentDoc": "TEXT_CONTENT_DOC", + "TextPromptTemplateConfiguration": "TEXT_PROMPT_TEMPLATE_CONFIGURATION", + "ThrottlingException": "THROTTLING_EXCEPTION", + "Tool": "TOOL", + "ToolToolSpec": "TOOL", + "ToolCachePoint": "TOOL", + "ToolUnknown": "TOOL", + "ToolChoice": "TOOL_CHOICE", + "ToolChoiceAuto": "TOOL_CHOICE", + "ToolChoiceAny": "TOOL_CHOICE", + "ToolChoiceTool": "TOOL_CHOICE", + "ToolChoiceUnknown": "TOOL_CHOICE", + "ToolConfiguration": "TOOL_CONFIGURATION", + "ToolInputSchema": "TOOL_INPUT_SCHEMA", + "ToolInputSchemaJson": "TOOL_INPUT_SCHEMA", + "ToolInputSchemaUnknown": "TOOL_INPUT_SCHEMA", + "ToolSpecification": "TOOL_SPECIFICATION", + "Transformation": "TRANSFORMATION", + "TransformationFunction": "TRANSFORMATION_FUNCTION", + "TransformationLambdaConfiguration": "TRANSFORMATION_LAMBDA_CONFIGURATION", + "Type": "TYPE", + "UnfulfilledNodeInputFlowValidationDetails": "UNFULFILLED_NODE_INPUT_FLOW_VALIDATION_DETAILS", + "UnknownConnectionConditionFlowValidationDetails": "UNKNOWN_CONNECTION_CONDITION_FLOW_VALIDATION_DETAILS", + "UnknownConnectionSourceFlowValidationDetails": "UNKNOWN_CONNECTION_SOURCE_FLOW_VALIDATION_DETAILS", + "UnknownConnectionSourceOutputFlowValidationDetails": "UNKNOWN_CONNECTION_SOURCE_OUTPUT_FLOW_VALIDATION_DETAILS", + "UnknownConnectionTargetFlowValidationDetails": "UNKNOWN_CONNECTION_TARGET_FLOW_VALIDATION_DETAILS", + "UnknownConnectionTargetInputFlowValidationDetails": "UNKNOWN_CONNECTION_TARGET_INPUT_FLOW_VALIDATION_DETAILS", + "UnknownNodeInputFlowValidationDetails": "UNKNOWN_NODE_INPUT_FLOW_VALIDATION_DETAILS", + "UnknownNodeOutputFlowValidationDetails": "UNKNOWN_NODE_OUTPUT_FLOW_VALIDATION_DETAILS", + "UnreachableNodeFlowValidationDetails": "UNREACHABLE_NODE_FLOW_VALIDATION_DETAILS", + "UnsatisfiedConnectionConditionsFlowValidationDetails": "UNSATISFIED_CONNECTION_CONDITIONS_FLOW_VALIDATION_DETAILS", + "UnspecifiedFlowValidationDetails": "UNSPECIFIED_FLOW_VALIDATION_DETAILS", + "UntagResourceInput": "UNTAG_RESOURCE_INPUT", + "UntagResourceOutput": "UNTAG_RESOURCE_OUTPUT", + "UpdateAgentActionGroupInput": "UPDATE_AGENT_ACTION_GROUP_INPUT", + "UpdateAgentActionGroupOutput": "UPDATE_AGENT_ACTION_GROUP_OUTPUT", + "UpdateAgentAliasInput": "UPDATE_AGENT_ALIAS_INPUT", + "UpdateAgentAliasOutput": "UPDATE_AGENT_ALIAS_OUTPUT", + "UpdateAgentCollaboratorInput": "UPDATE_AGENT_COLLABORATOR_INPUT", + "UpdateAgentCollaboratorOutput": "UPDATE_AGENT_COLLABORATOR_OUTPUT", + "UpdateAgentInput": "UPDATE_AGENT_INPUT", + "UpdateAgentKnowledgeBaseInput": "UPDATE_AGENT_KNOWLEDGE_BASE_INPUT", + "UpdateAgentKnowledgeBaseOutput": "UPDATE_AGENT_KNOWLEDGE_BASE_OUTPUT", + "UpdateAgentOutput": "UPDATE_AGENT_OUTPUT", + "UpdateDataSourceInput": "UPDATE_DATA_SOURCE_INPUT", + "UpdateDataSourceOutput": "UPDATE_DATA_SOURCE_OUTPUT", + "UpdateFlowAliasInput": "UPDATE_FLOW_ALIAS_INPUT", + "UpdateFlowAliasOutput": "UPDATE_FLOW_ALIAS_OUTPUT", + "UpdateFlowInput": "UPDATE_FLOW_INPUT", + "UpdateFlowOutput": "UPDATE_FLOW_OUTPUT", + "UpdateKnowledgeBaseInput": "UPDATE_KNOWLEDGE_BASE_INPUT", + "UpdateKnowledgeBaseOutput": "UPDATE_KNOWLEDGE_BASE_OUTPUT", + "UpdatePromptInput": "UPDATE_PROMPT_INPUT", + "UpdatePromptOutput": "UPDATE_PROMPT_OUTPUT", + "UrlConfiguration": "URL_CONFIGURATION", + "ValidateFlowDefinitionInput": "VALIDATE_FLOW_DEFINITION_INPUT", + "ValidateFlowDefinitionOutput": "VALIDATE_FLOW_DEFINITION_OUTPUT", + "ValidationException": "VALIDATION_EXCEPTION", + "ValidationExceptionField": "VALIDATION_EXCEPTION_FIELD", + "VectorIngestionConfiguration": "VECTOR_INGESTION_CONFIGURATION", + "VectorKnowledgeBaseConfiguration": "VECTOR_KNOWLEDGE_BASE_CONFIGURATION", + "VectorSearchBedrockRerankingConfiguration": "VECTOR_SEARCH_BEDROCK_RERANKING_CONFIGURATION", + "VectorSearchBedrockRerankingModelConfiguration": "VECTOR_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION", + "VectorSearchRerankingConfiguration": "VECTOR_SEARCH_RERANKING_CONFIGURATION", + "VectorSearchRerankingConfigurationType": "VECTOR_SEARCH_RERANKING_CONFIGURATION_TYPE", + "VideoConfiguration": "VIDEO_CONFIGURATION", + "VideoExtractionConfiguration": "VIDEO_EXTRACTION_CONFIGURATION", + "VideoSegmentationConfiguration": "VIDEO_SEGMENTATION_CONFIGURATION", + "VpcConfiguration": "VPC_CONFIGURATION", + "VpcConfigurationStatus": "VPC_CONFIGURATION_STATUS", + "VpcConfigurationSummary": "VPC_CONFIGURATION_SUMMARY", + "VpcProtocol": "VPC_PROTOCOL", + "VpcResolutionMode": "VPC_RESOLUTION_MODE", + "WebCrawlerConfiguration": "WEB_CRAWLER_CONFIGURATION", + "WebCrawlerLimits": "WEB_CRAWLER_LIMITS", + "WebDataSourceConfiguration": "WEB_DATA_SOURCE_CONFIGURATION", + "WebScopeType": "WEB_SCOPE_TYPE", + "WebSourceConfiguration": "WEB_SOURCE_CONFIGURATION", + "WeeklySchedule": "WEEKLY_SCHEDULE", + }, + shape_names=frozenset( + { + "APISchema", + "AccessControlAccess", + "AccessControlPrincipalType", + "AccessDeniedException", + "ActionGroupExecutor", + "ActionGroupSignature", + "ActionGroupState", + "ActionGroupSummary", + "Agent", + "AgentActionGroup", + "AgentAlias", + "AgentAliasHistoryEvent", + "AgentAliasRoutingConfigurationListItem", + "AgentAliasStatus", + "AgentAliasSummary", + "AgentCollaboration", + "AgentCollaborator", + "AgentCollaboratorSummary", + "AgentDescriptor", + "AgentFlowNodeConfiguration", + "AgentKnowledgeBase", + "AgentKnowledgeBaseSummary", + "AgentStatus", + "AgentSummary", + "AgentVersion", + "AgentVersionSummary", + "AliasInvocationState", + "AnyToolChoice", + "AssociateAgentCollaboratorInput", + "AssociateAgentCollaboratorOutput", + "AssociateAgentKnowledgeBaseInput", + "AssociateAgentKnowledgeBaseOutput", + "AudioConfiguration", + "AudioExtractionConfiguration", + "AudioSegmentationConfiguration", + "AutoToolChoice", + "BedrockDataAutomationConfiguration", + "BedrockEmbeddingModelConfiguration", + "BedrockFoundationModelConfiguration", + "BedrockFoundationModelContextEnrichmentConfiguration", + "ByteContentDoc", + "CachePointBlock", + "CachePointType", + "ChatPromptTemplateConfiguration", + "ChunkingConfiguration", + "ChunkingStrategy", + "CollectorFlowNodeConfiguration", + "ConcurrencyType", + "ConditionFlowNodeConfiguration", + "ConflictException", + "ConfluenceAuthType", + "ConfluenceCrawlerConfiguration", + "ConfluenceDataSourceConfiguration", + "ConfluenceHostType", + "ConfluenceSourceConfiguration", + "ContentBlock", + "ContentDataSourceType", + "ContextEnrichmentConfiguration", + "ContextEnrichmentType", + "ConversationRole", + "CrawlFilterConfiguration", + "CrawlFilterConfigurationType", + "CreateAgentActionGroupInput", + "CreateAgentActionGroupOutput", + "CreateAgentAliasInput", + "CreateAgentAliasOutput", + "CreateAgentInput", + "CreateAgentOutput", + "CreateDataSourceInput", + "CreateDataSourceOutput", + "CreateFlowAliasInput", + "CreateFlowAliasOutput", + "CreateFlowInput", + "CreateFlowOutput", + "CreateFlowVersionInput", + "CreateFlowVersionOutput", + "CreateKnowledgeBaseInput", + "CreateKnowledgeBaseOutput", + "CreatePromptInput", + "CreatePromptOutput", + "CreatePromptVersionInput", + "CreatePromptVersionOutput", + "CreateVpcConfigurationInput", + "CreateVpcConfigurationOutput", + "CreationMode", + "CuratedQuery", + "CustomContent", + "CustomControlMethod", + "CustomDocumentIdentifier", + "CustomOrchestration", + "CustomS3Location", + "CustomSourceType", + "CustomTransformationConfiguration", + "CyclicConnectionFlowValidationDetails", + "DailySchedule", + "DataDeletionPolicy", + "DataSource", + "DataSourceConfiguration", + "DataSourceStatus", + "DataSourceSummary", + "DataSourceType", + "DayOfMonth", + "DayOfWeek", + "DeleteAgentActionGroupInput", + "DeleteAgentActionGroupOutput", + "DeleteAgentAliasInput", + "DeleteAgentAliasOutput", + "DeleteAgentInput", + "DeleteAgentOutput", + "DeleteAgentVersionInput", + "DeleteAgentVersionOutput", + "DeleteDataSourceInput", + "DeleteDataSourceOutput", + "DeleteFlowAliasInput", + "DeleteFlowAliasOutput", + "DeleteFlowInput", + "DeleteFlowOutput", + "DeleteFlowVersionInput", + "DeleteFlowVersionOutput", + "DeleteKnowledgeBaseDocumentsInput", + "DeleteKnowledgeBaseDocumentsOutput", + "DeleteKnowledgeBaseInput", + "DeleteKnowledgeBaseOutput", + "DeletePromptInput", + "DeletePromptOutput", + "DeleteResourcePolicyInput", + "DeleteResourcePolicyOutput", + "DeleteVpcConfigurationInput", + "DeleteVpcConfigurationOutput", + "DeletionProtectionConfiguration", + "DisassociateAgentCollaboratorInput", + "DisassociateAgentCollaboratorOutput", + "DisassociateAgentKnowledgeBaseInput", + "DisassociateAgentKnowledgeBaseOutput", + "DocumentAccessControlEntry", + "DocumentContent", + "DocumentIdentifier", + "DocumentMetadata", + "DocumentStatus", + "DuplicateConditionExpressionFlowValidationDetails", + "DuplicateConnectionsFlowValidationDetails", + "EmbeddingDataType", + "EmbeddingModelConfiguration", + "EmbeddingModelType", + "EnabledOrDisabledState", + "EnrichmentStrategyConfiguration", + "EnrichmentStrategyMethod", + "FieldForReranking", + "FixedSizeChunkingConfiguration", + "FlowAliasConcurrencyConfiguration", + "FlowAliasRoutingConfigurationListItem", + "FlowAliasSummary", + "FlowCondition", + "FlowConditionalConnectionConfiguration", + "FlowConnection", + "FlowConnectionConfiguration", + "FlowConnectionType", + "FlowDataConnectionConfiguration", + "FlowDefinition", + "FlowNode", + "FlowNodeConfiguration", + "FlowNodeIODataType", + "FlowNodeInput", + "FlowNodeInputCategory", + "FlowNodeOutput", + "FlowNodeType", + "FlowStatus", + "FlowSummary", + "FlowValidation", + "FlowValidationDetails", + "FlowValidationSeverity", + "FlowValidationType", + "FlowVersionSummary", + "Function", + "FunctionSchema", + "GetAgentActionGroupInput", + "GetAgentActionGroupOutput", + "GetAgentAliasInput", + "GetAgentAliasOutput", + "GetAgentCollaboratorInput", + "GetAgentCollaboratorOutput", + "GetAgentInput", + "GetAgentKnowledgeBaseInput", + "GetAgentKnowledgeBaseOutput", + "GetAgentOutput", + "GetAgentVersionInput", + "GetAgentVersionOutput", + "GetDataSourceInput", + "GetDataSourceOutput", + "GetFlowAliasInput", + "GetFlowAliasOutput", + "GetFlowInput", + "GetFlowOutput", + "GetFlowVersionInput", + "GetFlowVersionOutput", + "GetIngestionJobInput", + "GetIngestionJobOutput", + "GetKnowledgeBaseDocumentsInput", + "GetKnowledgeBaseDocumentsOutput", + "GetKnowledgeBaseInput", + "GetKnowledgeBaseOutput", + "GetPromptInput", + "GetPromptOutput", + "GetResourcePolicyInput", + "GetResourcePolicyOutput", + "GetVpcConfigurationInput", + "GetVpcConfigurationOutput", + "GuardrailConfiguration", + "HierarchicalChunkingConfiguration", + "HierarchicalChunkingLevelConfiguration", + "ImageExtractionConfiguration", + "IncludeExclude", + "IncludedData", + "IncompatibleConnectionDataTypeFlowValidationDetails", + "IncompatibleLoopNodeType", + "InferenceConfiguration", + "IngestKnowledgeBaseDocumentsInput", + "IngestKnowledgeBaseDocumentsOutput", + "IngestionJob", + "IngestionJobFilter", + "IngestionJobFilterAttribute", + "IngestionJobFilterOperator", + "IngestionJobSortBy", + "IngestionJobSortByAttribute", + "IngestionJobStatistics", + "IngestionJobStatus", + "IngestionJobSummary", + "InlineCodeFlowNodeConfiguration", + "InlineContent", + "InlineContentType", + "InputFlowNodeConfiguration", + "IntermediateStorage", + "InternalServerException", + "InvalidLoopBoundaryFlowValidationDetails", + "IteratorFlowNodeConfiguration", + "KendraKnowledgeBaseConfiguration", + "KnowledgeBase", + "KnowledgeBaseConfiguration", + "KnowledgeBaseDocument", + "KnowledgeBaseDocumentDetail", + "KnowledgeBaseFlowNodeConfiguration", + "KnowledgeBaseOrchestrationConfiguration", + "KnowledgeBasePromptTemplate", + "KnowledgeBaseState", + "KnowledgeBaseStatus", + "KnowledgeBaseStorageType", + "KnowledgeBaseSummary", + "KnowledgeBaseType", + "LambdaFunctionFlowNodeConfiguration", + "LastDayOfMonth", + "LexFlowNodeConfiguration", + "ListAgentActionGroupsInput", + "ListAgentActionGroupsOutput", + "ListAgentAliasesInput", + "ListAgentAliasesOutput", + "ListAgentCollaboratorsInput", + "ListAgentCollaboratorsOutput", + "ListAgentKnowledgeBasesInput", + "ListAgentKnowledgeBasesOutput", + "ListAgentVersionsInput", + "ListAgentVersionsOutput", + "ListAgentsInput", + "ListAgentsOutput", + "ListDataSourcesInput", + "ListDataSourcesOutput", + "ListFlowAliasesInput", + "ListFlowAliasesOutput", + "ListFlowVersionsInput", + "ListFlowVersionsOutput", + "ListFlowsInput", + "ListFlowsOutput", + "ListIngestionJobsInput", + "ListIngestionJobsOutput", + "ListKnowledgeBaseDocumentsInput", + "ListKnowledgeBaseDocumentsOutput", + "ListKnowledgeBasesInput", + "ListKnowledgeBasesOutput", + "ListPromptsInput", + "ListPromptsOutput", + "ListTagsForResourceInput", + "ListTagsForResourceOutput", + "ListVpcConfigurationsInput", + "ListVpcConfigurationsOutput", + "LoopControllerFlowNodeConfiguration", + "LoopFlowNodeConfiguration", + "LoopIncompatibleNodeTypeFlowValidationDetails", + "LoopInputFlowNodeConfiguration", + "MalformedConditionExpressionFlowValidationDetails", + "MalformedNodeInputExpressionFlowValidationDetails", + "ManagedKnowledgeBaseConfiguration", + "ManagedKnowledgeBaseConnectorConfiguration", + "MediaExtractionConfiguration", + "MemoryConfiguration", + "MemoryType", + "Message", + "MetadataAttribute", + "MetadataAttributeValue", + "MetadataConfigurationForReranking", + "MetadataSourceType", + "MetadataValueType", + "MismatchedNodeInputTypeFlowValidationDetails", + "MismatchedNodeOutputTypeFlowValidationDetails", + "MissingConnectionConfigurationFlowValidationDetails", + "MissingDefaultConditionFlowValidationDetails", + "MissingEndingNodesFlowValidationDetails", + "MissingLoopControllerNodeFlowValidationDetails", + "MissingLoopInputNodeFlowValidationDetails", + "MissingNodeConfigurationFlowValidationDetails", + "MissingNodeInputFlowValidationDetails", + "MissingNodeOutputFlowValidationDetails", + "MissingStartingNodesFlowValidationDetails", + "MongoDbAtlasConfiguration", + "MongoDbAtlasFieldMapping", + "MonthlySchedule", + "MultipleLoopControllerNodesFlowValidationDetails", + "MultipleLoopInputNodesFlowValidationDetails", + "MultipleNodeInputConnectionsFlowValidationDetails", + "NeptuneAnalyticsConfiguration", + "NeptuneAnalyticsFieldMapping", + "OpenSearchManagedClusterConfiguration", + "OpenSearchManagedClusterFieldMapping", + "OpenSearchServerlessConfiguration", + "OpenSearchServerlessFieldMapping", + "OrchestrationExecutor", + "OrchestrationType", + "OutputFlowNodeConfiguration", + "ParameterDetail", + "ParsingConfiguration", + "ParsingModality", + "ParsingPrompt", + "ParsingStrategy", + "PatternObjectFilter", + "PatternObjectFilterConfiguration", + "PerformanceConfigLatency", + "PerformanceConfiguration", + "PineconeConfiguration", + "PineconeFieldMapping", + "PrepareAgentInput", + "PrepareAgentOutput", + "PrepareFlowInput", + "PrepareFlowOutput", + "PromptAgentResource", + "PromptConfiguration", + "PromptFlowNodeConfiguration", + "PromptFlowNodeInlineConfiguration", + "PromptFlowNodeResourceConfiguration", + "PromptFlowNodeSourceConfiguration", + "PromptGenAiResource", + "PromptInferenceConfiguration", + "PromptInputVariable", + "PromptMetadataEntry", + "PromptModelInferenceConfiguration", + "PromptOverrideConfiguration", + "PromptState", + "PromptSummary", + "PromptTemplateConfiguration", + "PromptTemplateType", + "PromptType", + "PromptVariant", + "PutResourcePolicyInput", + "PutResourcePolicyOutput", + "QueryEngineType", + "QueryGenerationColumn", + "QueryGenerationConfiguration", + "QueryGenerationContext", + "QueryGenerationTable", + "RdsConfiguration", + "RdsFieldMapping", + "RedisEnterpriseCloudConfiguration", + "RedisEnterpriseCloudFieldMapping", + "RedshiftConfiguration", + "RedshiftProvisionedAuthConfiguration", + "RedshiftProvisionedAuthType", + "RedshiftProvisionedConfiguration", + "RedshiftQueryEngineAwsDataCatalogStorageConfiguration", + "RedshiftQueryEngineConfiguration", + "RedshiftQueryEngineRedshiftStorageConfiguration", + "RedshiftQueryEngineStorageConfiguration", + "RedshiftQueryEngineStorageType", + "RedshiftQueryEngineType", + "RedshiftServerlessAuthConfiguration", + "RedshiftServerlessAuthType", + "RedshiftServerlessConfiguration", + "RelayConversationHistory", + "RequireConfirmation", + "RerankingMetadataSelectionMode", + "RerankingMetadataSelectiveModeConfiguration", + "ResourceNotFoundException", + "RetrievalFlowNodeConfiguration", + "RetrievalFlowNodeS3Configuration", + "RetrievalFlowNodeServiceConfiguration", + "S3Content", + "S3DataSourceConfiguration", + "S3Identifier", + "S3Location", + "S3VectorsConfiguration", + "SalesforceAuthType", + "SalesforceCrawlerConfiguration", + "SalesforceDataSourceConfiguration", + "SalesforceSourceConfiguration", + "SeedUrl", + "SemanticChunkingConfiguration", + "ServerSideEncryptionConfiguration", + "ServiceQuotaExceededException", + "SessionSummaryConfiguration", + "SharePointAuthType", + "SharePointCrawlerConfiguration", + "SharePointDataSourceConfiguration", + "SharePointHostType", + "SharePointSourceConfiguration", + "SortOrder", + "SpecificToolChoice", + "SqlKnowledgeBaseConfiguration", + "StartIngestionJobInput", + "StartIngestionJobOutput", + "StepType", + "StopIngestionJobInput", + "StopIngestionJobOutput", + "StorageConfiguration", + "StorageFlowNodeConfiguration", + "StorageFlowNodeS3Configuration", + "StorageFlowNodeServiceConfiguration", + "SupplementalDataStorageConfiguration", + "SupplementalDataStorageLocation", + "SupplementalDataStorageLocationType", + "SupportedLanguages", + "SyncSchedule", + "SystemContentBlock", + "TagResourceInput", + "TagResourceOutput", + "TextContentDoc", + "TextPromptTemplateConfiguration", + "ThrottlingException", + "Tool", + "ToolChoice", + "ToolConfiguration", + "ToolInputSchema", + "ToolSpecification", + "Transformation", + "TransformationFunction", + "TransformationLambdaConfiguration", + "Type", + "UnfulfilledNodeInputFlowValidationDetails", + "UnknownConnectionConditionFlowValidationDetails", + "UnknownConnectionSourceFlowValidationDetails", + "UnknownConnectionSourceOutputFlowValidationDetails", + "UnknownConnectionTargetFlowValidationDetails", + "UnknownConnectionTargetInputFlowValidationDetails", + "UnknownNodeInputFlowValidationDetails", + "UnknownNodeOutputFlowValidationDetails", + "UnreachableNodeFlowValidationDetails", + "UnsatisfiedConnectionConditionsFlowValidationDetails", + "UnspecifiedFlowValidationDetails", + "UntagResourceInput", + "UntagResourceOutput", + "UpdateAgentActionGroupInput", + "UpdateAgentActionGroupOutput", + "UpdateAgentAliasInput", + "UpdateAgentAliasOutput", + "UpdateAgentCollaboratorInput", + "UpdateAgentCollaboratorOutput", + "UpdateAgentInput", + "UpdateAgentKnowledgeBaseInput", + "UpdateAgentKnowledgeBaseOutput", + "UpdateAgentOutput", + "UpdateDataSourceInput", + "UpdateDataSourceOutput", + "UpdateFlowAliasInput", + "UpdateFlowAliasOutput", + "UpdateFlowInput", + "UpdateFlowOutput", + "UpdateKnowledgeBaseInput", + "UpdateKnowledgeBaseOutput", + "UpdatePromptInput", + "UpdatePromptOutput", + "UrlConfiguration", + "ValidateFlowDefinitionInput", + "ValidateFlowDefinitionOutput", + "ValidationException", + "ValidationExceptionField", + "VectorIngestionConfiguration", + "VectorKnowledgeBaseConfiguration", + "VectorSearchBedrockRerankingConfiguration", + "VectorSearchBedrockRerankingModelConfiguration", + "VectorSearchRerankingConfiguration", + "VectorSearchRerankingConfigurationType", + "VideoConfiguration", + "VideoExtractionConfiguration", + "VideoSegmentationConfiguration", + "VpcConfiguration", + "VpcConfigurationStatus", + "VpcConfigurationSummary", + "VpcProtocol", + "VpcResolutionMode", + "WebCrawlerConfiguration", + "WebCrawlerLimits", + "WebDataSourceConfiguration", + "WebScopeType", + "WebSourceConfiguration", + "WeeklySchedule", + } + ), + service_error="ServiceError", +) + + +def __getattr__(name: str): + return _registry.build(name) + + +CREATE_AGENT_ACTION_GROUP: APIOperation[ + CreateAgentActionGroupInput, CreateAgentActionGroupOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_AGENT_ACTION_GROUP, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#ConflictException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +DELETE_AGENT_ACTION_GROUP: APIOperation[ + DeleteAgentActionGroupInput, DeleteAgentActionGroupOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_AGENT_ACTION_GROUP, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#ConflictException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +GET_AGENT_ACTION_GROUP: APIOperation[ + GetAgentActionGroupInput, GetAgentActionGroupOutput +] = APIOperation( + static_schema=_SCHEMA_GET_AGENT_ACTION_GROUP, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +LIST_AGENT_ACTION_GROUPS: APIOperation[ + ListAgentActionGroupsInput, ListAgentActionGroupsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_AGENT_ACTION_GROUPS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +UPDATE_AGENT_ACTION_GROUP: APIOperation[ + UpdateAgentActionGroupInput, UpdateAgentActionGroupOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_AGENT_ACTION_GROUP, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#ConflictException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - id: str - """The unique identifier of the flow.""" +ASSOCIATE_AGENT_COLLABORATOR: APIOperation[ + AssociateAgentCollaboratorInput, AssociateAgentCollaboratorOutput +] = APIOperation( + static_schema=_SCHEMA_ASSOCIATE_AGENT_COLLABORATOR, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#ConflictException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - arn: str - """The Amazon Resource Name (ARN) of the flow.""" +DISASSOCIATE_AGENT_COLLABORATOR: APIOperation[ + DisassociateAgentCollaboratorInput, DisassociateAgentCollaboratorOutput +] = APIOperation( + static_schema=_SCHEMA_DISASSOCIATE_AGENT_COLLABORATOR, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#ConflictException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - status: str - """ - The status of the flow. When you submit this request, the status will be - `NotPrepared`. If updating fails, the status becomes `Failed`. - """ +GET_AGENT_COLLABORATOR: APIOperation[ + GetAgentCollaboratorInput, GetAgentCollaboratorOutput +] = APIOperation( + static_schema=_SCHEMA_GET_AGENT_COLLABORATOR, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - created_at: datetime - """The time at which the flow was created.""" +LIST_AGENT_COLLABORATORS: APIOperation[ + ListAgentCollaboratorsInput, ListAgentCollaboratorsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_AGENT_COLLABORATORS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - updated_at: datetime - """The time at which the flow was last updated.""" +UPDATE_AGENT_COLLABORATOR: APIOperation[ + UpdateAgentCollaboratorInput, UpdateAgentCollaboratorOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_AGENT_COLLABORATOR, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#ConflictException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - version: str - """ - The version of the flow. When you update a flow, the version updated is - the `DRAFT` version. - """ +CREATE_AGENT: APIOperation[CreateAgentInput, CreateAgentOutput] = APIOperation( + static_schema=_SCHEMA_CREATE_AGENT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#ConflictException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - description: str | None = None - """The description of the flow.""" +DELETE_AGENT: APIOperation[DeleteAgentInput, DeleteAgentOutput] = APIOperation( + static_schema=_SCHEMA_DELETE_AGENT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#ConflictException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - customer_encryption_key_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the KMS key that the flow was - encrypted with. - """ +GET_AGENT: APIOperation[GetAgentInput, GetAgentOutput] = APIOperation( + static_schema=_SCHEMA_GET_AGENT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - definition: "FlowDefinition | None" = field(repr=False, default=None) - """A definition of the nodes and the connections between nodes in the flow.""" +LIST_AGENTS: APIOperation[ListAgentsInput, ListAgentsOutput] = APIOperation( + static_schema=_SCHEMA_LIST_AGENTS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False +PREPARE_AGENT: APIOperation[PrepareAgentInput, PrepareAgentOutput] = APIOperation( + static_schema=_SCHEMA_PREPARE_AGENT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#ConflictException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +UPDATE_AGENT: APIOperation[UpdateAgentInput, UpdateAgentOutput] = APIOperation( + static_schema=_SCHEMA_UPDATE_AGENT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#ConflictException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +CREATE_AGENT_ALIAS: APIOperation[CreateAgentAliasInput, CreateAgentAliasOutput] = ( + APIOperation( + static_schema=_SCHEMA_CREATE_AGENT_ALIAS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#ConflictException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_FLOW_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_UPDATE_FLOW_OUTPUT.members["name"], self.name) - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_FLOW_OUTPUT.members["description"], self.description - ) - - serializer.write_string( - _SCHEMA_UPDATE_FLOW_OUTPUT.members["executionRoleArn"], - self.execution_role_arn, - ) - if self.customer_encryption_key_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_FLOW_OUTPUT.members["customerEncryptionKeyArn"], - self.customer_encryption_key_arn, - ) - - serializer.write_string(_SCHEMA_UPDATE_FLOW_OUTPUT.members["id"], self.id) - serializer.write_string(_SCHEMA_UPDATE_FLOW_OUTPUT.members["arn"], self.arn) - serializer.write_string( - _SCHEMA_UPDATE_FLOW_OUTPUT.members["status"], self.status - ) - serializer.write_timestamp( - _SCHEMA_UPDATE_FLOW_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_UPDATE_FLOW_OUTPUT.members["updatedAt"], self.updated_at - ) - serializer.write_string( - _SCHEMA_UPDATE_FLOW_OUTPUT.members["version"], self.version - ) - if self.definition is not None: - serializer.write_struct( - _SCHEMA_UPDATE_FLOW_OUTPUT.members["definition"], self.definition - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_FLOW_OUTPUT.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_FLOW_OUTPUT.members["description"] - ) - - case 2: - kwargs["execution_role_arn"] = de.read_string( - _SCHEMA_UPDATE_FLOW_OUTPUT.members["executionRoleArn"] - ) - - case 3: - kwargs["customer_encryption_key_arn"] = de.read_string( - _SCHEMA_UPDATE_FLOW_OUTPUT.members["customerEncryptionKeyArn"] - ) - - case 4: - kwargs["id"] = de.read_string( - _SCHEMA_UPDATE_FLOW_OUTPUT.members["id"] - ) - - case 5: - kwargs["arn"] = de.read_string( - _SCHEMA_UPDATE_FLOW_OUTPUT.members["arn"] - ) - - case 6: - kwargs["status"] = FlowStatus( - de.read_string(_SCHEMA_UPDATE_FLOW_OUTPUT.members["status"]) - ) - - case 7: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_UPDATE_FLOW_OUTPUT.members["createdAt"] - ) - - case 8: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_UPDATE_FLOW_OUTPUT.members["updatedAt"] - ) - - case 9: - kwargs["version"] = de.read_string( - _SCHEMA_UPDATE_FLOW_OUTPUT.members["version"] - ) - - case 10: - kwargs["definition"] = FlowDefinition.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_FLOW_OUTPUT, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "execution_role_arn" not in kwargs: - kwargs["execution_role_arn"] = "" - if "id" not in kwargs: - kwargs["id"] = "" - if "arn" not in kwargs: - kwargs["arn"] = "" - if "status" not in kwargs: - kwargs["status"] = FlowStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "version" not in kwargs: - kwargs["version"] = "" - return kwargs - - -@dataclass(kw_only=True) -class ValidateFlowDefinitionInput: - """Dataclass for ValidateFlowDefinitionInput structure.""" - - definition: "FlowDefinition | None" = field(repr=False, default=None) - """The definition of a flow to validate.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VALIDATE_FLOW_DEFINITION_INPUT, self) +) + +DELETE_AGENT_ALIAS: APIOperation[DeleteAgentAliasInput, DeleteAgentAliasOutput] = ( + APIOperation( + static_schema=_SCHEMA_DELETE_AGENT_ALIAS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +GET_AGENT_ALIAS: APIOperation[GetAgentAliasInput, GetAgentAliasOutput] = APIOperation( + static_schema=_SCHEMA_GET_AGENT_ALIAS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +LIST_AGENT_ALIASES: APIOperation[ListAgentAliasesInput, ListAgentAliasesOutput] = ( + APIOperation( + static_schema=_SCHEMA_LIST_AGENT_ALIASES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +UPDATE_AGENT_ALIAS: APIOperation[UpdateAgentAliasInput, UpdateAgentAliasOutput] = ( + APIOperation( + static_schema=_SCHEMA_UPDATE_AGENT_ALIAS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#ConflictException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +CREATE_VPC_CONFIGURATION: APIOperation[ + CreateVpcConfigurationInput, CreateVpcConfigurationOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_VPC_CONFIGURATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#ConflictException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +CREATE_DATA_SOURCE: APIOperation[CreateDataSourceInput, CreateDataSourceOutput] = ( + APIOperation( + static_schema=_SCHEMA_CREATE_DATA_SOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#ConflictException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +DELETE_DATA_SOURCE: APIOperation[DeleteDataSourceInput, DeleteDataSourceOutput] = ( + APIOperation( + static_schema=_SCHEMA_DELETE_DATA_SOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#ConflictException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +GET_DATA_SOURCE: APIOperation[GetDataSourceInput, GetDataSourceOutput] = APIOperation( + static_schema=_SCHEMA_GET_DATA_SOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +LIST_DATA_SOURCES: APIOperation[ListDataSourcesInput, ListDataSourcesOutput] = ( + APIOperation( + static_schema=_SCHEMA_LIST_DATA_SOURCES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +UPDATE_DATA_SOURCE: APIOperation[UpdateDataSourceInput, UpdateDataSourceOutput] = ( + APIOperation( + static_schema=_SCHEMA_UPDATE_DATA_SOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#ConflictException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +DELETE_RESOURCE_POLICY: APIOperation[ + DeleteResourcePolicyInput, DeleteResourcePolicyOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_RESOURCE_POLICY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#ConflictException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +DELETE_VPC_CONFIGURATION: APIOperation[ + DeleteVpcConfigurationInput, DeleteVpcConfigurationOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_VPC_CONFIGURATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#ConflictException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +DELETE_FLOW: APIOperation[DeleteFlowInput, DeleteFlowOutput] = APIOperation( + static_schema=_SCHEMA_DELETE_FLOW, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#ConflictException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +CREATE_FLOW_ALIAS: APIOperation[CreateFlowAliasInput, CreateFlowAliasOutput] = ( + APIOperation( + static_schema=_SCHEMA_CREATE_FLOW_ALIAS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#ConflictException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +DELETE_FLOW_ALIAS: APIOperation[DeleteFlowAliasInput, DeleteFlowAliasOutput] = ( + APIOperation( + static_schema=_SCHEMA_DELETE_FLOW_ALIAS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#ConflictException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +GET_FLOW_ALIAS: APIOperation[GetFlowAliasInput, GetFlowAliasOutput] = APIOperation( + static_schema=_SCHEMA_GET_FLOW_ALIAS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +LIST_FLOW_ALIASES: APIOperation[ListFlowAliasesInput, ListFlowAliasesOutput] = ( + APIOperation( + static_schema=_SCHEMA_LIST_FLOW_ALIASES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +UPDATE_FLOW_ALIAS: APIOperation[UpdateFlowAliasInput, UpdateFlowAliasOutput] = ( + APIOperation( + static_schema=_SCHEMA_UPDATE_FLOW_ALIAS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#ConflictException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +DELETE_FLOW_VERSION: APIOperation[DeleteFlowVersionInput, DeleteFlowVersionOutput] = ( + APIOperation( + static_schema=_SCHEMA_DELETE_FLOW_VERSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#ConflictException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +LIST_FLOW_VERSIONS: APIOperation[ListFlowVersionsInput, ListFlowVersionsOutput] = ( + APIOperation( + static_schema=_SCHEMA_LIST_FLOW_VERSIONS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +LIST_FLOWS: APIOperation[ListFlowsInput, ListFlowsOutput] = APIOperation( + static_schema=_SCHEMA_LIST_FLOWS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +PREPARE_FLOW: APIOperation[PrepareFlowInput, PrepareFlowOutput] = APIOperation( + static_schema=_SCHEMA_PREPARE_FLOW, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#ConflictException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +GET_RESOURCE_POLICY: APIOperation[GetResourcePolicyInput, GetResourcePolicyOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_RESOURCE_POLICY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +GET_VPC_CONFIGURATION: APIOperation[ + GetVpcConfigurationInput, GetVpcConfigurationOutput +] = APIOperation( + static_schema=_SCHEMA_GET_VPC_CONFIGURATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +GET_INGESTION_JOB: APIOperation[GetIngestionJobInput, GetIngestionJobOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_INGESTION_JOB, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +LIST_INGESTION_JOBS: APIOperation[ListIngestionJobsInput, ListIngestionJobsOutput] = ( + APIOperation( + static_schema=_SCHEMA_LIST_INGESTION_JOBS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +START_INGESTION_JOB: APIOperation[StartIngestionJobInput, StartIngestionJobOutput] = ( + APIOperation( + static_schema=_SCHEMA_START_INGESTION_JOB, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#ConflictException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +STOP_INGESTION_JOB: APIOperation[StopIngestionJobInput, StopIngestionJobOutput] = ( + APIOperation( + static_schema=_SCHEMA_STOP_INGESTION_JOB, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#ConflictException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +DELETE_KNOWLEDGE_BASE_DOCUMENTS: APIOperation[ + DeleteKnowledgeBaseDocumentsInput, DeleteKnowledgeBaseDocumentsOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_KNOWLEDGE_BASE_DOCUMENTS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +GET_KNOWLEDGE_BASE_DOCUMENTS: APIOperation[ + GetKnowledgeBaseDocumentsInput, GetKnowledgeBaseDocumentsOutput +] = APIOperation( + static_schema=_SCHEMA_GET_KNOWLEDGE_BASE_DOCUMENTS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +INGEST_KNOWLEDGE_BASE_DOCUMENTS: APIOperation[ + IngestKnowledgeBaseDocumentsInput, IngestKnowledgeBaseDocumentsOutput +] = APIOperation( + static_schema=_SCHEMA_INGEST_KNOWLEDGE_BASE_DOCUMENTS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +LIST_KNOWLEDGE_BASE_DOCUMENTS: APIOperation[ + ListKnowledgeBaseDocumentsInput, ListKnowledgeBaseDocumentsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_KNOWLEDGE_BASE_DOCUMENTS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +ASSOCIATE_AGENT_KNOWLEDGE_BASE: APIOperation[ + AssociateAgentKnowledgeBaseInput, AssociateAgentKnowledgeBaseOutput +] = APIOperation( + static_schema=_SCHEMA_ASSOCIATE_AGENT_KNOWLEDGE_BASE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#ConflictException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +CREATE_KNOWLEDGE_BASE: APIOperation[ + CreateKnowledgeBaseInput, CreateKnowledgeBaseOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_KNOWLEDGE_BASE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#ConflictException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize_members(self, serializer: ShapeSerializer): - if self.definition is not None: - serializer.write_struct( - _SCHEMA_VALIDATE_FLOW_DEFINITION_INPUT.members["definition"], - self.definition, - ) +DELETE_KNOWLEDGE_BASE: APIOperation[ + DeleteKnowledgeBaseInput, DeleteKnowledgeBaseOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_KNOWLEDGE_BASE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#ConflictException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) +DISASSOCIATE_AGENT_KNOWLEDGE_BASE: APIOperation[ + DisassociateAgentKnowledgeBaseInput, DisassociateAgentKnowledgeBaseOutput +] = APIOperation( + static_schema=_SCHEMA_DISASSOCIATE_AGENT_KNOWLEDGE_BASE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#ConflictException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +GET_AGENT_KNOWLEDGE_BASE: APIOperation[ + GetAgentKnowledgeBaseInput, GetAgentKnowledgeBaseOutput +] = APIOperation( + static_schema=_SCHEMA_GET_AGENT_KNOWLEDGE_BASE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["definition"] = FlowDefinition.deserialize(de) +GET_KNOWLEDGE_BASE: APIOperation[GetKnowledgeBaseInput, GetKnowledgeBaseOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_KNOWLEDGE_BASE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - case _: - logger.debug("Unexpected member schema: %s", schema) +LIST_AGENT_KNOWLEDGE_BASES: APIOperation[ + ListAgentKnowledgeBasesInput, ListAgentKnowledgeBasesOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_AGENT_KNOWLEDGE_BASES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - deserializer.read_struct( - _SCHEMA_VALIDATE_FLOW_DEFINITION_INPUT, consumer=_consumer - ) - return kwargs +LIST_KNOWLEDGE_BASES: APIOperation[ + ListKnowledgeBasesInput, ListKnowledgeBasesOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_KNOWLEDGE_BASES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +UPDATE_AGENT_KNOWLEDGE_BASE: APIOperation[ + UpdateAgentKnowledgeBaseInput, UpdateAgentKnowledgeBaseOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_AGENT_KNOWLEDGE_BASE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#ConflictException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -CREATE_FLOW_VERSION = APIOperation( - input=CreateFlowVersionInput, - output=CreateFlowVersionOutput, - schema=_SCHEMA_CREATE_FLOW_VERSION, - input_schema=_SCHEMA_CREATE_FLOW_VERSION_INPUT, - output_schema=_SCHEMA_CREATE_FLOW_VERSION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrockagent#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), +UPDATE_KNOWLEDGE_BASE: APIOperation[ + UpdateKnowledgeBaseInput, UpdateKnowledgeBaseOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_KNOWLEDGE_BASE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#ConflictException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, +) + +LIST_VPC_CONFIGURATIONS: APIOperation[ + ListVpcConfigurationsInput, ListVpcConfigurationsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_VPC_CONFIGURATIONS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) -GET_FLOW = APIOperation( - input=GetFlowInput, - output=GetFlowOutput, - schema=_SCHEMA_GET_FLOW, - input_schema=_SCHEMA_GET_FLOW_INPUT, - output_schema=_SCHEMA_GET_FLOW_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), +CREATE_PROMPT: APIOperation[CreatePromptInput, CreatePromptOutput] = APIOperation( + static_schema=_SCHEMA_CREATE_PROMPT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#ConflictException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, +) + +CREATE_PROMPT_VERSION: APIOperation[ + CreatePromptVersionInput, CreatePromptVersionOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_PROMPT_VERSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#ConflictException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) -GET_FLOW_VERSION = APIOperation( - input=GetFlowVersionInput, - output=GetFlowVersionOutput, - schema=_SCHEMA_GET_FLOW_VERSION, - input_schema=_SCHEMA_GET_FLOW_VERSION_INPUT, - output_schema=_SCHEMA_GET_FLOW_VERSION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), +DELETE_PROMPT: APIOperation[DeletePromptInput, DeletePromptOutput] = APIOperation( + static_schema=_SCHEMA_DELETE_PROMPT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#ConflictException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, +) + +GET_PROMPT: APIOperation[GetPromptInput, GetPromptOutput] = APIOperation( + static_schema=_SCHEMA_GET_PROMPT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) -VALIDATE_FLOW_DEFINITION = APIOperation( - input=ValidateFlowDefinitionInput, - output=ValidateFlowDefinitionOutput, - schema=_SCHEMA_VALIDATE_FLOW_DEFINITION, - input_schema=_SCHEMA_VALIDATE_FLOW_DEFINITION_INPUT, - output_schema=_SCHEMA_VALIDATE_FLOW_DEFINITION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), +LIST_PROMPTS: APIOperation[ListPromptsInput, ListPromptsOutput] = APIOperation( + static_schema=_SCHEMA_LIST_PROMPTS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, +) + +UPDATE_PROMPT: APIOperation[UpdatePromptInput, UpdatePromptOutput] = APIOperation( + static_schema=_SCHEMA_UPDATE_PROMPT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#ConflictException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) -CREATE_FLOW = APIOperation( - input=CreateFlowInput, - output=CreateFlowOutput, - schema=_SCHEMA_CREATE_FLOW, - input_schema=_SCHEMA_CREATE_FLOW_INPUT, - output_schema=_SCHEMA_CREATE_FLOW_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrockagent#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), +PUT_RESOURCE_POLICY: APIOperation[PutResourcePolicyInput, PutResourcePolicyOutput] = ( + APIOperation( + static_schema=_SCHEMA_PUT_RESOURCE_POLICY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#ConflictException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +LIST_TAGS_FOR_RESOURCE: APIOperation[ + ListTagsForResourceInput, ListTagsForResourceOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_TAGS_FOR_RESOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +TAG_RESOURCE: APIOperation[TagResourceInput, TagResourceOutput] = APIOperation( + static_schema=_SCHEMA_TAG_RESOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, +) + +UNTAG_RESOURCE: APIOperation[UntagResourceInput, UntagResourceOutput] = APIOperation( + static_schema=_SCHEMA_UNTAG_RESOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +DELETE_AGENT_VERSION: APIOperation[ + DeleteAgentVersionInput, DeleteAgentVersionOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_AGENT_VERSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#ConflictException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +GET_AGENT_VERSION: APIOperation[GetAgentVersionInput, GetAgentVersionOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_AGENT_VERSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +LIST_AGENT_VERSIONS: APIOperation[ListAgentVersionsInput, ListAgentVersionsOutput] = ( + APIOperation( + static_schema=_SCHEMA_LIST_AGENT_VERSIONS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +CREATE_FLOW_VERSION: APIOperation[CreateFlowVersionInput, CreateFlowVersionOutput] = ( + APIOperation( + static_schema=_SCHEMA_CREATE_FLOW_VERSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#ConflictException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) ) -UPDATE_FLOW = APIOperation( - input=UpdateFlowInput, - output=UpdateFlowOutput, - schema=_SCHEMA_UPDATE_FLOW, - input_schema=_SCHEMA_UPDATE_FLOW_INPUT, - output_schema=_SCHEMA_UPDATE_FLOW_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagent#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrockagent#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrockagent#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagent#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagent#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagent#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagent#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, +GET_FLOW: APIOperation[GetFlowInput, GetFlowOutput] = APIOperation( + static_schema=_SCHEMA_GET_FLOW, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +GET_FLOW_VERSION: APIOperation[GetFlowVersionInput, GetFlowVersionOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_FLOW_VERSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +VALIDATE_FLOW_DEFINITION: APIOperation[ + ValidateFlowDefinitionInput, ValidateFlowDefinitionOutput +] = APIOperation( + static_schema=_SCHEMA_VALIDATE_FLOW_DEFINITION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +CREATE_FLOW: APIOperation[CreateFlowInput, CreateFlowOutput] = APIOperation( + static_schema=_SCHEMA_CREATE_FLOW, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#ConflictException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +UPDATE_FLOW: APIOperation[UpdateFlowInput, UpdateFlowOutput] = APIOperation( + static_schema=_SCHEMA_UPDATE_FLOW, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagent#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagent#ConflictException"), + ShapeID("com.amazonaws.bedrockagent#InternalServerException"), + ShapeID("com.amazonaws.bedrockagent#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagent#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagent#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagent#ValidationException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) diff --git a/clients/aws-sdk-bedrock-agent/src/aws_sdk_bedrock_agent/models.pyi b/clients/aws-sdk-bedrock-agent/src/aws_sdk_bedrock_agent/models.pyi new file mode 100644 index 00000000..185ebc6c --- /dev/null +++ b/clients/aws-sdk-bedrock-agent/src/aws_sdk_bedrock_agent/models.pyi @@ -0,0 +1,9885 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. + +from dataclasses import dataclass +from datetime import datetime +from enum import StrEnum +from typing import Self, Union + +from smithy_core.deserializers import ShapeDeserializer +from smithy_core.documents import Document +from smithy_core.exceptions import ModeledError +from smithy_core.response import ResponseMetadata +from smithy_core.schemas import APIOperation +from smithy_core.serializers import ShapeSerializer +from smithy_core.types import JsonString, UnknownEnumMixin + +class _SerdeShape: + def serialize(self, serializer: ShapeSerializer) -> None: ... + def serialize_members(self, serializer: ShapeSerializer) -> None: ... + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: ... + +class ServiceError(ModeledError): + """ + Base error for all errors in the service. + + Some exceptions do not extend from this class, including + synthetic, implicit, and shared exception types. + """ + +class AccessControlAccess(UnknownEnumMixin, StrEnum): + """The access level for an access control entry.""" + + ALLOW = "ALLOW" + DENY = "DENY" + +class AccessControlPrincipalType(UnknownEnumMixin, StrEnum): + """The type of principal in an access control entry.""" + + USER = "USER" + +@dataclass(kw_only=True) +class AccessDeniedException(ServiceError, _SerdeShape): + """The request is denied because of missing access permissions.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass +class ActionGroupExecutorLambda(_SerdeShape): + """ + The Amazon Resource Name (ARN) of the Lambda function containing the + business logic that is carried out upon invoking the action. + """ + + value: str + +@dataclass +class ActionGroupExecutorCustomControl(_SerdeShape): + """ + To return the action group invocation results directly in the + `InvokeAgent` response, specify `RETURN_CONTROL`. + """ + + value: str + +@dataclass +class ActionGroupExecutorUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ActionGroupExecutor = Union[ + ActionGroupExecutorLambda + | ActionGroupExecutorCustomControl + | ActionGroupExecutorUnknown +] +""" +Contains details about the Lambda function containing the business logic +that is carried out upon invoking the action or the custom control +method for handling the information elicited from the user. +""" + +class _ActionGroupExecutorDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> ActionGroupExecutor: ... + +class ActionGroupSignature(UnknownEnumMixin, StrEnum): + AMAZON_USERINPUT = "AMAZON.UserInput" + AMAZON_CODEINTERPRETER = "AMAZON.CodeInterpreter" + ANTHROPIC_COMPUTER = "ANTHROPIC.Computer" + ANTHROPIC_BASH = "ANTHROPIC.Bash" + ANTHROPIC_TEXTEDITOR = "ANTHROPIC.TextEditor" + +class ActionGroupState(UnknownEnumMixin, StrEnum): + ENABLED = "ENABLED" + DISABLED = "DISABLED" + +@dataclass(kw_only=True) +class ActionGroupSummary(_SerdeShape): + """Contains details about an action group.""" + + action_group_id: str + """The unique identifier of the action group.""" + action_group_name: str + """The name of the action group.""" + action_group_state: str + """ + Specifies whether the action group is available for the agent to invoke + or not when sending an + [InvokeAgent](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html) + request. + """ + description: str | None = ... + """The description of the action group.""" + updated_at: datetime + """The time at which the action group was last updated.""" + +@dataclass(kw_only=True) +class Agent(_SerdeShape): + """Contains details about an agent.""" + + agent_id: str + """The unique identifier of the agent.""" + agent_name: str + """The name of the agent.""" + agent_arn: str + """The Amazon Resource Name (ARN) of the agent.""" + agent_version: str + """The version of the agent.""" + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If this token matches a previous + request, Amazon Bedrock ignores the request, but does not return an + error. For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + instruction: str | None = ... + """ + Instructions that tell the agent what it should do and how it should + interact with users. + """ + agent_status: str + """ + The status of the agent and whether it is ready for use. The following + statuses are possible: + + - CREATING -- The agent is being created. + + - PREPARING -- The agent is being prepared. + + - PREPARED -- The agent is prepared and ready to be invoked. + + - NOT_PREPARED -- The agent has been created but not yet prepared. + + - FAILED -- The agent API operation failed. + + - UPDATING -- The agent is being updated. + + - DELETING -- The agent is being deleted. + """ + foundation_model: str | None = ... + """The foundation model used for orchestration by the agent.""" + description: str | None = ... + """The description of the agent.""" + orchestration_type: str | None = ... + """Specifies the orchestration strategy for the agent.""" + custom_orchestration: CustomOrchestration | None = ... + """Contains custom orchestration configurations for the agent.""" + idle_session_ttl_in_seconds: int + """ + The number of seconds for which Amazon Bedrock keeps information about a + user's conversation with the agent. + + A user interaction remains active for the amount of time specified. If + no conversation occurs during this time, the session expires and Amazon + Bedrock deletes any data provided before the timeout. + """ + agent_resource_role_arn: str + """ + The Amazon Resource Name (ARN) of the IAM role with permissions to + invoke API operations on the agent. + """ + customer_encryption_key_arn: str | None = ... + """The Amazon Resource Name (ARN) of the KMS key that encrypts the agent.""" + created_at: datetime + """The time at which the agent was created.""" + updated_at: datetime + """The time at which the agent was last updated.""" + prepared_at: datetime | None = ... + """The time at which the agent was last prepared.""" + failure_reasons: list[str] | None = ... + """Contains reasons that the agent-related API that you invoked failed.""" + recommended_actions: list[str] | None = ... + """ + Contains recommended actions to take for the agent-related API that you + invoked to succeed. + """ + prompt_override_configuration: PromptOverrideConfiguration | None = ... + """ + Contains configurations to override prompt templates in different parts + of an agent sequence. For more information, see [Advanced + prompts](https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts.html). + """ + guardrail_configuration: GuardrailConfiguration | None = ... + """Details about the guardrail associated with the agent.""" + memory_configuration: MemoryConfiguration | None = ... + """Contains memory configuration for the agent.""" + agent_collaboration: str | None = ... + """The agent's collaboration settings.""" + +@dataclass(kw_only=True) +class AgentActionGroup(_SerdeShape): + """Contains details about an action group.""" + + agent_id: str + """The unique identifier of the agent to which the action group belongs.""" + agent_version: str + """The version of the agent to which the action group belongs.""" + action_group_id: str + """The unique identifier of the action group.""" + action_group_name: str + """The name of the action group.""" + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If this token matches a previous + request, Amazon Bedrock ignores the request, but does not return an + error. For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + description: str | None = ... + """The description of the action group.""" + created_at: datetime + """The time at which the action group was created.""" + updated_at: datetime + """The time at which the action group was last updated.""" + parent_action_signature: str | None = ... + """ + If this field is set as `AMAZON.UserInput`, the agent can request the + user for additional information when trying to complete a task. The + `description`, `apiSchema`, and `actionGroupExecutor` fields must be + blank for this action group. + + During orchestration, if the agent determines that it needs to invoke an + API in an action group, but doesn't have enough information to complete + the API request, it will invoke this action group instead and return an + [Observation](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Observation.html) + reprompting the user for more information. + """ + parent_action_group_signature_params: dict[str, str] | None = ... + """ + The configuration settings for a computer use action. + + Warning: + Computer use is a new Anthropic Claude model capability (in beta) + available with Claude 3.7 Sonnet and Claude 3.5 Sonnet v2 only. For more + information, see [Configure an Amazon Bedrock Agent to complete tasks + with computer use + tools](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-computer-use.html). + """ + action_group_executor: ActionGroupExecutor | None = ... + """ + The Amazon Resource Name (ARN) of the Lambda function containing the + business logic that is carried out upon invoking the action or the + custom control method for handling the information elicited from the + user. + """ + api_schema: APISchema | None = ... + """ + Contains either details about the S3 object containing the OpenAPI + schema for the action group or the JSON or YAML-formatted payload + defining the schema. For more information, see [Action group OpenAPI + schemas](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-api-schema.html). + """ + function_schema: FunctionSchema | None = ... + """ + Defines functions that each define parameters that the agent needs to + invoke from the user. Each function represents an action in an action + group. + """ + action_group_state: str + """ + Specifies whether the action group is available for the agent to invoke + or not when sending an + [InvokeAgent](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html) + request. + """ + +@dataclass(kw_only=True) +class AgentAlias(_SerdeShape): + """Contains details about an alias of an agent.""" + + agent_id: str + """The unique identifier of the agent.""" + agent_alias_id: str + """The unique identifier of the alias of the agent.""" + agent_alias_name: str + """The name of the alias of the agent.""" + agent_alias_arn: str + """The Amazon Resource Name (ARN) of the alias of the agent.""" + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If this token matches a previous + request, Amazon Bedrock ignores the request, but does not return an + error. For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + description: str | None = ... + """The description of the alias of the agent.""" + routing_configuration: list[AgentAliasRoutingConfigurationListItem] + """Contains details about the routing configuration of the alias.""" + created_at: datetime + """The time at which the alias of the agent was created.""" + updated_at: datetime + """The time at which the alias was last updated.""" + agent_alias_history_events: list[AgentAliasHistoryEvent] | None = ... + """Contains details about the history of the alias.""" + agent_alias_status: str + """ + The status of the alias of the agent and whether it is ready for use. + The following statuses are possible: + + - CREATING -- The agent alias is being created. + + - PREPARED -- The agent alias is finished being created or updated and + is ready to be invoked. + + - FAILED -- The agent alias API operation failed. + + - UPDATING -- The agent alias is being updated. + + - DELETING -- The agent alias is being deleted. + + - DISSOCIATED - The agent alias has no version associated with it. + """ + failure_reasons: list[str] | None = ... + """ + Information on the failure of Provisioned Throughput assigned to an + agent alias. + """ + alias_invocation_state: str | None = ... + """ + The invocation state for the agent alias. If the agent alias is running, + the value is `ACCEPT_INVOCATIONS`. If the agent alias is paused, the + value is `REJECT_INVOCATIONS`. Use the `UpdateAgentAlias` operation to + change the invocation state. + """ + +@dataclass(kw_only=True) +class AgentAliasHistoryEvent(_SerdeShape): + """Contains details about the history of the alias.""" + + routing_configuration: list[AgentAliasRoutingConfigurationListItem] | None = ... + """ + Contains details about the version of the agent with which the alias is + associated. + """ + end_date: datetime | None = ... + """ + The date that the alias stopped being associated to the version in the + `routingConfiguration` object + """ + start_date: datetime | None = ... + """ + The date that the alias began being associated to the version in the + `routingConfiguration` object. + """ + +@dataclass(kw_only=True) +class AgentAliasRoutingConfigurationListItem(_SerdeShape): + """Contains details about the routing configuration of the alias.""" + + agent_version: str | None = ... + """The version of the agent with which the alias is associated.""" + provisioned_throughput: str | None = ... + """Information on the Provisioned Throughput assigned to an agent alias.""" + +class AgentAliasStatus(UnknownEnumMixin, StrEnum): + CREATING = "CREATING" + PREPARED = "PREPARED" + FAILED = "FAILED" + UPDATING = "UPDATING" + DELETING = "DELETING" + DISSOCIATED = "DISSOCIATED" + +@dataclass(kw_only=True) +class AgentAliasSummary(_SerdeShape): + """Contains details about an alias of an agent.""" + + agent_alias_id: str + """Contains details about""" + agent_alias_name: str + """The name of the alias.""" + description: str | None = ... + """The description of the alias.""" + routing_configuration: list[AgentAliasRoutingConfigurationListItem] | None = ... + """ + Contains details about the version of the agent with which the alias is + associated. + """ + agent_alias_status: str + """The status of the alias.""" + created_at: datetime + """The time at which the alias of the agent was created.""" + updated_at: datetime + """The time at which the alias was last updated.""" + alias_invocation_state: str | None = ... + """ + The invocation state for the agent alias. If the agent alias is running, + the value is `ACCEPT_INVOCATIONS`. If the agent alias is paused, the + value is `REJECT_INVOCATIONS`. Use the `UpdateAgentAlias` operation to + change the invocation state. + """ + +class AgentCollaboration(UnknownEnumMixin, StrEnum): + SUPERVISOR = "SUPERVISOR" + SUPERVISOR_ROUTER = "SUPERVISOR_ROUTER" + DISABLED = "DISABLED" + +@dataclass(kw_only=True) +class AgentCollaborator(_SerdeShape): + """An agent collaborator.""" + + agent_id: str + """The collaborator's agent ID.""" + agent_version: str + """The collaborator's agent version.""" + agent_descriptor: AgentDescriptor + """The collaborator's agent descriptor.""" + collaborator_id: str + """The collaborator's collaborator ID.""" + collaboration_instruction: str + """The collaborator's instructions.""" + collaborator_name: str + """The collaborator's collaborator name.""" + created_at: datetime + """When the collaborator was created.""" + last_updated_at: datetime + """When the collaborator was updated.""" + relay_conversation_history: str | None = ... + """The collaborator's relay conversation history.""" + client_token: str | None = ... + """The collaborator's client token.""" + +@dataclass(kw_only=True) +class AgentCollaboratorSummary(_SerdeShape): + """An agent collaborator summary.""" + + agent_id: str + """The collaborator's agent ID.""" + agent_version: str + """The collaborator's agent version.""" + collaborator_id: str + """The collaborator's ID.""" + agent_descriptor: AgentDescriptor + """The collaborator's agent descriptor.""" + collaboration_instruction: str + """The collaborator's collaboration instruction.""" + relay_conversation_history: str + """The collaborator's relay conversation history.""" + collaborator_name: str + """The collaborator's name.""" + created_at: datetime + """When the collaborator was created.""" + last_updated_at: datetime + """When the collaborator was last updated.""" + +@dataclass(kw_only=True) +class AgentDescriptor(_SerdeShape): + """An agent descriptor.""" + + alias_arn: str | None = ... + """The agent's alias ARN.""" + +@dataclass(kw_only=True) +class AgentFlowNodeConfiguration(_SerdeShape): + """ + Defines an agent node in your flow. You specify the agent to invoke at + this point in the flow. For more information, see [Node types in a + flow](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-nodes.html) + in the Amazon Bedrock User Guide. + """ + + agent_alias_arn: str = ... + """The Amazon Resource Name (ARN) of the alias of the agent to invoke.""" + +@dataclass(kw_only=True) +class AgentKnowledgeBase(_SerdeShape): + """ + Contains details about a knowledge base that is associated with an + agent. + """ + + agent_id: str + """ + The unique identifier of the agent with which the knowledge base is + associated. + """ + agent_version: str + """The version of the agent with which the knowledge base is associated.""" + knowledge_base_id: str + """ + The unique identifier of the association between the agent and the + knowledge base. + """ + description: str + """ + The description of the association between the agent and the knowledge + base. + """ + created_at: datetime + """ + The time at which the association between the agent and the knowledge + base was created. + """ + updated_at: datetime + """ + The time at which the association between the agent and the knowledge + base was last updated. + """ + knowledge_base_state: str + """ + Specifies whether to use the knowledge base or not when sending an + [InvokeAgent](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html) + request. + """ + +@dataclass(kw_only=True) +class AgentKnowledgeBaseSummary(_SerdeShape): + """Contains details about a knowledge base associated with an agent.""" + + knowledge_base_id: str + """The unique identifier of the knowledge base associated with an agent.""" + description: str | None = ... + """The description of the knowledge base associated with an agent.""" + knowledge_base_state: str + """ + Specifies whether the agent uses the knowledge base or not when sending + an + [InvokeAgent](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html) + request. + """ + updated_at: datetime + """ + The time at which the knowledge base associated with an agent was last + updated. + """ + +class AgentStatus(UnknownEnumMixin, StrEnum): + CREATING = "CREATING" + PREPARING = "PREPARING" + PREPARED = "PREPARED" + NOT_PREPARED = "NOT_PREPARED" + DELETING = "DELETING" + FAILED = "FAILED" + VERSIONING = "VERSIONING" + UPDATING = "UPDATING" + +@dataclass(kw_only=True) +class AgentSummary(_SerdeShape): + """Contains details about an agent.""" + + agent_id: str + """The unique identifier of the agent.""" + agent_name: str + """The name of the agent.""" + agent_status: str + """The status of the agent.""" + description: str | None = ... + """The description of the agent.""" + updated_at: datetime + """The time at which the agent was last updated.""" + latest_agent_version: str | None = ... + """The latest version of the agent.""" + guardrail_configuration: GuardrailConfiguration | None = ... + """Details about the guardrail associated with the agent.""" + +@dataclass(kw_only=True) +class AgentVersion(_SerdeShape): + """Contains details about a version of an agent.""" + + agent_id: str + """The unique identifier of the agent that the version belongs to.""" + agent_name: str + """The name of the agent that the version belongs to.""" + agent_arn: str + """The Amazon Resource Name (ARN) of the agent that the version belongs to.""" + version: str + """The version number.""" + instruction: str | None = ... + """The instructions provided to the agent.""" + agent_status: str + """The status of the agent that the version belongs to.""" + foundation_model: str | None = ... + """The foundation model that the version invokes.""" + description: str | None = ... + """The description of the version.""" + idle_session_ttl_in_seconds: int + """ + The number of seconds for which Amazon Bedrock keeps information about a + user's conversation with the agent. + + A user interaction remains active for the amount of time specified. If + no conversation occurs during this time, the session expires and Amazon + Bedrock deletes any data provided before the timeout. + """ + agent_resource_role_arn: str + """ + The Amazon Resource Name (ARN) of the IAM role with permissions to + invoke API operations on the agent. + """ + customer_encryption_key_arn: str | None = ... + """The Amazon Resource Name (ARN) of the KMS key that encrypts the agent.""" + created_at: datetime + """The time at which the version was created.""" + updated_at: datetime + """The time at which the version was last updated.""" + failure_reasons: list[str] | None = ... + """A list of reasons that the API operation on the version failed.""" + recommended_actions: list[str] | None = ... + """ + A list of recommended actions to take for the failed API operation on + the version to succeed. + """ + prompt_override_configuration: PromptOverrideConfiguration | None = ... + """ + Contains configurations to override prompt templates in different parts + of an agent sequence. For more information, see [Advanced + prompts](https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts.html). + """ + guardrail_configuration: GuardrailConfiguration | None = ... + """Details about the guardrail associated with the agent.""" + memory_configuration: MemoryConfiguration | None = ... + """ + Contains details of the memory configuration on the version of the + agent. + """ + agent_collaboration: str | None = ... + """The agent's collaboration settings.""" + +@dataclass(kw_only=True) +class AgentVersionSummary(_SerdeShape): + """Contains details about a version of an agent.""" + + agent_name: str + """The name of the agent to which the version belongs.""" + agent_status: str + """The status of the agent to which the version belongs.""" + agent_version: str + """The version of the agent.""" + created_at: datetime + """The time at which the version was created.""" + updated_at: datetime + """The time at which the version was last updated.""" + description: str | None = ... + """The description of the version of the agent.""" + guardrail_configuration: GuardrailConfiguration | None = ... + """Details about the guardrail associated with the agent.""" + +class AliasInvocationState(UnknownEnumMixin, StrEnum): + """Enum representing the invocation state of an agent alias""" + + ACCEPT_INVOCATIONS = "ACCEPT_INVOCATIONS" + """Agent is actively processing requests""" + REJECT_INVOCATIONS = "REJECT_INVOCATIONS" + """Agent is paused and will not accept new requests""" + +@dataclass(kw_only=True) +class AnyToolChoice(_SerdeShape): + """ + Defines tools, at least one of which must be requested by the model. No + text is generated but the results of tool use are sent back to the model + to help generate a response. For more information, see [Use a tool to + complete an Amazon Bedrock model + response](https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html). + """ + +@dataclass +class APISchemaS3(_SerdeShape): + """ + Contains details about the S3 object containing the OpenAPI schema for + the action group. For more information, see [Action group OpenAPI + schemas](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-api-schema.html). + """ + + value: S3Identifier + +@dataclass +class APISchemaPayload(_SerdeShape): + """ + The JSON or YAML-formatted payload defining the OpenAPI schema for the + action group. For more information, see [Action group OpenAPI + schemas](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-api-schema.html). + """ + + value: str + +@dataclass +class APISchemaUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +APISchema = Union[APISchemaS3 | APISchemaPayload | APISchemaUnknown] +""" +Contains details about the OpenAPI schema for the action group. For more +information, see [Action group OpenAPI +schemas](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-api-schema.html). +You can either include the schema directly in the `payload` field or you +can upload it to an S3 bucket and specify the S3 bucket location in the +`s3` field. +""" + +class _APISchemaDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> APISchema: ... + +@dataclass(kw_only=True) +class AssociateAgentCollaboratorInput(_SerdeShape): + """Dataclass for AssociateAgentCollaboratorInput structure.""" + + agent_id: str | None = ... + """The agent's ID.""" + agent_version: str | None = ... + """An agent version.""" + agent_descriptor: AgentDescriptor | None = ... + """The alias of the collaborator agent.""" + collaborator_name: str | None = ... + """A name for the collaborator.""" + collaboration_instruction: str | None = ... + """Instruction for the collaborator.""" + relay_conversation_history: str | None = ... + """A relay conversation history for the collaborator.""" + client_token: str | None = ... + """A client token.""" + +@dataclass(kw_only=True) +class AssociateAgentCollaboratorOutput(_SerdeShape): + """Dataclass for AssociateAgentCollaboratorOutput structure.""" + + agent_collaborator: AgentCollaborator + """Details about the collaborator.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class AssociateAgentKnowledgeBaseInput(_SerdeShape): + """Dataclass for AssociateAgentKnowledgeBaseInput structure.""" + + agent_id: str | None = ... + """ + The unique identifier of the agent with which you want to associate the + knowledge base. + """ + agent_version: str | None = ... + """ + The version of the agent with which you want to associate the knowledge + base. + """ + knowledge_base_id: str | None = ... + """The unique identifier of the knowledge base to associate with the agent.""" + description: str | None = ... + """A description of what the agent should use the knowledge base for.""" + knowledge_base_state: str | None = ... + """ + Specifies whether to use the knowledge base or not when sending an + [InvokeAgent](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html) + request. + """ + +@dataclass(kw_only=True) +class AssociateAgentKnowledgeBaseOutput(_SerdeShape): + """Dataclass for AssociateAgentKnowledgeBaseOutput structure.""" + + agent_knowledge_base: AgentKnowledgeBase + """ + Contains details about the knowledge base that has been associated with + the agent. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class AudioConfiguration(_SerdeShape): + """ + Configuration settings for processing audio content in multimodal + knowledge bases. + """ + + segmentation_configuration: AudioSegmentationConfiguration + """Configuration for segmenting audio content during processing.""" + +@dataclass(kw_only=True) +class AudioExtractionConfiguration(_SerdeShape): + """Configuration for audio extraction.""" + + audio_extraction_status: str + """Whether audio extraction is enabled or disabled.""" + +@dataclass(kw_only=True) +class AudioSegmentationConfiguration(_SerdeShape): + """ + Configuration for segmenting audio content during multimodal knowledge + base ingestion. Determines how audio files are divided into chunks for + processing. + """ + + fixed_length_duration: int + """ + The duration in seconds for each audio segment. Audio files will be + divided into chunks of this length for processing. + """ + +@dataclass(kw_only=True) +class AutoToolChoice(_SerdeShape): + """ + Defines tools. The model automatically decides whether to call a tool or + to generate text instead. For more information, see [Use a tool to + complete an Amazon Bedrock model + response](https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html). + """ + +@dataclass(kw_only=True) +class BedrockDataAutomationConfiguration(_SerdeShape): + """ + Contains configurations for using Amazon Bedrock Data Automation as the + parser for ingesting your data sources. + """ + + parsing_modality: str | None = ... + """ + Specifies whether to enable parsing of multimodal data, including both + text and/or images. + """ + +@dataclass(kw_only=True) +class BedrockEmbeddingModelConfiguration(_SerdeShape): + """The vector configuration details for the Bedrock embeddings model.""" + + dimensions: int | None = ... + """ + The dimensions details for the vector configuration used on the Bedrock + embeddings model. + """ + embedding_data_type: str | None = ... + """ + The data type for the vectors when using a model to convert text into + vector embeddings. The model must support the specified data type for + vector embeddings. Floating-point (float32) is the default data type, + and is supported by most models for vector embeddings. See [Supported + embeddings + models](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-supported.html) + for information on the available models and their vector data types. + """ + audio: list[AudioConfiguration] | None = ... + """ + Configuration settings for processing audio content in multimodal + knowledge bases. + + Warning: + This field is deprecated. Use `modelConfiguration` instead. + """ + video: list[VideoConfiguration] | None = ... + """ + Configuration settings for processing video content in multimodal + knowledge bases. + + Warning: + This field is deprecated. Use `modelConfiguration` instead. + """ + model_configuration: Document | None = ... + """ + Model-specific configuration for the embedding model, provided as a JSON + object. Use this field to specify settings that apply to the embedding + model that you selected, such as how audio and video files are divided + into segments. + + The fields that this object accepts depend on the embedding model. For + the settings that each model accepts, see the documentation for that + model. + + For an example of a + [CreateKnowledgeBase](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_CreateKnowledgeBase.html) + request that uses this field to configure a multimodal embedding model, + see the + [Examples](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_CreateKnowledgeBase.html#API_agent_CreateKnowledgeBase_Examples) + section of + [CreateKnowledgeBase](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_CreateKnowledgeBase.html). + """ + +@dataclass(kw_only=True) +class BedrockFoundationModelConfiguration(_SerdeShape): + """ + Settings for a foundation model used to parse documents for a data + source. + """ + + model_arn: str + """The ARN of the foundation model to use for parsing.""" + parsing_prompt: ParsingPrompt | None = ... + """Instructions for interpreting the contents of a document.""" + parsing_modality: str | None = ... + """ + Specifies whether to enable parsing of multimodal data, including both + text and/or images. + """ + +@dataclass(kw_only=True) +class BedrockFoundationModelContextEnrichmentConfiguration(_SerdeShape): + """ + Context enrichment configuration is used to provide additional context + to the RAG application using Amazon Bedrock foundation models. + """ + + enrichment_strategy_configuration: EnrichmentStrategyConfiguration + """ + The enrichment stategy used to provide additional context. For example, + Neptune GraphRAG uses Amazon Bedrock foundation models to perform chunk + entity extraction. + """ + model_arn: str + """ + The Amazon Resource Name (ARN) of the model used to create vector + embeddings for the knowledge base. + """ + +@dataclass(kw_only=True) +class ByteContentDoc(_SerdeShape): + """Contains information about content defined inline in bytes.""" + + mime_type: str + """ + The MIME type of the content. For a list of MIME types, see [Media + Types](https://www.iana.org/assignments/media-types/media-types.xhtml). + The following MIME types are supported: + + - text/plain + + - text/html + + - text/csv + + - text/vtt + + - message/rfc822 + + - application/xhtml+xml + + - application/pdf + + - application/msword + + - application/vnd.ms-word.document.macroenabled.12 + + - application/vnd.ms-word.template.macroenabled.12 + + - application/vnd.ms-excel + + - application/vnd.ms-excel.addin.macroenabled.12 + + - application/vnd.ms-excel.sheet.macroenabled.12 + + - application/vnd.ms-excel.template.macroenabled.12 + + - application/vnd.ms-excel.sheet.binary.macroenabled.12 + + - application/vnd.ms-spreadsheetml + + - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet + + - application/vnd.openxmlformats-officedocument.spreadsheetml.template + + - application/vnd.openxmlformats-officedocument.wordprocessingml.document + + - application/vnd.openxmlformats-officedocument.wordprocessingml.template + """ + data: bytes + """The base64-encoded string of the content.""" + +@dataclass(kw_only=True) +class CachePointBlock(_SerdeShape): + """ + Indicates where a cache checkpoint is located. All information before + this checkpoint is cached to be accessed on subsequent requests. + """ + + type: str + """Indicates that the CachePointBlock is of the default type""" + +class CachePointType(UnknownEnumMixin, StrEnum): + DEFAULT = "default" + +@dataclass(kw_only=True) +class ChatPromptTemplateConfiguration(_SerdeShape): + """ + Contains configurations to use a prompt in a conversational format. For + more information, see [Create a prompt using Prompt + management](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-create.html). + """ + + messages: list[Message] + """Contains messages in the chat for the prompt.""" + system: list[SystemContentBlock] | None = ... + """ + Contains system prompts to provide context to the model or to describe + how it should behave. + """ + input_variables: list[PromptInputVariable] | None = ... + """An array of the variables in the prompt template.""" + tool_configuration: ToolConfiguration | None = ... + """ + Configuration information for the tools that the model can use when + generating a response. + """ + +@dataclass(kw_only=True) +class ChunkingConfiguration(_SerdeShape): + """ + Details about how to chunk the documents in the data source. A *chunk* + refers to an excerpt from a data source that is returned when the + knowledge base that it belongs to is queried. + """ + + chunking_strategy: str + """ + Knowledge base can split your source data into chunks. A *chunk* refers + to an excerpt from a data source that is returned when the knowledge + base that it belongs to is queried. You have the following options for + chunking your data. If you opt for `NONE`, then you may want to + pre-process your files by splitting them up such that each file + corresponds to a chunk. + + - `FIXED_SIZE` -- Amazon Bedrock splits your source data into chunks of + the approximate size that you set in the + `fixedSizeChunkingConfiguration`. + + - `HIERARCHICAL` -- Split documents into layers of chunks where the + first layer contains large chunks, and the second layer contains + smaller chunks derived from the first layer. + + - `SEMANTIC` -- Split documents into chunks based on groups of similar + content derived with natural language processing. + + - `NONE` -- Amazon Bedrock treats each file as one chunk. If you choose + this option, you may want to pre-process your documents by splitting + them into separate files. + """ + fixed_size_chunking_configuration: FixedSizeChunkingConfiguration | None = ... + """ + Configurations for when you choose fixed-size chunking. If you set the + `chunkingStrategy` as `NONE`, exclude this field. + """ + hierarchical_chunking_configuration: HierarchicalChunkingConfiguration | None = ... + """ + Settings for hierarchical document chunking for a data source. + Hierarchical chunking splits documents into layers of chunks where the + first layer contains large chunks, and the second layer contains smaller + chunks derived from the first layer. + """ + semantic_chunking_configuration: SemanticChunkingConfiguration | None = ... + """ + Settings for semantic document chunking for a data source. Semantic + chunking splits a document into into smaller documents based on groups + of similar content derived from the text with natural language + processing. + """ + +class ChunkingStrategy(UnknownEnumMixin, StrEnum): + FIXED_SIZE = "FIXED_SIZE" + NONE = "NONE" + HIERARCHICAL = "HIERARCHICAL" + SEMANTIC = "SEMANTIC" + +@dataclass(kw_only=True) +class CollectorFlowNodeConfiguration(_SerdeShape): + """ + Defines a collector node in your flow. This node takes an iteration of + inputs and consolidates them into an array in the output. For more + information, see [Node types in a + flow](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-nodes.html) + in the Amazon Bedrock User Guide. + """ + +class ConcurrencyType(UnknownEnumMixin, StrEnum): + AUTOMATIC = "Automatic" + MANUAL = "Manual" + +@dataclass(kw_only=True) +class ConditionFlowNodeConfiguration(_SerdeShape): + """ + Defines a condition node in your flow. You can specify conditions that + determine which node comes next in the flow. For more information, see + [Node types in a + flow](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-nodes.html) + in the Amazon Bedrock User Guide. + """ + + conditions: list[FlowCondition] + """ + An array of conditions. Each member contains the name of a condition and + an expression that defines the condition. + """ + +@dataclass(kw_only=True) +class ConflictException(ServiceError, _SerdeShape): + """There was a conflict performing an operation.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class ConfluenceAuthType(UnknownEnumMixin, StrEnum): + BASIC = "BASIC" + OAUTH2_CLIENT_CREDENTIALS = "OAUTH2_CLIENT_CREDENTIALS" + +@dataclass(kw_only=True) +class ConfluenceCrawlerConfiguration(_SerdeShape): + """ + The configuration of the Confluence content. For example, configuring + specific types of Confluence content. + """ + + filter_configuration: CrawlFilterConfiguration | None = ... + """ + The configuration of filtering the Confluence content. For example, + configuring regular expression patterns to include or exclude certain + content. + """ + +@dataclass(kw_only=True) +class ConfluenceDataSourceConfiguration(_SerdeShape): + """ + The configuration information to connect to Confluence as your data + source for self-managed knowledge bases. + """ + + source_configuration: ConfluenceSourceConfiguration + """The endpoint information to connect to your Confluence data source.""" + crawler_configuration: ConfluenceCrawlerConfiguration | None = ... + """ + The configuration of the Confluence content. For example, configuring + specific types of Confluence content. + """ + +class ConfluenceHostType(UnknownEnumMixin, StrEnum): + SAAS = "SAAS" + +@dataclass(kw_only=True) +class ConfluenceSourceConfiguration(_SerdeShape): + """The endpoint information to connect to your Confluence data source.""" + + host_url: str + """The Confluence host URL or instance URL.""" + host_type: str + """The supported host type, whether online/cloud or server/on-premises.""" + auth_type: str + """ + The supported authentication type to authenticate and connect to your + Confluence instance. + """ + credentials_secret_arn: str + """ + The Amazon Resource Name of an Secrets Manager secret that stores your + authentication credentials for your Confluence instance URL. For more + information on the key-value pairs that must be included in your secret, + depending on your authentication type, see [Confluence connection + configuration](https://docs.aws.amazon.com/bedrock/latest/userguide/confluence-data-source-connector.html#configuration-confluence-connector). + """ + +@dataclass +class ContentBlockText(_SerdeShape): + """The text in the message.""" + + value: str + +@dataclass +class ContentBlockCachePoint(_SerdeShape): + """Creates a cache checkpoint within a message.""" + + value: CachePointBlock + +@dataclass +class ContentBlockUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ContentBlock = Union[ContentBlockText | ContentBlockCachePoint | ContentBlockUnknown] +""" +Contains the content for the message you pass to, or receive from a +model. For more information, see [Create a prompt using Prompt +management](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-create.html). +""" + +class _ContentBlockDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> ContentBlock: ... + +class ContentDataSourceType(UnknownEnumMixin, StrEnum): + CUSTOM = "CUSTOM" + S3 = "S3" + +@dataclass(kw_only=True) +class ContextEnrichmentConfiguration(_SerdeShape): + """ + Context enrichment configuration is used to provide additional context + to the RAG application. + """ + + type: str + """ + The method used for context enrichment. It must be Amazon Bedrock + foundation models. + """ + bedrock_foundation_model_configuration: ( + BedrockFoundationModelContextEnrichmentConfiguration | None + ) = ... + """ + The configuration of the Amazon Bedrock foundation model used for + context enrichment. + """ + +class ContextEnrichmentType(UnknownEnumMixin, StrEnum): + BEDROCK_FOUNDATION_MODEL = "BEDROCK_FOUNDATION_MODEL" + +class ConversationRole(UnknownEnumMixin, StrEnum): + USER = "user" + ASSISTANT = "assistant" + +@dataclass(kw_only=True) +class CrawlFilterConfiguration(_SerdeShape): + """ + The configuration of filtering the data source content. For example, + configuring regular expression patterns to include or exclude certain + content. + """ + + type: str + """ + The type of filtering that you want to apply to certain objects or + content of the data source. For example, the `PATTERN` type is regular + expression patterns you can apply to filter your content. + """ + pattern_object_filter: PatternObjectFilterConfiguration | None = ... + """ + The configuration of filtering certain objects or content types of the + data source. + """ + +class CrawlFilterConfigurationType(UnknownEnumMixin, StrEnum): + PATTERN = "PATTERN" + +@dataclass(kw_only=True) +class CreateAgentActionGroupInput(_SerdeShape): + """Dataclass for CreateAgentActionGroupInput structure.""" + + agent_id: str | None = ... + """The unique identifier of the agent for which to create the action group.""" + agent_version: str | None = ... + """The version of the agent for which to create the action group.""" + action_group_name: str | None = ... + """The name to give the action group.""" + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If this token matches a previous + request, Amazon Bedrock ignores the request, but does not return an + error. For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + description: str | None = ... + """A description of the action group.""" + parent_action_group_signature: str | None = ... + """ + Specify a built-in or computer use action for this action group. If you + specify a value, you must leave the `description`, `apiSchema`, and + `actionGroupExecutor` fields empty for this action group. + + - To allow your agent to request the user for additional information + when trying to complete a task, set this field to `AMAZON.UserInput`. + + - To allow your agent to generate, run, and troubleshoot code when + trying to complete a task, set this field to `AMAZON.CodeInterpreter`. + + - To allow your agent to use an Anthropic computer use tool, specify one + of the following values. + + Warning: + Computer use is a new Anthropic Claude model capability (in beta) + available with Anthropic Claude 3.7 Sonnet and Claude 3.5 Sonnet v2 + only. When operating computer use functionality, we recommend taking + additional security precautions, such as executing computer actions in + virtual environments with restricted data access and limited internet + connectivity. For more information, see [Configure an Amazon Bedrock + Agent to complete tasks with computer use + tools](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-computer-use.html). + + - `ANTHROPIC.Computer` - Gives the agent permission to use the mouse + and keyboard and take screenshots. + + - `ANTHROPIC.TextEditor` - Gives the agent permission to view, create + and edit files. + + - `ANTHROPIC.Bash` - Gives the agent permission to run commands in a + bash shell. + """ + parent_action_group_signature_params: dict[str, str] | None = ... + """ + The configuration settings for a computer use action. + + Warning: + Computer use is a new Anthropic Claude model capability (in beta) + available with Anthropic Claude 3.7 Sonnet and Claude 3.5 Sonnet v2 + only. For more information, see [Configure an Amazon Bedrock Agent to + complete tasks with computer use + tools](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-computer-use.html). + """ + action_group_executor: ActionGroupExecutor | None = ... + """ + The Amazon Resource Name (ARN) of the Lambda function containing the + business logic that is carried out upon invoking the action or the + custom control method for handling the information elicited from the + user. + """ + api_schema: APISchema | None = ... + """ + Contains either details about the S3 object containing the OpenAPI + schema for the action group or the JSON or YAML-formatted payload + defining the schema. For more information, see [Action group OpenAPI + schemas](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-api-schema.html). + """ + action_group_state: str | None = ... + """ + Specifies whether the action group is available for the agent to invoke + or not when sending an + [InvokeAgent](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html) + request. + """ + function_schema: FunctionSchema | None = ... + """ + Contains details about the function schema for the action group or the + JSON or YAML-formatted payload defining the schema. + """ + +@dataclass(kw_only=True) +class CreateAgentActionGroupOutput(_SerdeShape): + """Dataclass for CreateAgentActionGroupOutput structure.""" + + agent_action_group: AgentActionGroup + """Contains details about the action group that was created.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateAgentAliasInput(_SerdeShape): + """Dataclass for CreateAgentAliasInput structure.""" + + agent_id: str | None = ... + """The unique identifier of the agent.""" + agent_alias_name: str | None = ... + """The name of the alias.""" + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If this token matches a previous + request, Amazon Bedrock ignores the request, but does not return an + error. For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + description: str | None = ... + """A description of the alias of the agent.""" + routing_configuration: list[AgentAliasRoutingConfigurationListItem] | None = ... + """Contains details about the routing configuration of the alias.""" + tags: dict[str, str] | None = ... + """Any tags that you want to attach to the alias of the agent.""" + +@dataclass(kw_only=True) +class CreateAgentAliasOutput(_SerdeShape): + """Dataclass for CreateAgentAliasOutput structure.""" + + agent_alias: AgentAlias + """Contains details about the alias that was created.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateAgentInput(_SerdeShape): + """Dataclass for CreateAgentInput structure.""" + + agent_name: str | None = ... + """A name for the agent that you create.""" + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If this token matches a previous + request, Amazon Bedrock ignores the request, but does not return an + error. For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + instruction: str | None = ... + """ + Instructions that tell the agent what it should do and how it should + interact with users. + """ + foundation_model: str | None = ... + """ + The identifier for the model that you want to be used for orchestration + by the agent you create. + + The `modelId` to provide depends on the type of model or throughput that + you use: + + - If you use a base model, specify the model ID or its ARN. For a list + of model IDs for base models, see [Amazon Bedrock base model IDs + (on-demand + throughput)](https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns) + in the Amazon Bedrock User Guide. + + - If you use an inference profile, specify the inference profile ID or + its ARN. For a list of inference profile IDs, see [Supported Regions + and models for cross-region + inference](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference-support.html) + in the Amazon Bedrock User Guide. + + - If you use a provisioned model, specify the ARN of the Provisioned + Throughput. For more information, see [Run inference using a + Provisioned + Throughput](https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html) + in the Amazon Bedrock User Guide. + + - If you use a custom model, first purchase Provisioned Throughput for + it. Then specify the ARN of the resulting provisioned model. For more + information, see [Use a custom model in Amazon + Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html) + in the Amazon Bedrock User Guide. + + - If you use an [imported + model](https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-import-model.html), + specify the ARN of the imported model. You can get the model ARN from + a successful call to + [CreateModelImportJob](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_CreateModelImportJob.html) + or from the Imported models page in the Amazon Bedrock console. + """ + description: str | None = ... + """A description of the agent.""" + orchestration_type: str | None = ... + """ + Specifies the type of orchestration strategy for the agent. This is set + to `DEFAULT` orchestration type, by default. + """ + custom_orchestration: CustomOrchestration | None = ... + """Contains details of the custom orchestration configured for the agent.""" + idle_session_ttl_in_seconds: int | None = ... + """ + The number of seconds for which Amazon Bedrock keeps information about a + user's conversation with the agent. + + A user interaction remains active for the amount of time specified. If + no conversation occurs during this time, the session expires and Amazon + Bedrock deletes any data provided before the timeout. + """ + agent_resource_role_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the IAM role with permissions to + invoke API operations on the agent. + """ + customer_encryption_key_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the KMS key with which to encrypt the + agent. + """ + tags: dict[str, str] | None = ... + """Any tags that you want to attach to the agent.""" + prompt_override_configuration: PromptOverrideConfiguration | None = ... + """ + Contains configurations to override prompts in different parts of an + agent sequence. For more information, see [Advanced + prompts](https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts.html). + """ + guardrail_configuration: GuardrailConfiguration | None = ... + """ + The unique Guardrail configuration assigned to the agent when it is + created. + """ + memory_configuration: MemoryConfiguration | None = ... + """Contains the details of the memory configured for the agent.""" + agent_collaboration: str | None = ... + """The agent's collaboration role.""" + +@dataclass(kw_only=True) +class CreateAgentOutput(_SerdeShape): + """Dataclass for CreateAgentOutput structure.""" + + agent: Agent + """Contains details about the agent created.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateDataSourceInput(_SerdeShape): + """Dataclass for CreateDataSourceInput structure.""" + + knowledge_base_id: str | None = ... + """ + The unique identifier of the knowledge base to which to add the data + source. + """ + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If this token matches a previous + request, Amazon Bedrock ignores the request, but does not return an + error. For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + name: str | None = ... + """The name of the data source.""" + description: str | None = ... + """A description of the data source.""" + data_source_configuration: DataSourceConfiguration | None = ... + """The connection configuration for the data source.""" + data_deletion_policy: str | None = ... + """ + The data deletion policy for the data source. + + You can set the data deletion policy to: + + - DELETE: Deletes all data from your data source that's converted into + vector embeddings upon deletion of a knowledge base or data source + resource. Note that the **vector store itself is not deleted**, only + the data. This flag is ignored if an Amazon Web Services account is + deleted. + + - RETAIN: Retains all data from your data source that's converted into + vector embeddings upon deletion of a knowledge base or data source + resource. Note that the **vector store itself is not deleted** if you + delete a knowledge base or data source resource. + + Note: + For managed knowledge bases, the only supported option is `DELETE`, + which is also the default. + """ + server_side_encryption_configuration: ServerSideEncryptionConfiguration | None = ... + """Contains details about the server-side encryption for the data source.""" + vector_ingestion_configuration: VectorIngestionConfiguration | None = ... + """Contains details about how to ingest the documents in the data source.""" + +@dataclass(kw_only=True) +class CreateDataSourceOutput(_SerdeShape): + """Dataclass for CreateDataSourceOutput structure.""" + + data_source: DataSource + """Contains details about the data source.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateFlowAliasInput(_SerdeShape): + """Dataclass for CreateFlowAliasInput structure.""" + + name: str | None = ... + """A name for the alias.""" + description: str | None = ... + """A description for the alias.""" + routing_configuration: list[FlowAliasRoutingConfigurationListItem] | None = ... + """Contains information about the version to which to map the alias.""" + concurrency_configuration: FlowAliasConcurrencyConfiguration | None = ... + """ + The configuration that specifies how nodes in the flow are executed in + parallel. + """ + flow_identifier: str | None = ... + """The unique identifier of the flow for which to create an alias.""" + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If this token matches a previous + request, Amazon Bedrock ignores the request, but does not return an + error. For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + tags: dict[str, str] | None = ... + """ + Any tags that you want to attach to the alias of the flow. For more + information, see [Tagging resources in Amazon + Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/tagging.html). + """ + +@dataclass(kw_only=True) +class CreateFlowAliasOutput(_SerdeShape): + """Dataclass for CreateFlowAliasOutput structure.""" + + name: str + """The name of the alias.""" + description: str | None = ... + """The description of the alias.""" + routing_configuration: list[FlowAliasRoutingConfigurationListItem] + """Contains information about the version that the alias is mapped to.""" + concurrency_configuration: FlowAliasConcurrencyConfiguration | None = ... + """ + The configuration that specifies how nodes in the flow are executed in + parallel. + """ + flow_id: str + """The unique identifier of the flow that the alias belongs to.""" + id: str + """The unique identifier of the alias.""" + arn: str + """The Amazon Resource Name (ARN) of the alias.""" + created_at: datetime + """The time at which the alias was created.""" + updated_at: datetime + """The time at which the alias of the flow was last updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateFlowInput(_SerdeShape): + """Dataclass for CreateFlowInput structure.""" + + name: str | None = ... + """A name for the flow.""" + description: str | None = ... + """A description for the flow.""" + execution_role_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the service role with permissions to + create and manage a flow. For more information, see [Create a service + role for flows in Amazon + Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-permissions.html) + in the Amazon Bedrock User Guide. + """ + customer_encryption_key_arn: str | None = ... + """The Amazon Resource Name (ARN) of the KMS key to encrypt the flow.""" + definition: FlowDefinition | None = ... + """A definition of the nodes and connections between nodes in the flow.""" + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If this token matches a previous + request, Amazon Bedrock ignores the request, but does not return an + error. For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + tags: dict[str, str] | None = ... + """ + Any tags that you want to attach to the flow. For more information, see + [Tagging resources in Amazon + Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/tagging.html). + """ + +@dataclass(kw_only=True) +class CreateFlowOutput(_SerdeShape): + """Dataclass for CreateFlowOutput structure.""" + + name: str + """The name of the flow.""" + description: str | None = ... + """The description of the flow.""" + execution_role_arn: str + """ + The Amazon Resource Name (ARN) of the service role with permissions to + create a flow. For more information, see [Create a service role for + flows in Amazon + Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-permissions.html) + in the Amazon Bedrock User Guide. + """ + customer_encryption_key_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the KMS key that you encrypted the + flow with. + """ + id: str + """The unique identifier of the flow.""" + arn: str + """The Amazon Resource Name (ARN) of the flow.""" + status: str + """ + The status of the flow. When you submit this request, the status will be + `NotPrepared`. If creation fails, the status becomes `Failed`. + """ + created_at: datetime + """The time at which the flow was created.""" + updated_at: datetime + """The time at which the flow was last updated.""" + version: str + """ + The version of the flow. When you create a flow, the version created is + the `DRAFT` version. + """ + definition: FlowDefinition | None = ... + """A definition of the nodes and connections between nodes in the flow.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateFlowVersionInput(_SerdeShape): + """Dataclass for CreateFlowVersionInput structure.""" + + flow_identifier: str | None = ... + """The unique identifier of the flow that you want to create a version of.""" + description: str | None = ... + """A description of the version of the flow.""" + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If this token matches a previous + request, Amazon Bedrock ignores the request, but does not return an + error. For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + +@dataclass(kw_only=True) +class CreateFlowVersionOutput(_SerdeShape): + """Dataclass for CreateFlowVersionOutput structure.""" + + name: str + """The name of the version.""" + description: str | None = ... + """The description of the version.""" + execution_role_arn: str + """ + The Amazon Resource Name (ARN) of the service role with permissions to + create a flow. For more information, see [Create a service role for + flows in Amazon + Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-permissions.html) + in the Amazon Bedrock User Guide. + """ + customer_encryption_key_arn: str | None = ... + """The KMS key that the flow is encrypted with.""" + id: str + """The unique identifier of the flow.""" + arn: str + """The Amazon Resource Name (ARN) of the flow.""" + status: str + """The status of the flow.""" + created_at: datetime + """The time at which the flow was created.""" + version: str + """ + The version of the flow that was created. Versions are numbered + incrementally, starting from 1. + """ + definition: FlowDefinition | None = ... + """A definition of the nodes and connections in the flow.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateKnowledgeBaseInput(_SerdeShape): + """Dataclass for CreateKnowledgeBaseInput structure.""" + + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If this token matches a previous + request, Amazon Bedrock ignores the request, but does not return an + error. For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + name: str | None = ... + """A name for the knowledge base.""" + description: str | None = ... + """A description of the knowledge base.""" + role_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the IAM role with permissions to + invoke API operations on the knowledge base. + """ + knowledge_base_configuration: KnowledgeBaseConfiguration | None = ... + """Contains details about the embeddings model used for the knowledge base.""" + storage_configuration: StorageConfiguration | None = ... + """ + Contains details about the configuration of the vector database used for + the knowledge base. + """ + tags: dict[str, str] | None = ... + """ + Specify the key-value pairs for the tags that you want to attach to your + knowledge base in this object. + """ + +@dataclass(kw_only=True) +class CreateKnowledgeBaseOutput(_SerdeShape): + """Dataclass for CreateKnowledgeBaseOutput structure.""" + + knowledge_base: KnowledgeBase + """Contains details about the knowledge base.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreatePromptInput(_SerdeShape): + """Dataclass for CreatePromptInput structure.""" + + name: str | None = ... + """A name for the prompt.""" + description: str | None = ... + """A description for the prompt.""" + customer_encryption_key_arn: str | None = ... + """The Amazon Resource Name (ARN) of the KMS key to encrypt the prompt.""" + default_variant: str | None = ... + """ + The name of the default variant for the prompt. This value must match + the `name` field in the relevant + [PromptVariant](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptVariant.html) + object. + """ + variants: list[PromptVariant] | None = ... + """ + A list of objects, each containing details about a variant of the + prompt. + """ + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If this token matches a previous + request, Amazon Bedrock ignores the request, but does not return an + error. For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + tags: dict[str, str] | None = ... + """ + Any tags that you want to attach to the prompt. For more information, + see [Tagging resources in Amazon + Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/tagging.html). + """ + +@dataclass(kw_only=True) +class CreatePromptOutput(_SerdeShape): + """Dataclass for CreatePromptOutput structure.""" + + name: str + """The name of the prompt.""" + description: str | None = ... + """The description of the prompt.""" + customer_encryption_key_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the KMS key that you encrypted the + prompt with. + """ + default_variant: str | None = ... + """The name of the default variant for your prompt.""" + variants: list[PromptVariant] | None = ... + """ + A list of objects, each containing details about a variant of the + prompt. + """ + id: str + """The unique identifier of the prompt.""" + arn: str + """The Amazon Resource Name (ARN) of the prompt.""" + version: str + """ + The version of the prompt. When you create a prompt, the version created + is the `DRAFT` version. + """ + created_at: datetime + """The time at which the prompt was created.""" + updated_at: datetime + """The time at which the prompt was last updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreatePromptVersionInput(_SerdeShape): + """Dataclass for CreatePromptVersionInput structure.""" + + prompt_identifier: str | None = ... + """ + The unique identifier of the prompt that you want to create a version + of. + """ + description: str | None = ... + """A description for the version of the prompt.""" + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If this token matches a previous + request, Amazon Bedrock ignores the request, but does not return an + error. For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + tags: dict[str, str] | None = ... + """ + Any tags that you want to attach to the version of the prompt. For more + information, see [Tagging resources in Amazon + Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/tagging.html). + """ + +@dataclass(kw_only=True) +class CreatePromptVersionOutput(_SerdeShape): + """Dataclass for CreatePromptVersionOutput structure.""" + + name: str + """The name of the prompt.""" + description: str | None = ... + """A description for the version.""" + customer_encryption_key_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the KMS key to encrypt the version of + the prompt. + """ + default_variant: str | None = ... + """ + The name of the default variant for the prompt. This value must match + the `name` field in the relevant + [PromptVariant](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptVariant.html) + object. + """ + variants: list[PromptVariant] | None = ... + """ + A list of objects, each containing details about a variant of the + prompt. + """ + id: str + """The unique identifier of the prompt.""" + arn: str + """The Amazon Resource Name (ARN) of the version of the prompt.""" + version: str + """ + The version of the prompt that was created. Versions are numbered + incrementally, starting from 1. + """ + created_at: datetime + """The time at which the prompt was created.""" + updated_at: datetime + """The time at which the prompt was last updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateVpcConfigurationInput(_SerdeShape): + """Dataclass for CreateVpcConfigurationInput structure.""" + + knowledge_base_id: str | None = ... + """ + The unique identifier of the knowledge base to associate this VPC + configuration with. + """ + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the operation + completes no more than one time. If this token matches a previous + request, the service ignores the request but does not return an error. + """ + vpc_id: str | None = ... + """ + The identifier of the VPC that the knowledge base connects through to + reach the resource. + """ + subnet_ids: list[str] | None = ... + """ + The subnets, in the VPC identified by `vpcId`, that the knowledge base + uses to connect to the resource. + """ + resource_target: str | None = ... + """ + The private IPv4 address or DNS name of the resource you want the + knowledge base to reach. The target must be privately reachable from + inside your VPC, such as an internal load balancer or a private IP. The + following are not supported: + + - Internet-facing endpoints + + - Loopback addresses + + - Link-local addresses + + - Wildcard addresses + + - Multicast addresses + + - IPv6 literals + """ + port: int | None = ... + """The port on which to reach the resource.""" + protocol: str | None = ... + """ + The protocol used to connect to the resource. Specify `HTTP` for + plaintext or `HTTPS` for TLS. When you specify `HTTPS`, you must also + provide `tlsServerName`. + """ + resolution_mode: str | None = ... + """ + Controls how a domain-name `resourceTarget` is resolved. This applies + only when the target is a domain name; it has no effect for IP-address + targets, which have no name to resolve. In all cases the resolved + address must be reachable from inside your VPC. Valid values: + + - `IN_VPC` (default, recommended) -- The target domain name is resolved + privately, using the DNS resolvers of the VPC, such as private Route + 53 hosted zones or on-premises DNS reachable from the VPC. Use this + for targets that are private to your VPC, such as internal load + balancers, private hosted-zone names, or on-premises hosts. + + - `PUBLIC` -- The target domain name is resolved against public DNS + resolvers. Select this only when the target's domain name must be + resolved through public DNS and the resulting address is still + reachable from the VPC, an uncommon split-horizon configuration. If + you are unsure, use `IN_VPC`. + """ + host_header: str | None = ... + """ + An optional HTTP `Host` header value to send when invoking the resource. + Set this only if your resource (or an upstream router or ingress) routes + by the `Host` header and that host differs from the target. This setting + is independent of `tlsServerName`. + """ + tls_server_name: str | None = ... + """ + The expected TLS server name. The service matches this value against the + Subject Alternative Names on your resource's TLS certificate during + invocation. This field is required when `protocol` is `HTTPS`. Set it to + a hostname on your certificate, such as `app.internal.example.com`. You + can use a single leftmost wildcard, such as `*.example.com`. The value + must be a hostname without a port. + """ + name: str | None = ... + """ + An optional human-readable name for the VPC configuration. If you don't + specify a name, the VPC configuration has no name. + """ + description: str | None = ... + """ + An optional description of the VPC configuration. If you don't specify + a description, the VPC configuration has no description. + """ + +@dataclass(kw_only=True) +class CreateVpcConfigurationOutput(_SerdeShape): + """Dataclass for CreateVpcConfigurationOutput structure.""" + + vpc_configuration_id: str + """The unique identifier of the VPC configuration that was created.""" + status: str + """ + The current status of the VPC configuration. Immediately after creation + this is `CREATING`. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class CreationMode(UnknownEnumMixin, StrEnum): + DEFAULT = "DEFAULT" + OVERRIDDEN = "OVERRIDDEN" + +@dataclass(kw_only=True) +class CuratedQuery(_SerdeShape): + """ + Contains configurations for a query, each of which defines information + about example queries to help the query engine generate appropriate SQL + queries. + """ + + natural_language: str + """An example natural language query.""" + sql: str + """The SQL equivalent of the natural language query.""" + +@dataclass(kw_only=True) +class CustomContent(_SerdeShape): + """ + Contains information about the content to ingest into a knowledge base + connected to a custom data source. Choose a `sourceType` and include the + field that corresponds to it. + """ + + custom_document_identifier: CustomDocumentIdentifier + """A unique identifier for the document.""" + source_type: str + """The source of the data to ingest.""" + s3_location: CustomS3Location | None = ... + """ + Contains information about the Amazon S3 location of the file from which + to ingest data. + """ + inline_content: InlineContent | None = ... + """ + Contains information about content defined inline to ingest into a + knowledge base. + """ + +class CustomControlMethod(UnknownEnumMixin, StrEnum): + RETURN_CONTROL = "RETURN_CONTROL" + +@dataclass(kw_only=True) +class CustomDocumentIdentifier(_SerdeShape): + """ + Contains information about the identifier of the document to ingest into + a custom data source. + """ + + id: str + """The identifier of the document to ingest into a custom data source.""" + +@dataclass(kw_only=True) +class CustomOrchestration(_SerdeShape): + """Details of custom orchestration.""" + + executor: OrchestrationExecutor | None = ... + """ + The structure of the executor invoking the actions in custom + orchestration. + """ + +@dataclass(kw_only=True) +class CustomS3Location(_SerdeShape): + """ + Contains information about the Amazon S3 location of the file containing + the content to ingest into a knowledge base connected to a custom data + source. + """ + + uri: str + """The S3 URI of the file containing the content to ingest.""" + bucket_owner_account_id: str | None = ... + """ + The identifier of the Amazon Web Services account that owns the S3 + bucket containing the content to ingest. + """ + +class CustomSourceType(UnknownEnumMixin, StrEnum): + IN_LINE = "IN_LINE" + S3_LOCATION = "S3_LOCATION" + +@dataclass(kw_only=True) +class CustomTransformationConfiguration(_SerdeShape): + """ + Settings for customizing steps in the data source content ingestion + pipeline. + + You can configure the data source to process documents with a Lambda + function after they are parsed and converted into chunks. When you add a + post-chunking transformation, the service stores chunked documents in an + S3 bucket and invokes a Lambda function to process them. + + To process chunked documents with a Lambda function, define an S3 bucket + path for input and output objects, and a transformation that specifies + the Lambda function to invoke. You can use the Lambda function to + customize how chunks are split, and the metadata for each chunk. + """ + + intermediate_storage: IntermediateStorage + """An S3 bucket path for input and output objects.""" + transformations: list[Transformation] + """A Lambda function that processes documents.""" + +@dataclass(kw_only=True) +class CyclicConnectionFlowValidationDetails(_SerdeShape): + """Details about a cyclic connection detected in the flow.""" + + connection: str + """The name of the connection that causes the cycle in the flow.""" + +@dataclass(kw_only=True) +class DailySchedule(_SerdeShape): + """ + A daily sync. The run time is system-chosen (off-peak) and not + configurable. + """ + +class DataDeletionPolicy(UnknownEnumMixin, StrEnum): + RETAIN = "RETAIN" + DELETE = "DELETE" + +@dataclass(kw_only=True) +class DataSource(_SerdeShape): + """Contains details about a data source.""" + + knowledge_base_id: str + """ + The unique identifier of the knowledge base to which the data source + belongs. + """ + data_source_id: str + """The unique identifier of the data source.""" + name: str + """The name of the data source.""" + status: str + """ + The status of the data source. The following statuses are possible: + + - Available -- The data source has been created and is ready for + ingestion into the knowledge base. + + - Deleting -- The data source is being deleted. + """ + description: str | None = ... + """The description of the data source.""" + data_source_configuration: DataSourceConfiguration + """The connection configuration for the data source.""" + server_side_encryption_configuration: ServerSideEncryptionConfiguration | None = ... + """Contains details about the configuration of the server-side encryption.""" + vector_ingestion_configuration: VectorIngestionConfiguration | None = ... + """Contains details about how to ingest the documents in the data source.""" + data_deletion_policy: str | None = ... + """The data deletion policy for the data source.""" + created_at: datetime + """The time at which the data source was created.""" + updated_at: datetime + """The time at which the data source was last updated.""" + failure_reasons: list[str] | None = ... + """The detailed reasons on the failure to delete a data source.""" + +@dataclass(kw_only=True) +class DataSourceConfiguration(_SerdeShape): + """The connection configuration for the data source.""" + + type: str + """The type of data source.""" + managed_knowledge_base_connector_configuration: ( + ManagedKnowledgeBaseConnectorConfiguration | None + ) = ... + """ + Contains the configuration for a data source that connects a managed + knowledge base to a supported data source connector. Specify this object + when the data source type is `MANAGED_KNOWLEDGE_BASE_CONNECTOR`. + """ + s3_configuration: S3DataSourceConfiguration | None = ... + """ + The configuration information to connect to Amazon S3 as your data + source for self-managed knowledge bases. To configure this data source + for managed knowledge bases, use + [managedKnowledgeBaseConnectorConfiguration](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_ManagedKnowledgeBaseConnectorConfiguration.html). + """ + web_configuration: WebDataSourceConfiguration | None = ... + """ + The configuration of web URLs to crawl for your data source. You should + be authorized to crawl the URLs. + + Note: + To configure this data source for managed knowledge bases, use + [managedKnowledgeBaseConnectorConfiguration](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_ManagedKnowledgeBaseConnectorConfiguration.html). + Web crawler data source connector for self-managed knowledge bases is in + preview release and is subject to change. + """ + confluence_configuration: ConfluenceDataSourceConfiguration | None = ... + """ + The configuration information to connect to Confluence as your data + source for self-managed knowledge bases. + + Note: + To configure this data source for managed knowledge bases, use + [managedKnowledgeBaseConnectorConfiguration](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_ManagedKnowledgeBaseConnectorConfiguration.html). + Confluence data source connector for self-managed knowledge bases is in + preview release and is subject to change. + """ + salesforce_configuration: SalesforceDataSourceConfiguration | None = ... + """ + The configuration information to connect to Salesforce as your data + source. + + Note: + Salesforce data source connector for self-managed knowledge bases is in + preview release and is subject to change. + """ + share_point_configuration: SharePointDataSourceConfiguration | None = ... + """ + The configuration information to connect to SharePoint as your data + source for self-managed knowledge bases. + + Note: + To configure this data source for managed knowledge bases, use + [managedKnowledgeBaseConnectorConfiguration](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_ManagedKnowledgeBaseConnectorConfiguration.html). + SharePoint data source connector for self-managed knowledge bases is in + preview release and is subject to change. + """ + +class DataSourceStatus(UnknownEnumMixin, StrEnum): + AVAILABLE = "AVAILABLE" + DELETING = "DELETING" + DELETE_UNSUCCESSFUL = "DELETE_UNSUCCESSFUL" + CREATING = "CREATING" + UPDATING = "UPDATING" + FAILED = "FAILED" + +@dataclass(kw_only=True) +class DataSourceSummary(_SerdeShape): + """Contains details about a data source.""" + + knowledge_base_id: str + """ + The unique identifier of the knowledge base to which the data source + belongs. + """ + data_source_id: str + """The unique identifier of the data source.""" + name: str + """The name of the data source.""" + status: str + """The status of the data source.""" + description: str | None = ... + """The description of the data source.""" + updated_at: datetime + """The time at which the data source was last updated.""" + +class DataSourceType(UnknownEnumMixin, StrEnum): + S3 = "S3" + WEB = "WEB" + CONFLUENCE = "CONFLUENCE" + SALESFORCE = "SALESFORCE" + SHAREPOINT = "SHAREPOINT" + CUSTOM = "CUSTOM" + REDSHIFT_METADATA = "REDSHIFT_METADATA" + MANAGED_KNOWLEDGE_BASE_CONNECTOR = "MANAGED_KNOWLEDGE_BASE_CONNECTOR" + +@dataclass +class DayOfMonthDayNumber(_SerdeShape): + """ + A specific day of the month, from 1 to 28. Values are capped at 28, so a + monthly sync runs in every month, including February. + """ + + value: int + +@dataclass +class DayOfMonthLastDayOfMonth(_SerdeShape): + """ + Set this option to run the monthly sync on the last calendar day of each + month. + """ + + value: LastDayOfMonth + +@dataclass +class DayOfMonthUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +DayOfMonth = Union[DayOfMonthDayNumber | DayOfMonthLastDayOfMonth | DayOfMonthUnknown] +""" +The day of the month on which a monthly sync runs. Specify exactly one +of `dayNumber` or `lastDayOfMonth`. +""" + +class _DayOfMonthDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> DayOfMonth: ... + +class DayOfWeek(UnknownEnumMixin, StrEnum): + """ + The day of the week on which a weekly sync runs. Valid values are the + standard English day names, for example, MONDAY or TUESDAY. + """ + + SUNDAY = "SUNDAY" + MONDAY = "MONDAY" + TUESDAY = "TUESDAY" + WEDNESDAY = "WEDNESDAY" + THURSDAY = "THURSDAY" + FRIDAY = "FRIDAY" + SATURDAY = "SATURDAY" + +@dataclass(kw_only=True) +class DeleteAgentActionGroupInput(_SerdeShape): + """Dataclass for DeleteAgentActionGroupInput structure.""" + + agent_id: str | None = ... + """The unique identifier of the agent that the action group belongs to.""" + agent_version: str | None = ... + """The version of the agent that the action group belongs to.""" + action_group_id: str | None = ... + """The unique identifier of the action group to delete.""" + skip_resource_in_use_check: bool = ... + """ + By default, this value is `false` and deletion is stopped if the + resource is in use. If you set it to `true`, the resource will be + deleted even if the resource is in use. + """ + +@dataclass(kw_only=True) +class DeleteAgentActionGroupOutput(_SerdeShape): + """Dataclass for DeleteAgentActionGroupOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteAgentAliasInput(_SerdeShape): + """Dataclass for DeleteAgentAliasInput structure.""" + + agent_id: str | None = ... + """The unique identifier of the agent that the alias belongs to.""" + agent_alias_id: str | None = ... + """The unique identifier of the alias to delete.""" + +@dataclass(kw_only=True) +class DeleteAgentAliasOutput(_SerdeShape): + """Dataclass for DeleteAgentAliasOutput structure.""" + + agent_id: str + """The unique identifier of the agent that the alias belongs to.""" + agent_alias_id: str + """The unique identifier of the alias that was deleted.""" + agent_alias_status: str + """The status of the alias.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteAgentInput(_SerdeShape): + """Dataclass for DeleteAgentInput structure.""" + + agent_id: str | None = ... + """The unique identifier of the agent to delete.""" + skip_resource_in_use_check: bool = ... + """ + By default, this value is `false` and deletion is stopped if the + resource is in use. If you set it to `true`, the resource will be + deleted even if the resource is in use. + """ + +@dataclass(kw_only=True) +class DeleteAgentOutput(_SerdeShape): + """Dataclass for DeleteAgentOutput structure.""" + + agent_id: str + """The unique identifier of the agent that was deleted.""" + agent_status: str + """The status of the agent.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteAgentVersionInput(_SerdeShape): + """Dataclass for DeleteAgentVersionInput structure.""" + + agent_id: str | None = ... + """The unique identifier of the agent that the version belongs to.""" + agent_version: str | None = ... + """The version of the agent to delete.""" + skip_resource_in_use_check: bool = ... + """ + By default, this value is `false` and deletion is stopped if the + resource is in use. If you set it to `true`, the resource will be + deleted even if the resource is in use. + """ + +@dataclass(kw_only=True) +class DeleteAgentVersionOutput(_SerdeShape): + """Dataclass for DeleteAgentVersionOutput structure.""" + + agent_id: str + """The unique identifier of the agent that the version belongs to.""" + agent_version: str + """The version that was deleted.""" + agent_status: str + """The status of the agent version.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteDataSourceInput(_SerdeShape): + """Dataclass for DeleteDataSourceInput structure.""" + + knowledge_base_id: str | None = ... + """ + The unique identifier of the knowledge base from which to delete the + data source. + """ + data_source_id: str | None = ... + """The unique identifier of the data source to delete.""" + +@dataclass(kw_only=True) +class DeleteDataSourceOutput(_SerdeShape): + """Dataclass for DeleteDataSourceOutput structure.""" + + knowledge_base_id: str + """ + The unique identifier of the knowledge base to which the data source + that was deleted belonged. + """ + data_source_id: str + """The unique identifier of the data source that was deleted.""" + status: str + """The status of the data source.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteFlowAliasInput(_SerdeShape): + """Dataclass for DeleteFlowAliasInput structure.""" + + flow_identifier: str | None = ... + """The unique identifier of the flow that the alias belongs to.""" + alias_identifier: str | None = ... + """The unique identifier of the alias to be deleted.""" + +@dataclass(kw_only=True) +class DeleteFlowAliasOutput(_SerdeShape): + """Dataclass for DeleteFlowAliasOutput structure.""" + + flow_id: str + """The unique identifier of the flow that the alias belongs to.""" + id: str + """The unique identifier of the flow.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteFlowInput(_SerdeShape): + """Dataclass for DeleteFlowInput structure.""" + + flow_identifier: str | None = ... + """The unique identifier of the flow.""" + skip_resource_in_use_check: bool = ... + """ + By default, this value is `false` and deletion is stopped if the + resource is in use. If you set it to `true`, the resource will be + deleted even if the resource is in use. + """ + +@dataclass(kw_only=True) +class DeleteFlowOutput(_SerdeShape): + """Dataclass for DeleteFlowOutput structure.""" + + id: str + """The unique identifier of the flow.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteFlowVersionInput(_SerdeShape): + """Dataclass for DeleteFlowVersionInput structure.""" + + flow_identifier: str | None = ... + """The unique identifier of the flow whose version that you want to delete""" + flow_version: str | None = ... + """The version of the flow that you want to delete.""" + skip_resource_in_use_check: bool = ... + """ + By default, this value is `false` and deletion is stopped if the + resource is in use. If you set it to `true`, the resource will be + deleted even if the resource is in use. + """ + +@dataclass(kw_only=True) +class DeleteFlowVersionOutput(_SerdeShape): + """Dataclass for DeleteFlowVersionOutput structure.""" + + id: str + """The unique identifier of the flow.""" + version: str + """The version of the flow being deleted.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteKnowledgeBaseDocumentsInput(_SerdeShape): + """Dataclass for DeleteKnowledgeBaseDocumentsInput structure.""" + + knowledge_base_id: str | None = ... + """ + The unique identifier of the knowledge base that is connected to the + data source. + """ + data_source_id: str | None = ... + """The unique identifier of the data source that contains the documents.""" + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If this token matches a previous + request, Amazon Bedrock ignores the request, but does not return an + error. For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + document_identifiers: list[DocumentIdentifier] | None = ... + """ + A list of objects, each of which contains information to identify a + document to delete. + """ + +@dataclass(kw_only=True) +class DeleteKnowledgeBaseDocumentsOutput(_SerdeShape): + """Dataclass for DeleteKnowledgeBaseDocumentsOutput structure.""" + + document_details: list[KnowledgeBaseDocumentDetail] | None = ... + """ + A list of objects, each of which contains information about the + documents that were deleted. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteKnowledgeBaseInput(_SerdeShape): + """Dataclass for DeleteKnowledgeBaseInput structure.""" + + knowledge_base_id: str | None = ... + """The unique identifier of the knowledge base to delete.""" + +@dataclass(kw_only=True) +class DeleteKnowledgeBaseOutput(_SerdeShape): + """Dataclass for DeleteKnowledgeBaseOutput structure.""" + + knowledge_base_id: str + """The unique identifier of the knowledge base that was deleted.""" + status: str + """ + The status of the knowledge base and whether it has been successfully + deleted. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeletePromptInput(_SerdeShape): + """Dataclass for DeletePromptInput structure.""" + + prompt_identifier: str | None = ... + """The unique identifier of the prompt.""" + prompt_version: str | None = ... + """ + The version of the prompt to delete. To delete the prompt, omit this + field. + """ + +@dataclass(kw_only=True) +class DeletePromptOutput(_SerdeShape): + """Dataclass for DeletePromptOutput structure.""" + + id: str + """The unique identifier of the prompt that was deleted.""" + version: str | None = ... + """The version of the prompt that was deleted.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteResourcePolicyInput(_SerdeShape): + """Dataclass for DeleteResourcePolicyInput structure.""" + + resource_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the knowledge base to remove the + resource policy from. + """ + expected_revision_id: str | None = ... + """ + The expected revision identifier of the resource policy. Use this to + prevent conflicts when multiple users update the same policy + concurrently. + """ + +@dataclass(kw_only=True) +class DeleteResourcePolicyOutput(_SerdeShape): + """Dataclass for DeleteResourcePolicyOutput structure.""" + + resource_arn: str + """The ARN of the knowledge base that the resource policy was removed from.""" + revision_id: str | None = ... + """The revision identifier after the resource policy was deleted.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteVpcConfigurationInput(_SerdeShape): + """Dataclass for DeleteVpcConfigurationInput structure.""" + + knowledge_base_id: str | None = ... + """ + The unique identifier of the knowledge base that owns the VPC + configuration. + """ + vpc_configuration_id: str | None = ... + """The unique identifier of the VPC configuration to delete.""" + +@dataclass(kw_only=True) +class DeleteVpcConfigurationOutput(_SerdeShape): + """Dataclass for DeleteVpcConfigurationOutput structure.""" + + vpc_configuration_id: str + """The unique identifier of the VPC configuration being deleted.""" + status: str + """ + The current status of the VPC configuration. Immediately after a delete + request this is `DELETING`. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeletionProtectionConfiguration(_SerdeShape): + """Configuration for deletion protection.""" + + deletion_protection_status: str + """Enable or disable deletion protection for the connector.""" + deletion_protection_threshold: int = ... + """ + The threshold is the maximum percentage of documents that a sync job can + delete from your index. If a sync would delete more than this + percentage, the sync skips its delete phase, leaving your indexed + documents in place. Not supported for the Custom connector. + """ + +@dataclass(kw_only=True) +class DisassociateAgentCollaboratorInput(_SerdeShape): + """Dataclass for DisassociateAgentCollaboratorInput structure.""" + + agent_id: str | None = ... + """An agent ID.""" + agent_version: str | None = ... + """The agent's version.""" + collaborator_id: str | None = ... + """The collaborator's ID.""" + +@dataclass(kw_only=True) +class DisassociateAgentCollaboratorOutput(_SerdeShape): + """Dataclass for DisassociateAgentCollaboratorOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DisassociateAgentKnowledgeBaseInput(_SerdeShape): + """Dataclass for DisassociateAgentKnowledgeBaseInput structure.""" + + agent_id: str | None = ... + """ + The unique identifier of the agent from which to disassociate the + knowledge base. + """ + agent_version: str | None = ... + """The version of the agent from which to disassociate the knowledge base.""" + knowledge_base_id: str | None = ... + """The unique identifier of the knowledge base to disassociate.""" + +@dataclass(kw_only=True) +class DisassociateAgentKnowledgeBaseOutput(_SerdeShape): + """Dataclass for DisassociateAgentKnowledgeBaseOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DocumentAccessControlEntry(_SerdeShape): + """An access control entry specifying a principal and their access level.""" + + name: str + """The user identifier.""" + type: str + """The type of principal.""" + access: str + """Whether to allow or deny access.""" + +@dataclass(kw_only=True) +class DocumentContent(_SerdeShape): + """ + Contains information about the content of a document. Choose a + `dataSourceType` and include the field that corresponds to it. + """ + + data_source_type: str + """ + The type of data source that is connected to the knowledge base to which + to ingest this document. + """ + custom: CustomContent | None = ... + """ + Contains information about the content to ingest into a knowledge base + connected to a custom data source. + """ + s3: S3Content | None = ... + """ + Contains information about the content to ingest into a knowledge base + connected to an Amazon S3 data source + """ + +@dataclass(kw_only=True) +class DocumentIdentifier(_SerdeShape): + """Contains information that identifies the document.""" + + data_source_type: str + """ + The type of data source connected to the knowledge base that contains + the document. + """ + s3: S3Location | None = ... + """Contains information that identifies the document in an S3 data source.""" + custom: CustomDocumentIdentifier | None = ... + """ + Contains information that identifies the document in a custom data + source. + """ + +@dataclass(kw_only=True) +class DocumentMetadata(_SerdeShape): + """ + Contains information about the metadata associate with the content to + ingest into a knowledge base. Choose a `type` and include the field that + corresponds to it. + """ + + type: str + """The type of the source source from which to add metadata.""" + inline_attributes: list[MetadataAttribute] | None = ... + """ + An array of objects, each of which defines a metadata attribute to + associate with the content to ingest. You define the attributes inline. + """ + s3_location: CustomS3Location | None = ... + """ + The Amazon S3 location of the file containing metadata to associate with + the content to ingest. + """ + access_control_list: list[DocumentAccessControlEntry] | None = ... + """ + Access control list for the document. Used when metadata type is + IN_LINE_ATTRIBUTE. + """ + +class DocumentStatus(UnknownEnumMixin, StrEnum): + INDEXED = "INDEXED" + PARTIALLY_INDEXED = "PARTIALLY_INDEXED" + PENDING = "PENDING" + FAILED = "FAILED" + METADATA_PARTIALLY_INDEXED = "METADATA_PARTIALLY_INDEXED" + METADATA_UPDATE_FAILED = "METADATA_UPDATE_FAILED" + IGNORED = "IGNORED" + NOT_FOUND = "NOT_FOUND" + STARTING = "STARTING" + IN_PROGRESS = "IN_PROGRESS" + DELETING = "DELETING" + DELETE_IN_PROGRESS = "DELETE_IN_PROGRESS" + +@dataclass(kw_only=True) +class DuplicateConditionExpressionFlowValidationDetails(_SerdeShape): + """Details about duplicate condition expressions found in a condition node.""" + + node: str + """The name of the node containing the duplicate condition expressions.""" + expression: str + """The duplicated condition expression.""" + +@dataclass(kw_only=True) +class DuplicateConnectionsFlowValidationDetails(_SerdeShape): + """Details about duplicate connections found between two nodes in the flow.""" + + source: str + """The name of the source node where the duplicate connection starts.""" + target: str + """The name of the target node where the duplicate connection ends.""" + +class EmbeddingDataType(UnknownEnumMixin, StrEnum): + """Bedrock models embedding data type. Can be either float32 or binary.""" + + FLOAT32 = "FLOAT32" + BINARY = "BINARY" + +@dataclass(kw_only=True) +class EmbeddingModelConfiguration(_SerdeShape): + """The configuration details for the embeddings model.""" + + bedrock_embedding_model_configuration: ( + BedrockEmbeddingModelConfiguration | None + ) = ... + """The vector configuration details on the Bedrock embeddings model.""" + +class EmbeddingModelType(UnknownEnumMixin, StrEnum): + """ + Choose `CUSTOM` to provide your own Bedrock embedding model ARN. Choose + `MANAGED` to use a service-managed embedding model. For more + information, see [Embedding model + options](https://docs.aws.amazon.com/bedrock/latest/userguide/kb-managed-create.html#kb-managed-embedding-models). + """ + + CUSTOM = "CUSTOM" + MANAGED = "MANAGED" + +class EnabledOrDisabledState(UnknownEnumMixin, StrEnum): + ENABLED = "ENABLED" + DISABLED = "DISABLED" + +@dataclass(kw_only=True) +class EnrichmentStrategyConfiguration(_SerdeShape): + """The strategy used for performing context enrichment.""" + + method: str + """The method used for the context enrichment strategy.""" + +class EnrichmentStrategyMethod(UnknownEnumMixin, StrEnum): + CHUNK_ENTITY_EXTRACTION = "CHUNK_ENTITY_EXTRACTION" + +@dataclass(kw_only=True) +class FieldForReranking(_SerdeShape): + """ + Specifies a metadata field to include or exclude during the reranking + process. + """ + + field_name: str + """The name of the metadata field to include or exclude during reranking.""" + +@dataclass(kw_only=True) +class FixedSizeChunkingConfiguration(_SerdeShape): + """ + Configurations for when you choose fixed-size chunking. If you set the + `chunkingStrategy` as `NONE`, exclude this field. + """ + + max_tokens: int + """The maximum number of tokens to include in a chunk.""" + overlap_percentage: int + """The percentage of overlap between adjacent chunks of a data source.""" + +@dataclass(kw_only=True) +class FlowAliasConcurrencyConfiguration(_SerdeShape): + """ + Determines how multiple nodes in a flow can run in parallel. Running + nodes concurrently can improve your flow's performance. + """ + + type: str + """ + The type of concurrency to use for parallel node execution. Specify one + of the following options: + + - `Automatic` - Amazon Bedrock determines which nodes can be executed in + parallel based on the flow definition and its dependencies. + + - `Manual` - You specify which nodes can be executed in parallel. + """ + max_concurrency: int | None = ... + """ + The maximum number of nodes that can be executed concurrently in the + flow. + """ + +@dataclass(kw_only=True) +class FlowAliasRoutingConfigurationListItem(_SerdeShape): + """Contains information about a version that the alias maps to.""" + + flow_version: str | None = ... + """The version that the alias maps to.""" + +@dataclass(kw_only=True) +class FlowAliasSummary(_SerdeShape): + """ + Contains information about an alias of a flow. + + This data type is used in the following API operations: + + - [ListFlowAliases + response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_ListFlowAliases.html#API_agent_ListFlowAliases_ResponseSyntax) + """ + + name: str + """The name of the alias.""" + description: str | None = ... + """A description of the alias.""" + routing_configuration: list[FlowAliasRoutingConfigurationListItem] + """ + A list of configurations about the versions that the alias maps to. + Currently, you can only specify one. + """ + concurrency_configuration: FlowAliasConcurrencyConfiguration | None = ... + """ + The configuration that specifies how nodes in the flow are executed + concurrently. + """ + flow_id: str + """The unique identifier of the flow.""" + id: str + """The unique identifier of the alias of the flow.""" + arn: str + """The Amazon Resource Name (ARN) of the alias.""" + created_at: datetime + """The time at which the alias was created.""" + updated_at: datetime + """The time at which the alias was last updated.""" + +@dataclass(kw_only=True) +class FlowCondition(_SerdeShape): + """Defines a condition in the condition node.""" + + name: str + """A name for the condition that you can reference.""" + expression: str | None = ... + """ + Defines the condition. You must refer to at least one of the inputs in + the condition. For more information, expand the Condition node section + in [Node types in prompt + flows](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-how-it-works.html#flows-nodes). + """ + +@dataclass(kw_only=True) +class FlowConditionalConnectionConfiguration(_SerdeShape): + """ + The configuration of a connection between a condition node and another + node. + """ + + condition: str + """ + The condition that triggers this connection. For more information about + how to write conditions, see the **Condition** node type in the [Node + types](https://docs.aws.amazon.com/bedrock/latest/userguide/node-types.html) + topic in the Amazon Bedrock User Guide. + """ + +@dataclass(kw_only=True) +class FlowConnection(_SerdeShape): + """Contains information about a connection between two nodes in the flow.""" + + type: str + """ + Whether the source node that the connection begins from is a condition + node (`Conditional`) or not (`Data`). + """ + name: str + """A name for the connection that you can reference.""" + source: str + """The node that the connection starts at.""" + target: str + """The node that the connection ends at.""" + configuration: FlowConnectionConfiguration | None = ... + """The configuration of the connection.""" + +@dataclass +class FlowConnectionConfigurationData(_SerdeShape): + """ + The configuration of a connection originating from a node that isn't a + Condition node. + """ + + value: FlowDataConnectionConfiguration + +@dataclass +class FlowConnectionConfigurationConditional(_SerdeShape): + """The configuration of a connection originating from a Condition node.""" + + value: FlowConditionalConnectionConfiguration + +@dataclass +class FlowConnectionConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +FlowConnectionConfiguration = Union[ + FlowConnectionConfigurationData + | FlowConnectionConfigurationConditional + | FlowConnectionConfigurationUnknown +] +"""The configuration of the connection.""" + +class _FlowConnectionConfigurationDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> FlowConnectionConfiguration: ... + +class FlowConnectionType(UnknownEnumMixin, StrEnum): + DATA = "Data" + CONDITIONAL = "Conditional" + +@dataclass(kw_only=True) +class FlowDataConnectionConfiguration(_SerdeShape): + """ + The configuration of a connection originating from a node that isn't a + Condition node. + """ + + source_output: str + """ + The name of the output in the source node that the connection begins + from. + """ + target_input: str + """The name of the input in the target node that the connection ends at.""" + +@dataclass(kw_only=True) +class FlowDefinition(_SerdeShape): + """The definition of the nodes and connections between nodes in the flow.""" + + nodes: list[FlowNode] | None = ... + """An array of node definitions in the flow.""" + connections: list[FlowConnection] | None = ... + """An array of connection definitions in the flow.""" + +@dataclass(kw_only=True) +class FlowNode(_SerdeShape): + """Contains configurations about a node in the flow.""" + + name: str + """A name for the node.""" + type: str + """ + The type of node. This value must match the name of the key that you + provide in the configuration you provide in the `FlowNodeConfiguration` + field. + """ + configuration: FlowNodeConfiguration | None = ... + """Contains configurations for the node.""" + inputs: list[FlowNodeInput] | None = ... + """ + An array of objects, each of which contains information about an input + into the node. + """ + outputs: list[FlowNodeOutput] | None = ... + """ + A list of objects, each of which contains information about an output + from the node. + """ + +@dataclass +class FlowNodeConfigurationInput(_SerdeShape): + """ + Contains configurations for an input flow node in your flow. The first + node in the flow. `inputs` can't be specified for this node. + """ + + value: InputFlowNodeConfiguration + +@dataclass +class FlowNodeConfigurationOutput(_SerdeShape): + """ + Contains configurations for an output flow node in your flow. The last + node in the flow. `outputs` can't be specified for this node. + """ + + value: OutputFlowNodeConfiguration + +@dataclass +class FlowNodeConfigurationKnowledgeBase(_SerdeShape): + """ + Contains configurations for a knowledge base node in your flow. Queries + a knowledge base and returns the retrieved results or generated + response. + """ + + value: KnowledgeBaseFlowNodeConfiguration + +@dataclass +class FlowNodeConfigurationCondition(_SerdeShape): + """ + Contains configurations for a condition node in your flow. Defines + conditions that lead to different branches of the flow. + """ + + value: ConditionFlowNodeConfiguration + +@dataclass +class FlowNodeConfigurationLex(_SerdeShape): + """ + Contains configurations for a Lex node in your flow. Invokes an Amazon + Lex bot to identify the intent of the input and return the intent as the + output. + """ + + value: LexFlowNodeConfiguration + +@dataclass +class FlowNodeConfigurationPrompt(_SerdeShape): + """ + Contains configurations for a prompt node in your flow. Runs a prompt + and generates the model response as the output. You can use a prompt + from Prompt management or you can configure one in this node. + """ + + value: PromptFlowNodeConfiguration + +@dataclass +class FlowNodeConfigurationLambdaFunction(_SerdeShape): + """ + Contains configurations for a Lambda function node in your flow. Invokes + an Lambda function. + """ + + value: LambdaFunctionFlowNodeConfiguration + +@dataclass +class FlowNodeConfigurationStorage(_SerdeShape): + """ + Contains configurations for a storage node in your flow. Stores an input + in an Amazon S3 location. + """ + + value: StorageFlowNodeConfiguration + +@dataclass +class FlowNodeConfigurationAgent(_SerdeShape): + """ + Contains configurations for an agent node in your flow. Invokes an alias + of an agent and returns the response. + """ + + value: AgentFlowNodeConfiguration + +@dataclass +class FlowNodeConfigurationRetrieval(_SerdeShape): + """ + Contains configurations for a retrieval node in your flow. Retrieves + data from an Amazon S3 location and returns it as the output. + """ + + value: RetrievalFlowNodeConfiguration + +@dataclass +class FlowNodeConfigurationIterator(_SerdeShape): + """ + Contains configurations for an iterator node in your flow. Takes an + input that is an array and iteratively sends each item of the array as + an output to the following node. The size of the array is also returned + in the output. + + The output flow node at the end of the flow iteration will return a + response for each member of the array. To return only one response, you + can include a collector node downstream from the iterator node. + """ + + value: IteratorFlowNodeConfiguration + +@dataclass +class FlowNodeConfigurationCollector(_SerdeShape): + """ + Contains configurations for a collector node in your flow. Collects an + iteration of inputs and consolidates them into an array of outputs. + """ + + value: CollectorFlowNodeConfiguration + +@dataclass +class FlowNodeConfigurationInlineCode(_SerdeShape): + """ + Contains configurations for an inline code node in your flow. Inline + code nodes let you write and execute code directly within your flow, + enabling data transformations, custom logic, and integrations without + needing an external Lambda function. + """ + + value: InlineCodeFlowNodeConfiguration + +@dataclass +class FlowNodeConfigurationLoop(_SerdeShape): + """Contains configurations for a DoWhile loop in your flow.""" + + value: LoopFlowNodeConfiguration + +@dataclass +class FlowNodeConfigurationLoopInput(_SerdeShape): + """Contains input node configurations for a DoWhile loop in your flow.""" + + value: LoopInputFlowNodeConfiguration + +@dataclass +class FlowNodeConfigurationLoopController(_SerdeShape): + """Contains controller node configurations for a DoWhile loop in your flow.""" + + value: LoopControllerFlowNodeConfiguration + +@dataclass +class FlowNodeConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +FlowNodeConfiguration = Union[ + FlowNodeConfigurationInput + | FlowNodeConfigurationOutput + | FlowNodeConfigurationKnowledgeBase + | FlowNodeConfigurationCondition + | FlowNodeConfigurationLex + | FlowNodeConfigurationPrompt + | FlowNodeConfigurationLambdaFunction + | FlowNodeConfigurationStorage + | FlowNodeConfigurationAgent + | FlowNodeConfigurationRetrieval + | FlowNodeConfigurationIterator + | FlowNodeConfigurationCollector + | FlowNodeConfigurationInlineCode + | FlowNodeConfigurationLoop + | FlowNodeConfigurationLoopInput + | FlowNodeConfigurationLoopController + | FlowNodeConfigurationUnknown +] +""" +Contains configurations for a node in your flow. For more information, +see [Node types in a +flow](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-nodes.html) +in the Amazon Bedrock User Guide. +""" + +class _FlowNodeConfigurationDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> FlowNodeConfiguration: ... + +@dataclass(kw_only=True) +class FlowNodeInput(_SerdeShape): + """Contains configurations for an input in an Amazon Bedrock Flows node.""" + + name: str + """Specifies a name for the input that you can reference.""" + type: str + """ + Specifies the data type of the input. If the input doesn't match this + type at runtime, a validation error will be thrown. + """ + expression: str + """ + An expression that formats the input for the node. For an explanation of + how to create expressions, see [Expressions in Prompt flows in Amazon + Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-expressions.html). + """ + category: str | None = ... + """ + Specifies how input data flows between iterations in a DoWhile loop. + + - `LoopCondition` - Controls whether the loop continues by evaluating + condition expressions against the input data. Use this category to + define the condition that determines if the loop should continue. + + - `ReturnValueToLoopStart` - Defines data to pass back to the start of + the loop's next iteration. Use this category for variables that you + want to update for each loop iteration. + + - `ExitLoop` - Defines the value that's available once the loop ends. + Use this category to expose loop results to nodes outside the loop. + """ + +class FlowNodeInputCategory(UnknownEnumMixin, StrEnum): + LOOP_CONDITION = "LoopCondition" + RETURN_VALUE_TO_LOOP_START = "ReturnValueToLoopStart" + EXIT_LOOP = "ExitLoop" + +class FlowNodeIODataType(UnknownEnumMixin, StrEnum): + STRING = "String" + NUMBER = "Number" + BOOLEAN = "Boolean" + OBJECT = "Object" + ARRAY = "Array" + +@dataclass(kw_only=True) +class FlowNodeOutput(_SerdeShape): + """Contains configurations for an output from a node.""" + + name: str + """A name for the output that you can reference.""" + type: str + """ + The data type of the output. If the output doesn't match this type at + runtime, a validation error will be thrown. + """ + +class FlowNodeType(UnknownEnumMixin, StrEnum): + INPUT = "Input" + OUTPUT = "Output" + KNOWLEDGE_BASE = "KnowledgeBase" + CONDITION = "Condition" + LEX = "Lex" + PROMPT = "Prompt" + LAMBDA_FUNCTION = "LambdaFunction" + STORAGE = "Storage" + AGENT = "Agent" + RETRIEVAL = "Retrieval" + ITERATOR = "Iterator" + COLLECTOR = "Collector" + INLINE_CODE = "InlineCode" + LOOP = "Loop" + LOOP_INPUT = "LoopInput" + LOOP_CONTROLLER = "LoopController" + +class FlowStatus(UnknownEnumMixin, StrEnum): + FAILED = "Failed" + PREPARED = "Prepared" + PREPARING = "Preparing" + NOT_PREPARED = "NotPrepared" + +@dataclass(kw_only=True) +class FlowSummary(_SerdeShape): + """Contains the definition of a flow.""" + + name: str + """The name of the flow.""" + description: str | None = ... + """A description of the flow.""" + id: str + """The unique identifier of the flow.""" + arn: str + """The Amazon Resource Name (ARN) of the flow.""" + status: str + """ + The status of the flow. The following statuses are possible: + + - NotPrepared -- The flow has been created or updated, but hasn't been + prepared. If you just created the flow, you can't test it. If you + updated the flow, the `DRAFT` version won't contain the latest + changes for testing. Send a + [PrepareFlow](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PrepareFlow.html) + request to package the latest changes into the `DRAFT` version. + + - Preparing -- The flow is being prepared so that the `DRAFT` version + contains the latest changes for testing. + + - Prepared -- The flow is prepared and the `DRAFT` version contains the + latest changes for testing. + + - Failed -- The last API operation that you invoked on the flow failed. + Send a + [GetFlow](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_GetFlow.html) + request and check the error message in the `validations` field. + """ + created_at: datetime + """The time at which the flow was created.""" + updated_at: datetime + """The time at which the flow was last updated.""" + version: str + """The latest version of the flow.""" + +@dataclass(kw_only=True) +class FlowValidation(_SerdeShape): + """ + Contains information about validation of the flow. + + This data type is used in the following API operations: + + - [GetFlow + response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_GetFlow.html#API_agent_GetFlow_ResponseSyntax) + + - [GetFlowVersion + response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_GetFlowVersion.html#API_agent_GetFlowVersion_ResponseSyntax) + """ + + message: str + """A message describing the validation error.""" + severity: str + """The severity of the issue described in the message.""" + details: FlowValidationDetails | None = ... + """Specific details about the validation issue encountered in the flow.""" + type: str | None = ... + """The type of validation issue encountered in the flow.""" + +@dataclass +class FlowValidationDetailsCyclicConnection(_SerdeShape): + """Details about a cyclic connection in the flow.""" + + value: CyclicConnectionFlowValidationDetails + +@dataclass +class FlowValidationDetailsDuplicateConnections(_SerdeShape): + """Details about duplicate connections between nodes.""" + + value: DuplicateConnectionsFlowValidationDetails + +@dataclass +class FlowValidationDetailsDuplicateConditionExpression(_SerdeShape): + """Details about duplicate condition expressions in a node.""" + + value: DuplicateConditionExpressionFlowValidationDetails + +@dataclass +class FlowValidationDetailsUnreachableNode(_SerdeShape): + """Details about an unreachable node in the flow.""" + + value: UnreachableNodeFlowValidationDetails + +@dataclass +class FlowValidationDetailsUnknownConnectionSource(_SerdeShape): + """Details about an unknown source node for a connection.""" + + value: UnknownConnectionSourceFlowValidationDetails + +@dataclass +class FlowValidationDetailsUnknownConnectionSourceOutput(_SerdeShape): + """Details about an unknown source output for a connection.""" + + value: UnknownConnectionSourceOutputFlowValidationDetails + +@dataclass +class FlowValidationDetailsUnknownConnectionTarget(_SerdeShape): + """Details about an unknown target node for a connection.""" + + value: UnknownConnectionTargetFlowValidationDetails + +@dataclass +class FlowValidationDetailsUnknownConnectionTargetInput(_SerdeShape): + """Details about an unknown target input for a connection.""" + + value: UnknownConnectionTargetInputFlowValidationDetails + +@dataclass +class FlowValidationDetailsUnknownConnectionCondition(_SerdeShape): + """Details about an unknown condition for a connection.""" + + value: UnknownConnectionConditionFlowValidationDetails + +@dataclass +class FlowValidationDetailsMalformedConditionExpression(_SerdeShape): + """Details about a malformed condition expression in a node.""" + + value: MalformedConditionExpressionFlowValidationDetails + +@dataclass +class FlowValidationDetailsMalformedNodeInputExpression(_SerdeShape): + """Details about a malformed input expression in a node.""" + + value: MalformedNodeInputExpressionFlowValidationDetails + +@dataclass +class FlowValidationDetailsMismatchedNodeInputType(_SerdeShape): + """Details about mismatched input data types in a node.""" + + value: MismatchedNodeInputTypeFlowValidationDetails + +@dataclass +class FlowValidationDetailsMismatchedNodeOutputType(_SerdeShape): + """Details about mismatched output data types in a node.""" + + value: MismatchedNodeOutputTypeFlowValidationDetails + +@dataclass +class FlowValidationDetailsIncompatibleConnectionDataType(_SerdeShape): + """Details about incompatible data types in a connection.""" + + value: IncompatibleConnectionDataTypeFlowValidationDetails + +@dataclass +class FlowValidationDetailsMissingConnectionConfiguration(_SerdeShape): + """Details about missing configuration for a connection.""" + + value: MissingConnectionConfigurationFlowValidationDetails + +@dataclass +class FlowValidationDetailsMissingDefaultCondition(_SerdeShape): + """Details about a missing default condition in a conditional node.""" + + value: MissingDefaultConditionFlowValidationDetails + +@dataclass +class FlowValidationDetailsMissingEndingNodes(_SerdeShape): + """Details about missing ending nodes in the flow.""" + + value: MissingEndingNodesFlowValidationDetails + +@dataclass +class FlowValidationDetailsMissingNodeConfiguration(_SerdeShape): + """Details about missing configuration for a node.""" + + value: MissingNodeConfigurationFlowValidationDetails + +@dataclass +class FlowValidationDetailsMissingNodeInput(_SerdeShape): + """Details about a missing required input in a node.""" + + value: MissingNodeInputFlowValidationDetails + +@dataclass +class FlowValidationDetailsMissingNodeOutput(_SerdeShape): + """Details about a missing required output in a node.""" + + value: MissingNodeOutputFlowValidationDetails + +@dataclass +class FlowValidationDetailsMissingStartingNodes(_SerdeShape): + """Details about missing starting nodes in the flow.""" + + value: MissingStartingNodesFlowValidationDetails + +@dataclass +class FlowValidationDetailsMultipleNodeInputConnections(_SerdeShape): + """Details about multiple connections to a single node input.""" + + value: MultipleNodeInputConnectionsFlowValidationDetails + +@dataclass +class FlowValidationDetailsUnfulfilledNodeInput(_SerdeShape): + """Details about an unfulfilled node input with no valid connections.""" + + value: UnfulfilledNodeInputFlowValidationDetails + +@dataclass +class FlowValidationDetailsUnsatisfiedConnectionConditions(_SerdeShape): + """Details about unsatisfied conditions for a connection.""" + + value: UnsatisfiedConnectionConditionsFlowValidationDetails + +@dataclass +class FlowValidationDetailsUnspecified(_SerdeShape): + """Details about an unspecified validation.""" + + value: UnspecifiedFlowValidationDetails + +@dataclass +class FlowValidationDetailsUnknownNodeInput(_SerdeShape): + """Details about an unknown input for a node.""" + + value: UnknownNodeInputFlowValidationDetails + +@dataclass +class FlowValidationDetailsUnknownNodeOutput(_SerdeShape): + """Details about an unknown output for a node.""" + + value: UnknownNodeOutputFlowValidationDetails + +@dataclass +class FlowValidationDetailsMissingLoopInputNode(_SerdeShape): + """ + Details about a flow that's missing a required `LoopInput` node in a + DoWhile loop. + """ + + value: MissingLoopInputNodeFlowValidationDetails + +@dataclass +class FlowValidationDetailsMissingLoopControllerNode(_SerdeShape): + """ + Details about a flow that's missing a required `LoopController` node in + a DoWhile loop. + """ + + value: MissingLoopControllerNodeFlowValidationDetails + +@dataclass +class FlowValidationDetailsMultipleLoopInputNodes(_SerdeShape): + """ + Details about a flow that contains multiple `LoopInput` nodes in a + DoWhile loop. + """ + + value: MultipleLoopInputNodesFlowValidationDetails + +@dataclass +class FlowValidationDetailsMultipleLoopControllerNodes(_SerdeShape): + """ + Details about a flow that contains multiple `LoopController` nodes in a + DoWhile loop. + """ + + value: MultipleLoopControllerNodesFlowValidationDetails + +@dataclass +class FlowValidationDetailsLoopIncompatibleNodeType(_SerdeShape): + """ + Details about a flow that includes incompatible node types in a DoWhile + loop. + """ + + value: LoopIncompatibleNodeTypeFlowValidationDetails + +@dataclass +class FlowValidationDetailsInvalidLoopBoundary(_SerdeShape): + """ + Details about a flow that includes connections that violate loop + boundary rules. + """ + + value: InvalidLoopBoundaryFlowValidationDetails + +@dataclass +class FlowValidationDetailsUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +FlowValidationDetails = Union[ + FlowValidationDetailsCyclicConnection + | FlowValidationDetailsDuplicateConnections + | FlowValidationDetailsDuplicateConditionExpression + | FlowValidationDetailsUnreachableNode + | FlowValidationDetailsUnknownConnectionSource + | FlowValidationDetailsUnknownConnectionSourceOutput + | FlowValidationDetailsUnknownConnectionTarget + | FlowValidationDetailsUnknownConnectionTargetInput + | FlowValidationDetailsUnknownConnectionCondition + | FlowValidationDetailsMalformedConditionExpression + | FlowValidationDetailsMalformedNodeInputExpression + | FlowValidationDetailsMismatchedNodeInputType + | FlowValidationDetailsMismatchedNodeOutputType + | FlowValidationDetailsIncompatibleConnectionDataType + | FlowValidationDetailsMissingConnectionConfiguration + | FlowValidationDetailsMissingDefaultCondition + | FlowValidationDetailsMissingEndingNodes + | FlowValidationDetailsMissingNodeConfiguration + | FlowValidationDetailsMissingNodeInput + | FlowValidationDetailsMissingNodeOutput + | FlowValidationDetailsMissingStartingNodes + | FlowValidationDetailsMultipleNodeInputConnections + | FlowValidationDetailsUnfulfilledNodeInput + | FlowValidationDetailsUnsatisfiedConnectionConditions + | FlowValidationDetailsUnspecified + | FlowValidationDetailsUnknownNodeInput + | FlowValidationDetailsUnknownNodeOutput + | FlowValidationDetailsMissingLoopInputNode + | FlowValidationDetailsMissingLoopControllerNode + | FlowValidationDetailsMultipleLoopInputNodes + | FlowValidationDetailsMultipleLoopControllerNodes + | FlowValidationDetailsLoopIncompatibleNodeType + | FlowValidationDetailsInvalidLoopBoundary + | FlowValidationDetailsUnknown +] +"""A union type containing various possible validation issues in the flow.""" + +class _FlowValidationDetailsDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> FlowValidationDetails: ... + +class FlowValidationSeverity(UnknownEnumMixin, StrEnum): + WARNING = "Warning" + ERROR = "Error" + +class FlowValidationType(UnknownEnumMixin, StrEnum): + CYCLIC_CONNECTION = "CyclicConnection" + DUPLICATE_CONNECTIONS = "DuplicateConnections" + DUPLICATE_CONDITION_EXPRESSION = "DuplicateConditionExpression" + UNREACHABLE_NODE = "UnreachableNode" + UNKNOWN_CONNECTION_SOURCE = "UnknownConnectionSource" + UNKNOWN_CONNECTION_SOURCE_OUTPUT = "UnknownConnectionSourceOutput" + UNKNOWN_CONNECTION_TARGET = "UnknownConnectionTarget" + UNKNOWN_CONNECTION_TARGET_INPUT = "UnknownConnectionTargetInput" + UNKNOWN_CONNECTION_CONDITION = "UnknownConnectionCondition" + MALFORMED_CONDITION_EXPRESSION = "MalformedConditionExpression" + MALFORMED_NODE_INPUT_EXPRESSION = "MalformedNodeInputExpression" + MISMATCHED_NODE_INPUT_TYPE = "MismatchedNodeInputType" + MISMATCHED_NODE_OUTPUT_TYPE = "MismatchedNodeOutputType" + INCOMPATIBLE_CONNECTION_DATA_TYPE = "IncompatibleConnectionDataType" + MISSING_CONNECTION_CONFIGURATION = "MissingConnectionConfiguration" + MISSING_DEFAULT_CONDITION = "MissingDefaultCondition" + MISSING_ENDING_NODES = "MissingEndingNodes" + MISSING_NODE_CONFIGURATION = "MissingNodeConfiguration" + MISSING_NODE_INPUT = "MissingNodeInput" + MISSING_NODE_OUTPUT = "MissingNodeOutput" + MISSING_STARTING_NODES = "MissingStartingNodes" + MULTIPLE_NODE_INPUT_CONNECTIONS = "MultipleNodeInputConnections" + UNFULFILLED_NODE_INPUT = "UnfulfilledNodeInput" + UNSATISFIED_CONNECTION_CONDITIONS = "UnsatisfiedConnectionConditions" + UNSPECIFIED = "Unspecified" + UNKNOWN_NODE_INPUT = "UnknownNodeInput" + UNKNOWN_NODE_OUTPUT = "UnknownNodeOutput" + MISSING_LOOP_INPUT_NODE = "MissingLoopInputNode" + MISSING_LOOP_CONTROLLER_NODE = "MissingLoopControllerNode" + MULTIPLE_LOOP_INPUT_NODES = "MultipleLoopInputNodes" + MULTIPLE_LOOP_CONTROLLER_NODES = "MultipleLoopControllerNodes" + LOOP_INCOMPATIBLE_NODE_TYPE = "LoopIncompatibleNodeType" + INVALID_LOOP_BOUNDARY = "InvalidLoopBoundary" + +@dataclass(kw_only=True) +class FlowVersionSummary(_SerdeShape): + """ + Contains information about a version of a flow. + + This data type is used in the following API operations: + + - [ListFlowVersions + response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_ListFlowVersions.html#API_agent_ListFlowVersions_ResponseSyntax) + """ + + id: str + """The unique identifier of the flow.""" + arn: str + """The Amazon Resource Name (ARN) of the flow that the version belongs to.""" + status: str + """The status of the flow.""" + created_at: datetime + """The time at the version was created.""" + version: str + """The version of the flow.""" + +@dataclass(kw_only=True) +class Function(_SerdeShape): + """ + Defines parameters that the agent needs to invoke from the user to + complete the function. Corresponds to an action in an action group. + + This data type is used in the following API operations: + + - [CreateAgentActionGroup + request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_CreateAgentActionGroup.html#API_agent_CreateAgentActionGroup_RequestSyntax) + + - [CreateAgentActionGroup + response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_CreateAgentActionGroup.html#API_agent_CreateAgentActionGroup_ResponseSyntax) + + - [UpdateAgentActionGroup + request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_UpdateAgentActionGroup.html#API_agent_UpdateAgentActionGroup_RequestSyntax) + + - [UpdateAgentActionGroup + response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_UpdateAgentActionGroup.html#API_agent_UpdateAgentActionGroup_ResponseSyntax) + + - [GetAgentActionGroup + response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_GetAgentActionGroup.html#API_agent_GetAgentActionGroup_ResponseSyntax) + """ + + name: str + """A name for the function.""" + description: str | None = ... + """A description of the function and its purpose.""" + parameters: dict[str, ParameterDetail] | None = ... + """ + The parameters that the agent elicits from the user to fulfill the + function. + """ + require_confirmation: str | None = ... + """ + Contains information if user confirmation is required to invoke the + function. + """ + +@dataclass +class FunctionSchemaFunctions(_SerdeShape): + """A list of functions that each define an action in the action group.""" + + value: list[Function] + +@dataclass +class FunctionSchemaUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +FunctionSchema = Union[FunctionSchemaFunctions | FunctionSchemaUnknown] +""" +Defines functions that each define parameters that the agent needs to +invoke from the user. Each function represents an action in an action +group. + +This data type is used in the following API operations: + +- [CreateAgentActionGroup + request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_CreateAgentActionGroup.html#API_agent_CreateAgentActionGroup_RequestSyntax) + +- [CreateAgentActionGroup + response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_CreateAgentActionGroup.html#API_agent_CreateAgentActionGroup_ResponseSyntax) + +- [UpdateAgentActionGroup + request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_UpdateAgentActionGroup.html#API_agent_UpdateAgentActionGroup_RequestSyntax) + +- [UpdateAgentActionGroup + response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_UpdateAgentActionGroup.html#API_agent_UpdateAgentActionGroup_ResponseSyntax) + +- [GetAgentActionGroup + response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_GetAgentActionGroup.html#API_agent_GetAgentActionGroup_ResponseSyntax) +""" + +class _FunctionSchemaDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> FunctionSchema: ... + +@dataclass(kw_only=True) +class GetAgentActionGroupInput(_SerdeShape): + """Dataclass for GetAgentActionGroupInput structure.""" + + agent_id: str | None = ... + """The unique identifier of the agent that the action group belongs to.""" + agent_version: str | None = ... + """The version of the agent that the action group belongs to.""" + action_group_id: str | None = ... + """The unique identifier of the action group for which to get information.""" + +@dataclass(kw_only=True) +class GetAgentActionGroupOutput(_SerdeShape): + """Dataclass for GetAgentActionGroupOutput structure.""" + + agent_action_group: AgentActionGroup + """Contains details about the action group.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetAgentAliasInput(_SerdeShape): + """Dataclass for GetAgentAliasInput structure.""" + + agent_id: str | None = ... + """ + The unique identifier of the agent to which the alias to get information + belongs. + """ + agent_alias_id: str | None = ... + """The unique identifier of the alias for which to get information.""" + +@dataclass(kw_only=True) +class GetAgentAliasOutput(_SerdeShape): + """Dataclass for GetAgentAliasOutput structure.""" + + agent_alias: AgentAlias + """Contains information about the alias.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetAgentCollaboratorInput(_SerdeShape): + """Dataclass for GetAgentCollaboratorInput structure.""" + + agent_id: str | None = ... + """The agent's ID.""" + agent_version: str | None = ... + """The agent's version.""" + collaborator_id: str | None = ... + """The collaborator's ID.""" + +@dataclass(kw_only=True) +class GetAgentCollaboratorOutput(_SerdeShape): + """Dataclass for GetAgentCollaboratorOutput structure.""" + + agent_collaborator: AgentCollaborator + """Details about the collaborator.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetAgentInput(_SerdeShape): + """Dataclass for GetAgentInput structure.""" + + agent_id: str | None = ... + """The unique identifier of the agent.""" + +@dataclass(kw_only=True) +class GetAgentKnowledgeBaseInput(_SerdeShape): + """Dataclass for GetAgentKnowledgeBaseInput structure.""" + + agent_id: str | None = ... + """ + The unique identifier of the agent with which the knowledge base is + associated. + """ + agent_version: str | None = ... + """The version of the agent with which the knowledge base is associated.""" + knowledge_base_id: str | None = ... + """The unique identifier of the knowledge base associated with the agent.""" + +@dataclass(kw_only=True) +class GetAgentKnowledgeBaseOutput(_SerdeShape): + """Dataclass for GetAgentKnowledgeBaseOutput structure.""" + + agent_knowledge_base: AgentKnowledgeBase + """Contains details about a knowledge base attached to an agent.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetAgentOutput(_SerdeShape): + """Dataclass for GetAgentOutput structure.""" + + agent: Agent + """Contains details about the agent.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetAgentVersionInput(_SerdeShape): + """Dataclass for GetAgentVersionInput structure.""" + + agent_id: str | None = ... + """The unique identifier of the agent.""" + agent_version: str | None = ... + """The version of the agent.""" + +@dataclass(kw_only=True) +class GetAgentVersionOutput(_SerdeShape): + """Dataclass for GetAgentVersionOutput structure.""" + + agent_version: AgentVersion + """Contains details about the version of the agent.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetDataSourceInput(_SerdeShape): + """Dataclass for GetDataSourceInput structure.""" + + knowledge_base_id: str | None = ... + """The unique identifier of the knowledge base for the data source.""" + data_source_id: str | None = ... + """The unique identifier of the data source.""" + +@dataclass(kw_only=True) +class GetDataSourceOutput(_SerdeShape): + """Dataclass for GetDataSourceOutput structure.""" + + data_source: DataSource + """Contains details about the data source.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetFlowAliasInput(_SerdeShape): + """Dataclass for GetFlowAliasInput structure.""" + + flow_identifier: str | None = ... + """The unique identifier of the flow that the alias belongs to.""" + alias_identifier: str | None = ... + """The unique identifier of the alias for which to retrieve information.""" + +@dataclass(kw_only=True) +class GetFlowAliasOutput(_SerdeShape): + """Dataclass for GetFlowAliasOutput structure.""" + + name: str + """The name of the alias.""" + description: str | None = ... + """The description of the flow.""" + routing_configuration: list[FlowAliasRoutingConfigurationListItem] + """Contains information about the version that the alias is mapped to.""" + concurrency_configuration: FlowAliasConcurrencyConfiguration | None = ... + """ + The configuration that specifies how nodes in the flow are executed in + parallel. + """ + flow_id: str + """The unique identifier of the flow that the alias belongs to.""" + id: str + """The unique identifier of the alias of the flow.""" + arn: str + """The Amazon Resource Name (ARN) of the flow.""" + created_at: datetime + """The time at which the flow was created.""" + updated_at: datetime + """The time at which the alias was last updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetFlowInput(_SerdeShape): + """Dataclass for GetFlowInput structure.""" + + flow_identifier: str | None = ... + """The unique identifier of the flow.""" + included_data: str | None = ... + """ + Controls the scope of data returned. Set to `METADATA_ONLY` to return + only resource metadata. Set to `ALL_DATA` or omit this field to return + the full response. + """ + +@dataclass(kw_only=True) +class GetFlowOutput(_SerdeShape): + """Dataclass for GetFlowOutput structure.""" + + name: str + """The name of the flow.""" + description: str | None = ... + """The description of the flow.""" + execution_role_arn: str + """ + The Amazon Resource Name (ARN) of the service role with permissions to + create a flow. For more information, see [Create a service row for + flows](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-permissions.html) + in the Amazon Bedrock User Guide. + """ + customer_encryption_key_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the KMS key that the flow is encrypted + with. + """ + id: str + """The unique identifier of the flow.""" + arn: str + """The Amazon Resource Name (ARN) of the flow.""" + status: str + """ + The status of the flow. The following statuses are possible: + + - NotPrepared -- The flow has been created or updated, but hasn't been + prepared. If you just created the flow, you can't test it. If you + updated the flow, the `DRAFT` version won't contain the latest + changes for testing. Send a + [PrepareFlow](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PrepareFlow.html) + request to package the latest changes into the `DRAFT` version. + + - Preparing -- The flow is being prepared so that the `DRAFT` version + contains the latest changes for testing. + + - Prepared -- The flow is prepared and the `DRAFT` version contains the + latest changes for testing. + + - Failed -- The last API operation that you invoked on the flow failed. + Send a + [GetFlow](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_GetFlow.html) + request and check the error message in the `validations` field. + """ + created_at: datetime + """The time at which the flow was created.""" + updated_at: datetime + """The time at which the flow was last updated.""" + version: str + """The version of the flow for which information was retrieved.""" + definition: FlowDefinition | None = ... + """ + The definition of the nodes and connections between the nodes in the + flow. + """ + validations: list[FlowValidation] | None = ... + """ + A list of validation error messages related to the last failed operation + on the flow. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetFlowVersionInput(_SerdeShape): + """Dataclass for GetFlowVersionInput structure.""" + + flow_identifier: str | None = ... + """The unique identifier of the flow for which to get information.""" + flow_version: str | None = ... + """The version of the flow for which to get information.""" + included_data: str | None = ... + """ + Controls the scope of data returned. Set to `METADATA_ONLY` to return + only resource metadata. Set to `ALL_DATA` or omit this field to return + the full response. + """ + +@dataclass(kw_only=True) +class GetFlowVersionOutput(_SerdeShape): + """Dataclass for GetFlowVersionOutput structure.""" + + name: str + """The name of the version.""" + description: str | None = ... + """The description of the flow.""" + execution_role_arn: str + """ + The Amazon Resource Name (ARN) of the service role with permissions to + create a flow. For more information, see [Create a service role for + flows in Amazon + Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-permissions.html) + in the Amazon Bedrock User Guide. + """ + customer_encryption_key_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the KMS key that the version of the + flow is encrypted with. + """ + id: str + """The unique identifier of the flow.""" + arn: str + """The Amazon Resource Name (ARN) of the flow.""" + status: str + """The status of the flow.""" + created_at: datetime + """The time at which the flow was created.""" + version: str + """The version of the flow for which information was retrieved.""" + definition: FlowDefinition | None = ... + """The definition of the nodes and connections between nodes in the flow.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetIngestionJobInput(_SerdeShape): + """Dataclass for GetIngestionJobInput structure.""" + + knowledge_base_id: str | None = ... + """ + The unique identifier of the knowledge base for the data ingestion job + you want to get information on. + """ + data_source_id: str | None = ... + """ + The unique identifier of the data source for the data ingestion job you + want to get information on. + """ + ingestion_job_id: str | None = ... + """ + The unique identifier of the data ingestion job you want to get + information on. + """ + +@dataclass(kw_only=True) +class GetIngestionJobOutput(_SerdeShape): + """Dataclass for GetIngestionJobOutput structure.""" + + ingestion_job: IngestionJob + """Contains details about the data ingestion job.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetKnowledgeBaseDocumentsInput(_SerdeShape): + """Dataclass for GetKnowledgeBaseDocumentsInput structure.""" + + knowledge_base_id: str | None = ... + """ + The unique identifier of the knowledge base that is connected to the + data source. + """ + data_source_id: str | None = ... + """The unique identifier of the data source that contains the documents.""" + document_identifiers: list[DocumentIdentifier] | None = ... + """ + A list of objects, each of which contains information to identify a + document for which to retrieve information. + """ + +@dataclass(kw_only=True) +class GetKnowledgeBaseDocumentsOutput(_SerdeShape): + """Dataclass for GetKnowledgeBaseDocumentsOutput structure.""" + + document_details: list[KnowledgeBaseDocumentDetail] | None = ... + """ + A list of objects, each of which contains information about the + documents that were retrieved. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetKnowledgeBaseInput(_SerdeShape): + """Dataclass for GetKnowledgeBaseInput structure.""" + + knowledge_base_id: str | None = ... + """ + The unique identifier of the knowledge base you want to get information + on. + """ + +@dataclass(kw_only=True) +class GetKnowledgeBaseOutput(_SerdeShape): + """Dataclass for GetKnowledgeBaseOutput structure.""" + + knowledge_base: KnowledgeBase + """Contains details about the knowledge base.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetPromptInput(_SerdeShape): + """Dataclass for GetPromptInput structure.""" + + prompt_identifier: str | None = ... + """The unique identifier of the prompt.""" + prompt_version: str | None = ... + """ + The version of the prompt about which you want to retrieve information. + Omit this field to return information about the working draft of the + prompt. + """ + included_data: str | None = ... + """ + Controls the scope of data returned. Set to `METADATA_ONLY` to return + only resource metadata. Set to `ALL_DATA` or omit this field to return + the full response. + """ + +@dataclass(kw_only=True) +class GetPromptOutput(_SerdeShape): + """Dataclass for GetPromptOutput structure.""" + + name: str + """The name of the prompt.""" + description: str | None = ... + """The descriptino of the prompt.""" + customer_encryption_key_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the KMS key that the prompt is + encrypted with. + """ + default_variant: str | None = ... + """ + The name of the default variant for the prompt. This value must match + the `name` field in the relevant + [PromptVariant](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptVariant.html) + object. + """ + variants: list[PromptVariant] | None = ... + """ + A list of objects, each containing details about a variant of the + prompt. + """ + id: str + """The unique identifier of the prompt.""" + arn: str + """ + The Amazon Resource Name (ARN) of the prompt or the prompt version (if + you specified a version in the request). + """ + version: str + """The version of the prompt.""" + created_at: datetime + """The time at which the prompt was created.""" + updated_at: datetime + """The time at which the prompt was last updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetResourcePolicyInput(_SerdeShape): + """Dataclass for GetResourcePolicyInput structure.""" + + resource_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the knowledge base to retrieve the + resource policy for. + """ + +@dataclass(kw_only=True) +class GetResourcePolicyOutput(_SerdeShape): + """Dataclass for GetResourcePolicyOutput structure.""" + + resource_arn: str + """ + The ARN of the knowledge base that the resource policy is associated + with. + """ + policy: str | JsonString + """The JSON-formatted resource policy associated with the knowledge base.""" + revision_id: str + """The revision identifier of the resource policy.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetVpcConfigurationInput(_SerdeShape): + """Dataclass for GetVpcConfigurationInput structure.""" + + knowledge_base_id: str | None = ... + """ + The unique identifier of the knowledge base that owns the VPC + configuration. + """ + vpc_configuration_id: str | None = ... + """The unique identifier of the VPC configuration to retrieve.""" + +@dataclass(kw_only=True) +class GetVpcConfigurationOutput(_SerdeShape): + """Dataclass for GetVpcConfigurationOutput structure.""" + + vpc_configuration: VpcConfiguration + """ + The VPC configuration, including its connection settings, resolution + mode, and current lifecycle status. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GuardrailConfiguration(_SerdeShape): + """Details about a guardrail associated with a resource.""" + + guardrail_identifier: str | None = ... + """The unique identifier of the guardrail.""" + guardrail_version: str | None = ... + """The version of the guardrail.""" + +@dataclass(kw_only=True) +class HierarchicalChunkingConfiguration(_SerdeShape): + """ + Settings for hierarchical document chunking for a data source. + Hierarchical chunking splits documents into layers of chunks where the + first layer contains large chunks, and the second layer contains smaller + chunks derived from the first layer. + + You configure the number of tokens to overlap, or repeat across adjacent + chunks. For example, if you set overlap tokens to 60, the last 60 tokens + in the first chunk are also included at the beginning of the second + chunk. For each layer, you must also configure the maximum number of + tokens in a chunk. + """ + + level_configurations: list[HierarchicalChunkingLevelConfiguration] + """Token settings for each layer.""" + overlap_tokens: int + """The number of tokens to repeat across chunks in the same layer.""" + +@dataclass(kw_only=True) +class HierarchicalChunkingLevelConfiguration(_SerdeShape): + """Token settings for a layer in a hierarchical chunking configuration.""" + + max_tokens: int + """The maximum number of tokens that a chunk can contain in this layer.""" + +@dataclass(kw_only=True) +class ImageExtractionConfiguration(_SerdeShape): + """Configuration for image extraction.""" + + image_extraction_status: str + """Whether image extraction is enabled or disabled.""" + +class IncludedData(UnknownEnumMixin, StrEnum): + ALL_DATA = "ALL_DATA" + METADATA_ONLY = "METADATA_ONLY" + +class IncludeExclude(UnknownEnumMixin, StrEnum): + INCLUDE = "INCLUDE" + EXCLUDE = "EXCLUDE" + +@dataclass(kw_only=True) +class IncompatibleConnectionDataTypeFlowValidationDetails(_SerdeShape): + """Details about incompatible data types in a connection between nodes.""" + + connection: str + """The name of the connection with incompatible data types.""" + +class IncompatibleLoopNodeType(UnknownEnumMixin, StrEnum): + INPUT = "Input" + CONDITION = "Condition" + ITERATOR = "Iterator" + COLLECTOR = "Collector" + +@dataclass(kw_only=True) +class InferenceConfiguration(_SerdeShape): + """ + Contains inference parameters to use when the agent invokes a foundation + model in the part of the agent sequence defined by the `promptType`. For + more information, see [Inference parameters for foundation + models](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). + """ + + temperature: float | None = ... + """ + The likelihood of the model selecting higher-probability options while + generating a response. A lower value makes the model more likely to + choose higher-probability options, while a higher value makes the model + more likely to choose lower-probability options. + """ + top_p: float | None = ... + """ + While generating a response, the model determines the probability of the + following token at each point of generation. The value that you set for + `Top P` determines the number of most-likely candidates from which the + model chooses the next token in the sequence. For example, if you set + `topP` to 0.8, the model only selects the next token from the top 80% of + the probability distribution of next tokens. + """ + top_k: int | None = ... + """ + While generating a response, the model determines the probability of the + following token at each point of generation. The value that you set for + `topK` is the number of most-likely candidates from which the model + chooses the next token in the sequence. For example, if you set `topK` + to 50, the model selects the next token from among the top 50 most + likely choices. + """ + maximum_length: int | None = ... + """The maximum number of tokens to allow in the generated response.""" + stop_sequences: list[str] | None = ... + """ + A list of stop sequences. A stop sequence is a sequence of characters + that causes the model to stop generating the response. + """ + +@dataclass(kw_only=True) +class IngestionJob(_SerdeShape): + """ + Contains details about a data ingestion job. Data sources are ingested + into a knowledge base so that Large Language Models (LLMs) can use your + data. + + This data type is used in the following API operations: + + - [StartIngestionJob + response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_StartIngestionJob.html#API_agent_StartIngestionJob_ResponseSyntax) + + - [GetIngestionJob + response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_GetIngestionJob.html#API_agent_GetIngestionJob_ResponseSyntax) + + - [ListIngestionJob + response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_ListIngestionJobs.html#API_agent_ListIngestionJobs_ResponseSyntax) + """ + + knowledge_base_id: str + """The unique identifier of the knowledge for the data ingestion job.""" + data_source_id: str + """The unique identifier of the data source for the data ingestion job.""" + ingestion_job_id: str + """The unique identifier of the data ingestion job.""" + description: str | None = ... + """The description of the data ingestion job.""" + status: str + """The status of the data ingestion job.""" + statistics: IngestionJobStatistics | None = ... + """Contains statistics about the data ingestion job.""" + failure_reasons: list[str] | None = ... + """A list of reasons that the data ingestion job failed.""" + started_at: datetime + """ + The time the data ingestion job started. + + If you stop a data ingestion job, the `startedAt` time is the time the + job was started before the job was stopped. + """ + updated_at: datetime + """ + The time the data ingestion job was last updated. + + If you stop a data ingestion job, the `updatedAt` time is the time the + job was stopped. + """ + text_ready_at: datetime | None = ... + """ + The time at which all text content in the data ingestion job finished + extraction and became available to query. + + This time isn't returned until text extraction is complete for all the + documents in the job. + """ + +@dataclass(kw_only=True) +class IngestionJobFilter(_SerdeShape): + """The definition of a filter to filter the data.""" + + attribute: str + """The name of field or attribute to apply the filter.""" + operator: str + """The operation to apply to the field or attribute.""" + values: list[str] + """A list of values that belong to the field or attribute.""" + +class IngestionJobFilterAttribute(UnknownEnumMixin, StrEnum): + STATUS = "STATUS" + +class IngestionJobFilterOperator(UnknownEnumMixin, StrEnum): + EQ = "EQ" + +@dataclass(kw_only=True) +class IngestionJobSortBy(_SerdeShape): + """The parameters of sorting the data.""" + + attribute: str + """The name of field or attribute to apply sorting of data.""" + order: str + """The order for sorting the data.""" + +class IngestionJobSortByAttribute(UnknownEnumMixin, StrEnum): + STATUS = "STATUS" + STARTED_AT = "STARTED_AT" + +@dataclass(kw_only=True) +class IngestionJobStatistics(_SerdeShape): + """Contains the statistics for the data ingestion job.""" + + number_of_documents_scanned: int = ... + """ + The total number of source documents that were scanned. Includes new, + updated, and unchanged documents. + """ + number_of_metadata_documents_scanned: int = ... + """ + The total number of metadata files that were scanned. Includes new, + updated, and unchanged files. + """ + number_of_new_documents_indexed: int = ... + """ + The number of new source documents in the data source that were + successfully indexed. + """ + number_of_modified_documents_indexed: int = ... + """ + The number of modified source documents in the data source that were + successfully indexed. + """ + number_of_metadata_documents_modified: int = ... + """The number of metadata files that were updated or deleted.""" + number_of_documents_deleted: int = ... + """The number of source documents that were deleted.""" + number_of_documents_failed: int = ... + """The number of source documents that failed to be ingested.""" + number_of_documents_skipped: int = ... + """The number of source documents that were skipped during ingestion.""" + +class IngestionJobStatus(UnknownEnumMixin, StrEnum): + STARTING = "STARTING" + IN_PROGRESS = "IN_PROGRESS" + COMPLETE = "COMPLETE" + FAILED = "FAILED" + STOPPING = "STOPPING" + STOPPED = "STOPPED" + +@dataclass(kw_only=True) +class IngestionJobSummary(_SerdeShape): + """Contains details about a data ingestion job.""" + + knowledge_base_id: str + """The unique identifier of the knowledge base for the data ingestion job.""" + data_source_id: str + """The unique identifier of the data source for the data ingestion job.""" + ingestion_job_id: str + """The unique identifier of the data ingestion job.""" + description: str | None = ... + """The description of the data ingestion job.""" + status: str + """The status of the data ingestion job.""" + started_at: datetime + """The time the data ingestion job started.""" + updated_at: datetime + """The time the data ingestion job was last updated.""" + text_ready_at: datetime | None = ... + """ + The time at which all text content in the data ingestion job finished + extraction and became available to query. + + This time isn't returned until text extraction is complete for all the + documents in the job. + """ + statistics: IngestionJobStatistics | None = ... + """Contains statistics for the data ingestion job.""" + +@dataclass(kw_only=True) +class IngestKnowledgeBaseDocumentsInput(_SerdeShape): + """Dataclass for IngestKnowledgeBaseDocumentsInput structure.""" + + knowledge_base_id: str | None = ... + """ + The unique identifier of the knowledge base to ingest the documents + into. + """ + data_source_id: str | None = ... + """ + The unique identifier of the data source connected to the knowledge base + that you're adding documents to. + """ + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If this token matches a previous + request, Amazon Bedrock ignores the request, but does not return an + error. For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + documents: list[KnowledgeBaseDocument] | None = ... + """ + A list of objects, each of which contains information about the + documents to add. + """ + +@dataclass(kw_only=True) +class IngestKnowledgeBaseDocumentsOutput(_SerdeShape): + """Dataclass for IngestKnowledgeBaseDocumentsOutput structure.""" + + document_details: list[KnowledgeBaseDocumentDetail] | None = ... + """ + A list of objects, each of which contains information about the + documents that were ingested. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InlineCodeFlowNodeConfiguration(_SerdeShape): + """ + Contains configurations for an inline code node in your flow. Inline + code nodes let you write and execute code directly within your flow, + enabling data transformations, custom logic, and integrations without + needing an external Lambda function. + """ + + code: str = ... + """ + The code that's executed in your inline code node. The code can access + input data from previous nodes in the flow, perform operations on that + data, and produce output that can be used by other nodes in your flow. + + The code must be valid in the programming `language` that you specify. + """ + language: str = ... + """ + The programming language used by your inline code node. + + The code must be valid in the programming `language` that you specify. + Currently, only Python 3 (`Python_3`) is supported. + """ + +@dataclass(kw_only=True) +class InlineContent(_SerdeShape): + """ + Contains information about content defined inline to ingest into a data + source. Choose a `type` and include the field that corresponds to it. + """ + + type: str + """The type of inline content to define.""" + byte_content: ByteContentDoc | None = ... + """Contains information about content defined inline in bytes.""" + text_content: TextContentDoc | None = ... + """Contains information about content defined inline in text.""" + +class InlineContentType(UnknownEnumMixin, StrEnum): + BYTE = "BYTE" + TEXT = "TEXT" + +@dataclass(kw_only=True) +class InputFlowNodeConfiguration(_SerdeShape): + """ + Contains configurations for the input flow node for a flow. This node + takes the input from flow invocation and passes it to the next node in + the data type that you specify. + """ + +@dataclass(kw_only=True) +class IntermediateStorage(_SerdeShape): + """ + A location for storing content from data sources temporarily as it is + processed by custom components in the ingestion pipeline. + """ + + s3_location: S3Location + """An S3 bucket path.""" + +@dataclass(kw_only=True) +class InternalServerException(ServiceError, _SerdeShape): + """An internal server error occurred. Retry your request.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidLoopBoundaryFlowValidationDetails(_SerdeShape): + """ + Details about a flow that contains connections that violate loop + boundary rules. + """ + + connection: str + """The name of the connection that violates loop boundary rules.""" + source: str + """ + The source node of the connection that violates DoWhile loop boundary + rules. + """ + target: str + """ + The target node of the connection that violates DoWhile loop boundary + rules. + """ + +@dataclass(kw_only=True) +class IteratorFlowNodeConfiguration(_SerdeShape): + """ + Contains configurations for an iterator node in a flow. Takes an input + that is an array and iteratively sends each item of the array as an + output to the following node. The size of the array is also returned in + the output. + + The output flow node at the end of the flow iteration will return a + response for each member of the array. To return only one response, you + can include a collector node downstream from the iterator node. + """ + +@dataclass(kw_only=True) +class KendraKnowledgeBaseConfiguration(_SerdeShape): + """Settings for an Amazon Kendra knowledge base.""" + + kendra_index_arn: str + """The ARN of the Amazon Kendra index.""" + +@dataclass(kw_only=True) +class KnowledgeBase(_SerdeShape): + """Contains information about a knowledge base.""" + + knowledge_base_id: str + """The unique identifier of the knowledge base.""" + name: str + """The name of the knowledge base.""" + knowledge_base_arn: str + """The Amazon Resource Name (ARN) of the knowledge base.""" + description: str | None = ... + """The description of the knowledge base.""" + role_arn: str + """ + The Amazon Resource Name (ARN) of the IAM role with permissions to + invoke API operations on the knowledge base. + """ + knowledge_base_configuration: KnowledgeBaseConfiguration + """ + Contains details about the embeddings configuration of the knowledge + base. + """ + storage_configuration: StorageConfiguration | None = ... + """Contains details about the storage configuration of the knowledge base.""" + status: str + """ + The status of the knowledge base. The following statuses are possible: + + - CREATING -- The knowledge base is being created. + + - ACTIVE -- The knowledge base is ready to be queried. + + - DELETING -- The knowledge base is being deleted. + + - UPDATING -- The knowledge base is being updated. + + - FAILED -- The knowledge base API operation failed. + """ + created_at: datetime + """The time the knowledge base was created.""" + updated_at: datetime + """The time the knowledge base was last updated.""" + failure_reasons: list[str] | None = ... + """A list of reasons that the API operation on the knowledge base failed.""" + +@dataclass(kw_only=True) +class KnowledgeBaseConfiguration(_SerdeShape): + """ + Contains details about the vector embeddings configuration of the + knowledge base. + """ + + type: str + """ + The type of data that the data source is converted into for the + knowledge base. Choose `MANAGED` to create a managed knowledge base. + """ + vector_knowledge_base_configuration: VectorKnowledgeBaseConfiguration | None = ... + """ + Contains details about the model that's used to convert the data source + into vector embeddings. + """ + managed_knowledge_base_configuration: ManagedKnowledgeBaseConfiguration | None = ... + """ + Contains configuration details for a knowledge base that uses a vector + store fully managed by Amazon Bedrock. Specify this object when the + knowledge base type is MANAGED. + """ + kendra_knowledge_base_configuration: KendraKnowledgeBaseConfiguration | None = ... + """Settings for an Amazon Kendra knowledge base.""" + sql_knowledge_base_configuration: SqlKnowledgeBaseConfiguration | None = ... + """ + Specifies configurations for a knowledge base connected to an SQL + database. + """ + +@dataclass(kw_only=True) +class KnowledgeBaseDocument(_SerdeShape): + """ + Contains information about a document to ingest into a knowledge base + and metadata to associate with it. + """ + + metadata: DocumentMetadata | None = ... + """Contains the metadata to associate with the document.""" + content: DocumentContent + """Contains the content of the document.""" + +@dataclass(kw_only=True) +class KnowledgeBaseDocumentDetail(_SerdeShape): + """Contains the details for a document that was ingested or deleted.""" + + knowledge_base_id: str + """ + The identifier of the knowledge base that the document was ingested into + or deleted from. + """ + data_source_id: str + """ + The identifier of the data source connected to the knowledge base that + the document was ingested into or deleted from. + """ + status: str + """ + The ingestion status of the document. The following statuses are + possible: + + - STARTING -- You submitted the ingestion job containing the document. + + - PENDING -- The document is waiting to be ingested. + + - IN_PROGRESS -- The document is being ingested. + + - INDEXED -- The document was successfully indexed. + + - PARTIALLY_INDEXED -- The document was partially indexed. + + - METADATA_PARTIALLY_INDEXED -- You submitted metadata for an existing + document and it was partially indexed. + + - METADATA_UPDATE_FAILED -- You submitted a metadata update for an + existing document but it failed. + + - FAILED -- The document failed to be ingested. + + - NOT_FOUND -- The document wasn't found. + + - IGNORED -- The document was ignored during ingestion. + + - DELETING -- You submitted the delete job containing the document. + + - DELETE_IN_PROGRESS -- The document is being deleted. + """ + identifier: DocumentIdentifier + """Contains information that identifies the document.""" + status_reason: str | None = ... + """The reason for the status. Appears alongside the status `IGNORED`.""" + updated_at: datetime | None = ... + """The date and time at which the document was last updated.""" + +@dataclass(kw_only=True) +class KnowledgeBaseFlowNodeConfiguration(_SerdeShape): + """ + Contains configurations for a knowledge base node in a flow. This node + takes a query as the input and returns, as the output, the retrieved + responses directly (as an array) or a response generated based on the + retrieved responses. For more information, see [Node types in a + flow](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-nodes.html) + in the Amazon Bedrock User Guide. + """ + + knowledge_base_id: str = ... + """The unique identifier of the knowledge base to query.""" + model_id: str | None = ... + """ + The unique identifier of the model or [inference + profile](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html) + to use to generate a response from the query results. Omit this field if + you want to return the retrieved results as an array. + """ + guardrail_configuration: GuardrailConfiguration | None = ... + """ + Contains configurations for a guardrail to apply during query and + response generation for the knowledge base in this configuration. + """ + number_of_results: int | None = ... + """The number of results to retrieve from the knowledge base.""" + prompt_template: KnowledgeBasePromptTemplate | None = ... + """ + A custom prompt template to use with the knowledge base for generating + responses. + """ + inference_configuration: PromptInferenceConfiguration | None = ... + """Contains inference configurations for the prompt.""" + reranking_configuration: VectorSearchRerankingConfiguration | None = ... + """ + The configuration for reranking the retrieved results from the knowledge + base to improve relevance. + """ + orchestration_configuration: KnowledgeBaseOrchestrationConfiguration | None = ... + """ + The configuration for orchestrating the retrieval and generation process + in the knowledge base node. + """ + +@dataclass(kw_only=True) +class KnowledgeBaseOrchestrationConfiguration(_SerdeShape): + """ + Configures how the knowledge base orchestrates the retrieval and + generation process, allowing for customization of prompts, inference + parameters, and performance settings. + """ + + prompt_template: KnowledgeBasePromptTemplate | None = ... + """ + A custom prompt template for orchestrating the retrieval and generation + process. + """ + inference_config: PromptInferenceConfiguration | None = ... + """Contains inference configurations for the prompt.""" + additional_model_request_fields: dict[str, Document] | None = ... + """ + The additional model-specific request parameters as key-value pairs to + be included in the request to the foundation model. + """ + performance_config: PerformanceConfiguration | None = ... + """ + The performance configuration options for the knowledge base retrieval + and generation process. + """ + +@dataclass(kw_only=True) +class KnowledgeBasePromptTemplate(_SerdeShape): + """ + Defines a custom prompt template for orchestrating the retrieval and + generation process. + """ + + text_prompt_template: str | None = ... + """The text of the prompt template.""" + +class KnowledgeBaseState(UnknownEnumMixin, StrEnum): + ENABLED = "ENABLED" + DISABLED = "DISABLED" + +class KnowledgeBaseStatus(UnknownEnumMixin, StrEnum): + CREATING = "CREATING" + ACTIVE = "ACTIVE" + DELETING = "DELETING" + UPDATING = "UPDATING" + FAILED = "FAILED" + DELETE_UNSUCCESSFUL = "DELETE_UNSUCCESSFUL" + UPDATE_UNSUCCESSFUL = "UPDATE_UNSUCCESSFUL" + +class KnowledgeBaseStorageType(UnknownEnumMixin, StrEnum): + """The storage type of a knowledge base.""" + + OPENSEARCH_SERVERLESS = "OPENSEARCH_SERVERLESS" + PINECONE = "PINECONE" + REDIS_ENTERPRISE_CLOUD = "REDIS_ENTERPRISE_CLOUD" + RDS = "RDS" + MONGO_DB_ATLAS = "MONGO_DB_ATLAS" + NEPTUNE_ANALYTICS = "NEPTUNE_ANALYTICS" + OPENSEARCH_MANAGED_CLUSTER = "OPENSEARCH_MANAGED_CLUSTER" + S3_VECTORS = "S3_VECTORS" + +@dataclass(kw_only=True) +class KnowledgeBaseSummary(_SerdeShape): + """Contains details about a knowledge base.""" + + knowledge_base_id: str + """The unique identifier of the knowledge base.""" + name: str + """The name of the knowledge base.""" + description: str | None = ... + """The description of the knowledge base.""" + status: str + """The status of the knowledge base.""" + updated_at: datetime + """The time the knowledge base was last updated.""" + +class KnowledgeBaseType(UnknownEnumMixin, StrEnum): + """The type of a knowledge base.""" + + VECTOR = "VECTOR" + KENDRA = "KENDRA" + SQL = "SQL" + MANAGED = "MANAGED" + +@dataclass(kw_only=True) +class LambdaFunctionFlowNodeConfiguration(_SerdeShape): + """ + Contains configurations for a Lambda function node in the flow. You + specify the Lambda function to invoke and the inputs into the function. + The output is the response that is defined in the Lambda function. For + more information, see [Node types in a + flow](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-nodes.html) + in the Amazon Bedrock User Guide. + """ + + lambda_arn: str = ... + """The Amazon Resource Name (ARN) of the Lambda function to invoke.""" + +@dataclass(kw_only=True) +class LastDayOfMonth(_SerdeShape): + """ + The option to run the monthly sync on the last calendar day of each + month. + """ + +@dataclass(kw_only=True) +class LexFlowNodeConfiguration(_SerdeShape): + """ + Contains configurations for a Lex node in the flow. You specify a Amazon + Lex bot to invoke. This node takes an utterance as the input and returns + as the output the intent identified by the Amazon Lex bot. For more + information, see [Node types in a + flow](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-nodes.html) + in the Amazon Bedrock User Guide. + """ + + bot_alias_arn: str = ... + """The Amazon Resource Name (ARN) of the Amazon Lex bot alias to invoke.""" + locale_id: str = ... + """The Region to invoke the Amazon Lex bot in.""" + +@dataclass(kw_only=True) +class ListAgentActionGroupsInput(_SerdeShape): + """Dataclass for ListAgentActionGroupsInput structure.""" + + agent_id: str | None = ... + """The unique identifier of the agent.""" + agent_version: str | None = ... + """The version of the agent.""" + max_results: int | None = ... + """ + The maximum number of results to return in the response. If the total + number of results is greater than this value, use the token returned in + the response in the `nextToken` field when making another request to + return the next batch of results. + """ + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, enter the token returned in the `nextToken` + field in the response in this field to return the next batch of results. + """ + +@dataclass(kw_only=True) +class ListAgentActionGroupsOutput(_SerdeShape): + """Dataclass for ListAgentActionGroupsOutput structure.""" + + action_group_summaries: list[ActionGroupSummary] + """ + A list of objects, each of which contains information about an action + group. + """ + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, use this token when making another request in + the `nextToken` field to return the next batch of results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListAgentAliasesInput(_SerdeShape): + """Dataclass for ListAgentAliasesInput structure.""" + + agent_id: str | None = ... + """The unique identifier of the agent.""" + max_results: int | None = ... + """ + The maximum number of results to return in the response. If the total + number of results is greater than this value, use the token returned in + the response in the `nextToken` field when making another request to + return the next batch of results. + """ + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, enter the token returned in the `nextToken` + field in the response in this field to return the next batch of results. + """ + +@dataclass(kw_only=True) +class ListAgentAliasesOutput(_SerdeShape): + """Dataclass for ListAgentAliasesOutput structure.""" + + agent_alias_summaries: list[AgentAliasSummary] + """ + A list of objects, each of which contains information about an alias of + the agent. + """ + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, use this token when making another request in + the `nextToken` field to return the next batch of results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListAgentCollaboratorsInput(_SerdeShape): + """Dataclass for ListAgentCollaboratorsInput structure.""" + + agent_id: str | None = ... + """The agent's ID.""" + agent_version: str | None = ... + """The agent's version.""" + max_results: int | None = ... + """ + The maximum number of agent collaborators to return in one page of + results. + """ + next_token: str | None = ... + """ + Specify the pagination token from a previous request to retrieve the + next page of results. + """ + +@dataclass(kw_only=True) +class ListAgentCollaboratorsOutput(_SerdeShape): + """Dataclass for ListAgentCollaboratorsOutput structure.""" + + agent_collaborator_summaries: list[AgentCollaboratorSummary] + """A list of collaborator summaries.""" + next_token: str | None = ... + """ + Specify the pagination token from a previous request to retrieve the + next page of results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListAgentKnowledgeBasesInput(_SerdeShape): + """Dataclass for ListAgentKnowledgeBasesInput structure.""" + + agent_id: str | None = ... + """ + The unique identifier of the agent for which to return information about + knowledge bases associated with it. + """ + agent_version: str | None = ... + """ + The version of the agent for which to return information about knowledge + bases associated with it. + """ + max_results: int | None = ... + """ + The maximum number of results to return in the response. If the total + number of results is greater than this value, use the token returned in + the response in the `nextToken` field when making another request to + return the next batch of results. + """ + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, enter the token returned in the `nextToken` + field in the response in this field to return the next batch of results. + """ + +@dataclass(kw_only=True) +class ListAgentKnowledgeBasesOutput(_SerdeShape): + """Dataclass for ListAgentKnowledgeBasesOutput structure.""" + + agent_knowledge_base_summaries: list[AgentKnowledgeBaseSummary] + """ + A list of objects, each of which contains information about a knowledge + base associated with the agent. + """ + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, use this token when making another request in + the `nextToken` field to return the next batch of results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListAgentsInput(_SerdeShape): + """Dataclass for ListAgentsInput structure.""" + + max_results: int | None = ... + """ + The maximum number of results to return in the response. If the total + number of results is greater than this value, use the token returned in + the response in the `nextToken` field when making another request to + return the next batch of results. + """ + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, enter the token returned in the `nextToken` + field in the response in this field to return the next batch of results. + """ + +@dataclass(kw_only=True) +class ListAgentsOutput(_SerdeShape): + """Dataclass for ListAgentsOutput structure.""" + + agent_summaries: list[AgentSummary] + """A list of objects, each of which contains information about an agent.""" + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, use this token when making another request in + the `nextToken` field to return the next batch of results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListAgentVersionsInput(_SerdeShape): + """Dataclass for ListAgentVersionsInput structure.""" + + agent_id: str | None = ... + """The unique identifier of the agent.""" + max_results: int | None = ... + """ + The maximum number of results to return in the response. If the total + number of results is greater than this value, use the token returned in + the response in the `nextToken` field when making another request to + return the next batch of results. + """ + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, enter the token returned in the `nextToken` + field in the response in this field to return the next batch of results. + """ + +@dataclass(kw_only=True) +class ListAgentVersionsOutput(_SerdeShape): + """Dataclass for ListAgentVersionsOutput structure.""" + + agent_version_summaries: list[AgentVersionSummary] + """ + A list of objects, each of which contains information about a version of + the agent. + """ + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, use this token when making another request in + the `nextToken` field to return the next batch of results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListDataSourcesInput(_SerdeShape): + """Dataclass for ListDataSourcesInput structure.""" + + knowledge_base_id: str | None = ... + """ + The unique identifier of the knowledge base for which to return a list + of information. + """ + max_results: int | None = ... + """ + The maximum number of results to return in the response. If the total + number of results is greater than this value, use the token returned in + the response in the `nextToken` field when making another request to + return the next batch of results. + """ + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, enter the token returned in the `nextToken` + field in the response in this field to return the next batch of results. + """ + +@dataclass(kw_only=True) +class ListDataSourcesOutput(_SerdeShape): + """Dataclass for ListDataSourcesOutput structure.""" + + data_source_summaries: list[DataSourceSummary] + """ + A list of objects, each of which contains information about a data + source. + """ + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, use this token when making another request in + the `nextToken` field to return the next batch of results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListFlowAliasesInput(_SerdeShape): + """Dataclass for ListFlowAliasesInput structure.""" + + flow_identifier: str | None = ... + """The unique identifier of the flow for which aliases are being returned.""" + max_results: int | None = ... + """ + The maximum number of results to return in the response. If the total + number of results is greater than this value, use the token returned in + the response in the `nextToken` field when making another request to + return the next batch of results. + """ + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, enter the token returned in the `nextToken` + field in the response in this field to return the next batch of results. + """ + +@dataclass(kw_only=True) +class ListFlowAliasesOutput(_SerdeShape): + """Dataclass for ListFlowAliasesOutput structure.""" + + flow_alias_summaries: list[FlowAliasSummary] + """A list, each member of which contains information about an alias.""" + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, use this token when making another request in + the `nextToken` field to return the next batch of results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListFlowsInput(_SerdeShape): + """Dataclass for ListFlowsInput structure.""" + + max_results: int | None = ... + """ + The maximum number of results to return in the response. If the total + number of results is greater than this value, use the token returned in + the response in the `nextToken` field when making another request to + return the next batch of results. + """ + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, enter the token returned in the `nextToken` + field in the response in this field to return the next batch of results. + """ + +@dataclass(kw_only=True) +class ListFlowsOutput(_SerdeShape): + """Dataclass for ListFlowsOutput structure.""" + + flow_summaries: list[FlowSummary] + """A list, each member of which contains information about a flow.""" + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, use this token when making another request in + the `nextToken` field to return the next batch of results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListFlowVersionsInput(_SerdeShape): + """Dataclass for ListFlowVersionsInput structure.""" + + flow_identifier: str | None = ... + """The unique identifier of the flow.""" + max_results: int | None = ... + """ + The maximum number of results to return in the response. If the total + number of results is greater than this value, use the token returned in + the response in the `nextToken` field when making another request to + return the next batch of results. + """ + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, enter the token returned in the `nextToken` + field in the response in this field to return the next batch of results. + """ + +@dataclass(kw_only=True) +class ListFlowVersionsOutput(_SerdeShape): + """Dataclass for ListFlowVersionsOutput structure.""" + + flow_version_summaries: list[FlowVersionSummary] + """A list, each member of which contains information about a flow.""" + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, use this token when making another request in + the `nextToken` field to return the next batch of results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListIngestionJobsInput(_SerdeShape): + """Dataclass for ListIngestionJobsInput structure.""" + + knowledge_base_id: str | None = ... + """ + The unique identifier of the knowledge base for the list of data + ingestion jobs. + """ + data_source_id: str | None = ... + """ + The unique identifier of the data source for the list of data ingestion + jobs. + """ + filters: list[IngestionJobFilter] | None = ... + """Contains information about the filters for filtering the data.""" + sort_by: IngestionJobSortBy | None = ... + """Contains details about how to sort the data.""" + max_results: int | None = ... + """ + The maximum number of results to return in the response. If the total + number of results is greater than this value, use the token returned in + the response in the `nextToken` field when making another request to + return the next batch of results. + """ + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, enter the token returned in the `nextToken` + field in the response in this field to return the next batch of results. + """ + +@dataclass(kw_only=True) +class ListIngestionJobsOutput(_SerdeShape): + """Dataclass for ListIngestionJobsOutput structure.""" + + ingestion_job_summaries: list[IngestionJobSummary] + """A list of data ingestion jobs with information about each job.""" + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, use this token when making another request in + the `nextToken` field to return the next batch of results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListKnowledgeBaseDocumentsInput(_SerdeShape): + """Dataclass for ListKnowledgeBaseDocumentsInput structure.""" + + knowledge_base_id: str | None = ... + """ + The unique identifier of the knowledge base that is connected to the + data source. + """ + data_source_id: str | None = ... + """The unique identifier of the data source that contains the documents.""" + max_results: int | None = ... + """ + The maximum number of results to return in the response. If the total + number of results is greater than this value, use the token returned in + the response in the `nextToken` field when making another request to + return the next batch of results. + """ + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, enter the token returned in the `nextToken` + field in the response in this field to return the next batch of results. + """ + +@dataclass(kw_only=True) +class ListKnowledgeBaseDocumentsOutput(_SerdeShape): + """Dataclass for ListKnowledgeBaseDocumentsOutput structure.""" + + document_details: list[KnowledgeBaseDocumentDetail] + """ + A list of objects, each of which contains information about the + documents that were retrieved. + """ + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, use this token when making another request in + the `nextToken` field to return the next batch of results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListKnowledgeBasesInput(_SerdeShape): + """Dataclass for ListKnowledgeBasesInput structure.""" + + max_results: int | None = ... + """ + The maximum number of results to return in the response. If the total + number of results is greater than this value, use the token returned in + the response in the `nextToken` field when making another request to + return the next batch of results. + """ + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, enter the token returned in the `nextToken` + field in the response in this field to return the next batch of results. + """ + +@dataclass(kw_only=True) +class ListKnowledgeBasesOutput(_SerdeShape): + """Dataclass for ListKnowledgeBasesOutput structure.""" + + knowledge_base_summaries: list[KnowledgeBaseSummary] + """A list of knowledge bases with information about each knowledge base.""" + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, use this token when making another request in + the `nextToken` field to return the next batch of results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListPromptsInput(_SerdeShape): + """Dataclass for ListPromptsInput structure.""" + + prompt_identifier: str | None = ... + """ + The unique identifier of the prompt for whose versions you want to + return information. Omit this field to list information about all + prompts in an account. + """ + max_results: int | None = ... + """ + The maximum number of results to return in the response. If the total + number of results is greater than this value, use the token returned in + the response in the `nextToken` field when making another request to + return the next batch of results. + """ + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, enter the token returned in the `nextToken` + field in the response in this field to return the next batch of results. + """ + +@dataclass(kw_only=True) +class ListPromptsOutput(_SerdeShape): + """Dataclass for ListPromptsOutput structure.""" + + prompt_summaries: list[PromptSummary] + """ + A list, each member of which contains information about a prompt using + Prompt management. + """ + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, use this token when making another request in + the `nextToken` field to return the next batch of results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListTagsForResourceInput(_SerdeShape): + """Dataclass for ListTagsForResourceInput structure.""" + + resource_arn: str | None = ... + """The Amazon Resource Name (ARN) of the resource for which to list tags.""" + +@dataclass(kw_only=True) +class ListTagsForResourceOutput(_SerdeShape): + """Dataclass for ListTagsForResourceOutput structure.""" + + tags: dict[str, str] | None = ... + """The key-value pairs for the tags associated with the resource.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListVpcConfigurationsInput(_SerdeShape): + """Dataclass for ListVpcConfigurationsInput structure.""" + + knowledge_base_id: str | None = ... + """ + The unique identifier of the knowledge base whose VPC configurations you + want to list. + """ + status_filter: str | None = ... + """ + The status to filter the results by. Only VPC configurations with the + specified status are returned. + """ + max_results: int | None = ... + """ + The maximum number of results to return in the response. If more results + are available, the response returns a `nextToken`. + """ + next_token: str | None = ... + """ + A pagination token to retrieve the next page of results, returned in a + previous response when more results are available. + """ + +@dataclass(kw_only=True) +class ListVpcConfigurationsOutput(_SerdeShape): + """Dataclass for ListVpcConfigurationsOutput structure.""" + + items: list[VpcConfigurationSummary] + """A list of VPC configuration summaries.""" + next_token: str | None = ... + """ + A pagination token to retrieve the next page of results, present when + the total number of results exceeds the maximum number of results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class LoopControllerFlowNodeConfiguration(_SerdeShape): + """ + Contains configurations for the controller node of a DoWhile loop in the + flow. + """ + + continue_condition: FlowCondition + """ + Specifies the condition that determines when the flow exits the DoWhile + loop. The loop executes until this condition evaluates to true. + """ + max_iterations: int = ... + """ + Specifies the maximum number of times the DoWhile loop can iterate + before the flow exits the loop. + """ + +@dataclass(kw_only=True) +class LoopFlowNodeConfiguration(_SerdeShape): + """ + Contains configurations for the nodes of a DoWhile loop in your flow. + + A DoWhile loop is made up of the following nodes: + + - `Loop` - The container node that holds the loop's flow definition. + This node encompasses the entire loop structure. + + - `LoopInput` - The entry point node for the loop. This node receives + inputs from nodes outside the loop and from previous loop iterations. + + - Body nodes - The processing nodes that execute within each loop + iteration. These can be nodes for handling data in your flow, such as + a prompt or Lambda function nodes. Some node types aren't supported + inside a DoWhile loop body. For more information, see + [LoopIncompatibleNodeTypeFlowValidationDetails](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_LoopIncompatibleNodeTypeFlowValidationDetails.html). + + - `LoopController` - The node that evaluates whether the loop should + continue or exit based on a condition. + + These nodes work together to create a loop that runs at least once and + continues until a specified condition is met or a maximum number of + iterations is reached. + """ + + definition: FlowDefinition + """ + The definition of the DoWhile loop nodes and connections between nodes + in the flow. + """ + +@dataclass(kw_only=True) +class LoopIncompatibleNodeTypeFlowValidationDetails(_SerdeShape): + """ + Details about a flow that contains an incompatible node in a DoWhile + loop. + """ + + node: str + """The `Loop` container node that contains an incompatible node.""" + incompatible_node_type: str + """ + The node type of the incompatible node in the DoWhile loop. Some node + types, like a condition node, aren't allowed in a DoWhile loop. + """ + incompatible_node_name: str + """The node that's incompatible in the DoWhile loop.""" + +@dataclass(kw_only=True) +class LoopInputFlowNodeConfiguration(_SerdeShape): + """ + Contains configurations for the input node of a DoWhile loop in the + flow. + """ + +@dataclass(kw_only=True) +class MalformedConditionExpressionFlowValidationDetails(_SerdeShape): + """Details about a malformed condition expression in a node.""" + + node: str + """The name of the node containing the malformed condition expression.""" + condition: str + """The name of the malformed condition.""" + cause: str + """The error message describing why the condition expression is malformed.""" + +@dataclass(kw_only=True) +class MalformedNodeInputExpressionFlowValidationDetails(_SerdeShape): + """Details about a malformed input expression in a node.""" + + node: str + """The name of the node containing the malformed input expression.""" + input: str + """The name of the input with the malformed expression.""" + cause: str + """The error message describing why the input expression is malformed.""" + +@dataclass(kw_only=True) +class ManagedKnowledgeBaseConfiguration(_SerdeShape): + """Configurations for a managed knowledge base.""" + + embedding_model_type: str | None = ... + """ + Choose CUSTOM to provide your own Bedrock embedding model ARN. Choose + MANAGED to use a service-managed embedding model. + """ + embedding_model_arn: str | None = ... + """The ARN for the embeddings model.""" + embedding_model_configuration: EmbeddingModelConfiguration | None = ... + """ + The configuration details for the embeddings model. Not required when + choosing the MANAGED embeddingModelType. + """ + server_side_encryption_configuration: ServerSideEncryptionConfiguration | None = ... + """ + Contains the configuration for server-side encryption for your managed + knowledge base. + """ + supplemental_data_storage_configuration: ( + SupplementalDataStorageConfiguration | None + ) = ... + """ + Use this object to specify the Amazon S3 location that the knowledge + base uses to process and ingest multimodal content. This field is + required when you use a native multimodal embedding model. + """ + +@dataclass(kw_only=True) +class ManagedKnowledgeBaseConnectorConfiguration(_SerdeShape): + """Configuration for managed knowledge base connector data sources.""" + + deletion_protection_configuration: DeletionProtectionConfiguration | None = ... + """A safeguard against accidental bulk deletion of indexed content.""" + media_extraction_configuration: MediaExtractionConfiguration | None = ... + """ + Configuration for extracting media (images, audio, video) from data + source files. + """ + connector_parameters: Document | None = ... + """ + Connector-specific parameters. For more information, see [Connect a data + source](https://docs.aws.amazon.com/bedrock/latest/userguide/kb-managed-connect-ds.html). + """ + sync_schedule: SyncSchedule | None = ... + """ + The recurring schedule on which the connector automatically syncs this + data source. If not specified, the data source is not synced + automatically and you start each sync yourself. Not supported for the + Custom connector. + """ + +@dataclass(kw_only=True) +class MediaExtractionConfiguration(_SerdeShape): + """Configuration for media extraction settings.""" + + image_extraction_configuration: ImageExtractionConfiguration | None = ... + """Configuration for image extraction.""" + audio_extraction_configuration: AudioExtractionConfiguration | None = ... + """Configuration for audio extraction.""" + video_extraction_configuration: VideoExtractionConfiguration | None = ... + """Configuration for video extraction.""" + +@dataclass(kw_only=True) +class MemoryConfiguration(_SerdeShape): + """Details of the memory configuration.""" + + enabled_memory_types: list[str] + """The type of memory that is stored.""" + storage_days: int = ... + """ + The number of days the agent is configured to retain the conversational + context. + """ + session_summary_configuration: SessionSummaryConfiguration | None = ... + """ + Contains the configuration for SESSION_SUMMARY memory type enabled for + the agent. + """ + +class MemoryType(UnknownEnumMixin, StrEnum): + SESSION_SUMMARY = "SESSION_SUMMARY" + +@dataclass(kw_only=True) +class Message(_SerdeShape): + """ + A message input or response from a model. For more information, see + [Create a prompt using Prompt + management](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-create.html). + """ + + role: str + """The role that the message belongs to.""" + content: list[ContentBlock] + """The content in the message.""" + +@dataclass(kw_only=True) +class MetadataAttribute(_SerdeShape): + """Contains information about a metadata attribute.""" + + key: str + """The key of the metadata attribute.""" + value: MetadataAttributeValue + """Contains the value of the metadata attribute.""" + +@dataclass(kw_only=True) +class MetadataAttributeValue(_SerdeShape): + """ + Contains the value of the metadata attribute. Choose a `type` and + include the field that corresponds to it. + """ + + type: str + """The type of the metadata attribute.""" + number_value: float | None = ... + """The value of the numeric metadata attribute.""" + boolean_value: bool | None = ... + """The value of the Boolean metadata attribute.""" + string_value: str | None = ... + """The value of the string metadata attribute.""" + string_list_value: list[str] | None = ... + """An array of strings that define the value of the metadata attribute.""" + +@dataclass(kw_only=True) +class MetadataConfigurationForReranking(_SerdeShape): + """ + Specifies how metadata fields should be handled during the reranking + process. + """ + + selection_mode: str + """The mode for selecting metadata fields for reranking.""" + selective_mode_configuration: ( + RerankingMetadataSelectiveModeConfiguration | None + ) = ... + """ + The configuration for selective metadata field inclusion or exclusion + during reranking. + """ + +class MetadataSourceType(UnknownEnumMixin, StrEnum): + IN_LINE_ATTRIBUTE = "IN_LINE_ATTRIBUTE" + S3_LOCATION = "S3_LOCATION" + +class MetadataValueType(UnknownEnumMixin, StrEnum): + BOOLEAN = "BOOLEAN" + NUMBER = "NUMBER" + STRING = "STRING" + STRING_LIST = "STRING_LIST" + +@dataclass(kw_only=True) +class MismatchedNodeInputTypeFlowValidationDetails(_SerdeShape): + """Details about mismatched input data types in a node.""" + + node: str + """The name of the node containing the input with the mismatched data type.""" + input: str + """The name of the input with the mismatched data type.""" + expected_type: str + """The expected data type for the node input.""" + +@dataclass(kw_only=True) +class MismatchedNodeOutputTypeFlowValidationDetails(_SerdeShape): + """Details about mismatched output data types in a node.""" + + node: str + """ + The name of the node containing the output with the mismatched data + type. + """ + output: str + """The name of the output with the mismatched data type.""" + expected_type: str + """The expected data type for the node output.""" + +@dataclass(kw_only=True) +class MissingConnectionConfigurationFlowValidationDetails(_SerdeShape): + """Details about a connection missing required configuration.""" + + connection: str + """The name of the connection missing configuration.""" + +@dataclass(kw_only=True) +class MissingDefaultConditionFlowValidationDetails(_SerdeShape): + """Details about a missing default condition in a conditional node.""" + + node: str + """The name of the node missing the default condition.""" + +@dataclass(kw_only=True) +class MissingEndingNodesFlowValidationDetails(_SerdeShape): + """Details about missing ending nodes (such as FlowOutputNode) in the flow.""" + +@dataclass(kw_only=True) +class MissingLoopControllerNodeFlowValidationDetails(_SerdeShape): + """ + Details about a flow that's missing a required `LoopController` node in + a DoWhile loop. + """ + + loop_node: str + """ + The DoWhile loop in a flow that's missing a required `LoopController` + node. + """ + +@dataclass(kw_only=True) +class MissingLoopInputNodeFlowValidationDetails(_SerdeShape): + """ + Details about a flow that's missing a required `LoopInput` node in a + DoWhile loop. + """ + + loop_node: str + """The DoWhile loop in a flow that's missing a required `LoopInput` node.""" + +@dataclass(kw_only=True) +class MissingNodeConfigurationFlowValidationDetails(_SerdeShape): + """Details about a node missing a required configuration.""" + + node: str + """The name of the node missing a required configuration.""" + +@dataclass(kw_only=True) +class MissingNodeInputFlowValidationDetails(_SerdeShape): + """Details about a missing required input in a node.""" + + node: str + """The name of the node missing the required input.""" + input: str + """The name of the missing input.""" + +@dataclass(kw_only=True) +class MissingNodeOutputFlowValidationDetails(_SerdeShape): + """Details about a missing required output in a node.""" + + node: str + """The name of the node missing the required output.""" + output: str + """The name of the missing output.""" + +@dataclass(kw_only=True) +class MissingStartingNodesFlowValidationDetails(_SerdeShape): + """ + Details about missing starting nodes (such as FlowInputNode) in the + flow. + """ + +@dataclass(kw_only=True) +class MongoDbAtlasConfiguration(_SerdeShape): + """ + Contains details about the storage configuration of the knowledge base + in MongoDB Atlas. + """ + + endpoint: str + """The endpoint URL of your MongoDB Atlas cluster for your knowledge base.""" + database_name: str + """The database name in your MongoDB Atlas cluster for your knowledge base.""" + collection_name: str + """The collection name of the knowledge base in MongoDB Atlas.""" + vector_index_name: str + """The name of the MongoDB Atlas vector search index.""" + credentials_secret_arn: str + """ + The Amazon Resource Name (ARN) of the secret that you created in Secrets + Manager that contains user credentials for your MongoDB Atlas cluster. + """ + field_mapping: MongoDbAtlasFieldMapping + """ + Contains the names of the fields to which to map information about the + vector store. + """ + endpoint_service_name: str | None = ... + """ + The name of the VPC endpoint service in your account that is connected + to your MongoDB Atlas cluster. + """ + text_index_name: str | None = ... + """ + The name of the text search index in the MongoDB collection. This is + required for using the hybrid search feature. + """ + +@dataclass(kw_only=True) +class MongoDbAtlasFieldMapping(_SerdeShape): + """ + Contains the names of the fields to which to map information about the + vector store. + """ + + vector_field: str + """ + The name of the field in which Amazon Bedrock stores the vector + embeddings for your data sources. + """ + text_field: str + """ + The name of the field in which Amazon Bedrock stores the raw text from + your data. The text is split according to the chunking strategy you + choose. + """ + metadata_field: str + """ + The name of the field in which Amazon Bedrock stores metadata about the + vector store. + """ + +@dataclass(kw_only=True) +class MonthlySchedule(_SerdeShape): + """A monthly sync on a specified day of the month.""" + + day_of_month: DayOfMonth + """The day of the month on which the monthly sync runs.""" + +@dataclass(kw_only=True) +class MultipleLoopControllerNodesFlowValidationDetails(_SerdeShape): + """ + Details about a flow that contains multiple `LoopController` nodes in a + DoWhile loop. + """ + + loop_node: str + """ + The DoWhile loop in a flow that contains multiple `LoopController` + nodes. + """ + +@dataclass(kw_only=True) +class MultipleLoopInputNodesFlowValidationDetails(_SerdeShape): + """ + Details about a flow that contains multiple `LoopInput` nodes in a + DoWhile loop. + """ + + loop_node: str + """The DoWhile loop in a flow that contains multiple `LoopInput` nodes.""" + +@dataclass(kw_only=True) +class MultipleNodeInputConnectionsFlowValidationDetails(_SerdeShape): + """Details about multiple connections to a single node input.""" + + node: str + """The name of the node containing the input with multiple connections.""" + input: str + """The name of the input with multiple connections to it.""" + +@dataclass(kw_only=True) +class NeptuneAnalyticsConfiguration(_SerdeShape): + """ + Contains details about the storage configuration of the knowledge base + in Amazon Neptune Analytics. For more information, see [Create a vector + index in Amazon Neptune + Analytics](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-setup-neptune.html). + """ + + graph_arn: str + """The Amazon Resource Name (ARN) of the Neptune Analytics vector store.""" + field_mapping: NeptuneAnalyticsFieldMapping + """ + Contains the names of the fields to which to map information about the + vector store. + """ + +@dataclass(kw_only=True) +class NeptuneAnalyticsFieldMapping(_SerdeShape): + """ + Contains the names of the fields to which to map information about the + vector store. + """ + + text_field: str + """ + The name of the field in which Amazon Bedrock stores the raw text from + your data. The text is split according to the chunking strategy you + choose. + """ + metadata_field: str + """ + The name of the field in which Amazon Bedrock stores metadata about the + vector store. + """ + +@dataclass(kw_only=True) +class OpenSearchManagedClusterConfiguration(_SerdeShape): + """ + Contains details about the Managed Cluster configuration of the + knowledge base in Amazon OpenSearch Service. For more information, see + [Create a vector index in OpenSearch Managed + Cluster](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-setup-osm.html). + """ + + domain_endpoint: str + """The endpoint URL the OpenSearch domain.""" + domain_arn: str + """The Amazon Resource Name (ARN) of the OpenSearch domain.""" + vector_index_name: str + """The name of the vector store.""" + field_mapping: OpenSearchManagedClusterFieldMapping + """ + Contains the names of the fields to which to map information about the + vector store. + """ + +@dataclass(kw_only=True) +class OpenSearchManagedClusterFieldMapping(_SerdeShape): + """ + Contains the names of the fields to which to map information about the + vector store. + """ + + vector_field: str + """ + The name of the field in which Amazon Bedrock stores the vector + embeddings for your data sources. + """ + text_field: str + """ + The name of the field in which Amazon Bedrock stores the raw text from + your data. The text is split according to the chunking strategy you + choose. + """ + metadata_field: str + """ + The name of the field in which Amazon Bedrock stores metadata about the + vector store. + """ + +@dataclass(kw_only=True) +class OpenSearchServerlessConfiguration(_SerdeShape): + """ + Contains details about the storage configuration of the knowledge base + in Amazon OpenSearch Service. For more information, see [Create a vector + index in Amazon OpenSearch + Service](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-setup-oss.html). + """ + + collection_arn: str + """The Amazon Resource Name (ARN) of the OpenSearch Service vector store.""" + vector_index_name: str + """The name of the vector store.""" + field_mapping: OpenSearchServerlessFieldMapping + """ + Contains the names of the fields to which to map information about the + vector store. + """ + +@dataclass(kw_only=True) +class OpenSearchServerlessFieldMapping(_SerdeShape): + """ + Contains the names of the fields to which to map information about the + vector store. + """ + + vector_field: str + """ + The name of the field in which Amazon Bedrock stores the vector + embeddings for your data sources. + """ + text_field: str + """ + The name of the field in which Amazon Bedrock stores the raw text from + your data. The text is split according to the chunking strategy you + choose. + """ + metadata_field: str + """ + The name of the field in which Amazon Bedrock stores metadata about the + vector store. + """ + +@dataclass +class OrchestrationExecutorLambda(_SerdeShape): + """ + The Amazon Resource Name (ARN) of the Lambda function containing the + business logic that is carried out upon invoking the action. + """ + + value: str + +@dataclass +class OrchestrationExecutorUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +OrchestrationExecutor = Union[ + OrchestrationExecutorLambda | OrchestrationExecutorUnknown +] +""" +Contains details about the Lambda function containing the orchestration +logic carried out upon invoking the custom orchestration. +""" + +class _OrchestrationExecutorDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> OrchestrationExecutor: ... + +class OrchestrationType(UnknownEnumMixin, StrEnum): + DEFAULT = "DEFAULT" + CUSTOM_ORCHESTRATION = "CUSTOM_ORCHESTRATION" + +@dataclass(kw_only=True) +class OutputFlowNodeConfiguration(_SerdeShape): + """ + Contains configurations for an output flow node in the flow. You specify + the data type expected for the input into the node in the `type` field + and how to return the final output in the `expression` field. + """ + +@dataclass(kw_only=True) +class ParameterDetail(_SerdeShape): + """ + Contains details about a parameter in a function for an action group. + + This data type is used in the following API operations: + + - [CreateAgentActionGroup + request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_CreateAgentActionGroup.html#API_agent_CreateAgentActionGroup_RequestSyntax) + + - [CreateAgentActionGroup + response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_CreateAgentActionGroup.html#API_agent_CreateAgentActionGroup_ResponseSyntax) + + - [UpdateAgentActionGroup + request](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_UpdateAgentActionGroup.html#API_agent_UpdateAgentActionGroup_RequestSyntax) + + - [UpdateAgentActionGroup + response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_UpdateAgentActionGroup.html#API_agent_UpdateAgentActionGroup_ResponseSyntax) + + - [GetAgentActionGroup + response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_GetAgentActionGroup.html#API_agent_GetAgentActionGroup_ResponseSyntax) + """ + + description: str | None = ... + """ + A description of the parameter. Helps the foundation model determine how + to elicit the parameters from the user. + """ + type: str + """The data type of the parameter.""" + required: bool | None = ... + """ + Whether the parameter is required for the agent to complete the function + for action group invocation. + """ + +@dataclass(kw_only=True) +class ParsingConfiguration(_SerdeShape): + """ + Settings for parsing document contents. If you exclude this field, the + default parser converts the contents of each document into text before + splitting it into chunks. Specify the parsing strategy to use in the + `parsingStrategy` field and include the relevant configuration, or omit + it to use the Amazon Bedrock default parser. For more information, see + [Parsing options for your data + source](https://docs.aws.amazon.com/bedrock/latest/userguide/kb-advanced-parsing.html). + + Note: + If you specify `BEDROCK_DATA_AUTOMATION` or `BEDROCK_FOUNDATION_MODEL` + and it fails to parse a file, the Amazon Bedrock default parser will be + used instead. + """ + + parsing_strategy: str + """ + The parsing strategy for the data source. + + For managed knowledge bases, the strategy that you can select depends on + the embedding model that your knowledge base uses: + + - If your knowledge base uses a native multimodal embedding model, + specify `MULTI_MODAL_EMBEDDINGS`. With this strategy, files are sent + directly to the embedding model instead of being parsed into text. + This is the only strategy that is supported for these knowledge bases. + + - Otherwise, specify `SMART_PARSING`. + + For more information, see [Customize ingestion for managed knowledge + bases](https://docs.aws.amazon.com/bedrock/latest/userguide/kb-managed-customize-ingestion.html). + """ + bedrock_foundation_model_configuration: ( + BedrockFoundationModelConfiguration | None + ) = ... + """ + If you specify `BEDROCK_FOUNDATION_MODEL` as the parsing strategy for + ingesting your data source, use this object to modify configurations for + using a foundation model to parse documents. + """ + bedrock_data_automation_configuration: ( + BedrockDataAutomationConfiguration | None + ) = ... + """ + If you specify `BEDROCK_DATA_AUTOMATION` as the parsing strategy for + ingesting your data source, use this object to modify configurations for + using the Amazon Bedrock Data Automation parser. + """ + +class ParsingModality(UnknownEnumMixin, StrEnum): + MULTIMODAL = "MULTIMODAL" + +@dataclass(kw_only=True) +class ParsingPrompt(_SerdeShape): + """Instructions for interpreting the contents of a document.""" + + parsing_prompt_text: str + """Instructions for interpreting the contents of a document.""" + +class ParsingStrategy(UnknownEnumMixin, StrEnum): + BEDROCK_FOUNDATION_MODEL = "BEDROCK_FOUNDATION_MODEL" + BEDROCK_DATA_AUTOMATION = "BEDROCK_DATA_AUTOMATION" + SMART_PARSING = "SMART_PARSING" + MULTI_MODAL_EMBEDDINGS = "MULTI_MODAL_EMBEDDINGS" + +@dataclass(kw_only=True) +class PatternObjectFilter(_SerdeShape): + """ + The specific filters applied to your data source content. You can filter + out or include certain content. + """ + + object_type: str + """The supported object type or content type of the data source.""" + inclusion_filters: list[str] | None = ... + """ + A list of one or more inclusion regular expression patterns to include + certain object types that adhere to the pattern. If you specify an + inclusion and exclusion filter/pattern and both match a document, the + exclusion filter takes precedence and the document isn't crawled. + """ + exclusion_filters: list[str] | None = ... + """ + A list of one or more exclusion regular expression patterns to exclude + certain object types that adhere to the pattern. If you specify an + inclusion and exclusion filter/pattern and both match a document, the + exclusion filter takes precedence and the document isn't crawled. + """ + +@dataclass(kw_only=True) +class PatternObjectFilterConfiguration(_SerdeShape): + """ + The configuration of filtering certain objects or content types of the + data source. + """ + + filters: list[PatternObjectFilter] + """ + The configuration of specific filters applied to your data source + content. You can filter out or include certain content. + """ + +class PerformanceConfigLatency(UnknownEnumMixin, StrEnum): + STANDARD = "standard" + OPTIMIZED = "optimized" + +@dataclass(kw_only=True) +class PerformanceConfiguration(_SerdeShape): + """ + The performance-related configuration options for the knowledge base + retrieval and generation process. + """ + + latency: str = ... + """The latency optimization setting.""" + +@dataclass(kw_only=True) +class PineconeConfiguration(_SerdeShape): + """ + Contains details about the storage configuration of the knowledge base + in Pinecone. For more information, see [Create a vector index in + Pinecone](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-setup-pinecone.html). + """ + + connection_string: str + """The endpoint URL for your index management page.""" + credentials_secret_arn: str + """ + The Amazon Resource Name (ARN) of the secret that you created in Secrets + Manager that is linked to your Pinecone API key. + """ + namespace: str | None = ... + """The namespace to be used to write new data to your database.""" + field_mapping: PineconeFieldMapping + """ + Contains the names of the fields to which to map information about the + vector store. + """ + +@dataclass(kw_only=True) +class PineconeFieldMapping(_SerdeShape): + """ + Contains the names of the fields to which to map information about the + vector store. + """ + + text_field: str + """ + The name of the field in which Amazon Bedrock stores the raw text from + your data. The text is split according to the chunking strategy you + choose. + """ + metadata_field: str + """ + The name of the field in which Amazon Bedrock stores metadata about the + vector store. + """ + +@dataclass(kw_only=True) +class PrepareAgentInput(_SerdeShape): + """Dataclass for PrepareAgentInput structure.""" + + agent_id: str | None = ... + """ + The unique identifier of the agent for which to create a `DRAFT` + version. + """ + +@dataclass(kw_only=True) +class PrepareAgentOutput(_SerdeShape): + """Dataclass for PrepareAgentOutput structure.""" + + agent_id: str + """ + The unique identifier of the agent for which the `DRAFT` version was + created. + """ + agent_status: str + """The status of the `DRAFT` version and whether it is ready for use.""" + agent_version: str + """The version of the agent.""" + prepared_at: datetime + """The time at which the `DRAFT` version of the agent was last prepared.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class PrepareFlowInput(_SerdeShape): + """Dataclass for PrepareFlowInput structure.""" + + flow_identifier: str | None = ... + """The unique identifier of the flow.""" + +@dataclass(kw_only=True) +class PrepareFlowOutput(_SerdeShape): + """Dataclass for PrepareFlowOutput structure.""" + + id: str + """The unique identifier of the flow.""" + status: str + """ + The status of the flow. When you submit this request, the status will be + `NotPrepared`. If preparation succeeds, the status becomes `Prepared`. + If it fails, the status becomes `FAILED`. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class PromptAgentResource(_SerdeShape): + """ + Contains specifications for an Amazon Bedrock agent with which to use + the prompt. For more information, see [Create a prompt using Prompt + management](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-create.html) + and [Automate tasks in your application using conversational + agents](https://docs.aws.amazon.com/bedrock/latest/userguide/agents.html). + """ + + agent_identifier: str + """The ARN of the agent with which to use the prompt.""" + +@dataclass(kw_only=True) +class PromptConfiguration(_SerdeShape): + """ + Contains configurations to override a prompt template in one part of an + agent sequence. For more information, see [Advanced + prompts](https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts.html). + """ + + prompt_type: str | None = ... + """ + The step in the agent sequence that this prompt configuration applies + to. + """ + prompt_creation_mode: str | None = ... + """ + Specifies whether to override the default prompt template for this + `promptType`. Set this value to `OVERRIDDEN` to use the prompt that you + provide in the `basePromptTemplate`. If you leave it as `DEFAULT`, the + agent uses a default prompt template. + """ + prompt_state: str | None = ... + """ + Specifies whether to allow the agent to carry out the step specified in + the `promptType`. If you set this value to `DISABLED`, the agent skips + that step. The default state for each `promptType` is as follows. + + - `PRE_PROCESSING` -- `DISABLED` + + - `ORCHESTRATION` -- `ENABLED` + + - `KNOWLEDGE_BASE_RESPONSE_GENERATION` -- `ENABLED` + + - `POST_PROCESSING` -- `DISABLED` + """ + base_prompt_template: str | None = ... + """ + Defines the prompt template with which to replace the default prompt + template. You can use placeholder variables in the base prompt template + to customize the prompt. For more information, see [Prompt template + placeholder + variables](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-placeholders.html). + For more information, see [Configure the prompt + templates](https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts-configure.html). + """ + inference_configuration: InferenceConfiguration | None = ... + """ + Contains inference parameters to use when the agent invokes a foundation + model in the part of the agent sequence defined by the `promptType`. For + more information, see [Inference parameters for foundation + models](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). + """ + parser_mode: str | None = ... + """ + Specifies whether to override the default parser Lambda function when + parsing the raw foundation model output in the part of the agent + sequence defined by the `promptType`. If you set the field as + `OVERRIDDEN`, the `overrideLambda` field in the + [PromptOverrideConfiguration](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptOverrideConfiguration.html) + must be specified with the ARN of a Lambda function. + """ + foundation_model: str | None = ... + """The agent's foundation model.""" + additional_model_request_fields: Document | None = ... + """ + If the Converse or ConverseStream operations support the model, + `additionalModelRequestFields` contains additional inference parameters, + beyond the base set of inference parameters in the + `inferenceConfiguration` field. + + For more information, see *Inference request parameters and response + fields for foundation models* in the Amazon Bedrock user guide. + """ + +@dataclass(kw_only=True) +class PromptFlowNodeConfiguration(_SerdeShape): + """ + Contains configurations for a prompt node in the flow. You can use a + prompt from Prompt management or you can define one in this node. If the + prompt contains variables, the inputs into this node will fill in the + variables. The output from this node is the response generated by the + model. For more information, see [Node types in a + flow](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-nodes.html) + in the Amazon Bedrock User Guide. + """ + + source_configuration: PromptFlowNodeSourceConfiguration + """ + Specifies whether the prompt is from Prompt management or defined + inline. + """ + guardrail_configuration: GuardrailConfiguration | None = ... + """ + Contains configurations for a guardrail to apply to the prompt in this + node and the response generated from it. + """ + +@dataclass(kw_only=True) +class PromptFlowNodeInlineConfiguration(_SerdeShape): + """Contains configurations for a prompt defined inline in the node.""" + + template_type: str = ... + """The type of prompt template.""" + template_configuration: PromptTemplateConfiguration + """ + Contains a prompt and variables in the prompt that can be replaced with + values at runtime. + """ + model_id: str = ... + """ + The unique identifier of the model or [inference + profile](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html) + to run inference with. + """ + inference_configuration: PromptInferenceConfiguration | None = ... + """Contains inference configurations for the prompt.""" + additional_model_request_fields: Document | None = ... + """ + Additional fields to be included in the model request for the Prompt + node. + """ + +@dataclass(kw_only=True) +class PromptFlowNodeResourceConfiguration(_SerdeShape): + """ + Contains configurations for a prompt from Prompt management to use in a + node. + """ + + prompt_arn: str = ... + """The Amazon Resource Name (ARN) of the prompt from Prompt management.""" + +@dataclass +class PromptFlowNodeSourceConfigurationResource(_SerdeShape): + """Contains configurations for a prompt from Prompt management.""" + + value: PromptFlowNodeResourceConfiguration + +@dataclass +class PromptFlowNodeSourceConfigurationInline(_SerdeShape): + """Contains configurations for a prompt that is defined inline""" + + value: PromptFlowNodeInlineConfiguration + +@dataclass +class PromptFlowNodeSourceConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +PromptFlowNodeSourceConfiguration = Union[ + PromptFlowNodeSourceConfigurationResource + | PromptFlowNodeSourceConfigurationInline + | PromptFlowNodeSourceConfigurationUnknown +] +""" +Contains configurations for a prompt and whether it is from Prompt +management or defined inline. +""" + +class _PromptFlowNodeSourceConfigurationDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> PromptFlowNodeSourceConfiguration: ... + +@dataclass +class PromptGenAiResourceAgent(_SerdeShape): + """Specifies an Amazon Bedrock agent with which to use the prompt.""" + + value: PromptAgentResource + +@dataclass +class PromptGenAiResourceUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +PromptGenAiResource = Union[PromptGenAiResourceAgent | PromptGenAiResourceUnknown] +""" +Contains specifications for a generative AI resource with which to use +the prompt. For more information, see [Create a prompt using Prompt +management](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-create.html). +""" + +class _PromptGenAiResourceDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> PromptGenAiResource: ... + +@dataclass +class PromptInferenceConfigurationText(_SerdeShape): + """Contains inference configurations for a text prompt.""" + + value: PromptModelInferenceConfiguration + +@dataclass +class PromptInferenceConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +PromptInferenceConfiguration = Union[ + PromptInferenceConfigurationText | PromptInferenceConfigurationUnknown +] +"""Contains inference configurations for the prompt.""" + +class _PromptInferenceConfigurationDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> PromptInferenceConfiguration: ... + +@dataclass(kw_only=True) +class PromptInputVariable(_SerdeShape): + """Contains information about a variable in the prompt.""" + + name: str | None = ... + """The name of the variable.""" + +@dataclass(kw_only=True) +class PromptMetadataEntry(_SerdeShape): + """ + Contains a key-value pair that defines a metadata tag and value to + attach to a prompt variant. For more information, see [Create a prompt + using Prompt + management](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-create.html). + """ + + key: str + """The key of a metadata tag for a prompt variant.""" + value: str + """The value of a metadata tag for a prompt variant.""" + +@dataclass(kw_only=True) +class PromptModelInferenceConfiguration(_SerdeShape): + """ + Contains inference configurations related to model inference for a + prompt. For more information, see [Inference + parameters](https://docs.aws.amazon.com/bedrock/latest/userguide/inference-parameters.html). + """ + + temperature: float | None = ... + """ + Controls the randomness of the response. Choose a lower value for more + predictable outputs and a higher value for more surprising outputs. + """ + top_p: float | None = ... + """ + The percentage of most-likely candidates that the model considers for + the next token. + """ + max_tokens: int | None = ... + """The maximum number of tokens to return in the response.""" + stop_sequences: list[str] | None = ... + """ + A list of strings that define sequences after which the model will stop + generating. + """ + +@dataclass(kw_only=True) +class PromptOverrideConfiguration(_SerdeShape): + """ + Contains configurations to override prompts in different parts of an + agent sequence. For more information, see [Advanced + prompts](https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts.html). + """ + + prompt_configurations: list[PromptConfiguration] + """ + Contains configurations to override a prompt template in one part of an + agent sequence. For more information, see [Advanced + prompts](https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts.html). + """ + override_lambda: str | None = ... + """ + The ARN of the Lambda function to use when parsing the raw foundation + model output in parts of the agent sequence. If you specify this field, + at least one of the `promptConfigurations` must contain a `parserMode` + value that is set to `OVERRIDDEN`. For more information, see [Parser + Lambda function in Amazon Bedrock + Agents](https://docs.aws.amazon.com/bedrock/latest/userguide/lambda-parser.html). + """ + +class PromptState(UnknownEnumMixin, StrEnum): + ENABLED = "ENABLED" + DISABLED = "DISABLED" + +@dataclass(kw_only=True) +class PromptSummary(_SerdeShape): + """ + Contains information about a prompt in your Prompt management tool. + + This data type is used in the following API operations: + + - [ListPrompts + response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_ListPrompts.html#API_agent_ListPrompts_ResponseSyntax) + """ + + name: str + """The name of the prompt.""" + description: str | None = ... + """The description of the prompt.""" + id: str + """The unique identifier of the prompt.""" + arn: str + """ + The Amazon Resource Name (ARN) of the prompt or the prompt version (if + you specified a version in the request). + """ + version: str + """The version of the prompt that this summary applies to.""" + created_at: datetime + """The time at which the prompt was created.""" + updated_at: datetime + """The time at which the prompt was last updated.""" + +@dataclass +class PromptTemplateConfigurationText(_SerdeShape): + """Contains configurations for the text in a message for a prompt.""" + + value: TextPromptTemplateConfiguration + +@dataclass +class PromptTemplateConfigurationChat(_SerdeShape): + """Contains configurations to use the prompt in a conversational format.""" + + value: ChatPromptTemplateConfiguration + +@dataclass +class PromptTemplateConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +PromptTemplateConfiguration = Union[ + PromptTemplateConfigurationText + | PromptTemplateConfigurationChat + | PromptTemplateConfigurationUnknown +] +""" +Contains the message for a prompt. For more information, see [Construct +and store reusable prompts with Prompt management in Amazon +Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management.html). +""" + +class _PromptTemplateConfigurationDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> PromptTemplateConfiguration: ... + +class PromptTemplateType(UnknownEnumMixin, StrEnum): + TEXT = "TEXT" + CHAT = "CHAT" + +class PromptType(UnknownEnumMixin, StrEnum): + PRE_PROCESSING = "PRE_PROCESSING" + ORCHESTRATION = "ORCHESTRATION" + POST_PROCESSING = "POST_PROCESSING" + KNOWLEDGE_BASE_RESPONSE_GENERATION = "KNOWLEDGE_BASE_RESPONSE_GENERATION" + MEMORY_SUMMARIZATION = "MEMORY_SUMMARIZATION" + +@dataclass(kw_only=True) +class PromptVariant(_SerdeShape): + """Contains details about a variant of the prompt.""" + + name: str + """The name of the prompt variant.""" + template_type: str + """The type of prompt template to use.""" + template_configuration: PromptTemplateConfiguration + """Contains configurations for the prompt template.""" + model_id: str | None = ... + """ + The unique identifier of the model or [inference + profile](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html) + with which to run inference on the prompt. + """ + inference_configuration: PromptInferenceConfiguration | None = ... + """Contains inference configurations for the prompt variant.""" + metadata: list[PromptMetadataEntry] | None = ... + """ + An array of objects, each containing a key-value pair that defines a + metadata tag and value to attach to a prompt variant. + """ + additional_model_request_fields: Document | None = ... + """ + Contains model-specific inference configurations that aren't in the + `inferenceConfiguration` field. To see model-specific inference + parameters, see [Inference request parameters and response fields for + foundation + models](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). + """ + gen_ai_resource: PromptGenAiResource | None = ... + """Specifies a generative AI resource with which to use the prompt.""" + +@dataclass(kw_only=True) +class PutResourcePolicyInput(_SerdeShape): + """Dataclass for PutResourcePolicyInput structure.""" + + resource_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the knowledge base to attach the + resource policy to. + """ + policy: str | JsonString | None = ... + """The JSON-formatted resource policy to associate with the knowledge base.""" + expected_revision_id: str | None = ... + """ + The expected revision identifier of the resource policy. Use this to + prevent conflicts when multiple users update the same policy + concurrently. Specify the `revisionId` from the most recent + `GetResourcePolicy` or `PutResourcePolicy` response. + """ + +@dataclass(kw_only=True) +class PutResourcePolicyOutput(_SerdeShape): + """Dataclass for PutResourcePolicyOutput structure.""" + + resource_arn: str + """The ARN of the knowledge base that the resource policy was attached to.""" + revision_id: str + """ + The revision identifier of the resource policy. Use this value in the + `expectedRevisionId` field of a subsequent `PutResourcePolicy` or + `DeleteResourcePolicy` request. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class QueryEngineType(UnknownEnumMixin, StrEnum): + REDSHIFT = "REDSHIFT" + +@dataclass(kw_only=True) +class QueryGenerationColumn(_SerdeShape): + """ + Contains information about a column in the current table for the query + engine to consider. + """ + + name: str | None = ... + """The name of the column for which the other fields in this object apply.""" + description: str | None = ... + """ + A description of the column that helps the query engine understand the + contents of the column. + """ + inclusion: str | None = ... + """ + Specifies whether to include or exclude the column during query + generation. If you specify `EXCLUDE`, the column will be ignored. If you + specify `INCLUDE`, all other columns in the table will be ignored. + """ + +@dataclass(kw_only=True) +class QueryGenerationConfiguration(_SerdeShape): + """ + Contains configurations for query generation. For more information, see + [Build a knowledge base by connecting to a structured data + source](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-build-structured.html) + in the Amazon Bedrock User Guide.. + """ + + execution_timeout_seconds: int | None = ... + """The time after which query generation will time out.""" + generation_context: QueryGenerationContext | None = ... + """Specifies configurations for context to use during query generation.""" + +@dataclass(kw_only=True) +class QueryGenerationContext(_SerdeShape): + """>Contains configurations for context to use during query generation.""" + + tables: list[QueryGenerationTable] | None = ... + """ + An array of objects, each of which defines information about a table in + the database. + """ + curated_queries: list[CuratedQuery] | None = ... + """ + An array of objects, each of which defines information about example + queries to help the query engine generate appropriate SQL queries. + """ + +@dataclass(kw_only=True) +class QueryGenerationTable(_SerdeShape): + """Contains information about a table for the query engine to consider.""" + + name: str + """The name of the table for which the other fields in this object apply.""" + description: str | None = ... + """ + A description of the table that helps the query engine understand the + contents of the table. + """ + inclusion: str | None = ... + """ + Specifies whether to include or exclude the table during query + generation. If you specify `EXCLUDE`, the table will be ignored. If you + specify `INCLUDE`, all other tables will be ignored. + """ + columns: list[QueryGenerationColumn] | None = ... + """ + An array of objects, each of which defines information about a column in + the table. + """ + +@dataclass(kw_only=True) +class RdsConfiguration(_SerdeShape): + """ + Contains details about the storage configuration of the knowledge base + in Amazon RDS. For more information, see [Create a vector index in + Amazon + RDS](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-setup-rds.html). + """ + + resource_arn: str + """The Amazon Resource Name (ARN) of the vector store.""" + credentials_secret_arn: str + """ + The Amazon Resource Name (ARN) of the secret that you created in Secrets + Manager that is linked to your Amazon RDS database. + """ + database_name: str + """The name of your Amazon RDS database.""" + table_name: str + """The name of the table in the database.""" + field_mapping: RdsFieldMapping + """ + Contains the names of the fields to which to map information about the + vector store. + """ + +@dataclass(kw_only=True) +class RdsFieldMapping(_SerdeShape): + """ + Contains the names of the fields to which to map information about the + vector store. + """ + + primary_key_field: str + """ + The name of the field in which Amazon Bedrock stores the ID for each + entry. + """ + vector_field: str + """ + The name of the field in which Amazon Bedrock stores the vector + embeddings for your data sources. + """ + text_field: str + """ + The name of the field in which Amazon Bedrock stores the raw text from + your data. The text is split according to the chunking strategy you + choose. + """ + metadata_field: str + """ + The name of the field in which Amazon Bedrock stores metadata about the + vector store. + """ + custom_metadata_field: str | None = ... + """ + Provide a name for the universal metadata field where Amazon Bedrock + will store any custom metadata from your data source. + """ + +@dataclass(kw_only=True) +class RedisEnterpriseCloudConfiguration(_SerdeShape): + """ + Contains details about the storage configuration of the knowledge base + in Redis Enterprise Cloud. For more information, see [Create a vector + index in Redis Enterprise + Cloud](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-setup-oss.html). + """ + + endpoint: str + """The endpoint URL of the Redis Enterprise Cloud database.""" + vector_index_name: str + """The name of the vector index.""" + credentials_secret_arn: str + """ + The Amazon Resource Name (ARN) of the secret that you created in Secrets + Manager that is linked to your Redis Enterprise Cloud database. + """ + field_mapping: RedisEnterpriseCloudFieldMapping + """ + Contains the names of the fields to which to map information about the + vector store. + """ + +@dataclass(kw_only=True) +class RedisEnterpriseCloudFieldMapping(_SerdeShape): + """ + Contains the names of the fields to which to map information about the + vector store. + """ + + vector_field: str + """ + The name of the field in which Amazon Bedrock stores the vector + embeddings for your data sources. + """ + text_field: str + """ + The name of the field in which Amazon Bedrock stores the raw text from + your data. The text is split according to the chunking strategy you + choose. + """ + metadata_field: str + """ + The name of the field in which Amazon Bedrock stores metadata about the + vector store. + """ + +@dataclass(kw_only=True) +class RedshiftConfiguration(_SerdeShape): + """ + Contains configurations for an Amazon Redshift database. For more + information, see [Build a knowledge base by connecting to a structured + data + source](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-build-structured.html) + in the Amazon Bedrock User Guide. + """ + + storage_configurations: list[RedshiftQueryEngineStorageConfiguration] + """Specifies configurations for Amazon Redshift database storage.""" + query_engine_configuration: RedshiftQueryEngineConfiguration + """Specifies configurations for an Amazon Redshift query engine.""" + query_generation_configuration: QueryGenerationConfiguration | None = ... + """Specifies configurations for generating queries.""" + +@dataclass(kw_only=True) +class RedshiftProvisionedAuthConfiguration(_SerdeShape): + """ + Contains configurations for authentication to an Amazon Redshift + provisioned data warehouse. Specify the type of authentication to use in + the `type` field and include the corresponding field. If you specify IAM + authentication, you don't need to include another field. + """ + + type: str + """The type of authentication to use.""" + database_user: str | None = ... + """ + The database username for authentication to an Amazon Redshift + provisioned data warehouse. + """ + username_password_secret_arn: str | None = ... + """The ARN of an Secrets Manager secret for authentication.""" + +class RedshiftProvisionedAuthType(UnknownEnumMixin, StrEnum): + IAM = "IAM" + USERNAME_PASSWORD = "USERNAME_PASSWORD" + USERNAME = "USERNAME" + +@dataclass(kw_only=True) +class RedshiftProvisionedConfiguration(_SerdeShape): + """Contains configurations for a provisioned Amazon Redshift query engine.""" + + cluster_identifier: str + """The ID of the Amazon Redshift cluster.""" + auth_configuration: RedshiftProvisionedAuthConfiguration + """Specifies configurations for authentication to Amazon Redshift.""" + +@dataclass(kw_only=True) +class RedshiftQueryEngineAwsDataCatalogStorageConfiguration(_SerdeShape): + """Contains configurations for storage in Glue Data Catalog.""" + + table_names: list[str] + """A list of names of the tables to use.""" + +@dataclass(kw_only=True) +class RedshiftQueryEngineConfiguration(_SerdeShape): + """ + Contains configurations for an Amazon Redshift query engine. Specify the + type of query engine in `type` and include the corresponding field. For + more information, see [Build a knowledge base by connecting to a + structured data + source](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-build-structured.html) + in the Amazon Bedrock User Guide. + """ + + type: str + """The type of query engine.""" + serverless_configuration: RedshiftServerlessConfiguration | None = ... + """Specifies configurations for a serverless Amazon Redshift query engine.""" + provisioned_configuration: RedshiftProvisionedConfiguration | None = ... + """Specifies configurations for a provisioned Amazon Redshift query engine.""" + +@dataclass(kw_only=True) +class RedshiftQueryEngineRedshiftStorageConfiguration(_SerdeShape): + """Contains configurations for storage in Amazon Redshift.""" + + database_name: str + """The name of the Amazon Redshift database.""" + +@dataclass(kw_only=True) +class RedshiftQueryEngineStorageConfiguration(_SerdeShape): + """ + Contains configurations for Amazon Redshift data storage. Specify the + data storage service to use in the `type` field and include the + corresponding field. For more information, see [Build a knowledge base + by connecting to a structured data + source](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-build-structured.html) + in the Amazon Bedrock User Guide. + """ + + type: str + """The data storage service to use.""" + aws_data_catalog_configuration: ( + RedshiftQueryEngineAwsDataCatalogStorageConfiguration | None + ) = ... + """Specifies configurations for storage in Glue Data Catalog.""" + redshift_configuration: RedshiftQueryEngineRedshiftStorageConfiguration | None = ... + """Specifies configurations for storage in Amazon Redshift.""" + +class RedshiftQueryEngineStorageType(UnknownEnumMixin, StrEnum): + REDSHIFT = "REDSHIFT" + AWS_DATA_CATALOG = "AWS_DATA_CATALOG" + +class RedshiftQueryEngineType(UnknownEnumMixin, StrEnum): + SERVERLESS = "SERVERLESS" + PROVISIONED = "PROVISIONED" + +@dataclass(kw_only=True) +class RedshiftServerlessAuthConfiguration(_SerdeShape): + """ + Specifies configurations for authentication to a Redshift Serverless. + Specify the type of authentication to use in the `type` field and + include the corresponding field. If you specify IAM authentication, you + don't need to include another field. + """ + + type: str + """The type of authentication to use.""" + username_password_secret_arn: str | None = ... + """The ARN of an Secrets Manager secret for authentication.""" + +class RedshiftServerlessAuthType(UnknownEnumMixin, StrEnum): + IAM = "IAM" + USERNAME_PASSWORD = "USERNAME_PASSWORD" + +@dataclass(kw_only=True) +class RedshiftServerlessConfiguration(_SerdeShape): + """ + Contains configurations for authentication to Amazon Redshift + Serverless. + """ + + workgroup_arn: str + """The ARN of the Amazon Redshift workgroup.""" + auth_configuration: RedshiftServerlessAuthConfiguration + """ + Specifies configurations for authentication to an Amazon Redshift + provisioned data warehouse. + """ + +class RelayConversationHistory(UnknownEnumMixin, StrEnum): + TO_COLLABORATOR = "TO_COLLABORATOR" + DISABLED = "DISABLED" + +class RequireConfirmation(UnknownEnumMixin, StrEnum): + """Whether the action requires user confirmation.""" + + ENABLED = "ENABLED" + DISABLED = "DISABLED" + +class RerankingMetadataSelectionMode(UnknownEnumMixin, StrEnum): + SELECTIVE = "SELECTIVE" + ALL = "ALL" + +@dataclass +class RerankingMetadataSelectiveModeConfigurationFieldsToInclude(_SerdeShape): + """Specifies the metadata fields to include in the reranking process.""" + + value: list[FieldForReranking] + +@dataclass +class RerankingMetadataSelectiveModeConfigurationFieldsToExclude(_SerdeShape): + """Specifies the metadata fields to exclude from the reranking process.""" + + value: list[FieldForReranking] + +@dataclass +class RerankingMetadataSelectiveModeConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +RerankingMetadataSelectiveModeConfiguration = Union[ + RerankingMetadataSelectiveModeConfigurationFieldsToInclude + | RerankingMetadataSelectiveModeConfigurationFieldsToExclude + | RerankingMetadataSelectiveModeConfigurationUnknown +] +""" +Configures the metadata fields to include or exclude during the +reranking process when using selective mode. +""" + +class _RerankingMetadataSelectiveModeConfigurationDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> RerankingMetadataSelectiveModeConfiguration: ... + +@dataclass(kw_only=True) +class ResourceNotFoundException(ServiceError, _SerdeShape): + """ + The specified resource Amazon Resource Name (ARN) was not found. Check + the Amazon Resource Name (ARN) and try your request again. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class RetrievalFlowNodeConfiguration(_SerdeShape): + """ + Contains configurations for a Retrieval node in a flow. This node + retrieves data from the Amazon S3 location that you specify and returns + it as the output. + """ + + service_configuration: RetrievalFlowNodeServiceConfiguration + """ + Contains configurations for the service to use for retrieving data to + return as the output from the node. + """ + +@dataclass(kw_only=True) +class RetrievalFlowNodeS3Configuration(_SerdeShape): + """ + Contains configurations for the Amazon S3 location from which to + retrieve data to return as the output from the node. + """ + + bucket_name: str = ... + """The name of the Amazon S3 bucket from which to retrieve data.""" + +@dataclass +class RetrievalFlowNodeServiceConfigurationS3(_SerdeShape): + """ + Contains configurations for the Amazon S3 location from which to + retrieve data to return as the output from the node. + """ + + value: RetrievalFlowNodeS3Configuration + +@dataclass +class RetrievalFlowNodeServiceConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +RetrievalFlowNodeServiceConfiguration = Union[ + RetrievalFlowNodeServiceConfigurationS3 + | RetrievalFlowNodeServiceConfigurationUnknown +] +""" +Contains configurations for the service to use for retrieving data to +return as the output from the node. +""" + +class _RetrievalFlowNodeServiceConfigurationDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> RetrievalFlowNodeServiceConfiguration: ... + +@dataclass(kw_only=True) +class S3Content(_SerdeShape): + """ + Contains information about the content to ingest into a knowledge base + connected to an Amazon S3 data source. + """ + + s3_location: S3Location + """The S3 location of the file containing the content to ingest.""" + +@dataclass(kw_only=True) +class S3DataSourceConfiguration(_SerdeShape): + """ + The configuration information to connect to Amazon S3 as your data + source for self-managed knowledge bases. To configure this data source + for managed knowledge bases, use + [managedKnowledgeBaseConnectorConfiguration](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_ManagedKnowledgeBaseConnectorConfiguration.html). + """ + + bucket_arn: str + """The Amazon Resource Name (ARN) of the S3 bucket that contains your data.""" + inclusion_prefixes: list[str] | None = ... + """ + A list of S3 prefixes to include certain files or content. For more + information, see [Organizing objects using + prefixes](https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-prefixes.html). + """ + bucket_owner_account_id: str | None = ... + """The account ID for the owner of the S3 bucket.""" + +@dataclass(kw_only=True) +class S3Identifier(_SerdeShape): + """The identifier information for an Amazon S3 bucket.""" + + s3_bucket_name: str | None = ... + """The name of the S3 bucket.""" + s3_object_key: str | None = ... + """The S3 object key for the S3 resource.""" + +@dataclass(kw_only=True) +class S3Location(_SerdeShape): + """An Amazon S3 location.""" + + uri: str + """The location's URI. For example, `s3://my-bucket/chunk-processor/`.""" + +@dataclass(kw_only=True) +class S3VectorsConfiguration(_SerdeShape): + """Contains the storage configuration of the knowledge base for S3 vectors.""" + + vector_bucket_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the S3 bucket where vector embeddings + are stored. This bucket contains the vector data used by the knowledge + base. + """ + index_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the vector index used for the + knowledge base. This ARN identifies the specific vector index resource + within Amazon Bedrock. + """ + index_name: str | None = ... + """ + The name of the vector index used for the knowledge base. This name + identifies the vector index within the Amazon Bedrock service. + """ + +class SalesforceAuthType(UnknownEnumMixin, StrEnum): + OAUTH2_CLIENT_CREDENTIALS = "OAUTH2_CLIENT_CREDENTIALS" + +@dataclass(kw_only=True) +class SalesforceCrawlerConfiguration(_SerdeShape): + """ + The configuration of the Salesforce content. For example, configuring + specific types of Salesforce content. + """ + + filter_configuration: CrawlFilterConfiguration | None = ... + """ + The configuration of filtering the Salesforce content. For example, + configuring regular expression patterns to include or exclude certain + content. + """ + +@dataclass(kw_only=True) +class SalesforceDataSourceConfiguration(_SerdeShape): + """ + The configuration information to connect to Salesforce as your data + source. + """ + + source_configuration: SalesforceSourceConfiguration + """The endpoint information to connect to your Salesforce data source.""" + crawler_configuration: SalesforceCrawlerConfiguration | None = ... + """ + The configuration of the Salesforce content. For example, configuring + specific types of Salesforce content. + """ + +@dataclass(kw_only=True) +class SalesforceSourceConfiguration(_SerdeShape): + """The endpoint information to connect to your Salesforce data source.""" + + host_url: str + """The Salesforce host URL or instance URL.""" + auth_type: str + """ + The supported authentication type to authenticate and connect to your + Salesforce instance. + """ + credentials_secret_arn: str + """ + The Amazon Resource Name of an Secrets Manager secret that stores your + authentication credentials for your Salesforce instance URL. For more + information on the key-value pairs that must be included in your secret, + depending on your authentication type, see [Salesforce connection + configuration](https://docs.aws.amazon.com/bedrock/latest/userguide/salesforce-data-source-connector.html#configuration-salesforce-connector). + """ + +@dataclass(kw_only=True) +class SeedUrl(_SerdeShape): + """ + The seed or starting point URL. You should be authorized to crawl the + URL. + """ + + url: str | None = ... + """A seed or starting point URL.""" + +@dataclass(kw_only=True) +class SemanticChunkingConfiguration(_SerdeShape): + """ + Settings for semantic document chunking for a data source. Semantic + chunking splits a document into into smaller documents based on groups + of similar content derived from the text with natural language + processing. + + With semantic chunking, each sentence is compared to the next to + determine how similar they are. You specify a threshold in the form of a + percentile, where adjacent sentences that are less similar than that + percentage of sentence pairs are divided into separate chunks. For + example, if you set the threshold to 90, then the 10 percent of sentence + pairs that are least similar are split. So if you have 101 sentences, + 100 sentence pairs are compared, and the 10 with the least similarity + are split, creating 11 chunks. These chunks are further split if they + exceed the max token size. + + You must also specify a buffer size, which determines whether sentences + are compared in isolation, or within a moving context window that + includes the previous and following sentence. For example, if you set + the buffer size to `1`, the embedding for sentence 10 is derived from + sentences 9, 10, and 11 combined. + """ + + max_tokens: int + """The maximum number of tokens that a chunk can contain.""" + buffer_size: int + """The buffer size.""" + breakpoint_percentile_threshold: int + """The dissimilarity threshold for splitting chunks.""" + +@dataclass(kw_only=True) +class ServerSideEncryptionConfiguration(_SerdeShape): + """ + Contains the configuration for server-side encryption for your managed + knowledge base. + """ + + kms_key_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the KMS key used to encrypt the + resource. + """ + +@dataclass(kw_only=True) +class ServiceQuotaExceededException(ServiceError, _SerdeShape): + """ + The number of requests exceeds the service quota. Resubmit your request + later. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class SessionSummaryConfiguration(_SerdeShape): + """Configuration for SESSION_SUMMARY memory type enabled for the agent.""" + + max_recent_sessions: int | None = ... + """ + Maximum number of recent session summaries to include in the agent's + prompt context. + """ + +class SharePointAuthType(UnknownEnumMixin, StrEnum): + OAUTH2_CLIENT_CREDENTIALS = "OAUTH2_CLIENT_CREDENTIALS" + OAUTH2_SHAREPOINT_APP_ONLY_CLIENT_CREDENTIALS = ( + "OAUTH2_SHAREPOINT_APP_ONLY_CLIENT_CREDENTIALS" + ) + +@dataclass(kw_only=True) +class SharePointCrawlerConfiguration(_SerdeShape): + """ + The configuration of the SharePoint content. For example, configuring + specific types of SharePoint content. + """ + + filter_configuration: CrawlFilterConfiguration | None = ... + """ + The configuration of filtering the SharePoint content. For example, + configuring regular expression patterns to include or exclude certain + content. + """ + +@dataclass(kw_only=True) +class SharePointDataSourceConfiguration(_SerdeShape): + """ + The configuration information to connect to SharePoint as your data + source for self-managed knowledge bases. + """ + + source_configuration: SharePointSourceConfiguration + """The endpoint information to connect to your SharePoint data source.""" + crawler_configuration: SharePointCrawlerConfiguration | None = ... + """ + The configuration of the SharePoint content. For example, configuring + specific types of SharePoint content. + """ + +class SharePointHostType(UnknownEnumMixin, StrEnum): + ONLINE = "ONLINE" + +@dataclass(kw_only=True) +class SharePointSourceConfiguration(_SerdeShape): + """The endpoint information to connect to your SharePoint data source.""" + + tenant_id: str | None = ... + """The identifier of your Microsoft 365 tenant.""" + domain: str + """The domain of your SharePoint instance or site URL/URLs.""" + site_urls: list[str] + """A list of one or more SharePoint site URLs.""" + host_type: str + """The supported host type, whether online/cloud or server/on-premises.""" + auth_type: str + """ + The supported authentication type to authenticate and connect to your + SharePoint site/sites. + """ + credentials_secret_arn: str + """ + The Amazon Resource Name of an Secrets Manager secret that stores your + authentication credentials for your SharePoint site/sites. For more + information on the key-value pairs that must be included in your secret, + depending on your authentication type, see [SharePoint connection + configuration](https://docs.aws.amazon.com/bedrock/latest/userguide/sharepoint-data-source-connector.html#configuration-sharepoint-connector). + """ + +class SortOrder(UnknownEnumMixin, StrEnum): + ASCENDING = "ASCENDING" + DESCENDING = "DESCENDING" + +@dataclass(kw_only=True) +class SpecificToolChoice(_SerdeShape): + """ + Defines a specific tool that the model must request. No text is + generated but the results of tool use are sent back to the model to help + generate a response. For more information, see [Use a tool to complete + an Amazon Bedrock model + response](https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html). + """ + + name: str + """The name of the tool.""" + +@dataclass(kw_only=True) +class SqlKnowledgeBaseConfiguration(_SerdeShape): + """ + Contains configurations for a knowledge base connected to an SQL + database. Specify the SQL database type in the `type` field and include + the corresponding field. For more information, see [Build a knowledge + base by connecting to a structured data + source](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-build-structured.html) + in the Amazon Bedrock User Guide. + """ + + type: str + """The type of SQL database to connect to the knowledge base.""" + redshift_configuration: RedshiftConfiguration | None = ... + """ + Specifies configurations for a knowledge base connected to an Amazon + Redshift database. + """ + +@dataclass(kw_only=True) +class StartIngestionJobInput(_SerdeShape): + """Dataclass for StartIngestionJobInput structure.""" + + knowledge_base_id: str | None = ... + """The unique identifier of the knowledge base for the data ingestion job.""" + data_source_id: str | None = ... + """ + The unique identifier of the data source you want to ingest into your + knowledge base. + """ + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If this token matches a previous + request, Amazon Bedrock ignores the request, but does not return an + error. For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + description: str | None = ... + """A description of the data ingestion job.""" + +@dataclass(kw_only=True) +class StartIngestionJobOutput(_SerdeShape): + """Dataclass for StartIngestionJobOutput structure.""" + + ingestion_job: IngestionJob + """Contains information about the data ingestion job.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class StepType(UnknownEnumMixin, StrEnum): + POST_CHUNKING = "POST_CHUNKING" + +@dataclass(kw_only=True) +class StopIngestionJobInput(_SerdeShape): + """Dataclass for StopIngestionJobInput structure.""" + + knowledge_base_id: str | None = ... + """ + The unique identifier of the knowledge base for the data ingestion job + you want to stop. + """ + data_source_id: str | None = ... + """ + The unique identifier of the data source for the data ingestion job you + want to stop. + """ + ingestion_job_id: str | None = ... + """The unique identifier of the data ingestion job you want to stop.""" + +@dataclass(kw_only=True) +class StopIngestionJobOutput(_SerdeShape): + """Dataclass for StopIngestionJobOutput structure.""" + + ingestion_job: IngestionJob + """Contains information about the stopped data ingestion job.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class StorageConfiguration(_SerdeShape): + """Contains the storage configuration of the knowledge base.""" + + type: str + """The vector store service in which the knowledge base is stored.""" + opensearch_serverless_configuration: OpenSearchServerlessConfiguration | None = ... + """ + Contains the storage configuration of the knowledge base in Amazon + OpenSearch Service. + """ + opensearch_managed_cluster_configuration: ( + OpenSearchManagedClusterConfiguration | None + ) = ... + """ + Contains details about the storage configuration of the knowledge base + in OpenSearch Managed Cluster. For more information, see [Create a + vector index in Amazon OpenSearch + Service](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-setup-osm.html). + """ + pinecone_configuration: PineconeConfiguration | None = ... + """Contains the storage configuration of the knowledge base in Pinecone.""" + redis_enterprise_cloud_configuration: RedisEnterpriseCloudConfiguration | None = ... + """ + Contains the storage configuration of the knowledge base in Redis + Enterprise Cloud. + """ + rds_configuration: RdsConfiguration | None = ... + """ + Contains details about the storage configuration of the knowledge base + in Amazon RDS. For more information, see [Create a vector index in + Amazon + RDS](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-setup-rds.html). + """ + mongo_db_atlas_configuration: MongoDbAtlasConfiguration | None = ... + """ + Contains the storage configuration of the knowledge base in MongoDB + Atlas. + """ + neptune_analytics_configuration: NeptuneAnalyticsConfiguration | None = ... + """ + Contains details about the Neptune Analytics configuration of the + knowledge base in Amazon Neptune. For more information, see [Create a + vector index in Amazon Neptune + Analytics.](https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base-setup-neptune.html). + """ + s3_vectors_configuration: S3VectorsConfiguration | None = ... + """ + The configuration settings for storing knowledge base data using S3 + vectors. This includes vector index information and S3 bucket details + for vector storage. + """ + +@dataclass(kw_only=True) +class StorageFlowNodeConfiguration(_SerdeShape): + """ + Contains configurations for a Storage node in a flow. This node stores + the input in an Amazon S3 location that you specify. + """ + + service_configuration: StorageFlowNodeServiceConfiguration + """ + Contains configurations for the service to use for storing the input + into the node. + """ + +@dataclass(kw_only=True) +class StorageFlowNodeS3Configuration(_SerdeShape): + """ + Contains configurations for the Amazon S3 location in which to store the + input into the node. + """ + + bucket_name: str = ... + """ + The name of the Amazon S3 bucket in which to store the input into the + node. + """ + +@dataclass +class StorageFlowNodeServiceConfigurationS3(_SerdeShape): + """ + Contains configurations for the Amazon S3 location in which to store the + input into the node. + """ + + value: StorageFlowNodeS3Configuration + +@dataclass +class StorageFlowNodeServiceConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +StorageFlowNodeServiceConfiguration = Union[ + StorageFlowNodeServiceConfigurationS3 | StorageFlowNodeServiceConfigurationUnknown +] +""" +Contains configurations for the service to use for storing the input +into the node. +""" + +class _StorageFlowNodeServiceConfigurationDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> StorageFlowNodeServiceConfiguration: ... + +@dataclass(kw_only=True) +class SupplementalDataStorageConfiguration(_SerdeShape): + """ + Specifies configurations for the storage location of multimedia content + (images, audio, and video) extracted from multimodal documents in your + data source. This content can be retrieved and returned to the end user + with timestamp references for audio and video segments. + """ + + storage_locations: list[SupplementalDataStorageLocation] + """ + A list of objects specifying storage locations for multimedia content + (images, audio, and video) extracted from multimodal documents in your + data source. + """ + +@dataclass(kw_only=True) +class SupplementalDataStorageLocation(_SerdeShape): + """ + Contains information about a storage location for multimedia content + (images, audio, and video) extracted from multimodal documents in your + data source. + """ + + type: str + """Specifies the storage service used for this location.""" + s3_location: S3Location | None = ... + """ + Contains information about the Amazon S3 location for the extracted + multimedia content. + """ + +class SupplementalDataStorageLocationType(UnknownEnumMixin, StrEnum): + S3 = "S3" + +class SupportedLanguages(UnknownEnumMixin, StrEnum): + PYTHON_3 = "Python_3" + +@dataclass +class SyncScheduleDaily(_SerdeShape): + """ + A daily sync that runs once a day at a system-chosen off-peak time. The + run time is not configurable. + """ + + value: DailySchedule + +@dataclass +class SyncScheduleWeekly(_SerdeShape): + """A weekly sync that runs once a week on the specified day of the week.""" + + value: WeeklySchedule + +@dataclass +class SyncScheduleMonthly(_SerdeShape): + """A monthly sync that runs once a month on the specified day of the month.""" + + value: MonthlySchedule + +@dataclass +class SyncScheduleUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +SyncSchedule = Union[ + SyncScheduleDaily | SyncScheduleWeekly | SyncScheduleMonthly | SyncScheduleUnknown +] +""" +The recurring schedule on which a managed knowledge base connector +automatically syncs its data source. Specify exactly one of `daily`, +`weekly`, or `monthly`. +""" + +class _SyncScheduleDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> SyncSchedule: ... + +@dataclass +class SystemContentBlockText(_SerdeShape): + """The text in the system prompt.""" + + value: str + +@dataclass +class SystemContentBlockCachePoint(_SerdeShape): + """Creates a cache checkpoint within a tool designation""" + + value: CachePointBlock + +@dataclass +class SystemContentBlockUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +SystemContentBlock = Union[ + SystemContentBlockText | SystemContentBlockCachePoint | SystemContentBlockUnknown +] +""" +Contains a system prompt to provide context to the model or to describe +how it should behave. For more information, see [Create a prompt using +Prompt +management](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-create.html). +""" + +class _SystemContentBlockDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> SystemContentBlock: ... + +@dataclass(kw_only=True) +class TagResourceInput(_SerdeShape): + """Dataclass for TagResourceInput structure.""" + + resource_arn: str | None = ... + """The Amazon Resource Name (ARN) of the resource to tag.""" + tags: dict[str, str] | None = ... + """ + An object containing key-value pairs that define the tags to attach to + the resource. + """ + +@dataclass(kw_only=True) +class TagResourceOutput(_SerdeShape): + """Dataclass for TagResourceOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class TextContentDoc(_SerdeShape): + """Contains information about content defined inline in text.""" + + data: str + """The text of the content.""" + +@dataclass(kw_only=True) +class TextPromptTemplateConfiguration(_SerdeShape): + """ + Contains configurations for a text prompt template. To include a + variable, enclose a word in double curly braces as in `{{variable}}`. + """ + + text: str + """The message for the prompt.""" + cache_point: CachePointBlock | None = ... + """A cache checkpoint within a template configuration.""" + input_variables: list[PromptInputVariable] | None = ... + """An array of the variables in the prompt template.""" + +@dataclass(kw_only=True) +class ThrottlingException(ServiceError, _SerdeShape): + """The number of requests exceeds the limit. Resubmit your request later.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass +class ToolToolSpec(_SerdeShape): + """The specification for the tool.""" + + value: ToolSpecification + +@dataclass +class ToolCachePoint(_SerdeShape): + """Creates a cache checkpoint within a tool designation""" + + value: CachePointBlock + +@dataclass +class ToolUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +Tool = Union[ToolToolSpec | ToolCachePoint | ToolUnknown] +""" +Contains configurations for a tool that a model can use when generating +a response. For more information, see [Use a tool to complete an Amazon +Bedrock model +response](https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html). +""" + +class _ToolDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> Tool: ... + +@dataclass +class ToolChoiceAuto(_SerdeShape): + """ + Defines tools. The model automatically decides whether to call a tool or + to generate text instead. + """ + + value: AutoToolChoice + +@dataclass +class ToolChoiceAny(_SerdeShape): + """ + Defines tools, at least one of which must be requested by the model. No + text is generated but the results of tool use are sent back to the model + to help generate a response. + """ + + value: AnyToolChoice + +@dataclass +class ToolChoiceTool(_SerdeShape): + """ + Defines a specific tool that the model must request. No text is + generated but the results of tool use are sent back to the model to help + generate a response. + """ + + value: SpecificToolChoice + +@dataclass +class ToolChoiceUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ToolChoice = Union[ToolChoiceAuto | ToolChoiceAny | ToolChoiceTool | ToolChoiceUnknown] +""" +Defines which tools the model should request when invoked. For more +information, see [Use a tool to complete an Amazon Bedrock model +response](https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html). +""" + +class _ToolChoiceDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> ToolChoice: ... + +@dataclass(kw_only=True) +class ToolConfiguration(_SerdeShape): + """ + Configuration information for the tools that the model can use when + generating a response. For more information, see [Use a tool to complete + an Amazon Bedrock model + response](https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html). + """ + + tools: list[Tool] + """An array of tools to pass to a model.""" + tool_choice: ToolChoice | None = ... + """Defines which tools the model should request when invoked.""" + +@dataclass +class ToolInputSchemaJson(_SerdeShape): + """A JSON object defining the input schema for the tool.""" + + value: Document + +@dataclass +class ToolInputSchemaUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ToolInputSchema = Union[ToolInputSchemaJson | ToolInputSchemaUnknown] +""" +The input schema for the tool. For more information, see [Use a tool to +complete an Amazon Bedrock model +response](https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html). +""" + +class _ToolInputSchemaDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> ToolInputSchema: ... + +@dataclass(kw_only=True) +class ToolSpecification(_SerdeShape): + """ + Contains a specification for a tool. For more information, see [Use a + tool to complete an Amazon Bedrock model + response](https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html). + """ + + name: str + """The name of the tool.""" + description: str | None = ... + """The description of the tool.""" + input_schema: ToolInputSchema + """The input schema for the tool.""" + strict: bool | None = ... + """Whether the tool schema is strictly enforced.""" + +@dataclass(kw_only=True) +class Transformation(_SerdeShape): + """ + A custom processing step for documents moving through a data source + ingestion pipeline. To process documents after they have been converted + into chunks, set the step to apply to `POST_CHUNKING`. + """ + + transformation_function: TransformationFunction + """A Lambda function that processes documents.""" + step_to_apply: str + """When the service applies the transformation.""" + +@dataclass(kw_only=True) +class TransformationFunction(_SerdeShape): + """A Lambda function that processes documents.""" + + transformation_lambda_configuration: TransformationLambdaConfiguration + """The Lambda function.""" + +@dataclass(kw_only=True) +class TransformationLambdaConfiguration(_SerdeShape): + """A Lambda function that processes documents.""" + + lambda_arn: str + """The function's ARN identifier.""" + +class Type(UnknownEnumMixin, StrEnum): + STRING = "string" + NUMBER = "number" + INTEGER = "integer" + BOOLEAN = "boolean" + ARRAY = "array" + +@dataclass(kw_only=True) +class UnfulfilledNodeInputFlowValidationDetails(_SerdeShape): + """Details about an unfulfilled node input with no valid connections.""" + + node: str + """The name of the node containing the unfulfilled input.""" + input: str + """ + The name of the unfulfilled input. An input is unfulfilled if there are + no data connections to it. + """ + +@dataclass(kw_only=True) +class UnknownConnectionConditionFlowValidationDetails(_SerdeShape): + """Details about an unknown condition for a connection.""" + + connection: str + """The name of the connection with the unknown condition.""" + +@dataclass(kw_only=True) +class UnknownConnectionSourceFlowValidationDetails(_SerdeShape): + """Details about an unknown source node for a connection.""" + + connection: str + """The name of the connection with the unknown source.""" + +@dataclass(kw_only=True) +class UnknownConnectionSourceOutputFlowValidationDetails(_SerdeShape): + """Details about an unknown source output for a connection.""" + + connection: str + """The name of the connection with the unknown source output.""" + +@dataclass(kw_only=True) +class UnknownConnectionTargetFlowValidationDetails(_SerdeShape): + """Details about an unknown target node for a connection.""" + + connection: str + """The name of the connection with the unknown target.""" + +@dataclass(kw_only=True) +class UnknownConnectionTargetInputFlowValidationDetails(_SerdeShape): + """Details about an unknown target input for a connection.""" + + connection: str + """The name of the connection with the unknown target input.""" + +@dataclass(kw_only=True) +class UnknownNodeInputFlowValidationDetails(_SerdeShape): + """Details about an unknown input for a node.""" + + node: str + """The name of the unknown input.""" + input: str + """The name of the node with the unknown input.""" + +@dataclass(kw_only=True) +class UnknownNodeOutputFlowValidationDetails(_SerdeShape): + """Details about an unknown output for a node.""" + + node: str + """The name of the node with the unknown output.""" + output: str + """The name of the unknown output.""" + +@dataclass(kw_only=True) +class UnreachableNodeFlowValidationDetails(_SerdeShape): + """ + Details about an unreachable node in the flow. A node is unreachable + when there are no paths to it from any starting node. + """ + + node: str + """The name of the unreachable node.""" + +@dataclass(kw_only=True) +class UnsatisfiedConnectionConditionsFlowValidationDetails(_SerdeShape): + """ + Details about unsatisfied conditions for a connection. A condition is + unsatisfied if it can never be true, for example two branches of + condition node cannot be simultaneously true. + """ + + connection: str + """The name of the connection with unsatisfied conditions.""" + +@dataclass(kw_only=True) +class UnspecifiedFlowValidationDetails(_SerdeShape): + """ + Details about an unspecified validation that doesn't fit other + categories. + """ + +@dataclass(kw_only=True) +class UntagResourceInput(_SerdeShape): + """Dataclass for UntagResourceInput structure.""" + + resource_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the resource from which to remove + tags. + """ + tag_keys: list[str] | None = ... + """A list of keys of the tags to remove from the resource.""" + +@dataclass(kw_only=True) +class UntagResourceOutput(_SerdeShape): + """Dataclass for UntagResourceOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateAgentActionGroupInput(_SerdeShape): + """Dataclass for UpdateAgentActionGroupInput structure.""" + + agent_id: str | None = ... + """The unique identifier of the agent for which to update the action group.""" + agent_version: str | None = ... + """ + The unique identifier of the agent version for which to update the + action group. + """ + action_group_id: str | None = ... + """The unique identifier of the action group.""" + action_group_name: str | None = ... + """Specifies a new name for the action group.""" + description: str | None = ... + """Specifies a new name for the action group.""" + parent_action_group_signature: str | None = ... + """ + Update the built-in or computer use action for this action group. If you + specify a value, you must leave the `description`, `apiSchema`, and + `actionGroupExecutor` fields empty for this action group. + + - To allow your agent to request the user for additional information + when trying to complete a task, set this field to `AMAZON.UserInput`. + + - To allow your agent to generate, run, and troubleshoot code when + trying to complete a task, set this field to `AMAZON.CodeInterpreter`. + + - To allow your agent to use an Anthropic computer use tool, specify one + of the following values. + + Warning: + Computer use is a new Anthropic Claude model capability (in beta) + available with Anthropic Claude 3.7 Sonnet and Claude 3.5 Sonnet v2 + only. When operating computer use functionality, we recommend taking + additional security precautions, such as executing computer actions in + virtual environments with restricted data access and limited internet + connectivity. For more information, see [Configure an Amazon Bedrock + Agent to complete tasks with computer use + tools](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-computer-use.html). + + - `ANTHROPIC.Computer` - Gives the agent permission to use the mouse + and keyboard and take screenshots. + + - `ANTHROPIC.TextEditor` - Gives the agent permission to view, create + and edit files. + + - `ANTHROPIC.Bash` - Gives the agent permission to run commands in a + bash shell. + + During orchestration, if your agent determines that it needs to invoke + an API in an action group, but doesn't have enough information to + complete the API request, it will invoke this action group instead and + return an + [Observation](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_Observation.html) + reprompting the user for more information. + """ + parent_action_group_signature_params: dict[str, str] | None = ... + """ + The configuration settings for a computer use action. + + Warning: + Computer use is a new Anthropic Claude model capability (in beta) + available with Claude 3.7 Sonnet and Claude 3.5 Sonnet v2 only. For more + information, see [Configure an Amazon Bedrock Agent to complete tasks + with computer use + tools](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-computer-use.html). + """ + action_group_executor: ActionGroupExecutor | None = ... + """ + The Amazon Resource Name (ARN) of the Lambda function containing the + business logic that is carried out upon invoking the action. + """ + action_group_state: str | None = ... + """ + Specifies whether the action group is available for the agent to invoke + or not when sending an + [InvokeAgent](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html) + request. + """ + api_schema: APISchema | None = ... + """ + Contains either details about the S3 object containing the OpenAPI + schema for the action group or the JSON or YAML-formatted payload + defining the schema. For more information, see [Action group OpenAPI + schemas](https://docs.aws.amazon.com/bedrock/latest/userguide/agents-api-schema.html). + """ + function_schema: FunctionSchema | None = ... + """ + Contains details about the function schema for the action group or the + JSON or YAML-formatted payload defining the schema. + """ + +@dataclass(kw_only=True) +class UpdateAgentActionGroupOutput(_SerdeShape): + """Dataclass for UpdateAgentActionGroupOutput structure.""" + + agent_action_group: AgentActionGroup + """Contains details about the action group that was updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateAgentAliasInput(_SerdeShape): + """Dataclass for UpdateAgentAliasInput structure.""" + + agent_id: str | None = ... + """The unique identifier of the agent.""" + agent_alias_id: str | None = ... + """The unique identifier of the alias.""" + agent_alias_name: str | None = ... + """Specifies a new name for the alias.""" + description: str | None = ... + """Specifies a new description for the alias.""" + routing_configuration: list[AgentAliasRoutingConfigurationListItem] | None = ... + """Contains details about the routing configuration of the alias.""" + alias_invocation_state: str | None = ... + """ + The invocation state for the agent alias. To pause the agent alias, set + the value to `REJECT_INVOCATIONS`. To start the agent alias running + again, set the value to `ACCEPT_INVOCATIONS`. Use the `GetAgentAlias`, + or `ListAgentAliases`, operation to get the invocation state of an agent + alias. + """ + +@dataclass(kw_only=True) +class UpdateAgentAliasOutput(_SerdeShape): + """Dataclass for UpdateAgentAliasOutput structure.""" + + agent_alias: AgentAlias + """Contains details about the alias that was updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateAgentCollaboratorInput(_SerdeShape): + """Dataclass for UpdateAgentCollaboratorInput structure.""" + + agent_id: str | None = ... + """The agent's ID.""" + agent_version: str | None = ... + """The agent's version.""" + collaborator_id: str | None = ... + """The collaborator's ID.""" + agent_descriptor: AgentDescriptor | None = ... + """An agent descriptor for the agent collaborator.""" + collaborator_name: str | None = ... + """The collaborator's name.""" + collaboration_instruction: str | None = ... + """Instruction for the collaborator.""" + relay_conversation_history: str | None = ... + """A relay conversation history for the collaborator.""" + +@dataclass(kw_only=True) +class UpdateAgentCollaboratorOutput(_SerdeShape): + """Dataclass for UpdateAgentCollaboratorOutput structure.""" + + agent_collaborator: AgentCollaborator + """Details about the collaborator.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateAgentInput(_SerdeShape): + """Dataclass for UpdateAgentInput structure.""" + + agent_id: str | None = ... + """The unique identifier of the agent.""" + agent_name: str | None = ... + """Specifies a new name for the agent.""" + instruction: str | None = ... + """ + Specifies new instructions that tell the agent what it should do and how + it should interact with users. + """ + foundation_model: str | None = ... + """ + The identifier for the model that you want to be used for orchestration + by the agent you create. + + The `modelId` to provide depends on the type of model or throughput that + you use: + + - If you use a base model, specify the model ID or its ARN. For a list + of model IDs for base models, see [Amazon Bedrock base model IDs + (on-demand + throughput)](https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns) + in the Amazon Bedrock User Guide. + + - If you use an inference profile, specify the inference profile ID or + its ARN. For a list of inference profile IDs, see [Supported Regions + and models for cross-region + inference](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference-support.html) + in the Amazon Bedrock User Guide. + + - If you use a provisioned model, specify the ARN of the Provisioned + Throughput. For more information, see [Run inference using a + Provisioned + Throughput](https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html) + in the Amazon Bedrock User Guide. + + - If you use a custom model, first purchase Provisioned Throughput for + it. Then specify the ARN of the resulting provisioned model. For more + information, see [Use a custom model in Amazon + Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html) + in the Amazon Bedrock User Guide. + + - If you use an [imported + model](https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-import-model.html), + specify the ARN of the imported model. You can get the model ARN from + a successful call to + [CreateModelImportJob](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_CreateModelImportJob.html) + or from the Imported models page in the Amazon Bedrock console. + """ + description: str | None = ... + """Specifies a new description of the agent.""" + orchestration_type: str | None = ... + """ + Specifies the type of orchestration strategy for the agent. This is set + to `DEFAULT` orchestration type, by default. + """ + custom_orchestration: CustomOrchestration | None = ... + """Contains details of the custom orchestration configured for the agent.""" + idle_session_ttl_in_seconds: int | None = ... + """ + The number of seconds for which Amazon Bedrock keeps information about a + user's conversation with the agent. + + A user interaction remains active for the amount of time specified. If + no conversation occurs during this time, the session expires and Amazon + Bedrock deletes any data provided before the timeout. + """ + agent_resource_role_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the IAM role with permissions to + invoke API operations on the agent. + """ + customer_encryption_key_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the KMS key with which to encrypt the + agent. + """ + prompt_override_configuration: PromptOverrideConfiguration | None = ... + """ + Contains configurations to override prompts in different parts of an + agent sequence. For more information, see [Advanced + prompts](https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts.html). + """ + guardrail_configuration: GuardrailConfiguration | None = ... + """ + The unique Guardrail configuration assigned to the agent when it is + updated. + """ + memory_configuration: MemoryConfiguration | None = ... + """Specifies the new memory configuration for the agent.""" + agent_collaboration: str | None = ... + """The agent's collaboration role.""" + +@dataclass(kw_only=True) +class UpdateAgentKnowledgeBaseInput(_SerdeShape): + """Dataclass for UpdateAgentKnowledgeBaseInput structure.""" + + agent_id: str | None = ... + """ + The unique identifier of the agent associated with the knowledge base + that you want to update. + """ + agent_version: str | None = ... + """ + The version of the agent associated with the knowledge base that you + want to update. + """ + knowledge_base_id: str | None = ... + """ + The unique identifier of the knowledge base that has been associated + with an agent. + """ + description: str | None = ... + """ + Specifies a new description for the knowledge base associated with an + agent. + """ + knowledge_base_state: str | None = ... + """ + Specifies whether the agent uses the knowledge base or not when sending + an + [InvokeAgent](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html) + request. + """ + +@dataclass(kw_only=True) +class UpdateAgentKnowledgeBaseOutput(_SerdeShape): + """Dataclass for UpdateAgentKnowledgeBaseOutput structure.""" + + agent_knowledge_base: AgentKnowledgeBase + """ + Contains details about the knowledge base that has been associated with + an agent. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateAgentOutput(_SerdeShape): + """Dataclass for UpdateAgentOutput structure.""" + + agent: Agent + """Contains details about the agent that was updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateDataSourceInput(_SerdeShape): + """Dataclass for UpdateDataSourceInput structure.""" + + knowledge_base_id: str | None = ... + """The unique identifier of the knowledge base for the data source.""" + data_source_id: str | None = ... + """The unique identifier of the data source.""" + name: str | None = ... + """Specifies a new name for the data source.""" + description: str | None = ... + """Specifies a new description for the data source.""" + data_source_configuration: DataSourceConfiguration | None = ... + """ + The connection configuration for the data source that you want to + update. + """ + data_deletion_policy: str | None = ... + """The data deletion policy for the data source that you want to update.""" + server_side_encryption_configuration: ServerSideEncryptionConfiguration | None = ... + """Contains details about server-side encryption of the data source.""" + vector_ingestion_configuration: VectorIngestionConfiguration | None = ... + """Contains details about how to ingest the documents in the data source.""" + +@dataclass(kw_only=True) +class UpdateDataSourceOutput(_SerdeShape): + """Dataclass for UpdateDataSourceOutput structure.""" + + data_source: DataSource + """Contains details about the data source.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateFlowAliasInput(_SerdeShape): + """Dataclass for UpdateFlowAliasInput structure.""" + + name: str | None = ... + """The name of the alias.""" + description: str | None = ... + """A description for the alias.""" + routing_configuration: list[FlowAliasRoutingConfigurationListItem] | None = ... + """Contains information about the version to which to map the alias.""" + concurrency_configuration: FlowAliasConcurrencyConfiguration | None = ... + """ + The configuration that specifies how nodes in the flow are executed in + parallel. + """ + flow_identifier: str | None = ... + """The unique identifier of the flow.""" + alias_identifier: str | None = ... + """The unique identifier of the alias.""" + +@dataclass(kw_only=True) +class UpdateFlowAliasOutput(_SerdeShape): + """Dataclass for UpdateFlowAliasOutput structure.""" + + name: str + """The name of the alias.""" + description: str | None = ... + """The description of the flow.""" + routing_configuration: list[FlowAliasRoutingConfigurationListItem] + """Contains information about the version that the alias is mapped to.""" + concurrency_configuration: FlowAliasConcurrencyConfiguration | None = ... + """ + The configuration that specifies how nodes in the flow are executed in + parallel. + """ + flow_id: str + """The unique identifier of the flow.""" + id: str + """The unique identifier of the alias.""" + arn: str + """The Amazon Resource Name (ARN) of the flow.""" + created_at: datetime + """The time at which the flow was created.""" + updated_at: datetime + """The time at which the alias was last updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateFlowInput(_SerdeShape): + """Dataclass for UpdateFlowInput structure.""" + + name: str | None = ... + """A name for the flow.""" + description: str | None = ... + """A description for the flow.""" + execution_role_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the service role with permissions to + create and manage a flow. For more information, see [Create a service + role for flows in Amazon + Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-permissions.html) + in the Amazon Bedrock User Guide. + """ + customer_encryption_key_arn: str | None = ... + """The Amazon Resource Name (ARN) of the KMS key to encrypt the flow.""" + definition: FlowDefinition | None = ... + """ + A definition of the nodes and the connections between the nodes in the + flow. + """ + flow_identifier: str | None = ... + """The unique identifier of the flow.""" + +@dataclass(kw_only=True) +class UpdateFlowOutput(_SerdeShape): + """Dataclass for UpdateFlowOutput structure.""" + + name: str + """The name of the flow.""" + description: str | None = ... + """The description of the flow.""" + execution_role_arn: str + """ + The Amazon Resource Name (ARN) of the service role with permissions to + create a flow. For more information, see [Create a service role for + flows in Amazon + Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/flows-permissions.html) + in the Amazon Bedrock User Guide. + """ + customer_encryption_key_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the KMS key that the flow was + encrypted with. + """ + id: str + """The unique identifier of the flow.""" + arn: str + """The Amazon Resource Name (ARN) of the flow.""" + status: str + """ + The status of the flow. When you submit this request, the status will be + `NotPrepared`. If updating fails, the status becomes `Failed`. + """ + created_at: datetime + """The time at which the flow was created.""" + updated_at: datetime + """The time at which the flow was last updated.""" + version: str + """ + The version of the flow. When you update a flow, the version updated is + the `DRAFT` version. + """ + definition: FlowDefinition | None = ... + """A definition of the nodes and the connections between nodes in the flow.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateKnowledgeBaseInput(_SerdeShape): + """Dataclass for UpdateKnowledgeBaseInput structure.""" + + knowledge_base_id: str | None = ... + """The unique identifier of the knowledge base to update.""" + name: str | None = ... + """Specifies a new name for the knowledge base.""" + description: str | None = ... + """Specifies a new description for the knowledge base.""" + role_arn: str | None = ... + """ + Specifies a different Amazon Resource Name (ARN) of the IAM role with + permissions to invoke API operations on the knowledge base. + """ + knowledge_base_configuration: KnowledgeBaseConfiguration | None = ... + """ + Specifies the configuration for the embeddings model used for the + knowledge base. You must use the same configuration as when the + knowledge base was created. + """ + storage_configuration: StorageConfiguration | None = ... + """ + Specifies the configuration for the vector store used for the knowledge + base. You must use the same configuration as when the knowledge base was + created. + """ + +@dataclass(kw_only=True) +class UpdateKnowledgeBaseOutput(_SerdeShape): + """Dataclass for UpdateKnowledgeBaseOutput structure.""" + + knowledge_base: KnowledgeBase + """Contains details about the knowledge base.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdatePromptInput(_SerdeShape): + """Dataclass for UpdatePromptInput structure.""" + + name: str | None = ... + """A name for the prompt.""" + description: str | None = ... + """A description for the prompt.""" + customer_encryption_key_arn: str | None = ... + """The Amazon Resource Name (ARN) of the KMS key to encrypt the prompt.""" + default_variant: str | None = ... + """ + The name of the default variant for the prompt. This value must match + the `name` field in the relevant + [PromptVariant](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptVariant.html) + object. + """ + variants: list[PromptVariant] | None = ... + """ + A list of objects, each containing details about a variant of the + prompt. + """ + prompt_identifier: str | None = ... + """The unique identifier of the prompt.""" + +@dataclass(kw_only=True) +class UpdatePromptOutput(_SerdeShape): + """Dataclass for UpdatePromptOutput structure.""" + + name: str + """The name of the prompt.""" + description: str | None = ... + """The description of the prompt.""" + customer_encryption_key_arn: str | None = ... + """The Amazon Resource Name (ARN) of the KMS key to encrypt the prompt.""" + default_variant: str | None = ... + """ + The name of the default variant for the prompt. This value must match + the `name` field in the relevant + [PromptVariant](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_PromptVariant.html) + object. + """ + variants: list[PromptVariant] | None = ... + """ + A list of objects, each containing details about a variant of the + prompt. + """ + id: str + """The unique identifier of the prompt.""" + arn: str + """The Amazon Resource Name (ARN) of the prompt.""" + version: str + """ + The version of the prompt. When you update a prompt, the version updated + is the `DRAFT` version. + """ + created_at: datetime + """The time at which the prompt was created.""" + updated_at: datetime + """The time at which the prompt was last updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UrlConfiguration(_SerdeShape): + """ + The configuration of web URLs that you want to crawl. You should be + authorized to crawl the URLs. + """ + + seed_urls: list[SeedUrl] | None = ... + """One or more seed or starting point URLs.""" + +@dataclass(kw_only=True) +class ValidateFlowDefinitionInput(_SerdeShape): + """Dataclass for ValidateFlowDefinitionInput structure.""" + + definition: FlowDefinition | None = ... + """The definition of a flow to validate.""" + +@dataclass(kw_only=True) +class ValidateFlowDefinitionOutput(_SerdeShape): + """Dataclass for ValidateFlowDefinitionOutput structure.""" + + validations: list[FlowValidation] + """ + Contains an array of objects, each of which contains an error identified + by validation. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ValidationException(ServiceError, _SerdeShape): + """ + Input validation failed. Check your request parameters and retry the + request. + """ + + field_list: list[ValidationExceptionField] | None = ... + """ + A list of objects containing fields that caused validation errors and + their corresponding validation error messages. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ValidationExceptionField(_SerdeShape): + """ + Stores information about a field passed inside a request that resulted + in an validation error. + """ + + name: str + """The name of the field.""" + message: str + """A message describing why this field failed validation.""" + +@dataclass(kw_only=True) +class VectorIngestionConfiguration(_SerdeShape): + """Contains details about how to ingest the documents in a data source.""" + + chunking_configuration: ChunkingConfiguration | None = ... + """ + Details about how to chunk the documents in the data source. A *chunk* + refers to an excerpt from a data source that is returned when the + knowledge base that it belongs to is queried. + """ + custom_transformation_configuration: CustomTransformationConfiguration | None = ... + """A custom document transformer for parsed data source documents.""" + parsing_configuration: ParsingConfiguration | None = ... + """ + Configurations for a parser to use for parsing documents in your data + source. If you exclude this field, the default parser will be used. + """ + context_enrichment_configuration: ContextEnrichmentConfiguration | None = ... + """ + The context enrichment configuration used for ingestion of the data into + the vector store. + """ + +@dataclass(kw_only=True) +class VectorKnowledgeBaseConfiguration(_SerdeShape): + """ + Contains details about the model used to create vector embeddings for + the knowledge base. + """ + + embedding_model_arn: str + """ + The Amazon Resource Name (ARN) of the model used to create vector + embeddings for the knowledge base. + """ + embedding_model_configuration: EmbeddingModelConfiguration | None = ... + """ + The embeddings model configuration details for the vector model used in + Knowledge Base. + """ + supplemental_data_storage_configuration: ( + SupplementalDataStorageConfiguration | None + ) = ... + """ + If you include multimodal data from your data source, use this object to + specify configurations for the storage location of the images extracted + from your documents. These images can be retrieved and returned to the + end user. They can also be used in generation when using + [RetrieveAndGenerate](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_RetrieveAndGenerate.html). + """ + +@dataclass(kw_only=True) +class VectorSearchBedrockRerankingConfiguration(_SerdeShape): + """ + Configures the Amazon Bedrock reranker model to improve the relevance of + retrieved results. + """ + + model_configuration: VectorSearchBedrockRerankingModelConfiguration + """Specifies the configuration for the Amazon Bedrock reranker model.""" + number_of_reranked_results: int | None = ... + """Specifies the number of results to return after reranking.""" + metadata_configuration: MetadataConfigurationForReranking | None = ... + """ + Specifies how metadata fields should be handled during the reranking + process. + """ + +@dataclass(kw_only=True) +class VectorSearchBedrockRerankingModelConfiguration(_SerdeShape): + """ + Configures the Amazon Bedrock model used for reranking retrieved + results. + """ + + model_arn: str + """The Amazon Resource Name (ARN) of the Amazon Bedrock reranker model.""" + additional_model_request_fields: dict[str, Document] | None = ... + """ + Specifies additional model-specific request parameters as key-value + pairs that are included in the request to the Amazon Bedrock reranker + model. + """ + +@dataclass(kw_only=True) +class VectorSearchRerankingConfiguration(_SerdeShape): + """ + Specifies how retrieved results from a knowledge base are reranked to + improve relevance. + """ + + type: str + """ + Specifies the type of reranking model to use. Currently, the only + supported value is `BEDROCK_RERANKING_MODEL`. + """ + bedrock_reranking_configuration: ( + VectorSearchBedrockRerankingConfiguration | None + ) = ... + """ + Specifies the configuration for using an Amazon Bedrock reranker model + to rerank retrieved results. + """ + +class VectorSearchRerankingConfigurationType(UnknownEnumMixin, StrEnum): + BEDROCK_RERANKING_MODEL = "BEDROCK_RERANKING_MODEL" + +@dataclass(kw_only=True) +class VideoConfiguration(_SerdeShape): + """ + Configuration settings for processing video content in multimodal + knowledge bases. + """ + + segmentation_configuration: VideoSegmentationConfiguration + """Configuration for segmenting video content during processing.""" + +@dataclass(kw_only=True) +class VideoExtractionConfiguration(_SerdeShape): + """Configuration for video extraction.""" + + video_extraction_status: str + """Whether video extraction is enabled or disabled.""" + +@dataclass(kw_only=True) +class VideoSegmentationConfiguration(_SerdeShape): + """ + Configuration for segmenting video content during multimodal knowledge + base ingestion. Determines how video files are divided into chunks for + processing. + """ + + fixed_length_duration: int + """ + The duration in seconds for each video segment. Video files will be + divided into chunks of this length for processing. + """ + +@dataclass(kw_only=True) +class VpcConfiguration(_SerdeShape): + """ + Contains the details of a VPC configuration, including its connection + settings, resolution mode, and current lifecycle status. + """ + + vpc_configuration_id: str + """The unique identifier of the VPC configuration.""" + status: str + """The current lifecycle status of the VPC configuration.""" + status_message: str | None = ... + """ + Additional detail about the current status, such as the cause of a + `CREATE_FAILED` or `DELETE_FAILED` status. + """ + vpc_id: str + """ + The identifier of the VPC that the knowledge base connects through to + reach the resource. + """ + subnet_ids: list[str] + """The subnets that the knowledge base uses to connect to the resource.""" + resource_target: str + """The private IPv4 address or DNS name of the resource.""" + port: int + """The port on which the resource is reached.""" + protocol: str + """The protocol used to connect to the resource.""" + resolution_mode: str + """Specifies how the resource target is resolved.""" + host_header: str | None = ... + """ + The HTTP `Host` header value sent when invoking the resource, if + configured. + """ + tls_server_name: str | None = ... + """ + The expected TLS server name that the service matches against the + Subject Alternative Names on the resource's TLS certificate. Present + when `protocol` is `HTTPS`. + """ + name: str | None = ... + """The human-readable name of the VPC configuration, if provided.""" + description: str | None = ... + """The description of the VPC configuration, if provided.""" + created_at: datetime + """The time at which the VPC configuration was created.""" + updated_at: datetime + """The time at which the VPC configuration was last updated.""" + +class VpcConfigurationStatus(UnknownEnumMixin, StrEnum): + """ + The lifecycle status of a VPC configuration. Valid values: + + - `CREATING` -- The configuration is being created. + + - `CREATED` -- The configuration is ready to use. + + - `DELETING` -- The configuration is being deleted. + + - `CREATE_FAILED` -- Creation failed. See `statusMessage` for the cause. + + - `DELETE_FAILED` -- Deletion failed. See `statusMessage` for the cause. + """ + + CREATING = "CREATING" + CREATED = "CREATED" + DELETING = "DELETING" + CREATE_FAILED = "CREATE_FAILED" + DELETE_FAILED = "DELETE_FAILED" + +@dataclass(kw_only=True) +class VpcConfigurationSummary(_SerdeShape): + """A summary of a VPC configuration returned by `ListVpcConfigurations`.""" + + vpc_configuration_id: str + """The unique identifier of the VPC configuration.""" + status: str + """The current lifecycle status of the VPC configuration.""" + status_message: str | None = ... + """ + Additional detail about the current status, such as the cause of a + failure. + """ + vpc_id: str + """ + The identifier of the VPC that the knowledge base connects through to + reach the resource. + """ + resource_target: str + """The private IPv4 address or DNS name of the resource.""" + port: int + """The port on which the resource is reached.""" + protocol: str + """The protocol used to connect to the resource.""" + resolution_mode: str + """Specifies how the resource target is resolved.""" + host_header: str | None = ... + """ + The HTTP `Host` header value sent when invoking the resource, if + configured. + """ + tls_server_name: str | None = ... + """ + The expected TLS server name that the service matches against the + Subject Alternative Names on the resource's TLS certificate. Present + when `protocol` is `HTTPS`. + """ + name: str | None = ... + """The human-readable name of the VPC configuration, if provided.""" + description: str | None = ... + """The description of the VPC configuration, if provided.""" + created_at: datetime + """The time at which the VPC configuration was created.""" + +class VpcProtocol(UnknownEnumMixin, StrEnum): + """ + The protocol used to connect to the resource. Valid values: + + - `HTTP` -- Connect over plaintext HTTP. + + - `HTTPS` -- Connect over TLS. + """ + + HTTP = "HTTP" + HTTPS = "HTTPS" + +class VpcResolutionMode(UnknownEnumMixin, StrEnum): + """ + Controls how a domain-name resource target is resolved. This applies + only when the target is a domain name; it has no effect for IP-address + targets. In all cases the resolved address must be reachable from inside + the VPC. Valid values: + + - `IN_VPC` (default, recommended) -- The target domain name is resolved + privately, using the DNS resolvers of the VPC. + + - `PUBLIC` -- The target domain name is resolved against public DNS + resolvers, for the uncommon case where the name must resolve through + public DNS but the resulting address remains reachable from the VPC. + """ + + PUBLIC = "PUBLIC" + IN_VPC = "IN_VPC" + +@dataclass(kw_only=True) +class WebCrawlerConfiguration(_SerdeShape): + """ + The configuration of web URLs that you want to crawl. You should be + authorized to crawl the URLs. + """ + + crawler_limits: WebCrawlerLimits | None = ... + """The configuration of crawl limits for the web URLs.""" + inclusion_filters: list[str] | None = ... + """ + A list of one or more inclusion regular expression patterns to include + certain URLs. If you specify an inclusion and exclusion filter/pattern + and both match a URL, the exclusion filter takes precedence and the web + content of the URL isn't crawled. + """ + exclusion_filters: list[str] | None = ... + """ + A list of one or more exclusion regular expression patterns to exclude + certain URLs. If you specify an inclusion and exclusion filter/pattern + and both match a URL, the exclusion filter takes precedence and the web + content of the URL isn't crawled. + """ + scope: str | None = ... + """ + The scope of what is crawled for your URLs. + + You can choose to crawl only web pages that belong to the same host or + primary domain. For example, only web pages that contain the seed URL + \"https://docs.aws.amazon.com/bedrock/latest/userguide/\" and no other + domains. You can choose to include sub domains in addition to the host + or primary domain. For example, web pages that contain + \"aws.amazon.com\" can also include sub domain \"docs.aws.amazon.com\". + """ + user_agent: str | None = ... + """Returns the user agent suffix for your web crawler.""" + user_agent_header: str | None = ... + """ + A string used for identifying the crawler or bot when it accesses a web + server. The user agent header value consists of the `bedrockbot`, UUID, + and a user agent suffix for your crawler (if one is provided). By + default, it is set to `bedrockbot_UUID`. You can optionally append a + custom suffix to `bedrockbot_UUID` to allowlist a specific user agent + permitted to access your source URLs. + """ + +@dataclass(kw_only=True) +class WebCrawlerLimits(_SerdeShape): + """ + The rate limits for the URLs that you want to crawl. You should be + authorized to crawl the URLs. + """ + + rate_limit: int | None = ... + """The max rate at which pages are crawled, up to 300 per minute per host.""" + max_pages: int | None = ... + """ + The max number of web pages crawled from your source URLs, up to 25,000 + pages. If the web pages exceed this limit, the data source sync will + fail and no web pages will be ingested. + """ + +@dataclass(kw_only=True) +class WebDataSourceConfiguration(_SerdeShape): + """The configuration details for the web data source.""" + + source_configuration: WebSourceConfiguration + """The source configuration details for the web data source.""" + crawler_configuration: WebCrawlerConfiguration | None = ... + """The Web Crawler configuration details for the web data source.""" + +class WebScopeType(UnknownEnumMixin, StrEnum): + HOST_ONLY = "HOST_ONLY" + SUBDOMAINS = "SUBDOMAINS" + +@dataclass(kw_only=True) +class WebSourceConfiguration(_SerdeShape): + """ + The configuration of the URL/URLs for the web content that you want to + crawl. You should be authorized to crawl the URLs. + """ + + url_configuration: UrlConfiguration + """The configuration of the URL/URLs.""" + +@dataclass(kw_only=True) +class WeeklySchedule(_SerdeShape): + """A weekly sync on a specified day of the week.""" + + day_of_week: str + """The day of the week on which the weekly sync runs.""" + +ASSOCIATE_AGENT_COLLABORATOR: APIOperation[ + AssociateAgentCollaboratorInput, AssociateAgentCollaboratorOutput +] +ASSOCIATE_AGENT_KNOWLEDGE_BASE: APIOperation[ + AssociateAgentKnowledgeBaseInput, AssociateAgentKnowledgeBaseOutput +] +CREATE_AGENT: APIOperation[CreateAgentInput, CreateAgentOutput] +CREATE_AGENT_ACTION_GROUP: APIOperation[ + CreateAgentActionGroupInput, CreateAgentActionGroupOutput +] +CREATE_AGENT_ALIAS: APIOperation[CreateAgentAliasInput, CreateAgentAliasOutput] +CREATE_DATA_SOURCE: APIOperation[CreateDataSourceInput, CreateDataSourceOutput] +CREATE_FLOW: APIOperation[CreateFlowInput, CreateFlowOutput] +CREATE_FLOW_ALIAS: APIOperation[CreateFlowAliasInput, CreateFlowAliasOutput] +CREATE_FLOW_VERSION: APIOperation[CreateFlowVersionInput, CreateFlowVersionOutput] +CREATE_KNOWLEDGE_BASE: APIOperation[CreateKnowledgeBaseInput, CreateKnowledgeBaseOutput] +CREATE_PROMPT: APIOperation[CreatePromptInput, CreatePromptOutput] +CREATE_PROMPT_VERSION: APIOperation[CreatePromptVersionInput, CreatePromptVersionOutput] +CREATE_VPC_CONFIGURATION: APIOperation[ + CreateVpcConfigurationInput, CreateVpcConfigurationOutput +] +DELETE_AGENT: APIOperation[DeleteAgentInput, DeleteAgentOutput] +DELETE_AGENT_ACTION_GROUP: APIOperation[ + DeleteAgentActionGroupInput, DeleteAgentActionGroupOutput +] +DELETE_AGENT_ALIAS: APIOperation[DeleteAgentAliasInput, DeleteAgentAliasOutput] +DELETE_AGENT_VERSION: APIOperation[DeleteAgentVersionInput, DeleteAgentVersionOutput] +DELETE_DATA_SOURCE: APIOperation[DeleteDataSourceInput, DeleteDataSourceOutput] +DELETE_FLOW: APIOperation[DeleteFlowInput, DeleteFlowOutput] +DELETE_FLOW_ALIAS: APIOperation[DeleteFlowAliasInput, DeleteFlowAliasOutput] +DELETE_FLOW_VERSION: APIOperation[DeleteFlowVersionInput, DeleteFlowVersionOutput] +DELETE_KNOWLEDGE_BASE: APIOperation[DeleteKnowledgeBaseInput, DeleteKnowledgeBaseOutput] +DELETE_KNOWLEDGE_BASE_DOCUMENTS: APIOperation[ + DeleteKnowledgeBaseDocumentsInput, DeleteKnowledgeBaseDocumentsOutput +] +DELETE_PROMPT: APIOperation[DeletePromptInput, DeletePromptOutput] +DELETE_RESOURCE_POLICY: APIOperation[ + DeleteResourcePolicyInput, DeleteResourcePolicyOutput +] +DELETE_VPC_CONFIGURATION: APIOperation[ + DeleteVpcConfigurationInput, DeleteVpcConfigurationOutput +] +DISASSOCIATE_AGENT_COLLABORATOR: APIOperation[ + DisassociateAgentCollaboratorInput, DisassociateAgentCollaboratorOutput +] +DISASSOCIATE_AGENT_KNOWLEDGE_BASE: APIOperation[ + DisassociateAgentKnowledgeBaseInput, DisassociateAgentKnowledgeBaseOutput +] +GET_AGENT: APIOperation[GetAgentInput, GetAgentOutput] +GET_AGENT_ACTION_GROUP: APIOperation[ + GetAgentActionGroupInput, GetAgentActionGroupOutput +] +GET_AGENT_ALIAS: APIOperation[GetAgentAliasInput, GetAgentAliasOutput] +GET_AGENT_COLLABORATOR: APIOperation[ + GetAgentCollaboratorInput, GetAgentCollaboratorOutput +] +GET_AGENT_KNOWLEDGE_BASE: APIOperation[ + GetAgentKnowledgeBaseInput, GetAgentKnowledgeBaseOutput +] +GET_AGENT_VERSION: APIOperation[GetAgentVersionInput, GetAgentVersionOutput] +GET_DATA_SOURCE: APIOperation[GetDataSourceInput, GetDataSourceOutput] +GET_FLOW: APIOperation[GetFlowInput, GetFlowOutput] +GET_FLOW_ALIAS: APIOperation[GetFlowAliasInput, GetFlowAliasOutput] +GET_FLOW_VERSION: APIOperation[GetFlowVersionInput, GetFlowVersionOutput] +GET_INGESTION_JOB: APIOperation[GetIngestionJobInput, GetIngestionJobOutput] +GET_KNOWLEDGE_BASE: APIOperation[GetKnowledgeBaseInput, GetKnowledgeBaseOutput] +GET_KNOWLEDGE_BASE_DOCUMENTS: APIOperation[ + GetKnowledgeBaseDocumentsInput, GetKnowledgeBaseDocumentsOutput +] +GET_PROMPT: APIOperation[GetPromptInput, GetPromptOutput] +GET_RESOURCE_POLICY: APIOperation[GetResourcePolicyInput, GetResourcePolicyOutput] +GET_VPC_CONFIGURATION: APIOperation[GetVpcConfigurationInput, GetVpcConfigurationOutput] +INGEST_KNOWLEDGE_BASE_DOCUMENTS: APIOperation[ + IngestKnowledgeBaseDocumentsInput, IngestKnowledgeBaseDocumentsOutput +] +LIST_AGENT_ACTION_GROUPS: APIOperation[ + ListAgentActionGroupsInput, ListAgentActionGroupsOutput +] +LIST_AGENT_ALIASES: APIOperation[ListAgentAliasesInput, ListAgentAliasesOutput] +LIST_AGENT_COLLABORATORS: APIOperation[ + ListAgentCollaboratorsInput, ListAgentCollaboratorsOutput +] +LIST_AGENT_KNOWLEDGE_BASES: APIOperation[ + ListAgentKnowledgeBasesInput, ListAgentKnowledgeBasesOutput +] +LIST_AGENTS: APIOperation[ListAgentsInput, ListAgentsOutput] +LIST_AGENT_VERSIONS: APIOperation[ListAgentVersionsInput, ListAgentVersionsOutput] +LIST_DATA_SOURCES: APIOperation[ListDataSourcesInput, ListDataSourcesOutput] +LIST_FLOW_ALIASES: APIOperation[ListFlowAliasesInput, ListFlowAliasesOutput] +LIST_FLOWS: APIOperation[ListFlowsInput, ListFlowsOutput] +LIST_FLOW_VERSIONS: APIOperation[ListFlowVersionsInput, ListFlowVersionsOutput] +LIST_INGESTION_JOBS: APIOperation[ListIngestionJobsInput, ListIngestionJobsOutput] +LIST_KNOWLEDGE_BASE_DOCUMENTS: APIOperation[ + ListKnowledgeBaseDocumentsInput, ListKnowledgeBaseDocumentsOutput +] +LIST_KNOWLEDGE_BASES: APIOperation[ListKnowledgeBasesInput, ListKnowledgeBasesOutput] +LIST_PROMPTS: APIOperation[ListPromptsInput, ListPromptsOutput] +LIST_TAGS_FOR_RESOURCE: APIOperation[ + ListTagsForResourceInput, ListTagsForResourceOutput +] +LIST_VPC_CONFIGURATIONS: APIOperation[ + ListVpcConfigurationsInput, ListVpcConfigurationsOutput +] +PREPARE_AGENT: APIOperation[PrepareAgentInput, PrepareAgentOutput] +PREPARE_FLOW: APIOperation[PrepareFlowInput, PrepareFlowOutput] +PUT_RESOURCE_POLICY: APIOperation[PutResourcePolicyInput, PutResourcePolicyOutput] +START_INGESTION_JOB: APIOperation[StartIngestionJobInput, StartIngestionJobOutput] +STOP_INGESTION_JOB: APIOperation[StopIngestionJobInput, StopIngestionJobOutput] +TAG_RESOURCE: APIOperation[TagResourceInput, TagResourceOutput] +UNTAG_RESOURCE: APIOperation[UntagResourceInput, UntagResourceOutput] +UPDATE_AGENT: APIOperation[UpdateAgentInput, UpdateAgentOutput] +UPDATE_AGENT_ACTION_GROUP: APIOperation[ + UpdateAgentActionGroupInput, UpdateAgentActionGroupOutput +] +UPDATE_AGENT_ALIAS: APIOperation[UpdateAgentAliasInput, UpdateAgentAliasOutput] +UPDATE_AGENT_COLLABORATOR: APIOperation[ + UpdateAgentCollaboratorInput, UpdateAgentCollaboratorOutput +] +UPDATE_AGENT_KNOWLEDGE_BASE: APIOperation[ + UpdateAgentKnowledgeBaseInput, UpdateAgentKnowledgeBaseOutput +] +UPDATE_DATA_SOURCE: APIOperation[UpdateDataSourceInput, UpdateDataSourceOutput] +UPDATE_FLOW: APIOperation[UpdateFlowInput, UpdateFlowOutput] +UPDATE_FLOW_ALIAS: APIOperation[UpdateFlowAliasInput, UpdateFlowAliasOutput] +UPDATE_KNOWLEDGE_BASE: APIOperation[UpdateKnowledgeBaseInput, UpdateKnowledgeBaseOutput] +UPDATE_PROMPT: APIOperation[UpdatePromptInput, UpdatePromptOutput] +VALIDATE_FLOW_DEFINITION: APIOperation[ + ValidateFlowDefinitionInput, ValidateFlowDefinitionOutput +] diff --git a/clients/aws-sdk-bedrock-agentcore-control/scripts/docs/generate_doc_stubs.py b/clients/aws-sdk-bedrock-agentcore-control/scripts/docs/generate_doc_stubs.py index 52d470bc..795f2e4b 100644 --- a/clients/aws-sdk-bedrock-agentcore-control/scripts/docs/generate_doc_stubs.py +++ b/clients/aws-sdk-bedrock-agentcore-control/scripts/docs/generate_doc_stubs.py @@ -126,7 +126,9 @@ class ClientInfo: class DocStubGenerator: """Generate markdown API Reference stubs for AWS SDK for Python v4 clients.""" - def __init__(self, client_dir: Path, output_dir: Path, service_name: str | None = None) -> None: + def __init__( + self, client_dir: Path, output_dir: Path, service_name: str | None = None + ) -> None: """ Initialize the documentation generator. @@ -190,7 +192,9 @@ def _analyze_client_package(self, package_name: str) -> ClientInfo: required = ("client", "config", "models") missing = [name for name in required if not package.modules.get(name)] if missing: - raise ValueError(f"Missing required modules in {package_name}: {', '.join(missing)}") + raise ValueError( + f"Missing required modules in {package_name}: {', '.join(missing)}" + ) # Parse submodules client_module = package.modules["client"] @@ -199,11 +203,15 @@ def _analyze_client_package(self, package_name: str) -> ClientInfo: client_class = self._find_class_with_suffix(client_module, "Client") if not client_class: - raise ValueError(f"No class ending with 'Client' found in {package_name}.client") + raise ValueError( + f"No class ending with 'Client' found in {package_name}.client" + ) config_class = self._find_class_with_suffix(config_module, "Config") if not config_class: - raise ValueError(f"No class ending with 'Config' found in {package_name}.config") + raise ValueError( + f"No class ending with 'Config' found in {package_name}.config" + ) plugin_alias = config_module.members.get("Plugin") if not plugin_alias: @@ -288,7 +296,9 @@ def _analyze_operation(self, operation: Function) -> OperationInfo: if output_type in stream_type_map: stream_type = stream_type_map[output_type] - stream_args = self._get_subscript_elements(returns, f"'{operation.name}' stream type") + stream_args = self._get_subscript_elements( + returns, f"'{operation.name}' stream type" + ) if stream_type in (StreamType.INPUT, StreamType.DUPLEX): event_input_type = stream_args[0].canonical_name @@ -316,7 +326,9 @@ def _analyze_operation(self, operation: Function) -> OperationInfo: def _get_expr(self, annotation: str | Expr | None, context: str) -> Expr: """Extract and validate an Expr from an annotation.""" if not isinstance(annotation, Expr): - raise TypeError(f"{context}: expected Expr, got {type(annotation).__name__}") + raise TypeError( + f"{context}: expected Expr, got {type(annotation).__name__}" + ) return annotation def _get_subscript_elements(self, expr: Expr, context: str) -> list[Expr]: @@ -330,7 +342,9 @@ def _get_subscript_elements(self, expr: Expr, context: str) -> list[Expr]: return [el for el in slice_expr.elements if isinstance(el, Expr)] return [slice_expr] - def _extract_models(self, models_module: Module, operations: list[OperationInfo]) -> ModelsInfo: + def _extract_models( + self, models_module: Module, operations: list[OperationInfo] + ) -> ModelsInfo: """Extract structures, unions, enums, and errors from models module.""" structures, unions, enums, errors = [], [], [], [] @@ -356,14 +370,16 @@ def _extract_models(self, models_module: Module, operations: list[OperationInfo] duplicates = [] for structure in structures: - if self._is_operation_io_type(structure.name, operations) or self._is_union_member( - structure.name, unions - ): + if self._is_operation_io_type( + structure.name, operations + ) or self._is_union_member(structure.name, unions): duplicates.append(structure) structures = [struct for struct in structures if struct not in duplicates] - return ModelsInfo(structures=structures, unions=unions, enums=enums, errors=errors) + return ModelsInfo( + structures=structures, unions=unions, enums=enums, errors=errors + ) def _is_union(self, member: Object | Alias) -> TypeGuard[Attribute]: """Check if a module member is a union type.""" @@ -399,7 +415,9 @@ def _extract_union_members( for name in member_names: if not (member_object := models_module.members.get(name)): raise ValueError(f"Union member '{name}' not found in models module") - members.append(TypeInfo(name=member_object.name, module_path=member_object.path)) + members.append( + TypeInfo(name=member_object.name, module_path=member_object.path) + ) return members @@ -408,7 +426,8 @@ def _is_enum(self, member: Object | Alias) -> TypeGuard[Class]: if not isinstance(member, Class): return False return any( - isinstance(base, ExprName) and base.name in ENUM_BASE_CLASSES for base in member.bases + isinstance(base, ExprName) and base.name in ENUM_BASE_CLASSES + for base in member.bases ) def _is_error(self, member: Object | Alias) -> TypeGuard[Class]: @@ -416,10 +435,13 @@ def _is_error(self, member: Object | Alias) -> TypeGuard[Class]: if not isinstance(member, Class): return False return any( - isinstance(base, ExprName) and base.name in ERROR_BASE_CLASSES for base in member.bases + isinstance(base, ExprName) and base.name in ERROR_BASE_CLASSES + for base in member.bases ) - def _is_operation_io_type(self, type_name: str, operations: list[OperationInfo]) -> bool: + def _is_operation_io_type( + self, type_name: str, operations: list[OperationInfo] + ) -> bool: """Check if a type is used as operation input/output.""" return any(type_name in (op.input.name, op.output.name) for op in operations) @@ -437,8 +459,12 @@ def _generate_client_docs(self, client_info: ClientInfo) -> bool: self._generate_type_stubs( client_info.models.structures, "structures", "Structure Class" ) - self._generate_type_stubs(client_info.models.errors, "errors", "Error Class") - self._generate_type_stubs(client_info.models.enums, "enums", "Enum Class", members=True) + self._generate_type_stubs( + client_info.models.errors, "errors", "Error Class" + ) + self._generate_type_stubs( + client_info.models.enums, "enums", "Enum Class", members=True + ) self._generate_union_stubs(client_info.models.unions) except OSError as e: logger.error(f"Failed to write documentation files: {e}") @@ -470,7 +496,9 @@ def _generate_index(self, client_info: ClientInfo) -> None: ] for method in sorted(client_info.client_methods, key=lambda x: x.name): - lines.extend([*self._mkdocs_directive(method.module_path, heading_level=4), ""]) + lines.extend( + [*self._mkdocs_directive(method.module_path, heading_level=4), ""] + ) # Operations section if client_info.operations: @@ -578,7 +606,9 @@ def _generate_operation_stubs(self, operations: list[OperationInfo]) -> None: output_path = self.output_dir / "operations" / f"{op.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb("Operations", op.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb("Operations", op.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(operations)} operation file(s)") @@ -600,7 +630,9 @@ def _generate_type_stubs( output_path = self.output_dir / category / f"{item.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb(category.title(), item.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb(category.title(), item.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(items)} {category} file(s)") @@ -624,7 +656,9 @@ def _generate_union_stubs(self, unions: list[UnionInfo]) -> None: output_path = self.output_dir / "unions" / f"{union.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb("Unions", union.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb("Unions", union.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(unions)} union file(s)") diff --git a/clients/aws-sdk-bedrock-agentcore-control/src/aws_sdk_bedrock_agentcore_control/_private/schemas.py b/clients/aws-sdk-bedrock-agentcore-control/src/aws_sdk_bedrock_agentcore_control/_private/schemas.py index fddfeca8..dc34e9a9 100644 --- a/clients/aws-sdk-bedrock-agentcore-control/src/aws_sdk_bedrock_agentcore_control/_private/schemas.py +++ b/clients/aws-sdk-bedrock-agentcore-control/src/aws_sdk_bedrock_agentcore_control/_private/schemas.py @@ -2,21837 +2,19003 @@ from types import MappingProxyType -from smithy_core.prelude import ( - BOOLEAN, - DOCUMENT, - DOUBLE, - FLOAT, - INTEGER, - LONG, - STRING as _STRING, - TIMESTAMP, - UNIT, +from smithy_core._schema_compact import StaticOperationSchema, StaticSchema + + +n0 = "com.amazonaws.bedrockagentcorecontrol" +_IC = "InlineContent" +_SV = "SchemaVersion" +_ACD = "AgentCardDefinition" +_sV = "schemaVersion" +_iC = "inlineContent" +_AD = "A2aDescriptor" +_aC = "agentCard" +_NBS = "NonBlankString" +_ADE = "AccessDeniedException" +_s = "smithy.api#error" +_c = "client" +_sE = "smithy.api#httpError" +_m = "message" +_GCBA = "GatewayConfigurationBundleArn" +_SO = "StaticOverride" +_bA = "bundleArn" +_sm = "smithy.api#required" +_bV = "bundleVersion" +_CBR = "ConfigurationBundleReference" +_TSMK = "TrafficSplitMetadataKey" +_TSMV = "TrafficSplitMetadataValue" +_TSMM = "TrafficSplitMetadataMap" +_k = "key" +_v = "value" +_TSE = "TrafficSplitEntry" +_n = "name" +_w = "weight" +_cB = "configurationBundle" +_d = "description" +_me = "metadata" +_TSEr = "TrafficSplitEntries" +_mem = "member" +_WO = "WeightedOverride" +_tS = "trafficSplit" +_CBA = "ConfigurationBundleAction" +_sO = "staticOverride" +_wO = "weightedOverride" +_TN = "TargetName" +_smi = "smithy.api#sensitive" +_SR = "StaticRoute" +_tN = "targetName" +_TTSE = "TargetTrafficSplitEntry" +_TTSEa = "TargetTrafficSplitEntries" +_WR = "WeightedRoute" +_RTTA = "RouteToTargetAction" +_sR = "staticRoute" +_wR = "weightedRoute" +_A = "Action" +_rTT = "routeToTarget" +_Ac = "Actions" +_ATCT = "ActorTokenContentType" +_NONE = "NONE" +_sVm = "smithy.api#enumValue" +_MM = "M2M" +_AIITJ = "AWS_IAM_ID_TOKEN_JWT" +_CT = "ClientToken" +_DI = "DatasetId" +_SJ = "SensitiveJson" +_DEL = "DatasetExampleList" +_IES = "InlineExamplesSource" +_e = "examples" +_SU = "S3Uri" +_SS = "S3Source" +_sU = "s3Uri" +_DST = "DataSourceType" +_iE = "inlineExamples" +_sS = "s3Source" +_ADEI = "AddDatasetExamplesInput" +_sSI = "smithy.synthetic#originalShapeId" +_cADER = "com.amazonaws.bedrockagentcorecontrol#AddDatasetExamplesRequest" +_smit = "smithy.api#input" +_dI = "datasetId" +_sL = "smithy.api#httpLabel" +_cT = "clientToken" +_sT = "smithy.api#idempotencyToken" +_so = "source" +_DA = "DatasetArn" +_EI = "ExampleId" +_EIL = "ExampleIdList" +_DS = "DatasetStatus" +_CREATING = "CREATING" +_UPDATING = "UPDATING" +_DELETING = "DELETING" +_ACTIVE = "ACTIVE" +_CF = "CREATE_FAILED" +_UF = "UPDATE_FAILED" +_DF = "DELETE_FAILED" +_ADEO = "AddDatasetExamplesOutput" +_cADERo = "com.amazonaws.bedrockagentcorecontrol#AddDatasetExamplesResponse" +_smith = "smithy.api#output" +_dA = "datasetArn" +_st = "status" +_aCd = "addedCount" +_uA = "updatedAt" +_eI = "exampleIds" +_CE = "ConflictException" +_ISE = "InternalServerException" +_se = "server" +_RNFE = "ResourceNotFoundException" +_SQEE = "ServiceQuotaExceededException" +_TE = "ThrottlingException" +_VEF = "ValidationExceptionField" +_VEFL = "ValidationExceptionFieldList" +_VER = "ValidationExceptionReason" +_CP = "CANNOT_PARSE" +_CPa = "CannotParse" +_FVF = "FIELD_VALIDATION_FAILED" +_FVFi = "FieldValidationFailed" +_IPME = "IDEMPOTENT_PARAMETER_MISMATCH_EXCEPTION" +_IPMEd = "IdempotentParameterMismatchException" +_REIOS = "ROOT_EVENT_IN_OTHER_SESSION" +_EIOS = "EventInOtherSession" +_RC = "RESOURCE_CONFLICT" +_RCe = "ResourceConflict" +_VE = "ValidationException" +_r = "reason" +_fL = "fieldList" +_ADEd = "AddDatasetExamples" +_smithy = "smithy.api#http" +_ACN = "AdditionalClaimName" +_ACV = "AdditionalClaimValue" +_AC = "AdditionalClaims" +_AMRF = "AdditionalModelRequestFields" +_AST = "AllowedScopeType" +_ASMT = "AdvertisedScopeMappingType" +_AED = "AgentEndpointDescription" +_ARI = "AgentRuntimeId" +_ARV = "AgentRuntimeVersion" +_EN = "EndpointName" +_TK = "TagKey" +_TV = "TagValue" +_TM = "TagsMap" +_CAREI = "CreateAgentRuntimeEndpointInput" +_cCARER = "com.amazonaws.bedrockagentcorecontrol#CreateAgentRuntimeEndpointRequest" +_aRI = "agentRuntimeId" +_aRV = "agentRuntimeVersion" +_t = "tags" +_ARA = "AgentRuntimeArn" +_AREA = "AgentRuntimeEndpointArn" +_DT = "DateTimestamp" +_sF = "smithy.api#timestampFormat" +_dt = "date-time" +_ARES = "AgentRuntimeEndpointStatus" +_READY = "READY" +_CAREO = "CreateAgentRuntimeEndpointOutput" +_cCARERo = "com.amazonaws.bedrockagentcorecontrol#CreateAgentRuntimeEndpointResponse" +_tV = "targetVersion" +_aREA = "agentRuntimeEndpointArn" +_aRA = "agentRuntimeArn" +_eN = "endpointName" +_cA = "createdAt" +_CARE = "CreateAgentRuntimeEndpoint" +_DAREI = "DeleteAgentRuntimeEndpointInput" +_cDARER = "com.amazonaws.bedrockagentcorecontrol#DeleteAgentRuntimeEndpointRequest" +_sQ = "smithy.api#httpQuery" +_DAREO = "DeleteAgentRuntimeEndpointOutput" +_cDARERo = "com.amazonaws.bedrockagentcorecontrol#DeleteAgentRuntimeEndpointResponse" +_DARE = "DeleteAgentRuntimeEndpoint" +_GAREI = "GetAgentRuntimeEndpointInput" +_cGARER = "com.amazonaws.bedrockagentcorecontrol#GetAgentRuntimeEndpointRequest" +_AREI = "AgentRuntimeEndpointId" +_GAREO = "GetAgentRuntimeEndpointOutput" +_cGARERo = "com.amazonaws.bedrockagentcorecontrol#GetAgentRuntimeEndpointResponse" +_lV = "liveVersion" +_lUA = "lastUpdatedAt" +_fR = "failureReason" +_i = "id" +_GARE = "GetAgentRuntimeEndpoint" +_MR = "MaxResults" +_NT = "NextToken" +_LAREI = "ListAgentRuntimeEndpointsInput" +_cLARER = "com.amazonaws.bedrockagentcorecontrol#ListAgentRuntimeEndpointsRequest" +_mR = "maxResults" +_nT = "nextToken" +_ARE = "AgentRuntimeEndpoint" +_AREg = "AgentRuntimeEndpoints" +_LAREO = "ListAgentRuntimeEndpointsOutput" +_cLARERo = "com.amazonaws.bedrockagentcorecontrol#ListAgentRuntimeEndpointsResponse" +_rE = "runtimeEndpoints" +_LARE = "ListAgentRuntimeEndpoints" +_UAREI = "UpdateAgentRuntimeEndpointInput" +_cUARER = "com.amazonaws.bedrockagentcorecontrol#UpdateAgentRuntimeEndpointRequest" +_UAREO = "UpdateAgentRuntimeEndpointOutput" +_cUARERo = "com.amazonaws.bedrockagentcorecontrol#UpdateAgentRuntimeEndpointResponse" +_UARE = "UpdateAgentRuntimeEndpoint" +_AMRT = "AgentManagedRuntimeType" +_P = "PYTHON_3_10" +_P_ = "PYTHON_3_11" +_P__ = "PYTHON_3_12" +_P___ = "PYTHON_3_13" +_P____ = "PYTHON_3_14" +_N = "NODE_22" +_SL = "S3Location" +_b = "bucket" +_p = "prefix" +_vI = "versionId" +_C = "Code" +_s_ = "s3" +_eP = "entryPoint" +_EP = "EntryPoints" +_CC = "CodeConfiguration" +_co = "code" +_ru = "runtime" +_RCU = "RuntimeContainerUri" +_CCo = "ContainerConfiguration" +_cU = "containerUri" +_ARAg = "AgentRuntimeArtifact" +_cC = "containerConfiguration" +_cCo = "codeConfiguration" +_ARN = "AgentRuntimeName" +_AA = "AllowedAudience" +_AAL = "AllowedAudienceList" +_ACl = "AllowedClient" +_ACL = "AllowedClientsList" +_ASTl = "AllowedScopesType" +_BARA = "BedrockAgentcoreResourceArn" +_HE = "HostingEnvironment" +_a = "arn" +_HELT = "HostingEnvironmentListType" +_WINT = "WorkloadIdentityNameType" +_WINLT = "WorkloadIdentityNameListType" +_AWC = "AllowedWorkloadConfiguration" +_hE = "hostingEnvironments" +_wI = "workloadIdentities" +_CMOT = "ClaimMatchOperatorType" +_EQUALS = "EQUALS" +_CONTAINS = "CONTAINS" +_CA = "CONTAINS_ANY" +_MVS = "MatchValueString" +_MVSL = "MatchValueStringList" +_CMVT = "ClaimMatchValueType" +_mVS = "matchValueString" +_mVSL = "matchValueStringList" +_ACMVT = "AuthorizingClaimMatchValueType" +_cMV = "claimMatchValue" +_cMO = "claimMatchOperator" +_ITCNT = "InboundTokenClaimNameType" +_ITCVT = "InboundTokenClaimValueType" +_STRING = "STRING" +_SA = "STRING_ARRAY" +_CCVT = "CustomClaimValidationType" +_iTCN = "inboundTokenClaimName" +_iTCVT = "inboundTokenClaimValueType" +_aCMV = "authorizingClaimMatchValue" +_CCVTu = "CustomClaimValidationsType" +_DU = "DiscoveryUrl" +_EIAT = "EndpointIpAddressType" +_IPV = "IPV4" +_IPV_ = "IPV6" +_RD = "RoutingDomain" +_SGI = "SecurityGroupIdentifier" +_SGIe = "SecurityGroupIds" +_SI = "SubnetId" +_SIu = "SubnetIds" +_VI = "VpcIdentifier" +_MVR = "ManagedVpcResource" +_vIp = "vpcIdentifier" +_sI = "subnetIds" +_eIAT = "endpointIpAddressType" +_sGI = "securityGroupIds" +_rD = "routingDomain" +_RCI = "ResourceConfigurationIdentifier" +_SMLR = "SelfManagedLatticeResource" +_rCI = "resourceConfigurationIdentifier" +_PE = "PrivateEndpoint" +_sMLR = "selfManagedLatticeResource" +_mVR = "managedVpcResource" +_PEOD = "PrivateEndpointOverrideDomain" +_PEO = "PrivateEndpointOverride" +_do = "domain" +_pE = "privateEndpoint" +_PEOr = "PrivateEndpointOverrides" +_CJWTAC = "CustomJWTAuthorizerConfiguration" +_dU = "discoveryUrl" +_aA = "allowedAudience" +_aCl = "allowedClients" +_aS = "allowedScopes" +_aSM = "advertisedScopeMapping" +_cCu = "customClaims" +_pEO = "privateEndpointOverrides" +_aWC = "allowedWorkloadConfiguration" +_ACu = "AuthorizerConfiguration" +_cJWTA = "customJWTAuthorizer" +_CPA = "CapacityProviderArn" +_CPC = "CapacityProviderConfiguration" +_cPA = "capacityProviderArn" +_D = "Description" +_EVK = "EnvironmentVariableKey" +_EVV = "EnvironmentVariableValue" +_EVM = "EnvironmentVariablesMap" +_MP = "MountPath" +_CPVN = "CapacityProviderVolumeName" +_CPVC = "CapacityProviderVolumeConfiguration" +_vN = "volumeName" +_mP = "mountPath" +_EAPA = "EfsAccessPointArn" +_EAPC = "EfsAccessPointConfiguration" +_aPA = "accessPointArn" +_SFAPA = "S3FilesAccessPointArn" +_SFAPC = "S3FilesAccessPointConfiguration" +_SSC = "SessionStorageConfiguration" +_FC = "FilesystemConfiguration" +_sSe = "sessionStorage" +_sFAP = "s3FilesAccessPoint" +_eAP = "efsAccessPoint" +_cPV = "capacityProviderVolume" +_FCi = "FilesystemConfigurations" +_LC = "LifecycleConfiguration" +_iRST = "idleRuntimeSessionTimeout" +_mL = "maxLifetime" +_NM = "NetworkMode" +_PUBLIC = "PUBLIC" +_VPC = "VPC" +_SGIec = "SecurityGroupId" +_SG = "SecurityGroups" +_S = "Subnets" +_VC = "VpcConfig" +_sG = "securityGroups" +_su = "subnets" +_rSSE = "requireServiceS3Endpoint" +_NC = "NetworkConfiguration" +_nM = "networkMode" +_nMC = "networkModeConfig" +_PV = "PlatformVersion" +_SP = "ServerProtocol" +_MCP = "MCP" +_HTTP = "HTTP" +_AA_ = "A2A" +_AGUI = "AGUI" +_PC = "ProtocolConfiguration" +_sP = "serverProtocol" +_HN = "HeaderName" +_RHA = "RequestHeaderAllowlist" +_RHC = "RequestHeaderConfiguration" +_rHA = "requestHeaderAllowlist" +_RA = "RoleArn" +_CARI = "CreateAgentRuntimeInput" +_cCARR = "com.amazonaws.bedrockagentcorecontrol#CreateAgentRuntimeRequest" +_aRN = "agentRuntimeName" +_aRAg = "agentRuntimeArtifact" +_rA = "roleArn" +_nC = "networkConfiguration" +_aCu = "authorizerConfiguration" +_rHC = "requestHeaderConfiguration" +_pC = "protocolConfiguration" +_lC = "lifecycleConfiguration" +_eV = "environmentVariables" +_fC = "filesystemConfigurations" +_cPC = "capacityProviderConfiguration" +_pV = "platformVersion" +_ARS = "AgentRuntimeStatus" +_WIA = "WorkloadIdentityArn" +_WID = "WorkloadIdentityDetails" +_wIA = "workloadIdentityArn" +_CARO = "CreateAgentRuntimeOutput" +_cCARRo = "com.amazonaws.bedrockagentcorecontrol#CreateAgentRuntimeResponse" +_wID = "workloadIdentityDetails" +_CAR = "CreateAgentRuntime" +_DARI = "DeleteAgentRuntimeInput" +_cDARR = "com.amazonaws.bedrockagentcorecontrol#DeleteAgentRuntimeRequest" +_ve = "version" +_DARO = "DeleteAgentRuntimeOutput" +_cDARRo = "com.amazonaws.bedrockagentcorecontrol#DeleteAgentRuntimeResponse" +_DAR = "DeleteAgentRuntime" +_GARI = "GetAgentRuntimeInput" +_cGARR = "com.amazonaws.bedrockagentcorecontrol#GetAgentRuntimeRequest" +_RMC = "RuntimeMetadataConfiguration" +_rMMDSV = "requireMMDSV2" +_GARO = "GetAgentRuntimeOutput" +_cGARRo = "com.amazonaws.bedrockagentcorecontrol#GetAgentRuntimeResponse" +_mC = "metadataConfiguration" +_GAR = "GetAgentRuntime" +_LARI = "ListAgentRuntimesInput" +_cLARR = "com.amazonaws.bedrockagentcorecontrol#ListAgentRuntimesRequest" +_AR = "AgentRuntime" +_ARg = "AgentRuntimes" +_LARO = "ListAgentRuntimesOutput" +_cLARRo = "com.amazonaws.bedrockagentcorecontrol#ListAgentRuntimesResponse" +_aR = "agentRuntimes" +_LAR = "ListAgentRuntimes" +_LARVI = "ListAgentRuntimeVersionsInput" +_cLARVR = "com.amazonaws.bedrockagentcorecontrol#ListAgentRuntimeVersionsRequest" +_LARVO = "ListAgentRuntimeVersionsOutput" +_cLARVRo = "com.amazonaws.bedrockagentcorecontrol#ListAgentRuntimeVersionsResponse" +_LARV = "ListAgentRuntimeVersions" +_UARI = "UpdateAgentRuntimeInput" +_cUARR = "com.amazonaws.bedrockagentcorecontrol#UpdateAgentRuntimeRequest" +_UARO = "UpdateAgentRuntimeOutput" +_cUARRo = "com.amazonaws.bedrockagentcorecontrol#UpdateAgentRuntimeResponse" +_UAR = "UpdateAgentRuntime" +_ARVS = "AgentRuntimeVersionSummary" +_ARVSL = "AgentRuntimeVersionSummaryList" +_SD = "SkillDefinition" +_SMD = "SkillMdDefinition" +_ASD = "AgentSkillsDescriptor" +_sM = "skillMd" +_sD = "skillDefinition" +_AAT = "AllowedAudienceType" +_HQPN = "HttpQueryParameterName" +_AQP = "AllowedQueryParameters" +_HHN = "HttpHeaderName" +_ARH = "AllowedRequestHeaders" +_ARHl = "AllowedResponseHeaders" +_ASLV = "AllowedStringListValue" +_ASLVL = "AllowedStringListValuesList" +_ASV = "AllowedStringValue" +_ASVL = "AllowedStringValuesList" +_AKCPAT = "ApiKeyCredentialProviderArnType" +_DAKT = "DefaultApiKeyType" +_SJKT = "SecretJsonKeyType" +_SIT = "SecretIdType" +_SRe = "SecretReference" +_sIe = "secretId" +_jK = "jsonKey" +_SST = "SecretSourceType" +_MANAGED = "MANAGED" +_EXTERNAL = "EXTERNAL" +_CPN = "CredentialProviderName" +_CAKCPI = "CreateApiKeyCredentialProviderInput" +_cCAKCPR = "com.amazonaws.bedrockagentcorecontrol#CreateApiKeyCredentialProviderRequest" +_aK = "apiKey" +_smithya = "smithy.api#default" +_v_ = "" +_aKSC = "apiKeySecretConfig" +_aKSS = "apiKeySecretSource" +_SAe = "SecretArn" +_Se = "Secret" +_sA = "secretArn" +_CAKCPO = "CreateApiKeyCredentialProviderOutput" +_cCAKCPRo = ( + "com.amazonaws.bedrockagentcorecontrol#CreateApiKeyCredentialProviderResponse" +) +_aKSA = "apiKeySecretArn" +_aKSJK = "apiKeySecretJsonKey" +_cPAr = "credentialProviderArn" +_DFe = "DecryptionFailure" +_EF = "EncryptionFailure" +_RLEE = "ResourceLimitExceededException" +_UE = "UnauthorizedException" +_CAKCP = "CreateApiKeyCredentialProvider" +_DAKCPI = "DeleteApiKeyCredentialProviderInput" +_cDAKCPR = "com.amazonaws.bedrockagentcorecontrol#DeleteApiKeyCredentialProviderRequest" +_DAKCPO = "DeleteApiKeyCredentialProviderOutput" +_cDAKCPRo = ( + "com.amazonaws.bedrockagentcorecontrol#DeleteApiKeyCredentialProviderResponse" +) +_DAKCP = "DeleteApiKeyCredentialProvider" +_GAKCPI = "GetApiKeyCredentialProviderInput" +_cGAKCPR = "com.amazonaws.bedrockagentcorecontrol#GetApiKeyCredentialProviderRequest" +_GAKCPO = "GetApiKeyCredentialProviderOutput" +_cGAKCPRo = "com.amazonaws.bedrockagentcorecontrol#GetApiKeyCredentialProviderResponse" +_cTr = "createdTime" +_lUT = "lastUpdatedTime" +_GAKCP = "GetApiKeyCredentialProvider" +_LAKCPI = "ListApiKeyCredentialProvidersInput" +_cLAKCPR = "com.amazonaws.bedrockagentcorecontrol#ListApiKeyCredentialProvidersRequest" +_AKCPI = "ApiKeyCredentialProviderItem" +_AKCP = "ApiKeyCredentialProviders" +_LAKCPO = "ListApiKeyCredentialProvidersOutput" +_cLAKCPRo = ( + "com.amazonaws.bedrockagentcorecontrol#ListApiKeyCredentialProvidersResponse" +) +_cP = "credentialProviders" +_LAKCP = "ListApiKeyCredentialProviders" +_UAKCPI = "UpdateApiKeyCredentialProviderInput" +_cUAKCPR = "com.amazonaws.bedrockagentcorecontrol#UpdateApiKeyCredentialProviderRequest" +_UAKCPO = "UpdateApiKeyCredentialProviderOutput" +_cUAKCPRo = ( + "com.amazonaws.bedrockagentcorecontrol#UpdateApiKeyCredentialProviderResponse" +) +_UAKCP = "UpdateApiKeyCredentialProvider" +_BPI = "BrowserProfileId" +_BPN = "BrowserProfileName" +_CBPI = "CreateBrowserProfileInput" +_cCBPR = "com.amazonaws.bedrockagentcorecontrol#CreateBrowserProfileRequest" +_BPA = "BrowserProfileArn" +_BPS = "BrowserProfileStatus" +_DELETED = "DELETED" +_SAVING = "SAVING" +_CBPO = "CreateBrowserProfileOutput" +_cCBPRo = "com.amazonaws.bedrockagentcorecontrol#CreateBrowserProfileResponse" +_pI = "profileId" +_pA = "profileArn" +_CBP = "CreateBrowserProfile" +_DBPI = "DeleteBrowserProfileInput" +_cDBPR = "com.amazonaws.bedrockagentcorecontrol#DeleteBrowserProfileRequest" +_DBPO = "DeleteBrowserProfileOutput" +_cDBPRo = "com.amazonaws.bedrockagentcorecontrol#DeleteBrowserProfileResponse" +_lSA = "lastSavedAt" +_DBP = "DeleteBrowserProfile" +_GBPI = "GetBrowserProfileInput" +_cGBPR = "com.amazonaws.bedrockagentcorecontrol#GetBrowserProfileRequest" +_BI = "BrowserId" +_BSI = "BrowserSessionId" +_GBPO = "GetBrowserProfileOutput" +_cGBPRo = "com.amazonaws.bedrockagentcorecontrol#GetBrowserProfileResponse" +_lSBSI = "lastSavedBrowserSessionId" +_lSBI = "lastSavedBrowserId" +_GBP = "GetBrowserProfile" +_LBPI = "ListBrowserProfilesInput" +_cLBPR = "com.amazonaws.bedrockagentcorecontrol#ListBrowserProfilesRequest" +_BPSr = "BrowserProfileSummary" +_BPSro = "BrowserProfileSummaries" +_LBPO = "ListBrowserProfilesOutput" +_cLBPRo = "com.amazonaws.bedrockagentcorecontrol#ListBrowserProfilesResponse" +_pS = "profileSummaries" +_LBP = "ListBrowserProfiles" +_BSCI = "BrowserSigningConfigInput" +_en = "enabled" +_TSA = "ToolSecretArn" +_SML = "SecretsManagerLocation" +_CL = "CertificateLocation" +_sMe = "secretsManager" +_Ce = "Certificate" +_l = "location" +_Cer = "Certificates" +_RL = "ResourceLocation" +_BEPT = "BrowserEnterprisePolicyType" +_RECOMMENDED = "RECOMMENDED" +_BEP = "BrowserEnterprisePolicy" +_ty = "type" +_BEPr = "BrowserEnterprisePolicies" +_EFSA = "EfsFileSystemArn" +_EC = "EfsConfiguration" +_fSA = "fileSystemArn" +_SFFSA = "S3FilesFileSystemArn" +_SFC = "S3FilesConfiguration" +_TFSC = "ToolsFileSystemConfiguration" +_sFC = "s3FilesConfiguration" +_eC = "efsConfiguration" +_TFSCo = "ToolsFileSystemConfigurations" +_SN = "SandboxName" +_BNM = "BrowserNetworkMode" +_BNC = "BrowserNetworkConfiguration" +_vC = "vpcConfig" +_RCec = "RecordingConfig" +_sLo = "s3Location" +_CBI = "CreateBrowserInput" +_cCBR = "com.amazonaws.bedrockagentcorecontrol#CreateBrowserRequest" +_eRA = "executionRoleArn" +_re = "recording" +_bS = "browserSigning" +_ePn = "enterprisePolicies" +_ce = "certificates" +_BA = "BrowserArn" +_BS = "BrowserStatus" +_CBO = "CreateBrowserOutput" +_cCBRo = "com.amazonaws.bedrockagentcorecontrol#CreateBrowserResponse" +_bI = "browserId" +_bAr = "browserArn" +_CB = "CreateBrowser" +_DBI = "DeleteBrowserInput" +_cDBR = "com.amazonaws.bedrockagentcorecontrol#DeleteBrowserRequest" +_DBO = "DeleteBrowserOutput" +_cDBRo = "com.amazonaws.bedrockagentcorecontrol#DeleteBrowserResponse" +_DB = "DeleteBrowser" +_GBI = "GetBrowserInput" +_cGBR = "com.amazonaws.bedrockagentcorecontrol#GetBrowserRequest" +_BSCO = "BrowserSigningConfigOutput" +_GBO = "GetBrowserOutput" +_cGBRo = "com.amazonaws.bedrockagentcorecontrol#GetBrowserResponse" +_GB = "GetBrowser" +_RT = "ResourceType" +_SYSTEM = "SYSTEM" +_CUSTOM = "CUSTOM" +_LBI = "ListBrowsersInput" +_cLBR = "com.amazonaws.bedrockagentcorecontrol#ListBrowsersRequest" +_BSr = "BrowserSummary" +_BSro = "BrowserSummaries" +_LBO = "ListBrowsersOutput" +_cLBRo = "com.amazonaws.bedrockagentcorecontrol#ListBrowsersResponse" +_bSr = "browserSummaries" +_LB = "ListBrowsers" +_CPI = "CapacityProviderId" +_CRP = "CapacityReservationPreference" +_CRO = "CAPACITY_RESERVATIONS_ONLY" +_cro = "capacity-reservations-only" +_OPEN = "OPEN" +_o = "open" +_no = "none" +_CRI = "CapacityReservationId" +_CRRGA = "CapacityReservationResourceGroupArn" +_CRT = "CapacityReservationTarget" +_cRI = "capacityReservationId" +_cRRGA = "capacityReservationResourceGroupArn" +_CRS = "CapacityReservationSpecification" +_cRP = "capacityReservationPreference" +_cRT = "capacityReservationTarget" +_DN = "DeviceName" +_ECI = "EbsCardIndex" +_VIo = "VolumeIops" +_KKI = "KmsKeyId" +_ESI = "EbsSnapshotId" +_VT = "VolumeThroughput" +_EVIR = "EbsVolumeInitializationRate" +_VSGB = "VolumeSizeGiB" +_EVT = "EbsVolumeType" +_STANDARD = "STANDARD" +_sta = "standard" +_IO = "IO1" +_io = "io1" +_IO_ = "IO2" +_io_ = "io2" +_GP = "GP2" +_g = "gp2" +_SC = "SC1" +_sc = "sc1" +_ST = "ST1" +_st_ = "st1" +_GP_ = "GP3" +_gp = "gp3" +_EEBSVC = "EphemeralEBSVolumeConfiguration" +_vT = "volumeType" +_iop = "iops" +_th = "throughput" +_enc = "encrypted" +_kKI = "kmsKeyId" +_sIn = "snapshotId" +_vS = "volumeSize" +_vIR = "volumeInitializationRate" +_eCI = "ebsCardIndex" +_VDN = "VirtualDeviceName" +_EBDM = "EphemeralBlockDeviceMapping" +_dN = "deviceName" +_vNi = "virtualName" +_eb = "ebs" +_EBDML = "EphemeralBlockDeviceMappingList" +_IPA = "InstanceProfileArn" +_ECIT = "EC2InstanceType" +_ITL = "InstanceTypeList" +_IR = "InstanceRequirements" +_aIT = "allowedInstanceTypes" +_LCA = "LicenseConfigurationArn" +_LS = "LicenseSpecification" +_lCA = "licenseConfigurationArn" +_LSL = "LicenseSpecificationList" +_M = "Monitoring" +_BASIC = "BASIC" +_DETAILED = "DETAILED" +_OS = "OperatingSystem" +_LX = "LINUX_X86_64" +_LA = "LINUX_ARM64" +_SSHKN = "SSHKeyName" +_LP = "LaunchParameters" +_oS = "operatingSystem" +_iR = "instanceRequirements" +_eVp = "ephemeralVolumes" +_mo = "monitoring" +_lS = "licenseSpecifications" +_cRS = "capacityReservationSpecification" +_sKN = "sshKeyName" +_iPA = "instanceProfileArn" +_pT = "propagatedTags" +_LTS = "LaunchTemplateSource" +_lP = "launchParameters" +_ILC = "InstanceLifecycleConfiguration" +_iIT = "idleInstanceTimeout" +_RVC = "RootVolumeConfiguration" +_fSGB = "freeSpaceGiB" +_VN = "VolumeName" +_EVC = "EbsVolumeConfiguration" +_sGB = "sizeGiB" +_VCo = "VolumeConfiguration" +_eCb = "ebsConfiguration" +_VCL = "VolumeConfigurationList" +_SGIL = "SecurityGroupIdList" +_SIL = "SubnetIdList" +_VCp = "VpcConfiguration" +_ECc = "Ec2Configuration" +_lTS = "launchTemplateSource" +_vCp = "vpcConfiguration" +_vo = "volumes" +_rV = "rootVolume" +_CCom = "ComputeConfiguration" +_eCc = "ec2Configuration" +_CPNa = "CapacityProviderName" +_PCe = "PermissionsConfiguration" +_cPORA = "capacityProviderOperatorRoleArn" +_CCPI = "CreateCapacityProviderInput" +_pCe = "permissionsConfiguration" +_cCom = "computeConfiguration" +_CPS = "CapacityProviderStatus" +_CCPO = "CreateCapacityProviderOutput" +_cPI = "capacityProviderId" +_RCE = "RetryableConflictException" +_CCP = "CreateCapacityProvider" +_DCPI = "DeleteCapacityProviderInput" +_DCPO = "DeleteCapacityProviderOutput" +_DCP = "DeleteCapacityProvider" +_GCPI = "GetCapacityProviderInput" +_CPSC = "CapacityProviderStatusCode" +_VE_ = "VALIDATION_ERROR" +_QE = "QUOTA_EXCEEDED" +_THROTTLED = "THROTTLED" +_ISE_ = "INTERNAL_SERVER_EXCEPTION" +_GCPO = "GetCapacityProviderOutput" +_sC = "statusCode" +_sRt = "statusReason" +_GCP = "GetCapacityProvider" +_LARVBCPI = "ListAgentRuntimeVersionsByCapacityProviderInput" +_LARVBCPO = "ListAgentRuntimeVersionsByCapacityProviderOutput" +_LARVBCP = "ListAgentRuntimeVersionsByCapacityProvider" +_LCPI = "ListCapacityProvidersInput" +_CPSa = "CapacityProviderSummary" +_CPL = "CapacityProviderList" +_LCPO = "ListCapacityProvidersOutput" +_cPa = "capacityProviders" +_LCP = "ListCapacityProviders" +_UD = "UpdatedDescription" +_oV = "optionalValue" +_UCPI = "UpdateCapacityProviderInput" +_UCPO = "UpdateCapacityProviderOutput" +_UCP = "UpdateCapacityProvider" +_CII = "CodeInterpreterId" +_CINM = "CodeInterpreterNetworkMode" +_SANDBOX = "SANDBOX" +_CINC = "CodeInterpreterNetworkConfiguration" +_CCII = "CreateCodeInterpreterInput" +_cCCIR = "com.amazonaws.bedrockagentcorecontrol#CreateCodeInterpreterRequest" +_CIA = "CodeInterpreterArn" +_CIS = "CodeInterpreterStatus" +_CCIO = "CreateCodeInterpreterOutput" +_cCCIRo = "com.amazonaws.bedrockagentcorecontrol#CreateCodeInterpreterResponse" +_cII = "codeInterpreterId" +_cIA = "codeInterpreterArn" +_CCI = "CreateCodeInterpreter" +_DCII = "DeleteCodeInterpreterInput" +_cDCIR = "com.amazonaws.bedrockagentcorecontrol#DeleteCodeInterpreterRequest" +_DCIO = "DeleteCodeInterpreterOutput" +_cDCIRo = "com.amazonaws.bedrockagentcorecontrol#DeleteCodeInterpreterResponse" +_DCI = "DeleteCodeInterpreter" +_GCII = "GetCodeInterpreterInput" +_cGCIR = "com.amazonaws.bedrockagentcorecontrol#GetCodeInterpreterRequest" +_GCIO = "GetCodeInterpreterOutput" +_cGCIRo = "com.amazonaws.bedrockagentcorecontrol#GetCodeInterpreterResponse" +_GCI = "GetCodeInterpreter" +_LCII = "ListCodeInterpretersInput" +_cLCIR = "com.amazonaws.bedrockagentcorecontrol#ListCodeInterpretersRequest" +_CISo = "CodeInterpreterSummary" +_CISod = "CodeInterpreterSummaries" +_LCIO = "ListCodeInterpretersOutput" +_cLCIRo = "com.amazonaws.bedrockagentcorecontrol#ListCodeInterpretersResponse" +_cIS = "codeInterpreterSummaries" +_LCI = "ListCodeInterpreters" +_CBIo = "ConfigurationBundleId" +_BN = "BranchName" +_CBN = "ConfigurationBundleName" +_CI = "ComponentIdentifier" +_CComp = "ComponentConfiguration" +_con = "configuration" +_CCM = "ComponentConfigurationMap" +_VCBS = "VersionCreatedBySource" +_CBD = "ConfigurationBundleDescription" +_KKA = "KmsKeyArn" +_CCBI = "CreateConfigurationBundleInput" +_cCCBR = "com.amazonaws.bedrockagentcorecontrol#CreateConfigurationBundleRequest" +_bN = "bundleName" +_com = "components" +_bNr = "branchName" +_cM = "commitMessage" +_cBr = "createdBy" +_kKA = "kmsKeyArn" +_CBAo = "ConfigurationBundleArn" +_CBV = "ConfigurationBundleVersion" +_CCBO = "CreateConfigurationBundleOutput" +_cCCBRo = "com.amazonaws.bedrockagentcorecontrol#CreateConfigurationBundleResponse" +_bIu = "bundleId" +_CCB = "CreateConfigurationBundle" +_DCBI = "DeleteConfigurationBundleInput" +_cDCBR = "com.amazonaws.bedrockagentcorecontrol#DeleteConfigurationBundleRequest" +_CBS = "ConfigurationBundleStatus" +_DCBO = "DeleteConfigurationBundleOutput" +_cDCBRo = "com.amazonaws.bedrockagentcorecontrol#DeleteConfigurationBundleResponse" +_DCB = "DeleteConfigurationBundle" +_GCBI = "GetConfigurationBundleInput" +_cGCBR = "com.amazonaws.bedrockagentcorecontrol#GetConfigurationBundleRequest" +_CBVL = "ConfigurationBundleVersionList" +_VLM = "VersionLineageMetadata" +_pVI = "parentVersionIds" +_GCBO = "GetConfigurationBundleOutput" +_cGCBRo = "com.amazonaws.bedrockagentcorecontrol#GetConfigurationBundleResponse" +_lM = "lineageMetadata" +_GCB = "GetConfigurationBundle" +_GCBVI = "GetConfigurationBundleVersionInput" +_cGCBVR = "com.amazonaws.bedrockagentcorecontrol#GetConfigurationBundleVersionRequest" +_GCBVO = "GetConfigurationBundleVersionOutput" +_cGCBVRo = "com.amazonaws.bedrockagentcorecontrol#GetConfigurationBundleVersionResponse" +_vCA = "versionCreatedAt" +_GCBV = "GetConfigurationBundleVersion" +_LCBI = "ListConfigurationBundlesInput" +_cLCBR = "com.amazonaws.bedrockagentcorecontrol#ListConfigurationBundlesRequest" +_CBSo = "ConfigurationBundleSummary" +_CBSL = "ConfigurationBundleSummaryList" +_LCBO = "ListConfigurationBundlesOutput" +_cLCBRo = "com.amazonaws.bedrockagentcorecontrol#ListConfigurationBundlesResponse" +_bu = "bundles" +_LCB = "ListConfigurationBundles" +_VF = "VersionFilter" +_cBN = "createdByName" +_lPB = "latestPerBranch" +_LCBVI = "ListConfigurationBundleVersionsInput" +_cLCBVR = "com.amazonaws.bedrockagentcorecontrol#ListConfigurationBundleVersionsRequest" +_f = "filter" +_CBVS = "ConfigurationBundleVersionSummary" +_CBVSL = "ConfigurationBundleVersionSummaryList" +_LCBVO = "ListConfigurationBundleVersionsOutput" +_cLCBVRo = ( + "com.amazonaws.bedrockagentcorecontrol#ListConfigurationBundleVersionsResponse" +) +_ver = "versions" +_LCBV = "ListConfigurationBundleVersions" +_UCBI = "UpdateConfigurationBundleInput" +_cUCBR = "com.amazonaws.bedrockagentcorecontrol#UpdateConfigurationBundleRequest" +_UCBO = "UpdateConfigurationBundleOutput" +_cUCBRo = "com.amazonaws.bedrockagentcorecontrol#UpdateConfigurationBundleResponse" +_UCB = "UpdateConfigurationBundle" +_CPAT = "ConsentPortalArnType" +_CPDT = "ConsentPortalDescriptionType" +_CPIo = "ConsentPortalIdentifier" +_OACPA = "OAuth2CredentialProviderArn" +_CPIC = "ConsentPortalIdpConfig" +_sco = "scopes" +_au = "audience" +_CPNT = "ConsentPortalNameType" +_CPSIT = "ConsentPortalSourceIdentifierType" +_CPST = "ConsentPortalSourceType" +_AG = "AGENTCORE_GATEWAY" +_ag = "agentcore-gateway" +_CPSo = "ConsentPortalSource" +_id = "identifier" +_CPSon = "ConsentPortalSources" +_CPSons = "ConsentPortalStatus" +_FAILED = "FAILED" +_ERAT = "ExecutionRoleArnType" +_CCPIr = "CreateConsentPortalInput" +_cCCPR = "com.amazonaws.bedrockagentcorecontrol#CreateConsentPortalRequest" +_iCd = "idpConfig" +_sou = "sources" +_CPIT = "ConsentPortalIdType" +_PUT = "PortalUrlType" +_SRT = "StatusReasonType" +_CCPOr = "CreateConsentPortalOutput" +_cCCPRo = "com.amazonaws.bedrockagentcorecontrol#CreateConsentPortalResponse" +_cPAo = "consentPortalArn" +_cPIo = "consentPortalId" +_pU = "portalUrl" +_CCPr = "CreateConsentPortal" +_DCPIe = "DeleteConsentPortalInput" +_cDCPR = "com.amazonaws.bedrockagentcorecontrol#DeleteConsentPortalRequest" +_cPIon = "consentPortalIdentifier" +_DCPOe = "DeleteConsentPortalOutput" +_cDCPRo = "com.amazonaws.bedrockagentcorecontrol#DeleteConsentPortalResponse" +_DCPe = "DeleteConsentPortal" +_GCPIe = "GetConsentPortalInput" +_cGCPR = "com.amazonaws.bedrockagentcorecontrol#GetConsentPortalRequest" +_GCPOe = "GetConsentPortalOutput" +_cGCPRo = "com.amazonaws.bedrockagentcorecontrol#GetConsentPortalResponse" +_GCPe = "GetConsentPortal" +_LCPIi = "ListConsentPortalsInput" +_cLCPR = "com.amazonaws.bedrockagentcorecontrol#ListConsentPortalsRequest" +_CPSonse = "ConsentPortalSummary" +_CPSonsen = "ConsentPortalSummaries" +_LCPOi = "ListConsentPortalsOutput" +_cLCPRo = "com.amazonaws.bedrockagentcorecontrol#ListConsentPortalsResponse" +_cPo = "consentPortals" +_LCPi = "ListConsentPortals" +_UCPIp = "UpdateConsentPortalInput" +_cUCPR = "com.amazonaws.bedrockagentcorecontrol#UpdateConsentPortalRequest" +_UCPOp = "UpdateConsentPortalOutput" +_cUCPRo = "com.amazonaws.bedrockagentcorecontrol#UpdateConsentPortalResponse" +_UCPp = "UpdateConsentPortal" +_DNa = "DatasetName" +_DSTa = "DatasetSchemaType" +_AEPV = "AGENTCORE_EVALUATION_PREDEFINED_V1" +_AESV = "AGENTCORE_EVALUATION_SIMULATED_V1" +_TPEV = "THIRD_PARTY_EVALUATION_V1" +_CDI = "CreateDatasetInput" +_cCDR = "com.amazonaws.bedrockagentcorecontrol#CreateDatasetRequest" +_dNa = "datasetName" +_sTc = "schemaType" +_CDO = "CreateDatasetOutput" +_cCDRo = "com.amazonaws.bedrockagentcorecontrol#CreateDatasetResponse" +_CD = "CreateDataset" +_CDVI = "CreateDatasetVersionInput" +_cCDVR = "com.amazonaws.bedrockagentcorecontrol#CreateDatasetVersionRequest" +_DV = "DatasetVersion" +_CDVO = "CreateDatasetVersionOutput" +_cCDVRo = "com.amazonaws.bedrockagentcorecontrol#CreateDatasetVersionResponse" +_dV = "datasetVersion" +_CDV = "CreateDatasetVersion" +_DDI = "DeleteDatasetInput" +_cDDR = "com.amazonaws.bedrockagentcorecontrol#DeleteDatasetRequest" +_DDO = "DeleteDatasetOutput" +_cDDRo = "com.amazonaws.bedrockagentcorecontrol#DeleteDatasetResponse" +_DD = "DeleteDataset" +_DDEI = "DeleteDatasetExamplesInput" +_cDDER = "com.amazonaws.bedrockagentcorecontrol#DeleteDatasetExamplesRequest" +_DDEO = "DeleteDatasetExamplesOutput" +_cDDERo = "com.amazonaws.bedrockagentcorecontrol#DeleteDatasetExamplesResponse" +_dC = "deletedCount" +_DDE = "DeleteDatasetExamples" +_GDI = "GetDatasetInput" +_cGDR = "com.amazonaws.bedrockagentcorecontrol#GetDatasetRequest" +_DUo = "DownloadUrl" +_DSr = "DraftStatus" +_MODIFIED = "MODIFIED" +_UNMODIFIED = "UNMODIFIED" +_GDO = "GetDatasetOutput" +_cGDRo = "com.amazonaws.bedrockagentcorecontrol#GetDatasetResponse" +_dS = "draftStatus" +_eCx = "exampleCount" +_dUo = "downloadUrl" +_dUEA = "downloadUrlExpiresAt" +_GD = "GetDataset" +_LDEI = "ListDatasetExamplesInput" +_cLDER = "com.amazonaws.bedrockagentcorecontrol#ListDatasetExamplesRequest" +_LDEO = "ListDatasetExamplesOutput" +_cLDERo = "com.amazonaws.bedrockagentcorecontrol#ListDatasetExamplesResponse" +_LDE = "ListDatasetExamples" +_LDI = "ListDatasetsInput" +_cLDR = "com.amazonaws.bedrockagentcorecontrol#ListDatasetsRequest" +_DSa = "DatasetSummary" +_DSL = "DatasetSummaryList" +_LDO = "ListDatasetsOutput" +_cLDRo = "com.amazonaws.bedrockagentcorecontrol#ListDatasetsResponse" +_da = "datasets" +_LD = "ListDatasets" +_LDVI = "ListDatasetVersionsInput" +_cLDVR = "com.amazonaws.bedrockagentcorecontrol#ListDatasetVersionsRequest" +_DVS = "DatasetVersionSummary" +_DVSL = "DatasetVersionSummaryList" +_LDVO = "ListDatasetVersionsOutput" +_cLDVRo = "com.amazonaws.bedrockagentcorecontrol#ListDatasetVersionsResponse" +_LDV = "ListDatasetVersions" +_UDI = "UpdateDatasetInput" +_cUDR = "com.amazonaws.bedrockagentcorecontrol#UpdateDatasetRequest" +_UDO = "UpdateDatasetOutput" +_cUDRo = "com.amazonaws.bedrockagentcorecontrol#UpdateDatasetResponse" +_UDp = "UpdateDataset" +_UDEI = "UpdateDatasetExamplesInput" +_cUDER = "com.amazonaws.bedrockagentcorecontrol#UpdateDatasetExamplesRequest" +_UDEO = "UpdateDatasetExamplesOutput" +_cUDERo = "com.amazonaws.bedrockagentcorecontrol#UpdateDatasetExamplesResponse" +_uC = "updatedCount" +_UDE = "UpdateDatasetExamples" +_DRPI = "DeleteResourcePolicyInput" +_cDRPR = "com.amazonaws.bedrockagentcorecontrol#DeleteResourcePolicyRequest" +_rAe = "resourceArn" +_DRPO = "DeleteResourcePolicyOutput" +_cDRPRo = "com.amazonaws.bedrockagentcorecontrol#DeleteResourcePolicyResponse" +_DRP = "DeleteResourcePolicy" +_ED = "EvaluatorDescription" +_LAa = "LambdaArn" +_LEC = "LambdaEvaluatorConfig" +_lA = "lambdaArn" +_lTIS = "lambdaTimeoutInSeconds" +_CBEC = "CodeBasedEvaluatorConfig" +_lCa = "lambdaConfig" +_EIv = "EvaluatorId" +_NES = "NonEmptyString" +_NESL = "NonEmptyStringList" +_ICn = "InferenceConfiguration" +_mT = "maxTokens" +_te = "temperature" +_tP = "topP" +_sSt = "stopSequences" +_MI = "ModelId" +_BEMC = "BedrockEvaluatorModelConfig" +_mI = "modelId" +_iCn = "inferenceConfig" +_aMRF = "additionalModelRequestFields" +_RCea = "ReasoningConfiguration" +_ef = "effort" +_OREMC = "OpenResponsesEvaluatorModelConfig" +_mOT = "maxOutputTokens" +_rea = "reasoning" +_EMC = "EvaluatorModelConfig" +_bEMC = "bedrockEvaluatorModelConfig" +_rEMC = "responsesEvaluatorModelConfig" +_DEC = "DerivedEvaluatorConfig" +_bEI = "baseEvaluatorId" +_mCo = "modelConfig" +_EIva = "EvaluatorInstructions" +_CSD = "CategoricalScaleDefinition" +_de = "definition" +_la = "label" +_CSDa = "CategoricalScaleDefinitions" +_NSD = "NumericalScaleDefinition" +_NSDu = "NumericalScaleDefinitions" +_RS = "RatingScale" +_nu = "numerical" +_ca = "categorical" +_LAAJEC = "LlmAsAJudgeEvaluatorConfig" +_in = "instructions" +_rS = "ratingScale" +_ECv = "EvaluatorConfig" +_lAAJ = "llmAsAJudge" +_cBo = "codeBased" +_der = "derived" +_CEN = "CustomEvaluatorName" +_EL = "EvaluatorLevel" +_TC = "TOOL_CALL" +_TRACE = "TRACE" +_SESSION = "SESSION" +_CEI = "CreateEvaluatorInput" +_cCER = "com.amazonaws.bedrockagentcorecontrol#CreateEvaluatorRequest" +_eNv = "evaluatorName" +_eCv = "evaluatorConfig" +_le = "level" +_CEA = "CustomEvaluatorArn" +_ES = "EvaluatorStatus" +_CEO = "CreateEvaluatorOutput" +_cCERo = "com.amazonaws.bedrockagentcorecontrol#CreateEvaluatorResponse" +_eA = "evaluatorArn" +_eIv = "evaluatorId" +_CEr = "CreateEvaluator" +_DEI = "DeleteEvaluatorInput" +_cDER = "com.amazonaws.bedrockagentcorecontrol#DeleteEvaluatorRequest" +_EA = "EvaluatorArn" +_DEO = "DeleteEvaluatorOutput" +_cDERo = "com.amazonaws.bedrockagentcorecontrol#DeleteEvaluatorResponse" +_DE = "DeleteEvaluator" +_ID = "IncludedData" +_AD_ = "ALL_DATA" +_MO = "METADATA_ONLY" +_GEI = "GetEvaluatorInput" +_cGER = "com.amazonaws.bedrockagentcorecontrol#GetEvaluatorRequest" +_iD = "includedData" +_ENv = "EvaluatorName" +_ET = "EvaluatorType" +_BUILTIN = "BUILTIN" +_B = "Builtin" +_TP = "THIRD_PARTY" +_TPh = "ThirdParty" +_Cu = "Custom" +_CODE = "CODE" +_CCu = "CustomCode" +_CD_ = "CUSTOM_DERIVED" +_CDu = "CustomDerived" +_Pr = "Provider" +_AWS = "AWS" +_DE_ = "DEEP_EVAL" +_DEe = "DeepEval" +_AE = "AUTO_EVAL" +_AEu = "AutoEval" +_GEO = "GetEvaluatorOutput" +_cGERo = "com.amazonaws.bedrockagentcorecontrol#GetEvaluatorResponse" +_eT = "evaluatorType" +_pr = "provider" +_lFM = "lockedForModification" +_GE = "GetEvaluator" +_LEI = "ListEvaluatorsInput" +_cLER = "com.amazonaws.bedrockagentcorecontrol#ListEvaluatorsRequest" +_ESv = "EvaluatorSummary" +_ESL = "EvaluatorSummaryList" +_LEO = "ListEvaluatorsOutput" +_cLERo = "com.amazonaws.bedrockagentcorecontrol#ListEvaluatorsResponse" +_ev = "evaluators" +_LE = "ListEvaluators" +_UEI = "UpdateEvaluatorInput" +_cUER = "com.amazonaws.bedrockagentcorecontrol#UpdateEvaluatorRequest" +_UEO = "UpdateEvaluatorOutput" +_cUERo = "com.amazonaws.bedrockagentcorecontrol#UpdateEvaluatorResponse" +_UEp = "UpdateEvaluator" +_GI = "GatewayIdentifier" +_GRLD = "GatewayRateLimitDescription" +_DK = "DimensionKey" +_DKi = "DimensionKeys" +_Pe = "Period" +_SECOND = "SECOND" +_sec = "second" +_MINUTE = "MINUTE" +_mi = "minute" +_RCa = "RateConfig" +_ra = "rate" +_pe = "period" +_RCat = "RateConfigs" +_DVi = "DimensionValue" +_Di = "Dimensions" +_LEi = "LimitEntry" +_di = "dimensions" +_req = "requests" +_to = "tokens" +_conn = "connections" +_LEim = "LimitEntries" +_GRLI = "GatewayRateLimitId" +_BPLE = "BatchPutLimitEntry" +_rLI = "rateLimitId" +_dK = "dimensionKeys" +_ent = "entries" +_BPLEa = "BatchPutLimitEntries" +_BPGRLI = "BatchPutGatewayRateLimitsInput" +_cBPGRLR = "com.amazonaws.bedrockagentcorecontrol#BatchPutGatewayRateLimitsRequest" +_gI = "gatewayIdentifier" +_rL = "rateLimits" +_GRLS = "GatewayRateLimitStatus" +_GRLDa = "GatewayRateLimitDetail" +_GRL = "GatewayRateLimits" +_BPGRLO = "BatchPutGatewayRateLimitsOutput" +_cBPGRLRo = "com.amazonaws.bedrockagentcorecontrol#BatchPutGatewayRateLimitsResponse" +_BPGRL = "BatchPutGatewayRateLimits" +_CGRLI = "CreateGatewayRateLimitInput" +_cCGRLR = "com.amazonaws.bedrockagentcorecontrol#CreateGatewayRateLimitRequest" +_CGRLO = "CreateGatewayRateLimitOutput" +_cCGRLRo = "com.amazonaws.bedrockagentcorecontrol#CreateGatewayRateLimitResponse" +_CGRL = "CreateGatewayRateLimit" +_DGRLI = "DeleteGatewayRateLimitInput" +_cDGRLR = "com.amazonaws.bedrockagentcorecontrol#DeleteGatewayRateLimitRequest" +_DGRLO = "DeleteGatewayRateLimitOutput" +_cDGRLRo = "com.amazonaws.bedrockagentcorecontrol#DeleteGatewayRateLimitResponse" +_DGRL = "DeleteGatewayRateLimit" +_GGRLI = "GetGatewayRateLimitInput" +_cGGRLR = "com.amazonaws.bedrockagentcorecontrol#GetGatewayRateLimitRequest" +_GGRLO = "GetGatewayRateLimitOutput" +_cGGRLRo = "com.amazonaws.bedrockagentcorecontrol#GetGatewayRateLimitResponse" +_GGRL = "GetGatewayRateLimit" +_GRLMR = "GatewayRateLimitMaxResults" +_GRLNT = "GatewayRateLimitNextToken" +_LGRLI = "ListGatewayRateLimitsInput" +_cLGRLR = "com.amazonaws.bedrockagentcorecontrol#ListGatewayRateLimitsRequest" +_LGRLO = "ListGatewayRateLimitsOutput" +_cLGRLRo = "com.amazonaws.bedrockagentcorecontrol#ListGatewayRateLimitsResponse" +_LGRL = "ListGatewayRateLimits" +_UGRLI = "UpdateGatewayRateLimitInput" +_cUGRLR = "com.amazonaws.bedrockagentcorecontrol#UpdateGatewayRateLimitRequest" +_UGRLO = "UpdateGatewayRateLimitOutput" +_cUGRLRo = "com.amazonaws.bedrockagentcorecontrol#UpdateGatewayRateLimitResponse" +_UGRL = "UpdateGatewayRateLimit" +_AT = "AuthorizerType" +_CJ = "CUSTOM_JWT" +_AI = "AWS_IAM" +_AO = "AUTHENTICATE_ONLY" +_GDa = "GatewayDescription" +_ELx = "ExceptionLevel" +_DEBUG = "DEBUG" +_IPE = "InterceptorPayloadExclusion" +_RB = "RESPONSE_BODY" +_IPES = "InterceptorPayloadExclusionSelector" +_fi = "field" +_IPESL = "InterceptorPayloadExclusionSelectorList" +_IPF = "InterceptorPayloadFilter" +_ex = "exclude" +_IIC = "InterceptorInputConfiguration" +_pRH = "passRequestHeaders" +_pF = "payloadFilter" +_GIP = "GatewayInterceptionPoint" +_REQUEST = "REQUEST" +_RESPONSE = "RESPONSE" +_GIPa = "GatewayInterceptionPoints" +_LFA = "LambdaFunctionArn" +_LIC = "LambdaInterceptorConfiguration" +_ICnt = "InterceptorConfiguration" +_lam = "lambda" +_GIC = "GatewayInterceptorConfiguration" +_int = "interceptor" +_iP = "interceptionPoints" +_iCnp = "inputConfiguration" +_GICa = "GatewayInterceptorConfigurations" +_GN = "GatewayName" +_GPEA = "GatewayPolicyEngineArn" +_GPEM = "GatewayPolicyEngineMode" +_LO = "LOG_ONLY" +_ENFORCE = "ENFORCE" +_GPEC = "GatewayPolicyEngineConfiguration" +_mod = "mode" +_MIc = "McpInstructions" +_STe = "SearchType" +_SEMANTIC = "SEMANTIC" +_SCe = "SessionConfiguration" +_sTIS = "sessionTimeoutInSeconds" +_SCt = "StreamingConfiguration" +_eRS = "enableResponseStreaming" +_MV = "McpVersion" +_v__ = "2025-03-26" +_MSV = "McpSupportedVersions" +_MCPGC = "MCPGatewayConfiguration" +_sVu = "supportedVersions" +_sTe = "searchType" +_sCe = "sessionConfiguration" +_sCt = "streamingConfiguration" +_dMLTP = "disableMcpListToolsPagination" +_GPC = "GatewayProtocolConfiguration" +_mc = "mcp" +_GPT = "GatewayProtocolType" +_CGI = "CreateGatewayInput" +_cCGR = "com.amazonaws.bedrockagentcorecontrol#CreateGatewayRequest" +_pTr = "protocolType" +_aT = "authorizerType" +_iCnt = "interceptorConfigurations" +_pEC = "policyEngineConfiguration" +_eL = "exceptionLevel" +_LTC = "LambdaTransformConfiguration" +_CTC = "CustomTransformConfiguration" +_GA = "GatewayArn" +_GIa = "GatewayId" +_GU = "GatewayUrl" +_GS = "GatewayStatus" +_UU = "UPDATE_UNSUCCESSFUL" +_SRt = "StatusReason" +_SRta = "StatusReasons" +_WFM = "WafFailureMode" +_FC_ = "FAIL_CLOSE" +_FO = "FAIL_OPEN" +_WC = "WafConfiguration" +_fM = "failureMode" +_WAA = "WebAclArn" +_CGO = "CreateGatewayOutput" +_cCGRo = "com.amazonaws.bedrockagentcorecontrol#CreateGatewayResponse" +_gA = "gatewayArn" +_gIa = "gatewayId" +_gU = "gatewayUrl" +_sRta = "statusReasons" +_cTC = "customTransformConfiguration" +_wAA = "webAclArn" +_wC = "wafConfiguration" +_CG = "CreateGateway" +_DGI = "DeleteGatewayInput" +_cDGR = "com.amazonaws.bedrockagentcorecontrol#DeleteGatewayRequest" +_DGO = "DeleteGatewayOutput" +_cDGRo = "com.amazonaws.bedrockagentcorecontrol#DeleteGatewayResponse" +_DG = "DeleteGateway" +_GGI = "GetGatewayInput" +_cGGR = "com.amazonaws.bedrockagentcorecontrol#GetGatewayRequest" +_GGO = "GetGatewayOutput" +_cGGRo = "com.amazonaws.bedrockagentcorecontrol#GetGatewayResponse" +_GG = "GetGateway" +_GMR = "GatewayMaxResults" +_GNT = "GatewayNextToken" +_LGI = "ListGatewaysInput" +_cLGR = "com.amazonaws.bedrockagentcorecontrol#ListGatewaysRequest" +_GSa = "GatewaySummary" +_GSat = "GatewaySummaries" +_LGO = "ListGatewaysOutput" +_cLGRo = "com.amazonaws.bedrockagentcorecontrol#ListGatewaysResponse" +_it = "items" +_LG = "ListGateways" +_UGI = "UpdateGatewayInput" +_cUGR = "com.amazonaws.bedrockagentcorecontrol#UpdateGatewayRequest" +_UGO = "UpdateGatewayOutput" +_cUGRo = "com.amazonaws.bedrockagentcorecontrol#UpdateGatewayResponse" +_UG = "UpdateGateway" +_MPP = "MatchPathPattern" +_MPPa = "MatchPathPatterns" +_MPa = "MatchPaths" +_aO = "anyOf" +_IPAa = "IamPrincipalArn" +_PMO = "PrincipalMatchOperator" +_SE = "StringEquals" +_SLt = "StringLike" +_IP = "IamPrincipal" +_op = "operator" +_MPE = "MatchPrincipalEntry" +_iPa = "iamPrincipal" +_MPEa = "MatchPrincipalEntries" +_MPat = "MatchPrincipals" +_Co = "Condition" +_mPa = "matchPrincipals" +_mPat = "matchPaths" +_Con = "Conditions" +_GRD = "GatewayRuleDescription" +_GRP = "GatewayRulePriority" +_CGRI = "CreateGatewayRuleInput" +_cCGRR = "com.amazonaws.bedrockagentcorecontrol#CreateGatewayRuleRequest" +_pri = "priority" +_cond = "conditions" +_ac = "actions" +_GRI = "GatewayRuleId" +_GRS = "GatewayRuleStatus" +_SMB = "SystemManagedBlock" +_mB = "managedBy" +_CGRO = "CreateGatewayRuleOutput" +_cCGRRo = "com.amazonaws.bedrockagentcorecontrol#CreateGatewayRuleResponse" +_rI = "ruleId" +_sy = "system" +_CGR = "CreateGatewayRule" +_DGRI = "DeleteGatewayRuleInput" +_cDGRR = "com.amazonaws.bedrockagentcorecontrol#DeleteGatewayRuleRequest" +_DGRO = "DeleteGatewayRuleOutput" +_cDGRRo = "com.amazonaws.bedrockagentcorecontrol#DeleteGatewayRuleResponse" +_DGR = "DeleteGatewayRule" +_GGRI = "GetGatewayRuleInput" +_cGGRR = "com.amazonaws.bedrockagentcorecontrol#GetGatewayRuleRequest" +_GGRO = "GetGatewayRuleOutput" +_cGGRRo = "com.amazonaws.bedrockagentcorecontrol#GetGatewayRuleResponse" +_GGR = "GetGatewayRule" +_GRMR = "GatewayRuleMaxResults" +_GRNT = "GatewayRuleNextToken" +_LGRI = "ListGatewayRulesInput" +_cLGRR = "com.amazonaws.bedrockagentcorecontrol#ListGatewayRulesRequest" +_GRDa = "GatewayRuleDetail" +_GR = "GatewayRules" +_LGRO = "ListGatewayRulesOutput" +_cLGRRo = "com.amazonaws.bedrockagentcorecontrol#ListGatewayRulesResponse" +_gR = "gatewayRules" +_LGR = "ListGatewayRules" +_UGRI = "UpdateGatewayRuleInput" +_cUGRR = "com.amazonaws.bedrockagentcorecontrol#UpdateGatewayRuleRequest" +_UGRO = "UpdateGatewayRuleOutput" +_cUGRRo = "com.amazonaws.bedrockagentcorecontrol#UpdateGatewayRuleResponse" +_UGR = "UpdateGatewayRule" +_CBOAI = "CertificateBucketOwnerAccountId" +_CSU = "CertificateS3Uri" +_SCC = "S3CertificateConfiguration" +_u = "uri" +_bOAI = "bucketOwnerAccountId" +_CSA = "CertificateSecretArn" +_SMCC = "SecretsManagerCertificateConfiguration" +_CCe = "CertificateConfiguration" +_CCL = "CertificateConfigurationList" +_AKCL = "ApiKeyCredentialLocation" +_HEADER = "HEADER" +_QP = "QUERY_PARAMETER" +_AKCPN = "ApiKeyCredentialParameterName" +_AKCPp = "ApiKeyCredentialPrefix" +_AKCPA = "ApiKeyCredentialProviderArn" +_GAKCPa = "GatewayApiKeyCredentialProvider" +_pAr = "providerArn" +_cPN = "credentialParameterName" +_cPr = "credentialPrefix" +_cL = "credentialLocation" +_ICP = "IamCredentialProvider" +_ser = "service" +_reg = "region" +_OACPK = "OAuthCustomParametersKey" +_OACPV = "OAuthCustomParametersValue" +_OACP = "OAuthCustomParameters" +_OADRU = "OAuthDefaultReturnUrl" +_OAGT = "OAuthGrantType" +_CC_ = "CLIENT_CREDENTIALS" +_AC_ = "AUTHORIZATION_CODE" +_TE_ = "TOKEN_EXCHANGE" +_OACPAu = "OAuthCredentialProviderArn" +_OAS = "OAuthScope" +_OASu = "OAuthScopes" +_OACPu = "OAuthCredentialProvider" +_cPu = "customParameters" +_gT = "grantType" +_dRU = "defaultReturnUrl" +_CPr = "CredentialProvider" +_oCP = "oauthCredentialProvider" +_aKCP = "apiKeyCredentialProvider" +_iCP = "iamCredentialProvider" +_CPT = "CredentialProviderType" +_GIR = "GATEWAY_IAM_ROLE" +_OAUTH = "OAUTH" +_AK = "API_KEY" +_CIC = "CALLER_IAM_CREDENTIALS" +_JP = "JWT_PASSTHROUGH" +_CPCr = "CredentialProviderConfiguration" +_cPT = "credentialProviderType" +_cPre = "credentialProvider" +_CPCre = "CredentialProviderConfigurations" +_TD = "TargetDescription" +_MC = "MetadataConfiguration" +_aRH = "allowedRequestHeaders" +_aQP = "allowedQueryParameters" +_aRHl = "allowedResponseHeaders" +_RAu = "RuntimeArn" +_RQ = "RuntimeQualifier" +_IPn = "InlinePayload" +_AAI = "AwsAccountId" +_SBU = "S3BucketUri" +_SCo = "S3Configuration" +_ASC = "ApiSchemaConfiguration" +_iPn = "inlinePayload" +_HASC = "HttpApiSchemaConfiguration" +_RTC = "RuntimeTargetConfiguration" +_q = "qualifier" +_sch = "schema" +_CPNo = "ConnectorParameterName" +_CPV = "ConnectorParameterValue" +_HCP = "HttpConnectorParameters" +_CIo = "ConnectorId" +_HCS = "HttpConnectorSource" +_cI = "connectorId" +_HCTC = "HttpConnectorTargetConfiguration" +_pa = "parameters" +_PEa = "PassthroughEndpoint" +_PPT = "PassthroughProtocolType" +_INFERENCE = "INFERENCE" +_SQPCR = "StaticQueryParameterConflictResolution" +_CO = "CLIENT_OVERRIDE" +_SO_ = "STATIC_OVERRIDE" +_SQPN = "StaticQueryParameterName" +_SQPV = "StaticQueryParameterValue" +_SQP = "StaticQueryParameters" +_CIE = "CompositeIdentifierEntry" +_CIL = "CompositeIdentifierList" +_STt = "StickinessTimeout" +_SCti = "StickinessConfiguration" +_ti = "timeout" +_cIo = "compositeIdentifier" +_PTC = "PassthroughTargetConfiguration" +_end = "endpoint" +_sCti = "stickinessConfiguration" +_sQP = "staticQueryParameters" +_sQPCR = "staticQueryParameterConflictResolution" +_HTC = "HttpTargetConfiguration" +_aRg = "agentcoreRuntime" +_pas = "passthrough" +_conne = "connector" +_ICI = "InferenceConnectorId" +_ICS = "InferenceConnectorSource" +_ICTC = "InferenceConnectorTargetConfiguration" +_PP = "ProviderPrefix" +_str = "strip" +_sep = "separator" +_v___ = "." +_MMo = "ModelMapping" +_pP = "providerPrefix" +_MPo = "ModelPattern" +_ME = "ModelEntry" +_mode = "model" +_MEo = "ModelEntries" +_IOP = "InferenceOperationPath" +_IOC = "InferenceOperationConfiguration" +_pat = "path" +_pPr = "providerPath" +_model = "models" +_IOCn = "InferenceOperationConfigurations" +_IPTC = "InferenceProviderTargetConfiguration" +_mM = "modelMapping" +_ope = "operations" +_ITC = "InferenceTargetConfiguration" +_RAM = "RestApiMethod" +_GET = "GET" +_DELETE = "DELETE" +_HEAD = "HEAD" +_OPTIONS = "OPTIONS" +_PATCH = "PATCH" +_PUT_ = "PUT" +_POST = "POST" +_RAMe = "RestApiMethods" +_AGTF = "ApiGatewayToolFilter" +_fP = "filterPath" +_met = "methods" +_AGTFp = "ApiGatewayToolFilters" +_AGTO = "ApiGatewayToolOverride" +_meth = "method" +_AGTOp = "ApiGatewayToolOverrides" +_AGTC = "ApiGatewayToolConfiguration" +_tO = "toolOverrides" +_tF = "toolFilters" +_AGTCp = "ApiGatewayTargetConfiguration" +_rAI = "restApiId" +_stag = "stage" +_aGTC = "apiGatewayToolConfiguration" +_CPO = "ConnectorParameterOverride" +_vi = "visible" +_CPOo = "ConnectorParameterOverrides" +_CCon = "ConnectorConfiguration" +_pVa = "parameterValues" +_pO = "parameterOverrides" +_CConn = "ConnectorConfigurations" +_ECn = "EnabledConnectors" +_CV = "ConnectorVersion" +_CS = "ConnectorSource" +_CTCo = "ConnectorTargetConfiguration" +_conf = "configurations" +_RP = "RequiredProperties" +_STc = "SchemaType" +_stri = "string" +_NUMBER = "NUMBER" +_num = "number" +_OBJECT = "OBJECT" +_ob = "object" +_ARRAY = "ARRAY" +_ar = "array" +_BOOLEAN = "BOOLEAN" +_bo = "boolean" +_INTEGER = "INTEGER" +_inte = "integer" +_LM = "ListingMode" +_DEFAULT = "DEFAULT" +_DYNAMIC = "DYNAMIC" +_MTSC = "McpToolSchemaConfiguration" +_TRP = "TargetResourcePriority" +_MSTC = "McpServerTargetConfiguration" +_mTS = "mcpToolSchema" +_lMi = "listingMode" +_rP = "resourcePriority" +_OAAD = "OAuth2AuthorizationData" +_aU = "authorizationUrl" +_uI = "userId" +_ADu = "AuthorizationData" +_oa = "oauth2" +_DNo = "DomainName" +_RAA = "ResourceAssociationArn" +_RGA = "ResourceGatewayArn" +_MRD = "ManagedResourceDetails" +_rGA = "resourceGatewayArn" +_rAA = "resourceAssociationArn" +_PEMR = "PrivateEndpointManagedResources" +_TPT = "TargetProtocolType" +_TS = "TargetStatus" +_SYNCHRONIZING = "SYNCHRONIZING" +_SU_ = "SYNCHRONIZE_UNSUCCESSFUL" +_CPA_ = "CREATE_PENDING_AUTH" +_UPA = "UPDATE_PENDING_AUTH" +_SPA = "SYNCHRONIZE_PENDING_AUTH" +_TI = "TargetId" +_DGTI = "DeleteGatewayTargetInput" +_cDGTR = "com.amazonaws.bedrockagentcorecontrol#DeleteGatewayTargetRequest" +_tI = "targetId" +_DGTO = "DeleteGatewayTargetOutput" +_cDGTRo = "com.amazonaws.bedrockagentcorecontrol#DeleteGatewayTargetResponse" +_DGT = "DeleteGatewayTarget" +_GGTI = "GetGatewayTargetInput" +_cGGTR = "com.amazonaws.bedrockagentcorecontrol#GetGatewayTargetRequest" +_TMR = "TargetMaxResults" +_TNT = "TargetNextToken" +_LGTI = "ListGatewayTargetsInput" +_cLGTR = "com.amazonaws.bedrockagentcorecontrol#ListGatewayTargetsRequest" +_TT = "TargetType" +_OAS_ = "OPEN_API_SCHEMA" +_SM = "SMITHY_MODEL" +_MS = "MCP_SERVER" +_LAMBDA = "LAMBDA" +_AG_ = "API_GATEWAY" +_CONNECTOR = "CONNECTOR" +_AR_ = "AGENTCORE_RUNTIME" +_PASSTHROUGH = "PASSTHROUGH" +_PROVIDER = "PROVIDER" +_HC = "HTTP_CONNECTOR" +_TSa = "TargetSummary" +_lSAa = "lastSynchronizedAt" +_aD = "authorizationData" +_tT = "targetType" +_TSar = "TargetSummaries" +_LGTO = "ListGatewayTargetsOutput" +_cLGTRo = "com.amazonaws.bedrockagentcorecontrol#ListGatewayTargetsResponse" +_LGT = "ListGatewayTargets" +_TIL = "TargetIdList" +_SGTI = "SynchronizeGatewayTargetsInput" +_cSGTR = "com.amazonaws.bedrockagentcorecontrol#SynchronizeGatewayTargetsRequest" +_tIL = "targetIdList" +_GRPI = "GetResourcePolicyInput" +_cGRPR = "com.amazonaws.bedrockagentcorecontrol#GetResourcePolicyRequest" +_RPB = "ResourcePolicyBody" +_GRPO = "GetResourcePolicyOutput" +_cGRPRo = "com.amazonaws.bedrockagentcorecontrol#GetResourcePolicyResponse" +_po = "policy" +_GRPe = "GetResourcePolicy" +_TVIT = "TokenVaultIdType" +_GTVI = "GetTokenVaultInput" +_cGTVR = "com.amazonaws.bedrockagentcorecontrol#GetTokenVaultRequest" +_tVI = "tokenVaultId" +_KT = "KeyType" +_CMK = "CustomerManagedKey" +_SMK = "ServiceManagedKey" +_KC = "KmsConfiguration" +_kT = "keyType" +_GTVO = "GetTokenVaultOutput" +_cGTVRo = "com.amazonaws.bedrockagentcorecontrol#GetTokenVaultResponse" +_kC = "kmsConfiguration" +_lMD = "lastModifiedDate" +_GTV = "GetTokenVault" +_HED = "HarnessEndpointDescription" +_HEN = "HarnessEndpointName" +_HI = "HarnessId" +_HV = "HarnessVersion" +_CHEI = "CreateHarnessEndpointInput" +_cCHER = "com.amazonaws.bedrockagentcorecontrol#CreateHarnessEndpointRequest" +_hI = "harnessId" +_HEA = "HarnessEndpointArn" +_HNa = "HarnessName" +_HES = "HarnessEndpointStatus" +_HEa = "HarnessEndpoint" +_hN = "harnessName" +_CHEO = "CreateHarnessEndpointOutput" +_cCHERo = "com.amazonaws.bedrockagentcorecontrol#CreateHarnessEndpointResponse" +_CHE = "CreateHarnessEndpoint" +_DHEI = "DeleteHarnessEndpointInput" +_cDHER = "com.amazonaws.bedrockagentcorecontrol#DeleteHarnessEndpointRequest" +_DHEO = "DeleteHarnessEndpointOutput" +_cDHERo = "com.amazonaws.bedrockagentcorecontrol#DeleteHarnessEndpointResponse" +_DHE = "DeleteHarnessEndpoint" +_GHEI = "GetHarnessEndpointInput" +_cGHER = "com.amazonaws.bedrockagentcorecontrol#GetHarnessEndpointRequest" +_GHEO = "GetHarnessEndpointOutput" +_cGHERo = "com.amazonaws.bedrockagentcorecontrol#GetHarnessEndpointResponse" +_GHE = "GetHarnessEndpoint" +_LHEI = "ListHarnessEndpointsInput" +_cLHER = "com.amazonaws.bedrockagentcorecontrol#ListHarnessEndpointsRequest" +_HEar = "HarnessEndpoints" +_LHEO = "ListHarnessEndpointsOutput" +_cLHERo = "com.amazonaws.bedrockagentcorecontrol#ListHarnessEndpointsResponse" +_endp = "endpoints" +_LHE = "ListHarnessEndpoints" +_UHEI = "UpdateHarnessEndpointInput" +_cUHER = "com.amazonaws.bedrockagentcorecontrol#UpdateHarnessEndpointRequest" +_UHEO = "UpdateHarnessEndpointOutput" +_cUHERo = "com.amazonaws.bedrockagentcorecontrol#UpdateHarnessEndpointResponse" +_UHE = "UpdateHarnessEndpoint" +_HAT = "HarnessAllowedTool" +_HATa = "HarnessAllowedTools" +_HACRER = "HarnessAgentCoreRuntimeEnvironmentRequest" +_HEPR = "HarnessEnvironmentProviderRequest" +_aCRE = "agentCoreRuntimeEnvironment" +_HEAa = "HarnessEnvironmentArtifact" +_HHNa = "HarnessHookName" +_HEBBA = "HarnessEventBridgeBusArn" +_HHEBT = "HarnessHookEventBridgeTarget" +_HLFA = "HarnessLambdaFunctionArn" +_HHFM = "HarnessHookFailureMode" +_ALLOW = "ALLOW" +_al = "allow" +_DENY = "DENY" +_den = "deny" +_HHLT = "HarnessHookLambdaTarget" +_tSi = "timeoutSeconds" +_HSTA = "HarnessSnsTopicArn" +_HHST = "HarnessHookSnsTarget" +_HHT = "HarnessHookTarget" +_sn = "sns" +_eB = "eventBridge" +_HAIH = "HarnessAfterInvocationHook" +_ta = "target" +_HATCH = "HarnessAfterToolCallHook" +_HBIH = "HarnessBeforeInvocationHook" +_HBTCH = "HarnessBeforeToolCallHook" +_HH = "HarnessHook" +_bIe = "beforeInvocation" +_aI = "afterInvocation" +_bTC = "beforeToolCall" +_aTC = "afterToolCall" +_HHa = "HarnessHooks" +_MA = "MemoryArn" +_HACMRC = "HarnessAgentCoreMemoryRetrievalConfig" +_tK = "topK" +_rSe = "relevanceScore" +_sIt = "strategyId" +_HACMRCa = "HarnessAgentCoreMemoryRetrievalConfigs" +_HACMC = "HarnessAgentCoreMemoryConfiguration" +_aIc = "actorId" +_mCe = "messagesCount" +_rC = "retrievalConfig" +_HDMC = "HarnessDisabledMemoryConfiguration" +_HMMST = "HarnessManagedMemoryStrategyType" +_SUMMARIZATION = "SUMMARIZATION" +_UP = "USER_PREFERENCE" +_EPISODIC = "EPISODIC" +_HMMSL = "HarnessManagedMemoryStrategyList" +_HMMC = "HarnessManagedMemoryConfiguration" +_stra = "strategies" +_eED = "eventExpiryDuration" +_eKA = "encryptionKeyArn" +_HMC = "HarnessMemoryConfiguration" +_aCMC = "agentCoreMemoryConfiguration" +_mMC = "managedMemoryConfiguration" +_dis = "disabled" +_HBAF = "HarnessBedrockApiFormat" +_CS_ = "CONVERSE_STREAM" +_cs = "converse_stream" +_RESPONSES = "RESPONSES" +_res = "responses" +_CC__ = "CHAT_COMPLETIONS" +_cc = "chat_completions" +_MT = "MaxTokens" +_T = "Temperature" +_TPo = "TopP" +_HBMC = "HarnessBedrockModelConfig" +_aF = "apiFormat" +_aP = "additionalParams" +_AKA = "ApiKeyArn" +_TKo = "TopK" +_HGMC = "HarnessGeminiModelConfig" +_aKA = "apiKeyArn" +_HLLAB = "HarnessLiteLlmApiBase" +_HLLMC = "HarnessLiteLlmModelConfig" +_aB = "apiBase" +_HOAAB = "HarnessOpenAiApiBase" +_HOAAF = "HarnessOpenAiApiFormat" +_HOAMC = "HarnessOpenAiModelConfig" +_HMCa = "HarnessModelConfiguration" +_bMC = "bedrockModelConfig" +_oAMC = "openAiModelConfig" +_gMC = "geminiModelConfig" +_lLMC = "liteLlmModelConfig" +_HASP = "HarnessAwsSkillPath" +_HASPa = "HarnessAwsSkillPaths" +_HSASS = "HarnessSkillAwsSkillsSource" +_path = "paths" +_HSGA = "HarnessSkillGitAuth" +_cAr = "credentialArn" +_us = "username" +_HSGU = "HarnessSkillGitUrl" +_HSGS = "HarnessSkillGitSource" +_ur = "url" +_aut = "auth" +_HSP = "HarnessSkillPath" +_HSSU = "HarnessSkillS3Uri" +_HSSS = "HarnessSkillS3Source" +_HS = "HarnessSkill" +_gi = "git" +_aSw = "awsSkills" +_HSa = "HarnessSkills" +_STen = "SensitiveText" +_HSCB = "HarnessSystemContentBlock" +_tex = "text" +_HSPa = "HarnessSystemPrompt" +_HBA = "HarnessBrowserArn" +_HACBC = "HarnessAgentCoreBrowserConfig" +_HCIA = "HarnessCodeInterpreterArn" +_HACCIC = "HarnessAgentCoreCodeInterpreterConfig" +_HGOA = "HarnessGatewayOutboundAuth" +_aIw = "awsIam" +_oau = "oauth" +_HACGC = "HarnessAgentCoreGatewayConfig" +_oA = "outboundAuth" +_HIFD = "HarnessInlineFunctionDescription" +_HIFC = "HarnessInlineFunctionConfig" +_iS = "inputSchema" +_HHK = "HttpHeaderKey" +_HHV = "HttpHeaderValue" +_HHM = "HttpHeadersMap" +_HRMU = "HarnessRemoteMcpUrl" +_HRMC = "HarnessRemoteMcpConfig" +_h = "headers" +_HTCa = "HarnessToolConfiguration" +_rM = "remoteMcp" +_aCB = "agentCoreBrowser" +_aCG = "agentCoreGateway" +_iF = "inlineFunction" +_aCCI = "agentCoreCodeInterpreter" +_HTN = "HarnessToolName" +_HTT = "HarnessToolType" +_RM = "REMOTE_MCP" +_rm = "remote_mcp" +_AB = "AGENTCORE_BROWSER" +_ab = "agentcore_browser" +_ag_ = "agentcore_gateway" +_IF = "INLINE_FUNCTION" +_if = "inline_function" +_ACI = "AGENTCORE_CODE_INTERPRETER" +_aci = "agentcore_code_interpreter" +_HT = "HarnessTool" +_confi = "config" +_HTa = "HarnessTools" +_HSWC = "HarnessSlidingWindowConfiguration" +_HSC = "HarnessSummarizationConfiguration" +_sRu = "summaryRatio" +_pRM = "preserveRecentMessages" +_sSP = "summarizationSystemPrompt" +_HTSC = "HarnessTruncationStrategyConfiguration" +_sW = "slidingWindow" +_sum = "summarization" +_HTS = "HarnessTruncationStrategy" +_SW = "SLIDING_WINDOW" +_sw = "sliding_window" +_HTCar = "HarnessTruncationConfiguration" +_strat = "strategy" +_CHI = "CreateHarnessInput" +_cCHR = "com.amazonaws.bedrockagentcorecontrol#CreateHarnessRequest" +_env = "environment" +_eAn = "environmentArtifact" +_sPy = "systemPrompt" +_too = "tools" +_sk = "skills" +_aTl = "allowedTools" +_memo = "memory" +_tr = "truncation" +_ho = "hooks" +_mIa = "maxIterations" +_HA = "HarnessArn" +_HACRE = "HarnessAgentCoreRuntimeEnvironment" +_HEP = "HarnessEnvironmentProvider" +_HSar = "HarnessStatus" +_H = "Harness" +_hV = "harnessVersion" +_CHO = "CreateHarnessOutput" +_cCHRo = "com.amazonaws.bedrockagentcorecontrol#CreateHarnessResponse" +_ha = "harness" +_CH = "CreateHarness" +_DHI = "DeleteHarnessInput" +_cDHR = "com.amazonaws.bedrockagentcorecontrol#DeleteHarnessRequest" +_dMM = "deleteManagedMemory" +_DHO = "DeleteHarnessOutput" +_cDHRo = "com.amazonaws.bedrockagentcorecontrol#DeleteHarnessResponse" +_DH = "DeleteHarness" +_GHI = "GetHarnessInput" +_cGHR = "com.amazonaws.bedrockagentcorecontrol#GetHarnessRequest" +_GHO = "GetHarnessOutput" +_cGHRo = "com.amazonaws.bedrockagentcorecontrol#GetHarnessResponse" +_GH = "GetHarness" +_LHI = "ListHarnessesInput" +_cLHR = "com.amazonaws.bedrockagentcorecontrol#ListHarnessesRequest" +_HSarn = "HarnessSummary" +_HSarne = "HarnessSummaries" +_LHO = "ListHarnessesOutput" +_cLHRo = "com.amazonaws.bedrockagentcorecontrol#ListHarnessesResponse" +_har = "harnesses" +_LH = "ListHarnesses" +_LHVI = "ListHarnessVersionsInput" +_cLHVR = "com.amazonaws.bedrockagentcorecontrol#ListHarnessVersionsRequest" +_HVS = "HarnessVersionSummary" +_HVSa = "HarnessVersionSummaries" +_LHVO = "ListHarnessVersionsOutput" +_cLHVRo = "com.amazonaws.bedrockagentcorecontrol#ListHarnessVersionsResponse" +_hVa = "harnessVersions" +_LHV = "ListHarnessVersions" +_UAC = "UpdatedAuthorizerConfiguration" +_UHEA = "UpdatedHarnessEnvironmentArtifact" +_UHMC = "UpdatedHarnessMemoryConfiguration" +_UHI = "UpdateHarnessInput" +_cUHR = "com.amazonaws.bedrockagentcorecontrol#UpdateHarnessRequest" +_UHO = "UpdateHarnessOutput" +_cUHRo = "com.amazonaws.bedrockagentcorecontrol#UpdateHarnessResponse" +_UH = "UpdateHarness" +_TRA = "TaggableResourcesArn" +_LTFRI = "ListTagsForResourceInput" +_cLTFRR = "com.amazonaws.bedrockagentcorecontrol#ListTagsForResourceRequest" +_LTFRO = "ListTagsForResourceOutput" +_cLTFRRo = "com.amazonaws.bedrockagentcorecontrol#ListTagsForResourceResponse" +_LTFR = "ListTagsForResource" +_Ar = "Arn" +_MK = "MetadataKey" +_MVT = "MetadataValueType" +_STRINGLIST = "STRINGLIST" +_IK = "IndexedKey" +_IKL = "IndexedKeysList" +_Pro = "Prompt" +_EOCCI = "EpisodicOverrideConsolidationConfigurationInput" +_aTP = "appendToPrompt" +_EOECI = "EpisodicOverrideExtractionConfigurationInput" +_De = "Definition" +_LEIl = "LlmExtractionInstruction" +_NV = "NumberValidation" +_mV = "minValue" +_mVa = "maxValue" +_SLV = "StringListValidation" +_aV = "allowedValues" +_mIax = "maxItems" +_SVt = "StringValidation" +_V = "Validation" +_sVt = "stringValidation" +_sLV = "stringListValidation" +_nV = "numberValidation" +_LECl = "LlmExtractionConfig" +_lEI = "llmExtractionInstruction" +_va = "validation" +_ECx = "ExtractionConfig" +_lEC = "llmExtractionConfig" +_ETx = "ExtractionType" +_LI = "LLM_INFERRED" +_SC_ = "STRICTLY_CONSISTENT" +_MSE = "MetadataSchemaEntry" +_eTx = "extractionType" +_eCxt = "extractionConfig" +_MSL = "MetadataSchemaList" +_MRS = "MemoryRecordSchema" +_mS = "metadataSchema" +_Na = "Namespace" +_NL = "NamespacesList" +_EORCI = "EpisodicOverrideReflectionConfigurationInput" +_na = "namespaces" +_nTa = "namespaceTemplates" +_mRS = "memoryRecordSchema" +_EOCI = "EpisodicOverrideConfigurationInput" +_ext = "extraction" +_cons = "consolidation" +_ref = "reflection" +_ICIn = "InvocationConfigurationInput" +_tA = "topicArn" +_pDBN = "payloadDeliveryBucketName" +_MBTI = "MessageBasedTriggerInput" +_mCes = "messageCount" +_TBTI = "TimeBasedTriggerInput" +_iST = "idleSessionTimeout" +_TBTIo = "TokenBasedTriggerInput" +_tC = "tokenCount" +_TCI = "TriggerConditionInput" +_mBT = "messageBasedTrigger" +_tBT = "tokenBasedTrigger" +_tBTi = "timeBasedTrigger" +_TCIL = "TriggerConditionInputList" +_SMCI = "SelfManagedConfigurationInput" +_tCr = "triggerConditions" +_iCnv = "invocationConfiguration" +_hCWS = "historicalContextWindowSize" +_SOCCI = "SemanticOverrideConsolidationConfigurationInput" +_SOECI = "SemanticOverrideExtractionConfigurationInput" +_SOCI = "SemanticOverrideConfigurationInput" +_SOCCIu = "SummaryOverrideConsolidationConfigurationInput" +_SOCIu = "SummaryOverrideConfigurationInput" +_UPOCCI = "UserPreferenceOverrideConsolidationConfigurationInput" +_UPOECI = "UserPreferenceOverrideExtractionConfigurationInput" +_UPOCI = "UserPreferenceOverrideConfigurationInput" +_CCIu = "CustomConfigurationInput" +_sOe = "semanticOverride" +_sOu = "summaryOverride" +_uPO = "userPreferenceOverride" +_eO = "episodicOverride" +_sMC = "selfManagedConfiguration" +_Nam = "Name" +_CMSI = "CustomMemoryStrategyInput" +_ERCI = "EpisodicReflectionConfigurationInput" +_EMSI = "EpisodicMemoryStrategyInput" +_rCe = "reflectionConfiguration" +_SMSI = "SemanticMemoryStrategyInput" +_SMSIu = "SummaryMemoryStrategyInput" +_UPMSI = "UserPreferenceMemoryStrategyInput" +_MSI = "MemoryStrategyInput" +_sMS = "semanticMemoryStrategy" +_sMSu = "summaryMemoryStrategy" +_uPMS = "userPreferenceMemoryStrategy" +_cMS = "customMemoryStrategy" +_eMS = "episodicMemoryStrategy" +_MSIL = "MemoryStrategyInputList" +_NVK = "NamespaceVariableKey" +_NAV = "NamespaceAllowedValue" +_NAVL = "NamespaceAllowedValuesList" +_NRP = "NamespaceRegexPattern" +_NKV = "NamespaceKeyValidation" +_rPe = "regexPattern" +_NKE = "NamespaceKeyEntry" +_NKL = "NamespaceKeysList" +_CLo = "ContentLevel" +_FC__ = "FULL_CONTENT" +_CTo = "ContentType" +_MR_ = "MEMORY_RECORDS" +_CCont = "ContentConfiguration" +_CCLo = "ContentConfigurationList" +_KR = "KinesisResource" +_dSA = "dataStreamArn" +_cCon = "contentConfigurations" +_SDR = "StreamDeliveryResource" +_ki = "kinesis" +_SDRL = "StreamDeliveryResourcesList" +_SDRt = "StreamDeliveryResources" +_reso = "resources" +_CMI = "CreateMemoryInput" +_mERA = "memoryExecutionRoleArn" +_mSe = "memoryStrategies" +_iK = "indexedKeys" +_nK = "namespaceKeys" +_sDR = "streamDeliveryResources" +_MIe = "MemoryId" +_MSe = "MemoryStatus" +_ECO = "EpisodicConsolidationOverride" +_SCO = "SemanticConsolidationOverride" +_SCOu = "SummaryConsolidationOverride" +_UPCO = "UserPreferenceConsolidationOverride" +_CCC = "CustomConsolidationConfiguration" +_sCO = "semanticConsolidationOverride" +_sCOu = "summaryConsolidationOverride" +_uPCO = "userPreferenceConsolidationOverride" +_eCO = "episodicConsolidationOverride" +_CCons = "ConsolidationConfiguration" +_cCC = "customConsolidationConfiguration" +_EEO = "EpisodicExtractionOverride" +_SEO = "SemanticExtractionOverride" +_UPEO = "UserPreferenceExtractionOverride" +_CEC = "CustomExtractionConfiguration" +_sEO = "semanticExtractionOverride" +_uPEO = "userPreferenceExtractionOverride" +_eEO = "episodicExtractionOverride" +_ECxt = "ExtractionConfiguration" +_cEC = "customExtractionConfiguration" +_ERO = "EpisodicReflectionOverride" +_CRC = "CustomReflectionConfiguration" +_eRO = "episodicReflectionOverride" +_ERC = "EpisodicReflectionConfiguration" +_RCef = "ReflectionConfiguration" +_cRC = "customReflectionConfiguration" +_eRC = "episodicReflectionConfiguration" +_ICnv = "InvocationConfiguration" +_MBT = "MessageBasedTrigger" +_TBT = "TimeBasedTrigger" +_TBTo = "TokenBasedTrigger" +_TCr = "TriggerCondition" +_TCL = "TriggerConditionsList" +_SMC = "SelfManagedConfiguration" +_OT = "OverrideType" +_SO__ = "SEMANTIC_OVERRIDE" +_SO___ = "SUMMARY_OVERRIDE" +_UPO = "USER_PREFERENCE_OVERRIDE" +_SM_ = "SELF_MANAGED" +_EO = "EPISODIC_OVERRIDE" +_SCtr = "StrategyConfiguration" +_MSS = "MemoryStrategyStatus" +_MSIe = "MemoryStrategyId" +_MST = "MemoryStrategyType" +_MSem = "MemoryStrategy" +_MSLe = "MemoryStrategyList" +_Me = "Memory" +_mBRA = "managedByResourceArn" +_CMO = "CreateMemoryOutput" +_SEe = "ServiceException" +_TEh = "ThrottledException" +_CM = "CreateMemory" +_DMI = "DeleteMemoryInput" +_mIe = "memoryId" +_DMO = "DeleteMemoryOutput" +_DM = "DeleteMemory" +_MVe = "MemoryView" +_FULL = "FULL" +_fu = "full" +_WD = "WITHOUT_DECRYPTION" +_wd = "without_decryption" +_GMI = "GetMemoryInput" +_vie = "view" +_GMO = "GetMemoryOutput" +_GM = "GetMemory" +_LMI = "ListMemoriesInput" +_MSemo = "MemorySummary" +_MSLem = "MemorySummaryList" +_LMO = "ListMemoriesOutput" +_memor = "memories" +_LMi = "ListMemories" +_DMSI = "DeleteMemoryStrategyInput" +_mSI = "memoryStrategyId" +_DMSL = "DeleteMemoryStrategiesList" +_CCCI = "CustomConsolidationConfigurationInput" +_MCC = "ModifyConsolidationConfiguration" +_CECI = "CustomExtractionConfigurationInput" +_MEC = "ModifyExtractionConfiguration" +_CRCI = "CustomReflectionConfigurationInput" +_MRC = "ModifyReflectionConfiguration" +_MICI = "ModifyInvocationConfigurationInput" +_MSMC = "ModifySelfManagedConfiguration" +_MSC = "ModifyStrategyConfiguration" +_MMSI = "ModifyMemoryStrategyInput" +_MMSL = "ModifyMemoryStrategiesList" +_MMS = "ModifyMemoryStrategies" +_aMS = "addMemoryStrategies" +_mMS = "modifyMemoryStrategies" +_dMS = "deleteMemoryStrategies" +_UMI = "UpdateMemoryInput" +_aIK = "addIndexedKeys" +_UMO = "UpdateMemoryOutput" +_UM = "UpdateMemory" +_CPVT = "CredentialProviderVendorType" +_GO = "GoogleOauth2" +_GOi = "GithubOauth2" +_SOl = "SlackOauth2" +_SOa = "SalesforceOauth2" +_MOi = "MicrosoftOauth2" +_COu = "CustomOauth2" +_AOt = "AtlassianOauth2" +_LOi = "LinkedinOauth2" +_XO = "XOauth2" +_OO = "OktaOauth2" +_OLO = "OneLoginOauth2" +_POO = "PingOneOauth2" +_FOa = "FacebookOauth2" +_YO = "YandexOauth2" +_RO = "RedditOauth2" +_ZO = "ZoomOauth2" +_TO = "TwitchOauth2" +_SOp = "SpotifyOauth2" +_DO = "DropboxOauth2" +_NO = "NotionOauth2" +_HO = "HubspotOauth2" +_CAO = "CyberArkOauth2" +_FAO = "FusionAuthOauth2" +_AOu = "Auth0Oauth2" +_COo = "CognitoOauth2" +_CIT = "ClientIdType" +_DCST = "DefaultClientSecretType" +_AOPCI = "AtlassianOauth2ProviderConfigInput" +_cIl = "clientId" +_cS = "clientSecret" +_cSC = "clientSecretConfig" +_cSS = "clientSecretSource" +_CAMT = "ClientAuthenticationMethodType" +_CSB = "CLIENT_SECRET_BASIC" +_CSP = "CLIENT_SECRET_POST" +_PKJ = "PRIVATE_KEY_JWT" +_DCIT = "DefaultClientIdType" +_AET = "AuthorizationEndpointType" +_IUT = "IssuerUrlType" +_RTe = "ResponseType" +_RLT = "ResponseListType" +_TET = "TokenEndpointType" +_TAM = "TokenAuthMethod" +_TEAMT = "TokenEndpointAuthMethodsType" +_OASM = "Oauth2AuthorizationServerMetadata" +_is = "issuer" +_aE = "authorizationEndpoint" +_tE = "tokenEndpoint" +_rT = "responseTypes" +_tEAM = "tokenEndpointAuthMethods" +_DUT = "DiscoveryUrlType" +_OD = "Oauth2Discovery" +_aSMu = "authorizationServerMetadata" +_OBOTEGTT = "OnBehalfOfTokenExchangeGrantTypeType" +_JAG = "JWT_AUTHORIZATION_GRANT" +_STco = "ScopeType" +_SLT = "ScopesListType" +_TEGTCT = "TokenExchangeGrantTypeConfigType" +_aTCc = "actorTokenContent" +_aTS = "actorTokenScopes" +_OBOTECT = "OnBehalfOfTokenExchangeConfigType" +_tEGTC = "tokenExchangeGrantTypeConfig" +_KKST = "KmsKeySourceType" +_PKS = "PrivateKeySource" +_kKS = "kmsKeySource" +_SAi = "SigningAlgorithm" +_RS_ = "RS256" +_PS = "PS256" +_ES_ = "ES256" +_PKJC = "PrivateKeyJwtConfig" +_pKS = "privateKeySource" +_sAi = "signingAlgorithm" +_aHC = "additionalHeaderClaims" +_aPC = "additionalPayloadClaims" +_COPCI = "CustomOauth2ProviderConfigInput" +_oD = "oauthDiscovery" +_oBOTEC = "onBehalfOfTokenExchangeConfig" +_cAM = "clientAuthenticationMethod" +_pKJC = "privateKeyJwtConfig" +_GOPCI = "GithubOauth2ProviderConfigInput" +_GOPCIo = "GoogleOauth2ProviderConfigInput" +_IOPCI = "IncludedOauth2ProviderConfigInput" +_LOPCI = "LinkedinOauth2ProviderConfigInput" +_TIT = "TenantIdType" +_MOPCI = "MicrosoftOauth2ProviderConfigInput" +_tIe = "tenantId" +_SOPCI = "SalesforceOauth2ProviderConfigInput" +_SOPCIl = "SlackOauth2ProviderConfigInput" +_OPCI = "Oauth2ProviderConfigInput" +_cOPC = "customOauth2ProviderConfig" +_gOPC = "googleOauth2ProviderConfig" +_gOPCi = "githubOauth2ProviderConfig" +_sOPC = "slackOauth2ProviderConfig" +_sOPCa = "salesforceOauth2ProviderConfig" +_mOPC = "microsoftOauth2ProviderConfig" +_aOPC = "atlassianOauth2ProviderConfig" +_lOPC = "linkedinOauth2ProviderConfig" +_iOPC = "includedOauth2ProviderConfig" +_COCPI = "CreateOauth2CredentialProviderInput" +_cCOCPR = "com.amazonaws.bedrockagentcorecontrol#CreateOauth2CredentialProviderRequest" +_cPVr = "credentialProviderVendor" +_oPCI = "oauth2ProviderConfigInput" +_CPATr = "CredentialProviderArnType" +_AOPCO = "AtlassianOauth2ProviderConfigOutput" +_COPCO = "CustomOauth2ProviderConfigOutput" +_GOPCO = "GithubOauth2ProviderConfigOutput" +_GOPCOo = "GoogleOauth2ProviderConfigOutput" +_IOPCO = "IncludedOauth2ProviderConfigOutput" +_LOPCO = "LinkedinOauth2ProviderConfigOutput" +_MOPCO = "MicrosoftOauth2ProviderConfigOutput" +_SOPCO = "SalesforceOauth2ProviderConfigOutput" +_SOPCOl = "SlackOauth2ProviderConfigOutput" +_OPCO = "Oauth2ProviderConfigOutput" +_St = "Status" +_COCPO = "CreateOauth2CredentialProviderOutput" +_cCOCPRo = ( + "com.amazonaws.bedrockagentcorecontrol#CreateOauth2CredentialProviderResponse" +) +_cSA = "clientSecretArn" +_cSJK = "clientSecretJsonKey" +_cUa = "callbackUrl" +_oPCO = "oauth2ProviderConfigOutput" +_COCP = "CreateOauth2CredentialProvider" +_DOCPI = "DeleteOauth2CredentialProviderInput" +_cDOCPR = "com.amazonaws.bedrockagentcorecontrol#DeleteOauth2CredentialProviderRequest" +_DOCPO = "DeleteOauth2CredentialProviderOutput" +_cDOCPRo = ( + "com.amazonaws.bedrockagentcorecontrol#DeleteOauth2CredentialProviderResponse" +) +_DOCP = "DeleteOauth2CredentialProvider" +_GOCPI = "GetOauth2CredentialProviderInput" +_cGOCPR = "com.amazonaws.bedrockagentcorecontrol#GetOauth2CredentialProviderRequest" +_GOCPO = "GetOauth2CredentialProviderOutput" +_cGOCPRo = "com.amazonaws.bedrockagentcorecontrol#GetOauth2CredentialProviderResponse" +_GOCP = "GetOauth2CredentialProvider" +_LOCPI = "ListOauth2CredentialProvidersInput" +_cLOCPR = "com.amazonaws.bedrockagentcorecontrol#ListOauth2CredentialProvidersRequest" +_OCPI = "Oauth2CredentialProviderItem" +_OCP = "Oauth2CredentialProviders" +_LOCPO = "ListOauth2CredentialProvidersOutput" +_cLOCPRo = "com.amazonaws.bedrockagentcorecontrol#ListOauth2CredentialProvidersResponse" +_LOCP = "ListOauth2CredentialProviders" +_UOCPI = "UpdateOauth2CredentialProviderInput" +_cUOCPR = "com.amazonaws.bedrockagentcorecontrol#UpdateOauth2CredentialProviderRequest" +_UOCPO = "UpdateOauth2CredentialProviderOutput" +_cUOCPRo = ( + "com.amazonaws.bedrockagentcorecontrol#UpdateOauth2CredentialProviderResponse" +) +_UOCP = "UpdateOauth2CredentialProvider" +_CFl = "ClusteringFrequency" +_DAILY = "DAILY" +_WEEKLY = "WEEKLY" +_MONTHLY = "MONTHLY" +_CFL = "ClusteringFrequencyList" +_CCl = "ClusteringConfig" +_fr = "frequencies" +_LGNP = "LogGroupNamePrefix" +_LGNPL = "LogGroupNamePrefixList" +_LGN = "LogGroupName" +_LGNL = "LogGroupNamesList" +_SNe = "ServiceName" +_SNL = "ServiceNamesList" +_CWLIC = "CloudWatchLogsInputConfig" +_lGN = "logGroupNames" +_lGNP = "logGroupNamePrefixes" +_sN = "serviceNames" +_DSC = "DataSourceConfig" +_cWL = "cloudWatchLogs" +_ECD = "EvaluationConfigDescription" +_ER = "EvaluatorReference" +_ELv = "EvaluatorList" +_II = "InsightId" +_I = "Insight" +_iI = "insightId" +_IL = "InsightList" +_ECN = "EvaluationConfigName" +_OLGN = "OptionalLogGroupName" +_MN = "MetricsNamespace" +_RDe = "ResultDestination" +_DLG = "DEDICATED_LOG_GROUP" +_SLG = "SOURCE_LOG_GROUP" +_CWOC = "CloudWatchOutputConfig" +_lGNo = "logGroupName" +_mN = "metricsNamespace" +_rDe = "resultDestination" +_OC = "OutputConfig" +_cWC = "cloudWatchConfig" +_FOi = "FilterOperator" +_E = "Equals" +_NE = "NOT_EQUALS" +_NEo = "NotEquals" +_GT = "GREATER_THAN" +_GTr = "GreaterThan" +_LT = "LESS_THAN" +_LTe = "LessThan" +_GTOE = "GREATER_THAN_OR_EQUAL" +_GTOEr = "GreaterThanOrEqual" +_LTOE = "LESS_THAN_OR_EQUAL" +_LTOEe = "LessThanOrEqual" +_Cont = "Contains" +_NC_ = "NOT_CONTAINS" +_NCo = "NotContains" +_FV = "FilterValue" +_sVtr = "stringValue" +_dVo = "doubleValue" +_bVo = "booleanValue" +_F = "Filter" +_FL = "FilterList" +_SPa = "SamplingPercentage" +_SCa = "SamplingConfig" +_sPa = "samplingPercentage" +_SCes = "SessionConfig" +_sTM = "sessionTimeoutMinutes" +_R = "Rule" +_sCa = "samplingConfig" +_fil = "filters" +_sCes = "sessionConfig" +_COECI = "CreateOnlineEvaluationConfigInput" +_cCOECR = "com.amazonaws.bedrockagentcorecontrol#CreateOnlineEvaluationConfigRequest" +_oECN = "onlineEvaluationConfigName" +_rul = "rule" +_dSC = "dataSourceConfig" +_ins = "insights" +_cCl = "clusteringConfig" +_oC = "outputConfig" +_eERA = "evaluationExecutionRoleArn" +_eOC = "enableOnCreate" +_OEES = "OnlineEvaluationExecutionStatus" +_ENABLED = "ENABLED" +_DISABLED = "DISABLED" +_OECA = "OnlineEvaluationConfigArn" +_OECI = "OnlineEvaluationConfigId" +_OECS = "OnlineEvaluationConfigStatus" +_ERROR = "ERROR" +_COECO = "CreateOnlineEvaluationConfigOutput" +_cCOECRo = "com.amazonaws.bedrockagentcorecontrol#CreateOnlineEvaluationConfigResponse" +_oECA = "onlineEvaluationConfigArn" +_oECI = "onlineEvaluationConfigId" +_eS = "executionStatus" +_COEC = "CreateOnlineEvaluationConfig" +_DOECI = "DeleteOnlineEvaluationConfigInput" +_cDOECR = "com.amazonaws.bedrockagentcorecontrol#DeleteOnlineEvaluationConfigRequest" +_DOECO = "DeleteOnlineEvaluationConfigOutput" +_cDOECRo = "com.amazonaws.bedrockagentcorecontrol#DeleteOnlineEvaluationConfigResponse" +_DOEC = "DeleteOnlineEvaluationConfig" +_GOECI = "GetOnlineEvaluationConfigInput" +_cGOECR = "com.amazonaws.bedrockagentcorecontrol#GetOnlineEvaluationConfigRequest" +_GOECO = "GetOnlineEvaluationConfigOutput" +_cGOECRo = "com.amazonaws.bedrockagentcorecontrol#GetOnlineEvaluationConfigResponse" +_GOEC = "GetOnlineEvaluationConfig" +_LOECI = "ListOnlineEvaluationConfigsInput" +_cLOECR = "com.amazonaws.bedrockagentcorecontrol#ListOnlineEvaluationConfigsRequest" +_OECSn = "OnlineEvaluationConfigSummary" +_OECSL = "OnlineEvaluationConfigSummaryList" +_LOECO = "ListOnlineEvaluationConfigsOutput" +_cLOECRo = "com.amazonaws.bedrockagentcorecontrol#ListOnlineEvaluationConfigsResponse" +_oEC = "onlineEvaluationConfigs" +_LOEC = "ListOnlineEvaluationConfigs" +_UOECI = "UpdateOnlineEvaluationConfigInput" +_cUOECR = "com.amazonaws.bedrockagentcorecontrol#UpdateOnlineEvaluationConfigRequest" +_UOECO = "UpdateOnlineEvaluationConfigOutput" +_cUOECRo = "com.amazonaws.bedrockagentcorecontrol#UpdateOnlineEvaluationConfigResponse" +_UOEC = "UpdateOnlineEvaluationConfig" +_PCPVT = "PaymentCredentialProviderVendorType" +_CCDP = "CoinbaseCDP" +_SPt = "StripePrivy" +_CCAKIT = "CoinbaseCdpApiKeyIdType" +_DCCAKST = "DefaultCoinbaseCdpApiKeySecretType" +_DCCWST = "DefaultCoinbaseCdpWalletSecretType" +_CCCIo = "CoinbaseCdpConfigurationInput" +_aKI = "apiKeyId" +_aKS = "apiKeySecret" +_wS = "walletSecret" +_wSS = "walletSecretSource" +_wSC = "walletSecretConfig" +_SPAIT = "StripePrivyAppIdType" +_DSPAST = "DefaultStripePrivyAppSecretType" +_SPAITt = "StripePrivyAuthorizationIdType" +_DSPAPKT = "DefaultStripePrivyAuthorizationPrivateKeyType" +_SPCI = "StripePrivyConfigurationInput" +_aIp = "appId" +_aSp = "appSecret" +_aSS = "appSecretSource" +_aSC = "appSecretConfig" +_aPK = "authorizationPrivateKey" +_aPKS = "authorizationPrivateKeySource" +_aPKC = "authorizationPrivateKeyConfig" +_aIu = "authorizationId" +_PPCI = "PaymentProviderConfigurationInput" +_cCCo = "coinbaseCdpConfiguration" +_sPC = "stripePrivyConfiguration" +_CPCPI = "CreatePaymentCredentialProviderInput" +_cCPCPR = "com.amazonaws.bedrockagentcorecontrol#CreatePaymentCredentialProviderRequest" +_pCI = "providerConfigurationInput" +_PCPAT = "PaymentCredentialProviderArnType" +_CCCO = "CoinbaseCdpConfigurationOutput" +_wSA = "walletSecretArn" +_wSJK = "walletSecretJsonKey" +_SPCO = "StripePrivyConfigurationOutput" +_aSA = "appSecretArn" +_aSJK = "appSecretJsonKey" +_aPKA = "authorizationPrivateKeyArn" +_aPKJK = "authorizationPrivateKeyJsonKey" +_PPCO = "PaymentProviderConfigurationOutput" +_CPCPO = "CreatePaymentCredentialProviderOutput" +_cCPCPRo = ( + "com.amazonaws.bedrockagentcorecontrol#CreatePaymentCredentialProviderResponse" +) +_pCO = "providerConfigurationOutput" +_CPCP = "CreatePaymentCredentialProvider" +_DPCPI = "DeletePaymentCredentialProviderInput" +_cDPCPR = "com.amazonaws.bedrockagentcorecontrol#DeletePaymentCredentialProviderRequest" +_DPCPO = "DeletePaymentCredentialProviderOutput" +_cDPCPRo = ( + "com.amazonaws.bedrockagentcorecontrol#DeletePaymentCredentialProviderResponse" +) +_DPCP = "DeletePaymentCredentialProvider" +_GPCPI = "GetPaymentCredentialProviderInput" +_cGPCPR = "com.amazonaws.bedrockagentcorecontrol#GetPaymentCredentialProviderRequest" +_GPCPO = "GetPaymentCredentialProviderOutput" +_cGPCPRo = "com.amazonaws.bedrockagentcorecontrol#GetPaymentCredentialProviderResponse" +_GPCP = "GetPaymentCredentialProvider" +_LPCPI = "ListPaymentCredentialProvidersInput" +_cLPCPR = "com.amazonaws.bedrockagentcorecontrol#ListPaymentCredentialProvidersRequest" +_PCPI = "PaymentCredentialProviderItem" +_PCP = "PaymentCredentialProviders" +_LPCPO = "ListPaymentCredentialProvidersOutput" +_cLPCPRo = ( + "com.amazonaws.bedrockagentcorecontrol#ListPaymentCredentialProvidersResponse" +) +_LPCP = "ListPaymentCredentialProviders" +_UPCPI = "UpdatePaymentCredentialProviderInput" +_cUPCPR = "com.amazonaws.bedrockagentcorecontrol#UpdatePaymentCredentialProviderRequest" +_UPCPO = "UpdatePaymentCredentialProviderOutput" +_cUPCPRo = ( + "com.amazonaws.bedrockagentcorecontrol#UpdatePaymentCredentialProviderResponse" +) +_UPCP = "UpdatePaymentCredentialProvider" +_PAT = "PaymentsAuthorizerType" +_PD = "PaymentsDescription" +_PMN = "PaymentManagerName" +_CPMI = "CreatePaymentManagerInput" +_cCPMR = "com.amazonaws.bedrockagentcorecontrol#CreatePaymentManagerRequest" +_PMA = "PaymentManagerArn" +_PMI = "PaymentManagerId" +_PMS = "PaymentManagerStatus" +_CPMO = "CreatePaymentManagerOutput" +_cCPMRo = "com.amazonaws.bedrockagentcorecontrol#CreatePaymentManagerResponse" +_pMA = "paymentManagerArn" +_pMI = "paymentManagerId" +_CPM = "CreatePaymentManager" +_DPMI = "DeletePaymentManagerInput" +_cDPMR = "com.amazonaws.bedrockagentcorecontrol#DeletePaymentManagerRequest" +_DPMO = "DeletePaymentManagerOutput" +_cDPMRo = "com.amazonaws.bedrockagentcorecontrol#DeletePaymentManagerResponse" +_DPM = "DeletePaymentManager" +_GPMI = "GetPaymentManagerInput" +_cGPMR = "com.amazonaws.bedrockagentcorecontrol#GetPaymentManagerRequest" +_GPMO = "GetPaymentManagerOutput" +_cGPMRo = "com.amazonaws.bedrockagentcorecontrol#GetPaymentManagerResponse" +_GPM = "GetPaymentManager" +_LPMI = "ListPaymentManagersInput" +_cLPMR = "com.amazonaws.bedrockagentcorecontrol#ListPaymentManagersRequest" +_PMSa = "PaymentManagerSummary" +_PMSay = "PaymentManagerSummaries" +_LPMO = "ListPaymentManagersOutput" +_cLPMRo = "com.amazonaws.bedrockagentcorecontrol#ListPaymentManagersResponse" +_pM = "paymentManagers" +_LPM = "ListPaymentManagers" +_PCPA = "PaymentCredentialProviderArn" +_PCPC = "PaymentCredentialProviderConfiguration" +_CPCred = "CredentialsProviderConfiguration" +_cCDP = "coinbaseCDP" +_sPt = "stripePrivy" +_CPCrede = "CredentialsProviderConfigurations" +_PCN = "PaymentConnectorName" +_PCPM = "PaymentConnectorProvisionMode" +_MANUAL = "MANUAL" +_QC = "QUICK_CREATE" +_PCT = "PaymentConnectorType" +_CC___ = "COINBASE_CDP" +_SP_ = "STRIPE_PRIVY" +_CPCI = "CreatePaymentConnectorInput" +_cCPCR = "com.amazonaws.bedrockagentcorecontrol#CreatePaymentConnectorRequest" +_cPCr = "credentialProviderConfigurations" +_pMr = "provisionMode" +_PCAU = "PaymentConnectorAuthorizationUrl" +_PCI = "PaymentConnectorId" +_PCS = "PaymentConnectorStatus" +_AMSR = "AWS_MARKETPLACE_SUBSCRIPTION_REQUIRED" +_PA = "PENDING_AUTHENTICATION" +_PROVISIONING = "PROVISIONING" +_AE_ = "AUTHENTICATION_EXPIRED" +_AF = "AUTHENTICATION_FAILED" +_CPCO = "CreatePaymentConnectorOutput" +_cCPCRo = "com.amazonaws.bedrockagentcorecontrol#CreatePaymentConnectorResponse" +_pCIa = "paymentConnectorId" +_SRE = "SubscriptionRequiredException" +_sUu = "subscriptionUrl" +_pN = "productName" +_CPCrea = "CreatePaymentConnector" +_DPCI = "DeletePaymentConnectorInput" +_cDPCR = "com.amazonaws.bedrockagentcorecontrol#DeletePaymentConnectorRequest" +_DPCO = "DeletePaymentConnectorOutput" +_cDPCRo = "com.amazonaws.bedrockagentcorecontrol#DeletePaymentConnectorResponse" +_DPC = "DeletePaymentConnector" +_GPCI = "GetPaymentConnectorInput" +_cGPCR = "com.amazonaws.bedrockagentcorecontrol#GetPaymentConnectorRequest" +_GPCO = "GetPaymentConnectorOutput" +_cGPCRo = "com.amazonaws.bedrockagentcorecontrol#GetPaymentConnectorResponse" +_cUA = "credentialsUpdatedAt" +_GPCe = "GetPaymentConnector" +_LPCI = "ListPaymentConnectorsInput" +_cLPCR = "com.amazonaws.bedrockagentcorecontrol#ListPaymentConnectorsRequest" +_PCSa = "PaymentConnectorSummary" +_PCSay = "PaymentConnectorSummaries" +_LPCO = "ListPaymentConnectorsOutput" +_cLPCRo = "com.amazonaws.bedrockagentcorecontrol#ListPaymentConnectorsResponse" +_pCa = "paymentConnectors" +_LPC = "ListPaymentConnectors" +_CCS = "CoinbaseCdpSecret" +_WS = "WALLET_SECRET" +_CCSo = "CoinbaseCdpSecrets" +_CCRT = "CoinbaseCdpRotationTargets" +_secr = "secrets" +_CRCr = "CredentialRotationConfig" +_RPCCI = "RotatePaymentConnectorCredentialsInput" +_cRPCCR = ( + "com.amazonaws.bedrockagentcorecontrol#RotatePaymentConnectorCredentialsRequest" +) +_cTR = "credentialsToRotate" +_RPCCO = "RotatePaymentConnectorCredentialsOutput" +_cRPCCRo = ( + "com.amazonaws.bedrockagentcorecontrol#RotatePaymentConnectorCredentialsResponse" +) +_RPCC = "RotatePaymentConnectorCredentials" +_UPCI = "UpdatePaymentConnectorInput" +_cUPCR = "com.amazonaws.bedrockagentcorecontrol#UpdatePaymentConnectorRequest" +_UPCOp = "UpdatePaymentConnectorOutput" +_cUPCRo = "com.amazonaws.bedrockagentcorecontrol#UpdatePaymentConnectorResponse" +_UPC = "UpdatePaymentConnector" +_UPMI = "UpdatePaymentManagerInput" +_cUPMR = "com.amazonaws.bedrockagentcorecontrol#UpdatePaymentManagerRequest" +_UPMO = "UpdatePaymentManagerOutput" +_cUPMRo = "com.amazonaws.bedrockagentcorecontrol#UpdatePaymentManagerResponse" +_UPM = "UpdatePaymentManager" +_PEN = "PolicyEngineName" +_CPEI = "CreatePolicyEngineInput" +_cCPER = "com.amazonaws.bedrockagentcorecontrol#CreatePolicyEngineRequest" +_PEA = "PolicyEngineArn" +_RI = "ResourceId" +_PES = "PolicyEngineStatus" +_Str = "String" +_PSR = "PolicyStatusReasons" +_CPEO = "CreatePolicyEngineOutput" +_cCPERo = "com.amazonaws.bedrockagentcorecontrol#CreatePolicyEngineResponse" +_pEI = "policyEngineId" +_pEA = "policyEngineArn" +_CPE = "CreatePolicyEngine" +_DPEI = "DeletePolicyEngineInput" +_cDPER = "com.amazonaws.bedrockagentcorecontrol#DeletePolicyEngineRequest" +_DPEO = "DeletePolicyEngineOutput" +_cDPERo = "com.amazonaws.bedrockagentcorecontrol#DeletePolicyEngineResponse" +_DPE = "DeletePolicyEngine" +_GPEI = "GetPolicyEngineInput" +_cGPER = "com.amazonaws.bedrockagentcorecontrol#GetPolicyEngineRequest" +_GPEO = "GetPolicyEngineOutput" +_cGPERo = "com.amazonaws.bedrockagentcorecontrol#GetPolicyEngineResponse" +_GPE = "GetPolicyEngine" +_GPESI = "GetPolicyEngineSummaryInput" +_cGPESR = "com.amazonaws.bedrockagentcorecontrol#GetPolicyEngineSummaryRequest" +_GPESO = "GetPolicyEngineSummaryOutput" +_cGPESRo = "com.amazonaws.bedrockagentcorecontrol#GetPolicyEngineSummaryResponse" +_GPES = "GetPolicyEngineSummary" +_LPEI = "ListPolicyEnginesInput" +_cLPER = "com.amazonaws.bedrockagentcorecontrol#ListPolicyEnginesRequest" +_PEo = "PolicyEngine" +_PEol = "PolicyEngines" +_LPEO = "ListPolicyEnginesOutput" +_cLPERo = "com.amazonaws.bedrockagentcorecontrol#ListPolicyEnginesResponse" +_pEo = "policyEngines" +_LPE = "ListPolicyEngines" +_LPESI = "ListPolicyEngineSummariesInput" +_cLPESR = "com.amazonaws.bedrockagentcorecontrol#ListPolicyEngineSummariesRequest" +_PESo = "PolicyEngineSummary" +_PESL = "PolicyEngineSummaryList" +_LPESO = "ListPolicyEngineSummariesOutput" +_cLPESRo = "com.amazonaws.bedrockagentcorecontrol#ListPolicyEngineSummariesResponse" +_LPES = "ListPolicyEngineSummaries" +_UPEI = "UpdatePolicyEngineInput" +_cUPER = "com.amazonaws.bedrockagentcorecontrol#UpdatePolicyEngineRequest" +_UPEOp = "UpdatePolicyEngineOutput" +_cUPERo = "com.amazonaws.bedrockagentcorecontrol#UpdatePolicyEngineResponse" +_UPE = "UpdatePolicyEngine" +_GPGI = "GetPolicyGenerationInput" +_cGPGR = "com.amazonaws.bedrockagentcorecontrol#GetPolicyGenerationRequest" +_pGI = "policyGenerationId" +_PGN = "PolicyGenerationName" +_PGA = "PolicyGenerationArn" +_Re = "Resource" +_PGS = "PolicyGenerationStatus" +_GENERATING = "GENERATING" +_GENERATED = "GENERATED" +_GF = "GENERATE_FAILED" +_GPGO = "GetPolicyGenerationOutput" +_cGPGRo = "com.amazonaws.bedrockagentcorecontrol#GetPolicyGenerationResponse" +_pGA = "policyGenerationArn" +_resou = "resource" +_fin = "findings" +_GPG = "GetPolicyGeneration" +_GPGSI = "GetPolicyGenerationSummaryInput" +_cGPGSR = "com.amazonaws.bedrockagentcorecontrol#GetPolicyGenerationSummaryRequest" +_GPGSO = "GetPolicyGenerationSummaryOutput" +_cGPGSRo = "com.amazonaws.bedrockagentcorecontrol#GetPolicyGenerationSummaryResponse" +_GPGS = "GetPolicyGenerationSummary" +_LPGAI = "ListPolicyGenerationAssetsInput" +_cLPGAR = "com.amazonaws.bedrockagentcorecontrol#ListPolicyGenerationAssetsRequest" +_Sta = "Statement" +_CPe = "CedarPolicy" +_stat = "statement" +_PSo = "PolicyStatement" +_PGD = "PolicyGenerationDetails" +_pGAI = "policyGenerationAssetId" +_PDo = "PolicyDefinition" +_ced = "cedar" +_pG = "policyGeneration" +_FT = "FindingType" +_VALID = "VALID" +_INVALID = "INVALID" +_NT_ = "NOT_TRANSLATABLE" +_AA__ = "ALLOW_ALL" +_AN = "ALLOW_NONE" +_DA_ = "DENY_ALL" +_DN_ = "DENY_NONE" +_Fi = "Finding" +_Fin = "Findings" +_NLa = "NaturalLanguage" +_PGAo = "PolicyGenerationAsset" +_rTF = "rawTextFragment" +_PGAol = "PolicyGenerationAssets" +_LPGAO = "ListPolicyGenerationAssetsOutput" +_cLPGARo = "com.amazonaws.bedrockagentcorecontrol#ListPolicyGenerationAssetsResponse" +_pGAo = "policyGenerationAssets" +_LPGA = "ListPolicyGenerationAssets" +_LPGI = "ListPolicyGenerationsInput" +_cLPGR = "com.amazonaws.bedrockagentcorecontrol#ListPolicyGenerationsRequest" +_PG = "PolicyGeneration" +_PGo = "PolicyGenerations" +_LPGO = "ListPolicyGenerationsOutput" +_cLPGRo = "com.amazonaws.bedrockagentcorecontrol#ListPolicyGenerationsResponse" +_pGo = "policyGenerations" +_LPG = "ListPolicyGenerations" +_LPGSI = "ListPolicyGenerationSummariesInput" +_cLPGSR = "com.amazonaws.bedrockagentcorecontrol#ListPolicyGenerationSummariesRequest" +_PGSo = "PolicyGenerationSummary" +_PGSL = "PolicyGenerationSummaryList" +_LPGSO = "ListPolicyGenerationSummariesOutput" +_cLPGSRo = "com.amazonaws.bedrockagentcorecontrol#ListPolicyGenerationSummariesResponse" +_LPGS = "ListPolicyGenerationSummaries" +_Conte = "Content" +_rTa = "rawText" +_SPGI = "StartPolicyGenerationInput" +_cSPGR = "com.amazonaws.bedrockagentcorecontrol#StartPolicyGenerationRequest" +_cont = "content" +_SPGO = "StartPolicyGenerationOutput" +_cSPGRo = "com.amazonaws.bedrockagentcorecontrol#StartPolicyGenerationResponse" +_SPG = "StartPolicyGeneration" +_EM = "EnforcementMode" +_PN = "PolicyName" +_PVM = "PolicyValidationMode" +_FOAF = "FAIL_ON_ANY_FINDINGS" +_IAF = "IGNORE_ALL_FINDINGS" +_CPIr = "CreatePolicyInput" +_cCPR = "com.amazonaws.bedrockagentcorecontrol#CreatePolicyRequest" +_vM = "validationMode" +_eM = "enforcementMode" +_PAo = "PolicyArn" +_PSol = "PolicyStatus" +_CPOr = "CreatePolicyOutput" +_cCPRo = "com.amazonaws.bedrockagentcorecontrol#CreatePolicyResponse" +_pIo = "policyId" +_pAo = "policyArn" +_CPre = "CreatePolicy" +_DPI = "DeletePolicyInput" +_cDPR = "com.amazonaws.bedrockagentcorecontrol#DeletePolicyRequest" +_DPO = "DeletePolicyOutput" +_cDPRo = "com.amazonaws.bedrockagentcorecontrol#DeletePolicyResponse" +_DP = "DeletePolicy" +_GPI = "GetPolicyInput" +_cGPR = "com.amazonaws.bedrockagentcorecontrol#GetPolicyRequest" +_GPO = "GetPolicyOutput" +_cGPRo = "com.amazonaws.bedrockagentcorecontrol#GetPolicyResponse" +_GPe = "GetPolicy" +_GPSI = "GetPolicySummaryInput" +_cGPSR = "com.amazonaws.bedrockagentcorecontrol#GetPolicySummaryRequest" +_GPSO = "GetPolicySummaryOutput" +_cGPSRo = "com.amazonaws.bedrockagentcorecontrol#GetPolicySummaryResponse" +_GPS = "GetPolicySummary" +_LPI = "ListPoliciesInput" +_cLPR = "com.amazonaws.bedrockagentcorecontrol#ListPoliciesRequest" +_tRS = "targetResourceScope" +_Po = "Policy" +_Pol = "Policies" +_LPO = "ListPoliciesOutput" +_cLPRo = "com.amazonaws.bedrockagentcorecontrol#ListPoliciesResponse" +_pol = "policies" +_LPi = "ListPolicies" +_LPSI = "ListPolicySummariesInput" +_cLPSR = "com.amazonaws.bedrockagentcorecontrol#ListPolicySummariesRequest" +_PSoli = "PolicySummary" +_PSL = "PolicySummaryList" +_LPSO = "ListPolicySummariesOutput" +_cLPSRo = "com.amazonaws.bedrockagentcorecontrol#ListPolicySummariesResponse" +_LPS = "ListPolicySummaries" +_UPI = "UpdatePolicyInput" +_cUPR = "com.amazonaws.bedrockagentcorecontrol#UpdatePolicyRequest" +_UPOp = "UpdatePolicyOutput" +_cUPRo = "com.amazonaws.bedrockagentcorecontrol#UpdatePolicyResponse" +_UPp = "UpdatePolicy" +_PRPI = "PutResourcePolicyInput" +_cPRPR = "com.amazonaws.bedrockagentcorecontrol#PutResourcePolicyRequest" +_PRPO = "PutResourcePolicyOutput" +_cPRPRo = "com.amazonaws.bedrockagentcorecontrol#PutResourcePolicyResponse" +_PRP = "PutResourcePolicy" +_CDus = "CustomDescriptor" +_SDe = "ServerDefinition" +_TDo = "ToolsDefinition" +_pVr = "protocolVersion" +_MD = "McpDescriptor" +_Des = "Descriptors" +_aa = "a2a" +_cu = "custom" +_aSg = "agentSkills" +_DTe = "DescriptorType" +_AS = "AGENT_SKILLS" +_RRN = "RegistryRecordName" +_RRV = "RegistryRecordVersion" +_RIe = "RegistryIdentifier" +_ISR = "IamSigningRegion" +_IRA = "IamRoleArn" +_ISSN = "IamSigningServiceName" +_RRICP = "RegistryRecordIamCredentialProvider" +_CPMu = "CustomParameterMap" +_RROAGT = "RegistryRecordOAuthGrantType" +_CPAr = "CredentialProviderArn" +_SLc = "ScopeList" +_RROACP = "RegistryRecordOAuthCredentialProvider" +_RRCPU = "RegistryRecordCredentialProviderUnion" +_RRCPT = "RegistryRecordCredentialProviderType" +_IAM = "IAM" +_RRCPC = "RegistryRecordCredentialProviderConfiguration" +_RRCPCL = "RegistryRecordCredentialProviderConfigurationList" +_MSU = "McpServerUrl" +_FUSC = "FromUrlSynchronizationConfiguration" +_SCy = "SynchronizationConfiguration" +_fU = "fromUrl" +_STy = "SynchronizationType" +_URL = "URL" +_CRRI = "CreateRegistryRecordInput" +_cCRRR = "com.amazonaws.bedrockagentcorecontrol#CreateRegistryRecordRequest" +_rIe = "registryId" +_dT = "descriptorType" +_des = "descriptors" +_rVe = "recordVersion" +_sTy = "synchronizationType" +_sCy = "synchronizationConfiguration" +_RRA = "RegistryRecordArn" +_RRS = "RegistryRecordStatus" +_DRAFT = "DRAFT" +_PA_ = "PENDING_APPROVAL" +_APPROVED = "APPROVED" +_REJECTED = "REJECTED" +_DEPRECATED = "DEPRECATED" +_CRRO = "CreateRegistryRecordOutput" +_cCRRRo = "com.amazonaws.bedrockagentcorecontrol#CreateRegistryRecordResponse" +_rAec = "recordArn" +_CRR = "CreateRegistryRecord" +_RIec = "RecordIdentifier" +_DRRI = "DeleteRegistryRecordInput" +_cDRRR = "com.amazonaws.bedrockagentcorecontrol#DeleteRegistryRecordRequest" +_rIec = "recordId" +_DRRO = "DeleteRegistryRecordOutput" +_cDRRRo = "com.amazonaws.bedrockagentcorecontrol#DeleteRegistryRecordResponse" +_DRR = "DeleteRegistryRecord" +_GRRI = "GetRegistryRecordInput" +_cGRRR = "com.amazonaws.bedrockagentcorecontrol#GetRegistryRecordRequest" +_RRI = "RegistryRecordId" +_RAe = "RegistryArn" +_GRRO = "GetRegistryRecordOutput" +_cGRRRo = "com.amazonaws.bedrockagentcorecontrol#GetRegistryRecordResponse" +_rAeg = "registryArn" +_GRR = "GetRegistryRecord" +_LRRI = "ListRegistryRecordsInput" +_cLRRR = "com.amazonaws.bedrockagentcorecontrol#ListRegistryRecordsRequest" +_RRSe = "RegistryRecordSummary" +_RRSL = "RegistryRecordSummaryList" +_LRRO = "ListRegistryRecordsOutput" +_cLRRRo = "com.amazonaws.bedrockagentcorecontrol#ListRegistryRecordsResponse" +_rR = "registryRecords" +_LRR = "ListRegistryRecords" +_SRRFAI = "SubmitRegistryRecordForApprovalInput" +_cSRRFAR = ( + "com.amazonaws.bedrockagentcorecontrol#SubmitRegistryRecordForApprovalRequest" +) +_SRRFAO = "SubmitRegistryRecordForApprovalOutput" +_cSRRFARo = ( + "com.amazonaws.bedrockagentcorecontrol#SubmitRegistryRecordForApprovalResponse" +) +_SRRFA = "SubmitRegistryRecordForApproval" +_UAD = "UpdatedA2aDescriptor" +_USD = "UpdatedSkillDefinition" +_USMD = "UpdatedSkillMdDefinition" +_UASDF = "UpdatedAgentSkillsDescriptorFields" +_UASD = "UpdatedAgentSkillsDescriptor" +_UCD = "UpdatedCustomDescriptor" +_USDp = "UpdatedServerDefinition" +_UTD = "UpdatedToolsDefinition" +_UMDF = "UpdatedMcpDescriptorFields" +_UMD = "UpdatedMcpDescriptor" +_UDU = "UpdatedDescriptorsUnion" +_UDpd = "UpdatedDescriptors" +_USC = "UpdatedSynchronizationConfiguration" +_UST = "UpdatedSynchronizationType" +_URRI = "UpdateRegistryRecordInput" +_cURRR = "com.amazonaws.bedrockagentcorecontrol#UpdateRegistryRecordRequest" +_tSr = "triggerSynchronization" +_URRO = "UpdateRegistryRecordOutput" +_cURRRo = "com.amazonaws.bedrockagentcorecontrol#UpdateRegistryRecordResponse" +_URR = "UpdateRegistryRecord" +_URRSI = "UpdateRegistryRecordStatusInput" +_cURRSR = "com.amazonaws.bedrockagentcorecontrol#UpdateRegistryRecordStatusRequest" +_URRSO = "UpdateRegistryRecordStatusOutput" +_cURRSRo = "com.amazonaws.bedrockagentcorecontrol#UpdateRegistryRecordStatusResponse" +_URRS = "UpdateRegistryRecordStatus" +_ACp = "ApprovalConfiguration" +_aAu = "autoApproval" +_RAT = "RegistryAuthorizerType" +_RN = "RegistryName" +_CRIr = "CreateRegistryInput" +_cCRR = "com.amazonaws.bedrockagentcorecontrol#CreateRegistryRequest" +_aCp = "approvalConfiguration" +_CROr = "CreateRegistryOutput" +_cCRRo = "com.amazonaws.bedrockagentcorecontrol#CreateRegistryResponse" +_CR = "CreateRegistry" +_DRI = "DeleteRegistryInput" +_cDRR = "com.amazonaws.bedrockagentcorecontrol#DeleteRegistryRequest" +_RSe = "RegistryStatus" +_DRO = "DeleteRegistryOutput" +_cDRRo = "com.amazonaws.bedrockagentcorecontrol#DeleteRegistryResponse" +_DR = "DeleteRegistry" +_GRIe = "GetRegistryInput" +_cGRR = "com.amazonaws.bedrockagentcorecontrol#GetRegistryRequest" +_RIeg = "RegistryId" +_GRO = "GetRegistryOutput" +_cGRRo = "com.amazonaws.bedrockagentcorecontrol#GetRegistryResponse" +_GRe = "GetRegistry" +_LRI = "ListRegistriesInput" +_cLRR = "com.amazonaws.bedrockagentcorecontrol#ListRegistriesRequest" +_RSeg = "RegistrySummary" +_RSL = "RegistrySummaryList" +_LRO = "ListRegistriesOutput" +_cLRRo = "com.amazonaws.bedrockagentcorecontrol#ListRegistriesResponse" +_regi = "registries" +_LR = "ListRegistries" +_UACp = "UpdatedApprovalConfiguration" +_URI = "UpdateRegistryInput" +_cURR = "com.amazonaws.bedrockagentcorecontrol#UpdateRegistryRequest" +_URO = "UpdateRegistryOutput" +_cURRo = "com.amazonaws.bedrockagentcorecontrol#UpdateRegistryResponse" +_UR = "UpdateRegistry" +_CME = "ConcurrentModificationException" +_STVCMKI = "SetTokenVaultCMKInput" +_cSTVCMKR = "com.amazonaws.bedrockagentcorecontrol#SetTokenVaultCMKRequest" +_STVCMKO = "SetTokenVaultCMKOutput" +_cSTVCMKRo = "com.amazonaws.bedrockagentcorecontrol#SetTokenVaultCMKResponse" +_STVCMK = "SetTokenVaultCMK" +_TRI = "TagResourceInput" +_cTRR = "com.amazonaws.bedrockagentcorecontrol#TagResourceRequest" +_TRO = "TagResourceOutput" +_cTRRo = "com.amazonaws.bedrockagentcorecontrol#TagResourceResponse" +_TR = "TagResource" +_TKL = "TagKeyList" +_URIn = "UntagResourceInput" +_cURRom = "com.amazonaws.bedrockagentcorecontrol#UntagResourceRequest" +_tKa = "tagKeys" +_UROn = "UntagResourceOutput" +_cURRoma = "com.amazonaws.bedrockagentcorecontrol#UntagResourceResponse" +_URn = "UntagResource" +_RORUT = "ResourceOauth2ReturnUrlType" +_RORULT = "ResourceOauth2ReturnUrlListType" +_CWII = "CreateWorkloadIdentityInput" +_cCWIR = "com.amazonaws.bedrockagentcorecontrol#CreateWorkloadIdentityRequest" +_aRORU = "allowedResourceOauth2ReturnUrls" +_WIAT = "WorkloadIdentityArnType" +_CWIO = "CreateWorkloadIdentityOutput" +_cCWIRo = "com.amazonaws.bedrockagentcorecontrol#CreateWorkloadIdentityResponse" +_CWI = "CreateWorkloadIdentity" +_DWII = "DeleteWorkloadIdentityInput" +_cDWIR = "com.amazonaws.bedrockagentcorecontrol#DeleteWorkloadIdentityRequest" +_DWIO = "DeleteWorkloadIdentityOutput" +_cDWIRo = "com.amazonaws.bedrockagentcorecontrol#DeleteWorkloadIdentityResponse" +_DWI = "DeleteWorkloadIdentity" +_GWII = "GetWorkloadIdentityInput" +_cGWIR = "com.amazonaws.bedrockagentcorecontrol#GetWorkloadIdentityRequest" +_GWIO = "GetWorkloadIdentityOutput" +_cGWIRo = "com.amazonaws.bedrockagentcorecontrol#GetWorkloadIdentityResponse" +_GWI = "GetWorkloadIdentity" +_LWII = "ListWorkloadIdentitiesInput" +_cLWIR = "com.amazonaws.bedrockagentcorecontrol#ListWorkloadIdentitiesRequest" +_WIT = "WorkloadIdentityType" +_WIL = "WorkloadIdentityList" +_LWIO = "ListWorkloadIdentitiesOutput" +_cLWIRo = "com.amazonaws.bedrockagentcorecontrol#ListWorkloadIdentitiesResponse" +_LWI = "ListWorkloadIdentities" +_UWII = "UpdateWorkloadIdentityInput" +_cUWIR = "com.amazonaws.bedrockagentcorecontrol#UpdateWorkloadIdentityRequest" +_UWIO = "UpdateWorkloadIdentityOutput" +_cUWIRo = "com.amazonaws.bedrockagentcorecontrol#UpdateWorkloadIdentityResponse" +_UWI = "UpdateWorkloadIdentity" +_SDc = "SchemaDefinition" +_pro = "properties" +_requ = "required" +_SPc = "SchemaProperties" +_TDoo = "ToolDefinition" +_oSu = "outputSchema" +_TDool = "ToolDefinitions" +_TSo = "ToolSchema" +_MLTC = "McpLambdaTargetConfiguration" +_tSo = "toolSchema" +_MTC = "McpTargetConfiguration" +_oAS = "openApiSchema" +_sMm = "smithyModel" +_mSc = "mcpServer" +_aG = "apiGateway" +_TCa = "TargetConfiguration" +_ht = "http" +_inf = "inference" +_CGTI = "CreateGatewayTargetInput" +_cCGTR = "com.amazonaws.bedrockagentcorecontrol#CreateGatewayTargetRequest" +_tCa = "targetConfiguration" +_cCe = "certificateConfigurations" +_CGTO = "CreateGatewayTargetOutput" +_cCGTRo = "com.amazonaws.bedrockagentcorecontrol#CreateGatewayTargetResponse" +_pEMR = "privateEndpointManagedResources" +_GTa = "GatewayTarget" +_GGTO = "GetGatewayTargetOutput" +_cGGTRo = "com.amazonaws.bedrockagentcorecontrol#GetGatewayTargetResponse" +_UGTI = "UpdateGatewayTargetInput" +_cUGTR = "com.amazonaws.bedrockagentcorecontrol#UpdateGatewayTargetRequest" +_UGTO = "UpdateGatewayTargetOutput" +_cUGTRo = "com.amazonaws.bedrockagentcorecontrol#UpdateGatewayTargetResponse" +_GGT = "GetGatewayTarget" +_GTL = "GatewayTargetList" +_SGTO = "SynchronizeGatewayTargetsOutput" +_cSGTRo = "com.amazonaws.bedrockagentcorecontrol#SynchronizeGatewayTargetsResponse" +_tar = "targets" +_SGT = "SynchronizeGatewayTargets" +_CGT = "CreateGatewayTarget" +_UGT = "UpdateGatewayTarget" +_ABACC = "AmazonBedrockAgentCoreControl" +_aw = "aws.auth#sigv4" +_sB = "smithy.rules#endpointBdd" +_aws = "aws.api#service" +_aJ = "aws.protocols#restJson1" +_smithyap = "smithy.api#cors" + +INLINE_CONTENT: StaticSchema = (3, n0, _IC, 0) + +SCHEMA_VERSION: StaticSchema = (3, n0, _SV, 0) + +AGENT_CARD_DEFINITION: StaticSchema = ( + 18, + n0, + _ACD, + 0, + (_sV, _iC), + ((SCHEMA_VERSION, 0), (INLINE_CONTENT, 0)), +) + +A2A_DESCRIPTOR: StaticSchema = (18, n0, _AD, 0, (_aC,), ((AGENT_CARD_DEFINITION, 0),)) + +NON_BLANK_STRING: StaticSchema = (3, n0, _NBS, 0) + +ACCESS_DENIED_EXCEPTION: StaticSchema = ( + 18, + n0, + _ADE, + {_s: _c, _sE: 403}, + (_m,), + ((NON_BLANK_STRING, 0),), +) + +GATEWAY_CONFIGURATION_BUNDLE_ARN: StaticSchema = (3, n0, _GCBA, 0) + +STATIC_OVERRIDE: StaticSchema = ( + 18, + n0, + _SO, + 0, + (_bA, _bV), + ((GATEWAY_CONFIGURATION_BUNDLE_ARN, 1), (3, 1)), +) + +CONFIGURATION_BUNDLE_REFERENCE: StaticSchema = ( + 18, + n0, + _CBR, + 0, + (_bA, _bV), + ((GATEWAY_CONFIGURATION_BUNDLE_ARN, 1), (3, 1)), +) + +TRAFFIC_SPLIT_METADATA_KEY: StaticSchema = (3, n0, _TSMK, 0) + +TRAFFIC_SPLIT_METADATA_VALUE: StaticSchema = (3, n0, _TSMV, 0) + +TRAFFIC_SPLIT_METADATA_MAP: StaticSchema = ( + 17, + n0, + _TSMM, + 0, + (_k, _v), + ((TRAFFIC_SPLIT_METADATA_KEY, 0), (TRAFFIC_SPLIT_METADATA_VALUE, 0)), +) + +TRAFFIC_SPLIT_ENTRY: StaticSchema = ( + 18, + n0, + _TSE, + 0, + (_n, _w, _cB, _d, _me), + ( + (3, 1), + (7, 1), + (CONFIGURATION_BUNDLE_REFERENCE, 1), + (3, 0), + (TRAFFIC_SPLIT_METADATA_MAP, 0), + ), ) -from smithy_core.schemas import Schema -from smithy_core.shapes import ShapeID, ShapeType -from smithy_core.traits import Trait - -INLINE_CONTENT = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#InlineContent"), - shape_type=ShapeType.STRING, +TRAFFIC_SPLIT_ENTRIES: StaticSchema = ( + 16, + n0, + _TSEr, + 0, + (_mem,), + ((TRAFFIC_SPLIT_ENTRY, 0),), ) -SCHEMA_VERSION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SchemaVersion"), - shape_type=ShapeType.STRING, +WEIGHTED_OVERRIDE: StaticSchema = ( + 18, + n0, + _WO, + 0, + (_tS,), + ((TRAFFIC_SPLIT_ENTRIES, 1),), ) -AGENT_CARD_DEFINITION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#AgentCardDefinition"), - members={ - "schemaVersion": {"target": SCHEMA_VERSION}, - "inlineContent": {"target": INLINE_CONTENT}, - }, +CONFIGURATION_BUNDLE_ACTION: StaticSchema = ( + 19, + n0, + _CBA, + 0, + (_sO, _wO), + ((STATIC_OVERRIDE, 0), (WEIGHTED_OVERRIDE, 0)), ) -A2A_DESCRIPTOR = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#A2aDescriptor"), - members={"agentCard": {"target": AGENT_CARD_DEFINITION}}, -) +TARGET_NAME: StaticSchema = (3, n0, _TN, 4) -NON_BLANK_STRING = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#NonBlankString"), - shape_type=ShapeType.STRING, -) +STATIC_ROUTE: StaticSchema = (18, n0, _SR, 0, (_tN,), ((TARGET_NAME, 1),)) -ACCESS_DENIED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=403), - ], - members={"message": {"target": NON_BLANK_STRING}}, +TARGET_TRAFFIC_SPLIT_ENTRY: StaticSchema = ( + 18, + n0, + _TTSE, + 0, + (_n, _w, _tN, _d, _me), + ((3, 1), (7, 1), (TARGET_NAME, 1), (3, 0), (TRAFFIC_SPLIT_METADATA_MAP, 0)), ) -GATEWAY_CONFIGURATION_BUNDLE_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GatewayConfigurationBundleArn"), - shape_type=ShapeType.STRING, +TARGET_TRAFFIC_SPLIT_ENTRIES: StaticSchema = ( + 16, + n0, + _TTSEa, + 0, + (_mem,), + ((TARGET_TRAFFIC_SPLIT_ENTRY, 0),), ) -STATIC_OVERRIDE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#StaticOverride"), - members={ - "bundleArn": { - "target": GATEWAY_CONFIGURATION_BUNDLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "bundleVersion": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +WEIGHTED_ROUTE: StaticSchema = ( + 18, + n0, + _WR, + 0, + (_tS,), + ((TARGET_TRAFFIC_SPLIT_ENTRIES, 1),), ) -CONFIGURATION_BUNDLE_REFERENCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ConfigurationBundleReference"), - members={ - "bundleArn": { - "target": GATEWAY_CONFIGURATION_BUNDLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "bundleVersion": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +ROUTE_TO_TARGET_ACTION: StaticSchema = ( + 19, + n0, + _RTTA, + 0, + (_sR, _wR), + ((STATIC_ROUTE, 0), (WEIGHTED_ROUTE, 0)), ) -TRAFFIC_SPLIT_METADATA_KEY = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#TrafficSplitMetadataKey"), - shape_type=ShapeType.STRING, +ACTION: StaticSchema = ( + 19, + n0, + _A, + 0, + (_cB, _rTT), + ((CONFIGURATION_BUNDLE_ACTION, 0), (ROUTE_TO_TARGET_ACTION, 0)), ) -TRAFFIC_SPLIT_METADATA_VALUE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#TrafficSplitMetadataValue"), - shape_type=ShapeType.STRING, -) +ACTIONS: StaticSchema = (16, n0, _Ac, 0, (_mem,), ((ACTION, 0),)) -TRAFFIC_SPLIT_METADATA_MAP = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#TrafficSplitMetadataMap"), - shape_type=ShapeType.MAP, - members={ - "key": {"target": TRAFFIC_SPLIT_METADATA_KEY}, - "value": {"target": TRAFFIC_SPLIT_METADATA_VALUE}, - }, +ACTOR_TOKEN_CONTENT_TYPE: StaticSchema = ( + 14, + n0, + _ATCT, + 0, + (_NONE, _MM, _AIITJ), + ((-1, {_sVm: _NONE}), (-1, {_sVm: _MM}), (-1, {_sVm: _AIITJ})), ) -TRAFFIC_SPLIT_ENTRY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#TrafficSplitEntry"), - members={ - "name": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "weight": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "configurationBundle": { - "target": CONFIGURATION_BUNDLE_REFERENCE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": _STRING}, - "metadata": {"target": TRAFFIC_SPLIT_METADATA_MAP}, - }, -) +CLIENT_TOKEN: StaticSchema = (3, n0, _CT, 0) -TRAFFIC_SPLIT_ENTRIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#TrafficSplitEntries"), - shape_type=ShapeType.LIST, - members={"member": {"target": TRAFFIC_SPLIT_ENTRY}}, -) +DATASET_ID: StaticSchema = (3, n0, _DI, 0) -WEIGHTED_OVERRIDE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#WeightedOverride"), - members={ - "trafficSplit": { - "target": TRAFFIC_SPLIT_ENTRIES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +SENSITIVE_JSON: StaticSchema = (13, n0, _SJ, 4) -CONFIGURATION_BUNDLE_ACTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ConfigurationBundleAction"), - shape_type=ShapeType.UNION, - members={ - "staticOverride": {"target": STATIC_OVERRIDE}, - "weightedOverride": {"target": WEIGHTED_OVERRIDE}, - }, -) +DATASET_EXAMPLE_LIST: StaticSchema = (16, n0, _DEL, 0, (_mem,), ((SENSITIVE_JSON, 0),)) -TARGET_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#TargetName"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +INLINE_EXAMPLES_SOURCE: StaticSchema = ( + 18, + n0, + _IES, + 0, + (_e,), + ((DATASET_EXAMPLE_LIST, 1),), ) -STATIC_ROUTE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#StaticRoute"), - members={ - "targetName": { - "target": TARGET_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +S3_URI: StaticSchema = (3, n0, _SU, 0) -TARGET_TRAFFIC_SPLIT_ENTRY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#TargetTrafficSplitEntry"), - members={ - "name": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "weight": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "targetName": { - "target": TARGET_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": _STRING}, - "metadata": {"target": TRAFFIC_SPLIT_METADATA_MAP}, - }, +S3_SOURCE: StaticSchema = (18, n0, _SS, 0, (_sU,), ((S3_URI, 1),)) + +DATA_SOURCE_TYPE: StaticSchema = ( + 19, + n0, + _DST, + 0, + (_iE, _sS), + ((INLINE_EXAMPLES_SOURCE, 0), (S3_SOURCE, 0)), ) -TARGET_TRAFFIC_SPLIT_ENTRIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#TargetTrafficSplitEntries"), - shape_type=ShapeType.LIST, - members={"member": {"target": TARGET_TRAFFIC_SPLIT_ENTRY}}, +ADD_DATASET_EXAMPLES_INPUT: StaticSchema = ( + 18, + n0, + _ADEI, + {_sSI: _cADER, _smit: None}, + (_dI, _cT, _so), + ((DATASET_ID, 9), (CLIENT_TOKEN, 2), (DATA_SOURCE_TYPE, 1)), ) -WEIGHTED_ROUTE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#WeightedRoute"), - members={ - "trafficSplit": { - "target": TARGET_TRAFFIC_SPLIT_ENTRIES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +DATASET_ARN: StaticSchema = (3, n0, _DA, 0) + +EXAMPLE_ID: StaticSchema = (3, n0, _EI, 0) + +EXAMPLE_ID_LIST: StaticSchema = (16, n0, _EIL, 0, (_mem,), ((EXAMPLE_ID, 0),)) + +DATASET_STATUS: StaticSchema = ( + 14, + n0, + _DS, + 0, + (_CREATING, _UPDATING, _DELETING, _ACTIVE, _CF, _UF, _DF), + ( + (-1, {_sVm: _CREATING}), + (-1, {_sVm: _UPDATING}), + (-1, {_sVm: _DELETING}), + (-1, {_sVm: _ACTIVE}), + (-1, {_sVm: _CF}), + (-1, {_sVm: _UF}), + (-1, {_sVm: _DF}), + ), ) -ROUTE_TO_TARGET_ACTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#RouteToTargetAction"), - shape_type=ShapeType.UNION, - members={ - "staticRoute": {"target": STATIC_ROUTE}, - "weightedRoute": {"target": WEIGHTED_ROUTE}, - }, +ADD_DATASET_EXAMPLES_OUTPUT: StaticSchema = ( + 18, + n0, + _ADEO, + {_sSI: _cADERo, _smith: None}, + (_dA, _dI, _st, _aCd, _uA, _eI), + ( + (DATASET_ARN, 1), + (DATASET_ID, 1), + (DATASET_STATUS, 1), + (8, 1), + (4, 1), + (EXAMPLE_ID_LIST, 1), + ), ) -ACTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#Action"), - shape_type=ShapeType.UNION, - members={ - "configurationBundle": {"target": CONFIGURATION_BUNDLE_ACTION}, - "routeToTarget": {"target": ROUTE_TO_TARGET_ACTION}, - }, +CONFLICT_EXCEPTION: StaticSchema = ( + 18, + n0, + _CE, + {_s: _c, _sE: 409}, + (_m,), + ((NON_BLANK_STRING, 0),), +) + +INTERNAL_SERVER_EXCEPTION: StaticSchema = ( + 18, + n0, + _ISE, + {_s: _se, _sE: 500}, + (_m,), + ((NON_BLANK_STRING, 0),), +) + +RESOURCE_NOT_FOUND_EXCEPTION: StaticSchema = ( + 18, + n0, + _RNFE, + {_s: _c, _sE: 404}, + (_m,), + ((NON_BLANK_STRING, 0),), +) + +SERVICE_QUOTA_EXCEEDED_EXCEPTION: StaticSchema = ( + 18, + n0, + _SQEE, + {_s: _c, _sE: 402}, + (_m,), + ((NON_BLANK_STRING, 0),), +) + +THROTTLING_EXCEPTION: StaticSchema = ( + 18, + n0, + _TE, + {_s: _c, _sE: 429}, + (_m,), + ((NON_BLANK_STRING, 0),), +) + +VALIDATION_EXCEPTION_FIELD: StaticSchema = (18, n0, _VEF, 0, (_n, _m), ((3, 1), (3, 1))) + +VALIDATION_EXCEPTION_FIELD_LIST: StaticSchema = ( + 16, + n0, + _VEFL, + 0, + (_mem,), + ((VALIDATION_EXCEPTION_FIELD, 0),), +) + +VALIDATION_EXCEPTION_REASON: StaticSchema = ( + 14, + n0, + _VER, + 0, + (_CP, _FVF, _IPME, _REIOS, _RC), + ( + (-1, {_sVm: _CPa}), + (-1, {_sVm: _FVFi}), + (-1, {_sVm: _IPMEd}), + (-1, {_sVm: _EIOS}), + (-1, {_sVm: _RCe}), + ), ) -ACTIONS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#Actions"), - shape_type=ShapeType.LIST, - members={"member": {"target": ACTION}}, +VALIDATION_EXCEPTION: StaticSchema = ( + 18, + n0, + _VE, + {_s: _c, _sE: 400}, + (_m, _r, _fL), + ((3, 1), (VALIDATION_EXCEPTION_REASON, 1), (VALIDATION_EXCEPTION_FIELD_LIST, 0)), +) + +ADD_DATASET_EXAMPLES: StaticOperationSchema = ( + 23, + n0, + _ADEd, + { + _smithy: MappingProxyType( + {"method": "POST", "uri": "/datasets/{datasetId}/examples/add", "code": 202} + ) + }, + ADD_DATASET_EXAMPLES_INPUT, + ADD_DATASET_EXAMPLES_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -ACTOR_TOKEN_CONTENT_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ActorTokenContentType"), - shape_type=ShapeType.ENUM, - members={ - "NONE": {"target": UNIT}, - "M2M": {"target": UNIT}, - "AWS_IAM_ID_TOKEN_JWT": {"target": UNIT}, - }, +ADDITIONAL_CLAIM_NAME: StaticSchema = (3, n0, _ACN, 0) + +ADDITIONAL_CLAIM_VALUE: StaticSchema = (3, n0, _ACV, 4) + +ADDITIONAL_CLAIMS: StaticSchema = ( + 17, + n0, + _AC, + 0, + (_k, _v), + ((ADDITIONAL_CLAIM_NAME, 0), (ADDITIONAL_CLAIM_VALUE, 0)), ) -CLIENT_TOKEN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ClientToken"), - shape_type=ShapeType.STRING, +ADDITIONAL_MODEL_REQUEST_FIELDS: StaticSchema = (13, n0, _AMRF, 0) + +ALLOWED_SCOPE_TYPE: StaticSchema = (3, n0, _AST, 0) + +ADVERTISED_SCOPE_MAPPING_TYPE: StaticSchema = ( + 17, + n0, + _ASMT, + 0, + (_k, _v), + ((ALLOWED_SCOPE_TYPE, 0), (ALLOWED_SCOPE_TYPE, 0)), ) -DATASET_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DatasetId"), - shape_type=ShapeType.STRING, +AGENT_ENDPOINT_DESCRIPTION: StaticSchema = (3, n0, _AED, 0) + +AGENT_RUNTIME_ID: StaticSchema = (3, n0, _ARI, 0) + +AGENT_RUNTIME_VERSION: StaticSchema = (3, n0, _ARV, 0) + +ENDPOINT_NAME: StaticSchema = (3, n0, _EN, 4) + +TAG_KEY: StaticSchema = (3, n0, _TK, 0) + +TAG_VALUE: StaticSchema = (3, n0, _TV, 0) + +TAGS_MAP: StaticSchema = (17, n0, _TM, 0, (_k, _v), ((TAG_KEY, 0), (TAG_VALUE, 0))) + +CREATE_AGENT_RUNTIME_ENDPOINT_INPUT: StaticSchema = ( + 18, + n0, + _CAREI, + {_sSI: _cCARER, _smit: None}, + (_aRI, _n, _aRV, _d, _cT, _t), + ( + (AGENT_RUNTIME_ID, 9), + (ENDPOINT_NAME, 1), + (AGENT_RUNTIME_VERSION, 0), + (AGENT_ENDPOINT_DESCRIPTION, 0), + (CLIENT_TOKEN, 2), + (TAGS_MAP, 0), + ), ) -SENSITIVE_JSON = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SensitiveJson"), - shape_type=ShapeType.DOCUMENT, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +AGENT_RUNTIME_ARN: StaticSchema = (3, n0, _ARA, 0) + +AGENT_RUNTIME_ENDPOINT_ARN: StaticSchema = (3, n0, _AREA, 0) + +DATE_TIMESTAMP: StaticSchema = (4, n0, _DT, {_sF: _dt}) + +AGENT_RUNTIME_ENDPOINT_STATUS: StaticSchema = ( + 14, + n0, + _ARES, + 0, + (_CREATING, _CF, _UPDATING, _UF, _READY, _DELETING, _DF), + ( + (-1, {_sVm: _CREATING}), + (-1, {_sVm: _CF}), + (-1, {_sVm: _UPDATING}), + (-1, {_sVm: _UF}), + (-1, {_sVm: _READY}), + (-1, {_sVm: _DELETING}), + (-1, {_sVm: _DF}), + ), ) -DATASET_EXAMPLE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DatasetExampleList"), - shape_type=ShapeType.LIST, - members={"member": {"target": SENSITIVE_JSON}}, +CREATE_AGENT_RUNTIME_ENDPOINT_OUTPUT: StaticSchema = ( + 18, + n0, + _CAREO, + {_sSI: _cCARERo, _smith: None}, + (_tV, _aREA, _aRA, _aRI, _eN, _st, _cA), + ( + (AGENT_RUNTIME_VERSION, 1), + (AGENT_RUNTIME_ENDPOINT_ARN, 1), + (AGENT_RUNTIME_ARN, 1), + (AGENT_RUNTIME_ID, 0), + (ENDPOINT_NAME, 0), + (AGENT_RUNTIME_ENDPOINT_STATUS, 1), + (DATE_TIMESTAMP, 1), + ), ) -INLINE_EXAMPLES_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#InlineExamplesSource"), - members={ - "examples": { - "target": DATASET_EXAMPLE_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +CREATE_AGENT_RUNTIME_ENDPOINT: StaticOperationSchema = ( + 23, + n0, + _CARE, + { + _smithy: MappingProxyType( + { + "code": 202, + "method": "PUT", + "uri": "/runtimes/{agentRuntimeId}/runtime-endpoints/", + } + ) + }, + CREATE_AGENT_RUNTIME_ENDPOINT_INPUT, + CREATE_AGENT_RUNTIME_ENDPOINT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -S3_URI = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#S3Uri"), - shape_type=ShapeType.STRING, +DELETE_AGENT_RUNTIME_ENDPOINT_INPUT: StaticSchema = ( + 18, + n0, + _DAREI, + {_sSI: _cDARER, _smit: None}, + (_aRI, _eN, _cT), + ((AGENT_RUNTIME_ID, 9), (ENDPOINT_NAME, 9), (CLIENT_TOKEN, {_sQ: _cT, _sT: None})), +) + +DELETE_AGENT_RUNTIME_ENDPOINT_OUTPUT: StaticSchema = ( + 18, + n0, + _DAREO, + {_sSI: _cDARERo, _smith: None}, + (_st, _aRI, _eN), + ((AGENT_RUNTIME_ENDPOINT_STATUS, 1), (AGENT_RUNTIME_ID, 0), (ENDPOINT_NAME, 0)), +) + +DELETE_AGENT_RUNTIME_ENDPOINT: StaticOperationSchema = ( + 23, + n0, + _DARE, + { + _smithy: MappingProxyType( + { + "code": 202, + "method": "DELETE", + "uri": "/runtimes/{agentRuntimeId}/runtime-endpoints/{endpointName}/", + } + ) + }, + DELETE_AGENT_RUNTIME_ENDPOINT_INPUT, + DELETE_AGENT_RUNTIME_ENDPOINT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + ), ) -S3_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#S3Source"), - members={ - "s3Uri": { - "target": S3_URI, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +GET_AGENT_RUNTIME_ENDPOINT_INPUT: StaticSchema = ( + 18, + n0, + _GAREI, + {_sSI: _cGARER, _smit: None}, + (_aRI, _eN), + ((AGENT_RUNTIME_ID, 9), (ENDPOINT_NAME, 9)), +) + +AGENT_RUNTIME_ENDPOINT_ID: StaticSchema = (3, n0, _AREI, 0) + +GET_AGENT_RUNTIME_ENDPOINT_OUTPUT: StaticSchema = ( + 18, + n0, + _GAREO, + {_sSI: _cGARERo, _smith: None}, + (_lV, _tV, _aREA, _aRA, _d, _st, _cA, _lUA, _fR, _n, _i), + ( + (AGENT_RUNTIME_VERSION, 0), + (AGENT_RUNTIME_VERSION, 0), + (AGENT_RUNTIME_ENDPOINT_ARN, 1), + (AGENT_RUNTIME_ARN, 1), + (AGENT_ENDPOINT_DESCRIPTION, 0), + (AGENT_RUNTIME_ENDPOINT_STATUS, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (3, 0), + (ENDPOINT_NAME, 1), + (AGENT_RUNTIME_ENDPOINT_ID, 1), + ), ) -DATA_SOURCE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DataSourceType"), - shape_type=ShapeType.UNION, - members={ - "inlineExamples": {"target": INLINE_EXAMPLES_SOURCE}, - "s3Source": {"target": S3_SOURCE}, - }, +GET_AGENT_RUNTIME_ENDPOINT: StaticOperationSchema = ( + 23, + n0, + _GARE, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "GET", + "uri": "/runtimes/{agentRuntimeId}/runtime-endpoints/{endpointName}/", + } + ) + }, + GET_AGENT_RUNTIME_ENDPOINT_INPUT, + GET_AGENT_RUNTIME_ENDPOINT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -ADD_DATASET_EXAMPLES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#AddDatasetExamplesInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#AddDatasetExamplesRequest", - ) - ], - members={ - "datasetId": { - "target": DATASET_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "source": { - "target": DATA_SOURCE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +MAX_RESULTS: StaticSchema = (7, n0, _MR, 0) + +NEXT_TOKEN: StaticSchema = (3, n0, _NT, 0) + +LIST_AGENT_RUNTIME_ENDPOINTS_INPUT: StaticSchema = ( + 18, + n0, + _LAREI, + {_sSI: _cLARER, _smit: None}, + (_aRI, _mR, _nT), + ((AGENT_RUNTIME_ID, 9), (MAX_RESULTS, {_sQ: _mR}), (NEXT_TOKEN, {_sQ: _nT})), +) + +AGENT_RUNTIME_ENDPOINT: StaticSchema = ( + 18, + n0, + _ARE, + 0, + (_n, _lV, _tV, _aREA, _aRA, _st, _i, _d, _cA, _lUA), + ( + (ENDPOINT_NAME, 1), + (AGENT_RUNTIME_VERSION, 0), + (AGENT_RUNTIME_VERSION, 0), + (AGENT_RUNTIME_ENDPOINT_ARN, 1), + (AGENT_RUNTIME_ARN, 1), + (AGENT_RUNTIME_ENDPOINT_STATUS, 1), + (AGENT_RUNTIME_ENDPOINT_ID, 1), + (AGENT_ENDPOINT_DESCRIPTION, 0), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + ), ) -DATASET_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DatasetArn"), - shape_type=ShapeType.STRING, +AGENT_RUNTIME_ENDPOINTS: StaticSchema = ( + 16, + n0, + _AREg, + 0, + (_mem,), + ((AGENT_RUNTIME_ENDPOINT, 0),), +) + +LIST_AGENT_RUNTIME_ENDPOINTS_OUTPUT: StaticSchema = ( + 18, + n0, + _LAREO, + {_sSI: _cLARERo, _smith: None}, + (_rE, _nT), + ((AGENT_RUNTIME_ENDPOINTS, 1), (NEXT_TOKEN, 0)), +) + +LIST_AGENT_RUNTIME_ENDPOINTS: StaticOperationSchema = ( + 23, + n0, + _LARE, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "POST", + "uri": "/runtimes/{agentRuntimeId}/runtime-endpoints/", + } + ) + }, + LIST_AGENT_RUNTIME_ENDPOINTS_INPUT, + LIST_AGENT_RUNTIME_ENDPOINTS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -EXAMPLE_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ExampleId"), - shape_type=ShapeType.STRING, +UPDATE_AGENT_RUNTIME_ENDPOINT_INPUT: StaticSchema = ( + 18, + n0, + _UAREI, + {_sSI: _cUARER, _smit: None}, + (_aRI, _eN, _aRV, _d, _cT), + ( + (AGENT_RUNTIME_ID, 9), + (ENDPOINT_NAME, 9), + (AGENT_RUNTIME_VERSION, 0), + (AGENT_ENDPOINT_DESCRIPTION, 0), + (CLIENT_TOKEN, 2), + ), ) -EXAMPLE_ID_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ExampleIdList"), - shape_type=ShapeType.LIST, - members={"member": {"target": EXAMPLE_ID}}, +UPDATE_AGENT_RUNTIME_ENDPOINT_OUTPUT: StaticSchema = ( + 18, + n0, + _UAREO, + {_sSI: _cUARERo, _smith: None}, + (_lV, _tV, _aREA, _aRA, _st, _cA, _lUA), + ( + (AGENT_RUNTIME_VERSION, 0), + (AGENT_RUNTIME_VERSION, 0), + (AGENT_RUNTIME_ENDPOINT_ARN, 1), + (AGENT_RUNTIME_ARN, 1), + (AGENT_RUNTIME_ENDPOINT_STATUS, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + ), ) -DATASET_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DatasetStatus"), - shape_type=ShapeType.ENUM, - members={ - "CREATING": {"target": UNIT}, - "UPDATING": {"target": UNIT}, - "DELETING": {"target": UNIT}, - "ACTIVE": {"target": UNIT}, - "CREATE_FAILED": {"target": UNIT}, - "UPDATE_FAILED": {"target": UNIT}, - "DELETE_FAILED": {"target": UNIT}, - }, +UPDATE_AGENT_RUNTIME_ENDPOINT: StaticOperationSchema = ( + 23, + n0, + _UARE, + { + _smithy: MappingProxyType( + { + "code": 202, + "method": "PUT", + "uri": "/runtimes/{agentRuntimeId}/runtime-endpoints/{endpointName}/", + } + ) + }, + UPDATE_AGENT_RUNTIME_ENDPOINT_INPUT, + UPDATE_AGENT_RUNTIME_ENDPOINT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -ADD_DATASET_EXAMPLES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#AddDatasetExamplesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#AddDatasetExamplesResponse", - ) - ], - members={ - "datasetArn": { - "target": DATASET_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "datasetId": { - "target": DATASET_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": DATASET_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "addedCount": { - "target": LONG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "exampleIds": { - "target": EXAMPLE_ID_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +AGENT_MANAGED_RUNTIME_TYPE: StaticSchema = ( + 14, + n0, + _AMRT, + 0, + (_P, _P_, _P__, _P___, _P____, _N), + ( + (-1, {_sVm: _P}), + (-1, {_sVm: _P_}), + (-1, {_sVm: _P__}), + (-1, {_sVm: _P___}), + (-1, {_sVm: _P____}), + (-1, {_sVm: _N}), + ), ) -CONFLICT_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=409), - ], - members={"message": {"target": NON_BLANK_STRING}}, -) - -INTERNAL_SERVER_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="server"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=500), - ], - members={"message": {"target": NON_BLANK_STRING}}, -) - -RESOURCE_NOT_FOUND_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=404), - ], - members={"message": {"target": NON_BLANK_STRING}}, -) - -SERVICE_QUOTA_EXCEEDED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=402), - ], - members={"message": {"target": NON_BLANK_STRING}}, -) - -THROTTLING_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=429), - ], - members={"message": {"target": NON_BLANK_STRING}}, -) - -VALIDATION_EXCEPTION_FIELD = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationExceptionField"), - members={ - "name": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "message": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +S3_LOCATION: StaticSchema = (18, n0, _SL, 0, (_b, _p, _vI), ((3, 1), (3, 1), (3, 0))) + +CODE: StaticSchema = (19, n0, _C, 0, (_s_,), ((S3_LOCATION, 0),)) + +ENTRY_POINT: StaticSchema = (3, n0, _eP, 0) + +ENTRY_POINTS: StaticSchema = (16, n0, _EP, 0, (_mem,), ((ENTRY_POINT, 0),)) + +CODE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _CC, + 0, + (_co, _ru, _eP), + ((CODE, 1), (AGENT_MANAGED_RUNTIME_TYPE, 1), (ENTRY_POINTS, 1)), ) -VALIDATION_EXCEPTION_FIELD_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationExceptionFieldList"), - shape_type=ShapeType.LIST, - members={"member": {"target": VALIDATION_EXCEPTION_FIELD}}, +RUNTIME_CONTAINER_URI: StaticSchema = (3, n0, _RCU, 0) + +CONTAINER_CONFIGURATION: StaticSchema = ( + 18, + n0, + _CCo, + 0, + (_cU,), + ((RUNTIME_CONTAINER_URI, 1),), ) -VALIDATION_EXCEPTION_REASON = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationExceptionReason"), - shape_type=ShapeType.ENUM, - members={ - "CANNOT_PARSE": {"target": UNIT}, - "FIELD_VALIDATION_FAILED": {"target": UNIT}, - "IDEMPOTENT_PARAMETER_MISMATCH_EXCEPTION": {"target": UNIT}, - "ROOT_EVENT_IN_OTHER_SESSION": {"target": UNIT}, - "RESOURCE_CONFLICT": {"target": UNIT}, - }, +AGENT_RUNTIME_ARTIFACT: StaticSchema = ( + 19, + n0, + _ARAg, + 0, + (_cC, _cCo), + ((CONTAINER_CONFIGURATION, 0), (CODE_CONFIGURATION, 0)), ) -VALIDATION_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={ - "message": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "reason": { - "target": VALIDATION_EXCEPTION_REASON, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "fieldList": {"target": VALIDATION_EXCEPTION_FIELD_LIST}, - }, +AGENT_RUNTIME_NAME: StaticSchema = (3, n0, _ARN, 0) + +ALLOWED_AUDIENCE: StaticSchema = (3, n0, _AA, 0) + +ALLOWED_AUDIENCE_LIST: StaticSchema = ( + 16, + n0, + _AAL, + 0, + (_mem,), + ((ALLOWED_AUDIENCE, 0),), ) -ADD_DATASET_EXAMPLES = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#AddDatasetExamples"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/datasets/{datasetId}/examples/add", - "code": 202, - } - ), - ) - ], +ALLOWED_CLIENT: StaticSchema = (3, n0, _ACl, 0) + +ALLOWED_CLIENTS_LIST: StaticSchema = (16, n0, _ACL, 0, (_mem,), ((ALLOWED_CLIENT, 0),)) + +ALLOWED_SCOPES_TYPE: StaticSchema = ( + 16, + n0, + _ASTl, + 0, + (_mem,), + ((ALLOWED_SCOPE_TYPE, 0),), ) -ADDITIONAL_CLAIM_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#AdditionalClaimName"), - shape_type=ShapeType.STRING, +BEDROCK_AGENTCORE_RESOURCE_ARN: StaticSchema = (3, n0, _BARA, 0) + +HOSTING_ENVIRONMENT: StaticSchema = ( + 18, + n0, + _HE, + 0, + (_a,), + ((BEDROCK_AGENTCORE_RESOURCE_ARN, 1),), ) -ADDITIONAL_CLAIM_VALUE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#AdditionalClaimValue"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +HOSTING_ENVIRONMENT_LIST_TYPE: StaticSchema = ( + 16, + n0, + _HELT, + 0, + (_mem,), + ((HOSTING_ENVIRONMENT, 0),), ) -ADDITIONAL_CLAIMS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#AdditionalClaims"), - shape_type=ShapeType.MAP, - members={ - "key": {"target": ADDITIONAL_CLAIM_NAME}, - "value": {"target": ADDITIONAL_CLAIM_VALUE}, - }, +WORKLOAD_IDENTITY_NAME_TYPE: StaticSchema = (3, n0, _WINT, 0) + +WORKLOAD_IDENTITY_NAME_LIST_TYPE: StaticSchema = ( + 16, + n0, + _WINLT, + 0, + (_mem,), + ((WORKLOAD_IDENTITY_NAME_TYPE, 0),), ) -ADDITIONAL_MODEL_REQUEST_FIELDS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#AdditionalModelRequestFields"), - shape_type=ShapeType.DOCUMENT, +ALLOWED_WORKLOAD_CONFIGURATION: StaticSchema = ( + 18, + n0, + _AWC, + 0, + (_hE, _wI), + ((HOSTING_ENVIRONMENT_LIST_TYPE, 0), (WORKLOAD_IDENTITY_NAME_LIST_TYPE, 0)), ) -ALLOWED_SCOPE_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#AllowedScopeType"), - shape_type=ShapeType.STRING, +CLAIM_MATCH_OPERATOR_TYPE: StaticSchema = ( + 14, + n0, + _CMOT, + 0, + (_EQUALS, _CONTAINS, _CA), + ((-1, {_sVm: _EQUALS}), (-1, {_sVm: _CONTAINS}), (-1, {_sVm: _CA})), +) + +MATCH_VALUE_STRING: StaticSchema = (3, n0, _MVS, 0) + +MATCH_VALUE_STRING_LIST: StaticSchema = ( + 16, + n0, + _MVSL, + 0, + (_mem,), + ((MATCH_VALUE_STRING, 0),), +) + +CLAIM_MATCH_VALUE_TYPE: StaticSchema = ( + 19, + n0, + _CMVT, + 0, + (_mVS, _mVSL), + ((MATCH_VALUE_STRING, 0), (MATCH_VALUE_STRING_LIST, 0)), +) + +AUTHORIZING_CLAIM_MATCH_VALUE_TYPE: StaticSchema = ( + 18, + n0, + _ACMVT, + 0, + (_cMV, _cMO), + ((CLAIM_MATCH_VALUE_TYPE, 1), (CLAIM_MATCH_OPERATOR_TYPE, 1)), +) + +INBOUND_TOKEN_CLAIM_NAME_TYPE: StaticSchema = (3, n0, _ITCNT, 0) + +INBOUND_TOKEN_CLAIM_VALUE_TYPE: StaticSchema = ( + 14, + n0, + _ITCVT, + 0, + (_STRING, _SA), + ((-1, {_sVm: _STRING}), (-1, {_sVm: _SA})), +) + +CUSTOM_CLAIM_VALIDATION_TYPE: StaticSchema = ( + 18, + n0, + _CCVT, + 0, + (_iTCN, _iTCVT, _aCMV), + ( + (INBOUND_TOKEN_CLAIM_NAME_TYPE, 1), + (INBOUND_TOKEN_CLAIM_VALUE_TYPE, 1), + (AUTHORIZING_CLAIM_MATCH_VALUE_TYPE, 1), + ), ) -ADVERTISED_SCOPE_MAPPING_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#AdvertisedScopeMappingType"), - shape_type=ShapeType.MAP, - members={ - "key": {"target": ALLOWED_SCOPE_TYPE}, - "value": {"target": ALLOWED_SCOPE_TYPE}, - }, +CUSTOM_CLAIM_VALIDATIONS_TYPE: StaticSchema = ( + 16, + n0, + _CCVTu, + 0, + (_mem,), + ((CUSTOM_CLAIM_VALIDATION_TYPE, 0),), ) -AGENT_ENDPOINT_DESCRIPTION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#AgentEndpointDescription"), - shape_type=ShapeType.STRING, +DISCOVERY_URL: StaticSchema = (3, n0, _DU, 0) + +ENDPOINT_IP_ADDRESS_TYPE: StaticSchema = ( + 14, + n0, + _EIAT, + 0, + (_IPV, _IPV_), + ((-1, {_sVm: _IPV}), (-1, {_sVm: _IPV_})), ) -AGENT_RUNTIME_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#AgentRuntimeId"), - shape_type=ShapeType.STRING, +ROUTING_DOMAIN: StaticSchema = (3, n0, _RD, 0) + +SECURITY_GROUP_IDENTIFIER: StaticSchema = (3, n0, _SGI, 0) + +SECURITY_GROUP_IDS: StaticSchema = ( + 16, + n0, + _SGIe, + 0, + (_mem,), + ((SECURITY_GROUP_IDENTIFIER, 0),), ) -AGENT_RUNTIME_VERSION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#AgentRuntimeVersion"), - shape_type=ShapeType.STRING, +SUBNET_ID: StaticSchema = (3, n0, _SI, 0) + +SUBNET_IDS: StaticSchema = (16, n0, _SIu, 0, (_mem,), ((SUBNET_ID, 0),)) + +VPC_IDENTIFIER: StaticSchema = (3, n0, _VI, 0) + +MANAGED_VPC_RESOURCE: StaticSchema = ( + 18, + n0, + _MVR, + 0, + (_vIp, _sI, _eIAT, _sGI, _t, _rD), + ( + (VPC_IDENTIFIER, 1), + (SUBNET_IDS, 1), + (ENDPOINT_IP_ADDRESS_TYPE, 1), + (SECURITY_GROUP_IDS, 0), + (TAGS_MAP, 0), + (ROUTING_DOMAIN, 0), + ), ) -ENDPOINT_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#EndpointName"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +RESOURCE_CONFIGURATION_IDENTIFIER: StaticSchema = (3, n0, _RCI, 0) + +SELF_MANAGED_LATTICE_RESOURCE: StaticSchema = ( + 19, + n0, + _SMLR, + 0, + (_rCI,), + ((RESOURCE_CONFIGURATION_IDENTIFIER, 0),), +) + +PRIVATE_ENDPOINT: StaticSchema = ( + 19, + n0, + _PE, + 0, + (_sMLR, _mVR), + ((SELF_MANAGED_LATTICE_RESOURCE, 0), (MANAGED_VPC_RESOURCE, 0)), +) + +PRIVATE_ENDPOINT_OVERRIDE_DOMAIN: StaticSchema = (3, n0, _PEOD, 0) + +PRIVATE_ENDPOINT_OVERRIDE: StaticSchema = ( + 18, + n0, + _PEO, + 0, + (_do, _pE), + ((PRIVATE_ENDPOINT_OVERRIDE_DOMAIN, 1), (PRIVATE_ENDPOINT, 1)), +) + +PRIVATE_ENDPOINT_OVERRIDES: StaticSchema = ( + 16, + n0, + _PEOr, + 0, + (_mem,), + ((PRIVATE_ENDPOINT_OVERRIDE, 0),), +) + +CUSTOM_JWT_AUTHORIZER_CONFIGURATION: StaticSchema = ( + 18, + n0, + _CJWTAC, + 0, + (_dU, _aA, _aCl, _aS, _aSM, _cCu, _pE, _pEO, _aWC), + ( + (DISCOVERY_URL, 1), + (ALLOWED_AUDIENCE_LIST, 0), + (ALLOWED_CLIENTS_LIST, 0), + (ALLOWED_SCOPES_TYPE, 0), + (ADVERTISED_SCOPE_MAPPING_TYPE, 0), + (CUSTOM_CLAIM_VALIDATIONS_TYPE, 0), + (PRIVATE_ENDPOINT, 0), + (PRIVATE_ENDPOINT_OVERRIDES, 0), + (ALLOWED_WORKLOAD_CONFIGURATION, 0), + ), ) -TAG_KEY = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#TagKey"), - shape_type=ShapeType.STRING, +AUTHORIZER_CONFIGURATION: StaticSchema = ( + 19, + n0, + _ACu, + 0, + (_cJWTA,), + ((CUSTOM_JWT_AUTHORIZER_CONFIGURATION, 0),), ) -TAG_VALUE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#TagValue"), - shape_type=ShapeType.STRING, +CAPACITY_PROVIDER_ARN: StaticSchema = (3, n0, _CPA, 0) + +CAPACITY_PROVIDER_CONFIGURATION: StaticSchema = ( + 18, + n0, + _CPC, + 0, + (_cPA,), + ((CAPACITY_PROVIDER_ARN, 1),), ) -TAGS_MAP = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#TagsMap"), - shape_type=ShapeType.MAP, - members={"key": {"target": TAG_KEY}, "value": {"target": TAG_VALUE}}, +DESCRIPTION: StaticSchema = (3, n0, _D, 4) + +ENVIRONMENT_VARIABLE_KEY: StaticSchema = (3, n0, _EVK, 0) + +ENVIRONMENT_VARIABLE_VALUE: StaticSchema = (3, n0, _EVV, 0) + +ENVIRONMENT_VARIABLES_MAP: StaticSchema = ( + 17, + n0, + _EVM, + 4, + (_k, _v), + ((ENVIRONMENT_VARIABLE_KEY, 0), (ENVIRONMENT_VARIABLE_VALUE, 0)), ) -CREATE_AGENT_RUNTIME_ENDPOINT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateAgentRuntimeEndpointInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreateAgentRuntimeEndpointRequest", - ) - ], - members={ - "agentRuntimeId": { - "target": AGENT_RUNTIME_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "name": { - "target": ENDPOINT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentRuntimeVersion": {"target": AGENT_RUNTIME_VERSION}, - "description": {"target": AGENT_ENDPOINT_DESCRIPTION}, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "tags": {"target": TAGS_MAP}, - }, +MOUNT_PATH: StaticSchema = (3, n0, _MP, 0) + +CAPACITY_PROVIDER_VOLUME_NAME: StaticSchema = (3, n0, _CPVN, 0) + +CAPACITY_PROVIDER_VOLUME_CONFIGURATION: StaticSchema = ( + 18, + n0, + _CPVC, + 0, + (_vN, _mP), + ((CAPACITY_PROVIDER_VOLUME_NAME, 1), (MOUNT_PATH, 1)), ) -AGENT_RUNTIME_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#AgentRuntimeArn"), - shape_type=ShapeType.STRING, +EFS_ACCESS_POINT_ARN: StaticSchema = (3, n0, _EAPA, 0) + +EFS_ACCESS_POINT_CONFIGURATION: StaticSchema = ( + 18, + n0, + _EAPC, + 0, + (_aPA, _mP), + ((EFS_ACCESS_POINT_ARN, 1), (MOUNT_PATH, 1)), ) -AGENT_RUNTIME_ENDPOINT_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#AgentRuntimeEndpointArn"), - shape_type=ShapeType.STRING, +S3_FILES_ACCESS_POINT_ARN: StaticSchema = (3, n0, _SFAPA, 0) + +S3_FILES_ACCESS_POINT_CONFIGURATION: StaticSchema = ( + 18, + n0, + _SFAPC, + 0, + (_aPA, _mP), + ((S3_FILES_ACCESS_POINT_ARN, 1), (MOUNT_PATH, 1)), ) -DATE_TIMESTAMP = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DateTimestamp"), - shape_type=ShapeType.TIMESTAMP, - traits=[Trait.new(id=ShapeID("smithy.api#timestampFormat"), value="date-time")], +SESSION_STORAGE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _SSC, + 0, + (_mP,), + ((MOUNT_PATH, 1),), ) -AGENT_RUNTIME_ENDPOINT_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#AgentRuntimeEndpointStatus"), - shape_type=ShapeType.ENUM, - members={ - "CREATING": {"target": UNIT}, - "CREATE_FAILED": {"target": UNIT}, - "UPDATING": {"target": UNIT}, - "UPDATE_FAILED": {"target": UNIT}, - "READY": {"target": UNIT}, - "DELETING": {"target": UNIT}, - "DELETE_FAILED": {"target": UNIT}, - }, +FILESYSTEM_CONFIGURATION: StaticSchema = ( + 19, + n0, + _FC, + 0, + (_sSe, _sFAP, _eAP, _cPV), + ( + (SESSION_STORAGE_CONFIGURATION, 0), + (S3_FILES_ACCESS_POINT_CONFIGURATION, 0), + (EFS_ACCESS_POINT_CONFIGURATION, 0), + (CAPACITY_PROVIDER_VOLUME_CONFIGURATION, 0), + ), ) -CREATE_AGENT_RUNTIME_ENDPOINT_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#CreateAgentRuntimeEndpointOutput" +FILESYSTEM_CONFIGURATIONS: StaticSchema = ( + 16, + n0, + _FCi, + 0, + (_mem,), + ((FILESYSTEM_CONFIGURATION, 0),), +) + +LIFECYCLE_CONFIGURATION: StaticSchema = (18, n0, _LC, 0, (_iRST, _mL), ((7, 0), (7, 0))) + +NETWORK_MODE: StaticSchema = ( + 14, + n0, + _NM, + 0, + (_PUBLIC, _VPC), + ((-1, {_sVm: _PUBLIC}), (-1, {_sVm: _VPC})), +) + +SECURITY_GROUP_ID: StaticSchema = (3, n0, _SGIec, 0) + +SECURITY_GROUPS: StaticSchema = (16, n0, _SG, 0, (_mem,), ((SECURITY_GROUP_ID, 0),)) + +SUBNETS: StaticSchema = (16, n0, _S, 0, (_mem,), ((SUBNET_ID, 0),)) + +VPC_CONFIG: StaticSchema = ( + 18, + n0, + _VC, + 0, + (_sG, _su, _rSSE), + ((SECURITY_GROUPS, 1), (SUBNETS, 1), (2, 0)), +) + +NETWORK_CONFIGURATION: StaticSchema = ( + 18, + n0, + _NC, + 0, + (_nM, _nMC), + ((NETWORK_MODE, 1), (VPC_CONFIG, 0)), +) + +PLATFORM_VERSION: StaticSchema = (3, n0, _PV, 0) + +SERVER_PROTOCOL: StaticSchema = ( + 14, + n0, + _SP, + 0, + (_MCP, _HTTP, _AA_, _AGUI), + ((-1, {_sVm: _MCP}), (-1, {_sVm: _HTTP}), (-1, {_sVm: _AA_}), (-1, {_sVm: _AGUI})), +) + +PROTOCOL_CONFIGURATION: StaticSchema = (18, n0, _PC, 0, (_sP,), ((SERVER_PROTOCOL, 1),)) + +HEADER_NAME: StaticSchema = (3, n0, _HN, 0) + +REQUEST_HEADER_ALLOWLIST: StaticSchema = (16, n0, _RHA, 0, (_mem,), ((HEADER_NAME, 0),)) + +REQUEST_HEADER_CONFIGURATION: StaticSchema = ( + 19, + n0, + _RHC, + 0, + (_rHA,), + ((REQUEST_HEADER_ALLOWLIST, 0),), +) + +ROLE_ARN: StaticSchema = (3, n0, _RA, 0) + +CREATE_AGENT_RUNTIME_INPUT: StaticSchema = ( + 18, + n0, + _CARI, + {_sSI: _cCARR, _smit: None}, + (_aRN, _aRAg, _rA, _nC, _cT, _d, _aCu, _rHC, _pC, _lC, _eV, _fC, _cPC, _t, _pV), + ( + (AGENT_RUNTIME_NAME, 1), + (AGENT_RUNTIME_ARTIFACT, 1), + (ROLE_ARN, 1), + (NETWORK_CONFIGURATION, 0), + (CLIENT_TOKEN, 2), + (DESCRIPTION, 0), + (AUTHORIZER_CONFIGURATION, 0), + (REQUEST_HEADER_CONFIGURATION, 0), + (PROTOCOL_CONFIGURATION, 0), + (LIFECYCLE_CONFIGURATION, 0), + (ENVIRONMENT_VARIABLES_MAP, 0), + (FILESYSTEM_CONFIGURATIONS, 0), + (CAPACITY_PROVIDER_CONFIGURATION, 0), + (TAGS_MAP, 0), + (PLATFORM_VERSION, 0), ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreateAgentRuntimeEndpointResponse", - ) - ], - members={ - "targetVersion": { - "target": AGENT_RUNTIME_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentRuntimeEndpointArn": { - "target": AGENT_RUNTIME_ENDPOINT_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentRuntimeArn": { - "target": AGENT_RUNTIME_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentRuntimeId": {"target": AGENT_RUNTIME_ID}, - "endpointName": {"target": ENDPOINT_NAME}, - "status": { - "target": AGENT_RUNTIME_ENDPOINT_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, ) -CREATE_AGENT_RUNTIME_ENDPOINT = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateAgentRuntimeEndpoint"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 202, - "method": "PUT", - "uri": "/runtimes/{agentRuntimeId}/runtime-endpoints/", - } - ), - ) - ], +AGENT_RUNTIME_STATUS: StaticSchema = ( + 14, + n0, + _ARS, + 0, + (_CREATING, _CF, _UPDATING, _UF, _READY, _DELETING, _DF), + ( + (-1, {_sVm: _CREATING}), + (-1, {_sVm: _CF}), + (-1, {_sVm: _UPDATING}), + (-1, {_sVm: _UF}), + (-1, {_sVm: _READY}), + (-1, {_sVm: _DELETING}), + (-1, {_sVm: _DF}), + ), ) -DELETE_AGENT_RUNTIME_ENDPOINT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteAgentRuntimeEndpointInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeleteAgentRuntimeEndpointRequest", - ) - ], - members={ - "agentRuntimeId": { - "target": AGENT_RUNTIME_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "endpointName": { - "target": ENDPOINT_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#idempotencyToken")), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="clientToken"), - ], - }, - }, +WORKLOAD_IDENTITY_ARN: StaticSchema = (3, n0, _WIA, 0) + +WORKLOAD_IDENTITY_DETAILS: StaticSchema = ( + 18, + n0, + _WID, + 0, + (_wIA,), + ((WORKLOAD_IDENTITY_ARN, 1),), +) + +CREATE_AGENT_RUNTIME_OUTPUT: StaticSchema = ( + 18, + n0, + _CARO, + {_sSI: _cCARRo, _smith: None}, + (_aRA, _wID, _aRI, _aRV, _cA, _st), + ( + (AGENT_RUNTIME_ARN, 1), + (WORKLOAD_IDENTITY_DETAILS, 0), + (AGENT_RUNTIME_ID, 1), + (AGENT_RUNTIME_VERSION, 1), + (DATE_TIMESTAMP, 1), + (AGENT_RUNTIME_STATUS, 1), + ), ) -DELETE_AGENT_RUNTIME_ENDPOINT_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#DeleteAgentRuntimeEndpointOutput" +CREATE_AGENT_RUNTIME: StaticOperationSchema = ( + 23, + n0, + _CAR, + {_smithy: MappingProxyType({"code": 202, "method": "PUT", "uri": "/runtimes/"})}, + CREATE_AGENT_RUNTIME_INPUT, + CREATE_AGENT_RUNTIME_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeleteAgentRuntimeEndpointResponse", - ) - ], - members={ - "status": { - "target": AGENT_RUNTIME_ENDPOINT_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentRuntimeId": {"target": AGENT_RUNTIME_ID}, - "endpointName": {"target": ENDPOINT_NAME}, - }, ) -DELETE_AGENT_RUNTIME_ENDPOINT = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteAgentRuntimeEndpoint"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 202, - "method": "DELETE", - "uri": "/runtimes/{agentRuntimeId}/runtime-endpoints/{endpointName}/", - } - ), - ) - ], +DELETE_AGENT_RUNTIME_INPUT: StaticSchema = ( + 18, + n0, + _DARI, + {_sSI: _cDARR, _smit: None}, + (_aRI, _aRV, _cT), + ( + (AGENT_RUNTIME_ID, 9), + (AGENT_RUNTIME_VERSION, {_sQ: _ve}), + (CLIENT_TOKEN, {_sQ: _cT, _sT: None}), + ), ) -GET_AGENT_RUNTIME_ENDPOINT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetAgentRuntimeEndpointInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetAgentRuntimeEndpointRequest", - ) - ], - members={ - "agentRuntimeId": { - "target": AGENT_RUNTIME_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "endpointName": { - "target": ENDPOINT_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, +DELETE_AGENT_RUNTIME_OUTPUT: StaticSchema = ( + 18, + n0, + _DARO, + {_sSI: _cDARRo, _smith: None}, + (_st, _aRI, _aRV), + ((AGENT_RUNTIME_STATUS, 1), (AGENT_RUNTIME_ID, 0), (AGENT_RUNTIME_VERSION, 0)), +) + +DELETE_AGENT_RUNTIME: StaticOperationSchema = ( + 23, + n0, + _DAR, + { + _smithy: MappingProxyType( + {"code": 202, "method": "DELETE", "uri": "/runtimes/{agentRuntimeId}/"} + ) + }, + DELETE_AGENT_RUNTIME_INPUT, + DELETE_AGENT_RUNTIME_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + ), ) -AGENT_RUNTIME_ENDPOINT_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#AgentRuntimeEndpointId"), - shape_type=ShapeType.STRING, +GET_AGENT_RUNTIME_INPUT: StaticSchema = ( + 18, + n0, + _GARI, + {_sSI: _cGARR, _smit: None}, + (_aRI, _aRV), + ((AGENT_RUNTIME_ID, 9), (AGENT_RUNTIME_VERSION, {_sQ: _ve})), +) + +RUNTIME_METADATA_CONFIGURATION: StaticSchema = (18, n0, _RMC, 0, (_rMMDSV,), ((2, 1),)) + +GET_AGENT_RUNTIME_OUTPUT: StaticSchema = ( + 18, + n0, + _GARO, + {_sSI: _cGARRo, _smith: None}, + ( + _aRA, + _aRN, + _aRI, + _aRV, + _cA, + _lUA, + _rA, + _nC, + _st, + _lC, + _fR, + _d, + _wID, + _aRAg, + _pC, + _eV, + _aCu, + _rHC, + _mC, + _fC, + _cPC, + _pV, + ), + ( + (AGENT_RUNTIME_ARN, 1), + (AGENT_RUNTIME_NAME, 1), + (AGENT_RUNTIME_ID, 1), + (AGENT_RUNTIME_VERSION, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (ROLE_ARN, 1), + (NETWORK_CONFIGURATION, 0), + (AGENT_RUNTIME_STATUS, 1), + (LIFECYCLE_CONFIGURATION, 1), + (3, 0), + (DESCRIPTION, 0), + (WORKLOAD_IDENTITY_DETAILS, 0), + (AGENT_RUNTIME_ARTIFACT, 0), + (PROTOCOL_CONFIGURATION, 0), + (ENVIRONMENT_VARIABLES_MAP, 0), + (AUTHORIZER_CONFIGURATION, 0), + (REQUEST_HEADER_CONFIGURATION, 0), + (RUNTIME_METADATA_CONFIGURATION, 0), + (FILESYSTEM_CONFIGURATIONS, 0), + (CAPACITY_PROVIDER_CONFIGURATION, 0), + (PLATFORM_VERSION, 0), + ), ) -GET_AGENT_RUNTIME_ENDPOINT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetAgentRuntimeEndpointOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetAgentRuntimeEndpointResponse", +GET_AGENT_RUNTIME: StaticOperationSchema = ( + 23, + n0, + _GAR, + { + _smithy: MappingProxyType( + {"code": 200, "method": "GET", "uri": "/runtimes/{agentRuntimeId}/"} ) - ], - members={ - "liveVersion": {"target": AGENT_RUNTIME_VERSION}, - "targetVersion": {"target": AGENT_RUNTIME_VERSION}, - "agentRuntimeEndpointArn": { - "target": AGENT_RUNTIME_ENDPOINT_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentRuntimeArn": { - "target": AGENT_RUNTIME_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": AGENT_ENDPOINT_DESCRIPTION}, - "status": { - "target": AGENT_RUNTIME_ENDPOINT_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastUpdatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "failureReason": {"target": _STRING}, - "name": { - "target": ENDPOINT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "id": { - "target": AGENT_RUNTIME_ENDPOINT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, }, + GET_AGENT_RUNTIME_INPUT, + GET_AGENT_RUNTIME_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -GET_AGENT_RUNTIME_ENDPOINT = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetAgentRuntimeEndpoint"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/runtimes/{agentRuntimeId}/runtime-endpoints/{endpointName}/", - } - ), - ) - ], +LIST_AGENT_RUNTIMES_INPUT: StaticSchema = ( + 18, + n0, + _LARI, + {_sSI: _cLARR, _smit: None}, + (_mR, _nT), + ((MAX_RESULTS, {_sQ: _mR}), (NEXT_TOKEN, {_sQ: _nT})), +) + +AGENT_RUNTIME: StaticSchema = ( + 18, + n0, + _AR, + 0, + (_aRA, _aRI, _aRV, _aRN, _d, _lUA, _st), + ( + (AGENT_RUNTIME_ARN, 1), + (AGENT_RUNTIME_ID, 1), + (AGENT_RUNTIME_VERSION, 1), + (AGENT_RUNTIME_NAME, 1), + (DESCRIPTION, 1), + (DATE_TIMESTAMP, 1), + (AGENT_RUNTIME_STATUS, 1), + ), ) -MAX_RESULTS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#MaxResults"), - shape_type=ShapeType.INTEGER, +AGENT_RUNTIMES: StaticSchema = (16, n0, _ARg, 0, (_mem,), ((AGENT_RUNTIME, 0),)) + +LIST_AGENT_RUNTIMES_OUTPUT: StaticSchema = ( + 18, + n0, + _LARO, + {_sSI: _cLARRo, _smith: None}, + (_aR, _nT), + ((AGENT_RUNTIMES, 1), (NEXT_TOKEN, 0)), +) + +LIST_AGENT_RUNTIMES: StaticOperationSchema = ( + 23, + n0, + _LAR, + {_smithy: MappingProxyType({"code": 200, "method": "POST", "uri": "/runtimes/"})}, + LIST_AGENT_RUNTIMES_INPUT, + LIST_AGENT_RUNTIMES_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -NEXT_TOKEN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#NextToken"), - shape_type=ShapeType.STRING, +LIST_AGENT_RUNTIME_VERSIONS_INPUT: StaticSchema = ( + 18, + n0, + _LARVI, + {_sSI: _cLARVR, _smit: None}, + (_aRI, _mR, _nT), + ((AGENT_RUNTIME_ID, 9), (MAX_RESULTS, {_sQ: _mR}), (NEXT_TOKEN, {_sQ: _nT})), +) + +LIST_AGENT_RUNTIME_VERSIONS_OUTPUT: StaticSchema = ( + 18, + n0, + _LARVO, + {_sSI: _cLARVRo, _smith: None}, + (_aR, _nT), + ((AGENT_RUNTIMES, 1), (NEXT_TOKEN, 0)), +) + +LIST_AGENT_RUNTIME_VERSIONS: StaticOperationSchema = ( + 23, + n0, + _LARV, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "POST", + "uri": "/runtimes/{agentRuntimeId}/versions/", + } + ) + }, + LIST_AGENT_RUNTIME_VERSIONS_INPUT, + LIST_AGENT_RUNTIME_VERSIONS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -LIST_AGENT_RUNTIME_ENDPOINTS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListAgentRuntimeEndpointsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListAgentRuntimeEndpointsRequest", - ) - ], - members={ - "agentRuntimeId": { - "target": AGENT_RUNTIME_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - }, +UPDATE_AGENT_RUNTIME_INPUT: StaticSchema = ( + 18, + n0, + _UARI, + {_sSI: _cUARR, _smit: None}, + (_aRI, _aRAg, _rA, _nC, _d, _aCu, _rHC, _pC, _lC, _mC, _eV, _fC, _cPC, _pV, _cT), + ( + (AGENT_RUNTIME_ID, 9), + (AGENT_RUNTIME_ARTIFACT, 1), + (ROLE_ARN, 1), + (NETWORK_CONFIGURATION, 0), + (DESCRIPTION, 0), + (AUTHORIZER_CONFIGURATION, 0), + (REQUEST_HEADER_CONFIGURATION, 0), + (PROTOCOL_CONFIGURATION, 0), + (LIFECYCLE_CONFIGURATION, 0), + (RUNTIME_METADATA_CONFIGURATION, 0), + (ENVIRONMENT_VARIABLES_MAP, 0), + (FILESYSTEM_CONFIGURATIONS, 0), + (CAPACITY_PROVIDER_CONFIGURATION, 0), + (PLATFORM_VERSION, 0), + (CLIENT_TOKEN, 2), + ), ) -AGENT_RUNTIME_ENDPOINT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#AgentRuntimeEndpoint"), - members={ - "name": { - "target": ENDPOINT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "liveVersion": {"target": AGENT_RUNTIME_VERSION}, - "targetVersion": {"target": AGENT_RUNTIME_VERSION}, - "agentRuntimeEndpointArn": { - "target": AGENT_RUNTIME_ENDPOINT_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentRuntimeArn": { - "target": AGENT_RUNTIME_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": AGENT_RUNTIME_ENDPOINT_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "id": { - "target": AGENT_RUNTIME_ENDPOINT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": AGENT_ENDPOINT_DESCRIPTION}, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastUpdatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +UPDATE_AGENT_RUNTIME_OUTPUT: StaticSchema = ( + 18, + n0, + _UARO, + {_sSI: _cUARRo, _smith: None}, + (_aRA, _aRI, _wID, _aRV, _cA, _lUA, _st), + ( + (AGENT_RUNTIME_ARN, 1), + (AGENT_RUNTIME_ID, 1), + (WORKLOAD_IDENTITY_DETAILS, 0), + (AGENT_RUNTIME_VERSION, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (AGENT_RUNTIME_STATUS, 1), + ), ) -AGENT_RUNTIME_ENDPOINTS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#AgentRuntimeEndpoints"), - shape_type=ShapeType.LIST, - members={"member": {"target": AGENT_RUNTIME_ENDPOINT}}, +UPDATE_AGENT_RUNTIME: StaticOperationSchema = ( + 23, + n0, + _UAR, + { + _smithy: MappingProxyType( + {"code": 202, "method": "PUT", "uri": "/runtimes/{agentRuntimeId}/"} + ) + }, + UPDATE_AGENT_RUNTIME_INPUT, + UPDATE_AGENT_RUNTIME_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -LIST_AGENT_RUNTIME_ENDPOINTS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListAgentRuntimeEndpointsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListAgentRuntimeEndpointsResponse", - ) - ], - members={ - "runtimeEndpoints": { - "target": AGENT_RUNTIME_ENDPOINTS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": NEXT_TOKEN}, - }, +AGENT_RUNTIME_VERSION_SUMMARY: StaticSchema = ( + 18, + n0, + _ARVS, + 0, + (_aRA, _aRV, _st), + ((AGENT_RUNTIME_ARN, 1), (AGENT_RUNTIME_VERSION, 1), (AGENT_RUNTIME_STATUS, 1)), ) -LIST_AGENT_RUNTIME_ENDPOINTS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListAgentRuntimeEndpoints"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "POST", - "uri": "/runtimes/{agentRuntimeId}/runtime-endpoints/", - } - ), - ) - ], +AGENT_RUNTIME_VERSION_SUMMARY_LIST: StaticSchema = ( + 16, + n0, + _ARVSL, + 0, + (_mem,), + ((AGENT_RUNTIME_VERSION_SUMMARY, 0),), ) -UPDATE_AGENT_RUNTIME_ENDPOINT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateAgentRuntimeEndpointInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UpdateAgentRuntimeEndpointRequest", - ) - ], - members={ - "agentRuntimeId": { - "target": AGENT_RUNTIME_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "endpointName": { - "target": ENDPOINT_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "agentRuntimeVersion": {"target": AGENT_RUNTIME_VERSION}, - "description": {"target": AGENT_ENDPOINT_DESCRIPTION}, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - }, +SKILL_DEFINITION: StaticSchema = ( + 18, + n0, + _SD, + 0, + (_sV, _iC), + ((SCHEMA_VERSION, 0), (INLINE_CONTENT, 0)), ) -UPDATE_AGENT_RUNTIME_ENDPOINT_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#UpdateAgentRuntimeEndpointOutput" - ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UpdateAgentRuntimeEndpointResponse", - ) - ], - members={ - "liveVersion": {"target": AGENT_RUNTIME_VERSION}, - "targetVersion": {"target": AGENT_RUNTIME_VERSION}, - "agentRuntimeEndpointArn": { - "target": AGENT_RUNTIME_ENDPOINT_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentRuntimeArn": { - "target": AGENT_RUNTIME_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": AGENT_RUNTIME_ENDPOINT_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastUpdatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +SKILL_MD_DEFINITION: StaticSchema = (18, n0, _SMD, 0, (_iC,), ((INLINE_CONTENT, 0),)) -UPDATE_AGENT_RUNTIME_ENDPOINT = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateAgentRuntimeEndpoint"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 202, - "method": "PUT", - "uri": "/runtimes/{agentRuntimeId}/runtime-endpoints/{endpointName}/", - } - ), - ) - ], -) - -AGENT_MANAGED_RUNTIME_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#AgentManagedRuntimeType"), - shape_type=ShapeType.ENUM, - members={ - "PYTHON_3_10": {"target": UNIT}, - "PYTHON_3_11": {"target": UNIT}, - "PYTHON_3_12": {"target": UNIT}, - "PYTHON_3_13": {"target": UNIT}, - "PYTHON_3_14": {"target": UNIT}, - "NODE_22": {"target": UNIT}, - }, +AGENT_SKILLS_DESCRIPTOR: StaticSchema = ( + 18, + n0, + _ASD, + 0, + (_sM, _sD), + ((SKILL_MD_DEFINITION, 0), (SKILL_DEFINITION, 0)), ) -S3_LOCATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#S3Location"), - members={ - "bucket": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "prefix": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "versionId": {"target": _STRING}, - }, +ALLOWED_AUDIENCE_TYPE: StaticSchema = (3, n0, _AAT, 0) + +HTTP_QUERY_PARAMETER_NAME: StaticSchema = (3, n0, _HQPN, 0) + +ALLOWED_QUERY_PARAMETERS: StaticSchema = ( + 16, + n0, + _AQP, + 0, + (_mem,), + ((HTTP_QUERY_PARAMETER_NAME, 0),), ) -CODE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#Code"), - shape_type=ShapeType.UNION, - members={"s3": {"target": S3_LOCATION}}, +HTTP_HEADER_NAME: StaticSchema = (3, n0, _HHN, 0) + +ALLOWED_REQUEST_HEADERS: StaticSchema = ( + 16, + n0, + _ARH, + 0, + (_mem,), + ((HTTP_HEADER_NAME, 0),), ) -ENTRY_POINT = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#entryPoint"), - shape_type=ShapeType.STRING, +ALLOWED_RESPONSE_HEADERS: StaticSchema = ( + 16, + n0, + _ARHl, + 0, + (_mem,), + ((HTTP_HEADER_NAME, 0),), ) -ENTRY_POINTS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#EntryPoints"), - shape_type=ShapeType.LIST, - members={"member": {"target": ENTRY_POINT}}, +ALLOWED_STRING_LIST_VALUE: StaticSchema = (3, n0, _ASLV, 0) + +ALLOWED_STRING_LIST_VALUES_LIST: StaticSchema = ( + 16, + n0, + _ASLVL, + 0, + (_mem,), + ((ALLOWED_STRING_LIST_VALUE, 0),), ) -CODE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CodeConfiguration"), - members={ - "code": { - "target": CODE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "runtime": { - "target": AGENT_MANAGED_RUNTIME_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "entryPoint": { - "target": ENTRY_POINTS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +ALLOWED_STRING_VALUE: StaticSchema = (3, n0, _ASV, 0) + +ALLOWED_STRING_VALUES_LIST: StaticSchema = ( + 16, + n0, + _ASVL, + 0, + (_mem,), + ((ALLOWED_STRING_VALUE, 0),), ) -RUNTIME_CONTAINER_URI = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#RuntimeContainerUri"), - shape_type=ShapeType.STRING, +API_KEY_CREDENTIAL_PROVIDER_ARN_TYPE: StaticSchema = (3, n0, _AKCPAT, 0) + +DEFAULT_API_KEY_TYPE: StaticSchema = (3, n0, _DAKT, 4) + +SECRET_JSON_KEY_TYPE: StaticSchema = (3, n0, _SJKT, 0) + +SECRET_ID_TYPE: StaticSchema = (3, n0, _SIT, 0) + +SECRET_REFERENCE: StaticSchema = ( + 18, + n0, + _SRe, + 0, + (_sIe, _jK), + ((SECRET_ID_TYPE, 1), (SECRET_JSON_KEY_TYPE, 1)), ) -CONTAINER_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ContainerConfiguration"), - members={ - "containerUri": { - "target": RUNTIME_CONTAINER_URI, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +SECRET_SOURCE_TYPE: StaticSchema = ( + 14, + n0, + _SST, + 0, + (_MANAGED, _EXTERNAL), + ((-1, {_sVm: _MANAGED}), (-1, {_sVm: _EXTERNAL})), ) -AGENT_RUNTIME_ARTIFACT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#AgentRuntimeArtifact"), - shape_type=ShapeType.UNION, - members={ - "containerConfiguration": {"target": CONTAINER_CONFIGURATION}, - "codeConfiguration": {"target": CODE_CONFIGURATION}, - }, +CREDENTIAL_PROVIDER_NAME: StaticSchema = (3, n0, _CPN, 0) + +CREATE_API_KEY_CREDENTIAL_PROVIDER_INPUT: StaticSchema = ( + 18, + n0, + _CAKCPI, + {_sSI: _cCAKCPR, _smit: None}, + (_n, _aK, _aKSC, _aKSS, _t), + ( + (CREDENTIAL_PROVIDER_NAME, 1), + (DEFAULT_API_KEY_TYPE, {_smithya: _v_}), + (SECRET_REFERENCE, 0), + (SECRET_SOURCE_TYPE, 0), + (TAGS_MAP, 0), + ), ) -AGENT_RUNTIME_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#AgentRuntimeName"), - shape_type=ShapeType.STRING, +SECRET_ARN: StaticSchema = (3, n0, _SAe, 0) + +SECRET: StaticSchema = (18, n0, _Se, 0, (_sA,), ((SECRET_ARN, 1),)) + +CREATE_API_KEY_CREDENTIAL_PROVIDER_OUTPUT: StaticSchema = ( + 18, + n0, + _CAKCPO, + {_sSI: _cCAKCPRo, _smith: None}, + (_aKSA, _aKSJK, _aKSS, _n, _cPAr), + ( + (SECRET, 1), + (SECRET_JSON_KEY_TYPE, 0), + (SECRET_SOURCE_TYPE, 0), + (CREDENTIAL_PROVIDER_NAME, 1), + (API_KEY_CREDENTIAL_PROVIDER_ARN_TYPE, 1), + ), ) -ALLOWED_AUDIENCE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#AllowedAudience"), - shape_type=ShapeType.STRING, +DECRYPTION_FAILURE: StaticSchema = (18, n0, _DFe, {_s: _c, _sE: 400}, (_m,), ((3, 1),)) + +ENCRYPTION_FAILURE: StaticSchema = (18, n0, _EF, {_s: _c, _sE: 400}, (_m,), ((3, 1),)) + +RESOURCE_LIMIT_EXCEEDED_EXCEPTION: StaticSchema = ( + 18, + n0, + _RLEE, + {_s: _c, _sE: 400}, + (_m,), + ((3, 0),), +) + +UNAUTHORIZED_EXCEPTION: StaticSchema = ( + 18, + n0, + _UE, + {_s: _c, _sE: 401}, + (_m,), + ((NON_BLANK_STRING, 0),), +) + +CREATE_API_KEY_CREDENTIAL_PROVIDER: StaticOperationSchema = ( + 23, + n0, + _CAKCP, + { + _smithy: MappingProxyType( + { + "code": 201, + "uri": "/identities/CreateApiKeyCredentialProvider", + "method": "POST", + } + ) + }, + CREATE_API_KEY_CREDENTIAL_PROVIDER_INPUT, + CREATE_API_KEY_CREDENTIAL_PROVIDER_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + DECRYPTION_FAILURE, + ENCRYPTION_FAILURE, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_LIMIT_EXCEEDED_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -ALLOWED_AUDIENCE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#AllowedAudienceList"), - shape_type=ShapeType.LIST, - members={"member": {"target": ALLOWED_AUDIENCE}}, +DELETE_API_KEY_CREDENTIAL_PROVIDER_INPUT: StaticSchema = ( + 18, + n0, + _DAKCPI, + {_sSI: _cDAKCPR, _smit: None}, + (_n,), + ((CREDENTIAL_PROVIDER_NAME, 1),), +) + +DELETE_API_KEY_CREDENTIAL_PROVIDER_OUTPUT: StaticSchema = ( + 18, + n0, + _DAKCPO, + {_sSI: _cDAKCPRo, _smith: None}, +) + +DELETE_API_KEY_CREDENTIAL_PROVIDER: StaticOperationSchema = ( + 23, + n0, + _DAKCP, + { + _smithy: MappingProxyType( + { + "code": 204, + "uri": "/identities/DeleteApiKeyCredentialProvider", + "method": "POST", + } + ) + }, + DELETE_API_KEY_CREDENTIAL_PROVIDER_INPUT, + DELETE_API_KEY_CREDENTIAL_PROVIDER_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -ALLOWED_CLIENT = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#AllowedClient"), - shape_type=ShapeType.STRING, +GET_API_KEY_CREDENTIAL_PROVIDER_INPUT: StaticSchema = ( + 18, + n0, + _GAKCPI, + {_sSI: _cGAKCPR, _smit: None}, + (_n,), + ((CREDENTIAL_PROVIDER_NAME, 1),), +) + +GET_API_KEY_CREDENTIAL_PROVIDER_OUTPUT: StaticSchema = ( + 18, + n0, + _GAKCPO, + {_sSI: _cGAKCPRo, _smith: None}, + (_aKSA, _aKSJK, _aKSS, _n, _cPAr, _cTr, _lUT), + ( + (SECRET, 1), + (SECRET_JSON_KEY_TYPE, 0), + (SECRET_SOURCE_TYPE, 0), + (CREDENTIAL_PROVIDER_NAME, 1), + (API_KEY_CREDENTIAL_PROVIDER_ARN_TYPE, 1), + (4, 1), + (4, 1), + ), ) -ALLOWED_CLIENTS_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#AllowedClientsList"), - shape_type=ShapeType.LIST, - members={"member": {"target": ALLOWED_CLIENT}}, +GET_API_KEY_CREDENTIAL_PROVIDER: StaticOperationSchema = ( + 23, + n0, + _GAKCP, + { + _smithy: MappingProxyType( + {"uri": "/identities/GetApiKeyCredentialProvider", "method": "POST"} + ) + }, + GET_API_KEY_CREDENTIAL_PROVIDER_INPUT, + GET_API_KEY_CREDENTIAL_PROVIDER_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + DECRYPTION_FAILURE, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -ALLOWED_SCOPES_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#AllowedScopesType"), - shape_type=ShapeType.LIST, - members={"member": {"target": ALLOWED_SCOPE_TYPE}}, +LIST_API_KEY_CREDENTIAL_PROVIDERS_INPUT: StaticSchema = ( + 18, + n0, + _LAKCPI, + {_sSI: _cLAKCPR, _smit: None}, + (_nT, _mR), + ((3, 0), (MAX_RESULTS, {_smithya: 10})), +) + +API_KEY_CREDENTIAL_PROVIDER_ITEM: StaticSchema = ( + 18, + n0, + _AKCPI, + 0, + (_n, _cPAr, _cTr, _lUT), + ( + (CREDENTIAL_PROVIDER_NAME, 1), + (API_KEY_CREDENTIAL_PROVIDER_ARN_TYPE, 1), + (4, 1), + (4, 1), + ), ) -BEDROCK_AGENTCORE_RESOURCE_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#BedrockAgentcoreResourceArn"), - shape_type=ShapeType.STRING, +API_KEY_CREDENTIAL_PROVIDERS: StaticSchema = ( + 16, + n0, + _AKCP, + 0, + (_mem,), + ((API_KEY_CREDENTIAL_PROVIDER_ITEM, 0),), +) + +LIST_API_KEY_CREDENTIAL_PROVIDERS_OUTPUT: StaticSchema = ( + 18, + n0, + _LAKCPO, + {_sSI: _cLAKCPRo, _smith: None}, + (_cP, _nT), + ((API_KEY_CREDENTIAL_PROVIDERS, 1), (3, 0)), +) + +LIST_API_KEY_CREDENTIAL_PROVIDERS: StaticOperationSchema = ( + 23, + n0, + _LAKCP, + { + _smithy: MappingProxyType( + {"uri": "/identities/ListApiKeyCredentialProviders", "method": "POST"} + ) + }, + LIST_API_KEY_CREDENTIAL_PROVIDERS_INPUT, + LIST_API_KEY_CREDENTIAL_PROVIDERS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -HOSTING_ENVIRONMENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HostingEnvironment"), - members={ - "arn": { - "target": BEDROCK_AGENTCORE_RESOURCE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +UPDATE_API_KEY_CREDENTIAL_PROVIDER_INPUT: StaticSchema = ( + 18, + n0, + _UAKCPI, + {_sSI: _cUAKCPR, _smit: None}, + (_n, _aK, _aKSC, _aKSS), + ( + (CREDENTIAL_PROVIDER_NAME, 1), + (DEFAULT_API_KEY_TYPE, {_smithya: _v_}), + (SECRET_REFERENCE, 0), + (SECRET_SOURCE_TYPE, 0), + ), ) -HOSTING_ENVIRONMENT_LIST_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HostingEnvironmentListType"), - shape_type=ShapeType.LIST, - members={"member": {"target": HOSTING_ENVIRONMENT}}, +UPDATE_API_KEY_CREDENTIAL_PROVIDER_OUTPUT: StaticSchema = ( + 18, + n0, + _UAKCPO, + {_sSI: _cUAKCPRo, _smith: None}, + (_aKSA, _aKSJK, _aKSS, _n, _cPAr, _cTr, _lUT), + ( + (SECRET, 1), + (SECRET_JSON_KEY_TYPE, 0), + (SECRET_SOURCE_TYPE, 0), + (CREDENTIAL_PROVIDER_NAME, 1), + (API_KEY_CREDENTIAL_PROVIDER_ARN_TYPE, 1), + (4, 1), + (4, 1), + ), ) -WORKLOAD_IDENTITY_NAME_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#WorkloadIdentityNameType"), - shape_type=ShapeType.STRING, +UPDATE_API_KEY_CREDENTIAL_PROVIDER: StaticOperationSchema = ( + 23, + n0, + _UAKCP, + { + _smithy: MappingProxyType( + {"uri": "/identities/UpdateApiKeyCredentialProvider", "method": "POST"} + ) + }, + UPDATE_API_KEY_CREDENTIAL_PROVIDER_INPUT, + UPDATE_API_KEY_CREDENTIAL_PROVIDER_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + DECRYPTION_FAILURE, + ENCRYPTION_FAILURE, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -WORKLOAD_IDENTITY_NAME_LIST_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#WorkloadIdentityNameListType"), - shape_type=ShapeType.LIST, - members={"member": {"target": WORKLOAD_IDENTITY_NAME_TYPE}}, +BROWSER_PROFILE_ID: StaticSchema = (3, n0, _BPI, 0) + +BROWSER_PROFILE_NAME: StaticSchema = (3, n0, _BPN, 0) + +CREATE_BROWSER_PROFILE_INPUT: StaticSchema = ( + 18, + n0, + _CBPI, + {_sSI: _cCBPR, _smit: None}, + (_n, _d, _cT, _t), + ((BROWSER_PROFILE_NAME, 1), (DESCRIPTION, 0), (CLIENT_TOKEN, 2), (TAGS_MAP, 0)), ) -ALLOWED_WORKLOAD_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#AllowedWorkloadConfiguration"), - members={ - "hostingEnvironments": {"target": HOSTING_ENVIRONMENT_LIST_TYPE}, - "workloadIdentities": {"target": WORKLOAD_IDENTITY_NAME_LIST_TYPE}, - }, +BROWSER_PROFILE_ARN: StaticSchema = (3, n0, _BPA, 0) + +BROWSER_PROFILE_STATUS: StaticSchema = ( + 14, + n0, + _BPS, + 0, + (_READY, _DELETING, _DELETED, _SAVING), + ( + (-1, {_sVm: _READY}), + (-1, {_sVm: _DELETING}), + (-1, {_sVm: _DELETED}), + (-1, {_sVm: _SAVING}), + ), ) -CLAIM_MATCH_OPERATOR_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ClaimMatchOperatorType"), - shape_type=ShapeType.ENUM, - members={ - "EQUALS": {"target": UNIT}, - "CONTAINS": {"target": UNIT}, - "CONTAINS_ANY": {"target": UNIT}, - }, +CREATE_BROWSER_PROFILE_OUTPUT: StaticSchema = ( + 18, + n0, + _CBPO, + {_sSI: _cCBPRo, _smith: None}, + (_pI, _pA, _cA, _st), + ( + (BROWSER_PROFILE_ID, 1), + (BROWSER_PROFILE_ARN, 1), + (DATE_TIMESTAMP, 1), + (BROWSER_PROFILE_STATUS, 1), + ), ) -MATCH_VALUE_STRING = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#MatchValueString"), - shape_type=ShapeType.STRING, +CREATE_BROWSER_PROFILE: StaticOperationSchema = ( + 23, + n0, + _CBP, + { + _smithy: MappingProxyType( + {"code": 200, "method": "PUT", "uri": "/browser-profiles"} + ) + }, + CREATE_BROWSER_PROFILE_INPUT, + CREATE_BROWSER_PROFILE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -MATCH_VALUE_STRING_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#MatchValueStringList"), - shape_type=ShapeType.LIST, - members={"member": {"target": MATCH_VALUE_STRING}}, +DELETE_BROWSER_PROFILE_INPUT: StaticSchema = ( + 18, + n0, + _DBPI, + {_sSI: _cDBPR, _smit: None}, + (_pI, _cT), + ((BROWSER_PROFILE_ID, 9), (CLIENT_TOKEN, {_sQ: _cT, _sT: None})), +) + +DELETE_BROWSER_PROFILE_OUTPUT: StaticSchema = ( + 18, + n0, + _DBPO, + {_sSI: _cDBPRo, _smith: None}, + (_pI, _pA, _st, _lUA, _lSA), + ( + (BROWSER_PROFILE_ID, 1), + (BROWSER_PROFILE_ARN, 1), + (BROWSER_PROFILE_STATUS, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 0), + ), ) -CLAIM_MATCH_VALUE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ClaimMatchValueType"), - shape_type=ShapeType.UNION, - members={ - "matchValueString": {"target": MATCH_VALUE_STRING}, - "matchValueStringList": {"target": MATCH_VALUE_STRING_LIST}, - }, +DELETE_BROWSER_PROFILE: StaticOperationSchema = ( + 23, + n0, + _DBP, + { + _smithy: MappingProxyType( + {"code": 200, "method": "DELETE", "uri": "/browser-profiles/{profileId}"} + ) + }, + DELETE_BROWSER_PROFILE_INPUT, + DELETE_BROWSER_PROFILE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AUTHORIZING_CLAIM_MATCH_VALUE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#AuthorizingClaimMatchValueType"), - members={ - "claimMatchValue": { - "target": CLAIM_MATCH_VALUE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "claimMatchOperator": { - "target": CLAIM_MATCH_OPERATOR_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +GET_BROWSER_PROFILE_INPUT: StaticSchema = ( + 18, + n0, + _GBPI, + {_sSI: _cGBPR, _smit: None}, + (_pI,), + ((BROWSER_PROFILE_ID, 9),), +) + +BROWSER_ID: StaticSchema = (3, n0, _BI, 0) + +BROWSER_SESSION_ID: StaticSchema = (3, n0, _BSI, 0) + +GET_BROWSER_PROFILE_OUTPUT: StaticSchema = ( + 18, + n0, + _GBPO, + {_sSI: _cGBPRo, _smith: None}, + (_pI, _pA, _n, _d, _st, _cA, _lUA, _lSA, _lSBSI, _lSBI), + ( + (BROWSER_PROFILE_ID, 1), + (BROWSER_PROFILE_ARN, 1), + (BROWSER_PROFILE_NAME, 1), + (DESCRIPTION, 0), + (BROWSER_PROFILE_STATUS, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 0), + (BROWSER_SESSION_ID, 0), + (BROWSER_ID, 0), + ), ) -INBOUND_TOKEN_CLAIM_NAME_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#InboundTokenClaimNameType"), - shape_type=ShapeType.STRING, -) - -INBOUND_TOKEN_CLAIM_VALUE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#InboundTokenClaimValueType"), - shape_type=ShapeType.ENUM, - members={"STRING": {"target": UNIT}, "STRING_ARRAY": {"target": UNIT}}, -) - -CUSTOM_CLAIM_VALIDATION_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CustomClaimValidationType"), - members={ - "inboundTokenClaimName": { - "target": INBOUND_TOKEN_CLAIM_NAME_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "inboundTokenClaimValueType": { - "target": INBOUND_TOKEN_CLAIM_VALUE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "authorizingClaimMatchValue": { - "target": AUTHORIZING_CLAIM_MATCH_VALUE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, +GET_BROWSER_PROFILE: StaticOperationSchema = ( + 23, + n0, + _GBP, + { + _smithy: MappingProxyType( + {"code": 200, "method": "GET", "uri": "/browser-profiles/{profileId}"} + ) }, + GET_BROWSER_PROFILE_INPUT, + GET_BROWSER_PROFILE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CUSTOM_CLAIM_VALIDATIONS_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CustomClaimValidationsType"), - shape_type=ShapeType.LIST, - members={"member": {"target": CUSTOM_CLAIM_VALIDATION_TYPE}}, +LIST_BROWSER_PROFILES_INPUT: StaticSchema = ( + 18, + n0, + _LBPI, + {_sSI: _cLBPR, _smit: None}, + (_mR, _nT, _n), + ((MAX_RESULTS, {_sQ: _mR}), (NEXT_TOKEN, {_sQ: _nT}), (BROWSER_PROFILE_NAME, 0)), +) + +BROWSER_PROFILE_SUMMARY: StaticSchema = ( + 18, + n0, + _BPSr, + 0, + (_pI, _pA, _n, _d, _st, _cA, _lUA, _lSA, _lSBSI, _lSBI), + ( + (BROWSER_PROFILE_ID, 1), + (BROWSER_PROFILE_ARN, 1), + (BROWSER_PROFILE_NAME, 1), + (DESCRIPTION, 0), + (BROWSER_PROFILE_STATUS, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 0), + (BROWSER_SESSION_ID, 0), + (BROWSER_ID, 0), + ), ) -DISCOVERY_URL = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DiscoveryUrl"), - shape_type=ShapeType.STRING, +BROWSER_PROFILE_SUMMARIES: StaticSchema = ( + 16, + n0, + _BPSro, + 0, + (_mem,), + ((BROWSER_PROFILE_SUMMARY, 0),), +) + +LIST_BROWSER_PROFILES_OUTPUT: StaticSchema = ( + 18, + n0, + _LBPO, + {_sSI: _cLBPRo, _smith: None}, + (_pS, _nT), + ((BROWSER_PROFILE_SUMMARIES, 1), (NEXT_TOKEN, 0)), +) + +LIST_BROWSER_PROFILES: StaticOperationSchema = ( + 23, + n0, + _LBP, + { + _smithy: MappingProxyType( + {"code": 200, "method": "POST", "uri": "/browser-profiles"} + ) + }, + LIST_BROWSER_PROFILES_INPUT, + LIST_BROWSER_PROFILES_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -ENDPOINT_IP_ADDRESS_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#EndpointIpAddressType"), - shape_type=ShapeType.ENUM, - members={"IPV4": {"target": UNIT}, "IPV6": {"target": UNIT}}, +BROWSER_SIGNING_CONFIG_INPUT: StaticSchema = ( + 18, + n0, + _BSCI, + 0, + (_en,), + ((2, {_smithya: False, _sm: None}),), ) -ROUTING_DOMAIN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#RoutingDomain"), - shape_type=ShapeType.STRING, -) +TOOL_SECRET_ARN: StaticSchema = (3, n0, _TSA, 0) -SECURITY_GROUP_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SecurityGroupIdentifier"), - shape_type=ShapeType.STRING, +SECRETS_MANAGER_LOCATION: StaticSchema = ( + 18, + n0, + _SML, + 0, + (_sA,), + ((TOOL_SECRET_ARN, 1),), ) -SECURITY_GROUP_IDS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SecurityGroupIds"), - shape_type=ShapeType.LIST, - members={"member": {"target": SECURITY_GROUP_IDENTIFIER}}, +CERTIFICATE_LOCATION: StaticSchema = ( + 19, + n0, + _CL, + 0, + (_sMe,), + ((SECRETS_MANAGER_LOCATION, 0),), ) -SUBNET_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SubnetId"), - shape_type=ShapeType.STRING, -) +CERTIFICATE: StaticSchema = (18, n0, _Ce, 0, (_l,), ((CERTIFICATE_LOCATION, 1),)) -SUBNET_IDS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SubnetIds"), - shape_type=ShapeType.LIST, - members={"member": {"target": SUBNET_ID}}, -) +CERTIFICATES: StaticSchema = (16, n0, _Cer, 0, (_mem,), ((CERTIFICATE, 0),)) -VPC_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#VpcIdentifier"), - shape_type=ShapeType.STRING, -) +RESOURCE_LOCATION: StaticSchema = (19, n0, _RL, 0, (_s_,), ((S3_LOCATION, 0),)) -MANAGED_VPC_RESOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ManagedVpcResource"), - members={ - "vpcIdentifier": { - "target": VPC_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "subnetIds": { - "target": SUBNET_IDS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "endpointIpAddressType": { - "target": ENDPOINT_IP_ADDRESS_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "securityGroupIds": {"target": SECURITY_GROUP_IDS}, - "tags": {"target": TAGS_MAP}, - "routingDomain": {"target": ROUTING_DOMAIN}, - }, +BROWSER_ENTERPRISE_POLICY_TYPE: StaticSchema = ( + 14, + n0, + _BEPT, + 0, + (_MANAGED, _RECOMMENDED), + ((-1, {_sVm: _MANAGED}), (-1, {_sVm: _RECOMMENDED})), +) + +BROWSER_ENTERPRISE_POLICY: StaticSchema = ( + 18, + n0, + _BEP, + 0, + (_l, _ty), + ((RESOURCE_LOCATION, 1), (BROWSER_ENTERPRISE_POLICY_TYPE, 0)), +) + +BROWSER_ENTERPRISE_POLICIES: StaticSchema = ( + 16, + n0, + _BEPr, + 0, + (_mem,), + ((BROWSER_ENTERPRISE_POLICY, 0),), +) + +EFS_FILE_SYSTEM_ARN: StaticSchema = (3, n0, _EFSA, 0) + +EFS_CONFIGURATION: StaticSchema = ( + 18, + n0, + _EC, + 0, + (_aPA, _mP, _fSA), + ((EFS_ACCESS_POINT_ARN, 1), (MOUNT_PATH, 1), (EFS_FILE_SYSTEM_ARN, 1)), +) + +S3_FILES_FILE_SYSTEM_ARN: StaticSchema = (3, n0, _SFFSA, 0) + +S3_FILES_CONFIGURATION: StaticSchema = ( + 18, + n0, + _SFC, + 0, + (_aPA, _mP, _fSA), + ((S3_FILES_ACCESS_POINT_ARN, 1), (MOUNT_PATH, 1), (S3_FILES_FILE_SYSTEM_ARN, 1)), +) + +TOOLS_FILE_SYSTEM_CONFIGURATION: StaticSchema = ( + 19, + n0, + _TFSC, + 0, + (_sFC, _eC), + ((S3_FILES_CONFIGURATION, 0), (EFS_CONFIGURATION, 0)), +) + +TOOLS_FILE_SYSTEM_CONFIGURATIONS: StaticSchema = ( + 16, + n0, + _TFSCo, + 0, + (_mem,), + ((TOOLS_FILE_SYSTEM_CONFIGURATION, 0),), +) + +SANDBOX_NAME: StaticSchema = (3, n0, _SN, 0) + +BROWSER_NETWORK_MODE: StaticSchema = ( + 14, + n0, + _BNM, + 0, + (_PUBLIC, _VPC), + ((-1, {_sVm: _PUBLIC}), (-1, {_sVm: _VPC})), +) + +BROWSER_NETWORK_CONFIGURATION: StaticSchema = ( + 18, + n0, + _BNC, + 0, + (_nM, _vC), + ((BROWSER_NETWORK_MODE, {_smithya: _PUBLIC, _sm: None}), (VPC_CONFIG, 0)), +) + +RECORDING_CONFIG: StaticSchema = ( + 18, + n0, + _RCec, + 0, + (_en, _sLo), + ((2, {_smithya: False}), (S3_LOCATION, 0)), +) + +CREATE_BROWSER_INPUT: StaticSchema = ( + 18, + n0, + _CBI, + {_sSI: _cCBR, _smit: None}, + (_n, _d, _eRA, _nC, _re, _bS, _ePn, _ce, _fC, _cT, _t), + ( + (SANDBOX_NAME, 1), + (DESCRIPTION, 0), + (ROLE_ARN, 0), + (BROWSER_NETWORK_CONFIGURATION, 1), + (RECORDING_CONFIG, 0), + (BROWSER_SIGNING_CONFIG_INPUT, 0), + (BROWSER_ENTERPRISE_POLICIES, 0), + (CERTIFICATES, 0), + (TOOLS_FILE_SYSTEM_CONFIGURATIONS, 0), + (CLIENT_TOKEN, 2), + (TAGS_MAP, 0), + ), ) -RESOURCE_CONFIGURATION_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceConfigurationIdentifier"), - shape_type=ShapeType.STRING, +BROWSER_ARN: StaticSchema = (3, n0, _BA, 0) + +BROWSER_STATUS: StaticSchema = ( + 14, + n0, + _BS, + 0, + (_CREATING, _CF, _READY, _DELETING, _DF, _DELETED), + ( + (-1, {_sVm: _CREATING}), + (-1, {_sVm: _CF}), + (-1, {_sVm: _READY}), + (-1, {_sVm: _DELETING}), + (-1, {_sVm: _DF}), + (-1, {_sVm: _DELETED}), + ), ) -SELF_MANAGED_LATTICE_RESOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SelfManagedLatticeResource"), - shape_type=ShapeType.UNION, - members={ - "resourceConfigurationIdentifier": {"target": RESOURCE_CONFIGURATION_IDENTIFIER} - }, +CREATE_BROWSER_OUTPUT: StaticSchema = ( + 18, + n0, + _CBO, + {_sSI: _cCBRo, _smith: None}, + (_bI, _bAr, _cA, _st), + ((BROWSER_ID, 1), (BROWSER_ARN, 1), (DATE_TIMESTAMP, 1), (BROWSER_STATUS, 1)), +) + +CREATE_BROWSER: StaticOperationSchema = ( + 23, + n0, + _CB, + {_smithy: MappingProxyType({"code": 202, "method": "PUT", "uri": "/browsers"})}, + CREATE_BROWSER_INPUT, + CREATE_BROWSER_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -PRIVATE_ENDPOINT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PrivateEndpoint"), - shape_type=ShapeType.UNION, - members={ - "selfManagedLatticeResource": {"target": SELF_MANAGED_LATTICE_RESOURCE}, - "managedVpcResource": {"target": MANAGED_VPC_RESOURCE}, - }, +DELETE_BROWSER_INPUT: StaticSchema = ( + 18, + n0, + _DBI, + {_sSI: _cDBR, _smit: None}, + (_bI, _cT), + ((BROWSER_ID, 9), (CLIENT_TOKEN, {_sQ: _cT, _sT: None})), +) + +DELETE_BROWSER_OUTPUT: StaticSchema = ( + 18, + n0, + _DBO, + {_sSI: _cDBRo, _smith: None}, + (_bI, _st, _lUA), + ((BROWSER_ID, 1), (BROWSER_STATUS, 1), (DATE_TIMESTAMP, 1)), +) + +DELETE_BROWSER: StaticOperationSchema = ( + 23, + n0, + _DB, + { + _smithy: MappingProxyType( + {"code": 202, "method": "DELETE", "uri": "/browsers/{browserId}"} + ) + }, + DELETE_BROWSER_INPUT, + DELETE_BROWSER_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -PRIVATE_ENDPOINT_OVERRIDE_DOMAIN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PrivateEndpointOverrideDomain"), - shape_type=ShapeType.STRING, +GET_BROWSER_INPUT: StaticSchema = ( + 18, + n0, + _GBI, + {_sSI: _cGBR, _smit: None}, + (_bI,), + ((BROWSER_ID, 9),), +) + +BROWSER_SIGNING_CONFIG_OUTPUT: StaticSchema = ( + 18, + n0, + _BSCO, + 0, + (_en,), + ((2, {_smithya: False, _sm: None}),), +) + +GET_BROWSER_OUTPUT: StaticSchema = ( + 18, + n0, + _GBO, + {_sSI: _cGBRo, _smith: None}, + (_bI, _bAr, _n, _d, _eRA, _nC, _re, _bS, _ePn, _ce, _fC, _st, _fR, _cA, _lUA), + ( + (BROWSER_ID, 1), + (BROWSER_ARN, 1), + (SANDBOX_NAME, 1), + (DESCRIPTION, 0), + (ROLE_ARN, 0), + (BROWSER_NETWORK_CONFIGURATION, 1), + (RECORDING_CONFIG, 0), + (BROWSER_SIGNING_CONFIG_OUTPUT, 0), + (BROWSER_ENTERPRISE_POLICIES, 0), + (CERTIFICATES, 0), + (TOOLS_FILE_SYSTEM_CONFIGURATIONS, 0), + (BROWSER_STATUS, 1), + (3, 0), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + ), ) -PRIVATE_ENDPOINT_OVERRIDE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PrivateEndpointOverride"), - members={ - "domain": { - "target": PRIVATE_ENDPOINT_OVERRIDE_DOMAIN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "privateEndpoint": { - "target": PRIVATE_ENDPOINT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, +GET_BROWSER: StaticOperationSchema = ( + 23, + n0, + _GB, + { + _smithy: MappingProxyType( + {"code": 200, "method": "GET", "uri": "/browsers/{browserId}"} + ) }, + GET_BROWSER_INPUT, + GET_BROWSER_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + ), ) -PRIVATE_ENDPOINT_OVERRIDES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PrivateEndpointOverrides"), - shape_type=ShapeType.LIST, - members={"member": {"target": PRIVATE_ENDPOINT_OVERRIDE}}, -) - -CUSTOM_JWT_AUTHORIZER_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#CustomJWTAuthorizerConfiguration" - ), - members={ - "discoveryUrl": { - "target": DISCOVERY_URL, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "allowedAudience": {"target": ALLOWED_AUDIENCE_LIST}, - "allowedClients": {"target": ALLOWED_CLIENTS_LIST}, - "allowedScopes": {"target": ALLOWED_SCOPES_TYPE}, - "advertisedScopeMapping": {"target": ADVERTISED_SCOPE_MAPPING_TYPE}, - "customClaims": {"target": CUSTOM_CLAIM_VALIDATIONS_TYPE}, - "privateEndpoint": {"target": PRIVATE_ENDPOINT}, - "privateEndpointOverrides": {"target": PRIVATE_ENDPOINT_OVERRIDES}, - "allowedWorkloadConfiguration": {"target": ALLOWED_WORKLOAD_CONFIGURATION}, - }, +RESOURCE_TYPE: StaticSchema = ( + 14, + n0, + _RT, + 0, + (_SYSTEM, _CUSTOM), + ((-1, {_sVm: _SYSTEM}), (-1, {_sVm: _CUSTOM})), +) + +LIST_BROWSERS_INPUT: StaticSchema = ( + 18, + n0, + _LBI, + {_sSI: _cLBR, _smit: None}, + (_mR, _nT, _ty), + ((MAX_RESULTS, {_sQ: _mR}), (NEXT_TOKEN, {_sQ: _nT}), (RESOURCE_TYPE, {_sQ: _ty})), +) + +BROWSER_SUMMARY: StaticSchema = ( + 18, + n0, + _BSr, + 0, + (_bI, _bAr, _n, _d, _st, _cA, _lUA), + ( + (BROWSER_ID, 1), + (BROWSER_ARN, 1), + (SANDBOX_NAME, 0), + (DESCRIPTION, 0), + (BROWSER_STATUS, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 0), + ), ) -AUTHORIZER_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#AuthorizerConfiguration"), - shape_type=ShapeType.UNION, - members={"customJWTAuthorizer": {"target": CUSTOM_JWT_AUTHORIZER_CONFIGURATION}}, +BROWSER_SUMMARIES: StaticSchema = (16, n0, _BSro, 0, (_mem,), ((BROWSER_SUMMARY, 0),)) + +LIST_BROWSERS_OUTPUT: StaticSchema = ( + 18, + n0, + _LBO, + {_sSI: _cLBRo, _smith: None}, + (_bSr, _nT), + ((BROWSER_SUMMARIES, 1), (NEXT_TOKEN, 0)), +) + +LIST_BROWSERS: StaticOperationSchema = ( + 23, + n0, + _LB, + {_smithy: MappingProxyType({"code": 200, "method": "POST", "uri": "/browsers"})}, + LIST_BROWSERS_INPUT, + LIST_BROWSERS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CAPACITY_PROVIDER_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CapacityProviderArn"), - shape_type=ShapeType.STRING, -) +CAPACITY_PROVIDER_ID: StaticSchema = (3, n0, _CPI, 0) -CAPACITY_PROVIDER_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CapacityProviderConfiguration"), - members={ - "capacityProviderArn": { - "target": CAPACITY_PROVIDER_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +CAPACITY_RESERVATION_PREFERENCE: StaticSchema = ( + 14, + n0, + _CRP, + 0, + (_CRO, _OPEN, _NONE), + ((-1, {_sVm: _cro}), (-1, {_sVm: _o}), (-1, {_sVm: _no})), ) -DESCRIPTION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#Description"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +CAPACITY_RESERVATION_ID: StaticSchema = (3, n0, _CRI, 0) + +CAPACITY_RESERVATION_RESOURCE_GROUP_ARN: StaticSchema = (3, n0, _CRRGA, 0) + +CAPACITY_RESERVATION_TARGET: StaticSchema = ( + 18, + n0, + _CRT, + 0, + (_cRI, _cRRGA), + ((CAPACITY_RESERVATION_ID, 0), (CAPACITY_RESERVATION_RESOURCE_GROUP_ARN, 0)), ) -ENVIRONMENT_VARIABLE_KEY = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#EnvironmentVariableKey"), - shape_type=ShapeType.STRING, +CAPACITY_RESERVATION_SPECIFICATION: StaticSchema = ( + 18, + n0, + _CRS, + 0, + (_cRP, _cRT), + ((CAPACITY_RESERVATION_PREFERENCE, 0), (CAPACITY_RESERVATION_TARGET, 0)), ) -ENVIRONMENT_VARIABLE_VALUE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#EnvironmentVariableValue"), - shape_type=ShapeType.STRING, +DEVICE_NAME: StaticSchema = (3, n0, _DN, 0) + +EBS_CARD_INDEX: StaticSchema = (7, n0, _ECI, 0) + +VOLUME_IOPS: StaticSchema = (7, n0, _VIo, 0) + +KMS_KEY_ID: StaticSchema = (3, n0, _KKI, 0) + +EBS_SNAPSHOT_ID: StaticSchema = (3, n0, _ESI, 0) + +VOLUME_THROUGHPUT: StaticSchema = (7, n0, _VT, 0) + +EBS_VOLUME_INITIALIZATION_RATE: StaticSchema = (7, n0, _EVIR, 0) + +VOLUME_SIZE_GI_B: StaticSchema = (7, n0, _VSGB, 0) + +EBS_VOLUME_TYPE: StaticSchema = ( + 14, + n0, + _EVT, + 0, + (_STANDARD, _IO, _IO_, _GP, _SC, _ST, _GP_), + ( + (-1, {_sVm: _sta}), + (-1, {_sVm: _io}), + (-1, {_sVm: _io_}), + (-1, {_sVm: _g}), + (-1, {_sVm: _sc}), + (-1, {_sVm: _st_}), + (-1, {_sVm: _gp}), + ), ) -ENVIRONMENT_VARIABLES_MAP = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#EnvironmentVariablesMap"), - shape_type=ShapeType.MAP, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "key": {"target": ENVIRONMENT_VARIABLE_KEY}, - "value": {"target": ENVIRONMENT_VARIABLE_VALUE}, - }, +EPHEMERAL_EBS_VOLUME_CONFIGURATION: StaticSchema = ( + 18, + n0, + _EEBSVC, + 0, + (_vT, _iop, _th, _enc, _kKI, _sIn, _vS, _vIR, _eCI), + ( + (EBS_VOLUME_TYPE, {_smithya: _gp}), + (VOLUME_IOPS, 0), + (VOLUME_THROUGHPUT, 0), + (2, 0), + (KMS_KEY_ID, 0), + (EBS_SNAPSHOT_ID, 0), + (VOLUME_SIZE_GI_B, 0), + (EBS_VOLUME_INITIALIZATION_RATE, 0), + (EBS_CARD_INDEX, 0), + ), ) -MOUNT_PATH = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#MountPath"), - shape_type=ShapeType.STRING, +VIRTUAL_DEVICE_NAME: StaticSchema = (3, n0, _VDN, 0) + +EPHEMERAL_BLOCK_DEVICE_MAPPING: StaticSchema = ( + 18, + n0, + _EBDM, + 0, + (_dN, _vNi, _eb), + ( + (DEVICE_NAME, 0), + (VIRTUAL_DEVICE_NAME, 0), + (EPHEMERAL_EBS_VOLUME_CONFIGURATION, 0), + ), ) -CAPACITY_PROVIDER_VOLUME_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CapacityProviderVolumeName"), - shape_type=ShapeType.STRING, +EPHEMERAL_BLOCK_DEVICE_MAPPING_LIST: StaticSchema = ( + 16, + n0, + _EBDML, + 0, + (_mem,), + ((EPHEMERAL_BLOCK_DEVICE_MAPPING, 0),), +) + +INSTANCE_PROFILE_ARN: StaticSchema = (3, n0, _IPA, 0) + +EC2_INSTANCE_TYPE: StaticSchema = (3, n0, _ECIT, 0) + +INSTANCE_TYPE_LIST: StaticSchema = (16, n0, _ITL, 0, (_mem,), ((EC2_INSTANCE_TYPE, 0),)) + +INSTANCE_REQUIREMENTS: StaticSchema = ( + 18, + n0, + _IR, + 0, + (_aIT,), + ((INSTANCE_TYPE_LIST, 1),), +) + +LICENSE_CONFIGURATION_ARN: StaticSchema = (3, n0, _LCA, 0) + +LICENSE_SPECIFICATION: StaticSchema = ( + 18, + n0, + _LS, + 0, + (_lCA,), + ((LICENSE_CONFIGURATION_ARN, 1),), +) + +LICENSE_SPECIFICATION_LIST: StaticSchema = ( + 16, + n0, + _LSL, + 0, + (_mem,), + ((LICENSE_SPECIFICATION, 0),), +) + +MONITORING: StaticSchema = ( + 14, + n0, + _M, + 0, + (_BASIC, _DETAILED), + ((-1, {_sVm: _BASIC}), (-1, {_sVm: _DETAILED})), +) + +OPERATING_SYSTEM: StaticSchema = ( + 14, + n0, + _OS, + 0, + (_LX, _LA), + ((-1, {_sVm: _LX}), (-1, {_sVm: _LA})), +) + +SSH_KEY_NAME: StaticSchema = (3, n0, _SSHKN, 0) + +LAUNCH_PARAMETERS: StaticSchema = ( + 18, + n0, + _LP, + 0, + (_oS, _iR, _eVp, _mo, _lS, _cRS, _sKN, _iPA, _pT), + ( + (OPERATING_SYSTEM, 1), + (INSTANCE_REQUIREMENTS, 1), + (EPHEMERAL_BLOCK_DEVICE_MAPPING_LIST, 0), + (MONITORING, 0), + (LICENSE_SPECIFICATION_LIST, 0), + (CAPACITY_RESERVATION_SPECIFICATION, 0), + (SSH_KEY_NAME, 0), + (INSTANCE_PROFILE_ARN, 0), + (TAGS_MAP, 0), + ), ) -CAPACITY_PROVIDER_VOLUME_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#CapacityProviderVolumeConfiguration" +LAUNCH_TEMPLATE_SOURCE: StaticSchema = ( + 19, + n0, + _LTS, + 0, + (_lP,), + ((LAUNCH_PARAMETERS, 0),), +) + +INSTANCE_LIFECYCLE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _ILC, + 0, + (_iIT, _mL), + ((7, 0), (7, 0)), +) + +ROOT_VOLUME_CONFIGURATION: StaticSchema = ( + 18, + n0, + _RVC, + 0, + (_vT, _iop, _th, _enc, _kKI, _fSGB), + ( + (EBS_VOLUME_TYPE, {_smithya: _gp}), + (VOLUME_IOPS, 0), + (VOLUME_THROUGHPUT, 0), + (2, 0), + (KMS_KEY_ID, 0), + (VOLUME_SIZE_GI_B, 0), ), - members={ - "volumeName": { - "target": CAPACITY_PROVIDER_VOLUME_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "mountPath": { - "target": MOUNT_PATH, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, ) -EFS_ACCESS_POINT_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#EfsAccessPointArn"), - shape_type=ShapeType.STRING, +VOLUME_NAME: StaticSchema = (3, n0, _VN, 0) + +EBS_VOLUME_CONFIGURATION: StaticSchema = ( + 18, + n0, + _EVC, + 0, + (_n, _sGB, _vT, _iop, _th, _enc, _kKI, _sIn), + ( + (VOLUME_NAME, 1), + (VOLUME_SIZE_GI_B, 1), + (EBS_VOLUME_TYPE, {_smithya: _gp}), + (VOLUME_IOPS, 0), + (VOLUME_THROUGHPUT, 0), + (2, 0), + (KMS_KEY_ID, 0), + (EBS_SNAPSHOT_ID, 0), + ), ) -EFS_ACCESS_POINT_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#EfsAccessPointConfiguration"), - members={ - "accessPointArn": { - "target": EFS_ACCESS_POINT_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "mountPath": { - "target": MOUNT_PATH, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +VOLUME_CONFIGURATION: StaticSchema = ( + 19, + n0, + _VCo, + 0, + (_eCb,), + ((EBS_VOLUME_CONFIGURATION, 0),), +) + +VOLUME_CONFIGURATION_LIST: StaticSchema = ( + 16, + n0, + _VCL, + 0, + (_mem,), + ((VOLUME_CONFIGURATION, 0),), +) + +SECURITY_GROUP_ID_LIST: StaticSchema = ( + 16, + n0, + _SGIL, + 0, + (_mem,), + ((SECURITY_GROUP_ID, 0),), +) + +SUBNET_ID_LIST: StaticSchema = (16, n0, _SIL, 0, (_mem,), ((SUBNET_ID, 0),)) + +VPC_CONFIGURATION: StaticSchema = ( + 18, + n0, + _VCp, + 0, + (_su, _sG), + ((SUBNET_ID_LIST, 1), (SECURITY_GROUP_ID_LIST, 1)), +) + +EC2_CONFIGURATION: StaticSchema = ( + 18, + n0, + _ECc, + 0, + (_lTS, _vCp, _vo, _lC, _rV), + ( + (LAUNCH_TEMPLATE_SOURCE, 1), + (VPC_CONFIGURATION, 1), + (VOLUME_CONFIGURATION_LIST, 0), + (INSTANCE_LIFECYCLE_CONFIGURATION, 0), + (ROOT_VOLUME_CONFIGURATION, 0), + ), ) -S3_FILES_ACCESS_POINT_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#S3FilesAccessPointArn"), - shape_type=ShapeType.STRING, +COMPUTE_CONFIGURATION: StaticSchema = ( + 19, + n0, + _CCom, + 0, + (_eCc,), + ((EC2_CONFIGURATION, 0),), +) + +CAPACITY_PROVIDER_NAME: StaticSchema = (3, n0, _CPNa, 0) + +PERMISSIONS_CONFIGURATION: StaticSchema = (18, n0, _PCe, 0, (_cPORA,), ((ROLE_ARN, 1),)) + +CREATE_CAPACITY_PROVIDER_INPUT: StaticSchema = ( + 18, + n0, + _CCPI, + {_smit: None}, + (_n, _d, _pCe, _cT, _t, _cCom), + ( + (CAPACITY_PROVIDER_NAME, 1), + (DESCRIPTION, 0), + (PERMISSIONS_CONFIGURATION, 1), + (CLIENT_TOKEN, 2), + (TAGS_MAP, 0), + (COMPUTE_CONFIGURATION, 1), + ), ) -S3_FILES_ACCESS_POINT_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#S3FilesAccessPointConfiguration"), - members={ - "accessPointArn": { - "target": S3_FILES_ACCESS_POINT_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "mountPath": { - "target": MOUNT_PATH, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +CAPACITY_PROVIDER_STATUS: StaticSchema = ( + 14, + n0, + _CPS, + 0, + (_CREATING, _CF, _UPDATING, _UF, _READY, _DELETING, _DF), + ( + (-1, {_sVm: _CREATING}), + (-1, {_sVm: _CF}), + (-1, {_sVm: _UPDATING}), + (-1, {_sVm: _UF}), + (-1, {_sVm: _READY}), + (-1, {_sVm: _DELETING}), + (-1, {_sVm: _DF}), + ), ) -SESSION_STORAGE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SessionStorageConfiguration"), - members={ - "mountPath": { - "target": MOUNT_PATH, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +CREATE_CAPACITY_PROVIDER_OUTPUT: StaticSchema = ( + 18, + n0, + _CCPO, + {_smith: None}, + (_cPI, _cPA, _n, _st), + ( + (CAPACITY_PROVIDER_ID, 1), + (CAPACITY_PROVIDER_ARN, 1), + (CAPACITY_PROVIDER_NAME, 1), + (CAPACITY_PROVIDER_STATUS, 1), + ), ) -FILESYSTEM_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#FilesystemConfiguration"), - shape_type=ShapeType.UNION, - members={ - "sessionStorage": {"target": SESSION_STORAGE_CONFIGURATION}, - "s3FilesAccessPoint": {"target": S3_FILES_ACCESS_POINT_CONFIGURATION}, - "efsAccessPoint": {"target": EFS_ACCESS_POINT_CONFIGURATION}, - "capacityProviderVolume": {"target": CAPACITY_PROVIDER_VOLUME_CONFIGURATION}, - }, +RETRYABLE_CONFLICT_EXCEPTION: StaticSchema = ( + 18, + n0, + _RCE, + {_s: _c, _sE: 409}, + (_m,), + ((3, 1),), +) + +CREATE_CAPACITY_PROVIDER: StaticOperationSchema = ( + 23, + n0, + _CCP, + { + _smithy: MappingProxyType( + {"method": "PUT", "uri": "/capacity-providers", "code": 202} + ) + }, + CREATE_CAPACITY_PROVIDER_INPUT, + CREATE_CAPACITY_PROVIDER_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + RETRYABLE_CONFLICT_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -FILESYSTEM_CONFIGURATIONS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#FilesystemConfigurations"), - shape_type=ShapeType.LIST, - members={"member": {"target": FILESYSTEM_CONFIGURATION}}, +DELETE_CAPACITY_PROVIDER_INPUT: StaticSchema = ( + 18, + n0, + _DCPI, + {_smit: None}, + (_cPI, _cT), + ((CAPACITY_PROVIDER_ID, 9), (CLIENT_TOKEN, {_sQ: _cT, _sT: None})), +) + +DELETE_CAPACITY_PROVIDER_OUTPUT: StaticSchema = ( + 18, + n0, + _DCPO, + {_smith: None}, + (_cPI, _st), + ((CAPACITY_PROVIDER_ID, 1), (CAPACITY_PROVIDER_STATUS, 1)), +) + +DELETE_CAPACITY_PROVIDER: StaticOperationSchema = ( + 23, + n0, + _DCP, + { + _smithy: MappingProxyType( + { + "method": "DELETE", + "uri": "/capacity-providers/{capacityProviderId}", + "code": 202, + } + ) + }, + DELETE_CAPACITY_PROVIDER_INPUT, + DELETE_CAPACITY_PROVIDER_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + RETRYABLE_CONFLICT_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -LIFECYCLE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#LifecycleConfiguration"), - members={ - "idleRuntimeSessionTimeout": {"target": INTEGER}, - "maxLifetime": {"target": INTEGER}, - }, +GET_CAPACITY_PROVIDER_INPUT: StaticSchema = ( + 18, + n0, + _GCPI, + {_smit: None}, + (_cPI,), + ((CAPACITY_PROVIDER_ID, 9),), +) + +CAPACITY_PROVIDER_STATUS_CODE: StaticSchema = ( + 14, + n0, + _CPSC, + 0, + (_VE_, _QE, _THROTTLED, _ISE_), + ( + (-1, {_sVm: _VE_}), + (-1, {_sVm: _QE}), + (-1, {_sVm: _THROTTLED}), + (-1, {_sVm: _ISE_}), + ), ) -NETWORK_MODE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#NetworkMode"), - shape_type=ShapeType.ENUM, - members={"PUBLIC": {"target": UNIT}, "VPC": {"target": UNIT}}, +GET_CAPACITY_PROVIDER_OUTPUT: StaticSchema = ( + 18, + n0, + _GCPO, + {_smith: None}, + (_cPI, _cPA, _n, _st, _d, _sC, _sRt, _pCe, _cCom, _cA, _lUA), + ( + (CAPACITY_PROVIDER_ID, 1), + (CAPACITY_PROVIDER_ARN, 1), + (CAPACITY_PROVIDER_NAME, 1), + (CAPACITY_PROVIDER_STATUS, 1), + (DESCRIPTION, 0), + (CAPACITY_PROVIDER_STATUS_CODE, 0), + (3, 0), + (PERMISSIONS_CONFIGURATION, 1), + (COMPUTE_CONFIGURATION, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + ), ) -SECURITY_GROUP_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SecurityGroupId"), - shape_type=ShapeType.STRING, +GET_CAPACITY_PROVIDER: StaticOperationSchema = ( + 23, + n0, + _GCP, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/capacity-providers/{capacityProviderId}", + "code": 200, + } + ) + }, + GET_CAPACITY_PROVIDER_INPUT, + GET_CAPACITY_PROVIDER_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -SECURITY_GROUPS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SecurityGroups"), - shape_type=ShapeType.LIST, - members={"member": {"target": SECURITY_GROUP_ID}}, +LIST_AGENT_RUNTIME_VERSIONS_BY_CAPACITY_PROVIDER_INPUT: StaticSchema = ( + 18, + n0, + _LARVBCPI, + {_smit: None}, + (_cPI, _mR, _nT), + ((CAPACITY_PROVIDER_ID, 9), (MAX_RESULTS, {_sQ: _mR}), (NEXT_TOKEN, {_sQ: _nT})), +) + +LIST_AGENT_RUNTIME_VERSIONS_BY_CAPACITY_PROVIDER_OUTPUT: StaticSchema = ( + 18, + n0, + _LARVBCPO, + {_smith: None}, + (_aR, _nT), + ((AGENT_RUNTIME_VERSION_SUMMARY_LIST, 1), (3, 0)), +) + +LIST_AGENT_RUNTIME_VERSIONS_BY_CAPACITY_PROVIDER: StaticOperationSchema = ( + 23, + n0, + _LARVBCP, + { + _smithy: MappingProxyType( + { + "method": "POST", + "uri": "/capacity-providers/{capacityProviderId}/runtime-versions", + "code": 200, + } + ) + }, + LIST_AGENT_RUNTIME_VERSIONS_BY_CAPACITY_PROVIDER_INPUT, + LIST_AGENT_RUNTIME_VERSIONS_BY_CAPACITY_PROVIDER_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -SUBNETS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#Subnets"), - shape_type=ShapeType.LIST, - members={"member": {"target": SUBNET_ID}}, +LIST_CAPACITY_PROVIDERS_INPUT: StaticSchema = ( + 18, + n0, + _LCPI, + {_smit: None}, + (_mR, _nT), + ((MAX_RESULTS, {_sQ: _mR}), (NEXT_TOKEN, {_sQ: _nT})), +) + +CAPACITY_PROVIDER_SUMMARY: StaticSchema = ( + 18, + n0, + _CPSa, + 0, + (_cPI, _cPA, _n, _st, _lUA), + ( + (CAPACITY_PROVIDER_ID, 1), + (CAPACITY_PROVIDER_ARN, 1), + (CAPACITY_PROVIDER_NAME, 1), + (CAPACITY_PROVIDER_STATUS, 1), + (4, 1), + ), ) -VPC_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#VpcConfig"), - members={ - "securityGroups": { - "target": SECURITY_GROUPS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "subnets": { - "target": SUBNETS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "requireServiceS3Endpoint": {"target": BOOLEAN}, - }, +CAPACITY_PROVIDER_LIST: StaticSchema = ( + 16, + n0, + _CPL, + 0, + (_mem,), + ((CAPACITY_PROVIDER_SUMMARY, 0),), +) + +LIST_CAPACITY_PROVIDERS_OUTPUT: StaticSchema = ( + 18, + n0, + _LCPO, + {_smith: None}, + (_cPa, _nT), + ((CAPACITY_PROVIDER_LIST, 1), (NEXT_TOKEN, 0)), +) + +LIST_CAPACITY_PROVIDERS: StaticOperationSchema = ( + 23, + n0, + _LCP, + { + _smithy: MappingProxyType( + {"method": "POST", "uri": "/capacity-providers", "code": 200} + ) + }, + LIST_CAPACITY_PROVIDERS_INPUT, + LIST_CAPACITY_PROVIDERS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -NETWORK_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#NetworkConfiguration"), - members={ - "networkMode": { - "target": NETWORK_MODE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "networkModeConfig": {"target": VPC_CONFIG}, - }, +UPDATED_DESCRIPTION: StaticSchema = (18, n0, _UD, 0, (_oV,), ((DESCRIPTION, 0),)) + +UPDATE_CAPACITY_PROVIDER_INPUT: StaticSchema = ( + 18, + n0, + _UCPI, + {_smit: None}, + (_cPI, _d, _cT), + ((CAPACITY_PROVIDER_ID, 9), (UPDATED_DESCRIPTION, 0), (CLIENT_TOKEN, 2)), +) + +UPDATE_CAPACITY_PROVIDER_OUTPUT: StaticSchema = ( + 18, + n0, + _UCPO, + {_smith: None}, + (_cPI, _cPA, _n, _st, _cA, _lUA), + ( + (CAPACITY_PROVIDER_ID, 1), + (CAPACITY_PROVIDER_ARN, 1), + (CAPACITY_PROVIDER_NAME, 1), + (CAPACITY_PROVIDER_STATUS, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + ), ) -PLATFORM_VERSION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PlatformVersion"), - shape_type=ShapeType.STRING, +UPDATE_CAPACITY_PROVIDER: StaticOperationSchema = ( + 23, + n0, + _UCP, + { + _smithy: MappingProxyType( + { + "method": "PUT", + "uri": "/capacity-providers/{capacityProviderId}", + "code": 202, + } + ) + }, + UPDATE_CAPACITY_PROVIDER_INPUT, + UPDATE_CAPACITY_PROVIDER_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + RETRYABLE_CONFLICT_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -SERVER_PROTOCOL = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ServerProtocol"), - shape_type=ShapeType.ENUM, - members={ - "MCP": {"target": UNIT}, - "HTTP": {"target": UNIT}, - "A2A": {"target": UNIT}, - "AGUI": {"target": UNIT}, - }, +CODE_INTERPRETER_ID: StaticSchema = (3, n0, _CII, 0) + +CODE_INTERPRETER_NETWORK_MODE: StaticSchema = ( + 14, + n0, + _CINM, + 0, + (_PUBLIC, _SANDBOX, _VPC), + ((-1, {_sVm: _PUBLIC}), (-1, {_sVm: _SANDBOX}), (-1, {_sVm: _VPC})), +) + +CODE_INTERPRETER_NETWORK_CONFIGURATION: StaticSchema = ( + 18, + n0, + _CINC, + 0, + (_nM, _vC), + ((CODE_INTERPRETER_NETWORK_MODE, {_smithya: _SANDBOX, _sm: None}), (VPC_CONFIG, 0)), +) + +CREATE_CODE_INTERPRETER_INPUT: StaticSchema = ( + 18, + n0, + _CCII, + {_sSI: _cCCIR, _smit: None}, + (_n, _d, _eRA, _nC, _ce, _fC, _cT, _t), + ( + (SANDBOX_NAME, 1), + (DESCRIPTION, 0), + (ROLE_ARN, 0), + (CODE_INTERPRETER_NETWORK_CONFIGURATION, 1), + (CERTIFICATES, 0), + (TOOLS_FILE_SYSTEM_CONFIGURATIONS, 0), + (CLIENT_TOKEN, 2), + (TAGS_MAP, 0), + ), ) -PROTOCOL_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ProtocolConfiguration"), - members={ - "serverProtocol": { - "target": SERVER_PROTOCOL, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +CODE_INTERPRETER_ARN: StaticSchema = (3, n0, _CIA, 0) + +CODE_INTERPRETER_STATUS: StaticSchema = ( + 14, + n0, + _CIS, + 0, + (_CREATING, _CF, _READY, _DELETING, _DF, _DELETED), + ( + (-1, {_sVm: _CREATING}), + (-1, {_sVm: _CF}), + (-1, {_sVm: _READY}), + (-1, {_sVm: _DELETING}), + (-1, {_sVm: _DF}), + (-1, {_sVm: _DELETED}), + ), ) -HEADER_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HeaderName"), - shape_type=ShapeType.STRING, +CREATE_CODE_INTERPRETER_OUTPUT: StaticSchema = ( + 18, + n0, + _CCIO, + {_sSI: _cCCIRo, _smith: None}, + (_cII, _cIA, _cA, _st), + ( + (CODE_INTERPRETER_ID, 1), + (CODE_INTERPRETER_ARN, 1), + (DATE_TIMESTAMP, 1), + (CODE_INTERPRETER_STATUS, 1), + ), ) -REQUEST_HEADER_ALLOWLIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#RequestHeaderAllowlist"), - shape_type=ShapeType.LIST, - members={"member": {"target": HEADER_NAME}}, +CREATE_CODE_INTERPRETER: StaticOperationSchema = ( + 23, + n0, + _CCI, + { + _smithy: MappingProxyType( + {"code": 202, "method": "PUT", "uri": "/code-interpreters"} + ) + }, + CREATE_CODE_INTERPRETER_INPUT, + CREATE_CODE_INTERPRETER_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -REQUEST_HEADER_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#RequestHeaderConfiguration"), - shape_type=ShapeType.UNION, - members={"requestHeaderAllowlist": {"target": REQUEST_HEADER_ALLOWLIST}}, +DELETE_CODE_INTERPRETER_INPUT: StaticSchema = ( + 18, + n0, + _DCII, + {_sSI: _cDCIR, _smit: None}, + (_cII, _cT), + ((CODE_INTERPRETER_ID, 9), (CLIENT_TOKEN, {_sQ: _cT, _sT: None})), +) + +DELETE_CODE_INTERPRETER_OUTPUT: StaticSchema = ( + 18, + n0, + _DCIO, + {_sSI: _cDCIRo, _smith: None}, + (_cII, _st, _lUA), + ((CODE_INTERPRETER_ID, 1), (CODE_INTERPRETER_STATUS, 1), (DATE_TIMESTAMP, 1)), +) + +DELETE_CODE_INTERPRETER: StaticOperationSchema = ( + 23, + n0, + _DCI, + { + _smithy: MappingProxyType( + { + "code": 202, + "method": "DELETE", + "uri": "/code-interpreters/{codeInterpreterId}", + } + ) + }, + DELETE_CODE_INTERPRETER_INPUT, + DELETE_CODE_INTERPRETER_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -ROLE_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#RoleArn"), - shape_type=ShapeType.STRING, +GET_CODE_INTERPRETER_INPUT: StaticSchema = ( + 18, + n0, + _GCII, + {_sSI: _cGCIR, _smit: None}, + (_cII,), + ((CODE_INTERPRETER_ID, 9),), +) + +GET_CODE_INTERPRETER_OUTPUT: StaticSchema = ( + 18, + n0, + _GCIO, + {_sSI: _cGCIRo, _smith: None}, + (_cII, _cIA, _n, _d, _eRA, _nC, _st, _ce, _fC, _fR, _cA, _lUA), + ( + (CODE_INTERPRETER_ID, 1), + (CODE_INTERPRETER_ARN, 1), + (SANDBOX_NAME, 1), + (DESCRIPTION, 0), + (ROLE_ARN, 0), + (CODE_INTERPRETER_NETWORK_CONFIGURATION, 1), + (CODE_INTERPRETER_STATUS, 1), + (CERTIFICATES, 0), + (TOOLS_FILE_SYSTEM_CONFIGURATIONS, 0), + (3, 0), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + ), ) -CREATE_AGENT_RUNTIME_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateAgentRuntimeInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreateAgentRuntimeRequest", - ) - ], - members={ - "agentRuntimeName": { - "target": AGENT_RUNTIME_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentRuntimeArtifact": { - "target": AGENT_RUNTIME_ARTIFACT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "roleArn": { - "target": ROLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "networkConfiguration": {"target": NETWORK_CONFIGURATION}, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "description": {"target": DESCRIPTION}, - "authorizerConfiguration": {"target": AUTHORIZER_CONFIGURATION}, - "requestHeaderConfiguration": {"target": REQUEST_HEADER_CONFIGURATION}, - "protocolConfiguration": {"target": PROTOCOL_CONFIGURATION}, - "lifecycleConfiguration": {"target": LIFECYCLE_CONFIGURATION}, - "environmentVariables": {"target": ENVIRONMENT_VARIABLES_MAP}, - "filesystemConfigurations": {"target": FILESYSTEM_CONFIGURATIONS}, - "capacityProviderConfiguration": {"target": CAPACITY_PROVIDER_CONFIGURATION}, - "tags": {"target": TAGS_MAP}, - "platformVersion": {"target": PLATFORM_VERSION}, - }, +GET_CODE_INTERPRETER: StaticOperationSchema = ( + 23, + n0, + _GCI, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "GET", + "uri": "/code-interpreters/{codeInterpreterId}", + } + ) + }, + GET_CODE_INTERPRETER_INPUT, + GET_CODE_INTERPRETER_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + ), ) -AGENT_RUNTIME_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#AgentRuntimeStatus"), - shape_type=ShapeType.ENUM, - members={ - "CREATING": {"target": UNIT}, - "CREATE_FAILED": {"target": UNIT}, - "UPDATING": {"target": UNIT}, - "UPDATE_FAILED": {"target": UNIT}, - "READY": {"target": UNIT}, - "DELETING": {"target": UNIT}, - "DELETE_FAILED": {"target": UNIT}, - }, +LIST_CODE_INTERPRETERS_INPUT: StaticSchema = ( + 18, + n0, + _LCII, + {_sSI: _cLCIR, _smit: None}, + (_mR, _nT, _ty), + ((MAX_RESULTS, {_sQ: _mR}), (NEXT_TOKEN, {_sQ: _nT}), (RESOURCE_TYPE, {_sQ: _ty})), +) + +CODE_INTERPRETER_SUMMARY: StaticSchema = ( + 18, + n0, + _CISo, + 0, + (_cII, _cIA, _n, _d, _st, _cA, _lUA), + ( + (CODE_INTERPRETER_ID, 1), + (CODE_INTERPRETER_ARN, 1), + (SANDBOX_NAME, 0), + (DESCRIPTION, 0), + (CODE_INTERPRETER_STATUS, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 0), + ), ) -WORKLOAD_IDENTITY_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#WorkloadIdentityArn"), - shape_type=ShapeType.STRING, +CODE_INTERPRETER_SUMMARIES: StaticSchema = ( + 16, + n0, + _CISod, + 0, + (_mem,), + ((CODE_INTERPRETER_SUMMARY, 0),), +) + +LIST_CODE_INTERPRETERS_OUTPUT: StaticSchema = ( + 18, + n0, + _LCIO, + {_sSI: _cLCIRo, _smith: None}, + (_cIS, _nT), + ((CODE_INTERPRETER_SUMMARIES, 1), (NEXT_TOKEN, 0)), +) + +LIST_CODE_INTERPRETERS: StaticOperationSchema = ( + 23, + n0, + _LCI, + { + _smithy: MappingProxyType( + {"code": 200, "method": "POST", "uri": "/code-interpreters"} + ) + }, + LIST_CODE_INTERPRETERS_INPUT, + LIST_CODE_INTERPRETERS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -WORKLOAD_IDENTITY_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#WorkloadIdentityDetails"), - members={ - "workloadIdentityArn": { - "target": WORKLOAD_IDENTITY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +CONFIGURATION_BUNDLE_ID: StaticSchema = (3, n0, _CBIo, 0) -CREATE_AGENT_RUNTIME_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateAgentRuntimeOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreateAgentRuntimeResponse", - ) - ], - members={ - "agentRuntimeArn": { - "target": AGENT_RUNTIME_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "workloadIdentityDetails": {"target": WORKLOAD_IDENTITY_DETAILS}, - "agentRuntimeId": { - "target": AGENT_RUNTIME_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentRuntimeVersion": { - "target": AGENT_RUNTIME_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": AGENT_RUNTIME_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +BRANCH_NAME: StaticSchema = (3, n0, _BN, 0) -CREATE_AGENT_RUNTIME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateAgentRuntime"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType({"code": 202, "method": "PUT", "uri": "/runtimes/"}), - ) - ], -) +CONFIGURATION_BUNDLE_NAME: StaticSchema = (3, n0, _CBN, 0) -DELETE_AGENT_RUNTIME_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteAgentRuntimeInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeleteAgentRuntimeRequest", - ) - ], - members={ - "agentRuntimeId": { - "target": AGENT_RUNTIME_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "agentRuntimeVersion": { - "target": AGENT_RUNTIME_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="version")], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#idempotencyToken")), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="clientToken"), - ], - }, - }, -) +COMPONENT_IDENTIFIER: StaticSchema = (3, n0, _CI, 0) -DELETE_AGENT_RUNTIME_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteAgentRuntimeOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeleteAgentRuntimeResponse", - ) - ], - members={ - "status": { - "target": AGENT_RUNTIME_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentRuntimeId": {"target": AGENT_RUNTIME_ID}, - "agentRuntimeVersion": {"target": AGENT_RUNTIME_VERSION}, - }, -) +COMPONENT_CONFIGURATION: StaticSchema = (18, n0, _CComp, 4, (_con,), ((13, 1),)) -DELETE_AGENT_RUNTIME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteAgentRuntime"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 202, "method": "DELETE", "uri": "/runtimes/{agentRuntimeId}/"} - ), - ) - ], +COMPONENT_CONFIGURATION_MAP: StaticSchema = ( + 17, + n0, + _CCM, + 0, + (_k, _v), + ((COMPONENT_IDENTIFIER, 0), (COMPONENT_CONFIGURATION, 0)), ) -GET_AGENT_RUNTIME_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetAgentRuntimeInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetAgentRuntimeRequest", - ) - ], - members={ - "agentRuntimeId": { - "target": AGENT_RUNTIME_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "agentRuntimeVersion": { - "target": AGENT_RUNTIME_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="version")], - }, - }, -) +VERSION_CREATED_BY_SOURCE: StaticSchema = (18, n0, _VCBS, 0, (_n, _a), ((3, 1), (3, 0))) -RUNTIME_METADATA_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#RuntimeMetadataConfiguration"), - members={ - "requireMMDSV2": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +CONFIGURATION_BUNDLE_DESCRIPTION: StaticSchema = (3, n0, _CBD, 4) -GET_AGENT_RUNTIME_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetAgentRuntimeOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetAgentRuntimeResponse", - ) - ], - members={ - "agentRuntimeArn": { - "target": AGENT_RUNTIME_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentRuntimeName": { - "target": AGENT_RUNTIME_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentRuntimeId": { - "target": AGENT_RUNTIME_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentRuntimeVersion": { - "target": AGENT_RUNTIME_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastUpdatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "roleArn": { - "target": ROLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "networkConfiguration": {"target": NETWORK_CONFIGURATION}, - "status": { - "target": AGENT_RUNTIME_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lifecycleConfiguration": { - "target": LIFECYCLE_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "failureReason": {"target": _STRING}, - "description": {"target": DESCRIPTION}, - "workloadIdentityDetails": {"target": WORKLOAD_IDENTITY_DETAILS}, - "agentRuntimeArtifact": {"target": AGENT_RUNTIME_ARTIFACT}, - "protocolConfiguration": {"target": PROTOCOL_CONFIGURATION}, - "environmentVariables": {"target": ENVIRONMENT_VARIABLES_MAP}, - "authorizerConfiguration": {"target": AUTHORIZER_CONFIGURATION}, - "requestHeaderConfiguration": {"target": REQUEST_HEADER_CONFIGURATION}, - "metadataConfiguration": {"target": RUNTIME_METADATA_CONFIGURATION}, - "filesystemConfigurations": {"target": FILESYSTEM_CONFIGURATIONS}, - "capacityProviderConfiguration": {"target": CAPACITY_PROVIDER_CONFIGURATION}, - "platformVersion": {"target": PLATFORM_VERSION}, - }, -) +KMS_KEY_ARN: StaticSchema = (3, n0, _KKA, 0) -GET_AGENT_RUNTIME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetAgentRuntime"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "GET", "uri": "/runtimes/{agentRuntimeId}/"} - ), - ) - ], +CREATE_CONFIGURATION_BUNDLE_INPUT: StaticSchema = ( + 18, + n0, + _CCBI, + {_sSI: _cCCBR, _smit: None}, + (_cT, _bN, _d, _com, _bNr, _cM, _cBr, _kKA, _t), + ( + (CLIENT_TOKEN, 2), + (CONFIGURATION_BUNDLE_NAME, 1), + (CONFIGURATION_BUNDLE_DESCRIPTION, 0), + (COMPONENT_CONFIGURATION_MAP, 1), + (BRANCH_NAME, 0), + (3, 0), + (VERSION_CREATED_BY_SOURCE, 0), + (KMS_KEY_ARN, 0), + (TAGS_MAP, 0), + ), ) -LIST_AGENT_RUNTIMES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListAgentRuntimesInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListAgentRuntimesRequest", - ) - ], - members={ - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - }, -) +CONFIGURATION_BUNDLE_ARN: StaticSchema = (3, n0, _CBAo, 0) -AGENT_RUNTIME = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#AgentRuntime"), - members={ - "agentRuntimeArn": { - "target": AGENT_RUNTIME_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentRuntimeId": { - "target": AGENT_RUNTIME_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentRuntimeVersion": { - "target": AGENT_RUNTIME_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentRuntimeName": { - "target": AGENT_RUNTIME_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": { - "target": DESCRIPTION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastUpdatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": AGENT_RUNTIME_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +CONFIGURATION_BUNDLE_VERSION: StaticSchema = (3, n0, _CBV, 0) -AGENT_RUNTIMES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#AgentRuntimes"), - shape_type=ShapeType.LIST, - members={"member": {"target": AGENT_RUNTIME}}, +CREATE_CONFIGURATION_BUNDLE_OUTPUT: StaticSchema = ( + 18, + n0, + _CCBO, + {_sSI: _cCCBRo, _smith: None}, + (_bA, _bIu, _vI, _cA), + ( + (CONFIGURATION_BUNDLE_ARN, 1), + (CONFIGURATION_BUNDLE_ID, 1), + (CONFIGURATION_BUNDLE_VERSION, 1), + (4, 1), + ), ) -LIST_AGENT_RUNTIMES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListAgentRuntimesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListAgentRuntimesResponse", - ) - ], - members={ - "agentRuntimes": { - "target": AGENT_RUNTIMES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": NEXT_TOKEN}, - }, +CREATE_CONFIGURATION_BUNDLE: StaticOperationSchema = ( + 23, + n0, + _CCB, + { + _smithy: MappingProxyType( + {"method": "POST", "uri": "/configuration-bundles/create", "code": 201} + ) + }, + CREATE_CONFIGURATION_BUNDLE_INPUT, + CREATE_CONFIGURATION_BUNDLE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -LIST_AGENT_RUNTIMES = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListAgentRuntimes"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "POST", "uri": "/runtimes/"} - ), - ) - ], +DELETE_CONFIGURATION_BUNDLE_INPUT: StaticSchema = ( + 18, + n0, + _DCBI, + {_sSI: _cDCBR, _smit: None}, + (_bIu,), + ((CONFIGURATION_BUNDLE_ID, 9),), +) + +CONFIGURATION_BUNDLE_STATUS: StaticSchema = ( + 14, + n0, + _CBS, + 0, + (_ACTIVE, _CREATING, _CF, _UPDATING, _UF, _DELETING, _DF), + ( + (-1, {_sVm: _ACTIVE}), + (-1, {_sVm: _CREATING}), + (-1, {_sVm: _CF}), + (-1, {_sVm: _UPDATING}), + (-1, {_sVm: _UF}), + (-1, {_sVm: _DELETING}), + (-1, {_sVm: _DF}), + ), ) -LIST_AGENT_RUNTIME_VERSIONS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListAgentRuntimeVersionsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListAgentRuntimeVersionsRequest", - ) - ], - members={ - "agentRuntimeId": { - "target": AGENT_RUNTIME_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - }, +DELETE_CONFIGURATION_BUNDLE_OUTPUT: StaticSchema = ( + 18, + n0, + _DCBO, + {_sSI: _cDCBRo, _smith: None}, + (_bA, _bIu, _st), + ( + (CONFIGURATION_BUNDLE_ARN, 1), + (CONFIGURATION_BUNDLE_ID, 1), + (CONFIGURATION_BUNDLE_STATUS, 1), + ), ) -LIST_AGENT_RUNTIME_VERSIONS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListAgentRuntimeVersionsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListAgentRuntimeVersionsResponse", - ) - ], - members={ - "agentRuntimes": { - "target": AGENT_RUNTIMES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": NEXT_TOKEN}, - }, +DELETE_CONFIGURATION_BUNDLE: StaticOperationSchema = ( + 23, + n0, + _DCB, + { + _smithy: MappingProxyType( + { + "method": "DELETE", + "uri": "/configuration-bundles/{bundleId}", + "code": 202, + } + ) + }, + DELETE_CONFIGURATION_BUNDLE_INPUT, + DELETE_CONFIGURATION_BUNDLE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -LIST_AGENT_RUNTIME_VERSIONS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListAgentRuntimeVersions"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "POST", - "uri": "/runtimes/{agentRuntimeId}/versions/", - } - ), - ) - ], +GET_CONFIGURATION_BUNDLE_INPUT: StaticSchema = ( + 18, + n0, + _GCBI, + {_sSI: _cGCBR, _smit: None}, + (_bIu, _bNr), + ((CONFIGURATION_BUNDLE_ID, 9), (BRANCH_NAME, {_sQ: _bNr})), +) + +CONFIGURATION_BUNDLE_VERSION_LIST: StaticSchema = ( + 16, + n0, + _CBVL, + 0, + (_mem,), + ((CONFIGURATION_BUNDLE_VERSION, 0),), +) + +VERSION_LINEAGE_METADATA: StaticSchema = ( + 18, + n0, + _VLM, + 0, + (_pVI, _bNr, _cBr, _cM), + ( + (CONFIGURATION_BUNDLE_VERSION_LIST, 0), + (BRANCH_NAME, 0), + (VERSION_CREATED_BY_SOURCE, 0), + (3, 0), + ), ) -UPDATE_AGENT_RUNTIME_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateAgentRuntimeInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UpdateAgentRuntimeRequest", - ) - ], - members={ - "agentRuntimeId": { - "target": AGENT_RUNTIME_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "agentRuntimeArtifact": { - "target": AGENT_RUNTIME_ARTIFACT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "roleArn": { - "target": ROLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "networkConfiguration": {"target": NETWORK_CONFIGURATION}, - "description": {"target": DESCRIPTION}, - "authorizerConfiguration": {"target": AUTHORIZER_CONFIGURATION}, - "requestHeaderConfiguration": {"target": REQUEST_HEADER_CONFIGURATION}, - "protocolConfiguration": {"target": PROTOCOL_CONFIGURATION}, - "lifecycleConfiguration": {"target": LIFECYCLE_CONFIGURATION}, - "metadataConfiguration": {"target": RUNTIME_METADATA_CONFIGURATION}, - "environmentVariables": {"target": ENVIRONMENT_VARIABLES_MAP}, - "filesystemConfigurations": {"target": FILESYSTEM_CONFIGURATIONS}, - "capacityProviderConfiguration": {"target": CAPACITY_PROVIDER_CONFIGURATION}, - "platformVersion": {"target": PLATFORM_VERSION}, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - }, +GET_CONFIGURATION_BUNDLE_OUTPUT: StaticSchema = ( + 18, + n0, + _GCBO, + {_sSI: _cGCBRo, _smith: None}, + (_bA, _bIu, _bN, _d, _vI, _com, _lM, _cA, _uA, _kKA), + ( + (CONFIGURATION_BUNDLE_ARN, 1), + (CONFIGURATION_BUNDLE_ID, 1), + (CONFIGURATION_BUNDLE_NAME, 1), + (CONFIGURATION_BUNDLE_DESCRIPTION, 0), + (CONFIGURATION_BUNDLE_VERSION, 1), + (COMPONENT_CONFIGURATION_MAP, 1), + (VERSION_LINEAGE_METADATA, 0), + (4, 1), + (4, 1), + (KMS_KEY_ARN, 0), + ), ) -UPDATE_AGENT_RUNTIME_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateAgentRuntimeOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UpdateAgentRuntimeResponse", +GET_CONFIGURATION_BUNDLE: StaticOperationSchema = ( + 23, + n0, + _GCB, + { + _smithy: MappingProxyType( + {"method": "GET", "uri": "/configuration-bundles/{bundleId}"} ) - ], - members={ - "agentRuntimeArn": { - "target": AGENT_RUNTIME_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentRuntimeId": { - "target": AGENT_RUNTIME_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "workloadIdentityDetails": {"target": WORKLOAD_IDENTITY_DETAILS}, - "agentRuntimeVersion": { - "target": AGENT_RUNTIME_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastUpdatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": AGENT_RUNTIME_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, }, + GET_CONFIGURATION_BUNDLE_INPUT, + GET_CONFIGURATION_BUNDLE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -UPDATE_AGENT_RUNTIME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateAgentRuntime"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 202, "method": "PUT", "uri": "/runtimes/{agentRuntimeId}/"} - ), - ) - ], -) - -AGENT_RUNTIME_VERSION_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#AgentRuntimeVersionSummary"), - members={ - "agentRuntimeArn": { - "target": AGENT_RUNTIME_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentRuntimeVersion": { - "target": AGENT_RUNTIME_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": AGENT_RUNTIME_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +GET_CONFIGURATION_BUNDLE_VERSION_INPUT: StaticSchema = ( + 18, + n0, + _GCBVI, + {_sSI: _cGCBVR, _smit: None}, + (_bIu, _vI), + ((CONFIGURATION_BUNDLE_ID, 9), (CONFIGURATION_BUNDLE_VERSION, 9)), +) + +GET_CONFIGURATION_BUNDLE_VERSION_OUTPUT: StaticSchema = ( + 18, + n0, + _GCBVO, + {_sSI: _cGCBVRo, _smith: None}, + (_bA, _bIu, _bN, _d, _vI, _com, _lM, _cA, _vCA, _kKA), + ( + (CONFIGURATION_BUNDLE_ARN, 1), + (CONFIGURATION_BUNDLE_ID, 1), + (CONFIGURATION_BUNDLE_NAME, 1), + (CONFIGURATION_BUNDLE_DESCRIPTION, 0), + (CONFIGURATION_BUNDLE_VERSION, 1), + (COMPONENT_CONFIGURATION_MAP, 1), + (VERSION_LINEAGE_METADATA, 0), + (4, 1), + (4, 1), + (KMS_KEY_ARN, 0), + ), ) -AGENT_RUNTIME_VERSION_SUMMARY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#AgentRuntimeVersionSummaryList"), - shape_type=ShapeType.LIST, - members={"member": {"target": AGENT_RUNTIME_VERSION_SUMMARY}}, +GET_CONFIGURATION_BUNDLE_VERSION: StaticOperationSchema = ( + 23, + n0, + _GCBV, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/configuration-bundles/{bundleId}/versions/{versionId}", + } + ) + }, + GET_CONFIGURATION_BUNDLE_VERSION_INPUT, + GET_CONFIGURATION_BUNDLE_VERSION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -SKILL_DEFINITION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SkillDefinition"), - members={ - "schemaVersion": {"target": SCHEMA_VERSION}, - "inlineContent": {"target": INLINE_CONTENT}, - }, +LIST_CONFIGURATION_BUNDLES_INPUT: StaticSchema = ( + 18, + n0, + _LCBI, + {_sSI: _cLCBR, _smit: None}, + (_nT, _mR), + ((3, {_sQ: _nT}), (7, {_sQ: _mR})), +) + +CONFIGURATION_BUNDLE_SUMMARY: StaticSchema = ( + 18, + n0, + _CBSo, + 0, + (_bA, _bIu, _bN, _d, _cA), + ( + (CONFIGURATION_BUNDLE_ARN, 1), + (CONFIGURATION_BUNDLE_ID, 1), + (CONFIGURATION_BUNDLE_NAME, 1), + (CONFIGURATION_BUNDLE_DESCRIPTION, 0), + (4, 0), + ), ) -SKILL_MD_DEFINITION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SkillMdDefinition"), - members={"inlineContent": {"target": INLINE_CONTENT}}, +CONFIGURATION_BUNDLE_SUMMARY_LIST: StaticSchema = ( + 16, + n0, + _CBSL, + 0, + (_mem,), + ((CONFIGURATION_BUNDLE_SUMMARY, 0),), +) + +LIST_CONFIGURATION_BUNDLES_OUTPUT: StaticSchema = ( + 18, + n0, + _LCBO, + {_sSI: _cLCBRo, _smith: None}, + (_bu, _nT), + ((CONFIGURATION_BUNDLE_SUMMARY_LIST, 1), (3, 0)), +) + +LIST_CONFIGURATION_BUNDLES: StaticOperationSchema = ( + 23, + n0, + _LCB, + {_smithy: MappingProxyType({"method": "POST", "uri": "/configuration-bundles"})}, + LIST_CONFIGURATION_BUNDLES_INPUT, + LIST_CONFIGURATION_BUNDLES_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AGENT_SKILLS_DESCRIPTOR = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#AgentSkillsDescriptor"), - members={ - "skillMd": {"target": SKILL_MD_DEFINITION}, - "skillDefinition": {"target": SKILL_DEFINITION}, - }, +VERSION_FILTER: StaticSchema = ( + 18, + n0, + _VF, + 0, + (_bNr, _cBN, _lPB), + ((BRANCH_NAME, 0), (3, 0), (2, 0)), +) + +LIST_CONFIGURATION_BUNDLE_VERSIONS_INPUT: StaticSchema = ( + 18, + n0, + _LCBVI, + {_sSI: _cLCBVR, _smit: None}, + (_bIu, _nT, _mR, _f), + ( + (CONFIGURATION_BUNDLE_ID, 9), + (3, {_sQ: _nT}), + (7, {_sQ: _mR}), + (VERSION_FILTER, 0), + ), ) -ALLOWED_AUDIENCE_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#AllowedAudienceType"), - shape_type=ShapeType.STRING, +CONFIGURATION_BUNDLE_VERSION_SUMMARY: StaticSchema = ( + 18, + n0, + _CBVS, + 0, + (_bA, _bIu, _vI, _lM, _vCA), + ( + (CONFIGURATION_BUNDLE_ARN, 1), + (CONFIGURATION_BUNDLE_ID, 1), + (CONFIGURATION_BUNDLE_VERSION, 1), + (VERSION_LINEAGE_METADATA, 0), + (4, 1), + ), ) -HTTP_QUERY_PARAMETER_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HttpQueryParameterName"), - shape_type=ShapeType.STRING, +CONFIGURATION_BUNDLE_VERSION_SUMMARY_LIST: StaticSchema = ( + 16, + n0, + _CBVSL, + 0, + (_mem,), + ((CONFIGURATION_BUNDLE_VERSION_SUMMARY, 0),), +) + +LIST_CONFIGURATION_BUNDLE_VERSIONS_OUTPUT: StaticSchema = ( + 18, + n0, + _LCBVO, + {_sSI: _cLCBVRo, _smith: None}, + (_ver, _nT), + ((CONFIGURATION_BUNDLE_VERSION_SUMMARY_LIST, 1), (3, 0)), +) + +LIST_CONFIGURATION_BUNDLE_VERSIONS: StaticOperationSchema = ( + 23, + n0, + _LCBV, + { + _smithy: MappingProxyType( + {"method": "POST", "uri": "/configuration-bundles/{bundleId}/versions"} + ) + }, + LIST_CONFIGURATION_BUNDLE_VERSIONS_INPUT, + LIST_CONFIGURATION_BUNDLE_VERSIONS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -ALLOWED_QUERY_PARAMETERS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#AllowedQueryParameters"), - shape_type=ShapeType.LIST, - members={"member": {"target": HTTP_QUERY_PARAMETER_NAME}}, +UPDATE_CONFIGURATION_BUNDLE_INPUT: StaticSchema = ( + 18, + n0, + _UCBI, + {_sSI: _cUCBR, _smit: None}, + (_cT, _bIu, _bN, _d, _com, _pVI, _bNr, _cM, _cBr, _kKA), + ( + (CLIENT_TOKEN, 2), + (CONFIGURATION_BUNDLE_ID, 9), + (CONFIGURATION_BUNDLE_NAME, 0), + (CONFIGURATION_BUNDLE_DESCRIPTION, 0), + (COMPONENT_CONFIGURATION_MAP, 0), + (CONFIGURATION_BUNDLE_VERSION_LIST, 1), + (BRANCH_NAME, 0), + (3, 1), + (VERSION_CREATED_BY_SOURCE, 0), + (KMS_KEY_ARN, 0), + ), ) -HTTP_HEADER_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HttpHeaderName"), - shape_type=ShapeType.STRING, +UPDATE_CONFIGURATION_BUNDLE_OUTPUT: StaticSchema = ( + 18, + n0, + _UCBO, + {_sSI: _cUCBRo, _smith: None}, + (_bA, _bIu, _vI, _uA), + ( + (CONFIGURATION_BUNDLE_ARN, 1), + (CONFIGURATION_BUNDLE_ID, 1), + (CONFIGURATION_BUNDLE_VERSION, 1), + (4, 1), + ), ) -ALLOWED_REQUEST_HEADERS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#AllowedRequestHeaders"), - shape_type=ShapeType.LIST, - members={"member": {"target": HTTP_HEADER_NAME}}, +UPDATE_CONFIGURATION_BUNDLE: StaticOperationSchema = ( + 23, + n0, + _UCB, + { + _smithy: MappingProxyType( + {"method": "PUT", "uri": "/configuration-bundles/{bundleId}"} + ) + }, + UPDATE_CONFIGURATION_BUNDLE_INPUT, + UPDATE_CONFIGURATION_BUNDLE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -ALLOWED_RESPONSE_HEADERS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#AllowedResponseHeaders"), - shape_type=ShapeType.LIST, - members={"member": {"target": HTTP_HEADER_NAME}}, -) +CONSENT_PORTAL_ARN_TYPE: StaticSchema = (3, n0, _CPAT, 0) -ALLOWED_STRING_LIST_VALUE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#AllowedStringListValue"), - shape_type=ShapeType.STRING, -) +CONSENT_PORTAL_DESCRIPTION_TYPE: StaticSchema = (3, n0, _CPDT, 0) -ALLOWED_STRING_LIST_VALUES_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#AllowedStringListValuesList"), - shape_type=ShapeType.LIST, - members={"member": {"target": ALLOWED_STRING_LIST_VALUE}}, -) +CONSENT_PORTAL_IDENTIFIER: StaticSchema = (3, n0, _CPIo, 0) -ALLOWED_STRING_VALUE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#AllowedStringValue"), - shape_type=ShapeType.STRING, +O_AUTH2_CREDENTIAL_PROVIDER_ARN: StaticSchema = (3, n0, _OACPA, 0) + +CONSENT_PORTAL_IDP_CONFIG: StaticSchema = ( + 18, + n0, + _CPIC, + 0, + (_cPAr, _sco, _au), + ( + (O_AUTH2_CREDENTIAL_PROVIDER_ARN, 1), + (ALLOWED_SCOPES_TYPE, 1), + (ALLOWED_AUDIENCE_TYPE, 0), + ), ) -ALLOWED_STRING_VALUES_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#AllowedStringValuesList"), - shape_type=ShapeType.LIST, - members={"member": {"target": ALLOWED_STRING_VALUE}}, +CONSENT_PORTAL_NAME_TYPE: StaticSchema = (3, n0, _CPNT, 0) + +CONSENT_PORTAL_SOURCE_IDENTIFIER_TYPE: StaticSchema = (3, n0, _CPSIT, 0) + +CONSENT_PORTAL_SOURCE_TYPE: StaticSchema = ( + 14, + n0, + _CPST, + 0, + (_AG,), + ((-1, {_sVm: _ag}),), +) + +CONSENT_PORTAL_SOURCE: StaticSchema = ( + 18, + n0, + _CPSo, + 0, + (_id, _ty), + ((CONSENT_PORTAL_SOURCE_IDENTIFIER_TYPE, 1), (CONSENT_PORTAL_SOURCE_TYPE, 1)), +) + +CONSENT_PORTAL_SOURCES: StaticSchema = ( + 16, + n0, + _CPSon, + 0, + (_mem,), + ((CONSENT_PORTAL_SOURCE, 0),), +) + +CONSENT_PORTAL_STATUS: StaticSchema = ( + 14, + n0, + _CPSons, + 0, + (_CREATING, _ACTIVE, _UPDATING, _UF, _DELETING, _FAILED), + ( + (-1, {_sVm: _CREATING}), + (-1, {_sVm: _ACTIVE}), + (-1, {_sVm: _UPDATING}), + (-1, {_sVm: _UF}), + (-1, {_sVm: _DELETING}), + (-1, {_sVm: _FAILED}), + ), ) -API_KEY_CREDENTIAL_PROVIDER_ARN_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ApiKeyCredentialProviderArnType"), - shape_type=ShapeType.STRING, +EXECUTION_ROLE_ARN_TYPE: StaticSchema = (3, n0, _ERAT, 0) + +CREATE_CONSENT_PORTAL_INPUT: StaticSchema = ( + 18, + n0, + _CCPIr, + {_sSI: _cCCPR, _smit: None}, + (_eRA, _iCd, _n, _sou, _d, _t), + ( + (EXECUTION_ROLE_ARN_TYPE, 1), + (CONSENT_PORTAL_IDP_CONFIG, 1), + (CONSENT_PORTAL_NAME_TYPE, 1), + (CONSENT_PORTAL_SOURCES, 1), + (CONSENT_PORTAL_DESCRIPTION_TYPE, 0), + (TAGS_MAP, 0), + ), ) -DEFAULT_API_KEY_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DefaultApiKeyType"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +CONSENT_PORTAL_ID_TYPE: StaticSchema = (3, n0, _CPIT, 0) + +PORTAL_URL_TYPE: StaticSchema = (3, n0, _PUT, 0) + +STATUS_REASON_TYPE: StaticSchema = (3, n0, _SRT, 0) + +CREATE_CONSENT_PORTAL_OUTPUT: StaticSchema = ( + 18, + n0, + _CCPOr, + {_sSI: _cCCPRo, _smith: None}, + (_sou, _cPAo, _cPIo, _cA, _d, _eRA, _iCd, _n, _pU, _st, _sRt, _uA), + ( + (CONSENT_PORTAL_SOURCES, 1), + (CONSENT_PORTAL_ARN_TYPE, 1), + (CONSENT_PORTAL_ID_TYPE, 1), + (4, 1), + (CONSENT_PORTAL_DESCRIPTION_TYPE, 0), + (EXECUTION_ROLE_ARN_TYPE, 1), + (CONSENT_PORTAL_IDP_CONFIG, 1), + (CONSENT_PORTAL_NAME_TYPE, 1), + (PORTAL_URL_TYPE, 0), + (CONSENT_PORTAL_STATUS, 1), + (STATUS_REASON_TYPE, 0), + (4, 1), + ), ) -SECRET_JSON_KEY_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SecretJsonKeyType"), - shape_type=ShapeType.STRING, +CREATE_CONSENT_PORTAL: StaticOperationSchema = ( + 23, + n0, + _CCPr, + { + _smithy: MappingProxyType( + {"code": 202, "uri": "/identities/CreateConsentPortal", "method": "POST"} + ) + }, + CREATE_CONSENT_PORTAL_INPUT, + CREATE_CONSENT_PORTAL_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -SECRET_ID_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SecretIdType"), - shape_type=ShapeType.STRING, +DELETE_CONSENT_PORTAL_INPUT: StaticSchema = ( + 18, + n0, + _DCPIe, + {_sSI: _cDCPR, _smit: None}, + (_cPIon,), + ((CONSENT_PORTAL_IDENTIFIER, 1),), +) + +DELETE_CONSENT_PORTAL_OUTPUT: StaticSchema = ( + 18, + n0, + _DCPOe, + {_sSI: _cDCPRo, _smith: None}, +) + +DELETE_CONSENT_PORTAL: StaticOperationSchema = ( + 23, + n0, + _DCPe, + { + _smithy: MappingProxyType( + {"code": 204, "uri": "/identities/DeleteConsentPortal", "method": "POST"} + ) + }, + DELETE_CONSENT_PORTAL_INPUT, + DELETE_CONSENT_PORTAL_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -SECRET_REFERENCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SecretReference"), - members={ - "secretId": { - "target": SECRET_ID_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "jsonKey": { - "target": SECRET_JSON_KEY_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +GET_CONSENT_PORTAL_INPUT: StaticSchema = ( + 18, + n0, + _GCPIe, + {_sSI: _cGCPR, _smit: None}, + (_cPIon,), + ((CONSENT_PORTAL_IDENTIFIER, 1),), +) + +GET_CONSENT_PORTAL_OUTPUT: StaticSchema = ( + 18, + n0, + _GCPOe, + {_sSI: _cGCPRo, _smith: None}, + (_sou, _cPAo, _cPIo, _cA, _d, _eRA, _iCd, _n, _pU, _st, _sRt, _uA), + ( + (CONSENT_PORTAL_SOURCES, 1), + (CONSENT_PORTAL_ARN_TYPE, 1), + (CONSENT_PORTAL_ID_TYPE, 1), + (4, 1), + (CONSENT_PORTAL_DESCRIPTION_TYPE, 0), + (EXECUTION_ROLE_ARN_TYPE, 1), + (CONSENT_PORTAL_IDP_CONFIG, 1), + (CONSENT_PORTAL_NAME_TYPE, 1), + (PORTAL_URL_TYPE, 0), + (CONSENT_PORTAL_STATUS, 1), + (STATUS_REASON_TYPE, 0), + (4, 1), + ), ) -SECRET_SOURCE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SecretSourceType"), - shape_type=ShapeType.ENUM, - members={"MANAGED": {"target": UNIT}, "EXTERNAL": {"target": UNIT}}, +GET_CONSENT_PORTAL: StaticOperationSchema = ( + 23, + n0, + _GCPe, + { + _smithy: MappingProxyType( + {"uri": "/identities/GetConsentPortal", "method": "POST"} + ) + }, + GET_CONSENT_PORTAL_INPUT, + GET_CONSENT_PORTAL_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CREDENTIAL_PROVIDER_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CredentialProviderName"), - shape_type=ShapeType.STRING, +LIST_CONSENT_PORTALS_INPUT: StaticSchema = ( + 18, + n0, + _LCPIi, + {_sSI: _cLCPR, _smit: None}, + (_mR, _nT), + ((7, 0), (3, 0)), +) + +CONSENT_PORTAL_SUMMARY: StaticSchema = ( + 18, + n0, + _CPSonse, + 0, + (_sou, _cPAo, _cPIo, _cA, _d, _n, _pU, _st, _uA), + ( + (CONSENT_PORTAL_SOURCES, 1), + (CONSENT_PORTAL_ARN_TYPE, 1), + (CONSENT_PORTAL_ID_TYPE, 1), + (4, 1), + (CONSENT_PORTAL_DESCRIPTION_TYPE, 0), + (CONSENT_PORTAL_NAME_TYPE, 1), + (PORTAL_URL_TYPE, 0), + (CONSENT_PORTAL_STATUS, 1), + (4, 1), + ), ) -CREATE_API_KEY_CREDENTIAL_PROVIDER_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#CreateApiKeyCredentialProviderInput" +CONSENT_PORTAL_SUMMARIES: StaticSchema = ( + 16, + n0, + _CPSonsen, + 0, + (_mem,), + ((CONSENT_PORTAL_SUMMARY, 0),), +) + +LIST_CONSENT_PORTALS_OUTPUT: StaticSchema = ( + 18, + n0, + _LCPOi, + {_sSI: _cLCPRo, _smith: None}, + (_cPo, _nT), + ((CONSENT_PORTAL_SUMMARIES, 1), (3, 0)), +) + +LIST_CONSENT_PORTALS: StaticOperationSchema = ( + 23, + n0, + _LCPi, + { + _smithy: MappingProxyType( + {"uri": "/identities/ListConsentPortals", "method": "POST"} + ) + }, + LIST_CONSENT_PORTALS_INPUT, + LIST_CONSENT_PORTALS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + VALIDATION_EXCEPTION, ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreateApiKeyCredentialProviderRequest", - ) - ], - members={ - "name": { - "target": CREDENTIAL_PROVIDER_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "apiKey": { - "target": DEFAULT_API_KEY_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="")], - }, - "apiKeySecretConfig": {"target": SECRET_REFERENCE}, - "apiKeySecretSource": {"target": SECRET_SOURCE_TYPE}, - "tags": {"target": TAGS_MAP}, - }, ) -SECRET_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SecretArn"), - shape_type=ShapeType.STRING, +UPDATE_CONSENT_PORTAL_INPUT: StaticSchema = ( + 18, + n0, + _UCPIp, + {_sSI: _cUCPR, _smit: None}, + (_cPIon, _eRA, _iCd, _d), + ( + (CONSENT_PORTAL_IDENTIFIER, 1), + (EXECUTION_ROLE_ARN_TYPE, 0), + (CONSENT_PORTAL_IDP_CONFIG, 0), + (CONSENT_PORTAL_DESCRIPTION_TYPE, 0), + ), ) -SECRET = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#Secret"), - members={ - "secretArn": { - "target": SECRET_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +UPDATE_CONSENT_PORTAL_OUTPUT: StaticSchema = ( + 18, + n0, + _UCPOp, + {_sSI: _cUCPRo, _smith: None}, + (_sou, _cPAo, _cPIo, _cA, _d, _eRA, _iCd, _n, _pU, _st, _sRt, _uA), + ( + (CONSENT_PORTAL_SOURCES, 1), + (CONSENT_PORTAL_ARN_TYPE, 1), + (CONSENT_PORTAL_ID_TYPE, 1), + (4, 1), + (CONSENT_PORTAL_DESCRIPTION_TYPE, 0), + (EXECUTION_ROLE_ARN_TYPE, 1), + (CONSENT_PORTAL_IDP_CONFIG, 1), + (CONSENT_PORTAL_NAME_TYPE, 1), + (PORTAL_URL_TYPE, 0), + (CONSENT_PORTAL_STATUS, 1), + (STATUS_REASON_TYPE, 0), + (4, 1), + ), ) -CREATE_API_KEY_CREDENTIAL_PROVIDER_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#CreateApiKeyCredentialProviderOutput" +UPDATE_CONSENT_PORTAL: StaticOperationSchema = ( + 23, + n0, + _UCPp, + { + _smithy: MappingProxyType( + {"code": 202, "uri": "/identities/UpdateConsentPortal", "method": "POST"} + ) + }, + UPDATE_CONSENT_PORTAL_INPUT, + UPDATE_CONSENT_PORTAL_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + VALIDATION_EXCEPTION, ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreateApiKeyCredentialProviderResponse", - ) - ], - members={ - "apiKeySecretArn": { - "target": SECRET, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "apiKeySecretJsonKey": {"target": SECRET_JSON_KEY_TYPE}, - "apiKeySecretSource": {"target": SECRET_SOURCE_TYPE}, - "name": { - "target": CREDENTIAL_PROVIDER_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "credentialProviderArn": { - "target": API_KEY_CREDENTIAL_PROVIDER_ARN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, ) -DECRYPTION_FAILURE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DecryptionFailure"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={ - "message": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +DATASET_NAME: StaticSchema = (3, n0, _DNa, 0) + +DATASET_SCHEMA_TYPE: StaticSchema = ( + 14, + n0, + _DSTa, + 0, + (_AEPV, _AESV, _TPEV), + ((-1, {_sVm: _AEPV}), (-1, {_sVm: _AESV}), (-1, {_sVm: _TPEV})), +) + +CREATE_DATASET_INPUT: StaticSchema = ( + 18, + n0, + _CDI, + {_sSI: _cCDR, _smit: None}, + (_cT, _dNa, _d, _so, _sTc, _kKA, _t), + ( + (CLIENT_TOKEN, 2), + (DATASET_NAME, 1), + (3, 0), + (DATA_SOURCE_TYPE, 1), + (DATASET_SCHEMA_TYPE, 1), + (KMS_KEY_ARN, 0), + (TAGS_MAP, 0), + ), ) -ENCRYPTION_FAILURE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#EncryptionFailure"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={ - "message": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +CREATE_DATASET_OUTPUT: StaticSchema = ( + 18, + n0, + _CDO, + {_sSI: _cCDRo, _smith: None}, + (_dA, _dI, _st, _cA), + ((DATASET_ARN, 1), (DATASET_ID, 1), (DATASET_STATUS, 1), (4, 1)), +) + +CREATE_DATASET: StaticOperationSchema = ( + 23, + n0, + _CD, + {_smithy: MappingProxyType({"method": "POST", "uri": "/datasets", "code": 202})}, + CREATE_DATASET_INPUT, + CREATE_DATASET_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -RESOURCE_LIMIT_EXCEEDED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceLimitExceededException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"message": {"target": _STRING}}, -) - -UNAUTHORIZED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UnauthorizedException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=401), - ], - members={"message": {"target": NON_BLANK_STRING}}, -) - -CREATE_API_KEY_CREDENTIAL_PROVIDER = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateApiKeyCredentialProvider"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 201, - "uri": "/identities/CreateApiKeyCredentialProvider", - "method": "POST", - } - ), - ) - ], +CREATE_DATASET_VERSION_INPUT: StaticSchema = ( + 18, + n0, + _CDVI, + {_sSI: _cCDVR, _smit: None}, + (_dI, _cT), + ((DATASET_ID, 9), (CLIENT_TOKEN, 2)), +) + +DATASET_VERSION: StaticSchema = (3, n0, _DV, 0) + +CREATE_DATASET_VERSION_OUTPUT: StaticSchema = ( + 18, + n0, + _CDVO, + {_sSI: _cCDVRo, _smith: None}, + (_dA, _dI, _st, _dV, _cA), + ( + (DATASET_ARN, 1), + (DATASET_ID, 1), + (DATASET_STATUS, 1), + (DATASET_VERSION, 1), + (4, 1), + ), ) -DELETE_API_KEY_CREDENTIAL_PROVIDER_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#DeleteApiKeyCredentialProviderInput" +CREATE_DATASET_VERSION: StaticOperationSchema = ( + 23, + n0, + _CDV, + { + _smithy: MappingProxyType( + {"method": "POST", "uri": "/datasets/{datasetId}/versions", "code": 202} + ) + }, + CREATE_DATASET_VERSION_INPUT, + CREATE_DATASET_VERSION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeleteApiKeyCredentialProviderRequest", - ) - ], - members={ - "name": { - "target": CREDENTIAL_PROVIDER_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, ) -DELETE_API_KEY_CREDENTIAL_PROVIDER_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#DeleteApiKeyCredentialProviderOutput" +DELETE_DATASET_INPUT: StaticSchema = ( + 18, + n0, + _DDI, + {_sSI: _cDDR, _smit: None}, + (_dI, _dV), + ((DATASET_ID, 9), (DATASET_VERSION, {_sQ: _dV})), +) + +DELETE_DATASET_OUTPUT: StaticSchema = ( + 18, + n0, + _DDO, + {_sSI: _cDDRo, _smith: None}, + (_dA, _dI, _st, _dV, _uA), + ( + (DATASET_ARN, 1), + (DATASET_ID, 1), + (DATASET_STATUS, 1), + (DATASET_VERSION, 1), + (4, 1), ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeleteApiKeyCredentialProviderResponse", - ) - ], -) - -DELETE_API_KEY_CREDENTIAL_PROVIDER = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteApiKeyCredentialProvider"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 204, - "uri": "/identities/DeleteApiKeyCredentialProvider", - "method": "POST", - } - ), - ) - ], ) -GET_API_KEY_CREDENTIAL_PROVIDER_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#GetApiKeyCredentialProviderInput" +DELETE_DATASET: StaticOperationSchema = ( + 23, + n0, + _DD, + { + _smithy: MappingProxyType( + {"method": "DELETE", "uri": "/datasets/{datasetId}", "code": 202} + ) + }, + DELETE_DATASET_INPUT, + DELETE_DATASET_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetApiKeyCredentialProviderRequest", - ) - ], - members={ - "name": { - "target": CREDENTIAL_PROVIDER_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, ) -GET_API_KEY_CREDENTIAL_PROVIDER_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#GetApiKeyCredentialProviderOutput" +DELETE_DATASET_EXAMPLES_INPUT: StaticSchema = ( + 18, + n0, + _DDEI, + {_sSI: _cDDER, _smit: None}, + (_dI, _cT, _eI), + ((DATASET_ID, 9), (CLIENT_TOKEN, 2), (EXAMPLE_ID_LIST, 1)), +) + +DELETE_DATASET_EXAMPLES_OUTPUT: StaticSchema = ( + 18, + n0, + _DDEO, + {_sSI: _cDDERo, _smith: None}, + (_dA, _dI, _st, _dC, _uA), + ((DATASET_ARN, 1), (DATASET_ID, 1), (DATASET_STATUS, 1), (8, 1), (4, 1)), +) + +DELETE_DATASET_EXAMPLES: StaticOperationSchema = ( + 23, + n0, + _DDE, + { + _smithy: MappingProxyType( + { + "method": "POST", + "uri": "/datasets/{datasetId}/examples/delete", + "code": 202, + } + ) + }, + DELETE_DATASET_EXAMPLES_INPUT, + DELETE_DATASET_EXAMPLES_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetApiKeyCredentialProviderResponse", - ) - ], - members={ - "apiKeySecretArn": { - "target": SECRET, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "apiKeySecretJsonKey": {"target": SECRET_JSON_KEY_TYPE}, - "apiKeySecretSource": {"target": SECRET_SOURCE_TYPE}, - "name": { - "target": CREDENTIAL_PROVIDER_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "credentialProviderArn": { - "target": API_KEY_CREDENTIAL_PROVIDER_ARN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastUpdatedTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, ) -GET_API_KEY_CREDENTIAL_PROVIDER = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetApiKeyCredentialProvider"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"uri": "/identities/GetApiKeyCredentialProvider", "method": "POST"} - ), - ) - ], +GET_DATASET_INPUT: StaticSchema = ( + 18, + n0, + _GDI, + {_sSI: _cGDR, _smit: None}, + (_dI, _dV), + ((DATASET_ID, 9), (DATASET_VERSION, {_sQ: _dV})), +) + +DOWNLOAD_URL: StaticSchema = (3, n0, _DUo, 4) + +DRAFT_STATUS: StaticSchema = ( + 14, + n0, + _DSr, + 0, + (_MODIFIED, _UNMODIFIED), + ((-1, {_sVm: _MODIFIED}), (-1, {_sVm: _UNMODIFIED})), +) + +GET_DATASET_OUTPUT: StaticSchema = ( + 18, + n0, + _GDO, + {_sSI: _cGDRo, _smith: None}, + ( + _dA, + _dI, + _dV, + _dNa, + _d, + _st, + _dS, + _fR, + _sTc, + _kKA, + _eCx, + _dUo, + _dUEA, + _cA, + _uA, + _t, + ), + ( + (DATASET_ARN, 1), + (DATASET_ID, 1), + (DATASET_VERSION, 1), + (DATASET_NAME, 1), + (3, 0), + (DATASET_STATUS, 1), + (DRAFT_STATUS, 0), + (3, 0), + (DATASET_SCHEMA_TYPE, 1), + (KMS_KEY_ARN, 0), + (8, 1), + (DOWNLOAD_URL, 0), + (4, 0), + (4, 1), + (4, 1), + (TAGS_MAP, 0), + ), ) -LIST_API_KEY_CREDENTIAL_PROVIDERS_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ListApiKeyCredentialProvidersInput" +GET_DATASET: StaticOperationSchema = ( + 23, + n0, + _GD, + {_smithy: MappingProxyType({"method": "GET", "uri": "/datasets/{datasetId}"})}, + GET_DATASET_INPUT, + GET_DATASET_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListApiKeyCredentialProvidersRequest", - ) - ], - members={ - "nextToken": {"target": _STRING}, - "maxResults": { - "target": MAX_RESULTS, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=10)], - }, - }, ) -API_KEY_CREDENTIAL_PROVIDER_ITEM = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ApiKeyCredentialProviderItem"), - members={ - "name": { - "target": CREDENTIAL_PROVIDER_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "credentialProviderArn": { - "target": API_KEY_CREDENTIAL_PROVIDER_ARN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastUpdatedTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +LIST_DATASET_EXAMPLES_INPUT: StaticSchema = ( + 18, + n0, + _LDEI, + {_sSI: _cLDER, _smit: None}, + (_dI, _dV, _mR, _nT), + ((DATASET_ID, 9), (DATASET_VERSION, {_sQ: _dV}), (7, {_sQ: _mR}), (3, {_sQ: _nT})), +) + +LIST_DATASET_EXAMPLES_OUTPUT: StaticSchema = ( + 18, + n0, + _LDEO, + {_sSI: _cLDERo, _smith: None}, + (_dA, _dI, _dV, _e, _nT), + ( + (DATASET_ARN, 1), + (DATASET_ID, 1), + (DATASET_VERSION, 1), + (DATASET_EXAMPLE_LIST, 1), + (3, 0), + ), ) -API_KEY_CREDENTIAL_PROVIDERS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ApiKeyCredentialProviders"), - shape_type=ShapeType.LIST, - members={"member": {"target": API_KEY_CREDENTIAL_PROVIDER_ITEM}}, +LIST_DATASET_EXAMPLES: StaticOperationSchema = ( + 23, + n0, + _LDE, + { + _smithy: MappingProxyType( + {"method": "GET", "uri": "/datasets/{datasetId}/examples"} + ) + }, + LIST_DATASET_EXAMPLES_INPUT, + LIST_DATASET_EXAMPLES_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -LIST_API_KEY_CREDENTIAL_PROVIDERS_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ListApiKeyCredentialProvidersOutput" +LIST_DATASETS_INPUT: StaticSchema = ( + 18, + n0, + _LDI, + {_sSI: _cLDR, _smit: None}, + (_nT, _mR), + ((3, {_sQ: _nT}), (7, {_sQ: _mR})), +) + +DATASET_SUMMARY: StaticSchema = ( + 18, + n0, + _DSa, + 0, + (_dA, _dI, _dNa, _d, _st, _dS, _sTc, _eCx, _cA, _uA), + ( + (DATASET_ARN, 1), + (DATASET_ID, 1), + (DATASET_NAME, 1), + (3, 0), + (DATASET_STATUS, 1), + (DRAFT_STATUS, 0), + (DATASET_SCHEMA_TYPE, 1), + (8, 1), + (4, 1), + (4, 1), ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListApiKeyCredentialProvidersResponse", - ) - ], - members={ - "credentialProviders": { - "target": API_KEY_CREDENTIAL_PROVIDERS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": _STRING}, - }, ) -LIST_API_KEY_CREDENTIAL_PROVIDERS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListApiKeyCredentialProviders"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"uri": "/identities/ListApiKeyCredentialProviders", "method": "POST"} - ), - ) - ], +DATASET_SUMMARY_LIST: StaticSchema = (16, n0, _DSL, 0, (_mem,), ((DATASET_SUMMARY, 0),)) + +LIST_DATASETS_OUTPUT: StaticSchema = ( + 18, + n0, + _LDO, + {_sSI: _cLDRo, _smith: None}, + (_da, _nT), + ((DATASET_SUMMARY_LIST, 1), (3, 0)), +) + +LIST_DATASETS: StaticOperationSchema = ( + 23, + n0, + _LD, + {_smithy: MappingProxyType({"method": "GET", "uri": "/datasets"})}, + LIST_DATASETS_INPUT, + LIST_DATASETS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -UPDATE_API_KEY_CREDENTIAL_PROVIDER_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#UpdateApiKeyCredentialProviderInput" +LIST_DATASET_VERSIONS_INPUT: StaticSchema = ( + 18, + n0, + _LDVI, + {_sSI: _cLDVR, _smit: None}, + (_dI, _nT, _mR), + ((DATASET_ID, 9), (3, {_sQ: _nT}), (7, {_sQ: _mR})), +) + +DATASET_VERSION_SUMMARY: StaticSchema = ( + 18, + n0, + _DVS, + 0, + (_dV, _eCx, _cA), + ((DATASET_VERSION, 1), (8, 1), (4, 1)), +) + +DATASET_VERSION_SUMMARY_LIST: StaticSchema = ( + 16, + n0, + _DVSL, + 0, + (_mem,), + ((DATASET_VERSION_SUMMARY, 0),), +) + +LIST_DATASET_VERSIONS_OUTPUT: StaticSchema = ( + 18, + n0, + _LDVO, + {_sSI: _cLDVRo, _smith: None}, + (_ver, _nT), + ((DATASET_VERSION_SUMMARY_LIST, 1), (3, 0)), +) + +LIST_DATASET_VERSIONS: StaticOperationSchema = ( + 23, + n0, + _LDV, + { + _smithy: MappingProxyType( + {"method": "GET", "uri": "/datasets/{datasetId}/versions"} + ) + }, + LIST_DATASET_VERSIONS_INPUT, + LIST_DATASET_VERSIONS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UpdateApiKeyCredentialProviderRequest", - ) - ], - members={ - "name": { - "target": CREDENTIAL_PROVIDER_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "apiKey": { - "target": DEFAULT_API_KEY_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="")], - }, - "apiKeySecretConfig": {"target": SECRET_REFERENCE}, - "apiKeySecretSource": {"target": SECRET_SOURCE_TYPE}, - }, ) -UPDATE_API_KEY_CREDENTIAL_PROVIDER_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#UpdateApiKeyCredentialProviderOutput" +UPDATE_DATASET_INPUT: StaticSchema = ( + 18, + n0, + _UDI, + {_sSI: _cUDR, _smit: None}, + (_dI, _cT, _d), + ((DATASET_ID, 9), (CLIENT_TOKEN, 2), (3, 0)), +) + +UPDATE_DATASET_OUTPUT: StaticSchema = ( + 18, + n0, + _UDO, + {_sSI: _cUDRo, _smith: None}, + (_dA, _dI, _uA), + ((DATASET_ARN, 1), (DATASET_ID, 1), (4, 1)), +) + +UPDATE_DATASET: StaticOperationSchema = ( + 23, + n0, + _UDp, + { + _smithy: MappingProxyType( + {"method": "PUT", "uri": "/datasets/{datasetId}", "code": 200} + ) + }, + UPDATE_DATASET_INPUT, + UPDATE_DATASET_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UpdateApiKeyCredentialProviderResponse", - ) - ], - members={ - "apiKeySecretArn": { - "target": SECRET, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "apiKeySecretJsonKey": {"target": SECRET_JSON_KEY_TYPE}, - "apiKeySecretSource": {"target": SECRET_SOURCE_TYPE}, - "name": { - "target": CREDENTIAL_PROVIDER_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "credentialProviderArn": { - "target": API_KEY_CREDENTIAL_PROVIDER_ARN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastUpdatedTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, ) -UPDATE_API_KEY_CREDENTIAL_PROVIDER = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateApiKeyCredentialProvider"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"uri": "/identities/UpdateApiKeyCredentialProvider", "method": "POST"} - ), - ) - ], +UPDATE_DATASET_EXAMPLES_INPUT: StaticSchema = ( + 18, + n0, + _UDEI, + {_sSI: _cUDER, _smit: None}, + (_dI, _cT, _e), + ((DATASET_ID, 9), (CLIENT_TOKEN, 2), (DATASET_EXAMPLE_LIST, 1)), +) + +UPDATE_DATASET_EXAMPLES_OUTPUT: StaticSchema = ( + 18, + n0, + _UDEO, + {_sSI: _cUDERo, _smith: None}, + (_dA, _dI, _st, _uC, _uA), + ((DATASET_ARN, 1), (DATASET_ID, 1), (DATASET_STATUS, 1), (8, 1), (4, 1)), +) + +UPDATE_DATASET_EXAMPLES: StaticOperationSchema = ( + 23, + n0, + _UDE, + { + _smithy: MappingProxyType( + { + "method": "POST", + "uri": "/datasets/{datasetId}/examples/update", + "code": 202, + } + ) + }, + UPDATE_DATASET_EXAMPLES_INPUT, + UPDATE_DATASET_EXAMPLES_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -BROWSER_PROFILE_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#BrowserProfileId"), - shape_type=ShapeType.STRING, +DELETE_RESOURCE_POLICY_INPUT: StaticSchema = ( + 18, + n0, + _DRPI, + {_sSI: _cDRPR, _smit: None}, + (_rAe,), + ((BEDROCK_AGENTCORE_RESOURCE_ARN, 9),), ) -BROWSER_PROFILE_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#BrowserProfileName"), - shape_type=ShapeType.STRING, +DELETE_RESOURCE_POLICY_OUTPUT: StaticSchema = ( + 18, + n0, + _DRPO, + {_sSI: _cDRPRo, _smith: None}, ) -CREATE_BROWSER_PROFILE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateBrowserProfileInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreateBrowserProfileRequest", +DELETE_RESOURCE_POLICY: StaticOperationSchema = ( + 23, + n0, + _DRP, + { + _smithy: MappingProxyType( + {"code": 204, "method": "DELETE", "uri": "/resourcepolicy/{resourceArn}"} ) - ], - members={ - "name": { - "target": BROWSER_PROFILE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "tags": {"target": TAGS_MAP}, }, + DELETE_RESOURCE_POLICY_INPUT, + DELETE_RESOURCE_POLICY_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -BROWSER_PROFILE_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#BrowserProfileArn"), - shape_type=ShapeType.STRING, -) +EVALUATOR_DESCRIPTION: StaticSchema = (3, n0, _ED, 4) -BROWSER_PROFILE_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#BrowserProfileStatus"), - shape_type=ShapeType.ENUM, - members={ - "READY": {"target": UNIT}, - "DELETING": {"target": UNIT}, - "DELETED": {"target": UNIT}, - "SAVING": {"target": UNIT}, - }, -) +LAMBDA_ARN: StaticSchema = (3, n0, _LAa, 0) -CREATE_BROWSER_PROFILE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateBrowserProfileOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreateBrowserProfileResponse", - ) - ], - members={ - "profileId": { - "target": BROWSER_PROFILE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "profileArn": { - "target": BROWSER_PROFILE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": BROWSER_PROFILE_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +LAMBDA_EVALUATOR_CONFIG: StaticSchema = ( + 18, + n0, + _LEC, + 0, + (_lA, _lTIS), + ((LAMBDA_ARN, 1), (7, 0)), ) -CREATE_BROWSER_PROFILE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateBrowserProfile"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "PUT", "uri": "/browser-profiles"} - ), - ) - ], +CODE_BASED_EVALUATOR_CONFIG: StaticSchema = ( + 19, + n0, + _CBEC, + 0, + (_lCa,), + ((LAMBDA_EVALUATOR_CONFIG, 0),), ) -DELETE_BROWSER_PROFILE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteBrowserProfileInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeleteBrowserProfileRequest", - ) - ], - members={ - "profileId": { - "target": BROWSER_PROFILE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#idempotencyToken")), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="clientToken"), - ], - }, - }, -) +EVALUATOR_ID: StaticSchema = (3, n0, _EIv, 0) -DELETE_BROWSER_PROFILE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteBrowserProfileOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeleteBrowserProfileResponse", - ) - ], - members={ - "profileId": { - "target": BROWSER_PROFILE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "profileArn": { - "target": BROWSER_PROFILE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": BROWSER_PROFILE_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastUpdatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastSavedAt": {"target": DATE_TIMESTAMP}, - }, -) +NON_EMPTY_STRING: StaticSchema = (3, n0, _NES, 0) -DELETE_BROWSER_PROFILE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteBrowserProfile"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "DELETE", - "uri": "/browser-profiles/{profileId}", - } - ), - ) - ], +NON_EMPTY_STRING_LIST: StaticSchema = ( + 16, + n0, + _NESL, + 0, + (_mem,), + ((NON_EMPTY_STRING, 0),), ) -GET_BROWSER_PROFILE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetBrowserProfileInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetBrowserProfileRequest", - ) - ], - members={ - "profileId": { - "target": BROWSER_PROFILE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, +INFERENCE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _ICn, + 0, + (_mT, _te, _tP, _sSt), + ((7, 0), (9, 0), (9, 0), (NON_EMPTY_STRING_LIST, 0)), ) -BROWSER_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#BrowserId"), - shape_type=ShapeType.STRING, -) +MODEL_ID: StaticSchema = (3, n0, _MI, 0) -BROWSER_SESSION_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#BrowserSessionId"), - shape_type=ShapeType.STRING, +BEDROCK_EVALUATOR_MODEL_CONFIG: StaticSchema = ( + 18, + n0, + _BEMC, + 0, + (_mI, _iCn, _aMRF), + ((MODEL_ID, 1), (INFERENCE_CONFIGURATION, 0), (ADDITIONAL_MODEL_REQUEST_FIELDS, 0)), +) + +REASONING_CONFIGURATION: StaticSchema = (18, n0, _RCea, 0, (_ef,), ((3, 0),)) + +OPEN_RESPONSES_EVALUATOR_MODEL_CONFIG: StaticSchema = ( + 18, + n0, + _OREMC, + 0, + (_mI, _mOT, _te, _tP, _rea), + ((MODEL_ID, 1), (7, 0), (9, 0), (9, 0), (REASONING_CONFIGURATION, 0)), +) + +EVALUATOR_MODEL_CONFIG: StaticSchema = ( + 19, + n0, + _EMC, + 0, + (_bEMC, _rEMC), + ((BEDROCK_EVALUATOR_MODEL_CONFIG, 0), (OPEN_RESPONSES_EVALUATOR_MODEL_CONFIG, 0)), +) + +DERIVED_EVALUATOR_CONFIG: StaticSchema = ( + 18, + n0, + _DEC, + 0, + (_bEI, _mCo), + ((EVALUATOR_ID, 1), (EVALUATOR_MODEL_CONFIG, 1)), +) + +EVALUATOR_INSTRUCTIONS: StaticSchema = (3, n0, _EIva, 4) + +CATEGORICAL_SCALE_DEFINITION: StaticSchema = ( + 18, + n0, + _CSD, + 0, + (_de, _la), + ((3, 1), (3, 1)), +) + +CATEGORICAL_SCALE_DEFINITIONS: StaticSchema = ( + 16, + n0, + _CSDa, + 0, + (_mem,), + ((CATEGORICAL_SCALE_DEFINITION, 0),), +) + +NUMERICAL_SCALE_DEFINITION: StaticSchema = ( + 18, + n0, + _NSD, + 0, + (_de, _v, _la), + ((3, 1), (10, 1), (3, 1)), +) + +NUMERICAL_SCALE_DEFINITIONS: StaticSchema = ( + 16, + n0, + _NSDu, + 0, + (_mem,), + ((NUMERICAL_SCALE_DEFINITION, 0),), +) + +RATING_SCALE: StaticSchema = ( + 19, + n0, + _RS, + 4, + (_nu, _ca), + ((NUMERICAL_SCALE_DEFINITIONS, 0), (CATEGORICAL_SCALE_DEFINITIONS, 0)), +) + +LLM_AS_A_JUDGE_EVALUATOR_CONFIG: StaticSchema = ( + 18, + n0, + _LAAJEC, + 0, + (_in, _rS, _mCo), + ((EVALUATOR_INSTRUCTIONS, 1), (RATING_SCALE, 1), (EVALUATOR_MODEL_CONFIG, 1)), +) + +EVALUATOR_CONFIG: StaticSchema = ( + 19, + n0, + _ECv, + 0, + (_lAAJ, _cBo, _der), + ( + (LLM_AS_A_JUDGE_EVALUATOR_CONFIG, 0), + (CODE_BASED_EVALUATOR_CONFIG, 0), + (DERIVED_EVALUATOR_CONFIG, 0), + ), ) -GET_BROWSER_PROFILE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetBrowserProfileOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetBrowserProfileResponse", - ) - ], - members={ - "profileId": { - "target": BROWSER_PROFILE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "profileArn": { - "target": BROWSER_PROFILE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": BROWSER_PROFILE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "status": { - "target": BROWSER_PROFILE_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastUpdatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastSavedAt": {"target": DATE_TIMESTAMP}, - "lastSavedBrowserSessionId": {"target": BROWSER_SESSION_ID}, - "lastSavedBrowserId": {"target": BROWSER_ID}, - }, +CUSTOM_EVALUATOR_NAME: StaticSchema = (3, n0, _CEN, 0) + +EVALUATOR_LEVEL: StaticSchema = ( + 14, + n0, + _EL, + 0, + (_TC, _TRACE, _SESSION), + ((-1, {_sVm: _TC}), (-1, {_sVm: _TRACE}), (-1, {_sVm: _SESSION})), +) + +CREATE_EVALUATOR_INPUT: StaticSchema = ( + 18, + n0, + _CEI, + {_sSI: _cCER, _smit: None}, + (_cT, _eNv, _d, _eCv, _le, _kKA, _t), + ( + (CLIENT_TOKEN, 2), + (CUSTOM_EVALUATOR_NAME, 1), + (EVALUATOR_DESCRIPTION, 0), + (EVALUATOR_CONFIG, 1), + (EVALUATOR_LEVEL, 1), + (KMS_KEY_ARN, 0), + (TAGS_MAP, 0), + ), ) -GET_BROWSER_PROFILE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetBrowserProfile"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "GET", "uri": "/browser-profiles/{profileId}"} - ), - ) - ], +CUSTOM_EVALUATOR_ARN: StaticSchema = (3, n0, _CEA, 0) + +EVALUATOR_STATUS: StaticSchema = ( + 14, + n0, + _ES, + 0, + (_ACTIVE, _CREATING, _CF, _UPDATING, _UF, _DELETING), + ( + (-1, {_sVm: _ACTIVE}), + (-1, {_sVm: _CREATING}), + (-1, {_sVm: _CF}), + (-1, {_sVm: _UPDATING}), + (-1, {_sVm: _UF}), + (-1, {_sVm: _DELETING}), + ), ) -LIST_BROWSER_PROFILES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListBrowserProfilesInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListBrowserProfilesRequest", - ) - ], - members={ - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "name": {"target": BROWSER_PROFILE_NAME}, - }, +CREATE_EVALUATOR_OUTPUT: StaticSchema = ( + 18, + n0, + _CEO, + {_sSI: _cCERo, _smith: None}, + (_eA, _eIv, _cA, _st), + ((CUSTOM_EVALUATOR_ARN, 1), (EVALUATOR_ID, 1), (4, 1), (EVALUATOR_STATUS, 1)), +) + +CREATE_EVALUATOR: StaticOperationSchema = ( + 23, + n0, + _CEr, + { + _smithy: MappingProxyType( + {"method": "POST", "uri": "/evaluators/create", "code": 202} + ) + }, + CREATE_EVALUATOR_INPUT, + CREATE_EVALUATOR_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -BROWSER_PROFILE_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#BrowserProfileSummary"), - members={ - "profileId": { - "target": BROWSER_PROFILE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "profileArn": { - "target": BROWSER_PROFILE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": BROWSER_PROFILE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "status": { - "target": BROWSER_PROFILE_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastUpdatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastSavedAt": {"target": DATE_TIMESTAMP}, - "lastSavedBrowserSessionId": {"target": BROWSER_SESSION_ID}, - "lastSavedBrowserId": {"target": BROWSER_ID}, - }, +DELETE_EVALUATOR_INPUT: StaticSchema = ( + 18, + n0, + _DEI, + {_sSI: _cDER, _smit: None}, + (_eIv,), + ((EVALUATOR_ID, 9),), +) + +EVALUATOR_ARN: StaticSchema = (3, n0, _EA, 0) + +DELETE_EVALUATOR_OUTPUT: StaticSchema = ( + 18, + n0, + _DEO, + {_sSI: _cDERo, _smith: None}, + (_eA, _eIv, _st), + ((EVALUATOR_ARN, 1), (EVALUATOR_ID, 1), (EVALUATOR_STATUS, 1)), +) + +DELETE_EVALUATOR: StaticOperationSchema = ( + 23, + n0, + _DE, + { + _smithy: MappingProxyType( + {"method": "DELETE", "uri": "/evaluators/{evaluatorId}", "code": 202} + ) + }, + DELETE_EVALUATOR_INPUT, + DELETE_EVALUATOR_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -BROWSER_PROFILE_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#BrowserProfileSummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": BROWSER_PROFILE_SUMMARY}}, +INCLUDED_DATA: StaticSchema = ( + 14, + n0, + _ID, + 0, + (_AD_, _MO), + ((-1, {_sVm: _AD_}), (-1, {_sVm: _MO})), +) + +GET_EVALUATOR_INPUT: StaticSchema = ( + 18, + n0, + _GEI, + {_sSI: _cGER, _smit: None}, + (_eIv, _iD), + ((EVALUATOR_ID, 9), (INCLUDED_DATA, {_sQ: _iD})), +) + +EVALUATOR_NAME: StaticSchema = (3, n0, _ENv, 0) + +EVALUATOR_TYPE: StaticSchema = ( + 14, + n0, + _ET, + 0, + (_BUILTIN, _TP, _CUSTOM, _CODE, _CD_), + ( + (-1, {_sVm: _B}), + (-1, {_sVm: _TPh}), + (-1, {_sVm: _Cu}), + (-1, {_sVm: _CCu}), + (-1, {_sVm: _CDu}), + ), ) -LIST_BROWSER_PROFILES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListBrowserProfilesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListBrowserProfilesResponse", - ) - ], - members={ - "profileSummaries": { - "target": BROWSER_PROFILE_SUMMARIES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": NEXT_TOKEN}, - }, +PROVIDER: StaticSchema = ( + 14, + n0, + _Pr, + 0, + (_AWS, _DE_, _AE, _CUSTOM), + ((-1, {_sVm: _AWS}), (-1, {_sVm: _DEe}), (-1, {_sVm: _AEu}), (-1, {_sVm: _Cu})), +) + +GET_EVALUATOR_OUTPUT: StaticSchema = ( + 18, + n0, + _GEO, + {_sSI: _cGERo, _smith: None}, + (_eA, _eIv, _eNv, _d, _eCv, _eT, _pr, _le, _st, _cA, _uA, _lFM, _kKA), + ( + (EVALUATOR_ARN, 1), + (EVALUATOR_ID, 1), + (EVALUATOR_NAME, 1), + (EVALUATOR_DESCRIPTION, 0), + (EVALUATOR_CONFIG, 1), + (EVALUATOR_TYPE, 0), + (PROVIDER, 0), + (EVALUATOR_LEVEL, 1), + (EVALUATOR_STATUS, 1), + (4, 1), + (4, 1), + (2, 0), + (KMS_KEY_ARN, 0), + ), ) -LIST_BROWSER_PROFILES = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListBrowserProfiles"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "POST", "uri": "/browser-profiles"} - ), - ) - ], -) - -BROWSER_SIGNING_CONFIG_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#BrowserSigningConfigInput"), - members={ - "enabled": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=False), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, +GET_EVALUATOR: StaticOperationSchema = ( + 23, + n0, + _GE, + {_smithy: MappingProxyType({"method": "GET", "uri": "/evaluators/{evaluatorId}"})}, + GET_EVALUATOR_INPUT, + GET_EVALUATOR_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -TOOL_SECRET_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ToolSecretArn"), - shape_type=ShapeType.STRING, +LIST_EVALUATORS_INPUT: StaticSchema = ( + 18, + n0, + _LEI, + {_sSI: _cLER, _smit: None}, + (_nT, _mR), + ((3, {_sQ: _nT}), (7, {_sQ: _mR})), +) + +EVALUATOR_SUMMARY: StaticSchema = ( + 18, + n0, + _ESv, + 0, + (_eA, _eIv, _eNv, _d, _eT, _pr, _le, _st, _cA, _uA, _lFM, _kKA), + ( + (EVALUATOR_ARN, 1), + (EVALUATOR_ID, 1), + (EVALUATOR_NAME, 1), + (EVALUATOR_DESCRIPTION, 0), + (EVALUATOR_TYPE, 1), + (PROVIDER, 0), + (EVALUATOR_LEVEL, 0), + (EVALUATOR_STATUS, 1), + (4, 1), + (4, 1), + (2, 0), + (KMS_KEY_ARN, 0), + ), ) -SECRETS_MANAGER_LOCATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SecretsManagerLocation"), - members={ - "secretArn": { - "target": TOOL_SECRET_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +EVALUATOR_SUMMARY_LIST: StaticSchema = ( + 16, + n0, + _ESL, + 0, + (_mem,), + ((EVALUATOR_SUMMARY, 0),), +) + +LIST_EVALUATORS_OUTPUT: StaticSchema = ( + 18, + n0, + _LEO, + {_sSI: _cLERo, _smith: None}, + (_ev, _nT), + ((EVALUATOR_SUMMARY_LIST, 1), (3, 0)), +) + +LIST_EVALUATORS: StaticOperationSchema = ( + 23, + n0, + _LE, + {_smithy: MappingProxyType({"method": "POST", "uri": "/evaluators"})}, + LIST_EVALUATORS_INPUT, + LIST_EVALUATORS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CERTIFICATE_LOCATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CertificateLocation"), - shape_type=ShapeType.UNION, - members={"secretsManager": {"target": SECRETS_MANAGER_LOCATION}}, +UPDATE_EVALUATOR_INPUT: StaticSchema = ( + 18, + n0, + _UEI, + {_sSI: _cUER, _smit: None}, + (_cT, _eIv, _d, _eCv, _le, _kKA), + ( + (CLIENT_TOKEN, 2), + (EVALUATOR_ID, 9), + (EVALUATOR_DESCRIPTION, 0), + (EVALUATOR_CONFIG, 0), + (EVALUATOR_LEVEL, 0), + (KMS_KEY_ARN, 0), + ), ) -CERTIFICATE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#Certificate"), - members={ - "location": { - "target": CERTIFICATE_LOCATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +UPDATE_EVALUATOR_OUTPUT: StaticSchema = ( + 18, + n0, + _UEO, + {_sSI: _cUERo, _smith: None}, + (_eA, _eIv, _uA, _st), + ((EVALUATOR_ARN, 1), (EVALUATOR_ID, 1), (4, 1), (EVALUATOR_STATUS, 1)), +) + +UPDATE_EVALUATOR: StaticOperationSchema = ( + 23, + n0, + _UEp, + { + _smithy: MappingProxyType( + {"method": "PUT", "uri": "/evaluators/{evaluatorId}", "code": 202} + ) + }, + UPDATE_EVALUATOR_INPUT, + UPDATE_EVALUATOR_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CERTIFICATES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#Certificates"), - shape_type=ShapeType.LIST, - members={"member": {"target": CERTIFICATE}}, -) +GATEWAY_IDENTIFIER: StaticSchema = (3, n0, _GI, 0) -RESOURCE_LOCATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceLocation"), - shape_type=ShapeType.UNION, - members={"s3": {"target": S3_LOCATION}}, -) +GATEWAY_RATE_LIMIT_DESCRIPTION: StaticSchema = (3, n0, _GRLD, 0) -BROWSER_ENTERPRISE_POLICY_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#BrowserEnterprisePolicyType"), - shape_type=ShapeType.ENUM, - members={"MANAGED": {"target": UNIT}, "RECOMMENDED": {"target": UNIT}}, -) +DIMENSION_KEY: StaticSchema = (3, n0, _DK, 0) -BROWSER_ENTERPRISE_POLICY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#BrowserEnterprisePolicy"), - members={ - "location": { - "target": RESOURCE_LOCATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "type": {"target": BROWSER_ENTERPRISE_POLICY_TYPE}, - }, -) +DIMENSION_KEYS: StaticSchema = (16, n0, _DKi, 0, (_mem,), ((DIMENSION_KEY, 0),)) -BROWSER_ENTERPRISE_POLICIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#BrowserEnterprisePolicies"), - shape_type=ShapeType.LIST, - members={"member": {"target": BROWSER_ENTERPRISE_POLICY}}, -) - -EFS_FILE_SYSTEM_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#EfsFileSystemArn"), - shape_type=ShapeType.STRING, -) - -EFS_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#EfsConfiguration"), - members={ - "accessPointArn": { - "target": EFS_ACCESS_POINT_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "mountPath": { - "target": MOUNT_PATH, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "fileSystemArn": { - "target": EFS_FILE_SYSTEM_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +PERIOD: StaticSchema = ( + 14, + n0, + _Pe, + 0, + (_SECOND, _MINUTE), + ((-1, {_sVm: _sec}), (-1, {_sVm: _mi})), ) -S3_FILES_FILE_SYSTEM_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#S3FilesFileSystemArn"), - shape_type=ShapeType.STRING, -) - -S3_FILES_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#S3FilesConfiguration"), - members={ - "accessPointArn": { - "target": S3_FILES_ACCESS_POINT_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "mountPath": { - "target": MOUNT_PATH, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "fileSystemArn": { - "target": S3_FILES_FILE_SYSTEM_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +RATE_CONFIG: StaticSchema = (18, n0, _RCa, 0, (_ra, _pe), ((10, 1), (PERIOD, 1))) -TOOLS_FILE_SYSTEM_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ToolsFileSystemConfiguration"), - shape_type=ShapeType.UNION, - members={ - "s3FilesConfiguration": {"target": S3_FILES_CONFIGURATION}, - "efsConfiguration": {"target": EFS_CONFIGURATION}, - }, -) +RATE_CONFIGS: StaticSchema = (16, n0, _RCat, 0, (_mem,), ((RATE_CONFIG, 0),)) -TOOLS_FILE_SYSTEM_CONFIGURATIONS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ToolsFileSystemConfigurations"), - shape_type=ShapeType.LIST, - members={"member": {"target": TOOLS_FILE_SYSTEM_CONFIGURATION}}, -) +DIMENSION_VALUE: StaticSchema = (3, n0, _DVi, 0) -SANDBOX_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SandboxName"), - shape_type=ShapeType.STRING, +DIMENSIONS: StaticSchema = ( + 17, + n0, + _Di, + 0, + (_k, _v), + ((DIMENSION_KEY, 0), (DIMENSION_VALUE, 0)), ) -BROWSER_NETWORK_MODE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#BrowserNetworkMode"), - shape_type=ShapeType.ENUM, - members={"PUBLIC": {"target": UNIT}, "VPC": {"target": UNIT}}, +LIMIT_ENTRY: StaticSchema = ( + 18, + n0, + _LEi, + 0, + (_di, _req, _to, _conn), + ((DIMENSIONS, 1), (RATE_CONFIGS, 0), (RATE_CONFIGS, 0), (RATE_CONFIGS, 0)), ) -BROWSER_NETWORK_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#BrowserNetworkConfiguration"), - members={ - "networkMode": { - "target": BROWSER_NETWORK_MODE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value="PUBLIC"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "vpcConfig": {"target": VPC_CONFIG}, - }, -) +LIMIT_ENTRIES: StaticSchema = (16, n0, _LEim, 0, (_mem,), ((LIMIT_ENTRY, 0),)) -RECORDING_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#RecordingConfig"), - members={ - "enabled": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "s3Location": {"target": S3_LOCATION}, - }, -) +GATEWAY_RATE_LIMIT_ID: StaticSchema = (3, n0, _GRLI, 0) -CREATE_BROWSER_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateBrowserInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreateBrowserRequest", - ) - ], - members={ - "name": { - "target": SANDBOX_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "executionRoleArn": {"target": ROLE_ARN}, - "networkConfiguration": { - "target": BROWSER_NETWORK_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "recording": {"target": RECORDING_CONFIG}, - "browserSigning": {"target": BROWSER_SIGNING_CONFIG_INPUT}, - "enterprisePolicies": {"target": BROWSER_ENTERPRISE_POLICIES}, - "certificates": {"target": CERTIFICATES}, - "filesystemConfigurations": {"target": TOOLS_FILE_SYSTEM_CONFIGURATIONS}, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "tags": {"target": TAGS_MAP}, - }, +BATCH_PUT_LIMIT_ENTRY: StaticSchema = ( + 18, + n0, + _BPLE, + 0, + (_rLI, _d, _dK, _ent), + ( + (GATEWAY_RATE_LIMIT_ID, 0), + (GATEWAY_RATE_LIMIT_DESCRIPTION, 0), + (DIMENSION_KEYS, 1), + (LIMIT_ENTRIES, 1), + ), ) -BROWSER_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#BrowserArn"), - shape_type=ShapeType.STRING, +BATCH_PUT_LIMIT_ENTRIES: StaticSchema = ( + 16, + n0, + _BPLEa, + 0, + (_mem,), + ((BATCH_PUT_LIMIT_ENTRY, 0),), +) + +BATCH_PUT_GATEWAY_RATE_LIMITS_INPUT: StaticSchema = ( + 18, + n0, + _BPGRLI, + {_sSI: _cBPGRLR, _smit: None}, + (_gI, _cT, _rL), + ((GATEWAY_IDENTIFIER, 9), (CLIENT_TOKEN, 2), (BATCH_PUT_LIMIT_ENTRIES, 1)), +) + +GATEWAY_RATE_LIMIT_STATUS: StaticSchema = ( + 14, + n0, + _GRLS, + 0, + (_CREATING, _ACTIVE, _UPDATING, _DELETING), + ( + (-1, {_sVm: _CREATING}), + (-1, {_sVm: _ACTIVE}), + (-1, {_sVm: _UPDATING}), + (-1, {_sVm: _DELETING}), + ), ) -BROWSER_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#BrowserStatus"), - shape_type=ShapeType.ENUM, - members={ - "CREATING": {"target": UNIT}, - "CREATE_FAILED": {"target": UNIT}, - "READY": {"target": UNIT}, - "DELETING": {"target": UNIT}, - "DELETE_FAILED": {"target": UNIT}, - "DELETED": {"target": UNIT}, - }, +GATEWAY_RATE_LIMIT_DETAIL: StaticSchema = ( + 18, + n0, + _GRLDa, + 0, + (_rLI, _gI, _d, _dK, _ent, _st, _cA, _uA), + ( + (GATEWAY_RATE_LIMIT_ID, 1), + (GATEWAY_IDENTIFIER, 1), + (GATEWAY_RATE_LIMIT_DESCRIPTION, 0), + (DIMENSION_KEYS, 1), + (LIMIT_ENTRIES, 1), + (GATEWAY_RATE_LIMIT_STATUS, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + ), ) -CREATE_BROWSER_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateBrowserOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreateBrowserResponse", - ) - ], - members={ - "browserId": { - "target": BROWSER_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "browserArn": { - "target": BROWSER_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": BROWSER_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +GATEWAY_RATE_LIMITS: StaticSchema = ( + 16, + n0, + _GRL, + 0, + (_mem,), + ((GATEWAY_RATE_LIMIT_DETAIL, 0),), +) + +BATCH_PUT_GATEWAY_RATE_LIMITS_OUTPUT: StaticSchema = ( + 18, + n0, + _BPGRLO, + {_sSI: _cBPGRLRo, _smith: None}, + (_rL,), + ((GATEWAY_RATE_LIMITS, 1),), +) + +BATCH_PUT_GATEWAY_RATE_LIMITS: StaticOperationSchema = ( + 23, + n0, + _BPGRL, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "PUT", + "uri": "/gateways/{gatewayIdentifier}/rate-limits/batch", + } + ) + }, + BATCH_PUT_GATEWAY_RATE_LIMITS_INPUT, + BATCH_PUT_GATEWAY_RATE_LIMITS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CREATE_BROWSER = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateBrowser"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType({"code": 202, "method": "PUT", "uri": "/browsers"}), - ) - ], +CREATE_GATEWAY_RATE_LIMIT_INPUT: StaticSchema = ( + 18, + n0, + _CGRLI, + {_sSI: _cCGRLR, _smit: None}, + (_gI, _cT, _rLI, _d, _dK, _ent), + ( + (GATEWAY_IDENTIFIER, 9), + (CLIENT_TOKEN, 2), + (GATEWAY_RATE_LIMIT_ID, 0), + (GATEWAY_RATE_LIMIT_DESCRIPTION, 0), + (DIMENSION_KEYS, 1), + (LIMIT_ENTRIES, 1), + ), ) -DELETE_BROWSER_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteBrowserInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeleteBrowserRequest", - ) - ], - members={ - "browserId": { - "target": BROWSER_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#idempotencyToken")), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="clientToken"), - ], - }, - }, +CREATE_GATEWAY_RATE_LIMIT_OUTPUT: StaticSchema = ( + 18, + n0, + _CGRLO, + {_sSI: _cCGRLRo, _smith: None}, + (_rLI, _gI, _d, _dK, _ent, _st, _cA, _uA), + ( + (GATEWAY_RATE_LIMIT_ID, 1), + (GATEWAY_IDENTIFIER, 1), + (GATEWAY_RATE_LIMIT_DESCRIPTION, 0), + (DIMENSION_KEYS, 1), + (LIMIT_ENTRIES, 1), + (GATEWAY_RATE_LIMIT_STATUS, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + ), ) -DELETE_BROWSER_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteBrowserOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeleteBrowserResponse", - ) - ], - members={ - "browserId": { - "target": BROWSER_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": BROWSER_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastUpdatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +CREATE_GATEWAY_RATE_LIMIT: StaticOperationSchema = ( + 23, + n0, + _CGRL, + { + _smithy: MappingProxyType( + { + "code": 201, + "method": "POST", + "uri": "/gateways/{gatewayIdentifier}/rate-limits", + } + ) + }, + CREATE_GATEWAY_RATE_LIMIT_INPUT, + CREATE_GATEWAY_RATE_LIMIT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -DELETE_BROWSER = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteBrowser"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 202, "method": "DELETE", "uri": "/browsers/{browserId}"} - ), - ) - ], +DELETE_GATEWAY_RATE_LIMIT_INPUT: StaticSchema = ( + 18, + n0, + _DGRLI, + {_sSI: _cDGRLR, _smit: None}, + (_gI, _rLI), + ((GATEWAY_IDENTIFIER, 9), (GATEWAY_RATE_LIMIT_ID, 9)), +) + +DELETE_GATEWAY_RATE_LIMIT_OUTPUT: StaticSchema = ( + 18, + n0, + _DGRLO, + {_sSI: _cDGRLRo, _smith: None}, + (_rLI, _st), + ((GATEWAY_RATE_LIMIT_ID, 1), (GATEWAY_RATE_LIMIT_STATUS, 1)), +) + +DELETE_GATEWAY_RATE_LIMIT: StaticOperationSchema = ( + 23, + n0, + _DGRL, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "DELETE", + "uri": "/gateways/{gatewayIdentifier}/rate-limits/{rateLimitId}", + } + ) + }, + DELETE_GATEWAY_RATE_LIMIT_INPUT, + DELETE_GATEWAY_RATE_LIMIT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -GET_BROWSER_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetBrowserInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetBrowserRequest", - ) - ], - members={ - "browserId": { - "target": BROWSER_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, +GET_GATEWAY_RATE_LIMIT_INPUT: StaticSchema = ( + 18, + n0, + _GGRLI, + {_sSI: _cGGRLR, _smit: None}, + (_gI, _rLI), + ((GATEWAY_IDENTIFIER, 9), (GATEWAY_RATE_LIMIT_ID, 9)), +) + +GET_GATEWAY_RATE_LIMIT_OUTPUT: StaticSchema = ( + 18, + n0, + _GGRLO, + {_sSI: _cGGRLRo, _smith: None}, + (_rLI, _gI, _d, _dK, _ent, _st, _cA, _uA), + ( + (GATEWAY_RATE_LIMIT_ID, 1), + (GATEWAY_IDENTIFIER, 1), + (GATEWAY_RATE_LIMIT_DESCRIPTION, 0), + (DIMENSION_KEYS, 1), + (LIMIT_ENTRIES, 1), + (GATEWAY_RATE_LIMIT_STATUS, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + ), ) -BROWSER_SIGNING_CONFIG_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#BrowserSigningConfigOutput"), - members={ - "enabled": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=False), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, +GET_GATEWAY_RATE_LIMIT: StaticOperationSchema = ( + 23, + n0, + _GGRL, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "GET", + "uri": "/gateways/{gatewayIdentifier}/rate-limits/{rateLimitId}", + } + ) + }, + GET_GATEWAY_RATE_LIMIT_INPUT, + GET_GATEWAY_RATE_LIMIT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -GET_BROWSER_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetBrowserOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetBrowserResponse", - ) - ], - members={ - "browserId": { - "target": BROWSER_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "browserArn": { - "target": BROWSER_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": SANDBOX_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "executionRoleArn": {"target": ROLE_ARN}, - "networkConfiguration": { - "target": BROWSER_NETWORK_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "recording": {"target": RECORDING_CONFIG}, - "browserSigning": {"target": BROWSER_SIGNING_CONFIG_OUTPUT}, - "enterprisePolicies": {"target": BROWSER_ENTERPRISE_POLICIES}, - "certificates": {"target": CERTIFICATES}, - "filesystemConfigurations": {"target": TOOLS_FILE_SYSTEM_CONFIGURATIONS}, - "status": { - "target": BROWSER_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "failureReason": {"target": _STRING}, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastUpdatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +GATEWAY_RATE_LIMIT_MAX_RESULTS: StaticSchema = (7, n0, _GRLMR, 0) -GET_BROWSER = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetBrowser"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "GET", "uri": "/browsers/{browserId}"} - ), - ) - ], -) +GATEWAY_RATE_LIMIT_NEXT_TOKEN: StaticSchema = (3, n0, _GRLNT, 0) -RESOURCE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceType"), - shape_type=ShapeType.ENUM, - members={"SYSTEM": {"target": UNIT}, "CUSTOM": {"target": UNIT}}, +LIST_GATEWAY_RATE_LIMITS_INPUT: StaticSchema = ( + 18, + n0, + _LGRLI, + {_sSI: _cLGRLR, _smit: None}, + (_gI, _mR, _nT), + ( + (GATEWAY_IDENTIFIER, 9), + (GATEWAY_RATE_LIMIT_MAX_RESULTS, {_sQ: _mR}), + (GATEWAY_RATE_LIMIT_NEXT_TOKEN, {_sQ: _nT}), + ), ) -LIST_BROWSERS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListBrowsersInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListBrowsersRequest", - ) - ], - members={ - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "type": { - "target": RESOURCE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="type")], - }, - }, +LIST_GATEWAY_RATE_LIMITS_OUTPUT: StaticSchema = ( + 18, + n0, + _LGRLO, + {_sSI: _cLGRLRo, _smith: None}, + (_rL, _nT), + ((GATEWAY_RATE_LIMITS, 1), (GATEWAY_RATE_LIMIT_NEXT_TOKEN, 0)), +) + +LIST_GATEWAY_RATE_LIMITS: StaticOperationSchema = ( + 23, + n0, + _LGRL, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "GET", + "uri": "/gateways/{gatewayIdentifier}/rate-limits", + } + ) + }, + LIST_GATEWAY_RATE_LIMITS_INPUT, + LIST_GATEWAY_RATE_LIMITS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -BROWSER_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#BrowserSummary"), - members={ - "browserId": { - "target": BROWSER_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "browserArn": { - "target": BROWSER_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": {"target": SANDBOX_NAME}, - "description": {"target": DESCRIPTION}, - "status": { - "target": BROWSER_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastUpdatedAt": {"target": DATE_TIMESTAMP}, - }, +UPDATE_GATEWAY_RATE_LIMIT_INPUT: StaticSchema = ( + 18, + n0, + _UGRLI, + {_sSI: _cUGRLR, _smit: None}, + (_gI, _rLI, _d, _ent), + ( + (GATEWAY_IDENTIFIER, 9), + (GATEWAY_RATE_LIMIT_ID, 9), + (GATEWAY_RATE_LIMIT_DESCRIPTION, 0), + (LIMIT_ENTRIES, 1), + ), ) -BROWSER_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#BrowserSummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": BROWSER_SUMMARY}}, +UPDATE_GATEWAY_RATE_LIMIT_OUTPUT: StaticSchema = ( + 18, + n0, + _UGRLO, + {_sSI: _cUGRLRo, _smith: None}, + (_rLI, _gI, _d, _dK, _ent, _st, _cA, _uA), + ( + (GATEWAY_RATE_LIMIT_ID, 1), + (GATEWAY_IDENTIFIER, 1), + (GATEWAY_RATE_LIMIT_DESCRIPTION, 0), + (DIMENSION_KEYS, 1), + (LIMIT_ENTRIES, 1), + (GATEWAY_RATE_LIMIT_STATUS, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + ), ) -LIST_BROWSERS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListBrowsersOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListBrowsersResponse", - ) - ], - members={ - "browserSummaries": { - "target": BROWSER_SUMMARIES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": NEXT_TOKEN}, - }, +UPDATE_GATEWAY_RATE_LIMIT: StaticOperationSchema = ( + 23, + n0, + _UGRL, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "PATCH", + "uri": "/gateways/{gatewayIdentifier}/rate-limits/{rateLimitId}", + } + ) + }, + UPDATE_GATEWAY_RATE_LIMIT_INPUT, + UPDATE_GATEWAY_RATE_LIMIT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -LIST_BROWSERS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListBrowsers"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType({"code": 200, "method": "POST", "uri": "/browsers"}), - ) - ], +AUTHORIZER_TYPE: StaticSchema = ( + 14, + n0, + _AT, + 0, + (_CJ, _AI, _NONE, _AO), + ((-1, {_sVm: _CJ}), (-1, {_sVm: _AI}), (-1, {_sVm: _NONE}), (-1, {_sVm: _AO})), +) + +GATEWAY_DESCRIPTION: StaticSchema = (3, n0, _GDa, 4) + +EXCEPTION_LEVEL: StaticSchema = (14, n0, _ELx, 0, (_DEBUG,), ((-1, {_sVm: _DEBUG}),)) + +INTERCEPTOR_PAYLOAD_EXCLUSION: StaticSchema = ( + 14, + n0, + _IPE, + 0, + (_RB,), + ((-1, {_sVm: _RB}),), +) + +INTERCEPTOR_PAYLOAD_EXCLUSION_SELECTOR: StaticSchema = ( + 19, + n0, + _IPES, + 0, + (_fi,), + ((INTERCEPTOR_PAYLOAD_EXCLUSION, 0),), +) + +INTERCEPTOR_PAYLOAD_EXCLUSION_SELECTOR_LIST: StaticSchema = ( + 16, + n0, + _IPESL, + 0, + (_mem,), + ((INTERCEPTOR_PAYLOAD_EXCLUSION_SELECTOR, 0),), +) + +INTERCEPTOR_PAYLOAD_FILTER: StaticSchema = ( + 18, + n0, + _IPF, + 0, + (_ex,), + ((INTERCEPTOR_PAYLOAD_EXCLUSION_SELECTOR_LIST, 1),), +) + +INTERCEPTOR_INPUT_CONFIGURATION: StaticSchema = ( + 18, + n0, + _IIC, + 0, + (_pRH, _pF), + ((2, 1), (INTERCEPTOR_PAYLOAD_FILTER, 0)), +) + +GATEWAY_INTERCEPTION_POINT: StaticSchema = ( + 14, + n0, + _GIP, + 0, + (_REQUEST, _RESPONSE), + ((-1, {_sVm: _REQUEST}), (-1, {_sVm: _RESPONSE})), +) + +GATEWAY_INTERCEPTION_POINTS: StaticSchema = ( + 16, + n0, + _GIPa, + 0, + (_mem,), + ((GATEWAY_INTERCEPTION_POINT, 0),), +) + +LAMBDA_FUNCTION_ARN: StaticSchema = (3, n0, _LFA, 0) + +LAMBDA_INTERCEPTOR_CONFIGURATION: StaticSchema = ( + 18, + n0, + _LIC, + 0, + (_a,), + ((LAMBDA_FUNCTION_ARN, 1),), +) + +INTERCEPTOR_CONFIGURATION: StaticSchema = ( + 19, + n0, + _ICnt, + 0, + (_lam,), + ((LAMBDA_INTERCEPTOR_CONFIGURATION, 0),), +) + +GATEWAY_INTERCEPTOR_CONFIGURATION: StaticSchema = ( + 18, + n0, + _GIC, + 0, + (_int, _iP, _iCnp), + ( + (INTERCEPTOR_CONFIGURATION, 1), + (GATEWAY_INTERCEPTION_POINTS, 1), + (INTERCEPTOR_INPUT_CONFIGURATION, 0), + ), ) -CAPACITY_PROVIDER_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CapacityProviderId"), - shape_type=ShapeType.STRING, +GATEWAY_INTERCEPTOR_CONFIGURATIONS: StaticSchema = ( + 16, + n0, + _GICa, + 0, + (_mem,), + ((GATEWAY_INTERCEPTOR_CONFIGURATION, 0),), ) -CAPACITY_RESERVATION_PREFERENCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CapacityReservationPreference"), - shape_type=ShapeType.ENUM, - members={ - "CAPACITY_RESERVATIONS_ONLY": {"target": UNIT}, - "OPEN": {"target": UNIT}, - "NONE": {"target": UNIT}, - }, -) +GATEWAY_NAME: StaticSchema = (3, n0, _GN, 0) -CAPACITY_RESERVATION_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CapacityReservationId"), - shape_type=ShapeType.STRING, -) +GATEWAY_POLICY_ENGINE_ARN: StaticSchema = (3, n0, _GPEA, 0) -CAPACITY_RESERVATION_RESOURCE_GROUP_ARN = Schema( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#CapacityReservationResourceGroupArn" - ), - shape_type=ShapeType.STRING, +GATEWAY_POLICY_ENGINE_MODE: StaticSchema = ( + 14, + n0, + _GPEM, + 0, + (_LO, _ENFORCE), + ((-1, {_sVm: _LO}), (-1, {_sVm: _ENFORCE})), ) -CAPACITY_RESERVATION_TARGET = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CapacityReservationTarget"), - members={ - "capacityReservationId": {"target": CAPACITY_RESERVATION_ID}, - "capacityReservationResourceGroupArn": { - "target": CAPACITY_RESERVATION_RESOURCE_GROUP_ARN - }, - }, +GATEWAY_POLICY_ENGINE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _GPEC, + 0, + (_a, _mod), + ((GATEWAY_POLICY_ENGINE_ARN, 1), (GATEWAY_POLICY_ENGINE_MODE, 1)), ) -CAPACITY_RESERVATION_SPECIFICATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#CapacityReservationSpecification" +MCP_INSTRUCTIONS: StaticSchema = (3, n0, _MIc, 4) + +SEARCH_TYPE: StaticSchema = (14, n0, _STe, 0, (_SEMANTIC,), ((-1, {_sVm: _SEMANTIC}),)) + +SESSION_CONFIGURATION: StaticSchema = (18, n0, _SCe, 0, (_sTIS,), ((7, 0),)) + +STREAMING_CONFIGURATION: StaticSchema = (18, n0, _SCt, 0, (_eRS,), ((2, 0),)) + +MCP_VERSION: StaticSchema = (3, n0, _MV, {_smithya: _v__}) + +MCP_SUPPORTED_VERSIONS: StaticSchema = (16, n0, _MSV, 0, (_mem,), ((MCP_VERSION, 0),)) + +MCP_GATEWAY_CONFIGURATION: StaticSchema = ( + 18, + n0, + _MCPGC, + 0, + (_sVu, _in, _sTe, _sCe, _sCt, _dMLTP), + ( + (MCP_SUPPORTED_VERSIONS, 0), + (MCP_INSTRUCTIONS, 0), + (SEARCH_TYPE, 0), + (SESSION_CONFIGURATION, 0), + (STREAMING_CONFIGURATION, 0), + (2, 0), ), - members={ - "capacityReservationPreference": {"target": CAPACITY_RESERVATION_PREFERENCE}, - "capacityReservationTarget": {"target": CAPACITY_RESERVATION_TARGET}, - }, ) -DEVICE_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeviceName"), - shape_type=ShapeType.STRING, +GATEWAY_PROTOCOL_CONFIGURATION: StaticSchema = ( + 19, + n0, + _GPC, + 0, + (_mc,), + ((MCP_GATEWAY_CONFIGURATION, 0),), +) + +GATEWAY_PROTOCOL_TYPE: StaticSchema = (14, n0, _GPT, 0, (_MCP,), ((-1, {_sVm: _MCP}),)) + +CREATE_GATEWAY_INPUT: StaticSchema = ( + 18, + n0, + _CGI, + {_sSI: _cCGR, _smit: None}, + (_n, _d, _cT, _rA, _pTr, _pC, _aT, _aCu, _kKA, _iCnt, _pEC, _eL, _t), + ( + (GATEWAY_NAME, 1), + (GATEWAY_DESCRIPTION, 0), + (CLIENT_TOKEN, 2), + (ROLE_ARN, 1), + (GATEWAY_PROTOCOL_TYPE, {_smithya: _MCP}), + (GATEWAY_PROTOCOL_CONFIGURATION, 0), + (AUTHORIZER_TYPE, 1), + (AUTHORIZER_CONFIGURATION, 0), + (KMS_KEY_ARN, 0), + (GATEWAY_INTERCEPTOR_CONFIGURATIONS, 0), + (GATEWAY_POLICY_ENGINE_CONFIGURATION, 0), + (EXCEPTION_LEVEL, 0), + (TAGS_MAP, 0), + ), ) -EBS_CARD_INDEX = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#EbsCardIndex"), - shape_type=ShapeType.INTEGER, +LAMBDA_TRANSFORM_CONFIGURATION: StaticSchema = ( + 18, + n0, + _LTC, + 0, + (_a,), + ((LAMBDA_FUNCTION_ARN, 0),), ) -VOLUME_IOPS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#VolumeIops"), - shape_type=ShapeType.INTEGER, +CUSTOM_TRANSFORM_CONFIGURATION: StaticSchema = ( + 18, + n0, + _CTC, + 0, + (_lam,), + ((LAMBDA_TRANSFORM_CONFIGURATION, 0),), ) -KMS_KEY_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#KmsKeyId"), - shape_type=ShapeType.STRING, -) +GATEWAY_ARN: StaticSchema = (3, n0, _GA, 0) -EBS_SNAPSHOT_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#EbsSnapshotId"), - shape_type=ShapeType.STRING, -) +GATEWAY_ID: StaticSchema = (3, n0, _GIa, 0) -VOLUME_THROUGHPUT = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#VolumeThroughput"), - shape_type=ShapeType.INTEGER, -) +GATEWAY_URL: StaticSchema = (3, n0, _GU, 0) -EBS_VOLUME_INITIALIZATION_RATE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#EbsVolumeInitializationRate"), - shape_type=ShapeType.INTEGER, +GATEWAY_STATUS: StaticSchema = ( + 14, + n0, + _GS, + 0, + (_CREATING, _UPDATING, _UU, _DELETING, _READY, _FAILED), + ( + (-1, {_sVm: _CREATING}), + (-1, {_sVm: _UPDATING}), + (-1, {_sVm: _UU}), + (-1, {_sVm: _DELETING}), + (-1, {_sVm: _READY}), + (-1, {_sVm: _FAILED}), + ), ) -VOLUME_SIZE_GI_B = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#VolumeSizeGiB"), - shape_type=ShapeType.INTEGER, +STATUS_REASON: StaticSchema = (3, n0, _SRt, 0) + +STATUS_REASONS: StaticSchema = (16, n0, _SRta, 0, (_mem,), ((STATUS_REASON, 0),)) + +WAF_FAILURE_MODE: StaticSchema = ( + 14, + n0, + _WFM, + 0, + (_FC_, _FO), + ((-1, {_sVm: _FC_}), (-1, {_sVm: _FO})), +) + +WAF_CONFIGURATION: StaticSchema = (18, n0, _WC, 0, (_fM,), ((WAF_FAILURE_MODE, 0),)) + +WEB_ACL_ARN: StaticSchema = (3, n0, _WAA, 0) + +CREATE_GATEWAY_OUTPUT: StaticSchema = ( + 18, + n0, + _CGO, + {_sSI: _cCGRo, _smith: None}, + ( + _gA, + _gIa, + _gU, + _cA, + _uA, + _st, + _sRta, + _n, + _d, + _rA, + _pTr, + _pC, + _aT, + _aCu, + _kKA, + _cTC, + _iCnt, + _pEC, + _wID, + _eL, + _wAA, + _wC, + ), + ( + (GATEWAY_ARN, 1), + (GATEWAY_ID, 1), + (GATEWAY_URL, 0), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (GATEWAY_STATUS, 1), + (STATUS_REASONS, 0), + (GATEWAY_NAME, 1), + (GATEWAY_DESCRIPTION, 0), + (ROLE_ARN, 0), + (GATEWAY_PROTOCOL_TYPE, {_smithya: _MCP}), + (GATEWAY_PROTOCOL_CONFIGURATION, 0), + (AUTHORIZER_TYPE, 1), + (AUTHORIZER_CONFIGURATION, 0), + (KMS_KEY_ARN, 0), + (CUSTOM_TRANSFORM_CONFIGURATION, 0), + (GATEWAY_INTERCEPTOR_CONFIGURATIONS, 0), + (GATEWAY_POLICY_ENGINE_CONFIGURATION, 0), + (WORKLOAD_IDENTITY_DETAILS, 0), + (EXCEPTION_LEVEL, 0), + (WEB_ACL_ARN, 0), + (WAF_CONFIGURATION, 0), + ), ) -EBS_VOLUME_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#EbsVolumeType"), - shape_type=ShapeType.ENUM, - members={ - "STANDARD": {"target": UNIT}, - "IO1": {"target": UNIT}, - "IO2": {"target": UNIT}, - "GP2": {"target": UNIT}, - "SC1": {"target": UNIT}, - "ST1": {"target": UNIT}, - "GP3": {"target": UNIT}, - }, +CREATE_GATEWAY: StaticOperationSchema = ( + 23, + n0, + _CG, + {_smithy: MappingProxyType({"code": 202, "method": "POST", "uri": "/gateways/"})}, + CREATE_GATEWAY_INPUT, + CREATE_GATEWAY_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -EPHEMERAL_EBS_VOLUME_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#EphemeralEBSVolumeConfiguration"), - members={ - "volumeType": { - "target": EBS_VOLUME_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="gp3")], - }, - "iops": {"target": VOLUME_IOPS}, - "throughput": {"target": VOLUME_THROUGHPUT}, - "encrypted": {"target": BOOLEAN}, - "kmsKeyId": {"target": KMS_KEY_ID}, - "snapshotId": {"target": EBS_SNAPSHOT_ID}, - "volumeSize": {"target": VOLUME_SIZE_GI_B}, - "volumeInitializationRate": {"target": EBS_VOLUME_INITIALIZATION_RATE}, - "ebsCardIndex": {"target": EBS_CARD_INDEX}, - }, +DELETE_GATEWAY_INPUT: StaticSchema = ( + 18, + n0, + _DGI, + {_sSI: _cDGR, _smit: None}, + (_gI,), + ((GATEWAY_IDENTIFIER, 9),), +) + +DELETE_GATEWAY_OUTPUT: StaticSchema = ( + 18, + n0, + _DGO, + {_sSI: _cDGRo, _smith: None}, + (_gIa, _st, _sRta), + ((GATEWAY_ID, 1), (GATEWAY_STATUS, 1), (STATUS_REASONS, 0)), +) + +DELETE_GATEWAY: StaticOperationSchema = ( + 23, + n0, + _DG, + { + _smithy: MappingProxyType( + {"code": 202, "method": "DELETE", "uri": "/gateways/{gatewayIdentifier}/"} + ) + }, + DELETE_GATEWAY_INPUT, + DELETE_GATEWAY_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -VIRTUAL_DEVICE_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#VirtualDeviceName"), - shape_type=ShapeType.STRING, +GET_GATEWAY_INPUT: StaticSchema = ( + 18, + n0, + _GGI, + {_sSI: _cGGR, _smit: None}, + (_gI,), + ((GATEWAY_IDENTIFIER, 9),), +) + +GET_GATEWAY_OUTPUT: StaticSchema = ( + 18, + n0, + _GGO, + {_sSI: _cGGRo, _smith: None}, + ( + _gA, + _gIa, + _gU, + _cA, + _uA, + _st, + _sRta, + _n, + _d, + _rA, + _pTr, + _pC, + _aT, + _aCu, + _kKA, + _cTC, + _iCnt, + _pEC, + _wID, + _eL, + _wAA, + _wC, + ), + ( + (GATEWAY_ARN, 1), + (GATEWAY_ID, 1), + (GATEWAY_URL, 0), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (GATEWAY_STATUS, 1), + (STATUS_REASONS, 0), + (GATEWAY_NAME, 1), + (GATEWAY_DESCRIPTION, 0), + (ROLE_ARN, 0), + (GATEWAY_PROTOCOL_TYPE, {_smithya: _MCP}), + (GATEWAY_PROTOCOL_CONFIGURATION, 0), + (AUTHORIZER_TYPE, 1), + (AUTHORIZER_CONFIGURATION, 0), + (KMS_KEY_ARN, 0), + (CUSTOM_TRANSFORM_CONFIGURATION, 0), + (GATEWAY_INTERCEPTOR_CONFIGURATIONS, 0), + (GATEWAY_POLICY_ENGINE_CONFIGURATION, 0), + (WORKLOAD_IDENTITY_DETAILS, 0), + (EXCEPTION_LEVEL, 0), + (WEB_ACL_ARN, 0), + (WAF_CONFIGURATION, 0), + ), ) -EPHEMERAL_BLOCK_DEVICE_MAPPING = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#EphemeralBlockDeviceMapping"), - members={ - "deviceName": {"target": DEVICE_NAME}, - "virtualName": {"target": VIRTUAL_DEVICE_NAME}, - "ebs": {"target": EPHEMERAL_EBS_VOLUME_CONFIGURATION}, +GET_GATEWAY: StaticOperationSchema = ( + 23, + n0, + _GG, + { + _smithy: MappingProxyType( + {"code": 200, "method": "GET", "uri": "/gateways/{gatewayIdentifier}/"} + ) }, + GET_GATEWAY_INPUT, + GET_GATEWAY_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -EPHEMERAL_BLOCK_DEVICE_MAPPING_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#EphemeralBlockDeviceMappingList"), - shape_type=ShapeType.LIST, - members={"member": {"target": EPHEMERAL_BLOCK_DEVICE_MAPPING}}, +GATEWAY_MAX_RESULTS: StaticSchema = (7, n0, _GMR, 0) + +GATEWAY_NEXT_TOKEN: StaticSchema = (3, n0, _GNT, 0) + +LIST_GATEWAYS_INPUT: StaticSchema = ( + 18, + n0, + _LGI, + {_sSI: _cLGR, _smit: None}, + (_mR, _nT), + ((GATEWAY_MAX_RESULTS, {_sQ: _mR}), (GATEWAY_NEXT_TOKEN, {_sQ: _nT})), +) + +GATEWAY_SUMMARY: StaticSchema = ( + 18, + n0, + _GSa, + 0, + (_gIa, _n, _st, _d, _cA, _uA, _aT, _pTr), + ( + (GATEWAY_ID, 1), + (GATEWAY_NAME, 1), + (GATEWAY_STATUS, 1), + (GATEWAY_DESCRIPTION, 0), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (AUTHORIZER_TYPE, 1), + (GATEWAY_PROTOCOL_TYPE, {_smithya: _MCP}), + ), ) -INSTANCE_PROFILE_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#InstanceProfileArn"), - shape_type=ShapeType.STRING, +GATEWAY_SUMMARIES: StaticSchema = (16, n0, _GSat, 0, (_mem,), ((GATEWAY_SUMMARY, 0),)) + +LIST_GATEWAYS_OUTPUT: StaticSchema = ( + 18, + n0, + _LGO, + {_sSI: _cLGRo, _smith: None}, + (_it, _nT), + ((GATEWAY_SUMMARIES, 1), (GATEWAY_NEXT_TOKEN, 0)), +) + +LIST_GATEWAYS: StaticOperationSchema = ( + 23, + n0, + _LG, + {_smithy: MappingProxyType({"code": 200, "method": "GET", "uri": "/gateways/"})}, + LIST_GATEWAYS_INPUT, + LIST_GATEWAYS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -EC2_INSTANCE_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#EC2InstanceType"), - shape_type=ShapeType.STRING, +UPDATE_GATEWAY_INPUT: StaticSchema = ( + 18, + n0, + _UGI, + {_sSI: _cUGR, _smit: None}, + (_gI, _n, _d, _rA, _pTr, _pC, _aT, _aCu, _kKA, _cTC, _iCnt, _pEC, _eL, _wC), + ( + (GATEWAY_IDENTIFIER, 9), + (GATEWAY_NAME, 1), + (GATEWAY_DESCRIPTION, 0), + (ROLE_ARN, 1), + (GATEWAY_PROTOCOL_TYPE, {_smithya: _MCP}), + (GATEWAY_PROTOCOL_CONFIGURATION, 0), + (AUTHORIZER_TYPE, 1), + (AUTHORIZER_CONFIGURATION, 0), + (KMS_KEY_ARN, 0), + (CUSTOM_TRANSFORM_CONFIGURATION, 0), + (GATEWAY_INTERCEPTOR_CONFIGURATIONS, 0), + (GATEWAY_POLICY_ENGINE_CONFIGURATION, 0), + (EXCEPTION_LEVEL, 0), + (WAF_CONFIGURATION, 0), + ), ) -INSTANCE_TYPE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#InstanceTypeList"), - shape_type=ShapeType.LIST, - members={"member": {"target": EC2_INSTANCE_TYPE}}, +UPDATE_GATEWAY_OUTPUT: StaticSchema = ( + 18, + n0, + _UGO, + {_sSI: _cUGRo, _smith: None}, + ( + _gA, + _gIa, + _gU, + _cA, + _uA, + _st, + _sRta, + _n, + _d, + _rA, + _pTr, + _pC, + _aT, + _aCu, + _kKA, + _cTC, + _iCnt, + _pEC, + _wID, + _eL, + _wAA, + _wC, + ), + ( + (GATEWAY_ARN, 1), + (GATEWAY_ID, 1), + (GATEWAY_URL, 0), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (GATEWAY_STATUS, 1), + (STATUS_REASONS, 0), + (GATEWAY_NAME, 1), + (GATEWAY_DESCRIPTION, 0), + (ROLE_ARN, 0), + (GATEWAY_PROTOCOL_TYPE, {_smithya: _MCP}), + (GATEWAY_PROTOCOL_CONFIGURATION, 0), + (AUTHORIZER_TYPE, 1), + (AUTHORIZER_CONFIGURATION, 0), + (KMS_KEY_ARN, 0), + (CUSTOM_TRANSFORM_CONFIGURATION, 0), + (GATEWAY_INTERCEPTOR_CONFIGURATIONS, 0), + (GATEWAY_POLICY_ENGINE_CONFIGURATION, 0), + (WORKLOAD_IDENTITY_DETAILS, 0), + (EXCEPTION_LEVEL, 0), + (WEB_ACL_ARN, 0), + (WAF_CONFIGURATION, 0), + ), ) -INSTANCE_REQUIREMENTS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#InstanceRequirements"), - members={ - "allowedInstanceTypes": { - "target": INSTANCE_TYPE_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +UPDATE_GATEWAY: StaticOperationSchema = ( + 23, + n0, + _UG, + { + _smithy: MappingProxyType( + {"code": 202, "method": "PUT", "uri": "/gateways/{gatewayIdentifier}/"} + ) + }, + UPDATE_GATEWAY_INPUT, + UPDATE_GATEWAY_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -LICENSE_CONFIGURATION_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#LicenseConfigurationArn"), - shape_type=ShapeType.STRING, -) +MATCH_PATH_PATTERN: StaticSchema = (3, n0, _MPP, 0) -LICENSE_SPECIFICATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#LicenseSpecification"), - members={ - "licenseConfigurationArn": { - "target": LICENSE_CONFIGURATION_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +MATCH_PATH_PATTERNS: StaticSchema = ( + 16, + n0, + _MPPa, + 0, + (_mem,), + ((MATCH_PATH_PATTERN, 0),), ) -LICENSE_SPECIFICATION_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#LicenseSpecificationList"), - shape_type=ShapeType.LIST, - members={"member": {"target": LICENSE_SPECIFICATION}}, -) - -MONITORING = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#Monitoring"), - shape_type=ShapeType.ENUM, - members={"BASIC": {"target": UNIT}, "DETAILED": {"target": UNIT}}, -) - -OPERATING_SYSTEM = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#OperatingSystem"), - shape_type=ShapeType.ENUM, - members={"LINUX_X86_64": {"target": UNIT}, "LINUX_ARM64": {"target": UNIT}}, -) - -SSH_KEY_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SSHKeyName"), - shape_type=ShapeType.STRING, -) - -LAUNCH_PARAMETERS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#LaunchParameters"), - members={ - "operatingSystem": { - "target": OPERATING_SYSTEM, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "instanceRequirements": { - "target": INSTANCE_REQUIREMENTS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ephemeralVolumes": {"target": EPHEMERAL_BLOCK_DEVICE_MAPPING_LIST}, - "monitoring": {"target": MONITORING}, - "licenseSpecifications": {"target": LICENSE_SPECIFICATION_LIST}, - "capacityReservationSpecification": { - "target": CAPACITY_RESERVATION_SPECIFICATION - }, - "sshKeyName": {"target": SSH_KEY_NAME}, - "instanceProfileArn": {"target": INSTANCE_PROFILE_ARN}, - "propagatedTags": {"target": TAGS_MAP}, - }, +MATCH_PATHS: StaticSchema = (18, n0, _MPa, 0, (_aO,), ((MATCH_PATH_PATTERNS, 1),)) + +IAM_PRINCIPAL_ARN: StaticSchema = (3, n0, _IPAa, 0) + +PRINCIPAL_MATCH_OPERATOR: StaticSchema = ( + 14, + n0, + _PMO, + 0, + (_SE, _SLt), + ((-1, {_sVm: _SE}), (-1, {_sVm: _SLt})), ) -LAUNCH_TEMPLATE_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#LaunchTemplateSource"), - shape_type=ShapeType.UNION, - members={"launchParameters": {"target": LAUNCH_PARAMETERS}}, +IAM_PRINCIPAL: StaticSchema = ( + 18, + n0, + _IP, + 0, + (_a, _op), + ((IAM_PRINCIPAL_ARN, 1), (PRINCIPAL_MATCH_OPERATOR, 0)), ) -INSTANCE_LIFECYCLE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#InstanceLifecycleConfiguration"), - members={ - "idleInstanceTimeout": {"target": INTEGER}, - "maxLifetime": {"target": INTEGER}, - }, -) +MATCH_PRINCIPAL_ENTRY: StaticSchema = (19, n0, _MPE, 0, (_iPa,), ((IAM_PRINCIPAL, 0),)) -ROOT_VOLUME_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#RootVolumeConfiguration"), - members={ - "volumeType": { - "target": EBS_VOLUME_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="gp3")], - }, - "iops": {"target": VOLUME_IOPS}, - "throughput": {"target": VOLUME_THROUGHPUT}, - "encrypted": {"target": BOOLEAN}, - "kmsKeyId": {"target": KMS_KEY_ID}, - "freeSpaceGiB": {"target": VOLUME_SIZE_GI_B}, - }, +MATCH_PRINCIPAL_ENTRIES: StaticSchema = ( + 16, + n0, + _MPEa, + 0, + (_mem,), + ((MATCH_PRINCIPAL_ENTRY, 0),), ) -VOLUME_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#VolumeName"), - shape_type=ShapeType.STRING, -) - -EBS_VOLUME_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#EbsVolumeConfiguration"), - members={ - "name": { - "target": VOLUME_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "sizeGiB": { - "target": VOLUME_SIZE_GI_B, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "volumeType": { - "target": EBS_VOLUME_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="gp3")], - }, - "iops": {"target": VOLUME_IOPS}, - "throughput": {"target": VOLUME_THROUGHPUT}, - "encrypted": {"target": BOOLEAN}, - "kmsKeyId": {"target": KMS_KEY_ID}, - "snapshotId": {"target": EBS_SNAPSHOT_ID}, - }, +MATCH_PRINCIPALS: StaticSchema = ( + 18, + n0, + _MPat, + 0, + (_aO,), + ((MATCH_PRINCIPAL_ENTRIES, 1),), ) -VOLUME_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#VolumeConfiguration"), - shape_type=ShapeType.UNION, - members={"ebsConfiguration": {"target": EBS_VOLUME_CONFIGURATION}}, +CONDITION: StaticSchema = ( + 19, + n0, + _Co, + 0, + (_mPa, _mPat), + ((MATCH_PRINCIPALS, 0), (MATCH_PATHS, 0)), ) -VOLUME_CONFIGURATION_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#VolumeConfigurationList"), - shape_type=ShapeType.LIST, - members={"member": {"target": VOLUME_CONFIGURATION}}, -) +CONDITIONS: StaticSchema = (16, n0, _Con, 0, (_mem,), ((CONDITION, 0),)) -SECURITY_GROUP_ID_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SecurityGroupIdList"), - shape_type=ShapeType.LIST, - members={"member": {"target": SECURITY_GROUP_ID}}, -) +GATEWAY_RULE_DESCRIPTION: StaticSchema = (3, n0, _GRD, 0) -SUBNET_ID_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SubnetIdList"), - shape_type=ShapeType.LIST, - members={"member": {"target": SUBNET_ID}}, -) +GATEWAY_RULE_PRIORITY: StaticSchema = (7, n0, _GRP, 0) -VPC_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#VpcConfiguration"), - members={ - "subnets": { - "target": SUBNET_ID_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "securityGroups": { - "target": SECURITY_GROUP_ID_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +CREATE_GATEWAY_RULE_INPUT: StaticSchema = ( + 18, + n0, + _CGRI, + {_sSI: _cCGRR, _smit: None}, + (_gI, _cT, _pri, _cond, _ac, _d), + ( + (GATEWAY_IDENTIFIER, 9), + (CLIENT_TOKEN, 2), + (GATEWAY_RULE_PRIORITY, 1), + (CONDITIONS, 0), + (ACTIONS, 1), + (GATEWAY_RULE_DESCRIPTION, 0), + ), ) -EC2_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#Ec2Configuration"), - members={ - "launchTemplateSource": { - "target": LAUNCH_TEMPLATE_SOURCE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "vpcConfiguration": { - "target": VPC_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "volumes": {"target": VOLUME_CONFIGURATION_LIST}, - "lifecycleConfiguration": {"target": INSTANCE_LIFECYCLE_CONFIGURATION}, - "rootVolume": {"target": ROOT_VOLUME_CONFIGURATION}, - }, -) +GATEWAY_RULE_ID: StaticSchema = (3, n0, _GRI, 0) -COMPUTE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ComputeConfiguration"), - shape_type=ShapeType.UNION, - members={"ec2Configuration": {"target": EC2_CONFIGURATION}}, +GATEWAY_RULE_STATUS: StaticSchema = ( + 14, + n0, + _GRS, + 0, + (_CREATING, _ACTIVE, _UPDATING, _DELETING), + ( + (-1, {_sVm: _CREATING}), + (-1, {_sVm: _ACTIVE}), + (-1, {_sVm: _UPDATING}), + (-1, {_sVm: _DELETING}), + ), ) -CAPACITY_PROVIDER_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CapacityProviderName"), - shape_type=ShapeType.STRING, +SYSTEM_MANAGED_BLOCK: StaticSchema = (18, n0, _SMB, 0, (_mB,), ((3, 1),)) + +CREATE_GATEWAY_RULE_OUTPUT: StaticSchema = ( + 18, + n0, + _CGRO, + {_sSI: _cCGRRo, _smith: None}, + (_rI, _gA, _pri, _cond, _ac, _d, _cA, _st, _sy), + ( + (GATEWAY_RULE_ID, 1), + (GATEWAY_ARN, 1), + (GATEWAY_RULE_PRIORITY, 1), + (CONDITIONS, 0), + (ACTIONS, 1), + (GATEWAY_RULE_DESCRIPTION, 0), + (DATE_TIMESTAMP, 1), + (GATEWAY_RULE_STATUS, 1), + (SYSTEM_MANAGED_BLOCK, 0), + ), ) -PERMISSIONS_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PermissionsConfiguration"), - members={ - "capacityProviderOperatorRoleArn": { - "target": ROLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +CREATE_GATEWAY_RULE: StaticOperationSchema = ( + 23, + n0, + _CGR, + { + _smithy: MappingProxyType( + { + "code": 202, + "method": "POST", + "uri": "/gateways/{gatewayIdentifier}/rules", + } + ) + }, + CREATE_GATEWAY_RULE_INPUT, + CREATE_GATEWAY_RULE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CREATE_CAPACITY_PROVIDER_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateCapacityProviderInput"), - members={ - "name": { - "target": CAPACITY_PROVIDER_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "permissionsConfiguration": { - "target": PERMISSIONS_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "tags": {"target": TAGS_MAP}, - "computeConfiguration": { - "target": COMPUTE_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +DELETE_GATEWAY_RULE_INPUT: StaticSchema = ( + 18, + n0, + _DGRI, + {_sSI: _cDGRR, _smit: None}, + (_gI, _rI), + ((GATEWAY_IDENTIFIER, 9), (GATEWAY_RULE_ID, 9)), +) + +DELETE_GATEWAY_RULE_OUTPUT: StaticSchema = ( + 18, + n0, + _DGRO, + {_sSI: _cDGRRo, _smith: None}, + (_rI, _st), + ((GATEWAY_RULE_ID, 1), (GATEWAY_RULE_STATUS, 1)), +) + +DELETE_GATEWAY_RULE: StaticOperationSchema = ( + 23, + n0, + _DGR, + { + _smithy: MappingProxyType( + { + "code": 202, + "method": "DELETE", + "uri": "/gateways/{gatewayIdentifier}/rules/{ruleId}", + } + ) + }, + DELETE_GATEWAY_RULE_INPUT, + DELETE_GATEWAY_RULE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CAPACITY_PROVIDER_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CapacityProviderStatus"), - shape_type=ShapeType.ENUM, - members={ - "CREATING": {"target": UNIT}, - "CREATE_FAILED": {"target": UNIT}, - "UPDATING": {"target": UNIT}, - "UPDATE_FAILED": {"target": UNIT}, - "READY": {"target": UNIT}, - "DELETING": {"target": UNIT}, - "DELETE_FAILED": {"target": UNIT}, - }, +GET_GATEWAY_RULE_INPUT: StaticSchema = ( + 18, + n0, + _GGRI, + {_sSI: _cGGRR, _smit: None}, + (_gI, _rI), + ((GATEWAY_IDENTIFIER, 9), (GATEWAY_RULE_ID, 9)), +) + +GET_GATEWAY_RULE_OUTPUT: StaticSchema = ( + 18, + n0, + _GGRO, + {_sSI: _cGGRRo, _smith: None}, + (_rI, _gA, _pri, _cond, _ac, _d, _cA, _st, _sy, _uA), + ( + (GATEWAY_RULE_ID, 1), + (GATEWAY_ARN, 1), + (GATEWAY_RULE_PRIORITY, 1), + (CONDITIONS, 0), + (ACTIONS, 1), + (GATEWAY_RULE_DESCRIPTION, 0), + (DATE_TIMESTAMP, 1), + (GATEWAY_RULE_STATUS, 1), + (SYSTEM_MANAGED_BLOCK, 0), + (DATE_TIMESTAMP, 0), + ), ) -CREATE_CAPACITY_PROVIDER_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateCapacityProviderOutput"), - members={ - "capacityProviderId": { - "target": CAPACITY_PROVIDER_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "capacityProviderArn": { - "target": CAPACITY_PROVIDER_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": CAPACITY_PROVIDER_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": CAPACITY_PROVIDER_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +GET_GATEWAY_RULE: StaticOperationSchema = ( + 23, + n0, + _GGR, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "GET", + "uri": "/gateways/{gatewayIdentifier}/rules/{ruleId}", + } + ) + }, + GET_GATEWAY_RULE_INPUT, + GET_GATEWAY_RULE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -RETRYABLE_CONFLICT_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#RetryableConflictException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=409), - ], - members={ - "message": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +GATEWAY_RULE_MAX_RESULTS: StaticSchema = (7, n0, _GRMR, 0) -CREATE_CAPACITY_PROVIDER = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateCapacityProvider"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "PUT", "uri": "/capacity-providers", "code": 202} - ), - ) - ], -) - -DELETE_CAPACITY_PROVIDER_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteCapacityProviderInput"), - members={ - "capacityProviderId": { - "target": CAPACITY_PROVIDER_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#idempotencyToken")), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="clientToken"), - ], - }, - }, -) +GATEWAY_RULE_NEXT_TOKEN: StaticSchema = (3, n0, _GRNT, 0) -DELETE_CAPACITY_PROVIDER_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteCapacityProviderOutput"), - members={ - "capacityProviderId": { - "target": CAPACITY_PROVIDER_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": CAPACITY_PROVIDER_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +LIST_GATEWAY_RULES_INPUT: StaticSchema = ( + 18, + n0, + _LGRI, + {_sSI: _cLGRR, _smit: None}, + (_gI, _mR, _nT), + ( + (GATEWAY_IDENTIFIER, 9), + (GATEWAY_RULE_MAX_RESULTS, {_sQ: _mR}), + (GATEWAY_RULE_NEXT_TOKEN, {_sQ: _nT}), + ), ) -DELETE_CAPACITY_PROVIDER = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteCapacityProvider"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/capacity-providers/{capacityProviderId}", - "code": 202, - } - ), - ) - ], -) - -GET_CAPACITY_PROVIDER_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetCapacityProviderInput"), - members={ - "capacityProviderId": { - "target": CAPACITY_PROVIDER_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, +GATEWAY_RULE_DETAIL: StaticSchema = ( + 18, + n0, + _GRDa, + 0, + (_rI, _gA, _pri, _cond, _ac, _d, _cA, _st, _sy, _uA), + ( + (GATEWAY_RULE_ID, 1), + (GATEWAY_ARN, 1), + (GATEWAY_RULE_PRIORITY, 1), + (CONDITIONS, 0), + (ACTIONS, 1), + (GATEWAY_RULE_DESCRIPTION, 0), + (DATE_TIMESTAMP, 1), + (GATEWAY_RULE_STATUS, 1), + (SYSTEM_MANAGED_BLOCK, 0), + (DATE_TIMESTAMP, 0), + ), ) -CAPACITY_PROVIDER_STATUS_CODE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CapacityProviderStatusCode"), - shape_type=ShapeType.ENUM, - members={ - "VALIDATION_ERROR": {"target": UNIT}, - "QUOTA_EXCEEDED": {"target": UNIT}, - "THROTTLED": {"target": UNIT}, - "INTERNAL_SERVER_EXCEPTION": {"target": UNIT}, - }, -) +GATEWAY_RULES: StaticSchema = (16, n0, _GR, 0, (_mem,), ((GATEWAY_RULE_DETAIL, 0),)) -GET_CAPACITY_PROVIDER_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetCapacityProviderOutput"), - members={ - "capacityProviderId": { - "target": CAPACITY_PROVIDER_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "capacityProviderArn": { - "target": CAPACITY_PROVIDER_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": CAPACITY_PROVIDER_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": CAPACITY_PROVIDER_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "statusCode": {"target": CAPACITY_PROVIDER_STATUS_CODE}, - "statusReason": {"target": _STRING}, - "permissionsConfiguration": { - "target": PERMISSIONS_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "computeConfiguration": { - "target": COMPUTE_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastUpdatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +LIST_GATEWAY_RULES_OUTPUT: StaticSchema = ( + 18, + n0, + _LGRO, + {_sSI: _cLGRRo, _smith: None}, + (_gR, _nT), + ((GATEWAY_RULES, 1), (GATEWAY_RULE_NEXT_TOKEN, 0)), ) -GET_CAPACITY_PROVIDER = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetCapacityProvider"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/capacity-providers/{capacityProviderId}", - "code": 200, - } - ), +LIST_GATEWAY_RULES: StaticOperationSchema = ( + 23, + n0, + _LGR, + { + _smithy: MappingProxyType( + {"code": 200, "method": "GET", "uri": "/gateways/{gatewayIdentifier}/rules"} ) - ], -) - -LIST_AGENT_RUNTIME_VERSIONS_BY_CAPACITY_PROVIDER_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ListAgentRuntimeVersionsByCapacityProviderInput" - ), - members={ - "capacityProviderId": { - "target": CAPACITY_PROVIDER_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, }, + LIST_GATEWAY_RULES_INPUT, + LIST_GATEWAY_RULES_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -LIST_AGENT_RUNTIME_VERSIONS_BY_CAPACITY_PROVIDER_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ListAgentRuntimeVersionsByCapacityProviderOutput" +UPDATE_GATEWAY_RULE_INPUT: StaticSchema = ( + 18, + n0, + _UGRI, + {_sSI: _cUGRR, _smit: None}, + (_gI, _rI, _pri, _cond, _ac, _d), + ( + (GATEWAY_IDENTIFIER, 9), + (GATEWAY_RULE_ID, 9), + (GATEWAY_RULE_PRIORITY, 0), + (CONDITIONS, 0), + (ACTIONS, 0), + (GATEWAY_RULE_DESCRIPTION, 0), ), - members={ - "agentRuntimes": { - "target": AGENT_RUNTIME_VERSION_SUMMARY_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": _STRING}, - }, ) -LIST_AGENT_RUNTIME_VERSIONS_BY_CAPACITY_PROVIDER = Schema( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ListAgentRuntimeVersionsByCapacityProvider" - ), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/capacity-providers/{capacityProviderId}/runtime-versions", - "code": 200, - } - ), - ) - ], -) - -LIST_CAPACITY_PROVIDERS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListCapacityProvidersInput"), - members={ - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - }, +UPDATE_GATEWAY_RULE_OUTPUT: StaticSchema = ( + 18, + n0, + _UGRO, + {_sSI: _cUGRRo, _smith: None}, + (_rI, _gA, _pri, _cond, _ac, _d, _cA, _st, _sy, _uA), + ( + (GATEWAY_RULE_ID, 1), + (GATEWAY_ARN, 1), + (GATEWAY_RULE_PRIORITY, 1), + (CONDITIONS, 0), + (ACTIONS, 1), + (GATEWAY_RULE_DESCRIPTION, 0), + (DATE_TIMESTAMP, 1), + (GATEWAY_RULE_STATUS, 1), + (SYSTEM_MANAGED_BLOCK, 0), + (DATE_TIMESTAMP, 0), + ), ) -CAPACITY_PROVIDER_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CapacityProviderSummary"), - members={ - "capacityProviderId": { - "target": CAPACITY_PROVIDER_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "capacityProviderArn": { - "target": CAPACITY_PROVIDER_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": CAPACITY_PROVIDER_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": CAPACITY_PROVIDER_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastUpdatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +UPDATE_GATEWAY_RULE: StaticOperationSchema = ( + 23, + n0, + _UGR, + { + _smithy: MappingProxyType( + { + "code": 202, + "method": "PATCH", + "uri": "/gateways/{gatewayIdentifier}/rules/{ruleId}", + } + ) + }, + UPDATE_GATEWAY_RULE_INPUT, + UPDATE_GATEWAY_RULE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CAPACITY_PROVIDER_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CapacityProviderList"), - shape_type=ShapeType.LIST, - members={"member": {"target": CAPACITY_PROVIDER_SUMMARY}}, -) +CERTIFICATE_BUCKET_OWNER_ACCOUNT_ID: StaticSchema = (3, n0, _CBOAI, 0) -LIST_CAPACITY_PROVIDERS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListCapacityProvidersOutput"), - members={ - "capacityProviders": { - "target": CAPACITY_PROVIDER_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": NEXT_TOKEN}, - }, -) +CERTIFICATE_S3_URI: StaticSchema = (3, n0, _CSU, 0) -LIST_CAPACITY_PROVIDERS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListCapacityProviders"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/capacity-providers", "code": 200} - ), - ) - ], -) - -UPDATED_DESCRIPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdatedDescription"), - members={"optionalValue": {"target": DESCRIPTION}}, -) - -UPDATE_CAPACITY_PROVIDER_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateCapacityProviderInput"), - members={ - "capacityProviderId": { - "target": CAPACITY_PROVIDER_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "description": {"target": UPDATED_DESCRIPTION}, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - }, +S3_CERTIFICATE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _SCC, + 0, + (_u, _bOAI), + ((CERTIFICATE_S3_URI, 1), (CERTIFICATE_BUCKET_OWNER_ACCOUNT_ID, 0)), ) -UPDATE_CAPACITY_PROVIDER_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateCapacityProviderOutput"), - members={ - "capacityProviderId": { - "target": CAPACITY_PROVIDER_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "capacityProviderArn": { - "target": CAPACITY_PROVIDER_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": CAPACITY_PROVIDER_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": CAPACITY_PROVIDER_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastUpdatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +CERTIFICATE_SECRET_ARN: StaticSchema = (3, n0, _CSA, 0) + +SECRETS_MANAGER_CERTIFICATE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _SMCC, + 0, + (_sA,), + ((CERTIFICATE_SECRET_ARN, 1),), ) -UPDATE_CAPACITY_PROVIDER = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateCapacityProvider"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PUT", - "uri": "/capacity-providers/{capacityProviderId}", - "code": 202, - } - ), - ) - ], +CERTIFICATE_CONFIGURATION: StaticSchema = ( + 19, + n0, + _CCe, + 0, + (_s_, _sMe), + ((S3_CERTIFICATE_CONFIGURATION, 0), (SECRETS_MANAGER_CERTIFICATE_CONFIGURATION, 0)), ) -CODE_INTERPRETER_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CodeInterpreterId"), - shape_type=ShapeType.STRING, +CERTIFICATE_CONFIGURATION_LIST: StaticSchema = ( + 16, + n0, + _CCL, + 0, + (_mem,), + ((CERTIFICATE_CONFIGURATION, 0),), ) -CODE_INTERPRETER_NETWORK_MODE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CodeInterpreterNetworkMode"), - shape_type=ShapeType.ENUM, - members={ - "PUBLIC": {"target": UNIT}, - "SANDBOX": {"target": UNIT}, - "VPC": {"target": UNIT}, - }, +API_KEY_CREDENTIAL_LOCATION: StaticSchema = ( + 14, + n0, + _AKCL, + 0, + (_HEADER, _QP), + ((-1, {_sVm: _HEADER}), (-1, {_sVm: _QP})), ) -CODE_INTERPRETER_NETWORK_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#CodeInterpreterNetworkConfiguration" +API_KEY_CREDENTIAL_PARAMETER_NAME: StaticSchema = (3, n0, _AKCPN, 0) + +API_KEY_CREDENTIAL_PREFIX: StaticSchema = (3, n0, _AKCPp, 0) + +API_KEY_CREDENTIAL_PROVIDER_ARN: StaticSchema = (3, n0, _AKCPA, 0) + +GATEWAY_API_KEY_CREDENTIAL_PROVIDER: StaticSchema = ( + 18, + n0, + _GAKCPa, + 0, + (_pAr, _cPN, _cPr, _cL), + ( + (API_KEY_CREDENTIAL_PROVIDER_ARN, 1), + (API_KEY_CREDENTIAL_PARAMETER_NAME, 0), + (API_KEY_CREDENTIAL_PREFIX, 0), + (API_KEY_CREDENTIAL_LOCATION, 0), ), - members={ - "networkMode": { - "target": CODE_INTERPRETER_NETWORK_MODE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value="SANDBOX"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "vpcConfig": {"target": VPC_CONFIG}, - }, ) -CREATE_CODE_INTERPRETER_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateCodeInterpreterInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreateCodeInterpreterRequest", - ) - ], - members={ - "name": { - "target": SANDBOX_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "executionRoleArn": {"target": ROLE_ARN}, - "networkConfiguration": { - "target": CODE_INTERPRETER_NETWORK_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "certificates": {"target": CERTIFICATES}, - "filesystemConfigurations": {"target": TOOLS_FILE_SYSTEM_CONFIGURATIONS}, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "tags": {"target": TAGS_MAP}, - }, +IAM_CREDENTIAL_PROVIDER: StaticSchema = ( + 18, + n0, + _ICP, + 0, + (_ser, _reg), + ((3, 1), (3, 0)), ) -CODE_INTERPRETER_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CodeInterpreterArn"), - shape_type=ShapeType.STRING, -) +O_AUTH_CUSTOM_PARAMETERS_KEY: StaticSchema = (3, n0, _OACPK, 0) -CODE_INTERPRETER_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CodeInterpreterStatus"), - shape_type=ShapeType.ENUM, - members={ - "CREATING": {"target": UNIT}, - "CREATE_FAILED": {"target": UNIT}, - "READY": {"target": UNIT}, - "DELETING": {"target": UNIT}, - "DELETE_FAILED": {"target": UNIT}, - "DELETED": {"target": UNIT}, - }, -) +O_AUTH_CUSTOM_PARAMETERS_VALUE: StaticSchema = (3, n0, _OACPV, 4) -CREATE_CODE_INTERPRETER_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateCodeInterpreterOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreateCodeInterpreterResponse", - ) - ], - members={ - "codeInterpreterId": { - "target": CODE_INTERPRETER_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "codeInterpreterArn": { - "target": CODE_INTERPRETER_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": CODE_INTERPRETER_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +O_AUTH_CUSTOM_PARAMETERS: StaticSchema = ( + 17, + n0, + _OACP, + 0, + (_k, _v), + ((O_AUTH_CUSTOM_PARAMETERS_KEY, 0), (O_AUTH_CUSTOM_PARAMETERS_VALUE, 0)), ) -CREATE_CODE_INTERPRETER = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateCodeInterpreter"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 202, "method": "PUT", "uri": "/code-interpreters"} - ), - ) - ], -) +O_AUTH_DEFAULT_RETURN_URL: StaticSchema = (3, n0, _OADRU, 0) -DELETE_CODE_INTERPRETER_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteCodeInterpreterInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeleteCodeInterpreterRequest", - ) - ], - members={ - "codeInterpreterId": { - "target": CODE_INTERPRETER_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#idempotencyToken")), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="clientToken"), - ], - }, - }, +O_AUTH_GRANT_TYPE: StaticSchema = ( + 14, + n0, + _OAGT, + 0, + (_CC_, _AC_, _TE_), + ((-1, {_sVm: _CC_}), (-1, {_sVm: _AC_}), (-1, {_sVm: _TE_})), ) -DELETE_CODE_INTERPRETER_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteCodeInterpreterOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeleteCodeInterpreterResponse", - ) - ], - members={ - "codeInterpreterId": { - "target": CODE_INTERPRETER_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": CODE_INTERPRETER_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastUpdatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +O_AUTH_CREDENTIAL_PROVIDER_ARN: StaticSchema = (3, n0, _OACPAu, 0) -DELETE_CODE_INTERPRETER = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteCodeInterpreter"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 202, - "method": "DELETE", - "uri": "/code-interpreters/{codeInterpreterId}", - } - ), - ) - ], -) +O_AUTH_SCOPE: StaticSchema = (3, n0, _OAS, 0) -GET_CODE_INTERPRETER_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetCodeInterpreterInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetCodeInterpreterRequest", - ) - ], - members={ - "codeInterpreterId": { - "target": CODE_INTERPRETER_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) +O_AUTH_SCOPES: StaticSchema = (16, n0, _OASu, 0, (_mem,), ((O_AUTH_SCOPE, 0),)) -GET_CODE_INTERPRETER_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetCodeInterpreterOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetCodeInterpreterResponse", - ) - ], - members={ - "codeInterpreterId": { - "target": CODE_INTERPRETER_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "codeInterpreterArn": { - "target": CODE_INTERPRETER_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": SANDBOX_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "executionRoleArn": {"target": ROLE_ARN}, - "networkConfiguration": { - "target": CODE_INTERPRETER_NETWORK_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": CODE_INTERPRETER_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "certificates": {"target": CERTIFICATES}, - "filesystemConfigurations": {"target": TOOLS_FILE_SYSTEM_CONFIGURATIONS}, - "failureReason": {"target": _STRING}, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastUpdatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +O_AUTH_CREDENTIAL_PROVIDER: StaticSchema = ( + 18, + n0, + _OACPu, + 0, + (_pAr, _sco, _cPu, _gT, _dRU), + ( + (O_AUTH_CREDENTIAL_PROVIDER_ARN, 1), + (O_AUTH_SCOPES, 1), + (O_AUTH_CUSTOM_PARAMETERS, 0), + (O_AUTH_GRANT_TYPE, {_smithya: _CC_}), + (O_AUTH_DEFAULT_RETURN_URL, 0), + ), ) -GET_CODE_INTERPRETER = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetCodeInterpreter"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/code-interpreters/{codeInterpreterId}", - } - ), - ) - ], +CREDENTIAL_PROVIDER: StaticSchema = ( + 19, + n0, + _CPr, + 0, + (_oCP, _aKCP, _iCP), + ( + (O_AUTH_CREDENTIAL_PROVIDER, 0), + (GATEWAY_API_KEY_CREDENTIAL_PROVIDER, 0), + (IAM_CREDENTIAL_PROVIDER, 0), + ), ) -LIST_CODE_INTERPRETERS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListCodeInterpretersInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListCodeInterpretersRequest", - ) - ], - members={ - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "type": { - "target": RESOURCE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="type")], - }, - }, +CREDENTIAL_PROVIDER_TYPE: StaticSchema = ( + 14, + n0, + _CPT, + 0, + (_GIR, _OAUTH, _AK, _CIC, _JP), + ( + (-1, {_sVm: _GIR}), + (-1, {_sVm: _OAUTH}), + (-1, {_sVm: _AK}), + (-1, {_sVm: _CIC}), + (-1, {_sVm: _JP}), + ), ) -CODE_INTERPRETER_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CodeInterpreterSummary"), - members={ - "codeInterpreterId": { - "target": CODE_INTERPRETER_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "codeInterpreterArn": { - "target": CODE_INTERPRETER_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": {"target": SANDBOX_NAME}, - "description": {"target": DESCRIPTION}, - "status": { - "target": CODE_INTERPRETER_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastUpdatedAt": {"target": DATE_TIMESTAMP}, - }, +CREDENTIAL_PROVIDER_CONFIGURATION: StaticSchema = ( + 18, + n0, + _CPCr, + 0, + (_cPT, _cPre), + ((CREDENTIAL_PROVIDER_TYPE, 1), (CREDENTIAL_PROVIDER, 0)), +) + +CREDENTIAL_PROVIDER_CONFIGURATIONS: StaticSchema = ( + 16, + n0, + _CPCre, + 0, + (_mem,), + ((CREDENTIAL_PROVIDER_CONFIGURATION, 0),), +) + +TARGET_DESCRIPTION: StaticSchema = (3, n0, _TD, 4) + +METADATA_CONFIGURATION: StaticSchema = ( + 18, + n0, + _MC, + 0, + (_aRH, _aQP, _aRHl), + ( + (ALLOWED_REQUEST_HEADERS, 0), + (ALLOWED_QUERY_PARAMETERS, 0), + (ALLOWED_RESPONSE_HEADERS, 0), + ), ) -CODE_INTERPRETER_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CodeInterpreterSummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": CODE_INTERPRETER_SUMMARY}}, -) +RUNTIME_ARN: StaticSchema = (3, n0, _RAu, 0) -LIST_CODE_INTERPRETERS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListCodeInterpretersOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListCodeInterpretersResponse", - ) - ], - members={ - "codeInterpreterSummaries": { - "target": CODE_INTERPRETER_SUMMARIES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": NEXT_TOKEN}, - }, -) +RUNTIME_QUALIFIER: StaticSchema = (3, n0, _RQ, 0) -LIST_CODE_INTERPRETERS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListCodeInterpreters"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "POST", "uri": "/code-interpreters"} - ), - ) - ], -) +INLINE_PAYLOAD: StaticSchema = (3, n0, _IPn, 4) -CONFIGURATION_BUNDLE_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ConfigurationBundleId"), - shape_type=ShapeType.STRING, -) +AWS_ACCOUNT_ID: StaticSchema = (3, n0, _AAI, 0) -BRANCH_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#BranchName"), - shape_type=ShapeType.STRING, -) +S3_BUCKET_URI: StaticSchema = (3, n0, _SBU, 0) -CONFIGURATION_BUNDLE_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ConfigurationBundleName"), - shape_type=ShapeType.STRING, +S3_CONFIGURATION: StaticSchema = ( + 18, + n0, + _SCo, + 0, + (_u, _bOAI), + ((S3_BUCKET_URI, 0), (AWS_ACCOUNT_ID, 0)), ) -COMPONENT_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ComponentIdentifier"), - shape_type=ShapeType.STRING, +API_SCHEMA_CONFIGURATION: StaticSchema = ( + 19, + n0, + _ASC, + 0, + (_s_, _iPn), + ((S3_CONFIGURATION, 0), (INLINE_PAYLOAD, 0)), ) -COMPONENT_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ComponentConfiguration"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "configuration": { - "target": DOCUMENT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +HTTP_API_SCHEMA_CONFIGURATION: StaticSchema = ( + 18, + n0, + _HASC, + 0, + (_so,), + ((API_SCHEMA_CONFIGURATION, 1),), ) -COMPONENT_CONFIGURATION_MAP = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ComponentConfigurationMap"), - shape_type=ShapeType.MAP, - members={ - "key": {"target": COMPONENT_IDENTIFIER}, - "value": {"target": COMPONENT_CONFIGURATION}, - }, +RUNTIME_TARGET_CONFIGURATION: StaticSchema = ( + 18, + n0, + _RTC, + 0, + (_a, _q, _sch), + ((RUNTIME_ARN, 1), (RUNTIME_QUALIFIER, 0), (HTTP_API_SCHEMA_CONFIGURATION, 0)), ) -VERSION_CREATED_BY_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#VersionCreatedBySource"), - members={ - "name": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "arn": {"target": _STRING}, - }, -) +CONNECTOR_PARAMETER_NAME: StaticSchema = (3, n0, _CPNo, 0) -CONFIGURATION_BUNDLE_DESCRIPTION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ConfigurationBundleDescription"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) +CONNECTOR_PARAMETER_VALUE: StaticSchema = (3, n0, _CPV, 0) -KMS_KEY_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#KmsKeyArn"), - shape_type=ShapeType.STRING, +HTTP_CONNECTOR_PARAMETERS: StaticSchema = ( + 17, + n0, + _HCP, + 0, + (_k, _v), + ((CONNECTOR_PARAMETER_NAME, 0), (CONNECTOR_PARAMETER_VALUE, 0)), ) -CREATE_CONFIGURATION_BUNDLE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateConfigurationBundleInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreateConfigurationBundleRequest", - ) - ], - members={ - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "bundleName": { - "target": CONFIGURATION_BUNDLE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": CONFIGURATION_BUNDLE_DESCRIPTION}, - "components": { - "target": COMPONENT_CONFIGURATION_MAP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "branchName": {"target": BRANCH_NAME}, - "commitMessage": {"target": _STRING}, - "createdBy": {"target": VERSION_CREATED_BY_SOURCE}, - "kmsKeyArn": {"target": KMS_KEY_ARN}, - "tags": {"target": TAGS_MAP}, - }, -) +CONNECTOR_ID: StaticSchema = (3, n0, _CIo, 0) + +HTTP_CONNECTOR_SOURCE: StaticSchema = (18, n0, _HCS, 0, (_cI,), ((CONNECTOR_ID, 1),)) -CONFIGURATION_BUNDLE_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ConfigurationBundleArn"), - shape_type=ShapeType.STRING, +HTTP_CONNECTOR_TARGET_CONFIGURATION: StaticSchema = ( + 18, + n0, + _HCTC, + 0, + (_so, _pa), + ((HTTP_CONNECTOR_SOURCE, 1), (HTTP_CONNECTOR_PARAMETERS, 0)), ) -CONFIGURATION_BUNDLE_VERSION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ConfigurationBundleVersion"), - shape_type=ShapeType.STRING, +PASSTHROUGH_ENDPOINT: StaticSchema = (3, n0, _PEa, 0) + +PASSTHROUGH_PROTOCOL_TYPE: StaticSchema = ( + 14, + n0, + _PPT, + 0, + (_MCP, _AA_, _INFERENCE, _CUSTOM), + ( + (-1, {_sVm: _MCP}), + (-1, {_sVm: _AA_}), + (-1, {_sVm: _INFERENCE}), + (-1, {_sVm: _CUSTOM}), + ), ) -CREATE_CONFIGURATION_BUNDLE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateConfigurationBundleOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreateConfigurationBundleResponse", - ) - ], - members={ - "bundleArn": { - "target": CONFIGURATION_BUNDLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "bundleId": { - "target": CONFIGURATION_BUNDLE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "versionId": { - "target": CONFIGURATION_BUNDLE_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +STATIC_QUERY_PARAMETER_CONFLICT_RESOLUTION: StaticSchema = ( + 14, + n0, + _SQPCR, + 0, + (_CO, _SO_), + ((-1, {_sVm: _CO}), (-1, {_sVm: _SO_})), ) -CREATE_CONFIGURATION_BUNDLE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateConfigurationBundle"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/configuration-bundles/create", "code": 201} - ), - ) - ], +STATIC_QUERY_PARAMETER_NAME: StaticSchema = (3, n0, _SQPN, 0) + +STATIC_QUERY_PARAMETER_VALUE: StaticSchema = (3, n0, _SQPV, 4) + +STATIC_QUERY_PARAMETERS: StaticSchema = ( + 17, + n0, + _SQP, + 0, + (_k, _v), + ((STATIC_QUERY_PARAMETER_NAME, 0), (STATIC_QUERY_PARAMETER_VALUE, 0)), ) -DELETE_CONFIGURATION_BUNDLE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteConfigurationBundleInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeleteConfigurationBundleRequest", - ) - ], - members={ - "bundleId": { - "target": CONFIGURATION_BUNDLE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, +COMPOSITE_IDENTIFIER_ENTRY: StaticSchema = (3, n0, _CIE, 0) + +COMPOSITE_IDENTIFIER_LIST: StaticSchema = ( + 16, + n0, + _CIL, + 0, + (_mem,), + ((COMPOSITE_IDENTIFIER_ENTRY, 0),), ) -CONFIGURATION_BUNDLE_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ConfigurationBundleStatus"), - shape_type=ShapeType.ENUM, - members={ - "ACTIVE": {"target": UNIT}, - "CREATING": {"target": UNIT}, - "CREATE_FAILED": {"target": UNIT}, - "UPDATING": {"target": UNIT}, - "UPDATE_FAILED": {"target": UNIT}, - "DELETING": {"target": UNIT}, - "DELETE_FAILED": {"target": UNIT}, - }, +STICKINESS_TIMEOUT: StaticSchema = (7, n0, _STt, 0) + +STICKINESS_CONFIGURATION: StaticSchema = ( + 18, + n0, + _SCti, + 0, + (_id, _ti, _cIo), + ((3, 1), (STICKINESS_TIMEOUT, 0), (COMPOSITE_IDENTIFIER_LIST, 0)), ) -DELETE_CONFIGURATION_BUNDLE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteConfigurationBundleOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeleteConfigurationBundleResponse", - ) - ], - members={ - "bundleArn": { - "target": CONFIGURATION_BUNDLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "bundleId": { - "target": CONFIGURATION_BUNDLE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": CONFIGURATION_BUNDLE_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +PASSTHROUGH_TARGET_CONFIGURATION: StaticSchema = ( + 18, + n0, + _PTC, + 0, + (_end, _pTr, _sch, _sCti, _sQP, _sQPCR), + ( + (PASSTHROUGH_ENDPOINT, 1), + (PASSTHROUGH_PROTOCOL_TYPE, 1), + (HTTP_API_SCHEMA_CONFIGURATION, 0), + (STICKINESS_CONFIGURATION, 0), + (STATIC_QUERY_PARAMETERS, 0), + (STATIC_QUERY_PARAMETER_CONFLICT_RESOLUTION, 0), + ), ) -DELETE_CONFIGURATION_BUNDLE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteConfigurationBundle"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/configuration-bundles/{bundleId}", - "code": 202, - } - ), - ) - ], +HTTP_TARGET_CONFIGURATION: StaticSchema = ( + 19, + n0, + _HTC, + 0, + (_aRg, _pas, _conne), + ( + (RUNTIME_TARGET_CONFIGURATION, 0), + (PASSTHROUGH_TARGET_CONFIGURATION, 0), + (HTTP_CONNECTOR_TARGET_CONFIGURATION, 0), + ), ) -GET_CONFIGURATION_BUNDLE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetConfigurationBundleInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetConfigurationBundleRequest", - ) - ], - members={ - "bundleId": { - "target": CONFIGURATION_BUNDLE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "branchName": { - "target": BRANCH_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="branchName") - ], - }, - }, +INFERENCE_CONNECTOR_ID: StaticSchema = (3, n0, _ICI, 0) + +INFERENCE_CONNECTOR_SOURCE: StaticSchema = ( + 18, + n0, + _ICS, + 0, + (_cI,), + ((INFERENCE_CONNECTOR_ID, 1),), ) -CONFIGURATION_BUNDLE_VERSION_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ConfigurationBundleVersionList"), - shape_type=ShapeType.LIST, - members={"member": {"target": CONFIGURATION_BUNDLE_VERSION}}, +INFERENCE_CONNECTOR_TARGET_CONFIGURATION: StaticSchema = ( + 18, + n0, + _ICTC, + 0, + (_so,), + ((INFERENCE_CONNECTOR_SOURCE, 1),), ) -VERSION_LINEAGE_METADATA = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#VersionLineageMetadata"), - members={ - "parentVersionIds": {"target": CONFIGURATION_BUNDLE_VERSION_LIST}, - "branchName": {"target": BRANCH_NAME}, - "createdBy": {"target": VERSION_CREATED_BY_SOURCE}, - "commitMessage": {"target": _STRING}, - }, +PROVIDER_PREFIX: StaticSchema = ( + 18, + n0, + _PP, + 0, + (_str, _sep), + ((2, {_smithya: False}), (3, {_smithya: _v___})), ) -GET_CONFIGURATION_BUNDLE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetConfigurationBundleOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetConfigurationBundleResponse", - ) - ], - members={ - "bundleArn": { - "target": CONFIGURATION_BUNDLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "bundleId": { - "target": CONFIGURATION_BUNDLE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "bundleName": { - "target": CONFIGURATION_BUNDLE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": CONFIGURATION_BUNDLE_DESCRIPTION}, - "versionId": { - "target": CONFIGURATION_BUNDLE_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "components": { - "target": COMPONENT_CONFIGURATION_MAP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lineageMetadata": {"target": VERSION_LINEAGE_METADATA}, - "createdAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "kmsKeyArn": {"target": KMS_KEY_ARN}, - }, +MODEL_MAPPING: StaticSchema = (18, n0, _MMo, 0, (_pP,), ((PROVIDER_PREFIX, 0),)) + +MODEL_PATTERN: StaticSchema = (3, n0, _MPo, 0) + +MODEL_ENTRY: StaticSchema = (18, n0, _ME, 0, (_mode,), ((MODEL_PATTERN, 1),)) + +MODEL_ENTRIES: StaticSchema = (16, n0, _MEo, 0, (_mem,), ((MODEL_ENTRY, 0),)) + +INFERENCE_OPERATION_PATH: StaticSchema = (3, n0, _IOP, 0) + +INFERENCE_OPERATION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _IOC, + 0, + (_pat, _pPr, _model), + ((INFERENCE_OPERATION_PATH, 1), (INFERENCE_OPERATION_PATH, 0), (MODEL_ENTRIES, 0)), ) -GET_CONFIGURATION_BUNDLE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetConfigurationBundle"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/configuration-bundles/{bundleId}"} - ), - ) - ], +INFERENCE_OPERATION_CONFIGURATIONS: StaticSchema = ( + 16, + n0, + _IOCn, + 0, + (_mem,), + ((INFERENCE_OPERATION_CONFIGURATION, 0),), ) -GET_CONFIGURATION_BUNDLE_VERSION_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#GetConfigurationBundleVersionInput" +INFERENCE_PROVIDER_TARGET_CONFIGURATION: StaticSchema = ( + 18, + n0, + _IPTC, + 0, + (_end, _mM, _ope), + ( + (PASSTHROUGH_ENDPOINT, 1), + (MODEL_MAPPING, 0), + (INFERENCE_OPERATION_CONFIGURATIONS, 0), ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetConfigurationBundleVersionRequest", - ) - ], - members={ - "bundleId": { - "target": CONFIGURATION_BUNDLE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "versionId": { - "target": CONFIGURATION_BUNDLE_VERSION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, ) -GET_CONFIGURATION_BUNDLE_VERSION_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#GetConfigurationBundleVersionOutput" +INFERENCE_TARGET_CONFIGURATION: StaticSchema = ( + 19, + n0, + _ITC, + 0, + (_conne, _pr), + ( + (INFERENCE_CONNECTOR_TARGET_CONFIGURATION, 0), + (INFERENCE_PROVIDER_TARGET_CONFIGURATION, 0), ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetConfigurationBundleVersionResponse", - ) - ], - members={ - "bundleArn": { - "target": CONFIGURATION_BUNDLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "bundleId": { - "target": CONFIGURATION_BUNDLE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "bundleName": { - "target": CONFIGURATION_BUNDLE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": CONFIGURATION_BUNDLE_DESCRIPTION}, - "versionId": { - "target": CONFIGURATION_BUNDLE_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "components": { - "target": COMPONENT_CONFIGURATION_MAP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lineageMetadata": {"target": VERSION_LINEAGE_METADATA}, - "createdAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "versionCreatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "kmsKeyArn": {"target": KMS_KEY_ARN}, - }, ) -GET_CONFIGURATION_BUNDLE_VERSION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetConfigurationBundleVersion"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/configuration-bundles/{bundleId}/versions/{versionId}", - } - ), - ) - ], +REST_API_METHOD: StaticSchema = ( + 14, + n0, + _RAM, + 0, + (_GET, _DELETE, _HEAD, _OPTIONS, _PATCH, _PUT_, _POST), + ( + (-1, {_sVm: _GET}), + (-1, {_sVm: _DELETE}), + (-1, {_sVm: _HEAD}), + (-1, {_sVm: _OPTIONS}), + (-1, {_sVm: _PATCH}), + (-1, {_sVm: _PUT_}), + (-1, {_sVm: _POST}), + ), ) -LIST_CONFIGURATION_BUNDLES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListConfigurationBundlesInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListConfigurationBundlesRequest", - ) - ], - members={ - "nextToken": { - "target": _STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "maxResults": { - "target": INTEGER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - }, +REST_API_METHODS: StaticSchema = (16, n0, _RAMe, 0, (_mem,), ((REST_API_METHOD, 0),)) + +API_GATEWAY_TOOL_FILTER: StaticSchema = ( + 18, + n0, + _AGTF, + 0, + (_fP, _met), + ((3, 1), (REST_API_METHODS, 1)), +) + +API_GATEWAY_TOOL_FILTERS: StaticSchema = ( + 16, + n0, + _AGTFp, + 0, + (_mem,), + ((API_GATEWAY_TOOL_FILTER, 0),), ) -CONFIGURATION_BUNDLE_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ConfigurationBundleSummary"), - members={ - "bundleArn": { - "target": CONFIGURATION_BUNDLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "bundleId": { - "target": CONFIGURATION_BUNDLE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "bundleName": { - "target": CONFIGURATION_BUNDLE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": CONFIGURATION_BUNDLE_DESCRIPTION}, - "createdAt": {"target": TIMESTAMP}, - }, +API_GATEWAY_TOOL_OVERRIDE: StaticSchema = ( + 18, + n0, + _AGTO, + 0, + (_n, _d, _pat, _meth), + ((3, 1), (3, 0), (3, 1), (REST_API_METHOD, 1)), +) + +API_GATEWAY_TOOL_OVERRIDES: StaticSchema = ( + 16, + n0, + _AGTOp, + 0, + (_mem,), + ((API_GATEWAY_TOOL_OVERRIDE, 0),), +) + +API_GATEWAY_TOOL_CONFIGURATION: StaticSchema = ( + 18, + n0, + _AGTC, + 0, + (_tO, _tF), + ((API_GATEWAY_TOOL_OVERRIDES, 0), (API_GATEWAY_TOOL_FILTERS, 1)), +) + +API_GATEWAY_TARGET_CONFIGURATION: StaticSchema = ( + 18, + n0, + _AGTCp, + 0, + (_rAI, _stag, _aGTC), + ((3, 1), (3, 1), (API_GATEWAY_TOOL_CONFIGURATION, 1)), +) + +CONNECTOR_PARAMETER_OVERRIDE: StaticSchema = ( + 18, + n0, + _CPO, + 0, + (_pat, _d, _vi), + ((3, 1), (3, 0), (2, 0)), +) + +CONNECTOR_PARAMETER_OVERRIDES: StaticSchema = ( + 16, + n0, + _CPOo, + 0, + (_mem,), + ((CONNECTOR_PARAMETER_OVERRIDE, 0),), +) + +CONNECTOR_CONFIGURATION: StaticSchema = ( + 18, + n0, + _CCon, + 0, + (_n, _d, _pVa, _pO), + ((3, 1), (3, 0), (13, 0), (CONNECTOR_PARAMETER_OVERRIDES, 0)), +) + +CONNECTOR_CONFIGURATIONS: StaticSchema = ( + 16, + n0, + _CConn, + 0, + (_mem,), + ((CONNECTOR_CONFIGURATION, 0),), +) + +ENABLED_CONNECTORS: StaticSchema = (16, n0, _ECn, 0, (_mem,), ((3, 0),)) + +CONNECTOR_VERSION: StaticSchema = (3, n0, _CV, 0) + +CONNECTOR_SOURCE: StaticSchema = ( + 18, + n0, + _CS, + 0, + (_cI, _ve), + ((CONNECTOR_ID, 1), (CONNECTOR_VERSION, 0)), +) + +CONNECTOR_TARGET_CONFIGURATION: StaticSchema = ( + 18, + n0, + _CTCo, + 0, + (_so, _en, _conf), + ((CONNECTOR_SOURCE, 1), (ENABLED_CONNECTORS, 0), (CONNECTOR_CONFIGURATIONS, 0)), +) + +REQUIRED_PROPERTIES: StaticSchema = (16, n0, _RP, 0, (_mem,), ((3, 0),)) + +SCHEMA_TYPE: StaticSchema = ( + 14, + n0, + _STc, + 0, + (_STRING, _NUMBER, _OBJECT, _ARRAY, _BOOLEAN, _INTEGER), + ( + (-1, {_sVm: _stri}), + (-1, {_sVm: _num}), + (-1, {_sVm: _ob}), + (-1, {_sVm: _ar}), + (-1, {_sVm: _bo}), + (-1, {_sVm: _inte}), + ), ) -CONFIGURATION_BUNDLE_SUMMARY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ConfigurationBundleSummaryList"), - shape_type=ShapeType.LIST, - members={"member": {"target": CONFIGURATION_BUNDLE_SUMMARY}}, +LISTING_MODE: StaticSchema = ( + 14, + n0, + _LM, + 0, + (_DEFAULT, _DYNAMIC), + ((-1, {_sVm: _DEFAULT}), (-1, {_sVm: _DYNAMIC})), +) + +MCP_TOOL_SCHEMA_CONFIGURATION: StaticSchema = ( + 19, + n0, + _MTSC, + 0, + (_s_, _iPn), + ((S3_CONFIGURATION, 0), (INLINE_PAYLOAD, 0)), +) + +TARGET_RESOURCE_PRIORITY: StaticSchema = (7, n0, _TRP, 0) + +MCP_SERVER_TARGET_CONFIGURATION: StaticSchema = ( + 18, + n0, + _MSTC, + 0, + (_end, _mTS, _lMi, _rP), + ( + (3, 1), + (MCP_TOOL_SCHEMA_CONFIGURATION, 0), + (LISTING_MODE, 0), + (TARGET_RESOURCE_PRIORITY, 0), + ), ) -LIST_CONFIGURATION_BUNDLES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListConfigurationBundlesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListConfigurationBundlesResponse", - ) - ], - members={ - "bundles": { - "target": CONFIGURATION_BUNDLE_SUMMARY_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": _STRING}, - }, +O_AUTH2_AUTHORIZATION_DATA: StaticSchema = ( + 18, + n0, + _OAAD, + 0, + (_aU, _uI), + ((3, 1), (3, 0)), +) + +AUTHORIZATION_DATA: StaticSchema = ( + 19, + n0, + _ADu, + 0, + (_oa,), + ((O_AUTH2_AUTHORIZATION_DATA, 0),), +) + +DOMAIN_NAME: StaticSchema = (3, n0, _DNo, 0) + +RESOURCE_ASSOCIATION_ARN: StaticSchema = (3, n0, _RAA, 0) + +RESOURCE_GATEWAY_ARN: StaticSchema = (3, n0, _RGA, 0) + +MANAGED_RESOURCE_DETAILS: StaticSchema = ( + 18, + n0, + _MRD, + 0, + (_do, _rGA, _rAA), + ((DOMAIN_NAME, 0), (RESOURCE_GATEWAY_ARN, 0), (RESOURCE_ASSOCIATION_ARN, 0)), +) + +PRIVATE_ENDPOINT_MANAGED_RESOURCES: StaticSchema = ( + 16, + n0, + _PEMR, + 0, + (_mem,), + ((MANAGED_RESOURCE_DETAILS, 0),), +) + +TARGET_PROTOCOL_TYPE: StaticSchema = ( + 14, + n0, + _TPT, + 0, + (_MCP, _HTTP), + ((-1, {_sVm: _MCP}), (-1, {_sVm: _HTTP})), +) + +TARGET_STATUS: StaticSchema = ( + 14, + n0, + _TS, + 0, + ( + _CREATING, + _UPDATING, + _UU, + _DELETING, + _READY, + _FAILED, + _SYNCHRONIZING, + _SU_, + _CPA_, + _UPA, + _SPA, + ), + ( + (-1, {_sVm: _CREATING}), + (-1, {_sVm: _UPDATING}), + (-1, {_sVm: _UU}), + (-1, {_sVm: _DELETING}), + (-1, {_sVm: _READY}), + (-1, {_sVm: _FAILED}), + (-1, {_sVm: _SYNCHRONIZING}), + (-1, {_sVm: _SU_}), + (-1, {_sVm: _CPA_}), + (-1, {_sVm: _UPA}), + (-1, {_sVm: _SPA}), + ), ) -LIST_CONFIGURATION_BUNDLES = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListConfigurationBundles"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType({"method": "POST", "uri": "/configuration-bundles"}), - ) - ], +TARGET_ID: StaticSchema = (3, n0, _TI, 0) + +DELETE_GATEWAY_TARGET_INPUT: StaticSchema = ( + 18, + n0, + _DGTI, + {_sSI: _cDGTR, _smit: None}, + (_gI, _tI), + ((GATEWAY_IDENTIFIER, 9), (TARGET_ID, 9)), +) + +DELETE_GATEWAY_TARGET_OUTPUT: StaticSchema = ( + 18, + n0, + _DGTO, + {_sSI: _cDGTRo, _smith: None}, + (_gA, _tI, _st, _sRta), + ((GATEWAY_ARN, 1), (TARGET_ID, 1), (TARGET_STATUS, 1), (STATUS_REASONS, 0)), +) + +DELETE_GATEWAY_TARGET: StaticOperationSchema = ( + 23, + n0, + _DGT, + { + _smithy: MappingProxyType( + { + "code": 202, + "method": "DELETE", + "uri": "/gateways/{gatewayIdentifier}/targets/{targetId}/", + } + ) + }, + DELETE_GATEWAY_TARGET_INPUT, + DELETE_GATEWAY_TARGET_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -VERSION_FILTER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#VersionFilter"), - members={ - "branchName": {"target": BRANCH_NAME}, - "createdByName": {"target": _STRING}, - "latestPerBranch": {"target": BOOLEAN}, - }, +GET_GATEWAY_TARGET_INPUT: StaticSchema = ( + 18, + n0, + _GGTI, + {_sSI: _cGGTR, _smit: None}, + (_gI, _tI), + ((GATEWAY_IDENTIFIER, 9), (TARGET_ID, 9)), ) -LIST_CONFIGURATION_BUNDLE_VERSIONS_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ListConfigurationBundleVersionsInput" +TARGET_MAX_RESULTS: StaticSchema = (7, n0, _TMR, 0) + +TARGET_NEXT_TOKEN: StaticSchema = (3, n0, _TNT, 0) + +LIST_GATEWAY_TARGETS_INPUT: StaticSchema = ( + 18, + n0, + _LGTI, + {_sSI: _cLGTR, _smit: None}, + (_gI, _mR, _nT), + ( + (GATEWAY_IDENTIFIER, 9), + (TARGET_MAX_RESULTS, {_sQ: _mR}), + (TARGET_NEXT_TOKEN, {_sQ: _nT}), ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListConfigurationBundleVersionsRequest", - ) - ], - members={ - "bundleId": { - "target": CONFIGURATION_BUNDLE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "nextToken": { - "target": _STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "maxResults": { - "target": INTEGER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "filter": {"target": VERSION_FILTER}, - }, ) -CONFIGURATION_BUNDLE_VERSION_SUMMARY = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConfigurationBundleVersionSummary" - ), - members={ - "bundleArn": { - "target": CONFIGURATION_BUNDLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "bundleId": { - "target": CONFIGURATION_BUNDLE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "versionId": { - "target": CONFIGURATION_BUNDLE_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lineageMetadata": {"target": VERSION_LINEAGE_METADATA}, - "versionCreatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +TARGET_TYPE: StaticSchema = ( + 14, + n0, + _TT, + 0, + (_OAS_, _SM, _MS, _LAMBDA, _AG_, _CONNECTOR, _AR_, _PASSTHROUGH, _PROVIDER, _HC), + ( + (-1, {_sVm: _OAS_}), + (-1, {_sVm: _SM}), + (-1, {_sVm: _MS}), + (-1, {_sVm: _LAMBDA}), + (-1, {_sVm: _AG_}), + (-1, {_sVm: _CONNECTOR}), + (-1, {_sVm: _AR_}), + (-1, {_sVm: _PASSTHROUGH}), + (-1, {_sVm: _PROVIDER}), + (-1, {_sVm: _HC}), + ), ) -CONFIGURATION_BUNDLE_VERSION_SUMMARY_LIST = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConfigurationBundleVersionSummaryList" +TARGET_SUMMARY: StaticSchema = ( + 18, + n0, + _TSa, + 0, + (_tI, _n, _st, _d, _cA, _uA, _rP, _lSAa, _aD, _tT, _lMi), + ( + (TARGET_ID, 1), + (TARGET_NAME, 1), + (TARGET_STATUS, 1), + (TARGET_DESCRIPTION, 0), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (TARGET_RESOURCE_PRIORITY, 0), + (DATE_TIMESTAMP, 0), + (AUTHORIZATION_DATA, 0), + (TARGET_TYPE, 0), + (LISTING_MODE, 0), ), - shape_type=ShapeType.LIST, - members={"member": {"target": CONFIGURATION_BUNDLE_VERSION_SUMMARY}}, ) -LIST_CONFIGURATION_BUNDLE_VERSIONS_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ListConfigurationBundleVersionsOutput" +TARGET_SUMMARIES: StaticSchema = (16, n0, _TSar, 0, (_mem,), ((TARGET_SUMMARY, 0),)) + +LIST_GATEWAY_TARGETS_OUTPUT: StaticSchema = ( + 18, + n0, + _LGTO, + {_sSI: _cLGTRo, _smith: None}, + (_it, _nT), + ((TARGET_SUMMARIES, 1), (TARGET_NEXT_TOKEN, 0)), +) + +LIST_GATEWAY_TARGETS: StaticOperationSchema = ( + 23, + n0, + _LGT, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "GET", + "uri": "/gateways/{gatewayIdentifier}/targets/", + } + ) + }, + LIST_GATEWAY_TARGETS_INPUT, + LIST_GATEWAY_TARGETS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListConfigurationBundleVersionsResponse", - ) - ], - members={ - "versions": { - "target": CONFIGURATION_BUNDLE_VERSION_SUMMARY_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": _STRING}, - }, ) -LIST_CONFIGURATION_BUNDLE_VERSIONS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListConfigurationBundleVersions"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/configuration-bundles/{bundleId}/versions"} - ), - ) - ], +TARGET_ID_LIST: StaticSchema = (16, n0, _TIL, 0, (_mem,), ((TARGET_ID, 0),)) + +SYNCHRONIZE_GATEWAY_TARGETS_INPUT: StaticSchema = ( + 18, + n0, + _SGTI, + {_sSI: _cSGTR, _smit: None}, + (_gI, _tIL), + ((GATEWAY_IDENTIFIER, 9), (TARGET_ID_LIST, 1)), ) -UPDATE_CONFIGURATION_BUNDLE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateConfigurationBundleInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UpdateConfigurationBundleRequest", - ) - ], - members={ - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "bundleId": { - "target": CONFIGURATION_BUNDLE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "bundleName": {"target": CONFIGURATION_BUNDLE_NAME}, - "description": {"target": CONFIGURATION_BUNDLE_DESCRIPTION}, - "components": {"target": COMPONENT_CONFIGURATION_MAP}, - "parentVersionIds": { - "target": CONFIGURATION_BUNDLE_VERSION_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "branchName": {"target": BRANCH_NAME}, - "commitMessage": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdBy": {"target": VERSION_CREATED_BY_SOURCE}, - "kmsKeyArn": {"target": KMS_KEY_ARN}, - }, +GET_RESOURCE_POLICY_INPUT: StaticSchema = ( + 18, + n0, + _GRPI, + {_sSI: _cGRPR, _smit: None}, + (_rAe,), + ((BEDROCK_AGENTCORE_RESOURCE_ARN, 9),), ) -UPDATE_CONFIGURATION_BUNDLE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateConfigurationBundleOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UpdateConfigurationBundleResponse", - ) - ], - members={ - "bundleArn": { - "target": CONFIGURATION_BUNDLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "bundleId": { - "target": CONFIGURATION_BUNDLE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "versionId": { - "target": CONFIGURATION_BUNDLE_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +RESOURCE_POLICY_BODY: StaticSchema = (3, n0, _RPB, 0) + +GET_RESOURCE_POLICY_OUTPUT: StaticSchema = ( + 18, + n0, + _GRPO, + {_sSI: _cGRPRo, _smith: None}, + (_po,), + ((RESOURCE_POLICY_BODY, 0),), ) -UPDATE_CONFIGURATION_BUNDLE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateConfigurationBundle"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "PUT", "uri": "/configuration-bundles/{bundleId}"} - ), +GET_RESOURCE_POLICY: StaticOperationSchema = ( + 23, + n0, + _GRPe, + { + _smithy: MappingProxyType( + {"code": 200, "method": "GET", "uri": "/resourcepolicy/{resourceArn}"} ) - ], + }, + GET_RESOURCE_POLICY_INPUT, + GET_RESOURCE_POLICY_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CONSENT_PORTAL_ARN_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ConsentPortalArnType"), - shape_type=ShapeType.STRING, +TOKEN_VAULT_ID_TYPE: StaticSchema = (3, n0, _TVIT, 0) + +GET_TOKEN_VAULT_INPUT: StaticSchema = ( + 18, + n0, + _GTVI, + {_sSI: _cGTVR, _smit: None}, + (_tVI,), + ((TOKEN_VAULT_ID_TYPE, 0),), +) + +KEY_TYPE: StaticSchema = ( + 14, + n0, + _KT, + 0, + (_CMK, _SMK), + ((-1, {_sVm: _CMK}), (-1, {_sVm: _SMK})), +) + +KMS_CONFIGURATION: StaticSchema = ( + 18, + n0, + _KC, + 0, + (_kT, _kKA), + ((KEY_TYPE, 1), (KMS_KEY_ARN, 0)), +) + +GET_TOKEN_VAULT_OUTPUT: StaticSchema = ( + 18, + n0, + _GTVO, + {_sSI: _cGTVRo, _smith: None}, + (_tVI, _kC, _lMD), + ((TOKEN_VAULT_ID_TYPE, 1), (KMS_CONFIGURATION, 1), (4, 1)), +) + +GET_TOKEN_VAULT: StaticOperationSchema = ( + 23, + n0, + _GTV, + { + _smithy: MappingProxyType( + {"uri": "/identities/get-token-vault", "method": "POST"} + ) + }, + GET_TOKEN_VAULT_INPUT, + GET_TOKEN_VAULT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CONSENT_PORTAL_DESCRIPTION_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ConsentPortalDescriptionType"), - shape_type=ShapeType.STRING, -) +HARNESS_ENDPOINT_DESCRIPTION: StaticSchema = (3, n0, _HED, 0) -CONSENT_PORTAL_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ConsentPortalIdentifier"), - shape_type=ShapeType.STRING, -) +HARNESS_ENDPOINT_NAME: StaticSchema = (3, n0, _HEN, 0) + +HARNESS_ID: StaticSchema = (3, n0, _HI, 0) -O_AUTH2_CREDENTIAL_PROVIDER_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#OAuth2CredentialProviderArn"), - shape_type=ShapeType.STRING, +HARNESS_VERSION: StaticSchema = (3, n0, _HV, 0) + +CREATE_HARNESS_ENDPOINT_INPUT: StaticSchema = ( + 18, + n0, + _CHEI, + {_sSI: _cCHER, _smit: None}, + (_hI, _eN, _tV, _d, _cT, _t), + ( + (HARNESS_ID, 9), + (HARNESS_ENDPOINT_NAME, 1), + (HARNESS_VERSION, 0), + (HARNESS_ENDPOINT_DESCRIPTION, 0), + (CLIENT_TOKEN, 2), + (TAGS_MAP, 0), + ), ) -CONSENT_PORTAL_IDP_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ConsentPortalIdpConfig"), - members={ - "credentialProviderArn": { - "target": O_AUTH2_CREDENTIAL_PROVIDER_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "scopes": { - "target": ALLOWED_SCOPES_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "audience": {"target": ALLOWED_AUDIENCE_TYPE}, - }, +HARNESS_ENDPOINT_ARN: StaticSchema = (3, n0, _HEA, 0) + +HARNESS_NAME: StaticSchema = (3, n0, _HNa, 0) + +HARNESS_ENDPOINT_STATUS: StaticSchema = ( + 14, + n0, + _HES, + 0, + (_CREATING, _CF, _UPDATING, _UF, _READY, _DELETING, _DF), + ( + (-1, {_sVm: _CREATING}), + (-1, {_sVm: _CF}), + (-1, {_sVm: _UPDATING}), + (-1, {_sVm: _UF}), + (-1, {_sVm: _READY}), + (-1, {_sVm: _DELETING}), + (-1, {_sVm: _DF}), + ), ) -CONSENT_PORTAL_NAME_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ConsentPortalNameType"), - shape_type=ShapeType.STRING, +HARNESS_ENDPOINT: StaticSchema = ( + 18, + n0, + _HEa, + 0, + (_hI, _hN, _eN, _a, _st, _cA, _uA, _lV, _tV, _d, _fR), + ( + (HARNESS_ID, 1), + (HARNESS_NAME, 1), + (HARNESS_ENDPOINT_NAME, 1), + (HARNESS_ENDPOINT_ARN, 1), + (HARNESS_ENDPOINT_STATUS, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (HARNESS_VERSION, 0), + (HARNESS_VERSION, 0), + (HARNESS_ENDPOINT_DESCRIPTION, 0), + (3, 0), + ), ) -CONSENT_PORTAL_SOURCE_IDENTIFIER_TYPE = Schema( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConsentPortalSourceIdentifierType" +CREATE_HARNESS_ENDPOINT_OUTPUT: StaticSchema = ( + 18, + n0, + _CHEO, + {_sSI: _cCHERo, _smith: None}, + (_end,), + ((HARNESS_ENDPOINT, 1),), +) + +CREATE_HARNESS_ENDPOINT: StaticOperationSchema = ( + 23, + n0, + _CHE, + { + _smithy: MappingProxyType( + {"code": 201, "method": "POST", "uri": "/harnesses/{harnessId}/endpoints"} + ) + }, + CREATE_HARNESS_ENDPOINT_INPUT, + CREATE_HARNESS_ENDPOINT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, ), - shape_type=ShapeType.STRING, ) -CONSENT_PORTAL_SOURCE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ConsentPortalSourceType"), - shape_type=ShapeType.ENUM, - members={"AGENTCORE_GATEWAY": {"target": UNIT}}, +DELETE_HARNESS_ENDPOINT_INPUT: StaticSchema = ( + 18, + n0, + _DHEI, + {_sSI: _cDHER, _smit: None}, + (_hI, _eN, _cT), + ( + (HARNESS_ID, 9), + (HARNESS_ENDPOINT_NAME, 9), + (CLIENT_TOKEN, {_sQ: _cT, _sT: None}), + ), ) -CONSENT_PORTAL_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ConsentPortalSource"), - members={ - "identifier": { - "target": CONSENT_PORTAL_SOURCE_IDENTIFIER_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "type": { - "target": CONSENT_PORTAL_SOURCE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +DELETE_HARNESS_ENDPOINT_OUTPUT: StaticSchema = ( + 18, + n0, + _DHEO, + {_sSI: _cDHERo, _smith: None}, + (_end,), + ((HARNESS_ENDPOINT, 1),), +) + +DELETE_HARNESS_ENDPOINT: StaticOperationSchema = ( + 23, + n0, + _DHE, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "DELETE", + "uri": "/harnesses/{harnessId}/endpoints/{endpointName}", + } + ) + }, + DELETE_HARNESS_ENDPOINT_INPUT, + DELETE_HARNESS_ENDPOINT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CONSENT_PORTAL_SOURCES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ConsentPortalSources"), - shape_type=ShapeType.LIST, - members={"member": {"target": CONSENT_PORTAL_SOURCE}}, +GET_HARNESS_ENDPOINT_INPUT: StaticSchema = ( + 18, + n0, + _GHEI, + {_sSI: _cGHER, _smit: None}, + (_hI, _eN), + ((HARNESS_ID, 9), (HARNESS_ENDPOINT_NAME, 9)), +) + +GET_HARNESS_ENDPOINT_OUTPUT: StaticSchema = ( + 18, + n0, + _GHEO, + {_sSI: _cGHERo, _smith: None}, + (_end,), + ((HARNESS_ENDPOINT, 1),), +) + +GET_HARNESS_ENDPOINT: StaticOperationSchema = ( + 23, + n0, + _GHE, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "GET", + "uri": "/harnesses/{harnessId}/endpoints/{endpointName}", + } + ) + }, + GET_HARNESS_ENDPOINT_INPUT, + GET_HARNESS_ENDPOINT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CONSENT_PORTAL_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ConsentPortalStatus"), - shape_type=ShapeType.ENUM, - members={ - "CREATING": {"target": UNIT}, - "ACTIVE": {"target": UNIT}, - "UPDATING": {"target": UNIT}, - "UPDATE_FAILED": {"target": UNIT}, - "DELETING": {"target": UNIT}, - "FAILED": {"target": UNIT}, - }, +LIST_HARNESS_ENDPOINTS_INPUT: StaticSchema = ( + 18, + n0, + _LHEI, + {_sSI: _cLHER, _smit: None}, + (_hI, _mR, _nT), + ((HARNESS_ID, 9), (MAX_RESULTS, {_sQ: _mR}), (NEXT_TOKEN, {_sQ: _nT})), ) -EXECUTION_ROLE_ARN_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ExecutionRoleArnType"), - shape_type=ShapeType.STRING, +HARNESS_ENDPOINTS: StaticSchema = (16, n0, _HEar, 0, (_mem,), ((HARNESS_ENDPOINT, 0),)) + +LIST_HARNESS_ENDPOINTS_OUTPUT: StaticSchema = ( + 18, + n0, + _LHEO, + {_sSI: _cLHERo, _smith: None}, + (_endp, _nT), + ((HARNESS_ENDPOINTS, 1), (NEXT_TOKEN, 0)), ) -CREATE_CONSENT_PORTAL_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateConsentPortalInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreateConsentPortalRequest", +LIST_HARNESS_ENDPOINTS: StaticOperationSchema = ( + 23, + n0, + _LHE, + { + _smithy: MappingProxyType( + {"code": 200, "method": "GET", "uri": "/harnesses/{harnessId}/endpoints"} ) - ], - members={ - "executionRoleArn": { - "target": EXECUTION_ROLE_ARN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "idpConfig": { - "target": CONSENT_PORTAL_IDP_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": CONSENT_PORTAL_NAME_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "sources": { - "target": CONSENT_PORTAL_SOURCES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": CONSENT_PORTAL_DESCRIPTION_TYPE}, - "tags": {"target": TAGS_MAP}, }, + LIST_HARNESS_ENDPOINTS_INPUT, + LIST_HARNESS_ENDPOINTS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CONSENT_PORTAL_ID_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ConsentPortalIdType"), - shape_type=ShapeType.STRING, +UPDATE_HARNESS_ENDPOINT_INPUT: StaticSchema = ( + 18, + n0, + _UHEI, + {_sSI: _cUHER, _smit: None}, + (_hI, _eN, _tV, _d, _cT), + ( + (HARNESS_ID, 9), + (HARNESS_ENDPOINT_NAME, 9), + (HARNESS_VERSION, 0), + (HARNESS_ENDPOINT_DESCRIPTION, 0), + (CLIENT_TOKEN, 2), + ), ) -PORTAL_URL_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PortalUrlType"), - shape_type=ShapeType.STRING, +UPDATE_HARNESS_ENDPOINT_OUTPUT: StaticSchema = ( + 18, + n0, + _UHEO, + {_sSI: _cUHERo, _smith: None}, + (_end,), + ((HARNESS_ENDPOINT, 1),), +) + +UPDATE_HARNESS_ENDPOINT: StaticOperationSchema = ( + 23, + n0, + _UHE, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "PATCH", + "uri": "/harnesses/{harnessId}/endpoints/{endpointName}", + } + ) + }, + UPDATE_HARNESS_ENDPOINT_INPUT, + UPDATE_HARNESS_ENDPOINT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -STATUS_REASON_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#StatusReasonType"), - shape_type=ShapeType.STRING, -) +HARNESS_ALLOWED_TOOL: StaticSchema = (3, n0, _HAT, 0) -CREATE_CONSENT_PORTAL_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateConsentPortalOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreateConsentPortalResponse", - ) - ], - members={ - "sources": { - "target": CONSENT_PORTAL_SOURCES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "consentPortalArn": { - "target": CONSENT_PORTAL_ARN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "consentPortalId": { - "target": CONSENT_PORTAL_ID_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": CONSENT_PORTAL_DESCRIPTION_TYPE}, - "executionRoleArn": { - "target": EXECUTION_ROLE_ARN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "idpConfig": { - "target": CONSENT_PORTAL_IDP_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": CONSENT_PORTAL_NAME_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "portalUrl": {"target": PORTAL_URL_TYPE}, - "status": { - "target": CONSENT_PORTAL_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "statusReason": {"target": STATUS_REASON_TYPE}, - "updatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +HARNESS_ALLOWED_TOOLS: StaticSchema = ( + 16, + n0, + _HATa, + 0, + (_mem,), + ((HARNESS_ALLOWED_TOOL, 0),), ) -CREATE_CONSENT_PORTAL = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateConsentPortal"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 202, - "uri": "/identities/CreateConsentPortal", - "method": "POST", - } - ), - ) - ], +HARNESS_AGENT_CORE_RUNTIME_ENVIRONMENT_REQUEST: StaticSchema = ( + 18, + n0, + _HACRER, + 0, + (_lC, _nC, _fC), + ( + (LIFECYCLE_CONFIGURATION, 0), + (NETWORK_CONFIGURATION, 0), + (FILESYSTEM_CONFIGURATIONS, 0), + ), ) -DELETE_CONSENT_PORTAL_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteConsentPortalInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeleteConsentPortalRequest", - ) - ], - members={ - "consentPortalIdentifier": { - "target": CONSENT_PORTAL_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +HARNESS_ENVIRONMENT_PROVIDER_REQUEST: StaticSchema = ( + 19, + n0, + _HEPR, + 0, + (_aCRE,), + ((HARNESS_AGENT_CORE_RUNTIME_ENVIRONMENT_REQUEST, 0),), ) -DELETE_CONSENT_PORTAL_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteConsentPortalOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeleteConsentPortalResponse", - ) - ], -) - -DELETE_CONSENT_PORTAL = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteConsentPortal"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 204, - "uri": "/identities/DeleteConsentPortal", - "method": "POST", - } - ), - ) - ], +HARNESS_ENVIRONMENT_ARTIFACT: StaticSchema = ( + 19, + n0, + _HEAa, + 0, + (_cC,), + ((CONTAINER_CONFIGURATION, 0),), ) -GET_CONSENT_PORTAL_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetConsentPortalInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetConsentPortalRequest", - ) - ], - members={ - "consentPortalIdentifier": { - "target": CONSENT_PORTAL_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +HARNESS_HOOK_NAME: StaticSchema = (3, n0, _HHNa, 0) -GET_CONSENT_PORTAL_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetConsentPortalOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetConsentPortalResponse", - ) - ], - members={ - "sources": { - "target": CONSENT_PORTAL_SOURCES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "consentPortalArn": { - "target": CONSENT_PORTAL_ARN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "consentPortalId": { - "target": CONSENT_PORTAL_ID_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": CONSENT_PORTAL_DESCRIPTION_TYPE}, - "executionRoleArn": { - "target": EXECUTION_ROLE_ARN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "idpConfig": { - "target": CONSENT_PORTAL_IDP_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": CONSENT_PORTAL_NAME_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "portalUrl": {"target": PORTAL_URL_TYPE}, - "status": { - "target": CONSENT_PORTAL_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "statusReason": {"target": STATUS_REASON_TYPE}, - "updatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +HARNESS_EVENT_BRIDGE_BUS_ARN: StaticSchema = (3, n0, _HEBBA, 0) -GET_CONSENT_PORTAL = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetConsentPortal"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"uri": "/identities/GetConsentPortal", "method": "POST"} - ), - ) - ], +HARNESS_HOOK_EVENT_BRIDGE_TARGET: StaticSchema = ( + 18, + n0, + _HHEBT, + 0, + (_a,), + ((HARNESS_EVENT_BRIDGE_BUS_ARN, 1),), ) -LIST_CONSENT_PORTALS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListConsentPortalsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListConsentPortalsRequest", - ) - ], - members={"maxResults": {"target": INTEGER}, "nextToken": {"target": _STRING}}, -) - -CONSENT_PORTAL_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ConsentPortalSummary"), - members={ - "sources": { - "target": CONSENT_PORTAL_SOURCES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "consentPortalArn": { - "target": CONSENT_PORTAL_ARN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "consentPortalId": { - "target": CONSENT_PORTAL_ID_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": CONSENT_PORTAL_DESCRIPTION_TYPE}, - "name": { - "target": CONSENT_PORTAL_NAME_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "portalUrl": {"target": PORTAL_URL_TYPE}, - "status": { - "target": CONSENT_PORTAL_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +HARNESS_LAMBDA_FUNCTION_ARN: StaticSchema = (3, n0, _HLFA, 0) -CONSENT_PORTAL_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ConsentPortalSummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": CONSENT_PORTAL_SUMMARY}}, +HARNESS_HOOK_FAILURE_MODE: StaticSchema = ( + 14, + n0, + _HHFM, + 0, + (_ALLOW, _DENY), + ((-1, {_sVm: _al}), (-1, {_sVm: _den})), ) -LIST_CONSENT_PORTALS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListConsentPortalsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListConsentPortalsResponse", - ) - ], - members={ - "consentPortals": { - "target": CONSENT_PORTAL_SUMMARIES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": _STRING}, - }, +HARNESS_HOOK_LAMBDA_TARGET: StaticSchema = ( + 18, + n0, + _HHLT, + 0, + (_a, _tSi, _fM), + ( + (HARNESS_LAMBDA_FUNCTION_ARN, 1), + (7, {_smithya: 60}), + (HARNESS_HOOK_FAILURE_MODE, {_smithya: _den}), + ), ) -LIST_CONSENT_PORTALS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListConsentPortals"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"uri": "/identities/ListConsentPortals", "method": "POST"} - ), - ) - ], -) +HARNESS_SNS_TOPIC_ARN: StaticSchema = (3, n0, _HSTA, 0) -UPDATE_CONSENT_PORTAL_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateConsentPortalInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UpdateConsentPortalRequest", - ) - ], - members={ - "consentPortalIdentifier": { - "target": CONSENT_PORTAL_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "executionRoleArn": {"target": EXECUTION_ROLE_ARN_TYPE}, - "idpConfig": {"target": CONSENT_PORTAL_IDP_CONFIG}, - "description": {"target": CONSENT_PORTAL_DESCRIPTION_TYPE}, - }, +HARNESS_HOOK_SNS_TARGET: StaticSchema = ( + 18, + n0, + _HHST, + 0, + (_a,), + ((HARNESS_SNS_TOPIC_ARN, 1),), ) -UPDATE_CONSENT_PORTAL_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateConsentPortalOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UpdateConsentPortalResponse", - ) - ], - members={ - "sources": { - "target": CONSENT_PORTAL_SOURCES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "consentPortalArn": { - "target": CONSENT_PORTAL_ARN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "consentPortalId": { - "target": CONSENT_PORTAL_ID_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": CONSENT_PORTAL_DESCRIPTION_TYPE}, - "executionRoleArn": { - "target": EXECUTION_ROLE_ARN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "idpConfig": { - "target": CONSENT_PORTAL_IDP_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": CONSENT_PORTAL_NAME_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "portalUrl": {"target": PORTAL_URL_TYPE}, - "status": { - "target": CONSENT_PORTAL_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "statusReason": {"target": STATUS_REASON_TYPE}, - "updatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +HARNESS_HOOK_TARGET: StaticSchema = ( + 19, + n0, + _HHT, + 0, + (_lam, _sn, _eB), + ( + (HARNESS_HOOK_LAMBDA_TARGET, 0), + (HARNESS_HOOK_SNS_TARGET, 0), + (HARNESS_HOOK_EVENT_BRIDGE_TARGET, 0), + ), ) -UPDATE_CONSENT_PORTAL = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateConsentPortal"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 202, - "uri": "/identities/UpdateConsentPortal", - "method": "POST", - } - ), - ) - ], +HARNESS_AFTER_INVOCATION_HOOK: StaticSchema = ( + 18, + n0, + _HAIH, + 0, + (_n, _ta), + ((HARNESS_HOOK_NAME, 1), (HARNESS_HOOK_TARGET, 1)), +) + +HARNESS_AFTER_TOOL_CALL_HOOK: StaticSchema = ( + 18, + n0, + _HATCH, + 0, + (_n, _ta), + ((HARNESS_HOOK_NAME, 1), (HARNESS_HOOK_TARGET, 1)), +) + +HARNESS_BEFORE_INVOCATION_HOOK: StaticSchema = ( + 18, + n0, + _HBIH, + 0, + (_n, _ta), + ((HARNESS_HOOK_NAME, 1), (HARNESS_HOOK_TARGET, 1)), +) + +HARNESS_BEFORE_TOOL_CALL_HOOK: StaticSchema = ( + 18, + n0, + _HBTCH, + 0, + (_n, _ta), + ((HARNESS_HOOK_NAME, 1), (HARNESS_HOOK_TARGET, 1)), +) + +HARNESS_HOOK: StaticSchema = ( + 19, + n0, + _HH, + 0, + (_bIe, _aI, _bTC, _aTC), + ( + (HARNESS_BEFORE_INVOCATION_HOOK, 0), + (HARNESS_AFTER_INVOCATION_HOOK, 0), + (HARNESS_BEFORE_TOOL_CALL_HOOK, 0), + (HARNESS_AFTER_TOOL_CALL_HOOK, 0), + ), ) -DATASET_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DatasetName"), - shape_type=ShapeType.STRING, -) +HARNESS_HOOKS: StaticSchema = (16, n0, _HHa, 0, (_mem,), ((HARNESS_HOOK, 0),)) -DATASET_SCHEMA_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DatasetSchemaType"), - shape_type=ShapeType.ENUM, - members={ - "AGENTCORE_EVALUATION_PREDEFINED_V1": {"target": UNIT}, - "AGENTCORE_EVALUATION_SIMULATED_V1": {"target": UNIT}, - "THIRD_PARTY_EVALUATION_V1": {"target": UNIT}, - }, -) +MEMORY_ARN: StaticSchema = (3, n0, _MA, 0) -CREATE_DATASET_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateDatasetInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreateDatasetRequest", - ) - ], - members={ - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "datasetName": { - "target": DATASET_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": _STRING}, - "source": { - "target": DATA_SOURCE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "schemaType": { - "target": DATASET_SCHEMA_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "kmsKeyArn": {"target": KMS_KEY_ARN}, - "tags": {"target": TAGS_MAP}, - }, +HARNESS_AGENT_CORE_MEMORY_RETRIEVAL_CONFIG: StaticSchema = ( + 18, + n0, + _HACMRC, + 0, + (_tK, _rSe, _sIt), + ((7, 0), (9, 0), (3, 0)), ) -CREATE_DATASET_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateDatasetOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreateDatasetResponse", - ) - ], - members={ - "datasetArn": { - "target": DATASET_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "datasetId": { - "target": DATASET_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": DATASET_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +HARNESS_AGENT_CORE_MEMORY_RETRIEVAL_CONFIGS: StaticSchema = ( + 17, + n0, + _HACMRCa, + 0, + (_k, _v), + ((3, 0), (HARNESS_AGENT_CORE_MEMORY_RETRIEVAL_CONFIG, 0)), ) -CREATE_DATASET = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateDataset"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType({"method": "POST", "uri": "/datasets", "code": 202}), - ) - ], +HARNESS_AGENT_CORE_MEMORY_CONFIGURATION: StaticSchema = ( + 18, + n0, + _HACMC, + 0, + (_a, _aIc, _mCe, _rC), + ((MEMORY_ARN, 1), (3, 0), (7, 0), (HARNESS_AGENT_CORE_MEMORY_RETRIEVAL_CONFIGS, 0)), ) -CREATE_DATASET_VERSION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateDatasetVersionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreateDatasetVersionRequest", - ) - ], - members={ - "datasetId": { - "target": DATASET_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - }, -) +HARNESS_DISABLED_MEMORY_CONFIGURATION: StaticSchema = (18, n0, _HDMC, 0) -DATASET_VERSION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DatasetVersion"), - shape_type=ShapeType.STRING, +HARNESS_MANAGED_MEMORY_STRATEGY_TYPE: StaticSchema = ( + 14, + n0, + _HMMST, + 0, + (_SEMANTIC, _SUMMARIZATION, _UP, _EPISODIC), + ( + (-1, {_sVm: _SEMANTIC}), + (-1, {_sVm: _SUMMARIZATION}), + (-1, {_sVm: _UP}), + (-1, {_sVm: _EPISODIC}), + ), ) -CREATE_DATASET_VERSION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateDatasetVersionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreateDatasetVersionResponse", - ) - ], - members={ - "datasetArn": { - "target": DATASET_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "datasetId": { - "target": DATASET_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": DATASET_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "datasetVersion": { - "target": DATASET_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +HARNESS_MANAGED_MEMORY_STRATEGY_LIST: StaticSchema = ( + 16, + n0, + _HMMSL, + 0, + (_mem,), + ((HARNESS_MANAGED_MEMORY_STRATEGY_TYPE, 0),), +) + +HARNESS_MANAGED_MEMORY_CONFIGURATION: StaticSchema = ( + 18, + n0, + _HMMC, + 0, + (_a, _stra, _eED, _eKA), + ( + (MEMORY_ARN, 0), + (HARNESS_MANAGED_MEMORY_STRATEGY_LIST, 0), + (7, 0), + (KMS_KEY_ARN, 0), + ), ) -CREATE_DATASET_VERSION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateDatasetVersion"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/datasets/{datasetId}/versions", "code": 202} - ), - ) - ], +HARNESS_MEMORY_CONFIGURATION: StaticSchema = ( + 19, + n0, + _HMC, + 0, + (_aCMC, _mMC, _dis), + ( + (HARNESS_AGENT_CORE_MEMORY_CONFIGURATION, 0), + (HARNESS_MANAGED_MEMORY_CONFIGURATION, 0), + (HARNESS_DISABLED_MEMORY_CONFIGURATION, 0), + ), ) -DELETE_DATASET_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteDatasetInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeleteDatasetRequest", - ) - ], - members={ - "datasetId": { - "target": DATASET_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "datasetVersion": { - "target": DATASET_VERSION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="datasetVersion") - ], - }, - }, +HARNESS_BEDROCK_API_FORMAT: StaticSchema = ( + 14, + n0, + _HBAF, + 0, + (_CS_, _RESPONSES, _CC__), + ((-1, {_sVm: _cs}), (-1, {_sVm: _res}), (-1, {_sVm: _cc})), ) -DELETE_DATASET_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteDatasetOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeleteDatasetResponse", - ) - ], - members={ - "datasetArn": { - "target": DATASET_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "datasetId": { - "target": DATASET_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": DATASET_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "datasetVersion": { - "target": DATASET_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +MAX_TOKENS: StaticSchema = (7, n0, _MT, 0) -DELETE_DATASET = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteDataset"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "DELETE", "uri": "/datasets/{datasetId}", "code": 202} - ), - ) - ], -) +TEMPERATURE: StaticSchema = (9, n0, _T, 0) -DELETE_DATASET_EXAMPLES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteDatasetExamplesInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeleteDatasetExamplesRequest", - ) - ], - members={ - "datasetId": { - "target": DATASET_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "exampleIds": { - "target": EXAMPLE_ID_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +TOP_P: StaticSchema = (9, n0, _TPo, 0) -DELETE_DATASET_EXAMPLES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteDatasetExamplesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeleteDatasetExamplesResponse", - ) - ], - members={ - "datasetArn": { - "target": DATASET_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "datasetId": { - "target": DATASET_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": DATASET_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "deletedCount": { - "target": LONG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +HARNESS_BEDROCK_MODEL_CONFIG: StaticSchema = ( + 18, + n0, + _HBMC, + 0, + (_mI, _mT, _te, _tP, _aF, _aP), + ( + (MODEL_ID, 1), + (MAX_TOKENS, 0), + (TEMPERATURE, 0), + (TOP_P, 0), + (HARNESS_BEDROCK_API_FORMAT, 0), + (13, 0), + ), ) -DELETE_DATASET_EXAMPLES = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteDatasetExamples"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/datasets/{datasetId}/examples/delete", - "code": 202, - } - ), - ) - ], +API_KEY_ARN: StaticSchema = (3, n0, _AKA, 0) + +TOP_K: StaticSchema = (7, n0, _TKo, 0) + +HARNESS_GEMINI_MODEL_CONFIG: StaticSchema = ( + 18, + n0, + _HGMC, + 0, + (_mI, _aKA, _mT, _te, _tP, _tK, _aP), + ( + (MODEL_ID, 1), + (API_KEY_ARN, 1), + (MAX_TOKENS, 0), + (TEMPERATURE, 0), + (TOP_P, 0), + (TOP_K, 0), + (13, 0), + ), ) -GET_DATASET_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetDatasetInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetDatasetRequest", - ) - ], - members={ - "datasetId": { - "target": DATASET_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "datasetVersion": { - "target": DATASET_VERSION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="datasetVersion") - ], - }, - }, +HARNESS_LITE_LLM_API_BASE: StaticSchema = (3, n0, _HLLAB, 4) + +HARNESS_LITE_LLM_MODEL_CONFIG: StaticSchema = ( + 18, + n0, + _HLLMC, + 0, + (_mI, _aKA, _aB, _mT, _te, _tP, _aP), + ( + (MODEL_ID, 1), + (API_KEY_ARN, 0), + (HARNESS_LITE_LLM_API_BASE, 0), + (MAX_TOKENS, 0), + (TEMPERATURE, 0), + (TOP_P, 0), + (13, 0), + ), ) -DOWNLOAD_URL = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DownloadUrl"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +HARNESS_OPEN_AI_API_BASE: StaticSchema = (3, n0, _HOAAB, 4) + +HARNESS_OPEN_AI_API_FORMAT: StaticSchema = ( + 14, + n0, + _HOAAF, + 0, + (_CC__, _RESPONSES), + ((-1, {_sVm: _cc}), (-1, {_sVm: _res})), +) + +HARNESS_OPEN_AI_MODEL_CONFIG: StaticSchema = ( + 18, + n0, + _HOAMC, + 0, + (_mI, _aKA, _aB, _mT, _te, _tP, _aF, _aP), + ( + (MODEL_ID, 1), + (API_KEY_ARN, 1), + (HARNESS_OPEN_AI_API_BASE, 0), + (MAX_TOKENS, 0), + (TEMPERATURE, 0), + (TOP_P, 0), + (HARNESS_OPEN_AI_API_FORMAT, 0), + (13, 0), + ), ) -DRAFT_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DraftStatus"), - shape_type=ShapeType.ENUM, - members={"MODIFIED": {"target": UNIT}, "UNMODIFIED": {"target": UNIT}}, +HARNESS_MODEL_CONFIGURATION: StaticSchema = ( + 19, + n0, + _HMCa, + 0, + (_bMC, _oAMC, _gMC, _lLMC), + ( + (HARNESS_BEDROCK_MODEL_CONFIG, 0), + (HARNESS_OPEN_AI_MODEL_CONFIG, 0), + (HARNESS_GEMINI_MODEL_CONFIG, 0), + (HARNESS_LITE_LLM_MODEL_CONFIG, 0), + ), ) -GET_DATASET_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetDatasetOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetDatasetResponse", - ) - ], - members={ - "datasetArn": { - "target": DATASET_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "datasetId": { - "target": DATASET_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "datasetVersion": { - "target": DATASET_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "datasetName": { - "target": DATASET_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": _STRING}, - "status": { - "target": DATASET_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "draftStatus": {"target": DRAFT_STATUS}, - "failureReason": {"target": _STRING}, - "schemaType": { - "target": DATASET_SCHEMA_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "kmsKeyArn": {"target": KMS_KEY_ARN}, - "exampleCount": { - "target": LONG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "downloadUrl": {"target": DOWNLOAD_URL}, - "downloadUrlExpiresAt": {"target": TIMESTAMP}, - "createdAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "tags": {"target": TAGS_MAP}, - }, +HARNESS_AWS_SKILL_PATH: StaticSchema = (3, n0, _HASP, 0) + +HARNESS_AWS_SKILL_PATHS: StaticSchema = ( + 16, + n0, + _HASPa, + 0, + (_mem,), + ((HARNESS_AWS_SKILL_PATH, 0),), ) -GET_DATASET = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetDataset"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType({"method": "GET", "uri": "/datasets/{datasetId}"}), - ) - ], +HARNESS_SKILL_AWS_SKILLS_SOURCE: StaticSchema = ( + 18, + n0, + _HSASS, + 0, + (_path,), + ((HARNESS_AWS_SKILL_PATHS, 0),), ) -LIST_DATASET_EXAMPLES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListDatasetExamplesInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListDatasetExamplesRequest", - ) - ], - members={ - "datasetId": { - "target": DATASET_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "datasetVersion": { - "target": DATASET_VERSION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="datasetVersion") - ], - }, - "maxResults": { - "target": INTEGER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "nextToken": { - "target": _STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - }, +HARNESS_SKILL_GIT_AUTH: StaticSchema = ( + 18, + n0, + _HSGA, + 0, + (_cAr, _us), + ((API_KEY_ARN, 1), (3, 0)), ) -LIST_DATASET_EXAMPLES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListDatasetExamplesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListDatasetExamplesResponse", - ) - ], - members={ - "datasetArn": { - "target": DATASET_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "datasetId": { - "target": DATASET_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "datasetVersion": { - "target": DATASET_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "examples": { - "target": DATASET_EXAMPLE_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": _STRING}, - }, -) - -LIST_DATASET_EXAMPLES = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListDatasetExamples"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/datasets/{datasetId}/examples"} - ), - ) - ], -) +HARNESS_SKILL_GIT_URL: StaticSchema = (3, n0, _HSGU, 0) -LIST_DATASETS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListDatasetsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListDatasetsRequest", - ) - ], - members={ - "nextToken": { - "target": _STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "maxResults": { - "target": INTEGER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - }, +HARNESS_SKILL_GIT_SOURCE: StaticSchema = ( + 18, + n0, + _HSGS, + 0, + (_ur, _pat, _aut), + ((HARNESS_SKILL_GIT_URL, 1), (3, 0), (HARNESS_SKILL_GIT_AUTH, 0)), ) -DATASET_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DatasetSummary"), - members={ - "datasetArn": { - "target": DATASET_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "datasetId": { - "target": DATASET_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "datasetName": { - "target": DATASET_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": _STRING}, - "status": { - "target": DATASET_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "draftStatus": {"target": DRAFT_STATUS}, - "schemaType": { - "target": DATASET_SCHEMA_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "exampleCount": { - "target": LONG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +HARNESS_SKILL_PATH: StaticSchema = (3, n0, _HSP, 0) -DATASET_SUMMARY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DatasetSummaryList"), - shape_type=ShapeType.LIST, - members={"member": {"target": DATASET_SUMMARY}}, -) +HARNESS_SKILL_S3_URI: StaticSchema = (3, n0, _HSSU, 0) -LIST_DATASETS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListDatasetsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListDatasetsResponse", - ) - ], - members={ - "datasets": { - "target": DATASET_SUMMARY_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": _STRING}, - }, +HARNESS_SKILL_S3_SOURCE: StaticSchema = ( + 18, + n0, + _HSSS, + 0, + (_u,), + ((HARNESS_SKILL_S3_URI, 1),), ) -LIST_DATASETS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListDatasets"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType({"method": "GET", "uri": "/datasets"}), - ) - ], +HARNESS_SKILL: StaticSchema = ( + 19, + n0, + _HS, + 0, + (_pat, _s_, _gi, _aSw), + ( + (HARNESS_SKILL_PATH, 0), + (HARNESS_SKILL_S3_SOURCE, 0), + (HARNESS_SKILL_GIT_SOURCE, 0), + (HARNESS_SKILL_AWS_SKILLS_SOURCE, 0), + ), ) -LIST_DATASET_VERSIONS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListDatasetVersionsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListDatasetVersionsRequest", - ) - ], - members={ - "datasetId": { - "target": DATASET_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "nextToken": { - "target": _STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "maxResults": { - "target": INTEGER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - }, -) +HARNESS_SKILLS: StaticSchema = (16, n0, _HSa, 0, (_mem,), ((HARNESS_SKILL, 0),)) -DATASET_VERSION_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DatasetVersionSummary"), - members={ - "datasetVersion": { - "target": DATASET_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "exampleCount": { - "target": LONG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +SENSITIVE_TEXT: StaticSchema = (3, n0, _STen, 4) -DATASET_VERSION_SUMMARY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DatasetVersionSummaryList"), - shape_type=ShapeType.LIST, - members={"member": {"target": DATASET_VERSION_SUMMARY}}, +HARNESS_SYSTEM_CONTENT_BLOCK: StaticSchema = ( + 19, + n0, + _HSCB, + 0, + (_tex,), + ((SENSITIVE_TEXT, 0),), ) -LIST_DATASET_VERSIONS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListDatasetVersionsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListDatasetVersionsResponse", - ) - ], - members={ - "versions": { - "target": DATASET_VERSION_SUMMARY_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": _STRING}, - }, +HARNESS_SYSTEM_PROMPT: StaticSchema = ( + 16, + n0, + _HSPa, + 0, + (_mem,), + ((HARNESS_SYSTEM_CONTENT_BLOCK, 0),), ) -LIST_DATASET_VERSIONS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListDatasetVersions"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/datasets/{datasetId}/versions"} - ), - ) - ], -) +HARNESS_BROWSER_ARN: StaticSchema = (3, n0, _HBA, 0) -UPDATE_DATASET_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateDatasetInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UpdateDatasetRequest", - ) - ], - members={ - "datasetId": { - "target": DATASET_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "description": {"target": _STRING}, - }, +HARNESS_AGENT_CORE_BROWSER_CONFIG: StaticSchema = ( + 18, + n0, + _HACBC, + 0, + (_bAr,), + ((HARNESS_BROWSER_ARN, 0),), ) -UPDATE_DATASET_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateDatasetOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UpdateDatasetResponse", - ) - ], - members={ - "datasetArn": { - "target": DATASET_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "datasetId": { - "target": DATASET_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +HARNESS_CODE_INTERPRETER_ARN: StaticSchema = (3, n0, _HCIA, 0) -UPDATE_DATASET = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateDataset"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "PUT", "uri": "/datasets/{datasetId}", "code": 200} - ), - ) - ], +HARNESS_AGENT_CORE_CODE_INTERPRETER_CONFIG: StaticSchema = ( + 18, + n0, + _HACCIC, + 0, + (_cIA,), + ((HARNESS_CODE_INTERPRETER_ARN, 0),), ) -UPDATE_DATASET_EXAMPLES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateDatasetExamplesInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UpdateDatasetExamplesRequest", - ) - ], - members={ - "datasetId": { - "target": DATASET_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "examples": { - "target": DATASET_EXAMPLE_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +HARNESS_GATEWAY_OUTBOUND_AUTH: StaticSchema = ( + 19, + n0, + _HGOA, + 0, + (_aIw, _no, _oau), + ((-1, 0), (-1, 0), (O_AUTH_CREDENTIAL_PROVIDER, 0)), ) -UPDATE_DATASET_EXAMPLES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateDatasetExamplesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UpdateDatasetExamplesResponse", - ) - ], - members={ - "datasetArn": { - "target": DATASET_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "datasetId": { - "target": DATASET_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": DATASET_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedCount": { - "target": LONG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +HARNESS_AGENT_CORE_GATEWAY_CONFIG: StaticSchema = ( + 18, + n0, + _HACGC, + 0, + (_gA, _oA), + ((GATEWAY_ARN, 1), (HARNESS_GATEWAY_OUTBOUND_AUTH, 0)), ) -UPDATE_DATASET_EXAMPLES = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateDatasetExamples"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/datasets/{datasetId}/examples/update", - "code": 202, - } - ), - ) - ], -) +HARNESS_INLINE_FUNCTION_DESCRIPTION: StaticSchema = (3, n0, _HIFD, 4) -DELETE_RESOURCE_POLICY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteResourcePolicyInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeleteResourcePolicyRequest", - ) - ], - members={ - "resourceArn": { - "target": BEDROCK_AGENTCORE_RESOURCE_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, +HARNESS_INLINE_FUNCTION_CONFIG: StaticSchema = ( + 18, + n0, + _HIFC, + 0, + (_d, _iS), + ((HARNESS_INLINE_FUNCTION_DESCRIPTION, 1), (SENSITIVE_JSON, 1)), ) -DELETE_RESOURCE_POLICY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteResourcePolicyOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeleteResourcePolicyResponse", - ) - ], -) - -DELETE_RESOURCE_POLICY = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteResourcePolicy"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 204, - "method": "DELETE", - "uri": "/resourcepolicy/{resourceArn}", - } - ), - ) - ], -) +HTTP_HEADER_KEY: StaticSchema = (3, n0, _HHK, 0) -EVALUATOR_DESCRIPTION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#EvaluatorDescription"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) +HTTP_HEADER_VALUE: StaticSchema = (3, n0, _HHV, 0) -LAMBDA_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#LambdaArn"), - shape_type=ShapeType.STRING, +HTTP_HEADERS_MAP: StaticSchema = ( + 17, + n0, + _HHM, + 4, + (_k, _v), + ((HTTP_HEADER_KEY, 0), (HTTP_HEADER_VALUE, 0)), ) -LAMBDA_EVALUATOR_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#LambdaEvaluatorConfig"), - members={ - "lambdaArn": { - "target": LAMBDA_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lambdaTimeoutInSeconds": {"target": INTEGER}, - }, -) +HARNESS_REMOTE_MCP_URL: StaticSchema = (3, n0, _HRMU, 4) -CODE_BASED_EVALUATOR_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CodeBasedEvaluatorConfig"), - shape_type=ShapeType.UNION, - members={"lambdaConfig": {"target": LAMBDA_EVALUATOR_CONFIG}}, +HARNESS_REMOTE_MCP_CONFIG: StaticSchema = ( + 18, + n0, + _HRMC, + 0, + (_ur, _h), + ((HARNESS_REMOTE_MCP_URL, 1), (HTTP_HEADERS_MAP, 0)), ) -EVALUATOR_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#EvaluatorId"), - shape_type=ShapeType.STRING, +HARNESS_TOOL_CONFIGURATION: StaticSchema = ( + 19, + n0, + _HTCa, + 0, + (_rM, _aCB, _aCG, _iF, _aCCI), + ( + (HARNESS_REMOTE_MCP_CONFIG, 0), + (HARNESS_AGENT_CORE_BROWSER_CONFIG, 0), + (HARNESS_AGENT_CORE_GATEWAY_CONFIG, 0), + (HARNESS_INLINE_FUNCTION_CONFIG, 0), + (HARNESS_AGENT_CORE_CODE_INTERPRETER_CONFIG, 0), + ), ) -NON_EMPTY_STRING = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#NonEmptyString"), - shape_type=ShapeType.STRING, +HARNESS_TOOL_NAME: StaticSchema = (3, n0, _HTN, 0) + +HARNESS_TOOL_TYPE: StaticSchema = ( + 14, + n0, + _HTT, + 0, + (_RM, _AB, _AG, _IF, _ACI), + ( + (-1, {_sVm: _rm}), + (-1, {_sVm: _ab}), + (-1, {_sVm: _ag_}), + (-1, {_sVm: _if}), + (-1, {_sVm: _aci}), + ), ) -NON_EMPTY_STRING_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#NonEmptyStringList"), - shape_type=ShapeType.LIST, - members={"member": {"target": NON_EMPTY_STRING}}, +HARNESS_TOOL: StaticSchema = ( + 18, + n0, + _HT, + 0, + (_ty, _n, _confi), + ((HARNESS_TOOL_TYPE, 1), (HARNESS_TOOL_NAME, 0), (HARNESS_TOOL_CONFIGURATION, 0)), +) + +HARNESS_TOOLS: StaticSchema = (16, n0, _HTa, 0, (_mem,), ((HARNESS_TOOL, 0),)) + +HARNESS_SLIDING_WINDOW_CONFIGURATION: StaticSchema = ( + 18, + n0, + _HSWC, + 0, + (_mCe,), + ((7, 0),), +) + +HARNESS_SUMMARIZATION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _HSC, + 0, + (_sRu, _pRM, _sSP), + ((9, 0), (7, 0), (3, 0)), +) + +HARNESS_TRUNCATION_STRATEGY_CONFIGURATION: StaticSchema = ( + 19, + n0, + _HTSC, + 0, + (_sW, _sum), + ( + (HARNESS_SLIDING_WINDOW_CONFIGURATION, 0), + (HARNESS_SUMMARIZATION_CONFIGURATION, 0), + ), ) -INFERENCE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#InferenceConfiguration"), - members={ - "maxTokens": {"target": INTEGER}, - "temperature": {"target": FLOAT}, - "topP": {"target": FLOAT}, - "stopSequences": {"target": NON_EMPTY_STRING_LIST}, - }, +HARNESS_TRUNCATION_STRATEGY: StaticSchema = ( + 14, + n0, + _HTS, + 0, + (_SW, _SUMMARIZATION, _NONE), + ((-1, {_sVm: _sw}), (-1, {_sVm: _sum}), (-1, {_sVm: _no})), +) + +HARNESS_TRUNCATION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _HTCar, + 0, + (_strat, _confi), + ((HARNESS_TRUNCATION_STRATEGY, 1), (HARNESS_TRUNCATION_STRATEGY_CONFIGURATION, 0)), +) + +CREATE_HARNESS_INPUT: StaticSchema = ( + 18, + n0, + _CHI, + {_sSI: _cCHR, _smit: None}, + ( + _hN, + _cT, + _eRA, + _env, + _eAn, + _eV, + _aCu, + _mode, + _sPy, + _too, + _sk, + _aTl, + _memo, + _tr, + _ho, + _mIa, + _mT, + _tSi, + _t, + ), + ( + (HARNESS_NAME, 1), + (CLIENT_TOKEN, 2), + (ROLE_ARN, 1), + (HARNESS_ENVIRONMENT_PROVIDER_REQUEST, 0), + (HARNESS_ENVIRONMENT_ARTIFACT, 0), + (ENVIRONMENT_VARIABLES_MAP, 0), + (AUTHORIZER_CONFIGURATION, 0), + (HARNESS_MODEL_CONFIGURATION, 0), + (HARNESS_SYSTEM_PROMPT, 0), + (HARNESS_TOOLS, 0), + (HARNESS_SKILLS, 0), + (HARNESS_ALLOWED_TOOLS, 0), + (HARNESS_MEMORY_CONFIGURATION, 0), + (HARNESS_TRUNCATION_CONFIGURATION, 0), + (HARNESS_HOOKS, 0), + (7, 0), + (7, 0), + (7, 0), + (TAGS_MAP, 0), + ), ) -MODEL_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ModelId"), - shape_type=ShapeType.STRING, +HARNESS_ARN: StaticSchema = (3, n0, _HA, 0) + +HARNESS_AGENT_CORE_RUNTIME_ENVIRONMENT: StaticSchema = ( + 18, + n0, + _HACRE, + 0, + (_aRA, _aRN, _aRI, _lC, _nC, _fC), + ( + (BEDROCK_AGENTCORE_RESOURCE_ARN, 1), + (3, 1), + (3, 1), + (LIFECYCLE_CONFIGURATION, 1), + (NETWORK_CONFIGURATION, 1), + (FILESYSTEM_CONFIGURATIONS, 0), + ), ) -BEDROCK_EVALUATOR_MODEL_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#BedrockEvaluatorModelConfig"), - members={ - "modelId": { - "target": MODEL_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "inferenceConfig": {"target": INFERENCE_CONFIGURATION}, - "additionalModelRequestFields": {"target": ADDITIONAL_MODEL_REQUEST_FIELDS}, - }, +HARNESS_ENVIRONMENT_PROVIDER: StaticSchema = ( + 19, + n0, + _HEP, + 0, + (_aCRE,), + ((HARNESS_AGENT_CORE_RUNTIME_ENVIRONMENT, 0),), +) + +HARNESS_STATUS: StaticSchema = ( + 14, + n0, + _HSar, + 0, + (_CREATING, _CF, _UPDATING, _UF, _READY, _DELETING, _DF), + ( + (-1, {_sVm: _CREATING}), + (-1, {_sVm: _CF}), + (-1, {_sVm: _UPDATING}), + (-1, {_sVm: _UF}), + (-1, {_sVm: _READY}), + (-1, {_sVm: _DELETING}), + (-1, {_sVm: _DF}), + ), ) -REASONING_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ReasoningConfiguration"), - members={"effort": {"target": _STRING}}, +HARNESS: StaticSchema = ( + 18, + n0, + _H, + 0, + ( + _hI, + _hN, + _a, + _st, + _hV, + _eRA, + _cA, + _uA, + _mode, + _sPy, + _too, + _sk, + _aTl, + _tr, + _env, + _eAn, + _eV, + _aCu, + _memo, + _ho, + _mIa, + _mT, + _tSi, + _fR, + ), + ( + (HARNESS_ID, 1), + (HARNESS_NAME, 1), + (HARNESS_ARN, 1), + (HARNESS_STATUS, 1), + (HARNESS_VERSION, 0), + (ROLE_ARN, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (HARNESS_MODEL_CONFIGURATION, 1), + (HARNESS_SYSTEM_PROMPT, 1), + (HARNESS_TOOLS, 1), + (HARNESS_SKILLS, 1), + (HARNESS_ALLOWED_TOOLS, 1), + (HARNESS_TRUNCATION_CONFIGURATION, 1), + (HARNESS_ENVIRONMENT_PROVIDER, 1), + (HARNESS_ENVIRONMENT_ARTIFACT, 0), + (ENVIRONMENT_VARIABLES_MAP, 0), + (AUTHORIZER_CONFIGURATION, 0), + (HARNESS_MEMORY_CONFIGURATION, 0), + (HARNESS_HOOKS, 0), + (7, 0), + (7, 0), + (7, 0), + (3, 0), + ), ) -OPEN_RESPONSES_EVALUATOR_MODEL_CONFIG = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#OpenResponsesEvaluatorModelConfig" +CREATE_HARNESS_OUTPUT: StaticSchema = ( + 18, + n0, + _CHO, + {_sSI: _cCHRo, _smith: None}, + (_ha,), + ((HARNESS, 1),), +) + +CREATE_HARNESS: StaticOperationSchema = ( + 23, + n0, + _CH, + {_smithy: MappingProxyType({"code": 201, "method": "POST", "uri": "/harnesses"})}, + CREATE_HARNESS_INPUT, + CREATE_HARNESS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, ), - members={ - "modelId": { - "target": MODEL_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "maxOutputTokens": {"target": INTEGER}, - "temperature": {"target": FLOAT}, - "topP": {"target": FLOAT}, - "reasoning": {"target": REASONING_CONFIGURATION}, - }, ) -EVALUATOR_MODEL_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#EvaluatorModelConfig"), - shape_type=ShapeType.UNION, - members={ - "bedrockEvaluatorModelConfig": {"target": BEDROCK_EVALUATOR_MODEL_CONFIG}, - "responsesEvaluatorModelConfig": { - "target": OPEN_RESPONSES_EVALUATOR_MODEL_CONFIG - }, - }, +DELETE_HARNESS_INPUT: StaticSchema = ( + 18, + n0, + _DHI, + {_sSI: _cDHR, _smit: None}, + (_hI, _cT, _dMM), + ((HARNESS_ID, 9), (CLIENT_TOKEN, {_sQ: _cT, _sT: None}), (2, {_sQ: _dMM})), +) + +DELETE_HARNESS_OUTPUT: StaticSchema = ( + 18, + n0, + _DHO, + {_sSI: _cDHRo, _smith: None}, + (_ha,), + ((HARNESS, 0),), +) + +DELETE_HARNESS: StaticOperationSchema = ( + 23, + n0, + _DH, + { + _smithy: MappingProxyType( + {"code": 200, "method": "DELETE", "uri": "/harnesses/{harnessId}"} + ) + }, + DELETE_HARNESS_INPUT, + DELETE_HARNESS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -DERIVED_EVALUATOR_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DerivedEvaluatorConfig"), - members={ - "baseEvaluatorId": { - "target": EVALUATOR_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelConfig": { - "target": EVALUATOR_MODEL_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +GET_HARNESS_INPUT: StaticSchema = ( + 18, + n0, + _GHI, + {_sSI: _cGHR, _smit: None}, + (_hI, _hV), + ((HARNESS_ID, 9), (HARNESS_VERSION, {_sQ: _hV})), +) + +GET_HARNESS_OUTPUT: StaticSchema = ( + 18, + n0, + _GHO, + {_sSI: _cGHRo, _smith: None}, + (_ha,), + ((HARNESS, 1),), +) + +GET_HARNESS: StaticOperationSchema = ( + 23, + n0, + _GH, + { + _smithy: MappingProxyType( + {"code": 200, "method": "GET", "uri": "/harnesses/{harnessId}"} + ) + }, + GET_HARNESS_INPUT, + GET_HARNESS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -EVALUATOR_INSTRUCTIONS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#EvaluatorInstructions"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +LIST_HARNESSES_INPUT: StaticSchema = ( + 18, + n0, + _LHI, + {_sSI: _cLHR, _smit: None}, + (_mR, _nT), + ((MAX_RESULTS, {_sQ: _mR}), (NEXT_TOKEN, {_sQ: _nT})), +) + +HARNESS_SUMMARY: StaticSchema = ( + 18, + n0, + _HSarn, + 0, + (_hI, _hN, _a, _st, _cA, _uA, _hV), + ( + (HARNESS_ID, 1), + (HARNESS_NAME, 1), + (HARNESS_ARN, 1), + (HARNESS_STATUS, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (HARNESS_VERSION, 0), + ), ) -CATEGORICAL_SCALE_DEFINITION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CategoricalScaleDefinition"), - members={ - "definition": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "label": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +HARNESS_SUMMARIES: StaticSchema = (16, n0, _HSarne, 0, (_mem,), ((HARNESS_SUMMARY, 0),)) + +LIST_HARNESSES_OUTPUT: StaticSchema = ( + 18, + n0, + _LHO, + {_sSI: _cLHRo, _smith: None}, + (_har, _nT), + ((HARNESS_SUMMARIES, 1), (NEXT_TOKEN, 0)), +) + +LIST_HARNESSES: StaticOperationSchema = ( + 23, + n0, + _LH, + {_smithy: MappingProxyType({"code": 200, "method": "GET", "uri": "/harnesses"})}, + LIST_HARNESSES_INPUT, + LIST_HARNESSES_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CATEGORICAL_SCALE_DEFINITIONS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CategoricalScaleDefinitions"), - shape_type=ShapeType.LIST, - members={"member": {"target": CATEGORICAL_SCALE_DEFINITION}}, -) - -NUMERICAL_SCALE_DEFINITION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#NumericalScaleDefinition"), - members={ - "definition": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "value": { - "target": DOUBLE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "label": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +LIST_HARNESS_VERSIONS_INPUT: StaticSchema = ( + 18, + n0, + _LHVI, + {_sSI: _cLHVR, _smit: None}, + (_hI, _mR, _nT), + ((HARNESS_ID, 9), (MAX_RESULTS, {_sQ: _mR}), (NEXT_TOKEN, {_sQ: _nT})), +) + +HARNESS_VERSION_SUMMARY: StaticSchema = ( + 18, + n0, + _HVS, + 0, + (_hI, _hN, _a, _hV, _st, _cA, _uA, _fR), + ( + (HARNESS_ID, 1), + (HARNESS_NAME, 1), + (HARNESS_ARN, 1), + (HARNESS_VERSION, 1), + (HARNESS_STATUS, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (3, 0), + ), ) -NUMERICAL_SCALE_DEFINITIONS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#NumericalScaleDefinitions"), - shape_type=ShapeType.LIST, - members={"member": {"target": NUMERICAL_SCALE_DEFINITION}}, +HARNESS_VERSION_SUMMARIES: StaticSchema = ( + 16, + n0, + _HVSa, + 0, + (_mem,), + ((HARNESS_VERSION_SUMMARY, 0),), +) + +LIST_HARNESS_VERSIONS_OUTPUT: StaticSchema = ( + 18, + n0, + _LHVO, + {_sSI: _cLHVRo, _smith: None}, + (_hVa, _nT), + ((HARNESS_VERSION_SUMMARIES, 1), (NEXT_TOKEN, 0)), +) + +LIST_HARNESS_VERSIONS: StaticOperationSchema = ( + 23, + n0, + _LHV, + { + _smithy: MappingProxyType( + {"code": 200, "method": "GET", "uri": "/harnesses/{harnessId}/versions"} + ) + }, + LIST_HARNESS_VERSIONS_INPUT, + LIST_HARNESS_VERSIONS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -RATING_SCALE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#RatingScale"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "numerical": {"target": NUMERICAL_SCALE_DEFINITIONS}, - "categorical": {"target": CATEGORICAL_SCALE_DEFINITIONS}, - }, +UPDATED_AUTHORIZER_CONFIGURATION: StaticSchema = ( + 18, + n0, + _UAC, + 0, + (_oV,), + ((AUTHORIZER_CONFIGURATION, 0),), +) + +UPDATED_HARNESS_ENVIRONMENT_ARTIFACT: StaticSchema = ( + 18, + n0, + _UHEA, + 0, + (_oV,), + ((HARNESS_ENVIRONMENT_ARTIFACT, 0),), +) + +UPDATED_HARNESS_MEMORY_CONFIGURATION: StaticSchema = ( + 18, + n0, + _UHMC, + 0, + (_oV,), + ((HARNESS_MEMORY_CONFIGURATION, 0),), +) + +UPDATE_HARNESS_INPUT: StaticSchema = ( + 18, + n0, + _UHI, + {_sSI: _cUHR, _smit: None}, + ( + _hI, + _cT, + _eRA, + _env, + _eAn, + _eV, + _aCu, + _mode, + _sPy, + _too, + _sk, + _aTl, + _memo, + _tr, + _ho, + _mIa, + _mT, + _tSi, + ), + ( + (HARNESS_ID, 9), + (CLIENT_TOKEN, 2), + (ROLE_ARN, 0), + (HARNESS_ENVIRONMENT_PROVIDER_REQUEST, 0), + (UPDATED_HARNESS_ENVIRONMENT_ARTIFACT, 0), + (ENVIRONMENT_VARIABLES_MAP, 0), + (UPDATED_AUTHORIZER_CONFIGURATION, 0), + (HARNESS_MODEL_CONFIGURATION, 0), + (HARNESS_SYSTEM_PROMPT, 0), + (HARNESS_TOOLS, 0), + (HARNESS_SKILLS, 0), + (HARNESS_ALLOWED_TOOLS, 0), + (UPDATED_HARNESS_MEMORY_CONFIGURATION, 0), + (HARNESS_TRUNCATION_CONFIGURATION, 0), + (HARNESS_HOOKS, 0), + (7, 0), + (7, 0), + (7, 0), + ), ) -LLM_AS_A_JUDGE_EVALUATOR_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#LlmAsAJudgeEvaluatorConfig"), - members={ - "instructions": { - "target": EVALUATOR_INSTRUCTIONS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ratingScale": { - "target": RATING_SCALE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelConfig": { - "target": EVALUATOR_MODEL_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +UPDATE_HARNESS_OUTPUT: StaticSchema = ( + 18, + n0, + _UHO, + {_sSI: _cUHRo, _smith: None}, + (_ha,), + ((HARNESS, 1),), +) + +UPDATE_HARNESS: StaticOperationSchema = ( + 23, + n0, + _UH, + { + _smithy: MappingProxyType( + {"code": 200, "method": "PATCH", "uri": "/harnesses/{harnessId}"} + ) + }, + UPDATE_HARNESS_INPUT, + UPDATE_HARNESS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -EVALUATOR_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#EvaluatorConfig"), - shape_type=ShapeType.UNION, - members={ - "llmAsAJudge": {"target": LLM_AS_A_JUDGE_EVALUATOR_CONFIG}, - "codeBased": {"target": CODE_BASED_EVALUATOR_CONFIG}, - "derived": {"target": DERIVED_EVALUATOR_CONFIG}, - }, -) +TAGGABLE_RESOURCES_ARN: StaticSchema = (3, n0, _TRA, 0) -CUSTOM_EVALUATOR_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CustomEvaluatorName"), - shape_type=ShapeType.STRING, +LIST_TAGS_FOR_RESOURCE_INPUT: StaticSchema = ( + 18, + n0, + _LTFRI, + {_sSI: _cLTFRR, _smit: None}, + (_rAe,), + ((TAGGABLE_RESOURCES_ARN, 9),), ) -EVALUATOR_LEVEL = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#EvaluatorLevel"), - shape_type=ShapeType.ENUM, - members={ - "TOOL_CALL": {"target": UNIT}, - "TRACE": {"target": UNIT}, - "SESSION": {"target": UNIT}, - }, +LIST_TAGS_FOR_RESOURCE_OUTPUT: StaticSchema = ( + 18, + n0, + _LTFRO, + {_sSI: _cLTFRRo, _smith: None}, + (_t,), + ((TAGS_MAP, 0),), ) -CREATE_EVALUATOR_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateEvaluatorInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreateEvaluatorRequest", +LIST_TAGS_FOR_RESOURCE: StaticOperationSchema = ( + 23, + n0, + _LTFR, + { + _smithy: MappingProxyType( + {"code": 200, "method": "GET", "uri": "/tags/{resourceArn}"} ) - ], - members={ - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "evaluatorName": { - "target": CUSTOM_EVALUATOR_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": EVALUATOR_DESCRIPTION}, - "evaluatorConfig": { - "target": EVALUATOR_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "level": { - "target": EVALUATOR_LEVEL, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "kmsKeyArn": {"target": KMS_KEY_ARN}, - "tags": {"target": TAGS_MAP}, }, + LIST_TAGS_FOR_RESOURCE_INPUT, + LIST_TAGS_FOR_RESOURCE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CUSTOM_EVALUATOR_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CustomEvaluatorArn"), - shape_type=ShapeType.STRING, -) +ARN: StaticSchema = (3, n0, _Ar, 0) -EVALUATOR_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#EvaluatorStatus"), - shape_type=ShapeType.ENUM, - members={ - "ACTIVE": {"target": UNIT}, - "CREATING": {"target": UNIT}, - "CREATE_FAILED": {"target": UNIT}, - "UPDATING": {"target": UNIT}, - "UPDATE_FAILED": {"target": UNIT}, - "DELETING": {"target": UNIT}, - }, -) +METADATA_KEY: StaticSchema = (3, n0, _MK, 0) -CREATE_EVALUATOR_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateEvaluatorOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreateEvaluatorResponse", - ) - ], - members={ - "evaluatorArn": { - "target": CUSTOM_EVALUATOR_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "evaluatorId": { - "target": EVALUATOR_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": EVALUATOR_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +METADATA_VALUE_TYPE: StaticSchema = ( + 14, + n0, + _MVT, + 0, + (_STRING, _STRINGLIST, _NUMBER), + ((-1, {_sVm: _STRING}), (-1, {_sVm: _STRINGLIST}), (-1, {_sVm: _NUMBER})), ) -CREATE_EVALUATOR = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateEvaluator"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/evaluators/create", "code": 202} - ), - ) - ], +INDEXED_KEY: StaticSchema = ( + 18, + n0, + _IK, + 0, + (_k, _ty), + ((METADATA_KEY, 1), (METADATA_VALUE_TYPE, 1)), ) -DELETE_EVALUATOR_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteEvaluatorInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeleteEvaluatorRequest", - ) - ], - members={ - "evaluatorId": { - "target": EVALUATOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) +INDEXED_KEYS_LIST: StaticSchema = (16, n0, _IKL, 0, (_mem,), ((INDEXED_KEY, 0),)) -EVALUATOR_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#EvaluatorArn"), - shape_type=ShapeType.STRING, -) +PROMPT: StaticSchema = (3, n0, _Pro, 4) -DELETE_EVALUATOR_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteEvaluatorOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeleteEvaluatorResponse", - ) - ], - members={ - "evaluatorArn": { - "target": EVALUATOR_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "evaluatorId": { - "target": EVALUATOR_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": EVALUATOR_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +EPISODIC_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT: StaticSchema = ( + 18, + n0, + _EOCCI, + 0, + (_aTP, _mI), + ((PROMPT, 1), (3, 1)), ) -DELETE_EVALUATOR = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteEvaluator"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "DELETE", "uri": "/evaluators/{evaluatorId}", "code": 202} - ), - ) - ], +EPISODIC_OVERRIDE_EXTRACTION_CONFIGURATION_INPUT: StaticSchema = ( + 18, + n0, + _EOECI, + 0, + (_aTP, _mI), + ((PROMPT, 1), (3, 1)), ) -INCLUDED_DATA = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#IncludedData"), - shape_type=ShapeType.ENUM, - members={"ALL_DATA": {"target": UNIT}, "METADATA_ONLY": {"target": UNIT}}, -) +DEFINITION: StaticSchema = (3, n0, _De, 4) -GET_EVALUATOR_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetEvaluatorInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetEvaluatorRequest", - ) - ], - members={ - "evaluatorId": { - "target": EVALUATOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "includedData": { - "target": INCLUDED_DATA, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="includedData") - ], - }, - }, -) +LLM_EXTRACTION_INSTRUCTION: StaticSchema = (3, n0, _LEIl, 4) -EVALUATOR_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#EvaluatorName"), - shape_type=ShapeType.STRING, -) +NUMBER_VALIDATION: StaticSchema = (18, n0, _NV, 0, (_mV, _mVa), ((10, 0), (10, 0))) -EVALUATOR_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#EvaluatorType"), - shape_type=ShapeType.ENUM, - members={ - "BUILTIN": {"target": UNIT}, - "THIRD_PARTY": {"target": UNIT}, - "CUSTOM": {"target": UNIT}, - "CODE": {"target": UNIT}, - "CUSTOM_DERIVED": {"target": UNIT}, - }, +STRING_LIST_VALIDATION: StaticSchema = ( + 18, + n0, + _SLV, + 0, + (_aV, _mIax), + ((ALLOWED_STRING_LIST_VALUES_LIST, 0), (7, 0)), ) -PROVIDER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#Provider"), - shape_type=ShapeType.ENUM, - members={ - "AWS": {"target": UNIT}, - "DEEP_EVAL": {"target": UNIT}, - "AUTO_EVAL": {"target": UNIT}, - "CUSTOM": {"target": UNIT}, - }, +STRING_VALIDATION: StaticSchema = ( + 18, + n0, + _SVt, + 0, + (_aV,), + ((ALLOWED_STRING_VALUES_LIST, 1),), ) -GET_EVALUATOR_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetEvaluatorOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetEvaluatorResponse", - ) - ], - members={ - "evaluatorArn": { - "target": EVALUATOR_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "evaluatorId": { - "target": EVALUATOR_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "evaluatorName": { - "target": EVALUATOR_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": EVALUATOR_DESCRIPTION}, - "evaluatorConfig": { - "target": EVALUATOR_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "evaluatorType": {"target": EVALUATOR_TYPE}, - "provider": {"target": PROVIDER}, - "level": { - "target": EVALUATOR_LEVEL, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": EVALUATOR_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lockedForModification": {"target": BOOLEAN}, - "kmsKeyArn": {"target": KMS_KEY_ARN}, - }, +VALIDATION: StaticSchema = ( + 19, + n0, + _V, + 0, + (_sVt, _sLV, _nV), + ((STRING_VALIDATION, 0), (STRING_LIST_VALIDATION, 0), (NUMBER_VALIDATION, 0)), ) -GET_EVALUATOR = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetEvaluator"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/evaluators/{evaluatorId}"} - ), - ) - ], +LLM_EXTRACTION_CONFIG: StaticSchema = ( + 18, + n0, + _LECl, + 0, + (_lEI, _de, _va), + ((LLM_EXTRACTION_INSTRUCTION, 0), (DEFINITION, 1), (VALIDATION, 0)), ) -LIST_EVALUATORS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListEvaluatorsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListEvaluatorsRequest", - ) - ], - members={ - "nextToken": { - "target": _STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "maxResults": { - "target": INTEGER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - }, +EXTRACTION_CONFIG: StaticSchema = ( + 19, + n0, + _ECx, + 0, + (_lEC,), + ((LLM_EXTRACTION_CONFIG, 0),), ) -EVALUATOR_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#EvaluatorSummary"), - members={ - "evaluatorArn": { - "target": EVALUATOR_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "evaluatorId": { - "target": EVALUATOR_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "evaluatorName": { - "target": EVALUATOR_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": EVALUATOR_DESCRIPTION}, - "evaluatorType": { - "target": EVALUATOR_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "provider": {"target": PROVIDER}, - "level": {"target": EVALUATOR_LEVEL}, - "status": { - "target": EVALUATOR_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lockedForModification": {"target": BOOLEAN}, - "kmsKeyArn": {"target": KMS_KEY_ARN}, - }, +EXTRACTION_TYPE: StaticSchema = ( + 14, + n0, + _ETx, + 0, + (_LI, _SC_), + ((-1, {_sVm: _LI}), (-1, {_sVm: _SC_})), +) + +METADATA_SCHEMA_ENTRY: StaticSchema = ( + 18, + n0, + _MSE, + 0, + (_k, _ty, _eTx, _eCxt), + ( + (METADATA_KEY, 1), + (METADATA_VALUE_TYPE, 0), + (EXTRACTION_TYPE, 0), + (EXTRACTION_CONFIG, 0), + ), ) -EVALUATOR_SUMMARY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#EvaluatorSummaryList"), - shape_type=ShapeType.LIST, - members={"member": {"target": EVALUATOR_SUMMARY}}, +METADATA_SCHEMA_LIST: StaticSchema = ( + 16, + n0, + _MSL, + 0, + (_mem,), + ((METADATA_SCHEMA_ENTRY, 0),), +) + +MEMORY_RECORD_SCHEMA: StaticSchema = ( + 18, + n0, + _MRS, + 0, + (_mS,), + ((METADATA_SCHEMA_LIST, 0),), +) + +NAMESPACE: StaticSchema = (3, n0, _Na, 0) + +NAMESPACES_LIST: StaticSchema = (16, n0, _NL, 0, (_mem,), ((NAMESPACE, 0),)) + +EPISODIC_OVERRIDE_REFLECTION_CONFIGURATION_INPUT: StaticSchema = ( + 18, + n0, + _EORCI, + 0, + (_aTP, _mI, _na, _nTa, _mRS), + ( + (PROMPT, 1), + (3, 1), + (NAMESPACES_LIST, 0), + (NAMESPACES_LIST, 0), + (MEMORY_RECORD_SCHEMA, 0), + ), ) -LIST_EVALUATORS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListEvaluatorsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListEvaluatorsResponse", - ) - ], - members={ - "evaluators": { - "target": EVALUATOR_SUMMARY_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": _STRING}, - }, +EPISODIC_OVERRIDE_CONFIGURATION_INPUT: StaticSchema = ( + 18, + n0, + _EOCI, + 0, + (_ext, _cons, _ref), + ( + (EPISODIC_OVERRIDE_EXTRACTION_CONFIGURATION_INPUT, 0), + (EPISODIC_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT, 0), + (EPISODIC_OVERRIDE_REFLECTION_CONFIGURATION_INPUT, 0), + ), ) -LIST_EVALUATORS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListEvaluators"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType({"method": "POST", "uri": "/evaluators"}), - ) - ], +INVOCATION_CONFIGURATION_INPUT: StaticSchema = ( + 18, + n0, + _ICIn, + 0, + (_tA, _pDBN), + ((ARN, 1), (3, 1)), +) + +MESSAGE_BASED_TRIGGER_INPUT: StaticSchema = ( + 18, + n0, + _MBTI, + 0, + (_mCes,), + ((7, {_smithya: 6}),), +) + +TIME_BASED_TRIGGER_INPUT: StaticSchema = ( + 18, + n0, + _TBTI, + 0, + (_iST,), + ((7, {_smithya: 20}),), +) + +TOKEN_BASED_TRIGGER_INPUT: StaticSchema = ( + 18, + n0, + _TBTIo, + 0, + (_tC,), + ((7, {_smithya: 5000}),), +) + +TRIGGER_CONDITION_INPUT: StaticSchema = ( + 19, + n0, + _TCI, + 0, + (_mBT, _tBT, _tBTi), + ( + (MESSAGE_BASED_TRIGGER_INPUT, 0), + (TOKEN_BASED_TRIGGER_INPUT, 0), + (TIME_BASED_TRIGGER_INPUT, 0), + ), ) -UPDATE_EVALUATOR_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateEvaluatorInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UpdateEvaluatorRequest", - ) - ], - members={ - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "evaluatorId": { - "target": EVALUATOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "description": {"target": EVALUATOR_DESCRIPTION}, - "evaluatorConfig": {"target": EVALUATOR_CONFIG}, - "level": {"target": EVALUATOR_LEVEL}, - "kmsKeyArn": {"target": KMS_KEY_ARN}, - }, +TRIGGER_CONDITION_INPUT_LIST: StaticSchema = ( + 16, + n0, + _TCIL, + 0, + (_mem,), + ((TRIGGER_CONDITION_INPUT, 0),), +) + +SELF_MANAGED_CONFIGURATION_INPUT: StaticSchema = ( + 18, + n0, + _SMCI, + 0, + (_tCr, _iCnv, _hCWS), + ( + (TRIGGER_CONDITION_INPUT_LIST, 0), + (INVOCATION_CONFIGURATION_INPUT, 1), + (7, {_smithya: 4}), + ), ) -UPDATE_EVALUATOR_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateEvaluatorOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UpdateEvaluatorResponse", - ) - ], - members={ - "evaluatorArn": { - "target": EVALUATOR_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "evaluatorId": { - "target": EVALUATOR_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": EVALUATOR_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +SEMANTIC_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT: StaticSchema = ( + 18, + n0, + _SOCCI, + 0, + (_aTP, _mI), + ((PROMPT, 1), (3, 1)), +) + +SEMANTIC_OVERRIDE_EXTRACTION_CONFIGURATION_INPUT: StaticSchema = ( + 18, + n0, + _SOECI, + 0, + (_aTP, _mI), + ((PROMPT, 1), (3, 1)), +) + +SEMANTIC_OVERRIDE_CONFIGURATION_INPUT: StaticSchema = ( + 18, + n0, + _SOCI, + 0, + (_ext, _cons), + ( + (SEMANTIC_OVERRIDE_EXTRACTION_CONFIGURATION_INPUT, 0), + (SEMANTIC_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT, 0), + ), ) -UPDATE_EVALUATOR = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateEvaluator"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "PUT", "uri": "/evaluators/{evaluatorId}", "code": 202} - ), - ) - ], +SUMMARY_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT: StaticSchema = ( + 18, + n0, + _SOCCIu, + 0, + (_aTP, _mI), + ((PROMPT, 1), (3, 1)), +) + +SUMMARY_OVERRIDE_CONFIGURATION_INPUT: StaticSchema = ( + 18, + n0, + _SOCIu, + 0, + (_cons,), + ((SUMMARY_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT, 0),), +) + +USER_PREFERENCE_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT: StaticSchema = ( + 18, + n0, + _UPOCCI, + 0, + (_aTP, _mI), + ((PROMPT, 1), (3, 1)), +) + +USER_PREFERENCE_OVERRIDE_EXTRACTION_CONFIGURATION_INPUT: StaticSchema = ( + 18, + n0, + _UPOECI, + 0, + (_aTP, _mI), + ((PROMPT, 1), (3, 1)), +) + +USER_PREFERENCE_OVERRIDE_CONFIGURATION_INPUT: StaticSchema = ( + 18, + n0, + _UPOCI, + 0, + (_ext, _cons), + ( + (USER_PREFERENCE_OVERRIDE_EXTRACTION_CONFIGURATION_INPUT, 0), + (USER_PREFERENCE_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT, 0), + ), ) -GATEWAY_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GatewayIdentifier"), - shape_type=ShapeType.STRING, +CUSTOM_CONFIGURATION_INPUT: StaticSchema = ( + 19, + n0, + _CCIu, + 0, + (_sOe, _sOu, _uPO, _eO, _sMC), + ( + (SEMANTIC_OVERRIDE_CONFIGURATION_INPUT, 0), + (SUMMARY_OVERRIDE_CONFIGURATION_INPUT, 0), + (USER_PREFERENCE_OVERRIDE_CONFIGURATION_INPUT, 0), + (EPISODIC_OVERRIDE_CONFIGURATION_INPUT, 0), + (SELF_MANAGED_CONFIGURATION_INPUT, 0), + ), ) -GATEWAY_RATE_LIMIT_DESCRIPTION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GatewayRateLimitDescription"), - shape_type=ShapeType.STRING, +NAME: StaticSchema = (3, n0, _Nam, 0) + +CUSTOM_MEMORY_STRATEGY_INPUT: StaticSchema = ( + 18, + n0, + _CMSI, + 0, + (_n, _d, _na, _nTa, _con, _mRS), + ( + (NAME, 1), + (DESCRIPTION, 0), + (NAMESPACES_LIST, 0), + (NAMESPACES_LIST, 0), + (CUSTOM_CONFIGURATION_INPUT, 0), + (MEMORY_RECORD_SCHEMA, 0), + ), ) -DIMENSION_KEY = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DimensionKey"), - shape_type=ShapeType.STRING, +EPISODIC_REFLECTION_CONFIGURATION_INPUT: StaticSchema = ( + 18, + n0, + _ERCI, + 0, + (_na, _nTa, _mRS), + ((NAMESPACES_LIST, 0), (NAMESPACES_LIST, 0), (MEMORY_RECORD_SCHEMA, 0)), +) + +EPISODIC_MEMORY_STRATEGY_INPUT: StaticSchema = ( + 18, + n0, + _EMSI, + 0, + (_n, _d, _na, _nTa, _rCe, _mRS), + ( + (NAME, 1), + (DESCRIPTION, 0), + (NAMESPACES_LIST, 0), + (NAMESPACES_LIST, 0), + (EPISODIC_REFLECTION_CONFIGURATION_INPUT, 0), + (MEMORY_RECORD_SCHEMA, 0), + ), ) -DIMENSION_KEYS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DimensionKeys"), - shape_type=ShapeType.LIST, - members={"member": {"target": DIMENSION_KEY}}, +SEMANTIC_MEMORY_STRATEGY_INPUT: StaticSchema = ( + 18, + n0, + _SMSI, + 0, + (_n, _d, _na, _nTa, _mRS), + ( + (NAME, 1), + (DESCRIPTION, 0), + (NAMESPACES_LIST, 0), + (NAMESPACES_LIST, 0), + (MEMORY_RECORD_SCHEMA, 0), + ), ) -PERIOD = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#Period"), - shape_type=ShapeType.ENUM, - members={"SECOND": {"target": UNIT}, "MINUTE": {"target": UNIT}}, +SUMMARY_MEMORY_STRATEGY_INPUT: StaticSchema = ( + 18, + n0, + _SMSIu, + 0, + (_n, _d, _na, _nTa, _mRS), + ( + (NAME, 1), + (DESCRIPTION, 0), + (NAMESPACES_LIST, 0), + (NAMESPACES_LIST, 0), + (MEMORY_RECORD_SCHEMA, 0), + ), ) -RATE_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#RateConfig"), - members={ - "rate": { - "target": DOUBLE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "period": { - "target": PERIOD, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +USER_PREFERENCE_MEMORY_STRATEGY_INPUT: StaticSchema = ( + 18, + n0, + _UPMSI, + 0, + (_n, _d, _na, _nTa, _mRS), + ( + (NAME, 1), + (DESCRIPTION, 0), + (NAMESPACES_LIST, 0), + (NAMESPACES_LIST, 0), + (MEMORY_RECORD_SCHEMA, 0), + ), ) -RATE_CONFIGS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#RateConfigs"), - shape_type=ShapeType.LIST, - members={"member": {"target": RATE_CONFIG}}, +MEMORY_STRATEGY_INPUT: StaticSchema = ( + 19, + n0, + _MSI, + 0, + (_sMS, _sMSu, _uPMS, _cMS, _eMS), + ( + (SEMANTIC_MEMORY_STRATEGY_INPUT, 0), + (SUMMARY_MEMORY_STRATEGY_INPUT, 0), + (USER_PREFERENCE_MEMORY_STRATEGY_INPUT, 0), + (CUSTOM_MEMORY_STRATEGY_INPUT, 0), + (EPISODIC_MEMORY_STRATEGY_INPUT, 0), + ), ) -DIMENSION_VALUE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DimensionValue"), - shape_type=ShapeType.STRING, +MEMORY_STRATEGY_INPUT_LIST: StaticSchema = ( + 16, + n0, + _MSIL, + 0, + (_mem,), + ((MEMORY_STRATEGY_INPUT, 0),), ) -DIMENSIONS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#Dimensions"), - shape_type=ShapeType.MAP, - members={"key": {"target": DIMENSION_KEY}, "value": {"target": DIMENSION_VALUE}}, -) +NAMESPACE_VARIABLE_KEY: StaticSchema = (3, n0, _NVK, 0) -LIMIT_ENTRY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#LimitEntry"), - members={ - "dimensions": { - "target": DIMENSIONS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "requests": {"target": RATE_CONFIGS}, - "tokens": {"target": RATE_CONFIGS}, - "connections": {"target": RATE_CONFIGS}, - }, -) +NAMESPACE_ALLOWED_VALUE: StaticSchema = (3, n0, _NAV, 0) -LIMIT_ENTRIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#LimitEntries"), - shape_type=ShapeType.LIST, - members={"member": {"target": LIMIT_ENTRY}}, +NAMESPACE_ALLOWED_VALUES_LIST: StaticSchema = ( + 16, + n0, + _NAVL, + 0, + (_mem,), + ((NAMESPACE_ALLOWED_VALUE, 0),), ) - -GATEWAY_RATE_LIMIT_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GatewayRateLimitId"), - shape_type=ShapeType.STRING, + +NAMESPACE_REGEX_PATTERN: StaticSchema = (3, n0, _NRP, 0) + +NAMESPACE_KEY_VALIDATION: StaticSchema = ( + 18, + n0, + _NKV, + 0, + (_aV, _rPe), + ((NAMESPACE_ALLOWED_VALUES_LIST, 0), (NAMESPACE_REGEX_PATTERN, 0)), +) + +NAMESPACE_KEY_ENTRY: StaticSchema = ( + 18, + n0, + _NKE, + 0, + (_k, _va), + ((NAMESPACE_VARIABLE_KEY, 1), (NAMESPACE_KEY_VALIDATION, 0)), +) + +NAMESPACE_KEYS_LIST: StaticSchema = ( + 16, + n0, + _NKL, + 0, + (_mem,), + ((NAMESPACE_KEY_ENTRY, 0),), +) + +CONTENT_LEVEL: StaticSchema = ( + 14, + n0, + _CLo, + 0, + (_MO, _FC__), + ((-1, {_sVm: _MO}), (-1, {_sVm: _FC__})), +) + +CONTENT_TYPE: StaticSchema = (14, n0, _CTo, 0, (_MR_,), ((-1, {_sVm: _MR_}),)) + +CONTENT_CONFIGURATION: StaticSchema = ( + 18, + n0, + _CCont, + 0, + (_ty, _le), + ((CONTENT_TYPE, 1), (CONTENT_LEVEL, {_smithya: _MO})), +) + +CONTENT_CONFIGURATION_LIST: StaticSchema = ( + 16, + n0, + _CCLo, + 0, + (_mem,), + ((CONTENT_CONFIGURATION, 0),), +) + +KINESIS_RESOURCE: StaticSchema = ( + 18, + n0, + _KR, + 0, + (_dSA, _cCon), + ((ARN, 1), (CONTENT_CONFIGURATION_LIST, 1)), +) + +STREAM_DELIVERY_RESOURCE: StaticSchema = ( + 19, + n0, + _SDR, + 0, + (_ki,), + ((KINESIS_RESOURCE, 0),), +) + +STREAM_DELIVERY_RESOURCES_LIST: StaticSchema = ( + 16, + n0, + _SDRL, + 0, + (_mem,), + ((STREAM_DELIVERY_RESOURCE, 0),), +) + +STREAM_DELIVERY_RESOURCES: StaticSchema = ( + 18, + n0, + _SDRt, + 0, + (_reso,), + ((STREAM_DELIVERY_RESOURCES_LIST, 1),), +) + +CREATE_MEMORY_INPUT: StaticSchema = ( + 18, + n0, + _CMI, + {_smit: None}, + (_cT, _n, _d, _eKA, _mERA, _eED, _mSe, _iK, _nK, _sDR, _t), + ( + (NON_EMPTY_STRING, 2), + (NAME, 1), + (DESCRIPTION, 0), + (ARN, 0), + (ARN, 0), + (7, 1), + (MEMORY_STRATEGY_INPUT_LIST, 0), + (INDEXED_KEYS_LIST, 0), + (NAMESPACE_KEYS_LIST, 0), + (STREAM_DELIVERY_RESOURCES, 0), + (TAGS_MAP, 0), + ), ) -BATCH_PUT_LIMIT_ENTRY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#BatchPutLimitEntry"), - members={ - "rateLimitId": {"target": GATEWAY_RATE_LIMIT_ID}, - "description": {"target": GATEWAY_RATE_LIMIT_DESCRIPTION}, - "dimensionKeys": { - "target": DIMENSION_KEYS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "entries": { - "target": LIMIT_ENTRIES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +MEMORY_ID: StaticSchema = (3, n0, _MIe, 0) + +MEMORY_STATUS: StaticSchema = ( + 14, + n0, + _MSe, + 0, + (_CREATING, _ACTIVE, _FAILED, _DELETING, _UPDATING), + ( + (-1, {_sVm: _CREATING}), + (-1, {_sVm: _ACTIVE}), + (-1, {_sVm: _FAILED}), + (-1, {_sVm: _DELETING}), + (-1, {_sVm: _UPDATING}), + ), ) -BATCH_PUT_LIMIT_ENTRIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#BatchPutLimitEntries"), - shape_type=ShapeType.LIST, - members={"member": {"target": BATCH_PUT_LIMIT_ENTRY}}, +EPISODIC_CONSOLIDATION_OVERRIDE: StaticSchema = ( + 18, + n0, + _ECO, + 0, + (_aTP, _mI), + ((PROMPT, 1), (3, 1)), +) + +SEMANTIC_CONSOLIDATION_OVERRIDE: StaticSchema = ( + 18, + n0, + _SCO, + 0, + (_aTP, _mI), + ((PROMPT, 1), (3, 1)), +) + +SUMMARY_CONSOLIDATION_OVERRIDE: StaticSchema = ( + 18, + n0, + _SCOu, + 0, + (_aTP, _mI), + ((PROMPT, 1), (3, 1)), +) + +USER_PREFERENCE_CONSOLIDATION_OVERRIDE: StaticSchema = ( + 18, + n0, + _UPCO, + 0, + (_aTP, _mI), + ((PROMPT, 1), (3, 1)), +) + +CUSTOM_CONSOLIDATION_CONFIGURATION: StaticSchema = ( + 19, + n0, + _CCC, + 0, + (_sCO, _sCOu, _uPCO, _eCO), + ( + (SEMANTIC_CONSOLIDATION_OVERRIDE, 0), + (SUMMARY_CONSOLIDATION_OVERRIDE, 0), + (USER_PREFERENCE_CONSOLIDATION_OVERRIDE, 0), + (EPISODIC_CONSOLIDATION_OVERRIDE, 0), + ), ) -BATCH_PUT_GATEWAY_RATE_LIMITS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#BatchPutGatewayRateLimitsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#BatchPutGatewayRateLimitsRequest", - ) - ], - members={ - "gatewayIdentifier": { - "target": GATEWAY_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "rateLimits": { - "target": BATCH_PUT_LIMIT_ENTRIES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +CONSOLIDATION_CONFIGURATION: StaticSchema = ( + 19, + n0, + _CCons, + 0, + (_cCC,), + ((CUSTOM_CONSOLIDATION_CONFIGURATION, 0),), +) + +EPISODIC_EXTRACTION_OVERRIDE: StaticSchema = ( + 18, + n0, + _EEO, + 0, + (_aTP, _mI), + ((PROMPT, 1), (3, 1)), +) + +SEMANTIC_EXTRACTION_OVERRIDE: StaticSchema = ( + 18, + n0, + _SEO, + 0, + (_aTP, _mI), + ((PROMPT, 1), (3, 1)), +) + +USER_PREFERENCE_EXTRACTION_OVERRIDE: StaticSchema = ( + 18, + n0, + _UPEO, + 0, + (_aTP, _mI), + ((PROMPT, 1), (3, 1)), +) + +CUSTOM_EXTRACTION_CONFIGURATION: StaticSchema = ( + 19, + n0, + _CEC, + 0, + (_sEO, _uPEO, _eEO), + ( + (SEMANTIC_EXTRACTION_OVERRIDE, 0), + (USER_PREFERENCE_EXTRACTION_OVERRIDE, 0), + (EPISODIC_EXTRACTION_OVERRIDE, 0), + ), ) -GATEWAY_RATE_LIMIT_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GatewayRateLimitStatus"), - shape_type=ShapeType.ENUM, - members={ - "CREATING": {"target": UNIT}, - "ACTIVE": {"target": UNIT}, - "UPDATING": {"target": UNIT}, - "DELETING": {"target": UNIT}, - }, +EXTRACTION_CONFIGURATION: StaticSchema = ( + 19, + n0, + _ECxt, + 0, + (_cEC,), + ((CUSTOM_EXTRACTION_CONFIGURATION, 0),), +) + +EPISODIC_REFLECTION_OVERRIDE: StaticSchema = ( + 18, + n0, + _ERO, + 0, + (_aTP, _mI, _na, _nTa, _mRS), + ( + (PROMPT, 1), + (3, 1), + (NAMESPACES_LIST, 0), + (NAMESPACES_LIST, 0), + (MEMORY_RECORD_SCHEMA, 0), + ), ) -GATEWAY_RATE_LIMIT_DETAIL = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GatewayRateLimitDetail"), - members={ - "rateLimitId": { - "target": GATEWAY_RATE_LIMIT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "gatewayIdentifier": { - "target": GATEWAY_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": GATEWAY_RATE_LIMIT_DESCRIPTION}, - "dimensionKeys": { - "target": DIMENSION_KEYS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "entries": { - "target": LIMIT_ENTRIES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": GATEWAY_RATE_LIMIT_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +CUSTOM_REFLECTION_CONFIGURATION: StaticSchema = ( + 19, + n0, + _CRC, + 0, + (_eRO,), + ((EPISODIC_REFLECTION_OVERRIDE, 0),), +) + +EPISODIC_REFLECTION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _ERC, + 0, + (_na, _nTa, _mRS), + ((NAMESPACES_LIST, 0), (NAMESPACES_LIST, 0), (MEMORY_RECORD_SCHEMA, 0)), +) + +REFLECTION_CONFIGURATION: StaticSchema = ( + 19, + n0, + _RCef, + 0, + (_cRC, _eRC), + ((CUSTOM_REFLECTION_CONFIGURATION, 0), (EPISODIC_REFLECTION_CONFIGURATION, 0)), +) + +INVOCATION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _ICnv, + 0, + (_tA, _pDBN), + ((ARN, 1), (3, 1)), +) + +MESSAGE_BASED_TRIGGER: StaticSchema = (18, n0, _MBT, 0, (_mCes,), ((7, 0),)) + +TIME_BASED_TRIGGER: StaticSchema = (18, n0, _TBT, 0, (_iST,), ((7, 0),)) + +TOKEN_BASED_TRIGGER: StaticSchema = (18, n0, _TBTo, 0, (_tC,), ((7, 0),)) + +TRIGGER_CONDITION: StaticSchema = ( + 19, + n0, + _TCr, + 0, + (_mBT, _tBT, _tBTi), + ((MESSAGE_BASED_TRIGGER, 0), (TOKEN_BASED_TRIGGER, 0), (TIME_BASED_TRIGGER, 0)), +) + +TRIGGER_CONDITIONS_LIST: StaticSchema = ( + 16, + n0, + _TCL, + 0, + (_mem,), + ((TRIGGER_CONDITION, 0),), +) + +SELF_MANAGED_CONFIGURATION: StaticSchema = ( + 18, + n0, + _SMC, + 0, + (_tCr, _iCnv, _hCWS), + ((TRIGGER_CONDITIONS_LIST, 1), (INVOCATION_CONFIGURATION, 1), (7, 1)), +) + +OVERRIDE_TYPE: StaticSchema = ( + 14, + n0, + _OT, + 0, + (_SO__, _SO___, _UPO, _SM_, _EO), + ( + (-1, {_sVm: _SO__}), + (-1, {_sVm: _SO___}), + (-1, {_sVm: _UPO}), + (-1, {_sVm: _SM_}), + (-1, {_sVm: _EO}), + ), ) -GATEWAY_RATE_LIMITS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GatewayRateLimits"), - shape_type=ShapeType.LIST, - members={"member": {"target": GATEWAY_RATE_LIMIT_DETAIL}}, +STRATEGY_CONFIGURATION: StaticSchema = ( + 18, + n0, + _SCtr, + 0, + (_ty, _ext, _cons, _ref, _sMC), + ( + (OVERRIDE_TYPE, 0), + (EXTRACTION_CONFIGURATION, 0), + (CONSOLIDATION_CONFIGURATION, 0), + (REFLECTION_CONFIGURATION, 0), + (SELF_MANAGED_CONFIGURATION, 0), + ), ) -BATCH_PUT_GATEWAY_RATE_LIMITS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#BatchPutGatewayRateLimitsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#BatchPutGatewayRateLimitsResponse", - ) - ], - members={ - "rateLimits": { - "target": GATEWAY_RATE_LIMITS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +MEMORY_STRATEGY_STATUS: StaticSchema = ( + 14, + n0, + _MSS, + 0, + (_CREATING, _ACTIVE, _DELETING, _FAILED), + ( + (-1, {_sVm: _CREATING}), + (-1, {_sVm: _ACTIVE}), + (-1, {_sVm: _DELETING}), + (-1, {_sVm: _FAILED}), + ), ) -BATCH_PUT_GATEWAY_RATE_LIMITS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#BatchPutGatewayRateLimits"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "PUT", - "uri": "/gateways/{gatewayIdentifier}/rate-limits/batch", - } - ), - ) - ], +MEMORY_STRATEGY_ID: StaticSchema = (3, n0, _MSIe, 0) + +MEMORY_STRATEGY_TYPE: StaticSchema = ( + 14, + n0, + _MST, + 0, + (_SEMANTIC, _SUMMARIZATION, _UP, _CUSTOM, _EPISODIC), + ( + (-1, {_sVm: _SEMANTIC}), + (-1, {_sVm: _SUMMARIZATION}), + (-1, {_sVm: _UP}), + (-1, {_sVm: _CUSTOM}), + (-1, {_sVm: _EPISODIC}), + ), ) -CREATE_GATEWAY_RATE_LIMIT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateGatewayRateLimitInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreateGatewayRateLimitRequest", - ) - ], - members={ - "gatewayIdentifier": { - "target": GATEWAY_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "rateLimitId": {"target": GATEWAY_RATE_LIMIT_ID}, - "description": {"target": GATEWAY_RATE_LIMIT_DESCRIPTION}, - "dimensionKeys": { - "target": DIMENSION_KEYS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "entries": { - "target": LIMIT_ENTRIES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +MEMORY_STRATEGY: StaticSchema = ( + 18, + n0, + _MSem, + 0, + (_sIt, _n, _d, _con, _ty, _na, _nTa, _cA, _uA, _st, _mRS), + ( + (MEMORY_STRATEGY_ID, 1), + (NAME, 1), + (DESCRIPTION, 0), + (STRATEGY_CONFIGURATION, 0), + (MEMORY_STRATEGY_TYPE, 1), + (NAMESPACES_LIST, 1), + (NAMESPACES_LIST, 1), + (4, 0), + (4, 0), + (MEMORY_STRATEGY_STATUS, 0), + (MEMORY_RECORD_SCHEMA, 0), + ), ) -CREATE_GATEWAY_RATE_LIMIT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateGatewayRateLimitOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreateGatewayRateLimitResponse", - ) - ], - members={ - "rateLimitId": { - "target": GATEWAY_RATE_LIMIT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "gatewayIdentifier": { - "target": GATEWAY_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": GATEWAY_RATE_LIMIT_DESCRIPTION}, - "dimensionKeys": { - "target": DIMENSION_KEYS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "entries": { - "target": LIMIT_ENTRIES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": GATEWAY_RATE_LIMIT_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +MEMORY_STRATEGY_LIST: StaticSchema = ( + 16, + n0, + _MSLe, + 0, + (_mem,), + ((MEMORY_STRATEGY, 0),), +) + +MEMORY: StaticSchema = ( + 18, + n0, + _Me, + 0, + ( + _a, + _i, + _n, + _d, + _eKA, + _mERA, + _eED, + _st, + _fR, + _cA, + _uA, + _stra, + _iK, + _nK, + _sDR, + _mBRA, + ), + ( + (MEMORY_ARN, 1), + (MEMORY_ID, 1), + (NAME, 1), + (DESCRIPTION, 0), + (ARN, 0), + (ARN, 0), + (7, 1), + (MEMORY_STATUS, 1), + (3, 0), + (4, 1), + (4, 1), + (MEMORY_STRATEGY_LIST, 0), + (INDEXED_KEYS_LIST, 0), + (NAMESPACE_KEYS_LIST, 0), + (STREAM_DELIVERY_RESOURCES, 0), + (ARN, 0), + ), ) -CREATE_GATEWAY_RATE_LIMIT = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateGatewayRateLimit"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 201, - "method": "POST", - "uri": "/gateways/{gatewayIdentifier}/rate-limits", - } - ), - ) - ], +CREATE_MEMORY_OUTPUT: StaticSchema = ( + 18, + n0, + _CMO, + {_smith: None}, + (_memo,), + ((MEMORY, 0),), ) -DELETE_GATEWAY_RATE_LIMIT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteGatewayRateLimitInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeleteGatewayRateLimitRequest", - ) - ], - members={ - "gatewayIdentifier": { - "target": GATEWAY_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "rateLimitId": { - "target": GATEWAY_RATE_LIMIT_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) +SERVICE_EXCEPTION: StaticSchema = (18, n0, _SEe, {_s: _se, _sE: 500}, (_m,), ((3, 0),)) -DELETE_GATEWAY_RATE_LIMIT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteGatewayRateLimitOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeleteGatewayRateLimitResponse", +THROTTLED_EXCEPTION: StaticSchema = (18, n0, _TEh, {_s: _c, _sE: 429}, (_m,), ((3, 0),)) + +CREATE_MEMORY: StaticOperationSchema = ( + 23, + n0, + _CM, + { + _smithy: MappingProxyType( + {"code": 202, "method": "POST", "uri": "/memories/create"} ) - ], - members={ - "rateLimitId": { - "target": GATEWAY_RATE_LIMIT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": GATEWAY_RATE_LIMIT_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, }, + CREATE_MEMORY_INPUT, + CREATE_MEMORY_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -DELETE_GATEWAY_RATE_LIMIT = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteGatewayRateLimit"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "DELETE", - "uri": "/gateways/{gatewayIdentifier}/rate-limits/{rateLimitId}", - } - ), - ) - ], +DELETE_MEMORY_INPUT: StaticSchema = ( + 18, + n0, + _DMI, + {_smit: None}, + (_cT, _mIe), + ((NON_EMPTY_STRING, {_sQ: _cT, _sT: None}), (MEMORY_ID, 9)), +) + +DELETE_MEMORY_OUTPUT: StaticSchema = ( + 18, + n0, + _DMO, + {_smith: None}, + (_mIe, _st), + ((MEMORY_ID, 1), (MEMORY_STATUS, 0)), +) + +DELETE_MEMORY: StaticOperationSchema = ( + 23, + n0, + _DM, + { + _smithy: MappingProxyType( + {"code": 202, "method": "DELETE", "uri": "/memories/{memoryId}/delete"} + ) + }, + DELETE_MEMORY_INPUT, + DELETE_MEMORY_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + THROTTLED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -GET_GATEWAY_RATE_LIMIT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetGatewayRateLimitInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetGatewayRateLimitRequest", - ) - ], - members={ - "gatewayIdentifier": { - "target": GATEWAY_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "rateLimitId": { - "target": GATEWAY_RATE_LIMIT_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, +MEMORY_VIEW: StaticSchema = ( + 14, + n0, + _MVe, + 0, + (_FULL, _WD), + ((-1, {_sVm: _fu}), (-1, {_sVm: _wd})), +) + +GET_MEMORY_INPUT: StaticSchema = ( + 18, + n0, + _GMI, + {_smit: None}, + (_mIe, _vie), + ((MEMORY_ID, 9), (MEMORY_VIEW, {_smithya: _fu, _sQ: _vie})), +) + +GET_MEMORY_OUTPUT: StaticSchema = ( + 18, + n0, + _GMO, + {_smith: None}, + (_memo,), + ((MEMORY, 1),), +) + +GET_MEMORY: StaticOperationSchema = ( + 23, + n0, + _GM, + { + _smithy: MappingProxyType( + {"method": "GET", "uri": "/memories/{memoryId}/details"} + ) + }, + GET_MEMORY_INPUT, + GET_MEMORY_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + THROTTLED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -GET_GATEWAY_RATE_LIMIT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetGatewayRateLimitOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetGatewayRateLimitResponse", - ) - ], - members={ - "rateLimitId": { - "target": GATEWAY_RATE_LIMIT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "gatewayIdentifier": { - "target": GATEWAY_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": GATEWAY_RATE_LIMIT_DESCRIPTION}, - "dimensionKeys": { - "target": DIMENSION_KEYS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "entries": { - "target": LIMIT_ENTRIES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": GATEWAY_RATE_LIMIT_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +LIST_MEMORIES_INPUT: StaticSchema = ( + 18, + n0, + _LMI, + {_smit: None}, + (_mR, _nT), + ((7, {_smithya: 100}), (3, 0)), +) + +MEMORY_SUMMARY: StaticSchema = ( + 18, + n0, + _MSemo, + 0, + (_a, _i, _st, _cA, _uA, _mBRA), + ((MEMORY_ARN, 0), (MEMORY_ID, 0), (MEMORY_STATUS, 0), (4, 1), (4, 1), (ARN, 0)), +) + +MEMORY_SUMMARY_LIST: StaticSchema = (16, n0, _MSLem, 0, (_mem,), ((MEMORY_SUMMARY, 0),)) + +LIST_MEMORIES_OUTPUT: StaticSchema = ( + 18, + n0, + _LMO, + {_smith: None}, + (_memor, _nT), + ((MEMORY_SUMMARY_LIST, 1), (3, 0)), +) + +LIST_MEMORIES: StaticOperationSchema = ( + 23, + n0, + _LMi, + {_smithy: MappingProxyType({"method": "POST", "uri": "/memories/"})}, + LIST_MEMORIES_INPUT, + LIST_MEMORIES_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + THROTTLED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -GET_GATEWAY_RATE_LIMIT = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetGatewayRateLimit"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/gateways/{gatewayIdentifier}/rate-limits/{rateLimitId}", - } - ), - ) - ], +DELETE_MEMORY_STRATEGY_INPUT: StaticSchema = (18, n0, _DMSI, 0, (_mSI,), ((3, 1),)) + +DELETE_MEMORY_STRATEGIES_LIST: StaticSchema = ( + 16, + n0, + _DMSL, + 0, + (_mem,), + ((DELETE_MEMORY_STRATEGY_INPUT, 0),), +) + +CUSTOM_CONSOLIDATION_CONFIGURATION_INPUT: StaticSchema = ( + 19, + n0, + _CCCI, + 0, + (_sCO, _sCOu, _uPCO, _eCO), + ( + (SEMANTIC_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT, 0), + (SUMMARY_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT, 0), + (USER_PREFERENCE_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT, 0), + (EPISODIC_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT, 0), + ), ) -GATEWAY_RATE_LIMIT_MAX_RESULTS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GatewayRateLimitMaxResults"), - shape_type=ShapeType.INTEGER, +MODIFY_CONSOLIDATION_CONFIGURATION: StaticSchema = ( + 19, + n0, + _MCC, + 0, + (_cCC,), + ((CUSTOM_CONSOLIDATION_CONFIGURATION_INPUT, 0),), +) + +CUSTOM_EXTRACTION_CONFIGURATION_INPUT: StaticSchema = ( + 19, + n0, + _CECI, + 0, + (_sEO, _uPEO, _eEO), + ( + (SEMANTIC_OVERRIDE_EXTRACTION_CONFIGURATION_INPUT, 0), + (USER_PREFERENCE_OVERRIDE_EXTRACTION_CONFIGURATION_INPUT, 0), + (EPISODIC_OVERRIDE_EXTRACTION_CONFIGURATION_INPUT, 0), + ), ) -GATEWAY_RATE_LIMIT_NEXT_TOKEN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GatewayRateLimitNextToken"), - shape_type=ShapeType.STRING, +MODIFY_EXTRACTION_CONFIGURATION: StaticSchema = ( + 19, + n0, + _MEC, + 0, + (_cEC,), + ((CUSTOM_EXTRACTION_CONFIGURATION_INPUT, 0),), +) + +CUSTOM_REFLECTION_CONFIGURATION_INPUT: StaticSchema = ( + 19, + n0, + _CRCI, + 0, + (_eRO,), + ((EPISODIC_OVERRIDE_REFLECTION_CONFIGURATION_INPUT, 0),), +) + +MODIFY_REFLECTION_CONFIGURATION: StaticSchema = ( + 19, + n0, + _MRC, + 0, + (_eRC, _cRC), + ( + (EPISODIC_REFLECTION_CONFIGURATION_INPUT, 0), + (CUSTOM_REFLECTION_CONFIGURATION_INPUT, 0), + ), ) -LIST_GATEWAY_RATE_LIMITS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListGatewayRateLimitsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListGatewayRateLimitsRequest", - ) - ], - members={ - "gatewayIdentifier": { - "target": GATEWAY_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "maxResults": { - "target": GATEWAY_RATE_LIMIT_MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "nextToken": { - "target": GATEWAY_RATE_LIMIT_NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - }, +MODIFY_INVOCATION_CONFIGURATION_INPUT: StaticSchema = ( + 18, + n0, + _MICI, + 0, + (_tA, _pDBN), + ((ARN, 0), (3, 0)), +) + +MODIFY_SELF_MANAGED_CONFIGURATION: StaticSchema = ( + 18, + n0, + _MSMC, + 0, + (_tCr, _iCnv, _hCWS), + ( + (TRIGGER_CONDITION_INPUT_LIST, 0), + (MODIFY_INVOCATION_CONFIGURATION_INPUT, 0), + (7, 0), + ), ) -LIST_GATEWAY_RATE_LIMITS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListGatewayRateLimitsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListGatewayRateLimitsResponse", - ) - ], - members={ - "rateLimits": { - "target": GATEWAY_RATE_LIMITS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": GATEWAY_RATE_LIMIT_NEXT_TOKEN}, - }, +MODIFY_STRATEGY_CONFIGURATION: StaticSchema = ( + 18, + n0, + _MSC, + 0, + (_ext, _cons, _ref, _sMC), + ( + (MODIFY_EXTRACTION_CONFIGURATION, 0), + (MODIFY_CONSOLIDATION_CONFIGURATION, 0), + (MODIFY_REFLECTION_CONFIGURATION, 0), + (MODIFY_SELF_MANAGED_CONFIGURATION, 0), + ), ) -LIST_GATEWAY_RATE_LIMITS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListGatewayRateLimits"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/gateways/{gatewayIdentifier}/rate-limits", - } - ), - ) - ], +MODIFY_MEMORY_STRATEGY_INPUT: StaticSchema = ( + 18, + n0, + _MMSI, + 0, + (_mSI, _d, _na, _nTa, _con, _mRS), + ( + (3, 1), + (DESCRIPTION, 0), + (NAMESPACES_LIST, 0), + (NAMESPACES_LIST, 0), + (MODIFY_STRATEGY_CONFIGURATION, 0), + (MEMORY_RECORD_SCHEMA, 0), + ), ) -UPDATE_GATEWAY_RATE_LIMIT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateGatewayRateLimitInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UpdateGatewayRateLimitRequest", - ) - ], - members={ - "gatewayIdentifier": { - "target": GATEWAY_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "rateLimitId": { - "target": GATEWAY_RATE_LIMIT_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "description": {"target": GATEWAY_RATE_LIMIT_DESCRIPTION}, - "entries": { - "target": LIMIT_ENTRIES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +MODIFY_MEMORY_STRATEGIES_LIST: StaticSchema = ( + 16, + n0, + _MMSL, + 0, + (_mem,), + ((MODIFY_MEMORY_STRATEGY_INPUT, 0),), +) + +MODIFY_MEMORY_STRATEGIES: StaticSchema = ( + 18, + n0, + _MMS, + 0, + (_aMS, _mMS, _dMS), + ( + (MEMORY_STRATEGY_INPUT_LIST, 0), + (MODIFY_MEMORY_STRATEGIES_LIST, 0), + (DELETE_MEMORY_STRATEGIES_LIST, 0), + ), ) -UPDATE_GATEWAY_RATE_LIMIT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateGatewayRateLimitOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UpdateGatewayRateLimitResponse", - ) - ], - members={ - "rateLimitId": { - "target": GATEWAY_RATE_LIMIT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "gatewayIdentifier": { - "target": GATEWAY_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": GATEWAY_RATE_LIMIT_DESCRIPTION}, - "dimensionKeys": { - "target": DIMENSION_KEYS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "entries": { - "target": LIMIT_ENTRIES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": GATEWAY_RATE_LIMIT_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +UPDATE_MEMORY_INPUT: StaticSchema = ( + 18, + n0, + _UMI, + {_smit: None}, + (_cT, _mIe, _d, _eED, _mERA, _mSe, _aIK, _nK, _sDR), + ( + (NON_EMPTY_STRING, 2), + (MEMORY_ID, 9), + (DESCRIPTION, 0), + (7, 0), + (ARN, 0), + (MODIFY_MEMORY_STRATEGIES, 0), + (INDEXED_KEYS_LIST, 0), + (NAMESPACE_KEYS_LIST, 0), + (STREAM_DELIVERY_RESOURCES, 0), + ), ) -UPDATE_GATEWAY_RATE_LIMIT = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateGatewayRateLimit"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "PATCH", - "uri": "/gateways/{gatewayIdentifier}/rate-limits/{rateLimitId}", - } - ), - ) - ], +UPDATE_MEMORY_OUTPUT: StaticSchema = ( + 18, + n0, + _UMO, + {_smith: None}, + (_memo,), + ((MEMORY, 0),), +) + +UPDATE_MEMORY: StaticOperationSchema = ( + 23, + n0, + _UM, + { + _smithy: MappingProxyType( + {"code": 202, "method": "PUT", "uri": "/memories/{memoryId}/update"} + ) + }, + UPDATE_MEMORY_INPUT, + UPDATE_MEMORY_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AUTHORIZER_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#AuthorizerType"), - shape_type=ShapeType.ENUM, - members={ - "CUSTOM_JWT": {"target": UNIT}, - "AWS_IAM": {"target": UNIT}, - "NONE": {"target": UNIT}, - "AUTHENTICATE_ONLY": {"target": UNIT}, - }, +CREDENTIAL_PROVIDER_VENDOR_TYPE: StaticSchema = ( + 14, + n0, + _CPVT, + 0, + ( + _GO, + _GOi, + _SOl, + _SOa, + _MOi, + _COu, + _AOt, + _LOi, + _XO, + _OO, + _OLO, + _POO, + _FOa, + _YO, + _RO, + _ZO, + _TO, + _SOp, + _DO, + _NO, + _HO, + _CAO, + _FAO, + _AOu, + _COo, + ), + ( + (-1, {_sVm: _GO}), + (-1, {_sVm: _GOi}), + (-1, {_sVm: _SOl}), + (-1, {_sVm: _SOa}), + (-1, {_sVm: _MOi}), + (-1, {_sVm: _COu}), + (-1, {_sVm: _AOt}), + (-1, {_sVm: _LOi}), + (-1, {_sVm: _XO}), + (-1, {_sVm: _OO}), + (-1, {_sVm: _OLO}), + (-1, {_sVm: _POO}), + (-1, {_sVm: _FOa}), + (-1, {_sVm: _YO}), + (-1, {_sVm: _RO}), + (-1, {_sVm: _ZO}), + (-1, {_sVm: _TO}), + (-1, {_sVm: _SOp}), + (-1, {_sVm: _DO}), + (-1, {_sVm: _NO}), + (-1, {_sVm: _HO}), + (-1, {_sVm: _CAO}), + (-1, {_sVm: _FAO}), + (-1, {_sVm: _AOu}), + (-1, {_sVm: _COo}), + ), ) -GATEWAY_DESCRIPTION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GatewayDescription"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) +CLIENT_ID_TYPE: StaticSchema = (3, n0, _CIT, 0) -EXCEPTION_LEVEL = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ExceptionLevel"), - shape_type=ShapeType.ENUM, - members={"DEBUG": {"target": UNIT}}, +DEFAULT_CLIENT_SECRET_TYPE: StaticSchema = (3, n0, _DCST, 4) + +ATLASSIAN_OAUTH2_PROVIDER_CONFIG_INPUT: StaticSchema = ( + 18, + n0, + _AOPCI, + 0, + (_cIl, _cS, _cSC, _cSS), + ( + (CLIENT_ID_TYPE, 1), + (DEFAULT_CLIENT_SECRET_TYPE, {_smithya: _v_}), + (SECRET_REFERENCE, 0), + (SECRET_SOURCE_TYPE, 0), + ), ) -INTERCEPTOR_PAYLOAD_EXCLUSION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#InterceptorPayloadExclusion"), - shape_type=ShapeType.ENUM, - members={"RESPONSE_BODY": {"target": UNIT}}, +CLIENT_AUTHENTICATION_METHOD_TYPE: StaticSchema = ( + 14, + n0, + _CAMT, + 0, + (_CSB, _CSP, _AIITJ, _PKJ), + ((-1, {_sVm: _CSB}), (-1, {_sVm: _CSP}), (-1, {_sVm: _AIITJ}), (-1, {_sVm: _PKJ})), ) -INTERCEPTOR_PAYLOAD_EXCLUSION_SELECTOR = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InterceptorPayloadExclusionSelector" - ), - shape_type=ShapeType.UNION, - members={"field": {"target": INTERCEPTOR_PAYLOAD_EXCLUSION}}, +DEFAULT_CLIENT_ID_TYPE: StaticSchema = (3, n0, _DCIT, 0) + +AUTHORIZATION_ENDPOINT_TYPE: StaticSchema = (3, n0, _AET, 0) + +ISSUER_URL_TYPE: StaticSchema = (3, n0, _IUT, 0) + +RESPONSE_TYPE: StaticSchema = (3, n0, _RTe, 0) + +RESPONSE_LIST_TYPE: StaticSchema = (16, n0, _RLT, 0, (_mem,), ((RESPONSE_TYPE, 0),)) + +TOKEN_ENDPOINT_TYPE: StaticSchema = (3, n0, _TET, 0) + +TOKEN_AUTH_METHOD: StaticSchema = (3, n0, _TAM, 0) + +TOKEN_ENDPOINT_AUTH_METHODS_TYPE: StaticSchema = ( + 16, + n0, + _TEAMT, + 0, + (_mem,), + ((TOKEN_AUTH_METHOD, 0),), ) -INTERCEPTOR_PAYLOAD_EXCLUSION_SELECTOR_LIST = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InterceptorPayloadExclusionSelectorList" +OAUTH2_AUTHORIZATION_SERVER_METADATA: StaticSchema = ( + 18, + n0, + _OASM, + 0, + (_is, _aE, _tE, _rT, _tEAM), + ( + (ISSUER_URL_TYPE, 1), + (AUTHORIZATION_ENDPOINT_TYPE, 1), + (TOKEN_ENDPOINT_TYPE, 1), + (RESPONSE_LIST_TYPE, 0), + (TOKEN_ENDPOINT_AUTH_METHODS_TYPE, 0), ), - shape_type=ShapeType.LIST, - members={"member": {"target": INTERCEPTOR_PAYLOAD_EXCLUSION_SELECTOR}}, ) -INTERCEPTOR_PAYLOAD_FILTER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#InterceptorPayloadFilter"), - members={ - "exclude": { - "target": INTERCEPTOR_PAYLOAD_EXCLUSION_SELECTOR_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +DISCOVERY_URL_TYPE: StaticSchema = (3, n0, _DUT, 0) -INTERCEPTOR_INPUT_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#InterceptorInputConfiguration"), - members={ - "passRequestHeaders": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "payloadFilter": {"target": INTERCEPTOR_PAYLOAD_FILTER}, - }, +OAUTH2_DISCOVERY: StaticSchema = ( + 19, + n0, + _OD, + 0, + (_dU, _aSMu), + ((DISCOVERY_URL_TYPE, 0), (OAUTH2_AUTHORIZATION_SERVER_METADATA, 0)), ) -GATEWAY_INTERCEPTION_POINT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GatewayInterceptionPoint"), - shape_type=ShapeType.ENUM, - members={"REQUEST": {"target": UNIT}, "RESPONSE": {"target": UNIT}}, +ON_BEHALF_OF_TOKEN_EXCHANGE_GRANT_TYPE_TYPE: StaticSchema = ( + 14, + n0, + _OBOTEGTT, + 0, + (_TE_, _JAG), + ((-1, {_sVm: _TE_}), (-1, {_sVm: _JAG})), ) -GATEWAY_INTERCEPTION_POINTS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GatewayInterceptionPoints"), - shape_type=ShapeType.LIST, - members={"member": {"target": GATEWAY_INTERCEPTION_POINT}}, -) +SCOPE_TYPE: StaticSchema = (3, n0, _STco, 0) -LAMBDA_FUNCTION_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#LambdaFunctionArn"), - shape_type=ShapeType.STRING, -) +SCOPES_LIST_TYPE: StaticSchema = (16, n0, _SLT, 0, (_mem,), ((SCOPE_TYPE, 0),)) -LAMBDA_INTERCEPTOR_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#LambdaInterceptorConfiguration"), - members={ - "arn": { - "target": LAMBDA_FUNCTION_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +TOKEN_EXCHANGE_GRANT_TYPE_CONFIG_TYPE: StaticSchema = ( + 18, + n0, + _TEGTCT, + 0, + (_aTCc, _aTS), + ((ACTOR_TOKEN_CONTENT_TYPE, 1), (SCOPES_LIST_TYPE, 0)), ) -INTERCEPTOR_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#InterceptorConfiguration"), - shape_type=ShapeType.UNION, - members={"lambda": {"target": LAMBDA_INTERCEPTOR_CONFIGURATION}}, -) - -GATEWAY_INTERCEPTOR_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GatewayInterceptorConfiguration"), - members={ - "interceptor": { - "target": INTERCEPTOR_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "interceptionPoints": { - "target": GATEWAY_INTERCEPTION_POINTS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "inputConfiguration": {"target": INTERCEPTOR_INPUT_CONFIGURATION}, - }, +ON_BEHALF_OF_TOKEN_EXCHANGE_CONFIG_TYPE: StaticSchema = ( + 18, + n0, + _OBOTECT, + 0, + (_gT, _tEGTC), + ( + (ON_BEHALF_OF_TOKEN_EXCHANGE_GRANT_TYPE_TYPE, 1), + (TOKEN_EXCHANGE_GRANT_TYPE_CONFIG_TYPE, 0), + ), ) -GATEWAY_INTERCEPTOR_CONFIGURATIONS = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#GatewayInterceptorConfigurations" +KMS_KEY_SOURCE_TYPE: StaticSchema = (18, n0, _KKST, 0, (_kKA,), ((KMS_KEY_ARN, 1),)) + +PRIVATE_KEY_SOURCE: StaticSchema = ( + 19, + n0, + _PKS, + 0, + (_kKS,), + ((KMS_KEY_SOURCE_TYPE, 0),), +) + +SIGNING_ALGORITHM: StaticSchema = ( + 14, + n0, + _SAi, + 0, + (_RS_, _PS, _ES_), + ((-1, {_sVm: _RS_}), (-1, {_sVm: _PS}), (-1, {_sVm: _ES_})), +) + +PRIVATE_KEY_JWT_CONFIG: StaticSchema = ( + 18, + n0, + _PKJC, + 0, + (_pKS, _sAi, _aHC, _aPC), + ( + (PRIVATE_KEY_SOURCE, 0), + (SIGNING_ALGORITHM, 0), + (ADDITIONAL_CLAIMS, 0), + (ADDITIONAL_CLAIMS, 0), ), - shape_type=ShapeType.LIST, - members={"member": {"target": GATEWAY_INTERCEPTOR_CONFIGURATION}}, ) -GATEWAY_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GatewayName"), - shape_type=ShapeType.STRING, +CUSTOM_OAUTH2_PROVIDER_CONFIG_INPUT: StaticSchema = ( + 18, + n0, + _COPCI, + 0, + (_oD, _cIl, _cS, _cSC, _cSS, _oBOTEC, _cAM, _pKJC, _pE, _pEO), + ( + (OAUTH2_DISCOVERY, 1), + (DEFAULT_CLIENT_ID_TYPE, {_smithya: _v_}), + (DEFAULT_CLIENT_SECRET_TYPE, {_smithya: _v_}), + (SECRET_REFERENCE, 0), + (SECRET_SOURCE_TYPE, 0), + (ON_BEHALF_OF_TOKEN_EXCHANGE_CONFIG_TYPE, 0), + (CLIENT_AUTHENTICATION_METHOD_TYPE, 0), + (PRIVATE_KEY_JWT_CONFIG, 0), + (PRIVATE_ENDPOINT, 0), + (PRIVATE_ENDPOINT_OVERRIDES, 0), + ), ) -GATEWAY_POLICY_ENGINE_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GatewayPolicyEngineArn"), - shape_type=ShapeType.STRING, +GITHUB_OAUTH2_PROVIDER_CONFIG_INPUT: StaticSchema = ( + 18, + n0, + _GOPCI, + 0, + (_cIl, _cS, _cSC, _cSS), + ( + (CLIENT_ID_TYPE, 1), + (DEFAULT_CLIENT_SECRET_TYPE, {_smithya: _v_}), + (SECRET_REFERENCE, 0), + (SECRET_SOURCE_TYPE, 0), + ), ) -GATEWAY_POLICY_ENGINE_MODE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GatewayPolicyEngineMode"), - shape_type=ShapeType.ENUM, - members={"LOG_ONLY": {"target": UNIT}, "ENFORCE": {"target": UNIT}}, +GOOGLE_OAUTH2_PROVIDER_CONFIG_INPUT: StaticSchema = ( + 18, + n0, + _GOPCIo, + 0, + (_cIl, _cS, _cSC, _cSS), + ( + (CLIENT_ID_TYPE, 1), + (DEFAULT_CLIENT_SECRET_TYPE, {_smithya: _v_}), + (SECRET_REFERENCE, 0), + (SECRET_SOURCE_TYPE, 0), + ), ) -GATEWAY_POLICY_ENGINE_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#GatewayPolicyEngineConfiguration" +INCLUDED_OAUTH2_PROVIDER_CONFIG_INPUT: StaticSchema = ( + 18, + n0, + _IOPCI, + 0, + (_cIl, _cS, _cSC, _cSS, _is, _aE, _tE), + ( + (CLIENT_ID_TYPE, 1), + (DEFAULT_CLIENT_SECRET_TYPE, {_smithya: _v_}), + (SECRET_REFERENCE, 0), + (SECRET_SOURCE_TYPE, 0), + (ISSUER_URL_TYPE, 0), + (AUTHORIZATION_ENDPOINT_TYPE, 0), + (TOKEN_ENDPOINT_TYPE, 0), ), - members={ - "arn": { - "target": GATEWAY_POLICY_ENGINE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "mode": { - "target": GATEWAY_POLICY_ENGINE_MODE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, ) -MCP_INSTRUCTIONS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#McpInstructions"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +LINKEDIN_OAUTH2_PROVIDER_CONFIG_INPUT: StaticSchema = ( + 18, + n0, + _LOPCI, + 0, + (_cIl, _cS, _cSC, _cSS), + ( + (CLIENT_ID_TYPE, 1), + (DEFAULT_CLIENT_SECRET_TYPE, {_smithya: _v_}), + (SECRET_REFERENCE, 0), + (SECRET_SOURCE_TYPE, 0), + ), ) -SEARCH_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SearchType"), - shape_type=ShapeType.ENUM, - members={"SEMANTIC": {"target": UNIT}}, +TENANT_ID_TYPE: StaticSchema = (3, n0, _TIT, 0) + +MICROSOFT_OAUTH2_PROVIDER_CONFIG_INPUT: StaticSchema = ( + 18, + n0, + _MOPCI, + 0, + (_cIl, _cS, _cSC, _cSS, _tIe), + ( + (CLIENT_ID_TYPE, 1), + (DEFAULT_CLIENT_SECRET_TYPE, {_smithya: _v_}), + (SECRET_REFERENCE, 0), + (SECRET_SOURCE_TYPE, 0), + (TENANT_ID_TYPE, 0), + ), ) -SESSION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SessionConfiguration"), - members={"sessionTimeoutInSeconds": {"target": INTEGER}}, +SALESFORCE_OAUTH2_PROVIDER_CONFIG_INPUT: StaticSchema = ( + 18, + n0, + _SOPCI, + 0, + (_cIl, _cS, _cSC, _cSS), + ( + (CLIENT_ID_TYPE, 1), + (DEFAULT_CLIENT_SECRET_TYPE, {_smithya: _v_}), + (SECRET_REFERENCE, 0), + (SECRET_SOURCE_TYPE, 0), + ), ) -STREAMING_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#StreamingConfiguration"), - members={"enableResponseStreaming": {"target": BOOLEAN}}, +SLACK_OAUTH2_PROVIDER_CONFIG_INPUT: StaticSchema = ( + 18, + n0, + _SOPCIl, + 0, + (_cIl, _cS, _cSC, _cSS), + ( + (CLIENT_ID_TYPE, 1), + (DEFAULT_CLIENT_SECRET_TYPE, {_smithya: _v_}), + (SECRET_REFERENCE, 0), + (SECRET_SOURCE_TYPE, 0), + ), ) -MCP_VERSION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#McpVersion"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value="2025-03-26")], +OAUTH2_PROVIDER_CONFIG_INPUT: StaticSchema = ( + 19, + n0, + _OPCI, + 0, + (_cOPC, _gOPC, _gOPCi, _sOPC, _sOPCa, _mOPC, _aOPC, _lOPC, _iOPC), + ( + (CUSTOM_OAUTH2_PROVIDER_CONFIG_INPUT, 0), + (GOOGLE_OAUTH2_PROVIDER_CONFIG_INPUT, 0), + (GITHUB_OAUTH2_PROVIDER_CONFIG_INPUT, 0), + (SLACK_OAUTH2_PROVIDER_CONFIG_INPUT, 0), + (SALESFORCE_OAUTH2_PROVIDER_CONFIG_INPUT, 0), + (MICROSOFT_OAUTH2_PROVIDER_CONFIG_INPUT, 0), + (ATLASSIAN_OAUTH2_PROVIDER_CONFIG_INPUT, 0), + (LINKEDIN_OAUTH2_PROVIDER_CONFIG_INPUT, 0), + (INCLUDED_OAUTH2_PROVIDER_CONFIG_INPUT, 0), + ), ) -MCP_SUPPORTED_VERSIONS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#McpSupportedVersions"), - shape_type=ShapeType.LIST, - members={"member": {"target": MCP_VERSION}}, +CREATE_OAUTH2_CREDENTIAL_PROVIDER_INPUT: StaticSchema = ( + 18, + n0, + _COCPI, + {_sSI: _cCOCPR, _smit: None}, + (_n, _cPVr, _oPCI, _t), + ( + (CREDENTIAL_PROVIDER_NAME, 1), + (CREDENTIAL_PROVIDER_VENDOR_TYPE, 1), + (OAUTH2_PROVIDER_CONFIG_INPUT, 1), + (TAGS_MAP, 0), + ), ) -MCP_GATEWAY_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#MCPGatewayConfiguration"), - members={ - "supportedVersions": {"target": MCP_SUPPORTED_VERSIONS}, - "instructions": {"target": MCP_INSTRUCTIONS}, - "searchType": {"target": SEARCH_TYPE}, - "sessionConfiguration": {"target": SESSION_CONFIGURATION}, - "streamingConfiguration": {"target": STREAMING_CONFIGURATION}, - "disableMcpListToolsPagination": {"target": BOOLEAN}, - }, +CREDENTIAL_PROVIDER_ARN_TYPE: StaticSchema = (3, n0, _CPATr, 0) + +ATLASSIAN_OAUTH2_PROVIDER_CONFIG_OUTPUT: StaticSchema = ( + 18, + n0, + _AOPCO, + 0, + (_oD, _cIl), + ((OAUTH2_DISCOVERY, 1), (CLIENT_ID_TYPE, 0)), +) + +CUSTOM_OAUTH2_PROVIDER_CONFIG_OUTPUT: StaticSchema = ( + 18, + n0, + _COPCO, + 0, + (_oD, _cIl, _oBOTEC, _cAM, _pE, _pEO, _pKJC), + ( + (OAUTH2_DISCOVERY, 1), + (CLIENT_ID_TYPE, 0), + (ON_BEHALF_OF_TOKEN_EXCHANGE_CONFIG_TYPE, 0), + (CLIENT_AUTHENTICATION_METHOD_TYPE, 0), + (PRIVATE_ENDPOINT, 0), + (PRIVATE_ENDPOINT_OVERRIDES, 0), + (PRIVATE_KEY_JWT_CONFIG, 0), + ), ) -GATEWAY_PROTOCOL_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GatewayProtocolConfiguration"), - shape_type=ShapeType.UNION, - members={"mcp": {"target": MCP_GATEWAY_CONFIGURATION}}, +GITHUB_OAUTH2_PROVIDER_CONFIG_OUTPUT: StaticSchema = ( + 18, + n0, + _GOPCO, + 0, + (_oD, _cIl), + ((OAUTH2_DISCOVERY, 1), (CLIENT_ID_TYPE, 0)), +) + +GOOGLE_OAUTH2_PROVIDER_CONFIG_OUTPUT: StaticSchema = ( + 18, + n0, + _GOPCOo, + 0, + (_oD, _cIl), + ((OAUTH2_DISCOVERY, 1), (CLIENT_ID_TYPE, 0)), +) + +INCLUDED_OAUTH2_PROVIDER_CONFIG_OUTPUT: StaticSchema = ( + 18, + n0, + _IOPCO, + 0, + (_oD, _cIl), + ((OAUTH2_DISCOVERY, 1), (CLIENT_ID_TYPE, 0)), +) + +LINKEDIN_OAUTH2_PROVIDER_CONFIG_OUTPUT: StaticSchema = ( + 18, + n0, + _LOPCO, + 0, + (_oD, _cIl), + ((OAUTH2_DISCOVERY, 1), (CLIENT_ID_TYPE, 0)), +) + +MICROSOFT_OAUTH2_PROVIDER_CONFIG_OUTPUT: StaticSchema = ( + 18, + n0, + _MOPCO, + 0, + (_oD, _cIl), + ((OAUTH2_DISCOVERY, 1), (CLIENT_ID_TYPE, 0)), +) + +SALESFORCE_OAUTH2_PROVIDER_CONFIG_OUTPUT: StaticSchema = ( + 18, + n0, + _SOPCO, + 0, + (_oD, _cIl), + ((OAUTH2_DISCOVERY, 1), (CLIENT_ID_TYPE, 0)), +) + +SLACK_OAUTH2_PROVIDER_CONFIG_OUTPUT: StaticSchema = ( + 18, + n0, + _SOPCOl, + 0, + (_oD, _cIl), + ((OAUTH2_DISCOVERY, 1), (CLIENT_ID_TYPE, 0)), +) + +OAUTH2_PROVIDER_CONFIG_OUTPUT: StaticSchema = ( + 19, + n0, + _OPCO, + 0, + (_cOPC, _gOPC, _gOPCi, _sOPC, _sOPCa, _mOPC, _aOPC, _lOPC, _iOPC), + ( + (CUSTOM_OAUTH2_PROVIDER_CONFIG_OUTPUT, 0), + (GOOGLE_OAUTH2_PROVIDER_CONFIG_OUTPUT, 0), + (GITHUB_OAUTH2_PROVIDER_CONFIG_OUTPUT, 0), + (SLACK_OAUTH2_PROVIDER_CONFIG_OUTPUT, 0), + (SALESFORCE_OAUTH2_PROVIDER_CONFIG_OUTPUT, 0), + (MICROSOFT_OAUTH2_PROVIDER_CONFIG_OUTPUT, 0), + (ATLASSIAN_OAUTH2_PROVIDER_CONFIG_OUTPUT, 0), + (LINKEDIN_OAUTH2_PROVIDER_CONFIG_OUTPUT, 0), + (INCLUDED_OAUTH2_PROVIDER_CONFIG_OUTPUT, 0), + ), ) -GATEWAY_PROTOCOL_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GatewayProtocolType"), - shape_type=ShapeType.ENUM, - members={"MCP": {"target": UNIT}}, +STATUS: StaticSchema = ( + 14, + n0, + _St, + 0, + (_CREATING, _CF, _UPDATING, _UF, _READY, _DELETING, _DF), + ( + (-1, {_sVm: _CREATING}), + (-1, {_sVm: _CF}), + (-1, {_sVm: _UPDATING}), + (-1, {_sVm: _UF}), + (-1, {_sVm: _READY}), + (-1, {_sVm: _DELETING}), + (-1, {_sVm: _DF}), + ), ) -CREATE_GATEWAY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateGatewayInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreateGatewayRequest", - ) - ], - members={ - "name": { - "target": GATEWAY_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": GATEWAY_DESCRIPTION}, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "roleArn": { - "target": ROLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "protocolType": { - "target": GATEWAY_PROTOCOL_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="MCP")], - }, - "protocolConfiguration": {"target": GATEWAY_PROTOCOL_CONFIGURATION}, - "authorizerType": { - "target": AUTHORIZER_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "authorizerConfiguration": {"target": AUTHORIZER_CONFIGURATION}, - "kmsKeyArn": {"target": KMS_KEY_ARN}, - "interceptorConfigurations": {"target": GATEWAY_INTERCEPTOR_CONFIGURATIONS}, - "policyEngineConfiguration": {"target": GATEWAY_POLICY_ENGINE_CONFIGURATION}, - "exceptionLevel": {"target": EXCEPTION_LEVEL}, - "tags": {"target": TAGS_MAP}, - }, +CREATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT: StaticSchema = ( + 18, + n0, + _COCPO, + {_sSI: _cCOCPRo, _smith: None}, + (_cSA, _cSJK, _cSS, _n, _cPAr, _cUa, _oPCO, _st), + ( + (SECRET, 1), + (SECRET_JSON_KEY_TYPE, 0), + (SECRET_SOURCE_TYPE, 0), + (CREDENTIAL_PROVIDER_NAME, 1), + (CREDENTIAL_PROVIDER_ARN_TYPE, 1), + (3, 0), + (OAUTH2_PROVIDER_CONFIG_OUTPUT, 0), + (STATUS, 0), + ), ) -LAMBDA_TRANSFORM_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#LambdaTransformConfiguration"), - members={"arn": {"target": LAMBDA_FUNCTION_ARN}}, +CREATE_OAUTH2_CREDENTIAL_PROVIDER: StaticOperationSchema = ( + 23, + n0, + _COCP, + { + _smithy: MappingProxyType( + { + "code": 201, + "uri": "/identities/CreateOauth2CredentialProvider", + "method": "POST", + } + ) + }, + CREATE_OAUTH2_CREDENTIAL_PROVIDER_INPUT, + CREATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + DECRYPTION_FAILURE, + ENCRYPTION_FAILURE, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_LIMIT_EXCEEDED_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CUSTOM_TRANSFORM_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CustomTransformConfiguration"), - members={"lambda": {"target": LAMBDA_TRANSFORM_CONFIGURATION}}, +DELETE_OAUTH2_CREDENTIAL_PROVIDER_INPUT: StaticSchema = ( + 18, + n0, + _DOCPI, + {_sSI: _cDOCPR, _smit: None}, + (_n,), + ((CREDENTIAL_PROVIDER_NAME, 1),), +) + +DELETE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT: StaticSchema = ( + 18, + n0, + _DOCPO, + {_sSI: _cDOCPRo, _smith: None}, +) + +DELETE_OAUTH2_CREDENTIAL_PROVIDER: StaticOperationSchema = ( + 23, + n0, + _DOCP, + { + _smithy: MappingProxyType( + { + "code": 204, + "uri": "/identities/DeleteOauth2CredentialProvider", + "method": "POST", + } + ) + }, + DELETE_OAUTH2_CREDENTIAL_PROVIDER_INPUT, + DELETE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -GATEWAY_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GatewayArn"), - shape_type=ShapeType.STRING, +GET_OAUTH2_CREDENTIAL_PROVIDER_INPUT: StaticSchema = ( + 18, + n0, + _GOCPI, + {_sSI: _cGOCPR, _smit: None}, + (_n,), + ((CREDENTIAL_PROVIDER_NAME, 1),), +) + +GET_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT: StaticSchema = ( + 18, + n0, + _GOCPO, + {_sSI: _cGOCPRo, _smith: None}, + (_cSA, _cSJK, _cSS, _n, _cPAr, _cPVr, _cUa, _oPCO, _cTr, _lUT, _st, _fR), + ( + (SECRET, 1), + (SECRET_JSON_KEY_TYPE, 0), + (SECRET_SOURCE_TYPE, 0), + (CREDENTIAL_PROVIDER_NAME, 1), + (CREDENTIAL_PROVIDER_ARN_TYPE, 1), + (CREDENTIAL_PROVIDER_VENDOR_TYPE, 1), + (3, 0), + (OAUTH2_PROVIDER_CONFIG_OUTPUT, 1), + (4, 1), + (4, 1), + (STATUS, 0), + (3, 0), + ), ) -GATEWAY_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GatewayId"), - shape_type=ShapeType.STRING, +GET_OAUTH2_CREDENTIAL_PROVIDER: StaticOperationSchema = ( + 23, + n0, + _GOCP, + { + _smithy: MappingProxyType( + {"uri": "/identities/GetOauth2CredentialProvider", "method": "POST"} + ) + }, + GET_OAUTH2_CREDENTIAL_PROVIDER_INPUT, + GET_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + DECRYPTION_FAILURE, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -GATEWAY_URL = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GatewayUrl"), - shape_type=ShapeType.STRING, +LIST_OAUTH2_CREDENTIAL_PROVIDERS_INPUT: StaticSchema = ( + 18, + n0, + _LOCPI, + {_sSI: _cLOCPR, _smit: None}, + (_nT, _mR), + ((3, 0), (7, {_smithya: 10})), +) + +OAUTH2_CREDENTIAL_PROVIDER_ITEM: StaticSchema = ( + 18, + n0, + _OCPI, + 0, + (_n, _cPVr, _cPAr, _cTr, _lUT), + ( + (CREDENTIAL_PROVIDER_NAME, 1), + (CREDENTIAL_PROVIDER_VENDOR_TYPE, 1), + (CREDENTIAL_PROVIDER_ARN_TYPE, 1), + (4, 1), + (4, 1), + ), ) -GATEWAY_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GatewayStatus"), - shape_type=ShapeType.ENUM, - members={ - "CREATING": {"target": UNIT}, - "UPDATING": {"target": UNIT}, - "UPDATE_UNSUCCESSFUL": {"target": UNIT}, - "DELETING": {"target": UNIT}, - "READY": {"target": UNIT}, - "FAILED": {"target": UNIT}, - }, +OAUTH2_CREDENTIAL_PROVIDERS: StaticSchema = ( + 16, + n0, + _OCP, + 0, + (_mem,), + ((OAUTH2_CREDENTIAL_PROVIDER_ITEM, 0),), +) + +LIST_OAUTH2_CREDENTIAL_PROVIDERS_OUTPUT: StaticSchema = ( + 18, + n0, + _LOCPO, + {_sSI: _cLOCPRo, _smith: None}, + (_cP, _nT), + ((OAUTH2_CREDENTIAL_PROVIDERS, 1), (3, 0)), +) + +LIST_OAUTH2_CREDENTIAL_PROVIDERS: StaticOperationSchema = ( + 23, + n0, + _LOCP, + { + _smithy: MappingProxyType( + {"uri": "/identities/ListOauth2CredentialProviders", "method": "POST"} + ) + }, + LIST_OAUTH2_CREDENTIAL_PROVIDERS_INPUT, + LIST_OAUTH2_CREDENTIAL_PROVIDERS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -STATUS_REASON = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#StatusReason"), - shape_type=ShapeType.STRING, +UPDATE_OAUTH2_CREDENTIAL_PROVIDER_INPUT: StaticSchema = ( + 18, + n0, + _UOCPI, + {_sSI: _cUOCPR, _smit: None}, + (_n, _cPVr, _oPCI), + ( + (CREDENTIAL_PROVIDER_NAME, 1), + (CREDENTIAL_PROVIDER_VENDOR_TYPE, 1), + (OAUTH2_PROVIDER_CONFIG_INPUT, 1), + ), ) -STATUS_REASONS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#StatusReasons"), - shape_type=ShapeType.LIST, - members={"member": {"target": STATUS_REASON}}, +UPDATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT: StaticSchema = ( + 18, + n0, + _UOCPO, + {_sSI: _cUOCPRo, _smith: None}, + (_cSA, _cSJK, _cSS, _n, _cPVr, _cPAr, _cUa, _oPCO, _cTr, _lUT, _st), + ( + (SECRET, 1), + (SECRET_JSON_KEY_TYPE, 0), + (SECRET_SOURCE_TYPE, 0), + (CREDENTIAL_PROVIDER_NAME, 1), + (CREDENTIAL_PROVIDER_VENDOR_TYPE, 1), + (CREDENTIAL_PROVIDER_ARN_TYPE, 1), + (3, 0), + (OAUTH2_PROVIDER_CONFIG_OUTPUT, 1), + (4, 1), + (4, 1), + (STATUS, 0), + ), ) -WAF_FAILURE_MODE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#WafFailureMode"), - shape_type=ShapeType.ENUM, - members={"FAIL_CLOSE": {"target": UNIT}, "FAIL_OPEN": {"target": UNIT}}, +UPDATE_OAUTH2_CREDENTIAL_PROVIDER: StaticOperationSchema = ( + 23, + n0, + _UOCP, + { + _smithy: MappingProxyType( + {"uri": "/identities/UpdateOauth2CredentialProvider", "method": "POST"} + ) + }, + UPDATE_OAUTH2_CREDENTIAL_PROVIDER_INPUT, + UPDATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + DECRYPTION_FAILURE, + ENCRYPTION_FAILURE, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -WAF_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#WafConfiguration"), - members={"failureMode": {"target": WAF_FAILURE_MODE}}, +CLUSTERING_FREQUENCY: StaticSchema = ( + 14, + n0, + _CFl, + 0, + (_DAILY, _WEEKLY, _MONTHLY), + ((-1, {_sVm: _DAILY}), (-1, {_sVm: _WEEKLY}), (-1, {_sVm: _MONTHLY})), ) -WEB_ACL_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#WebAclArn"), - shape_type=ShapeType.STRING, +CLUSTERING_FREQUENCY_LIST: StaticSchema = ( + 16, + n0, + _CFL, + 0, + (_mem,), + ((CLUSTERING_FREQUENCY, 0),), ) -CREATE_GATEWAY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateGatewayOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreateGatewayResponse", - ) - ], - members={ - "gatewayArn": { - "target": GATEWAY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "gatewayId": { - "target": GATEWAY_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "gatewayUrl": {"target": GATEWAY_URL}, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": GATEWAY_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "statusReasons": {"target": STATUS_REASONS}, - "name": { - "target": GATEWAY_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": GATEWAY_DESCRIPTION}, - "roleArn": {"target": ROLE_ARN}, - "protocolType": { - "target": GATEWAY_PROTOCOL_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="MCP")], - }, - "protocolConfiguration": {"target": GATEWAY_PROTOCOL_CONFIGURATION}, - "authorizerType": { - "target": AUTHORIZER_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "authorizerConfiguration": {"target": AUTHORIZER_CONFIGURATION}, - "kmsKeyArn": {"target": KMS_KEY_ARN}, - "customTransformConfiguration": {"target": CUSTOM_TRANSFORM_CONFIGURATION}, - "interceptorConfigurations": {"target": GATEWAY_INTERCEPTOR_CONFIGURATIONS}, - "policyEngineConfiguration": {"target": GATEWAY_POLICY_ENGINE_CONFIGURATION}, - "workloadIdentityDetails": {"target": WORKLOAD_IDENTITY_DETAILS}, - "exceptionLevel": {"target": EXCEPTION_LEVEL}, - "webAclArn": {"target": WEB_ACL_ARN}, - "wafConfiguration": {"target": WAF_CONFIGURATION}, - }, +CLUSTERING_CONFIG: StaticSchema = ( + 18, + n0, + _CCl, + 0, + (_fr,), + ((CLUSTERING_FREQUENCY_LIST, 1),), ) -CREATE_GATEWAY = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateGateway"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 202, "method": "POST", "uri": "/gateways/"} - ), - ) - ], -) +LOG_GROUP_NAME_PREFIX: StaticSchema = (3, n0, _LGNP, 0) -DELETE_GATEWAY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteGatewayInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeleteGatewayRequest", - ) - ], - members={ - "gatewayIdentifier": { - "target": GATEWAY_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, +LOG_GROUP_NAME_PREFIX_LIST: StaticSchema = ( + 16, + n0, + _LGNPL, + 0, + (_mem,), + ((LOG_GROUP_NAME_PREFIX, 0),), ) -DELETE_GATEWAY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteGatewayOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeleteGatewayResponse", - ) - ], - members={ - "gatewayId": { - "target": GATEWAY_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": GATEWAY_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "statusReasons": {"target": STATUS_REASONS}, - }, -) +LOG_GROUP_NAME: StaticSchema = (3, n0, _LGN, 0) -DELETE_GATEWAY = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteGateway"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 202, - "method": "DELETE", - "uri": "/gateways/{gatewayIdentifier}/", - } - ), - ) - ], -) +LOG_GROUP_NAMES_LIST: StaticSchema = (16, n0, _LGNL, 0, (_mem,), ((LOG_GROUP_NAME, 0),)) -GET_GATEWAY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetGatewayInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetGatewayRequest", - ) - ], - members={ - "gatewayIdentifier": { - "target": GATEWAY_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) +SERVICE_NAME: StaticSchema = (3, n0, _SNe, 0) -GET_GATEWAY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetGatewayOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetGatewayResponse", - ) - ], - members={ - "gatewayArn": { - "target": GATEWAY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "gatewayId": { - "target": GATEWAY_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "gatewayUrl": {"target": GATEWAY_URL}, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": GATEWAY_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "statusReasons": {"target": STATUS_REASONS}, - "name": { - "target": GATEWAY_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": GATEWAY_DESCRIPTION}, - "roleArn": {"target": ROLE_ARN}, - "protocolType": { - "target": GATEWAY_PROTOCOL_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="MCP")], - }, - "protocolConfiguration": {"target": GATEWAY_PROTOCOL_CONFIGURATION}, - "authorizerType": { - "target": AUTHORIZER_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "authorizerConfiguration": {"target": AUTHORIZER_CONFIGURATION}, - "kmsKeyArn": {"target": KMS_KEY_ARN}, - "customTransformConfiguration": {"target": CUSTOM_TRANSFORM_CONFIGURATION}, - "interceptorConfigurations": {"target": GATEWAY_INTERCEPTOR_CONFIGURATIONS}, - "policyEngineConfiguration": {"target": GATEWAY_POLICY_ENGINE_CONFIGURATION}, - "workloadIdentityDetails": {"target": WORKLOAD_IDENTITY_DETAILS}, - "exceptionLevel": {"target": EXCEPTION_LEVEL}, - "webAclArn": {"target": WEB_ACL_ARN}, - "wafConfiguration": {"target": WAF_CONFIGURATION}, - }, -) +SERVICE_NAMES_LIST: StaticSchema = (16, n0, _SNL, 0, (_mem,), ((SERVICE_NAME, 0),)) -GET_GATEWAY = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetGateway"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "GET", "uri": "/gateways/{gatewayIdentifier}/"} - ), - ) - ], +CLOUD_WATCH_LOGS_INPUT_CONFIG: StaticSchema = ( + 18, + n0, + _CWLIC, + 0, + (_lGN, _lGNP, _sN), + ( + (LOG_GROUP_NAMES_LIST, {_smithya: ()}), + (LOG_GROUP_NAME_PREFIX_LIST, 0), + (SERVICE_NAMES_LIST, 1), + ), ) -GATEWAY_MAX_RESULTS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GatewayMaxResults"), - shape_type=ShapeType.INTEGER, +DATA_SOURCE_CONFIG: StaticSchema = ( + 19, + n0, + _DSC, + 0, + (_cWL,), + ((CLOUD_WATCH_LOGS_INPUT_CONFIG, 0),), ) -GATEWAY_NEXT_TOKEN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GatewayNextToken"), - shape_type=ShapeType.STRING, -) +EVALUATION_CONFIG_DESCRIPTION: StaticSchema = (3, n0, _ECD, 4) -LIST_GATEWAYS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListGatewaysInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListGatewaysRequest", - ) - ], - members={ - "maxResults": { - "target": GATEWAY_MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "nextToken": { - "target": GATEWAY_NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - }, -) +EVALUATOR_REFERENCE: StaticSchema = (19, n0, _ER, 0, (_eIv,), ((EVALUATOR_ID, 0),)) -GATEWAY_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GatewaySummary"), - members={ - "gatewayId": { - "target": GATEWAY_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": GATEWAY_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": GATEWAY_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": GATEWAY_DESCRIPTION}, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "authorizerType": { - "target": AUTHORIZER_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "protocolType": { - "target": GATEWAY_PROTOCOL_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="MCP")], - }, - }, -) +EVALUATOR_LIST: StaticSchema = (16, n0, _ELv, 0, (_mem,), ((EVALUATOR_REFERENCE, 0),)) -GATEWAY_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GatewaySummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": GATEWAY_SUMMARY}}, -) +INSIGHT_ID: StaticSchema = (3, n0, _II, 0) -LIST_GATEWAYS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListGatewaysOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListGatewaysResponse", - ) - ], - members={ - "items": { - "target": GATEWAY_SUMMARIES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": GATEWAY_NEXT_TOKEN}, - }, -) +INSIGHT: StaticSchema = (18, n0, _I, 0, (_iI,), ((INSIGHT_ID, 1),)) -LIST_GATEWAYS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListGateways"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType({"code": 200, "method": "GET", "uri": "/gateways/"}), - ) - ], -) +INSIGHT_LIST: StaticSchema = (16, n0, _IL, 0, (_mem,), ((INSIGHT, 0),)) -UPDATE_GATEWAY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateGatewayInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UpdateGatewayRequest", - ) - ], - members={ - "gatewayIdentifier": { - "target": GATEWAY_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "name": { - "target": GATEWAY_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": GATEWAY_DESCRIPTION}, - "roleArn": { - "target": ROLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "protocolType": { - "target": GATEWAY_PROTOCOL_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="MCP")], - }, - "protocolConfiguration": {"target": GATEWAY_PROTOCOL_CONFIGURATION}, - "authorizerType": { - "target": AUTHORIZER_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "authorizerConfiguration": {"target": AUTHORIZER_CONFIGURATION}, - "kmsKeyArn": {"target": KMS_KEY_ARN}, - "customTransformConfiguration": {"target": CUSTOM_TRANSFORM_CONFIGURATION}, - "interceptorConfigurations": {"target": GATEWAY_INTERCEPTOR_CONFIGURATIONS}, - "policyEngineConfiguration": {"target": GATEWAY_POLICY_ENGINE_CONFIGURATION}, - "exceptionLevel": {"target": EXCEPTION_LEVEL}, - "wafConfiguration": {"target": WAF_CONFIGURATION}, - }, -) +EVALUATION_CONFIG_NAME: StaticSchema = (3, n0, _ECN, 0) -UPDATE_GATEWAY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateGatewayOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UpdateGatewayResponse", - ) - ], - members={ - "gatewayArn": { - "target": GATEWAY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "gatewayId": { - "target": GATEWAY_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "gatewayUrl": {"target": GATEWAY_URL}, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": GATEWAY_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "statusReasons": {"target": STATUS_REASONS}, - "name": { - "target": GATEWAY_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": GATEWAY_DESCRIPTION}, - "roleArn": {"target": ROLE_ARN}, - "protocolType": { - "target": GATEWAY_PROTOCOL_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="MCP")], - }, - "protocolConfiguration": {"target": GATEWAY_PROTOCOL_CONFIGURATION}, - "authorizerType": { - "target": AUTHORIZER_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "authorizerConfiguration": {"target": AUTHORIZER_CONFIGURATION}, - "kmsKeyArn": {"target": KMS_KEY_ARN}, - "customTransformConfiguration": {"target": CUSTOM_TRANSFORM_CONFIGURATION}, - "interceptorConfigurations": {"target": GATEWAY_INTERCEPTOR_CONFIGURATIONS}, - "policyEngineConfiguration": {"target": GATEWAY_POLICY_ENGINE_CONFIGURATION}, - "workloadIdentityDetails": {"target": WORKLOAD_IDENTITY_DETAILS}, - "exceptionLevel": {"target": EXCEPTION_LEVEL}, - "webAclArn": {"target": WEB_ACL_ARN}, - "wafConfiguration": {"target": WAF_CONFIGURATION}, - }, -) +OPTIONAL_LOG_GROUP_NAME: StaticSchema = (3, n0, _OLGN, 0) -UPDATE_GATEWAY = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateGateway"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 202, "method": "PUT", "uri": "/gateways/{gatewayIdentifier}/"} - ), - ) - ], -) +METRICS_NAMESPACE: StaticSchema = (3, n0, _MN, 0) -MATCH_PATH_PATTERN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#MatchPathPattern"), - shape_type=ShapeType.STRING, +RESULT_DESTINATION: StaticSchema = ( + 14, + n0, + _RDe, + 0, + (_DLG, _SLG), + ((-1, {_sVm: _DLG}), (-1, {_sVm: _SLG})), ) -MATCH_PATH_PATTERNS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#MatchPathPatterns"), - shape_type=ShapeType.LIST, - members={"member": {"target": MATCH_PATH_PATTERN}}, +CLOUD_WATCH_OUTPUT_CONFIG: StaticSchema = ( + 18, + n0, + _CWOC, + 0, + (_lGNo, _mN, _rDe), + ( + (OPTIONAL_LOG_GROUP_NAME, {_smithya: _v_}), + (METRICS_NAMESPACE, 0), + (RESULT_DESTINATION, {_smithya: _DLG}), + ), ) -MATCH_PATHS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#MatchPaths"), - members={ - "anyOf": { - "target": MATCH_PATH_PATTERNS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +OUTPUT_CONFIG: StaticSchema = ( + 18, + n0, + _OC, + 0, + (_cWC,), + ((CLOUD_WATCH_OUTPUT_CONFIG, 1),), +) + +FILTER_OPERATOR: StaticSchema = ( + 14, + n0, + _FOi, + 0, + (_EQUALS, _NE, _GT, _LT, _GTOE, _LTOE, _CONTAINS, _NC_), + ( + (-1, {_sVm: _E}), + (-1, {_sVm: _NEo}), + (-1, {_sVm: _GTr}), + (-1, {_sVm: _LTe}), + (-1, {_sVm: _GTOEr}), + (-1, {_sVm: _LTOEe}), + (-1, {_sVm: _Cont}), + (-1, {_sVm: _NCo}), + ), ) -IAM_PRINCIPAL_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#IamPrincipalArn"), - shape_type=ShapeType.STRING, +FILTER_VALUE: StaticSchema = ( + 19, + n0, + _FV, + 0, + (_sVtr, _dVo, _bVo), + ((3, 0), (10, 0), (2, 0)), +) + +FILTER: StaticSchema = ( + 18, + n0, + _F, + 0, + (_k, _op, _v), + ((3, 1), (FILTER_OPERATOR, 1), (FILTER_VALUE, 1)), +) + +FILTER_LIST: StaticSchema = (16, n0, _FL, 0, (_mem,), ((FILTER, 0),)) + +SAMPLING_PERCENTAGE: StaticSchema = (10, n0, _SPa, 0) + +SAMPLING_CONFIG: StaticSchema = (18, n0, _SCa, 0, (_sPa,), ((SAMPLING_PERCENTAGE, 1),)) + +SESSION_CONFIG: StaticSchema = (18, n0, _SCes, 0, (_sTM,), ((7, 1),)) + +RULE: StaticSchema = ( + 18, + n0, + _R, + 0, + (_sCa, _fil, _sCes), + ((SAMPLING_CONFIG, 1), (FILTER_LIST, 0), (SESSION_CONFIG, 0)), +) + +CREATE_ONLINE_EVALUATION_CONFIG_INPUT: StaticSchema = ( + 18, + n0, + _COECI, + {_sSI: _cCOECR, _smit: None}, + (_cT, _oECN, _d, _rul, _dSC, _ev, _ins, _cCl, _oC, _eERA, _eOC, _t), + ( + (CLIENT_TOKEN, 2), + (EVALUATION_CONFIG_NAME, 1), + (EVALUATION_CONFIG_DESCRIPTION, 0), + (RULE, 1), + (DATA_SOURCE_CONFIG, 1), + (EVALUATOR_LIST, 0), + (INSIGHT_LIST, 0), + (CLUSTERING_CONFIG, 0), + (OUTPUT_CONFIG, 0), + (ROLE_ARN, 1), + (2, 1), + (TAGS_MAP, 0), + ), ) -PRINCIPAL_MATCH_OPERATOR = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PrincipalMatchOperator"), - shape_type=ShapeType.ENUM, - members={"StringEquals": {"target": UNIT}, "StringLike": {"target": UNIT}}, +ONLINE_EVALUATION_EXECUTION_STATUS: StaticSchema = ( + 14, + n0, + _OEES, + 0, + (_ENABLED, _DISABLED), + ((-1, {_sVm: _ENABLED}), (-1, {_sVm: _DISABLED})), +) + +ONLINE_EVALUATION_CONFIG_ARN: StaticSchema = (3, n0, _OECA, 0) + +ONLINE_EVALUATION_CONFIG_ID: StaticSchema = (3, n0, _OECI, 0) + +ONLINE_EVALUATION_CONFIG_STATUS: StaticSchema = ( + 14, + n0, + _OECS, + 0, + (_ACTIVE, _CREATING, _CF, _UPDATING, _UF, _DELETING, _ERROR), + ( + (-1, {_sVm: _ACTIVE}), + (-1, {_sVm: _CREATING}), + (-1, {_sVm: _CF}), + (-1, {_sVm: _UPDATING}), + (-1, {_sVm: _UF}), + (-1, {_sVm: _DELETING}), + (-1, {_sVm: _ERROR}), + ), ) -IAM_PRINCIPAL = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#IamPrincipal"), - members={ - "arn": { - "target": IAM_PRINCIPAL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "operator": {"target": PRINCIPAL_MATCH_OPERATOR}, - }, +CREATE_ONLINE_EVALUATION_CONFIG_OUTPUT: StaticSchema = ( + 18, + n0, + _COECO, + {_sSI: _cCOECRo, _smith: None}, + (_oECA, _oECI, _cA, _oC, _st, _eS, _fR), + ( + (ONLINE_EVALUATION_CONFIG_ARN, 1), + (ONLINE_EVALUATION_CONFIG_ID, 1), + (4, 1), + (OUTPUT_CONFIG, 0), + (ONLINE_EVALUATION_CONFIG_STATUS, 1), + (ONLINE_EVALUATION_EXECUTION_STATUS, 1), + (3, 0), + ), ) -MATCH_PRINCIPAL_ENTRY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#MatchPrincipalEntry"), - shape_type=ShapeType.UNION, - members={"iamPrincipal": {"target": IAM_PRINCIPAL}}, +CREATE_ONLINE_EVALUATION_CONFIG: StaticOperationSchema = ( + 23, + n0, + _COEC, + { + _smithy: MappingProxyType( + {"method": "POST", "uri": "/online-evaluation-configs/create", "code": 202} + ) + }, + CREATE_ONLINE_EVALUATION_CONFIG_INPUT, + CREATE_ONLINE_EVALUATION_CONFIG_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -MATCH_PRINCIPAL_ENTRIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#MatchPrincipalEntries"), - shape_type=ShapeType.LIST, - members={"member": {"target": MATCH_PRINCIPAL_ENTRY}}, +DELETE_ONLINE_EVALUATION_CONFIG_INPUT: StaticSchema = ( + 18, + n0, + _DOECI, + {_sSI: _cDOECR, _smit: None}, + (_oECI,), + ((ONLINE_EVALUATION_CONFIG_ID, 9),), +) + +DELETE_ONLINE_EVALUATION_CONFIG_OUTPUT: StaticSchema = ( + 18, + n0, + _DOECO, + {_sSI: _cDOECRo, _smith: None}, + (_oECA, _oECI, _st), + ( + (ONLINE_EVALUATION_CONFIG_ARN, 1), + (ONLINE_EVALUATION_CONFIG_ID, 1), + (ONLINE_EVALUATION_CONFIG_STATUS, 1), + ), ) -MATCH_PRINCIPALS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#MatchPrincipals"), - members={ - "anyOf": { - "target": MATCH_PRINCIPAL_ENTRIES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +DELETE_ONLINE_EVALUATION_CONFIG: StaticOperationSchema = ( + 23, + n0, + _DOEC, + { + _smithy: MappingProxyType( + { + "method": "DELETE", + "uri": "/online-evaluation-configs/{onlineEvaluationConfigId}", + "code": 202, + } + ) + }, + DELETE_ONLINE_EVALUATION_CONFIG_INPUT, + DELETE_ONLINE_EVALUATION_CONFIG_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CONDITION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#Condition"), - shape_type=ShapeType.UNION, - members={ - "matchPrincipals": {"target": MATCH_PRINCIPALS}, - "matchPaths": {"target": MATCH_PATHS}, - }, +GET_ONLINE_EVALUATION_CONFIG_INPUT: StaticSchema = ( + 18, + n0, + _GOECI, + {_sSI: _cGOECR, _smit: None}, + (_oECI,), + ((ONLINE_EVALUATION_CONFIG_ID, 9),), +) + +GET_ONLINE_EVALUATION_CONFIG_OUTPUT: StaticSchema = ( + 18, + n0, + _GOECO, + {_sSI: _cGOECRo, _smith: None}, + ( + _oECA, + _oECI, + _oECN, + _d, + _rul, + _dSC, + _ev, + _ins, + _cCl, + _oC, + _eERA, + _st, + _eS, + _cA, + _uA, + _fR, + ), + ( + (ONLINE_EVALUATION_CONFIG_ARN, 1), + (ONLINE_EVALUATION_CONFIG_ID, 1), + (EVALUATION_CONFIG_NAME, 1), + (EVALUATION_CONFIG_DESCRIPTION, 0), + (RULE, 1), + (DATA_SOURCE_CONFIG, 1), + (EVALUATOR_LIST, {_smithya: ()}), + (INSIGHT_LIST, 0), + (CLUSTERING_CONFIG, 0), + (OUTPUT_CONFIG, 0), + (ROLE_ARN, 0), + (ONLINE_EVALUATION_CONFIG_STATUS, 1), + (ONLINE_EVALUATION_EXECUTION_STATUS, 1), + (4, 1), + (4, 1), + (3, 0), + ), ) -CONDITIONS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#Conditions"), - shape_type=ShapeType.LIST, - members={"member": {"target": CONDITION}}, +GET_ONLINE_EVALUATION_CONFIG: StaticOperationSchema = ( + 23, + n0, + _GOEC, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/online-evaluation-configs/{onlineEvaluationConfigId}", + } + ) + }, + GET_ONLINE_EVALUATION_CONFIG_INPUT, + GET_ONLINE_EVALUATION_CONFIG_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -GATEWAY_RULE_DESCRIPTION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GatewayRuleDescription"), - shape_type=ShapeType.STRING, +LIST_ONLINE_EVALUATION_CONFIGS_INPUT: StaticSchema = ( + 18, + n0, + _LOECI, + {_sSI: _cLOECR, _smit: None}, + (_nT, _mR), + ((3, {_sQ: _nT}), (7, {_sQ: _mR})), +) + +ONLINE_EVALUATION_CONFIG_SUMMARY: StaticSchema = ( + 18, + n0, + _OECSn, + 0, + (_oECA, _oECI, _oECN, _d, _st, _eS, _cA, _uA, _fR, _ins, _cCl), + ( + (ONLINE_EVALUATION_CONFIG_ARN, 1), + (ONLINE_EVALUATION_CONFIG_ID, 1), + (EVALUATION_CONFIG_NAME, 1), + (EVALUATION_CONFIG_DESCRIPTION, 0), + (ONLINE_EVALUATION_CONFIG_STATUS, 1), + (ONLINE_EVALUATION_EXECUTION_STATUS, 1), + (4, 1), + (4, 1), + (3, 0), + (INSIGHT_LIST, 0), + (CLUSTERING_CONFIG, 0), + ), ) -GATEWAY_RULE_PRIORITY = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GatewayRulePriority"), - shape_type=ShapeType.INTEGER, +ONLINE_EVALUATION_CONFIG_SUMMARY_LIST: StaticSchema = ( + 16, + n0, + _OECSL, + 0, + (_mem,), + ((ONLINE_EVALUATION_CONFIG_SUMMARY, 0),), +) + +LIST_ONLINE_EVALUATION_CONFIGS_OUTPUT: StaticSchema = ( + 18, + n0, + _LOECO, + {_sSI: _cLOECRo, _smith: None}, + (_oEC, _nT), + ((ONLINE_EVALUATION_CONFIG_SUMMARY_LIST, 1), (3, 0)), +) + +LIST_ONLINE_EVALUATION_CONFIGS: StaticOperationSchema = ( + 23, + n0, + _LOEC, + { + _smithy: MappingProxyType( + {"method": "POST", "uri": "/online-evaluation-configs"} + ) + }, + LIST_ONLINE_EVALUATION_CONFIGS_INPUT, + LIST_ONLINE_EVALUATION_CONFIGS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CREATE_GATEWAY_RULE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateGatewayRuleInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreateGatewayRuleRequest", - ) - ], - members={ - "gatewayIdentifier": { - "target": GATEWAY_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "priority": { - "target": GATEWAY_RULE_PRIORITY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "conditions": {"target": CONDITIONS}, - "actions": { - "target": ACTIONS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": GATEWAY_RULE_DESCRIPTION}, - }, +UPDATE_ONLINE_EVALUATION_CONFIG_INPUT: StaticSchema = ( + 18, + n0, + _UOECI, + {_sSI: _cUOECR, _smit: None}, + (_cT, _oECI, _d, _rul, _dSC, _ev, _ins, _cCl, _oC, _eERA, _eS), + ( + (CLIENT_TOKEN, 2), + (ONLINE_EVALUATION_CONFIG_ID, 9), + (EVALUATION_CONFIG_DESCRIPTION, 0), + (RULE, 0), + (DATA_SOURCE_CONFIG, 0), + (EVALUATOR_LIST, 0), + (INSIGHT_LIST, 0), + (CLUSTERING_CONFIG, 0), + (OUTPUT_CONFIG, 0), + (ROLE_ARN, 0), + (ONLINE_EVALUATION_EXECUTION_STATUS, 0), + ), ) -GATEWAY_RULE_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GatewayRuleId"), - shape_type=ShapeType.STRING, +UPDATE_ONLINE_EVALUATION_CONFIG_OUTPUT: StaticSchema = ( + 18, + n0, + _UOECO, + {_sSI: _cUOECRo, _smith: None}, + (_oECA, _oECI, _uA, _st, _eS, _fR), + ( + (ONLINE_EVALUATION_CONFIG_ARN, 1), + (ONLINE_EVALUATION_CONFIG_ID, 1), + (4, 1), + (ONLINE_EVALUATION_CONFIG_STATUS, 1), + (ONLINE_EVALUATION_EXECUTION_STATUS, 1), + (3, 0), + ), ) -GATEWAY_RULE_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GatewayRuleStatus"), - shape_type=ShapeType.ENUM, - members={ - "CREATING": {"target": UNIT}, - "ACTIVE": {"target": UNIT}, - "UPDATING": {"target": UNIT}, - "DELETING": {"target": UNIT}, - }, +UPDATE_ONLINE_EVALUATION_CONFIG: StaticOperationSchema = ( + 23, + n0, + _UOEC, + { + _smithy: MappingProxyType( + { + "method": "PUT", + "uri": "/online-evaluation-configs/{onlineEvaluationConfigId}", + "code": 202, + } + ) + }, + UPDATE_ONLINE_EVALUATION_CONFIG_INPUT, + UPDATE_ONLINE_EVALUATION_CONFIG_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -SYSTEM_MANAGED_BLOCK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SystemManagedBlock"), - members={ - "managedBy": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +PAYMENT_CREDENTIAL_PROVIDER_VENDOR_TYPE: StaticSchema = ( + 14, + n0, + _PCPVT, + 0, + (_CCDP, _SPt), + ((-1, {_sVm: _CCDP}), (-1, {_sVm: _SPt})), ) -CREATE_GATEWAY_RULE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateGatewayRuleOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreateGatewayRuleResponse", - ) - ], - members={ - "ruleId": { - "target": GATEWAY_RULE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "gatewayArn": { - "target": GATEWAY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "priority": { - "target": GATEWAY_RULE_PRIORITY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "conditions": {"target": CONDITIONS}, - "actions": { - "target": ACTIONS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": GATEWAY_RULE_DESCRIPTION}, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": GATEWAY_RULE_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "system": {"target": SYSTEM_MANAGED_BLOCK}, - }, -) +COINBASE_CDP_API_KEY_ID_TYPE: StaticSchema = (3, n0, _CCAKIT, 0) -CREATE_GATEWAY_RULE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateGatewayRule"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 202, - "method": "POST", - "uri": "/gateways/{gatewayIdentifier}/rules", - } - ), - ) - ], -) +DEFAULT_COINBASE_CDP_API_KEY_SECRET_TYPE: StaticSchema = (3, n0, _DCCAKST, 4) -DELETE_GATEWAY_RULE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteGatewayRuleInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeleteGatewayRuleRequest", - ) - ], - members={ - "gatewayIdentifier": { - "target": GATEWAY_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "ruleId": { - "target": GATEWAY_RULE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, +DEFAULT_COINBASE_CDP_WALLET_SECRET_TYPE: StaticSchema = (3, n0, _DCCWST, 4) + +COINBASE_CDP_CONFIGURATION_INPUT: StaticSchema = ( + 18, + n0, + _CCCIo, + 0, + (_aKI, _aKS, _aKSS, _aKSC, _wS, _wSS, _wSC), + ( + (COINBASE_CDP_API_KEY_ID_TYPE, 1), + (DEFAULT_COINBASE_CDP_API_KEY_SECRET_TYPE, {_smithya: _v_}), + (SECRET_SOURCE_TYPE, 0), + (SECRET_REFERENCE, 0), + (DEFAULT_COINBASE_CDP_WALLET_SECRET_TYPE, {_smithya: _v_}), + (SECRET_SOURCE_TYPE, 0), + (SECRET_REFERENCE, 0), + ), ) -DELETE_GATEWAY_RULE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteGatewayRuleOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeleteGatewayRuleResponse", - ) - ], - members={ - "ruleId": { - "target": GATEWAY_RULE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": GATEWAY_RULE_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +STRIPE_PRIVY_APP_ID_TYPE: StaticSchema = (3, n0, _SPAIT, 0) + +DEFAULT_STRIPE_PRIVY_APP_SECRET_TYPE: StaticSchema = (3, n0, _DSPAST, 4) + +STRIPE_PRIVY_AUTHORIZATION_ID_TYPE: StaticSchema = (3, n0, _SPAITt, 0) + +DEFAULT_STRIPE_PRIVY_AUTHORIZATION_PRIVATE_KEY_TYPE: StaticSchema = (3, n0, _DSPAPKT, 4) + +STRIPE_PRIVY_CONFIGURATION_INPUT: StaticSchema = ( + 18, + n0, + _SPCI, + 0, + (_aIp, _aSp, _aSS, _aSC, _aPK, _aPKS, _aPKC, _aIu), + ( + (STRIPE_PRIVY_APP_ID_TYPE, 1), + (DEFAULT_STRIPE_PRIVY_APP_SECRET_TYPE, {_smithya: _v_}), + (SECRET_SOURCE_TYPE, 0), + (SECRET_REFERENCE, 0), + (DEFAULT_STRIPE_PRIVY_AUTHORIZATION_PRIVATE_KEY_TYPE, {_smithya: _v_}), + (SECRET_SOURCE_TYPE, 0), + (SECRET_REFERENCE, 0), + (STRIPE_PRIVY_AUTHORIZATION_ID_TYPE, 1), + ), ) -DELETE_GATEWAY_RULE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteGatewayRule"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 202, - "method": "DELETE", - "uri": "/gateways/{gatewayIdentifier}/rules/{ruleId}", - } - ), - ) - ], +PAYMENT_PROVIDER_CONFIGURATION_INPUT: StaticSchema = ( + 19, + n0, + _PPCI, + 0, + (_cCCo, _sPC), + ((COINBASE_CDP_CONFIGURATION_INPUT, 0), (STRIPE_PRIVY_CONFIGURATION_INPUT, 0)), +) + +CREATE_PAYMENT_CREDENTIAL_PROVIDER_INPUT: StaticSchema = ( + 18, + n0, + _CPCPI, + {_sSI: _cCPCPR, _smit: None}, + (_n, _cPVr, _pCI, _t), + ( + (CREDENTIAL_PROVIDER_NAME, 1), + (PAYMENT_CREDENTIAL_PROVIDER_VENDOR_TYPE, 1), + (PAYMENT_PROVIDER_CONFIGURATION_INPUT, 1), + (TAGS_MAP, 0), + ), ) -GET_GATEWAY_RULE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetGatewayRuleInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetGatewayRuleRequest", - ) - ], - members={ - "gatewayIdentifier": { - "target": GATEWAY_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "ruleId": { - "target": GATEWAY_RULE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, +PAYMENT_CREDENTIAL_PROVIDER_ARN_TYPE: StaticSchema = (3, n0, _PCPAT, 0) + +COINBASE_CDP_CONFIGURATION_OUTPUT: StaticSchema = ( + 18, + n0, + _CCCO, + 0, + (_aKI, _aKSA, _aKSJK, _aKSS, _wSA, _wSJK, _wSS), + ( + (COINBASE_CDP_API_KEY_ID_TYPE, 1), + (SECRET, 1), + (SECRET_JSON_KEY_TYPE, 0), + (SECRET_SOURCE_TYPE, 0), + (SECRET, 1), + (SECRET_JSON_KEY_TYPE, 0), + (SECRET_SOURCE_TYPE, 0), + ), ) -GET_GATEWAY_RULE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetGatewayRuleOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetGatewayRuleResponse", - ) - ], - members={ - "ruleId": { - "target": GATEWAY_RULE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "gatewayArn": { - "target": GATEWAY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "priority": { - "target": GATEWAY_RULE_PRIORITY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "conditions": {"target": CONDITIONS}, - "actions": { - "target": ACTIONS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": GATEWAY_RULE_DESCRIPTION}, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": GATEWAY_RULE_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "system": {"target": SYSTEM_MANAGED_BLOCK}, - "updatedAt": {"target": DATE_TIMESTAMP}, - }, +STRIPE_PRIVY_CONFIGURATION_OUTPUT: StaticSchema = ( + 18, + n0, + _SPCO, + 0, + (_aIp, _aSA, _aSJK, _aSS, _aPKA, _aPKJK, _aPKS, _aIu), + ( + (STRIPE_PRIVY_APP_ID_TYPE, 1), + (SECRET, 1), + (SECRET_JSON_KEY_TYPE, 0), + (SECRET_SOURCE_TYPE, 0), + (SECRET, 1), + (SECRET_JSON_KEY_TYPE, 0), + (SECRET_SOURCE_TYPE, 0), + (STRIPE_PRIVY_AUTHORIZATION_ID_TYPE, 1), + ), ) -GET_GATEWAY_RULE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetGatewayRule"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/gateways/{gatewayIdentifier}/rules/{ruleId}", - } - ), - ) - ], +PAYMENT_PROVIDER_CONFIGURATION_OUTPUT: StaticSchema = ( + 19, + n0, + _PPCO, + 0, + (_cCCo, _sPC), + ((COINBASE_CDP_CONFIGURATION_OUTPUT, 0), (STRIPE_PRIVY_CONFIGURATION_OUTPUT, 0)), +) + +CREATE_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT: StaticSchema = ( + 18, + n0, + _CPCPO, + {_sSI: _cCPCPRo, _smith: None}, + (_n, _cPVr, _cPAr, _pCO), + ( + (CREDENTIAL_PROVIDER_NAME, 1), + (PAYMENT_CREDENTIAL_PROVIDER_VENDOR_TYPE, 1), + (PAYMENT_CREDENTIAL_PROVIDER_ARN_TYPE, 1), + (PAYMENT_PROVIDER_CONFIGURATION_OUTPUT, 1), + ), ) -GATEWAY_RULE_MAX_RESULTS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GatewayRuleMaxResults"), - shape_type=ShapeType.INTEGER, +CREATE_PAYMENT_CREDENTIAL_PROVIDER: StaticOperationSchema = ( + 23, + n0, + _CPCP, + { + _smithy: MappingProxyType( + { + "code": 201, + "uri": "/identities/CreatePaymentCredentialProvider", + "method": "POST", + } + ) + }, + CREATE_PAYMENT_CREDENTIAL_PROVIDER_INPUT, + CREATE_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + DECRYPTION_FAILURE, + ENCRYPTION_FAILURE, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_LIMIT_EXCEEDED_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -GATEWAY_RULE_NEXT_TOKEN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GatewayRuleNextToken"), - shape_type=ShapeType.STRING, +DELETE_PAYMENT_CREDENTIAL_PROVIDER_INPUT: StaticSchema = ( + 18, + n0, + _DPCPI, + {_sSI: _cDPCPR, _smit: None}, + (_n,), + ((CREDENTIAL_PROVIDER_NAME, 1),), +) + +DELETE_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT: StaticSchema = ( + 18, + n0, + _DPCPO, + {_sSI: _cDPCPRo, _smith: None}, +) + +DELETE_PAYMENT_CREDENTIAL_PROVIDER: StaticOperationSchema = ( + 23, + n0, + _DPCP, + { + _smithy: MappingProxyType( + { + "code": 204, + "uri": "/identities/DeletePaymentCredentialProvider", + "method": "POST", + } + ) + }, + DELETE_PAYMENT_CREDENTIAL_PROVIDER_INPUT, + DELETE_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -LIST_GATEWAY_RULES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListGatewayRulesInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListGatewayRulesRequest", - ) - ], - members={ - "gatewayIdentifier": { - "target": GATEWAY_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "maxResults": { - "target": GATEWAY_RULE_MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "nextToken": { - "target": GATEWAY_RULE_NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - }, +GET_PAYMENT_CREDENTIAL_PROVIDER_INPUT: StaticSchema = ( + 18, + n0, + _GPCPI, + {_sSI: _cGPCPR, _smit: None}, + (_n,), + ((CREDENTIAL_PROVIDER_NAME, 1),), +) + +GET_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT: StaticSchema = ( + 18, + n0, + _GPCPO, + {_sSI: _cGPCPRo, _smith: None}, + (_n, _cPAr, _cPVr, _pCO, _cTr, _lUT, _t), + ( + (CREDENTIAL_PROVIDER_NAME, 1), + (PAYMENT_CREDENTIAL_PROVIDER_ARN_TYPE, 1), + (PAYMENT_CREDENTIAL_PROVIDER_VENDOR_TYPE, 1), + (PAYMENT_PROVIDER_CONFIGURATION_OUTPUT, 1), + (4, 1), + (4, 1), + (TAGS_MAP, 0), + ), ) -GATEWAY_RULE_DETAIL = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GatewayRuleDetail"), - members={ - "ruleId": { - "target": GATEWAY_RULE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "gatewayArn": { - "target": GATEWAY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "priority": { - "target": GATEWAY_RULE_PRIORITY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "conditions": {"target": CONDITIONS}, - "actions": { - "target": ACTIONS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": GATEWAY_RULE_DESCRIPTION}, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": GATEWAY_RULE_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "system": {"target": SYSTEM_MANAGED_BLOCK}, - "updatedAt": {"target": DATE_TIMESTAMP}, - }, +GET_PAYMENT_CREDENTIAL_PROVIDER: StaticOperationSchema = ( + 23, + n0, + _GPCP, + { + _smithy: MappingProxyType( + {"uri": "/identities/GetPaymentCredentialProvider", "method": "POST"} + ) + }, + GET_PAYMENT_CREDENTIAL_PROVIDER_INPUT, + GET_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + DECRYPTION_FAILURE, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -GATEWAY_RULES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GatewayRules"), - shape_type=ShapeType.LIST, - members={"member": {"target": GATEWAY_RULE_DETAIL}}, +LIST_PAYMENT_CREDENTIAL_PROVIDERS_INPUT: StaticSchema = ( + 18, + n0, + _LPCPI, + {_sSI: _cLPCPR, _smit: None}, + (_nT, _mR), + ((3, 0), (7, {_smithya: 10})), +) + +PAYMENT_CREDENTIAL_PROVIDER_ITEM: StaticSchema = ( + 18, + n0, + _PCPI, + 0, + (_n, _cPVr, _cPAr, _cTr, _lUT), + ( + (CREDENTIAL_PROVIDER_NAME, 1), + (PAYMENT_CREDENTIAL_PROVIDER_VENDOR_TYPE, 1), + (PAYMENT_CREDENTIAL_PROVIDER_ARN_TYPE, 1), + (4, 1), + (4, 1), + ), ) -LIST_GATEWAY_RULES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListGatewayRulesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListGatewayRulesResponse", - ) - ], - members={ - "gatewayRules": { - "target": GATEWAY_RULES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": GATEWAY_RULE_NEXT_TOKEN}, - }, +PAYMENT_CREDENTIAL_PROVIDERS: StaticSchema = ( + 16, + n0, + _PCP, + 0, + (_mem,), + ((PAYMENT_CREDENTIAL_PROVIDER_ITEM, 0),), +) + +LIST_PAYMENT_CREDENTIAL_PROVIDERS_OUTPUT: StaticSchema = ( + 18, + n0, + _LPCPO, + {_sSI: _cLPCPRo, _smith: None}, + (_cP, _nT), + ((PAYMENT_CREDENTIAL_PROVIDERS, 1), (3, 0)), +) + +LIST_PAYMENT_CREDENTIAL_PROVIDERS: StaticOperationSchema = ( + 23, + n0, + _LPCP, + { + _smithy: MappingProxyType( + {"uri": "/identities/ListPaymentCredentialProviders", "method": "POST"} + ) + }, + LIST_PAYMENT_CREDENTIAL_PROVIDERS_INPUT, + LIST_PAYMENT_CREDENTIAL_PROVIDERS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -LIST_GATEWAY_RULES = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListGatewayRules"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/gateways/{gatewayIdentifier}/rules", - } - ), - ) - ], +UPDATE_PAYMENT_CREDENTIAL_PROVIDER_INPUT: StaticSchema = ( + 18, + n0, + _UPCPI, + {_sSI: _cUPCPR, _smit: None}, + (_n, _cPVr, _pCI), + ( + (CREDENTIAL_PROVIDER_NAME, 1), + (PAYMENT_CREDENTIAL_PROVIDER_VENDOR_TYPE, 1), + (PAYMENT_PROVIDER_CONFIGURATION_INPUT, 1), + ), ) -UPDATE_GATEWAY_RULE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateGatewayRuleInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UpdateGatewayRuleRequest", - ) - ], - members={ - "gatewayIdentifier": { - "target": GATEWAY_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "ruleId": { - "target": GATEWAY_RULE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "priority": {"target": GATEWAY_RULE_PRIORITY}, - "conditions": {"target": CONDITIONS}, - "actions": {"target": ACTIONS}, - "description": {"target": GATEWAY_RULE_DESCRIPTION}, - }, +UPDATE_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT: StaticSchema = ( + 18, + n0, + _UPCPO, + {_sSI: _cUPCPRo, _smith: None}, + (_n, _cPVr, _cPAr, _pCO, _cTr, _lUT), + ( + (CREDENTIAL_PROVIDER_NAME, 1), + (PAYMENT_CREDENTIAL_PROVIDER_VENDOR_TYPE, 1), + (PAYMENT_CREDENTIAL_PROVIDER_ARN_TYPE, 1), + (PAYMENT_PROVIDER_CONFIGURATION_OUTPUT, 1), + (4, 1), + (4, 1), + ), ) -UPDATE_GATEWAY_RULE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateGatewayRuleOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UpdateGatewayRuleResponse", - ) - ], - members={ - "ruleId": { - "target": GATEWAY_RULE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "gatewayArn": { - "target": GATEWAY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "priority": { - "target": GATEWAY_RULE_PRIORITY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "conditions": {"target": CONDITIONS}, - "actions": { - "target": ACTIONS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": GATEWAY_RULE_DESCRIPTION}, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": GATEWAY_RULE_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "system": {"target": SYSTEM_MANAGED_BLOCK}, - "updatedAt": {"target": DATE_TIMESTAMP}, - }, +UPDATE_PAYMENT_CREDENTIAL_PROVIDER: StaticOperationSchema = ( + 23, + n0, + _UPCP, + { + _smithy: MappingProxyType( + {"uri": "/identities/UpdatePaymentCredentialProvider", "method": "POST"} + ) + }, + UPDATE_PAYMENT_CREDENTIAL_PROVIDER_INPUT, + UPDATE_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + DECRYPTION_FAILURE, + ENCRYPTION_FAILURE, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -UPDATE_GATEWAY_RULE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateGatewayRule"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 202, - "method": "PATCH", - "uri": "/gateways/{gatewayIdentifier}/rules/{ruleId}", - } - ), - ) - ], +PAYMENTS_AUTHORIZER_TYPE: StaticSchema = ( + 14, + n0, + _PAT, + 0, + (_CJ, _AI), + ((-1, {_sVm: _CJ}), (-1, {_sVm: _AI})), +) + +PAYMENTS_DESCRIPTION: StaticSchema = (3, n0, _PD, 0) + +PAYMENT_MANAGER_NAME: StaticSchema = (3, n0, _PMN, 0) + +CREATE_PAYMENT_MANAGER_INPUT: StaticSchema = ( + 18, + n0, + _CPMI, + {_sSI: _cCPMR, _smit: None}, + (_n, _d, _aT, _aCu, _rA, _cT, _t, _kKA), + ( + (PAYMENT_MANAGER_NAME, 1), + (PAYMENTS_DESCRIPTION, 0), + (PAYMENTS_AUTHORIZER_TYPE, 1), + (AUTHORIZER_CONFIGURATION, 0), + (ROLE_ARN, 1), + (CLIENT_TOKEN, 2), + (TAGS_MAP, 0), + (KMS_KEY_ARN, 0), + ), ) -CERTIFICATE_BUCKET_OWNER_ACCOUNT_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CertificateBucketOwnerAccountId"), - shape_type=ShapeType.STRING, +PAYMENT_MANAGER_ARN: StaticSchema = (3, n0, _PMA, 0) + +PAYMENT_MANAGER_ID: StaticSchema = (3, n0, _PMI, 0) + +PAYMENT_MANAGER_STATUS: StaticSchema = ( + 14, + n0, + _PMS, + 0, + (_CREATING, _UPDATING, _DELETING, _READY, _CF, _UF, _DF), + ( + (-1, {_sVm: _CREATING}), + (-1, {_sVm: _UPDATING}), + (-1, {_sVm: _DELETING}), + (-1, {_sVm: _READY}), + (-1, {_sVm: _CF}), + (-1, {_sVm: _UF}), + (-1, {_sVm: _DF}), + ), ) -CERTIFICATE_S3_URI = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CertificateS3Uri"), - shape_type=ShapeType.STRING, +CREATE_PAYMENT_MANAGER_OUTPUT: StaticSchema = ( + 18, + n0, + _CPMO, + {_sSI: _cCPMRo, _smith: None}, + (_pMA, _pMI, _n, _aT, _aCu, _rA, _wID, _cA, _st, _t, _kKA), + ( + (PAYMENT_MANAGER_ARN, 1), + (PAYMENT_MANAGER_ID, 1), + (PAYMENT_MANAGER_NAME, 1), + (PAYMENTS_AUTHORIZER_TYPE, 1), + (AUTHORIZER_CONFIGURATION, 0), + (ROLE_ARN, 1), + (WORKLOAD_IDENTITY_DETAILS, 0), + (DATE_TIMESTAMP, 1), + (PAYMENT_MANAGER_STATUS, 1), + (TAGS_MAP, 0), + (KMS_KEY_ARN, 0), + ), ) -S3_CERTIFICATE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#S3CertificateConfiguration"), - members={ - "uri": { - "target": CERTIFICATE_S3_URI, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "bucketOwnerAccountId": {"target": CERTIFICATE_BUCKET_OWNER_ACCOUNT_ID}, - }, +CREATE_PAYMENT_MANAGER: StaticOperationSchema = ( + 23, + n0, + _CPM, + { + _smithy: MappingProxyType( + {"code": 202, "method": "POST", "uri": "/payments/managers"} + ) + }, + CREATE_PAYMENT_MANAGER_INPUT, + CREATE_PAYMENT_MANAGER_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CERTIFICATE_SECRET_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CertificateSecretArn"), - shape_type=ShapeType.STRING, +DELETE_PAYMENT_MANAGER_INPUT: StaticSchema = ( + 18, + n0, + _DPMI, + {_sSI: _cDPMR, _smit: None}, + (_pMI, _cT), + ((PAYMENT_MANAGER_ID, 9), (CLIENT_TOKEN, {_sQ: _cT, _sT: None})), +) + +DELETE_PAYMENT_MANAGER_OUTPUT: StaticSchema = ( + 18, + n0, + _DPMO, + {_sSI: _cDPMRo, _smith: None}, + (_st, _pMI), + ((PAYMENT_MANAGER_STATUS, 1), (PAYMENT_MANAGER_ID, 0)), +) + +DELETE_PAYMENT_MANAGER: StaticOperationSchema = ( + 23, + n0, + _DPM, + { + _smithy: MappingProxyType( + { + "code": 202, + "method": "DELETE", + "uri": "/payments/managers/{paymentManagerId}", + } + ) + }, + DELETE_PAYMENT_MANAGER_INPUT, + DELETE_PAYMENT_MANAGER_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + ), ) -SECRETS_MANAGER_CERTIFICATE_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#SecretsManagerCertificateConfiguration" +GET_PAYMENT_MANAGER_INPUT: StaticSchema = ( + 18, + n0, + _GPMI, + {_sSI: _cGPMR, _smit: None}, + (_pMI,), + ((PAYMENT_MANAGER_ID, 9),), +) + +GET_PAYMENT_MANAGER_OUTPUT: StaticSchema = ( + 18, + n0, + _GPMO, + {_sSI: _cGPMRo, _smith: None}, + (_pMA, _pMI, _n, _d, _aT, _aCu, _rA, _wID, _cA, _lUA, _st, _t, _kKA), + ( + (PAYMENT_MANAGER_ARN, 1), + (PAYMENT_MANAGER_ID, 1), + (PAYMENT_MANAGER_NAME, 1), + (PAYMENTS_DESCRIPTION, 0), + (PAYMENTS_AUTHORIZER_TYPE, 1), + (AUTHORIZER_CONFIGURATION, 0), + (ROLE_ARN, 1), + (WORKLOAD_IDENTITY_DETAILS, 0), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (PAYMENT_MANAGER_STATUS, 1), + (TAGS_MAP, 0), + (KMS_KEY_ARN, 0), ), - members={ - "secretArn": { - "target": CERTIFICATE_SECRET_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, ) -CERTIFICATE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CertificateConfiguration"), - shape_type=ShapeType.UNION, - members={ - "s3": {"target": S3_CERTIFICATE_CONFIGURATION}, - "secretsManager": {"target": SECRETS_MANAGER_CERTIFICATE_CONFIGURATION}, - }, +GET_PAYMENT_MANAGER: StaticOperationSchema = ( + 23, + n0, + _GPM, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "GET", + "uri": "/payments/managers/{paymentManagerId}", + } + ) + }, + GET_PAYMENT_MANAGER_INPUT, + GET_PAYMENT_MANAGER_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CERTIFICATE_CONFIGURATION_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CertificateConfigurationList"), - shape_type=ShapeType.LIST, - members={"member": {"target": CERTIFICATE_CONFIGURATION}}, +LIST_PAYMENT_MANAGERS_INPUT: StaticSchema = ( + 18, + n0, + _LPMI, + {_sSI: _cLPMR, _smit: None}, + (_mR, _nT), + ((MAX_RESULTS, {_sQ: _mR}), (NEXT_TOKEN, {_sQ: _nT})), +) + +PAYMENT_MANAGER_SUMMARY: StaticSchema = ( + 18, + n0, + _PMSa, + 0, + (_pMA, _pMI, _n, _d, _aT, _rA, _st, _cA, _lUA, _kKA), + ( + (PAYMENT_MANAGER_ARN, 1), + (PAYMENT_MANAGER_ID, 1), + (PAYMENT_MANAGER_NAME, 1), + (PAYMENTS_DESCRIPTION, 0), + (PAYMENTS_AUTHORIZER_TYPE, 1), + (ROLE_ARN, 1), + (PAYMENT_MANAGER_STATUS, 1), + (DATE_TIMESTAMP, 0), + (DATE_TIMESTAMP, 1), + (KMS_KEY_ARN, 0), + ), ) -API_KEY_CREDENTIAL_LOCATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ApiKeyCredentialLocation"), - shape_type=ShapeType.ENUM, - members={"HEADER": {"target": UNIT}, "QUERY_PARAMETER": {"target": UNIT}}, +PAYMENT_MANAGER_SUMMARIES: StaticSchema = ( + 16, + n0, + _PMSay, + 0, + (_mem,), + ((PAYMENT_MANAGER_SUMMARY, 0),), +) + +LIST_PAYMENT_MANAGERS_OUTPUT: StaticSchema = ( + 18, + n0, + _LPMO, + {_sSI: _cLPMRo, _smith: None}, + (_pM, _nT), + ((PAYMENT_MANAGER_SUMMARIES, 1), (NEXT_TOKEN, 0)), +) + +LIST_PAYMENT_MANAGERS: StaticOperationSchema = ( + 23, + n0, + _LPM, + { + _smithy: MappingProxyType( + {"code": 200, "method": "POST", "uri": "/payments/managers-list"} + ) + }, + LIST_PAYMENT_MANAGERS_INPUT, + LIST_PAYMENT_MANAGERS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -API_KEY_CREDENTIAL_PARAMETER_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ApiKeyCredentialParameterName"), - shape_type=ShapeType.STRING, +PAYMENT_CREDENTIAL_PROVIDER_ARN: StaticSchema = (3, n0, _PCPA, 0) + +PAYMENT_CREDENTIAL_PROVIDER_CONFIGURATION: StaticSchema = ( + 18, + n0, + _PCPC, + 0, + (_cPAr,), + ((PAYMENT_CREDENTIAL_PROVIDER_ARN, 1),), ) -API_KEY_CREDENTIAL_PREFIX = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ApiKeyCredentialPrefix"), - shape_type=ShapeType.STRING, +CREDENTIALS_PROVIDER_CONFIGURATION: StaticSchema = ( + 19, + n0, + _CPCred, + 0, + (_cCDP, _sPt), + ( + (PAYMENT_CREDENTIAL_PROVIDER_CONFIGURATION, 0), + (PAYMENT_CREDENTIAL_PROVIDER_CONFIGURATION, 0), + ), ) -API_KEY_CREDENTIAL_PROVIDER_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ApiKeyCredentialProviderArn"), - shape_type=ShapeType.STRING, +CREDENTIALS_PROVIDER_CONFIGURATIONS: StaticSchema = ( + 16, + n0, + _CPCrede, + 0, + (_mem,), + ((CREDENTIALS_PROVIDER_CONFIGURATION, 0),), +) + +PAYMENT_CONNECTOR_NAME: StaticSchema = (3, n0, _PCN, 0) + +PAYMENT_CONNECTOR_PROVISION_MODE: StaticSchema = ( + 14, + n0, + _PCPM, + 0, + (_MANUAL, _QC), + ((-1, {_sVm: _MANUAL}), (-1, {_sVm: _QC})), +) + +PAYMENT_CONNECTOR_TYPE: StaticSchema = ( + 14, + n0, + _PCT, + 0, + (_CC___, _SP_), + ((-1, {_sVm: _CCDP}), (-1, {_sVm: _SPt})), +) + +CREATE_PAYMENT_CONNECTOR_INPUT: StaticSchema = ( + 18, + n0, + _CPCI, + {_sSI: _cCPCR, _smit: None}, + (_pMI, _n, _d, _ty, _cPCr, _pMr, _cT), + ( + (PAYMENT_MANAGER_ID, 9), + (PAYMENT_CONNECTOR_NAME, 1), + (PAYMENTS_DESCRIPTION, 0), + (PAYMENT_CONNECTOR_TYPE, 1), + (CREDENTIALS_PROVIDER_CONFIGURATIONS, 1), + (PAYMENT_CONNECTOR_PROVISION_MODE, 0), + (CLIENT_TOKEN, 2), + ), ) -GATEWAY_API_KEY_CREDENTIAL_PROVIDER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GatewayApiKeyCredentialProvider"), - members={ - "providerArn": { - "target": API_KEY_CREDENTIAL_PROVIDER_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "credentialParameterName": {"target": API_KEY_CREDENTIAL_PARAMETER_NAME}, - "credentialPrefix": {"target": API_KEY_CREDENTIAL_PREFIX}, - "credentialLocation": {"target": API_KEY_CREDENTIAL_LOCATION}, - }, +PAYMENT_CONNECTOR_AUTHORIZATION_URL: StaticSchema = (3, n0, _PCAU, 0) + +PAYMENT_CONNECTOR_ID: StaticSchema = (3, n0, _PCI, 0) + +PAYMENT_CONNECTOR_STATUS: StaticSchema = ( + 14, + n0, + _PCS, + 0, + ( + _CREATING, + _UPDATING, + _DELETING, + _READY, + _CF, + _UF, + _DF, + _AMSR, + _PA, + _PROVISIONING, + _AE_, + _AF, + ), + ( + (-1, {_sVm: _CREATING}), + (-1, {_sVm: _UPDATING}), + (-1, {_sVm: _DELETING}), + (-1, {_sVm: _READY}), + (-1, {_sVm: _CF}), + (-1, {_sVm: _UF}), + (-1, {_sVm: _DF}), + (-1, {_sVm: _AMSR}), + (-1, {_sVm: _PA}), + (-1, {_sVm: _PROVISIONING}), + (-1, {_sVm: _AE_}), + (-1, {_sVm: _AF}), + ), ) -IAM_CREDENTIAL_PROVIDER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#IamCredentialProvider"), - members={ - "service": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "region": {"target": _STRING}, - }, +CREATE_PAYMENT_CONNECTOR_OUTPUT: StaticSchema = ( + 18, + n0, + _CPCO, + {_sSI: _cCPCRo, _smith: None}, + (_pCIa, _pMI, _n, _ty, _cPCr, _cA, _st, _aU), + ( + (PAYMENT_CONNECTOR_ID, 1), + (PAYMENT_MANAGER_ID, 1), + (PAYMENT_CONNECTOR_NAME, 1), + (PAYMENT_CONNECTOR_TYPE, 1), + (CREDENTIALS_PROVIDER_CONFIGURATIONS, 1), + (DATE_TIMESTAMP, 1), + (PAYMENT_CONNECTOR_STATUS, 1), + (PAYMENT_CONNECTOR_AUTHORIZATION_URL, 0), + ), ) -O_AUTH_CUSTOM_PARAMETERS_KEY = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#OAuthCustomParametersKey"), - shape_type=ShapeType.STRING, +SUBSCRIPTION_REQUIRED_EXCEPTION: StaticSchema = ( + 18, + n0, + _SRE, + {_s: _c, _sE: 403}, + (_m, _sUu, _pN), + ((3, 1), (3, 0), (3, 0)), +) + +CREATE_PAYMENT_CONNECTOR: StaticOperationSchema = ( + 23, + n0, + _CPCrea, + { + _smithy: MappingProxyType( + { + "code": 202, + "method": "POST", + "uri": "/payments/managers/{paymentManagerId}/connectors", + } + ) + }, + CREATE_PAYMENT_CONNECTOR_INPUT, + CREATE_PAYMENT_CONNECTOR_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + SUBSCRIPTION_REQUIRED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -O_AUTH_CUSTOM_PARAMETERS_VALUE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#OAuthCustomParametersValue"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +DELETE_PAYMENT_CONNECTOR_INPUT: StaticSchema = ( + 18, + n0, + _DPCI, + {_sSI: _cDPCR, _smit: None}, + (_pMI, _pCIa, _cT), + ( + (PAYMENT_MANAGER_ID, 9), + (PAYMENT_CONNECTOR_ID, 9), + (CLIENT_TOKEN, {_sQ: _cT, _sT: None}), + ), ) -O_AUTH_CUSTOM_PARAMETERS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#OAuthCustomParameters"), - shape_type=ShapeType.MAP, - members={ - "key": {"target": O_AUTH_CUSTOM_PARAMETERS_KEY}, - "value": {"target": O_AUTH_CUSTOM_PARAMETERS_VALUE}, - }, +DELETE_PAYMENT_CONNECTOR_OUTPUT: StaticSchema = ( + 18, + n0, + _DPCO, + {_sSI: _cDPCRo, _smith: None}, + (_st, _pCIa), + ((PAYMENT_CONNECTOR_STATUS, 1), (PAYMENT_CONNECTOR_ID, 0)), +) + +DELETE_PAYMENT_CONNECTOR: StaticOperationSchema = ( + 23, + n0, + _DPC, + { + _smithy: MappingProxyType( + { + "code": 202, + "method": "DELETE", + "uri": "/payments/managers/{paymentManagerId}/connectors/{paymentConnectorId}", + } + ) + }, + DELETE_PAYMENT_CONNECTOR_INPUT, + DELETE_PAYMENT_CONNECTOR_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + ), ) -O_AUTH_DEFAULT_RETURN_URL = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#OAuthDefaultReturnUrl"), - shape_type=ShapeType.STRING, +GET_PAYMENT_CONNECTOR_INPUT: StaticSchema = ( + 18, + n0, + _GPCI, + {_sSI: _cGPCR, _smit: None}, + (_pMI, _pCIa), + ((PAYMENT_MANAGER_ID, 9), (PAYMENT_CONNECTOR_ID, 9)), +) + +GET_PAYMENT_CONNECTOR_OUTPUT: StaticSchema = ( + 18, + n0, + _GPCO, + {_sSI: _cGPCRo, _smith: None}, + (_pCIa, _n, _d, _ty, _pMr, _cPCr, _cA, _lUA, _st, _aU, _cUA), + ( + (PAYMENT_CONNECTOR_ID, 1), + (PAYMENT_CONNECTOR_NAME, 1), + (PAYMENTS_DESCRIPTION, 0), + (PAYMENT_CONNECTOR_TYPE, 1), + (PAYMENT_CONNECTOR_PROVISION_MODE, 0), + (CREDENTIALS_PROVIDER_CONFIGURATIONS, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (PAYMENT_CONNECTOR_STATUS, 1), + (PAYMENT_CONNECTOR_AUTHORIZATION_URL, 0), + (DATE_TIMESTAMP, 0), + ), ) -O_AUTH_GRANT_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#OAuthGrantType"), - shape_type=ShapeType.ENUM, - members={ - "CLIENT_CREDENTIALS": {"target": UNIT}, - "AUTHORIZATION_CODE": {"target": UNIT}, - "TOKEN_EXCHANGE": {"target": UNIT}, - }, +GET_PAYMENT_CONNECTOR: StaticOperationSchema = ( + 23, + n0, + _GPCe, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "GET", + "uri": "/payments/managers/{paymentManagerId}/connectors/{paymentConnectorId}", + } + ) + }, + GET_PAYMENT_CONNECTOR_INPUT, + GET_PAYMENT_CONNECTOR_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -O_AUTH_CREDENTIAL_PROVIDER_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#OAuthCredentialProviderArn"), - shape_type=ShapeType.STRING, -) - -O_AUTH_SCOPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#OAuthScope"), - shape_type=ShapeType.STRING, -) - -O_AUTH_SCOPES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#OAuthScopes"), - shape_type=ShapeType.LIST, - members={"member": {"target": O_AUTH_SCOPE}}, -) - -O_AUTH_CREDENTIAL_PROVIDER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#OAuthCredentialProvider"), - members={ - "providerArn": { - "target": O_AUTH_CREDENTIAL_PROVIDER_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "scopes": { - "target": O_AUTH_SCOPES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "customParameters": {"target": O_AUTH_CUSTOM_PARAMETERS}, - "grantType": { - "target": O_AUTH_GRANT_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value="CLIENT_CREDENTIALS") - ], - }, - "defaultReturnUrl": {"target": O_AUTH_DEFAULT_RETURN_URL}, - }, +LIST_PAYMENT_CONNECTORS_INPUT: StaticSchema = ( + 18, + n0, + _LPCI, + {_sSI: _cLPCR, _smit: None}, + (_pMI, _mR, _nT), + ((PAYMENT_MANAGER_ID, 9), (MAX_RESULTS, {_sQ: _mR}), (NEXT_TOKEN, {_sQ: _nT})), +) + +PAYMENT_CONNECTOR_SUMMARY: StaticSchema = ( + 18, + n0, + _PCSa, + 0, + (_pCIa, _n, _ty, _pMr, _st, _lUA), + ( + (PAYMENT_CONNECTOR_ID, 1), + (PAYMENT_CONNECTOR_NAME, 1), + (PAYMENT_CONNECTOR_TYPE, 1), + (PAYMENT_CONNECTOR_PROVISION_MODE, 0), + (PAYMENT_CONNECTOR_STATUS, 1), + (DATE_TIMESTAMP, 1), + ), ) -CREDENTIAL_PROVIDER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CredentialProvider"), - shape_type=ShapeType.UNION, - members={ - "oauthCredentialProvider": {"target": O_AUTH_CREDENTIAL_PROVIDER}, - "apiKeyCredentialProvider": {"target": GATEWAY_API_KEY_CREDENTIAL_PROVIDER}, - "iamCredentialProvider": {"target": IAM_CREDENTIAL_PROVIDER}, - }, +PAYMENT_CONNECTOR_SUMMARIES: StaticSchema = ( + 16, + n0, + _PCSay, + 0, + (_mem,), + ((PAYMENT_CONNECTOR_SUMMARY, 0),), +) + +LIST_PAYMENT_CONNECTORS_OUTPUT: StaticSchema = ( + 18, + n0, + _LPCO, + {_sSI: _cLPCRo, _smith: None}, + (_pCa, _nT), + ((PAYMENT_CONNECTOR_SUMMARIES, 1), (NEXT_TOKEN, 0)), +) + +LIST_PAYMENT_CONNECTORS: StaticOperationSchema = ( + 23, + n0, + _LPC, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "POST", + "uri": "/payments/managers/{paymentManagerId}/connectors-list", + } + ) + }, + LIST_PAYMENT_CONNECTORS_INPUT, + LIST_PAYMENT_CONNECTORS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CREDENTIAL_PROVIDER_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CredentialProviderType"), - shape_type=ShapeType.ENUM, - members={ - "GATEWAY_IAM_ROLE": {"target": UNIT}, - "OAUTH": {"target": UNIT}, - "API_KEY": {"target": UNIT}, - "CALLER_IAM_CREDENTIALS": {"target": UNIT}, - "JWT_PASSTHROUGH": {"target": UNIT}, - }, +COINBASE_CDP_SECRET: StaticSchema = ( + 14, + n0, + _CCS, + 0, + (_AK, _WS), + ((-1, {_sVm: _AK}), (-1, {_sVm: _WS})), +) + +COINBASE_CDP_SECRETS: StaticSchema = ( + 16, + n0, + _CCSo, + 0, + (_mem,), + ((COINBASE_CDP_SECRET, 0),), +) + +COINBASE_CDP_ROTATION_TARGETS: StaticSchema = ( + 18, + n0, + _CCRT, + 0, + (_secr,), + ((COINBASE_CDP_SECRETS, 1),), +) + +CREDENTIAL_ROTATION_CONFIG: StaticSchema = ( + 19, + n0, + _CRCr, + 0, + (_cCDP,), + ((COINBASE_CDP_ROTATION_TARGETS, 0),), +) + +ROTATE_PAYMENT_CONNECTOR_CREDENTIALS_INPUT: StaticSchema = ( + 18, + n0, + _RPCCI, + {_sSI: _cRPCCR, _smit: None}, + (_pMI, _pCIa, _cTR, _cT), + ( + (PAYMENT_MANAGER_ID, 9), + (PAYMENT_CONNECTOR_ID, 9), + (CREDENTIAL_ROTATION_CONFIG, 1), + (CLIENT_TOKEN, 2), + ), ) -CREDENTIAL_PROVIDER_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CredentialProviderConfiguration"), - members={ - "credentialProviderType": { - "target": CREDENTIAL_PROVIDER_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "credentialProvider": {"target": CREDENTIAL_PROVIDER}, - }, +ROTATE_PAYMENT_CONNECTOR_CREDENTIALS_OUTPUT: StaticSchema = ( + 18, + n0, + _RPCCO, + {_sSI: _cRPCCRo, _smith: None}, + (_pCIa, _pMI, _lUA, _st), + ( + (PAYMENT_CONNECTOR_ID, 1), + (PAYMENT_MANAGER_ID, 1), + (DATE_TIMESTAMP, 1), + (PAYMENT_CONNECTOR_STATUS, 1), + ), ) -CREDENTIAL_PROVIDER_CONFIGURATIONS = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#CredentialProviderConfigurations" +ROTATE_PAYMENT_CONNECTOR_CREDENTIALS: StaticOperationSchema = ( + 23, + n0, + _RPCC, + { + _smithy: MappingProxyType( + { + "code": 202, + "method": "POST", + "uri": "/payments/managers/{paymentManagerId}/connectors/{paymentConnectorId}/rotate-credentials", + } + ) + }, + ROTATE_PAYMENT_CONNECTOR_CREDENTIALS_INPUT, + ROTATE_PAYMENT_CONNECTOR_CREDENTIALS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, ), - shape_type=ShapeType.LIST, - members={"member": {"target": CREDENTIAL_PROVIDER_CONFIGURATION}}, ) -TARGET_DESCRIPTION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#TargetDescription"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +UPDATE_PAYMENT_CONNECTOR_INPUT: StaticSchema = ( + 18, + n0, + _UPCI, + {_sSI: _cUPCR, _smit: None}, + (_pMI, _pCIa, _d, _ty, _cPCr, _cT), + ( + (PAYMENT_MANAGER_ID, 9), + (PAYMENT_CONNECTOR_ID, 9), + (PAYMENTS_DESCRIPTION, 0), + (PAYMENT_CONNECTOR_TYPE, 0), + (CREDENTIALS_PROVIDER_CONFIGURATIONS, 0), + (CLIENT_TOKEN, 2), + ), ) -METADATA_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#MetadataConfiguration"), - members={ - "allowedRequestHeaders": {"target": ALLOWED_REQUEST_HEADERS}, - "allowedQueryParameters": {"target": ALLOWED_QUERY_PARAMETERS}, - "allowedResponseHeaders": {"target": ALLOWED_RESPONSE_HEADERS}, - }, +UPDATE_PAYMENT_CONNECTOR_OUTPUT: StaticSchema = ( + 18, + n0, + _UPCOp, + {_sSI: _cUPCRo, _smith: None}, + (_pCIa, _pMI, _n, _ty, _cPCr, _lUA, _st, _aU), + ( + (PAYMENT_CONNECTOR_ID, 1), + (PAYMENT_MANAGER_ID, 1), + (PAYMENT_CONNECTOR_NAME, 1), + (PAYMENT_CONNECTOR_TYPE, 1), + (CREDENTIALS_PROVIDER_CONFIGURATIONS, 1), + (DATE_TIMESTAMP, 1), + (PAYMENT_CONNECTOR_STATUS, 1), + (PAYMENT_CONNECTOR_AUTHORIZATION_URL, 0), + ), ) -RUNTIME_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#RuntimeArn"), - shape_type=ShapeType.STRING, +UPDATE_PAYMENT_CONNECTOR: StaticOperationSchema = ( + 23, + n0, + _UPC, + { + _smithy: MappingProxyType( + { + "code": 202, + "method": "PATCH", + "uri": "/payments/managers/{paymentManagerId}/connectors/{paymentConnectorId}", + } + ) + }, + UPDATE_PAYMENT_CONNECTOR_INPUT, + UPDATE_PAYMENT_CONNECTOR_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + SUBSCRIPTION_REQUIRED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -RUNTIME_QUALIFIER = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#RuntimeQualifier"), - shape_type=ShapeType.STRING, +UPDATE_PAYMENT_MANAGER_INPUT: StaticSchema = ( + 18, + n0, + _UPMI, + {_sSI: _cUPMR, _smit: None}, + (_pMI, _d, _aT, _aCu, _rA, _cT, _kKA), + ( + (PAYMENT_MANAGER_ID, 9), + (PAYMENTS_DESCRIPTION, 0), + (PAYMENTS_AUTHORIZER_TYPE, 0), + (AUTHORIZER_CONFIGURATION, 0), + (ROLE_ARN, 0), + (CLIENT_TOKEN, 2), + (KMS_KEY_ARN, 0), + ), ) -INLINE_PAYLOAD = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#InlinePayload"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +UPDATE_PAYMENT_MANAGER_OUTPUT: StaticSchema = ( + 18, + n0, + _UPMO, + {_sSI: _cUPMRo, _smith: None}, + (_pMA, _pMI, _n, _aT, _rA, _wID, _lUA, _st, _kKA), + ( + (PAYMENT_MANAGER_ARN, 1), + (PAYMENT_MANAGER_ID, 1), + (PAYMENT_MANAGER_NAME, 1), + (PAYMENTS_AUTHORIZER_TYPE, 1), + (ROLE_ARN, 1), + (WORKLOAD_IDENTITY_DETAILS, 0), + (DATE_TIMESTAMP, 1), + (PAYMENT_MANAGER_STATUS, 1), + (KMS_KEY_ARN, 0), + ), ) -AWS_ACCOUNT_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#AwsAccountId"), - shape_type=ShapeType.STRING, +UPDATE_PAYMENT_MANAGER: StaticOperationSchema = ( + 23, + n0, + _UPM, + { + _smithy: MappingProxyType( + { + "code": 202, + "method": "PATCH", + "uri": "/payments/managers/{paymentManagerId}", + } + ) + }, + UPDATE_PAYMENT_MANAGER_INPUT, + UPDATE_PAYMENT_MANAGER_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -S3_BUCKET_URI = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#S3BucketUri"), - shape_type=ShapeType.STRING, +POLICY_ENGINE_NAME: StaticSchema = (3, n0, _PEN, 0) + +CREATE_POLICY_ENGINE_INPUT: StaticSchema = ( + 18, + n0, + _CPEI, + {_sSI: _cCPER, _smit: None}, + (_n, _d, _cT, _eKA, _t), + ( + (POLICY_ENGINE_NAME, 1), + (DESCRIPTION, 0), + (CLIENT_TOKEN, 2), + (KMS_KEY_ARN, 0), + (TAGS_MAP, 0), + ), ) -S3_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#S3Configuration"), - members={ - "uri": {"target": S3_BUCKET_URI}, - "bucketOwnerAccountId": {"target": AWS_ACCOUNT_ID}, - }, +POLICY_ENGINE_ARN: StaticSchema = (3, n0, _PEA, 0) + +RESOURCE_ID: StaticSchema = (3, n0, _RI, 0) + +POLICY_ENGINE_STATUS: StaticSchema = ( + 14, + n0, + _PES, + 0, + (_CREATING, _ACTIVE, _UPDATING, _DELETING, _CF, _UF, _DF), + ( + (-1, {_sVm: _CREATING}), + (-1, {_sVm: _ACTIVE}), + (-1, {_sVm: _UPDATING}), + (-1, {_sVm: _DELETING}), + (-1, {_sVm: _CF}), + (-1, {_sVm: _UF}), + (-1, {_sVm: _DF}), + ), ) -API_SCHEMA_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ApiSchemaConfiguration"), - shape_type=ShapeType.UNION, - members={ - "s3": {"target": S3_CONFIGURATION}, - "inlinePayload": {"target": INLINE_PAYLOAD}, - }, +STRING: StaticSchema = (3, n0, _Str, 0) + +POLICY_STATUS_REASONS: StaticSchema = (16, n0, _PSR, 0, (_mem,), ((STRING, 0),)) + +CREATE_POLICY_ENGINE_OUTPUT: StaticSchema = ( + 18, + n0, + _CPEO, + {_sSI: _cCPERo, _smith: None}, + (_pEI, _n, _cA, _uA, _pEA, _st, _eKA, _d, _sRta), + ( + (RESOURCE_ID, 1), + (POLICY_ENGINE_NAME, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (POLICY_ENGINE_ARN, 1), + (POLICY_ENGINE_STATUS, 1), + (KMS_KEY_ARN, 0), + (DESCRIPTION, 0), + (POLICY_STATUS_REASONS, 1), + ), ) -HTTP_API_SCHEMA_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HttpApiSchemaConfiguration"), - members={ - "source": { - "target": API_SCHEMA_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +CREATE_POLICY_ENGINE: StaticOperationSchema = ( + 23, + n0, + _CPE, + { + _smithy: MappingProxyType( + {"method": "POST", "uri": "/policy-engines", "code": 202} + ) + }, + CREATE_POLICY_ENGINE_INPUT, + CREATE_POLICY_ENGINE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -RUNTIME_TARGET_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#RuntimeTargetConfiguration"), - members={ - "arn": { - "target": RUNTIME_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "qualifier": {"target": RUNTIME_QUALIFIER}, - "schema": {"target": HTTP_API_SCHEMA_CONFIGURATION}, - }, +DELETE_POLICY_ENGINE_INPUT: StaticSchema = ( + 18, + n0, + _DPEI, + {_sSI: _cDPER, _smit: None}, + (_pEI,), + ((RESOURCE_ID, 9),), +) + +DELETE_POLICY_ENGINE_OUTPUT: StaticSchema = ( + 18, + n0, + _DPEO, + {_sSI: _cDPERo, _smith: None}, + (_pEI, _n, _cA, _uA, _pEA, _st, _eKA, _d, _sRta), + ( + (RESOURCE_ID, 1), + (POLICY_ENGINE_NAME, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (POLICY_ENGINE_ARN, 1), + (POLICY_ENGINE_STATUS, 1), + (KMS_KEY_ARN, 0), + (DESCRIPTION, 0), + (POLICY_STATUS_REASONS, 1), + ), ) -CONNECTOR_PARAMETER_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ConnectorParameterName"), - shape_type=ShapeType.STRING, +DELETE_POLICY_ENGINE: StaticOperationSchema = ( + 23, + n0, + _DPE, + { + _smithy: MappingProxyType( + {"method": "DELETE", "uri": "/policy-engines/{policyEngineId}", "code": 202} + ) + }, + DELETE_POLICY_ENGINE_INPUT, + DELETE_POLICY_ENGINE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CONNECTOR_PARAMETER_VALUE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ConnectorParameterValue"), - shape_type=ShapeType.STRING, +GET_POLICY_ENGINE_INPUT: StaticSchema = ( + 18, + n0, + _GPEI, + {_sSI: _cGPER, _smit: None}, + (_pEI,), + ((RESOURCE_ID, 9),), +) + +GET_POLICY_ENGINE_OUTPUT: StaticSchema = ( + 18, + n0, + _GPEO, + {_sSI: _cGPERo, _smith: None}, + (_pEI, _n, _cA, _uA, _pEA, _st, _eKA, _d, _sRta), + ( + (RESOURCE_ID, 1), + (POLICY_ENGINE_NAME, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (POLICY_ENGINE_ARN, 1), + (POLICY_ENGINE_STATUS, 1), + (KMS_KEY_ARN, 0), + (DESCRIPTION, 0), + (POLICY_STATUS_REASONS, 1), + ), ) -HTTP_CONNECTOR_PARAMETERS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HttpConnectorParameters"), - shape_type=ShapeType.MAP, - members={ - "key": {"target": CONNECTOR_PARAMETER_NAME}, - "value": {"target": CONNECTOR_PARAMETER_VALUE}, +GET_POLICY_ENGINE: StaticOperationSchema = ( + 23, + n0, + _GPE, + { + _smithy: MappingProxyType( + {"method": "GET", "uri": "/policy-engines/{policyEngineId}", "code": 200} + ) }, + GET_POLICY_ENGINE_INPUT, + GET_POLICY_ENGINE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CONNECTOR_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ConnectorId"), - shape_type=ShapeType.STRING, +GET_POLICY_ENGINE_SUMMARY_INPUT: StaticSchema = ( + 18, + n0, + _GPESI, + {_sSI: _cGPESR, _smit: None}, + (_pEI,), + ((RESOURCE_ID, 9),), +) + +GET_POLICY_ENGINE_SUMMARY_OUTPUT: StaticSchema = ( + 18, + n0, + _GPESO, + {_sSI: _cGPESRo, _smith: None}, + (_pEI, _n, _cA, _uA, _pEA, _st, _eKA), + ( + (RESOURCE_ID, 1), + (POLICY_ENGINE_NAME, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (POLICY_ENGINE_ARN, 1), + (POLICY_ENGINE_STATUS, 1), + (KMS_KEY_ARN, 0), + ), ) -HTTP_CONNECTOR_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HttpConnectorSource"), - members={ - "connectorId": { - "target": CONNECTOR_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +GET_POLICY_ENGINE_SUMMARY: StaticOperationSchema = ( + 23, + n0, + _GPES, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/policy-engine-summaries/{policyEngineId}", + "code": 200, + } + ) + }, + GET_POLICY_ENGINE_SUMMARY_INPUT, + GET_POLICY_ENGINE_SUMMARY_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -HTTP_CONNECTOR_TARGET_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#HttpConnectorTargetConfiguration" +LIST_POLICY_ENGINES_INPUT: StaticSchema = ( + 18, + n0, + _LPEI, + {_sSI: _cLPER, _smit: None}, + (_nT, _mR), + ((NEXT_TOKEN, {_sQ: _nT}), (MAX_RESULTS, {_sQ: _mR})), +) + +POLICY_ENGINE: StaticSchema = ( + 18, + n0, + _PEo, + 0, + (_pEI, _n, _cA, _uA, _pEA, _st, _eKA, _d, _sRta), + ( + (RESOURCE_ID, 1), + (POLICY_ENGINE_NAME, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (POLICY_ENGINE_ARN, 1), + (POLICY_ENGINE_STATUS, 1), + (KMS_KEY_ARN, 0), + (DESCRIPTION, 0), + (POLICY_STATUS_REASONS, 1), ), - members={ - "source": { - "target": HTTP_CONNECTOR_SOURCE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "parameters": {"target": HTTP_CONNECTOR_PARAMETERS}, - }, ) -PASSTHROUGH_ENDPOINT = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PassthroughEndpoint"), - shape_type=ShapeType.STRING, +POLICY_ENGINES: StaticSchema = (16, n0, _PEol, 0, (_mem,), ((POLICY_ENGINE, 0),)) + +LIST_POLICY_ENGINES_OUTPUT: StaticSchema = ( + 18, + n0, + _LPEO, + {_sSI: _cLPERo, _smith: None}, + (_pEo, _nT), + ((POLICY_ENGINES, 1), (NEXT_TOKEN, 0)), ) -PASSTHROUGH_PROTOCOL_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PassthroughProtocolType"), - shape_type=ShapeType.ENUM, - members={ - "MCP": {"target": UNIT}, - "A2A": {"target": UNIT}, - "INFERENCE": {"target": UNIT}, - "CUSTOM": {"target": UNIT}, +LIST_POLICY_ENGINES: StaticOperationSchema = ( + 23, + n0, + _LPE, + { + _smithy: MappingProxyType( + {"method": "GET", "uri": "/policy-engines", "code": 200} + ) }, + LIST_POLICY_ENGINES_INPUT, + LIST_POLICY_ENGINES_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -STATIC_QUERY_PARAMETER_CONFLICT_RESOLUTION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#StaticQueryParameterConflictResolution" +LIST_POLICY_ENGINE_SUMMARIES_INPUT: StaticSchema = ( + 18, + n0, + _LPESI, + {_sSI: _cLPESR, _smit: None}, + (_nT, _mR), + ((NEXT_TOKEN, {_sQ: _nT}), (MAX_RESULTS, {_sQ: _mR})), +) + +POLICY_ENGINE_SUMMARY: StaticSchema = ( + 18, + n0, + _PESo, + 0, + (_pEI, _n, _cA, _uA, _pEA, _st, _eKA), + ( + (RESOURCE_ID, 1), + (POLICY_ENGINE_NAME, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (POLICY_ENGINE_ARN, 1), + (POLICY_ENGINE_STATUS, 1), + (KMS_KEY_ARN, 0), ), - shape_type=ShapeType.ENUM, - members={"CLIENT_OVERRIDE": {"target": UNIT}, "STATIC_OVERRIDE": {"target": UNIT}}, ) -STATIC_QUERY_PARAMETER_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#StaticQueryParameterName"), - shape_type=ShapeType.STRING, +POLICY_ENGINE_SUMMARY_LIST: StaticSchema = ( + 16, + n0, + _PESL, + 0, + (_mem,), + ((POLICY_ENGINE_SUMMARY, 0),), +) + +LIST_POLICY_ENGINE_SUMMARIES_OUTPUT: StaticSchema = ( + 18, + n0, + _LPESO, + {_sSI: _cLPESRo, _smith: None}, + (_pEo, _nT), + ((POLICY_ENGINE_SUMMARY_LIST, 1), (NEXT_TOKEN, 0)), +) + +LIST_POLICY_ENGINE_SUMMARIES: StaticOperationSchema = ( + 23, + n0, + _LPES, + { + _smithy: MappingProxyType( + {"method": "GET", "uri": "/policy-engine-summaries", "code": 200} + ) + }, + LIST_POLICY_ENGINE_SUMMARIES_INPUT, + LIST_POLICY_ENGINE_SUMMARIES_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -STATIC_QUERY_PARAMETER_VALUE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#StaticQueryParameterValue"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +UPDATE_POLICY_ENGINE_INPUT: StaticSchema = ( + 18, + n0, + _UPEI, + {_sSI: _cUPER, _smit: None}, + (_pEI, _d), + ((RESOURCE_ID, 9), (UPDATED_DESCRIPTION, 0)), +) + +UPDATE_POLICY_ENGINE_OUTPUT: StaticSchema = ( + 18, + n0, + _UPEOp, + {_sSI: _cUPERo, _smith: None}, + (_pEI, _n, _cA, _uA, _pEA, _st, _eKA, _d, _sRta), + ( + (RESOURCE_ID, 1), + (POLICY_ENGINE_NAME, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (POLICY_ENGINE_ARN, 1), + (POLICY_ENGINE_STATUS, 1), + (KMS_KEY_ARN, 0), + (DESCRIPTION, 0), + (POLICY_STATUS_REASONS, 1), + ), ) -STATIC_QUERY_PARAMETERS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#StaticQueryParameters"), - shape_type=ShapeType.MAP, - members={ - "key": {"target": STATIC_QUERY_PARAMETER_NAME}, - "value": {"target": STATIC_QUERY_PARAMETER_VALUE}, - }, +UPDATE_POLICY_ENGINE: StaticOperationSchema = ( + 23, + n0, + _UPE, + { + _smithy: MappingProxyType( + {"method": "PATCH", "uri": "/policy-engines/{policyEngineId}", "code": 202} + ) + }, + UPDATE_POLICY_ENGINE_INPUT, + UPDATE_POLICY_ENGINE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -COMPOSITE_IDENTIFIER_ENTRY = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CompositeIdentifierEntry"), - shape_type=ShapeType.STRING, +GET_POLICY_GENERATION_INPUT: StaticSchema = ( + 18, + n0, + _GPGI, + {_sSI: _cGPGR, _smit: None}, + (_pGI, _pEI), + ((RESOURCE_ID, 9), (RESOURCE_ID, 9)), ) -COMPOSITE_IDENTIFIER_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CompositeIdentifierList"), - shape_type=ShapeType.LIST, - members={"member": {"target": COMPOSITE_IDENTIFIER_ENTRY}}, -) +POLICY_GENERATION_NAME: StaticSchema = (3, n0, _PGN, 0) + +POLICY_GENERATION_ARN: StaticSchema = (3, n0, _PGA, 0) + +RESOURCE: StaticSchema = (19, n0, _Re, 0, (_a,), ((BEDROCK_AGENTCORE_RESOURCE_ARN, 0),)) -STICKINESS_TIMEOUT = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#StickinessTimeout"), - shape_type=ShapeType.INTEGER, +POLICY_GENERATION_STATUS: StaticSchema = ( + 14, + n0, + _PGS, + 0, + (_GENERATING, _GENERATED, _GF, _DF), + ( + (-1, {_sVm: _GENERATING}), + (-1, {_sVm: _GENERATED}), + (-1, {_sVm: _GF}), + (-1, {_sVm: _DF}), + ), ) -STICKINESS_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#StickinessConfiguration"), - members={ - "identifier": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "timeout": {"target": STICKINESS_TIMEOUT}, - "compositeIdentifier": {"target": COMPOSITE_IDENTIFIER_LIST}, - }, +GET_POLICY_GENERATION_OUTPUT: StaticSchema = ( + 18, + n0, + _GPGO, + {_sSI: _cGPGRo, _smith: None}, + (_pEI, _pGI, _n, _pGA, _resou, _cA, _uA, _st, _fin, _sRta), + ( + (RESOURCE_ID, 1), + (RESOURCE_ID, 1), + (POLICY_GENERATION_NAME, 1), + (POLICY_GENERATION_ARN, 1), + (RESOURCE, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (POLICY_GENERATION_STATUS, 1), + (STRING, 0), + (POLICY_STATUS_REASONS, 1), + ), ) -PASSTHROUGH_TARGET_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PassthroughTargetConfiguration"), - members={ - "endpoint": { - "target": PASSTHROUGH_ENDPOINT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "protocolType": { - "target": PASSTHROUGH_PROTOCOL_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "schema": {"target": HTTP_API_SCHEMA_CONFIGURATION}, - "stickinessConfiguration": {"target": STICKINESS_CONFIGURATION}, - "staticQueryParameters": {"target": STATIC_QUERY_PARAMETERS}, - "staticQueryParameterConflictResolution": { - "target": STATIC_QUERY_PARAMETER_CONFLICT_RESOLUTION - }, - }, +GET_POLICY_GENERATION: StaticOperationSchema = ( + 23, + n0, + _GPG, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/policy-engines/{policyEngineId}/policy-generations/{policyGenerationId}", + } + ) + }, + GET_POLICY_GENERATION_INPUT, + GET_POLICY_GENERATION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -HTTP_TARGET_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HttpTargetConfiguration"), - shape_type=ShapeType.UNION, - members={ - "agentcoreRuntime": {"target": RUNTIME_TARGET_CONFIGURATION}, - "passthrough": {"target": PASSTHROUGH_TARGET_CONFIGURATION}, - "connector": {"target": HTTP_CONNECTOR_TARGET_CONFIGURATION}, - }, +GET_POLICY_GENERATION_SUMMARY_INPUT: StaticSchema = ( + 18, + n0, + _GPGSI, + {_sSI: _cGPGSR, _smit: None}, + (_pGI, _pEI), + ((RESOURCE_ID, 9), (RESOURCE_ID, 9)), +) + +GET_POLICY_GENERATION_SUMMARY_OUTPUT: StaticSchema = ( + 18, + n0, + _GPGSO, + {_sSI: _cGPGSRo, _smith: None}, + (_pEI, _pGI, _n, _pGA, _resou, _cA, _uA, _st, _fin), + ( + (RESOURCE_ID, 1), + (RESOURCE_ID, 1), + (POLICY_GENERATION_NAME, 1), + (POLICY_GENERATION_ARN, 1), + (RESOURCE, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (POLICY_GENERATION_STATUS, 1), + (STRING, 0), + ), ) -INFERENCE_CONNECTOR_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#InferenceConnectorId"), - shape_type=ShapeType.STRING, +GET_POLICY_GENERATION_SUMMARY: StaticOperationSchema = ( + 23, + n0, + _GPGS, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/policy-engines/{policyEngineId}/policy-generation-summaries/{policyGenerationId}", + "code": 200, + } + ) + }, + GET_POLICY_GENERATION_SUMMARY_INPUT, + GET_POLICY_GENERATION_SUMMARY_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -INFERENCE_CONNECTOR_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#InferenceConnectorSource"), - members={ - "connectorId": { - "target": INFERENCE_CONNECTOR_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +LIST_POLICY_GENERATION_ASSETS_INPUT: StaticSchema = ( + 18, + n0, + _LPGAI, + {_sSI: _cLPGAR, _smit: None}, + (_pGI, _pEI, _nT, _mR), + ( + (RESOURCE_ID, 9), + (RESOURCE_ID, 9), + (NEXT_TOKEN, {_sQ: _nT}), + (MAX_RESULTS, {_sQ: _mR}), + ), ) -INFERENCE_CONNECTOR_TARGET_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InferenceConnectorTargetConfiguration" +STATEMENT: StaticSchema = (3, n0, _Sta, 0) + +CEDAR_POLICY: StaticSchema = (18, n0, _CPe, 0, (_stat,), ((STATEMENT, 1),)) + +POLICY_STATEMENT: StaticSchema = (18, n0, _PSo, 0, (_stat,), ((STATEMENT, 1),)) + +POLICY_GENERATION_DETAILS: StaticSchema = ( + 18, + n0, + _PGD, + 0, + (_pGI, _pGAI), + ((RESOURCE_ID, 1), (RESOURCE_ID, 1)), +) + +POLICY_DEFINITION: StaticSchema = ( + 19, + n0, + _PDo, + 0, + (_ced, _pG, _po), + ((CEDAR_POLICY, 0), (POLICY_GENERATION_DETAILS, 0), (POLICY_STATEMENT, 0)), +) + +FINDING_TYPE: StaticSchema = ( + 14, + n0, + _FT, + 0, + (_VALID, _INVALID, _NT_, _AA__, _AN, _DA_, _DN_), + ( + (-1, {_sVm: _VALID}), + (-1, {_sVm: _INVALID}), + (-1, {_sVm: _NT_}), + (-1, {_sVm: _AA__}), + (-1, {_sVm: _AN}), + (-1, {_sVm: _DA_}), + (-1, {_sVm: _DN_}), ), - members={ - "source": { - "target": INFERENCE_CONNECTOR_SOURCE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, ) -PROVIDER_PREFIX = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ProviderPrefix"), - members={ - "strip": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "separator": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=".")], - }, - }, +FINDING: StaticSchema = (18, n0, _Fi, 0, (_ty, _d), ((FINDING_TYPE, 0), (STRING, 0))) + +FINDINGS: StaticSchema = (16, n0, _Fin, 0, (_mem,), ((FINDING, 0),)) + +NATURAL_LANGUAGE: StaticSchema = (3, n0, _NLa, 0) + +POLICY_GENERATION_ASSET: StaticSchema = ( + 18, + n0, + _PGAo, + 0, + (_pGAI, _de, _rTF, _fin), + ((RESOURCE_ID, 1), (POLICY_DEFINITION, 0), (NATURAL_LANGUAGE, 1), (FINDINGS, 1)), ) -MODEL_MAPPING = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ModelMapping"), - members={"providerPrefix": {"target": PROVIDER_PREFIX}}, +POLICY_GENERATION_ASSETS: StaticSchema = ( + 16, + n0, + _PGAol, + 0, + (_mem,), + ((POLICY_GENERATION_ASSET, 0),), ) -MODEL_PATTERN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ModelPattern"), - shape_type=ShapeType.STRING, +LIST_POLICY_GENERATION_ASSETS_OUTPUT: StaticSchema = ( + 18, + n0, + _LPGAO, + {_sSI: _cLPGARo, _smith: None}, + (_pGAo, _nT), + ((POLICY_GENERATION_ASSETS, 0), (NEXT_TOKEN, 0)), ) -MODEL_ENTRY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ModelEntry"), - members={ - "model": { - "target": MODEL_PATTERN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } +LIST_POLICY_GENERATION_ASSETS: StaticOperationSchema = ( + 23, + n0, + _LPGA, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/policy-engines/{policyEngineId}/policy-generations/{policyGenerationId}/assets", + } + ) }, + LIST_POLICY_GENERATION_ASSETS_INPUT, + LIST_POLICY_GENERATION_ASSETS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -MODEL_ENTRIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ModelEntries"), - shape_type=ShapeType.LIST, - members={"member": {"target": MODEL_ENTRY}}, +LIST_POLICY_GENERATIONS_INPUT: StaticSchema = ( + 18, + n0, + _LPGI, + {_sSI: _cLPGR, _smit: None}, + (_nT, _mR, _pEI), + ((NEXT_TOKEN, {_sQ: _nT}), (MAX_RESULTS, {_sQ: _mR}), (RESOURCE_ID, 9)), +) + +POLICY_GENERATION: StaticSchema = ( + 18, + n0, + _PG, + 0, + (_pEI, _pGI, _n, _pGA, _resou, _cA, _uA, _st, _fin, _sRta), + ( + (RESOURCE_ID, 1), + (RESOURCE_ID, 1), + (POLICY_GENERATION_NAME, 1), + (POLICY_GENERATION_ARN, 1), + (RESOURCE, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (POLICY_GENERATION_STATUS, 1), + (STRING, 0), + (POLICY_STATUS_REASONS, 1), + ), ) -INFERENCE_OPERATION_PATH = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#InferenceOperationPath"), - shape_type=ShapeType.STRING, +POLICY_GENERATIONS: StaticSchema = (16, n0, _PGo, 0, (_mem,), ((POLICY_GENERATION, 0),)) + +LIST_POLICY_GENERATIONS_OUTPUT: StaticSchema = ( + 18, + n0, + _LPGO, + {_sSI: _cLPGRo, _smith: None}, + (_pGo, _nT), + ((POLICY_GENERATIONS, 1), (NEXT_TOKEN, 0)), +) + +LIST_POLICY_GENERATIONS: StaticOperationSchema = ( + 23, + n0, + _LPG, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/policy-engines/{policyEngineId}/policy-generations", + } + ) + }, + LIST_POLICY_GENERATIONS_INPUT, + LIST_POLICY_GENERATIONS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -INFERENCE_OPERATION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#InferenceOperationConfiguration"), - members={ - "path": { - "target": INFERENCE_OPERATION_PATH, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "providerPath": {"target": INFERENCE_OPERATION_PATH}, - "models": {"target": MODEL_ENTRIES}, - }, +LIST_POLICY_GENERATION_SUMMARIES_INPUT: StaticSchema = ( + 18, + n0, + _LPGSI, + {_sSI: _cLPGSR, _smit: None}, + (_nT, _mR, _pEI), + ((NEXT_TOKEN, {_sQ: _nT}), (MAX_RESULTS, {_sQ: _mR}), (RESOURCE_ID, 9)), +) + +POLICY_GENERATION_SUMMARY: StaticSchema = ( + 18, + n0, + _PGSo, + 0, + (_pEI, _pGI, _n, _pGA, _resou, _cA, _uA, _st, _fin), + ( + (RESOURCE_ID, 1), + (RESOURCE_ID, 1), + (POLICY_GENERATION_NAME, 1), + (POLICY_GENERATION_ARN, 1), + (RESOURCE, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (POLICY_GENERATION_STATUS, 1), + (STRING, 0), + ), ) -INFERENCE_OPERATION_CONFIGURATIONS = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InferenceOperationConfigurations" +POLICY_GENERATION_SUMMARY_LIST: StaticSchema = ( + 16, + n0, + _PGSL, + 0, + (_mem,), + ((POLICY_GENERATION_SUMMARY, 0),), +) + +LIST_POLICY_GENERATION_SUMMARIES_OUTPUT: StaticSchema = ( + 18, + n0, + _LPGSO, + {_sSI: _cLPGSRo, _smith: None}, + (_pGo, _nT), + ((POLICY_GENERATION_SUMMARY_LIST, 1), (NEXT_TOKEN, 0)), +) + +LIST_POLICY_GENERATION_SUMMARIES: StaticOperationSchema = ( + 23, + n0, + _LPGS, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/policy-engines/{policyEngineId}/policy-generation-summaries", + "code": 200, + } + ) + }, + LIST_POLICY_GENERATION_SUMMARIES_INPUT, + LIST_POLICY_GENERATION_SUMMARIES_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, ), - shape_type=ShapeType.LIST, - members={"member": {"target": INFERENCE_OPERATION_CONFIGURATION}}, ) -INFERENCE_PROVIDER_TARGET_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InferenceProviderTargetConfiguration" +CONTENT: StaticSchema = (19, n0, _Conte, 0, (_rTa,), ((NATURAL_LANGUAGE, 0),)) + +START_POLICY_GENERATION_INPUT: StaticSchema = ( + 18, + n0, + _SPGI, + {_sSI: _cSPGR, _smit: None}, + (_pEI, _resou, _cont, _n, _cT), + ( + (RESOURCE_ID, 9), + (RESOURCE, 1), + (CONTENT, 1), + (POLICY_GENERATION_NAME, 1), + (CLIENT_TOKEN, 2), ), - members={ - "endpoint": { - "target": PASSTHROUGH_ENDPOINT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelMapping": {"target": MODEL_MAPPING}, - "operations": {"target": INFERENCE_OPERATION_CONFIGURATIONS}, - }, ) -INFERENCE_TARGET_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#InferenceTargetConfiguration"), - shape_type=ShapeType.UNION, - members={ - "connector": {"target": INFERENCE_CONNECTOR_TARGET_CONFIGURATION}, - "provider": {"target": INFERENCE_PROVIDER_TARGET_CONFIGURATION}, - }, +START_POLICY_GENERATION_OUTPUT: StaticSchema = ( + 18, + n0, + _SPGO, + {_sSI: _cSPGRo, _smith: None}, + (_pEI, _pGI, _n, _pGA, _resou, _cA, _uA, _st, _fin, _sRta), + ( + (RESOURCE_ID, 1), + (RESOURCE_ID, 1), + (POLICY_GENERATION_NAME, 1), + (POLICY_GENERATION_ARN, 1), + (RESOURCE, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (POLICY_GENERATION_STATUS, 1), + (STRING, 0), + (POLICY_STATUS_REASONS, 1), + ), ) -REST_API_METHOD = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#RestApiMethod"), - shape_type=ShapeType.ENUM, - members={ - "GET": {"target": UNIT}, - "DELETE": {"target": UNIT}, - "HEAD": {"target": UNIT}, - "OPTIONS": {"target": UNIT}, - "PATCH": {"target": UNIT}, - "PUT": {"target": UNIT}, - "POST": {"target": UNIT}, - }, +START_POLICY_GENERATION: StaticOperationSchema = ( + 23, + n0, + _SPG, + { + _smithy: MappingProxyType( + { + "method": "POST", + "uri": "/policy-engines/{policyEngineId}/policy-generations", + "code": 202, + } + ) + }, + START_POLICY_GENERATION_INPUT, + START_POLICY_GENERATION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -REST_API_METHODS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#RestApiMethods"), - shape_type=ShapeType.LIST, - members={"member": {"target": REST_API_METHOD}}, +ENFORCEMENT_MODE: StaticSchema = ( + 14, + n0, + _EM, + {_smithya: _ACTIVE}, + (_ACTIVE, _LO), + ((-1, {_sVm: _ACTIVE}), (-1, {_sVm: _LO})), +) + +POLICY_NAME: StaticSchema = (3, n0, _PN, 0) + +POLICY_VALIDATION_MODE: StaticSchema = ( + 14, + n0, + _PVM, + {_smithya: _FOAF}, + (_FOAF, _IAF), + ((-1, {_sVm: _FOAF}), (-1, {_sVm: _IAF})), +) + +CREATE_POLICY_INPUT: StaticSchema = ( + 18, + n0, + _CPIr, + {_sSI: _cCPR, _smit: None}, + (_n, _de, _d, _vM, _eM, _pEI, _cT), + ( + (POLICY_NAME, 1), + (POLICY_DEFINITION, 1), + (DESCRIPTION, 0), + (POLICY_VALIDATION_MODE, {_smithya: _FOAF}), + (ENFORCEMENT_MODE, {_smithya: _ACTIVE}), + (RESOURCE_ID, 9), + (CLIENT_TOKEN, 2), + ), ) -API_GATEWAY_TOOL_FILTER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ApiGatewayToolFilter"), - members={ - "filterPath": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "methods": { - "target": REST_API_METHODS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +POLICY_ARN: StaticSchema = (3, n0, _PAo, 0) + +POLICY_STATUS: StaticSchema = ( + 14, + n0, + _PSol, + 0, + (_CREATING, _ACTIVE, _UPDATING, _DELETING, _CF, _UF, _DF), + ( + (-1, {_sVm: _CREATING}), + (-1, {_sVm: _ACTIVE}), + (-1, {_sVm: _UPDATING}), + (-1, {_sVm: _DELETING}), + (-1, {_sVm: _CF}), + (-1, {_sVm: _UF}), + (-1, {_sVm: _DF}), + ), ) -API_GATEWAY_TOOL_FILTERS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ApiGatewayToolFilters"), - shape_type=ShapeType.LIST, - members={"member": {"target": API_GATEWAY_TOOL_FILTER}}, -) - -API_GATEWAY_TOOL_OVERRIDE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ApiGatewayToolOverride"), - members={ - "name": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": _STRING}, - "path": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "method": { - "target": REST_API_METHOD, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +CREATE_POLICY_OUTPUT: StaticSchema = ( + 18, + n0, + _CPOr, + {_sSI: _cCPRo, _smith: None}, + (_pIo, _n, _pEI, _cA, _uA, _pAo, _st, _eM, _de, _d, _sRta), + ( + (RESOURCE_ID, 1), + (POLICY_NAME, 1), + (RESOURCE_ID, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (POLICY_ARN, 1), + (POLICY_STATUS, 1), + (ENFORCEMENT_MODE, {_smithya: _ACTIVE}), + (POLICY_DEFINITION, 1), + (DESCRIPTION, 0), + (POLICY_STATUS_REASONS, 1), + ), ) -API_GATEWAY_TOOL_OVERRIDES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ApiGatewayToolOverrides"), - shape_type=ShapeType.LIST, - members={"member": {"target": API_GATEWAY_TOOL_OVERRIDE}}, +CREATE_POLICY: StaticOperationSchema = ( + 23, + n0, + _CPre, + { + _smithy: MappingProxyType( + { + "method": "POST", + "uri": "/policy-engines/{policyEngineId}/policies", + "code": 202, + } + ) + }, + CREATE_POLICY_INPUT, + CREATE_POLICY_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -API_GATEWAY_TOOL_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ApiGatewayToolConfiguration"), - members={ - "toolOverrides": {"target": API_GATEWAY_TOOL_OVERRIDES}, - "toolFilters": { - "target": API_GATEWAY_TOOL_FILTERS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +DELETE_POLICY_INPUT: StaticSchema = ( + 18, + n0, + _DPI, + {_sSI: _cDPR, _smit: None}, + (_pEI, _pIo), + ((RESOURCE_ID, 9), (RESOURCE_ID, 9)), +) + +DELETE_POLICY_OUTPUT: StaticSchema = ( + 18, + n0, + _DPO, + {_sSI: _cDPRo, _smith: None}, + (_pIo, _n, _pEI, _cA, _uA, _pAo, _st, _eM, _de, _d, _sRta), + ( + (RESOURCE_ID, 1), + (POLICY_NAME, 1), + (RESOURCE_ID, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (POLICY_ARN, 1), + (POLICY_STATUS, 1), + (ENFORCEMENT_MODE, {_smithya: _ACTIVE}), + (POLICY_DEFINITION, 1), + (DESCRIPTION, 0), + (POLICY_STATUS_REASONS, 1), + ), ) -API_GATEWAY_TARGET_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ApiGatewayTargetConfiguration"), - members={ - "restApiId": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "stage": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "apiGatewayToolConfiguration": { - "target": API_GATEWAY_TOOL_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +DELETE_POLICY: StaticOperationSchema = ( + 23, + n0, + _DP, + { + _smithy: MappingProxyType( + { + "method": "DELETE", + "uri": "/policy-engines/{policyEngineId}/policies/{policyId}", + "code": 202, + } + ) + }, + DELETE_POLICY_INPUT, + DELETE_POLICY_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CONNECTOR_PARAMETER_OVERRIDE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ConnectorParameterOverride"), - members={ - "path": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": _STRING}, - "visible": {"target": BOOLEAN}, - }, +GET_POLICY_INPUT: StaticSchema = ( + 18, + n0, + _GPI, + {_sSI: _cGPR, _smit: None}, + (_pEI, _pIo), + ((RESOURCE_ID, 9), (RESOURCE_ID, 9)), +) + +GET_POLICY_OUTPUT: StaticSchema = ( + 18, + n0, + _GPO, + {_sSI: _cGPRo, _smith: None}, + (_pIo, _n, _pEI, _cA, _uA, _pAo, _st, _eM, _de, _d, _sRta), + ( + (RESOURCE_ID, 1), + (POLICY_NAME, 1), + (RESOURCE_ID, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (POLICY_ARN, 1), + (POLICY_STATUS, 1), + (ENFORCEMENT_MODE, {_smithya: _ACTIVE}), + (POLICY_DEFINITION, 1), + (DESCRIPTION, 0), + (POLICY_STATUS_REASONS, 1), + ), ) -CONNECTOR_PARAMETER_OVERRIDES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ConnectorParameterOverrides"), - shape_type=ShapeType.LIST, - members={"member": {"target": CONNECTOR_PARAMETER_OVERRIDE}}, +GET_POLICY: StaticOperationSchema = ( + 23, + n0, + _GPe, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/policy-engines/{policyEngineId}/policies/{policyId}", + "code": 200, + } + ) + }, + GET_POLICY_INPUT, + GET_POLICY_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CONNECTOR_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ConnectorConfiguration"), - members={ - "name": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": _STRING}, - "parameterValues": {"target": DOCUMENT}, - "parameterOverrides": {"target": CONNECTOR_PARAMETER_OVERRIDES}, - }, +GET_POLICY_SUMMARY_INPUT: StaticSchema = ( + 18, + n0, + _GPSI, + {_sSI: _cGPSR, _smit: None}, + (_pEI, _pIo), + ((RESOURCE_ID, 9), (RESOURCE_ID, 9)), +) + +GET_POLICY_SUMMARY_OUTPUT: StaticSchema = ( + 18, + n0, + _GPSO, + {_sSI: _cGPSRo, _smith: None}, + (_pIo, _n, _pEI, _cA, _uA, _pAo, _st, _eM), + ( + (RESOURCE_ID, 1), + (POLICY_NAME, 1), + (RESOURCE_ID, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (POLICY_ARN, 1), + (POLICY_STATUS, 1), + (ENFORCEMENT_MODE, {_smithya: _ACTIVE}), + ), ) -CONNECTOR_CONFIGURATIONS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ConnectorConfigurations"), - shape_type=ShapeType.LIST, - members={"member": {"target": CONNECTOR_CONFIGURATION}}, +GET_POLICY_SUMMARY: StaticOperationSchema = ( + 23, + n0, + _GPS, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/policy-engines/{policyEngineId}/policy-summaries/{policyId}", + "code": 200, + } + ) + }, + GET_POLICY_SUMMARY_INPUT, + GET_POLICY_SUMMARY_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -ENABLED_CONNECTORS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#EnabledConnectors"), - shape_type=ShapeType.LIST, - members={"member": {"target": _STRING}}, +LIST_POLICIES_INPUT: StaticSchema = ( + 18, + n0, + _LPI, + {_sSI: _cLPR, _smit: None}, + (_nT, _mR, _pEI, _tRS), + ( + (NEXT_TOKEN, {_sQ: _nT}), + (MAX_RESULTS, {_sQ: _mR}), + (RESOURCE_ID, 9), + (BEDROCK_AGENTCORE_RESOURCE_ARN, {_sQ: _tRS}), + ), ) -CONNECTOR_VERSION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ConnectorVersion"), - shape_type=ShapeType.STRING, +POLICY: StaticSchema = ( + 18, + n0, + _Po, + 0, + (_pIo, _n, _pEI, _cA, _uA, _pAo, _st, _eM, _de, _d, _sRta), + ( + (RESOURCE_ID, 1), + (POLICY_NAME, 1), + (RESOURCE_ID, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (POLICY_ARN, 1), + (POLICY_STATUS, 1), + (ENFORCEMENT_MODE, {_smithya: _ACTIVE}), + (POLICY_DEFINITION, 1), + (DESCRIPTION, 0), + (POLICY_STATUS_REASONS, 1), + ), ) -CONNECTOR_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ConnectorSource"), - members={ - "connectorId": { - "target": CONNECTOR_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "version": {"target": CONNECTOR_VERSION}, - }, +POLICIES: StaticSchema = (16, n0, _Pol, 0, (_mem,), ((POLICY, 0),)) + +LIST_POLICIES_OUTPUT: StaticSchema = ( + 18, + n0, + _LPO, + {_sSI: _cLPRo, _smith: None}, + (_pol, _nT), + ((POLICIES, 1), (NEXT_TOKEN, 0)), +) + +LIST_POLICIES: StaticOperationSchema = ( + 23, + n0, + _LPi, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/policy-engines/{policyEngineId}/policies", + "code": 200, + } + ) + }, + LIST_POLICIES_INPUT, + LIST_POLICIES_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CONNECTOR_TARGET_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ConnectorTargetConfiguration"), - members={ - "source": { - "target": CONNECTOR_SOURCE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "enabled": {"target": ENABLED_CONNECTORS}, - "configurations": {"target": CONNECTOR_CONFIGURATIONS}, - }, +LIST_POLICY_SUMMARIES_INPUT: StaticSchema = ( + 18, + n0, + _LPSI, + {_sSI: _cLPSR, _smit: None}, + (_nT, _mR, _pEI, _tRS), + ( + (NEXT_TOKEN, {_sQ: _nT}), + (MAX_RESULTS, {_sQ: _mR}), + (RESOURCE_ID, 9), + (BEDROCK_AGENTCORE_RESOURCE_ARN, {_sQ: _tRS}), + ), ) -REQUIRED_PROPERTIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#RequiredProperties"), - shape_type=ShapeType.LIST, - members={"member": {"target": _STRING}}, +POLICY_SUMMARY: StaticSchema = ( + 18, + n0, + _PSoli, + 0, + (_pIo, _n, _pEI, _cA, _uA, _pAo, _st, _eM), + ( + (RESOURCE_ID, 1), + (POLICY_NAME, 1), + (RESOURCE_ID, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (POLICY_ARN, 1), + (POLICY_STATUS, 1), + (ENFORCEMENT_MODE, {_smithya: _ACTIVE}), + ), ) -SCHEMA_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SchemaType"), - shape_type=ShapeType.ENUM, - members={ - "STRING": {"target": UNIT}, - "NUMBER": {"target": UNIT}, - "OBJECT": {"target": UNIT}, - "ARRAY": {"target": UNIT}, - "BOOLEAN": {"target": UNIT}, - "INTEGER": {"target": UNIT}, - }, +POLICY_SUMMARY_LIST: StaticSchema = (16, n0, _PSL, 0, (_mem,), ((POLICY_SUMMARY, 0),)) + +LIST_POLICY_SUMMARIES_OUTPUT: StaticSchema = ( + 18, + n0, + _LPSO, + {_sSI: _cLPSRo, _smith: None}, + (_pol, _nT), + ((POLICY_SUMMARY_LIST, 1), (NEXT_TOKEN, 0)), +) + +LIST_POLICY_SUMMARIES: StaticOperationSchema = ( + 23, + n0, + _LPS, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/policy-engines/{policyEngineId}/policy-summaries", + "code": 200, + } + ) + }, + LIST_POLICY_SUMMARIES_INPUT, + LIST_POLICY_SUMMARIES_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -LISTING_MODE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListingMode"), - shape_type=ShapeType.ENUM, - members={"DEFAULT": {"target": UNIT}, "DYNAMIC": {"target": UNIT}}, +UPDATE_POLICY_INPUT: StaticSchema = ( + 18, + n0, + _UPI, + {_sSI: _cUPR, _smit: None}, + (_pEI, _pIo, _d, _de, _vM, _eM), + ( + (RESOURCE_ID, 9), + (RESOURCE_ID, 9), + (UPDATED_DESCRIPTION, 0), + (POLICY_DEFINITION, 0), + (POLICY_VALIDATION_MODE, {_smithya: _FOAF}), + (ENFORCEMENT_MODE, {_smithya: None}), + ), ) -MCP_TOOL_SCHEMA_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#McpToolSchemaConfiguration"), - shape_type=ShapeType.UNION, - members={ - "s3": {"target": S3_CONFIGURATION}, - "inlinePayload": {"target": INLINE_PAYLOAD}, - }, +UPDATE_POLICY_OUTPUT: StaticSchema = ( + 18, + n0, + _UPOp, + {_sSI: _cUPRo, _smith: None}, + (_pIo, _n, _pEI, _cA, _uA, _pAo, _st, _eM, _de, _d, _sRta), + ( + (RESOURCE_ID, 1), + (POLICY_NAME, 1), + (RESOURCE_ID, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (POLICY_ARN, 1), + (POLICY_STATUS, 1), + (ENFORCEMENT_MODE, {_smithya: _ACTIVE}), + (POLICY_DEFINITION, 1), + (DESCRIPTION, 0), + (POLICY_STATUS_REASONS, 1), + ), ) -TARGET_RESOURCE_PRIORITY = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#TargetResourcePriority"), - shape_type=ShapeType.INTEGER, +UPDATE_POLICY: StaticOperationSchema = ( + 23, + n0, + _UPp, + { + _smithy: MappingProxyType( + { + "method": "PATCH", + "uri": "/policy-engines/{policyEngineId}/policies/{policyId}", + "code": 202, + } + ) + }, + UPDATE_POLICY_INPUT, + UPDATE_POLICY_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -MCP_SERVER_TARGET_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#McpServerTargetConfiguration"), - members={ - "endpoint": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "mcpToolSchema": {"target": MCP_TOOL_SCHEMA_CONFIGURATION}, - "listingMode": {"target": LISTING_MODE}, - "resourcePriority": {"target": TARGET_RESOURCE_PRIORITY}, - }, +PUT_RESOURCE_POLICY_INPUT: StaticSchema = ( + 18, + n0, + _PRPI, + {_sSI: _cPRPR, _smit: None}, + (_rAe, _po), + ((BEDROCK_AGENTCORE_RESOURCE_ARN, 9), (RESOURCE_POLICY_BODY, 1)), +) + +PUT_RESOURCE_POLICY_OUTPUT: StaticSchema = ( + 18, + n0, + _PRPO, + {_sSI: _cPRPRo, _smith: None}, + (_po,), + ((RESOURCE_POLICY_BODY, 1),), +) + +PUT_RESOURCE_POLICY: StaticOperationSchema = ( + 23, + n0, + _PRP, + { + _smithy: MappingProxyType( + {"code": 201, "method": "PUT", "uri": "/resourcepolicy/{resourceArn}"} + ) + }, + PUT_RESOURCE_POLICY_INPUT, + PUT_RESOURCE_POLICY_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -O_AUTH2_AUTHORIZATION_DATA = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#OAuth2AuthorizationData"), - members={ - "authorizationUrl": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "userId": {"target": _STRING}, - }, +CUSTOM_DESCRIPTOR: StaticSchema = (18, n0, _CDus, 0, (_iC,), ((INLINE_CONTENT, 0),)) + +SERVER_DEFINITION: StaticSchema = ( + 18, + n0, + _SDe, + 0, + (_sV, _iC), + ((SCHEMA_VERSION, 0), (INLINE_CONTENT, 0)), +) + +TOOLS_DEFINITION: StaticSchema = ( + 18, + n0, + _TDo, + 0, + (_pVr, _iC), + ((SCHEMA_VERSION, 0), (INLINE_CONTENT, 0)), +) + +MCP_DESCRIPTOR: StaticSchema = ( + 18, + n0, + _MD, + 0, + (_se, _too), + ((SERVER_DEFINITION, 0), (TOOLS_DEFINITION, 0)), +) + +DESCRIPTORS: StaticSchema = ( + 18, + n0, + _Des, + 0, + (_mc, _aa, _cu, _aSg), + ( + (MCP_DESCRIPTOR, 0), + (A2A_DESCRIPTOR, 0), + (CUSTOM_DESCRIPTOR, 0), + (AGENT_SKILLS_DESCRIPTOR, 0), + ), ) -AUTHORIZATION_DATA = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#AuthorizationData"), - shape_type=ShapeType.UNION, - members={"oauth2": {"target": O_AUTH2_AUTHORIZATION_DATA}}, +DESCRIPTOR_TYPE: StaticSchema = ( + 14, + n0, + _DTe, + 0, + (_MCP, _AA_, _CUSTOM, _AS), + ((-1, {_sVm: _MCP}), (-1, {_sVm: _AA_}), (-1, {_sVm: _CUSTOM}), (-1, {_sVm: _AS})), ) -DOMAIN_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DomainName"), - shape_type=ShapeType.STRING, -) +REGISTRY_RECORD_NAME: StaticSchema = (3, n0, _RRN, 0) -RESOURCE_ASSOCIATION_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceAssociationArn"), - shape_type=ShapeType.STRING, +REGISTRY_RECORD_VERSION: StaticSchema = (3, n0, _RRV, 0) + +REGISTRY_IDENTIFIER: StaticSchema = (3, n0, _RIe, 0) + +IAM_SIGNING_REGION: StaticSchema = (3, n0, _ISR, 0) + +IAM_ROLE_ARN: StaticSchema = (3, n0, _IRA, 0) + +IAM_SIGNING_SERVICE_NAME: StaticSchema = (3, n0, _ISSN, 0) + +REGISTRY_RECORD_IAM_CREDENTIAL_PROVIDER: StaticSchema = ( + 18, + n0, + _RRICP, + 0, + (_rA, _ser, _reg), + ((IAM_ROLE_ARN, 0), (IAM_SIGNING_SERVICE_NAME, 0), (IAM_SIGNING_REGION, 0)), ) -RESOURCE_GATEWAY_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceGatewayArn"), - shape_type=ShapeType.STRING, +CUSTOM_PARAMETER_MAP: StaticSchema = (17, n0, _CPMu, 0, (_k, _v), ((3, 0), (3, 0))) + +REGISTRY_RECORD_O_AUTH_GRANT_TYPE: StaticSchema = ( + 14, + n0, + _RROAGT, + 0, + (_CC_,), + ((-1, {_sVm: _CC_}),), ) -MANAGED_RESOURCE_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ManagedResourceDetails"), - members={ - "domain": {"target": DOMAIN_NAME}, - "resourceGatewayArn": {"target": RESOURCE_GATEWAY_ARN}, - "resourceAssociationArn": {"target": RESOURCE_ASSOCIATION_ARN}, - }, +CREDENTIAL_PROVIDER_ARN: StaticSchema = (3, n0, _CPAr, 0) + +SCOPE_LIST: StaticSchema = (16, n0, _SLc, 0, (_mem,), ((3, 0),)) + +REGISTRY_RECORD_O_AUTH_CREDENTIAL_PROVIDER: StaticSchema = ( + 18, + n0, + _RROACP, + 0, + (_pAr, _gT, _sco, _cPu), + ( + (CREDENTIAL_PROVIDER_ARN, 1), + (REGISTRY_RECORD_O_AUTH_GRANT_TYPE, 0), + (SCOPE_LIST, 0), + (CUSTOM_PARAMETER_MAP, 0), + ), ) -PRIVATE_ENDPOINT_MANAGED_RESOURCES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PrivateEndpointManagedResources"), - shape_type=ShapeType.LIST, - members={"member": {"target": MANAGED_RESOURCE_DETAILS}}, -) - -TARGET_PROTOCOL_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#TargetProtocolType"), - shape_type=ShapeType.ENUM, - members={"MCP": {"target": UNIT}, "HTTP": {"target": UNIT}}, -) - -TARGET_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#TargetStatus"), - shape_type=ShapeType.ENUM, - members={ - "CREATING": {"target": UNIT}, - "UPDATING": {"target": UNIT}, - "UPDATE_UNSUCCESSFUL": {"target": UNIT}, - "DELETING": {"target": UNIT}, - "READY": {"target": UNIT}, - "FAILED": {"target": UNIT}, - "SYNCHRONIZING": {"target": UNIT}, - "SYNCHRONIZE_UNSUCCESSFUL": {"target": UNIT}, - "CREATE_PENDING_AUTH": {"target": UNIT}, - "UPDATE_PENDING_AUTH": {"target": UNIT}, - "SYNCHRONIZE_PENDING_AUTH": {"target": UNIT}, - }, +REGISTRY_RECORD_CREDENTIAL_PROVIDER_UNION: StaticSchema = ( + 19, + n0, + _RRCPU, + 0, + (_oCP, _iCP), + ( + (REGISTRY_RECORD_O_AUTH_CREDENTIAL_PROVIDER, 0), + (REGISTRY_RECORD_IAM_CREDENTIAL_PROVIDER, 0), + ), ) -TARGET_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#TargetId"), - shape_type=ShapeType.STRING, +REGISTRY_RECORD_CREDENTIAL_PROVIDER_TYPE: StaticSchema = ( + 14, + n0, + _RRCPT, + 0, + (_OAUTH, _IAM), + ((-1, {_sVm: _OAUTH}), (-1, {_sVm: _IAM})), +) + +REGISTRY_RECORD_CREDENTIAL_PROVIDER_CONFIGURATION: StaticSchema = ( + 18, + n0, + _RRCPC, + 0, + (_cPT, _cPre), + ( + (REGISTRY_RECORD_CREDENTIAL_PROVIDER_TYPE, 1), + (REGISTRY_RECORD_CREDENTIAL_PROVIDER_UNION, 1), + ), ) -DELETE_GATEWAY_TARGET_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteGatewayTargetInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeleteGatewayTargetRequest", - ) - ], - members={ - "gatewayIdentifier": { - "target": GATEWAY_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "targetId": { - "target": TARGET_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, +REGISTRY_RECORD_CREDENTIAL_PROVIDER_CONFIGURATION_LIST: StaticSchema = ( + 16, + n0, + _RRCPCL, + 0, + (_mem,), + ((REGISTRY_RECORD_CREDENTIAL_PROVIDER_CONFIGURATION, 0),), +) + +MCP_SERVER_URL: StaticSchema = (3, n0, _MSU, 0) + +FROM_URL_SYNCHRONIZATION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _FUSC, + 0, + (_ur, _cPCr), + ((MCP_SERVER_URL, 1), (REGISTRY_RECORD_CREDENTIAL_PROVIDER_CONFIGURATION_LIST, 0)), +) + +SYNCHRONIZATION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _SCy, + 0, + (_fU,), + ((FROM_URL_SYNCHRONIZATION_CONFIGURATION, 0),), +) + +SYNCHRONIZATION_TYPE: StaticSchema = (14, n0, _STy, 0, (_URL,), ((-1, {_sVm: _URL}),)) + +CREATE_REGISTRY_RECORD_INPUT: StaticSchema = ( + 18, + n0, + _CRRI, + {_sSI: _cCRRR, _smit: None}, + (_rIe, _n, _d, _dT, _des, _rVe, _sTy, _sCy, _cT), + ( + (REGISTRY_IDENTIFIER, 9), + (REGISTRY_RECORD_NAME, 1), + (DESCRIPTION, 0), + (DESCRIPTOR_TYPE, 1), + (DESCRIPTORS, 0), + (REGISTRY_RECORD_VERSION, 0), + (SYNCHRONIZATION_TYPE, 0), + (SYNCHRONIZATION_CONFIGURATION, 0), + (CLIENT_TOKEN, 2), + ), ) -DELETE_GATEWAY_TARGET_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteGatewayTargetOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeleteGatewayTargetResponse", - ) - ], - members={ - "gatewayArn": { - "target": GATEWAY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "targetId": { - "target": TARGET_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": TARGET_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "statusReasons": {"target": STATUS_REASONS}, - }, +REGISTRY_RECORD_ARN: StaticSchema = (3, n0, _RRA, 0) + +REGISTRY_RECORD_STATUS: StaticSchema = ( + 14, + n0, + _RRS, + 0, + (_DRAFT, _PA_, _APPROVED, _REJECTED, _DEPRECATED, _CREATING, _UPDATING, _CF, _UF), + ( + (-1, {_sVm: _DRAFT}), + (-1, {_sVm: _PA_}), + (-1, {_sVm: _APPROVED}), + (-1, {_sVm: _REJECTED}), + (-1, {_sVm: _DEPRECATED}), + (-1, {_sVm: _CREATING}), + (-1, {_sVm: _UPDATING}), + (-1, {_sVm: _CF}), + (-1, {_sVm: _UF}), + ), ) -DELETE_GATEWAY_TARGET = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteGatewayTarget"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 202, - "method": "DELETE", - "uri": "/gateways/{gatewayIdentifier}/targets/{targetId}/", - } - ), - ) - ], +CREATE_REGISTRY_RECORD_OUTPUT: StaticSchema = ( + 18, + n0, + _CRRO, + {_sSI: _cCRRRo, _smith: None}, + (_rAec, _st), + ((REGISTRY_RECORD_ARN, 1), (REGISTRY_RECORD_STATUS, 1)), +) + +CREATE_REGISTRY_RECORD: StaticOperationSchema = ( + 23, + n0, + _CRR, + { + _smithy: MappingProxyType( + {"method": "POST", "uri": "/registries/{registryId}/records", "code": 202} + ) + }, + CREATE_REGISTRY_RECORD_INPUT, + CREATE_REGISTRY_RECORD_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -GET_GATEWAY_TARGET_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetGatewayTargetInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetGatewayTargetRequest", - ) - ], - members={ - "gatewayIdentifier": { - "target": GATEWAY_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "targetId": { - "target": TARGET_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, +RECORD_IDENTIFIER: StaticSchema = (3, n0, _RIec, 0) + +DELETE_REGISTRY_RECORD_INPUT: StaticSchema = ( + 18, + n0, + _DRRI, + {_sSI: _cDRRR, _smit: None}, + (_rIe, _rIec), + ((REGISTRY_IDENTIFIER, 9), (RECORD_IDENTIFIER, 9)), +) + +DELETE_REGISTRY_RECORD_OUTPUT: StaticSchema = ( + 18, + n0, + _DRRO, + {_sSI: _cDRRRo, _smith: None}, +) + +DELETE_REGISTRY_RECORD: StaticOperationSchema = ( + 23, + n0, + _DRR, + { + _smithy: MappingProxyType( + { + "method": "DELETE", + "uri": "/registries/{registryId}/records/{recordId}", + "code": 200, + } + ) + }, + DELETE_REGISTRY_RECORD_INPUT, + DELETE_REGISTRY_RECORD_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -TARGET_MAX_RESULTS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#TargetMaxResults"), - shape_type=ShapeType.INTEGER, +GET_REGISTRY_RECORD_INPUT: StaticSchema = ( + 18, + n0, + _GRRI, + {_sSI: _cGRRR, _smit: None}, + (_rIe, _rIec), + ((REGISTRY_IDENTIFIER, 9), (RECORD_IDENTIFIER, 9)), +) + +REGISTRY_RECORD_ID: StaticSchema = (3, n0, _RRI, 0) + +REGISTRY_ARN: StaticSchema = (3, n0, _RAe, 0) + +GET_REGISTRY_RECORD_OUTPUT: StaticSchema = ( + 18, + n0, + _GRRO, + {_sSI: _cGRRRo, _smith: None}, + (_rAeg, _rAec, _rIec, _n, _d, _dT, _des, _rVe, _st, _cA, _uA, _sRt, _sTy, _sCy), + ( + (REGISTRY_ARN, 1), + (REGISTRY_RECORD_ARN, 1), + (REGISTRY_RECORD_ID, 1), + (REGISTRY_RECORD_NAME, 1), + (DESCRIPTION, 0), + (DESCRIPTOR_TYPE, 1), + (DESCRIPTORS, 1), + (REGISTRY_RECORD_VERSION, 0), + (REGISTRY_RECORD_STATUS, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (3, 0), + (SYNCHRONIZATION_TYPE, 0), + (SYNCHRONIZATION_CONFIGURATION, 0), + ), ) -TARGET_NEXT_TOKEN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#TargetNextToken"), - shape_type=ShapeType.STRING, +GET_REGISTRY_RECORD: StaticOperationSchema = ( + 23, + n0, + _GRR, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/registries/{registryId}/records/{recordId}", + "code": 200, + } + ) + }, + GET_REGISTRY_RECORD_INPUT, + GET_REGISTRY_RECORD_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -LIST_GATEWAY_TARGETS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListGatewayTargetsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListGatewayTargetsRequest", - ) - ], - members={ - "gatewayIdentifier": { - "target": GATEWAY_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "maxResults": { - "target": TARGET_MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "nextToken": { - "target": TARGET_NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - }, +LIST_REGISTRY_RECORDS_INPUT: StaticSchema = ( + 18, + n0, + _LRRI, + {_sSI: _cLRRR, _smit: None}, + (_rIe, _mR, _nT, _n, _st, _dT), + ( + (REGISTRY_IDENTIFIER, 9), + (MAX_RESULTS, {_sQ: _mR}), + (NEXT_TOKEN, {_sQ: _nT}), + (REGISTRY_RECORD_NAME, {_sQ: _n}), + (REGISTRY_RECORD_STATUS, {_sQ: _st}), + (DESCRIPTOR_TYPE, {_sQ: _dT}), + ), ) -TARGET_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#TargetType"), - shape_type=ShapeType.ENUM, - members={ - "OPEN_API_SCHEMA": {"target": UNIT}, - "SMITHY_MODEL": {"target": UNIT}, - "MCP_SERVER": {"target": UNIT}, - "LAMBDA": {"target": UNIT}, - "API_GATEWAY": {"target": UNIT}, - "CONNECTOR": {"target": UNIT}, - "AGENTCORE_RUNTIME": {"target": UNIT}, - "PASSTHROUGH": {"target": UNIT}, - "PROVIDER": {"target": UNIT}, - "HTTP_CONNECTOR": {"target": UNIT}, - }, +REGISTRY_RECORD_SUMMARY: StaticSchema = ( + 18, + n0, + _RRSe, + 0, + (_rAeg, _rAec, _rIec, _n, _d, _dT, _rVe, _st, _cA, _uA), + ( + (REGISTRY_ARN, 1), + (REGISTRY_RECORD_ARN, 1), + (REGISTRY_RECORD_ID, 1), + (REGISTRY_RECORD_NAME, 1), + (DESCRIPTION, 0), + (DESCRIPTOR_TYPE, 1), + (REGISTRY_RECORD_VERSION, 1), + (REGISTRY_RECORD_STATUS, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + ), ) -TARGET_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#TargetSummary"), - members={ - "targetId": { - "target": TARGET_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": TARGET_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": TARGET_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": TARGET_DESCRIPTION}, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "resourcePriority": {"target": TARGET_RESOURCE_PRIORITY}, - "lastSynchronizedAt": {"target": DATE_TIMESTAMP}, - "authorizationData": {"target": AUTHORIZATION_DATA}, - "targetType": {"target": TARGET_TYPE}, - "listingMode": {"target": LISTING_MODE}, - }, +REGISTRY_RECORD_SUMMARY_LIST: StaticSchema = ( + 16, + n0, + _RRSL, + 0, + (_mem,), + ((REGISTRY_RECORD_SUMMARY, 0),), +) + +LIST_REGISTRY_RECORDS_OUTPUT: StaticSchema = ( + 18, + n0, + _LRRO, + {_sSI: _cLRRRo, _smith: None}, + (_rR, _nT), + ((REGISTRY_RECORD_SUMMARY_LIST, 1), (NEXT_TOKEN, 0)), +) + +LIST_REGISTRY_RECORDS: StaticOperationSchema = ( + 23, + n0, + _LRR, + { + _smithy: MappingProxyType( + {"method": "GET", "uri": "/registries/{registryId}/records", "code": 200} + ) + }, + LIST_REGISTRY_RECORDS_INPUT, + LIST_REGISTRY_RECORDS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -TARGET_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#TargetSummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": TARGET_SUMMARY}}, +SUBMIT_REGISTRY_RECORD_FOR_APPROVAL_INPUT: StaticSchema = ( + 18, + n0, + _SRRFAI, + {_sSI: _cSRRFAR, _smit: None}, + (_rIe, _rIec), + ((REGISTRY_IDENTIFIER, 9), (RECORD_IDENTIFIER, 9)), +) + +SUBMIT_REGISTRY_RECORD_FOR_APPROVAL_OUTPUT: StaticSchema = ( + 18, + n0, + _SRRFAO, + {_sSI: _cSRRFARo, _smith: None}, + (_rAeg, _rAec, _rIec, _st, _uA), + ( + (REGISTRY_ARN, 1), + (REGISTRY_RECORD_ARN, 1), + (REGISTRY_RECORD_ID, 1), + (REGISTRY_RECORD_STATUS, 1), + (DATE_TIMESTAMP, 1), + ), ) -LIST_GATEWAY_TARGETS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListGatewayTargetsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListGatewayTargetsResponse", - ) - ], - members={ - "items": { - "target": TARGET_SUMMARIES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": TARGET_NEXT_TOKEN}, - }, +SUBMIT_REGISTRY_RECORD_FOR_APPROVAL: StaticOperationSchema = ( + 23, + n0, + _SRRFA, + { + _smithy: MappingProxyType( + { + "method": "POST", + "uri": "/registries/{registryId}/records/{recordId}/submit-for-approval", + "code": 202, + } + ) + }, + SUBMIT_REGISTRY_RECORD_FOR_APPROVAL_INPUT, + SUBMIT_REGISTRY_RECORD_FOR_APPROVAL_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -LIST_GATEWAY_TARGETS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListGatewayTargets"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/gateways/{gatewayIdentifier}/targets/", - } - ), - ) - ], +UPDATED_A2A_DESCRIPTOR: StaticSchema = (18, n0, _UAD, 0, (_oV,), ((A2A_DESCRIPTOR, 0),)) + +UPDATED_SKILL_DEFINITION: StaticSchema = ( + 18, + n0, + _USD, + 0, + (_oV,), + ((SKILL_DEFINITION, 0),), +) + +UPDATED_SKILL_MD_DEFINITION: StaticSchema = ( + 18, + n0, + _USMD, + 0, + (_oV,), + ((SKILL_MD_DEFINITION, 0),), +) + +UPDATED_AGENT_SKILLS_DESCRIPTOR_FIELDS: StaticSchema = ( + 18, + n0, + _UASDF, + 0, + (_sM, _sD), + ((UPDATED_SKILL_MD_DEFINITION, 0), (UPDATED_SKILL_DEFINITION, 0)), +) + +UPDATED_AGENT_SKILLS_DESCRIPTOR: StaticSchema = ( + 18, + n0, + _UASD, + 0, + (_oV,), + ((UPDATED_AGENT_SKILLS_DESCRIPTOR_FIELDS, 0),), +) + +UPDATED_CUSTOM_DESCRIPTOR: StaticSchema = ( + 18, + n0, + _UCD, + 0, + (_oV,), + ((CUSTOM_DESCRIPTOR, 0),), +) + +UPDATED_SERVER_DEFINITION: StaticSchema = ( + 18, + n0, + _USDp, + 0, + (_oV,), + ((SERVER_DEFINITION, 0),), +) + +UPDATED_TOOLS_DEFINITION: StaticSchema = ( + 18, + n0, + _UTD, + 0, + (_oV,), + ((TOOLS_DEFINITION, 0),), +) + +UPDATED_MCP_DESCRIPTOR_FIELDS: StaticSchema = ( + 18, + n0, + _UMDF, + 0, + (_se, _too), + ((UPDATED_SERVER_DEFINITION, 0), (UPDATED_TOOLS_DEFINITION, 0)), +) + +UPDATED_MCP_DESCRIPTOR: StaticSchema = ( + 18, + n0, + _UMD, + 0, + (_oV,), + ((UPDATED_MCP_DESCRIPTOR_FIELDS, 0),), +) + +UPDATED_DESCRIPTORS_UNION: StaticSchema = ( + 18, + n0, + _UDU, + 0, + (_mc, _aa, _cu, _aSg), + ( + (UPDATED_MCP_DESCRIPTOR, 0), + (UPDATED_A2A_DESCRIPTOR, 0), + (UPDATED_CUSTOM_DESCRIPTOR, 0), + (UPDATED_AGENT_SKILLS_DESCRIPTOR, 0), + ), ) -TARGET_ID_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#TargetIdList"), - shape_type=ShapeType.LIST, - members={"member": {"target": TARGET_ID}}, +UPDATED_DESCRIPTORS: StaticSchema = ( + 18, + n0, + _UDpd, + 0, + (_oV,), + ((UPDATED_DESCRIPTORS_UNION, 0),), +) + +UPDATED_SYNCHRONIZATION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _USC, + 0, + (_oV,), + ((SYNCHRONIZATION_CONFIGURATION, 0),), +) + +UPDATED_SYNCHRONIZATION_TYPE: StaticSchema = ( + 18, + n0, + _UST, + 0, + (_oV,), + ((SYNCHRONIZATION_TYPE, 0),), +) + +UPDATE_REGISTRY_RECORD_INPUT: StaticSchema = ( + 18, + n0, + _URRI, + {_sSI: _cURRR, _smit: None}, + (_rIe, _rIec, _n, _d, _dT, _des, _rVe, _sTy, _sCy, _tSr), + ( + (REGISTRY_IDENTIFIER, 9), + (RECORD_IDENTIFIER, 9), + (REGISTRY_RECORD_NAME, 0), + (UPDATED_DESCRIPTION, 0), + (DESCRIPTOR_TYPE, 0), + (UPDATED_DESCRIPTORS, 0), + (REGISTRY_RECORD_VERSION, 0), + (UPDATED_SYNCHRONIZATION_TYPE, 0), + (UPDATED_SYNCHRONIZATION_CONFIGURATION, 0), + (2, 0), + ), ) -SYNCHRONIZE_GATEWAY_TARGETS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SynchronizeGatewayTargetsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#SynchronizeGatewayTargetsRequest", - ) - ], - members={ - "gatewayIdentifier": { - "target": GATEWAY_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "targetIdList": { - "target": TARGET_ID_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -GET_RESOURCE_POLICY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetResourcePolicyInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetResourcePolicyRequest", - ) - ], - members={ - "resourceArn": { - "target": BEDROCK_AGENTCORE_RESOURCE_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -RESOURCE_POLICY_BODY = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourcePolicyBody"), - shape_type=ShapeType.STRING, -) - -GET_RESOURCE_POLICY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetResourcePolicyOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetResourcePolicyResponse", - ) - ], - members={"policy": {"target": RESOURCE_POLICY_BODY}}, -) - -GET_RESOURCE_POLICY = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetResourcePolicy"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "GET", "uri": "/resourcepolicy/{resourceArn}"} - ), - ) - ], -) - -TOKEN_VAULT_ID_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#TokenVaultIdType"), - shape_type=ShapeType.STRING, -) - -GET_TOKEN_VAULT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetTokenVaultInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetTokenVaultRequest", - ) - ], - members={"tokenVaultId": {"target": TOKEN_VAULT_ID_TYPE}}, -) - -KEY_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#KeyType"), - shape_type=ShapeType.ENUM, - members={ - "CustomerManagedKey": {"target": UNIT}, - "ServiceManagedKey": {"target": UNIT}, - }, -) - -KMS_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#KmsConfiguration"), - members={ - "keyType": { - "target": KEY_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "kmsKeyArn": {"target": KMS_KEY_ARN}, - }, -) - -GET_TOKEN_VAULT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetTokenVaultOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetTokenVaultResponse", - ) - ], - members={ - "tokenVaultId": { - "target": TOKEN_VAULT_ID_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "kmsConfiguration": { - "target": KMS_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastModifiedDate": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -GET_TOKEN_VAULT = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetTokenVault"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"uri": "/identities/get-token-vault", "method": "POST"} - ), - ) - ], -) - -HARNESS_ENDPOINT_DESCRIPTION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessEndpointDescription"), - shape_type=ShapeType.STRING, -) - -HARNESS_ENDPOINT_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessEndpointName"), - shape_type=ShapeType.STRING, -) - -HARNESS_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessId"), - shape_type=ShapeType.STRING, -) - -HARNESS_VERSION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessVersion"), - shape_type=ShapeType.STRING, -) - -CREATE_HARNESS_ENDPOINT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateHarnessEndpointInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreateHarnessEndpointRequest", - ) - ], - members={ - "harnessId": { - "target": HARNESS_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "endpointName": { - "target": HARNESS_ENDPOINT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "targetVersion": {"target": HARNESS_VERSION}, - "description": {"target": HARNESS_ENDPOINT_DESCRIPTION}, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "tags": {"target": TAGS_MAP}, - }, -) - -HARNESS_ENDPOINT_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessEndpointArn"), - shape_type=ShapeType.STRING, -) - -HARNESS_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessName"), - shape_type=ShapeType.STRING, -) - -HARNESS_ENDPOINT_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessEndpointStatus"), - shape_type=ShapeType.ENUM, - members={ - "CREATING": {"target": UNIT}, - "CREATE_FAILED": {"target": UNIT}, - "UPDATING": {"target": UNIT}, - "UPDATE_FAILED": {"target": UNIT}, - "READY": {"target": UNIT}, - "DELETING": {"target": UNIT}, - "DELETE_FAILED": {"target": UNIT}, - }, -) - -HARNESS_ENDPOINT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessEndpoint"), - members={ - "harnessId": { - "target": HARNESS_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "harnessName": { - "target": HARNESS_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "endpointName": { - "target": HARNESS_ENDPOINT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "arn": { - "target": HARNESS_ENDPOINT_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": HARNESS_ENDPOINT_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "liveVersion": {"target": HARNESS_VERSION}, - "targetVersion": {"target": HARNESS_VERSION}, - "description": {"target": HARNESS_ENDPOINT_DESCRIPTION}, - "failureReason": {"target": _STRING}, - }, -) - -CREATE_HARNESS_ENDPOINT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateHarnessEndpointOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreateHarnessEndpointResponse", - ) - ], - members={ - "endpoint": { - "target": HARNESS_ENDPOINT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -CREATE_HARNESS_ENDPOINT = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateHarnessEndpoint"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 201, - "method": "POST", - "uri": "/harnesses/{harnessId}/endpoints", - } - ), - ) - ], -) - -DELETE_HARNESS_ENDPOINT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteHarnessEndpointInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeleteHarnessEndpointRequest", - ) - ], - members={ - "harnessId": { - "target": HARNESS_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "endpointName": { - "target": HARNESS_ENDPOINT_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#idempotencyToken")), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="clientToken"), - ], - }, - }, -) - -DELETE_HARNESS_ENDPOINT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteHarnessEndpointOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeleteHarnessEndpointResponse", - ) - ], - members={ - "endpoint": { - "target": HARNESS_ENDPOINT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -DELETE_HARNESS_ENDPOINT = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteHarnessEndpoint"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "DELETE", - "uri": "/harnesses/{harnessId}/endpoints/{endpointName}", - } - ), - ) - ], -) - -GET_HARNESS_ENDPOINT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetHarnessEndpointInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetHarnessEndpointRequest", - ) - ], - members={ - "harnessId": { - "target": HARNESS_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "endpointName": { - "target": HARNESS_ENDPOINT_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -GET_HARNESS_ENDPOINT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetHarnessEndpointOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetHarnessEndpointResponse", - ) - ], - members={ - "endpoint": { - "target": HARNESS_ENDPOINT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -GET_HARNESS_ENDPOINT = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetHarnessEndpoint"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/harnesses/{harnessId}/endpoints/{endpointName}", - } - ), - ) - ], -) - -LIST_HARNESS_ENDPOINTS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListHarnessEndpointsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListHarnessEndpointsRequest", - ) - ], - members={ - "harnessId": { - "target": HARNESS_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - }, -) - -HARNESS_ENDPOINTS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessEndpoints"), - shape_type=ShapeType.LIST, - members={"member": {"target": HARNESS_ENDPOINT}}, -) - -LIST_HARNESS_ENDPOINTS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListHarnessEndpointsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListHarnessEndpointsResponse", - ) - ], - members={ - "endpoints": { - "target": HARNESS_ENDPOINTS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": NEXT_TOKEN}, - }, -) - -LIST_HARNESS_ENDPOINTS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListHarnessEndpoints"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/harnesses/{harnessId}/endpoints", - } - ), - ) - ], -) - -UPDATE_HARNESS_ENDPOINT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateHarnessEndpointInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UpdateHarnessEndpointRequest", - ) - ], - members={ - "harnessId": { - "target": HARNESS_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "endpointName": { - "target": HARNESS_ENDPOINT_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "targetVersion": {"target": HARNESS_VERSION}, - "description": {"target": HARNESS_ENDPOINT_DESCRIPTION}, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - }, -) - -UPDATE_HARNESS_ENDPOINT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateHarnessEndpointOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UpdateHarnessEndpointResponse", - ) - ], - members={ - "endpoint": { - "target": HARNESS_ENDPOINT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -UPDATE_HARNESS_ENDPOINT = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateHarnessEndpoint"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "PATCH", - "uri": "/harnesses/{harnessId}/endpoints/{endpointName}", - } - ), - ) - ], -) - -HARNESS_ALLOWED_TOOL = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessAllowedTool"), - shape_type=ShapeType.STRING, -) - -HARNESS_ALLOWED_TOOLS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessAllowedTools"), - shape_type=ShapeType.LIST, - members={"member": {"target": HARNESS_ALLOWED_TOOL}}, -) - -HARNESS_AGENT_CORE_RUNTIME_ENVIRONMENT_REQUEST = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#HarnessAgentCoreRuntimeEnvironmentRequest" - ), - members={ - "lifecycleConfiguration": {"target": LIFECYCLE_CONFIGURATION}, - "networkConfiguration": {"target": NETWORK_CONFIGURATION}, - "filesystemConfigurations": {"target": FILESYSTEM_CONFIGURATIONS}, - }, -) - -HARNESS_ENVIRONMENT_PROVIDER_REQUEST = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#HarnessEnvironmentProviderRequest" - ), - shape_type=ShapeType.UNION, - members={ - "agentCoreRuntimeEnvironment": { - "target": HARNESS_AGENT_CORE_RUNTIME_ENVIRONMENT_REQUEST - } - }, -) - -HARNESS_ENVIRONMENT_ARTIFACT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessEnvironmentArtifact"), - shape_type=ShapeType.UNION, - members={"containerConfiguration": {"target": CONTAINER_CONFIGURATION}}, -) - -HARNESS_HOOK_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessHookName"), - shape_type=ShapeType.STRING, -) - -HARNESS_EVENT_BRIDGE_BUS_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessEventBridgeBusArn"), - shape_type=ShapeType.STRING, -) - -HARNESS_HOOK_EVENT_BRIDGE_TARGET = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessHookEventBridgeTarget"), - members={ - "arn": { - "target": HARNESS_EVENT_BRIDGE_BUS_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -HARNESS_LAMBDA_FUNCTION_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessLambdaFunctionArn"), - shape_type=ShapeType.STRING, -) - -HARNESS_HOOK_FAILURE_MODE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessHookFailureMode"), - shape_type=ShapeType.ENUM, - members={"ALLOW": {"target": UNIT}, "DENY": {"target": UNIT}}, -) - -HARNESS_HOOK_LAMBDA_TARGET = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessHookLambdaTarget"), - members={ - "arn": { - "target": HARNESS_LAMBDA_FUNCTION_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "timeoutSeconds": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=60)], - }, - "failureMode": { - "target": HARNESS_HOOK_FAILURE_MODE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="deny")], - }, - }, -) - -HARNESS_SNS_TOPIC_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessSnsTopicArn"), - shape_type=ShapeType.STRING, -) - -HARNESS_HOOK_SNS_TARGET = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessHookSnsTarget"), - members={ - "arn": { - "target": HARNESS_SNS_TOPIC_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -HARNESS_HOOK_TARGET = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessHookTarget"), - shape_type=ShapeType.UNION, - members={ - "lambda": {"target": HARNESS_HOOK_LAMBDA_TARGET}, - "sns": {"target": HARNESS_HOOK_SNS_TARGET}, - "eventBridge": {"target": HARNESS_HOOK_EVENT_BRIDGE_TARGET}, - }, -) - -HARNESS_AFTER_INVOCATION_HOOK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessAfterInvocationHook"), - members={ - "name": { - "target": HARNESS_HOOK_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "target": { - "target": HARNESS_HOOK_TARGET, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -HARNESS_AFTER_TOOL_CALL_HOOK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessAfterToolCallHook"), - members={ - "name": { - "target": HARNESS_HOOK_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "target": { - "target": HARNESS_HOOK_TARGET, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -HARNESS_BEFORE_INVOCATION_HOOK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessBeforeInvocationHook"), - members={ - "name": { - "target": HARNESS_HOOK_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "target": { - "target": HARNESS_HOOK_TARGET, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -HARNESS_BEFORE_TOOL_CALL_HOOK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessBeforeToolCallHook"), - members={ - "name": { - "target": HARNESS_HOOK_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "target": { - "target": HARNESS_HOOK_TARGET, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -HARNESS_HOOK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessHook"), - shape_type=ShapeType.UNION, - members={ - "beforeInvocation": {"target": HARNESS_BEFORE_INVOCATION_HOOK}, - "afterInvocation": {"target": HARNESS_AFTER_INVOCATION_HOOK}, - "beforeToolCall": {"target": HARNESS_BEFORE_TOOL_CALL_HOOK}, - "afterToolCall": {"target": HARNESS_AFTER_TOOL_CALL_HOOK}, - }, -) - -HARNESS_HOOKS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessHooks"), - shape_type=ShapeType.LIST, - members={"member": {"target": HARNESS_HOOK}}, -) - -MEMORY_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#MemoryArn"), - shape_type=ShapeType.STRING, -) - -HARNESS_AGENT_CORE_MEMORY_RETRIEVAL_CONFIG = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#HarnessAgentCoreMemoryRetrievalConfig" - ), - members={ - "topK": {"target": INTEGER}, - "relevanceScore": {"target": FLOAT}, - "strategyId": {"target": _STRING}, - }, -) - -HARNESS_AGENT_CORE_MEMORY_RETRIEVAL_CONFIGS = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#HarnessAgentCoreMemoryRetrievalConfigs" - ), - shape_type=ShapeType.MAP, - members={ - "key": {"target": _STRING}, - "value": {"target": HARNESS_AGENT_CORE_MEMORY_RETRIEVAL_CONFIG}, - }, -) - -HARNESS_AGENT_CORE_MEMORY_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#HarnessAgentCoreMemoryConfiguration" - ), - members={ - "arn": { - "target": MEMORY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "actorId": {"target": _STRING}, - "messagesCount": {"target": INTEGER}, - "retrievalConfig": {"target": HARNESS_AGENT_CORE_MEMORY_RETRIEVAL_CONFIGS}, - }, -) - -HARNESS_DISABLED_MEMORY_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#HarnessDisabledMemoryConfiguration" - ) -) - -HARNESS_MANAGED_MEMORY_STRATEGY_TYPE = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#HarnessManagedMemoryStrategyType" - ), - shape_type=ShapeType.ENUM, - members={ - "SEMANTIC": {"target": UNIT}, - "SUMMARIZATION": {"target": UNIT}, - "USER_PREFERENCE": {"target": UNIT}, - "EPISODIC": {"target": UNIT}, - }, -) - -HARNESS_MANAGED_MEMORY_STRATEGY_LIST = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#HarnessManagedMemoryStrategyList" - ), - shape_type=ShapeType.LIST, - members={"member": {"target": HARNESS_MANAGED_MEMORY_STRATEGY_TYPE}}, -) - -HARNESS_MANAGED_MEMORY_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#HarnessManagedMemoryConfiguration" - ), - members={ - "arn": {"target": MEMORY_ARN}, - "strategies": {"target": HARNESS_MANAGED_MEMORY_STRATEGY_LIST}, - "eventExpiryDuration": {"target": INTEGER}, - "encryptionKeyArn": {"target": KMS_KEY_ARN}, - }, -) - -HARNESS_MEMORY_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessMemoryConfiguration"), - shape_type=ShapeType.UNION, - members={ - "agentCoreMemoryConfiguration": { - "target": HARNESS_AGENT_CORE_MEMORY_CONFIGURATION - }, - "managedMemoryConfiguration": {"target": HARNESS_MANAGED_MEMORY_CONFIGURATION}, - "disabled": {"target": HARNESS_DISABLED_MEMORY_CONFIGURATION}, - }, -) - -HARNESS_BEDROCK_API_FORMAT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessBedrockApiFormat"), - shape_type=ShapeType.ENUM, - members={ - "CONVERSE_STREAM": {"target": UNIT}, - "RESPONSES": {"target": UNIT}, - "CHAT_COMPLETIONS": {"target": UNIT}, - }, -) - -MAX_TOKENS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#MaxTokens"), - shape_type=ShapeType.INTEGER, -) - -TEMPERATURE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#Temperature"), - shape_type=ShapeType.FLOAT, -) - -TOP_P = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#TopP"), shape_type=ShapeType.FLOAT -) - -HARNESS_BEDROCK_MODEL_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessBedrockModelConfig"), - members={ - "modelId": { - "target": MODEL_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "maxTokens": {"target": MAX_TOKENS}, - "temperature": {"target": TEMPERATURE}, - "topP": {"target": TOP_P}, - "apiFormat": {"target": HARNESS_BEDROCK_API_FORMAT}, - "additionalParams": {"target": DOCUMENT}, - }, -) - -API_KEY_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ApiKeyArn"), - shape_type=ShapeType.STRING, -) - -TOP_K = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#TopK"), - shape_type=ShapeType.INTEGER, -) - -HARNESS_GEMINI_MODEL_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessGeminiModelConfig"), - members={ - "modelId": { - "target": MODEL_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "apiKeyArn": { - "target": API_KEY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "maxTokens": {"target": MAX_TOKENS}, - "temperature": {"target": TEMPERATURE}, - "topP": {"target": TOP_P}, - "topK": {"target": TOP_K}, - "additionalParams": {"target": DOCUMENT}, - }, -) - -HARNESS_LITE_LLM_API_BASE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessLiteLlmApiBase"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -HARNESS_LITE_LLM_MODEL_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessLiteLlmModelConfig"), - members={ - "modelId": { - "target": MODEL_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "apiKeyArn": {"target": API_KEY_ARN}, - "apiBase": {"target": HARNESS_LITE_LLM_API_BASE}, - "maxTokens": {"target": MAX_TOKENS}, - "temperature": {"target": TEMPERATURE}, - "topP": {"target": TOP_P}, - "additionalParams": {"target": DOCUMENT}, - }, -) - -HARNESS_OPEN_AI_API_BASE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessOpenAiApiBase"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -HARNESS_OPEN_AI_API_FORMAT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessOpenAiApiFormat"), - shape_type=ShapeType.ENUM, - members={"CHAT_COMPLETIONS": {"target": UNIT}, "RESPONSES": {"target": UNIT}}, -) - -HARNESS_OPEN_AI_MODEL_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessOpenAiModelConfig"), - members={ - "modelId": { - "target": MODEL_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "apiKeyArn": { - "target": API_KEY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "apiBase": {"target": HARNESS_OPEN_AI_API_BASE}, - "maxTokens": {"target": MAX_TOKENS}, - "temperature": {"target": TEMPERATURE}, - "topP": {"target": TOP_P}, - "apiFormat": {"target": HARNESS_OPEN_AI_API_FORMAT}, - "additionalParams": {"target": DOCUMENT}, - }, -) - -HARNESS_MODEL_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessModelConfiguration"), - shape_type=ShapeType.UNION, - members={ - "bedrockModelConfig": {"target": HARNESS_BEDROCK_MODEL_CONFIG}, - "openAiModelConfig": {"target": HARNESS_OPEN_AI_MODEL_CONFIG}, - "geminiModelConfig": {"target": HARNESS_GEMINI_MODEL_CONFIG}, - "liteLlmModelConfig": {"target": HARNESS_LITE_LLM_MODEL_CONFIG}, - }, -) - -HARNESS_AWS_SKILL_PATH = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessAwsSkillPath"), - shape_type=ShapeType.STRING, -) - -HARNESS_AWS_SKILL_PATHS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessAwsSkillPaths"), - shape_type=ShapeType.LIST, - members={"member": {"target": HARNESS_AWS_SKILL_PATH}}, -) - -HARNESS_SKILL_AWS_SKILLS_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessSkillAwsSkillsSource"), - members={"paths": {"target": HARNESS_AWS_SKILL_PATHS}}, -) - -HARNESS_SKILL_GIT_AUTH = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessSkillGitAuth"), - members={ - "credentialArn": { - "target": API_KEY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "username": {"target": _STRING}, - }, -) - -HARNESS_SKILL_GIT_URL = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessSkillGitUrl"), - shape_type=ShapeType.STRING, -) - -HARNESS_SKILL_GIT_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessSkillGitSource"), - members={ - "url": { - "target": HARNESS_SKILL_GIT_URL, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "path": {"target": _STRING}, - "auth": {"target": HARNESS_SKILL_GIT_AUTH}, - }, -) - -HARNESS_SKILL_PATH = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessSkillPath"), - shape_type=ShapeType.STRING, -) - -HARNESS_SKILL_S3_URI = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessSkillS3Uri"), - shape_type=ShapeType.STRING, -) - -HARNESS_SKILL_S3_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessSkillS3Source"), - members={ - "uri": { - "target": HARNESS_SKILL_S3_URI, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -HARNESS_SKILL = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessSkill"), - shape_type=ShapeType.UNION, - members={ - "path": {"target": HARNESS_SKILL_PATH}, - "s3": {"target": HARNESS_SKILL_S3_SOURCE}, - "git": {"target": HARNESS_SKILL_GIT_SOURCE}, - "awsSkills": {"target": HARNESS_SKILL_AWS_SKILLS_SOURCE}, - }, -) - -HARNESS_SKILLS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessSkills"), - shape_type=ShapeType.LIST, - members={"member": {"target": HARNESS_SKILL}}, -) - -SENSITIVE_TEXT = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SensitiveText"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -HARNESS_SYSTEM_CONTENT_BLOCK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessSystemContentBlock"), - shape_type=ShapeType.UNION, - members={"text": {"target": SENSITIVE_TEXT}}, -) - -HARNESS_SYSTEM_PROMPT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessSystemPrompt"), - shape_type=ShapeType.LIST, - members={"member": {"target": HARNESS_SYSTEM_CONTENT_BLOCK}}, -) - -HARNESS_BROWSER_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessBrowserArn"), - shape_type=ShapeType.STRING, -) - -HARNESS_AGENT_CORE_BROWSER_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessAgentCoreBrowserConfig"), - members={"browserArn": {"target": HARNESS_BROWSER_ARN}}, -) - -HARNESS_CODE_INTERPRETER_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessCodeInterpreterArn"), - shape_type=ShapeType.STRING, -) - -HARNESS_AGENT_CORE_CODE_INTERPRETER_CONFIG = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#HarnessAgentCoreCodeInterpreterConfig" - ), - members={"codeInterpreterArn": {"target": HARNESS_CODE_INTERPRETER_ARN}}, -) - -HARNESS_GATEWAY_OUTBOUND_AUTH = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessGatewayOutboundAuth"), - shape_type=ShapeType.UNION, - members={ - "awsIam": {"target": UNIT}, - "none": {"target": UNIT}, - "oauth": {"target": O_AUTH_CREDENTIAL_PROVIDER}, - }, -) - -HARNESS_AGENT_CORE_GATEWAY_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessAgentCoreGatewayConfig"), - members={ - "gatewayArn": { - "target": GATEWAY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "outboundAuth": {"target": HARNESS_GATEWAY_OUTBOUND_AUTH}, - }, -) - -HARNESS_INLINE_FUNCTION_DESCRIPTION = Schema( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#HarnessInlineFunctionDescription" - ), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -HARNESS_INLINE_FUNCTION_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessInlineFunctionConfig"), - members={ - "description": { - "target": HARNESS_INLINE_FUNCTION_DESCRIPTION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "inputSchema": { - "target": SENSITIVE_JSON, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -HTTP_HEADER_KEY = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HttpHeaderKey"), - shape_type=ShapeType.STRING, -) - -HTTP_HEADER_VALUE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HttpHeaderValue"), - shape_type=ShapeType.STRING, -) - -HTTP_HEADERS_MAP = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HttpHeadersMap"), - shape_type=ShapeType.MAP, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "key": {"target": HTTP_HEADER_KEY}, - "value": {"target": HTTP_HEADER_VALUE}, - }, -) - -HARNESS_REMOTE_MCP_URL = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessRemoteMcpUrl"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -HARNESS_REMOTE_MCP_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessRemoteMcpConfig"), - members={ - "url": { - "target": HARNESS_REMOTE_MCP_URL, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "headers": {"target": HTTP_HEADERS_MAP}, - }, -) - -HARNESS_TOOL_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessToolConfiguration"), - shape_type=ShapeType.UNION, - members={ - "remoteMcp": {"target": HARNESS_REMOTE_MCP_CONFIG}, - "agentCoreBrowser": {"target": HARNESS_AGENT_CORE_BROWSER_CONFIG}, - "agentCoreGateway": {"target": HARNESS_AGENT_CORE_GATEWAY_CONFIG}, - "inlineFunction": {"target": HARNESS_INLINE_FUNCTION_CONFIG}, - "agentCoreCodeInterpreter": { - "target": HARNESS_AGENT_CORE_CODE_INTERPRETER_CONFIG - }, - }, -) - -HARNESS_TOOL_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessToolName"), - shape_type=ShapeType.STRING, -) - -HARNESS_TOOL_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessToolType"), - shape_type=ShapeType.ENUM, - members={ - "REMOTE_MCP": {"target": UNIT}, - "AGENTCORE_BROWSER": {"target": UNIT}, - "AGENTCORE_GATEWAY": {"target": UNIT}, - "INLINE_FUNCTION": {"target": UNIT}, - "AGENTCORE_CODE_INTERPRETER": {"target": UNIT}, - }, -) - -HARNESS_TOOL = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessTool"), - members={ - "type": { - "target": HARNESS_TOOL_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": {"target": HARNESS_TOOL_NAME}, - "config": {"target": HARNESS_TOOL_CONFIGURATION}, - }, -) - -HARNESS_TOOLS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessTools"), - shape_type=ShapeType.LIST, - members={"member": {"target": HARNESS_TOOL}}, -) - -HARNESS_SLIDING_WINDOW_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#HarnessSlidingWindowConfiguration" - ), - members={"messagesCount": {"target": INTEGER}}, -) - -HARNESS_SUMMARIZATION_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#HarnessSummarizationConfiguration" - ), - members={ - "summaryRatio": {"target": FLOAT}, - "preserveRecentMessages": {"target": INTEGER}, - "summarizationSystemPrompt": {"target": _STRING}, - }, -) - -HARNESS_TRUNCATION_STRATEGY_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#HarnessTruncationStrategyConfiguration" - ), - shape_type=ShapeType.UNION, - members={ - "slidingWindow": {"target": HARNESS_SLIDING_WINDOW_CONFIGURATION}, - "summarization": {"target": HARNESS_SUMMARIZATION_CONFIGURATION}, - }, -) - -HARNESS_TRUNCATION_STRATEGY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessTruncationStrategy"), - shape_type=ShapeType.ENUM, - members={ - "SLIDING_WINDOW": {"target": UNIT}, - "SUMMARIZATION": {"target": UNIT}, - "NONE": {"target": UNIT}, - }, -) - -HARNESS_TRUNCATION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessTruncationConfiguration"), - members={ - "strategy": { - "target": HARNESS_TRUNCATION_STRATEGY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "config": {"target": HARNESS_TRUNCATION_STRATEGY_CONFIGURATION}, - }, -) - -CREATE_HARNESS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateHarnessInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreateHarnessRequest", - ) - ], - members={ - "harnessName": { - "target": HARNESS_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "executionRoleArn": { - "target": ROLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "environment": {"target": HARNESS_ENVIRONMENT_PROVIDER_REQUEST}, - "environmentArtifact": {"target": HARNESS_ENVIRONMENT_ARTIFACT}, - "environmentVariables": {"target": ENVIRONMENT_VARIABLES_MAP}, - "authorizerConfiguration": {"target": AUTHORIZER_CONFIGURATION}, - "model": {"target": HARNESS_MODEL_CONFIGURATION}, - "systemPrompt": {"target": HARNESS_SYSTEM_PROMPT}, - "tools": {"target": HARNESS_TOOLS}, - "skills": {"target": HARNESS_SKILLS}, - "allowedTools": {"target": HARNESS_ALLOWED_TOOLS}, - "memory": {"target": HARNESS_MEMORY_CONFIGURATION}, - "truncation": {"target": HARNESS_TRUNCATION_CONFIGURATION}, - "hooks": {"target": HARNESS_HOOKS}, - "maxIterations": {"target": INTEGER}, - "maxTokens": {"target": INTEGER}, - "timeoutSeconds": {"target": INTEGER}, - "tags": {"target": TAGS_MAP}, - }, -) - -HARNESS_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessArn"), - shape_type=ShapeType.STRING, -) - -HARNESS_AGENT_CORE_RUNTIME_ENVIRONMENT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#HarnessAgentCoreRuntimeEnvironment" - ), - members={ - "agentRuntimeArn": { - "target": BEDROCK_AGENTCORE_RESOURCE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentRuntimeName": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentRuntimeId": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lifecycleConfiguration": { - "target": LIFECYCLE_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "networkConfiguration": { - "target": NETWORK_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "filesystemConfigurations": {"target": FILESYSTEM_CONFIGURATIONS}, - }, -) - -HARNESS_ENVIRONMENT_PROVIDER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessEnvironmentProvider"), - shape_type=ShapeType.UNION, - members={ - "agentCoreRuntimeEnvironment": { - "target": HARNESS_AGENT_CORE_RUNTIME_ENVIRONMENT - } - }, -) - -HARNESS_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessStatus"), - shape_type=ShapeType.ENUM, - members={ - "CREATING": {"target": UNIT}, - "CREATE_FAILED": {"target": UNIT}, - "UPDATING": {"target": UNIT}, - "UPDATE_FAILED": {"target": UNIT}, - "READY": {"target": UNIT}, - "DELETING": {"target": UNIT}, - "DELETE_FAILED": {"target": UNIT}, - }, -) - -HARNESS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#Harness"), - members={ - "harnessId": { - "target": HARNESS_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "harnessName": { - "target": HARNESS_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "arn": { - "target": HARNESS_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": HARNESS_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "harnessVersion": {"target": HARNESS_VERSION}, - "executionRoleArn": { - "target": ROLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "model": { - "target": HARNESS_MODEL_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "systemPrompt": { - "target": HARNESS_SYSTEM_PROMPT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "tools": { - "target": HARNESS_TOOLS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "skills": { - "target": HARNESS_SKILLS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "allowedTools": { - "target": HARNESS_ALLOWED_TOOLS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "truncation": { - "target": HARNESS_TRUNCATION_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "environment": { - "target": HARNESS_ENVIRONMENT_PROVIDER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "environmentArtifact": {"target": HARNESS_ENVIRONMENT_ARTIFACT}, - "environmentVariables": {"target": ENVIRONMENT_VARIABLES_MAP}, - "authorizerConfiguration": {"target": AUTHORIZER_CONFIGURATION}, - "memory": {"target": HARNESS_MEMORY_CONFIGURATION}, - "hooks": {"target": HARNESS_HOOKS}, - "maxIterations": {"target": INTEGER}, - "maxTokens": {"target": INTEGER}, - "timeoutSeconds": {"target": INTEGER}, - "failureReason": {"target": _STRING}, - }, -) - -CREATE_HARNESS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateHarnessOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreateHarnessResponse", - ) - ], - members={ - "harness": { - "target": HARNESS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -CREATE_HARNESS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateHarness"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 201, "method": "POST", "uri": "/harnesses"} - ), - ) - ], -) - -DELETE_HARNESS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteHarnessInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeleteHarnessRequest", - ) - ], - members={ - "harnessId": { - "target": HARNESS_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#idempotencyToken")), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="clientToken"), - ], - }, - "deleteManagedMemory": { - "target": BOOLEAN, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpQuery"), value="deleteManagedMemory" - ) - ], - }, - }, -) - -DELETE_HARNESS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteHarnessOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeleteHarnessResponse", - ) - ], - members={"harness": {"target": HARNESS}}, -) - -DELETE_HARNESS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteHarness"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "DELETE", "uri": "/harnesses/{harnessId}"} - ), - ) - ], -) - -GET_HARNESS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetHarnessInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetHarnessRequest", - ) - ], - members={ - "harnessId": { - "target": HARNESS_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "harnessVersion": { - "target": HARNESS_VERSION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="harnessVersion") - ], - }, - }, -) - -GET_HARNESS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetHarnessOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetHarnessResponse", - ) - ], - members={ - "harness": { - "target": HARNESS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -GET_HARNESS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetHarness"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "GET", "uri": "/harnesses/{harnessId}"} - ), - ) - ], -) - -LIST_HARNESSES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListHarnessesInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListHarnessesRequest", - ) - ], - members={ - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - }, -) - -HARNESS_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessSummary"), - members={ - "harnessId": { - "target": HARNESS_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "harnessName": { - "target": HARNESS_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "arn": { - "target": HARNESS_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": HARNESS_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "harnessVersion": {"target": HARNESS_VERSION}, - }, -) - -HARNESS_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessSummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": HARNESS_SUMMARY}}, -) - -LIST_HARNESSES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListHarnessesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListHarnessesResponse", - ) - ], - members={ - "harnesses": { - "target": HARNESS_SUMMARIES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": NEXT_TOKEN}, - }, -) - -LIST_HARNESSES = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListHarnesses"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType({"code": 200, "method": "GET", "uri": "/harnesses"}), - ) - ], -) - -LIST_HARNESS_VERSIONS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListHarnessVersionsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListHarnessVersionsRequest", - ) - ], - members={ - "harnessId": { - "target": HARNESS_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - }, -) - -HARNESS_VERSION_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessVersionSummary"), - members={ - "harnessId": { - "target": HARNESS_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "harnessName": { - "target": HARNESS_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "arn": { - "target": HARNESS_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "harnessVersion": { - "target": HARNESS_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": HARNESS_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "failureReason": {"target": _STRING}, - }, -) - -HARNESS_VERSION_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#HarnessVersionSummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": HARNESS_VERSION_SUMMARY}}, -) - -LIST_HARNESS_VERSIONS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListHarnessVersionsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListHarnessVersionsResponse", - ) - ], - members={ - "harnessVersions": { - "target": HARNESS_VERSION_SUMMARIES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": NEXT_TOKEN}, - }, -) - -LIST_HARNESS_VERSIONS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListHarnessVersions"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "GET", "uri": "/harnesses/{harnessId}/versions"} - ), - ) - ], -) - -UPDATED_AUTHORIZER_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdatedAuthorizerConfiguration"), - members={"optionalValue": {"target": AUTHORIZER_CONFIGURATION}}, -) - -UPDATED_HARNESS_ENVIRONMENT_ARTIFACT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#UpdatedHarnessEnvironmentArtifact" - ), - members={"optionalValue": {"target": HARNESS_ENVIRONMENT_ARTIFACT}}, -) - -UPDATED_HARNESS_MEMORY_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#UpdatedHarnessMemoryConfiguration" - ), - members={"optionalValue": {"target": HARNESS_MEMORY_CONFIGURATION}}, -) - -UPDATE_HARNESS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateHarnessInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UpdateHarnessRequest", - ) - ], - members={ - "harnessId": { - "target": HARNESS_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "executionRoleArn": {"target": ROLE_ARN}, - "environment": {"target": HARNESS_ENVIRONMENT_PROVIDER_REQUEST}, - "environmentArtifact": {"target": UPDATED_HARNESS_ENVIRONMENT_ARTIFACT}, - "environmentVariables": {"target": ENVIRONMENT_VARIABLES_MAP}, - "authorizerConfiguration": {"target": UPDATED_AUTHORIZER_CONFIGURATION}, - "model": {"target": HARNESS_MODEL_CONFIGURATION}, - "systemPrompt": {"target": HARNESS_SYSTEM_PROMPT}, - "tools": {"target": HARNESS_TOOLS}, - "skills": {"target": HARNESS_SKILLS}, - "allowedTools": {"target": HARNESS_ALLOWED_TOOLS}, - "memory": {"target": UPDATED_HARNESS_MEMORY_CONFIGURATION}, - "truncation": {"target": HARNESS_TRUNCATION_CONFIGURATION}, - "hooks": {"target": HARNESS_HOOKS}, - "maxIterations": {"target": INTEGER}, - "maxTokens": {"target": INTEGER}, - "timeoutSeconds": {"target": INTEGER}, - }, -) - -UPDATE_HARNESS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateHarnessOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UpdateHarnessResponse", - ) - ], - members={ - "harness": { - "target": HARNESS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -UPDATE_HARNESS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateHarness"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "PATCH", "uri": "/harnesses/{harnessId}"} - ), - ) - ], -) - -TAGGABLE_RESOURCES_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#TaggableResourcesArn"), - shape_type=ShapeType.STRING, -) - -LIST_TAGS_FOR_RESOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListTagsForResourceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListTagsForResourceRequest", - ) - ], - members={ - "resourceArn": { - "target": TAGGABLE_RESOURCES_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -LIST_TAGS_FOR_RESOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListTagsForResourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListTagsForResourceResponse", - ) - ], - members={"tags": {"target": TAGS_MAP}}, -) - -LIST_TAGS_FOR_RESOURCE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListTagsForResource"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "GET", "uri": "/tags/{resourceArn}"} - ), - ) - ], -) - -ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#Arn"), shape_type=ShapeType.STRING -) - -METADATA_KEY = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#MetadataKey"), - shape_type=ShapeType.STRING, -) - -METADATA_VALUE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#MetadataValueType"), - shape_type=ShapeType.ENUM, - members={ - "STRING": {"target": UNIT}, - "STRINGLIST": {"target": UNIT}, - "NUMBER": {"target": UNIT}, - }, -) - -INDEXED_KEY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#IndexedKey"), - members={ - "key": { - "target": METADATA_KEY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "type": { - "target": METADATA_VALUE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -INDEXED_KEYS_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#IndexedKeysList"), - shape_type=ShapeType.LIST, - members={"member": {"target": INDEXED_KEY}}, -) - -PROMPT = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#Prompt"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -EPISODIC_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#EpisodicOverrideConsolidationConfigurationInput" - ), - members={ - "appendToPrompt": { - "target": PROMPT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelId": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -EPISODIC_OVERRIDE_EXTRACTION_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#EpisodicOverrideExtractionConfigurationInput" - ), - members={ - "appendToPrompt": { - "target": PROMPT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelId": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -DEFINITION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#Definition"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -LLM_EXTRACTION_INSTRUCTION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#LlmExtractionInstruction"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -NUMBER_VALIDATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#NumberValidation"), - members={"minValue": {"target": DOUBLE}, "maxValue": {"target": DOUBLE}}, -) - -STRING_LIST_VALIDATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#StringListValidation"), - members={ - "allowedValues": {"target": ALLOWED_STRING_LIST_VALUES_LIST}, - "maxItems": {"target": INTEGER}, - }, -) - -STRING_VALIDATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#StringValidation"), - members={ - "allowedValues": { - "target": ALLOWED_STRING_VALUES_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -VALIDATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#Validation"), - shape_type=ShapeType.UNION, - members={ - "stringValidation": {"target": STRING_VALIDATION}, - "stringListValidation": {"target": STRING_LIST_VALIDATION}, - "numberValidation": {"target": NUMBER_VALIDATION}, - }, -) - -LLM_EXTRACTION_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#LlmExtractionConfig"), - members={ - "llmExtractionInstruction": {"target": LLM_EXTRACTION_INSTRUCTION}, - "definition": { - "target": DEFINITION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "validation": {"target": VALIDATION}, - }, -) - -EXTRACTION_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ExtractionConfig"), - shape_type=ShapeType.UNION, - members={"llmExtractionConfig": {"target": LLM_EXTRACTION_CONFIG}}, -) - -EXTRACTION_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ExtractionType"), - shape_type=ShapeType.ENUM, - members={"LLM_INFERRED": {"target": UNIT}, "STRICTLY_CONSISTENT": {"target": UNIT}}, -) - -METADATA_SCHEMA_ENTRY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#MetadataSchemaEntry"), - members={ - "key": { - "target": METADATA_KEY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "type": {"target": METADATA_VALUE_TYPE}, - "extractionType": {"target": EXTRACTION_TYPE}, - "extractionConfig": {"target": EXTRACTION_CONFIG}, - }, -) - -METADATA_SCHEMA_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#MetadataSchemaList"), - shape_type=ShapeType.LIST, - members={"member": {"target": METADATA_SCHEMA_ENTRY}}, -) - -MEMORY_RECORD_SCHEMA = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#MemoryRecordSchema"), - members={"metadataSchema": {"target": METADATA_SCHEMA_LIST}}, -) - -NAMESPACE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#Namespace"), - shape_type=ShapeType.STRING, -) - -NAMESPACES_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#NamespacesList"), - shape_type=ShapeType.LIST, - members={"member": {"target": NAMESPACE}}, -) - -EPISODIC_OVERRIDE_REFLECTION_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#EpisodicOverrideReflectionConfigurationInput" - ), - members={ - "appendToPrompt": { - "target": PROMPT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelId": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "namespaces": {"target": NAMESPACES_LIST}, - "namespaceTemplates": {"target": NAMESPACES_LIST}, - "memoryRecordSchema": {"target": MEMORY_RECORD_SCHEMA}, - }, -) - -EPISODIC_OVERRIDE_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#EpisodicOverrideConfigurationInput" - ), - members={ - "extraction": {"target": EPISODIC_OVERRIDE_EXTRACTION_CONFIGURATION_INPUT}, - "consolidation": { - "target": EPISODIC_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT - }, - "reflection": {"target": EPISODIC_OVERRIDE_REFLECTION_CONFIGURATION_INPUT}, - }, -) - -INVOCATION_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#InvocationConfigurationInput"), - members={ - "topicArn": { - "target": ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "payloadDeliveryBucketName": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -MESSAGE_BASED_TRIGGER_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#MessageBasedTriggerInput"), - members={ - "messageCount": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=6)], - } - }, -) - -TIME_BASED_TRIGGER_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#TimeBasedTriggerInput"), - members={ - "idleSessionTimeout": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=20)], - } - }, -) - -TOKEN_BASED_TRIGGER_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#TokenBasedTriggerInput"), - members={ - "tokenCount": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=5000)], - } - }, -) - -TRIGGER_CONDITION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#TriggerConditionInput"), - shape_type=ShapeType.UNION, - members={ - "messageBasedTrigger": {"target": MESSAGE_BASED_TRIGGER_INPUT}, - "tokenBasedTrigger": {"target": TOKEN_BASED_TRIGGER_INPUT}, - "timeBasedTrigger": {"target": TIME_BASED_TRIGGER_INPUT}, - }, -) - -TRIGGER_CONDITION_INPUT_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#TriggerConditionInputList"), - shape_type=ShapeType.LIST, - members={"member": {"target": TRIGGER_CONDITION_INPUT}}, -) - -SELF_MANAGED_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SelfManagedConfigurationInput"), - members={ - "triggerConditions": {"target": TRIGGER_CONDITION_INPUT_LIST}, - "invocationConfiguration": { - "target": INVOCATION_CONFIGURATION_INPUT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "historicalContextWindowSize": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=4)], - }, - }, -) - -SEMANTIC_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#SemanticOverrideConsolidationConfigurationInput" - ), - members={ - "appendToPrompt": { - "target": PROMPT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelId": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -SEMANTIC_OVERRIDE_EXTRACTION_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#SemanticOverrideExtractionConfigurationInput" - ), - members={ - "appendToPrompt": { - "target": PROMPT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelId": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -SEMANTIC_OVERRIDE_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#SemanticOverrideConfigurationInput" - ), - members={ - "extraction": {"target": SEMANTIC_OVERRIDE_EXTRACTION_CONFIGURATION_INPUT}, - "consolidation": { - "target": SEMANTIC_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT - }, - }, -) - -SUMMARY_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#SummaryOverrideConsolidationConfigurationInput" - ), - members={ - "appendToPrompt": { - "target": PROMPT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelId": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -SUMMARY_OVERRIDE_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#SummaryOverrideConfigurationInput" - ), - members={ - "consolidation": {"target": SUMMARY_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT} - }, -) - -USER_PREFERENCE_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#UserPreferenceOverrideConsolidationConfigurationInput" - ), - members={ - "appendToPrompt": { - "target": PROMPT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelId": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -USER_PREFERENCE_OVERRIDE_EXTRACTION_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#UserPreferenceOverrideExtractionConfigurationInput" - ), - members={ - "appendToPrompt": { - "target": PROMPT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelId": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -USER_PREFERENCE_OVERRIDE_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#UserPreferenceOverrideConfigurationInput" - ), - members={ - "extraction": { - "target": USER_PREFERENCE_OVERRIDE_EXTRACTION_CONFIGURATION_INPUT - }, - "consolidation": { - "target": USER_PREFERENCE_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT - }, - }, -) - -CUSTOM_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CustomConfigurationInput"), - shape_type=ShapeType.UNION, - members={ - "semanticOverride": {"target": SEMANTIC_OVERRIDE_CONFIGURATION_INPUT}, - "summaryOverride": {"target": SUMMARY_OVERRIDE_CONFIGURATION_INPUT}, - "userPreferenceOverride": { - "target": USER_PREFERENCE_OVERRIDE_CONFIGURATION_INPUT - }, - "episodicOverride": {"target": EPISODIC_OVERRIDE_CONFIGURATION_INPUT}, - "selfManagedConfiguration": {"target": SELF_MANAGED_CONFIGURATION_INPUT}, - }, -) - -NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#Name"), - shape_type=ShapeType.STRING, -) - -CUSTOM_MEMORY_STRATEGY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CustomMemoryStrategyInput"), - members={ - "name": { - "target": NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "namespaces": {"target": NAMESPACES_LIST}, - "namespaceTemplates": {"target": NAMESPACES_LIST}, - "configuration": {"target": CUSTOM_CONFIGURATION_INPUT}, - "memoryRecordSchema": {"target": MEMORY_RECORD_SCHEMA}, - }, -) - -EPISODIC_REFLECTION_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#EpisodicReflectionConfigurationInput" - ), - members={ - "namespaces": {"target": NAMESPACES_LIST}, - "namespaceTemplates": {"target": NAMESPACES_LIST}, - "memoryRecordSchema": {"target": MEMORY_RECORD_SCHEMA}, - }, -) - -EPISODIC_MEMORY_STRATEGY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#EpisodicMemoryStrategyInput"), - members={ - "name": { - "target": NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "namespaces": {"target": NAMESPACES_LIST}, - "namespaceTemplates": {"target": NAMESPACES_LIST}, - "reflectionConfiguration": {"target": EPISODIC_REFLECTION_CONFIGURATION_INPUT}, - "memoryRecordSchema": {"target": MEMORY_RECORD_SCHEMA}, - }, -) - -SEMANTIC_MEMORY_STRATEGY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SemanticMemoryStrategyInput"), - members={ - "name": { - "target": NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "namespaces": {"target": NAMESPACES_LIST}, - "namespaceTemplates": {"target": NAMESPACES_LIST}, - "memoryRecordSchema": {"target": MEMORY_RECORD_SCHEMA}, - }, -) - -SUMMARY_MEMORY_STRATEGY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SummaryMemoryStrategyInput"), - members={ - "name": { - "target": NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "namespaces": {"target": NAMESPACES_LIST}, - "namespaceTemplates": {"target": NAMESPACES_LIST}, - "memoryRecordSchema": {"target": MEMORY_RECORD_SCHEMA}, - }, -) - -USER_PREFERENCE_MEMORY_STRATEGY_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#UserPreferenceMemoryStrategyInput" - ), - members={ - "name": { - "target": NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "namespaces": {"target": NAMESPACES_LIST}, - "namespaceTemplates": {"target": NAMESPACES_LIST}, - "memoryRecordSchema": {"target": MEMORY_RECORD_SCHEMA}, - }, -) - -MEMORY_STRATEGY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#MemoryStrategyInput"), - shape_type=ShapeType.UNION, - members={ - "semanticMemoryStrategy": {"target": SEMANTIC_MEMORY_STRATEGY_INPUT}, - "summaryMemoryStrategy": {"target": SUMMARY_MEMORY_STRATEGY_INPUT}, - "userPreferenceMemoryStrategy": { - "target": USER_PREFERENCE_MEMORY_STRATEGY_INPUT - }, - "customMemoryStrategy": {"target": CUSTOM_MEMORY_STRATEGY_INPUT}, - "episodicMemoryStrategy": {"target": EPISODIC_MEMORY_STRATEGY_INPUT}, - }, -) - -MEMORY_STRATEGY_INPUT_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#MemoryStrategyInputList"), - shape_type=ShapeType.LIST, - members={"member": {"target": MEMORY_STRATEGY_INPUT}}, -) - -NAMESPACE_VARIABLE_KEY = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#NamespaceVariableKey"), - shape_type=ShapeType.STRING, -) - -NAMESPACE_ALLOWED_VALUE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#NamespaceAllowedValue"), - shape_type=ShapeType.STRING, -) - -NAMESPACE_ALLOWED_VALUES_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#NamespaceAllowedValuesList"), - shape_type=ShapeType.LIST, - members={"member": {"target": NAMESPACE_ALLOWED_VALUE}}, -) - -NAMESPACE_REGEX_PATTERN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#NamespaceRegexPattern"), - shape_type=ShapeType.STRING, -) - -NAMESPACE_KEY_VALIDATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#NamespaceKeyValidation"), - members={ - "allowedValues": {"target": NAMESPACE_ALLOWED_VALUES_LIST}, - "regexPattern": {"target": NAMESPACE_REGEX_PATTERN}, - }, -) - -NAMESPACE_KEY_ENTRY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#NamespaceKeyEntry"), - members={ - "key": { - "target": NAMESPACE_VARIABLE_KEY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "validation": {"target": NAMESPACE_KEY_VALIDATION}, - }, -) - -NAMESPACE_KEYS_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#NamespaceKeysList"), - shape_type=ShapeType.LIST, - members={"member": {"target": NAMESPACE_KEY_ENTRY}}, -) - -CONTENT_LEVEL = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ContentLevel"), - shape_type=ShapeType.ENUM, - members={"METADATA_ONLY": {"target": UNIT}, "FULL_CONTENT": {"target": UNIT}}, -) - -CONTENT_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ContentType"), - shape_type=ShapeType.ENUM, - members={"MEMORY_RECORDS": {"target": UNIT}}, -) - -CONTENT_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ContentConfiguration"), - members={ - "type": { - "target": CONTENT_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "level": { - "target": CONTENT_LEVEL, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value="METADATA_ONLY") - ], - }, - }, -) - -CONTENT_CONFIGURATION_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ContentConfigurationList"), - shape_type=ShapeType.LIST, - members={"member": {"target": CONTENT_CONFIGURATION}}, -) - -KINESIS_RESOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#KinesisResource"), - members={ - "dataStreamArn": { - "target": ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "contentConfigurations": { - "target": CONTENT_CONFIGURATION_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -STREAM_DELIVERY_RESOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#StreamDeliveryResource"), - shape_type=ShapeType.UNION, - members={"kinesis": {"target": KINESIS_RESOURCE}}, -) - -STREAM_DELIVERY_RESOURCES_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#StreamDeliveryResourcesList"), - shape_type=ShapeType.LIST, - members={"member": {"target": STREAM_DELIVERY_RESOURCE}}, -) - -STREAM_DELIVERY_RESOURCES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#StreamDeliveryResources"), - members={ - "resources": { - "target": STREAM_DELIVERY_RESOURCES_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -CREATE_MEMORY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateMemoryInput"), - members={ - "clientToken": { - "target": NON_EMPTY_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "name": { - "target": NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "encryptionKeyArn": {"target": ARN}, - "memoryExecutionRoleArn": {"target": ARN}, - "eventExpiryDuration": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "memoryStrategies": {"target": MEMORY_STRATEGY_INPUT_LIST}, - "indexedKeys": {"target": INDEXED_KEYS_LIST}, - "namespaceKeys": {"target": NAMESPACE_KEYS_LIST}, - "streamDeliveryResources": {"target": STREAM_DELIVERY_RESOURCES}, - "tags": {"target": TAGS_MAP}, - }, -) - -MEMORY_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#MemoryId"), - shape_type=ShapeType.STRING, -) - -MEMORY_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#MemoryStatus"), - shape_type=ShapeType.ENUM, - members={ - "CREATING": {"target": UNIT}, - "ACTIVE": {"target": UNIT}, - "FAILED": {"target": UNIT}, - "DELETING": {"target": UNIT}, - "UPDATING": {"target": UNIT}, - }, -) - -EPISODIC_CONSOLIDATION_OVERRIDE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#EpisodicConsolidationOverride"), - members={ - "appendToPrompt": { - "target": PROMPT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelId": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -SEMANTIC_CONSOLIDATION_OVERRIDE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SemanticConsolidationOverride"), - members={ - "appendToPrompt": { - "target": PROMPT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelId": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -SUMMARY_CONSOLIDATION_OVERRIDE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SummaryConsolidationOverride"), - members={ - "appendToPrompt": { - "target": PROMPT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelId": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -USER_PREFERENCE_CONSOLIDATION_OVERRIDE = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#UserPreferenceConsolidationOverride" - ), - members={ - "appendToPrompt": { - "target": PROMPT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelId": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -CUSTOM_CONSOLIDATION_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#CustomConsolidationConfiguration" - ), - shape_type=ShapeType.UNION, - members={ - "semanticConsolidationOverride": {"target": SEMANTIC_CONSOLIDATION_OVERRIDE}, - "summaryConsolidationOverride": {"target": SUMMARY_CONSOLIDATION_OVERRIDE}, - "userPreferenceConsolidationOverride": { - "target": USER_PREFERENCE_CONSOLIDATION_OVERRIDE - }, - "episodicConsolidationOverride": {"target": EPISODIC_CONSOLIDATION_OVERRIDE}, - }, -) - -CONSOLIDATION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ConsolidationConfiguration"), - shape_type=ShapeType.UNION, - members={ - "customConsolidationConfiguration": { - "target": CUSTOM_CONSOLIDATION_CONFIGURATION - } - }, -) - -EPISODIC_EXTRACTION_OVERRIDE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#EpisodicExtractionOverride"), - members={ - "appendToPrompt": { - "target": PROMPT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelId": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -SEMANTIC_EXTRACTION_OVERRIDE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SemanticExtractionOverride"), - members={ - "appendToPrompt": { - "target": PROMPT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelId": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -USER_PREFERENCE_EXTRACTION_OVERRIDE = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#UserPreferenceExtractionOverride" - ), - members={ - "appendToPrompt": { - "target": PROMPT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelId": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -CUSTOM_EXTRACTION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CustomExtractionConfiguration"), - shape_type=ShapeType.UNION, - members={ - "semanticExtractionOverride": {"target": SEMANTIC_EXTRACTION_OVERRIDE}, - "userPreferenceExtractionOverride": { - "target": USER_PREFERENCE_EXTRACTION_OVERRIDE - }, - "episodicExtractionOverride": {"target": EPISODIC_EXTRACTION_OVERRIDE}, - }, -) - -EXTRACTION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ExtractionConfiguration"), - shape_type=ShapeType.UNION, - members={ - "customExtractionConfiguration": {"target": CUSTOM_EXTRACTION_CONFIGURATION} - }, -) - -EPISODIC_REFLECTION_OVERRIDE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#EpisodicReflectionOverride"), - members={ - "appendToPrompt": { - "target": PROMPT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelId": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "namespaces": {"target": NAMESPACES_LIST}, - "namespaceTemplates": {"target": NAMESPACES_LIST}, - "memoryRecordSchema": {"target": MEMORY_RECORD_SCHEMA}, - }, -) - -CUSTOM_REFLECTION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CustomReflectionConfiguration"), - shape_type=ShapeType.UNION, - members={"episodicReflectionOverride": {"target": EPISODIC_REFLECTION_OVERRIDE}}, -) - -EPISODIC_REFLECTION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#EpisodicReflectionConfiguration"), - members={ - "namespaces": {"target": NAMESPACES_LIST}, - "namespaceTemplates": {"target": NAMESPACES_LIST}, - "memoryRecordSchema": {"target": MEMORY_RECORD_SCHEMA}, - }, -) - -REFLECTION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ReflectionConfiguration"), - shape_type=ShapeType.UNION, - members={ - "customReflectionConfiguration": {"target": CUSTOM_REFLECTION_CONFIGURATION}, - "episodicReflectionConfiguration": { - "target": EPISODIC_REFLECTION_CONFIGURATION - }, - }, -) - -INVOCATION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#InvocationConfiguration"), - members={ - "topicArn": { - "target": ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "payloadDeliveryBucketName": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -MESSAGE_BASED_TRIGGER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#MessageBasedTrigger"), - members={"messageCount": {"target": INTEGER}}, -) - -TIME_BASED_TRIGGER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#TimeBasedTrigger"), - members={"idleSessionTimeout": {"target": INTEGER}}, -) - -TOKEN_BASED_TRIGGER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#TokenBasedTrigger"), - members={"tokenCount": {"target": INTEGER}}, -) - -TRIGGER_CONDITION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#TriggerCondition"), - shape_type=ShapeType.UNION, - members={ - "messageBasedTrigger": {"target": MESSAGE_BASED_TRIGGER}, - "tokenBasedTrigger": {"target": TOKEN_BASED_TRIGGER}, - "timeBasedTrigger": {"target": TIME_BASED_TRIGGER}, - }, -) - -TRIGGER_CONDITIONS_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#TriggerConditionsList"), - shape_type=ShapeType.LIST, - members={"member": {"target": TRIGGER_CONDITION}}, -) - -SELF_MANAGED_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SelfManagedConfiguration"), - members={ - "triggerConditions": { - "target": TRIGGER_CONDITIONS_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "invocationConfiguration": { - "target": INVOCATION_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "historicalContextWindowSize": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -OVERRIDE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#OverrideType"), - shape_type=ShapeType.ENUM, - members={ - "SEMANTIC_OVERRIDE": {"target": UNIT}, - "SUMMARY_OVERRIDE": {"target": UNIT}, - "USER_PREFERENCE_OVERRIDE": {"target": UNIT}, - "SELF_MANAGED": {"target": UNIT}, - "EPISODIC_OVERRIDE": {"target": UNIT}, - }, -) - -STRATEGY_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#StrategyConfiguration"), - members={ - "type": {"target": OVERRIDE_TYPE}, - "extraction": {"target": EXTRACTION_CONFIGURATION}, - "consolidation": {"target": CONSOLIDATION_CONFIGURATION}, - "reflection": {"target": REFLECTION_CONFIGURATION}, - "selfManagedConfiguration": {"target": SELF_MANAGED_CONFIGURATION}, - }, -) - -MEMORY_STRATEGY_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#MemoryStrategyStatus"), - shape_type=ShapeType.ENUM, - members={ - "CREATING": {"target": UNIT}, - "ACTIVE": {"target": UNIT}, - "DELETING": {"target": UNIT}, - "FAILED": {"target": UNIT}, - }, -) - -MEMORY_STRATEGY_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#MemoryStrategyId"), - shape_type=ShapeType.STRING, -) - -MEMORY_STRATEGY_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#MemoryStrategyType"), - shape_type=ShapeType.ENUM, - members={ - "SEMANTIC": {"target": UNIT}, - "SUMMARIZATION": {"target": UNIT}, - "USER_PREFERENCE": {"target": UNIT}, - "CUSTOM": {"target": UNIT}, - "EPISODIC": {"target": UNIT}, - }, -) - -MEMORY_STRATEGY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#MemoryStrategy"), - members={ - "strategyId": { - "target": MEMORY_STRATEGY_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "configuration": {"target": STRATEGY_CONFIGURATION}, - "type": { - "target": MEMORY_STRATEGY_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "namespaces": { - "target": NAMESPACES_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "namespaceTemplates": { - "target": NAMESPACES_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": {"target": TIMESTAMP}, - "updatedAt": {"target": TIMESTAMP}, - "status": {"target": MEMORY_STRATEGY_STATUS}, - "memoryRecordSchema": {"target": MEMORY_RECORD_SCHEMA}, - }, -) - -MEMORY_STRATEGY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#MemoryStrategyList"), - shape_type=ShapeType.LIST, - members={"member": {"target": MEMORY_STRATEGY}}, -) - -MEMORY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#Memory"), - members={ - "arn": { - "target": MEMORY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "id": { - "target": MEMORY_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "encryptionKeyArn": {"target": ARN}, - "memoryExecutionRoleArn": {"target": ARN}, - "eventExpiryDuration": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": MEMORY_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "failureReason": {"target": _STRING}, - "createdAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "strategies": {"target": MEMORY_STRATEGY_LIST}, - "indexedKeys": {"target": INDEXED_KEYS_LIST}, - "namespaceKeys": {"target": NAMESPACE_KEYS_LIST}, - "streamDeliveryResources": {"target": STREAM_DELIVERY_RESOURCES}, - "managedByResourceArn": {"target": ARN}, - }, -) - -CREATE_MEMORY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateMemoryOutput"), - members={"memory": {"target": MEMORY}}, -) - -SERVICE_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="server"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=500), - ], - members={"message": {"target": _STRING}}, -) - -THROTTLED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottledException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=429), - ], - members={"message": {"target": _STRING}}, -) - -CREATE_MEMORY = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateMemory"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 202, "method": "POST", "uri": "/memories/create"} - ), - ) - ], -) - -DELETE_MEMORY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteMemoryInput"), - members={ - "clientToken": { - "target": NON_EMPTY_STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#idempotencyToken")), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="clientToken"), - ], - }, - "memoryId": { - "target": MEMORY_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -DELETE_MEMORY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteMemoryOutput"), - members={ - "memoryId": { - "target": MEMORY_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": {"target": MEMORY_STATUS}, - }, -) - -DELETE_MEMORY = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteMemory"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 202, "method": "DELETE", "uri": "/memories/{memoryId}/delete"} - ), - ) - ], -) - -MEMORY_VIEW = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#MemoryView"), - shape_type=ShapeType.ENUM, - members={"FULL": {"target": UNIT}, "WITHOUT_DECRYPTION": {"target": UNIT}}, -) - -GET_MEMORY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetMemoryInput"), - members={ - "memoryId": { - "target": MEMORY_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "view": { - "target": MEMORY_VIEW, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value="full"), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="view"), - ], - }, - }, -) - -GET_MEMORY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetMemoryOutput"), - members={ - "memory": { - "target": MEMORY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -GET_MEMORY = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetMemory"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/memories/{memoryId}/details"} - ), - ) - ], -) - -LIST_MEMORIES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListMemoriesInput"), - members={ - "maxResults": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=100)], - }, - "nextToken": {"target": _STRING}, - }, -) - -MEMORY_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#MemorySummary"), - members={ - "arn": {"target": MEMORY_ARN}, - "id": {"target": MEMORY_ID}, - "status": {"target": MEMORY_STATUS}, - "createdAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "managedByResourceArn": {"target": ARN}, - }, -) - -MEMORY_SUMMARY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#MemorySummaryList"), - shape_type=ShapeType.LIST, - members={"member": {"target": MEMORY_SUMMARY}}, -) - -LIST_MEMORIES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListMemoriesOutput"), - members={ - "memories": { - "target": MEMORY_SUMMARY_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": _STRING}, - }, -) - -LIST_MEMORIES = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListMemories"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType({"method": "POST", "uri": "/memories/"}), - ) - ], -) - -DELETE_MEMORY_STRATEGY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteMemoryStrategyInput"), - members={ - "memoryStrategyId": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -DELETE_MEMORY_STRATEGIES_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteMemoryStrategiesList"), - shape_type=ShapeType.LIST, - members={"member": {"target": DELETE_MEMORY_STRATEGY_INPUT}}, -) - -CUSTOM_CONSOLIDATION_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#CustomConsolidationConfigurationInput" - ), - shape_type=ShapeType.UNION, - members={ - "semanticConsolidationOverride": { - "target": SEMANTIC_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT - }, - "summaryConsolidationOverride": { - "target": SUMMARY_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT - }, - "userPreferenceConsolidationOverride": { - "target": USER_PREFERENCE_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT - }, - "episodicConsolidationOverride": { - "target": EPISODIC_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT - }, - }, -) - -MODIFY_CONSOLIDATION_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ModifyConsolidationConfiguration" - ), - shape_type=ShapeType.UNION, - members={ - "customConsolidationConfiguration": { - "target": CUSTOM_CONSOLIDATION_CONFIGURATION_INPUT - } - }, -) - -CUSTOM_EXTRACTION_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#CustomExtractionConfigurationInput" - ), - shape_type=ShapeType.UNION, - members={ - "semanticExtractionOverride": { - "target": SEMANTIC_OVERRIDE_EXTRACTION_CONFIGURATION_INPUT - }, - "userPreferenceExtractionOverride": { - "target": USER_PREFERENCE_OVERRIDE_EXTRACTION_CONFIGURATION_INPUT - }, - "episodicExtractionOverride": { - "target": EPISODIC_OVERRIDE_EXTRACTION_CONFIGURATION_INPUT - }, - }, -) - -MODIFY_EXTRACTION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ModifyExtractionConfiguration"), - shape_type=ShapeType.UNION, - members={ - "customExtractionConfiguration": { - "target": CUSTOM_EXTRACTION_CONFIGURATION_INPUT - } - }, -) - -CUSTOM_REFLECTION_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#CustomReflectionConfigurationInput" - ), - shape_type=ShapeType.UNION, - members={ - "episodicReflectionOverride": { - "target": EPISODIC_OVERRIDE_REFLECTION_CONFIGURATION_INPUT - } - }, -) - -MODIFY_REFLECTION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ModifyReflectionConfiguration"), - shape_type=ShapeType.UNION, - members={ - "episodicReflectionConfiguration": { - "target": EPISODIC_REFLECTION_CONFIGURATION_INPUT - }, - "customReflectionConfiguration": { - "target": CUSTOM_REFLECTION_CONFIGURATION_INPUT - }, - }, -) - -MODIFY_INVOCATION_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ModifyInvocationConfigurationInput" - ), - members={ - "topicArn": {"target": ARN}, - "payloadDeliveryBucketName": {"target": _STRING}, - }, -) - -MODIFY_SELF_MANAGED_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ModifySelfManagedConfiguration"), - members={ - "triggerConditions": {"target": TRIGGER_CONDITION_INPUT_LIST}, - "invocationConfiguration": {"target": MODIFY_INVOCATION_CONFIGURATION_INPUT}, - "historicalContextWindowSize": {"target": INTEGER}, - }, -) - -MODIFY_STRATEGY_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ModifyStrategyConfiguration"), - members={ - "extraction": {"target": MODIFY_EXTRACTION_CONFIGURATION}, - "consolidation": {"target": MODIFY_CONSOLIDATION_CONFIGURATION}, - "reflection": {"target": MODIFY_REFLECTION_CONFIGURATION}, - "selfManagedConfiguration": {"target": MODIFY_SELF_MANAGED_CONFIGURATION}, - }, -) - -MODIFY_MEMORY_STRATEGY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ModifyMemoryStrategyInput"), - members={ - "memoryStrategyId": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "namespaces": {"target": NAMESPACES_LIST}, - "namespaceTemplates": {"target": NAMESPACES_LIST}, - "configuration": {"target": MODIFY_STRATEGY_CONFIGURATION}, - "memoryRecordSchema": {"target": MEMORY_RECORD_SCHEMA}, - }, -) - -MODIFY_MEMORY_STRATEGIES_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ModifyMemoryStrategiesList"), - shape_type=ShapeType.LIST, - members={"member": {"target": MODIFY_MEMORY_STRATEGY_INPUT}}, -) - -MODIFY_MEMORY_STRATEGIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ModifyMemoryStrategies"), - members={ - "addMemoryStrategies": {"target": MEMORY_STRATEGY_INPUT_LIST}, - "modifyMemoryStrategies": {"target": MODIFY_MEMORY_STRATEGIES_LIST}, - "deleteMemoryStrategies": {"target": DELETE_MEMORY_STRATEGIES_LIST}, - }, -) - -UPDATE_MEMORY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateMemoryInput"), - members={ - "clientToken": { - "target": NON_EMPTY_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "memoryId": { - "target": MEMORY_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "description": {"target": DESCRIPTION}, - "eventExpiryDuration": {"target": INTEGER}, - "memoryExecutionRoleArn": {"target": ARN}, - "memoryStrategies": {"target": MODIFY_MEMORY_STRATEGIES}, - "addIndexedKeys": {"target": INDEXED_KEYS_LIST}, - "namespaceKeys": {"target": NAMESPACE_KEYS_LIST}, - "streamDeliveryResources": {"target": STREAM_DELIVERY_RESOURCES}, - }, -) - -UPDATE_MEMORY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateMemoryOutput"), - members={"memory": {"target": MEMORY}}, -) - -UPDATE_MEMORY = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateMemory"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 202, "method": "PUT", "uri": "/memories/{memoryId}/update"} - ), - ) - ], -) - -CREDENTIAL_PROVIDER_VENDOR_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CredentialProviderVendorType"), - shape_type=ShapeType.ENUM, - members={ - "GoogleOauth2": {"target": UNIT}, - "GithubOauth2": {"target": UNIT}, - "SlackOauth2": {"target": UNIT}, - "SalesforceOauth2": {"target": UNIT}, - "MicrosoftOauth2": {"target": UNIT}, - "CustomOauth2": {"target": UNIT}, - "AtlassianOauth2": {"target": UNIT}, - "LinkedinOauth2": {"target": UNIT}, - "XOauth2": {"target": UNIT}, - "OktaOauth2": {"target": UNIT}, - "OneLoginOauth2": {"target": UNIT}, - "PingOneOauth2": {"target": UNIT}, - "FacebookOauth2": {"target": UNIT}, - "YandexOauth2": {"target": UNIT}, - "RedditOauth2": {"target": UNIT}, - "ZoomOauth2": {"target": UNIT}, - "TwitchOauth2": {"target": UNIT}, - "SpotifyOauth2": {"target": UNIT}, - "DropboxOauth2": {"target": UNIT}, - "NotionOauth2": {"target": UNIT}, - "HubspotOauth2": {"target": UNIT}, - "CyberArkOauth2": {"target": UNIT}, - "FusionAuthOauth2": {"target": UNIT}, - "Auth0Oauth2": {"target": UNIT}, - "CognitoOauth2": {"target": UNIT}, - }, -) - -CLIENT_ID_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ClientIdType"), - shape_type=ShapeType.STRING, -) - -DEFAULT_CLIENT_SECRET_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DefaultClientSecretType"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -ATLASSIAN_OAUTH2_PROVIDER_CONFIG_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AtlassianOauth2ProviderConfigInput" - ), - members={ - "clientId": { - "target": CLIENT_ID_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientSecret": { - "target": DEFAULT_CLIENT_SECRET_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="")], - }, - "clientSecretConfig": {"target": SECRET_REFERENCE}, - "clientSecretSource": {"target": SECRET_SOURCE_TYPE}, - }, -) - -CLIENT_AUTHENTICATION_METHOD_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ClientAuthenticationMethodType"), - shape_type=ShapeType.ENUM, - members={ - "CLIENT_SECRET_BASIC": {"target": UNIT}, - "CLIENT_SECRET_POST": {"target": UNIT}, - "AWS_IAM_ID_TOKEN_JWT": {"target": UNIT}, - "PRIVATE_KEY_JWT": {"target": UNIT}, - }, -) - -DEFAULT_CLIENT_ID_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DefaultClientIdType"), - shape_type=ShapeType.STRING, -) - -AUTHORIZATION_ENDPOINT_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#AuthorizationEndpointType"), - shape_type=ShapeType.STRING, -) - -ISSUER_URL_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#IssuerUrlType"), - shape_type=ShapeType.STRING, -) - -RESPONSE_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ResponseType"), - shape_type=ShapeType.STRING, -) - -RESPONSE_LIST_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ResponseListType"), - shape_type=ShapeType.LIST, - members={"member": {"target": RESPONSE_TYPE}}, -) - -TOKEN_ENDPOINT_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#TokenEndpointType"), - shape_type=ShapeType.STRING, -) - -TOKEN_AUTH_METHOD = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#TokenAuthMethod"), - shape_type=ShapeType.STRING, -) - -TOKEN_ENDPOINT_AUTH_METHODS_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#TokenEndpointAuthMethodsType"), - shape_type=ShapeType.LIST, - members={"member": {"target": TOKEN_AUTH_METHOD}}, -) - -OAUTH2_AUTHORIZATION_SERVER_METADATA = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#Oauth2AuthorizationServerMetadata" - ), - members={ - "issuer": { - "target": ISSUER_URL_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "authorizationEndpoint": { - "target": AUTHORIZATION_ENDPOINT_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "tokenEndpoint": { - "target": TOKEN_ENDPOINT_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "responseTypes": {"target": RESPONSE_LIST_TYPE}, - "tokenEndpointAuthMethods": {"target": TOKEN_ENDPOINT_AUTH_METHODS_TYPE}, - }, -) - -DISCOVERY_URL_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DiscoveryUrlType"), - shape_type=ShapeType.STRING, -) - -OAUTH2_DISCOVERY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#Oauth2Discovery"), - shape_type=ShapeType.UNION, - members={ - "discoveryUrl": {"target": DISCOVERY_URL_TYPE}, - "authorizationServerMetadata": {"target": OAUTH2_AUTHORIZATION_SERVER_METADATA}, - }, -) - -ON_BEHALF_OF_TOKEN_EXCHANGE_GRANT_TYPE_TYPE = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#OnBehalfOfTokenExchangeGrantTypeType" - ), - shape_type=ShapeType.ENUM, - members={ - "TOKEN_EXCHANGE": {"target": UNIT}, - "JWT_AUTHORIZATION_GRANT": {"target": UNIT}, - }, -) - -SCOPE_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ScopeType"), - shape_type=ShapeType.STRING, -) - -SCOPES_LIST_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ScopesListType"), - shape_type=ShapeType.LIST, - members={"member": {"target": SCOPE_TYPE}}, -) - -TOKEN_EXCHANGE_GRANT_TYPE_CONFIG_TYPE = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#TokenExchangeGrantTypeConfigType" - ), - members={ - "actorTokenContent": { - "target": ACTOR_TOKEN_CONTENT_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "actorTokenScopes": {"target": SCOPES_LIST_TYPE}, - }, -) - -ON_BEHALF_OF_TOKEN_EXCHANGE_CONFIG_TYPE = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#OnBehalfOfTokenExchangeConfigType" - ), - members={ - "grantType": { - "target": ON_BEHALF_OF_TOKEN_EXCHANGE_GRANT_TYPE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "tokenExchangeGrantTypeConfig": { - "target": TOKEN_EXCHANGE_GRANT_TYPE_CONFIG_TYPE - }, - }, -) - -KMS_KEY_SOURCE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#KmsKeySourceType"), - members={ - "kmsKeyArn": { - "target": KMS_KEY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -PRIVATE_KEY_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PrivateKeySource"), - shape_type=ShapeType.UNION, - members={"kmsKeySource": {"target": KMS_KEY_SOURCE_TYPE}}, -) - -SIGNING_ALGORITHM = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SigningAlgorithm"), - shape_type=ShapeType.ENUM, - members={ - "RS256": {"target": UNIT}, - "PS256": {"target": UNIT}, - "ES256": {"target": UNIT}, - }, -) - -PRIVATE_KEY_JWT_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PrivateKeyJwtConfig"), - members={ - "privateKeySource": {"target": PRIVATE_KEY_SOURCE}, - "signingAlgorithm": {"target": SIGNING_ALGORITHM}, - "additionalHeaderClaims": {"target": ADDITIONAL_CLAIMS}, - "additionalPayloadClaims": {"target": ADDITIONAL_CLAIMS}, - }, -) - -CUSTOM_OAUTH2_PROVIDER_CONFIG_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CustomOauth2ProviderConfigInput"), - members={ - "oauthDiscovery": { - "target": OAUTH2_DISCOVERY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientId": { - "target": DEFAULT_CLIENT_ID_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="")], - }, - "clientSecret": { - "target": DEFAULT_CLIENT_SECRET_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="")], - }, - "clientSecretConfig": {"target": SECRET_REFERENCE}, - "clientSecretSource": {"target": SECRET_SOURCE_TYPE}, - "onBehalfOfTokenExchangeConfig": { - "target": ON_BEHALF_OF_TOKEN_EXCHANGE_CONFIG_TYPE - }, - "clientAuthenticationMethod": {"target": CLIENT_AUTHENTICATION_METHOD_TYPE}, - "privateKeyJwtConfig": {"target": PRIVATE_KEY_JWT_CONFIG}, - "privateEndpoint": {"target": PRIVATE_ENDPOINT}, - "privateEndpointOverrides": {"target": PRIVATE_ENDPOINT_OVERRIDES}, - }, -) - -GITHUB_OAUTH2_PROVIDER_CONFIG_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GithubOauth2ProviderConfigInput"), - members={ - "clientId": { - "target": CLIENT_ID_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientSecret": { - "target": DEFAULT_CLIENT_SECRET_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="")], - }, - "clientSecretConfig": {"target": SECRET_REFERENCE}, - "clientSecretSource": {"target": SECRET_SOURCE_TYPE}, - }, -) - -GOOGLE_OAUTH2_PROVIDER_CONFIG_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GoogleOauth2ProviderConfigInput"), - members={ - "clientId": { - "target": CLIENT_ID_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientSecret": { - "target": DEFAULT_CLIENT_SECRET_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="")], - }, - "clientSecretConfig": {"target": SECRET_REFERENCE}, - "clientSecretSource": {"target": SECRET_SOURCE_TYPE}, - }, -) - -INCLUDED_OAUTH2_PROVIDER_CONFIG_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#IncludedOauth2ProviderConfigInput" - ), - members={ - "clientId": { - "target": CLIENT_ID_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientSecret": { - "target": DEFAULT_CLIENT_SECRET_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="")], - }, - "clientSecretConfig": {"target": SECRET_REFERENCE}, - "clientSecretSource": {"target": SECRET_SOURCE_TYPE}, - "issuer": {"target": ISSUER_URL_TYPE}, - "authorizationEndpoint": {"target": AUTHORIZATION_ENDPOINT_TYPE}, - "tokenEndpoint": {"target": TOKEN_ENDPOINT_TYPE}, - }, -) - -LINKEDIN_OAUTH2_PROVIDER_CONFIG_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#LinkedinOauth2ProviderConfigInput" - ), - members={ - "clientId": { - "target": CLIENT_ID_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientSecret": { - "target": DEFAULT_CLIENT_SECRET_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="")], - }, - "clientSecretConfig": {"target": SECRET_REFERENCE}, - "clientSecretSource": {"target": SECRET_SOURCE_TYPE}, - }, -) - -TENANT_ID_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#TenantIdType"), - shape_type=ShapeType.STRING, -) - -MICROSOFT_OAUTH2_PROVIDER_CONFIG_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#MicrosoftOauth2ProviderConfigInput" - ), - members={ - "clientId": { - "target": CLIENT_ID_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientSecret": { - "target": DEFAULT_CLIENT_SECRET_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="")], - }, - "clientSecretConfig": {"target": SECRET_REFERENCE}, - "clientSecretSource": {"target": SECRET_SOURCE_TYPE}, - "tenantId": {"target": TENANT_ID_TYPE}, - }, -) - -SALESFORCE_OAUTH2_PROVIDER_CONFIG_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#SalesforceOauth2ProviderConfigInput" - ), - members={ - "clientId": { - "target": CLIENT_ID_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientSecret": { - "target": DEFAULT_CLIENT_SECRET_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="")], - }, - "clientSecretConfig": {"target": SECRET_REFERENCE}, - "clientSecretSource": {"target": SECRET_SOURCE_TYPE}, - }, -) - -SLACK_OAUTH2_PROVIDER_CONFIG_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SlackOauth2ProviderConfigInput"), - members={ - "clientId": { - "target": CLIENT_ID_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientSecret": { - "target": DEFAULT_CLIENT_SECRET_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="")], - }, - "clientSecretConfig": {"target": SECRET_REFERENCE}, - "clientSecretSource": {"target": SECRET_SOURCE_TYPE}, - }, -) - -OAUTH2_PROVIDER_CONFIG_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#Oauth2ProviderConfigInput"), - shape_type=ShapeType.UNION, - members={ - "customOauth2ProviderConfig": {"target": CUSTOM_OAUTH2_PROVIDER_CONFIG_INPUT}, - "googleOauth2ProviderConfig": {"target": GOOGLE_OAUTH2_PROVIDER_CONFIG_INPUT}, - "githubOauth2ProviderConfig": {"target": GITHUB_OAUTH2_PROVIDER_CONFIG_INPUT}, - "slackOauth2ProviderConfig": {"target": SLACK_OAUTH2_PROVIDER_CONFIG_INPUT}, - "salesforceOauth2ProviderConfig": { - "target": SALESFORCE_OAUTH2_PROVIDER_CONFIG_INPUT - }, - "microsoftOauth2ProviderConfig": { - "target": MICROSOFT_OAUTH2_PROVIDER_CONFIG_INPUT - }, - "atlassianOauth2ProviderConfig": { - "target": ATLASSIAN_OAUTH2_PROVIDER_CONFIG_INPUT - }, - "linkedinOauth2ProviderConfig": { - "target": LINKEDIN_OAUTH2_PROVIDER_CONFIG_INPUT - }, - "includedOauth2ProviderConfig": { - "target": INCLUDED_OAUTH2_PROVIDER_CONFIG_INPUT - }, - }, -) - -CREATE_OAUTH2_CREDENTIAL_PROVIDER_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#CreateOauth2CredentialProviderInput" - ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreateOauth2CredentialProviderRequest", - ) - ], - members={ - "name": { - "target": CREDENTIAL_PROVIDER_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "credentialProviderVendor": { - "target": CREDENTIAL_PROVIDER_VENDOR_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "oauth2ProviderConfigInput": { - "target": OAUTH2_PROVIDER_CONFIG_INPUT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "tags": {"target": TAGS_MAP}, - }, -) - -CREDENTIAL_PROVIDER_ARN_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CredentialProviderArnType"), - shape_type=ShapeType.STRING, -) - -ATLASSIAN_OAUTH2_PROVIDER_CONFIG_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AtlassianOauth2ProviderConfigOutput" - ), - members={ - "oauthDiscovery": { - "target": OAUTH2_DISCOVERY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientId": {"target": CLIENT_ID_TYPE}, - }, -) - -CUSTOM_OAUTH2_PROVIDER_CONFIG_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#CustomOauth2ProviderConfigOutput" - ), - members={ - "oauthDiscovery": { - "target": OAUTH2_DISCOVERY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientId": {"target": CLIENT_ID_TYPE}, - "onBehalfOfTokenExchangeConfig": { - "target": ON_BEHALF_OF_TOKEN_EXCHANGE_CONFIG_TYPE - }, - "clientAuthenticationMethod": {"target": CLIENT_AUTHENTICATION_METHOD_TYPE}, - "privateEndpoint": {"target": PRIVATE_ENDPOINT}, - "privateEndpointOverrides": {"target": PRIVATE_ENDPOINT_OVERRIDES}, - "privateKeyJwtConfig": {"target": PRIVATE_KEY_JWT_CONFIG}, - }, -) - -GITHUB_OAUTH2_PROVIDER_CONFIG_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#GithubOauth2ProviderConfigOutput" - ), - members={ - "oauthDiscovery": { - "target": OAUTH2_DISCOVERY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientId": {"target": CLIENT_ID_TYPE}, - }, -) - -GOOGLE_OAUTH2_PROVIDER_CONFIG_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#GoogleOauth2ProviderConfigOutput" - ), - members={ - "oauthDiscovery": { - "target": OAUTH2_DISCOVERY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientId": {"target": CLIENT_ID_TYPE}, - }, -) - -INCLUDED_OAUTH2_PROVIDER_CONFIG_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#IncludedOauth2ProviderConfigOutput" - ), - members={ - "oauthDiscovery": { - "target": OAUTH2_DISCOVERY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientId": {"target": CLIENT_ID_TYPE}, - }, -) - -LINKEDIN_OAUTH2_PROVIDER_CONFIG_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#LinkedinOauth2ProviderConfigOutput" - ), - members={ - "oauthDiscovery": { - "target": OAUTH2_DISCOVERY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientId": {"target": CLIENT_ID_TYPE}, - }, -) - -MICROSOFT_OAUTH2_PROVIDER_CONFIG_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#MicrosoftOauth2ProviderConfigOutput" - ), - members={ - "oauthDiscovery": { - "target": OAUTH2_DISCOVERY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientId": {"target": CLIENT_ID_TYPE}, - }, -) - -SALESFORCE_OAUTH2_PROVIDER_CONFIG_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#SalesforceOauth2ProviderConfigOutput" - ), - members={ - "oauthDiscovery": { - "target": OAUTH2_DISCOVERY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientId": {"target": CLIENT_ID_TYPE}, - }, -) - -SLACK_OAUTH2_PROVIDER_CONFIG_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SlackOauth2ProviderConfigOutput"), - members={ - "oauthDiscovery": { - "target": OAUTH2_DISCOVERY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientId": {"target": CLIENT_ID_TYPE}, - }, -) - -OAUTH2_PROVIDER_CONFIG_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#Oauth2ProviderConfigOutput"), - shape_type=ShapeType.UNION, - members={ - "customOauth2ProviderConfig": {"target": CUSTOM_OAUTH2_PROVIDER_CONFIG_OUTPUT}, - "googleOauth2ProviderConfig": {"target": GOOGLE_OAUTH2_PROVIDER_CONFIG_OUTPUT}, - "githubOauth2ProviderConfig": {"target": GITHUB_OAUTH2_PROVIDER_CONFIG_OUTPUT}, - "slackOauth2ProviderConfig": {"target": SLACK_OAUTH2_PROVIDER_CONFIG_OUTPUT}, - "salesforceOauth2ProviderConfig": { - "target": SALESFORCE_OAUTH2_PROVIDER_CONFIG_OUTPUT - }, - "microsoftOauth2ProviderConfig": { - "target": MICROSOFT_OAUTH2_PROVIDER_CONFIG_OUTPUT - }, - "atlassianOauth2ProviderConfig": { - "target": ATLASSIAN_OAUTH2_PROVIDER_CONFIG_OUTPUT - }, - "linkedinOauth2ProviderConfig": { - "target": LINKEDIN_OAUTH2_PROVIDER_CONFIG_OUTPUT - }, - "includedOauth2ProviderConfig": { - "target": INCLUDED_OAUTH2_PROVIDER_CONFIG_OUTPUT - }, - }, -) - -STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#Status"), - shape_type=ShapeType.ENUM, - members={ - "CREATING": {"target": UNIT}, - "CREATE_FAILED": {"target": UNIT}, - "UPDATING": {"target": UNIT}, - "UPDATE_FAILED": {"target": UNIT}, - "READY": {"target": UNIT}, - "DELETING": {"target": UNIT}, - "DELETE_FAILED": {"target": UNIT}, - }, -) - -CREATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#CreateOauth2CredentialProviderOutput" - ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreateOauth2CredentialProviderResponse", - ) - ], - members={ - "clientSecretArn": { - "target": SECRET, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientSecretJsonKey": {"target": SECRET_JSON_KEY_TYPE}, - "clientSecretSource": {"target": SECRET_SOURCE_TYPE}, - "name": { - "target": CREDENTIAL_PROVIDER_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "credentialProviderArn": { - "target": CREDENTIAL_PROVIDER_ARN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "callbackUrl": {"target": _STRING}, - "oauth2ProviderConfigOutput": {"target": OAUTH2_PROVIDER_CONFIG_OUTPUT}, - "status": {"target": STATUS}, - }, -) - -CREATE_OAUTH2_CREDENTIAL_PROVIDER = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateOauth2CredentialProvider"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 201, - "uri": "/identities/CreateOauth2CredentialProvider", - "method": "POST", - } - ), - ) - ], -) - -DELETE_OAUTH2_CREDENTIAL_PROVIDER_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#DeleteOauth2CredentialProviderInput" - ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeleteOauth2CredentialProviderRequest", - ) - ], - members={ - "name": { - "target": CREDENTIAL_PROVIDER_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -DELETE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#DeleteOauth2CredentialProviderOutput" - ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeleteOauth2CredentialProviderResponse", - ) - ], -) - -DELETE_OAUTH2_CREDENTIAL_PROVIDER = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteOauth2CredentialProvider"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 204, - "uri": "/identities/DeleteOauth2CredentialProvider", - "method": "POST", - } - ), - ) - ], -) - -GET_OAUTH2_CREDENTIAL_PROVIDER_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#GetOauth2CredentialProviderInput" - ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetOauth2CredentialProviderRequest", - ) - ], - members={ - "name": { - "target": CREDENTIAL_PROVIDER_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -GET_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#GetOauth2CredentialProviderOutput" - ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetOauth2CredentialProviderResponse", - ) - ], - members={ - "clientSecretArn": { - "target": SECRET, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientSecretJsonKey": {"target": SECRET_JSON_KEY_TYPE}, - "clientSecretSource": {"target": SECRET_SOURCE_TYPE}, - "name": { - "target": CREDENTIAL_PROVIDER_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "credentialProviderArn": { - "target": CREDENTIAL_PROVIDER_ARN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "credentialProviderVendor": { - "target": CREDENTIAL_PROVIDER_VENDOR_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "callbackUrl": {"target": _STRING}, - "oauth2ProviderConfigOutput": { - "target": OAUTH2_PROVIDER_CONFIG_OUTPUT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastUpdatedTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": {"target": STATUS}, - "failureReason": {"target": _STRING}, - }, -) - -GET_OAUTH2_CREDENTIAL_PROVIDER = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetOauth2CredentialProvider"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"uri": "/identities/GetOauth2CredentialProvider", "method": "POST"} - ), - ) - ], -) - -LIST_OAUTH2_CREDENTIAL_PROVIDERS_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ListOauth2CredentialProvidersInput" - ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListOauth2CredentialProvidersRequest", - ) - ], - members={ - "nextToken": {"target": _STRING}, - "maxResults": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=10)], - }, - }, -) - -OAUTH2_CREDENTIAL_PROVIDER_ITEM = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#Oauth2CredentialProviderItem"), - members={ - "name": { - "target": CREDENTIAL_PROVIDER_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "credentialProviderVendor": { - "target": CREDENTIAL_PROVIDER_VENDOR_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "credentialProviderArn": { - "target": CREDENTIAL_PROVIDER_ARN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastUpdatedTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -OAUTH2_CREDENTIAL_PROVIDERS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#Oauth2CredentialProviders"), - shape_type=ShapeType.LIST, - members={"member": {"target": OAUTH2_CREDENTIAL_PROVIDER_ITEM}}, -) - -LIST_OAUTH2_CREDENTIAL_PROVIDERS_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ListOauth2CredentialProvidersOutput" - ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListOauth2CredentialProvidersResponse", - ) - ], - members={ - "credentialProviders": { - "target": OAUTH2_CREDENTIAL_PROVIDERS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": _STRING}, - }, -) - -LIST_OAUTH2_CREDENTIAL_PROVIDERS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListOauth2CredentialProviders"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"uri": "/identities/ListOauth2CredentialProviders", "method": "POST"} - ), - ) - ], -) - -UPDATE_OAUTH2_CREDENTIAL_PROVIDER_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#UpdateOauth2CredentialProviderInput" - ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UpdateOauth2CredentialProviderRequest", - ) - ], - members={ - "name": { - "target": CREDENTIAL_PROVIDER_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "credentialProviderVendor": { - "target": CREDENTIAL_PROVIDER_VENDOR_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "oauth2ProviderConfigInput": { - "target": OAUTH2_PROVIDER_CONFIG_INPUT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -UPDATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#UpdateOauth2CredentialProviderOutput" - ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UpdateOauth2CredentialProviderResponse", - ) - ], - members={ - "clientSecretArn": { - "target": SECRET, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientSecretJsonKey": {"target": SECRET_JSON_KEY_TYPE}, - "clientSecretSource": {"target": SECRET_SOURCE_TYPE}, - "name": { - "target": CREDENTIAL_PROVIDER_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "credentialProviderVendor": { - "target": CREDENTIAL_PROVIDER_VENDOR_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "credentialProviderArn": { - "target": CREDENTIAL_PROVIDER_ARN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "callbackUrl": {"target": _STRING}, - "oauth2ProviderConfigOutput": { - "target": OAUTH2_PROVIDER_CONFIG_OUTPUT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastUpdatedTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": {"target": STATUS}, - }, -) - -UPDATE_OAUTH2_CREDENTIAL_PROVIDER = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateOauth2CredentialProvider"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"uri": "/identities/UpdateOauth2CredentialProvider", "method": "POST"} - ), - ) - ], -) - -CLUSTERING_FREQUENCY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ClusteringFrequency"), - shape_type=ShapeType.ENUM, - members={ - "DAILY": {"target": UNIT}, - "WEEKLY": {"target": UNIT}, - "MONTHLY": {"target": UNIT}, - }, -) - -CLUSTERING_FREQUENCY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ClusteringFrequencyList"), - shape_type=ShapeType.LIST, - members={"member": {"target": CLUSTERING_FREQUENCY}}, -) - -CLUSTERING_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ClusteringConfig"), - members={ - "frequencies": { - "target": CLUSTERING_FREQUENCY_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -LOG_GROUP_NAME_PREFIX = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#LogGroupNamePrefix"), - shape_type=ShapeType.STRING, -) - -LOG_GROUP_NAME_PREFIX_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#LogGroupNamePrefixList"), - shape_type=ShapeType.LIST, - members={"member": {"target": LOG_GROUP_NAME_PREFIX}}, -) - -LOG_GROUP_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#LogGroupName"), - shape_type=ShapeType.STRING, -) - -LOG_GROUP_NAMES_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#LogGroupNamesList"), - shape_type=ShapeType.LIST, - members={"member": {"target": LOG_GROUP_NAME}}, -) - -SERVICE_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceName"), - shape_type=ShapeType.STRING, -) - -SERVICE_NAMES_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceNamesList"), - shape_type=ShapeType.LIST, - members={"member": {"target": SERVICE_NAME}}, -) - -CLOUD_WATCH_LOGS_INPUT_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CloudWatchLogsInputConfig"), - members={ - "logGroupNames": { - "target": LOG_GROUP_NAMES_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=())], - }, - "logGroupNamePrefixes": {"target": LOG_GROUP_NAME_PREFIX_LIST}, - "serviceNames": { - "target": SERVICE_NAMES_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -DATA_SOURCE_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DataSourceConfig"), - shape_type=ShapeType.UNION, - members={"cloudWatchLogs": {"target": CLOUD_WATCH_LOGS_INPUT_CONFIG}}, -) - -EVALUATION_CONFIG_DESCRIPTION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#EvaluationConfigDescription"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -EVALUATOR_REFERENCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#EvaluatorReference"), - shape_type=ShapeType.UNION, - members={"evaluatorId": {"target": EVALUATOR_ID}}, -) - -EVALUATOR_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#EvaluatorList"), - shape_type=ShapeType.LIST, - members={"member": {"target": EVALUATOR_REFERENCE}}, -) - -INSIGHT_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#InsightId"), - shape_type=ShapeType.STRING, -) - -INSIGHT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#Insight"), - members={ - "insightId": { - "target": INSIGHT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -INSIGHT_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#InsightList"), - shape_type=ShapeType.LIST, - members={"member": {"target": INSIGHT}}, -) - -EVALUATION_CONFIG_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#EvaluationConfigName"), - shape_type=ShapeType.STRING, -) - -OPTIONAL_LOG_GROUP_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#OptionalLogGroupName"), - shape_type=ShapeType.STRING, -) - -METRICS_NAMESPACE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#MetricsNamespace"), - shape_type=ShapeType.STRING, -) - -RESULT_DESTINATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ResultDestination"), - shape_type=ShapeType.ENUM, - members={ - "DEDICATED_LOG_GROUP": {"target": UNIT}, - "SOURCE_LOG_GROUP": {"target": UNIT}, - }, -) - -CLOUD_WATCH_OUTPUT_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CloudWatchOutputConfig"), - members={ - "logGroupName": { - "target": OPTIONAL_LOG_GROUP_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="")], - }, - "metricsNamespace": {"target": METRICS_NAMESPACE}, - "resultDestination": { - "target": RESULT_DESTINATION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value="DEDICATED_LOG_GROUP") - ], - }, - }, -) - -OUTPUT_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#OutputConfig"), - members={ - "cloudWatchConfig": { - "target": CLOUD_WATCH_OUTPUT_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -FILTER_OPERATOR = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#FilterOperator"), - shape_type=ShapeType.ENUM, - members={ - "EQUALS": {"target": UNIT}, - "NOT_EQUALS": {"target": UNIT}, - "GREATER_THAN": {"target": UNIT}, - "LESS_THAN": {"target": UNIT}, - "GREATER_THAN_OR_EQUAL": {"target": UNIT}, - "LESS_THAN_OR_EQUAL": {"target": UNIT}, - "CONTAINS": {"target": UNIT}, - "NOT_CONTAINS": {"target": UNIT}, - }, -) - -FILTER_VALUE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#FilterValue"), - shape_type=ShapeType.UNION, - members={ - "stringValue": {"target": _STRING}, - "doubleValue": {"target": DOUBLE}, - "booleanValue": {"target": BOOLEAN}, - }, -) - -FILTER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#Filter"), - members={ - "key": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "operator": { - "target": FILTER_OPERATOR, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "value": { - "target": FILTER_VALUE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -FILTER_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#FilterList"), - shape_type=ShapeType.LIST, - members={"member": {"target": FILTER}}, -) - -SAMPLING_PERCENTAGE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SamplingPercentage"), - shape_type=ShapeType.DOUBLE, -) - -SAMPLING_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SamplingConfig"), - members={ - "samplingPercentage": { - "target": SAMPLING_PERCENTAGE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -SESSION_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SessionConfig"), - members={ - "sessionTimeoutMinutes": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -RULE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#Rule"), - members={ - "samplingConfig": { - "target": SAMPLING_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "filters": {"target": FILTER_LIST}, - "sessionConfig": {"target": SESSION_CONFIG}, - }, -) - -CREATE_ONLINE_EVALUATION_CONFIG_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#CreateOnlineEvaluationConfigInput" - ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreateOnlineEvaluationConfigRequest", - ) - ], - members={ - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "onlineEvaluationConfigName": { - "target": EVALUATION_CONFIG_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": EVALUATION_CONFIG_DESCRIPTION}, - "rule": { - "target": RULE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "dataSourceConfig": { - "target": DATA_SOURCE_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "evaluators": {"target": EVALUATOR_LIST}, - "insights": {"target": INSIGHT_LIST}, - "clusteringConfig": {"target": CLUSTERING_CONFIG}, - "outputConfig": {"target": OUTPUT_CONFIG}, - "evaluationExecutionRoleArn": { - "target": ROLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "enableOnCreate": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "tags": {"target": TAGS_MAP}, - }, -) - -ONLINE_EVALUATION_EXECUTION_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#OnlineEvaluationExecutionStatus"), - shape_type=ShapeType.ENUM, - members={"ENABLED": {"target": UNIT}, "DISABLED": {"target": UNIT}}, -) - -ONLINE_EVALUATION_CONFIG_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#OnlineEvaluationConfigArn"), - shape_type=ShapeType.STRING, -) - -ONLINE_EVALUATION_CONFIG_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#OnlineEvaluationConfigId"), - shape_type=ShapeType.STRING, -) - -ONLINE_EVALUATION_CONFIG_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#OnlineEvaluationConfigStatus"), - shape_type=ShapeType.ENUM, - members={ - "ACTIVE": {"target": UNIT}, - "CREATING": {"target": UNIT}, - "CREATE_FAILED": {"target": UNIT}, - "UPDATING": {"target": UNIT}, - "UPDATE_FAILED": {"target": UNIT}, - "DELETING": {"target": UNIT}, - "ERROR": {"target": UNIT}, - }, -) - -CREATE_ONLINE_EVALUATION_CONFIG_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#CreateOnlineEvaluationConfigOutput" - ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreateOnlineEvaluationConfigResponse", - ) - ], - members={ - "onlineEvaluationConfigArn": { - "target": ONLINE_EVALUATION_CONFIG_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "onlineEvaluationConfigId": { - "target": ONLINE_EVALUATION_CONFIG_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "outputConfig": {"target": OUTPUT_CONFIG}, - "status": { - "target": ONLINE_EVALUATION_CONFIG_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "executionStatus": { - "target": ONLINE_EVALUATION_EXECUTION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "failureReason": {"target": _STRING}, - }, -) - -CREATE_ONLINE_EVALUATION_CONFIG = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateOnlineEvaluationConfig"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/online-evaluation-configs/create", - "code": 202, - } - ), - ) - ], -) - -DELETE_ONLINE_EVALUATION_CONFIG_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#DeleteOnlineEvaluationConfigInput" - ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeleteOnlineEvaluationConfigRequest", - ) - ], - members={ - "onlineEvaluationConfigId": { - "target": ONLINE_EVALUATION_CONFIG_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -DELETE_ONLINE_EVALUATION_CONFIG_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#DeleteOnlineEvaluationConfigOutput" - ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeleteOnlineEvaluationConfigResponse", - ) - ], - members={ - "onlineEvaluationConfigArn": { - "target": ONLINE_EVALUATION_CONFIG_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "onlineEvaluationConfigId": { - "target": ONLINE_EVALUATION_CONFIG_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": ONLINE_EVALUATION_CONFIG_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -DELETE_ONLINE_EVALUATION_CONFIG = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteOnlineEvaluationConfig"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/online-evaluation-configs/{onlineEvaluationConfigId}", - "code": 202, - } - ), - ) - ], -) - -GET_ONLINE_EVALUATION_CONFIG_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetOnlineEvaluationConfigInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetOnlineEvaluationConfigRequest", - ) - ], - members={ - "onlineEvaluationConfigId": { - "target": ONLINE_EVALUATION_CONFIG_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -GET_ONLINE_EVALUATION_CONFIG_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetOnlineEvaluationConfigOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetOnlineEvaluationConfigResponse", - ) - ], - members={ - "onlineEvaluationConfigArn": { - "target": ONLINE_EVALUATION_CONFIG_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "onlineEvaluationConfigId": { - "target": ONLINE_EVALUATION_CONFIG_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "onlineEvaluationConfigName": { - "target": EVALUATION_CONFIG_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": EVALUATION_CONFIG_DESCRIPTION}, - "rule": { - "target": RULE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "dataSourceConfig": { - "target": DATA_SOURCE_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "evaluators": { - "target": EVALUATOR_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=())], - }, - "insights": {"target": INSIGHT_LIST}, - "clusteringConfig": {"target": CLUSTERING_CONFIG}, - "outputConfig": {"target": OUTPUT_CONFIG}, - "evaluationExecutionRoleArn": {"target": ROLE_ARN}, - "status": { - "target": ONLINE_EVALUATION_CONFIG_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "executionStatus": { - "target": ONLINE_EVALUATION_EXECUTION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "failureReason": {"target": _STRING}, - }, -) - -GET_ONLINE_EVALUATION_CONFIG = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetOnlineEvaluationConfig"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/online-evaluation-configs/{onlineEvaluationConfigId}", - } - ), - ) - ], -) - -LIST_ONLINE_EVALUATION_CONFIGS_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ListOnlineEvaluationConfigsInput" - ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListOnlineEvaluationConfigsRequest", - ) - ], - members={ - "nextToken": { - "target": _STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "maxResults": { - "target": INTEGER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - }, -) - -ONLINE_EVALUATION_CONFIG_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#OnlineEvaluationConfigSummary"), - members={ - "onlineEvaluationConfigArn": { - "target": ONLINE_EVALUATION_CONFIG_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "onlineEvaluationConfigId": { - "target": ONLINE_EVALUATION_CONFIG_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "onlineEvaluationConfigName": { - "target": EVALUATION_CONFIG_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": EVALUATION_CONFIG_DESCRIPTION}, - "status": { - "target": ONLINE_EVALUATION_CONFIG_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "executionStatus": { - "target": ONLINE_EVALUATION_EXECUTION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "failureReason": {"target": _STRING}, - "insights": {"target": INSIGHT_LIST}, - "clusteringConfig": {"target": CLUSTERING_CONFIG}, - }, -) - -ONLINE_EVALUATION_CONFIG_SUMMARY_LIST = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#OnlineEvaluationConfigSummaryList" - ), - shape_type=ShapeType.LIST, - members={"member": {"target": ONLINE_EVALUATION_CONFIG_SUMMARY}}, -) - -LIST_ONLINE_EVALUATION_CONFIGS_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ListOnlineEvaluationConfigsOutput" - ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListOnlineEvaluationConfigsResponse", - ) - ], - members={ - "onlineEvaluationConfigs": { - "target": ONLINE_EVALUATION_CONFIG_SUMMARY_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": _STRING}, - }, -) - -LIST_ONLINE_EVALUATION_CONFIGS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListOnlineEvaluationConfigs"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/online-evaluation-configs"} - ), - ) - ], -) - -UPDATE_ONLINE_EVALUATION_CONFIG_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#UpdateOnlineEvaluationConfigInput" - ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UpdateOnlineEvaluationConfigRequest", - ) - ], - members={ - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "onlineEvaluationConfigId": { - "target": ONLINE_EVALUATION_CONFIG_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "description": {"target": EVALUATION_CONFIG_DESCRIPTION}, - "rule": {"target": RULE}, - "dataSourceConfig": {"target": DATA_SOURCE_CONFIG}, - "evaluators": {"target": EVALUATOR_LIST}, - "insights": {"target": INSIGHT_LIST}, - "clusteringConfig": {"target": CLUSTERING_CONFIG}, - "outputConfig": {"target": OUTPUT_CONFIG}, - "evaluationExecutionRoleArn": {"target": ROLE_ARN}, - "executionStatus": {"target": ONLINE_EVALUATION_EXECUTION_STATUS}, - }, -) - -UPDATE_ONLINE_EVALUATION_CONFIG_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#UpdateOnlineEvaluationConfigOutput" - ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UpdateOnlineEvaluationConfigResponse", - ) - ], - members={ - "onlineEvaluationConfigArn": { - "target": ONLINE_EVALUATION_CONFIG_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "onlineEvaluationConfigId": { - "target": ONLINE_EVALUATION_CONFIG_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": ONLINE_EVALUATION_CONFIG_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "executionStatus": { - "target": ONLINE_EVALUATION_EXECUTION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "failureReason": {"target": _STRING}, - }, -) - -UPDATE_ONLINE_EVALUATION_CONFIG = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateOnlineEvaluationConfig"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PUT", - "uri": "/online-evaluation-configs/{onlineEvaluationConfigId}", - "code": 202, - } - ), - ) - ], -) - -PAYMENT_CREDENTIAL_PROVIDER_VENDOR_TYPE = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#PaymentCredentialProviderVendorType" - ), - shape_type=ShapeType.ENUM, - members={"CoinbaseCDP": {"target": UNIT}, "StripePrivy": {"target": UNIT}}, -) - -COINBASE_CDP_API_KEY_ID_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CoinbaseCdpApiKeyIdType"), - shape_type=ShapeType.STRING, -) - -DEFAULT_COINBASE_CDP_API_KEY_SECRET_TYPE = Schema( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#DefaultCoinbaseCdpApiKeySecretType" - ), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -DEFAULT_COINBASE_CDP_WALLET_SECRET_TYPE = Schema( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#DefaultCoinbaseCdpWalletSecretType" - ), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -COINBASE_CDP_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CoinbaseCdpConfigurationInput"), - members={ - "apiKeyId": { - "target": COINBASE_CDP_API_KEY_ID_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "apiKeySecret": { - "target": DEFAULT_COINBASE_CDP_API_KEY_SECRET_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="")], - }, - "apiKeySecretSource": {"target": SECRET_SOURCE_TYPE}, - "apiKeySecretConfig": {"target": SECRET_REFERENCE}, - "walletSecret": { - "target": DEFAULT_COINBASE_CDP_WALLET_SECRET_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="")], - }, - "walletSecretSource": {"target": SECRET_SOURCE_TYPE}, - "walletSecretConfig": {"target": SECRET_REFERENCE}, - }, -) - -STRIPE_PRIVY_APP_ID_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#StripePrivyAppIdType"), - shape_type=ShapeType.STRING, -) - -DEFAULT_STRIPE_PRIVY_APP_SECRET_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DefaultStripePrivyAppSecretType"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -STRIPE_PRIVY_AUTHORIZATION_ID_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#StripePrivyAuthorizationIdType"), - shape_type=ShapeType.STRING, -) - -DEFAULT_STRIPE_PRIVY_AUTHORIZATION_PRIVATE_KEY_TYPE = Schema( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#DefaultStripePrivyAuthorizationPrivateKeyType" - ), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -STRIPE_PRIVY_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#StripePrivyConfigurationInput"), - members={ - "appId": { - "target": STRIPE_PRIVY_APP_ID_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "appSecret": { - "target": DEFAULT_STRIPE_PRIVY_APP_SECRET_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="")], - }, - "appSecretSource": {"target": SECRET_SOURCE_TYPE}, - "appSecretConfig": {"target": SECRET_REFERENCE}, - "authorizationPrivateKey": { - "target": DEFAULT_STRIPE_PRIVY_AUTHORIZATION_PRIVATE_KEY_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="")], - }, - "authorizationPrivateKeySource": {"target": SECRET_SOURCE_TYPE}, - "authorizationPrivateKeyConfig": {"target": SECRET_REFERENCE}, - "authorizationId": { - "target": STRIPE_PRIVY_AUTHORIZATION_ID_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -PAYMENT_PROVIDER_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#PaymentProviderConfigurationInput" - ), - shape_type=ShapeType.UNION, - members={ - "coinbaseCdpConfiguration": {"target": COINBASE_CDP_CONFIGURATION_INPUT}, - "stripePrivyConfiguration": {"target": STRIPE_PRIVY_CONFIGURATION_INPUT}, - }, -) - -CREATE_PAYMENT_CREDENTIAL_PROVIDER_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#CreatePaymentCredentialProviderInput" - ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreatePaymentCredentialProviderRequest", - ) - ], - members={ - "name": { - "target": CREDENTIAL_PROVIDER_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "credentialProviderVendor": { - "target": PAYMENT_CREDENTIAL_PROVIDER_VENDOR_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "providerConfigurationInput": { - "target": PAYMENT_PROVIDER_CONFIGURATION_INPUT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "tags": {"target": TAGS_MAP}, - }, -) - -PAYMENT_CREDENTIAL_PROVIDER_ARN_TYPE = Schema( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#PaymentCredentialProviderArnType" - ), - shape_type=ShapeType.STRING, -) - -COINBASE_CDP_CONFIGURATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CoinbaseCdpConfigurationOutput"), - members={ - "apiKeyId": { - "target": COINBASE_CDP_API_KEY_ID_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "apiKeySecretArn": { - "target": SECRET, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "apiKeySecretJsonKey": {"target": SECRET_JSON_KEY_TYPE}, - "apiKeySecretSource": {"target": SECRET_SOURCE_TYPE}, - "walletSecretArn": { - "target": SECRET, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "walletSecretJsonKey": {"target": SECRET_JSON_KEY_TYPE}, - "walletSecretSource": {"target": SECRET_SOURCE_TYPE}, - }, -) - -STRIPE_PRIVY_CONFIGURATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#StripePrivyConfigurationOutput"), - members={ - "appId": { - "target": STRIPE_PRIVY_APP_ID_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "appSecretArn": { - "target": SECRET, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "appSecretJsonKey": {"target": SECRET_JSON_KEY_TYPE}, - "appSecretSource": {"target": SECRET_SOURCE_TYPE}, - "authorizationPrivateKeyArn": { - "target": SECRET, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "authorizationPrivateKeyJsonKey": {"target": SECRET_JSON_KEY_TYPE}, - "authorizationPrivateKeySource": {"target": SECRET_SOURCE_TYPE}, - "authorizationId": { - "target": STRIPE_PRIVY_AUTHORIZATION_ID_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -PAYMENT_PROVIDER_CONFIGURATION_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#PaymentProviderConfigurationOutput" - ), - shape_type=ShapeType.UNION, - members={ - "coinbaseCdpConfiguration": {"target": COINBASE_CDP_CONFIGURATION_OUTPUT}, - "stripePrivyConfiguration": {"target": STRIPE_PRIVY_CONFIGURATION_OUTPUT}, - }, -) - -CREATE_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#CreatePaymentCredentialProviderOutput" - ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreatePaymentCredentialProviderResponse", - ) - ], - members={ - "name": { - "target": CREDENTIAL_PROVIDER_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "credentialProviderVendor": { - "target": PAYMENT_CREDENTIAL_PROVIDER_VENDOR_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "credentialProviderArn": { - "target": PAYMENT_CREDENTIAL_PROVIDER_ARN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "providerConfigurationOutput": { - "target": PAYMENT_PROVIDER_CONFIGURATION_OUTPUT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -CREATE_PAYMENT_CREDENTIAL_PROVIDER = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreatePaymentCredentialProvider"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 201, - "uri": "/identities/CreatePaymentCredentialProvider", - "method": "POST", - } - ), - ) - ], -) - -DELETE_PAYMENT_CREDENTIAL_PROVIDER_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#DeletePaymentCredentialProviderInput" - ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeletePaymentCredentialProviderRequest", - ) - ], - members={ - "name": { - "target": CREDENTIAL_PROVIDER_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -DELETE_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#DeletePaymentCredentialProviderOutput" - ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeletePaymentCredentialProviderResponse", - ) - ], -) - -DELETE_PAYMENT_CREDENTIAL_PROVIDER = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeletePaymentCredentialProvider"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 204, - "uri": "/identities/DeletePaymentCredentialProvider", - "method": "POST", - } - ), - ) - ], -) - -GET_PAYMENT_CREDENTIAL_PROVIDER_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#GetPaymentCredentialProviderInput" - ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetPaymentCredentialProviderRequest", - ) - ], - members={ - "name": { - "target": CREDENTIAL_PROVIDER_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -GET_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#GetPaymentCredentialProviderOutput" - ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetPaymentCredentialProviderResponse", - ) - ], - members={ - "name": { - "target": CREDENTIAL_PROVIDER_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "credentialProviderArn": { - "target": PAYMENT_CREDENTIAL_PROVIDER_ARN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "credentialProviderVendor": { - "target": PAYMENT_CREDENTIAL_PROVIDER_VENDOR_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "providerConfigurationOutput": { - "target": PAYMENT_PROVIDER_CONFIGURATION_OUTPUT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastUpdatedTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "tags": {"target": TAGS_MAP}, - }, -) - -GET_PAYMENT_CREDENTIAL_PROVIDER = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetPaymentCredentialProvider"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"uri": "/identities/GetPaymentCredentialProvider", "method": "POST"} - ), - ) - ], -) - -LIST_PAYMENT_CREDENTIAL_PROVIDERS_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ListPaymentCredentialProvidersInput" - ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListPaymentCredentialProvidersRequest", - ) - ], - members={ - "nextToken": {"target": _STRING}, - "maxResults": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=10)], - }, - }, -) - -PAYMENT_CREDENTIAL_PROVIDER_ITEM = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PaymentCredentialProviderItem"), - members={ - "name": { - "target": CREDENTIAL_PROVIDER_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "credentialProviderVendor": { - "target": PAYMENT_CREDENTIAL_PROVIDER_VENDOR_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "credentialProviderArn": { - "target": PAYMENT_CREDENTIAL_PROVIDER_ARN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastUpdatedTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -PAYMENT_CREDENTIAL_PROVIDERS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PaymentCredentialProviders"), - shape_type=ShapeType.LIST, - members={"member": {"target": PAYMENT_CREDENTIAL_PROVIDER_ITEM}}, -) - -LIST_PAYMENT_CREDENTIAL_PROVIDERS_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ListPaymentCredentialProvidersOutput" - ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListPaymentCredentialProvidersResponse", - ) - ], - members={ - "credentialProviders": { - "target": PAYMENT_CREDENTIAL_PROVIDERS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": _STRING}, - }, -) - -LIST_PAYMENT_CREDENTIAL_PROVIDERS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListPaymentCredentialProviders"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"uri": "/identities/ListPaymentCredentialProviders", "method": "POST"} - ), - ) - ], -) - -UPDATE_PAYMENT_CREDENTIAL_PROVIDER_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#UpdatePaymentCredentialProviderInput" - ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UpdatePaymentCredentialProviderRequest", - ) - ], - members={ - "name": { - "target": CREDENTIAL_PROVIDER_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "credentialProviderVendor": { - "target": PAYMENT_CREDENTIAL_PROVIDER_VENDOR_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "providerConfigurationInput": { - "target": PAYMENT_PROVIDER_CONFIGURATION_INPUT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -UPDATE_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#UpdatePaymentCredentialProviderOutput" - ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UpdatePaymentCredentialProviderResponse", - ) - ], - members={ - "name": { - "target": CREDENTIAL_PROVIDER_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "credentialProviderVendor": { - "target": PAYMENT_CREDENTIAL_PROVIDER_VENDOR_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "credentialProviderArn": { - "target": PAYMENT_CREDENTIAL_PROVIDER_ARN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "providerConfigurationOutput": { - "target": PAYMENT_PROVIDER_CONFIGURATION_OUTPUT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastUpdatedTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -UPDATE_PAYMENT_CREDENTIAL_PROVIDER = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdatePaymentCredentialProvider"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"uri": "/identities/UpdatePaymentCredentialProvider", "method": "POST"} - ), - ) - ], -) - -PAYMENTS_AUTHORIZER_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PaymentsAuthorizerType"), - shape_type=ShapeType.ENUM, - members={"CUSTOM_JWT": {"target": UNIT}, "AWS_IAM": {"target": UNIT}}, -) - -PAYMENTS_DESCRIPTION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PaymentsDescription"), - shape_type=ShapeType.STRING, -) - -PAYMENT_MANAGER_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PaymentManagerName"), - shape_type=ShapeType.STRING, -) - -CREATE_PAYMENT_MANAGER_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreatePaymentManagerInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreatePaymentManagerRequest", - ) - ], - members={ - "name": { - "target": PAYMENT_MANAGER_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": PAYMENTS_DESCRIPTION}, - "authorizerType": { - "target": PAYMENTS_AUTHORIZER_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "authorizerConfiguration": {"target": AUTHORIZER_CONFIGURATION}, - "roleArn": { - "target": ROLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "tags": {"target": TAGS_MAP}, - "kmsKeyArn": {"target": KMS_KEY_ARN}, - }, -) - -PAYMENT_MANAGER_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PaymentManagerArn"), - shape_type=ShapeType.STRING, -) - -PAYMENT_MANAGER_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PaymentManagerId"), - shape_type=ShapeType.STRING, -) - -PAYMENT_MANAGER_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PaymentManagerStatus"), - shape_type=ShapeType.ENUM, - members={ - "CREATING": {"target": UNIT}, - "UPDATING": {"target": UNIT}, - "DELETING": {"target": UNIT}, - "READY": {"target": UNIT}, - "CREATE_FAILED": {"target": UNIT}, - "UPDATE_FAILED": {"target": UNIT}, - "DELETE_FAILED": {"target": UNIT}, - }, -) - -CREATE_PAYMENT_MANAGER_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreatePaymentManagerOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreatePaymentManagerResponse", - ) - ], - members={ - "paymentManagerArn": { - "target": PAYMENT_MANAGER_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "paymentManagerId": { - "target": PAYMENT_MANAGER_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": PAYMENT_MANAGER_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "authorizerType": { - "target": PAYMENTS_AUTHORIZER_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "authorizerConfiguration": {"target": AUTHORIZER_CONFIGURATION}, - "roleArn": { - "target": ROLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "workloadIdentityDetails": {"target": WORKLOAD_IDENTITY_DETAILS}, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": PAYMENT_MANAGER_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "tags": {"target": TAGS_MAP}, - "kmsKeyArn": {"target": KMS_KEY_ARN}, - }, -) - -CREATE_PAYMENT_MANAGER = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreatePaymentManager"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 202, "method": "POST", "uri": "/payments/managers"} - ), - ) - ], -) - -DELETE_PAYMENT_MANAGER_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeletePaymentManagerInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeletePaymentManagerRequest", - ) - ], - members={ - "paymentManagerId": { - "target": PAYMENT_MANAGER_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#idempotencyToken")), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="clientToken"), - ], - }, - }, -) - -DELETE_PAYMENT_MANAGER_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeletePaymentManagerOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeletePaymentManagerResponse", - ) - ], - members={ - "status": { - "target": PAYMENT_MANAGER_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "paymentManagerId": {"target": PAYMENT_MANAGER_ID}, - }, -) - -DELETE_PAYMENT_MANAGER = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeletePaymentManager"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 202, - "method": "DELETE", - "uri": "/payments/managers/{paymentManagerId}", - } - ), - ) - ], -) - -GET_PAYMENT_MANAGER_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetPaymentManagerInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetPaymentManagerRequest", - ) - ], - members={ - "paymentManagerId": { - "target": PAYMENT_MANAGER_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -GET_PAYMENT_MANAGER_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetPaymentManagerOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetPaymentManagerResponse", - ) - ], - members={ - "paymentManagerArn": { - "target": PAYMENT_MANAGER_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "paymentManagerId": { - "target": PAYMENT_MANAGER_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": PAYMENT_MANAGER_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": PAYMENTS_DESCRIPTION}, - "authorizerType": { - "target": PAYMENTS_AUTHORIZER_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "authorizerConfiguration": {"target": AUTHORIZER_CONFIGURATION}, - "roleArn": { - "target": ROLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "workloadIdentityDetails": {"target": WORKLOAD_IDENTITY_DETAILS}, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastUpdatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": PAYMENT_MANAGER_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "tags": {"target": TAGS_MAP}, - "kmsKeyArn": {"target": KMS_KEY_ARN}, - }, -) - -GET_PAYMENT_MANAGER = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetPaymentManager"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/payments/managers/{paymentManagerId}", - } - ), - ) - ], -) - -LIST_PAYMENT_MANAGERS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListPaymentManagersInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListPaymentManagersRequest", - ) - ], - members={ - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - }, -) - -PAYMENT_MANAGER_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PaymentManagerSummary"), - members={ - "paymentManagerArn": { - "target": PAYMENT_MANAGER_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "paymentManagerId": { - "target": PAYMENT_MANAGER_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": PAYMENT_MANAGER_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": PAYMENTS_DESCRIPTION}, - "authorizerType": { - "target": PAYMENTS_AUTHORIZER_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "roleArn": { - "target": ROLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": PAYMENT_MANAGER_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": {"target": DATE_TIMESTAMP}, - "lastUpdatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "kmsKeyArn": {"target": KMS_KEY_ARN}, - }, -) - -PAYMENT_MANAGER_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PaymentManagerSummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": PAYMENT_MANAGER_SUMMARY}}, -) - -LIST_PAYMENT_MANAGERS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListPaymentManagersOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListPaymentManagersResponse", - ) - ], - members={ - "paymentManagers": { - "target": PAYMENT_MANAGER_SUMMARIES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": NEXT_TOKEN}, - }, -) - -LIST_PAYMENT_MANAGERS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListPaymentManagers"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "POST", "uri": "/payments/managers-list"} - ), - ) - ], -) - -PAYMENT_CREDENTIAL_PROVIDER_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PaymentCredentialProviderArn"), - shape_type=ShapeType.STRING, -) - -PAYMENT_CREDENTIAL_PROVIDER_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#PaymentCredentialProviderConfiguration" - ), - members={ - "credentialProviderArn": { - "target": PAYMENT_CREDENTIAL_PROVIDER_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -CREDENTIALS_PROVIDER_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#CredentialsProviderConfiguration" - ), - shape_type=ShapeType.UNION, - members={ - "coinbaseCDP": {"target": PAYMENT_CREDENTIAL_PROVIDER_CONFIGURATION}, - "stripePrivy": {"target": PAYMENT_CREDENTIAL_PROVIDER_CONFIGURATION}, - }, -) - -CREDENTIALS_PROVIDER_CONFIGURATIONS = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#CredentialsProviderConfigurations" - ), - shape_type=ShapeType.LIST, - members={"member": {"target": CREDENTIALS_PROVIDER_CONFIGURATION}}, -) - -PAYMENT_CONNECTOR_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PaymentConnectorName"), - shape_type=ShapeType.STRING, -) - -PAYMENT_CONNECTOR_PROVISION_MODE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PaymentConnectorProvisionMode"), - shape_type=ShapeType.ENUM, - members={"MANUAL": {"target": UNIT}, "QUICK_CREATE": {"target": UNIT}}, -) - -PAYMENT_CONNECTOR_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PaymentConnectorType"), - shape_type=ShapeType.ENUM, - members={"COINBASE_CDP": {"target": UNIT}, "STRIPE_PRIVY": {"target": UNIT}}, -) - -CREATE_PAYMENT_CONNECTOR_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreatePaymentConnectorInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreatePaymentConnectorRequest", - ) - ], - members={ - "paymentManagerId": { - "target": PAYMENT_MANAGER_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "name": { - "target": PAYMENT_CONNECTOR_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": PAYMENTS_DESCRIPTION}, - "type": { - "target": PAYMENT_CONNECTOR_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "credentialProviderConfigurations": { - "target": CREDENTIALS_PROVIDER_CONFIGURATIONS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "provisionMode": {"target": PAYMENT_CONNECTOR_PROVISION_MODE}, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - }, -) - -PAYMENT_CONNECTOR_AUTHORIZATION_URL = Schema( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#PaymentConnectorAuthorizationUrl" - ), - shape_type=ShapeType.STRING, -) - -PAYMENT_CONNECTOR_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PaymentConnectorId"), - shape_type=ShapeType.STRING, -) - -PAYMENT_CONNECTOR_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PaymentConnectorStatus"), - shape_type=ShapeType.ENUM, - members={ - "CREATING": {"target": UNIT}, - "UPDATING": {"target": UNIT}, - "DELETING": {"target": UNIT}, - "READY": {"target": UNIT}, - "CREATE_FAILED": {"target": UNIT}, - "UPDATE_FAILED": {"target": UNIT}, - "DELETE_FAILED": {"target": UNIT}, - "AWS_MARKETPLACE_SUBSCRIPTION_REQUIRED": {"target": UNIT}, - "PENDING_AUTHENTICATION": {"target": UNIT}, - "PROVISIONING": {"target": UNIT}, - "AUTHENTICATION_EXPIRED": {"target": UNIT}, - "AUTHENTICATION_FAILED": {"target": UNIT}, - }, -) - -CREATE_PAYMENT_CONNECTOR_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreatePaymentConnectorOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreatePaymentConnectorResponse", - ) - ], - members={ - "paymentConnectorId": { - "target": PAYMENT_CONNECTOR_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "paymentManagerId": { - "target": PAYMENT_MANAGER_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": PAYMENT_CONNECTOR_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "type": { - "target": PAYMENT_CONNECTOR_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "credentialProviderConfigurations": { - "target": CREDENTIALS_PROVIDER_CONFIGURATIONS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": PAYMENT_CONNECTOR_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "authorizationUrl": {"target": PAYMENT_CONNECTOR_AUTHORIZATION_URL}, - }, -) - -SUBSCRIPTION_REQUIRED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SubscriptionRequiredException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=403), - ], - members={ - "message": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "subscriptionUrl": {"target": _STRING}, - "productName": {"target": _STRING}, - }, -) - -CREATE_PAYMENT_CONNECTOR = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreatePaymentConnector"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 202, - "method": "POST", - "uri": "/payments/managers/{paymentManagerId}/connectors", - } - ), - ) - ], -) - -DELETE_PAYMENT_CONNECTOR_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeletePaymentConnectorInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeletePaymentConnectorRequest", - ) - ], - members={ - "paymentManagerId": { - "target": PAYMENT_MANAGER_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "paymentConnectorId": { - "target": PAYMENT_CONNECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#idempotencyToken")), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="clientToken"), - ], - }, - }, -) - -DELETE_PAYMENT_CONNECTOR_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeletePaymentConnectorOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeletePaymentConnectorResponse", - ) - ], - members={ - "status": { - "target": PAYMENT_CONNECTOR_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "paymentConnectorId": {"target": PAYMENT_CONNECTOR_ID}, - }, -) - -DELETE_PAYMENT_CONNECTOR = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeletePaymentConnector"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 202, - "method": "DELETE", - "uri": "/payments/managers/{paymentManagerId}/connectors/{paymentConnectorId}", - } - ), - ) - ], -) - -GET_PAYMENT_CONNECTOR_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetPaymentConnectorInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetPaymentConnectorRequest", - ) - ], - members={ - "paymentManagerId": { - "target": PAYMENT_MANAGER_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "paymentConnectorId": { - "target": PAYMENT_CONNECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -GET_PAYMENT_CONNECTOR_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetPaymentConnectorOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetPaymentConnectorResponse", - ) - ], - members={ - "paymentConnectorId": { - "target": PAYMENT_CONNECTOR_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": PAYMENT_CONNECTOR_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": PAYMENTS_DESCRIPTION}, - "type": { - "target": PAYMENT_CONNECTOR_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "provisionMode": {"target": PAYMENT_CONNECTOR_PROVISION_MODE}, - "credentialProviderConfigurations": { - "target": CREDENTIALS_PROVIDER_CONFIGURATIONS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastUpdatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": PAYMENT_CONNECTOR_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "authorizationUrl": {"target": PAYMENT_CONNECTOR_AUTHORIZATION_URL}, - "credentialsUpdatedAt": {"target": DATE_TIMESTAMP}, - }, -) - -GET_PAYMENT_CONNECTOR = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetPaymentConnector"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/payments/managers/{paymentManagerId}/connectors/{paymentConnectorId}", - } - ), - ) - ], -) - -LIST_PAYMENT_CONNECTORS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListPaymentConnectorsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListPaymentConnectorsRequest", - ) - ], - members={ - "paymentManagerId": { - "target": PAYMENT_MANAGER_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - }, -) - -PAYMENT_CONNECTOR_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PaymentConnectorSummary"), - members={ - "paymentConnectorId": { - "target": PAYMENT_CONNECTOR_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": PAYMENT_CONNECTOR_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "type": { - "target": PAYMENT_CONNECTOR_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "provisionMode": {"target": PAYMENT_CONNECTOR_PROVISION_MODE}, - "status": { - "target": PAYMENT_CONNECTOR_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastUpdatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -PAYMENT_CONNECTOR_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PaymentConnectorSummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": PAYMENT_CONNECTOR_SUMMARY}}, -) - -LIST_PAYMENT_CONNECTORS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListPaymentConnectorsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListPaymentConnectorsResponse", - ) - ], - members={ - "paymentConnectors": { - "target": PAYMENT_CONNECTOR_SUMMARIES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": NEXT_TOKEN}, - }, -) - -LIST_PAYMENT_CONNECTORS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListPaymentConnectors"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "POST", - "uri": "/payments/managers/{paymentManagerId}/connectors-list", - } - ), - ) - ], -) - -COINBASE_CDP_SECRET = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CoinbaseCdpSecret"), - shape_type=ShapeType.ENUM, - members={"API_KEY": {"target": UNIT}, "WALLET_SECRET": {"target": UNIT}}, -) - -COINBASE_CDP_SECRETS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CoinbaseCdpSecrets"), - shape_type=ShapeType.LIST, - members={"member": {"target": COINBASE_CDP_SECRET}}, -) - -COINBASE_CDP_ROTATION_TARGETS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CoinbaseCdpRotationTargets"), - members={ - "secrets": { - "target": COINBASE_CDP_SECRETS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -CREDENTIAL_ROTATION_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CredentialRotationConfig"), - shape_type=ShapeType.UNION, - members={"coinbaseCDP": {"target": COINBASE_CDP_ROTATION_TARGETS}}, -) - -ROTATE_PAYMENT_CONNECTOR_CREDENTIALS_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#RotatePaymentConnectorCredentialsInput" - ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#RotatePaymentConnectorCredentialsRequest", - ) - ], - members={ - "paymentManagerId": { - "target": PAYMENT_MANAGER_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "paymentConnectorId": { - "target": PAYMENT_CONNECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "credentialsToRotate": { - "target": CREDENTIAL_ROTATION_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - }, -) - -ROTATE_PAYMENT_CONNECTOR_CREDENTIALS_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#RotatePaymentConnectorCredentialsOutput" - ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#RotatePaymentConnectorCredentialsResponse", - ) - ], - members={ - "paymentConnectorId": { - "target": PAYMENT_CONNECTOR_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "paymentManagerId": { - "target": PAYMENT_MANAGER_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastUpdatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": PAYMENT_CONNECTOR_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -ROTATE_PAYMENT_CONNECTOR_CREDENTIALS = Schema( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#RotatePaymentConnectorCredentials" - ), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 202, - "method": "POST", - "uri": "/payments/managers/{paymentManagerId}/connectors/{paymentConnectorId}/rotate-credentials", - } - ), - ) - ], -) - -UPDATE_PAYMENT_CONNECTOR_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdatePaymentConnectorInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UpdatePaymentConnectorRequest", - ) - ], - members={ - "paymentManagerId": { - "target": PAYMENT_MANAGER_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "paymentConnectorId": { - "target": PAYMENT_CONNECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "description": {"target": PAYMENTS_DESCRIPTION}, - "type": {"target": PAYMENT_CONNECTOR_TYPE}, - "credentialProviderConfigurations": { - "target": CREDENTIALS_PROVIDER_CONFIGURATIONS - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - }, -) - -UPDATE_PAYMENT_CONNECTOR_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdatePaymentConnectorOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UpdatePaymentConnectorResponse", - ) - ], - members={ - "paymentConnectorId": { - "target": PAYMENT_CONNECTOR_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "paymentManagerId": { - "target": PAYMENT_MANAGER_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": PAYMENT_CONNECTOR_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "type": { - "target": PAYMENT_CONNECTOR_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "credentialProviderConfigurations": { - "target": CREDENTIALS_PROVIDER_CONFIGURATIONS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastUpdatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": PAYMENT_CONNECTOR_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "authorizationUrl": {"target": PAYMENT_CONNECTOR_AUTHORIZATION_URL}, - }, -) - -UPDATE_PAYMENT_CONNECTOR = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdatePaymentConnector"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 202, - "method": "PATCH", - "uri": "/payments/managers/{paymentManagerId}/connectors/{paymentConnectorId}", - } - ), - ) - ], -) - -UPDATE_PAYMENT_MANAGER_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdatePaymentManagerInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UpdatePaymentManagerRequest", - ) - ], - members={ - "paymentManagerId": { - "target": PAYMENT_MANAGER_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "description": {"target": PAYMENTS_DESCRIPTION}, - "authorizerType": {"target": PAYMENTS_AUTHORIZER_TYPE}, - "authorizerConfiguration": {"target": AUTHORIZER_CONFIGURATION}, - "roleArn": {"target": ROLE_ARN}, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "kmsKeyArn": {"target": KMS_KEY_ARN}, - }, -) - -UPDATE_PAYMENT_MANAGER_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdatePaymentManagerOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UpdatePaymentManagerResponse", - ) - ], - members={ - "paymentManagerArn": { - "target": PAYMENT_MANAGER_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "paymentManagerId": { - "target": PAYMENT_MANAGER_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": PAYMENT_MANAGER_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "authorizerType": { - "target": PAYMENTS_AUTHORIZER_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "roleArn": { - "target": ROLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "workloadIdentityDetails": {"target": WORKLOAD_IDENTITY_DETAILS}, - "lastUpdatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": PAYMENT_MANAGER_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "kmsKeyArn": {"target": KMS_KEY_ARN}, - }, -) - -UPDATE_PAYMENT_MANAGER = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdatePaymentManager"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 202, - "method": "PATCH", - "uri": "/payments/managers/{paymentManagerId}", - } - ), - ) - ], -) - -POLICY_ENGINE_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PolicyEngineName"), - shape_type=ShapeType.STRING, -) - -CREATE_POLICY_ENGINE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreatePolicyEngineInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreatePolicyEngineRequest", - ) - ], - members={ - "name": { - "target": POLICY_ENGINE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "encryptionKeyArn": {"target": KMS_KEY_ARN}, - "tags": {"target": TAGS_MAP}, - }, -) - -POLICY_ENGINE_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PolicyEngineArn"), - shape_type=ShapeType.STRING, -) - -RESOURCE_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceId"), - shape_type=ShapeType.STRING, -) - -POLICY_ENGINE_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PolicyEngineStatus"), - shape_type=ShapeType.ENUM, - members={ - "CREATING": {"target": UNIT}, - "ACTIVE": {"target": UNIT}, - "UPDATING": {"target": UNIT}, - "DELETING": {"target": UNIT}, - "CREATE_FAILED": {"target": UNIT}, - "UPDATE_FAILED": {"target": UNIT}, - "DELETE_FAILED": {"target": UNIT}, - }, -) - -STRING = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#String"), - shape_type=ShapeType.STRING, -) - -POLICY_STATUS_REASONS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PolicyStatusReasons"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, -) - -CREATE_POLICY_ENGINE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreatePolicyEngineOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreatePolicyEngineResponse", - ) - ], - members={ - "policyEngineId": { - "target": RESOURCE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": POLICY_ENGINE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "policyEngineArn": { - "target": POLICY_ENGINE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": POLICY_ENGINE_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "encryptionKeyArn": {"target": KMS_KEY_ARN}, - "description": {"target": DESCRIPTION}, - "statusReasons": { - "target": POLICY_STATUS_REASONS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -CREATE_POLICY_ENGINE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreatePolicyEngine"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/policy-engines", "code": 202} - ), - ) - ], -) - -DELETE_POLICY_ENGINE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeletePolicyEngineInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeletePolicyEngineRequest", - ) - ], - members={ - "policyEngineId": { - "target": RESOURCE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -DELETE_POLICY_ENGINE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeletePolicyEngineOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeletePolicyEngineResponse", - ) - ], - members={ - "policyEngineId": { - "target": RESOURCE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": POLICY_ENGINE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "policyEngineArn": { - "target": POLICY_ENGINE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": POLICY_ENGINE_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "encryptionKeyArn": {"target": KMS_KEY_ARN}, - "description": {"target": DESCRIPTION}, - "statusReasons": { - "target": POLICY_STATUS_REASONS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -DELETE_POLICY_ENGINE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeletePolicyEngine"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/policy-engines/{policyEngineId}", - "code": 202, - } - ), - ) - ], -) - -GET_POLICY_ENGINE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetPolicyEngineInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetPolicyEngineRequest", - ) - ], - members={ - "policyEngineId": { - "target": RESOURCE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -GET_POLICY_ENGINE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetPolicyEngineOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetPolicyEngineResponse", - ) - ], - members={ - "policyEngineId": { - "target": RESOURCE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": POLICY_ENGINE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "policyEngineArn": { - "target": POLICY_ENGINE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": POLICY_ENGINE_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "encryptionKeyArn": {"target": KMS_KEY_ARN}, - "description": {"target": DESCRIPTION}, - "statusReasons": { - "target": POLICY_STATUS_REASONS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -GET_POLICY_ENGINE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetPolicyEngine"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/policy-engines/{policyEngineId}", - "code": 200, - } - ), - ) - ], -) - -GET_POLICY_ENGINE_SUMMARY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetPolicyEngineSummaryInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetPolicyEngineSummaryRequest", - ) - ], - members={ - "policyEngineId": { - "target": RESOURCE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -GET_POLICY_ENGINE_SUMMARY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetPolicyEngineSummaryOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetPolicyEngineSummaryResponse", - ) - ], - members={ - "policyEngineId": { - "target": RESOURCE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": POLICY_ENGINE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "policyEngineArn": { - "target": POLICY_ENGINE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": POLICY_ENGINE_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "encryptionKeyArn": {"target": KMS_KEY_ARN}, - }, -) - -GET_POLICY_ENGINE_SUMMARY = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetPolicyEngineSummary"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/policy-engine-summaries/{policyEngineId}", - "code": 200, - } - ), - ) - ], -) - -LIST_POLICY_ENGINES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListPolicyEnginesInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListPolicyEnginesRequest", - ) - ], - members={ - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - }, -) - -POLICY_ENGINE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PolicyEngine"), - members={ - "policyEngineId": { - "target": RESOURCE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": POLICY_ENGINE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "policyEngineArn": { - "target": POLICY_ENGINE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": POLICY_ENGINE_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "encryptionKeyArn": {"target": KMS_KEY_ARN}, - "description": {"target": DESCRIPTION}, - "statusReasons": { - "target": POLICY_STATUS_REASONS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -POLICY_ENGINES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PolicyEngines"), - shape_type=ShapeType.LIST, - members={"member": {"target": POLICY_ENGINE}}, -) - -LIST_POLICY_ENGINES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListPolicyEnginesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListPolicyEnginesResponse", - ) - ], - members={ - "policyEngines": { - "target": POLICY_ENGINES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": NEXT_TOKEN}, - }, -) - -LIST_POLICY_ENGINES = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListPolicyEngines"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/policy-engines", "code": 200} - ), - ) - ], -) - -LIST_POLICY_ENGINE_SUMMARIES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListPolicyEngineSummariesInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListPolicyEngineSummariesRequest", - ) - ], - members={ - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - }, -) - -POLICY_ENGINE_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PolicyEngineSummary"), - members={ - "policyEngineId": { - "target": RESOURCE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": POLICY_ENGINE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "policyEngineArn": { - "target": POLICY_ENGINE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": POLICY_ENGINE_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "encryptionKeyArn": {"target": KMS_KEY_ARN}, - }, -) - -POLICY_ENGINE_SUMMARY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PolicyEngineSummaryList"), - shape_type=ShapeType.LIST, - members={"member": {"target": POLICY_ENGINE_SUMMARY}}, -) - -LIST_POLICY_ENGINE_SUMMARIES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListPolicyEngineSummariesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListPolicyEngineSummariesResponse", - ) - ], - members={ - "policyEngines": { - "target": POLICY_ENGINE_SUMMARY_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": NEXT_TOKEN}, - }, -) - -LIST_POLICY_ENGINE_SUMMARIES = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListPolicyEngineSummaries"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/policy-engine-summaries", "code": 200} - ), - ) - ], -) - -UPDATE_POLICY_ENGINE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdatePolicyEngineInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UpdatePolicyEngineRequest", - ) - ], - members={ - "policyEngineId": { - "target": RESOURCE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "description": {"target": UPDATED_DESCRIPTION}, - }, -) - -UPDATE_POLICY_ENGINE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdatePolicyEngineOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UpdatePolicyEngineResponse", - ) - ], - members={ - "policyEngineId": { - "target": RESOURCE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": POLICY_ENGINE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "policyEngineArn": { - "target": POLICY_ENGINE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": POLICY_ENGINE_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "encryptionKeyArn": {"target": KMS_KEY_ARN}, - "description": {"target": DESCRIPTION}, - "statusReasons": { - "target": POLICY_STATUS_REASONS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -UPDATE_POLICY_ENGINE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdatePolicyEngine"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PATCH", - "uri": "/policy-engines/{policyEngineId}", - "code": 202, - } - ), - ) - ], -) - -GET_POLICY_GENERATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetPolicyGenerationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetPolicyGenerationRequest", - ) - ], - members={ - "policyGenerationId": { - "target": RESOURCE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "policyEngineId": { - "target": RESOURCE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -POLICY_GENERATION_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PolicyGenerationName"), - shape_type=ShapeType.STRING, -) - -POLICY_GENERATION_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PolicyGenerationArn"), - shape_type=ShapeType.STRING, -) - -RESOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#Resource"), - shape_type=ShapeType.UNION, - members={"arn": {"target": BEDROCK_AGENTCORE_RESOURCE_ARN}}, -) - -POLICY_GENERATION_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PolicyGenerationStatus"), - shape_type=ShapeType.ENUM, - members={ - "GENERATING": {"target": UNIT}, - "GENERATED": {"target": UNIT}, - "GENERATE_FAILED": {"target": UNIT}, - "DELETE_FAILED": {"target": UNIT}, - }, -) - -GET_POLICY_GENERATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetPolicyGenerationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetPolicyGenerationResponse", - ) - ], - members={ - "policyEngineId": { - "target": RESOURCE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "policyGenerationId": { - "target": RESOURCE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": POLICY_GENERATION_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "policyGenerationArn": { - "target": POLICY_GENERATION_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "resource": { - "target": RESOURCE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": POLICY_GENERATION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "findings": {"target": STRING}, - "statusReasons": { - "target": POLICY_STATUS_REASONS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -GET_POLICY_GENERATION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetPolicyGeneration"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/policy-engines/{policyEngineId}/policy-generations/{policyGenerationId}", - } - ), - ) - ], -) - -GET_POLICY_GENERATION_SUMMARY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetPolicyGenerationSummaryInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetPolicyGenerationSummaryRequest", - ) - ], - members={ - "policyGenerationId": { - "target": RESOURCE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "policyEngineId": { - "target": RESOURCE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -GET_POLICY_GENERATION_SUMMARY_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#GetPolicyGenerationSummaryOutput" - ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetPolicyGenerationSummaryResponse", - ) - ], - members={ - "policyEngineId": { - "target": RESOURCE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "policyGenerationId": { - "target": RESOURCE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": POLICY_GENERATION_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "policyGenerationArn": { - "target": POLICY_GENERATION_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "resource": { - "target": RESOURCE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": POLICY_GENERATION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "findings": {"target": STRING}, - }, -) - -GET_POLICY_GENERATION_SUMMARY = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetPolicyGenerationSummary"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/policy-engines/{policyEngineId}/policy-generation-summaries/{policyGenerationId}", - "code": 200, - } - ), - ) - ], -) - -LIST_POLICY_GENERATION_ASSETS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListPolicyGenerationAssetsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListPolicyGenerationAssetsRequest", - ) - ], - members={ - "policyGenerationId": { - "target": RESOURCE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "policyEngineId": { - "target": RESOURCE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - }, -) - -STATEMENT = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#Statement"), - shape_type=ShapeType.STRING, -) - -CEDAR_POLICY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CedarPolicy"), - members={ - "statement": { - "target": STATEMENT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -POLICY_STATEMENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PolicyStatement"), - members={ - "statement": { - "target": STATEMENT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -POLICY_GENERATION_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PolicyGenerationDetails"), - members={ - "policyGenerationId": { - "target": RESOURCE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "policyGenerationAssetId": { - "target": RESOURCE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -POLICY_DEFINITION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PolicyDefinition"), - shape_type=ShapeType.UNION, - members={ - "cedar": {"target": CEDAR_POLICY}, - "policyGeneration": {"target": POLICY_GENERATION_DETAILS}, - "policy": {"target": POLICY_STATEMENT}, - }, -) - -FINDING_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#FindingType"), - shape_type=ShapeType.ENUM, - members={ - "VALID": {"target": UNIT}, - "INVALID": {"target": UNIT}, - "NOT_TRANSLATABLE": {"target": UNIT}, - "ALLOW_ALL": {"target": UNIT}, - "ALLOW_NONE": {"target": UNIT}, - "DENY_ALL": {"target": UNIT}, - "DENY_NONE": {"target": UNIT}, - }, -) - -FINDING = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#Finding"), - members={"type": {"target": FINDING_TYPE}, "description": {"target": STRING}}, -) - -FINDINGS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#Findings"), - shape_type=ShapeType.LIST, - members={"member": {"target": FINDING}}, -) - -NATURAL_LANGUAGE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#NaturalLanguage"), - shape_type=ShapeType.STRING, -) - -POLICY_GENERATION_ASSET = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PolicyGenerationAsset"), - members={ - "policyGenerationAssetId": { - "target": RESOURCE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "definition": {"target": POLICY_DEFINITION}, - "rawTextFragment": { - "target": NATURAL_LANGUAGE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "findings": { - "target": FINDINGS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -POLICY_GENERATION_ASSETS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PolicyGenerationAssets"), - shape_type=ShapeType.LIST, - members={"member": {"target": POLICY_GENERATION_ASSET}}, -) - -LIST_POLICY_GENERATION_ASSETS_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ListPolicyGenerationAssetsOutput" - ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListPolicyGenerationAssetsResponse", - ) - ], - members={ - "policyGenerationAssets": {"target": POLICY_GENERATION_ASSETS}, - "nextToken": {"target": NEXT_TOKEN}, - }, -) - -LIST_POLICY_GENERATION_ASSETS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListPolicyGenerationAssets"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/policy-engines/{policyEngineId}/policy-generations/{policyGenerationId}/assets", - } - ), - ) - ], -) - -LIST_POLICY_GENERATIONS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListPolicyGenerationsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListPolicyGenerationsRequest", - ) - ], - members={ - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "policyEngineId": { - "target": RESOURCE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -POLICY_GENERATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PolicyGeneration"), - members={ - "policyEngineId": { - "target": RESOURCE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "policyGenerationId": { - "target": RESOURCE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": POLICY_GENERATION_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "policyGenerationArn": { - "target": POLICY_GENERATION_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "resource": { - "target": RESOURCE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": POLICY_GENERATION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "findings": {"target": STRING}, - "statusReasons": { - "target": POLICY_STATUS_REASONS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -POLICY_GENERATIONS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PolicyGenerations"), - shape_type=ShapeType.LIST, - members={"member": {"target": POLICY_GENERATION}}, -) - -LIST_POLICY_GENERATIONS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListPolicyGenerationsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListPolicyGenerationsResponse", - ) - ], - members={ - "policyGenerations": { - "target": POLICY_GENERATIONS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": NEXT_TOKEN}, - }, -) - -LIST_POLICY_GENERATIONS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListPolicyGenerations"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/policy-engines/{policyEngineId}/policy-generations", - } - ), - ) - ], -) - -LIST_POLICY_GENERATION_SUMMARIES_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ListPolicyGenerationSummariesInput" - ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListPolicyGenerationSummariesRequest", - ) - ], - members={ - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "policyEngineId": { - "target": RESOURCE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -POLICY_GENERATION_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PolicyGenerationSummary"), - members={ - "policyEngineId": { - "target": RESOURCE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "policyGenerationId": { - "target": RESOURCE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": POLICY_GENERATION_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "policyGenerationArn": { - "target": POLICY_GENERATION_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "resource": { - "target": RESOURCE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": POLICY_GENERATION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "findings": {"target": STRING}, - }, -) - -POLICY_GENERATION_SUMMARY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PolicyGenerationSummaryList"), - shape_type=ShapeType.LIST, - members={"member": {"target": POLICY_GENERATION_SUMMARY}}, -) - -LIST_POLICY_GENERATION_SUMMARIES_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ListPolicyGenerationSummariesOutput" - ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListPolicyGenerationSummariesResponse", - ) - ], - members={ - "policyGenerations": { - "target": POLICY_GENERATION_SUMMARY_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": NEXT_TOKEN}, - }, -) - -LIST_POLICY_GENERATION_SUMMARIES = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListPolicyGenerationSummaries"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/policy-engines/{policyEngineId}/policy-generation-summaries", - "code": 200, - } - ), - ) - ], -) - -CONTENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#Content"), - shape_type=ShapeType.UNION, - members={"rawText": {"target": NATURAL_LANGUAGE}}, -) - -START_POLICY_GENERATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#StartPolicyGenerationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#StartPolicyGenerationRequest", - ) - ], - members={ - "policyEngineId": { - "target": RESOURCE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "resource": { - "target": RESOURCE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "content": { - "target": CONTENT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": POLICY_GENERATION_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - }, -) - -START_POLICY_GENERATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#StartPolicyGenerationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#StartPolicyGenerationResponse", - ) - ], - members={ - "policyEngineId": { - "target": RESOURCE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "policyGenerationId": { - "target": RESOURCE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": POLICY_GENERATION_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "policyGenerationArn": { - "target": POLICY_GENERATION_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "resource": { - "target": RESOURCE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": POLICY_GENERATION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "findings": {"target": STRING}, - "statusReasons": { - "target": POLICY_STATUS_REASONS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -START_POLICY_GENERATION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#StartPolicyGeneration"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/policy-engines/{policyEngineId}/policy-generations", - "code": 202, - } - ), - ) - ], -) - -ENFORCEMENT_MODE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#EnforcementMode"), - shape_type=ShapeType.ENUM, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value="ACTIVE")], - members={"ACTIVE": {"target": UNIT}, "LOG_ONLY": {"target": UNIT}}, -) - -POLICY_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PolicyName"), - shape_type=ShapeType.STRING, -) - -POLICY_VALIDATION_MODE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PolicyValidationMode"), - shape_type=ShapeType.ENUM, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value="FAIL_ON_ANY_FINDINGS")], - members={ - "FAIL_ON_ANY_FINDINGS": {"target": UNIT}, - "IGNORE_ALL_FINDINGS": {"target": UNIT}, - }, -) - -CREATE_POLICY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreatePolicyInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreatePolicyRequest", - ) - ], - members={ - "name": { - "target": POLICY_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "definition": { - "target": POLICY_DEFINITION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "validationMode": { - "target": POLICY_VALIDATION_MODE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#default"), value="FAIL_ON_ANY_FINDINGS" - ) - ], - }, - "enforcementMode": { - "target": ENFORCEMENT_MODE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="ACTIVE")], - }, - "policyEngineId": { - "target": RESOURCE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - }, -) - -POLICY_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PolicyArn"), - shape_type=ShapeType.STRING, -) - -POLICY_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PolicyStatus"), - shape_type=ShapeType.ENUM, - members={ - "CREATING": {"target": UNIT}, - "ACTIVE": {"target": UNIT}, - "UPDATING": {"target": UNIT}, - "DELETING": {"target": UNIT}, - "CREATE_FAILED": {"target": UNIT}, - "UPDATE_FAILED": {"target": UNIT}, - "DELETE_FAILED": {"target": UNIT}, - }, -) - -CREATE_POLICY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreatePolicyOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreatePolicyResponse", - ) - ], - members={ - "policyId": { - "target": RESOURCE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": POLICY_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "policyEngineId": { - "target": RESOURCE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "policyArn": { - "target": POLICY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": POLICY_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "enforcementMode": { - "target": ENFORCEMENT_MODE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="ACTIVE")], - }, - "definition": { - "target": POLICY_DEFINITION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "statusReasons": { - "target": POLICY_STATUS_REASONS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -CREATE_POLICY = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreatePolicy"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/policy-engines/{policyEngineId}/policies", - "code": 202, - } - ), - ) - ], -) - -DELETE_POLICY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeletePolicyInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeletePolicyRequest", - ) - ], - members={ - "policyEngineId": { - "target": RESOURCE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "policyId": { - "target": RESOURCE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -DELETE_POLICY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeletePolicyOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeletePolicyResponse", - ) - ], - members={ - "policyId": { - "target": RESOURCE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": POLICY_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "policyEngineId": { - "target": RESOURCE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "policyArn": { - "target": POLICY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": POLICY_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "enforcementMode": { - "target": ENFORCEMENT_MODE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="ACTIVE")], - }, - "definition": { - "target": POLICY_DEFINITION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "statusReasons": { - "target": POLICY_STATUS_REASONS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -DELETE_POLICY = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeletePolicy"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/policy-engines/{policyEngineId}/policies/{policyId}", - "code": 202, - } - ), - ) - ], -) - -GET_POLICY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetPolicyInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetPolicyRequest", - ) - ], - members={ - "policyEngineId": { - "target": RESOURCE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "policyId": { - "target": RESOURCE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -GET_POLICY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetPolicyOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetPolicyResponse", - ) - ], - members={ - "policyId": { - "target": RESOURCE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": POLICY_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "policyEngineId": { - "target": RESOURCE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "policyArn": { - "target": POLICY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": POLICY_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "enforcementMode": { - "target": ENFORCEMENT_MODE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="ACTIVE")], - }, - "definition": { - "target": POLICY_DEFINITION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "statusReasons": { - "target": POLICY_STATUS_REASONS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -GET_POLICY = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetPolicy"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/policy-engines/{policyEngineId}/policies/{policyId}", - "code": 200, - } - ), - ) - ], -) - -GET_POLICY_SUMMARY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetPolicySummaryInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetPolicySummaryRequest", - ) - ], - members={ - "policyEngineId": { - "target": RESOURCE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "policyId": { - "target": RESOURCE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -GET_POLICY_SUMMARY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetPolicySummaryOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetPolicySummaryResponse", - ) - ], - members={ - "policyId": { - "target": RESOURCE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": POLICY_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "policyEngineId": { - "target": RESOURCE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "policyArn": { - "target": POLICY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": POLICY_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "enforcementMode": { - "target": ENFORCEMENT_MODE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="ACTIVE")], - }, - }, -) - -GET_POLICY_SUMMARY = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetPolicySummary"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/policy-engines/{policyEngineId}/policy-summaries/{policyId}", - "code": 200, - } - ), - ) - ], -) - -LIST_POLICIES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListPoliciesInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListPoliciesRequest", - ) - ], - members={ - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "policyEngineId": { - "target": RESOURCE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "targetResourceScope": { - "target": BEDROCK_AGENTCORE_RESOURCE_ARN, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpQuery"), value="targetResourceScope" - ) - ], - }, - }, -) - -POLICY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#Policy"), - members={ - "policyId": { - "target": RESOURCE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": POLICY_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "policyEngineId": { - "target": RESOURCE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "policyArn": { - "target": POLICY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": POLICY_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "enforcementMode": { - "target": ENFORCEMENT_MODE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="ACTIVE")], - }, - "definition": { - "target": POLICY_DEFINITION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "statusReasons": { - "target": POLICY_STATUS_REASONS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -POLICIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#Policies"), - shape_type=ShapeType.LIST, - members={"member": {"target": POLICY}}, -) - -LIST_POLICIES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListPoliciesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListPoliciesResponse", - ) - ], - members={ - "policies": { - "target": POLICIES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": NEXT_TOKEN}, - }, -) - -LIST_POLICIES = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListPolicies"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/policy-engines/{policyEngineId}/policies", - "code": 200, - } - ), - ) - ], -) - -LIST_POLICY_SUMMARIES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListPolicySummariesInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListPolicySummariesRequest", - ) - ], - members={ - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "policyEngineId": { - "target": RESOURCE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "targetResourceScope": { - "target": BEDROCK_AGENTCORE_RESOURCE_ARN, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpQuery"), value="targetResourceScope" - ) - ], - }, - }, -) - -POLICY_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PolicySummary"), - members={ - "policyId": { - "target": RESOURCE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": POLICY_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "policyEngineId": { - "target": RESOURCE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "policyArn": { - "target": POLICY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": POLICY_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "enforcementMode": { - "target": ENFORCEMENT_MODE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="ACTIVE")], - }, - }, -) - -POLICY_SUMMARY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PolicySummaryList"), - shape_type=ShapeType.LIST, - members={"member": {"target": POLICY_SUMMARY}}, -) - -LIST_POLICY_SUMMARIES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListPolicySummariesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListPolicySummariesResponse", - ) - ], - members={ - "policies": { - "target": POLICY_SUMMARY_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": NEXT_TOKEN}, - }, -) - -LIST_POLICY_SUMMARIES = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListPolicySummaries"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/policy-engines/{policyEngineId}/policy-summaries", - "code": 200, - } - ), - ) - ], -) - -UPDATE_POLICY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdatePolicyInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UpdatePolicyRequest", - ) - ], - members={ - "policyEngineId": { - "target": RESOURCE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "policyId": { - "target": RESOURCE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "description": {"target": UPDATED_DESCRIPTION}, - "definition": {"target": POLICY_DEFINITION}, - "validationMode": { - "target": POLICY_VALIDATION_MODE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#default"), value="FAIL_ON_ANY_FINDINGS" - ) - ], - }, - "enforcementMode": { - "target": ENFORCEMENT_MODE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=None)], - }, - }, -) - -UPDATE_POLICY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdatePolicyOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UpdatePolicyResponse", - ) - ], - members={ - "policyId": { - "target": RESOURCE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": POLICY_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "policyEngineId": { - "target": RESOURCE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "policyArn": { - "target": POLICY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": POLICY_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "enforcementMode": { - "target": ENFORCEMENT_MODE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="ACTIVE")], - }, - "definition": { - "target": POLICY_DEFINITION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "statusReasons": { - "target": POLICY_STATUS_REASONS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -UPDATE_POLICY = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdatePolicy"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PATCH", - "uri": "/policy-engines/{policyEngineId}/policies/{policyId}", - "code": 202, - } - ), - ) - ], -) - -PUT_RESOURCE_POLICY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PutResourcePolicyInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#PutResourcePolicyRequest", - ) - ], - members={ - "resourceArn": { - "target": BEDROCK_AGENTCORE_RESOURCE_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "policy": { - "target": RESOURCE_POLICY_BODY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -PUT_RESOURCE_POLICY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PutResourcePolicyOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#PutResourcePolicyResponse", - ) - ], - members={ - "policy": { - "target": RESOURCE_POLICY_BODY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -PUT_RESOURCE_POLICY = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#PutResourcePolicy"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 201, "method": "PUT", "uri": "/resourcepolicy/{resourceArn}"} - ), - ) - ], -) - -CUSTOM_DESCRIPTOR = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CustomDescriptor"), - members={"inlineContent": {"target": INLINE_CONTENT}}, -) - -SERVER_DEFINITION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ServerDefinition"), - members={ - "schemaVersion": {"target": SCHEMA_VERSION}, - "inlineContent": {"target": INLINE_CONTENT}, - }, -) - -TOOLS_DEFINITION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ToolsDefinition"), - members={ - "protocolVersion": {"target": SCHEMA_VERSION}, - "inlineContent": {"target": INLINE_CONTENT}, - }, -) - -MCP_DESCRIPTOR = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#McpDescriptor"), - members={ - "server": {"target": SERVER_DEFINITION}, - "tools": {"target": TOOLS_DEFINITION}, - }, -) - -DESCRIPTORS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#Descriptors"), - members={ - "mcp": {"target": MCP_DESCRIPTOR}, - "a2a": {"target": A2A_DESCRIPTOR}, - "custom": {"target": CUSTOM_DESCRIPTOR}, - "agentSkills": {"target": AGENT_SKILLS_DESCRIPTOR}, - }, -) - -DESCRIPTOR_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DescriptorType"), - shape_type=ShapeType.ENUM, - members={ - "MCP": {"target": UNIT}, - "A2A": {"target": UNIT}, - "CUSTOM": {"target": UNIT}, - "AGENT_SKILLS": {"target": UNIT}, - }, -) - -REGISTRY_RECORD_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#RegistryRecordName"), - shape_type=ShapeType.STRING, -) - -REGISTRY_RECORD_VERSION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#RegistryRecordVersion"), - shape_type=ShapeType.STRING, -) - -REGISTRY_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#RegistryIdentifier"), - shape_type=ShapeType.STRING, -) - -IAM_SIGNING_REGION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#IamSigningRegion"), - shape_type=ShapeType.STRING, -) - -IAM_ROLE_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#IamRoleArn"), - shape_type=ShapeType.STRING, -) - -IAM_SIGNING_SERVICE_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#IamSigningServiceName"), - shape_type=ShapeType.STRING, -) - -REGISTRY_RECORD_IAM_CREDENTIAL_PROVIDER = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#RegistryRecordIamCredentialProvider" - ), - members={ - "roleArn": {"target": IAM_ROLE_ARN}, - "service": {"target": IAM_SIGNING_SERVICE_NAME}, - "region": {"target": IAM_SIGNING_REGION}, - }, -) - -CUSTOM_PARAMETER_MAP = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CustomParameterMap"), - shape_type=ShapeType.MAP, - members={"key": {"target": _STRING}, "value": {"target": _STRING}}, -) - -REGISTRY_RECORD_O_AUTH_GRANT_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#RegistryRecordOAuthGrantType"), - shape_type=ShapeType.ENUM, - members={"CLIENT_CREDENTIALS": {"target": UNIT}}, -) - -CREDENTIAL_PROVIDER_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CredentialProviderArn"), - shape_type=ShapeType.STRING, -) - -SCOPE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ScopeList"), - shape_type=ShapeType.LIST, - members={"member": {"target": _STRING}}, -) - -REGISTRY_RECORD_O_AUTH_CREDENTIAL_PROVIDER = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#RegistryRecordOAuthCredentialProvider" - ), - members={ - "providerArn": { - "target": CREDENTIAL_PROVIDER_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "grantType": {"target": REGISTRY_RECORD_O_AUTH_GRANT_TYPE}, - "scopes": {"target": SCOPE_LIST}, - "customParameters": {"target": CUSTOM_PARAMETER_MAP}, - }, -) - -REGISTRY_RECORD_CREDENTIAL_PROVIDER_UNION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#RegistryRecordCredentialProviderUnion" - ), - shape_type=ShapeType.UNION, - members={ - "oauthCredentialProvider": { - "target": REGISTRY_RECORD_O_AUTH_CREDENTIAL_PROVIDER - }, - "iamCredentialProvider": {"target": REGISTRY_RECORD_IAM_CREDENTIAL_PROVIDER}, - }, -) - -REGISTRY_RECORD_CREDENTIAL_PROVIDER_TYPE = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#RegistryRecordCredentialProviderType" - ), - shape_type=ShapeType.ENUM, - members={"OAUTH": {"target": UNIT}, "IAM": {"target": UNIT}}, -) - -REGISTRY_RECORD_CREDENTIAL_PROVIDER_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#RegistryRecordCredentialProviderConfiguration" - ), - members={ - "credentialProviderType": { - "target": REGISTRY_RECORD_CREDENTIAL_PROVIDER_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "credentialProvider": { - "target": REGISTRY_RECORD_CREDENTIAL_PROVIDER_UNION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -REGISTRY_RECORD_CREDENTIAL_PROVIDER_CONFIGURATION_LIST = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#RegistryRecordCredentialProviderConfigurationList" - ), - shape_type=ShapeType.LIST, - members={"member": {"target": REGISTRY_RECORD_CREDENTIAL_PROVIDER_CONFIGURATION}}, -) - -MCP_SERVER_URL = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#McpServerUrl"), - shape_type=ShapeType.STRING, -) - -FROM_URL_SYNCHRONIZATION_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#FromUrlSynchronizationConfiguration" - ), - members={ - "url": { - "target": MCP_SERVER_URL, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "credentialProviderConfigurations": { - "target": REGISTRY_RECORD_CREDENTIAL_PROVIDER_CONFIGURATION_LIST - }, - }, -) - -SYNCHRONIZATION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SynchronizationConfiguration"), - members={"fromUrl": {"target": FROM_URL_SYNCHRONIZATION_CONFIGURATION}}, -) - -SYNCHRONIZATION_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SynchronizationType"), - shape_type=ShapeType.ENUM, - members={"URL": {"target": UNIT}}, -) - -CREATE_REGISTRY_RECORD_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateRegistryRecordInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreateRegistryRecordRequest", - ) - ], - members={ - "registryId": { - "target": REGISTRY_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "name": { - "target": REGISTRY_RECORD_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "descriptorType": { - "target": DESCRIPTOR_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "descriptors": {"target": DESCRIPTORS}, - "recordVersion": {"target": REGISTRY_RECORD_VERSION}, - "synchronizationType": {"target": SYNCHRONIZATION_TYPE}, - "synchronizationConfiguration": {"target": SYNCHRONIZATION_CONFIGURATION}, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - }, -) - -REGISTRY_RECORD_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#RegistryRecordArn"), - shape_type=ShapeType.STRING, -) - -REGISTRY_RECORD_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#RegistryRecordStatus"), - shape_type=ShapeType.ENUM, - members={ - "DRAFT": {"target": UNIT}, - "PENDING_APPROVAL": {"target": UNIT}, - "APPROVED": {"target": UNIT}, - "REJECTED": {"target": UNIT}, - "DEPRECATED": {"target": UNIT}, - "CREATING": {"target": UNIT}, - "UPDATING": {"target": UNIT}, - "CREATE_FAILED": {"target": UNIT}, - "UPDATE_FAILED": {"target": UNIT}, - }, -) - -CREATE_REGISTRY_RECORD_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateRegistryRecordOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreateRegistryRecordResponse", - ) - ], - members={ - "recordArn": { - "target": REGISTRY_RECORD_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": REGISTRY_RECORD_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -CREATE_REGISTRY_RECORD = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateRegistryRecord"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/registries/{registryId}/records", - "code": 202, - } - ), - ) - ], -) - -RECORD_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#RecordIdentifier"), - shape_type=ShapeType.STRING, -) - -DELETE_REGISTRY_RECORD_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteRegistryRecordInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeleteRegistryRecordRequest", - ) - ], - members={ - "registryId": { - "target": REGISTRY_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "recordId": { - "target": RECORD_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -DELETE_REGISTRY_RECORD_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteRegistryRecordOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeleteRegistryRecordResponse", - ) - ], -) - -DELETE_REGISTRY_RECORD = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteRegistryRecord"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/registries/{registryId}/records/{recordId}", - "code": 200, - } - ), - ) - ], -) - -GET_REGISTRY_RECORD_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetRegistryRecordInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetRegistryRecordRequest", - ) - ], - members={ - "registryId": { - "target": REGISTRY_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "recordId": { - "target": RECORD_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -REGISTRY_RECORD_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#RegistryRecordId"), - shape_type=ShapeType.STRING, -) - -REGISTRY_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#RegistryArn"), - shape_type=ShapeType.STRING, -) - -GET_REGISTRY_RECORD_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetRegistryRecordOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetRegistryRecordResponse", - ) - ], - members={ - "registryArn": { - "target": REGISTRY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "recordArn": { - "target": REGISTRY_RECORD_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "recordId": { - "target": REGISTRY_RECORD_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": REGISTRY_RECORD_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "descriptorType": { - "target": DESCRIPTOR_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "descriptors": { - "target": DESCRIPTORS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "recordVersion": {"target": REGISTRY_RECORD_VERSION}, - "status": { - "target": REGISTRY_RECORD_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "statusReason": {"target": _STRING}, - "synchronizationType": {"target": SYNCHRONIZATION_TYPE}, - "synchronizationConfiguration": {"target": SYNCHRONIZATION_CONFIGURATION}, - }, -) - -GET_REGISTRY_RECORD = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetRegistryRecord"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/registries/{registryId}/records/{recordId}", - "code": 200, - } - ), - ) - ], -) - -LIST_REGISTRY_RECORDS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListRegistryRecordsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListRegistryRecordsRequest", - ) - ], - members={ - "registryId": { - "target": REGISTRY_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "name": { - "target": REGISTRY_RECORD_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="name")], - }, - "status": { - "target": REGISTRY_RECORD_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="status")], - }, - "descriptorType": { - "target": DESCRIPTOR_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="descriptorType") - ], - }, - }, -) - -REGISTRY_RECORD_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#RegistryRecordSummary"), - members={ - "registryArn": { - "target": REGISTRY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "recordArn": { - "target": REGISTRY_RECORD_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "recordId": { - "target": REGISTRY_RECORD_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": REGISTRY_RECORD_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "descriptorType": { - "target": DESCRIPTOR_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "recordVersion": { - "target": REGISTRY_RECORD_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": REGISTRY_RECORD_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -REGISTRY_RECORD_SUMMARY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#RegistryRecordSummaryList"), - shape_type=ShapeType.LIST, - members={"member": {"target": REGISTRY_RECORD_SUMMARY}}, -) - -LIST_REGISTRY_RECORDS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListRegistryRecordsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListRegistryRecordsResponse", - ) - ], - members={ - "registryRecords": { - "target": REGISTRY_RECORD_SUMMARY_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": NEXT_TOKEN}, - }, -) - -LIST_REGISTRY_RECORDS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListRegistryRecords"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/registries/{registryId}/records", - "code": 200, - } - ), - ) - ], -) - -SUBMIT_REGISTRY_RECORD_FOR_APPROVAL_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#SubmitRegistryRecordForApprovalInput" - ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#SubmitRegistryRecordForApprovalRequest", - ) - ], - members={ - "registryId": { - "target": REGISTRY_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "recordId": { - "target": RECORD_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -SUBMIT_REGISTRY_RECORD_FOR_APPROVAL_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#SubmitRegistryRecordForApprovalOutput" - ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#SubmitRegistryRecordForApprovalResponse", - ) - ], - members={ - "registryArn": { - "target": REGISTRY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "recordArn": { - "target": REGISTRY_RECORD_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "recordId": { - "target": REGISTRY_RECORD_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": REGISTRY_RECORD_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -SUBMIT_REGISTRY_RECORD_FOR_APPROVAL = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SubmitRegistryRecordForApproval"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/registries/{registryId}/records/{recordId}/submit-for-approval", - "code": 202, - } - ), - ) - ], -) - -UPDATED_A2A_DESCRIPTOR = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdatedA2aDescriptor"), - members={"optionalValue": {"target": A2A_DESCRIPTOR}}, -) - -UPDATED_SKILL_DEFINITION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdatedSkillDefinition"), - members={"optionalValue": {"target": SKILL_DEFINITION}}, -) - -UPDATED_SKILL_MD_DEFINITION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdatedSkillMdDefinition"), - members={"optionalValue": {"target": SKILL_MD_DEFINITION}}, -) - -UPDATED_AGENT_SKILLS_DESCRIPTOR_FIELDS = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#UpdatedAgentSkillsDescriptorFields" +UPDATE_REGISTRY_RECORD_OUTPUT: StaticSchema = ( + 18, + n0, + _URRO, + {_sSI: _cURRRo, _smith: None}, + (_rAeg, _rAec, _rIec, _n, _d, _dT, _des, _rVe, _st, _cA, _uA, _sRt, _sTy, _sCy), + ( + (REGISTRY_ARN, 1), + (REGISTRY_RECORD_ARN, 1), + (REGISTRY_RECORD_ID, 1), + (REGISTRY_RECORD_NAME, 1), + (DESCRIPTION, 0), + (DESCRIPTOR_TYPE, 1), + (DESCRIPTORS, 1), + (REGISTRY_RECORD_VERSION, 0), + (REGISTRY_RECORD_STATUS, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (3, 0), + (SYNCHRONIZATION_TYPE, 0), + (SYNCHRONIZATION_CONFIGURATION, 0), ), - members={ - "skillMd": {"target": UPDATED_SKILL_MD_DEFINITION}, - "skillDefinition": {"target": UPDATED_SKILL_DEFINITION}, - }, -) - -UPDATED_AGENT_SKILLS_DESCRIPTOR = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdatedAgentSkillsDescriptor"), - members={"optionalValue": {"target": UPDATED_AGENT_SKILLS_DESCRIPTOR_FIELDS}}, -) - -UPDATED_CUSTOM_DESCRIPTOR = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdatedCustomDescriptor"), - members={"optionalValue": {"target": CUSTOM_DESCRIPTOR}}, -) - -UPDATED_SERVER_DEFINITION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdatedServerDefinition"), - members={"optionalValue": {"target": SERVER_DEFINITION}}, -) - -UPDATED_TOOLS_DEFINITION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdatedToolsDefinition"), - members={"optionalValue": {"target": TOOLS_DEFINITION}}, -) - -UPDATED_MCP_DESCRIPTOR_FIELDS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdatedMcpDescriptorFields"), - members={ - "server": {"target": UPDATED_SERVER_DEFINITION}, - "tools": {"target": UPDATED_TOOLS_DEFINITION}, - }, -) - -UPDATED_MCP_DESCRIPTOR = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdatedMcpDescriptor"), - members={"optionalValue": {"target": UPDATED_MCP_DESCRIPTOR_FIELDS}}, ) -UPDATED_DESCRIPTORS_UNION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdatedDescriptorsUnion"), - members={ - "mcp": {"target": UPDATED_MCP_DESCRIPTOR}, - "a2a": {"target": UPDATED_A2A_DESCRIPTOR}, - "custom": {"target": UPDATED_CUSTOM_DESCRIPTOR}, - "agentSkills": {"target": UPDATED_AGENT_SKILLS_DESCRIPTOR}, - }, -) - -UPDATED_DESCRIPTORS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdatedDescriptors"), - members={"optionalValue": {"target": UPDATED_DESCRIPTORS_UNION}}, -) - -UPDATED_SYNCHRONIZATION_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#UpdatedSynchronizationConfiguration" +UPDATE_REGISTRY_RECORD: StaticOperationSchema = ( + 23, + n0, + _URR, + { + _smithy: MappingProxyType( + { + "method": "PATCH", + "uri": "/registries/{registryId}/records/{recordId}", + "code": 202, + } + ) + }, + UPDATE_REGISTRY_RECORD_INPUT, + UPDATE_REGISTRY_RECORD_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, ), - members={"optionalValue": {"target": SYNCHRONIZATION_CONFIGURATION}}, -) - -UPDATED_SYNCHRONIZATION_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdatedSynchronizationType"), - members={"optionalValue": {"target": SYNCHRONIZATION_TYPE}}, -) - -UPDATE_REGISTRY_RECORD_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateRegistryRecordInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UpdateRegistryRecordRequest", - ) - ], - members={ - "registryId": { - "target": REGISTRY_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "recordId": { - "target": RECORD_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "name": {"target": REGISTRY_RECORD_NAME}, - "description": {"target": UPDATED_DESCRIPTION}, - "descriptorType": {"target": DESCRIPTOR_TYPE}, - "descriptors": {"target": UPDATED_DESCRIPTORS}, - "recordVersion": {"target": REGISTRY_RECORD_VERSION}, - "synchronizationType": {"target": UPDATED_SYNCHRONIZATION_TYPE}, - "synchronizationConfiguration": { - "target": UPDATED_SYNCHRONIZATION_CONFIGURATION - }, - "triggerSynchronization": {"target": BOOLEAN}, - }, -) - -UPDATE_REGISTRY_RECORD_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateRegistryRecordOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UpdateRegistryRecordResponse", - ) - ], - members={ - "registryArn": { - "target": REGISTRY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "recordArn": { - "target": REGISTRY_RECORD_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "recordId": { - "target": REGISTRY_RECORD_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": REGISTRY_RECORD_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "descriptorType": { - "target": DESCRIPTOR_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "descriptors": { - "target": DESCRIPTORS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "recordVersion": {"target": REGISTRY_RECORD_VERSION}, - "status": { - "target": REGISTRY_RECORD_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "statusReason": {"target": _STRING}, - "synchronizationType": {"target": SYNCHRONIZATION_TYPE}, - "synchronizationConfiguration": {"target": SYNCHRONIZATION_CONFIGURATION}, - }, -) - -UPDATE_REGISTRY_RECORD = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateRegistryRecord"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PATCH", - "uri": "/registries/{registryId}/records/{recordId}", - "code": 202, - } - ), - ) - ], -) - -UPDATE_REGISTRY_RECORD_STATUS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateRegistryRecordStatusInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UpdateRegistryRecordStatusRequest", - ) - ], - members={ - "registryId": { - "target": REGISTRY_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "recordId": { - "target": RECORD_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "status": { - "target": REGISTRY_RECORD_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "statusReason": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, ) -UPDATE_REGISTRY_RECORD_STATUS_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcorecontrol#UpdateRegistryRecordStatusOutput" +UPDATE_REGISTRY_RECORD_STATUS_INPUT: StaticSchema = ( + 18, + n0, + _URRSI, + {_sSI: _cURRSR, _smit: None}, + (_rIe, _rIec, _st, _sRt), + ( + (REGISTRY_IDENTIFIER, 9), + (RECORD_IDENTIFIER, 9), + (REGISTRY_RECORD_STATUS, 1), + (3, 1), ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UpdateRegistryRecordStatusResponse", - ) - ], - members={ - "registryArn": { - "target": REGISTRY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "recordArn": { - "target": REGISTRY_RECORD_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "recordId": { - "target": REGISTRY_RECORD_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": REGISTRY_RECORD_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "statusReason": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -UPDATE_REGISTRY_RECORD_STATUS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateRegistryRecordStatus"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PATCH", - "uri": "/registries/{registryId}/records/{recordId}/status", - "code": 202, - } - ), - ) - ], -) - -APPROVAL_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ApprovalConfiguration"), - members={ - "autoApproval": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - } - }, -) - -REGISTRY_AUTHORIZER_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#RegistryAuthorizerType"), - shape_type=ShapeType.ENUM, - members={"CUSTOM_JWT": {"target": UNIT}, "AWS_IAM": {"target": UNIT}}, -) - -REGISTRY_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#RegistryName"), - shape_type=ShapeType.STRING, -) - -CREATE_REGISTRY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateRegistryInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreateRegistryRequest", - ) - ], - members={ - "name": { - "target": REGISTRY_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "authorizerType": {"target": REGISTRY_AUTHORIZER_TYPE}, - "authorizerConfiguration": {"target": AUTHORIZER_CONFIGURATION}, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "approvalConfiguration": {"target": APPROVAL_CONFIGURATION}, - }, -) - -CREATE_REGISTRY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateRegistryOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreateRegistryResponse", - ) - ], - members={ - "registryArn": { - "target": REGISTRY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -CREATE_REGISTRY = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateRegistry"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 202, "method": "POST", "uri": "/registries"} - ), - ) - ], -) - -DELETE_REGISTRY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteRegistryInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeleteRegistryRequest", - ) - ], - members={ - "registryId": { - "target": REGISTRY_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -REGISTRY_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#RegistryStatus"), - shape_type=ShapeType.ENUM, - members={ - "CREATING": {"target": UNIT}, - "READY": {"target": UNIT}, - "UPDATING": {"target": UNIT}, - "CREATE_FAILED": {"target": UNIT}, - "UPDATE_FAILED": {"target": UNIT}, - "DELETING": {"target": UNIT}, - "DELETE_FAILED": {"target": UNIT}, - }, -) - -DELETE_REGISTRY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteRegistryOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeleteRegistryResponse", - ) - ], - members={ - "status": { - "target": REGISTRY_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -DELETE_REGISTRY = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteRegistry"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 202, "method": "DELETE", "uri": "/registries/{registryId}"} - ), - ) - ], -) - -GET_REGISTRY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetRegistryInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetRegistryRequest", - ) - ], - members={ - "registryId": { - "target": REGISTRY_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -REGISTRY_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#RegistryId"), - shape_type=ShapeType.STRING, -) - -GET_REGISTRY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetRegistryOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetRegistryResponse", - ) - ], - members={ - "name": { - "target": REGISTRY_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "registryId": { - "target": REGISTRY_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "registryArn": { - "target": REGISTRY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "authorizerType": {"target": REGISTRY_AUTHORIZER_TYPE}, - "authorizerConfiguration": {"target": AUTHORIZER_CONFIGURATION}, - "approvalConfiguration": {"target": APPROVAL_CONFIGURATION}, - "status": { - "target": REGISTRY_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "statusReason": {"target": _STRING}, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -GET_REGISTRY = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetRegistry"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "GET", "uri": "/registries/{registryId}"} - ), - ) - ], -) - -LIST_REGISTRIES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListRegistriesInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListRegistriesRequest", - ) - ], - members={ - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "status": { - "target": REGISTRY_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="status")], - }, - "authorizerType": { - "target": REGISTRY_AUTHORIZER_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="authorizerType") - ], - }, - }, -) - -REGISTRY_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#RegistrySummary"), - members={ - "name": { - "target": REGISTRY_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "registryId": { - "target": REGISTRY_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "registryArn": { - "target": REGISTRY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "authorizerType": {"target": REGISTRY_AUTHORIZER_TYPE}, - "status": { - "target": REGISTRY_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "statusReason": {"target": _STRING}, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -REGISTRY_SUMMARY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#RegistrySummaryList"), - shape_type=ShapeType.LIST, - members={"member": {"target": REGISTRY_SUMMARY}}, -) - -LIST_REGISTRIES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListRegistriesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListRegistriesResponse", - ) - ], - members={ - "registries": { - "target": REGISTRY_SUMMARY_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": NEXT_TOKEN}, - }, -) - -LIST_REGISTRIES = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListRegistries"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "GET", "uri": "/registries"} - ), - ) - ], ) -UPDATED_APPROVAL_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdatedApprovalConfiguration"), - members={"optionalValue": {"target": APPROVAL_CONFIGURATION}}, +UPDATE_REGISTRY_RECORD_STATUS_OUTPUT: StaticSchema = ( + 18, + n0, + _URRSO, + {_sSI: _cURRSRo, _smith: None}, + (_rAeg, _rAec, _rIec, _st, _sRt, _uA), + ( + (REGISTRY_ARN, 1), + (REGISTRY_RECORD_ARN, 1), + (REGISTRY_RECORD_ID, 1), + (REGISTRY_RECORD_STATUS, 1), + (3, 1), + (DATE_TIMESTAMP, 1), + ), ) -UPDATE_REGISTRY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateRegistryInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UpdateRegistryRequest", - ) - ], - members={ - "registryId": { - "target": REGISTRY_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "name": {"target": REGISTRY_NAME}, - "description": {"target": UPDATED_DESCRIPTION}, - "authorizerConfiguration": {"target": UPDATED_AUTHORIZER_CONFIGURATION}, - "approvalConfiguration": {"target": UPDATED_APPROVAL_CONFIGURATION}, - }, +UPDATE_REGISTRY_RECORD_STATUS: StaticOperationSchema = ( + 23, + n0, + _URRS, + { + _smithy: MappingProxyType( + { + "method": "PATCH", + "uri": "/registries/{registryId}/records/{recordId}/status", + "code": 202, + } + ) + }, + UPDATE_REGISTRY_RECORD_STATUS_INPUT, + UPDATE_REGISTRY_RECORD_STATUS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -UPDATE_REGISTRY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateRegistryOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UpdateRegistryResponse", - ) - ], - members={ - "name": { - "target": REGISTRY_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "registryId": { - "target": REGISTRY_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "registryArn": { - "target": REGISTRY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "authorizerType": {"target": REGISTRY_AUTHORIZER_TYPE}, - "authorizerConfiguration": {"target": AUTHORIZER_CONFIGURATION}, - "approvalConfiguration": {"target": APPROVAL_CONFIGURATION}, - "status": { - "target": REGISTRY_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "statusReason": {"target": _STRING}, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +APPROVAL_CONFIGURATION: StaticSchema = ( + 18, + n0, + _ACp, + 0, + (_aAu,), + ((2, {_smithya: False}),), +) + +REGISTRY_AUTHORIZER_TYPE: StaticSchema = ( + 14, + n0, + _RAT, + 0, + (_CJ, _AI), + ((-1, {_sVm: _CJ}), (-1, {_sVm: _AI})), +) + +REGISTRY_NAME: StaticSchema = (3, n0, _RN, 0) + +CREATE_REGISTRY_INPUT: StaticSchema = ( + 18, + n0, + _CRIr, + {_sSI: _cCRR, _smit: None}, + (_n, _d, _aT, _aCu, _cT, _aCp), + ( + (REGISTRY_NAME, 1), + (DESCRIPTION, 0), + (REGISTRY_AUTHORIZER_TYPE, 0), + (AUTHORIZER_CONFIGURATION, 0), + (CLIENT_TOKEN, 2), + (APPROVAL_CONFIGURATION, 0), + ), ) -UPDATE_REGISTRY = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateRegistry"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 202, "method": "PATCH", "uri": "/registries/{registryId}"} - ), - ) - ], -) - -CONCURRENT_MODIFICATION_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ConcurrentModificationException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=409), - ], - members={ - "message": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +CREATE_REGISTRY_OUTPUT: StaticSchema = ( + 18, + n0, + _CROr, + {_sSI: _cCRRo, _smith: None}, + (_rAeg,), + ((REGISTRY_ARN, 1),), +) + +CREATE_REGISTRY: StaticOperationSchema = ( + 23, + n0, + _CR, + {_smithy: MappingProxyType({"code": 202, "method": "POST", "uri": "/registries"})}, + CREATE_REGISTRY_INPUT, + CREATE_REGISTRY_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -SET_TOKEN_VAULT_CMK_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SetTokenVaultCMKInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#SetTokenVaultCMKRequest", - ) - ], - members={ - "tokenVaultId": {"target": TOKEN_VAULT_ID_TYPE}, - "kmsConfiguration": { - "target": KMS_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +DELETE_REGISTRY_INPUT: StaticSchema = ( + 18, + n0, + _DRI, + {_sSI: _cDRR, _smit: None}, + (_rIe,), + ((REGISTRY_IDENTIFIER, 9),), +) + +REGISTRY_STATUS: StaticSchema = ( + 14, + n0, + _RSe, + 0, + (_CREATING, _READY, _UPDATING, _CF, _UF, _DELETING, _DF), + ( + (-1, {_sVm: _CREATING}), + (-1, {_sVm: _READY}), + (-1, {_sVm: _UPDATING}), + (-1, {_sVm: _CF}), + (-1, {_sVm: _UF}), + (-1, {_sVm: _DELETING}), + (-1, {_sVm: _DF}), + ), ) -SET_TOKEN_VAULT_CMK_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SetTokenVaultCMKOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#SetTokenVaultCMKResponse", - ) - ], - members={ - "tokenVaultId": { - "target": TOKEN_VAULT_ID_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "kmsConfiguration": { - "target": KMS_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastModifiedDate": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +DELETE_REGISTRY_OUTPUT: StaticSchema = ( + 18, + n0, + _DRO, + {_sSI: _cDRRo, _smith: None}, + (_st,), + ((REGISTRY_STATUS, 1),), +) + +DELETE_REGISTRY: StaticOperationSchema = ( + 23, + n0, + _DR, + { + _smithy: MappingProxyType( + {"code": 202, "method": "DELETE", "uri": "/registries/{registryId}"} + ) + }, + DELETE_REGISTRY_INPUT, + DELETE_REGISTRY_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -SET_TOKEN_VAULT_CMK = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SetTokenVaultCMK"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"uri": "/identities/set-token-vault-cmk", "method": "POST"} - ), - ) - ], +GET_REGISTRY_INPUT: StaticSchema = ( + 18, + n0, + _GRIe, + {_sSI: _cGRR, _smit: None}, + (_rIe,), + ((REGISTRY_IDENTIFIER, 9),), +) + +REGISTRY_ID: StaticSchema = (3, n0, _RIeg, 0) + +GET_REGISTRY_OUTPUT: StaticSchema = ( + 18, + n0, + _GRO, + {_sSI: _cGRRo, _smith: None}, + (_n, _d, _rIe, _rAeg, _aT, _aCu, _aCp, _st, _sRt, _cA, _uA), + ( + (REGISTRY_NAME, 1), + (DESCRIPTION, 0), + (REGISTRY_ID, 1), + (REGISTRY_ARN, 1), + (REGISTRY_AUTHORIZER_TYPE, 0), + (AUTHORIZER_CONFIGURATION, 0), + (APPROVAL_CONFIGURATION, 0), + (REGISTRY_STATUS, 1), + (3, 0), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + ), ) -TAG_RESOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#TagResourceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#TagResourceRequest", +GET_REGISTRY: StaticOperationSchema = ( + 23, + n0, + _GRe, + { + _smithy: MappingProxyType( + {"code": 200, "method": "GET", "uri": "/registries/{registryId}"} ) - ], - members={ - "resourceArn": { - "target": TAGGABLE_RESOURCES_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "tags": { - "target": TAGS_MAP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, }, + GET_REGISTRY_INPUT, + GET_REGISTRY_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -TAG_RESOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#TagResourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#TagResourceResponse", - ) - ], -) - -TAG_RESOURCE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#TagResource"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 204, "method": "POST", "uri": "/tags/{resourceArn}"} - ), - ) - ], +LIST_REGISTRIES_INPUT: StaticSchema = ( + 18, + n0, + _LRI, + {_sSI: _cLRR, _smit: None}, + (_mR, _nT, _st, _aT), + ( + (MAX_RESULTS, {_sQ: _mR}), + (NEXT_TOKEN, {_sQ: _nT}), + (REGISTRY_STATUS, {_sQ: _st}), + (REGISTRY_AUTHORIZER_TYPE, {_sQ: _aT}), + ), ) -TAG_KEY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#TagKeyList"), - shape_type=ShapeType.LIST, - members={"member": {"target": TAG_KEY}}, +REGISTRY_SUMMARY: StaticSchema = ( + 18, + n0, + _RSeg, + 0, + (_n, _d, _rIe, _rAeg, _aT, _st, _sRt, _cA, _uA), + ( + (REGISTRY_NAME, 1), + (DESCRIPTION, 0), + (REGISTRY_ID, 1), + (REGISTRY_ARN, 1), + (REGISTRY_AUTHORIZER_TYPE, 0), + (REGISTRY_STATUS, 1), + (3, 0), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + ), ) -UNTAG_RESOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UntagResourceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UntagResourceRequest", - ) - ], - members={ - "resourceArn": { - "target": TAGGABLE_RESOURCES_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "tagKeys": { - "target": TAG_KEY_LIST, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="tagKeys"), - ], - }, - }, +REGISTRY_SUMMARY_LIST: StaticSchema = ( + 16, + n0, + _RSL, + 0, + (_mem,), + ((REGISTRY_SUMMARY, 0),), +) + +LIST_REGISTRIES_OUTPUT: StaticSchema = ( + 18, + n0, + _LRO, + {_sSI: _cLRRo, _smith: None}, + (_regi, _nT), + ((REGISTRY_SUMMARY_LIST, 1), (NEXT_TOKEN, 0)), +) + +LIST_REGISTRIES: StaticOperationSchema = ( + 23, + n0, + _LR, + {_smithy: MappingProxyType({"code": 200, "method": "GET", "uri": "/registries"})}, + LIST_REGISTRIES_INPUT, + LIST_REGISTRIES_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -UNTAG_RESOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UntagResourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UntagResourceResponse", - ) - ], -) - -UNTAG_RESOURCE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UntagResource"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 204, "method": "DELETE", "uri": "/tags/{resourceArn}"} - ), - ) - ], +UPDATED_APPROVAL_CONFIGURATION: StaticSchema = ( + 18, + n0, + _UACp, + 0, + (_oV,), + ((APPROVAL_CONFIGURATION, 0),), +) + +UPDATE_REGISTRY_INPUT: StaticSchema = ( + 18, + n0, + _URI, + {_sSI: _cURR, _smit: None}, + (_rIe, _n, _d, _aCu, _aCp), + ( + (REGISTRY_IDENTIFIER, 9), + (REGISTRY_NAME, 0), + (UPDATED_DESCRIPTION, 0), + (UPDATED_AUTHORIZER_CONFIGURATION, 0), + (UPDATED_APPROVAL_CONFIGURATION, 0), + ), ) -RESOURCE_OAUTH2_RETURN_URL_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceOauth2ReturnUrlType"), - shape_type=ShapeType.STRING, +UPDATE_REGISTRY_OUTPUT: StaticSchema = ( + 18, + n0, + _URO, + {_sSI: _cURRo, _smith: None}, + (_n, _d, _rIe, _rAeg, _aT, _aCu, _aCp, _st, _sRt, _cA, _uA), + ( + (REGISTRY_NAME, 1), + (DESCRIPTION, 0), + (REGISTRY_ID, 1), + (REGISTRY_ARN, 1), + (REGISTRY_AUTHORIZER_TYPE, 0), + (AUTHORIZER_CONFIGURATION, 0), + (APPROVAL_CONFIGURATION, 0), + (REGISTRY_STATUS, 1), + (3, 0), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + ), ) -RESOURCE_OAUTH2_RETURN_URL_LIST_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceOauth2ReturnUrlListType"), - shape_type=ShapeType.LIST, - members={"member": {"target": RESOURCE_OAUTH2_RETURN_URL_TYPE}}, +UPDATE_REGISTRY: StaticOperationSchema = ( + 23, + n0, + _UR, + { + _smithy: MappingProxyType( + {"code": 202, "method": "PATCH", "uri": "/registries/{registryId}"} + ) + }, + UPDATE_REGISTRY_INPUT, + UPDATE_REGISTRY_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CREATE_WORKLOAD_IDENTITY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateWorkloadIdentityInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreateWorkloadIdentityRequest", - ) - ], - members={ - "name": { - "target": WORKLOAD_IDENTITY_NAME_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "allowedResourceOauth2ReturnUrls": { - "target": RESOURCE_OAUTH2_RETURN_URL_LIST_TYPE - }, - "tags": {"target": TAGS_MAP}, - }, +CONCURRENT_MODIFICATION_EXCEPTION: StaticSchema = ( + 18, + n0, + _CME, + {_s: _c, _sE: 409}, + (_m,), + ((3, 1),), +) + +SET_TOKEN_VAULT_CMK_INPUT: StaticSchema = ( + 18, + n0, + _STVCMKI, + {_sSI: _cSTVCMKR, _smit: None}, + (_tVI, _kC), + ((TOKEN_VAULT_ID_TYPE, 0), (KMS_CONFIGURATION, 1)), +) + +SET_TOKEN_VAULT_CMK_OUTPUT: StaticSchema = ( + 18, + n0, + _STVCMKO, + {_sSI: _cSTVCMKRo, _smith: None}, + (_tVI, _kC, _lMD), + ((TOKEN_VAULT_ID_TYPE, 1), (KMS_CONFIGURATION, 1), (4, 1)), +) + +SET_TOKEN_VAULT_CMK: StaticOperationSchema = ( + 23, + n0, + _STVCMK, + { + _smithy: MappingProxyType( + {"uri": "/identities/set-token-vault-cmk", "method": "POST"} + ) + }, + SET_TOKEN_VAULT_CMK_INPUT, + SET_TOKEN_VAULT_CMK_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONCURRENT_MODIFICATION_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -WORKLOAD_IDENTITY_ARN_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#WorkloadIdentityArnType"), - shape_type=ShapeType.STRING, +TAG_RESOURCE_INPUT: StaticSchema = ( + 18, + n0, + _TRI, + {_sSI: _cTRR, _smit: None}, + (_rAe, _t), + ((TAGGABLE_RESOURCES_ARN, 9), (TAGS_MAP, 1)), ) -CREATE_WORKLOAD_IDENTITY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateWorkloadIdentityOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreateWorkloadIdentityResponse", +TAG_RESOURCE_OUTPUT: StaticSchema = (18, n0, _TRO, {_sSI: _cTRRo, _smith: None}) + +TAG_RESOURCE: StaticOperationSchema = ( + 23, + n0, + _TR, + { + _smithy: MappingProxyType( + {"code": 204, "method": "POST", "uri": "/tags/{resourceArn}"} ) - ], - members={ - "name": { - "target": WORKLOAD_IDENTITY_NAME_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "workloadIdentityArn": { - "target": WORKLOAD_IDENTITY_ARN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "allowedResourceOauth2ReturnUrls": { - "target": RESOURCE_OAUTH2_RETURN_URL_LIST_TYPE - }, }, + TAG_RESOURCE_INPUT, + TAG_RESOURCE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CREATE_WORKLOAD_IDENTITY = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateWorkloadIdentity"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 201, - "uri": "/identities/CreateWorkloadIdentity", - "method": "POST", - } - ), - ) - ], -) +TAG_KEY_LIST: StaticSchema = (16, n0, _TKL, 0, (_mem,), ((TAG_KEY, 0),)) -DELETE_WORKLOAD_IDENTITY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteWorkloadIdentityInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeleteWorkloadIdentityRequest", - ) - ], - members={ - "name": { - "target": WORKLOAD_IDENTITY_NAME_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +UNTAG_RESOURCE_INPUT: StaticSchema = ( + 18, + n0, + _URIn, + {_sSI: _cURRom, _smit: None}, + (_rAe, _tKa), + ((TAGGABLE_RESOURCES_ARN, 9), (TAG_KEY_LIST, {_sQ: _tKa, _sm: None})), ) -DELETE_WORKLOAD_IDENTITY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteWorkloadIdentityOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#DeleteWorkloadIdentityResponse", - ) - ], -) - -DELETE_WORKLOAD_IDENTITY = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#DeleteWorkloadIdentity"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 204, - "uri": "/identities/DeleteWorkloadIdentity", - "method": "POST", - } - ), - ) - ], -) +UNTAG_RESOURCE_OUTPUT: StaticSchema = (18, n0, _UROn, {_sSI: _cURRoma, _smith: None}) -GET_WORKLOAD_IDENTITY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetWorkloadIdentityInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetWorkloadIdentityRequest", +UNTAG_RESOURCE: StaticOperationSchema = ( + 23, + n0, + _URn, + { + _smithy: MappingProxyType( + {"code": 204, "method": "DELETE", "uri": "/tags/{resourceArn}"} ) - ], - members={ - "name": { - "target": WORKLOAD_IDENTITY_NAME_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } }, + UNTAG_RESOURCE_INPUT, + UNTAG_RESOURCE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -GET_WORKLOAD_IDENTITY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetWorkloadIdentityOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetWorkloadIdentityResponse", - ) - ], - members={ - "name": { - "target": WORKLOAD_IDENTITY_NAME_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "workloadIdentityArn": { - "target": WORKLOAD_IDENTITY_ARN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "allowedResourceOauth2ReturnUrls": { - "target": RESOURCE_OAUTH2_RETURN_URL_LIST_TYPE - }, - "createdTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastUpdatedTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +RESOURCE_OAUTH2_RETURN_URL_TYPE: StaticSchema = (3, n0, _RORUT, 0) -GET_WORKLOAD_IDENTITY = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetWorkloadIdentity"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"uri": "/identities/GetWorkloadIdentity", "method": "POST"} - ), - ) - ], +RESOURCE_OAUTH2_RETURN_URL_LIST_TYPE: StaticSchema = ( + 16, + n0, + _RORULT, + 0, + (_mem,), + ((RESOURCE_OAUTH2_RETURN_URL_TYPE, 0),), ) -LIST_WORKLOAD_IDENTITIES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListWorkloadIdentitiesInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListWorkloadIdentitiesRequest", - ) - ], - members={ - "nextToken": {"target": _STRING}, - "maxResults": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=10)], - }, - }, +CREATE_WORKLOAD_IDENTITY_INPUT: StaticSchema = ( + 18, + n0, + _CWII, + {_sSI: _cCWIR, _smit: None}, + (_n, _aRORU, _t), + ( + (WORKLOAD_IDENTITY_NAME_TYPE, 1), + (RESOURCE_OAUTH2_RETURN_URL_LIST_TYPE, 0), + (TAGS_MAP, 0), + ), ) -WORKLOAD_IDENTITY_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#WorkloadIdentityType"), - members={ - "name": { - "target": WORKLOAD_IDENTITY_NAME_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "workloadIdentityArn": { - "target": WORKLOAD_IDENTITY_ARN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +WORKLOAD_IDENTITY_ARN_TYPE: StaticSchema = (3, n0, _WIAT, 0) -WORKLOAD_IDENTITY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#WorkloadIdentityList"), - shape_type=ShapeType.LIST, - members={"member": {"target": WORKLOAD_IDENTITY_TYPE}}, +CREATE_WORKLOAD_IDENTITY_OUTPUT: StaticSchema = ( + 18, + n0, + _CWIO, + {_sSI: _cCWIRo, _smith: None}, + (_n, _wIA, _aRORU), + ( + (WORKLOAD_IDENTITY_NAME_TYPE, 1), + (WORKLOAD_IDENTITY_ARN_TYPE, 1), + (RESOURCE_OAUTH2_RETURN_URL_LIST_TYPE, 0), + ), ) -LIST_WORKLOAD_IDENTITIES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListWorkloadIdentitiesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#ListWorkloadIdentitiesResponse", - ) - ], - members={ - "workloadIdentities": { - "target": WORKLOAD_IDENTITY_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": _STRING}, - }, +CREATE_WORKLOAD_IDENTITY: StaticOperationSchema = ( + 23, + n0, + _CWI, + { + _smithy: MappingProxyType( + {"code": 201, "uri": "/identities/CreateWorkloadIdentity", "method": "POST"} + ) + }, + CREATE_WORKLOAD_IDENTITY_INPUT, + CREATE_WORKLOAD_IDENTITY_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -LIST_WORKLOAD_IDENTITIES = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ListWorkloadIdentities"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"uri": "/identities/ListWorkloadIdentities", "method": "POST"} - ), - ) - ], +DELETE_WORKLOAD_IDENTITY_INPUT: StaticSchema = ( + 18, + n0, + _DWII, + {_sSI: _cDWIR, _smit: None}, + (_n,), + ((WORKLOAD_IDENTITY_NAME_TYPE, 1),), +) + +DELETE_WORKLOAD_IDENTITY_OUTPUT: StaticSchema = ( + 18, + n0, + _DWIO, + {_sSI: _cDWIRo, _smith: None}, +) + +DELETE_WORKLOAD_IDENTITY: StaticOperationSchema = ( + 23, + n0, + _DWI, + { + _smithy: MappingProxyType( + {"code": 204, "uri": "/identities/DeleteWorkloadIdentity", "method": "POST"} + ) + }, + DELETE_WORKLOAD_IDENTITY_INPUT, + DELETE_WORKLOAD_IDENTITY_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -UPDATE_WORKLOAD_IDENTITY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateWorkloadIdentityInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UpdateWorkloadIdentityRequest", - ) - ], - members={ - "name": { - "target": WORKLOAD_IDENTITY_NAME_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "allowedResourceOauth2ReturnUrls": { - "target": RESOURCE_OAUTH2_RETURN_URL_LIST_TYPE - }, - }, +GET_WORKLOAD_IDENTITY_INPUT: StaticSchema = ( + 18, + n0, + _GWII, + {_sSI: _cGWIR, _smit: None}, + (_n,), + ((WORKLOAD_IDENTITY_NAME_TYPE, 1),), +) + +GET_WORKLOAD_IDENTITY_OUTPUT: StaticSchema = ( + 18, + n0, + _GWIO, + {_sSI: _cGWIRo, _smith: None}, + (_n, _wIA, _aRORU, _cTr, _lUT), + ( + (WORKLOAD_IDENTITY_NAME_TYPE, 1), + (WORKLOAD_IDENTITY_ARN_TYPE, 1), + (RESOURCE_OAUTH2_RETURN_URL_LIST_TYPE, 0), + (4, 1), + (4, 1), + ), ) -UPDATE_WORKLOAD_IDENTITY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateWorkloadIdentityOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UpdateWorkloadIdentityResponse", - ) - ], - members={ - "name": { - "target": WORKLOAD_IDENTITY_NAME_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "workloadIdentityArn": { - "target": WORKLOAD_IDENTITY_ARN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "allowedResourceOauth2ReturnUrls": { - "target": RESOURCE_OAUTH2_RETURN_URL_LIST_TYPE - }, - "createdTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastUpdatedTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +GET_WORKLOAD_IDENTITY: StaticOperationSchema = ( + 23, + n0, + _GWI, + { + _smithy: MappingProxyType( + {"uri": "/identities/GetWorkloadIdentity", "method": "POST"} + ) + }, + GET_WORKLOAD_IDENTITY_INPUT, + GET_WORKLOAD_IDENTITY_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -UPDATE_WORKLOAD_IDENTITY = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateWorkloadIdentity"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"uri": "/identities/UpdateWorkloadIdentity", "method": "POST"} - ), - ) - ], -) - -SCHEMA_DEFINITION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SchemaDefinition"), - members={ - "type": { - "target": SCHEMA_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - # This needs to reference a schema that isn't defined yet. - # It will be populated with a non-null value at the end of the file. - "properties": None, - "required": {"target": REQUIRED_PROPERTIES}, - # This needs to reference a schema that isn't defined yet. - # It will be populated with a non-null value at the end of the file. - "items": None, - "description": {"target": _STRING}, - }, +LIST_WORKLOAD_IDENTITIES_INPUT: StaticSchema = ( + 18, + n0, + _LWII, + {_sSI: _cLWIR, _smit: None}, + (_nT, _mR), + ((3, 0), (7, {_smithya: 10})), +) + +WORKLOAD_IDENTITY_TYPE: StaticSchema = ( + 18, + n0, + _WIT, + 0, + (_n, _wIA), + ((WORKLOAD_IDENTITY_NAME_TYPE, 1), (WORKLOAD_IDENTITY_ARN_TYPE, 1)), +) + +WORKLOAD_IDENTITY_LIST: StaticSchema = ( + 16, + n0, + _WIL, + 0, + (_mem,), + ((WORKLOAD_IDENTITY_TYPE, 0),), +) + +LIST_WORKLOAD_IDENTITIES_OUTPUT: StaticSchema = ( + 18, + n0, + _LWIO, + {_sSI: _cLWIRo, _smith: None}, + (_wI, _nT), + ((WORKLOAD_IDENTITY_LIST, 1), (3, 0)), +) + +LIST_WORKLOAD_IDENTITIES: StaticOperationSchema = ( + 23, + n0, + _LWI, + { + _smithy: MappingProxyType( + {"uri": "/identities/ListWorkloadIdentities", "method": "POST"} + ) + }, + LIST_WORKLOAD_IDENTITIES_INPUT, + LIST_WORKLOAD_IDENTITIES_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -SCHEMA_PROPERTIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SchemaProperties"), - shape_type=ShapeType.MAP, - members={"key": {"target": _STRING}, "value": {"target": SCHEMA_DEFINITION}}, -) - -TOOL_DEFINITION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ToolDefinition"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "name": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": { - "target": _STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "inputSchema": { - "target": SCHEMA_DEFINITION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "outputSchema": {"target": SCHEMA_DEFINITION}, - }, +UPDATE_WORKLOAD_IDENTITY_INPUT: StaticSchema = ( + 18, + n0, + _UWII, + {_sSI: _cUWIR, _smit: None}, + (_n, _aRORU), + ((WORKLOAD_IDENTITY_NAME_TYPE, 1), (RESOURCE_OAUTH2_RETURN_URL_LIST_TYPE, 0)), +) + +UPDATE_WORKLOAD_IDENTITY_OUTPUT: StaticSchema = ( + 18, + n0, + _UWIO, + {_sSI: _cUWIRo, _smith: None}, + (_n, _wIA, _aRORU, _cTr, _lUT), + ( + (WORKLOAD_IDENTITY_NAME_TYPE, 1), + (WORKLOAD_IDENTITY_ARN_TYPE, 1), + (RESOURCE_OAUTH2_RETURN_URL_LIST_TYPE, 0), + (4, 1), + (4, 1), + ), ) -TOOL_DEFINITIONS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ToolDefinitions"), - shape_type=ShapeType.LIST, - members={"member": {"target": TOOL_DEFINITION}}, +UPDATE_WORKLOAD_IDENTITY: StaticOperationSchema = ( + 23, + n0, + _UWI, + { + _smithy: MappingProxyType( + {"uri": "/identities/UpdateWorkloadIdentity", "method": "POST"} + ) + }, + UPDATE_WORKLOAD_IDENTITY_INPUT, + UPDATE_WORKLOAD_IDENTITY_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -TOOL_SCHEMA = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#ToolSchema"), - shape_type=ShapeType.UNION, - members={ - "s3": {"target": S3_CONFIGURATION}, - "inlinePayload": {"target": TOOL_DEFINITIONS}, - }, +SCHEMA_DEFINITION: StaticSchema = ( + 18, + n0, + _SDc, + 0, + (_ty, _pro, _requ, _it, _d), + ( + (SCHEMA_TYPE, 1), + (lambda: SCHEMA_PROPERTIES, 0), + (REQUIRED_PROPERTIES, 0), + (lambda: SCHEMA_DEFINITION, 0), + (3, 0), + ), ) -MCP_LAMBDA_TARGET_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#McpLambdaTargetConfiguration"), - members={ - "lambdaArn": { - "target": LAMBDA_FUNCTION_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "toolSchema": { - "target": TOOL_SCHEMA, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +SCHEMA_PROPERTIES: StaticSchema = ( + 17, + n0, + _SPc, + 0, + (_k, _v), + ((3, 0), (SCHEMA_DEFINITION, 0)), +) + +TOOL_DEFINITION: StaticSchema = ( + 18, + n0, + _TDoo, + 4, + (_n, _d, _iS, _oSu), + ((3, 1), (3, 1), (SCHEMA_DEFINITION, 1), (SCHEMA_DEFINITION, 0)), +) + +TOOL_DEFINITIONS: StaticSchema = (16, n0, _TDool, 0, (_mem,), ((TOOL_DEFINITION, 0),)) + +TOOL_SCHEMA: StaticSchema = ( + 19, + n0, + _TSo, + 0, + (_s_, _iPn), + ((S3_CONFIGURATION, 0), (TOOL_DEFINITIONS, 0)), +) + +MCP_LAMBDA_TARGET_CONFIGURATION: StaticSchema = ( + 18, + n0, + _MLTC, + 0, + (_lA, _tSo), + ((LAMBDA_FUNCTION_ARN, 1), (TOOL_SCHEMA, 1)), +) + +MCP_TARGET_CONFIGURATION: StaticSchema = ( + 19, + n0, + _MTC, + 0, + (_oAS, _sMm, _lam, _mSc, _aG, _conne), + ( + (API_SCHEMA_CONFIGURATION, 0), + (API_SCHEMA_CONFIGURATION, 0), + (MCP_LAMBDA_TARGET_CONFIGURATION, 0), + (MCP_SERVER_TARGET_CONFIGURATION, 0), + (API_GATEWAY_TARGET_CONFIGURATION, 0), + (CONNECTOR_TARGET_CONFIGURATION, 0), + ), ) -MCP_TARGET_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#McpTargetConfiguration"), - shape_type=ShapeType.UNION, - members={ - "openApiSchema": {"target": API_SCHEMA_CONFIGURATION}, - "smithyModel": {"target": API_SCHEMA_CONFIGURATION}, - "lambda": {"target": MCP_LAMBDA_TARGET_CONFIGURATION}, - "mcpServer": {"target": MCP_SERVER_TARGET_CONFIGURATION}, - "apiGateway": {"target": API_GATEWAY_TARGET_CONFIGURATION}, - "connector": {"target": CONNECTOR_TARGET_CONFIGURATION}, - }, +TARGET_CONFIGURATION: StaticSchema = ( + 19, + n0, + _TCa, + 0, + (_mc, _ht, _inf), + ( + (MCP_TARGET_CONFIGURATION, 0), + (HTTP_TARGET_CONFIGURATION, 0), + (INFERENCE_TARGET_CONFIGURATION, 0), + ), ) -TARGET_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#TargetConfiguration"), - shape_type=ShapeType.UNION, - members={ - "mcp": {"target": MCP_TARGET_CONFIGURATION}, - "http": {"target": HTTP_TARGET_CONFIGURATION}, - "inference": {"target": INFERENCE_TARGET_CONFIGURATION}, - }, +CREATE_GATEWAY_TARGET_INPUT: StaticSchema = ( + 18, + n0, + _CGTI, + {_sSI: _cCGTR, _smit: None}, + (_gI, _n, _d, _cT, _tCa, _cPCr, _mC, _pE, _cCe), + ( + (GATEWAY_IDENTIFIER, 9), + (TARGET_NAME, 0), + (TARGET_DESCRIPTION, 0), + (CLIENT_TOKEN, 2), + (TARGET_CONFIGURATION, 1), + (CREDENTIAL_PROVIDER_CONFIGURATIONS, 0), + (METADATA_CONFIGURATION, 0), + (PRIVATE_ENDPOINT, 0), + (CERTIFICATE_CONFIGURATION_LIST, 0), + ), ) -CREATE_GATEWAY_TARGET_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateGatewayTargetInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreateGatewayTargetRequest", - ) - ], - members={ - "gatewayIdentifier": { - "target": GATEWAY_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "name": {"target": TARGET_NAME}, - "description": {"target": TARGET_DESCRIPTION}, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "targetConfiguration": { - "target": TARGET_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "credentialProviderConfigurations": { - "target": CREDENTIAL_PROVIDER_CONFIGURATIONS - }, - "metadataConfiguration": {"target": METADATA_CONFIGURATION}, - "privateEndpoint": {"target": PRIVATE_ENDPOINT}, - "certificateConfigurations": {"target": CERTIFICATE_CONFIGURATION_LIST}, - }, +CREATE_GATEWAY_TARGET_OUTPUT: StaticSchema = ( + 18, + n0, + _CGTO, + {_sSI: _cCGTRo, _smith: None}, + ( + _gA, + _tI, + _cA, + _uA, + _st, + _sRta, + _n, + _d, + _tCa, + _cPCr, + _lSAa, + _mC, + _pE, + _pEMR, + _aD, + _pTr, + _cCe, + ), + ( + (GATEWAY_ARN, 1), + (TARGET_ID, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (TARGET_STATUS, 1), + (STATUS_REASONS, 0), + (TARGET_NAME, 1), + (TARGET_DESCRIPTION, 0), + (TARGET_CONFIGURATION, 1), + (CREDENTIAL_PROVIDER_CONFIGURATIONS, 1), + (DATE_TIMESTAMP, 0), + (METADATA_CONFIGURATION, 0), + (PRIVATE_ENDPOINT, 0), + (PRIVATE_ENDPOINT_MANAGED_RESOURCES, 0), + (AUTHORIZATION_DATA, 0), + (TARGET_PROTOCOL_TYPE, 0), + (CERTIFICATE_CONFIGURATION_LIST, 0), + ), ) -CREATE_GATEWAY_TARGET_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateGatewayTargetOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#CreateGatewayTargetResponse", - ) - ], - members={ - "gatewayArn": { - "target": GATEWAY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "targetId": { - "target": TARGET_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": TARGET_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "statusReasons": {"target": STATUS_REASONS}, - "name": { - "target": TARGET_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": TARGET_DESCRIPTION}, - "targetConfiguration": { - "target": TARGET_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "credentialProviderConfigurations": { - "target": CREDENTIAL_PROVIDER_CONFIGURATIONS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastSynchronizedAt": {"target": DATE_TIMESTAMP}, - "metadataConfiguration": {"target": METADATA_CONFIGURATION}, - "privateEndpoint": {"target": PRIVATE_ENDPOINT}, - "privateEndpointManagedResources": { - "target": PRIVATE_ENDPOINT_MANAGED_RESOURCES - }, - "authorizationData": {"target": AUTHORIZATION_DATA}, - "protocolType": {"target": TARGET_PROTOCOL_TYPE}, - "certificateConfigurations": {"target": CERTIFICATE_CONFIGURATION_LIST}, - }, +GATEWAY_TARGET: StaticSchema = ( + 18, + n0, + _GTa, + 0, + ( + _gA, + _tI, + _cA, + _uA, + _st, + _sRta, + _n, + _d, + _tCa, + _cPCr, + _lSAa, + _mC, + _pE, + _pEMR, + _aD, + _pTr, + _cCe, + ), + ( + (GATEWAY_ARN, 1), + (TARGET_ID, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (TARGET_STATUS, 1), + (STATUS_REASONS, 0), + (TARGET_NAME, 1), + (TARGET_DESCRIPTION, 0), + (TARGET_CONFIGURATION, 1), + (CREDENTIAL_PROVIDER_CONFIGURATIONS, 1), + (DATE_TIMESTAMP, 0), + (METADATA_CONFIGURATION, 0), + (PRIVATE_ENDPOINT, 0), + (PRIVATE_ENDPOINT_MANAGED_RESOURCES, 0), + (AUTHORIZATION_DATA, 0), + (TARGET_PROTOCOL_TYPE, 0), + (CERTIFICATE_CONFIGURATION_LIST, 0), + ), ) -GATEWAY_TARGET = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GatewayTarget"), - members={ - "gatewayArn": { - "target": GATEWAY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "targetId": { - "target": TARGET_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": TARGET_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "statusReasons": {"target": STATUS_REASONS}, - "name": { - "target": TARGET_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": TARGET_DESCRIPTION}, - "targetConfiguration": { - "target": TARGET_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "credentialProviderConfigurations": { - "target": CREDENTIAL_PROVIDER_CONFIGURATIONS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastSynchronizedAt": {"target": DATE_TIMESTAMP}, - "metadataConfiguration": {"target": METADATA_CONFIGURATION}, - "privateEndpoint": {"target": PRIVATE_ENDPOINT}, - "privateEndpointManagedResources": { - "target": PRIVATE_ENDPOINT_MANAGED_RESOURCES - }, - "authorizationData": {"target": AUTHORIZATION_DATA}, - "protocolType": {"target": TARGET_PROTOCOL_TYPE}, - "certificateConfigurations": {"target": CERTIFICATE_CONFIGURATION_LIST}, - }, +GET_GATEWAY_TARGET_OUTPUT: StaticSchema = ( + 18, + n0, + _GGTO, + {_sSI: _cGGTRo, _smith: None}, + ( + _gA, + _tI, + _cA, + _uA, + _st, + _sRta, + _n, + _d, + _tCa, + _cPCr, + _lSAa, + _mC, + _pE, + _pEMR, + _aD, + _pTr, + _cCe, + ), + ( + (GATEWAY_ARN, 1), + (TARGET_ID, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (TARGET_STATUS, 1), + (STATUS_REASONS, 0), + (TARGET_NAME, 1), + (TARGET_DESCRIPTION, 0), + (TARGET_CONFIGURATION, 1), + (CREDENTIAL_PROVIDER_CONFIGURATIONS, 1), + (DATE_TIMESTAMP, 0), + (METADATA_CONFIGURATION, 0), + (PRIVATE_ENDPOINT, 0), + (PRIVATE_ENDPOINT_MANAGED_RESOURCES, 0), + (AUTHORIZATION_DATA, 0), + (TARGET_PROTOCOL_TYPE, 0), + (CERTIFICATE_CONFIGURATION_LIST, 0), + ), ) -GET_GATEWAY_TARGET_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetGatewayTargetOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#GetGatewayTargetResponse", - ) - ], - members={ - "gatewayArn": { - "target": GATEWAY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "targetId": { - "target": TARGET_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": TARGET_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "statusReasons": {"target": STATUS_REASONS}, - "name": { - "target": TARGET_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": TARGET_DESCRIPTION}, - "targetConfiguration": { - "target": TARGET_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "credentialProviderConfigurations": { - "target": CREDENTIAL_PROVIDER_CONFIGURATIONS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastSynchronizedAt": {"target": DATE_TIMESTAMP}, - "metadataConfiguration": {"target": METADATA_CONFIGURATION}, - "privateEndpoint": {"target": PRIVATE_ENDPOINT}, - "privateEndpointManagedResources": { - "target": PRIVATE_ENDPOINT_MANAGED_RESOURCES - }, - "authorizationData": {"target": AUTHORIZATION_DATA}, - "protocolType": {"target": TARGET_PROTOCOL_TYPE}, - "certificateConfigurations": {"target": CERTIFICATE_CONFIGURATION_LIST}, - }, +UPDATE_GATEWAY_TARGET_INPUT: StaticSchema = ( + 18, + n0, + _UGTI, + {_sSI: _cUGTR, _smit: None}, + (_gI, _tI, _n, _d, _tCa, _cPCr, _mC, _pE, _cCe), + ( + (GATEWAY_IDENTIFIER, 9), + (TARGET_ID, 9), + (TARGET_NAME, 0), + (TARGET_DESCRIPTION, 0), + (TARGET_CONFIGURATION, 1), + (CREDENTIAL_PROVIDER_CONFIGURATIONS, 0), + (METADATA_CONFIGURATION, 0), + (PRIVATE_ENDPOINT, 0), + (CERTIFICATE_CONFIGURATION_LIST, 0), + ), ) -UPDATE_GATEWAY_TARGET_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateGatewayTargetInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UpdateGatewayTargetRequest", - ) - ], - members={ - "gatewayIdentifier": { - "target": GATEWAY_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "targetId": { - "target": TARGET_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "name": {"target": TARGET_NAME}, - "description": {"target": TARGET_DESCRIPTION}, - "targetConfiguration": { - "target": TARGET_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "credentialProviderConfigurations": { - "target": CREDENTIAL_PROVIDER_CONFIGURATIONS - }, - "metadataConfiguration": {"target": METADATA_CONFIGURATION}, - "privateEndpoint": {"target": PRIVATE_ENDPOINT}, - "certificateConfigurations": {"target": CERTIFICATE_CONFIGURATION_LIST}, - }, +UPDATE_GATEWAY_TARGET_OUTPUT: StaticSchema = ( + 18, + n0, + _UGTO, + {_sSI: _cUGTRo, _smith: None}, + ( + _gA, + _tI, + _cA, + _uA, + _st, + _sRta, + _n, + _d, + _tCa, + _cPCr, + _lSAa, + _mC, + _pE, + _pEMR, + _aD, + _pTr, + _cCe, + ), + ( + (GATEWAY_ARN, 1), + (TARGET_ID, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (TARGET_STATUS, 1), + (STATUS_REASONS, 0), + (TARGET_NAME, 1), + (TARGET_DESCRIPTION, 0), + (TARGET_CONFIGURATION, 1), + (CREDENTIAL_PROVIDER_CONFIGURATIONS, 1), + (DATE_TIMESTAMP, 0), + (METADATA_CONFIGURATION, 0), + (PRIVATE_ENDPOINT, 0), + (PRIVATE_ENDPOINT_MANAGED_RESOURCES, 0), + (AUTHORIZATION_DATA, 0), + (TARGET_PROTOCOL_TYPE, 0), + (CERTIFICATE_CONFIGURATION_LIST, 0), + ), ) -UPDATE_GATEWAY_TARGET_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateGatewayTargetOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#UpdateGatewayTargetResponse", - ) - ], - members={ - "gatewayArn": { - "target": GATEWAY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "targetId": { - "target": TARGET_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": TARGET_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "statusReasons": {"target": STATUS_REASONS}, - "name": { - "target": TARGET_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": TARGET_DESCRIPTION}, - "targetConfiguration": { - "target": TARGET_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "credentialProviderConfigurations": { - "target": CREDENTIAL_PROVIDER_CONFIGURATIONS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastSynchronizedAt": {"target": DATE_TIMESTAMP}, - "metadataConfiguration": {"target": METADATA_CONFIGURATION}, - "privateEndpoint": {"target": PRIVATE_ENDPOINT}, - "privateEndpointManagedResources": { - "target": PRIVATE_ENDPOINT_MANAGED_RESOURCES - }, - "authorizationData": {"target": AUTHORIZATION_DATA}, - "protocolType": {"target": TARGET_PROTOCOL_TYPE}, - "certificateConfigurations": {"target": CERTIFICATE_CONFIGURATION_LIST}, - }, +GET_GATEWAY_TARGET: StaticOperationSchema = ( + 23, + n0, + _GGT, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "GET", + "uri": "/gateways/{gatewayIdentifier}/targets/{targetId}/", + } + ) + }, + GET_GATEWAY_TARGET_INPUT, + GET_GATEWAY_TARGET_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -GET_GATEWAY_TARGET = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GetGatewayTarget"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/gateways/{gatewayIdentifier}/targets/{targetId}/", - } - ), - ) - ], +GATEWAY_TARGET_LIST: StaticSchema = (16, n0, _GTL, 0, (_mem,), ((GATEWAY_TARGET, 0),)) + +SYNCHRONIZE_GATEWAY_TARGETS_OUTPUT: StaticSchema = ( + 18, + n0, + _SGTO, + {_sSI: _cSGTRo, _smith: None}, + (_tar,), + ((GATEWAY_TARGET_LIST, 0),), +) + +SYNCHRONIZE_GATEWAY_TARGETS: StaticOperationSchema = ( + 23, + n0, + _SGT, + { + _smithy: MappingProxyType( + { + "code": 202, + "method": "PUT", + "uri": "/gateways/{gatewayIdentifier}/synchronizeTargets", + } + ) + }, + SYNCHRONIZE_GATEWAY_TARGETS_INPUT, + SYNCHRONIZE_GATEWAY_TARGETS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -GATEWAY_TARGET_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#GatewayTargetList"), - shape_type=ShapeType.LIST, - members={"member": {"target": GATEWAY_TARGET}}, +CREATE_GATEWAY_TARGET: StaticOperationSchema = ( + 23, + n0, + _CGT, + { + _smithy: MappingProxyType( + { + "code": 202, + "method": "POST", + "uri": "/gateways/{gatewayIdentifier}/targets/", + } + ) + }, + CREATE_GATEWAY_TARGET_INPUT, + CREATE_GATEWAY_TARGET_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -SYNCHRONIZE_GATEWAY_TARGETS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SynchronizeGatewayTargetsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcorecontrol#SynchronizeGatewayTargetsResponse", - ) - ], - members={"targets": {"target": GATEWAY_TARGET_LIST}}, -) - -SYNCHRONIZE_GATEWAY_TARGETS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#SynchronizeGatewayTargets"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 202, - "method": "PUT", - "uri": "/gateways/{gatewayIdentifier}/synchronizeTargets", - } - ), - ) - ], -) - -CREATE_GATEWAY_TARGET = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#CreateGatewayTarget"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 202, - "method": "POST", - "uri": "/gateways/{gatewayIdentifier}/targets/", - } - ), - ) - ], -) - -UPDATE_GATEWAY_TARGET = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#UpdateGatewayTarget"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 202, - "method": "PUT", - "uri": "/gateways/{gatewayIdentifier}/targets/{targetId}/", - } - ), - ) - ], +UPDATE_GATEWAY_TARGET: StaticOperationSchema = ( + 23, + n0, + _UGT, + { + _smithy: MappingProxyType( + { + "code": 202, + "method": "PUT", + "uri": "/gateways/{gatewayIdentifier}/targets/{targetId}/", + } + ) + }, + UPDATE_GATEWAY_TARGET_INPUT, + UPDATE_GATEWAY_TARGET_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AMAZON_BEDROCK_AGENT_CORE_CONTROL = Schema( - id=ShapeID("com.amazonaws.bedrockagentcorecontrol#AmazonBedrockAgentCoreControl"), - shape_type=ShapeType.SERVICE, - traits=[ - Trait.new( - id=ShapeID("aws.auth#sigv4"), - value=MappingProxyType({"name": "bedrock-agentcore"}), - ), - Trait.new( - id=ShapeID("smithy.rules#endpointBdd"), - value=MappingProxyType( - { - "version": "1.1", - "parameters": MappingProxyType( - { - "Region": MappingProxyType( - { - "builtIn": "AWS::Region", - "required": False, - "documentation": "The AWS region used to dispatch the request.", - "type": "string", - } - ), - "UseDualStack": MappingProxyType( - { - "builtIn": "AWS::UseDualStack", - "required": True, - "default": False, - "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", - "type": "boolean", - } - ), - "UseFIPS": MappingProxyType( - { - "builtIn": "AWS::UseFIPS", - "required": True, - "default": False, - "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", - "type": "boolean", - } - ), - "Endpoint": MappingProxyType( - { - "builtIn": "SDK::Endpoint", - "required": False, - "documentation": "Override the endpoint used to send this request", - "type": "string", - } - ), - } - ), - "conditions": ( - MappingProxyType( - { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "Endpoint"}),), - } - ), - MappingProxyType( - { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "Region"}),), - } - ), - MappingProxyType( - { - "fn": "aws.partition", - "argv": (MappingProxyType({"ref": "Region"}),), - "assign": "PartitionResult", - } - ), - MappingProxyType( +AMAZON_BEDROCK_AGENT_CORE_CONTROL: StaticSchema = ( + 21, + n0, + _ABACC, + { + _aw: MappingProxyType({"name": "bedrock-agentcore"}), + _sB: MappingProxyType( + { + "version": "1.1", + "parameters": MappingProxyType( + { + "Region": MappingProxyType( { - "fn": "booleanEquals", - "argv": (MappingProxyType({"ref": "UseFIPS"}), True), + "builtIn": "AWS::Region", + "required": False, + "documentation": "The AWS region used to dispatch the request.", + "type": "string", } ), - MappingProxyType( + "UseDualStack": MappingProxyType( { - "fn": "booleanEquals", - "argv": ( - MappingProxyType({"ref": "UseDualStack"}), - True, - ), + "builtIn": "AWS::UseDualStack", + "required": True, + "default": False, + "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", + "type": "boolean", } ), - MappingProxyType( + "UseFIPS": MappingProxyType( { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "supportsDualStack", - ), - } - ), - True, - ), + "builtIn": "AWS::UseFIPS", + "required": True, + "default": False, + "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", + "type": "boolean", } ), - MappingProxyType( + "Endpoint": MappingProxyType( { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "supportsFIPS", - ), - } - ), - True, - ), + "builtIn": "SDK::Endpoint", + "required": False, + "documentation": "Override the endpoint used to send this request", + "type": "string", } ), + } + ), + "conditions": ( + MappingProxyType( + { + "fn": "isSet", + "argv": (MappingProxyType({"ref": "Endpoint"}),), + } ), - "results": ( - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: FIPS and custom endpoint are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": MappingProxyType({"ref": "Endpoint"}), - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://bedrock-agentcore-control-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "FIPS and DualStack are enabled, but this partition does not support one or both", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://bedrock-agentcore-control-fips.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "FIPS is enabled but this partition does not support FIPS", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + MappingProxyType( + {"fn": "isSet", "argv": (MappingProxyType({"ref": "Region"}),)} + ), + MappingProxyType( + { + "fn": "aws.partition", + "argv": (MappingProxyType({"ref": "Region"}),), + "assign": "PartitionResult", + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": (MappingProxyType({"ref": "UseFIPS"}), True), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": (MappingProxyType({"ref": "UseDualStack"}), True), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( { - "url": "https://bedrock-agentcore-control.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "supportsDualStack", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "DualStack is enabled but this partition does not support DualStack", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + True, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( { - "url": "https://bedrock-agentcore-control.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "supportsFIPS", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: Missing Region", - "type": "error", - } - ), + True, + ), + } ), - "root": 2, - "nodeCount": 13, - "nodes": "/////wAAAAH/////AAAAAAAAAAwAAAADAAAAAQAAAAQF9eELAAAAAgAAAAUF9eELAAAAAwAAAAgAAAAGAAAABAAAAAcF9eEKAAAABQX14QgF9eEJAAAABAAAAAoAAAAJAAAABgX14QYF9eEHAAAABQAAAAsF9eEFAAAABgX14QQF9eEFAAAAAwX14QEAAAANAAAABAX14QIF9eED", - } - ), - ), - Trait.new( - id=ShapeID("aws.api#service"), - value=MappingProxyType( - { - "sdkId": "Bedrock AgentCore Control", - "arnNamespace": "bedrock-agentcore", - "endpointPrefix": "bedrock-agentcore-control", - "cloudTrailEventSource": "bedrock-agentcore.amazonaws.com", - } - ), - ), - Trait.new(id=ShapeID("aws.protocols#restJson1")), - Trait.new( - id=ShapeID("smithy.api#cors"), - value=MappingProxyType( - { - "additionalAllowedHeaders": ( - "*", - "content-type", - "x-amz-content-sha256", - "x-amz-user-agent", - "x-amzn-platform-id", - "x-amzn-trace-id", + ), + "results": ( + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: FIPS and custom endpoint are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": MappingProxyType({"ref": "Endpoint"}), + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://bedrock-agentcore-control-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS and DualStack are enabled, but this partition does not support one or both", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://bedrock-agentcore-control-fips.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS is enabled but this partition does not support FIPS", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://bedrock-agentcore-control.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "DualStack is enabled but this partition does not support DualStack", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://bedrock-agentcore-control.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } ), - "additionalExposedHeaders": ( - "x-amzn-errortype", - "x-amzn-requestid", - "x-amzn-trace-id", + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Missing Region", + "type": "error", + } ), - "maxAge": 86400, - } - ), + ), + "root": 2, + "nodeCount": 13, + "nodes": "/////wAAAAH/////AAAAAAAAAAwAAAADAAAAAQAAAAQF9eELAAAAAgAAAAUF9eELAAAAAwAAAAgAAAAGAAAABAAAAAcF9eEKAAAABQX14QgF9eEJAAAABAAAAAoAAAAJAAAABgX14QYF9eEHAAAABQAAAAsF9eEFAAAABgX14QQF9eEFAAAAAwX14QEAAAANAAAABAX14QIF9eED", + } ), - ], -) - -SCHEMA_DEFINITION.members["items"] = Schema.member( - id=SCHEMA_DEFINITION.id.with_member("items"), target=SCHEMA_DEFINITION, index=3 -) - -SCHEMA_DEFINITION.members["properties"] = Schema.member( - id=SCHEMA_DEFINITION.id.with_member("properties"), target=SCHEMA_PROPERTIES, index=1 + _aws: MappingProxyType( + { + "sdkId": "Bedrock AgentCore Control", + "arnNamespace": "bedrock-agentcore", + "endpointPrefix": "bedrock-agentcore-control", + "cloudTrailEventSource": "bedrock-agentcore.amazonaws.com", + } + ), + _aJ: None, + _smithyap: MappingProxyType( + { + "additionalAllowedHeaders": ( + "*", + "content-type", + "x-amz-content-sha256", + "x-amz-user-agent", + "x-amzn-platform-id", + "x-amzn-trace-id", + ), + "additionalExposedHeaders": ( + "x-amzn-errortype", + "x-amzn-requestid", + "x-amzn-trace-id", + ), + "maxAge": 86400, + } + ), + }, ) diff --git a/clients/aws-sdk-bedrock-agentcore-control/src/aws_sdk_bedrock_agentcore_control/client.py b/clients/aws-sdk-bedrock-agentcore-control/src/aws_sdk_bedrock_agentcore_control/client.py index 4d3f9a29..0fb14ca6 100644 --- a/clients/aws-sdk-bedrock-agentcore-control/src/aws_sdk_bedrock_agentcore_control/client.py +++ b/clients/aws-sdk-bedrock-agentcore-control/src/aws_sdk_bedrock_agentcore_control/client.py @@ -1,28 +1,26 @@ # Code generated by smithy-python-codegen DO NOT EDIT. +from __future__ import annotations + from copy import deepcopy import logging from typing import Any, cast +from smithy_aws_core.aio.identity.chain import AsyncIdentityChain from smithy_aws_core.config import ConfigSource from smithy_aws_core.identity import AWSCredentialsIdentity -from smithy_aws_core.identity.chain import IdentityChain -from smithy_core.aio.client import AsyncClient, ClientCall, RequestPipeline +from smithy_core.aio.client import AsyncClient, AsyncClientCall, AsyncRequestPipeline from smithy_core.deserializers import DeserializeableShape from smithy_core.exceptions import ExpectationNotMetError from smithy_core.schemas import APIOperation from smithy_core.serializers import SerializeableShape -from smithy_http.aio.interfaces import HTTPClient +from smithy_http.aio.interfaces import AsyncHTTPClient from smithy_http.plugins import user_agent_plugin from .config import AsyncBedrockAgentCoreControlConfig, Plugin from .models import ( ADD_DATASET_EXAMPLES, - AddDatasetExamplesInput, - AddDatasetExamplesOutput, BATCH_PUT_GATEWAY_RATE_LIMITS, - BatchPutGatewayRateLimitsInput, - BatchPutGatewayRateLimitsOutput, CREATE_AGENT_RUNTIME, CREATE_AGENT_RUNTIME_ENDPOINT, CREATE_API_KEY_CREDENTIAL_PROVIDER, @@ -52,64 +50,6 @@ CREATE_REGISTRY, CREATE_REGISTRY_RECORD, CREATE_WORKLOAD_IDENTITY, - CreateAgentRuntimeEndpointInput, - CreateAgentRuntimeEndpointOutput, - CreateAgentRuntimeInput, - CreateAgentRuntimeOutput, - CreateApiKeyCredentialProviderInput, - CreateApiKeyCredentialProviderOutput, - CreateBrowserInput, - CreateBrowserOutput, - CreateBrowserProfileInput, - CreateBrowserProfileOutput, - CreateCapacityProviderInput, - CreateCapacityProviderOutput, - CreateCodeInterpreterInput, - CreateCodeInterpreterOutput, - CreateConfigurationBundleInput, - CreateConfigurationBundleOutput, - CreateConsentPortalInput, - CreateConsentPortalOutput, - CreateDatasetInput, - CreateDatasetOutput, - CreateDatasetVersionInput, - CreateDatasetVersionOutput, - CreateEvaluatorInput, - CreateEvaluatorOutput, - CreateGatewayInput, - CreateGatewayOutput, - CreateGatewayRateLimitInput, - CreateGatewayRateLimitOutput, - CreateGatewayRuleInput, - CreateGatewayRuleOutput, - CreateGatewayTargetInput, - CreateGatewayTargetOutput, - CreateHarnessEndpointInput, - CreateHarnessEndpointOutput, - CreateHarnessInput, - CreateHarnessOutput, - CreateMemoryInput, - CreateMemoryOutput, - CreateOauth2CredentialProviderInput, - CreateOauth2CredentialProviderOutput, - CreateOnlineEvaluationConfigInput, - CreateOnlineEvaluationConfigOutput, - CreatePaymentConnectorInput, - CreatePaymentConnectorOutput, - CreatePaymentCredentialProviderInput, - CreatePaymentCredentialProviderOutput, - CreatePaymentManagerInput, - CreatePaymentManagerOutput, - CreatePolicyEngineInput, - CreatePolicyEngineOutput, - CreatePolicyInput, - CreatePolicyOutput, - CreateRegistryInput, - CreateRegistryOutput, - CreateRegistryRecordInput, - CreateRegistryRecordOutput, - CreateWorkloadIdentityInput, - CreateWorkloadIdentityOutput, DELETE_AGENT_RUNTIME, DELETE_AGENT_RUNTIME_ENDPOINT, DELETE_API_KEY_CREDENTIAL_PROVIDER, @@ -140,66 +80,6 @@ DELETE_REGISTRY_RECORD, DELETE_RESOURCE_POLICY, DELETE_WORKLOAD_IDENTITY, - DeleteAgentRuntimeEndpointInput, - DeleteAgentRuntimeEndpointOutput, - DeleteAgentRuntimeInput, - DeleteAgentRuntimeOutput, - DeleteApiKeyCredentialProviderInput, - DeleteApiKeyCredentialProviderOutput, - DeleteBrowserInput, - DeleteBrowserOutput, - DeleteBrowserProfileInput, - DeleteBrowserProfileOutput, - DeleteCapacityProviderInput, - DeleteCapacityProviderOutput, - DeleteCodeInterpreterInput, - DeleteCodeInterpreterOutput, - DeleteConfigurationBundleInput, - DeleteConfigurationBundleOutput, - DeleteConsentPortalInput, - DeleteConsentPortalOutput, - DeleteDatasetExamplesInput, - DeleteDatasetExamplesOutput, - DeleteDatasetInput, - DeleteDatasetOutput, - DeleteEvaluatorInput, - DeleteEvaluatorOutput, - DeleteGatewayInput, - DeleteGatewayOutput, - DeleteGatewayRateLimitInput, - DeleteGatewayRateLimitOutput, - DeleteGatewayRuleInput, - DeleteGatewayRuleOutput, - DeleteGatewayTargetInput, - DeleteGatewayTargetOutput, - DeleteHarnessEndpointInput, - DeleteHarnessEndpointOutput, - DeleteHarnessInput, - DeleteHarnessOutput, - DeleteMemoryInput, - DeleteMemoryOutput, - DeleteOauth2CredentialProviderInput, - DeleteOauth2CredentialProviderOutput, - DeleteOnlineEvaluationConfigInput, - DeleteOnlineEvaluationConfigOutput, - DeletePaymentConnectorInput, - DeletePaymentConnectorOutput, - DeletePaymentCredentialProviderInput, - DeletePaymentCredentialProviderOutput, - DeletePaymentManagerInput, - DeletePaymentManagerOutput, - DeletePolicyEngineInput, - DeletePolicyEngineOutput, - DeletePolicyInput, - DeletePolicyOutput, - DeleteRegistryInput, - DeleteRegistryOutput, - DeleteRegistryRecordInput, - DeleteRegistryRecordOutput, - DeleteResourcePolicyInput, - DeleteResourcePolicyOutput, - DeleteWorkloadIdentityInput, - DeleteWorkloadIdentityOutput, GET_AGENT_RUNTIME, GET_AGENT_RUNTIME_ENDPOINT, GET_API_KEY_CREDENTIAL_PROVIDER, @@ -235,76 +115,6 @@ GET_RESOURCE_POLICY, GET_TOKEN_VAULT, GET_WORKLOAD_IDENTITY, - GetAgentRuntimeEndpointInput, - GetAgentRuntimeEndpointOutput, - GetAgentRuntimeInput, - GetAgentRuntimeOutput, - GetApiKeyCredentialProviderInput, - GetApiKeyCredentialProviderOutput, - GetBrowserInput, - GetBrowserOutput, - GetBrowserProfileInput, - GetBrowserProfileOutput, - GetCapacityProviderInput, - GetCapacityProviderOutput, - GetCodeInterpreterInput, - GetCodeInterpreterOutput, - GetConfigurationBundleInput, - GetConfigurationBundleOutput, - GetConfigurationBundleVersionInput, - GetConfigurationBundleVersionOutput, - GetConsentPortalInput, - GetConsentPortalOutput, - GetDatasetInput, - GetDatasetOutput, - GetEvaluatorInput, - GetEvaluatorOutput, - GetGatewayInput, - GetGatewayOutput, - GetGatewayRateLimitInput, - GetGatewayRateLimitOutput, - GetGatewayRuleInput, - GetGatewayRuleOutput, - GetGatewayTargetInput, - GetGatewayTargetOutput, - GetHarnessEndpointInput, - GetHarnessEndpointOutput, - GetHarnessInput, - GetHarnessOutput, - GetMemoryInput, - GetMemoryOutput, - GetOauth2CredentialProviderInput, - GetOauth2CredentialProviderOutput, - GetOnlineEvaluationConfigInput, - GetOnlineEvaluationConfigOutput, - GetPaymentConnectorInput, - GetPaymentConnectorOutput, - GetPaymentCredentialProviderInput, - GetPaymentCredentialProviderOutput, - GetPaymentManagerInput, - GetPaymentManagerOutput, - GetPolicyEngineInput, - GetPolicyEngineOutput, - GetPolicyEngineSummaryInput, - GetPolicyEngineSummaryOutput, - GetPolicyGenerationInput, - GetPolicyGenerationOutput, - GetPolicyGenerationSummaryInput, - GetPolicyGenerationSummaryOutput, - GetPolicyInput, - GetPolicyOutput, - GetPolicySummaryInput, - GetPolicySummaryOutput, - GetRegistryInput, - GetRegistryOutput, - GetRegistryRecordInput, - GetRegistryRecordOutput, - GetResourcePolicyInput, - GetResourcePolicyOutput, - GetTokenVaultInput, - GetTokenVaultOutput, - GetWorkloadIdentityInput, - GetWorkloadIdentityOutput, LIST_AGENT_RUNTIMES, LIST_AGENT_RUNTIME_ENDPOINTS, LIST_AGENT_RUNTIME_VERSIONS, @@ -345,107 +155,13 @@ LIST_REGISTRY_RECORDS, LIST_TAGS_FOR_RESOURCE, LIST_WORKLOAD_IDENTITIES, - ListAgentRuntimeEndpointsInput, - ListAgentRuntimeEndpointsOutput, - ListAgentRuntimeVersionsByCapacityProviderInput, - ListAgentRuntimeVersionsByCapacityProviderOutput, - ListAgentRuntimeVersionsInput, - ListAgentRuntimeVersionsOutput, - ListAgentRuntimesInput, - ListAgentRuntimesOutput, - ListApiKeyCredentialProvidersInput, - ListApiKeyCredentialProvidersOutput, - ListBrowserProfilesInput, - ListBrowserProfilesOutput, - ListBrowsersInput, - ListBrowsersOutput, - ListCapacityProvidersInput, - ListCapacityProvidersOutput, - ListCodeInterpretersInput, - ListCodeInterpretersOutput, - ListConfigurationBundleVersionsInput, - ListConfigurationBundleVersionsOutput, - ListConfigurationBundlesInput, - ListConfigurationBundlesOutput, - ListConsentPortalsInput, - ListConsentPortalsOutput, - ListDatasetExamplesInput, - ListDatasetExamplesOutput, - ListDatasetVersionsInput, - ListDatasetVersionsOutput, - ListDatasetsInput, - ListDatasetsOutput, - ListEvaluatorsInput, - ListEvaluatorsOutput, - ListGatewayRateLimitsInput, - ListGatewayRateLimitsOutput, - ListGatewayRulesInput, - ListGatewayRulesOutput, - ListGatewayTargetsInput, - ListGatewayTargetsOutput, - ListGatewaysInput, - ListGatewaysOutput, - ListHarnessEndpointsInput, - ListHarnessEndpointsOutput, - ListHarnessVersionsInput, - ListHarnessVersionsOutput, - ListHarnessesInput, - ListHarnessesOutput, - ListMemoriesInput, - ListMemoriesOutput, - ListOauth2CredentialProvidersInput, - ListOauth2CredentialProvidersOutput, - ListOnlineEvaluationConfigsInput, - ListOnlineEvaluationConfigsOutput, - ListPaymentConnectorsInput, - ListPaymentConnectorsOutput, - ListPaymentCredentialProvidersInput, - ListPaymentCredentialProvidersOutput, - ListPaymentManagersInput, - ListPaymentManagersOutput, - ListPoliciesInput, - ListPoliciesOutput, - ListPolicyEngineSummariesInput, - ListPolicyEngineSummariesOutput, - ListPolicyEnginesInput, - ListPolicyEnginesOutput, - ListPolicyGenerationAssetsInput, - ListPolicyGenerationAssetsOutput, - ListPolicyGenerationSummariesInput, - ListPolicyGenerationSummariesOutput, - ListPolicyGenerationsInput, - ListPolicyGenerationsOutput, - ListPolicySummariesInput, - ListPolicySummariesOutput, - ListRegistriesInput, - ListRegistriesOutput, - ListRegistryRecordsInput, - ListRegistryRecordsOutput, - ListTagsForResourceInput, - ListTagsForResourceOutput, - ListWorkloadIdentitiesInput, - ListWorkloadIdentitiesOutput, PUT_RESOURCE_POLICY, - PutResourcePolicyInput, - PutResourcePolicyOutput, ROTATE_PAYMENT_CONNECTOR_CREDENTIALS, - RotatePaymentConnectorCredentialsInput, - RotatePaymentConnectorCredentialsOutput, SET_TOKEN_VAULT_CMK, START_POLICY_GENERATION, SUBMIT_REGISTRY_RECORD_FOR_APPROVAL, SYNCHRONIZE_GATEWAY_TARGETS, - SetTokenVaultCMKInput, - SetTokenVaultCMKOutput, - StartPolicyGenerationInput, - StartPolicyGenerationOutput, - SubmitRegistryRecordForApprovalInput, - SubmitRegistryRecordForApprovalOutput, - SynchronizeGatewayTargetsInput, - SynchronizeGatewayTargetsOutput, TAG_RESOURCE, - TagResourceInput, - TagResourceOutput, UNTAG_RESOURCE, UPDATE_AGENT_RUNTIME, UPDATE_AGENT_RUNTIME_ENDPOINT, @@ -474,65 +190,357 @@ UPDATE_REGISTRY_RECORD, UPDATE_REGISTRY_RECORD_STATUS, UPDATE_WORKLOAD_IDENTITY, - UntagResourceInput, - UntagResourceOutput, - UpdateAgentRuntimeEndpointInput, - UpdateAgentRuntimeEndpointOutput, - UpdateAgentRuntimeInput, - UpdateAgentRuntimeOutput, - UpdateApiKeyCredentialProviderInput, - UpdateApiKeyCredentialProviderOutput, - UpdateCapacityProviderInput, - UpdateCapacityProviderOutput, - UpdateConfigurationBundleInput, - UpdateConfigurationBundleOutput, - UpdateConsentPortalInput, - UpdateConsentPortalOutput, - UpdateDatasetExamplesInput, - UpdateDatasetExamplesOutput, - UpdateDatasetInput, - UpdateDatasetOutput, - UpdateEvaluatorInput, - UpdateEvaluatorOutput, - UpdateGatewayInput, - UpdateGatewayOutput, - UpdateGatewayRateLimitInput, - UpdateGatewayRateLimitOutput, - UpdateGatewayRuleInput, - UpdateGatewayRuleOutput, - UpdateGatewayTargetInput, - UpdateGatewayTargetOutput, - UpdateHarnessEndpointInput, - UpdateHarnessEndpointOutput, - UpdateHarnessInput, - UpdateHarnessOutput, - UpdateMemoryInput, - UpdateMemoryOutput, - UpdateOauth2CredentialProviderInput, - UpdateOauth2CredentialProviderOutput, - UpdateOnlineEvaluationConfigInput, - UpdateOnlineEvaluationConfigOutput, - UpdatePaymentConnectorInput, - UpdatePaymentConnectorOutput, - UpdatePaymentCredentialProviderInput, - UpdatePaymentCredentialProviderOutput, - UpdatePaymentManagerInput, - UpdatePaymentManagerOutput, - UpdatePolicyEngineInput, - UpdatePolicyEngineOutput, - UpdatePolicyInput, - UpdatePolicyOutput, - UpdateRegistryInput, - UpdateRegistryOutput, - UpdateRegistryRecordInput, - UpdateRegistryRecordOutput, - UpdateRegistryRecordStatusInput, - UpdateRegistryRecordStatusOutput, - UpdateWorkloadIdentityInput, - UpdateWorkloadIdentityOutput, ) from .user_agent import aws_user_agent_plugin +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .models import ( + AddDatasetExamplesInput, + AddDatasetExamplesOutput, + BatchPutGatewayRateLimitsInput, + BatchPutGatewayRateLimitsOutput, + CreateAgentRuntimeEndpointInput, + CreateAgentRuntimeEndpointOutput, + CreateAgentRuntimeInput, + CreateAgentRuntimeOutput, + CreateApiKeyCredentialProviderInput, + CreateApiKeyCredentialProviderOutput, + CreateBrowserInput, + CreateBrowserOutput, + CreateBrowserProfileInput, + CreateBrowserProfileOutput, + CreateCapacityProviderInput, + CreateCapacityProviderOutput, + CreateCodeInterpreterInput, + CreateCodeInterpreterOutput, + CreateConfigurationBundleInput, + CreateConfigurationBundleOutput, + CreateConsentPortalInput, + CreateConsentPortalOutput, + CreateDatasetInput, + CreateDatasetOutput, + CreateDatasetVersionInput, + CreateDatasetVersionOutput, + CreateEvaluatorInput, + CreateEvaluatorOutput, + CreateGatewayInput, + CreateGatewayOutput, + CreateGatewayRateLimitInput, + CreateGatewayRateLimitOutput, + CreateGatewayRuleInput, + CreateGatewayRuleOutput, + CreateGatewayTargetInput, + CreateGatewayTargetOutput, + CreateHarnessEndpointInput, + CreateHarnessEndpointOutput, + CreateHarnessInput, + CreateHarnessOutput, + CreateMemoryInput, + CreateMemoryOutput, + CreateOauth2CredentialProviderInput, + CreateOauth2CredentialProviderOutput, + CreateOnlineEvaluationConfigInput, + CreateOnlineEvaluationConfigOutput, + CreatePaymentConnectorInput, + CreatePaymentConnectorOutput, + CreatePaymentCredentialProviderInput, + CreatePaymentCredentialProviderOutput, + CreatePaymentManagerInput, + CreatePaymentManagerOutput, + CreatePolicyEngineInput, + CreatePolicyEngineOutput, + CreatePolicyInput, + CreatePolicyOutput, + CreateRegistryInput, + CreateRegistryOutput, + CreateRegistryRecordInput, + CreateRegistryRecordOutput, + CreateWorkloadIdentityInput, + CreateWorkloadIdentityOutput, + DeleteAgentRuntimeEndpointInput, + DeleteAgentRuntimeEndpointOutput, + DeleteAgentRuntimeInput, + DeleteAgentRuntimeOutput, + DeleteApiKeyCredentialProviderInput, + DeleteApiKeyCredentialProviderOutput, + DeleteBrowserInput, + DeleteBrowserOutput, + DeleteBrowserProfileInput, + DeleteBrowserProfileOutput, + DeleteCapacityProviderInput, + DeleteCapacityProviderOutput, + DeleteCodeInterpreterInput, + DeleteCodeInterpreterOutput, + DeleteConfigurationBundleInput, + DeleteConfigurationBundleOutput, + DeleteConsentPortalInput, + DeleteConsentPortalOutput, + DeleteDatasetExamplesInput, + DeleteDatasetExamplesOutput, + DeleteDatasetInput, + DeleteDatasetOutput, + DeleteEvaluatorInput, + DeleteEvaluatorOutput, + DeleteGatewayInput, + DeleteGatewayOutput, + DeleteGatewayRateLimitInput, + DeleteGatewayRateLimitOutput, + DeleteGatewayRuleInput, + DeleteGatewayRuleOutput, + DeleteGatewayTargetInput, + DeleteGatewayTargetOutput, + DeleteHarnessEndpointInput, + DeleteHarnessEndpointOutput, + DeleteHarnessInput, + DeleteHarnessOutput, + DeleteMemoryInput, + DeleteMemoryOutput, + DeleteOauth2CredentialProviderInput, + DeleteOauth2CredentialProviderOutput, + DeleteOnlineEvaluationConfigInput, + DeleteOnlineEvaluationConfigOutput, + DeletePaymentConnectorInput, + DeletePaymentConnectorOutput, + DeletePaymentCredentialProviderInput, + DeletePaymentCredentialProviderOutput, + DeletePaymentManagerInput, + DeletePaymentManagerOutput, + DeletePolicyEngineInput, + DeletePolicyEngineOutput, + DeletePolicyInput, + DeletePolicyOutput, + DeleteRegistryInput, + DeleteRegistryOutput, + DeleteRegistryRecordInput, + DeleteRegistryRecordOutput, + DeleteResourcePolicyInput, + DeleteResourcePolicyOutput, + DeleteWorkloadIdentityInput, + DeleteWorkloadIdentityOutput, + GetAgentRuntimeEndpointInput, + GetAgentRuntimeEndpointOutput, + GetAgentRuntimeInput, + GetAgentRuntimeOutput, + GetApiKeyCredentialProviderInput, + GetApiKeyCredentialProviderOutput, + GetBrowserInput, + GetBrowserOutput, + GetBrowserProfileInput, + GetBrowserProfileOutput, + GetCapacityProviderInput, + GetCapacityProviderOutput, + GetCodeInterpreterInput, + GetCodeInterpreterOutput, + GetConfigurationBundleInput, + GetConfigurationBundleOutput, + GetConfigurationBundleVersionInput, + GetConfigurationBundleVersionOutput, + GetConsentPortalInput, + GetConsentPortalOutput, + GetDatasetInput, + GetDatasetOutput, + GetEvaluatorInput, + GetEvaluatorOutput, + GetGatewayInput, + GetGatewayOutput, + GetGatewayRateLimitInput, + GetGatewayRateLimitOutput, + GetGatewayRuleInput, + GetGatewayRuleOutput, + GetGatewayTargetInput, + GetGatewayTargetOutput, + GetHarnessEndpointInput, + GetHarnessEndpointOutput, + GetHarnessInput, + GetHarnessOutput, + GetMemoryInput, + GetMemoryOutput, + GetOauth2CredentialProviderInput, + GetOauth2CredentialProviderOutput, + GetOnlineEvaluationConfigInput, + GetOnlineEvaluationConfigOutput, + GetPaymentConnectorInput, + GetPaymentConnectorOutput, + GetPaymentCredentialProviderInput, + GetPaymentCredentialProviderOutput, + GetPaymentManagerInput, + GetPaymentManagerOutput, + GetPolicyEngineInput, + GetPolicyEngineOutput, + GetPolicyEngineSummaryInput, + GetPolicyEngineSummaryOutput, + GetPolicyGenerationInput, + GetPolicyGenerationOutput, + GetPolicyGenerationSummaryInput, + GetPolicyGenerationSummaryOutput, + GetPolicyInput, + GetPolicyOutput, + GetPolicySummaryInput, + GetPolicySummaryOutput, + GetRegistryInput, + GetRegistryOutput, + GetRegistryRecordInput, + GetRegistryRecordOutput, + GetResourcePolicyInput, + GetResourcePolicyOutput, + GetTokenVaultInput, + GetTokenVaultOutput, + GetWorkloadIdentityInput, + GetWorkloadIdentityOutput, + ListAgentRuntimeEndpointsInput, + ListAgentRuntimeEndpointsOutput, + ListAgentRuntimeVersionsByCapacityProviderInput, + ListAgentRuntimeVersionsByCapacityProviderOutput, + ListAgentRuntimeVersionsInput, + ListAgentRuntimeVersionsOutput, + ListAgentRuntimesInput, + ListAgentRuntimesOutput, + ListApiKeyCredentialProvidersInput, + ListApiKeyCredentialProvidersOutput, + ListBrowserProfilesInput, + ListBrowserProfilesOutput, + ListBrowsersInput, + ListBrowsersOutput, + ListCapacityProvidersInput, + ListCapacityProvidersOutput, + ListCodeInterpretersInput, + ListCodeInterpretersOutput, + ListConfigurationBundleVersionsInput, + ListConfigurationBundleVersionsOutput, + ListConfigurationBundlesInput, + ListConfigurationBundlesOutput, + ListConsentPortalsInput, + ListConsentPortalsOutput, + ListDatasetExamplesInput, + ListDatasetExamplesOutput, + ListDatasetVersionsInput, + ListDatasetVersionsOutput, + ListDatasetsInput, + ListDatasetsOutput, + ListEvaluatorsInput, + ListEvaluatorsOutput, + ListGatewayRateLimitsInput, + ListGatewayRateLimitsOutput, + ListGatewayRulesInput, + ListGatewayRulesOutput, + ListGatewayTargetsInput, + ListGatewayTargetsOutput, + ListGatewaysInput, + ListGatewaysOutput, + ListHarnessEndpointsInput, + ListHarnessEndpointsOutput, + ListHarnessVersionsInput, + ListHarnessVersionsOutput, + ListHarnessesInput, + ListHarnessesOutput, + ListMemoriesInput, + ListMemoriesOutput, + ListOauth2CredentialProvidersInput, + ListOauth2CredentialProvidersOutput, + ListOnlineEvaluationConfigsInput, + ListOnlineEvaluationConfigsOutput, + ListPaymentConnectorsInput, + ListPaymentConnectorsOutput, + ListPaymentCredentialProvidersInput, + ListPaymentCredentialProvidersOutput, + ListPaymentManagersInput, + ListPaymentManagersOutput, + ListPoliciesInput, + ListPoliciesOutput, + ListPolicyEngineSummariesInput, + ListPolicyEngineSummariesOutput, + ListPolicyEnginesInput, + ListPolicyEnginesOutput, + ListPolicyGenerationAssetsInput, + ListPolicyGenerationAssetsOutput, + ListPolicyGenerationSummariesInput, + ListPolicyGenerationSummariesOutput, + ListPolicyGenerationsInput, + ListPolicyGenerationsOutput, + ListPolicySummariesInput, + ListPolicySummariesOutput, + ListRegistriesInput, + ListRegistriesOutput, + ListRegistryRecordsInput, + ListRegistryRecordsOutput, + ListTagsForResourceInput, + ListTagsForResourceOutput, + ListWorkloadIdentitiesInput, + ListWorkloadIdentitiesOutput, + PutResourcePolicyInput, + PutResourcePolicyOutput, + RotatePaymentConnectorCredentialsInput, + RotatePaymentConnectorCredentialsOutput, + SetTokenVaultCMKInput, + SetTokenVaultCMKOutput, + StartPolicyGenerationInput, + StartPolicyGenerationOutput, + SubmitRegistryRecordForApprovalInput, + SubmitRegistryRecordForApprovalOutput, + SynchronizeGatewayTargetsInput, + SynchronizeGatewayTargetsOutput, + TagResourceInput, + TagResourceOutput, + UntagResourceInput, + UntagResourceOutput, + UpdateAgentRuntimeEndpointInput, + UpdateAgentRuntimeEndpointOutput, + UpdateAgentRuntimeInput, + UpdateAgentRuntimeOutput, + UpdateApiKeyCredentialProviderInput, + UpdateApiKeyCredentialProviderOutput, + UpdateCapacityProviderInput, + UpdateCapacityProviderOutput, + UpdateConfigurationBundleInput, + UpdateConfigurationBundleOutput, + UpdateConsentPortalInput, + UpdateConsentPortalOutput, + UpdateDatasetExamplesInput, + UpdateDatasetExamplesOutput, + UpdateDatasetInput, + UpdateDatasetOutput, + UpdateEvaluatorInput, + UpdateEvaluatorOutput, + UpdateGatewayInput, + UpdateGatewayOutput, + UpdateGatewayRateLimitInput, + UpdateGatewayRateLimitOutput, + UpdateGatewayRuleInput, + UpdateGatewayRuleOutput, + UpdateGatewayTargetInput, + UpdateGatewayTargetOutput, + UpdateHarnessEndpointInput, + UpdateHarnessEndpointOutput, + UpdateHarnessInput, + UpdateHarnessOutput, + UpdateMemoryInput, + UpdateMemoryOutput, + UpdateOauth2CredentialProviderInput, + UpdateOauth2CredentialProviderOutput, + UpdateOnlineEvaluationConfigInput, + UpdateOnlineEvaluationConfigOutput, + UpdatePaymentConnectorInput, + UpdatePaymentConnectorOutput, + UpdatePaymentCredentialProviderInput, + UpdatePaymentCredentialProviderOutput, + UpdatePaymentManagerInput, + UpdatePaymentManagerOutput, + UpdatePolicyEngineInput, + UpdatePolicyEngineOutput, + UpdatePolicyInput, + UpdatePolicyOutput, + UpdateRegistryInput, + UpdateRegistryOutput, + UpdateRegistryRecordInput, + UpdateRegistryRecordOutput, + UpdateRegistryRecordStatusInput, + UpdateRegistryRecordStatusOutput, + UpdateWorkloadIdentityInput, + UpdateWorkloadIdentityOutput, + ) + logger = logging.getLogger(__name__) @@ -602,12 +610,12 @@ async def _post_setup(self, config: AsyncBedrockAgentCoreControlConfig) -> None: config_file = await config_context.parsed_profiles() if config_context.profile_source is ConfigSource.OVERRIDE: profile_name = config_context.profile_name - config.aws_credentials_identity_resolver = await IdentityChain.create( + config.aws_credentials_identity_resolver = await AsyncIdentityChain.create( AWSCredentialsIdentity, config_file=config_file, profile_name=profile_name, region_override=config.region, - http_client=cast(HTTPClient | None, config.transport), + http_client=cast(AsyncHTTPClient | None, config.transport), ) async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( @@ -616,7 +624,7 @@ async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( operation: APIOperation[I, O], default_plugins: list[Plugin], plugins: list[Plugin] | None, - ) -> tuple[RequestPipeline[Any, Any], ClientCall[I, O]]: + ) -> tuple[AsyncRequestPipeline[Any, Any], AsyncClientCall[I, O]]: if self._closed: raise RuntimeError( "Cannot invoke an operation on a client that has been closed." diff --git a/clients/aws-sdk-bedrock-agentcore-control/src/aws_sdk_bedrock_agentcore_control/config.py b/clients/aws-sdk-bedrock-agentcore-control/src/aws_sdk_bedrock_agentcore_control/config.py index 577095a9..0f914e2b 100644 --- a/clients/aws-sdk-bedrock-agentcore-control/src/aws_sdk_bedrock_agentcore_control/config.py +++ b/clients/aws-sdk-bedrock-agentcore-control/src/aws_sdk_bedrock_agentcore_control/config.py @@ -1,699 +1,766 @@ # Code generated by smithy-python-codegen DO NOT EDIT. from dataclasses import dataclass, field -from typing import Any, Callable, ClassVar, Self, TypeAlias, Union, Unpack +from typing import ( + Any, + Callable, + ClassVar, + Self, + TYPE_CHECKING, + TypeAlias, + Union, + Unpack, +) -from smithy_aws_core.aio.protocols import RestJsonClientProtocol -from smithy_aws_core.auth import SigV4AuthScheme -from smithy_aws_core.config import AwsConfigOverrides, FileSystem -from smithy_aws_core.config.aws_config import AsyncAwsConfig -from smithy_aws_core.config.resolvers import EndpointUriResolver -from smithy_aws_core.config.types import FieldSpec -from smithy_aws_core.endpoints.standard_regional import ( - StandardRegionalEndpointsResolver, +from smithy_aws_core.aio.auth.sigv4 import AsyncSigV4AuthScheme +from smithy_aws_core.aio.config import AsyncFileSystem +from smithy_aws_core.aio.config.aws_config import AsyncAwsConfig, AwsConfigOverrides +from smithy_aws_core.aio.config.resolvers import EndpointUriResolver +from smithy_aws_core.aio.endpoints.standard_regional import ( + AsyncStandardRegionalEndpointsResolver, ) +from smithy_aws_core.aio.protocols import AsyncRestJsonClientProtocol +from smithy_aws_core.config.types import FieldSpec from smithy_aws_core.identity import AWSCredentialsIdentity, AWSIdentityProperties -from smithy_core.aio.interfaces import ( - ClientProtocol, - EndpointResolver, - ProtocolConstructor, - ProtocolSettings, -) -from smithy_core.aio.interfaces.auth import AuthScheme -from smithy_core.aio.interfaces.identity import IdentityResolver -from smithy_core.interceptors import Interceptor +from smithy_core.aio.interfaces import AsyncClientProtocol, AsyncEndpointResolver +from smithy_core.aio.interfaces.auth import AsyncAuthScheme +from smithy_core.aio.interfaces.identity import AsyncIdentityResolver +from smithy_core.interfaces import ProtocolConstructor, ProtocolSettings from smithy_core.interfaces.auth import AuthSchemeResolver from smithy_core.shapes import ShapeID from smithy_http.aio.aiohttp import AIOHTTPClient +from ._private.schemas import AMAZON_BEDROCK_AGENT_CORE_CONTROL from .auth import HTTPAuthSchemeResolver -from .models import ( - AddDatasetExamplesInput, - AddDatasetExamplesOutput, - BatchPutGatewayRateLimitsInput, - BatchPutGatewayRateLimitsOutput, - CreateAgentRuntimeEndpointInput, - CreateAgentRuntimeEndpointOutput, - CreateAgentRuntimeInput, - CreateAgentRuntimeOutput, - CreateApiKeyCredentialProviderInput, - CreateApiKeyCredentialProviderOutput, - CreateBrowserInput, - CreateBrowserOutput, - CreateBrowserProfileInput, - CreateBrowserProfileOutput, - CreateCapacityProviderInput, - CreateCapacityProviderOutput, - CreateCodeInterpreterInput, - CreateCodeInterpreterOutput, - CreateConfigurationBundleInput, - CreateConfigurationBundleOutput, - CreateConsentPortalInput, - CreateConsentPortalOutput, - CreateDatasetInput, - CreateDatasetOutput, - CreateDatasetVersionInput, - CreateDatasetVersionOutput, - CreateEvaluatorInput, - CreateEvaluatorOutput, - CreateGatewayInput, - CreateGatewayOutput, - CreateGatewayRateLimitInput, - CreateGatewayRateLimitOutput, - CreateGatewayRuleInput, - CreateGatewayRuleOutput, - CreateGatewayTargetInput, - CreateGatewayTargetOutput, - CreateHarnessEndpointInput, - CreateHarnessEndpointOutput, - CreateHarnessInput, - CreateHarnessOutput, - CreateMemoryInput, - CreateMemoryOutput, - CreateOauth2CredentialProviderInput, - CreateOauth2CredentialProviderOutput, - CreateOnlineEvaluationConfigInput, - CreateOnlineEvaluationConfigOutput, - CreatePaymentConnectorInput, - CreatePaymentConnectorOutput, - CreatePaymentCredentialProviderInput, - CreatePaymentCredentialProviderOutput, - CreatePaymentManagerInput, - CreatePaymentManagerOutput, - CreatePolicyEngineInput, - CreatePolicyEngineOutput, - CreatePolicyInput, - CreatePolicyOutput, - CreateRegistryInput, - CreateRegistryOutput, - CreateRegistryRecordInput, - CreateRegistryRecordOutput, - CreateWorkloadIdentityInput, - CreateWorkloadIdentityOutput, - DeleteAgentRuntimeEndpointInput, - DeleteAgentRuntimeEndpointOutput, - DeleteAgentRuntimeInput, - DeleteAgentRuntimeOutput, - DeleteApiKeyCredentialProviderInput, - DeleteApiKeyCredentialProviderOutput, - DeleteBrowserInput, - DeleteBrowserOutput, - DeleteBrowserProfileInput, - DeleteBrowserProfileOutput, - DeleteCapacityProviderInput, - DeleteCapacityProviderOutput, - DeleteCodeInterpreterInput, - DeleteCodeInterpreterOutput, - DeleteConfigurationBundleInput, - DeleteConfigurationBundleOutput, - DeleteConsentPortalInput, - DeleteConsentPortalOutput, - DeleteDatasetExamplesInput, - DeleteDatasetExamplesOutput, - DeleteDatasetInput, - DeleteDatasetOutput, - DeleteEvaluatorInput, - DeleteEvaluatorOutput, - DeleteGatewayInput, - DeleteGatewayOutput, - DeleteGatewayRateLimitInput, - DeleteGatewayRateLimitOutput, - DeleteGatewayRuleInput, - DeleteGatewayRuleOutput, - DeleteGatewayTargetInput, - DeleteGatewayTargetOutput, - DeleteHarnessEndpointInput, - DeleteHarnessEndpointOutput, - DeleteHarnessInput, - DeleteHarnessOutput, - DeleteMemoryInput, - DeleteMemoryOutput, - DeleteOauth2CredentialProviderInput, - DeleteOauth2CredentialProviderOutput, - DeleteOnlineEvaluationConfigInput, - DeleteOnlineEvaluationConfigOutput, - DeletePaymentConnectorInput, - DeletePaymentConnectorOutput, - DeletePaymentCredentialProviderInput, - DeletePaymentCredentialProviderOutput, - DeletePaymentManagerInput, - DeletePaymentManagerOutput, - DeletePolicyEngineInput, - DeletePolicyEngineOutput, - DeletePolicyInput, - DeletePolicyOutput, - DeleteRegistryInput, - DeleteRegistryOutput, - DeleteRegistryRecordInput, - DeleteRegistryRecordOutput, - DeleteResourcePolicyInput, - DeleteResourcePolicyOutput, - DeleteWorkloadIdentityInput, - DeleteWorkloadIdentityOutput, - GetAgentRuntimeEndpointInput, - GetAgentRuntimeEndpointOutput, - GetAgentRuntimeInput, - GetAgentRuntimeOutput, - GetApiKeyCredentialProviderInput, - GetApiKeyCredentialProviderOutput, - GetBrowserInput, - GetBrowserOutput, - GetBrowserProfileInput, - GetBrowserProfileOutput, - GetCapacityProviderInput, - GetCapacityProviderOutput, - GetCodeInterpreterInput, - GetCodeInterpreterOutput, - GetConfigurationBundleInput, - GetConfigurationBundleOutput, - GetConfigurationBundleVersionInput, - GetConfigurationBundleVersionOutput, - GetConsentPortalInput, - GetConsentPortalOutput, - GetDatasetInput, - GetDatasetOutput, - GetEvaluatorInput, - GetEvaluatorOutput, - GetGatewayInput, - GetGatewayOutput, - GetGatewayRateLimitInput, - GetGatewayRateLimitOutput, - GetGatewayRuleInput, - GetGatewayRuleOutput, - GetGatewayTargetInput, - GetGatewayTargetOutput, - GetHarnessEndpointInput, - GetHarnessEndpointOutput, - GetHarnessInput, - GetHarnessOutput, - GetMemoryInput, - GetMemoryOutput, - GetOauth2CredentialProviderInput, - GetOauth2CredentialProviderOutput, - GetOnlineEvaluationConfigInput, - GetOnlineEvaluationConfigOutput, - GetPaymentConnectorInput, - GetPaymentConnectorOutput, - GetPaymentCredentialProviderInput, - GetPaymentCredentialProviderOutput, - GetPaymentManagerInput, - GetPaymentManagerOutput, - GetPolicyEngineInput, - GetPolicyEngineOutput, - GetPolicyEngineSummaryInput, - GetPolicyEngineSummaryOutput, - GetPolicyGenerationInput, - GetPolicyGenerationOutput, - GetPolicyGenerationSummaryInput, - GetPolicyGenerationSummaryOutput, - GetPolicyInput, - GetPolicyOutput, - GetPolicySummaryInput, - GetPolicySummaryOutput, - GetRegistryInput, - GetRegistryOutput, - GetRegistryRecordInput, - GetRegistryRecordOutput, - GetResourcePolicyInput, - GetResourcePolicyOutput, - GetTokenVaultInput, - GetTokenVaultOutput, - GetWorkloadIdentityInput, - GetWorkloadIdentityOutput, - ListAgentRuntimeEndpointsInput, - ListAgentRuntimeEndpointsOutput, - ListAgentRuntimeVersionsByCapacityProviderInput, - ListAgentRuntimeVersionsByCapacityProviderOutput, - ListAgentRuntimeVersionsInput, - ListAgentRuntimeVersionsOutput, - ListAgentRuntimesInput, - ListAgentRuntimesOutput, - ListApiKeyCredentialProvidersInput, - ListApiKeyCredentialProvidersOutput, - ListBrowserProfilesInput, - ListBrowserProfilesOutput, - ListBrowsersInput, - ListBrowsersOutput, - ListCapacityProvidersInput, - ListCapacityProvidersOutput, - ListCodeInterpretersInput, - ListCodeInterpretersOutput, - ListConfigurationBundleVersionsInput, - ListConfigurationBundleVersionsOutput, - ListConfigurationBundlesInput, - ListConfigurationBundlesOutput, - ListConsentPortalsInput, - ListConsentPortalsOutput, - ListDatasetExamplesInput, - ListDatasetExamplesOutput, - ListDatasetVersionsInput, - ListDatasetVersionsOutput, - ListDatasetsInput, - ListDatasetsOutput, - ListEvaluatorsInput, - ListEvaluatorsOutput, - ListGatewayRateLimitsInput, - ListGatewayRateLimitsOutput, - ListGatewayRulesInput, - ListGatewayRulesOutput, - ListGatewayTargetsInput, - ListGatewayTargetsOutput, - ListGatewaysInput, - ListGatewaysOutput, - ListHarnessEndpointsInput, - ListHarnessEndpointsOutput, - ListHarnessVersionsInput, - ListHarnessVersionsOutput, - ListHarnessesInput, - ListHarnessesOutput, - ListMemoriesInput, - ListMemoriesOutput, - ListOauth2CredentialProvidersInput, - ListOauth2CredentialProvidersOutput, - ListOnlineEvaluationConfigsInput, - ListOnlineEvaluationConfigsOutput, - ListPaymentConnectorsInput, - ListPaymentConnectorsOutput, - ListPaymentCredentialProvidersInput, - ListPaymentCredentialProvidersOutput, - ListPaymentManagersInput, - ListPaymentManagersOutput, - ListPoliciesInput, - ListPoliciesOutput, - ListPolicyEngineSummariesInput, - ListPolicyEngineSummariesOutput, - ListPolicyEnginesInput, - ListPolicyEnginesOutput, - ListPolicyGenerationAssetsInput, - ListPolicyGenerationAssetsOutput, - ListPolicyGenerationSummariesInput, - ListPolicyGenerationSummariesOutput, - ListPolicyGenerationsInput, - ListPolicyGenerationsOutput, - ListPolicySummariesInput, - ListPolicySummariesOutput, - ListRegistriesInput, - ListRegistriesOutput, - ListRegistryRecordsInput, - ListRegistryRecordsOutput, - ListTagsForResourceInput, - ListTagsForResourceOutput, - ListWorkloadIdentitiesInput, - ListWorkloadIdentitiesOutput, - PutResourcePolicyInput, - PutResourcePolicyOutput, - RotatePaymentConnectorCredentialsInput, - RotatePaymentConnectorCredentialsOutput, - SetTokenVaultCMKInput, - SetTokenVaultCMKOutput, - StartPolicyGenerationInput, - StartPolicyGenerationOutput, - SubmitRegistryRecordForApprovalInput, - SubmitRegistryRecordForApprovalOutput, - SynchronizeGatewayTargetsInput, - SynchronizeGatewayTargetsOutput, - TagResourceInput, - TagResourceOutput, - UntagResourceInput, - UntagResourceOutput, - UpdateAgentRuntimeEndpointInput, - UpdateAgentRuntimeEndpointOutput, - UpdateAgentRuntimeInput, - UpdateAgentRuntimeOutput, - UpdateApiKeyCredentialProviderInput, - UpdateApiKeyCredentialProviderOutput, - UpdateCapacityProviderInput, - UpdateCapacityProviderOutput, - UpdateConfigurationBundleInput, - UpdateConfigurationBundleOutput, - UpdateConsentPortalInput, - UpdateConsentPortalOutput, - UpdateDatasetExamplesInput, - UpdateDatasetExamplesOutput, - UpdateDatasetInput, - UpdateDatasetOutput, - UpdateEvaluatorInput, - UpdateEvaluatorOutput, - UpdateGatewayInput, - UpdateGatewayOutput, - UpdateGatewayRateLimitInput, - UpdateGatewayRateLimitOutput, - UpdateGatewayRuleInput, - UpdateGatewayRuleOutput, - UpdateGatewayTargetInput, - UpdateGatewayTargetOutput, - UpdateHarnessEndpointInput, - UpdateHarnessEndpointOutput, - UpdateHarnessInput, - UpdateHarnessOutput, - UpdateMemoryInput, - UpdateMemoryOutput, - UpdateOauth2CredentialProviderInput, - UpdateOauth2CredentialProviderOutput, - UpdateOnlineEvaluationConfigInput, - UpdateOnlineEvaluationConfigOutput, - UpdatePaymentConnectorInput, - UpdatePaymentConnectorOutput, - UpdatePaymentCredentialProviderInput, - UpdatePaymentCredentialProviderOutput, - UpdatePaymentManagerInput, - UpdatePaymentManagerOutput, - UpdatePolicyEngineInput, - UpdatePolicyEngineOutput, - UpdatePolicyInput, - UpdatePolicyOutput, - UpdateRegistryInput, - UpdateRegistryOutput, - UpdateRegistryRecordInput, - UpdateRegistryRecordOutput, - UpdateRegistryRecordStatusInput, - UpdateRegistryRecordStatusOutput, - UpdateWorkloadIdentityInput, - UpdateWorkloadIdentityOutput, -) -_ServiceInterceptor = Union[ - Interceptor[AddDatasetExamplesInput, AddDatasetExamplesOutput, Any, Any], - Interceptor[ - BatchPutGatewayRateLimitsInput, BatchPutGatewayRateLimitsOutput, Any, Any - ], - Interceptor[CreateAgentRuntimeInput, CreateAgentRuntimeOutput, Any, Any], - Interceptor[ - CreateAgentRuntimeEndpointInput, CreateAgentRuntimeEndpointOutput, Any, Any - ], - Interceptor[ +if TYPE_CHECKING: + from smithy_core.interceptors import Interceptor + from .models import ( + AddDatasetExamplesInput, + AddDatasetExamplesOutput, + BatchPutGatewayRateLimitsInput, + BatchPutGatewayRateLimitsOutput, + CreateAgentRuntimeEndpointInput, + CreateAgentRuntimeEndpointOutput, + CreateAgentRuntimeInput, + CreateAgentRuntimeOutput, CreateApiKeyCredentialProviderInput, CreateApiKeyCredentialProviderOutput, - Any, - Any, - ], - Interceptor[CreateBrowserInput, CreateBrowserOutput, Any, Any], - Interceptor[CreateBrowserProfileInput, CreateBrowserProfileOutput, Any, Any], - Interceptor[CreateCapacityProviderInput, CreateCapacityProviderOutput, Any, Any], - Interceptor[CreateCodeInterpreterInput, CreateCodeInterpreterOutput, Any, Any], - Interceptor[ - CreateConfigurationBundleInput, CreateConfigurationBundleOutput, Any, Any - ], - Interceptor[CreateConsentPortalInput, CreateConsentPortalOutput, Any, Any], - Interceptor[CreateDatasetInput, CreateDatasetOutput, Any, Any], - Interceptor[CreateDatasetVersionInput, CreateDatasetVersionOutput, Any, Any], - Interceptor[CreateEvaluatorInput, CreateEvaluatorOutput, Any, Any], - Interceptor[CreateGatewayInput, CreateGatewayOutput, Any, Any], - Interceptor[CreateGatewayRateLimitInput, CreateGatewayRateLimitOutput, Any, Any], - Interceptor[CreateGatewayRuleInput, CreateGatewayRuleOutput, Any, Any], - Interceptor[CreateGatewayTargetInput, CreateGatewayTargetOutput, Any, Any], - Interceptor[CreateHarnessInput, CreateHarnessOutput, Any, Any], - Interceptor[CreateHarnessEndpointInput, CreateHarnessEndpointOutput, Any, Any], - Interceptor[CreateMemoryInput, CreateMemoryOutput, Any, Any], - Interceptor[ + CreateBrowserInput, + CreateBrowserOutput, + CreateBrowserProfileInput, + CreateBrowserProfileOutput, + CreateCapacityProviderInput, + CreateCapacityProviderOutput, + CreateCodeInterpreterInput, + CreateCodeInterpreterOutput, + CreateConfigurationBundleInput, + CreateConfigurationBundleOutput, + CreateConsentPortalInput, + CreateConsentPortalOutput, + CreateDatasetInput, + CreateDatasetOutput, + CreateDatasetVersionInput, + CreateDatasetVersionOutput, + CreateEvaluatorInput, + CreateEvaluatorOutput, + CreateGatewayInput, + CreateGatewayOutput, + CreateGatewayRateLimitInput, + CreateGatewayRateLimitOutput, + CreateGatewayRuleInput, + CreateGatewayRuleOutput, + CreateGatewayTargetInput, + CreateGatewayTargetOutput, + CreateHarnessEndpointInput, + CreateHarnessEndpointOutput, + CreateHarnessInput, + CreateHarnessOutput, + CreateMemoryInput, + CreateMemoryOutput, CreateOauth2CredentialProviderInput, CreateOauth2CredentialProviderOutput, - Any, - Any, - ], - Interceptor[ - CreateOnlineEvaluationConfigInput, CreateOnlineEvaluationConfigOutput, Any, Any - ], - Interceptor[CreatePaymentConnectorInput, CreatePaymentConnectorOutput, Any, Any], - Interceptor[ + CreateOnlineEvaluationConfigInput, + CreateOnlineEvaluationConfigOutput, + CreatePaymentConnectorInput, + CreatePaymentConnectorOutput, CreatePaymentCredentialProviderInput, CreatePaymentCredentialProviderOutput, - Any, - Any, - ], - Interceptor[CreatePaymentManagerInput, CreatePaymentManagerOutput, Any, Any], - Interceptor[CreatePolicyInput, CreatePolicyOutput, Any, Any], - Interceptor[CreatePolicyEngineInput, CreatePolicyEngineOutput, Any, Any], - Interceptor[CreateRegistryInput, CreateRegistryOutput, Any, Any], - Interceptor[CreateRegistryRecordInput, CreateRegistryRecordOutput, Any, Any], - Interceptor[CreateWorkloadIdentityInput, CreateWorkloadIdentityOutput, Any, Any], - Interceptor[DeleteAgentRuntimeInput, DeleteAgentRuntimeOutput, Any, Any], - Interceptor[ - DeleteAgentRuntimeEndpointInput, DeleteAgentRuntimeEndpointOutput, Any, Any - ], - Interceptor[ + CreatePaymentManagerInput, + CreatePaymentManagerOutput, + CreatePolicyEngineInput, + CreatePolicyEngineOutput, + CreatePolicyInput, + CreatePolicyOutput, + CreateRegistryInput, + CreateRegistryOutput, + CreateRegistryRecordInput, + CreateRegistryRecordOutput, + CreateWorkloadIdentityInput, + CreateWorkloadIdentityOutput, + DeleteAgentRuntimeEndpointInput, + DeleteAgentRuntimeEndpointOutput, + DeleteAgentRuntimeInput, + DeleteAgentRuntimeOutput, DeleteApiKeyCredentialProviderInput, DeleteApiKeyCredentialProviderOutput, - Any, - Any, - ], - Interceptor[DeleteBrowserInput, DeleteBrowserOutput, Any, Any], - Interceptor[DeleteBrowserProfileInput, DeleteBrowserProfileOutput, Any, Any], - Interceptor[DeleteCapacityProviderInput, DeleteCapacityProviderOutput, Any, Any], - Interceptor[DeleteCodeInterpreterInput, DeleteCodeInterpreterOutput, Any, Any], - Interceptor[ - DeleteConfigurationBundleInput, DeleteConfigurationBundleOutput, Any, Any - ], - Interceptor[DeleteConsentPortalInput, DeleteConsentPortalOutput, Any, Any], - Interceptor[DeleteDatasetInput, DeleteDatasetOutput, Any, Any], - Interceptor[DeleteDatasetExamplesInput, DeleteDatasetExamplesOutput, Any, Any], - Interceptor[DeleteEvaluatorInput, DeleteEvaluatorOutput, Any, Any], - Interceptor[DeleteGatewayInput, DeleteGatewayOutput, Any, Any], - Interceptor[DeleteGatewayRateLimitInput, DeleteGatewayRateLimitOutput, Any, Any], - Interceptor[DeleteGatewayRuleInput, DeleteGatewayRuleOutput, Any, Any], - Interceptor[DeleteGatewayTargetInput, DeleteGatewayTargetOutput, Any, Any], - Interceptor[DeleteHarnessInput, DeleteHarnessOutput, Any, Any], - Interceptor[DeleteHarnessEndpointInput, DeleteHarnessEndpointOutput, Any, Any], - Interceptor[DeleteMemoryInput, DeleteMemoryOutput, Any, Any], - Interceptor[ + DeleteBrowserInput, + DeleteBrowserOutput, + DeleteBrowserProfileInput, + DeleteBrowserProfileOutput, + DeleteCapacityProviderInput, + DeleteCapacityProviderOutput, + DeleteCodeInterpreterInput, + DeleteCodeInterpreterOutput, + DeleteConfigurationBundleInput, + DeleteConfigurationBundleOutput, + DeleteConsentPortalInput, + DeleteConsentPortalOutput, + DeleteDatasetExamplesInput, + DeleteDatasetExamplesOutput, + DeleteDatasetInput, + DeleteDatasetOutput, + DeleteEvaluatorInput, + DeleteEvaluatorOutput, + DeleteGatewayInput, + DeleteGatewayOutput, + DeleteGatewayRateLimitInput, + DeleteGatewayRateLimitOutput, + DeleteGatewayRuleInput, + DeleteGatewayRuleOutput, + DeleteGatewayTargetInput, + DeleteGatewayTargetOutput, + DeleteHarnessEndpointInput, + DeleteHarnessEndpointOutput, + DeleteHarnessInput, + DeleteHarnessOutput, + DeleteMemoryInput, + DeleteMemoryOutput, DeleteOauth2CredentialProviderInput, DeleteOauth2CredentialProviderOutput, - Any, - Any, - ], - Interceptor[ - DeleteOnlineEvaluationConfigInput, DeleteOnlineEvaluationConfigOutput, Any, Any - ], - Interceptor[DeletePaymentConnectorInput, DeletePaymentConnectorOutput, Any, Any], - Interceptor[ + DeleteOnlineEvaluationConfigInput, + DeleteOnlineEvaluationConfigOutput, + DeletePaymentConnectorInput, + DeletePaymentConnectorOutput, DeletePaymentCredentialProviderInput, DeletePaymentCredentialProviderOutput, - Any, - Any, - ], - Interceptor[DeletePaymentManagerInput, DeletePaymentManagerOutput, Any, Any], - Interceptor[DeletePolicyInput, DeletePolicyOutput, Any, Any], - Interceptor[DeletePolicyEngineInput, DeletePolicyEngineOutput, Any, Any], - Interceptor[DeleteRegistryInput, DeleteRegistryOutput, Any, Any], - Interceptor[DeleteRegistryRecordInput, DeleteRegistryRecordOutput, Any, Any], - Interceptor[DeleteResourcePolicyInput, DeleteResourcePolicyOutput, Any, Any], - Interceptor[DeleteWorkloadIdentityInput, DeleteWorkloadIdentityOutput, Any, Any], - Interceptor[GetAgentRuntimeInput, GetAgentRuntimeOutput, Any, Any], - Interceptor[GetAgentRuntimeEndpointInput, GetAgentRuntimeEndpointOutput, Any, Any], - Interceptor[ - GetApiKeyCredentialProviderInput, GetApiKeyCredentialProviderOutput, Any, Any - ], - Interceptor[GetBrowserInput, GetBrowserOutput, Any, Any], - Interceptor[GetBrowserProfileInput, GetBrowserProfileOutput, Any, Any], - Interceptor[GetCapacityProviderInput, GetCapacityProviderOutput, Any, Any], - Interceptor[GetCodeInterpreterInput, GetCodeInterpreterOutput, Any, Any], - Interceptor[GetConfigurationBundleInput, GetConfigurationBundleOutput, Any, Any], - Interceptor[ + DeletePaymentManagerInput, + DeletePaymentManagerOutput, + DeletePolicyEngineInput, + DeletePolicyEngineOutput, + DeletePolicyInput, + DeletePolicyOutput, + DeleteRegistryInput, + DeleteRegistryOutput, + DeleteRegistryRecordInput, + DeleteRegistryRecordOutput, + DeleteResourcePolicyInput, + DeleteResourcePolicyOutput, + DeleteWorkloadIdentityInput, + DeleteWorkloadIdentityOutput, + GetAgentRuntimeEndpointInput, + GetAgentRuntimeEndpointOutput, + GetAgentRuntimeInput, + GetAgentRuntimeOutput, + GetApiKeyCredentialProviderInput, + GetApiKeyCredentialProviderOutput, + GetBrowserInput, + GetBrowserOutput, + GetBrowserProfileInput, + GetBrowserProfileOutput, + GetCapacityProviderInput, + GetCapacityProviderOutput, + GetCodeInterpreterInput, + GetCodeInterpreterOutput, + GetConfigurationBundleInput, + GetConfigurationBundleOutput, GetConfigurationBundleVersionInput, GetConfigurationBundleVersionOutput, - Any, - Any, - ], - Interceptor[GetConsentPortalInput, GetConsentPortalOutput, Any, Any], - Interceptor[GetDatasetInput, GetDatasetOutput, Any, Any], - Interceptor[GetEvaluatorInput, GetEvaluatorOutput, Any, Any], - Interceptor[GetGatewayInput, GetGatewayOutput, Any, Any], - Interceptor[GetGatewayRateLimitInput, GetGatewayRateLimitOutput, Any, Any], - Interceptor[GetGatewayRuleInput, GetGatewayRuleOutput, Any, Any], - Interceptor[GetGatewayTargetInput, GetGatewayTargetOutput, Any, Any], - Interceptor[GetHarnessInput, GetHarnessOutput, Any, Any], - Interceptor[GetHarnessEndpointInput, GetHarnessEndpointOutput, Any, Any], - Interceptor[GetMemoryInput, GetMemoryOutput, Any, Any], - Interceptor[ - GetOauth2CredentialProviderInput, GetOauth2CredentialProviderOutput, Any, Any - ], - Interceptor[ - GetOnlineEvaluationConfigInput, GetOnlineEvaluationConfigOutput, Any, Any - ], - Interceptor[GetPaymentConnectorInput, GetPaymentConnectorOutput, Any, Any], - Interceptor[ - GetPaymentCredentialProviderInput, GetPaymentCredentialProviderOutput, Any, Any - ], - Interceptor[GetPaymentManagerInput, GetPaymentManagerOutput, Any, Any], - Interceptor[GetPolicyInput, GetPolicyOutput, Any, Any], - Interceptor[GetPolicyEngineInput, GetPolicyEngineOutput, Any, Any], - Interceptor[GetPolicyEngineSummaryInput, GetPolicyEngineSummaryOutput, Any, Any], - Interceptor[GetPolicyGenerationInput, GetPolicyGenerationOutput, Any, Any], - Interceptor[ - GetPolicyGenerationSummaryInput, GetPolicyGenerationSummaryOutput, Any, Any - ], - Interceptor[GetPolicySummaryInput, GetPolicySummaryOutput, Any, Any], - Interceptor[GetRegistryInput, GetRegistryOutput, Any, Any], - Interceptor[GetRegistryRecordInput, GetRegistryRecordOutput, Any, Any], - Interceptor[GetResourcePolicyInput, GetResourcePolicyOutput, Any, Any], - Interceptor[GetTokenVaultInput, GetTokenVaultOutput, Any, Any], - Interceptor[GetWorkloadIdentityInput, GetWorkloadIdentityOutput, Any, Any], - Interceptor[ - ListAgentRuntimeEndpointsInput, ListAgentRuntimeEndpointsOutput, Any, Any - ], - Interceptor[ListAgentRuntimesInput, ListAgentRuntimesOutput, Any, Any], - Interceptor[ - ListAgentRuntimeVersionsInput, ListAgentRuntimeVersionsOutput, Any, Any - ], - Interceptor[ + GetConsentPortalInput, + GetConsentPortalOutput, + GetDatasetInput, + GetDatasetOutput, + GetEvaluatorInput, + GetEvaluatorOutput, + GetGatewayInput, + GetGatewayOutput, + GetGatewayRateLimitInput, + GetGatewayRateLimitOutput, + GetGatewayRuleInput, + GetGatewayRuleOutput, + GetGatewayTargetInput, + GetGatewayTargetOutput, + GetHarnessEndpointInput, + GetHarnessEndpointOutput, + GetHarnessInput, + GetHarnessOutput, + GetMemoryInput, + GetMemoryOutput, + GetOauth2CredentialProviderInput, + GetOauth2CredentialProviderOutput, + GetOnlineEvaluationConfigInput, + GetOnlineEvaluationConfigOutput, + GetPaymentConnectorInput, + GetPaymentConnectorOutput, + GetPaymentCredentialProviderInput, + GetPaymentCredentialProviderOutput, + GetPaymentManagerInput, + GetPaymentManagerOutput, + GetPolicyEngineInput, + GetPolicyEngineOutput, + GetPolicyEngineSummaryInput, + GetPolicyEngineSummaryOutput, + GetPolicyGenerationInput, + GetPolicyGenerationOutput, + GetPolicyGenerationSummaryInput, + GetPolicyGenerationSummaryOutput, + GetPolicyInput, + GetPolicyOutput, + GetPolicySummaryInput, + GetPolicySummaryOutput, + GetRegistryInput, + GetRegistryOutput, + GetRegistryRecordInput, + GetRegistryRecordOutput, + GetResourcePolicyInput, + GetResourcePolicyOutput, + GetTokenVaultInput, + GetTokenVaultOutput, + GetWorkloadIdentityInput, + GetWorkloadIdentityOutput, + ListAgentRuntimeEndpointsInput, + ListAgentRuntimeEndpointsOutput, ListAgentRuntimeVersionsByCapacityProviderInput, ListAgentRuntimeVersionsByCapacityProviderOutput, - Any, - Any, - ], - Interceptor[ + ListAgentRuntimeVersionsInput, + ListAgentRuntimeVersionsOutput, + ListAgentRuntimesInput, + ListAgentRuntimesOutput, ListApiKeyCredentialProvidersInput, ListApiKeyCredentialProvidersOutput, - Any, - Any, - ], - Interceptor[ListBrowserProfilesInput, ListBrowserProfilesOutput, Any, Any], - Interceptor[ListBrowsersInput, ListBrowsersOutput, Any, Any], - Interceptor[ListCapacityProvidersInput, ListCapacityProvidersOutput, Any, Any], - Interceptor[ListCodeInterpretersInput, ListCodeInterpretersOutput, Any, Any], - Interceptor[ - ListConfigurationBundlesInput, ListConfigurationBundlesOutput, Any, Any - ], - Interceptor[ + ListBrowserProfilesInput, + ListBrowserProfilesOutput, + ListBrowsersInput, + ListBrowsersOutput, + ListCapacityProvidersInput, + ListCapacityProvidersOutput, + ListCodeInterpretersInput, + ListCodeInterpretersOutput, ListConfigurationBundleVersionsInput, ListConfigurationBundleVersionsOutput, - Any, - Any, - ], - Interceptor[ListConsentPortalsInput, ListConsentPortalsOutput, Any, Any], - Interceptor[ListDatasetExamplesInput, ListDatasetExamplesOutput, Any, Any], - Interceptor[ListDatasetsInput, ListDatasetsOutput, Any, Any], - Interceptor[ListDatasetVersionsInput, ListDatasetVersionsOutput, Any, Any], - Interceptor[ListEvaluatorsInput, ListEvaluatorsOutput, Any, Any], - Interceptor[ListGatewayRateLimitsInput, ListGatewayRateLimitsOutput, Any, Any], - Interceptor[ListGatewayRulesInput, ListGatewayRulesOutput, Any, Any], - Interceptor[ListGatewaysInput, ListGatewaysOutput, Any, Any], - Interceptor[ListGatewayTargetsInput, ListGatewayTargetsOutput, Any, Any], - Interceptor[ListHarnessEndpointsInput, ListHarnessEndpointsOutput, Any, Any], - Interceptor[ListHarnessesInput, ListHarnessesOutput, Any, Any], - Interceptor[ListHarnessVersionsInput, ListHarnessVersionsOutput, Any, Any], - Interceptor[ListMemoriesInput, ListMemoriesOutput, Any, Any], - Interceptor[ + ListConfigurationBundlesInput, + ListConfigurationBundlesOutput, + ListConsentPortalsInput, + ListConsentPortalsOutput, + ListDatasetExamplesInput, + ListDatasetExamplesOutput, + ListDatasetVersionsInput, + ListDatasetVersionsOutput, + ListDatasetsInput, + ListDatasetsOutput, + ListEvaluatorsInput, + ListEvaluatorsOutput, + ListGatewayRateLimitsInput, + ListGatewayRateLimitsOutput, + ListGatewayRulesInput, + ListGatewayRulesOutput, + ListGatewayTargetsInput, + ListGatewayTargetsOutput, + ListGatewaysInput, + ListGatewaysOutput, + ListHarnessEndpointsInput, + ListHarnessEndpointsOutput, + ListHarnessVersionsInput, + ListHarnessVersionsOutput, + ListHarnessesInput, + ListHarnessesOutput, + ListMemoriesInput, + ListMemoriesOutput, ListOauth2CredentialProvidersInput, ListOauth2CredentialProvidersOutput, - Any, - Any, - ], - Interceptor[ - ListOnlineEvaluationConfigsInput, ListOnlineEvaluationConfigsOutput, Any, Any - ], - Interceptor[ListPaymentConnectorsInput, ListPaymentConnectorsOutput, Any, Any], - Interceptor[ + ListOnlineEvaluationConfigsInput, + ListOnlineEvaluationConfigsOutput, + ListPaymentConnectorsInput, + ListPaymentConnectorsOutput, ListPaymentCredentialProvidersInput, ListPaymentCredentialProvidersOutput, - Any, - Any, - ], - Interceptor[ListPaymentManagersInput, ListPaymentManagersOutput, Any, Any], - Interceptor[ListPoliciesInput, ListPoliciesOutput, Any, Any], - Interceptor[ListPolicyEnginesInput, ListPolicyEnginesOutput, Any, Any], - Interceptor[ - ListPolicyEngineSummariesInput, ListPolicyEngineSummariesOutput, Any, Any - ], - Interceptor[ - ListPolicyGenerationAssetsInput, ListPolicyGenerationAssetsOutput, Any, Any - ], - Interceptor[ListPolicyGenerationsInput, ListPolicyGenerationsOutput, Any, Any], - Interceptor[ + ListPaymentManagersInput, + ListPaymentManagersOutput, + ListPoliciesInput, + ListPoliciesOutput, + ListPolicyEngineSummariesInput, + ListPolicyEngineSummariesOutput, + ListPolicyEnginesInput, + ListPolicyEnginesOutput, + ListPolicyGenerationAssetsInput, + ListPolicyGenerationAssetsOutput, ListPolicyGenerationSummariesInput, ListPolicyGenerationSummariesOutput, - Any, - Any, - ], - Interceptor[ListPolicySummariesInput, ListPolicySummariesOutput, Any, Any], - Interceptor[ListRegistriesInput, ListRegistriesOutput, Any, Any], - Interceptor[ListRegistryRecordsInput, ListRegistryRecordsOutput, Any, Any], - Interceptor[ListTagsForResourceInput, ListTagsForResourceOutput, Any, Any], - Interceptor[ListWorkloadIdentitiesInput, ListWorkloadIdentitiesOutput, Any, Any], - Interceptor[PutResourcePolicyInput, PutResourcePolicyOutput, Any, Any], - Interceptor[ + ListPolicyGenerationsInput, + ListPolicyGenerationsOutput, + ListPolicySummariesInput, + ListPolicySummariesOutput, + ListRegistriesInput, + ListRegistriesOutput, + ListRegistryRecordsInput, + ListRegistryRecordsOutput, + ListTagsForResourceInput, + ListTagsForResourceOutput, + ListWorkloadIdentitiesInput, + ListWorkloadIdentitiesOutput, + PutResourcePolicyInput, + PutResourcePolicyOutput, RotatePaymentConnectorCredentialsInput, RotatePaymentConnectorCredentialsOutput, - Any, - Any, - ], - Interceptor[SetTokenVaultCMKInput, SetTokenVaultCMKOutput, Any, Any], - Interceptor[StartPolicyGenerationInput, StartPolicyGenerationOutput, Any, Any], - Interceptor[ + SetTokenVaultCMKInput, + SetTokenVaultCMKOutput, + StartPolicyGenerationInput, + StartPolicyGenerationOutput, SubmitRegistryRecordForApprovalInput, SubmitRegistryRecordForApprovalOutput, - Any, - Any, - ], - Interceptor[ - SynchronizeGatewayTargetsInput, SynchronizeGatewayTargetsOutput, Any, Any - ], - Interceptor[TagResourceInput, TagResourceOutput, Any, Any], - Interceptor[UntagResourceInput, UntagResourceOutput, Any, Any], - Interceptor[UpdateAgentRuntimeInput, UpdateAgentRuntimeOutput, Any, Any], - Interceptor[ - UpdateAgentRuntimeEndpointInput, UpdateAgentRuntimeEndpointOutput, Any, Any - ], - Interceptor[ + SynchronizeGatewayTargetsInput, + SynchronizeGatewayTargetsOutput, + TagResourceInput, + TagResourceOutput, + UntagResourceInput, + UntagResourceOutput, + UpdateAgentRuntimeEndpointInput, + UpdateAgentRuntimeEndpointOutput, + UpdateAgentRuntimeInput, + UpdateAgentRuntimeOutput, UpdateApiKeyCredentialProviderInput, UpdateApiKeyCredentialProviderOutput, - Any, - Any, - ], - Interceptor[UpdateCapacityProviderInput, UpdateCapacityProviderOutput, Any, Any], - Interceptor[ - UpdateConfigurationBundleInput, UpdateConfigurationBundleOutput, Any, Any - ], - Interceptor[UpdateConsentPortalInput, UpdateConsentPortalOutput, Any, Any], - Interceptor[UpdateDatasetInput, UpdateDatasetOutput, Any, Any], - Interceptor[UpdateDatasetExamplesInput, UpdateDatasetExamplesOutput, Any, Any], - Interceptor[UpdateEvaluatorInput, UpdateEvaluatorOutput, Any, Any], - Interceptor[UpdateGatewayInput, UpdateGatewayOutput, Any, Any], - Interceptor[UpdateGatewayRateLimitInput, UpdateGatewayRateLimitOutput, Any, Any], - Interceptor[UpdateGatewayRuleInput, UpdateGatewayRuleOutput, Any, Any], - Interceptor[UpdateGatewayTargetInput, UpdateGatewayTargetOutput, Any, Any], - Interceptor[UpdateHarnessInput, UpdateHarnessOutput, Any, Any], - Interceptor[UpdateHarnessEndpointInput, UpdateHarnessEndpointOutput, Any, Any], - Interceptor[UpdateMemoryInput, UpdateMemoryOutput, Any, Any], - Interceptor[ + UpdateCapacityProviderInput, + UpdateCapacityProviderOutput, + UpdateConfigurationBundleInput, + UpdateConfigurationBundleOutput, + UpdateConsentPortalInput, + UpdateConsentPortalOutput, + UpdateDatasetExamplesInput, + UpdateDatasetExamplesOutput, + UpdateDatasetInput, + UpdateDatasetOutput, + UpdateEvaluatorInput, + UpdateEvaluatorOutput, + UpdateGatewayInput, + UpdateGatewayOutput, + UpdateGatewayRateLimitInput, + UpdateGatewayRateLimitOutput, + UpdateGatewayRuleInput, + UpdateGatewayRuleOutput, + UpdateGatewayTargetInput, + UpdateGatewayTargetOutput, + UpdateHarnessEndpointInput, + UpdateHarnessEndpointOutput, + UpdateHarnessInput, + UpdateHarnessOutput, + UpdateMemoryInput, + UpdateMemoryOutput, UpdateOauth2CredentialProviderInput, UpdateOauth2CredentialProviderOutput, - Any, - Any, - ], - Interceptor[ - UpdateOnlineEvaluationConfigInput, UpdateOnlineEvaluationConfigOutput, Any, Any - ], - Interceptor[UpdatePaymentConnectorInput, UpdatePaymentConnectorOutput, Any, Any], - Interceptor[ + UpdateOnlineEvaluationConfigInput, + UpdateOnlineEvaluationConfigOutput, + UpdatePaymentConnectorInput, + UpdatePaymentConnectorOutput, UpdatePaymentCredentialProviderInput, UpdatePaymentCredentialProviderOutput, - Any, - Any, - ], - Interceptor[UpdatePaymentManagerInput, UpdatePaymentManagerOutput, Any, Any], - Interceptor[UpdatePolicyInput, UpdatePolicyOutput, Any, Any], - Interceptor[UpdatePolicyEngineInput, UpdatePolicyEngineOutput, Any, Any], - Interceptor[UpdateRegistryInput, UpdateRegistryOutput, Any, Any], - Interceptor[UpdateRegistryRecordInput, UpdateRegistryRecordOutput, Any, Any], - Interceptor[ - UpdateRegistryRecordStatusInput, UpdateRegistryRecordStatusOutput, Any, Any - ], - Interceptor[UpdateWorkloadIdentityInput, UpdateWorkloadIdentityOutput, Any, Any], -] + UpdatePaymentManagerInput, + UpdatePaymentManagerOutput, + UpdatePolicyEngineInput, + UpdatePolicyEngineOutput, + UpdatePolicyInput, + UpdatePolicyOutput, + UpdateRegistryInput, + UpdateRegistryOutput, + UpdateRegistryRecordInput, + UpdateRegistryRecordOutput, + UpdateRegistryRecordStatusInput, + UpdateRegistryRecordStatusOutput, + UpdateWorkloadIdentityInput, + UpdateWorkloadIdentityOutput, + ) + + _ServiceInterceptor = Union[ + Interceptor[AddDatasetExamplesInput, AddDatasetExamplesOutput, Any, Any], + Interceptor[ + BatchPutGatewayRateLimitsInput, BatchPutGatewayRateLimitsOutput, Any, Any + ], + Interceptor[CreateAgentRuntimeInput, CreateAgentRuntimeOutput, Any, Any], + Interceptor[ + CreateAgentRuntimeEndpointInput, CreateAgentRuntimeEndpointOutput, Any, Any + ], + Interceptor[ + CreateApiKeyCredentialProviderInput, + CreateApiKeyCredentialProviderOutput, + Any, + Any, + ], + Interceptor[CreateBrowserInput, CreateBrowserOutput, Any, Any], + Interceptor[CreateBrowserProfileInput, CreateBrowserProfileOutput, Any, Any], + Interceptor[ + CreateCapacityProviderInput, CreateCapacityProviderOutput, Any, Any + ], + Interceptor[CreateCodeInterpreterInput, CreateCodeInterpreterOutput, Any, Any], + Interceptor[ + CreateConfigurationBundleInput, CreateConfigurationBundleOutput, Any, Any + ], + Interceptor[CreateConsentPortalInput, CreateConsentPortalOutput, Any, Any], + Interceptor[CreateDatasetInput, CreateDatasetOutput, Any, Any], + Interceptor[CreateDatasetVersionInput, CreateDatasetVersionOutput, Any, Any], + Interceptor[CreateEvaluatorInput, CreateEvaluatorOutput, Any, Any], + Interceptor[CreateGatewayInput, CreateGatewayOutput, Any, Any], + Interceptor[ + CreateGatewayRateLimitInput, CreateGatewayRateLimitOutput, Any, Any + ], + Interceptor[CreateGatewayRuleInput, CreateGatewayRuleOutput, Any, Any], + Interceptor[CreateGatewayTargetInput, CreateGatewayTargetOutput, Any, Any], + Interceptor[CreateHarnessInput, CreateHarnessOutput, Any, Any], + Interceptor[CreateHarnessEndpointInput, CreateHarnessEndpointOutput, Any, Any], + Interceptor[CreateMemoryInput, CreateMemoryOutput, Any, Any], + Interceptor[ + CreateOauth2CredentialProviderInput, + CreateOauth2CredentialProviderOutput, + Any, + Any, + ], + Interceptor[ + CreateOnlineEvaluationConfigInput, + CreateOnlineEvaluationConfigOutput, + Any, + Any, + ], + Interceptor[ + CreatePaymentConnectorInput, CreatePaymentConnectorOutput, Any, Any + ], + Interceptor[ + CreatePaymentCredentialProviderInput, + CreatePaymentCredentialProviderOutput, + Any, + Any, + ], + Interceptor[CreatePaymentManagerInput, CreatePaymentManagerOutput, Any, Any], + Interceptor[CreatePolicyInput, CreatePolicyOutput, Any, Any], + Interceptor[CreatePolicyEngineInput, CreatePolicyEngineOutput, Any, Any], + Interceptor[CreateRegistryInput, CreateRegistryOutput, Any, Any], + Interceptor[CreateRegistryRecordInput, CreateRegistryRecordOutput, Any, Any], + Interceptor[ + CreateWorkloadIdentityInput, CreateWorkloadIdentityOutput, Any, Any + ], + Interceptor[DeleteAgentRuntimeInput, DeleteAgentRuntimeOutput, Any, Any], + Interceptor[ + DeleteAgentRuntimeEndpointInput, DeleteAgentRuntimeEndpointOutput, Any, Any + ], + Interceptor[ + DeleteApiKeyCredentialProviderInput, + DeleteApiKeyCredentialProviderOutput, + Any, + Any, + ], + Interceptor[DeleteBrowserInput, DeleteBrowserOutput, Any, Any], + Interceptor[DeleteBrowserProfileInput, DeleteBrowserProfileOutput, Any, Any], + Interceptor[ + DeleteCapacityProviderInput, DeleteCapacityProviderOutput, Any, Any + ], + Interceptor[DeleteCodeInterpreterInput, DeleteCodeInterpreterOutput, Any, Any], + Interceptor[ + DeleteConfigurationBundleInput, DeleteConfigurationBundleOutput, Any, Any + ], + Interceptor[DeleteConsentPortalInput, DeleteConsentPortalOutput, Any, Any], + Interceptor[DeleteDatasetInput, DeleteDatasetOutput, Any, Any], + Interceptor[DeleteDatasetExamplesInput, DeleteDatasetExamplesOutput, Any, Any], + Interceptor[DeleteEvaluatorInput, DeleteEvaluatorOutput, Any, Any], + Interceptor[DeleteGatewayInput, DeleteGatewayOutput, Any, Any], + Interceptor[ + DeleteGatewayRateLimitInput, DeleteGatewayRateLimitOutput, Any, Any + ], + Interceptor[DeleteGatewayRuleInput, DeleteGatewayRuleOutput, Any, Any], + Interceptor[DeleteGatewayTargetInput, DeleteGatewayTargetOutput, Any, Any], + Interceptor[DeleteHarnessInput, DeleteHarnessOutput, Any, Any], + Interceptor[DeleteHarnessEndpointInput, DeleteHarnessEndpointOutput, Any, Any], + Interceptor[DeleteMemoryInput, DeleteMemoryOutput, Any, Any], + Interceptor[ + DeleteOauth2CredentialProviderInput, + DeleteOauth2CredentialProviderOutput, + Any, + Any, + ], + Interceptor[ + DeleteOnlineEvaluationConfigInput, + DeleteOnlineEvaluationConfigOutput, + Any, + Any, + ], + Interceptor[ + DeletePaymentConnectorInput, DeletePaymentConnectorOutput, Any, Any + ], + Interceptor[ + DeletePaymentCredentialProviderInput, + DeletePaymentCredentialProviderOutput, + Any, + Any, + ], + Interceptor[DeletePaymentManagerInput, DeletePaymentManagerOutput, Any, Any], + Interceptor[DeletePolicyInput, DeletePolicyOutput, Any, Any], + Interceptor[DeletePolicyEngineInput, DeletePolicyEngineOutput, Any, Any], + Interceptor[DeleteRegistryInput, DeleteRegistryOutput, Any, Any], + Interceptor[DeleteRegistryRecordInput, DeleteRegistryRecordOutput, Any, Any], + Interceptor[DeleteResourcePolicyInput, DeleteResourcePolicyOutput, Any, Any], + Interceptor[ + DeleteWorkloadIdentityInput, DeleteWorkloadIdentityOutput, Any, Any + ], + Interceptor[GetAgentRuntimeInput, GetAgentRuntimeOutput, Any, Any], + Interceptor[ + GetAgentRuntimeEndpointInput, GetAgentRuntimeEndpointOutput, Any, Any + ], + Interceptor[ + GetApiKeyCredentialProviderInput, + GetApiKeyCredentialProviderOutput, + Any, + Any, + ], + Interceptor[GetBrowserInput, GetBrowserOutput, Any, Any], + Interceptor[GetBrowserProfileInput, GetBrowserProfileOutput, Any, Any], + Interceptor[GetCapacityProviderInput, GetCapacityProviderOutput, Any, Any], + Interceptor[GetCodeInterpreterInput, GetCodeInterpreterOutput, Any, Any], + Interceptor[ + GetConfigurationBundleInput, GetConfigurationBundleOutput, Any, Any + ], + Interceptor[ + GetConfigurationBundleVersionInput, + GetConfigurationBundleVersionOutput, + Any, + Any, + ], + Interceptor[GetConsentPortalInput, GetConsentPortalOutput, Any, Any], + Interceptor[GetDatasetInput, GetDatasetOutput, Any, Any], + Interceptor[GetEvaluatorInput, GetEvaluatorOutput, Any, Any], + Interceptor[GetGatewayInput, GetGatewayOutput, Any, Any], + Interceptor[GetGatewayRateLimitInput, GetGatewayRateLimitOutput, Any, Any], + Interceptor[GetGatewayRuleInput, GetGatewayRuleOutput, Any, Any], + Interceptor[GetGatewayTargetInput, GetGatewayTargetOutput, Any, Any], + Interceptor[GetHarnessInput, GetHarnessOutput, Any, Any], + Interceptor[GetHarnessEndpointInput, GetHarnessEndpointOutput, Any, Any], + Interceptor[GetMemoryInput, GetMemoryOutput, Any, Any], + Interceptor[ + GetOauth2CredentialProviderInput, + GetOauth2CredentialProviderOutput, + Any, + Any, + ], + Interceptor[ + GetOnlineEvaluationConfigInput, GetOnlineEvaluationConfigOutput, Any, Any + ], + Interceptor[GetPaymentConnectorInput, GetPaymentConnectorOutput, Any, Any], + Interceptor[ + GetPaymentCredentialProviderInput, + GetPaymentCredentialProviderOutput, + Any, + Any, + ], + Interceptor[GetPaymentManagerInput, GetPaymentManagerOutput, Any, Any], + Interceptor[GetPolicyInput, GetPolicyOutput, Any, Any], + Interceptor[GetPolicyEngineInput, GetPolicyEngineOutput, Any, Any], + Interceptor[ + GetPolicyEngineSummaryInput, GetPolicyEngineSummaryOutput, Any, Any + ], + Interceptor[GetPolicyGenerationInput, GetPolicyGenerationOutput, Any, Any], + Interceptor[ + GetPolicyGenerationSummaryInput, GetPolicyGenerationSummaryOutput, Any, Any + ], + Interceptor[GetPolicySummaryInput, GetPolicySummaryOutput, Any, Any], + Interceptor[GetRegistryInput, GetRegistryOutput, Any, Any], + Interceptor[GetRegistryRecordInput, GetRegistryRecordOutput, Any, Any], + Interceptor[GetResourcePolicyInput, GetResourcePolicyOutput, Any, Any], + Interceptor[GetTokenVaultInput, GetTokenVaultOutput, Any, Any], + Interceptor[GetWorkloadIdentityInput, GetWorkloadIdentityOutput, Any, Any], + Interceptor[ + ListAgentRuntimeEndpointsInput, ListAgentRuntimeEndpointsOutput, Any, Any + ], + Interceptor[ListAgentRuntimesInput, ListAgentRuntimesOutput, Any, Any], + Interceptor[ + ListAgentRuntimeVersionsInput, ListAgentRuntimeVersionsOutput, Any, Any + ], + Interceptor[ + ListAgentRuntimeVersionsByCapacityProviderInput, + ListAgentRuntimeVersionsByCapacityProviderOutput, + Any, + Any, + ], + Interceptor[ + ListApiKeyCredentialProvidersInput, + ListApiKeyCredentialProvidersOutput, + Any, + Any, + ], + Interceptor[ListBrowserProfilesInput, ListBrowserProfilesOutput, Any, Any], + Interceptor[ListBrowsersInput, ListBrowsersOutput, Any, Any], + Interceptor[ListCapacityProvidersInput, ListCapacityProvidersOutput, Any, Any], + Interceptor[ListCodeInterpretersInput, ListCodeInterpretersOutput, Any, Any], + Interceptor[ + ListConfigurationBundlesInput, ListConfigurationBundlesOutput, Any, Any + ], + Interceptor[ + ListConfigurationBundleVersionsInput, + ListConfigurationBundleVersionsOutput, + Any, + Any, + ], + Interceptor[ListConsentPortalsInput, ListConsentPortalsOutput, Any, Any], + Interceptor[ListDatasetExamplesInput, ListDatasetExamplesOutput, Any, Any], + Interceptor[ListDatasetsInput, ListDatasetsOutput, Any, Any], + Interceptor[ListDatasetVersionsInput, ListDatasetVersionsOutput, Any, Any], + Interceptor[ListEvaluatorsInput, ListEvaluatorsOutput, Any, Any], + Interceptor[ListGatewayRateLimitsInput, ListGatewayRateLimitsOutput, Any, Any], + Interceptor[ListGatewayRulesInput, ListGatewayRulesOutput, Any, Any], + Interceptor[ListGatewaysInput, ListGatewaysOutput, Any, Any], + Interceptor[ListGatewayTargetsInput, ListGatewayTargetsOutput, Any, Any], + Interceptor[ListHarnessEndpointsInput, ListHarnessEndpointsOutput, Any, Any], + Interceptor[ListHarnessesInput, ListHarnessesOutput, Any, Any], + Interceptor[ListHarnessVersionsInput, ListHarnessVersionsOutput, Any, Any], + Interceptor[ListMemoriesInput, ListMemoriesOutput, Any, Any], + Interceptor[ + ListOauth2CredentialProvidersInput, + ListOauth2CredentialProvidersOutput, + Any, + Any, + ], + Interceptor[ + ListOnlineEvaluationConfigsInput, + ListOnlineEvaluationConfigsOutput, + Any, + Any, + ], + Interceptor[ListPaymentConnectorsInput, ListPaymentConnectorsOutput, Any, Any], + Interceptor[ + ListPaymentCredentialProvidersInput, + ListPaymentCredentialProvidersOutput, + Any, + Any, + ], + Interceptor[ListPaymentManagersInput, ListPaymentManagersOutput, Any, Any], + Interceptor[ListPoliciesInput, ListPoliciesOutput, Any, Any], + Interceptor[ListPolicyEnginesInput, ListPolicyEnginesOutput, Any, Any], + Interceptor[ + ListPolicyEngineSummariesInput, ListPolicyEngineSummariesOutput, Any, Any + ], + Interceptor[ + ListPolicyGenerationAssetsInput, ListPolicyGenerationAssetsOutput, Any, Any + ], + Interceptor[ListPolicyGenerationsInput, ListPolicyGenerationsOutput, Any, Any], + Interceptor[ + ListPolicyGenerationSummariesInput, + ListPolicyGenerationSummariesOutput, + Any, + Any, + ], + Interceptor[ListPolicySummariesInput, ListPolicySummariesOutput, Any, Any], + Interceptor[ListRegistriesInput, ListRegistriesOutput, Any, Any], + Interceptor[ListRegistryRecordsInput, ListRegistryRecordsOutput, Any, Any], + Interceptor[ListTagsForResourceInput, ListTagsForResourceOutput, Any, Any], + Interceptor[ + ListWorkloadIdentitiesInput, ListWorkloadIdentitiesOutput, Any, Any + ], + Interceptor[PutResourcePolicyInput, PutResourcePolicyOutput, Any, Any], + Interceptor[ + RotatePaymentConnectorCredentialsInput, + RotatePaymentConnectorCredentialsOutput, + Any, + Any, + ], + Interceptor[SetTokenVaultCMKInput, SetTokenVaultCMKOutput, Any, Any], + Interceptor[StartPolicyGenerationInput, StartPolicyGenerationOutput, Any, Any], + Interceptor[ + SubmitRegistryRecordForApprovalInput, + SubmitRegistryRecordForApprovalOutput, + Any, + Any, + ], + Interceptor[ + SynchronizeGatewayTargetsInput, SynchronizeGatewayTargetsOutput, Any, Any + ], + Interceptor[TagResourceInput, TagResourceOutput, Any, Any], + Interceptor[UntagResourceInput, UntagResourceOutput, Any, Any], + Interceptor[UpdateAgentRuntimeInput, UpdateAgentRuntimeOutput, Any, Any], + Interceptor[ + UpdateAgentRuntimeEndpointInput, UpdateAgentRuntimeEndpointOutput, Any, Any + ], + Interceptor[ + UpdateApiKeyCredentialProviderInput, + UpdateApiKeyCredentialProviderOutput, + Any, + Any, + ], + Interceptor[ + UpdateCapacityProviderInput, UpdateCapacityProviderOutput, Any, Any + ], + Interceptor[ + UpdateConfigurationBundleInput, UpdateConfigurationBundleOutput, Any, Any + ], + Interceptor[UpdateConsentPortalInput, UpdateConsentPortalOutput, Any, Any], + Interceptor[UpdateDatasetInput, UpdateDatasetOutput, Any, Any], + Interceptor[UpdateDatasetExamplesInput, UpdateDatasetExamplesOutput, Any, Any], + Interceptor[UpdateEvaluatorInput, UpdateEvaluatorOutput, Any, Any], + Interceptor[UpdateGatewayInput, UpdateGatewayOutput, Any, Any], + Interceptor[ + UpdateGatewayRateLimitInput, UpdateGatewayRateLimitOutput, Any, Any + ], + Interceptor[UpdateGatewayRuleInput, UpdateGatewayRuleOutput, Any, Any], + Interceptor[UpdateGatewayTargetInput, UpdateGatewayTargetOutput, Any, Any], + Interceptor[UpdateHarnessInput, UpdateHarnessOutput, Any, Any], + Interceptor[UpdateHarnessEndpointInput, UpdateHarnessEndpointOutput, Any, Any], + Interceptor[UpdateMemoryInput, UpdateMemoryOutput, Any, Any], + Interceptor[ + UpdateOauth2CredentialProviderInput, + UpdateOauth2CredentialProviderOutput, + Any, + Any, + ], + Interceptor[ + UpdateOnlineEvaluationConfigInput, + UpdateOnlineEvaluationConfigOutput, + Any, + Any, + ], + Interceptor[ + UpdatePaymentConnectorInput, UpdatePaymentConnectorOutput, Any, Any + ], + Interceptor[ + UpdatePaymentCredentialProviderInput, + UpdatePaymentCredentialProviderOutput, + Any, + Any, + ], + Interceptor[UpdatePaymentManagerInput, UpdatePaymentManagerOutput, Any, Any], + Interceptor[UpdatePolicyInput, UpdatePolicyOutput, Any, Any], + Interceptor[UpdatePolicyEngineInput, UpdatePolicyEngineOutput, Any, Any], + Interceptor[UpdateRegistryInput, UpdateRegistryOutput, Any, Any], + Interceptor[UpdateRegistryRecordInput, UpdateRegistryRecordOutput, Any, Any], + Interceptor[ + UpdateRegistryRecordStatusInput, UpdateRegistryRecordStatusOutput, Any, Any + ], + Interceptor[ + UpdateWorkloadIdentityInput, UpdateWorkloadIdentityOutput, Any, Any + ], + ] +else: + _ServiceInterceptor = Any + _PROTOCOL_SETTINGS = ProtocolSettings( namespace="com.amazonaws.bedrockagentcorecontrol", service_target="AmazonBedrockAgentCoreControl", + service_schema=AMAZON_BEDROCK_AGENT_CORE_CONTROL, ) class _AsyncBedrockAgentCoreControlConfigOverrides(AwsConfigOverrides, total=False): - endpoint_resolver: EndpointResolver | None + endpoint_resolver: AsyncEndpointResolver | None protocol: ( - ClientProtocol[Any, Any] | ProtocolConstructor[ClientProtocol[Any, Any]] | None + AsyncClientProtocol[Any, Any] + | ProtocolConstructor[AsyncClientProtocol[Any, Any]] + | None ) - auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None + auth_schemes: dict[ShapeID, AsyncAuthScheme[Any, Any, Any, Any]] | None auth_scheme_resolver: AuthSchemeResolver | None @@ -701,17 +768,17 @@ class _AsyncBedrockAgentCoreControlConfigOverrides(AwsConfigOverrides, total=Fal class AsyncBedrockAgentCoreControlConfig(AsyncAwsConfig): """Bedrock AgentCore Control configuration (async-resolved).""" - endpoint_resolver: EndpointResolver | None = None + endpoint_resolver: AsyncEndpointResolver | None = None """ The endpoint resolver used to resolve the final endpoint per-operation based on the configuration. """ - protocol: ClientProtocol[Any, Any] | None = None + protocol: AsyncClientProtocol[Any, Any] | None = None """ Pass a protocol class reference from smithy_aws_core.aio.protocols to - select the protocol, e.g. protocol=AwsJson10ClientProtocol. For custom - protocols a protocol instance may also be passed. + select the protocol, e.g. protocol=AsyncAwsJson10ClientProtocol. For + custom protocols a protocol instance may also be passed. """ interceptors: list[_ServiceInterceptor] = field(default_factory=lambda: []) @@ -720,7 +787,7 @@ class AsyncBedrockAgentCoreControlConfig(AsyncAwsConfig): execution of a request. """ - auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None = None + auth_schemes: dict[ShapeID, AsyncAuthScheme[Any, Any, Any, Any]] | None = None """A map of auth scheme ids to auth schemes.""" auth_scheme_resolver: AuthSchemeResolver | None = None @@ -730,7 +797,7 @@ class AsyncBedrockAgentCoreControlConfig(AsyncAwsConfig): """ aws_credentials_identity_resolver: ( - IdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None + AsyncIdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None ) = None """Resolves AWS Credentials. Required for operations that use Sigv4 Auth.""" @@ -771,24 +838,26 @@ class AsyncBedrockAgentCoreControlConfig(AsyncAwsConfig): default=None, resolver=EndpointUriResolver("bedrock_agentcore_control") ), "endpoint_resolver": FieldSpec( - default_factory=lambda: StandardRegionalEndpointsResolver( + default_factory=lambda: AsyncStandardRegionalEndpointsResolver( endpoint_prefix="bedrock-agentcore-control" ) ), "protocol": FieldSpec( - default_factory=lambda: RestJsonClientProtocol(_PROTOCOL_SETTINGS), + default_factory=lambda: AsyncRestJsonClientProtocol(_PROTOCOL_SETTINGS), converter=lambda p: p(_PROTOCOL_SETTINGS) if isinstance(p, type) else p, ), "auth_schemes": FieldSpec( default_factory=lambda: { - ShapeID("aws.auth#sigv4"): SigV4AuthScheme(service="bedrock-agentcore") + ShapeID("aws.auth#sigv4"): AsyncSigV4AuthScheme( + service="bedrock-agentcore" + ) } ), "auth_scheme_resolver": FieldSpec(default_factory=HTTPAuthSchemeResolver), "transport": FieldSpec(default_factory=lambda: AIOHTTPClient()), } - def set_auth_scheme(self, scheme: AuthScheme[Any, Any, Any, Any]) -> None: + def set_auth_scheme(self, scheme: AsyncAuthScheme[Any, Any, Any, Any]) -> None: """ Set an auth scheme implementation using its scheme ID. :param scheme: The auth scheme to add or replace. @@ -802,7 +871,7 @@ async def resolve( # pyright: ignore[reportIncompatibleMethodOverride] cls, *, profile: str | None = None, - fs: FileSystem | None = None, + fs: AsyncFileSystem | None = None, config_file_path: str | None = None, credentials_file_path: str | None = None, **overrides: Unpack[_AsyncBedrockAgentCoreControlConfigOverrides], diff --git a/clients/aws-sdk-bedrock-agentcore-control/src/aws_sdk_bedrock_agentcore_control/models.py b/clients/aws-sdk-bedrock-agentcore-control/src/aws_sdk_bedrock_agentcore_control/models.py index 1e6a4cfe..e56fc988 100644 --- a/clients/aws-sdk-bedrock-agentcore-control/src/aws_sdk_bedrock_agentcore_control/models.py +++ b/clients/aws-sdk-bedrock-agentcore-control/src/aws_sdk_bedrock_agentcore_control/models.py @@ -1,967 +1,534 @@ # Code generated by smithy-python-codegen DO NOT EDIT. -from dataclasses import dataclass, field -from datetime import datetime, timezone -from enum import StrEnum -import logging -from typing import Any, Literal, Self, Union +from __future__ import annotations -from smithy_core.deserializers import ShapeDeserializer -from smithy_core.documents import Document, TypeRegistry -from smithy_core.exceptions import ModeledError, SerializationError -from smithy_core.prelude import UNIT as _SCHEMA_UNIT -from smithy_core.response import EMPTY_RESPONSE_METADATA, ResponseMetadata -from smithy_core.schemas import APIOperation, Schema -from smithy_core.serializers import ShapeSerializer +from ._private import schemas as _schemas +from smithy_core._dynamic_models import ModelRegistry +from smithy_core.exceptions import ModeledError +from smithy_core.schemas import APIOperation from smithy_core.shapes import ShapeID -from smithy_core.types import UnknownEnumMixin from ._private.schemas import ( - A2A_DESCRIPTOR as _SCHEMA_A2A_DESCRIPTOR, - ACCESS_DENIED_EXCEPTION as _SCHEMA_ACCESS_DENIED_EXCEPTION, - ACTION as _SCHEMA_ACTION, ADD_DATASET_EXAMPLES as _SCHEMA_ADD_DATASET_EXAMPLES, - ADD_DATASET_EXAMPLES_INPUT as _SCHEMA_ADD_DATASET_EXAMPLES_INPUT, - ADD_DATASET_EXAMPLES_OUTPUT as _SCHEMA_ADD_DATASET_EXAMPLES_OUTPUT, - AGENT_CARD_DEFINITION as _SCHEMA_AGENT_CARD_DEFINITION, - AGENT_RUNTIME as _SCHEMA_AGENT_RUNTIME, - AGENT_RUNTIME_ARTIFACT as _SCHEMA_AGENT_RUNTIME_ARTIFACT, - AGENT_RUNTIME_ENDPOINT as _SCHEMA_AGENT_RUNTIME_ENDPOINT, - AGENT_RUNTIME_VERSION_SUMMARY as _SCHEMA_AGENT_RUNTIME_VERSION_SUMMARY, - AGENT_SKILLS_DESCRIPTOR as _SCHEMA_AGENT_SKILLS_DESCRIPTOR, - ALLOWED_WORKLOAD_CONFIGURATION as _SCHEMA_ALLOWED_WORKLOAD_CONFIGURATION, - API_GATEWAY_TARGET_CONFIGURATION as _SCHEMA_API_GATEWAY_TARGET_CONFIGURATION, - API_GATEWAY_TOOL_CONFIGURATION as _SCHEMA_API_GATEWAY_TOOL_CONFIGURATION, - API_GATEWAY_TOOL_FILTER as _SCHEMA_API_GATEWAY_TOOL_FILTER, - API_GATEWAY_TOOL_OVERRIDE as _SCHEMA_API_GATEWAY_TOOL_OVERRIDE, - API_KEY_CREDENTIAL_PROVIDER_ITEM as _SCHEMA_API_KEY_CREDENTIAL_PROVIDER_ITEM, - API_SCHEMA_CONFIGURATION as _SCHEMA_API_SCHEMA_CONFIGURATION, - APPROVAL_CONFIGURATION as _SCHEMA_APPROVAL_CONFIGURATION, - ATLASSIAN_OAUTH2_PROVIDER_CONFIG_INPUT as _SCHEMA_ATLASSIAN_OAUTH2_PROVIDER_CONFIG_INPUT, - ATLASSIAN_OAUTH2_PROVIDER_CONFIG_OUTPUT as _SCHEMA_ATLASSIAN_OAUTH2_PROVIDER_CONFIG_OUTPUT, - AUTHORIZATION_DATA as _SCHEMA_AUTHORIZATION_DATA, - AUTHORIZER_CONFIGURATION as _SCHEMA_AUTHORIZER_CONFIGURATION, - AUTHORIZING_CLAIM_MATCH_VALUE_TYPE as _SCHEMA_AUTHORIZING_CLAIM_MATCH_VALUE_TYPE, BATCH_PUT_GATEWAY_RATE_LIMITS as _SCHEMA_BATCH_PUT_GATEWAY_RATE_LIMITS, - BATCH_PUT_GATEWAY_RATE_LIMITS_INPUT as _SCHEMA_BATCH_PUT_GATEWAY_RATE_LIMITS_INPUT, - BATCH_PUT_GATEWAY_RATE_LIMITS_OUTPUT as _SCHEMA_BATCH_PUT_GATEWAY_RATE_LIMITS_OUTPUT, - BATCH_PUT_LIMIT_ENTRY as _SCHEMA_BATCH_PUT_LIMIT_ENTRY, - BEDROCK_EVALUATOR_MODEL_CONFIG as _SCHEMA_BEDROCK_EVALUATOR_MODEL_CONFIG, - BROWSER_ENTERPRISE_POLICY as _SCHEMA_BROWSER_ENTERPRISE_POLICY, - BROWSER_NETWORK_CONFIGURATION as _SCHEMA_BROWSER_NETWORK_CONFIGURATION, - BROWSER_PROFILE_SUMMARY as _SCHEMA_BROWSER_PROFILE_SUMMARY, - BROWSER_SIGNING_CONFIG_INPUT as _SCHEMA_BROWSER_SIGNING_CONFIG_INPUT, - BROWSER_SIGNING_CONFIG_OUTPUT as _SCHEMA_BROWSER_SIGNING_CONFIG_OUTPUT, - BROWSER_SUMMARY as _SCHEMA_BROWSER_SUMMARY, - CAPACITY_PROVIDER_CONFIGURATION as _SCHEMA_CAPACITY_PROVIDER_CONFIGURATION, - CAPACITY_PROVIDER_SUMMARY as _SCHEMA_CAPACITY_PROVIDER_SUMMARY, - CAPACITY_PROVIDER_VOLUME_CONFIGURATION as _SCHEMA_CAPACITY_PROVIDER_VOLUME_CONFIGURATION, - CAPACITY_RESERVATION_SPECIFICATION as _SCHEMA_CAPACITY_RESERVATION_SPECIFICATION, - CAPACITY_RESERVATION_TARGET as _SCHEMA_CAPACITY_RESERVATION_TARGET, - CATEGORICAL_SCALE_DEFINITION as _SCHEMA_CATEGORICAL_SCALE_DEFINITION, - CEDAR_POLICY as _SCHEMA_CEDAR_POLICY, - CERTIFICATE as _SCHEMA_CERTIFICATE, - CERTIFICATE_CONFIGURATION as _SCHEMA_CERTIFICATE_CONFIGURATION, - CERTIFICATE_LOCATION as _SCHEMA_CERTIFICATE_LOCATION, - CLAIM_MATCH_VALUE_TYPE as _SCHEMA_CLAIM_MATCH_VALUE_TYPE, - CLOUD_WATCH_LOGS_INPUT_CONFIG as _SCHEMA_CLOUD_WATCH_LOGS_INPUT_CONFIG, - CLOUD_WATCH_OUTPUT_CONFIG as _SCHEMA_CLOUD_WATCH_OUTPUT_CONFIG, - CLUSTERING_CONFIG as _SCHEMA_CLUSTERING_CONFIG, - CODE as _SCHEMA_CODE, - CODE_BASED_EVALUATOR_CONFIG as _SCHEMA_CODE_BASED_EVALUATOR_CONFIG, - CODE_CONFIGURATION as _SCHEMA_CODE_CONFIGURATION, - CODE_INTERPRETER_NETWORK_CONFIGURATION as _SCHEMA_CODE_INTERPRETER_NETWORK_CONFIGURATION, - CODE_INTERPRETER_SUMMARY as _SCHEMA_CODE_INTERPRETER_SUMMARY, - COINBASE_CDP_CONFIGURATION_INPUT as _SCHEMA_COINBASE_CDP_CONFIGURATION_INPUT, - COINBASE_CDP_CONFIGURATION_OUTPUT as _SCHEMA_COINBASE_CDP_CONFIGURATION_OUTPUT, - COINBASE_CDP_ROTATION_TARGETS as _SCHEMA_COINBASE_CDP_ROTATION_TARGETS, - COMPONENT_CONFIGURATION as _SCHEMA_COMPONENT_CONFIGURATION, - COMPUTE_CONFIGURATION as _SCHEMA_COMPUTE_CONFIGURATION, - CONCURRENT_MODIFICATION_EXCEPTION as _SCHEMA_CONCURRENT_MODIFICATION_EXCEPTION, - CONDITION as _SCHEMA_CONDITION, - CONFIGURATION_BUNDLE_ACTION as _SCHEMA_CONFIGURATION_BUNDLE_ACTION, - CONFIGURATION_BUNDLE_REFERENCE as _SCHEMA_CONFIGURATION_BUNDLE_REFERENCE, - CONFIGURATION_BUNDLE_SUMMARY as _SCHEMA_CONFIGURATION_BUNDLE_SUMMARY, - CONFIGURATION_BUNDLE_VERSION_SUMMARY as _SCHEMA_CONFIGURATION_BUNDLE_VERSION_SUMMARY, - CONFLICT_EXCEPTION as _SCHEMA_CONFLICT_EXCEPTION, - CONNECTOR_CONFIGURATION as _SCHEMA_CONNECTOR_CONFIGURATION, - CONNECTOR_PARAMETER_OVERRIDE as _SCHEMA_CONNECTOR_PARAMETER_OVERRIDE, - CONNECTOR_SOURCE as _SCHEMA_CONNECTOR_SOURCE, - CONNECTOR_TARGET_CONFIGURATION as _SCHEMA_CONNECTOR_TARGET_CONFIGURATION, - CONSENT_PORTAL_IDP_CONFIG as _SCHEMA_CONSENT_PORTAL_IDP_CONFIG, - CONSENT_PORTAL_SOURCE as _SCHEMA_CONSENT_PORTAL_SOURCE, - CONSENT_PORTAL_SUMMARY as _SCHEMA_CONSENT_PORTAL_SUMMARY, - CONSOLIDATION_CONFIGURATION as _SCHEMA_CONSOLIDATION_CONFIGURATION, - CONTAINER_CONFIGURATION as _SCHEMA_CONTAINER_CONFIGURATION, - CONTENT as _SCHEMA_CONTENT, - CONTENT_CONFIGURATION as _SCHEMA_CONTENT_CONFIGURATION, CREATE_AGENT_RUNTIME as _SCHEMA_CREATE_AGENT_RUNTIME, CREATE_AGENT_RUNTIME_ENDPOINT as _SCHEMA_CREATE_AGENT_RUNTIME_ENDPOINT, - CREATE_AGENT_RUNTIME_ENDPOINT_INPUT as _SCHEMA_CREATE_AGENT_RUNTIME_ENDPOINT_INPUT, - CREATE_AGENT_RUNTIME_ENDPOINT_OUTPUT as _SCHEMA_CREATE_AGENT_RUNTIME_ENDPOINT_OUTPUT, - CREATE_AGENT_RUNTIME_INPUT as _SCHEMA_CREATE_AGENT_RUNTIME_INPUT, - CREATE_AGENT_RUNTIME_OUTPUT as _SCHEMA_CREATE_AGENT_RUNTIME_OUTPUT, CREATE_API_KEY_CREDENTIAL_PROVIDER as _SCHEMA_CREATE_API_KEY_CREDENTIAL_PROVIDER, - CREATE_API_KEY_CREDENTIAL_PROVIDER_INPUT as _SCHEMA_CREATE_API_KEY_CREDENTIAL_PROVIDER_INPUT, - CREATE_API_KEY_CREDENTIAL_PROVIDER_OUTPUT as _SCHEMA_CREATE_API_KEY_CREDENTIAL_PROVIDER_OUTPUT, CREATE_BROWSER as _SCHEMA_CREATE_BROWSER, - CREATE_BROWSER_INPUT as _SCHEMA_CREATE_BROWSER_INPUT, - CREATE_BROWSER_OUTPUT as _SCHEMA_CREATE_BROWSER_OUTPUT, CREATE_BROWSER_PROFILE as _SCHEMA_CREATE_BROWSER_PROFILE, - CREATE_BROWSER_PROFILE_INPUT as _SCHEMA_CREATE_BROWSER_PROFILE_INPUT, - CREATE_BROWSER_PROFILE_OUTPUT as _SCHEMA_CREATE_BROWSER_PROFILE_OUTPUT, CREATE_CAPACITY_PROVIDER as _SCHEMA_CREATE_CAPACITY_PROVIDER, - CREATE_CAPACITY_PROVIDER_INPUT as _SCHEMA_CREATE_CAPACITY_PROVIDER_INPUT, - CREATE_CAPACITY_PROVIDER_OUTPUT as _SCHEMA_CREATE_CAPACITY_PROVIDER_OUTPUT, CREATE_CODE_INTERPRETER as _SCHEMA_CREATE_CODE_INTERPRETER, - CREATE_CODE_INTERPRETER_INPUT as _SCHEMA_CREATE_CODE_INTERPRETER_INPUT, - CREATE_CODE_INTERPRETER_OUTPUT as _SCHEMA_CREATE_CODE_INTERPRETER_OUTPUT, CREATE_CONFIGURATION_BUNDLE as _SCHEMA_CREATE_CONFIGURATION_BUNDLE, - CREATE_CONFIGURATION_BUNDLE_INPUT as _SCHEMA_CREATE_CONFIGURATION_BUNDLE_INPUT, - CREATE_CONFIGURATION_BUNDLE_OUTPUT as _SCHEMA_CREATE_CONFIGURATION_BUNDLE_OUTPUT, CREATE_CONSENT_PORTAL as _SCHEMA_CREATE_CONSENT_PORTAL, - CREATE_CONSENT_PORTAL_INPUT as _SCHEMA_CREATE_CONSENT_PORTAL_INPUT, - CREATE_CONSENT_PORTAL_OUTPUT as _SCHEMA_CREATE_CONSENT_PORTAL_OUTPUT, CREATE_DATASET as _SCHEMA_CREATE_DATASET, - CREATE_DATASET_INPUT as _SCHEMA_CREATE_DATASET_INPUT, - CREATE_DATASET_OUTPUT as _SCHEMA_CREATE_DATASET_OUTPUT, CREATE_DATASET_VERSION as _SCHEMA_CREATE_DATASET_VERSION, - CREATE_DATASET_VERSION_INPUT as _SCHEMA_CREATE_DATASET_VERSION_INPUT, - CREATE_DATASET_VERSION_OUTPUT as _SCHEMA_CREATE_DATASET_VERSION_OUTPUT, CREATE_EVALUATOR as _SCHEMA_CREATE_EVALUATOR, - CREATE_EVALUATOR_INPUT as _SCHEMA_CREATE_EVALUATOR_INPUT, - CREATE_EVALUATOR_OUTPUT as _SCHEMA_CREATE_EVALUATOR_OUTPUT, CREATE_GATEWAY as _SCHEMA_CREATE_GATEWAY, - CREATE_GATEWAY_INPUT as _SCHEMA_CREATE_GATEWAY_INPUT, - CREATE_GATEWAY_OUTPUT as _SCHEMA_CREATE_GATEWAY_OUTPUT, CREATE_GATEWAY_RATE_LIMIT as _SCHEMA_CREATE_GATEWAY_RATE_LIMIT, - CREATE_GATEWAY_RATE_LIMIT_INPUT as _SCHEMA_CREATE_GATEWAY_RATE_LIMIT_INPUT, - CREATE_GATEWAY_RATE_LIMIT_OUTPUT as _SCHEMA_CREATE_GATEWAY_RATE_LIMIT_OUTPUT, CREATE_GATEWAY_RULE as _SCHEMA_CREATE_GATEWAY_RULE, - CREATE_GATEWAY_RULE_INPUT as _SCHEMA_CREATE_GATEWAY_RULE_INPUT, - CREATE_GATEWAY_RULE_OUTPUT as _SCHEMA_CREATE_GATEWAY_RULE_OUTPUT, CREATE_GATEWAY_TARGET as _SCHEMA_CREATE_GATEWAY_TARGET, - CREATE_GATEWAY_TARGET_INPUT as _SCHEMA_CREATE_GATEWAY_TARGET_INPUT, - CREATE_GATEWAY_TARGET_OUTPUT as _SCHEMA_CREATE_GATEWAY_TARGET_OUTPUT, CREATE_HARNESS as _SCHEMA_CREATE_HARNESS, CREATE_HARNESS_ENDPOINT as _SCHEMA_CREATE_HARNESS_ENDPOINT, - CREATE_HARNESS_ENDPOINT_INPUT as _SCHEMA_CREATE_HARNESS_ENDPOINT_INPUT, - CREATE_HARNESS_ENDPOINT_OUTPUT as _SCHEMA_CREATE_HARNESS_ENDPOINT_OUTPUT, - CREATE_HARNESS_INPUT as _SCHEMA_CREATE_HARNESS_INPUT, - CREATE_HARNESS_OUTPUT as _SCHEMA_CREATE_HARNESS_OUTPUT, CREATE_MEMORY as _SCHEMA_CREATE_MEMORY, - CREATE_MEMORY_INPUT as _SCHEMA_CREATE_MEMORY_INPUT, - CREATE_MEMORY_OUTPUT as _SCHEMA_CREATE_MEMORY_OUTPUT, CREATE_OAUTH2_CREDENTIAL_PROVIDER as _SCHEMA_CREATE_OAUTH2_CREDENTIAL_PROVIDER, - CREATE_OAUTH2_CREDENTIAL_PROVIDER_INPUT as _SCHEMA_CREATE_OAUTH2_CREDENTIAL_PROVIDER_INPUT, - CREATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT as _SCHEMA_CREATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT, CREATE_ONLINE_EVALUATION_CONFIG as _SCHEMA_CREATE_ONLINE_EVALUATION_CONFIG, - CREATE_ONLINE_EVALUATION_CONFIG_INPUT as _SCHEMA_CREATE_ONLINE_EVALUATION_CONFIG_INPUT, - CREATE_ONLINE_EVALUATION_CONFIG_OUTPUT as _SCHEMA_CREATE_ONLINE_EVALUATION_CONFIG_OUTPUT, CREATE_PAYMENT_CONNECTOR as _SCHEMA_CREATE_PAYMENT_CONNECTOR, - CREATE_PAYMENT_CONNECTOR_INPUT as _SCHEMA_CREATE_PAYMENT_CONNECTOR_INPUT, - CREATE_PAYMENT_CONNECTOR_OUTPUT as _SCHEMA_CREATE_PAYMENT_CONNECTOR_OUTPUT, CREATE_PAYMENT_CREDENTIAL_PROVIDER as _SCHEMA_CREATE_PAYMENT_CREDENTIAL_PROVIDER, - CREATE_PAYMENT_CREDENTIAL_PROVIDER_INPUT as _SCHEMA_CREATE_PAYMENT_CREDENTIAL_PROVIDER_INPUT, - CREATE_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT as _SCHEMA_CREATE_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT, CREATE_PAYMENT_MANAGER as _SCHEMA_CREATE_PAYMENT_MANAGER, - CREATE_PAYMENT_MANAGER_INPUT as _SCHEMA_CREATE_PAYMENT_MANAGER_INPUT, - CREATE_PAYMENT_MANAGER_OUTPUT as _SCHEMA_CREATE_PAYMENT_MANAGER_OUTPUT, CREATE_POLICY as _SCHEMA_CREATE_POLICY, CREATE_POLICY_ENGINE as _SCHEMA_CREATE_POLICY_ENGINE, - CREATE_POLICY_ENGINE_INPUT as _SCHEMA_CREATE_POLICY_ENGINE_INPUT, - CREATE_POLICY_ENGINE_OUTPUT as _SCHEMA_CREATE_POLICY_ENGINE_OUTPUT, - CREATE_POLICY_INPUT as _SCHEMA_CREATE_POLICY_INPUT, - CREATE_POLICY_OUTPUT as _SCHEMA_CREATE_POLICY_OUTPUT, CREATE_REGISTRY as _SCHEMA_CREATE_REGISTRY, - CREATE_REGISTRY_INPUT as _SCHEMA_CREATE_REGISTRY_INPUT, - CREATE_REGISTRY_OUTPUT as _SCHEMA_CREATE_REGISTRY_OUTPUT, CREATE_REGISTRY_RECORD as _SCHEMA_CREATE_REGISTRY_RECORD, - CREATE_REGISTRY_RECORD_INPUT as _SCHEMA_CREATE_REGISTRY_RECORD_INPUT, - CREATE_REGISTRY_RECORD_OUTPUT as _SCHEMA_CREATE_REGISTRY_RECORD_OUTPUT, CREATE_WORKLOAD_IDENTITY as _SCHEMA_CREATE_WORKLOAD_IDENTITY, - CREATE_WORKLOAD_IDENTITY_INPUT as _SCHEMA_CREATE_WORKLOAD_IDENTITY_INPUT, - CREATE_WORKLOAD_IDENTITY_OUTPUT as _SCHEMA_CREATE_WORKLOAD_IDENTITY_OUTPUT, - CREDENTIALS_PROVIDER_CONFIGURATION as _SCHEMA_CREDENTIALS_PROVIDER_CONFIGURATION, - CREDENTIAL_PROVIDER as _SCHEMA_CREDENTIAL_PROVIDER, - CREDENTIAL_PROVIDER_CONFIGURATION as _SCHEMA_CREDENTIAL_PROVIDER_CONFIGURATION, - CREDENTIAL_ROTATION_CONFIG as _SCHEMA_CREDENTIAL_ROTATION_CONFIG, - CUSTOM_CLAIM_VALIDATION_TYPE as _SCHEMA_CUSTOM_CLAIM_VALIDATION_TYPE, - CUSTOM_CONFIGURATION_INPUT as _SCHEMA_CUSTOM_CONFIGURATION_INPUT, - CUSTOM_CONSOLIDATION_CONFIGURATION as _SCHEMA_CUSTOM_CONSOLIDATION_CONFIGURATION, - CUSTOM_CONSOLIDATION_CONFIGURATION_INPUT as _SCHEMA_CUSTOM_CONSOLIDATION_CONFIGURATION_INPUT, - CUSTOM_DESCRIPTOR as _SCHEMA_CUSTOM_DESCRIPTOR, - CUSTOM_EXTRACTION_CONFIGURATION as _SCHEMA_CUSTOM_EXTRACTION_CONFIGURATION, - CUSTOM_EXTRACTION_CONFIGURATION_INPUT as _SCHEMA_CUSTOM_EXTRACTION_CONFIGURATION_INPUT, - CUSTOM_JWT_AUTHORIZER_CONFIGURATION as _SCHEMA_CUSTOM_JWT_AUTHORIZER_CONFIGURATION, - CUSTOM_MEMORY_STRATEGY_INPUT as _SCHEMA_CUSTOM_MEMORY_STRATEGY_INPUT, - CUSTOM_OAUTH2_PROVIDER_CONFIG_INPUT as _SCHEMA_CUSTOM_OAUTH2_PROVIDER_CONFIG_INPUT, - CUSTOM_OAUTH2_PROVIDER_CONFIG_OUTPUT as _SCHEMA_CUSTOM_OAUTH2_PROVIDER_CONFIG_OUTPUT, - CUSTOM_REFLECTION_CONFIGURATION as _SCHEMA_CUSTOM_REFLECTION_CONFIGURATION, - CUSTOM_REFLECTION_CONFIGURATION_INPUT as _SCHEMA_CUSTOM_REFLECTION_CONFIGURATION_INPUT, - CUSTOM_TRANSFORM_CONFIGURATION as _SCHEMA_CUSTOM_TRANSFORM_CONFIGURATION, - DATASET_SUMMARY as _SCHEMA_DATASET_SUMMARY, - DATASET_VERSION_SUMMARY as _SCHEMA_DATASET_VERSION_SUMMARY, - DATA_SOURCE_CONFIG as _SCHEMA_DATA_SOURCE_CONFIG, - DATA_SOURCE_TYPE as _SCHEMA_DATA_SOURCE_TYPE, - DECRYPTION_FAILURE as _SCHEMA_DECRYPTION_FAILURE, DELETE_AGENT_RUNTIME as _SCHEMA_DELETE_AGENT_RUNTIME, DELETE_AGENT_RUNTIME_ENDPOINT as _SCHEMA_DELETE_AGENT_RUNTIME_ENDPOINT, - DELETE_AGENT_RUNTIME_ENDPOINT_INPUT as _SCHEMA_DELETE_AGENT_RUNTIME_ENDPOINT_INPUT, - DELETE_AGENT_RUNTIME_ENDPOINT_OUTPUT as _SCHEMA_DELETE_AGENT_RUNTIME_ENDPOINT_OUTPUT, - DELETE_AGENT_RUNTIME_INPUT as _SCHEMA_DELETE_AGENT_RUNTIME_INPUT, - DELETE_AGENT_RUNTIME_OUTPUT as _SCHEMA_DELETE_AGENT_RUNTIME_OUTPUT, DELETE_API_KEY_CREDENTIAL_PROVIDER as _SCHEMA_DELETE_API_KEY_CREDENTIAL_PROVIDER, - DELETE_API_KEY_CREDENTIAL_PROVIDER_INPUT as _SCHEMA_DELETE_API_KEY_CREDENTIAL_PROVIDER_INPUT, - DELETE_API_KEY_CREDENTIAL_PROVIDER_OUTPUT as _SCHEMA_DELETE_API_KEY_CREDENTIAL_PROVIDER_OUTPUT, DELETE_BROWSER as _SCHEMA_DELETE_BROWSER, - DELETE_BROWSER_INPUT as _SCHEMA_DELETE_BROWSER_INPUT, - DELETE_BROWSER_OUTPUT as _SCHEMA_DELETE_BROWSER_OUTPUT, DELETE_BROWSER_PROFILE as _SCHEMA_DELETE_BROWSER_PROFILE, - DELETE_BROWSER_PROFILE_INPUT as _SCHEMA_DELETE_BROWSER_PROFILE_INPUT, - DELETE_BROWSER_PROFILE_OUTPUT as _SCHEMA_DELETE_BROWSER_PROFILE_OUTPUT, DELETE_CAPACITY_PROVIDER as _SCHEMA_DELETE_CAPACITY_PROVIDER, - DELETE_CAPACITY_PROVIDER_INPUT as _SCHEMA_DELETE_CAPACITY_PROVIDER_INPUT, - DELETE_CAPACITY_PROVIDER_OUTPUT as _SCHEMA_DELETE_CAPACITY_PROVIDER_OUTPUT, DELETE_CODE_INTERPRETER as _SCHEMA_DELETE_CODE_INTERPRETER, - DELETE_CODE_INTERPRETER_INPUT as _SCHEMA_DELETE_CODE_INTERPRETER_INPUT, - DELETE_CODE_INTERPRETER_OUTPUT as _SCHEMA_DELETE_CODE_INTERPRETER_OUTPUT, DELETE_CONFIGURATION_BUNDLE as _SCHEMA_DELETE_CONFIGURATION_BUNDLE, - DELETE_CONFIGURATION_BUNDLE_INPUT as _SCHEMA_DELETE_CONFIGURATION_BUNDLE_INPUT, - DELETE_CONFIGURATION_BUNDLE_OUTPUT as _SCHEMA_DELETE_CONFIGURATION_BUNDLE_OUTPUT, DELETE_CONSENT_PORTAL as _SCHEMA_DELETE_CONSENT_PORTAL, - DELETE_CONSENT_PORTAL_INPUT as _SCHEMA_DELETE_CONSENT_PORTAL_INPUT, - DELETE_CONSENT_PORTAL_OUTPUT as _SCHEMA_DELETE_CONSENT_PORTAL_OUTPUT, DELETE_DATASET as _SCHEMA_DELETE_DATASET, DELETE_DATASET_EXAMPLES as _SCHEMA_DELETE_DATASET_EXAMPLES, - DELETE_DATASET_EXAMPLES_INPUT as _SCHEMA_DELETE_DATASET_EXAMPLES_INPUT, - DELETE_DATASET_EXAMPLES_OUTPUT as _SCHEMA_DELETE_DATASET_EXAMPLES_OUTPUT, - DELETE_DATASET_INPUT as _SCHEMA_DELETE_DATASET_INPUT, - DELETE_DATASET_OUTPUT as _SCHEMA_DELETE_DATASET_OUTPUT, DELETE_EVALUATOR as _SCHEMA_DELETE_EVALUATOR, - DELETE_EVALUATOR_INPUT as _SCHEMA_DELETE_EVALUATOR_INPUT, - DELETE_EVALUATOR_OUTPUT as _SCHEMA_DELETE_EVALUATOR_OUTPUT, DELETE_GATEWAY as _SCHEMA_DELETE_GATEWAY, - DELETE_GATEWAY_INPUT as _SCHEMA_DELETE_GATEWAY_INPUT, - DELETE_GATEWAY_OUTPUT as _SCHEMA_DELETE_GATEWAY_OUTPUT, DELETE_GATEWAY_RATE_LIMIT as _SCHEMA_DELETE_GATEWAY_RATE_LIMIT, - DELETE_GATEWAY_RATE_LIMIT_INPUT as _SCHEMA_DELETE_GATEWAY_RATE_LIMIT_INPUT, - DELETE_GATEWAY_RATE_LIMIT_OUTPUT as _SCHEMA_DELETE_GATEWAY_RATE_LIMIT_OUTPUT, DELETE_GATEWAY_RULE as _SCHEMA_DELETE_GATEWAY_RULE, - DELETE_GATEWAY_RULE_INPUT as _SCHEMA_DELETE_GATEWAY_RULE_INPUT, - DELETE_GATEWAY_RULE_OUTPUT as _SCHEMA_DELETE_GATEWAY_RULE_OUTPUT, DELETE_GATEWAY_TARGET as _SCHEMA_DELETE_GATEWAY_TARGET, - DELETE_GATEWAY_TARGET_INPUT as _SCHEMA_DELETE_GATEWAY_TARGET_INPUT, - DELETE_GATEWAY_TARGET_OUTPUT as _SCHEMA_DELETE_GATEWAY_TARGET_OUTPUT, DELETE_HARNESS as _SCHEMA_DELETE_HARNESS, DELETE_HARNESS_ENDPOINT as _SCHEMA_DELETE_HARNESS_ENDPOINT, - DELETE_HARNESS_ENDPOINT_INPUT as _SCHEMA_DELETE_HARNESS_ENDPOINT_INPUT, - DELETE_HARNESS_ENDPOINT_OUTPUT as _SCHEMA_DELETE_HARNESS_ENDPOINT_OUTPUT, - DELETE_HARNESS_INPUT as _SCHEMA_DELETE_HARNESS_INPUT, - DELETE_HARNESS_OUTPUT as _SCHEMA_DELETE_HARNESS_OUTPUT, DELETE_MEMORY as _SCHEMA_DELETE_MEMORY, - DELETE_MEMORY_INPUT as _SCHEMA_DELETE_MEMORY_INPUT, - DELETE_MEMORY_OUTPUT as _SCHEMA_DELETE_MEMORY_OUTPUT, - DELETE_MEMORY_STRATEGY_INPUT as _SCHEMA_DELETE_MEMORY_STRATEGY_INPUT, DELETE_OAUTH2_CREDENTIAL_PROVIDER as _SCHEMA_DELETE_OAUTH2_CREDENTIAL_PROVIDER, - DELETE_OAUTH2_CREDENTIAL_PROVIDER_INPUT as _SCHEMA_DELETE_OAUTH2_CREDENTIAL_PROVIDER_INPUT, - DELETE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT as _SCHEMA_DELETE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT, DELETE_ONLINE_EVALUATION_CONFIG as _SCHEMA_DELETE_ONLINE_EVALUATION_CONFIG, - DELETE_ONLINE_EVALUATION_CONFIG_INPUT as _SCHEMA_DELETE_ONLINE_EVALUATION_CONFIG_INPUT, - DELETE_ONLINE_EVALUATION_CONFIG_OUTPUT as _SCHEMA_DELETE_ONLINE_EVALUATION_CONFIG_OUTPUT, DELETE_PAYMENT_CONNECTOR as _SCHEMA_DELETE_PAYMENT_CONNECTOR, - DELETE_PAYMENT_CONNECTOR_INPUT as _SCHEMA_DELETE_PAYMENT_CONNECTOR_INPUT, - DELETE_PAYMENT_CONNECTOR_OUTPUT as _SCHEMA_DELETE_PAYMENT_CONNECTOR_OUTPUT, DELETE_PAYMENT_CREDENTIAL_PROVIDER as _SCHEMA_DELETE_PAYMENT_CREDENTIAL_PROVIDER, - DELETE_PAYMENT_CREDENTIAL_PROVIDER_INPUT as _SCHEMA_DELETE_PAYMENT_CREDENTIAL_PROVIDER_INPUT, - DELETE_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT as _SCHEMA_DELETE_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT, DELETE_PAYMENT_MANAGER as _SCHEMA_DELETE_PAYMENT_MANAGER, - DELETE_PAYMENT_MANAGER_INPUT as _SCHEMA_DELETE_PAYMENT_MANAGER_INPUT, - DELETE_PAYMENT_MANAGER_OUTPUT as _SCHEMA_DELETE_PAYMENT_MANAGER_OUTPUT, DELETE_POLICY as _SCHEMA_DELETE_POLICY, DELETE_POLICY_ENGINE as _SCHEMA_DELETE_POLICY_ENGINE, - DELETE_POLICY_ENGINE_INPUT as _SCHEMA_DELETE_POLICY_ENGINE_INPUT, - DELETE_POLICY_ENGINE_OUTPUT as _SCHEMA_DELETE_POLICY_ENGINE_OUTPUT, - DELETE_POLICY_INPUT as _SCHEMA_DELETE_POLICY_INPUT, - DELETE_POLICY_OUTPUT as _SCHEMA_DELETE_POLICY_OUTPUT, DELETE_REGISTRY as _SCHEMA_DELETE_REGISTRY, - DELETE_REGISTRY_INPUT as _SCHEMA_DELETE_REGISTRY_INPUT, - DELETE_REGISTRY_OUTPUT as _SCHEMA_DELETE_REGISTRY_OUTPUT, DELETE_REGISTRY_RECORD as _SCHEMA_DELETE_REGISTRY_RECORD, - DELETE_REGISTRY_RECORD_INPUT as _SCHEMA_DELETE_REGISTRY_RECORD_INPUT, - DELETE_REGISTRY_RECORD_OUTPUT as _SCHEMA_DELETE_REGISTRY_RECORD_OUTPUT, DELETE_RESOURCE_POLICY as _SCHEMA_DELETE_RESOURCE_POLICY, - DELETE_RESOURCE_POLICY_INPUT as _SCHEMA_DELETE_RESOURCE_POLICY_INPUT, - DELETE_RESOURCE_POLICY_OUTPUT as _SCHEMA_DELETE_RESOURCE_POLICY_OUTPUT, DELETE_WORKLOAD_IDENTITY as _SCHEMA_DELETE_WORKLOAD_IDENTITY, - DELETE_WORKLOAD_IDENTITY_INPUT as _SCHEMA_DELETE_WORKLOAD_IDENTITY_INPUT, - DELETE_WORKLOAD_IDENTITY_OUTPUT as _SCHEMA_DELETE_WORKLOAD_IDENTITY_OUTPUT, - DERIVED_EVALUATOR_CONFIG as _SCHEMA_DERIVED_EVALUATOR_CONFIG, - DESCRIPTORS as _SCHEMA_DESCRIPTORS, - EBS_VOLUME_CONFIGURATION as _SCHEMA_EBS_VOLUME_CONFIGURATION, - EC2_CONFIGURATION as _SCHEMA_EC2_CONFIGURATION, - EFS_ACCESS_POINT_CONFIGURATION as _SCHEMA_EFS_ACCESS_POINT_CONFIGURATION, - EFS_CONFIGURATION as _SCHEMA_EFS_CONFIGURATION, - ENCRYPTION_FAILURE as _SCHEMA_ENCRYPTION_FAILURE, - EPHEMERAL_BLOCK_DEVICE_MAPPING as _SCHEMA_EPHEMERAL_BLOCK_DEVICE_MAPPING, - EPHEMERAL_EBS_VOLUME_CONFIGURATION as _SCHEMA_EPHEMERAL_EBS_VOLUME_CONFIGURATION, - EPISODIC_CONSOLIDATION_OVERRIDE as _SCHEMA_EPISODIC_CONSOLIDATION_OVERRIDE, - EPISODIC_EXTRACTION_OVERRIDE as _SCHEMA_EPISODIC_EXTRACTION_OVERRIDE, - EPISODIC_MEMORY_STRATEGY_INPUT as _SCHEMA_EPISODIC_MEMORY_STRATEGY_INPUT, - EPISODIC_OVERRIDE_CONFIGURATION_INPUT as _SCHEMA_EPISODIC_OVERRIDE_CONFIGURATION_INPUT, - EPISODIC_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT as _SCHEMA_EPISODIC_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT, - EPISODIC_OVERRIDE_EXTRACTION_CONFIGURATION_INPUT as _SCHEMA_EPISODIC_OVERRIDE_EXTRACTION_CONFIGURATION_INPUT, - EPISODIC_OVERRIDE_REFLECTION_CONFIGURATION_INPUT as _SCHEMA_EPISODIC_OVERRIDE_REFLECTION_CONFIGURATION_INPUT, - EPISODIC_REFLECTION_CONFIGURATION as _SCHEMA_EPISODIC_REFLECTION_CONFIGURATION, - EPISODIC_REFLECTION_CONFIGURATION_INPUT as _SCHEMA_EPISODIC_REFLECTION_CONFIGURATION_INPUT, - EPISODIC_REFLECTION_OVERRIDE as _SCHEMA_EPISODIC_REFLECTION_OVERRIDE, - EVALUATOR_CONFIG as _SCHEMA_EVALUATOR_CONFIG, - EVALUATOR_MODEL_CONFIG as _SCHEMA_EVALUATOR_MODEL_CONFIG, - EVALUATOR_REFERENCE as _SCHEMA_EVALUATOR_REFERENCE, - EVALUATOR_SUMMARY as _SCHEMA_EVALUATOR_SUMMARY, - EXTRACTION_CONFIG as _SCHEMA_EXTRACTION_CONFIG, - EXTRACTION_CONFIGURATION as _SCHEMA_EXTRACTION_CONFIGURATION, - FILESYSTEM_CONFIGURATION as _SCHEMA_FILESYSTEM_CONFIGURATION, - FILTER as _SCHEMA_FILTER, - FILTER_VALUE as _SCHEMA_FILTER_VALUE, - FINDING as _SCHEMA_FINDING, - FROM_URL_SYNCHRONIZATION_CONFIGURATION as _SCHEMA_FROM_URL_SYNCHRONIZATION_CONFIGURATION, - GATEWAY_API_KEY_CREDENTIAL_PROVIDER as _SCHEMA_GATEWAY_API_KEY_CREDENTIAL_PROVIDER, - GATEWAY_INTERCEPTOR_CONFIGURATION as _SCHEMA_GATEWAY_INTERCEPTOR_CONFIGURATION, - GATEWAY_POLICY_ENGINE_CONFIGURATION as _SCHEMA_GATEWAY_POLICY_ENGINE_CONFIGURATION, - GATEWAY_PROTOCOL_CONFIGURATION as _SCHEMA_GATEWAY_PROTOCOL_CONFIGURATION, - GATEWAY_RATE_LIMIT_DETAIL as _SCHEMA_GATEWAY_RATE_LIMIT_DETAIL, - GATEWAY_RULE_DETAIL as _SCHEMA_GATEWAY_RULE_DETAIL, - GATEWAY_SUMMARY as _SCHEMA_GATEWAY_SUMMARY, - GATEWAY_TARGET as _SCHEMA_GATEWAY_TARGET, GET_AGENT_RUNTIME as _SCHEMA_GET_AGENT_RUNTIME, GET_AGENT_RUNTIME_ENDPOINT as _SCHEMA_GET_AGENT_RUNTIME_ENDPOINT, - GET_AGENT_RUNTIME_ENDPOINT_INPUT as _SCHEMA_GET_AGENT_RUNTIME_ENDPOINT_INPUT, - GET_AGENT_RUNTIME_ENDPOINT_OUTPUT as _SCHEMA_GET_AGENT_RUNTIME_ENDPOINT_OUTPUT, - GET_AGENT_RUNTIME_INPUT as _SCHEMA_GET_AGENT_RUNTIME_INPUT, - GET_AGENT_RUNTIME_OUTPUT as _SCHEMA_GET_AGENT_RUNTIME_OUTPUT, GET_API_KEY_CREDENTIAL_PROVIDER as _SCHEMA_GET_API_KEY_CREDENTIAL_PROVIDER, - GET_API_KEY_CREDENTIAL_PROVIDER_INPUT as _SCHEMA_GET_API_KEY_CREDENTIAL_PROVIDER_INPUT, - GET_API_KEY_CREDENTIAL_PROVIDER_OUTPUT as _SCHEMA_GET_API_KEY_CREDENTIAL_PROVIDER_OUTPUT, GET_BROWSER as _SCHEMA_GET_BROWSER, - GET_BROWSER_INPUT as _SCHEMA_GET_BROWSER_INPUT, - GET_BROWSER_OUTPUT as _SCHEMA_GET_BROWSER_OUTPUT, GET_BROWSER_PROFILE as _SCHEMA_GET_BROWSER_PROFILE, - GET_BROWSER_PROFILE_INPUT as _SCHEMA_GET_BROWSER_PROFILE_INPUT, - GET_BROWSER_PROFILE_OUTPUT as _SCHEMA_GET_BROWSER_PROFILE_OUTPUT, GET_CAPACITY_PROVIDER as _SCHEMA_GET_CAPACITY_PROVIDER, - GET_CAPACITY_PROVIDER_INPUT as _SCHEMA_GET_CAPACITY_PROVIDER_INPUT, - GET_CAPACITY_PROVIDER_OUTPUT as _SCHEMA_GET_CAPACITY_PROVIDER_OUTPUT, GET_CODE_INTERPRETER as _SCHEMA_GET_CODE_INTERPRETER, - GET_CODE_INTERPRETER_INPUT as _SCHEMA_GET_CODE_INTERPRETER_INPUT, - GET_CODE_INTERPRETER_OUTPUT as _SCHEMA_GET_CODE_INTERPRETER_OUTPUT, GET_CONFIGURATION_BUNDLE as _SCHEMA_GET_CONFIGURATION_BUNDLE, - GET_CONFIGURATION_BUNDLE_INPUT as _SCHEMA_GET_CONFIGURATION_BUNDLE_INPUT, - GET_CONFIGURATION_BUNDLE_OUTPUT as _SCHEMA_GET_CONFIGURATION_BUNDLE_OUTPUT, GET_CONFIGURATION_BUNDLE_VERSION as _SCHEMA_GET_CONFIGURATION_BUNDLE_VERSION, - GET_CONFIGURATION_BUNDLE_VERSION_INPUT as _SCHEMA_GET_CONFIGURATION_BUNDLE_VERSION_INPUT, - GET_CONFIGURATION_BUNDLE_VERSION_OUTPUT as _SCHEMA_GET_CONFIGURATION_BUNDLE_VERSION_OUTPUT, GET_CONSENT_PORTAL as _SCHEMA_GET_CONSENT_PORTAL, - GET_CONSENT_PORTAL_INPUT as _SCHEMA_GET_CONSENT_PORTAL_INPUT, - GET_CONSENT_PORTAL_OUTPUT as _SCHEMA_GET_CONSENT_PORTAL_OUTPUT, GET_DATASET as _SCHEMA_GET_DATASET, - GET_DATASET_INPUT as _SCHEMA_GET_DATASET_INPUT, - GET_DATASET_OUTPUT as _SCHEMA_GET_DATASET_OUTPUT, GET_EVALUATOR as _SCHEMA_GET_EVALUATOR, - GET_EVALUATOR_INPUT as _SCHEMA_GET_EVALUATOR_INPUT, - GET_EVALUATOR_OUTPUT as _SCHEMA_GET_EVALUATOR_OUTPUT, GET_GATEWAY as _SCHEMA_GET_GATEWAY, - GET_GATEWAY_INPUT as _SCHEMA_GET_GATEWAY_INPUT, - GET_GATEWAY_OUTPUT as _SCHEMA_GET_GATEWAY_OUTPUT, GET_GATEWAY_RATE_LIMIT as _SCHEMA_GET_GATEWAY_RATE_LIMIT, - GET_GATEWAY_RATE_LIMIT_INPUT as _SCHEMA_GET_GATEWAY_RATE_LIMIT_INPUT, - GET_GATEWAY_RATE_LIMIT_OUTPUT as _SCHEMA_GET_GATEWAY_RATE_LIMIT_OUTPUT, GET_GATEWAY_RULE as _SCHEMA_GET_GATEWAY_RULE, - GET_GATEWAY_RULE_INPUT as _SCHEMA_GET_GATEWAY_RULE_INPUT, - GET_GATEWAY_RULE_OUTPUT as _SCHEMA_GET_GATEWAY_RULE_OUTPUT, GET_GATEWAY_TARGET as _SCHEMA_GET_GATEWAY_TARGET, - GET_GATEWAY_TARGET_INPUT as _SCHEMA_GET_GATEWAY_TARGET_INPUT, - GET_GATEWAY_TARGET_OUTPUT as _SCHEMA_GET_GATEWAY_TARGET_OUTPUT, GET_HARNESS as _SCHEMA_GET_HARNESS, GET_HARNESS_ENDPOINT as _SCHEMA_GET_HARNESS_ENDPOINT, - GET_HARNESS_ENDPOINT_INPUT as _SCHEMA_GET_HARNESS_ENDPOINT_INPUT, - GET_HARNESS_ENDPOINT_OUTPUT as _SCHEMA_GET_HARNESS_ENDPOINT_OUTPUT, - GET_HARNESS_INPUT as _SCHEMA_GET_HARNESS_INPUT, - GET_HARNESS_OUTPUT as _SCHEMA_GET_HARNESS_OUTPUT, GET_MEMORY as _SCHEMA_GET_MEMORY, - GET_MEMORY_INPUT as _SCHEMA_GET_MEMORY_INPUT, - GET_MEMORY_OUTPUT as _SCHEMA_GET_MEMORY_OUTPUT, GET_OAUTH2_CREDENTIAL_PROVIDER as _SCHEMA_GET_OAUTH2_CREDENTIAL_PROVIDER, - GET_OAUTH2_CREDENTIAL_PROVIDER_INPUT as _SCHEMA_GET_OAUTH2_CREDENTIAL_PROVIDER_INPUT, - GET_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT as _SCHEMA_GET_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT, GET_ONLINE_EVALUATION_CONFIG as _SCHEMA_GET_ONLINE_EVALUATION_CONFIG, - GET_ONLINE_EVALUATION_CONFIG_INPUT as _SCHEMA_GET_ONLINE_EVALUATION_CONFIG_INPUT, - GET_ONLINE_EVALUATION_CONFIG_OUTPUT as _SCHEMA_GET_ONLINE_EVALUATION_CONFIG_OUTPUT, GET_PAYMENT_CONNECTOR as _SCHEMA_GET_PAYMENT_CONNECTOR, - GET_PAYMENT_CONNECTOR_INPUT as _SCHEMA_GET_PAYMENT_CONNECTOR_INPUT, - GET_PAYMENT_CONNECTOR_OUTPUT as _SCHEMA_GET_PAYMENT_CONNECTOR_OUTPUT, GET_PAYMENT_CREDENTIAL_PROVIDER as _SCHEMA_GET_PAYMENT_CREDENTIAL_PROVIDER, - GET_PAYMENT_CREDENTIAL_PROVIDER_INPUT as _SCHEMA_GET_PAYMENT_CREDENTIAL_PROVIDER_INPUT, - GET_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT as _SCHEMA_GET_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT, GET_PAYMENT_MANAGER as _SCHEMA_GET_PAYMENT_MANAGER, - GET_PAYMENT_MANAGER_INPUT as _SCHEMA_GET_PAYMENT_MANAGER_INPUT, - GET_PAYMENT_MANAGER_OUTPUT as _SCHEMA_GET_PAYMENT_MANAGER_OUTPUT, GET_POLICY as _SCHEMA_GET_POLICY, GET_POLICY_ENGINE as _SCHEMA_GET_POLICY_ENGINE, - GET_POLICY_ENGINE_INPUT as _SCHEMA_GET_POLICY_ENGINE_INPUT, - GET_POLICY_ENGINE_OUTPUT as _SCHEMA_GET_POLICY_ENGINE_OUTPUT, GET_POLICY_ENGINE_SUMMARY as _SCHEMA_GET_POLICY_ENGINE_SUMMARY, - GET_POLICY_ENGINE_SUMMARY_INPUT as _SCHEMA_GET_POLICY_ENGINE_SUMMARY_INPUT, - GET_POLICY_ENGINE_SUMMARY_OUTPUT as _SCHEMA_GET_POLICY_ENGINE_SUMMARY_OUTPUT, GET_POLICY_GENERATION as _SCHEMA_GET_POLICY_GENERATION, - GET_POLICY_GENERATION_INPUT as _SCHEMA_GET_POLICY_GENERATION_INPUT, - GET_POLICY_GENERATION_OUTPUT as _SCHEMA_GET_POLICY_GENERATION_OUTPUT, GET_POLICY_GENERATION_SUMMARY as _SCHEMA_GET_POLICY_GENERATION_SUMMARY, - GET_POLICY_GENERATION_SUMMARY_INPUT as _SCHEMA_GET_POLICY_GENERATION_SUMMARY_INPUT, - GET_POLICY_GENERATION_SUMMARY_OUTPUT as _SCHEMA_GET_POLICY_GENERATION_SUMMARY_OUTPUT, - GET_POLICY_INPUT as _SCHEMA_GET_POLICY_INPUT, - GET_POLICY_OUTPUT as _SCHEMA_GET_POLICY_OUTPUT, GET_POLICY_SUMMARY as _SCHEMA_GET_POLICY_SUMMARY, - GET_POLICY_SUMMARY_INPUT as _SCHEMA_GET_POLICY_SUMMARY_INPUT, - GET_POLICY_SUMMARY_OUTPUT as _SCHEMA_GET_POLICY_SUMMARY_OUTPUT, GET_REGISTRY as _SCHEMA_GET_REGISTRY, - GET_REGISTRY_INPUT as _SCHEMA_GET_REGISTRY_INPUT, - GET_REGISTRY_OUTPUT as _SCHEMA_GET_REGISTRY_OUTPUT, GET_REGISTRY_RECORD as _SCHEMA_GET_REGISTRY_RECORD, - GET_REGISTRY_RECORD_INPUT as _SCHEMA_GET_REGISTRY_RECORD_INPUT, - GET_REGISTRY_RECORD_OUTPUT as _SCHEMA_GET_REGISTRY_RECORD_OUTPUT, GET_RESOURCE_POLICY as _SCHEMA_GET_RESOURCE_POLICY, - GET_RESOURCE_POLICY_INPUT as _SCHEMA_GET_RESOURCE_POLICY_INPUT, - GET_RESOURCE_POLICY_OUTPUT as _SCHEMA_GET_RESOURCE_POLICY_OUTPUT, GET_TOKEN_VAULT as _SCHEMA_GET_TOKEN_VAULT, - GET_TOKEN_VAULT_INPUT as _SCHEMA_GET_TOKEN_VAULT_INPUT, - GET_TOKEN_VAULT_OUTPUT as _SCHEMA_GET_TOKEN_VAULT_OUTPUT, GET_WORKLOAD_IDENTITY as _SCHEMA_GET_WORKLOAD_IDENTITY, - GET_WORKLOAD_IDENTITY_INPUT as _SCHEMA_GET_WORKLOAD_IDENTITY_INPUT, - GET_WORKLOAD_IDENTITY_OUTPUT as _SCHEMA_GET_WORKLOAD_IDENTITY_OUTPUT, - GITHUB_OAUTH2_PROVIDER_CONFIG_INPUT as _SCHEMA_GITHUB_OAUTH2_PROVIDER_CONFIG_INPUT, - GITHUB_OAUTH2_PROVIDER_CONFIG_OUTPUT as _SCHEMA_GITHUB_OAUTH2_PROVIDER_CONFIG_OUTPUT, - GOOGLE_OAUTH2_PROVIDER_CONFIG_INPUT as _SCHEMA_GOOGLE_OAUTH2_PROVIDER_CONFIG_INPUT, - GOOGLE_OAUTH2_PROVIDER_CONFIG_OUTPUT as _SCHEMA_GOOGLE_OAUTH2_PROVIDER_CONFIG_OUTPUT, - HARNESS as _SCHEMA_HARNESS, - HARNESS_AFTER_INVOCATION_HOOK as _SCHEMA_HARNESS_AFTER_INVOCATION_HOOK, - HARNESS_AFTER_TOOL_CALL_HOOK as _SCHEMA_HARNESS_AFTER_TOOL_CALL_HOOK, - HARNESS_AGENT_CORE_BROWSER_CONFIG as _SCHEMA_HARNESS_AGENT_CORE_BROWSER_CONFIG, - HARNESS_AGENT_CORE_CODE_INTERPRETER_CONFIG as _SCHEMA_HARNESS_AGENT_CORE_CODE_INTERPRETER_CONFIG, - HARNESS_AGENT_CORE_GATEWAY_CONFIG as _SCHEMA_HARNESS_AGENT_CORE_GATEWAY_CONFIG, - HARNESS_AGENT_CORE_MEMORY_CONFIGURATION as _SCHEMA_HARNESS_AGENT_CORE_MEMORY_CONFIGURATION, - HARNESS_AGENT_CORE_MEMORY_RETRIEVAL_CONFIG as _SCHEMA_HARNESS_AGENT_CORE_MEMORY_RETRIEVAL_CONFIG, - HARNESS_AGENT_CORE_RUNTIME_ENVIRONMENT as _SCHEMA_HARNESS_AGENT_CORE_RUNTIME_ENVIRONMENT, - HARNESS_AGENT_CORE_RUNTIME_ENVIRONMENT_REQUEST as _SCHEMA_HARNESS_AGENT_CORE_RUNTIME_ENVIRONMENT_REQUEST, - HARNESS_BEDROCK_MODEL_CONFIG as _SCHEMA_HARNESS_BEDROCK_MODEL_CONFIG, - HARNESS_BEFORE_INVOCATION_HOOK as _SCHEMA_HARNESS_BEFORE_INVOCATION_HOOK, - HARNESS_BEFORE_TOOL_CALL_HOOK as _SCHEMA_HARNESS_BEFORE_TOOL_CALL_HOOK, - HARNESS_DISABLED_MEMORY_CONFIGURATION as _SCHEMA_HARNESS_DISABLED_MEMORY_CONFIGURATION, - HARNESS_ENDPOINT as _SCHEMA_HARNESS_ENDPOINT, - HARNESS_ENVIRONMENT_ARTIFACT as _SCHEMA_HARNESS_ENVIRONMENT_ARTIFACT, - HARNESS_ENVIRONMENT_PROVIDER as _SCHEMA_HARNESS_ENVIRONMENT_PROVIDER, - HARNESS_ENVIRONMENT_PROVIDER_REQUEST as _SCHEMA_HARNESS_ENVIRONMENT_PROVIDER_REQUEST, - HARNESS_GATEWAY_OUTBOUND_AUTH as _SCHEMA_HARNESS_GATEWAY_OUTBOUND_AUTH, - HARNESS_GEMINI_MODEL_CONFIG as _SCHEMA_HARNESS_GEMINI_MODEL_CONFIG, - HARNESS_HOOK as _SCHEMA_HARNESS_HOOK, - HARNESS_HOOK_EVENT_BRIDGE_TARGET as _SCHEMA_HARNESS_HOOK_EVENT_BRIDGE_TARGET, - HARNESS_HOOK_LAMBDA_TARGET as _SCHEMA_HARNESS_HOOK_LAMBDA_TARGET, - HARNESS_HOOK_SNS_TARGET as _SCHEMA_HARNESS_HOOK_SNS_TARGET, - HARNESS_HOOK_TARGET as _SCHEMA_HARNESS_HOOK_TARGET, - HARNESS_INLINE_FUNCTION_CONFIG as _SCHEMA_HARNESS_INLINE_FUNCTION_CONFIG, - HARNESS_LITE_LLM_MODEL_CONFIG as _SCHEMA_HARNESS_LITE_LLM_MODEL_CONFIG, - HARNESS_MANAGED_MEMORY_CONFIGURATION as _SCHEMA_HARNESS_MANAGED_MEMORY_CONFIGURATION, - HARNESS_MEMORY_CONFIGURATION as _SCHEMA_HARNESS_MEMORY_CONFIGURATION, - HARNESS_MODEL_CONFIGURATION as _SCHEMA_HARNESS_MODEL_CONFIGURATION, - HARNESS_OPEN_AI_MODEL_CONFIG as _SCHEMA_HARNESS_OPEN_AI_MODEL_CONFIG, - HARNESS_REMOTE_MCP_CONFIG as _SCHEMA_HARNESS_REMOTE_MCP_CONFIG, - HARNESS_SKILL as _SCHEMA_HARNESS_SKILL, - HARNESS_SKILL_AWS_SKILLS_SOURCE as _SCHEMA_HARNESS_SKILL_AWS_SKILLS_SOURCE, - HARNESS_SKILL_GIT_AUTH as _SCHEMA_HARNESS_SKILL_GIT_AUTH, - HARNESS_SKILL_GIT_SOURCE as _SCHEMA_HARNESS_SKILL_GIT_SOURCE, - HARNESS_SKILL_S3_SOURCE as _SCHEMA_HARNESS_SKILL_S3_SOURCE, - HARNESS_SLIDING_WINDOW_CONFIGURATION as _SCHEMA_HARNESS_SLIDING_WINDOW_CONFIGURATION, - HARNESS_SUMMARIZATION_CONFIGURATION as _SCHEMA_HARNESS_SUMMARIZATION_CONFIGURATION, - HARNESS_SUMMARY as _SCHEMA_HARNESS_SUMMARY, - HARNESS_SYSTEM_CONTENT_BLOCK as _SCHEMA_HARNESS_SYSTEM_CONTENT_BLOCK, - HARNESS_TOOL as _SCHEMA_HARNESS_TOOL, - HARNESS_TOOL_CONFIGURATION as _SCHEMA_HARNESS_TOOL_CONFIGURATION, - HARNESS_TRUNCATION_CONFIGURATION as _SCHEMA_HARNESS_TRUNCATION_CONFIGURATION, - HARNESS_TRUNCATION_STRATEGY_CONFIGURATION as _SCHEMA_HARNESS_TRUNCATION_STRATEGY_CONFIGURATION, - HARNESS_VERSION_SUMMARY as _SCHEMA_HARNESS_VERSION_SUMMARY, - HOSTING_ENVIRONMENT as _SCHEMA_HOSTING_ENVIRONMENT, - HTTP_API_SCHEMA_CONFIGURATION as _SCHEMA_HTTP_API_SCHEMA_CONFIGURATION, - HTTP_CONNECTOR_SOURCE as _SCHEMA_HTTP_CONNECTOR_SOURCE, - HTTP_CONNECTOR_TARGET_CONFIGURATION as _SCHEMA_HTTP_CONNECTOR_TARGET_CONFIGURATION, - HTTP_TARGET_CONFIGURATION as _SCHEMA_HTTP_TARGET_CONFIGURATION, - IAM_CREDENTIAL_PROVIDER as _SCHEMA_IAM_CREDENTIAL_PROVIDER, - IAM_PRINCIPAL as _SCHEMA_IAM_PRINCIPAL, - INCLUDED_OAUTH2_PROVIDER_CONFIG_INPUT as _SCHEMA_INCLUDED_OAUTH2_PROVIDER_CONFIG_INPUT, - INCLUDED_OAUTH2_PROVIDER_CONFIG_OUTPUT as _SCHEMA_INCLUDED_OAUTH2_PROVIDER_CONFIG_OUTPUT, - INDEXED_KEY as _SCHEMA_INDEXED_KEY, - INFERENCE_CONFIGURATION as _SCHEMA_INFERENCE_CONFIGURATION, - INFERENCE_CONNECTOR_SOURCE as _SCHEMA_INFERENCE_CONNECTOR_SOURCE, - INFERENCE_CONNECTOR_TARGET_CONFIGURATION as _SCHEMA_INFERENCE_CONNECTOR_TARGET_CONFIGURATION, - INFERENCE_OPERATION_CONFIGURATION as _SCHEMA_INFERENCE_OPERATION_CONFIGURATION, - INFERENCE_PROVIDER_TARGET_CONFIGURATION as _SCHEMA_INFERENCE_PROVIDER_TARGET_CONFIGURATION, - INFERENCE_TARGET_CONFIGURATION as _SCHEMA_INFERENCE_TARGET_CONFIGURATION, - INLINE_EXAMPLES_SOURCE as _SCHEMA_INLINE_EXAMPLES_SOURCE, - INSIGHT as _SCHEMA_INSIGHT, - INSTANCE_LIFECYCLE_CONFIGURATION as _SCHEMA_INSTANCE_LIFECYCLE_CONFIGURATION, - INSTANCE_REQUIREMENTS as _SCHEMA_INSTANCE_REQUIREMENTS, - INTERCEPTOR_CONFIGURATION as _SCHEMA_INTERCEPTOR_CONFIGURATION, - INTERCEPTOR_INPUT_CONFIGURATION as _SCHEMA_INTERCEPTOR_INPUT_CONFIGURATION, - INTERCEPTOR_PAYLOAD_EXCLUSION_SELECTOR as _SCHEMA_INTERCEPTOR_PAYLOAD_EXCLUSION_SELECTOR, - INTERCEPTOR_PAYLOAD_FILTER as _SCHEMA_INTERCEPTOR_PAYLOAD_FILTER, - INTERNAL_SERVER_EXCEPTION as _SCHEMA_INTERNAL_SERVER_EXCEPTION, - INVOCATION_CONFIGURATION as _SCHEMA_INVOCATION_CONFIGURATION, - INVOCATION_CONFIGURATION_INPUT as _SCHEMA_INVOCATION_CONFIGURATION_INPUT, - KINESIS_RESOURCE as _SCHEMA_KINESIS_RESOURCE, - KMS_CONFIGURATION as _SCHEMA_KMS_CONFIGURATION, - KMS_KEY_SOURCE_TYPE as _SCHEMA_KMS_KEY_SOURCE_TYPE, - LAMBDA_EVALUATOR_CONFIG as _SCHEMA_LAMBDA_EVALUATOR_CONFIG, - LAMBDA_INTERCEPTOR_CONFIGURATION as _SCHEMA_LAMBDA_INTERCEPTOR_CONFIGURATION, - LAMBDA_TRANSFORM_CONFIGURATION as _SCHEMA_LAMBDA_TRANSFORM_CONFIGURATION, - LAUNCH_PARAMETERS as _SCHEMA_LAUNCH_PARAMETERS, - LAUNCH_TEMPLATE_SOURCE as _SCHEMA_LAUNCH_TEMPLATE_SOURCE, - LICENSE_SPECIFICATION as _SCHEMA_LICENSE_SPECIFICATION, - LIFECYCLE_CONFIGURATION as _SCHEMA_LIFECYCLE_CONFIGURATION, - LIMIT_ENTRY as _SCHEMA_LIMIT_ENTRY, - LINKEDIN_OAUTH2_PROVIDER_CONFIG_INPUT as _SCHEMA_LINKEDIN_OAUTH2_PROVIDER_CONFIG_INPUT, - LINKEDIN_OAUTH2_PROVIDER_CONFIG_OUTPUT as _SCHEMA_LINKEDIN_OAUTH2_PROVIDER_CONFIG_OUTPUT, LIST_AGENT_RUNTIMES as _SCHEMA_LIST_AGENT_RUNTIMES, - LIST_AGENT_RUNTIMES_INPUT as _SCHEMA_LIST_AGENT_RUNTIMES_INPUT, - LIST_AGENT_RUNTIMES_OUTPUT as _SCHEMA_LIST_AGENT_RUNTIMES_OUTPUT, LIST_AGENT_RUNTIME_ENDPOINTS as _SCHEMA_LIST_AGENT_RUNTIME_ENDPOINTS, - LIST_AGENT_RUNTIME_ENDPOINTS_INPUT as _SCHEMA_LIST_AGENT_RUNTIME_ENDPOINTS_INPUT, - LIST_AGENT_RUNTIME_ENDPOINTS_OUTPUT as _SCHEMA_LIST_AGENT_RUNTIME_ENDPOINTS_OUTPUT, LIST_AGENT_RUNTIME_VERSIONS as _SCHEMA_LIST_AGENT_RUNTIME_VERSIONS, LIST_AGENT_RUNTIME_VERSIONS_BY_CAPACITY_PROVIDER as _SCHEMA_LIST_AGENT_RUNTIME_VERSIONS_BY_CAPACITY_PROVIDER, - LIST_AGENT_RUNTIME_VERSIONS_BY_CAPACITY_PROVIDER_INPUT as _SCHEMA_LIST_AGENT_RUNTIME_VERSIONS_BY_CAPACITY_PROVIDER_INPUT, - LIST_AGENT_RUNTIME_VERSIONS_BY_CAPACITY_PROVIDER_OUTPUT as _SCHEMA_LIST_AGENT_RUNTIME_VERSIONS_BY_CAPACITY_PROVIDER_OUTPUT, - LIST_AGENT_RUNTIME_VERSIONS_INPUT as _SCHEMA_LIST_AGENT_RUNTIME_VERSIONS_INPUT, - LIST_AGENT_RUNTIME_VERSIONS_OUTPUT as _SCHEMA_LIST_AGENT_RUNTIME_VERSIONS_OUTPUT, LIST_API_KEY_CREDENTIAL_PROVIDERS as _SCHEMA_LIST_API_KEY_CREDENTIAL_PROVIDERS, - LIST_API_KEY_CREDENTIAL_PROVIDERS_INPUT as _SCHEMA_LIST_API_KEY_CREDENTIAL_PROVIDERS_INPUT, - LIST_API_KEY_CREDENTIAL_PROVIDERS_OUTPUT as _SCHEMA_LIST_API_KEY_CREDENTIAL_PROVIDERS_OUTPUT, LIST_BROWSERS as _SCHEMA_LIST_BROWSERS, - LIST_BROWSERS_INPUT as _SCHEMA_LIST_BROWSERS_INPUT, - LIST_BROWSERS_OUTPUT as _SCHEMA_LIST_BROWSERS_OUTPUT, LIST_BROWSER_PROFILES as _SCHEMA_LIST_BROWSER_PROFILES, - LIST_BROWSER_PROFILES_INPUT as _SCHEMA_LIST_BROWSER_PROFILES_INPUT, - LIST_BROWSER_PROFILES_OUTPUT as _SCHEMA_LIST_BROWSER_PROFILES_OUTPUT, LIST_CAPACITY_PROVIDERS as _SCHEMA_LIST_CAPACITY_PROVIDERS, - LIST_CAPACITY_PROVIDERS_INPUT as _SCHEMA_LIST_CAPACITY_PROVIDERS_INPUT, - LIST_CAPACITY_PROVIDERS_OUTPUT as _SCHEMA_LIST_CAPACITY_PROVIDERS_OUTPUT, LIST_CODE_INTERPRETERS as _SCHEMA_LIST_CODE_INTERPRETERS, - LIST_CODE_INTERPRETERS_INPUT as _SCHEMA_LIST_CODE_INTERPRETERS_INPUT, - LIST_CODE_INTERPRETERS_OUTPUT as _SCHEMA_LIST_CODE_INTERPRETERS_OUTPUT, LIST_CONFIGURATION_BUNDLES as _SCHEMA_LIST_CONFIGURATION_BUNDLES, - LIST_CONFIGURATION_BUNDLES_INPUT as _SCHEMA_LIST_CONFIGURATION_BUNDLES_INPUT, - LIST_CONFIGURATION_BUNDLES_OUTPUT as _SCHEMA_LIST_CONFIGURATION_BUNDLES_OUTPUT, LIST_CONFIGURATION_BUNDLE_VERSIONS as _SCHEMA_LIST_CONFIGURATION_BUNDLE_VERSIONS, - LIST_CONFIGURATION_BUNDLE_VERSIONS_INPUT as _SCHEMA_LIST_CONFIGURATION_BUNDLE_VERSIONS_INPUT, - LIST_CONFIGURATION_BUNDLE_VERSIONS_OUTPUT as _SCHEMA_LIST_CONFIGURATION_BUNDLE_VERSIONS_OUTPUT, LIST_CONSENT_PORTALS as _SCHEMA_LIST_CONSENT_PORTALS, - LIST_CONSENT_PORTALS_INPUT as _SCHEMA_LIST_CONSENT_PORTALS_INPUT, - LIST_CONSENT_PORTALS_OUTPUT as _SCHEMA_LIST_CONSENT_PORTALS_OUTPUT, LIST_DATASETS as _SCHEMA_LIST_DATASETS, - LIST_DATASETS_INPUT as _SCHEMA_LIST_DATASETS_INPUT, - LIST_DATASETS_OUTPUT as _SCHEMA_LIST_DATASETS_OUTPUT, LIST_DATASET_EXAMPLES as _SCHEMA_LIST_DATASET_EXAMPLES, - LIST_DATASET_EXAMPLES_INPUT as _SCHEMA_LIST_DATASET_EXAMPLES_INPUT, - LIST_DATASET_EXAMPLES_OUTPUT as _SCHEMA_LIST_DATASET_EXAMPLES_OUTPUT, LIST_DATASET_VERSIONS as _SCHEMA_LIST_DATASET_VERSIONS, - LIST_DATASET_VERSIONS_INPUT as _SCHEMA_LIST_DATASET_VERSIONS_INPUT, - LIST_DATASET_VERSIONS_OUTPUT as _SCHEMA_LIST_DATASET_VERSIONS_OUTPUT, LIST_EVALUATORS as _SCHEMA_LIST_EVALUATORS, - LIST_EVALUATORS_INPUT as _SCHEMA_LIST_EVALUATORS_INPUT, - LIST_EVALUATORS_OUTPUT as _SCHEMA_LIST_EVALUATORS_OUTPUT, LIST_GATEWAYS as _SCHEMA_LIST_GATEWAYS, - LIST_GATEWAYS_INPUT as _SCHEMA_LIST_GATEWAYS_INPUT, - LIST_GATEWAYS_OUTPUT as _SCHEMA_LIST_GATEWAYS_OUTPUT, LIST_GATEWAY_RATE_LIMITS as _SCHEMA_LIST_GATEWAY_RATE_LIMITS, - LIST_GATEWAY_RATE_LIMITS_INPUT as _SCHEMA_LIST_GATEWAY_RATE_LIMITS_INPUT, - LIST_GATEWAY_RATE_LIMITS_OUTPUT as _SCHEMA_LIST_GATEWAY_RATE_LIMITS_OUTPUT, LIST_GATEWAY_RULES as _SCHEMA_LIST_GATEWAY_RULES, - LIST_GATEWAY_RULES_INPUT as _SCHEMA_LIST_GATEWAY_RULES_INPUT, - LIST_GATEWAY_RULES_OUTPUT as _SCHEMA_LIST_GATEWAY_RULES_OUTPUT, LIST_GATEWAY_TARGETS as _SCHEMA_LIST_GATEWAY_TARGETS, - LIST_GATEWAY_TARGETS_INPUT as _SCHEMA_LIST_GATEWAY_TARGETS_INPUT, - LIST_GATEWAY_TARGETS_OUTPUT as _SCHEMA_LIST_GATEWAY_TARGETS_OUTPUT, LIST_HARNESSES as _SCHEMA_LIST_HARNESSES, - LIST_HARNESSES_INPUT as _SCHEMA_LIST_HARNESSES_INPUT, - LIST_HARNESSES_OUTPUT as _SCHEMA_LIST_HARNESSES_OUTPUT, LIST_HARNESS_ENDPOINTS as _SCHEMA_LIST_HARNESS_ENDPOINTS, - LIST_HARNESS_ENDPOINTS_INPUT as _SCHEMA_LIST_HARNESS_ENDPOINTS_INPUT, - LIST_HARNESS_ENDPOINTS_OUTPUT as _SCHEMA_LIST_HARNESS_ENDPOINTS_OUTPUT, LIST_HARNESS_VERSIONS as _SCHEMA_LIST_HARNESS_VERSIONS, - LIST_HARNESS_VERSIONS_INPUT as _SCHEMA_LIST_HARNESS_VERSIONS_INPUT, - LIST_HARNESS_VERSIONS_OUTPUT as _SCHEMA_LIST_HARNESS_VERSIONS_OUTPUT, LIST_MEMORIES as _SCHEMA_LIST_MEMORIES, - LIST_MEMORIES_INPUT as _SCHEMA_LIST_MEMORIES_INPUT, - LIST_MEMORIES_OUTPUT as _SCHEMA_LIST_MEMORIES_OUTPUT, LIST_OAUTH2_CREDENTIAL_PROVIDERS as _SCHEMA_LIST_OAUTH2_CREDENTIAL_PROVIDERS, - LIST_OAUTH2_CREDENTIAL_PROVIDERS_INPUT as _SCHEMA_LIST_OAUTH2_CREDENTIAL_PROVIDERS_INPUT, - LIST_OAUTH2_CREDENTIAL_PROVIDERS_OUTPUT as _SCHEMA_LIST_OAUTH2_CREDENTIAL_PROVIDERS_OUTPUT, LIST_ONLINE_EVALUATION_CONFIGS as _SCHEMA_LIST_ONLINE_EVALUATION_CONFIGS, - LIST_ONLINE_EVALUATION_CONFIGS_INPUT as _SCHEMA_LIST_ONLINE_EVALUATION_CONFIGS_INPUT, - LIST_ONLINE_EVALUATION_CONFIGS_OUTPUT as _SCHEMA_LIST_ONLINE_EVALUATION_CONFIGS_OUTPUT, LIST_PAYMENT_CONNECTORS as _SCHEMA_LIST_PAYMENT_CONNECTORS, - LIST_PAYMENT_CONNECTORS_INPUT as _SCHEMA_LIST_PAYMENT_CONNECTORS_INPUT, - LIST_PAYMENT_CONNECTORS_OUTPUT as _SCHEMA_LIST_PAYMENT_CONNECTORS_OUTPUT, LIST_PAYMENT_CREDENTIAL_PROVIDERS as _SCHEMA_LIST_PAYMENT_CREDENTIAL_PROVIDERS, - LIST_PAYMENT_CREDENTIAL_PROVIDERS_INPUT as _SCHEMA_LIST_PAYMENT_CREDENTIAL_PROVIDERS_INPUT, - LIST_PAYMENT_CREDENTIAL_PROVIDERS_OUTPUT as _SCHEMA_LIST_PAYMENT_CREDENTIAL_PROVIDERS_OUTPUT, LIST_PAYMENT_MANAGERS as _SCHEMA_LIST_PAYMENT_MANAGERS, - LIST_PAYMENT_MANAGERS_INPUT as _SCHEMA_LIST_PAYMENT_MANAGERS_INPUT, - LIST_PAYMENT_MANAGERS_OUTPUT as _SCHEMA_LIST_PAYMENT_MANAGERS_OUTPUT, LIST_POLICIES as _SCHEMA_LIST_POLICIES, - LIST_POLICIES_INPUT as _SCHEMA_LIST_POLICIES_INPUT, - LIST_POLICIES_OUTPUT as _SCHEMA_LIST_POLICIES_OUTPUT, LIST_POLICY_ENGINES as _SCHEMA_LIST_POLICY_ENGINES, - LIST_POLICY_ENGINES_INPUT as _SCHEMA_LIST_POLICY_ENGINES_INPUT, - LIST_POLICY_ENGINES_OUTPUT as _SCHEMA_LIST_POLICY_ENGINES_OUTPUT, LIST_POLICY_ENGINE_SUMMARIES as _SCHEMA_LIST_POLICY_ENGINE_SUMMARIES, - LIST_POLICY_ENGINE_SUMMARIES_INPUT as _SCHEMA_LIST_POLICY_ENGINE_SUMMARIES_INPUT, - LIST_POLICY_ENGINE_SUMMARIES_OUTPUT as _SCHEMA_LIST_POLICY_ENGINE_SUMMARIES_OUTPUT, LIST_POLICY_GENERATIONS as _SCHEMA_LIST_POLICY_GENERATIONS, - LIST_POLICY_GENERATIONS_INPUT as _SCHEMA_LIST_POLICY_GENERATIONS_INPUT, - LIST_POLICY_GENERATIONS_OUTPUT as _SCHEMA_LIST_POLICY_GENERATIONS_OUTPUT, LIST_POLICY_GENERATION_ASSETS as _SCHEMA_LIST_POLICY_GENERATION_ASSETS, - LIST_POLICY_GENERATION_ASSETS_INPUT as _SCHEMA_LIST_POLICY_GENERATION_ASSETS_INPUT, - LIST_POLICY_GENERATION_ASSETS_OUTPUT as _SCHEMA_LIST_POLICY_GENERATION_ASSETS_OUTPUT, LIST_POLICY_GENERATION_SUMMARIES as _SCHEMA_LIST_POLICY_GENERATION_SUMMARIES, - LIST_POLICY_GENERATION_SUMMARIES_INPUT as _SCHEMA_LIST_POLICY_GENERATION_SUMMARIES_INPUT, - LIST_POLICY_GENERATION_SUMMARIES_OUTPUT as _SCHEMA_LIST_POLICY_GENERATION_SUMMARIES_OUTPUT, LIST_POLICY_SUMMARIES as _SCHEMA_LIST_POLICY_SUMMARIES, - LIST_POLICY_SUMMARIES_INPUT as _SCHEMA_LIST_POLICY_SUMMARIES_INPUT, - LIST_POLICY_SUMMARIES_OUTPUT as _SCHEMA_LIST_POLICY_SUMMARIES_OUTPUT, LIST_REGISTRIES as _SCHEMA_LIST_REGISTRIES, - LIST_REGISTRIES_INPUT as _SCHEMA_LIST_REGISTRIES_INPUT, - LIST_REGISTRIES_OUTPUT as _SCHEMA_LIST_REGISTRIES_OUTPUT, LIST_REGISTRY_RECORDS as _SCHEMA_LIST_REGISTRY_RECORDS, - LIST_REGISTRY_RECORDS_INPUT as _SCHEMA_LIST_REGISTRY_RECORDS_INPUT, - LIST_REGISTRY_RECORDS_OUTPUT as _SCHEMA_LIST_REGISTRY_RECORDS_OUTPUT, LIST_TAGS_FOR_RESOURCE as _SCHEMA_LIST_TAGS_FOR_RESOURCE, - LIST_TAGS_FOR_RESOURCE_INPUT as _SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT, - LIST_TAGS_FOR_RESOURCE_OUTPUT as _SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT, LIST_WORKLOAD_IDENTITIES as _SCHEMA_LIST_WORKLOAD_IDENTITIES, - LIST_WORKLOAD_IDENTITIES_INPUT as _SCHEMA_LIST_WORKLOAD_IDENTITIES_INPUT, - LIST_WORKLOAD_IDENTITIES_OUTPUT as _SCHEMA_LIST_WORKLOAD_IDENTITIES_OUTPUT, - LLM_AS_A_JUDGE_EVALUATOR_CONFIG as _SCHEMA_LLM_AS_A_JUDGE_EVALUATOR_CONFIG, - LLM_EXTRACTION_CONFIG as _SCHEMA_LLM_EXTRACTION_CONFIG, - MANAGED_RESOURCE_DETAILS as _SCHEMA_MANAGED_RESOURCE_DETAILS, - MANAGED_VPC_RESOURCE as _SCHEMA_MANAGED_VPC_RESOURCE, - MATCH_PATHS as _SCHEMA_MATCH_PATHS, - MATCH_PRINCIPALS as _SCHEMA_MATCH_PRINCIPALS, - MATCH_PRINCIPAL_ENTRY as _SCHEMA_MATCH_PRINCIPAL_ENTRY, - MCP_DESCRIPTOR as _SCHEMA_MCP_DESCRIPTOR, - MCP_GATEWAY_CONFIGURATION as _SCHEMA_MCP_GATEWAY_CONFIGURATION, - MCP_LAMBDA_TARGET_CONFIGURATION as _SCHEMA_MCP_LAMBDA_TARGET_CONFIGURATION, - MCP_SERVER_TARGET_CONFIGURATION as _SCHEMA_MCP_SERVER_TARGET_CONFIGURATION, - MCP_TARGET_CONFIGURATION as _SCHEMA_MCP_TARGET_CONFIGURATION, - MCP_TOOL_SCHEMA_CONFIGURATION as _SCHEMA_MCP_TOOL_SCHEMA_CONFIGURATION, - MEMORY as _SCHEMA_MEMORY, - MEMORY_RECORD_SCHEMA as _SCHEMA_MEMORY_RECORD_SCHEMA, - MEMORY_STRATEGY as _SCHEMA_MEMORY_STRATEGY, - MEMORY_STRATEGY_INPUT as _SCHEMA_MEMORY_STRATEGY_INPUT, - MEMORY_SUMMARY as _SCHEMA_MEMORY_SUMMARY, - MESSAGE_BASED_TRIGGER as _SCHEMA_MESSAGE_BASED_TRIGGER, - MESSAGE_BASED_TRIGGER_INPUT as _SCHEMA_MESSAGE_BASED_TRIGGER_INPUT, - METADATA_CONFIGURATION as _SCHEMA_METADATA_CONFIGURATION, - METADATA_SCHEMA_ENTRY as _SCHEMA_METADATA_SCHEMA_ENTRY, - MICROSOFT_OAUTH2_PROVIDER_CONFIG_INPUT as _SCHEMA_MICROSOFT_OAUTH2_PROVIDER_CONFIG_INPUT, - MICROSOFT_OAUTH2_PROVIDER_CONFIG_OUTPUT as _SCHEMA_MICROSOFT_OAUTH2_PROVIDER_CONFIG_OUTPUT, - MODEL_ENTRY as _SCHEMA_MODEL_ENTRY, - MODEL_MAPPING as _SCHEMA_MODEL_MAPPING, - MODIFY_CONSOLIDATION_CONFIGURATION as _SCHEMA_MODIFY_CONSOLIDATION_CONFIGURATION, - MODIFY_EXTRACTION_CONFIGURATION as _SCHEMA_MODIFY_EXTRACTION_CONFIGURATION, - MODIFY_INVOCATION_CONFIGURATION_INPUT as _SCHEMA_MODIFY_INVOCATION_CONFIGURATION_INPUT, - MODIFY_MEMORY_STRATEGIES as _SCHEMA_MODIFY_MEMORY_STRATEGIES, - MODIFY_MEMORY_STRATEGY_INPUT as _SCHEMA_MODIFY_MEMORY_STRATEGY_INPUT, - MODIFY_REFLECTION_CONFIGURATION as _SCHEMA_MODIFY_REFLECTION_CONFIGURATION, - MODIFY_SELF_MANAGED_CONFIGURATION as _SCHEMA_MODIFY_SELF_MANAGED_CONFIGURATION, - MODIFY_STRATEGY_CONFIGURATION as _SCHEMA_MODIFY_STRATEGY_CONFIGURATION, - NAMESPACE_KEY_ENTRY as _SCHEMA_NAMESPACE_KEY_ENTRY, - NAMESPACE_KEY_VALIDATION as _SCHEMA_NAMESPACE_KEY_VALIDATION, - NETWORK_CONFIGURATION as _SCHEMA_NETWORK_CONFIGURATION, - NUMBER_VALIDATION as _SCHEMA_NUMBER_VALIDATION, - NUMERICAL_SCALE_DEFINITION as _SCHEMA_NUMERICAL_SCALE_DEFINITION, - OAUTH2_AUTHORIZATION_SERVER_METADATA as _SCHEMA_OAUTH2_AUTHORIZATION_SERVER_METADATA, - OAUTH2_CREDENTIAL_PROVIDER_ITEM as _SCHEMA_OAUTH2_CREDENTIAL_PROVIDER_ITEM, - OAUTH2_DISCOVERY as _SCHEMA_OAUTH2_DISCOVERY, - OAUTH2_PROVIDER_CONFIG_INPUT as _SCHEMA_OAUTH2_PROVIDER_CONFIG_INPUT, - OAUTH2_PROVIDER_CONFIG_OUTPUT as _SCHEMA_OAUTH2_PROVIDER_CONFIG_OUTPUT, - ONLINE_EVALUATION_CONFIG_SUMMARY as _SCHEMA_ONLINE_EVALUATION_CONFIG_SUMMARY, - ON_BEHALF_OF_TOKEN_EXCHANGE_CONFIG_TYPE as _SCHEMA_ON_BEHALF_OF_TOKEN_EXCHANGE_CONFIG_TYPE, - OPEN_RESPONSES_EVALUATOR_MODEL_CONFIG as _SCHEMA_OPEN_RESPONSES_EVALUATOR_MODEL_CONFIG, - OUTPUT_CONFIG as _SCHEMA_OUTPUT_CONFIG, - O_AUTH2_AUTHORIZATION_DATA as _SCHEMA_O_AUTH2_AUTHORIZATION_DATA, - O_AUTH_CREDENTIAL_PROVIDER as _SCHEMA_O_AUTH_CREDENTIAL_PROVIDER, - PASSTHROUGH_TARGET_CONFIGURATION as _SCHEMA_PASSTHROUGH_TARGET_CONFIGURATION, - PAYMENT_CONNECTOR_SUMMARY as _SCHEMA_PAYMENT_CONNECTOR_SUMMARY, - PAYMENT_CREDENTIAL_PROVIDER_CONFIGURATION as _SCHEMA_PAYMENT_CREDENTIAL_PROVIDER_CONFIGURATION, - PAYMENT_CREDENTIAL_PROVIDER_ITEM as _SCHEMA_PAYMENT_CREDENTIAL_PROVIDER_ITEM, - PAYMENT_MANAGER_SUMMARY as _SCHEMA_PAYMENT_MANAGER_SUMMARY, - PAYMENT_PROVIDER_CONFIGURATION_INPUT as _SCHEMA_PAYMENT_PROVIDER_CONFIGURATION_INPUT, - PAYMENT_PROVIDER_CONFIGURATION_OUTPUT as _SCHEMA_PAYMENT_PROVIDER_CONFIGURATION_OUTPUT, - PERMISSIONS_CONFIGURATION as _SCHEMA_PERMISSIONS_CONFIGURATION, - POLICY as _SCHEMA_POLICY, - POLICY_DEFINITION as _SCHEMA_POLICY_DEFINITION, - POLICY_ENGINE as _SCHEMA_POLICY_ENGINE, - POLICY_ENGINE_SUMMARY as _SCHEMA_POLICY_ENGINE_SUMMARY, - POLICY_GENERATION as _SCHEMA_POLICY_GENERATION, - POLICY_GENERATION_ASSET as _SCHEMA_POLICY_GENERATION_ASSET, - POLICY_GENERATION_DETAILS as _SCHEMA_POLICY_GENERATION_DETAILS, - POLICY_GENERATION_SUMMARY as _SCHEMA_POLICY_GENERATION_SUMMARY, - POLICY_STATEMENT as _SCHEMA_POLICY_STATEMENT, - POLICY_SUMMARY as _SCHEMA_POLICY_SUMMARY, - PRIVATE_ENDPOINT as _SCHEMA_PRIVATE_ENDPOINT, - PRIVATE_ENDPOINT_OVERRIDE as _SCHEMA_PRIVATE_ENDPOINT_OVERRIDE, - PRIVATE_KEY_JWT_CONFIG as _SCHEMA_PRIVATE_KEY_JWT_CONFIG, - PRIVATE_KEY_SOURCE as _SCHEMA_PRIVATE_KEY_SOURCE, - PROTOCOL_CONFIGURATION as _SCHEMA_PROTOCOL_CONFIGURATION, - PROVIDER_PREFIX as _SCHEMA_PROVIDER_PREFIX, PUT_RESOURCE_POLICY as _SCHEMA_PUT_RESOURCE_POLICY, - PUT_RESOURCE_POLICY_INPUT as _SCHEMA_PUT_RESOURCE_POLICY_INPUT, - PUT_RESOURCE_POLICY_OUTPUT as _SCHEMA_PUT_RESOURCE_POLICY_OUTPUT, - RATE_CONFIG as _SCHEMA_RATE_CONFIG, - RATING_SCALE as _SCHEMA_RATING_SCALE, - REASONING_CONFIGURATION as _SCHEMA_REASONING_CONFIGURATION, - RECORDING_CONFIG as _SCHEMA_RECORDING_CONFIG, - REFLECTION_CONFIGURATION as _SCHEMA_REFLECTION_CONFIGURATION, - REGISTRY_RECORD_CREDENTIAL_PROVIDER_CONFIGURATION as _SCHEMA_REGISTRY_RECORD_CREDENTIAL_PROVIDER_CONFIGURATION, - REGISTRY_RECORD_CREDENTIAL_PROVIDER_UNION as _SCHEMA_REGISTRY_RECORD_CREDENTIAL_PROVIDER_UNION, - REGISTRY_RECORD_IAM_CREDENTIAL_PROVIDER as _SCHEMA_REGISTRY_RECORD_IAM_CREDENTIAL_PROVIDER, - REGISTRY_RECORD_O_AUTH_CREDENTIAL_PROVIDER as _SCHEMA_REGISTRY_RECORD_O_AUTH_CREDENTIAL_PROVIDER, - REGISTRY_RECORD_SUMMARY as _SCHEMA_REGISTRY_RECORD_SUMMARY, - REGISTRY_SUMMARY as _SCHEMA_REGISTRY_SUMMARY, - REQUEST_HEADER_CONFIGURATION as _SCHEMA_REQUEST_HEADER_CONFIGURATION, - RESOURCE as _SCHEMA_RESOURCE, - RESOURCE_LIMIT_EXCEEDED_EXCEPTION as _SCHEMA_RESOURCE_LIMIT_EXCEEDED_EXCEPTION, - RESOURCE_LOCATION as _SCHEMA_RESOURCE_LOCATION, - RESOURCE_NOT_FOUND_EXCEPTION as _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - RETRYABLE_CONFLICT_EXCEPTION as _SCHEMA_RETRYABLE_CONFLICT_EXCEPTION, - ROOT_VOLUME_CONFIGURATION as _SCHEMA_ROOT_VOLUME_CONFIGURATION, ROTATE_PAYMENT_CONNECTOR_CREDENTIALS as _SCHEMA_ROTATE_PAYMENT_CONNECTOR_CREDENTIALS, - ROTATE_PAYMENT_CONNECTOR_CREDENTIALS_INPUT as _SCHEMA_ROTATE_PAYMENT_CONNECTOR_CREDENTIALS_INPUT, - ROTATE_PAYMENT_CONNECTOR_CREDENTIALS_OUTPUT as _SCHEMA_ROTATE_PAYMENT_CONNECTOR_CREDENTIALS_OUTPUT, - ROUTE_TO_TARGET_ACTION as _SCHEMA_ROUTE_TO_TARGET_ACTION, - RULE as _SCHEMA_RULE, - RUNTIME_METADATA_CONFIGURATION as _SCHEMA_RUNTIME_METADATA_CONFIGURATION, - RUNTIME_TARGET_CONFIGURATION as _SCHEMA_RUNTIME_TARGET_CONFIGURATION, - S3_CERTIFICATE_CONFIGURATION as _SCHEMA_S3_CERTIFICATE_CONFIGURATION, - S3_CONFIGURATION as _SCHEMA_S3_CONFIGURATION, - S3_FILES_ACCESS_POINT_CONFIGURATION as _SCHEMA_S3_FILES_ACCESS_POINT_CONFIGURATION, - S3_FILES_CONFIGURATION as _SCHEMA_S3_FILES_CONFIGURATION, - S3_LOCATION as _SCHEMA_S3_LOCATION, - S3_SOURCE as _SCHEMA_S3_SOURCE, - SALESFORCE_OAUTH2_PROVIDER_CONFIG_INPUT as _SCHEMA_SALESFORCE_OAUTH2_PROVIDER_CONFIG_INPUT, - SALESFORCE_OAUTH2_PROVIDER_CONFIG_OUTPUT as _SCHEMA_SALESFORCE_OAUTH2_PROVIDER_CONFIG_OUTPUT, - SAMPLING_CONFIG as _SCHEMA_SAMPLING_CONFIG, - SCHEMA_DEFINITION as _SCHEMA_SCHEMA_DEFINITION, - SECRET as _SCHEMA_SECRET, - SECRETS_MANAGER_CERTIFICATE_CONFIGURATION as _SCHEMA_SECRETS_MANAGER_CERTIFICATE_CONFIGURATION, - SECRETS_MANAGER_LOCATION as _SCHEMA_SECRETS_MANAGER_LOCATION, - SECRET_REFERENCE as _SCHEMA_SECRET_REFERENCE, - SELF_MANAGED_CONFIGURATION as _SCHEMA_SELF_MANAGED_CONFIGURATION, - SELF_MANAGED_CONFIGURATION_INPUT as _SCHEMA_SELF_MANAGED_CONFIGURATION_INPUT, - SELF_MANAGED_LATTICE_RESOURCE as _SCHEMA_SELF_MANAGED_LATTICE_RESOURCE, - SEMANTIC_CONSOLIDATION_OVERRIDE as _SCHEMA_SEMANTIC_CONSOLIDATION_OVERRIDE, - SEMANTIC_EXTRACTION_OVERRIDE as _SCHEMA_SEMANTIC_EXTRACTION_OVERRIDE, - SEMANTIC_MEMORY_STRATEGY_INPUT as _SCHEMA_SEMANTIC_MEMORY_STRATEGY_INPUT, - SEMANTIC_OVERRIDE_CONFIGURATION_INPUT as _SCHEMA_SEMANTIC_OVERRIDE_CONFIGURATION_INPUT, - SEMANTIC_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT as _SCHEMA_SEMANTIC_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT, - SEMANTIC_OVERRIDE_EXTRACTION_CONFIGURATION_INPUT as _SCHEMA_SEMANTIC_OVERRIDE_EXTRACTION_CONFIGURATION_INPUT, - SERVER_DEFINITION as _SCHEMA_SERVER_DEFINITION, - SERVICE_EXCEPTION as _SCHEMA_SERVICE_EXCEPTION, - SERVICE_QUOTA_EXCEEDED_EXCEPTION as _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - SESSION_CONFIG as _SCHEMA_SESSION_CONFIG, - SESSION_CONFIGURATION as _SCHEMA_SESSION_CONFIGURATION, - SESSION_STORAGE_CONFIGURATION as _SCHEMA_SESSION_STORAGE_CONFIGURATION, SET_TOKEN_VAULT_CMK as _SCHEMA_SET_TOKEN_VAULT_CMK, - SET_TOKEN_VAULT_CMK_INPUT as _SCHEMA_SET_TOKEN_VAULT_CMK_INPUT, - SET_TOKEN_VAULT_CMK_OUTPUT as _SCHEMA_SET_TOKEN_VAULT_CMK_OUTPUT, - SKILL_DEFINITION as _SCHEMA_SKILL_DEFINITION, - SKILL_MD_DEFINITION as _SCHEMA_SKILL_MD_DEFINITION, - SLACK_OAUTH2_PROVIDER_CONFIG_INPUT as _SCHEMA_SLACK_OAUTH2_PROVIDER_CONFIG_INPUT, - SLACK_OAUTH2_PROVIDER_CONFIG_OUTPUT as _SCHEMA_SLACK_OAUTH2_PROVIDER_CONFIG_OUTPUT, START_POLICY_GENERATION as _SCHEMA_START_POLICY_GENERATION, - START_POLICY_GENERATION_INPUT as _SCHEMA_START_POLICY_GENERATION_INPUT, - START_POLICY_GENERATION_OUTPUT as _SCHEMA_START_POLICY_GENERATION_OUTPUT, - STATIC_OVERRIDE as _SCHEMA_STATIC_OVERRIDE, - STATIC_ROUTE as _SCHEMA_STATIC_ROUTE, - STICKINESS_CONFIGURATION as _SCHEMA_STICKINESS_CONFIGURATION, - STRATEGY_CONFIGURATION as _SCHEMA_STRATEGY_CONFIGURATION, - STREAMING_CONFIGURATION as _SCHEMA_STREAMING_CONFIGURATION, - STREAM_DELIVERY_RESOURCE as _SCHEMA_STREAM_DELIVERY_RESOURCE, - STREAM_DELIVERY_RESOURCES as _SCHEMA_STREAM_DELIVERY_RESOURCES, - STRING_LIST_VALIDATION as _SCHEMA_STRING_LIST_VALIDATION, - STRING_VALIDATION as _SCHEMA_STRING_VALIDATION, - STRIPE_PRIVY_CONFIGURATION_INPUT as _SCHEMA_STRIPE_PRIVY_CONFIGURATION_INPUT, - STRIPE_PRIVY_CONFIGURATION_OUTPUT as _SCHEMA_STRIPE_PRIVY_CONFIGURATION_OUTPUT, SUBMIT_REGISTRY_RECORD_FOR_APPROVAL as _SCHEMA_SUBMIT_REGISTRY_RECORD_FOR_APPROVAL, - SUBMIT_REGISTRY_RECORD_FOR_APPROVAL_INPUT as _SCHEMA_SUBMIT_REGISTRY_RECORD_FOR_APPROVAL_INPUT, - SUBMIT_REGISTRY_RECORD_FOR_APPROVAL_OUTPUT as _SCHEMA_SUBMIT_REGISTRY_RECORD_FOR_APPROVAL_OUTPUT, - SUBSCRIPTION_REQUIRED_EXCEPTION as _SCHEMA_SUBSCRIPTION_REQUIRED_EXCEPTION, - SUMMARY_CONSOLIDATION_OVERRIDE as _SCHEMA_SUMMARY_CONSOLIDATION_OVERRIDE, - SUMMARY_MEMORY_STRATEGY_INPUT as _SCHEMA_SUMMARY_MEMORY_STRATEGY_INPUT, - SUMMARY_OVERRIDE_CONFIGURATION_INPUT as _SCHEMA_SUMMARY_OVERRIDE_CONFIGURATION_INPUT, - SUMMARY_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT as _SCHEMA_SUMMARY_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT, - SYNCHRONIZATION_CONFIGURATION as _SCHEMA_SYNCHRONIZATION_CONFIGURATION, SYNCHRONIZE_GATEWAY_TARGETS as _SCHEMA_SYNCHRONIZE_GATEWAY_TARGETS, - SYNCHRONIZE_GATEWAY_TARGETS_INPUT as _SCHEMA_SYNCHRONIZE_GATEWAY_TARGETS_INPUT, - SYNCHRONIZE_GATEWAY_TARGETS_OUTPUT as _SCHEMA_SYNCHRONIZE_GATEWAY_TARGETS_OUTPUT, - SYSTEM_MANAGED_BLOCK as _SCHEMA_SYSTEM_MANAGED_BLOCK, TAG_RESOURCE as _SCHEMA_TAG_RESOURCE, - TAG_RESOURCE_INPUT as _SCHEMA_TAG_RESOURCE_INPUT, - TAG_RESOURCE_OUTPUT as _SCHEMA_TAG_RESOURCE_OUTPUT, - TARGET_CONFIGURATION as _SCHEMA_TARGET_CONFIGURATION, - TARGET_SUMMARY as _SCHEMA_TARGET_SUMMARY, - TARGET_TRAFFIC_SPLIT_ENTRY as _SCHEMA_TARGET_TRAFFIC_SPLIT_ENTRY, - THROTTLED_EXCEPTION as _SCHEMA_THROTTLED_EXCEPTION, - THROTTLING_EXCEPTION as _SCHEMA_THROTTLING_EXCEPTION, - TIME_BASED_TRIGGER as _SCHEMA_TIME_BASED_TRIGGER, - TIME_BASED_TRIGGER_INPUT as _SCHEMA_TIME_BASED_TRIGGER_INPUT, - TOKEN_BASED_TRIGGER as _SCHEMA_TOKEN_BASED_TRIGGER, - TOKEN_BASED_TRIGGER_INPUT as _SCHEMA_TOKEN_BASED_TRIGGER_INPUT, - TOKEN_EXCHANGE_GRANT_TYPE_CONFIG_TYPE as _SCHEMA_TOKEN_EXCHANGE_GRANT_TYPE_CONFIG_TYPE, - TOOLS_DEFINITION as _SCHEMA_TOOLS_DEFINITION, - TOOLS_FILE_SYSTEM_CONFIGURATION as _SCHEMA_TOOLS_FILE_SYSTEM_CONFIGURATION, - TOOL_DEFINITION as _SCHEMA_TOOL_DEFINITION, - TOOL_SCHEMA as _SCHEMA_TOOL_SCHEMA, - TRAFFIC_SPLIT_ENTRY as _SCHEMA_TRAFFIC_SPLIT_ENTRY, - TRIGGER_CONDITION as _SCHEMA_TRIGGER_CONDITION, - TRIGGER_CONDITION_INPUT as _SCHEMA_TRIGGER_CONDITION_INPUT, - UNAUTHORIZED_EXCEPTION as _SCHEMA_UNAUTHORIZED_EXCEPTION, UNTAG_RESOURCE as _SCHEMA_UNTAG_RESOURCE, - UNTAG_RESOURCE_INPUT as _SCHEMA_UNTAG_RESOURCE_INPUT, - UNTAG_RESOURCE_OUTPUT as _SCHEMA_UNTAG_RESOURCE_OUTPUT, - UPDATED_A2A_DESCRIPTOR as _SCHEMA_UPDATED_A2A_DESCRIPTOR, - UPDATED_AGENT_SKILLS_DESCRIPTOR as _SCHEMA_UPDATED_AGENT_SKILLS_DESCRIPTOR, - UPDATED_AGENT_SKILLS_DESCRIPTOR_FIELDS as _SCHEMA_UPDATED_AGENT_SKILLS_DESCRIPTOR_FIELDS, - UPDATED_APPROVAL_CONFIGURATION as _SCHEMA_UPDATED_APPROVAL_CONFIGURATION, - UPDATED_AUTHORIZER_CONFIGURATION as _SCHEMA_UPDATED_AUTHORIZER_CONFIGURATION, - UPDATED_CUSTOM_DESCRIPTOR as _SCHEMA_UPDATED_CUSTOM_DESCRIPTOR, - UPDATED_DESCRIPTION as _SCHEMA_UPDATED_DESCRIPTION, - UPDATED_DESCRIPTORS as _SCHEMA_UPDATED_DESCRIPTORS, - UPDATED_DESCRIPTORS_UNION as _SCHEMA_UPDATED_DESCRIPTORS_UNION, - UPDATED_HARNESS_ENVIRONMENT_ARTIFACT as _SCHEMA_UPDATED_HARNESS_ENVIRONMENT_ARTIFACT, - UPDATED_HARNESS_MEMORY_CONFIGURATION as _SCHEMA_UPDATED_HARNESS_MEMORY_CONFIGURATION, - UPDATED_MCP_DESCRIPTOR as _SCHEMA_UPDATED_MCP_DESCRIPTOR, - UPDATED_MCP_DESCRIPTOR_FIELDS as _SCHEMA_UPDATED_MCP_DESCRIPTOR_FIELDS, - UPDATED_SERVER_DEFINITION as _SCHEMA_UPDATED_SERVER_DEFINITION, - UPDATED_SKILL_DEFINITION as _SCHEMA_UPDATED_SKILL_DEFINITION, - UPDATED_SKILL_MD_DEFINITION as _SCHEMA_UPDATED_SKILL_MD_DEFINITION, - UPDATED_SYNCHRONIZATION_CONFIGURATION as _SCHEMA_UPDATED_SYNCHRONIZATION_CONFIGURATION, - UPDATED_SYNCHRONIZATION_TYPE as _SCHEMA_UPDATED_SYNCHRONIZATION_TYPE, - UPDATED_TOOLS_DEFINITION as _SCHEMA_UPDATED_TOOLS_DEFINITION, UPDATE_AGENT_RUNTIME as _SCHEMA_UPDATE_AGENT_RUNTIME, UPDATE_AGENT_RUNTIME_ENDPOINT as _SCHEMA_UPDATE_AGENT_RUNTIME_ENDPOINT, - UPDATE_AGENT_RUNTIME_ENDPOINT_INPUT as _SCHEMA_UPDATE_AGENT_RUNTIME_ENDPOINT_INPUT, - UPDATE_AGENT_RUNTIME_ENDPOINT_OUTPUT as _SCHEMA_UPDATE_AGENT_RUNTIME_ENDPOINT_OUTPUT, - UPDATE_AGENT_RUNTIME_INPUT as _SCHEMA_UPDATE_AGENT_RUNTIME_INPUT, - UPDATE_AGENT_RUNTIME_OUTPUT as _SCHEMA_UPDATE_AGENT_RUNTIME_OUTPUT, UPDATE_API_KEY_CREDENTIAL_PROVIDER as _SCHEMA_UPDATE_API_KEY_CREDENTIAL_PROVIDER, - UPDATE_API_KEY_CREDENTIAL_PROVIDER_INPUT as _SCHEMA_UPDATE_API_KEY_CREDENTIAL_PROVIDER_INPUT, - UPDATE_API_KEY_CREDENTIAL_PROVIDER_OUTPUT as _SCHEMA_UPDATE_API_KEY_CREDENTIAL_PROVIDER_OUTPUT, UPDATE_CAPACITY_PROVIDER as _SCHEMA_UPDATE_CAPACITY_PROVIDER, - UPDATE_CAPACITY_PROVIDER_INPUT as _SCHEMA_UPDATE_CAPACITY_PROVIDER_INPUT, - UPDATE_CAPACITY_PROVIDER_OUTPUT as _SCHEMA_UPDATE_CAPACITY_PROVIDER_OUTPUT, UPDATE_CONFIGURATION_BUNDLE as _SCHEMA_UPDATE_CONFIGURATION_BUNDLE, - UPDATE_CONFIGURATION_BUNDLE_INPUT as _SCHEMA_UPDATE_CONFIGURATION_BUNDLE_INPUT, - UPDATE_CONFIGURATION_BUNDLE_OUTPUT as _SCHEMA_UPDATE_CONFIGURATION_BUNDLE_OUTPUT, UPDATE_CONSENT_PORTAL as _SCHEMA_UPDATE_CONSENT_PORTAL, - UPDATE_CONSENT_PORTAL_INPUT as _SCHEMA_UPDATE_CONSENT_PORTAL_INPUT, - UPDATE_CONSENT_PORTAL_OUTPUT as _SCHEMA_UPDATE_CONSENT_PORTAL_OUTPUT, UPDATE_DATASET as _SCHEMA_UPDATE_DATASET, UPDATE_DATASET_EXAMPLES as _SCHEMA_UPDATE_DATASET_EXAMPLES, - UPDATE_DATASET_EXAMPLES_INPUT as _SCHEMA_UPDATE_DATASET_EXAMPLES_INPUT, - UPDATE_DATASET_EXAMPLES_OUTPUT as _SCHEMA_UPDATE_DATASET_EXAMPLES_OUTPUT, - UPDATE_DATASET_INPUT as _SCHEMA_UPDATE_DATASET_INPUT, - UPDATE_DATASET_OUTPUT as _SCHEMA_UPDATE_DATASET_OUTPUT, UPDATE_EVALUATOR as _SCHEMA_UPDATE_EVALUATOR, - UPDATE_EVALUATOR_INPUT as _SCHEMA_UPDATE_EVALUATOR_INPUT, - UPDATE_EVALUATOR_OUTPUT as _SCHEMA_UPDATE_EVALUATOR_OUTPUT, UPDATE_GATEWAY as _SCHEMA_UPDATE_GATEWAY, - UPDATE_GATEWAY_INPUT as _SCHEMA_UPDATE_GATEWAY_INPUT, - UPDATE_GATEWAY_OUTPUT as _SCHEMA_UPDATE_GATEWAY_OUTPUT, UPDATE_GATEWAY_RATE_LIMIT as _SCHEMA_UPDATE_GATEWAY_RATE_LIMIT, - UPDATE_GATEWAY_RATE_LIMIT_INPUT as _SCHEMA_UPDATE_GATEWAY_RATE_LIMIT_INPUT, - UPDATE_GATEWAY_RATE_LIMIT_OUTPUT as _SCHEMA_UPDATE_GATEWAY_RATE_LIMIT_OUTPUT, UPDATE_GATEWAY_RULE as _SCHEMA_UPDATE_GATEWAY_RULE, - UPDATE_GATEWAY_RULE_INPUT as _SCHEMA_UPDATE_GATEWAY_RULE_INPUT, - UPDATE_GATEWAY_RULE_OUTPUT as _SCHEMA_UPDATE_GATEWAY_RULE_OUTPUT, UPDATE_GATEWAY_TARGET as _SCHEMA_UPDATE_GATEWAY_TARGET, - UPDATE_GATEWAY_TARGET_INPUT as _SCHEMA_UPDATE_GATEWAY_TARGET_INPUT, - UPDATE_GATEWAY_TARGET_OUTPUT as _SCHEMA_UPDATE_GATEWAY_TARGET_OUTPUT, UPDATE_HARNESS as _SCHEMA_UPDATE_HARNESS, UPDATE_HARNESS_ENDPOINT as _SCHEMA_UPDATE_HARNESS_ENDPOINT, - UPDATE_HARNESS_ENDPOINT_INPUT as _SCHEMA_UPDATE_HARNESS_ENDPOINT_INPUT, - UPDATE_HARNESS_ENDPOINT_OUTPUT as _SCHEMA_UPDATE_HARNESS_ENDPOINT_OUTPUT, - UPDATE_HARNESS_INPUT as _SCHEMA_UPDATE_HARNESS_INPUT, - UPDATE_HARNESS_OUTPUT as _SCHEMA_UPDATE_HARNESS_OUTPUT, UPDATE_MEMORY as _SCHEMA_UPDATE_MEMORY, - UPDATE_MEMORY_INPUT as _SCHEMA_UPDATE_MEMORY_INPUT, - UPDATE_MEMORY_OUTPUT as _SCHEMA_UPDATE_MEMORY_OUTPUT, UPDATE_OAUTH2_CREDENTIAL_PROVIDER as _SCHEMA_UPDATE_OAUTH2_CREDENTIAL_PROVIDER, - UPDATE_OAUTH2_CREDENTIAL_PROVIDER_INPUT as _SCHEMA_UPDATE_OAUTH2_CREDENTIAL_PROVIDER_INPUT, - UPDATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT as _SCHEMA_UPDATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT, UPDATE_ONLINE_EVALUATION_CONFIG as _SCHEMA_UPDATE_ONLINE_EVALUATION_CONFIG, - UPDATE_ONLINE_EVALUATION_CONFIG_INPUT as _SCHEMA_UPDATE_ONLINE_EVALUATION_CONFIG_INPUT, - UPDATE_ONLINE_EVALUATION_CONFIG_OUTPUT as _SCHEMA_UPDATE_ONLINE_EVALUATION_CONFIG_OUTPUT, UPDATE_PAYMENT_CONNECTOR as _SCHEMA_UPDATE_PAYMENT_CONNECTOR, - UPDATE_PAYMENT_CONNECTOR_INPUT as _SCHEMA_UPDATE_PAYMENT_CONNECTOR_INPUT, - UPDATE_PAYMENT_CONNECTOR_OUTPUT as _SCHEMA_UPDATE_PAYMENT_CONNECTOR_OUTPUT, UPDATE_PAYMENT_CREDENTIAL_PROVIDER as _SCHEMA_UPDATE_PAYMENT_CREDENTIAL_PROVIDER, - UPDATE_PAYMENT_CREDENTIAL_PROVIDER_INPUT as _SCHEMA_UPDATE_PAYMENT_CREDENTIAL_PROVIDER_INPUT, - UPDATE_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT as _SCHEMA_UPDATE_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT, UPDATE_PAYMENT_MANAGER as _SCHEMA_UPDATE_PAYMENT_MANAGER, - UPDATE_PAYMENT_MANAGER_INPUT as _SCHEMA_UPDATE_PAYMENT_MANAGER_INPUT, - UPDATE_PAYMENT_MANAGER_OUTPUT as _SCHEMA_UPDATE_PAYMENT_MANAGER_OUTPUT, UPDATE_POLICY as _SCHEMA_UPDATE_POLICY, UPDATE_POLICY_ENGINE as _SCHEMA_UPDATE_POLICY_ENGINE, - UPDATE_POLICY_ENGINE_INPUT as _SCHEMA_UPDATE_POLICY_ENGINE_INPUT, - UPDATE_POLICY_ENGINE_OUTPUT as _SCHEMA_UPDATE_POLICY_ENGINE_OUTPUT, - UPDATE_POLICY_INPUT as _SCHEMA_UPDATE_POLICY_INPUT, - UPDATE_POLICY_OUTPUT as _SCHEMA_UPDATE_POLICY_OUTPUT, UPDATE_REGISTRY as _SCHEMA_UPDATE_REGISTRY, - UPDATE_REGISTRY_INPUT as _SCHEMA_UPDATE_REGISTRY_INPUT, - UPDATE_REGISTRY_OUTPUT as _SCHEMA_UPDATE_REGISTRY_OUTPUT, UPDATE_REGISTRY_RECORD as _SCHEMA_UPDATE_REGISTRY_RECORD, - UPDATE_REGISTRY_RECORD_INPUT as _SCHEMA_UPDATE_REGISTRY_RECORD_INPUT, - UPDATE_REGISTRY_RECORD_OUTPUT as _SCHEMA_UPDATE_REGISTRY_RECORD_OUTPUT, UPDATE_REGISTRY_RECORD_STATUS as _SCHEMA_UPDATE_REGISTRY_RECORD_STATUS, - UPDATE_REGISTRY_RECORD_STATUS_INPUT as _SCHEMA_UPDATE_REGISTRY_RECORD_STATUS_INPUT, - UPDATE_REGISTRY_RECORD_STATUS_OUTPUT as _SCHEMA_UPDATE_REGISTRY_RECORD_STATUS_OUTPUT, UPDATE_WORKLOAD_IDENTITY as _SCHEMA_UPDATE_WORKLOAD_IDENTITY, - UPDATE_WORKLOAD_IDENTITY_INPUT as _SCHEMA_UPDATE_WORKLOAD_IDENTITY_INPUT, - UPDATE_WORKLOAD_IDENTITY_OUTPUT as _SCHEMA_UPDATE_WORKLOAD_IDENTITY_OUTPUT, - USER_PREFERENCE_CONSOLIDATION_OVERRIDE as _SCHEMA_USER_PREFERENCE_CONSOLIDATION_OVERRIDE, - USER_PREFERENCE_EXTRACTION_OVERRIDE as _SCHEMA_USER_PREFERENCE_EXTRACTION_OVERRIDE, - USER_PREFERENCE_MEMORY_STRATEGY_INPUT as _SCHEMA_USER_PREFERENCE_MEMORY_STRATEGY_INPUT, - USER_PREFERENCE_OVERRIDE_CONFIGURATION_INPUT as _SCHEMA_USER_PREFERENCE_OVERRIDE_CONFIGURATION_INPUT, - USER_PREFERENCE_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT as _SCHEMA_USER_PREFERENCE_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT, - USER_PREFERENCE_OVERRIDE_EXTRACTION_CONFIGURATION_INPUT as _SCHEMA_USER_PREFERENCE_OVERRIDE_EXTRACTION_CONFIGURATION_INPUT, - VALIDATION as _SCHEMA_VALIDATION, - VALIDATION_EXCEPTION as _SCHEMA_VALIDATION_EXCEPTION, - VALIDATION_EXCEPTION_FIELD as _SCHEMA_VALIDATION_EXCEPTION_FIELD, - VERSION_CREATED_BY_SOURCE as _SCHEMA_VERSION_CREATED_BY_SOURCE, - VERSION_FILTER as _SCHEMA_VERSION_FILTER, - VERSION_LINEAGE_METADATA as _SCHEMA_VERSION_LINEAGE_METADATA, - VOLUME_CONFIGURATION as _SCHEMA_VOLUME_CONFIGURATION, - VPC_CONFIG as _SCHEMA_VPC_CONFIG, - VPC_CONFIGURATION as _SCHEMA_VPC_CONFIGURATION, - WAF_CONFIGURATION as _SCHEMA_WAF_CONFIGURATION, - WEIGHTED_OVERRIDE as _SCHEMA_WEIGHTED_OVERRIDE, - WEIGHTED_ROUTE as _SCHEMA_WEIGHTED_ROUTE, - WORKLOAD_IDENTITY_DETAILS as _SCHEMA_WORKLOAD_IDENTITY_DETAILS, - WORKLOAD_IDENTITY_TYPE as _SCHEMA_WORKLOAD_IDENTITY_TYPE, ) - -logger = logging.getLogger(__name__) +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .models import ( + AddDatasetExamplesInput, + AddDatasetExamplesOutput, + BatchPutGatewayRateLimitsInput, + BatchPutGatewayRateLimitsOutput, + CreateAgentRuntimeEndpointInput, + CreateAgentRuntimeEndpointOutput, + CreateAgentRuntimeInput, + CreateAgentRuntimeOutput, + CreateApiKeyCredentialProviderInput, + CreateApiKeyCredentialProviderOutput, + CreateBrowserInput, + CreateBrowserOutput, + CreateBrowserProfileInput, + CreateBrowserProfileOutput, + CreateCapacityProviderInput, + CreateCapacityProviderOutput, + CreateCodeInterpreterInput, + CreateCodeInterpreterOutput, + CreateConfigurationBundleInput, + CreateConfigurationBundleOutput, + CreateConsentPortalInput, + CreateConsentPortalOutput, + CreateDatasetInput, + CreateDatasetOutput, + CreateDatasetVersionInput, + CreateDatasetVersionOutput, + CreateEvaluatorInput, + CreateEvaluatorOutput, + CreateGatewayInput, + CreateGatewayOutput, + CreateGatewayRateLimitInput, + CreateGatewayRateLimitOutput, + CreateGatewayRuleInput, + CreateGatewayRuleOutput, + CreateGatewayTargetInput, + CreateGatewayTargetOutput, + CreateHarnessEndpointInput, + CreateHarnessEndpointOutput, + CreateHarnessInput, + CreateHarnessOutput, + CreateMemoryInput, + CreateMemoryOutput, + CreateOauth2CredentialProviderInput, + CreateOauth2CredentialProviderOutput, + CreateOnlineEvaluationConfigInput, + CreateOnlineEvaluationConfigOutput, + CreatePaymentConnectorInput, + CreatePaymentConnectorOutput, + CreatePaymentCredentialProviderInput, + CreatePaymentCredentialProviderOutput, + CreatePaymentManagerInput, + CreatePaymentManagerOutput, + CreatePolicyEngineInput, + CreatePolicyEngineOutput, + CreatePolicyInput, + CreatePolicyOutput, + CreateRegistryInput, + CreateRegistryOutput, + CreateRegistryRecordInput, + CreateRegistryRecordOutput, + CreateWorkloadIdentityInput, + CreateWorkloadIdentityOutput, + DeleteAgentRuntimeEndpointInput, + DeleteAgentRuntimeEndpointOutput, + DeleteAgentRuntimeInput, + DeleteAgentRuntimeOutput, + DeleteApiKeyCredentialProviderInput, + DeleteApiKeyCredentialProviderOutput, + DeleteBrowserInput, + DeleteBrowserOutput, + DeleteBrowserProfileInput, + DeleteBrowserProfileOutput, + DeleteCapacityProviderInput, + DeleteCapacityProviderOutput, + DeleteCodeInterpreterInput, + DeleteCodeInterpreterOutput, + DeleteConfigurationBundleInput, + DeleteConfigurationBundleOutput, + DeleteConsentPortalInput, + DeleteConsentPortalOutput, + DeleteDatasetExamplesInput, + DeleteDatasetExamplesOutput, + DeleteDatasetInput, + DeleteDatasetOutput, + DeleteEvaluatorInput, + DeleteEvaluatorOutput, + DeleteGatewayInput, + DeleteGatewayOutput, + DeleteGatewayRateLimitInput, + DeleteGatewayRateLimitOutput, + DeleteGatewayRuleInput, + DeleteGatewayRuleOutput, + DeleteGatewayTargetInput, + DeleteGatewayTargetOutput, + DeleteHarnessEndpointInput, + DeleteHarnessEndpointOutput, + DeleteHarnessInput, + DeleteHarnessOutput, + DeleteMemoryInput, + DeleteMemoryOutput, + DeleteOauth2CredentialProviderInput, + DeleteOauth2CredentialProviderOutput, + DeleteOnlineEvaluationConfigInput, + DeleteOnlineEvaluationConfigOutput, + DeletePaymentConnectorInput, + DeletePaymentConnectorOutput, + DeletePaymentCredentialProviderInput, + DeletePaymentCredentialProviderOutput, + DeletePaymentManagerInput, + DeletePaymentManagerOutput, + DeletePolicyEngineInput, + DeletePolicyEngineOutput, + DeletePolicyInput, + DeletePolicyOutput, + DeleteRegistryInput, + DeleteRegistryOutput, + DeleteRegistryRecordInput, + DeleteRegistryRecordOutput, + DeleteResourcePolicyInput, + DeleteResourcePolicyOutput, + DeleteWorkloadIdentityInput, + DeleteWorkloadIdentityOutput, + GetAgentRuntimeEndpointInput, + GetAgentRuntimeEndpointOutput, + GetAgentRuntimeInput, + GetAgentRuntimeOutput, + GetApiKeyCredentialProviderInput, + GetApiKeyCredentialProviderOutput, + GetBrowserInput, + GetBrowserOutput, + GetBrowserProfileInput, + GetBrowserProfileOutput, + GetCapacityProviderInput, + GetCapacityProviderOutput, + GetCodeInterpreterInput, + GetCodeInterpreterOutput, + GetConfigurationBundleInput, + GetConfigurationBundleOutput, + GetConfigurationBundleVersionInput, + GetConfigurationBundleVersionOutput, + GetConsentPortalInput, + GetConsentPortalOutput, + GetDatasetInput, + GetDatasetOutput, + GetEvaluatorInput, + GetEvaluatorOutput, + GetGatewayInput, + GetGatewayOutput, + GetGatewayRateLimitInput, + GetGatewayRateLimitOutput, + GetGatewayRuleInput, + GetGatewayRuleOutput, + GetGatewayTargetInput, + GetGatewayTargetOutput, + GetHarnessEndpointInput, + GetHarnessEndpointOutput, + GetHarnessInput, + GetHarnessOutput, + GetMemoryInput, + GetMemoryOutput, + GetOauth2CredentialProviderInput, + GetOauth2CredentialProviderOutput, + GetOnlineEvaluationConfigInput, + GetOnlineEvaluationConfigOutput, + GetPaymentConnectorInput, + GetPaymentConnectorOutput, + GetPaymentCredentialProviderInput, + GetPaymentCredentialProviderOutput, + GetPaymentManagerInput, + GetPaymentManagerOutput, + GetPolicyEngineInput, + GetPolicyEngineOutput, + GetPolicyEngineSummaryInput, + GetPolicyEngineSummaryOutput, + GetPolicyGenerationInput, + GetPolicyGenerationOutput, + GetPolicyGenerationSummaryInput, + GetPolicyGenerationSummaryOutput, + GetPolicyInput, + GetPolicyOutput, + GetPolicySummaryInput, + GetPolicySummaryOutput, + GetRegistryInput, + GetRegistryOutput, + GetRegistryRecordInput, + GetRegistryRecordOutput, + GetResourcePolicyInput, + GetResourcePolicyOutput, + GetTokenVaultInput, + GetTokenVaultOutput, + GetWorkloadIdentityInput, + GetWorkloadIdentityOutput, + ListAgentRuntimeEndpointsInput, + ListAgentRuntimeEndpointsOutput, + ListAgentRuntimeVersionsByCapacityProviderInput, + ListAgentRuntimeVersionsByCapacityProviderOutput, + ListAgentRuntimeVersionsInput, + ListAgentRuntimeVersionsOutput, + ListAgentRuntimesInput, + ListAgentRuntimesOutput, + ListApiKeyCredentialProvidersInput, + ListApiKeyCredentialProvidersOutput, + ListBrowserProfilesInput, + ListBrowserProfilesOutput, + ListBrowsersInput, + ListBrowsersOutput, + ListCapacityProvidersInput, + ListCapacityProvidersOutput, + ListCodeInterpretersInput, + ListCodeInterpretersOutput, + ListConfigurationBundleVersionsInput, + ListConfigurationBundleVersionsOutput, + ListConfigurationBundlesInput, + ListConfigurationBundlesOutput, + ListConsentPortalsInput, + ListConsentPortalsOutput, + ListDatasetExamplesInput, + ListDatasetExamplesOutput, + ListDatasetVersionsInput, + ListDatasetVersionsOutput, + ListDatasetsInput, + ListDatasetsOutput, + ListEvaluatorsInput, + ListEvaluatorsOutput, + ListGatewayRateLimitsInput, + ListGatewayRateLimitsOutput, + ListGatewayRulesInput, + ListGatewayRulesOutput, + ListGatewayTargetsInput, + ListGatewayTargetsOutput, + ListGatewaysInput, + ListGatewaysOutput, + ListHarnessEndpointsInput, + ListHarnessEndpointsOutput, + ListHarnessVersionsInput, + ListHarnessVersionsOutput, + ListHarnessesInput, + ListHarnessesOutput, + ListMemoriesInput, + ListMemoriesOutput, + ListOauth2CredentialProvidersInput, + ListOauth2CredentialProvidersOutput, + ListOnlineEvaluationConfigsInput, + ListOnlineEvaluationConfigsOutput, + ListPaymentConnectorsInput, + ListPaymentConnectorsOutput, + ListPaymentCredentialProvidersInput, + ListPaymentCredentialProvidersOutput, + ListPaymentManagersInput, + ListPaymentManagersOutput, + ListPoliciesInput, + ListPoliciesOutput, + ListPolicyEngineSummariesInput, + ListPolicyEngineSummariesOutput, + ListPolicyEnginesInput, + ListPolicyEnginesOutput, + ListPolicyGenerationAssetsInput, + ListPolicyGenerationAssetsOutput, + ListPolicyGenerationSummariesInput, + ListPolicyGenerationSummariesOutput, + ListPolicyGenerationsInput, + ListPolicyGenerationsOutput, + ListPolicySummariesInput, + ListPolicySummariesOutput, + ListRegistriesInput, + ListRegistriesOutput, + ListRegistryRecordsInput, + ListRegistryRecordsOutput, + ListTagsForResourceInput, + ListTagsForResourceOutput, + ListWorkloadIdentitiesInput, + ListWorkloadIdentitiesOutput, + PutResourcePolicyInput, + PutResourcePolicyOutput, + RotatePaymentConnectorCredentialsInput, + RotatePaymentConnectorCredentialsOutput, + SetTokenVaultCMKInput, + SetTokenVaultCMKOutput, + StartPolicyGenerationInput, + StartPolicyGenerationOutput, + SubmitRegistryRecordForApprovalInput, + SubmitRegistryRecordForApprovalOutput, + SynchronizeGatewayTargetsInput, + SynchronizeGatewayTargetsOutput, + TagResourceInput, + TagResourceOutput, + UntagResourceInput, + UntagResourceOutput, + UpdateAgentRuntimeEndpointInput, + UpdateAgentRuntimeEndpointOutput, + UpdateAgentRuntimeInput, + UpdateAgentRuntimeOutput, + UpdateApiKeyCredentialProviderInput, + UpdateApiKeyCredentialProviderOutput, + UpdateCapacityProviderInput, + UpdateCapacityProviderOutput, + UpdateConfigurationBundleInput, + UpdateConfigurationBundleOutput, + UpdateConsentPortalInput, + UpdateConsentPortalOutput, + UpdateDatasetExamplesInput, + UpdateDatasetExamplesOutput, + UpdateDatasetInput, + UpdateDatasetOutput, + UpdateEvaluatorInput, + UpdateEvaluatorOutput, + UpdateGatewayInput, + UpdateGatewayOutput, + UpdateGatewayRateLimitInput, + UpdateGatewayRateLimitOutput, + UpdateGatewayRuleInput, + UpdateGatewayRuleOutput, + UpdateGatewayTargetInput, + UpdateGatewayTargetOutput, + UpdateHarnessEndpointInput, + UpdateHarnessEndpointOutput, + UpdateHarnessInput, + UpdateHarnessOutput, + UpdateMemoryInput, + UpdateMemoryOutput, + UpdateOauth2CredentialProviderInput, + UpdateOauth2CredentialProviderOutput, + UpdateOnlineEvaluationConfigInput, + UpdateOnlineEvaluationConfigOutput, + UpdatePaymentConnectorInput, + UpdatePaymentConnectorOutput, + UpdatePaymentCredentialProviderInput, + UpdatePaymentCredentialProviderOutput, + UpdatePaymentManagerInput, + UpdatePaymentManagerOutput, + UpdatePolicyEngineInput, + UpdatePolicyEngineOutput, + UpdatePolicyInput, + UpdatePolicyOutput, + UpdateRegistryInput, + UpdateRegistryOutput, + UpdateRegistryRecordInput, + UpdateRegistryRecordOutput, + UpdateRegistryRecordStatusInput, + UpdateRegistryRecordStatusOutput, + UpdateWorkloadIdentityInput, + UpdateWorkloadIdentityOutput, + ) class ServiceError(ModeledError): @@ -973,85649 +540,4695 @@ class ServiceError(ModeledError): """ -@dataclass(kw_only=True) -class Unit: - """Dataclass for Unit structure.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNIT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) +_registry = ModelRegistry( + _schemas, + renames={}, + index={ + "A2aDescriptor": "A2A_DESCRIPTOR", + "AccessDeniedException": "ACCESS_DENIED_EXCEPTION", + "Action": "ACTION", + "ActionConfigurationBundle": "ACTION", + "ActionRouteToTarget": "ACTION", + "ActionUnknown": "ACTION", + "ActorTokenContentType": "ACTOR_TOKEN_CONTENT_TYPE", + "AddDatasetExamplesInput": "ADD_DATASET_EXAMPLES_INPUT", + "AddDatasetExamplesOutput": "ADD_DATASET_EXAMPLES_OUTPUT", + "AgentCardDefinition": "AGENT_CARD_DEFINITION", + "AgentManagedRuntimeType": "AGENT_MANAGED_RUNTIME_TYPE", + "AgentRuntime": "AGENT_RUNTIME", + "AgentRuntimeArtifact": "AGENT_RUNTIME_ARTIFACT", + "AgentRuntimeArtifactContainerConfiguration": "AGENT_RUNTIME_ARTIFACT", + "AgentRuntimeArtifactCodeConfiguration": "AGENT_RUNTIME_ARTIFACT", + "AgentRuntimeArtifactUnknown": "AGENT_RUNTIME_ARTIFACT", + "AgentRuntimeEndpoint": "AGENT_RUNTIME_ENDPOINT", + "AgentRuntimeEndpointStatus": "AGENT_RUNTIME_ENDPOINT_STATUS", + "AgentRuntimeStatus": "AGENT_RUNTIME_STATUS", + "AgentRuntimeVersionSummary": "AGENT_RUNTIME_VERSION_SUMMARY", + "AgentSkillsDescriptor": "AGENT_SKILLS_DESCRIPTOR", + "AllowedWorkloadConfiguration": "ALLOWED_WORKLOAD_CONFIGURATION", + "ApiGatewayTargetConfiguration": "API_GATEWAY_TARGET_CONFIGURATION", + "ApiGatewayToolConfiguration": "API_GATEWAY_TOOL_CONFIGURATION", + "ApiGatewayToolFilter": "API_GATEWAY_TOOL_FILTER", + "ApiGatewayToolOverride": "API_GATEWAY_TOOL_OVERRIDE", + "ApiKeyCredentialLocation": "API_KEY_CREDENTIAL_LOCATION", + "ApiKeyCredentialProviderItem": "API_KEY_CREDENTIAL_PROVIDER_ITEM", + "ApiSchemaConfiguration": "API_SCHEMA_CONFIGURATION", + "ApiSchemaConfigurationS3": "API_SCHEMA_CONFIGURATION", + "ApiSchemaConfigurationInlinePayload": "API_SCHEMA_CONFIGURATION", + "ApiSchemaConfigurationUnknown": "API_SCHEMA_CONFIGURATION", + "ApprovalConfiguration": "APPROVAL_CONFIGURATION", + "AtlassianOauth2ProviderConfigInput": "ATLASSIAN_OAUTH2_PROVIDER_CONFIG_INPUT", + "AtlassianOauth2ProviderConfigOutput": "ATLASSIAN_OAUTH2_PROVIDER_CONFIG_OUTPUT", + "AuthorizationData": "AUTHORIZATION_DATA", + "AuthorizationDataOauth2": "AUTHORIZATION_DATA", + "AuthorizationDataUnknown": "AUTHORIZATION_DATA", + "AuthorizerConfiguration": "AUTHORIZER_CONFIGURATION", + "AuthorizerConfigurationCustomJWTAuthorizer": "AUTHORIZER_CONFIGURATION", + "AuthorizerConfigurationUnknown": "AUTHORIZER_CONFIGURATION", + "AuthorizerType": "AUTHORIZER_TYPE", + "AuthorizingClaimMatchValueType": "AUTHORIZING_CLAIM_MATCH_VALUE_TYPE", + "BatchPutGatewayRateLimitsInput": "BATCH_PUT_GATEWAY_RATE_LIMITS_INPUT", + "BatchPutGatewayRateLimitsOutput": "BATCH_PUT_GATEWAY_RATE_LIMITS_OUTPUT", + "BatchPutLimitEntry": "BATCH_PUT_LIMIT_ENTRY", + "BedrockEvaluatorModelConfig": "BEDROCK_EVALUATOR_MODEL_CONFIG", + "BrowserEnterprisePolicy": "BROWSER_ENTERPRISE_POLICY", + "BrowserEnterprisePolicyType": "BROWSER_ENTERPRISE_POLICY_TYPE", + "BrowserNetworkConfiguration": "BROWSER_NETWORK_CONFIGURATION", + "BrowserNetworkMode": "BROWSER_NETWORK_MODE", + "BrowserProfileStatus": "BROWSER_PROFILE_STATUS", + "BrowserProfileSummary": "BROWSER_PROFILE_SUMMARY", + "BrowserSigningConfigInput": "BROWSER_SIGNING_CONFIG_INPUT", + "BrowserSigningConfigOutput": "BROWSER_SIGNING_CONFIG_OUTPUT", + "BrowserStatus": "BROWSER_STATUS", + "BrowserSummary": "BROWSER_SUMMARY", + "CapacityProviderConfiguration": "CAPACITY_PROVIDER_CONFIGURATION", + "CapacityProviderStatus": "CAPACITY_PROVIDER_STATUS", + "CapacityProviderStatusCode": "CAPACITY_PROVIDER_STATUS_CODE", + "CapacityProviderSummary": "CAPACITY_PROVIDER_SUMMARY", + "CapacityProviderVolumeConfiguration": "CAPACITY_PROVIDER_VOLUME_CONFIGURATION", + "CapacityReservationPreference": "CAPACITY_RESERVATION_PREFERENCE", + "CapacityReservationSpecification": "CAPACITY_RESERVATION_SPECIFICATION", + "CapacityReservationTarget": "CAPACITY_RESERVATION_TARGET", + "CategoricalScaleDefinition": "CATEGORICAL_SCALE_DEFINITION", + "CedarPolicy": "CEDAR_POLICY", + "Certificate": "CERTIFICATE", + "CertificateConfiguration": "CERTIFICATE_CONFIGURATION", + "CertificateConfigurationS3": "CERTIFICATE_CONFIGURATION", + "CertificateConfigurationSecretsManager": "CERTIFICATE_CONFIGURATION", + "CertificateConfigurationUnknown": "CERTIFICATE_CONFIGURATION", + "CertificateLocation": "CERTIFICATE_LOCATION", + "CertificateLocationSecretsManager": "CERTIFICATE_LOCATION", + "CertificateLocationUnknown": "CERTIFICATE_LOCATION", + "ClaimMatchOperatorType": "CLAIM_MATCH_OPERATOR_TYPE", + "ClaimMatchValueType": "CLAIM_MATCH_VALUE_TYPE", + "ClaimMatchValueTypeMatchValueString": "CLAIM_MATCH_VALUE_TYPE", + "ClaimMatchValueTypeMatchValueStringList": "CLAIM_MATCH_VALUE_TYPE", + "ClaimMatchValueTypeUnknown": "CLAIM_MATCH_VALUE_TYPE", + "ClientAuthenticationMethodType": "CLIENT_AUTHENTICATION_METHOD_TYPE", + "CloudWatchLogsInputConfig": "CLOUD_WATCH_LOGS_INPUT_CONFIG", + "CloudWatchOutputConfig": "CLOUD_WATCH_OUTPUT_CONFIG", + "ClusteringConfig": "CLUSTERING_CONFIG", + "ClusteringFrequency": "CLUSTERING_FREQUENCY", + "Code": "CODE", + "CodeS3": "CODE", + "CodeUnknown": "CODE", + "CodeBasedEvaluatorConfig": "CODE_BASED_EVALUATOR_CONFIG", + "CodeBasedEvaluatorConfigLambdaConfig": "CODE_BASED_EVALUATOR_CONFIG", + "CodeBasedEvaluatorConfigUnknown": "CODE_BASED_EVALUATOR_CONFIG", + "CodeConfiguration": "CODE_CONFIGURATION", + "CodeInterpreterNetworkConfiguration": "CODE_INTERPRETER_NETWORK_CONFIGURATION", + "CodeInterpreterNetworkMode": "CODE_INTERPRETER_NETWORK_MODE", + "CodeInterpreterStatus": "CODE_INTERPRETER_STATUS", + "CodeInterpreterSummary": "CODE_INTERPRETER_SUMMARY", + "CoinbaseCdpConfigurationInput": "COINBASE_CDP_CONFIGURATION_INPUT", + "CoinbaseCdpConfigurationOutput": "COINBASE_CDP_CONFIGURATION_OUTPUT", + "CoinbaseCdpRotationTargets": "COINBASE_CDP_ROTATION_TARGETS", + "CoinbaseCdpSecret": "COINBASE_CDP_SECRET", + "ComponentConfiguration": "COMPONENT_CONFIGURATION", + "ComputeConfiguration": "COMPUTE_CONFIGURATION", + "ComputeConfigurationEc2Configuration": "COMPUTE_CONFIGURATION", + "ComputeConfigurationUnknown": "COMPUTE_CONFIGURATION", + "ConcurrentModificationException": "CONCURRENT_MODIFICATION_EXCEPTION", + "Condition": "CONDITION", + "ConditionMatchPrincipals": "CONDITION", + "ConditionMatchPaths": "CONDITION", + "ConditionUnknown": "CONDITION", + "ConfigurationBundleAction": "CONFIGURATION_BUNDLE_ACTION", + "ConfigurationBundleActionStaticOverride": "CONFIGURATION_BUNDLE_ACTION", + "ConfigurationBundleActionWeightedOverride": "CONFIGURATION_BUNDLE_ACTION", + "ConfigurationBundleActionUnknown": "CONFIGURATION_BUNDLE_ACTION", + "ConfigurationBundleReference": "CONFIGURATION_BUNDLE_REFERENCE", + "ConfigurationBundleStatus": "CONFIGURATION_BUNDLE_STATUS", + "ConfigurationBundleSummary": "CONFIGURATION_BUNDLE_SUMMARY", + "ConfigurationBundleVersionSummary": "CONFIGURATION_BUNDLE_VERSION_SUMMARY", + "ConflictException": "CONFLICT_EXCEPTION", + "ConnectorConfiguration": "CONNECTOR_CONFIGURATION", + "ConnectorParameterOverride": "CONNECTOR_PARAMETER_OVERRIDE", + "ConnectorSource": "CONNECTOR_SOURCE", + "ConnectorTargetConfiguration": "CONNECTOR_TARGET_CONFIGURATION", + "ConsentPortalIdpConfig": "CONSENT_PORTAL_IDP_CONFIG", + "ConsentPortalSource": "CONSENT_PORTAL_SOURCE", + "ConsentPortalSourceType": "CONSENT_PORTAL_SOURCE_TYPE", + "ConsentPortalStatus": "CONSENT_PORTAL_STATUS", + "ConsentPortalSummary": "CONSENT_PORTAL_SUMMARY", + "ConsolidationConfiguration": "CONSOLIDATION_CONFIGURATION", + "ConsolidationConfigurationCustomConsolidationConfiguration": "CONSOLIDATION_CONFIGURATION", + "ConsolidationConfigurationUnknown": "CONSOLIDATION_CONFIGURATION", + "ContainerConfiguration": "CONTAINER_CONFIGURATION", + "Content": "CONTENT", + "ContentRawText": "CONTENT", + "ContentUnknown": "CONTENT", + "ContentConfiguration": "CONTENT_CONFIGURATION", + "ContentLevel": "CONTENT_LEVEL", + "ContentType": "CONTENT_TYPE", + "CreateAgentRuntimeEndpointInput": "CREATE_AGENT_RUNTIME_ENDPOINT_INPUT", + "CreateAgentRuntimeEndpointOutput": "CREATE_AGENT_RUNTIME_ENDPOINT_OUTPUT", + "CreateAgentRuntimeInput": "CREATE_AGENT_RUNTIME_INPUT", + "CreateAgentRuntimeOutput": "CREATE_AGENT_RUNTIME_OUTPUT", + "CreateApiKeyCredentialProviderInput": "CREATE_API_KEY_CREDENTIAL_PROVIDER_INPUT", + "CreateApiKeyCredentialProviderOutput": "CREATE_API_KEY_CREDENTIAL_PROVIDER_OUTPUT", + "CreateBrowserInput": "CREATE_BROWSER_INPUT", + "CreateBrowserOutput": "CREATE_BROWSER_OUTPUT", + "CreateBrowserProfileInput": "CREATE_BROWSER_PROFILE_INPUT", + "CreateBrowserProfileOutput": "CREATE_BROWSER_PROFILE_OUTPUT", + "CreateCapacityProviderInput": "CREATE_CAPACITY_PROVIDER_INPUT", + "CreateCapacityProviderOutput": "CREATE_CAPACITY_PROVIDER_OUTPUT", + "CreateCodeInterpreterInput": "CREATE_CODE_INTERPRETER_INPUT", + "CreateCodeInterpreterOutput": "CREATE_CODE_INTERPRETER_OUTPUT", + "CreateConfigurationBundleInput": "CREATE_CONFIGURATION_BUNDLE_INPUT", + "CreateConfigurationBundleOutput": "CREATE_CONFIGURATION_BUNDLE_OUTPUT", + "CreateConsentPortalInput": "CREATE_CONSENT_PORTAL_INPUT", + "CreateConsentPortalOutput": "CREATE_CONSENT_PORTAL_OUTPUT", + "CreateDatasetInput": "CREATE_DATASET_INPUT", + "CreateDatasetOutput": "CREATE_DATASET_OUTPUT", + "CreateDatasetVersionInput": "CREATE_DATASET_VERSION_INPUT", + "CreateDatasetVersionOutput": "CREATE_DATASET_VERSION_OUTPUT", + "CreateEvaluatorInput": "CREATE_EVALUATOR_INPUT", + "CreateEvaluatorOutput": "CREATE_EVALUATOR_OUTPUT", + "CreateGatewayInput": "CREATE_GATEWAY_INPUT", + "CreateGatewayOutput": "CREATE_GATEWAY_OUTPUT", + "CreateGatewayRateLimitInput": "CREATE_GATEWAY_RATE_LIMIT_INPUT", + "CreateGatewayRateLimitOutput": "CREATE_GATEWAY_RATE_LIMIT_OUTPUT", + "CreateGatewayRuleInput": "CREATE_GATEWAY_RULE_INPUT", + "CreateGatewayRuleOutput": "CREATE_GATEWAY_RULE_OUTPUT", + "CreateGatewayTargetInput": "CREATE_GATEWAY_TARGET_INPUT", + "CreateGatewayTargetOutput": "CREATE_GATEWAY_TARGET_OUTPUT", + "CreateHarnessEndpointInput": "CREATE_HARNESS_ENDPOINT_INPUT", + "CreateHarnessEndpointOutput": "CREATE_HARNESS_ENDPOINT_OUTPUT", + "CreateHarnessInput": "CREATE_HARNESS_INPUT", + "CreateHarnessOutput": "CREATE_HARNESS_OUTPUT", + "CreateMemoryInput": "CREATE_MEMORY_INPUT", + "CreateMemoryOutput": "CREATE_MEMORY_OUTPUT", + "CreateOauth2CredentialProviderInput": "CREATE_OAUTH2_CREDENTIAL_PROVIDER_INPUT", + "CreateOauth2CredentialProviderOutput": "CREATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT", + "CreateOnlineEvaluationConfigInput": "CREATE_ONLINE_EVALUATION_CONFIG_INPUT", + "CreateOnlineEvaluationConfigOutput": "CREATE_ONLINE_EVALUATION_CONFIG_OUTPUT", + "CreatePaymentConnectorInput": "CREATE_PAYMENT_CONNECTOR_INPUT", + "CreatePaymentConnectorOutput": "CREATE_PAYMENT_CONNECTOR_OUTPUT", + "CreatePaymentCredentialProviderInput": "CREATE_PAYMENT_CREDENTIAL_PROVIDER_INPUT", + "CreatePaymentCredentialProviderOutput": "CREATE_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT", + "CreatePaymentManagerInput": "CREATE_PAYMENT_MANAGER_INPUT", + "CreatePaymentManagerOutput": "CREATE_PAYMENT_MANAGER_OUTPUT", + "CreatePolicyEngineInput": "CREATE_POLICY_ENGINE_INPUT", + "CreatePolicyEngineOutput": "CREATE_POLICY_ENGINE_OUTPUT", + "CreatePolicyInput": "CREATE_POLICY_INPUT", + "CreatePolicyOutput": "CREATE_POLICY_OUTPUT", + "CreateRegistryInput": "CREATE_REGISTRY_INPUT", + "CreateRegistryOutput": "CREATE_REGISTRY_OUTPUT", + "CreateRegistryRecordInput": "CREATE_REGISTRY_RECORD_INPUT", + "CreateRegistryRecordOutput": "CREATE_REGISTRY_RECORD_OUTPUT", + "CreateWorkloadIdentityInput": "CREATE_WORKLOAD_IDENTITY_INPUT", + "CreateWorkloadIdentityOutput": "CREATE_WORKLOAD_IDENTITY_OUTPUT", + "CredentialProvider": "CREDENTIAL_PROVIDER", + "CredentialProviderOauthCredentialProvider": "CREDENTIAL_PROVIDER", + "CredentialProviderApiKeyCredentialProvider": "CREDENTIAL_PROVIDER", + "CredentialProviderIamCredentialProvider": "CREDENTIAL_PROVIDER", + "CredentialProviderUnknown": "CREDENTIAL_PROVIDER", + "CredentialProviderConfiguration": "CREDENTIAL_PROVIDER_CONFIGURATION", + "CredentialProviderType": "CREDENTIAL_PROVIDER_TYPE", + "CredentialProviderVendorType": "CREDENTIAL_PROVIDER_VENDOR_TYPE", + "CredentialRotationConfig": "CREDENTIAL_ROTATION_CONFIG", + "CredentialRotationConfigCoinbaseCDP": "CREDENTIAL_ROTATION_CONFIG", + "CredentialRotationConfigUnknown": "CREDENTIAL_ROTATION_CONFIG", + "CredentialsProviderConfiguration": "CREDENTIALS_PROVIDER_CONFIGURATION", + "CredentialsProviderConfigurationCoinbaseCDP": "CREDENTIALS_PROVIDER_CONFIGURATION", + "CredentialsProviderConfigurationStripePrivy": "CREDENTIALS_PROVIDER_CONFIGURATION", + "CredentialsProviderConfigurationUnknown": "CREDENTIALS_PROVIDER_CONFIGURATION", + "CustomClaimValidationType": "CUSTOM_CLAIM_VALIDATION_TYPE", + "CustomConfigurationInput": "CUSTOM_CONFIGURATION_INPUT", + "CustomConfigurationInputSemanticOverride": "CUSTOM_CONFIGURATION_INPUT", + "CustomConfigurationInputSummaryOverride": "CUSTOM_CONFIGURATION_INPUT", + "CustomConfigurationInputUserPreferenceOverride": "CUSTOM_CONFIGURATION_INPUT", + "CustomConfigurationInputEpisodicOverride": "CUSTOM_CONFIGURATION_INPUT", + "CustomConfigurationInputSelfManagedConfiguration": "CUSTOM_CONFIGURATION_INPUT", + "CustomConfigurationInputUnknown": "CUSTOM_CONFIGURATION_INPUT", + "CustomConsolidationConfiguration": "CUSTOM_CONSOLIDATION_CONFIGURATION", + "CustomConsolidationConfigurationSemanticConsolidationOverride": "CUSTOM_CONSOLIDATION_CONFIGURATION", + "CustomConsolidationConfigurationSummaryConsolidationOverride": "CUSTOM_CONSOLIDATION_CONFIGURATION", + "CustomConsolidationConfigurationUserPreferenceConsolidationOverride": "CUSTOM_CONSOLIDATION_CONFIGURATION", + "CustomConsolidationConfigurationEpisodicConsolidationOverride": "CUSTOM_CONSOLIDATION_CONFIGURATION", + "CustomConsolidationConfigurationUnknown": "CUSTOM_CONSOLIDATION_CONFIGURATION", + "CustomConsolidationConfigurationInput": "CUSTOM_CONSOLIDATION_CONFIGURATION_INPUT", + "CustomConsolidationConfigurationInputSemanticConsolidationOverride": "CUSTOM_CONSOLIDATION_CONFIGURATION_INPUT", + "CustomConsolidationConfigurationInputSummaryConsolidationOverride": "CUSTOM_CONSOLIDATION_CONFIGURATION_INPUT", + "CustomConsolidationConfigurationInputUserPreferenceConsolidationOverride": "CUSTOM_CONSOLIDATION_CONFIGURATION_INPUT", + "CustomConsolidationConfigurationInputEpisodicConsolidationOverride": "CUSTOM_CONSOLIDATION_CONFIGURATION_INPUT", + "CustomConsolidationConfigurationInputUnknown": "CUSTOM_CONSOLIDATION_CONFIGURATION_INPUT", + "CustomDescriptor": "CUSTOM_DESCRIPTOR", + "CustomExtractionConfiguration": "CUSTOM_EXTRACTION_CONFIGURATION", + "CustomExtractionConfigurationSemanticExtractionOverride": "CUSTOM_EXTRACTION_CONFIGURATION", + "CustomExtractionConfigurationUserPreferenceExtractionOverride": "CUSTOM_EXTRACTION_CONFIGURATION", + "CustomExtractionConfigurationEpisodicExtractionOverride": "CUSTOM_EXTRACTION_CONFIGURATION", + "CustomExtractionConfigurationUnknown": "CUSTOM_EXTRACTION_CONFIGURATION", + "CustomExtractionConfigurationInput": "CUSTOM_EXTRACTION_CONFIGURATION_INPUT", + "CustomExtractionConfigurationInputSemanticExtractionOverride": "CUSTOM_EXTRACTION_CONFIGURATION_INPUT", + "CustomExtractionConfigurationInputUserPreferenceExtractionOverride": "CUSTOM_EXTRACTION_CONFIGURATION_INPUT", + "CustomExtractionConfigurationInputEpisodicExtractionOverride": "CUSTOM_EXTRACTION_CONFIGURATION_INPUT", + "CustomExtractionConfigurationInputUnknown": "CUSTOM_EXTRACTION_CONFIGURATION_INPUT", + "CustomJWTAuthorizerConfiguration": "CUSTOM_JWT_AUTHORIZER_CONFIGURATION", + "CustomMemoryStrategyInput": "CUSTOM_MEMORY_STRATEGY_INPUT", + "CustomOauth2ProviderConfigInput": "CUSTOM_OAUTH2_PROVIDER_CONFIG_INPUT", + "CustomOauth2ProviderConfigOutput": "CUSTOM_OAUTH2_PROVIDER_CONFIG_OUTPUT", + "CustomReflectionConfiguration": "CUSTOM_REFLECTION_CONFIGURATION", + "CustomReflectionConfigurationEpisodicReflectionOverride": "CUSTOM_REFLECTION_CONFIGURATION", + "CustomReflectionConfigurationUnknown": "CUSTOM_REFLECTION_CONFIGURATION", + "CustomReflectionConfigurationInput": "CUSTOM_REFLECTION_CONFIGURATION_INPUT", + "CustomReflectionConfigurationInputEpisodicReflectionOverride": "CUSTOM_REFLECTION_CONFIGURATION_INPUT", + "CustomReflectionConfigurationInputUnknown": "CUSTOM_REFLECTION_CONFIGURATION_INPUT", + "CustomTransformConfiguration": "CUSTOM_TRANSFORM_CONFIGURATION", + "DatasetSchemaType": "DATASET_SCHEMA_TYPE", + "DatasetStatus": "DATASET_STATUS", + "DatasetSummary": "DATASET_SUMMARY", + "DatasetVersionSummary": "DATASET_VERSION_SUMMARY", + "DataSourceConfig": "DATA_SOURCE_CONFIG", + "DataSourceConfigCloudWatchLogs": "DATA_SOURCE_CONFIG", + "DataSourceConfigUnknown": "DATA_SOURCE_CONFIG", + "DataSourceType": "DATA_SOURCE_TYPE", + "DataSourceTypeInlineExamples": "DATA_SOURCE_TYPE", + "DataSourceTypeS3Source": "DATA_SOURCE_TYPE", + "DataSourceTypeUnknown": "DATA_SOURCE_TYPE", + "DecryptionFailure": "DECRYPTION_FAILURE", + "DeleteAgentRuntimeEndpointInput": "DELETE_AGENT_RUNTIME_ENDPOINT_INPUT", + "DeleteAgentRuntimeEndpointOutput": "DELETE_AGENT_RUNTIME_ENDPOINT_OUTPUT", + "DeleteAgentRuntimeInput": "DELETE_AGENT_RUNTIME_INPUT", + "DeleteAgentRuntimeOutput": "DELETE_AGENT_RUNTIME_OUTPUT", + "DeleteApiKeyCredentialProviderInput": "DELETE_API_KEY_CREDENTIAL_PROVIDER_INPUT", + "DeleteApiKeyCredentialProviderOutput": "DELETE_API_KEY_CREDENTIAL_PROVIDER_OUTPUT", + "DeleteBrowserInput": "DELETE_BROWSER_INPUT", + "DeleteBrowserOutput": "DELETE_BROWSER_OUTPUT", + "DeleteBrowserProfileInput": "DELETE_BROWSER_PROFILE_INPUT", + "DeleteBrowserProfileOutput": "DELETE_BROWSER_PROFILE_OUTPUT", + "DeleteCapacityProviderInput": "DELETE_CAPACITY_PROVIDER_INPUT", + "DeleteCapacityProviderOutput": "DELETE_CAPACITY_PROVIDER_OUTPUT", + "DeleteCodeInterpreterInput": "DELETE_CODE_INTERPRETER_INPUT", + "DeleteCodeInterpreterOutput": "DELETE_CODE_INTERPRETER_OUTPUT", + "DeleteConfigurationBundleInput": "DELETE_CONFIGURATION_BUNDLE_INPUT", + "DeleteConfigurationBundleOutput": "DELETE_CONFIGURATION_BUNDLE_OUTPUT", + "DeleteConsentPortalInput": "DELETE_CONSENT_PORTAL_INPUT", + "DeleteConsentPortalOutput": "DELETE_CONSENT_PORTAL_OUTPUT", + "DeleteDatasetExamplesInput": "DELETE_DATASET_EXAMPLES_INPUT", + "DeleteDatasetExamplesOutput": "DELETE_DATASET_EXAMPLES_OUTPUT", + "DeleteDatasetInput": "DELETE_DATASET_INPUT", + "DeleteDatasetOutput": "DELETE_DATASET_OUTPUT", + "DeleteEvaluatorInput": "DELETE_EVALUATOR_INPUT", + "DeleteEvaluatorOutput": "DELETE_EVALUATOR_OUTPUT", + "DeleteGatewayInput": "DELETE_GATEWAY_INPUT", + "DeleteGatewayOutput": "DELETE_GATEWAY_OUTPUT", + "DeleteGatewayRateLimitInput": "DELETE_GATEWAY_RATE_LIMIT_INPUT", + "DeleteGatewayRateLimitOutput": "DELETE_GATEWAY_RATE_LIMIT_OUTPUT", + "DeleteGatewayRuleInput": "DELETE_GATEWAY_RULE_INPUT", + "DeleteGatewayRuleOutput": "DELETE_GATEWAY_RULE_OUTPUT", + "DeleteGatewayTargetInput": "DELETE_GATEWAY_TARGET_INPUT", + "DeleteGatewayTargetOutput": "DELETE_GATEWAY_TARGET_OUTPUT", + "DeleteHarnessEndpointInput": "DELETE_HARNESS_ENDPOINT_INPUT", + "DeleteHarnessEndpointOutput": "DELETE_HARNESS_ENDPOINT_OUTPUT", + "DeleteHarnessInput": "DELETE_HARNESS_INPUT", + "DeleteHarnessOutput": "DELETE_HARNESS_OUTPUT", + "DeleteMemoryInput": "DELETE_MEMORY_INPUT", + "DeleteMemoryOutput": "DELETE_MEMORY_OUTPUT", + "DeleteMemoryStrategyInput": "DELETE_MEMORY_STRATEGY_INPUT", + "DeleteOauth2CredentialProviderInput": "DELETE_OAUTH2_CREDENTIAL_PROVIDER_INPUT", + "DeleteOauth2CredentialProviderOutput": "DELETE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT", + "DeleteOnlineEvaluationConfigInput": "DELETE_ONLINE_EVALUATION_CONFIG_INPUT", + "DeleteOnlineEvaluationConfigOutput": "DELETE_ONLINE_EVALUATION_CONFIG_OUTPUT", + "DeletePaymentConnectorInput": "DELETE_PAYMENT_CONNECTOR_INPUT", + "DeletePaymentConnectorOutput": "DELETE_PAYMENT_CONNECTOR_OUTPUT", + "DeletePaymentCredentialProviderInput": "DELETE_PAYMENT_CREDENTIAL_PROVIDER_INPUT", + "DeletePaymentCredentialProviderOutput": "DELETE_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT", + "DeletePaymentManagerInput": "DELETE_PAYMENT_MANAGER_INPUT", + "DeletePaymentManagerOutput": "DELETE_PAYMENT_MANAGER_OUTPUT", + "DeletePolicyEngineInput": "DELETE_POLICY_ENGINE_INPUT", + "DeletePolicyEngineOutput": "DELETE_POLICY_ENGINE_OUTPUT", + "DeletePolicyInput": "DELETE_POLICY_INPUT", + "DeletePolicyOutput": "DELETE_POLICY_OUTPUT", + "DeleteRegistryInput": "DELETE_REGISTRY_INPUT", + "DeleteRegistryOutput": "DELETE_REGISTRY_OUTPUT", + "DeleteRegistryRecordInput": "DELETE_REGISTRY_RECORD_INPUT", + "DeleteRegistryRecordOutput": "DELETE_REGISTRY_RECORD_OUTPUT", + "DeleteResourcePolicyInput": "DELETE_RESOURCE_POLICY_INPUT", + "DeleteResourcePolicyOutput": "DELETE_RESOURCE_POLICY_OUTPUT", + "DeleteWorkloadIdentityInput": "DELETE_WORKLOAD_IDENTITY_INPUT", + "DeleteWorkloadIdentityOutput": "DELETE_WORKLOAD_IDENTITY_OUTPUT", + "DerivedEvaluatorConfig": "DERIVED_EVALUATOR_CONFIG", + "Descriptors": "DESCRIPTORS", + "DescriptorType": "DESCRIPTOR_TYPE", + "DraftStatus": "DRAFT_STATUS", + "EbsVolumeConfiguration": "EBS_VOLUME_CONFIGURATION", + "EbsVolumeType": "EBS_VOLUME_TYPE", + "Ec2Configuration": "EC2_CONFIGURATION", + "EfsAccessPointConfiguration": "EFS_ACCESS_POINT_CONFIGURATION", + "EfsConfiguration": "EFS_CONFIGURATION", + "EncryptionFailure": "ENCRYPTION_FAILURE", + "EndpointIpAddressType": "ENDPOINT_IP_ADDRESS_TYPE", + "EnforcementMode": "ENFORCEMENT_MODE", + "EphemeralBlockDeviceMapping": "EPHEMERAL_BLOCK_DEVICE_MAPPING", + "EphemeralEBSVolumeConfiguration": "EPHEMERAL_EBS_VOLUME_CONFIGURATION", + "EpisodicConsolidationOverride": "EPISODIC_CONSOLIDATION_OVERRIDE", + "EpisodicExtractionOverride": "EPISODIC_EXTRACTION_OVERRIDE", + "EpisodicMemoryStrategyInput": "EPISODIC_MEMORY_STRATEGY_INPUT", + "EpisodicOverrideConfigurationInput": "EPISODIC_OVERRIDE_CONFIGURATION_INPUT", + "EpisodicOverrideConsolidationConfigurationInput": "EPISODIC_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT", + "EpisodicOverrideExtractionConfigurationInput": "EPISODIC_OVERRIDE_EXTRACTION_CONFIGURATION_INPUT", + "EpisodicOverrideReflectionConfigurationInput": "EPISODIC_OVERRIDE_REFLECTION_CONFIGURATION_INPUT", + "EpisodicReflectionConfiguration": "EPISODIC_REFLECTION_CONFIGURATION", + "EpisodicReflectionConfigurationInput": "EPISODIC_REFLECTION_CONFIGURATION_INPUT", + "EpisodicReflectionOverride": "EPISODIC_REFLECTION_OVERRIDE", + "EvaluatorConfig": "EVALUATOR_CONFIG", + "EvaluatorConfigLlmAsAJudge": "EVALUATOR_CONFIG", + "EvaluatorConfigCodeBased": "EVALUATOR_CONFIG", + "EvaluatorConfigDerived": "EVALUATOR_CONFIG", + "EvaluatorConfigUnknown": "EVALUATOR_CONFIG", + "EvaluatorLevel": "EVALUATOR_LEVEL", + "EvaluatorModelConfig": "EVALUATOR_MODEL_CONFIG", + "EvaluatorModelConfigBedrockEvaluatorModelConfig": "EVALUATOR_MODEL_CONFIG", + "EvaluatorModelConfigResponsesEvaluatorModelConfig": "EVALUATOR_MODEL_CONFIG", + "EvaluatorModelConfigUnknown": "EVALUATOR_MODEL_CONFIG", + "EvaluatorReference": "EVALUATOR_REFERENCE", + "EvaluatorReferenceEvaluatorId": "EVALUATOR_REFERENCE", + "EvaluatorReferenceUnknown": "EVALUATOR_REFERENCE", + "EvaluatorStatus": "EVALUATOR_STATUS", + "EvaluatorSummary": "EVALUATOR_SUMMARY", + "EvaluatorType": "EVALUATOR_TYPE", + "ExceptionLevel": "EXCEPTION_LEVEL", + "ExtractionConfig": "EXTRACTION_CONFIG", + "ExtractionConfigLlmExtractionConfig": "EXTRACTION_CONFIG", + "ExtractionConfigUnknown": "EXTRACTION_CONFIG", + "ExtractionConfiguration": "EXTRACTION_CONFIGURATION", + "ExtractionConfigurationCustomExtractionConfiguration": "EXTRACTION_CONFIGURATION", + "ExtractionConfigurationUnknown": "EXTRACTION_CONFIGURATION", + "ExtractionType": "EXTRACTION_TYPE", + "FilesystemConfiguration": "FILESYSTEM_CONFIGURATION", + "FilesystemConfigurationSessionStorage": "FILESYSTEM_CONFIGURATION", + "FilesystemConfigurationS3FilesAccessPoint": "FILESYSTEM_CONFIGURATION", + "FilesystemConfigurationEfsAccessPoint": "FILESYSTEM_CONFIGURATION", + "FilesystemConfigurationCapacityProviderVolume": "FILESYSTEM_CONFIGURATION", + "FilesystemConfigurationUnknown": "FILESYSTEM_CONFIGURATION", + "Filter": "FILTER", + "FilterOperator": "FILTER_OPERATOR", + "FilterValue": "FILTER_VALUE", + "FilterValueStringValue": "FILTER_VALUE", + "FilterValueDoubleValue": "FILTER_VALUE", + "FilterValueBooleanValue": "FILTER_VALUE", + "FilterValueUnknown": "FILTER_VALUE", + "Finding": "FINDING", + "FindingType": "FINDING_TYPE", + "FromUrlSynchronizationConfiguration": "FROM_URL_SYNCHRONIZATION_CONFIGURATION", + "GatewayApiKeyCredentialProvider": "GATEWAY_API_KEY_CREDENTIAL_PROVIDER", + "GatewayInterceptionPoint": "GATEWAY_INTERCEPTION_POINT", + "GatewayInterceptorConfiguration": "GATEWAY_INTERCEPTOR_CONFIGURATION", + "GatewayPolicyEngineConfiguration": "GATEWAY_POLICY_ENGINE_CONFIGURATION", + "GatewayPolicyEngineMode": "GATEWAY_POLICY_ENGINE_MODE", + "GatewayProtocolConfiguration": "GATEWAY_PROTOCOL_CONFIGURATION", + "GatewayProtocolConfigurationMcp": "GATEWAY_PROTOCOL_CONFIGURATION", + "GatewayProtocolConfigurationUnknown": "GATEWAY_PROTOCOL_CONFIGURATION", + "GatewayProtocolType": "GATEWAY_PROTOCOL_TYPE", + "GatewayRateLimitDetail": "GATEWAY_RATE_LIMIT_DETAIL", + "GatewayRateLimitStatus": "GATEWAY_RATE_LIMIT_STATUS", + "GatewayRuleDetail": "GATEWAY_RULE_DETAIL", + "GatewayRuleStatus": "GATEWAY_RULE_STATUS", + "GatewayStatus": "GATEWAY_STATUS", + "GatewaySummary": "GATEWAY_SUMMARY", + "GatewayTarget": "GATEWAY_TARGET", + "GetAgentRuntimeEndpointInput": "GET_AGENT_RUNTIME_ENDPOINT_INPUT", + "GetAgentRuntimeEndpointOutput": "GET_AGENT_RUNTIME_ENDPOINT_OUTPUT", + "GetAgentRuntimeInput": "GET_AGENT_RUNTIME_INPUT", + "GetAgentRuntimeOutput": "GET_AGENT_RUNTIME_OUTPUT", + "GetApiKeyCredentialProviderInput": "GET_API_KEY_CREDENTIAL_PROVIDER_INPUT", + "GetApiKeyCredentialProviderOutput": "GET_API_KEY_CREDENTIAL_PROVIDER_OUTPUT", + "GetBrowserInput": "GET_BROWSER_INPUT", + "GetBrowserOutput": "GET_BROWSER_OUTPUT", + "GetBrowserProfileInput": "GET_BROWSER_PROFILE_INPUT", + "GetBrowserProfileOutput": "GET_BROWSER_PROFILE_OUTPUT", + "GetCapacityProviderInput": "GET_CAPACITY_PROVIDER_INPUT", + "GetCapacityProviderOutput": "GET_CAPACITY_PROVIDER_OUTPUT", + "GetCodeInterpreterInput": "GET_CODE_INTERPRETER_INPUT", + "GetCodeInterpreterOutput": "GET_CODE_INTERPRETER_OUTPUT", + "GetConfigurationBundleInput": "GET_CONFIGURATION_BUNDLE_INPUT", + "GetConfigurationBundleOutput": "GET_CONFIGURATION_BUNDLE_OUTPUT", + "GetConfigurationBundleVersionInput": "GET_CONFIGURATION_BUNDLE_VERSION_INPUT", + "GetConfigurationBundleVersionOutput": "GET_CONFIGURATION_BUNDLE_VERSION_OUTPUT", + "GetConsentPortalInput": "GET_CONSENT_PORTAL_INPUT", + "GetConsentPortalOutput": "GET_CONSENT_PORTAL_OUTPUT", + "GetDatasetInput": "GET_DATASET_INPUT", + "GetDatasetOutput": "GET_DATASET_OUTPUT", + "GetEvaluatorInput": "GET_EVALUATOR_INPUT", + "GetEvaluatorOutput": "GET_EVALUATOR_OUTPUT", + "GetGatewayInput": "GET_GATEWAY_INPUT", + "GetGatewayOutput": "GET_GATEWAY_OUTPUT", + "GetGatewayRateLimitInput": "GET_GATEWAY_RATE_LIMIT_INPUT", + "GetGatewayRateLimitOutput": "GET_GATEWAY_RATE_LIMIT_OUTPUT", + "GetGatewayRuleInput": "GET_GATEWAY_RULE_INPUT", + "GetGatewayRuleOutput": "GET_GATEWAY_RULE_OUTPUT", + "GetGatewayTargetInput": "GET_GATEWAY_TARGET_INPUT", + "GetGatewayTargetOutput": "GET_GATEWAY_TARGET_OUTPUT", + "GetHarnessEndpointInput": "GET_HARNESS_ENDPOINT_INPUT", + "GetHarnessEndpointOutput": "GET_HARNESS_ENDPOINT_OUTPUT", + "GetHarnessInput": "GET_HARNESS_INPUT", + "GetHarnessOutput": "GET_HARNESS_OUTPUT", + "GetMemoryInput": "GET_MEMORY_INPUT", + "GetMemoryOutput": "GET_MEMORY_OUTPUT", + "GetOauth2CredentialProviderInput": "GET_OAUTH2_CREDENTIAL_PROVIDER_INPUT", + "GetOauth2CredentialProviderOutput": "GET_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT", + "GetOnlineEvaluationConfigInput": "GET_ONLINE_EVALUATION_CONFIG_INPUT", + "GetOnlineEvaluationConfigOutput": "GET_ONLINE_EVALUATION_CONFIG_OUTPUT", + "GetPaymentConnectorInput": "GET_PAYMENT_CONNECTOR_INPUT", + "GetPaymentConnectorOutput": "GET_PAYMENT_CONNECTOR_OUTPUT", + "GetPaymentCredentialProviderInput": "GET_PAYMENT_CREDENTIAL_PROVIDER_INPUT", + "GetPaymentCredentialProviderOutput": "GET_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT", + "GetPaymentManagerInput": "GET_PAYMENT_MANAGER_INPUT", + "GetPaymentManagerOutput": "GET_PAYMENT_MANAGER_OUTPUT", + "GetPolicyEngineInput": "GET_POLICY_ENGINE_INPUT", + "GetPolicyEngineOutput": "GET_POLICY_ENGINE_OUTPUT", + "GetPolicyEngineSummaryInput": "GET_POLICY_ENGINE_SUMMARY_INPUT", + "GetPolicyEngineSummaryOutput": "GET_POLICY_ENGINE_SUMMARY_OUTPUT", + "GetPolicyGenerationInput": "GET_POLICY_GENERATION_INPUT", + "GetPolicyGenerationOutput": "GET_POLICY_GENERATION_OUTPUT", + "GetPolicyGenerationSummaryInput": "GET_POLICY_GENERATION_SUMMARY_INPUT", + "GetPolicyGenerationSummaryOutput": "GET_POLICY_GENERATION_SUMMARY_OUTPUT", + "GetPolicyInput": "GET_POLICY_INPUT", + "GetPolicyOutput": "GET_POLICY_OUTPUT", + "GetPolicySummaryInput": "GET_POLICY_SUMMARY_INPUT", + "GetPolicySummaryOutput": "GET_POLICY_SUMMARY_OUTPUT", + "GetRegistryInput": "GET_REGISTRY_INPUT", + "GetRegistryOutput": "GET_REGISTRY_OUTPUT", + "GetRegistryRecordInput": "GET_REGISTRY_RECORD_INPUT", + "GetRegistryRecordOutput": "GET_REGISTRY_RECORD_OUTPUT", + "GetResourcePolicyInput": "GET_RESOURCE_POLICY_INPUT", + "GetResourcePolicyOutput": "GET_RESOURCE_POLICY_OUTPUT", + "GetTokenVaultInput": "GET_TOKEN_VAULT_INPUT", + "GetTokenVaultOutput": "GET_TOKEN_VAULT_OUTPUT", + "GetWorkloadIdentityInput": "GET_WORKLOAD_IDENTITY_INPUT", + "GetWorkloadIdentityOutput": "GET_WORKLOAD_IDENTITY_OUTPUT", + "GithubOauth2ProviderConfigInput": "GITHUB_OAUTH2_PROVIDER_CONFIG_INPUT", + "GithubOauth2ProviderConfigOutput": "GITHUB_OAUTH2_PROVIDER_CONFIG_OUTPUT", + "GoogleOauth2ProviderConfigInput": "GOOGLE_OAUTH2_PROVIDER_CONFIG_INPUT", + "GoogleOauth2ProviderConfigOutput": "GOOGLE_OAUTH2_PROVIDER_CONFIG_OUTPUT", + "Harness": "HARNESS", + "HarnessAfterInvocationHook": "HARNESS_AFTER_INVOCATION_HOOK", + "HarnessAfterToolCallHook": "HARNESS_AFTER_TOOL_CALL_HOOK", + "HarnessAgentCoreBrowserConfig": "HARNESS_AGENT_CORE_BROWSER_CONFIG", + "HarnessAgentCoreCodeInterpreterConfig": "HARNESS_AGENT_CORE_CODE_INTERPRETER_CONFIG", + "HarnessAgentCoreGatewayConfig": "HARNESS_AGENT_CORE_GATEWAY_CONFIG", + "HarnessAgentCoreMemoryConfiguration": "HARNESS_AGENT_CORE_MEMORY_CONFIGURATION", + "HarnessAgentCoreMemoryRetrievalConfig": "HARNESS_AGENT_CORE_MEMORY_RETRIEVAL_CONFIG", + "HarnessAgentCoreRuntimeEnvironment": "HARNESS_AGENT_CORE_RUNTIME_ENVIRONMENT", + "HarnessAgentCoreRuntimeEnvironmentRequest": "HARNESS_AGENT_CORE_RUNTIME_ENVIRONMENT_REQUEST", + "HarnessBedrockApiFormat": "HARNESS_BEDROCK_API_FORMAT", + "HarnessBedrockModelConfig": "HARNESS_BEDROCK_MODEL_CONFIG", + "HarnessBeforeInvocationHook": "HARNESS_BEFORE_INVOCATION_HOOK", + "HarnessBeforeToolCallHook": "HARNESS_BEFORE_TOOL_CALL_HOOK", + "HarnessDisabledMemoryConfiguration": "HARNESS_DISABLED_MEMORY_CONFIGURATION", + "HarnessEndpoint": "HARNESS_ENDPOINT", + "HarnessEndpointStatus": "HARNESS_ENDPOINT_STATUS", + "HarnessEnvironmentArtifact": "HARNESS_ENVIRONMENT_ARTIFACT", + "HarnessEnvironmentArtifactContainerConfiguration": "HARNESS_ENVIRONMENT_ARTIFACT", + "HarnessEnvironmentArtifactUnknown": "HARNESS_ENVIRONMENT_ARTIFACT", + "HarnessEnvironmentProvider": "HARNESS_ENVIRONMENT_PROVIDER", + "HarnessEnvironmentProviderAgentCoreRuntimeEnvironment": "HARNESS_ENVIRONMENT_PROVIDER", + "HarnessEnvironmentProviderUnknown": "HARNESS_ENVIRONMENT_PROVIDER", + "HarnessEnvironmentProviderRequest": "HARNESS_ENVIRONMENT_PROVIDER_REQUEST", + "HarnessEnvironmentProviderRequestAgentCoreRuntimeEnvironment": "HARNESS_ENVIRONMENT_PROVIDER_REQUEST", + "HarnessEnvironmentProviderRequestUnknown": "HARNESS_ENVIRONMENT_PROVIDER_REQUEST", + "HarnessGatewayOutboundAuth": "HARNESS_GATEWAY_OUTBOUND_AUTH", + "HarnessGatewayOutboundAuthAwsIam": "HARNESS_GATEWAY_OUTBOUND_AUTH", + "HarnessGatewayOutboundAuthNone": "HARNESS_GATEWAY_OUTBOUND_AUTH", + "HarnessGatewayOutboundAuthOauth": "HARNESS_GATEWAY_OUTBOUND_AUTH", + "HarnessGatewayOutboundAuthUnknown": "HARNESS_GATEWAY_OUTBOUND_AUTH", + "HarnessGeminiModelConfig": "HARNESS_GEMINI_MODEL_CONFIG", + "HarnessHook": "HARNESS_HOOK", + "HarnessHookBeforeInvocation": "HARNESS_HOOK", + "HarnessHookAfterInvocation": "HARNESS_HOOK", + "HarnessHookBeforeToolCall": "HARNESS_HOOK", + "HarnessHookAfterToolCall": "HARNESS_HOOK", + "HarnessHookUnknown": "HARNESS_HOOK", + "HarnessHookEventBridgeTarget": "HARNESS_HOOK_EVENT_BRIDGE_TARGET", + "HarnessHookFailureMode": "HARNESS_HOOK_FAILURE_MODE", + "HarnessHookLambdaTarget": "HARNESS_HOOK_LAMBDA_TARGET", + "HarnessHookSnsTarget": "HARNESS_HOOK_SNS_TARGET", + "HarnessHookTarget": "HARNESS_HOOK_TARGET", + "HarnessHookTargetLambda": "HARNESS_HOOK_TARGET", + "HarnessHookTargetSns": "HARNESS_HOOK_TARGET", + "HarnessHookTargetEventBridge": "HARNESS_HOOK_TARGET", + "HarnessHookTargetUnknown": "HARNESS_HOOK_TARGET", + "HarnessInlineFunctionConfig": "HARNESS_INLINE_FUNCTION_CONFIG", + "HarnessLiteLlmModelConfig": "HARNESS_LITE_LLM_MODEL_CONFIG", + "HarnessManagedMemoryConfiguration": "HARNESS_MANAGED_MEMORY_CONFIGURATION", + "HarnessManagedMemoryStrategyType": "HARNESS_MANAGED_MEMORY_STRATEGY_TYPE", + "HarnessMemoryConfiguration": "HARNESS_MEMORY_CONFIGURATION", + "HarnessMemoryConfigurationAgentCoreMemoryConfiguration": "HARNESS_MEMORY_CONFIGURATION", + "HarnessMemoryConfigurationManagedMemoryConfiguration": "HARNESS_MEMORY_CONFIGURATION", + "HarnessMemoryConfigurationDisabled": "HARNESS_MEMORY_CONFIGURATION", + "HarnessMemoryConfigurationUnknown": "HARNESS_MEMORY_CONFIGURATION", + "HarnessModelConfiguration": "HARNESS_MODEL_CONFIGURATION", + "HarnessModelConfigurationBedrockModelConfig": "HARNESS_MODEL_CONFIGURATION", + "HarnessModelConfigurationOpenAiModelConfig": "HARNESS_MODEL_CONFIGURATION", + "HarnessModelConfigurationGeminiModelConfig": "HARNESS_MODEL_CONFIGURATION", + "HarnessModelConfigurationLiteLlmModelConfig": "HARNESS_MODEL_CONFIGURATION", + "HarnessModelConfigurationUnknown": "HARNESS_MODEL_CONFIGURATION", + "HarnessOpenAiApiFormat": "HARNESS_OPEN_AI_API_FORMAT", + "HarnessOpenAiModelConfig": "HARNESS_OPEN_AI_MODEL_CONFIG", + "HarnessRemoteMcpConfig": "HARNESS_REMOTE_MCP_CONFIG", + "HarnessSkill": "HARNESS_SKILL", + "HarnessSkillPath": "HARNESS_SKILL", + "HarnessSkillS3": "HARNESS_SKILL", + "HarnessSkillGit": "HARNESS_SKILL", + "HarnessSkillAwsSkills": "HARNESS_SKILL", + "HarnessSkillUnknown": "HARNESS_SKILL", + "HarnessSkillAwsSkillsSource": "HARNESS_SKILL_AWS_SKILLS_SOURCE", + "HarnessSkillGitAuth": "HARNESS_SKILL_GIT_AUTH", + "HarnessSkillGitSource": "HARNESS_SKILL_GIT_SOURCE", + "HarnessSkillS3Source": "HARNESS_SKILL_S3_SOURCE", + "HarnessSlidingWindowConfiguration": "HARNESS_SLIDING_WINDOW_CONFIGURATION", + "HarnessStatus": "HARNESS_STATUS", + "HarnessSummarizationConfiguration": "HARNESS_SUMMARIZATION_CONFIGURATION", + "HarnessSummary": "HARNESS_SUMMARY", + "HarnessSystemContentBlock": "HARNESS_SYSTEM_CONTENT_BLOCK", + "HarnessSystemContentBlockText": "HARNESS_SYSTEM_CONTENT_BLOCK", + "HarnessSystemContentBlockUnknown": "HARNESS_SYSTEM_CONTENT_BLOCK", + "HarnessTool": "HARNESS_TOOL", + "HarnessToolConfiguration": "HARNESS_TOOL_CONFIGURATION", + "HarnessToolConfigurationRemoteMcp": "HARNESS_TOOL_CONFIGURATION", + "HarnessToolConfigurationAgentCoreBrowser": "HARNESS_TOOL_CONFIGURATION", + "HarnessToolConfigurationAgentCoreGateway": "HARNESS_TOOL_CONFIGURATION", + "HarnessToolConfigurationInlineFunction": "HARNESS_TOOL_CONFIGURATION", + "HarnessToolConfigurationAgentCoreCodeInterpreter": "HARNESS_TOOL_CONFIGURATION", + "HarnessToolConfigurationUnknown": "HARNESS_TOOL_CONFIGURATION", + "HarnessToolType": "HARNESS_TOOL_TYPE", + "HarnessTruncationConfiguration": "HARNESS_TRUNCATION_CONFIGURATION", + "HarnessTruncationStrategy": "HARNESS_TRUNCATION_STRATEGY", + "HarnessTruncationStrategyConfiguration": "HARNESS_TRUNCATION_STRATEGY_CONFIGURATION", + "HarnessTruncationStrategyConfigurationSlidingWindow": "HARNESS_TRUNCATION_STRATEGY_CONFIGURATION", + "HarnessTruncationStrategyConfigurationSummarization": "HARNESS_TRUNCATION_STRATEGY_CONFIGURATION", + "HarnessTruncationStrategyConfigurationUnknown": "HARNESS_TRUNCATION_STRATEGY_CONFIGURATION", + "HarnessVersionSummary": "HARNESS_VERSION_SUMMARY", + "HostingEnvironment": "HOSTING_ENVIRONMENT", + "HttpApiSchemaConfiguration": "HTTP_API_SCHEMA_CONFIGURATION", + "HttpConnectorSource": "HTTP_CONNECTOR_SOURCE", + "HttpConnectorTargetConfiguration": "HTTP_CONNECTOR_TARGET_CONFIGURATION", + "HttpTargetConfiguration": "HTTP_TARGET_CONFIGURATION", + "HttpTargetConfigurationAgentcoreRuntime": "HTTP_TARGET_CONFIGURATION", + "HttpTargetConfigurationPassthrough": "HTTP_TARGET_CONFIGURATION", + "HttpTargetConfigurationConnector": "HTTP_TARGET_CONFIGURATION", + "HttpTargetConfigurationUnknown": "HTTP_TARGET_CONFIGURATION", + "IamCredentialProvider": "IAM_CREDENTIAL_PROVIDER", + "IamPrincipal": "IAM_PRINCIPAL", + "InboundTokenClaimValueType": "INBOUND_TOKEN_CLAIM_VALUE_TYPE", + "IncludedData": "INCLUDED_DATA", + "IncludedOauth2ProviderConfigInput": "INCLUDED_OAUTH2_PROVIDER_CONFIG_INPUT", + "IncludedOauth2ProviderConfigOutput": "INCLUDED_OAUTH2_PROVIDER_CONFIG_OUTPUT", + "IndexedKey": "INDEXED_KEY", + "InferenceConfiguration": "INFERENCE_CONFIGURATION", + "InferenceConnectorSource": "INFERENCE_CONNECTOR_SOURCE", + "InferenceConnectorTargetConfiguration": "INFERENCE_CONNECTOR_TARGET_CONFIGURATION", + "InferenceOperationConfiguration": "INFERENCE_OPERATION_CONFIGURATION", + "InferenceProviderTargetConfiguration": "INFERENCE_PROVIDER_TARGET_CONFIGURATION", + "InferenceTargetConfiguration": "INFERENCE_TARGET_CONFIGURATION", + "InferenceTargetConfigurationConnector": "INFERENCE_TARGET_CONFIGURATION", + "InferenceTargetConfigurationProvider": "INFERENCE_TARGET_CONFIGURATION", + "InferenceTargetConfigurationUnknown": "INFERENCE_TARGET_CONFIGURATION", + "InlineExamplesSource": "INLINE_EXAMPLES_SOURCE", + "Insight": "INSIGHT", + "InstanceLifecycleConfiguration": "INSTANCE_LIFECYCLE_CONFIGURATION", + "InstanceRequirements": "INSTANCE_REQUIREMENTS", + "InterceptorConfiguration": "INTERCEPTOR_CONFIGURATION", + "InterceptorConfigurationLambda": "INTERCEPTOR_CONFIGURATION", + "InterceptorConfigurationUnknown": "INTERCEPTOR_CONFIGURATION", + "InterceptorInputConfiguration": "INTERCEPTOR_INPUT_CONFIGURATION", + "InterceptorPayloadExclusion": "INTERCEPTOR_PAYLOAD_EXCLUSION", + "InterceptorPayloadExclusionSelector": "INTERCEPTOR_PAYLOAD_EXCLUSION_SELECTOR", + "InterceptorPayloadExclusionSelectorField": "INTERCEPTOR_PAYLOAD_EXCLUSION_SELECTOR", + "InterceptorPayloadExclusionSelectorUnknown": "INTERCEPTOR_PAYLOAD_EXCLUSION_SELECTOR", + "InterceptorPayloadFilter": "INTERCEPTOR_PAYLOAD_FILTER", + "InternalServerException": "INTERNAL_SERVER_EXCEPTION", + "InvocationConfiguration": "INVOCATION_CONFIGURATION", + "InvocationConfigurationInput": "INVOCATION_CONFIGURATION_INPUT", + "KeyType": "KEY_TYPE", + "KinesisResource": "KINESIS_RESOURCE", + "KmsConfiguration": "KMS_CONFIGURATION", + "KmsKeySourceType": "KMS_KEY_SOURCE_TYPE", + "LambdaEvaluatorConfig": "LAMBDA_EVALUATOR_CONFIG", + "LambdaInterceptorConfiguration": "LAMBDA_INTERCEPTOR_CONFIGURATION", + "LambdaTransformConfiguration": "LAMBDA_TRANSFORM_CONFIGURATION", + "LaunchParameters": "LAUNCH_PARAMETERS", + "LaunchTemplateSource": "LAUNCH_TEMPLATE_SOURCE", + "LaunchTemplateSourceLaunchParameters": "LAUNCH_TEMPLATE_SOURCE", + "LaunchTemplateSourceUnknown": "LAUNCH_TEMPLATE_SOURCE", + "LicenseSpecification": "LICENSE_SPECIFICATION", + "LifecycleConfiguration": "LIFECYCLE_CONFIGURATION", + "LimitEntry": "LIMIT_ENTRY", + "LinkedinOauth2ProviderConfigInput": "LINKEDIN_OAUTH2_PROVIDER_CONFIG_INPUT", + "LinkedinOauth2ProviderConfigOutput": "LINKEDIN_OAUTH2_PROVIDER_CONFIG_OUTPUT", + "ListAgentRuntimeEndpointsInput": "LIST_AGENT_RUNTIME_ENDPOINTS_INPUT", + "ListAgentRuntimeEndpointsOutput": "LIST_AGENT_RUNTIME_ENDPOINTS_OUTPUT", + "ListAgentRuntimesInput": "LIST_AGENT_RUNTIMES_INPUT", + "ListAgentRuntimesOutput": "LIST_AGENT_RUNTIMES_OUTPUT", + "ListAgentRuntimeVersionsByCapacityProviderInput": "LIST_AGENT_RUNTIME_VERSIONS_BY_CAPACITY_PROVIDER_INPUT", + "ListAgentRuntimeVersionsByCapacityProviderOutput": "LIST_AGENT_RUNTIME_VERSIONS_BY_CAPACITY_PROVIDER_OUTPUT", + "ListAgentRuntimeVersionsInput": "LIST_AGENT_RUNTIME_VERSIONS_INPUT", + "ListAgentRuntimeVersionsOutput": "LIST_AGENT_RUNTIME_VERSIONS_OUTPUT", + "ListApiKeyCredentialProvidersInput": "LIST_API_KEY_CREDENTIAL_PROVIDERS_INPUT", + "ListApiKeyCredentialProvidersOutput": "LIST_API_KEY_CREDENTIAL_PROVIDERS_OUTPUT", + "ListBrowserProfilesInput": "LIST_BROWSER_PROFILES_INPUT", + "ListBrowserProfilesOutput": "LIST_BROWSER_PROFILES_OUTPUT", + "ListBrowsersInput": "LIST_BROWSERS_INPUT", + "ListBrowsersOutput": "LIST_BROWSERS_OUTPUT", + "ListCapacityProvidersInput": "LIST_CAPACITY_PROVIDERS_INPUT", + "ListCapacityProvidersOutput": "LIST_CAPACITY_PROVIDERS_OUTPUT", + "ListCodeInterpretersInput": "LIST_CODE_INTERPRETERS_INPUT", + "ListCodeInterpretersOutput": "LIST_CODE_INTERPRETERS_OUTPUT", + "ListConfigurationBundlesInput": "LIST_CONFIGURATION_BUNDLES_INPUT", + "ListConfigurationBundlesOutput": "LIST_CONFIGURATION_BUNDLES_OUTPUT", + "ListConfigurationBundleVersionsInput": "LIST_CONFIGURATION_BUNDLE_VERSIONS_INPUT", + "ListConfigurationBundleVersionsOutput": "LIST_CONFIGURATION_BUNDLE_VERSIONS_OUTPUT", + "ListConsentPortalsInput": "LIST_CONSENT_PORTALS_INPUT", + "ListConsentPortalsOutput": "LIST_CONSENT_PORTALS_OUTPUT", + "ListDatasetExamplesInput": "LIST_DATASET_EXAMPLES_INPUT", + "ListDatasetExamplesOutput": "LIST_DATASET_EXAMPLES_OUTPUT", + "ListDatasetsInput": "LIST_DATASETS_INPUT", + "ListDatasetsOutput": "LIST_DATASETS_OUTPUT", + "ListDatasetVersionsInput": "LIST_DATASET_VERSIONS_INPUT", + "ListDatasetVersionsOutput": "LIST_DATASET_VERSIONS_OUTPUT", + "ListEvaluatorsInput": "LIST_EVALUATORS_INPUT", + "ListEvaluatorsOutput": "LIST_EVALUATORS_OUTPUT", + "ListGatewayRateLimitsInput": "LIST_GATEWAY_RATE_LIMITS_INPUT", + "ListGatewayRateLimitsOutput": "LIST_GATEWAY_RATE_LIMITS_OUTPUT", + "ListGatewayRulesInput": "LIST_GATEWAY_RULES_INPUT", + "ListGatewayRulesOutput": "LIST_GATEWAY_RULES_OUTPUT", + "ListGatewaysInput": "LIST_GATEWAYS_INPUT", + "ListGatewaysOutput": "LIST_GATEWAYS_OUTPUT", + "ListGatewayTargetsInput": "LIST_GATEWAY_TARGETS_INPUT", + "ListGatewayTargetsOutput": "LIST_GATEWAY_TARGETS_OUTPUT", + "ListHarnessEndpointsInput": "LIST_HARNESS_ENDPOINTS_INPUT", + "ListHarnessEndpointsOutput": "LIST_HARNESS_ENDPOINTS_OUTPUT", + "ListHarnessesInput": "LIST_HARNESSES_INPUT", + "ListHarnessesOutput": "LIST_HARNESSES_OUTPUT", + "ListHarnessVersionsInput": "LIST_HARNESS_VERSIONS_INPUT", + "ListHarnessVersionsOutput": "LIST_HARNESS_VERSIONS_OUTPUT", + "ListingMode": "LISTING_MODE", + "ListMemoriesInput": "LIST_MEMORIES_INPUT", + "ListMemoriesOutput": "LIST_MEMORIES_OUTPUT", + "ListOauth2CredentialProvidersInput": "LIST_OAUTH2_CREDENTIAL_PROVIDERS_INPUT", + "ListOauth2CredentialProvidersOutput": "LIST_OAUTH2_CREDENTIAL_PROVIDERS_OUTPUT", + "ListOnlineEvaluationConfigsInput": "LIST_ONLINE_EVALUATION_CONFIGS_INPUT", + "ListOnlineEvaluationConfigsOutput": "LIST_ONLINE_EVALUATION_CONFIGS_OUTPUT", + "ListPaymentConnectorsInput": "LIST_PAYMENT_CONNECTORS_INPUT", + "ListPaymentConnectorsOutput": "LIST_PAYMENT_CONNECTORS_OUTPUT", + "ListPaymentCredentialProvidersInput": "LIST_PAYMENT_CREDENTIAL_PROVIDERS_INPUT", + "ListPaymentCredentialProvidersOutput": "LIST_PAYMENT_CREDENTIAL_PROVIDERS_OUTPUT", + "ListPaymentManagersInput": "LIST_PAYMENT_MANAGERS_INPUT", + "ListPaymentManagersOutput": "LIST_PAYMENT_MANAGERS_OUTPUT", + "ListPoliciesInput": "LIST_POLICIES_INPUT", + "ListPoliciesOutput": "LIST_POLICIES_OUTPUT", + "ListPolicyEnginesInput": "LIST_POLICY_ENGINES_INPUT", + "ListPolicyEnginesOutput": "LIST_POLICY_ENGINES_OUTPUT", + "ListPolicyEngineSummariesInput": "LIST_POLICY_ENGINE_SUMMARIES_INPUT", + "ListPolicyEngineSummariesOutput": "LIST_POLICY_ENGINE_SUMMARIES_OUTPUT", + "ListPolicyGenerationAssetsInput": "LIST_POLICY_GENERATION_ASSETS_INPUT", + "ListPolicyGenerationAssetsOutput": "LIST_POLICY_GENERATION_ASSETS_OUTPUT", + "ListPolicyGenerationsInput": "LIST_POLICY_GENERATIONS_INPUT", + "ListPolicyGenerationsOutput": "LIST_POLICY_GENERATIONS_OUTPUT", + "ListPolicyGenerationSummariesInput": "LIST_POLICY_GENERATION_SUMMARIES_INPUT", + "ListPolicyGenerationSummariesOutput": "LIST_POLICY_GENERATION_SUMMARIES_OUTPUT", + "ListPolicySummariesInput": "LIST_POLICY_SUMMARIES_INPUT", + "ListPolicySummariesOutput": "LIST_POLICY_SUMMARIES_OUTPUT", + "ListRegistriesInput": "LIST_REGISTRIES_INPUT", + "ListRegistriesOutput": "LIST_REGISTRIES_OUTPUT", + "ListRegistryRecordsInput": "LIST_REGISTRY_RECORDS_INPUT", + "ListRegistryRecordsOutput": "LIST_REGISTRY_RECORDS_OUTPUT", + "ListTagsForResourceInput": "LIST_TAGS_FOR_RESOURCE_INPUT", + "ListTagsForResourceOutput": "LIST_TAGS_FOR_RESOURCE_OUTPUT", + "ListWorkloadIdentitiesInput": "LIST_WORKLOAD_IDENTITIES_INPUT", + "ListWorkloadIdentitiesOutput": "LIST_WORKLOAD_IDENTITIES_OUTPUT", + "LlmAsAJudgeEvaluatorConfig": "LLM_AS_A_JUDGE_EVALUATOR_CONFIG", + "LlmExtractionConfig": "LLM_EXTRACTION_CONFIG", + "ManagedResourceDetails": "MANAGED_RESOURCE_DETAILS", + "ManagedVpcResource": "MANAGED_VPC_RESOURCE", + "MatchPaths": "MATCH_PATHS", + "MatchPrincipalEntry": "MATCH_PRINCIPAL_ENTRY", + "MatchPrincipalEntryIamPrincipal": "MATCH_PRINCIPAL_ENTRY", + "MatchPrincipalEntryUnknown": "MATCH_PRINCIPAL_ENTRY", + "MatchPrincipals": "MATCH_PRINCIPALS", + "McpDescriptor": "MCP_DESCRIPTOR", + "MCPGatewayConfiguration": "MCP_GATEWAY_CONFIGURATION", + "McpLambdaTargetConfiguration": "MCP_LAMBDA_TARGET_CONFIGURATION", + "McpServerTargetConfiguration": "MCP_SERVER_TARGET_CONFIGURATION", + "McpTargetConfiguration": "MCP_TARGET_CONFIGURATION", + "McpTargetConfigurationOpenApiSchema": "MCP_TARGET_CONFIGURATION", + "McpTargetConfigurationSmithyModel": "MCP_TARGET_CONFIGURATION", + "McpTargetConfigurationLambda": "MCP_TARGET_CONFIGURATION", + "McpTargetConfigurationMcpServer": "MCP_TARGET_CONFIGURATION", + "McpTargetConfigurationApiGateway": "MCP_TARGET_CONFIGURATION", + "McpTargetConfigurationConnector": "MCP_TARGET_CONFIGURATION", + "McpTargetConfigurationUnknown": "MCP_TARGET_CONFIGURATION", + "McpToolSchemaConfiguration": "MCP_TOOL_SCHEMA_CONFIGURATION", + "McpToolSchemaConfigurationS3": "MCP_TOOL_SCHEMA_CONFIGURATION", + "McpToolSchemaConfigurationInlinePayload": "MCP_TOOL_SCHEMA_CONFIGURATION", + "McpToolSchemaConfigurationUnknown": "MCP_TOOL_SCHEMA_CONFIGURATION", + "Memory": "MEMORY", + "MemoryRecordSchema": "MEMORY_RECORD_SCHEMA", + "MemoryStatus": "MEMORY_STATUS", + "MemoryStrategy": "MEMORY_STRATEGY", + "MemoryStrategyInput": "MEMORY_STRATEGY_INPUT", + "MemoryStrategyInputSemanticMemoryStrategy": "MEMORY_STRATEGY_INPUT", + "MemoryStrategyInputSummaryMemoryStrategy": "MEMORY_STRATEGY_INPUT", + "MemoryStrategyInputUserPreferenceMemoryStrategy": "MEMORY_STRATEGY_INPUT", + "MemoryStrategyInputCustomMemoryStrategy": "MEMORY_STRATEGY_INPUT", + "MemoryStrategyInputEpisodicMemoryStrategy": "MEMORY_STRATEGY_INPUT", + "MemoryStrategyInputUnknown": "MEMORY_STRATEGY_INPUT", + "MemoryStrategyStatus": "MEMORY_STRATEGY_STATUS", + "MemoryStrategyType": "MEMORY_STRATEGY_TYPE", + "MemorySummary": "MEMORY_SUMMARY", + "MemoryView": "MEMORY_VIEW", + "MessageBasedTrigger": "MESSAGE_BASED_TRIGGER", + "MessageBasedTriggerInput": "MESSAGE_BASED_TRIGGER_INPUT", + "MetadataConfiguration": "METADATA_CONFIGURATION", + "MetadataSchemaEntry": "METADATA_SCHEMA_ENTRY", + "MetadataValueType": "METADATA_VALUE_TYPE", + "MicrosoftOauth2ProviderConfigInput": "MICROSOFT_OAUTH2_PROVIDER_CONFIG_INPUT", + "MicrosoftOauth2ProviderConfigOutput": "MICROSOFT_OAUTH2_PROVIDER_CONFIG_OUTPUT", + "ModelEntry": "MODEL_ENTRY", + "ModelMapping": "MODEL_MAPPING", + "ModifyConsolidationConfiguration": "MODIFY_CONSOLIDATION_CONFIGURATION", + "ModifyConsolidationConfigurationCustomConsolidationConfiguration": "MODIFY_CONSOLIDATION_CONFIGURATION", + "ModifyConsolidationConfigurationUnknown": "MODIFY_CONSOLIDATION_CONFIGURATION", + "ModifyExtractionConfiguration": "MODIFY_EXTRACTION_CONFIGURATION", + "ModifyExtractionConfigurationCustomExtractionConfiguration": "MODIFY_EXTRACTION_CONFIGURATION", + "ModifyExtractionConfigurationUnknown": "MODIFY_EXTRACTION_CONFIGURATION", + "ModifyInvocationConfigurationInput": "MODIFY_INVOCATION_CONFIGURATION_INPUT", + "ModifyMemoryStrategies": "MODIFY_MEMORY_STRATEGIES", + "ModifyMemoryStrategyInput": "MODIFY_MEMORY_STRATEGY_INPUT", + "ModifyReflectionConfiguration": "MODIFY_REFLECTION_CONFIGURATION", + "ModifyReflectionConfigurationEpisodicReflectionConfiguration": "MODIFY_REFLECTION_CONFIGURATION", + "ModifyReflectionConfigurationCustomReflectionConfiguration": "MODIFY_REFLECTION_CONFIGURATION", + "ModifyReflectionConfigurationUnknown": "MODIFY_REFLECTION_CONFIGURATION", + "ModifySelfManagedConfiguration": "MODIFY_SELF_MANAGED_CONFIGURATION", + "ModifyStrategyConfiguration": "MODIFY_STRATEGY_CONFIGURATION", + "Monitoring": "MONITORING", + "NamespaceKeyEntry": "NAMESPACE_KEY_ENTRY", + "NamespaceKeyValidation": "NAMESPACE_KEY_VALIDATION", + "NetworkConfiguration": "NETWORK_CONFIGURATION", + "NetworkMode": "NETWORK_MODE", + "NumberValidation": "NUMBER_VALIDATION", + "NumericalScaleDefinition": "NUMERICAL_SCALE_DEFINITION", + "OAuth2AuthorizationData": "O_AUTH2_AUTHORIZATION_DATA", + "Oauth2AuthorizationServerMetadata": "OAUTH2_AUTHORIZATION_SERVER_METADATA", + "Oauth2CredentialProviderItem": "OAUTH2_CREDENTIAL_PROVIDER_ITEM", + "Oauth2Discovery": "OAUTH2_DISCOVERY", + "Oauth2DiscoveryDiscoveryUrl": "OAUTH2_DISCOVERY", + "Oauth2DiscoveryAuthorizationServerMetadata": "OAUTH2_DISCOVERY", + "Oauth2DiscoveryUnknown": "OAUTH2_DISCOVERY", + "Oauth2ProviderConfigInput": "OAUTH2_PROVIDER_CONFIG_INPUT", + "Oauth2ProviderConfigInputCustomOauth2ProviderConfig": "OAUTH2_PROVIDER_CONFIG_INPUT", + "Oauth2ProviderConfigInputGoogleOauth2ProviderConfig": "OAUTH2_PROVIDER_CONFIG_INPUT", + "Oauth2ProviderConfigInputGithubOauth2ProviderConfig": "OAUTH2_PROVIDER_CONFIG_INPUT", + "Oauth2ProviderConfigInputSlackOauth2ProviderConfig": "OAUTH2_PROVIDER_CONFIG_INPUT", + "Oauth2ProviderConfigInputSalesforceOauth2ProviderConfig": "OAUTH2_PROVIDER_CONFIG_INPUT", + "Oauth2ProviderConfigInputMicrosoftOauth2ProviderConfig": "OAUTH2_PROVIDER_CONFIG_INPUT", + "Oauth2ProviderConfigInputAtlassianOauth2ProviderConfig": "OAUTH2_PROVIDER_CONFIG_INPUT", + "Oauth2ProviderConfigInputLinkedinOauth2ProviderConfig": "OAUTH2_PROVIDER_CONFIG_INPUT", + "Oauth2ProviderConfigInputIncludedOauth2ProviderConfig": "OAUTH2_PROVIDER_CONFIG_INPUT", + "Oauth2ProviderConfigInputUnknown": "OAUTH2_PROVIDER_CONFIG_INPUT", + "Oauth2ProviderConfigOutput": "OAUTH2_PROVIDER_CONFIG_OUTPUT", + "Oauth2ProviderConfigOutputCustomOauth2ProviderConfig": "OAUTH2_PROVIDER_CONFIG_OUTPUT", + "Oauth2ProviderConfigOutputGoogleOauth2ProviderConfig": "OAUTH2_PROVIDER_CONFIG_OUTPUT", + "Oauth2ProviderConfigOutputGithubOauth2ProviderConfig": "OAUTH2_PROVIDER_CONFIG_OUTPUT", + "Oauth2ProviderConfigOutputSlackOauth2ProviderConfig": "OAUTH2_PROVIDER_CONFIG_OUTPUT", + "Oauth2ProviderConfigOutputSalesforceOauth2ProviderConfig": "OAUTH2_PROVIDER_CONFIG_OUTPUT", + "Oauth2ProviderConfigOutputMicrosoftOauth2ProviderConfig": "OAUTH2_PROVIDER_CONFIG_OUTPUT", + "Oauth2ProviderConfigOutputAtlassianOauth2ProviderConfig": "OAUTH2_PROVIDER_CONFIG_OUTPUT", + "Oauth2ProviderConfigOutputLinkedinOauth2ProviderConfig": "OAUTH2_PROVIDER_CONFIG_OUTPUT", + "Oauth2ProviderConfigOutputIncludedOauth2ProviderConfig": "OAUTH2_PROVIDER_CONFIG_OUTPUT", + "Oauth2ProviderConfigOutputUnknown": "OAUTH2_PROVIDER_CONFIG_OUTPUT", + "OAuthCredentialProvider": "O_AUTH_CREDENTIAL_PROVIDER", + "OAuthGrantType": "O_AUTH_GRANT_TYPE", + "OnBehalfOfTokenExchangeConfigType": "ON_BEHALF_OF_TOKEN_EXCHANGE_CONFIG_TYPE", + "OnBehalfOfTokenExchangeGrantTypeType": "ON_BEHALF_OF_TOKEN_EXCHANGE_GRANT_TYPE_TYPE", + "OnlineEvaluationConfigStatus": "ONLINE_EVALUATION_CONFIG_STATUS", + "OnlineEvaluationConfigSummary": "ONLINE_EVALUATION_CONFIG_SUMMARY", + "OnlineEvaluationExecutionStatus": "ONLINE_EVALUATION_EXECUTION_STATUS", + "OpenResponsesEvaluatorModelConfig": "OPEN_RESPONSES_EVALUATOR_MODEL_CONFIG", + "OperatingSystem": "OPERATING_SYSTEM", + "OutputConfig": "OUTPUT_CONFIG", + "OverrideType": "OVERRIDE_TYPE", + "PassthroughProtocolType": "PASSTHROUGH_PROTOCOL_TYPE", + "PassthroughTargetConfiguration": "PASSTHROUGH_TARGET_CONFIGURATION", + "PaymentConnectorProvisionMode": "PAYMENT_CONNECTOR_PROVISION_MODE", + "PaymentConnectorStatus": "PAYMENT_CONNECTOR_STATUS", + "PaymentConnectorSummary": "PAYMENT_CONNECTOR_SUMMARY", + "PaymentConnectorType": "PAYMENT_CONNECTOR_TYPE", + "PaymentCredentialProviderConfiguration": "PAYMENT_CREDENTIAL_PROVIDER_CONFIGURATION", + "PaymentCredentialProviderItem": "PAYMENT_CREDENTIAL_PROVIDER_ITEM", + "PaymentCredentialProviderVendorType": "PAYMENT_CREDENTIAL_PROVIDER_VENDOR_TYPE", + "PaymentManagerStatus": "PAYMENT_MANAGER_STATUS", + "PaymentManagerSummary": "PAYMENT_MANAGER_SUMMARY", + "PaymentProviderConfigurationInput": "PAYMENT_PROVIDER_CONFIGURATION_INPUT", + "PaymentProviderConfigurationInputCoinbaseCdpConfiguration": "PAYMENT_PROVIDER_CONFIGURATION_INPUT", + "PaymentProviderConfigurationInputStripePrivyConfiguration": "PAYMENT_PROVIDER_CONFIGURATION_INPUT", + "PaymentProviderConfigurationInputUnknown": "PAYMENT_PROVIDER_CONFIGURATION_INPUT", + "PaymentProviderConfigurationOutput": "PAYMENT_PROVIDER_CONFIGURATION_OUTPUT", + "PaymentProviderConfigurationOutputCoinbaseCdpConfiguration": "PAYMENT_PROVIDER_CONFIGURATION_OUTPUT", + "PaymentProviderConfigurationOutputStripePrivyConfiguration": "PAYMENT_PROVIDER_CONFIGURATION_OUTPUT", + "PaymentProviderConfigurationOutputUnknown": "PAYMENT_PROVIDER_CONFIGURATION_OUTPUT", + "PaymentsAuthorizerType": "PAYMENTS_AUTHORIZER_TYPE", + "Period": "PERIOD", + "PermissionsConfiguration": "PERMISSIONS_CONFIGURATION", + "Policy": "POLICY", + "PolicyDefinition": "POLICY_DEFINITION", + "PolicyDefinitionCedar": "POLICY_DEFINITION", + "PolicyDefinitionPolicyGeneration": "POLICY_DEFINITION", + "PolicyDefinitionPolicy": "POLICY_DEFINITION", + "PolicyDefinitionUnknown": "POLICY_DEFINITION", + "PolicyEngine": "POLICY_ENGINE", + "PolicyEngineStatus": "POLICY_ENGINE_STATUS", + "PolicyEngineSummary": "POLICY_ENGINE_SUMMARY", + "PolicyGeneration": "POLICY_GENERATION", + "PolicyGenerationAsset": "POLICY_GENERATION_ASSET", + "PolicyGenerationDetails": "POLICY_GENERATION_DETAILS", + "PolicyGenerationStatus": "POLICY_GENERATION_STATUS", + "PolicyGenerationSummary": "POLICY_GENERATION_SUMMARY", + "PolicyStatement": "POLICY_STATEMENT", + "PolicyStatus": "POLICY_STATUS", + "PolicySummary": "POLICY_SUMMARY", + "PolicyValidationMode": "POLICY_VALIDATION_MODE", + "PrincipalMatchOperator": "PRINCIPAL_MATCH_OPERATOR", + "PrivateEndpoint": "PRIVATE_ENDPOINT", + "PrivateEndpointSelfManagedLatticeResource": "PRIVATE_ENDPOINT", + "PrivateEndpointManagedVpcResource": "PRIVATE_ENDPOINT", + "PrivateEndpointUnknown": "PRIVATE_ENDPOINT", + "PrivateEndpointOverride": "PRIVATE_ENDPOINT_OVERRIDE", + "PrivateKeyJwtConfig": "PRIVATE_KEY_JWT_CONFIG", + "PrivateKeySource": "PRIVATE_KEY_SOURCE", + "PrivateKeySourceKmsKeySource": "PRIVATE_KEY_SOURCE", + "PrivateKeySourceUnknown": "PRIVATE_KEY_SOURCE", + "ProtocolConfiguration": "PROTOCOL_CONFIGURATION", + "Provider": "PROVIDER", + "ProviderPrefix": "PROVIDER_PREFIX", + "PutResourcePolicyInput": "PUT_RESOURCE_POLICY_INPUT", + "PutResourcePolicyOutput": "PUT_RESOURCE_POLICY_OUTPUT", + "RateConfig": "RATE_CONFIG", + "RatingScale": "RATING_SCALE", + "RatingScaleNumerical": "RATING_SCALE", + "RatingScaleCategorical": "RATING_SCALE", + "RatingScaleUnknown": "RATING_SCALE", + "ReasoningConfiguration": "REASONING_CONFIGURATION", + "RecordingConfig": "RECORDING_CONFIG", + "ReflectionConfiguration": "REFLECTION_CONFIGURATION", + "ReflectionConfigurationCustomReflectionConfiguration": "REFLECTION_CONFIGURATION", + "ReflectionConfigurationEpisodicReflectionConfiguration": "REFLECTION_CONFIGURATION", + "ReflectionConfigurationUnknown": "REFLECTION_CONFIGURATION", + "RegistryAuthorizerType": "REGISTRY_AUTHORIZER_TYPE", + "RegistryRecordCredentialProviderConfiguration": "REGISTRY_RECORD_CREDENTIAL_PROVIDER_CONFIGURATION", + "RegistryRecordCredentialProviderType": "REGISTRY_RECORD_CREDENTIAL_PROVIDER_TYPE", + "RegistryRecordCredentialProviderUnion": "REGISTRY_RECORD_CREDENTIAL_PROVIDER_UNION", + "RegistryRecordCredentialProviderUnionOauthCredentialProvider": "REGISTRY_RECORD_CREDENTIAL_PROVIDER_UNION", + "RegistryRecordCredentialProviderUnionIamCredentialProvider": "REGISTRY_RECORD_CREDENTIAL_PROVIDER_UNION", + "RegistryRecordCredentialProviderUnionUnknown": "REGISTRY_RECORD_CREDENTIAL_PROVIDER_UNION", + "RegistryRecordIamCredentialProvider": "REGISTRY_RECORD_IAM_CREDENTIAL_PROVIDER", + "RegistryRecordOAuthCredentialProvider": "REGISTRY_RECORD_O_AUTH_CREDENTIAL_PROVIDER", + "RegistryRecordOAuthGrantType": "REGISTRY_RECORD_O_AUTH_GRANT_TYPE", + "RegistryRecordStatus": "REGISTRY_RECORD_STATUS", + "RegistryRecordSummary": "REGISTRY_RECORD_SUMMARY", + "RegistryStatus": "REGISTRY_STATUS", + "RegistrySummary": "REGISTRY_SUMMARY", + "RequestHeaderConfiguration": "REQUEST_HEADER_CONFIGURATION", + "RequestHeaderConfigurationRequestHeaderAllowlist": "REQUEST_HEADER_CONFIGURATION", + "RequestHeaderConfigurationUnknown": "REQUEST_HEADER_CONFIGURATION", + "Resource": "RESOURCE", + "ResourceArn": "RESOURCE", + "ResourceUnknown": "RESOURCE", + "ResourceLimitExceededException": "RESOURCE_LIMIT_EXCEEDED_EXCEPTION", + "ResourceLocation": "RESOURCE_LOCATION", + "ResourceLocationS3": "RESOURCE_LOCATION", + "ResourceLocationUnknown": "RESOURCE_LOCATION", + "ResourceNotFoundException": "RESOURCE_NOT_FOUND_EXCEPTION", + "ResourceType": "RESOURCE_TYPE", + "RestApiMethod": "REST_API_METHOD", + "ResultDestination": "RESULT_DESTINATION", + "RetryableConflictException": "RETRYABLE_CONFLICT_EXCEPTION", + "RootVolumeConfiguration": "ROOT_VOLUME_CONFIGURATION", + "RotatePaymentConnectorCredentialsInput": "ROTATE_PAYMENT_CONNECTOR_CREDENTIALS_INPUT", + "RotatePaymentConnectorCredentialsOutput": "ROTATE_PAYMENT_CONNECTOR_CREDENTIALS_OUTPUT", + "RouteToTargetAction": "ROUTE_TO_TARGET_ACTION", + "RouteToTargetActionStaticRoute": "ROUTE_TO_TARGET_ACTION", + "RouteToTargetActionWeightedRoute": "ROUTE_TO_TARGET_ACTION", + "RouteToTargetActionUnknown": "ROUTE_TO_TARGET_ACTION", + "Rule": "RULE", + "RuntimeMetadataConfiguration": "RUNTIME_METADATA_CONFIGURATION", + "RuntimeTargetConfiguration": "RUNTIME_TARGET_CONFIGURATION", + "S3CertificateConfiguration": "S3_CERTIFICATE_CONFIGURATION", + "S3Configuration": "S3_CONFIGURATION", + "S3FilesAccessPointConfiguration": "S3_FILES_ACCESS_POINT_CONFIGURATION", + "S3FilesConfiguration": "S3_FILES_CONFIGURATION", + "S3Location": "S3_LOCATION", + "S3Source": "S3_SOURCE", + "SalesforceOauth2ProviderConfigInput": "SALESFORCE_OAUTH2_PROVIDER_CONFIG_INPUT", + "SalesforceOauth2ProviderConfigOutput": "SALESFORCE_OAUTH2_PROVIDER_CONFIG_OUTPUT", + "SamplingConfig": "SAMPLING_CONFIG", + "SchemaDefinition": "SCHEMA_DEFINITION", + "SchemaType": "SCHEMA_TYPE", + "SearchType": "SEARCH_TYPE", + "Secret": "SECRET", + "SecretReference": "SECRET_REFERENCE", + "SecretsManagerCertificateConfiguration": "SECRETS_MANAGER_CERTIFICATE_CONFIGURATION", + "SecretsManagerLocation": "SECRETS_MANAGER_LOCATION", + "SecretSourceType": "SECRET_SOURCE_TYPE", + "SelfManagedConfiguration": "SELF_MANAGED_CONFIGURATION", + "SelfManagedConfigurationInput": "SELF_MANAGED_CONFIGURATION_INPUT", + "SelfManagedLatticeResource": "SELF_MANAGED_LATTICE_RESOURCE", + "SelfManagedLatticeResourceResourceConfigurationIdentifier": "SELF_MANAGED_LATTICE_RESOURCE", + "SelfManagedLatticeResourceUnknown": "SELF_MANAGED_LATTICE_RESOURCE", + "SemanticConsolidationOverride": "SEMANTIC_CONSOLIDATION_OVERRIDE", + "SemanticExtractionOverride": "SEMANTIC_EXTRACTION_OVERRIDE", + "SemanticMemoryStrategyInput": "SEMANTIC_MEMORY_STRATEGY_INPUT", + "SemanticOverrideConfigurationInput": "SEMANTIC_OVERRIDE_CONFIGURATION_INPUT", + "SemanticOverrideConsolidationConfigurationInput": "SEMANTIC_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT", + "SemanticOverrideExtractionConfigurationInput": "SEMANTIC_OVERRIDE_EXTRACTION_CONFIGURATION_INPUT", + "ServerDefinition": "SERVER_DEFINITION", + "ServerProtocol": "SERVER_PROTOCOL", + "ServiceException": "SERVICE_EXCEPTION", + "ServiceQuotaExceededException": "SERVICE_QUOTA_EXCEEDED_EXCEPTION", + "SessionConfig": "SESSION_CONFIG", + "SessionConfiguration": "SESSION_CONFIGURATION", + "SessionStorageConfiguration": "SESSION_STORAGE_CONFIGURATION", + "SetTokenVaultCMKInput": "SET_TOKEN_VAULT_CMK_INPUT", + "SetTokenVaultCMKOutput": "SET_TOKEN_VAULT_CMK_OUTPUT", + "SigningAlgorithm": "SIGNING_ALGORITHM", + "SkillDefinition": "SKILL_DEFINITION", + "SkillMdDefinition": "SKILL_MD_DEFINITION", + "SlackOauth2ProviderConfigInput": "SLACK_OAUTH2_PROVIDER_CONFIG_INPUT", + "SlackOauth2ProviderConfigOutput": "SLACK_OAUTH2_PROVIDER_CONFIG_OUTPUT", + "StartPolicyGenerationInput": "START_POLICY_GENERATION_INPUT", + "StartPolicyGenerationOutput": "START_POLICY_GENERATION_OUTPUT", + "StaticOverride": "STATIC_OVERRIDE", + "StaticQueryParameterConflictResolution": "STATIC_QUERY_PARAMETER_CONFLICT_RESOLUTION", + "StaticRoute": "STATIC_ROUTE", + "Status": "STATUS", + "StickinessConfiguration": "STICKINESS_CONFIGURATION", + "StrategyConfiguration": "STRATEGY_CONFIGURATION", + "StreamDeliveryResource": "STREAM_DELIVERY_RESOURCE", + "StreamDeliveryResourceKinesis": "STREAM_DELIVERY_RESOURCE", + "StreamDeliveryResourceUnknown": "STREAM_DELIVERY_RESOURCE", + "StreamDeliveryResources": "STREAM_DELIVERY_RESOURCES", + "StreamingConfiguration": "STREAMING_CONFIGURATION", + "StringListValidation": "STRING_LIST_VALIDATION", + "StringValidation": "STRING_VALIDATION", + "StripePrivyConfigurationInput": "STRIPE_PRIVY_CONFIGURATION_INPUT", + "StripePrivyConfigurationOutput": "STRIPE_PRIVY_CONFIGURATION_OUTPUT", + "SubmitRegistryRecordForApprovalInput": "SUBMIT_REGISTRY_RECORD_FOR_APPROVAL_INPUT", + "SubmitRegistryRecordForApprovalOutput": "SUBMIT_REGISTRY_RECORD_FOR_APPROVAL_OUTPUT", + "SubscriptionRequiredException": "SUBSCRIPTION_REQUIRED_EXCEPTION", + "SummaryConsolidationOverride": "SUMMARY_CONSOLIDATION_OVERRIDE", + "SummaryMemoryStrategyInput": "SUMMARY_MEMORY_STRATEGY_INPUT", + "SummaryOverrideConfigurationInput": "SUMMARY_OVERRIDE_CONFIGURATION_INPUT", + "SummaryOverrideConsolidationConfigurationInput": "SUMMARY_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT", + "SynchronizationConfiguration": "SYNCHRONIZATION_CONFIGURATION", + "SynchronizationType": "SYNCHRONIZATION_TYPE", + "SynchronizeGatewayTargetsInput": "SYNCHRONIZE_GATEWAY_TARGETS_INPUT", + "SynchronizeGatewayTargetsOutput": "SYNCHRONIZE_GATEWAY_TARGETS_OUTPUT", + "SystemManagedBlock": "SYSTEM_MANAGED_BLOCK", + "TagResourceInput": "TAG_RESOURCE_INPUT", + "TagResourceOutput": "TAG_RESOURCE_OUTPUT", + "TargetConfiguration": "TARGET_CONFIGURATION", + "TargetConfigurationMcp": "TARGET_CONFIGURATION", + "TargetConfigurationHttp": "TARGET_CONFIGURATION", + "TargetConfigurationInference": "TARGET_CONFIGURATION", + "TargetConfigurationUnknown": "TARGET_CONFIGURATION", + "TargetProtocolType": "TARGET_PROTOCOL_TYPE", + "TargetStatus": "TARGET_STATUS", + "TargetSummary": "TARGET_SUMMARY", + "TargetTrafficSplitEntry": "TARGET_TRAFFIC_SPLIT_ENTRY", + "TargetType": "TARGET_TYPE", + "ThrottledException": "THROTTLED_EXCEPTION", + "ThrottlingException": "THROTTLING_EXCEPTION", + "TimeBasedTrigger": "TIME_BASED_TRIGGER", + "TimeBasedTriggerInput": "TIME_BASED_TRIGGER_INPUT", + "TokenBasedTrigger": "TOKEN_BASED_TRIGGER", + "TokenBasedTriggerInput": "TOKEN_BASED_TRIGGER_INPUT", + "TokenExchangeGrantTypeConfigType": "TOKEN_EXCHANGE_GRANT_TYPE_CONFIG_TYPE", + "ToolDefinition": "TOOL_DEFINITION", + "ToolSchema": "TOOL_SCHEMA", + "ToolSchemaS3": "TOOL_SCHEMA", + "ToolSchemaInlinePayload": "TOOL_SCHEMA", + "ToolSchemaUnknown": "TOOL_SCHEMA", + "ToolsDefinition": "TOOLS_DEFINITION", + "ToolsFileSystemConfiguration": "TOOLS_FILE_SYSTEM_CONFIGURATION", + "ToolsFileSystemConfigurationS3FilesConfiguration": "TOOLS_FILE_SYSTEM_CONFIGURATION", + "ToolsFileSystemConfigurationEfsConfiguration": "TOOLS_FILE_SYSTEM_CONFIGURATION", + "ToolsFileSystemConfigurationUnknown": "TOOLS_FILE_SYSTEM_CONFIGURATION", + "TrafficSplitEntry": "TRAFFIC_SPLIT_ENTRY", + "TriggerCondition": "TRIGGER_CONDITION", + "TriggerConditionMessageBasedTrigger": "TRIGGER_CONDITION", + "TriggerConditionTokenBasedTrigger": "TRIGGER_CONDITION", + "TriggerConditionTimeBasedTrigger": "TRIGGER_CONDITION", + "TriggerConditionUnknown": "TRIGGER_CONDITION", + "TriggerConditionInput": "TRIGGER_CONDITION_INPUT", + "TriggerConditionInputMessageBasedTrigger": "TRIGGER_CONDITION_INPUT", + "TriggerConditionInputTokenBasedTrigger": "TRIGGER_CONDITION_INPUT", + "TriggerConditionInputTimeBasedTrigger": "TRIGGER_CONDITION_INPUT", + "TriggerConditionInputUnknown": "TRIGGER_CONDITION_INPUT", + "UnauthorizedException": "UNAUTHORIZED_EXCEPTION", + "UntagResourceInput": "UNTAG_RESOURCE_INPUT", + "UntagResourceOutput": "UNTAG_RESOURCE_OUTPUT", + "UpdateAgentRuntimeEndpointInput": "UPDATE_AGENT_RUNTIME_ENDPOINT_INPUT", + "UpdateAgentRuntimeEndpointOutput": "UPDATE_AGENT_RUNTIME_ENDPOINT_OUTPUT", + "UpdateAgentRuntimeInput": "UPDATE_AGENT_RUNTIME_INPUT", + "UpdateAgentRuntimeOutput": "UPDATE_AGENT_RUNTIME_OUTPUT", + "UpdateApiKeyCredentialProviderInput": "UPDATE_API_KEY_CREDENTIAL_PROVIDER_INPUT", + "UpdateApiKeyCredentialProviderOutput": "UPDATE_API_KEY_CREDENTIAL_PROVIDER_OUTPUT", + "UpdateCapacityProviderInput": "UPDATE_CAPACITY_PROVIDER_INPUT", + "UpdateCapacityProviderOutput": "UPDATE_CAPACITY_PROVIDER_OUTPUT", + "UpdateConfigurationBundleInput": "UPDATE_CONFIGURATION_BUNDLE_INPUT", + "UpdateConfigurationBundleOutput": "UPDATE_CONFIGURATION_BUNDLE_OUTPUT", + "UpdateConsentPortalInput": "UPDATE_CONSENT_PORTAL_INPUT", + "UpdateConsentPortalOutput": "UPDATE_CONSENT_PORTAL_OUTPUT", + "UpdatedA2aDescriptor": "UPDATED_A2A_DESCRIPTOR", + "UpdatedAgentSkillsDescriptor": "UPDATED_AGENT_SKILLS_DESCRIPTOR", + "UpdatedAgentSkillsDescriptorFields": "UPDATED_AGENT_SKILLS_DESCRIPTOR_FIELDS", + "UpdatedApprovalConfiguration": "UPDATED_APPROVAL_CONFIGURATION", + "UpdateDatasetExamplesInput": "UPDATE_DATASET_EXAMPLES_INPUT", + "UpdateDatasetExamplesOutput": "UPDATE_DATASET_EXAMPLES_OUTPUT", + "UpdateDatasetInput": "UPDATE_DATASET_INPUT", + "UpdateDatasetOutput": "UPDATE_DATASET_OUTPUT", + "UpdatedAuthorizerConfiguration": "UPDATED_AUTHORIZER_CONFIGURATION", + "UpdatedCustomDescriptor": "UPDATED_CUSTOM_DESCRIPTOR", + "UpdatedDescription": "UPDATED_DESCRIPTION", + "UpdatedDescriptors": "UPDATED_DESCRIPTORS", + "UpdatedDescriptorsUnion": "UPDATED_DESCRIPTORS_UNION", + "UpdatedHarnessEnvironmentArtifact": "UPDATED_HARNESS_ENVIRONMENT_ARTIFACT", + "UpdatedHarnessMemoryConfiguration": "UPDATED_HARNESS_MEMORY_CONFIGURATION", + "UpdatedMcpDescriptor": "UPDATED_MCP_DESCRIPTOR", + "UpdatedMcpDescriptorFields": "UPDATED_MCP_DESCRIPTOR_FIELDS", + "UpdatedServerDefinition": "UPDATED_SERVER_DEFINITION", + "UpdatedSkillDefinition": "UPDATED_SKILL_DEFINITION", + "UpdatedSkillMdDefinition": "UPDATED_SKILL_MD_DEFINITION", + "UpdatedSynchronizationConfiguration": "UPDATED_SYNCHRONIZATION_CONFIGURATION", + "UpdatedSynchronizationType": "UPDATED_SYNCHRONIZATION_TYPE", + "UpdatedToolsDefinition": "UPDATED_TOOLS_DEFINITION", + "UpdateEvaluatorInput": "UPDATE_EVALUATOR_INPUT", + "UpdateEvaluatorOutput": "UPDATE_EVALUATOR_OUTPUT", + "UpdateGatewayInput": "UPDATE_GATEWAY_INPUT", + "UpdateGatewayOutput": "UPDATE_GATEWAY_OUTPUT", + "UpdateGatewayRateLimitInput": "UPDATE_GATEWAY_RATE_LIMIT_INPUT", + "UpdateGatewayRateLimitOutput": "UPDATE_GATEWAY_RATE_LIMIT_OUTPUT", + "UpdateGatewayRuleInput": "UPDATE_GATEWAY_RULE_INPUT", + "UpdateGatewayRuleOutput": "UPDATE_GATEWAY_RULE_OUTPUT", + "UpdateGatewayTargetInput": "UPDATE_GATEWAY_TARGET_INPUT", + "UpdateGatewayTargetOutput": "UPDATE_GATEWAY_TARGET_OUTPUT", + "UpdateHarnessEndpointInput": "UPDATE_HARNESS_ENDPOINT_INPUT", + "UpdateHarnessEndpointOutput": "UPDATE_HARNESS_ENDPOINT_OUTPUT", + "UpdateHarnessInput": "UPDATE_HARNESS_INPUT", + "UpdateHarnessOutput": "UPDATE_HARNESS_OUTPUT", + "UpdateMemoryInput": "UPDATE_MEMORY_INPUT", + "UpdateMemoryOutput": "UPDATE_MEMORY_OUTPUT", + "UpdateOauth2CredentialProviderInput": "UPDATE_OAUTH2_CREDENTIAL_PROVIDER_INPUT", + "UpdateOauth2CredentialProviderOutput": "UPDATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT", + "UpdateOnlineEvaluationConfigInput": "UPDATE_ONLINE_EVALUATION_CONFIG_INPUT", + "UpdateOnlineEvaluationConfigOutput": "UPDATE_ONLINE_EVALUATION_CONFIG_OUTPUT", + "UpdatePaymentConnectorInput": "UPDATE_PAYMENT_CONNECTOR_INPUT", + "UpdatePaymentConnectorOutput": "UPDATE_PAYMENT_CONNECTOR_OUTPUT", + "UpdatePaymentCredentialProviderInput": "UPDATE_PAYMENT_CREDENTIAL_PROVIDER_INPUT", + "UpdatePaymentCredentialProviderOutput": "UPDATE_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT", + "UpdatePaymentManagerInput": "UPDATE_PAYMENT_MANAGER_INPUT", + "UpdatePaymentManagerOutput": "UPDATE_PAYMENT_MANAGER_OUTPUT", + "UpdatePolicyEngineInput": "UPDATE_POLICY_ENGINE_INPUT", + "UpdatePolicyEngineOutput": "UPDATE_POLICY_ENGINE_OUTPUT", + "UpdatePolicyInput": "UPDATE_POLICY_INPUT", + "UpdatePolicyOutput": "UPDATE_POLICY_OUTPUT", + "UpdateRegistryInput": "UPDATE_REGISTRY_INPUT", + "UpdateRegistryOutput": "UPDATE_REGISTRY_OUTPUT", + "UpdateRegistryRecordInput": "UPDATE_REGISTRY_RECORD_INPUT", + "UpdateRegistryRecordOutput": "UPDATE_REGISTRY_RECORD_OUTPUT", + "UpdateRegistryRecordStatusInput": "UPDATE_REGISTRY_RECORD_STATUS_INPUT", + "UpdateRegistryRecordStatusOutput": "UPDATE_REGISTRY_RECORD_STATUS_OUTPUT", + "UpdateWorkloadIdentityInput": "UPDATE_WORKLOAD_IDENTITY_INPUT", + "UpdateWorkloadIdentityOutput": "UPDATE_WORKLOAD_IDENTITY_OUTPUT", + "UserPreferenceConsolidationOverride": "USER_PREFERENCE_CONSOLIDATION_OVERRIDE", + "UserPreferenceExtractionOverride": "USER_PREFERENCE_EXTRACTION_OVERRIDE", + "UserPreferenceMemoryStrategyInput": "USER_PREFERENCE_MEMORY_STRATEGY_INPUT", + "UserPreferenceOverrideConfigurationInput": "USER_PREFERENCE_OVERRIDE_CONFIGURATION_INPUT", + "UserPreferenceOverrideConsolidationConfigurationInput": "USER_PREFERENCE_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT", + "UserPreferenceOverrideExtractionConfigurationInput": "USER_PREFERENCE_OVERRIDE_EXTRACTION_CONFIGURATION_INPUT", + "Validation": "VALIDATION", + "ValidationStringValidation": "VALIDATION", + "ValidationStringListValidation": "VALIDATION", + "ValidationNumberValidation": "VALIDATION", + "ValidationUnknown": "VALIDATION", + "ValidationException": "VALIDATION_EXCEPTION", + "ValidationExceptionField": "VALIDATION_EXCEPTION_FIELD", + "ValidationExceptionReason": "VALIDATION_EXCEPTION_REASON", + "VersionCreatedBySource": "VERSION_CREATED_BY_SOURCE", + "VersionFilter": "VERSION_FILTER", + "VersionLineageMetadata": "VERSION_LINEAGE_METADATA", + "VolumeConfiguration": "VOLUME_CONFIGURATION", + "VolumeConfigurationEbsConfiguration": "VOLUME_CONFIGURATION", + "VolumeConfigurationUnknown": "VOLUME_CONFIGURATION", + "VpcConfig": "VPC_CONFIG", + "VpcConfiguration": "VPC_CONFIGURATION", + "WafConfiguration": "WAF_CONFIGURATION", + "WafFailureMode": "WAF_FAILURE_MODE", + "WeightedOverride": "WEIGHTED_OVERRIDE", + "WeightedRoute": "WEIGHTED_ROUTE", + "WorkloadIdentityDetails": "WORKLOAD_IDENTITY_DETAILS", + "WorkloadIdentityType": "WORKLOAD_IDENTITY_TYPE", + }, + shape_names=frozenset( + { + "A2aDescriptor", + "AccessDeniedException", + "Action", + "ActorTokenContentType", + "AddDatasetExamplesInput", + "AddDatasetExamplesOutput", + "AgentCardDefinition", + "AgentManagedRuntimeType", + "AgentRuntime", + "AgentRuntimeArtifact", + "AgentRuntimeEndpoint", + "AgentRuntimeEndpointStatus", + "AgentRuntimeStatus", + "AgentRuntimeVersionSummary", + "AgentSkillsDescriptor", + "AllowedWorkloadConfiguration", + "ApiGatewayTargetConfiguration", + "ApiGatewayToolConfiguration", + "ApiGatewayToolFilter", + "ApiGatewayToolOverride", + "ApiKeyCredentialLocation", + "ApiKeyCredentialProviderItem", + "ApiSchemaConfiguration", + "ApprovalConfiguration", + "AtlassianOauth2ProviderConfigInput", + "AtlassianOauth2ProviderConfigOutput", + "AuthorizationData", + "AuthorizerConfiguration", + "AuthorizerType", + "AuthorizingClaimMatchValueType", + "BatchPutGatewayRateLimitsInput", + "BatchPutGatewayRateLimitsOutput", + "BatchPutLimitEntry", + "BedrockEvaluatorModelConfig", + "BrowserEnterprisePolicy", + "BrowserEnterprisePolicyType", + "BrowserNetworkConfiguration", + "BrowserNetworkMode", + "BrowserProfileStatus", + "BrowserProfileSummary", + "BrowserSigningConfigInput", + "BrowserSigningConfigOutput", + "BrowserStatus", + "BrowserSummary", + "CapacityProviderConfiguration", + "CapacityProviderStatus", + "CapacityProviderStatusCode", + "CapacityProviderSummary", + "CapacityProviderVolumeConfiguration", + "CapacityReservationPreference", + "CapacityReservationSpecification", + "CapacityReservationTarget", + "CategoricalScaleDefinition", + "CedarPolicy", + "Certificate", + "CertificateConfiguration", + "CertificateLocation", + "ClaimMatchOperatorType", + "ClaimMatchValueType", + "ClientAuthenticationMethodType", + "CloudWatchLogsInputConfig", + "CloudWatchOutputConfig", + "ClusteringConfig", + "ClusteringFrequency", + "Code", + "CodeBasedEvaluatorConfig", + "CodeConfiguration", + "CodeInterpreterNetworkConfiguration", + "CodeInterpreterNetworkMode", + "CodeInterpreterStatus", + "CodeInterpreterSummary", + "CoinbaseCdpConfigurationInput", + "CoinbaseCdpConfigurationOutput", + "CoinbaseCdpRotationTargets", + "CoinbaseCdpSecret", + "ComponentConfiguration", + "ComputeConfiguration", + "ConcurrentModificationException", + "Condition", + "ConfigurationBundleAction", + "ConfigurationBundleReference", + "ConfigurationBundleStatus", + "ConfigurationBundleSummary", + "ConfigurationBundleVersionSummary", + "ConflictException", + "ConnectorConfiguration", + "ConnectorParameterOverride", + "ConnectorSource", + "ConnectorTargetConfiguration", + "ConsentPortalIdpConfig", + "ConsentPortalSource", + "ConsentPortalSourceType", + "ConsentPortalStatus", + "ConsentPortalSummary", + "ConsolidationConfiguration", + "ContainerConfiguration", + "Content", + "ContentConfiguration", + "ContentLevel", + "ContentType", + "CreateAgentRuntimeEndpointInput", + "CreateAgentRuntimeEndpointOutput", + "CreateAgentRuntimeInput", + "CreateAgentRuntimeOutput", + "CreateApiKeyCredentialProviderInput", + "CreateApiKeyCredentialProviderOutput", + "CreateBrowserInput", + "CreateBrowserOutput", + "CreateBrowserProfileInput", + "CreateBrowserProfileOutput", + "CreateCapacityProviderInput", + "CreateCapacityProviderOutput", + "CreateCodeInterpreterInput", + "CreateCodeInterpreterOutput", + "CreateConfigurationBundleInput", + "CreateConfigurationBundleOutput", + "CreateConsentPortalInput", + "CreateConsentPortalOutput", + "CreateDatasetInput", + "CreateDatasetOutput", + "CreateDatasetVersionInput", + "CreateDatasetVersionOutput", + "CreateEvaluatorInput", + "CreateEvaluatorOutput", + "CreateGatewayInput", + "CreateGatewayOutput", + "CreateGatewayRateLimitInput", + "CreateGatewayRateLimitOutput", + "CreateGatewayRuleInput", + "CreateGatewayRuleOutput", + "CreateGatewayTargetInput", + "CreateGatewayTargetOutput", + "CreateHarnessEndpointInput", + "CreateHarnessEndpointOutput", + "CreateHarnessInput", + "CreateHarnessOutput", + "CreateMemoryInput", + "CreateMemoryOutput", + "CreateOauth2CredentialProviderInput", + "CreateOauth2CredentialProviderOutput", + "CreateOnlineEvaluationConfigInput", + "CreateOnlineEvaluationConfigOutput", + "CreatePaymentConnectorInput", + "CreatePaymentConnectorOutput", + "CreatePaymentCredentialProviderInput", + "CreatePaymentCredentialProviderOutput", + "CreatePaymentManagerInput", + "CreatePaymentManagerOutput", + "CreatePolicyEngineInput", + "CreatePolicyEngineOutput", + "CreatePolicyInput", + "CreatePolicyOutput", + "CreateRegistryInput", + "CreateRegistryOutput", + "CreateRegistryRecordInput", + "CreateRegistryRecordOutput", + "CreateWorkloadIdentityInput", + "CreateWorkloadIdentityOutput", + "CredentialProvider", + "CredentialProviderConfiguration", + "CredentialProviderType", + "CredentialProviderVendorType", + "CredentialRotationConfig", + "CredentialsProviderConfiguration", + "CustomClaimValidationType", + "CustomConfigurationInput", + "CustomConsolidationConfiguration", + "CustomConsolidationConfigurationInput", + "CustomDescriptor", + "CustomExtractionConfiguration", + "CustomExtractionConfigurationInput", + "CustomJWTAuthorizerConfiguration", + "CustomMemoryStrategyInput", + "CustomOauth2ProviderConfigInput", + "CustomOauth2ProviderConfigOutput", + "CustomReflectionConfiguration", + "CustomReflectionConfigurationInput", + "CustomTransformConfiguration", + "DataSourceConfig", + "DataSourceType", + "DatasetSchemaType", + "DatasetStatus", + "DatasetSummary", + "DatasetVersionSummary", + "DecryptionFailure", + "DeleteAgentRuntimeEndpointInput", + "DeleteAgentRuntimeEndpointOutput", + "DeleteAgentRuntimeInput", + "DeleteAgentRuntimeOutput", + "DeleteApiKeyCredentialProviderInput", + "DeleteApiKeyCredentialProviderOutput", + "DeleteBrowserInput", + "DeleteBrowserOutput", + "DeleteBrowserProfileInput", + "DeleteBrowserProfileOutput", + "DeleteCapacityProviderInput", + "DeleteCapacityProviderOutput", + "DeleteCodeInterpreterInput", + "DeleteCodeInterpreterOutput", + "DeleteConfigurationBundleInput", + "DeleteConfigurationBundleOutput", + "DeleteConsentPortalInput", + "DeleteConsentPortalOutput", + "DeleteDatasetExamplesInput", + "DeleteDatasetExamplesOutput", + "DeleteDatasetInput", + "DeleteDatasetOutput", + "DeleteEvaluatorInput", + "DeleteEvaluatorOutput", + "DeleteGatewayInput", + "DeleteGatewayOutput", + "DeleteGatewayRateLimitInput", + "DeleteGatewayRateLimitOutput", + "DeleteGatewayRuleInput", + "DeleteGatewayRuleOutput", + "DeleteGatewayTargetInput", + "DeleteGatewayTargetOutput", + "DeleteHarnessEndpointInput", + "DeleteHarnessEndpointOutput", + "DeleteHarnessInput", + "DeleteHarnessOutput", + "DeleteMemoryInput", + "DeleteMemoryOutput", + "DeleteMemoryStrategyInput", + "DeleteOauth2CredentialProviderInput", + "DeleteOauth2CredentialProviderOutput", + "DeleteOnlineEvaluationConfigInput", + "DeleteOnlineEvaluationConfigOutput", + "DeletePaymentConnectorInput", + "DeletePaymentConnectorOutput", + "DeletePaymentCredentialProviderInput", + "DeletePaymentCredentialProviderOutput", + "DeletePaymentManagerInput", + "DeletePaymentManagerOutput", + "DeletePolicyEngineInput", + "DeletePolicyEngineOutput", + "DeletePolicyInput", + "DeletePolicyOutput", + "DeleteRegistryInput", + "DeleteRegistryOutput", + "DeleteRegistryRecordInput", + "DeleteRegistryRecordOutput", + "DeleteResourcePolicyInput", + "DeleteResourcePolicyOutput", + "DeleteWorkloadIdentityInput", + "DeleteWorkloadIdentityOutput", + "DerivedEvaluatorConfig", + "DescriptorType", + "Descriptors", + "DraftStatus", + "EbsVolumeConfiguration", + "EbsVolumeType", + "Ec2Configuration", + "EfsAccessPointConfiguration", + "EfsConfiguration", + "EncryptionFailure", + "EndpointIpAddressType", + "EnforcementMode", + "EphemeralBlockDeviceMapping", + "EphemeralEBSVolumeConfiguration", + "EpisodicConsolidationOverride", + "EpisodicExtractionOverride", + "EpisodicMemoryStrategyInput", + "EpisodicOverrideConfigurationInput", + "EpisodicOverrideConsolidationConfigurationInput", + "EpisodicOverrideExtractionConfigurationInput", + "EpisodicOverrideReflectionConfigurationInput", + "EpisodicReflectionConfiguration", + "EpisodicReflectionConfigurationInput", + "EpisodicReflectionOverride", + "EvaluatorConfig", + "EvaluatorLevel", + "EvaluatorModelConfig", + "EvaluatorReference", + "EvaluatorStatus", + "EvaluatorSummary", + "EvaluatorType", + "ExceptionLevel", + "ExtractionConfig", + "ExtractionConfiguration", + "ExtractionType", + "FilesystemConfiguration", + "Filter", + "FilterOperator", + "FilterValue", + "Finding", + "FindingType", + "FromUrlSynchronizationConfiguration", + "GatewayApiKeyCredentialProvider", + "GatewayInterceptionPoint", + "GatewayInterceptorConfiguration", + "GatewayPolicyEngineConfiguration", + "GatewayPolicyEngineMode", + "GatewayProtocolConfiguration", + "GatewayProtocolType", + "GatewayRateLimitDetail", + "GatewayRateLimitStatus", + "GatewayRuleDetail", + "GatewayRuleStatus", + "GatewayStatus", + "GatewaySummary", + "GatewayTarget", + "GetAgentRuntimeEndpointInput", + "GetAgentRuntimeEndpointOutput", + "GetAgentRuntimeInput", + "GetAgentRuntimeOutput", + "GetApiKeyCredentialProviderInput", + "GetApiKeyCredentialProviderOutput", + "GetBrowserInput", + "GetBrowserOutput", + "GetBrowserProfileInput", + "GetBrowserProfileOutput", + "GetCapacityProviderInput", + "GetCapacityProviderOutput", + "GetCodeInterpreterInput", + "GetCodeInterpreterOutput", + "GetConfigurationBundleInput", + "GetConfigurationBundleOutput", + "GetConfigurationBundleVersionInput", + "GetConfigurationBundleVersionOutput", + "GetConsentPortalInput", + "GetConsentPortalOutput", + "GetDatasetInput", + "GetDatasetOutput", + "GetEvaluatorInput", + "GetEvaluatorOutput", + "GetGatewayInput", + "GetGatewayOutput", + "GetGatewayRateLimitInput", + "GetGatewayRateLimitOutput", + "GetGatewayRuleInput", + "GetGatewayRuleOutput", + "GetGatewayTargetInput", + "GetGatewayTargetOutput", + "GetHarnessEndpointInput", + "GetHarnessEndpointOutput", + "GetHarnessInput", + "GetHarnessOutput", + "GetMemoryInput", + "GetMemoryOutput", + "GetOauth2CredentialProviderInput", + "GetOauth2CredentialProviderOutput", + "GetOnlineEvaluationConfigInput", + "GetOnlineEvaluationConfigOutput", + "GetPaymentConnectorInput", + "GetPaymentConnectorOutput", + "GetPaymentCredentialProviderInput", + "GetPaymentCredentialProviderOutput", + "GetPaymentManagerInput", + "GetPaymentManagerOutput", + "GetPolicyEngineInput", + "GetPolicyEngineOutput", + "GetPolicyEngineSummaryInput", + "GetPolicyEngineSummaryOutput", + "GetPolicyGenerationInput", + "GetPolicyGenerationOutput", + "GetPolicyGenerationSummaryInput", + "GetPolicyGenerationSummaryOutput", + "GetPolicyInput", + "GetPolicyOutput", + "GetPolicySummaryInput", + "GetPolicySummaryOutput", + "GetRegistryInput", + "GetRegistryOutput", + "GetRegistryRecordInput", + "GetRegistryRecordOutput", + "GetResourcePolicyInput", + "GetResourcePolicyOutput", + "GetTokenVaultInput", + "GetTokenVaultOutput", + "GetWorkloadIdentityInput", + "GetWorkloadIdentityOutput", + "GithubOauth2ProviderConfigInput", + "GithubOauth2ProviderConfigOutput", + "GoogleOauth2ProviderConfigInput", + "GoogleOauth2ProviderConfigOutput", + "Harness", + "HarnessAfterInvocationHook", + "HarnessAfterToolCallHook", + "HarnessAgentCoreBrowserConfig", + "HarnessAgentCoreCodeInterpreterConfig", + "HarnessAgentCoreGatewayConfig", + "HarnessAgentCoreMemoryConfiguration", + "HarnessAgentCoreMemoryRetrievalConfig", + "HarnessAgentCoreRuntimeEnvironment", + "HarnessAgentCoreRuntimeEnvironmentRequest", + "HarnessBedrockApiFormat", + "HarnessBedrockModelConfig", + "HarnessBeforeInvocationHook", + "HarnessBeforeToolCallHook", + "HarnessDisabledMemoryConfiguration", + "HarnessEndpoint", + "HarnessEndpointStatus", + "HarnessEnvironmentArtifact", + "HarnessEnvironmentProvider", + "HarnessEnvironmentProviderRequest", + "HarnessGatewayOutboundAuth", + "HarnessGeminiModelConfig", + "HarnessHook", + "HarnessHookEventBridgeTarget", + "HarnessHookFailureMode", + "HarnessHookLambdaTarget", + "HarnessHookSnsTarget", + "HarnessHookTarget", + "HarnessInlineFunctionConfig", + "HarnessLiteLlmModelConfig", + "HarnessManagedMemoryConfiguration", + "HarnessManagedMemoryStrategyType", + "HarnessMemoryConfiguration", + "HarnessModelConfiguration", + "HarnessOpenAiApiFormat", + "HarnessOpenAiModelConfig", + "HarnessRemoteMcpConfig", + "HarnessSkill", + "HarnessSkillAwsSkillsSource", + "HarnessSkillGitAuth", + "HarnessSkillGitSource", + "HarnessSkillS3Source", + "HarnessSlidingWindowConfiguration", + "HarnessStatus", + "HarnessSummarizationConfiguration", + "HarnessSummary", + "HarnessSystemContentBlock", + "HarnessTool", + "HarnessToolConfiguration", + "HarnessToolType", + "HarnessTruncationConfiguration", + "HarnessTruncationStrategy", + "HarnessTruncationStrategyConfiguration", + "HarnessVersionSummary", + "HostingEnvironment", + "HttpApiSchemaConfiguration", + "HttpConnectorSource", + "HttpConnectorTargetConfiguration", + "HttpTargetConfiguration", + "IamCredentialProvider", + "IamPrincipal", + "InboundTokenClaimValueType", + "IncludedData", + "IncludedOauth2ProviderConfigInput", + "IncludedOauth2ProviderConfigOutput", + "IndexedKey", + "InferenceConfiguration", + "InferenceConnectorSource", + "InferenceConnectorTargetConfiguration", + "InferenceOperationConfiguration", + "InferenceProviderTargetConfiguration", + "InferenceTargetConfiguration", + "InlineExamplesSource", + "Insight", + "InstanceLifecycleConfiguration", + "InstanceRequirements", + "InterceptorConfiguration", + "InterceptorInputConfiguration", + "InterceptorPayloadExclusion", + "InterceptorPayloadExclusionSelector", + "InterceptorPayloadFilter", + "InternalServerException", + "InvocationConfiguration", + "InvocationConfigurationInput", + "KeyType", + "KinesisResource", + "KmsConfiguration", + "KmsKeySourceType", + "LambdaEvaluatorConfig", + "LambdaInterceptorConfiguration", + "LambdaTransformConfiguration", + "LaunchParameters", + "LaunchTemplateSource", + "LicenseSpecification", + "LifecycleConfiguration", + "LimitEntry", + "LinkedinOauth2ProviderConfigInput", + "LinkedinOauth2ProviderConfigOutput", + "ListAgentRuntimeEndpointsInput", + "ListAgentRuntimeEndpointsOutput", + "ListAgentRuntimeVersionsByCapacityProviderInput", + "ListAgentRuntimeVersionsByCapacityProviderOutput", + "ListAgentRuntimeVersionsInput", + "ListAgentRuntimeVersionsOutput", + "ListAgentRuntimesInput", + "ListAgentRuntimesOutput", + "ListApiKeyCredentialProvidersInput", + "ListApiKeyCredentialProvidersOutput", + "ListBrowserProfilesInput", + "ListBrowserProfilesOutput", + "ListBrowsersInput", + "ListBrowsersOutput", + "ListCapacityProvidersInput", + "ListCapacityProvidersOutput", + "ListCodeInterpretersInput", + "ListCodeInterpretersOutput", + "ListConfigurationBundleVersionsInput", + "ListConfigurationBundleVersionsOutput", + "ListConfigurationBundlesInput", + "ListConfigurationBundlesOutput", + "ListConsentPortalsInput", + "ListConsentPortalsOutput", + "ListDatasetExamplesInput", + "ListDatasetExamplesOutput", + "ListDatasetVersionsInput", + "ListDatasetVersionsOutput", + "ListDatasetsInput", + "ListDatasetsOutput", + "ListEvaluatorsInput", + "ListEvaluatorsOutput", + "ListGatewayRateLimitsInput", + "ListGatewayRateLimitsOutput", + "ListGatewayRulesInput", + "ListGatewayRulesOutput", + "ListGatewayTargetsInput", + "ListGatewayTargetsOutput", + "ListGatewaysInput", + "ListGatewaysOutput", + "ListHarnessEndpointsInput", + "ListHarnessEndpointsOutput", + "ListHarnessVersionsInput", + "ListHarnessVersionsOutput", + "ListHarnessesInput", + "ListHarnessesOutput", + "ListMemoriesInput", + "ListMemoriesOutput", + "ListOauth2CredentialProvidersInput", + "ListOauth2CredentialProvidersOutput", + "ListOnlineEvaluationConfigsInput", + "ListOnlineEvaluationConfigsOutput", + "ListPaymentConnectorsInput", + "ListPaymentConnectorsOutput", + "ListPaymentCredentialProvidersInput", + "ListPaymentCredentialProvidersOutput", + "ListPaymentManagersInput", + "ListPaymentManagersOutput", + "ListPoliciesInput", + "ListPoliciesOutput", + "ListPolicyEngineSummariesInput", + "ListPolicyEngineSummariesOutput", + "ListPolicyEnginesInput", + "ListPolicyEnginesOutput", + "ListPolicyGenerationAssetsInput", + "ListPolicyGenerationAssetsOutput", + "ListPolicyGenerationSummariesInput", + "ListPolicyGenerationSummariesOutput", + "ListPolicyGenerationsInput", + "ListPolicyGenerationsOutput", + "ListPolicySummariesInput", + "ListPolicySummariesOutput", + "ListRegistriesInput", + "ListRegistriesOutput", + "ListRegistryRecordsInput", + "ListRegistryRecordsOutput", + "ListTagsForResourceInput", + "ListTagsForResourceOutput", + "ListWorkloadIdentitiesInput", + "ListWorkloadIdentitiesOutput", + "ListingMode", + "LlmAsAJudgeEvaluatorConfig", + "LlmExtractionConfig", + "MCPGatewayConfiguration", + "ManagedResourceDetails", + "ManagedVpcResource", + "MatchPaths", + "MatchPrincipalEntry", + "MatchPrincipals", + "McpDescriptor", + "McpLambdaTargetConfiguration", + "McpServerTargetConfiguration", + "McpTargetConfiguration", + "McpToolSchemaConfiguration", + "Memory", + "MemoryRecordSchema", + "MemoryStatus", + "MemoryStrategy", + "MemoryStrategyInput", + "MemoryStrategyStatus", + "MemoryStrategyType", + "MemorySummary", + "MemoryView", + "MessageBasedTrigger", + "MessageBasedTriggerInput", + "MetadataConfiguration", + "MetadataSchemaEntry", + "MetadataValueType", + "MicrosoftOauth2ProviderConfigInput", + "MicrosoftOauth2ProviderConfigOutput", + "ModelEntry", + "ModelMapping", + "ModifyConsolidationConfiguration", + "ModifyExtractionConfiguration", + "ModifyInvocationConfigurationInput", + "ModifyMemoryStrategies", + "ModifyMemoryStrategyInput", + "ModifyReflectionConfiguration", + "ModifySelfManagedConfiguration", + "ModifyStrategyConfiguration", + "Monitoring", + "NamespaceKeyEntry", + "NamespaceKeyValidation", + "NetworkConfiguration", + "NetworkMode", + "NumberValidation", + "NumericalScaleDefinition", + "OAuth2AuthorizationData", + "OAuthCredentialProvider", + "OAuthGrantType", + "Oauth2AuthorizationServerMetadata", + "Oauth2CredentialProviderItem", + "Oauth2Discovery", + "Oauth2ProviderConfigInput", + "Oauth2ProviderConfigOutput", + "OnBehalfOfTokenExchangeConfigType", + "OnBehalfOfTokenExchangeGrantTypeType", + "OnlineEvaluationConfigStatus", + "OnlineEvaluationConfigSummary", + "OnlineEvaluationExecutionStatus", + "OpenResponsesEvaluatorModelConfig", + "OperatingSystem", + "OutputConfig", + "OverrideType", + "PassthroughProtocolType", + "PassthroughTargetConfiguration", + "PaymentConnectorProvisionMode", + "PaymentConnectorStatus", + "PaymentConnectorSummary", + "PaymentConnectorType", + "PaymentCredentialProviderConfiguration", + "PaymentCredentialProviderItem", + "PaymentCredentialProviderVendorType", + "PaymentManagerStatus", + "PaymentManagerSummary", + "PaymentProviderConfigurationInput", + "PaymentProviderConfigurationOutput", + "PaymentsAuthorizerType", + "Period", + "PermissionsConfiguration", + "Policy", + "PolicyDefinition", + "PolicyEngine", + "PolicyEngineStatus", + "PolicyEngineSummary", + "PolicyGeneration", + "PolicyGenerationAsset", + "PolicyGenerationDetails", + "PolicyGenerationStatus", + "PolicyGenerationSummary", + "PolicyStatement", + "PolicyStatus", + "PolicySummary", + "PolicyValidationMode", + "PrincipalMatchOperator", + "PrivateEndpoint", + "PrivateEndpointOverride", + "PrivateKeyJwtConfig", + "PrivateKeySource", + "ProtocolConfiguration", + "Provider", + "ProviderPrefix", + "PutResourcePolicyInput", + "PutResourcePolicyOutput", + "RateConfig", + "RatingScale", + "ReasoningConfiguration", + "RecordingConfig", + "ReflectionConfiguration", + "RegistryAuthorizerType", + "RegistryRecordCredentialProviderConfiguration", + "RegistryRecordCredentialProviderType", + "RegistryRecordCredentialProviderUnion", + "RegistryRecordIamCredentialProvider", + "RegistryRecordOAuthCredentialProvider", + "RegistryRecordOAuthGrantType", + "RegistryRecordStatus", + "RegistryRecordSummary", + "RegistryStatus", + "RegistrySummary", + "RequestHeaderConfiguration", + "Resource", + "ResourceLimitExceededException", + "ResourceLocation", + "ResourceNotFoundException", + "ResourceType", + "RestApiMethod", + "ResultDestination", + "RetryableConflictException", + "RootVolumeConfiguration", + "RotatePaymentConnectorCredentialsInput", + "RotatePaymentConnectorCredentialsOutput", + "RouteToTargetAction", + "Rule", + "RuntimeMetadataConfiguration", + "RuntimeTargetConfiguration", + "S3CertificateConfiguration", + "S3Configuration", + "S3FilesAccessPointConfiguration", + "S3FilesConfiguration", + "S3Location", + "S3Source", + "SalesforceOauth2ProviderConfigInput", + "SalesforceOauth2ProviderConfigOutput", + "SamplingConfig", + "SchemaDefinition", + "SchemaType", + "SearchType", + "Secret", + "SecretReference", + "SecretSourceType", + "SecretsManagerCertificateConfiguration", + "SecretsManagerLocation", + "SelfManagedConfiguration", + "SelfManagedConfigurationInput", + "SelfManagedLatticeResource", + "SemanticConsolidationOverride", + "SemanticExtractionOverride", + "SemanticMemoryStrategyInput", + "SemanticOverrideConfigurationInput", + "SemanticOverrideConsolidationConfigurationInput", + "SemanticOverrideExtractionConfigurationInput", + "ServerDefinition", + "ServerProtocol", + "ServiceException", + "ServiceQuotaExceededException", + "SessionConfig", + "SessionConfiguration", + "SessionStorageConfiguration", + "SetTokenVaultCMKInput", + "SetTokenVaultCMKOutput", + "SigningAlgorithm", + "SkillDefinition", + "SkillMdDefinition", + "SlackOauth2ProviderConfigInput", + "SlackOauth2ProviderConfigOutput", + "StartPolicyGenerationInput", + "StartPolicyGenerationOutput", + "StaticOverride", + "StaticQueryParameterConflictResolution", + "StaticRoute", + "Status", + "StickinessConfiguration", + "StrategyConfiguration", + "StreamDeliveryResource", + "StreamDeliveryResources", + "StreamingConfiguration", + "StringListValidation", + "StringValidation", + "StripePrivyConfigurationInput", + "StripePrivyConfigurationOutput", + "SubmitRegistryRecordForApprovalInput", + "SubmitRegistryRecordForApprovalOutput", + "SubscriptionRequiredException", + "SummaryConsolidationOverride", + "SummaryMemoryStrategyInput", + "SummaryOverrideConfigurationInput", + "SummaryOverrideConsolidationConfigurationInput", + "SynchronizationConfiguration", + "SynchronizationType", + "SynchronizeGatewayTargetsInput", + "SynchronizeGatewayTargetsOutput", + "SystemManagedBlock", + "TagResourceInput", + "TagResourceOutput", + "TargetConfiguration", + "TargetProtocolType", + "TargetStatus", + "TargetSummary", + "TargetTrafficSplitEntry", + "TargetType", + "ThrottledException", + "ThrottlingException", + "TimeBasedTrigger", + "TimeBasedTriggerInput", + "TokenBasedTrigger", + "TokenBasedTriggerInput", + "TokenExchangeGrantTypeConfigType", + "ToolDefinition", + "ToolSchema", + "ToolsDefinition", + "ToolsFileSystemConfiguration", + "TrafficSplitEntry", + "TriggerCondition", + "TriggerConditionInput", + "UnauthorizedException", + "UntagResourceInput", + "UntagResourceOutput", + "UpdateAgentRuntimeEndpointInput", + "UpdateAgentRuntimeEndpointOutput", + "UpdateAgentRuntimeInput", + "UpdateAgentRuntimeOutput", + "UpdateApiKeyCredentialProviderInput", + "UpdateApiKeyCredentialProviderOutput", + "UpdateCapacityProviderInput", + "UpdateCapacityProviderOutput", + "UpdateConfigurationBundleInput", + "UpdateConfigurationBundleOutput", + "UpdateConsentPortalInput", + "UpdateConsentPortalOutput", + "UpdateDatasetExamplesInput", + "UpdateDatasetExamplesOutput", + "UpdateDatasetInput", + "UpdateDatasetOutput", + "UpdateEvaluatorInput", + "UpdateEvaluatorOutput", + "UpdateGatewayInput", + "UpdateGatewayOutput", + "UpdateGatewayRateLimitInput", + "UpdateGatewayRateLimitOutput", + "UpdateGatewayRuleInput", + "UpdateGatewayRuleOutput", + "UpdateGatewayTargetInput", + "UpdateGatewayTargetOutput", + "UpdateHarnessEndpointInput", + "UpdateHarnessEndpointOutput", + "UpdateHarnessInput", + "UpdateHarnessOutput", + "UpdateMemoryInput", + "UpdateMemoryOutput", + "UpdateOauth2CredentialProviderInput", + "UpdateOauth2CredentialProviderOutput", + "UpdateOnlineEvaluationConfigInput", + "UpdateOnlineEvaluationConfigOutput", + "UpdatePaymentConnectorInput", + "UpdatePaymentConnectorOutput", + "UpdatePaymentCredentialProviderInput", + "UpdatePaymentCredentialProviderOutput", + "UpdatePaymentManagerInput", + "UpdatePaymentManagerOutput", + "UpdatePolicyEngineInput", + "UpdatePolicyEngineOutput", + "UpdatePolicyInput", + "UpdatePolicyOutput", + "UpdateRegistryInput", + "UpdateRegistryOutput", + "UpdateRegistryRecordInput", + "UpdateRegistryRecordOutput", + "UpdateRegistryRecordStatusInput", + "UpdateRegistryRecordStatusOutput", + "UpdateWorkloadIdentityInput", + "UpdateWorkloadIdentityOutput", + "UpdatedA2aDescriptor", + "UpdatedAgentSkillsDescriptor", + "UpdatedAgentSkillsDescriptorFields", + "UpdatedApprovalConfiguration", + "UpdatedAuthorizerConfiguration", + "UpdatedCustomDescriptor", + "UpdatedDescription", + "UpdatedDescriptors", + "UpdatedDescriptorsUnion", + "UpdatedHarnessEnvironmentArtifact", + "UpdatedHarnessMemoryConfiguration", + "UpdatedMcpDescriptor", + "UpdatedMcpDescriptorFields", + "UpdatedServerDefinition", + "UpdatedSkillDefinition", + "UpdatedSkillMdDefinition", + "UpdatedSynchronizationConfiguration", + "UpdatedSynchronizationType", + "UpdatedToolsDefinition", + "UserPreferenceConsolidationOverride", + "UserPreferenceExtractionOverride", + "UserPreferenceMemoryStrategyInput", + "UserPreferenceOverrideConfigurationInput", + "UserPreferenceOverrideConsolidationConfigurationInput", + "UserPreferenceOverrideExtractionConfigurationInput", + "Validation", + "ValidationException", + "ValidationExceptionField", + "ValidationExceptionReason", + "VersionCreatedBySource", + "VersionFilter", + "VersionLineageMetadata", + "VolumeConfiguration", + "VpcConfig", + "VpcConfiguration", + "WafConfiguration", + "WafFailureMode", + "WeightedOverride", + "WeightedRoute", + "WorkloadIdentityDetails", + "WorkloadIdentityType", + } + ), + service_error="ServiceError", +) + + +def __getattr__(name: str): + return _registry.build(name) + + +ADD_DATASET_EXAMPLES: APIOperation[ + AddDatasetExamplesInput, AddDatasetExamplesOutput +] = APIOperation( + static_schema=_SCHEMA_ADD_DATASET_EXAMPLES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +CREATE_AGENT_RUNTIME_ENDPOINT: APIOperation[ + CreateAgentRuntimeEndpointInput, CreateAgentRuntimeEndpointOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_AGENT_RUNTIME_ENDPOINT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +DELETE_AGENT_RUNTIME_ENDPOINT: APIOperation[ + DeleteAgentRuntimeEndpointInput, DeleteAgentRuntimeEndpointOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_AGENT_RUNTIME_ENDPOINT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +GET_AGENT_RUNTIME_ENDPOINT: APIOperation[ + GetAgentRuntimeEndpointInput, GetAgentRuntimeEndpointOutput +] = APIOperation( + static_schema=_SCHEMA_GET_AGENT_RUNTIME_ENDPOINT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +LIST_AGENT_RUNTIME_ENDPOINTS: APIOperation[ + ListAgentRuntimeEndpointsInput, ListAgentRuntimeEndpointsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_AGENT_RUNTIME_ENDPOINTS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +UPDATE_AGENT_RUNTIME_ENDPOINT: APIOperation[ + UpdateAgentRuntimeEndpointInput, UpdateAgentRuntimeEndpointOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_AGENT_RUNTIME_ENDPOINT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - deserializer.read_struct(_SCHEMA_UNIT, consumer=_consumer) - return kwargs +CREATE_AGENT_RUNTIME: APIOperation[ + CreateAgentRuntimeInput, CreateAgentRuntimeOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_AGENT_RUNTIME, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +DELETE_AGENT_RUNTIME: APIOperation[ + DeleteAgentRuntimeInput, DeleteAgentRuntimeOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_AGENT_RUNTIME, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -@dataclass(kw_only=True) -class AgentCardDefinition: - """ - The agent card definition for an A2A descriptor. Contains the schema - version and inline content for the agent card. - """ +GET_AGENT_RUNTIME: APIOperation[GetAgentRuntimeInput, GetAgentRuntimeOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_AGENT_RUNTIME, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - schema_version: str | None = None - """ - The schema version of the agent card based on the A2A protocol - specification. - """ +LIST_AGENT_RUNTIMES: APIOperation[ListAgentRuntimesInput, ListAgentRuntimesOutput] = ( + APIOperation( + static_schema=_SCHEMA_LIST_AGENT_RUNTIMES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +LIST_AGENT_RUNTIME_VERSIONS: APIOperation[ + ListAgentRuntimeVersionsInput, ListAgentRuntimeVersionsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_AGENT_RUNTIME_VERSIONS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +UPDATE_AGENT_RUNTIME: APIOperation[ + UpdateAgentRuntimeInput, UpdateAgentRuntimeOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_AGENT_RUNTIME, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +CREATE_API_KEY_CREDENTIAL_PROVIDER: APIOperation[ + CreateApiKeyCredentialProviderInput, CreateApiKeyCredentialProviderOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_API_KEY_CREDENTIAL_PROVIDER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#DecryptionFailure"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#EncryptionFailure"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceLimitExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#UnauthorizedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +DELETE_API_KEY_CREDENTIAL_PROVIDER: APIOperation[ + DeleteApiKeyCredentialProviderInput, DeleteApiKeyCredentialProviderOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_API_KEY_CREDENTIAL_PROVIDER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#UnauthorizedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +GET_API_KEY_CREDENTIAL_PROVIDER: APIOperation[ + GetApiKeyCredentialProviderInput, GetApiKeyCredentialProviderOutput +] = APIOperation( + static_schema=_SCHEMA_GET_API_KEY_CREDENTIAL_PROVIDER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#DecryptionFailure"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#UnauthorizedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +LIST_API_KEY_CREDENTIAL_PROVIDERS: APIOperation[ + ListApiKeyCredentialProvidersInput, ListApiKeyCredentialProvidersOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_API_KEY_CREDENTIAL_PROVIDERS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#UnauthorizedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +UPDATE_API_KEY_CREDENTIAL_PROVIDER: APIOperation[ + UpdateApiKeyCredentialProviderInput, UpdateApiKeyCredentialProviderOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_API_KEY_CREDENTIAL_PROVIDER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#DecryptionFailure"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#EncryptionFailure"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#UnauthorizedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +CREATE_BROWSER_PROFILE: APIOperation[ + CreateBrowserProfileInput, CreateBrowserProfileOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_BROWSER_PROFILE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - inline_content: str | None = None - """ - The JSON content containing the A2A agent card definition, conforming to - the A2A protocol specification. - """ +DELETE_BROWSER_PROFILE: APIOperation[ + DeleteBrowserProfileInput, DeleteBrowserProfileOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_BROWSER_PROFILE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENT_CARD_DEFINITION, self) +GET_BROWSER_PROFILE: APIOperation[GetBrowserProfileInput, GetBrowserProfileOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_BROWSER_PROFILE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +LIST_BROWSER_PROFILES: APIOperation[ + ListBrowserProfilesInput, ListBrowserProfilesOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_BROWSER_PROFILES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize_members(self, serializer: ShapeSerializer): - if self.schema_version is not None: - serializer.write_string( - _SCHEMA_AGENT_CARD_DEFINITION.members["schemaVersion"], - self.schema_version, - ) +CREATE_BROWSER: APIOperation[CreateBrowserInput, CreateBrowserOutput] = APIOperation( + static_schema=_SCHEMA_CREATE_BROWSER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - if self.inline_content is not None: - serializer.write_string( - _SCHEMA_AGENT_CARD_DEFINITION.members["inlineContent"], - self.inline_content, - ) +DELETE_BROWSER: APIOperation[DeleteBrowserInput, DeleteBrowserOutput] = APIOperation( + static_schema=_SCHEMA_DELETE_BROWSER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) +GET_BROWSER: APIOperation[GetBrowserInput, GetBrowserOutput] = APIOperation( + static_schema=_SCHEMA_GET_BROWSER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +LIST_BROWSERS: APIOperation[ListBrowsersInput, ListBrowsersOutput] = APIOperation( + static_schema=_SCHEMA_LIST_BROWSERS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["schema_version"] = de.read_string( - _SCHEMA_AGENT_CARD_DEFINITION.members["schemaVersion"] - ) +CREATE_CAPACITY_PROVIDER: APIOperation[ + CreateCapacityProviderInput, CreateCapacityProviderOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_CAPACITY_PROVIDER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#RetryableConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 1: - kwargs["inline_content"] = de.read_string( - _SCHEMA_AGENT_CARD_DEFINITION.members["inlineContent"] - ) +DELETE_CAPACITY_PROVIDER: APIOperation[ + DeleteCapacityProviderInput, DeleteCapacityProviderOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_CAPACITY_PROVIDER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#RetryableConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case _: - logger.debug("Unexpected member schema: %s", schema) +GET_CAPACITY_PROVIDER: APIOperation[ + GetCapacityProviderInput, GetCapacityProviderOutput +] = APIOperation( + static_schema=_SCHEMA_GET_CAPACITY_PROVIDER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - deserializer.read_struct(_SCHEMA_AGENT_CARD_DEFINITION, consumer=_consumer) - return kwargs +LIST_AGENT_RUNTIME_VERSIONS_BY_CAPACITY_PROVIDER: APIOperation[ + ListAgentRuntimeVersionsByCapacityProviderInput, + ListAgentRuntimeVersionsByCapacityProviderOutput, +] = APIOperation( + static_schema=_SCHEMA_LIST_AGENT_RUNTIME_VERSIONS_BY_CAPACITY_PROVIDER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +LIST_CAPACITY_PROVIDERS: APIOperation[ + ListCapacityProvidersInput, ListCapacityProvidersOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_CAPACITY_PROVIDERS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -@dataclass(kw_only=True) -class A2aDescriptor: - """ - The Agent-to-Agent (A2A) protocol descriptor for a registry record. - Contains the agent card definition as defined by the A2A protocol - specification. - """ +UPDATE_CAPACITY_PROVIDER: APIOperation[ + UpdateCapacityProviderInput, UpdateCapacityProviderOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_CAPACITY_PROVIDER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#RetryableConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - agent_card: AgentCardDefinition | None = None - """ - The agent card definition for the A2A agent, as defined by the A2A - protocol specification. - """ +CREATE_CODE_INTERPRETER: APIOperation[ + CreateCodeInterpreterInput, CreateCodeInterpreterOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_CODE_INTERPRETER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_A2A_DESCRIPTOR, self) +DELETE_CODE_INTERPRETER: APIOperation[ + DeleteCodeInterpreterInput, DeleteCodeInterpreterOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_CODE_INTERPRETER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize_members(self, serializer: ShapeSerializer): - if self.agent_card is not None: - serializer.write_struct( - _SCHEMA_A2A_DESCRIPTOR.members["agentCard"], self.agent_card - ) +GET_CODE_INTERPRETER: APIOperation[ + GetCodeInterpreterInput, GetCodeInterpreterOutput +] = APIOperation( + static_schema=_SCHEMA_GET_CODE_INTERPRETER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) +LIST_CODE_INTERPRETERS: APIOperation[ + ListCodeInterpretersInput, ListCodeInterpretersOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_CODE_INTERPRETERS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +CREATE_CONFIGURATION_BUNDLE: APIOperation[ + CreateConfigurationBundleInput, CreateConfigurationBundleOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_CONFIGURATION_BUNDLE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_card"] = AgentCardDefinition.deserialize(de) +DELETE_CONFIGURATION_BUNDLE: APIOperation[ + DeleteConfigurationBundleInput, DeleteConfigurationBundleOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_CONFIGURATION_BUNDLE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case _: - logger.debug("Unexpected member schema: %s", schema) +GET_CONFIGURATION_BUNDLE: APIOperation[ + GetConfigurationBundleInput, GetConfigurationBundleOutput +] = APIOperation( + static_schema=_SCHEMA_GET_CONFIGURATION_BUNDLE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - deserializer.read_struct(_SCHEMA_A2A_DESCRIPTOR, consumer=_consumer) - return kwargs +GET_CONFIGURATION_BUNDLE_VERSION: APIOperation[ + GetConfigurationBundleVersionInput, GetConfigurationBundleVersionOutput +] = APIOperation( + static_schema=_SCHEMA_GET_CONFIGURATION_BUNDLE_VERSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +LIST_CONFIGURATION_BUNDLES: APIOperation[ + ListConfigurationBundlesInput, ListConfigurationBundlesOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_CONFIGURATION_BUNDLES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -@dataclass(kw_only=True) -class AccessDeniedException(ServiceError): - """This exception is thrown when a request is denied per access permissions""" +LIST_CONFIGURATION_BUNDLE_VERSIONS: APIOperation[ + ListConfigurationBundleVersionsInput, ListConfigurationBundleVersionsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_CONFIGURATION_BUNDLE_VERSIONS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - fault: Literal["client", "server"] | None = "client" +UPDATE_CONFIGURATION_BUNDLE: APIOperation[ + UpdateConfigurationBundleInput, UpdateConfigurationBundleOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_CONFIGURATION_BUNDLE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACCESS_DENIED_EXCEPTION, self) +CREATE_CONSENT_PORTAL: APIOperation[ + CreateConsentPortalInput, CreateConsentPortalOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_CONSENT_PORTAL, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#UnauthorizedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_ACCESS_DENIED_EXCEPTION.members["message"], self.message - ) +DELETE_CONSENT_PORTAL: APIOperation[ + DeleteConsentPortalInput, DeleteConsentPortalOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_CONSENT_PORTAL, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#UnauthorizedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) +GET_CONSENT_PORTAL: APIOperation[GetConsentPortalInput, GetConsentPortalOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_CONSENT_PORTAL, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#UnauthorizedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +LIST_CONSENT_PORTALS: APIOperation[ + ListConsentPortalsInput, ListConsentPortalsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_CONSENT_PORTALS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#UnauthorizedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_ACCESS_DENIED_EXCEPTION.members["message"] - ) +UPDATE_CONSENT_PORTAL: APIOperation[ + UpdateConsentPortalInput, UpdateConsentPortalOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_CONSENT_PORTAL, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#UnauthorizedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case _: - logger.debug("Unexpected member schema: %s", schema) +CREATE_DATASET: APIOperation[CreateDatasetInput, CreateDatasetOutput] = APIOperation( + static_schema=_SCHEMA_CREATE_DATASET, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - deserializer.read_struct(_SCHEMA_ACCESS_DENIED_EXCEPTION, consumer=_consumer) - return kwargs +CREATE_DATASET_VERSION: APIOperation[ + CreateDatasetVersionInput, CreateDatasetVersionOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_DATASET_VERSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +DELETE_DATASET: APIOperation[DeleteDatasetInput, DeleteDatasetOutput] = APIOperation( + static_schema=_SCHEMA_DELETE_DATASET, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -@dataclass(kw_only=True) -class StaticOverride: - """A static configuration bundle override.""" +DELETE_DATASET_EXAMPLES: APIOperation[ + DeleteDatasetExamplesInput, DeleteDatasetExamplesOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_DATASET_EXAMPLES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - bundle_arn: str - """The Amazon Resource Name (ARN) of the configuration bundle to apply.""" +GET_DATASET: APIOperation[GetDatasetInput, GetDatasetOutput] = APIOperation( + static_schema=_SCHEMA_GET_DATASET, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - bundle_version: str - """The version of the configuration bundle to apply.""" +LIST_DATASET_EXAMPLES: APIOperation[ + ListDatasetExamplesInput, ListDatasetExamplesOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_DATASET_EXAMPLES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STATIC_OVERRIDE, self) +LIST_DATASETS: APIOperation[ListDatasetsInput, ListDatasetsOutput] = APIOperation( + static_schema=_SCHEMA_LIST_DATASETS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_STATIC_OVERRIDE.members["bundleArn"], self.bundle_arn - ) - serializer.write_string( - _SCHEMA_STATIC_OVERRIDE.members["bundleVersion"], self.bundle_version - ) +LIST_DATASET_VERSIONS: APIOperation[ + ListDatasetVersionsInput, ListDatasetVersionsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_DATASET_VERSIONS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) +UPDATE_DATASET: APIOperation[UpdateDatasetInput, UpdateDatasetOutput] = APIOperation( + static_schema=_SCHEMA_UPDATE_DATASET, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +UPDATE_DATASET_EXAMPLES: APIOperation[ + UpdateDatasetExamplesInput, UpdateDatasetExamplesOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_DATASET_EXAMPLES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bundle_arn"] = de.read_string( - _SCHEMA_STATIC_OVERRIDE.members["bundleArn"] - ) +DELETE_RESOURCE_POLICY: APIOperation[ + DeleteResourcePolicyInput, DeleteResourcePolicyOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_RESOURCE_POLICY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 1: - kwargs["bundle_version"] = de.read_string( - _SCHEMA_STATIC_OVERRIDE.members["bundleVersion"] - ) +CREATE_EVALUATOR: APIOperation[CreateEvaluatorInput, CreateEvaluatorOutput] = ( + APIOperation( + static_schema=_SCHEMA_CREATE_EVALUATOR, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID( + "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" + ), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - case _: - logger.debug("Unexpected member schema: %s", schema) +DELETE_EVALUATOR: APIOperation[DeleteEvaluatorInput, DeleteEvaluatorOutput] = ( + APIOperation( + static_schema=_SCHEMA_DELETE_EVALUATOR, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - deserializer.read_struct(_SCHEMA_STATIC_OVERRIDE, consumer=_consumer) - if "bundle_arn" not in kwargs: - kwargs["bundle_arn"] = "" - if "bundle_version" not in kwargs: - kwargs["bundle_version"] = "" - return kwargs +GET_EVALUATOR: APIOperation[GetEvaluatorInput, GetEvaluatorOutput] = APIOperation( + static_schema=_SCHEMA_GET_EVALUATOR, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +LIST_EVALUATORS: APIOperation[ListEvaluatorsInput, ListEvaluatorsOutput] = APIOperation( + static_schema=_SCHEMA_LIST_EVALUATORS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -@dataclass(kw_only=True) -class ConfigurationBundleReference: - """A reference to a specific version of a configuration bundle.""" +UPDATE_EVALUATOR: APIOperation[UpdateEvaluatorInput, UpdateEvaluatorOutput] = ( + APIOperation( + static_schema=_SCHEMA_UPDATE_EVALUATOR, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID( + "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" + ), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - bundle_arn: str - """The Amazon Resource Name (ARN) of the configuration bundle.""" +BATCH_PUT_GATEWAY_RATE_LIMITS: APIOperation[ + BatchPutGatewayRateLimitsInput, BatchPutGatewayRateLimitsOutput +] = APIOperation( + static_schema=_SCHEMA_BATCH_PUT_GATEWAY_RATE_LIMITS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - bundle_version: str - """The version of the configuration bundle.""" +CREATE_GATEWAY_RATE_LIMIT: APIOperation[ + CreateGatewayRateLimitInput, CreateGatewayRateLimitOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_GATEWAY_RATE_LIMIT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONFIGURATION_BUNDLE_REFERENCE, self) +DELETE_GATEWAY_RATE_LIMIT: APIOperation[ + DeleteGatewayRateLimitInput, DeleteGatewayRateLimitOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_GATEWAY_RATE_LIMIT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CONFIGURATION_BUNDLE_REFERENCE.members["bundleArn"], self.bundle_arn - ) - serializer.write_string( - _SCHEMA_CONFIGURATION_BUNDLE_REFERENCE.members["bundleVersion"], - self.bundle_version, - ) +GET_GATEWAY_RATE_LIMIT: APIOperation[ + GetGatewayRateLimitInput, GetGatewayRateLimitOutput +] = APIOperation( + static_schema=_SCHEMA_GET_GATEWAY_RATE_LIMIT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) +LIST_GATEWAY_RATE_LIMITS: APIOperation[ + ListGatewayRateLimitsInput, ListGatewayRateLimitsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_GATEWAY_RATE_LIMITS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +UPDATE_GATEWAY_RATE_LIMIT: APIOperation[ + UpdateGatewayRateLimitInput, UpdateGatewayRateLimitOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_GATEWAY_RATE_LIMIT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bundle_arn"] = de.read_string( - _SCHEMA_CONFIGURATION_BUNDLE_REFERENCE.members["bundleArn"] - ) +CREATE_GATEWAY: APIOperation[CreateGatewayInput, CreateGatewayOutput] = APIOperation( + static_schema=_SCHEMA_CREATE_GATEWAY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 1: - kwargs["bundle_version"] = de.read_string( - _SCHEMA_CONFIGURATION_BUNDLE_REFERENCE.members["bundleVersion"] - ) +DELETE_GATEWAY: APIOperation[DeleteGatewayInput, DeleteGatewayOutput] = APIOperation( + static_schema=_SCHEMA_DELETE_GATEWAY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case _: - logger.debug("Unexpected member schema: %s", schema) +GET_GATEWAY: APIOperation[GetGatewayInput, GetGatewayOutput] = APIOperation( + static_schema=_SCHEMA_GET_GATEWAY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - deserializer.read_struct( - _SCHEMA_CONFIGURATION_BUNDLE_REFERENCE, consumer=_consumer - ) - if "bundle_arn" not in kwargs: - kwargs["bundle_arn"] = "" - if "bundle_version" not in kwargs: - kwargs["bundle_version"] = "" - return kwargs +LIST_GATEWAYS: APIOperation[ListGatewaysInput, ListGatewaysOutput] = APIOperation( + static_schema=_SCHEMA_LIST_GATEWAYS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def _smithy_default(cls) -> Self: - return cls(bundle_arn="", bundle_version="") +UPDATE_GATEWAY: APIOperation[UpdateGatewayInput, UpdateGatewayOutput] = APIOperation( + static_schema=_SCHEMA_UPDATE_GATEWAY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +CREATE_GATEWAY_RULE: APIOperation[CreateGatewayRuleInput, CreateGatewayRuleOutput] = ( + APIOperation( + static_schema=_SCHEMA_CREATE_GATEWAY_RULE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID( + "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" + ), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +DELETE_GATEWAY_RULE: APIOperation[DeleteGatewayRuleInput, DeleteGatewayRuleOutput] = ( + APIOperation( + static_schema=_SCHEMA_DELETE_GATEWAY_RULE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +GET_GATEWAY_RULE: APIOperation[GetGatewayRuleInput, GetGatewayRuleOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_GATEWAY_RULE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +LIST_GATEWAY_RULES: APIOperation[ListGatewayRulesInput, ListGatewayRulesOutput] = ( + APIOperation( + static_schema=_SCHEMA_LIST_GATEWAY_RULES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +UPDATE_GATEWAY_RULE: APIOperation[UpdateGatewayRuleInput, UpdateGatewayRuleOutput] = ( + APIOperation( + static_schema=_SCHEMA_UPDATE_GATEWAY_RULE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +DELETE_GATEWAY_TARGET: APIOperation[ + DeleteGatewayTargetInput, DeleteGatewayTargetOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_GATEWAY_TARGET, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +LIST_GATEWAY_TARGETS: APIOperation[ + ListGatewayTargetsInput, ListGatewayTargetsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_GATEWAY_TARGETS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +GET_RESOURCE_POLICY: APIOperation[GetResourcePolicyInput, GetResourcePolicyOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_RESOURCE_POLICY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +GET_TOKEN_VAULT: APIOperation[GetTokenVaultInput, GetTokenVaultOutput] = APIOperation( + static_schema=_SCHEMA_GET_TOKEN_VAULT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#UnauthorizedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +CREATE_HARNESS_ENDPOINT: APIOperation[ + CreateHarnessEndpointInput, CreateHarnessEndpointOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_HARNESS_ENDPOINT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +DELETE_HARNESS_ENDPOINT: APIOperation[ + DeleteHarnessEndpointInput, DeleteHarnessEndpointOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_HARNESS_ENDPOINT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -def _serialize_traffic_split_metadata_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) +GET_HARNESS_ENDPOINT: APIOperation[ + GetHarnessEndpointInput, GetHarnessEndpointOutput +] = APIOperation( + static_schema=_SCHEMA_GET_HARNESS_ENDPOINT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +LIST_HARNESS_ENDPOINTS: APIOperation[ + ListHarnessEndpointsInput, ListHarnessEndpointsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_HARNESS_ENDPOINTS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -def _deserialize_traffic_split_metadata_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] +UPDATE_HARNESS_ENDPOINT: APIOperation[ + UpdateHarnessEndpointInput, UpdateHarnessEndpointOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_HARNESS_ENDPOINT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() +CREATE_HARNESS: APIOperation[CreateHarnessInput, CreateHarnessOutput] = APIOperation( + static_schema=_SCHEMA_CREATE_HARNESS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - else: - result[k] = d.read_string(value_schema) +DELETE_HARNESS: APIOperation[DeleteHarnessInput, DeleteHarnessOutput] = APIOperation( + static_schema=_SCHEMA_DELETE_HARNESS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - deserializer.read_map(schema, _read_value) - return result +GET_HARNESS: APIOperation[GetHarnessInput, GetHarnessOutput] = APIOperation( + static_schema=_SCHEMA_GET_HARNESS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +LIST_HARNESSES: APIOperation[ListHarnessesInput, ListHarnessesOutput] = APIOperation( + static_schema=_SCHEMA_LIST_HARNESSES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -@dataclass(kw_only=True) -class TrafficSplitEntry: - """ - An entry in a traffic split configuration, defining a named variant with - a weight and configuration bundle reference. - """ +LIST_HARNESS_VERSIONS: APIOperation[ + ListHarnessVersionsInput, ListHarnessVersionsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_HARNESS_VERSIONS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - name: str - """The name of this traffic split variant.""" +UPDATE_HARNESS: APIOperation[UpdateHarnessInput, UpdateHarnessOutput] = APIOperation( + static_schema=_SCHEMA_UPDATE_HARNESS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - weight: int - """ - The percentage of traffic to route to this variant. Weights across all - entries must sum to 100. - """ +LIST_TAGS_FOR_RESOURCE: APIOperation[ + ListTagsForResourceInput, ListTagsForResourceOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_TAGS_FOR_RESOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - configuration_bundle: ConfigurationBundleReference - """The configuration bundle reference for this variant.""" +CREATE_MEMORY: APIOperation[CreateMemoryInput, CreateMemoryOutput] = APIOperation( + static_schema=_SCHEMA_CREATE_MEMORY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottledException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - description: str | None = None - """The description of this traffic split variant.""" +DELETE_MEMORY: APIOperation[DeleteMemoryInput, DeleteMemoryOutput] = APIOperation( + static_schema=_SCHEMA_DELETE_MEMORY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottledException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - metadata: dict[str, str] | None = None - """Key-value metadata associated with this traffic split variant.""" +GET_MEMORY: APIOperation[GetMemoryInput, GetMemoryOutput] = APIOperation( + static_schema=_SCHEMA_GET_MEMORY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottledException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRAFFIC_SPLIT_ENTRY, self) +LIST_MEMORIES: APIOperation[ListMemoriesInput, ListMemoriesOutput] = APIOperation( + static_schema=_SCHEMA_LIST_MEMORIES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottledException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +UPDATE_MEMORY: APIOperation[UpdateMemoryInput, UpdateMemoryOutput] = APIOperation( + static_schema=_SCHEMA_UPDATE_MEMORY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottledException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +CREATE_OAUTH2_CREDENTIAL_PROVIDER: APIOperation[ + CreateOauth2CredentialProviderInput, CreateOauth2CredentialProviderOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_OAUTH2_CREDENTIAL_PROVIDER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#DecryptionFailure"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#EncryptionFailure"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceLimitExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#UnauthorizedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_TRAFFIC_SPLIT_ENTRY.members["name"], self.name) - serializer.write_integer( - _SCHEMA_TRAFFIC_SPLIT_ENTRY.members["weight"], self.weight - ) - serializer.write_struct( - _SCHEMA_TRAFFIC_SPLIT_ENTRY.members["configurationBundle"], - self.configuration_bundle, - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_TRAFFIC_SPLIT_ENTRY.members["description"], self.description - ) +DELETE_OAUTH2_CREDENTIAL_PROVIDER: APIOperation[ + DeleteOauth2CredentialProviderInput, DeleteOauth2CredentialProviderOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_OAUTH2_CREDENTIAL_PROVIDER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#UnauthorizedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - if self.metadata is not None: - _serialize_traffic_split_metadata_map( - serializer, - _SCHEMA_TRAFFIC_SPLIT_ENTRY.members["metadata"], - self.metadata, - ) +GET_OAUTH2_CREDENTIAL_PROVIDER: APIOperation[ + GetOauth2CredentialProviderInput, GetOauth2CredentialProviderOutput +] = APIOperation( + static_schema=_SCHEMA_GET_OAUTH2_CREDENTIAL_PROVIDER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#DecryptionFailure"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#UnauthorizedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) +LIST_OAUTH2_CREDENTIAL_PROVIDERS: APIOperation[ + ListOauth2CredentialProvidersInput, ListOauth2CredentialProvidersOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_OAUTH2_CREDENTIAL_PROVIDERS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#UnauthorizedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +UPDATE_OAUTH2_CREDENTIAL_PROVIDER: APIOperation[ + UpdateOauth2CredentialProviderInput, UpdateOauth2CredentialProviderOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_OAUTH2_CREDENTIAL_PROVIDER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#DecryptionFailure"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#EncryptionFailure"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#UnauthorizedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +CREATE_ONLINE_EVALUATION_CONFIG: APIOperation[ + CreateOnlineEvaluationConfigInput, CreateOnlineEvaluationConfigOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_ONLINE_EVALUATION_CONFIG, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +DELETE_ONLINE_EVALUATION_CONFIG: APIOperation[ + DeleteOnlineEvaluationConfigInput, DeleteOnlineEvaluationConfigOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_ONLINE_EVALUATION_CONFIG, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +GET_ONLINE_EVALUATION_CONFIG: APIOperation[ + GetOnlineEvaluationConfigInput, GetOnlineEvaluationConfigOutput +] = APIOperation( + static_schema=_SCHEMA_GET_ONLINE_EVALUATION_CONFIG, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +LIST_ONLINE_EVALUATION_CONFIGS: APIOperation[ + ListOnlineEvaluationConfigsInput, ListOnlineEvaluationConfigsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_ONLINE_EVALUATION_CONFIGS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +UPDATE_ONLINE_EVALUATION_CONFIG: APIOperation[ + UpdateOnlineEvaluationConfigInput, UpdateOnlineEvaluationConfigOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_ONLINE_EVALUATION_CONFIG, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +CREATE_PAYMENT_CREDENTIAL_PROVIDER: APIOperation[ + CreatePaymentCredentialProviderInput, CreatePaymentCredentialProviderOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_PAYMENT_CREDENTIAL_PROVIDER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#DecryptionFailure"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#EncryptionFailure"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceLimitExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#UnauthorizedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_TRAFFIC_SPLIT_ENTRY.members["name"] - ) - - case 1: - kwargs["weight"] = de.read_integer( - _SCHEMA_TRAFFIC_SPLIT_ENTRY.members["weight"] - ) - - case 2: - kwargs["configuration_bundle"] = ( - ConfigurationBundleReference.deserialize(de) - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_TRAFFIC_SPLIT_ENTRY.members["description"] - ) - - case 4: - kwargs["metadata"] = _deserialize_traffic_split_metadata_map( - de, _SCHEMA_TRAFFIC_SPLIT_ENTRY.members["metadata"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TRAFFIC_SPLIT_ENTRY, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "weight" not in kwargs: - kwargs["weight"] = 0 - if "configuration_bundle" not in kwargs: - kwargs["configuration_bundle"] = ( - ConfigurationBundleReference._smithy_default() - ) - return kwargs - - -def _serialize_traffic_split_entries( - serializer: ShapeSerializer, schema: Schema, value: list[TrafficSplitEntry] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_traffic_split_entries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[TrafficSplitEntry]: - result: list[TrafficSplitEntry] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(TrafficSplitEntry.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class WeightedOverride: - """ - A weighted configuration bundle override that splits traffic between - multiple bundle versions. - """ - - traffic_split: list[TrafficSplitEntry] - """ - The traffic split entries defining how traffic is distributed between - configuration bundle versions. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_WEIGHTED_OVERRIDE, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_traffic_split_entries( - serializer, - _SCHEMA_WEIGHTED_OVERRIDE.members["trafficSplit"], - self.traffic_split, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["traffic_split"] = _deserialize_traffic_split_entries( - de, _SCHEMA_WEIGHTED_OVERRIDE.members["trafficSplit"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_WEIGHTED_OVERRIDE, consumer=_consumer) - if "traffic_split" not in kwargs: - kwargs["traffic_split"] = [] - return kwargs - - -@dataclass -class ConfigurationBundleActionStaticOverride: - """ - A static configuration bundle override that applies a single bundle - version to all matching requests. - """ - - value: StaticOverride - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONFIGURATION_BUNDLE_ACTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CONFIGURATION_BUNDLE_ACTION.members["staticOverride"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=StaticOverride.deserialize(deserializer)) - - -@dataclass -class ConfigurationBundleActionWeightedOverride: - """ - A weighted configuration bundle override that splits traffic between - multiple bundle versions based on configured weights. - """ - - value: WeightedOverride - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONFIGURATION_BUNDLE_ACTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CONFIGURATION_BUNDLE_ACTION.members["weightedOverride"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=WeightedOverride.deserialize(deserializer)) - - -@dataclass -class ConfigurationBundleActionUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ConfigurationBundleAction = Union[ - ConfigurationBundleActionStaticOverride - | ConfigurationBundleActionWeightedOverride - | ConfigurationBundleActionUnknown -] -""" -An action that applies a configuration bundle override, either as a -static override or a weighted split for A/B testing. -""" - - -class _ConfigurationBundleActionDeserializer: - _result: ConfigurationBundleAction | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> ConfigurationBundleAction: - self._result = None - deserializer.read_struct(_SCHEMA_CONFIGURATION_BUNDLE_ACTION, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - ConfigurationBundleActionStaticOverride.deserialize(de) - ) - - case 1: - self._set_result( - ConfigurationBundleActionWeightedOverride.deserialize(de) - ) - - case _: - self._set_result( - ConfigurationBundleActionUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: ConfigurationBundleAction) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class StaticRoute: - """A static route to a single gateway target.""" - - target_name: str = field(repr=False) - """The name of the target to route requests to.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STATIC_ROUTE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_STATIC_ROUTE.members["targetName"], self.target_name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["target_name"] = de.read_string( - _SCHEMA_STATIC_ROUTE.members["targetName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_STATIC_ROUTE, consumer=_consumer) - if "target_name" not in kwargs: - kwargs["target_name"] = "" - return kwargs - - -@dataclass(kw_only=True) -class TargetTrafficSplitEntry: - """An entry in a target traffic split configuration.""" - - name: str - """The name of this traffic split variant.""" - - weight: int - """The percentage of traffic to route to this variant.""" - - target_name: str = field(repr=False) - """The name of the target to route traffic to.""" - - description: str | None = None - """The description of this traffic split variant.""" - - metadata: dict[str, str] | None = None - """Key-value metadata associated with this traffic split variant.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TARGET_TRAFFIC_SPLIT_ENTRY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_TARGET_TRAFFIC_SPLIT_ENTRY.members["name"], self.name - ) - serializer.write_integer( - _SCHEMA_TARGET_TRAFFIC_SPLIT_ENTRY.members["weight"], self.weight - ) - serializer.write_string( - _SCHEMA_TARGET_TRAFFIC_SPLIT_ENTRY.members["targetName"], self.target_name - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_TARGET_TRAFFIC_SPLIT_ENTRY.members["description"], - self.description, - ) - - if self.metadata is not None: - _serialize_traffic_split_metadata_map( - serializer, - _SCHEMA_TARGET_TRAFFIC_SPLIT_ENTRY.members["metadata"], - self.metadata, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_TARGET_TRAFFIC_SPLIT_ENTRY.members["name"] - ) - - case 1: - kwargs["weight"] = de.read_integer( - _SCHEMA_TARGET_TRAFFIC_SPLIT_ENTRY.members["weight"] - ) - - case 2: - kwargs["target_name"] = de.read_string( - _SCHEMA_TARGET_TRAFFIC_SPLIT_ENTRY.members["targetName"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_TARGET_TRAFFIC_SPLIT_ENTRY.members["description"] - ) - - case 4: - kwargs["metadata"] = _deserialize_traffic_split_metadata_map( - de, _SCHEMA_TARGET_TRAFFIC_SPLIT_ENTRY.members["metadata"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TARGET_TRAFFIC_SPLIT_ENTRY, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "weight" not in kwargs: - kwargs["weight"] = 0 - if "target_name" not in kwargs: - kwargs["target_name"] = "" - return kwargs - - -def _serialize_target_traffic_split_entries( - serializer: ShapeSerializer, schema: Schema, value: list[TargetTrafficSplitEntry] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_target_traffic_split_entries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[TargetTrafficSplitEntry]: - result: list[TargetTrafficSplitEntry] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(TargetTrafficSplitEntry.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class WeightedRoute: - """A weighted route that splits traffic between multiple gateway targets.""" - - traffic_split: list[TargetTrafficSplitEntry] - """ - The traffic split entries defining how traffic is distributed between - targets. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_WEIGHTED_ROUTE, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_target_traffic_split_entries( - serializer, - _SCHEMA_WEIGHTED_ROUTE.members["trafficSplit"], - self.traffic_split, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["traffic_split"] = _deserialize_target_traffic_split_entries( - de, _SCHEMA_WEIGHTED_ROUTE.members["trafficSplit"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_WEIGHTED_ROUTE, consumer=_consumer) - if "traffic_split" not in kwargs: - kwargs["traffic_split"] = [] - return kwargs - - -@dataclass -class RouteToTargetActionStaticRoute: - """A static route that sends all matching requests to a single target.""" - - value: StaticRoute - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ROUTE_TO_TARGET_ACTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_ROUTE_TO_TARGET_ACTION.members["staticRoute"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=StaticRoute.deserialize(deserializer)) - - -@dataclass -class RouteToTargetActionWeightedRoute: - """A weighted route that splits traffic between multiple targets.""" - - value: WeightedRoute - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ROUTE_TO_TARGET_ACTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_ROUTE_TO_TARGET_ACTION.members["weightedRoute"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=WeightedRoute.deserialize(deserializer)) - - -@dataclass -class RouteToTargetActionUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -RouteToTargetAction = Union[ - RouteToTargetActionStaticRoute - | RouteToTargetActionWeightedRoute - | RouteToTargetActionUnknown -] -""" -An action that routes requests to a gateway target, either statically or -with weighted traffic splitting. -""" - - -class _RouteToTargetActionDeserializer: - _result: RouteToTargetAction | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> RouteToTargetAction: - self._result = None - deserializer.read_struct(_SCHEMA_ROUTE_TO_TARGET_ACTION, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(RouteToTargetActionStaticRoute.deserialize(de)) - - case 1: - self._set_result(RouteToTargetActionWeightedRoute.deserialize(de)) - - case _: - self._set_result( - RouteToTargetActionUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: RouteToTargetAction) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass -class ActionConfigurationBundle: - """An action that applies a configuration bundle override to the request.""" - - value: ConfigurationBundleAction - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_ACTION.members["configurationBundle"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_ConfigurationBundleActionDeserializer().deserialize(deserializer) - ) - - -@dataclass -class ActionRouteToTarget: - """An action that routes the request to a specific target.""" - - value: RouteToTargetAction - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACTION.members["routeToTarget"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=_RouteToTargetActionDeserializer().deserialize(deserializer)) - - -@dataclass -class ActionUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -Action = Union[ActionConfigurationBundle | ActionRouteToTarget | ActionUnknown] -"""An action to take when a gateway rule's conditions are met.""" - - -class _ActionDeserializer: - _result: Action | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> Action: - self._result = None - deserializer.read_struct(_SCHEMA_ACTION, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(ActionConfigurationBundle.deserialize(de)) - - case 1: - self._set_result(ActionRouteToTarget.deserialize(de)) - - case _: - self._set_result(ActionUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: Action) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_actions( - serializer: ShapeSerializer, schema: Schema, value: list[Action] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_actions( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Action]: - result: list[Action] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_ActionDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class ActorTokenContentType(UnknownEnumMixin, StrEnum): - NONE = "NONE" - M2_M = "M2M" - AWS_IAM_ID_TOKEN_JWT = "AWS_IAM_ID_TOKEN_JWT" - - -def _serialize_dataset_example_list( - serializer: ShapeSerializer, schema: Schema, value: list[Document] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_document(member_schema, e) - - -def _deserialize_dataset_example_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Document]: - result: list[Document] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_document(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class InlineExamplesSource: - """Inline examples provided directly in the request body.""" - - examples: list[Document] - """Examples to add. Each example is assigned an auto-generated UUID.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INLINE_EXAMPLES_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_dataset_example_list( - serializer, - _SCHEMA_INLINE_EXAMPLES_SOURCE.members["examples"], - self.examples, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["examples"] = _deserialize_dataset_example_list( - de, _SCHEMA_INLINE_EXAMPLES_SOURCE.members["examples"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INLINE_EXAMPLES_SOURCE, consumer=_consumer) - if "examples" not in kwargs: - kwargs["examples"] = [] - return kwargs - - -@dataclass(kw_only=True) -class S3Source: - """Amazon S3 location of a JSONL file containing dataset examples.""" - - s3_uri: str - """ - Amazon S3 URI of the JSONL file (for example, - `s3://my-bucket/path/to/examples.jsonl`). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_S3_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_S3_SOURCE.members["s3Uri"], self.s3_uri) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["s3_uri"] = de.read_string( - _SCHEMA_S3_SOURCE.members["s3Uri"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_S3_SOURCE, consumer=_consumer) - if "s3_uri" not in kwargs: - kwargs["s3_uri"] = "" - return kwargs - - -@dataclass -class DataSourceTypeInlineExamples: - """Inline examples provided directly in the request body.""" - - value: InlineExamplesSource - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DATA_SOURCE_TYPE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DATA_SOURCE_TYPE.members["inlineExamples"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=InlineExamplesSource.deserialize(deserializer)) - - -@dataclass -class DataSourceTypeS3Source: - """Amazon S3 URI pointing to a JSONL file in the customer's bucket.""" - - value: S3Source - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DATA_SOURCE_TYPE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DATA_SOURCE_TYPE.members["s3Source"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=S3Source.deserialize(deserializer)) - - -@dataclass -class DataSourceTypeUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -DataSourceType = Union[ - DataSourceTypeInlineExamples | DataSourceTypeS3Source | DataSourceTypeUnknown -] -"""Source of examples to add to the dataset.""" - - -class _DataSourceTypeDeserializer: - _result: DataSourceType | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> DataSourceType: - self._result = None - deserializer.read_struct(_SCHEMA_DATA_SOURCE_TYPE, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(DataSourceTypeInlineExamples.deserialize(de)) - - case 1: - self._set_result(DataSourceTypeS3Source.deserialize(de)) - - case _: - self._set_result(DataSourceTypeUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: DataSourceType) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class AddDatasetExamplesInput: - """Dataclass for AddDatasetExamplesInput structure.""" - - dataset_id: str | None = None - """The unique identifier of the dataset to add examples to.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If you don't specify this field, a - value is randomly generated for you. If this token matches a previous - request, the service ignores the request, but doesn't return an error. - For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - source: DataSourceType | None = None - """ - Source of examples to add. Provide either inline examples or an S3 URI - pointing to a JSONL file. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ADD_DATASET_EXAMPLES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.dataset_id is not None: - serializer.write_string( - _SCHEMA_ADD_DATASET_EXAMPLES_INPUT.members["datasetId"], self.dataset_id - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_ADD_DATASET_EXAMPLES_INPUT.members["clientToken"], - self.client_token, - ) - - if self.source is not None: - serializer.write_struct( - _SCHEMA_ADD_DATASET_EXAMPLES_INPUT.members["source"], self.source - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["dataset_id"] = de.read_string( - _SCHEMA_ADD_DATASET_EXAMPLES_INPUT.members["datasetId"] - ) - - case 1: - kwargs["client_token"] = de.read_string( - _SCHEMA_ADD_DATASET_EXAMPLES_INPUT.members["clientToken"] - ) - - case 2: - kwargs["source"] = _DataSourceTypeDeserializer().deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ADD_DATASET_EXAMPLES_INPUT, consumer=_consumer) - return kwargs - - -def _serialize_example_id_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_example_id_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -class DatasetStatus(UnknownEnumMixin, StrEnum): - """Dataset lifecycle and operation status.""" - - CREATING = "CREATING" - """CreateDataset async ingestion in progress. All writes are blocked.""" - UPDATING = "UPDATING" - """ - An async example mutation or CreateDatasetVersion is in progress. All - writes are blocked. - """ - DELETING = "DELETING" - """ - Full or version-specific delete is in progress. Read operations are - still allowed. - """ - ACTIVE = "ACTIVE" - """ - Dataset is stable. All operations are allowed per operation-specific - guards. - """ - CREATE_FAILED = "CREATE_FAILED" - """Initial ingestion failed. DRAFT record exists but contains no examples.""" - UPDATE_FAILED = "UPDATE_FAILED" - """ - Last example mutation or CreateDatasetVersion failed. DRAFT may be - partially modified. - """ - DELETE_FAILED = "DELETE_FAILED" - """ - Delete failed after retries. Dataset record may be in an inconsistent - state. - """ - - -@dataclass(kw_only=True) -class AddDatasetExamplesOutput: - """Dataclass for AddDatasetExamplesOutput structure.""" - - dataset_arn: str - """The Amazon Resource Name (ARN) of the dataset.""" - - dataset_id: str - """The unique identifier of the dataset.""" - - status: str - """The current status of the dataset.""" - - added_count: int - """The number of examples added.""" - - updated_at: datetime - """The timestamp when the examples were added.""" - - example_ids: list[str] - """IDs of all added examples (auto-generated UUIDs).""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ADD_DATASET_EXAMPLES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_ADD_DATASET_EXAMPLES_OUTPUT.members["datasetArn"], self.dataset_arn - ) - serializer.write_string( - _SCHEMA_ADD_DATASET_EXAMPLES_OUTPUT.members["datasetId"], self.dataset_id - ) - serializer.write_string( - _SCHEMA_ADD_DATASET_EXAMPLES_OUTPUT.members["status"], self.status - ) - serializer.write_long( - _SCHEMA_ADD_DATASET_EXAMPLES_OUTPUT.members["addedCount"], self.added_count - ) - serializer.write_timestamp( - _SCHEMA_ADD_DATASET_EXAMPLES_OUTPUT.members["updatedAt"], self.updated_at - ) - _serialize_example_id_list( - serializer, - _SCHEMA_ADD_DATASET_EXAMPLES_OUTPUT.members["exampleIds"], - self.example_ids, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["dataset_arn"] = de.read_string( - _SCHEMA_ADD_DATASET_EXAMPLES_OUTPUT.members["datasetArn"] - ) - - case 1: - kwargs["dataset_id"] = de.read_string( - _SCHEMA_ADD_DATASET_EXAMPLES_OUTPUT.members["datasetId"] - ) - - case 2: - kwargs["status"] = DatasetStatus( - de.read_string( - _SCHEMA_ADD_DATASET_EXAMPLES_OUTPUT.members["status"] - ) - ) - - case 3: - kwargs["added_count"] = de.read_long( - _SCHEMA_ADD_DATASET_EXAMPLES_OUTPUT.members["addedCount"] - ) - - case 4: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_ADD_DATASET_EXAMPLES_OUTPUT.members["updatedAt"] - ) - - case 5: - kwargs["example_ids"] = _deserialize_example_id_list( - de, _SCHEMA_ADD_DATASET_EXAMPLES_OUTPUT.members["exampleIds"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ADD_DATASET_EXAMPLES_OUTPUT, consumer=_consumer - ) - if "dataset_arn" not in kwargs: - kwargs["dataset_arn"] = "" - if "dataset_id" not in kwargs: - kwargs["dataset_id"] = "" - if "status" not in kwargs: - kwargs["status"] = DatasetStatus._corrected("") - if "added_count" not in kwargs: - kwargs["added_count"] = 0 - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "example_ids" not in kwargs: - kwargs["example_ids"] = [] - return kwargs - - -@dataclass(kw_only=True) -class ConflictException(ServiceError): - """ - This exception is thrown when there is a conflict performing an - operation - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONFLICT_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_CONFLICT_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_CONFLICT_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONFLICT_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class InternalServerException(ServiceError): - """ - This exception is thrown if there was an unexpected error during - processing of request - """ - - fault: Literal["client", "server"] | None = "server" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INTERNAL_SERVER_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INTERNAL_SERVER_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INTERNAL_SERVER_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INTERNAL_SERVER_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ResourceNotFoundException(ServiceError): - """ - This exception is thrown when a resource referenced by the operation - does not exist - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ServiceQuotaExceededException(ServiceError): - """This exception is thrown when a request is made beyond the service quota""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ThrottlingException(ServiceError): - """This exception is thrown when the number of requests exceeds the limit""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_THROTTLING_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_THROTTLING_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_THROTTLING_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_THROTTLING_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ValidationExceptionField: - """ - Stores information about a field passed inside a request that resulted - in an exception. - """ - - name: str - """The name of the field.""" - - message: str - """A message describing why this field failed validation.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VALIDATION_EXCEPTION_FIELD, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_VALIDATION_EXCEPTION_FIELD.members["name"], self.name - ) - serializer.write_string( - _SCHEMA_VALIDATION_EXCEPTION_FIELD.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_VALIDATION_EXCEPTION_FIELD.members["name"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_VALIDATION_EXCEPTION_FIELD.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VALIDATION_EXCEPTION_FIELD, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "message" not in kwargs: - kwargs["message"] = "" - return kwargs - - -def _serialize_validation_exception_field_list( - serializer: ShapeSerializer, schema: Schema, value: list[ValidationExceptionField] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_validation_exception_field_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ValidationExceptionField]: - result: list[ValidationExceptionField] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ValidationExceptionField.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class ValidationExceptionReason(UnknownEnumMixin, StrEnum): - CANNOT_PARSE = "CannotParse" - FIELD_VALIDATION_FAILED = "FieldValidationFailed" - IDEMPOTENT_PARAMETER_MISMATCH_EXCEPTION = "IdempotentParameterMismatchException" - ROOT_EVENT_IN_OTHER_SESSION = "EventInOtherSession" - RESOURCE_CONFLICT = "ResourceConflict" - - -@dataclass(kw_only=True) -class ValidationException(ServiceError): - """The input fails to satisfy the constraints specified by the service.""" - - fault: Literal["client", "server"] | None = "client" - - reason: str - - field_list: list[ValidationExceptionField] | None = None - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VALIDATION_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_VALIDATION_EXCEPTION.members["message"], self.message - ) - serializer.write_string( - _SCHEMA_VALIDATION_EXCEPTION.members["reason"], self.reason - ) - if self.field_list is not None: - _serialize_validation_exception_field_list( - serializer, - _SCHEMA_VALIDATION_EXCEPTION.members["fieldList"], - self.field_list, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_VALIDATION_EXCEPTION.members["message"] - ) - - case 1: - kwargs["reason"] = ValidationExceptionReason( - de.read_string(_SCHEMA_VALIDATION_EXCEPTION.members["reason"]) - ) - - case 2: - kwargs["field_list"] = _deserialize_validation_exception_field_list( - de, _SCHEMA_VALIDATION_EXCEPTION.members["fieldList"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VALIDATION_EXCEPTION, consumer=_consumer) - if "reason" not in kwargs: - kwargs["reason"] = ValidationExceptionReason._corrected("") - return kwargs - - -ADD_DATASET_EXAMPLES = APIOperation( - input=AddDatasetExamplesInput, - output=AddDatasetExamplesOutput, - schema=_SCHEMA_ADD_DATASET_EXAMPLES, - input_schema=_SCHEMA_ADD_DATASET_EXAMPLES_INPUT, - output_schema=_SCHEMA_ADD_DATASET_EXAMPLES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -def _serialize_additional_claims( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_additional_claims( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -def _serialize_advertised_scope_mapping_type( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_advertised_scope_mapping_type( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -def _serialize_tags_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_tags_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CreateAgentRuntimeEndpointInput: - """Dataclass for CreateAgentRuntimeEndpointInput structure.""" - - agent_runtime_id: str | None = None - """ - The unique identifier of the AgentCore Runtime to create an endpoint - for. - """ - - name: str | None = field(repr=False, default=None) - """The name of the AgentCore Runtime endpoint.""" - - agent_runtime_version: str | None = None - """The version of the AgentCore Runtime to use for the endpoint.""" - - description: str | None = None - """The description of the AgentCore Runtime endpoint.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure idempotency of the - request. - """ - - tags: dict[str, str] | None = None - """ - A map of tag keys and values to assign to the agent runtime endpoint. - Tags enable you to categorize your resources in different ways, for - example, by purpose, owner, or environment. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_AGENT_RUNTIME_ENDPOINT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.agent_runtime_id is not None: - serializer.write_string( - _SCHEMA_CREATE_AGENT_RUNTIME_ENDPOINT_INPUT.members["agentRuntimeId"], - self.agent_runtime_id, - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_AGENT_RUNTIME_ENDPOINT_INPUT.members["name"], self.name - ) - - if self.agent_runtime_version is not None: - serializer.write_string( - _SCHEMA_CREATE_AGENT_RUNTIME_ENDPOINT_INPUT.members[ - "agentRuntimeVersion" - ], - self.agent_runtime_version, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_AGENT_RUNTIME_ENDPOINT_INPUT.members["description"], - self.description, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_AGENT_RUNTIME_ENDPOINT_INPUT.members["clientToken"], - self.client_token, - ) - - if self.tags is not None: - _serialize_tags_map( - serializer, - _SCHEMA_CREATE_AGENT_RUNTIME_ENDPOINT_INPUT.members["tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_runtime_id"] = de.read_string( - _SCHEMA_CREATE_AGENT_RUNTIME_ENDPOINT_INPUT.members[ - "agentRuntimeId" - ] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_AGENT_RUNTIME_ENDPOINT_INPUT.members["name"] - ) - - case 2: - kwargs["agent_runtime_version"] = de.read_string( - _SCHEMA_CREATE_AGENT_RUNTIME_ENDPOINT_INPUT.members[ - "agentRuntimeVersion" - ] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_AGENT_RUNTIME_ENDPOINT_INPUT.members[ - "description" - ] - ) - - case 4: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_AGENT_RUNTIME_ENDPOINT_INPUT.members[ - "clientToken" - ] - ) - - case 5: - kwargs["tags"] = _deserialize_tags_map( - de, _SCHEMA_CREATE_AGENT_RUNTIME_ENDPOINT_INPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_AGENT_RUNTIME_ENDPOINT_INPUT, consumer=_consumer - ) - return kwargs - - -class AgentRuntimeEndpointStatus(UnknownEnumMixin, StrEnum): - CREATING = "CREATING" - CREATE_FAILED = "CREATE_FAILED" - UPDATING = "UPDATING" - UPDATE_FAILED = "UPDATE_FAILED" - READY = "READY" - DELETING = "DELETING" - DELETE_FAILED = "DELETE_FAILED" - - -@dataclass(kw_only=True) -class CreateAgentRuntimeEndpointOutput: - """Dataclass for CreateAgentRuntimeEndpointOutput structure.""" - - target_version: str - """The target version of the AgentCore Runtime for the endpoint.""" - - agent_runtime_endpoint_arn: str - """The Amazon Resource Name (ARN) of the AgentCore Runtime endpoint.""" - - agent_runtime_arn: str - """The Amazon Resource Name (ARN) of the AgentCore Runtime.""" - - status: str - """The current status of the AgentCore Runtime endpoint.""" - - created_at: datetime - """The timestamp when the AgentCore Runtime endpoint was created.""" - - agent_runtime_id: str | None = None - """The unique identifier of the AgentCore Runtime.""" - - endpoint_name: str | None = field(repr=False, default=None) - """The name of the AgentCore Runtime endpoint.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_AGENT_RUNTIME_ENDPOINT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_AGENT_RUNTIME_ENDPOINT_OUTPUT.members["targetVersion"], - self.target_version, - ) - serializer.write_string( - _SCHEMA_CREATE_AGENT_RUNTIME_ENDPOINT_OUTPUT.members[ - "agentRuntimeEndpointArn" - ], - self.agent_runtime_endpoint_arn, - ) - serializer.write_string( - _SCHEMA_CREATE_AGENT_RUNTIME_ENDPOINT_OUTPUT.members["agentRuntimeArn"], - self.agent_runtime_arn, - ) - if self.agent_runtime_id is not None: - serializer.write_string( - _SCHEMA_CREATE_AGENT_RUNTIME_ENDPOINT_OUTPUT.members["agentRuntimeId"], - self.agent_runtime_id, - ) - - if self.endpoint_name is not None: - serializer.write_string( - _SCHEMA_CREATE_AGENT_RUNTIME_ENDPOINT_OUTPUT.members["endpointName"], - self.endpoint_name, - ) - - serializer.write_string( - _SCHEMA_CREATE_AGENT_RUNTIME_ENDPOINT_OUTPUT.members["status"], self.status - ) - serializer.write_timestamp( - _SCHEMA_CREATE_AGENT_RUNTIME_ENDPOINT_OUTPUT.members["createdAt"], - self.created_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["target_version"] = de.read_string( - _SCHEMA_CREATE_AGENT_RUNTIME_ENDPOINT_OUTPUT.members[ - "targetVersion" - ] - ) - - case 1: - kwargs["agent_runtime_endpoint_arn"] = de.read_string( - _SCHEMA_CREATE_AGENT_RUNTIME_ENDPOINT_OUTPUT.members[ - "agentRuntimeEndpointArn" - ] - ) - - case 2: - kwargs["agent_runtime_arn"] = de.read_string( - _SCHEMA_CREATE_AGENT_RUNTIME_ENDPOINT_OUTPUT.members[ - "agentRuntimeArn" - ] - ) - - case 3: - kwargs["agent_runtime_id"] = de.read_string( - _SCHEMA_CREATE_AGENT_RUNTIME_ENDPOINT_OUTPUT.members[ - "agentRuntimeId" - ] - ) - - case 4: - kwargs["endpoint_name"] = de.read_string( - _SCHEMA_CREATE_AGENT_RUNTIME_ENDPOINT_OUTPUT.members[ - "endpointName" - ] - ) - - case 5: - kwargs["status"] = AgentRuntimeEndpointStatus( - de.read_string( - _SCHEMA_CREATE_AGENT_RUNTIME_ENDPOINT_OUTPUT.members[ - "status" - ] - ) - ) - - case 6: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_CREATE_AGENT_RUNTIME_ENDPOINT_OUTPUT.members[ - "createdAt" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_AGENT_RUNTIME_ENDPOINT_OUTPUT, consumer=_consumer - ) - if "target_version" not in kwargs: - kwargs["target_version"] = "" - if "agent_runtime_endpoint_arn" not in kwargs: - kwargs["agent_runtime_endpoint_arn"] = "" - if "agent_runtime_arn" not in kwargs: - kwargs["agent_runtime_arn"] = "" - if "status" not in kwargs: - kwargs["status"] = AgentRuntimeEndpointStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -CREATE_AGENT_RUNTIME_ENDPOINT = APIOperation( - input=CreateAgentRuntimeEndpointInput, - output=CreateAgentRuntimeEndpointOutput, - schema=_SCHEMA_CREATE_AGENT_RUNTIME_ENDPOINT, - input_schema=_SCHEMA_CREATE_AGENT_RUNTIME_ENDPOINT_INPUT, - output_schema=_SCHEMA_CREATE_AGENT_RUNTIME_ENDPOINT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteAgentRuntimeEndpointInput: - """Dataclass for DeleteAgentRuntimeEndpointInput structure.""" - - agent_runtime_id: str | None = None - """ - The unique identifier of the AgentCore Runtime associated with the - endpoint. - """ - - endpoint_name: str | None = field(repr=False, default=None) - """The name of the AgentCore Runtime endpoint to delete.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure idempotency of the - request. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_AGENT_RUNTIME_ENDPOINT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.agent_runtime_id is not None: - serializer.write_string( - _SCHEMA_DELETE_AGENT_RUNTIME_ENDPOINT_INPUT.members["agentRuntimeId"], - self.agent_runtime_id, - ) - - if self.endpoint_name is not None: - serializer.write_string( - _SCHEMA_DELETE_AGENT_RUNTIME_ENDPOINT_INPUT.members["endpointName"], - self.endpoint_name, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_DELETE_AGENT_RUNTIME_ENDPOINT_INPUT.members["clientToken"], - self.client_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_runtime_id"] = de.read_string( - _SCHEMA_DELETE_AGENT_RUNTIME_ENDPOINT_INPUT.members[ - "agentRuntimeId" - ] - ) - - case 1: - kwargs["endpoint_name"] = de.read_string( - _SCHEMA_DELETE_AGENT_RUNTIME_ENDPOINT_INPUT.members[ - "endpointName" - ] - ) - - case 2: - kwargs["client_token"] = de.read_string( - _SCHEMA_DELETE_AGENT_RUNTIME_ENDPOINT_INPUT.members[ - "clientToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_AGENT_RUNTIME_ENDPOINT_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteAgentRuntimeEndpointOutput: - """Dataclass for DeleteAgentRuntimeEndpointOutput structure.""" - - status: str - """The current status of the AgentCore Runtime endpoint deletion.""" - - agent_runtime_id: str | None = None - """The unique identifier of the AgentCore Runtime.""" - - endpoint_name: str | None = field(repr=False, default=None) - """The name of the AgentCore Runtime endpoint.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_AGENT_RUNTIME_ENDPOINT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DELETE_AGENT_RUNTIME_ENDPOINT_OUTPUT.members["status"], self.status - ) - if self.agent_runtime_id is not None: - serializer.write_string( - _SCHEMA_DELETE_AGENT_RUNTIME_ENDPOINT_OUTPUT.members["agentRuntimeId"], - self.agent_runtime_id, - ) - - if self.endpoint_name is not None: - serializer.write_string( - _SCHEMA_DELETE_AGENT_RUNTIME_ENDPOINT_OUTPUT.members["endpointName"], - self.endpoint_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["status"] = AgentRuntimeEndpointStatus( - de.read_string( - _SCHEMA_DELETE_AGENT_RUNTIME_ENDPOINT_OUTPUT.members[ - "status" - ] - ) - ) - - case 1: - kwargs["agent_runtime_id"] = de.read_string( - _SCHEMA_DELETE_AGENT_RUNTIME_ENDPOINT_OUTPUT.members[ - "agentRuntimeId" - ] - ) - - case 2: - kwargs["endpoint_name"] = de.read_string( - _SCHEMA_DELETE_AGENT_RUNTIME_ENDPOINT_OUTPUT.members[ - "endpointName" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_AGENT_RUNTIME_ENDPOINT_OUTPUT, consumer=_consumer - ) - if "status" not in kwargs: - kwargs["status"] = AgentRuntimeEndpointStatus._corrected("") - return kwargs - - -DELETE_AGENT_RUNTIME_ENDPOINT = APIOperation( - input=DeleteAgentRuntimeEndpointInput, - output=DeleteAgentRuntimeEndpointOutput, - schema=_SCHEMA_DELETE_AGENT_RUNTIME_ENDPOINT, - input_schema=_SCHEMA_DELETE_AGENT_RUNTIME_ENDPOINT_INPUT, - output_schema=_SCHEMA_DELETE_AGENT_RUNTIME_ENDPOINT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetAgentRuntimeEndpointInput: - """Dataclass for GetAgentRuntimeEndpointInput structure.""" - - agent_runtime_id: str | None = None - """ - The unique identifier of the AgentCore Runtime associated with the - endpoint. - """ - - endpoint_name: str | None = field(repr=False, default=None) - """The name of the AgentCore Runtime endpoint to retrieve.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_AGENT_RUNTIME_ENDPOINT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.agent_runtime_id is not None: - serializer.write_string( - _SCHEMA_GET_AGENT_RUNTIME_ENDPOINT_INPUT.members["agentRuntimeId"], - self.agent_runtime_id, - ) - - if self.endpoint_name is not None: - serializer.write_string( - _SCHEMA_GET_AGENT_RUNTIME_ENDPOINT_INPUT.members["endpointName"], - self.endpoint_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_runtime_id"] = de.read_string( - _SCHEMA_GET_AGENT_RUNTIME_ENDPOINT_INPUT.members[ - "agentRuntimeId" - ] - ) - - case 1: - kwargs["endpoint_name"] = de.read_string( - _SCHEMA_GET_AGENT_RUNTIME_ENDPOINT_INPUT.members["endpointName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_AGENT_RUNTIME_ENDPOINT_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetAgentRuntimeEndpointOutput: - """Dataclass for GetAgentRuntimeEndpointOutput structure.""" - - agent_runtime_endpoint_arn: str - """The Amazon Resource Name (ARN) of the AgentCore Runtime endpoint.""" - - agent_runtime_arn: str - """The Amazon Resource Name (ARN) of the AgentCore Runtime.""" - - status: str - """The current status of the AgentCore Runtime endpoint.""" - - created_at: datetime - """The timestamp when the AgentCore Runtime endpoint was created.""" - - last_updated_at: datetime - """The timestamp when the AgentCore Runtime endpoint was last updated.""" - - name: str = field(repr=False) - """The name of the AgentCore Runtime endpoint.""" - - id: str - """The unique identifier of the AgentCore Runtime endpoint.""" - - live_version: str | None = None - """The currently deployed version of the AgentCore Runtime on the endpoint.""" - - target_version: str | None = None - """The target version of the AgentCore Runtime for the endpoint.""" - - description: str | None = None - """The description of the AgentCore Runtime endpoint.""" - - failure_reason: str | None = None - """ - The reason for failure if the AgentCore Runtime endpoint is in a failed - state. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_AGENT_RUNTIME_ENDPOINT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.live_version is not None: - serializer.write_string( - _SCHEMA_GET_AGENT_RUNTIME_ENDPOINT_OUTPUT.members["liveVersion"], - self.live_version, - ) - - if self.target_version is not None: - serializer.write_string( - _SCHEMA_GET_AGENT_RUNTIME_ENDPOINT_OUTPUT.members["targetVersion"], - self.target_version, - ) - - serializer.write_string( - _SCHEMA_GET_AGENT_RUNTIME_ENDPOINT_OUTPUT.members[ - "agentRuntimeEndpointArn" - ], - self.agent_runtime_endpoint_arn, - ) - serializer.write_string( - _SCHEMA_GET_AGENT_RUNTIME_ENDPOINT_OUTPUT.members["agentRuntimeArn"], - self.agent_runtime_arn, - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_AGENT_RUNTIME_ENDPOINT_OUTPUT.members["description"], - self.description, - ) - - serializer.write_string( - _SCHEMA_GET_AGENT_RUNTIME_ENDPOINT_OUTPUT.members["status"], self.status - ) - serializer.write_timestamp( - _SCHEMA_GET_AGENT_RUNTIME_ENDPOINT_OUTPUT.members["createdAt"], - self.created_at, - ) - serializer.write_timestamp( - _SCHEMA_GET_AGENT_RUNTIME_ENDPOINT_OUTPUT.members["lastUpdatedAt"], - self.last_updated_at, - ) - if self.failure_reason is not None: - serializer.write_string( - _SCHEMA_GET_AGENT_RUNTIME_ENDPOINT_OUTPUT.members["failureReason"], - self.failure_reason, - ) - - serializer.write_string( - _SCHEMA_GET_AGENT_RUNTIME_ENDPOINT_OUTPUT.members["name"], self.name - ) - serializer.write_string( - _SCHEMA_GET_AGENT_RUNTIME_ENDPOINT_OUTPUT.members["id"], self.id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["live_version"] = de.read_string( - _SCHEMA_GET_AGENT_RUNTIME_ENDPOINT_OUTPUT.members["liveVersion"] - ) - - case 1: - kwargs["target_version"] = de.read_string( - _SCHEMA_GET_AGENT_RUNTIME_ENDPOINT_OUTPUT.members[ - "targetVersion" - ] - ) - - case 2: - kwargs["agent_runtime_endpoint_arn"] = de.read_string( - _SCHEMA_GET_AGENT_RUNTIME_ENDPOINT_OUTPUT.members[ - "agentRuntimeEndpointArn" - ] - ) - - case 3: - kwargs["agent_runtime_arn"] = de.read_string( - _SCHEMA_GET_AGENT_RUNTIME_ENDPOINT_OUTPUT.members[ - "agentRuntimeArn" - ] - ) - - case 4: - kwargs["description"] = de.read_string( - _SCHEMA_GET_AGENT_RUNTIME_ENDPOINT_OUTPUT.members["description"] - ) - - case 5: - kwargs["status"] = AgentRuntimeEndpointStatus( - de.read_string( - _SCHEMA_GET_AGENT_RUNTIME_ENDPOINT_OUTPUT.members["status"] - ) - ) - - case 6: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_AGENT_RUNTIME_ENDPOINT_OUTPUT.members["createdAt"] - ) - - case 7: - kwargs["last_updated_at"] = de.read_timestamp( - _SCHEMA_GET_AGENT_RUNTIME_ENDPOINT_OUTPUT.members[ - "lastUpdatedAt" - ] - ) - - case 8: - kwargs["failure_reason"] = de.read_string( - _SCHEMA_GET_AGENT_RUNTIME_ENDPOINT_OUTPUT.members[ - "failureReason" - ] - ) - - case 9: - kwargs["name"] = de.read_string( - _SCHEMA_GET_AGENT_RUNTIME_ENDPOINT_OUTPUT.members["name"] - ) - - case 10: - kwargs["id"] = de.read_string( - _SCHEMA_GET_AGENT_RUNTIME_ENDPOINT_OUTPUT.members["id"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_AGENT_RUNTIME_ENDPOINT_OUTPUT, consumer=_consumer - ) - if "agent_runtime_endpoint_arn" not in kwargs: - kwargs["agent_runtime_endpoint_arn"] = "" - if "agent_runtime_arn" not in kwargs: - kwargs["agent_runtime_arn"] = "" - if "status" not in kwargs: - kwargs["status"] = AgentRuntimeEndpointStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "last_updated_at" not in kwargs: - kwargs["last_updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "name" not in kwargs: - kwargs["name"] = "" - if "id" not in kwargs: - kwargs["id"] = "" - return kwargs - - -GET_AGENT_RUNTIME_ENDPOINT = APIOperation( - input=GetAgentRuntimeEndpointInput, - output=GetAgentRuntimeEndpointOutput, - schema=_SCHEMA_GET_AGENT_RUNTIME_ENDPOINT, - input_schema=_SCHEMA_GET_AGENT_RUNTIME_ENDPOINT_INPUT, - output_schema=_SCHEMA_GET_AGENT_RUNTIME_ENDPOINT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListAgentRuntimeEndpointsInput: - """Dataclass for ListAgentRuntimeEndpointsInput structure.""" - - agent_runtime_id: str | None = None - """The unique identifier of the AgentCore Runtime to list endpoints for.""" - - max_results: int | None = None - """The maximum number of results to return in the response.""" - - next_token: str | None = None - """A token to retrieve the next page of results.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_AGENT_RUNTIME_ENDPOINTS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.agent_runtime_id is not None: - serializer.write_string( - _SCHEMA_LIST_AGENT_RUNTIME_ENDPOINTS_INPUT.members["agentRuntimeId"], - self.agent_runtime_id, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_AGENT_RUNTIME_ENDPOINTS_INPUT.members["maxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_AGENT_RUNTIME_ENDPOINTS_INPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_runtime_id"] = de.read_string( - _SCHEMA_LIST_AGENT_RUNTIME_ENDPOINTS_INPUT.members[ - "agentRuntimeId" - ] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_AGENT_RUNTIME_ENDPOINTS_INPUT.members["maxResults"] - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_AGENT_RUNTIME_ENDPOINTS_INPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_AGENT_RUNTIME_ENDPOINTS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class AgentRuntimeEndpoint: - """ - Contains information about an agent runtime endpoint. An endpoint - provides a way to connect to and interact with an agent runtime. - """ - - name: str = field(repr=False) - """The name of the agent runtime endpoint.""" - - agent_runtime_endpoint_arn: str - """The Amazon Resource Name (ARN) of the agent runtime endpoint.""" - - agent_runtime_arn: str - """ - The Amazon Resource Name (ARN) of the agent runtime associated with the - endpoint. - """ - - status: str - """The current status of the agent runtime endpoint.""" - - id: str - """The unique identifier of the agent runtime endpoint.""" - - created_at: datetime - """The timestamp when the agent runtime endpoint was created.""" - - last_updated_at: datetime - """The timestamp when the agent runtime endpoint was last updated.""" - - live_version: str | None = None - """ - The live version of the agent runtime endpoint. This is the version that - is currently serving requests. - """ - - target_version: str | None = None - """ - The target version of the agent runtime endpoint. This is the version - that the endpoint is being updated to. - """ - - description: str | None = None - """The description of the agent runtime endpoint.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENT_RUNTIME_ENDPOINT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AGENT_RUNTIME_ENDPOINT.members["name"], self.name - ) - if self.live_version is not None: - serializer.write_string( - _SCHEMA_AGENT_RUNTIME_ENDPOINT.members["liveVersion"], self.live_version - ) - - if self.target_version is not None: - serializer.write_string( - _SCHEMA_AGENT_RUNTIME_ENDPOINT.members["targetVersion"], - self.target_version, - ) - - serializer.write_string( - _SCHEMA_AGENT_RUNTIME_ENDPOINT.members["agentRuntimeEndpointArn"], - self.agent_runtime_endpoint_arn, - ) - serializer.write_string( - _SCHEMA_AGENT_RUNTIME_ENDPOINT.members["agentRuntimeArn"], - self.agent_runtime_arn, - ) - serializer.write_string( - _SCHEMA_AGENT_RUNTIME_ENDPOINT.members["status"], self.status - ) - serializer.write_string(_SCHEMA_AGENT_RUNTIME_ENDPOINT.members["id"], self.id) - if self.description is not None: - serializer.write_string( - _SCHEMA_AGENT_RUNTIME_ENDPOINT.members["description"], self.description - ) - - serializer.write_timestamp( - _SCHEMA_AGENT_RUNTIME_ENDPOINT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_AGENT_RUNTIME_ENDPOINT.members["lastUpdatedAt"], - self.last_updated_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_AGENT_RUNTIME_ENDPOINT.members["name"] - ) - - case 1: - kwargs["live_version"] = de.read_string( - _SCHEMA_AGENT_RUNTIME_ENDPOINT.members["liveVersion"] - ) - - case 2: - kwargs["target_version"] = de.read_string( - _SCHEMA_AGENT_RUNTIME_ENDPOINT.members["targetVersion"] - ) - - case 3: - kwargs["agent_runtime_endpoint_arn"] = de.read_string( - _SCHEMA_AGENT_RUNTIME_ENDPOINT.members[ - "agentRuntimeEndpointArn" - ] - ) - - case 4: - kwargs["agent_runtime_arn"] = de.read_string( - _SCHEMA_AGENT_RUNTIME_ENDPOINT.members["agentRuntimeArn"] - ) - - case 5: - kwargs["status"] = AgentRuntimeEndpointStatus( - de.read_string(_SCHEMA_AGENT_RUNTIME_ENDPOINT.members["status"]) - ) - - case 6: - kwargs["id"] = de.read_string( - _SCHEMA_AGENT_RUNTIME_ENDPOINT.members["id"] - ) - - case 7: - kwargs["description"] = de.read_string( - _SCHEMA_AGENT_RUNTIME_ENDPOINT.members["description"] - ) - - case 8: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_AGENT_RUNTIME_ENDPOINT.members["createdAt"] - ) - - case 9: - kwargs["last_updated_at"] = de.read_timestamp( - _SCHEMA_AGENT_RUNTIME_ENDPOINT.members["lastUpdatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AGENT_RUNTIME_ENDPOINT, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "agent_runtime_endpoint_arn" not in kwargs: - kwargs["agent_runtime_endpoint_arn"] = "" - if "agent_runtime_arn" not in kwargs: - kwargs["agent_runtime_arn"] = "" - if "status" not in kwargs: - kwargs["status"] = AgentRuntimeEndpointStatus._corrected("") - if "id" not in kwargs: - kwargs["id"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "last_updated_at" not in kwargs: - kwargs["last_updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_agent_runtime_endpoints( - serializer: ShapeSerializer, schema: Schema, value: list[AgentRuntimeEndpoint] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_agent_runtime_endpoints( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AgentRuntimeEndpoint]: - result: list[AgentRuntimeEndpoint] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AgentRuntimeEndpoint.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListAgentRuntimeEndpointsOutput: - """Dataclass for ListAgentRuntimeEndpointsOutput structure.""" - - runtime_endpoints: list[AgentRuntimeEndpoint] - """The list of AgentCore Runtime endpoints.""" - - next_token: str | None = None - """A token to retrieve the next page of results.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_AGENT_RUNTIME_ENDPOINTS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_agent_runtime_endpoints( - serializer, - _SCHEMA_LIST_AGENT_RUNTIME_ENDPOINTS_OUTPUT.members["runtimeEndpoints"], - self.runtime_endpoints, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_AGENT_RUNTIME_ENDPOINTS_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["runtime_endpoints"] = _deserialize_agent_runtime_endpoints( - de, - _SCHEMA_LIST_AGENT_RUNTIME_ENDPOINTS_OUTPUT.members[ - "runtimeEndpoints" - ], - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_AGENT_RUNTIME_ENDPOINTS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_AGENT_RUNTIME_ENDPOINTS_OUTPUT, consumer=_consumer - ) - if "runtime_endpoints" not in kwargs: - kwargs["runtime_endpoints"] = [] - return kwargs - - -LIST_AGENT_RUNTIME_ENDPOINTS = APIOperation( - input=ListAgentRuntimeEndpointsInput, - output=ListAgentRuntimeEndpointsOutput, - schema=_SCHEMA_LIST_AGENT_RUNTIME_ENDPOINTS, - input_schema=_SCHEMA_LIST_AGENT_RUNTIME_ENDPOINTS_INPUT, - output_schema=_SCHEMA_LIST_AGENT_RUNTIME_ENDPOINTS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateAgentRuntimeEndpointInput: - """Dataclass for UpdateAgentRuntimeEndpointInput structure.""" - - agent_runtime_id: str | None = None - """ - The unique identifier of the AgentCore Runtime associated with the - endpoint. - """ - - endpoint_name: str | None = field(repr=False, default=None) - """The name of the AgentCore Runtime endpoint to update.""" - - agent_runtime_version: str | None = None - """The updated version of the AgentCore Runtime for the endpoint.""" - - description: str | None = None - """The updated description of the AgentCore Runtime endpoint.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure idempotency of the - request. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_AGENT_RUNTIME_ENDPOINT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.agent_runtime_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_AGENT_RUNTIME_ENDPOINT_INPUT.members["agentRuntimeId"], - self.agent_runtime_id, - ) - - if self.endpoint_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_AGENT_RUNTIME_ENDPOINT_INPUT.members["endpointName"], - self.endpoint_name, - ) - - if self.agent_runtime_version is not None: - serializer.write_string( - _SCHEMA_UPDATE_AGENT_RUNTIME_ENDPOINT_INPUT.members[ - "agentRuntimeVersion" - ], - self.agent_runtime_version, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_AGENT_RUNTIME_ENDPOINT_INPUT.members["description"], - self.description, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_UPDATE_AGENT_RUNTIME_ENDPOINT_INPUT.members["clientToken"], - self.client_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_runtime_id"] = de.read_string( - _SCHEMA_UPDATE_AGENT_RUNTIME_ENDPOINT_INPUT.members[ - "agentRuntimeId" - ] - ) - - case 1: - kwargs["endpoint_name"] = de.read_string( - _SCHEMA_UPDATE_AGENT_RUNTIME_ENDPOINT_INPUT.members[ - "endpointName" - ] - ) - - case 2: - kwargs["agent_runtime_version"] = de.read_string( - _SCHEMA_UPDATE_AGENT_RUNTIME_ENDPOINT_INPUT.members[ - "agentRuntimeVersion" - ] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_AGENT_RUNTIME_ENDPOINT_INPUT.members[ - "description" - ] - ) - - case 4: - kwargs["client_token"] = de.read_string( - _SCHEMA_UPDATE_AGENT_RUNTIME_ENDPOINT_INPUT.members[ - "clientToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_AGENT_RUNTIME_ENDPOINT_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateAgentRuntimeEndpointOutput: - """Dataclass for UpdateAgentRuntimeEndpointOutput structure.""" - - agent_runtime_endpoint_arn: str - """The Amazon Resource Name (ARN) of the AgentCore Runtime endpoint.""" - - agent_runtime_arn: str - """The Amazon Resource Name (ARN) of the AgentCore Runtime.""" - - status: str - """The current status of the updated AgentCore Runtime endpoint.""" - - created_at: datetime - """The timestamp when the AgentCore Runtime endpoint was created.""" - - last_updated_at: datetime - """The timestamp when the AgentCore Runtime endpoint was last updated.""" - - live_version: str | None = None - """The currently deployed version of the AgentCore Runtime on the endpoint.""" - - target_version: str | None = None - """The target version of the AgentCore Runtime for the endpoint.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_AGENT_RUNTIME_ENDPOINT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.live_version is not None: - serializer.write_string( - _SCHEMA_UPDATE_AGENT_RUNTIME_ENDPOINT_OUTPUT.members["liveVersion"], - self.live_version, - ) - - if self.target_version is not None: - serializer.write_string( - _SCHEMA_UPDATE_AGENT_RUNTIME_ENDPOINT_OUTPUT.members["targetVersion"], - self.target_version, - ) - - serializer.write_string( - _SCHEMA_UPDATE_AGENT_RUNTIME_ENDPOINT_OUTPUT.members[ - "agentRuntimeEndpointArn" - ], - self.agent_runtime_endpoint_arn, - ) - serializer.write_string( - _SCHEMA_UPDATE_AGENT_RUNTIME_ENDPOINT_OUTPUT.members["agentRuntimeArn"], - self.agent_runtime_arn, - ) - serializer.write_string( - _SCHEMA_UPDATE_AGENT_RUNTIME_ENDPOINT_OUTPUT.members["status"], self.status - ) - serializer.write_timestamp( - _SCHEMA_UPDATE_AGENT_RUNTIME_ENDPOINT_OUTPUT.members["createdAt"], - self.created_at, - ) - serializer.write_timestamp( - _SCHEMA_UPDATE_AGENT_RUNTIME_ENDPOINT_OUTPUT.members["lastUpdatedAt"], - self.last_updated_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["live_version"] = de.read_string( - _SCHEMA_UPDATE_AGENT_RUNTIME_ENDPOINT_OUTPUT.members[ - "liveVersion" - ] - ) - - case 1: - kwargs["target_version"] = de.read_string( - _SCHEMA_UPDATE_AGENT_RUNTIME_ENDPOINT_OUTPUT.members[ - "targetVersion" - ] - ) - - case 2: - kwargs["agent_runtime_endpoint_arn"] = de.read_string( - _SCHEMA_UPDATE_AGENT_RUNTIME_ENDPOINT_OUTPUT.members[ - "agentRuntimeEndpointArn" - ] - ) - - case 3: - kwargs["agent_runtime_arn"] = de.read_string( - _SCHEMA_UPDATE_AGENT_RUNTIME_ENDPOINT_OUTPUT.members[ - "agentRuntimeArn" - ] - ) - - case 4: - kwargs["status"] = AgentRuntimeEndpointStatus( - de.read_string( - _SCHEMA_UPDATE_AGENT_RUNTIME_ENDPOINT_OUTPUT.members[ - "status" - ] - ) - ) - - case 5: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_UPDATE_AGENT_RUNTIME_ENDPOINT_OUTPUT.members[ - "createdAt" - ] - ) - - case 6: - kwargs["last_updated_at"] = de.read_timestamp( - _SCHEMA_UPDATE_AGENT_RUNTIME_ENDPOINT_OUTPUT.members[ - "lastUpdatedAt" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_AGENT_RUNTIME_ENDPOINT_OUTPUT, consumer=_consumer - ) - if "agent_runtime_endpoint_arn" not in kwargs: - kwargs["agent_runtime_endpoint_arn"] = "" - if "agent_runtime_arn" not in kwargs: - kwargs["agent_runtime_arn"] = "" - if "status" not in kwargs: - kwargs["status"] = AgentRuntimeEndpointStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "last_updated_at" not in kwargs: - kwargs["last_updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -UPDATE_AGENT_RUNTIME_ENDPOINT = APIOperation( - input=UpdateAgentRuntimeEndpointInput, - output=UpdateAgentRuntimeEndpointOutput, - schema=_SCHEMA_UPDATE_AGENT_RUNTIME_ENDPOINT, - input_schema=_SCHEMA_UPDATE_AGENT_RUNTIME_ENDPOINT_INPUT, - output_schema=_SCHEMA_UPDATE_AGENT_RUNTIME_ENDPOINT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class AgentManagedRuntimeType(UnknownEnumMixin, StrEnum): - PYTHON_3_10 = "PYTHON_3_10" - PYTHON_3_11 = "PYTHON_3_11" - PYTHON_3_12 = "PYTHON_3_12" - PYTHON_3_13 = "PYTHON_3_13" - PYTHON_3_14 = "PYTHON_3_14" - NODE_22 = "NODE_22" - - -@dataclass(kw_only=True) -class S3Location: - """ - The Amazon S3 location for storing data. This structure defines where in - Amazon S3 data is stored. - """ - - bucket: str - """The name of the Amazon S3 bucket. This bucket contains the stored data.""" - - prefix: str - """ - The prefix for objects in the Amazon S3 bucket. This prefix is added to - the object keys to organize the data. - """ - - version_id: str | None = None - """ - The version ID of the Amazon Amazon S3 object. If not specified, the - latest version of the object is used. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_S3_LOCATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_S3_LOCATION.members["bucket"], self.bucket) - serializer.write_string(_SCHEMA_S3_LOCATION.members["prefix"], self.prefix) - if self.version_id is not None: - serializer.write_string( - _SCHEMA_S3_LOCATION.members["versionId"], self.version_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bucket"] = de.read_string( - _SCHEMA_S3_LOCATION.members["bucket"] - ) - - case 1: - kwargs["prefix"] = de.read_string( - _SCHEMA_S3_LOCATION.members["prefix"] - ) - - case 2: - kwargs["version_id"] = de.read_string( - _SCHEMA_S3_LOCATION.members["versionId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_S3_LOCATION, consumer=_consumer) - if "bucket" not in kwargs: - kwargs["bucket"] = "" - if "prefix" not in kwargs: - kwargs["prefix"] = "" - return kwargs - - -@dataclass -class CodeS3: - """ - The Amazon Amazon S3 object that contains the source code for the agent - runtime. - """ - - value: S3Location - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CODE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CODE.members["s3"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=S3Location.deserialize(deserializer)) - - -@dataclass -class CodeUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -Code = Union[CodeS3 | CodeUnknown] -""" -The source code configuration that specifies the location and details of -the code to be executed. -""" - - -class _CodeDeserializer: - _result: Code | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> Code: - self._result = None - deserializer.read_struct(_SCHEMA_CODE, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(CodeS3.deserialize(de)) - - case _: - self._set_result(CodeUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: Code) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_entry_points( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_entry_points( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CodeConfiguration: - """ - The configuration for the source code that defines how the agent runtime - code should be executed, including the code location, runtime - environment, and entry point. - """ - - code: Code - """The source code location and configuration details.""" - - runtime: str - """ - The runtime environment for executing the agent code. Specify the - programming language and version to use for the agent runtime. For valid - values, see the list of supported runtimes. - """ - - entry_point: list[str] - """ - The entry point for the code execution, specifying the function or - method that should be invoked when the code runs. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CODE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CODE_CONFIGURATION.members["code"], self.code) - serializer.write_string( - _SCHEMA_CODE_CONFIGURATION.members["runtime"], self.runtime - ) - _serialize_entry_points( - serializer, - _SCHEMA_CODE_CONFIGURATION.members["entryPoint"], - self.entry_point, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["code"] = _CodeDeserializer().deserialize(de) - - case 1: - kwargs["runtime"] = AgentManagedRuntimeType( - de.read_string(_SCHEMA_CODE_CONFIGURATION.members["runtime"]) - ) - - case 2: - kwargs["entry_point"] = _deserialize_entry_points( - de, _SCHEMA_CODE_CONFIGURATION.members["entryPoint"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CODE_CONFIGURATION, consumer=_consumer) - if "code" not in kwargs: - kwargs["code"] = CodeUnknown(tag="") - if "runtime" not in kwargs: - kwargs["runtime"] = AgentManagedRuntimeType._corrected("") - if "entry_point" not in kwargs: - kwargs["entry_point"] = [] - return kwargs - - -@dataclass(kw_only=True) -class ContainerConfiguration: - """Representation of a container configuration.""" - - container_uri: str - """The ECR URI of the container.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTAINER_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CONTAINER_CONFIGURATION.members["containerUri"], self.container_uri - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["container_uri"] = de.read_string( - _SCHEMA_CONTAINER_CONFIGURATION.members["containerUri"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONTAINER_CONFIGURATION, consumer=_consumer) - if "container_uri" not in kwargs: - kwargs["container_uri"] = "" - return kwargs - - -@dataclass -class AgentRuntimeArtifactContainerConfiguration: - """The container configuration for the agent artifact.""" - - value: ContainerConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENT_RUNTIME_ARTIFACT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AGENT_RUNTIME_ARTIFACT.members["containerConfiguration"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ContainerConfiguration.deserialize(deserializer)) - - -@dataclass -class AgentRuntimeArtifactCodeConfiguration: - """ - The code configuration for the agent runtime artifact, including the - source code location and execution settings. - """ - - value: CodeConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENT_RUNTIME_ARTIFACT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AGENT_RUNTIME_ARTIFACT.members["codeConfiguration"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=CodeConfiguration.deserialize(deserializer)) - - -@dataclass -class AgentRuntimeArtifactUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -AgentRuntimeArtifact = Union[ - AgentRuntimeArtifactContainerConfiguration - | AgentRuntimeArtifactCodeConfiguration - | AgentRuntimeArtifactUnknown -] -"""The artifact of the agent.""" - - -class _AgentRuntimeArtifactDeserializer: - _result: AgentRuntimeArtifact | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> AgentRuntimeArtifact: - self._result = None - deserializer.read_struct(_SCHEMA_AGENT_RUNTIME_ARTIFACT, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - AgentRuntimeArtifactContainerConfiguration.deserialize(de) - ) - - case 1: - self._set_result(AgentRuntimeArtifactCodeConfiguration.deserialize(de)) - - case _: - self._set_result( - AgentRuntimeArtifactUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: AgentRuntimeArtifact) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_allowed_audience_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_allowed_audience_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_allowed_clients_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_allowed_clients_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_allowed_scopes_type( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_allowed_scopes_type( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class HostingEnvironment: - """ - A hosting environment whose workloads are allowed to invoke the target. - At launch, the only supported hosting environment is AgentCore Gateway. - """ - - arn: str - """The Amazon Resource Name (ARN) of the hosting environment.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HOSTING_ENVIRONMENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_HOSTING_ENVIRONMENT.members["arn"], self.arn) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["arn"] = de.read_string( - _SCHEMA_HOSTING_ENVIRONMENT.members["arn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_HOSTING_ENVIRONMENT, consumer=_consumer) - if "arn" not in kwargs: - kwargs["arn"] = "" - return kwargs - - -def _serialize_hosting_environment_list_type( - serializer: ShapeSerializer, schema: Schema, value: list[HostingEnvironment] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_hosting_environment_list_type( - deserializer: ShapeDeserializer, schema: Schema -) -> list[HostingEnvironment]: - result: list[HostingEnvironment] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(HostingEnvironment.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_workload_identity_name_list_type( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_workload_identity_name_list_type( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AllowedWorkloadConfiguration: - """ - The configuration that restricts which workloads in the request's - identity chain are allowed to invoke the target, identified by their - hosting environments and workload identities. At launch, this is - supported only for AgentCore Runtime targets, and the allowed workloads - are AgentCore Gateways. - """ - - hosting_environments: list[HostingEnvironment] | None = None - """ - The list of hosting environments whose workloads are allowed to invoke - the target. At launch, the only supported hosting environment is - AgentCore Gateway. - """ - - workload_identities: list[str] | None = None - """The list of workload identities that are allowed to invoke the target.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ALLOWED_WORKLOAD_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.hosting_environments is not None: - _serialize_hosting_environment_list_type( - serializer, - _SCHEMA_ALLOWED_WORKLOAD_CONFIGURATION.members["hostingEnvironments"], - self.hosting_environments, - ) - - if self.workload_identities is not None: - _serialize_workload_identity_name_list_type( - serializer, - _SCHEMA_ALLOWED_WORKLOAD_CONFIGURATION.members["workloadIdentities"], - self.workload_identities, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["hosting_environments"] = ( - _deserialize_hosting_environment_list_type( - de, - _SCHEMA_ALLOWED_WORKLOAD_CONFIGURATION.members[ - "hostingEnvironments" - ], - ) - ) - - case 1: - kwargs["workload_identities"] = ( - _deserialize_workload_identity_name_list_type( - de, - _SCHEMA_ALLOWED_WORKLOAD_CONFIGURATION.members[ - "workloadIdentities" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ALLOWED_WORKLOAD_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -class ClaimMatchOperatorType(UnknownEnumMixin, StrEnum): - EQUALS = "EQUALS" - CONTAINS = "CONTAINS" - CONTAINS_ANY = "CONTAINS_ANY" - - -def _serialize_match_value_string_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_match_value_string_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass -class ClaimMatchValueTypeMatchValueString: - """The string value to match for.""" - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CLAIM_MATCH_VALUE_TYPE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CLAIM_MATCH_VALUE_TYPE.members["matchValueString"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string( - _SCHEMA_CLAIM_MATCH_VALUE_TYPE.members["matchValueString"] - ) - ) - - -@dataclass -class ClaimMatchValueTypeMatchValueStringList: - """An array of strings to check for a match.""" - - value: list[str] - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CLAIM_MATCH_VALUE_TYPE, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_match_value_string_list( - serializer, - _SCHEMA_CLAIM_MATCH_VALUE_TYPE.members["matchValueStringList"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_deserialize_match_value_string_list( - deserializer, - _SCHEMA_CLAIM_MATCH_VALUE_TYPE.members["matchValueStringList"], - ) - ) - - -@dataclass -class ClaimMatchValueTypeUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ClaimMatchValueType = Union[ - ClaimMatchValueTypeMatchValueString - | ClaimMatchValueTypeMatchValueStringList - | ClaimMatchValueTypeUnknown -] -""" -The value or values to match for. - -- Include a `matchValueString` with the `EQUALS` operator to specify a - string that matches the claim field value. - -- Include a `matchValueArray` to specify an array of string values. You - can use the following operators: - - - Use `CONTAINS` to yield a match if the claim field value is in the - array. - - - Use `CONTAINS_ANY` to yield a match if the claim field value - contains any of the strings in the array. -""" - - -class _ClaimMatchValueTypeDeserializer: - _result: ClaimMatchValueType | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> ClaimMatchValueType: - self._result = None - deserializer.read_struct(_SCHEMA_CLAIM_MATCH_VALUE_TYPE, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(ClaimMatchValueTypeMatchValueString.deserialize(de)) - - case 1: - self._set_result( - ClaimMatchValueTypeMatchValueStringList.deserialize(de) - ) - - case _: - self._set_result( - ClaimMatchValueTypeUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: ClaimMatchValueType) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class AuthorizingClaimMatchValueType: - """ - Defines the value or values to match for and the relationship of the - match. - """ - - claim_match_value: ClaimMatchValueType - """The value or values to match for.""" - - claim_match_operator: str - """ - Defines the relationship between the claim field value and the value or - values you're matching for. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTHORIZING_CLAIM_MATCH_VALUE_TYPE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTHORIZING_CLAIM_MATCH_VALUE_TYPE.members["claimMatchValue"], - self.claim_match_value, - ) - serializer.write_string( - _SCHEMA_AUTHORIZING_CLAIM_MATCH_VALUE_TYPE.members["claimMatchOperator"], - self.claim_match_operator, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["claim_match_value"] = ( - _ClaimMatchValueTypeDeserializer().deserialize(de) - ) - - case 1: - kwargs["claim_match_operator"] = ClaimMatchOperatorType( - de.read_string( - _SCHEMA_AUTHORIZING_CLAIM_MATCH_VALUE_TYPE.members[ - "claimMatchOperator" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTHORIZING_CLAIM_MATCH_VALUE_TYPE, consumer=_consumer - ) - if "claim_match_value" not in kwargs: - kwargs["claim_match_value"] = ClaimMatchValueTypeUnknown(tag="") - if "claim_match_operator" not in kwargs: - kwargs["claim_match_operator"] = ClaimMatchOperatorType._corrected("") - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls( - claim_match_value=ClaimMatchValueTypeUnknown(tag=""), - claim_match_operator=ClaimMatchOperatorType._corrected(""), - ) - - -class InboundTokenClaimValueType(UnknownEnumMixin, StrEnum): - STRING = "STRING" - STRING_ARRAY = "STRING_ARRAY" - - -@dataclass(kw_only=True) -class CustomClaimValidationType: - """ - Defines the name of a custom claim field and rules for finding matches - to authenticate its value. - """ - - inbound_token_claim_name: str - """The name of the custom claim field to check.""" - - inbound_token_claim_value_type: str - """ - The data type of the claim value to check for. - - - Use `STRING` if you want to find an exact match to a string you - define. - - - Use `STRING_ARRAY` if you want to fnd a match to at least one value in - an array you define. - """ - - authorizing_claim_match_value: AuthorizingClaimMatchValueType - """ - Defines the value or values to match for and the relationship of the - match. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOM_CLAIM_VALIDATION_TYPE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CUSTOM_CLAIM_VALIDATION_TYPE.members["inboundTokenClaimName"], - self.inbound_token_claim_name, - ) - serializer.write_string( - _SCHEMA_CUSTOM_CLAIM_VALIDATION_TYPE.members["inboundTokenClaimValueType"], - self.inbound_token_claim_value_type, - ) - serializer.write_struct( - _SCHEMA_CUSTOM_CLAIM_VALIDATION_TYPE.members["authorizingClaimMatchValue"], - self.authorizing_claim_match_value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["inbound_token_claim_name"] = de.read_string( - _SCHEMA_CUSTOM_CLAIM_VALIDATION_TYPE.members[ - "inboundTokenClaimName" - ] - ) - - case 1: - kwargs["inbound_token_claim_value_type"] = ( - InboundTokenClaimValueType( - de.read_string( - _SCHEMA_CUSTOM_CLAIM_VALIDATION_TYPE.members[ - "inboundTokenClaimValueType" - ] - ) - ) - ) - - case 2: - kwargs["authorizing_claim_match_value"] = ( - AuthorizingClaimMatchValueType.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CUSTOM_CLAIM_VALIDATION_TYPE, consumer=_consumer - ) - if "inbound_token_claim_name" not in kwargs: - kwargs["inbound_token_claim_name"] = "" - if "inbound_token_claim_value_type" not in kwargs: - kwargs["inbound_token_claim_value_type"] = ( - InboundTokenClaimValueType._corrected("") - ) - if "authorizing_claim_match_value" not in kwargs: - kwargs["authorizing_claim_match_value"] = ( - AuthorizingClaimMatchValueType._smithy_default() - ) - return kwargs - - -def _serialize_custom_claim_validations_type( - serializer: ShapeSerializer, schema: Schema, value: list[CustomClaimValidationType] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_custom_claim_validations_type( - deserializer: ShapeDeserializer, schema: Schema -) -> list[CustomClaimValidationType]: - result: list[CustomClaimValidationType] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(CustomClaimValidationType.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class EndpointIpAddressType(UnknownEnumMixin, StrEnum): - IPV4 = "IPV4" - IPV6 = "IPV6" - - -def _serialize_security_group_ids( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_security_group_ids( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_subnet_ids( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_subnet_ids( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ManagedVpcResource: - """ - Configuration for a managed VPC Lattice resource. The gateway creates - and manages the VPC Lattice resource gateway and resource configuration - on your behalf using a service-linked role. - """ - - vpc_identifier: str - """The ID of the VPC that contains your private resource.""" - - subnet_ids: list[str] - """ - The subnet IDs within the VPC where the VPC Lattice resource gateway is - placed. - """ - - endpoint_ip_address_type: str - """The IP address type for the resource configuration endpoint.""" - - security_group_ids: list[str] | None = None - """ - The security group IDs to associate with the VPC Lattice resource - gateway. If not specified, the default security group for the VPC is - used. - """ - - tags: dict[str, str] | None = None - """Tags to apply to the managed VPC Lattice resource gateway.""" - - routing_domain: str | None = None - """ - An intermediate domain to use as the resource configuration endpoint - instead of the actual target domain. Use this when you want to route - traffic through an intermediate component such as a VPC endpoint or - internal load balancer. For more information, see - xref:lattice-vpc-egress-routing-domain[Route traffic through an - intermediate domain]. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MANAGED_VPC_RESOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MANAGED_VPC_RESOURCE.members["vpcIdentifier"], self.vpc_identifier - ) - _serialize_subnet_ids( - serializer, - _SCHEMA_MANAGED_VPC_RESOURCE.members["subnetIds"], - self.subnet_ids, - ) - serializer.write_string( - _SCHEMA_MANAGED_VPC_RESOURCE.members["endpointIpAddressType"], - self.endpoint_ip_address_type, - ) - if self.security_group_ids is not None: - _serialize_security_group_ids( - serializer, - _SCHEMA_MANAGED_VPC_RESOURCE.members["securityGroupIds"], - self.security_group_ids, - ) - - if self.tags is not None: - _serialize_tags_map( - serializer, _SCHEMA_MANAGED_VPC_RESOURCE.members["tags"], self.tags - ) - - if self.routing_domain is not None: - serializer.write_string( - _SCHEMA_MANAGED_VPC_RESOURCE.members["routingDomain"], - self.routing_domain, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["vpc_identifier"] = de.read_string( - _SCHEMA_MANAGED_VPC_RESOURCE.members["vpcIdentifier"] - ) - - case 1: - kwargs["subnet_ids"] = _deserialize_subnet_ids( - de, _SCHEMA_MANAGED_VPC_RESOURCE.members["subnetIds"] - ) - - case 2: - kwargs["endpoint_ip_address_type"] = EndpointIpAddressType( - de.read_string( - _SCHEMA_MANAGED_VPC_RESOURCE.members[ - "endpointIpAddressType" - ] - ) - ) - - case 3: - kwargs["security_group_ids"] = _deserialize_security_group_ids( - de, _SCHEMA_MANAGED_VPC_RESOURCE.members["securityGroupIds"] - ) - - case 4: - kwargs["tags"] = _deserialize_tags_map( - de, _SCHEMA_MANAGED_VPC_RESOURCE.members["tags"] - ) - - case 5: - kwargs["routing_domain"] = de.read_string( - _SCHEMA_MANAGED_VPC_RESOURCE.members["routingDomain"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MANAGED_VPC_RESOURCE, consumer=_consumer) - if "vpc_identifier" not in kwargs: - kwargs["vpc_identifier"] = "" - if "subnet_ids" not in kwargs: - kwargs["subnet_ids"] = [] - if "endpoint_ip_address_type" not in kwargs: - kwargs["endpoint_ip_address_type"] = EndpointIpAddressType._corrected("") - return kwargs - - -@dataclass -class SelfManagedLatticeResourceResourceConfigurationIdentifier: - """The ARN or ID of the VPC Lattice resource configuration.""" - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SELF_MANAGED_LATTICE_RESOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SELF_MANAGED_LATTICE_RESOURCE.members[ - "resourceConfigurationIdentifier" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string( - _SCHEMA_SELF_MANAGED_LATTICE_RESOURCE.members[ - "resourceConfigurationIdentifier" - ] - ) - ) - - -@dataclass -class SelfManagedLatticeResourceUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -SelfManagedLatticeResource = Union[ - SelfManagedLatticeResourceResourceConfigurationIdentifier - | SelfManagedLatticeResourceUnknown -] -""" -Configuration for a self-managed VPC Lattice resource. You create and -manage the VPC Lattice resource gateway and resource configuration, then -provide the resource configuration identifier. -""" - - -class _SelfManagedLatticeResourceDeserializer: - _result: SelfManagedLatticeResource | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> SelfManagedLatticeResource: - self._result = None - deserializer.read_struct(_SCHEMA_SELF_MANAGED_LATTICE_RESOURCE, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - SelfManagedLatticeResourceResourceConfigurationIdentifier.deserialize( - de - ) - ) - - case _: - self._set_result( - SelfManagedLatticeResourceUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: SelfManagedLatticeResource) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass -class PrivateEndpointSelfManagedLatticeResource: - """ - Configuration for connecting to a private resource using a self-managed - VPC Lattice resource configuration. - """ - - value: SelfManagedLatticeResource - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PRIVATE_ENDPOINT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_PRIVATE_ENDPOINT.members["selfManagedLatticeResource"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_SelfManagedLatticeResourceDeserializer().deserialize(deserializer) - ) - - -@dataclass -class PrivateEndpointManagedVpcResource: - """ - Configuration for connecting to a private resource using a managed VPC - Lattice resource. The gateway creates and manages the VPC Lattice - resources on your behalf. - """ - - value: ManagedVpcResource - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PRIVATE_ENDPOINT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_PRIVATE_ENDPOINT.members["managedVpcResource"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ManagedVpcResource.deserialize(deserializer)) - - -@dataclass -class PrivateEndpointUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -PrivateEndpoint = Union[ - PrivateEndpointSelfManagedLatticeResource - | PrivateEndpointManagedVpcResource - | PrivateEndpointUnknown -] -""" -The private endpoint configuration for a gateway target. Defines how the -gateway connects to private resources in your VPC. -""" - - -class _PrivateEndpointDeserializer: - _result: PrivateEndpoint | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> PrivateEndpoint: - self._result = None - deserializer.read_struct(_SCHEMA_PRIVATE_ENDPOINT, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - PrivateEndpointSelfManagedLatticeResource.deserialize(de) - ) - - case 1: - self._set_result(PrivateEndpointManagedVpcResource.deserialize(de)) - - case _: - self._set_result( - PrivateEndpointUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: PrivateEndpoint) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class PrivateEndpointOverride: - """ - A mapping of a specific domain to a private endpoint for secure - connectivity through a VPC Lattice resource configuration. - """ - - domain: str - """The domain to override with a private endpoint.""" - - private_endpoint: PrivateEndpoint - """The private endpoint configuration for the specified domain.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PRIVATE_ENDPOINT_OVERRIDE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_PRIVATE_ENDPOINT_OVERRIDE.members["domain"], self.domain - ) - serializer.write_struct( - _SCHEMA_PRIVATE_ENDPOINT_OVERRIDE.members["privateEndpoint"], - self.private_endpoint, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["domain"] = de.read_string( - _SCHEMA_PRIVATE_ENDPOINT_OVERRIDE.members["domain"] - ) - - case 1: - kwargs["private_endpoint"] = ( - _PrivateEndpointDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PRIVATE_ENDPOINT_OVERRIDE, consumer=_consumer) - if "domain" not in kwargs: - kwargs["domain"] = "" - if "private_endpoint" not in kwargs: - kwargs["private_endpoint"] = PrivateEndpointUnknown(tag="") - return kwargs - - -def _serialize_private_endpoint_overrides( - serializer: ShapeSerializer, schema: Schema, value: list[PrivateEndpointOverride] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_private_endpoint_overrides( - deserializer: ShapeDeserializer, schema: Schema -) -> list[PrivateEndpointOverride]: - result: list[PrivateEndpointOverride] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(PrivateEndpointOverride.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CustomJWTAuthorizerConfiguration: - """ - Configuration for inbound JWT-based authorization, specifying how - incoming requests should be authenticated. - """ - - discovery_url: str - """ - This URL is used to fetch OpenID Connect configuration or authorization - server metadata for validating incoming tokens. - """ - - allowed_audience: list[str] | None = None - """ - Represents individual audience values that are validated in the incoming - JWT token validation process. - """ - - allowed_clients: list[str] | None = None - """ - Represents individual client IDs that are validated in the incoming JWT - token validation process. - """ - - allowed_scopes: list[str] | None = None - """An array of scopes that are allowed to access the token.""" - - advertised_scope_mapping: dict[str, str] | None = None - """ - A map that associates each scope in `allowedScopes` with a corresponding - advertised scope value. The advertised scope appears in OAuth protected - resource metadata and `WWW-Authenticate` response headers. Use this - parameter when the scope that clients request from your identity - provider differs from the scope in the validated token. Each key is a - scope from `allowedScopes` that the service uses for token validation. - Each value is the corresponding scope that the service advertises to - clients. Scopes without a mapping entry appear unchanged to clients. - """ - - custom_claims: list[CustomClaimValidationType] | None = None - """ - An array of objects that define a custom claim validation name, value, - and operation - """ - - private_endpoint: PrivateEndpoint | None = None - """ - The private endpoint configuration for a gateway target. Defines how the - gateway connects to private resources in your VPC. - """ - - private_endpoint_overrides: list[PrivateEndpointOverride] | None = None - """ - The private endpoint overrides for the custom JWT authorizer - configuration. - """ - - allowed_workload_configuration: AllowedWorkloadConfiguration | None = None - """ - The configuration that restricts which workloads in the request's - identity chain are allowed to invoke the target, identified by their - hosting environments and workload identities. At launch, this is - supported only for AgentCore Runtime targets, and the allowed workloads - are AgentCore Gateways. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOM_JWT_AUTHORIZER_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CUSTOM_JWT_AUTHORIZER_CONFIGURATION.members["discoveryUrl"], - self.discovery_url, - ) - if self.allowed_audience is not None: - _serialize_allowed_audience_list( - serializer, - _SCHEMA_CUSTOM_JWT_AUTHORIZER_CONFIGURATION.members["allowedAudience"], - self.allowed_audience, - ) - - if self.allowed_clients is not None: - _serialize_allowed_clients_list( - serializer, - _SCHEMA_CUSTOM_JWT_AUTHORIZER_CONFIGURATION.members["allowedClients"], - self.allowed_clients, - ) - - if self.allowed_scopes is not None: - _serialize_allowed_scopes_type( - serializer, - _SCHEMA_CUSTOM_JWT_AUTHORIZER_CONFIGURATION.members["allowedScopes"], - self.allowed_scopes, - ) - - if self.advertised_scope_mapping is not None: - _serialize_advertised_scope_mapping_type( - serializer, - _SCHEMA_CUSTOM_JWT_AUTHORIZER_CONFIGURATION.members[ - "advertisedScopeMapping" - ], - self.advertised_scope_mapping, - ) - - if self.custom_claims is not None: - _serialize_custom_claim_validations_type( - serializer, - _SCHEMA_CUSTOM_JWT_AUTHORIZER_CONFIGURATION.members["customClaims"], - self.custom_claims, - ) - - if self.private_endpoint is not None: - serializer.write_struct( - _SCHEMA_CUSTOM_JWT_AUTHORIZER_CONFIGURATION.members["privateEndpoint"], - self.private_endpoint, - ) - - if self.private_endpoint_overrides is not None: - _serialize_private_endpoint_overrides( - serializer, - _SCHEMA_CUSTOM_JWT_AUTHORIZER_CONFIGURATION.members[ - "privateEndpointOverrides" - ], - self.private_endpoint_overrides, - ) - - if self.allowed_workload_configuration is not None: - serializer.write_struct( - _SCHEMA_CUSTOM_JWT_AUTHORIZER_CONFIGURATION.members[ - "allowedWorkloadConfiguration" - ], - self.allowed_workload_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["discovery_url"] = de.read_string( - _SCHEMA_CUSTOM_JWT_AUTHORIZER_CONFIGURATION.members[ - "discoveryUrl" - ] - ) - - case 1: - kwargs["allowed_audience"] = _deserialize_allowed_audience_list( - de, - _SCHEMA_CUSTOM_JWT_AUTHORIZER_CONFIGURATION.members[ - "allowedAudience" - ], - ) - - case 2: - kwargs["allowed_clients"] = _deserialize_allowed_clients_list( - de, - _SCHEMA_CUSTOM_JWT_AUTHORIZER_CONFIGURATION.members[ - "allowedClients" - ], - ) - - case 3: - kwargs["allowed_scopes"] = _deserialize_allowed_scopes_type( - de, - _SCHEMA_CUSTOM_JWT_AUTHORIZER_CONFIGURATION.members[ - "allowedScopes" - ], - ) - - case 4: - kwargs["advertised_scope_mapping"] = ( - _deserialize_advertised_scope_mapping_type( - de, - _SCHEMA_CUSTOM_JWT_AUTHORIZER_CONFIGURATION.members[ - "advertisedScopeMapping" - ], - ) - ) - - case 5: - kwargs["custom_claims"] = ( - _deserialize_custom_claim_validations_type( - de, - _SCHEMA_CUSTOM_JWT_AUTHORIZER_CONFIGURATION.members[ - "customClaims" - ], - ) - ) - - case 6: - kwargs["private_endpoint"] = ( - _PrivateEndpointDeserializer().deserialize(de) - ) - - case 7: - kwargs["private_endpoint_overrides"] = ( - _deserialize_private_endpoint_overrides( - de, - _SCHEMA_CUSTOM_JWT_AUTHORIZER_CONFIGURATION.members[ - "privateEndpointOverrides" - ], - ) - ) - - case 8: - kwargs["allowed_workload_configuration"] = ( - AllowedWorkloadConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CUSTOM_JWT_AUTHORIZER_CONFIGURATION, consumer=_consumer - ) - if "discovery_url" not in kwargs: - kwargs["discovery_url"] = "" - return kwargs - - -@dataclass -class AuthorizerConfigurationCustomJWTAuthorizer: - """ - The inbound JWT-based authorization, specifying how incoming requests - should be authenticated. - """ - - value: CustomJWTAuthorizerConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTHORIZER_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTHORIZER_CONFIGURATION.members["customJWTAuthorizer"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=CustomJWTAuthorizerConfiguration.deserialize(deserializer)) - - -@dataclass -class AuthorizerConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -AuthorizerConfiguration = Union[ - AuthorizerConfigurationCustomJWTAuthorizer | AuthorizerConfigurationUnknown -] -""" -Represents inbound authorization configuration options used to -authenticate incoming requests. -""" - - -class _AuthorizerConfigurationDeserializer: - _result: AuthorizerConfiguration | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> AuthorizerConfiguration: - self._result = None - deserializer.read_struct(_SCHEMA_AUTHORIZER_CONFIGURATION, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - AuthorizerConfigurationCustomJWTAuthorizer.deserialize(de) - ) - - case _: - self._set_result( - AuthorizerConfigurationUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: AuthorizerConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class CapacityProviderConfiguration: - """ - Configuration for customer-managed compute capacity for the AgentCore - Runtime. A capacity provider runs the AgentCore Runtime on the Instances - compute type, using Amazon Web Services managed compute in your account. - """ - - capacity_provider_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the capacity provider to use for the - AgentCore Runtime. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CAPACITY_PROVIDER_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.capacity_provider_arn is not None: - serializer.write_string( - _SCHEMA_CAPACITY_PROVIDER_CONFIGURATION.members["capacityProviderArn"], - self.capacity_provider_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["capacity_provider_arn"] = de.read_string( - _SCHEMA_CAPACITY_PROVIDER_CONFIGURATION.members[ - "capacityProviderArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CAPACITY_PROVIDER_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -def _serialize_environment_variables_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_environment_variables_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CapacityProviderVolumeConfiguration: - """ - Configuration for a capacity provider volume mounted into the AgentCore - Runtime. This references a persistent volume by its logical name, as - defined in the capacity provider's list of volumes. - """ - - volume_name: str - """ - The logical name of the capacity provider volume to mount. This name - must match a volume that is defined in the capacity provider's list of - volumes. - """ - - mount_path: str - """ - The mount path for the capacity provider volume inside the AgentCore - Runtime. The path must be under `/mnt` with exactly one subdirectory - level (for example, `/mnt/data`). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CAPACITY_PROVIDER_VOLUME_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CAPACITY_PROVIDER_VOLUME_CONFIGURATION.members["volumeName"], - self.volume_name, - ) - serializer.write_string( - _SCHEMA_CAPACITY_PROVIDER_VOLUME_CONFIGURATION.members["mountPath"], - self.mount_path, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["volume_name"] = de.read_string( - _SCHEMA_CAPACITY_PROVIDER_VOLUME_CONFIGURATION.members[ - "volumeName" - ] - ) - - case 1: - kwargs["mount_path"] = de.read_string( - _SCHEMA_CAPACITY_PROVIDER_VOLUME_CONFIGURATION.members[ - "mountPath" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CAPACITY_PROVIDER_VOLUME_CONFIGURATION, consumer=_consumer - ) - if "volume_name" not in kwargs: - kwargs["volume_name"] = "" - if "mount_path" not in kwargs: - kwargs["mount_path"] = "" - return kwargs - - -@dataclass(kw_only=True) -class EfsAccessPointConfiguration: - """ - Configuration for an Amazon EFS access point filesystem mounted into the - AgentCore Runtime. EFS access points provide shared file storage - accessible from your AgentCore Runtime sessions. - """ - - access_point_arn: str - """The ARN of the EFS access point to mount into the AgentCore Runtime.""" - - mount_path: str - """ - The mount path for the EFS access point inside the AgentCore Runtime. - The path must be under `/mnt` with exactly one subdirectory level (for - example, `/mnt/data`). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EFS_ACCESS_POINT_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_EFS_ACCESS_POINT_CONFIGURATION.members["accessPointArn"], - self.access_point_arn, - ) - serializer.write_string( - _SCHEMA_EFS_ACCESS_POINT_CONFIGURATION.members["mountPath"], self.mount_path - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["access_point_arn"] = de.read_string( - _SCHEMA_EFS_ACCESS_POINT_CONFIGURATION.members["accessPointArn"] - ) - - case 1: - kwargs["mount_path"] = de.read_string( - _SCHEMA_EFS_ACCESS_POINT_CONFIGURATION.members["mountPath"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EFS_ACCESS_POINT_CONFIGURATION, consumer=_consumer - ) - if "access_point_arn" not in kwargs: - kwargs["access_point_arn"] = "" - if "mount_path" not in kwargs: - kwargs["mount_path"] = "" - return kwargs - - -@dataclass(kw_only=True) -class S3FilesAccessPointConfiguration: - """ - Configuration for an Amazon S3 Files access point filesystem mounted - into the AgentCore Runtime. S3 Files access points provide shared file - storage accessible from your AgentCore Runtime sessions. - """ - - access_point_arn: str - """ - The ARN of the S3 Files access point to mount into the AgentCore - Runtime. - """ - - mount_path: str - """ - The mount path for the S3 Files access point inside the AgentCore - Runtime. The path must be under `/mnt` with exactly one subdirectory - level (for example, `/mnt/data`). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_S3_FILES_ACCESS_POINT_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_S3_FILES_ACCESS_POINT_CONFIGURATION.members["accessPointArn"], - self.access_point_arn, - ) - serializer.write_string( - _SCHEMA_S3_FILES_ACCESS_POINT_CONFIGURATION.members["mountPath"], - self.mount_path, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["access_point_arn"] = de.read_string( - _SCHEMA_S3_FILES_ACCESS_POINT_CONFIGURATION.members[ - "accessPointArn" - ] - ) - - case 1: - kwargs["mount_path"] = de.read_string( - _SCHEMA_S3_FILES_ACCESS_POINT_CONFIGURATION.members["mountPath"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_S3_FILES_ACCESS_POINT_CONFIGURATION, consumer=_consumer - ) - if "access_point_arn" not in kwargs: - kwargs["access_point_arn"] = "" - if "mount_path" not in kwargs: - kwargs["mount_path"] = "" - return kwargs - - -@dataclass(kw_only=True) -class SessionStorageConfiguration: - """ - Configuration for a session storage filesystem mounted into the - AgentCore Runtime. Session storage provides persistent storage that is - preserved across AgentCore Runtime session invocations. - """ - - mount_path: str - """ - The mount path for the session storage filesystem inside the AgentCore - Runtime. The path must be under `/mnt` with exactly one subdirectory - level (for example, `/mnt/data`). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SESSION_STORAGE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SESSION_STORAGE_CONFIGURATION.members["mountPath"], self.mount_path - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["mount_path"] = de.read_string( - _SCHEMA_SESSION_STORAGE_CONFIGURATION.members["mountPath"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SESSION_STORAGE_CONFIGURATION, consumer=_consumer - ) - if "mount_path" not in kwargs: - kwargs["mount_path"] = "" - return kwargs - - -@dataclass -class FilesystemConfigurationSessionStorage: - """ - Configuration for session storage. Session storage provides persistent - storage that is preserved across AgentCore Runtime session invocations. - """ - - value: SessionStorageConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FILESYSTEM_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FILESYSTEM_CONFIGURATION.members["sessionStorage"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=SessionStorageConfiguration.deserialize(deserializer)) - - -@dataclass -class FilesystemConfigurationS3FilesAccessPoint: - """ - Configuration for an Amazon S3 Files access point to mount into the - AgentCore Runtime. - """ - - value: S3FilesAccessPointConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FILESYSTEM_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FILESYSTEM_CONFIGURATION.members["s3FilesAccessPoint"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=S3FilesAccessPointConfiguration.deserialize(deserializer)) - - -@dataclass -class FilesystemConfigurationEfsAccessPoint: - """ - Configuration for an Amazon EFS access point to mount into the AgentCore - Runtime. - """ - - value: EfsAccessPointConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FILESYSTEM_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FILESYSTEM_CONFIGURATION.members["efsAccessPoint"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=EfsAccessPointConfiguration.deserialize(deserializer)) - - -@dataclass -class FilesystemConfigurationCapacityProviderVolume: - """ - Configuration for a capacity provider volume to mount into the AgentCore - Runtime. This mounts a persistent volume that is defined on the capacity - provider, referenced by its logical name. - """ - - value: CapacityProviderVolumeConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FILESYSTEM_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FILESYSTEM_CONFIGURATION.members["capacityProviderVolume"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=CapacityProviderVolumeConfiguration.deserialize(deserializer)) - - -@dataclass -class FilesystemConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -FilesystemConfiguration = Union[ - FilesystemConfigurationSessionStorage - | FilesystemConfigurationS3FilesAccessPoint - | FilesystemConfigurationEfsAccessPoint - | FilesystemConfigurationCapacityProviderVolume - | FilesystemConfigurationUnknown -] -""" -Configuration for a filesystem that can be mounted into the AgentCore -Runtime. -""" - - -class _FilesystemConfigurationDeserializer: - _result: FilesystemConfiguration | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> FilesystemConfiguration: - self._result = None - deserializer.read_struct(_SCHEMA_FILESYSTEM_CONFIGURATION, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(FilesystemConfigurationSessionStorage.deserialize(de)) - - case 1: - self._set_result( - FilesystemConfigurationS3FilesAccessPoint.deserialize(de) - ) - - case 2: - self._set_result(FilesystemConfigurationEfsAccessPoint.deserialize(de)) - - case 3: - self._set_result( - FilesystemConfigurationCapacityProviderVolume.deserialize(de) - ) - - case _: - self._set_result( - FilesystemConfigurationUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: FilesystemConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_filesystem_configurations( - serializer: ShapeSerializer, schema: Schema, value: list[FilesystemConfiguration] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_filesystem_configurations( - deserializer: ShapeDeserializer, schema: Schema -) -> list[FilesystemConfiguration]: - result: list[FilesystemConfiguration] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_FilesystemConfigurationDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class LifecycleConfiguration: - """ - LifecycleConfiguration lets you manage the lifecycle of runtime sessions - and resources in AgentCore Runtime. This configuration helps optimize - resource utilization by automatically cleaning up idle sessions and - preventing long-running instances from consuming resources indefinitely. - """ - - idle_runtime_session_timeout: int | None = None - """ - Timeout in seconds for idle runtime sessions. When a session remains - idle for this duration, it will be automatically terminated. Default: - 900 seconds (15 minutes). - """ - - max_lifetime: int | None = None - """ - Maximum lifetime for the instance in seconds. Once reached, instances - will be automatically terminated and replaced. Default: 28800 seconds (8 - hours). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIFECYCLE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.idle_runtime_session_timeout is not None: - serializer.write_integer( - _SCHEMA_LIFECYCLE_CONFIGURATION.members["idleRuntimeSessionTimeout"], - self.idle_runtime_session_timeout, - ) - - if self.max_lifetime is not None: - serializer.write_integer( - _SCHEMA_LIFECYCLE_CONFIGURATION.members["maxLifetime"], - self.max_lifetime, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["idle_runtime_session_timeout"] = de.read_integer( - _SCHEMA_LIFECYCLE_CONFIGURATION.members[ - "idleRuntimeSessionTimeout" - ] - ) - - case 1: - kwargs["max_lifetime"] = de.read_integer( - _SCHEMA_LIFECYCLE_CONFIGURATION.members["maxLifetime"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIFECYCLE_CONFIGURATION, consumer=_consumer) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls() - - -class NetworkMode(UnknownEnumMixin, StrEnum): - PUBLIC = "PUBLIC" - VPC = "VPC" - - -def _serialize_security_groups( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_security_groups( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_subnets( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_subnets(deserializer: ShapeDeserializer, schema: Schema) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class VpcConfig: - """VpcConfig for the Agent.""" - - security_groups: list[str] - """The security groups associated with the VPC configuration.""" - - subnets: list[str] - """The subnets associated with the VPC configuration.""" - - require_service_s3_endpoint: bool | None = None - """ - Note: - This field applies only to Agent Runtimes. It is not applicable to - Browsers or Code Interpreters. - - Controls whether a service-managed Amazon S3 gateway endpoint is - provisioned in the VPC network topology for the agent runtime. This - gateway is used by Amazon Bedrock AgentCore Runtime to download code and - container images during agent startup. - - Starting May 5, 2026, Amazon Bedrock AgentCore Runtime is gradually - rolling out a change to how network isolation is configured for VPC mode - agents. Agent runtimes created on or after this rollout will no longer - include the service-managed Amazon S3 gateway. Instead, all network - access, including to Amazon S3, is governed exclusively by your VPC - configuration. This field cannot be set on agent runtimes created after - the rollout. Passing this field in an `UpdateAgentRuntime` request for - these agent runtimes returns a `ValidationException`. - - Agent runtimes created before the rollout are not affected and continue - to operate with the service-managed Amazon S3 gateway. To enforce full - VPC network isolation on these existing agent runtimes, set this field - to `false` via the `UpdateAgentRuntime` API. Before opting out, ensure - your VPC provides the Amazon S3 access required for agent startup. If - this field is not specified or is set to `true`, the service-managed - Amazon S3 gateway remains provisioned. - - This field is only supported in the `UpdateAgentRuntime` API for - pre-rollout agent runtimes. Passing this field in a `CreateAgentRuntime` - request returns a `ValidationException`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VPC_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_security_groups( - serializer, - _SCHEMA_VPC_CONFIG.members["securityGroups"], - self.security_groups, - ) - _serialize_subnets( - serializer, _SCHEMA_VPC_CONFIG.members["subnets"], self.subnets - ) - if self.require_service_s3_endpoint is not None: - serializer.write_boolean( - _SCHEMA_VPC_CONFIG.members["requireServiceS3Endpoint"], - self.require_service_s3_endpoint, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["security_groups"] = _deserialize_security_groups( - de, _SCHEMA_VPC_CONFIG.members["securityGroups"] - ) - - case 1: - kwargs["subnets"] = _deserialize_subnets( - de, _SCHEMA_VPC_CONFIG.members["subnets"] - ) - - case 2: - kwargs["require_service_s3_endpoint"] = de.read_boolean( - _SCHEMA_VPC_CONFIG.members["requireServiceS3Endpoint"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VPC_CONFIG, consumer=_consumer) - if "security_groups" not in kwargs: - kwargs["security_groups"] = [] - if "subnets" not in kwargs: - kwargs["subnets"] = [] - return kwargs - - -@dataclass(kw_only=True) -class NetworkConfiguration: - """SecurityConfig for the Agent.""" - - network_mode: str - """The network mode for the AgentCore Runtime.""" - - network_mode_config: VpcConfig | None = None - """The network mode configuration for the AgentCore Runtime.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_NETWORK_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_NETWORK_CONFIGURATION.members["networkMode"], self.network_mode - ) - if self.network_mode_config is not None: - serializer.write_struct( - _SCHEMA_NETWORK_CONFIGURATION.members["networkModeConfig"], - self.network_mode_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["network_mode"] = NetworkMode( - de.read_string( - _SCHEMA_NETWORK_CONFIGURATION.members["networkMode"] - ) - ) - - case 1: - kwargs["network_mode_config"] = VpcConfig.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_NETWORK_CONFIGURATION, consumer=_consumer) - if "network_mode" not in kwargs: - kwargs["network_mode"] = NetworkMode._corrected("") - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(network_mode=NetworkMode._corrected("")) - - -class ServerProtocol(UnknownEnumMixin, StrEnum): - MCP = "MCP" - HTTP = "HTTP" - A2_A = "A2A" - AGUI = "AGUI" - - -@dataclass(kw_only=True) -class ProtocolConfiguration: - """ - The protocol configuration for an agent runtime. This structure defines - how the agent runtime communicates with clients. - """ - - server_protocol: str - """ - The server protocol for the agent runtime. This field specifies which - protocol the agent runtime uses to communicate with clients. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PROTOCOL_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_PROTOCOL_CONFIGURATION.members["serverProtocol"], - self.server_protocol, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["server_protocol"] = ServerProtocol( - de.read_string( - _SCHEMA_PROTOCOL_CONFIGURATION.members["serverProtocol"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PROTOCOL_CONFIGURATION, consumer=_consumer) - if "server_protocol" not in kwargs: - kwargs["server_protocol"] = ServerProtocol._corrected("") - return kwargs - - -def _serialize_request_header_allowlist( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_request_header_allowlist( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass -class RequestHeaderConfigurationRequestHeaderAllowlist: - """ - A list of HTTP request headers that are allowed to be passed through to - the runtime. - """ - - value: list[str] - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REQUEST_HEADER_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_request_header_allowlist( - serializer, - _SCHEMA_REQUEST_HEADER_CONFIGURATION.members["requestHeaderAllowlist"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_deserialize_request_header_allowlist( - deserializer, - _SCHEMA_REQUEST_HEADER_CONFIGURATION.members["requestHeaderAllowlist"], - ) - ) - - -@dataclass -class RequestHeaderConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -RequestHeaderConfiguration = Union[ - RequestHeaderConfigurationRequestHeaderAllowlist | RequestHeaderConfigurationUnknown -] -""" -Configuration for HTTP request headers that will be passed through to -the runtime. -""" - - -class _RequestHeaderConfigurationDeserializer: - _result: RequestHeaderConfiguration | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> RequestHeaderConfiguration: - self._result = None - deserializer.read_struct(_SCHEMA_REQUEST_HEADER_CONFIGURATION, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - RequestHeaderConfigurationRequestHeaderAllowlist.deserialize(de) - ) - - case _: - self._set_result( - RequestHeaderConfigurationUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: RequestHeaderConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class CreateAgentRuntimeInput: - """Dataclass for CreateAgentRuntimeInput structure.""" - - agent_runtime_name: str | None = None - """The name of the AgentCore Runtime.""" - - agent_runtime_artifact: AgentRuntimeArtifact | None = None - """The artifact of the AgentCore Runtime.""" - - role_arn: str | None = None - """The IAM role ARN that provides permissions for the AgentCore Runtime.""" - - network_configuration: NetworkConfiguration | None = None - """The network configuration for the AgentCore Runtime.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure idempotency of the - request. - """ - - description: str | None = field(repr=False, default=None) - """The description of the AgentCore Runtime.""" - - authorizer_configuration: AuthorizerConfiguration | None = None - """The authorizer configuration for the AgentCore Runtime.""" - - request_header_configuration: RequestHeaderConfiguration | None = None - """ - Configuration for HTTP request headers that will be passed through to - the runtime. - """ - - protocol_configuration: ProtocolConfiguration | None = None - """ - The protocol configuration for an agent runtime. This structure defines - how the agent runtime communicates with clients. - """ - - lifecycle_configuration: LifecycleConfiguration | None = None - """The life cycle configuration for the AgentCore Runtime.""" - - environment_variables: dict[str, str] | None = field(repr=False, default=None) - """Environment variables to set in the AgentCore Runtime environment.""" - - filesystem_configurations: list[FilesystemConfiguration] | None = None - """ - The filesystem configurations to mount into the AgentCore Runtime. Use - filesystem configurations to provide persistent storage to your - AgentCore Runtime sessions. - """ - - capacity_provider_configuration: CapacityProviderConfiguration | None = None - """ - The capacity provider configuration for the AgentCore Runtime. Use a - capacity provider to run the AgentCore Runtime on the Instances compute - type, which provisions Amazon Web Services managed compute in your - account. - """ - - tags: dict[str, str] | None = None - """ - A map of tag keys and values to assign to the agent runtime. Tags enable - you to categorize your resources in different ways, for example, by - purpose, owner, or environment. - """ - - platform_version: str | None = None - """The version of the runtime platform to use for the AgentCore Runtime.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_AGENT_RUNTIME_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.agent_runtime_name is not None: - serializer.write_string( - _SCHEMA_CREATE_AGENT_RUNTIME_INPUT.members["agentRuntimeName"], - self.agent_runtime_name, - ) - - if self.agent_runtime_artifact is not None: - serializer.write_struct( - _SCHEMA_CREATE_AGENT_RUNTIME_INPUT.members["agentRuntimeArtifact"], - self.agent_runtime_artifact, - ) - - if self.role_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_AGENT_RUNTIME_INPUT.members["roleArn"], self.role_arn - ) - - if self.network_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_AGENT_RUNTIME_INPUT.members["networkConfiguration"], - self.network_configuration, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_AGENT_RUNTIME_INPUT.members["clientToken"], - self.client_token, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_AGENT_RUNTIME_INPUT.members["description"], - self.description, - ) - - if self.authorizer_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_AGENT_RUNTIME_INPUT.members["authorizerConfiguration"], - self.authorizer_configuration, - ) - - if self.request_header_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_AGENT_RUNTIME_INPUT.members[ - "requestHeaderConfiguration" - ], - self.request_header_configuration, - ) - - if self.protocol_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_AGENT_RUNTIME_INPUT.members["protocolConfiguration"], - self.protocol_configuration, - ) - - if self.lifecycle_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_AGENT_RUNTIME_INPUT.members["lifecycleConfiguration"], - self.lifecycle_configuration, - ) - - if self.environment_variables is not None: - _serialize_environment_variables_map( - serializer, - _SCHEMA_CREATE_AGENT_RUNTIME_INPUT.members["environmentVariables"], - self.environment_variables, - ) - - if self.filesystem_configurations is not None: - _serialize_filesystem_configurations( - serializer, - _SCHEMA_CREATE_AGENT_RUNTIME_INPUT.members["filesystemConfigurations"], - self.filesystem_configurations, - ) - - if self.capacity_provider_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_AGENT_RUNTIME_INPUT.members[ - "capacityProviderConfiguration" - ], - self.capacity_provider_configuration, - ) - - if self.tags is not None: - _serialize_tags_map( - serializer, - _SCHEMA_CREATE_AGENT_RUNTIME_INPUT.members["tags"], - self.tags, - ) - - if self.platform_version is not None: - serializer.write_string( - _SCHEMA_CREATE_AGENT_RUNTIME_INPUT.members["platformVersion"], - self.platform_version, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_runtime_name"] = de.read_string( - _SCHEMA_CREATE_AGENT_RUNTIME_INPUT.members["agentRuntimeName"] - ) - - case 1: - kwargs["agent_runtime_artifact"] = ( - _AgentRuntimeArtifactDeserializer().deserialize(de) - ) - - case 2: - kwargs["role_arn"] = de.read_string( - _SCHEMA_CREATE_AGENT_RUNTIME_INPUT.members["roleArn"] - ) - - case 3: - kwargs["network_configuration"] = NetworkConfiguration.deserialize( - de - ) - - case 4: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_AGENT_RUNTIME_INPUT.members["clientToken"] - ) - - case 5: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_AGENT_RUNTIME_INPUT.members["description"] - ) - - case 6: - kwargs["authorizer_configuration"] = ( - _AuthorizerConfigurationDeserializer().deserialize(de) - ) - - case 7: - kwargs["request_header_configuration"] = ( - _RequestHeaderConfigurationDeserializer().deserialize(de) - ) - - case 8: - kwargs["protocol_configuration"] = ( - ProtocolConfiguration.deserialize(de) - ) - - case 9: - kwargs["lifecycle_configuration"] = ( - LifecycleConfiguration.deserialize(de) - ) - - case 10: - kwargs["environment_variables"] = ( - _deserialize_environment_variables_map( - de, - _SCHEMA_CREATE_AGENT_RUNTIME_INPUT.members[ - "environmentVariables" - ], - ) - ) - - case 11: - kwargs["filesystem_configurations"] = ( - _deserialize_filesystem_configurations( - de, - _SCHEMA_CREATE_AGENT_RUNTIME_INPUT.members[ - "filesystemConfigurations" - ], - ) - ) - - case 12: - kwargs["capacity_provider_configuration"] = ( - CapacityProviderConfiguration.deserialize(de) - ) - - case 13: - kwargs["tags"] = _deserialize_tags_map( - de, _SCHEMA_CREATE_AGENT_RUNTIME_INPUT.members["tags"] - ) - - case 14: - kwargs["platform_version"] = de.read_string( - _SCHEMA_CREATE_AGENT_RUNTIME_INPUT.members["platformVersion"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_AGENT_RUNTIME_INPUT, consumer=_consumer) - return kwargs - - -class AgentRuntimeStatus(UnknownEnumMixin, StrEnum): - CREATING = "CREATING" - CREATE_FAILED = "CREATE_FAILED" - UPDATING = "UPDATING" - UPDATE_FAILED = "UPDATE_FAILED" - READY = "READY" - DELETING = "DELETING" - DELETE_FAILED = "DELETE_FAILED" - - -@dataclass(kw_only=True) -class WorkloadIdentityDetails: - """The information about the workload identity.""" - - workload_identity_arn: str - """The ARN associated with the workload identity.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_WORKLOAD_IDENTITY_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_WORKLOAD_IDENTITY_DETAILS.members["workloadIdentityArn"], - self.workload_identity_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["workload_identity_arn"] = de.read_string( - _SCHEMA_WORKLOAD_IDENTITY_DETAILS.members["workloadIdentityArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_WORKLOAD_IDENTITY_DETAILS, consumer=_consumer) - if "workload_identity_arn" not in kwargs: - kwargs["workload_identity_arn"] = "" - return kwargs - - -@dataclass(kw_only=True) -class CreateAgentRuntimeOutput: - """Dataclass for CreateAgentRuntimeOutput structure.""" - - agent_runtime_arn: str - """The Amazon Resource Name (ARN) of the AgentCore Runtime.""" - - agent_runtime_id: str - """The unique identifier of the AgentCore Runtime.""" - - agent_runtime_version: str - """The version of the AgentCore Runtime.""" - - created_at: datetime - """The timestamp when the AgentCore Runtime was created.""" - - status: str - """The current status of the AgentCore Runtime.""" - - workload_identity_details: WorkloadIdentityDetails | None = None - """The workload identity details for the AgentCore Runtime.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_AGENT_RUNTIME_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_AGENT_RUNTIME_OUTPUT.members["agentRuntimeArn"], - self.agent_runtime_arn, - ) - if self.workload_identity_details is not None: - serializer.write_struct( - _SCHEMA_CREATE_AGENT_RUNTIME_OUTPUT.members["workloadIdentityDetails"], - self.workload_identity_details, - ) - - serializer.write_string( - _SCHEMA_CREATE_AGENT_RUNTIME_OUTPUT.members["agentRuntimeId"], - self.agent_runtime_id, - ) - serializer.write_string( - _SCHEMA_CREATE_AGENT_RUNTIME_OUTPUT.members["agentRuntimeVersion"], - self.agent_runtime_version, - ) - serializer.write_timestamp( - _SCHEMA_CREATE_AGENT_RUNTIME_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_string( - _SCHEMA_CREATE_AGENT_RUNTIME_OUTPUT.members["status"], self.status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_runtime_arn"] = de.read_string( - _SCHEMA_CREATE_AGENT_RUNTIME_OUTPUT.members["agentRuntimeArn"] - ) - - case 1: - kwargs["workload_identity_details"] = ( - WorkloadIdentityDetails.deserialize(de) - ) - - case 2: - kwargs["agent_runtime_id"] = de.read_string( - _SCHEMA_CREATE_AGENT_RUNTIME_OUTPUT.members["agentRuntimeId"] - ) - - case 3: - kwargs["agent_runtime_version"] = de.read_string( - _SCHEMA_CREATE_AGENT_RUNTIME_OUTPUT.members[ - "agentRuntimeVersion" - ] - ) - - case 4: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_CREATE_AGENT_RUNTIME_OUTPUT.members["createdAt"] - ) - - case 5: - kwargs["status"] = AgentRuntimeStatus( - de.read_string( - _SCHEMA_CREATE_AGENT_RUNTIME_OUTPUT.members["status"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_AGENT_RUNTIME_OUTPUT, consumer=_consumer - ) - if "agent_runtime_arn" not in kwargs: - kwargs["agent_runtime_arn"] = "" - if "agent_runtime_id" not in kwargs: - kwargs["agent_runtime_id"] = "" - if "agent_runtime_version" not in kwargs: - kwargs["agent_runtime_version"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "status" not in kwargs: - kwargs["status"] = AgentRuntimeStatus._corrected("") - return kwargs - - -CREATE_AGENT_RUNTIME = APIOperation( - input=CreateAgentRuntimeInput, - output=CreateAgentRuntimeOutput, - schema=_SCHEMA_CREATE_AGENT_RUNTIME, - input_schema=_SCHEMA_CREATE_AGENT_RUNTIME_INPUT, - output_schema=_SCHEMA_CREATE_AGENT_RUNTIME_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteAgentRuntimeInput: - """Dataclass for DeleteAgentRuntimeInput structure.""" - - agent_runtime_id: str | None = None - """The unique identifier of the AgentCore Runtime to delete.""" - - agent_runtime_version: str | None = None - """ - The version of the AgentCore Runtime to delete. When you provide this - value, only that version is deleted. When you omit it, the entire - AgentCore Runtime and all of its versions are deleted. - """ - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the operation - completes no more than one time. If this token matches a previous - request, the service ignores the request but does not return an error. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_AGENT_RUNTIME_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.agent_runtime_id is not None: - serializer.write_string( - _SCHEMA_DELETE_AGENT_RUNTIME_INPUT.members["agentRuntimeId"], - self.agent_runtime_id, - ) - - if self.agent_runtime_version is not None: - serializer.write_string( - _SCHEMA_DELETE_AGENT_RUNTIME_INPUT.members["agentRuntimeVersion"], - self.agent_runtime_version, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_DELETE_AGENT_RUNTIME_INPUT.members["clientToken"], - self.client_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_runtime_id"] = de.read_string( - _SCHEMA_DELETE_AGENT_RUNTIME_INPUT.members["agentRuntimeId"] - ) - - case 1: - kwargs["agent_runtime_version"] = de.read_string( - _SCHEMA_DELETE_AGENT_RUNTIME_INPUT.members[ - "agentRuntimeVersion" - ] - ) - - case 2: - kwargs["client_token"] = de.read_string( - _SCHEMA_DELETE_AGENT_RUNTIME_INPUT.members["clientToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_AGENT_RUNTIME_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteAgentRuntimeOutput: - """Dataclass for DeleteAgentRuntimeOutput structure.""" - - status: str - """The current status of the AgentCore Runtime deletion.""" - - agent_runtime_id: str | None = None - """The unique identifier of the AgentCore Runtime.""" - - agent_runtime_version: str | None = None - """ - The version of the AgentCore Runtime that was deleted. This value is - present only when you delete a single version. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_AGENT_RUNTIME_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DELETE_AGENT_RUNTIME_OUTPUT.members["status"], self.status - ) - if self.agent_runtime_id is not None: - serializer.write_string( - _SCHEMA_DELETE_AGENT_RUNTIME_OUTPUT.members["agentRuntimeId"], - self.agent_runtime_id, - ) - - if self.agent_runtime_version is not None: - serializer.write_string( - _SCHEMA_DELETE_AGENT_RUNTIME_OUTPUT.members["agentRuntimeVersion"], - self.agent_runtime_version, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["status"] = AgentRuntimeStatus( - de.read_string( - _SCHEMA_DELETE_AGENT_RUNTIME_OUTPUT.members["status"] - ) - ) - - case 1: - kwargs["agent_runtime_id"] = de.read_string( - _SCHEMA_DELETE_AGENT_RUNTIME_OUTPUT.members["agentRuntimeId"] - ) - - case 2: - kwargs["agent_runtime_version"] = de.read_string( - _SCHEMA_DELETE_AGENT_RUNTIME_OUTPUT.members[ - "agentRuntimeVersion" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_AGENT_RUNTIME_OUTPUT, consumer=_consumer - ) - if "status" not in kwargs: - kwargs["status"] = AgentRuntimeStatus._corrected("") - return kwargs - - -DELETE_AGENT_RUNTIME = APIOperation( - input=DeleteAgentRuntimeInput, - output=DeleteAgentRuntimeOutput, - schema=_SCHEMA_DELETE_AGENT_RUNTIME, - input_schema=_SCHEMA_DELETE_AGENT_RUNTIME_INPUT, - output_schema=_SCHEMA_DELETE_AGENT_RUNTIME_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetAgentRuntimeInput: - """Dataclass for GetAgentRuntimeInput structure.""" - - agent_runtime_id: str | None = None - """The unique identifier of the AgentCore Runtime to retrieve.""" - - agent_runtime_version: str | None = None - """The version of the AgentCore Runtime to retrieve.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_AGENT_RUNTIME_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.agent_runtime_id is not None: - serializer.write_string( - _SCHEMA_GET_AGENT_RUNTIME_INPUT.members["agentRuntimeId"], - self.agent_runtime_id, - ) - - if self.agent_runtime_version is not None: - serializer.write_string( - _SCHEMA_GET_AGENT_RUNTIME_INPUT.members["agentRuntimeVersion"], - self.agent_runtime_version, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_runtime_id"] = de.read_string( - _SCHEMA_GET_AGENT_RUNTIME_INPUT.members["agentRuntimeId"] - ) - - case 1: - kwargs["agent_runtime_version"] = de.read_string( - _SCHEMA_GET_AGENT_RUNTIME_INPUT.members["agentRuntimeVersion"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_AGENT_RUNTIME_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class RuntimeMetadataConfiguration: - """Configuration for microVM metadata service settings.""" - - require_mmdsv2: bool - """ - Enables MMDSv2 (microVM Metadata Service Version 2) requirement for the - agent runtime. When set to `true`, the runtime microVM will only accept - MMDSv2 requests. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RUNTIME_METADATA_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_boolean( - _SCHEMA_RUNTIME_METADATA_CONFIGURATION.members["requireMMDSV2"], - self.require_mmdsv2, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["require_mmdsv2"] = de.read_boolean( - _SCHEMA_RUNTIME_METADATA_CONFIGURATION.members["requireMMDSV2"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RUNTIME_METADATA_CONFIGURATION, consumer=_consumer - ) - if "require_mmdsv2" not in kwargs: - kwargs["require_mmdsv2"] = False - return kwargs - - -@dataclass(kw_only=True) -class GetAgentRuntimeOutput: - """Dataclass for GetAgentRuntimeOutput structure.""" - - agent_runtime_arn: str - """The Amazon Resource Name (ARN) of the AgentCore Runtime.""" - - agent_runtime_name: str - """The name of the AgentCore Runtime.""" - - agent_runtime_id: str - """The unique identifier of the AgentCore Runtime.""" - - agent_runtime_version: str - """The version of the AgentCore Runtime.""" - - created_at: datetime - """The timestamp when the AgentCore Runtime was created.""" - - last_updated_at: datetime - """The timestamp when the AgentCore Runtime was last updated.""" - - role_arn: str - """The IAM role ARN that provides permissions for the AgentCore Runtime.""" - - status: str - """The current status of the AgentCore Runtime.""" - - lifecycle_configuration: LifecycleConfiguration - """The life cycle configuration for the AgentCore Runtime.""" - - network_configuration: NetworkConfiguration | None = None - """The network configuration for the AgentCore Runtime.""" - - failure_reason: str | None = None - """The reason for failure if the AgentCore Runtime is in a failed state.""" - - description: str | None = field(repr=False, default=None) - """The description of the AgentCore Runtime.""" - - workload_identity_details: WorkloadIdentityDetails | None = None - """The workload identity details for the AgentCore Runtime.""" - - agent_runtime_artifact: AgentRuntimeArtifact | None = None - """The artifact of the AgentCore Runtime.""" - - protocol_configuration: ProtocolConfiguration | None = None - """ - The protocol configuration for an agent runtime. This structure defines - how the agent runtime communicates with clients. - """ - - environment_variables: dict[str, str] | None = field(repr=False, default=None) - """Environment variables set in the AgentCore Runtime environment.""" - - authorizer_configuration: AuthorizerConfiguration | None = None - """The authorizer configuration for the AgentCore Runtime.""" - - request_header_configuration: RequestHeaderConfiguration | None = None - """ - Configuration for HTTP request headers that will be passed through to - the runtime. - """ - - metadata_configuration: RuntimeMetadataConfiguration | None = None - """ - Configuration for microVM Metadata Service (MMDS) settings for the - AgentCore Runtime. - """ - - filesystem_configurations: list[FilesystemConfiguration] | None = None - """The filesystem configurations mounted into the AgentCore Runtime.""" - - capacity_provider_configuration: CapacityProviderConfiguration | None = None - """The capacity provider configuration for the AgentCore Runtime.""" - - platform_version: str | None = None - """The version of the runtime platform used by the AgentCore Runtime.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_AGENT_RUNTIME_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_AGENT_RUNTIME_OUTPUT.members["agentRuntimeArn"], - self.agent_runtime_arn, - ) - serializer.write_string( - _SCHEMA_GET_AGENT_RUNTIME_OUTPUT.members["agentRuntimeName"], - self.agent_runtime_name, - ) - serializer.write_string( - _SCHEMA_GET_AGENT_RUNTIME_OUTPUT.members["agentRuntimeId"], - self.agent_runtime_id, - ) - serializer.write_string( - _SCHEMA_GET_AGENT_RUNTIME_OUTPUT.members["agentRuntimeVersion"], - self.agent_runtime_version, - ) - serializer.write_timestamp( - _SCHEMA_GET_AGENT_RUNTIME_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_GET_AGENT_RUNTIME_OUTPUT.members["lastUpdatedAt"], - self.last_updated_at, - ) - serializer.write_string( - _SCHEMA_GET_AGENT_RUNTIME_OUTPUT.members["roleArn"], self.role_arn - ) - if self.network_configuration is not None: - serializer.write_struct( - _SCHEMA_GET_AGENT_RUNTIME_OUTPUT.members["networkConfiguration"], - self.network_configuration, - ) - - serializer.write_string( - _SCHEMA_GET_AGENT_RUNTIME_OUTPUT.members["status"], self.status - ) - serializer.write_struct( - _SCHEMA_GET_AGENT_RUNTIME_OUTPUT.members["lifecycleConfiguration"], - self.lifecycle_configuration, - ) - if self.failure_reason is not None: - serializer.write_string( - _SCHEMA_GET_AGENT_RUNTIME_OUTPUT.members["failureReason"], - self.failure_reason, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_AGENT_RUNTIME_OUTPUT.members["description"], - self.description, - ) - - if self.workload_identity_details is not None: - serializer.write_struct( - _SCHEMA_GET_AGENT_RUNTIME_OUTPUT.members["workloadIdentityDetails"], - self.workload_identity_details, - ) - - if self.agent_runtime_artifact is not None: - serializer.write_struct( - _SCHEMA_GET_AGENT_RUNTIME_OUTPUT.members["agentRuntimeArtifact"], - self.agent_runtime_artifact, - ) - - if self.protocol_configuration is not None: - serializer.write_struct( - _SCHEMA_GET_AGENT_RUNTIME_OUTPUT.members["protocolConfiguration"], - self.protocol_configuration, - ) - - if self.environment_variables is not None: - _serialize_environment_variables_map( - serializer, - _SCHEMA_GET_AGENT_RUNTIME_OUTPUT.members["environmentVariables"], - self.environment_variables, - ) - - if self.authorizer_configuration is not None: - serializer.write_struct( - _SCHEMA_GET_AGENT_RUNTIME_OUTPUT.members["authorizerConfiguration"], - self.authorizer_configuration, - ) - - if self.request_header_configuration is not None: - serializer.write_struct( - _SCHEMA_GET_AGENT_RUNTIME_OUTPUT.members["requestHeaderConfiguration"], - self.request_header_configuration, - ) - - if self.metadata_configuration is not None: - serializer.write_struct( - _SCHEMA_GET_AGENT_RUNTIME_OUTPUT.members["metadataConfiguration"], - self.metadata_configuration, - ) - - if self.filesystem_configurations is not None: - _serialize_filesystem_configurations( - serializer, - _SCHEMA_GET_AGENT_RUNTIME_OUTPUT.members["filesystemConfigurations"], - self.filesystem_configurations, - ) - - if self.capacity_provider_configuration is not None: - serializer.write_struct( - _SCHEMA_GET_AGENT_RUNTIME_OUTPUT.members[ - "capacityProviderConfiguration" - ], - self.capacity_provider_configuration, - ) - - if self.platform_version is not None: - serializer.write_string( - _SCHEMA_GET_AGENT_RUNTIME_OUTPUT.members["platformVersion"], - self.platform_version, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_runtime_arn"] = de.read_string( - _SCHEMA_GET_AGENT_RUNTIME_OUTPUT.members["agentRuntimeArn"] - ) - - case 1: - kwargs["agent_runtime_name"] = de.read_string( - _SCHEMA_GET_AGENT_RUNTIME_OUTPUT.members["agentRuntimeName"] - ) - - case 2: - kwargs["agent_runtime_id"] = de.read_string( - _SCHEMA_GET_AGENT_RUNTIME_OUTPUT.members["agentRuntimeId"] - ) - - case 3: - kwargs["agent_runtime_version"] = de.read_string( - _SCHEMA_GET_AGENT_RUNTIME_OUTPUT.members["agentRuntimeVersion"] - ) - - case 4: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_AGENT_RUNTIME_OUTPUT.members["createdAt"] - ) - - case 5: - kwargs["last_updated_at"] = de.read_timestamp( - _SCHEMA_GET_AGENT_RUNTIME_OUTPUT.members["lastUpdatedAt"] - ) - - case 6: - kwargs["role_arn"] = de.read_string( - _SCHEMA_GET_AGENT_RUNTIME_OUTPUT.members["roleArn"] - ) - - case 7: - kwargs["network_configuration"] = NetworkConfiguration.deserialize( - de - ) - - case 8: - kwargs["status"] = AgentRuntimeStatus( - de.read_string( - _SCHEMA_GET_AGENT_RUNTIME_OUTPUT.members["status"] - ) - ) - - case 9: - kwargs["lifecycle_configuration"] = ( - LifecycleConfiguration.deserialize(de) - ) - - case 10: - kwargs["failure_reason"] = de.read_string( - _SCHEMA_GET_AGENT_RUNTIME_OUTPUT.members["failureReason"] - ) - - case 11: - kwargs["description"] = de.read_string( - _SCHEMA_GET_AGENT_RUNTIME_OUTPUT.members["description"] - ) - - case 12: - kwargs["workload_identity_details"] = ( - WorkloadIdentityDetails.deserialize(de) - ) - - case 13: - kwargs["agent_runtime_artifact"] = ( - _AgentRuntimeArtifactDeserializer().deserialize(de) - ) - - case 14: - kwargs["protocol_configuration"] = ( - ProtocolConfiguration.deserialize(de) - ) - - case 15: - kwargs["environment_variables"] = ( - _deserialize_environment_variables_map( - de, - _SCHEMA_GET_AGENT_RUNTIME_OUTPUT.members[ - "environmentVariables" - ], - ) - ) - - case 16: - kwargs["authorizer_configuration"] = ( - _AuthorizerConfigurationDeserializer().deserialize(de) - ) - - case 17: - kwargs["request_header_configuration"] = ( - _RequestHeaderConfigurationDeserializer().deserialize(de) - ) - - case 18: - kwargs["metadata_configuration"] = ( - RuntimeMetadataConfiguration.deserialize(de) - ) - - case 19: - kwargs["filesystem_configurations"] = ( - _deserialize_filesystem_configurations( - de, - _SCHEMA_GET_AGENT_RUNTIME_OUTPUT.members[ - "filesystemConfigurations" - ], - ) - ) - - case 20: - kwargs["capacity_provider_configuration"] = ( - CapacityProviderConfiguration.deserialize(de) - ) - - case 21: - kwargs["platform_version"] = de.read_string( - _SCHEMA_GET_AGENT_RUNTIME_OUTPUT.members["platformVersion"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_AGENT_RUNTIME_OUTPUT, consumer=_consumer) - if "agent_runtime_arn" not in kwargs: - kwargs["agent_runtime_arn"] = "" - if "agent_runtime_name" not in kwargs: - kwargs["agent_runtime_name"] = "" - if "agent_runtime_id" not in kwargs: - kwargs["agent_runtime_id"] = "" - if "agent_runtime_version" not in kwargs: - kwargs["agent_runtime_version"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "last_updated_at" not in kwargs: - kwargs["last_updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "role_arn" not in kwargs: - kwargs["role_arn"] = "" - if "status" not in kwargs: - kwargs["status"] = AgentRuntimeStatus._corrected("") - if "lifecycle_configuration" not in kwargs: - kwargs["lifecycle_configuration"] = LifecycleConfiguration._smithy_default() - return kwargs - - -GET_AGENT_RUNTIME = APIOperation( - input=GetAgentRuntimeInput, - output=GetAgentRuntimeOutput, - schema=_SCHEMA_GET_AGENT_RUNTIME, - input_schema=_SCHEMA_GET_AGENT_RUNTIME_INPUT, - output_schema=_SCHEMA_GET_AGENT_RUNTIME_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListAgentRuntimesInput: - """Dataclass for ListAgentRuntimesInput structure.""" - - max_results: int | None = None - """The maximum number of results to return in the response.""" - - next_token: str | None = None - """A token to retrieve the next page of results.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_AGENT_RUNTIMES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_AGENT_RUNTIMES_INPUT.members["maxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_AGENT_RUNTIMES_INPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_AGENT_RUNTIMES_INPUT.members["maxResults"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_AGENT_RUNTIMES_INPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_AGENT_RUNTIMES_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class AgentRuntime: - """ - Contains information about an agent runtime. An agent runtime is the - execution environment for a Amazon Bedrock AgentCore Agent. - """ - - agent_runtime_arn: str - """The Amazon Resource Name (ARN) of the agent runtime.""" - - agent_runtime_id: str - """The unique identifier of the agent runtime.""" - - agent_runtime_version: str - """The version of the agent runtime.""" - - agent_runtime_name: str - """The name of the agent runtime.""" - - description: str = field(repr=False) - """The description of the agent runtime.""" - - last_updated_at: datetime - """The timestamp when the agent runtime was last updated.""" - - status: str - """The current status of the agent runtime.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENT_RUNTIME, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AGENT_RUNTIME.members["agentRuntimeArn"], self.agent_runtime_arn - ) - serializer.write_string( - _SCHEMA_AGENT_RUNTIME.members["agentRuntimeId"], self.agent_runtime_id - ) - serializer.write_string( - _SCHEMA_AGENT_RUNTIME.members["agentRuntimeVersion"], - self.agent_runtime_version, - ) - serializer.write_string( - _SCHEMA_AGENT_RUNTIME.members["agentRuntimeName"], self.agent_runtime_name - ) - serializer.write_string( - _SCHEMA_AGENT_RUNTIME.members["description"], self.description - ) - serializer.write_timestamp( - _SCHEMA_AGENT_RUNTIME.members["lastUpdatedAt"], self.last_updated_at - ) - serializer.write_string(_SCHEMA_AGENT_RUNTIME.members["status"], self.status) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_runtime_arn"] = de.read_string( - _SCHEMA_AGENT_RUNTIME.members["agentRuntimeArn"] - ) - - case 1: - kwargs["agent_runtime_id"] = de.read_string( - _SCHEMA_AGENT_RUNTIME.members["agentRuntimeId"] - ) - - case 2: - kwargs["agent_runtime_version"] = de.read_string( - _SCHEMA_AGENT_RUNTIME.members["agentRuntimeVersion"] - ) - - case 3: - kwargs["agent_runtime_name"] = de.read_string( - _SCHEMA_AGENT_RUNTIME.members["agentRuntimeName"] - ) - - case 4: - kwargs["description"] = de.read_string( - _SCHEMA_AGENT_RUNTIME.members["description"] - ) - - case 5: - kwargs["last_updated_at"] = de.read_timestamp( - _SCHEMA_AGENT_RUNTIME.members["lastUpdatedAt"] - ) - - case 6: - kwargs["status"] = AgentRuntimeStatus( - de.read_string(_SCHEMA_AGENT_RUNTIME.members["status"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AGENT_RUNTIME, consumer=_consumer) - if "agent_runtime_arn" not in kwargs: - kwargs["agent_runtime_arn"] = "" - if "agent_runtime_id" not in kwargs: - kwargs["agent_runtime_id"] = "" - if "agent_runtime_version" not in kwargs: - kwargs["agent_runtime_version"] = "" - if "agent_runtime_name" not in kwargs: - kwargs["agent_runtime_name"] = "" - if "description" not in kwargs: - kwargs["description"] = "" - if "last_updated_at" not in kwargs: - kwargs["last_updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "status" not in kwargs: - kwargs["status"] = AgentRuntimeStatus._corrected("") - return kwargs - - -def _serialize_agent_runtimes( - serializer: ShapeSerializer, schema: Schema, value: list[AgentRuntime] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_agent_runtimes( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AgentRuntime]: - result: list[AgentRuntime] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AgentRuntime.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListAgentRuntimesOutput: - """Dataclass for ListAgentRuntimesOutput structure.""" - - agent_runtimes: list[AgentRuntime] - """The list of AgentCore Runtime resources.""" - - next_token: str | None = None - """A token to retrieve the next page of results.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_AGENT_RUNTIMES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_agent_runtimes( - serializer, - _SCHEMA_LIST_AGENT_RUNTIMES_OUTPUT.members["agentRuntimes"], - self.agent_runtimes, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_AGENT_RUNTIMES_OUTPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_runtimes"] = _deserialize_agent_runtimes( - de, _SCHEMA_LIST_AGENT_RUNTIMES_OUTPUT.members["agentRuntimes"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_AGENT_RUNTIMES_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_AGENT_RUNTIMES_OUTPUT, consumer=_consumer) - if "agent_runtimes" not in kwargs: - kwargs["agent_runtimes"] = [] - return kwargs - - -LIST_AGENT_RUNTIMES = APIOperation( - input=ListAgentRuntimesInput, - output=ListAgentRuntimesOutput, - schema=_SCHEMA_LIST_AGENT_RUNTIMES, - input_schema=_SCHEMA_LIST_AGENT_RUNTIMES_INPUT, - output_schema=_SCHEMA_LIST_AGENT_RUNTIMES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListAgentRuntimeVersionsInput: - """Dataclass for ListAgentRuntimeVersionsInput structure.""" - - agent_runtime_id: str | None = None - """The unique identifier of the AgentCore Runtime to list versions for.""" - - max_results: int | None = None - """The maximum number of results to return in the response.""" - - next_token: str | None = None - """A token to retrieve the next page of results.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_AGENT_RUNTIME_VERSIONS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.agent_runtime_id is not None: - serializer.write_string( - _SCHEMA_LIST_AGENT_RUNTIME_VERSIONS_INPUT.members["agentRuntimeId"], - self.agent_runtime_id, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_AGENT_RUNTIME_VERSIONS_INPUT.members["maxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_AGENT_RUNTIME_VERSIONS_INPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_runtime_id"] = de.read_string( - _SCHEMA_LIST_AGENT_RUNTIME_VERSIONS_INPUT.members[ - "agentRuntimeId" - ] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_AGENT_RUNTIME_VERSIONS_INPUT.members["maxResults"] - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_AGENT_RUNTIME_VERSIONS_INPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_AGENT_RUNTIME_VERSIONS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ListAgentRuntimeVersionsOutput: - """Dataclass for ListAgentRuntimeVersionsOutput structure.""" - - agent_runtimes: list[AgentRuntime] - """The list of AgentCore Runtime versions.""" - - next_token: str | None = None - """A token to retrieve the next page of results.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_AGENT_RUNTIME_VERSIONS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_agent_runtimes( - serializer, - _SCHEMA_LIST_AGENT_RUNTIME_VERSIONS_OUTPUT.members["agentRuntimes"], - self.agent_runtimes, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_AGENT_RUNTIME_VERSIONS_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_runtimes"] = _deserialize_agent_runtimes( - de, - _SCHEMA_LIST_AGENT_RUNTIME_VERSIONS_OUTPUT.members[ - "agentRuntimes" - ], - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_AGENT_RUNTIME_VERSIONS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_AGENT_RUNTIME_VERSIONS_OUTPUT, consumer=_consumer - ) - if "agent_runtimes" not in kwargs: - kwargs["agent_runtimes"] = [] - return kwargs - - -LIST_AGENT_RUNTIME_VERSIONS = APIOperation( - input=ListAgentRuntimeVersionsInput, - output=ListAgentRuntimeVersionsOutput, - schema=_SCHEMA_LIST_AGENT_RUNTIME_VERSIONS, - input_schema=_SCHEMA_LIST_AGENT_RUNTIME_VERSIONS_INPUT, - output_schema=_SCHEMA_LIST_AGENT_RUNTIME_VERSIONS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateAgentRuntimeInput: - """Dataclass for UpdateAgentRuntimeInput structure.""" - - agent_runtime_id: str | None = None - """The unique identifier of the AgentCore Runtime to update.""" - - agent_runtime_artifact: AgentRuntimeArtifact | None = None - """The updated artifact of the AgentCore Runtime.""" - - role_arn: str | None = None - """ - The updated IAM role ARN that provides permissions for the AgentCore - Runtime. - """ - - network_configuration: NetworkConfiguration | None = None - """The updated network configuration for the AgentCore Runtime.""" - - description: str | None = field(repr=False, default=None) - """The updated description of the AgentCore Runtime.""" - - authorizer_configuration: AuthorizerConfiguration | None = None - """The updated authorizer configuration for the AgentCore Runtime.""" - - request_header_configuration: RequestHeaderConfiguration | None = None - """ - The updated configuration for HTTP request headers that will be passed - through to the runtime. - """ - - protocol_configuration: ProtocolConfiguration | None = None - """ - The protocol configuration for an agent runtime. This structure defines - how the agent runtime communicates with clients. - """ - - lifecycle_configuration: LifecycleConfiguration | None = None - """The updated life cycle configuration for the AgentCore Runtime.""" - - metadata_configuration: RuntimeMetadataConfiguration | None = None - """ - The updated configuration for microVM Metadata Service (MMDS) settings - for the AgentCore Runtime. - """ - - environment_variables: dict[str, str] | None = field(repr=False, default=None) - """ - Updated environment variables to set in the AgentCore Runtime - environment. - """ - - filesystem_configurations: list[FilesystemConfiguration] | None = None - """ - The updated filesystem configurations to mount into the AgentCore - Runtime. - """ - - capacity_provider_configuration: CapacityProviderConfiguration | None = None - """The updated capacity provider configuration for the AgentCore Runtime.""" - - platform_version: str | None = None - """ - The updated version of the runtime platform to use for the AgentCore - Runtime. - """ - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure idempotency of the - request. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_AGENT_RUNTIME_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.agent_runtime_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_AGENT_RUNTIME_INPUT.members["agentRuntimeId"], - self.agent_runtime_id, - ) - - if self.agent_runtime_artifact is not None: - serializer.write_struct( - _SCHEMA_UPDATE_AGENT_RUNTIME_INPUT.members["agentRuntimeArtifact"], - self.agent_runtime_artifact, - ) - - if self.role_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_AGENT_RUNTIME_INPUT.members["roleArn"], self.role_arn - ) - - if self.network_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_AGENT_RUNTIME_INPUT.members["networkConfiguration"], - self.network_configuration, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_AGENT_RUNTIME_INPUT.members["description"], - self.description, - ) - - if self.authorizer_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_AGENT_RUNTIME_INPUT.members["authorizerConfiguration"], - self.authorizer_configuration, - ) - - if self.request_header_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_AGENT_RUNTIME_INPUT.members[ - "requestHeaderConfiguration" - ], - self.request_header_configuration, - ) - - if self.protocol_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_AGENT_RUNTIME_INPUT.members["protocolConfiguration"], - self.protocol_configuration, - ) - - if self.lifecycle_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_AGENT_RUNTIME_INPUT.members["lifecycleConfiguration"], - self.lifecycle_configuration, - ) - - if self.metadata_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_AGENT_RUNTIME_INPUT.members["metadataConfiguration"], - self.metadata_configuration, - ) - - if self.environment_variables is not None: - _serialize_environment_variables_map( - serializer, - _SCHEMA_UPDATE_AGENT_RUNTIME_INPUT.members["environmentVariables"], - self.environment_variables, - ) - - if self.filesystem_configurations is not None: - _serialize_filesystem_configurations( - serializer, - _SCHEMA_UPDATE_AGENT_RUNTIME_INPUT.members["filesystemConfigurations"], - self.filesystem_configurations, - ) - - if self.capacity_provider_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_AGENT_RUNTIME_INPUT.members[ - "capacityProviderConfiguration" - ], - self.capacity_provider_configuration, - ) - - if self.platform_version is not None: - serializer.write_string( - _SCHEMA_UPDATE_AGENT_RUNTIME_INPUT.members["platformVersion"], - self.platform_version, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_UPDATE_AGENT_RUNTIME_INPUT.members["clientToken"], - self.client_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_runtime_id"] = de.read_string( - _SCHEMA_UPDATE_AGENT_RUNTIME_INPUT.members["agentRuntimeId"] - ) - - case 1: - kwargs["agent_runtime_artifact"] = ( - _AgentRuntimeArtifactDeserializer().deserialize(de) - ) - - case 2: - kwargs["role_arn"] = de.read_string( - _SCHEMA_UPDATE_AGENT_RUNTIME_INPUT.members["roleArn"] - ) - - case 3: - kwargs["network_configuration"] = NetworkConfiguration.deserialize( - de - ) - - case 4: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_AGENT_RUNTIME_INPUT.members["description"] - ) - - case 5: - kwargs["authorizer_configuration"] = ( - _AuthorizerConfigurationDeserializer().deserialize(de) - ) - - case 6: - kwargs["request_header_configuration"] = ( - _RequestHeaderConfigurationDeserializer().deserialize(de) - ) - - case 7: - kwargs["protocol_configuration"] = ( - ProtocolConfiguration.deserialize(de) - ) - - case 8: - kwargs["lifecycle_configuration"] = ( - LifecycleConfiguration.deserialize(de) - ) - - case 9: - kwargs["metadata_configuration"] = ( - RuntimeMetadataConfiguration.deserialize(de) - ) - - case 10: - kwargs["environment_variables"] = ( - _deserialize_environment_variables_map( - de, - _SCHEMA_UPDATE_AGENT_RUNTIME_INPUT.members[ - "environmentVariables" - ], - ) - ) - - case 11: - kwargs["filesystem_configurations"] = ( - _deserialize_filesystem_configurations( - de, - _SCHEMA_UPDATE_AGENT_RUNTIME_INPUT.members[ - "filesystemConfigurations" - ], - ) - ) - - case 12: - kwargs["capacity_provider_configuration"] = ( - CapacityProviderConfiguration.deserialize(de) - ) - - case 13: - kwargs["platform_version"] = de.read_string( - _SCHEMA_UPDATE_AGENT_RUNTIME_INPUT.members["platformVersion"] - ) - - case 14: - kwargs["client_token"] = de.read_string( - _SCHEMA_UPDATE_AGENT_RUNTIME_INPUT.members["clientToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_AGENT_RUNTIME_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateAgentRuntimeOutput: - """Dataclass for UpdateAgentRuntimeOutput structure.""" - - agent_runtime_arn: str - """The Amazon Resource Name (ARN) of the updated AgentCore Runtime.""" - - agent_runtime_id: str - """The unique identifier of the updated AgentCore Runtime.""" - - agent_runtime_version: str - """The version of the updated AgentCore Runtime.""" - - created_at: datetime - """The timestamp when the AgentCore Runtime was created.""" - - last_updated_at: datetime - """The timestamp when the AgentCore Runtime was last updated.""" - - status: str - """The current status of the updated AgentCore Runtime.""" - - workload_identity_details: WorkloadIdentityDetails | None = None - """The workload identity details for the updated AgentCore Runtime.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_AGENT_RUNTIME_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_UPDATE_AGENT_RUNTIME_OUTPUT.members["agentRuntimeArn"], - self.agent_runtime_arn, - ) - serializer.write_string( - _SCHEMA_UPDATE_AGENT_RUNTIME_OUTPUT.members["agentRuntimeId"], - self.agent_runtime_id, - ) - if self.workload_identity_details is not None: - serializer.write_struct( - _SCHEMA_UPDATE_AGENT_RUNTIME_OUTPUT.members["workloadIdentityDetails"], - self.workload_identity_details, - ) - - serializer.write_string( - _SCHEMA_UPDATE_AGENT_RUNTIME_OUTPUT.members["agentRuntimeVersion"], - self.agent_runtime_version, - ) - serializer.write_timestamp( - _SCHEMA_UPDATE_AGENT_RUNTIME_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_UPDATE_AGENT_RUNTIME_OUTPUT.members["lastUpdatedAt"], - self.last_updated_at, - ) - serializer.write_string( - _SCHEMA_UPDATE_AGENT_RUNTIME_OUTPUT.members["status"], self.status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_runtime_arn"] = de.read_string( - _SCHEMA_UPDATE_AGENT_RUNTIME_OUTPUT.members["agentRuntimeArn"] - ) - - case 1: - kwargs["agent_runtime_id"] = de.read_string( - _SCHEMA_UPDATE_AGENT_RUNTIME_OUTPUT.members["agentRuntimeId"] - ) - - case 2: - kwargs["workload_identity_details"] = ( - WorkloadIdentityDetails.deserialize(de) - ) - - case 3: - kwargs["agent_runtime_version"] = de.read_string( - _SCHEMA_UPDATE_AGENT_RUNTIME_OUTPUT.members[ - "agentRuntimeVersion" - ] - ) - - case 4: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_UPDATE_AGENT_RUNTIME_OUTPUT.members["createdAt"] - ) - - case 5: - kwargs["last_updated_at"] = de.read_timestamp( - _SCHEMA_UPDATE_AGENT_RUNTIME_OUTPUT.members["lastUpdatedAt"] - ) - - case 6: - kwargs["status"] = AgentRuntimeStatus( - de.read_string( - _SCHEMA_UPDATE_AGENT_RUNTIME_OUTPUT.members["status"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_AGENT_RUNTIME_OUTPUT, consumer=_consumer - ) - if "agent_runtime_arn" not in kwargs: - kwargs["agent_runtime_arn"] = "" - if "agent_runtime_id" not in kwargs: - kwargs["agent_runtime_id"] = "" - if "agent_runtime_version" not in kwargs: - kwargs["agent_runtime_version"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "last_updated_at" not in kwargs: - kwargs["last_updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "status" not in kwargs: - kwargs["status"] = AgentRuntimeStatus._corrected("") - return kwargs - - -UPDATE_AGENT_RUNTIME = APIOperation( - input=UpdateAgentRuntimeInput, - output=UpdateAgentRuntimeOutput, - schema=_SCHEMA_UPDATE_AGENT_RUNTIME, - input_schema=_SCHEMA_UPDATE_AGENT_RUNTIME_INPUT, - output_schema=_SCHEMA_UPDATE_AGENT_RUNTIME_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class AgentRuntimeVersionSummary: - """ - Summary information about an agent runtime version associated with a - capacity provider. This is returned by - `ListAgentRuntimeVersionsByCapacityProvider`. - """ - - agent_runtime_arn: str - """The Amazon Resource Name (ARN) of the agent runtime.""" - - agent_runtime_version: str - """The version of the agent runtime.""" - - status: str - """The current status of the agent runtime version.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENT_RUNTIME_VERSION_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AGENT_RUNTIME_VERSION_SUMMARY.members["agentRuntimeArn"], - self.agent_runtime_arn, - ) - serializer.write_string( - _SCHEMA_AGENT_RUNTIME_VERSION_SUMMARY.members["agentRuntimeVersion"], - self.agent_runtime_version, - ) - serializer.write_string( - _SCHEMA_AGENT_RUNTIME_VERSION_SUMMARY.members["status"], self.status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_runtime_arn"] = de.read_string( - _SCHEMA_AGENT_RUNTIME_VERSION_SUMMARY.members["agentRuntimeArn"] - ) - - case 1: - kwargs["agent_runtime_version"] = de.read_string( - _SCHEMA_AGENT_RUNTIME_VERSION_SUMMARY.members[ - "agentRuntimeVersion" - ] - ) - - case 2: - kwargs["status"] = AgentRuntimeStatus( - de.read_string( - _SCHEMA_AGENT_RUNTIME_VERSION_SUMMARY.members["status"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AGENT_RUNTIME_VERSION_SUMMARY, consumer=_consumer - ) - if "agent_runtime_arn" not in kwargs: - kwargs["agent_runtime_arn"] = "" - if "agent_runtime_version" not in kwargs: - kwargs["agent_runtime_version"] = "" - if "status" not in kwargs: - kwargs["status"] = AgentRuntimeStatus._corrected("") - return kwargs - - -def _serialize_agent_runtime_version_summary_list( - serializer: ShapeSerializer, schema: Schema, value: list[AgentRuntimeVersionSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_agent_runtime_version_summary_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AgentRuntimeVersionSummary]: - result: list[AgentRuntimeVersionSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AgentRuntimeVersionSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class SkillDefinition: - """The structured skill definition with schema version and content.""" - - schema_version: str | None = None - """The version of the skill definition schema.""" - - inline_content: str | None = None - """The JSON content containing the structured skill definition.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SKILL_DEFINITION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.schema_version is not None: - serializer.write_string( - _SCHEMA_SKILL_DEFINITION.members["schemaVersion"], self.schema_version - ) - - if self.inline_content is not None: - serializer.write_string( - _SCHEMA_SKILL_DEFINITION.members["inlineContent"], self.inline_content - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["schema_version"] = de.read_string( - _SCHEMA_SKILL_DEFINITION.members["schemaVersion"] - ) - - case 1: - kwargs["inline_content"] = de.read_string( - _SCHEMA_SKILL_DEFINITION.members["inlineContent"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SKILL_DEFINITION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class SkillMdDefinition: - """The skill markdown definition for an agent skills descriptor.""" - - inline_content: str | None = None - """ - The markdown content describing the agent's skills in a human-readable - format. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SKILL_MD_DEFINITION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.inline_content is not None: - serializer.write_string( - _SCHEMA_SKILL_MD_DEFINITION.members["inlineContent"], - self.inline_content, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["inline_content"] = de.read_string( - _SCHEMA_SKILL_MD_DEFINITION.members["inlineContent"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SKILL_MD_DEFINITION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class AgentSkillsDescriptor: - """ - The agent skills descriptor for a registry record. Contains an optional - skill markdown definition in human-readable format and an optional - structured skill definition. - """ - - skill_md: SkillMdDefinition | None = None - """ - The optional skill markdown definition describing the agent's skills in - a human-readable format. - """ - - skill_definition: SkillDefinition | None = None - """The structured skill definition with schema version and content.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENT_SKILLS_DESCRIPTOR, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.skill_md is not None: - serializer.write_struct( - _SCHEMA_AGENT_SKILLS_DESCRIPTOR.members["skillMd"], self.skill_md - ) - - if self.skill_definition is not None: - serializer.write_struct( - _SCHEMA_AGENT_SKILLS_DESCRIPTOR.members["skillDefinition"], - self.skill_definition, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["skill_md"] = SkillMdDefinition.deserialize(de) - - case 1: - kwargs["skill_definition"] = SkillDefinition.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AGENT_SKILLS_DESCRIPTOR, consumer=_consumer) - return kwargs - - -def _serialize_allowed_query_parameters( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_allowed_query_parameters( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_allowed_request_headers( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_allowed_request_headers( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_allowed_response_headers( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_allowed_response_headers( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_allowed_string_list_values_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_allowed_string_list_values_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_allowed_string_values_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_allowed_string_values_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class SecretReference: - """ - Contains a reference to a secret stored in Amazon Web Services Secrets - Manager. - """ - - secret_id: str - """ - The ID of the Amazon Web Services Secrets Manager secret that stores the - secret value. - """ - - json_key: str - """ - The JSON key used to extract the secret value from the Amazon Web - Services Secrets Manager secret. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SECRET_REFERENCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SECRET_REFERENCE.members["secretId"], self.secret_id - ) - serializer.write_string( - _SCHEMA_SECRET_REFERENCE.members["jsonKey"], self.json_key - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["secret_id"] = de.read_string( - _SCHEMA_SECRET_REFERENCE.members["secretId"] - ) - - case 1: - kwargs["json_key"] = de.read_string( - _SCHEMA_SECRET_REFERENCE.members["jsonKey"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SECRET_REFERENCE, consumer=_consumer) - if "secret_id" not in kwargs: - kwargs["secret_id"] = "" - if "json_key" not in kwargs: - kwargs["json_key"] = "" - return kwargs - - -class SecretSourceType(UnknownEnumMixin, StrEnum): - MANAGED = "MANAGED" - EXTERNAL = "EXTERNAL" - - -@dataclass(kw_only=True) -class CreateApiKeyCredentialProviderInput: - """Dataclass for CreateApiKeyCredentialProviderInput structure.""" - - name: str | None = None - """ - The name of the API key credential provider. The name must be unique - within your account. - """ - - api_key: str = field(repr=False, default="") - """ - The API key to use for authentication. This value is encrypted and - stored securely. - """ - - api_key_secret_config: SecretReference | None = None - """ - A reference to the Amazon Web Services Secrets Manager secret that - stores the API key. This includes the secret ID and the JSON key used to - extract the API key value from the secret. Required when - `apiKeySecretSource` is set to `EXTERNAL`. - """ - - api_key_secret_source: str | None = None - """ - The source type of the API key secret. Use `MANAGED` if the secret is - managed by the service, or `EXTERNAL` if you manage the secret yourself - in Amazon Web Services Secrets Manager. - """ - - tags: dict[str, str] | None = None - """ - A map of tag keys and values to assign to the API key credential - provider. Tags enable you to categorize your resources in different - ways, for example, by purpose, owner, or environment. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_API_KEY_CREDENTIAL_PROVIDER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_API_KEY_CREDENTIAL_PROVIDER_INPUT.members["name"], - self.name, - ) - - if self.api_key is not None: - serializer.write_string( - _SCHEMA_CREATE_API_KEY_CREDENTIAL_PROVIDER_INPUT.members["apiKey"], - self.api_key, - ) - - if self.api_key_secret_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_API_KEY_CREDENTIAL_PROVIDER_INPUT.members[ - "apiKeySecretConfig" - ], - self.api_key_secret_config, - ) - - if self.api_key_secret_source is not None: - serializer.write_string( - _SCHEMA_CREATE_API_KEY_CREDENTIAL_PROVIDER_INPUT.members[ - "apiKeySecretSource" - ], - self.api_key_secret_source, - ) - - if self.tags is not None: - _serialize_tags_map( - serializer, - _SCHEMA_CREATE_API_KEY_CREDENTIAL_PROVIDER_INPUT.members["tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_API_KEY_CREDENTIAL_PROVIDER_INPUT.members["name"] - ) - - case 1: - kwargs["api_key"] = de.read_string( - _SCHEMA_CREATE_API_KEY_CREDENTIAL_PROVIDER_INPUT.members[ - "apiKey" - ] - ) - - case 2: - kwargs["api_key_secret_config"] = SecretReference.deserialize(de) - - case 3: - kwargs["api_key_secret_source"] = SecretSourceType( - de.read_string( - _SCHEMA_CREATE_API_KEY_CREDENTIAL_PROVIDER_INPUT.members[ - "apiKeySecretSource" - ] - ) - ) - - case 4: - kwargs["tags"] = _deserialize_tags_map( - de, - _SCHEMA_CREATE_API_KEY_CREDENTIAL_PROVIDER_INPUT.members[ - "tags" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_API_KEY_CREDENTIAL_PROVIDER_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class Secret: - """ - Contains information about a secret in Amazon Web Services Secrets - Manager. - """ - - secret_arn: str - """ - The Amazon Resource Name (ARN) of the secret in Amazon Web Services - Secrets Manager. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SECRET, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_SECRET.members["secretArn"], self.secret_arn) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["secret_arn"] = de.read_string( - _SCHEMA_SECRET.members["secretArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SECRET, consumer=_consumer) - if "secret_arn" not in kwargs: - kwargs["secret_arn"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(secret_arn="") - - -@dataclass(kw_only=True) -class CreateApiKeyCredentialProviderOutput: - """Dataclass for CreateApiKeyCredentialProviderOutput structure.""" - - api_key_secret_arn: Secret - """The Amazon Resource Name (ARN) of the secret containing the API key.""" - - name: str - """The name of the created API key credential provider.""" - - credential_provider_arn: str - """ - The Amazon Resource Name (ARN) of the created API key credential - provider. - """ - - api_key_secret_json_key: str | None = None - """ - The JSON key used to extract the API key value from the Amazon Web - Services Secrets Manager secret. - """ - - api_key_secret_source: str | None = None - """ - The source type of the API key secret. Either `MANAGED` if the secret is - managed by the service, or `EXTERNAL` if managed by the user in Amazon - Web Services Secrets Manager. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_API_KEY_CREDENTIAL_PROVIDER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CREATE_API_KEY_CREDENTIAL_PROVIDER_OUTPUT.members[ - "apiKeySecretArn" - ], - self.api_key_secret_arn, - ) - if self.api_key_secret_json_key is not None: - serializer.write_string( - _SCHEMA_CREATE_API_KEY_CREDENTIAL_PROVIDER_OUTPUT.members[ - "apiKeySecretJsonKey" - ], - self.api_key_secret_json_key, - ) - - if self.api_key_secret_source is not None: - serializer.write_string( - _SCHEMA_CREATE_API_KEY_CREDENTIAL_PROVIDER_OUTPUT.members[ - "apiKeySecretSource" - ], - self.api_key_secret_source, - ) - - serializer.write_string( - _SCHEMA_CREATE_API_KEY_CREDENTIAL_PROVIDER_OUTPUT.members["name"], self.name - ) - serializer.write_string( - _SCHEMA_CREATE_API_KEY_CREDENTIAL_PROVIDER_OUTPUT.members[ - "credentialProviderArn" - ], - self.credential_provider_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["api_key_secret_arn"] = Secret.deserialize(de) - - case 1: - kwargs["api_key_secret_json_key"] = de.read_string( - _SCHEMA_CREATE_API_KEY_CREDENTIAL_PROVIDER_OUTPUT.members[ - "apiKeySecretJsonKey" - ] - ) - - case 2: - kwargs["api_key_secret_source"] = SecretSourceType( - de.read_string( - _SCHEMA_CREATE_API_KEY_CREDENTIAL_PROVIDER_OUTPUT.members[ - "apiKeySecretSource" - ] - ) - ) - - case 3: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_API_KEY_CREDENTIAL_PROVIDER_OUTPUT.members[ - "name" - ] - ) - - case 4: - kwargs["credential_provider_arn"] = de.read_string( - _SCHEMA_CREATE_API_KEY_CREDENTIAL_PROVIDER_OUTPUT.members[ - "credentialProviderArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_API_KEY_CREDENTIAL_PROVIDER_OUTPUT, consumer=_consumer - ) - if "api_key_secret_arn" not in kwargs: - kwargs["api_key_secret_arn"] = Secret._smithy_default() - if "name" not in kwargs: - kwargs["name"] = "" - if "credential_provider_arn" not in kwargs: - kwargs["credential_provider_arn"] = "" - return kwargs - - -@dataclass(kw_only=True) -class DecryptionFailure(ServiceError): - """Exception thrown when decryption of a secret fails.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DECRYPTION_FAILURE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DECRYPTION_FAILURE.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_DECRYPTION_FAILURE.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DECRYPTION_FAILURE, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class EncryptionFailure(ServiceError): - """Exception thrown when encryption of a secret fails.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ENCRYPTION_FAILURE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_ENCRYPTION_FAILURE.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_ENCRYPTION_FAILURE.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ENCRYPTION_FAILURE, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ResourceLimitExceededException(ServiceError): - """Exception thrown when a resource limit is exceeded.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESOURCE_LIMIT_EXCEEDED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_RESOURCE_LIMIT_EXCEEDED_EXCEPTION.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_RESOURCE_LIMIT_EXCEEDED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RESOURCE_LIMIT_EXCEEDED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UnauthorizedException(ServiceError): - """ - This exception is thrown when the JWT bearer token is invalid or not - found for OAuth bearer token based access - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNAUTHORIZED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_UNAUTHORIZED_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_UNAUTHORIZED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UNAUTHORIZED_EXCEPTION, consumer=_consumer) - return kwargs - - -CREATE_API_KEY_CREDENTIAL_PROVIDER = APIOperation( - input=CreateApiKeyCredentialProviderInput, - output=CreateApiKeyCredentialProviderOutput, - schema=_SCHEMA_CREATE_API_KEY_CREDENTIAL_PROVIDER, - input_schema=_SCHEMA_CREATE_API_KEY_CREDENTIAL_PROVIDER_INPUT, - output_schema=_SCHEMA_CREATE_API_KEY_CREDENTIAL_PROVIDER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#DecryptionFailure" - ): DecryptionFailure, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#EncryptionFailure" - ): EncryptionFailure, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceLimitExceededException" - ): ResourceLimitExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#UnauthorizedException" - ): UnauthorizedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_DECRYPTION_FAILURE, - _SCHEMA_ENCRYPTION_FAILURE, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteApiKeyCredentialProviderInput: - """Dataclass for DeleteApiKeyCredentialProviderInput structure.""" - - name: str | None = None - """The name of the API key credential provider to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_API_KEY_CREDENTIAL_PROVIDER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_DELETE_API_KEY_CREDENTIAL_PROVIDER_INPUT.members["name"], - self.name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_DELETE_API_KEY_CREDENTIAL_PROVIDER_INPUT.members["name"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_API_KEY_CREDENTIAL_PROVIDER_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteApiKeyCredentialProviderOutput: - """Dataclass for DeleteApiKeyCredentialProviderOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_API_KEY_CREDENTIAL_PROVIDER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_API_KEY_CREDENTIAL_PROVIDER_OUTPUT, consumer=_consumer - ) - return kwargs - - -DELETE_API_KEY_CREDENTIAL_PROVIDER = APIOperation( - input=DeleteApiKeyCredentialProviderInput, - output=DeleteApiKeyCredentialProviderOutput, - schema=_SCHEMA_DELETE_API_KEY_CREDENTIAL_PROVIDER, - input_schema=_SCHEMA_DELETE_API_KEY_CREDENTIAL_PROVIDER_INPUT, - output_schema=_SCHEMA_DELETE_API_KEY_CREDENTIAL_PROVIDER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#UnauthorizedException" - ): UnauthorizedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetApiKeyCredentialProviderInput: - """Dataclass for GetApiKeyCredentialProviderInput structure.""" - - name: str | None = None - """The name of the API key credential provider to retrieve.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_API_KEY_CREDENTIAL_PROVIDER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_GET_API_KEY_CREDENTIAL_PROVIDER_INPUT.members["name"], self.name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_GET_API_KEY_CREDENTIAL_PROVIDER_INPUT.members["name"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_API_KEY_CREDENTIAL_PROVIDER_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetApiKeyCredentialProviderOutput: - """Dataclass for GetApiKeyCredentialProviderOutput structure.""" - - api_key_secret_arn: Secret - """ - The Amazon Resource Name (ARN) of the API key secret in Amazon Web - Services Secrets Manager. - """ - - name: str - """The name of the API key credential provider.""" - - credential_provider_arn: str - """The Amazon Resource Name (ARN) of the API key credential provider.""" - - created_time: datetime - """The timestamp when the API key credential provider was created.""" - - last_updated_time: datetime - """The timestamp when the API key credential provider was last updated.""" - - api_key_secret_json_key: str | None = None - """ - The JSON key used to extract the API key value from the Amazon Web - Services Secrets Manager secret. - """ - - api_key_secret_source: str | None = None - """ - The source type of the API key secret. Either `MANAGED` if the secret is - managed by the service, or `EXTERNAL` if managed by the user in Amazon - Web Services Secrets Manager. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_API_KEY_CREDENTIAL_PROVIDER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_API_KEY_CREDENTIAL_PROVIDER_OUTPUT.members["apiKeySecretArn"], - self.api_key_secret_arn, - ) - if self.api_key_secret_json_key is not None: - serializer.write_string( - _SCHEMA_GET_API_KEY_CREDENTIAL_PROVIDER_OUTPUT.members[ - "apiKeySecretJsonKey" - ], - self.api_key_secret_json_key, - ) - - if self.api_key_secret_source is not None: - serializer.write_string( - _SCHEMA_GET_API_KEY_CREDENTIAL_PROVIDER_OUTPUT.members[ - "apiKeySecretSource" - ], - self.api_key_secret_source, - ) - - serializer.write_string( - _SCHEMA_GET_API_KEY_CREDENTIAL_PROVIDER_OUTPUT.members["name"], self.name - ) - serializer.write_string( - _SCHEMA_GET_API_KEY_CREDENTIAL_PROVIDER_OUTPUT.members[ - "credentialProviderArn" - ], - self.credential_provider_arn, - ) - serializer.write_timestamp( - _SCHEMA_GET_API_KEY_CREDENTIAL_PROVIDER_OUTPUT.members["createdTime"], - self.created_time, - ) - serializer.write_timestamp( - _SCHEMA_GET_API_KEY_CREDENTIAL_PROVIDER_OUTPUT.members["lastUpdatedTime"], - self.last_updated_time, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["api_key_secret_arn"] = Secret.deserialize(de) - - case 1: - kwargs["api_key_secret_json_key"] = de.read_string( - _SCHEMA_GET_API_KEY_CREDENTIAL_PROVIDER_OUTPUT.members[ - "apiKeySecretJsonKey" - ] - ) - - case 2: - kwargs["api_key_secret_source"] = SecretSourceType( - de.read_string( - _SCHEMA_GET_API_KEY_CREDENTIAL_PROVIDER_OUTPUT.members[ - "apiKeySecretSource" - ] - ) - ) - - case 3: - kwargs["name"] = de.read_string( - _SCHEMA_GET_API_KEY_CREDENTIAL_PROVIDER_OUTPUT.members["name"] - ) - - case 4: - kwargs["credential_provider_arn"] = de.read_string( - _SCHEMA_GET_API_KEY_CREDENTIAL_PROVIDER_OUTPUT.members[ - "credentialProviderArn" - ] - ) - - case 5: - kwargs["created_time"] = de.read_timestamp( - _SCHEMA_GET_API_KEY_CREDENTIAL_PROVIDER_OUTPUT.members[ - "createdTime" - ] - ) - - case 6: - kwargs["last_updated_time"] = de.read_timestamp( - _SCHEMA_GET_API_KEY_CREDENTIAL_PROVIDER_OUTPUT.members[ - "lastUpdatedTime" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_API_KEY_CREDENTIAL_PROVIDER_OUTPUT, consumer=_consumer - ) - if "api_key_secret_arn" not in kwargs: - kwargs["api_key_secret_arn"] = Secret._smithy_default() - if "name" not in kwargs: - kwargs["name"] = "" - if "credential_provider_arn" not in kwargs: - kwargs["credential_provider_arn"] = "" - if "created_time" not in kwargs: - kwargs["created_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "last_updated_time" not in kwargs: - kwargs["last_updated_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -GET_API_KEY_CREDENTIAL_PROVIDER = APIOperation( - input=GetApiKeyCredentialProviderInput, - output=GetApiKeyCredentialProviderOutput, - schema=_SCHEMA_GET_API_KEY_CREDENTIAL_PROVIDER, - input_schema=_SCHEMA_GET_API_KEY_CREDENTIAL_PROVIDER_INPUT, - output_schema=_SCHEMA_GET_API_KEY_CREDENTIAL_PROVIDER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#DecryptionFailure" - ): DecryptionFailure, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#UnauthorizedException" - ): UnauthorizedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_DECRYPTION_FAILURE, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListApiKeyCredentialProvidersInput: - """Dataclass for ListApiKeyCredentialProvidersInput structure.""" - - next_token: str | None = None - """Pagination token.""" - - max_results: int = 10 - """Maximum number of results to return.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_API_KEY_CREDENTIAL_PROVIDERS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_API_KEY_CREDENTIAL_PROVIDERS_INPUT.members["nextToken"], - self.next_token, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_API_KEY_CREDENTIAL_PROVIDERS_INPUT.members["maxResults"], - self.max_results, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_API_KEY_CREDENTIAL_PROVIDERS_INPUT.members[ - "nextToken" - ] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_API_KEY_CREDENTIAL_PROVIDERS_INPUT.members[ - "maxResults" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_API_KEY_CREDENTIAL_PROVIDERS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ApiKeyCredentialProviderItem: - """Contains information about an API key credential provider.""" - - name: str - """The name of the API key credential provider.""" - - credential_provider_arn: str - """The Amazon Resource Name (ARN) of the API key credential provider.""" - - created_time: datetime - """The timestamp when the API key credential provider was created.""" - - last_updated_time: datetime - """The timestamp when the API key credential provider was last updated.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_API_KEY_CREDENTIAL_PROVIDER_ITEM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_API_KEY_CREDENTIAL_PROVIDER_ITEM.members["name"], self.name - ) - serializer.write_string( - _SCHEMA_API_KEY_CREDENTIAL_PROVIDER_ITEM.members["credentialProviderArn"], - self.credential_provider_arn, - ) - serializer.write_timestamp( - _SCHEMA_API_KEY_CREDENTIAL_PROVIDER_ITEM.members["createdTime"], - self.created_time, - ) - serializer.write_timestamp( - _SCHEMA_API_KEY_CREDENTIAL_PROVIDER_ITEM.members["lastUpdatedTime"], - self.last_updated_time, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_API_KEY_CREDENTIAL_PROVIDER_ITEM.members["name"] - ) - - case 1: - kwargs["credential_provider_arn"] = de.read_string( - _SCHEMA_API_KEY_CREDENTIAL_PROVIDER_ITEM.members[ - "credentialProviderArn" - ] - ) - - case 2: - kwargs["created_time"] = de.read_timestamp( - _SCHEMA_API_KEY_CREDENTIAL_PROVIDER_ITEM.members["createdTime"] - ) - - case 3: - kwargs["last_updated_time"] = de.read_timestamp( - _SCHEMA_API_KEY_CREDENTIAL_PROVIDER_ITEM.members[ - "lastUpdatedTime" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_API_KEY_CREDENTIAL_PROVIDER_ITEM, consumer=_consumer - ) - if "name" not in kwargs: - kwargs["name"] = "" - if "credential_provider_arn" not in kwargs: - kwargs["credential_provider_arn"] = "" - if "created_time" not in kwargs: - kwargs["created_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "last_updated_time" not in kwargs: - kwargs["last_updated_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_api_key_credential_providers( - serializer: ShapeSerializer, - schema: Schema, - value: list[ApiKeyCredentialProviderItem], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_api_key_credential_providers( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ApiKeyCredentialProviderItem]: - result: list[ApiKeyCredentialProviderItem] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ApiKeyCredentialProviderItem.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListApiKeyCredentialProvidersOutput: - """Dataclass for ListApiKeyCredentialProvidersOutput structure.""" - - credential_providers: list[ApiKeyCredentialProviderItem] - """The list of API key credential providers.""" - - next_token: str | None = None - """Pagination token for the next page of results.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_API_KEY_CREDENTIAL_PROVIDERS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_api_key_credential_providers( - serializer, - _SCHEMA_LIST_API_KEY_CREDENTIAL_PROVIDERS_OUTPUT.members[ - "credentialProviders" - ], - self.credential_providers, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_API_KEY_CREDENTIAL_PROVIDERS_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["credential_providers"] = ( - _deserialize_api_key_credential_providers( - de, - _SCHEMA_LIST_API_KEY_CREDENTIAL_PROVIDERS_OUTPUT.members[ - "credentialProviders" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_API_KEY_CREDENTIAL_PROVIDERS_OUTPUT.members[ - "nextToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_API_KEY_CREDENTIAL_PROVIDERS_OUTPUT, consumer=_consumer - ) - if "credential_providers" not in kwargs: - kwargs["credential_providers"] = [] - return kwargs - - -LIST_API_KEY_CREDENTIAL_PROVIDERS = APIOperation( - input=ListApiKeyCredentialProvidersInput, - output=ListApiKeyCredentialProvidersOutput, - schema=_SCHEMA_LIST_API_KEY_CREDENTIAL_PROVIDERS, - input_schema=_SCHEMA_LIST_API_KEY_CREDENTIAL_PROVIDERS_INPUT, - output_schema=_SCHEMA_LIST_API_KEY_CREDENTIAL_PROVIDERS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#UnauthorizedException" - ): UnauthorizedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateApiKeyCredentialProviderInput: - """Dataclass for UpdateApiKeyCredentialProviderInput structure.""" - - name: str | None = None - """The name of the API key credential provider to update.""" - - api_key: str = field(repr=False, default="") - """ - The new API key to use for authentication. This value replaces the - existing API key and is encrypted and stored securely. - """ - - api_key_secret_config: SecretReference | None = None - """ - A reference to the Amazon Web Services Secrets Manager secret that - stores the API key. This includes the secret ID and the JSON key used to - extract the API key value from the secret. Required when - `apiKeySecretSource` is set to `EXTERNAL`. - """ - - api_key_secret_source: str | None = None - """ - The source type of the API key secret. Use `MANAGED` if the secret is - managed by the service, or `EXTERNAL` if you manage the secret yourself - in Amazon Web Services Secrets Manager. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_API_KEY_CREDENTIAL_PROVIDER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_UPDATE_API_KEY_CREDENTIAL_PROVIDER_INPUT.members["name"], - self.name, - ) - - if self.api_key is not None: - serializer.write_string( - _SCHEMA_UPDATE_API_KEY_CREDENTIAL_PROVIDER_INPUT.members["apiKey"], - self.api_key, - ) - - if self.api_key_secret_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_API_KEY_CREDENTIAL_PROVIDER_INPUT.members[ - "apiKeySecretConfig" - ], - self.api_key_secret_config, - ) - - if self.api_key_secret_source is not None: - serializer.write_string( - _SCHEMA_UPDATE_API_KEY_CREDENTIAL_PROVIDER_INPUT.members[ - "apiKeySecretSource" - ], - self.api_key_secret_source, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_API_KEY_CREDENTIAL_PROVIDER_INPUT.members["name"] - ) - - case 1: - kwargs["api_key"] = de.read_string( - _SCHEMA_UPDATE_API_KEY_CREDENTIAL_PROVIDER_INPUT.members[ - "apiKey" - ] - ) - - case 2: - kwargs["api_key_secret_config"] = SecretReference.deserialize(de) - - case 3: - kwargs["api_key_secret_source"] = SecretSourceType( - de.read_string( - _SCHEMA_UPDATE_API_KEY_CREDENTIAL_PROVIDER_INPUT.members[ - "apiKeySecretSource" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_API_KEY_CREDENTIAL_PROVIDER_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateApiKeyCredentialProviderOutput: - """Dataclass for UpdateApiKeyCredentialProviderOutput structure.""" - - api_key_secret_arn: Secret - """ - The Amazon Resource Name (ARN) of the API key secret in Amazon Web - Services Secrets Manager. - """ - - name: str - """The name of the API key credential provider.""" - - credential_provider_arn: str - """The Amazon Resource Name (ARN) of the API key credential provider.""" - - created_time: datetime - """The timestamp when the API key credential provider was created.""" - - last_updated_time: datetime - """The timestamp when the API key credential provider was last updated.""" - - api_key_secret_json_key: str | None = None - """ - The JSON key used to extract the API key value from the Amazon Web - Services Secrets Manager secret. - """ - - api_key_secret_source: str | None = None - """ - The source type of the API key secret. Either `MANAGED` if the secret is - managed by the service, or `EXTERNAL` if managed by the user in Amazon - Web Services Secrets Manager. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_API_KEY_CREDENTIAL_PROVIDER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_UPDATE_API_KEY_CREDENTIAL_PROVIDER_OUTPUT.members[ - "apiKeySecretArn" - ], - self.api_key_secret_arn, - ) - if self.api_key_secret_json_key is not None: - serializer.write_string( - _SCHEMA_UPDATE_API_KEY_CREDENTIAL_PROVIDER_OUTPUT.members[ - "apiKeySecretJsonKey" - ], - self.api_key_secret_json_key, - ) - - if self.api_key_secret_source is not None: - serializer.write_string( - _SCHEMA_UPDATE_API_KEY_CREDENTIAL_PROVIDER_OUTPUT.members[ - "apiKeySecretSource" - ], - self.api_key_secret_source, - ) - - serializer.write_string( - _SCHEMA_UPDATE_API_KEY_CREDENTIAL_PROVIDER_OUTPUT.members["name"], self.name - ) - serializer.write_string( - _SCHEMA_UPDATE_API_KEY_CREDENTIAL_PROVIDER_OUTPUT.members[ - "credentialProviderArn" - ], - self.credential_provider_arn, - ) - serializer.write_timestamp( - _SCHEMA_UPDATE_API_KEY_CREDENTIAL_PROVIDER_OUTPUT.members["createdTime"], - self.created_time, - ) - serializer.write_timestamp( - _SCHEMA_UPDATE_API_KEY_CREDENTIAL_PROVIDER_OUTPUT.members[ - "lastUpdatedTime" - ], - self.last_updated_time, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["api_key_secret_arn"] = Secret.deserialize(de) - - case 1: - kwargs["api_key_secret_json_key"] = de.read_string( - _SCHEMA_UPDATE_API_KEY_CREDENTIAL_PROVIDER_OUTPUT.members[ - "apiKeySecretJsonKey" - ] - ) - - case 2: - kwargs["api_key_secret_source"] = SecretSourceType( - de.read_string( - _SCHEMA_UPDATE_API_KEY_CREDENTIAL_PROVIDER_OUTPUT.members[ - "apiKeySecretSource" - ] - ) - ) - - case 3: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_API_KEY_CREDENTIAL_PROVIDER_OUTPUT.members[ - "name" - ] - ) - - case 4: - kwargs["credential_provider_arn"] = de.read_string( - _SCHEMA_UPDATE_API_KEY_CREDENTIAL_PROVIDER_OUTPUT.members[ - "credentialProviderArn" - ] - ) - - case 5: - kwargs["created_time"] = de.read_timestamp( - _SCHEMA_UPDATE_API_KEY_CREDENTIAL_PROVIDER_OUTPUT.members[ - "createdTime" - ] - ) - - case 6: - kwargs["last_updated_time"] = de.read_timestamp( - _SCHEMA_UPDATE_API_KEY_CREDENTIAL_PROVIDER_OUTPUT.members[ - "lastUpdatedTime" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_API_KEY_CREDENTIAL_PROVIDER_OUTPUT, consumer=_consumer - ) - if "api_key_secret_arn" not in kwargs: - kwargs["api_key_secret_arn"] = Secret._smithy_default() - if "name" not in kwargs: - kwargs["name"] = "" - if "credential_provider_arn" not in kwargs: - kwargs["credential_provider_arn"] = "" - if "created_time" not in kwargs: - kwargs["created_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "last_updated_time" not in kwargs: - kwargs["last_updated_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -UPDATE_API_KEY_CREDENTIAL_PROVIDER = APIOperation( - input=UpdateApiKeyCredentialProviderInput, - output=UpdateApiKeyCredentialProviderOutput, - schema=_SCHEMA_UPDATE_API_KEY_CREDENTIAL_PROVIDER, - input_schema=_SCHEMA_UPDATE_API_KEY_CREDENTIAL_PROVIDER_INPUT, - output_schema=_SCHEMA_UPDATE_API_KEY_CREDENTIAL_PROVIDER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#DecryptionFailure" - ): DecryptionFailure, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#EncryptionFailure" - ): EncryptionFailure, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#UnauthorizedException" - ): UnauthorizedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_DECRYPTION_FAILURE, - _SCHEMA_ENCRYPTION_FAILURE, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class CreateBrowserProfileInput: - """Dataclass for CreateBrowserProfileInput structure.""" - - name: str | None = None - """ - The name of the browser profile. The name must be unique within your - account and can contain alphanumeric characters and underscores. - """ - - description: str | None = field(repr=False, default=None) - """ - A description of the browser profile. Use this field to describe the - purpose or contents of the profile. - """ - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the operation - completes no more than one time. If this token matches a previous - request, Amazon Bedrock AgentCore ignores the request but does not - return an error. - """ - - tags: dict[str, str] | None = None - """ - A map of tag keys and values to assign to the browser profile. Tags - enable you to categorize your resources in different ways, for example, - by purpose, owner, or environment. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_BROWSER_PROFILE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_BROWSER_PROFILE_INPUT.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_BROWSER_PROFILE_INPUT.members["description"], - self.description, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_BROWSER_PROFILE_INPUT.members["clientToken"], - self.client_token, - ) - - if self.tags is not None: - _serialize_tags_map( - serializer, - _SCHEMA_CREATE_BROWSER_PROFILE_INPUT.members["tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_BROWSER_PROFILE_INPUT.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_BROWSER_PROFILE_INPUT.members["description"] - ) - - case 2: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_BROWSER_PROFILE_INPUT.members["clientToken"] - ) - - case 3: - kwargs["tags"] = _deserialize_tags_map( - de, _SCHEMA_CREATE_BROWSER_PROFILE_INPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_BROWSER_PROFILE_INPUT, consumer=_consumer - ) - return kwargs - - -class BrowserProfileStatus(UnknownEnumMixin, StrEnum): - """The status of a browser profile.""" - - READY = "READY" - DELETING = "DELETING" - DELETED = "DELETED" - SAVING = "SAVING" - - -@dataclass(kw_only=True) -class CreateBrowserProfileOutput: - """Dataclass for CreateBrowserProfileOutput structure.""" - - profile_id: str - """The unique identifier of the created browser profile.""" - - profile_arn: str - """The Amazon Resource Name (ARN) of the created browser profile.""" - - created_at: datetime - """The timestamp when the browser profile was created.""" - - status: str - """The current status of the browser profile.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_BROWSER_PROFILE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_BROWSER_PROFILE_OUTPUT.members["profileId"], self.profile_id - ) - serializer.write_string( - _SCHEMA_CREATE_BROWSER_PROFILE_OUTPUT.members["profileArn"], - self.profile_arn, - ) - serializer.write_timestamp( - _SCHEMA_CREATE_BROWSER_PROFILE_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_string( - _SCHEMA_CREATE_BROWSER_PROFILE_OUTPUT.members["status"], self.status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["profile_id"] = de.read_string( - _SCHEMA_CREATE_BROWSER_PROFILE_OUTPUT.members["profileId"] - ) - - case 1: - kwargs["profile_arn"] = de.read_string( - _SCHEMA_CREATE_BROWSER_PROFILE_OUTPUT.members["profileArn"] - ) - - case 2: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_CREATE_BROWSER_PROFILE_OUTPUT.members["createdAt"] - ) - - case 3: - kwargs["status"] = BrowserProfileStatus( - de.read_string( - _SCHEMA_CREATE_BROWSER_PROFILE_OUTPUT.members["status"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_BROWSER_PROFILE_OUTPUT, consumer=_consumer - ) - if "profile_id" not in kwargs: - kwargs["profile_id"] = "" - if "profile_arn" not in kwargs: - kwargs["profile_arn"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "status" not in kwargs: - kwargs["status"] = BrowserProfileStatus._corrected("") - return kwargs - - -CREATE_BROWSER_PROFILE = APIOperation( - input=CreateBrowserProfileInput, - output=CreateBrowserProfileOutput, - schema=_SCHEMA_CREATE_BROWSER_PROFILE, - input_schema=_SCHEMA_CREATE_BROWSER_PROFILE_INPUT, - output_schema=_SCHEMA_CREATE_BROWSER_PROFILE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteBrowserProfileInput: - """Dataclass for DeleteBrowserProfileInput structure.""" - - profile_id: str | None = None - """The unique identifier of the browser profile to delete.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure idempotency of the - request. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_BROWSER_PROFILE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.profile_id is not None: - serializer.write_string( - _SCHEMA_DELETE_BROWSER_PROFILE_INPUT.members["profileId"], - self.profile_id, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_DELETE_BROWSER_PROFILE_INPUT.members["clientToken"], - self.client_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["profile_id"] = de.read_string( - _SCHEMA_DELETE_BROWSER_PROFILE_INPUT.members["profileId"] - ) - - case 1: - kwargs["client_token"] = de.read_string( - _SCHEMA_DELETE_BROWSER_PROFILE_INPUT.members["clientToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_BROWSER_PROFILE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteBrowserProfileOutput: - """Dataclass for DeleteBrowserProfileOutput structure.""" - - profile_id: str - """The unique identifier of the deleted browser profile.""" - - profile_arn: str - """The Amazon Resource Name (ARN) of the deleted browser profile.""" - - status: str - """The current status of the browser profile deletion.""" - - last_updated_at: datetime - """The timestamp when the browser profile was last updated.""" - - last_saved_at: datetime | None = None - """ - The timestamp when browser session data was last saved to this profile - before deletion. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_BROWSER_PROFILE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DELETE_BROWSER_PROFILE_OUTPUT.members["profileId"], self.profile_id - ) - serializer.write_string( - _SCHEMA_DELETE_BROWSER_PROFILE_OUTPUT.members["profileArn"], - self.profile_arn, - ) - serializer.write_string( - _SCHEMA_DELETE_BROWSER_PROFILE_OUTPUT.members["status"], self.status - ) - serializer.write_timestamp( - _SCHEMA_DELETE_BROWSER_PROFILE_OUTPUT.members["lastUpdatedAt"], - self.last_updated_at, - ) - if self.last_saved_at is not None: - serializer.write_timestamp( - _SCHEMA_DELETE_BROWSER_PROFILE_OUTPUT.members["lastSavedAt"], - self.last_saved_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["profile_id"] = de.read_string( - _SCHEMA_DELETE_BROWSER_PROFILE_OUTPUT.members["profileId"] - ) - - case 1: - kwargs["profile_arn"] = de.read_string( - _SCHEMA_DELETE_BROWSER_PROFILE_OUTPUT.members["profileArn"] - ) - - case 2: - kwargs["status"] = BrowserProfileStatus( - de.read_string( - _SCHEMA_DELETE_BROWSER_PROFILE_OUTPUT.members["status"] - ) - ) - - case 3: - kwargs["last_updated_at"] = de.read_timestamp( - _SCHEMA_DELETE_BROWSER_PROFILE_OUTPUT.members["lastUpdatedAt"] - ) - - case 4: - kwargs["last_saved_at"] = de.read_timestamp( - _SCHEMA_DELETE_BROWSER_PROFILE_OUTPUT.members["lastSavedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_BROWSER_PROFILE_OUTPUT, consumer=_consumer - ) - if "profile_id" not in kwargs: - kwargs["profile_id"] = "" - if "profile_arn" not in kwargs: - kwargs["profile_arn"] = "" - if "status" not in kwargs: - kwargs["status"] = BrowserProfileStatus._corrected("") - if "last_updated_at" not in kwargs: - kwargs["last_updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -DELETE_BROWSER_PROFILE = APIOperation( - input=DeleteBrowserProfileInput, - output=DeleteBrowserProfileOutput, - schema=_SCHEMA_DELETE_BROWSER_PROFILE, - input_schema=_SCHEMA_DELETE_BROWSER_PROFILE_INPUT, - output_schema=_SCHEMA_DELETE_BROWSER_PROFILE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetBrowserProfileInput: - """Dataclass for GetBrowserProfileInput structure.""" - - profile_id: str | None = None - """The unique identifier of the browser profile to retrieve.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_BROWSER_PROFILE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.profile_id is not None: - serializer.write_string( - _SCHEMA_GET_BROWSER_PROFILE_INPUT.members["profileId"], self.profile_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["profile_id"] = de.read_string( - _SCHEMA_GET_BROWSER_PROFILE_INPUT.members["profileId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_BROWSER_PROFILE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetBrowserProfileOutput: - """Dataclass for GetBrowserProfileOutput structure.""" - - profile_id: str - """The unique identifier of the browser profile.""" - - profile_arn: str - """The Amazon Resource Name (ARN) of the browser profile.""" - - name: str - """The name of the browser profile.""" - - status: str - """The current status of the browser profile.""" - - created_at: datetime - """The timestamp when the browser profile was created.""" - - last_updated_at: datetime - """The timestamp when the browser profile was last updated.""" - - description: str | None = field(repr=False, default=None) - """The description of the browser profile.""" - - last_saved_at: datetime | None = None - """The timestamp when browser session data was last saved to this profile.""" - - last_saved_browser_session_id: str | None = None - """ - The identifier of the browser session from which data was last saved to - this profile. - """ - - last_saved_browser_id: str | None = None - """ - The identifier of the browser from which data was last saved to this - profile. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_BROWSER_PROFILE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_BROWSER_PROFILE_OUTPUT.members["profileId"], self.profile_id - ) - serializer.write_string( - _SCHEMA_GET_BROWSER_PROFILE_OUTPUT.members["profileArn"], self.profile_arn - ) - serializer.write_string( - _SCHEMA_GET_BROWSER_PROFILE_OUTPUT.members["name"], self.name - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_BROWSER_PROFILE_OUTPUT.members["description"], - self.description, - ) - - serializer.write_string( - _SCHEMA_GET_BROWSER_PROFILE_OUTPUT.members["status"], self.status - ) - serializer.write_timestamp( - _SCHEMA_GET_BROWSER_PROFILE_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_GET_BROWSER_PROFILE_OUTPUT.members["lastUpdatedAt"], - self.last_updated_at, - ) - if self.last_saved_at is not None: - serializer.write_timestamp( - _SCHEMA_GET_BROWSER_PROFILE_OUTPUT.members["lastSavedAt"], - self.last_saved_at, - ) - - if self.last_saved_browser_session_id is not None: - serializer.write_string( - _SCHEMA_GET_BROWSER_PROFILE_OUTPUT.members["lastSavedBrowserSessionId"], - self.last_saved_browser_session_id, - ) - - if self.last_saved_browser_id is not None: - serializer.write_string( - _SCHEMA_GET_BROWSER_PROFILE_OUTPUT.members["lastSavedBrowserId"], - self.last_saved_browser_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["profile_id"] = de.read_string( - _SCHEMA_GET_BROWSER_PROFILE_OUTPUT.members["profileId"] - ) - - case 1: - kwargs["profile_arn"] = de.read_string( - _SCHEMA_GET_BROWSER_PROFILE_OUTPUT.members["profileArn"] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_GET_BROWSER_PROFILE_OUTPUT.members["name"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_GET_BROWSER_PROFILE_OUTPUT.members["description"] - ) - - case 4: - kwargs["status"] = BrowserProfileStatus( - de.read_string( - _SCHEMA_GET_BROWSER_PROFILE_OUTPUT.members["status"] - ) - ) - - case 5: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_BROWSER_PROFILE_OUTPUT.members["createdAt"] - ) - - case 6: - kwargs["last_updated_at"] = de.read_timestamp( - _SCHEMA_GET_BROWSER_PROFILE_OUTPUT.members["lastUpdatedAt"] - ) - - case 7: - kwargs["last_saved_at"] = de.read_timestamp( - _SCHEMA_GET_BROWSER_PROFILE_OUTPUT.members["lastSavedAt"] - ) - - case 8: - kwargs["last_saved_browser_session_id"] = de.read_string( - _SCHEMA_GET_BROWSER_PROFILE_OUTPUT.members[ - "lastSavedBrowserSessionId" - ] - ) - - case 9: - kwargs["last_saved_browser_id"] = de.read_string( - _SCHEMA_GET_BROWSER_PROFILE_OUTPUT.members["lastSavedBrowserId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_BROWSER_PROFILE_OUTPUT, consumer=_consumer) - if "profile_id" not in kwargs: - kwargs["profile_id"] = "" - if "profile_arn" not in kwargs: - kwargs["profile_arn"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "status" not in kwargs: - kwargs["status"] = BrowserProfileStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "last_updated_at" not in kwargs: - kwargs["last_updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -GET_BROWSER_PROFILE = APIOperation( - input=GetBrowserProfileInput, - output=GetBrowserProfileOutput, - schema=_SCHEMA_GET_BROWSER_PROFILE, - input_schema=_SCHEMA_GET_BROWSER_PROFILE_INPUT, - output_schema=_SCHEMA_GET_BROWSER_PROFILE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListBrowserProfilesInput: - """Dataclass for ListBrowserProfilesInput structure.""" - - max_results: int | None = None - """The maximum number of results to return in the response.""" - - next_token: str | None = None - """A token to retrieve the next page of results.""" - - name: str | None = None - """The name of the browser profile to filter results by.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_BROWSER_PROFILES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_BROWSER_PROFILES_INPUT.members["maxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_BROWSER_PROFILES_INPUT.members["nextToken"], - self.next_token, - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_LIST_BROWSER_PROFILES_INPUT.members["name"], self.name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_BROWSER_PROFILES_INPUT.members["maxResults"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_BROWSER_PROFILES_INPUT.members["nextToken"] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_LIST_BROWSER_PROFILES_INPUT.members["name"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_BROWSER_PROFILES_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class BrowserProfileSummary: - """ - Contains summary information about a browser profile. A browser profile - stores persistent browser data that can be reused across browser - sessions. - """ - - profile_id: str - """The unique identifier of the browser profile.""" - - profile_arn: str - """The Amazon Resource Name (ARN) of the browser profile.""" - - name: str - """The name of the browser profile.""" - - status: str - """ - The current status of the browser profile. Possible values include - READY, SAVING, DELETING, and DELETED. - """ - - created_at: datetime - """The timestamp when the browser profile was created.""" - - last_updated_at: datetime - """The timestamp when the browser profile was last updated.""" - - description: str | None = field(repr=False, default=None) - """The description of the browser profile.""" - - last_saved_at: datetime | None = None - """The timestamp when browser session data was last saved to this profile.""" - - last_saved_browser_session_id: str | None = None - """ - The identifier of the browser session from which data was last saved to - this profile. - """ - - last_saved_browser_id: str | None = None - """ - The identifier of the browser from which data was last saved to this - profile. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BROWSER_PROFILE_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_BROWSER_PROFILE_SUMMARY.members["profileId"], self.profile_id - ) - serializer.write_string( - _SCHEMA_BROWSER_PROFILE_SUMMARY.members["profileArn"], self.profile_arn - ) - serializer.write_string( - _SCHEMA_BROWSER_PROFILE_SUMMARY.members["name"], self.name - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_BROWSER_PROFILE_SUMMARY.members["description"], self.description - ) - - serializer.write_string( - _SCHEMA_BROWSER_PROFILE_SUMMARY.members["status"], self.status - ) - serializer.write_timestamp( - _SCHEMA_BROWSER_PROFILE_SUMMARY.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_BROWSER_PROFILE_SUMMARY.members["lastUpdatedAt"], - self.last_updated_at, - ) - if self.last_saved_at is not None: - serializer.write_timestamp( - _SCHEMA_BROWSER_PROFILE_SUMMARY.members["lastSavedAt"], - self.last_saved_at, - ) - - if self.last_saved_browser_session_id is not None: - serializer.write_string( - _SCHEMA_BROWSER_PROFILE_SUMMARY.members["lastSavedBrowserSessionId"], - self.last_saved_browser_session_id, - ) - - if self.last_saved_browser_id is not None: - serializer.write_string( - _SCHEMA_BROWSER_PROFILE_SUMMARY.members["lastSavedBrowserId"], - self.last_saved_browser_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["profile_id"] = de.read_string( - _SCHEMA_BROWSER_PROFILE_SUMMARY.members["profileId"] - ) - - case 1: - kwargs["profile_arn"] = de.read_string( - _SCHEMA_BROWSER_PROFILE_SUMMARY.members["profileArn"] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_BROWSER_PROFILE_SUMMARY.members["name"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_BROWSER_PROFILE_SUMMARY.members["description"] - ) - - case 4: - kwargs["status"] = BrowserProfileStatus( - de.read_string( - _SCHEMA_BROWSER_PROFILE_SUMMARY.members["status"] - ) - ) - - case 5: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_BROWSER_PROFILE_SUMMARY.members["createdAt"] - ) - - case 6: - kwargs["last_updated_at"] = de.read_timestamp( - _SCHEMA_BROWSER_PROFILE_SUMMARY.members["lastUpdatedAt"] - ) - - case 7: - kwargs["last_saved_at"] = de.read_timestamp( - _SCHEMA_BROWSER_PROFILE_SUMMARY.members["lastSavedAt"] - ) - - case 8: - kwargs["last_saved_browser_session_id"] = de.read_string( - _SCHEMA_BROWSER_PROFILE_SUMMARY.members[ - "lastSavedBrowserSessionId" - ] - ) - - case 9: - kwargs["last_saved_browser_id"] = de.read_string( - _SCHEMA_BROWSER_PROFILE_SUMMARY.members["lastSavedBrowserId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BROWSER_PROFILE_SUMMARY, consumer=_consumer) - if "profile_id" not in kwargs: - kwargs["profile_id"] = "" - if "profile_arn" not in kwargs: - kwargs["profile_arn"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "status" not in kwargs: - kwargs["status"] = BrowserProfileStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "last_updated_at" not in kwargs: - kwargs["last_updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_browser_profile_summaries( - serializer: ShapeSerializer, schema: Schema, value: list[BrowserProfileSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_browser_profile_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[BrowserProfileSummary]: - result: list[BrowserProfileSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(BrowserProfileSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListBrowserProfilesOutput: - """Dataclass for ListBrowserProfilesOutput structure.""" - - profile_summaries: list[BrowserProfileSummary] - """The list of browser profile summaries.""" - - next_token: str | None = None - """A token to retrieve the next page of results.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_BROWSER_PROFILES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_browser_profile_summaries( - serializer, - _SCHEMA_LIST_BROWSER_PROFILES_OUTPUT.members["profileSummaries"], - self.profile_summaries, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_BROWSER_PROFILES_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["profile_summaries"] = ( - _deserialize_browser_profile_summaries( - de, - _SCHEMA_LIST_BROWSER_PROFILES_OUTPUT.members[ - "profileSummaries" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_BROWSER_PROFILES_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_BROWSER_PROFILES_OUTPUT, consumer=_consumer - ) - if "profile_summaries" not in kwargs: - kwargs["profile_summaries"] = [] - return kwargs - - -LIST_BROWSER_PROFILES = APIOperation( - input=ListBrowserProfilesInput, - output=ListBrowserProfilesOutput, - schema=_SCHEMA_LIST_BROWSER_PROFILES, - input_schema=_SCHEMA_LIST_BROWSER_PROFILES_INPUT, - output_schema=_SCHEMA_LIST_BROWSER_PROFILES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class BrowserSigningConfigInput: - """ - Configuration for enabling browser signing capabilities that allow - agents to cryptographically identify themselves to websites using HTTP - message signatures. - """ - - enabled: bool = False - """ - Specifies whether browser signing is enabled. When enabled, the browser - will cryptographically sign HTTP requests to identify itself as an AI - agent to bot control vendors. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BROWSER_SIGNING_CONFIG_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_boolean( - _SCHEMA_BROWSER_SIGNING_CONFIG_INPUT.members["enabled"], self.enabled - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["enabled"] = de.read_boolean( - _SCHEMA_BROWSER_SIGNING_CONFIG_INPUT.members["enabled"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_BROWSER_SIGNING_CONFIG_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class SecretsManagerLocation: - """The Amazon Web Services Secrets Manager location configuration.""" - - secret_arn: str - """ - The ARN of the Amazon Web Services Secrets Manager secret containing the - certificate. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SECRETS_MANAGER_LOCATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SECRETS_MANAGER_LOCATION.members["secretArn"], self.secret_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["secret_arn"] = de.read_string( - _SCHEMA_SECRETS_MANAGER_LOCATION.members["secretArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SECRETS_MANAGER_LOCATION, consumer=_consumer) - if "secret_arn" not in kwargs: - kwargs["secret_arn"] = "" - return kwargs - - -@dataclass -class CertificateLocationSecretsManager: - """The Amazon Web Services Secrets Manager location of the certificate.""" - - value: SecretsManagerLocation - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CERTIFICATE_LOCATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CERTIFICATE_LOCATION.members["secretsManager"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=SecretsManagerLocation.deserialize(deserializer)) - - -@dataclass -class CertificateLocationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -CertificateLocation = Union[ - CertificateLocationSecretsManager | CertificateLocationUnknown -] -"""The location from which to retrieve a certificate.""" - - -class _CertificateLocationDeserializer: - _result: CertificateLocation | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> CertificateLocation: - self._result = None - deserializer.read_struct(_SCHEMA_CERTIFICATE_LOCATION, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(CertificateLocationSecretsManager.deserialize(de)) - - case _: - self._set_result( - CertificateLocationUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: CertificateLocation) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class Certificate: - """A certificate to install in the browser or code interpreter.""" - - location: CertificateLocation - """The location of the certificate.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CERTIFICATE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CERTIFICATE.members["location"], self.location) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["location"] = _CertificateLocationDeserializer().deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CERTIFICATE, consumer=_consumer) - if "location" not in kwargs: - kwargs["location"] = CertificateLocationUnknown(tag="") - return kwargs - - -def _serialize_certificates( - serializer: ShapeSerializer, schema: Schema, value: list[Certificate] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_certificates( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Certificate]: - result: list[Certificate] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Certificate.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass -class ResourceLocationS3: - """ - The Amazon S3 location for storing data. This structure defines where in - Amazon S3 data is stored. - """ - - value: S3Location - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESOURCE_LOCATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESOURCE_LOCATION.members["s3"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=S3Location.deserialize(deserializer)) - - -@dataclass -class ResourceLocationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ResourceLocation = Union[ResourceLocationS3 | ResourceLocationUnknown] -"""The location of a resource.""" - - -class _ResourceLocationDeserializer: - _result: ResourceLocation | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> ResourceLocation: - self._result = None - deserializer.read_struct(_SCHEMA_RESOURCE_LOCATION, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(ResourceLocationS3.deserialize(de)) - - case _: - self._set_result( - ResourceLocationUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: ResourceLocation) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class BrowserEnterprisePolicyType(UnknownEnumMixin, StrEnum): - MANAGED = "MANAGED" - RECOMMENDED = "RECOMMENDED" - - -@dataclass(kw_only=True) -class BrowserEnterprisePolicy: - """Browser enterprise policy configuration.""" - - location: ResourceLocation - """The location of the enterprise policy file.""" - - type: str | None = None - """ - The type of browser enterprise policy. Available values are `MANAGED` - and `RECOMMENDED`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BROWSER_ENTERPRISE_POLICY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_BROWSER_ENTERPRISE_POLICY.members["location"], self.location - ) - if self.type is not None: - serializer.write_string( - _SCHEMA_BROWSER_ENTERPRISE_POLICY.members["type"], self.type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["location"] = _ResourceLocationDeserializer().deserialize(de) - - case 1: - kwargs["type"] = BrowserEnterprisePolicyType( - de.read_string( - _SCHEMA_BROWSER_ENTERPRISE_POLICY.members["type"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BROWSER_ENTERPRISE_POLICY, consumer=_consumer) - if "location" not in kwargs: - kwargs["location"] = ResourceLocationUnknown(tag="") - return kwargs - - -def _serialize_browser_enterprise_policies( - serializer: ShapeSerializer, schema: Schema, value: list[BrowserEnterprisePolicy] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_browser_enterprise_policies( - deserializer: ShapeDeserializer, schema: Schema -) -> list[BrowserEnterprisePolicy]: - result: list[BrowserEnterprisePolicy] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(BrowserEnterprisePolicy.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class EfsConfiguration: - """ - The configuration for mounting an Amazon Elastic File System (Amazon - EFS) access point that you own into a session. - """ - - access_point_arn: str - """ - The Amazon Resource Name (ARN) of the Amazon Elastic File System (Amazon - EFS) access point to mount. - """ - - mount_path: str - """ - The absolute path within the session at which the access point is - mounted, for example `/mnt/efs`. Each mount path must be unique across - all file system configurations in the session. - """ - - file_system_arn: str - """ - The Amazon Resource Name (ARN) of the Amazon Elastic File System (Amazon - EFS) file system that owns the access point. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EFS_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_EFS_CONFIGURATION.members["accessPointArn"], self.access_point_arn - ) - serializer.write_string( - _SCHEMA_EFS_CONFIGURATION.members["mountPath"], self.mount_path - ) - serializer.write_string( - _SCHEMA_EFS_CONFIGURATION.members["fileSystemArn"], self.file_system_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["access_point_arn"] = de.read_string( - _SCHEMA_EFS_CONFIGURATION.members["accessPointArn"] - ) - - case 1: - kwargs["mount_path"] = de.read_string( - _SCHEMA_EFS_CONFIGURATION.members["mountPath"] - ) - - case 2: - kwargs["file_system_arn"] = de.read_string( - _SCHEMA_EFS_CONFIGURATION.members["fileSystemArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EFS_CONFIGURATION, consumer=_consumer) - if "access_point_arn" not in kwargs: - kwargs["access_point_arn"] = "" - if "mount_path" not in kwargs: - kwargs["mount_path"] = "" - if "file_system_arn" not in kwargs: - kwargs["file_system_arn"] = "" - return kwargs - - -@dataclass(kw_only=True) -class S3FilesConfiguration: - """ - The configuration for mounting an Amazon Simple Storage Service (Amazon - S3) Files access point that you own into a session. - """ - - access_point_arn: str - """ - The Amazon Resource Name (ARN) of the Amazon Simple Storage Service - (Amazon S3) Files access point to mount. - """ - - mount_path: str - """ - The absolute path within the session at which the access point is - mounted, for example `/mnt/s3data`. Each mount path must be unique - across all file system configurations in the session. - """ - - file_system_arn: str - """ - The Amazon Resource Name (ARN) of the Amazon Simple Storage Service - (Amazon S3) Files file system that owns the access point. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_S3_FILES_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_S3_FILES_CONFIGURATION.members["accessPointArn"], - self.access_point_arn, - ) - serializer.write_string( - _SCHEMA_S3_FILES_CONFIGURATION.members["mountPath"], self.mount_path - ) - serializer.write_string( - _SCHEMA_S3_FILES_CONFIGURATION.members["fileSystemArn"], - self.file_system_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["access_point_arn"] = de.read_string( - _SCHEMA_S3_FILES_CONFIGURATION.members["accessPointArn"] - ) - - case 1: - kwargs["mount_path"] = de.read_string( - _SCHEMA_S3_FILES_CONFIGURATION.members["mountPath"] - ) - - case 2: - kwargs["file_system_arn"] = de.read_string( - _SCHEMA_S3_FILES_CONFIGURATION.members["fileSystemArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_S3_FILES_CONFIGURATION, consumer=_consumer) - if "access_point_arn" not in kwargs: - kwargs["access_point_arn"] = "" - if "mount_path" not in kwargs: - kwargs["mount_path"] = "" - if "file_system_arn" not in kwargs: - kwargs["file_system_arn"] = "" - return kwargs - - -@dataclass -class ToolsFileSystemConfigurationS3FilesConfiguration: - """ - The configuration for mounting your own Amazon Simple Storage Service - (Amazon S3) Files access point into the session. - """ - - value: S3FilesConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOLS_FILE_SYSTEM_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_TOOLS_FILE_SYSTEM_CONFIGURATION.members["s3FilesConfiguration"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=S3FilesConfiguration.deserialize(deserializer)) - - -@dataclass -class ToolsFileSystemConfigurationEfsConfiguration: - """ - The configuration for mounting your own Amazon Elastic File System - (Amazon EFS) access point into the session. - """ - - value: EfsConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOLS_FILE_SYSTEM_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_TOOLS_FILE_SYSTEM_CONFIGURATION.members["efsConfiguration"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=EfsConfiguration.deserialize(deserializer)) - - -@dataclass -class ToolsFileSystemConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ToolsFileSystemConfiguration = Union[ - ToolsFileSystemConfigurationS3FilesConfiguration - | ToolsFileSystemConfigurationEfsConfiguration - | ToolsFileSystemConfigurationUnknown -] -""" -Specifies a file system to mount into the session by providing exactly -one of the following: - -- `s3FilesConfiguration` - Mounts an Amazon Simple Storage Service - (Amazon S3) Files access point. - -- `efsConfiguration` - Mounts an Amazon Elastic File System (Amazon EFS) - access point. -""" - - -class _ToolsFileSystemConfigurationDeserializer: - _result: ToolsFileSystemConfiguration | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> ToolsFileSystemConfiguration: - self._result = None - deserializer.read_struct( - _SCHEMA_TOOLS_FILE_SYSTEM_CONFIGURATION, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - ToolsFileSystemConfigurationS3FilesConfiguration.deserialize(de) - ) - - case 1: - self._set_result( - ToolsFileSystemConfigurationEfsConfiguration.deserialize(de) - ) - - case _: - self._set_result( - ToolsFileSystemConfigurationUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: ToolsFileSystemConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_tools_file_system_configurations( - serializer: ShapeSerializer, - schema: Schema, - value: list[ToolsFileSystemConfiguration], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_tools_file_system_configurations( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ToolsFileSystemConfiguration]: - result: list[ToolsFileSystemConfiguration] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_ToolsFileSystemConfigurationDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class BrowserNetworkMode(UnknownEnumMixin, StrEnum): - PUBLIC = "PUBLIC" - VPC = "VPC" - - -@dataclass(kw_only=True) -class BrowserNetworkConfiguration: - """ - The network configuration for a browser. This structure defines how the - browser connects to the network. - """ - - network_mode: str = BrowserNetworkMode("PUBLIC") - """ - The network mode for the browser. This field specifies how the browser - connects to the network. - """ - - vpc_config: VpcConfig | None = None - """ - The VPC configuration for the browser. This configuration is required - when the network mode is set to `VPC`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BROWSER_NETWORK_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_BROWSER_NETWORK_CONFIGURATION.members["networkMode"], - self.network_mode, - ) - if self.vpc_config is not None: - serializer.write_struct( - _SCHEMA_BROWSER_NETWORK_CONFIGURATION.members["vpcConfig"], - self.vpc_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["network_mode"] = BrowserNetworkMode( - de.read_string( - _SCHEMA_BROWSER_NETWORK_CONFIGURATION.members["networkMode"] - ) - ) - - case 1: - kwargs["vpc_config"] = VpcConfig.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_BROWSER_NETWORK_CONFIGURATION, consumer=_consumer - ) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls() - - -@dataclass(kw_only=True) -class RecordingConfig: - """ - The recording configuration for a browser. This structure defines how - browser sessions are recorded. - """ - - enabled: bool = False - """ - Indicates whether recording is enabled for the browser. When set to - true, browser sessions are recorded. - """ - - s3_location: S3Location | None = None - """ - The Amazon S3 location where browser recordings are stored. This - location contains the recorded browser sessions. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RECORDING_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_boolean( - _SCHEMA_RECORDING_CONFIG.members["enabled"], self.enabled - ) - if self.s3_location is not None: - serializer.write_struct( - _SCHEMA_RECORDING_CONFIG.members["s3Location"], self.s3_location - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["enabled"] = de.read_boolean( - _SCHEMA_RECORDING_CONFIG.members["enabled"] - ) - - case 1: - kwargs["s3_location"] = S3Location.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RECORDING_CONFIG, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CreateBrowserInput: - """Dataclass for CreateBrowserInput structure.""" - - name: str | None = None - """The name of the browser. The name must be unique within your account.""" - - description: str | None = field(repr=False, default=None) - """The description of the browser.""" - - execution_role_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the IAM role that provides permissions - for the browser to access Amazon Web Services services. - """ - - network_configuration: BrowserNetworkConfiguration | None = None - """ - The network configuration for the browser. This configuration specifies - the network mode for the browser. - """ - - recording: RecordingConfig | None = None - """ - The recording configuration for the browser. When enabled, browser - sessions are recorded and stored in the specified Amazon S3 location. - """ - - browser_signing: BrowserSigningConfigInput | None = None - """ - The browser signing configuration that enables cryptographic agent - identification using HTTP message signatures for web bot authentication. - """ - - enterprise_policies: list[BrowserEnterprisePolicy] | None = None - """A list of enterprise policy files for the browser.""" - - certificates: list[Certificate] | None = None - """A list of certificates to install in the browser.""" - - filesystem_configurations: list[ToolsFileSystemConfiguration] | None = None - """ - The file system configurations to mount into the browser. Use these - configurations to mount your own Amazon Simple Storage Service (Amazon - S3) Files or Amazon Elastic File System (Amazon EFS) access points. Your - sessions can then access your data. If you don't specify this field, no - file systems are mounted. - """ - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the operation - completes no more than one time. If this token matches a previous - request, Amazon Bedrock AgentCore ignores the request but does not - return an error. - """ - - tags: dict[str, str] | None = None - """ - A map of tag keys and values to assign to the browser. Tags enable you - to categorize your resources in different ways, for example, by purpose, - owner, or environment. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_BROWSER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_BROWSER_INPUT.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_BROWSER_INPUT.members["description"], self.description - ) - - if self.execution_role_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_BROWSER_INPUT.members["executionRoleArn"], - self.execution_role_arn, - ) - - if self.network_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_BROWSER_INPUT.members["networkConfiguration"], - self.network_configuration, - ) - - if self.recording is not None: - serializer.write_struct( - _SCHEMA_CREATE_BROWSER_INPUT.members["recording"], self.recording - ) - - if self.browser_signing is not None: - serializer.write_struct( - _SCHEMA_CREATE_BROWSER_INPUT.members["browserSigning"], - self.browser_signing, - ) - - if self.enterprise_policies is not None: - _serialize_browser_enterprise_policies( - serializer, - _SCHEMA_CREATE_BROWSER_INPUT.members["enterprisePolicies"], - self.enterprise_policies, - ) - - if self.certificates is not None: - _serialize_certificates( - serializer, - _SCHEMA_CREATE_BROWSER_INPUT.members["certificates"], - self.certificates, - ) - - if self.filesystem_configurations is not None: - _serialize_tools_file_system_configurations( - serializer, - _SCHEMA_CREATE_BROWSER_INPUT.members["filesystemConfigurations"], - self.filesystem_configurations, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_BROWSER_INPUT.members["clientToken"], self.client_token - ) - - if self.tags is not None: - _serialize_tags_map( - serializer, _SCHEMA_CREATE_BROWSER_INPUT.members["tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_BROWSER_INPUT.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_BROWSER_INPUT.members["description"] - ) - - case 2: - kwargs["execution_role_arn"] = de.read_string( - _SCHEMA_CREATE_BROWSER_INPUT.members["executionRoleArn"] - ) - - case 3: - kwargs["network_configuration"] = ( - BrowserNetworkConfiguration.deserialize(de) - ) - - case 4: - kwargs["recording"] = RecordingConfig.deserialize(de) - - case 5: - kwargs["browser_signing"] = BrowserSigningConfigInput.deserialize( - de - ) - - case 6: - kwargs["enterprise_policies"] = ( - _deserialize_browser_enterprise_policies( - de, - _SCHEMA_CREATE_BROWSER_INPUT.members["enterprisePolicies"], - ) - ) - - case 7: - kwargs["certificates"] = _deserialize_certificates( - de, _SCHEMA_CREATE_BROWSER_INPUT.members["certificates"] - ) - - case 8: - kwargs["filesystem_configurations"] = ( - _deserialize_tools_file_system_configurations( - de, - _SCHEMA_CREATE_BROWSER_INPUT.members[ - "filesystemConfigurations" - ], - ) - ) - - case 9: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_BROWSER_INPUT.members["clientToken"] - ) - - case 10: - kwargs["tags"] = _deserialize_tags_map( - de, _SCHEMA_CREATE_BROWSER_INPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_BROWSER_INPUT, consumer=_consumer) - return kwargs - - -class BrowserStatus(UnknownEnumMixin, StrEnum): - CREATING = "CREATING" - CREATE_FAILED = "CREATE_FAILED" - READY = "READY" - DELETING = "DELETING" - DELETE_FAILED = "DELETE_FAILED" - DELETED = "DELETED" - - -@dataclass(kw_only=True) -class CreateBrowserOutput: - """Dataclass for CreateBrowserOutput structure.""" - - browser_id: str - """The unique identifier of the created browser.""" - - browser_arn: str - """The Amazon Resource Name (ARN) of the created browser.""" - - created_at: datetime - """The timestamp when the browser was created.""" - - status: str - """The current status of the browser.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_BROWSER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_BROWSER_OUTPUT.members["browserId"], self.browser_id - ) - serializer.write_string( - _SCHEMA_CREATE_BROWSER_OUTPUT.members["browserArn"], self.browser_arn - ) - serializer.write_timestamp( - _SCHEMA_CREATE_BROWSER_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_string( - _SCHEMA_CREATE_BROWSER_OUTPUT.members["status"], self.status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["browser_id"] = de.read_string( - _SCHEMA_CREATE_BROWSER_OUTPUT.members["browserId"] - ) - - case 1: - kwargs["browser_arn"] = de.read_string( - _SCHEMA_CREATE_BROWSER_OUTPUT.members["browserArn"] - ) - - case 2: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_CREATE_BROWSER_OUTPUT.members["createdAt"] - ) - - case 3: - kwargs["status"] = BrowserStatus( - de.read_string(_SCHEMA_CREATE_BROWSER_OUTPUT.members["status"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_BROWSER_OUTPUT, consumer=_consumer) - if "browser_id" not in kwargs: - kwargs["browser_id"] = "" - if "browser_arn" not in kwargs: - kwargs["browser_arn"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "status" not in kwargs: - kwargs["status"] = BrowserStatus._corrected("") - return kwargs - - -CREATE_BROWSER = APIOperation( - input=CreateBrowserInput, - output=CreateBrowserOutput, - schema=_SCHEMA_CREATE_BROWSER, - input_schema=_SCHEMA_CREATE_BROWSER_INPUT, - output_schema=_SCHEMA_CREATE_BROWSER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteBrowserInput: - """Dataclass for DeleteBrowserInput structure.""" - - browser_id: str | None = None - """The unique identifier of the browser to delete.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure idempotency of the - request. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_BROWSER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.browser_id is not None: - serializer.write_string( - _SCHEMA_DELETE_BROWSER_INPUT.members["browserId"], self.browser_id - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_DELETE_BROWSER_INPUT.members["clientToken"], self.client_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["browser_id"] = de.read_string( - _SCHEMA_DELETE_BROWSER_INPUT.members["browserId"] - ) - - case 1: - kwargs["client_token"] = de.read_string( - _SCHEMA_DELETE_BROWSER_INPUT.members["clientToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_BROWSER_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteBrowserOutput: - """Dataclass for DeleteBrowserOutput structure.""" - - browser_id: str - """The unique identifier of the deleted browser.""" - - status: str - """The current status of the browser deletion.""" - - last_updated_at: datetime - """The timestamp when the browser was last updated.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_BROWSER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DELETE_BROWSER_OUTPUT.members["browserId"], self.browser_id - ) - serializer.write_string( - _SCHEMA_DELETE_BROWSER_OUTPUT.members["status"], self.status - ) - serializer.write_timestamp( - _SCHEMA_DELETE_BROWSER_OUTPUT.members["lastUpdatedAt"], self.last_updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["browser_id"] = de.read_string( - _SCHEMA_DELETE_BROWSER_OUTPUT.members["browserId"] - ) - - case 1: - kwargs["status"] = BrowserStatus( - de.read_string(_SCHEMA_DELETE_BROWSER_OUTPUT.members["status"]) - ) - - case 2: - kwargs["last_updated_at"] = de.read_timestamp( - _SCHEMA_DELETE_BROWSER_OUTPUT.members["lastUpdatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_BROWSER_OUTPUT, consumer=_consumer) - if "browser_id" not in kwargs: - kwargs["browser_id"] = "" - if "status" not in kwargs: - kwargs["status"] = BrowserStatus._corrected("") - if "last_updated_at" not in kwargs: - kwargs["last_updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -DELETE_BROWSER = APIOperation( - input=DeleteBrowserInput, - output=DeleteBrowserOutput, - schema=_SCHEMA_DELETE_BROWSER, - input_schema=_SCHEMA_DELETE_BROWSER_INPUT, - output_schema=_SCHEMA_DELETE_BROWSER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetBrowserInput: - """Dataclass for GetBrowserInput structure.""" - - browser_id: str | None = None - """The unique identifier of the browser to retrieve.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_BROWSER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.browser_id is not None: - serializer.write_string( - _SCHEMA_GET_BROWSER_INPUT.members["browserId"], self.browser_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["browser_id"] = de.read_string( - _SCHEMA_GET_BROWSER_INPUT.members["browserId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_BROWSER_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class BrowserSigningConfigOutput: - """ - The current browser signing configuration that shows whether - cryptographic agent identification is enabled for web bot - authentication. - """ - - enabled: bool = False - """ - Indicates whether browser signing is currently enabled for cryptographic - agent identification using HTTP message signatures. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BROWSER_SIGNING_CONFIG_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_boolean( - _SCHEMA_BROWSER_SIGNING_CONFIG_OUTPUT.members["enabled"], self.enabled - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["enabled"] = de.read_boolean( - _SCHEMA_BROWSER_SIGNING_CONFIG_OUTPUT.members["enabled"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_BROWSER_SIGNING_CONFIG_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetBrowserOutput: - """Dataclass for GetBrowserOutput structure.""" - - browser_id: str - """The unique identifier of the browser.""" - - browser_arn: str - """The Amazon Resource Name (ARN) of the browser.""" - - name: str - """The name of the browser.""" - - network_configuration: BrowserNetworkConfiguration - """ - The network configuration for a browser. This structure defines how the - browser connects to the network. - """ - - status: str - """The current status of the browser.""" - - created_at: datetime - """The timestamp when the browser was created.""" - - last_updated_at: datetime - """The timestamp when the browser was last updated.""" - - description: str | None = field(repr=False, default=None) - """The description of the browser.""" - - execution_role_arn: str | None = None - """The IAM role ARN that provides permissions for the browser.""" - - recording: RecordingConfig | None = None - """ - The recording configuration for a browser. This structure defines how - browser sessions are recorded. - """ - - browser_signing: BrowserSigningConfigOutput | None = None - """ - The browser signing configuration that shows whether cryptographic agent - identification is enabled for web bot authentication. - """ - - enterprise_policies: list[BrowserEnterprisePolicy] | None = None - """The list of enterprise policy files configured for the browser.""" - - certificates: list[Certificate] | None = None - """The list of certificates configured for the browser.""" - - filesystem_configurations: list[ToolsFileSystemConfiguration] | None = None - """ - The file system configurations mounted into the browser. Each entry - describes an access point and its mount path. - """ - - failure_reason: str | None = None - """The reason for failure if the browser is in a failed state.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_BROWSER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_BROWSER_OUTPUT.members["browserId"], self.browser_id - ) - serializer.write_string( - _SCHEMA_GET_BROWSER_OUTPUT.members["browserArn"], self.browser_arn - ) - serializer.write_string(_SCHEMA_GET_BROWSER_OUTPUT.members["name"], self.name) - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_BROWSER_OUTPUT.members["description"], self.description - ) - - if self.execution_role_arn is not None: - serializer.write_string( - _SCHEMA_GET_BROWSER_OUTPUT.members["executionRoleArn"], - self.execution_role_arn, - ) - - serializer.write_struct( - _SCHEMA_GET_BROWSER_OUTPUT.members["networkConfiguration"], - self.network_configuration, - ) - if self.recording is not None: - serializer.write_struct( - _SCHEMA_GET_BROWSER_OUTPUT.members["recording"], self.recording - ) - - if self.browser_signing is not None: - serializer.write_struct( - _SCHEMA_GET_BROWSER_OUTPUT.members["browserSigning"], - self.browser_signing, - ) - - if self.enterprise_policies is not None: - _serialize_browser_enterprise_policies( - serializer, - _SCHEMA_GET_BROWSER_OUTPUT.members["enterprisePolicies"], - self.enterprise_policies, - ) - - if self.certificates is not None: - _serialize_certificates( - serializer, - _SCHEMA_GET_BROWSER_OUTPUT.members["certificates"], - self.certificates, - ) - - if self.filesystem_configurations is not None: - _serialize_tools_file_system_configurations( - serializer, - _SCHEMA_GET_BROWSER_OUTPUT.members["filesystemConfigurations"], - self.filesystem_configurations, - ) - - serializer.write_string( - _SCHEMA_GET_BROWSER_OUTPUT.members["status"], self.status - ) - if self.failure_reason is not None: - serializer.write_string( - _SCHEMA_GET_BROWSER_OUTPUT.members["failureReason"], self.failure_reason - ) - - serializer.write_timestamp( - _SCHEMA_GET_BROWSER_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_GET_BROWSER_OUTPUT.members["lastUpdatedAt"], self.last_updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["browser_id"] = de.read_string( - _SCHEMA_GET_BROWSER_OUTPUT.members["browserId"] - ) - - case 1: - kwargs["browser_arn"] = de.read_string( - _SCHEMA_GET_BROWSER_OUTPUT.members["browserArn"] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_GET_BROWSER_OUTPUT.members["name"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_GET_BROWSER_OUTPUT.members["description"] - ) - - case 4: - kwargs["execution_role_arn"] = de.read_string( - _SCHEMA_GET_BROWSER_OUTPUT.members["executionRoleArn"] - ) - - case 5: - kwargs["network_configuration"] = ( - BrowserNetworkConfiguration.deserialize(de) - ) - - case 6: - kwargs["recording"] = RecordingConfig.deserialize(de) - - case 7: - kwargs["browser_signing"] = BrowserSigningConfigOutput.deserialize( - de - ) - - case 8: - kwargs["enterprise_policies"] = ( - _deserialize_browser_enterprise_policies( - de, _SCHEMA_GET_BROWSER_OUTPUT.members["enterprisePolicies"] - ) - ) - - case 9: - kwargs["certificates"] = _deserialize_certificates( - de, _SCHEMA_GET_BROWSER_OUTPUT.members["certificates"] - ) - - case 10: - kwargs["filesystem_configurations"] = ( - _deserialize_tools_file_system_configurations( - de, - _SCHEMA_GET_BROWSER_OUTPUT.members[ - "filesystemConfigurations" - ], - ) - ) - - case 11: - kwargs["status"] = BrowserStatus( - de.read_string(_SCHEMA_GET_BROWSER_OUTPUT.members["status"]) - ) - - case 12: - kwargs["failure_reason"] = de.read_string( - _SCHEMA_GET_BROWSER_OUTPUT.members["failureReason"] - ) - - case 13: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_BROWSER_OUTPUT.members["createdAt"] - ) - - case 14: - kwargs["last_updated_at"] = de.read_timestamp( - _SCHEMA_GET_BROWSER_OUTPUT.members["lastUpdatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_BROWSER_OUTPUT, consumer=_consumer) - if "browser_id" not in kwargs: - kwargs["browser_id"] = "" - if "browser_arn" not in kwargs: - kwargs["browser_arn"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "network_configuration" not in kwargs: - kwargs["network_configuration"] = ( - BrowserNetworkConfiguration._smithy_default() - ) - if "status" not in kwargs: - kwargs["status"] = BrowserStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "last_updated_at" not in kwargs: - kwargs["last_updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -GET_BROWSER = APIOperation( - input=GetBrowserInput, - output=GetBrowserOutput, - schema=_SCHEMA_GET_BROWSER, - input_schema=_SCHEMA_GET_BROWSER_INPUT, - output_schema=_SCHEMA_GET_BROWSER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - ], -) - - -class ResourceType(UnknownEnumMixin, StrEnum): - SYSTEM = "SYSTEM" - CUSTOM = "CUSTOM" - - -@dataclass(kw_only=True) -class ListBrowsersInput: - """Dataclass for ListBrowsersInput structure.""" - - max_results: int | None = None - """ - The maximum number of results to return in a single call. The default - value is 10. The maximum value is 50. - """ - - next_token: str | None = None - """ - The token for the next set of results. Use the value returned in the - previous response in the next request to retrieve the next set of - results. - """ - - type: str | None = None - """ - The type of browsers to list. If not specified, all browser types are - returned. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_BROWSERS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_BROWSERS_INPUT.members["maxResults"], self.max_results - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_BROWSERS_INPUT.members["nextToken"], self.next_token - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_LIST_BROWSERS_INPUT.members["type"], self.type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_BROWSERS_INPUT.members["maxResults"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_BROWSERS_INPUT.members["nextToken"] - ) - - case 2: - kwargs["type"] = ResourceType( - de.read_string(_SCHEMA_LIST_BROWSERS_INPUT.members["type"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_BROWSERS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class BrowserSummary: - """ - Contains summary information about a browser. A browser enables Amazon - Bedrock AgentCore Agent to interact with web content. - """ - - browser_id: str - """The unique identifier of the browser.""" - - browser_arn: str - """The Amazon Resource Name (ARN) of the browser.""" - - status: str - """The current status of the browser.""" - - created_at: datetime - """The timestamp when the browser was created.""" - - name: str | None = None - """The name of the browser.""" - - description: str | None = field(repr=False, default=None) - """The description of the browser.""" - - last_updated_at: datetime | None = None - """The timestamp when the browser was last updated.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BROWSER_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_BROWSER_SUMMARY.members["browserId"], self.browser_id - ) - serializer.write_string( - _SCHEMA_BROWSER_SUMMARY.members["browserArn"], self.browser_arn - ) - if self.name is not None: - serializer.write_string(_SCHEMA_BROWSER_SUMMARY.members["name"], self.name) - - if self.description is not None: - serializer.write_string( - _SCHEMA_BROWSER_SUMMARY.members["description"], self.description - ) - - serializer.write_string(_SCHEMA_BROWSER_SUMMARY.members["status"], self.status) - serializer.write_timestamp( - _SCHEMA_BROWSER_SUMMARY.members["createdAt"], self.created_at - ) - if self.last_updated_at is not None: - serializer.write_timestamp( - _SCHEMA_BROWSER_SUMMARY.members["lastUpdatedAt"], self.last_updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["browser_id"] = de.read_string( - _SCHEMA_BROWSER_SUMMARY.members["browserId"] - ) - - case 1: - kwargs["browser_arn"] = de.read_string( - _SCHEMA_BROWSER_SUMMARY.members["browserArn"] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_BROWSER_SUMMARY.members["name"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_BROWSER_SUMMARY.members["description"] - ) - - case 4: - kwargs["status"] = BrowserStatus( - de.read_string(_SCHEMA_BROWSER_SUMMARY.members["status"]) - ) - - case 5: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_BROWSER_SUMMARY.members["createdAt"] - ) - - case 6: - kwargs["last_updated_at"] = de.read_timestamp( - _SCHEMA_BROWSER_SUMMARY.members["lastUpdatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BROWSER_SUMMARY, consumer=_consumer) - if "browser_id" not in kwargs: - kwargs["browser_id"] = "" - if "browser_arn" not in kwargs: - kwargs["browser_arn"] = "" - if "status" not in kwargs: - kwargs["status"] = BrowserStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_browser_summaries( - serializer: ShapeSerializer, schema: Schema, value: list[BrowserSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_browser_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[BrowserSummary]: - result: list[BrowserSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(BrowserSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListBrowsersOutput: - """Dataclass for ListBrowsersOutput structure.""" - - browser_summaries: list[BrowserSummary] - """The list of browser summaries.""" - - next_token: str | None = None - """A token to retrieve the next page of results.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_BROWSERS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_browser_summaries( - serializer, - _SCHEMA_LIST_BROWSERS_OUTPUT.members["browserSummaries"], - self.browser_summaries, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_BROWSERS_OUTPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["browser_summaries"] = _deserialize_browser_summaries( - de, _SCHEMA_LIST_BROWSERS_OUTPUT.members["browserSummaries"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_BROWSERS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_BROWSERS_OUTPUT, consumer=_consumer) - if "browser_summaries" not in kwargs: - kwargs["browser_summaries"] = [] - return kwargs - - -LIST_BROWSERS = APIOperation( - input=ListBrowsersInput, - output=ListBrowsersOutput, - schema=_SCHEMA_LIST_BROWSERS, - input_schema=_SCHEMA_LIST_BROWSERS_INPUT, - output_schema=_SCHEMA_LIST_BROWSERS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class CapacityReservationPreference(UnknownEnumMixin, StrEnum): - CAPACITY_RESERVATIONS_ONLY = "capacity-reservations-only" - OPEN = "open" - NONE = "none" - - -@dataclass(kw_only=True) -class CapacityReservationTarget: - """ - Information about the target Capacity Reservation or Capacity - Reservation group for the instances. - """ - - capacity_reservation_id: str | None = None - """The ID of the Capacity Reservation in which to run the instances.""" - - capacity_reservation_resource_group_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the Capacity Reservation resource - group in which to run the instances. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CAPACITY_RESERVATION_TARGET, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.capacity_reservation_id is not None: - serializer.write_string( - _SCHEMA_CAPACITY_RESERVATION_TARGET.members["capacityReservationId"], - self.capacity_reservation_id, - ) - - if self.capacity_reservation_resource_group_arn is not None: - serializer.write_string( - _SCHEMA_CAPACITY_RESERVATION_TARGET.members[ - "capacityReservationResourceGroupArn" - ], - self.capacity_reservation_resource_group_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["capacity_reservation_id"] = de.read_string( - _SCHEMA_CAPACITY_RESERVATION_TARGET.members[ - "capacityReservationId" - ] - ) - - case 1: - kwargs["capacity_reservation_resource_group_arn"] = de.read_string( - _SCHEMA_CAPACITY_RESERVATION_TARGET.members[ - "capacityReservationResourceGroupArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CAPACITY_RESERVATION_TARGET, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CapacityReservationSpecification: - """The Capacity Reservation targeting option for the instances.""" - - capacity_reservation_preference: str | None = None - """The Capacity Reservation preference for the instances.""" - - capacity_reservation_target: CapacityReservationTarget | None = None - """ - The target Capacity Reservation or Capacity Reservation group for the - instances. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CAPACITY_RESERVATION_SPECIFICATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.capacity_reservation_preference is not None: - serializer.write_string( - _SCHEMA_CAPACITY_RESERVATION_SPECIFICATION.members[ - "capacityReservationPreference" - ], - self.capacity_reservation_preference, - ) - - if self.capacity_reservation_target is not None: - serializer.write_struct( - _SCHEMA_CAPACITY_RESERVATION_SPECIFICATION.members[ - "capacityReservationTarget" - ], - self.capacity_reservation_target, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["capacity_reservation_preference"] = ( - CapacityReservationPreference( - de.read_string( - _SCHEMA_CAPACITY_RESERVATION_SPECIFICATION.members[ - "capacityReservationPreference" - ] - ) - ) - ) - - case 1: - kwargs["capacity_reservation_target"] = ( - CapacityReservationTarget.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CAPACITY_RESERVATION_SPECIFICATION, consumer=_consumer - ) - return kwargs - - -class EbsVolumeType(UnknownEnumMixin, StrEnum): - """The type of Amazon EBS volume.""" - - STANDARD = "standard" - IO1 = "io1" - IO2 = "io2" - GP2 = "gp2" - SC1 = "sc1" - ST1 = "st1" - GP3 = "gp3" - - -@dataclass(kw_only=True) -class EphemeralEBSVolumeConfiguration: - """ - The shared Amazon EBS performance and encryption properties for a - volume. These properties are common across the different volume - configurations for a capacity provider. - """ - - volume_type: str = EbsVolumeType("gp3") - """ - The Amazon EBS volume type. If you do not specify a type, the default is - `gp3`. - """ - - iops: int | None = None - """ - The number of IOPS to provision. For `gp3`, `io1`, and `io2` volumes, - this is the number of IOPS provisioned for the volume. For `gp2` - volumes, this sets the baseline IOPS performance. It also controls the - rate at which the volume accumulates I/O credits for bursting. Supported - values: `gp3`, 3,000--80,000; `io1`, 100--64,000; `io2`, 100--256,000. - """ - - throughput: int | None = None - """ - The throughput to provision, in MiB/s. Valid only for `gp3` volumes. - Valid range: 125--2,000 MiB/s. - """ - - encrypted: bool | None = None - """ - Specifies whether to encrypt the volume. Encrypted volumes can be - attached only to instances that support Amazon EBS encryption. If you - create a volume from a snapshot, you cannot specify an encryption value. - """ - - kms_key_id: str | None = None - """ - The identifier (key ID, key alias, key ARN, or alias ARN) of the - customer managed KMS key to use for Amazon EBS encryption. - """ - - snapshot_id: str | None = None - """The ID of the snapshot.""" - - volume_size: int | None = None - """ - The size of the volume, in GiB. You must specify either a snapshot ID or - a volume size. Supported sizes: `gp2`, 1--16,384; `gp3`, 1--65,536; - `io1`, 4--16,384; `io2`, 4--65,536. - """ - - volume_initialization_rate: int | None = None - """ - The rate at which the volume is initialized after creation, in MiB/s. - Supported only for volumes created from snapshots. Valid range: 100--300 - MiB/s. - """ - - ebs_card_index: int | None = None - """ - The index of the Amazon EBS card. Applies to instances with multiple - Amazon EBS cards. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EPHEMERAL_EBS_VOLUME_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_EPHEMERAL_EBS_VOLUME_CONFIGURATION.members["volumeType"], - self.volume_type, - ) - if self.iops is not None: - serializer.write_integer( - _SCHEMA_EPHEMERAL_EBS_VOLUME_CONFIGURATION.members["iops"], self.iops - ) - - if self.throughput is not None: - serializer.write_integer( - _SCHEMA_EPHEMERAL_EBS_VOLUME_CONFIGURATION.members["throughput"], - self.throughput, - ) - - if self.encrypted is not None: - serializer.write_boolean( - _SCHEMA_EPHEMERAL_EBS_VOLUME_CONFIGURATION.members["encrypted"], - self.encrypted, - ) - - if self.kms_key_id is not None: - serializer.write_string( - _SCHEMA_EPHEMERAL_EBS_VOLUME_CONFIGURATION.members["kmsKeyId"], - self.kms_key_id, - ) - - if self.snapshot_id is not None: - serializer.write_string( - _SCHEMA_EPHEMERAL_EBS_VOLUME_CONFIGURATION.members["snapshotId"], - self.snapshot_id, - ) - - if self.volume_size is not None: - serializer.write_integer( - _SCHEMA_EPHEMERAL_EBS_VOLUME_CONFIGURATION.members["volumeSize"], - self.volume_size, - ) - - if self.volume_initialization_rate is not None: - serializer.write_integer( - _SCHEMA_EPHEMERAL_EBS_VOLUME_CONFIGURATION.members[ - "volumeInitializationRate" - ], - self.volume_initialization_rate, - ) - - if self.ebs_card_index is not None: - serializer.write_integer( - _SCHEMA_EPHEMERAL_EBS_VOLUME_CONFIGURATION.members["ebsCardIndex"], - self.ebs_card_index, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["volume_type"] = EbsVolumeType( - de.read_string( - _SCHEMA_EPHEMERAL_EBS_VOLUME_CONFIGURATION.members[ - "volumeType" - ] - ) - ) - - case 1: - kwargs["iops"] = de.read_integer( - _SCHEMA_EPHEMERAL_EBS_VOLUME_CONFIGURATION.members["iops"] - ) - - case 2: - kwargs["throughput"] = de.read_integer( - _SCHEMA_EPHEMERAL_EBS_VOLUME_CONFIGURATION.members["throughput"] - ) - - case 3: - kwargs["encrypted"] = de.read_boolean( - _SCHEMA_EPHEMERAL_EBS_VOLUME_CONFIGURATION.members["encrypted"] - ) - - case 4: - kwargs["kms_key_id"] = de.read_string( - _SCHEMA_EPHEMERAL_EBS_VOLUME_CONFIGURATION.members["kmsKeyId"] - ) - - case 5: - kwargs["snapshot_id"] = de.read_string( - _SCHEMA_EPHEMERAL_EBS_VOLUME_CONFIGURATION.members["snapshotId"] - ) - - case 6: - kwargs["volume_size"] = de.read_integer( - _SCHEMA_EPHEMERAL_EBS_VOLUME_CONFIGURATION.members["volumeSize"] - ) - - case 7: - kwargs["volume_initialization_rate"] = de.read_integer( - _SCHEMA_EPHEMERAL_EBS_VOLUME_CONFIGURATION.members[ - "volumeInitializationRate" - ] - ) - - case 8: - kwargs["ebs_card_index"] = de.read_integer( - _SCHEMA_EPHEMERAL_EBS_VOLUME_CONFIGURATION.members[ - "ebsCardIndex" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EPHEMERAL_EBS_VOLUME_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class EphemeralBlockDeviceMapping: - """A block device mapping for an instance store (ephemeral) volume.""" - - device_name: str | None = None - """The device name, for example `/dev/sdh` or `xvdh`.""" - - virtual_name: str | None = None - """ - The virtual device name (`ephemeralN`). Instance store volumes are - numbered starting from 0. The number of available instance store volumes - depends on the instance type. After you connect to the instance, you - must mount the volume. - """ - - ebs: EphemeralEBSVolumeConfiguration | None = None - """ - The shared Amazon EBS performance and encryption properties for a - volume. These properties are common across the different volume - configurations for a capacity provider. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EPHEMERAL_BLOCK_DEVICE_MAPPING, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.device_name is not None: - serializer.write_string( - _SCHEMA_EPHEMERAL_BLOCK_DEVICE_MAPPING.members["deviceName"], - self.device_name, - ) - - if self.virtual_name is not None: - serializer.write_string( - _SCHEMA_EPHEMERAL_BLOCK_DEVICE_MAPPING.members["virtualName"], - self.virtual_name, - ) - - if self.ebs is not None: - serializer.write_struct( - _SCHEMA_EPHEMERAL_BLOCK_DEVICE_MAPPING.members["ebs"], self.ebs - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["device_name"] = de.read_string( - _SCHEMA_EPHEMERAL_BLOCK_DEVICE_MAPPING.members["deviceName"] - ) - - case 1: - kwargs["virtual_name"] = de.read_string( - _SCHEMA_EPHEMERAL_BLOCK_DEVICE_MAPPING.members["virtualName"] - ) - - case 2: - kwargs["ebs"] = EphemeralEBSVolumeConfiguration.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EPHEMERAL_BLOCK_DEVICE_MAPPING, consumer=_consumer - ) - return kwargs - - -def _serialize_ephemeral_block_device_mapping_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[EphemeralBlockDeviceMapping], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_ephemeral_block_device_mapping_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[EphemeralBlockDeviceMapping]: - result: list[EphemeralBlockDeviceMapping] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(EphemeralBlockDeviceMapping.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_instance_type_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_instance_type_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class InstanceRequirements: - """The requirements for Amazon EC2 instance types in a capacity provider.""" - - allowed_instance_types: list[str] - """ - The list of allowed instance types. You can specify up to 30 instance - types. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INSTANCE_REQUIREMENTS, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_instance_type_list( - serializer, - _SCHEMA_INSTANCE_REQUIREMENTS.members["allowedInstanceTypes"], - self.allowed_instance_types, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["allowed_instance_types"] = _deserialize_instance_type_list( - de, - _SCHEMA_INSTANCE_REQUIREMENTS.members["allowedInstanceTypes"], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INSTANCE_REQUIREMENTS, consumer=_consumer) - if "allowed_instance_types" not in kwargs: - kwargs["allowed_instance_types"] = [] - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(allowed_instance_types=[]) - - -@dataclass(kw_only=True) -class LicenseSpecification: - """A license configuration to associate with the instances.""" - - license_configuration_arn: str - """The Amazon Resource Name (ARN) of the license configuration.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LICENSE_SPECIFICATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_LICENSE_SPECIFICATION.members["licenseConfigurationArn"], - self.license_configuration_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["license_configuration_arn"] = de.read_string( - _SCHEMA_LICENSE_SPECIFICATION.members["licenseConfigurationArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LICENSE_SPECIFICATION, consumer=_consumer) - if "license_configuration_arn" not in kwargs: - kwargs["license_configuration_arn"] = "" - return kwargs - - -def _serialize_license_specification_list( - serializer: ShapeSerializer, schema: Schema, value: list[LicenseSpecification] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_license_specification_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[LicenseSpecification]: - result: list[LicenseSpecification] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(LicenseSpecification.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class Monitoring(UnknownEnumMixin, StrEnum): - BASIC = "BASIC" - DETAILED = "DETAILED" - - -class OperatingSystem(UnknownEnumMixin, StrEnum): - """ - The operating system and CPU architecture for capacity provider - instances. - """ - - LINUX_X86_64 = "LINUX_X86_64" - LINUX_ARM64 = "LINUX_ARM64" - - -@dataclass(kw_only=True) -class LaunchParameters: - """ - The parameters for launching Amazon EC2 instances in a capacity - provider. - """ - - operating_system: str - """The operating system and CPU architecture for the instances.""" - - instance_requirements: InstanceRequirements - """The requirements that determine which instance types can be launched.""" - - ephemeral_volumes: list[EphemeralBlockDeviceMapping] | None = None - """ - The block device mappings for instance store (ephemeral) volumes. You - can specify up to five mappings. - """ - - monitoring: str | None = None - """The monitoring level for the instances.""" - - license_specifications: list[LicenseSpecification] | None = None - """ - The license configurations to associate with the instances. You can - specify up to five configurations. - """ - - capacity_reservation_specification: CapacityReservationSpecification | None = None - """The Capacity Reservation targeting option for the instances.""" - - ssh_key_name: str | None = None - """ - The name of the SSH key pair to configure on the instances for SSH - connectivity. - """ - - instance_profile_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the IAM instance profile to associate - with launched instances. If provided, this overrides the default - instance profile. - """ - - propagated_tags: dict[str, str] | None = None - """ - The tags to propagate to all Amazon EC2 resources (instances, volumes, - and network interfaces) that the capacity provider creates. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LAUNCH_PARAMETERS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_LAUNCH_PARAMETERS.members["operatingSystem"], self.operating_system - ) - serializer.write_struct( - _SCHEMA_LAUNCH_PARAMETERS.members["instanceRequirements"], - self.instance_requirements, - ) - if self.ephemeral_volumes is not None: - _serialize_ephemeral_block_device_mapping_list( - serializer, - _SCHEMA_LAUNCH_PARAMETERS.members["ephemeralVolumes"], - self.ephemeral_volumes, - ) - - if self.monitoring is not None: - serializer.write_string( - _SCHEMA_LAUNCH_PARAMETERS.members["monitoring"], self.monitoring - ) - - if self.license_specifications is not None: - _serialize_license_specification_list( - serializer, - _SCHEMA_LAUNCH_PARAMETERS.members["licenseSpecifications"], - self.license_specifications, - ) - - if self.capacity_reservation_specification is not None: - serializer.write_struct( - _SCHEMA_LAUNCH_PARAMETERS.members["capacityReservationSpecification"], - self.capacity_reservation_specification, - ) - - if self.ssh_key_name is not None: - serializer.write_string( - _SCHEMA_LAUNCH_PARAMETERS.members["sshKeyName"], self.ssh_key_name - ) - - if self.instance_profile_arn is not None: - serializer.write_string( - _SCHEMA_LAUNCH_PARAMETERS.members["instanceProfileArn"], - self.instance_profile_arn, - ) - - if self.propagated_tags is not None: - _serialize_tags_map( - serializer, - _SCHEMA_LAUNCH_PARAMETERS.members["propagatedTags"], - self.propagated_tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["operating_system"] = OperatingSystem( - de.read_string( - _SCHEMA_LAUNCH_PARAMETERS.members["operatingSystem"] - ) - ) - - case 1: - kwargs["instance_requirements"] = InstanceRequirements.deserialize( - de - ) - - case 2: - kwargs["ephemeral_volumes"] = ( - _deserialize_ephemeral_block_device_mapping_list( - de, _SCHEMA_LAUNCH_PARAMETERS.members["ephemeralVolumes"] - ) - ) - - case 3: - kwargs["monitoring"] = Monitoring( - de.read_string(_SCHEMA_LAUNCH_PARAMETERS.members["monitoring"]) - ) - - case 4: - kwargs["license_specifications"] = ( - _deserialize_license_specification_list( - de, - _SCHEMA_LAUNCH_PARAMETERS.members["licenseSpecifications"], - ) - ) - - case 5: - kwargs["capacity_reservation_specification"] = ( - CapacityReservationSpecification.deserialize(de) - ) - - case 6: - kwargs["ssh_key_name"] = de.read_string( - _SCHEMA_LAUNCH_PARAMETERS.members["sshKeyName"] - ) - - case 7: - kwargs["instance_profile_arn"] = de.read_string( - _SCHEMA_LAUNCH_PARAMETERS.members["instanceProfileArn"] - ) - - case 8: - kwargs["propagated_tags"] = _deserialize_tags_map( - de, _SCHEMA_LAUNCH_PARAMETERS.members["propagatedTags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LAUNCH_PARAMETERS, consumer=_consumer) - if "operating_system" not in kwargs: - kwargs["operating_system"] = OperatingSystem._corrected("") - if "instance_requirements" not in kwargs: - kwargs["instance_requirements"] = InstanceRequirements._smithy_default() - return kwargs - - -@dataclass -class LaunchTemplateSourceLaunchParameters: - """The parameters that AgentCore uses to create the launch template.""" - - value: LaunchParameters - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LAUNCH_TEMPLATE_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_LAUNCH_TEMPLATE_SOURCE.members["launchParameters"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=LaunchParameters.deserialize(deserializer)) - - -@dataclass -class LaunchTemplateSourceUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -LaunchTemplateSource = Union[ - LaunchTemplateSourceLaunchParameters | LaunchTemplateSourceUnknown -] -""" -The source of the launch template configuration for a capacity provider. -The `launchParameters` member specifies the operating system, instance -requirements, and other settings used to launch instances. -""" - - -class _LaunchTemplateSourceDeserializer: - _result: LaunchTemplateSource | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> LaunchTemplateSource: - self._result = None - deserializer.read_struct(_SCHEMA_LAUNCH_TEMPLATE_SOURCE, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(LaunchTemplateSourceLaunchParameters.deserialize(de)) - - case _: - self._set_result( - LaunchTemplateSourceUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: LaunchTemplateSource) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class InstanceLifecycleConfiguration: - """ - The configuration that manages the lifecycle of instances in a capacity - provider, including idle timeout and maximum lifetime. - """ - - idle_instance_timeout: int | None = None - """ - The number of seconds an instance can remain idle before it is stopped. - An instance is considered idle when all of its agents are idle. The - default is 900 seconds (15 minutes). - """ - - max_lifetime: int | None = None - """ - The maximum lifetime of an instance, in seconds. When an instance - reaches this limit, the service terminates it regardless of activity. - The default is 28800 seconds (8 hours). The maximum is 1209600 seconds - (14 days). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INSTANCE_LIFECYCLE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.idle_instance_timeout is not None: - serializer.write_integer( - _SCHEMA_INSTANCE_LIFECYCLE_CONFIGURATION.members["idleInstanceTimeout"], - self.idle_instance_timeout, - ) - - if self.max_lifetime is not None: - serializer.write_integer( - _SCHEMA_INSTANCE_LIFECYCLE_CONFIGURATION.members["maxLifetime"], - self.max_lifetime, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["idle_instance_timeout"] = de.read_integer( - _SCHEMA_INSTANCE_LIFECYCLE_CONFIGURATION.members[ - "idleInstanceTimeout" - ] - ) - - case 1: - kwargs["max_lifetime"] = de.read_integer( - _SCHEMA_INSTANCE_LIFECYCLE_CONFIGURATION.members["maxLifetime"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INSTANCE_LIFECYCLE_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class RootVolumeConfiguration: - """ - The configuration for the root volume of a capacity provider instance. - Specify the amount of free space to guarantee on the root volume. The - device name and delete-on-termination settings are fixed and cannot be - changed. - """ - - volume_type: str = EbsVolumeType("gp3") - """ - The Amazon EBS volume type. If you do not specify a type, the default is - `gp3`. - """ - - iops: int | None = None - """ - The number of IOPS to provision. For `gp3`, `io1`, and `io2` volumes, - this is the number of IOPS provisioned for the volume. For `gp2` - volumes, this sets the baseline IOPS performance. It also controls the - rate at which the volume accumulates I/O credits for bursting. Supported - values: `gp3`, 3,000--80,000; `io1`, 100--64,000; `io2`, 100--256,000. - """ - - throughput: int | None = None - """ - The throughput to provision, in MiB/s. Valid only for `gp3` volumes. - Valid range: 125--2,000 MiB/s. - """ - - encrypted: bool | None = None - """ - Specifies whether to encrypt the volume. Encrypted volumes can be - attached only to instances that support Amazon EBS encryption. If you - create a volume from a snapshot, you cannot specify an encryption value. - """ - - kms_key_id: str | None = None - """ - The identifier (key ID, key alias, key ARN, or alias ARN) of the - customer managed KMS key to use for Amazon EBS encryption. - """ - - free_space_gi_b: int | None = None - """ - The free space guaranteed on the root volume, in GiB. AgentCore adds the - operating system overhead on top of this value. The default is 8 GiB. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ROOT_VOLUME_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_ROOT_VOLUME_CONFIGURATION.members["volumeType"], self.volume_type - ) - if self.iops is not None: - serializer.write_integer( - _SCHEMA_ROOT_VOLUME_CONFIGURATION.members["iops"], self.iops - ) - - if self.throughput is not None: - serializer.write_integer( - _SCHEMA_ROOT_VOLUME_CONFIGURATION.members["throughput"], self.throughput - ) - - if self.encrypted is not None: - serializer.write_boolean( - _SCHEMA_ROOT_VOLUME_CONFIGURATION.members["encrypted"], self.encrypted - ) - - if self.kms_key_id is not None: - serializer.write_string( - _SCHEMA_ROOT_VOLUME_CONFIGURATION.members["kmsKeyId"], self.kms_key_id - ) - - if self.free_space_gi_b is not None: - serializer.write_integer( - _SCHEMA_ROOT_VOLUME_CONFIGURATION.members["freeSpaceGiB"], - self.free_space_gi_b, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["volume_type"] = EbsVolumeType( - de.read_string( - _SCHEMA_ROOT_VOLUME_CONFIGURATION.members["volumeType"] - ) - ) - - case 1: - kwargs["iops"] = de.read_integer( - _SCHEMA_ROOT_VOLUME_CONFIGURATION.members["iops"] - ) - - case 2: - kwargs["throughput"] = de.read_integer( - _SCHEMA_ROOT_VOLUME_CONFIGURATION.members["throughput"] - ) - - case 3: - kwargs["encrypted"] = de.read_boolean( - _SCHEMA_ROOT_VOLUME_CONFIGURATION.members["encrypted"] - ) - - case 4: - kwargs["kms_key_id"] = de.read_string( - _SCHEMA_ROOT_VOLUME_CONFIGURATION.members["kmsKeyId"] - ) - - case 5: - kwargs["free_space_gi_b"] = de.read_integer( - _SCHEMA_ROOT_VOLUME_CONFIGURATION.members["freeSpaceGiB"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ROOT_VOLUME_CONFIGURATION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class EbsVolumeConfiguration: - """ - The configuration for an Amazon EBS-backed persistent volume. The - service creates persistent volumes when a session first launches, and - the volumes survive instance termination. The volumes persist until you - delete the session. - """ - - name: str - """ - The logical name of the volume. Use this name to reference the volume - when you mount it into an agent runtime. - """ - - size_gi_b: int - """The size of the volume, in GiB.""" - - volume_type: str = EbsVolumeType("gp3") - """ - The Amazon EBS volume type. If you do not specify a type, the default is - `gp3`. - """ - - iops: int | None = None - """ - The number of IOPS to provision. Valid only for `gp3`, `io1`, and `io2` - volumes. - """ - - throughput: int | None = None - """The throughput, in MiB/s. Valid only for `gp3` volumes.""" - - encrypted: bool | None = None - """ - Specifies whether to encrypt the volume. If `true`, the service encrypts - the volume with the KMS key that you specify in `kmsKeyId`, or the - default KMS key for Amazon EBS if you do not specify one. The default is - `true`. - """ - - kms_key_id: str | None = None - """The identifier of the KMS key to use for encryption.""" - - snapshot_id: str | None = None - """ - An optional Amazon EBS snapshot ID. If provided, the volume is - initialized from this snapshot the first time it is created. On - subsequent restarts, the existing volume is used and the snapshot is - ignored. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EBS_VOLUME_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_EBS_VOLUME_CONFIGURATION.members["name"], self.name - ) - serializer.write_integer( - _SCHEMA_EBS_VOLUME_CONFIGURATION.members["sizeGiB"], self.size_gi_b - ) - serializer.write_string( - _SCHEMA_EBS_VOLUME_CONFIGURATION.members["volumeType"], self.volume_type - ) - if self.iops is not None: - serializer.write_integer( - _SCHEMA_EBS_VOLUME_CONFIGURATION.members["iops"], self.iops - ) - - if self.throughput is not None: - serializer.write_integer( - _SCHEMA_EBS_VOLUME_CONFIGURATION.members["throughput"], self.throughput - ) - - if self.encrypted is not None: - serializer.write_boolean( - _SCHEMA_EBS_VOLUME_CONFIGURATION.members["encrypted"], self.encrypted - ) - - if self.kms_key_id is not None: - serializer.write_string( - _SCHEMA_EBS_VOLUME_CONFIGURATION.members["kmsKeyId"], self.kms_key_id - ) - - if self.snapshot_id is not None: - serializer.write_string( - _SCHEMA_EBS_VOLUME_CONFIGURATION.members["snapshotId"], self.snapshot_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_EBS_VOLUME_CONFIGURATION.members["name"] - ) - - case 1: - kwargs["size_gi_b"] = de.read_integer( - _SCHEMA_EBS_VOLUME_CONFIGURATION.members["sizeGiB"] - ) - - case 2: - kwargs["volume_type"] = EbsVolumeType( - de.read_string( - _SCHEMA_EBS_VOLUME_CONFIGURATION.members["volumeType"] - ) - ) - - case 3: - kwargs["iops"] = de.read_integer( - _SCHEMA_EBS_VOLUME_CONFIGURATION.members["iops"] - ) - - case 4: - kwargs["throughput"] = de.read_integer( - _SCHEMA_EBS_VOLUME_CONFIGURATION.members["throughput"] - ) - - case 5: - kwargs["encrypted"] = de.read_boolean( - _SCHEMA_EBS_VOLUME_CONFIGURATION.members["encrypted"] - ) - - case 6: - kwargs["kms_key_id"] = de.read_string( - _SCHEMA_EBS_VOLUME_CONFIGURATION.members["kmsKeyId"] - ) - - case 7: - kwargs["snapshot_id"] = de.read_string( - _SCHEMA_EBS_VOLUME_CONFIGURATION.members["snapshotId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EBS_VOLUME_CONFIGURATION, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "size_gi_b" not in kwargs: - kwargs["size_gi_b"] = 0 - return kwargs - - -@dataclass -class VolumeConfigurationEbsConfiguration: - """The configuration for an Amazon EBS-backed persistent volume.""" - - value: EbsVolumeConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VOLUME_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_VOLUME_CONFIGURATION.members["ebsConfiguration"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=EbsVolumeConfiguration.deserialize(deserializer)) - - -@dataclass -class VolumeConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -VolumeConfiguration = Union[ - VolumeConfigurationEbsConfiguration | VolumeConfigurationUnknown -] -""" -The configuration for a persistent volume attached to a capacity -provider. This structure defines the storage backing for the persistent -volumes used by agents that run on capacity provider instances. -""" - - -class _VolumeConfigurationDeserializer: - _result: VolumeConfiguration | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> VolumeConfiguration: - self._result = None - deserializer.read_struct(_SCHEMA_VOLUME_CONFIGURATION, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(VolumeConfigurationEbsConfiguration.deserialize(de)) - - case _: - self._set_result( - VolumeConfigurationUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: VolumeConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_volume_configuration_list( - serializer: ShapeSerializer, schema: Schema, value: list[VolumeConfiguration] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_volume_configuration_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[VolumeConfiguration]: - result: list[VolumeConfiguration] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_VolumeConfigurationDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_security_group_id_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_security_group_id_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_subnet_id_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_subnet_id_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class VpcConfiguration: - """The VPC configuration for launching Amazon EC2 instances.""" - - subnets: list[str] - """ - The IDs of the subnets in which to launch instances. You must specify at - least one subnet. - """ - - security_groups: list[str] - """ - The IDs of the security groups to associate with the instances. You must - specify at least one security group. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VPC_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_subnet_id_list( - serializer, _SCHEMA_VPC_CONFIGURATION.members["subnets"], self.subnets - ) - _serialize_security_group_id_list( - serializer, - _SCHEMA_VPC_CONFIGURATION.members["securityGroups"], - self.security_groups, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["subnets"] = _deserialize_subnet_id_list( - de, _SCHEMA_VPC_CONFIGURATION.members["subnets"] - ) - - case 1: - kwargs["security_groups"] = _deserialize_security_group_id_list( - de, _SCHEMA_VPC_CONFIGURATION.members["securityGroups"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VPC_CONFIGURATION, consumer=_consumer) - if "subnets" not in kwargs: - kwargs["subnets"] = [] - if "security_groups" not in kwargs: - kwargs["security_groups"] = [] - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(subnets=[], security_groups=[]) - - -@dataclass(kw_only=True) -class Ec2Configuration: - """ - The configuration for Amazon EC2-based compute, including the launch - template source, networking, storage volumes, and instance lifecycle - settings. - """ - - launch_template_source: LaunchTemplateSource - """ - The source of the launch template configuration that defines how - instances are launched. - """ - - vpc_configuration: VpcConfiguration - """ - The VPC configuration for launching instances, including subnets and - security groups. - """ - - volumes: list[VolumeConfiguration] | None = None - """ - The named persistent Amazon EBS volumes for the capacity provider. A - capacity provider can define up to five volumes. - """ - - lifecycle_configuration: InstanceLifecycleConfiguration | None = None - """The lifecycle configuration for instances in the capacity provider.""" - - root_volume: RootVolumeConfiguration | None = None - """ - The configuration for the instance root volume. Specify the amount of - free space to guarantee and, optionally, the Amazon EBS performance and - encryption settings. The device name and delete-on-termination behavior - are not configurable. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EC2_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_EC2_CONFIGURATION.members["launchTemplateSource"], - self.launch_template_source, - ) - serializer.write_struct( - _SCHEMA_EC2_CONFIGURATION.members["vpcConfiguration"], - self.vpc_configuration, - ) - if self.volumes is not None: - _serialize_volume_configuration_list( - serializer, _SCHEMA_EC2_CONFIGURATION.members["volumes"], self.volumes - ) - - if self.lifecycle_configuration is not None: - serializer.write_struct( - _SCHEMA_EC2_CONFIGURATION.members["lifecycleConfiguration"], - self.lifecycle_configuration, - ) - - if self.root_volume is not None: - serializer.write_struct( - _SCHEMA_EC2_CONFIGURATION.members["rootVolume"], self.root_volume - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["launch_template_source"] = ( - _LaunchTemplateSourceDeserializer().deserialize(de) - ) - - case 1: - kwargs["vpc_configuration"] = VpcConfiguration.deserialize(de) - - case 2: - kwargs["volumes"] = _deserialize_volume_configuration_list( - de, _SCHEMA_EC2_CONFIGURATION.members["volumes"] - ) - - case 3: - kwargs["lifecycle_configuration"] = ( - InstanceLifecycleConfiguration.deserialize(de) - ) - - case 4: - kwargs["root_volume"] = RootVolumeConfiguration.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EC2_CONFIGURATION, consumer=_consumer) - if "launch_template_source" not in kwargs: - kwargs["launch_template_source"] = LaunchTemplateSourceUnknown(tag="") - if "vpc_configuration" not in kwargs: - kwargs["vpc_configuration"] = VpcConfiguration._smithy_default() - return kwargs - - -@dataclass -class ComputeConfigurationEc2Configuration: - """The Amazon EC2 compute configuration for the capacity provider.""" - - value: Ec2Configuration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_COMPUTE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_COMPUTE_CONFIGURATION.members["ec2Configuration"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=Ec2Configuration.deserialize(deserializer)) - - -@dataclass -class ComputeConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ComputeConfiguration = Union[ - ComputeConfigurationEc2Configuration | ComputeConfigurationUnknown -] -""" -The compute configuration for a capacity provider. This structure -defines the type and settings of the compute resources used to launch -instances. -""" - - -class _ComputeConfigurationDeserializer: - _result: ComputeConfiguration | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> ComputeConfiguration: - self._result = None - deserializer.read_struct(_SCHEMA_COMPUTE_CONFIGURATION, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(ComputeConfigurationEc2Configuration.deserialize(de)) - - case _: - self._set_result( - ComputeConfigurationUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: ComputeConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class PermissionsConfiguration: - """ - The permissions configuration for a capacity provider. This specifies - the IAM role that AgentCore uses to manage the Amazon EC2 instances for - the capacity provider on your behalf. - """ - - capacity_provider_operator_role_arn: str - """ - The Amazon Resource Name (ARN) of the IAM role that AgentCore assumes to - manage the capacity provider, including launching, tagging, and - terminating instances and their network interfaces. We recommend scoping - this role to the minimum permissions that your workloads require. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PERMISSIONS_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_PERMISSIONS_CONFIGURATION.members[ - "capacityProviderOperatorRoleArn" - ], - self.capacity_provider_operator_role_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["capacity_provider_operator_role_arn"] = de.read_string( - _SCHEMA_PERMISSIONS_CONFIGURATION.members[ - "capacityProviderOperatorRoleArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PERMISSIONS_CONFIGURATION, consumer=_consumer) - if "capacity_provider_operator_role_arn" not in kwargs: - kwargs["capacity_provider_operator_role_arn"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(capacity_provider_operator_role_arn="") - - -@dataclass(kw_only=True) -class CreateCapacityProviderInput: - """Dataclass for CreateCapacityProviderInput structure.""" - - name: str | None = None - """ - The name of the capacity provider. The name must be unique within your - account. - """ - - description: str | None = field(repr=False, default=None) - """ - An optional description of the capacity provider. If you don't specify - a description, the service creates the capacity provider without one. - """ - - permissions_configuration: PermissionsConfiguration | None = None - """ - The permissions configuration for the capacity provider. This specifies - the IAM role that AgentCore uses to manage the Amazon EC2 instances on - your behalf. - """ - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If you don't specify this field, a - value is randomly generated for you. If this token matches a previous - request, the service ignores the request, but doesn't return an error. - For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - tags: dict[str, str] | None = None - """ - A map of tag keys and values to associate with the capacity provider. If - you don't specify tags, the capacity provider is created with no tags. - """ - - compute_configuration: ComputeConfiguration | None = None - """ - The compute configuration for the capacity provider. This defines the - Amazon EC2 compute resources used to launch instances: the operating - system, allowed instance types, networking, and storage. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_CAPACITY_PROVIDER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_CAPACITY_PROVIDER_INPUT.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_CAPACITY_PROVIDER_INPUT.members["description"], - self.description, - ) - - if self.permissions_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_CAPACITY_PROVIDER_INPUT.members[ - "permissionsConfiguration" - ], - self.permissions_configuration, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_CAPACITY_PROVIDER_INPUT.members["clientToken"], - self.client_token, - ) - - if self.tags is not None: - _serialize_tags_map( - serializer, - _SCHEMA_CREATE_CAPACITY_PROVIDER_INPUT.members["tags"], - self.tags, - ) - - if self.compute_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_CAPACITY_PROVIDER_INPUT.members["computeConfiguration"], - self.compute_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_CAPACITY_PROVIDER_INPUT.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_CAPACITY_PROVIDER_INPUT.members["description"] - ) - - case 2: - kwargs["permissions_configuration"] = ( - PermissionsConfiguration.deserialize(de) - ) - - case 3: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_CAPACITY_PROVIDER_INPUT.members["clientToken"] - ) - - case 4: - kwargs["tags"] = _deserialize_tags_map( - de, _SCHEMA_CREATE_CAPACITY_PROVIDER_INPUT.members["tags"] - ) - - case 5: - kwargs["compute_configuration"] = ( - _ComputeConfigurationDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_CAPACITY_PROVIDER_INPUT, consumer=_consumer - ) - return kwargs - - -class CapacityProviderStatus(UnknownEnumMixin, StrEnum): - """ - The status of a capacity provider. Possible values: - - - `CREATING` -- The service is creating the capacity provider and - validating its configuration. - - - `CREATE_FAILED` -- The service could not create the capacity provider. - For details, see `statusCode` and `statusReason`. - - - `UPDATING` -- The service is updating the capacity provider. - - - `UPDATE_FAILED` -- The service could not update the capacity provider. - For details, see `statusCode` and `statusReason`. - - - `READY` -- The capacity provider is available for use. - - - `DELETING` -- The service is deleting the capacity provider. - - - `DELETE_FAILED` -- The service could not delete the capacity provider. - You can retry the deletion. - """ - - CREATING = "CREATING" - CREATE_FAILED = "CREATE_FAILED" - UPDATING = "UPDATING" - UPDATE_FAILED = "UPDATE_FAILED" - READY = "READY" - DELETING = "DELETING" - DELETE_FAILED = "DELETE_FAILED" - - -@dataclass(kw_only=True) -class CreateCapacityProviderOutput: - """Dataclass for CreateCapacityProviderOutput structure.""" - - capacity_provider_id: str - """The unique identifier of the created capacity provider.""" - - capacity_provider_arn: str - """The Amazon Resource Name (ARN) of the capacity provider.""" - - name: str - """The name of the capacity provider.""" - - status: str - """ - The current status of the capacity provider. For possible values, see - `CapacityProviderStatus`. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_CAPACITY_PROVIDER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_CAPACITY_PROVIDER_OUTPUT.members["capacityProviderId"], - self.capacity_provider_id, - ) - serializer.write_string( - _SCHEMA_CREATE_CAPACITY_PROVIDER_OUTPUT.members["capacityProviderArn"], - self.capacity_provider_arn, - ) - serializer.write_string( - _SCHEMA_CREATE_CAPACITY_PROVIDER_OUTPUT.members["name"], self.name - ) - serializer.write_string( - _SCHEMA_CREATE_CAPACITY_PROVIDER_OUTPUT.members["status"], self.status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["capacity_provider_id"] = de.read_string( - _SCHEMA_CREATE_CAPACITY_PROVIDER_OUTPUT.members[ - "capacityProviderId" - ] - ) - - case 1: - kwargs["capacity_provider_arn"] = de.read_string( - _SCHEMA_CREATE_CAPACITY_PROVIDER_OUTPUT.members[ - "capacityProviderArn" - ] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_CAPACITY_PROVIDER_OUTPUT.members["name"] - ) - - case 3: - kwargs["status"] = CapacityProviderStatus( - de.read_string( - _SCHEMA_CREATE_CAPACITY_PROVIDER_OUTPUT.members["status"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_CAPACITY_PROVIDER_OUTPUT, consumer=_consumer - ) - if "capacity_provider_id" not in kwargs: - kwargs["capacity_provider_id"] = "" - if "capacity_provider_arn" not in kwargs: - kwargs["capacity_provider_arn"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "status" not in kwargs: - kwargs["status"] = CapacityProviderStatus._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class RetryableConflictException(ServiceError): - """ - The operation failed because of a conflicting request. Retry the - request. - """ - - fault: Literal["client", "server"] | None = "client" - is_retry_safe: bool | None = True - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRYABLE_CONFLICT_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_RETRYABLE_CONFLICT_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_RETRYABLE_CONFLICT_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RETRYABLE_CONFLICT_EXCEPTION, consumer=_consumer - ) - return kwargs - - -CREATE_CAPACITY_PROVIDER = APIOperation( - input=CreateCapacityProviderInput, - output=CreateCapacityProviderOutput, - schema=_SCHEMA_CREATE_CAPACITY_PROVIDER, - input_schema=_SCHEMA_CREATE_CAPACITY_PROVIDER_INPUT, - output_schema=_SCHEMA_CREATE_CAPACITY_PROVIDER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#RetryableConflictException" - ): RetryableConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_RETRYABLE_CONFLICT_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteCapacityProviderInput: - """Dataclass for DeleteCapacityProviderInput structure.""" - - capacity_provider_id: str | None = None - """The unique identifier of the capacity provider to delete.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If you don't specify this field, a - value is randomly generated for you. If this token matches a previous - request, the service ignores the request, but doesn't return an error. - For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_CAPACITY_PROVIDER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.capacity_provider_id is not None: - serializer.write_string( - _SCHEMA_DELETE_CAPACITY_PROVIDER_INPUT.members["capacityProviderId"], - self.capacity_provider_id, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_DELETE_CAPACITY_PROVIDER_INPUT.members["clientToken"], - self.client_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["capacity_provider_id"] = de.read_string( - _SCHEMA_DELETE_CAPACITY_PROVIDER_INPUT.members[ - "capacityProviderId" - ] - ) - - case 1: - kwargs["client_token"] = de.read_string( - _SCHEMA_DELETE_CAPACITY_PROVIDER_INPUT.members["clientToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_CAPACITY_PROVIDER_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteCapacityProviderOutput: - """Dataclass for DeleteCapacityProviderOutput structure.""" - - capacity_provider_id: str - """The unique identifier of the deleted capacity provider.""" - - status: str - """ - The current status of the capacity provider. For possible values, see - `CapacityProviderStatus`. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_CAPACITY_PROVIDER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DELETE_CAPACITY_PROVIDER_OUTPUT.members["capacityProviderId"], - self.capacity_provider_id, - ) - serializer.write_string( - _SCHEMA_DELETE_CAPACITY_PROVIDER_OUTPUT.members["status"], self.status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["capacity_provider_id"] = de.read_string( - _SCHEMA_DELETE_CAPACITY_PROVIDER_OUTPUT.members[ - "capacityProviderId" - ] - ) - - case 1: - kwargs["status"] = CapacityProviderStatus( - de.read_string( - _SCHEMA_DELETE_CAPACITY_PROVIDER_OUTPUT.members["status"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_CAPACITY_PROVIDER_OUTPUT, consumer=_consumer - ) - if "capacity_provider_id" not in kwargs: - kwargs["capacity_provider_id"] = "" - if "status" not in kwargs: - kwargs["status"] = CapacityProviderStatus._corrected("") - return kwargs - - -DELETE_CAPACITY_PROVIDER = APIOperation( - input=DeleteCapacityProviderInput, - output=DeleteCapacityProviderOutput, - schema=_SCHEMA_DELETE_CAPACITY_PROVIDER, - input_schema=_SCHEMA_DELETE_CAPACITY_PROVIDER_INPUT, - output_schema=_SCHEMA_DELETE_CAPACITY_PROVIDER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#RetryableConflictException" - ): RetryableConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_RETRYABLE_CONFLICT_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetCapacityProviderInput: - """Dataclass for GetCapacityProviderInput structure.""" - - capacity_provider_id: str | None = None - """The unique identifier of the capacity provider.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_CAPACITY_PROVIDER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.capacity_provider_id is not None: - serializer.write_string( - _SCHEMA_GET_CAPACITY_PROVIDER_INPUT.members["capacityProviderId"], - self.capacity_provider_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["capacity_provider_id"] = de.read_string( - _SCHEMA_GET_CAPACITY_PROVIDER_INPUT.members[ - "capacityProviderId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_CAPACITY_PROVIDER_INPUT, consumer=_consumer - ) - return kwargs - - -class CapacityProviderStatusCode(UnknownEnumMixin, StrEnum): - """ - A reason code for a capacity provider that is not in the `READY` state. - Possible values: - - - `VALIDATION_ERROR` -- A configuration error prevented the operation. - For example, missing permissions, invalid parameters, or a naming - conflict. - - - `QUOTA_EXCEEDED` -- An Amazon EC2 resource quota was exceeded. Request - a limit increase or remove unused resources. - - - `THROTTLED` -- The request was throttled. Retry after a short delay. - - - `INTERNAL_SERVER_EXCEPTION` -- An internal error occurred. - """ - - VALIDATION_ERROR = "VALIDATION_ERROR" - QUOTA_EXCEEDED = "QUOTA_EXCEEDED" - THROTTLED = "THROTTLED" - INTERNAL_SERVER_EXCEPTION = "INTERNAL_SERVER_EXCEPTION" - - -@dataclass(kw_only=True) -class GetCapacityProviderOutput: - """Dataclass for GetCapacityProviderOutput structure.""" - - capacity_provider_id: str - """The unique identifier of the capacity provider.""" - - capacity_provider_arn: str - """The Amazon Resource Name (ARN) of the capacity provider.""" - - name: str - """The name of the capacity provider.""" - - status: str - """ - The current status of the capacity provider. For possible values, see - `CapacityProviderStatus`. - """ - - permissions_configuration: PermissionsConfiguration - """The permissions configuration for the capacity provider.""" - - compute_configuration: ComputeConfiguration - """The compute configuration for the capacity provider.""" - - created_at: datetime - """The timestamp when the capacity provider was created.""" - - last_updated_at: datetime - """The timestamp when the capacity provider was last updated.""" - - description: str | None = field(repr=False, default=None) - """The description of the capacity provider, if one was provided.""" - - status_code: str | None = None - """ - A reason code for a capacity provider that is not in the `READY` state. - Use this code for programmatic error handling. - """ - - status_reason: str | None = None - """ - A human-readable message that describes why the capacity provider is not - in the `READY` state. Because these messages can change, use - `statusCode` for programmatic error handling. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_CAPACITY_PROVIDER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_CAPACITY_PROVIDER_OUTPUT.members["capacityProviderId"], - self.capacity_provider_id, - ) - serializer.write_string( - _SCHEMA_GET_CAPACITY_PROVIDER_OUTPUT.members["capacityProviderArn"], - self.capacity_provider_arn, - ) - serializer.write_string( - _SCHEMA_GET_CAPACITY_PROVIDER_OUTPUT.members["name"], self.name - ) - serializer.write_string( - _SCHEMA_GET_CAPACITY_PROVIDER_OUTPUT.members["status"], self.status - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_CAPACITY_PROVIDER_OUTPUT.members["description"], - self.description, - ) - - if self.status_code is not None: - serializer.write_string( - _SCHEMA_GET_CAPACITY_PROVIDER_OUTPUT.members["statusCode"], - self.status_code, - ) - - if self.status_reason is not None: - serializer.write_string( - _SCHEMA_GET_CAPACITY_PROVIDER_OUTPUT.members["statusReason"], - self.status_reason, - ) - - serializer.write_struct( - _SCHEMA_GET_CAPACITY_PROVIDER_OUTPUT.members["permissionsConfiguration"], - self.permissions_configuration, - ) - serializer.write_struct( - _SCHEMA_GET_CAPACITY_PROVIDER_OUTPUT.members["computeConfiguration"], - self.compute_configuration, - ) - serializer.write_timestamp( - _SCHEMA_GET_CAPACITY_PROVIDER_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_GET_CAPACITY_PROVIDER_OUTPUT.members["lastUpdatedAt"], - self.last_updated_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["capacity_provider_id"] = de.read_string( - _SCHEMA_GET_CAPACITY_PROVIDER_OUTPUT.members[ - "capacityProviderId" - ] - ) - - case 1: - kwargs["capacity_provider_arn"] = de.read_string( - _SCHEMA_GET_CAPACITY_PROVIDER_OUTPUT.members[ - "capacityProviderArn" - ] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_GET_CAPACITY_PROVIDER_OUTPUT.members["name"] - ) - - case 3: - kwargs["status"] = CapacityProviderStatus( - de.read_string( - _SCHEMA_GET_CAPACITY_PROVIDER_OUTPUT.members["status"] - ) - ) - - case 4: - kwargs["description"] = de.read_string( - _SCHEMA_GET_CAPACITY_PROVIDER_OUTPUT.members["description"] - ) - - case 5: - kwargs["status_code"] = CapacityProviderStatusCode( - de.read_string( - _SCHEMA_GET_CAPACITY_PROVIDER_OUTPUT.members["statusCode"] - ) - ) - - case 6: - kwargs["status_reason"] = de.read_string( - _SCHEMA_GET_CAPACITY_PROVIDER_OUTPUT.members["statusReason"] - ) - - case 7: - kwargs["permissions_configuration"] = ( - PermissionsConfiguration.deserialize(de) - ) - - case 8: - kwargs["compute_configuration"] = ( - _ComputeConfigurationDeserializer().deserialize(de) - ) - - case 9: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_CAPACITY_PROVIDER_OUTPUT.members["createdAt"] - ) - - case 10: - kwargs["last_updated_at"] = de.read_timestamp( - _SCHEMA_GET_CAPACITY_PROVIDER_OUTPUT.members["lastUpdatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_CAPACITY_PROVIDER_OUTPUT, consumer=_consumer - ) - if "capacity_provider_id" not in kwargs: - kwargs["capacity_provider_id"] = "" - if "capacity_provider_arn" not in kwargs: - kwargs["capacity_provider_arn"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "status" not in kwargs: - kwargs["status"] = CapacityProviderStatus._corrected("") - if "permissions_configuration" not in kwargs: - kwargs["permissions_configuration"] = ( - PermissionsConfiguration._smithy_default() - ) - if "compute_configuration" not in kwargs: - kwargs["compute_configuration"] = ComputeConfigurationUnknown(tag="") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "last_updated_at" not in kwargs: - kwargs["last_updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -GET_CAPACITY_PROVIDER = APIOperation( - input=GetCapacityProviderInput, - output=GetCapacityProviderOutput, - schema=_SCHEMA_GET_CAPACITY_PROVIDER, - input_schema=_SCHEMA_GET_CAPACITY_PROVIDER_INPUT, - output_schema=_SCHEMA_GET_CAPACITY_PROVIDER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListAgentRuntimeVersionsByCapacityProviderInput: - """Dataclass for ListAgentRuntimeVersionsByCapacityProviderInput structure.""" - - capacity_provider_id: str | None = None - """The unique identifier of the capacity provider.""" - - max_results: int | None = None - """ - The maximum number of results to return in the response. If the total - number of results is greater than this value, use the token returned in - the response in the `nextToken` field when making another request to - return the next batch of results. - """ - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, enter the token returned in the `nextToken` - field in the response in this field to return the next batch of results. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_LIST_AGENT_RUNTIME_VERSIONS_BY_CAPACITY_PROVIDER_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.capacity_provider_id is not None: - serializer.write_string( - _SCHEMA_LIST_AGENT_RUNTIME_VERSIONS_BY_CAPACITY_PROVIDER_INPUT.members[ - "capacityProviderId" - ], - self.capacity_provider_id, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_AGENT_RUNTIME_VERSIONS_BY_CAPACITY_PROVIDER_INPUT.members[ - "maxResults" - ], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_AGENT_RUNTIME_VERSIONS_BY_CAPACITY_PROVIDER_INPUT.members[ - "nextToken" - ], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["capacity_provider_id"] = de.read_string( - _SCHEMA_LIST_AGENT_RUNTIME_VERSIONS_BY_CAPACITY_PROVIDER_INPUT.members[ - "capacityProviderId" - ] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_AGENT_RUNTIME_VERSIONS_BY_CAPACITY_PROVIDER_INPUT.members[ - "maxResults" - ] - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_AGENT_RUNTIME_VERSIONS_BY_CAPACITY_PROVIDER_INPUT.members[ - "nextToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_AGENT_RUNTIME_VERSIONS_BY_CAPACITY_PROVIDER_INPUT, - consumer=_consumer, - ) - return kwargs - - -@dataclass(kw_only=True) -class ListAgentRuntimeVersionsByCapacityProviderOutput: - """ - Dataclass for ListAgentRuntimeVersionsByCapacityProviderOutput - structure. - """ - - agent_runtimes: list[AgentRuntimeVersionSummary] - """ - The list of agent runtime versions that are associated with the capacity - provider. - """ - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, use this token when making another request in - the `nextToken` field to return the next batch of results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_LIST_AGENT_RUNTIME_VERSIONS_BY_CAPACITY_PROVIDER_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_agent_runtime_version_summary_list( - serializer, - _SCHEMA_LIST_AGENT_RUNTIME_VERSIONS_BY_CAPACITY_PROVIDER_OUTPUT.members[ - "agentRuntimes" - ], - self.agent_runtimes, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_AGENT_RUNTIME_VERSIONS_BY_CAPACITY_PROVIDER_OUTPUT.members[ - "nextToken" - ], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_runtimes"] = ( - _deserialize_agent_runtime_version_summary_list( - de, - _SCHEMA_LIST_AGENT_RUNTIME_VERSIONS_BY_CAPACITY_PROVIDER_OUTPUT.members[ - "agentRuntimes" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_AGENT_RUNTIME_VERSIONS_BY_CAPACITY_PROVIDER_OUTPUT.members[ - "nextToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_AGENT_RUNTIME_VERSIONS_BY_CAPACITY_PROVIDER_OUTPUT, - consumer=_consumer, - ) - if "agent_runtimes" not in kwargs: - kwargs["agent_runtimes"] = [] - return kwargs - - -LIST_AGENT_RUNTIME_VERSIONS_BY_CAPACITY_PROVIDER = APIOperation( - input=ListAgentRuntimeVersionsByCapacityProviderInput, - output=ListAgentRuntimeVersionsByCapacityProviderOutput, - schema=_SCHEMA_LIST_AGENT_RUNTIME_VERSIONS_BY_CAPACITY_PROVIDER, - input_schema=_SCHEMA_LIST_AGENT_RUNTIME_VERSIONS_BY_CAPACITY_PROVIDER_INPUT, - output_schema=_SCHEMA_LIST_AGENT_RUNTIME_VERSIONS_BY_CAPACITY_PROVIDER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListCapacityProvidersInput: - """Dataclass for ListCapacityProvidersInput structure.""" - - max_results: int | None = None - """ - The maximum number of results to return in the response. If the total - number of results is greater than this value, use the token returned in - the response in the `nextToken` field when making another request to - return the next batch of results. - """ - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, enter the token returned in the `nextToken` - field in the response in this field to return the next batch of results. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_CAPACITY_PROVIDERS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_CAPACITY_PROVIDERS_INPUT.members["maxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_CAPACITY_PROVIDERS_INPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_CAPACITY_PROVIDERS_INPUT.members["maxResults"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_CAPACITY_PROVIDERS_INPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_CAPACITY_PROVIDERS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CapacityProviderSummary: - """ - A summary of a capacity provider, as returned by - `ListCapacityProviders`. Each summary includes the capacity provider - identifier, Amazon Resource Name (ARN), name, status, and last-updated - timestamp. - """ - - capacity_provider_id: str - """The unique identifier of the capacity provider.""" - - capacity_provider_arn: str - """The Amazon Resource Name (ARN) of the capacity provider.""" - - name: str - """The name of the capacity provider.""" - - status: str - """ - The current status of the capacity provider. For possible values, see - `CapacityProviderStatus`. - """ - - last_updated_at: datetime - """The timestamp when the capacity provider was last updated.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CAPACITY_PROVIDER_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CAPACITY_PROVIDER_SUMMARY.members["capacityProviderId"], - self.capacity_provider_id, - ) - serializer.write_string( - _SCHEMA_CAPACITY_PROVIDER_SUMMARY.members["capacityProviderArn"], - self.capacity_provider_arn, - ) - serializer.write_string( - _SCHEMA_CAPACITY_PROVIDER_SUMMARY.members["name"], self.name - ) - serializer.write_string( - _SCHEMA_CAPACITY_PROVIDER_SUMMARY.members["status"], self.status - ) - serializer.write_timestamp( - _SCHEMA_CAPACITY_PROVIDER_SUMMARY.members["lastUpdatedAt"], - self.last_updated_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["capacity_provider_id"] = de.read_string( - _SCHEMA_CAPACITY_PROVIDER_SUMMARY.members["capacityProviderId"] - ) - - case 1: - kwargs["capacity_provider_arn"] = de.read_string( - _SCHEMA_CAPACITY_PROVIDER_SUMMARY.members["capacityProviderArn"] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_CAPACITY_PROVIDER_SUMMARY.members["name"] - ) - - case 3: - kwargs["status"] = CapacityProviderStatus( - de.read_string( - _SCHEMA_CAPACITY_PROVIDER_SUMMARY.members["status"] - ) - ) - - case 4: - kwargs["last_updated_at"] = de.read_timestamp( - _SCHEMA_CAPACITY_PROVIDER_SUMMARY.members["lastUpdatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CAPACITY_PROVIDER_SUMMARY, consumer=_consumer) - if "capacity_provider_id" not in kwargs: - kwargs["capacity_provider_id"] = "" - if "capacity_provider_arn" not in kwargs: - kwargs["capacity_provider_arn"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "status" not in kwargs: - kwargs["status"] = CapacityProviderStatus._corrected("") - if "last_updated_at" not in kwargs: - kwargs["last_updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_capacity_provider_list( - serializer: ShapeSerializer, schema: Schema, value: list[CapacityProviderSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_capacity_provider_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[CapacityProviderSummary]: - result: list[CapacityProviderSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(CapacityProviderSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListCapacityProvidersOutput: - """Dataclass for ListCapacityProvidersOutput structure.""" - - capacity_providers: list[CapacityProviderSummary] - """The list of capacity provider summaries.""" - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, use this token when making another request in - the `nextToken` field to return the next batch of results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_CAPACITY_PROVIDERS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_capacity_provider_list( - serializer, - _SCHEMA_LIST_CAPACITY_PROVIDERS_OUTPUT.members["capacityProviders"], - self.capacity_providers, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_CAPACITY_PROVIDERS_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["capacity_providers"] = _deserialize_capacity_provider_list( - de, - _SCHEMA_LIST_CAPACITY_PROVIDERS_OUTPUT.members[ - "capacityProviders" - ], - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_CAPACITY_PROVIDERS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_CAPACITY_PROVIDERS_OUTPUT, consumer=_consumer - ) - if "capacity_providers" not in kwargs: - kwargs["capacity_providers"] = [] - return kwargs - - -LIST_CAPACITY_PROVIDERS = APIOperation( - input=ListCapacityProvidersInput, - output=ListCapacityProvidersOutput, - schema=_SCHEMA_LIST_CAPACITY_PROVIDERS, - input_schema=_SCHEMA_LIST_CAPACITY_PROVIDERS_INPUT, - output_schema=_SCHEMA_LIST_CAPACITY_PROVIDERS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdatedDescription: - """ - Wrapper for updating an optional Description field with PATCH semantics. - When present in an update request, the description is replaced with - optionalValue. When absent, the description is left unchanged. To unset - the description, include the wrapper with optionalValue not specified. - """ - - optional_value: str | None = field(repr=False, default=None) - """ - Represents an optional value that is used to update the human-readable - description of the resource. If not specified, it will clear the current - description of the resource. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATED_DESCRIPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.optional_value is not None: - serializer.write_string( - _SCHEMA_UPDATED_DESCRIPTION.members["optionalValue"], - self.optional_value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["optional_value"] = de.read_string( - _SCHEMA_UPDATED_DESCRIPTION.members["optionalValue"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATED_DESCRIPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateCapacityProviderInput: - """Dataclass for UpdateCapacityProviderInput structure.""" - - capacity_provider_id: str | None = None - """The unique identifier of the capacity provider to update.""" - - description: UpdatedDescription | None = None - """The updated description of the capacity provider.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If you don't specify this field, a - value is randomly generated for you. If this token matches a previous - request, the service ignores the request, but doesn't return an error. - For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_CAPACITY_PROVIDER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.capacity_provider_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_CAPACITY_PROVIDER_INPUT.members["capacityProviderId"], - self.capacity_provider_id, - ) - - if self.description is not None: - serializer.write_struct( - _SCHEMA_UPDATE_CAPACITY_PROVIDER_INPUT.members["description"], - self.description, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_UPDATE_CAPACITY_PROVIDER_INPUT.members["clientToken"], - self.client_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["capacity_provider_id"] = de.read_string( - _SCHEMA_UPDATE_CAPACITY_PROVIDER_INPUT.members[ - "capacityProviderId" - ] - ) - - case 1: - kwargs["description"] = UpdatedDescription.deserialize(de) - - case 2: - kwargs["client_token"] = de.read_string( - _SCHEMA_UPDATE_CAPACITY_PROVIDER_INPUT.members["clientToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_CAPACITY_PROVIDER_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateCapacityProviderOutput: - """Dataclass for UpdateCapacityProviderOutput structure.""" - - capacity_provider_id: str - """The unique identifier of the capacity provider.""" - - capacity_provider_arn: str - """The Amazon Resource Name (ARN) of the capacity provider.""" - - name: str - """The name of the capacity provider.""" - - status: str - """ - The current status of the capacity provider. For possible values, see - `CapacityProviderStatus`. - """ - - created_at: datetime - """The timestamp when the capacity provider was created.""" - - last_updated_at: datetime - """The timestamp when the capacity provider was last updated.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_CAPACITY_PROVIDER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_UPDATE_CAPACITY_PROVIDER_OUTPUT.members["capacityProviderId"], - self.capacity_provider_id, - ) - serializer.write_string( - _SCHEMA_UPDATE_CAPACITY_PROVIDER_OUTPUT.members["capacityProviderArn"], - self.capacity_provider_arn, - ) - serializer.write_string( - _SCHEMA_UPDATE_CAPACITY_PROVIDER_OUTPUT.members["name"], self.name - ) - serializer.write_string( - _SCHEMA_UPDATE_CAPACITY_PROVIDER_OUTPUT.members["status"], self.status - ) - serializer.write_timestamp( - _SCHEMA_UPDATE_CAPACITY_PROVIDER_OUTPUT.members["createdAt"], - self.created_at, - ) - serializer.write_timestamp( - _SCHEMA_UPDATE_CAPACITY_PROVIDER_OUTPUT.members["lastUpdatedAt"], - self.last_updated_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["capacity_provider_id"] = de.read_string( - _SCHEMA_UPDATE_CAPACITY_PROVIDER_OUTPUT.members[ - "capacityProviderId" - ] - ) - - case 1: - kwargs["capacity_provider_arn"] = de.read_string( - _SCHEMA_UPDATE_CAPACITY_PROVIDER_OUTPUT.members[ - "capacityProviderArn" - ] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_CAPACITY_PROVIDER_OUTPUT.members["name"] - ) - - case 3: - kwargs["status"] = CapacityProviderStatus( - de.read_string( - _SCHEMA_UPDATE_CAPACITY_PROVIDER_OUTPUT.members["status"] - ) - ) - - case 4: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_UPDATE_CAPACITY_PROVIDER_OUTPUT.members["createdAt"] - ) - - case 5: - kwargs["last_updated_at"] = de.read_timestamp( - _SCHEMA_UPDATE_CAPACITY_PROVIDER_OUTPUT.members["lastUpdatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_CAPACITY_PROVIDER_OUTPUT, consumer=_consumer - ) - if "capacity_provider_id" not in kwargs: - kwargs["capacity_provider_id"] = "" - if "capacity_provider_arn" not in kwargs: - kwargs["capacity_provider_arn"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "status" not in kwargs: - kwargs["status"] = CapacityProviderStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "last_updated_at" not in kwargs: - kwargs["last_updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -UPDATE_CAPACITY_PROVIDER = APIOperation( - input=UpdateCapacityProviderInput, - output=UpdateCapacityProviderOutput, - schema=_SCHEMA_UPDATE_CAPACITY_PROVIDER, - input_schema=_SCHEMA_UPDATE_CAPACITY_PROVIDER_INPUT, - output_schema=_SCHEMA_UPDATE_CAPACITY_PROVIDER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#RetryableConflictException" - ): RetryableConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_RETRYABLE_CONFLICT_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class CodeInterpreterNetworkMode(UnknownEnumMixin, StrEnum): - PUBLIC = "PUBLIC" - SANDBOX = "SANDBOX" - VPC = "VPC" - - -@dataclass(kw_only=True) -class CodeInterpreterNetworkConfiguration: - """ - The network configuration for a code interpreter. This structure defines - how the code interpreter connects to the network. - """ - - network_mode: str = CodeInterpreterNetworkMode("SANDBOX") - """ - The network mode for the code interpreter. This field specifies how the - code interpreter connects to the network. - """ - - vpc_config: VpcConfig | None = None - """ - The VPC configuration for the code interpreter. This configuration is - required when the network mode is set to `VPC`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CODE_INTERPRETER_NETWORK_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CODE_INTERPRETER_NETWORK_CONFIGURATION.members["networkMode"], - self.network_mode, - ) - if self.vpc_config is not None: - serializer.write_struct( - _SCHEMA_CODE_INTERPRETER_NETWORK_CONFIGURATION.members["vpcConfig"], - self.vpc_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["network_mode"] = CodeInterpreterNetworkMode( - de.read_string( - _SCHEMA_CODE_INTERPRETER_NETWORK_CONFIGURATION.members[ - "networkMode" - ] - ) - ) - - case 1: - kwargs["vpc_config"] = VpcConfig.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CODE_INTERPRETER_NETWORK_CONFIGURATION, consumer=_consumer - ) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls() - - -@dataclass(kw_only=True) -class CreateCodeInterpreterInput: - """Dataclass for CreateCodeInterpreterInput structure.""" - - name: str | None = None - """ - The name of the code interpreter. The name must be unique within your - account. - """ - - description: str | None = field(repr=False, default=None) - """The description of the code interpreter.""" - - execution_role_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the IAM role that provides permissions - for the code interpreter to access Amazon Web Services services. - """ - - network_configuration: CodeInterpreterNetworkConfiguration | None = None - """ - The network configuration for the code interpreter. This configuration - specifies the network mode for the code interpreter. - """ - - certificates: list[Certificate] | None = None - """A list of certificates to install in the code interpreter.""" - - filesystem_configurations: list[ToolsFileSystemConfiguration] | None = None - """ - The file system configurations to mount into the code interpreter. Use - these configurations to mount your own Amazon Simple Storage Service - (Amazon S3) Files or Amazon Elastic File System (Amazon EFS) access - points. Your sessions can then access your data. If you don't specify - this field, no file systems are mounted. - """ - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the operation - completes no more than one time. If this token matches a previous - request, Amazon Bedrock AgentCore ignores the request but does not - return an error. - """ - - tags: dict[str, str] | None = None - """ - A map of tag keys and values to assign to the code interpreter. Tags - enable you to categorize your resources in different ways, for example, - by purpose, owner, or environment. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_CODE_INTERPRETER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_CODE_INTERPRETER_INPUT.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_CODE_INTERPRETER_INPUT.members["description"], - self.description, - ) - - if self.execution_role_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_CODE_INTERPRETER_INPUT.members["executionRoleArn"], - self.execution_role_arn, - ) - - if self.network_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_CODE_INTERPRETER_INPUT.members["networkConfiguration"], - self.network_configuration, - ) - - if self.certificates is not None: - _serialize_certificates( - serializer, - _SCHEMA_CREATE_CODE_INTERPRETER_INPUT.members["certificates"], - self.certificates, - ) - - if self.filesystem_configurations is not None: - _serialize_tools_file_system_configurations( - serializer, - _SCHEMA_CREATE_CODE_INTERPRETER_INPUT.members[ - "filesystemConfigurations" - ], - self.filesystem_configurations, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_CODE_INTERPRETER_INPUT.members["clientToken"], - self.client_token, - ) - - if self.tags is not None: - _serialize_tags_map( - serializer, - _SCHEMA_CREATE_CODE_INTERPRETER_INPUT.members["tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_CODE_INTERPRETER_INPUT.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_CODE_INTERPRETER_INPUT.members["description"] - ) - - case 2: - kwargs["execution_role_arn"] = de.read_string( - _SCHEMA_CREATE_CODE_INTERPRETER_INPUT.members[ - "executionRoleArn" - ] - ) - - case 3: - kwargs["network_configuration"] = ( - CodeInterpreterNetworkConfiguration.deserialize(de) - ) - - case 4: - kwargs["certificates"] = _deserialize_certificates( - de, - _SCHEMA_CREATE_CODE_INTERPRETER_INPUT.members["certificates"], - ) - - case 5: - kwargs["filesystem_configurations"] = ( - _deserialize_tools_file_system_configurations( - de, - _SCHEMA_CREATE_CODE_INTERPRETER_INPUT.members[ - "filesystemConfigurations" - ], - ) - ) - - case 6: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_CODE_INTERPRETER_INPUT.members["clientToken"] - ) - - case 7: - kwargs["tags"] = _deserialize_tags_map( - de, _SCHEMA_CREATE_CODE_INTERPRETER_INPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_CODE_INTERPRETER_INPUT, consumer=_consumer - ) - return kwargs - - -class CodeInterpreterStatus(UnknownEnumMixin, StrEnum): - CREATING = "CREATING" - CREATE_FAILED = "CREATE_FAILED" - READY = "READY" - DELETING = "DELETING" - DELETE_FAILED = "DELETE_FAILED" - DELETED = "DELETED" - - -@dataclass(kw_only=True) -class CreateCodeInterpreterOutput: - """Dataclass for CreateCodeInterpreterOutput structure.""" - - code_interpreter_id: str - """The unique identifier of the created code interpreter.""" - - code_interpreter_arn: str - """The Amazon Resource Name (ARN) of the created code interpreter.""" - - created_at: datetime - """The timestamp when the code interpreter was created.""" - - status: str - """The current status of the code interpreter.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_CODE_INTERPRETER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_CODE_INTERPRETER_OUTPUT.members["codeInterpreterId"], - self.code_interpreter_id, - ) - serializer.write_string( - _SCHEMA_CREATE_CODE_INTERPRETER_OUTPUT.members["codeInterpreterArn"], - self.code_interpreter_arn, - ) - serializer.write_timestamp( - _SCHEMA_CREATE_CODE_INTERPRETER_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_string( - _SCHEMA_CREATE_CODE_INTERPRETER_OUTPUT.members["status"], self.status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["code_interpreter_id"] = de.read_string( - _SCHEMA_CREATE_CODE_INTERPRETER_OUTPUT.members[ - "codeInterpreterId" - ] - ) - - case 1: - kwargs["code_interpreter_arn"] = de.read_string( - _SCHEMA_CREATE_CODE_INTERPRETER_OUTPUT.members[ - "codeInterpreterArn" - ] - ) - - case 2: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_CREATE_CODE_INTERPRETER_OUTPUT.members["createdAt"] - ) - - case 3: - kwargs["status"] = CodeInterpreterStatus( - de.read_string( - _SCHEMA_CREATE_CODE_INTERPRETER_OUTPUT.members["status"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_CODE_INTERPRETER_OUTPUT, consumer=_consumer - ) - if "code_interpreter_id" not in kwargs: - kwargs["code_interpreter_id"] = "" - if "code_interpreter_arn" not in kwargs: - kwargs["code_interpreter_arn"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "status" not in kwargs: - kwargs["status"] = CodeInterpreterStatus._corrected("") - return kwargs - - -CREATE_CODE_INTERPRETER = APIOperation( - input=CreateCodeInterpreterInput, - output=CreateCodeInterpreterOutput, - schema=_SCHEMA_CREATE_CODE_INTERPRETER, - input_schema=_SCHEMA_CREATE_CODE_INTERPRETER_INPUT, - output_schema=_SCHEMA_CREATE_CODE_INTERPRETER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteCodeInterpreterInput: - """Dataclass for DeleteCodeInterpreterInput structure.""" - - code_interpreter_id: str | None = None - """The unique identifier of the code interpreter to delete.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure idempotency of the - request. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_CODE_INTERPRETER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.code_interpreter_id is not None: - serializer.write_string( - _SCHEMA_DELETE_CODE_INTERPRETER_INPUT.members["codeInterpreterId"], - self.code_interpreter_id, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_DELETE_CODE_INTERPRETER_INPUT.members["clientToken"], - self.client_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["code_interpreter_id"] = de.read_string( - _SCHEMA_DELETE_CODE_INTERPRETER_INPUT.members[ - "codeInterpreterId" - ] - ) - - case 1: - kwargs["client_token"] = de.read_string( - _SCHEMA_DELETE_CODE_INTERPRETER_INPUT.members["clientToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_CODE_INTERPRETER_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteCodeInterpreterOutput: - """Dataclass for DeleteCodeInterpreterOutput structure.""" - - code_interpreter_id: str - """The unique identifier of the deleted code interpreter.""" - - status: str - """The current status of the code interpreter deletion.""" - - last_updated_at: datetime - """The timestamp when the code interpreter was last updated.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_CODE_INTERPRETER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DELETE_CODE_INTERPRETER_OUTPUT.members["codeInterpreterId"], - self.code_interpreter_id, - ) - serializer.write_string( - _SCHEMA_DELETE_CODE_INTERPRETER_OUTPUT.members["status"], self.status - ) - serializer.write_timestamp( - _SCHEMA_DELETE_CODE_INTERPRETER_OUTPUT.members["lastUpdatedAt"], - self.last_updated_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["code_interpreter_id"] = de.read_string( - _SCHEMA_DELETE_CODE_INTERPRETER_OUTPUT.members[ - "codeInterpreterId" - ] - ) - - case 1: - kwargs["status"] = CodeInterpreterStatus( - de.read_string( - _SCHEMA_DELETE_CODE_INTERPRETER_OUTPUT.members["status"] - ) - ) - - case 2: - kwargs["last_updated_at"] = de.read_timestamp( - _SCHEMA_DELETE_CODE_INTERPRETER_OUTPUT.members["lastUpdatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_CODE_INTERPRETER_OUTPUT, consumer=_consumer - ) - if "code_interpreter_id" not in kwargs: - kwargs["code_interpreter_id"] = "" - if "status" not in kwargs: - kwargs["status"] = CodeInterpreterStatus._corrected("") - if "last_updated_at" not in kwargs: - kwargs["last_updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -DELETE_CODE_INTERPRETER = APIOperation( - input=DeleteCodeInterpreterInput, - output=DeleteCodeInterpreterOutput, - schema=_SCHEMA_DELETE_CODE_INTERPRETER, - input_schema=_SCHEMA_DELETE_CODE_INTERPRETER_INPUT, - output_schema=_SCHEMA_DELETE_CODE_INTERPRETER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetCodeInterpreterInput: - """Dataclass for GetCodeInterpreterInput structure.""" - - code_interpreter_id: str | None = None - """The unique identifier of the code interpreter to retrieve.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_CODE_INTERPRETER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.code_interpreter_id is not None: - serializer.write_string( - _SCHEMA_GET_CODE_INTERPRETER_INPUT.members["codeInterpreterId"], - self.code_interpreter_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["code_interpreter_id"] = de.read_string( - _SCHEMA_GET_CODE_INTERPRETER_INPUT.members["codeInterpreterId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_CODE_INTERPRETER_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetCodeInterpreterOutput: - """Dataclass for GetCodeInterpreterOutput structure.""" - - code_interpreter_id: str - """The unique identifier of the code interpreter.""" - - code_interpreter_arn: str - """The Amazon Resource Name (ARN) of the code interpreter.""" - - name: str - """The name of the code interpreter.""" - - network_configuration: CodeInterpreterNetworkConfiguration - """ - The network configuration for a code interpreter. This structure defines - how the code interpreter connects to the network. - """ - - status: str - """The current status of the code interpreter.""" - - created_at: datetime - """The timestamp when the code interpreter was created.""" - - last_updated_at: datetime - """The timestamp when the code interpreter was last updated.""" - - description: str | None = field(repr=False, default=None) - """The description of the code interpreter.""" - - execution_role_arn: str | None = None - """The IAM role ARN that provides permissions for the code interpreter.""" - - certificates: list[Certificate] | None = None - """The list of certificates configured for the code interpreter.""" - - filesystem_configurations: list[ToolsFileSystemConfiguration] | None = None - """ - The file system configurations mounted into the code interpreter. Each - entry describes an access point and its mount path. - """ - - failure_reason: str | None = None - """The reason for failure if the code interpreter is in a failed state.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_CODE_INTERPRETER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_CODE_INTERPRETER_OUTPUT.members["codeInterpreterId"], - self.code_interpreter_id, - ) - serializer.write_string( - _SCHEMA_GET_CODE_INTERPRETER_OUTPUT.members["codeInterpreterArn"], - self.code_interpreter_arn, - ) - serializer.write_string( - _SCHEMA_GET_CODE_INTERPRETER_OUTPUT.members["name"], self.name - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_CODE_INTERPRETER_OUTPUT.members["description"], - self.description, - ) - - if self.execution_role_arn is not None: - serializer.write_string( - _SCHEMA_GET_CODE_INTERPRETER_OUTPUT.members["executionRoleArn"], - self.execution_role_arn, - ) - - serializer.write_struct( - _SCHEMA_GET_CODE_INTERPRETER_OUTPUT.members["networkConfiguration"], - self.network_configuration, - ) - serializer.write_string( - _SCHEMA_GET_CODE_INTERPRETER_OUTPUT.members["status"], self.status - ) - if self.certificates is not None: - _serialize_certificates( - serializer, - _SCHEMA_GET_CODE_INTERPRETER_OUTPUT.members["certificates"], - self.certificates, - ) - - if self.filesystem_configurations is not None: - _serialize_tools_file_system_configurations( - serializer, - _SCHEMA_GET_CODE_INTERPRETER_OUTPUT.members["filesystemConfigurations"], - self.filesystem_configurations, - ) - - if self.failure_reason is not None: - serializer.write_string( - _SCHEMA_GET_CODE_INTERPRETER_OUTPUT.members["failureReason"], - self.failure_reason, - ) - - serializer.write_timestamp( - _SCHEMA_GET_CODE_INTERPRETER_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_GET_CODE_INTERPRETER_OUTPUT.members["lastUpdatedAt"], - self.last_updated_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["code_interpreter_id"] = de.read_string( - _SCHEMA_GET_CODE_INTERPRETER_OUTPUT.members["codeInterpreterId"] - ) - - case 1: - kwargs["code_interpreter_arn"] = de.read_string( - _SCHEMA_GET_CODE_INTERPRETER_OUTPUT.members[ - "codeInterpreterArn" - ] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_GET_CODE_INTERPRETER_OUTPUT.members["name"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_GET_CODE_INTERPRETER_OUTPUT.members["description"] - ) - - case 4: - kwargs["execution_role_arn"] = de.read_string( - _SCHEMA_GET_CODE_INTERPRETER_OUTPUT.members["executionRoleArn"] - ) - - case 5: - kwargs["network_configuration"] = ( - CodeInterpreterNetworkConfiguration.deserialize(de) - ) - - case 6: - kwargs["status"] = CodeInterpreterStatus( - de.read_string( - _SCHEMA_GET_CODE_INTERPRETER_OUTPUT.members["status"] - ) - ) - - case 7: - kwargs["certificates"] = _deserialize_certificates( - de, _SCHEMA_GET_CODE_INTERPRETER_OUTPUT.members["certificates"] - ) - - case 8: - kwargs["filesystem_configurations"] = ( - _deserialize_tools_file_system_configurations( - de, - _SCHEMA_GET_CODE_INTERPRETER_OUTPUT.members[ - "filesystemConfigurations" - ], - ) - ) - - case 9: - kwargs["failure_reason"] = de.read_string( - _SCHEMA_GET_CODE_INTERPRETER_OUTPUT.members["failureReason"] - ) - - case 10: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_CODE_INTERPRETER_OUTPUT.members["createdAt"] - ) - - case 11: - kwargs["last_updated_at"] = de.read_timestamp( - _SCHEMA_GET_CODE_INTERPRETER_OUTPUT.members["lastUpdatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_CODE_INTERPRETER_OUTPUT, consumer=_consumer - ) - if "code_interpreter_id" not in kwargs: - kwargs["code_interpreter_id"] = "" - if "code_interpreter_arn" not in kwargs: - kwargs["code_interpreter_arn"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "network_configuration" not in kwargs: - kwargs["network_configuration"] = ( - CodeInterpreterNetworkConfiguration._smithy_default() - ) - if "status" not in kwargs: - kwargs["status"] = CodeInterpreterStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "last_updated_at" not in kwargs: - kwargs["last_updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -GET_CODE_INTERPRETER = APIOperation( - input=GetCodeInterpreterInput, - output=GetCodeInterpreterOutput, - schema=_SCHEMA_GET_CODE_INTERPRETER, - input_schema=_SCHEMA_GET_CODE_INTERPRETER_INPUT, - output_schema=_SCHEMA_GET_CODE_INTERPRETER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListCodeInterpretersInput: - """Dataclass for ListCodeInterpretersInput structure.""" - - max_results: int | None = None - """The maximum number of results to return in the response.""" - - next_token: str | None = None - """A token to retrieve the next page of results.""" - - type: str | None = None - """The type of code interpreters to list.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_CODE_INTERPRETERS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_CODE_INTERPRETERS_INPUT.members["maxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_CODE_INTERPRETERS_INPUT.members["nextToken"], - self.next_token, - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_LIST_CODE_INTERPRETERS_INPUT.members["type"], self.type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_CODE_INTERPRETERS_INPUT.members["maxResults"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_CODE_INTERPRETERS_INPUT.members["nextToken"] - ) - - case 2: - kwargs["type"] = ResourceType( - de.read_string( - _SCHEMA_LIST_CODE_INTERPRETERS_INPUT.members["type"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_CODE_INTERPRETERS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CodeInterpreterSummary: - """ - Contains summary information about a code interpreter. A code - interpreter enables Amazon Bedrock AgentCore Agent to execute code. - """ - - code_interpreter_id: str - """The unique identifier of the code interpreter.""" - - code_interpreter_arn: str - """The Amazon Resource Name (ARN) of the code interpreter.""" - - status: str - """The current status of the code interpreter.""" - - created_at: datetime - """The timestamp when the code interpreter was created.""" - - name: str | None = None - """The name of the code interpreter.""" - - description: str | None = field(repr=False, default=None) - """The description of the code interpreter.""" - - last_updated_at: datetime | None = None - """The timestamp when the code interpreter was last updated.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CODE_INTERPRETER_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CODE_INTERPRETER_SUMMARY.members["codeInterpreterId"], - self.code_interpreter_id, - ) - serializer.write_string( - _SCHEMA_CODE_INTERPRETER_SUMMARY.members["codeInterpreterArn"], - self.code_interpreter_arn, - ) - if self.name is not None: - serializer.write_string( - _SCHEMA_CODE_INTERPRETER_SUMMARY.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CODE_INTERPRETER_SUMMARY.members["description"], - self.description, - ) - - serializer.write_string( - _SCHEMA_CODE_INTERPRETER_SUMMARY.members["status"], self.status - ) - serializer.write_timestamp( - _SCHEMA_CODE_INTERPRETER_SUMMARY.members["createdAt"], self.created_at - ) - if self.last_updated_at is not None: - serializer.write_timestamp( - _SCHEMA_CODE_INTERPRETER_SUMMARY.members["lastUpdatedAt"], - self.last_updated_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["code_interpreter_id"] = de.read_string( - _SCHEMA_CODE_INTERPRETER_SUMMARY.members["codeInterpreterId"] - ) - - case 1: - kwargs["code_interpreter_arn"] = de.read_string( - _SCHEMA_CODE_INTERPRETER_SUMMARY.members["codeInterpreterArn"] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_CODE_INTERPRETER_SUMMARY.members["name"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_CODE_INTERPRETER_SUMMARY.members["description"] - ) - - case 4: - kwargs["status"] = CodeInterpreterStatus( - de.read_string( - _SCHEMA_CODE_INTERPRETER_SUMMARY.members["status"] - ) - ) - - case 5: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_CODE_INTERPRETER_SUMMARY.members["createdAt"] - ) - - case 6: - kwargs["last_updated_at"] = de.read_timestamp( - _SCHEMA_CODE_INTERPRETER_SUMMARY.members["lastUpdatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CODE_INTERPRETER_SUMMARY, consumer=_consumer) - if "code_interpreter_id" not in kwargs: - kwargs["code_interpreter_id"] = "" - if "code_interpreter_arn" not in kwargs: - kwargs["code_interpreter_arn"] = "" - if "status" not in kwargs: - kwargs["status"] = CodeInterpreterStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_code_interpreter_summaries( - serializer: ShapeSerializer, schema: Schema, value: list[CodeInterpreterSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_code_interpreter_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[CodeInterpreterSummary]: - result: list[CodeInterpreterSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(CodeInterpreterSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListCodeInterpretersOutput: - """Dataclass for ListCodeInterpretersOutput structure.""" - - code_interpreter_summaries: list[CodeInterpreterSummary] - """The list of code interpreter summaries.""" - - next_token: str | None = None - """A token to retrieve the next page of results.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_CODE_INTERPRETERS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_code_interpreter_summaries( - serializer, - _SCHEMA_LIST_CODE_INTERPRETERS_OUTPUT.members["codeInterpreterSummaries"], - self.code_interpreter_summaries, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_CODE_INTERPRETERS_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["code_interpreter_summaries"] = ( - _deserialize_code_interpreter_summaries( - de, - _SCHEMA_LIST_CODE_INTERPRETERS_OUTPUT.members[ - "codeInterpreterSummaries" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_CODE_INTERPRETERS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_CODE_INTERPRETERS_OUTPUT, consumer=_consumer - ) - if "code_interpreter_summaries" not in kwargs: - kwargs["code_interpreter_summaries"] = [] - return kwargs - - -LIST_CODE_INTERPRETERS = APIOperation( - input=ListCodeInterpretersInput, - output=ListCodeInterpretersOutput, - schema=_SCHEMA_LIST_CODE_INTERPRETERS, - input_schema=_SCHEMA_LIST_CODE_INTERPRETERS_INPUT, - output_schema=_SCHEMA_LIST_CODE_INTERPRETERS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ComponentConfiguration: - """ - The configuration for a component within a configuration bundle. The - component type is inferred from the component identifier ARN. - """ - - configuration: Document - """The configuration values as a flexible JSON document.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_COMPONENT_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_document( - _SCHEMA_COMPONENT_CONFIGURATION.members["configuration"], self.configuration - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["configuration"] = de.read_document( - _SCHEMA_COMPONENT_CONFIGURATION.members["configuration"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_COMPONENT_CONFIGURATION, consumer=_consumer) - if "configuration" not in kwargs: - kwargs["configuration"] = Document(None) - return kwargs - - -def _serialize_component_configuration_map( - serializer: ShapeSerializer, - schema: Schema, - value: dict[str, ComponentConfiguration], -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_struct(value_schema, v)) - - -def _deserialize_component_configuration_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, ComponentConfiguration]: - result: dict[str, ComponentConfiguration] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = ComponentConfiguration.deserialize(d) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class VersionCreatedBySource: - """The source that created a configuration bundle version.""" - - name: str - """ - The name of the source (for example, `user`, `optimization-job`, or - `system`). - """ - - arn: str | None = None - """ - The Amazon Resource Name (ARN) of the source, if applicable (for - example, a user ARN or optimization job ARN). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VERSION_CREATED_BY_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_VERSION_CREATED_BY_SOURCE.members["name"], self.name - ) - if self.arn is not None: - serializer.write_string( - _SCHEMA_VERSION_CREATED_BY_SOURCE.members["arn"], self.arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_VERSION_CREATED_BY_SOURCE.members["name"] - ) - - case 1: - kwargs["arn"] = de.read_string( - _SCHEMA_VERSION_CREATED_BY_SOURCE.members["arn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VERSION_CREATED_BY_SOURCE, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - return kwargs - - -@dataclass(kw_only=True) -class CreateConfigurationBundleInput: - """Dataclass for CreateConfigurationBundleInput structure.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If you don't specify this field, a - value is randomly generated for you. If this token matches a previous - request, the service ignores the request, but doesn't return an error. - For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - bundle_name: str | None = None - """ - The name for the configuration bundle. Names must be unique within your - account. - """ - - description: str | None = field(repr=False, default=None) - """The description for the configuration bundle.""" - - components: dict[str, ComponentConfiguration] | None = None - """ - A map of component identifiers to their configurations. Each component - represents a configurable element within the bundle. - """ - - branch_name: str | None = None - """ - The branch name for version tracking. Defaults to `mainline` if not - specified. - """ - - commit_message: str | None = None - """ - A commit message describing the initial version of the configuration - bundle. - """ - - created_by: VersionCreatedBySource | None = None - """ - The source that created this version, including the source name and - optional ARN. - """ - - kms_key_arn: str | None = None - """Optional KMS key ARN for encrypting component configurations.""" - - tags: dict[str, str] | None = None - """ - A map of tag keys and values to assign to the configuration bundle. Tags - enable you to categorize your resources in different ways, for example, - by purpose, owner, or environment. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_CONFIGURATION_BUNDLE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_CONFIGURATION_BUNDLE_INPUT.members["clientToken"], - self.client_token, - ) - - if self.bundle_name is not None: - serializer.write_string( - _SCHEMA_CREATE_CONFIGURATION_BUNDLE_INPUT.members["bundleName"], - self.bundle_name, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_CONFIGURATION_BUNDLE_INPUT.members["description"], - self.description, - ) - - if self.components is not None: - _serialize_component_configuration_map( - serializer, - _SCHEMA_CREATE_CONFIGURATION_BUNDLE_INPUT.members["components"], - self.components, - ) - - if self.branch_name is not None: - serializer.write_string( - _SCHEMA_CREATE_CONFIGURATION_BUNDLE_INPUT.members["branchName"], - self.branch_name, - ) - - if self.commit_message is not None: - serializer.write_string( - _SCHEMA_CREATE_CONFIGURATION_BUNDLE_INPUT.members["commitMessage"], - self.commit_message, - ) - - if self.created_by is not None: - serializer.write_struct( - _SCHEMA_CREATE_CONFIGURATION_BUNDLE_INPUT.members["createdBy"], - self.created_by, - ) - - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_CONFIGURATION_BUNDLE_INPUT.members["kmsKeyArn"], - self.kms_key_arn, - ) - - if self.tags is not None: - _serialize_tags_map( - serializer, - _SCHEMA_CREATE_CONFIGURATION_BUNDLE_INPUT.members["tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_CONFIGURATION_BUNDLE_INPUT.members["clientToken"] - ) - - case 1: - kwargs["bundle_name"] = de.read_string( - _SCHEMA_CREATE_CONFIGURATION_BUNDLE_INPUT.members["bundleName"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_CONFIGURATION_BUNDLE_INPUT.members["description"] - ) - - case 3: - kwargs["components"] = _deserialize_component_configuration_map( - de, - _SCHEMA_CREATE_CONFIGURATION_BUNDLE_INPUT.members["components"], - ) - - case 4: - kwargs["branch_name"] = de.read_string( - _SCHEMA_CREATE_CONFIGURATION_BUNDLE_INPUT.members["branchName"] - ) - - case 5: - kwargs["commit_message"] = de.read_string( - _SCHEMA_CREATE_CONFIGURATION_BUNDLE_INPUT.members[ - "commitMessage" - ] - ) - - case 6: - kwargs["created_by"] = VersionCreatedBySource.deserialize(de) - - case 7: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_CREATE_CONFIGURATION_BUNDLE_INPUT.members["kmsKeyArn"] - ) - - case 8: - kwargs["tags"] = _deserialize_tags_map( - de, _SCHEMA_CREATE_CONFIGURATION_BUNDLE_INPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_CONFIGURATION_BUNDLE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CreateConfigurationBundleOutput: - """Dataclass for CreateConfigurationBundleOutput structure.""" - - bundle_arn: str - """The Amazon Resource Name (ARN) of the created configuration bundle.""" - - bundle_id: str - """The unique identifier of the created configuration bundle.""" - - version_id: str - """The initial version identifier of the configuration bundle.""" - - created_at: datetime - """The timestamp when the configuration bundle was created.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_CONFIGURATION_BUNDLE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_CONFIGURATION_BUNDLE_OUTPUT.members["bundleArn"], - self.bundle_arn, - ) - serializer.write_string( - _SCHEMA_CREATE_CONFIGURATION_BUNDLE_OUTPUT.members["bundleId"], - self.bundle_id, - ) - serializer.write_string( - _SCHEMA_CREATE_CONFIGURATION_BUNDLE_OUTPUT.members["versionId"], - self.version_id, - ) - serializer.write_timestamp( - _SCHEMA_CREATE_CONFIGURATION_BUNDLE_OUTPUT.members["createdAt"], - self.created_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bundle_arn"] = de.read_string( - _SCHEMA_CREATE_CONFIGURATION_BUNDLE_OUTPUT.members["bundleArn"] - ) - - case 1: - kwargs["bundle_id"] = de.read_string( - _SCHEMA_CREATE_CONFIGURATION_BUNDLE_OUTPUT.members["bundleId"] - ) - - case 2: - kwargs["version_id"] = de.read_string( - _SCHEMA_CREATE_CONFIGURATION_BUNDLE_OUTPUT.members["versionId"] - ) - - case 3: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_CREATE_CONFIGURATION_BUNDLE_OUTPUT.members["createdAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_CONFIGURATION_BUNDLE_OUTPUT, consumer=_consumer - ) - if "bundle_arn" not in kwargs: - kwargs["bundle_arn"] = "" - if "bundle_id" not in kwargs: - kwargs["bundle_id"] = "" - if "version_id" not in kwargs: - kwargs["version_id"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -CREATE_CONFIGURATION_BUNDLE = APIOperation( - input=CreateConfigurationBundleInput, - output=CreateConfigurationBundleOutput, - schema=_SCHEMA_CREATE_CONFIGURATION_BUNDLE, - input_schema=_SCHEMA_CREATE_CONFIGURATION_BUNDLE_INPUT, - output_schema=_SCHEMA_CREATE_CONFIGURATION_BUNDLE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteConfigurationBundleInput: - """Dataclass for DeleteConfigurationBundleInput structure.""" - - bundle_id: str | None = None - """The unique identifier of the configuration bundle to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_CONFIGURATION_BUNDLE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.bundle_id is not None: - serializer.write_string( - _SCHEMA_DELETE_CONFIGURATION_BUNDLE_INPUT.members["bundleId"], - self.bundle_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bundle_id"] = de.read_string( - _SCHEMA_DELETE_CONFIGURATION_BUNDLE_INPUT.members["bundleId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_CONFIGURATION_BUNDLE_INPUT, consumer=_consumer - ) - return kwargs - - -class ConfigurationBundleStatus(UnknownEnumMixin, StrEnum): - ACTIVE = "ACTIVE" - CREATING = "CREATING" - CREATE_FAILED = "CREATE_FAILED" - UPDATING = "UPDATING" - UPDATE_FAILED = "UPDATE_FAILED" - DELETING = "DELETING" - DELETE_FAILED = "DELETE_FAILED" - - -@dataclass(kw_only=True) -class DeleteConfigurationBundleOutput: - """Dataclass for DeleteConfigurationBundleOutput structure.""" - - bundle_id: str - """The unique identifier of the deleted configuration bundle.""" - - status: str - """The status of the configuration bundle deletion operation.""" - - bundle_arn: str | None = None - """The Amazon Resource Name (ARN) of the deleted configuration bundle.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_CONFIGURATION_BUNDLE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.bundle_arn is not None: - serializer.write_string( - _SCHEMA_DELETE_CONFIGURATION_BUNDLE_OUTPUT.members["bundleArn"], - self.bundle_arn, - ) - - serializer.write_string( - _SCHEMA_DELETE_CONFIGURATION_BUNDLE_OUTPUT.members["bundleId"], - self.bundle_id, - ) - serializer.write_string( - _SCHEMA_DELETE_CONFIGURATION_BUNDLE_OUTPUT.members["status"], self.status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bundle_arn"] = de.read_string( - _SCHEMA_DELETE_CONFIGURATION_BUNDLE_OUTPUT.members["bundleArn"] - ) - - case 1: - kwargs["bundle_id"] = de.read_string( - _SCHEMA_DELETE_CONFIGURATION_BUNDLE_OUTPUT.members["bundleId"] - ) - - case 2: - kwargs["status"] = ConfigurationBundleStatus( - de.read_string( - _SCHEMA_DELETE_CONFIGURATION_BUNDLE_OUTPUT.members["status"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_CONFIGURATION_BUNDLE_OUTPUT, consumer=_consumer - ) - if "bundle_id" not in kwargs: - kwargs["bundle_id"] = "" - if "status" not in kwargs: - kwargs["status"] = ConfigurationBundleStatus._corrected("") - return kwargs - - -DELETE_CONFIGURATION_BUNDLE = APIOperation( - input=DeleteConfigurationBundleInput, - output=DeleteConfigurationBundleOutput, - schema=_SCHEMA_DELETE_CONFIGURATION_BUNDLE, - input_schema=_SCHEMA_DELETE_CONFIGURATION_BUNDLE_INPUT, - output_schema=_SCHEMA_DELETE_CONFIGURATION_BUNDLE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetConfigurationBundleInput: - """Dataclass for GetConfigurationBundleInput structure.""" - - bundle_id: str | None = None - """The unique identifier of the configuration bundle to retrieve.""" - - branch_name: str | None = None - """ - The branch name to get the latest version from. If not specified, - returns the latest version on the mainline branch. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_CONFIGURATION_BUNDLE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.bundle_id is not None: - serializer.write_string( - _SCHEMA_GET_CONFIGURATION_BUNDLE_INPUT.members["bundleId"], - self.bundle_id, - ) - - if self.branch_name is not None: - serializer.write_string( - _SCHEMA_GET_CONFIGURATION_BUNDLE_INPUT.members["branchName"], - self.branch_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bundle_id"] = de.read_string( - _SCHEMA_GET_CONFIGURATION_BUNDLE_INPUT.members["bundleId"] - ) - - case 1: - kwargs["branch_name"] = de.read_string( - _SCHEMA_GET_CONFIGURATION_BUNDLE_INPUT.members["branchName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_CONFIGURATION_BUNDLE_INPUT, consumer=_consumer - ) - return kwargs - - -def _serialize_configuration_bundle_version_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_configuration_bundle_version_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class VersionLineageMetadata: - """ - The version lineage metadata that tracks parent versions and creation - source. Supports git-like two-parent merges for branch management. - """ - - parent_version_ids: list[str] | None = None - """ - A list of parent version identifiers. Regular commits have 0-1 parents. - Merge commits have 2 parents: the target branch parent and the source - branch parent. The first parent represents the primary lineage. - """ - - branch_name: str | None = None - """ - The branch name for this version. If not specified, inherits the - parent's branch or defaults to `mainline`. - """ - - created_by: VersionCreatedBySource | None = None - """The source that created this version.""" - - commit_message: str | None = None - """A commit message describing the changes in this version.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VERSION_LINEAGE_METADATA, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.parent_version_ids is not None: - _serialize_configuration_bundle_version_list( - serializer, - _SCHEMA_VERSION_LINEAGE_METADATA.members["parentVersionIds"], - self.parent_version_ids, - ) - - if self.branch_name is not None: - serializer.write_string( - _SCHEMA_VERSION_LINEAGE_METADATA.members["branchName"], self.branch_name - ) - - if self.created_by is not None: - serializer.write_struct( - _SCHEMA_VERSION_LINEAGE_METADATA.members["createdBy"], self.created_by - ) - - if self.commit_message is not None: - serializer.write_string( - _SCHEMA_VERSION_LINEAGE_METADATA.members["commitMessage"], - self.commit_message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["parent_version_ids"] = ( - _deserialize_configuration_bundle_version_list( - de, - _SCHEMA_VERSION_LINEAGE_METADATA.members[ - "parentVersionIds" - ], - ) - ) - - case 1: - kwargs["branch_name"] = de.read_string( - _SCHEMA_VERSION_LINEAGE_METADATA.members["branchName"] - ) - - case 2: - kwargs["created_by"] = VersionCreatedBySource.deserialize(de) - - case 3: - kwargs["commit_message"] = de.read_string( - _SCHEMA_VERSION_LINEAGE_METADATA.members["commitMessage"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VERSION_LINEAGE_METADATA, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetConfigurationBundleOutput: - """Dataclass for GetConfigurationBundleOutput structure.""" - - bundle_arn: str - """The Amazon Resource Name (ARN) of the configuration bundle.""" - - bundle_id: str - """The unique identifier of the configuration bundle.""" - - bundle_name: str - """The name of the configuration bundle.""" - - version_id: str - """The version identifier of this configuration bundle.""" - - components: dict[str, ComponentConfiguration] - """A map of component identifiers to their configurations for this version.""" - - created_at: datetime - """The timestamp when the configuration bundle was created.""" - - updated_at: datetime - """The timestamp when the configuration bundle was last updated.""" - - description: str | None = field(repr=False, default=None) - """The description of the configuration bundle.""" - - lineage_metadata: VersionLineageMetadata | None = None - """ - The version lineage metadata, including parent versions, branch name, - and creation source. - """ - - kms_key_arn: str | None = None - """ - KMS key ARN used to encrypt component configurations, if CMK was - provided. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_CONFIGURATION_BUNDLE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_CONFIGURATION_BUNDLE_OUTPUT.members["bundleArn"], - self.bundle_arn, - ) - serializer.write_string( - _SCHEMA_GET_CONFIGURATION_BUNDLE_OUTPUT.members["bundleId"], self.bundle_id - ) - serializer.write_string( - _SCHEMA_GET_CONFIGURATION_BUNDLE_OUTPUT.members["bundleName"], - self.bundle_name, - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_CONFIGURATION_BUNDLE_OUTPUT.members["description"], - self.description, - ) - - serializer.write_string( - _SCHEMA_GET_CONFIGURATION_BUNDLE_OUTPUT.members["versionId"], - self.version_id, - ) - _serialize_component_configuration_map( - serializer, - _SCHEMA_GET_CONFIGURATION_BUNDLE_OUTPUT.members["components"], - self.components, - ) - if self.lineage_metadata is not None: - serializer.write_struct( - _SCHEMA_GET_CONFIGURATION_BUNDLE_OUTPUT.members["lineageMetadata"], - self.lineage_metadata, - ) - - serializer.write_timestamp( - _SCHEMA_GET_CONFIGURATION_BUNDLE_OUTPUT.members["createdAt"], - self.created_at, - ) - serializer.write_timestamp( - _SCHEMA_GET_CONFIGURATION_BUNDLE_OUTPUT.members["updatedAt"], - self.updated_at, - ) - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_GET_CONFIGURATION_BUNDLE_OUTPUT.members["kmsKeyArn"], - self.kms_key_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bundle_arn"] = de.read_string( - _SCHEMA_GET_CONFIGURATION_BUNDLE_OUTPUT.members["bundleArn"] - ) - - case 1: - kwargs["bundle_id"] = de.read_string( - _SCHEMA_GET_CONFIGURATION_BUNDLE_OUTPUT.members["bundleId"] - ) - - case 2: - kwargs["bundle_name"] = de.read_string( - _SCHEMA_GET_CONFIGURATION_BUNDLE_OUTPUT.members["bundleName"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_GET_CONFIGURATION_BUNDLE_OUTPUT.members["description"] - ) - - case 4: - kwargs["version_id"] = de.read_string( - _SCHEMA_GET_CONFIGURATION_BUNDLE_OUTPUT.members["versionId"] - ) - - case 5: - kwargs["components"] = _deserialize_component_configuration_map( - de, - _SCHEMA_GET_CONFIGURATION_BUNDLE_OUTPUT.members["components"], - ) - - case 6: - kwargs["lineage_metadata"] = VersionLineageMetadata.deserialize(de) - - case 7: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_CONFIGURATION_BUNDLE_OUTPUT.members["createdAt"] - ) - - case 8: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_GET_CONFIGURATION_BUNDLE_OUTPUT.members["updatedAt"] - ) - - case 9: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_GET_CONFIGURATION_BUNDLE_OUTPUT.members["kmsKeyArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_CONFIGURATION_BUNDLE_OUTPUT, consumer=_consumer - ) - if "bundle_arn" not in kwargs: - kwargs["bundle_arn"] = "" - if "bundle_id" not in kwargs: - kwargs["bundle_id"] = "" - if "bundle_name" not in kwargs: - kwargs["bundle_name"] = "" - if "version_id" not in kwargs: - kwargs["version_id"] = "" - if "components" not in kwargs: - kwargs["components"] = {} - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -GET_CONFIGURATION_BUNDLE = APIOperation( - input=GetConfigurationBundleInput, - output=GetConfigurationBundleOutput, - schema=_SCHEMA_GET_CONFIGURATION_BUNDLE, - input_schema=_SCHEMA_GET_CONFIGURATION_BUNDLE_INPUT, - output_schema=_SCHEMA_GET_CONFIGURATION_BUNDLE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetConfigurationBundleVersionInput: - """Dataclass for GetConfigurationBundleVersionInput structure.""" - - bundle_id: str | None = None - """The unique identifier of the configuration bundle.""" - - version_id: str | None = None - """The version identifier of the configuration bundle version to retrieve.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_CONFIGURATION_BUNDLE_VERSION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.bundle_id is not None: - serializer.write_string( - _SCHEMA_GET_CONFIGURATION_BUNDLE_VERSION_INPUT.members["bundleId"], - self.bundle_id, - ) - - if self.version_id is not None: - serializer.write_string( - _SCHEMA_GET_CONFIGURATION_BUNDLE_VERSION_INPUT.members["versionId"], - self.version_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bundle_id"] = de.read_string( - _SCHEMA_GET_CONFIGURATION_BUNDLE_VERSION_INPUT.members[ - "bundleId" - ] - ) - - case 1: - kwargs["version_id"] = de.read_string( - _SCHEMA_GET_CONFIGURATION_BUNDLE_VERSION_INPUT.members[ - "versionId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_CONFIGURATION_BUNDLE_VERSION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetConfigurationBundleVersionOutput: - """Dataclass for GetConfigurationBundleVersionOutput structure.""" - - bundle_arn: str - """The Amazon Resource Name (ARN) of the configuration bundle.""" - - bundle_id: str - """The unique identifier of the configuration bundle.""" - - bundle_name: str - """The name of the configuration bundle.""" - - version_id: str - """The version identifier of this configuration bundle version.""" - - components: dict[str, ComponentConfiguration] - """A map of component identifiers to their configurations for this version.""" - - created_at: datetime - """The timestamp when the configuration bundle was created.""" - - version_created_at: datetime - """The timestamp when this specific version was created.""" - - description: str | None = field(repr=False, default=None) - """The description of the configuration bundle.""" - - lineage_metadata: VersionLineageMetadata | None = None - """ - The version lineage metadata, including parent versions, branch name, - and creation source. - """ - - kms_key_arn: str | None = None - """ - KMS key ARN used to encrypt component configurations, if CMK was - provided. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_CONFIGURATION_BUNDLE_VERSION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_CONFIGURATION_BUNDLE_VERSION_OUTPUT.members["bundleArn"], - self.bundle_arn, - ) - serializer.write_string( - _SCHEMA_GET_CONFIGURATION_BUNDLE_VERSION_OUTPUT.members["bundleId"], - self.bundle_id, - ) - serializer.write_string( - _SCHEMA_GET_CONFIGURATION_BUNDLE_VERSION_OUTPUT.members["bundleName"], - self.bundle_name, - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_CONFIGURATION_BUNDLE_VERSION_OUTPUT.members["description"], - self.description, - ) - - serializer.write_string( - _SCHEMA_GET_CONFIGURATION_BUNDLE_VERSION_OUTPUT.members["versionId"], - self.version_id, - ) - _serialize_component_configuration_map( - serializer, - _SCHEMA_GET_CONFIGURATION_BUNDLE_VERSION_OUTPUT.members["components"], - self.components, - ) - if self.lineage_metadata is not None: - serializer.write_struct( - _SCHEMA_GET_CONFIGURATION_BUNDLE_VERSION_OUTPUT.members[ - "lineageMetadata" - ], - self.lineage_metadata, - ) - - serializer.write_timestamp( - _SCHEMA_GET_CONFIGURATION_BUNDLE_VERSION_OUTPUT.members["createdAt"], - self.created_at, - ) - serializer.write_timestamp( - _SCHEMA_GET_CONFIGURATION_BUNDLE_VERSION_OUTPUT.members["versionCreatedAt"], - self.version_created_at, - ) - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_GET_CONFIGURATION_BUNDLE_VERSION_OUTPUT.members["kmsKeyArn"], - self.kms_key_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bundle_arn"] = de.read_string( - _SCHEMA_GET_CONFIGURATION_BUNDLE_VERSION_OUTPUT.members[ - "bundleArn" - ] - ) - - case 1: - kwargs["bundle_id"] = de.read_string( - _SCHEMA_GET_CONFIGURATION_BUNDLE_VERSION_OUTPUT.members[ - "bundleId" - ] - ) - - case 2: - kwargs["bundle_name"] = de.read_string( - _SCHEMA_GET_CONFIGURATION_BUNDLE_VERSION_OUTPUT.members[ - "bundleName" - ] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_GET_CONFIGURATION_BUNDLE_VERSION_OUTPUT.members[ - "description" - ] - ) - - case 4: - kwargs["version_id"] = de.read_string( - _SCHEMA_GET_CONFIGURATION_BUNDLE_VERSION_OUTPUT.members[ - "versionId" - ] - ) - - case 5: - kwargs["components"] = _deserialize_component_configuration_map( - de, - _SCHEMA_GET_CONFIGURATION_BUNDLE_VERSION_OUTPUT.members[ - "components" - ], - ) - - case 6: - kwargs["lineage_metadata"] = VersionLineageMetadata.deserialize(de) - - case 7: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_CONFIGURATION_BUNDLE_VERSION_OUTPUT.members[ - "createdAt" - ] - ) - - case 8: - kwargs["version_created_at"] = de.read_timestamp( - _SCHEMA_GET_CONFIGURATION_BUNDLE_VERSION_OUTPUT.members[ - "versionCreatedAt" - ] - ) - - case 9: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_GET_CONFIGURATION_BUNDLE_VERSION_OUTPUT.members[ - "kmsKeyArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_CONFIGURATION_BUNDLE_VERSION_OUTPUT, consumer=_consumer - ) - if "bundle_arn" not in kwargs: - kwargs["bundle_arn"] = "" - if "bundle_id" not in kwargs: - kwargs["bundle_id"] = "" - if "bundle_name" not in kwargs: - kwargs["bundle_name"] = "" - if "version_id" not in kwargs: - kwargs["version_id"] = "" - if "components" not in kwargs: - kwargs["components"] = {} - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "version_created_at" not in kwargs: - kwargs["version_created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -GET_CONFIGURATION_BUNDLE_VERSION = APIOperation( - input=GetConfigurationBundleVersionInput, - output=GetConfigurationBundleVersionOutput, - schema=_SCHEMA_GET_CONFIGURATION_BUNDLE_VERSION, - input_schema=_SCHEMA_GET_CONFIGURATION_BUNDLE_VERSION_INPUT, - output_schema=_SCHEMA_GET_CONFIGURATION_BUNDLE_VERSION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListConfigurationBundlesInput: - """Dataclass for ListConfigurationBundlesInput structure.""" - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, enter the token returned in the `nextToken` - field in the response in this field to return the next batch of results. - """ - - max_results: int | None = None - """ - The maximum number of results to return in the response. If the total - number of results is greater than this value, use the token returned in - the response in the `nextToken` field when making another request to - return the next batch of results. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_CONFIGURATION_BUNDLES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_CONFIGURATION_BUNDLES_INPUT.members["nextToken"], - self.next_token, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_CONFIGURATION_BUNDLES_INPUT.members["maxResults"], - self.max_results, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_CONFIGURATION_BUNDLES_INPUT.members["nextToken"] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_CONFIGURATION_BUNDLES_INPUT.members["maxResults"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_CONFIGURATION_BUNDLES_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ConfigurationBundleSummary: - """Summary information about a configuration bundle.""" - - bundle_arn: str - """The Amazon Resource Name (ARN) of the configuration bundle.""" - - bundle_id: str - """The unique identifier of the configuration bundle.""" - - bundle_name: str - """The name of the configuration bundle.""" - - description: str | None = field(repr=False, default=None) - """The description of the configuration bundle.""" - - created_at: datetime | None = None - """The timestamp when the configuration bundle was created.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONFIGURATION_BUNDLE_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CONFIGURATION_BUNDLE_SUMMARY.members["bundleArn"], self.bundle_arn - ) - serializer.write_string( - _SCHEMA_CONFIGURATION_BUNDLE_SUMMARY.members["bundleId"], self.bundle_id - ) - serializer.write_string( - _SCHEMA_CONFIGURATION_BUNDLE_SUMMARY.members["bundleName"], self.bundle_name - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_CONFIGURATION_BUNDLE_SUMMARY.members["description"], - self.description, - ) - - if self.created_at is not None: - serializer.write_timestamp( - _SCHEMA_CONFIGURATION_BUNDLE_SUMMARY.members["createdAt"], - self.created_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bundle_arn"] = de.read_string( - _SCHEMA_CONFIGURATION_BUNDLE_SUMMARY.members["bundleArn"] - ) - - case 1: - kwargs["bundle_id"] = de.read_string( - _SCHEMA_CONFIGURATION_BUNDLE_SUMMARY.members["bundleId"] - ) - - case 2: - kwargs["bundle_name"] = de.read_string( - _SCHEMA_CONFIGURATION_BUNDLE_SUMMARY.members["bundleName"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_CONFIGURATION_BUNDLE_SUMMARY.members["description"] - ) - - case 4: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_CONFIGURATION_BUNDLE_SUMMARY.members["createdAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CONFIGURATION_BUNDLE_SUMMARY, consumer=_consumer - ) - if "bundle_arn" not in kwargs: - kwargs["bundle_arn"] = "" - if "bundle_id" not in kwargs: - kwargs["bundle_id"] = "" - if "bundle_name" not in kwargs: - kwargs["bundle_name"] = "" - return kwargs - - -def _serialize_configuration_bundle_summary_list( - serializer: ShapeSerializer, schema: Schema, value: list[ConfigurationBundleSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_configuration_bundle_summary_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ConfigurationBundleSummary]: - result: list[ConfigurationBundleSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ConfigurationBundleSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListConfigurationBundlesOutput: - """Dataclass for ListConfigurationBundlesOutput structure.""" - - bundles: list[ConfigurationBundleSummary] - """The list of configuration bundle summaries.""" - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, use this token when making another request in - the `nextToken` field to return the next batch of results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_CONFIGURATION_BUNDLES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_configuration_bundle_summary_list( - serializer, - _SCHEMA_LIST_CONFIGURATION_BUNDLES_OUTPUT.members["bundles"], - self.bundles, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_CONFIGURATION_BUNDLES_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bundles"] = _deserialize_configuration_bundle_summary_list( - de, _SCHEMA_LIST_CONFIGURATION_BUNDLES_OUTPUT.members["bundles"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_CONFIGURATION_BUNDLES_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_CONFIGURATION_BUNDLES_OUTPUT, consumer=_consumer - ) - if "bundles" not in kwargs: - kwargs["bundles"] = [] - return kwargs - - -LIST_CONFIGURATION_BUNDLES = APIOperation( - input=ListConfigurationBundlesInput, - output=ListConfigurationBundlesOutput, - schema=_SCHEMA_LIST_CONFIGURATION_BUNDLES, - input_schema=_SCHEMA_LIST_CONFIGURATION_BUNDLES_INPUT, - output_schema=_SCHEMA_LIST_CONFIGURATION_BUNDLES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class VersionFilter: - """A filter for listing configuration bundle versions.""" - - branch_name: str | None = None - """Filter by branch name.""" - - created_by_name: str | None = None - """Filter by creation source name.""" - - latest_per_branch: bool | None = None - """ - When true, returns only the latest version for each branch. When false - or not specified, returns all versions. Can be combined with - `branchName` to get the latest version for a specific branch. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VERSION_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.branch_name is not None: - serializer.write_string( - _SCHEMA_VERSION_FILTER.members["branchName"], self.branch_name - ) - - if self.created_by_name is not None: - serializer.write_string( - _SCHEMA_VERSION_FILTER.members["createdByName"], self.created_by_name - ) - - if self.latest_per_branch is not None: - serializer.write_boolean( - _SCHEMA_VERSION_FILTER.members["latestPerBranch"], - self.latest_per_branch, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["branch_name"] = de.read_string( - _SCHEMA_VERSION_FILTER.members["branchName"] - ) - - case 1: - kwargs["created_by_name"] = de.read_string( - _SCHEMA_VERSION_FILTER.members["createdByName"] - ) - - case 2: - kwargs["latest_per_branch"] = de.read_boolean( - _SCHEMA_VERSION_FILTER.members["latestPerBranch"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VERSION_FILTER, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ListConfigurationBundleVersionsInput: - """Dataclass for ListConfigurationBundleVersionsInput structure.""" - - bundle_id: str | None = None - """The unique identifier of the configuration bundle to list versions for.""" - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, enter the token returned in the `nextToken` - field in the response in this field to return the next batch of results. - """ - - max_results: int | None = None - """ - The maximum number of results to return in the response. If the total - number of results is greater than this value, use the token returned in - the response in the `nextToken` field when making another request to - return the next batch of results. - """ - - filter: VersionFilter | None = None - """ - An optional filter for listing versions, including branch name, creation - source, and whether to return only the latest version per branch. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_CONFIGURATION_BUNDLE_VERSIONS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.bundle_id is not None: - serializer.write_string( - _SCHEMA_LIST_CONFIGURATION_BUNDLE_VERSIONS_INPUT.members["bundleId"], - self.bundle_id, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_CONFIGURATION_BUNDLE_VERSIONS_INPUT.members["nextToken"], - self.next_token, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_CONFIGURATION_BUNDLE_VERSIONS_INPUT.members["maxResults"], - self.max_results, - ) - - if self.filter is not None: - serializer.write_struct( - _SCHEMA_LIST_CONFIGURATION_BUNDLE_VERSIONS_INPUT.members["filter"], - self.filter, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bundle_id"] = de.read_string( - _SCHEMA_LIST_CONFIGURATION_BUNDLE_VERSIONS_INPUT.members[ - "bundleId" - ] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_CONFIGURATION_BUNDLE_VERSIONS_INPUT.members[ - "nextToken" - ] - ) - - case 2: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_CONFIGURATION_BUNDLE_VERSIONS_INPUT.members[ - "maxResults" - ] - ) - - case 3: - kwargs["filter"] = VersionFilter.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_CONFIGURATION_BUNDLE_VERSIONS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ConfigurationBundleVersionSummary: - """Summary information about a configuration bundle version.""" - - bundle_arn: str - """The Amazon Resource Name (ARN) of the configuration bundle.""" - - bundle_id: str - """The unique identifier of the configuration bundle.""" - - version_id: str - """The version identifier of this configuration bundle version.""" - - version_created_at: datetime - """The timestamp when this version was created.""" - - lineage_metadata: VersionLineageMetadata | None = None - """ - The version lineage metadata, including parent versions, branch name, - and creation source. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONFIGURATION_BUNDLE_VERSION_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CONFIGURATION_BUNDLE_VERSION_SUMMARY.members["bundleArn"], - self.bundle_arn, - ) - serializer.write_string( - _SCHEMA_CONFIGURATION_BUNDLE_VERSION_SUMMARY.members["bundleId"], - self.bundle_id, - ) - serializer.write_string( - _SCHEMA_CONFIGURATION_BUNDLE_VERSION_SUMMARY.members["versionId"], - self.version_id, - ) - if self.lineage_metadata is not None: - serializer.write_struct( - _SCHEMA_CONFIGURATION_BUNDLE_VERSION_SUMMARY.members["lineageMetadata"], - self.lineage_metadata, - ) - - serializer.write_timestamp( - _SCHEMA_CONFIGURATION_BUNDLE_VERSION_SUMMARY.members["versionCreatedAt"], - self.version_created_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bundle_arn"] = de.read_string( - _SCHEMA_CONFIGURATION_BUNDLE_VERSION_SUMMARY.members[ - "bundleArn" - ] - ) - - case 1: - kwargs["bundle_id"] = de.read_string( - _SCHEMA_CONFIGURATION_BUNDLE_VERSION_SUMMARY.members["bundleId"] - ) - - case 2: - kwargs["version_id"] = de.read_string( - _SCHEMA_CONFIGURATION_BUNDLE_VERSION_SUMMARY.members[ - "versionId" - ] - ) - - case 3: - kwargs["lineage_metadata"] = VersionLineageMetadata.deserialize(de) - - case 4: - kwargs["version_created_at"] = de.read_timestamp( - _SCHEMA_CONFIGURATION_BUNDLE_VERSION_SUMMARY.members[ - "versionCreatedAt" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CONFIGURATION_BUNDLE_VERSION_SUMMARY, consumer=_consumer - ) - if "bundle_arn" not in kwargs: - kwargs["bundle_arn"] = "" - if "bundle_id" not in kwargs: - kwargs["bundle_id"] = "" - if "version_id" not in kwargs: - kwargs["version_id"] = "" - if "version_created_at" not in kwargs: - kwargs["version_created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_configuration_bundle_version_summary_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[ConfigurationBundleVersionSummary], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_configuration_bundle_version_summary_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ConfigurationBundleVersionSummary]: - result: list[ConfigurationBundleVersionSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ConfigurationBundleVersionSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListConfigurationBundleVersionsOutput: - """Dataclass for ListConfigurationBundleVersionsOutput structure.""" - - versions: list[ConfigurationBundleVersionSummary] - """The list of configuration bundle version summaries.""" - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, use this token when making another request in - the `nextToken` field to return the next batch of results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_CONFIGURATION_BUNDLE_VERSIONS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_configuration_bundle_version_summary_list( - serializer, - _SCHEMA_LIST_CONFIGURATION_BUNDLE_VERSIONS_OUTPUT.members["versions"], - self.versions, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_CONFIGURATION_BUNDLE_VERSIONS_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["versions"] = ( - _deserialize_configuration_bundle_version_summary_list( - de, - _SCHEMA_LIST_CONFIGURATION_BUNDLE_VERSIONS_OUTPUT.members[ - "versions" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_CONFIGURATION_BUNDLE_VERSIONS_OUTPUT.members[ - "nextToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_CONFIGURATION_BUNDLE_VERSIONS_OUTPUT, consumer=_consumer - ) - if "versions" not in kwargs: - kwargs["versions"] = [] - return kwargs - - -LIST_CONFIGURATION_BUNDLE_VERSIONS = APIOperation( - input=ListConfigurationBundleVersionsInput, - output=ListConfigurationBundleVersionsOutput, - schema=_SCHEMA_LIST_CONFIGURATION_BUNDLE_VERSIONS, - input_schema=_SCHEMA_LIST_CONFIGURATION_BUNDLE_VERSIONS_INPUT, - output_schema=_SCHEMA_LIST_CONFIGURATION_BUNDLE_VERSIONS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateConfigurationBundleInput: - """Dataclass for UpdateConfigurationBundleInput structure.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If you don't specify this field, a - value is randomly generated for you. If this token matches a previous - request, the service ignores the request, but doesn't return an error. - For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - bundle_id: str | None = None - """The unique identifier of the configuration bundle to update.""" - - bundle_name: str | None = None - """The updated name for the configuration bundle.""" - - description: str | None = field(repr=False, default=None) - """The updated description for the configuration bundle.""" - - components: dict[str, ComponentConfiguration] | None = None - """ - The updated component configurations. Creates a new version of the - bundle. - """ - - parent_version_ids: list[str] | None = None - """ - A list of parent version identifiers for lineage tracking. Regular - commits have a single parent. Merge commits have two parents: the target - branch parent and the source branch parent. If the branch already - exists, the first parent must be the latest version on that branch. - """ - - branch_name: str | None = None - """ - The branch name for this version. If not specified, inherits the - parent's branch or defaults to `mainline`. - """ - - commit_message: str | None = None - """A commit message describing the changes in this version.""" - - created_by: VersionCreatedBySource | None = None - """ - The source that created this version, including the source name and - optional ARN. - """ - - kms_key_arn: str | None = None - """ - Optional KMS key ARN for encrypting component configurations. If - provided, components will be encrypted with this key. If the bundle - already has a KMS key, this rotates to the new key. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_CONFIGURATION_BUNDLE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.client_token is not None: - serializer.write_string( - _SCHEMA_UPDATE_CONFIGURATION_BUNDLE_INPUT.members["clientToken"], - self.client_token, - ) - - if self.bundle_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_CONFIGURATION_BUNDLE_INPUT.members["bundleId"], - self.bundle_id, - ) - - if self.bundle_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_CONFIGURATION_BUNDLE_INPUT.members["bundleName"], - self.bundle_name, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_CONFIGURATION_BUNDLE_INPUT.members["description"], - self.description, - ) - - if self.components is not None: - _serialize_component_configuration_map( - serializer, - _SCHEMA_UPDATE_CONFIGURATION_BUNDLE_INPUT.members["components"], - self.components, - ) - - if self.parent_version_ids is not None: - _serialize_configuration_bundle_version_list( - serializer, - _SCHEMA_UPDATE_CONFIGURATION_BUNDLE_INPUT.members["parentVersionIds"], - self.parent_version_ids, - ) - - if self.branch_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_CONFIGURATION_BUNDLE_INPUT.members["branchName"], - self.branch_name, - ) - - if self.commit_message is not None: - serializer.write_string( - _SCHEMA_UPDATE_CONFIGURATION_BUNDLE_INPUT.members["commitMessage"], - self.commit_message, - ) - - if self.created_by is not None: - serializer.write_struct( - _SCHEMA_UPDATE_CONFIGURATION_BUNDLE_INPUT.members["createdBy"], - self.created_by, - ) - - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_CONFIGURATION_BUNDLE_INPUT.members["kmsKeyArn"], - self.kms_key_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["client_token"] = de.read_string( - _SCHEMA_UPDATE_CONFIGURATION_BUNDLE_INPUT.members["clientToken"] - ) - - case 1: - kwargs["bundle_id"] = de.read_string( - _SCHEMA_UPDATE_CONFIGURATION_BUNDLE_INPUT.members["bundleId"] - ) - - case 2: - kwargs["bundle_name"] = de.read_string( - _SCHEMA_UPDATE_CONFIGURATION_BUNDLE_INPUT.members["bundleName"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_CONFIGURATION_BUNDLE_INPUT.members["description"] - ) - - case 4: - kwargs["components"] = _deserialize_component_configuration_map( - de, - _SCHEMA_UPDATE_CONFIGURATION_BUNDLE_INPUT.members["components"], - ) - - case 5: - kwargs["parent_version_ids"] = ( - _deserialize_configuration_bundle_version_list( - de, - _SCHEMA_UPDATE_CONFIGURATION_BUNDLE_INPUT.members[ - "parentVersionIds" - ], - ) - ) - - case 6: - kwargs["branch_name"] = de.read_string( - _SCHEMA_UPDATE_CONFIGURATION_BUNDLE_INPUT.members["branchName"] - ) - - case 7: - kwargs["commit_message"] = de.read_string( - _SCHEMA_UPDATE_CONFIGURATION_BUNDLE_INPUT.members[ - "commitMessage" - ] - ) - - case 8: - kwargs["created_by"] = VersionCreatedBySource.deserialize(de) - - case 9: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_UPDATE_CONFIGURATION_BUNDLE_INPUT.members["kmsKeyArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_CONFIGURATION_BUNDLE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateConfigurationBundleOutput: - """Dataclass for UpdateConfigurationBundleOutput structure.""" - - bundle_arn: str - """The Amazon Resource Name (ARN) of the updated configuration bundle.""" - - bundle_id: str - """The unique identifier of the updated configuration bundle.""" - - version_id: str - """The new version identifier created by this update.""" - - updated_at: datetime - """The timestamp when the configuration bundle was updated.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_CONFIGURATION_BUNDLE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_UPDATE_CONFIGURATION_BUNDLE_OUTPUT.members["bundleArn"], - self.bundle_arn, - ) - serializer.write_string( - _SCHEMA_UPDATE_CONFIGURATION_BUNDLE_OUTPUT.members["bundleId"], - self.bundle_id, - ) - serializer.write_string( - _SCHEMA_UPDATE_CONFIGURATION_BUNDLE_OUTPUT.members["versionId"], - self.version_id, - ) - serializer.write_timestamp( - _SCHEMA_UPDATE_CONFIGURATION_BUNDLE_OUTPUT.members["updatedAt"], - self.updated_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bundle_arn"] = de.read_string( - _SCHEMA_UPDATE_CONFIGURATION_BUNDLE_OUTPUT.members["bundleArn"] - ) - - case 1: - kwargs["bundle_id"] = de.read_string( - _SCHEMA_UPDATE_CONFIGURATION_BUNDLE_OUTPUT.members["bundleId"] - ) - - case 2: - kwargs["version_id"] = de.read_string( - _SCHEMA_UPDATE_CONFIGURATION_BUNDLE_OUTPUT.members["versionId"] - ) - - case 3: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_UPDATE_CONFIGURATION_BUNDLE_OUTPUT.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_CONFIGURATION_BUNDLE_OUTPUT, consumer=_consumer - ) - if "bundle_arn" not in kwargs: - kwargs["bundle_arn"] = "" - if "bundle_id" not in kwargs: - kwargs["bundle_id"] = "" - if "version_id" not in kwargs: - kwargs["version_id"] = "" - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -UPDATE_CONFIGURATION_BUNDLE = APIOperation( - input=UpdateConfigurationBundleInput, - output=UpdateConfigurationBundleOutput, - schema=_SCHEMA_UPDATE_CONFIGURATION_BUNDLE, - input_schema=_SCHEMA_UPDATE_CONFIGURATION_BUNDLE_INPUT, - output_schema=_SCHEMA_UPDATE_CONFIGURATION_BUNDLE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ConsentPortalIdpConfig: - """ - The identity provider configuration used to authenticate end users to - the consent portal. - """ - - credential_provider_arn: str - """ - The Amazon Resource Name (ARN) of the OAuth2 credential provider used to - authenticate end users to the consent portal. - """ - - scopes: list[str] - """ - The OAuth2 scopes that the consent portal requests when authenticating - end users. - """ - - audience: str | None = None - """ - The audience value that the consent portal includes when requesting - tokens from the identity provider. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONSENT_PORTAL_IDP_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CONSENT_PORTAL_IDP_CONFIG.members["credentialProviderArn"], - self.credential_provider_arn, - ) - _serialize_allowed_scopes_type( - serializer, _SCHEMA_CONSENT_PORTAL_IDP_CONFIG.members["scopes"], self.scopes - ) - if self.audience is not None: - serializer.write_string( - _SCHEMA_CONSENT_PORTAL_IDP_CONFIG.members["audience"], self.audience - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["credential_provider_arn"] = de.read_string( - _SCHEMA_CONSENT_PORTAL_IDP_CONFIG.members[ - "credentialProviderArn" - ] - ) - - case 1: - kwargs["scopes"] = _deserialize_allowed_scopes_type( - de, _SCHEMA_CONSENT_PORTAL_IDP_CONFIG.members["scopes"] - ) - - case 2: - kwargs["audience"] = de.read_string( - _SCHEMA_CONSENT_PORTAL_IDP_CONFIG.members["audience"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONSENT_PORTAL_IDP_CONFIG, consumer=_consumer) - if "credential_provider_arn" not in kwargs: - kwargs["credential_provider_arn"] = "" - if "scopes" not in kwargs: - kwargs["scopes"] = [] - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(credential_provider_arn="", scopes=[]) - - -class ConsentPortalSourceType(UnknownEnumMixin, StrEnum): - """ - The type of a consent portal source. Currently, we only support type - `agentcore-gateway`. - """ - - AGENTCORE_GATEWAY = "agentcore-gateway" - - -@dataclass(kw_only=True) -class ConsentPortalSource: - """A resource served by the consent portal.""" - - identifier: str - """ - The identifier of the source resource. For an `agentcore-gateway` - source, this is the gateway ID or its Amazon Resource Name (ARN). - """ - - type: str - """The type of the source resource.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONSENT_PORTAL_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CONSENT_PORTAL_SOURCE.members["identifier"], self.identifier - ) - serializer.write_string( - _SCHEMA_CONSENT_PORTAL_SOURCE.members["type"], self.type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["identifier"] = de.read_string( - _SCHEMA_CONSENT_PORTAL_SOURCE.members["identifier"] - ) - - case 1: - kwargs["type"] = ConsentPortalSourceType( - de.read_string(_SCHEMA_CONSENT_PORTAL_SOURCE.members["type"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONSENT_PORTAL_SOURCE, consumer=_consumer) - if "identifier" not in kwargs: - kwargs["identifier"] = "" - if "type" not in kwargs: - kwargs["type"] = ConsentPortalSourceType._corrected("") - return kwargs - - -def _serialize_consent_portal_sources( - serializer: ShapeSerializer, schema: Schema, value: list[ConsentPortalSource] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_consent_portal_sources( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ConsentPortalSource]: - result: list[ConsentPortalSource] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ConsentPortalSource.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class ConsentPortalStatus(UnknownEnumMixin, StrEnum): - """The lifecycle status of a consent portal.""" - - CREATING = "CREATING" - ACTIVE = "ACTIVE" - UPDATING = "UPDATING" - UPDATE_FAILED = "UPDATE_FAILED" - DELETING = "DELETING" - FAILED = "FAILED" - - -@dataclass(kw_only=True) -class CreateConsentPortalInput: - """Dataclass for CreateConsentPortalInput structure.""" - - execution_role_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the IAM role that the consent portal - assumes to access the resources defined in its sources. - """ - - idp_config: ConsentPortalIdpConfig | None = None - """ - The identity provider configuration that the consent portal uses to - authenticate end users. - """ - - name: str | None = None - """ - The name of the consent portal. The name must be unique within your - account. - """ - - sources: list[ConsentPortalSource] | None = None - """ - The resources served by the consent portal. Currently, we only support - type `agentcore-gateway`. - """ - - description: str | None = None - """The description of the consent portal.""" - - tags: dict[str, str] | None = None - """ - A map of tag keys and values to assign to the consent portal. Tags - enable you to categorize your resources in different ways, for example, - by purpose, owner, or environment. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_CONSENT_PORTAL_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.execution_role_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_CONSENT_PORTAL_INPUT.members["executionRoleArn"], - self.execution_role_arn, - ) - - if self.idp_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_CONSENT_PORTAL_INPUT.members["idpConfig"], - self.idp_config, - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_CONSENT_PORTAL_INPUT.members["name"], self.name - ) - - if self.sources is not None: - _serialize_consent_portal_sources( - serializer, - _SCHEMA_CREATE_CONSENT_PORTAL_INPUT.members["sources"], - self.sources, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_CONSENT_PORTAL_INPUT.members["description"], - self.description, - ) - - if self.tags is not None: - _serialize_tags_map( - serializer, - _SCHEMA_CREATE_CONSENT_PORTAL_INPUT.members["tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["execution_role_arn"] = de.read_string( - _SCHEMA_CREATE_CONSENT_PORTAL_INPUT.members["executionRoleArn"] - ) - - case 1: - kwargs["idp_config"] = ConsentPortalIdpConfig.deserialize(de) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_CONSENT_PORTAL_INPUT.members["name"] - ) - - case 3: - kwargs["sources"] = _deserialize_consent_portal_sources( - de, _SCHEMA_CREATE_CONSENT_PORTAL_INPUT.members["sources"] - ) - - case 4: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_CONSENT_PORTAL_INPUT.members["description"] - ) - - case 5: - kwargs["tags"] = _deserialize_tags_map( - de, _SCHEMA_CREATE_CONSENT_PORTAL_INPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_CONSENT_PORTAL_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CreateConsentPortalOutput: - """Dataclass for CreateConsentPortalOutput structure.""" - - sources: list[ConsentPortalSource] - """The resources served by the consent portal.""" - - consent_portal_arn: str - """The Amazon Resource Name (ARN) of the consent portal.""" - - consent_portal_id: str - """The unique identifier of the consent portal.""" - - created_at: datetime - """The timestamp for when the consent portal was created.""" - - execution_role_arn: str - """ - The Amazon Resource Name (ARN) of the IAM role that the consent portal - assumes to access the resources defined in its sources. - """ - - idp_config: ConsentPortalIdpConfig - """ - The identity provider configuration that the consent portal uses to - authenticate end users. - """ - - name: str - """The name of the consent portal.""" - - status: str - """The current status of the consent portal.""" - - updated_at: datetime - """The timestamp for when the consent portal was last updated.""" - - description: str | None = None - """The description of the consent portal.""" - - portal_url: str | None = None - """The URL used to access the consent portal.""" - - status_reason: str | None = None - """ - A message that provides additional information about the current status - of the consent portal. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_CONSENT_PORTAL_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_consent_portal_sources( - serializer, - _SCHEMA_CREATE_CONSENT_PORTAL_OUTPUT.members["sources"], - self.sources, - ) - serializer.write_string( - _SCHEMA_CREATE_CONSENT_PORTAL_OUTPUT.members["consentPortalArn"], - self.consent_portal_arn, - ) - serializer.write_string( - _SCHEMA_CREATE_CONSENT_PORTAL_OUTPUT.members["consentPortalId"], - self.consent_portal_id, - ) - serializer.write_timestamp( - _SCHEMA_CREATE_CONSENT_PORTAL_OUTPUT.members["createdAt"], self.created_at - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_CONSENT_PORTAL_OUTPUT.members["description"], - self.description, - ) - - serializer.write_string( - _SCHEMA_CREATE_CONSENT_PORTAL_OUTPUT.members["executionRoleArn"], - self.execution_role_arn, - ) - serializer.write_struct( - _SCHEMA_CREATE_CONSENT_PORTAL_OUTPUT.members["idpConfig"], self.idp_config - ) - serializer.write_string( - _SCHEMA_CREATE_CONSENT_PORTAL_OUTPUT.members["name"], self.name - ) - if self.portal_url is not None: - serializer.write_string( - _SCHEMA_CREATE_CONSENT_PORTAL_OUTPUT.members["portalUrl"], - self.portal_url, - ) - - serializer.write_string( - _SCHEMA_CREATE_CONSENT_PORTAL_OUTPUT.members["status"], self.status - ) - if self.status_reason is not None: - serializer.write_string( - _SCHEMA_CREATE_CONSENT_PORTAL_OUTPUT.members["statusReason"], - self.status_reason, - ) - - serializer.write_timestamp( - _SCHEMA_CREATE_CONSENT_PORTAL_OUTPUT.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["sources"] = _deserialize_consent_portal_sources( - de, _SCHEMA_CREATE_CONSENT_PORTAL_OUTPUT.members["sources"] - ) - - case 1: - kwargs["consent_portal_arn"] = de.read_string( - _SCHEMA_CREATE_CONSENT_PORTAL_OUTPUT.members["consentPortalArn"] - ) - - case 2: - kwargs["consent_portal_id"] = de.read_string( - _SCHEMA_CREATE_CONSENT_PORTAL_OUTPUT.members["consentPortalId"] - ) - - case 3: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_CREATE_CONSENT_PORTAL_OUTPUT.members["createdAt"] - ) - - case 4: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_CONSENT_PORTAL_OUTPUT.members["description"] - ) - - case 5: - kwargs["execution_role_arn"] = de.read_string( - _SCHEMA_CREATE_CONSENT_PORTAL_OUTPUT.members["executionRoleArn"] - ) - - case 6: - kwargs["idp_config"] = ConsentPortalIdpConfig.deserialize(de) - - case 7: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_CONSENT_PORTAL_OUTPUT.members["name"] - ) - - case 8: - kwargs["portal_url"] = de.read_string( - _SCHEMA_CREATE_CONSENT_PORTAL_OUTPUT.members["portalUrl"] - ) - - case 9: - kwargs["status"] = ConsentPortalStatus( - de.read_string( - _SCHEMA_CREATE_CONSENT_PORTAL_OUTPUT.members["status"] - ) - ) - - case 10: - kwargs["status_reason"] = de.read_string( - _SCHEMA_CREATE_CONSENT_PORTAL_OUTPUT.members["statusReason"] - ) - - case 11: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_CREATE_CONSENT_PORTAL_OUTPUT.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_CONSENT_PORTAL_OUTPUT, consumer=_consumer - ) - if "sources" not in kwargs: - kwargs["sources"] = [] - if "consent_portal_arn" not in kwargs: - kwargs["consent_portal_arn"] = "" - if "consent_portal_id" not in kwargs: - kwargs["consent_portal_id"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "execution_role_arn" not in kwargs: - kwargs["execution_role_arn"] = "" - if "idp_config" not in kwargs: - kwargs["idp_config"] = ConsentPortalIdpConfig._smithy_default() - if "name" not in kwargs: - kwargs["name"] = "" - if "status" not in kwargs: - kwargs["status"] = ConsentPortalStatus._corrected("") - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -CREATE_CONSENT_PORTAL = APIOperation( - input=CreateConsentPortalInput, - output=CreateConsentPortalOutput, - schema=_SCHEMA_CREATE_CONSENT_PORTAL, - input_schema=_SCHEMA_CREATE_CONSENT_PORTAL_INPUT, - output_schema=_SCHEMA_CREATE_CONSENT_PORTAL_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#UnauthorizedException" - ): UnauthorizedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteConsentPortalInput: - """Dataclass for DeleteConsentPortalInput structure.""" - - consent_portal_identifier: str | None = None - """ - The identifier of the consent portal. You can specify either the consent - portal ID or its Amazon Resource Name (ARN). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_CONSENT_PORTAL_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.consent_portal_identifier is not None: - serializer.write_string( - _SCHEMA_DELETE_CONSENT_PORTAL_INPUT.members["consentPortalIdentifier"], - self.consent_portal_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["consent_portal_identifier"] = de.read_string( - _SCHEMA_DELETE_CONSENT_PORTAL_INPUT.members[ - "consentPortalIdentifier" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_CONSENT_PORTAL_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteConsentPortalOutput: - """Dataclass for DeleteConsentPortalOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_CONSENT_PORTAL_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_CONSENT_PORTAL_OUTPUT, consumer=_consumer - ) - return kwargs - - -DELETE_CONSENT_PORTAL = APIOperation( - input=DeleteConsentPortalInput, - output=DeleteConsentPortalOutput, - schema=_SCHEMA_DELETE_CONSENT_PORTAL, - input_schema=_SCHEMA_DELETE_CONSENT_PORTAL_INPUT, - output_schema=_SCHEMA_DELETE_CONSENT_PORTAL_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#UnauthorizedException" - ): UnauthorizedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetConsentPortalInput: - """Dataclass for GetConsentPortalInput structure.""" - - consent_portal_identifier: str | None = None - """ - The identifier of the consent portal. You can specify either the consent - portal ID or its Amazon Resource Name (ARN). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_CONSENT_PORTAL_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.consent_portal_identifier is not None: - serializer.write_string( - _SCHEMA_GET_CONSENT_PORTAL_INPUT.members["consentPortalIdentifier"], - self.consent_portal_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["consent_portal_identifier"] = de.read_string( - _SCHEMA_GET_CONSENT_PORTAL_INPUT.members[ - "consentPortalIdentifier" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_CONSENT_PORTAL_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetConsentPortalOutput: - """Dataclass for GetConsentPortalOutput structure.""" - - sources: list[ConsentPortalSource] - """The resources served by the consent portal.""" - - consent_portal_arn: str - """The Amazon Resource Name (ARN) of the consent portal.""" - - consent_portal_id: str - """The unique identifier of the consent portal.""" - - created_at: datetime - """The timestamp for when the consent portal was created.""" - - execution_role_arn: str - """ - The Amazon Resource Name (ARN) of the IAM role that the consent portal - assumes to access the resources defined in its sources. - """ - - idp_config: ConsentPortalIdpConfig - """ - The identity provider configuration that the consent portal uses to - authenticate end users. - """ - - name: str - """The name of the consent portal.""" - - status: str - """The current status of the consent portal.""" - - updated_at: datetime - """The timestamp for when the consent portal was last updated.""" - - description: str | None = None - """The description of the consent portal.""" - - portal_url: str | None = None - """The URL used to access the consent portal.""" - - status_reason: str | None = None - """ - A message that provides additional information about the current status - of the consent portal. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_CONSENT_PORTAL_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_consent_portal_sources( - serializer, - _SCHEMA_GET_CONSENT_PORTAL_OUTPUT.members["sources"], - self.sources, - ) - serializer.write_string( - _SCHEMA_GET_CONSENT_PORTAL_OUTPUT.members["consentPortalArn"], - self.consent_portal_arn, - ) - serializer.write_string( - _SCHEMA_GET_CONSENT_PORTAL_OUTPUT.members["consentPortalId"], - self.consent_portal_id, - ) - serializer.write_timestamp( - _SCHEMA_GET_CONSENT_PORTAL_OUTPUT.members["createdAt"], self.created_at - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_CONSENT_PORTAL_OUTPUT.members["description"], - self.description, - ) - - serializer.write_string( - _SCHEMA_GET_CONSENT_PORTAL_OUTPUT.members["executionRoleArn"], - self.execution_role_arn, - ) - serializer.write_struct( - _SCHEMA_GET_CONSENT_PORTAL_OUTPUT.members["idpConfig"], self.idp_config - ) - serializer.write_string( - _SCHEMA_GET_CONSENT_PORTAL_OUTPUT.members["name"], self.name - ) - if self.portal_url is not None: - serializer.write_string( - _SCHEMA_GET_CONSENT_PORTAL_OUTPUT.members["portalUrl"], self.portal_url - ) - - serializer.write_string( - _SCHEMA_GET_CONSENT_PORTAL_OUTPUT.members["status"], self.status - ) - if self.status_reason is not None: - serializer.write_string( - _SCHEMA_GET_CONSENT_PORTAL_OUTPUT.members["statusReason"], - self.status_reason, - ) - - serializer.write_timestamp( - _SCHEMA_GET_CONSENT_PORTAL_OUTPUT.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["sources"] = _deserialize_consent_portal_sources( - de, _SCHEMA_GET_CONSENT_PORTAL_OUTPUT.members["sources"] - ) - - case 1: - kwargs["consent_portal_arn"] = de.read_string( - _SCHEMA_GET_CONSENT_PORTAL_OUTPUT.members["consentPortalArn"] - ) - - case 2: - kwargs["consent_portal_id"] = de.read_string( - _SCHEMA_GET_CONSENT_PORTAL_OUTPUT.members["consentPortalId"] - ) - - case 3: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_CONSENT_PORTAL_OUTPUT.members["createdAt"] - ) - - case 4: - kwargs["description"] = de.read_string( - _SCHEMA_GET_CONSENT_PORTAL_OUTPUT.members["description"] - ) - - case 5: - kwargs["execution_role_arn"] = de.read_string( - _SCHEMA_GET_CONSENT_PORTAL_OUTPUT.members["executionRoleArn"] - ) - - case 6: - kwargs["idp_config"] = ConsentPortalIdpConfig.deserialize(de) - - case 7: - kwargs["name"] = de.read_string( - _SCHEMA_GET_CONSENT_PORTAL_OUTPUT.members["name"] - ) - - case 8: - kwargs["portal_url"] = de.read_string( - _SCHEMA_GET_CONSENT_PORTAL_OUTPUT.members["portalUrl"] - ) - - case 9: - kwargs["status"] = ConsentPortalStatus( - de.read_string( - _SCHEMA_GET_CONSENT_PORTAL_OUTPUT.members["status"] - ) - ) - - case 10: - kwargs["status_reason"] = de.read_string( - _SCHEMA_GET_CONSENT_PORTAL_OUTPUT.members["statusReason"] - ) - - case 11: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_GET_CONSENT_PORTAL_OUTPUT.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_CONSENT_PORTAL_OUTPUT, consumer=_consumer) - if "sources" not in kwargs: - kwargs["sources"] = [] - if "consent_portal_arn" not in kwargs: - kwargs["consent_portal_arn"] = "" - if "consent_portal_id" not in kwargs: - kwargs["consent_portal_id"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "execution_role_arn" not in kwargs: - kwargs["execution_role_arn"] = "" - if "idp_config" not in kwargs: - kwargs["idp_config"] = ConsentPortalIdpConfig._smithy_default() - if "name" not in kwargs: - kwargs["name"] = "" - if "status" not in kwargs: - kwargs["status"] = ConsentPortalStatus._corrected("") - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -GET_CONSENT_PORTAL = APIOperation( - input=GetConsentPortalInput, - output=GetConsentPortalOutput, - schema=_SCHEMA_GET_CONSENT_PORTAL, - input_schema=_SCHEMA_GET_CONSENT_PORTAL_INPUT, - output_schema=_SCHEMA_GET_CONSENT_PORTAL_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#UnauthorizedException" - ): UnauthorizedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListConsentPortalsInput: - """Dataclass for ListConsentPortalsInput structure.""" - - max_results: int | None = None - """The maximum number of consent portals to return in a single call.""" - - next_token: str | None = None - """ - A token to retrieve the next page of results. Use the value returned in - a previous response to request the next page. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_CONSENT_PORTALS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_CONSENT_PORTALS_INPUT.members["maxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_CONSENT_PORTALS_INPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_CONSENT_PORTALS_INPUT.members["maxResults"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_CONSENT_PORTALS_INPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_CONSENT_PORTALS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ConsentPortalSummary: - """Summary information about a consent portal.""" - - sources: list[ConsentPortalSource] - """The resources served by the consent portal.""" - - consent_portal_arn: str - """The Amazon Resource Name (ARN) of the consent portal.""" - - consent_portal_id: str - """The unique identifier of the consent portal.""" - - created_at: datetime - """The timestamp for when the consent portal was created.""" - - name: str - """The name of the consent portal.""" - - status: str - """The current status of the consent portal.""" - - updated_at: datetime - """The timestamp for when the consent portal was last updated.""" - - description: str | None = None - """The description of the consent portal.""" - - portal_url: str | None = None - """The URL used to access the consent portal.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONSENT_PORTAL_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_consent_portal_sources( - serializer, _SCHEMA_CONSENT_PORTAL_SUMMARY.members["sources"], self.sources - ) - serializer.write_string( - _SCHEMA_CONSENT_PORTAL_SUMMARY.members["consentPortalArn"], - self.consent_portal_arn, - ) - serializer.write_string( - _SCHEMA_CONSENT_PORTAL_SUMMARY.members["consentPortalId"], - self.consent_portal_id, - ) - serializer.write_timestamp( - _SCHEMA_CONSENT_PORTAL_SUMMARY.members["createdAt"], self.created_at - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_CONSENT_PORTAL_SUMMARY.members["description"], self.description - ) - - serializer.write_string( - _SCHEMA_CONSENT_PORTAL_SUMMARY.members["name"], self.name - ) - if self.portal_url is not None: - serializer.write_string( - _SCHEMA_CONSENT_PORTAL_SUMMARY.members["portalUrl"], self.portal_url - ) - - serializer.write_string( - _SCHEMA_CONSENT_PORTAL_SUMMARY.members["status"], self.status - ) - serializer.write_timestamp( - _SCHEMA_CONSENT_PORTAL_SUMMARY.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["sources"] = _deserialize_consent_portal_sources( - de, _SCHEMA_CONSENT_PORTAL_SUMMARY.members["sources"] - ) - - case 1: - kwargs["consent_portal_arn"] = de.read_string( - _SCHEMA_CONSENT_PORTAL_SUMMARY.members["consentPortalArn"] - ) - - case 2: - kwargs["consent_portal_id"] = de.read_string( - _SCHEMA_CONSENT_PORTAL_SUMMARY.members["consentPortalId"] - ) - - case 3: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_CONSENT_PORTAL_SUMMARY.members["createdAt"] - ) - - case 4: - kwargs["description"] = de.read_string( - _SCHEMA_CONSENT_PORTAL_SUMMARY.members["description"] - ) - - case 5: - kwargs["name"] = de.read_string( - _SCHEMA_CONSENT_PORTAL_SUMMARY.members["name"] - ) - - case 6: - kwargs["portal_url"] = de.read_string( - _SCHEMA_CONSENT_PORTAL_SUMMARY.members["portalUrl"] - ) - - case 7: - kwargs["status"] = ConsentPortalStatus( - de.read_string(_SCHEMA_CONSENT_PORTAL_SUMMARY.members["status"]) - ) - - case 8: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_CONSENT_PORTAL_SUMMARY.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONSENT_PORTAL_SUMMARY, consumer=_consumer) - if "sources" not in kwargs: - kwargs["sources"] = [] - if "consent_portal_arn" not in kwargs: - kwargs["consent_portal_arn"] = "" - if "consent_portal_id" not in kwargs: - kwargs["consent_portal_id"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "name" not in kwargs: - kwargs["name"] = "" - if "status" not in kwargs: - kwargs["status"] = ConsentPortalStatus._corrected("") - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_consent_portal_summaries( - serializer: ShapeSerializer, schema: Schema, value: list[ConsentPortalSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_consent_portal_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ConsentPortalSummary]: - result: list[ConsentPortalSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ConsentPortalSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListConsentPortalsOutput: - """Dataclass for ListConsentPortalsOutput structure.""" - - consent_portals: list[ConsentPortalSummary] - """The list of consent portals.""" - - next_token: str | None = None - """ - The token to use in a subsequent request to retrieve the next page of - results. This value is null when there are no more results to return. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_CONSENT_PORTALS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_consent_portal_summaries( - serializer, - _SCHEMA_LIST_CONSENT_PORTALS_OUTPUT.members["consentPortals"], - self.consent_portals, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_CONSENT_PORTALS_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["consent_portals"] = _deserialize_consent_portal_summaries( - de, - _SCHEMA_LIST_CONSENT_PORTALS_OUTPUT.members["consentPortals"], - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_CONSENT_PORTALS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_CONSENT_PORTALS_OUTPUT, consumer=_consumer - ) - if "consent_portals" not in kwargs: - kwargs["consent_portals"] = [] - return kwargs - - -LIST_CONSENT_PORTALS = APIOperation( - input=ListConsentPortalsInput, - output=ListConsentPortalsOutput, - schema=_SCHEMA_LIST_CONSENT_PORTALS, - input_schema=_SCHEMA_LIST_CONSENT_PORTALS_INPUT, - output_schema=_SCHEMA_LIST_CONSENT_PORTALS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#UnauthorizedException" - ): UnauthorizedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateConsentPortalInput: - """Dataclass for UpdateConsentPortalInput structure.""" - - consent_portal_identifier: str | None = None - """ - The identifier of the consent portal. You can specify either the consent - portal ID or its Amazon Resource Name (ARN). - """ - - execution_role_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the IAM role that the consent portal - assumes to access the resources defined in its sources. - """ - - idp_config: ConsentPortalIdpConfig | None = None - """ - The identity provider configuration that the consent portal uses to - authenticate end users. - """ - - description: str | None = None - """The description of the consent portal.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_CONSENT_PORTAL_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.consent_portal_identifier is not None: - serializer.write_string( - _SCHEMA_UPDATE_CONSENT_PORTAL_INPUT.members["consentPortalIdentifier"], - self.consent_portal_identifier, - ) - - if self.execution_role_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_CONSENT_PORTAL_INPUT.members["executionRoleArn"], - self.execution_role_arn, - ) - - if self.idp_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_CONSENT_PORTAL_INPUT.members["idpConfig"], - self.idp_config, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_CONSENT_PORTAL_INPUT.members["description"], - self.description, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["consent_portal_identifier"] = de.read_string( - _SCHEMA_UPDATE_CONSENT_PORTAL_INPUT.members[ - "consentPortalIdentifier" - ] - ) - - case 1: - kwargs["execution_role_arn"] = de.read_string( - _SCHEMA_UPDATE_CONSENT_PORTAL_INPUT.members["executionRoleArn"] - ) - - case 2: - kwargs["idp_config"] = ConsentPortalIdpConfig.deserialize(de) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_CONSENT_PORTAL_INPUT.members["description"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_CONSENT_PORTAL_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateConsentPortalOutput: - """Dataclass for UpdateConsentPortalOutput structure.""" - - sources: list[ConsentPortalSource] - """The resources served by the consent portal.""" - - consent_portal_arn: str - """The Amazon Resource Name (ARN) of the consent portal.""" - - consent_portal_id: str - """The unique identifier of the consent portal.""" - - created_at: datetime - """The timestamp for when the consent portal was created.""" - - execution_role_arn: str - """ - The Amazon Resource Name (ARN) of the IAM role that the consent portal - assumes to access the resources defined in its sources. - """ - - idp_config: ConsentPortalIdpConfig - """ - The identity provider configuration that the consent portal uses to - authenticate end users. - """ - - name: str - """The name of the consent portal.""" - - status: str - """The current status of the consent portal.""" - - updated_at: datetime - """The timestamp for when the consent portal was last updated.""" - - description: str | None = None - """The description of the consent portal.""" - - portal_url: str | None = None - """The URL used to access the consent portal.""" - - status_reason: str | None = None - """ - A message that provides additional information about the current status - of the consent portal. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_CONSENT_PORTAL_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_consent_portal_sources( - serializer, - _SCHEMA_UPDATE_CONSENT_PORTAL_OUTPUT.members["sources"], - self.sources, - ) - serializer.write_string( - _SCHEMA_UPDATE_CONSENT_PORTAL_OUTPUT.members["consentPortalArn"], - self.consent_portal_arn, - ) - serializer.write_string( - _SCHEMA_UPDATE_CONSENT_PORTAL_OUTPUT.members["consentPortalId"], - self.consent_portal_id, - ) - serializer.write_timestamp( - _SCHEMA_UPDATE_CONSENT_PORTAL_OUTPUT.members["createdAt"], self.created_at - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_CONSENT_PORTAL_OUTPUT.members["description"], - self.description, - ) - - serializer.write_string( - _SCHEMA_UPDATE_CONSENT_PORTAL_OUTPUT.members["executionRoleArn"], - self.execution_role_arn, - ) - serializer.write_struct( - _SCHEMA_UPDATE_CONSENT_PORTAL_OUTPUT.members["idpConfig"], self.idp_config - ) - serializer.write_string( - _SCHEMA_UPDATE_CONSENT_PORTAL_OUTPUT.members["name"], self.name - ) - if self.portal_url is not None: - serializer.write_string( - _SCHEMA_UPDATE_CONSENT_PORTAL_OUTPUT.members["portalUrl"], - self.portal_url, - ) - - serializer.write_string( - _SCHEMA_UPDATE_CONSENT_PORTAL_OUTPUT.members["status"], self.status - ) - if self.status_reason is not None: - serializer.write_string( - _SCHEMA_UPDATE_CONSENT_PORTAL_OUTPUT.members["statusReason"], - self.status_reason, - ) - - serializer.write_timestamp( - _SCHEMA_UPDATE_CONSENT_PORTAL_OUTPUT.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["sources"] = _deserialize_consent_portal_sources( - de, _SCHEMA_UPDATE_CONSENT_PORTAL_OUTPUT.members["sources"] - ) - - case 1: - kwargs["consent_portal_arn"] = de.read_string( - _SCHEMA_UPDATE_CONSENT_PORTAL_OUTPUT.members["consentPortalArn"] - ) - - case 2: - kwargs["consent_portal_id"] = de.read_string( - _SCHEMA_UPDATE_CONSENT_PORTAL_OUTPUT.members["consentPortalId"] - ) - - case 3: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_UPDATE_CONSENT_PORTAL_OUTPUT.members["createdAt"] - ) - - case 4: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_CONSENT_PORTAL_OUTPUT.members["description"] - ) - - case 5: - kwargs["execution_role_arn"] = de.read_string( - _SCHEMA_UPDATE_CONSENT_PORTAL_OUTPUT.members["executionRoleArn"] - ) - - case 6: - kwargs["idp_config"] = ConsentPortalIdpConfig.deserialize(de) - - case 7: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_CONSENT_PORTAL_OUTPUT.members["name"] - ) - - case 8: - kwargs["portal_url"] = de.read_string( - _SCHEMA_UPDATE_CONSENT_PORTAL_OUTPUT.members["portalUrl"] - ) - - case 9: - kwargs["status"] = ConsentPortalStatus( - de.read_string( - _SCHEMA_UPDATE_CONSENT_PORTAL_OUTPUT.members["status"] - ) - ) - - case 10: - kwargs["status_reason"] = de.read_string( - _SCHEMA_UPDATE_CONSENT_PORTAL_OUTPUT.members["statusReason"] - ) - - case 11: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_UPDATE_CONSENT_PORTAL_OUTPUT.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_CONSENT_PORTAL_OUTPUT, consumer=_consumer - ) - if "sources" not in kwargs: - kwargs["sources"] = [] - if "consent_portal_arn" not in kwargs: - kwargs["consent_portal_arn"] = "" - if "consent_portal_id" not in kwargs: - kwargs["consent_portal_id"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "execution_role_arn" not in kwargs: - kwargs["execution_role_arn"] = "" - if "idp_config" not in kwargs: - kwargs["idp_config"] = ConsentPortalIdpConfig._smithy_default() - if "name" not in kwargs: - kwargs["name"] = "" - if "status" not in kwargs: - kwargs["status"] = ConsentPortalStatus._corrected("") - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -UPDATE_CONSENT_PORTAL = APIOperation( - input=UpdateConsentPortalInput, - output=UpdateConsentPortalOutput, - schema=_SCHEMA_UPDATE_CONSENT_PORTAL, - input_schema=_SCHEMA_UPDATE_CONSENT_PORTAL_INPUT, - output_schema=_SCHEMA_UPDATE_CONSENT_PORTAL_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#UnauthorizedException" - ): UnauthorizedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class DatasetSchemaType(UnknownEnumMixin, StrEnum): - """ - Versioned schema type for dataset examples. Each value identifies both - the source format and the version of that format's schema. - """ - - AGENTCORE_EVALUATION_PREDEFINED_V1 = "AGENTCORE_EVALUATION_PREDEFINED_V1" - """ - AgentCore predefined evaluation schema, version 1. Dataset with - pre-written inputs per conversation turn. - """ - AGENTCORE_EVALUATION_SIMULATED_V1 = "AGENTCORE_EVALUATION_SIMULATED_V1" - """ - AgentCore simulated evaluation schema, version 1. Dataset for synthetic - data generation where each example is a scenario used to generate full - conversations. - """ - THIRD_PARTY_EVALUATION_V1 = "THIRD_PARTY_EVALUATION_V1" - """ - Third-party evaluation schema, version 1. Supports single-turn (string - input) and multi-turn (message list input) across third-party evaluation - frameworks. - """ - - -@dataclass(kw_only=True) -class CreateDatasetInput: - """Dataclass for CreateDatasetInput structure.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If you don't specify this field, a - value is randomly generated for you. If this token matches a previous - request, the service ignores the request, but doesn't return an error. - For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - dataset_name: str | None = None - """ - Human-readable name for the dataset. Must be unique within the account. - Immutable after creation. - """ - - description: str | None = None - """A description of the dataset.""" - - source: DataSourceType | None = None - """ - Source of initial examples. Provide either inline examples or an S3 URI - pointing to a JSONL file. - """ - - schema_type: str | None = None - """ - Versioned schema type governing the structure of examples. Immutable - after creation. - """ - - kms_key_arn: str | None = None - """ - Optional KMS key ARN for server-side encryption on service Amazon S3 - writes. - """ - - tags: dict[str, str] | None = None - """A map of tag keys and values to assign to the dataset.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_DATASET_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_DATASET_INPUT.members["clientToken"], self.client_token - ) - - if self.dataset_name is not None: - serializer.write_string( - _SCHEMA_CREATE_DATASET_INPUT.members["datasetName"], self.dataset_name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_DATASET_INPUT.members["description"], self.description - ) - - if self.source is not None: - serializer.write_struct( - _SCHEMA_CREATE_DATASET_INPUT.members["source"], self.source - ) - - if self.schema_type is not None: - serializer.write_string( - _SCHEMA_CREATE_DATASET_INPUT.members["schemaType"], self.schema_type - ) - - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_DATASET_INPUT.members["kmsKeyArn"], self.kms_key_arn - ) - - if self.tags is not None: - _serialize_tags_map( - serializer, _SCHEMA_CREATE_DATASET_INPUT.members["tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_DATASET_INPUT.members["clientToken"] - ) - - case 1: - kwargs["dataset_name"] = de.read_string( - _SCHEMA_CREATE_DATASET_INPUT.members["datasetName"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_DATASET_INPUT.members["description"] - ) - - case 3: - kwargs["source"] = _DataSourceTypeDeserializer().deserialize(de) - - case 4: - kwargs["schema_type"] = DatasetSchemaType( - de.read_string( - _SCHEMA_CREATE_DATASET_INPUT.members["schemaType"] - ) - ) - - case 5: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_CREATE_DATASET_INPUT.members["kmsKeyArn"] - ) - - case 6: - kwargs["tags"] = _deserialize_tags_map( - de, _SCHEMA_CREATE_DATASET_INPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_DATASET_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CreateDatasetOutput: - """Dataclass for CreateDatasetOutput structure.""" - - dataset_arn: str - """The Amazon Resource Name (ARN) of the created dataset.""" - - dataset_id: str - """The unique identifier of the created dataset.""" - - status: str - """ - Always CREATING immediately after this call. Poll `GetDataset` until - status transitions to ACTIVE or CREATE_FAILED. - """ - - created_at: datetime - """The timestamp when the dataset was created.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_DATASET_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_DATASET_OUTPUT.members["datasetArn"], self.dataset_arn - ) - serializer.write_string( - _SCHEMA_CREATE_DATASET_OUTPUT.members["datasetId"], self.dataset_id - ) - serializer.write_string( - _SCHEMA_CREATE_DATASET_OUTPUT.members["status"], self.status - ) - serializer.write_timestamp( - _SCHEMA_CREATE_DATASET_OUTPUT.members["createdAt"], self.created_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["dataset_arn"] = de.read_string( - _SCHEMA_CREATE_DATASET_OUTPUT.members["datasetArn"] - ) - - case 1: - kwargs["dataset_id"] = de.read_string( - _SCHEMA_CREATE_DATASET_OUTPUT.members["datasetId"] - ) - - case 2: - kwargs["status"] = DatasetStatus( - de.read_string(_SCHEMA_CREATE_DATASET_OUTPUT.members["status"]) - ) - - case 3: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_CREATE_DATASET_OUTPUT.members["createdAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_DATASET_OUTPUT, consumer=_consumer) - if "dataset_arn" not in kwargs: - kwargs["dataset_arn"] = "" - if "dataset_id" not in kwargs: - kwargs["dataset_id"] = "" - if "status" not in kwargs: - kwargs["status"] = DatasetStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -CREATE_DATASET = APIOperation( - input=CreateDatasetInput, - output=CreateDatasetOutput, - schema=_SCHEMA_CREATE_DATASET, - input_schema=_SCHEMA_CREATE_DATASET_INPUT, - output_schema=_SCHEMA_CREATE_DATASET_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class CreateDatasetVersionInput: - """Dataclass for CreateDatasetVersionInput structure.""" - - dataset_id: str | None = None - """The unique identifier of the dataset to publish a version for.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If you don't specify this field, a - value is randomly generated for you. If this token matches a previous - request, the service ignores the request, but doesn't return an error. - For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_DATASET_VERSION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.dataset_id is not None: - serializer.write_string( - _SCHEMA_CREATE_DATASET_VERSION_INPUT.members["datasetId"], - self.dataset_id, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_DATASET_VERSION_INPUT.members["clientToken"], - self.client_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["dataset_id"] = de.read_string( - _SCHEMA_CREATE_DATASET_VERSION_INPUT.members["datasetId"] - ) - - case 1: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_DATASET_VERSION_INPUT.members["clientToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_DATASET_VERSION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CreateDatasetVersionOutput: - """Dataclass for CreateDatasetVersionOutput structure.""" - - dataset_arn: str - """The Amazon Resource Name (ARN) of the dataset.""" - - dataset_id: str - """The unique identifier of the dataset.""" - - status: str - """ - Always UPDATING immediately after this call. Poll `GetDataset` until - status transitions to ACTIVE or UPDATE_FAILED. - """ - - dataset_version: str - """The version number being created.""" - - created_at: datetime - """The timestamp when the version creation was initiated.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_DATASET_VERSION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_DATASET_VERSION_OUTPUT.members["datasetArn"], - self.dataset_arn, - ) - serializer.write_string( - _SCHEMA_CREATE_DATASET_VERSION_OUTPUT.members["datasetId"], self.dataset_id - ) - serializer.write_string( - _SCHEMA_CREATE_DATASET_VERSION_OUTPUT.members["status"], self.status - ) - serializer.write_string( - _SCHEMA_CREATE_DATASET_VERSION_OUTPUT.members["datasetVersion"], - self.dataset_version, - ) - serializer.write_timestamp( - _SCHEMA_CREATE_DATASET_VERSION_OUTPUT.members["createdAt"], self.created_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["dataset_arn"] = de.read_string( - _SCHEMA_CREATE_DATASET_VERSION_OUTPUT.members["datasetArn"] - ) - - case 1: - kwargs["dataset_id"] = de.read_string( - _SCHEMA_CREATE_DATASET_VERSION_OUTPUT.members["datasetId"] - ) - - case 2: - kwargs["status"] = DatasetStatus( - de.read_string( - _SCHEMA_CREATE_DATASET_VERSION_OUTPUT.members["status"] - ) - ) - - case 3: - kwargs["dataset_version"] = de.read_string( - _SCHEMA_CREATE_DATASET_VERSION_OUTPUT.members["datasetVersion"] - ) - - case 4: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_CREATE_DATASET_VERSION_OUTPUT.members["createdAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_DATASET_VERSION_OUTPUT, consumer=_consumer - ) - if "dataset_arn" not in kwargs: - kwargs["dataset_arn"] = "" - if "dataset_id" not in kwargs: - kwargs["dataset_id"] = "" - if "status" not in kwargs: - kwargs["status"] = DatasetStatus._corrected("") - if "dataset_version" not in kwargs: - kwargs["dataset_version"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -CREATE_DATASET_VERSION = APIOperation( - input=CreateDatasetVersionInput, - output=CreateDatasetVersionOutput, - schema=_SCHEMA_CREATE_DATASET_VERSION, - input_schema=_SCHEMA_CREATE_DATASET_VERSION_INPUT, - output_schema=_SCHEMA_CREATE_DATASET_VERSION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteDatasetInput: - """Dataclass for DeleteDatasetInput structure.""" - - dataset_id: str | None = None - """The unique identifier of the dataset to delete.""" - - dataset_version: str | None = None - """ - Optional version to delete. If absent, deletes the entire dataset. If - provided, deletes only that specific version. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_DATASET_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.dataset_id is not None: - serializer.write_string( - _SCHEMA_DELETE_DATASET_INPUT.members["datasetId"], self.dataset_id - ) - - if self.dataset_version is not None: - serializer.write_string( - _SCHEMA_DELETE_DATASET_INPUT.members["datasetVersion"], - self.dataset_version, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["dataset_id"] = de.read_string( - _SCHEMA_DELETE_DATASET_INPUT.members["datasetId"] - ) - - case 1: - kwargs["dataset_version"] = de.read_string( - _SCHEMA_DELETE_DATASET_INPUT.members["datasetVersion"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_DATASET_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteDatasetOutput: - """Dataclass for DeleteDatasetOutput structure.""" - - dataset_arn: str - """The Amazon Resource Name (ARN) of the dataset.""" - - dataset_id: str - """The unique identifier of the dataset.""" - - status: str - """The current status of the dataset after the delete request.""" - - dataset_version: str - """The version that was deleted.""" - - updated_at: datetime - """The timestamp when the delete was initiated.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_DATASET_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DELETE_DATASET_OUTPUT.members["datasetArn"], self.dataset_arn - ) - serializer.write_string( - _SCHEMA_DELETE_DATASET_OUTPUT.members["datasetId"], self.dataset_id - ) - serializer.write_string( - _SCHEMA_DELETE_DATASET_OUTPUT.members["status"], self.status - ) - serializer.write_string( - _SCHEMA_DELETE_DATASET_OUTPUT.members["datasetVersion"], - self.dataset_version, - ) - serializer.write_timestamp( - _SCHEMA_DELETE_DATASET_OUTPUT.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["dataset_arn"] = de.read_string( - _SCHEMA_DELETE_DATASET_OUTPUT.members["datasetArn"] - ) - - case 1: - kwargs["dataset_id"] = de.read_string( - _SCHEMA_DELETE_DATASET_OUTPUT.members["datasetId"] - ) - - case 2: - kwargs["status"] = DatasetStatus( - de.read_string(_SCHEMA_DELETE_DATASET_OUTPUT.members["status"]) - ) - - case 3: - kwargs["dataset_version"] = de.read_string( - _SCHEMA_DELETE_DATASET_OUTPUT.members["datasetVersion"] - ) - - case 4: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_DELETE_DATASET_OUTPUT.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_DATASET_OUTPUT, consumer=_consumer) - if "dataset_arn" not in kwargs: - kwargs["dataset_arn"] = "" - if "dataset_id" not in kwargs: - kwargs["dataset_id"] = "" - if "status" not in kwargs: - kwargs["status"] = DatasetStatus._corrected("") - if "dataset_version" not in kwargs: - kwargs["dataset_version"] = "" - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -DELETE_DATASET = APIOperation( - input=DeleteDatasetInput, - output=DeleteDatasetOutput, - schema=_SCHEMA_DELETE_DATASET, - input_schema=_SCHEMA_DELETE_DATASET_INPUT, - output_schema=_SCHEMA_DELETE_DATASET_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteDatasetExamplesInput: - """Dataclass for DeleteDatasetExamplesInput structure.""" - - dataset_id: str | None = None - """The unique identifier of the dataset.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If you don't specify this field, a - value is randomly generated for you. If this token matches a previous - request, the service ignores the request, but doesn't return an error. - For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - example_ids: list[str] | None = None - """The IDs of the examples to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_DATASET_EXAMPLES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.dataset_id is not None: - serializer.write_string( - _SCHEMA_DELETE_DATASET_EXAMPLES_INPUT.members["datasetId"], - self.dataset_id, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_DELETE_DATASET_EXAMPLES_INPUT.members["clientToken"], - self.client_token, - ) - - if self.example_ids is not None: - _serialize_example_id_list( - serializer, - _SCHEMA_DELETE_DATASET_EXAMPLES_INPUT.members["exampleIds"], - self.example_ids, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["dataset_id"] = de.read_string( - _SCHEMA_DELETE_DATASET_EXAMPLES_INPUT.members["datasetId"] - ) - - case 1: - kwargs["client_token"] = de.read_string( - _SCHEMA_DELETE_DATASET_EXAMPLES_INPUT.members["clientToken"] - ) - - case 2: - kwargs["example_ids"] = _deserialize_example_id_list( - de, _SCHEMA_DELETE_DATASET_EXAMPLES_INPUT.members["exampleIds"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_DATASET_EXAMPLES_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteDatasetExamplesOutput: - """Dataclass for DeleteDatasetExamplesOutput structure.""" - - dataset_arn: str - """The Amazon Resource Name (ARN) of the dataset.""" - - dataset_id: str - """The unique identifier of the dataset.""" - - status: str - """The current status of the dataset.""" - - deleted_count: int - """The number of examples deleted.""" - - updated_at: datetime - """The timestamp when the examples were deleted.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_DATASET_EXAMPLES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DELETE_DATASET_EXAMPLES_OUTPUT.members["datasetArn"], - self.dataset_arn, - ) - serializer.write_string( - _SCHEMA_DELETE_DATASET_EXAMPLES_OUTPUT.members["datasetId"], self.dataset_id - ) - serializer.write_string( - _SCHEMA_DELETE_DATASET_EXAMPLES_OUTPUT.members["status"], self.status - ) - serializer.write_long( - _SCHEMA_DELETE_DATASET_EXAMPLES_OUTPUT.members["deletedCount"], - self.deleted_count, - ) - serializer.write_timestamp( - _SCHEMA_DELETE_DATASET_EXAMPLES_OUTPUT.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["dataset_arn"] = de.read_string( - _SCHEMA_DELETE_DATASET_EXAMPLES_OUTPUT.members["datasetArn"] - ) - - case 1: - kwargs["dataset_id"] = de.read_string( - _SCHEMA_DELETE_DATASET_EXAMPLES_OUTPUT.members["datasetId"] - ) - - case 2: - kwargs["status"] = DatasetStatus( - de.read_string( - _SCHEMA_DELETE_DATASET_EXAMPLES_OUTPUT.members["status"] - ) - ) - - case 3: - kwargs["deleted_count"] = de.read_long( - _SCHEMA_DELETE_DATASET_EXAMPLES_OUTPUT.members["deletedCount"] - ) - - case 4: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_DELETE_DATASET_EXAMPLES_OUTPUT.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_DATASET_EXAMPLES_OUTPUT, consumer=_consumer - ) - if "dataset_arn" not in kwargs: - kwargs["dataset_arn"] = "" - if "dataset_id" not in kwargs: - kwargs["dataset_id"] = "" - if "status" not in kwargs: - kwargs["status"] = DatasetStatus._corrected("") - if "deleted_count" not in kwargs: - kwargs["deleted_count"] = 0 - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -DELETE_DATASET_EXAMPLES = APIOperation( - input=DeleteDatasetExamplesInput, - output=DeleteDatasetExamplesOutput, - schema=_SCHEMA_DELETE_DATASET_EXAMPLES, - input_schema=_SCHEMA_DELETE_DATASET_EXAMPLES_INPUT, - output_schema=_SCHEMA_DELETE_DATASET_EXAMPLES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetDatasetInput: - """Dataclass for GetDatasetInput structure.""" - - dataset_id: str | None = None - """The unique identifier of the dataset to retrieve.""" - - dataset_version: str | None = None - """ - Version to retrieve: \"DRAFT\" or a version number. Defaults to DRAFT if - absent. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DATASET_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.dataset_id is not None: - serializer.write_string( - _SCHEMA_GET_DATASET_INPUT.members["datasetId"], self.dataset_id - ) - - if self.dataset_version is not None: - serializer.write_string( - _SCHEMA_GET_DATASET_INPUT.members["datasetVersion"], - self.dataset_version, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["dataset_id"] = de.read_string( - _SCHEMA_GET_DATASET_INPUT.members["datasetId"] - ) - - case 1: - kwargs["dataset_version"] = de.read_string( - _SCHEMA_GET_DATASET_INPUT.members["datasetVersion"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_DATASET_INPUT, consumer=_consumer) - return kwargs - - -class DraftStatus(UnknownEnumMixin, StrEnum): - """Publish synchronization state of the DRAFT working copy.""" - - MODIFIED = "MODIFIED" - """ - DRAFT has changes not yet reflected in any published version, or no - versions have been published yet. - """ - UNMODIFIED = "UNMODIFIED" - """DRAFT content matches the latest published version exactly.""" - - -@dataclass(kw_only=True) -class GetDatasetOutput: - """Dataclass for GetDatasetOutput structure.""" - - dataset_arn: str - """The Amazon Resource Name (ARN) of the dataset.""" - - dataset_id: str - """The unique identifier of the dataset.""" - - dataset_version: str - """ - The resolved version: \"DRAFT\" (default) or the requested version - number. - """ - - dataset_name: str - """The name of the dataset.""" - - status: str - """The current status of the dataset.""" - - schema_type: str - """The schema type declared at create time. Immutable after creation.""" - - example_count: int - """The number of examples in the DRAFT.""" - - created_at: datetime - """The timestamp when the dataset was created.""" - - updated_at: datetime - """The timestamp when the dataset was last updated.""" - - description: str | None = None - """The description of the dataset.""" - - draft_status: str | None = None - """ - Publish synchronization state. Only authoritative when status is ACTIVE. - MODIFIED indicates DRAFT has unpublished changes. UNMODIFIED indicates - DRAFT matches the latest published version. - """ - - failure_reason: str | None = None - """ - Populated when status is CREATE_FAILED, UPDATE_FAILED, or DELETE_FAILED. - Describes the reason for the failure. - """ - - kms_key_arn: str | None = None - """ - KMS key ARN used for server-side encryption on service Amazon S3 writes, - if configured. - """ - - download_url: str | None = field(repr=False, default=None) - """ - Presigned Amazon S3 URL to download the consolidated dataset file for - the resolved version. Expires after 5 minutes. Omitted if the file does - not yet exist. - """ - - download_url_expires_at: datetime | None = None - """Expiry timestamp for the download URL.""" - - tags: dict[str, str] | None = None - """The tags associated with the dataset.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DATASET_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_DATASET_OUTPUT.members["datasetArn"], self.dataset_arn - ) - serializer.write_string( - _SCHEMA_GET_DATASET_OUTPUT.members["datasetId"], self.dataset_id - ) - serializer.write_string( - _SCHEMA_GET_DATASET_OUTPUT.members["datasetVersion"], self.dataset_version - ) - serializer.write_string( - _SCHEMA_GET_DATASET_OUTPUT.members["datasetName"], self.dataset_name - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_DATASET_OUTPUT.members["description"], self.description - ) - - serializer.write_string( - _SCHEMA_GET_DATASET_OUTPUT.members["status"], self.status - ) - if self.draft_status is not None: - serializer.write_string( - _SCHEMA_GET_DATASET_OUTPUT.members["draftStatus"], self.draft_status - ) - - if self.failure_reason is not None: - serializer.write_string( - _SCHEMA_GET_DATASET_OUTPUT.members["failureReason"], self.failure_reason - ) - - serializer.write_string( - _SCHEMA_GET_DATASET_OUTPUT.members["schemaType"], self.schema_type - ) - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_GET_DATASET_OUTPUT.members["kmsKeyArn"], self.kms_key_arn - ) - - serializer.write_long( - _SCHEMA_GET_DATASET_OUTPUT.members["exampleCount"], self.example_count - ) - if self.download_url is not None: - serializer.write_string( - _SCHEMA_GET_DATASET_OUTPUT.members["downloadUrl"], self.download_url - ) - - if self.download_url_expires_at is not None: - serializer.write_timestamp( - _SCHEMA_GET_DATASET_OUTPUT.members["downloadUrlExpiresAt"], - self.download_url_expires_at, - ) - - serializer.write_timestamp( - _SCHEMA_GET_DATASET_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_GET_DATASET_OUTPUT.members["updatedAt"], self.updated_at - ) - if self.tags is not None: - _serialize_tags_map( - serializer, _SCHEMA_GET_DATASET_OUTPUT.members["tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["dataset_arn"] = de.read_string( - _SCHEMA_GET_DATASET_OUTPUT.members["datasetArn"] - ) - - case 1: - kwargs["dataset_id"] = de.read_string( - _SCHEMA_GET_DATASET_OUTPUT.members["datasetId"] - ) - - case 2: - kwargs["dataset_version"] = de.read_string( - _SCHEMA_GET_DATASET_OUTPUT.members["datasetVersion"] - ) - - case 3: - kwargs["dataset_name"] = de.read_string( - _SCHEMA_GET_DATASET_OUTPUT.members["datasetName"] - ) - - case 4: - kwargs["description"] = de.read_string( - _SCHEMA_GET_DATASET_OUTPUT.members["description"] - ) - - case 5: - kwargs["status"] = DatasetStatus( - de.read_string(_SCHEMA_GET_DATASET_OUTPUT.members["status"]) - ) - - case 6: - kwargs["draft_status"] = DraftStatus( - de.read_string( - _SCHEMA_GET_DATASET_OUTPUT.members["draftStatus"] - ) - ) - - case 7: - kwargs["failure_reason"] = de.read_string( - _SCHEMA_GET_DATASET_OUTPUT.members["failureReason"] - ) - - case 8: - kwargs["schema_type"] = DatasetSchemaType( - de.read_string(_SCHEMA_GET_DATASET_OUTPUT.members["schemaType"]) - ) - - case 9: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_GET_DATASET_OUTPUT.members["kmsKeyArn"] - ) - - case 10: - kwargs["example_count"] = de.read_long( - _SCHEMA_GET_DATASET_OUTPUT.members["exampleCount"] - ) - - case 11: - kwargs["download_url"] = de.read_string( - _SCHEMA_GET_DATASET_OUTPUT.members["downloadUrl"] - ) - - case 12: - kwargs["download_url_expires_at"] = de.read_timestamp( - _SCHEMA_GET_DATASET_OUTPUT.members["downloadUrlExpiresAt"] - ) - - case 13: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_DATASET_OUTPUT.members["createdAt"] - ) - - case 14: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_GET_DATASET_OUTPUT.members["updatedAt"] - ) - - case 15: - kwargs["tags"] = _deserialize_tags_map( - de, _SCHEMA_GET_DATASET_OUTPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_DATASET_OUTPUT, consumer=_consumer) - if "dataset_arn" not in kwargs: - kwargs["dataset_arn"] = "" - if "dataset_id" not in kwargs: - kwargs["dataset_id"] = "" - if "dataset_version" not in kwargs: - kwargs["dataset_version"] = "" - if "dataset_name" not in kwargs: - kwargs["dataset_name"] = "" - if "status" not in kwargs: - kwargs["status"] = DatasetStatus._corrected("") - if "schema_type" not in kwargs: - kwargs["schema_type"] = DatasetSchemaType._corrected("") - if "example_count" not in kwargs: - kwargs["example_count"] = 0 - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -GET_DATASET = APIOperation( - input=GetDatasetInput, - output=GetDatasetOutput, - schema=_SCHEMA_GET_DATASET, - input_schema=_SCHEMA_GET_DATASET_INPUT, - output_schema=_SCHEMA_GET_DATASET_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListDatasetExamplesInput: - """Dataclass for ListDatasetExamplesInput structure.""" - - dataset_id: str | None = None - """The unique identifier of the dataset.""" - - dataset_version: str | None = None - """ - Version to paginate: \"DRAFT\" or a version number. Defaults to DRAFT if - absent. Only used on the first request; for subsequent pages, the - version is extracted from the pagination token. - """ - - max_results: int | None = None - """Maximum number of examples to return per page.""" - - next_token: str | None = None - """The token for the next page of results.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_DATASET_EXAMPLES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.dataset_id is not None: - serializer.write_string( - _SCHEMA_LIST_DATASET_EXAMPLES_INPUT.members["datasetId"], - self.dataset_id, - ) - - if self.dataset_version is not None: - serializer.write_string( - _SCHEMA_LIST_DATASET_EXAMPLES_INPUT.members["datasetVersion"], - self.dataset_version, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_DATASET_EXAMPLES_INPUT.members["maxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_DATASET_EXAMPLES_INPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["dataset_id"] = de.read_string( - _SCHEMA_LIST_DATASET_EXAMPLES_INPUT.members["datasetId"] - ) - - case 1: - kwargs["dataset_version"] = de.read_string( - _SCHEMA_LIST_DATASET_EXAMPLES_INPUT.members["datasetVersion"] - ) - - case 2: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_DATASET_EXAMPLES_INPUT.members["maxResults"] - ) - - case 3: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_DATASET_EXAMPLES_INPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_DATASET_EXAMPLES_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ListDatasetExamplesOutput: - """Dataclass for ListDatasetExamplesOutput structure.""" - - dataset_arn: str - """The Amazon Resource Name (ARN) of the dataset.""" - - dataset_id: str - """The unique identifier of the dataset.""" - - dataset_version: str - """The version returned.""" - - examples: list[Document] - """ - Paginated example content. Each element is a JSON object containing at - least an `exampleId` field plus the schema-specific content fields. - """ - - next_token: str | None = None - """ - The token for the next page of results, or null if there are no more - results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_DATASET_EXAMPLES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_LIST_DATASET_EXAMPLES_OUTPUT.members["datasetArn"], self.dataset_arn - ) - serializer.write_string( - _SCHEMA_LIST_DATASET_EXAMPLES_OUTPUT.members["datasetId"], self.dataset_id - ) - serializer.write_string( - _SCHEMA_LIST_DATASET_EXAMPLES_OUTPUT.members["datasetVersion"], - self.dataset_version, - ) - _serialize_dataset_example_list( - serializer, - _SCHEMA_LIST_DATASET_EXAMPLES_OUTPUT.members["examples"], - self.examples, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_DATASET_EXAMPLES_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["dataset_arn"] = de.read_string( - _SCHEMA_LIST_DATASET_EXAMPLES_OUTPUT.members["datasetArn"] - ) - - case 1: - kwargs["dataset_id"] = de.read_string( - _SCHEMA_LIST_DATASET_EXAMPLES_OUTPUT.members["datasetId"] - ) - - case 2: - kwargs["dataset_version"] = de.read_string( - _SCHEMA_LIST_DATASET_EXAMPLES_OUTPUT.members["datasetVersion"] - ) - - case 3: - kwargs["examples"] = _deserialize_dataset_example_list( - de, _SCHEMA_LIST_DATASET_EXAMPLES_OUTPUT.members["examples"] - ) - - case 4: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_DATASET_EXAMPLES_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_DATASET_EXAMPLES_OUTPUT, consumer=_consumer - ) - if "dataset_arn" not in kwargs: - kwargs["dataset_arn"] = "" - if "dataset_id" not in kwargs: - kwargs["dataset_id"] = "" - if "dataset_version" not in kwargs: - kwargs["dataset_version"] = "" - if "examples" not in kwargs: - kwargs["examples"] = [] - return kwargs - - -LIST_DATASET_EXAMPLES = APIOperation( - input=ListDatasetExamplesInput, - output=ListDatasetExamplesOutput, - schema=_SCHEMA_LIST_DATASET_EXAMPLES, - input_schema=_SCHEMA_LIST_DATASET_EXAMPLES_INPUT, - output_schema=_SCHEMA_LIST_DATASET_EXAMPLES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListDatasetsInput: - """Dataclass for ListDatasetsInput structure.""" - - next_token: str | None = None - """The token for the next page of results.""" - - max_results: int | None = None - """The maximum number of datasets to return per page.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_DATASETS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_DATASETS_INPUT.members["nextToken"], self.next_token - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_DATASETS_INPUT.members["maxResults"], self.max_results - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_DATASETS_INPUT.members["nextToken"] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_DATASETS_INPUT.members["maxResults"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_DATASETS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DatasetSummary: - """Summary information about a dataset.""" - - dataset_arn: str - """The Amazon Resource Name (ARN) of the dataset.""" - - dataset_id: str - """The unique identifier of the dataset.""" - - dataset_name: str - """The name of the dataset.""" - - status: str - """The current status of the dataset.""" - - schema_type: str - """The schema type of the dataset.""" - - example_count: int - """The number of examples in the dataset.""" - - created_at: datetime - """The timestamp when the dataset was created.""" - - updated_at: datetime - """The timestamp when the dataset was last updated.""" - - description: str | None = None - """The description of the dataset.""" - - draft_status: str | None = None - """Publish synchronization state. Only authoritative when status is ACTIVE.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DATASET_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DATASET_SUMMARY.members["datasetArn"], self.dataset_arn - ) - serializer.write_string( - _SCHEMA_DATASET_SUMMARY.members["datasetId"], self.dataset_id - ) - serializer.write_string( - _SCHEMA_DATASET_SUMMARY.members["datasetName"], self.dataset_name - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_DATASET_SUMMARY.members["description"], self.description - ) - - serializer.write_string(_SCHEMA_DATASET_SUMMARY.members["status"], self.status) - if self.draft_status is not None: - serializer.write_string( - _SCHEMA_DATASET_SUMMARY.members["draftStatus"], self.draft_status - ) - - serializer.write_string( - _SCHEMA_DATASET_SUMMARY.members["schemaType"], self.schema_type - ) - serializer.write_long( - _SCHEMA_DATASET_SUMMARY.members["exampleCount"], self.example_count - ) - serializer.write_timestamp( - _SCHEMA_DATASET_SUMMARY.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_DATASET_SUMMARY.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["dataset_arn"] = de.read_string( - _SCHEMA_DATASET_SUMMARY.members["datasetArn"] - ) - - case 1: - kwargs["dataset_id"] = de.read_string( - _SCHEMA_DATASET_SUMMARY.members["datasetId"] - ) - - case 2: - kwargs["dataset_name"] = de.read_string( - _SCHEMA_DATASET_SUMMARY.members["datasetName"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_DATASET_SUMMARY.members["description"] - ) - - case 4: - kwargs["status"] = DatasetStatus( - de.read_string(_SCHEMA_DATASET_SUMMARY.members["status"]) - ) - - case 5: - kwargs["draft_status"] = DraftStatus( - de.read_string(_SCHEMA_DATASET_SUMMARY.members["draftStatus"]) - ) - - case 6: - kwargs["schema_type"] = DatasetSchemaType( - de.read_string(_SCHEMA_DATASET_SUMMARY.members["schemaType"]) - ) - - case 7: - kwargs["example_count"] = de.read_long( - _SCHEMA_DATASET_SUMMARY.members["exampleCount"] - ) - - case 8: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_DATASET_SUMMARY.members["createdAt"] - ) - - case 9: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_DATASET_SUMMARY.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DATASET_SUMMARY, consumer=_consumer) - if "dataset_arn" not in kwargs: - kwargs["dataset_arn"] = "" - if "dataset_id" not in kwargs: - kwargs["dataset_id"] = "" - if "dataset_name" not in kwargs: - kwargs["dataset_name"] = "" - if "status" not in kwargs: - kwargs["status"] = DatasetStatus._corrected("") - if "schema_type" not in kwargs: - kwargs["schema_type"] = DatasetSchemaType._corrected("") - if "example_count" not in kwargs: - kwargs["example_count"] = 0 - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_dataset_summary_list( - serializer: ShapeSerializer, schema: Schema, value: list[DatasetSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_dataset_summary_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[DatasetSummary]: - result: list[DatasetSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(DatasetSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListDatasetsOutput: - """Dataclass for ListDatasetsOutput structure.""" - - datasets: list[DatasetSummary] - """The list of datasets.""" - - next_token: str | None = None - """ - The token for the next page of results, or null if there are no more - results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_DATASETS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_dataset_summary_list( - serializer, _SCHEMA_LIST_DATASETS_OUTPUT.members["datasets"], self.datasets - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_DATASETS_OUTPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["datasets"] = _deserialize_dataset_summary_list( - de, _SCHEMA_LIST_DATASETS_OUTPUT.members["datasets"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_DATASETS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_DATASETS_OUTPUT, consumer=_consumer) - if "datasets" not in kwargs: - kwargs["datasets"] = [] - return kwargs - - -LIST_DATASETS = APIOperation( - input=ListDatasetsInput, - output=ListDatasetsOutput, - schema=_SCHEMA_LIST_DATASETS, - input_schema=_SCHEMA_LIST_DATASETS_INPUT, - output_schema=_SCHEMA_LIST_DATASETS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListDatasetVersionsInput: - """Dataclass for ListDatasetVersionsInput structure.""" - - dataset_id: str | None = None - """The unique identifier of the dataset.""" - - next_token: str | None = None - """The token for the next page of results.""" - - max_results: int | None = None - """The maximum number of versions to return per page.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_DATASET_VERSIONS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.dataset_id is not None: - serializer.write_string( - _SCHEMA_LIST_DATASET_VERSIONS_INPUT.members["datasetId"], - self.dataset_id, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_DATASET_VERSIONS_INPUT.members["nextToken"], - self.next_token, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_DATASET_VERSIONS_INPUT.members["maxResults"], - self.max_results, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["dataset_id"] = de.read_string( - _SCHEMA_LIST_DATASET_VERSIONS_INPUT.members["datasetId"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_DATASET_VERSIONS_INPUT.members["nextToken"] - ) - - case 2: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_DATASET_VERSIONS_INPUT.members["maxResults"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_DATASET_VERSIONS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DatasetVersionSummary: - """Summary information about a published dataset version.""" - - dataset_version: str - """The version number of this published snapshot.""" - - example_count: int - """The number of examples in this version.""" - - created_at: datetime - """The timestamp when this version was published.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DATASET_VERSION_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DATASET_VERSION_SUMMARY.members["datasetVersion"], - self.dataset_version, - ) - serializer.write_long( - _SCHEMA_DATASET_VERSION_SUMMARY.members["exampleCount"], self.example_count - ) - serializer.write_timestamp( - _SCHEMA_DATASET_VERSION_SUMMARY.members["createdAt"], self.created_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["dataset_version"] = de.read_string( - _SCHEMA_DATASET_VERSION_SUMMARY.members["datasetVersion"] - ) - - case 1: - kwargs["example_count"] = de.read_long( - _SCHEMA_DATASET_VERSION_SUMMARY.members["exampleCount"] - ) - - case 2: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_DATASET_VERSION_SUMMARY.members["createdAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DATASET_VERSION_SUMMARY, consumer=_consumer) - if "dataset_version" not in kwargs: - kwargs["dataset_version"] = "" - if "example_count" not in kwargs: - kwargs["example_count"] = 0 - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_dataset_version_summary_list( - serializer: ShapeSerializer, schema: Schema, value: list[DatasetVersionSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_dataset_version_summary_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[DatasetVersionSummary]: - result: list[DatasetVersionSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(DatasetVersionSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListDatasetVersionsOutput: - """Dataclass for ListDatasetVersionsOutput structure.""" - - versions: list[DatasetVersionSummary] - """The list of published dataset versions.""" - - next_token: str | None = None - """ - The token for the next page of results, or null if there are no more - results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_DATASET_VERSIONS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_dataset_version_summary_list( - serializer, - _SCHEMA_LIST_DATASET_VERSIONS_OUTPUT.members["versions"], - self.versions, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_DATASET_VERSIONS_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["versions"] = _deserialize_dataset_version_summary_list( - de, _SCHEMA_LIST_DATASET_VERSIONS_OUTPUT.members["versions"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_DATASET_VERSIONS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_DATASET_VERSIONS_OUTPUT, consumer=_consumer - ) - if "versions" not in kwargs: - kwargs["versions"] = [] - return kwargs - - -LIST_DATASET_VERSIONS = APIOperation( - input=ListDatasetVersionsInput, - output=ListDatasetVersionsOutput, - schema=_SCHEMA_LIST_DATASET_VERSIONS, - input_schema=_SCHEMA_LIST_DATASET_VERSIONS_INPUT, - output_schema=_SCHEMA_LIST_DATASET_VERSIONS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateDatasetInput: - """Dataclass for UpdateDatasetInput structure.""" - - dataset_id: str | None = None - """The unique identifier of the dataset to update.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If you don't specify this field, a - value is randomly generated for you. If this token matches a previous - request, the service ignores the request, but doesn't return an error. - For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - description: str | None = None - """The updated description for the dataset.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_DATASET_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.dataset_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_DATASET_INPUT.members["datasetId"], self.dataset_id - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_UPDATE_DATASET_INPUT.members["clientToken"], self.client_token - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_DATASET_INPUT.members["description"], self.description - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["dataset_id"] = de.read_string( - _SCHEMA_UPDATE_DATASET_INPUT.members["datasetId"] - ) - - case 1: - kwargs["client_token"] = de.read_string( - _SCHEMA_UPDATE_DATASET_INPUT.members["clientToken"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_DATASET_INPUT.members["description"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_DATASET_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateDatasetOutput: - """Dataclass for UpdateDatasetOutput structure.""" - - dataset_arn: str - """The Amazon Resource Name (ARN) of the updated dataset.""" - - dataset_id: str - """The unique identifier of the updated dataset.""" - - updated_at: datetime - """The timestamp when the dataset was updated.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_DATASET_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_UPDATE_DATASET_OUTPUT.members["datasetArn"], self.dataset_arn - ) - serializer.write_string( - _SCHEMA_UPDATE_DATASET_OUTPUT.members["datasetId"], self.dataset_id - ) - serializer.write_timestamp( - _SCHEMA_UPDATE_DATASET_OUTPUT.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["dataset_arn"] = de.read_string( - _SCHEMA_UPDATE_DATASET_OUTPUT.members["datasetArn"] - ) - - case 1: - kwargs["dataset_id"] = de.read_string( - _SCHEMA_UPDATE_DATASET_OUTPUT.members["datasetId"] - ) - - case 2: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_UPDATE_DATASET_OUTPUT.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_DATASET_OUTPUT, consumer=_consumer) - if "dataset_arn" not in kwargs: - kwargs["dataset_arn"] = "" - if "dataset_id" not in kwargs: - kwargs["dataset_id"] = "" - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -UPDATE_DATASET = APIOperation( - input=UpdateDatasetInput, - output=UpdateDatasetOutput, - schema=_SCHEMA_UPDATE_DATASET, - input_schema=_SCHEMA_UPDATE_DATASET_INPUT, - output_schema=_SCHEMA_UPDATE_DATASET_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateDatasetExamplesInput: - """Dataclass for UpdateDatasetExamplesInput structure.""" - - dataset_id: str | None = None - """The unique identifier of the dataset.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If you don't specify this field, a - value is randomly generated for you. If this token matches a previous - request, the service ignores the request, but doesn't return an error. - For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - examples: list[Document] | None = None - """ - Examples to update. Each element is a JSON object containing a required - `exampleId` field identifying the existing example, plus the replacement - fields. Maximum 1000 examples per call. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_DATASET_EXAMPLES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.dataset_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_DATASET_EXAMPLES_INPUT.members["datasetId"], - self.dataset_id, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_UPDATE_DATASET_EXAMPLES_INPUT.members["clientToken"], - self.client_token, - ) - - if self.examples is not None: - _serialize_dataset_example_list( - serializer, - _SCHEMA_UPDATE_DATASET_EXAMPLES_INPUT.members["examples"], - self.examples, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["dataset_id"] = de.read_string( - _SCHEMA_UPDATE_DATASET_EXAMPLES_INPUT.members["datasetId"] - ) - - case 1: - kwargs["client_token"] = de.read_string( - _SCHEMA_UPDATE_DATASET_EXAMPLES_INPUT.members["clientToken"] - ) - - case 2: - kwargs["examples"] = _deserialize_dataset_example_list( - de, _SCHEMA_UPDATE_DATASET_EXAMPLES_INPUT.members["examples"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_DATASET_EXAMPLES_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateDatasetExamplesOutput: - """Dataclass for UpdateDatasetExamplesOutput structure.""" - - dataset_arn: str - """The Amazon Resource Name (ARN) of the dataset.""" - - dataset_id: str - """The unique identifier of the dataset.""" - - status: str - """The current status of the dataset.""" - - updated_count: int - """The number of examples updated.""" - - updated_at: datetime - """The timestamp when the examples were updated.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_DATASET_EXAMPLES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_UPDATE_DATASET_EXAMPLES_OUTPUT.members["datasetArn"], - self.dataset_arn, - ) - serializer.write_string( - _SCHEMA_UPDATE_DATASET_EXAMPLES_OUTPUT.members["datasetId"], self.dataset_id - ) - serializer.write_string( - _SCHEMA_UPDATE_DATASET_EXAMPLES_OUTPUT.members["status"], self.status - ) - serializer.write_long( - _SCHEMA_UPDATE_DATASET_EXAMPLES_OUTPUT.members["updatedCount"], - self.updated_count, - ) - serializer.write_timestamp( - _SCHEMA_UPDATE_DATASET_EXAMPLES_OUTPUT.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["dataset_arn"] = de.read_string( - _SCHEMA_UPDATE_DATASET_EXAMPLES_OUTPUT.members["datasetArn"] - ) - - case 1: - kwargs["dataset_id"] = de.read_string( - _SCHEMA_UPDATE_DATASET_EXAMPLES_OUTPUT.members["datasetId"] - ) - - case 2: - kwargs["status"] = DatasetStatus( - de.read_string( - _SCHEMA_UPDATE_DATASET_EXAMPLES_OUTPUT.members["status"] - ) - ) - - case 3: - kwargs["updated_count"] = de.read_long( - _SCHEMA_UPDATE_DATASET_EXAMPLES_OUTPUT.members["updatedCount"] - ) - - case 4: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_UPDATE_DATASET_EXAMPLES_OUTPUT.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_DATASET_EXAMPLES_OUTPUT, consumer=_consumer - ) - if "dataset_arn" not in kwargs: - kwargs["dataset_arn"] = "" - if "dataset_id" not in kwargs: - kwargs["dataset_id"] = "" - if "status" not in kwargs: - kwargs["status"] = DatasetStatus._corrected("") - if "updated_count" not in kwargs: - kwargs["updated_count"] = 0 - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -UPDATE_DATASET_EXAMPLES = APIOperation( - input=UpdateDatasetExamplesInput, - output=UpdateDatasetExamplesOutput, - schema=_SCHEMA_UPDATE_DATASET_EXAMPLES, - input_schema=_SCHEMA_UPDATE_DATASET_EXAMPLES_INPUT, - output_schema=_SCHEMA_UPDATE_DATASET_EXAMPLES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteResourcePolicyInput: - """Dataclass for DeleteResourcePolicyInput structure.""" - - resource_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the resource for which to delete the - resource policy. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_RESOURCE_POLICY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_DELETE_RESOURCE_POLICY_INPUT.members["resourceArn"], - self.resource_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_DELETE_RESOURCE_POLICY_INPUT.members["resourceArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_RESOURCE_POLICY_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteResourcePolicyOutput: - """Dataclass for DeleteResourcePolicyOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_RESOURCE_POLICY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_RESOURCE_POLICY_OUTPUT, consumer=_consumer - ) - return kwargs - - -DELETE_RESOURCE_POLICY = APIOperation( - input=DeleteResourcePolicyInput, - output=DeleteResourcePolicyOutput, - schema=_SCHEMA_DELETE_RESOURCE_POLICY, - input_schema=_SCHEMA_DELETE_RESOURCE_POLICY_INPUT, - output_schema=_SCHEMA_DELETE_RESOURCE_POLICY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class LambdaEvaluatorConfig: - """Configuration for a Lambda function used as a code-based evaluator.""" - - lambda_arn: str - """ - The Amazon Resource Name (ARN) of the Lambda function that implements - the evaluation logic. - """ - - lambda_timeout_in_seconds: int | None = None - """ - The timeout in seconds for the Lambda function invocation. Defaults to - 60. Must be between 1 and 300. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LAMBDA_EVALUATOR_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_LAMBDA_EVALUATOR_CONFIG.members["lambdaArn"], self.lambda_arn - ) - if self.lambda_timeout_in_seconds is not None: - serializer.write_integer( - _SCHEMA_LAMBDA_EVALUATOR_CONFIG.members["lambdaTimeoutInSeconds"], - self.lambda_timeout_in_seconds, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["lambda_arn"] = de.read_string( - _SCHEMA_LAMBDA_EVALUATOR_CONFIG.members["lambdaArn"] - ) - - case 1: - kwargs["lambda_timeout_in_seconds"] = de.read_integer( - _SCHEMA_LAMBDA_EVALUATOR_CONFIG.members[ - "lambdaTimeoutInSeconds" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LAMBDA_EVALUATOR_CONFIG, consumer=_consumer) - if "lambda_arn" not in kwargs: - kwargs["lambda_arn"] = "" - return kwargs - - -@dataclass -class CodeBasedEvaluatorConfigLambdaConfig: - """The Lambda function configuration for code-based evaluation.""" - - value: LambdaEvaluatorConfig - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CODE_BASED_EVALUATOR_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CODE_BASED_EVALUATOR_CONFIG.members["lambdaConfig"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=LambdaEvaluatorConfig.deserialize(deserializer)) - - -@dataclass -class CodeBasedEvaluatorConfigUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -CodeBasedEvaluatorConfig = Union[ - CodeBasedEvaluatorConfigLambdaConfig | CodeBasedEvaluatorConfigUnknown -] -""" -Configuration for a code-based evaluator. Specify the Lambda function to -use for evaluation. -""" - - -class _CodeBasedEvaluatorConfigDeserializer: - _result: CodeBasedEvaluatorConfig | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> CodeBasedEvaluatorConfig: - self._result = None - deserializer.read_struct(_SCHEMA_CODE_BASED_EVALUATOR_CONFIG, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(CodeBasedEvaluatorConfigLambdaConfig.deserialize(de)) - - case _: - self._set_result( - CodeBasedEvaluatorConfigUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: CodeBasedEvaluatorConfig) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_non_empty_string_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_non_empty_string_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class InferenceConfiguration: - """ - The configuration parameters that control how the foundation model - behaves during evaluation, including response generation settings. - """ - - max_tokens: int | None = None - """ - The maximum number of tokens to generate in the model response during - evaluation. - """ - - temperature: float | None = None - """ - The temperature value that controls randomness in the model's - responses. Lower values produce more deterministic outputs. - """ - - top_p: float | None = None - """ - The top-p sampling parameter that controls the diversity of the model's - responses by limiting the cumulative probability of token choices. - """ - - stop_sequences: list[str] | None = None - """ - The list of sequences that will cause the model to stop generating - tokens when encountered. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INFERENCE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.max_tokens is not None: - serializer.write_integer( - _SCHEMA_INFERENCE_CONFIGURATION.members["maxTokens"], self.max_tokens - ) - - if self.temperature is not None: - serializer.write_float( - _SCHEMA_INFERENCE_CONFIGURATION.members["temperature"], self.temperature - ) - - if self.top_p is not None: - serializer.write_float( - _SCHEMA_INFERENCE_CONFIGURATION.members["topP"], self.top_p - ) - - if self.stop_sequences is not None: - _serialize_non_empty_string_list( - serializer, - _SCHEMA_INFERENCE_CONFIGURATION.members["stopSequences"], - self.stop_sequences, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["max_tokens"] = de.read_integer( - _SCHEMA_INFERENCE_CONFIGURATION.members["maxTokens"] - ) - - case 1: - kwargs["temperature"] = de.read_float( - _SCHEMA_INFERENCE_CONFIGURATION.members["temperature"] - ) - - case 2: - kwargs["top_p"] = de.read_float( - _SCHEMA_INFERENCE_CONFIGURATION.members["topP"] - ) - - case 3: - kwargs["stop_sequences"] = _deserialize_non_empty_string_list( - de, _SCHEMA_INFERENCE_CONFIGURATION.members["stopSequences"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INFERENCE_CONFIGURATION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class BedrockEvaluatorModelConfig: - """ - The configuration for using Amazon Bedrock models in evaluator - assessments, including model selection and inference parameters. - """ - - model_id: str - """ - The identifier of the Amazon Bedrock model to use for evaluation. Must - be a supported foundation model available in your region. - """ - - inference_config: InferenceConfiguration | None = None - """ - The inference configuration parameters that control model behavior - during evaluation, including temperature, token limits, and sampling - settings. - """ - - additional_model_request_fields: Document | None = None - """ - Additional model-specific request fields to customize model behavior - beyond the standard inference configuration. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BEDROCK_EVALUATOR_MODEL_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_BEDROCK_EVALUATOR_MODEL_CONFIG.members["modelId"], self.model_id - ) - if self.inference_config is not None: - serializer.write_struct( - _SCHEMA_BEDROCK_EVALUATOR_MODEL_CONFIG.members["inferenceConfig"], - self.inference_config, - ) - - if self.additional_model_request_fields is not None: - serializer.write_document( - _SCHEMA_BEDROCK_EVALUATOR_MODEL_CONFIG.members[ - "additionalModelRequestFields" - ], - self.additional_model_request_fields, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_id"] = de.read_string( - _SCHEMA_BEDROCK_EVALUATOR_MODEL_CONFIG.members["modelId"] - ) - - case 1: - kwargs["inference_config"] = InferenceConfiguration.deserialize(de) - - case 2: - kwargs["additional_model_request_fields"] = de.read_document( - _SCHEMA_BEDROCK_EVALUATOR_MODEL_CONFIG.members[ - "additionalModelRequestFields" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_BEDROCK_EVALUATOR_MODEL_CONFIG, consumer=_consumer - ) - if "model_id" not in kwargs: - kwargs["model_id"] = "" - return kwargs - - -@dataclass(kw_only=True) -class ReasoningConfiguration: - """ - The reasoning configuration that controls how a reasoning model - allocates effort during evaluation. - """ - - effort: str | None = None - """ - The level of reasoning effort the model applies when generating a - response. For supported values, see the model provider's documentation. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REASONING_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.effort is not None: - serializer.write_string( - _SCHEMA_REASONING_CONFIGURATION.members["effort"], self.effort - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["effort"] = de.read_string( - _SCHEMA_REASONING_CONFIGURATION.members["effort"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_REASONING_CONFIGURATION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class OpenResponsesEvaluatorModelConfig: - """ - The configuration for using models served through the OpenResponses API - in evaluator assessments, including model selection and inference - parameters. - """ - - model_id: str - """The identifier of the model to use for evaluation.""" - - max_output_tokens: int | None = None - """ - The maximum number of tokens to generate in the model response, - including visible output and reasoning tokens. - """ - - temperature: float | None = None - """ - The temperature value that controls randomness in the model's - responses. Lower values produce more deterministic outputs. - """ - - top_p: float | None = None - """ - The top-p sampling parameter that controls the diversity of the model's - responses by limiting the cumulative probability of token choices. - """ - - reasoning: ReasoningConfiguration | None = None - """ - The reasoning configuration for reasoning models. Non-reasoning models - ignore this configuration. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OPEN_RESPONSES_EVALUATOR_MODEL_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_OPEN_RESPONSES_EVALUATOR_MODEL_CONFIG.members["modelId"], - self.model_id, - ) - if self.max_output_tokens is not None: - serializer.write_integer( - _SCHEMA_OPEN_RESPONSES_EVALUATOR_MODEL_CONFIG.members[ - "maxOutputTokens" - ], - self.max_output_tokens, - ) - - if self.temperature is not None: - serializer.write_float( - _SCHEMA_OPEN_RESPONSES_EVALUATOR_MODEL_CONFIG.members["temperature"], - self.temperature, - ) - - if self.top_p is not None: - serializer.write_float( - _SCHEMA_OPEN_RESPONSES_EVALUATOR_MODEL_CONFIG.members["topP"], - self.top_p, - ) - - if self.reasoning is not None: - serializer.write_struct( - _SCHEMA_OPEN_RESPONSES_EVALUATOR_MODEL_CONFIG.members["reasoning"], - self.reasoning, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_id"] = de.read_string( - _SCHEMA_OPEN_RESPONSES_EVALUATOR_MODEL_CONFIG.members["modelId"] - ) - - case 1: - kwargs["max_output_tokens"] = de.read_integer( - _SCHEMA_OPEN_RESPONSES_EVALUATOR_MODEL_CONFIG.members[ - "maxOutputTokens" - ] - ) - - case 2: - kwargs["temperature"] = de.read_float( - _SCHEMA_OPEN_RESPONSES_EVALUATOR_MODEL_CONFIG.members[ - "temperature" - ] - ) - - case 3: - kwargs["top_p"] = de.read_float( - _SCHEMA_OPEN_RESPONSES_EVALUATOR_MODEL_CONFIG.members["topP"] - ) - - case 4: - kwargs["reasoning"] = ReasoningConfiguration.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_OPEN_RESPONSES_EVALUATOR_MODEL_CONFIG, consumer=_consumer - ) - if "model_id" not in kwargs: - kwargs["model_id"] = "" - return kwargs - - -@dataclass -class EvaluatorModelConfigBedrockEvaluatorModelConfig: - """The Amazon Bedrock model configuration for evaluation.""" - - value: BedrockEvaluatorModelConfig - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVALUATOR_MODEL_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_EVALUATOR_MODEL_CONFIG.members["bedrockEvaluatorModelConfig"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=BedrockEvaluatorModelConfig.deserialize(deserializer)) - - -@dataclass -class EvaluatorModelConfigResponsesEvaluatorModelConfig: - """The OpenResponses model configuration for evaluation.""" - - value: OpenResponsesEvaluatorModelConfig - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVALUATOR_MODEL_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_EVALUATOR_MODEL_CONFIG.members["responsesEvaluatorModelConfig"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=OpenResponsesEvaluatorModelConfig.deserialize(deserializer)) - - -@dataclass -class EvaluatorModelConfigUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -EvaluatorModelConfig = Union[ - EvaluatorModelConfigBedrockEvaluatorModelConfig - | EvaluatorModelConfigResponsesEvaluatorModelConfig - | EvaluatorModelConfigUnknown -] -""" -The model configuration that specifies which foundation model to use for -evaluation and how to configure it. -""" - - -class _EvaluatorModelConfigDeserializer: - _result: EvaluatorModelConfig | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> EvaluatorModelConfig: - self._result = None - deserializer.read_struct(_SCHEMA_EVALUATOR_MODEL_CONFIG, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - EvaluatorModelConfigBedrockEvaluatorModelConfig.deserialize(de) - ) - - case 1: - self._set_result( - EvaluatorModelConfigResponsesEvaluatorModelConfig.deserialize(de) - ) - - case _: - self._set_result( - EvaluatorModelConfigUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: EvaluatorModelConfig) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class DerivedEvaluatorConfig: - """ - The configuration for a derived evaluator. It reuses an existing - evaluator's logic on your own model. - """ - - base_evaluator_id: str - """ - The identifier of the base evaluator whose logic to run (a `Builtin.*` - or `ThirdParty.*` evaluator). - """ - - model_config: EvaluatorModelConfig - """The configuration of the evaluator model that you supply.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DERIVED_EVALUATOR_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DERIVED_EVALUATOR_CONFIG.members["baseEvaluatorId"], - self.base_evaluator_id, - ) - serializer.write_struct( - _SCHEMA_DERIVED_EVALUATOR_CONFIG.members["modelConfig"], self.model_config - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["base_evaluator_id"] = de.read_string( - _SCHEMA_DERIVED_EVALUATOR_CONFIG.members["baseEvaluatorId"] - ) - - case 1: - kwargs["model_config"] = ( - _EvaluatorModelConfigDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DERIVED_EVALUATOR_CONFIG, consumer=_consumer) - if "base_evaluator_id" not in kwargs: - kwargs["base_evaluator_id"] = "" - if "model_config" not in kwargs: - kwargs["model_config"] = EvaluatorModelConfigUnknown(tag="") - return kwargs - - -@dataclass(kw_only=True) -class CategoricalScaleDefinition: - """ - The definition of a categorical rating scale option that provides a - named category with its description for evaluation scoring. - """ - - definition: str - """ - The description that explains what this categorical rating represents - and when it should be used. - """ - - label: str - """The label or name of this categorical rating option.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CATEGORICAL_SCALE_DEFINITION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CATEGORICAL_SCALE_DEFINITION.members["definition"], self.definition - ) - serializer.write_string( - _SCHEMA_CATEGORICAL_SCALE_DEFINITION.members["label"], self.label - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["definition"] = de.read_string( - _SCHEMA_CATEGORICAL_SCALE_DEFINITION.members["definition"] - ) - - case 1: - kwargs["label"] = de.read_string( - _SCHEMA_CATEGORICAL_SCALE_DEFINITION.members["label"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CATEGORICAL_SCALE_DEFINITION, consumer=_consumer - ) - if "definition" not in kwargs: - kwargs["definition"] = "" - if "label" not in kwargs: - kwargs["label"] = "" - return kwargs - - -def _serialize_categorical_scale_definitions( - serializer: ShapeSerializer, schema: Schema, value: list[CategoricalScaleDefinition] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_categorical_scale_definitions( - deserializer: ShapeDeserializer, schema: Schema -) -> list[CategoricalScaleDefinition]: - result: list[CategoricalScaleDefinition] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(CategoricalScaleDefinition.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class NumericalScaleDefinition: - """ - The definition of a numerical rating scale option that provides a - numeric value with its description for evaluation scoring. - """ - - definition: str - """ - The description that explains what this numerical rating represents and - when it should be used. - """ - - value: float - """The numerical value for this rating scale option.""" - - label: str - """The label or name that describes this numerical rating option.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_NUMERICAL_SCALE_DEFINITION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_NUMERICAL_SCALE_DEFINITION.members["definition"], self.definition - ) - serializer.write_double( - _SCHEMA_NUMERICAL_SCALE_DEFINITION.members["value"], self.value - ) - serializer.write_string( - _SCHEMA_NUMERICAL_SCALE_DEFINITION.members["label"], self.label - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["definition"] = de.read_string( - _SCHEMA_NUMERICAL_SCALE_DEFINITION.members["definition"] - ) - - case 1: - kwargs["value"] = de.read_double( - _SCHEMA_NUMERICAL_SCALE_DEFINITION.members["value"] - ) - - case 2: - kwargs["label"] = de.read_string( - _SCHEMA_NUMERICAL_SCALE_DEFINITION.members["label"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_NUMERICAL_SCALE_DEFINITION, consumer=_consumer) - if "definition" not in kwargs: - kwargs["definition"] = "" - if "value" not in kwargs: - kwargs["value"] = 0.0 - if "label" not in kwargs: - kwargs["label"] = "" - return kwargs - - -def _serialize_numerical_scale_definitions( - serializer: ShapeSerializer, schema: Schema, value: list[NumericalScaleDefinition] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_numerical_scale_definitions( - deserializer: ShapeDeserializer, schema: Schema -) -> list[NumericalScaleDefinition]: - result: list[NumericalScaleDefinition] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(NumericalScaleDefinition.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass -class RatingScaleNumerical: - """ - The numerical rating scale with defined score values and descriptions - for quantitative evaluation. - """ - - value: list[NumericalScaleDefinition] - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RATING_SCALE, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_numerical_scale_definitions( - serializer, _SCHEMA_RATING_SCALE.members["numerical"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_deserialize_numerical_scale_definitions( - deserializer, _SCHEMA_RATING_SCALE.members["numerical"] - ) - ) - - -@dataclass -class RatingScaleCategorical: - """ - The categorical rating scale with named categories and definitions for - qualitative evaluation. - """ - - value: list[CategoricalScaleDefinition] - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RATING_SCALE, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_categorical_scale_definitions( - serializer, _SCHEMA_RATING_SCALE.members["categorical"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_deserialize_categorical_scale_definitions( - deserializer, _SCHEMA_RATING_SCALE.members["categorical"] - ) - ) - - -@dataclass -class RatingScaleUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -RatingScale = Union[RatingScaleNumerical | RatingScaleCategorical | RatingScaleUnknown] -""" -The rating scale that defines how evaluators should score agent -performance, supporting both numerical and categorical scales. -""" - - -class _RatingScaleDeserializer: - _result: RatingScale | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> RatingScale: - self._result = None - deserializer.read_struct(_SCHEMA_RATING_SCALE, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(RatingScaleNumerical.deserialize(de)) - - case 1: - self._set_result(RatingScaleCategorical.deserialize(de)) - - case _: - self._set_result(RatingScaleUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: RatingScale) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class LlmAsAJudgeEvaluatorConfig: - """ - The configuration for LLM-as-a-Judge evaluation that uses a language - model to assess agent performance based on custom instructions and - rating scales. - """ - - instructions: str = field(repr=False) - """ - The evaluation instructions that guide the language model in assessing - agent performance, including criteria and evaluation guidelines. - """ - - rating_scale: RatingScale = field(repr=False) - """ - The rating scale that defines how the evaluator should score agent - performance, either numerical or categorical. - """ - - model_config: EvaluatorModelConfig - """ - The model configuration that specifies which foundation model to use and - how to configure it for evaluation. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LLM_AS_A_JUDGE_EVALUATOR_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_LLM_AS_A_JUDGE_EVALUATOR_CONFIG.members["instructions"], - self.instructions, - ) - serializer.write_struct( - _SCHEMA_LLM_AS_A_JUDGE_EVALUATOR_CONFIG.members["ratingScale"], - self.rating_scale, - ) - serializer.write_struct( - _SCHEMA_LLM_AS_A_JUDGE_EVALUATOR_CONFIG.members["modelConfig"], - self.model_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["instructions"] = de.read_string( - _SCHEMA_LLM_AS_A_JUDGE_EVALUATOR_CONFIG.members["instructions"] - ) - - case 1: - kwargs["rating_scale"] = _RatingScaleDeserializer().deserialize(de) - - case 2: - kwargs["model_config"] = ( - _EvaluatorModelConfigDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LLM_AS_A_JUDGE_EVALUATOR_CONFIG, consumer=_consumer - ) - if "instructions" not in kwargs: - kwargs["instructions"] = "" - if "rating_scale" not in kwargs: - kwargs["rating_scale"] = RatingScaleUnknown(tag="") - if "model_config" not in kwargs: - kwargs["model_config"] = EvaluatorModelConfigUnknown(tag="") - return kwargs - - -@dataclass -class EvaluatorConfigLlmAsAJudge: - """ - The LLM-as-a-Judge configuration that uses a language model to evaluate - agent performance based on custom instructions and rating scales. - """ - - value: LlmAsAJudgeEvaluatorConfig - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVALUATOR_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_EVALUATOR_CONFIG.members["llmAsAJudge"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=LlmAsAJudgeEvaluatorConfig.deserialize(deserializer)) - - -@dataclass -class EvaluatorConfigCodeBased: - """ - Configuration for a code-based evaluator that uses a customer-managed - Lambda function to programmatically assess agent performance. - """ - - value: CodeBasedEvaluatorConfig - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVALUATOR_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_EVALUATOR_CONFIG.members["codeBased"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_CodeBasedEvaluatorConfigDeserializer().deserialize(deserializer) - ) - - -@dataclass -class EvaluatorConfigDerived: - """ - The configuration for an evaluator derived from an existing base - evaluator (a built-in or third-party evaluator), run on your own model. - The base evaluator supplies the prompt and scoring. - """ - - value: DerivedEvaluatorConfig - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVALUATOR_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVALUATOR_CONFIG.members["derived"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=DerivedEvaluatorConfig.deserialize(deserializer)) - - -@dataclass -class EvaluatorConfigUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -EvaluatorConfig = Union[ - EvaluatorConfigLlmAsAJudge - | EvaluatorConfigCodeBased - | EvaluatorConfigDerived - | EvaluatorConfigUnknown -] -""" -The configuration that defines how an evaluator assesses agent -performance, including the evaluation method and parameters. -""" - - -class _EvaluatorConfigDeserializer: - _result: EvaluatorConfig | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> EvaluatorConfig: - self._result = None - deserializer.read_struct(_SCHEMA_EVALUATOR_CONFIG, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(EvaluatorConfigLlmAsAJudge.deserialize(de)) - - case 1: - self._set_result(EvaluatorConfigCodeBased.deserialize(de)) - - case 2: - self._set_result(EvaluatorConfigDerived.deserialize(de)) - - case _: - self._set_result( - EvaluatorConfigUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: EvaluatorConfig) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class EvaluatorLevel(UnknownEnumMixin, StrEnum): - TOOL_CALL = "TOOL_CALL" - TRACE = "TRACE" - SESSION = "SESSION" - - -@dataclass(kw_only=True) -class CreateEvaluatorInput: - """Dataclass for CreateEvaluatorInput structure.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If you don't specify this field, a - value is randomly generated for you. If this token matches a previous - request, the service ignores the request, but doesn't return an error. - For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - evaluator_name: str | None = None - """The name of the evaluator. Must be unique within your account.""" - - description: str | None = field(repr=False, default=None) - """ - The description of the evaluator that explains its purpose and - evaluation criteria. - """ - - evaluator_config: EvaluatorConfig | None = None - """ - The configuration for the evaluator. Specify either LLM-as-a-Judge - settings with instructions, rating scale, and model configuration, or - code-based settings with a customer-managed Lambda function. - """ - - level: str | None = None - """ - The evaluation level that determines the scope of evaluation. Valid - values are `TOOL_CALL` for individual tool invocations, `TRACE` for - single request-response interactions, or `SESSION` for entire - conversation sessions. - """ - - kms_key_arn: str | None = None - """ - The Amazon Resource Name (ARN) of a customer managed KMS key to use for - encrypting sensitive evaluator data, including instructions and rating - scale. If you don't specify a KMS key, the evaluator data is encrypted - with an Amazon Web Services owned key. Only symmetric encryption KMS - keys are supported. For more information, see [Encryption at rest for - AgentCore - Evaluations](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/evaluations-encryption.html). - """ - - tags: dict[str, str] | None = None - """ - A map of tag keys and values to assign to an AgentCore Evaluator. Tags - enable you to categorize your resources in different ways, for example, - by purpose, owner, or environment. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_EVALUATOR_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_EVALUATOR_INPUT.members["clientToken"], self.client_token - ) - - if self.evaluator_name is not None: - serializer.write_string( - _SCHEMA_CREATE_EVALUATOR_INPUT.members["evaluatorName"], - self.evaluator_name, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_EVALUATOR_INPUT.members["description"], self.description - ) - - if self.evaluator_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_EVALUATOR_INPUT.members["evaluatorConfig"], - self.evaluator_config, - ) - - if self.level is not None: - serializer.write_string( - _SCHEMA_CREATE_EVALUATOR_INPUT.members["level"], self.level - ) - - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_EVALUATOR_INPUT.members["kmsKeyArn"], self.kms_key_arn - ) - - if self.tags is not None: - _serialize_tags_map( - serializer, _SCHEMA_CREATE_EVALUATOR_INPUT.members["tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_EVALUATOR_INPUT.members["clientToken"] - ) - - case 1: - kwargs["evaluator_name"] = de.read_string( - _SCHEMA_CREATE_EVALUATOR_INPUT.members["evaluatorName"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_EVALUATOR_INPUT.members["description"] - ) - - case 3: - kwargs["evaluator_config"] = ( - _EvaluatorConfigDeserializer().deserialize(de) - ) - - case 4: - kwargs["level"] = EvaluatorLevel( - de.read_string(_SCHEMA_CREATE_EVALUATOR_INPUT.members["level"]) - ) - - case 5: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_CREATE_EVALUATOR_INPUT.members["kmsKeyArn"] - ) - - case 6: - kwargs["tags"] = _deserialize_tags_map( - de, _SCHEMA_CREATE_EVALUATOR_INPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_EVALUATOR_INPUT, consumer=_consumer) - return kwargs - - -class EvaluatorStatus(UnknownEnumMixin, StrEnum): - ACTIVE = "ACTIVE" - CREATING = "CREATING" - CREATE_FAILED = "CREATE_FAILED" - UPDATING = "UPDATING" - UPDATE_FAILED = "UPDATE_FAILED" - DELETING = "DELETING" - - -@dataclass(kw_only=True) -class CreateEvaluatorOutput: - """Dataclass for CreateEvaluatorOutput structure.""" - - evaluator_arn: str - """The Amazon Resource Name (ARN) of the created evaluator.""" - - evaluator_id: str - """The unique identifier of the created evaluator.""" - - created_at: datetime - """The timestamp when the evaluator was created.""" - - status: str - """The status of the evaluator creation operation.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_EVALUATOR_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_EVALUATOR_OUTPUT.members["evaluatorArn"], self.evaluator_arn - ) - serializer.write_string( - _SCHEMA_CREATE_EVALUATOR_OUTPUT.members["evaluatorId"], self.evaluator_id - ) - serializer.write_timestamp( - _SCHEMA_CREATE_EVALUATOR_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_string( - _SCHEMA_CREATE_EVALUATOR_OUTPUT.members["status"], self.status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["evaluator_arn"] = de.read_string( - _SCHEMA_CREATE_EVALUATOR_OUTPUT.members["evaluatorArn"] - ) - - case 1: - kwargs["evaluator_id"] = de.read_string( - _SCHEMA_CREATE_EVALUATOR_OUTPUT.members["evaluatorId"] - ) - - case 2: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_CREATE_EVALUATOR_OUTPUT.members["createdAt"] - ) - - case 3: - kwargs["status"] = EvaluatorStatus( - de.read_string( - _SCHEMA_CREATE_EVALUATOR_OUTPUT.members["status"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_EVALUATOR_OUTPUT, consumer=_consumer) - if "evaluator_arn" not in kwargs: - kwargs["evaluator_arn"] = "" - if "evaluator_id" not in kwargs: - kwargs["evaluator_id"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "status" not in kwargs: - kwargs["status"] = EvaluatorStatus._corrected("") - return kwargs - - -CREATE_EVALUATOR = APIOperation( - input=CreateEvaluatorInput, - output=CreateEvaluatorOutput, - schema=_SCHEMA_CREATE_EVALUATOR, - input_schema=_SCHEMA_CREATE_EVALUATOR_INPUT, - output_schema=_SCHEMA_CREATE_EVALUATOR_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteEvaluatorInput: - """Dataclass for DeleteEvaluatorInput structure.""" - - evaluator_id: str | None = None - """The unique identifier of the evaluator to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_EVALUATOR_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.evaluator_id is not None: - serializer.write_string( - _SCHEMA_DELETE_EVALUATOR_INPUT.members["evaluatorId"], self.evaluator_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["evaluator_id"] = de.read_string( - _SCHEMA_DELETE_EVALUATOR_INPUT.members["evaluatorId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_EVALUATOR_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteEvaluatorOutput: - """Dataclass for DeleteEvaluatorOutput structure.""" - - evaluator_arn: str - """The Amazon Resource Name (ARN) of the deleted evaluator.""" - - evaluator_id: str - """The unique identifier of the deleted evaluator.""" - - status: str - """The status of the evaluator deletion operation.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_EVALUATOR_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DELETE_EVALUATOR_OUTPUT.members["evaluatorArn"], self.evaluator_arn - ) - serializer.write_string( - _SCHEMA_DELETE_EVALUATOR_OUTPUT.members["evaluatorId"], self.evaluator_id - ) - serializer.write_string( - _SCHEMA_DELETE_EVALUATOR_OUTPUT.members["status"], self.status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["evaluator_arn"] = de.read_string( - _SCHEMA_DELETE_EVALUATOR_OUTPUT.members["evaluatorArn"] - ) - - case 1: - kwargs["evaluator_id"] = de.read_string( - _SCHEMA_DELETE_EVALUATOR_OUTPUT.members["evaluatorId"] - ) - - case 2: - kwargs["status"] = EvaluatorStatus( - de.read_string( - _SCHEMA_DELETE_EVALUATOR_OUTPUT.members["status"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_EVALUATOR_OUTPUT, consumer=_consumer) - if "evaluator_arn" not in kwargs: - kwargs["evaluator_arn"] = "" - if "evaluator_id" not in kwargs: - kwargs["evaluator_id"] = "" - if "status" not in kwargs: - kwargs["status"] = EvaluatorStatus._corrected("") - return kwargs - - -DELETE_EVALUATOR = APIOperation( - input=DeleteEvaluatorInput, - output=DeleteEvaluatorOutput, - schema=_SCHEMA_DELETE_EVALUATOR, - input_schema=_SCHEMA_DELETE_EVALUATOR_INPUT, - output_schema=_SCHEMA_DELETE_EVALUATOR_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class IncludedData(UnknownEnumMixin, StrEnum): - ALL_DATA = "ALL_DATA" - METADATA_ONLY = "METADATA_ONLY" - - -@dataclass(kw_only=True) -class GetEvaluatorInput: - """Dataclass for GetEvaluatorInput structure.""" - - evaluator_id: str | None = None - """ - The unique identifier of the evaluator to retrieve. Can be a built-in - evaluator ID (e.g., Builtin.Helpfulness) or a custom evaluator ID. - """ - - included_data: str | None = None - """ - Controls which data is returned in the response. `ALL_DATA` (default) - returns the full evaluator including decrypted instructions and rating - scale. For evaluators encrypted with a customer managed KMS key, this - requires `kms:Decrypt` permission on the key. `METADATA_ONLY` returns - evaluator metadata and model configuration without instructions or - rating scale, and does not require any KMS permissions. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_EVALUATOR_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.evaluator_id is not None: - serializer.write_string( - _SCHEMA_GET_EVALUATOR_INPUT.members["evaluatorId"], self.evaluator_id - ) - - if self.included_data is not None: - serializer.write_string( - _SCHEMA_GET_EVALUATOR_INPUT.members["includedData"], self.included_data - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["evaluator_id"] = de.read_string( - _SCHEMA_GET_EVALUATOR_INPUT.members["evaluatorId"] - ) - - case 1: - kwargs["included_data"] = IncludedData( - de.read_string( - _SCHEMA_GET_EVALUATOR_INPUT.members["includedData"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_EVALUATOR_INPUT, consumer=_consumer) - return kwargs - - -class EvaluatorType(UnknownEnumMixin, StrEnum): - BUILTIN = "Builtin" - THIRD_PARTY = "ThirdParty" - CUSTOM = "Custom" - CODE = "CustomCode" - CUSTOM_DERIVED = "CustomDerived" - - -class Provider(UnknownEnumMixin, StrEnum): - AWS = "AWS" - DEEP_EVAL = "DeepEval" - AUTO_EVAL = "AutoEval" - CUSTOM = "Custom" - - -@dataclass(kw_only=True) -class GetEvaluatorOutput: - """Dataclass for GetEvaluatorOutput structure.""" - - evaluator_arn: str - """The Amazon Resource Name (ARN) of the evaluator.""" - - evaluator_id: str - """The unique identifier of the evaluator.""" - - evaluator_name: str - """The name of the evaluator.""" - - evaluator_config: EvaluatorConfig - """ - The configuration of the evaluator, including LLM-as-a-Judge or - code-based settings. - """ - - level: str - """ - The evaluation level (`TOOL_CALL`, `TRACE`, or `SESSION`) that - determines the scope of evaluation. - """ - - status: str - """The current status of the evaluator.""" - - created_at: datetime - """The timestamp when the evaluator was created.""" - - updated_at: datetime - """The timestamp when the evaluator was last updated.""" - - description: str | None = field(repr=False, default=None) - """The description of the evaluator.""" - - evaluator_type: str | None = None - """ - The kind of evaluator resource. Valid values: - - - `Builtin` -- An Amazon Web Services-managed global evaluator. - - - `ThirdParty` -- An Amazon Web Services-managed global evaluator from a - third-party provider. - - - `Custom` -- A customer-created evaluator. - - - `CustomCode` -- A customer-created code-based evaluator. - - - `CustomDerived` -- A customer-created evaluator derived from an - existing base evaluator. - """ - - provider: str | None = None - """ - The source of the evaluator's logic: Amazon Web Services, a third-party - library, or you. - """ - - locked_for_modification: bool | None = None - """ - Whether the evaluator is locked for modification due to being referenced - by active online evaluation configurations. - """ - - kms_key_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the customer managed KMS key used to - encrypt the evaluator's sensitive data. This field is only present for - evaluators encrypted with a customer managed key. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_EVALUATOR_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_EVALUATOR_OUTPUT.members["evaluatorArn"], self.evaluator_arn - ) - serializer.write_string( - _SCHEMA_GET_EVALUATOR_OUTPUT.members["evaluatorId"], self.evaluator_id - ) - serializer.write_string( - _SCHEMA_GET_EVALUATOR_OUTPUT.members["evaluatorName"], self.evaluator_name - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_EVALUATOR_OUTPUT.members["description"], self.description - ) - - serializer.write_struct( - _SCHEMA_GET_EVALUATOR_OUTPUT.members["evaluatorConfig"], - self.evaluator_config, - ) - if self.evaluator_type is not None: - serializer.write_string( - _SCHEMA_GET_EVALUATOR_OUTPUT.members["evaluatorType"], - self.evaluator_type, - ) - - if self.provider is not None: - serializer.write_string( - _SCHEMA_GET_EVALUATOR_OUTPUT.members["provider"], self.provider - ) - - serializer.write_string( - _SCHEMA_GET_EVALUATOR_OUTPUT.members["level"], self.level - ) - serializer.write_string( - _SCHEMA_GET_EVALUATOR_OUTPUT.members["status"], self.status - ) - serializer.write_timestamp( - _SCHEMA_GET_EVALUATOR_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_GET_EVALUATOR_OUTPUT.members["updatedAt"], self.updated_at - ) - if self.locked_for_modification is not None: - serializer.write_boolean( - _SCHEMA_GET_EVALUATOR_OUTPUT.members["lockedForModification"], - self.locked_for_modification, - ) - - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_GET_EVALUATOR_OUTPUT.members["kmsKeyArn"], self.kms_key_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["evaluator_arn"] = de.read_string( - _SCHEMA_GET_EVALUATOR_OUTPUT.members["evaluatorArn"] - ) - - case 1: - kwargs["evaluator_id"] = de.read_string( - _SCHEMA_GET_EVALUATOR_OUTPUT.members["evaluatorId"] - ) - - case 2: - kwargs["evaluator_name"] = de.read_string( - _SCHEMA_GET_EVALUATOR_OUTPUT.members["evaluatorName"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_GET_EVALUATOR_OUTPUT.members["description"] - ) - - case 4: - kwargs["evaluator_config"] = ( - _EvaluatorConfigDeserializer().deserialize(de) - ) - - case 5: - kwargs["evaluator_type"] = EvaluatorType( - de.read_string( - _SCHEMA_GET_EVALUATOR_OUTPUT.members["evaluatorType"] - ) - ) - - case 6: - kwargs["provider"] = Provider( - de.read_string(_SCHEMA_GET_EVALUATOR_OUTPUT.members["provider"]) - ) - - case 7: - kwargs["level"] = EvaluatorLevel( - de.read_string(_SCHEMA_GET_EVALUATOR_OUTPUT.members["level"]) - ) - - case 8: - kwargs["status"] = EvaluatorStatus( - de.read_string(_SCHEMA_GET_EVALUATOR_OUTPUT.members["status"]) - ) - - case 9: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_EVALUATOR_OUTPUT.members["createdAt"] - ) - - case 10: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_GET_EVALUATOR_OUTPUT.members["updatedAt"] - ) - - case 11: - kwargs["locked_for_modification"] = de.read_boolean( - _SCHEMA_GET_EVALUATOR_OUTPUT.members["lockedForModification"] - ) - - case 12: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_GET_EVALUATOR_OUTPUT.members["kmsKeyArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_EVALUATOR_OUTPUT, consumer=_consumer) - if "evaluator_arn" not in kwargs: - kwargs["evaluator_arn"] = "" - if "evaluator_id" not in kwargs: - kwargs["evaluator_id"] = "" - if "evaluator_name" not in kwargs: - kwargs["evaluator_name"] = "" - if "evaluator_config" not in kwargs: - kwargs["evaluator_config"] = EvaluatorConfigUnknown(tag="") - if "level" not in kwargs: - kwargs["level"] = EvaluatorLevel._corrected("") - if "status" not in kwargs: - kwargs["status"] = EvaluatorStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -GET_EVALUATOR = APIOperation( - input=GetEvaluatorInput, - output=GetEvaluatorOutput, - schema=_SCHEMA_GET_EVALUATOR, - input_schema=_SCHEMA_GET_EVALUATOR_INPUT, - output_schema=_SCHEMA_GET_EVALUATOR_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListEvaluatorsInput: - """Dataclass for ListEvaluatorsInput structure.""" - - next_token: str | None = None - """ - The pagination token from a previous request to retrieve the next page - of results. - """ - - max_results: int | None = None - """The maximum number of evaluators to return in a single response.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_EVALUATORS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_EVALUATORS_INPUT.members["nextToken"], self.next_token - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_EVALUATORS_INPUT.members["maxResults"], self.max_results - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_EVALUATORS_INPUT.members["nextToken"] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_EVALUATORS_INPUT.members["maxResults"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_EVALUATORS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class EvaluatorSummary: - """ - The summary information about an evaluator, including basic metadata and - status information. - """ - - evaluator_arn: str - """The Amazon Resource Name (ARN) of the evaluator.""" - - evaluator_id: str - """The unique identifier of the evaluator.""" - - evaluator_name: str - """The name of the evaluator.""" - - evaluator_type: str - """ - The type of evaluator, indicating whether it is a built-in evaluator - provided by the service or a custom evaluator created by the user. - """ - - status: str - """The current status of the evaluator.""" - - created_at: datetime - """The timestamp when the evaluator was created.""" - - updated_at: datetime - """The timestamp when the evaluator was last updated.""" - - description: str | None = field(repr=False, default=None) - """The description of the evaluator.""" - - provider: str | None = None - """ - The source of the evaluator's logic: Amazon Web Services, a third-party - library, or you. - """ - - level: str | None = None - """ - The evaluation level (`TOOL_CALL`, `TRACE`, or `SESSION`) that - determines the scope of evaluation. - """ - - locked_for_modification: bool | None = None - """ - Whether the evaluator is locked for modification due to being referenced - by active online evaluation configurations. - """ - - kms_key_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the customer managed KMS key used to - encrypt the evaluator's sensitive data. This field is only present for - evaluators encrypted with a customer managed key. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVALUATOR_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_EVALUATOR_SUMMARY.members["evaluatorArn"], self.evaluator_arn - ) - serializer.write_string( - _SCHEMA_EVALUATOR_SUMMARY.members["evaluatorId"], self.evaluator_id - ) - serializer.write_string( - _SCHEMA_EVALUATOR_SUMMARY.members["evaluatorName"], self.evaluator_name - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_EVALUATOR_SUMMARY.members["description"], self.description - ) - - serializer.write_string( - _SCHEMA_EVALUATOR_SUMMARY.members["evaluatorType"], self.evaluator_type - ) - if self.provider is not None: - serializer.write_string( - _SCHEMA_EVALUATOR_SUMMARY.members["provider"], self.provider - ) - - if self.level is not None: - serializer.write_string( - _SCHEMA_EVALUATOR_SUMMARY.members["level"], self.level - ) - - serializer.write_string( - _SCHEMA_EVALUATOR_SUMMARY.members["status"], self.status - ) - serializer.write_timestamp( - _SCHEMA_EVALUATOR_SUMMARY.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_EVALUATOR_SUMMARY.members["updatedAt"], self.updated_at - ) - if self.locked_for_modification is not None: - serializer.write_boolean( - _SCHEMA_EVALUATOR_SUMMARY.members["lockedForModification"], - self.locked_for_modification, - ) - - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_EVALUATOR_SUMMARY.members["kmsKeyArn"], self.kms_key_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["evaluator_arn"] = de.read_string( - _SCHEMA_EVALUATOR_SUMMARY.members["evaluatorArn"] - ) - - case 1: - kwargs["evaluator_id"] = de.read_string( - _SCHEMA_EVALUATOR_SUMMARY.members["evaluatorId"] - ) - - case 2: - kwargs["evaluator_name"] = de.read_string( - _SCHEMA_EVALUATOR_SUMMARY.members["evaluatorName"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_EVALUATOR_SUMMARY.members["description"] - ) - - case 4: - kwargs["evaluator_type"] = EvaluatorType( - de.read_string( - _SCHEMA_EVALUATOR_SUMMARY.members["evaluatorType"] - ) - ) - - case 5: - kwargs["provider"] = Provider( - de.read_string(_SCHEMA_EVALUATOR_SUMMARY.members["provider"]) - ) - - case 6: - kwargs["level"] = EvaluatorLevel( - de.read_string(_SCHEMA_EVALUATOR_SUMMARY.members["level"]) - ) - - case 7: - kwargs["status"] = EvaluatorStatus( - de.read_string(_SCHEMA_EVALUATOR_SUMMARY.members["status"]) - ) - - case 8: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_EVALUATOR_SUMMARY.members["createdAt"] - ) - - case 9: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_EVALUATOR_SUMMARY.members["updatedAt"] - ) - - case 10: - kwargs["locked_for_modification"] = de.read_boolean( - _SCHEMA_EVALUATOR_SUMMARY.members["lockedForModification"] - ) - - case 11: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_EVALUATOR_SUMMARY.members["kmsKeyArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EVALUATOR_SUMMARY, consumer=_consumer) - if "evaluator_arn" not in kwargs: - kwargs["evaluator_arn"] = "" - if "evaluator_id" not in kwargs: - kwargs["evaluator_id"] = "" - if "evaluator_name" not in kwargs: - kwargs["evaluator_name"] = "" - if "evaluator_type" not in kwargs: - kwargs["evaluator_type"] = EvaluatorType._corrected("") - if "status" not in kwargs: - kwargs["status"] = EvaluatorStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_evaluator_summary_list( - serializer: ShapeSerializer, schema: Schema, value: list[EvaluatorSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_evaluator_summary_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[EvaluatorSummary]: - result: list[EvaluatorSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(EvaluatorSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListEvaluatorsOutput: - """Dataclass for ListEvaluatorsOutput structure.""" - - evaluators: list[EvaluatorSummary] - """ - The list of evaluator summaries containing basic information about each - evaluator. - """ - - next_token: str | None = None - """ - The pagination token to use in a subsequent request to retrieve the next - page of results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_EVALUATORS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_evaluator_summary_list( - serializer, - _SCHEMA_LIST_EVALUATORS_OUTPUT.members["evaluators"], - self.evaluators, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_EVALUATORS_OUTPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["evaluators"] = _deserialize_evaluator_summary_list( - de, _SCHEMA_LIST_EVALUATORS_OUTPUT.members["evaluators"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_EVALUATORS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_EVALUATORS_OUTPUT, consumer=_consumer) - if "evaluators" not in kwargs: - kwargs["evaluators"] = [] - return kwargs - - -LIST_EVALUATORS = APIOperation( - input=ListEvaluatorsInput, - output=ListEvaluatorsOutput, - schema=_SCHEMA_LIST_EVALUATORS, - input_schema=_SCHEMA_LIST_EVALUATORS_INPUT, - output_schema=_SCHEMA_LIST_EVALUATORS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateEvaluatorInput: - """Dataclass for UpdateEvaluatorInput structure.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If you don't specify this field, a - value is randomly generated for you. If this token matches a previous - request, the service ignores the request, but doesn't return an error. - For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - evaluator_id: str | None = None - """The unique identifier of the evaluator to update.""" - - description: str | None = field(repr=False, default=None) - """The updated description of the evaluator.""" - - evaluator_config: EvaluatorConfig | None = None - """ - The updated configuration for the evaluator. Specify either - LLM-as-a-Judge settings with instructions, rating scale, and model - configuration, or code-based settings with a customer-managed Lambda - function. - """ - - level: str | None = None - """ - The updated evaluation level (`TOOL_CALL`, `TRACE`, or `SESSION`) that - determines the scope of evaluation. - """ - - kms_key_arn: str | None = None - """ - The Amazon Resource Name (ARN) of a customer managed KMS key to use for - encrypting sensitive evaluator data. Specify a new key ARN to rotate the - encryption key, or specify a key ARN to add encryption to an evaluator - that was previously created without one. When you rotate to a new key, - the service decrypts the existing data with the old key and re-encrypts - it with the new key. Only symmetric encryption KMS keys are supported. - For more information, see [Encryption at rest for AgentCore - Evaluations](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/evaluations-encryption.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_EVALUATOR_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.client_token is not None: - serializer.write_string( - _SCHEMA_UPDATE_EVALUATOR_INPUT.members["clientToken"], self.client_token - ) - - if self.evaluator_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_EVALUATOR_INPUT.members["evaluatorId"], self.evaluator_id - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_EVALUATOR_INPUT.members["description"], self.description - ) - - if self.evaluator_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_EVALUATOR_INPUT.members["evaluatorConfig"], - self.evaluator_config, - ) - - if self.level is not None: - serializer.write_string( - _SCHEMA_UPDATE_EVALUATOR_INPUT.members["level"], self.level - ) - - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_EVALUATOR_INPUT.members["kmsKeyArn"], self.kms_key_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["client_token"] = de.read_string( - _SCHEMA_UPDATE_EVALUATOR_INPUT.members["clientToken"] - ) - - case 1: - kwargs["evaluator_id"] = de.read_string( - _SCHEMA_UPDATE_EVALUATOR_INPUT.members["evaluatorId"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_EVALUATOR_INPUT.members["description"] - ) - - case 3: - kwargs["evaluator_config"] = ( - _EvaluatorConfigDeserializer().deserialize(de) - ) - - case 4: - kwargs["level"] = EvaluatorLevel( - de.read_string(_SCHEMA_UPDATE_EVALUATOR_INPUT.members["level"]) - ) - - case 5: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_UPDATE_EVALUATOR_INPUT.members["kmsKeyArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_EVALUATOR_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateEvaluatorOutput: - """Dataclass for UpdateEvaluatorOutput structure.""" - - evaluator_arn: str - """The Amazon Resource Name (ARN) of the updated evaluator.""" - - evaluator_id: str - """The unique identifier of the updated evaluator.""" - - updated_at: datetime - """The timestamp when the evaluator was last updated.""" - - status: str - """The status of the evaluator update operation.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_EVALUATOR_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_UPDATE_EVALUATOR_OUTPUT.members["evaluatorArn"], self.evaluator_arn - ) - serializer.write_string( - _SCHEMA_UPDATE_EVALUATOR_OUTPUT.members["evaluatorId"], self.evaluator_id - ) - serializer.write_timestamp( - _SCHEMA_UPDATE_EVALUATOR_OUTPUT.members["updatedAt"], self.updated_at - ) - serializer.write_string( - _SCHEMA_UPDATE_EVALUATOR_OUTPUT.members["status"], self.status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["evaluator_arn"] = de.read_string( - _SCHEMA_UPDATE_EVALUATOR_OUTPUT.members["evaluatorArn"] - ) - - case 1: - kwargs["evaluator_id"] = de.read_string( - _SCHEMA_UPDATE_EVALUATOR_OUTPUT.members["evaluatorId"] - ) - - case 2: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_UPDATE_EVALUATOR_OUTPUT.members["updatedAt"] - ) - - case 3: - kwargs["status"] = EvaluatorStatus( - de.read_string( - _SCHEMA_UPDATE_EVALUATOR_OUTPUT.members["status"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_EVALUATOR_OUTPUT, consumer=_consumer) - if "evaluator_arn" not in kwargs: - kwargs["evaluator_arn"] = "" - if "evaluator_id" not in kwargs: - kwargs["evaluator_id"] = "" - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "status" not in kwargs: - kwargs["status"] = EvaluatorStatus._corrected("") - return kwargs - - -UPDATE_EVALUATOR = APIOperation( - input=UpdateEvaluatorInput, - output=UpdateEvaluatorOutput, - schema=_SCHEMA_UPDATE_EVALUATOR, - input_schema=_SCHEMA_UPDATE_EVALUATOR_INPUT, - output_schema=_SCHEMA_UPDATE_EVALUATOR_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -def _serialize_dimension_keys( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_dimension_keys( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -class Period(UnknownEnumMixin, StrEnum): - """The time period for rate limiting.""" - - SECOND = "second" - MINUTE = "minute" - - -@dataclass(kw_only=True) -class RateConfig: - """ - Contains the rate configuration for a rate limit metric, specifying the - allowed rate and time period. - """ - - rate: float - """ - The rate value for the limit. For request limits, this is the number of - requests allowed per period. For token limits, this is the number of - tokens allowed per period. For connection limits, this is the number of - concurrent connections allowed. - """ - - period: str - """ - The time period for the rate limit. Valid values: - - - `second`---Measures the rate limit over a one-second window. - - - `minute`---Measures the rate limit over a one-minute window. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RATE_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_double(_SCHEMA_RATE_CONFIG.members["rate"], self.rate) - serializer.write_string(_SCHEMA_RATE_CONFIG.members["period"], self.period) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rate"] = de.read_double(_SCHEMA_RATE_CONFIG.members["rate"]) - - case 1: - kwargs["period"] = Period( - de.read_string(_SCHEMA_RATE_CONFIG.members["period"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RATE_CONFIG, consumer=_consumer) - if "rate" not in kwargs: - kwargs["rate"] = 0.0 - if "period" not in kwargs: - kwargs["period"] = Period._corrected("") - return kwargs - - -def _serialize_rate_configs( - serializer: ShapeSerializer, schema: Schema, value: list[RateConfig] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_rate_configs( - deserializer: ShapeDeserializer, schema: Schema -) -> list[RateConfig]: - result: list[RateConfig] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(RateConfig.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_dimensions( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_dimensions( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class LimitEntry: - """ - A single rule entry within a rate limit that maps dimension values to - rate configurations. Each entry defines the rate limits for a specific - combination of dimension values. - """ - - dimensions: dict[str, str] - """ - A map of dimension names to dimension values for this rule entry. Keys - must match the parent rate limit's dimension keys. Values may use `*` - as a wildcard, but only in trailing positions based on the dimension - keys ordering. - """ - - requests: list[RateConfig] | None = None - """ - The request rate limit configuration. Specifies the maximum number of - requests allowed per time period. - """ - - tokens: list[RateConfig] | None = None - """ - The token rate limit configuration. Specifies the maximum number of - tokens allowed per time period. - """ - - connections: list[RateConfig] | None = None - """ - The connection rate limit configuration. Specifies the maximum number of - concurrent connections allowed. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIMIT_ENTRY, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_dimensions( - serializer, _SCHEMA_LIMIT_ENTRY.members["dimensions"], self.dimensions - ) - if self.requests is not None: - _serialize_rate_configs( - serializer, _SCHEMA_LIMIT_ENTRY.members["requests"], self.requests - ) - - if self.tokens is not None: - _serialize_rate_configs( - serializer, _SCHEMA_LIMIT_ENTRY.members["tokens"], self.tokens - ) - - if self.connections is not None: - _serialize_rate_configs( - serializer, _SCHEMA_LIMIT_ENTRY.members["connections"], self.connections - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["dimensions"] = _deserialize_dimensions( - de, _SCHEMA_LIMIT_ENTRY.members["dimensions"] - ) - - case 1: - kwargs["requests"] = _deserialize_rate_configs( - de, _SCHEMA_LIMIT_ENTRY.members["requests"] - ) - - case 2: - kwargs["tokens"] = _deserialize_rate_configs( - de, _SCHEMA_LIMIT_ENTRY.members["tokens"] - ) - - case 3: - kwargs["connections"] = _deserialize_rate_configs( - de, _SCHEMA_LIMIT_ENTRY.members["connections"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIMIT_ENTRY, consumer=_consumer) - if "dimensions" not in kwargs: - kwargs["dimensions"] = {} - return kwargs - - -def _serialize_limit_entries( - serializer: ShapeSerializer, schema: Schema, value: list[LimitEntry] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_limit_entries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[LimitEntry]: - result: list[LimitEntry] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(LimitEntry.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class BatchPutLimitEntry: - """ - A rate limit definition within a batch put request. If you provide a - `rateLimitId`, the service uses it for upsert matching against existing - rate limits. - """ - - dimension_keys: list[str] - """ - The ordered list of dimension key names that define the scope of this - rate limit. - """ - - entries: list[LimitEntry] - """ - The list of rule entries that map dimension values to rate - configurations. - """ - - rate_limit_id: str | None = None - """ - The unique identifier of the rate limit. If provided, the service uses - it for upsert matching against existing rate limits. - """ - - description: str | None = None - """ - An optional human-readable description for this rate limit. If not - provided, the rate limit is created without a description. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BATCH_PUT_LIMIT_ENTRY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rate_limit_id is not None: - serializer.write_string( - _SCHEMA_BATCH_PUT_LIMIT_ENTRY.members["rateLimitId"], self.rate_limit_id - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_BATCH_PUT_LIMIT_ENTRY.members["description"], self.description - ) - - _serialize_dimension_keys( - serializer, - _SCHEMA_BATCH_PUT_LIMIT_ENTRY.members["dimensionKeys"], - self.dimension_keys, - ) - _serialize_limit_entries( - serializer, _SCHEMA_BATCH_PUT_LIMIT_ENTRY.members["entries"], self.entries - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rate_limit_id"] = de.read_string( - _SCHEMA_BATCH_PUT_LIMIT_ENTRY.members["rateLimitId"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_BATCH_PUT_LIMIT_ENTRY.members["description"] - ) - - case 2: - kwargs["dimension_keys"] = _deserialize_dimension_keys( - de, _SCHEMA_BATCH_PUT_LIMIT_ENTRY.members["dimensionKeys"] - ) - - case 3: - kwargs["entries"] = _deserialize_limit_entries( - de, _SCHEMA_BATCH_PUT_LIMIT_ENTRY.members["entries"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BATCH_PUT_LIMIT_ENTRY, consumer=_consumer) - if "dimension_keys" not in kwargs: - kwargs["dimension_keys"] = [] - if "entries" not in kwargs: - kwargs["entries"] = [] - return kwargs - - -def _serialize_batch_put_limit_entries( - serializer: ShapeSerializer, schema: Schema, value: list[BatchPutLimitEntry] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_batch_put_limit_entries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[BatchPutLimitEntry]: - result: list[BatchPutLimitEntry] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(BatchPutLimitEntry.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class BatchPutGatewayRateLimitsInput: - """Dataclass for BatchPutGatewayRateLimitsInput structure.""" - - gateway_identifier: str | None = None - """The unique identifier of the gateway.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If you don't specify this field, a - value is randomly generated for you. If this token matches a previous - request, the service ignores the request, but doesn't return an error. - For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - rate_limits: list[BatchPutLimitEntry] | None = None - """ - The complete set of rate limits for this gateway. This operation - replaces all existing rate limits in a single request. If the operation - fails, no rate limits are changed. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BATCH_PUT_GATEWAY_RATE_LIMITS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.gateway_identifier is not None: - serializer.write_string( - _SCHEMA_BATCH_PUT_GATEWAY_RATE_LIMITS_INPUT.members[ - "gatewayIdentifier" - ], - self.gateway_identifier, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_BATCH_PUT_GATEWAY_RATE_LIMITS_INPUT.members["clientToken"], - self.client_token, - ) - - if self.rate_limits is not None: - _serialize_batch_put_limit_entries( - serializer, - _SCHEMA_BATCH_PUT_GATEWAY_RATE_LIMITS_INPUT.members["rateLimits"], - self.rate_limits, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["gateway_identifier"] = de.read_string( - _SCHEMA_BATCH_PUT_GATEWAY_RATE_LIMITS_INPUT.members[ - "gatewayIdentifier" - ] - ) - - case 1: - kwargs["client_token"] = de.read_string( - _SCHEMA_BATCH_PUT_GATEWAY_RATE_LIMITS_INPUT.members[ - "clientToken" - ] - ) - - case 2: - kwargs["rate_limits"] = _deserialize_batch_put_limit_entries( - de, - _SCHEMA_BATCH_PUT_GATEWAY_RATE_LIMITS_INPUT.members[ - "rateLimits" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_BATCH_PUT_GATEWAY_RATE_LIMITS_INPUT, consumer=_consumer - ) - return kwargs - - -class GatewayRateLimitStatus(UnknownEnumMixin, StrEnum): - """The status of a gateway limit.""" - - CREATING = "CREATING" - ACTIVE = "ACTIVE" - UPDATING = "UPDATING" - DELETING = "DELETING" - - -@dataclass(kw_only=True) -class GatewayRateLimitDetail: - """ - Contains detailed information about a gateway rate limit, including its - configuration and current status. - """ - - rate_limit_id: str - """The unique identifier of the rate limit.""" - - gateway_identifier: str - """The unique identifier of the gateway.""" - - dimension_keys: list[str] - """ - The ordered list of dimension key names that define the scope of this - rate limit. - """ - - entries: list[LimitEntry] - """ - The list of rule entries that map dimension values to rate - configurations. - """ - - status: str - """The current status of the rate limit.""" - - created_at: datetime - """The timestamp when the rate limit was created.""" - - updated_at: datetime - """The timestamp when the rate limit was last updated.""" - - description: str | None = None - """The human-readable description of the rate limit.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GATEWAY_RATE_LIMIT_DETAIL, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GATEWAY_RATE_LIMIT_DETAIL.members["rateLimitId"], self.rate_limit_id - ) - serializer.write_string( - _SCHEMA_GATEWAY_RATE_LIMIT_DETAIL.members["gatewayIdentifier"], - self.gateway_identifier, - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_GATEWAY_RATE_LIMIT_DETAIL.members["description"], - self.description, - ) - - _serialize_dimension_keys( - serializer, - _SCHEMA_GATEWAY_RATE_LIMIT_DETAIL.members["dimensionKeys"], - self.dimension_keys, - ) - _serialize_limit_entries( - serializer, - _SCHEMA_GATEWAY_RATE_LIMIT_DETAIL.members["entries"], - self.entries, - ) - serializer.write_string( - _SCHEMA_GATEWAY_RATE_LIMIT_DETAIL.members["status"], self.status - ) - serializer.write_timestamp( - _SCHEMA_GATEWAY_RATE_LIMIT_DETAIL.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_GATEWAY_RATE_LIMIT_DETAIL.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rate_limit_id"] = de.read_string( - _SCHEMA_GATEWAY_RATE_LIMIT_DETAIL.members["rateLimitId"] - ) - - case 1: - kwargs["gateway_identifier"] = de.read_string( - _SCHEMA_GATEWAY_RATE_LIMIT_DETAIL.members["gatewayIdentifier"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_GATEWAY_RATE_LIMIT_DETAIL.members["description"] - ) - - case 3: - kwargs["dimension_keys"] = _deserialize_dimension_keys( - de, _SCHEMA_GATEWAY_RATE_LIMIT_DETAIL.members["dimensionKeys"] - ) - - case 4: - kwargs["entries"] = _deserialize_limit_entries( - de, _SCHEMA_GATEWAY_RATE_LIMIT_DETAIL.members["entries"] - ) - - case 5: - kwargs["status"] = GatewayRateLimitStatus( - de.read_string( - _SCHEMA_GATEWAY_RATE_LIMIT_DETAIL.members["status"] - ) - ) - - case 6: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GATEWAY_RATE_LIMIT_DETAIL.members["createdAt"] - ) - - case 7: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_GATEWAY_RATE_LIMIT_DETAIL.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GATEWAY_RATE_LIMIT_DETAIL, consumer=_consumer) - if "rate_limit_id" not in kwargs: - kwargs["rate_limit_id"] = "" - if "gateway_identifier" not in kwargs: - kwargs["gateway_identifier"] = "" - if "dimension_keys" not in kwargs: - kwargs["dimension_keys"] = [] - if "entries" not in kwargs: - kwargs["entries"] = [] - if "status" not in kwargs: - kwargs["status"] = GatewayRateLimitStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_gateway_rate_limits( - serializer: ShapeSerializer, schema: Schema, value: list[GatewayRateLimitDetail] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_gateway_rate_limits( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GatewayRateLimitDetail]: - result: list[GatewayRateLimitDetail] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GatewayRateLimitDetail.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class BatchPutGatewayRateLimitsOutput: - """Dataclass for BatchPutGatewayRateLimitsOutput structure.""" - - rate_limits: list[GatewayRateLimitDetail] - """The resulting set of rate limits after the batch operation.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BATCH_PUT_GATEWAY_RATE_LIMITS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_gateway_rate_limits( - serializer, - _SCHEMA_BATCH_PUT_GATEWAY_RATE_LIMITS_OUTPUT.members["rateLimits"], - self.rate_limits, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rate_limits"] = _deserialize_gateway_rate_limits( - de, - _SCHEMA_BATCH_PUT_GATEWAY_RATE_LIMITS_OUTPUT.members[ - "rateLimits" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_BATCH_PUT_GATEWAY_RATE_LIMITS_OUTPUT, consumer=_consumer - ) - if "rate_limits" not in kwargs: - kwargs["rate_limits"] = [] - return kwargs - - -BATCH_PUT_GATEWAY_RATE_LIMITS = APIOperation( - input=BatchPutGatewayRateLimitsInput, - output=BatchPutGatewayRateLimitsOutput, - schema=_SCHEMA_BATCH_PUT_GATEWAY_RATE_LIMITS, - input_schema=_SCHEMA_BATCH_PUT_GATEWAY_RATE_LIMITS_INPUT, - output_schema=_SCHEMA_BATCH_PUT_GATEWAY_RATE_LIMITS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class CreateGatewayRateLimitInput: - """Dataclass for CreateGatewayRateLimitInput structure.""" - - gateway_identifier: str | None = None - """The unique identifier of the gateway to create the rate limit for.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If you don't specify this field, a - value is randomly generated for you. If this token matches a previous - request, the service ignores the request, but doesn't return an error. - For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - rate_limit_id: str | None = None - """ - An optional customer-defined identifier for the rate limit. If not - provided, the system generates one. - """ - - description: str | None = None - """ - An optional human-readable description for this rate limit. If not - provided, the rate limit is created without a description. - """ - - dimension_keys: list[str] | None = None - """ - The ordered list of dimension key names that define the scope of this - rate limit. Must be unique per gateway---no two rate limits can share - the same dimension keys. - """ - - entries: list[LimitEntry] | None = None - """The rule entries that map dimension values to rate configurations.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_GATEWAY_RATE_LIMIT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.gateway_identifier is not None: - serializer.write_string( - _SCHEMA_CREATE_GATEWAY_RATE_LIMIT_INPUT.members["gatewayIdentifier"], - self.gateway_identifier, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_GATEWAY_RATE_LIMIT_INPUT.members["clientToken"], - self.client_token, - ) - - if self.rate_limit_id is not None: - serializer.write_string( - _SCHEMA_CREATE_GATEWAY_RATE_LIMIT_INPUT.members["rateLimitId"], - self.rate_limit_id, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_GATEWAY_RATE_LIMIT_INPUT.members["description"], - self.description, - ) - - if self.dimension_keys is not None: - _serialize_dimension_keys( - serializer, - _SCHEMA_CREATE_GATEWAY_RATE_LIMIT_INPUT.members["dimensionKeys"], - self.dimension_keys, - ) - - if self.entries is not None: - _serialize_limit_entries( - serializer, - _SCHEMA_CREATE_GATEWAY_RATE_LIMIT_INPUT.members["entries"], - self.entries, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["gateway_identifier"] = de.read_string( - _SCHEMA_CREATE_GATEWAY_RATE_LIMIT_INPUT.members[ - "gatewayIdentifier" - ] - ) - - case 1: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_GATEWAY_RATE_LIMIT_INPUT.members["clientToken"] - ) - - case 2: - kwargs["rate_limit_id"] = de.read_string( - _SCHEMA_CREATE_GATEWAY_RATE_LIMIT_INPUT.members["rateLimitId"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_GATEWAY_RATE_LIMIT_INPUT.members["description"] - ) - - case 4: - kwargs["dimension_keys"] = _deserialize_dimension_keys( - de, - _SCHEMA_CREATE_GATEWAY_RATE_LIMIT_INPUT.members[ - "dimensionKeys" - ], - ) - - case 5: - kwargs["entries"] = _deserialize_limit_entries( - de, _SCHEMA_CREATE_GATEWAY_RATE_LIMIT_INPUT.members["entries"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_GATEWAY_RATE_LIMIT_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CreateGatewayRateLimitOutput: - """Shared fields for `GatewayRateLimit` responses.""" - - rate_limit_id: str - """The unique identifier of the created rate limit.""" - - gateway_identifier: str - """The unique identifier of the gateway.""" - - dimension_keys: list[str] - """ - The ordered list of dimension key names that define the scope of this - rate limit. - """ - - entries: list[LimitEntry] - """ - The list of rule entries that map dimension values to rate - configurations. - """ - - status: str - """The current status of the rate limit.""" - - created_at: datetime - """The timestamp when the rate limit was created.""" - - updated_at: datetime - """The timestamp when the rate limit was last updated.""" - - description: str | None = None - """The human-readable description of the rate limit.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_GATEWAY_RATE_LIMIT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_GATEWAY_RATE_LIMIT_OUTPUT.members["rateLimitId"], - self.rate_limit_id, - ) - serializer.write_string( - _SCHEMA_CREATE_GATEWAY_RATE_LIMIT_OUTPUT.members["gatewayIdentifier"], - self.gateway_identifier, - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_GATEWAY_RATE_LIMIT_OUTPUT.members["description"], - self.description, - ) - - _serialize_dimension_keys( - serializer, - _SCHEMA_CREATE_GATEWAY_RATE_LIMIT_OUTPUT.members["dimensionKeys"], - self.dimension_keys, - ) - _serialize_limit_entries( - serializer, - _SCHEMA_CREATE_GATEWAY_RATE_LIMIT_OUTPUT.members["entries"], - self.entries, - ) - serializer.write_string( - _SCHEMA_CREATE_GATEWAY_RATE_LIMIT_OUTPUT.members["status"], self.status - ) - serializer.write_timestamp( - _SCHEMA_CREATE_GATEWAY_RATE_LIMIT_OUTPUT.members["createdAt"], - self.created_at, - ) - serializer.write_timestamp( - _SCHEMA_CREATE_GATEWAY_RATE_LIMIT_OUTPUT.members["updatedAt"], - self.updated_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rate_limit_id"] = de.read_string( - _SCHEMA_CREATE_GATEWAY_RATE_LIMIT_OUTPUT.members["rateLimitId"] - ) - - case 1: - kwargs["gateway_identifier"] = de.read_string( - _SCHEMA_CREATE_GATEWAY_RATE_LIMIT_OUTPUT.members[ - "gatewayIdentifier" - ] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_GATEWAY_RATE_LIMIT_OUTPUT.members["description"] - ) - - case 3: - kwargs["dimension_keys"] = _deserialize_dimension_keys( - de, - _SCHEMA_CREATE_GATEWAY_RATE_LIMIT_OUTPUT.members[ - "dimensionKeys" - ], - ) - - case 4: - kwargs["entries"] = _deserialize_limit_entries( - de, _SCHEMA_CREATE_GATEWAY_RATE_LIMIT_OUTPUT.members["entries"] - ) - - case 5: - kwargs["status"] = GatewayRateLimitStatus( - de.read_string( - _SCHEMA_CREATE_GATEWAY_RATE_LIMIT_OUTPUT.members["status"] - ) - ) - - case 6: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_CREATE_GATEWAY_RATE_LIMIT_OUTPUT.members["createdAt"] - ) - - case 7: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_CREATE_GATEWAY_RATE_LIMIT_OUTPUT.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_GATEWAY_RATE_LIMIT_OUTPUT, consumer=_consumer - ) - if "rate_limit_id" not in kwargs: - kwargs["rate_limit_id"] = "" - if "gateway_identifier" not in kwargs: - kwargs["gateway_identifier"] = "" - if "dimension_keys" not in kwargs: - kwargs["dimension_keys"] = [] - if "entries" not in kwargs: - kwargs["entries"] = [] - if "status" not in kwargs: - kwargs["status"] = GatewayRateLimitStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -CREATE_GATEWAY_RATE_LIMIT = APIOperation( - input=CreateGatewayRateLimitInput, - output=CreateGatewayRateLimitOutput, - schema=_SCHEMA_CREATE_GATEWAY_RATE_LIMIT, - input_schema=_SCHEMA_CREATE_GATEWAY_RATE_LIMIT_INPUT, - output_schema=_SCHEMA_CREATE_GATEWAY_RATE_LIMIT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteGatewayRateLimitInput: - """Dataclass for DeleteGatewayRateLimitInput structure.""" - - gateway_identifier: str | None = None - """The unique identifier of the gateway.""" - - rate_limit_id: str | None = None - """The unique identifier of the rate limit to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_GATEWAY_RATE_LIMIT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.gateway_identifier is not None: - serializer.write_string( - _SCHEMA_DELETE_GATEWAY_RATE_LIMIT_INPUT.members["gatewayIdentifier"], - self.gateway_identifier, - ) - - if self.rate_limit_id is not None: - serializer.write_string( - _SCHEMA_DELETE_GATEWAY_RATE_LIMIT_INPUT.members["rateLimitId"], - self.rate_limit_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["gateway_identifier"] = de.read_string( - _SCHEMA_DELETE_GATEWAY_RATE_LIMIT_INPUT.members[ - "gatewayIdentifier" - ] - ) - - case 1: - kwargs["rate_limit_id"] = de.read_string( - _SCHEMA_DELETE_GATEWAY_RATE_LIMIT_INPUT.members["rateLimitId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_GATEWAY_RATE_LIMIT_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteGatewayRateLimitOutput: - """Dataclass for DeleteGatewayRateLimitOutput structure.""" - - rate_limit_id: str - """The unique identifier of the deleted rate limit.""" - - status: str - """The current status of the rate limit deletion.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_GATEWAY_RATE_LIMIT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DELETE_GATEWAY_RATE_LIMIT_OUTPUT.members["rateLimitId"], - self.rate_limit_id, - ) - serializer.write_string( - _SCHEMA_DELETE_GATEWAY_RATE_LIMIT_OUTPUT.members["status"], self.status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rate_limit_id"] = de.read_string( - _SCHEMA_DELETE_GATEWAY_RATE_LIMIT_OUTPUT.members["rateLimitId"] - ) - - case 1: - kwargs["status"] = GatewayRateLimitStatus( - de.read_string( - _SCHEMA_DELETE_GATEWAY_RATE_LIMIT_OUTPUT.members["status"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_GATEWAY_RATE_LIMIT_OUTPUT, consumer=_consumer - ) - if "rate_limit_id" not in kwargs: - kwargs["rate_limit_id"] = "" - if "status" not in kwargs: - kwargs["status"] = GatewayRateLimitStatus._corrected("") - return kwargs - - -DELETE_GATEWAY_RATE_LIMIT = APIOperation( - input=DeleteGatewayRateLimitInput, - output=DeleteGatewayRateLimitOutput, - schema=_SCHEMA_DELETE_GATEWAY_RATE_LIMIT, - input_schema=_SCHEMA_DELETE_GATEWAY_RATE_LIMIT_INPUT, - output_schema=_SCHEMA_DELETE_GATEWAY_RATE_LIMIT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetGatewayRateLimitInput: - """Dataclass for GetGatewayRateLimitInput structure.""" - - gateway_identifier: str | None = None - """The unique identifier of the gateway.""" - - rate_limit_id: str | None = None - """The unique identifier of the rate limit to retrieve.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_GATEWAY_RATE_LIMIT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.gateway_identifier is not None: - serializer.write_string( - _SCHEMA_GET_GATEWAY_RATE_LIMIT_INPUT.members["gatewayIdentifier"], - self.gateway_identifier, - ) - - if self.rate_limit_id is not None: - serializer.write_string( - _SCHEMA_GET_GATEWAY_RATE_LIMIT_INPUT.members["rateLimitId"], - self.rate_limit_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["gateway_identifier"] = de.read_string( - _SCHEMA_GET_GATEWAY_RATE_LIMIT_INPUT.members[ - "gatewayIdentifier" - ] - ) - - case 1: - kwargs["rate_limit_id"] = de.read_string( - _SCHEMA_GET_GATEWAY_RATE_LIMIT_INPUT.members["rateLimitId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_GATEWAY_RATE_LIMIT_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetGatewayRateLimitOutput: - """Shared fields for `GatewayRateLimit` responses.""" - - rate_limit_id: str - """The unique identifier of the rate limit.""" - - gateway_identifier: str - """The unique identifier of the gateway.""" - - dimension_keys: list[str] - """ - The ordered list of dimension key names that define the scope of this - rate limit. - """ - - entries: list[LimitEntry] - """ - The list of rule entries that map dimension values to rate - configurations. - """ - - status: str - """The current status of the rate limit.""" - - created_at: datetime - """The timestamp when the rate limit was created.""" - - updated_at: datetime - """The timestamp when the rate limit was last updated.""" - - description: str | None = None - """The human-readable description of the rate limit.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_GATEWAY_RATE_LIMIT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_GATEWAY_RATE_LIMIT_OUTPUT.members["rateLimitId"], - self.rate_limit_id, - ) - serializer.write_string( - _SCHEMA_GET_GATEWAY_RATE_LIMIT_OUTPUT.members["gatewayIdentifier"], - self.gateway_identifier, - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_GATEWAY_RATE_LIMIT_OUTPUT.members["description"], - self.description, - ) - - _serialize_dimension_keys( - serializer, - _SCHEMA_GET_GATEWAY_RATE_LIMIT_OUTPUT.members["dimensionKeys"], - self.dimension_keys, - ) - _serialize_limit_entries( - serializer, - _SCHEMA_GET_GATEWAY_RATE_LIMIT_OUTPUT.members["entries"], - self.entries, - ) - serializer.write_string( - _SCHEMA_GET_GATEWAY_RATE_LIMIT_OUTPUT.members["status"], self.status - ) - serializer.write_timestamp( - _SCHEMA_GET_GATEWAY_RATE_LIMIT_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_GET_GATEWAY_RATE_LIMIT_OUTPUT.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rate_limit_id"] = de.read_string( - _SCHEMA_GET_GATEWAY_RATE_LIMIT_OUTPUT.members["rateLimitId"] - ) - - case 1: - kwargs["gateway_identifier"] = de.read_string( - _SCHEMA_GET_GATEWAY_RATE_LIMIT_OUTPUT.members[ - "gatewayIdentifier" - ] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_GET_GATEWAY_RATE_LIMIT_OUTPUT.members["description"] - ) - - case 3: - kwargs["dimension_keys"] = _deserialize_dimension_keys( - de, - _SCHEMA_GET_GATEWAY_RATE_LIMIT_OUTPUT.members["dimensionKeys"], - ) - - case 4: - kwargs["entries"] = _deserialize_limit_entries( - de, _SCHEMA_GET_GATEWAY_RATE_LIMIT_OUTPUT.members["entries"] - ) - - case 5: - kwargs["status"] = GatewayRateLimitStatus( - de.read_string( - _SCHEMA_GET_GATEWAY_RATE_LIMIT_OUTPUT.members["status"] - ) - ) - - case 6: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_GATEWAY_RATE_LIMIT_OUTPUT.members["createdAt"] - ) - - case 7: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_GET_GATEWAY_RATE_LIMIT_OUTPUT.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_GATEWAY_RATE_LIMIT_OUTPUT, consumer=_consumer - ) - if "rate_limit_id" not in kwargs: - kwargs["rate_limit_id"] = "" - if "gateway_identifier" not in kwargs: - kwargs["gateway_identifier"] = "" - if "dimension_keys" not in kwargs: - kwargs["dimension_keys"] = [] - if "entries" not in kwargs: - kwargs["entries"] = [] - if "status" not in kwargs: - kwargs["status"] = GatewayRateLimitStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -GET_GATEWAY_RATE_LIMIT = APIOperation( - input=GetGatewayRateLimitInput, - output=GetGatewayRateLimitOutput, - schema=_SCHEMA_GET_GATEWAY_RATE_LIMIT, - input_schema=_SCHEMA_GET_GATEWAY_RATE_LIMIT_INPUT, - output_schema=_SCHEMA_GET_GATEWAY_RATE_LIMIT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListGatewayRateLimitsInput: - """Dataclass for ListGatewayRateLimitsInput structure.""" - - gateway_identifier: str | None = None - """The unique identifier of the gateway.""" - - max_results: int | None = None - """ - The maximum number of results to return in the response. If the total - number of results is greater than this value, use the token returned in - the response in the `nextToken` field when making another request to - return the next batch of results. - """ - - next_token: str | None = None - """ - The token to use to retrieve the next page of results. Use the value - returned in a previous `ListGatewayRateLimits` response. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_GATEWAY_RATE_LIMITS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.gateway_identifier is not None: - serializer.write_string( - _SCHEMA_LIST_GATEWAY_RATE_LIMITS_INPUT.members["gatewayIdentifier"], - self.gateway_identifier, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_GATEWAY_RATE_LIMITS_INPUT.members["maxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_GATEWAY_RATE_LIMITS_INPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["gateway_identifier"] = de.read_string( - _SCHEMA_LIST_GATEWAY_RATE_LIMITS_INPUT.members[ - "gatewayIdentifier" - ] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_GATEWAY_RATE_LIMITS_INPUT.members["maxResults"] - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_GATEWAY_RATE_LIMITS_INPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_GATEWAY_RATE_LIMITS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ListGatewayRateLimitsOutput: - """Dataclass for ListGatewayRateLimitsOutput structure.""" - - rate_limits: list[GatewayRateLimitDetail] - """The list of rate limits for the gateway.""" - - next_token: str | None = None - """ - The token for the next page of results. If this value is absent, there - are no more results to retrieve. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_GATEWAY_RATE_LIMITS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_gateway_rate_limits( - serializer, - _SCHEMA_LIST_GATEWAY_RATE_LIMITS_OUTPUT.members["rateLimits"], - self.rate_limits, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_GATEWAY_RATE_LIMITS_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rate_limits"] = _deserialize_gateway_rate_limits( - de, - _SCHEMA_LIST_GATEWAY_RATE_LIMITS_OUTPUT.members["rateLimits"], - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_GATEWAY_RATE_LIMITS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_GATEWAY_RATE_LIMITS_OUTPUT, consumer=_consumer - ) - if "rate_limits" not in kwargs: - kwargs["rate_limits"] = [] - return kwargs - - -LIST_GATEWAY_RATE_LIMITS = APIOperation( - input=ListGatewayRateLimitsInput, - output=ListGatewayRateLimitsOutput, - schema=_SCHEMA_LIST_GATEWAY_RATE_LIMITS, - input_schema=_SCHEMA_LIST_GATEWAY_RATE_LIMITS_INPUT, - output_schema=_SCHEMA_LIST_GATEWAY_RATE_LIMITS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateGatewayRateLimitInput: - """Dataclass for UpdateGatewayRateLimitInput structure.""" - - gateway_identifier: str | None = None - """The unique identifier of the gateway.""" - - rate_limit_id: str | None = None - """The unique identifier of the rate limit to update.""" - - description: str | None = None - """The updated human-readable description for this rate limit.""" - - entries: list[LimitEntry] | None = None - """ - The updated rule entries. The dimension keys are immutable after - creation and cannot be changed. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_GATEWAY_RATE_LIMIT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.gateway_identifier is not None: - serializer.write_string( - _SCHEMA_UPDATE_GATEWAY_RATE_LIMIT_INPUT.members["gatewayIdentifier"], - self.gateway_identifier, - ) - - if self.rate_limit_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_GATEWAY_RATE_LIMIT_INPUT.members["rateLimitId"], - self.rate_limit_id, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_GATEWAY_RATE_LIMIT_INPUT.members["description"], - self.description, - ) - - if self.entries is not None: - _serialize_limit_entries( - serializer, - _SCHEMA_UPDATE_GATEWAY_RATE_LIMIT_INPUT.members["entries"], - self.entries, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["gateway_identifier"] = de.read_string( - _SCHEMA_UPDATE_GATEWAY_RATE_LIMIT_INPUT.members[ - "gatewayIdentifier" - ] - ) - - case 1: - kwargs["rate_limit_id"] = de.read_string( - _SCHEMA_UPDATE_GATEWAY_RATE_LIMIT_INPUT.members["rateLimitId"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_GATEWAY_RATE_LIMIT_INPUT.members["description"] - ) - - case 3: - kwargs["entries"] = _deserialize_limit_entries( - de, _SCHEMA_UPDATE_GATEWAY_RATE_LIMIT_INPUT.members["entries"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_GATEWAY_RATE_LIMIT_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateGatewayRateLimitOutput: - """Shared fields for `GatewayRateLimit` responses.""" - - rate_limit_id: str - """The unique identifier of the rate limit.""" - - gateway_identifier: str - """The unique identifier of the gateway.""" - - dimension_keys: list[str] - """ - The ordered list of dimension key names that define the scope of this - rate limit. - """ - - entries: list[LimitEntry] - """ - The list of rule entries that map dimension values to rate - configurations. - """ - - status: str - """The current status of the rate limit.""" - - created_at: datetime - """The timestamp when the rate limit was created.""" - - updated_at: datetime - """The timestamp when the rate limit was last updated.""" - - description: str | None = None - """The human-readable description of the rate limit.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_GATEWAY_RATE_LIMIT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_UPDATE_GATEWAY_RATE_LIMIT_OUTPUT.members["rateLimitId"], - self.rate_limit_id, - ) - serializer.write_string( - _SCHEMA_UPDATE_GATEWAY_RATE_LIMIT_OUTPUT.members["gatewayIdentifier"], - self.gateway_identifier, - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_GATEWAY_RATE_LIMIT_OUTPUT.members["description"], - self.description, - ) - - _serialize_dimension_keys( - serializer, - _SCHEMA_UPDATE_GATEWAY_RATE_LIMIT_OUTPUT.members["dimensionKeys"], - self.dimension_keys, - ) - _serialize_limit_entries( - serializer, - _SCHEMA_UPDATE_GATEWAY_RATE_LIMIT_OUTPUT.members["entries"], - self.entries, - ) - serializer.write_string( - _SCHEMA_UPDATE_GATEWAY_RATE_LIMIT_OUTPUT.members["status"], self.status - ) - serializer.write_timestamp( - _SCHEMA_UPDATE_GATEWAY_RATE_LIMIT_OUTPUT.members["createdAt"], - self.created_at, - ) - serializer.write_timestamp( - _SCHEMA_UPDATE_GATEWAY_RATE_LIMIT_OUTPUT.members["updatedAt"], - self.updated_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rate_limit_id"] = de.read_string( - _SCHEMA_UPDATE_GATEWAY_RATE_LIMIT_OUTPUT.members["rateLimitId"] - ) - - case 1: - kwargs["gateway_identifier"] = de.read_string( - _SCHEMA_UPDATE_GATEWAY_RATE_LIMIT_OUTPUT.members[ - "gatewayIdentifier" - ] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_GATEWAY_RATE_LIMIT_OUTPUT.members["description"] - ) - - case 3: - kwargs["dimension_keys"] = _deserialize_dimension_keys( - de, - _SCHEMA_UPDATE_GATEWAY_RATE_LIMIT_OUTPUT.members[ - "dimensionKeys" - ], - ) - - case 4: - kwargs["entries"] = _deserialize_limit_entries( - de, _SCHEMA_UPDATE_GATEWAY_RATE_LIMIT_OUTPUT.members["entries"] - ) - - case 5: - kwargs["status"] = GatewayRateLimitStatus( - de.read_string( - _SCHEMA_UPDATE_GATEWAY_RATE_LIMIT_OUTPUT.members["status"] - ) - ) - - case 6: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_UPDATE_GATEWAY_RATE_LIMIT_OUTPUT.members["createdAt"] - ) - - case 7: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_UPDATE_GATEWAY_RATE_LIMIT_OUTPUT.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_GATEWAY_RATE_LIMIT_OUTPUT, consumer=_consumer - ) - if "rate_limit_id" not in kwargs: - kwargs["rate_limit_id"] = "" - if "gateway_identifier" not in kwargs: - kwargs["gateway_identifier"] = "" - if "dimension_keys" not in kwargs: - kwargs["dimension_keys"] = [] - if "entries" not in kwargs: - kwargs["entries"] = [] - if "status" not in kwargs: - kwargs["status"] = GatewayRateLimitStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -UPDATE_GATEWAY_RATE_LIMIT = APIOperation( - input=UpdateGatewayRateLimitInput, - output=UpdateGatewayRateLimitOutput, - schema=_SCHEMA_UPDATE_GATEWAY_RATE_LIMIT, - input_schema=_SCHEMA_UPDATE_GATEWAY_RATE_LIMIT_INPUT, - output_schema=_SCHEMA_UPDATE_GATEWAY_RATE_LIMIT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class AuthorizerType(UnknownEnumMixin, StrEnum): - CUSTOM_JWT = "CUSTOM_JWT" - AWS_IAM = "AWS_IAM" - NONE = "NONE" - AUTHENTICATE_ONLY = "AUTHENTICATE_ONLY" - - -class ExceptionLevel(UnknownEnumMixin, StrEnum): - DEBUG = "DEBUG" - - -class InterceptorPayloadExclusion(UnknownEnumMixin, StrEnum): - RESPONSE_BODY = "RESPONSE_BODY" - - -@dataclass -class InterceptorPayloadExclusionSelectorField: - """The field to exclude from the interceptor input.""" - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INTERCEPTOR_PAYLOAD_EXCLUSION_SELECTOR, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_INTERCEPTOR_PAYLOAD_EXCLUSION_SELECTOR.members["field"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=InterceptorPayloadExclusion( - deserializer.read_string( - _SCHEMA_INTERCEPTOR_PAYLOAD_EXCLUSION_SELECTOR.members["field"] - ) - ) - ) - - -@dataclass -class InterceptorPayloadExclusionSelectorUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -InterceptorPayloadExclusionSelector = Union[ - InterceptorPayloadExclusionSelectorField - | InterceptorPayloadExclusionSelectorUnknown -] -""" -A selector that identifies a payload field to exclude from the -interceptor input. -""" - - -class _InterceptorPayloadExclusionSelectorDeserializer: - _result: InterceptorPayloadExclusionSelector | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> InterceptorPayloadExclusionSelector: - self._result = None - deserializer.read_struct( - _SCHEMA_INTERCEPTOR_PAYLOAD_EXCLUSION_SELECTOR, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - InterceptorPayloadExclusionSelectorField.deserialize(de) - ) - - case _: - self._set_result( - InterceptorPayloadExclusionSelectorUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: InterceptorPayloadExclusionSelector) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_interceptor_payload_exclusion_selector_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[InterceptorPayloadExclusionSelector], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_interceptor_payload_exclusion_selector_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[InterceptorPayloadExclusionSelector]: - result: list[InterceptorPayloadExclusionSelector] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append( - _InterceptorPayloadExclusionSelectorDeserializer().deserialize(d) - ) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class InterceptorPayloadFilter: - """ - The filter that controls which fields of the request or response payload - are included in the input to the interceptor. - """ - - exclude: list[InterceptorPayloadExclusionSelector] - """ - The list of selectors that identify payload fields to exclude from the - interceptor input. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INTERCEPTOR_PAYLOAD_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_interceptor_payload_exclusion_selector_list( - serializer, - _SCHEMA_INTERCEPTOR_PAYLOAD_FILTER.members["exclude"], - self.exclude, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["exclude"] = ( - _deserialize_interceptor_payload_exclusion_selector_list( - de, _SCHEMA_INTERCEPTOR_PAYLOAD_FILTER.members["exclude"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INTERCEPTOR_PAYLOAD_FILTER, consumer=_consumer) - if "exclude" not in kwargs: - kwargs["exclude"] = [] - return kwargs - - -@dataclass(kw_only=True) -class InterceptorInputConfiguration: - """The input configuration of the interceptor.""" - - pass_request_headers: bool - """ - Indicates whether to pass request headers as input into the interceptor. - When set to true, request headers will be passed. - """ - - payload_filter: InterceptorPayloadFilter | None = None - """ - The filter that determines which parts of the request or response - payload are passed as input to the interceptor. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INTERCEPTOR_INPUT_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_boolean( - _SCHEMA_INTERCEPTOR_INPUT_CONFIGURATION.members["passRequestHeaders"], - self.pass_request_headers, - ) - if self.payload_filter is not None: - serializer.write_struct( - _SCHEMA_INTERCEPTOR_INPUT_CONFIGURATION.members["payloadFilter"], - self.payload_filter, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["pass_request_headers"] = de.read_boolean( - _SCHEMA_INTERCEPTOR_INPUT_CONFIGURATION.members[ - "passRequestHeaders" - ] - ) - - case 1: - kwargs["payload_filter"] = InterceptorPayloadFilter.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INTERCEPTOR_INPUT_CONFIGURATION, consumer=_consumer - ) - if "pass_request_headers" not in kwargs: - kwargs["pass_request_headers"] = False - return kwargs - - -class GatewayInterceptionPoint(UnknownEnumMixin, StrEnum): - REQUEST = "REQUEST" - RESPONSE = "RESPONSE" - - -def _serialize_gateway_interception_points( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_gateway_interception_points( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GatewayInterceptionPoint(d.read_string(member_schema))) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class LambdaInterceptorConfiguration: - """The lambda configuration for the interceptor""" - - arn: str - """The arn of the lambda function to be invoked for the interceptor.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LAMBDA_INTERCEPTOR_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_LAMBDA_INTERCEPTOR_CONFIGURATION.members["arn"], self.arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["arn"] = de.read_string( - _SCHEMA_LAMBDA_INTERCEPTOR_CONFIGURATION.members["arn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LAMBDA_INTERCEPTOR_CONFIGURATION, consumer=_consumer - ) - if "arn" not in kwargs: - kwargs["arn"] = "" - return kwargs - - -@dataclass -class InterceptorConfigurationLambda: - """The details of the lambda function used for the interceptor.""" - - value: LambdaInterceptorConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INTERCEPTOR_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INTERCEPTOR_CONFIGURATION.members["lambda"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=LambdaInterceptorConfiguration.deserialize(deserializer)) - - -@dataclass -class InterceptorConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -InterceptorConfiguration = Union[ - InterceptorConfigurationLambda | InterceptorConfigurationUnknown -] -"""The interceptor configuration.""" - - -class _InterceptorConfigurationDeserializer: - _result: InterceptorConfiguration | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> InterceptorConfiguration: - self._result = None - deserializer.read_struct(_SCHEMA_INTERCEPTOR_CONFIGURATION, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(InterceptorConfigurationLambda.deserialize(de)) - - case _: - self._set_result( - InterceptorConfigurationUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: InterceptorConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class GatewayInterceptorConfiguration: - """ - The configuration for an interceptor on a gateway. This structure - defines settings for an interceptor that will be invoked during the - invocation of the gateway. - """ - - interceptor: InterceptorConfiguration - """ - The infrastructure settings of an interceptor configuration. This - structure defines how the interceptor can be invoked. - """ - - interception_points: list[str] - """ - The supported points of interception. This field specifies which points - during the gateway invocation to invoke the interceptor - """ - - input_configuration: InterceptorInputConfiguration | None = None - """ - The configuration for the input of the interceptor. This field specifies - how the input to the interceptor is constructed - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GATEWAY_INTERCEPTOR_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GATEWAY_INTERCEPTOR_CONFIGURATION.members["interceptor"], - self.interceptor, - ) - _serialize_gateway_interception_points( - serializer, - _SCHEMA_GATEWAY_INTERCEPTOR_CONFIGURATION.members["interceptionPoints"], - self.interception_points, - ) - if self.input_configuration is not None: - serializer.write_struct( - _SCHEMA_GATEWAY_INTERCEPTOR_CONFIGURATION.members["inputConfiguration"], - self.input_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["interceptor"] = ( - _InterceptorConfigurationDeserializer().deserialize(de) - ) - - case 1: - kwargs["interception_points"] = ( - _deserialize_gateway_interception_points( - de, - _SCHEMA_GATEWAY_INTERCEPTOR_CONFIGURATION.members[ - "interceptionPoints" - ], - ) - ) - - case 2: - kwargs["input_configuration"] = ( - InterceptorInputConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GATEWAY_INTERCEPTOR_CONFIGURATION, consumer=_consumer - ) - if "interceptor" not in kwargs: - kwargs["interceptor"] = InterceptorConfigurationUnknown(tag="") - if "interception_points" not in kwargs: - kwargs["interception_points"] = [] - return kwargs - - -def _serialize_gateway_interceptor_configurations( - serializer: ShapeSerializer, - schema: Schema, - value: list[GatewayInterceptorConfiguration], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_gateway_interceptor_configurations( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GatewayInterceptorConfiguration]: - result: list[GatewayInterceptorConfiguration] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GatewayInterceptorConfiguration.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class GatewayPolicyEngineMode(UnknownEnumMixin, StrEnum): - LOG_ONLY = "LOG_ONLY" - ENFORCE = "ENFORCE" - - -@dataclass(kw_only=True) -class GatewayPolicyEngineConfiguration: - """ - The configuration for a policy engine associated with a gateway. A - policy engine is a collection of policies that evaluates and authorizes - agent tool calls. When associated with a gateway, the policy engine - intercepts all agent requests and determines whether to allow or deny - each action based on the defined policies. - """ - - arn: str - """ - The ARN of the policy engine. The policy engine contains Cedar or - Dogwood policies that define fine-grained authorization rules specifying - who can perform what actions on which resources as agents interact - through the gateway. - """ - - mode: str - """ - The enforcement mode for the policy engine. Valid values include: - - - `LOG_ONLY` - The policy engine evaluates each action against your - policies and adds traces on whether tool calls would be allowed or - denied, but does not enforce the decision. Use this mode to test and - validate policies before enabling enforcement. - - - `ENFORCE` - The policy engine evaluates actions against your policies - and enforces decisions by allowing or denying agent operations. Test - and validate policies in `LOG_ONLY` mode before enabling enforcement - to avoid unintended denials or adversely affecting production traffic. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GATEWAY_POLICY_ENGINE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GATEWAY_POLICY_ENGINE_CONFIGURATION.members["arn"], self.arn - ) - serializer.write_string( - _SCHEMA_GATEWAY_POLICY_ENGINE_CONFIGURATION.members["mode"], self.mode - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["arn"] = de.read_string( - _SCHEMA_GATEWAY_POLICY_ENGINE_CONFIGURATION.members["arn"] - ) - - case 1: - kwargs["mode"] = GatewayPolicyEngineMode( - de.read_string( - _SCHEMA_GATEWAY_POLICY_ENGINE_CONFIGURATION.members["mode"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GATEWAY_POLICY_ENGINE_CONFIGURATION, consumer=_consumer - ) - if "arn" not in kwargs: - kwargs["arn"] = "" - if "mode" not in kwargs: - kwargs["mode"] = GatewayPolicyEngineMode._corrected("") - return kwargs - - -class SearchType(UnknownEnumMixin, StrEnum): - SEMANTIC = "SEMANTIC" - - -@dataclass(kw_only=True) -class SessionConfiguration: - """ - The session configuration for an MCP gateway. This structure defines - settings that control session behavior. - """ - - session_timeout_in_seconds: int | None = None - """ - The session timeout in seconds. After this timeout, the session expires - and subsequent requests to this session will receive an error. The - minimum value is 900 seconds (15 minutes), the maximum value is 28800 - seconds (8 hours), and the default value is 3600 seconds (1 hour). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SESSION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.session_timeout_in_seconds is not None: - serializer.write_integer( - _SCHEMA_SESSION_CONFIGURATION.members["sessionTimeoutInSeconds"], - self.session_timeout_in_seconds, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["session_timeout_in_seconds"] = de.read_integer( - _SCHEMA_SESSION_CONFIGURATION.members["sessionTimeoutInSeconds"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SESSION_CONFIGURATION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class StreamingConfiguration: - """ - The streaming configuration for an MCP gateway. This structure defines - settings that control response streaming behavior. - """ - - enable_response_streaming: bool | None = None - """ - Indicates whether response streaming is enabled for the gateway. When - set to `true`, the gateway streams responses from targets back to the - client. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STREAMING_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.enable_response_streaming is not None: - serializer.write_boolean( - _SCHEMA_STREAMING_CONFIGURATION.members["enableResponseStreaming"], - self.enable_response_streaming, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["enable_response_streaming"] = de.read_boolean( - _SCHEMA_STREAMING_CONFIGURATION.members[ - "enableResponseStreaming" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_STREAMING_CONFIGURATION, consumer=_consumer) - return kwargs - - -def _serialize_mcp_supported_versions( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_mcp_supported_versions( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class MCPGatewayConfiguration: - """ - The configuration for a Model Context Protocol (MCP) gateway. This - structure defines how the gateway implements the MCP protocol. - """ - - supported_versions: list[str] | None = None - """ - The supported versions of the Model Context Protocol. This field - specifies which versions of the protocol the gateway can use. - """ - - instructions: str | None = field(repr=False, default=None) - """ - The instructions for using the Model Context Protocol gateway. These - instructions provide guidance on how to interact with the gateway. - """ - - search_type: str | None = None - """ - The search type for the Model Context Protocol gateway. This field - specifies how the gateway handles search operations. - """ - - session_configuration: SessionConfiguration | None = None - """ - The session configuration for the MCP gateway. This configuration - controls session behavior, including session timeout settings. - """ - - streaming_configuration: StreamingConfiguration | None = None - """ - The streaming configuration for the MCP gateway. This configuration - controls whether response streaming is enabled for the gateway. - """ - - disable_mcp_list_tools_pagination: bool | None = None - """ - Specifies whether pagination is disabled for the Model Context Protocol - (MCP) `tools/list` operation. When set to `true`, the gateway returns - the complete list of tools in a single response without a pagination - cursor. When set to `false` or omitted, the gateway returns tools in - paginated responses. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MCP_GATEWAY_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.supported_versions is not None: - _serialize_mcp_supported_versions( - serializer, - _SCHEMA_MCP_GATEWAY_CONFIGURATION.members["supportedVersions"], - self.supported_versions, - ) - - if self.instructions is not None: - serializer.write_string( - _SCHEMA_MCP_GATEWAY_CONFIGURATION.members["instructions"], - self.instructions, - ) - - if self.search_type is not None: - serializer.write_string( - _SCHEMA_MCP_GATEWAY_CONFIGURATION.members["searchType"], - self.search_type, - ) - - if self.session_configuration is not None: - serializer.write_struct( - _SCHEMA_MCP_GATEWAY_CONFIGURATION.members["sessionConfiguration"], - self.session_configuration, - ) - - if self.streaming_configuration is not None: - serializer.write_struct( - _SCHEMA_MCP_GATEWAY_CONFIGURATION.members["streamingConfiguration"], - self.streaming_configuration, - ) - - if self.disable_mcp_list_tools_pagination is not None: - serializer.write_boolean( - _SCHEMA_MCP_GATEWAY_CONFIGURATION.members[ - "disableMcpListToolsPagination" - ], - self.disable_mcp_list_tools_pagination, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["supported_versions"] = _deserialize_mcp_supported_versions( - de, - _SCHEMA_MCP_GATEWAY_CONFIGURATION.members["supportedVersions"], - ) - - case 1: - kwargs["instructions"] = de.read_string( - _SCHEMA_MCP_GATEWAY_CONFIGURATION.members["instructions"] - ) - - case 2: - kwargs["search_type"] = SearchType( - de.read_string( - _SCHEMA_MCP_GATEWAY_CONFIGURATION.members["searchType"] - ) - ) - - case 3: - kwargs["session_configuration"] = SessionConfiguration.deserialize( - de - ) - - case 4: - kwargs["streaming_configuration"] = ( - StreamingConfiguration.deserialize(de) - ) - - case 5: - kwargs["disable_mcp_list_tools_pagination"] = de.read_boolean( - _SCHEMA_MCP_GATEWAY_CONFIGURATION.members[ - "disableMcpListToolsPagination" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MCP_GATEWAY_CONFIGURATION, consumer=_consumer) - return kwargs - - -@dataclass -class GatewayProtocolConfigurationMcp: - """ - The configuration for the Model Context Protocol (MCP). This protocol - enables communication between Amazon Bedrock Agent and external tools. - """ - - value: MCPGatewayConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GATEWAY_PROTOCOL_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GATEWAY_PROTOCOL_CONFIGURATION.members["mcp"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=MCPGatewayConfiguration.deserialize(deserializer)) - - -@dataclass -class GatewayProtocolConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -GatewayProtocolConfiguration = Union[ - GatewayProtocolConfigurationMcp | GatewayProtocolConfigurationUnknown -] -""" -The configuration for a gateway protocol. This structure defines how the -gateway communicates with external services. -""" - - -class _GatewayProtocolConfigurationDeserializer: - _result: GatewayProtocolConfiguration | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> GatewayProtocolConfiguration: - self._result = None - deserializer.read_struct(_SCHEMA_GATEWAY_PROTOCOL_CONFIGURATION, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(GatewayProtocolConfigurationMcp.deserialize(de)) - - case _: - self._set_result( - GatewayProtocolConfigurationUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: GatewayProtocolConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class GatewayProtocolType(UnknownEnumMixin, StrEnum): - MCP = "MCP" - - -@dataclass(kw_only=True) -class CreateGatewayInput: - """Dataclass for CreateGatewayInput structure.""" - - name: str | None = None - """The name of the gateway. The name must be unique within your account.""" - - description: str | None = field(repr=False, default=None) - """The description of the gateway.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If you don't specify this field, a - value is randomly generated for you. If this token matches a previous - request, the service ignores the request, but doesn't return an error. - For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - role_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the IAM role that provides permissions - for the gateway to access Amazon Web Services services. - """ - - protocol_type: str = GatewayProtocolType("MCP") - """The protocol type for the gateway.""" - - protocol_configuration: GatewayProtocolConfiguration | None = None - """ - The configuration settings for the protocol specified in the - `protocolType` parameter. - """ - - authorizer_type: str | None = None - """ - The type of authorizer to use for the gateway. - - - `CUSTOM_JWT` - Authorize with a bearer token. - - - `AWS_IAM` - Authorize with your Amazon Web Services IAM credentials. - - - `NONE` - No authorization - """ - - authorizer_configuration: AuthorizerConfiguration | None = None - """ - The authorizer configuration for the gateway. Required if - `authorizerType` is `CUSTOM_JWT`. - """ - - kms_key_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the KMS key used to encrypt data - associated with the gateway. - """ - - interceptor_configurations: list[GatewayInterceptorConfiguration] | None = None - """ - A list of configuration settings for a gateway interceptor. Gateway - interceptors allow custom code to be invoked during gateway invocations. - """ - - policy_engine_configuration: GatewayPolicyEngineConfiguration | None = None - """ - The policy engine configuration for the gateway. A policy engine is a - collection of policies that evaluates and authorizes agent tool calls. - When associated with a gateway, the policy engine intercepts all agent - requests and determines whether to allow or deny each action based on - the defined policies. - """ - - exception_level: str | None = None - """ - The level of detail in error messages returned when invoking the - gateway. - - - If the value is `DEBUG`, granular exception messages are returned to - help a user debug the gateway. - - - If the value is omitted, a generic error message is returned to the - end user. - """ - - tags: dict[str, str] | None = None - """A map of key-value pairs to associate with the gateway as metadata tags.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_GATEWAY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_GATEWAY_INPUT.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_GATEWAY_INPUT.members["description"], self.description - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_GATEWAY_INPUT.members["clientToken"], self.client_token - ) - - if self.role_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_GATEWAY_INPUT.members["roleArn"], self.role_arn - ) - - if self.protocol_type is not None: - serializer.write_string( - _SCHEMA_CREATE_GATEWAY_INPUT.members["protocolType"], self.protocol_type - ) - - if self.protocol_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_GATEWAY_INPUT.members["protocolConfiguration"], - self.protocol_configuration, - ) - - if self.authorizer_type is not None: - serializer.write_string( - _SCHEMA_CREATE_GATEWAY_INPUT.members["authorizerType"], - self.authorizer_type, - ) - - if self.authorizer_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_GATEWAY_INPUT.members["authorizerConfiguration"], - self.authorizer_configuration, - ) - - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_GATEWAY_INPUT.members["kmsKeyArn"], self.kms_key_arn - ) - - if self.interceptor_configurations is not None: - _serialize_gateway_interceptor_configurations( - serializer, - _SCHEMA_CREATE_GATEWAY_INPUT.members["interceptorConfigurations"], - self.interceptor_configurations, - ) - - if self.policy_engine_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_GATEWAY_INPUT.members["policyEngineConfiguration"], - self.policy_engine_configuration, - ) - - if self.exception_level is not None: - serializer.write_string( - _SCHEMA_CREATE_GATEWAY_INPUT.members["exceptionLevel"], - self.exception_level, - ) - - if self.tags is not None: - _serialize_tags_map( - serializer, _SCHEMA_CREATE_GATEWAY_INPUT.members["tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_GATEWAY_INPUT.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_GATEWAY_INPUT.members["description"] - ) - - case 2: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_GATEWAY_INPUT.members["clientToken"] - ) - - case 3: - kwargs["role_arn"] = de.read_string( - _SCHEMA_CREATE_GATEWAY_INPUT.members["roleArn"] - ) - - case 4: - kwargs["protocol_type"] = GatewayProtocolType( - de.read_string( - _SCHEMA_CREATE_GATEWAY_INPUT.members["protocolType"] - ) - ) - - case 5: - kwargs["protocol_configuration"] = ( - _GatewayProtocolConfigurationDeserializer().deserialize(de) - ) - - case 6: - kwargs["authorizer_type"] = AuthorizerType( - de.read_string( - _SCHEMA_CREATE_GATEWAY_INPUT.members["authorizerType"] - ) - ) - - case 7: - kwargs["authorizer_configuration"] = ( - _AuthorizerConfigurationDeserializer().deserialize(de) - ) - - case 8: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_CREATE_GATEWAY_INPUT.members["kmsKeyArn"] - ) - - case 9: - kwargs["interceptor_configurations"] = ( - _deserialize_gateway_interceptor_configurations( - de, - _SCHEMA_CREATE_GATEWAY_INPUT.members[ - "interceptorConfigurations" - ], - ) - ) - - case 10: - kwargs["policy_engine_configuration"] = ( - GatewayPolicyEngineConfiguration.deserialize(de) - ) - - case 11: - kwargs["exception_level"] = ExceptionLevel( - de.read_string( - _SCHEMA_CREATE_GATEWAY_INPUT.members["exceptionLevel"] - ) - ) - - case 12: - kwargs["tags"] = _deserialize_tags_map( - de, _SCHEMA_CREATE_GATEWAY_INPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_GATEWAY_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class LambdaTransformConfiguration: - """ - The Lambda configuration for custom transformations. This structure - defines the Lambda function that the gateway invokes to transform data. - """ - - arn: str | None = None - """ - The Amazon Resource Name (ARN) of the Lambda function. This function is - invoked by the gateway to transform data. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LAMBDA_TRANSFORM_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.arn is not None: - serializer.write_string( - _SCHEMA_LAMBDA_TRANSFORM_CONFIGURATION.members["arn"], self.arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["arn"] = de.read_string( - _SCHEMA_LAMBDA_TRANSFORM_CONFIGURATION.members["arn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LAMBDA_TRANSFORM_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CustomTransformConfiguration: - """ - The configuration for custom transformations applied to requests and - responses through the gateway. This structure defines how the gateway - transforms data. - """ - - lambda_: LambdaTransformConfiguration | None = None - """ - The Lambda configuration for custom transformations. This configuration - defines how the gateway uses a Lambda function to transform data. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOM_TRANSFORM_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.lambda_ is not None: - serializer.write_struct( - _SCHEMA_CUSTOM_TRANSFORM_CONFIGURATION.members["lambda"], self.lambda_ - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["lambda_"] = LambdaTransformConfiguration.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CUSTOM_TRANSFORM_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -class GatewayStatus(UnknownEnumMixin, StrEnum): - CREATING = "CREATING" - UPDATING = "UPDATING" - UPDATE_UNSUCCESSFUL = "UPDATE_UNSUCCESSFUL" - DELETING = "DELETING" - READY = "READY" - FAILED = "FAILED" - - -def _serialize_status_reasons( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_status_reasons( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -class WafFailureMode(UnknownEnumMixin, StrEnum): - FAIL_CLOSE = "FAIL_CLOSE" - FAIL_OPEN = "FAIL_OPEN" - - -@dataclass(kw_only=True) -class WafConfiguration: - """ - The Amazon Web Services WAF configuration for the gateway. This - configuration controls how the gateway behaves when the associated web - ACL cannot be evaluated. - """ - - failure_mode: str | None = None - """ - The failure mode that determines how the gateway handles requests when - Amazon Web Services WAF is unreachable or times out. Valid values - include: - - - `FAIL_CLOSE` - The gateway blocks requests when Amazon Web Services - WAF cannot be evaluated. - - - `FAIL_OPEN` - The gateway allows requests when Amazon Web Services WAF - cannot be evaluated. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_WAF_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.failure_mode is not None: - serializer.write_string( - _SCHEMA_WAF_CONFIGURATION.members["failureMode"], self.failure_mode - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["failure_mode"] = WafFailureMode( - de.read_string(_SCHEMA_WAF_CONFIGURATION.members["failureMode"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_WAF_CONFIGURATION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CreateGatewayOutput: - """Dataclass for CreateGatewayOutput structure.""" - - gateway_arn: str - """The Amazon Resource Name (ARN) of the created gateway.""" - - gateway_id: str - """The unique identifier of the created gateway.""" - - created_at: datetime - """The timestamp when the gateway was created.""" - - updated_at: datetime - """The timestamp when the gateway was last updated.""" - - status: str - """The current status of the gateway.""" - - name: str - """The name of the gateway.""" - - authorizer_type: str - """The type of authorizer used by the gateway.""" - - gateway_url: str | None = None - """The URL endpoint for the created gateway.""" - - status_reasons: list[str] | None = None - """The reasons for the current status of the gateway.""" - - description: str | None = field(repr=False, default=None) - """The description of the gateway.""" - - role_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the IAM role associated with the - gateway. - """ - - protocol_type: str = GatewayProtocolType("MCP") - """The protocol type of the gateway.""" - - protocol_configuration: GatewayProtocolConfiguration | None = None - """The configuration settings for the protocol used by the gateway.""" - - authorizer_configuration: AuthorizerConfiguration | None = None - """The authorizer configuration for the created gateway.""" - - kms_key_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the KMS key used to encrypt data - associated with the gateway. - """ - - custom_transform_configuration: CustomTransformConfiguration | None = None - """ - The custom transformation configuration for the gateway. This - configuration defines how the gateway transforms requests and responses. - """ - - interceptor_configurations: list[GatewayInterceptorConfiguration] | None = None - """The list of interceptor configurations for the created gateway.""" - - policy_engine_configuration: GatewayPolicyEngineConfiguration | None = None - """The policy engine configuration for the created gateway.""" - - workload_identity_details: WorkloadIdentityDetails | None = None - """The workload identity details for the created gateway.""" - - exception_level: str | None = None - """ - The level of detail in error messages returned when invoking the - gateway. - - - If the value is `DEBUG`, granular exception messages are returned to - help a user debug the gateway. - - - If the value is omitted, a generic error message is returned to the - end user. - """ - - web_acl_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the Amazon Web Services WAF web ACL - associated with the gateway. - """ - - waf_configuration: WafConfiguration | None = None - """The Amazon Web Services WAF configuration for the gateway.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_GATEWAY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_GATEWAY_OUTPUT.members["gatewayArn"], self.gateway_arn - ) - serializer.write_string( - _SCHEMA_CREATE_GATEWAY_OUTPUT.members["gatewayId"], self.gateway_id - ) - if self.gateway_url is not None: - serializer.write_string( - _SCHEMA_CREATE_GATEWAY_OUTPUT.members["gatewayUrl"], self.gateway_url - ) - - serializer.write_timestamp( - _SCHEMA_CREATE_GATEWAY_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_CREATE_GATEWAY_OUTPUT.members["updatedAt"], self.updated_at - ) - serializer.write_string( - _SCHEMA_CREATE_GATEWAY_OUTPUT.members["status"], self.status - ) - if self.status_reasons is not None: - _serialize_status_reasons( - serializer, - _SCHEMA_CREATE_GATEWAY_OUTPUT.members["statusReasons"], - self.status_reasons, - ) - - serializer.write_string( - _SCHEMA_CREATE_GATEWAY_OUTPUT.members["name"], self.name - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_GATEWAY_OUTPUT.members["description"], self.description - ) - - if self.role_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_GATEWAY_OUTPUT.members["roleArn"], self.role_arn - ) - - serializer.write_string( - _SCHEMA_CREATE_GATEWAY_OUTPUT.members["protocolType"], self.protocol_type - ) - if self.protocol_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_GATEWAY_OUTPUT.members["protocolConfiguration"], - self.protocol_configuration, - ) - - serializer.write_string( - _SCHEMA_CREATE_GATEWAY_OUTPUT.members["authorizerType"], - self.authorizer_type, - ) - if self.authorizer_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_GATEWAY_OUTPUT.members["authorizerConfiguration"], - self.authorizer_configuration, - ) - - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_GATEWAY_OUTPUT.members["kmsKeyArn"], self.kms_key_arn - ) - - if self.custom_transform_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_GATEWAY_OUTPUT.members["customTransformConfiguration"], - self.custom_transform_configuration, - ) - - if self.interceptor_configurations is not None: - _serialize_gateway_interceptor_configurations( - serializer, - _SCHEMA_CREATE_GATEWAY_OUTPUT.members["interceptorConfigurations"], - self.interceptor_configurations, - ) - - if self.policy_engine_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_GATEWAY_OUTPUT.members["policyEngineConfiguration"], - self.policy_engine_configuration, - ) - - if self.workload_identity_details is not None: - serializer.write_struct( - _SCHEMA_CREATE_GATEWAY_OUTPUT.members["workloadIdentityDetails"], - self.workload_identity_details, - ) - - if self.exception_level is not None: - serializer.write_string( - _SCHEMA_CREATE_GATEWAY_OUTPUT.members["exceptionLevel"], - self.exception_level, - ) - - if self.web_acl_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_GATEWAY_OUTPUT.members["webAclArn"], self.web_acl_arn - ) - - if self.waf_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_GATEWAY_OUTPUT.members["wafConfiguration"], - self.waf_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["gateway_arn"] = de.read_string( - _SCHEMA_CREATE_GATEWAY_OUTPUT.members["gatewayArn"] - ) - - case 1: - kwargs["gateway_id"] = de.read_string( - _SCHEMA_CREATE_GATEWAY_OUTPUT.members["gatewayId"] - ) - - case 2: - kwargs["gateway_url"] = de.read_string( - _SCHEMA_CREATE_GATEWAY_OUTPUT.members["gatewayUrl"] - ) - - case 3: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_CREATE_GATEWAY_OUTPUT.members["createdAt"] - ) - - case 4: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_CREATE_GATEWAY_OUTPUT.members["updatedAt"] - ) - - case 5: - kwargs["status"] = GatewayStatus( - de.read_string(_SCHEMA_CREATE_GATEWAY_OUTPUT.members["status"]) - ) - - case 6: - kwargs["status_reasons"] = _deserialize_status_reasons( - de, _SCHEMA_CREATE_GATEWAY_OUTPUT.members["statusReasons"] - ) - - case 7: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_GATEWAY_OUTPUT.members["name"] - ) - - case 8: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_GATEWAY_OUTPUT.members["description"] - ) - - case 9: - kwargs["role_arn"] = de.read_string( - _SCHEMA_CREATE_GATEWAY_OUTPUT.members["roleArn"] - ) - - case 10: - kwargs["protocol_type"] = GatewayProtocolType( - de.read_string( - _SCHEMA_CREATE_GATEWAY_OUTPUT.members["protocolType"] - ) - ) - - case 11: - kwargs["protocol_configuration"] = ( - _GatewayProtocolConfigurationDeserializer().deserialize(de) - ) - - case 12: - kwargs["authorizer_type"] = AuthorizerType( - de.read_string( - _SCHEMA_CREATE_GATEWAY_OUTPUT.members["authorizerType"] - ) - ) - - case 13: - kwargs["authorizer_configuration"] = ( - _AuthorizerConfigurationDeserializer().deserialize(de) - ) - - case 14: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_CREATE_GATEWAY_OUTPUT.members["kmsKeyArn"] - ) - - case 15: - kwargs["custom_transform_configuration"] = ( - CustomTransformConfiguration.deserialize(de) - ) - - case 16: - kwargs["interceptor_configurations"] = ( - _deserialize_gateway_interceptor_configurations( - de, - _SCHEMA_CREATE_GATEWAY_OUTPUT.members[ - "interceptorConfigurations" - ], - ) - ) - - case 17: - kwargs["policy_engine_configuration"] = ( - GatewayPolicyEngineConfiguration.deserialize(de) - ) - - case 18: - kwargs["workload_identity_details"] = ( - WorkloadIdentityDetails.deserialize(de) - ) - - case 19: - kwargs["exception_level"] = ExceptionLevel( - de.read_string( - _SCHEMA_CREATE_GATEWAY_OUTPUT.members["exceptionLevel"] - ) - ) - - case 20: - kwargs["web_acl_arn"] = de.read_string( - _SCHEMA_CREATE_GATEWAY_OUTPUT.members["webAclArn"] - ) - - case 21: - kwargs["waf_configuration"] = WafConfiguration.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_GATEWAY_OUTPUT, consumer=_consumer) - if "gateway_arn" not in kwargs: - kwargs["gateway_arn"] = "" - if "gateway_id" not in kwargs: - kwargs["gateway_id"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "status" not in kwargs: - kwargs["status"] = GatewayStatus._corrected("") - if "name" not in kwargs: - kwargs["name"] = "" - if "authorizer_type" not in kwargs: - kwargs["authorizer_type"] = AuthorizerType._corrected("") - return kwargs - - -CREATE_GATEWAY = APIOperation( - input=CreateGatewayInput, - output=CreateGatewayOutput, - schema=_SCHEMA_CREATE_GATEWAY, - input_schema=_SCHEMA_CREATE_GATEWAY_INPUT, - output_schema=_SCHEMA_CREATE_GATEWAY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteGatewayInput: - """Dataclass for DeleteGatewayInput structure.""" - - gateway_identifier: str | None = None - """The identifier of the gateway to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_GATEWAY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.gateway_identifier is not None: - serializer.write_string( - _SCHEMA_DELETE_GATEWAY_INPUT.members["gatewayIdentifier"], - self.gateway_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["gateway_identifier"] = de.read_string( - _SCHEMA_DELETE_GATEWAY_INPUT.members["gatewayIdentifier"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_GATEWAY_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteGatewayOutput: - """Dataclass for DeleteGatewayOutput structure.""" - - gateway_id: str - """The unique identifier of the deleted gateway.""" - - status: str - """The current status of the gateway deletion.""" - - status_reasons: list[str] | None = None - """The reasons for the current status of the gateway deletion.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_GATEWAY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DELETE_GATEWAY_OUTPUT.members["gatewayId"], self.gateway_id - ) - serializer.write_string( - _SCHEMA_DELETE_GATEWAY_OUTPUT.members["status"], self.status - ) - if self.status_reasons is not None: - _serialize_status_reasons( - serializer, - _SCHEMA_DELETE_GATEWAY_OUTPUT.members["statusReasons"], - self.status_reasons, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["gateway_id"] = de.read_string( - _SCHEMA_DELETE_GATEWAY_OUTPUT.members["gatewayId"] - ) - - case 1: - kwargs["status"] = GatewayStatus( - de.read_string(_SCHEMA_DELETE_GATEWAY_OUTPUT.members["status"]) - ) - - case 2: - kwargs["status_reasons"] = _deserialize_status_reasons( - de, _SCHEMA_DELETE_GATEWAY_OUTPUT.members["statusReasons"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_GATEWAY_OUTPUT, consumer=_consumer) - if "gateway_id" not in kwargs: - kwargs["gateway_id"] = "" - if "status" not in kwargs: - kwargs["status"] = GatewayStatus._corrected("") - return kwargs - - -DELETE_GATEWAY = APIOperation( - input=DeleteGatewayInput, - output=DeleteGatewayOutput, - schema=_SCHEMA_DELETE_GATEWAY, - input_schema=_SCHEMA_DELETE_GATEWAY_INPUT, - output_schema=_SCHEMA_DELETE_GATEWAY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetGatewayInput: - """Dataclass for GetGatewayInput structure.""" - - gateway_identifier: str | None = None - """The identifier of the gateway to retrieve.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_GATEWAY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.gateway_identifier is not None: - serializer.write_string( - _SCHEMA_GET_GATEWAY_INPUT.members["gatewayIdentifier"], - self.gateway_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["gateway_identifier"] = de.read_string( - _SCHEMA_GET_GATEWAY_INPUT.members["gatewayIdentifier"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_GATEWAY_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetGatewayOutput: - """Dataclass for GetGatewayOutput structure.""" - - gateway_arn: str - """The Amazon Resource Name (ARN) of the gateway.""" - - gateway_id: str - """The unique identifier of the gateway.""" - - created_at: datetime - """The timestamp when the gateway was created.""" - - updated_at: datetime - """The timestamp when the gateway was last updated.""" - - status: str - """The current status of the gateway.""" - - name: str - """The name of the gateway.""" - - authorizer_type: str - """Authorizer type for the gateway.""" - - gateway_url: str | None = None - """An endpoint for invoking gateway.""" - - status_reasons: list[str] | None = None - """The reasons for the current status of the gateway.""" - - description: str | None = field(repr=False, default=None) - """The description of the gateway.""" - - role_arn: str | None = None - """The IAM role ARN that provides permissions for the gateway.""" - - protocol_type: str = GatewayProtocolType("MCP") - """Protocol applied to a gateway.""" - - protocol_configuration: GatewayProtocolConfiguration | None = None - """ - The configuration for a gateway protocol. This structure defines how the - gateway communicates with external services. - """ - - authorizer_configuration: AuthorizerConfiguration | None = None - """The authorizer configuration for the gateway.""" - - kms_key_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the KMS key used to encrypt the - gateway. - """ - - custom_transform_configuration: CustomTransformConfiguration | None = None - """ - The custom transformation configuration for the gateway. This - configuration defines how the gateway transforms requests and responses. - """ - - interceptor_configurations: list[GatewayInterceptorConfiguration] | None = None - """The interceptors configured on the gateway.""" - - policy_engine_configuration: GatewayPolicyEngineConfiguration | None = None - """The policy engine configuration for the gateway.""" - - workload_identity_details: WorkloadIdentityDetails | None = None - """The workload identity details for the gateway.""" - - exception_level: str | None = None - """ - The level of detail in error messages returned when invoking the - gateway. - - - If the value is `DEBUG`, granular exception messages are returned to - help a user debug the gateway. - - - If the value is omitted, a generic error message is returned to the - end user. - """ - - web_acl_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the Amazon Web Services WAF web ACL - associated with the gateway. - """ - - waf_configuration: WafConfiguration | None = None - """The Amazon Web Services WAF configuration for the gateway.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_GATEWAY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_GATEWAY_OUTPUT.members["gatewayArn"], self.gateway_arn - ) - serializer.write_string( - _SCHEMA_GET_GATEWAY_OUTPUT.members["gatewayId"], self.gateway_id - ) - if self.gateway_url is not None: - serializer.write_string( - _SCHEMA_GET_GATEWAY_OUTPUT.members["gatewayUrl"], self.gateway_url - ) - - serializer.write_timestamp( - _SCHEMA_GET_GATEWAY_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_GET_GATEWAY_OUTPUT.members["updatedAt"], self.updated_at - ) - serializer.write_string( - _SCHEMA_GET_GATEWAY_OUTPUT.members["status"], self.status - ) - if self.status_reasons is not None: - _serialize_status_reasons( - serializer, - _SCHEMA_GET_GATEWAY_OUTPUT.members["statusReasons"], - self.status_reasons, - ) - - serializer.write_string(_SCHEMA_GET_GATEWAY_OUTPUT.members["name"], self.name) - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_GATEWAY_OUTPUT.members["description"], self.description - ) - - if self.role_arn is not None: - serializer.write_string( - _SCHEMA_GET_GATEWAY_OUTPUT.members["roleArn"], self.role_arn - ) - - serializer.write_string( - _SCHEMA_GET_GATEWAY_OUTPUT.members["protocolType"], self.protocol_type - ) - if self.protocol_configuration is not None: - serializer.write_struct( - _SCHEMA_GET_GATEWAY_OUTPUT.members["protocolConfiguration"], - self.protocol_configuration, - ) - - serializer.write_string( - _SCHEMA_GET_GATEWAY_OUTPUT.members["authorizerType"], self.authorizer_type - ) - if self.authorizer_configuration is not None: - serializer.write_struct( - _SCHEMA_GET_GATEWAY_OUTPUT.members["authorizerConfiguration"], - self.authorizer_configuration, - ) - - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_GET_GATEWAY_OUTPUT.members["kmsKeyArn"], self.kms_key_arn - ) - - if self.custom_transform_configuration is not None: - serializer.write_struct( - _SCHEMA_GET_GATEWAY_OUTPUT.members["customTransformConfiguration"], - self.custom_transform_configuration, - ) - - if self.interceptor_configurations is not None: - _serialize_gateway_interceptor_configurations( - serializer, - _SCHEMA_GET_GATEWAY_OUTPUT.members["interceptorConfigurations"], - self.interceptor_configurations, - ) - - if self.policy_engine_configuration is not None: - serializer.write_struct( - _SCHEMA_GET_GATEWAY_OUTPUT.members["policyEngineConfiguration"], - self.policy_engine_configuration, - ) - - if self.workload_identity_details is not None: - serializer.write_struct( - _SCHEMA_GET_GATEWAY_OUTPUT.members["workloadIdentityDetails"], - self.workload_identity_details, - ) - - if self.exception_level is not None: - serializer.write_string( - _SCHEMA_GET_GATEWAY_OUTPUT.members["exceptionLevel"], - self.exception_level, - ) - - if self.web_acl_arn is not None: - serializer.write_string( - _SCHEMA_GET_GATEWAY_OUTPUT.members["webAclArn"], self.web_acl_arn - ) - - if self.waf_configuration is not None: - serializer.write_struct( - _SCHEMA_GET_GATEWAY_OUTPUT.members["wafConfiguration"], - self.waf_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["gateway_arn"] = de.read_string( - _SCHEMA_GET_GATEWAY_OUTPUT.members["gatewayArn"] - ) - - case 1: - kwargs["gateway_id"] = de.read_string( - _SCHEMA_GET_GATEWAY_OUTPUT.members["gatewayId"] - ) - - case 2: - kwargs["gateway_url"] = de.read_string( - _SCHEMA_GET_GATEWAY_OUTPUT.members["gatewayUrl"] - ) - - case 3: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_GATEWAY_OUTPUT.members["createdAt"] - ) - - case 4: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_GET_GATEWAY_OUTPUT.members["updatedAt"] - ) - - case 5: - kwargs["status"] = GatewayStatus( - de.read_string(_SCHEMA_GET_GATEWAY_OUTPUT.members["status"]) - ) - - case 6: - kwargs["status_reasons"] = _deserialize_status_reasons( - de, _SCHEMA_GET_GATEWAY_OUTPUT.members["statusReasons"] - ) - - case 7: - kwargs["name"] = de.read_string( - _SCHEMA_GET_GATEWAY_OUTPUT.members["name"] - ) - - case 8: - kwargs["description"] = de.read_string( - _SCHEMA_GET_GATEWAY_OUTPUT.members["description"] - ) - - case 9: - kwargs["role_arn"] = de.read_string( - _SCHEMA_GET_GATEWAY_OUTPUT.members["roleArn"] - ) - - case 10: - kwargs["protocol_type"] = GatewayProtocolType( - de.read_string( - _SCHEMA_GET_GATEWAY_OUTPUT.members["protocolType"] - ) - ) - - case 11: - kwargs["protocol_configuration"] = ( - _GatewayProtocolConfigurationDeserializer().deserialize(de) - ) - - case 12: - kwargs["authorizer_type"] = AuthorizerType( - de.read_string( - _SCHEMA_GET_GATEWAY_OUTPUT.members["authorizerType"] - ) - ) - - case 13: - kwargs["authorizer_configuration"] = ( - _AuthorizerConfigurationDeserializer().deserialize(de) - ) - - case 14: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_GET_GATEWAY_OUTPUT.members["kmsKeyArn"] - ) - - case 15: - kwargs["custom_transform_configuration"] = ( - CustomTransformConfiguration.deserialize(de) - ) - - case 16: - kwargs["interceptor_configurations"] = ( - _deserialize_gateway_interceptor_configurations( - de, - _SCHEMA_GET_GATEWAY_OUTPUT.members[ - "interceptorConfigurations" - ], - ) - ) - - case 17: - kwargs["policy_engine_configuration"] = ( - GatewayPolicyEngineConfiguration.deserialize(de) - ) - - case 18: - kwargs["workload_identity_details"] = ( - WorkloadIdentityDetails.deserialize(de) - ) - - case 19: - kwargs["exception_level"] = ExceptionLevel( - de.read_string( - _SCHEMA_GET_GATEWAY_OUTPUT.members["exceptionLevel"] - ) - ) - - case 20: - kwargs["web_acl_arn"] = de.read_string( - _SCHEMA_GET_GATEWAY_OUTPUT.members["webAclArn"] - ) - - case 21: - kwargs["waf_configuration"] = WafConfiguration.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_GATEWAY_OUTPUT, consumer=_consumer) - if "gateway_arn" not in kwargs: - kwargs["gateway_arn"] = "" - if "gateway_id" not in kwargs: - kwargs["gateway_id"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "status" not in kwargs: - kwargs["status"] = GatewayStatus._corrected("") - if "name" not in kwargs: - kwargs["name"] = "" - if "authorizer_type" not in kwargs: - kwargs["authorizer_type"] = AuthorizerType._corrected("") - return kwargs - - -GET_GATEWAY = APIOperation( - input=GetGatewayInput, - output=GetGatewayOutput, - schema=_SCHEMA_GET_GATEWAY, - input_schema=_SCHEMA_GET_GATEWAY_INPUT, - output_schema=_SCHEMA_GET_GATEWAY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListGatewaysInput: - """Dataclass for ListGatewaysInput structure.""" - - max_results: int | None = None - """ - The maximum number of results to return in the response. If the total - number of results is greater than this value, use the token returned in - the response in the `nextToken` field when making another request to - return the next batch of results. - """ - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, enter the token returned in the `nextToken` - field in the response in this field to return the next batch of results. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_GATEWAYS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_GATEWAYS_INPUT.members["maxResults"], self.max_results - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_GATEWAYS_INPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_GATEWAYS_INPUT.members["maxResults"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_GATEWAYS_INPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_GATEWAYS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GatewaySummary: - """Contains summary information about a gateway.""" - - gateway_id: str - """The unique identifier of the gateway.""" - - name: str - """The name of the gateway.""" - - status: str - """The current status of the gateway.""" - - created_at: datetime - """The timestamp when the gateway was created.""" - - updated_at: datetime - """The timestamp when the gateway was last updated.""" - - authorizer_type: str - """The type of authorizer used by the gateway.""" - - description: str | None = field(repr=False, default=None) - """The description of the gateway.""" - - protocol_type: str = GatewayProtocolType("MCP") - """The protocol type used by the gateway.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GATEWAY_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GATEWAY_SUMMARY.members["gatewayId"], self.gateway_id - ) - serializer.write_string(_SCHEMA_GATEWAY_SUMMARY.members["name"], self.name) - serializer.write_string(_SCHEMA_GATEWAY_SUMMARY.members["status"], self.status) - if self.description is not None: - serializer.write_string( - _SCHEMA_GATEWAY_SUMMARY.members["description"], self.description - ) - - serializer.write_timestamp( - _SCHEMA_GATEWAY_SUMMARY.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_GATEWAY_SUMMARY.members["updatedAt"], self.updated_at - ) - serializer.write_string( - _SCHEMA_GATEWAY_SUMMARY.members["authorizerType"], self.authorizer_type - ) - serializer.write_string( - _SCHEMA_GATEWAY_SUMMARY.members["protocolType"], self.protocol_type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["gateway_id"] = de.read_string( - _SCHEMA_GATEWAY_SUMMARY.members["gatewayId"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_GATEWAY_SUMMARY.members["name"] - ) - - case 2: - kwargs["status"] = GatewayStatus( - de.read_string(_SCHEMA_GATEWAY_SUMMARY.members["status"]) - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_GATEWAY_SUMMARY.members["description"] - ) - - case 4: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GATEWAY_SUMMARY.members["createdAt"] - ) - - case 5: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_GATEWAY_SUMMARY.members["updatedAt"] - ) - - case 6: - kwargs["authorizer_type"] = AuthorizerType( - de.read_string( - _SCHEMA_GATEWAY_SUMMARY.members["authorizerType"] - ) - ) - - case 7: - kwargs["protocol_type"] = GatewayProtocolType( - de.read_string(_SCHEMA_GATEWAY_SUMMARY.members["protocolType"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GATEWAY_SUMMARY, consumer=_consumer) - if "gateway_id" not in kwargs: - kwargs["gateway_id"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "status" not in kwargs: - kwargs["status"] = GatewayStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "authorizer_type" not in kwargs: - kwargs["authorizer_type"] = AuthorizerType._corrected("") - return kwargs - - -def _serialize_gateway_summaries( - serializer: ShapeSerializer, schema: Schema, value: list[GatewaySummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_gateway_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GatewaySummary]: - result: list[GatewaySummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GatewaySummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListGatewaysOutput: - """Dataclass for ListGatewaysOutput structure.""" - - items: list[GatewaySummary] - """The list of gateway summaries.""" - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, use this token when making another request in - the `nextToken` field to return the next batch of results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_GATEWAYS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_gateway_summaries( - serializer, _SCHEMA_LIST_GATEWAYS_OUTPUT.members["items"], self.items - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_GATEWAYS_OUTPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["items"] = _deserialize_gateway_summaries( - de, _SCHEMA_LIST_GATEWAYS_OUTPUT.members["items"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_GATEWAYS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_GATEWAYS_OUTPUT, consumer=_consumer) - if "items" not in kwargs: - kwargs["items"] = [] - return kwargs - - -LIST_GATEWAYS = APIOperation( - input=ListGatewaysInput, - output=ListGatewaysOutput, - schema=_SCHEMA_LIST_GATEWAYS, - input_schema=_SCHEMA_LIST_GATEWAYS_INPUT, - output_schema=_SCHEMA_LIST_GATEWAYS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateGatewayInput: - """Dataclass for UpdateGatewayInput structure.""" - - gateway_identifier: str | None = None - """The identifier of the gateway to update.""" - - name: str | None = None - """ - The name of the gateway. This name must be the same as the one when the - gateway was created. - """ - - description: str | None = field(repr=False, default=None) - """The updated description for the gateway.""" - - role_arn: str | None = None - """The updated IAM role ARN that provides permissions for the gateway.""" - - protocol_type: str = GatewayProtocolType("MCP") - """The updated protocol type for the gateway.""" - - protocol_configuration: GatewayProtocolConfiguration | None = None - """ - The configuration for a gateway protocol. This structure defines how the - gateway communicates with external services. - """ - - authorizer_type: str | None = None - """The updated authorizer type for the gateway.""" - - authorizer_configuration: AuthorizerConfiguration | None = None - """The updated authorizer configuration for the gateway.""" - - kms_key_arn: str | None = None - """The updated ARN of the KMS key used to encrypt the gateway.""" - - custom_transform_configuration: CustomTransformConfiguration | None = None - """ - The updated custom transformation configuration for the gateway. This - configuration defines how the gateway transforms requests and responses. - """ - - interceptor_configurations: list[GatewayInterceptorConfiguration] | None = None - """The updated interceptor configurations for the gateway.""" - - policy_engine_configuration: GatewayPolicyEngineConfiguration | None = None - """ - The updated policy engine configuration for the gateway. A policy engine - is a collection of policies that evaluates and authorizes agent tool - calls. When associated with a gateway, the policy engine intercepts all - agent requests and determines whether to allow or deny each action based - on the defined policies. - """ - - exception_level: str | None = None - """ - The level of detail in error messages returned when invoking the - gateway. - - - If the value is `DEBUG`, granular exception messages are returned to - help a user debug the gateway. - - - If the value is omitted, a generic error message is returned to the - end user. - """ - - waf_configuration: WafConfiguration | None = None - """The updated Amazon Web Services WAF configuration for the gateway.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_GATEWAY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.gateway_identifier is not None: - serializer.write_string( - _SCHEMA_UPDATE_GATEWAY_INPUT.members["gatewayIdentifier"], - self.gateway_identifier, - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_UPDATE_GATEWAY_INPUT.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_GATEWAY_INPUT.members["description"], self.description - ) - - if self.role_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_GATEWAY_INPUT.members["roleArn"], self.role_arn - ) - - if self.protocol_type is not None: - serializer.write_string( - _SCHEMA_UPDATE_GATEWAY_INPUT.members["protocolType"], self.protocol_type - ) - - if self.protocol_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_GATEWAY_INPUT.members["protocolConfiguration"], - self.protocol_configuration, - ) - - if self.authorizer_type is not None: - serializer.write_string( - _SCHEMA_UPDATE_GATEWAY_INPUT.members["authorizerType"], - self.authorizer_type, - ) - - if self.authorizer_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_GATEWAY_INPUT.members["authorizerConfiguration"], - self.authorizer_configuration, - ) - - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_GATEWAY_INPUT.members["kmsKeyArn"], self.kms_key_arn - ) - - if self.custom_transform_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_GATEWAY_INPUT.members["customTransformConfiguration"], - self.custom_transform_configuration, - ) - - if self.interceptor_configurations is not None: - _serialize_gateway_interceptor_configurations( - serializer, - _SCHEMA_UPDATE_GATEWAY_INPUT.members["interceptorConfigurations"], - self.interceptor_configurations, - ) - - if self.policy_engine_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_GATEWAY_INPUT.members["policyEngineConfiguration"], - self.policy_engine_configuration, - ) - - if self.exception_level is not None: - serializer.write_string( - _SCHEMA_UPDATE_GATEWAY_INPUT.members["exceptionLevel"], - self.exception_level, - ) - - if self.waf_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_GATEWAY_INPUT.members["wafConfiguration"], - self.waf_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["gateway_identifier"] = de.read_string( - _SCHEMA_UPDATE_GATEWAY_INPUT.members["gatewayIdentifier"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_GATEWAY_INPUT.members["name"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_GATEWAY_INPUT.members["description"] - ) - - case 3: - kwargs["role_arn"] = de.read_string( - _SCHEMA_UPDATE_GATEWAY_INPUT.members["roleArn"] - ) - - case 4: - kwargs["protocol_type"] = GatewayProtocolType( - de.read_string( - _SCHEMA_UPDATE_GATEWAY_INPUT.members["protocolType"] - ) - ) - - case 5: - kwargs["protocol_configuration"] = ( - _GatewayProtocolConfigurationDeserializer().deserialize(de) - ) - - case 6: - kwargs["authorizer_type"] = AuthorizerType( - de.read_string( - _SCHEMA_UPDATE_GATEWAY_INPUT.members["authorizerType"] - ) - ) - - case 7: - kwargs["authorizer_configuration"] = ( - _AuthorizerConfigurationDeserializer().deserialize(de) - ) - - case 8: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_UPDATE_GATEWAY_INPUT.members["kmsKeyArn"] - ) - - case 9: - kwargs["custom_transform_configuration"] = ( - CustomTransformConfiguration.deserialize(de) - ) - - case 10: - kwargs["interceptor_configurations"] = ( - _deserialize_gateway_interceptor_configurations( - de, - _SCHEMA_UPDATE_GATEWAY_INPUT.members[ - "interceptorConfigurations" - ], - ) - ) - - case 11: - kwargs["policy_engine_configuration"] = ( - GatewayPolicyEngineConfiguration.deserialize(de) - ) - - case 12: - kwargs["exception_level"] = ExceptionLevel( - de.read_string( - _SCHEMA_UPDATE_GATEWAY_INPUT.members["exceptionLevel"] - ) - ) - - case 13: - kwargs["waf_configuration"] = WafConfiguration.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_GATEWAY_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateGatewayOutput: - """Dataclass for UpdateGatewayOutput structure.""" - - gateway_arn: str - """The Amazon Resource Name (ARN) of the updated gateway.""" - - gateway_id: str - """The unique identifier of the updated gateway.""" - - created_at: datetime - """The timestamp when the gateway was created.""" - - updated_at: datetime - """The timestamp when the gateway was last updated.""" - - status: str - """The current status of the updated gateway.""" - - name: str - """The name of the gateway.""" - - authorizer_type: str - """The updated authorizer type for the gateway.""" - - gateway_url: str | None = None - """An endpoint for invoking the updated gateway.""" - - status_reasons: list[str] | None = None - """The reasons for the current status of the updated gateway.""" - - description: str | None = field(repr=False, default=None) - """The updated description of the gateway.""" - - role_arn: str | None = None - """The updated IAM role ARN that provides permissions for the gateway.""" - - protocol_type: str = GatewayProtocolType("MCP") - """The updated protocol type for the gateway.""" - - protocol_configuration: GatewayProtocolConfiguration | None = None - """ - The configuration for a gateway protocol. This structure defines how the - gateway communicates with external services. - """ - - authorizer_configuration: AuthorizerConfiguration | None = None - """The updated authorizer configuration for the gateway.""" - - kms_key_arn: str | None = None - """The updated ARN of the KMS key used to encrypt the gateway.""" - - custom_transform_configuration: CustomTransformConfiguration | None = None - """ - The custom transformation configuration for the gateway. This - configuration defines how the gateway transforms requests and responses. - """ - - interceptor_configurations: list[GatewayInterceptorConfiguration] | None = None - """The updated interceptor configurations for the gateway.""" - - policy_engine_configuration: GatewayPolicyEngineConfiguration | None = None - """The updated policy engine configuration for the gateway.""" - - workload_identity_details: WorkloadIdentityDetails | None = None - """The workload identity details for the updated gateway.""" - - exception_level: str | None = None - """ - The level of detail in error messages returned when invoking the - gateway. - - - If the value is `DEBUG`, granular exception messages are returned to - help a user debug the gateway. - - - If the value is omitted, a generic error message is returned to the - end user. - """ - - web_acl_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the Amazon Web Services WAF web ACL - associated with the gateway. - """ - - waf_configuration: WafConfiguration | None = None - """The Amazon Web Services WAF configuration for the gateway.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_GATEWAY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_UPDATE_GATEWAY_OUTPUT.members["gatewayArn"], self.gateway_arn - ) - serializer.write_string( - _SCHEMA_UPDATE_GATEWAY_OUTPUT.members["gatewayId"], self.gateway_id - ) - if self.gateway_url is not None: - serializer.write_string( - _SCHEMA_UPDATE_GATEWAY_OUTPUT.members["gatewayUrl"], self.gateway_url - ) - - serializer.write_timestamp( - _SCHEMA_UPDATE_GATEWAY_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_UPDATE_GATEWAY_OUTPUT.members["updatedAt"], self.updated_at - ) - serializer.write_string( - _SCHEMA_UPDATE_GATEWAY_OUTPUT.members["status"], self.status - ) - if self.status_reasons is not None: - _serialize_status_reasons( - serializer, - _SCHEMA_UPDATE_GATEWAY_OUTPUT.members["statusReasons"], - self.status_reasons, - ) - - serializer.write_string( - _SCHEMA_UPDATE_GATEWAY_OUTPUT.members["name"], self.name - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_GATEWAY_OUTPUT.members["description"], self.description - ) - - if self.role_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_GATEWAY_OUTPUT.members["roleArn"], self.role_arn - ) - - serializer.write_string( - _SCHEMA_UPDATE_GATEWAY_OUTPUT.members["protocolType"], self.protocol_type - ) - if self.protocol_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_GATEWAY_OUTPUT.members["protocolConfiguration"], - self.protocol_configuration, - ) - - serializer.write_string( - _SCHEMA_UPDATE_GATEWAY_OUTPUT.members["authorizerType"], - self.authorizer_type, - ) - if self.authorizer_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_GATEWAY_OUTPUT.members["authorizerConfiguration"], - self.authorizer_configuration, - ) - - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_GATEWAY_OUTPUT.members["kmsKeyArn"], self.kms_key_arn - ) - - if self.custom_transform_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_GATEWAY_OUTPUT.members["customTransformConfiguration"], - self.custom_transform_configuration, - ) - - if self.interceptor_configurations is not None: - _serialize_gateway_interceptor_configurations( - serializer, - _SCHEMA_UPDATE_GATEWAY_OUTPUT.members["interceptorConfigurations"], - self.interceptor_configurations, - ) - - if self.policy_engine_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_GATEWAY_OUTPUT.members["policyEngineConfiguration"], - self.policy_engine_configuration, - ) - - if self.workload_identity_details is not None: - serializer.write_struct( - _SCHEMA_UPDATE_GATEWAY_OUTPUT.members["workloadIdentityDetails"], - self.workload_identity_details, - ) - - if self.exception_level is not None: - serializer.write_string( - _SCHEMA_UPDATE_GATEWAY_OUTPUT.members["exceptionLevel"], - self.exception_level, - ) - - if self.web_acl_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_GATEWAY_OUTPUT.members["webAclArn"], self.web_acl_arn - ) - - if self.waf_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_GATEWAY_OUTPUT.members["wafConfiguration"], - self.waf_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["gateway_arn"] = de.read_string( - _SCHEMA_UPDATE_GATEWAY_OUTPUT.members["gatewayArn"] - ) - - case 1: - kwargs["gateway_id"] = de.read_string( - _SCHEMA_UPDATE_GATEWAY_OUTPUT.members["gatewayId"] - ) - - case 2: - kwargs["gateway_url"] = de.read_string( - _SCHEMA_UPDATE_GATEWAY_OUTPUT.members["gatewayUrl"] - ) - - case 3: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_UPDATE_GATEWAY_OUTPUT.members["createdAt"] - ) - - case 4: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_UPDATE_GATEWAY_OUTPUT.members["updatedAt"] - ) - - case 5: - kwargs["status"] = GatewayStatus( - de.read_string(_SCHEMA_UPDATE_GATEWAY_OUTPUT.members["status"]) - ) - - case 6: - kwargs["status_reasons"] = _deserialize_status_reasons( - de, _SCHEMA_UPDATE_GATEWAY_OUTPUT.members["statusReasons"] - ) - - case 7: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_GATEWAY_OUTPUT.members["name"] - ) - - case 8: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_GATEWAY_OUTPUT.members["description"] - ) - - case 9: - kwargs["role_arn"] = de.read_string( - _SCHEMA_UPDATE_GATEWAY_OUTPUT.members["roleArn"] - ) - - case 10: - kwargs["protocol_type"] = GatewayProtocolType( - de.read_string( - _SCHEMA_UPDATE_GATEWAY_OUTPUT.members["protocolType"] - ) - ) - - case 11: - kwargs["protocol_configuration"] = ( - _GatewayProtocolConfigurationDeserializer().deserialize(de) - ) - - case 12: - kwargs["authorizer_type"] = AuthorizerType( - de.read_string( - _SCHEMA_UPDATE_GATEWAY_OUTPUT.members["authorizerType"] - ) - ) - - case 13: - kwargs["authorizer_configuration"] = ( - _AuthorizerConfigurationDeserializer().deserialize(de) - ) - - case 14: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_UPDATE_GATEWAY_OUTPUT.members["kmsKeyArn"] - ) - - case 15: - kwargs["custom_transform_configuration"] = ( - CustomTransformConfiguration.deserialize(de) - ) - - case 16: - kwargs["interceptor_configurations"] = ( - _deserialize_gateway_interceptor_configurations( - de, - _SCHEMA_UPDATE_GATEWAY_OUTPUT.members[ - "interceptorConfigurations" - ], - ) - ) - - case 17: - kwargs["policy_engine_configuration"] = ( - GatewayPolicyEngineConfiguration.deserialize(de) - ) - - case 18: - kwargs["workload_identity_details"] = ( - WorkloadIdentityDetails.deserialize(de) - ) - - case 19: - kwargs["exception_level"] = ExceptionLevel( - de.read_string( - _SCHEMA_UPDATE_GATEWAY_OUTPUT.members["exceptionLevel"] - ) - ) - - case 20: - kwargs["web_acl_arn"] = de.read_string( - _SCHEMA_UPDATE_GATEWAY_OUTPUT.members["webAclArn"] - ) - - case 21: - kwargs["waf_configuration"] = WafConfiguration.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_GATEWAY_OUTPUT, consumer=_consumer) - if "gateway_arn" not in kwargs: - kwargs["gateway_arn"] = "" - if "gateway_id" not in kwargs: - kwargs["gateway_id"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "status" not in kwargs: - kwargs["status"] = GatewayStatus._corrected("") - if "name" not in kwargs: - kwargs["name"] = "" - if "authorizer_type" not in kwargs: - kwargs["authorizer_type"] = AuthorizerType._corrected("") - return kwargs - - -UPDATE_GATEWAY = APIOperation( - input=UpdateGatewayInput, - output=UpdateGatewayOutput, - schema=_SCHEMA_UPDATE_GATEWAY, - input_schema=_SCHEMA_UPDATE_GATEWAY_INPUT, - output_schema=_SCHEMA_UPDATE_GATEWAY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -def _serialize_match_path_patterns( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_match_path_patterns( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class MatchPaths: - """A condition that matches requests based on the request path.""" - - any_of: list[str] - """ - A list of path patterns. The condition is met if the request path - matches any of the patterns. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MATCH_PATHS, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_match_path_patterns( - serializer, _SCHEMA_MATCH_PATHS.members["anyOf"], self.any_of - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["any_of"] = _deserialize_match_path_patterns( - de, _SCHEMA_MATCH_PATHS.members["anyOf"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MATCH_PATHS, consumer=_consumer) - if "any_of" not in kwargs: - kwargs["any_of"] = [] - return kwargs - - -class PrincipalMatchOperator(UnknownEnumMixin, StrEnum): - STRING_EQUALS = "StringEquals" - STRING_LIKE = "StringLike" - - -@dataclass(kw_only=True) -class IamPrincipal: - """An IAM principal specification for rule matching.""" - - arn: str - """ - The Amazon Resource Name (ARN) of the IAM principal. Supports user, - role, and assumed-role ARNs. Wildcards can be used with the `StringLike` - operator. - """ - - operator: str | None = None - """ - The match operator. `StringEquals` requires an exact match. `StringLike` - supports wildcard patterns using `*` and `?`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IAM_PRINCIPAL, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_IAM_PRINCIPAL.members["arn"], self.arn) - if self.operator is not None: - serializer.write_string( - _SCHEMA_IAM_PRINCIPAL.members["operator"], self.operator - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["arn"] = de.read_string(_SCHEMA_IAM_PRINCIPAL.members["arn"]) - - case 1: - kwargs["operator"] = PrincipalMatchOperator( - de.read_string(_SCHEMA_IAM_PRINCIPAL.members["operator"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_IAM_PRINCIPAL, consumer=_consumer) - if "arn" not in kwargs: - kwargs["arn"] = "" - return kwargs - - -@dataclass -class MatchPrincipalEntryIamPrincipal: - """An IAM principal to match against, specified by ARN.""" - - value: IamPrincipal - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MATCH_PRINCIPAL_ENTRY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MATCH_PRINCIPAL_ENTRY.members["iamPrincipal"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=IamPrincipal.deserialize(deserializer)) - - -@dataclass -class MatchPrincipalEntryUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -MatchPrincipalEntry = Union[ - MatchPrincipalEntryIamPrincipal | MatchPrincipalEntryUnknown -] -""" -Union for principal matching. Currently supports IAM principal ARN glob -matching. -""" - - -class _MatchPrincipalEntryDeserializer: - _result: MatchPrincipalEntry | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> MatchPrincipalEntry: - self._result = None - deserializer.read_struct(_SCHEMA_MATCH_PRINCIPAL_ENTRY, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(MatchPrincipalEntryIamPrincipal.deserialize(de)) - - case _: - self._set_result( - MatchPrincipalEntryUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: MatchPrincipalEntry) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_match_principal_entries( - serializer: ShapeSerializer, schema: Schema, value: list[MatchPrincipalEntry] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_match_principal_entries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[MatchPrincipalEntry]: - result: list[MatchPrincipalEntry] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_MatchPrincipalEntryDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class MatchPrincipals: - """A condition that matches requests based on the caller's identity.""" - - any_of: list[MatchPrincipalEntry] - """ - A list of principal entries. The condition is met if any of the entries - match the caller's identity. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MATCH_PRINCIPALS, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_match_principal_entries( - serializer, _SCHEMA_MATCH_PRINCIPALS.members["anyOf"], self.any_of - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["any_of"] = _deserialize_match_principal_entries( - de, _SCHEMA_MATCH_PRINCIPALS.members["anyOf"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MATCH_PRINCIPALS, consumer=_consumer) - if "any_of" not in kwargs: - kwargs["any_of"] = [] - return kwargs - - -@dataclass -class ConditionMatchPrincipals: - """ - A condition that matches on the identity of the caller making the - request. - """ - - value: MatchPrincipals - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONDITION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CONDITION.members["matchPrincipals"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=MatchPrincipals.deserialize(deserializer)) - - -@dataclass -class ConditionMatchPaths: - """A condition that matches on the request path.""" - - value: MatchPaths - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONDITION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONDITION.members["matchPaths"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=MatchPaths.deserialize(deserializer)) - - -@dataclass -class ConditionUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -Condition = Union[ConditionMatchPrincipals | ConditionMatchPaths | ConditionUnknown] -""" -A condition that determines when a gateway rule applies. Conditions can -match on principals or request paths. -""" - - -class _ConditionDeserializer: - _result: Condition | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> Condition: - self._result = None - deserializer.read_struct(_SCHEMA_CONDITION, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(ConditionMatchPrincipals.deserialize(de)) - - case 1: - self._set_result(ConditionMatchPaths.deserialize(de)) - - case _: - self._set_result(ConditionUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: Condition) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_conditions( - serializer: ShapeSerializer, schema: Schema, value: list[Condition] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_conditions( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Condition]: - result: list[Condition] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_ConditionDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CreateGatewayRuleInput: - """Dataclass for CreateGatewayRuleInput structure.""" - - gateway_identifier: str | None = None - """The identifier of the gateway to create a rule for.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If you don't specify this field, a - value is randomly generated for you. If this token matches a previous - request, the service ignores the request, but doesn't return an error. - For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - priority: int | None = None - """ - The priority of the rule. Rules are evaluated in order of priority, with - lower numbers evaluated first. Must be between 1 and 1,000,000. - """ - - conditions: list[Condition] | None = None - """ - The conditions that must be met for the rule to apply. Conditions can - match on principals (IAM ARNs) or request paths. - """ - - actions: list[Action] | None = None - """ - The actions to take when the rule conditions are met. Actions can route - to a specific target or apply a configuration bundle override. - """ - - description: str | None = None - """The description of the gateway rule.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_GATEWAY_RULE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.gateway_identifier is not None: - serializer.write_string( - _SCHEMA_CREATE_GATEWAY_RULE_INPUT.members["gatewayIdentifier"], - self.gateway_identifier, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_GATEWAY_RULE_INPUT.members["clientToken"], - self.client_token, - ) - - if self.priority is not None: - serializer.write_integer( - _SCHEMA_CREATE_GATEWAY_RULE_INPUT.members["priority"], self.priority - ) - - if self.conditions is not None: - _serialize_conditions( - serializer, - _SCHEMA_CREATE_GATEWAY_RULE_INPUT.members["conditions"], - self.conditions, - ) - - if self.actions is not None: - _serialize_actions( - serializer, - _SCHEMA_CREATE_GATEWAY_RULE_INPUT.members["actions"], - self.actions, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_GATEWAY_RULE_INPUT.members["description"], - self.description, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["gateway_identifier"] = de.read_string( - _SCHEMA_CREATE_GATEWAY_RULE_INPUT.members["gatewayIdentifier"] - ) - - case 1: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_GATEWAY_RULE_INPUT.members["clientToken"] - ) - - case 2: - kwargs["priority"] = de.read_integer( - _SCHEMA_CREATE_GATEWAY_RULE_INPUT.members["priority"] - ) - - case 3: - kwargs["conditions"] = _deserialize_conditions( - de, _SCHEMA_CREATE_GATEWAY_RULE_INPUT.members["conditions"] - ) - - case 4: - kwargs["actions"] = _deserialize_actions( - de, _SCHEMA_CREATE_GATEWAY_RULE_INPUT.members["actions"] - ) - - case 5: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_GATEWAY_RULE_INPUT.members["description"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_GATEWAY_RULE_INPUT, consumer=_consumer) - return kwargs - - -class GatewayRuleStatus(UnknownEnumMixin, StrEnum): - CREATING = "CREATING" - ACTIVE = "ACTIVE" - UPDATING = "UPDATING" - DELETING = "DELETING" - - -@dataclass(kw_only=True) -class SystemManagedBlock: - """ - System-managed metadata for rules created by automated processes such as - A/B tests. - """ - - managed_by: str - """The identifier of the system or process that manages this rule.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SYSTEM_MANAGED_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SYSTEM_MANAGED_BLOCK.members["managedBy"], self.managed_by - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["managed_by"] = de.read_string( - _SCHEMA_SYSTEM_MANAGED_BLOCK.members["managedBy"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SYSTEM_MANAGED_BLOCK, consumer=_consumer) - if "managed_by" not in kwargs: - kwargs["managed_by"] = "" - return kwargs - - -@dataclass(kw_only=True) -class CreateGatewayRuleOutput: - """Dataclass for CreateGatewayRuleOutput structure.""" - - rule_id: str - """The unique identifier of the gateway rule.""" - - gateway_arn: str - """The Amazon Resource Name (ARN) of the gateway that the rule belongs to.""" - - priority: int - """ - The priority of the rule. Rules are evaluated in order of priority, with - lower numbers evaluated first. - """ - - actions: list[Action] - """The actions to take when the rule conditions are met.""" - - created_at: datetime - """The timestamp when the rule was created.""" - - status: str - """The current status of the rule.""" - - conditions: list[Condition] | None = None - """The conditions that must be met for the rule to apply.""" - - description: str | None = None - """The description of the gateway rule.""" - - system: SystemManagedBlock | None = None - """System-managed metadata for rules created by automated processes.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_GATEWAY_RULE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_GATEWAY_RULE_OUTPUT.members["ruleId"], self.rule_id - ) - serializer.write_string( - _SCHEMA_CREATE_GATEWAY_RULE_OUTPUT.members["gatewayArn"], self.gateway_arn - ) - serializer.write_integer( - _SCHEMA_CREATE_GATEWAY_RULE_OUTPUT.members["priority"], self.priority - ) - if self.conditions is not None: - _serialize_conditions( - serializer, - _SCHEMA_CREATE_GATEWAY_RULE_OUTPUT.members["conditions"], - self.conditions, - ) - - _serialize_actions( - serializer, - _SCHEMA_CREATE_GATEWAY_RULE_OUTPUT.members["actions"], - self.actions, - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_GATEWAY_RULE_OUTPUT.members["description"], - self.description, - ) - - serializer.write_timestamp( - _SCHEMA_CREATE_GATEWAY_RULE_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_string( - _SCHEMA_CREATE_GATEWAY_RULE_OUTPUT.members["status"], self.status - ) - if self.system is not None: - serializer.write_struct( - _SCHEMA_CREATE_GATEWAY_RULE_OUTPUT.members["system"], self.system - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rule_id"] = de.read_string( - _SCHEMA_CREATE_GATEWAY_RULE_OUTPUT.members["ruleId"] - ) - - case 1: - kwargs["gateway_arn"] = de.read_string( - _SCHEMA_CREATE_GATEWAY_RULE_OUTPUT.members["gatewayArn"] - ) - - case 2: - kwargs["priority"] = de.read_integer( - _SCHEMA_CREATE_GATEWAY_RULE_OUTPUT.members["priority"] - ) - - case 3: - kwargs["conditions"] = _deserialize_conditions( - de, _SCHEMA_CREATE_GATEWAY_RULE_OUTPUT.members["conditions"] - ) - - case 4: - kwargs["actions"] = _deserialize_actions( - de, _SCHEMA_CREATE_GATEWAY_RULE_OUTPUT.members["actions"] - ) - - case 5: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_GATEWAY_RULE_OUTPUT.members["description"] - ) - - case 6: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_CREATE_GATEWAY_RULE_OUTPUT.members["createdAt"] - ) - - case 7: - kwargs["status"] = GatewayRuleStatus( - de.read_string( - _SCHEMA_CREATE_GATEWAY_RULE_OUTPUT.members["status"] - ) - ) - - case 8: - kwargs["system"] = SystemManagedBlock.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_GATEWAY_RULE_OUTPUT, consumer=_consumer) - if "rule_id" not in kwargs: - kwargs["rule_id"] = "" - if "gateway_arn" not in kwargs: - kwargs["gateway_arn"] = "" - if "priority" not in kwargs: - kwargs["priority"] = 0 - if "actions" not in kwargs: - kwargs["actions"] = [] - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "status" not in kwargs: - kwargs["status"] = GatewayRuleStatus._corrected("") - return kwargs - - -CREATE_GATEWAY_RULE = APIOperation( - input=CreateGatewayRuleInput, - output=CreateGatewayRuleOutput, - schema=_SCHEMA_CREATE_GATEWAY_RULE, - input_schema=_SCHEMA_CREATE_GATEWAY_RULE_INPUT, - output_schema=_SCHEMA_CREATE_GATEWAY_RULE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteGatewayRuleInput: - """Dataclass for DeleteGatewayRuleInput structure.""" - - gateway_identifier: str | None = None - """The identifier of the gateway containing the rule.""" - - rule_id: str | None = None - """The unique identifier of the rule to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_GATEWAY_RULE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.gateway_identifier is not None: - serializer.write_string( - _SCHEMA_DELETE_GATEWAY_RULE_INPUT.members["gatewayIdentifier"], - self.gateway_identifier, - ) - - if self.rule_id is not None: - serializer.write_string( - _SCHEMA_DELETE_GATEWAY_RULE_INPUT.members["ruleId"], self.rule_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["gateway_identifier"] = de.read_string( - _SCHEMA_DELETE_GATEWAY_RULE_INPUT.members["gatewayIdentifier"] - ) - - case 1: - kwargs["rule_id"] = de.read_string( - _SCHEMA_DELETE_GATEWAY_RULE_INPUT.members["ruleId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_GATEWAY_RULE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteGatewayRuleOutput: - """Dataclass for DeleteGatewayRuleOutput structure.""" - - rule_id: str - """The unique identifier of the deleted rule.""" - - status: str - """The status of the rule deletion operation.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_GATEWAY_RULE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DELETE_GATEWAY_RULE_OUTPUT.members["ruleId"], self.rule_id - ) - serializer.write_string( - _SCHEMA_DELETE_GATEWAY_RULE_OUTPUT.members["status"], self.status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rule_id"] = de.read_string( - _SCHEMA_DELETE_GATEWAY_RULE_OUTPUT.members["ruleId"] - ) - - case 1: - kwargs["status"] = GatewayRuleStatus( - de.read_string( - _SCHEMA_DELETE_GATEWAY_RULE_OUTPUT.members["status"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_GATEWAY_RULE_OUTPUT, consumer=_consumer) - if "rule_id" not in kwargs: - kwargs["rule_id"] = "" - if "status" not in kwargs: - kwargs["status"] = GatewayRuleStatus._corrected("") - return kwargs - - -DELETE_GATEWAY_RULE = APIOperation( - input=DeleteGatewayRuleInput, - output=DeleteGatewayRuleOutput, - schema=_SCHEMA_DELETE_GATEWAY_RULE, - input_schema=_SCHEMA_DELETE_GATEWAY_RULE_INPUT, - output_schema=_SCHEMA_DELETE_GATEWAY_RULE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetGatewayRuleInput: - """Dataclass for GetGatewayRuleInput structure.""" - - gateway_identifier: str | None = None - """The identifier of the gateway containing the rule.""" - - rule_id: str | None = None - """The unique identifier of the rule to retrieve.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_GATEWAY_RULE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.gateway_identifier is not None: - serializer.write_string( - _SCHEMA_GET_GATEWAY_RULE_INPUT.members["gatewayIdentifier"], - self.gateway_identifier, - ) - - if self.rule_id is not None: - serializer.write_string( - _SCHEMA_GET_GATEWAY_RULE_INPUT.members["ruleId"], self.rule_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["gateway_identifier"] = de.read_string( - _SCHEMA_GET_GATEWAY_RULE_INPUT.members["gatewayIdentifier"] - ) - - case 1: - kwargs["rule_id"] = de.read_string( - _SCHEMA_GET_GATEWAY_RULE_INPUT.members["ruleId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_GATEWAY_RULE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetGatewayRuleOutput: - """ - Create response excludes updatedAt (redundant on create). Get/Update - responses include it via their own output structures. - """ - - rule_id: str - """The unique identifier of the gateway rule.""" - - gateway_arn: str - """The Amazon Resource Name (ARN) of the gateway that the rule belongs to.""" - - priority: int - """ - The priority of the rule. Rules are evaluated in order of priority, with - lower numbers evaluated first. - """ - - actions: list[Action] - """The actions to take when the rule conditions are met.""" - - created_at: datetime - """The timestamp when the rule was created.""" - - status: str - """The current status of the rule.""" - - conditions: list[Condition] | None = None - """The conditions that must be met for the rule to apply.""" - - description: str | None = None - """The description of the gateway rule.""" - - system: SystemManagedBlock | None = None - """System-managed metadata for rules created by automated processes.""" - - updated_at: datetime | None = None - """The timestamp when the rule was last updated.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_GATEWAY_RULE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_GATEWAY_RULE_OUTPUT.members["ruleId"], self.rule_id - ) - serializer.write_string( - _SCHEMA_GET_GATEWAY_RULE_OUTPUT.members["gatewayArn"], self.gateway_arn - ) - serializer.write_integer( - _SCHEMA_GET_GATEWAY_RULE_OUTPUT.members["priority"], self.priority - ) - if self.conditions is not None: - _serialize_conditions( - serializer, - _SCHEMA_GET_GATEWAY_RULE_OUTPUT.members["conditions"], - self.conditions, - ) - - _serialize_actions( - serializer, _SCHEMA_GET_GATEWAY_RULE_OUTPUT.members["actions"], self.actions - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_GATEWAY_RULE_OUTPUT.members["description"], self.description - ) - - serializer.write_timestamp( - _SCHEMA_GET_GATEWAY_RULE_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_string( - _SCHEMA_GET_GATEWAY_RULE_OUTPUT.members["status"], self.status - ) - if self.system is not None: - serializer.write_struct( - _SCHEMA_GET_GATEWAY_RULE_OUTPUT.members["system"], self.system - ) - - if self.updated_at is not None: - serializer.write_timestamp( - _SCHEMA_GET_GATEWAY_RULE_OUTPUT.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rule_id"] = de.read_string( - _SCHEMA_GET_GATEWAY_RULE_OUTPUT.members["ruleId"] - ) - - case 1: - kwargs["gateway_arn"] = de.read_string( - _SCHEMA_GET_GATEWAY_RULE_OUTPUT.members["gatewayArn"] - ) - - case 2: - kwargs["priority"] = de.read_integer( - _SCHEMA_GET_GATEWAY_RULE_OUTPUT.members["priority"] - ) - - case 3: - kwargs["conditions"] = _deserialize_conditions( - de, _SCHEMA_GET_GATEWAY_RULE_OUTPUT.members["conditions"] - ) - - case 4: - kwargs["actions"] = _deserialize_actions( - de, _SCHEMA_GET_GATEWAY_RULE_OUTPUT.members["actions"] - ) - - case 5: - kwargs["description"] = de.read_string( - _SCHEMA_GET_GATEWAY_RULE_OUTPUT.members["description"] - ) - - case 6: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_GATEWAY_RULE_OUTPUT.members["createdAt"] - ) - - case 7: - kwargs["status"] = GatewayRuleStatus( - de.read_string( - _SCHEMA_GET_GATEWAY_RULE_OUTPUT.members["status"] - ) - ) - - case 8: - kwargs["system"] = SystemManagedBlock.deserialize(de) - - case 9: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_GET_GATEWAY_RULE_OUTPUT.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_GATEWAY_RULE_OUTPUT, consumer=_consumer) - if "rule_id" not in kwargs: - kwargs["rule_id"] = "" - if "gateway_arn" not in kwargs: - kwargs["gateway_arn"] = "" - if "priority" not in kwargs: - kwargs["priority"] = 0 - if "actions" not in kwargs: - kwargs["actions"] = [] - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "status" not in kwargs: - kwargs["status"] = GatewayRuleStatus._corrected("") - return kwargs - - -GET_GATEWAY_RULE = APIOperation( - input=GetGatewayRuleInput, - output=GetGatewayRuleOutput, - schema=_SCHEMA_GET_GATEWAY_RULE, - input_schema=_SCHEMA_GET_GATEWAY_RULE_INPUT, - output_schema=_SCHEMA_GET_GATEWAY_RULE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListGatewayRulesInput: - """Dataclass for ListGatewayRulesInput structure.""" - - gateway_identifier: str | None = None - """The identifier of the gateway to list rules for.""" - - max_results: int | None = None - """ - The maximum number of results to return in the response. If the total - number of results is greater than this value, use the token returned in - the response in the `nextToken` field when making another request to - return the next batch of results. - """ - - next_token: str | None = None - """The pagination token from a previous request.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_GATEWAY_RULES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.gateway_identifier is not None: - serializer.write_string( - _SCHEMA_LIST_GATEWAY_RULES_INPUT.members["gatewayIdentifier"], - self.gateway_identifier, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_GATEWAY_RULES_INPUT.members["maxResults"], self.max_results - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_GATEWAY_RULES_INPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["gateway_identifier"] = de.read_string( - _SCHEMA_LIST_GATEWAY_RULES_INPUT.members["gatewayIdentifier"] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_GATEWAY_RULES_INPUT.members["maxResults"] - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_GATEWAY_RULES_INPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_GATEWAY_RULES_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GatewayRuleDetail: - """Detailed information about a gateway rule.""" - - rule_id: str - """The unique identifier of the gateway rule.""" - - gateway_arn: str - """The Amazon Resource Name (ARN) of the gateway that the rule belongs to.""" - - priority: int - """ - The priority of the rule. Rules are evaluated in order of priority, with - lower numbers evaluated first. - """ - - actions: list[Action] - """The actions to take when the rule conditions are met.""" - - created_at: datetime - """The timestamp when the rule was created.""" - - status: str - """The current status of the rule.""" - - conditions: list[Condition] | None = None - """The conditions that must be met for the rule to apply.""" - - description: str | None = None - """The description of the gateway rule.""" - - system: SystemManagedBlock | None = None - """System-managed metadata for rules created by automated processes.""" - - updated_at: datetime | None = None - """The timestamp when the rule was last updated.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GATEWAY_RULE_DETAIL, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GATEWAY_RULE_DETAIL.members["ruleId"], self.rule_id - ) - serializer.write_string( - _SCHEMA_GATEWAY_RULE_DETAIL.members["gatewayArn"], self.gateway_arn - ) - serializer.write_integer( - _SCHEMA_GATEWAY_RULE_DETAIL.members["priority"], self.priority - ) - if self.conditions is not None: - _serialize_conditions( - serializer, - _SCHEMA_GATEWAY_RULE_DETAIL.members["conditions"], - self.conditions, - ) - - _serialize_actions( - serializer, _SCHEMA_GATEWAY_RULE_DETAIL.members["actions"], self.actions - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_GATEWAY_RULE_DETAIL.members["description"], self.description - ) - - serializer.write_timestamp( - _SCHEMA_GATEWAY_RULE_DETAIL.members["createdAt"], self.created_at - ) - serializer.write_string( - _SCHEMA_GATEWAY_RULE_DETAIL.members["status"], self.status - ) - if self.system is not None: - serializer.write_struct( - _SCHEMA_GATEWAY_RULE_DETAIL.members["system"], self.system - ) - - if self.updated_at is not None: - serializer.write_timestamp( - _SCHEMA_GATEWAY_RULE_DETAIL.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rule_id"] = de.read_string( - _SCHEMA_GATEWAY_RULE_DETAIL.members["ruleId"] - ) - - case 1: - kwargs["gateway_arn"] = de.read_string( - _SCHEMA_GATEWAY_RULE_DETAIL.members["gatewayArn"] - ) - - case 2: - kwargs["priority"] = de.read_integer( - _SCHEMA_GATEWAY_RULE_DETAIL.members["priority"] - ) - - case 3: - kwargs["conditions"] = _deserialize_conditions( - de, _SCHEMA_GATEWAY_RULE_DETAIL.members["conditions"] - ) - - case 4: - kwargs["actions"] = _deserialize_actions( - de, _SCHEMA_GATEWAY_RULE_DETAIL.members["actions"] - ) - - case 5: - kwargs["description"] = de.read_string( - _SCHEMA_GATEWAY_RULE_DETAIL.members["description"] - ) - - case 6: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GATEWAY_RULE_DETAIL.members["createdAt"] - ) - - case 7: - kwargs["status"] = GatewayRuleStatus( - de.read_string(_SCHEMA_GATEWAY_RULE_DETAIL.members["status"]) - ) - - case 8: - kwargs["system"] = SystemManagedBlock.deserialize(de) - - case 9: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_GATEWAY_RULE_DETAIL.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GATEWAY_RULE_DETAIL, consumer=_consumer) - if "rule_id" not in kwargs: - kwargs["rule_id"] = "" - if "gateway_arn" not in kwargs: - kwargs["gateway_arn"] = "" - if "priority" not in kwargs: - kwargs["priority"] = 0 - if "actions" not in kwargs: - kwargs["actions"] = [] - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "status" not in kwargs: - kwargs["status"] = GatewayRuleStatus._corrected("") - return kwargs - - -def _serialize_gateway_rules( - serializer: ShapeSerializer, schema: Schema, value: list[GatewayRuleDetail] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_gateway_rules( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GatewayRuleDetail]: - result: list[GatewayRuleDetail] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GatewayRuleDetail.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListGatewayRulesOutput: - """Dataclass for ListGatewayRulesOutput structure.""" - - gateway_rules: list[GatewayRuleDetail] - """The list of gateway rules.""" - - next_token: str | None = None - """The pagination token to use in a subsequent request.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_GATEWAY_RULES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_gateway_rules( - serializer, - _SCHEMA_LIST_GATEWAY_RULES_OUTPUT.members["gatewayRules"], - self.gateway_rules, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_GATEWAY_RULES_OUTPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["gateway_rules"] = _deserialize_gateway_rules( - de, _SCHEMA_LIST_GATEWAY_RULES_OUTPUT.members["gatewayRules"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_GATEWAY_RULES_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_GATEWAY_RULES_OUTPUT, consumer=_consumer) - if "gateway_rules" not in kwargs: - kwargs["gateway_rules"] = [] - return kwargs - - -LIST_GATEWAY_RULES = APIOperation( - input=ListGatewayRulesInput, - output=ListGatewayRulesOutput, - schema=_SCHEMA_LIST_GATEWAY_RULES, - input_schema=_SCHEMA_LIST_GATEWAY_RULES_INPUT, - output_schema=_SCHEMA_LIST_GATEWAY_RULES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateGatewayRuleInput: - """Dataclass for UpdateGatewayRuleInput structure.""" - - gateway_identifier: str | None = None - """The identifier of the gateway containing the rule.""" - - rule_id: str | None = None - """The unique identifier of the rule to update.""" - - priority: int | None = None - """The updated priority of the rule.""" - - conditions: list[Condition] | None = None - """The updated conditions for the rule.""" - - actions: list[Action] | None = None - """The updated actions for the rule.""" - - description: str | None = None - """The updated description of the rule.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_GATEWAY_RULE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.gateway_identifier is not None: - serializer.write_string( - _SCHEMA_UPDATE_GATEWAY_RULE_INPUT.members["gatewayIdentifier"], - self.gateway_identifier, - ) - - if self.rule_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_GATEWAY_RULE_INPUT.members["ruleId"], self.rule_id - ) - - if self.priority is not None: - serializer.write_integer( - _SCHEMA_UPDATE_GATEWAY_RULE_INPUT.members["priority"], self.priority - ) - - if self.conditions is not None: - _serialize_conditions( - serializer, - _SCHEMA_UPDATE_GATEWAY_RULE_INPUT.members["conditions"], - self.conditions, - ) - - if self.actions is not None: - _serialize_actions( - serializer, - _SCHEMA_UPDATE_GATEWAY_RULE_INPUT.members["actions"], - self.actions, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_GATEWAY_RULE_INPUT.members["description"], - self.description, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["gateway_identifier"] = de.read_string( - _SCHEMA_UPDATE_GATEWAY_RULE_INPUT.members["gatewayIdentifier"] - ) - - case 1: - kwargs["rule_id"] = de.read_string( - _SCHEMA_UPDATE_GATEWAY_RULE_INPUT.members["ruleId"] - ) - - case 2: - kwargs["priority"] = de.read_integer( - _SCHEMA_UPDATE_GATEWAY_RULE_INPUT.members["priority"] - ) - - case 3: - kwargs["conditions"] = _deserialize_conditions( - de, _SCHEMA_UPDATE_GATEWAY_RULE_INPUT.members["conditions"] - ) - - case 4: - kwargs["actions"] = _deserialize_actions( - de, _SCHEMA_UPDATE_GATEWAY_RULE_INPUT.members["actions"] - ) - - case 5: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_GATEWAY_RULE_INPUT.members["description"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_GATEWAY_RULE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateGatewayRuleOutput: - """ - Create response excludes updatedAt (redundant on create). Get/Update - responses include it via their own output structures. - """ - - rule_id: str - """The unique identifier of the gateway rule.""" - - gateway_arn: str - """The Amazon Resource Name (ARN) of the gateway that the rule belongs to.""" - - priority: int - """ - The priority of the rule. Rules are evaluated in order of priority, with - lower numbers evaluated first. - """ - - actions: list[Action] - """The actions to take when the rule conditions are met.""" - - created_at: datetime - """The timestamp when the rule was created.""" - - status: str - """The current status of the rule.""" - - conditions: list[Condition] | None = None - """The conditions that must be met for the rule to apply.""" - - description: str | None = None - """The description of the gateway rule.""" - - system: SystemManagedBlock | None = None - """System-managed metadata for rules created by automated processes.""" - - updated_at: datetime | None = None - """The timestamp when the rule was last updated.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_GATEWAY_RULE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_UPDATE_GATEWAY_RULE_OUTPUT.members["ruleId"], self.rule_id - ) - serializer.write_string( - _SCHEMA_UPDATE_GATEWAY_RULE_OUTPUT.members["gatewayArn"], self.gateway_arn - ) - serializer.write_integer( - _SCHEMA_UPDATE_GATEWAY_RULE_OUTPUT.members["priority"], self.priority - ) - if self.conditions is not None: - _serialize_conditions( - serializer, - _SCHEMA_UPDATE_GATEWAY_RULE_OUTPUT.members["conditions"], - self.conditions, - ) - - _serialize_actions( - serializer, - _SCHEMA_UPDATE_GATEWAY_RULE_OUTPUT.members["actions"], - self.actions, - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_GATEWAY_RULE_OUTPUT.members["description"], - self.description, - ) - - serializer.write_timestamp( - _SCHEMA_UPDATE_GATEWAY_RULE_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_string( - _SCHEMA_UPDATE_GATEWAY_RULE_OUTPUT.members["status"], self.status - ) - if self.system is not None: - serializer.write_struct( - _SCHEMA_UPDATE_GATEWAY_RULE_OUTPUT.members["system"], self.system - ) - - if self.updated_at is not None: - serializer.write_timestamp( - _SCHEMA_UPDATE_GATEWAY_RULE_OUTPUT.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rule_id"] = de.read_string( - _SCHEMA_UPDATE_GATEWAY_RULE_OUTPUT.members["ruleId"] - ) - - case 1: - kwargs["gateway_arn"] = de.read_string( - _SCHEMA_UPDATE_GATEWAY_RULE_OUTPUT.members["gatewayArn"] - ) - - case 2: - kwargs["priority"] = de.read_integer( - _SCHEMA_UPDATE_GATEWAY_RULE_OUTPUT.members["priority"] - ) - - case 3: - kwargs["conditions"] = _deserialize_conditions( - de, _SCHEMA_UPDATE_GATEWAY_RULE_OUTPUT.members["conditions"] - ) - - case 4: - kwargs["actions"] = _deserialize_actions( - de, _SCHEMA_UPDATE_GATEWAY_RULE_OUTPUT.members["actions"] - ) - - case 5: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_GATEWAY_RULE_OUTPUT.members["description"] - ) - - case 6: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_UPDATE_GATEWAY_RULE_OUTPUT.members["createdAt"] - ) - - case 7: - kwargs["status"] = GatewayRuleStatus( - de.read_string( - _SCHEMA_UPDATE_GATEWAY_RULE_OUTPUT.members["status"] - ) - ) - - case 8: - kwargs["system"] = SystemManagedBlock.deserialize(de) - - case 9: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_UPDATE_GATEWAY_RULE_OUTPUT.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_GATEWAY_RULE_OUTPUT, consumer=_consumer) - if "rule_id" not in kwargs: - kwargs["rule_id"] = "" - if "gateway_arn" not in kwargs: - kwargs["gateway_arn"] = "" - if "priority" not in kwargs: - kwargs["priority"] = 0 - if "actions" not in kwargs: - kwargs["actions"] = [] - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "status" not in kwargs: - kwargs["status"] = GatewayRuleStatus._corrected("") - return kwargs - - -UPDATE_GATEWAY_RULE = APIOperation( - input=UpdateGatewayRuleInput, - output=UpdateGatewayRuleOutput, - schema=_SCHEMA_UPDATE_GATEWAY_RULE, - input_schema=_SCHEMA_UPDATE_GATEWAY_RULE_INPUT, - output_schema=_SCHEMA_UPDATE_GATEWAY_RULE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class S3CertificateConfiguration: - """ - A reference to a PEM-encoded private CA certificate stored as an Amazon - S3 object. - """ - - uri: str - """ - The URI of the Amazon S3 object that contains the PEM-encoded - certificate. - """ - - bucket_owner_account_id: str | None = None - """ - The account ID of the Amazon S3 bucket owner. This ID is used for - cross-account access to the bucket. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_S3_CERTIFICATE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_S3_CERTIFICATE_CONFIGURATION.members["uri"], self.uri - ) - if self.bucket_owner_account_id is not None: - serializer.write_string( - _SCHEMA_S3_CERTIFICATE_CONFIGURATION.members["bucketOwnerAccountId"], - self.bucket_owner_account_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["uri"] = de.read_string( - _SCHEMA_S3_CERTIFICATE_CONFIGURATION.members["uri"] - ) - - case 1: - kwargs["bucket_owner_account_id"] = de.read_string( - _SCHEMA_S3_CERTIFICATE_CONFIGURATION.members[ - "bucketOwnerAccountId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_S3_CERTIFICATE_CONFIGURATION, consumer=_consumer - ) - if "uri" not in kwargs: - kwargs["uri"] = "" - return kwargs - - -@dataclass(kw_only=True) -class SecretsManagerCertificateConfiguration: - """ - A reference to a PEM-encoded private CA certificate stored in an Amazon - Web Services Secrets Manager secret. - """ - - secret_arn: str - """ - The Amazon Resource Name (ARN) of the Amazon Web Services Secrets - Manager secret that contains the PEM-encoded certificate. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SECRETS_MANAGER_CERTIFICATE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SECRETS_MANAGER_CERTIFICATE_CONFIGURATION.members["secretArn"], - self.secret_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["secret_arn"] = de.read_string( - _SCHEMA_SECRETS_MANAGER_CERTIFICATE_CONFIGURATION.members[ - "secretArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SECRETS_MANAGER_CERTIFICATE_CONFIGURATION, consumer=_consumer - ) - if "secret_arn" not in kwargs: - kwargs["secret_arn"] = "" - return kwargs - - -@dataclass -class CertificateConfigurationS3: - """The Amazon S3 location of the PEM-encoded private CA certificate.""" - - value: S3CertificateConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CERTIFICATE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CERTIFICATE_CONFIGURATION.members["s3"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=S3CertificateConfiguration.deserialize(deserializer)) - - -@dataclass -class CertificateConfigurationSecretsManager: - """ - The Amazon Web Services Secrets Manager location of the PEM-encoded - private CA certificate. - """ - - value: SecretsManagerCertificateConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CERTIFICATE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CERTIFICATE_CONFIGURATION.members["secretsManager"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=SecretsManagerCertificateConfiguration.deserialize(deserializer) - ) - - -@dataclass -class CertificateConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -CertificateConfiguration = Union[ - CertificateConfigurationS3 - | CertificateConfigurationSecretsManager - | CertificateConfigurationUnknown -] -""" -A reference to a private certificate authority (CA) certificate that the -gateway uses to verify TLS connections to the target endpoint. Use this -when the target presents a certificate issued by a private CA that is -not trusted by default. Specify exactly one certificate source. The -configuration is a reference only and never contains the certificate -content. -""" - - -class _CertificateConfigurationDeserializer: - _result: CertificateConfiguration | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> CertificateConfiguration: - self._result = None - deserializer.read_struct(_SCHEMA_CERTIFICATE_CONFIGURATION, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(CertificateConfigurationS3.deserialize(de)) - - case 1: - self._set_result(CertificateConfigurationSecretsManager.deserialize(de)) - - case _: - self._set_result( - CertificateConfigurationUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: CertificateConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_certificate_configuration_list( - serializer: ShapeSerializer, schema: Schema, value: list[CertificateConfiguration] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_certificate_configuration_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[CertificateConfiguration]: - result: list[CertificateConfiguration] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_CertificateConfigurationDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class ApiKeyCredentialLocation(UnknownEnumMixin, StrEnum): - HEADER = "HEADER" - QUERY_PARAMETER = "QUERY_PARAMETER" - - -@dataclass(kw_only=True) -class GatewayApiKeyCredentialProvider: - """ - An API key credential provider for gateway authentication. This - structure contains the configuration for authenticating with the target - endpoint using an API key. - """ - - provider_arn: str - """ - The Amazon Resource Name (ARN) of the API key credential provider. This - ARN identifies the provider in Amazon Web Services. - """ - - credential_parameter_name: str | None = None - """ - The name of the credential parameter for the API key. This parameter - name is used when sending the API key to the target endpoint. - """ - - credential_prefix: str | None = None - """ - The prefix for the API key credential. This prefix is added to the API - key when sending it to the target endpoint. - """ - - credential_location: str | None = None - """ - The location of the API key credential. This field specifies where in - the request the API key should be placed. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GATEWAY_API_KEY_CREDENTIAL_PROVIDER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GATEWAY_API_KEY_CREDENTIAL_PROVIDER.members["providerArn"], - self.provider_arn, - ) - if self.credential_parameter_name is not None: - serializer.write_string( - _SCHEMA_GATEWAY_API_KEY_CREDENTIAL_PROVIDER.members[ - "credentialParameterName" - ], - self.credential_parameter_name, - ) - - if self.credential_prefix is not None: - serializer.write_string( - _SCHEMA_GATEWAY_API_KEY_CREDENTIAL_PROVIDER.members["credentialPrefix"], - self.credential_prefix, - ) - - if self.credential_location is not None: - serializer.write_string( - _SCHEMA_GATEWAY_API_KEY_CREDENTIAL_PROVIDER.members[ - "credentialLocation" - ], - self.credential_location, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["provider_arn"] = de.read_string( - _SCHEMA_GATEWAY_API_KEY_CREDENTIAL_PROVIDER.members[ - "providerArn" - ] - ) - - case 1: - kwargs["credential_parameter_name"] = de.read_string( - _SCHEMA_GATEWAY_API_KEY_CREDENTIAL_PROVIDER.members[ - "credentialParameterName" - ] - ) - - case 2: - kwargs["credential_prefix"] = de.read_string( - _SCHEMA_GATEWAY_API_KEY_CREDENTIAL_PROVIDER.members[ - "credentialPrefix" - ] - ) - - case 3: - kwargs["credential_location"] = ApiKeyCredentialLocation( - de.read_string( - _SCHEMA_GATEWAY_API_KEY_CREDENTIAL_PROVIDER.members[ - "credentialLocation" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GATEWAY_API_KEY_CREDENTIAL_PROVIDER, consumer=_consumer - ) - if "provider_arn" not in kwargs: - kwargs["provider_arn"] = "" - return kwargs - - -@dataclass(kw_only=True) -class IamCredentialProvider: - """ - An IAM credential provider for gateway authentication. This structure - contains the configuration for authenticating with the target endpoint - using IAM credentials and SigV4 signing. - """ - - service: str - """ - The target Amazon Web Services service name used for SigV4 signing. This - value identifies the service that the gateway authenticates with when - making requests to the target endpoint. - """ - - region: str | None = None - """ - The Amazon Web Services Region used for SigV4 signing. If not specified, - defaults to the gateway's Region. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IAM_CREDENTIAL_PROVIDER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_IAM_CREDENTIAL_PROVIDER.members["service"], self.service - ) - if self.region is not None: - serializer.write_string( - _SCHEMA_IAM_CREDENTIAL_PROVIDER.members["region"], self.region - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["service"] = de.read_string( - _SCHEMA_IAM_CREDENTIAL_PROVIDER.members["service"] - ) - - case 1: - kwargs["region"] = de.read_string( - _SCHEMA_IAM_CREDENTIAL_PROVIDER.members["region"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_IAM_CREDENTIAL_PROVIDER, consumer=_consumer) - if "service" not in kwargs: - kwargs["service"] = "" - return kwargs - - -def _serialize_o_auth_custom_parameters( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_o_auth_custom_parameters( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -class OAuthGrantType(UnknownEnumMixin, StrEnum): - CLIENT_CREDENTIALS = "CLIENT_CREDENTIALS" - AUTHORIZATION_CODE = "AUTHORIZATION_CODE" - TOKEN_EXCHANGE = "TOKEN_EXCHANGE" - - -def _serialize_o_auth_scopes( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_o_auth_scopes( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class OAuthCredentialProvider: - """ - An OAuth credential provider for gateway authentication. This structure - contains the configuration for authenticating with the target endpoint - using OAuth. - """ - - provider_arn: str - """ - The Amazon Resource Name (ARN) of the OAuth credential provider. This - ARN identifies the provider in Amazon Web Services. - """ - - scopes: list[str] - """ - The OAuth scopes for the credential provider. These scopes define the - level of access requested from the OAuth provider. - """ - - custom_parameters: dict[str, str] | None = None - """ - The custom parameters for the OAuth credential provider. These - parameters provide additional configuration for the OAuth authentication - process. - """ - - grant_type: str = OAuthGrantType("CLIENT_CREDENTIALS") - """ - Specifies the kind of credentials to use for authorization: - - - `CLIENT_CREDENTIALS` - Authorization with a client ID and secret. - - - `AUTHORIZATION_CODE` - Authorization with a token that is specific to - an individual end user. - - - `TOKEN_EXCHANGE` - Authorization using on-behalf-of token exchange. An - inbound user token is exchanged for a downstream access token scoped - to the target audience. - """ - - default_return_url: str | None = None - """ - The URL where the end user's browser is redirected after obtaining the - authorization code. Generally points to the customer's application. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_O_AUTH_CREDENTIAL_PROVIDER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_O_AUTH_CREDENTIAL_PROVIDER.members["providerArn"], self.provider_arn - ) - _serialize_o_auth_scopes( - serializer, - _SCHEMA_O_AUTH_CREDENTIAL_PROVIDER.members["scopes"], - self.scopes, - ) - if self.custom_parameters is not None: - _serialize_o_auth_custom_parameters( - serializer, - _SCHEMA_O_AUTH_CREDENTIAL_PROVIDER.members["customParameters"], - self.custom_parameters, - ) - - serializer.write_string( - _SCHEMA_O_AUTH_CREDENTIAL_PROVIDER.members["grantType"], self.grant_type - ) - if self.default_return_url is not None: - serializer.write_string( - _SCHEMA_O_AUTH_CREDENTIAL_PROVIDER.members["defaultReturnUrl"], - self.default_return_url, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["provider_arn"] = de.read_string( - _SCHEMA_O_AUTH_CREDENTIAL_PROVIDER.members["providerArn"] - ) - - case 1: - kwargs["scopes"] = _deserialize_o_auth_scopes( - de, _SCHEMA_O_AUTH_CREDENTIAL_PROVIDER.members["scopes"] - ) - - case 2: - kwargs["custom_parameters"] = _deserialize_o_auth_custom_parameters( - de, - _SCHEMA_O_AUTH_CREDENTIAL_PROVIDER.members["customParameters"], - ) - - case 3: - kwargs["grant_type"] = OAuthGrantType( - de.read_string( - _SCHEMA_O_AUTH_CREDENTIAL_PROVIDER.members["grantType"] - ) - ) - - case 4: - kwargs["default_return_url"] = de.read_string( - _SCHEMA_O_AUTH_CREDENTIAL_PROVIDER.members["defaultReturnUrl"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_O_AUTH_CREDENTIAL_PROVIDER, consumer=_consumer) - if "provider_arn" not in kwargs: - kwargs["provider_arn"] = "" - if "scopes" not in kwargs: - kwargs["scopes"] = [] - return kwargs - - -@dataclass -class CredentialProviderOauthCredentialProvider: - """ - The OAuth credential provider. This provider uses OAuth authentication - to access the target endpoint. - """ - - value: OAuthCredentialProvider - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREDENTIAL_PROVIDER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CREDENTIAL_PROVIDER.members["oauthCredentialProvider"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=OAuthCredentialProvider.deserialize(deserializer)) - - -@dataclass -class CredentialProviderApiKeyCredentialProvider: - """ - The API key credential provider. This provider uses an API key to - authenticate with the target endpoint. - """ - - value: GatewayApiKeyCredentialProvider - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREDENTIAL_PROVIDER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CREDENTIAL_PROVIDER.members["apiKeyCredentialProvider"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=GatewayApiKeyCredentialProvider.deserialize(deserializer)) - - -@dataclass -class CredentialProviderIamCredentialProvider: - """ - The IAM credential provider. This provider uses IAM authentication with - SigV4 signing to access the target endpoint. - """ - - value: IamCredentialProvider - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREDENTIAL_PROVIDER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CREDENTIAL_PROVIDER.members["iamCredentialProvider"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=IamCredentialProvider.deserialize(deserializer)) - - -@dataclass -class CredentialProviderUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -CredentialProvider = Union[ - CredentialProviderOauthCredentialProvider - | CredentialProviderApiKeyCredentialProvider - | CredentialProviderIamCredentialProvider - | CredentialProviderUnknown -] -""" -A credential provider for gateway authentication. This structure -contains the configuration for authenticating with the target endpoint. -""" - - -class _CredentialProviderDeserializer: - _result: CredentialProvider | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> CredentialProvider: - self._result = None - deserializer.read_struct(_SCHEMA_CREDENTIAL_PROVIDER, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - CredentialProviderOauthCredentialProvider.deserialize(de) - ) - - case 1: - self._set_result( - CredentialProviderApiKeyCredentialProvider.deserialize(de) - ) - - case 2: - self._set_result( - CredentialProviderIamCredentialProvider.deserialize(de) - ) - - case _: - self._set_result( - CredentialProviderUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: CredentialProvider) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class CredentialProviderType(UnknownEnumMixin, StrEnum): - GATEWAY_IAM_ROLE = "GATEWAY_IAM_ROLE" - OAUTH = "OAUTH" - API_KEY = "API_KEY" - CALLER_IAM_CREDENTIALS = "CALLER_IAM_CREDENTIALS" - JWT_PASSTHROUGH = "JWT_PASSTHROUGH" - - -@dataclass(kw_only=True) -class CredentialProviderConfiguration: - """ - The configuration for a credential provider. This structure defines how - the gateway authenticates with the target endpoint. - """ - - credential_provider_type: str - """ - The type of credential provider. This field specifies which - authentication method the gateway uses. - """ - - credential_provider: CredentialProvider | None = None - """ - The credential provider. This field contains the specific configuration - for the credential provider type. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREDENTIAL_PROVIDER_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREDENTIAL_PROVIDER_CONFIGURATION.members["credentialProviderType"], - self.credential_provider_type, - ) - if self.credential_provider is not None: - serializer.write_struct( - _SCHEMA_CREDENTIAL_PROVIDER_CONFIGURATION.members["credentialProvider"], - self.credential_provider, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["credential_provider_type"] = CredentialProviderType( - de.read_string( - _SCHEMA_CREDENTIAL_PROVIDER_CONFIGURATION.members[ - "credentialProviderType" - ] - ) - ) - - case 1: - kwargs["credential_provider"] = ( - _CredentialProviderDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREDENTIAL_PROVIDER_CONFIGURATION, consumer=_consumer - ) - if "credential_provider_type" not in kwargs: - kwargs["credential_provider_type"] = CredentialProviderType._corrected("") - return kwargs - - -def _serialize_credential_provider_configurations( - serializer: ShapeSerializer, - schema: Schema, - value: list[CredentialProviderConfiguration], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_credential_provider_configurations( - deserializer: ShapeDeserializer, schema: Schema -) -> list[CredentialProviderConfiguration]: - result: list[CredentialProviderConfiguration] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(CredentialProviderConfiguration.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class MetadataConfiguration: - """ - Configuration for HTTP header and query parameter propagation between - the gateway and target servers. - """ - - allowed_request_headers: list[str] | None = None - """ - A list of HTTP headers that are allowed to be propagated from incoming - client requests to the target. - """ - - allowed_query_parameters: list[str] | None = None - """ - A list of URL query parameters that are allowed to be propagated from - incoming gateway URL to the target. - """ - - allowed_response_headers: list[str] | None = None - """ - A list of HTTP headers that are allowed to be propagated from the target - response back to the client. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_METADATA_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.allowed_request_headers is not None: - _serialize_allowed_request_headers( - serializer, - _SCHEMA_METADATA_CONFIGURATION.members["allowedRequestHeaders"], - self.allowed_request_headers, - ) - - if self.allowed_query_parameters is not None: - _serialize_allowed_query_parameters( - serializer, - _SCHEMA_METADATA_CONFIGURATION.members["allowedQueryParameters"], - self.allowed_query_parameters, - ) - - if self.allowed_response_headers is not None: - _serialize_allowed_response_headers( - serializer, - _SCHEMA_METADATA_CONFIGURATION.members["allowedResponseHeaders"], - self.allowed_response_headers, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["allowed_request_headers"] = ( - _deserialize_allowed_request_headers( - de, - _SCHEMA_METADATA_CONFIGURATION.members[ - "allowedRequestHeaders" - ], - ) - ) - - case 1: - kwargs["allowed_query_parameters"] = ( - _deserialize_allowed_query_parameters( - de, - _SCHEMA_METADATA_CONFIGURATION.members[ - "allowedQueryParameters" - ], - ) - ) - - case 2: - kwargs["allowed_response_headers"] = ( - _deserialize_allowed_response_headers( - de, - _SCHEMA_METADATA_CONFIGURATION.members[ - "allowedResponseHeaders" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_METADATA_CONFIGURATION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class S3Configuration: - """ - The Amazon S3 configuration for a gateway. This structure defines how - the gateway accesses files in Amazon S3. - """ - - uri: str | None = None - """ - The URI of the Amazon S3 object. This URI specifies the location of the - object in Amazon S3. - """ - - bucket_owner_account_id: str | None = None - """ - The account ID of the Amazon S3 bucket owner. This ID is used for - cross-account access to the bucket. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_S3_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.uri is not None: - serializer.write_string(_SCHEMA_S3_CONFIGURATION.members["uri"], self.uri) - - if self.bucket_owner_account_id is not None: - serializer.write_string( - _SCHEMA_S3_CONFIGURATION.members["bucketOwnerAccountId"], - self.bucket_owner_account_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["uri"] = de.read_string( - _SCHEMA_S3_CONFIGURATION.members["uri"] - ) - - case 1: - kwargs["bucket_owner_account_id"] = de.read_string( - _SCHEMA_S3_CONFIGURATION.members["bucketOwnerAccountId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_S3_CONFIGURATION, consumer=_consumer) - return kwargs - - -@dataclass -class ApiSchemaConfigurationS3: - """ - The Amazon S3 configuration for a gateway. This structure defines how - the gateway accesses files in Amazon S3. - """ - - value: S3Configuration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_API_SCHEMA_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_API_SCHEMA_CONFIGURATION.members["s3"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=S3Configuration.deserialize(deserializer)) - - -@dataclass -class ApiSchemaConfigurationInlinePayload: - """The inline payload containing the API schema definition.""" - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_API_SCHEMA_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_API_SCHEMA_CONFIGURATION.members["inlinePayload"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string( - _SCHEMA_API_SCHEMA_CONFIGURATION.members["inlinePayload"] - ) - ) - - -@dataclass -class ApiSchemaConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ApiSchemaConfiguration = Union[ - ApiSchemaConfigurationS3 - | ApiSchemaConfigurationInlinePayload - | ApiSchemaConfigurationUnknown -] -"""Configuration for API schema.""" - - -class _ApiSchemaConfigurationDeserializer: - _result: ApiSchemaConfiguration | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> ApiSchemaConfiguration: - self._result = None - deserializer.read_struct(_SCHEMA_API_SCHEMA_CONFIGURATION, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(ApiSchemaConfigurationS3.deserialize(de)) - - case 1: - self._set_result(ApiSchemaConfigurationInlinePayload.deserialize(de)) - - case _: - self._set_result( - ApiSchemaConfigurationUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: ApiSchemaConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class HttpApiSchemaConfiguration: - """ - The API schema configuration for an HTTP target. This schema defines the - API structure that the target exposes. - """ - - source: ApiSchemaConfiguration - """Configuration for API schema.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HTTP_API_SCHEMA_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HTTP_API_SCHEMA_CONFIGURATION.members["source"], self.source - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["source"] = ( - _ApiSchemaConfigurationDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_HTTP_API_SCHEMA_CONFIGURATION, consumer=_consumer - ) - if "source" not in kwargs: - kwargs["source"] = ApiSchemaConfigurationUnknown(tag="") - return kwargs - - -@dataclass(kw_only=True) -class RuntimeTargetConfiguration: - """ - Configuration for an AgentCore Runtime target. Specifies the agent - runtime to route requests to via HTTP. - """ - - arn: str - """ - The Amazon Resource Name (ARN) of the AgentCore Runtime to route - requests to. - """ - - qualifier: str | None = None - """ - The qualifier for the agent runtime, used to target a specific endpoint - version. If not specified, the default endpoint is used. - """ - - schema: HttpApiSchemaConfiguration | None = None - """ - The API schema configuration that defines the structure of the runtime - target's API. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RUNTIME_TARGET_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_RUNTIME_TARGET_CONFIGURATION.members["arn"], self.arn - ) - if self.qualifier is not None: - serializer.write_string( - _SCHEMA_RUNTIME_TARGET_CONFIGURATION.members["qualifier"], - self.qualifier, - ) - - if self.schema is not None: - serializer.write_struct( - _SCHEMA_RUNTIME_TARGET_CONFIGURATION.members["schema"], self.schema - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["arn"] = de.read_string( - _SCHEMA_RUNTIME_TARGET_CONFIGURATION.members["arn"] - ) - - case 1: - kwargs["qualifier"] = de.read_string( - _SCHEMA_RUNTIME_TARGET_CONFIGURATION.members["qualifier"] - ) - - case 2: - kwargs["schema"] = HttpApiSchemaConfiguration.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RUNTIME_TARGET_CONFIGURATION, consumer=_consumer - ) - if "arn" not in kwargs: - kwargs["arn"] = "" - return kwargs - - -def _serialize_http_connector_parameters( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_http_connector_parameters( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class HttpConnectorSource: - """The source identifying the HTTP connector integration.""" - - connector_id: str - """The identifier for the HTTP connector integration.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HTTP_CONNECTOR_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HTTP_CONNECTOR_SOURCE.members["connectorId"], self.connector_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["connector_id"] = de.read_string( - _SCHEMA_HTTP_CONNECTOR_SOURCE.members["connectorId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_HTTP_CONNECTOR_SOURCE, consumer=_consumer) - if "connector_id" not in kwargs: - kwargs["connector_id"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(connector_id="") - - -@dataclass(kw_only=True) -class HttpConnectorTargetConfiguration: - """ - The configuration for an HTTP connector target. Use this configuration - when you want to route HTTP requests through a managed connector. - """ - - source: HttpConnectorSource - """The source configuration identifying which HTTP connector to use.""" - - parameters: dict[str, str] | None = None - """ - The resource parameters for this connector (for example, `memoryId`). - The service validates these parameters against the request path at - runtime. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HTTP_CONNECTOR_TARGET_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HTTP_CONNECTOR_TARGET_CONFIGURATION.members["source"], self.source - ) - if self.parameters is not None: - _serialize_http_connector_parameters( - serializer, - _SCHEMA_HTTP_CONNECTOR_TARGET_CONFIGURATION.members["parameters"], - self.parameters, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["source"] = HttpConnectorSource.deserialize(de) - - case 1: - kwargs["parameters"] = _deserialize_http_connector_parameters( - de, - _SCHEMA_HTTP_CONNECTOR_TARGET_CONFIGURATION.members[ - "parameters" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_HTTP_CONNECTOR_TARGET_CONFIGURATION, consumer=_consumer - ) - if "source" not in kwargs: - kwargs["source"] = HttpConnectorSource._smithy_default() - return kwargs - - -class PassthroughProtocolType(UnknownEnumMixin, StrEnum): - MCP = "MCP" - A2_A = "A2A" - INFERENCE = "INFERENCE" - CUSTOM = "CUSTOM" - - -class StaticQueryParameterConflictResolution(UnknownEnumMixin, StrEnum): - """ - The precedence used when a client-supplied query parameter has the same - name as a configured static query parameter: - - - `CLIENT_OVERRIDE` - The client-supplied value overrides the configured - static value for that parameter name. This is the default. - - - `STATIC_OVERRIDE` - The configured static value is retained, - overriding the client-supplied value for that parameter name. - """ - - CLIENT_OVERRIDE = "CLIENT_OVERRIDE" - STATIC_OVERRIDE = "STATIC_OVERRIDE" - - -def _serialize_static_query_parameters( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_static_query_parameters( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -def _serialize_composite_identifier_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_composite_identifier_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class StickinessConfiguration: - """ - The configuration for session-sticky routing to a target. Session - stickiness routes requests that share a session identifier to the same - target. - """ - - identifier: str - """ - The expression that identifies where to extract the session identifier - from the request (for example, `$context.header.x-session-id`). - """ - - timeout: int | None = None - """ - The session stickiness timeout, in seconds. After this duration of - inactivity, the session affinity expires. Valid values range from 1 to - 86400. - """ - - composite_identifier: list[str] | None = None - """ - Additional headers to include in session affinity routing. When set, - requests are only considered part of the same session if both the - `identifier` and all composite identifier values match. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STICKINESS_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_STICKINESS_CONFIGURATION.members["identifier"], self.identifier - ) - if self.timeout is not None: - serializer.write_integer( - _SCHEMA_STICKINESS_CONFIGURATION.members["timeout"], self.timeout - ) - - if self.composite_identifier is not None: - _serialize_composite_identifier_list( - serializer, - _SCHEMA_STICKINESS_CONFIGURATION.members["compositeIdentifier"], - self.composite_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["identifier"] = de.read_string( - _SCHEMA_STICKINESS_CONFIGURATION.members["identifier"] - ) - - case 1: - kwargs["timeout"] = de.read_integer( - _SCHEMA_STICKINESS_CONFIGURATION.members["timeout"] - ) - - case 2: - kwargs["composite_identifier"] = ( - _deserialize_composite_identifier_list( - de, - _SCHEMA_STICKINESS_CONFIGURATION.members[ - "compositeIdentifier" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_STICKINESS_CONFIGURATION, consumer=_consumer) - if "identifier" not in kwargs: - kwargs["identifier"] = "" - return kwargs - - -@dataclass(kw_only=True) -class PassthroughTargetConfiguration: - """ - The configuration for an HTTP passthrough target. A passthrough target - forwards requests directly to an external HTTP endpoint. - """ - - endpoint: str - """ - The HTTPS endpoint that the gateway forwards requests to for this - passthrough target. - """ - - protocol_type: str - """ - The application protocol that the passthrough target implements. This - value is required for passthrough targets: - - - `MCP` - The Model Context Protocol. - - - `A2A` - The Agent-to-Agent protocol. - - - `INFERENCE` - The protocol for routing requests to a large language - model (LLM) provider. - - - `CUSTOM` - A custom application protocol. - """ - - schema: HttpApiSchemaConfiguration | None = None - """ - The API schema configuration that defines the structure of the - passthrough target's API. - """ - - stickiness_configuration: StickinessConfiguration | None = None - """ - The session stickiness configuration for the passthrough target. This - configuration routes requests within the same session to the same - target. - """ - - static_query_parameters: dict[str, str] | None = None - """ - A map of static query parameters that the gateway always appends to the - outbound URL when forwarding requests to the target. The total outbound - URL length, which includes the endpoint and the percent-encoded query - parameters, is enforced by the service. - """ - - static_query_parameter_conflict_resolution: str | None = None - """ - Controls precedence when a client request supplies a query parameter - whose name matches a configured static query parameter. If not set, - defaults to `CLIENT_OVERRIDE`: - - - `CLIENT_OVERRIDE` - The client-supplied value overrides the configured - static value for that parameter name. - - - `STATIC_OVERRIDE` - The configured static value is retained, - overriding the client-supplied value for that parameter name. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PASSTHROUGH_TARGET_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_PASSTHROUGH_TARGET_CONFIGURATION.members["endpoint"], self.endpoint - ) - serializer.write_string( - _SCHEMA_PASSTHROUGH_TARGET_CONFIGURATION.members["protocolType"], - self.protocol_type, - ) - if self.schema is not None: - serializer.write_struct( - _SCHEMA_PASSTHROUGH_TARGET_CONFIGURATION.members["schema"], self.schema - ) - - if self.stickiness_configuration is not None: - serializer.write_struct( - _SCHEMA_PASSTHROUGH_TARGET_CONFIGURATION.members[ - "stickinessConfiguration" - ], - self.stickiness_configuration, - ) - - if self.static_query_parameters is not None: - _serialize_static_query_parameters( - serializer, - _SCHEMA_PASSTHROUGH_TARGET_CONFIGURATION.members[ - "staticQueryParameters" - ], - self.static_query_parameters, - ) - - if self.static_query_parameter_conflict_resolution is not None: - serializer.write_string( - _SCHEMA_PASSTHROUGH_TARGET_CONFIGURATION.members[ - "staticQueryParameterConflictResolution" - ], - self.static_query_parameter_conflict_resolution, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["endpoint"] = de.read_string( - _SCHEMA_PASSTHROUGH_TARGET_CONFIGURATION.members["endpoint"] - ) - - case 1: - kwargs["protocol_type"] = PassthroughProtocolType( - de.read_string( - _SCHEMA_PASSTHROUGH_TARGET_CONFIGURATION.members[ - "protocolType" - ] - ) - ) - - case 2: - kwargs["schema"] = HttpApiSchemaConfiguration.deserialize(de) - - case 3: - kwargs["stickiness_configuration"] = ( - StickinessConfiguration.deserialize(de) - ) - - case 4: - kwargs["static_query_parameters"] = ( - _deserialize_static_query_parameters( - de, - _SCHEMA_PASSTHROUGH_TARGET_CONFIGURATION.members[ - "staticQueryParameters" - ], - ) - ) - - case 5: - kwargs["static_query_parameter_conflict_resolution"] = ( - StaticQueryParameterConflictResolution( - de.read_string( - _SCHEMA_PASSTHROUGH_TARGET_CONFIGURATION.members[ - "staticQueryParameterConflictResolution" - ] - ) - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PASSTHROUGH_TARGET_CONFIGURATION, consumer=_consumer - ) - if "endpoint" not in kwargs: - kwargs["endpoint"] = "" - if "protocol_type" not in kwargs: - kwargs["protocol_type"] = PassthroughProtocolType._corrected("") - return kwargs - - -@dataclass -class HttpTargetConfigurationAgentcoreRuntime: - """ - The AgentCore Runtime target configuration for HTTP-based communication - with an agent runtime. - """ - - value: RuntimeTargetConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HTTP_TARGET_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HTTP_TARGET_CONFIGURATION.members["agentcoreRuntime"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=RuntimeTargetConfiguration.deserialize(deserializer)) - - -@dataclass -class HttpTargetConfigurationPassthrough: - """ - The passthrough configuration for the HTTP target. A passthrough target - forwards requests directly to an external HTTP endpoint. - """ - - value: PassthroughTargetConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HTTP_TARGET_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HTTP_TARGET_CONFIGURATION.members["passthrough"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=PassthroughTargetConfiguration.deserialize(deserializer)) - - -@dataclass -class HttpTargetConfigurationConnector: - """ - The connector-based configuration for the HTTP target. Use this - configuration when you want to route HTTP requests through a managed - connector. - """ - - value: HttpConnectorTargetConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HTTP_TARGET_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HTTP_TARGET_CONFIGURATION.members["connector"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HttpConnectorTargetConfiguration.deserialize(deserializer)) - - -@dataclass -class HttpTargetConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -HttpTargetConfiguration = Union[ - HttpTargetConfigurationAgentcoreRuntime - | HttpTargetConfigurationPassthrough - | HttpTargetConfigurationConnector - | HttpTargetConfigurationUnknown -] -""" -The HTTP target configuration for a gateway target. Contains the -configuration for HTTP-based target endpoints. -""" - - -class _HttpTargetConfigurationDeserializer: - _result: HttpTargetConfiguration | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> HttpTargetConfiguration: - self._result = None - deserializer.read_struct(_SCHEMA_HTTP_TARGET_CONFIGURATION, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - HttpTargetConfigurationAgentcoreRuntime.deserialize(de) - ) - - case 1: - self._set_result(HttpTargetConfigurationPassthrough.deserialize(de)) - - case 2: - self._set_result(HttpTargetConfigurationConnector.deserialize(de)) - - case _: - self._set_result( - HttpTargetConfigurationUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: HttpTargetConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class InferenceConnectorSource: - """The source identifying the inference connector.""" - - connector_id: str - """ - The identifier for the inference connector (for example, - `bedrock-mantle`, `openai`, or `anthropic`). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INFERENCE_CONNECTOR_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_INFERENCE_CONNECTOR_SOURCE.members["connectorId"], self.connector_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["connector_id"] = de.read_string( - _SCHEMA_INFERENCE_CONNECTOR_SOURCE.members["connectorId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INFERENCE_CONNECTOR_SOURCE, consumer=_consumer) - if "connector_id" not in kwargs: - kwargs["connector_id"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(connector_id="") - - -@dataclass(kw_only=True) -class InferenceConnectorTargetConfiguration: - """ - The configuration for a connector-based inference target. This - configuration uses a built-in connector that provides predefined rules - for a large language model (LLM) provider. - """ - - source: InferenceConnectorSource - """The source configuration identifying which inference connector to use.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INFERENCE_CONNECTOR_TARGET_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INFERENCE_CONNECTOR_TARGET_CONFIGURATION.members["source"], - self.source, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["source"] = InferenceConnectorSource.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INFERENCE_CONNECTOR_TARGET_CONFIGURATION, consumer=_consumer - ) - if "source" not in kwargs: - kwargs["source"] = InferenceConnectorSource._smithy_default() - return kwargs - - -@dataclass(kw_only=True) -class ProviderPrefix: - """ - The configuration that controls how a provider prefix is applied to - model IDs during translation. - """ - - strip: bool = False - """ - Whether clients can omit the provider prefix from model IDs. If `true`, - the gateway accepts model IDs without the prefix and restores the full - prefixed form before forwarding to the provider. The default is `false`. - """ - - separator: str = "." - """ - The single character that separates the provider prefix from the model - name (for example, `.`). The default is `.`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PROVIDER_PREFIX, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_boolean(_SCHEMA_PROVIDER_PREFIX.members["strip"], self.strip) - serializer.write_string( - _SCHEMA_PROVIDER_PREFIX.members["separator"], self.separator - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["strip"] = de.read_boolean( - _SCHEMA_PROVIDER_PREFIX.members["strip"] - ) - - case 1: - kwargs["separator"] = de.read_string( - _SCHEMA_PROVIDER_PREFIX.members["separator"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PROVIDER_PREFIX, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ModelMapping: - """ - The configuration that translates model IDs between client-facing names - and provider model IDs. - """ - - provider_prefix: ProviderPrefix | None = None - """The provider prefix configuration used for model ID translation.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MODEL_MAPPING, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.provider_prefix is not None: - serializer.write_struct( - _SCHEMA_MODEL_MAPPING.members["providerPrefix"], self.provider_prefix - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["provider_prefix"] = ProviderPrefix.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MODEL_MAPPING, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ModelEntry: - """ - A model entry that specifies a model supported for an inference - operation. - """ - - model: str - """ - The model ID or glob pattern that identifies the model (for example, - `anthropic.claude-opus-*` or `openai.gpt-oss-*`). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MODEL_ENTRY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_MODEL_ENTRY.members["model"], self.model) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model"] = de.read_string( - _SCHEMA_MODEL_ENTRY.members["model"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MODEL_ENTRY, consumer=_consumer) - if "model" not in kwargs: - kwargs["model"] = "" - return kwargs - - -def _serialize_model_entries( - serializer: ShapeSerializer, schema: Schema, value: list[ModelEntry] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_model_entries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ModelEntry]: - result: list[ModelEntry] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ModelEntry.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class InferenceOperationConfiguration: - """ - The configuration for a specific inference operation, including its - request path and the models that the operation supports. - """ - - path: str - """ - The request path for this operation (for example, `/v1/messages` or - `/v1/responses`). - """ - - provider_path: str | None = None - """ - The provider path to forward requests to, if it differs from the request - path. For example, `/anthropic/v1/messages` when the provider expects a - different path than the client-facing `/v1/messages`. - """ - - models: list[ModelEntry] | None = None - """The list of models supported for this operation.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INFERENCE_OPERATION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_INFERENCE_OPERATION_CONFIGURATION.members["path"], self.path - ) - if self.provider_path is not None: - serializer.write_string( - _SCHEMA_INFERENCE_OPERATION_CONFIGURATION.members["providerPath"], - self.provider_path, - ) - - if self.models is not None: - _serialize_model_entries( - serializer, - _SCHEMA_INFERENCE_OPERATION_CONFIGURATION.members["models"], - self.models, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["path"] = de.read_string( - _SCHEMA_INFERENCE_OPERATION_CONFIGURATION.members["path"] - ) - - case 1: - kwargs["provider_path"] = de.read_string( - _SCHEMA_INFERENCE_OPERATION_CONFIGURATION.members[ - "providerPath" - ] - ) - - case 2: - kwargs["models"] = _deserialize_model_entries( - de, _SCHEMA_INFERENCE_OPERATION_CONFIGURATION.members["models"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INFERENCE_OPERATION_CONFIGURATION, consumer=_consumer - ) - if "path" not in kwargs: - kwargs["path"] = "" - return kwargs - - -def _serialize_inference_operation_configurations( - serializer: ShapeSerializer, - schema: Schema, - value: list[InferenceOperationConfiguration], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_inference_operation_configurations( - deserializer: ShapeDeserializer, schema: Schema -) -> list[InferenceOperationConfiguration]: - result: list[InferenceOperationConfiguration] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(InferenceOperationConfiguration.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class InferenceProviderTargetConfiguration: - """ - The configuration for a provider-based inference target. This - configuration explicitly defines the endpoint, model mapping, and - operations used to route requests to a large language model (LLM) - provider. - """ - - endpoint: str - """ - The HTTPS endpoint of the inference provider that the gateway forwards - requests to. - """ - - model_mapping: ModelMapping | None = None - """ - The configuration that translates client-facing model IDs to the model - IDs expected by the provider. - """ - - operations: list[InferenceOperationConfiguration] | None = None - """ - A list of per-operation configurations that map request paths to the - models supported for each operation. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INFERENCE_PROVIDER_TARGET_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_INFERENCE_PROVIDER_TARGET_CONFIGURATION.members["endpoint"], - self.endpoint, - ) - if self.model_mapping is not None: - serializer.write_struct( - _SCHEMA_INFERENCE_PROVIDER_TARGET_CONFIGURATION.members["modelMapping"], - self.model_mapping, - ) - - if self.operations is not None: - _serialize_inference_operation_configurations( - serializer, - _SCHEMA_INFERENCE_PROVIDER_TARGET_CONFIGURATION.members["operations"], - self.operations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["endpoint"] = de.read_string( - _SCHEMA_INFERENCE_PROVIDER_TARGET_CONFIGURATION.members[ - "endpoint" - ] - ) - - case 1: - kwargs["model_mapping"] = ModelMapping.deserialize(de) - - case 2: - kwargs["operations"] = ( - _deserialize_inference_operation_configurations( - de, - _SCHEMA_INFERENCE_PROVIDER_TARGET_CONFIGURATION.members[ - "operations" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INFERENCE_PROVIDER_TARGET_CONFIGURATION, consumer=_consumer - ) - if "endpoint" not in kwargs: - kwargs["endpoint"] = "" - return kwargs - - -@dataclass -class InferenceTargetConfigurationConnector: - """ - The connector-based inference configuration. Use this option to route - requests to an LLM provider through a built-in connector that includes - predefined provider rules. - """ - - value: InferenceConnectorTargetConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INFERENCE_TARGET_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INFERENCE_TARGET_CONFIGURATION.members["connector"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=InferenceConnectorTargetConfiguration.deserialize(deserializer) - ) - - -@dataclass -class InferenceTargetConfigurationProvider: - """ - The provider-based inference configuration. Use this option to - explicitly configure the endpoint, model mapping, and operations for an - LLM provider. - """ - - value: InferenceProviderTargetConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INFERENCE_TARGET_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INFERENCE_TARGET_CONFIGURATION.members["provider"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=InferenceProviderTargetConfiguration.deserialize(deserializer)) - - -@dataclass -class InferenceTargetConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -InferenceTargetConfiguration = Union[ - InferenceTargetConfigurationConnector - | InferenceTargetConfigurationProvider - | InferenceTargetConfigurationUnknown -] -""" -The configuration for an inference target. An inference target routes -requests to a large language model (LLM) provider, either through a -built-in connector or an explicitly configured provider. -""" - - -class _InferenceTargetConfigurationDeserializer: - _result: InferenceTargetConfiguration | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> InferenceTargetConfiguration: - self._result = None - deserializer.read_struct(_SCHEMA_INFERENCE_TARGET_CONFIGURATION, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(InferenceTargetConfigurationConnector.deserialize(de)) - - case 1: - self._set_result(InferenceTargetConfigurationProvider.deserialize(de)) - - case _: - self._set_result( - InferenceTargetConfigurationUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: InferenceTargetConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class RestApiMethod(UnknownEnumMixin, StrEnum): - GET = "GET" - DELETE = "DELETE" - HEAD = "HEAD" - OPTIONS = "OPTIONS" - PATCH = "PATCH" - PUT = "PUT" - POST = "POST" - - -def _serialize_rest_api_methods( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_rest_api_methods( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(RestApiMethod(d.read_string(member_schema))) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ApiGatewayToolFilter: - """ - Specifies which operations from an API Gateway REST API are exposed as - tools. Tool names and descriptions are derived from the operationId and - description fields in the API's exported OpenAPI specification. - """ - - filter_path: str - """ - Resource path to match in the REST API. Supports exact paths (for - example, `/pets`) or wildcard paths (for example, `/pets/*` to match all - paths under `/pets`). Must match existing paths in the REST API. - """ - - methods: list[str] - """The methods to filter for.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_API_GATEWAY_TOOL_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_API_GATEWAY_TOOL_FILTER.members["filterPath"], self.filter_path - ) - _serialize_rest_api_methods( - serializer, _SCHEMA_API_GATEWAY_TOOL_FILTER.members["methods"], self.methods - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["filter_path"] = de.read_string( - _SCHEMA_API_GATEWAY_TOOL_FILTER.members["filterPath"] - ) - - case 1: - kwargs["methods"] = _deserialize_rest_api_methods( - de, _SCHEMA_API_GATEWAY_TOOL_FILTER.members["methods"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_API_GATEWAY_TOOL_FILTER, consumer=_consumer) - if "filter_path" not in kwargs: - kwargs["filter_path"] = "" - if "methods" not in kwargs: - kwargs["methods"] = [] - return kwargs - - -def _serialize_api_gateway_tool_filters( - serializer: ShapeSerializer, schema: Schema, value: list[ApiGatewayToolFilter] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_api_gateway_tool_filters( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ApiGatewayToolFilter]: - result: list[ApiGatewayToolFilter] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ApiGatewayToolFilter.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ApiGatewayToolOverride: - """Settings to override configurations for a tool.""" - - name: str - """The name of tool. Identifies the tool in the Model Context Protocol.""" - - path: str - """ - Resource path in the REST API (e.g., `/pets`). Must explicitly match an - existing path in the REST API. - """ - - method: str - """The HTTP method to expose for the specified path.""" - - description: str | None = None - """ - The description of the tool. Provides information about the purpose and - usage of the tool. If not provided, uses the description from the API's - OpenAPI specification. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_API_GATEWAY_TOOL_OVERRIDE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_API_GATEWAY_TOOL_OVERRIDE.members["name"], self.name - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_API_GATEWAY_TOOL_OVERRIDE.members["description"], - self.description, - ) - - serializer.write_string( - _SCHEMA_API_GATEWAY_TOOL_OVERRIDE.members["path"], self.path - ) - serializer.write_string( - _SCHEMA_API_GATEWAY_TOOL_OVERRIDE.members["method"], self.method - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_API_GATEWAY_TOOL_OVERRIDE.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_API_GATEWAY_TOOL_OVERRIDE.members["description"] - ) - - case 2: - kwargs["path"] = de.read_string( - _SCHEMA_API_GATEWAY_TOOL_OVERRIDE.members["path"] - ) - - case 3: - kwargs["method"] = RestApiMethod( - de.read_string( - _SCHEMA_API_GATEWAY_TOOL_OVERRIDE.members["method"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_API_GATEWAY_TOOL_OVERRIDE, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "path" not in kwargs: - kwargs["path"] = "" - if "method" not in kwargs: - kwargs["method"] = RestApiMethod._corrected("") - return kwargs - - -def _serialize_api_gateway_tool_overrides( - serializer: ShapeSerializer, schema: Schema, value: list[ApiGatewayToolOverride] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_api_gateway_tool_overrides( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ApiGatewayToolOverride]: - result: list[ApiGatewayToolOverride] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ApiGatewayToolOverride.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ApiGatewayToolConfiguration: - """ - The configuration for defining REST API tool filters and overrides for - the gateway target. - """ - - tool_filters: list[ApiGatewayToolFilter] - """ - A list of path and method patterns to expose as tools using metadata - from the REST API's OpenAPI specification. - """ - - tool_overrides: list[ApiGatewayToolOverride] | None = None - """ - A list of explicit tool definitions with optional custom names and - descriptions. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_API_GATEWAY_TOOL_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.tool_overrides is not None: - _serialize_api_gateway_tool_overrides( - serializer, - _SCHEMA_API_GATEWAY_TOOL_CONFIGURATION.members["toolOverrides"], - self.tool_overrides, - ) - - _serialize_api_gateway_tool_filters( - serializer, - _SCHEMA_API_GATEWAY_TOOL_CONFIGURATION.members["toolFilters"], - self.tool_filters, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["tool_overrides"] = _deserialize_api_gateway_tool_overrides( - de, - _SCHEMA_API_GATEWAY_TOOL_CONFIGURATION.members["toolOverrides"], - ) - - case 1: - kwargs["tool_filters"] = _deserialize_api_gateway_tool_filters( - de, - _SCHEMA_API_GATEWAY_TOOL_CONFIGURATION.members["toolFilters"], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_API_GATEWAY_TOOL_CONFIGURATION, consumer=_consumer - ) - if "tool_filters" not in kwargs: - kwargs["tool_filters"] = [] - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(tool_filters=[]) - - -@dataclass(kw_only=True) -class ApiGatewayTargetConfiguration: - """The configuration for an Amazon API Gateway target.""" - - rest_api_id: str - """The ID of the API Gateway REST API.""" - - stage: str - """The ID of the stage of the REST API to add as a target.""" - - api_gateway_tool_configuration: ApiGatewayToolConfiguration - """ - The configuration for defining REST API tool filters and overrides for - the gateway target. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_API_GATEWAY_TARGET_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_API_GATEWAY_TARGET_CONFIGURATION.members["restApiId"], - self.rest_api_id, - ) - serializer.write_string( - _SCHEMA_API_GATEWAY_TARGET_CONFIGURATION.members["stage"], self.stage - ) - serializer.write_struct( - _SCHEMA_API_GATEWAY_TARGET_CONFIGURATION.members[ - "apiGatewayToolConfiguration" - ], - self.api_gateway_tool_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rest_api_id"] = de.read_string( - _SCHEMA_API_GATEWAY_TARGET_CONFIGURATION.members["restApiId"] - ) - - case 1: - kwargs["stage"] = de.read_string( - _SCHEMA_API_GATEWAY_TARGET_CONFIGURATION.members["stage"] - ) - - case 2: - kwargs["api_gateway_tool_configuration"] = ( - ApiGatewayToolConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_API_GATEWAY_TARGET_CONFIGURATION, consumer=_consumer - ) - if "rest_api_id" not in kwargs: - kwargs["rest_api_id"] = "" - if "stage" not in kwargs: - kwargs["stage"] = "" - if "api_gateway_tool_configuration" not in kwargs: - kwargs["api_gateway_tool_configuration"] = ( - ApiGatewayToolConfiguration._smithy_default() - ) - return kwargs - - -@dataclass(kw_only=True) -class ConnectorParameterOverride: - """ - Specifies a parameter override for a connector tool, allowing you to - control parameter visibility and descriptions. - """ - - path: str - """ - A JSON Pointer path identifying the parameter (for example, - `/numberOfResults` or `/filter`). - """ - - description: str | None = None - """An agent-facing description override for this parameter.""" - - visible: bool | None = None - """ - Whether this parameter is visible to the agent. If not specified, uses - the service default. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONNECTOR_PARAMETER_OVERRIDE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CONNECTOR_PARAMETER_OVERRIDE.members["path"], self.path - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_CONNECTOR_PARAMETER_OVERRIDE.members["description"], - self.description, - ) - - if self.visible is not None: - serializer.write_boolean( - _SCHEMA_CONNECTOR_PARAMETER_OVERRIDE.members["visible"], self.visible - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["path"] = de.read_string( - _SCHEMA_CONNECTOR_PARAMETER_OVERRIDE.members["path"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_CONNECTOR_PARAMETER_OVERRIDE.members["description"] - ) - - case 2: - kwargs["visible"] = de.read_boolean( - _SCHEMA_CONNECTOR_PARAMETER_OVERRIDE.members["visible"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CONNECTOR_PARAMETER_OVERRIDE, consumer=_consumer - ) - if "path" not in kwargs: - kwargs["path"] = "" - return kwargs - - -def _serialize_connector_parameter_overrides( - serializer: ShapeSerializer, schema: Schema, value: list[ConnectorParameterOverride] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_connector_parameter_overrides( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ConnectorParameterOverride]: - result: list[ConnectorParameterOverride] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ConnectorParameterOverride.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ConnectorConfiguration: - """Configuration for a single tool within a connector.""" - - name: str - """The tool or operation name (for example, `retrieve` or `webSearch`).""" - - description: str | None = None - """An agent-facing description override for this tool.""" - - parameter_values: Document | None = None - """ - Parameters to set as fixed or default values when provisioning this - tool. - """ - - parameter_overrides: list[ConnectorParameterOverride] | None = None - """ - Parameters to expose to the agent at runtime, with optional description - overrides. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONNECTOR_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CONNECTOR_CONFIGURATION.members["name"], self.name - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_CONNECTOR_CONFIGURATION.members["description"], self.description - ) - - if self.parameter_values is not None: - serializer.write_document( - _SCHEMA_CONNECTOR_CONFIGURATION.members["parameterValues"], - self.parameter_values, - ) - - if self.parameter_overrides is not None: - _serialize_connector_parameter_overrides( - serializer, - _SCHEMA_CONNECTOR_CONFIGURATION.members["parameterOverrides"], - self.parameter_overrides, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_CONNECTOR_CONFIGURATION.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_CONNECTOR_CONFIGURATION.members["description"] - ) - - case 2: - kwargs["parameter_values"] = de.read_document( - _SCHEMA_CONNECTOR_CONFIGURATION.members["parameterValues"] - ) - - case 3: - kwargs["parameter_overrides"] = ( - _deserialize_connector_parameter_overrides( - de, - _SCHEMA_CONNECTOR_CONFIGURATION.members[ - "parameterOverrides" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONNECTOR_CONFIGURATION, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - return kwargs - - -def _serialize_connector_configurations( - serializer: ShapeSerializer, schema: Schema, value: list[ConnectorConfiguration] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_connector_configurations( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ConnectorConfiguration]: - result: list[ConnectorConfiguration] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ConnectorConfiguration.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_enabled_connectors( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_enabled_connectors( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ConnectorSource: - """The source identifying the connector integration.""" - - connector_id: str - """ - The identifier for the connector integration (for example, - `bedrock-knowledge-bases`). - """ - - version: str | None = None - """ - The version of the connector to use (for example, `1.1.0`). If you - don't specify a version, the service uses the latest available version. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONNECTOR_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CONNECTOR_SOURCE.members["connectorId"], self.connector_id - ) - if self.version is not None: - serializer.write_string( - _SCHEMA_CONNECTOR_SOURCE.members["version"], self.version - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["connector_id"] = de.read_string( - _SCHEMA_CONNECTOR_SOURCE.members["connectorId"] - ) - - case 1: - kwargs["version"] = de.read_string( - _SCHEMA_CONNECTOR_SOURCE.members["version"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONNECTOR_SOURCE, consumer=_consumer) - if "connector_id" not in kwargs: - kwargs["connector_id"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(connector_id="") - - -@dataclass(kw_only=True) -class ConnectorTargetConfiguration: - """ - Configuration for a connector integration target. Connectors provide - pre-built integrations with Amazon Web Services services and third-party - tools. - """ - - source: ConnectorSource - """The source configuration identifying which connector to use.""" - - enabled: list[str] | None = None - """ - A list of tool names to enable from this connector. If absent, all tools - provided by the connector are enabled. - """ - - configurations: list[ConnectorConfiguration] | None = None - """A list of per-tool configurations for the connector.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONNECTOR_TARGET_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CONNECTOR_TARGET_CONFIGURATION.members["source"], self.source - ) - if self.enabled is not None: - _serialize_enabled_connectors( - serializer, - _SCHEMA_CONNECTOR_TARGET_CONFIGURATION.members["enabled"], - self.enabled, - ) - - if self.configurations is not None: - _serialize_connector_configurations( - serializer, - _SCHEMA_CONNECTOR_TARGET_CONFIGURATION.members["configurations"], - self.configurations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["source"] = ConnectorSource.deserialize(de) - - case 1: - kwargs["enabled"] = _deserialize_enabled_connectors( - de, _SCHEMA_CONNECTOR_TARGET_CONFIGURATION.members["enabled"] - ) - - case 2: - kwargs["configurations"] = _deserialize_connector_configurations( - de, - _SCHEMA_CONNECTOR_TARGET_CONFIGURATION.members[ - "configurations" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CONNECTOR_TARGET_CONFIGURATION, consumer=_consumer - ) - if "source" not in kwargs: - kwargs["source"] = ConnectorSource._smithy_default() - return kwargs - - -def _serialize_required_properties( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_required_properties( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -class SchemaType(UnknownEnumMixin, StrEnum): - STRING = "string" - NUMBER = "number" - OBJECT = "object" - ARRAY = "array" - BOOLEAN = "boolean" - INTEGER = "integer" - - -class ListingMode(UnknownEnumMixin, StrEnum): - DEFAULT = "DEFAULT" - DYNAMIC = "DYNAMIC" - - -@dataclass -class McpToolSchemaConfigurationS3: - """ - The Amazon S3 location of the tool schema. This location contains the - schema definition file. - """ - - value: S3Configuration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MCP_TOOL_SCHEMA_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MCP_TOOL_SCHEMA_CONFIGURATION.members["s3"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=S3Configuration.deserialize(deserializer)) - - -@dataclass -class McpToolSchemaConfigurationInlinePayload: - """The inline payload containing the MCP tool schema definition.""" - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MCP_TOOL_SCHEMA_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MCP_TOOL_SCHEMA_CONFIGURATION.members["inlinePayload"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string( - _SCHEMA_MCP_TOOL_SCHEMA_CONFIGURATION.members["inlinePayload"] - ) - ) - - -@dataclass -class McpToolSchemaConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -McpToolSchemaConfiguration = Union[ - McpToolSchemaConfigurationS3 - | McpToolSchemaConfigurationInlinePayload - | McpToolSchemaConfigurationUnknown -] -""" -The MCP tool schema configuration for an MCP server target. The tool -schema must be aligned with the MCP specification. -""" - - -class _McpToolSchemaConfigurationDeserializer: - _result: McpToolSchemaConfiguration | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> McpToolSchemaConfiguration: - self._result = None - deserializer.read_struct(_SCHEMA_MCP_TOOL_SCHEMA_CONFIGURATION, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(McpToolSchemaConfigurationS3.deserialize(de)) - - case 1: - self._set_result( - McpToolSchemaConfigurationInlinePayload.deserialize(de) - ) - - case _: - self._set_result( - McpToolSchemaConfigurationUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: McpToolSchemaConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class McpServerTargetConfiguration: - """The target configuration for the MCP server.""" - - endpoint: str - """The endpoint for the MCP server target configuration.""" - - mcp_tool_schema: McpToolSchemaConfiguration | None = None - """ - A static tool list for the MCP server target. It is supported for all - credential providers. Dynamic tool discovery/synchronization will be - disabled when a target is configured with mcpToolSchema. - """ - - listing_mode: str | None = None - """ - The listing mode for the MCP server target configuration. MCP resources - for default targets are cached at the control plane for faster access. - MCP resources for dynamic targets will be dynamically retrieved when - listing tools. - """ - - resource_priority: int | None = None - """ - Priority for resolving MCP server targets with shared resource URIs. - Lower values take precedence. Defaults to 1000 when not set. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MCP_SERVER_TARGET_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MCP_SERVER_TARGET_CONFIGURATION.members["endpoint"], self.endpoint - ) - if self.mcp_tool_schema is not None: - serializer.write_struct( - _SCHEMA_MCP_SERVER_TARGET_CONFIGURATION.members["mcpToolSchema"], - self.mcp_tool_schema, - ) - - if self.listing_mode is not None: - serializer.write_string( - _SCHEMA_MCP_SERVER_TARGET_CONFIGURATION.members["listingMode"], - self.listing_mode, - ) - - if self.resource_priority is not None: - serializer.write_integer( - _SCHEMA_MCP_SERVER_TARGET_CONFIGURATION.members["resourcePriority"], - self.resource_priority, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["endpoint"] = de.read_string( - _SCHEMA_MCP_SERVER_TARGET_CONFIGURATION.members["endpoint"] - ) - - case 1: - kwargs["mcp_tool_schema"] = ( - _McpToolSchemaConfigurationDeserializer().deserialize(de) - ) - - case 2: - kwargs["listing_mode"] = ListingMode( - de.read_string( - _SCHEMA_MCP_SERVER_TARGET_CONFIGURATION.members[ - "listingMode" - ] - ) - ) - - case 3: - kwargs["resource_priority"] = de.read_integer( - _SCHEMA_MCP_SERVER_TARGET_CONFIGURATION.members[ - "resourcePriority" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MCP_SERVER_TARGET_CONFIGURATION, consumer=_consumer - ) - if "endpoint" not in kwargs: - kwargs["endpoint"] = "" - return kwargs - - -@dataclass(kw_only=True) -class OAuth2AuthorizationData: - """ - OAuth2-specific authorization data, including the authorization URL and - user identifier for the authorization session. - """ - - authorization_url: str - """ - The URL to initiate the authorization process. This URL is provided when - the OAuth2 access token requires user authorization. - """ - - user_id: str | None = None - """ - The user identifier associated with the OAuth2 authorization session - that is defined by AgentCore Gateway. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_O_AUTH2_AUTHORIZATION_DATA, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_O_AUTH2_AUTHORIZATION_DATA.members["authorizationUrl"], - self.authorization_url, - ) - if self.user_id is not None: - serializer.write_string( - _SCHEMA_O_AUTH2_AUTHORIZATION_DATA.members["userId"], self.user_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["authorization_url"] = de.read_string( - _SCHEMA_O_AUTH2_AUTHORIZATION_DATA.members["authorizationUrl"] - ) - - case 1: - kwargs["user_id"] = de.read_string( - _SCHEMA_O_AUTH2_AUTHORIZATION_DATA.members["userId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_O_AUTH2_AUTHORIZATION_DATA, consumer=_consumer) - if "authorization_url" not in kwargs: - kwargs["authorization_url"] = "" - return kwargs - - -@dataclass -class AuthorizationDataOauth2: - """OAuth2 authorization data for the gateway target.""" - - value: OAuth2AuthorizationData - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTHORIZATION_DATA, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTHORIZATION_DATA.members["oauth2"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=OAuth2AuthorizationData.deserialize(deserializer)) - - -@dataclass -class AuthorizationDataUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -AuthorizationData = Union[AuthorizationDataOauth2 | AuthorizationDataUnknown] -""" -Contains the authorization data that is returned when a gateway target -is configured with a credential provider with authorization code grant -type and requires user federation. -""" - - -class _AuthorizationDataDeserializer: - _result: AuthorizationData | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> AuthorizationData: - self._result = None - deserializer.read_struct(_SCHEMA_AUTHORIZATION_DATA, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(AuthorizationDataOauth2.deserialize(de)) - - case _: - self._set_result( - AuthorizationDataUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: AuthorizationData) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class ManagedResourceDetails: - """ - Details of a resource created and managed by the gateway for private - endpoint connectivity. - """ - - domain: str | None = None - """The domain associated with this managed resource.""" - - resource_gateway_arn: str | None = None - """The ARN of the VPC Lattice resource gateway created in your account.""" - - resource_association_arn: str | None = None - """The ARN of the service network resource association.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MANAGED_RESOURCE_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.domain is not None: - serializer.write_string( - _SCHEMA_MANAGED_RESOURCE_DETAILS.members["domain"], self.domain - ) - - if self.resource_gateway_arn is not None: - serializer.write_string( - _SCHEMA_MANAGED_RESOURCE_DETAILS.members["resourceGatewayArn"], - self.resource_gateway_arn, - ) - - if self.resource_association_arn is not None: - serializer.write_string( - _SCHEMA_MANAGED_RESOURCE_DETAILS.members["resourceAssociationArn"], - self.resource_association_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["domain"] = de.read_string( - _SCHEMA_MANAGED_RESOURCE_DETAILS.members["domain"] - ) - - case 1: - kwargs["resource_gateway_arn"] = de.read_string( - _SCHEMA_MANAGED_RESOURCE_DETAILS.members["resourceGatewayArn"] - ) - - case 2: - kwargs["resource_association_arn"] = de.read_string( - _SCHEMA_MANAGED_RESOURCE_DETAILS.members[ - "resourceAssociationArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MANAGED_RESOURCE_DETAILS, consumer=_consumer) - return kwargs - - -def _serialize_private_endpoint_managed_resources( - serializer: ShapeSerializer, schema: Schema, value: list[ManagedResourceDetails] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_private_endpoint_managed_resources( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ManagedResourceDetails]: - result: list[ManagedResourceDetails] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ManagedResourceDetails.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class TargetProtocolType(UnknownEnumMixin, StrEnum): - MCP = "MCP" - HTTP = "HTTP" - - -class TargetStatus(UnknownEnumMixin, StrEnum): - CREATING = "CREATING" - UPDATING = "UPDATING" - UPDATE_UNSUCCESSFUL = "UPDATE_UNSUCCESSFUL" - DELETING = "DELETING" - READY = "READY" - FAILED = "FAILED" - SYNCHRONIZING = "SYNCHRONIZING" - SYNCHRONIZE_UNSUCCESSFUL = "SYNCHRONIZE_UNSUCCESSFUL" - CREATE_PENDING_AUTH = "CREATE_PENDING_AUTH" - UPDATE_PENDING_AUTH = "UPDATE_PENDING_AUTH" - SYNCHRONIZE_PENDING_AUTH = "SYNCHRONIZE_PENDING_AUTH" - - -@dataclass(kw_only=True) -class DeleteGatewayTargetInput: - """Dataclass for DeleteGatewayTargetInput structure.""" - - gateway_identifier: str | None = None - """The unique identifier of the gateway associated with the target.""" - - target_id: str | None = None - """The unique identifier of the gateway target to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_GATEWAY_TARGET_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.gateway_identifier is not None: - serializer.write_string( - _SCHEMA_DELETE_GATEWAY_TARGET_INPUT.members["gatewayIdentifier"], - self.gateway_identifier, - ) - - if self.target_id is not None: - serializer.write_string( - _SCHEMA_DELETE_GATEWAY_TARGET_INPUT.members["targetId"], self.target_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["gateway_identifier"] = de.read_string( - _SCHEMA_DELETE_GATEWAY_TARGET_INPUT.members["gatewayIdentifier"] - ) - - case 1: - kwargs["target_id"] = de.read_string( - _SCHEMA_DELETE_GATEWAY_TARGET_INPUT.members["targetId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_GATEWAY_TARGET_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteGatewayTargetOutput: - """Dataclass for DeleteGatewayTargetOutput structure.""" - - gateway_arn: str - """The Amazon Resource Name (ARN) of the gateway.""" - - target_id: str - """The unique identifier of the deleted gateway target.""" - - status: str - """The current status of the gateway target deletion.""" - - status_reasons: list[str] | None = None - """The reasons for the current status of the gateway target deletion.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_GATEWAY_TARGET_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DELETE_GATEWAY_TARGET_OUTPUT.members["gatewayArn"], self.gateway_arn - ) - serializer.write_string( - _SCHEMA_DELETE_GATEWAY_TARGET_OUTPUT.members["targetId"], self.target_id - ) - serializer.write_string( - _SCHEMA_DELETE_GATEWAY_TARGET_OUTPUT.members["status"], self.status - ) - if self.status_reasons is not None: - _serialize_status_reasons( - serializer, - _SCHEMA_DELETE_GATEWAY_TARGET_OUTPUT.members["statusReasons"], - self.status_reasons, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["gateway_arn"] = de.read_string( - _SCHEMA_DELETE_GATEWAY_TARGET_OUTPUT.members["gatewayArn"] - ) - - case 1: - kwargs["target_id"] = de.read_string( - _SCHEMA_DELETE_GATEWAY_TARGET_OUTPUT.members["targetId"] - ) - - case 2: - kwargs["status"] = TargetStatus( - de.read_string( - _SCHEMA_DELETE_GATEWAY_TARGET_OUTPUT.members["status"] - ) - ) - - case 3: - kwargs["status_reasons"] = _deserialize_status_reasons( - de, - _SCHEMA_DELETE_GATEWAY_TARGET_OUTPUT.members["statusReasons"], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_GATEWAY_TARGET_OUTPUT, consumer=_consumer - ) - if "gateway_arn" not in kwargs: - kwargs["gateway_arn"] = "" - if "target_id" not in kwargs: - kwargs["target_id"] = "" - if "status" not in kwargs: - kwargs["status"] = TargetStatus._corrected("") - return kwargs - - -DELETE_GATEWAY_TARGET = APIOperation( - input=DeleteGatewayTargetInput, - output=DeleteGatewayTargetOutput, - schema=_SCHEMA_DELETE_GATEWAY_TARGET, - input_schema=_SCHEMA_DELETE_GATEWAY_TARGET_INPUT, - output_schema=_SCHEMA_DELETE_GATEWAY_TARGET_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetGatewayTargetInput: - """Dataclass for GetGatewayTargetInput structure.""" - - gateway_identifier: str | None = None - """The identifier of the gateway that contains the target.""" - - target_id: str | None = None - """The unique identifier of the target to retrieve.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_GATEWAY_TARGET_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.gateway_identifier is not None: - serializer.write_string( - _SCHEMA_GET_GATEWAY_TARGET_INPUT.members["gatewayIdentifier"], - self.gateway_identifier, - ) - - if self.target_id is not None: - serializer.write_string( - _SCHEMA_GET_GATEWAY_TARGET_INPUT.members["targetId"], self.target_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["gateway_identifier"] = de.read_string( - _SCHEMA_GET_GATEWAY_TARGET_INPUT.members["gatewayIdentifier"] - ) - - case 1: - kwargs["target_id"] = de.read_string( - _SCHEMA_GET_GATEWAY_TARGET_INPUT.members["targetId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_GATEWAY_TARGET_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ListGatewayTargetsInput: - """Dataclass for ListGatewayTargetsInput structure.""" - - gateway_identifier: str | None = None - """The identifier of the gateway to list targets for.""" - - max_results: int | None = None - """ - The maximum number of results to return in the response. If the total - number of results is greater than this value, use the token returned in - the response in the `nextToken` field when making another request to - return the next batch of results. - """ - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, enter the token returned in the `nextToken` - field in the response in this field to return the next batch of results. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_GATEWAY_TARGETS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.gateway_identifier is not None: - serializer.write_string( - _SCHEMA_LIST_GATEWAY_TARGETS_INPUT.members["gatewayIdentifier"], - self.gateway_identifier, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_GATEWAY_TARGETS_INPUT.members["maxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_GATEWAY_TARGETS_INPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["gateway_identifier"] = de.read_string( - _SCHEMA_LIST_GATEWAY_TARGETS_INPUT.members["gatewayIdentifier"] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_GATEWAY_TARGETS_INPUT.members["maxResults"] - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_GATEWAY_TARGETS_INPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_GATEWAY_TARGETS_INPUT, consumer=_consumer) - return kwargs - - -class TargetType(UnknownEnumMixin, StrEnum): - OPEN_API_SCHEMA = "OPEN_API_SCHEMA" - SMITHY_MODEL = "SMITHY_MODEL" - MCP_SERVER = "MCP_SERVER" - LAMBDA_ = "LAMBDA" - API_GATEWAY = "API_GATEWAY" - CONNECTOR = "CONNECTOR" - AGENTCORE_RUNTIME = "AGENTCORE_RUNTIME" - PASSTHROUGH = "PASSTHROUGH" - PROVIDER = "PROVIDER" - HTTP_CONNECTOR = "HTTP_CONNECTOR" - - -@dataclass(kw_only=True) -class TargetSummary: - """ - Contains summary information about a gateway target. A target represents - an endpoint that the gateway can connect to. - """ - - target_id: str - """The unique identifier of the target.""" - - name: str = field(repr=False) - """The name of the target.""" - - status: str - """The current status of the target.""" - - created_at: datetime - """The timestamp when the target was created.""" - - updated_at: datetime - """The timestamp when the target was last updated.""" - - description: str | None = field(repr=False, default=None) - """The description of the target.""" - - resource_priority: int | None = None - """ - Priority for resolving resource URI conflicts across targets. Lower - values take precedence. Defaults to 1000 when not set. - """ - - last_synchronized_at: datetime | None = None - """The timestamp when the target was last synchronized.""" - - authorization_data: AuthorizationData | None = None - """ - Contains the authorization data that is returned when a gateway target - is configured with a credential provider with authorization code grant - type and requires user federation. - """ - - target_type: str | None = None - """The type of the target.""" - - listing_mode: str | None = None - """ - The listing mode for the target. MCP resources for `DEFAULT` targets are - cached at the control plane for faster access. MCP resources for - `DYNAMIC` targets are retrieved dynamically when listing tools. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TARGET_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_TARGET_SUMMARY.members["targetId"], self.target_id - ) - serializer.write_string(_SCHEMA_TARGET_SUMMARY.members["name"], self.name) - serializer.write_string(_SCHEMA_TARGET_SUMMARY.members["status"], self.status) - if self.description is not None: - serializer.write_string( - _SCHEMA_TARGET_SUMMARY.members["description"], self.description - ) - - serializer.write_timestamp( - _SCHEMA_TARGET_SUMMARY.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_TARGET_SUMMARY.members["updatedAt"], self.updated_at - ) - if self.resource_priority is not None: - serializer.write_integer( - _SCHEMA_TARGET_SUMMARY.members["resourcePriority"], - self.resource_priority, - ) - - if self.last_synchronized_at is not None: - serializer.write_timestamp( - _SCHEMA_TARGET_SUMMARY.members["lastSynchronizedAt"], - self.last_synchronized_at, - ) - - if self.authorization_data is not None: - serializer.write_struct( - _SCHEMA_TARGET_SUMMARY.members["authorizationData"], - self.authorization_data, - ) - - if self.target_type is not None: - serializer.write_string( - _SCHEMA_TARGET_SUMMARY.members["targetType"], self.target_type - ) - - if self.listing_mode is not None: - serializer.write_string( - _SCHEMA_TARGET_SUMMARY.members["listingMode"], self.listing_mode - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["target_id"] = de.read_string( - _SCHEMA_TARGET_SUMMARY.members["targetId"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_TARGET_SUMMARY.members["name"] - ) - - case 2: - kwargs["status"] = TargetStatus( - de.read_string(_SCHEMA_TARGET_SUMMARY.members["status"]) - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_TARGET_SUMMARY.members["description"] - ) - - case 4: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_TARGET_SUMMARY.members["createdAt"] - ) - - case 5: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_TARGET_SUMMARY.members["updatedAt"] - ) - - case 6: - kwargs["resource_priority"] = de.read_integer( - _SCHEMA_TARGET_SUMMARY.members["resourcePriority"] - ) - - case 7: - kwargs["last_synchronized_at"] = de.read_timestamp( - _SCHEMA_TARGET_SUMMARY.members["lastSynchronizedAt"] - ) - - case 8: - kwargs["authorization_data"] = ( - _AuthorizationDataDeserializer().deserialize(de) - ) - - case 9: - kwargs["target_type"] = TargetType( - de.read_string(_SCHEMA_TARGET_SUMMARY.members["targetType"]) - ) - - case 10: - kwargs["listing_mode"] = ListingMode( - de.read_string(_SCHEMA_TARGET_SUMMARY.members["listingMode"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TARGET_SUMMARY, consumer=_consumer) - if "target_id" not in kwargs: - kwargs["target_id"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "status" not in kwargs: - kwargs["status"] = TargetStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_target_summaries( - serializer: ShapeSerializer, schema: Schema, value: list[TargetSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_target_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[TargetSummary]: - result: list[TargetSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(TargetSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListGatewayTargetsOutput: - """Dataclass for ListGatewayTargetsOutput structure.""" - - items: list[TargetSummary] - """The list of gateway target summaries.""" - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, use this token when making another request in - the `nextToken` field to return the next batch of results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_GATEWAY_TARGETS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_target_summaries( - serializer, _SCHEMA_LIST_GATEWAY_TARGETS_OUTPUT.members["items"], self.items - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_GATEWAY_TARGETS_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["items"] = _deserialize_target_summaries( - de, _SCHEMA_LIST_GATEWAY_TARGETS_OUTPUT.members["items"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_GATEWAY_TARGETS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_GATEWAY_TARGETS_OUTPUT, consumer=_consumer - ) - if "items" not in kwargs: - kwargs["items"] = [] - return kwargs - - -LIST_GATEWAY_TARGETS = APIOperation( - input=ListGatewayTargetsInput, - output=ListGatewayTargetsOutput, - schema=_SCHEMA_LIST_GATEWAY_TARGETS, - input_schema=_SCHEMA_LIST_GATEWAY_TARGETS_INPUT, - output_schema=_SCHEMA_LIST_GATEWAY_TARGETS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -def _serialize_target_id_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_target_id_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class SynchronizeGatewayTargetsInput: - """Dataclass for SynchronizeGatewayTargetsInput structure.""" - - gateway_identifier: str | None = None - """The gateway Identifier.""" - - target_id_list: list[str] | None = None - """The target ID list.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SYNCHRONIZE_GATEWAY_TARGETS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.gateway_identifier is not None: - serializer.write_string( - _SCHEMA_SYNCHRONIZE_GATEWAY_TARGETS_INPUT.members["gatewayIdentifier"], - self.gateway_identifier, - ) - - if self.target_id_list is not None: - _serialize_target_id_list( - serializer, - _SCHEMA_SYNCHRONIZE_GATEWAY_TARGETS_INPUT.members["targetIdList"], - self.target_id_list, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["gateway_identifier"] = de.read_string( - _SCHEMA_SYNCHRONIZE_GATEWAY_TARGETS_INPUT.members[ - "gatewayIdentifier" - ] - ) - - case 1: - kwargs["target_id_list"] = _deserialize_target_id_list( - de, - _SCHEMA_SYNCHRONIZE_GATEWAY_TARGETS_INPUT.members[ - "targetIdList" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SYNCHRONIZE_GATEWAY_TARGETS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetResourcePolicyInput: - """Dataclass for GetResourcePolicyInput structure.""" - - resource_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the resource for which to retrieve the - resource policy. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_RESOURCE_POLICY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_GET_RESOURCE_POLICY_INPUT.members["resourceArn"], - self.resource_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_GET_RESOURCE_POLICY_INPUT.members["resourceArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_RESOURCE_POLICY_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetResourcePolicyOutput: - """Dataclass for GetResourcePolicyOutput structure.""" - - policy: str | None = None - """The resource policy associated with the specified resource.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_RESOURCE_POLICY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.policy is not None: - serializer.write_string( - _SCHEMA_GET_RESOURCE_POLICY_OUTPUT.members["policy"], self.policy - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy"] = de.read_string( - _SCHEMA_GET_RESOURCE_POLICY_OUTPUT.members["policy"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_RESOURCE_POLICY_OUTPUT, consumer=_consumer) - return kwargs - - -GET_RESOURCE_POLICY = APIOperation( - input=GetResourcePolicyInput, - output=GetResourcePolicyOutput, - schema=_SCHEMA_GET_RESOURCE_POLICY, - input_schema=_SCHEMA_GET_RESOURCE_POLICY_INPUT, - output_schema=_SCHEMA_GET_RESOURCE_POLICY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetTokenVaultInput: - """Dataclass for GetTokenVaultInput structure.""" - - token_vault_id: str | None = None - """The unique identifier of the token vault to retrieve.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_TOKEN_VAULT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.token_vault_id is not None: - serializer.write_string( - _SCHEMA_GET_TOKEN_VAULT_INPUT.members["tokenVaultId"], - self.token_vault_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["token_vault_id"] = de.read_string( - _SCHEMA_GET_TOKEN_VAULT_INPUT.members["tokenVaultId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_TOKEN_VAULT_INPUT, consumer=_consumer) - return kwargs - - -class KeyType(UnknownEnumMixin, StrEnum): - CUSTOMER_MANAGED_KEY = "CustomerManagedKey" - SERVICE_MANAGED_KEY = "ServiceManagedKey" - - -@dataclass(kw_only=True) -class KmsConfiguration: - """Contains the KMS configuration for a resource.""" - - key_type: str - """The type of KMS key (CustomerManagedKey or ServiceManagedKey).""" - - kms_key_arn: str | None = None - """The Amazon Resource Name (ARN) of the KMS key.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KMS_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_KMS_CONFIGURATION.members["keyType"], self.key_type - ) - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_KMS_CONFIGURATION.members["kmsKeyArn"], self.kms_key_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["key_type"] = KeyType( - de.read_string(_SCHEMA_KMS_CONFIGURATION.members["keyType"]) - ) - - case 1: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_KMS_CONFIGURATION.members["kmsKeyArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_KMS_CONFIGURATION, consumer=_consumer) - if "key_type" not in kwargs: - kwargs["key_type"] = KeyType._corrected("") - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(key_type=KeyType._corrected("")) - - -@dataclass(kw_only=True) -class GetTokenVaultOutput: - """Dataclass for GetTokenVaultOutput structure.""" - - token_vault_id: str - """The ID of the token vault.""" - - kms_configuration: KmsConfiguration - """The KMS configuration for the token vault.""" - - last_modified_date: datetime - """The timestamp when the token vault was last modified.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_TOKEN_VAULT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_TOKEN_VAULT_OUTPUT.members["tokenVaultId"], self.token_vault_id - ) - serializer.write_struct( - _SCHEMA_GET_TOKEN_VAULT_OUTPUT.members["kmsConfiguration"], - self.kms_configuration, - ) - serializer.write_timestamp( - _SCHEMA_GET_TOKEN_VAULT_OUTPUT.members["lastModifiedDate"], - self.last_modified_date, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["token_vault_id"] = de.read_string( - _SCHEMA_GET_TOKEN_VAULT_OUTPUT.members["tokenVaultId"] - ) - - case 1: - kwargs["kms_configuration"] = KmsConfiguration.deserialize(de) - - case 2: - kwargs["last_modified_date"] = de.read_timestamp( - _SCHEMA_GET_TOKEN_VAULT_OUTPUT.members["lastModifiedDate"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_TOKEN_VAULT_OUTPUT, consumer=_consumer) - if "token_vault_id" not in kwargs: - kwargs["token_vault_id"] = "" - if "kms_configuration" not in kwargs: - kwargs["kms_configuration"] = KmsConfiguration._smithy_default() - if "last_modified_date" not in kwargs: - kwargs["last_modified_date"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -GET_TOKEN_VAULT = APIOperation( - input=GetTokenVaultInput, - output=GetTokenVaultOutput, - schema=_SCHEMA_GET_TOKEN_VAULT, - input_schema=_SCHEMA_GET_TOKEN_VAULT_INPUT, - output_schema=_SCHEMA_GET_TOKEN_VAULT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#UnauthorizedException" - ): UnauthorizedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class CreateHarnessEndpointInput: - """Dataclass for CreateHarnessEndpointInput structure.""" - - harness_id: str | None = None - """The ID of the harness to create an endpoint for.""" - - endpoint_name: str | None = None - """ - The name of the endpoint. Must start with a letter and contain only - alphanumeric characters and underscores. - """ - - target_version: str | None = None - """ - The harness version that the endpoint points to and serves invocations - from. - """ - - description: str | None = None - """A description of the endpoint.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure idempotency of the - request. - """ - - tags: dict[str, str] | None = None - """Tags to apply to the endpoint resource.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_HARNESS_ENDPOINT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.harness_id is not None: - serializer.write_string( - _SCHEMA_CREATE_HARNESS_ENDPOINT_INPUT.members["harnessId"], - self.harness_id, - ) - - if self.endpoint_name is not None: - serializer.write_string( - _SCHEMA_CREATE_HARNESS_ENDPOINT_INPUT.members["endpointName"], - self.endpoint_name, - ) - - if self.target_version is not None: - serializer.write_string( - _SCHEMA_CREATE_HARNESS_ENDPOINT_INPUT.members["targetVersion"], - self.target_version, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_HARNESS_ENDPOINT_INPUT.members["description"], - self.description, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_HARNESS_ENDPOINT_INPUT.members["clientToken"], - self.client_token, - ) - - if self.tags is not None: - _serialize_tags_map( - serializer, - _SCHEMA_CREATE_HARNESS_ENDPOINT_INPUT.members["tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["harness_id"] = de.read_string( - _SCHEMA_CREATE_HARNESS_ENDPOINT_INPUT.members["harnessId"] - ) - - case 1: - kwargs["endpoint_name"] = de.read_string( - _SCHEMA_CREATE_HARNESS_ENDPOINT_INPUT.members["endpointName"] - ) - - case 2: - kwargs["target_version"] = de.read_string( - _SCHEMA_CREATE_HARNESS_ENDPOINT_INPUT.members["targetVersion"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_HARNESS_ENDPOINT_INPUT.members["description"] - ) - - case 4: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_HARNESS_ENDPOINT_INPUT.members["clientToken"] - ) - - case 5: - kwargs["tags"] = _deserialize_tags_map( - de, _SCHEMA_CREATE_HARNESS_ENDPOINT_INPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_HARNESS_ENDPOINT_INPUT, consumer=_consumer - ) - return kwargs - - -class HarnessEndpointStatus(UnknownEnumMixin, StrEnum): - CREATING = "CREATING" - CREATE_FAILED = "CREATE_FAILED" - UPDATING = "UPDATING" - UPDATE_FAILED = "UPDATE_FAILED" - READY = "READY" - DELETING = "DELETING" - DELETE_FAILED = "DELETE_FAILED" - - -@dataclass(kw_only=True) -class HarnessEndpoint: - """ - Representation of a harness endpoint. An endpoint is a named, stable - reference to a specific version of a harness that callers invoke, - allowing the underlying version to be updated without changing how the - agent is invoked. - """ - - harness_id: str - """The ID of the harness that the endpoint belongs to.""" - - harness_name: str - """The name of the harness that the endpoint belongs to.""" - - endpoint_name: str - """The name of the endpoint.""" - - arn: str - """The ARN of the endpoint.""" - - status: str - """The status of the endpoint.""" - - created_at: datetime - """The timestamp when the endpoint was created.""" - - updated_at: datetime - """The timestamp when the endpoint was last updated.""" - - live_version: str | None = None - """The harness version that the endpoint is currently serving.""" - - target_version: str | None = None - """ - The harness version that the endpoint points to. While an update is in - progress, this can differ from the live version until the endpoint - finishes transitioning. - """ - - description: str | None = None - """The description of the endpoint.""" - - failure_reason: str | None = None - """The reason the endpoint's last create or update operation failed.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_ENDPOINT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_ENDPOINT.members["harnessId"], self.harness_id - ) - serializer.write_string( - _SCHEMA_HARNESS_ENDPOINT.members["harnessName"], self.harness_name - ) - serializer.write_string( - _SCHEMA_HARNESS_ENDPOINT.members["endpointName"], self.endpoint_name - ) - serializer.write_string(_SCHEMA_HARNESS_ENDPOINT.members["arn"], self.arn) - serializer.write_string(_SCHEMA_HARNESS_ENDPOINT.members["status"], self.status) - serializer.write_timestamp( - _SCHEMA_HARNESS_ENDPOINT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_HARNESS_ENDPOINT.members["updatedAt"], self.updated_at - ) - if self.live_version is not None: - serializer.write_string( - _SCHEMA_HARNESS_ENDPOINT.members["liveVersion"], self.live_version - ) - - if self.target_version is not None: - serializer.write_string( - _SCHEMA_HARNESS_ENDPOINT.members["targetVersion"], self.target_version - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_HARNESS_ENDPOINT.members["description"], self.description - ) - - if self.failure_reason is not None: - serializer.write_string( - _SCHEMA_HARNESS_ENDPOINT.members["failureReason"], self.failure_reason - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["harness_id"] = de.read_string( - _SCHEMA_HARNESS_ENDPOINT.members["harnessId"] - ) - - case 1: - kwargs["harness_name"] = de.read_string( - _SCHEMA_HARNESS_ENDPOINT.members["harnessName"] - ) - - case 2: - kwargs["endpoint_name"] = de.read_string( - _SCHEMA_HARNESS_ENDPOINT.members["endpointName"] - ) - - case 3: - kwargs["arn"] = de.read_string( - _SCHEMA_HARNESS_ENDPOINT.members["arn"] - ) - - case 4: - kwargs["status"] = HarnessEndpointStatus( - de.read_string(_SCHEMA_HARNESS_ENDPOINT.members["status"]) - ) - - case 5: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_HARNESS_ENDPOINT.members["createdAt"] - ) - - case 6: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_HARNESS_ENDPOINT.members["updatedAt"] - ) - - case 7: - kwargs["live_version"] = de.read_string( - _SCHEMA_HARNESS_ENDPOINT.members["liveVersion"] - ) - - case 8: - kwargs["target_version"] = de.read_string( - _SCHEMA_HARNESS_ENDPOINT.members["targetVersion"] - ) - - case 9: - kwargs["description"] = de.read_string( - _SCHEMA_HARNESS_ENDPOINT.members["description"] - ) - - case 10: - kwargs["failure_reason"] = de.read_string( - _SCHEMA_HARNESS_ENDPOINT.members["failureReason"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_HARNESS_ENDPOINT, consumer=_consumer) - if "harness_id" not in kwargs: - kwargs["harness_id"] = "" - if "harness_name" not in kwargs: - kwargs["harness_name"] = "" - if "endpoint_name" not in kwargs: - kwargs["endpoint_name"] = "" - if "arn" not in kwargs: - kwargs["arn"] = "" - if "status" not in kwargs: - kwargs["status"] = HarnessEndpointStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls( - harness_id="", - harness_name="", - endpoint_name="", - arn="", - status=HarnessEndpointStatus._corrected(""), - created_at=datetime.fromtimestamp(0, tz=timezone.utc), - updated_at=datetime.fromtimestamp(0, tz=timezone.utc), - ) - - -@dataclass(kw_only=True) -class CreateHarnessEndpointOutput: - """Dataclass for CreateHarnessEndpointOutput structure.""" - - endpoint: HarnessEndpoint - """The endpoint that was created.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_HARNESS_ENDPOINT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CREATE_HARNESS_ENDPOINT_OUTPUT.members["endpoint"], self.endpoint - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["endpoint"] = HarnessEndpoint.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_HARNESS_ENDPOINT_OUTPUT, consumer=_consumer - ) - if "endpoint" not in kwargs: - kwargs["endpoint"] = HarnessEndpoint._smithy_default() - return kwargs - - -CREATE_HARNESS_ENDPOINT = APIOperation( - input=CreateHarnessEndpointInput, - output=CreateHarnessEndpointOutput, - schema=_SCHEMA_CREATE_HARNESS_ENDPOINT, - input_schema=_SCHEMA_CREATE_HARNESS_ENDPOINT_INPUT, - output_schema=_SCHEMA_CREATE_HARNESS_ENDPOINT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteHarnessEndpointInput: - """Dataclass for DeleteHarnessEndpointInput structure.""" - - harness_id: str | None = None - """The ID of the harness that the endpoint belongs to.""" - - endpoint_name: str | None = None - """The name of the endpoint to delete.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure idempotency of the - request. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_HARNESS_ENDPOINT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.harness_id is not None: - serializer.write_string( - _SCHEMA_DELETE_HARNESS_ENDPOINT_INPUT.members["harnessId"], - self.harness_id, - ) - - if self.endpoint_name is not None: - serializer.write_string( - _SCHEMA_DELETE_HARNESS_ENDPOINT_INPUT.members["endpointName"], - self.endpoint_name, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_DELETE_HARNESS_ENDPOINT_INPUT.members["clientToken"], - self.client_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["harness_id"] = de.read_string( - _SCHEMA_DELETE_HARNESS_ENDPOINT_INPUT.members["harnessId"] - ) - - case 1: - kwargs["endpoint_name"] = de.read_string( - _SCHEMA_DELETE_HARNESS_ENDPOINT_INPUT.members["endpointName"] - ) - - case 2: - kwargs["client_token"] = de.read_string( - _SCHEMA_DELETE_HARNESS_ENDPOINT_INPUT.members["clientToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_HARNESS_ENDPOINT_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteHarnessEndpointOutput: - """Dataclass for DeleteHarnessEndpointOutput structure.""" - - endpoint: HarnessEndpoint - """The endpoint that was deleted.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_HARNESS_ENDPOINT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DELETE_HARNESS_ENDPOINT_OUTPUT.members["endpoint"], self.endpoint - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["endpoint"] = HarnessEndpoint.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_HARNESS_ENDPOINT_OUTPUT, consumer=_consumer - ) - if "endpoint" not in kwargs: - kwargs["endpoint"] = HarnessEndpoint._smithy_default() - return kwargs - - -DELETE_HARNESS_ENDPOINT = APIOperation( - input=DeleteHarnessEndpointInput, - output=DeleteHarnessEndpointOutput, - schema=_SCHEMA_DELETE_HARNESS_ENDPOINT, - input_schema=_SCHEMA_DELETE_HARNESS_ENDPOINT_INPUT, - output_schema=_SCHEMA_DELETE_HARNESS_ENDPOINT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetHarnessEndpointInput: - """Dataclass for GetHarnessEndpointInput structure.""" - - harness_id: str | None = None - """The ID of the harness that the endpoint belongs to.""" - - endpoint_name: str | None = None - """The name of the endpoint to retrieve.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_HARNESS_ENDPOINT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.harness_id is not None: - serializer.write_string( - _SCHEMA_GET_HARNESS_ENDPOINT_INPUT.members["harnessId"], self.harness_id - ) - - if self.endpoint_name is not None: - serializer.write_string( - _SCHEMA_GET_HARNESS_ENDPOINT_INPUT.members["endpointName"], - self.endpoint_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["harness_id"] = de.read_string( - _SCHEMA_GET_HARNESS_ENDPOINT_INPUT.members["harnessId"] - ) - - case 1: - kwargs["endpoint_name"] = de.read_string( - _SCHEMA_GET_HARNESS_ENDPOINT_INPUT.members["endpointName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_HARNESS_ENDPOINT_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetHarnessEndpointOutput: - """Dataclass for GetHarnessEndpointOutput structure.""" - - endpoint: HarnessEndpoint - """The endpoint resource.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_HARNESS_ENDPOINT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_HARNESS_ENDPOINT_OUTPUT.members["endpoint"], self.endpoint - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["endpoint"] = HarnessEndpoint.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_HARNESS_ENDPOINT_OUTPUT, consumer=_consumer - ) - if "endpoint" not in kwargs: - kwargs["endpoint"] = HarnessEndpoint._smithy_default() - return kwargs - - -GET_HARNESS_ENDPOINT = APIOperation( - input=GetHarnessEndpointInput, - output=GetHarnessEndpointOutput, - schema=_SCHEMA_GET_HARNESS_ENDPOINT, - input_schema=_SCHEMA_GET_HARNESS_ENDPOINT_INPUT, - output_schema=_SCHEMA_GET_HARNESS_ENDPOINT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListHarnessEndpointsInput: - """Dataclass for ListHarnessEndpointsInput structure.""" - - harness_id: str | None = None - """The ID of the harness whose endpoints are listed.""" - - max_results: int | None = None - """The maximum number of results to return in a single call.""" - - next_token: str | None = None - """The token for the next set of results.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_HARNESS_ENDPOINTS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.harness_id is not None: - serializer.write_string( - _SCHEMA_LIST_HARNESS_ENDPOINTS_INPUT.members["harnessId"], - self.harness_id, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_HARNESS_ENDPOINTS_INPUT.members["maxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_HARNESS_ENDPOINTS_INPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["harness_id"] = de.read_string( - _SCHEMA_LIST_HARNESS_ENDPOINTS_INPUT.members["harnessId"] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_HARNESS_ENDPOINTS_INPUT.members["maxResults"] - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_HARNESS_ENDPOINTS_INPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_HARNESS_ENDPOINTS_INPUT, consumer=_consumer - ) - return kwargs - - -def _serialize_harness_endpoints( - serializer: ShapeSerializer, schema: Schema, value: list[HarnessEndpoint] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_harness_endpoints( - deserializer: ShapeDeserializer, schema: Schema -) -> list[HarnessEndpoint]: - result: list[HarnessEndpoint] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(HarnessEndpoint.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListHarnessEndpointsOutput: - """Dataclass for ListHarnessEndpointsOutput structure.""" - - endpoints: list[HarnessEndpoint] - """The list of harness endpoints.""" - - next_token: str | None = None - """The token for the next set of results.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_HARNESS_ENDPOINTS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_harness_endpoints( - serializer, - _SCHEMA_LIST_HARNESS_ENDPOINTS_OUTPUT.members["endpoints"], - self.endpoints, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_HARNESS_ENDPOINTS_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["endpoints"] = _deserialize_harness_endpoints( - de, _SCHEMA_LIST_HARNESS_ENDPOINTS_OUTPUT.members["endpoints"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_HARNESS_ENDPOINTS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_HARNESS_ENDPOINTS_OUTPUT, consumer=_consumer - ) - if "endpoints" not in kwargs: - kwargs["endpoints"] = [] - return kwargs - - -LIST_HARNESS_ENDPOINTS = APIOperation( - input=ListHarnessEndpointsInput, - output=ListHarnessEndpointsOutput, - schema=_SCHEMA_LIST_HARNESS_ENDPOINTS, - input_schema=_SCHEMA_LIST_HARNESS_ENDPOINTS_INPUT, - output_schema=_SCHEMA_LIST_HARNESS_ENDPOINTS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateHarnessEndpointInput: - """Dataclass for UpdateHarnessEndpointInput structure.""" - - harness_id: str | None = None - """The ID of the harness that the endpoint belongs to.""" - - endpoint_name: str | None = None - """The name of the endpoint to update.""" - - target_version: str | None = None - """ - The harness version that the endpoint points to. If not specified, the - existing value is retained. - """ - - description: str | None = None - """ - A description of the endpoint. If not specified, the existing value is - retained. - """ - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure idempotency of the - request. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_HARNESS_ENDPOINT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.harness_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_HARNESS_ENDPOINT_INPUT.members["harnessId"], - self.harness_id, - ) - - if self.endpoint_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_HARNESS_ENDPOINT_INPUT.members["endpointName"], - self.endpoint_name, - ) - - if self.target_version is not None: - serializer.write_string( - _SCHEMA_UPDATE_HARNESS_ENDPOINT_INPUT.members["targetVersion"], - self.target_version, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_HARNESS_ENDPOINT_INPUT.members["description"], - self.description, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_UPDATE_HARNESS_ENDPOINT_INPUT.members["clientToken"], - self.client_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["harness_id"] = de.read_string( - _SCHEMA_UPDATE_HARNESS_ENDPOINT_INPUT.members["harnessId"] - ) - - case 1: - kwargs["endpoint_name"] = de.read_string( - _SCHEMA_UPDATE_HARNESS_ENDPOINT_INPUT.members["endpointName"] - ) - - case 2: - kwargs["target_version"] = de.read_string( - _SCHEMA_UPDATE_HARNESS_ENDPOINT_INPUT.members["targetVersion"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_HARNESS_ENDPOINT_INPUT.members["description"] - ) - - case 4: - kwargs["client_token"] = de.read_string( - _SCHEMA_UPDATE_HARNESS_ENDPOINT_INPUT.members["clientToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_HARNESS_ENDPOINT_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateHarnessEndpointOutput: - """Dataclass for UpdateHarnessEndpointOutput structure.""" - - endpoint: HarnessEndpoint - """The updated endpoint.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_HARNESS_ENDPOINT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_UPDATE_HARNESS_ENDPOINT_OUTPUT.members["endpoint"], self.endpoint - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["endpoint"] = HarnessEndpoint.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_HARNESS_ENDPOINT_OUTPUT, consumer=_consumer - ) - if "endpoint" not in kwargs: - kwargs["endpoint"] = HarnessEndpoint._smithy_default() - return kwargs - - -UPDATE_HARNESS_ENDPOINT = APIOperation( - input=UpdateHarnessEndpointInput, - output=UpdateHarnessEndpointOutput, - schema=_SCHEMA_UPDATE_HARNESS_ENDPOINT, - input_schema=_SCHEMA_UPDATE_HARNESS_ENDPOINT_INPUT, - output_schema=_SCHEMA_UPDATE_HARNESS_ENDPOINT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -def _serialize_harness_allowed_tools( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_harness_allowed_tools( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class HarnessAgentCoreRuntimeEnvironmentRequest: - """The AgentCore Runtime environment request configuration.""" - - lifecycle_configuration: LifecycleConfiguration | None = None - """ - LifecycleConfiguration lets you manage the lifecycle of runtime sessions - and resources in AgentCore Runtime. This configuration helps optimize - resource utilization by automatically cleaning up idle sessions and - preventing long-running instances from consuming resources indefinitely. - """ - - network_configuration: NetworkConfiguration | None = None - """SecurityConfig for the Agent.""" - - filesystem_configurations: list[FilesystemConfiguration] | None = None - """The filesystem configurations for the runtime environment.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_AGENT_CORE_RUNTIME_ENVIRONMENT_REQUEST, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.lifecycle_configuration is not None: - serializer.write_struct( - _SCHEMA_HARNESS_AGENT_CORE_RUNTIME_ENVIRONMENT_REQUEST.members[ - "lifecycleConfiguration" - ], - self.lifecycle_configuration, - ) - - if self.network_configuration is not None: - serializer.write_struct( - _SCHEMA_HARNESS_AGENT_CORE_RUNTIME_ENVIRONMENT_REQUEST.members[ - "networkConfiguration" - ], - self.network_configuration, - ) - - if self.filesystem_configurations is not None: - _serialize_filesystem_configurations( - serializer, - _SCHEMA_HARNESS_AGENT_CORE_RUNTIME_ENVIRONMENT_REQUEST.members[ - "filesystemConfigurations" - ], - self.filesystem_configurations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["lifecycle_configuration"] = ( - LifecycleConfiguration.deserialize(de) - ) - - case 1: - kwargs["network_configuration"] = NetworkConfiguration.deserialize( - de - ) - - case 2: - kwargs["filesystem_configurations"] = ( - _deserialize_filesystem_configurations( - de, - _SCHEMA_HARNESS_AGENT_CORE_RUNTIME_ENVIRONMENT_REQUEST.members[ - "filesystemConfigurations" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_HARNESS_AGENT_CORE_RUNTIME_ENVIRONMENT_REQUEST, consumer=_consumer - ) - return kwargs - - -@dataclass -class HarnessEnvironmentProviderRequestAgentCoreRuntimeEnvironment: - """The AgentCore Runtime environment configuration.""" - - value: HarnessAgentCoreRuntimeEnvironmentRequest - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_ENVIRONMENT_PROVIDER_REQUEST, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_ENVIRONMENT_PROVIDER_REQUEST.members[ - "agentCoreRuntimeEnvironment" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=HarnessAgentCoreRuntimeEnvironmentRequest.deserialize(deserializer) - ) - - -@dataclass -class HarnessEnvironmentProviderRequestUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -HarnessEnvironmentProviderRequest = Union[ - HarnessEnvironmentProviderRequestAgentCoreRuntimeEnvironment - | HarnessEnvironmentProviderRequestUnknown -] -"""The environment provider request configuration.""" - - -class _HarnessEnvironmentProviderRequestDeserializer: - _result: HarnessEnvironmentProviderRequest | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> HarnessEnvironmentProviderRequest: - self._result = None - deserializer.read_struct( - _SCHEMA_HARNESS_ENVIRONMENT_PROVIDER_REQUEST, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - HarnessEnvironmentProviderRequestAgentCoreRuntimeEnvironment.deserialize( - de - ) - ) - - case _: - self._set_result( - HarnessEnvironmentProviderRequestUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: HarnessEnvironmentProviderRequest) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass -class HarnessEnvironmentArtifactContainerConfiguration: - """Representation of a container configuration.""" - - value: ContainerConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_ENVIRONMENT_ARTIFACT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_ENVIRONMENT_ARTIFACT.members["containerConfiguration"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ContainerConfiguration.deserialize(deserializer)) - - -@dataclass -class HarnessEnvironmentArtifactUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -HarnessEnvironmentArtifact = Union[ - HarnessEnvironmentArtifactContainerConfiguration | HarnessEnvironmentArtifactUnknown -] -""" -The environment artifact for a harness, such as a container image -containing custom dependencies. -""" - - -class _HarnessEnvironmentArtifactDeserializer: - _result: HarnessEnvironmentArtifact | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> HarnessEnvironmentArtifact: - self._result = None - deserializer.read_struct(_SCHEMA_HARNESS_ENVIRONMENT_ARTIFACT, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - HarnessEnvironmentArtifactContainerConfiguration.deserialize(de) - ) - - case _: - self._set_result( - HarnessEnvironmentArtifactUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: HarnessEnvironmentArtifact) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class HarnessHookEventBridgeTarget: - """The configuration for an Amazon EventBridge hook target.""" - - arn: str - """The ARN of the Amazon EventBridge event bus to send hook events to.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_HOOK_EVENT_BRIDGE_TARGET, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_HOOK_EVENT_BRIDGE_TARGET.members["arn"], self.arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["arn"] = de.read_string( - _SCHEMA_HARNESS_HOOK_EVENT_BRIDGE_TARGET.members["arn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_HARNESS_HOOK_EVENT_BRIDGE_TARGET, consumer=_consumer - ) - if "arn" not in kwargs: - kwargs["arn"] = "" - return kwargs - - -class HarnessHookFailureMode(UnknownEnumMixin, StrEnum): - """The behavior when a synchronous hook target fails.""" - - ALLOW = "allow" - """Specifies that the current action continues when the hook target fails.""" - DENY = "deny" - """ - Specifies that the service denies the current action when the hook - target fails. - """ - - -@dataclass(kw_only=True) -class HarnessHookLambdaTarget: - """The configuration for an AWS Lambda hook target.""" - - arn: str - """The ARN of the Lambda function to invoke.""" - - timeout_seconds: int = 60 - """ - The maximum number of seconds to wait for the Lambda function response. - The default is 60 seconds. - """ - - failure_mode: str = HarnessHookFailureMode("deny") - """ - The behavior when the Lambda function times out, returns an error, or - returns an invalid response. The default is `DENY`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_HOOK_LAMBDA_TARGET, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_HOOK_LAMBDA_TARGET.members["arn"], self.arn - ) - serializer.write_integer( - _SCHEMA_HARNESS_HOOK_LAMBDA_TARGET.members["timeoutSeconds"], - self.timeout_seconds, - ) - serializer.write_string( - _SCHEMA_HARNESS_HOOK_LAMBDA_TARGET.members["failureMode"], self.failure_mode - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["arn"] = de.read_string( - _SCHEMA_HARNESS_HOOK_LAMBDA_TARGET.members["arn"] - ) - - case 1: - kwargs["timeout_seconds"] = de.read_integer( - _SCHEMA_HARNESS_HOOK_LAMBDA_TARGET.members["timeoutSeconds"] - ) - - case 2: - kwargs["failure_mode"] = HarnessHookFailureMode( - de.read_string( - _SCHEMA_HARNESS_HOOK_LAMBDA_TARGET.members["failureMode"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_HARNESS_HOOK_LAMBDA_TARGET, consumer=_consumer) - if "arn" not in kwargs: - kwargs["arn"] = "" - return kwargs - - -@dataclass(kw_only=True) -class HarnessHookSnsTarget: - """The configuration for an Amazon SNS hook target.""" - - arn: str - """The ARN of the Amazon SNS topic to publish hook events to.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_HOOK_SNS_TARGET, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_HOOK_SNS_TARGET.members["arn"], self.arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["arn"] = de.read_string( - _SCHEMA_HARNESS_HOOK_SNS_TARGET.members["arn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_HARNESS_HOOK_SNS_TARGET, consumer=_consumer) - if "arn" not in kwargs: - kwargs["arn"] = "" - return kwargs - - -@dataclass -class HarnessHookTargetLambda: - """ - A Lambda hook target that invokes an AWS Lambda function synchronously - and waits for its response. - """ - - value: HarnessHookLambdaTarget - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_HOOK_TARGET, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_HOOK_TARGET.members["lambda"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HarnessHookLambdaTarget.deserialize(deserializer)) - - -@dataclass -class HarnessHookTargetSns: - """ - An Amazon SNS hook target that publishes the hook event without waiting - for a response. - """ - - value: HarnessHookSnsTarget - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_HOOK_TARGET, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_HOOK_TARGET.members["sns"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HarnessHookSnsTarget.deserialize(deserializer)) - - -@dataclass -class HarnessHookTargetEventBridge: - """ - An Amazon EventBridge hook target that sends the hook event without - waiting for a response. - """ - - value: HarnessHookEventBridgeTarget - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_HOOK_TARGET, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_HOOK_TARGET.members["eventBridge"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HarnessHookEventBridgeTarget.deserialize(deserializer)) - - -@dataclass -class HarnessHookTargetUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -HarnessHookTarget = Union[ - HarnessHookTargetLambda - | HarnessHookTargetSns - | HarnessHookTargetEventBridge - | HarnessHookTargetUnknown -] -"""The target that receives lifecycle hook events. Specify one target type.""" - - -class _HarnessHookTargetDeserializer: - _result: HarnessHookTarget | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> HarnessHookTarget: - self._result = None - deserializer.read_struct(_SCHEMA_HARNESS_HOOK_TARGET, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(HarnessHookTargetLambda.deserialize(de)) - - case 1: - self._set_result(HarnessHookTargetSns.deserialize(de)) - - case 2: - self._set_result(HarnessHookTargetEventBridge.deserialize(de)) - - case _: - self._set_result( - HarnessHookTargetUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: HarnessHookTarget) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class HarnessAfterInvocationHook: - """The configuration for a hook that runs after an invocation completes.""" - - name: str - """The name of the hook.""" - - target: HarnessHookTarget - """The target that receives the hook event.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_AFTER_INVOCATION_HOOK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_AFTER_INVOCATION_HOOK.members["name"], self.name - ) - serializer.write_struct( - _SCHEMA_HARNESS_AFTER_INVOCATION_HOOK.members["target"], self.target - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_HARNESS_AFTER_INVOCATION_HOOK.members["name"] - ) - - case 1: - kwargs["target"] = _HarnessHookTargetDeserializer().deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_HARNESS_AFTER_INVOCATION_HOOK, consumer=_consumer - ) - if "name" not in kwargs: - kwargs["name"] = "" - if "target" not in kwargs: - kwargs["target"] = HarnessHookTargetUnknown(tag="") - return kwargs - - -@dataclass(kw_only=True) -class HarnessAfterToolCallHook: - """The configuration for a hook that runs after a tool call completes.""" - - name: str - """The name of the hook.""" - - target: HarnessHookTarget - """The target that receives the hook event.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_AFTER_TOOL_CALL_HOOK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_AFTER_TOOL_CALL_HOOK.members["name"], self.name - ) - serializer.write_struct( - _SCHEMA_HARNESS_AFTER_TOOL_CALL_HOOK.members["target"], self.target - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_HARNESS_AFTER_TOOL_CALL_HOOK.members["name"] - ) - - case 1: - kwargs["target"] = _HarnessHookTargetDeserializer().deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_HARNESS_AFTER_TOOL_CALL_HOOK, consumer=_consumer - ) - if "name" not in kwargs: - kwargs["name"] = "" - if "target" not in kwargs: - kwargs["target"] = HarnessHookTargetUnknown(tag="") - return kwargs - - -@dataclass(kw_only=True) -class HarnessBeforeInvocationHook: - """The configuration for a hook that runs before an invocation begins.""" - - name: str - """The name of the hook.""" - - target: HarnessHookTarget - """The target that receives the hook event.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_BEFORE_INVOCATION_HOOK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_BEFORE_INVOCATION_HOOK.members["name"], self.name - ) - serializer.write_struct( - _SCHEMA_HARNESS_BEFORE_INVOCATION_HOOK.members["target"], self.target - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_HARNESS_BEFORE_INVOCATION_HOOK.members["name"] - ) - - case 1: - kwargs["target"] = _HarnessHookTargetDeserializer().deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_HARNESS_BEFORE_INVOCATION_HOOK, consumer=_consumer - ) - if "name" not in kwargs: - kwargs["name"] = "" - if "target" not in kwargs: - kwargs["target"] = HarnessHookTargetUnknown(tag="") - return kwargs - - -@dataclass(kw_only=True) -class HarnessBeforeToolCallHook: - """The configuration for a hook that runs before the agent calls a tool.""" - - name: str - """The name of the hook.""" - - target: HarnessHookTarget - """The target that receives the hook event.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_BEFORE_TOOL_CALL_HOOK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_BEFORE_TOOL_CALL_HOOK.members["name"], self.name - ) - serializer.write_struct( - _SCHEMA_HARNESS_BEFORE_TOOL_CALL_HOOK.members["target"], self.target - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_HARNESS_BEFORE_TOOL_CALL_HOOK.members["name"] - ) - - case 1: - kwargs["target"] = _HarnessHookTargetDeserializer().deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_HARNESS_BEFORE_TOOL_CALL_HOOK, consumer=_consumer - ) - if "name" not in kwargs: - kwargs["name"] = "" - if "target" not in kwargs: - kwargs["target"] = HarnessHookTargetUnknown(tag="") - return kwargs - - -@dataclass -class HarnessHookBeforeInvocation: - """A hook that runs before an invocation begins.""" - - value: HarnessBeforeInvocationHook - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_HOOK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_HOOK.members["beforeInvocation"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HarnessBeforeInvocationHook.deserialize(deserializer)) - - -@dataclass -class HarnessHookAfterInvocation: - """A hook that runs after an invocation completes.""" - - value: HarnessAfterInvocationHook - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_HOOK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_HOOK.members["afterInvocation"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HarnessAfterInvocationHook.deserialize(deserializer)) - - -@dataclass -class HarnessHookBeforeToolCall: - """A hook that runs before the agent calls a tool.""" - - value: HarnessBeforeToolCallHook - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_HOOK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_HOOK.members["beforeToolCall"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HarnessBeforeToolCallHook.deserialize(deserializer)) - - -@dataclass -class HarnessHookAfterToolCall: - """A hook that runs after a tool call completes.""" - - value: HarnessAfterToolCallHook - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_HOOK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_HOOK.members["afterToolCall"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HarnessAfterToolCallHook.deserialize(deserializer)) - - -@dataclass -class HarnessHookUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -HarnessHook = Union[ - HarnessHookBeforeInvocation - | HarnessHookAfterInvocation - | HarnessHookBeforeToolCall - | HarnessHookAfterToolCall - | HarnessHookUnknown -] -"""A lifecycle hook configuration. Specify one hook type.""" - - -class _HarnessHookDeserializer: - _result: HarnessHook | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> HarnessHook: - self._result = None - deserializer.read_struct(_SCHEMA_HARNESS_HOOK, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(HarnessHookBeforeInvocation.deserialize(de)) - - case 1: - self._set_result(HarnessHookAfterInvocation.deserialize(de)) - - case 2: - self._set_result(HarnessHookBeforeToolCall.deserialize(de)) - - case 3: - self._set_result(HarnessHookAfterToolCall.deserialize(de)) - - case _: - self._set_result(HarnessHookUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: HarnessHook) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_harness_hooks( - serializer: ShapeSerializer, schema: Schema, value: list[HarnessHook] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_harness_hooks( - deserializer: ShapeDeserializer, schema: Schema -) -> list[HarnessHook]: - result: list[HarnessHook] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_HarnessHookDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class HarnessAgentCoreMemoryRetrievalConfig: - """Configuration for memory retrieval within a namespace.""" - - top_k: int | None = None - """The maximum number of memory entries to retrieve.""" - - relevance_score: float | None = None - """The minimum relevance score for retrieved memories.""" - - strategy_id: str | None = None - """The ID of the retrieval strategy to use.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_AGENT_CORE_MEMORY_RETRIEVAL_CONFIG, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.top_k is not None: - serializer.write_integer( - _SCHEMA_HARNESS_AGENT_CORE_MEMORY_RETRIEVAL_CONFIG.members["topK"], - self.top_k, - ) - - if self.relevance_score is not None: - serializer.write_float( - _SCHEMA_HARNESS_AGENT_CORE_MEMORY_RETRIEVAL_CONFIG.members[ - "relevanceScore" - ], - self.relevance_score, - ) - - if self.strategy_id is not None: - serializer.write_string( - _SCHEMA_HARNESS_AGENT_CORE_MEMORY_RETRIEVAL_CONFIG.members[ - "strategyId" - ], - self.strategy_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["top_k"] = de.read_integer( - _SCHEMA_HARNESS_AGENT_CORE_MEMORY_RETRIEVAL_CONFIG.members[ - "topK" - ] - ) - - case 1: - kwargs["relevance_score"] = de.read_float( - _SCHEMA_HARNESS_AGENT_CORE_MEMORY_RETRIEVAL_CONFIG.members[ - "relevanceScore" - ] - ) - - case 2: - kwargs["strategy_id"] = de.read_string( - _SCHEMA_HARNESS_AGENT_CORE_MEMORY_RETRIEVAL_CONFIG.members[ - "strategyId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_HARNESS_AGENT_CORE_MEMORY_RETRIEVAL_CONFIG, consumer=_consumer - ) - return kwargs - - -def _serialize_harness_agent_core_memory_retrieval_configs( - serializer: ShapeSerializer, - schema: Schema, - value: dict[str, HarnessAgentCoreMemoryRetrievalConfig], -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_struct(value_schema, v)) - - -def _deserialize_harness_agent_core_memory_retrieval_configs( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, HarnessAgentCoreMemoryRetrievalConfig]: - result: dict[str, HarnessAgentCoreMemoryRetrievalConfig] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = HarnessAgentCoreMemoryRetrievalConfig.deserialize(d) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class HarnessAgentCoreMemoryConfiguration: - """Configuration for AgentCore Memory integration.""" - - arn: str - """The ARN of the AgentCore Memory resource.""" - - actor_id: str | None = None - """The actor ID for memory operations.""" - - messages_count: int | None = None - """The number of messages to retrieve from memory.""" - - retrieval_config: dict[str, HarnessAgentCoreMemoryRetrievalConfig] | None = None - """ - The retrieval configuration for long-term memory, mapping namespace path - templates to retrieval settings. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_AGENT_CORE_MEMORY_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_AGENT_CORE_MEMORY_CONFIGURATION.members["arn"], self.arn - ) - if self.actor_id is not None: - serializer.write_string( - _SCHEMA_HARNESS_AGENT_CORE_MEMORY_CONFIGURATION.members["actorId"], - self.actor_id, - ) - - if self.messages_count is not None: - serializer.write_integer( - _SCHEMA_HARNESS_AGENT_CORE_MEMORY_CONFIGURATION.members[ - "messagesCount" - ], - self.messages_count, - ) - - if self.retrieval_config is not None: - _serialize_harness_agent_core_memory_retrieval_configs( - serializer, - _SCHEMA_HARNESS_AGENT_CORE_MEMORY_CONFIGURATION.members[ - "retrievalConfig" - ], - self.retrieval_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["arn"] = de.read_string( - _SCHEMA_HARNESS_AGENT_CORE_MEMORY_CONFIGURATION.members["arn"] - ) - - case 1: - kwargs["actor_id"] = de.read_string( - _SCHEMA_HARNESS_AGENT_CORE_MEMORY_CONFIGURATION.members[ - "actorId" - ] - ) - - case 2: - kwargs["messages_count"] = de.read_integer( - _SCHEMA_HARNESS_AGENT_CORE_MEMORY_CONFIGURATION.members[ - "messagesCount" - ] - ) - - case 3: - kwargs["retrieval_config"] = ( - _deserialize_harness_agent_core_memory_retrieval_configs( - de, - _SCHEMA_HARNESS_AGENT_CORE_MEMORY_CONFIGURATION.members[ - "retrievalConfig" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_HARNESS_AGENT_CORE_MEMORY_CONFIGURATION, consumer=_consumer - ) - if "arn" not in kwargs: - kwargs["arn"] = "" - return kwargs - - -@dataclass(kw_only=True) -class HarnessDisabledMemoryConfiguration: - """Explicitly opt out of memory.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_DISABLED_MEMORY_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_HARNESS_DISABLED_MEMORY_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -class HarnessManagedMemoryStrategyType(UnknownEnumMixin, StrEnum): - SEMANTIC = "SEMANTIC" - SUMMARIZATION = "SUMMARIZATION" - USER_PREFERENCE = "USER_PREFERENCE" - EPISODIC = "EPISODIC" - - -def _serialize_harness_managed_memory_strategy_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_harness_managed_memory_strategy_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append( - HarnessManagedMemoryStrategyType(d.read_string(member_schema)) - ) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class HarnessManagedMemoryConfiguration: - """Configuration for managed memory creation.""" - - arn: str | None = None - """ - The ARN of the managed AgentCore Memory resource. Read-only on Get, - ignored on Create/Update input. - """ - - strategies: list[str] | None = None - """Strategy types to enable. Defaults to [SEMANTIC, SUMMARIZATION].""" - - event_expiry_duration: int | None = None - """Event retention in days. Defaults to 30.""" - - encryption_key_arn: str | None = None - """ - Customer-managed KMS key. Defaults to AWS-owned key. Not updatable after - creation. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_MANAGED_MEMORY_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.arn is not None: - serializer.write_string( - _SCHEMA_HARNESS_MANAGED_MEMORY_CONFIGURATION.members["arn"], self.arn - ) - - if self.strategies is not None: - _serialize_harness_managed_memory_strategy_list( - serializer, - _SCHEMA_HARNESS_MANAGED_MEMORY_CONFIGURATION.members["strategies"], - self.strategies, - ) - - if self.event_expiry_duration is not None: - serializer.write_integer( - _SCHEMA_HARNESS_MANAGED_MEMORY_CONFIGURATION.members[ - "eventExpiryDuration" - ], - self.event_expiry_duration, - ) - - if self.encryption_key_arn is not None: - serializer.write_string( - _SCHEMA_HARNESS_MANAGED_MEMORY_CONFIGURATION.members[ - "encryptionKeyArn" - ], - self.encryption_key_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["arn"] = de.read_string( - _SCHEMA_HARNESS_MANAGED_MEMORY_CONFIGURATION.members["arn"] - ) - - case 1: - kwargs["strategies"] = ( - _deserialize_harness_managed_memory_strategy_list( - de, - _SCHEMA_HARNESS_MANAGED_MEMORY_CONFIGURATION.members[ - "strategies" - ], - ) - ) - - case 2: - kwargs["event_expiry_duration"] = de.read_integer( - _SCHEMA_HARNESS_MANAGED_MEMORY_CONFIGURATION.members[ - "eventExpiryDuration" - ] - ) - - case 3: - kwargs["encryption_key_arn"] = de.read_string( - _SCHEMA_HARNESS_MANAGED_MEMORY_CONFIGURATION.members[ - "encryptionKeyArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_HARNESS_MANAGED_MEMORY_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass -class HarnessMemoryConfigurationAgentCoreMemoryConfiguration: - """The AgentCore Memory configuration.""" - - value: HarnessAgentCoreMemoryConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_MEMORY_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_MEMORY_CONFIGURATION.members[ - "agentCoreMemoryConfiguration" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HarnessAgentCoreMemoryConfiguration.deserialize(deserializer)) - - -@dataclass -class HarnessMemoryConfigurationManagedMemoryConfiguration: - """ - Harness creates and manages a memory resource in the customer's - account. - """ - - value: HarnessManagedMemoryConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_MEMORY_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_MEMORY_CONFIGURATION.members["managedMemoryConfiguration"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HarnessManagedMemoryConfiguration.deserialize(deserializer)) - - -@dataclass -class HarnessMemoryConfigurationDisabled: - """Explicitly opt out of memory.""" - - value: HarnessDisabledMemoryConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_MEMORY_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_MEMORY_CONFIGURATION.members["disabled"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HarnessDisabledMemoryConfiguration.deserialize(deserializer)) - - -@dataclass -class HarnessMemoryConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -HarnessMemoryConfiguration = Union[ - HarnessMemoryConfigurationAgentCoreMemoryConfiguration - | HarnessMemoryConfigurationManagedMemoryConfiguration - | HarnessMemoryConfigurationDisabled - | HarnessMemoryConfigurationUnknown -] -"""The memory configuration for a harness.""" - - -class _HarnessMemoryConfigurationDeserializer: - _result: HarnessMemoryConfiguration | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> HarnessMemoryConfiguration: - self._result = None - deserializer.read_struct(_SCHEMA_HARNESS_MEMORY_CONFIGURATION, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - HarnessMemoryConfigurationAgentCoreMemoryConfiguration.deserialize( - de - ) - ) - - case 1: - self._set_result( - HarnessMemoryConfigurationManagedMemoryConfiguration.deserialize(de) - ) - - case 2: - self._set_result(HarnessMemoryConfigurationDisabled.deserialize(de)) - - case _: - self._set_result( - HarnessMemoryConfigurationUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: HarnessMemoryConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class HarnessBedrockApiFormat(UnknownEnumMixin, StrEnum): - CONVERSE_STREAM = "converse_stream" - """Use the Bedrock Converse Stream API format.""" - RESPONSES = "responses" - """Use the Responses API format.""" - CHAT_COMPLETIONS = "chat_completions" - """Use the Chat Completions API format.""" - - -@dataclass(kw_only=True) -class HarnessBedrockModelConfig: - """Configuration for an Amazon Bedrock model provider.""" - - model_id: str - """The Bedrock model ID.""" - - max_tokens: int | None = None - """ - The maximum number of tokens to allow in the generated response per - model call. - """ - - temperature: float | None = None - """The temperature to set when calling the model.""" - - top_p: float | None = None - """The topP set when calling the model.""" - - api_format: str | None = None - """The API format to use when calling the Bedrock provider.""" - - additional_params: Document | None = None - """ - Provider-specific parameters passed through to the model provider - unchanged. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_BEDROCK_MODEL_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_BEDROCK_MODEL_CONFIG.members["modelId"], self.model_id - ) - if self.max_tokens is not None: - serializer.write_integer( - _SCHEMA_HARNESS_BEDROCK_MODEL_CONFIG.members["maxTokens"], - self.max_tokens, - ) - - if self.temperature is not None: - serializer.write_float( - _SCHEMA_HARNESS_BEDROCK_MODEL_CONFIG.members["temperature"], - self.temperature, - ) - - if self.top_p is not None: - serializer.write_float( - _SCHEMA_HARNESS_BEDROCK_MODEL_CONFIG.members["topP"], self.top_p - ) - - if self.api_format is not None: - serializer.write_string( - _SCHEMA_HARNESS_BEDROCK_MODEL_CONFIG.members["apiFormat"], - self.api_format, - ) - - if self.additional_params is not None: - serializer.write_document( - _SCHEMA_HARNESS_BEDROCK_MODEL_CONFIG.members["additionalParams"], - self.additional_params, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_id"] = de.read_string( - _SCHEMA_HARNESS_BEDROCK_MODEL_CONFIG.members["modelId"] - ) - - case 1: - kwargs["max_tokens"] = de.read_integer( - _SCHEMA_HARNESS_BEDROCK_MODEL_CONFIG.members["maxTokens"] - ) - - case 2: - kwargs["temperature"] = de.read_float( - _SCHEMA_HARNESS_BEDROCK_MODEL_CONFIG.members["temperature"] - ) - - case 3: - kwargs["top_p"] = de.read_float( - _SCHEMA_HARNESS_BEDROCK_MODEL_CONFIG.members["topP"] - ) - - case 4: - kwargs["api_format"] = HarnessBedrockApiFormat( - de.read_string( - _SCHEMA_HARNESS_BEDROCK_MODEL_CONFIG.members["apiFormat"] - ) - ) - - case 5: - kwargs["additional_params"] = de.read_document( - _SCHEMA_HARNESS_BEDROCK_MODEL_CONFIG.members["additionalParams"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_HARNESS_BEDROCK_MODEL_CONFIG, consumer=_consumer - ) - if "model_id" not in kwargs: - kwargs["model_id"] = "" - return kwargs - - -@dataclass(kw_only=True) -class HarnessGeminiModelConfig: - """ - Configuration for a Google Gemini model provider. Requires an API key - stored in AgentCore Identity. - """ - - model_id: str - """The Gemini model ID.""" - - api_key_arn: str - """The ARN of your Gemini API key on AgentCore Identity.""" - - max_tokens: int | None = None - """ - The maximum number of tokens to allow in the generated response per - model call. - """ - - temperature: float | None = None - """The temperature to set when calling the model.""" - - top_p: float | None = None - """The topP set when calling the model.""" - - top_k: int | None = None - """The topK set when calling the model.""" - - additional_params: Document | None = None - """ - Provider-specific parameters passed through to the Gemini model provider - unchanged. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_GEMINI_MODEL_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_GEMINI_MODEL_CONFIG.members["modelId"], self.model_id - ) - serializer.write_string( - _SCHEMA_HARNESS_GEMINI_MODEL_CONFIG.members["apiKeyArn"], self.api_key_arn - ) - if self.max_tokens is not None: - serializer.write_integer( - _SCHEMA_HARNESS_GEMINI_MODEL_CONFIG.members["maxTokens"], - self.max_tokens, - ) - - if self.temperature is not None: - serializer.write_float( - _SCHEMA_HARNESS_GEMINI_MODEL_CONFIG.members["temperature"], - self.temperature, - ) - - if self.top_p is not None: - serializer.write_float( - _SCHEMA_HARNESS_GEMINI_MODEL_CONFIG.members["topP"], self.top_p - ) - - if self.top_k is not None: - serializer.write_integer( - _SCHEMA_HARNESS_GEMINI_MODEL_CONFIG.members["topK"], self.top_k - ) - - if self.additional_params is not None: - serializer.write_document( - _SCHEMA_HARNESS_GEMINI_MODEL_CONFIG.members["additionalParams"], - self.additional_params, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_id"] = de.read_string( - _SCHEMA_HARNESS_GEMINI_MODEL_CONFIG.members["modelId"] - ) - - case 1: - kwargs["api_key_arn"] = de.read_string( - _SCHEMA_HARNESS_GEMINI_MODEL_CONFIG.members["apiKeyArn"] - ) - - case 2: - kwargs["max_tokens"] = de.read_integer( - _SCHEMA_HARNESS_GEMINI_MODEL_CONFIG.members["maxTokens"] - ) - - case 3: - kwargs["temperature"] = de.read_float( - _SCHEMA_HARNESS_GEMINI_MODEL_CONFIG.members["temperature"] - ) - - case 4: - kwargs["top_p"] = de.read_float( - _SCHEMA_HARNESS_GEMINI_MODEL_CONFIG.members["topP"] - ) - - case 5: - kwargs["top_k"] = de.read_integer( - _SCHEMA_HARNESS_GEMINI_MODEL_CONFIG.members["topK"] - ) - - case 6: - kwargs["additional_params"] = de.read_document( - _SCHEMA_HARNESS_GEMINI_MODEL_CONFIG.members["additionalParams"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_HARNESS_GEMINI_MODEL_CONFIG, consumer=_consumer - ) - if "model_id" not in kwargs: - kwargs["model_id"] = "" - if "api_key_arn" not in kwargs: - kwargs["api_key_arn"] = "" - return kwargs - - -@dataclass(kw_only=True) -class HarnessLiteLlmModelConfig: - """ - Configuration for a LiteLLM model provider, enabling connection to - third-party model providers. - """ - - model_id: str - """The LiteLLM model identifier (e.g., \"anthropic/claude-3-sonnet\").""" - - api_key_arn: str | None = None - """ - The ARN of the API key in AgentCore Identity for authenticating with the - model provider. - """ - - api_base: str | None = field(repr=False, default=None) - """The base URL for the model provider's API endpoint.""" - - max_tokens: int | None = None - """ - The maximum number of tokens to allow in the generated response per - iteration. - """ - - temperature: float | None = None - """The temperature to set when calling the model.""" - - top_p: float | None = None - """The topP set when calling the model.""" - - additional_params: Document | None = None - """ - Provider-specific parameters passed through to the model provider - unchanged. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_LITE_LLM_MODEL_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_LITE_LLM_MODEL_CONFIG.members["modelId"], self.model_id - ) - if self.api_key_arn is not None: - serializer.write_string( - _SCHEMA_HARNESS_LITE_LLM_MODEL_CONFIG.members["apiKeyArn"], - self.api_key_arn, - ) - - if self.api_base is not None: - serializer.write_string( - _SCHEMA_HARNESS_LITE_LLM_MODEL_CONFIG.members["apiBase"], self.api_base - ) - - if self.max_tokens is not None: - serializer.write_integer( - _SCHEMA_HARNESS_LITE_LLM_MODEL_CONFIG.members["maxTokens"], - self.max_tokens, - ) - - if self.temperature is not None: - serializer.write_float( - _SCHEMA_HARNESS_LITE_LLM_MODEL_CONFIG.members["temperature"], - self.temperature, - ) - - if self.top_p is not None: - serializer.write_float( - _SCHEMA_HARNESS_LITE_LLM_MODEL_CONFIG.members["topP"], self.top_p - ) - - if self.additional_params is not None: - serializer.write_document( - _SCHEMA_HARNESS_LITE_LLM_MODEL_CONFIG.members["additionalParams"], - self.additional_params, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_id"] = de.read_string( - _SCHEMA_HARNESS_LITE_LLM_MODEL_CONFIG.members["modelId"] - ) - - case 1: - kwargs["api_key_arn"] = de.read_string( - _SCHEMA_HARNESS_LITE_LLM_MODEL_CONFIG.members["apiKeyArn"] - ) - - case 2: - kwargs["api_base"] = de.read_string( - _SCHEMA_HARNESS_LITE_LLM_MODEL_CONFIG.members["apiBase"] - ) - - case 3: - kwargs["max_tokens"] = de.read_integer( - _SCHEMA_HARNESS_LITE_LLM_MODEL_CONFIG.members["maxTokens"] - ) - - case 4: - kwargs["temperature"] = de.read_float( - _SCHEMA_HARNESS_LITE_LLM_MODEL_CONFIG.members["temperature"] - ) - - case 5: - kwargs["top_p"] = de.read_float( - _SCHEMA_HARNESS_LITE_LLM_MODEL_CONFIG.members["topP"] - ) - - case 6: - kwargs["additional_params"] = de.read_document( - _SCHEMA_HARNESS_LITE_LLM_MODEL_CONFIG.members[ - "additionalParams" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_HARNESS_LITE_LLM_MODEL_CONFIG, consumer=_consumer - ) - if "model_id" not in kwargs: - kwargs["model_id"] = "" - return kwargs - - -class HarnessOpenAiApiFormat(UnknownEnumMixin, StrEnum): - CHAT_COMPLETIONS = "chat_completions" - """Use the Chat Completions API format.""" - RESPONSES = "responses" - """Use the Responses API format.""" - - -@dataclass(kw_only=True) -class HarnessOpenAiModelConfig: - """ - Configuration for an OpenAI model provider. Requires an API key stored - in AgentCore Identity. - """ - - model_id: str - """The OpenAI model ID.""" - - api_key_arn: str - """The ARN of your OpenAI API key on AgentCore Identity.""" - - api_base: str | None = field(repr=False, default=None) - """Optional custom endpoint URL for an OpenAI-compatible endpoint.""" - - max_tokens: int | None = None - """ - The maximum number of tokens to allow in the generated response per - model call. - """ - - temperature: float | None = None - """The temperature to set when calling the model.""" - - top_p: float | None = None - """The topP set when calling the model.""" - - api_format: str | None = None - """The API format to use when calling the OpenAI provider.""" - - additional_params: Document | None = None - """ - Provider-specific parameters passed through to the model provider - unchanged. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_OPEN_AI_MODEL_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_OPEN_AI_MODEL_CONFIG.members["modelId"], self.model_id - ) - serializer.write_string( - _SCHEMA_HARNESS_OPEN_AI_MODEL_CONFIG.members["apiKeyArn"], self.api_key_arn - ) - if self.api_base is not None: - serializer.write_string( - _SCHEMA_HARNESS_OPEN_AI_MODEL_CONFIG.members["apiBase"], self.api_base - ) - - if self.max_tokens is not None: - serializer.write_integer( - _SCHEMA_HARNESS_OPEN_AI_MODEL_CONFIG.members["maxTokens"], - self.max_tokens, - ) - - if self.temperature is not None: - serializer.write_float( - _SCHEMA_HARNESS_OPEN_AI_MODEL_CONFIG.members["temperature"], - self.temperature, - ) - - if self.top_p is not None: - serializer.write_float( - _SCHEMA_HARNESS_OPEN_AI_MODEL_CONFIG.members["topP"], self.top_p - ) - - if self.api_format is not None: - serializer.write_string( - _SCHEMA_HARNESS_OPEN_AI_MODEL_CONFIG.members["apiFormat"], - self.api_format, - ) - - if self.additional_params is not None: - serializer.write_document( - _SCHEMA_HARNESS_OPEN_AI_MODEL_CONFIG.members["additionalParams"], - self.additional_params, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_id"] = de.read_string( - _SCHEMA_HARNESS_OPEN_AI_MODEL_CONFIG.members["modelId"] - ) - - case 1: - kwargs["api_key_arn"] = de.read_string( - _SCHEMA_HARNESS_OPEN_AI_MODEL_CONFIG.members["apiKeyArn"] - ) - - case 2: - kwargs["api_base"] = de.read_string( - _SCHEMA_HARNESS_OPEN_AI_MODEL_CONFIG.members["apiBase"] - ) - - case 3: - kwargs["max_tokens"] = de.read_integer( - _SCHEMA_HARNESS_OPEN_AI_MODEL_CONFIG.members["maxTokens"] - ) - - case 4: - kwargs["temperature"] = de.read_float( - _SCHEMA_HARNESS_OPEN_AI_MODEL_CONFIG.members["temperature"] - ) - - case 5: - kwargs["top_p"] = de.read_float( - _SCHEMA_HARNESS_OPEN_AI_MODEL_CONFIG.members["topP"] - ) - - case 6: - kwargs["api_format"] = HarnessOpenAiApiFormat( - de.read_string( - _SCHEMA_HARNESS_OPEN_AI_MODEL_CONFIG.members["apiFormat"] - ) - ) - - case 7: - kwargs["additional_params"] = de.read_document( - _SCHEMA_HARNESS_OPEN_AI_MODEL_CONFIG.members["additionalParams"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_HARNESS_OPEN_AI_MODEL_CONFIG, consumer=_consumer - ) - if "model_id" not in kwargs: - kwargs["model_id"] = "" - if "api_key_arn" not in kwargs: - kwargs["api_key_arn"] = "" - return kwargs - - -@dataclass -class HarnessModelConfigurationBedrockModelConfig: - """Configuration for an Amazon Bedrock model.""" - - value: HarnessBedrockModelConfig - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_MODEL_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_MODEL_CONFIGURATION.members["bedrockModelConfig"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HarnessBedrockModelConfig.deserialize(deserializer)) - - -@dataclass -class HarnessModelConfigurationOpenAiModelConfig: - """Configuration for an OpenAI model.""" - - value: HarnessOpenAiModelConfig - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_MODEL_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_MODEL_CONFIGURATION.members["openAiModelConfig"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HarnessOpenAiModelConfig.deserialize(deserializer)) - - -@dataclass -class HarnessModelConfigurationGeminiModelConfig: - """Configuration for a Google Gemini model.""" - - value: HarnessGeminiModelConfig - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_MODEL_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_MODEL_CONFIGURATION.members["geminiModelConfig"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HarnessGeminiModelConfig.deserialize(deserializer)) - - -@dataclass -class HarnessModelConfigurationLiteLlmModelConfig: - """ - The LiteLLM model configuration for connecting to third-party model - providers. - """ - - value: HarnessLiteLlmModelConfig - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_MODEL_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_MODEL_CONFIGURATION.members["liteLlmModelConfig"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HarnessLiteLlmModelConfig.deserialize(deserializer)) - - -@dataclass -class HarnessModelConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -HarnessModelConfiguration = Union[ - HarnessModelConfigurationBedrockModelConfig - | HarnessModelConfigurationOpenAiModelConfig - | HarnessModelConfigurationGeminiModelConfig - | HarnessModelConfigurationLiteLlmModelConfig - | HarnessModelConfigurationUnknown -] -"""Specification of which model to use.""" - - -class _HarnessModelConfigurationDeserializer: - _result: HarnessModelConfiguration | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> HarnessModelConfiguration: - self._result = None - deserializer.read_struct(_SCHEMA_HARNESS_MODEL_CONFIGURATION, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - HarnessModelConfigurationBedrockModelConfig.deserialize(de) - ) - - case 1: - self._set_result( - HarnessModelConfigurationOpenAiModelConfig.deserialize(de) - ) - - case 2: - self._set_result( - HarnessModelConfigurationGeminiModelConfig.deserialize(de) - ) - - case 3: - self._set_result( - HarnessModelConfigurationLiteLlmModelConfig.deserialize(de) - ) - - case _: - self._set_result( - HarnessModelConfigurationUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: HarnessModelConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_harness_aws_skill_paths( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_harness_aws_skill_paths( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class HarnessSkillAwsSkillsSource: - """Passed to show that AWS Skills should be included.""" - - paths: list[str] | None = None - """ - Optionally filter allowed skills with glob syntax, e.g., - ['core-skills/*']. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_SKILL_AWS_SKILLS_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.paths is not None: - _serialize_harness_aws_skill_paths( - serializer, - _SCHEMA_HARNESS_SKILL_AWS_SKILLS_SOURCE.members["paths"], - self.paths, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["paths"] = _deserialize_harness_aws_skill_paths( - de, _SCHEMA_HARNESS_SKILL_AWS_SKILLS_SOURCE.members["paths"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_HARNESS_SKILL_AWS_SKILLS_SOURCE, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class HarnessSkillGitAuth: - """Authentication configuration for accessing a private git repository.""" - - credential_arn: str - """ - The ARN of the credential in AgentCore Identity containing the password - or personal access token. - """ - - username: str | None = None - """Username for authentication. Defaults to 'oauth2' if not specified.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_SKILL_GIT_AUTH, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_SKILL_GIT_AUTH.members["credentialArn"], self.credential_arn - ) - if self.username is not None: - serializer.write_string( - _SCHEMA_HARNESS_SKILL_GIT_AUTH.members["username"], self.username - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["credential_arn"] = de.read_string( - _SCHEMA_HARNESS_SKILL_GIT_AUTH.members["credentialArn"] - ) - - case 1: - kwargs["username"] = de.read_string( - _SCHEMA_HARNESS_SKILL_GIT_AUTH.members["username"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_HARNESS_SKILL_GIT_AUTH, consumer=_consumer) - if "credential_arn" not in kwargs: - kwargs["credential_arn"] = "" - return kwargs - - -@dataclass(kw_only=True) -class HarnessSkillGitSource: - """A git repository source for a skill.""" - - url: str - """The HTTPS URL of the git repository.""" - - path: str | None = None - """Subdirectory within the repository containing the skill.""" - - auth: HarnessSkillGitAuth | None = None - """Authentication configuration for private repositories.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_SKILL_GIT_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_SKILL_GIT_SOURCE.members["url"], self.url - ) - if self.path is not None: - serializer.write_string( - _SCHEMA_HARNESS_SKILL_GIT_SOURCE.members["path"], self.path - ) - - if self.auth is not None: - serializer.write_struct( - _SCHEMA_HARNESS_SKILL_GIT_SOURCE.members["auth"], self.auth - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["url"] = de.read_string( - _SCHEMA_HARNESS_SKILL_GIT_SOURCE.members["url"] - ) - - case 1: - kwargs["path"] = de.read_string( - _SCHEMA_HARNESS_SKILL_GIT_SOURCE.members["path"] - ) - - case 2: - kwargs["auth"] = HarnessSkillGitAuth.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_HARNESS_SKILL_GIT_SOURCE, consumer=_consumer) - if "url" not in kwargs: - kwargs["url"] = "" - return kwargs - - -@dataclass(kw_only=True) -class HarnessSkillS3Source: - """An S3 source for a skill.""" - - uri: str - """ - The S3 URI pointing to the skill directory (e.g., - s3://bucket/skills/my-skill/). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_SKILL_S3_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_SKILL_S3_SOURCE.members["uri"], self.uri - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["uri"] = de.read_string( - _SCHEMA_HARNESS_SKILL_S3_SOURCE.members["uri"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_HARNESS_SKILL_S3_SOURCE, consumer=_consumer) - if "uri" not in kwargs: - kwargs["uri"] = "" - return kwargs - - -@dataclass -class HarnessSkillPath: - """The filesystem path to the skill definition.""" - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_SKILL, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_HARNESS_SKILL.members["path"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string(_SCHEMA_HARNESS_SKILL.members["path"]) - ) - - -@dataclass -class HarnessSkillS3: - """An S3 source containing the skill.""" - - value: HarnessSkillS3Source - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_SKILL, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_SKILL.members["s3"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HarnessSkillS3Source.deserialize(deserializer)) - - -@dataclass -class HarnessSkillGit: - """A git repository containing the skill.""" - - value: HarnessSkillGitSource - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_SKILL, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_SKILL.members["git"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HarnessSkillGitSource.deserialize(deserializer)) - - -@dataclass -class HarnessSkillAwsSkills: - """AWS Skills baked into the harness's underlying Runtime.""" - - value: HarnessSkillAwsSkillsSource - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_SKILL, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_SKILL.members["awsSkills"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HarnessSkillAwsSkillsSource.deserialize(deserializer)) - - -@dataclass -class HarnessSkillUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -HarnessSkill = Union[ - HarnessSkillPath - | HarnessSkillS3 - | HarnessSkillGit - | HarnessSkillAwsSkills - | HarnessSkillUnknown -] -"""A skill available to the agent.""" - - -class _HarnessSkillDeserializer: - _result: HarnessSkill | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> HarnessSkill: - self._result = None - deserializer.read_struct(_SCHEMA_HARNESS_SKILL, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(HarnessSkillPath.deserialize(de)) - - case 1: - self._set_result(HarnessSkillS3.deserialize(de)) - - case 2: - self._set_result(HarnessSkillGit.deserialize(de)) - - case 3: - self._set_result(HarnessSkillAwsSkills.deserialize(de)) - - case _: - self._set_result(HarnessSkillUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: HarnessSkill) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_harness_skills( - serializer: ShapeSerializer, schema: Schema, value: list[HarnessSkill] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_harness_skills( - deserializer: ShapeDeserializer, schema: Schema -) -> list[HarnessSkill]: - result: list[HarnessSkill] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_HarnessSkillDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass -class HarnessSystemContentBlockText: - """The text content of the system prompt block.""" - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_SYSTEM_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_SYSTEM_CONTENT_BLOCK.members["text"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string( - _SCHEMA_HARNESS_SYSTEM_CONTENT_BLOCK.members["text"] - ) - ) - - -@dataclass -class HarnessSystemContentBlockUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -HarnessSystemContentBlock = Union[ - HarnessSystemContentBlockText | HarnessSystemContentBlockUnknown -] -"""A content block in the system prompt.""" - - -class _HarnessSystemContentBlockDeserializer: - _result: HarnessSystemContentBlock | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> HarnessSystemContentBlock: - self._result = None - deserializer.read_struct(_SCHEMA_HARNESS_SYSTEM_CONTENT_BLOCK, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(HarnessSystemContentBlockText.deserialize(de)) - - case _: - self._set_result( - HarnessSystemContentBlockUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: HarnessSystemContentBlock) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_harness_system_prompt( - serializer: ShapeSerializer, schema: Schema, value: list[HarnessSystemContentBlock] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_harness_system_prompt( - deserializer: ShapeDeserializer, schema: Schema -) -> list[HarnessSystemContentBlock]: - result: list[HarnessSystemContentBlock] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_HarnessSystemContentBlockDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class HarnessAgentCoreBrowserConfig: - """Configuration for AgentCore Browser.""" - - browser_arn: str | None = None - """If not populated, the built-in Browser ARN is used.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_AGENT_CORE_BROWSER_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.browser_arn is not None: - serializer.write_string( - _SCHEMA_HARNESS_AGENT_CORE_BROWSER_CONFIG.members["browserArn"], - self.browser_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["browser_arn"] = de.read_string( - _SCHEMA_HARNESS_AGENT_CORE_BROWSER_CONFIG.members["browserArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_HARNESS_AGENT_CORE_BROWSER_CONFIG, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class HarnessAgentCoreCodeInterpreterConfig: - """Configuration for AgentCore Code Interpreter.""" - - code_interpreter_arn: str | None = None - """If not populated, the built-in Code Interpreter ARN is used.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_AGENT_CORE_CODE_INTERPRETER_CONFIG, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.code_interpreter_arn is not None: - serializer.write_string( - _SCHEMA_HARNESS_AGENT_CORE_CODE_INTERPRETER_CONFIG.members[ - "codeInterpreterArn" - ], - self.code_interpreter_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["code_interpreter_arn"] = de.read_string( - _SCHEMA_HARNESS_AGENT_CORE_CODE_INTERPRETER_CONFIG.members[ - "codeInterpreterArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_HARNESS_AGENT_CORE_CODE_INTERPRETER_CONFIG, consumer=_consumer - ) - return kwargs - - -@dataclass -class HarnessGatewayOutboundAuthAwsIam: - """SigV4-sign requests using the agent's execution role.""" - - value: Unit - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_GATEWAY_OUTBOUND_AUTH, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_GATEWAY_OUTBOUND_AUTH.members["awsIam"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=Unit.deserialize(deserializer)) - - -@dataclass -class HarnessGatewayOutboundAuthNone: - """No authentication.""" - - value: Unit - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_GATEWAY_OUTBOUND_AUTH, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_GATEWAY_OUTBOUND_AUTH.members["none"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=Unit.deserialize(deserializer)) - - -@dataclass -class HarnessGatewayOutboundAuthOauth: - """Use OAuth credentials for outbound authentication to the gateway.""" - - value: OAuthCredentialProvider - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_GATEWAY_OUTBOUND_AUTH, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_GATEWAY_OUTBOUND_AUTH.members["oauth"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=OAuthCredentialProvider.deserialize(deserializer)) - - -@dataclass -class HarnessGatewayOutboundAuthUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -HarnessGatewayOutboundAuth = Union[ - HarnessGatewayOutboundAuthAwsIam - | HarnessGatewayOutboundAuthNone - | HarnessGatewayOutboundAuthOauth - | HarnessGatewayOutboundAuthUnknown -] -"""Authentication method for calling a Gateway.""" - - -class _HarnessGatewayOutboundAuthDeserializer: - _result: HarnessGatewayOutboundAuth | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> HarnessGatewayOutboundAuth: - self._result = None - deserializer.read_struct(_SCHEMA_HARNESS_GATEWAY_OUTBOUND_AUTH, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(HarnessGatewayOutboundAuthAwsIam.deserialize(de)) - - case 1: - self._set_result(HarnessGatewayOutboundAuthNone.deserialize(de)) - - case 2: - self._set_result(HarnessGatewayOutboundAuthOauth.deserialize(de)) - - case _: - self._set_result( - HarnessGatewayOutboundAuthUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: HarnessGatewayOutboundAuth) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class HarnessAgentCoreGatewayConfig: - """Configuration for AgentCore Gateway.""" - - gateway_arn: str - """The ARN of the desired AgentCore Gateway.""" - - outbound_auth: HarnessGatewayOutboundAuth | None = None - """ - How harness authenticates to this Gateway. Defaults to AWS_IAM (SigV4) - if omitted. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_AGENT_CORE_GATEWAY_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_AGENT_CORE_GATEWAY_CONFIG.members["gatewayArn"], - self.gateway_arn, - ) - if self.outbound_auth is not None: - serializer.write_struct( - _SCHEMA_HARNESS_AGENT_CORE_GATEWAY_CONFIG.members["outboundAuth"], - self.outbound_auth, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["gateway_arn"] = de.read_string( - _SCHEMA_HARNESS_AGENT_CORE_GATEWAY_CONFIG.members["gatewayArn"] - ) - - case 1: - kwargs["outbound_auth"] = ( - _HarnessGatewayOutboundAuthDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_HARNESS_AGENT_CORE_GATEWAY_CONFIG, consumer=_consumer - ) - if "gateway_arn" not in kwargs: - kwargs["gateway_arn"] = "" - return kwargs - - -@dataclass(kw_only=True) -class HarnessInlineFunctionConfig: - """ - Configuration for an inline function tool. When the agent calls this - tool, the tool call is returned to the caller for external execution. - """ - - description: str = field(repr=False) - """Description of what the tool does, provided to the model.""" - - input_schema: Document = field(repr=False) - """JSON Schema describing the tool's input parameters.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_INLINE_FUNCTION_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_INLINE_FUNCTION_CONFIG.members["description"], - self.description, - ) - serializer.write_document( - _SCHEMA_HARNESS_INLINE_FUNCTION_CONFIG.members["inputSchema"], - self.input_schema, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["description"] = de.read_string( - _SCHEMA_HARNESS_INLINE_FUNCTION_CONFIG.members["description"] - ) - - case 1: - kwargs["input_schema"] = de.read_document( - _SCHEMA_HARNESS_INLINE_FUNCTION_CONFIG.members["inputSchema"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_HARNESS_INLINE_FUNCTION_CONFIG, consumer=_consumer - ) - if "description" not in kwargs: - kwargs["description"] = "" - if "input_schema" not in kwargs: - kwargs["input_schema"] = Document(None) - return kwargs - - -def _serialize_http_headers_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_http_headers_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class HarnessRemoteMcpConfig: - """Configuration for connecting to a remote MCP server.""" - - url: str = field(repr=False) - """URL of the MCP endpoint.""" - - headers: dict[str, str] | None = field(repr=False, default=None) - """Custom headers to include when connecting to the remote MCP server.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_REMOTE_MCP_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_REMOTE_MCP_CONFIG.members["url"], self.url - ) - if self.headers is not None: - _serialize_http_headers_map( - serializer, - _SCHEMA_HARNESS_REMOTE_MCP_CONFIG.members["headers"], - self.headers, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["url"] = de.read_string( - _SCHEMA_HARNESS_REMOTE_MCP_CONFIG.members["url"] - ) - - case 1: - kwargs["headers"] = _deserialize_http_headers_map( - de, _SCHEMA_HARNESS_REMOTE_MCP_CONFIG.members["headers"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_HARNESS_REMOTE_MCP_CONFIG, consumer=_consumer) - if "url" not in kwargs: - kwargs["url"] = "" - return kwargs - - -@dataclass -class HarnessToolConfigurationRemoteMcp: - """Configuration for remote MCP server.""" - - value: HarnessRemoteMcpConfig - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_TOOL_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_TOOL_CONFIGURATION.members["remoteMcp"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HarnessRemoteMcpConfig.deserialize(deserializer)) - - -@dataclass -class HarnessToolConfigurationAgentCoreBrowser: - """Configuration for AgentCore Browser.""" - - value: HarnessAgentCoreBrowserConfig - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_TOOL_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_TOOL_CONFIGURATION.members["agentCoreBrowser"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HarnessAgentCoreBrowserConfig.deserialize(deserializer)) - - -@dataclass -class HarnessToolConfigurationAgentCoreGateway: - """Configuration for AgentCore Gateway.""" - - value: HarnessAgentCoreGatewayConfig - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_TOOL_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_TOOL_CONFIGURATION.members["agentCoreGateway"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HarnessAgentCoreGatewayConfig.deserialize(deserializer)) - - -@dataclass -class HarnessToolConfigurationInlineFunction: - """Configuration for an inline function tool.""" - - value: HarnessInlineFunctionConfig - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_TOOL_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_TOOL_CONFIGURATION.members["inlineFunction"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HarnessInlineFunctionConfig.deserialize(deserializer)) - - -@dataclass -class HarnessToolConfigurationAgentCoreCodeInterpreter: - """Configuration for AgentCore Code Interpreter.""" - - value: HarnessAgentCoreCodeInterpreterConfig - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_TOOL_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_TOOL_CONFIGURATION.members["agentCoreCodeInterpreter"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=HarnessAgentCoreCodeInterpreterConfig.deserialize(deserializer) - ) - - -@dataclass -class HarnessToolConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -HarnessToolConfiguration = Union[ - HarnessToolConfigurationRemoteMcp - | HarnessToolConfigurationAgentCoreBrowser - | HarnessToolConfigurationAgentCoreGateway - | HarnessToolConfigurationInlineFunction - | HarnessToolConfigurationAgentCoreCodeInterpreter - | HarnessToolConfigurationUnknown -] -"""Configuration union for different tool types.""" - - -class _HarnessToolConfigurationDeserializer: - _result: HarnessToolConfiguration | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> HarnessToolConfiguration: - self._result = None - deserializer.read_struct(_SCHEMA_HARNESS_TOOL_CONFIGURATION, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(HarnessToolConfigurationRemoteMcp.deserialize(de)) - - case 1: - self._set_result( - HarnessToolConfigurationAgentCoreBrowser.deserialize(de) - ) - - case 2: - self._set_result( - HarnessToolConfigurationAgentCoreGateway.deserialize(de) - ) - - case 3: - self._set_result(HarnessToolConfigurationInlineFunction.deserialize(de)) - - case 4: - self._set_result( - HarnessToolConfigurationAgentCoreCodeInterpreter.deserialize(de) - ) - - case _: - self._set_result( - HarnessToolConfigurationUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: HarnessToolConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class HarnessToolType(UnknownEnumMixin, StrEnum): - REMOTE_MCP = "remote_mcp" - AGENTCORE_BROWSER = "agentcore_browser" - AGENTCORE_GATEWAY = "agentcore_gateway" - INLINE_FUNCTION = "inline_function" - AGENTCORE_CODE_INTERPRETER = "agentcore_code_interpreter" - - -@dataclass(kw_only=True) -class HarnessTool: - """A tool available to the agent loop.""" - - type: str - """The type of tool.""" - - name: str | None = None - """ - Unique name for the tool. If not provided, a name will be inferred or - generated. - """ - - config: HarnessToolConfiguration | None = None - """Tool-specific configuration.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_TOOL, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_HARNESS_TOOL.members["type"], self.type) - if self.name is not None: - serializer.write_string(_SCHEMA_HARNESS_TOOL.members["name"], self.name) - - if self.config is not None: - serializer.write_struct(_SCHEMA_HARNESS_TOOL.members["config"], self.config) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = HarnessToolType( - de.read_string(_SCHEMA_HARNESS_TOOL.members["type"]) - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_HARNESS_TOOL.members["name"] - ) - - case 2: - kwargs["config"] = ( - _HarnessToolConfigurationDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_HARNESS_TOOL, consumer=_consumer) - if "type" not in kwargs: - kwargs["type"] = HarnessToolType._corrected("") - return kwargs - - -def _serialize_harness_tools( - serializer: ShapeSerializer, schema: Schema, value: list[HarnessTool] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_harness_tools( - deserializer: ShapeDeserializer, schema: Schema -) -> list[HarnessTool]: - result: list[HarnessTool] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(HarnessTool.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class HarnessSlidingWindowConfiguration: - """Configuration for sliding window truncation strategy.""" - - messages_count: int | None = None - """The number of recent messages to retain in the context window.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_SLIDING_WINDOW_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.messages_count is not None: - serializer.write_integer( - _SCHEMA_HARNESS_SLIDING_WINDOW_CONFIGURATION.members["messagesCount"], - self.messages_count, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["messages_count"] = de.read_integer( - _SCHEMA_HARNESS_SLIDING_WINDOW_CONFIGURATION.members[ - "messagesCount" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_HARNESS_SLIDING_WINDOW_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class HarnessSummarizationConfiguration: - """Configuration for summarization-based truncation strategy.""" - - summary_ratio: float | None = None - """The ratio of content to summarize.""" - - preserve_recent_messages: int | None = None - """The number of recent messages to preserve without summarization.""" - - summarization_system_prompt: str | None = None - """The system prompt used for generating summaries.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_SUMMARIZATION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.summary_ratio is not None: - serializer.write_float( - _SCHEMA_HARNESS_SUMMARIZATION_CONFIGURATION.members["summaryRatio"], - self.summary_ratio, - ) - - if self.preserve_recent_messages is not None: - serializer.write_integer( - _SCHEMA_HARNESS_SUMMARIZATION_CONFIGURATION.members[ - "preserveRecentMessages" - ], - self.preserve_recent_messages, - ) - - if self.summarization_system_prompt is not None: - serializer.write_string( - _SCHEMA_HARNESS_SUMMARIZATION_CONFIGURATION.members[ - "summarizationSystemPrompt" - ], - self.summarization_system_prompt, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["summary_ratio"] = de.read_float( - _SCHEMA_HARNESS_SUMMARIZATION_CONFIGURATION.members[ - "summaryRatio" - ] - ) - - case 1: - kwargs["preserve_recent_messages"] = de.read_integer( - _SCHEMA_HARNESS_SUMMARIZATION_CONFIGURATION.members[ - "preserveRecentMessages" - ] - ) - - case 2: - kwargs["summarization_system_prompt"] = de.read_string( - _SCHEMA_HARNESS_SUMMARIZATION_CONFIGURATION.members[ - "summarizationSystemPrompt" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_HARNESS_SUMMARIZATION_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass -class HarnessTruncationStrategyConfigurationSlidingWindow: - """Configuration for sliding window truncation.""" - - value: HarnessSlidingWindowConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_TRUNCATION_STRATEGY_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_TRUNCATION_STRATEGY_CONFIGURATION.members["slidingWindow"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HarnessSlidingWindowConfiguration.deserialize(deserializer)) - - -@dataclass -class HarnessTruncationStrategyConfigurationSummarization: - """Configuration for summarization-based truncation.""" - - value: HarnessSummarizationConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_TRUNCATION_STRATEGY_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_TRUNCATION_STRATEGY_CONFIGURATION.members["summarization"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HarnessSummarizationConfiguration.deserialize(deserializer)) - - -@dataclass -class HarnessTruncationStrategyConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -HarnessTruncationStrategyConfiguration = Union[ - HarnessTruncationStrategyConfigurationSlidingWindow - | HarnessTruncationStrategyConfigurationSummarization - | HarnessTruncationStrategyConfigurationUnknown -] -"""Strategy-specific truncation configuration.""" - - -class _HarnessTruncationStrategyConfigurationDeserializer: - _result: HarnessTruncationStrategyConfiguration | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> HarnessTruncationStrategyConfiguration: - self._result = None - deserializer.read_struct( - _SCHEMA_HARNESS_TRUNCATION_STRATEGY_CONFIGURATION, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - HarnessTruncationStrategyConfigurationSlidingWindow.deserialize(de) - ) - - case 1: - self._set_result( - HarnessTruncationStrategyConfigurationSummarization.deserialize(de) - ) - - case _: - self._set_result( - HarnessTruncationStrategyConfigurationUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: HarnessTruncationStrategyConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class HarnessTruncationStrategy(UnknownEnumMixin, StrEnum): - SLIDING_WINDOW = "sliding_window" - SUMMARIZATION = "summarization" - NONE = "none" - - -@dataclass(kw_only=True) -class HarnessTruncationConfiguration: - """ - Configuration for truncating conversation context when it exceeds model - limits. - """ - - strategy: str - """The truncation strategy to use.""" - - config: HarnessTruncationStrategyConfiguration | None = None - """The strategy-specific configuration.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_TRUNCATION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_TRUNCATION_CONFIGURATION.members["strategy"], self.strategy - ) - if self.config is not None: - serializer.write_struct( - _SCHEMA_HARNESS_TRUNCATION_CONFIGURATION.members["config"], self.config - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["strategy"] = HarnessTruncationStrategy( - de.read_string( - _SCHEMA_HARNESS_TRUNCATION_CONFIGURATION.members["strategy"] - ) - ) - - case 1: - kwargs["config"] = ( - _HarnessTruncationStrategyConfigurationDeserializer().deserialize( - de - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_HARNESS_TRUNCATION_CONFIGURATION, consumer=_consumer - ) - if "strategy" not in kwargs: - kwargs["strategy"] = HarnessTruncationStrategy._corrected("") - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(strategy=HarnessTruncationStrategy._corrected("")) - - -@dataclass(kw_only=True) -class CreateHarnessInput: - """Dataclass for CreateHarnessInput structure.""" - - harness_name: str | None = None - """ - The name of the harness. Must start with a letter and contain only - alphanumeric characters and underscores. - """ - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure idempotency of the - request. - """ - - execution_role_arn: str | None = None - """ - The ARN of the IAM role that the harness assumes when running. This role - must have permissions for the services the agent needs to access, such - as Amazon Bedrock for model invocation. - """ - - environment: HarnessEnvironmentProviderRequest | None = None - """ - The compute environment configuration for the harness, including network - and lifecycle settings. - """ - - environment_artifact: HarnessEnvironmentArtifact | None = None - """ - The environment artifact for the harness, such as a custom container - image containing additional dependencies. - """ - - environment_variables: dict[str, str] | None = field(repr=False, default=None) - """Environment variables to set in the harness runtime environment.""" - - authorizer_configuration: AuthorizerConfiguration | None = None - """ - Represents inbound authorization configuration options used to - authenticate incoming requests. - """ - - model: HarnessModelConfiguration | None = None - """ - The model configuration for the harness. Supports Amazon Bedrock, - OpenAI, and Google Gemini model providers. - """ - - system_prompt: list[HarnessSystemContentBlock] | None = None - """The system prompt that defines the agent's behavior and instructions.""" - - tools: list[HarnessTool] | None = None - """ - The tools available to the agent, such as remote MCP servers, AgentCore - Gateway, AgentCore Browser, Code Interpreter, or inline functions. - """ - - skills: list[HarnessSkill] | None = None - """ - The skills available to the agent. Skills are bundles of files that the - agent can pull into its context on demand. - """ - - allowed_tools: list[str] | None = None - """ - The tools that the agent is allowed to use. Supports glob patterns such - as * for all tools, @builtin for all built-in tools, or - @serverName/toolName for specific MCP server tools. - """ - - memory: HarnessMemoryConfiguration | None = None - """ - The AgentCore Memory configuration for persisting conversation context - across sessions. - """ - - truncation: HarnessTruncationConfiguration | None = None - """ - The truncation configuration for managing conversation context when it - exceeds model limits. - """ - - hooks: list[HarnessHook] | None = None - """The lifecycle hooks to run at defined points in the agent loop.""" - - max_iterations: int | None = None - """ - The maximum number of iterations the agent loop can execute per - invocation. - """ - - max_tokens: int | None = None - """ - The maximum total number of output tokens the agent can generate across - all model calls within a single invocation. - """ - - timeout_seconds: int | None = None - """ - The maximum duration in seconds for the agent loop execution per - invocation. - """ - - tags: dict[str, str] | None = None - """Tags to apply to the harness resource.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_HARNESS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.harness_name is not None: - serializer.write_string( - _SCHEMA_CREATE_HARNESS_INPUT.members["harnessName"], self.harness_name - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_HARNESS_INPUT.members["clientToken"], self.client_token - ) - - if self.execution_role_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_HARNESS_INPUT.members["executionRoleArn"], - self.execution_role_arn, - ) - - if self.environment is not None: - serializer.write_struct( - _SCHEMA_CREATE_HARNESS_INPUT.members["environment"], self.environment - ) - - if self.environment_artifact is not None: - serializer.write_struct( - _SCHEMA_CREATE_HARNESS_INPUT.members["environmentArtifact"], - self.environment_artifact, - ) - - if self.environment_variables is not None: - _serialize_environment_variables_map( - serializer, - _SCHEMA_CREATE_HARNESS_INPUT.members["environmentVariables"], - self.environment_variables, - ) - - if self.authorizer_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_HARNESS_INPUT.members["authorizerConfiguration"], - self.authorizer_configuration, - ) - - if self.model is not None: - serializer.write_struct( - _SCHEMA_CREATE_HARNESS_INPUT.members["model"], self.model - ) - - if self.system_prompt is not None: - _serialize_harness_system_prompt( - serializer, - _SCHEMA_CREATE_HARNESS_INPUT.members["systemPrompt"], - self.system_prompt, - ) - - if self.tools is not None: - _serialize_harness_tools( - serializer, _SCHEMA_CREATE_HARNESS_INPUT.members["tools"], self.tools - ) - - if self.skills is not None: - _serialize_harness_skills( - serializer, _SCHEMA_CREATE_HARNESS_INPUT.members["skills"], self.skills - ) - - if self.allowed_tools is not None: - _serialize_harness_allowed_tools( - serializer, - _SCHEMA_CREATE_HARNESS_INPUT.members["allowedTools"], - self.allowed_tools, - ) - - if self.memory is not None: - serializer.write_struct( - _SCHEMA_CREATE_HARNESS_INPUT.members["memory"], self.memory - ) - - if self.truncation is not None: - serializer.write_struct( - _SCHEMA_CREATE_HARNESS_INPUT.members["truncation"], self.truncation - ) - - if self.hooks is not None: - _serialize_harness_hooks( - serializer, _SCHEMA_CREATE_HARNESS_INPUT.members["hooks"], self.hooks - ) - - if self.max_iterations is not None: - serializer.write_integer( - _SCHEMA_CREATE_HARNESS_INPUT.members["maxIterations"], - self.max_iterations, - ) - - if self.max_tokens is not None: - serializer.write_integer( - _SCHEMA_CREATE_HARNESS_INPUT.members["maxTokens"], self.max_tokens - ) - - if self.timeout_seconds is not None: - serializer.write_integer( - _SCHEMA_CREATE_HARNESS_INPUT.members["timeoutSeconds"], - self.timeout_seconds, - ) - - if self.tags is not None: - _serialize_tags_map( - serializer, _SCHEMA_CREATE_HARNESS_INPUT.members["tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["harness_name"] = de.read_string( - _SCHEMA_CREATE_HARNESS_INPUT.members["harnessName"] - ) - - case 1: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_HARNESS_INPUT.members["clientToken"] - ) - - case 2: - kwargs["execution_role_arn"] = de.read_string( - _SCHEMA_CREATE_HARNESS_INPUT.members["executionRoleArn"] - ) - - case 3: - kwargs["environment"] = ( - _HarnessEnvironmentProviderRequestDeserializer().deserialize(de) - ) - - case 4: - kwargs["environment_artifact"] = ( - _HarnessEnvironmentArtifactDeserializer().deserialize(de) - ) - - case 5: - kwargs["environment_variables"] = ( - _deserialize_environment_variables_map( - de, - _SCHEMA_CREATE_HARNESS_INPUT.members[ - "environmentVariables" - ], - ) - ) - - case 6: - kwargs["authorizer_configuration"] = ( - _AuthorizerConfigurationDeserializer().deserialize(de) - ) - - case 7: - kwargs["model"] = ( - _HarnessModelConfigurationDeserializer().deserialize(de) - ) - - case 8: - kwargs["system_prompt"] = _deserialize_harness_system_prompt( - de, _SCHEMA_CREATE_HARNESS_INPUT.members["systemPrompt"] - ) - - case 9: - kwargs["tools"] = _deserialize_harness_tools( - de, _SCHEMA_CREATE_HARNESS_INPUT.members["tools"] - ) - - case 10: - kwargs["skills"] = _deserialize_harness_skills( - de, _SCHEMA_CREATE_HARNESS_INPUT.members["skills"] - ) - - case 11: - kwargs["allowed_tools"] = _deserialize_harness_allowed_tools( - de, _SCHEMA_CREATE_HARNESS_INPUT.members["allowedTools"] - ) - - case 12: - kwargs["memory"] = ( - _HarnessMemoryConfigurationDeserializer().deserialize(de) - ) - - case 13: - kwargs["truncation"] = HarnessTruncationConfiguration.deserialize( - de - ) - - case 14: - kwargs["hooks"] = _deserialize_harness_hooks( - de, _SCHEMA_CREATE_HARNESS_INPUT.members["hooks"] - ) - - case 15: - kwargs["max_iterations"] = de.read_integer( - _SCHEMA_CREATE_HARNESS_INPUT.members["maxIterations"] - ) - - case 16: - kwargs["max_tokens"] = de.read_integer( - _SCHEMA_CREATE_HARNESS_INPUT.members["maxTokens"] - ) - - case 17: - kwargs["timeout_seconds"] = de.read_integer( - _SCHEMA_CREATE_HARNESS_INPUT.members["timeoutSeconds"] - ) - - case 18: - kwargs["tags"] = _deserialize_tags_map( - de, _SCHEMA_CREATE_HARNESS_INPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_HARNESS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class HarnessAgentCoreRuntimeEnvironment: - """The AgentCore Runtime environment for a harness.""" - - agent_runtime_arn: str - """The ARN of the underlying AgentCore Runtime.""" - - agent_runtime_name: str - """The name of the underlying AgentCore Runtime.""" - - agent_runtime_id: str - """The ID of the underlying AgentCore Runtime.""" - - lifecycle_configuration: LifecycleConfiguration - """ - LifecycleConfiguration lets you manage the lifecycle of runtime sessions - and resources in AgentCore Runtime. This configuration helps optimize - resource utilization by automatically cleaning up idle sessions and - preventing long-running instances from consuming resources indefinitely. - """ - - network_configuration: NetworkConfiguration - """SecurityConfig for the Agent.""" - - filesystem_configurations: list[FilesystemConfiguration] | None = None - """The filesystem configurations for the runtime environment.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_AGENT_CORE_RUNTIME_ENVIRONMENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_AGENT_CORE_RUNTIME_ENVIRONMENT.members["agentRuntimeArn"], - self.agent_runtime_arn, - ) - serializer.write_string( - _SCHEMA_HARNESS_AGENT_CORE_RUNTIME_ENVIRONMENT.members["agentRuntimeName"], - self.agent_runtime_name, - ) - serializer.write_string( - _SCHEMA_HARNESS_AGENT_CORE_RUNTIME_ENVIRONMENT.members["agentRuntimeId"], - self.agent_runtime_id, - ) - serializer.write_struct( - _SCHEMA_HARNESS_AGENT_CORE_RUNTIME_ENVIRONMENT.members[ - "lifecycleConfiguration" - ], - self.lifecycle_configuration, - ) - serializer.write_struct( - _SCHEMA_HARNESS_AGENT_CORE_RUNTIME_ENVIRONMENT.members[ - "networkConfiguration" - ], - self.network_configuration, - ) - if self.filesystem_configurations is not None: - _serialize_filesystem_configurations( - serializer, - _SCHEMA_HARNESS_AGENT_CORE_RUNTIME_ENVIRONMENT.members[ - "filesystemConfigurations" - ], - self.filesystem_configurations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_runtime_arn"] = de.read_string( - _SCHEMA_HARNESS_AGENT_CORE_RUNTIME_ENVIRONMENT.members[ - "agentRuntimeArn" - ] - ) - - case 1: - kwargs["agent_runtime_name"] = de.read_string( - _SCHEMA_HARNESS_AGENT_CORE_RUNTIME_ENVIRONMENT.members[ - "agentRuntimeName" - ] - ) - - case 2: - kwargs["agent_runtime_id"] = de.read_string( - _SCHEMA_HARNESS_AGENT_CORE_RUNTIME_ENVIRONMENT.members[ - "agentRuntimeId" - ] - ) - - case 3: - kwargs["lifecycle_configuration"] = ( - LifecycleConfiguration.deserialize(de) - ) - - case 4: - kwargs["network_configuration"] = NetworkConfiguration.deserialize( - de - ) - - case 5: - kwargs["filesystem_configurations"] = ( - _deserialize_filesystem_configurations( - de, - _SCHEMA_HARNESS_AGENT_CORE_RUNTIME_ENVIRONMENT.members[ - "filesystemConfigurations" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_HARNESS_AGENT_CORE_RUNTIME_ENVIRONMENT, consumer=_consumer - ) - if "agent_runtime_arn" not in kwargs: - kwargs["agent_runtime_arn"] = "" - if "agent_runtime_name" not in kwargs: - kwargs["agent_runtime_name"] = "" - if "agent_runtime_id" not in kwargs: - kwargs["agent_runtime_id"] = "" - if "lifecycle_configuration" not in kwargs: - kwargs["lifecycle_configuration"] = LifecycleConfiguration._smithy_default() - if "network_configuration" not in kwargs: - kwargs["network_configuration"] = NetworkConfiguration._smithy_default() - return kwargs - - -@dataclass -class HarnessEnvironmentProviderAgentCoreRuntimeEnvironment: - """The AgentCore Runtime environment configuration.""" - - value: HarnessAgentCoreRuntimeEnvironment - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_ENVIRONMENT_PROVIDER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_ENVIRONMENT_PROVIDER.members["agentCoreRuntimeEnvironment"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HarnessAgentCoreRuntimeEnvironment.deserialize(deserializer)) - - -@dataclass -class HarnessEnvironmentProviderUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -HarnessEnvironmentProvider = Union[ - HarnessEnvironmentProviderAgentCoreRuntimeEnvironment - | HarnessEnvironmentProviderUnknown -] -"""The environment provider for a harness.""" - - -class _HarnessEnvironmentProviderDeserializer: - _result: HarnessEnvironmentProvider | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> HarnessEnvironmentProvider: - self._result = None - deserializer.read_struct(_SCHEMA_HARNESS_ENVIRONMENT_PROVIDER, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - HarnessEnvironmentProviderAgentCoreRuntimeEnvironment.deserialize( - de - ) - ) - - case _: - self._set_result( - HarnessEnvironmentProviderUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: HarnessEnvironmentProvider) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class HarnessStatus(UnknownEnumMixin, StrEnum): - CREATING = "CREATING" - CREATE_FAILED = "CREATE_FAILED" - UPDATING = "UPDATING" - UPDATE_FAILED = "UPDATE_FAILED" - READY = "READY" - DELETING = "DELETING" - DELETE_FAILED = "DELETE_FAILED" - - -@dataclass(kw_only=True) -class Harness: - """Representation of a harness.""" - - harness_id: str - """The ID of the harness.""" - - harness_name: str - """The name of the harness.""" - - arn: str - """The ARN of the harness.""" - - status: str - """The status of the harness.""" - - execution_role_arn: str - """IAM role the harness assumes when running.""" - - created_at: datetime - """The createdAt time of the harness.""" - - updated_at: datetime - """The updatedAt time of the harness.""" - - model: HarnessModelConfiguration - """The configuration of the default model used by the Harness.""" - - system_prompt: list[HarnessSystemContentBlock] - """The system prompt of the harness.""" - - tools: list[HarnessTool] - """The tools of the harness.""" - - skills: list[HarnessSkill] - """The skills of the harness.""" - - allowed_tools: list[str] - """The allowed tools of the harness. All tools are allowed by default.""" - - truncation: HarnessTruncationConfiguration - """Configuration for truncating model context.""" - - environment: HarnessEnvironmentProvider - """The compute environment on which the Harness runs.""" - - harness_version: str | None = None - """ - The version of the harness. Incremented on every successful - UpdateHarness. - """ - - environment_artifact: HarnessEnvironmentArtifact | None = None - """ - The environment artifact (e.g., container) in which the Harness - operates. - """ - - environment_variables: dict[str, str] | None = field(repr=False, default=None) - """ - Environment variables exposed in the environment in which the harness - operates. - """ - - authorizer_configuration: AuthorizerConfiguration | None = None - """ - Represents inbound authorization configuration options used to - authenticate incoming requests. - """ - - memory: HarnessMemoryConfiguration | None = None - """AgentCore Memory instance configuration for short and long term memory.""" - - hooks: list[HarnessHook] | None = None - """The lifecycle hooks configured for the harness.""" - - max_iterations: int | None = None - """ - The maximum number of iterations in the agent loop allowed before - exiting per invocation. - """ - - max_tokens: int | None = None - """ - The maximum total number of output tokens the agent can generate across - all model calls within a single invocation. - """ - - timeout_seconds: int | None = None - """The maximum duration per invocation.""" - - failure_reason: str | None = None - """Reason why create or update operations fail.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_HARNESS.members["harnessId"], self.harness_id) - serializer.write_string( - _SCHEMA_HARNESS.members["harnessName"], self.harness_name - ) - serializer.write_string(_SCHEMA_HARNESS.members["arn"], self.arn) - serializer.write_string(_SCHEMA_HARNESS.members["status"], self.status) - if self.harness_version is not None: - serializer.write_string( - _SCHEMA_HARNESS.members["harnessVersion"], self.harness_version - ) - - serializer.write_string( - _SCHEMA_HARNESS.members["executionRoleArn"], self.execution_role_arn - ) - serializer.write_timestamp( - _SCHEMA_HARNESS.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_HARNESS.members["updatedAt"], self.updated_at - ) - serializer.write_struct(_SCHEMA_HARNESS.members["model"], self.model) - _serialize_harness_system_prompt( - serializer, _SCHEMA_HARNESS.members["systemPrompt"], self.system_prompt - ) - _serialize_harness_tools( - serializer, _SCHEMA_HARNESS.members["tools"], self.tools - ) - _serialize_harness_skills( - serializer, _SCHEMA_HARNESS.members["skills"], self.skills - ) - _serialize_harness_allowed_tools( - serializer, _SCHEMA_HARNESS.members["allowedTools"], self.allowed_tools - ) - serializer.write_struct(_SCHEMA_HARNESS.members["truncation"], self.truncation) - serializer.write_struct( - _SCHEMA_HARNESS.members["environment"], self.environment - ) - if self.environment_artifact is not None: - serializer.write_struct( - _SCHEMA_HARNESS.members["environmentArtifact"], - self.environment_artifact, - ) - - if self.environment_variables is not None: - _serialize_environment_variables_map( - serializer, - _SCHEMA_HARNESS.members["environmentVariables"], - self.environment_variables, - ) - - if self.authorizer_configuration is not None: - serializer.write_struct( - _SCHEMA_HARNESS.members["authorizerConfiguration"], - self.authorizer_configuration, - ) - - if self.memory is not None: - serializer.write_struct(_SCHEMA_HARNESS.members["memory"], self.memory) - - if self.hooks is not None: - _serialize_harness_hooks( - serializer, _SCHEMA_HARNESS.members["hooks"], self.hooks - ) - - if self.max_iterations is not None: - serializer.write_integer( - _SCHEMA_HARNESS.members["maxIterations"], self.max_iterations - ) - - if self.max_tokens is not None: - serializer.write_integer( - _SCHEMA_HARNESS.members["maxTokens"], self.max_tokens - ) - - if self.timeout_seconds is not None: - serializer.write_integer( - _SCHEMA_HARNESS.members["timeoutSeconds"], self.timeout_seconds - ) - - if self.failure_reason is not None: - serializer.write_string( - _SCHEMA_HARNESS.members["failureReason"], self.failure_reason - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["harness_id"] = de.read_string( - _SCHEMA_HARNESS.members["harnessId"] - ) - - case 1: - kwargs["harness_name"] = de.read_string( - _SCHEMA_HARNESS.members["harnessName"] - ) - - case 2: - kwargs["arn"] = de.read_string(_SCHEMA_HARNESS.members["arn"]) - - case 3: - kwargs["status"] = HarnessStatus( - de.read_string(_SCHEMA_HARNESS.members["status"]) - ) - - case 4: - kwargs["harness_version"] = de.read_string( - _SCHEMA_HARNESS.members["harnessVersion"] - ) - - case 5: - kwargs["execution_role_arn"] = de.read_string( - _SCHEMA_HARNESS.members["executionRoleArn"] - ) - - case 6: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_HARNESS.members["createdAt"] - ) - - case 7: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_HARNESS.members["updatedAt"] - ) - - case 8: - kwargs["model"] = ( - _HarnessModelConfigurationDeserializer().deserialize(de) - ) - - case 9: - kwargs["system_prompt"] = _deserialize_harness_system_prompt( - de, _SCHEMA_HARNESS.members["systemPrompt"] - ) - - case 10: - kwargs["tools"] = _deserialize_harness_tools( - de, _SCHEMA_HARNESS.members["tools"] - ) - - case 11: - kwargs["skills"] = _deserialize_harness_skills( - de, _SCHEMA_HARNESS.members["skills"] - ) - - case 12: - kwargs["allowed_tools"] = _deserialize_harness_allowed_tools( - de, _SCHEMA_HARNESS.members["allowedTools"] - ) - - case 13: - kwargs["truncation"] = HarnessTruncationConfiguration.deserialize( - de - ) - - case 14: - kwargs["environment"] = ( - _HarnessEnvironmentProviderDeserializer().deserialize(de) - ) - - case 15: - kwargs["environment_artifact"] = ( - _HarnessEnvironmentArtifactDeserializer().deserialize(de) - ) - - case 16: - kwargs["environment_variables"] = ( - _deserialize_environment_variables_map( - de, _SCHEMA_HARNESS.members["environmentVariables"] - ) - ) - - case 17: - kwargs["authorizer_configuration"] = ( - _AuthorizerConfigurationDeserializer().deserialize(de) - ) - - case 18: - kwargs["memory"] = ( - _HarnessMemoryConfigurationDeserializer().deserialize(de) - ) - - case 19: - kwargs["hooks"] = _deserialize_harness_hooks( - de, _SCHEMA_HARNESS.members["hooks"] - ) - - case 20: - kwargs["max_iterations"] = de.read_integer( - _SCHEMA_HARNESS.members["maxIterations"] - ) - - case 21: - kwargs["max_tokens"] = de.read_integer( - _SCHEMA_HARNESS.members["maxTokens"] - ) - - case 22: - kwargs["timeout_seconds"] = de.read_integer( - _SCHEMA_HARNESS.members["timeoutSeconds"] - ) - - case 23: - kwargs["failure_reason"] = de.read_string( - _SCHEMA_HARNESS.members["failureReason"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_HARNESS, consumer=_consumer) - if "harness_id" not in kwargs: - kwargs["harness_id"] = "" - if "harness_name" not in kwargs: - kwargs["harness_name"] = "" - if "arn" not in kwargs: - kwargs["arn"] = "" - if "status" not in kwargs: - kwargs["status"] = HarnessStatus._corrected("") - if "execution_role_arn" not in kwargs: - kwargs["execution_role_arn"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "model" not in kwargs: - kwargs["model"] = HarnessModelConfigurationUnknown(tag="") - if "system_prompt" not in kwargs: - kwargs["system_prompt"] = [] - if "tools" not in kwargs: - kwargs["tools"] = [] - if "skills" not in kwargs: - kwargs["skills"] = [] - if "allowed_tools" not in kwargs: - kwargs["allowed_tools"] = [] - if "truncation" not in kwargs: - kwargs["truncation"] = HarnessTruncationConfiguration._smithy_default() - if "environment" not in kwargs: - kwargs["environment"] = HarnessEnvironmentProviderUnknown(tag="") - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls( - harness_id="", - harness_name="", - arn="", - status=HarnessStatus._corrected(""), - execution_role_arn="", - created_at=datetime.fromtimestamp(0, tz=timezone.utc), - updated_at=datetime.fromtimestamp(0, tz=timezone.utc), - model=HarnessModelConfigurationUnknown(tag=""), - system_prompt=[], - tools=[], - skills=[], - allowed_tools=[], - truncation=HarnessTruncationConfiguration._smithy_default(), - environment=HarnessEnvironmentProviderUnknown(tag=""), - ) - - -@dataclass(kw_only=True) -class CreateHarnessOutput: - """Dataclass for CreateHarnessOutput structure.""" - - harness: Harness - """The harness that was created.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_HARNESS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CREATE_HARNESS_OUTPUT.members["harness"], self.harness - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["harness"] = Harness.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_HARNESS_OUTPUT, consumer=_consumer) - if "harness" not in kwargs: - kwargs["harness"] = Harness._smithy_default() - return kwargs - - -CREATE_HARNESS = APIOperation( - input=CreateHarnessInput, - output=CreateHarnessOutput, - schema=_SCHEMA_CREATE_HARNESS, - input_schema=_SCHEMA_CREATE_HARNESS_INPUT, - output_schema=_SCHEMA_CREATE_HARNESS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteHarnessInput: - """Dataclass for DeleteHarnessInput structure.""" - - harness_id: str | None = None - """The ID of the harness to delete.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure idempotency of the - request. - """ - - delete_managed_memory: bool | None = None - """ - Whether to delete the managed memory on harness deletion. Default: true. - If false, the memory is disassociated and becomes a regular - customer-owned resource. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_HARNESS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.harness_id is not None: - serializer.write_string( - _SCHEMA_DELETE_HARNESS_INPUT.members["harnessId"], self.harness_id - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_DELETE_HARNESS_INPUT.members["clientToken"], self.client_token - ) - - if self.delete_managed_memory is not None: - serializer.write_boolean( - _SCHEMA_DELETE_HARNESS_INPUT.members["deleteManagedMemory"], - self.delete_managed_memory, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["harness_id"] = de.read_string( - _SCHEMA_DELETE_HARNESS_INPUT.members["harnessId"] - ) - - case 1: - kwargs["client_token"] = de.read_string( - _SCHEMA_DELETE_HARNESS_INPUT.members["clientToken"] - ) - - case 2: - kwargs["delete_managed_memory"] = de.read_boolean( - _SCHEMA_DELETE_HARNESS_INPUT.members["deleteManagedMemory"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_HARNESS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteHarnessOutput: - """Dataclass for DeleteHarnessOutput structure.""" - - harness: Harness | None = None - """The harness that was deleted.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_HARNESS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.harness is not None: - serializer.write_struct( - _SCHEMA_DELETE_HARNESS_OUTPUT.members["harness"], self.harness - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["harness"] = Harness.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_HARNESS_OUTPUT, consumer=_consumer) - return kwargs - - -DELETE_HARNESS = APIOperation( - input=DeleteHarnessInput, - output=DeleteHarnessOutput, - schema=_SCHEMA_DELETE_HARNESS, - input_schema=_SCHEMA_DELETE_HARNESS_INPUT, - output_schema=_SCHEMA_DELETE_HARNESS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetHarnessInput: - """Dataclass for GetHarnessInput structure.""" - - harness_id: str | None = None - """The ID of the harness to retrieve.""" - - harness_version: str | None = None - """ - Specific version of the harness to retrieve. If omitted, returns the - current Harness configuration, including its status. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_HARNESS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.harness_id is not None: - serializer.write_string( - _SCHEMA_GET_HARNESS_INPUT.members["harnessId"], self.harness_id - ) - - if self.harness_version is not None: - serializer.write_string( - _SCHEMA_GET_HARNESS_INPUT.members["harnessVersion"], - self.harness_version, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["harness_id"] = de.read_string( - _SCHEMA_GET_HARNESS_INPUT.members["harnessId"] - ) - - case 1: - kwargs["harness_version"] = de.read_string( - _SCHEMA_GET_HARNESS_INPUT.members["harnessVersion"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_HARNESS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetHarnessOutput: - """Dataclass for GetHarnessOutput structure.""" - - harness: Harness - """The harness resource.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_HARNESS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_HARNESS_OUTPUT.members["harness"], self.harness - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["harness"] = Harness.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_HARNESS_OUTPUT, consumer=_consumer) - if "harness" not in kwargs: - kwargs["harness"] = Harness._smithy_default() - return kwargs - - -GET_HARNESS = APIOperation( - input=GetHarnessInput, - output=GetHarnessOutput, - schema=_SCHEMA_GET_HARNESS, - input_schema=_SCHEMA_GET_HARNESS_INPUT, - output_schema=_SCHEMA_GET_HARNESS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListHarnessesInput: - """Dataclass for ListHarnessesInput structure.""" - - max_results: int | None = None - """The maximum number of results to return in a single call.""" - - next_token: str | None = None - """The token for the next set of results.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_HARNESSES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_HARNESSES_INPUT.members["maxResults"], self.max_results - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_HARNESSES_INPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_HARNESSES_INPUT.members["maxResults"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_HARNESSES_INPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_HARNESSES_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class HarnessSummary: - """Summary information about a harness.""" - - harness_id: str - """The ID of the harness.""" - - harness_name: str - """The name of the harness.""" - - arn: str - """The ARN of the harness.""" - - status: str - """The current status of the harness.""" - - created_at: datetime - """The timestamp when the harness was created.""" - - updated_at: datetime - """The timestamp when the harness was last updated.""" - - harness_version: str | None = None - """The latest version of the harness.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_SUMMARY.members["harnessId"], self.harness_id - ) - serializer.write_string( - _SCHEMA_HARNESS_SUMMARY.members["harnessName"], self.harness_name - ) - serializer.write_string(_SCHEMA_HARNESS_SUMMARY.members["arn"], self.arn) - serializer.write_string(_SCHEMA_HARNESS_SUMMARY.members["status"], self.status) - serializer.write_timestamp( - _SCHEMA_HARNESS_SUMMARY.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_HARNESS_SUMMARY.members["updatedAt"], self.updated_at - ) - if self.harness_version is not None: - serializer.write_string( - _SCHEMA_HARNESS_SUMMARY.members["harnessVersion"], self.harness_version - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["harness_id"] = de.read_string( - _SCHEMA_HARNESS_SUMMARY.members["harnessId"] - ) - - case 1: - kwargs["harness_name"] = de.read_string( - _SCHEMA_HARNESS_SUMMARY.members["harnessName"] - ) - - case 2: - kwargs["arn"] = de.read_string( - _SCHEMA_HARNESS_SUMMARY.members["arn"] - ) - - case 3: - kwargs["status"] = HarnessStatus( - de.read_string(_SCHEMA_HARNESS_SUMMARY.members["status"]) - ) - - case 4: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_HARNESS_SUMMARY.members["createdAt"] - ) - - case 5: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_HARNESS_SUMMARY.members["updatedAt"] - ) - - case 6: - kwargs["harness_version"] = de.read_string( - _SCHEMA_HARNESS_SUMMARY.members["harnessVersion"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_HARNESS_SUMMARY, consumer=_consumer) - if "harness_id" not in kwargs: - kwargs["harness_id"] = "" - if "harness_name" not in kwargs: - kwargs["harness_name"] = "" - if "arn" not in kwargs: - kwargs["arn"] = "" - if "status" not in kwargs: - kwargs["status"] = HarnessStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_harness_summaries( - serializer: ShapeSerializer, schema: Schema, value: list[HarnessSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_harness_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[HarnessSummary]: - result: list[HarnessSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(HarnessSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListHarnessesOutput: - """Dataclass for ListHarnessesOutput structure.""" - - harnesses: list[HarnessSummary] - """The list of harness summaries.""" - - next_token: str | None = None - """The token for the next set of results.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_HARNESSES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_harness_summaries( - serializer, - _SCHEMA_LIST_HARNESSES_OUTPUT.members["harnesses"], - self.harnesses, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_HARNESSES_OUTPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["harnesses"] = _deserialize_harness_summaries( - de, _SCHEMA_LIST_HARNESSES_OUTPUT.members["harnesses"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_HARNESSES_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_HARNESSES_OUTPUT, consumer=_consumer) - if "harnesses" not in kwargs: - kwargs["harnesses"] = [] - return kwargs - - -LIST_HARNESSES = APIOperation( - input=ListHarnessesInput, - output=ListHarnessesOutput, - schema=_SCHEMA_LIST_HARNESSES, - input_schema=_SCHEMA_LIST_HARNESSES_INPUT, - output_schema=_SCHEMA_LIST_HARNESSES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListHarnessVersionsInput: - """Dataclass for ListHarnessVersionsInput structure.""" - - harness_id: str | None = None - """The ID of the harness whose versions are listed.""" - - max_results: int | None = None - """The maximum number of results to return in a single call.""" - - next_token: str | None = None - """The token for the next set of results.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_HARNESS_VERSIONS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.harness_id is not None: - serializer.write_string( - _SCHEMA_LIST_HARNESS_VERSIONS_INPUT.members["harnessId"], - self.harness_id, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_HARNESS_VERSIONS_INPUT.members["maxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_HARNESS_VERSIONS_INPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["harness_id"] = de.read_string( - _SCHEMA_LIST_HARNESS_VERSIONS_INPUT.members["harnessId"] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_HARNESS_VERSIONS_INPUT.members["maxResults"] - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_HARNESS_VERSIONS_INPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_HARNESS_VERSIONS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class HarnessVersionSummary: - """Summary information about a single version of a harness.""" - - harness_id: str - """The ID of the harness.""" - - harness_name: str - """The name of the harness.""" - - arn: str - """The ARN of the harness.""" - - harness_version: str - """The version of the harness that this summary describes.""" - - status: str - """The status of this harness version.""" - - created_at: datetime - """The timestamp when this harness version was created.""" - - updated_at: datetime - """The timestamp when this harness version was last updated.""" - - failure_reason: str | None = None - """ - Reason why the create or update operation for this harness version - failed. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_VERSION_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_VERSION_SUMMARY.members["harnessId"], self.harness_id - ) - serializer.write_string( - _SCHEMA_HARNESS_VERSION_SUMMARY.members["harnessName"], self.harness_name - ) - serializer.write_string( - _SCHEMA_HARNESS_VERSION_SUMMARY.members["arn"], self.arn - ) - serializer.write_string( - _SCHEMA_HARNESS_VERSION_SUMMARY.members["harnessVersion"], - self.harness_version, - ) - serializer.write_string( - _SCHEMA_HARNESS_VERSION_SUMMARY.members["status"], self.status - ) - serializer.write_timestamp( - _SCHEMA_HARNESS_VERSION_SUMMARY.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_HARNESS_VERSION_SUMMARY.members["updatedAt"], self.updated_at - ) - if self.failure_reason is not None: - serializer.write_string( - _SCHEMA_HARNESS_VERSION_SUMMARY.members["failureReason"], - self.failure_reason, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["harness_id"] = de.read_string( - _SCHEMA_HARNESS_VERSION_SUMMARY.members["harnessId"] - ) - - case 1: - kwargs["harness_name"] = de.read_string( - _SCHEMA_HARNESS_VERSION_SUMMARY.members["harnessName"] - ) - - case 2: - kwargs["arn"] = de.read_string( - _SCHEMA_HARNESS_VERSION_SUMMARY.members["arn"] - ) - - case 3: - kwargs["harness_version"] = de.read_string( - _SCHEMA_HARNESS_VERSION_SUMMARY.members["harnessVersion"] - ) - - case 4: - kwargs["status"] = HarnessStatus( - de.read_string( - _SCHEMA_HARNESS_VERSION_SUMMARY.members["status"] - ) - ) - - case 5: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_HARNESS_VERSION_SUMMARY.members["createdAt"] - ) - - case 6: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_HARNESS_VERSION_SUMMARY.members["updatedAt"] - ) - - case 7: - kwargs["failure_reason"] = de.read_string( - _SCHEMA_HARNESS_VERSION_SUMMARY.members["failureReason"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_HARNESS_VERSION_SUMMARY, consumer=_consumer) - if "harness_id" not in kwargs: - kwargs["harness_id"] = "" - if "harness_name" not in kwargs: - kwargs["harness_name"] = "" - if "arn" not in kwargs: - kwargs["arn"] = "" - if "harness_version" not in kwargs: - kwargs["harness_version"] = "" - if "status" not in kwargs: - kwargs["status"] = HarnessStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_harness_version_summaries( - serializer: ShapeSerializer, schema: Schema, value: list[HarnessVersionSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_harness_version_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[HarnessVersionSummary]: - result: list[HarnessVersionSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(HarnessVersionSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListHarnessVersionsOutput: - """Dataclass for ListHarnessVersionsOutput structure.""" - - harness_versions: list[HarnessVersionSummary] - """The list of harness version summaries.""" - - next_token: str | None = None - """The token for the next set of results.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_HARNESS_VERSIONS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_harness_version_summaries( - serializer, - _SCHEMA_LIST_HARNESS_VERSIONS_OUTPUT.members["harnessVersions"], - self.harness_versions, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_HARNESS_VERSIONS_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["harness_versions"] = _deserialize_harness_version_summaries( - de, - _SCHEMA_LIST_HARNESS_VERSIONS_OUTPUT.members["harnessVersions"], - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_HARNESS_VERSIONS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_HARNESS_VERSIONS_OUTPUT, consumer=_consumer - ) - if "harness_versions" not in kwargs: - kwargs["harness_versions"] = [] - return kwargs - - -LIST_HARNESS_VERSIONS = APIOperation( - input=ListHarnessVersionsInput, - output=ListHarnessVersionsOutput, - schema=_SCHEMA_LIST_HARNESS_VERSIONS, - input_schema=_SCHEMA_LIST_HARNESS_VERSIONS_INPUT, - output_schema=_SCHEMA_LIST_HARNESS_VERSIONS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdatedAuthorizerConfiguration: - """ - Wrapper for updating an optional AuthorizerConfiguration field with - PATCH semantics. When present in an update request, the authorizer - configuration is replaced with optionalValue. When absent, the - authorizer configuration is left unchanged. To unset, include the - wrapper with optionalValue not specified. - """ - - optional_value: AuthorizerConfiguration | None = None - """ - The updated authorizer configuration value. If not specified, it will - clear the current authorizer configuration of the resource. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATED_AUTHORIZER_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.optional_value is not None: - serializer.write_struct( - _SCHEMA_UPDATED_AUTHORIZER_CONFIGURATION.members["optionalValue"], - self.optional_value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["optional_value"] = ( - _AuthorizerConfigurationDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATED_AUTHORIZER_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdatedHarnessEnvironmentArtifact: - """Wrapper for updating the environment artifact configuration.""" - - optional_value: HarnessEnvironmentArtifact | None = None - """ - The updated environment artifact value, or null to clear the existing - configuration. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATED_HARNESS_ENVIRONMENT_ARTIFACT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.optional_value is not None: - serializer.write_struct( - _SCHEMA_UPDATED_HARNESS_ENVIRONMENT_ARTIFACT.members["optionalValue"], - self.optional_value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["optional_value"] = ( - _HarnessEnvironmentArtifactDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATED_HARNESS_ENVIRONMENT_ARTIFACT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdatedHarnessMemoryConfiguration: - """Wrapper for updating the memory configuration.""" - - optional_value: HarnessMemoryConfiguration | None = None - """ - The updated memory configuration value, or null to clear the existing - configuration. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATED_HARNESS_MEMORY_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.optional_value is not None: - serializer.write_struct( - _SCHEMA_UPDATED_HARNESS_MEMORY_CONFIGURATION.members["optionalValue"], - self.optional_value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["optional_value"] = ( - _HarnessMemoryConfigurationDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATED_HARNESS_MEMORY_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateHarnessInput: - """Dataclass for UpdateHarnessInput structure.""" - - harness_id: str | None = None - """The ID of the harness to update.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure idempotency of the - request. - """ - - execution_role_arn: str | None = None - """ - The ARN of the IAM role that the harness assumes when running. If not - specified, the existing value is retained. - """ - - environment: HarnessEnvironmentProviderRequest | None = None - """ - The compute environment configuration for the harness. If not specified, - the existing value is retained. - """ - - environment_artifact: UpdatedHarnessEnvironmentArtifact | None = None - """ - The environment artifact for the harness. Use the optionalValue wrapper - to set a new value, or set it to null to clear the existing - configuration. - """ - - environment_variables: dict[str, str] | None = field(repr=False, default=None) - """ - Environment variables to set in the harness runtime environment. If - specified, this replaces all existing environment variables. If not - specified, the existing value is retained. - """ - - authorizer_configuration: UpdatedAuthorizerConfiguration | None = None - """ - Wrapper for updating an optional AuthorizerConfiguration field with - PATCH semantics. When present in an update request, the authorizer - configuration is replaced with optionalValue. When absent, the - authorizer configuration is left unchanged. To unset, include the - wrapper with optionalValue not specified. - """ - - model: HarnessModelConfiguration | None = None - """ - The model configuration for the harness. If not specified, the existing - value is retained. - """ - - system_prompt: list[HarnessSystemContentBlock] | None = None - """ - The system prompt that defines the agent's behavior. If not specified, - the existing value is retained. - """ - - tools: list[HarnessTool] | None = None - """ - The tools available to the agent. If specified, this replaces all - existing tools. If not specified, the existing value is retained. - """ - - skills: list[HarnessSkill] | None = None - """ - The skills available to the agent. If specified, this replaces all - existing skills. If not specified, the existing value is retained. - """ - - allowed_tools: list[str] | None = None - """ - The tools that the agent is allowed to use. If specified, this replaces - all existing allowed tools. If not specified, the existing value is - retained. - """ - - memory: UpdatedHarnessMemoryConfiguration | None = None - """ - The AgentCore Memory configuration. Use the optionalValue wrapper to set - a new value, or set it to null to clear the existing configuration. - """ - - truncation: HarnessTruncationConfiguration | None = None - """ - The truncation configuration for managing conversation context. If not - specified, the existing value is retained. - """ - - hooks: list[HarnessHook] | None = None - """ - The lifecycle hooks to run at defined points in the agent loop. If - specified, this replaces all existing hooks. If not specified, the - existing hooks are retained. - """ - - max_iterations: int | None = None - """ - The maximum number of iterations the agent loop can execute per - invocation. If not specified, the existing value is retained. - """ - - max_tokens: int | None = None - """ - The maximum total number of output tokens the agent can generate across - all model calls within a single invocation. If not specified, the - existing value is retained. - """ - - timeout_seconds: int | None = None - """ - The maximum duration in seconds for the agent loop execution per - invocation. If not specified, the existing value is retained. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_HARNESS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.harness_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_HARNESS_INPUT.members["harnessId"], self.harness_id - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_UPDATE_HARNESS_INPUT.members["clientToken"], self.client_token - ) - - if self.execution_role_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_HARNESS_INPUT.members["executionRoleArn"], - self.execution_role_arn, - ) - - if self.environment is not None: - serializer.write_struct( - _SCHEMA_UPDATE_HARNESS_INPUT.members["environment"], self.environment - ) - - if self.environment_artifact is not None: - serializer.write_struct( - _SCHEMA_UPDATE_HARNESS_INPUT.members["environmentArtifact"], - self.environment_artifact, - ) - - if self.environment_variables is not None: - _serialize_environment_variables_map( - serializer, - _SCHEMA_UPDATE_HARNESS_INPUT.members["environmentVariables"], - self.environment_variables, - ) - - if self.authorizer_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_HARNESS_INPUT.members["authorizerConfiguration"], - self.authorizer_configuration, - ) - - if self.model is not None: - serializer.write_struct( - _SCHEMA_UPDATE_HARNESS_INPUT.members["model"], self.model - ) - - if self.system_prompt is not None: - _serialize_harness_system_prompt( - serializer, - _SCHEMA_UPDATE_HARNESS_INPUT.members["systemPrompt"], - self.system_prompt, - ) - - if self.tools is not None: - _serialize_harness_tools( - serializer, _SCHEMA_UPDATE_HARNESS_INPUT.members["tools"], self.tools - ) - - if self.skills is not None: - _serialize_harness_skills( - serializer, _SCHEMA_UPDATE_HARNESS_INPUT.members["skills"], self.skills - ) - - if self.allowed_tools is not None: - _serialize_harness_allowed_tools( - serializer, - _SCHEMA_UPDATE_HARNESS_INPUT.members["allowedTools"], - self.allowed_tools, - ) - - if self.memory is not None: - serializer.write_struct( - _SCHEMA_UPDATE_HARNESS_INPUT.members["memory"], self.memory - ) - - if self.truncation is not None: - serializer.write_struct( - _SCHEMA_UPDATE_HARNESS_INPUT.members["truncation"], self.truncation - ) - - if self.hooks is not None: - _serialize_harness_hooks( - serializer, _SCHEMA_UPDATE_HARNESS_INPUT.members["hooks"], self.hooks - ) - - if self.max_iterations is not None: - serializer.write_integer( - _SCHEMA_UPDATE_HARNESS_INPUT.members["maxIterations"], - self.max_iterations, - ) - - if self.max_tokens is not None: - serializer.write_integer( - _SCHEMA_UPDATE_HARNESS_INPUT.members["maxTokens"], self.max_tokens - ) - - if self.timeout_seconds is not None: - serializer.write_integer( - _SCHEMA_UPDATE_HARNESS_INPUT.members["timeoutSeconds"], - self.timeout_seconds, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["harness_id"] = de.read_string( - _SCHEMA_UPDATE_HARNESS_INPUT.members["harnessId"] - ) - - case 1: - kwargs["client_token"] = de.read_string( - _SCHEMA_UPDATE_HARNESS_INPUT.members["clientToken"] - ) - - case 2: - kwargs["execution_role_arn"] = de.read_string( - _SCHEMA_UPDATE_HARNESS_INPUT.members["executionRoleArn"] - ) - - case 3: - kwargs["environment"] = ( - _HarnessEnvironmentProviderRequestDeserializer().deserialize(de) - ) - - case 4: - kwargs["environment_artifact"] = ( - UpdatedHarnessEnvironmentArtifact.deserialize(de) - ) - - case 5: - kwargs["environment_variables"] = ( - _deserialize_environment_variables_map( - de, - _SCHEMA_UPDATE_HARNESS_INPUT.members[ - "environmentVariables" - ], - ) - ) - - case 6: - kwargs["authorizer_configuration"] = ( - UpdatedAuthorizerConfiguration.deserialize(de) - ) - - case 7: - kwargs["model"] = ( - _HarnessModelConfigurationDeserializer().deserialize(de) - ) - - case 8: - kwargs["system_prompt"] = _deserialize_harness_system_prompt( - de, _SCHEMA_UPDATE_HARNESS_INPUT.members["systemPrompt"] - ) - - case 9: - kwargs["tools"] = _deserialize_harness_tools( - de, _SCHEMA_UPDATE_HARNESS_INPUT.members["tools"] - ) - - case 10: - kwargs["skills"] = _deserialize_harness_skills( - de, _SCHEMA_UPDATE_HARNESS_INPUT.members["skills"] - ) - - case 11: - kwargs["allowed_tools"] = _deserialize_harness_allowed_tools( - de, _SCHEMA_UPDATE_HARNESS_INPUT.members["allowedTools"] - ) - - case 12: - kwargs["memory"] = UpdatedHarnessMemoryConfiguration.deserialize(de) - - case 13: - kwargs["truncation"] = HarnessTruncationConfiguration.deserialize( - de - ) - - case 14: - kwargs["hooks"] = _deserialize_harness_hooks( - de, _SCHEMA_UPDATE_HARNESS_INPUT.members["hooks"] - ) - - case 15: - kwargs["max_iterations"] = de.read_integer( - _SCHEMA_UPDATE_HARNESS_INPUT.members["maxIterations"] - ) - - case 16: - kwargs["max_tokens"] = de.read_integer( - _SCHEMA_UPDATE_HARNESS_INPUT.members["maxTokens"] - ) - - case 17: - kwargs["timeout_seconds"] = de.read_integer( - _SCHEMA_UPDATE_HARNESS_INPUT.members["timeoutSeconds"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_HARNESS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateHarnessOutput: - """Dataclass for UpdateHarnessOutput structure.""" - - harness: Harness - """The updated harness.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_HARNESS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_UPDATE_HARNESS_OUTPUT.members["harness"], self.harness - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["harness"] = Harness.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_HARNESS_OUTPUT, consumer=_consumer) - if "harness" not in kwargs: - kwargs["harness"] = Harness._smithy_default() - return kwargs - - -UPDATE_HARNESS = APIOperation( - input=UpdateHarnessInput, - output=UpdateHarnessOutput, - schema=_SCHEMA_UPDATE_HARNESS, - input_schema=_SCHEMA_UPDATE_HARNESS_INPUT, - output_schema=_SCHEMA_UPDATE_HARNESS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListTagsForResourceInput: - """Dataclass for ListTagsForResourceInput structure.""" - - resource_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the resource for which you want to - list tags. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT.members["resourceArn"], - self.resource_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT.members["resourceArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ListTagsForResourceOutput: - """Dataclass for ListTagsForResourceOutput structure.""" - - tags: dict[str, str] | None = None - """The tags associated with the resource.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.tags is not None: - _serialize_tags_map( - serializer, - _SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT.members["tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["tags"] = _deserialize_tags_map( - de, _SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_TAGS_FOR_RESOURCE = APIOperation( - input=ListTagsForResourceInput, - output=ListTagsForResourceOutput, - schema=_SCHEMA_LIST_TAGS_FOR_RESOURCE, - input_schema=_SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT, - output_schema=_SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class MetadataValueType(UnknownEnumMixin, StrEnum): - STRING = "STRING" - STRINGLIST = "STRINGLIST" - NUMBER = "NUMBER" - - -@dataclass(kw_only=True) -class IndexedKey: - """A metadata key indexed for filtering.""" - - key: str - """The metadata key name to index.""" - - type: str - """The data type of the indexed key.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INDEXED_KEY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_INDEXED_KEY.members["key"], self.key) - serializer.write_string(_SCHEMA_INDEXED_KEY.members["type"], self.type) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["key"] = de.read_string(_SCHEMA_INDEXED_KEY.members["key"]) - - case 1: - kwargs["type"] = MetadataValueType( - de.read_string(_SCHEMA_INDEXED_KEY.members["type"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INDEXED_KEY, consumer=_consumer) - if "key" not in kwargs: - kwargs["key"] = "" - if "type" not in kwargs: - kwargs["type"] = MetadataValueType._corrected("") - return kwargs - - -def _serialize_indexed_keys_list( - serializer: ShapeSerializer, schema: Schema, value: list[IndexedKey] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_indexed_keys_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[IndexedKey]: - result: list[IndexedKey] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(IndexedKey.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class EpisodicOverrideConsolidationConfigurationInput: - """ - Configurations for overriding the consolidation step of the episodic - memory strategy. - """ - - append_to_prompt: str = field(repr=False) - """ - The text to append to the prompt for the consolidation step of the - episodic memory strategy. - """ - - model_id: str - """ - The model ID to use for the consolidation step of the episodic memory - strategy. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_EPISODIC_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_EPISODIC_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT.members[ - "appendToPrompt" - ], - self.append_to_prompt, - ) - serializer.write_string( - _SCHEMA_EPISODIC_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT.members[ - "modelId" - ], - self.model_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["append_to_prompt"] = de.read_string( - _SCHEMA_EPISODIC_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT.members[ - "appendToPrompt" - ] - ) - - case 1: - kwargs["model_id"] = de.read_string( - _SCHEMA_EPISODIC_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT.members[ - "modelId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EPISODIC_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT, - consumer=_consumer, - ) - if "append_to_prompt" not in kwargs: - kwargs["append_to_prompt"] = "" - if "model_id" not in kwargs: - kwargs["model_id"] = "" - return kwargs - - -@dataclass(kw_only=True) -class EpisodicOverrideExtractionConfigurationInput: - """ - Configurations for overriding the extraction step of the episodic memory - strategy. - """ - - append_to_prompt: str = field(repr=False) - """ - The text to append to the prompt for the extraction step of the episodic - memory strategy. - """ - - model_id: str - """ - The model ID to use for the extraction step of the episodic memory - strategy. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_EPISODIC_OVERRIDE_EXTRACTION_CONFIGURATION_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_EPISODIC_OVERRIDE_EXTRACTION_CONFIGURATION_INPUT.members[ - "appendToPrompt" - ], - self.append_to_prompt, - ) - serializer.write_string( - _SCHEMA_EPISODIC_OVERRIDE_EXTRACTION_CONFIGURATION_INPUT.members["modelId"], - self.model_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["append_to_prompt"] = de.read_string( - _SCHEMA_EPISODIC_OVERRIDE_EXTRACTION_CONFIGURATION_INPUT.members[ - "appendToPrompt" - ] - ) - - case 1: - kwargs["model_id"] = de.read_string( - _SCHEMA_EPISODIC_OVERRIDE_EXTRACTION_CONFIGURATION_INPUT.members[ - "modelId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EPISODIC_OVERRIDE_EXTRACTION_CONFIGURATION_INPUT, consumer=_consumer - ) - if "append_to_prompt" not in kwargs: - kwargs["append_to_prompt"] = "" - if "model_id" not in kwargs: - kwargs["model_id"] = "" - return kwargs - - -@dataclass(kw_only=True) -class NumberValidation: - """Validation for NUMBER fields.""" - - min_value: float | None = None - """Minimum allowed value.""" - - max_value: float | None = None - """Maximum allowed value.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_NUMBER_VALIDATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.min_value is not None: - serializer.write_double( - _SCHEMA_NUMBER_VALIDATION.members["minValue"], self.min_value - ) - - if self.max_value is not None: - serializer.write_double( - _SCHEMA_NUMBER_VALIDATION.members["maxValue"], self.max_value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["min_value"] = de.read_double( - _SCHEMA_NUMBER_VALIDATION.members["minValue"] - ) - - case 1: - kwargs["max_value"] = de.read_double( - _SCHEMA_NUMBER_VALIDATION.members["maxValue"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_NUMBER_VALIDATION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class StringListValidation: - """Validation for STRINGLIST fields.""" - - allowed_values: list[str] | None = None - """Allowed values for items in this STRINGLIST field.""" - - max_items: int | None = None - """Maximum number of items in the string list.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STRING_LIST_VALIDATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.allowed_values is not None: - _serialize_allowed_string_list_values_list( - serializer, - _SCHEMA_STRING_LIST_VALIDATION.members["allowedValues"], - self.allowed_values, - ) - - if self.max_items is not None: - serializer.write_integer( - _SCHEMA_STRING_LIST_VALIDATION.members["maxItems"], self.max_items - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["allowed_values"] = ( - _deserialize_allowed_string_list_values_list( - de, _SCHEMA_STRING_LIST_VALIDATION.members["allowedValues"] - ) - ) - - case 1: - kwargs["max_items"] = de.read_integer( - _SCHEMA_STRING_LIST_VALIDATION.members["maxItems"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_STRING_LIST_VALIDATION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class StringValidation: - """Validation for STRING fields.""" - - allowed_values: list[str] - """Allowed values for this STRING field.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STRING_VALIDATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_allowed_string_values_list( - serializer, - _SCHEMA_STRING_VALIDATION.members["allowedValues"], - self.allowed_values, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["allowed_values"] = _deserialize_allowed_string_values_list( - de, _SCHEMA_STRING_VALIDATION.members["allowedValues"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_STRING_VALIDATION, consumer=_consumer) - if "allowed_values" not in kwargs: - kwargs["allowed_values"] = [] - return kwargs - - -@dataclass -class ValidationStringValidation: - """Validation for STRING fields.""" - - value: StringValidation - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VALIDATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_VALIDATION.members["stringValidation"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=StringValidation.deserialize(deserializer)) - - -@dataclass -class ValidationStringListValidation: - """Validation for STRINGLIST fields.""" - - value: StringListValidation - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VALIDATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_VALIDATION.members["stringListValidation"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=StringListValidation.deserialize(deserializer)) - - -@dataclass -class ValidationNumberValidation: - """Validation for NUMBER fields.""" - - value: NumberValidation - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VALIDATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_VALIDATION.members["numberValidation"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=NumberValidation.deserialize(deserializer)) - - -@dataclass -class ValidationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -Validation = Union[ - ValidationStringValidation - | ValidationStringListValidation - | ValidationNumberValidation - | ValidationUnknown -] -""" -Validation rules for extracted metadata values. Only one type can be -specified, matching the field's data type. -""" - - -class _ValidationDeserializer: - _result: Validation | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> Validation: - self._result = None - deserializer.read_struct(_SCHEMA_VALIDATION, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(ValidationStringValidation.deserialize(de)) - - case 1: - self._set_result(ValidationStringListValidation.deserialize(de)) - - case 2: - self._set_result(ValidationNumberValidation.deserialize(de)) - - case _: - self._set_result(ValidationUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: Validation) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class LlmExtractionConfig: - """Model-based metadata extraction configuration.""" - - definition: str = field(repr=False) - """Description of what this metadata field represents.""" - - llm_extraction_instruction: str | None = field(repr=False, default=None) - """ - Instructions for extraction. Supports built-in operators like - LATEST_VALUE or custom natural-language instructions. - """ - - validation: Validation | None = None - """Validation rules to constrain extracted values.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LLM_EXTRACTION_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.llm_extraction_instruction is not None: - serializer.write_string( - _SCHEMA_LLM_EXTRACTION_CONFIG.members["llmExtractionInstruction"], - self.llm_extraction_instruction, - ) - - serializer.write_string( - _SCHEMA_LLM_EXTRACTION_CONFIG.members["definition"], self.definition - ) - if self.validation is not None: - serializer.write_struct( - _SCHEMA_LLM_EXTRACTION_CONFIG.members["validation"], self.validation - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["llm_extraction_instruction"] = de.read_string( - _SCHEMA_LLM_EXTRACTION_CONFIG.members[ - "llmExtractionInstruction" - ] - ) - - case 1: - kwargs["definition"] = de.read_string( - _SCHEMA_LLM_EXTRACTION_CONFIG.members["definition"] - ) - - case 2: - kwargs["validation"] = _ValidationDeserializer().deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LLM_EXTRACTION_CONFIG, consumer=_consumer) - if "definition" not in kwargs: - kwargs["definition"] = "" - return kwargs - - -@dataclass -class ExtractionConfigLlmExtractionConfig: - """Model-based extraction using a definition and instructions.""" - - value: LlmExtractionConfig - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EXTRACTION_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_EXTRACTION_CONFIG.members["llmExtractionConfig"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=LlmExtractionConfig.deserialize(deserializer)) - - -@dataclass -class ExtractionConfigUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ExtractionConfig = Union[ExtractionConfigLlmExtractionConfig | ExtractionConfigUnknown] -"""Configuration for metadata extraction from conversational content.""" - - -class _ExtractionConfigDeserializer: - _result: ExtractionConfig | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> ExtractionConfig: - self._result = None - deserializer.read_struct(_SCHEMA_EXTRACTION_CONFIG, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(ExtractionConfigLlmExtractionConfig.deserialize(de)) - - case _: - self._set_result( - ExtractionConfigUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: ExtractionConfig) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class ExtractionType(UnknownEnumMixin, StrEnum): - """ - The extraction type for a metadata field, determining how the value is - obtained during memory processing. - """ - - LLM_INFERRED = "LLM_INFERRED" - STRICTLY_CONSISTENT = "STRICTLY_CONSISTENT" - - -@dataclass(kw_only=True) -class MetadataSchemaEntry: - """A metadata field definition within a strategy's schema.""" - - key: str - """ - The metadata field name. Must match an indexed key to be queryable via - metadata filters. - """ - - type: str | None = None - """The MetadataValueType.""" - - extraction_type: str | None = None - """ - Specifies whether the metadata value is extracted by the LLM or passed - through deterministically from the event. - """ - - extraction_config: ExtractionConfig | None = None - """ - Configuration for extracting this metadata value from conversational - content. Applicable only if extractionType is LLM inferred. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_METADATA_SCHEMA_ENTRY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_METADATA_SCHEMA_ENTRY.members["key"], self.key) - if self.type is not None: - serializer.write_string( - _SCHEMA_METADATA_SCHEMA_ENTRY.members["type"], self.type - ) - - if self.extraction_type is not None: - serializer.write_string( - _SCHEMA_METADATA_SCHEMA_ENTRY.members["extractionType"], - self.extraction_type, - ) - - if self.extraction_config is not None: - serializer.write_struct( - _SCHEMA_METADATA_SCHEMA_ENTRY.members["extractionConfig"], - self.extraction_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["key"] = de.read_string( - _SCHEMA_METADATA_SCHEMA_ENTRY.members["key"] - ) - - case 1: - kwargs["type"] = MetadataValueType( - de.read_string(_SCHEMA_METADATA_SCHEMA_ENTRY.members["type"]) - ) - - case 2: - kwargs["extraction_type"] = ExtractionType( - de.read_string( - _SCHEMA_METADATA_SCHEMA_ENTRY.members["extractionType"] - ) - ) - - case 3: - kwargs["extraction_config"] = ( - _ExtractionConfigDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_METADATA_SCHEMA_ENTRY, consumer=_consumer) - if "key" not in kwargs: - kwargs["key"] = "" - return kwargs - - -def _serialize_metadata_schema_list( - serializer: ShapeSerializer, schema: Schema, value: list[MetadataSchemaEntry] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_metadata_schema_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[MetadataSchemaEntry]: - result: list[MetadataSchemaEntry] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(MetadataSchemaEntry.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class MemoryRecordSchema: - """Schema for metadata on memory records generated by a strategy.""" - - metadata_schema: list[MetadataSchemaEntry] | None = None - """The metadata field definitions for this strategy.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEMORY_RECORD_SCHEMA, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.metadata_schema is not None: - _serialize_metadata_schema_list( - serializer, - _SCHEMA_MEMORY_RECORD_SCHEMA.members["metadataSchema"], - self.metadata_schema, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["metadata_schema"] = _deserialize_metadata_schema_list( - de, _SCHEMA_MEMORY_RECORD_SCHEMA.members["metadataSchema"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MEMORY_RECORD_SCHEMA, consumer=_consumer) - return kwargs - - -def _serialize_namespaces_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_namespaces_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class EpisodicOverrideReflectionConfigurationInput: - """ - Configurations for overriding the reflection step of the episodic memory - strategy. - """ - - append_to_prompt: str = field(repr=False) - """ - The text to append to the prompt for reflection step of the episodic - memory strategy. - """ - - model_id: str - """ - The model ID to use for the reflection step of the episodic memory - strategy. - """ - - namespaces: list[str] | None = None - """ - This is a legacy parameter, use `namespaceTemplates`. The namespaces to - use for episodic reflection. Can be less nested than the episodic - namespaces. - """ - - namespace_templates: list[str] | None = None - """ - The namespaceTemplates to use for episodic reflection. Can be less - nested than the episodic namespaces. - """ - - memory_record_schema: MemoryRecordSchema | None = None - """ - Schema for metadata fields on records generated by this reflection - override. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_EPISODIC_OVERRIDE_REFLECTION_CONFIGURATION_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_EPISODIC_OVERRIDE_REFLECTION_CONFIGURATION_INPUT.members[ - "appendToPrompt" - ], - self.append_to_prompt, - ) - serializer.write_string( - _SCHEMA_EPISODIC_OVERRIDE_REFLECTION_CONFIGURATION_INPUT.members["modelId"], - self.model_id, - ) - if self.namespaces is not None: - _serialize_namespaces_list( - serializer, - _SCHEMA_EPISODIC_OVERRIDE_REFLECTION_CONFIGURATION_INPUT.members[ - "namespaces" - ], - self.namespaces, - ) - - if self.namespace_templates is not None: - _serialize_namespaces_list( - serializer, - _SCHEMA_EPISODIC_OVERRIDE_REFLECTION_CONFIGURATION_INPUT.members[ - "namespaceTemplates" - ], - self.namespace_templates, - ) - - if self.memory_record_schema is not None: - serializer.write_struct( - _SCHEMA_EPISODIC_OVERRIDE_REFLECTION_CONFIGURATION_INPUT.members[ - "memoryRecordSchema" - ], - self.memory_record_schema, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["append_to_prompt"] = de.read_string( - _SCHEMA_EPISODIC_OVERRIDE_REFLECTION_CONFIGURATION_INPUT.members[ - "appendToPrompt" - ] - ) - - case 1: - kwargs["model_id"] = de.read_string( - _SCHEMA_EPISODIC_OVERRIDE_REFLECTION_CONFIGURATION_INPUT.members[ - "modelId" - ] - ) - - case 2: - kwargs["namespaces"] = _deserialize_namespaces_list( - de, - _SCHEMA_EPISODIC_OVERRIDE_REFLECTION_CONFIGURATION_INPUT.members[ - "namespaces" - ], - ) - - case 3: - kwargs["namespace_templates"] = _deserialize_namespaces_list( - de, - _SCHEMA_EPISODIC_OVERRIDE_REFLECTION_CONFIGURATION_INPUT.members[ - "namespaceTemplates" - ], - ) - - case 4: - kwargs["memory_record_schema"] = MemoryRecordSchema.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EPISODIC_OVERRIDE_REFLECTION_CONFIGURATION_INPUT, consumer=_consumer - ) - if "append_to_prompt" not in kwargs: - kwargs["append_to_prompt"] = "" - if "model_id" not in kwargs: - kwargs["model_id"] = "" - return kwargs - - -@dataclass(kw_only=True) -class EpisodicOverrideConfigurationInput: - """Input for the configuration to override the episodic memory strategy.""" - - extraction: EpisodicOverrideExtractionConfigurationInput | None = None - """ - Contains configurations for overriding the extraction step of the - episodic memory strategy. - """ - - consolidation: EpisodicOverrideConsolidationConfigurationInput | None = None - """ - Contains configurations for overriding the consolidation step of the - episodic memory strategy. - """ - - reflection: EpisodicOverrideReflectionConfigurationInput | None = None - """ - Contains configurations for overriding the reflection step of the - episodic memory strategy. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EPISODIC_OVERRIDE_CONFIGURATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.extraction is not None: - serializer.write_struct( - _SCHEMA_EPISODIC_OVERRIDE_CONFIGURATION_INPUT.members["extraction"], - self.extraction, - ) - - if self.consolidation is not None: - serializer.write_struct( - _SCHEMA_EPISODIC_OVERRIDE_CONFIGURATION_INPUT.members["consolidation"], - self.consolidation, - ) - - if self.reflection is not None: - serializer.write_struct( - _SCHEMA_EPISODIC_OVERRIDE_CONFIGURATION_INPUT.members["reflection"], - self.reflection, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["extraction"] = ( - EpisodicOverrideExtractionConfigurationInput.deserialize(de) - ) - - case 1: - kwargs["consolidation"] = ( - EpisodicOverrideConsolidationConfigurationInput.deserialize(de) - ) - - case 2: - kwargs["reflection"] = ( - EpisodicOverrideReflectionConfigurationInput.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EPISODIC_OVERRIDE_CONFIGURATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InvocationConfigurationInput: - """ - The configuration to invoke a self-managed memory processing pipeline - with. - """ - - topic_arn: str - """The ARN of the SNS topic for job notifications.""" - - payload_delivery_bucket_name: str - """The S3 bucket name for event payload delivery.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOCATION_CONFIGURATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_INVOCATION_CONFIGURATION_INPUT.members["topicArn"], self.topic_arn - ) - serializer.write_string( - _SCHEMA_INVOCATION_CONFIGURATION_INPUT.members["payloadDeliveryBucketName"], - self.payload_delivery_bucket_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["topic_arn"] = de.read_string( - _SCHEMA_INVOCATION_CONFIGURATION_INPUT.members["topicArn"] - ) - - case 1: - kwargs["payload_delivery_bucket_name"] = de.read_string( - _SCHEMA_INVOCATION_CONFIGURATION_INPUT.members[ - "payloadDeliveryBucketName" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVOCATION_CONFIGURATION_INPUT, consumer=_consumer - ) - if "topic_arn" not in kwargs: - kwargs["topic_arn"] = "" - if "payload_delivery_bucket_name" not in kwargs: - kwargs["payload_delivery_bucket_name"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(topic_arn="", payload_delivery_bucket_name="") - - -@dataclass(kw_only=True) -class MessageBasedTriggerInput: - """The trigger configuration based on a message.""" - - message_count: int = 6 - """The number of messages that trigger memory processing.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MESSAGE_BASED_TRIGGER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer( - _SCHEMA_MESSAGE_BASED_TRIGGER_INPUT.members["messageCount"], - self.message_count, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message_count"] = de.read_integer( - _SCHEMA_MESSAGE_BASED_TRIGGER_INPUT.members["messageCount"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MESSAGE_BASED_TRIGGER_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class TimeBasedTriggerInput: - """Trigger configuration based on time.""" - - idle_session_timeout: int = 20 - """Idle session timeout (seconds) that triggers memory processing.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TIME_BASED_TRIGGER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer( - _SCHEMA_TIME_BASED_TRIGGER_INPUT.members["idleSessionTimeout"], - self.idle_session_timeout, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["idle_session_timeout"] = de.read_integer( - _SCHEMA_TIME_BASED_TRIGGER_INPUT.members["idleSessionTimeout"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TIME_BASED_TRIGGER_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class TokenBasedTriggerInput: - """Trigger configuration based on tokens.""" - - token_count: int = 5000 - """Number of tokens that trigger memory processing.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOKEN_BASED_TRIGGER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer( - _SCHEMA_TOKEN_BASED_TRIGGER_INPUT.members["tokenCount"], self.token_count - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["token_count"] = de.read_integer( - _SCHEMA_TOKEN_BASED_TRIGGER_INPUT.members["tokenCount"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TOKEN_BASED_TRIGGER_INPUT, consumer=_consumer) - return kwargs - - -@dataclass -class TriggerConditionInputMessageBasedTrigger: - """Message based trigger configuration.""" - - value: MessageBasedTriggerInput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRIGGER_CONDITION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_TRIGGER_CONDITION_INPUT.members["messageBasedTrigger"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=MessageBasedTriggerInput.deserialize(deserializer)) - - -@dataclass -class TriggerConditionInputTokenBasedTrigger: - """Token based trigger configuration.""" - - value: TokenBasedTriggerInput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRIGGER_CONDITION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_TRIGGER_CONDITION_INPUT.members["tokenBasedTrigger"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=TokenBasedTriggerInput.deserialize(deserializer)) - - -@dataclass -class TriggerConditionInputTimeBasedTrigger: - """Time based trigger configuration.""" - - value: TimeBasedTriggerInput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRIGGER_CONDITION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_TRIGGER_CONDITION_INPUT.members["timeBasedTrigger"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=TimeBasedTriggerInput.deserialize(deserializer)) - - -@dataclass -class TriggerConditionInputUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -TriggerConditionInput = Union[ - TriggerConditionInputMessageBasedTrigger - | TriggerConditionInputTokenBasedTrigger - | TriggerConditionInputTimeBasedTrigger - | TriggerConditionInputUnknown -] -"""Condition that triggers memory processing.""" - - -class _TriggerConditionInputDeserializer: - _result: TriggerConditionInput | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> TriggerConditionInput: - self._result = None - deserializer.read_struct(_SCHEMA_TRIGGER_CONDITION_INPUT, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - TriggerConditionInputMessageBasedTrigger.deserialize(de) - ) - - case 1: - self._set_result(TriggerConditionInputTokenBasedTrigger.deserialize(de)) - - case 2: - self._set_result(TriggerConditionInputTimeBasedTrigger.deserialize(de)) - - case _: - self._set_result( - TriggerConditionInputUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: TriggerConditionInput) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_trigger_condition_input_list( - serializer: ShapeSerializer, schema: Schema, value: list[TriggerConditionInput] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_trigger_condition_input_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[TriggerConditionInput]: - result: list[TriggerConditionInput] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_TriggerConditionInputDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class SelfManagedConfigurationInput: - """Input configuration for a self-managed memory strategy.""" - - invocation_configuration: InvocationConfigurationInput - """Configuration to invoke a self-managed memory processing pipeline with.""" - - trigger_conditions: list[TriggerConditionInput] | None = None - """A list of conditions that trigger memory processing.""" - - historical_context_window_size: int = 4 - """Number of historical messages to include in processing context.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SELF_MANAGED_CONFIGURATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.trigger_conditions is not None: - _serialize_trigger_condition_input_list( - serializer, - _SCHEMA_SELF_MANAGED_CONFIGURATION_INPUT.members["triggerConditions"], - self.trigger_conditions, - ) - - serializer.write_struct( - _SCHEMA_SELF_MANAGED_CONFIGURATION_INPUT.members["invocationConfiguration"], - self.invocation_configuration, - ) - serializer.write_integer( - _SCHEMA_SELF_MANAGED_CONFIGURATION_INPUT.members[ - "historicalContextWindowSize" - ], - self.historical_context_window_size, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["trigger_conditions"] = ( - _deserialize_trigger_condition_input_list( - de, - _SCHEMA_SELF_MANAGED_CONFIGURATION_INPUT.members[ - "triggerConditions" - ], - ) - ) - - case 1: - kwargs["invocation_configuration"] = ( - InvocationConfigurationInput.deserialize(de) - ) - - case 2: - kwargs["historical_context_window_size"] = de.read_integer( - _SCHEMA_SELF_MANAGED_CONFIGURATION_INPUT.members[ - "historicalContextWindowSize" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SELF_MANAGED_CONFIGURATION_INPUT, consumer=_consumer - ) - if "invocation_configuration" not in kwargs: - kwargs["invocation_configuration"] = ( - InvocationConfigurationInput._smithy_default() - ) - return kwargs - - -@dataclass(kw_only=True) -class SemanticOverrideConsolidationConfigurationInput: - """ - Input for semantic override consolidation configuration in a memory - strategy. - """ - - append_to_prompt: str = field(repr=False) - """The text to append to the prompt for semantic consolidation.""" - - model_id: str - """The model ID to use for semantic consolidation.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_SEMANTIC_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SEMANTIC_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT.members[ - "appendToPrompt" - ], - self.append_to_prompt, - ) - serializer.write_string( - _SCHEMA_SEMANTIC_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT.members[ - "modelId" - ], - self.model_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["append_to_prompt"] = de.read_string( - _SCHEMA_SEMANTIC_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT.members[ - "appendToPrompt" - ] - ) - - case 1: - kwargs["model_id"] = de.read_string( - _SCHEMA_SEMANTIC_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT.members[ - "modelId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SEMANTIC_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT, - consumer=_consumer, - ) - if "append_to_prompt" not in kwargs: - kwargs["append_to_prompt"] = "" - if "model_id" not in kwargs: - kwargs["model_id"] = "" - return kwargs - - -@dataclass(kw_only=True) -class SemanticOverrideExtractionConfigurationInput: - """ - Input for semantic override extraction configuration in a memory - strategy. - """ - - append_to_prompt: str = field(repr=False) - """The text to append to the prompt for semantic extraction.""" - - model_id: str - """The model ID to use for semantic extraction.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_SEMANTIC_OVERRIDE_EXTRACTION_CONFIGURATION_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SEMANTIC_OVERRIDE_EXTRACTION_CONFIGURATION_INPUT.members[ - "appendToPrompt" - ], - self.append_to_prompt, - ) - serializer.write_string( - _SCHEMA_SEMANTIC_OVERRIDE_EXTRACTION_CONFIGURATION_INPUT.members["modelId"], - self.model_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["append_to_prompt"] = de.read_string( - _SCHEMA_SEMANTIC_OVERRIDE_EXTRACTION_CONFIGURATION_INPUT.members[ - "appendToPrompt" - ] - ) - - case 1: - kwargs["model_id"] = de.read_string( - _SCHEMA_SEMANTIC_OVERRIDE_EXTRACTION_CONFIGURATION_INPUT.members[ - "modelId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SEMANTIC_OVERRIDE_EXTRACTION_CONFIGURATION_INPUT, consumer=_consumer - ) - if "append_to_prompt" not in kwargs: - kwargs["append_to_prompt"] = "" - if "model_id" not in kwargs: - kwargs["model_id"] = "" - return kwargs - - -@dataclass(kw_only=True) -class SemanticOverrideConfigurationInput: - """Input for semantic override configuration in a memory strategy.""" - - extraction: SemanticOverrideExtractionConfigurationInput | None = None - """The extraction configuration for a semantic override.""" - - consolidation: SemanticOverrideConsolidationConfigurationInput | None = None - """The consolidation configuration for a semantic override.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SEMANTIC_OVERRIDE_CONFIGURATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.extraction is not None: - serializer.write_struct( - _SCHEMA_SEMANTIC_OVERRIDE_CONFIGURATION_INPUT.members["extraction"], - self.extraction, - ) - - if self.consolidation is not None: - serializer.write_struct( - _SCHEMA_SEMANTIC_OVERRIDE_CONFIGURATION_INPUT.members["consolidation"], - self.consolidation, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["extraction"] = ( - SemanticOverrideExtractionConfigurationInput.deserialize(de) - ) - - case 1: - kwargs["consolidation"] = ( - SemanticOverrideConsolidationConfigurationInput.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SEMANTIC_OVERRIDE_CONFIGURATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class SummaryOverrideConsolidationConfigurationInput: - """ - Input for summary override consolidation configuration in a memory - strategy. - """ - - append_to_prompt: str = field(repr=False) - """The text to append to the prompt for summary consolidation.""" - - model_id: str - """The model ID to use for summary consolidation.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_SUMMARY_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SUMMARY_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT.members[ - "appendToPrompt" - ], - self.append_to_prompt, - ) - serializer.write_string( - _SCHEMA_SUMMARY_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT.members[ - "modelId" - ], - self.model_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["append_to_prompt"] = de.read_string( - _SCHEMA_SUMMARY_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT.members[ - "appendToPrompt" - ] - ) - - case 1: - kwargs["model_id"] = de.read_string( - _SCHEMA_SUMMARY_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT.members[ - "modelId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SUMMARY_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT, - consumer=_consumer, - ) - if "append_to_prompt" not in kwargs: - kwargs["append_to_prompt"] = "" - if "model_id" not in kwargs: - kwargs["model_id"] = "" - return kwargs - - -@dataclass(kw_only=True) -class SummaryOverrideConfigurationInput: - """Input for summary override configuration in a memory strategy.""" - - consolidation: SummaryOverrideConsolidationConfigurationInput | None = None - """The consolidation configuration for a summary override.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SUMMARY_OVERRIDE_CONFIGURATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.consolidation is not None: - serializer.write_struct( - _SCHEMA_SUMMARY_OVERRIDE_CONFIGURATION_INPUT.members["consolidation"], - self.consolidation, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["consolidation"] = ( - SummaryOverrideConsolidationConfigurationInput.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SUMMARY_OVERRIDE_CONFIGURATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UserPreferenceOverrideConsolidationConfigurationInput: - """ - Input for user preference override consolidation configuration in a - memory strategy. - """ - - append_to_prompt: str = field(repr=False) - """The text to append to the prompt for user preference consolidation.""" - - model_id: str - """The model ID to use for user preference consolidation.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_USER_PREFERENCE_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_USER_PREFERENCE_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT.members[ - "appendToPrompt" - ], - self.append_to_prompt, - ) - serializer.write_string( - _SCHEMA_USER_PREFERENCE_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT.members[ - "modelId" - ], - self.model_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["append_to_prompt"] = de.read_string( - _SCHEMA_USER_PREFERENCE_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT.members[ - "appendToPrompt" - ] - ) - - case 1: - kwargs["model_id"] = de.read_string( - _SCHEMA_USER_PREFERENCE_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT.members[ - "modelId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_USER_PREFERENCE_OVERRIDE_CONSOLIDATION_CONFIGURATION_INPUT, - consumer=_consumer, - ) - if "append_to_prompt" not in kwargs: - kwargs["append_to_prompt"] = "" - if "model_id" not in kwargs: - kwargs["model_id"] = "" - return kwargs - - -@dataclass(kw_only=True) -class UserPreferenceOverrideExtractionConfigurationInput: - """ - Input for user preference override extraction configuration in a memory - strategy. - """ - - append_to_prompt: str = field(repr=False) - """The text to append to the prompt for user preference extraction.""" - - model_id: str - """The model ID to use for user preference extraction.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_USER_PREFERENCE_OVERRIDE_EXTRACTION_CONFIGURATION_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_USER_PREFERENCE_OVERRIDE_EXTRACTION_CONFIGURATION_INPUT.members[ - "appendToPrompt" - ], - self.append_to_prompt, - ) - serializer.write_string( - _SCHEMA_USER_PREFERENCE_OVERRIDE_EXTRACTION_CONFIGURATION_INPUT.members[ - "modelId" - ], - self.model_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["append_to_prompt"] = de.read_string( - _SCHEMA_USER_PREFERENCE_OVERRIDE_EXTRACTION_CONFIGURATION_INPUT.members[ - "appendToPrompt" - ] - ) - - case 1: - kwargs["model_id"] = de.read_string( - _SCHEMA_USER_PREFERENCE_OVERRIDE_EXTRACTION_CONFIGURATION_INPUT.members[ - "modelId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_USER_PREFERENCE_OVERRIDE_EXTRACTION_CONFIGURATION_INPUT, - consumer=_consumer, - ) - if "append_to_prompt" not in kwargs: - kwargs["append_to_prompt"] = "" - if "model_id" not in kwargs: - kwargs["model_id"] = "" - return kwargs - - -@dataclass(kw_only=True) -class UserPreferenceOverrideConfigurationInput: - """Input for user preference override configuration in a memory strategy.""" - - extraction: UserPreferenceOverrideExtractionConfigurationInput | None = None - """The extraction configuration for a user preference override.""" - - consolidation: UserPreferenceOverrideConsolidationConfigurationInput | None = None - """The consolidation configuration for a user preference override.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_USER_PREFERENCE_OVERRIDE_CONFIGURATION_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.extraction is not None: - serializer.write_struct( - _SCHEMA_USER_PREFERENCE_OVERRIDE_CONFIGURATION_INPUT.members[ - "extraction" - ], - self.extraction, - ) - - if self.consolidation is not None: - serializer.write_struct( - _SCHEMA_USER_PREFERENCE_OVERRIDE_CONFIGURATION_INPUT.members[ - "consolidation" - ], - self.consolidation, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["extraction"] = ( - UserPreferenceOverrideExtractionConfigurationInput.deserialize( - de - ) - ) - - case 1: - kwargs["consolidation"] = ( - UserPreferenceOverrideConsolidationConfigurationInput.deserialize( - de - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_USER_PREFERENCE_OVERRIDE_CONFIGURATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass -class CustomConfigurationInputSemanticOverride: - """The semantic override configuration for a custom memory strategy.""" - - value: SemanticOverrideConfigurationInput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOM_CONFIGURATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CUSTOM_CONFIGURATION_INPUT.members["semanticOverride"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=SemanticOverrideConfigurationInput.deserialize(deserializer)) - - -@dataclass -class CustomConfigurationInputSummaryOverride: - """The summary override configuration for a custom memory strategy.""" - - value: SummaryOverrideConfigurationInput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOM_CONFIGURATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CUSTOM_CONFIGURATION_INPUT.members["summaryOverride"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=SummaryOverrideConfigurationInput.deserialize(deserializer)) - - -@dataclass -class CustomConfigurationInputUserPreferenceOverride: - """The user preference override configuration for a custom memory strategy.""" - - value: UserPreferenceOverrideConfigurationInput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOM_CONFIGURATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CUSTOM_CONFIGURATION_INPUT.members["userPreferenceOverride"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=UserPreferenceOverrideConfigurationInput.deserialize(deserializer) - ) - - -@dataclass -class CustomConfigurationInputEpisodicOverride: - """ - The episodic memory strategy override configuration for a custom memory - strategy. - """ - - value: EpisodicOverrideConfigurationInput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOM_CONFIGURATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CUSTOM_CONFIGURATION_INPUT.members["episodicOverride"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=EpisodicOverrideConfigurationInput.deserialize(deserializer)) - - -@dataclass -class CustomConfigurationInputSelfManagedConfiguration: - """The self managed configuration for a custom memory strategy.""" - - value: SelfManagedConfigurationInput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOM_CONFIGURATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CUSTOM_CONFIGURATION_INPUT.members["selfManagedConfiguration"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=SelfManagedConfigurationInput.deserialize(deserializer)) - - -@dataclass -class CustomConfigurationInputUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -CustomConfigurationInput = Union[ - CustomConfigurationInputSemanticOverride - | CustomConfigurationInputSummaryOverride - | CustomConfigurationInputUserPreferenceOverride - | CustomConfigurationInputEpisodicOverride - | CustomConfigurationInputSelfManagedConfiguration - | CustomConfigurationInputUnknown -] -"""Input for custom configuration of a memory strategy.""" - - -class _CustomConfigurationInputDeserializer: - _result: CustomConfigurationInput | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> CustomConfigurationInput: - self._result = None - deserializer.read_struct(_SCHEMA_CUSTOM_CONFIGURATION_INPUT, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - CustomConfigurationInputSemanticOverride.deserialize(de) - ) - - case 1: - self._set_result( - CustomConfigurationInputSummaryOverride.deserialize(de) - ) - - case 2: - self._set_result( - CustomConfigurationInputUserPreferenceOverride.deserialize(de) - ) - - case 3: - self._set_result( - CustomConfigurationInputEpisodicOverride.deserialize(de) - ) - - case 4: - self._set_result( - CustomConfigurationInputSelfManagedConfiguration.deserialize(de) - ) - - case _: - self._set_result( - CustomConfigurationInputUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: CustomConfigurationInput) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class CustomMemoryStrategyInput: - """Input for creating a custom memory strategy.""" - - name: str - """The name of the custom memory strategy.""" - - description: str | None = field(repr=False, default=None) - """The description of the custom memory strategy.""" - - namespaces: list[str] | None = None - """ - This is a legacy parameter, use `namespaceTemplates`. The namespaces - associated with the custom memory strategy. - """ - - namespace_templates: list[str] | None = None - """The namespaceTemplates associated with the custom memory strategy.""" - - configuration: CustomConfigurationInput | None = None - """The configuration for the custom memory strategy.""" - - memory_record_schema: MemoryRecordSchema | None = None - """Schema for metadata fields on records generated by this strategy.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOM_MEMORY_STRATEGY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CUSTOM_MEMORY_STRATEGY_INPUT.members["name"], self.name - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_CUSTOM_MEMORY_STRATEGY_INPUT.members["description"], - self.description, - ) - - if self.namespaces is not None: - _serialize_namespaces_list( - serializer, - _SCHEMA_CUSTOM_MEMORY_STRATEGY_INPUT.members["namespaces"], - self.namespaces, - ) - - if self.namespace_templates is not None: - _serialize_namespaces_list( - serializer, - _SCHEMA_CUSTOM_MEMORY_STRATEGY_INPUT.members["namespaceTemplates"], - self.namespace_templates, - ) - - if self.configuration is not None: - serializer.write_struct( - _SCHEMA_CUSTOM_MEMORY_STRATEGY_INPUT.members["configuration"], - self.configuration, - ) - - if self.memory_record_schema is not None: - serializer.write_struct( - _SCHEMA_CUSTOM_MEMORY_STRATEGY_INPUT.members["memoryRecordSchema"], - self.memory_record_schema, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_CUSTOM_MEMORY_STRATEGY_INPUT.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_CUSTOM_MEMORY_STRATEGY_INPUT.members["description"] - ) - - case 2: - kwargs["namespaces"] = _deserialize_namespaces_list( - de, _SCHEMA_CUSTOM_MEMORY_STRATEGY_INPUT.members["namespaces"] - ) - - case 3: - kwargs["namespace_templates"] = _deserialize_namespaces_list( - de, - _SCHEMA_CUSTOM_MEMORY_STRATEGY_INPUT.members[ - "namespaceTemplates" - ], - ) - - case 4: - kwargs["configuration"] = ( - _CustomConfigurationInputDeserializer().deserialize(de) - ) - - case 5: - kwargs["memory_record_schema"] = MemoryRecordSchema.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CUSTOM_MEMORY_STRATEGY_INPUT, consumer=_consumer - ) - if "name" not in kwargs: - kwargs["name"] = "" - return kwargs - - -@dataclass(kw_only=True) -class EpisodicReflectionConfigurationInput: - """An episodic reflection configuration input.""" - - namespaces: list[str] | None = None - """ - This is a legacy parameter, use `namespaceTemplates`. The namespaces - over which to create reflections. Can be less nested than episode - namespaces. - """ - - namespace_templates: list[str] | None = None - """ - The namespaceTemplates over which to create reflections. Can be less - nested than episode namespaces. - """ - - memory_record_schema: MemoryRecordSchema | None = None - """Schema for metadata fields on records generated by reflections.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EPISODIC_REFLECTION_CONFIGURATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.namespaces is not None: - _serialize_namespaces_list( - serializer, - _SCHEMA_EPISODIC_REFLECTION_CONFIGURATION_INPUT.members["namespaces"], - self.namespaces, - ) - - if self.namespace_templates is not None: - _serialize_namespaces_list( - serializer, - _SCHEMA_EPISODIC_REFLECTION_CONFIGURATION_INPUT.members[ - "namespaceTemplates" - ], - self.namespace_templates, - ) - - if self.memory_record_schema is not None: - serializer.write_struct( - _SCHEMA_EPISODIC_REFLECTION_CONFIGURATION_INPUT.members[ - "memoryRecordSchema" - ], - self.memory_record_schema, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["namespaces"] = _deserialize_namespaces_list( - de, - _SCHEMA_EPISODIC_REFLECTION_CONFIGURATION_INPUT.members[ - "namespaces" - ], - ) - - case 1: - kwargs["namespace_templates"] = _deserialize_namespaces_list( - de, - _SCHEMA_EPISODIC_REFLECTION_CONFIGURATION_INPUT.members[ - "namespaceTemplates" - ], - ) - - case 2: - kwargs["memory_record_schema"] = MemoryRecordSchema.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EPISODIC_REFLECTION_CONFIGURATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class EpisodicMemoryStrategyInput: - """Input for creating an episodic memory strategy.""" - - name: str - """The name of the episodic memory strategy.""" - - description: str | None = field(repr=False, default=None) - """The description of the episodic memory strategy.""" - - namespaces: list[str] | None = None - """ - This is a legacy parameter, use `namespaceTemplates`. The namespaces for - which to create episodes. - """ - - namespace_templates: list[str] | None = None - """The namespaceTemplates for which to create episodes.""" - - reflection_configuration: EpisodicReflectionConfigurationInput | None = None - """ - The configuration for the reflections created with the episodic memory - strategy. - """ - - memory_record_schema: MemoryRecordSchema | None = None - """Schema for metadata fields on records generated by this strategy.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EPISODIC_MEMORY_STRATEGY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_EPISODIC_MEMORY_STRATEGY_INPUT.members["name"], self.name - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_EPISODIC_MEMORY_STRATEGY_INPUT.members["description"], - self.description, - ) - - if self.namespaces is not None: - _serialize_namespaces_list( - serializer, - _SCHEMA_EPISODIC_MEMORY_STRATEGY_INPUT.members["namespaces"], - self.namespaces, - ) - - if self.namespace_templates is not None: - _serialize_namespaces_list( - serializer, - _SCHEMA_EPISODIC_MEMORY_STRATEGY_INPUT.members["namespaceTemplates"], - self.namespace_templates, - ) - - if self.reflection_configuration is not None: - serializer.write_struct( - _SCHEMA_EPISODIC_MEMORY_STRATEGY_INPUT.members[ - "reflectionConfiguration" - ], - self.reflection_configuration, - ) - - if self.memory_record_schema is not None: - serializer.write_struct( - _SCHEMA_EPISODIC_MEMORY_STRATEGY_INPUT.members["memoryRecordSchema"], - self.memory_record_schema, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_EPISODIC_MEMORY_STRATEGY_INPUT.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_EPISODIC_MEMORY_STRATEGY_INPUT.members["description"] - ) - - case 2: - kwargs["namespaces"] = _deserialize_namespaces_list( - de, _SCHEMA_EPISODIC_MEMORY_STRATEGY_INPUT.members["namespaces"] - ) - - case 3: - kwargs["namespace_templates"] = _deserialize_namespaces_list( - de, - _SCHEMA_EPISODIC_MEMORY_STRATEGY_INPUT.members[ - "namespaceTemplates" - ], - ) - - case 4: - kwargs["reflection_configuration"] = ( - EpisodicReflectionConfigurationInput.deserialize(de) - ) - - case 5: - kwargs["memory_record_schema"] = MemoryRecordSchema.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EPISODIC_MEMORY_STRATEGY_INPUT, consumer=_consumer - ) - if "name" not in kwargs: - kwargs["name"] = "" - return kwargs - - -@dataclass(kw_only=True) -class SemanticMemoryStrategyInput: - """Input for creating a semantic memory strategy.""" - - name: str - """The name of the semantic memory strategy.""" - - description: str | None = field(repr=False, default=None) - """The description of the semantic memory strategy.""" - - namespaces: list[str] | None = None - """ - This is a legacy parameter, use `namespaceTemplates`. The namespaces - associated with the semantic memory strategy. - """ - - namespace_templates: list[str] | None = None - """The namespaceTemplates associated with the semantic memory strategy.""" - - memory_record_schema: MemoryRecordSchema | None = None - """Schema for metadata on memory records generated by a strategy.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SEMANTIC_MEMORY_STRATEGY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SEMANTIC_MEMORY_STRATEGY_INPUT.members["name"], self.name - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_SEMANTIC_MEMORY_STRATEGY_INPUT.members["description"], - self.description, - ) - - if self.namespaces is not None: - _serialize_namespaces_list( - serializer, - _SCHEMA_SEMANTIC_MEMORY_STRATEGY_INPUT.members["namespaces"], - self.namespaces, - ) - - if self.namespace_templates is not None: - _serialize_namespaces_list( - serializer, - _SCHEMA_SEMANTIC_MEMORY_STRATEGY_INPUT.members["namespaceTemplates"], - self.namespace_templates, - ) - - if self.memory_record_schema is not None: - serializer.write_struct( - _SCHEMA_SEMANTIC_MEMORY_STRATEGY_INPUT.members["memoryRecordSchema"], - self.memory_record_schema, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_SEMANTIC_MEMORY_STRATEGY_INPUT.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_SEMANTIC_MEMORY_STRATEGY_INPUT.members["description"] - ) - - case 2: - kwargs["namespaces"] = _deserialize_namespaces_list( - de, _SCHEMA_SEMANTIC_MEMORY_STRATEGY_INPUT.members["namespaces"] - ) - - case 3: - kwargs["namespace_templates"] = _deserialize_namespaces_list( - de, - _SCHEMA_SEMANTIC_MEMORY_STRATEGY_INPUT.members[ - "namespaceTemplates" - ], - ) - - case 4: - kwargs["memory_record_schema"] = MemoryRecordSchema.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SEMANTIC_MEMORY_STRATEGY_INPUT, consumer=_consumer - ) - if "name" not in kwargs: - kwargs["name"] = "" - return kwargs - - -@dataclass(kw_only=True) -class SummaryMemoryStrategyInput: - """Input for creating a summary memory strategy.""" - - name: str - """The name of the summary memory strategy.""" - - description: str | None = field(repr=False, default=None) - """The description of the summary memory strategy.""" - - namespaces: list[str] | None = None - """ - This is a legacy parameter, use `namespaceTemplates`. The namespaces - associated with the summary memory strategy. - """ - - namespace_templates: list[str] | None = None - """The namespaceTemplates associated with the summary memory strategy.""" - - memory_record_schema: MemoryRecordSchema | None = None - """Schema for metadata fields on records generated by this strategy.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SUMMARY_MEMORY_STRATEGY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SUMMARY_MEMORY_STRATEGY_INPUT.members["name"], self.name - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_SUMMARY_MEMORY_STRATEGY_INPUT.members["description"], - self.description, - ) - - if self.namespaces is not None: - _serialize_namespaces_list( - serializer, - _SCHEMA_SUMMARY_MEMORY_STRATEGY_INPUT.members["namespaces"], - self.namespaces, - ) - - if self.namespace_templates is not None: - _serialize_namespaces_list( - serializer, - _SCHEMA_SUMMARY_MEMORY_STRATEGY_INPUT.members["namespaceTemplates"], - self.namespace_templates, - ) - - if self.memory_record_schema is not None: - serializer.write_struct( - _SCHEMA_SUMMARY_MEMORY_STRATEGY_INPUT.members["memoryRecordSchema"], - self.memory_record_schema, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_SUMMARY_MEMORY_STRATEGY_INPUT.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_SUMMARY_MEMORY_STRATEGY_INPUT.members["description"] - ) - - case 2: - kwargs["namespaces"] = _deserialize_namespaces_list( - de, _SCHEMA_SUMMARY_MEMORY_STRATEGY_INPUT.members["namespaces"] - ) - - case 3: - kwargs["namespace_templates"] = _deserialize_namespaces_list( - de, - _SCHEMA_SUMMARY_MEMORY_STRATEGY_INPUT.members[ - "namespaceTemplates" - ], - ) - - case 4: - kwargs["memory_record_schema"] = MemoryRecordSchema.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SUMMARY_MEMORY_STRATEGY_INPUT, consumer=_consumer - ) - if "name" not in kwargs: - kwargs["name"] = "" - return kwargs - - -@dataclass(kw_only=True) -class UserPreferenceMemoryStrategyInput: - """Input for creating a user preference memory strategy.""" - - name: str - """The name of the user preference memory strategy.""" - - description: str | None = field(repr=False, default=None) - """The description of the user preference memory strategy.""" - - namespaces: list[str] | None = None - """ - This is a legacy parameter, use `namespaceTemplates`. The namespaces - associated with the user preference memory strategy. - """ - - namespace_templates: list[str] | None = None - """ - The namespaceTemplates associated with the user preference memory - strategy. - """ - - memory_record_schema: MemoryRecordSchema | None = None - """Schema for metadata fields on records generated by this strategy.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_USER_PREFERENCE_MEMORY_STRATEGY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_USER_PREFERENCE_MEMORY_STRATEGY_INPUT.members["name"], self.name - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_USER_PREFERENCE_MEMORY_STRATEGY_INPUT.members["description"], - self.description, - ) - - if self.namespaces is not None: - _serialize_namespaces_list( - serializer, - _SCHEMA_USER_PREFERENCE_MEMORY_STRATEGY_INPUT.members["namespaces"], - self.namespaces, - ) - - if self.namespace_templates is not None: - _serialize_namespaces_list( - serializer, - _SCHEMA_USER_PREFERENCE_MEMORY_STRATEGY_INPUT.members[ - "namespaceTemplates" - ], - self.namespace_templates, - ) - - if self.memory_record_schema is not None: - serializer.write_struct( - _SCHEMA_USER_PREFERENCE_MEMORY_STRATEGY_INPUT.members[ - "memoryRecordSchema" - ], - self.memory_record_schema, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_USER_PREFERENCE_MEMORY_STRATEGY_INPUT.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_USER_PREFERENCE_MEMORY_STRATEGY_INPUT.members[ - "description" - ] - ) - - case 2: - kwargs["namespaces"] = _deserialize_namespaces_list( - de, - _SCHEMA_USER_PREFERENCE_MEMORY_STRATEGY_INPUT.members[ - "namespaces" - ], - ) - - case 3: - kwargs["namespace_templates"] = _deserialize_namespaces_list( - de, - _SCHEMA_USER_PREFERENCE_MEMORY_STRATEGY_INPUT.members[ - "namespaceTemplates" - ], - ) - - case 4: - kwargs["memory_record_schema"] = MemoryRecordSchema.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_USER_PREFERENCE_MEMORY_STRATEGY_INPUT, consumer=_consumer - ) - if "name" not in kwargs: - kwargs["name"] = "" - return kwargs - - -@dataclass -class MemoryStrategyInputSemanticMemoryStrategy: - """Input for creating a semantic memory strategy.""" - - value: SemanticMemoryStrategyInput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEMORY_STRATEGY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MEMORY_STRATEGY_INPUT.members["semanticMemoryStrategy"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=SemanticMemoryStrategyInput.deserialize(deserializer)) - - -@dataclass -class MemoryStrategyInputSummaryMemoryStrategy: - """Input for creating a summary memory strategy.""" - - value: SummaryMemoryStrategyInput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEMORY_STRATEGY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MEMORY_STRATEGY_INPUT.members["summaryMemoryStrategy"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=SummaryMemoryStrategyInput.deserialize(deserializer)) - - -@dataclass -class MemoryStrategyInputUserPreferenceMemoryStrategy: - """Input for creating a user preference memory strategy.""" - - value: UserPreferenceMemoryStrategyInput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEMORY_STRATEGY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MEMORY_STRATEGY_INPUT.members["userPreferenceMemoryStrategy"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=UserPreferenceMemoryStrategyInput.deserialize(deserializer)) - - -@dataclass -class MemoryStrategyInputCustomMemoryStrategy: - """Input for creating a custom memory strategy.""" - - value: CustomMemoryStrategyInput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEMORY_STRATEGY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MEMORY_STRATEGY_INPUT.members["customMemoryStrategy"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=CustomMemoryStrategyInput.deserialize(deserializer)) - - -@dataclass -class MemoryStrategyInputEpisodicMemoryStrategy: - """Input for creating an episodic memory strategy""" - - value: EpisodicMemoryStrategyInput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEMORY_STRATEGY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MEMORY_STRATEGY_INPUT.members["episodicMemoryStrategy"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=EpisodicMemoryStrategyInput.deserialize(deserializer)) - - -@dataclass -class MemoryStrategyInputUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -MemoryStrategyInput = Union[ - MemoryStrategyInputSemanticMemoryStrategy - | MemoryStrategyInputSummaryMemoryStrategy - | MemoryStrategyInputUserPreferenceMemoryStrategy - | MemoryStrategyInputCustomMemoryStrategy - | MemoryStrategyInputEpisodicMemoryStrategy - | MemoryStrategyInputUnknown -] -"""Contains input information for creating a memory strategy.""" - - -class _MemoryStrategyInputDeserializer: - _result: MemoryStrategyInput | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> MemoryStrategyInput: - self._result = None - deserializer.read_struct(_SCHEMA_MEMORY_STRATEGY_INPUT, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - MemoryStrategyInputSemanticMemoryStrategy.deserialize(de) - ) - - case 1: - self._set_result( - MemoryStrategyInputSummaryMemoryStrategy.deserialize(de) - ) - - case 2: - self._set_result( - MemoryStrategyInputUserPreferenceMemoryStrategy.deserialize(de) - ) - - case 3: - self._set_result( - MemoryStrategyInputCustomMemoryStrategy.deserialize(de) - ) - - case 4: - self._set_result( - MemoryStrategyInputEpisodicMemoryStrategy.deserialize(de) - ) - - case _: - self._set_result( - MemoryStrategyInputUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: MemoryStrategyInput) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_memory_strategy_input_list( - serializer: ShapeSerializer, schema: Schema, value: list[MemoryStrategyInput] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_memory_strategy_input_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[MemoryStrategyInput]: - result: list[MemoryStrategyInput] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_MemoryStrategyInputDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_namespace_allowed_values_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_namespace_allowed_values_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class NamespaceKeyValidation: - """ - The validation rules for namespace variable values. When you specify - multiple rules, the service enforces a logical `AND` across all provided - key-value pairs. - """ - - allowed_values: list[str] | None = None - """The allowed values for this namespace variable key.""" - - regex_pattern: str | None = None - """A regex pattern that the namespace variable key-value must match.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_NAMESPACE_KEY_VALIDATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.allowed_values is not None: - _serialize_namespace_allowed_values_list( - serializer, - _SCHEMA_NAMESPACE_KEY_VALIDATION.members["allowedValues"], - self.allowed_values, - ) - - if self.regex_pattern is not None: - serializer.write_string( - _SCHEMA_NAMESPACE_KEY_VALIDATION.members["regexPattern"], - self.regex_pattern, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["allowed_values"] = ( - _deserialize_namespace_allowed_values_list( - de, - _SCHEMA_NAMESPACE_KEY_VALIDATION.members["allowedValues"], - ) - ) - - case 1: - kwargs["regex_pattern"] = de.read_string( - _SCHEMA_NAMESPACE_KEY_VALIDATION.members["regexPattern"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_NAMESPACE_KEY_VALIDATION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class NamespaceKeyEntry: - """ - A namespace variable key definition with optional - `NamespaceKeyValidation` rules. - """ - - key: str - """The namespace variable key name.""" - - validation: NamespaceKeyValidation | None = None - """ - The validation rules that constrain values for this namespace variable - at runtime (`CreateEvent` API). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_NAMESPACE_KEY_ENTRY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_NAMESPACE_KEY_ENTRY.members["key"], self.key) - if self.validation is not None: - serializer.write_struct( - _SCHEMA_NAMESPACE_KEY_ENTRY.members["validation"], self.validation - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["key"] = de.read_string( - _SCHEMA_NAMESPACE_KEY_ENTRY.members["key"] - ) - - case 1: - kwargs["validation"] = NamespaceKeyValidation.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_NAMESPACE_KEY_ENTRY, consumer=_consumer) - if "key" not in kwargs: - kwargs["key"] = "" - return kwargs - - -def _serialize_namespace_keys_list( - serializer: ShapeSerializer, schema: Schema, value: list[NamespaceKeyEntry] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_namespace_keys_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[NamespaceKeyEntry]: - result: list[NamespaceKeyEntry] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(NamespaceKeyEntry.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class ContentLevel(UnknownEnumMixin, StrEnum): - METADATA_ONLY = "METADATA_ONLY" - FULL_CONTENT = "FULL_CONTENT" - - -class ContentType(UnknownEnumMixin, StrEnum): - MEMORY_RECORDS = "MEMORY_RECORDS" - - -@dataclass(kw_only=True) -class ContentConfiguration: - """Defines what content to stream and at what level of detail.""" - - type: str - """Type of content to stream.""" - - level: str = ContentLevel("METADATA_ONLY") - """Level of detail for streamed content.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CONTENT_CONFIGURATION.members["type"], self.type - ) - serializer.write_string( - _SCHEMA_CONTENT_CONFIGURATION.members["level"], self.level - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = ContentType( - de.read_string(_SCHEMA_CONTENT_CONFIGURATION.members["type"]) - ) - - case 1: - kwargs["level"] = ContentLevel( - de.read_string(_SCHEMA_CONTENT_CONFIGURATION.members["level"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONTENT_CONFIGURATION, consumer=_consumer) - if "type" not in kwargs: - kwargs["type"] = ContentType._corrected("") - return kwargs - - -def _serialize_content_configuration_list( - serializer: ShapeSerializer, schema: Schema, value: list[ContentConfiguration] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_content_configuration_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ContentConfiguration]: - result: list[ContentConfiguration] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ContentConfiguration.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class KinesisResource: - """Configuration for Kinesis Data Stream delivery.""" - - data_stream_arn: str - """ARN of the Kinesis Data Stream.""" - - content_configurations: list[ContentConfiguration] - """Content configurations for stream delivery.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KINESIS_RESOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_KINESIS_RESOURCE.members["dataStreamArn"], self.data_stream_arn - ) - _serialize_content_configuration_list( - serializer, - _SCHEMA_KINESIS_RESOURCE.members["contentConfigurations"], - self.content_configurations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["data_stream_arn"] = de.read_string( - _SCHEMA_KINESIS_RESOURCE.members["dataStreamArn"] - ) - - case 1: - kwargs["content_configurations"] = ( - _deserialize_content_configuration_list( - de, - _SCHEMA_KINESIS_RESOURCE.members["contentConfigurations"], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_KINESIS_RESOURCE, consumer=_consumer) - if "data_stream_arn" not in kwargs: - kwargs["data_stream_arn"] = "" - if "content_configurations" not in kwargs: - kwargs["content_configurations"] = [] - return kwargs - - -@dataclass -class StreamDeliveryResourceKinesis: - """Kinesis Data Stream configuration.""" - - value: KinesisResource - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STREAM_DELIVERY_RESOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_STREAM_DELIVERY_RESOURCE.members["kinesis"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=KinesisResource.deserialize(deserializer)) - - -@dataclass -class StreamDeliveryResourceUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -StreamDeliveryResource = Union[ - StreamDeliveryResourceKinesis | StreamDeliveryResourceUnknown -] -"""Supported stream delivery resource types.""" - - -class _StreamDeliveryResourceDeserializer: - _result: StreamDeliveryResource | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> StreamDeliveryResource: - self._result = None - deserializer.read_struct(_SCHEMA_STREAM_DELIVERY_RESOURCE, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(StreamDeliveryResourceKinesis.deserialize(de)) - - case _: - self._set_result( - StreamDeliveryResourceUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: StreamDeliveryResource) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_stream_delivery_resources_list( - serializer: ShapeSerializer, schema: Schema, value: list[StreamDeliveryResource] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_stream_delivery_resources_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[StreamDeliveryResource]: - result: list[StreamDeliveryResource] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_StreamDeliveryResourceDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class StreamDeliveryResources: - """Configuration for streaming memory record data to external resources.""" - - resources: list[StreamDeliveryResource] - """List of stream delivery resource configurations.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STREAM_DELIVERY_RESOURCES, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_stream_delivery_resources_list( - serializer, - _SCHEMA_STREAM_DELIVERY_RESOURCES.members["resources"], - self.resources, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resources"] = _deserialize_stream_delivery_resources_list( - de, _SCHEMA_STREAM_DELIVERY_RESOURCES.members["resources"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_STREAM_DELIVERY_RESOURCES, consumer=_consumer) - if "resources" not in kwargs: - kwargs["resources"] = [] - return kwargs - - -@dataclass(kw_only=True) -class CreateMemoryInput: - """Dataclass for CreateMemoryInput structure.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the operation - completes no more than one time. If this token matches a previous - request, Amazon Bedrock ignores the request but does not return an - error. - """ - - name: str | None = None - """The name of the memory. The name must be unique within your account.""" - - description: str | None = field(repr=False, default=None) - """The description of the memory.""" - - encryption_key_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the KMS key used to encrypt the memory - data. - """ - - memory_execution_role_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the IAM role that provides permissions - for the memory to access Amazon Web Services services. - """ - - event_expiry_duration: int | None = None - """ - The duration after which memory events expire. Specified as an ISO 8601 - duration. - """ - - memory_strategies: list[MemoryStrategyInput] | None = None - """ - The memory strategies to use for this memory. Strategies define how - information is extracted, processed, and consolidated. - """ - - indexed_keys: list[IndexedKey] | None = None - """ - Metadata keys to index for filtering. Once declared, indexed keys cannot - be removed. - """ - - namespace_keys: list[NamespaceKeyEntry] | None = None - """ - The namespace variable key definitions with optional validation rules. - Use these `namespaceKeys` in `namespaceTemplates` to control namespace - hierarchy. - """ - - stream_delivery_resources: StreamDeliveryResources | None = None - """Configuration for streaming memory record data to external resources.""" - - tags: dict[str, str] | None = None - """ - A map of tag keys and values to assign to an AgentCore Memory. Tags - enable you to categorize your resources in different ways, for example, - by purpose, owner, or environment. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_MEMORY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_MEMORY_INPUT.members["clientToken"], self.client_token - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_MEMORY_INPUT.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_MEMORY_INPUT.members["description"], self.description - ) - - if self.encryption_key_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_MEMORY_INPUT.members["encryptionKeyArn"], - self.encryption_key_arn, - ) - - if self.memory_execution_role_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_MEMORY_INPUT.members["memoryExecutionRoleArn"], - self.memory_execution_role_arn, - ) - - if self.event_expiry_duration is not None: - serializer.write_integer( - _SCHEMA_CREATE_MEMORY_INPUT.members["eventExpiryDuration"], - self.event_expiry_duration, - ) - - if self.memory_strategies is not None: - _serialize_memory_strategy_input_list( - serializer, - _SCHEMA_CREATE_MEMORY_INPUT.members["memoryStrategies"], - self.memory_strategies, - ) - - if self.indexed_keys is not None: - _serialize_indexed_keys_list( - serializer, - _SCHEMA_CREATE_MEMORY_INPUT.members["indexedKeys"], - self.indexed_keys, - ) - - if self.namespace_keys is not None: - _serialize_namespace_keys_list( - serializer, - _SCHEMA_CREATE_MEMORY_INPUT.members["namespaceKeys"], - self.namespace_keys, - ) - - if self.stream_delivery_resources is not None: - serializer.write_struct( - _SCHEMA_CREATE_MEMORY_INPUT.members["streamDeliveryResources"], - self.stream_delivery_resources, - ) - - if self.tags is not None: - _serialize_tags_map( - serializer, _SCHEMA_CREATE_MEMORY_INPUT.members["tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_MEMORY_INPUT.members["clientToken"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_MEMORY_INPUT.members["name"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_MEMORY_INPUT.members["description"] - ) - - case 3: - kwargs["encryption_key_arn"] = de.read_string( - _SCHEMA_CREATE_MEMORY_INPUT.members["encryptionKeyArn"] - ) - - case 4: - kwargs["memory_execution_role_arn"] = de.read_string( - _SCHEMA_CREATE_MEMORY_INPUT.members["memoryExecutionRoleArn"] - ) - - case 5: - kwargs["event_expiry_duration"] = de.read_integer( - _SCHEMA_CREATE_MEMORY_INPUT.members["eventExpiryDuration"] - ) - - case 6: - kwargs["memory_strategies"] = ( - _deserialize_memory_strategy_input_list( - de, _SCHEMA_CREATE_MEMORY_INPUT.members["memoryStrategies"] - ) - ) - - case 7: - kwargs["indexed_keys"] = _deserialize_indexed_keys_list( - de, _SCHEMA_CREATE_MEMORY_INPUT.members["indexedKeys"] - ) - - case 8: - kwargs["namespace_keys"] = _deserialize_namespace_keys_list( - de, _SCHEMA_CREATE_MEMORY_INPUT.members["namespaceKeys"] - ) - - case 9: - kwargs["stream_delivery_resources"] = ( - StreamDeliveryResources.deserialize(de) - ) - - case 10: - kwargs["tags"] = _deserialize_tags_map( - de, _SCHEMA_CREATE_MEMORY_INPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_MEMORY_INPUT, consumer=_consumer) - return kwargs - - -class MemoryStatus(UnknownEnumMixin, StrEnum): - CREATING = "CREATING" - ACTIVE = "ACTIVE" - FAILED = "FAILED" - DELETING = "DELETING" - UPDATING = "UPDATING" - - -@dataclass(kw_only=True) -class EpisodicConsolidationOverride: - """ - Contains configurations to override the default consolidation step for - the episodic memory strategy. - """ - - append_to_prompt: str = field(repr=False) - """ - The text appended to the prompt for the consolidation step of the - episodic memory strategy. - """ - - model_id: str - """ - The model ID used for the consolidation step of the episodic memory - strategy. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EPISODIC_CONSOLIDATION_OVERRIDE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_EPISODIC_CONSOLIDATION_OVERRIDE.members["appendToPrompt"], - self.append_to_prompt, - ) - serializer.write_string( - _SCHEMA_EPISODIC_CONSOLIDATION_OVERRIDE.members["modelId"], self.model_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["append_to_prompt"] = de.read_string( - _SCHEMA_EPISODIC_CONSOLIDATION_OVERRIDE.members[ - "appendToPrompt" - ] - ) - - case 1: - kwargs["model_id"] = de.read_string( - _SCHEMA_EPISODIC_CONSOLIDATION_OVERRIDE.members["modelId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EPISODIC_CONSOLIDATION_OVERRIDE, consumer=_consumer - ) - if "append_to_prompt" not in kwargs: - kwargs["append_to_prompt"] = "" - if "model_id" not in kwargs: - kwargs["model_id"] = "" - return kwargs - - -@dataclass(kw_only=True) -class SemanticConsolidationOverride: - """Contains semantic consolidation override configuration.""" - - append_to_prompt: str = field(repr=False) - """The text to append to the prompt for semantic consolidation.""" - - model_id: str - """The model ID to use for semantic consolidation.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SEMANTIC_CONSOLIDATION_OVERRIDE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SEMANTIC_CONSOLIDATION_OVERRIDE.members["appendToPrompt"], - self.append_to_prompt, - ) - serializer.write_string( - _SCHEMA_SEMANTIC_CONSOLIDATION_OVERRIDE.members["modelId"], self.model_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["append_to_prompt"] = de.read_string( - _SCHEMA_SEMANTIC_CONSOLIDATION_OVERRIDE.members[ - "appendToPrompt" - ] - ) - - case 1: - kwargs["model_id"] = de.read_string( - _SCHEMA_SEMANTIC_CONSOLIDATION_OVERRIDE.members["modelId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SEMANTIC_CONSOLIDATION_OVERRIDE, consumer=_consumer - ) - if "append_to_prompt" not in kwargs: - kwargs["append_to_prompt"] = "" - if "model_id" not in kwargs: - kwargs["model_id"] = "" - return kwargs - - -@dataclass(kw_only=True) -class SummaryConsolidationOverride: - """Contains summary consolidation override configuration.""" - - append_to_prompt: str = field(repr=False) - """The text to append to the prompt for summary consolidation.""" - - model_id: str - """The model ID to use for summary consolidation.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SUMMARY_CONSOLIDATION_OVERRIDE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SUMMARY_CONSOLIDATION_OVERRIDE.members["appendToPrompt"], - self.append_to_prompt, - ) - serializer.write_string( - _SCHEMA_SUMMARY_CONSOLIDATION_OVERRIDE.members["modelId"], self.model_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["append_to_prompt"] = de.read_string( - _SCHEMA_SUMMARY_CONSOLIDATION_OVERRIDE.members["appendToPrompt"] - ) - - case 1: - kwargs["model_id"] = de.read_string( - _SCHEMA_SUMMARY_CONSOLIDATION_OVERRIDE.members["modelId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SUMMARY_CONSOLIDATION_OVERRIDE, consumer=_consumer - ) - if "append_to_prompt" not in kwargs: - kwargs["append_to_prompt"] = "" - if "model_id" not in kwargs: - kwargs["model_id"] = "" - return kwargs - - -@dataclass(kw_only=True) -class UserPreferenceConsolidationOverride: - """Contains user preference consolidation override configuration.""" - - append_to_prompt: str = field(repr=False) - """The text to append to the prompt for user preference consolidation.""" - - model_id: str - """The model ID to use for user preference consolidation.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_USER_PREFERENCE_CONSOLIDATION_OVERRIDE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_USER_PREFERENCE_CONSOLIDATION_OVERRIDE.members["appendToPrompt"], - self.append_to_prompt, - ) - serializer.write_string( - _SCHEMA_USER_PREFERENCE_CONSOLIDATION_OVERRIDE.members["modelId"], - self.model_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["append_to_prompt"] = de.read_string( - _SCHEMA_USER_PREFERENCE_CONSOLIDATION_OVERRIDE.members[ - "appendToPrompt" - ] - ) - - case 1: - kwargs["model_id"] = de.read_string( - _SCHEMA_USER_PREFERENCE_CONSOLIDATION_OVERRIDE.members[ - "modelId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_USER_PREFERENCE_CONSOLIDATION_OVERRIDE, consumer=_consumer - ) - if "append_to_prompt" not in kwargs: - kwargs["append_to_prompt"] = "" - if "model_id" not in kwargs: - kwargs["model_id"] = "" - return kwargs - - -@dataclass -class CustomConsolidationConfigurationSemanticConsolidationOverride: - """The semantic consolidation override configuration.""" - - value: SemanticConsolidationOverride - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOM_CONSOLIDATION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CUSTOM_CONSOLIDATION_CONFIGURATION.members[ - "semanticConsolidationOverride" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=SemanticConsolidationOverride.deserialize(deserializer)) - - -@dataclass -class CustomConsolidationConfigurationSummaryConsolidationOverride: - """The summary consolidation override configuration.""" - - value: SummaryConsolidationOverride - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOM_CONSOLIDATION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CUSTOM_CONSOLIDATION_CONFIGURATION.members[ - "summaryConsolidationOverride" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=SummaryConsolidationOverride.deserialize(deserializer)) - - -@dataclass -class CustomConsolidationConfigurationUserPreferenceConsolidationOverride: - """The user preference consolidation override configuration.""" - - value: UserPreferenceConsolidationOverride - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOM_CONSOLIDATION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CUSTOM_CONSOLIDATION_CONFIGURATION.members[ - "userPreferenceConsolidationOverride" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=UserPreferenceConsolidationOverride.deserialize(deserializer)) - - -@dataclass -class CustomConsolidationConfigurationEpisodicConsolidationOverride: - """ - The configurations to override the default consolidation step for the - episodic memory strategy. - """ - - value: EpisodicConsolidationOverride - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOM_CONSOLIDATION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CUSTOM_CONSOLIDATION_CONFIGURATION.members[ - "episodicConsolidationOverride" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=EpisodicConsolidationOverride.deserialize(deserializer)) - - -@dataclass -class CustomConsolidationConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -CustomConsolidationConfiguration = Union[ - CustomConsolidationConfigurationSemanticConsolidationOverride - | CustomConsolidationConfigurationSummaryConsolidationOverride - | CustomConsolidationConfigurationUserPreferenceConsolidationOverride - | CustomConsolidationConfigurationEpisodicConsolidationOverride - | CustomConsolidationConfigurationUnknown -] -"""Contains custom consolidation configuration information.""" - - -class _CustomConsolidationConfigurationDeserializer: - _result: CustomConsolidationConfiguration | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> CustomConsolidationConfiguration: - self._result = None - deserializer.read_struct( - _SCHEMA_CUSTOM_CONSOLIDATION_CONFIGURATION, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - CustomConsolidationConfigurationSemanticConsolidationOverride.deserialize( - de - ) - ) - - case 1: - self._set_result( - CustomConsolidationConfigurationSummaryConsolidationOverride.deserialize( - de - ) - ) - - case 2: - self._set_result( - CustomConsolidationConfigurationUserPreferenceConsolidationOverride.deserialize( - de - ) - ) - - case 3: - self._set_result( - CustomConsolidationConfigurationEpisodicConsolidationOverride.deserialize( - de - ) - ) - - case _: - self._set_result( - CustomConsolidationConfigurationUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: CustomConsolidationConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass -class ConsolidationConfigurationCustomConsolidationConfiguration: - """The custom consolidation configuration.""" - - value: CustomConsolidationConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONSOLIDATION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CONSOLIDATION_CONFIGURATION.members[ - "customConsolidationConfiguration" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_CustomConsolidationConfigurationDeserializer().deserialize( - deserializer - ) - ) - - -@dataclass -class ConsolidationConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ConsolidationConfiguration = Union[ - ConsolidationConfigurationCustomConsolidationConfiguration - | ConsolidationConfigurationUnknown -] -"""Contains consolidation configuration information for a memory strategy.""" - - -class _ConsolidationConfigurationDeserializer: - _result: ConsolidationConfiguration | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> ConsolidationConfiguration: - self._result = None - deserializer.read_struct(_SCHEMA_CONSOLIDATION_CONFIGURATION, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - ConsolidationConfigurationCustomConsolidationConfiguration.deserialize( - de - ) - ) - - case _: - self._set_result( - ConsolidationConfigurationUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: ConsolidationConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class EpisodicExtractionOverride: - """ - Contains configurations to override the default extraction step for the - episodic memory strategy. - """ - - append_to_prompt: str = field(repr=False) - """ - The text appended to the prompt for the extraction step of the episodic - memory strategy. - """ - - model_id: str - """ - The model ID used for the extraction step of the episodic memory - strategy. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EPISODIC_EXTRACTION_OVERRIDE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_EPISODIC_EXTRACTION_OVERRIDE.members["appendToPrompt"], - self.append_to_prompt, - ) - serializer.write_string( - _SCHEMA_EPISODIC_EXTRACTION_OVERRIDE.members["modelId"], self.model_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["append_to_prompt"] = de.read_string( - _SCHEMA_EPISODIC_EXTRACTION_OVERRIDE.members["appendToPrompt"] - ) - - case 1: - kwargs["model_id"] = de.read_string( - _SCHEMA_EPISODIC_EXTRACTION_OVERRIDE.members["modelId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EPISODIC_EXTRACTION_OVERRIDE, consumer=_consumer - ) - if "append_to_prompt" not in kwargs: - kwargs["append_to_prompt"] = "" - if "model_id" not in kwargs: - kwargs["model_id"] = "" - return kwargs - - -@dataclass(kw_only=True) -class SemanticExtractionOverride: - """Contains semantic extraction override configuration.""" - - append_to_prompt: str = field(repr=False) - """The text to append to the prompt for semantic extraction.""" - - model_id: str - """The model ID to use for semantic extraction.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SEMANTIC_EXTRACTION_OVERRIDE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SEMANTIC_EXTRACTION_OVERRIDE.members["appendToPrompt"], - self.append_to_prompt, - ) - serializer.write_string( - _SCHEMA_SEMANTIC_EXTRACTION_OVERRIDE.members["modelId"], self.model_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["append_to_prompt"] = de.read_string( - _SCHEMA_SEMANTIC_EXTRACTION_OVERRIDE.members["appendToPrompt"] - ) - - case 1: - kwargs["model_id"] = de.read_string( - _SCHEMA_SEMANTIC_EXTRACTION_OVERRIDE.members["modelId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SEMANTIC_EXTRACTION_OVERRIDE, consumer=_consumer - ) - if "append_to_prompt" not in kwargs: - kwargs["append_to_prompt"] = "" - if "model_id" not in kwargs: - kwargs["model_id"] = "" - return kwargs - - -@dataclass(kw_only=True) -class UserPreferenceExtractionOverride: - """Contains user preference extraction override configuration.""" - - append_to_prompt: str = field(repr=False) - """The text to append to the prompt for user preference extraction.""" - - model_id: str - """The model ID to use for user preference extraction.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_USER_PREFERENCE_EXTRACTION_OVERRIDE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_USER_PREFERENCE_EXTRACTION_OVERRIDE.members["appendToPrompt"], - self.append_to_prompt, - ) - serializer.write_string( - _SCHEMA_USER_PREFERENCE_EXTRACTION_OVERRIDE.members["modelId"], - self.model_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["append_to_prompt"] = de.read_string( - _SCHEMA_USER_PREFERENCE_EXTRACTION_OVERRIDE.members[ - "appendToPrompt" - ] - ) - - case 1: - kwargs["model_id"] = de.read_string( - _SCHEMA_USER_PREFERENCE_EXTRACTION_OVERRIDE.members["modelId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_USER_PREFERENCE_EXTRACTION_OVERRIDE, consumer=_consumer - ) - if "append_to_prompt" not in kwargs: - kwargs["append_to_prompt"] = "" - if "model_id" not in kwargs: - kwargs["model_id"] = "" - return kwargs - - -@dataclass -class CustomExtractionConfigurationSemanticExtractionOverride: - """The semantic extraction override configuration.""" - - value: SemanticExtractionOverride - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOM_EXTRACTION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CUSTOM_EXTRACTION_CONFIGURATION.members[ - "semanticExtractionOverride" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=SemanticExtractionOverride.deserialize(deserializer)) - - -@dataclass -class CustomExtractionConfigurationUserPreferenceExtractionOverride: - """The user preference extraction override configuration.""" - - value: UserPreferenceExtractionOverride - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOM_EXTRACTION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CUSTOM_EXTRACTION_CONFIGURATION.members[ - "userPreferenceExtractionOverride" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=UserPreferenceExtractionOverride.deserialize(deserializer)) - - -@dataclass -class CustomExtractionConfigurationEpisodicExtractionOverride: - """ - The configurations to override the default extraction step for the - episodic memory strategy. - """ - - value: EpisodicExtractionOverride - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOM_EXTRACTION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CUSTOM_EXTRACTION_CONFIGURATION.members[ - "episodicExtractionOverride" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=EpisodicExtractionOverride.deserialize(deserializer)) - - -@dataclass -class CustomExtractionConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -CustomExtractionConfiguration = Union[ - CustomExtractionConfigurationSemanticExtractionOverride - | CustomExtractionConfigurationUserPreferenceExtractionOverride - | CustomExtractionConfigurationEpisodicExtractionOverride - | CustomExtractionConfigurationUnknown -] -"""Contains custom extraction configuration information.""" - - -class _CustomExtractionConfigurationDeserializer: - _result: CustomExtractionConfiguration | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> CustomExtractionConfiguration: - self._result = None - deserializer.read_struct( - _SCHEMA_CUSTOM_EXTRACTION_CONFIGURATION, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - CustomExtractionConfigurationSemanticExtractionOverride.deserialize( - de - ) - ) - - case 1: - self._set_result( - CustomExtractionConfigurationUserPreferenceExtractionOverride.deserialize( - de - ) - ) - - case 2: - self._set_result( - CustomExtractionConfigurationEpisodicExtractionOverride.deserialize( - de - ) - ) - - case _: - self._set_result( - CustomExtractionConfigurationUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: CustomExtractionConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass -class ExtractionConfigurationCustomExtractionConfiguration: - """The custom extraction configuration.""" - - value: CustomExtractionConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EXTRACTION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_EXTRACTION_CONFIGURATION.members["customExtractionConfiguration"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_CustomExtractionConfigurationDeserializer().deserialize(deserializer) - ) - - -@dataclass -class ExtractionConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ExtractionConfiguration = Union[ - ExtractionConfigurationCustomExtractionConfiguration - | ExtractionConfigurationUnknown -] -"""Contains extraction configuration information for a memory strategy.""" - - -class _ExtractionConfigurationDeserializer: - _result: ExtractionConfiguration | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> ExtractionConfiguration: - self._result = None - deserializer.read_struct(_SCHEMA_EXTRACTION_CONFIGURATION, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - ExtractionConfigurationCustomExtractionConfiguration.deserialize(de) - ) - - case _: - self._set_result( - ExtractionConfigurationUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: ExtractionConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class EpisodicReflectionOverride: - """ - Contains configurations to override the default reflection step for the - episodic memory strategy. - """ - - append_to_prompt: str = field(repr=False) - """ - The text appended to the prompt for the reflection step of the episodic - memory strategy. - """ - - model_id: str - """ - The model ID used for the reflection step of the episodic memory - strategy. - """ - - namespaces: list[str] | None = None - """ - This is a legacy parameter. The namespaces over which reflections were - created. Can be less nested than the episodic namespaces. - """ - - namespace_templates: list[str] | None = None - """ - The namespaceTemplates over which reflections were created. Can be less - nested than the episodic namespaces. - """ - - memory_record_schema: MemoryRecordSchema | None = None - """ - Schema for metadata fields on records generated by this reflection - override. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EPISODIC_REFLECTION_OVERRIDE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_EPISODIC_REFLECTION_OVERRIDE.members["appendToPrompt"], - self.append_to_prompt, - ) - serializer.write_string( - _SCHEMA_EPISODIC_REFLECTION_OVERRIDE.members["modelId"], self.model_id - ) - if self.namespaces is not None: - _serialize_namespaces_list( - serializer, - _SCHEMA_EPISODIC_REFLECTION_OVERRIDE.members["namespaces"], - self.namespaces, - ) - - if self.namespace_templates is not None: - _serialize_namespaces_list( - serializer, - _SCHEMA_EPISODIC_REFLECTION_OVERRIDE.members["namespaceTemplates"], - self.namespace_templates, - ) - - if self.memory_record_schema is not None: - serializer.write_struct( - _SCHEMA_EPISODIC_REFLECTION_OVERRIDE.members["memoryRecordSchema"], - self.memory_record_schema, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["append_to_prompt"] = de.read_string( - _SCHEMA_EPISODIC_REFLECTION_OVERRIDE.members["appendToPrompt"] - ) - - case 1: - kwargs["model_id"] = de.read_string( - _SCHEMA_EPISODIC_REFLECTION_OVERRIDE.members["modelId"] - ) - - case 2: - kwargs["namespaces"] = _deserialize_namespaces_list( - de, _SCHEMA_EPISODIC_REFLECTION_OVERRIDE.members["namespaces"] - ) - - case 3: - kwargs["namespace_templates"] = _deserialize_namespaces_list( - de, - _SCHEMA_EPISODIC_REFLECTION_OVERRIDE.members[ - "namespaceTemplates" - ], - ) - - case 4: - kwargs["memory_record_schema"] = MemoryRecordSchema.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EPISODIC_REFLECTION_OVERRIDE, consumer=_consumer - ) - if "append_to_prompt" not in kwargs: - kwargs["append_to_prompt"] = "" - if "model_id" not in kwargs: - kwargs["model_id"] = "" - return kwargs - - -@dataclass -class CustomReflectionConfigurationEpisodicReflectionOverride: - """The configuration for a reflection strategy to override the default one.""" - - value: EpisodicReflectionOverride - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOM_REFLECTION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CUSTOM_REFLECTION_CONFIGURATION.members[ - "episodicReflectionOverride" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=EpisodicReflectionOverride.deserialize(deserializer)) - - -@dataclass -class CustomReflectionConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -CustomReflectionConfiguration = Union[ - CustomReflectionConfigurationEpisodicReflectionOverride - | CustomReflectionConfigurationUnknown -] -"""Contains configurations for a custom reflection strategy.""" - - -class _CustomReflectionConfigurationDeserializer: - _result: CustomReflectionConfiguration | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> CustomReflectionConfiguration: - self._result = None - deserializer.read_struct( - _SCHEMA_CUSTOM_REFLECTION_CONFIGURATION, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - CustomReflectionConfigurationEpisodicReflectionOverride.deserialize( - de - ) - ) - - case _: - self._set_result( - CustomReflectionConfigurationUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: CustomReflectionConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class EpisodicReflectionConfiguration: - """ - The configuration for the reflections created with the episodic memory - strategy. - """ - - namespaces: list[str] | None = None - """ - This is a legacy parameter, use `namespaceTemplates`. The namespaces for - which to create reflections. Can be less nested than the episodic - namespaces. - """ - - namespace_templates: list[str] | None = None - """ - The namespaceTemplates for which to create reflections. Can be less - nested than the episodic namespaces. - """ - - memory_record_schema: MemoryRecordSchema | None = None - """\"Schema for metadata fields on records generated by reflections.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EPISODIC_REFLECTION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.namespaces is not None: - _serialize_namespaces_list( - serializer, - _SCHEMA_EPISODIC_REFLECTION_CONFIGURATION.members["namespaces"], - self.namespaces, - ) - - if self.namespace_templates is not None: - _serialize_namespaces_list( - serializer, - _SCHEMA_EPISODIC_REFLECTION_CONFIGURATION.members["namespaceTemplates"], - self.namespace_templates, - ) - - if self.memory_record_schema is not None: - serializer.write_struct( - _SCHEMA_EPISODIC_REFLECTION_CONFIGURATION.members["memoryRecordSchema"], - self.memory_record_schema, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["namespaces"] = _deserialize_namespaces_list( - de, - _SCHEMA_EPISODIC_REFLECTION_CONFIGURATION.members["namespaces"], - ) - - case 1: - kwargs["namespace_templates"] = _deserialize_namespaces_list( - de, - _SCHEMA_EPISODIC_REFLECTION_CONFIGURATION.members[ - "namespaceTemplates" - ], - ) - - case 2: - kwargs["memory_record_schema"] = MemoryRecordSchema.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EPISODIC_REFLECTION_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass -class ReflectionConfigurationCustomReflectionConfiguration: - """The configuration for a custom reflection strategy.""" - - value: CustomReflectionConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REFLECTION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_REFLECTION_CONFIGURATION.members["customReflectionConfiguration"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_CustomReflectionConfigurationDeserializer().deserialize(deserializer) - ) - - -@dataclass -class ReflectionConfigurationEpisodicReflectionConfiguration: - """The configuration for the episodic reflection strategy.""" - - value: EpisodicReflectionConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REFLECTION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_REFLECTION_CONFIGURATION.members["episodicReflectionConfiguration"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=EpisodicReflectionConfiguration.deserialize(deserializer)) - - -@dataclass -class ReflectionConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ReflectionConfiguration = Union[ - ReflectionConfigurationCustomReflectionConfiguration - | ReflectionConfigurationEpisodicReflectionConfiguration - | ReflectionConfigurationUnknown -] -"""Contains reflection configuration information for a memory strategy.""" - - -class _ReflectionConfigurationDeserializer: - _result: ReflectionConfiguration | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> ReflectionConfiguration: - self._result = None - deserializer.read_struct(_SCHEMA_REFLECTION_CONFIGURATION, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - ReflectionConfigurationCustomReflectionConfiguration.deserialize(de) - ) - - case 1: - self._set_result( - ReflectionConfigurationEpisodicReflectionConfiguration.deserialize( - de - ) - ) - - case _: - self._set_result( - ReflectionConfigurationUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: ReflectionConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class InvocationConfiguration: - """ - The configuration to invoke a self-managed memory processing pipeline - with. - """ - - topic_arn: str - """The ARN of the SNS topic for job notifications.""" - - payload_delivery_bucket_name: str - """The S3 bucket name for event payload delivery.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOCATION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_INVOCATION_CONFIGURATION.members["topicArn"], self.topic_arn - ) - serializer.write_string( - _SCHEMA_INVOCATION_CONFIGURATION.members["payloadDeliveryBucketName"], - self.payload_delivery_bucket_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["topic_arn"] = de.read_string( - _SCHEMA_INVOCATION_CONFIGURATION.members["topicArn"] - ) - - case 1: - kwargs["payload_delivery_bucket_name"] = de.read_string( - _SCHEMA_INVOCATION_CONFIGURATION.members[ - "payloadDeliveryBucketName" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INVOCATION_CONFIGURATION, consumer=_consumer) - if "topic_arn" not in kwargs: - kwargs["topic_arn"] = "" - if "payload_delivery_bucket_name" not in kwargs: - kwargs["payload_delivery_bucket_name"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(topic_arn="", payload_delivery_bucket_name="") - - -@dataclass(kw_only=True) -class MessageBasedTrigger: - """The trigger configuration based on a message.""" - - message_count: int | None = None - """The number of messages that trigger memory processing.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MESSAGE_BASED_TRIGGER, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message_count is not None: - serializer.write_integer( - _SCHEMA_MESSAGE_BASED_TRIGGER.members["messageCount"], - self.message_count, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message_count"] = de.read_integer( - _SCHEMA_MESSAGE_BASED_TRIGGER.members["messageCount"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MESSAGE_BASED_TRIGGER, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class TimeBasedTrigger: - """Trigger configuration based on time.""" - - idle_session_timeout: int | None = None - """Idle session timeout (seconds) that triggers memory processing.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TIME_BASED_TRIGGER, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.idle_session_timeout is not None: - serializer.write_integer( - _SCHEMA_TIME_BASED_TRIGGER.members["idleSessionTimeout"], - self.idle_session_timeout, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["idle_session_timeout"] = de.read_integer( - _SCHEMA_TIME_BASED_TRIGGER.members["idleSessionTimeout"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TIME_BASED_TRIGGER, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class TokenBasedTrigger: - """Trigger configuration based on tokens.""" - - token_count: int | None = None - """Number of tokens that trigger memory processing.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOKEN_BASED_TRIGGER, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.token_count is not None: - serializer.write_integer( - _SCHEMA_TOKEN_BASED_TRIGGER.members["tokenCount"], self.token_count - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["token_count"] = de.read_integer( - _SCHEMA_TOKEN_BASED_TRIGGER.members["tokenCount"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TOKEN_BASED_TRIGGER, consumer=_consumer) - return kwargs - - -@dataclass -class TriggerConditionMessageBasedTrigger: - """Message based trigger configuration.""" - - value: MessageBasedTrigger - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRIGGER_CONDITION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_TRIGGER_CONDITION.members["messageBasedTrigger"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=MessageBasedTrigger.deserialize(deserializer)) - - -@dataclass -class TriggerConditionTokenBasedTrigger: - """Token based trigger configuration.""" - - value: TokenBasedTrigger - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRIGGER_CONDITION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_TRIGGER_CONDITION.members["tokenBasedTrigger"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=TokenBasedTrigger.deserialize(deserializer)) - - -@dataclass -class TriggerConditionTimeBasedTrigger: - """Time based trigger configuration.""" - - value: TimeBasedTrigger - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRIGGER_CONDITION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_TRIGGER_CONDITION.members["timeBasedTrigger"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=TimeBasedTrigger.deserialize(deserializer)) - - -@dataclass -class TriggerConditionUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -TriggerCondition = Union[ - TriggerConditionMessageBasedTrigger - | TriggerConditionTokenBasedTrigger - | TriggerConditionTimeBasedTrigger - | TriggerConditionUnknown -] -"""Condition that triggers memory processing.""" - - -class _TriggerConditionDeserializer: - _result: TriggerCondition | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> TriggerCondition: - self._result = None - deserializer.read_struct(_SCHEMA_TRIGGER_CONDITION, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(TriggerConditionMessageBasedTrigger.deserialize(de)) - - case 1: - self._set_result(TriggerConditionTokenBasedTrigger.deserialize(de)) - - case 2: - self._set_result(TriggerConditionTimeBasedTrigger.deserialize(de)) - - case _: - self._set_result( - TriggerConditionUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: TriggerCondition) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_trigger_conditions_list( - serializer: ShapeSerializer, schema: Schema, value: list[TriggerCondition] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_trigger_conditions_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[TriggerCondition]: - result: list[TriggerCondition] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_TriggerConditionDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class SelfManagedConfiguration: - """A configuration for a self-managed memory strategy.""" - - trigger_conditions: list[TriggerCondition] - """A list of conditions that trigger memory processing.""" - - invocation_configuration: InvocationConfiguration - """The configuration to use when invoking memory processing.""" - - historical_context_window_size: int - """The number of historical messages to include in processing context.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SELF_MANAGED_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_trigger_conditions_list( - serializer, - _SCHEMA_SELF_MANAGED_CONFIGURATION.members["triggerConditions"], - self.trigger_conditions, - ) - serializer.write_struct( - _SCHEMA_SELF_MANAGED_CONFIGURATION.members["invocationConfiguration"], - self.invocation_configuration, - ) - serializer.write_integer( - _SCHEMA_SELF_MANAGED_CONFIGURATION.members["historicalContextWindowSize"], - self.historical_context_window_size, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["trigger_conditions"] = _deserialize_trigger_conditions_list( - de, - _SCHEMA_SELF_MANAGED_CONFIGURATION.members["triggerConditions"], - ) - - case 1: - kwargs["invocation_configuration"] = ( - InvocationConfiguration.deserialize(de) - ) - - case 2: - kwargs["historical_context_window_size"] = de.read_integer( - _SCHEMA_SELF_MANAGED_CONFIGURATION.members[ - "historicalContextWindowSize" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SELF_MANAGED_CONFIGURATION, consumer=_consumer) - if "trigger_conditions" not in kwargs: - kwargs["trigger_conditions"] = [] - if "invocation_configuration" not in kwargs: - kwargs["invocation_configuration"] = ( - InvocationConfiguration._smithy_default() - ) - if "historical_context_window_size" not in kwargs: - kwargs["historical_context_window_size"] = 0 - return kwargs - - -class OverrideType(UnknownEnumMixin, StrEnum): - SEMANTIC_OVERRIDE = "SEMANTIC_OVERRIDE" - SUMMARY_OVERRIDE = "SUMMARY_OVERRIDE" - USER_PREFERENCE_OVERRIDE = "USER_PREFERENCE_OVERRIDE" - SELF_MANAGED = "SELF_MANAGED" - EPISODIC_OVERRIDE = "EPISODIC_OVERRIDE" - - -@dataclass(kw_only=True) -class StrategyConfiguration: - """Contains configuration information for a memory strategy.""" - - type: str | None = None - """The type of override for the strategy configuration.""" - - extraction: ExtractionConfiguration | None = None - """The extraction configuration for the memory strategy.""" - - consolidation: ConsolidationConfiguration | None = None - """The consolidation configuration for the memory strategy.""" - - reflection: ReflectionConfiguration | None = None - """The reflection configuration for the memory strategy.""" - - self_managed_configuration: SelfManagedConfiguration | None = None - """Self-managed configuration settings.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STRATEGY_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_STRATEGY_CONFIGURATION.members["type"], self.type - ) - - if self.extraction is not None: - serializer.write_struct( - _SCHEMA_STRATEGY_CONFIGURATION.members["extraction"], self.extraction - ) - - if self.consolidation is not None: - serializer.write_struct( - _SCHEMA_STRATEGY_CONFIGURATION.members["consolidation"], - self.consolidation, - ) - - if self.reflection is not None: - serializer.write_struct( - _SCHEMA_STRATEGY_CONFIGURATION.members["reflection"], self.reflection - ) - - if self.self_managed_configuration is not None: - serializer.write_struct( - _SCHEMA_STRATEGY_CONFIGURATION.members["selfManagedConfiguration"], - self.self_managed_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = OverrideType( - de.read_string(_SCHEMA_STRATEGY_CONFIGURATION.members["type"]) - ) - - case 1: - kwargs["extraction"] = ( - _ExtractionConfigurationDeserializer().deserialize(de) - ) - - case 2: - kwargs["consolidation"] = ( - _ConsolidationConfigurationDeserializer().deserialize(de) - ) - - case 3: - kwargs["reflection"] = ( - _ReflectionConfigurationDeserializer().deserialize(de) - ) - - case 4: - kwargs["self_managed_configuration"] = ( - SelfManagedConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_STRATEGY_CONFIGURATION, consumer=_consumer) - return kwargs - - -class MemoryStrategyStatus(UnknownEnumMixin, StrEnum): - CREATING = "CREATING" - ACTIVE = "ACTIVE" - DELETING = "DELETING" - FAILED = "FAILED" - - -class MemoryStrategyType(UnknownEnumMixin, StrEnum): - SEMANTIC = "SEMANTIC" - SUMMARIZATION = "SUMMARIZATION" - USER_PREFERENCE = "USER_PREFERENCE" - CUSTOM = "CUSTOM" - EPISODIC = "EPISODIC" - - -@dataclass(kw_only=True) -class MemoryStrategy: - """Contains information about a memory strategy.""" - - strategy_id: str - """The unique identifier of the memory strategy.""" - - name: str - """The name of the memory strategy.""" - - type: str - """The type of the memory strategy.""" - - namespaces: list[str] - """ - This is a legacy parameter. The namespaces associated with the memory - strategy. - """ - - namespace_templates: list[str] - """The namespaceTemplates associated with the memory strategy.""" - - description: str | None = field(repr=False, default=None) - """The description of the memory strategy.""" - - configuration: StrategyConfiguration | None = None - """The configuration of the memory strategy.""" - - created_at: datetime | None = None - """The timestamp when the memory strategy was created.""" - - updated_at: datetime | None = None - """The timestamp when the memory strategy was last updated.""" - - status: str | None = None - """The current status of the memory strategy.""" - - memory_record_schema: MemoryRecordSchema | None = None - """Schema for metadata fields on records generated by this strategy.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEMORY_STRATEGY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MEMORY_STRATEGY.members["strategyId"], self.strategy_id - ) - serializer.write_string(_SCHEMA_MEMORY_STRATEGY.members["name"], self.name) - if self.description is not None: - serializer.write_string( - _SCHEMA_MEMORY_STRATEGY.members["description"], self.description - ) - - if self.configuration is not None: - serializer.write_struct( - _SCHEMA_MEMORY_STRATEGY.members["configuration"], self.configuration - ) - - serializer.write_string(_SCHEMA_MEMORY_STRATEGY.members["type"], self.type) - _serialize_namespaces_list( - serializer, _SCHEMA_MEMORY_STRATEGY.members["namespaces"], self.namespaces - ) - _serialize_namespaces_list( - serializer, - _SCHEMA_MEMORY_STRATEGY.members["namespaceTemplates"], - self.namespace_templates, - ) - if self.created_at is not None: - serializer.write_timestamp( - _SCHEMA_MEMORY_STRATEGY.members["createdAt"], self.created_at - ) - - if self.updated_at is not None: - serializer.write_timestamp( - _SCHEMA_MEMORY_STRATEGY.members["updatedAt"], self.updated_at - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_MEMORY_STRATEGY.members["status"], self.status - ) - - if self.memory_record_schema is not None: - serializer.write_struct( - _SCHEMA_MEMORY_STRATEGY.members["memoryRecordSchema"], - self.memory_record_schema, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["strategy_id"] = de.read_string( - _SCHEMA_MEMORY_STRATEGY.members["strategyId"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_MEMORY_STRATEGY.members["name"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_MEMORY_STRATEGY.members["description"] - ) - - case 3: - kwargs["configuration"] = StrategyConfiguration.deserialize(de) - - case 4: - kwargs["type"] = MemoryStrategyType( - de.read_string(_SCHEMA_MEMORY_STRATEGY.members["type"]) - ) - - case 5: - kwargs["namespaces"] = _deserialize_namespaces_list( - de, _SCHEMA_MEMORY_STRATEGY.members["namespaces"] - ) - - case 6: - kwargs["namespace_templates"] = _deserialize_namespaces_list( - de, _SCHEMA_MEMORY_STRATEGY.members["namespaceTemplates"] - ) - - case 7: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_MEMORY_STRATEGY.members["createdAt"] - ) - - case 8: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_MEMORY_STRATEGY.members["updatedAt"] - ) - - case 9: - kwargs["status"] = MemoryStrategyStatus( - de.read_string(_SCHEMA_MEMORY_STRATEGY.members["status"]) - ) - - case 10: - kwargs["memory_record_schema"] = MemoryRecordSchema.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MEMORY_STRATEGY, consumer=_consumer) - if "strategy_id" not in kwargs: - kwargs["strategy_id"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "type" not in kwargs: - kwargs["type"] = MemoryStrategyType._corrected("") - if "namespaces" not in kwargs: - kwargs["namespaces"] = [] - if "namespace_templates" not in kwargs: - kwargs["namespace_templates"] = [] - return kwargs - - -def _serialize_memory_strategy_list( - serializer: ShapeSerializer, schema: Schema, value: list[MemoryStrategy] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_memory_strategy_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[MemoryStrategy]: - result: list[MemoryStrategy] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(MemoryStrategy.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class Memory: - """Contains information about a memory resource.""" - - arn: str - """The Amazon Resource Name (ARN) of the memory.""" - - id: str - """The unique identifier of the memory.""" - - name: str - """The name of the memory.""" - - event_expiry_duration: int - """The number of days after which memory events will expire.""" - - status: str - """The current status of the memory.""" - - created_at: datetime - """The timestamp when the memory was created.""" - - updated_at: datetime - """The timestamp when the memory was last updated.""" - - description: str | None = field(repr=False, default=None) - """The description of the memory.""" - - encryption_key_arn: str | None = None - """The ARN of the KMS key used to encrypt the memory.""" - - memory_execution_role_arn: str | None = None - """The ARN of the IAM role that provides permissions for the memory.""" - - failure_reason: str | None = None - """The reason for failure if the memory is in a failed state.""" - - strategies: list[MemoryStrategy] | None = None - """The list of memory strategies associated with this memory.""" - - indexed_keys: list[IndexedKey] | None = None - """ - The indexed metadata keys for this memory. Only indexed keys can be used - in metadata filters. - """ - - namespace_keys: list[NamespaceKeyEntry] | None = None - """ - The namespace variable key definitions for this memory. Namespace keys - define custom variables used in `namespaceTemplates` with optional - validation rules. - """ - - stream_delivery_resources: StreamDeliveryResources | None = None - """Configuration for streaming memory record data to external resources.""" - - managed_by_resource_arn: str | None = None - """ - ARN of the resource managing this memory (e.g. a harness). When set, - strategy modifications and deletion are only allowed through the - managing resource. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEMORY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_MEMORY.members["arn"], self.arn) - serializer.write_string(_SCHEMA_MEMORY.members["id"], self.id) - serializer.write_string(_SCHEMA_MEMORY.members["name"], self.name) - if self.description is not None: - serializer.write_string( - _SCHEMA_MEMORY.members["description"], self.description - ) - - if self.encryption_key_arn is not None: - serializer.write_string( - _SCHEMA_MEMORY.members["encryptionKeyArn"], self.encryption_key_arn - ) - - if self.memory_execution_role_arn is not None: - serializer.write_string( - _SCHEMA_MEMORY.members["memoryExecutionRoleArn"], - self.memory_execution_role_arn, - ) - - serializer.write_integer( - _SCHEMA_MEMORY.members["eventExpiryDuration"], self.event_expiry_duration - ) - serializer.write_string(_SCHEMA_MEMORY.members["status"], self.status) - if self.failure_reason is not None: - serializer.write_string( - _SCHEMA_MEMORY.members["failureReason"], self.failure_reason - ) - - serializer.write_timestamp(_SCHEMA_MEMORY.members["createdAt"], self.created_at) - serializer.write_timestamp(_SCHEMA_MEMORY.members["updatedAt"], self.updated_at) - if self.strategies is not None: - _serialize_memory_strategy_list( - serializer, _SCHEMA_MEMORY.members["strategies"], self.strategies - ) - - if self.indexed_keys is not None: - _serialize_indexed_keys_list( - serializer, _SCHEMA_MEMORY.members["indexedKeys"], self.indexed_keys - ) - - if self.namespace_keys is not None: - _serialize_namespace_keys_list( - serializer, _SCHEMA_MEMORY.members["namespaceKeys"], self.namespace_keys - ) - - if self.stream_delivery_resources is not None: - serializer.write_struct( - _SCHEMA_MEMORY.members["streamDeliveryResources"], - self.stream_delivery_resources, - ) - - if self.managed_by_resource_arn is not None: - serializer.write_string( - _SCHEMA_MEMORY.members["managedByResourceArn"], - self.managed_by_resource_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["arn"] = de.read_string(_SCHEMA_MEMORY.members["arn"]) - - case 1: - kwargs["id"] = de.read_string(_SCHEMA_MEMORY.members["id"]) - - case 2: - kwargs["name"] = de.read_string(_SCHEMA_MEMORY.members["name"]) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_MEMORY.members["description"] - ) - - case 4: - kwargs["encryption_key_arn"] = de.read_string( - _SCHEMA_MEMORY.members["encryptionKeyArn"] - ) - - case 5: - kwargs["memory_execution_role_arn"] = de.read_string( - _SCHEMA_MEMORY.members["memoryExecutionRoleArn"] - ) - - case 6: - kwargs["event_expiry_duration"] = de.read_integer( - _SCHEMA_MEMORY.members["eventExpiryDuration"] - ) - - case 7: - kwargs["status"] = MemoryStatus( - de.read_string(_SCHEMA_MEMORY.members["status"]) - ) - - case 8: - kwargs["failure_reason"] = de.read_string( - _SCHEMA_MEMORY.members["failureReason"] - ) - - case 9: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_MEMORY.members["createdAt"] - ) - - case 10: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_MEMORY.members["updatedAt"] - ) - - case 11: - kwargs["strategies"] = _deserialize_memory_strategy_list( - de, _SCHEMA_MEMORY.members["strategies"] - ) - - case 12: - kwargs["indexed_keys"] = _deserialize_indexed_keys_list( - de, _SCHEMA_MEMORY.members["indexedKeys"] - ) - - case 13: - kwargs["namespace_keys"] = _deserialize_namespace_keys_list( - de, _SCHEMA_MEMORY.members["namespaceKeys"] - ) - - case 14: - kwargs["stream_delivery_resources"] = ( - StreamDeliveryResources.deserialize(de) - ) - - case 15: - kwargs["managed_by_resource_arn"] = de.read_string( - _SCHEMA_MEMORY.members["managedByResourceArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MEMORY, consumer=_consumer) - if "arn" not in kwargs: - kwargs["arn"] = "" - if "id" not in kwargs: - kwargs["id"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "event_expiry_duration" not in kwargs: - kwargs["event_expiry_duration"] = 0 - if "status" not in kwargs: - kwargs["status"] = MemoryStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls( - arn="", - id="", - name="", - event_expiry_duration=0, - status=MemoryStatus._corrected(""), - created_at=datetime.fromtimestamp(0, tz=timezone.utc), - updated_at=datetime.fromtimestamp(0, tz=timezone.utc), - ) - - -@dataclass(kw_only=True) -class CreateMemoryOutput: - """Dataclass for CreateMemoryOutput structure.""" - - memory: Memory | None = None - """ - The details of the created memory, including its ID, ARN, name, - description, and configuration settings. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_MEMORY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.memory is not None: - serializer.write_struct( - _SCHEMA_CREATE_MEMORY_OUTPUT.members["memory"], self.memory - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["memory"] = Memory.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_MEMORY_OUTPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ServiceException(ServiceError): - """An internal error occurred.""" - - fault: Literal["client", "server"] | None = "server" - is_retry_safe: bool | None = True - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SERVICE_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_SERVICE_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_SERVICE_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SERVICE_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ThrottledException(ServiceError): - """API rate limit has been exceeded.""" - - fault: Literal["client", "server"] | None = "client" - is_retry_safe: bool | None = True - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_THROTTLED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_THROTTLED_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_THROTTLED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_THROTTLED_EXCEPTION, consumer=_consumer) - return kwargs - - -CREATE_MEMORY = APIOperation( - input=CreateMemoryInput, - output=CreateMemoryOutput, - schema=_SCHEMA_CREATE_MEMORY, - input_schema=_SCHEMA_CREATE_MEMORY_INPUT, - output_schema=_SCHEMA_CREATE_MEMORY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceException" - ): ServiceException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottledException" - ): ThrottledException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteMemoryInput: - """Dataclass for DeleteMemoryInput structure.""" - - client_token: str | None = None - """ - A client token is used for keeping track of idempotent requests. It can - contain a session id which can be around 250 chars, combined with a - unique AWS identifier. - """ - - memory_id: str | None = None - """The unique identifier of the memory to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_MEMORY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.client_token is not None: - serializer.write_string( - _SCHEMA_DELETE_MEMORY_INPUT.members["clientToken"], self.client_token - ) - - if self.memory_id is not None: - serializer.write_string( - _SCHEMA_DELETE_MEMORY_INPUT.members["memoryId"], self.memory_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["client_token"] = de.read_string( - _SCHEMA_DELETE_MEMORY_INPUT.members["clientToken"] - ) - - case 1: - kwargs["memory_id"] = de.read_string( - _SCHEMA_DELETE_MEMORY_INPUT.members["memoryId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_MEMORY_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteMemoryOutput: - """Dataclass for DeleteMemoryOutput structure.""" - - memory_id: str - """The unique identifier of the deleted AgentCore Memory resource.""" - - status: str | None = None - """The current status of the AgentCore Memory resource deletion.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_MEMORY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DELETE_MEMORY_OUTPUT.members["memoryId"], self.memory_id - ) - if self.status is not None: - serializer.write_string( - _SCHEMA_DELETE_MEMORY_OUTPUT.members["status"], self.status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["memory_id"] = de.read_string( - _SCHEMA_DELETE_MEMORY_OUTPUT.members["memoryId"] - ) - - case 1: - kwargs["status"] = MemoryStatus( - de.read_string(_SCHEMA_DELETE_MEMORY_OUTPUT.members["status"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_MEMORY_OUTPUT, consumer=_consumer) - if "memory_id" not in kwargs: - kwargs["memory_id"] = "" - return kwargs - - -DELETE_MEMORY = APIOperation( - input=DeleteMemoryInput, - output=DeleteMemoryOutput, - schema=_SCHEMA_DELETE_MEMORY, - input_schema=_SCHEMA_DELETE_MEMORY_INPUT, - output_schema=_SCHEMA_DELETE_MEMORY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceException" - ): ServiceException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottledException" - ): ThrottledException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_THROTTLED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class MemoryView(UnknownEnumMixin, StrEnum): - FULL = "full" - WITHOUT_DECRYPTION = "without_decryption" - - -@dataclass(kw_only=True) -class GetMemoryInput: - """Dataclass for GetMemoryInput structure.""" - - memory_id: str | None = None - """The unique identifier of the memory to retrieve.""" - - view: str = MemoryView("full") - """The level of detail to return for the memory.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_MEMORY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.memory_id is not None: - serializer.write_string( - _SCHEMA_GET_MEMORY_INPUT.members["memoryId"], self.memory_id - ) - - if self.view is not None: - serializer.write_string(_SCHEMA_GET_MEMORY_INPUT.members["view"], self.view) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["memory_id"] = de.read_string( - _SCHEMA_GET_MEMORY_INPUT.members["memoryId"] - ) - - case 1: - kwargs["view"] = MemoryView( - de.read_string(_SCHEMA_GET_MEMORY_INPUT.members["view"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_MEMORY_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetMemoryOutput: - """Dataclass for GetMemoryOutput structure.""" - - memory: Memory - """The retrieved AgentCore Memory resource details.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_MEMORY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_MEMORY_OUTPUT.members["memory"], self.memory - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["memory"] = Memory.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_MEMORY_OUTPUT, consumer=_consumer) - if "memory" not in kwargs: - kwargs["memory"] = Memory._smithy_default() - return kwargs - - -GET_MEMORY = APIOperation( - input=GetMemoryInput, - output=GetMemoryOutput, - schema=_SCHEMA_GET_MEMORY, - input_schema=_SCHEMA_GET_MEMORY_INPUT, - output_schema=_SCHEMA_GET_MEMORY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceException" - ): ServiceException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottledException" - ): ThrottledException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_THROTTLED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListMemoriesInput: - """Dataclass for ListMemoriesInput structure.""" - - max_results: int = 100 - """ - The maximum number of results to return in a single call. The default - value is 10. The maximum value is 50. - """ - - next_token: str | None = None - """ - The token for the next set of results. Use the value returned in the - previous response in the next request to retrieve the next set of - results. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_MEMORIES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_MEMORIES_INPUT.members["maxResults"], self.max_results - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_MEMORIES_INPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_MEMORIES_INPUT.members["maxResults"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_MEMORIES_INPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_MEMORIES_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class MemorySummary: - """Contains summary information about a memory resource.""" - - created_at: datetime - """The timestamp when the memory was created.""" - - updated_at: datetime - """The timestamp when the memory was last updated.""" - - arn: str | None = None - """The Amazon Resource Name (ARN) of the memory.""" - - id: str | None = None - """The unique identifier of the memory.""" - - status: str | None = None - """The current status of the memory.""" - - managed_by_resource_arn: str | None = None - """ - ARN of the resource managing this memory (e.g. a harness). Null if not - managed. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEMORY_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.arn is not None: - serializer.write_string(_SCHEMA_MEMORY_SUMMARY.members["arn"], self.arn) - - if self.id is not None: - serializer.write_string(_SCHEMA_MEMORY_SUMMARY.members["id"], self.id) - - if self.status is not None: - serializer.write_string( - _SCHEMA_MEMORY_SUMMARY.members["status"], self.status - ) - - serializer.write_timestamp( - _SCHEMA_MEMORY_SUMMARY.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_MEMORY_SUMMARY.members["updatedAt"], self.updated_at - ) - if self.managed_by_resource_arn is not None: - serializer.write_string( - _SCHEMA_MEMORY_SUMMARY.members["managedByResourceArn"], - self.managed_by_resource_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["arn"] = de.read_string( - _SCHEMA_MEMORY_SUMMARY.members["arn"] - ) - - case 1: - kwargs["id"] = de.read_string(_SCHEMA_MEMORY_SUMMARY.members["id"]) - - case 2: - kwargs["status"] = MemoryStatus( - de.read_string(_SCHEMA_MEMORY_SUMMARY.members["status"]) - ) - - case 3: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_MEMORY_SUMMARY.members["createdAt"] - ) - - case 4: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_MEMORY_SUMMARY.members["updatedAt"] - ) - - case 5: - kwargs["managed_by_resource_arn"] = de.read_string( - _SCHEMA_MEMORY_SUMMARY.members["managedByResourceArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MEMORY_SUMMARY, consumer=_consumer) - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_memory_summary_list( - serializer: ShapeSerializer, schema: Schema, value: list[MemorySummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_memory_summary_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[MemorySummary]: - result: list[MemorySummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(MemorySummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListMemoriesOutput: - """Dataclass for ListMemoriesOutput structure.""" - - memories: list[MemorySummary] - """The list of AgentCore Memory resource summaries.""" - - next_token: str | None = None - """A token to retrieve the next page of results.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_MEMORIES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_memory_summary_list( - serializer, _SCHEMA_LIST_MEMORIES_OUTPUT.members["memories"], self.memories - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_MEMORIES_OUTPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["memories"] = _deserialize_memory_summary_list( - de, _SCHEMA_LIST_MEMORIES_OUTPUT.members["memories"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_MEMORIES_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_MEMORIES_OUTPUT, consumer=_consumer) - if "memories" not in kwargs: - kwargs["memories"] = [] - return kwargs - - -LIST_MEMORIES = APIOperation( - input=ListMemoriesInput, - output=ListMemoriesOutput, - schema=_SCHEMA_LIST_MEMORIES, - input_schema=_SCHEMA_LIST_MEMORIES_INPUT, - output_schema=_SCHEMA_LIST_MEMORIES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceException" - ): ServiceException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottledException" - ): ThrottledException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_THROTTLED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteMemoryStrategyInput: - """Input for deleting a memory strategy.""" - - memory_strategy_id: str - """The unique identifier of the memory strategy to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_MEMORY_STRATEGY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DELETE_MEMORY_STRATEGY_INPUT.members["memoryStrategyId"], - self.memory_strategy_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["memory_strategy_id"] = de.read_string( - _SCHEMA_DELETE_MEMORY_STRATEGY_INPUT.members["memoryStrategyId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_MEMORY_STRATEGY_INPUT, consumer=_consumer - ) - if "memory_strategy_id" not in kwargs: - kwargs["memory_strategy_id"] = "" - return kwargs - - -def _serialize_delete_memory_strategies_list( - serializer: ShapeSerializer, schema: Schema, value: list[DeleteMemoryStrategyInput] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_delete_memory_strategies_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[DeleteMemoryStrategyInput]: - result: list[DeleteMemoryStrategyInput] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(DeleteMemoryStrategyInput.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass -class CustomConsolidationConfigurationInputSemanticConsolidationOverride: - """The semantic consolidation override configuration input.""" - - value: SemanticOverrideConsolidationConfigurationInput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOM_CONSOLIDATION_CONFIGURATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CUSTOM_CONSOLIDATION_CONFIGURATION_INPUT.members[ - "semanticConsolidationOverride" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=SemanticOverrideConsolidationConfigurationInput.deserialize( - deserializer - ) - ) - - -@dataclass -class CustomConsolidationConfigurationInputSummaryConsolidationOverride: - """The summary consolidation override configuration input.""" - - value: SummaryOverrideConsolidationConfigurationInput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOM_CONSOLIDATION_CONFIGURATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CUSTOM_CONSOLIDATION_CONFIGURATION_INPUT.members[ - "summaryConsolidationOverride" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=SummaryOverrideConsolidationConfigurationInput.deserialize( - deserializer - ) - ) - - -@dataclass -class CustomConsolidationConfigurationInputUserPreferenceConsolidationOverride: - """The user preference consolidation override configuration input.""" - - value: UserPreferenceOverrideConsolidationConfigurationInput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOM_CONSOLIDATION_CONFIGURATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CUSTOM_CONSOLIDATION_CONFIGURATION_INPUT.members[ - "userPreferenceConsolidationOverride" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=UserPreferenceOverrideConsolidationConfigurationInput.deserialize( - deserializer - ) - ) - - -@dataclass -class CustomConsolidationConfigurationInputEpisodicConsolidationOverride: - """ - Configurations to override the consolidation step of the episodic - strategy. - """ - - value: EpisodicOverrideConsolidationConfigurationInput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOM_CONSOLIDATION_CONFIGURATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CUSTOM_CONSOLIDATION_CONFIGURATION_INPUT.members[ - "episodicConsolidationOverride" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=EpisodicOverrideConsolidationConfigurationInput.deserialize( - deserializer - ) - ) - - -@dataclass -class CustomConsolidationConfigurationInputUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -CustomConsolidationConfigurationInput = Union[ - CustomConsolidationConfigurationInputSemanticConsolidationOverride - | CustomConsolidationConfigurationInputSummaryConsolidationOverride - | CustomConsolidationConfigurationInputUserPreferenceConsolidationOverride - | CustomConsolidationConfigurationInputEpisodicConsolidationOverride - | CustomConsolidationConfigurationInputUnknown -] -"""Input for a custom consolidation configuration.""" - - -class _CustomConsolidationConfigurationInputDeserializer: - _result: CustomConsolidationConfigurationInput | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> CustomConsolidationConfigurationInput: - self._result = None - deserializer.read_struct( - _SCHEMA_CUSTOM_CONSOLIDATION_CONFIGURATION_INPUT, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - CustomConsolidationConfigurationInputSemanticConsolidationOverride.deserialize( - de - ) - ) - - case 1: - self._set_result( - CustomConsolidationConfigurationInputSummaryConsolidationOverride.deserialize( - de - ) - ) - - case 2: - self._set_result( - CustomConsolidationConfigurationInputUserPreferenceConsolidationOverride.deserialize( - de - ) - ) - - case 3: - self._set_result( - CustomConsolidationConfigurationInputEpisodicConsolidationOverride.deserialize( - de - ) - ) - - case _: - self._set_result( - CustomConsolidationConfigurationInputUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: CustomConsolidationConfigurationInput) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass -class ModifyConsolidationConfigurationCustomConsolidationConfiguration: - """The updated custom consolidation configuration.""" - - value: CustomConsolidationConfigurationInput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MODIFY_CONSOLIDATION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MODIFY_CONSOLIDATION_CONFIGURATION.members[ - "customConsolidationConfiguration" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_CustomConsolidationConfigurationInputDeserializer().deserialize( - deserializer - ) - ) - - -@dataclass -class ModifyConsolidationConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ModifyConsolidationConfiguration = Union[ - ModifyConsolidationConfigurationCustomConsolidationConfiguration - | ModifyConsolidationConfigurationUnknown -] -"""Contains information for modifying a consolidation configuration.""" - - -class _ModifyConsolidationConfigurationDeserializer: - _result: ModifyConsolidationConfiguration | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> ModifyConsolidationConfiguration: - self._result = None - deserializer.read_struct( - _SCHEMA_MODIFY_CONSOLIDATION_CONFIGURATION, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - ModifyConsolidationConfigurationCustomConsolidationConfiguration.deserialize( - de - ) - ) - - case _: - self._set_result( - ModifyConsolidationConfigurationUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: ModifyConsolidationConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass -class CustomExtractionConfigurationInputSemanticExtractionOverride: - """The semantic extraction override configuration input.""" - - value: SemanticOverrideExtractionConfigurationInput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOM_EXTRACTION_CONFIGURATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CUSTOM_EXTRACTION_CONFIGURATION_INPUT.members[ - "semanticExtractionOverride" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=SemanticOverrideExtractionConfigurationInput.deserialize(deserializer) - ) - - -@dataclass -class CustomExtractionConfigurationInputUserPreferenceExtractionOverride: - """The user preference extraction override configuration input.""" - - value: UserPreferenceOverrideExtractionConfigurationInput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOM_EXTRACTION_CONFIGURATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CUSTOM_EXTRACTION_CONFIGURATION_INPUT.members[ - "userPreferenceExtractionOverride" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=UserPreferenceOverrideExtractionConfigurationInput.deserialize( - deserializer - ) - ) - - -@dataclass -class CustomExtractionConfigurationInputEpisodicExtractionOverride: - """Configurations to override the extraction step of the episodic strategy.""" - - value: EpisodicOverrideExtractionConfigurationInput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOM_EXTRACTION_CONFIGURATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CUSTOM_EXTRACTION_CONFIGURATION_INPUT.members[ - "episodicExtractionOverride" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=EpisodicOverrideExtractionConfigurationInput.deserialize(deserializer) - ) - - -@dataclass -class CustomExtractionConfigurationInputUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -CustomExtractionConfigurationInput = Union[ - CustomExtractionConfigurationInputSemanticExtractionOverride - | CustomExtractionConfigurationInputUserPreferenceExtractionOverride - | CustomExtractionConfigurationInputEpisodicExtractionOverride - | CustomExtractionConfigurationInputUnknown -] -"""Input for a custom extraction configuration.""" - - -class _CustomExtractionConfigurationInputDeserializer: - _result: CustomExtractionConfigurationInput | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> CustomExtractionConfigurationInput: - self._result = None - deserializer.read_struct( - _SCHEMA_CUSTOM_EXTRACTION_CONFIGURATION_INPUT, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - CustomExtractionConfigurationInputSemanticExtractionOverride.deserialize( - de - ) - ) - - case 1: - self._set_result( - CustomExtractionConfigurationInputUserPreferenceExtractionOverride.deserialize( - de - ) - ) - - case 2: - self._set_result( - CustomExtractionConfigurationInputEpisodicExtractionOverride.deserialize( - de - ) - ) - - case _: - self._set_result( - CustomExtractionConfigurationInputUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: CustomExtractionConfigurationInput) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass -class ModifyExtractionConfigurationCustomExtractionConfiguration: - """The updated custom extraction configuration.""" - - value: CustomExtractionConfigurationInput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MODIFY_EXTRACTION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MODIFY_EXTRACTION_CONFIGURATION.members[ - "customExtractionConfiguration" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_CustomExtractionConfigurationInputDeserializer().deserialize( - deserializer - ) - ) - - -@dataclass -class ModifyExtractionConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ModifyExtractionConfiguration = Union[ - ModifyExtractionConfigurationCustomExtractionConfiguration - | ModifyExtractionConfigurationUnknown -] -"""Contains information for modifying an extraction configuration.""" - - -class _ModifyExtractionConfigurationDeserializer: - _result: ModifyExtractionConfiguration | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> ModifyExtractionConfiguration: - self._result = None - deserializer.read_struct( - _SCHEMA_MODIFY_EXTRACTION_CONFIGURATION, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - ModifyExtractionConfigurationCustomExtractionConfiguration.deserialize( - de - ) - ) - - case _: - self._set_result( - ModifyExtractionConfigurationUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: ModifyExtractionConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass -class CustomReflectionConfigurationInputEpisodicReflectionOverride: - """The reflection override configuration input.""" - - value: EpisodicOverrideReflectionConfigurationInput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOM_REFLECTION_CONFIGURATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CUSTOM_REFLECTION_CONFIGURATION_INPUT.members[ - "episodicReflectionOverride" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=EpisodicOverrideReflectionConfigurationInput.deserialize(deserializer) - ) - - -@dataclass -class CustomReflectionConfigurationInputUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -CustomReflectionConfigurationInput = Union[ - CustomReflectionConfigurationInputEpisodicReflectionOverride - | CustomReflectionConfigurationInputUnknown -] -"""Input for a custom reflection configuration.""" - - -class _CustomReflectionConfigurationInputDeserializer: - _result: CustomReflectionConfigurationInput | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> CustomReflectionConfigurationInput: - self._result = None - deserializer.read_struct( - _SCHEMA_CUSTOM_REFLECTION_CONFIGURATION_INPUT, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - CustomReflectionConfigurationInputEpisodicReflectionOverride.deserialize( - de - ) - ) - - case _: - self._set_result( - CustomReflectionConfigurationInputUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: CustomReflectionConfigurationInput) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass -class ModifyReflectionConfigurationEpisodicReflectionConfiguration: - """The updated episodic reflection configuration.""" - - value: EpisodicReflectionConfigurationInput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MODIFY_REFLECTION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MODIFY_REFLECTION_CONFIGURATION.members[ - "episodicReflectionConfiguration" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=EpisodicReflectionConfigurationInput.deserialize(deserializer)) - - -@dataclass -class ModifyReflectionConfigurationCustomReflectionConfiguration: - """The updated custom reflection configuration.""" - - value: CustomReflectionConfigurationInput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MODIFY_REFLECTION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MODIFY_REFLECTION_CONFIGURATION.members[ - "customReflectionConfiguration" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_CustomReflectionConfigurationInputDeserializer().deserialize( - deserializer - ) - ) - - -@dataclass -class ModifyReflectionConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ModifyReflectionConfiguration = Union[ - ModifyReflectionConfigurationEpisodicReflectionConfiguration - | ModifyReflectionConfigurationCustomReflectionConfiguration - | ModifyReflectionConfigurationUnknown -] -"""Contains information for modifying a reflection configuration.""" - - -class _ModifyReflectionConfigurationDeserializer: - _result: ModifyReflectionConfiguration | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> ModifyReflectionConfiguration: - self._result = None - deserializer.read_struct( - _SCHEMA_MODIFY_REFLECTION_CONFIGURATION, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - ModifyReflectionConfigurationEpisodicReflectionConfiguration.deserialize( - de - ) - ) - - case 1: - self._set_result( - ModifyReflectionConfigurationCustomReflectionConfiguration.deserialize( - de - ) - ) - - case _: - self._set_result( - ModifyReflectionConfigurationUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: ModifyReflectionConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class ModifyInvocationConfigurationInput: - """The configuration for updating invocation settings.""" - - topic_arn: str | None = None - """The updated ARN of the SNS topic for job notifications.""" - - payload_delivery_bucket_name: str | None = None - """The updated S3 bucket name for event payload delivery.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MODIFY_INVOCATION_CONFIGURATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.topic_arn is not None: - serializer.write_string( - _SCHEMA_MODIFY_INVOCATION_CONFIGURATION_INPUT.members["topicArn"], - self.topic_arn, - ) - - if self.payload_delivery_bucket_name is not None: - serializer.write_string( - _SCHEMA_MODIFY_INVOCATION_CONFIGURATION_INPUT.members[ - "payloadDeliveryBucketName" - ], - self.payload_delivery_bucket_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["topic_arn"] = de.read_string( - _SCHEMA_MODIFY_INVOCATION_CONFIGURATION_INPUT.members[ - "topicArn" - ] - ) - - case 1: - kwargs["payload_delivery_bucket_name"] = de.read_string( - _SCHEMA_MODIFY_INVOCATION_CONFIGURATION_INPUT.members[ - "payloadDeliveryBucketName" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MODIFY_INVOCATION_CONFIGURATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ModifySelfManagedConfiguration: - """The configuration for updating the self-managed memory strategy.""" - - trigger_conditions: list[TriggerConditionInput] | None = None - """The updated list of conditions that trigger memory processing.""" - - invocation_configuration: ModifyInvocationConfigurationInput | None = None - """ - The updated configuration to invoke self-managed memory processing - pipeline. - """ - - historical_context_window_size: int | None = None - """ - The updated number of historical messages to include in processing - context. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MODIFY_SELF_MANAGED_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.trigger_conditions is not None: - _serialize_trigger_condition_input_list( - serializer, - _SCHEMA_MODIFY_SELF_MANAGED_CONFIGURATION.members["triggerConditions"], - self.trigger_conditions, - ) - - if self.invocation_configuration is not None: - serializer.write_struct( - _SCHEMA_MODIFY_SELF_MANAGED_CONFIGURATION.members[ - "invocationConfiguration" - ], - self.invocation_configuration, - ) - - if self.historical_context_window_size is not None: - serializer.write_integer( - _SCHEMA_MODIFY_SELF_MANAGED_CONFIGURATION.members[ - "historicalContextWindowSize" - ], - self.historical_context_window_size, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["trigger_conditions"] = ( - _deserialize_trigger_condition_input_list( - de, - _SCHEMA_MODIFY_SELF_MANAGED_CONFIGURATION.members[ - "triggerConditions" - ], - ) - ) - - case 1: - kwargs["invocation_configuration"] = ( - ModifyInvocationConfigurationInput.deserialize(de) - ) - - case 2: - kwargs["historical_context_window_size"] = de.read_integer( - _SCHEMA_MODIFY_SELF_MANAGED_CONFIGURATION.members[ - "historicalContextWindowSize" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MODIFY_SELF_MANAGED_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ModifyStrategyConfiguration: - """Contains information for modifying a strategy configuration.""" - - extraction: ModifyExtractionConfiguration | None = None - """The updated extraction configuration.""" - - consolidation: ModifyConsolidationConfiguration | None = None - """The updated consolidation configuration.""" - - reflection: ModifyReflectionConfiguration | None = None - """The updated reflection configuration.""" - - self_managed_configuration: ModifySelfManagedConfiguration | None = None - """The updated self-managed configuration.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MODIFY_STRATEGY_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.extraction is not None: - serializer.write_struct( - _SCHEMA_MODIFY_STRATEGY_CONFIGURATION.members["extraction"], - self.extraction, - ) - - if self.consolidation is not None: - serializer.write_struct( - _SCHEMA_MODIFY_STRATEGY_CONFIGURATION.members["consolidation"], - self.consolidation, - ) - - if self.reflection is not None: - serializer.write_struct( - _SCHEMA_MODIFY_STRATEGY_CONFIGURATION.members["reflection"], - self.reflection, - ) - - if self.self_managed_configuration is not None: - serializer.write_struct( - _SCHEMA_MODIFY_STRATEGY_CONFIGURATION.members[ - "selfManagedConfiguration" - ], - self.self_managed_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["extraction"] = ( - _ModifyExtractionConfigurationDeserializer().deserialize(de) - ) - - case 1: - kwargs["consolidation"] = ( - _ModifyConsolidationConfigurationDeserializer().deserialize(de) - ) - - case 2: - kwargs["reflection"] = ( - _ModifyReflectionConfigurationDeserializer().deserialize(de) - ) - - case 3: - kwargs["self_managed_configuration"] = ( - ModifySelfManagedConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MODIFY_STRATEGY_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ModifyMemoryStrategyInput: - """Input for modifying a memory strategy.""" - - memory_strategy_id: str - """The unique identifier of the memory strategy to modify.""" - - description: str | None = field(repr=False, default=None) - """The updated description of the memory strategy.""" - - namespaces: list[str] | None = None - """ - This is a legacy parameter, use `namespaceTemplates`. The updated - namespaces for the memory strategy. - """ - - namespace_templates: list[str] | None = None - """The updated namespaceTemplates for the memory strategy.""" - - configuration: ModifyStrategyConfiguration | None = None - """The updated configuration for the memory strategy.""" - - memory_record_schema: MemoryRecordSchema | None = None - """Updated metadata schema for records generated by this strategy.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MODIFY_MEMORY_STRATEGY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MODIFY_MEMORY_STRATEGY_INPUT.members["memoryStrategyId"], - self.memory_strategy_id, - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_MODIFY_MEMORY_STRATEGY_INPUT.members["description"], - self.description, - ) - - if self.namespaces is not None: - _serialize_namespaces_list( - serializer, - _SCHEMA_MODIFY_MEMORY_STRATEGY_INPUT.members["namespaces"], - self.namespaces, - ) - - if self.namespace_templates is not None: - _serialize_namespaces_list( - serializer, - _SCHEMA_MODIFY_MEMORY_STRATEGY_INPUT.members["namespaceTemplates"], - self.namespace_templates, - ) - - if self.configuration is not None: - serializer.write_struct( - _SCHEMA_MODIFY_MEMORY_STRATEGY_INPUT.members["configuration"], - self.configuration, - ) - - if self.memory_record_schema is not None: - serializer.write_struct( - _SCHEMA_MODIFY_MEMORY_STRATEGY_INPUT.members["memoryRecordSchema"], - self.memory_record_schema, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["memory_strategy_id"] = de.read_string( - _SCHEMA_MODIFY_MEMORY_STRATEGY_INPUT.members["memoryStrategyId"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_MODIFY_MEMORY_STRATEGY_INPUT.members["description"] - ) - - case 2: - kwargs["namespaces"] = _deserialize_namespaces_list( - de, _SCHEMA_MODIFY_MEMORY_STRATEGY_INPUT.members["namespaces"] - ) - - case 3: - kwargs["namespace_templates"] = _deserialize_namespaces_list( - de, - _SCHEMA_MODIFY_MEMORY_STRATEGY_INPUT.members[ - "namespaceTemplates" - ], - ) - - case 4: - kwargs["configuration"] = ModifyStrategyConfiguration.deserialize( - de - ) - - case 5: - kwargs["memory_record_schema"] = MemoryRecordSchema.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MODIFY_MEMORY_STRATEGY_INPUT, consumer=_consumer - ) - if "memory_strategy_id" not in kwargs: - kwargs["memory_strategy_id"] = "" - return kwargs - - -def _serialize_modify_memory_strategies_list( - serializer: ShapeSerializer, schema: Schema, value: list[ModifyMemoryStrategyInput] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_modify_memory_strategies_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ModifyMemoryStrategyInput]: - result: list[ModifyMemoryStrategyInput] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ModifyMemoryStrategyInput.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ModifyMemoryStrategies: - """Contains information for modifying memory strategies.""" - - add_memory_strategies: list[MemoryStrategyInput] | None = None - """The list of memory strategies to add.""" - - modify_memory_strategies: list[ModifyMemoryStrategyInput] | None = None - """The list of memory strategies to modify.""" - - delete_memory_strategies: list[DeleteMemoryStrategyInput] | None = None - """The list of memory strategies to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MODIFY_MEMORY_STRATEGIES, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.add_memory_strategies is not None: - _serialize_memory_strategy_input_list( - serializer, - _SCHEMA_MODIFY_MEMORY_STRATEGIES.members["addMemoryStrategies"], - self.add_memory_strategies, - ) - - if self.modify_memory_strategies is not None: - _serialize_modify_memory_strategies_list( - serializer, - _SCHEMA_MODIFY_MEMORY_STRATEGIES.members["modifyMemoryStrategies"], - self.modify_memory_strategies, - ) - - if self.delete_memory_strategies is not None: - _serialize_delete_memory_strategies_list( - serializer, - _SCHEMA_MODIFY_MEMORY_STRATEGIES.members["deleteMemoryStrategies"], - self.delete_memory_strategies, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["add_memory_strategies"] = ( - _deserialize_memory_strategy_input_list( - de, - _SCHEMA_MODIFY_MEMORY_STRATEGIES.members[ - "addMemoryStrategies" - ], - ) - ) - - case 1: - kwargs["modify_memory_strategies"] = ( - _deserialize_modify_memory_strategies_list( - de, - _SCHEMA_MODIFY_MEMORY_STRATEGIES.members[ - "modifyMemoryStrategies" - ], - ) - ) - - case 2: - kwargs["delete_memory_strategies"] = ( - _deserialize_delete_memory_strategies_list( - de, - _SCHEMA_MODIFY_MEMORY_STRATEGIES.members[ - "deleteMemoryStrategies" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MODIFY_MEMORY_STRATEGIES, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateMemoryInput: - """Dataclass for UpdateMemoryInput structure.""" - - client_token: str | None = None - """ - A client token is used for keeping track of idempotent requests. It can - contain a session id which can be around 250 chars, combined with a - unique AWS identifier. - """ - - memory_id: str | None = None - """The unique identifier of the memory to update.""" - - description: str | None = field(repr=False, default=None) - """The updated description of the AgentCore Memory resource.""" - - event_expiry_duration: int | None = None - """ - The number of days after which memory events will expire, between 7 and - 365 days. - """ - - memory_execution_role_arn: str | None = None - """ - The ARN of the IAM role that provides permissions for the AgentCore - Memory resource. - """ - - memory_strategies: ModifyMemoryStrategies | None = None - """The memory strategies to add, modify, or delete.""" - - add_indexed_keys: list[IndexedKey] | None = None - """ - Additional metadata keys to index. Previously indexed keys cannot be - removed. - """ - - namespace_keys: list[NamespaceKeyEntry] | None = None - """ - The namespace variable key definitions with validation rules for this - memory. This value fully replaces the existing set --- any key you omit - is removed. Any referenced `namespaceKey` omission will throw - ValidationException. - """ - - stream_delivery_resources: StreamDeliveryResources | None = None - """Configuration for streaming memory record data to external resources.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_MEMORY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.client_token is not None: - serializer.write_string( - _SCHEMA_UPDATE_MEMORY_INPUT.members["clientToken"], self.client_token - ) - - if self.memory_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_MEMORY_INPUT.members["memoryId"], self.memory_id - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_MEMORY_INPUT.members["description"], self.description - ) - - if self.event_expiry_duration is not None: - serializer.write_integer( - _SCHEMA_UPDATE_MEMORY_INPUT.members["eventExpiryDuration"], - self.event_expiry_duration, - ) - - if self.memory_execution_role_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_MEMORY_INPUT.members["memoryExecutionRoleArn"], - self.memory_execution_role_arn, - ) - - if self.memory_strategies is not None: - serializer.write_struct( - _SCHEMA_UPDATE_MEMORY_INPUT.members["memoryStrategies"], - self.memory_strategies, - ) - - if self.add_indexed_keys is not None: - _serialize_indexed_keys_list( - serializer, - _SCHEMA_UPDATE_MEMORY_INPUT.members["addIndexedKeys"], - self.add_indexed_keys, - ) - - if self.namespace_keys is not None: - _serialize_namespace_keys_list( - serializer, - _SCHEMA_UPDATE_MEMORY_INPUT.members["namespaceKeys"], - self.namespace_keys, - ) - - if self.stream_delivery_resources is not None: - serializer.write_struct( - _SCHEMA_UPDATE_MEMORY_INPUT.members["streamDeliveryResources"], - self.stream_delivery_resources, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["client_token"] = de.read_string( - _SCHEMA_UPDATE_MEMORY_INPUT.members["clientToken"] - ) - - case 1: - kwargs["memory_id"] = de.read_string( - _SCHEMA_UPDATE_MEMORY_INPUT.members["memoryId"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_MEMORY_INPUT.members["description"] - ) - - case 3: - kwargs["event_expiry_duration"] = de.read_integer( - _SCHEMA_UPDATE_MEMORY_INPUT.members["eventExpiryDuration"] - ) - - case 4: - kwargs["memory_execution_role_arn"] = de.read_string( - _SCHEMA_UPDATE_MEMORY_INPUT.members["memoryExecutionRoleArn"] - ) - - case 5: - kwargs["memory_strategies"] = ModifyMemoryStrategies.deserialize(de) - - case 6: - kwargs["add_indexed_keys"] = _deserialize_indexed_keys_list( - de, _SCHEMA_UPDATE_MEMORY_INPUT.members["addIndexedKeys"] - ) - - case 7: - kwargs["namespace_keys"] = _deserialize_namespace_keys_list( - de, _SCHEMA_UPDATE_MEMORY_INPUT.members["namespaceKeys"] - ) - - case 8: - kwargs["stream_delivery_resources"] = ( - StreamDeliveryResources.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_MEMORY_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateMemoryOutput: - """Dataclass for UpdateMemoryOutput structure.""" - - memory: Memory | None = None - """The updated AgentCore Memory resource details.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_MEMORY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.memory is not None: - serializer.write_struct( - _SCHEMA_UPDATE_MEMORY_OUTPUT.members["memory"], self.memory - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["memory"] = Memory.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_MEMORY_OUTPUT, consumer=_consumer) - return kwargs - - -UPDATE_MEMORY = APIOperation( - input=UpdateMemoryInput, - output=UpdateMemoryOutput, - schema=_SCHEMA_UPDATE_MEMORY, - input_schema=_SCHEMA_UPDATE_MEMORY_INPUT, - output_schema=_SCHEMA_UPDATE_MEMORY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceException" - ): ServiceException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottledException" - ): ThrottledException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class CredentialProviderVendorType(UnknownEnumMixin, StrEnum): - GOOGLE_OAUTH2 = "GoogleOauth2" - GITHUB_OAUTH2 = "GithubOauth2" - SLACK_OAUTH2 = "SlackOauth2" - SALESFORCE_OAUTH2 = "SalesforceOauth2" - MICROSOFT_OAUTH2 = "MicrosoftOauth2" - CUSTOM_OAUTH2 = "CustomOauth2" - ATLASSIAN_OAUTH2 = "AtlassianOauth2" - LINKEDIN_OAUTH2 = "LinkedinOauth2" - X_OAUTH2 = "XOauth2" - OKTA_OAUTH2 = "OktaOauth2" - ONE_LOGIN_OAUTH2 = "OneLoginOauth2" - PING_ONE_OAUTH2 = "PingOneOauth2" - FACEBOOK_OAUTH2 = "FacebookOauth2" - YANDEX_OAUTH2 = "YandexOauth2" - REDDIT_OAUTH2 = "RedditOauth2" - ZOOM_OAUTH2 = "ZoomOauth2" - TWITCH_OAUTH2 = "TwitchOauth2" - SPOTIFY_OAUTH2 = "SpotifyOauth2" - DROPBOX_OAUTH2 = "DropboxOauth2" - NOTION_OAUTH2 = "NotionOauth2" - HUBSPOT_OAUTH2 = "HubspotOauth2" - CYBER_ARK_OAUTH2 = "CyberArkOauth2" - FUSION_AUTH_OAUTH2 = "FusionAuthOauth2" - AUTH0_OAUTH2 = "Auth0Oauth2" - COGNITO_OAUTH2 = "CognitoOauth2" - - -@dataclass(kw_only=True) -class AtlassianOauth2ProviderConfigInput: - """ - Configuration settings for connecting to Atlassian services using OAuth2 - authentication. This includes the client credentials required to - authenticate with Atlassian's OAuth2 authorization server. - """ - - client_id: str - """ - The client ID for the Atlassian OAuth2 provider. This identifier is - assigned by Atlassian when you register your application. - """ - - client_secret: str = field(repr=False, default="") - """ - The client secret for the Atlassian OAuth2 provider. This secret is - assigned by Atlassian and used along with the client ID to authenticate - your application. - """ - - client_secret_config: SecretReference | None = None - """ - A reference to the Amazon Web Services Secrets Manager secret that - stores the client secret. This includes the secret ID and the JSON key - used to extract the client secret value from the secret. Required when - `clientSecretSource` is set to `EXTERNAL`. - """ - - client_secret_source: str | None = None - """ - The source type of the client secret for the Atlassian OAuth2 provider. - Use `MANAGED` if the secret is managed by the service, or `EXTERNAL` if - you manage the secret yourself in Amazon Web Services Secrets Manager. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ATLASSIAN_OAUTH2_PROVIDER_CONFIG_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_ATLASSIAN_OAUTH2_PROVIDER_CONFIG_INPUT.members["clientId"], - self.client_id, - ) - serializer.write_string( - _SCHEMA_ATLASSIAN_OAUTH2_PROVIDER_CONFIG_INPUT.members["clientSecret"], - self.client_secret, - ) - if self.client_secret_config is not None: - serializer.write_struct( - _SCHEMA_ATLASSIAN_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "clientSecretConfig" - ], - self.client_secret_config, - ) - - if self.client_secret_source is not None: - serializer.write_string( - _SCHEMA_ATLASSIAN_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "clientSecretSource" - ], - self.client_secret_source, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["client_id"] = de.read_string( - _SCHEMA_ATLASSIAN_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "clientId" - ] - ) - - case 1: - kwargs["client_secret"] = de.read_string( - _SCHEMA_ATLASSIAN_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "clientSecret" - ] - ) - - case 2: - kwargs["client_secret_config"] = SecretReference.deserialize(de) - - case 3: - kwargs["client_secret_source"] = SecretSourceType( - de.read_string( - _SCHEMA_ATLASSIAN_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "clientSecretSource" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ATLASSIAN_OAUTH2_PROVIDER_CONFIG_INPUT, consumer=_consumer - ) - if "client_id" not in kwargs: - kwargs["client_id"] = "" - return kwargs - - -class ClientAuthenticationMethodType(UnknownEnumMixin, StrEnum): - CLIENT_SECRET_BASIC = "CLIENT_SECRET_BASIC" - CLIENT_SECRET_POST = "CLIENT_SECRET_POST" - AWS_IAM_ID_TOKEN_JWT = "AWS_IAM_ID_TOKEN_JWT" - PRIVATE_KEY_JWT = "PRIVATE_KEY_JWT" - - -def _serialize_response_list_type( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_response_list_type( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_token_endpoint_auth_methods_type( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_token_endpoint_auth_methods_type( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class Oauth2AuthorizationServerMetadata: - """Contains the authorization server metadata for an OAuth2 provider.""" - - issuer: str - """The issuer URL for the OAuth2 authorization server.""" - - authorization_endpoint: str - """The authorization endpoint URL for the OAuth2 authorization server.""" - - token_endpoint: str - """The token endpoint URL for the OAuth2 authorization server.""" - - response_types: list[str] | None = None - """The supported response types for the OAuth2 authorization server.""" - - token_endpoint_auth_methods: list[str] | None = None - """ - The authentication methods supported by the token endpoint. This - specifies how clients can authenticate when requesting tokens from the - authorization server. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OAUTH2_AUTHORIZATION_SERVER_METADATA, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_OAUTH2_AUTHORIZATION_SERVER_METADATA.members["issuer"], self.issuer - ) - serializer.write_string( - _SCHEMA_OAUTH2_AUTHORIZATION_SERVER_METADATA.members[ - "authorizationEndpoint" - ], - self.authorization_endpoint, - ) - serializer.write_string( - _SCHEMA_OAUTH2_AUTHORIZATION_SERVER_METADATA.members["tokenEndpoint"], - self.token_endpoint, - ) - if self.response_types is not None: - _serialize_response_list_type( - serializer, - _SCHEMA_OAUTH2_AUTHORIZATION_SERVER_METADATA.members["responseTypes"], - self.response_types, - ) - - if self.token_endpoint_auth_methods is not None: - _serialize_token_endpoint_auth_methods_type( - serializer, - _SCHEMA_OAUTH2_AUTHORIZATION_SERVER_METADATA.members[ - "tokenEndpointAuthMethods" - ], - self.token_endpoint_auth_methods, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["issuer"] = de.read_string( - _SCHEMA_OAUTH2_AUTHORIZATION_SERVER_METADATA.members["issuer"] - ) - - case 1: - kwargs["authorization_endpoint"] = de.read_string( - _SCHEMA_OAUTH2_AUTHORIZATION_SERVER_METADATA.members[ - "authorizationEndpoint" - ] - ) - - case 2: - kwargs["token_endpoint"] = de.read_string( - _SCHEMA_OAUTH2_AUTHORIZATION_SERVER_METADATA.members[ - "tokenEndpoint" - ] - ) - - case 3: - kwargs["response_types"] = _deserialize_response_list_type( - de, - _SCHEMA_OAUTH2_AUTHORIZATION_SERVER_METADATA.members[ - "responseTypes" - ], - ) - - case 4: - kwargs["token_endpoint_auth_methods"] = ( - _deserialize_token_endpoint_auth_methods_type( - de, - _SCHEMA_OAUTH2_AUTHORIZATION_SERVER_METADATA.members[ - "tokenEndpointAuthMethods" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_OAUTH2_AUTHORIZATION_SERVER_METADATA, consumer=_consumer - ) - if "issuer" not in kwargs: - kwargs["issuer"] = "" - if "authorization_endpoint" not in kwargs: - kwargs["authorization_endpoint"] = "" - if "token_endpoint" not in kwargs: - kwargs["token_endpoint"] = "" - return kwargs - - -@dataclass -class Oauth2DiscoveryDiscoveryUrl: - """The discovery URL for the OAuth2 provider.""" - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OAUTH2_DISCOVERY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_OAUTH2_DISCOVERY.members["discoveryUrl"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string( - _SCHEMA_OAUTH2_DISCOVERY.members["discoveryUrl"] - ) - ) - - -@dataclass -class Oauth2DiscoveryAuthorizationServerMetadata: - """The authorization server metadata for the OAuth2 provider.""" - - value: Oauth2AuthorizationServerMetadata - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OAUTH2_DISCOVERY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_OAUTH2_DISCOVERY.members["authorizationServerMetadata"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=Oauth2AuthorizationServerMetadata.deserialize(deserializer)) - - -@dataclass -class Oauth2DiscoveryUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -Oauth2Discovery = Union[ - Oauth2DiscoveryDiscoveryUrl - | Oauth2DiscoveryAuthorizationServerMetadata - | Oauth2DiscoveryUnknown -] -"""Contains the discovery information for an OAuth2 provider.""" - - -class _Oauth2DiscoveryDeserializer: - _result: Oauth2Discovery | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> Oauth2Discovery: - self._result = None - deserializer.read_struct(_SCHEMA_OAUTH2_DISCOVERY, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(Oauth2DiscoveryDiscoveryUrl.deserialize(de)) - - case 1: - self._set_result( - Oauth2DiscoveryAuthorizationServerMetadata.deserialize(de) - ) - - case _: - self._set_result( - Oauth2DiscoveryUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: Oauth2Discovery) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class OnBehalfOfTokenExchangeGrantTypeType(UnknownEnumMixin, StrEnum): - TOKEN_EXCHANGE = "TOKEN_EXCHANGE" - """ - RFC 8693 token exchange, adopted by the majority of identity providers - supporting on-behalf-of flows. - """ - JWT_AUTHORIZATION_GRANT = "JWT_AUTHORIZATION_GRANT" - """RFC 7523 JWT authorization grant, adopted by Microsoft Entra ID.""" - - -def _serialize_scopes_list_type( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_scopes_list_type( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class TokenExchangeGrantTypeConfigType: - """Configuration for RFC 8693 token exchange.""" - - actor_token_content: str - """The content type for the actor token in the token exchange.""" - - actor_token_scopes: list[str] | None = None - """ - The scopes for the actor token. Only valid when actorTokenContent is - M2M. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOKEN_EXCHANGE_GRANT_TYPE_CONFIG_TYPE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_TOKEN_EXCHANGE_GRANT_TYPE_CONFIG_TYPE.members["actorTokenContent"], - self.actor_token_content, - ) - if self.actor_token_scopes is not None: - _serialize_scopes_list_type( - serializer, - _SCHEMA_TOKEN_EXCHANGE_GRANT_TYPE_CONFIG_TYPE.members[ - "actorTokenScopes" - ], - self.actor_token_scopes, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["actor_token_content"] = ActorTokenContentType( - de.read_string( - _SCHEMA_TOKEN_EXCHANGE_GRANT_TYPE_CONFIG_TYPE.members[ - "actorTokenContent" - ] - ) - ) - - case 1: - kwargs["actor_token_scopes"] = _deserialize_scopes_list_type( - de, - _SCHEMA_TOKEN_EXCHANGE_GRANT_TYPE_CONFIG_TYPE.members[ - "actorTokenScopes" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_TOKEN_EXCHANGE_GRANT_TYPE_CONFIG_TYPE, consumer=_consumer - ) - if "actor_token_content" not in kwargs: - kwargs["actor_token_content"] = ActorTokenContentType._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class OnBehalfOfTokenExchangeConfigType: - """Configuration for on-behalf-of token exchange.""" - - grant_type: str - """The grant type for the on-behalf-of token exchange.""" - - token_exchange_grant_type_config: TokenExchangeGrantTypeConfigType | None = None - """Configuration specific to the TOKEN_EXCHANGE grant type (RFC 8693).""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ON_BEHALF_OF_TOKEN_EXCHANGE_CONFIG_TYPE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_ON_BEHALF_OF_TOKEN_EXCHANGE_CONFIG_TYPE.members["grantType"], - self.grant_type, - ) - if self.token_exchange_grant_type_config is not None: - serializer.write_struct( - _SCHEMA_ON_BEHALF_OF_TOKEN_EXCHANGE_CONFIG_TYPE.members[ - "tokenExchangeGrantTypeConfig" - ], - self.token_exchange_grant_type_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["grant_type"] = OnBehalfOfTokenExchangeGrantTypeType( - de.read_string( - _SCHEMA_ON_BEHALF_OF_TOKEN_EXCHANGE_CONFIG_TYPE.members[ - "grantType" - ] - ) - ) - - case 1: - kwargs["token_exchange_grant_type_config"] = ( - TokenExchangeGrantTypeConfigType.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ON_BEHALF_OF_TOKEN_EXCHANGE_CONFIG_TYPE, consumer=_consumer - ) - if "grant_type" not in kwargs: - kwargs["grant_type"] = OnBehalfOfTokenExchangeGrantTypeType._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class KmsKeySourceType: - """Contains the KMS key configuration for a JWT client assertion.""" - - kms_key_arn: str - """ - The Amazon Resource Name (ARN) of the KMS key used to sign the JWT - client assertion. The key must be an asymmetric key with key usage - SIGN_VERIFY and a key spec compatible with the configured signing - algorithm. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KMS_KEY_SOURCE_TYPE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_KMS_KEY_SOURCE_TYPE.members["kmsKeyArn"], self.kms_key_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_KMS_KEY_SOURCE_TYPE.members["kmsKeyArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_KMS_KEY_SOURCE_TYPE, consumer=_consumer) - if "kms_key_arn" not in kwargs: - kwargs["kms_key_arn"] = "" - return kwargs - - -@dataclass -class PrivateKeySourceKmsKeySource: - """The KMS key source for the JWT client assertion.""" - - value: KmsKeySourceType - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PRIVATE_KEY_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_PRIVATE_KEY_SOURCE.members["kmsKeySource"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=KmsKeySourceType.deserialize(deserializer)) - - -@dataclass -class PrivateKeySourceUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -PrivateKeySource = Union[PrivateKeySourceKmsKeySource | PrivateKeySourceUnknown] -""" -Contains the private key source configuration for a JWT client -assertion. -""" - - -class _PrivateKeySourceDeserializer: - _result: PrivateKeySource | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> PrivateKeySource: - self._result = None - deserializer.read_struct(_SCHEMA_PRIVATE_KEY_SOURCE, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(PrivateKeySourceKmsKeySource.deserialize(de)) - - case _: - self._set_result( - PrivateKeySourceUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: PrivateKeySource) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class SigningAlgorithm(UnknownEnumMixin, StrEnum): - RS256 = "RS256" - PS256 = "PS256" - ES256 = "ES256" - - -@dataclass(kw_only=True) -class PrivateKeyJwtConfig: - """The private key configuration for private_key_jwt client authentication.""" - - private_key_source: PrivateKeySource | None = None - """The private key source for the JWT client assertion.""" - - signing_algorithm: str | None = None - """ - The algorithm used to sign the JWT client assertion. Valid values are - `RS256`, `PS256`, and `ES256`. - """ - - additional_header_claims: dict[str, str] | None = None - """ - A map of additional claims to include in the JWT client assertion - header. Standard header claims such as `alg` and `typ` cannot be added. - """ - - additional_payload_claims: dict[str, str] | None = None - """ - A map of additional claims to include in the JWT client assertion - payload. Payload claims generated by the service, such as `iss`, `sub`, - `jti`, and `exp`, cannot be added. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PRIVATE_KEY_JWT_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.private_key_source is not None: - serializer.write_struct( - _SCHEMA_PRIVATE_KEY_JWT_CONFIG.members["privateKeySource"], - self.private_key_source, - ) - - if self.signing_algorithm is not None: - serializer.write_string( - _SCHEMA_PRIVATE_KEY_JWT_CONFIG.members["signingAlgorithm"], - self.signing_algorithm, - ) - - if self.additional_header_claims is not None: - _serialize_additional_claims( - serializer, - _SCHEMA_PRIVATE_KEY_JWT_CONFIG.members["additionalHeaderClaims"], - self.additional_header_claims, - ) - - if self.additional_payload_claims is not None: - _serialize_additional_claims( - serializer, - _SCHEMA_PRIVATE_KEY_JWT_CONFIG.members["additionalPayloadClaims"], - self.additional_payload_claims, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["private_key_source"] = ( - _PrivateKeySourceDeserializer().deserialize(de) - ) - - case 1: - kwargs["signing_algorithm"] = SigningAlgorithm( - de.read_string( - _SCHEMA_PRIVATE_KEY_JWT_CONFIG.members["signingAlgorithm"] - ) - ) - - case 2: - kwargs["additional_header_claims"] = _deserialize_additional_claims( - de, - _SCHEMA_PRIVATE_KEY_JWT_CONFIG.members[ - "additionalHeaderClaims" - ], - ) - - case 3: - kwargs["additional_payload_claims"] = ( - _deserialize_additional_claims( - de, - _SCHEMA_PRIVATE_KEY_JWT_CONFIG.members[ - "additionalPayloadClaims" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PRIVATE_KEY_JWT_CONFIG, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CustomOauth2ProviderConfigInput: - """Input configuration for a custom OAuth2 provider.""" - - oauth_discovery: Oauth2Discovery - """The OAuth2 discovery information for the custom provider.""" - - client_id: str = "" - """The client ID for the custom OAuth2 provider.""" - - client_secret: str = field(repr=False, default="") - """The client secret for the custom OAuth2 provider.""" - - client_secret_config: SecretReference | None = None - """ - A reference to the Amazon Web Services Secrets Manager secret that - stores the client secret. This includes the secret ID and the JSON key - used to extract the client secret value from the secret. Required when - `clientSecretSource` is set to `EXTERNAL`. - """ - - client_secret_source: str | None = None - """ - The source type of the client secret. Use `MANAGED` if the secret is - managed by the service, or `EXTERNAL` if you manage the secret yourself - in Amazon Web Services Secrets Manager. - """ - - on_behalf_of_token_exchange_config: OnBehalfOfTokenExchangeConfigType | None = None - """ - The configuration for on-behalf-of token exchange. This enables - authentication flows that use RFC 8693 token exchange or RFC 7523 JWT - authorization grants. - """ - - client_authentication_method: str | None = None - """ - The client authentication method to use when authenticating with the - token endpoint. - """ - - private_key_jwt_config: PrivateKeyJwtConfig | None = None - """ - The private_key_jwt client authentication configuration for this - credential provider. When specified, the credential provider uses JWT - client assertions to authenticate with the token endpoint. - """ - - private_endpoint: PrivateEndpoint | None = None - """ - The default private endpoint for the custom OAuth2 provider, enabling - secure connectivity through a VPC Lattice resource configuration. - """ - - private_endpoint_overrides: list[PrivateEndpointOverride] | None = None - """ - The private endpoint overrides for the custom OAuth2 provider - configuration. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOM_OAUTH2_PROVIDER_CONFIG_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CUSTOM_OAUTH2_PROVIDER_CONFIG_INPUT.members["oauthDiscovery"], - self.oauth_discovery, - ) - serializer.write_string( - _SCHEMA_CUSTOM_OAUTH2_PROVIDER_CONFIG_INPUT.members["clientId"], - self.client_id, - ) - serializer.write_string( - _SCHEMA_CUSTOM_OAUTH2_PROVIDER_CONFIG_INPUT.members["clientSecret"], - self.client_secret, - ) - if self.client_secret_config is not None: - serializer.write_struct( - _SCHEMA_CUSTOM_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "clientSecretConfig" - ], - self.client_secret_config, - ) - - if self.client_secret_source is not None: - serializer.write_string( - _SCHEMA_CUSTOM_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "clientSecretSource" - ], - self.client_secret_source, - ) - - if self.on_behalf_of_token_exchange_config is not None: - serializer.write_struct( - _SCHEMA_CUSTOM_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "onBehalfOfTokenExchangeConfig" - ], - self.on_behalf_of_token_exchange_config, - ) - - if self.client_authentication_method is not None: - serializer.write_string( - _SCHEMA_CUSTOM_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "clientAuthenticationMethod" - ], - self.client_authentication_method, - ) - - if self.private_key_jwt_config is not None: - serializer.write_struct( - _SCHEMA_CUSTOM_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "privateKeyJwtConfig" - ], - self.private_key_jwt_config, - ) - - if self.private_endpoint is not None: - serializer.write_struct( - _SCHEMA_CUSTOM_OAUTH2_PROVIDER_CONFIG_INPUT.members["privateEndpoint"], - self.private_endpoint, - ) - - if self.private_endpoint_overrides is not None: - _serialize_private_endpoint_overrides( - serializer, - _SCHEMA_CUSTOM_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "privateEndpointOverrides" - ], - self.private_endpoint_overrides, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["oauth_discovery"] = ( - _Oauth2DiscoveryDeserializer().deserialize(de) - ) - - case 1: - kwargs["client_id"] = de.read_string( - _SCHEMA_CUSTOM_OAUTH2_PROVIDER_CONFIG_INPUT.members["clientId"] - ) - - case 2: - kwargs["client_secret"] = de.read_string( - _SCHEMA_CUSTOM_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "clientSecret" - ] - ) - - case 3: - kwargs["client_secret_config"] = SecretReference.deserialize(de) - - case 4: - kwargs["client_secret_source"] = SecretSourceType( - de.read_string( - _SCHEMA_CUSTOM_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "clientSecretSource" - ] - ) - ) - - case 5: - kwargs["on_behalf_of_token_exchange_config"] = ( - OnBehalfOfTokenExchangeConfigType.deserialize(de) - ) - - case 6: - kwargs["client_authentication_method"] = ( - ClientAuthenticationMethodType( - de.read_string( - _SCHEMA_CUSTOM_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "clientAuthenticationMethod" - ] - ) - ) - ) - - case 7: - kwargs["private_key_jwt_config"] = PrivateKeyJwtConfig.deserialize( - de - ) - - case 8: - kwargs["private_endpoint"] = ( - _PrivateEndpointDeserializer().deserialize(de) - ) - - case 9: - kwargs["private_endpoint_overrides"] = ( - _deserialize_private_endpoint_overrides( - de, - _SCHEMA_CUSTOM_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "privateEndpointOverrides" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CUSTOM_OAUTH2_PROVIDER_CONFIG_INPUT, consumer=_consumer - ) - if "oauth_discovery" not in kwargs: - kwargs["oauth_discovery"] = Oauth2DiscoveryUnknown(tag="") - return kwargs - - -@dataclass(kw_only=True) -class GithubOauth2ProviderConfigInput: - """Input configuration for a GitHub OAuth2 provider.""" - - client_id: str - """The client ID for the GitHub OAuth2 provider.""" - - client_secret: str = field(repr=False, default="") - """The client secret for the GitHub OAuth2 provider.""" - - client_secret_config: SecretReference | None = None - """ - A reference to the Amazon Web Services Secrets Manager secret that - stores the client secret. This includes the secret ID and the JSON key - used to extract the client secret value from the secret. Required when - `clientSecretSource` is set to `EXTERNAL`. - """ - - client_secret_source: str | None = None - """ - The source type of the client secret. Use `MANAGED` if the secret is - managed by the service, or `EXTERNAL` if you manage the secret yourself - in Amazon Web Services Secrets Manager. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GITHUB_OAUTH2_PROVIDER_CONFIG_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GITHUB_OAUTH2_PROVIDER_CONFIG_INPUT.members["clientId"], - self.client_id, - ) - serializer.write_string( - _SCHEMA_GITHUB_OAUTH2_PROVIDER_CONFIG_INPUT.members["clientSecret"], - self.client_secret, - ) - if self.client_secret_config is not None: - serializer.write_struct( - _SCHEMA_GITHUB_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "clientSecretConfig" - ], - self.client_secret_config, - ) - - if self.client_secret_source is not None: - serializer.write_string( - _SCHEMA_GITHUB_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "clientSecretSource" - ], - self.client_secret_source, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["client_id"] = de.read_string( - _SCHEMA_GITHUB_OAUTH2_PROVIDER_CONFIG_INPUT.members["clientId"] - ) - - case 1: - kwargs["client_secret"] = de.read_string( - _SCHEMA_GITHUB_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "clientSecret" - ] - ) - - case 2: - kwargs["client_secret_config"] = SecretReference.deserialize(de) - - case 3: - kwargs["client_secret_source"] = SecretSourceType( - de.read_string( - _SCHEMA_GITHUB_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "clientSecretSource" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GITHUB_OAUTH2_PROVIDER_CONFIG_INPUT, consumer=_consumer - ) - if "client_id" not in kwargs: - kwargs["client_id"] = "" - return kwargs - - -@dataclass(kw_only=True) -class GoogleOauth2ProviderConfigInput: - """Input configuration for a Google OAuth2 provider.""" - - client_id: str - """The client ID for the Google OAuth2 provider.""" - - client_secret: str = field(repr=False, default="") - """The client secret for the Google OAuth2 provider.""" - - client_secret_config: SecretReference | None = None - """ - A reference to the Amazon Web Services Secrets Manager secret that - stores the client secret. This includes the secret ID and the JSON key - used to extract the client secret value from the secret. Required when - `clientSecretSource` is set to `EXTERNAL`. - """ - - client_secret_source: str | None = None - """ - The source type of the client secret. Use `MANAGED` if the secret is - managed by the service, or `EXTERNAL` if you manage the secret yourself - in Amazon Web Services Secrets Manager. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GOOGLE_OAUTH2_PROVIDER_CONFIG_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GOOGLE_OAUTH2_PROVIDER_CONFIG_INPUT.members["clientId"], - self.client_id, - ) - serializer.write_string( - _SCHEMA_GOOGLE_OAUTH2_PROVIDER_CONFIG_INPUT.members["clientSecret"], - self.client_secret, - ) - if self.client_secret_config is not None: - serializer.write_struct( - _SCHEMA_GOOGLE_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "clientSecretConfig" - ], - self.client_secret_config, - ) - - if self.client_secret_source is not None: - serializer.write_string( - _SCHEMA_GOOGLE_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "clientSecretSource" - ], - self.client_secret_source, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["client_id"] = de.read_string( - _SCHEMA_GOOGLE_OAUTH2_PROVIDER_CONFIG_INPUT.members["clientId"] - ) - - case 1: - kwargs["client_secret"] = de.read_string( - _SCHEMA_GOOGLE_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "clientSecret" - ] - ) - - case 2: - kwargs["client_secret_config"] = SecretReference.deserialize(de) - - case 3: - kwargs["client_secret_source"] = SecretSourceType( - de.read_string( - _SCHEMA_GOOGLE_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "clientSecretSource" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GOOGLE_OAUTH2_PROVIDER_CONFIG_INPUT, consumer=_consumer - ) - if "client_id" not in kwargs: - kwargs["client_id"] = "" - return kwargs - - -@dataclass(kw_only=True) -class IncludedOauth2ProviderConfigInput: - """ - Configuration settings for connecting to a supported OAuth2 provider. - This includes client credentials and OAuth2 discovery information for - providers that have built-in support. - """ - - client_id: str - """ - The client ID for the supported OAuth2 provider. This identifier is - assigned by the OAuth2 provider when you register your application. - """ - - client_secret: str = field(repr=False, default="") - """ - The client secret for the supported OAuth2 provider. This secret is - assigned by the OAuth2 provider and used along with the client ID to - authenticate your application. - """ - - client_secret_config: SecretReference | None = None - """ - A reference to the Amazon Web Services Secrets Manager secret that - stores the client secret. This includes the secret ID and the JSON key - used to extract the client secret value from the secret. Required when - `clientSecretSource` is set to `EXTERNAL`. - """ - - client_secret_source: str | None = None - """ - The source type of the client secret. Use `MANAGED` if the secret is - managed by the service, or `EXTERNAL` if you manage the secret yourself - in Amazon Web Services Secrets Manager. - """ - - issuer: str | None = None - """ - Token issuer of your isolated OAuth2 application tenant. This URL - identifies the authorization server that issues tokens for this - provider. - """ - - authorization_endpoint: str | None = None - """ - OAuth2 authorization endpoint for your isolated OAuth2 application - tenant. This is where users are redirected to authenticate and authorize - access to their resources. - """ - - token_endpoint: str | None = None - """ - OAuth2 token endpoint for your isolated OAuth2 application tenant. This - is where authorization codes are exchanged for access tokens. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INCLUDED_OAUTH2_PROVIDER_CONFIG_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_INCLUDED_OAUTH2_PROVIDER_CONFIG_INPUT.members["clientId"], - self.client_id, - ) - serializer.write_string( - _SCHEMA_INCLUDED_OAUTH2_PROVIDER_CONFIG_INPUT.members["clientSecret"], - self.client_secret, - ) - if self.client_secret_config is not None: - serializer.write_struct( - _SCHEMA_INCLUDED_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "clientSecretConfig" - ], - self.client_secret_config, - ) - - if self.client_secret_source is not None: - serializer.write_string( - _SCHEMA_INCLUDED_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "clientSecretSource" - ], - self.client_secret_source, - ) - - if self.issuer is not None: - serializer.write_string( - _SCHEMA_INCLUDED_OAUTH2_PROVIDER_CONFIG_INPUT.members["issuer"], - self.issuer, - ) - - if self.authorization_endpoint is not None: - serializer.write_string( - _SCHEMA_INCLUDED_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "authorizationEndpoint" - ], - self.authorization_endpoint, - ) - - if self.token_endpoint is not None: - serializer.write_string( - _SCHEMA_INCLUDED_OAUTH2_PROVIDER_CONFIG_INPUT.members["tokenEndpoint"], - self.token_endpoint, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["client_id"] = de.read_string( - _SCHEMA_INCLUDED_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "clientId" - ] - ) - - case 1: - kwargs["client_secret"] = de.read_string( - _SCHEMA_INCLUDED_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "clientSecret" - ] - ) - - case 2: - kwargs["client_secret_config"] = SecretReference.deserialize(de) - - case 3: - kwargs["client_secret_source"] = SecretSourceType( - de.read_string( - _SCHEMA_INCLUDED_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "clientSecretSource" - ] - ) - ) - - case 4: - kwargs["issuer"] = de.read_string( - _SCHEMA_INCLUDED_OAUTH2_PROVIDER_CONFIG_INPUT.members["issuer"] - ) - - case 5: - kwargs["authorization_endpoint"] = de.read_string( - _SCHEMA_INCLUDED_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "authorizationEndpoint" - ] - ) - - case 6: - kwargs["token_endpoint"] = de.read_string( - _SCHEMA_INCLUDED_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "tokenEndpoint" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INCLUDED_OAUTH2_PROVIDER_CONFIG_INPUT, consumer=_consumer - ) - if "client_id" not in kwargs: - kwargs["client_id"] = "" - return kwargs - - -@dataclass(kw_only=True) -class LinkedinOauth2ProviderConfigInput: - """ - Configuration settings for connecting to LinkedIn services using OAuth2 - authentication. This includes the client credentials required to - authenticate with LinkedIn's OAuth2 authorization server. - """ - - client_id: str - """ - The client ID for the LinkedIn OAuth2 provider. This identifier is - assigned by LinkedIn when you register your application. - """ - - client_secret: str = field(repr=False, default="") - """ - The client secret for the LinkedIn OAuth2 provider. This secret is - assigned by LinkedIn and used along with the client ID to authenticate - your application. - """ - - client_secret_config: SecretReference | None = None - """ - A reference to the Amazon Web Services Secrets Manager secret that - stores the client secret. This includes the secret ID and the JSON key - used to extract the client secret value from the secret. Required when - `clientSecretSource` is set to `EXTERNAL`. - """ - - client_secret_source: str | None = None - """ - The source type of the client secret. Use `MANAGED` if the secret is - managed by the service, or `EXTERNAL` if you manage the secret yourself - in Amazon Web Services Secrets Manager. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LINKEDIN_OAUTH2_PROVIDER_CONFIG_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_LINKEDIN_OAUTH2_PROVIDER_CONFIG_INPUT.members["clientId"], - self.client_id, - ) - serializer.write_string( - _SCHEMA_LINKEDIN_OAUTH2_PROVIDER_CONFIG_INPUT.members["clientSecret"], - self.client_secret, - ) - if self.client_secret_config is not None: - serializer.write_struct( - _SCHEMA_LINKEDIN_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "clientSecretConfig" - ], - self.client_secret_config, - ) - - if self.client_secret_source is not None: - serializer.write_string( - _SCHEMA_LINKEDIN_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "clientSecretSource" - ], - self.client_secret_source, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["client_id"] = de.read_string( - _SCHEMA_LINKEDIN_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "clientId" - ] - ) - - case 1: - kwargs["client_secret"] = de.read_string( - _SCHEMA_LINKEDIN_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "clientSecret" - ] - ) - - case 2: - kwargs["client_secret_config"] = SecretReference.deserialize(de) - - case 3: - kwargs["client_secret_source"] = SecretSourceType( - de.read_string( - _SCHEMA_LINKEDIN_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "clientSecretSource" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LINKEDIN_OAUTH2_PROVIDER_CONFIG_INPUT, consumer=_consumer - ) - if "client_id" not in kwargs: - kwargs["client_id"] = "" - return kwargs - - -@dataclass(kw_only=True) -class MicrosoftOauth2ProviderConfigInput: - """Input configuration for a Microsoft OAuth2 provider.""" - - client_id: str - """The client ID for the Microsoft OAuth2 provider.""" - - client_secret: str = field(repr=False, default="") - """The client secret for the Microsoft OAuth2 provider.""" - - client_secret_config: SecretReference | None = None - """ - A reference to the Amazon Web Services Secrets Manager secret that - stores the client secret. This includes the secret ID and the JSON key - used to extract the client secret value from the secret. Required when - `clientSecretSource` is set to `EXTERNAL`. - """ - - client_secret_source: str | None = None - """ - The source type of the client secret. Use `MANAGED` if the secret is - managed by the service, or `EXTERNAL` if you manage the secret yourself - in Amazon Web Services Secrets Manager. - """ - - tenant_id: str | None = None - """ - The Microsoft Entra ID (formerly Azure AD) tenant ID for your - organization. This identifies the specific tenant within Microsoft's - identity platform where your application is registered. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MICROSOFT_OAUTH2_PROVIDER_CONFIG_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MICROSOFT_OAUTH2_PROVIDER_CONFIG_INPUT.members["clientId"], - self.client_id, - ) - serializer.write_string( - _SCHEMA_MICROSOFT_OAUTH2_PROVIDER_CONFIG_INPUT.members["clientSecret"], - self.client_secret, - ) - if self.client_secret_config is not None: - serializer.write_struct( - _SCHEMA_MICROSOFT_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "clientSecretConfig" - ], - self.client_secret_config, - ) - - if self.client_secret_source is not None: - serializer.write_string( - _SCHEMA_MICROSOFT_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "clientSecretSource" - ], - self.client_secret_source, - ) - - if self.tenant_id is not None: - serializer.write_string( - _SCHEMA_MICROSOFT_OAUTH2_PROVIDER_CONFIG_INPUT.members["tenantId"], - self.tenant_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["client_id"] = de.read_string( - _SCHEMA_MICROSOFT_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "clientId" - ] - ) - - case 1: - kwargs["client_secret"] = de.read_string( - _SCHEMA_MICROSOFT_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "clientSecret" - ] - ) - - case 2: - kwargs["client_secret_config"] = SecretReference.deserialize(de) - - case 3: - kwargs["client_secret_source"] = SecretSourceType( - de.read_string( - _SCHEMA_MICROSOFT_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "clientSecretSource" - ] - ) - ) - - case 4: - kwargs["tenant_id"] = de.read_string( - _SCHEMA_MICROSOFT_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "tenantId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MICROSOFT_OAUTH2_PROVIDER_CONFIG_INPUT, consumer=_consumer - ) - if "client_id" not in kwargs: - kwargs["client_id"] = "" - return kwargs - - -@dataclass(kw_only=True) -class SalesforceOauth2ProviderConfigInput: - """Input configuration for a Salesforce OAuth2 provider.""" - - client_id: str - """The client ID for the Salesforce OAuth2 provider.""" - - client_secret: str = field(repr=False, default="") - """The client secret for the Salesforce OAuth2 provider.""" - - client_secret_config: SecretReference | None = None - """ - A reference to the Amazon Web Services Secrets Manager secret that - stores the client secret. This includes the secret ID and the JSON key - used to extract the client secret value from the secret. Required when - `clientSecretSource` is set to `EXTERNAL`. - """ - - client_secret_source: str | None = None - """ - The source type of the client secret. Use `MANAGED` if the secret is - managed by the service, or `EXTERNAL` if you manage the secret yourself - in Amazon Web Services Secrets Manager. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SALESFORCE_OAUTH2_PROVIDER_CONFIG_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SALESFORCE_OAUTH2_PROVIDER_CONFIG_INPUT.members["clientId"], - self.client_id, - ) - serializer.write_string( - _SCHEMA_SALESFORCE_OAUTH2_PROVIDER_CONFIG_INPUT.members["clientSecret"], - self.client_secret, - ) - if self.client_secret_config is not None: - serializer.write_struct( - _SCHEMA_SALESFORCE_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "clientSecretConfig" - ], - self.client_secret_config, - ) - - if self.client_secret_source is not None: - serializer.write_string( - _SCHEMA_SALESFORCE_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "clientSecretSource" - ], - self.client_secret_source, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["client_id"] = de.read_string( - _SCHEMA_SALESFORCE_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "clientId" - ] - ) - - case 1: - kwargs["client_secret"] = de.read_string( - _SCHEMA_SALESFORCE_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "clientSecret" - ] - ) - - case 2: - kwargs["client_secret_config"] = SecretReference.deserialize(de) - - case 3: - kwargs["client_secret_source"] = SecretSourceType( - de.read_string( - _SCHEMA_SALESFORCE_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "clientSecretSource" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SALESFORCE_OAUTH2_PROVIDER_CONFIG_INPUT, consumer=_consumer - ) - if "client_id" not in kwargs: - kwargs["client_id"] = "" - return kwargs - - -@dataclass(kw_only=True) -class SlackOauth2ProviderConfigInput: - """Input configuration for a Slack OAuth2 provider.""" - - client_id: str - """The client ID for the Slack OAuth2 provider.""" - - client_secret: str = field(repr=False, default="") - """The client secret for the Slack OAuth2 provider.""" - - client_secret_config: SecretReference | None = None - """ - A reference to the Amazon Web Services Secrets Manager secret that - stores the client secret. This includes the secret ID and the JSON key - used to extract the client secret value from the secret. Required when - `clientSecretSource` is set to `EXTERNAL`. - """ - - client_secret_source: str | None = None - """ - The source type of the client secret. Use `MANAGED` if the secret is - managed by the service, or `EXTERNAL` if you manage the secret yourself - in Amazon Web Services Secrets Manager. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SLACK_OAUTH2_PROVIDER_CONFIG_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SLACK_OAUTH2_PROVIDER_CONFIG_INPUT.members["clientId"], - self.client_id, - ) - serializer.write_string( - _SCHEMA_SLACK_OAUTH2_PROVIDER_CONFIG_INPUT.members["clientSecret"], - self.client_secret, - ) - if self.client_secret_config is not None: - serializer.write_struct( - _SCHEMA_SLACK_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "clientSecretConfig" - ], - self.client_secret_config, - ) - - if self.client_secret_source is not None: - serializer.write_string( - _SCHEMA_SLACK_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "clientSecretSource" - ], - self.client_secret_source, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["client_id"] = de.read_string( - _SCHEMA_SLACK_OAUTH2_PROVIDER_CONFIG_INPUT.members["clientId"] - ) - - case 1: - kwargs["client_secret"] = de.read_string( - _SCHEMA_SLACK_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "clientSecret" - ] - ) - - case 2: - kwargs["client_secret_config"] = SecretReference.deserialize(de) - - case 3: - kwargs["client_secret_source"] = SecretSourceType( - de.read_string( - _SCHEMA_SLACK_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "clientSecretSource" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SLACK_OAUTH2_PROVIDER_CONFIG_INPUT, consumer=_consumer - ) - if "client_id" not in kwargs: - kwargs["client_id"] = "" - return kwargs - - -@dataclass -class Oauth2ProviderConfigInputCustomOauth2ProviderConfig: - """The configuration for a custom OAuth2 provider.""" - - value: CustomOauth2ProviderConfigInput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OAUTH2_PROVIDER_CONFIG_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_OAUTH2_PROVIDER_CONFIG_INPUT.members["customOauth2ProviderConfig"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=CustomOauth2ProviderConfigInput.deserialize(deserializer)) - - -@dataclass -class Oauth2ProviderConfigInputGoogleOauth2ProviderConfig: - """The configuration for a Google OAuth2 provider.""" - - value: GoogleOauth2ProviderConfigInput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OAUTH2_PROVIDER_CONFIG_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_OAUTH2_PROVIDER_CONFIG_INPUT.members["googleOauth2ProviderConfig"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=GoogleOauth2ProviderConfigInput.deserialize(deserializer)) - - -@dataclass -class Oauth2ProviderConfigInputGithubOauth2ProviderConfig: - """The configuration for a GitHub OAuth2 provider.""" - - value: GithubOauth2ProviderConfigInput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OAUTH2_PROVIDER_CONFIG_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_OAUTH2_PROVIDER_CONFIG_INPUT.members["githubOauth2ProviderConfig"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=GithubOauth2ProviderConfigInput.deserialize(deserializer)) - - -@dataclass -class Oauth2ProviderConfigInputSlackOauth2ProviderConfig: - """The configuration for a Slack OAuth2 provider.""" - - value: SlackOauth2ProviderConfigInput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OAUTH2_PROVIDER_CONFIG_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_OAUTH2_PROVIDER_CONFIG_INPUT.members["slackOauth2ProviderConfig"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=SlackOauth2ProviderConfigInput.deserialize(deserializer)) - - -@dataclass -class Oauth2ProviderConfigInputSalesforceOauth2ProviderConfig: - """The configuration for a Salesforce OAuth2 provider.""" - - value: SalesforceOauth2ProviderConfigInput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OAUTH2_PROVIDER_CONFIG_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "salesforceOauth2ProviderConfig" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=SalesforceOauth2ProviderConfigInput.deserialize(deserializer)) - - -@dataclass -class Oauth2ProviderConfigInputMicrosoftOauth2ProviderConfig: - """The configuration for a Microsoft OAuth2 provider.""" - - value: MicrosoftOauth2ProviderConfigInput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OAUTH2_PROVIDER_CONFIG_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "microsoftOauth2ProviderConfig" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=MicrosoftOauth2ProviderConfigInput.deserialize(deserializer)) - - -@dataclass -class Oauth2ProviderConfigInputAtlassianOauth2ProviderConfig: - """Configuration settings for Atlassian OAuth2 provider integration.""" - - value: AtlassianOauth2ProviderConfigInput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OAUTH2_PROVIDER_CONFIG_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "atlassianOauth2ProviderConfig" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=AtlassianOauth2ProviderConfigInput.deserialize(deserializer)) - - -@dataclass -class Oauth2ProviderConfigInputLinkedinOauth2ProviderConfig: - """Configuration settings for LinkedIn OAuth2 provider integration.""" - - value: LinkedinOauth2ProviderConfigInput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OAUTH2_PROVIDER_CONFIG_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "linkedinOauth2ProviderConfig" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=LinkedinOauth2ProviderConfigInput.deserialize(deserializer)) - - -@dataclass -class Oauth2ProviderConfigInputIncludedOauth2ProviderConfig: - """ - The configuration for a non-custom OAuth2 provider. This includes - settings for supported OAuth2 providers that have built-in integration - support. - """ - - value: IncludedOauth2ProviderConfigInput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OAUTH2_PROVIDER_CONFIG_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_OAUTH2_PROVIDER_CONFIG_INPUT.members[ - "includedOauth2ProviderConfig" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=IncludedOauth2ProviderConfigInput.deserialize(deserializer)) - - -@dataclass -class Oauth2ProviderConfigInputUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -Oauth2ProviderConfigInput = Union[ - Oauth2ProviderConfigInputCustomOauth2ProviderConfig - | Oauth2ProviderConfigInputGoogleOauth2ProviderConfig - | Oauth2ProviderConfigInputGithubOauth2ProviderConfig - | Oauth2ProviderConfigInputSlackOauth2ProviderConfig - | Oauth2ProviderConfigInputSalesforceOauth2ProviderConfig - | Oauth2ProviderConfigInputMicrosoftOauth2ProviderConfig - | Oauth2ProviderConfigInputAtlassianOauth2ProviderConfig - | Oauth2ProviderConfigInputLinkedinOauth2ProviderConfig - | Oauth2ProviderConfigInputIncludedOauth2ProviderConfig - | Oauth2ProviderConfigInputUnknown -] -"""Contains the input configuration for an OAuth2 provider.""" - - -class _Oauth2ProviderConfigInputDeserializer: - _result: Oauth2ProviderConfigInput | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> Oauth2ProviderConfigInput: - self._result = None - deserializer.read_struct(_SCHEMA_OAUTH2_PROVIDER_CONFIG_INPUT, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - Oauth2ProviderConfigInputCustomOauth2ProviderConfig.deserialize(de) - ) - - case 1: - self._set_result( - Oauth2ProviderConfigInputGoogleOauth2ProviderConfig.deserialize(de) - ) - - case 2: - self._set_result( - Oauth2ProviderConfigInputGithubOauth2ProviderConfig.deserialize(de) - ) - - case 3: - self._set_result( - Oauth2ProviderConfigInputSlackOauth2ProviderConfig.deserialize(de) - ) - - case 4: - self._set_result( - Oauth2ProviderConfigInputSalesforceOauth2ProviderConfig.deserialize( - de - ) - ) - - case 5: - self._set_result( - Oauth2ProviderConfigInputMicrosoftOauth2ProviderConfig.deserialize( - de - ) - ) - - case 6: - self._set_result( - Oauth2ProviderConfigInputAtlassianOauth2ProviderConfig.deserialize( - de - ) - ) - - case 7: - self._set_result( - Oauth2ProviderConfigInputLinkedinOauth2ProviderConfig.deserialize( - de - ) - ) - - case 8: - self._set_result( - Oauth2ProviderConfigInputIncludedOauth2ProviderConfig.deserialize( - de - ) - ) - - case _: - self._set_result( - Oauth2ProviderConfigInputUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: Oauth2ProviderConfigInput) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class CreateOauth2CredentialProviderInput: - """Dataclass for CreateOauth2CredentialProviderInput structure.""" - - name: str | None = None - """ - The name of the OAuth2 credential provider. The name must be unique - within your account. - """ - - credential_provider_vendor: str | None = None - """ - The vendor of the OAuth2 credential provider. This specifies which - OAuth2 implementation to use. - """ - - oauth2_provider_config_input: Oauth2ProviderConfigInput | None = None - """ - The configuration settings for the OAuth2 provider, including client ID, - client secret, and other vendor-specific settings. - """ - - tags: dict[str, str] | None = None - """ - A map of tag keys and values to assign to the OAuth2 credential - provider. Tags enable you to categorize your resources in different - ways, for example, by purpose, owner, or environment. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_OAUTH2_CREDENTIAL_PROVIDER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_OAUTH2_CREDENTIAL_PROVIDER_INPUT.members["name"], - self.name, - ) - - if self.credential_provider_vendor is not None: - serializer.write_string( - _SCHEMA_CREATE_OAUTH2_CREDENTIAL_PROVIDER_INPUT.members[ - "credentialProviderVendor" - ], - self.credential_provider_vendor, - ) - - if self.oauth2_provider_config_input is not None: - serializer.write_struct( - _SCHEMA_CREATE_OAUTH2_CREDENTIAL_PROVIDER_INPUT.members[ - "oauth2ProviderConfigInput" - ], - self.oauth2_provider_config_input, - ) - - if self.tags is not None: - _serialize_tags_map( - serializer, - _SCHEMA_CREATE_OAUTH2_CREDENTIAL_PROVIDER_INPUT.members["tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_OAUTH2_CREDENTIAL_PROVIDER_INPUT.members["name"] - ) - - case 1: - kwargs["credential_provider_vendor"] = CredentialProviderVendorType( - de.read_string( - _SCHEMA_CREATE_OAUTH2_CREDENTIAL_PROVIDER_INPUT.members[ - "credentialProviderVendor" - ] - ) - ) - - case 2: - kwargs["oauth2_provider_config_input"] = ( - _Oauth2ProviderConfigInputDeserializer().deserialize(de) - ) - - case 3: - kwargs["tags"] = _deserialize_tags_map( - de, - _SCHEMA_CREATE_OAUTH2_CREDENTIAL_PROVIDER_INPUT.members["tags"], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_OAUTH2_CREDENTIAL_PROVIDER_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class AtlassianOauth2ProviderConfigOutput: - """ - The configuration details returned for an Atlassian OAuth2 provider, - including the client ID and OAuth2 discovery information. - """ - - oauth_discovery: Oauth2Discovery - """Contains the discovery information for an OAuth2 provider.""" - - client_id: str | None = None - """The client ID for the Atlassian OAuth2 provider.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ATLASSIAN_OAUTH2_PROVIDER_CONFIG_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_ATLASSIAN_OAUTH2_PROVIDER_CONFIG_OUTPUT.members["oauthDiscovery"], - self.oauth_discovery, - ) - if self.client_id is not None: - serializer.write_string( - _SCHEMA_ATLASSIAN_OAUTH2_PROVIDER_CONFIG_OUTPUT.members["clientId"], - self.client_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["oauth_discovery"] = ( - _Oauth2DiscoveryDeserializer().deserialize(de) - ) - - case 1: - kwargs["client_id"] = de.read_string( - _SCHEMA_ATLASSIAN_OAUTH2_PROVIDER_CONFIG_OUTPUT.members[ - "clientId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ATLASSIAN_OAUTH2_PROVIDER_CONFIG_OUTPUT, consumer=_consumer - ) - if "oauth_discovery" not in kwargs: - kwargs["oauth_discovery"] = Oauth2DiscoveryUnknown(tag="") - return kwargs - - -@dataclass(kw_only=True) -class CustomOauth2ProviderConfigOutput: - """Output configuration for a custom OAuth2 provider.""" - - oauth_discovery: Oauth2Discovery - """The OAuth2 discovery information for the custom provider.""" - - client_id: str | None = None - """The client ID for the custom OAuth2 provider.""" - - on_behalf_of_token_exchange_config: OnBehalfOfTokenExchangeConfigType | None = None - """The configuration for on-behalf-of token exchange.""" - - client_authentication_method: str | None = None - """ - The client authentication method used when authenticating with the token - endpoint. - """ - - private_endpoint: PrivateEndpoint | None = None - """ - The default private endpoint for the custom OAuth2 provider, enabling - secure connectivity through a VPC Lattice resource configuration. - """ - - private_endpoint_overrides: list[PrivateEndpointOverride] | None = None - """ - The private endpoint overrides for the custom OAuth2 provider - configuration. - """ - - private_key_jwt_config: PrivateKeyJwtConfig | None = None - """ - The configuration for private_key_jwt client authentication used by this - OAuth2 credential provider. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOM_OAUTH2_PROVIDER_CONFIG_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CUSTOM_OAUTH2_PROVIDER_CONFIG_OUTPUT.members["oauthDiscovery"], - self.oauth_discovery, - ) - if self.client_id is not None: - serializer.write_string( - _SCHEMA_CUSTOM_OAUTH2_PROVIDER_CONFIG_OUTPUT.members["clientId"], - self.client_id, - ) - - if self.on_behalf_of_token_exchange_config is not None: - serializer.write_struct( - _SCHEMA_CUSTOM_OAUTH2_PROVIDER_CONFIG_OUTPUT.members[ - "onBehalfOfTokenExchangeConfig" - ], - self.on_behalf_of_token_exchange_config, - ) - - if self.client_authentication_method is not None: - serializer.write_string( - _SCHEMA_CUSTOM_OAUTH2_PROVIDER_CONFIG_OUTPUT.members[ - "clientAuthenticationMethod" - ], - self.client_authentication_method, - ) - - if self.private_endpoint is not None: - serializer.write_struct( - _SCHEMA_CUSTOM_OAUTH2_PROVIDER_CONFIG_OUTPUT.members["privateEndpoint"], - self.private_endpoint, - ) - - if self.private_endpoint_overrides is not None: - _serialize_private_endpoint_overrides( - serializer, - _SCHEMA_CUSTOM_OAUTH2_PROVIDER_CONFIG_OUTPUT.members[ - "privateEndpointOverrides" - ], - self.private_endpoint_overrides, - ) - - if self.private_key_jwt_config is not None: - serializer.write_struct( - _SCHEMA_CUSTOM_OAUTH2_PROVIDER_CONFIG_OUTPUT.members[ - "privateKeyJwtConfig" - ], - self.private_key_jwt_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["oauth_discovery"] = ( - _Oauth2DiscoveryDeserializer().deserialize(de) - ) - - case 1: - kwargs["client_id"] = de.read_string( - _SCHEMA_CUSTOM_OAUTH2_PROVIDER_CONFIG_OUTPUT.members["clientId"] - ) - - case 2: - kwargs["on_behalf_of_token_exchange_config"] = ( - OnBehalfOfTokenExchangeConfigType.deserialize(de) - ) - - case 3: - kwargs["client_authentication_method"] = ( - ClientAuthenticationMethodType( - de.read_string( - _SCHEMA_CUSTOM_OAUTH2_PROVIDER_CONFIG_OUTPUT.members[ - "clientAuthenticationMethod" - ] - ) - ) - ) - - case 4: - kwargs["private_endpoint"] = ( - _PrivateEndpointDeserializer().deserialize(de) - ) - - case 5: - kwargs["private_endpoint_overrides"] = ( - _deserialize_private_endpoint_overrides( - de, - _SCHEMA_CUSTOM_OAUTH2_PROVIDER_CONFIG_OUTPUT.members[ - "privateEndpointOverrides" - ], - ) - ) - - case 6: - kwargs["private_key_jwt_config"] = PrivateKeyJwtConfig.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CUSTOM_OAUTH2_PROVIDER_CONFIG_OUTPUT, consumer=_consumer - ) - if "oauth_discovery" not in kwargs: - kwargs["oauth_discovery"] = Oauth2DiscoveryUnknown(tag="") - return kwargs - - -@dataclass(kw_only=True) -class GithubOauth2ProviderConfigOutput: - """Output configuration for a GitHub OAuth2 provider.""" - - oauth_discovery: Oauth2Discovery - """The OAuth2 discovery information for the GitHub provider.""" - - client_id: str | None = None - """The client ID for the GitHub OAuth2 provider.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GITHUB_OAUTH2_PROVIDER_CONFIG_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GITHUB_OAUTH2_PROVIDER_CONFIG_OUTPUT.members["oauthDiscovery"], - self.oauth_discovery, - ) - if self.client_id is not None: - serializer.write_string( - _SCHEMA_GITHUB_OAUTH2_PROVIDER_CONFIG_OUTPUT.members["clientId"], - self.client_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["oauth_discovery"] = ( - _Oauth2DiscoveryDeserializer().deserialize(de) - ) - - case 1: - kwargs["client_id"] = de.read_string( - _SCHEMA_GITHUB_OAUTH2_PROVIDER_CONFIG_OUTPUT.members["clientId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GITHUB_OAUTH2_PROVIDER_CONFIG_OUTPUT, consumer=_consumer - ) - if "oauth_discovery" not in kwargs: - kwargs["oauth_discovery"] = Oauth2DiscoveryUnknown(tag="") - return kwargs - - -@dataclass(kw_only=True) -class GoogleOauth2ProviderConfigOutput: - """Output configuration for a Google OAuth2 provider.""" - - oauth_discovery: Oauth2Discovery - """The OAuth2 discovery information for the Google provider.""" - - client_id: str | None = None - """The client ID for the Google OAuth2 provider.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GOOGLE_OAUTH2_PROVIDER_CONFIG_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GOOGLE_OAUTH2_PROVIDER_CONFIG_OUTPUT.members["oauthDiscovery"], - self.oauth_discovery, - ) - if self.client_id is not None: - serializer.write_string( - _SCHEMA_GOOGLE_OAUTH2_PROVIDER_CONFIG_OUTPUT.members["clientId"], - self.client_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["oauth_discovery"] = ( - _Oauth2DiscoveryDeserializer().deserialize(de) - ) - - case 1: - kwargs["client_id"] = de.read_string( - _SCHEMA_GOOGLE_OAUTH2_PROVIDER_CONFIG_OUTPUT.members["clientId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GOOGLE_OAUTH2_PROVIDER_CONFIG_OUTPUT, consumer=_consumer - ) - if "oauth_discovery" not in kwargs: - kwargs["oauth_discovery"] = Oauth2DiscoveryUnknown(tag="") - return kwargs - - -@dataclass(kw_only=True) -class IncludedOauth2ProviderConfigOutput: - """ - The configuration details returned for a supported OAuth2 provider, - including client credentials and OAuth2 discovery information. - """ - - oauth_discovery: Oauth2Discovery - """Contains the discovery information for an OAuth2 provider.""" - - client_id: str | None = None - """The client ID for the supported OAuth2 provider.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INCLUDED_OAUTH2_PROVIDER_CONFIG_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INCLUDED_OAUTH2_PROVIDER_CONFIG_OUTPUT.members["oauthDiscovery"], - self.oauth_discovery, - ) - if self.client_id is not None: - serializer.write_string( - _SCHEMA_INCLUDED_OAUTH2_PROVIDER_CONFIG_OUTPUT.members["clientId"], - self.client_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["oauth_discovery"] = ( - _Oauth2DiscoveryDeserializer().deserialize(de) - ) - - case 1: - kwargs["client_id"] = de.read_string( - _SCHEMA_INCLUDED_OAUTH2_PROVIDER_CONFIG_OUTPUT.members[ - "clientId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INCLUDED_OAUTH2_PROVIDER_CONFIG_OUTPUT, consumer=_consumer - ) - if "oauth_discovery" not in kwargs: - kwargs["oauth_discovery"] = Oauth2DiscoveryUnknown(tag="") - return kwargs - - -@dataclass(kw_only=True) -class LinkedinOauth2ProviderConfigOutput: - """ - The configuration details returned for a LinkedIn OAuth2 provider, - including the client ID and OAuth2 discovery information. - """ - - oauth_discovery: Oauth2Discovery - """Contains the discovery information for an OAuth2 provider.""" - - client_id: str | None = None - """The client ID for the LinkedIn OAuth2 provider.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LINKEDIN_OAUTH2_PROVIDER_CONFIG_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_LINKEDIN_OAUTH2_PROVIDER_CONFIG_OUTPUT.members["oauthDiscovery"], - self.oauth_discovery, - ) - if self.client_id is not None: - serializer.write_string( - _SCHEMA_LINKEDIN_OAUTH2_PROVIDER_CONFIG_OUTPUT.members["clientId"], - self.client_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["oauth_discovery"] = ( - _Oauth2DiscoveryDeserializer().deserialize(de) - ) - - case 1: - kwargs["client_id"] = de.read_string( - _SCHEMA_LINKEDIN_OAUTH2_PROVIDER_CONFIG_OUTPUT.members[ - "clientId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LINKEDIN_OAUTH2_PROVIDER_CONFIG_OUTPUT, consumer=_consumer - ) - if "oauth_discovery" not in kwargs: - kwargs["oauth_discovery"] = Oauth2DiscoveryUnknown(tag="") - return kwargs - - -@dataclass(kw_only=True) -class MicrosoftOauth2ProviderConfigOutput: - """Output configuration for a Microsoft OAuth2 provider.""" - - oauth_discovery: Oauth2Discovery - """The OAuth2 discovery information for the Microsoft provider.""" - - client_id: str | None = None - """The client ID for the Microsoft OAuth2 provider.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MICROSOFT_OAUTH2_PROVIDER_CONFIG_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MICROSOFT_OAUTH2_PROVIDER_CONFIG_OUTPUT.members["oauthDiscovery"], - self.oauth_discovery, - ) - if self.client_id is not None: - serializer.write_string( - _SCHEMA_MICROSOFT_OAUTH2_PROVIDER_CONFIG_OUTPUT.members["clientId"], - self.client_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["oauth_discovery"] = ( - _Oauth2DiscoveryDeserializer().deserialize(de) - ) - - case 1: - kwargs["client_id"] = de.read_string( - _SCHEMA_MICROSOFT_OAUTH2_PROVIDER_CONFIG_OUTPUT.members[ - "clientId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MICROSOFT_OAUTH2_PROVIDER_CONFIG_OUTPUT, consumer=_consumer - ) - if "oauth_discovery" not in kwargs: - kwargs["oauth_discovery"] = Oauth2DiscoveryUnknown(tag="") - return kwargs - - -@dataclass(kw_only=True) -class SalesforceOauth2ProviderConfigOutput: - """Output configuration for a Salesforce OAuth2 provider.""" - - oauth_discovery: Oauth2Discovery - """The OAuth2 discovery information for the Salesforce provider.""" - - client_id: str | None = None - """The client ID for the Salesforce OAuth2 provider.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SALESFORCE_OAUTH2_PROVIDER_CONFIG_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_SALESFORCE_OAUTH2_PROVIDER_CONFIG_OUTPUT.members["oauthDiscovery"], - self.oauth_discovery, - ) - if self.client_id is not None: - serializer.write_string( - _SCHEMA_SALESFORCE_OAUTH2_PROVIDER_CONFIG_OUTPUT.members["clientId"], - self.client_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["oauth_discovery"] = ( - _Oauth2DiscoveryDeserializer().deserialize(de) - ) - - case 1: - kwargs["client_id"] = de.read_string( - _SCHEMA_SALESFORCE_OAUTH2_PROVIDER_CONFIG_OUTPUT.members[ - "clientId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SALESFORCE_OAUTH2_PROVIDER_CONFIG_OUTPUT, consumer=_consumer - ) - if "oauth_discovery" not in kwargs: - kwargs["oauth_discovery"] = Oauth2DiscoveryUnknown(tag="") - return kwargs - - -@dataclass(kw_only=True) -class SlackOauth2ProviderConfigOutput: - """Output configuration for a Slack OAuth2 provider.""" - - oauth_discovery: Oauth2Discovery - """The OAuth2 discovery information for the Slack provider.""" - - client_id: str | None = None - """The client ID for the Slack OAuth2 provider.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SLACK_OAUTH2_PROVIDER_CONFIG_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_SLACK_OAUTH2_PROVIDER_CONFIG_OUTPUT.members["oauthDiscovery"], - self.oauth_discovery, - ) - if self.client_id is not None: - serializer.write_string( - _SCHEMA_SLACK_OAUTH2_PROVIDER_CONFIG_OUTPUT.members["clientId"], - self.client_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["oauth_discovery"] = ( - _Oauth2DiscoveryDeserializer().deserialize(de) - ) - - case 1: - kwargs["client_id"] = de.read_string( - _SCHEMA_SLACK_OAUTH2_PROVIDER_CONFIG_OUTPUT.members["clientId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SLACK_OAUTH2_PROVIDER_CONFIG_OUTPUT, consumer=_consumer - ) - if "oauth_discovery" not in kwargs: - kwargs["oauth_discovery"] = Oauth2DiscoveryUnknown(tag="") - return kwargs - - -@dataclass -class Oauth2ProviderConfigOutputCustomOauth2ProviderConfig: - """The output configuration for a custom OAuth2 provider.""" - - value: CustomOauth2ProviderConfigOutput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OAUTH2_PROVIDER_CONFIG_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_OAUTH2_PROVIDER_CONFIG_OUTPUT.members["customOauth2ProviderConfig"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=CustomOauth2ProviderConfigOutput.deserialize(deserializer)) - - -@dataclass -class Oauth2ProviderConfigOutputGoogleOauth2ProviderConfig: - """The output configuration for a Google OAuth2 provider.""" - - value: GoogleOauth2ProviderConfigOutput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OAUTH2_PROVIDER_CONFIG_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_OAUTH2_PROVIDER_CONFIG_OUTPUT.members["googleOauth2ProviderConfig"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=GoogleOauth2ProviderConfigOutput.deserialize(deserializer)) - - -@dataclass -class Oauth2ProviderConfigOutputGithubOauth2ProviderConfig: - """The output configuration for a GitHub OAuth2 provider.""" - - value: GithubOauth2ProviderConfigOutput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OAUTH2_PROVIDER_CONFIG_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_OAUTH2_PROVIDER_CONFIG_OUTPUT.members["githubOauth2ProviderConfig"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=GithubOauth2ProviderConfigOutput.deserialize(deserializer)) - - -@dataclass -class Oauth2ProviderConfigOutputSlackOauth2ProviderConfig: - """The output configuration for a Slack OAuth2 provider.""" - - value: SlackOauth2ProviderConfigOutput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OAUTH2_PROVIDER_CONFIG_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_OAUTH2_PROVIDER_CONFIG_OUTPUT.members["slackOauth2ProviderConfig"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=SlackOauth2ProviderConfigOutput.deserialize(deserializer)) - - -@dataclass -class Oauth2ProviderConfigOutputSalesforceOauth2ProviderConfig: - """The output configuration for a Salesforce OAuth2 provider.""" - - value: SalesforceOauth2ProviderConfigOutput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OAUTH2_PROVIDER_CONFIG_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_OAUTH2_PROVIDER_CONFIG_OUTPUT.members[ - "salesforceOauth2ProviderConfig" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=SalesforceOauth2ProviderConfigOutput.deserialize(deserializer)) - - -@dataclass -class Oauth2ProviderConfigOutputMicrosoftOauth2ProviderConfig: - """The output configuration for a Microsoft OAuth2 provider.""" - - value: MicrosoftOauth2ProviderConfigOutput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OAUTH2_PROVIDER_CONFIG_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_OAUTH2_PROVIDER_CONFIG_OUTPUT.members[ - "microsoftOauth2ProviderConfig" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=MicrosoftOauth2ProviderConfigOutput.deserialize(deserializer)) - - -@dataclass -class Oauth2ProviderConfigOutputAtlassianOauth2ProviderConfig: - """The configuration details for the Atlassian OAuth2 provider.""" - - value: AtlassianOauth2ProviderConfigOutput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OAUTH2_PROVIDER_CONFIG_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_OAUTH2_PROVIDER_CONFIG_OUTPUT.members[ - "atlassianOauth2ProviderConfig" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=AtlassianOauth2ProviderConfigOutput.deserialize(deserializer)) - - -@dataclass -class Oauth2ProviderConfigOutputLinkedinOauth2ProviderConfig: - """The configuration details for the LinkedIn OAuth2 provider.""" - - value: LinkedinOauth2ProviderConfigOutput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OAUTH2_PROVIDER_CONFIG_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_OAUTH2_PROVIDER_CONFIG_OUTPUT.members[ - "linkedinOauth2ProviderConfig" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=LinkedinOauth2ProviderConfigOutput.deserialize(deserializer)) - - -@dataclass -class Oauth2ProviderConfigOutputIncludedOauth2ProviderConfig: - """ - The configuration for a non-custom OAuth2 provider. This includes the - configuration details for supported OAuth2 providers that have built-in - integration support. - """ - - value: IncludedOauth2ProviderConfigOutput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OAUTH2_PROVIDER_CONFIG_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_OAUTH2_PROVIDER_CONFIG_OUTPUT.members[ - "includedOauth2ProviderConfig" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=IncludedOauth2ProviderConfigOutput.deserialize(deserializer)) - - -@dataclass -class Oauth2ProviderConfigOutputUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -Oauth2ProviderConfigOutput = Union[ - Oauth2ProviderConfigOutputCustomOauth2ProviderConfig - | Oauth2ProviderConfigOutputGoogleOauth2ProviderConfig - | Oauth2ProviderConfigOutputGithubOauth2ProviderConfig - | Oauth2ProviderConfigOutputSlackOauth2ProviderConfig - | Oauth2ProviderConfigOutputSalesforceOauth2ProviderConfig - | Oauth2ProviderConfigOutputMicrosoftOauth2ProviderConfig - | Oauth2ProviderConfigOutputAtlassianOauth2ProviderConfig - | Oauth2ProviderConfigOutputLinkedinOauth2ProviderConfig - | Oauth2ProviderConfigOutputIncludedOauth2ProviderConfig - | Oauth2ProviderConfigOutputUnknown -] -"""Contains the output configuration for an OAuth2 provider.""" - - -class _Oauth2ProviderConfigOutputDeserializer: - _result: Oauth2ProviderConfigOutput | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> Oauth2ProviderConfigOutput: - self._result = None - deserializer.read_struct(_SCHEMA_OAUTH2_PROVIDER_CONFIG_OUTPUT, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - Oauth2ProviderConfigOutputCustomOauth2ProviderConfig.deserialize(de) - ) - - case 1: - self._set_result( - Oauth2ProviderConfigOutputGoogleOauth2ProviderConfig.deserialize(de) - ) - - case 2: - self._set_result( - Oauth2ProviderConfigOutputGithubOauth2ProviderConfig.deserialize(de) - ) - - case 3: - self._set_result( - Oauth2ProviderConfigOutputSlackOauth2ProviderConfig.deserialize(de) - ) - - case 4: - self._set_result( - Oauth2ProviderConfigOutputSalesforceOauth2ProviderConfig.deserialize( - de - ) - ) - - case 5: - self._set_result( - Oauth2ProviderConfigOutputMicrosoftOauth2ProviderConfig.deserialize( - de - ) - ) - - case 6: - self._set_result( - Oauth2ProviderConfigOutputAtlassianOauth2ProviderConfig.deserialize( - de - ) - ) - - case 7: - self._set_result( - Oauth2ProviderConfigOutputLinkedinOauth2ProviderConfig.deserialize( - de - ) - ) - - case 8: - self._set_result( - Oauth2ProviderConfigOutputIncludedOauth2ProviderConfig.deserialize( - de - ) - ) - - case _: - self._set_result( - Oauth2ProviderConfigOutputUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: Oauth2ProviderConfigOutput) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class Status(UnknownEnumMixin, StrEnum): - CREATING = "CREATING" - CREATE_FAILED = "CREATE_FAILED" - UPDATING = "UPDATING" - UPDATE_FAILED = "UPDATE_FAILED" - READY = "READY" - DELETING = "DELETING" - DELETE_FAILED = "DELETE_FAILED" - - -@dataclass(kw_only=True) -class CreateOauth2CredentialProviderOutput: - """Dataclass for CreateOauth2CredentialProviderOutput structure.""" - - client_secret_arn: Secret - """ - The Amazon Resource Name (ARN) of the client secret in Amazon Web - Services Secrets Manager. - """ - - name: str - """The name of the OAuth2 credential provider.""" - - credential_provider_arn: str - """The Amazon Resource Name (ARN) of the OAuth2 credential provider.""" - - client_secret_json_key: str | None = None - """ - The JSON key used to extract the client secret value from the Amazon Web - Services Secrets Manager secret. - """ - - client_secret_source: str | None = None - """ - The source type of the client secret. Either `MANAGED` if the secret is - managed by the service, or `EXTERNAL` if managed by the user in Amazon - Web Services Secrets Manager. - """ - - callback_url: str | None = None - """ - Callback URL to register on the OAuth2 credential provider as an allowed - callback URL. This URL is where the OAuth2 authorization server - redirects users after they complete the authorization flow. - """ - - oauth2_provider_config_output: Oauth2ProviderConfigOutput | None = None - """Contains the output configuration for an OAuth2 provider.""" - - status: str | None = None - """The current status of the OAuth2 credential provider.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CREATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members["clientSecretArn"], - self.client_secret_arn, - ) - if self.client_secret_json_key is not None: - serializer.write_string( - _SCHEMA_CREATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members[ - "clientSecretJsonKey" - ], - self.client_secret_json_key, - ) - - if self.client_secret_source is not None: - serializer.write_string( - _SCHEMA_CREATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members[ - "clientSecretSource" - ], - self.client_secret_source, - ) - - serializer.write_string( - _SCHEMA_CREATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members["name"], self.name - ) - serializer.write_string( - _SCHEMA_CREATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members[ - "credentialProviderArn" - ], - self.credential_provider_arn, - ) - if self.callback_url is not None: - serializer.write_string( - _SCHEMA_CREATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members["callbackUrl"], - self.callback_url, - ) - - if self.oauth2_provider_config_output is not None: - serializer.write_struct( - _SCHEMA_CREATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members[ - "oauth2ProviderConfigOutput" - ], - self.oauth2_provider_config_output, - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_CREATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members["status"], - self.status, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["client_secret_arn"] = Secret.deserialize(de) - - case 1: - kwargs["client_secret_json_key"] = de.read_string( - _SCHEMA_CREATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members[ - "clientSecretJsonKey" - ] - ) - - case 2: - kwargs["client_secret_source"] = SecretSourceType( - de.read_string( - _SCHEMA_CREATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members[ - "clientSecretSource" - ] - ) - ) - - case 3: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members["name"] - ) - - case 4: - kwargs["credential_provider_arn"] = de.read_string( - _SCHEMA_CREATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members[ - "credentialProviderArn" - ] - ) - - case 5: - kwargs["callback_url"] = de.read_string( - _SCHEMA_CREATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members[ - "callbackUrl" - ] - ) - - case 6: - kwargs["oauth2_provider_config_output"] = ( - _Oauth2ProviderConfigOutputDeserializer().deserialize(de) - ) - - case 7: - kwargs["status"] = Status( - de.read_string( - _SCHEMA_CREATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members[ - "status" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT, consumer=_consumer - ) - if "client_secret_arn" not in kwargs: - kwargs["client_secret_arn"] = Secret._smithy_default() - if "name" not in kwargs: - kwargs["name"] = "" - if "credential_provider_arn" not in kwargs: - kwargs["credential_provider_arn"] = "" - return kwargs - - -CREATE_OAUTH2_CREDENTIAL_PROVIDER = APIOperation( - input=CreateOauth2CredentialProviderInput, - output=CreateOauth2CredentialProviderOutput, - schema=_SCHEMA_CREATE_OAUTH2_CREDENTIAL_PROVIDER, - input_schema=_SCHEMA_CREATE_OAUTH2_CREDENTIAL_PROVIDER_INPUT, - output_schema=_SCHEMA_CREATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#DecryptionFailure" - ): DecryptionFailure, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#EncryptionFailure" - ): EncryptionFailure, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceLimitExceededException" - ): ResourceLimitExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#UnauthorizedException" - ): UnauthorizedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_DECRYPTION_FAILURE, - _SCHEMA_ENCRYPTION_FAILURE, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteOauth2CredentialProviderInput: - """Dataclass for DeleteOauth2CredentialProviderInput structure.""" - - name: str | None = None - """The name of the OAuth2 credential provider to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_OAUTH2_CREDENTIAL_PROVIDER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_DELETE_OAUTH2_CREDENTIAL_PROVIDER_INPUT.members["name"], - self.name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_DELETE_OAUTH2_CREDENTIAL_PROVIDER_INPUT.members["name"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_OAUTH2_CREDENTIAL_PROVIDER_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteOauth2CredentialProviderOutput: - """Dataclass for DeleteOauth2CredentialProviderOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT, consumer=_consumer - ) - return kwargs - - -DELETE_OAUTH2_CREDENTIAL_PROVIDER = APIOperation( - input=DeleteOauth2CredentialProviderInput, - output=DeleteOauth2CredentialProviderOutput, - schema=_SCHEMA_DELETE_OAUTH2_CREDENTIAL_PROVIDER, - input_schema=_SCHEMA_DELETE_OAUTH2_CREDENTIAL_PROVIDER_INPUT, - output_schema=_SCHEMA_DELETE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#UnauthorizedException" - ): UnauthorizedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetOauth2CredentialProviderInput: - """Dataclass for GetOauth2CredentialProviderInput structure.""" - - name: str | None = None - """The name of the OAuth2 credential provider to retrieve.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_OAUTH2_CREDENTIAL_PROVIDER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_GET_OAUTH2_CREDENTIAL_PROVIDER_INPUT.members["name"], self.name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_GET_OAUTH2_CREDENTIAL_PROVIDER_INPUT.members["name"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_OAUTH2_CREDENTIAL_PROVIDER_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetOauth2CredentialProviderOutput: - """Dataclass for GetOauth2CredentialProviderOutput structure.""" - - client_secret_arn: Secret - """ - The Amazon Resource Name (ARN) of the client secret in Amazon Web - Services Secrets Manager. - """ - - name: str - """The name of the OAuth2 credential provider.""" - - credential_provider_arn: str - """ARN of the credential provider requested.""" - - credential_provider_vendor: str - """The vendor of the OAuth2 credential provider.""" - - oauth2_provider_config_output: Oauth2ProviderConfigOutput - """The configuration output for the OAuth2 provider.""" - - created_time: datetime - """The timestamp when the OAuth2 credential provider was created.""" - - last_updated_time: datetime - """The timestamp when the OAuth2 credential provider was last updated.""" - - client_secret_json_key: str | None = None - """ - The JSON key used to extract the client secret value from the Amazon Web - Services Secrets Manager secret. - """ - - client_secret_source: str | None = None - """ - The source type of the client secret. Either `MANAGED` if the secret is - managed by the service, or `EXTERNAL` if managed by the user in Amazon - Web Services Secrets Manager. - """ - - callback_url: str | None = None - """ - Callback URL to register on the OAuth2 credential provider as an allowed - callback URL. This URL is where the OAuth2 authorization server - redirects users after they complete the authorization flow. - """ - - status: str | None = None - """The current status of the OAuth2 credential provider.""" - - failure_reason: str | None = None - """ - The reason for failure if the OAuth2 credential provider is in a failed - state. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members["clientSecretArn"], - self.client_secret_arn, - ) - if self.client_secret_json_key is not None: - serializer.write_string( - _SCHEMA_GET_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members[ - "clientSecretJsonKey" - ], - self.client_secret_json_key, - ) - - if self.client_secret_source is not None: - serializer.write_string( - _SCHEMA_GET_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members[ - "clientSecretSource" - ], - self.client_secret_source, - ) - - serializer.write_string( - _SCHEMA_GET_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members["name"], self.name - ) - serializer.write_string( - _SCHEMA_GET_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members[ - "credentialProviderArn" - ], - self.credential_provider_arn, - ) - serializer.write_string( - _SCHEMA_GET_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members[ - "credentialProviderVendor" - ], - self.credential_provider_vendor, - ) - if self.callback_url is not None: - serializer.write_string( - _SCHEMA_GET_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members["callbackUrl"], - self.callback_url, - ) - - serializer.write_struct( - _SCHEMA_GET_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members[ - "oauth2ProviderConfigOutput" - ], - self.oauth2_provider_config_output, - ) - serializer.write_timestamp( - _SCHEMA_GET_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members["createdTime"], - self.created_time, - ) - serializer.write_timestamp( - _SCHEMA_GET_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members["lastUpdatedTime"], - self.last_updated_time, - ) - if self.status is not None: - serializer.write_string( - _SCHEMA_GET_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members["status"], - self.status, - ) - - if self.failure_reason is not None: - serializer.write_string( - _SCHEMA_GET_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members["failureReason"], - self.failure_reason, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["client_secret_arn"] = Secret.deserialize(de) - - case 1: - kwargs["client_secret_json_key"] = de.read_string( - _SCHEMA_GET_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members[ - "clientSecretJsonKey" - ] - ) - - case 2: - kwargs["client_secret_source"] = SecretSourceType( - de.read_string( - _SCHEMA_GET_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members[ - "clientSecretSource" - ] - ) - ) - - case 3: - kwargs["name"] = de.read_string( - _SCHEMA_GET_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members["name"] - ) - - case 4: - kwargs["credential_provider_arn"] = de.read_string( - _SCHEMA_GET_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members[ - "credentialProviderArn" - ] - ) - - case 5: - kwargs["credential_provider_vendor"] = CredentialProviderVendorType( - de.read_string( - _SCHEMA_GET_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members[ - "credentialProviderVendor" - ] - ) - ) - - case 6: - kwargs["callback_url"] = de.read_string( - _SCHEMA_GET_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members[ - "callbackUrl" - ] - ) - - case 7: - kwargs["oauth2_provider_config_output"] = ( - _Oauth2ProviderConfigOutputDeserializer().deserialize(de) - ) - - case 8: - kwargs["created_time"] = de.read_timestamp( - _SCHEMA_GET_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members[ - "createdTime" - ] - ) - - case 9: - kwargs["last_updated_time"] = de.read_timestamp( - _SCHEMA_GET_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members[ - "lastUpdatedTime" - ] - ) - - case 10: - kwargs["status"] = Status( - de.read_string( - _SCHEMA_GET_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members[ - "status" - ] - ) - ) - - case 11: - kwargs["failure_reason"] = de.read_string( - _SCHEMA_GET_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members[ - "failureReason" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT, consumer=_consumer - ) - if "client_secret_arn" not in kwargs: - kwargs["client_secret_arn"] = Secret._smithy_default() - if "name" not in kwargs: - kwargs["name"] = "" - if "credential_provider_arn" not in kwargs: - kwargs["credential_provider_arn"] = "" - if "credential_provider_vendor" not in kwargs: - kwargs["credential_provider_vendor"] = ( - CredentialProviderVendorType._corrected("") - ) - if "oauth2_provider_config_output" not in kwargs: - kwargs["oauth2_provider_config_output"] = Oauth2ProviderConfigOutputUnknown( - tag="" - ) - if "created_time" not in kwargs: - kwargs["created_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "last_updated_time" not in kwargs: - kwargs["last_updated_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -GET_OAUTH2_CREDENTIAL_PROVIDER = APIOperation( - input=GetOauth2CredentialProviderInput, - output=GetOauth2CredentialProviderOutput, - schema=_SCHEMA_GET_OAUTH2_CREDENTIAL_PROVIDER, - input_schema=_SCHEMA_GET_OAUTH2_CREDENTIAL_PROVIDER_INPUT, - output_schema=_SCHEMA_GET_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#DecryptionFailure" - ): DecryptionFailure, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#UnauthorizedException" - ): UnauthorizedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_DECRYPTION_FAILURE, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListOauth2CredentialProvidersInput: - """Dataclass for ListOauth2CredentialProvidersInput structure.""" - - next_token: str | None = None - """Pagination token.""" - - max_results: int = 10 - """Maximum number of results to return.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_OAUTH2_CREDENTIAL_PROVIDERS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_OAUTH2_CREDENTIAL_PROVIDERS_INPUT.members["nextToken"], - self.next_token, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_OAUTH2_CREDENTIAL_PROVIDERS_INPUT.members["maxResults"], - self.max_results, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_OAUTH2_CREDENTIAL_PROVIDERS_INPUT.members[ - "nextToken" - ] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_OAUTH2_CREDENTIAL_PROVIDERS_INPUT.members[ - "maxResults" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_OAUTH2_CREDENTIAL_PROVIDERS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class Oauth2CredentialProviderItem: - """Contains information about an OAuth2 credential provider.""" - - name: str - """The name of the OAuth2 credential provider.""" - - credential_provider_vendor: str - """The vendor of the OAuth2 credential provider.""" - - credential_provider_arn: str - """The Amazon Resource Name (ARN) of the OAuth2 credential provider.""" - - created_time: datetime - """The timestamp when the OAuth2 credential provider was created.""" - - last_updated_time: datetime - """The timestamp when the OAuth2 credential provider was last updated.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OAUTH2_CREDENTIAL_PROVIDER_ITEM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_OAUTH2_CREDENTIAL_PROVIDER_ITEM.members["name"], self.name - ) - serializer.write_string( - _SCHEMA_OAUTH2_CREDENTIAL_PROVIDER_ITEM.members["credentialProviderVendor"], - self.credential_provider_vendor, - ) - serializer.write_string( - _SCHEMA_OAUTH2_CREDENTIAL_PROVIDER_ITEM.members["credentialProviderArn"], - self.credential_provider_arn, - ) - serializer.write_timestamp( - _SCHEMA_OAUTH2_CREDENTIAL_PROVIDER_ITEM.members["createdTime"], - self.created_time, - ) - serializer.write_timestamp( - _SCHEMA_OAUTH2_CREDENTIAL_PROVIDER_ITEM.members["lastUpdatedTime"], - self.last_updated_time, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_OAUTH2_CREDENTIAL_PROVIDER_ITEM.members["name"] - ) - - case 1: - kwargs["credential_provider_vendor"] = CredentialProviderVendorType( - de.read_string( - _SCHEMA_OAUTH2_CREDENTIAL_PROVIDER_ITEM.members[ - "credentialProviderVendor" - ] - ) - ) - - case 2: - kwargs["credential_provider_arn"] = de.read_string( - _SCHEMA_OAUTH2_CREDENTIAL_PROVIDER_ITEM.members[ - "credentialProviderArn" - ] - ) - - case 3: - kwargs["created_time"] = de.read_timestamp( - _SCHEMA_OAUTH2_CREDENTIAL_PROVIDER_ITEM.members["createdTime"] - ) - - case 4: - kwargs["last_updated_time"] = de.read_timestamp( - _SCHEMA_OAUTH2_CREDENTIAL_PROVIDER_ITEM.members[ - "lastUpdatedTime" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_OAUTH2_CREDENTIAL_PROVIDER_ITEM, consumer=_consumer - ) - if "name" not in kwargs: - kwargs["name"] = "" - if "credential_provider_vendor" not in kwargs: - kwargs["credential_provider_vendor"] = ( - CredentialProviderVendorType._corrected("") - ) - if "credential_provider_arn" not in kwargs: - kwargs["credential_provider_arn"] = "" - if "created_time" not in kwargs: - kwargs["created_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "last_updated_time" not in kwargs: - kwargs["last_updated_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_oauth2_credential_providers( - serializer: ShapeSerializer, - schema: Schema, - value: list[Oauth2CredentialProviderItem], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_oauth2_credential_providers( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Oauth2CredentialProviderItem]: - result: list[Oauth2CredentialProviderItem] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Oauth2CredentialProviderItem.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListOauth2CredentialProvidersOutput: - """Dataclass for ListOauth2CredentialProvidersOutput structure.""" - - credential_providers: list[Oauth2CredentialProviderItem] - """The list of OAuth2 credential providers.""" - - next_token: str | None = None - """Pagination token for the next page of results.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_OAUTH2_CREDENTIAL_PROVIDERS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_oauth2_credential_providers( - serializer, - _SCHEMA_LIST_OAUTH2_CREDENTIAL_PROVIDERS_OUTPUT.members[ - "credentialProviders" - ], - self.credential_providers, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_OAUTH2_CREDENTIAL_PROVIDERS_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["credential_providers"] = ( - _deserialize_oauth2_credential_providers( - de, - _SCHEMA_LIST_OAUTH2_CREDENTIAL_PROVIDERS_OUTPUT.members[ - "credentialProviders" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_OAUTH2_CREDENTIAL_PROVIDERS_OUTPUT.members[ - "nextToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_OAUTH2_CREDENTIAL_PROVIDERS_OUTPUT, consumer=_consumer - ) - if "credential_providers" not in kwargs: - kwargs["credential_providers"] = [] - return kwargs - - -LIST_OAUTH2_CREDENTIAL_PROVIDERS = APIOperation( - input=ListOauth2CredentialProvidersInput, - output=ListOauth2CredentialProvidersOutput, - schema=_SCHEMA_LIST_OAUTH2_CREDENTIAL_PROVIDERS, - input_schema=_SCHEMA_LIST_OAUTH2_CREDENTIAL_PROVIDERS_INPUT, - output_schema=_SCHEMA_LIST_OAUTH2_CREDENTIAL_PROVIDERS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#UnauthorizedException" - ): UnauthorizedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateOauth2CredentialProviderInput: - """Dataclass for UpdateOauth2CredentialProviderInput structure.""" - - name: str | None = None - """The name of the OAuth2 credential provider to update.""" - - credential_provider_vendor: str | None = None - """The vendor of the OAuth2 credential provider.""" - - oauth2_provider_config_input: Oauth2ProviderConfigInput | None = None - """The configuration input for the OAuth2 provider.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_OAUTH2_CREDENTIAL_PROVIDER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_UPDATE_OAUTH2_CREDENTIAL_PROVIDER_INPUT.members["name"], - self.name, - ) - - if self.credential_provider_vendor is not None: - serializer.write_string( - _SCHEMA_UPDATE_OAUTH2_CREDENTIAL_PROVIDER_INPUT.members[ - "credentialProviderVendor" - ], - self.credential_provider_vendor, - ) - - if self.oauth2_provider_config_input is not None: - serializer.write_struct( - _SCHEMA_UPDATE_OAUTH2_CREDENTIAL_PROVIDER_INPUT.members[ - "oauth2ProviderConfigInput" - ], - self.oauth2_provider_config_input, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_OAUTH2_CREDENTIAL_PROVIDER_INPUT.members["name"] - ) - - case 1: - kwargs["credential_provider_vendor"] = CredentialProviderVendorType( - de.read_string( - _SCHEMA_UPDATE_OAUTH2_CREDENTIAL_PROVIDER_INPUT.members[ - "credentialProviderVendor" - ] - ) - ) - - case 2: - kwargs["oauth2_provider_config_input"] = ( - _Oauth2ProviderConfigInputDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_OAUTH2_CREDENTIAL_PROVIDER_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateOauth2CredentialProviderOutput: - """Dataclass for UpdateOauth2CredentialProviderOutput structure.""" - - client_secret_arn: Secret - """ - The Amazon Resource Name (ARN) of the client secret in Amazon Web - Services Secrets Manager. - """ - - name: str - """The name of the OAuth2 credential provider.""" - - credential_provider_vendor: str - """The vendor of the OAuth2 credential provider.""" - - credential_provider_arn: str - """The Amazon Resource Name (ARN) of the OAuth2 credential provider.""" - - oauth2_provider_config_output: Oauth2ProviderConfigOutput - """The configuration output for the OAuth2 provider.""" - - created_time: datetime - """The timestamp when the OAuth2 credential provider was created.""" - - last_updated_time: datetime - """The timestamp when the OAuth2 credential provider was last updated.""" - - client_secret_json_key: str | None = None - """ - The JSON key used to extract the client secret value from the Amazon Web - Services Secrets Manager secret. - """ - - client_secret_source: str | None = None - """ - The source type of the client secret. Either `MANAGED` if the secret is - managed by the service, or `EXTERNAL` if managed by the user in Amazon - Web Services Secrets Manager. - """ - - callback_url: str | None = None - """ - Callback URL to register on the OAuth2 credential provider as an allowed - callback URL. This URL is where the OAuth2 authorization server - redirects users after they complete the authorization flow. - """ - - status: str | None = None - """The current status of the updated OAuth2 credential provider.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_UPDATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members["clientSecretArn"], - self.client_secret_arn, - ) - if self.client_secret_json_key is not None: - serializer.write_string( - _SCHEMA_UPDATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members[ - "clientSecretJsonKey" - ], - self.client_secret_json_key, - ) - - if self.client_secret_source is not None: - serializer.write_string( - _SCHEMA_UPDATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members[ - "clientSecretSource" - ], - self.client_secret_source, - ) - - serializer.write_string( - _SCHEMA_UPDATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members["name"], self.name - ) - serializer.write_string( - _SCHEMA_UPDATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members[ - "credentialProviderVendor" - ], - self.credential_provider_vendor, - ) - serializer.write_string( - _SCHEMA_UPDATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members[ - "credentialProviderArn" - ], - self.credential_provider_arn, - ) - if self.callback_url is not None: - serializer.write_string( - _SCHEMA_UPDATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members["callbackUrl"], - self.callback_url, - ) - - serializer.write_struct( - _SCHEMA_UPDATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members[ - "oauth2ProviderConfigOutput" - ], - self.oauth2_provider_config_output, - ) - serializer.write_timestamp( - _SCHEMA_UPDATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members["createdTime"], - self.created_time, - ) - serializer.write_timestamp( - _SCHEMA_UPDATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members["lastUpdatedTime"], - self.last_updated_time, - ) - if self.status is not None: - serializer.write_string( - _SCHEMA_UPDATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members["status"], - self.status, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["client_secret_arn"] = Secret.deserialize(de) - - case 1: - kwargs["client_secret_json_key"] = de.read_string( - _SCHEMA_UPDATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members[ - "clientSecretJsonKey" - ] - ) - - case 2: - kwargs["client_secret_source"] = SecretSourceType( - de.read_string( - _SCHEMA_UPDATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members[ - "clientSecretSource" - ] - ) - ) - - case 3: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members["name"] - ) - - case 4: - kwargs["credential_provider_vendor"] = CredentialProviderVendorType( - de.read_string( - _SCHEMA_UPDATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members[ - "credentialProviderVendor" - ] - ) - ) - - case 5: - kwargs["credential_provider_arn"] = de.read_string( - _SCHEMA_UPDATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members[ - "credentialProviderArn" - ] - ) - - case 6: - kwargs["callback_url"] = de.read_string( - _SCHEMA_UPDATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members[ - "callbackUrl" - ] - ) - - case 7: - kwargs["oauth2_provider_config_output"] = ( - _Oauth2ProviderConfigOutputDeserializer().deserialize(de) - ) - - case 8: - kwargs["created_time"] = de.read_timestamp( - _SCHEMA_UPDATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members[ - "createdTime" - ] - ) - - case 9: - kwargs["last_updated_time"] = de.read_timestamp( - _SCHEMA_UPDATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members[ - "lastUpdatedTime" - ] - ) - - case 10: - kwargs["status"] = Status( - de.read_string( - _SCHEMA_UPDATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT.members[ - "status" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT, consumer=_consumer - ) - if "client_secret_arn" not in kwargs: - kwargs["client_secret_arn"] = Secret._smithy_default() - if "name" not in kwargs: - kwargs["name"] = "" - if "credential_provider_vendor" not in kwargs: - kwargs["credential_provider_vendor"] = ( - CredentialProviderVendorType._corrected("") - ) - if "credential_provider_arn" not in kwargs: - kwargs["credential_provider_arn"] = "" - if "oauth2_provider_config_output" not in kwargs: - kwargs["oauth2_provider_config_output"] = Oauth2ProviderConfigOutputUnknown( - tag="" - ) - if "created_time" not in kwargs: - kwargs["created_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "last_updated_time" not in kwargs: - kwargs["last_updated_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -UPDATE_OAUTH2_CREDENTIAL_PROVIDER = APIOperation( - input=UpdateOauth2CredentialProviderInput, - output=UpdateOauth2CredentialProviderOutput, - schema=_SCHEMA_UPDATE_OAUTH2_CREDENTIAL_PROVIDER, - input_schema=_SCHEMA_UPDATE_OAUTH2_CREDENTIAL_PROVIDER_INPUT, - output_schema=_SCHEMA_UPDATE_OAUTH2_CREDENTIAL_PROVIDER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#DecryptionFailure" - ): DecryptionFailure, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#EncryptionFailure" - ): EncryptionFailure, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#UnauthorizedException" - ): UnauthorizedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_DECRYPTION_FAILURE, - _SCHEMA_ENCRYPTION_FAILURE, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class ClusteringFrequency(UnknownEnumMixin, StrEnum): - DAILY = "DAILY" - WEEKLY = "WEEKLY" - MONTHLY = "MONTHLY" - - -def _serialize_clustering_frequency_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_clustering_frequency_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ClusteringFrequency(d.read_string(member_schema))) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ClusteringConfig: - """ - Configuration for periodic batch evaluation clustering, specifying how - often clustering jobs run. - """ - - frequencies: list[str] - """ - The list of frequencies at which clustering batch evaluations are - triggered. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CLUSTERING_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_clustering_frequency_list( - serializer, - _SCHEMA_CLUSTERING_CONFIG.members["frequencies"], - self.frequencies, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["frequencies"] = _deserialize_clustering_frequency_list( - de, _SCHEMA_CLUSTERING_CONFIG.members["frequencies"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CLUSTERING_CONFIG, consumer=_consumer) - if "frequencies" not in kwargs: - kwargs["frequencies"] = [] - return kwargs - - -def _serialize_log_group_name_prefix_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_log_group_name_prefix_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_log_group_names_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_log_group_names_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_service_names_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_service_names_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CloudWatchLogsInputConfig: - """ - The configuration for reading agent traces from CloudWatch logs as input - for online evaluation. - """ - - service_names: list[str] - """ - The list of service names to filter traces within the specified log - groups. Used to identify relevant agent sessions. - """ - - log_group_names: list[str] = field(default_factory=list[str]) - """The list of CloudWatch log group names to monitor for agent traces.""" - - log_group_name_prefixes: list[str] | None = None - """ - The list of CloudWatch log group name prefixes to monitor for agent - traces. Specify this instead of `logGroupNames` to match log groups by - prefix. Specify either `logGroupNames` or `logGroupNamePrefixes`, not - both. One of the two is required. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CLOUD_WATCH_LOGS_INPUT_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_log_group_names_list( - serializer, - _SCHEMA_CLOUD_WATCH_LOGS_INPUT_CONFIG.members["logGroupNames"], - self.log_group_names, - ) - if self.log_group_name_prefixes is not None: - _serialize_log_group_name_prefix_list( - serializer, - _SCHEMA_CLOUD_WATCH_LOGS_INPUT_CONFIG.members["logGroupNamePrefixes"], - self.log_group_name_prefixes, - ) - - _serialize_service_names_list( - serializer, - _SCHEMA_CLOUD_WATCH_LOGS_INPUT_CONFIG.members["serviceNames"], - self.service_names, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["log_group_names"] = _deserialize_log_group_names_list( - de, - _SCHEMA_CLOUD_WATCH_LOGS_INPUT_CONFIG.members["logGroupNames"], - ) - - case 1: - kwargs["log_group_name_prefixes"] = ( - _deserialize_log_group_name_prefix_list( - de, - _SCHEMA_CLOUD_WATCH_LOGS_INPUT_CONFIG.members[ - "logGroupNamePrefixes" - ], - ) - ) - - case 2: - kwargs["service_names"] = _deserialize_service_names_list( - de, - _SCHEMA_CLOUD_WATCH_LOGS_INPUT_CONFIG.members["serviceNames"], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CLOUD_WATCH_LOGS_INPUT_CONFIG, consumer=_consumer - ) - if "service_names" not in kwargs: - kwargs["service_names"] = [] - return kwargs - - -@dataclass -class DataSourceConfigCloudWatchLogs: - """ - The CloudWatch logs configuration for reading agent traces from log - groups. - """ - - value: CloudWatchLogsInputConfig - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DATA_SOURCE_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DATA_SOURCE_CONFIG.members["cloudWatchLogs"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=CloudWatchLogsInputConfig.deserialize(deserializer)) - - -@dataclass -class DataSourceConfigUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -DataSourceConfig = Union[DataSourceConfigCloudWatchLogs | DataSourceConfigUnknown] -""" -The configuration that specifies where to read agent traces for online -evaluation. -""" - - -class _DataSourceConfigDeserializer: - _result: DataSourceConfig | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> DataSourceConfig: - self._result = None - deserializer.read_struct(_SCHEMA_DATA_SOURCE_CONFIG, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(DataSourceConfigCloudWatchLogs.deserialize(de)) - - case _: - self._set_result( - DataSourceConfigUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: DataSourceConfig) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass -class EvaluatorReferenceEvaluatorId: - """ - The unique identifier of the evaluator. Can reference builtin evaluators - (e.g., Builtin.Helpfulness) or custom evaluators. - """ - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVALUATOR_REFERENCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_EVALUATOR_REFERENCE.members["evaluatorId"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string( - _SCHEMA_EVALUATOR_REFERENCE.members["evaluatorId"] - ) - ) - - -@dataclass -class EvaluatorReferenceUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -EvaluatorReference = Union[EvaluatorReferenceEvaluatorId | EvaluatorReferenceUnknown] -""" -The reference to an evaluator used in online evaluation configurations, -containing the evaluator identifier. -""" - - -class _EvaluatorReferenceDeserializer: - _result: EvaluatorReference | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> EvaluatorReference: - self._result = None - deserializer.read_struct(_SCHEMA_EVALUATOR_REFERENCE, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(EvaluatorReferenceEvaluatorId.deserialize(de)) - - case _: - self._set_result( - EvaluatorReferenceUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: EvaluatorReference) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_evaluator_list( - serializer: ShapeSerializer, schema: Schema, value: list[EvaluatorReference] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_evaluator_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[EvaluatorReference]: - result: list[EvaluatorReference] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_EvaluatorReferenceDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class Insight: - """ - A reference to an insight analysis to run against sessions during - evaluation. Insights provide deeper analysis beyond individual evaluator - scores, including failure detection, user intent clustering, and - execution summarization. - """ - - insight_id: str - """The unique identifier of the insight to run.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INSIGHT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_INSIGHT.members["insightId"], self.insight_id) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["insight_id"] = de.read_string( - _SCHEMA_INSIGHT.members["insightId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INSIGHT, consumer=_consumer) - if "insight_id" not in kwargs: - kwargs["insight_id"] = "" - return kwargs - - -def _serialize_insight_list( - serializer: ShapeSerializer, schema: Schema, value: list[Insight] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_insight_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Insight]: - result: list[Insight] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Insight.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class ResultDestination(UnknownEnumMixin, StrEnum): - """ - Where evaluation results are written: dedicated results log group - (default) or the source log group. - """ - - DEDICATED_LOG_GROUP = "DEDICATED_LOG_GROUP" - SOURCE_LOG_GROUP = "SOURCE_LOG_GROUP" - - -@dataclass(kw_only=True) -class CloudWatchOutputConfig: - """ - The configuration for writing evaluation results to CloudWatch logs with - embedded metric format (EMF) for monitoring. - """ - - log_group_name: str = "" - """ - The name of the CloudWatch log group where evaluation results will be - written. An existing log group is used as-is; otherwise the service - creates it, which requires the evaluation execution role to grant - `logs:CreateLogGroup` on the log group. Don't specify this value when - `resultDestination` is `SOURCE_LOG_GROUP`. The name can't be under the - service-reserved `/aws/bedrock-agentcore/evaluations/` namespace, apart - from this configuration's own service-managed default group. - """ - - metrics_namespace: str | None = None - """ - The CloudWatch metrics namespace where evaluation result metrics are - published. If you omit this value, the service publishes metrics to - `Bedrock-AgentCore/Evaluations`. This value can't begin with `AWS/`. - """ - - result_destination: str = ResultDestination("DEDICATED_LOG_GROUP") - """ - The destination where evaluation results are written. Valid values: - - - `DEDICATED_LOG_GROUP` (default) -- Writes results to a dedicated - result log group. - - - `SOURCE_LOG_GROUP` -- Writes results back to the log group that the - agent traces were read from. If you use this value, don't specify - `logGroupName`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CLOUD_WATCH_OUTPUT_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CLOUD_WATCH_OUTPUT_CONFIG.members["logGroupName"], - self.log_group_name, - ) - if self.metrics_namespace is not None: - serializer.write_string( - _SCHEMA_CLOUD_WATCH_OUTPUT_CONFIG.members["metricsNamespace"], - self.metrics_namespace, - ) - - serializer.write_string( - _SCHEMA_CLOUD_WATCH_OUTPUT_CONFIG.members["resultDestination"], - self.result_destination, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["log_group_name"] = de.read_string( - _SCHEMA_CLOUD_WATCH_OUTPUT_CONFIG.members["logGroupName"] - ) - - case 1: - kwargs["metrics_namespace"] = de.read_string( - _SCHEMA_CLOUD_WATCH_OUTPUT_CONFIG.members["metricsNamespace"] - ) - - case 2: - kwargs["result_destination"] = ResultDestination( - de.read_string( - _SCHEMA_CLOUD_WATCH_OUTPUT_CONFIG.members[ - "resultDestination" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CLOUD_WATCH_OUTPUT_CONFIG, consumer=_consumer) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls() - - -@dataclass(kw_only=True) -class OutputConfig: - """ - The configuration that specifies where evaluation results should be - written for monitoring and analysis. - """ - - cloud_watch_config: CloudWatchOutputConfig - """ - The CloudWatch configuration for writing evaluation results to - CloudWatch logs with embedded metric format. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OUTPUT_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_OUTPUT_CONFIG.members["cloudWatchConfig"], self.cloud_watch_config - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["cloud_watch_config"] = CloudWatchOutputConfig.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_OUTPUT_CONFIG, consumer=_consumer) - if "cloud_watch_config" not in kwargs: - kwargs["cloud_watch_config"] = CloudWatchOutputConfig._smithy_default() - return kwargs - - -class FilterOperator(UnknownEnumMixin, StrEnum): - EQUALS = "Equals" - NOT_EQUALS = "NotEquals" - GREATER_THAN = "GreaterThan" - LESS_THAN = "LessThan" - GREATER_THAN_OR_EQUAL = "GreaterThanOrEqual" - LESS_THAN_OR_EQUAL = "LessThanOrEqual" - CONTAINS = "Contains" - NOT_CONTAINS = "NotContains" - - -@dataclass -class FilterValueStringValue: - """The string value for text-based filtering.""" - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FILTER_VALUE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_FILTER_VALUE.members["stringValue"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string(_SCHEMA_FILTER_VALUE.members["stringValue"]) - ) - - -@dataclass -class FilterValueDoubleValue: - """The numeric value for numerical filtering and comparisons.""" - - value: float - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FILTER_VALUE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_double(_SCHEMA_FILTER_VALUE.members["doubleValue"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_double(_SCHEMA_FILTER_VALUE.members["doubleValue"]) - ) - - -@dataclass -class FilterValueBooleanValue: - """The boolean value for true/false filtering conditions.""" - - value: bool - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FILTER_VALUE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_boolean( - _SCHEMA_FILTER_VALUE.members["booleanValue"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_boolean( - _SCHEMA_FILTER_VALUE.members["booleanValue"] - ) - ) - - -@dataclass -class FilterValueUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -FilterValue = Union[ - FilterValueStringValue - | FilterValueDoubleValue - | FilterValueBooleanValue - | FilterValueUnknown -] -""" -The value used in filter comparisons, supporting different data types -for flexible filtering criteria. -""" - - -class _FilterValueDeserializer: - _result: FilterValue | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> FilterValue: - self._result = None - deserializer.read_struct(_SCHEMA_FILTER_VALUE, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(FilterValueStringValue.deserialize(de)) - - case 1: - self._set_result(FilterValueDoubleValue.deserialize(de)) - - case 2: - self._set_result(FilterValueBooleanValue.deserialize(de)) - - case _: - self._set_result(FilterValueUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: FilterValue) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class Filter: - """ - The filter that applies conditions to agent traces during online - evaluation to determine which traces should be evaluated. - """ - - key: str - """The key or field name to filter on within the agent trace data.""" - - operator: str - """The comparison operator to use for filtering.""" - - value: FilterValue - """The value to compare against using the specified operator.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_FILTER.members["key"], self.key) - serializer.write_string(_SCHEMA_FILTER.members["operator"], self.operator) - serializer.write_struct(_SCHEMA_FILTER.members["value"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["key"] = de.read_string(_SCHEMA_FILTER.members["key"]) - - case 1: - kwargs["operator"] = FilterOperator( - de.read_string(_SCHEMA_FILTER.members["operator"]) - ) - - case 2: - kwargs["value"] = _FilterValueDeserializer().deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FILTER, consumer=_consumer) - if "key" not in kwargs: - kwargs["key"] = "" - if "operator" not in kwargs: - kwargs["operator"] = FilterOperator._corrected("") - if "value" not in kwargs: - kwargs["value"] = FilterValueUnknown(tag="") - return kwargs - - -def _serialize_filter_list( - serializer: ShapeSerializer, schema: Schema, value: list[Filter] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_filter_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Filter]: - result: list[Filter] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Filter.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class SamplingConfig: - """ - The configuration that controls what percentage of agent traces are - sampled for evaluation to manage evaluation volume and costs. - """ - - sampling_percentage: float - """ - The percentage of agent traces to sample for evaluation, ranging from - 0.01% to 100%. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SAMPLING_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_double( - _SCHEMA_SAMPLING_CONFIG.members["samplingPercentage"], - self.sampling_percentage, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["sampling_percentage"] = de.read_double( - _SCHEMA_SAMPLING_CONFIG.members["samplingPercentage"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SAMPLING_CONFIG, consumer=_consumer) - if "sampling_percentage" not in kwargs: - kwargs["sampling_percentage"] = 0.0 - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(sampling_percentage=0.0) - - -@dataclass(kw_only=True) -class SessionConfig: - """ - The configuration that defines how agent sessions are detected and when - they are considered complete for evaluation. - """ - - session_timeout_minutes: int - """ - The number of minutes of inactivity after which an agent session is - considered complete and ready for evaluation. Default is 15 minutes. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SESSION_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer( - _SCHEMA_SESSION_CONFIG.members["sessionTimeoutMinutes"], - self.session_timeout_minutes, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["session_timeout_minutes"] = de.read_integer( - _SCHEMA_SESSION_CONFIG.members["sessionTimeoutMinutes"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SESSION_CONFIG, consumer=_consumer) - if "session_timeout_minutes" not in kwargs: - kwargs["session_timeout_minutes"] = 0 - return kwargs - - -@dataclass(kw_only=True) -class Rule: - """ - The evaluation rule that defines sampling configuration, filtering - criteria, and session detection settings for online evaluation. - """ - - sampling_config: SamplingConfig - """ - The sampling configuration that determines what percentage of agent - traces to evaluate. - """ - - filters: list[Filter] | None = None - """ - The list of filters that determine which agent traces should be included - in the evaluation based on trace properties. - """ - - session_config: SessionConfig | None = None - """ - The session configuration that defines timeout settings for detecting - when agent sessions are complete and ready for evaluation. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RULE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RULE.members["samplingConfig"], self.sampling_config - ) - if self.filters is not None: - _serialize_filter_list( - serializer, _SCHEMA_RULE.members["filters"], self.filters - ) - - if self.session_config is not None: - serializer.write_struct( - _SCHEMA_RULE.members["sessionConfig"], self.session_config - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["sampling_config"] = SamplingConfig.deserialize(de) - - case 1: - kwargs["filters"] = _deserialize_filter_list( - de, _SCHEMA_RULE.members["filters"] - ) - - case 2: - kwargs["session_config"] = SessionConfig.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RULE, consumer=_consumer) - if "sampling_config" not in kwargs: - kwargs["sampling_config"] = SamplingConfig._smithy_default() - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(sampling_config=SamplingConfig._smithy_default()) - - -@dataclass(kw_only=True) -class CreateOnlineEvaluationConfigInput: - """Dataclass for CreateOnlineEvaluationConfigInput structure.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If you don't specify this field, a - value is randomly generated for you. If this token matches a previous - request, the service ignores the request, but doesn't return an error. - For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - online_evaluation_config_name: str | None = None - """ - The name of the online evaluation configuration. Must be unique within - your account. - """ - - description: str | None = field(repr=False, default=None) - """ - The description of the online evaluation configuration that explains its - monitoring purpose and scope. - """ - - rule: Rule | None = None - """ - The evaluation rule that defines sampling configuration, filters, and - session detection settings for the online evaluation. - """ - - data_source_config: DataSourceConfig | None = None - """ - The data source configuration that specifies CloudWatch log groups and - service names to monitor for agent traces. - """ - - evaluators: list[EvaluatorReference] | None = None - """ - The list of evaluators to apply during online evaluation. Can include - both built-in evaluators and custom evaluators created with - `CreateEvaluator`. - """ - - insights: list[Insight] | None = None - """The list of insight types to run against agent sessions.""" - - clustering_config: ClusteringConfig | None = None - """ - Configuration for periodic batch evaluation clustering of insight - results. - """ - - output_config: OutputConfig | None = None - """ - The configuration that specifies where evaluation results should be - written for monitoring and analysis. - """ - - evaluation_execution_role_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the IAM role that grants permissions - to read from CloudWatch logs, write evaluation results, and invoke - Amazon Bedrock models for evaluation. If the configuration references - evaluators encrypted with a customer managed KMS key, this role must - also have `kms:Decrypt` permission on the KMS key. The service validates - this permission at configuration creation time. For more information, - see [Encryption at rest for AgentCore - Evaluations](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/evaluations-encryption.html). - """ - - enable_on_create: bool | None = None - """ - Whether to enable the online evaluation configuration immediately upon - creation. If true, evaluation begins automatically. - """ - - tags: dict[str, str] | None = None - """ - A map of tag keys and values to assign to an AgentCore Online Evaluation - Config. Tags enable you to categorize your resources in different ways, - for example, by purpose, owner, or environment. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_ONLINE_EVALUATION_CONFIG_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_ONLINE_EVALUATION_CONFIG_INPUT.members["clientToken"], - self.client_token, - ) - - if self.online_evaluation_config_name is not None: - serializer.write_string( - _SCHEMA_CREATE_ONLINE_EVALUATION_CONFIG_INPUT.members[ - "onlineEvaluationConfigName" - ], - self.online_evaluation_config_name, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_ONLINE_EVALUATION_CONFIG_INPUT.members["description"], - self.description, - ) - - if self.rule is not None: - serializer.write_struct( - _SCHEMA_CREATE_ONLINE_EVALUATION_CONFIG_INPUT.members["rule"], self.rule - ) - - if self.data_source_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_ONLINE_EVALUATION_CONFIG_INPUT.members[ - "dataSourceConfig" - ], - self.data_source_config, - ) - - if self.evaluators is not None: - _serialize_evaluator_list( - serializer, - _SCHEMA_CREATE_ONLINE_EVALUATION_CONFIG_INPUT.members["evaluators"], - self.evaluators, - ) - - if self.insights is not None: - _serialize_insight_list( - serializer, - _SCHEMA_CREATE_ONLINE_EVALUATION_CONFIG_INPUT.members["insights"], - self.insights, - ) - - if self.clustering_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_ONLINE_EVALUATION_CONFIG_INPUT.members[ - "clusteringConfig" - ], - self.clustering_config, - ) - - if self.output_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_ONLINE_EVALUATION_CONFIG_INPUT.members["outputConfig"], - self.output_config, - ) - - if self.evaluation_execution_role_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_ONLINE_EVALUATION_CONFIG_INPUT.members[ - "evaluationExecutionRoleArn" - ], - self.evaluation_execution_role_arn, - ) - - if self.enable_on_create is not None: - serializer.write_boolean( - _SCHEMA_CREATE_ONLINE_EVALUATION_CONFIG_INPUT.members["enableOnCreate"], - self.enable_on_create, - ) - - if self.tags is not None: - _serialize_tags_map( - serializer, - _SCHEMA_CREATE_ONLINE_EVALUATION_CONFIG_INPUT.members["tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_ONLINE_EVALUATION_CONFIG_INPUT.members[ - "clientToken" - ] - ) - - case 1: - kwargs["online_evaluation_config_name"] = de.read_string( - _SCHEMA_CREATE_ONLINE_EVALUATION_CONFIG_INPUT.members[ - "onlineEvaluationConfigName" - ] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_ONLINE_EVALUATION_CONFIG_INPUT.members[ - "description" - ] - ) - - case 3: - kwargs["rule"] = Rule.deserialize(de) - - case 4: - kwargs["data_source_config"] = ( - _DataSourceConfigDeserializer().deserialize(de) - ) - - case 5: - kwargs["evaluators"] = _deserialize_evaluator_list( - de, - _SCHEMA_CREATE_ONLINE_EVALUATION_CONFIG_INPUT.members[ - "evaluators" - ], - ) - - case 6: - kwargs["insights"] = _deserialize_insight_list( - de, - _SCHEMA_CREATE_ONLINE_EVALUATION_CONFIG_INPUT.members[ - "insights" - ], - ) - - case 7: - kwargs["clustering_config"] = ClusteringConfig.deserialize(de) - - case 8: - kwargs["output_config"] = OutputConfig.deserialize(de) - - case 9: - kwargs["evaluation_execution_role_arn"] = de.read_string( - _SCHEMA_CREATE_ONLINE_EVALUATION_CONFIG_INPUT.members[ - "evaluationExecutionRoleArn" - ] - ) - - case 10: - kwargs["enable_on_create"] = de.read_boolean( - _SCHEMA_CREATE_ONLINE_EVALUATION_CONFIG_INPUT.members[ - "enableOnCreate" - ] - ) - - case 11: - kwargs["tags"] = _deserialize_tags_map( - de, - _SCHEMA_CREATE_ONLINE_EVALUATION_CONFIG_INPUT.members["tags"], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_ONLINE_EVALUATION_CONFIG_INPUT, consumer=_consumer - ) - return kwargs - - -class OnlineEvaluationExecutionStatus(UnknownEnumMixin, StrEnum): - ENABLED = "ENABLED" - DISABLED = "DISABLED" - - -class OnlineEvaluationConfigStatus(UnknownEnumMixin, StrEnum): - ACTIVE = "ACTIVE" - CREATING = "CREATING" - CREATE_FAILED = "CREATE_FAILED" - UPDATING = "UPDATING" - UPDATE_FAILED = "UPDATE_FAILED" - DELETING = "DELETING" - ERROR = "ERROR" - - -@dataclass(kw_only=True) -class CreateOnlineEvaluationConfigOutput: - """Dataclass for CreateOnlineEvaluationConfigOutput structure.""" - - online_evaluation_config_arn: str - """ - The Amazon Resource Name (ARN) of the created online evaluation - configuration. - """ - - online_evaluation_config_id: str - """The unique identifier of the created online evaluation configuration.""" - - created_at: datetime - """The timestamp when the online evaluation configuration was created.""" - - status: str - """The status of the online evaluation configuration.""" - - execution_status: str - """ - The execution status indicating whether the online evaluation is - currently running. - """ - - output_config: OutputConfig | None = None - """ - The configuration that specifies where evaluation results should be - written for monitoring and analysis. - """ - - failure_reason: str | None = None - """ - The reason for failure if the online evaluation configuration creation - or execution failed. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_ONLINE_EVALUATION_CONFIG_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_ONLINE_EVALUATION_CONFIG_OUTPUT.members[ - "onlineEvaluationConfigArn" - ], - self.online_evaluation_config_arn, - ) - serializer.write_string( - _SCHEMA_CREATE_ONLINE_EVALUATION_CONFIG_OUTPUT.members[ - "onlineEvaluationConfigId" - ], - self.online_evaluation_config_id, - ) - serializer.write_timestamp( - _SCHEMA_CREATE_ONLINE_EVALUATION_CONFIG_OUTPUT.members["createdAt"], - self.created_at, - ) - if self.output_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_ONLINE_EVALUATION_CONFIG_OUTPUT.members["outputConfig"], - self.output_config, - ) - - serializer.write_string( - _SCHEMA_CREATE_ONLINE_EVALUATION_CONFIG_OUTPUT.members["status"], - self.status, - ) - serializer.write_string( - _SCHEMA_CREATE_ONLINE_EVALUATION_CONFIG_OUTPUT.members["executionStatus"], - self.execution_status, - ) - if self.failure_reason is not None: - serializer.write_string( - _SCHEMA_CREATE_ONLINE_EVALUATION_CONFIG_OUTPUT.members["failureReason"], - self.failure_reason, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["online_evaluation_config_arn"] = de.read_string( - _SCHEMA_CREATE_ONLINE_EVALUATION_CONFIG_OUTPUT.members[ - "onlineEvaluationConfigArn" - ] - ) - - case 1: - kwargs["online_evaluation_config_id"] = de.read_string( - _SCHEMA_CREATE_ONLINE_EVALUATION_CONFIG_OUTPUT.members[ - "onlineEvaluationConfigId" - ] - ) - - case 2: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_CREATE_ONLINE_EVALUATION_CONFIG_OUTPUT.members[ - "createdAt" - ] - ) - - case 3: - kwargs["output_config"] = OutputConfig.deserialize(de) - - case 4: - kwargs["status"] = OnlineEvaluationConfigStatus( - de.read_string( - _SCHEMA_CREATE_ONLINE_EVALUATION_CONFIG_OUTPUT.members[ - "status" - ] - ) - ) - - case 5: - kwargs["execution_status"] = OnlineEvaluationExecutionStatus( - de.read_string( - _SCHEMA_CREATE_ONLINE_EVALUATION_CONFIG_OUTPUT.members[ - "executionStatus" - ] - ) - ) - - case 6: - kwargs["failure_reason"] = de.read_string( - _SCHEMA_CREATE_ONLINE_EVALUATION_CONFIG_OUTPUT.members[ - "failureReason" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_ONLINE_EVALUATION_CONFIG_OUTPUT, consumer=_consumer - ) - if "online_evaluation_config_arn" not in kwargs: - kwargs["online_evaluation_config_arn"] = "" - if "online_evaluation_config_id" not in kwargs: - kwargs["online_evaluation_config_id"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "status" not in kwargs: - kwargs["status"] = OnlineEvaluationConfigStatus._corrected("") - if "execution_status" not in kwargs: - kwargs["execution_status"] = OnlineEvaluationExecutionStatus._corrected("") - return kwargs - - -CREATE_ONLINE_EVALUATION_CONFIG = APIOperation( - input=CreateOnlineEvaluationConfigInput, - output=CreateOnlineEvaluationConfigOutput, - schema=_SCHEMA_CREATE_ONLINE_EVALUATION_CONFIG, - input_schema=_SCHEMA_CREATE_ONLINE_EVALUATION_CONFIG_INPUT, - output_schema=_SCHEMA_CREATE_ONLINE_EVALUATION_CONFIG_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteOnlineEvaluationConfigInput: - """Dataclass for DeleteOnlineEvaluationConfigInput structure.""" - - online_evaluation_config_id: str | None = None - """The unique identifier of the online evaluation configuration to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_ONLINE_EVALUATION_CONFIG_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.online_evaluation_config_id is not None: - serializer.write_string( - _SCHEMA_DELETE_ONLINE_EVALUATION_CONFIG_INPUT.members[ - "onlineEvaluationConfigId" - ], - self.online_evaluation_config_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["online_evaluation_config_id"] = de.read_string( - _SCHEMA_DELETE_ONLINE_EVALUATION_CONFIG_INPUT.members[ - "onlineEvaluationConfigId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_ONLINE_EVALUATION_CONFIG_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteOnlineEvaluationConfigOutput: - """Dataclass for DeleteOnlineEvaluationConfigOutput structure.""" - - online_evaluation_config_arn: str - """ - The Amazon Resource Name (ARN) of the deleted online evaluation - configuration. - """ - - online_evaluation_config_id: str - """The unique identifier of the deleted online evaluation configuration.""" - - status: str - """The status of the online evaluation configuration deletion operation.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_ONLINE_EVALUATION_CONFIG_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DELETE_ONLINE_EVALUATION_CONFIG_OUTPUT.members[ - "onlineEvaluationConfigArn" - ], - self.online_evaluation_config_arn, - ) - serializer.write_string( - _SCHEMA_DELETE_ONLINE_EVALUATION_CONFIG_OUTPUT.members[ - "onlineEvaluationConfigId" - ], - self.online_evaluation_config_id, - ) - serializer.write_string( - _SCHEMA_DELETE_ONLINE_EVALUATION_CONFIG_OUTPUT.members["status"], - self.status, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["online_evaluation_config_arn"] = de.read_string( - _SCHEMA_DELETE_ONLINE_EVALUATION_CONFIG_OUTPUT.members[ - "onlineEvaluationConfigArn" - ] - ) - - case 1: - kwargs["online_evaluation_config_id"] = de.read_string( - _SCHEMA_DELETE_ONLINE_EVALUATION_CONFIG_OUTPUT.members[ - "onlineEvaluationConfigId" - ] - ) - - case 2: - kwargs["status"] = OnlineEvaluationConfigStatus( - de.read_string( - _SCHEMA_DELETE_ONLINE_EVALUATION_CONFIG_OUTPUT.members[ - "status" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_ONLINE_EVALUATION_CONFIG_OUTPUT, consumer=_consumer - ) - if "online_evaluation_config_arn" not in kwargs: - kwargs["online_evaluation_config_arn"] = "" - if "online_evaluation_config_id" not in kwargs: - kwargs["online_evaluation_config_id"] = "" - if "status" not in kwargs: - kwargs["status"] = OnlineEvaluationConfigStatus._corrected("") - return kwargs - - -DELETE_ONLINE_EVALUATION_CONFIG = APIOperation( - input=DeleteOnlineEvaluationConfigInput, - output=DeleteOnlineEvaluationConfigOutput, - schema=_SCHEMA_DELETE_ONLINE_EVALUATION_CONFIG, - input_schema=_SCHEMA_DELETE_ONLINE_EVALUATION_CONFIG_INPUT, - output_schema=_SCHEMA_DELETE_ONLINE_EVALUATION_CONFIG_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetOnlineEvaluationConfigInput: - """Dataclass for GetOnlineEvaluationConfigInput structure.""" - - online_evaluation_config_id: str | None = None - """ - The unique identifier of the online evaluation configuration to - retrieve. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_ONLINE_EVALUATION_CONFIG_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.online_evaluation_config_id is not None: - serializer.write_string( - _SCHEMA_GET_ONLINE_EVALUATION_CONFIG_INPUT.members[ - "onlineEvaluationConfigId" - ], - self.online_evaluation_config_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["online_evaluation_config_id"] = de.read_string( - _SCHEMA_GET_ONLINE_EVALUATION_CONFIG_INPUT.members[ - "onlineEvaluationConfigId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_ONLINE_EVALUATION_CONFIG_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetOnlineEvaluationConfigOutput: - """Dataclass for GetOnlineEvaluationConfigOutput structure.""" - - online_evaluation_config_arn: str - """The Amazon Resource Name (ARN) of the online evaluation configuration.""" - - online_evaluation_config_id: str - """The unique identifier of the online evaluation configuration.""" - - online_evaluation_config_name: str - """The name of the online evaluation configuration.""" - - rule: Rule - """ - The evaluation rule containing sampling configuration, filters, and - session settings. - """ - - data_source_config: DataSourceConfig - """ - The data source configuration specifying CloudWatch log groups and - service names to monitor. - """ - - status: str - """The status of the online evaluation configuration.""" - - execution_status: str - """ - The execution status indicating whether the online evaluation is - currently running. - """ - - created_at: datetime - """The timestamp when the online evaluation configuration was created.""" - - updated_at: datetime - """The timestamp when the online evaluation configuration was last updated.""" - - description: str | None = field(repr=False, default=None) - """The description of the online evaluation configuration.""" - - evaluators: list[EvaluatorReference] = field( - default_factory=list[EvaluatorReference] - ) - """The list of evaluators applied during online evaluation.""" - - insights: list[Insight] | None = None - """The list of insight types configured for this evaluation.""" - - clustering_config: ClusteringConfig | None = None - """The clustering configuration for periodic batch evaluation.""" - - output_config: OutputConfig | None = None - """ - The output configuration specifying where evaluation results are - written. - """ - - evaluation_execution_role_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the IAM role used for evaluation - execution. - """ - - failure_reason: str | None = None - """ - The reason for failure if the online evaluation configuration execution - failed. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_ONLINE_EVALUATION_CONFIG_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_ONLINE_EVALUATION_CONFIG_OUTPUT.members[ - "onlineEvaluationConfigArn" - ], - self.online_evaluation_config_arn, - ) - serializer.write_string( - _SCHEMA_GET_ONLINE_EVALUATION_CONFIG_OUTPUT.members[ - "onlineEvaluationConfigId" - ], - self.online_evaluation_config_id, - ) - serializer.write_string( - _SCHEMA_GET_ONLINE_EVALUATION_CONFIG_OUTPUT.members[ - "onlineEvaluationConfigName" - ], - self.online_evaluation_config_name, - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_ONLINE_EVALUATION_CONFIG_OUTPUT.members["description"], - self.description, - ) - - serializer.write_struct( - _SCHEMA_GET_ONLINE_EVALUATION_CONFIG_OUTPUT.members["rule"], self.rule - ) - serializer.write_struct( - _SCHEMA_GET_ONLINE_EVALUATION_CONFIG_OUTPUT.members["dataSourceConfig"], - self.data_source_config, - ) - _serialize_evaluator_list( - serializer, - _SCHEMA_GET_ONLINE_EVALUATION_CONFIG_OUTPUT.members["evaluators"], - self.evaluators, - ) - if self.insights is not None: - _serialize_insight_list( - serializer, - _SCHEMA_GET_ONLINE_EVALUATION_CONFIG_OUTPUT.members["insights"], - self.insights, - ) - - if self.clustering_config is not None: - serializer.write_struct( - _SCHEMA_GET_ONLINE_EVALUATION_CONFIG_OUTPUT.members["clusteringConfig"], - self.clustering_config, - ) - - if self.output_config is not None: - serializer.write_struct( - _SCHEMA_GET_ONLINE_EVALUATION_CONFIG_OUTPUT.members["outputConfig"], - self.output_config, - ) - - if self.evaluation_execution_role_arn is not None: - serializer.write_string( - _SCHEMA_GET_ONLINE_EVALUATION_CONFIG_OUTPUT.members[ - "evaluationExecutionRoleArn" - ], - self.evaluation_execution_role_arn, - ) - - serializer.write_string( - _SCHEMA_GET_ONLINE_EVALUATION_CONFIG_OUTPUT.members["status"], self.status - ) - serializer.write_string( - _SCHEMA_GET_ONLINE_EVALUATION_CONFIG_OUTPUT.members["executionStatus"], - self.execution_status, - ) - serializer.write_timestamp( - _SCHEMA_GET_ONLINE_EVALUATION_CONFIG_OUTPUT.members["createdAt"], - self.created_at, - ) - serializer.write_timestamp( - _SCHEMA_GET_ONLINE_EVALUATION_CONFIG_OUTPUT.members["updatedAt"], - self.updated_at, - ) - if self.failure_reason is not None: - serializer.write_string( - _SCHEMA_GET_ONLINE_EVALUATION_CONFIG_OUTPUT.members["failureReason"], - self.failure_reason, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["online_evaluation_config_arn"] = de.read_string( - _SCHEMA_GET_ONLINE_EVALUATION_CONFIG_OUTPUT.members[ - "onlineEvaluationConfigArn" - ] - ) - - case 1: - kwargs["online_evaluation_config_id"] = de.read_string( - _SCHEMA_GET_ONLINE_EVALUATION_CONFIG_OUTPUT.members[ - "onlineEvaluationConfigId" - ] - ) - - case 2: - kwargs["online_evaluation_config_name"] = de.read_string( - _SCHEMA_GET_ONLINE_EVALUATION_CONFIG_OUTPUT.members[ - "onlineEvaluationConfigName" - ] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_GET_ONLINE_EVALUATION_CONFIG_OUTPUT.members[ - "description" - ] - ) - - case 4: - kwargs["rule"] = Rule.deserialize(de) - - case 5: - kwargs["data_source_config"] = ( - _DataSourceConfigDeserializer().deserialize(de) - ) - - case 6: - kwargs["evaluators"] = _deserialize_evaluator_list( - de, - _SCHEMA_GET_ONLINE_EVALUATION_CONFIG_OUTPUT.members[ - "evaluators" - ], - ) - - case 7: - kwargs["insights"] = _deserialize_insight_list( - de, - _SCHEMA_GET_ONLINE_EVALUATION_CONFIG_OUTPUT.members["insights"], - ) - - case 8: - kwargs["clustering_config"] = ClusteringConfig.deserialize(de) - - case 9: - kwargs["output_config"] = OutputConfig.deserialize(de) - - case 10: - kwargs["evaluation_execution_role_arn"] = de.read_string( - _SCHEMA_GET_ONLINE_EVALUATION_CONFIG_OUTPUT.members[ - "evaluationExecutionRoleArn" - ] - ) - - case 11: - kwargs["status"] = OnlineEvaluationConfigStatus( - de.read_string( - _SCHEMA_GET_ONLINE_EVALUATION_CONFIG_OUTPUT.members[ - "status" - ] - ) - ) - - case 12: - kwargs["execution_status"] = OnlineEvaluationExecutionStatus( - de.read_string( - _SCHEMA_GET_ONLINE_EVALUATION_CONFIG_OUTPUT.members[ - "executionStatus" - ] - ) - ) - - case 13: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_ONLINE_EVALUATION_CONFIG_OUTPUT.members["createdAt"] - ) - - case 14: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_GET_ONLINE_EVALUATION_CONFIG_OUTPUT.members["updatedAt"] - ) - - case 15: - kwargs["failure_reason"] = de.read_string( - _SCHEMA_GET_ONLINE_EVALUATION_CONFIG_OUTPUT.members[ - "failureReason" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_ONLINE_EVALUATION_CONFIG_OUTPUT, consumer=_consumer - ) - if "online_evaluation_config_arn" not in kwargs: - kwargs["online_evaluation_config_arn"] = "" - if "online_evaluation_config_id" not in kwargs: - kwargs["online_evaluation_config_id"] = "" - if "online_evaluation_config_name" not in kwargs: - kwargs["online_evaluation_config_name"] = "" - if "rule" not in kwargs: - kwargs["rule"] = Rule._smithy_default() - if "data_source_config" not in kwargs: - kwargs["data_source_config"] = DataSourceConfigUnknown(tag="") - if "status" not in kwargs: - kwargs["status"] = OnlineEvaluationConfigStatus._corrected("") - if "execution_status" not in kwargs: - kwargs["execution_status"] = OnlineEvaluationExecutionStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -GET_ONLINE_EVALUATION_CONFIG = APIOperation( - input=GetOnlineEvaluationConfigInput, - output=GetOnlineEvaluationConfigOutput, - schema=_SCHEMA_GET_ONLINE_EVALUATION_CONFIG, - input_schema=_SCHEMA_GET_ONLINE_EVALUATION_CONFIG_INPUT, - output_schema=_SCHEMA_GET_ONLINE_EVALUATION_CONFIG_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListOnlineEvaluationConfigsInput: - """Dataclass for ListOnlineEvaluationConfigsInput structure.""" - - next_token: str | None = None - """ - The pagination token from a previous request to retrieve the next page - of results. - """ - - max_results: int | None = None - """ - The maximum number of online evaluation configurations to return in a - single response. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_ONLINE_EVALUATION_CONFIGS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_ONLINE_EVALUATION_CONFIGS_INPUT.members["nextToken"], - self.next_token, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_ONLINE_EVALUATION_CONFIGS_INPUT.members["maxResults"], - self.max_results, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_ONLINE_EVALUATION_CONFIGS_INPUT.members[ - "nextToken" - ] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_ONLINE_EVALUATION_CONFIGS_INPUT.members[ - "maxResults" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_ONLINE_EVALUATION_CONFIGS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class OnlineEvaluationConfigSummary: - """ - The summary information about an online evaluation configuration, - including basic metadata and execution status. - """ - - online_evaluation_config_arn: str - """The Amazon Resource Name (ARN) of the online evaluation configuration.""" - - online_evaluation_config_id: str - """The unique identifier of the online evaluation configuration.""" - - online_evaluation_config_name: str - """The name of the online evaluation configuration.""" - - status: str - """The status of the online evaluation configuration.""" - - execution_status: str - """ - The execution status indicating whether the online evaluation is - currently running. - """ - - created_at: datetime - """The timestamp when the online evaluation configuration was created.""" - - updated_at: datetime - """The timestamp when the online evaluation configuration was last updated.""" - - description: str | None = field(repr=False, default=None) - """The description of the online evaluation configuration.""" - - failure_reason: str | None = None - """ - The reason for failure if the online evaluation configuration execution - failed. - """ - - insights: list[Insight] | None = None - """The list of insight types configured for this evaluation.""" - - clustering_config: ClusteringConfig | None = None - """The clustering configuration for periodic batch evaluation.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ONLINE_EVALUATION_CONFIG_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_ONLINE_EVALUATION_CONFIG_SUMMARY.members[ - "onlineEvaluationConfigArn" - ], - self.online_evaluation_config_arn, - ) - serializer.write_string( - _SCHEMA_ONLINE_EVALUATION_CONFIG_SUMMARY.members[ - "onlineEvaluationConfigId" - ], - self.online_evaluation_config_id, - ) - serializer.write_string( - _SCHEMA_ONLINE_EVALUATION_CONFIG_SUMMARY.members[ - "onlineEvaluationConfigName" - ], - self.online_evaluation_config_name, - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_ONLINE_EVALUATION_CONFIG_SUMMARY.members["description"], - self.description, - ) - - serializer.write_string( - _SCHEMA_ONLINE_EVALUATION_CONFIG_SUMMARY.members["status"], self.status - ) - serializer.write_string( - _SCHEMA_ONLINE_EVALUATION_CONFIG_SUMMARY.members["executionStatus"], - self.execution_status, - ) - serializer.write_timestamp( - _SCHEMA_ONLINE_EVALUATION_CONFIG_SUMMARY.members["createdAt"], - self.created_at, - ) - serializer.write_timestamp( - _SCHEMA_ONLINE_EVALUATION_CONFIG_SUMMARY.members["updatedAt"], - self.updated_at, - ) - if self.failure_reason is not None: - serializer.write_string( - _SCHEMA_ONLINE_EVALUATION_CONFIG_SUMMARY.members["failureReason"], - self.failure_reason, - ) - - if self.insights is not None: - _serialize_insight_list( - serializer, - _SCHEMA_ONLINE_EVALUATION_CONFIG_SUMMARY.members["insights"], - self.insights, - ) - - if self.clustering_config is not None: - serializer.write_struct( - _SCHEMA_ONLINE_EVALUATION_CONFIG_SUMMARY.members["clusteringConfig"], - self.clustering_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["online_evaluation_config_arn"] = de.read_string( - _SCHEMA_ONLINE_EVALUATION_CONFIG_SUMMARY.members[ - "onlineEvaluationConfigArn" - ] - ) - - case 1: - kwargs["online_evaluation_config_id"] = de.read_string( - _SCHEMA_ONLINE_EVALUATION_CONFIG_SUMMARY.members[ - "onlineEvaluationConfigId" - ] - ) - - case 2: - kwargs["online_evaluation_config_name"] = de.read_string( - _SCHEMA_ONLINE_EVALUATION_CONFIG_SUMMARY.members[ - "onlineEvaluationConfigName" - ] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_ONLINE_EVALUATION_CONFIG_SUMMARY.members["description"] - ) - - case 4: - kwargs["status"] = OnlineEvaluationConfigStatus( - de.read_string( - _SCHEMA_ONLINE_EVALUATION_CONFIG_SUMMARY.members["status"] - ) - ) - - case 5: - kwargs["execution_status"] = OnlineEvaluationExecutionStatus( - de.read_string( - _SCHEMA_ONLINE_EVALUATION_CONFIG_SUMMARY.members[ - "executionStatus" - ] - ) - ) - - case 6: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_ONLINE_EVALUATION_CONFIG_SUMMARY.members["createdAt"] - ) - - case 7: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_ONLINE_EVALUATION_CONFIG_SUMMARY.members["updatedAt"] - ) - - case 8: - kwargs["failure_reason"] = de.read_string( - _SCHEMA_ONLINE_EVALUATION_CONFIG_SUMMARY.members[ - "failureReason" - ] - ) - - case 9: - kwargs["insights"] = _deserialize_insight_list( - de, _SCHEMA_ONLINE_EVALUATION_CONFIG_SUMMARY.members["insights"] - ) - - case 10: - kwargs["clustering_config"] = ClusteringConfig.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ONLINE_EVALUATION_CONFIG_SUMMARY, consumer=_consumer - ) - if "online_evaluation_config_arn" not in kwargs: - kwargs["online_evaluation_config_arn"] = "" - if "online_evaluation_config_id" not in kwargs: - kwargs["online_evaluation_config_id"] = "" - if "online_evaluation_config_name" not in kwargs: - kwargs["online_evaluation_config_name"] = "" - if "status" not in kwargs: - kwargs["status"] = OnlineEvaluationConfigStatus._corrected("") - if "execution_status" not in kwargs: - kwargs["execution_status"] = OnlineEvaluationExecutionStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_online_evaluation_config_summary_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[OnlineEvaluationConfigSummary], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_online_evaluation_config_summary_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[OnlineEvaluationConfigSummary]: - result: list[OnlineEvaluationConfigSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(OnlineEvaluationConfigSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListOnlineEvaluationConfigsOutput: - """Dataclass for ListOnlineEvaluationConfigsOutput structure.""" - - online_evaluation_configs: list[OnlineEvaluationConfigSummary] - """ - The list of online evaluation configuration summaries containing basic - information about each configuration. - """ - - next_token: str | None = None - """ - The pagination token to use in a subsequent request to retrieve the next - page of results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_ONLINE_EVALUATION_CONFIGS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_online_evaluation_config_summary_list( - serializer, - _SCHEMA_LIST_ONLINE_EVALUATION_CONFIGS_OUTPUT.members[ - "onlineEvaluationConfigs" - ], - self.online_evaluation_configs, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_ONLINE_EVALUATION_CONFIGS_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["online_evaluation_configs"] = ( - _deserialize_online_evaluation_config_summary_list( - de, - _SCHEMA_LIST_ONLINE_EVALUATION_CONFIGS_OUTPUT.members[ - "onlineEvaluationConfigs" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_ONLINE_EVALUATION_CONFIGS_OUTPUT.members[ - "nextToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_ONLINE_EVALUATION_CONFIGS_OUTPUT, consumer=_consumer - ) - if "online_evaluation_configs" not in kwargs: - kwargs["online_evaluation_configs"] = [] - return kwargs - - -LIST_ONLINE_EVALUATION_CONFIGS = APIOperation( - input=ListOnlineEvaluationConfigsInput, - output=ListOnlineEvaluationConfigsOutput, - schema=_SCHEMA_LIST_ONLINE_EVALUATION_CONFIGS, - input_schema=_SCHEMA_LIST_ONLINE_EVALUATION_CONFIGS_INPUT, - output_schema=_SCHEMA_LIST_ONLINE_EVALUATION_CONFIGS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateOnlineEvaluationConfigInput: - """Dataclass for UpdateOnlineEvaluationConfigInput structure.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If you don't specify this field, a - value is randomly generated for you. If this token matches a previous - request, the service ignores the request, but doesn't return an error. - For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - online_evaluation_config_id: str | None = None - """The unique identifier of the online evaluation configuration to update.""" - - description: str | None = field(repr=False, default=None) - """The updated description of the online evaluation configuration.""" - - rule: Rule | None = None - """ - The updated evaluation rule containing sampling configuration, filters, - and session settings. - """ - - data_source_config: DataSourceConfig | None = None - """ - The updated data source configuration specifying CloudWatch log groups - and service names to monitor. - """ - - evaluators: list[EvaluatorReference] | None = None - """The updated list of evaluators to apply during online evaluation.""" - - insights: list[Insight] | None = None - """The updated list of insight types to run against agent sessions.""" - - clustering_config: ClusteringConfig | None = None - """The updated clustering configuration for periodic batch evaluation.""" - - output_config: OutputConfig | None = None - """ - The configuration that specifies where evaluation results should be - written for monitoring and analysis. - """ - - evaluation_execution_role_arn: str | None = None - """ - The updated Amazon Resource Name (ARN) of the IAM role used for - evaluation execution. - """ - - execution_status: str | None = None - """The updated execution status to enable or disable the online evaluation.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_ONLINE_EVALUATION_CONFIG_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.client_token is not None: - serializer.write_string( - _SCHEMA_UPDATE_ONLINE_EVALUATION_CONFIG_INPUT.members["clientToken"], - self.client_token, - ) - - if self.online_evaluation_config_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_ONLINE_EVALUATION_CONFIG_INPUT.members[ - "onlineEvaluationConfigId" - ], - self.online_evaluation_config_id, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_ONLINE_EVALUATION_CONFIG_INPUT.members["description"], - self.description, - ) - - if self.rule is not None: - serializer.write_struct( - _SCHEMA_UPDATE_ONLINE_EVALUATION_CONFIG_INPUT.members["rule"], self.rule - ) - - if self.data_source_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_ONLINE_EVALUATION_CONFIG_INPUT.members[ - "dataSourceConfig" - ], - self.data_source_config, - ) - - if self.evaluators is not None: - _serialize_evaluator_list( - serializer, - _SCHEMA_UPDATE_ONLINE_EVALUATION_CONFIG_INPUT.members["evaluators"], - self.evaluators, - ) - - if self.insights is not None: - _serialize_insight_list( - serializer, - _SCHEMA_UPDATE_ONLINE_EVALUATION_CONFIG_INPUT.members["insights"], - self.insights, - ) - - if self.clustering_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_ONLINE_EVALUATION_CONFIG_INPUT.members[ - "clusteringConfig" - ], - self.clustering_config, - ) - - if self.output_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_ONLINE_EVALUATION_CONFIG_INPUT.members["outputConfig"], - self.output_config, - ) - - if self.evaluation_execution_role_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_ONLINE_EVALUATION_CONFIG_INPUT.members[ - "evaluationExecutionRoleArn" - ], - self.evaluation_execution_role_arn, - ) - - if self.execution_status is not None: - serializer.write_string( - _SCHEMA_UPDATE_ONLINE_EVALUATION_CONFIG_INPUT.members[ - "executionStatus" - ], - self.execution_status, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["client_token"] = de.read_string( - _SCHEMA_UPDATE_ONLINE_EVALUATION_CONFIG_INPUT.members[ - "clientToken" - ] - ) - - case 1: - kwargs["online_evaluation_config_id"] = de.read_string( - _SCHEMA_UPDATE_ONLINE_EVALUATION_CONFIG_INPUT.members[ - "onlineEvaluationConfigId" - ] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_ONLINE_EVALUATION_CONFIG_INPUT.members[ - "description" - ] - ) - - case 3: - kwargs["rule"] = Rule.deserialize(de) - - case 4: - kwargs["data_source_config"] = ( - _DataSourceConfigDeserializer().deserialize(de) - ) - - case 5: - kwargs["evaluators"] = _deserialize_evaluator_list( - de, - _SCHEMA_UPDATE_ONLINE_EVALUATION_CONFIG_INPUT.members[ - "evaluators" - ], - ) - - case 6: - kwargs["insights"] = _deserialize_insight_list( - de, - _SCHEMA_UPDATE_ONLINE_EVALUATION_CONFIG_INPUT.members[ - "insights" - ], - ) - - case 7: - kwargs["clustering_config"] = ClusteringConfig.deserialize(de) - - case 8: - kwargs["output_config"] = OutputConfig.deserialize(de) - - case 9: - kwargs["evaluation_execution_role_arn"] = de.read_string( - _SCHEMA_UPDATE_ONLINE_EVALUATION_CONFIG_INPUT.members[ - "evaluationExecutionRoleArn" - ] - ) - - case 10: - kwargs["execution_status"] = OnlineEvaluationExecutionStatus( - de.read_string( - _SCHEMA_UPDATE_ONLINE_EVALUATION_CONFIG_INPUT.members[ - "executionStatus" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_ONLINE_EVALUATION_CONFIG_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateOnlineEvaluationConfigOutput: - """Dataclass for UpdateOnlineEvaluationConfigOutput structure.""" - - online_evaluation_config_arn: str - """ - The Amazon Resource Name (ARN) of the updated online evaluation - configuration. - """ - - online_evaluation_config_id: str - """The unique identifier of the updated online evaluation configuration.""" - - updated_at: datetime - """The timestamp when the online evaluation configuration was last updated.""" - - status: str - """The status of the online evaluation configuration.""" - - execution_status: str - """ - The execution status indicating whether the online evaluation is - currently running. - """ - - failure_reason: str | None = None - """ - The reason for failure if the online evaluation configuration update or - execution failed. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_ONLINE_EVALUATION_CONFIG_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_UPDATE_ONLINE_EVALUATION_CONFIG_OUTPUT.members[ - "onlineEvaluationConfigArn" - ], - self.online_evaluation_config_arn, - ) - serializer.write_string( - _SCHEMA_UPDATE_ONLINE_EVALUATION_CONFIG_OUTPUT.members[ - "onlineEvaluationConfigId" - ], - self.online_evaluation_config_id, - ) - serializer.write_timestamp( - _SCHEMA_UPDATE_ONLINE_EVALUATION_CONFIG_OUTPUT.members["updatedAt"], - self.updated_at, - ) - serializer.write_string( - _SCHEMA_UPDATE_ONLINE_EVALUATION_CONFIG_OUTPUT.members["status"], - self.status, - ) - serializer.write_string( - _SCHEMA_UPDATE_ONLINE_EVALUATION_CONFIG_OUTPUT.members["executionStatus"], - self.execution_status, - ) - if self.failure_reason is not None: - serializer.write_string( - _SCHEMA_UPDATE_ONLINE_EVALUATION_CONFIG_OUTPUT.members["failureReason"], - self.failure_reason, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["online_evaluation_config_arn"] = de.read_string( - _SCHEMA_UPDATE_ONLINE_EVALUATION_CONFIG_OUTPUT.members[ - "onlineEvaluationConfigArn" - ] - ) - - case 1: - kwargs["online_evaluation_config_id"] = de.read_string( - _SCHEMA_UPDATE_ONLINE_EVALUATION_CONFIG_OUTPUT.members[ - "onlineEvaluationConfigId" - ] - ) - - case 2: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_UPDATE_ONLINE_EVALUATION_CONFIG_OUTPUT.members[ - "updatedAt" - ] - ) - - case 3: - kwargs["status"] = OnlineEvaluationConfigStatus( - de.read_string( - _SCHEMA_UPDATE_ONLINE_EVALUATION_CONFIG_OUTPUT.members[ - "status" - ] - ) - ) - - case 4: - kwargs["execution_status"] = OnlineEvaluationExecutionStatus( - de.read_string( - _SCHEMA_UPDATE_ONLINE_EVALUATION_CONFIG_OUTPUT.members[ - "executionStatus" - ] - ) - ) - - case 5: - kwargs["failure_reason"] = de.read_string( - _SCHEMA_UPDATE_ONLINE_EVALUATION_CONFIG_OUTPUT.members[ - "failureReason" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_ONLINE_EVALUATION_CONFIG_OUTPUT, consumer=_consumer - ) - if "online_evaluation_config_arn" not in kwargs: - kwargs["online_evaluation_config_arn"] = "" - if "online_evaluation_config_id" not in kwargs: - kwargs["online_evaluation_config_id"] = "" - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "status" not in kwargs: - kwargs["status"] = OnlineEvaluationConfigStatus._corrected("") - if "execution_status" not in kwargs: - kwargs["execution_status"] = OnlineEvaluationExecutionStatus._corrected("") - return kwargs - - -UPDATE_ONLINE_EVALUATION_CONFIG = APIOperation( - input=UpdateOnlineEvaluationConfigInput, - output=UpdateOnlineEvaluationConfigOutput, - schema=_SCHEMA_UPDATE_ONLINE_EVALUATION_CONFIG, - input_schema=_SCHEMA_UPDATE_ONLINE_EVALUATION_CONFIG_INPUT, - output_schema=_SCHEMA_UPDATE_ONLINE_EVALUATION_CONFIG_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class PaymentCredentialProviderVendorType(UnknownEnumMixin, StrEnum): - """ - Supported vendor types for payment providers using non-standard auth - protocols. - """ - - COINBASE_CDP = "CoinbaseCDP" - """Coinbase Developer Platform.""" - STRIPE_PRIVY = "StripePrivy" - """Stripe and Privy.""" - - -@dataclass(kw_only=True) -class CoinbaseCdpConfigurationInput: - """ - Coinbase CDP configuration --- credentials provided by Coinbase - Developer Platform. - """ - - api_key_id: str - """The API key identifier provided by Coinbase Developer Platform.""" - - api_key_secret: str = field(repr=False, default="") - """The API key secret provided by Coinbase Developer Platform.""" - - api_key_secret_source: str | None = None - """ - The source type of the API key secret for the Coinbase Developer - Platform. Use `MANAGED` if the secret is managed by the service, or - `EXTERNAL` if you manage the secret yourself in Amazon Web Services - Secrets Manager. - """ - - api_key_secret_config: SecretReference | None = None - """ - A reference to the Amazon Web Services Secrets Manager secret that - stores the API key secret. This includes the secret ID and the JSON key - used to extract the API key secret value from the secret. Required when - `apiKeySecretSource` is set to `EXTERNAL`. - """ - - wallet_secret: str = field(repr=False, default="") - """The wallet secret provided by Coinbase Developer Platform.""" - - wallet_secret_source: str | None = None - """ - The source type of the wallet secret for the Coinbase Developer - Platform. Use `MANAGED` if the secret is managed by the service, or - `EXTERNAL` if you manage the secret yourself in Amazon Web Services - Secrets Manager. - """ - - wallet_secret_config: SecretReference | None = None - """ - A reference to the Amazon Web Services Secrets Manager secret that - stores the wallet secret. This includes the secret ID and the JSON key - used to extract the wallet secret value from the secret. Required when - `walletSecretSource` is set to `EXTERNAL`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_COINBASE_CDP_CONFIGURATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_COINBASE_CDP_CONFIGURATION_INPUT.members["apiKeyId"], - self.api_key_id, - ) - serializer.write_string( - _SCHEMA_COINBASE_CDP_CONFIGURATION_INPUT.members["apiKeySecret"], - self.api_key_secret, - ) - if self.api_key_secret_source is not None: - serializer.write_string( - _SCHEMA_COINBASE_CDP_CONFIGURATION_INPUT.members["apiKeySecretSource"], - self.api_key_secret_source, - ) - - if self.api_key_secret_config is not None: - serializer.write_struct( - _SCHEMA_COINBASE_CDP_CONFIGURATION_INPUT.members["apiKeySecretConfig"], - self.api_key_secret_config, - ) - - serializer.write_string( - _SCHEMA_COINBASE_CDP_CONFIGURATION_INPUT.members["walletSecret"], - self.wallet_secret, - ) - if self.wallet_secret_source is not None: - serializer.write_string( - _SCHEMA_COINBASE_CDP_CONFIGURATION_INPUT.members["walletSecretSource"], - self.wallet_secret_source, - ) - - if self.wallet_secret_config is not None: - serializer.write_struct( - _SCHEMA_COINBASE_CDP_CONFIGURATION_INPUT.members["walletSecretConfig"], - self.wallet_secret_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["api_key_id"] = de.read_string( - _SCHEMA_COINBASE_CDP_CONFIGURATION_INPUT.members["apiKeyId"] - ) - - case 1: - kwargs["api_key_secret"] = de.read_string( - _SCHEMA_COINBASE_CDP_CONFIGURATION_INPUT.members["apiKeySecret"] - ) - - case 2: - kwargs["api_key_secret_source"] = SecretSourceType( - de.read_string( - _SCHEMA_COINBASE_CDP_CONFIGURATION_INPUT.members[ - "apiKeySecretSource" - ] - ) - ) - - case 3: - kwargs["api_key_secret_config"] = SecretReference.deserialize(de) - - case 4: - kwargs["wallet_secret"] = de.read_string( - _SCHEMA_COINBASE_CDP_CONFIGURATION_INPUT.members["walletSecret"] - ) - - case 5: - kwargs["wallet_secret_source"] = SecretSourceType( - de.read_string( - _SCHEMA_COINBASE_CDP_CONFIGURATION_INPUT.members[ - "walletSecretSource" - ] - ) - ) - - case 6: - kwargs["wallet_secret_config"] = SecretReference.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_COINBASE_CDP_CONFIGURATION_INPUT, consumer=_consumer - ) - if "api_key_id" not in kwargs: - kwargs["api_key_id"] = "" - return kwargs - - -@dataclass(kw_only=True) -class StripePrivyConfigurationInput: - """Stripe Privy configuration --- credentials provided by Stripe and Privy.""" - - app_id: str - """The app ID provided by Privy.""" - - authorization_id: str - """The authorization ID for the Stripe Privy integration.""" - - app_secret: str = field(repr=False, default="") - """The app secret provided by Privy.""" - - app_secret_source: str | None = None - """ - The source type of the app secret. Use `MANAGED` if the secret is - managed by the service, or `EXTERNAL` if you manage the secret yourself - in Amazon Web Services Secrets Manager. - """ - - app_secret_config: SecretReference | None = None - """ - A reference to the Amazon Web Services Secrets Manager secret that - stores the app secret. This includes the secret ID and the JSON key used - to extract the app secret value from the secret. Required when - `appSecretSource` is set to `EXTERNAL`. - """ - - authorization_private_key: str = field(repr=False, default="") - """The authorization private key for the Stripe Privy integration.""" - - authorization_private_key_source: str | None = None - """ - The source type of the authorization private key. Use `MANAGED` if the - secret is managed by the service, or `EXTERNAL` if you manage the secret - yourself in Amazon Web Services Secrets Manager. - """ - - authorization_private_key_config: SecretReference | None = None - """ - A reference to the Amazon Web Services Secrets Manager secret that - stores the authorization private key. This includes the secret ID and - the JSON key used to extract the authorization private key value from - the secret. Required when `authorizationPrivateKeySource` is set to - `EXTERNAL`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STRIPE_PRIVY_CONFIGURATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_STRIPE_PRIVY_CONFIGURATION_INPUT.members["appId"], self.app_id - ) - serializer.write_string( - _SCHEMA_STRIPE_PRIVY_CONFIGURATION_INPUT.members["appSecret"], - self.app_secret, - ) - if self.app_secret_source is not None: - serializer.write_string( - _SCHEMA_STRIPE_PRIVY_CONFIGURATION_INPUT.members["appSecretSource"], - self.app_secret_source, - ) - - if self.app_secret_config is not None: - serializer.write_struct( - _SCHEMA_STRIPE_PRIVY_CONFIGURATION_INPUT.members["appSecretConfig"], - self.app_secret_config, - ) - - serializer.write_string( - _SCHEMA_STRIPE_PRIVY_CONFIGURATION_INPUT.members["authorizationPrivateKey"], - self.authorization_private_key, - ) - if self.authorization_private_key_source is not None: - serializer.write_string( - _SCHEMA_STRIPE_PRIVY_CONFIGURATION_INPUT.members[ - "authorizationPrivateKeySource" - ], - self.authorization_private_key_source, - ) - - if self.authorization_private_key_config is not None: - serializer.write_struct( - _SCHEMA_STRIPE_PRIVY_CONFIGURATION_INPUT.members[ - "authorizationPrivateKeyConfig" - ], - self.authorization_private_key_config, - ) - - serializer.write_string( - _SCHEMA_STRIPE_PRIVY_CONFIGURATION_INPUT.members["authorizationId"], - self.authorization_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["app_id"] = de.read_string( - _SCHEMA_STRIPE_PRIVY_CONFIGURATION_INPUT.members["appId"] - ) - - case 1: - kwargs["app_secret"] = de.read_string( - _SCHEMA_STRIPE_PRIVY_CONFIGURATION_INPUT.members["appSecret"] - ) - - case 2: - kwargs["app_secret_source"] = SecretSourceType( - de.read_string( - _SCHEMA_STRIPE_PRIVY_CONFIGURATION_INPUT.members[ - "appSecretSource" - ] - ) - ) - - case 3: - kwargs["app_secret_config"] = SecretReference.deserialize(de) - - case 4: - kwargs["authorization_private_key"] = de.read_string( - _SCHEMA_STRIPE_PRIVY_CONFIGURATION_INPUT.members[ - "authorizationPrivateKey" - ] - ) - - case 5: - kwargs["authorization_private_key_source"] = SecretSourceType( - de.read_string( - _SCHEMA_STRIPE_PRIVY_CONFIGURATION_INPUT.members[ - "authorizationPrivateKeySource" - ] - ) - ) - - case 6: - kwargs["authorization_private_key_config"] = ( - SecretReference.deserialize(de) - ) - - case 7: - kwargs["authorization_id"] = de.read_string( - _SCHEMA_STRIPE_PRIVY_CONFIGURATION_INPUT.members[ - "authorizationId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_STRIPE_PRIVY_CONFIGURATION_INPUT, consumer=_consumer - ) - if "app_id" not in kwargs: - kwargs["app_id"] = "" - if "authorization_id" not in kwargs: - kwargs["authorization_id"] = "" - return kwargs - - -@dataclass -class PaymentProviderConfigurationInputCoinbaseCdpConfiguration: - """The Coinbase CDP configuration.""" - - value: CoinbaseCdpConfigurationInput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PAYMENT_PROVIDER_CONFIGURATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_PAYMENT_PROVIDER_CONFIGURATION_INPUT.members[ - "coinbaseCdpConfiguration" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=CoinbaseCdpConfigurationInput.deserialize(deserializer)) - - -@dataclass -class PaymentProviderConfigurationInputStripePrivyConfiguration: - """The Stripe Privy configuration.""" - - value: StripePrivyConfigurationInput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PAYMENT_PROVIDER_CONFIGURATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_PAYMENT_PROVIDER_CONFIGURATION_INPUT.members[ - "stripePrivyConfiguration" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=StripePrivyConfigurationInput.deserialize(deserializer)) - - -@dataclass -class PaymentProviderConfigurationInputUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -PaymentProviderConfigurationInput = Union[ - PaymentProviderConfigurationInputCoinbaseCdpConfiguration - | PaymentProviderConfigurationInputStripePrivyConfiguration - | PaymentProviderConfigurationInputUnknown -] -""" -Provider configuration input --- contains secrets for creation and -update. Varies by vendor type. -""" - - -class _PaymentProviderConfigurationInputDeserializer: - _result: PaymentProviderConfigurationInput | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> PaymentProviderConfigurationInput: - self._result = None - deserializer.read_struct( - _SCHEMA_PAYMENT_PROVIDER_CONFIGURATION_INPUT, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - PaymentProviderConfigurationInputCoinbaseCdpConfiguration.deserialize( - de - ) - ) - - case 1: - self._set_result( - PaymentProviderConfigurationInputStripePrivyConfiguration.deserialize( - de - ) - ) - - case _: - self._set_result( - PaymentProviderConfigurationInputUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: PaymentProviderConfigurationInput) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class CreatePaymentCredentialProviderInput: - """Dataclass for CreatePaymentCredentialProviderInput structure.""" - - name: str | None = None - """Unique name for the payment credential provider.""" - - credential_provider_vendor: str | None = None - """ - The vendor type for the payment credential provider (e.g., CoinbaseCDP, - StripePrivy). - """ - - provider_configuration_input: PaymentProviderConfigurationInput | None = None - """Configuration specific to the vendor, including API credentials.""" - - tags: dict[str, str] | None = None - """Optional tags for resource organization.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_PAYMENT_CREDENTIAL_PROVIDER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_PAYMENT_CREDENTIAL_PROVIDER_INPUT.members["name"], - self.name, - ) - - if self.credential_provider_vendor is not None: - serializer.write_string( - _SCHEMA_CREATE_PAYMENT_CREDENTIAL_PROVIDER_INPUT.members[ - "credentialProviderVendor" - ], - self.credential_provider_vendor, - ) - - if self.provider_configuration_input is not None: - serializer.write_struct( - _SCHEMA_CREATE_PAYMENT_CREDENTIAL_PROVIDER_INPUT.members[ - "providerConfigurationInput" - ], - self.provider_configuration_input, - ) - - if self.tags is not None: - _serialize_tags_map( - serializer, - _SCHEMA_CREATE_PAYMENT_CREDENTIAL_PROVIDER_INPUT.members["tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_PAYMENT_CREDENTIAL_PROVIDER_INPUT.members["name"] - ) - - case 1: - kwargs["credential_provider_vendor"] = ( - PaymentCredentialProviderVendorType( - de.read_string( - _SCHEMA_CREATE_PAYMENT_CREDENTIAL_PROVIDER_INPUT.members[ - "credentialProviderVendor" - ] - ) - ) - ) - - case 2: - kwargs["provider_configuration_input"] = ( - _PaymentProviderConfigurationInputDeserializer().deserialize(de) - ) - - case 3: - kwargs["tags"] = _deserialize_tags_map( - de, - _SCHEMA_CREATE_PAYMENT_CREDENTIAL_PROVIDER_INPUT.members[ - "tags" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_PAYMENT_CREDENTIAL_PROVIDER_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CoinbaseCdpConfigurationOutput: - """Coinbase CDP configuration output with secret ARNs.""" - - api_key_id: str - """The API key identifier provided by Coinbase Developer Platform.""" - - api_key_secret_arn: Secret - """ - Contains information about a secret in Amazon Web Services Secrets - Manager. - """ - - wallet_secret_arn: Secret - """ - Contains information about a secret in Amazon Web Services Secrets - Manager. - """ - - api_key_secret_json_key: str | None = None - """ - The JSON key used to extract the API key secret value from the Amazon - Web Services Secrets Manager secret. - """ - - api_key_secret_source: str | None = None - """ - The source type of the API key secret. Either `MANAGED` if the secret is - managed by the service, or `EXTERNAL` if managed by the user in Amazon - Web Services Secrets Manager. - """ - - wallet_secret_json_key: str | None = None - """ - The JSON key used to extract the wallet secret value from the Amazon Web - Services Secrets Manager secret. - """ - - wallet_secret_source: str | None = None - """ - The source type of the wallet secret. Either `MANAGED` if the secret is - managed by the service, or `EXTERNAL` if managed by the user in Amazon - Web Services Secrets Manager. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_COINBASE_CDP_CONFIGURATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_COINBASE_CDP_CONFIGURATION_OUTPUT.members["apiKeyId"], - self.api_key_id, - ) - serializer.write_struct( - _SCHEMA_COINBASE_CDP_CONFIGURATION_OUTPUT.members["apiKeySecretArn"], - self.api_key_secret_arn, - ) - if self.api_key_secret_json_key is not None: - serializer.write_string( - _SCHEMA_COINBASE_CDP_CONFIGURATION_OUTPUT.members[ - "apiKeySecretJsonKey" - ], - self.api_key_secret_json_key, - ) - - if self.api_key_secret_source is not None: - serializer.write_string( - _SCHEMA_COINBASE_CDP_CONFIGURATION_OUTPUT.members["apiKeySecretSource"], - self.api_key_secret_source, - ) - - serializer.write_struct( - _SCHEMA_COINBASE_CDP_CONFIGURATION_OUTPUT.members["walletSecretArn"], - self.wallet_secret_arn, - ) - if self.wallet_secret_json_key is not None: - serializer.write_string( - _SCHEMA_COINBASE_CDP_CONFIGURATION_OUTPUT.members[ - "walletSecretJsonKey" - ], - self.wallet_secret_json_key, - ) - - if self.wallet_secret_source is not None: - serializer.write_string( - _SCHEMA_COINBASE_CDP_CONFIGURATION_OUTPUT.members["walletSecretSource"], - self.wallet_secret_source, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["api_key_id"] = de.read_string( - _SCHEMA_COINBASE_CDP_CONFIGURATION_OUTPUT.members["apiKeyId"] - ) - - case 1: - kwargs["api_key_secret_arn"] = Secret.deserialize(de) - - case 2: - kwargs["api_key_secret_json_key"] = de.read_string( - _SCHEMA_COINBASE_CDP_CONFIGURATION_OUTPUT.members[ - "apiKeySecretJsonKey" - ] - ) - - case 3: - kwargs["api_key_secret_source"] = SecretSourceType( - de.read_string( - _SCHEMA_COINBASE_CDP_CONFIGURATION_OUTPUT.members[ - "apiKeySecretSource" - ] - ) - ) - - case 4: - kwargs["wallet_secret_arn"] = Secret.deserialize(de) - - case 5: - kwargs["wallet_secret_json_key"] = de.read_string( - _SCHEMA_COINBASE_CDP_CONFIGURATION_OUTPUT.members[ - "walletSecretJsonKey" - ] - ) - - case 6: - kwargs["wallet_secret_source"] = SecretSourceType( - de.read_string( - _SCHEMA_COINBASE_CDP_CONFIGURATION_OUTPUT.members[ - "walletSecretSource" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_COINBASE_CDP_CONFIGURATION_OUTPUT, consumer=_consumer - ) - if "api_key_id" not in kwargs: - kwargs["api_key_id"] = "" - if "api_key_secret_arn" not in kwargs: - kwargs["api_key_secret_arn"] = Secret._smithy_default() - if "wallet_secret_arn" not in kwargs: - kwargs["wallet_secret_arn"] = Secret._smithy_default() - return kwargs - - -@dataclass(kw_only=True) -class StripePrivyConfigurationOutput: - """Stripe Privy configuration output with secret ARNs.""" - - app_id: str - """The app ID provided by Privy.""" - - app_secret_arn: Secret - """ - Contains information about a secret in Amazon Web Services Secrets - Manager. - """ - - authorization_private_key_arn: Secret - """ - Contains information about a secret in Amazon Web Services Secrets - Manager. - """ - - authorization_id: str - """The authorization ID for the Stripe Privy integration.""" - - app_secret_json_key: str | None = None - """ - The JSON key used to extract the app secret value from the Amazon Web - Services Secrets Manager secret. - """ - - app_secret_source: str | None = None - """ - The source type of the app secret. Either `MANAGED` if the secret is - managed by the service, or `EXTERNAL` if managed by the user in Amazon - Web Services Secrets Manager. - """ - - authorization_private_key_json_key: str | None = None - """ - The JSON key used to extract the authorization private key value from - the Amazon Web Services Secrets Manager secret. - """ - - authorization_private_key_source: str | None = None - """ - The source type of the authorization private key. Either `MANAGED` if - the secret is managed by the service, or `EXTERNAL` if managed by the - user in Amazon Web Services Secrets Manager. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STRIPE_PRIVY_CONFIGURATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_STRIPE_PRIVY_CONFIGURATION_OUTPUT.members["appId"], self.app_id - ) - serializer.write_struct( - _SCHEMA_STRIPE_PRIVY_CONFIGURATION_OUTPUT.members["appSecretArn"], - self.app_secret_arn, - ) - if self.app_secret_json_key is not None: - serializer.write_string( - _SCHEMA_STRIPE_PRIVY_CONFIGURATION_OUTPUT.members["appSecretJsonKey"], - self.app_secret_json_key, - ) - - if self.app_secret_source is not None: - serializer.write_string( - _SCHEMA_STRIPE_PRIVY_CONFIGURATION_OUTPUT.members["appSecretSource"], - self.app_secret_source, - ) - - serializer.write_struct( - _SCHEMA_STRIPE_PRIVY_CONFIGURATION_OUTPUT.members[ - "authorizationPrivateKeyArn" - ], - self.authorization_private_key_arn, - ) - if self.authorization_private_key_json_key is not None: - serializer.write_string( - _SCHEMA_STRIPE_PRIVY_CONFIGURATION_OUTPUT.members[ - "authorizationPrivateKeyJsonKey" - ], - self.authorization_private_key_json_key, - ) - - if self.authorization_private_key_source is not None: - serializer.write_string( - _SCHEMA_STRIPE_PRIVY_CONFIGURATION_OUTPUT.members[ - "authorizationPrivateKeySource" - ], - self.authorization_private_key_source, - ) - - serializer.write_string( - _SCHEMA_STRIPE_PRIVY_CONFIGURATION_OUTPUT.members["authorizationId"], - self.authorization_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["app_id"] = de.read_string( - _SCHEMA_STRIPE_PRIVY_CONFIGURATION_OUTPUT.members["appId"] - ) - - case 1: - kwargs["app_secret_arn"] = Secret.deserialize(de) - - case 2: - kwargs["app_secret_json_key"] = de.read_string( - _SCHEMA_STRIPE_PRIVY_CONFIGURATION_OUTPUT.members[ - "appSecretJsonKey" - ] - ) - - case 3: - kwargs["app_secret_source"] = SecretSourceType( - de.read_string( - _SCHEMA_STRIPE_PRIVY_CONFIGURATION_OUTPUT.members[ - "appSecretSource" - ] - ) - ) - - case 4: - kwargs["authorization_private_key_arn"] = Secret.deserialize(de) - - case 5: - kwargs["authorization_private_key_json_key"] = de.read_string( - _SCHEMA_STRIPE_PRIVY_CONFIGURATION_OUTPUT.members[ - "authorizationPrivateKeyJsonKey" - ] - ) - - case 6: - kwargs["authorization_private_key_source"] = SecretSourceType( - de.read_string( - _SCHEMA_STRIPE_PRIVY_CONFIGURATION_OUTPUT.members[ - "authorizationPrivateKeySource" - ] - ) - ) - - case 7: - kwargs["authorization_id"] = de.read_string( - _SCHEMA_STRIPE_PRIVY_CONFIGURATION_OUTPUT.members[ - "authorizationId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_STRIPE_PRIVY_CONFIGURATION_OUTPUT, consumer=_consumer - ) - if "app_id" not in kwargs: - kwargs["app_id"] = "" - if "app_secret_arn" not in kwargs: - kwargs["app_secret_arn"] = Secret._smithy_default() - if "authorization_private_key_arn" not in kwargs: - kwargs["authorization_private_key_arn"] = Secret._smithy_default() - if "authorization_id" not in kwargs: - kwargs["authorization_id"] = "" - return kwargs - - -@dataclass -class PaymentProviderConfigurationOutputCoinbaseCdpConfiguration: - """The Coinbase CDP configuration.""" - - value: CoinbaseCdpConfigurationOutput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PAYMENT_PROVIDER_CONFIGURATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_PAYMENT_PROVIDER_CONFIGURATION_OUTPUT.members[ - "coinbaseCdpConfiguration" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=CoinbaseCdpConfigurationOutput.deserialize(deserializer)) - - -@dataclass -class PaymentProviderConfigurationOutputStripePrivyConfiguration: - """The Stripe Privy configuration.""" - - value: StripePrivyConfigurationOutput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PAYMENT_PROVIDER_CONFIGURATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_PAYMENT_PROVIDER_CONFIGURATION_OUTPUT.members[ - "stripePrivyConfiguration" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=StripePrivyConfigurationOutput.deserialize(deserializer)) - - -@dataclass -class PaymentProviderConfigurationOutputUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -PaymentProviderConfigurationOutput = Union[ - PaymentProviderConfigurationOutputCoinbaseCdpConfiguration - | PaymentProviderConfigurationOutputStripePrivyConfiguration - | PaymentProviderConfigurationOutputUnknown -] -""" -Provider configuration output --- no raw secrets, only ARNs. Varies by -vendor type. -""" - - -class _PaymentProviderConfigurationOutputDeserializer: - _result: PaymentProviderConfigurationOutput | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> PaymentProviderConfigurationOutput: - self._result = None - deserializer.read_struct( - _SCHEMA_PAYMENT_PROVIDER_CONFIGURATION_OUTPUT, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - PaymentProviderConfigurationOutputCoinbaseCdpConfiguration.deserialize( - de - ) - ) - - case 1: - self._set_result( - PaymentProviderConfigurationOutputStripePrivyConfiguration.deserialize( - de - ) - ) - - case _: - self._set_result( - PaymentProviderConfigurationOutputUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: PaymentProviderConfigurationOutput) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class CreatePaymentCredentialProviderOutput: - """Dataclass for CreatePaymentCredentialProviderOutput structure.""" - - name: str - """The name of the created payment credential provider.""" - - credential_provider_vendor: str - """The vendor type for the created payment credential provider.""" - - credential_provider_arn: str - """ - The Amazon Resource Name (ARN) of the created payment credential - provider. - """ - - provider_configuration_output: PaymentProviderConfigurationOutput - """ - Output configuration (contains secret ARNs, excludes actual secret - values). - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT.members["name"], self.name - ) - serializer.write_string( - _SCHEMA_CREATE_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT.members[ - "credentialProviderVendor" - ], - self.credential_provider_vendor, - ) - serializer.write_string( - _SCHEMA_CREATE_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT.members[ - "credentialProviderArn" - ], - self.credential_provider_arn, - ) - serializer.write_struct( - _SCHEMA_CREATE_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT.members[ - "providerConfigurationOutput" - ], - self.provider_configuration_output, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT.members[ - "name" - ] - ) - - case 1: - kwargs["credential_provider_vendor"] = ( - PaymentCredentialProviderVendorType( - de.read_string( - _SCHEMA_CREATE_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT.members[ - "credentialProviderVendor" - ] - ) - ) - ) - - case 2: - kwargs["credential_provider_arn"] = de.read_string( - _SCHEMA_CREATE_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT.members[ - "credentialProviderArn" - ] - ) - - case 3: - kwargs["provider_configuration_output"] = ( - _PaymentProviderConfigurationOutputDeserializer().deserialize( - de - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT, consumer=_consumer - ) - if "name" not in kwargs: - kwargs["name"] = "" - if "credential_provider_vendor" not in kwargs: - kwargs["credential_provider_vendor"] = ( - PaymentCredentialProviderVendorType._corrected("") - ) - if "credential_provider_arn" not in kwargs: - kwargs["credential_provider_arn"] = "" - if "provider_configuration_output" not in kwargs: - kwargs["provider_configuration_output"] = ( - PaymentProviderConfigurationOutputUnknown(tag="") - ) - return kwargs - - -CREATE_PAYMENT_CREDENTIAL_PROVIDER = APIOperation( - input=CreatePaymentCredentialProviderInput, - output=CreatePaymentCredentialProviderOutput, - schema=_SCHEMA_CREATE_PAYMENT_CREDENTIAL_PROVIDER, - input_schema=_SCHEMA_CREATE_PAYMENT_CREDENTIAL_PROVIDER_INPUT, - output_schema=_SCHEMA_CREATE_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#DecryptionFailure" - ): DecryptionFailure, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#EncryptionFailure" - ): EncryptionFailure, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceLimitExceededException" - ): ResourceLimitExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#UnauthorizedException" - ): UnauthorizedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_DECRYPTION_FAILURE, - _SCHEMA_ENCRYPTION_FAILURE, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeletePaymentCredentialProviderInput: - """Dataclass for DeletePaymentCredentialProviderInput structure.""" - - name: str | None = None - """The name of the payment credential provider to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_PAYMENT_CREDENTIAL_PROVIDER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_DELETE_PAYMENT_CREDENTIAL_PROVIDER_INPUT.members["name"], - self.name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_DELETE_PAYMENT_CREDENTIAL_PROVIDER_INPUT.members["name"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_PAYMENT_CREDENTIAL_PROVIDER_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeletePaymentCredentialProviderOutput: - """Dataclass for DeletePaymentCredentialProviderOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT, consumer=_consumer - ) - return kwargs - - -DELETE_PAYMENT_CREDENTIAL_PROVIDER = APIOperation( - input=DeletePaymentCredentialProviderInput, - output=DeletePaymentCredentialProviderOutput, - schema=_SCHEMA_DELETE_PAYMENT_CREDENTIAL_PROVIDER, - input_schema=_SCHEMA_DELETE_PAYMENT_CREDENTIAL_PROVIDER_INPUT, - output_schema=_SCHEMA_DELETE_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#UnauthorizedException" - ): UnauthorizedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetPaymentCredentialProviderInput: - """Dataclass for GetPaymentCredentialProviderInput structure.""" - - name: str | None = None - """The name of the payment credential provider to retrieve.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_PAYMENT_CREDENTIAL_PROVIDER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_GET_PAYMENT_CREDENTIAL_PROVIDER_INPUT.members["name"], self.name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_GET_PAYMENT_CREDENTIAL_PROVIDER_INPUT.members["name"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_PAYMENT_CREDENTIAL_PROVIDER_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetPaymentCredentialProviderOutput: - """Dataclass for GetPaymentCredentialProviderOutput structure.""" - - name: str - """The name of the payment credential provider.""" - - credential_provider_arn: str - """The Amazon Resource Name (ARN) of the payment credential provider.""" - - credential_provider_vendor: str - """The vendor type for the payment credential provider.""" - - provider_configuration_output: PaymentProviderConfigurationOutput - """ - Output configuration (contains secret ARNs, excludes actual secret - values). - """ - - created_time: datetime - """The timestamp when the payment credential provider was created.""" - - last_updated_time: datetime - """The timestamp when the payment credential provider was last updated.""" - - tags: dict[str, str] | None = None - """The tags associated with the payment credential provider.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT.members["name"], self.name - ) - serializer.write_string( - _SCHEMA_GET_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT.members[ - "credentialProviderArn" - ], - self.credential_provider_arn, - ) - serializer.write_string( - _SCHEMA_GET_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT.members[ - "credentialProviderVendor" - ], - self.credential_provider_vendor, - ) - serializer.write_struct( - _SCHEMA_GET_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT.members[ - "providerConfigurationOutput" - ], - self.provider_configuration_output, - ) - serializer.write_timestamp( - _SCHEMA_GET_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT.members["createdTime"], - self.created_time, - ) - serializer.write_timestamp( - _SCHEMA_GET_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT.members["lastUpdatedTime"], - self.last_updated_time, - ) - if self.tags is not None: - _serialize_tags_map( - serializer, - _SCHEMA_GET_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT.members["tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_GET_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT.members["name"] - ) - - case 1: - kwargs["credential_provider_arn"] = de.read_string( - _SCHEMA_GET_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT.members[ - "credentialProviderArn" - ] - ) - - case 2: - kwargs["credential_provider_vendor"] = ( - PaymentCredentialProviderVendorType( - de.read_string( - _SCHEMA_GET_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT.members[ - "credentialProviderVendor" - ] - ) - ) - ) - - case 3: - kwargs["provider_configuration_output"] = ( - _PaymentProviderConfigurationOutputDeserializer().deserialize( - de - ) - ) - - case 4: - kwargs["created_time"] = de.read_timestamp( - _SCHEMA_GET_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT.members[ - "createdTime" - ] - ) - - case 5: - kwargs["last_updated_time"] = de.read_timestamp( - _SCHEMA_GET_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT.members[ - "lastUpdatedTime" - ] - ) - - case 6: - kwargs["tags"] = _deserialize_tags_map( - de, - _SCHEMA_GET_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT.members["tags"], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT, consumer=_consumer - ) - if "name" not in kwargs: - kwargs["name"] = "" - if "credential_provider_arn" not in kwargs: - kwargs["credential_provider_arn"] = "" - if "credential_provider_vendor" not in kwargs: - kwargs["credential_provider_vendor"] = ( - PaymentCredentialProviderVendorType._corrected("") - ) - if "provider_configuration_output" not in kwargs: - kwargs["provider_configuration_output"] = ( - PaymentProviderConfigurationOutputUnknown(tag="") - ) - if "created_time" not in kwargs: - kwargs["created_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "last_updated_time" not in kwargs: - kwargs["last_updated_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -GET_PAYMENT_CREDENTIAL_PROVIDER = APIOperation( - input=GetPaymentCredentialProviderInput, - output=GetPaymentCredentialProviderOutput, - schema=_SCHEMA_GET_PAYMENT_CREDENTIAL_PROVIDER, - input_schema=_SCHEMA_GET_PAYMENT_CREDENTIAL_PROVIDER_INPUT, - output_schema=_SCHEMA_GET_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#DecryptionFailure" - ): DecryptionFailure, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#UnauthorizedException" - ): UnauthorizedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_DECRYPTION_FAILURE, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListPaymentCredentialProvidersInput: - """Dataclass for ListPaymentCredentialProvidersInput structure.""" - - next_token: str | None = None - """Pagination token.""" - - max_results: int = 10 - """Maximum number of results to return.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_PAYMENT_CREDENTIAL_PROVIDERS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_PAYMENT_CREDENTIAL_PROVIDERS_INPUT.members["nextToken"], - self.next_token, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_PAYMENT_CREDENTIAL_PROVIDERS_INPUT.members["maxResults"], - self.max_results, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_PAYMENT_CREDENTIAL_PROVIDERS_INPUT.members[ - "nextToken" - ] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_PAYMENT_CREDENTIAL_PROVIDERS_INPUT.members[ - "maxResults" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_PAYMENT_CREDENTIAL_PROVIDERS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class PaymentCredentialProviderItem: - """Contains summary information about a payment credential provider.""" - - name: str - """The name of the payment credential provider.""" - - credential_provider_vendor: str - """The vendor type for the payment credential provider.""" - - credential_provider_arn: str - """The Amazon Resource Name (ARN) of the payment credential provider.""" - - created_time: datetime - """The timestamp when the payment credential provider was created.""" - - last_updated_time: datetime - """The timestamp when the payment credential provider was last updated.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PAYMENT_CREDENTIAL_PROVIDER_ITEM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_PAYMENT_CREDENTIAL_PROVIDER_ITEM.members["name"], self.name - ) - serializer.write_string( - _SCHEMA_PAYMENT_CREDENTIAL_PROVIDER_ITEM.members[ - "credentialProviderVendor" - ], - self.credential_provider_vendor, - ) - serializer.write_string( - _SCHEMA_PAYMENT_CREDENTIAL_PROVIDER_ITEM.members["credentialProviderArn"], - self.credential_provider_arn, - ) - serializer.write_timestamp( - _SCHEMA_PAYMENT_CREDENTIAL_PROVIDER_ITEM.members["createdTime"], - self.created_time, - ) - serializer.write_timestamp( - _SCHEMA_PAYMENT_CREDENTIAL_PROVIDER_ITEM.members["lastUpdatedTime"], - self.last_updated_time, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_PAYMENT_CREDENTIAL_PROVIDER_ITEM.members["name"] - ) - - case 1: - kwargs["credential_provider_vendor"] = ( - PaymentCredentialProviderVendorType( - de.read_string( - _SCHEMA_PAYMENT_CREDENTIAL_PROVIDER_ITEM.members[ - "credentialProviderVendor" - ] - ) - ) - ) - - case 2: - kwargs["credential_provider_arn"] = de.read_string( - _SCHEMA_PAYMENT_CREDENTIAL_PROVIDER_ITEM.members[ - "credentialProviderArn" - ] - ) - - case 3: - kwargs["created_time"] = de.read_timestamp( - _SCHEMA_PAYMENT_CREDENTIAL_PROVIDER_ITEM.members["createdTime"] - ) - - case 4: - kwargs["last_updated_time"] = de.read_timestamp( - _SCHEMA_PAYMENT_CREDENTIAL_PROVIDER_ITEM.members[ - "lastUpdatedTime" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PAYMENT_CREDENTIAL_PROVIDER_ITEM, consumer=_consumer - ) - if "name" not in kwargs: - kwargs["name"] = "" - if "credential_provider_vendor" not in kwargs: - kwargs["credential_provider_vendor"] = ( - PaymentCredentialProviderVendorType._corrected("") - ) - if "credential_provider_arn" not in kwargs: - kwargs["credential_provider_arn"] = "" - if "created_time" not in kwargs: - kwargs["created_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "last_updated_time" not in kwargs: - kwargs["last_updated_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_payment_credential_providers( - serializer: ShapeSerializer, - schema: Schema, - value: list[PaymentCredentialProviderItem], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_payment_credential_providers( - deserializer: ShapeDeserializer, schema: Schema -) -> list[PaymentCredentialProviderItem]: - result: list[PaymentCredentialProviderItem] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(PaymentCredentialProviderItem.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListPaymentCredentialProvidersOutput: - """Dataclass for ListPaymentCredentialProvidersOutput structure.""" - - credential_providers: list[PaymentCredentialProviderItem] - """The list of payment credential providers.""" - - next_token: str | None = None - """Pagination token for the next page of results.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_PAYMENT_CREDENTIAL_PROVIDERS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_payment_credential_providers( - serializer, - _SCHEMA_LIST_PAYMENT_CREDENTIAL_PROVIDERS_OUTPUT.members[ - "credentialProviders" - ], - self.credential_providers, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_PAYMENT_CREDENTIAL_PROVIDERS_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["credential_providers"] = ( - _deserialize_payment_credential_providers( - de, - _SCHEMA_LIST_PAYMENT_CREDENTIAL_PROVIDERS_OUTPUT.members[ - "credentialProviders" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_PAYMENT_CREDENTIAL_PROVIDERS_OUTPUT.members[ - "nextToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_PAYMENT_CREDENTIAL_PROVIDERS_OUTPUT, consumer=_consumer - ) - if "credential_providers" not in kwargs: - kwargs["credential_providers"] = [] - return kwargs - - -LIST_PAYMENT_CREDENTIAL_PROVIDERS = APIOperation( - input=ListPaymentCredentialProvidersInput, - output=ListPaymentCredentialProvidersOutput, - schema=_SCHEMA_LIST_PAYMENT_CREDENTIAL_PROVIDERS, - input_schema=_SCHEMA_LIST_PAYMENT_CREDENTIAL_PROVIDERS_INPUT, - output_schema=_SCHEMA_LIST_PAYMENT_CREDENTIAL_PROVIDERS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#UnauthorizedException" - ): UnauthorizedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdatePaymentCredentialProviderInput: - """Dataclass for UpdatePaymentCredentialProviderInput structure.""" - - name: str | None = None - """The name of the payment credential provider to update.""" - - credential_provider_vendor: str | None = None - """ - The vendor type for the payment credential provider (e.g., CoinbaseCDP, - StripePrivy). - """ - - provider_configuration_input: PaymentProviderConfigurationInput | None = None - """Configuration specific to the vendor, including API credentials.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_PAYMENT_CREDENTIAL_PROVIDER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_UPDATE_PAYMENT_CREDENTIAL_PROVIDER_INPUT.members["name"], - self.name, - ) - - if self.credential_provider_vendor is not None: - serializer.write_string( - _SCHEMA_UPDATE_PAYMENT_CREDENTIAL_PROVIDER_INPUT.members[ - "credentialProviderVendor" - ], - self.credential_provider_vendor, - ) - - if self.provider_configuration_input is not None: - serializer.write_struct( - _SCHEMA_UPDATE_PAYMENT_CREDENTIAL_PROVIDER_INPUT.members[ - "providerConfigurationInput" - ], - self.provider_configuration_input, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_PAYMENT_CREDENTIAL_PROVIDER_INPUT.members["name"] - ) - - case 1: - kwargs["credential_provider_vendor"] = ( - PaymentCredentialProviderVendorType( - de.read_string( - _SCHEMA_UPDATE_PAYMENT_CREDENTIAL_PROVIDER_INPUT.members[ - "credentialProviderVendor" - ] - ) - ) - ) - - case 2: - kwargs["provider_configuration_input"] = ( - _PaymentProviderConfigurationInputDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_PAYMENT_CREDENTIAL_PROVIDER_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdatePaymentCredentialProviderOutput: - """Dataclass for UpdatePaymentCredentialProviderOutput structure.""" - - name: str - """The name of the updated payment credential provider.""" - - credential_provider_vendor: str - """The vendor type for the updated payment credential provider.""" - - credential_provider_arn: str - """ - The Amazon Resource Name (ARN) of the updated payment credential - provider. - """ - - provider_configuration_output: PaymentProviderConfigurationOutput - """ - Output configuration (contains secret ARNs, excludes actual secret - values). - """ - - created_time: datetime - """The timestamp when the payment credential provider was created.""" - - last_updated_time: datetime - """The timestamp when the payment credential provider was last updated.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_UPDATE_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT.members["name"], self.name - ) - serializer.write_string( - _SCHEMA_UPDATE_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT.members[ - "credentialProviderVendor" - ], - self.credential_provider_vendor, - ) - serializer.write_string( - _SCHEMA_UPDATE_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT.members[ - "credentialProviderArn" - ], - self.credential_provider_arn, - ) - serializer.write_struct( - _SCHEMA_UPDATE_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT.members[ - "providerConfigurationOutput" - ], - self.provider_configuration_output, - ) - serializer.write_timestamp( - _SCHEMA_UPDATE_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT.members["createdTime"], - self.created_time, - ) - serializer.write_timestamp( - _SCHEMA_UPDATE_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT.members[ - "lastUpdatedTime" - ], - self.last_updated_time, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT.members[ - "name" - ] - ) - - case 1: - kwargs["credential_provider_vendor"] = ( - PaymentCredentialProviderVendorType( - de.read_string( - _SCHEMA_UPDATE_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT.members[ - "credentialProviderVendor" - ] - ) - ) - ) - - case 2: - kwargs["credential_provider_arn"] = de.read_string( - _SCHEMA_UPDATE_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT.members[ - "credentialProviderArn" - ] - ) - - case 3: - kwargs["provider_configuration_output"] = ( - _PaymentProviderConfigurationOutputDeserializer().deserialize( - de - ) - ) - - case 4: - kwargs["created_time"] = de.read_timestamp( - _SCHEMA_UPDATE_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT.members[ - "createdTime" - ] - ) - - case 5: - kwargs["last_updated_time"] = de.read_timestamp( - _SCHEMA_UPDATE_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT.members[ - "lastUpdatedTime" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT, consumer=_consumer - ) - if "name" not in kwargs: - kwargs["name"] = "" - if "credential_provider_vendor" not in kwargs: - kwargs["credential_provider_vendor"] = ( - PaymentCredentialProviderVendorType._corrected("") - ) - if "credential_provider_arn" not in kwargs: - kwargs["credential_provider_arn"] = "" - if "provider_configuration_output" not in kwargs: - kwargs["provider_configuration_output"] = ( - PaymentProviderConfigurationOutputUnknown(tag="") - ) - if "created_time" not in kwargs: - kwargs["created_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "last_updated_time" not in kwargs: - kwargs["last_updated_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -UPDATE_PAYMENT_CREDENTIAL_PROVIDER = APIOperation( - input=UpdatePaymentCredentialProviderInput, - output=UpdatePaymentCredentialProviderOutput, - schema=_SCHEMA_UPDATE_PAYMENT_CREDENTIAL_PROVIDER, - input_schema=_SCHEMA_UPDATE_PAYMENT_CREDENTIAL_PROVIDER_INPUT, - output_schema=_SCHEMA_UPDATE_PAYMENT_CREDENTIAL_PROVIDER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#DecryptionFailure" - ): DecryptionFailure, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#EncryptionFailure" - ): EncryptionFailure, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#UnauthorizedException" - ): UnauthorizedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_DECRYPTION_FAILURE, - _SCHEMA_ENCRYPTION_FAILURE, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class PaymentsAuthorizerType(UnknownEnumMixin, StrEnum): - CUSTOM_JWT = "CUSTOM_JWT" - AWS_IAM = "AWS_IAM" - - -@dataclass(kw_only=True) -class CreatePaymentManagerInput: - """Dataclass for CreatePaymentManagerInput structure.""" - - name: str | None = None - """The name of the payment manager.""" - - description: str | None = None - """A description of the payment manager.""" - - authorizer_type: str | None = None - """ - The type of authorizer to use for the payment manager. - - - `CUSTOM_JWT` - Authorize with a bearer token. - - - `AWS_IAM` - Authorize with your Amazon Web Services IAM credentials. - """ - - authorizer_configuration: AuthorizerConfiguration | None = None - """The authorizer configuration for the payment manager.""" - - role_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the IAM role that the payment manager - assumes to access resources on your behalf. - """ - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If you don't specify this field, a - value is randomly generated for you. If this token matches a previous - request, the service ignores the request, but doesn't return an error. - For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - tags: dict[str, str] | None = None - """A map of tag keys and values to assign to the payment manager.""" - - kms_key_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the customer managed KMS key to use - for encrypting sensitive payment manager data at rest. If you don't - specify a key, the data is encrypted with an Amazon Web Services owned - key. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_PAYMENT_MANAGER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_PAYMENT_MANAGER_INPUT.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_PAYMENT_MANAGER_INPUT.members["description"], - self.description, - ) - - if self.authorizer_type is not None: - serializer.write_string( - _SCHEMA_CREATE_PAYMENT_MANAGER_INPUT.members["authorizerType"], - self.authorizer_type, - ) - - if self.authorizer_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_PAYMENT_MANAGER_INPUT.members["authorizerConfiguration"], - self.authorizer_configuration, - ) - - if self.role_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_PAYMENT_MANAGER_INPUT.members["roleArn"], self.role_arn - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_PAYMENT_MANAGER_INPUT.members["clientToken"], - self.client_token, - ) - - if self.tags is not None: - _serialize_tags_map( - serializer, - _SCHEMA_CREATE_PAYMENT_MANAGER_INPUT.members["tags"], - self.tags, - ) - - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_PAYMENT_MANAGER_INPUT.members["kmsKeyArn"], - self.kms_key_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_PAYMENT_MANAGER_INPUT.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_PAYMENT_MANAGER_INPUT.members["description"] - ) - - case 2: - kwargs["authorizer_type"] = PaymentsAuthorizerType( - de.read_string( - _SCHEMA_CREATE_PAYMENT_MANAGER_INPUT.members[ - "authorizerType" - ] - ) - ) - - case 3: - kwargs["authorizer_configuration"] = ( - _AuthorizerConfigurationDeserializer().deserialize(de) - ) - - case 4: - kwargs["role_arn"] = de.read_string( - _SCHEMA_CREATE_PAYMENT_MANAGER_INPUT.members["roleArn"] - ) - - case 5: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_PAYMENT_MANAGER_INPUT.members["clientToken"] - ) - - case 6: - kwargs["tags"] = _deserialize_tags_map( - de, _SCHEMA_CREATE_PAYMENT_MANAGER_INPUT.members["tags"] - ) - - case 7: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_CREATE_PAYMENT_MANAGER_INPUT.members["kmsKeyArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_PAYMENT_MANAGER_INPUT, consumer=_consumer - ) - return kwargs - - -class PaymentManagerStatus(UnknownEnumMixin, StrEnum): - CREATING = "CREATING" - UPDATING = "UPDATING" - DELETING = "DELETING" - READY = "READY" - CREATE_FAILED = "CREATE_FAILED" - UPDATE_FAILED = "UPDATE_FAILED" - DELETE_FAILED = "DELETE_FAILED" - - -@dataclass(kw_only=True) -class CreatePaymentManagerOutput: - """Dataclass for CreatePaymentManagerOutput structure.""" - - payment_manager_arn: str - """The Amazon Resource Name (ARN) of the created payment manager.""" - - payment_manager_id: str - """The unique identifier of the created payment manager.""" - - name: str - """The name of the created payment manager.""" - - authorizer_type: str - """The type of authorizer for the created payment manager.""" - - role_arn: str - """ - The Amazon Resource Name (ARN) of the IAM role associated with the - created payment manager. - """ - - created_at: datetime - """The timestamp when the payment manager was created.""" - - status: str - """ - The current status of the payment manager. Possible values include - `CREATING`, `READY`, `UPDATING`, `DELETING`, `CREATE_FAILED`, - `UPDATE_FAILED`, and `DELETE_FAILED`. - """ - - authorizer_configuration: AuthorizerConfiguration | None = None - """ - Represents inbound authorization configuration options used to - authenticate incoming requests. - """ - - workload_identity_details: WorkloadIdentityDetails | None = None - """The information about the workload identity.""" - - tags: dict[str, str] | None = None - """The tags associated with the created payment manager.""" - - kms_key_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the KMS key used to encrypt sensitive - payment manager data at rest, if configured. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_PAYMENT_MANAGER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_PAYMENT_MANAGER_OUTPUT.members["paymentManagerArn"], - self.payment_manager_arn, - ) - serializer.write_string( - _SCHEMA_CREATE_PAYMENT_MANAGER_OUTPUT.members["paymentManagerId"], - self.payment_manager_id, - ) - serializer.write_string( - _SCHEMA_CREATE_PAYMENT_MANAGER_OUTPUT.members["name"], self.name - ) - serializer.write_string( - _SCHEMA_CREATE_PAYMENT_MANAGER_OUTPUT.members["authorizerType"], - self.authorizer_type, - ) - if self.authorizer_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_PAYMENT_MANAGER_OUTPUT.members[ - "authorizerConfiguration" - ], - self.authorizer_configuration, - ) - - serializer.write_string( - _SCHEMA_CREATE_PAYMENT_MANAGER_OUTPUT.members["roleArn"], self.role_arn - ) - if self.workload_identity_details is not None: - serializer.write_struct( - _SCHEMA_CREATE_PAYMENT_MANAGER_OUTPUT.members[ - "workloadIdentityDetails" - ], - self.workload_identity_details, - ) - - serializer.write_timestamp( - _SCHEMA_CREATE_PAYMENT_MANAGER_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_string( - _SCHEMA_CREATE_PAYMENT_MANAGER_OUTPUT.members["status"], self.status - ) - if self.tags is not None: - _serialize_tags_map( - serializer, - _SCHEMA_CREATE_PAYMENT_MANAGER_OUTPUT.members["tags"], - self.tags, - ) - - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_PAYMENT_MANAGER_OUTPUT.members["kmsKeyArn"], - self.kms_key_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["payment_manager_arn"] = de.read_string( - _SCHEMA_CREATE_PAYMENT_MANAGER_OUTPUT.members[ - "paymentManagerArn" - ] - ) - - case 1: - kwargs["payment_manager_id"] = de.read_string( - _SCHEMA_CREATE_PAYMENT_MANAGER_OUTPUT.members[ - "paymentManagerId" - ] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_PAYMENT_MANAGER_OUTPUT.members["name"] - ) - - case 3: - kwargs["authorizer_type"] = PaymentsAuthorizerType( - de.read_string( - _SCHEMA_CREATE_PAYMENT_MANAGER_OUTPUT.members[ - "authorizerType" - ] - ) - ) - - case 4: - kwargs["authorizer_configuration"] = ( - _AuthorizerConfigurationDeserializer().deserialize(de) - ) - - case 5: - kwargs["role_arn"] = de.read_string( - _SCHEMA_CREATE_PAYMENT_MANAGER_OUTPUT.members["roleArn"] - ) - - case 6: - kwargs["workload_identity_details"] = ( - WorkloadIdentityDetails.deserialize(de) - ) - - case 7: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_CREATE_PAYMENT_MANAGER_OUTPUT.members["createdAt"] - ) - - case 8: - kwargs["status"] = PaymentManagerStatus( - de.read_string( - _SCHEMA_CREATE_PAYMENT_MANAGER_OUTPUT.members["status"] - ) - ) - - case 9: - kwargs["tags"] = _deserialize_tags_map( - de, _SCHEMA_CREATE_PAYMENT_MANAGER_OUTPUT.members["tags"] - ) - - case 10: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_CREATE_PAYMENT_MANAGER_OUTPUT.members["kmsKeyArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_PAYMENT_MANAGER_OUTPUT, consumer=_consumer - ) - if "payment_manager_arn" not in kwargs: - kwargs["payment_manager_arn"] = "" - if "payment_manager_id" not in kwargs: - kwargs["payment_manager_id"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "authorizer_type" not in kwargs: - kwargs["authorizer_type"] = PaymentsAuthorizerType._corrected("") - if "role_arn" not in kwargs: - kwargs["role_arn"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "status" not in kwargs: - kwargs["status"] = PaymentManagerStatus._corrected("") - return kwargs - - -CREATE_PAYMENT_MANAGER = APIOperation( - input=CreatePaymentManagerInput, - output=CreatePaymentManagerOutput, - schema=_SCHEMA_CREATE_PAYMENT_MANAGER, - input_schema=_SCHEMA_CREATE_PAYMENT_MANAGER_INPUT, - output_schema=_SCHEMA_CREATE_PAYMENT_MANAGER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeletePaymentManagerInput: - """Dataclass for DeletePaymentManagerInput structure.""" - - payment_manager_id: str | None = None - """The unique identifier of the payment manager to delete.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If you don't specify this field, a - value is randomly generated for you. If this token matches a previous - request, the service ignores the request, but doesn't return an error. - For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_PAYMENT_MANAGER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.payment_manager_id is not None: - serializer.write_string( - _SCHEMA_DELETE_PAYMENT_MANAGER_INPUT.members["paymentManagerId"], - self.payment_manager_id, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_DELETE_PAYMENT_MANAGER_INPUT.members["clientToken"], - self.client_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["payment_manager_id"] = de.read_string( - _SCHEMA_DELETE_PAYMENT_MANAGER_INPUT.members["paymentManagerId"] - ) - - case 1: - kwargs["client_token"] = de.read_string( - _SCHEMA_DELETE_PAYMENT_MANAGER_INPUT.members["clientToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_PAYMENT_MANAGER_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeletePaymentManagerOutput: - """Dataclass for DeletePaymentManagerOutput structure.""" - - status: str - """ - The current status of the payment manager, set to `DELETING` when - deletion is initiated. Possible values include `CREATING`, `READY`, - `UPDATING`, `DELETING`, `CREATE_FAILED`, `UPDATE_FAILED`, and - `DELETE_FAILED`. - """ - - payment_manager_id: str | None = None - """The unique identifier of the deleted payment manager.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_PAYMENT_MANAGER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DELETE_PAYMENT_MANAGER_OUTPUT.members["status"], self.status - ) - if self.payment_manager_id is not None: - serializer.write_string( - _SCHEMA_DELETE_PAYMENT_MANAGER_OUTPUT.members["paymentManagerId"], - self.payment_manager_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["status"] = PaymentManagerStatus( - de.read_string( - _SCHEMA_DELETE_PAYMENT_MANAGER_OUTPUT.members["status"] - ) - ) - - case 1: - kwargs["payment_manager_id"] = de.read_string( - _SCHEMA_DELETE_PAYMENT_MANAGER_OUTPUT.members[ - "paymentManagerId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_PAYMENT_MANAGER_OUTPUT, consumer=_consumer - ) - if "status" not in kwargs: - kwargs["status"] = PaymentManagerStatus._corrected("") - return kwargs - - -DELETE_PAYMENT_MANAGER = APIOperation( - input=DeletePaymentManagerInput, - output=DeletePaymentManagerOutput, - schema=_SCHEMA_DELETE_PAYMENT_MANAGER, - input_schema=_SCHEMA_DELETE_PAYMENT_MANAGER_INPUT, - output_schema=_SCHEMA_DELETE_PAYMENT_MANAGER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetPaymentManagerInput: - """Dataclass for GetPaymentManagerInput structure.""" - - payment_manager_id: str | None = None - """The unique identifier of the payment manager to retrieve.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_PAYMENT_MANAGER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.payment_manager_id is not None: - serializer.write_string( - _SCHEMA_GET_PAYMENT_MANAGER_INPUT.members["paymentManagerId"], - self.payment_manager_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["payment_manager_id"] = de.read_string( - _SCHEMA_GET_PAYMENT_MANAGER_INPUT.members["paymentManagerId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_PAYMENT_MANAGER_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetPaymentManagerOutput: - """Dataclass for GetPaymentManagerOutput structure.""" - - payment_manager_arn: str - """The Amazon Resource Name (ARN) of the payment manager.""" - - payment_manager_id: str - """The unique identifier of the payment manager.""" - - name: str - """The name of the payment manager.""" - - authorizer_type: str - """ - The type of authorizer used by the payment manager. - - - `CUSTOM_JWT` - Authorize with a bearer token. - - - `AWS_IAM` - Authorize with your Amazon Web Services IAM credentials. - """ - - role_arn: str - """ - The Amazon Resource Name (ARN) of the IAM role associated with the - payment manager. - """ - - created_at: datetime - """The timestamp when the payment manager was created.""" - - last_updated_at: datetime - """The timestamp when the payment manager was last updated.""" - - status: str - """ - The current status of the payment manager. Possible values include - `CREATING`, `READY`, `UPDATING`, `DELETING`, `CREATE_FAILED`, - `UPDATE_FAILED`, and `DELETE_FAILED`. - """ - - description: str | None = None - """The description of the payment manager.""" - - authorizer_configuration: AuthorizerConfiguration | None = None - """ - Represents inbound authorization configuration options used to - authenticate incoming requests. - """ - - workload_identity_details: WorkloadIdentityDetails | None = None - """The information about the workload identity.""" - - tags: dict[str, str] | None = None - """The tags associated with the payment manager.""" - - kms_key_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the KMS key used to encrypt sensitive - payment manager data at rest, if configured. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_PAYMENT_MANAGER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_PAYMENT_MANAGER_OUTPUT.members["paymentManagerArn"], - self.payment_manager_arn, - ) - serializer.write_string( - _SCHEMA_GET_PAYMENT_MANAGER_OUTPUT.members["paymentManagerId"], - self.payment_manager_id, - ) - serializer.write_string( - _SCHEMA_GET_PAYMENT_MANAGER_OUTPUT.members["name"], self.name - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_PAYMENT_MANAGER_OUTPUT.members["description"], - self.description, - ) - - serializer.write_string( - _SCHEMA_GET_PAYMENT_MANAGER_OUTPUT.members["authorizerType"], - self.authorizer_type, - ) - if self.authorizer_configuration is not None: - serializer.write_struct( - _SCHEMA_GET_PAYMENT_MANAGER_OUTPUT.members["authorizerConfiguration"], - self.authorizer_configuration, - ) - - serializer.write_string( - _SCHEMA_GET_PAYMENT_MANAGER_OUTPUT.members["roleArn"], self.role_arn - ) - if self.workload_identity_details is not None: - serializer.write_struct( - _SCHEMA_GET_PAYMENT_MANAGER_OUTPUT.members["workloadIdentityDetails"], - self.workload_identity_details, - ) - - serializer.write_timestamp( - _SCHEMA_GET_PAYMENT_MANAGER_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_GET_PAYMENT_MANAGER_OUTPUT.members["lastUpdatedAt"], - self.last_updated_at, - ) - serializer.write_string( - _SCHEMA_GET_PAYMENT_MANAGER_OUTPUT.members["status"], self.status - ) - if self.tags is not None: - _serialize_tags_map( - serializer, - _SCHEMA_GET_PAYMENT_MANAGER_OUTPUT.members["tags"], - self.tags, - ) - - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_GET_PAYMENT_MANAGER_OUTPUT.members["kmsKeyArn"], - self.kms_key_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["payment_manager_arn"] = de.read_string( - _SCHEMA_GET_PAYMENT_MANAGER_OUTPUT.members["paymentManagerArn"] - ) - - case 1: - kwargs["payment_manager_id"] = de.read_string( - _SCHEMA_GET_PAYMENT_MANAGER_OUTPUT.members["paymentManagerId"] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_GET_PAYMENT_MANAGER_OUTPUT.members["name"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_GET_PAYMENT_MANAGER_OUTPUT.members["description"] - ) - - case 4: - kwargs["authorizer_type"] = PaymentsAuthorizerType( - de.read_string( - _SCHEMA_GET_PAYMENT_MANAGER_OUTPUT.members["authorizerType"] - ) - ) - - case 5: - kwargs["authorizer_configuration"] = ( - _AuthorizerConfigurationDeserializer().deserialize(de) - ) - - case 6: - kwargs["role_arn"] = de.read_string( - _SCHEMA_GET_PAYMENT_MANAGER_OUTPUT.members["roleArn"] - ) - - case 7: - kwargs["workload_identity_details"] = ( - WorkloadIdentityDetails.deserialize(de) - ) - - case 8: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_PAYMENT_MANAGER_OUTPUT.members["createdAt"] - ) - - case 9: - kwargs["last_updated_at"] = de.read_timestamp( - _SCHEMA_GET_PAYMENT_MANAGER_OUTPUT.members["lastUpdatedAt"] - ) - - case 10: - kwargs["status"] = PaymentManagerStatus( - de.read_string( - _SCHEMA_GET_PAYMENT_MANAGER_OUTPUT.members["status"] - ) - ) - - case 11: - kwargs["tags"] = _deserialize_tags_map( - de, _SCHEMA_GET_PAYMENT_MANAGER_OUTPUT.members["tags"] - ) - - case 12: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_GET_PAYMENT_MANAGER_OUTPUT.members["kmsKeyArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_PAYMENT_MANAGER_OUTPUT, consumer=_consumer) - if "payment_manager_arn" not in kwargs: - kwargs["payment_manager_arn"] = "" - if "payment_manager_id" not in kwargs: - kwargs["payment_manager_id"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "authorizer_type" not in kwargs: - kwargs["authorizer_type"] = PaymentsAuthorizerType._corrected("") - if "role_arn" not in kwargs: - kwargs["role_arn"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "last_updated_at" not in kwargs: - kwargs["last_updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "status" not in kwargs: - kwargs["status"] = PaymentManagerStatus._corrected("") - return kwargs - - -GET_PAYMENT_MANAGER = APIOperation( - input=GetPaymentManagerInput, - output=GetPaymentManagerOutput, - schema=_SCHEMA_GET_PAYMENT_MANAGER, - input_schema=_SCHEMA_GET_PAYMENT_MANAGER_INPUT, - output_schema=_SCHEMA_GET_PAYMENT_MANAGER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListPaymentManagersInput: - """Dataclass for ListPaymentManagersInput structure.""" - - max_results: int | None = None - """ - The maximum number of results to return in the response. If the total - number of results is greater than this value, use the token returned in - the response in the `nextToken` field when making another request to - return the next batch of results. - """ - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, enter the token returned in the `nextToken` - field in the response in this field to return the next batch of results. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_PAYMENT_MANAGERS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_PAYMENT_MANAGERS_INPUT.members["maxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_PAYMENT_MANAGERS_INPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_PAYMENT_MANAGERS_INPUT.members["maxResults"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_PAYMENT_MANAGERS_INPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_PAYMENT_MANAGERS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class PaymentManagerSummary: - """Contains summary information about a payment manager.""" - - payment_manager_arn: str - """The Amazon Resource Name (ARN) of the payment manager.""" - - payment_manager_id: str - """The unique identifier of the payment manager.""" - - name: str - """The name of the payment manager.""" - - authorizer_type: str - """ - The type of authorizer used by the payment manager. - - - `CUSTOM_JWT` - Authorize with a bearer token. - - - `AWS_IAM` - Authorize with your Amazon Web Services IAM credentials. - """ - - role_arn: str - """ - The Amazon Resource Name (ARN) of the IAM role associated with the - payment manager. - """ - - status: str - """ - The current status of the payment manager. Possible values include - `CREATING`, `READY`, `UPDATING`, `DELETING`, `CREATE_FAILED`, - `UPDATE_FAILED`, and `DELETE_FAILED`. - """ - - last_updated_at: datetime - """The timestamp when the payment manager was last updated.""" - - description: str | None = None - """The description of the payment manager.""" - - created_at: datetime | None = None - """The timestamp when the payment manager was created.""" - - kms_key_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the KMS key used to encrypt sensitive - payment manager data at rest, if configured. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PAYMENT_MANAGER_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_PAYMENT_MANAGER_SUMMARY.members["paymentManagerArn"], - self.payment_manager_arn, - ) - serializer.write_string( - _SCHEMA_PAYMENT_MANAGER_SUMMARY.members["paymentManagerId"], - self.payment_manager_id, - ) - serializer.write_string( - _SCHEMA_PAYMENT_MANAGER_SUMMARY.members["name"], self.name - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_PAYMENT_MANAGER_SUMMARY.members["description"], self.description - ) - - serializer.write_string( - _SCHEMA_PAYMENT_MANAGER_SUMMARY.members["authorizerType"], - self.authorizer_type, - ) - serializer.write_string( - _SCHEMA_PAYMENT_MANAGER_SUMMARY.members["roleArn"], self.role_arn - ) - serializer.write_string( - _SCHEMA_PAYMENT_MANAGER_SUMMARY.members["status"], self.status - ) - if self.created_at is not None: - serializer.write_timestamp( - _SCHEMA_PAYMENT_MANAGER_SUMMARY.members["createdAt"], self.created_at - ) - - serializer.write_timestamp( - _SCHEMA_PAYMENT_MANAGER_SUMMARY.members["lastUpdatedAt"], - self.last_updated_at, - ) - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_PAYMENT_MANAGER_SUMMARY.members["kmsKeyArn"], self.kms_key_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["payment_manager_arn"] = de.read_string( - _SCHEMA_PAYMENT_MANAGER_SUMMARY.members["paymentManagerArn"] - ) - - case 1: - kwargs["payment_manager_id"] = de.read_string( - _SCHEMA_PAYMENT_MANAGER_SUMMARY.members["paymentManagerId"] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_PAYMENT_MANAGER_SUMMARY.members["name"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_PAYMENT_MANAGER_SUMMARY.members["description"] - ) - - case 4: - kwargs["authorizer_type"] = PaymentsAuthorizerType( - de.read_string( - _SCHEMA_PAYMENT_MANAGER_SUMMARY.members["authorizerType"] - ) - ) - - case 5: - kwargs["role_arn"] = de.read_string( - _SCHEMA_PAYMENT_MANAGER_SUMMARY.members["roleArn"] - ) - - case 6: - kwargs["status"] = PaymentManagerStatus( - de.read_string( - _SCHEMA_PAYMENT_MANAGER_SUMMARY.members["status"] - ) - ) - - case 7: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_PAYMENT_MANAGER_SUMMARY.members["createdAt"] - ) - - case 8: - kwargs["last_updated_at"] = de.read_timestamp( - _SCHEMA_PAYMENT_MANAGER_SUMMARY.members["lastUpdatedAt"] - ) - - case 9: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_PAYMENT_MANAGER_SUMMARY.members["kmsKeyArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PAYMENT_MANAGER_SUMMARY, consumer=_consumer) - if "payment_manager_arn" not in kwargs: - kwargs["payment_manager_arn"] = "" - if "payment_manager_id" not in kwargs: - kwargs["payment_manager_id"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "authorizer_type" not in kwargs: - kwargs["authorizer_type"] = PaymentsAuthorizerType._corrected("") - if "role_arn" not in kwargs: - kwargs["role_arn"] = "" - if "status" not in kwargs: - kwargs["status"] = PaymentManagerStatus._corrected("") - if "last_updated_at" not in kwargs: - kwargs["last_updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_payment_manager_summaries( - serializer: ShapeSerializer, schema: Schema, value: list[PaymentManagerSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_payment_manager_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[PaymentManagerSummary]: - result: list[PaymentManagerSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(PaymentManagerSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListPaymentManagersOutput: - """Dataclass for ListPaymentManagersOutput structure.""" - - payment_managers: list[PaymentManagerSummary] - """ - The list of payment manager summaries. For details about the fields in - each summary, see the `PaymentManagerSummary` data type. - """ - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, use this token when making another request in - the `nextToken` field to return the next batch of results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_PAYMENT_MANAGERS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_payment_manager_summaries( - serializer, - _SCHEMA_LIST_PAYMENT_MANAGERS_OUTPUT.members["paymentManagers"], - self.payment_managers, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_PAYMENT_MANAGERS_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["payment_managers"] = _deserialize_payment_manager_summaries( - de, - _SCHEMA_LIST_PAYMENT_MANAGERS_OUTPUT.members["paymentManagers"], - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_PAYMENT_MANAGERS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_PAYMENT_MANAGERS_OUTPUT, consumer=_consumer - ) - if "payment_managers" not in kwargs: - kwargs["payment_managers"] = [] - return kwargs - - -LIST_PAYMENT_MANAGERS = APIOperation( - input=ListPaymentManagersInput, - output=ListPaymentManagersOutput, - schema=_SCHEMA_LIST_PAYMENT_MANAGERS, - input_schema=_SCHEMA_LIST_PAYMENT_MANAGERS_INPUT, - output_schema=_SCHEMA_LIST_PAYMENT_MANAGERS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class PaymentCredentialProviderConfiguration: - """ - Configuration for a payment credential provider that stores - authentication credentials for a payment provider. - """ - - credential_provider_arn: str - """ - The Amazon Resource Name (ARN) of the credential provider that stores - the authentication credentials for the payment provider. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PAYMENT_CREDENTIAL_PROVIDER_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_PAYMENT_CREDENTIAL_PROVIDER_CONFIGURATION.members[ - "credentialProviderArn" - ], - self.credential_provider_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["credential_provider_arn"] = de.read_string( - _SCHEMA_PAYMENT_CREDENTIAL_PROVIDER_CONFIGURATION.members[ - "credentialProviderArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PAYMENT_CREDENTIAL_PROVIDER_CONFIGURATION, consumer=_consumer - ) - if "credential_provider_arn" not in kwargs: - kwargs["credential_provider_arn"] = "" - return kwargs - - -@dataclass -class CredentialsProviderConfigurationCoinbaseCDP: - """ - The credential provider configuration for a Coinbase CDP payment - connector. - """ - - value: PaymentCredentialProviderConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREDENTIALS_PROVIDER_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CREDENTIALS_PROVIDER_CONFIGURATION.members["coinbaseCDP"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=PaymentCredentialProviderConfiguration.deserialize(deserializer) - ) - - -@dataclass -class CredentialsProviderConfigurationStripePrivy: - """ - The credential provider configuration for a Stripe Privy payment - connector. - """ - - value: PaymentCredentialProviderConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREDENTIALS_PROVIDER_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CREDENTIALS_PROVIDER_CONFIGURATION.members["stripePrivy"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=PaymentCredentialProviderConfiguration.deserialize(deserializer) - ) - - -@dataclass -class CredentialsProviderConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -CredentialsProviderConfiguration = Union[ - CredentialsProviderConfigurationCoinbaseCDP - | CredentialsProviderConfigurationStripePrivy - | CredentialsProviderConfigurationUnknown -] -""" -The credential provider configuration for a payment connector. Specifies -the payment provider type and its associated credential provider. -""" - - -class _CredentialsProviderConfigurationDeserializer: - _result: CredentialsProviderConfiguration | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> CredentialsProviderConfiguration: - self._result = None - deserializer.read_struct( - _SCHEMA_CREDENTIALS_PROVIDER_CONFIGURATION, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - CredentialsProviderConfigurationCoinbaseCDP.deserialize(de) - ) - - case 1: - self._set_result( - CredentialsProviderConfigurationStripePrivy.deserialize(de) - ) - - case _: - self._set_result( - CredentialsProviderConfigurationUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: CredentialsProviderConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_credentials_provider_configurations( - serializer: ShapeSerializer, - schema: Schema, - value: list[CredentialsProviderConfiguration], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_credentials_provider_configurations( - deserializer: ShapeDeserializer, schema: Schema -) -> list[CredentialsProviderConfiguration]: - result: list[CredentialsProviderConfiguration] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append( - _CredentialsProviderConfigurationDeserializer().deserialize(d) - ) - - deserializer.read_list(schema, _read_value) - return result - - -class PaymentConnectorProvisionMode(UnknownEnumMixin, StrEnum): - MANUAL = "MANUAL" - QUICK_CREATE = "QUICK_CREATE" - - -class PaymentConnectorType(UnknownEnumMixin, StrEnum): - COINBASE_CDP = "CoinbaseCDP" - STRIPE_PRIVY = "StripePrivy" - - -@dataclass(kw_only=True) -class CreatePaymentConnectorInput: - """Dataclass for CreatePaymentConnectorInput structure.""" - - payment_manager_id: str | None = None - """ - The unique identifier of the payment manager to create the connector - for. - """ - - name: str | None = None - """The name of the payment connector.""" - - description: str | None = None - """A description of the payment connector.""" - - type: str | None = None - """ - The type of payment connector, which determines the payment provider - integration. - """ - - credential_provider_configurations: ( - list[CredentialsProviderConfiguration] | None - ) = None - """ - The credential provider configurations for the payment connector. These - configurations specify how the connector authenticates with the payment - provider. - """ - - provision_mode: str | None = None - """ - The provision mode for creating the payment connector. If you don't - specify a value, the default is `MANUAL`. - - - `MANUAL` - You provide the credential provider configurations - directly. - - - `QUICK_CREATE` - The service orchestrates OAuth consent and provisions - the credential provider for you. - """ - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If you don't specify this field, a - value is randomly generated for you. If this token matches a previous - request, the service ignores the request, but doesn't return an error. - For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_PAYMENT_CONNECTOR_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.payment_manager_id is not None: - serializer.write_string( - _SCHEMA_CREATE_PAYMENT_CONNECTOR_INPUT.members["paymentManagerId"], - self.payment_manager_id, - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_PAYMENT_CONNECTOR_INPUT.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_PAYMENT_CONNECTOR_INPUT.members["description"], - self.description, - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_CREATE_PAYMENT_CONNECTOR_INPUT.members["type"], self.type - ) - - if self.credential_provider_configurations is not None: - _serialize_credentials_provider_configurations( - serializer, - _SCHEMA_CREATE_PAYMENT_CONNECTOR_INPUT.members[ - "credentialProviderConfigurations" - ], - self.credential_provider_configurations, - ) - - if self.provision_mode is not None: - serializer.write_string( - _SCHEMA_CREATE_PAYMENT_CONNECTOR_INPUT.members["provisionMode"], - self.provision_mode, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_PAYMENT_CONNECTOR_INPUT.members["clientToken"], - self.client_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["payment_manager_id"] = de.read_string( - _SCHEMA_CREATE_PAYMENT_CONNECTOR_INPUT.members[ - "paymentManagerId" - ] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_PAYMENT_CONNECTOR_INPUT.members["name"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_PAYMENT_CONNECTOR_INPUT.members["description"] - ) - - case 3: - kwargs["type"] = PaymentConnectorType( - de.read_string( - _SCHEMA_CREATE_PAYMENT_CONNECTOR_INPUT.members["type"] - ) - ) - - case 4: - kwargs["credential_provider_configurations"] = ( - _deserialize_credentials_provider_configurations( - de, - _SCHEMA_CREATE_PAYMENT_CONNECTOR_INPUT.members[ - "credentialProviderConfigurations" - ], - ) - ) - - case 5: - kwargs["provision_mode"] = PaymentConnectorProvisionMode( - de.read_string( - _SCHEMA_CREATE_PAYMENT_CONNECTOR_INPUT.members[ - "provisionMode" - ] - ) - ) - - case 6: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_PAYMENT_CONNECTOR_INPUT.members["clientToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_PAYMENT_CONNECTOR_INPUT, consumer=_consumer - ) - return kwargs - - -class PaymentConnectorStatus(UnknownEnumMixin, StrEnum): - CREATING = "CREATING" - UPDATING = "UPDATING" - DELETING = "DELETING" - READY = "READY" - CREATE_FAILED = "CREATE_FAILED" - UPDATE_FAILED = "UPDATE_FAILED" - DELETE_FAILED = "DELETE_FAILED" - AWS_MARKETPLACE_SUBSCRIPTION_REQUIRED = "AWS_MARKETPLACE_SUBSCRIPTION_REQUIRED" - PENDING_AUTHENTICATION = "PENDING_AUTHENTICATION" - PROVISIONING = "PROVISIONING" - AUTHENTICATION_EXPIRED = "AUTHENTICATION_EXPIRED" - AUTHENTICATION_FAILED = "AUTHENTICATION_FAILED" - - -@dataclass(kw_only=True) -class CreatePaymentConnectorOutput: - """Dataclass for CreatePaymentConnectorOutput structure.""" - - payment_connector_id: str - """The unique identifier of the created payment connector.""" - - payment_manager_id: str - """The unique identifier of the parent payment manager.""" - - name: str - """The name of the created payment connector.""" - - type: str - """The type of the created payment connector.""" - - credential_provider_configurations: list[CredentialsProviderConfiguration] - """ - The credential provider configurations for the created payment - connector. - """ - - created_at: datetime - """The timestamp when the payment connector was created.""" - - status: str - """ - The current status of the payment connector. Possible values include - `CREATING`, `READY`, `UPDATING`, `DELETING`, `CREATE_FAILED`, - `UPDATE_FAILED`, and `DELETE_FAILED`. - """ - - authorization_url: str | None = None - """ - The URL that the user must open to complete OAuth consent. This field is - only present when the payment connector status is - `PENDING_AUTHENTICATION`. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_PAYMENT_CONNECTOR_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_PAYMENT_CONNECTOR_OUTPUT.members["paymentConnectorId"], - self.payment_connector_id, - ) - serializer.write_string( - _SCHEMA_CREATE_PAYMENT_CONNECTOR_OUTPUT.members["paymentManagerId"], - self.payment_manager_id, - ) - serializer.write_string( - _SCHEMA_CREATE_PAYMENT_CONNECTOR_OUTPUT.members["name"], self.name - ) - serializer.write_string( - _SCHEMA_CREATE_PAYMENT_CONNECTOR_OUTPUT.members["type"], self.type - ) - _serialize_credentials_provider_configurations( - serializer, - _SCHEMA_CREATE_PAYMENT_CONNECTOR_OUTPUT.members[ - "credentialProviderConfigurations" - ], - self.credential_provider_configurations, - ) - serializer.write_timestamp( - _SCHEMA_CREATE_PAYMENT_CONNECTOR_OUTPUT.members["createdAt"], - self.created_at, - ) - serializer.write_string( - _SCHEMA_CREATE_PAYMENT_CONNECTOR_OUTPUT.members["status"], self.status - ) - if self.authorization_url is not None: - serializer.write_string( - _SCHEMA_CREATE_PAYMENT_CONNECTOR_OUTPUT.members["authorizationUrl"], - self.authorization_url, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["payment_connector_id"] = de.read_string( - _SCHEMA_CREATE_PAYMENT_CONNECTOR_OUTPUT.members[ - "paymentConnectorId" - ] - ) - - case 1: - kwargs["payment_manager_id"] = de.read_string( - _SCHEMA_CREATE_PAYMENT_CONNECTOR_OUTPUT.members[ - "paymentManagerId" - ] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_PAYMENT_CONNECTOR_OUTPUT.members["name"] - ) - - case 3: - kwargs["type"] = PaymentConnectorType( - de.read_string( - _SCHEMA_CREATE_PAYMENT_CONNECTOR_OUTPUT.members["type"] - ) - ) - - case 4: - kwargs["credential_provider_configurations"] = ( - _deserialize_credentials_provider_configurations( - de, - _SCHEMA_CREATE_PAYMENT_CONNECTOR_OUTPUT.members[ - "credentialProviderConfigurations" - ], - ) - ) - - case 5: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_CREATE_PAYMENT_CONNECTOR_OUTPUT.members["createdAt"] - ) - - case 6: - kwargs["status"] = PaymentConnectorStatus( - de.read_string( - _SCHEMA_CREATE_PAYMENT_CONNECTOR_OUTPUT.members["status"] - ) - ) - - case 7: - kwargs["authorization_url"] = de.read_string( - _SCHEMA_CREATE_PAYMENT_CONNECTOR_OUTPUT.members[ - "authorizationUrl" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_PAYMENT_CONNECTOR_OUTPUT, consumer=_consumer - ) - if "payment_connector_id" not in kwargs: - kwargs["payment_connector_id"] = "" - if "payment_manager_id" not in kwargs: - kwargs["payment_manager_id"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "type" not in kwargs: - kwargs["type"] = PaymentConnectorType._corrected("") - if "credential_provider_configurations" not in kwargs: - kwargs["credential_provider_configurations"] = [] - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "status" not in kwargs: - kwargs["status"] = PaymentConnectorStatus._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class SubscriptionRequiredException(ServiceError): - """ - The request failed because it requires an active Amazon Web Services - Marketplace subscription that is not present. Subscribe to the required - product in Amazon Web Services Marketplace and try again. - """ - - fault: Literal["client", "server"] | None = "client" - - subscription_url: str | None = None - """URL to the Marketplace listing for subscription""" - - product_name: str | None = None - """The product requiring subscription""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SUBSCRIPTION_REQUIRED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SUBSCRIPTION_REQUIRED_EXCEPTION.members["message"], self.message - ) - if self.subscription_url is not None: - serializer.write_string( - _SCHEMA_SUBSCRIPTION_REQUIRED_EXCEPTION.members["subscriptionUrl"], - self.subscription_url, - ) - - if self.product_name is not None: - serializer.write_string( - _SCHEMA_SUBSCRIPTION_REQUIRED_EXCEPTION.members["productName"], - self.product_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_SUBSCRIPTION_REQUIRED_EXCEPTION.members["message"] - ) - - case 1: - kwargs["subscription_url"] = de.read_string( - _SCHEMA_SUBSCRIPTION_REQUIRED_EXCEPTION.members[ - "subscriptionUrl" - ] - ) - - case 2: - kwargs["product_name"] = de.read_string( - _SCHEMA_SUBSCRIPTION_REQUIRED_EXCEPTION.members["productName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SUBSCRIPTION_REQUIRED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -CREATE_PAYMENT_CONNECTOR = APIOperation( - input=CreatePaymentConnectorInput, - output=CreatePaymentConnectorOutput, - schema=_SCHEMA_CREATE_PAYMENT_CONNECTOR, - input_schema=_SCHEMA_CREATE_PAYMENT_CONNECTOR_INPUT, - output_schema=_SCHEMA_CREATE_PAYMENT_CONNECTOR_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#SubscriptionRequiredException" - ): SubscriptionRequiredException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_SUBSCRIPTION_REQUIRED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeletePaymentConnectorInput: - """Dataclass for DeletePaymentConnectorInput structure.""" - - payment_manager_id: str | None = None - """The unique identifier of the parent payment manager.""" - - payment_connector_id: str | None = None - """The unique identifier of the payment connector to delete.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If you don't specify this field, a - value is randomly generated for you. If this token matches a previous - request, the service ignores the request, but doesn't return an error. - For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_PAYMENT_CONNECTOR_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.payment_manager_id is not None: - serializer.write_string( - _SCHEMA_DELETE_PAYMENT_CONNECTOR_INPUT.members["paymentManagerId"], - self.payment_manager_id, - ) - - if self.payment_connector_id is not None: - serializer.write_string( - _SCHEMA_DELETE_PAYMENT_CONNECTOR_INPUT.members["paymentConnectorId"], - self.payment_connector_id, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_DELETE_PAYMENT_CONNECTOR_INPUT.members["clientToken"], - self.client_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["payment_manager_id"] = de.read_string( - _SCHEMA_DELETE_PAYMENT_CONNECTOR_INPUT.members[ - "paymentManagerId" - ] - ) - - case 1: - kwargs["payment_connector_id"] = de.read_string( - _SCHEMA_DELETE_PAYMENT_CONNECTOR_INPUT.members[ - "paymentConnectorId" - ] - ) - - case 2: - kwargs["client_token"] = de.read_string( - _SCHEMA_DELETE_PAYMENT_CONNECTOR_INPUT.members["clientToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_PAYMENT_CONNECTOR_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeletePaymentConnectorOutput: - """Dataclass for DeletePaymentConnectorOutput structure.""" - - status: str - """ - The current status of the payment connector, set to `DELETING` when - deletion is initiated. Possible values include `CREATING`, `READY`, - `UPDATING`, `DELETING`, `CREATE_FAILED`, `UPDATE_FAILED`, and - `DELETE_FAILED`. - """ - - payment_connector_id: str | None = None - """The unique identifier of the deleted payment connector.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_PAYMENT_CONNECTOR_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DELETE_PAYMENT_CONNECTOR_OUTPUT.members["status"], self.status - ) - if self.payment_connector_id is not None: - serializer.write_string( - _SCHEMA_DELETE_PAYMENT_CONNECTOR_OUTPUT.members["paymentConnectorId"], - self.payment_connector_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["status"] = PaymentConnectorStatus( - de.read_string( - _SCHEMA_DELETE_PAYMENT_CONNECTOR_OUTPUT.members["status"] - ) - ) - - case 1: - kwargs["payment_connector_id"] = de.read_string( - _SCHEMA_DELETE_PAYMENT_CONNECTOR_OUTPUT.members[ - "paymentConnectorId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_PAYMENT_CONNECTOR_OUTPUT, consumer=_consumer - ) - if "status" not in kwargs: - kwargs["status"] = PaymentConnectorStatus._corrected("") - return kwargs - - -DELETE_PAYMENT_CONNECTOR = APIOperation( - input=DeletePaymentConnectorInput, - output=DeletePaymentConnectorOutput, - schema=_SCHEMA_DELETE_PAYMENT_CONNECTOR, - input_schema=_SCHEMA_DELETE_PAYMENT_CONNECTOR_INPUT, - output_schema=_SCHEMA_DELETE_PAYMENT_CONNECTOR_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetPaymentConnectorInput: - """Dataclass for GetPaymentConnectorInput structure.""" - - payment_manager_id: str | None = None - """The unique identifier of the parent payment manager.""" - - payment_connector_id: str | None = None - """The unique identifier of the payment connector to retrieve.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_PAYMENT_CONNECTOR_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.payment_manager_id is not None: - serializer.write_string( - _SCHEMA_GET_PAYMENT_CONNECTOR_INPUT.members["paymentManagerId"], - self.payment_manager_id, - ) - - if self.payment_connector_id is not None: - serializer.write_string( - _SCHEMA_GET_PAYMENT_CONNECTOR_INPUT.members["paymentConnectorId"], - self.payment_connector_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["payment_manager_id"] = de.read_string( - _SCHEMA_GET_PAYMENT_CONNECTOR_INPUT.members["paymentManagerId"] - ) - - case 1: - kwargs["payment_connector_id"] = de.read_string( - _SCHEMA_GET_PAYMENT_CONNECTOR_INPUT.members[ - "paymentConnectorId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_PAYMENT_CONNECTOR_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetPaymentConnectorOutput: - """Dataclass for GetPaymentConnectorOutput structure.""" - - payment_connector_id: str - """The unique identifier of the payment connector.""" - - name: str - """The name of the payment connector.""" - - type: str - """ - The type of the payment connector, which determines the payment provider - integration. - """ - - credential_provider_configurations: list[CredentialsProviderConfiguration] - """The credential provider configurations for the payment connector.""" - - created_at: datetime - """The timestamp when the payment connector was created.""" - - last_updated_at: datetime - """The timestamp when the payment connector was last updated.""" - - status: str - """ - The current status of the payment connector. Possible values include - `CREATING`, `READY`, `UPDATING`, `DELETING`, `CREATE_FAILED`, - `UPDATE_FAILED`, and `DELETE_FAILED`. - """ - - description: str | None = None - """The description of the payment connector.""" - - provision_mode: str | None = None - """ - Specifies how the payment connector was provisioned. Payment connectors - that were created before this field was available return `MANUAL`. - - - `MANUAL` - You provided the credential provider configurations, so you - own the credentials. Rotate them with the payment provider, then call - `UpdatePaymentCredentialProvider`. - - - `QUICK_CREATE` - AgentCore provisioned the credential provider for - you, so the credentials are service-managed. You can rotate them with - `RotatePaymentConnectorCredentials`. - """ - - authorization_url: str | None = None - """ - The URL that the user must open to complete OAuth consent. This field is - only present when the payment connector status is - `PENDING_AUTHENTICATION`. - """ - - credentials_updated_at: datetime | None = None - """ - The timestamp when the payment connector's current service-managed - credentials took effect. It is first set when the credentials are - provisioned and is updated by each rotation. This field is present only - for payment connectors with a `provisionMode` of `QUICK_CREATE`. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_PAYMENT_CONNECTOR_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_PAYMENT_CONNECTOR_OUTPUT.members["paymentConnectorId"], - self.payment_connector_id, - ) - serializer.write_string( - _SCHEMA_GET_PAYMENT_CONNECTOR_OUTPUT.members["name"], self.name - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_PAYMENT_CONNECTOR_OUTPUT.members["description"], - self.description, - ) - - serializer.write_string( - _SCHEMA_GET_PAYMENT_CONNECTOR_OUTPUT.members["type"], self.type - ) - if self.provision_mode is not None: - serializer.write_string( - _SCHEMA_GET_PAYMENT_CONNECTOR_OUTPUT.members["provisionMode"], - self.provision_mode, - ) - - _serialize_credentials_provider_configurations( - serializer, - _SCHEMA_GET_PAYMENT_CONNECTOR_OUTPUT.members[ - "credentialProviderConfigurations" - ], - self.credential_provider_configurations, - ) - serializer.write_timestamp( - _SCHEMA_GET_PAYMENT_CONNECTOR_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_GET_PAYMENT_CONNECTOR_OUTPUT.members["lastUpdatedAt"], - self.last_updated_at, - ) - serializer.write_string( - _SCHEMA_GET_PAYMENT_CONNECTOR_OUTPUT.members["status"], self.status - ) - if self.authorization_url is not None: - serializer.write_string( - _SCHEMA_GET_PAYMENT_CONNECTOR_OUTPUT.members["authorizationUrl"], - self.authorization_url, - ) - - if self.credentials_updated_at is not None: - serializer.write_timestamp( - _SCHEMA_GET_PAYMENT_CONNECTOR_OUTPUT.members["credentialsUpdatedAt"], - self.credentials_updated_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["payment_connector_id"] = de.read_string( - _SCHEMA_GET_PAYMENT_CONNECTOR_OUTPUT.members[ - "paymentConnectorId" - ] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_GET_PAYMENT_CONNECTOR_OUTPUT.members["name"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_GET_PAYMENT_CONNECTOR_OUTPUT.members["description"] - ) - - case 3: - kwargs["type"] = PaymentConnectorType( - de.read_string( - _SCHEMA_GET_PAYMENT_CONNECTOR_OUTPUT.members["type"] - ) - ) - - case 4: - kwargs["provision_mode"] = PaymentConnectorProvisionMode( - de.read_string( - _SCHEMA_GET_PAYMENT_CONNECTOR_OUTPUT.members[ - "provisionMode" - ] - ) - ) - - case 5: - kwargs["credential_provider_configurations"] = ( - _deserialize_credentials_provider_configurations( - de, - _SCHEMA_GET_PAYMENT_CONNECTOR_OUTPUT.members[ - "credentialProviderConfigurations" - ], - ) - ) - - case 6: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_PAYMENT_CONNECTOR_OUTPUT.members["createdAt"] - ) - - case 7: - kwargs["last_updated_at"] = de.read_timestamp( - _SCHEMA_GET_PAYMENT_CONNECTOR_OUTPUT.members["lastUpdatedAt"] - ) - - case 8: - kwargs["status"] = PaymentConnectorStatus( - de.read_string( - _SCHEMA_GET_PAYMENT_CONNECTOR_OUTPUT.members["status"] - ) - ) - - case 9: - kwargs["authorization_url"] = de.read_string( - _SCHEMA_GET_PAYMENT_CONNECTOR_OUTPUT.members["authorizationUrl"] - ) - - case 10: - kwargs["credentials_updated_at"] = de.read_timestamp( - _SCHEMA_GET_PAYMENT_CONNECTOR_OUTPUT.members[ - "credentialsUpdatedAt" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_PAYMENT_CONNECTOR_OUTPUT, consumer=_consumer - ) - if "payment_connector_id" not in kwargs: - kwargs["payment_connector_id"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "type" not in kwargs: - kwargs["type"] = PaymentConnectorType._corrected("") - if "credential_provider_configurations" not in kwargs: - kwargs["credential_provider_configurations"] = [] - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "last_updated_at" not in kwargs: - kwargs["last_updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "status" not in kwargs: - kwargs["status"] = PaymentConnectorStatus._corrected("") - return kwargs - - -GET_PAYMENT_CONNECTOR = APIOperation( - input=GetPaymentConnectorInput, - output=GetPaymentConnectorOutput, - schema=_SCHEMA_GET_PAYMENT_CONNECTOR, - input_schema=_SCHEMA_GET_PAYMENT_CONNECTOR_INPUT, - output_schema=_SCHEMA_GET_PAYMENT_CONNECTOR_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListPaymentConnectorsInput: - """Dataclass for ListPaymentConnectorsInput structure.""" - - payment_manager_id: str | None = None - """The unique identifier of the payment manager whose connectors to list.""" - - max_results: int | None = None - """ - The maximum number of results to return in the response. If the total - number of results is greater than this value, use the token returned in - the response in the `nextToken` field when making another request to - return the next batch of results. - """ - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, enter the token returned in the `nextToken` - field in the response in this field to return the next batch of results. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_PAYMENT_CONNECTORS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.payment_manager_id is not None: - serializer.write_string( - _SCHEMA_LIST_PAYMENT_CONNECTORS_INPUT.members["paymentManagerId"], - self.payment_manager_id, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_PAYMENT_CONNECTORS_INPUT.members["maxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_PAYMENT_CONNECTORS_INPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["payment_manager_id"] = de.read_string( - _SCHEMA_LIST_PAYMENT_CONNECTORS_INPUT.members[ - "paymentManagerId" - ] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_PAYMENT_CONNECTORS_INPUT.members["maxResults"] - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_PAYMENT_CONNECTORS_INPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_PAYMENT_CONNECTORS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class PaymentConnectorSummary: - """Contains summary information about a payment connector.""" - - payment_connector_id: str - """The unique identifier of the payment connector.""" - - name: str - """The name of the payment connector.""" - - type: str - """ - The type of the payment connector, which determines the payment provider - integration. - """ - - status: str - """ - The current status of the payment connector. Possible values include - `CREATING`, `READY`, `UPDATING`, `DELETING`, `CREATE_FAILED`, - `UPDATE_FAILED`, and `DELETE_FAILED`. - """ - - last_updated_at: datetime - """The timestamp when the payment connector was last updated.""" - - provision_mode: str | None = None - """ - Specifies how the payment connector was provisioned. Payment connectors - that were created before this field was available return `MANUAL`. - - - `MANUAL` - You provided the credential provider configurations, so you - own the credentials. - - - `QUICK_CREATE` - AgentCore provisioned the credential provider for - you, so the credentials are service-managed and you can rotate them - with `RotatePaymentConnectorCredentials`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PAYMENT_CONNECTOR_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_PAYMENT_CONNECTOR_SUMMARY.members["paymentConnectorId"], - self.payment_connector_id, - ) - serializer.write_string( - _SCHEMA_PAYMENT_CONNECTOR_SUMMARY.members["name"], self.name - ) - serializer.write_string( - _SCHEMA_PAYMENT_CONNECTOR_SUMMARY.members["type"], self.type - ) - if self.provision_mode is not None: - serializer.write_string( - _SCHEMA_PAYMENT_CONNECTOR_SUMMARY.members["provisionMode"], - self.provision_mode, - ) - - serializer.write_string( - _SCHEMA_PAYMENT_CONNECTOR_SUMMARY.members["status"], self.status - ) - serializer.write_timestamp( - _SCHEMA_PAYMENT_CONNECTOR_SUMMARY.members["lastUpdatedAt"], - self.last_updated_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["payment_connector_id"] = de.read_string( - _SCHEMA_PAYMENT_CONNECTOR_SUMMARY.members["paymentConnectorId"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_PAYMENT_CONNECTOR_SUMMARY.members["name"] - ) - - case 2: - kwargs["type"] = PaymentConnectorType( - de.read_string( - _SCHEMA_PAYMENT_CONNECTOR_SUMMARY.members["type"] - ) - ) - - case 3: - kwargs["provision_mode"] = PaymentConnectorProvisionMode( - de.read_string( - _SCHEMA_PAYMENT_CONNECTOR_SUMMARY.members["provisionMode"] - ) - ) - - case 4: - kwargs["status"] = PaymentConnectorStatus( - de.read_string( - _SCHEMA_PAYMENT_CONNECTOR_SUMMARY.members["status"] - ) - ) - - case 5: - kwargs["last_updated_at"] = de.read_timestamp( - _SCHEMA_PAYMENT_CONNECTOR_SUMMARY.members["lastUpdatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PAYMENT_CONNECTOR_SUMMARY, consumer=_consumer) - if "payment_connector_id" not in kwargs: - kwargs["payment_connector_id"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "type" not in kwargs: - kwargs["type"] = PaymentConnectorType._corrected("") - if "status" not in kwargs: - kwargs["status"] = PaymentConnectorStatus._corrected("") - if "last_updated_at" not in kwargs: - kwargs["last_updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_payment_connector_summaries( - serializer: ShapeSerializer, schema: Schema, value: list[PaymentConnectorSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_payment_connector_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[PaymentConnectorSummary]: - result: list[PaymentConnectorSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(PaymentConnectorSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListPaymentConnectorsOutput: - """Dataclass for ListPaymentConnectorsOutput structure.""" - - payment_connectors: list[PaymentConnectorSummary] - """ - The list of payment connector summaries. For details about the fields in - each summary, see the `PaymentConnectorSummary` data type. - """ - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, use this token when making another request in - the `nextToken` field to return the next batch of results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_PAYMENT_CONNECTORS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_payment_connector_summaries( - serializer, - _SCHEMA_LIST_PAYMENT_CONNECTORS_OUTPUT.members["paymentConnectors"], - self.payment_connectors, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_PAYMENT_CONNECTORS_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["payment_connectors"] = ( - _deserialize_payment_connector_summaries( - de, - _SCHEMA_LIST_PAYMENT_CONNECTORS_OUTPUT.members[ - "paymentConnectors" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_PAYMENT_CONNECTORS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_PAYMENT_CONNECTORS_OUTPUT, consumer=_consumer - ) - if "payment_connectors" not in kwargs: - kwargs["payment_connectors"] = [] - return kwargs - - -LIST_PAYMENT_CONNECTORS = APIOperation( - input=ListPaymentConnectorsInput, - output=ListPaymentConnectorsOutput, - schema=_SCHEMA_LIST_PAYMENT_CONNECTORS, - input_schema=_SCHEMA_LIST_PAYMENT_CONNECTORS_INPUT, - output_schema=_SCHEMA_LIST_PAYMENT_CONNECTORS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class CoinbaseCdpSecret(UnknownEnumMixin, StrEnum): - API_KEY = "API_KEY" - WALLET_SECRET = "WALLET_SECRET" - - -def _serialize_coinbase_cdp_secrets( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_coinbase_cdp_secrets( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(CoinbaseCdpSecret(d.read_string(member_schema))) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CoinbaseCdpRotationTargets: - """Specifies the service-managed Coinbase CDP secrets to rotate.""" - - secrets: list[str] - """ - The secrets to rotate. Specify at least one value. Each secret that you - specify is rotated independently. - - - `API_KEY` - The API key that the payment connector uses to call - Coinbase CDP. Rotate it as routine maintenance, or if you suspect that - it is compromised. - - - `WALLET_SECRET` - The wallet secret that signs transactions. Rotate it - only if it is lost or compromised. Coinbase CDP allows one wallet - secret per project, so it is replaced in place and signing can be - briefly interrupted. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_COINBASE_CDP_ROTATION_TARGETS, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_coinbase_cdp_secrets( - serializer, - _SCHEMA_COINBASE_CDP_ROTATION_TARGETS.members["secrets"], - self.secrets, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["secrets"] = _deserialize_coinbase_cdp_secrets( - de, _SCHEMA_COINBASE_CDP_ROTATION_TARGETS.members["secrets"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_COINBASE_CDP_ROTATION_TARGETS, consumer=_consumer - ) - if "secrets" not in kwargs: - kwargs["secrets"] = [] - return kwargs - - -@dataclass -class CredentialRotationConfigCoinbaseCDP: - """The credentials to rotate for a Coinbase CDP payment connector.""" - - value: CoinbaseCdpRotationTargets - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREDENTIAL_ROTATION_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CREDENTIAL_ROTATION_CONFIG.members["coinbaseCDP"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=CoinbaseCdpRotationTargets.deserialize(deserializer)) - - -@dataclass -class CredentialRotationConfigUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -CredentialRotationConfig = Union[ - CredentialRotationConfigCoinbaseCDP | CredentialRotationConfigUnknown -] -""" -Specifies the service-managed credentials to rotate. Provide the member -that matches the payment connector's `type`. -""" - - -class _CredentialRotationConfigDeserializer: - _result: CredentialRotationConfig | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> CredentialRotationConfig: - self._result = None - deserializer.read_struct(_SCHEMA_CREDENTIAL_ROTATION_CONFIG, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(CredentialRotationConfigCoinbaseCDP.deserialize(de)) - - case _: - self._set_result( - CredentialRotationConfigUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: CredentialRotationConfig) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class RotatePaymentConnectorCredentialsInput: - """Dataclass for RotatePaymentConnectorCredentialsInput structure.""" - - payment_manager_id: str | None = None - """The unique identifier of the parent payment manager.""" - - payment_connector_id: str | None = None - """ - The unique identifier of the payment connector whose credentials you - want to rotate. - """ - - credentials_to_rotate: CredentialRotationConfig | None = None - """ - The credentials to rotate. Specify the member that matches the payment - connector's `type`. Each credential that you select is rotated - independently. - """ - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If you don't specify this field, a - value is randomly generated for you. If this token matches a previous - request, the service ignores the request, but doesn't return an error. - For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_ROTATE_PAYMENT_CONNECTOR_CREDENTIALS_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.payment_manager_id is not None: - serializer.write_string( - _SCHEMA_ROTATE_PAYMENT_CONNECTOR_CREDENTIALS_INPUT.members[ - "paymentManagerId" - ], - self.payment_manager_id, - ) - - if self.payment_connector_id is not None: - serializer.write_string( - _SCHEMA_ROTATE_PAYMENT_CONNECTOR_CREDENTIALS_INPUT.members[ - "paymentConnectorId" - ], - self.payment_connector_id, - ) - - if self.credentials_to_rotate is not None: - serializer.write_struct( - _SCHEMA_ROTATE_PAYMENT_CONNECTOR_CREDENTIALS_INPUT.members[ - "credentialsToRotate" - ], - self.credentials_to_rotate, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_ROTATE_PAYMENT_CONNECTOR_CREDENTIALS_INPUT.members[ - "clientToken" - ], - self.client_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["payment_manager_id"] = de.read_string( - _SCHEMA_ROTATE_PAYMENT_CONNECTOR_CREDENTIALS_INPUT.members[ - "paymentManagerId" - ] - ) - - case 1: - kwargs["payment_connector_id"] = de.read_string( - _SCHEMA_ROTATE_PAYMENT_CONNECTOR_CREDENTIALS_INPUT.members[ - "paymentConnectorId" - ] - ) - - case 2: - kwargs["credentials_to_rotate"] = ( - _CredentialRotationConfigDeserializer().deserialize(de) - ) - - case 3: - kwargs["client_token"] = de.read_string( - _SCHEMA_ROTATE_PAYMENT_CONNECTOR_CREDENTIALS_INPUT.members[ - "clientToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ROTATE_PAYMENT_CONNECTOR_CREDENTIALS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class RotatePaymentConnectorCredentialsOutput: - """Dataclass for RotatePaymentConnectorCredentialsOutput structure.""" - - payment_connector_id: str - """The unique identifier of the payment connector.""" - - payment_manager_id: str - """The unique identifier of the parent payment manager.""" - - last_updated_at: datetime - """ - The timestamp when the payment connector was last updated, which is when - the rotation completed. - """ - - status: str - """ - The current status of the payment connector, which is `READY` after a - successful rotation. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_ROTATE_PAYMENT_CONNECTOR_CREDENTIALS_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_ROTATE_PAYMENT_CONNECTOR_CREDENTIALS_OUTPUT.members[ - "paymentConnectorId" - ], - self.payment_connector_id, - ) - serializer.write_string( - _SCHEMA_ROTATE_PAYMENT_CONNECTOR_CREDENTIALS_OUTPUT.members[ - "paymentManagerId" - ], - self.payment_manager_id, - ) - serializer.write_timestamp( - _SCHEMA_ROTATE_PAYMENT_CONNECTOR_CREDENTIALS_OUTPUT.members[ - "lastUpdatedAt" - ], - self.last_updated_at, - ) - serializer.write_string( - _SCHEMA_ROTATE_PAYMENT_CONNECTOR_CREDENTIALS_OUTPUT.members["status"], - self.status, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["payment_connector_id"] = de.read_string( - _SCHEMA_ROTATE_PAYMENT_CONNECTOR_CREDENTIALS_OUTPUT.members[ - "paymentConnectorId" - ] - ) - - case 1: - kwargs["payment_manager_id"] = de.read_string( - _SCHEMA_ROTATE_PAYMENT_CONNECTOR_CREDENTIALS_OUTPUT.members[ - "paymentManagerId" - ] - ) - - case 2: - kwargs["last_updated_at"] = de.read_timestamp( - _SCHEMA_ROTATE_PAYMENT_CONNECTOR_CREDENTIALS_OUTPUT.members[ - "lastUpdatedAt" - ] - ) - - case 3: - kwargs["status"] = PaymentConnectorStatus( - de.read_string( - _SCHEMA_ROTATE_PAYMENT_CONNECTOR_CREDENTIALS_OUTPUT.members[ - "status" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ROTATE_PAYMENT_CONNECTOR_CREDENTIALS_OUTPUT, consumer=_consumer - ) - if "payment_connector_id" not in kwargs: - kwargs["payment_connector_id"] = "" - if "payment_manager_id" not in kwargs: - kwargs["payment_manager_id"] = "" - if "last_updated_at" not in kwargs: - kwargs["last_updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "status" not in kwargs: - kwargs["status"] = PaymentConnectorStatus._corrected("") - return kwargs - - -ROTATE_PAYMENT_CONNECTOR_CREDENTIALS = APIOperation( - input=RotatePaymentConnectorCredentialsInput, - output=RotatePaymentConnectorCredentialsOutput, - schema=_SCHEMA_ROTATE_PAYMENT_CONNECTOR_CREDENTIALS, - input_schema=_SCHEMA_ROTATE_PAYMENT_CONNECTOR_CREDENTIALS_INPUT, - output_schema=_SCHEMA_ROTATE_PAYMENT_CONNECTOR_CREDENTIALS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdatePaymentConnectorInput: - """Dataclass for UpdatePaymentConnectorInput structure.""" - - payment_manager_id: str | None = None - """The unique identifier of the parent payment manager.""" - - payment_connector_id: str | None = None - """The unique identifier of the payment connector to update.""" - - description: str | None = None - """The updated description of the payment connector.""" - - type: str | None = None - """The updated type of the payment connector.""" - - credential_provider_configurations: ( - list[CredentialsProviderConfiguration] | None - ) = None - """ - The updated credential provider configurations for the payment - connector. - """ - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If you don't specify this field, a - value is randomly generated for you. If this token matches a previous - request, the service ignores the request, but doesn't return an error. - For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_PAYMENT_CONNECTOR_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.payment_manager_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_PAYMENT_CONNECTOR_INPUT.members["paymentManagerId"], - self.payment_manager_id, - ) - - if self.payment_connector_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_PAYMENT_CONNECTOR_INPUT.members["paymentConnectorId"], - self.payment_connector_id, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_PAYMENT_CONNECTOR_INPUT.members["description"], - self.description, - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_UPDATE_PAYMENT_CONNECTOR_INPUT.members["type"], self.type - ) - - if self.credential_provider_configurations is not None: - _serialize_credentials_provider_configurations( - serializer, - _SCHEMA_UPDATE_PAYMENT_CONNECTOR_INPUT.members[ - "credentialProviderConfigurations" - ], - self.credential_provider_configurations, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_UPDATE_PAYMENT_CONNECTOR_INPUT.members["clientToken"], - self.client_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["payment_manager_id"] = de.read_string( - _SCHEMA_UPDATE_PAYMENT_CONNECTOR_INPUT.members[ - "paymentManagerId" - ] - ) - - case 1: - kwargs["payment_connector_id"] = de.read_string( - _SCHEMA_UPDATE_PAYMENT_CONNECTOR_INPUT.members[ - "paymentConnectorId" - ] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_PAYMENT_CONNECTOR_INPUT.members["description"] - ) - - case 3: - kwargs["type"] = PaymentConnectorType( - de.read_string( - _SCHEMA_UPDATE_PAYMENT_CONNECTOR_INPUT.members["type"] - ) - ) - - case 4: - kwargs["credential_provider_configurations"] = ( - _deserialize_credentials_provider_configurations( - de, - _SCHEMA_UPDATE_PAYMENT_CONNECTOR_INPUT.members[ - "credentialProviderConfigurations" - ], - ) - ) - - case 5: - kwargs["client_token"] = de.read_string( - _SCHEMA_UPDATE_PAYMENT_CONNECTOR_INPUT.members["clientToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_PAYMENT_CONNECTOR_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdatePaymentConnectorOutput: - """Dataclass for UpdatePaymentConnectorOutput structure.""" - - payment_connector_id: str - """The unique identifier of the updated payment connector.""" - - payment_manager_id: str - """The unique identifier of the parent payment manager.""" - - name: str - """The name of the updated payment connector.""" - - type: str - """The type of the updated payment connector.""" - - credential_provider_configurations: list[CredentialsProviderConfiguration] - """ - The credential provider configurations for the updated payment - connector. - """ - - last_updated_at: datetime - """The timestamp when the payment connector was last updated.""" - - status: str - """ - The current status of the updated payment connector. Possible values - include `CREATING`, `READY`, `UPDATING`, `DELETING`, `CREATE_FAILED`, - `UPDATE_FAILED`, and `DELETE_FAILED`. - """ - - authorization_url: str | None = None - """ - The URL that the user must open to complete OAuth consent. This field is - only present when the payment connector status is - `PENDING_AUTHENTICATION`. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_PAYMENT_CONNECTOR_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_UPDATE_PAYMENT_CONNECTOR_OUTPUT.members["paymentConnectorId"], - self.payment_connector_id, - ) - serializer.write_string( - _SCHEMA_UPDATE_PAYMENT_CONNECTOR_OUTPUT.members["paymentManagerId"], - self.payment_manager_id, - ) - serializer.write_string( - _SCHEMA_UPDATE_PAYMENT_CONNECTOR_OUTPUT.members["name"], self.name - ) - serializer.write_string( - _SCHEMA_UPDATE_PAYMENT_CONNECTOR_OUTPUT.members["type"], self.type - ) - _serialize_credentials_provider_configurations( - serializer, - _SCHEMA_UPDATE_PAYMENT_CONNECTOR_OUTPUT.members[ - "credentialProviderConfigurations" - ], - self.credential_provider_configurations, - ) - serializer.write_timestamp( - _SCHEMA_UPDATE_PAYMENT_CONNECTOR_OUTPUT.members["lastUpdatedAt"], - self.last_updated_at, - ) - serializer.write_string( - _SCHEMA_UPDATE_PAYMENT_CONNECTOR_OUTPUT.members["status"], self.status - ) - if self.authorization_url is not None: - serializer.write_string( - _SCHEMA_UPDATE_PAYMENT_CONNECTOR_OUTPUT.members["authorizationUrl"], - self.authorization_url, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["payment_connector_id"] = de.read_string( - _SCHEMA_UPDATE_PAYMENT_CONNECTOR_OUTPUT.members[ - "paymentConnectorId" - ] - ) - - case 1: - kwargs["payment_manager_id"] = de.read_string( - _SCHEMA_UPDATE_PAYMENT_CONNECTOR_OUTPUT.members[ - "paymentManagerId" - ] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_PAYMENT_CONNECTOR_OUTPUT.members["name"] - ) - - case 3: - kwargs["type"] = PaymentConnectorType( - de.read_string( - _SCHEMA_UPDATE_PAYMENT_CONNECTOR_OUTPUT.members["type"] - ) - ) - - case 4: - kwargs["credential_provider_configurations"] = ( - _deserialize_credentials_provider_configurations( - de, - _SCHEMA_UPDATE_PAYMENT_CONNECTOR_OUTPUT.members[ - "credentialProviderConfigurations" - ], - ) - ) - - case 5: - kwargs["last_updated_at"] = de.read_timestamp( - _SCHEMA_UPDATE_PAYMENT_CONNECTOR_OUTPUT.members["lastUpdatedAt"] - ) - - case 6: - kwargs["status"] = PaymentConnectorStatus( - de.read_string( - _SCHEMA_UPDATE_PAYMENT_CONNECTOR_OUTPUT.members["status"] - ) - ) - - case 7: - kwargs["authorization_url"] = de.read_string( - _SCHEMA_UPDATE_PAYMENT_CONNECTOR_OUTPUT.members[ - "authorizationUrl" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_PAYMENT_CONNECTOR_OUTPUT, consumer=_consumer - ) - if "payment_connector_id" not in kwargs: - kwargs["payment_connector_id"] = "" - if "payment_manager_id" not in kwargs: - kwargs["payment_manager_id"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "type" not in kwargs: - kwargs["type"] = PaymentConnectorType._corrected("") - if "credential_provider_configurations" not in kwargs: - kwargs["credential_provider_configurations"] = [] - if "last_updated_at" not in kwargs: - kwargs["last_updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "status" not in kwargs: - kwargs["status"] = PaymentConnectorStatus._corrected("") - return kwargs - - -UPDATE_PAYMENT_CONNECTOR = APIOperation( - input=UpdatePaymentConnectorInput, - output=UpdatePaymentConnectorOutput, - schema=_SCHEMA_UPDATE_PAYMENT_CONNECTOR, - input_schema=_SCHEMA_UPDATE_PAYMENT_CONNECTOR_INPUT, - output_schema=_SCHEMA_UPDATE_PAYMENT_CONNECTOR_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#SubscriptionRequiredException" - ): SubscriptionRequiredException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_SUBSCRIPTION_REQUIRED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdatePaymentManagerInput: - """Dataclass for UpdatePaymentManagerInput structure.""" - - payment_manager_id: str | None = None - """The unique identifier of the payment manager to update.""" - - description: str | None = None - """The updated description of the payment manager.""" - - authorizer_type: str | None = None - """The updated authorizer type for the payment manager.""" - - authorizer_configuration: AuthorizerConfiguration | None = None - """The updated authorizer configuration for the payment manager.""" - - role_arn: str | None = None - """ - The updated Amazon Resource Name (ARN) of the IAM role for the payment - manager. - """ - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If you don't specify this field, a - value is randomly generated for you. If this token matches a previous - request, the service ignores the request, but doesn't return an error. - For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - kms_key_arn: str | None = None - """ - The updated Amazon Resource Name (ARN) of the customer managed KMS key - used to encrypt sensitive payment manager data at rest. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_PAYMENT_MANAGER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.payment_manager_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_PAYMENT_MANAGER_INPUT.members["paymentManagerId"], - self.payment_manager_id, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_PAYMENT_MANAGER_INPUT.members["description"], - self.description, - ) - - if self.authorizer_type is not None: - serializer.write_string( - _SCHEMA_UPDATE_PAYMENT_MANAGER_INPUT.members["authorizerType"], - self.authorizer_type, - ) - - if self.authorizer_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_PAYMENT_MANAGER_INPUT.members["authorizerConfiguration"], - self.authorizer_configuration, - ) - - if self.role_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_PAYMENT_MANAGER_INPUT.members["roleArn"], self.role_arn - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_UPDATE_PAYMENT_MANAGER_INPUT.members["clientToken"], - self.client_token, - ) - - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_PAYMENT_MANAGER_INPUT.members["kmsKeyArn"], - self.kms_key_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["payment_manager_id"] = de.read_string( - _SCHEMA_UPDATE_PAYMENT_MANAGER_INPUT.members["paymentManagerId"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_PAYMENT_MANAGER_INPUT.members["description"] - ) - - case 2: - kwargs["authorizer_type"] = PaymentsAuthorizerType( - de.read_string( - _SCHEMA_UPDATE_PAYMENT_MANAGER_INPUT.members[ - "authorizerType" - ] - ) - ) - - case 3: - kwargs["authorizer_configuration"] = ( - _AuthorizerConfigurationDeserializer().deserialize(de) - ) - - case 4: - kwargs["role_arn"] = de.read_string( - _SCHEMA_UPDATE_PAYMENT_MANAGER_INPUT.members["roleArn"] - ) - - case 5: - kwargs["client_token"] = de.read_string( - _SCHEMA_UPDATE_PAYMENT_MANAGER_INPUT.members["clientToken"] - ) - - case 6: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_UPDATE_PAYMENT_MANAGER_INPUT.members["kmsKeyArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_PAYMENT_MANAGER_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdatePaymentManagerOutput: - """Dataclass for UpdatePaymentManagerOutput structure.""" - - payment_manager_arn: str - """The Amazon Resource Name (ARN) of the updated payment manager.""" - - payment_manager_id: str - """The unique identifier of the updated payment manager.""" - - name: str - """The name of the updated payment manager.""" - - authorizer_type: str - """The type of authorizer for the updated payment manager.""" - - role_arn: str - """ - The Amazon Resource Name (ARN) of the IAM role associated with the - updated payment manager. - """ - - last_updated_at: datetime - """The timestamp when the payment manager was last updated.""" - - status: str - """ - The current status of the updated payment manager. Possible values - include `CREATING`, `READY`, `UPDATING`, `DELETING`, `CREATE_FAILED`, - `UPDATE_FAILED`, and `DELETE_FAILED`. - """ - - workload_identity_details: WorkloadIdentityDetails | None = None - """The information about the workload identity.""" - - kms_key_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the KMS key used to encrypt sensitive - payment manager data at rest, if configured. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_PAYMENT_MANAGER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_UPDATE_PAYMENT_MANAGER_OUTPUT.members["paymentManagerArn"], - self.payment_manager_arn, - ) - serializer.write_string( - _SCHEMA_UPDATE_PAYMENT_MANAGER_OUTPUT.members["paymentManagerId"], - self.payment_manager_id, - ) - serializer.write_string( - _SCHEMA_UPDATE_PAYMENT_MANAGER_OUTPUT.members["name"], self.name - ) - serializer.write_string( - _SCHEMA_UPDATE_PAYMENT_MANAGER_OUTPUT.members["authorizerType"], - self.authorizer_type, - ) - serializer.write_string( - _SCHEMA_UPDATE_PAYMENT_MANAGER_OUTPUT.members["roleArn"], self.role_arn - ) - if self.workload_identity_details is not None: - serializer.write_struct( - _SCHEMA_UPDATE_PAYMENT_MANAGER_OUTPUT.members[ - "workloadIdentityDetails" - ], - self.workload_identity_details, - ) - - serializer.write_timestamp( - _SCHEMA_UPDATE_PAYMENT_MANAGER_OUTPUT.members["lastUpdatedAt"], - self.last_updated_at, - ) - serializer.write_string( - _SCHEMA_UPDATE_PAYMENT_MANAGER_OUTPUT.members["status"], self.status - ) - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_PAYMENT_MANAGER_OUTPUT.members["kmsKeyArn"], - self.kms_key_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["payment_manager_arn"] = de.read_string( - _SCHEMA_UPDATE_PAYMENT_MANAGER_OUTPUT.members[ - "paymentManagerArn" - ] - ) - - case 1: - kwargs["payment_manager_id"] = de.read_string( - _SCHEMA_UPDATE_PAYMENT_MANAGER_OUTPUT.members[ - "paymentManagerId" - ] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_PAYMENT_MANAGER_OUTPUT.members["name"] - ) - - case 3: - kwargs["authorizer_type"] = PaymentsAuthorizerType( - de.read_string( - _SCHEMA_UPDATE_PAYMENT_MANAGER_OUTPUT.members[ - "authorizerType" - ] - ) - ) - - case 4: - kwargs["role_arn"] = de.read_string( - _SCHEMA_UPDATE_PAYMENT_MANAGER_OUTPUT.members["roleArn"] - ) - - case 5: - kwargs["workload_identity_details"] = ( - WorkloadIdentityDetails.deserialize(de) - ) - - case 6: - kwargs["last_updated_at"] = de.read_timestamp( - _SCHEMA_UPDATE_PAYMENT_MANAGER_OUTPUT.members["lastUpdatedAt"] - ) - - case 7: - kwargs["status"] = PaymentManagerStatus( - de.read_string( - _SCHEMA_UPDATE_PAYMENT_MANAGER_OUTPUT.members["status"] - ) - ) - - case 8: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_UPDATE_PAYMENT_MANAGER_OUTPUT.members["kmsKeyArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_PAYMENT_MANAGER_OUTPUT, consumer=_consumer - ) - if "payment_manager_arn" not in kwargs: - kwargs["payment_manager_arn"] = "" - if "payment_manager_id" not in kwargs: - kwargs["payment_manager_id"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "authorizer_type" not in kwargs: - kwargs["authorizer_type"] = PaymentsAuthorizerType._corrected("") - if "role_arn" not in kwargs: - kwargs["role_arn"] = "" - if "last_updated_at" not in kwargs: - kwargs["last_updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "status" not in kwargs: - kwargs["status"] = PaymentManagerStatus._corrected("") - return kwargs - - -UPDATE_PAYMENT_MANAGER = APIOperation( - input=UpdatePaymentManagerInput, - output=UpdatePaymentManagerOutput, - schema=_SCHEMA_UPDATE_PAYMENT_MANAGER, - input_schema=_SCHEMA_UPDATE_PAYMENT_MANAGER_INPUT, - output_schema=_SCHEMA_UPDATE_PAYMENT_MANAGER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class CreatePolicyEngineInput: - """Dataclass for CreatePolicyEngineInput structure.""" - - name: str | None = None - """ - The customer-assigned immutable name for the policy engine. This name - identifies the policy engine and cannot be changed after creation. - """ - - description: str | None = field(repr=False, default=None) - """ - A human-readable description of the policy engine's purpose and scope - (1-4,096 characters). This helps administrators understand the policy - engine's role in the overall governance strategy. Document which - Gateway this engine will be associated with, what types of tools or - workflows it governs, and the team or service responsible for - maintaining it. Clear descriptions are essential when managing multiple - policy engines across different services or environments. - """ - - client_token: str | None = None - """ - A unique, case-sensitive identifier that you provide to ensure the - idempotency of the request. If you retry a request with the same client - token, the service returns the same response without creating a - duplicate policy engine. - """ - - encryption_key_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the KMS key used to encrypt the policy - engine data. - """ - - tags: dict[str, str] | None = None - """ - A map of tag keys and values to assign to an AgentCore Policy. Tags - enable you to categorize your resources in different ways, for example, - by purpose, owner, or environment. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_POLICY_ENGINE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_POLICY_ENGINE_INPUT.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_POLICY_ENGINE_INPUT.members["description"], - self.description, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_POLICY_ENGINE_INPUT.members["clientToken"], - self.client_token, - ) - - if self.encryption_key_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_POLICY_ENGINE_INPUT.members["encryptionKeyArn"], - self.encryption_key_arn, - ) - - if self.tags is not None: - _serialize_tags_map( - serializer, - _SCHEMA_CREATE_POLICY_ENGINE_INPUT.members["tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_POLICY_ENGINE_INPUT.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_POLICY_ENGINE_INPUT.members["description"] - ) - - case 2: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_POLICY_ENGINE_INPUT.members["clientToken"] - ) - - case 3: - kwargs["encryption_key_arn"] = de.read_string( - _SCHEMA_CREATE_POLICY_ENGINE_INPUT.members["encryptionKeyArn"] - ) - - case 4: - kwargs["tags"] = _deserialize_tags_map( - de, _SCHEMA_CREATE_POLICY_ENGINE_INPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_POLICY_ENGINE_INPUT, consumer=_consumer) - return kwargs - - -class PolicyEngineStatus(UnknownEnumMixin, StrEnum): - CREATING = "CREATING" - ACTIVE = "ACTIVE" - UPDATING = "UPDATING" - DELETING = "DELETING" - CREATE_FAILED = "CREATE_FAILED" - UPDATE_FAILED = "UPDATE_FAILED" - DELETE_FAILED = "DELETE_FAILED" - - -def _serialize_policy_status_reasons( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_policy_status_reasons( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CreatePolicyEngineOutput: - """Dataclass for CreatePolicyEngineOutput structure.""" - - policy_engine_id: str - """ - The unique identifier for the created policy engine. This - system-generated identifier consists of the user name plus a - 10-character generated suffix and is used for all subsequent policy - engine operations. - """ - - name: str - """ - The customer-assigned name of the created policy engine. This matches - the name provided in the request and serves as the human-readable - identifier. - """ - - created_at: datetime - """ - The timestamp when the policy engine was created. This is automatically - set by the service and used for auditing and lifecycle management. - """ - - updated_at: datetime - """ - The timestamp when the policy engine was last updated. For newly created - policy engines, this matches the `createdAt` timestamp. - """ - - policy_engine_arn: str - """ - The Amazon Resource Name (ARN) of the created policy engine. This - globally unique identifier can be used for cross-service references and - IAM policy statements. - """ - - status: str - """ - The current status of the policy engine. A status of `ACTIVE` indicates - the policy engine is ready for use. - """ - - status_reasons: list[str] - """ - Additional information about the policy engine status. This provides - details about any failures or the current state of the policy engine - creation process. - """ - - encryption_key_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the KMS key used to encrypt the policy - engine data. - """ - - description: str | None = field(repr=False, default=None) - """A human-readable description of the policy engine's purpose.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_POLICY_ENGINE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_POLICY_ENGINE_OUTPUT.members["policyEngineId"], - self.policy_engine_id, - ) - serializer.write_string( - _SCHEMA_CREATE_POLICY_ENGINE_OUTPUT.members["name"], self.name - ) - serializer.write_timestamp( - _SCHEMA_CREATE_POLICY_ENGINE_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_CREATE_POLICY_ENGINE_OUTPUT.members["updatedAt"], self.updated_at - ) - serializer.write_string( - _SCHEMA_CREATE_POLICY_ENGINE_OUTPUT.members["policyEngineArn"], - self.policy_engine_arn, - ) - serializer.write_string( - _SCHEMA_CREATE_POLICY_ENGINE_OUTPUT.members["status"], self.status - ) - if self.encryption_key_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_POLICY_ENGINE_OUTPUT.members["encryptionKeyArn"], - self.encryption_key_arn, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_POLICY_ENGINE_OUTPUT.members["description"], - self.description, - ) - - _serialize_policy_status_reasons( - serializer, - _SCHEMA_CREATE_POLICY_ENGINE_OUTPUT.members["statusReasons"], - self.status_reasons, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_engine_id"] = de.read_string( - _SCHEMA_CREATE_POLICY_ENGINE_OUTPUT.members["policyEngineId"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_POLICY_ENGINE_OUTPUT.members["name"] - ) - - case 2: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_CREATE_POLICY_ENGINE_OUTPUT.members["createdAt"] - ) - - case 3: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_CREATE_POLICY_ENGINE_OUTPUT.members["updatedAt"] - ) - - case 4: - kwargs["policy_engine_arn"] = de.read_string( - _SCHEMA_CREATE_POLICY_ENGINE_OUTPUT.members["policyEngineArn"] - ) - - case 5: - kwargs["status"] = PolicyEngineStatus( - de.read_string( - _SCHEMA_CREATE_POLICY_ENGINE_OUTPUT.members["status"] - ) - ) - - case 6: - kwargs["encryption_key_arn"] = de.read_string( - _SCHEMA_CREATE_POLICY_ENGINE_OUTPUT.members["encryptionKeyArn"] - ) - - case 7: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_POLICY_ENGINE_OUTPUT.members["description"] - ) - - case 8: - kwargs["status_reasons"] = _deserialize_policy_status_reasons( - de, _SCHEMA_CREATE_POLICY_ENGINE_OUTPUT.members["statusReasons"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_POLICY_ENGINE_OUTPUT, consumer=_consumer - ) - if "policy_engine_id" not in kwargs: - kwargs["policy_engine_id"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "policy_engine_arn" not in kwargs: - kwargs["policy_engine_arn"] = "" - if "status" not in kwargs: - kwargs["status"] = PolicyEngineStatus._corrected("") - if "status_reasons" not in kwargs: - kwargs["status_reasons"] = [] - return kwargs - - -CREATE_POLICY_ENGINE = APIOperation( - input=CreatePolicyEngineInput, - output=CreatePolicyEngineOutput, - schema=_SCHEMA_CREATE_POLICY_ENGINE, - input_schema=_SCHEMA_CREATE_POLICY_ENGINE_INPUT, - output_schema=_SCHEMA_CREATE_POLICY_ENGINE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeletePolicyEngineInput: - """Dataclass for DeletePolicyEngineInput structure.""" - - policy_engine_id: str | None = None - """ - The unique identifier of the policy engine to be deleted. This must be a - valid policy engine ID that exists within the account. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_POLICY_ENGINE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.policy_engine_id is not None: - serializer.write_string( - _SCHEMA_DELETE_POLICY_ENGINE_INPUT.members["policyEngineId"], - self.policy_engine_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_engine_id"] = de.read_string( - _SCHEMA_DELETE_POLICY_ENGINE_INPUT.members["policyEngineId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_POLICY_ENGINE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeletePolicyEngineOutput: - """Dataclass for DeletePolicyEngineOutput structure.""" - - policy_engine_id: str - """ - The unique identifier of the policy engine being deleted. This confirms - which policy engine the deletion operation targets. - """ - - name: str - """The customer-assigned name of the deleted policy engine.""" - - created_at: datetime - """The timestamp when the deleted policy engine was originally created.""" - - updated_at: datetime - """ - The timestamp when the deleted policy engine was last modified before - deletion. This tracks the final state of the policy engine before it was - removed from the system. - """ - - policy_engine_arn: str - """ - The Amazon Resource Name (ARN) of the deleted policy engine. This - globally unique identifier confirms which policy engine resource was - successfully removed. - """ - - status: str - """ - The status of the policy engine deletion operation. This provides status - about any issues that occurred during the deletion process. - """ - - status_reasons: list[str] - """ - Additional information about the deletion status. This provides details - about the deletion process or any issues that may have occurred. - """ - - encryption_key_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the KMS key used to encrypt the policy - engine data. - """ - - description: str | None = field(repr=False, default=None) - """The human-readable description of the deleted policy engine.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_POLICY_ENGINE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DELETE_POLICY_ENGINE_OUTPUT.members["policyEngineId"], - self.policy_engine_id, - ) - serializer.write_string( - _SCHEMA_DELETE_POLICY_ENGINE_OUTPUT.members["name"], self.name - ) - serializer.write_timestamp( - _SCHEMA_DELETE_POLICY_ENGINE_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_DELETE_POLICY_ENGINE_OUTPUT.members["updatedAt"], self.updated_at - ) - serializer.write_string( - _SCHEMA_DELETE_POLICY_ENGINE_OUTPUT.members["policyEngineArn"], - self.policy_engine_arn, - ) - serializer.write_string( - _SCHEMA_DELETE_POLICY_ENGINE_OUTPUT.members["status"], self.status - ) - if self.encryption_key_arn is not None: - serializer.write_string( - _SCHEMA_DELETE_POLICY_ENGINE_OUTPUT.members["encryptionKeyArn"], - self.encryption_key_arn, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_DELETE_POLICY_ENGINE_OUTPUT.members["description"], - self.description, - ) - - _serialize_policy_status_reasons( - serializer, - _SCHEMA_DELETE_POLICY_ENGINE_OUTPUT.members["statusReasons"], - self.status_reasons, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_engine_id"] = de.read_string( - _SCHEMA_DELETE_POLICY_ENGINE_OUTPUT.members["policyEngineId"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_DELETE_POLICY_ENGINE_OUTPUT.members["name"] - ) - - case 2: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_DELETE_POLICY_ENGINE_OUTPUT.members["createdAt"] - ) - - case 3: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_DELETE_POLICY_ENGINE_OUTPUT.members["updatedAt"] - ) - - case 4: - kwargs["policy_engine_arn"] = de.read_string( - _SCHEMA_DELETE_POLICY_ENGINE_OUTPUT.members["policyEngineArn"] - ) - - case 5: - kwargs["status"] = PolicyEngineStatus( - de.read_string( - _SCHEMA_DELETE_POLICY_ENGINE_OUTPUT.members["status"] - ) - ) - - case 6: - kwargs["encryption_key_arn"] = de.read_string( - _SCHEMA_DELETE_POLICY_ENGINE_OUTPUT.members["encryptionKeyArn"] - ) - - case 7: - kwargs["description"] = de.read_string( - _SCHEMA_DELETE_POLICY_ENGINE_OUTPUT.members["description"] - ) - - case 8: - kwargs["status_reasons"] = _deserialize_policy_status_reasons( - de, _SCHEMA_DELETE_POLICY_ENGINE_OUTPUT.members["statusReasons"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_POLICY_ENGINE_OUTPUT, consumer=_consumer - ) - if "policy_engine_id" not in kwargs: - kwargs["policy_engine_id"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "policy_engine_arn" not in kwargs: - kwargs["policy_engine_arn"] = "" - if "status" not in kwargs: - kwargs["status"] = PolicyEngineStatus._corrected("") - if "status_reasons" not in kwargs: - kwargs["status_reasons"] = [] - return kwargs - - -DELETE_POLICY_ENGINE = APIOperation( - input=DeletePolicyEngineInput, - output=DeletePolicyEngineOutput, - schema=_SCHEMA_DELETE_POLICY_ENGINE, - input_schema=_SCHEMA_DELETE_POLICY_ENGINE_INPUT, - output_schema=_SCHEMA_DELETE_POLICY_ENGINE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetPolicyEngineInput: - """Dataclass for GetPolicyEngineInput structure.""" - - policy_engine_id: str | None = None - """ - The unique identifier of the policy engine to be retrieved. This must be - a valid policy engine ID that exists within the account. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_POLICY_ENGINE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.policy_engine_id is not None: - serializer.write_string( - _SCHEMA_GET_POLICY_ENGINE_INPUT.members["policyEngineId"], - self.policy_engine_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_engine_id"] = de.read_string( - _SCHEMA_GET_POLICY_ENGINE_INPUT.members["policyEngineId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_POLICY_ENGINE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetPolicyEngineOutput: - """Dataclass for GetPolicyEngineOutput structure.""" - - policy_engine_id: str - """ - The unique identifier of the retrieved policy engine. This matches the - policy engine ID provided in the request and serves as the system - identifier. - """ - - name: str - """ - The customer-assigned name of the policy engine. This is the - human-readable identifier that was specified when the policy engine was - created. - """ - - created_at: datetime - """The timestamp when the policy engine was originally created.""" - - updated_at: datetime - """ - The timestamp when the policy engine was last modified. This tracks the - most recent changes to the policy engine configuration. - """ - - policy_engine_arn: str - """ - The Amazon Resource Name (ARN) of the policy engine. This globally - unique identifier can be used for cross-service references and IAM - policy statements. - """ - - status: str - """The current status of the policy engine.""" - - status_reasons: list[str] - """ - Additional information about the policy engine status. This provides - details about any failures or the current state of the policy engine. - """ - - encryption_key_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the KMS key used to encrypt the policy - engine data. - """ - - description: str | None = field(repr=False, default=None) - """ - The human-readable description of the policy engine's purpose and - scope. This helps administrators understand the policy engine's role in - governance. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_POLICY_ENGINE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_POLICY_ENGINE_OUTPUT.members["policyEngineId"], - self.policy_engine_id, - ) - serializer.write_string( - _SCHEMA_GET_POLICY_ENGINE_OUTPUT.members["name"], self.name - ) - serializer.write_timestamp( - _SCHEMA_GET_POLICY_ENGINE_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_GET_POLICY_ENGINE_OUTPUT.members["updatedAt"], self.updated_at - ) - serializer.write_string( - _SCHEMA_GET_POLICY_ENGINE_OUTPUT.members["policyEngineArn"], - self.policy_engine_arn, - ) - serializer.write_string( - _SCHEMA_GET_POLICY_ENGINE_OUTPUT.members["status"], self.status - ) - if self.encryption_key_arn is not None: - serializer.write_string( - _SCHEMA_GET_POLICY_ENGINE_OUTPUT.members["encryptionKeyArn"], - self.encryption_key_arn, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_POLICY_ENGINE_OUTPUT.members["description"], - self.description, - ) - - _serialize_policy_status_reasons( - serializer, - _SCHEMA_GET_POLICY_ENGINE_OUTPUT.members["statusReasons"], - self.status_reasons, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_engine_id"] = de.read_string( - _SCHEMA_GET_POLICY_ENGINE_OUTPUT.members["policyEngineId"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_GET_POLICY_ENGINE_OUTPUT.members["name"] - ) - - case 2: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_POLICY_ENGINE_OUTPUT.members["createdAt"] - ) - - case 3: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_GET_POLICY_ENGINE_OUTPUT.members["updatedAt"] - ) - - case 4: - kwargs["policy_engine_arn"] = de.read_string( - _SCHEMA_GET_POLICY_ENGINE_OUTPUT.members["policyEngineArn"] - ) - - case 5: - kwargs["status"] = PolicyEngineStatus( - de.read_string( - _SCHEMA_GET_POLICY_ENGINE_OUTPUT.members["status"] - ) - ) - - case 6: - kwargs["encryption_key_arn"] = de.read_string( - _SCHEMA_GET_POLICY_ENGINE_OUTPUT.members["encryptionKeyArn"] - ) - - case 7: - kwargs["description"] = de.read_string( - _SCHEMA_GET_POLICY_ENGINE_OUTPUT.members["description"] - ) - - case 8: - kwargs["status_reasons"] = _deserialize_policy_status_reasons( - de, _SCHEMA_GET_POLICY_ENGINE_OUTPUT.members["statusReasons"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_POLICY_ENGINE_OUTPUT, consumer=_consumer) - if "policy_engine_id" not in kwargs: - kwargs["policy_engine_id"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "policy_engine_arn" not in kwargs: - kwargs["policy_engine_arn"] = "" - if "status" not in kwargs: - kwargs["status"] = PolicyEngineStatus._corrected("") - if "status_reasons" not in kwargs: - kwargs["status_reasons"] = [] - return kwargs - - -GET_POLICY_ENGINE = APIOperation( - input=GetPolicyEngineInput, - output=GetPolicyEngineOutput, - schema=_SCHEMA_GET_POLICY_ENGINE, - input_schema=_SCHEMA_GET_POLICY_ENGINE_INPUT, - output_schema=_SCHEMA_GET_POLICY_ENGINE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetPolicyEngineSummaryInput: - """Dataclass for GetPolicyEngineSummaryInput structure.""" - - policy_engine_id: str | None = None - """ - The unique identifier of the policy engine to retrieve the summary for. - This must be a valid policy engine ID that exists within the account. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_POLICY_ENGINE_SUMMARY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.policy_engine_id is not None: - serializer.write_string( - _SCHEMA_GET_POLICY_ENGINE_SUMMARY_INPUT.members["policyEngineId"], - self.policy_engine_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_engine_id"] = de.read_string( - _SCHEMA_GET_POLICY_ENGINE_SUMMARY_INPUT.members[ - "policyEngineId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_POLICY_ENGINE_SUMMARY_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetPolicyEngineSummaryOutput: - """Dataclass for GetPolicyEngineSummaryOutput structure.""" - - policy_engine_id: str - """The unique identifier of the policy engine.""" - - name: str - """The customer-assigned name of the policy engine.""" - - created_at: datetime - """The timestamp when the policy engine was originally created.""" - - updated_at: datetime - """The timestamp when the policy engine was last modified.""" - - policy_engine_arn: str - """The Amazon Resource Name (ARN) of the policy engine.""" - - status: str - """The current status of the policy engine.""" - - encryption_key_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the KMS key used to encrypt the policy - engine data. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_POLICY_ENGINE_SUMMARY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_POLICY_ENGINE_SUMMARY_OUTPUT.members["policyEngineId"], - self.policy_engine_id, - ) - serializer.write_string( - _SCHEMA_GET_POLICY_ENGINE_SUMMARY_OUTPUT.members["name"], self.name - ) - serializer.write_timestamp( - _SCHEMA_GET_POLICY_ENGINE_SUMMARY_OUTPUT.members["createdAt"], - self.created_at, - ) - serializer.write_timestamp( - _SCHEMA_GET_POLICY_ENGINE_SUMMARY_OUTPUT.members["updatedAt"], - self.updated_at, - ) - serializer.write_string( - _SCHEMA_GET_POLICY_ENGINE_SUMMARY_OUTPUT.members["policyEngineArn"], - self.policy_engine_arn, - ) - serializer.write_string( - _SCHEMA_GET_POLICY_ENGINE_SUMMARY_OUTPUT.members["status"], self.status - ) - if self.encryption_key_arn is not None: - serializer.write_string( - _SCHEMA_GET_POLICY_ENGINE_SUMMARY_OUTPUT.members["encryptionKeyArn"], - self.encryption_key_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_engine_id"] = de.read_string( - _SCHEMA_GET_POLICY_ENGINE_SUMMARY_OUTPUT.members[ - "policyEngineId" - ] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_GET_POLICY_ENGINE_SUMMARY_OUTPUT.members["name"] - ) - - case 2: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_POLICY_ENGINE_SUMMARY_OUTPUT.members["createdAt"] - ) - - case 3: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_GET_POLICY_ENGINE_SUMMARY_OUTPUT.members["updatedAt"] - ) - - case 4: - kwargs["policy_engine_arn"] = de.read_string( - _SCHEMA_GET_POLICY_ENGINE_SUMMARY_OUTPUT.members[ - "policyEngineArn" - ] - ) - - case 5: - kwargs["status"] = PolicyEngineStatus( - de.read_string( - _SCHEMA_GET_POLICY_ENGINE_SUMMARY_OUTPUT.members["status"] - ) - ) - - case 6: - kwargs["encryption_key_arn"] = de.read_string( - _SCHEMA_GET_POLICY_ENGINE_SUMMARY_OUTPUT.members[ - "encryptionKeyArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_POLICY_ENGINE_SUMMARY_OUTPUT, consumer=_consumer - ) - if "policy_engine_id" not in kwargs: - kwargs["policy_engine_id"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "policy_engine_arn" not in kwargs: - kwargs["policy_engine_arn"] = "" - if "status" not in kwargs: - kwargs["status"] = PolicyEngineStatus._corrected("") - return kwargs - - -GET_POLICY_ENGINE_SUMMARY = APIOperation( - input=GetPolicyEngineSummaryInput, - output=GetPolicyEngineSummaryOutput, - schema=_SCHEMA_GET_POLICY_ENGINE_SUMMARY, - input_schema=_SCHEMA_GET_POLICY_ENGINE_SUMMARY_INPUT, - output_schema=_SCHEMA_GET_POLICY_ENGINE_SUMMARY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListPolicyEnginesInput: - """Dataclass for ListPolicyEnginesInput structure.""" - - next_token: str | None = None - """ - A pagination token returned from a previous - [ListPolicyEngines](https://docs.aws.amazon.com/bedrock-agentcore-control/latest/APIReference/API_ListPolicyEngines.html) - call. Use this token to retrieve the next page of results when the - response is paginated. - """ - - max_results: int | None = None - """ - The maximum number of policy engines to return in a single response. If - not specified, the default is 10 policy engines per page, with a maximum - of 100 per page. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_POLICY_ENGINES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_POLICY_ENGINES_INPUT.members["nextToken"], self.next_token - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_POLICY_ENGINES_INPUT.members["maxResults"], - self.max_results, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_POLICY_ENGINES_INPUT.members["nextToken"] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_POLICY_ENGINES_INPUT.members["maxResults"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_POLICY_ENGINES_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class PolicyEngine: - """ - Represents a policy engine resource within the AgentCore Policy system. - Policy engines serve as containers for grouping related policies and - provide the execution context for policy evaluation and management. Each - policy engine can be associated with one Gateway (one engine per - Gateway), where it intercepts all agent tool calls and evaluates them - against the contained policies before allowing tools to execute. The - policy engine maintains the Cedar schema generated from the Gateway's - tool manifest, ensuring that policies are validated against the actual - tools and parameters available. Policy engines support two enforcement - modes that can be configured when associating with a Gateway: log-only - mode for testing (evaluates decisions without blocking) and enforce mode - for production (actively allows or denies based on policy evaluation). - """ - - policy_engine_id: str - """ - The unique identifier for the policy engine. This system-generated - identifier consists of the user name plus a 10-character generated - suffix and serves as the primary key for policy engine operations. - """ - - name: str - """ - The customer-assigned immutable name for the policy engine. This - human-readable identifier must be unique within the account and cannot - exceed 48 characters. - """ - - created_at: datetime - """ - The timestamp when the policy engine was originally created. This is - automatically set by the service and used for auditing and lifecycle - management. - """ - - updated_at: datetime - """ - The timestamp when the policy engine was last modified. This tracks the - most recent changes to the policy engine configuration or metadata. - """ - - policy_engine_arn: str - """ - The Amazon Resource Name (ARN) of the policy engine. This globally - unique identifier can be used for cross-service references and IAM - policy statements. - """ - - status: str - """The current status of the policy engine.""" - - status_reasons: list[str] - """ - Additional information about the policy engine status. This provides - details about any failures or the current state of the policy engine - lifecycle. - """ - - encryption_key_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the KMS key used to encrypt the policy - engine data. - """ - - description: str | None = field(repr=False, default=None) - """ - A human-readable description of the policy engine's purpose and scope. - Limited to 4,096 characters, this helps administrators understand the - policy engine's role in the overall governance strategy. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_POLICY_ENGINE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_POLICY_ENGINE.members["policyEngineId"], self.policy_engine_id - ) - serializer.write_string(_SCHEMA_POLICY_ENGINE.members["name"], self.name) - serializer.write_timestamp( - _SCHEMA_POLICY_ENGINE.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_POLICY_ENGINE.members["updatedAt"], self.updated_at - ) - serializer.write_string( - _SCHEMA_POLICY_ENGINE.members["policyEngineArn"], self.policy_engine_arn - ) - serializer.write_string(_SCHEMA_POLICY_ENGINE.members["status"], self.status) - if self.encryption_key_arn is not None: - serializer.write_string( - _SCHEMA_POLICY_ENGINE.members["encryptionKeyArn"], - self.encryption_key_arn, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_POLICY_ENGINE.members["description"], self.description - ) - - _serialize_policy_status_reasons( - serializer, - _SCHEMA_POLICY_ENGINE.members["statusReasons"], - self.status_reasons, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_engine_id"] = de.read_string( - _SCHEMA_POLICY_ENGINE.members["policyEngineId"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_POLICY_ENGINE.members["name"] - ) - - case 2: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_POLICY_ENGINE.members["createdAt"] - ) - - case 3: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_POLICY_ENGINE.members["updatedAt"] - ) - - case 4: - kwargs["policy_engine_arn"] = de.read_string( - _SCHEMA_POLICY_ENGINE.members["policyEngineArn"] - ) - - case 5: - kwargs["status"] = PolicyEngineStatus( - de.read_string(_SCHEMA_POLICY_ENGINE.members["status"]) - ) - - case 6: - kwargs["encryption_key_arn"] = de.read_string( - _SCHEMA_POLICY_ENGINE.members["encryptionKeyArn"] - ) - - case 7: - kwargs["description"] = de.read_string( - _SCHEMA_POLICY_ENGINE.members["description"] - ) - - case 8: - kwargs["status_reasons"] = _deserialize_policy_status_reasons( - de, _SCHEMA_POLICY_ENGINE.members["statusReasons"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_POLICY_ENGINE, consumer=_consumer) - if "policy_engine_id" not in kwargs: - kwargs["policy_engine_id"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "policy_engine_arn" not in kwargs: - kwargs["policy_engine_arn"] = "" - if "status" not in kwargs: - kwargs["status"] = PolicyEngineStatus._corrected("") - if "status_reasons" not in kwargs: - kwargs["status_reasons"] = [] - return kwargs - - -def _serialize_policy_engines( - serializer: ShapeSerializer, schema: Schema, value: list[PolicyEngine] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_policy_engines( - deserializer: ShapeDeserializer, schema: Schema -) -> list[PolicyEngine]: - result: list[PolicyEngine] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(PolicyEngine.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListPolicyEnginesOutput: - """Dataclass for ListPolicyEnginesOutput structure.""" - - policy_engines: list[PolicyEngine] - """ - An array of policy engine objects that exist in the account. Each policy - engine object contains the engine metadata, status, and key identifiers - for further operations. - """ - - next_token: str | None = None - """ - A pagination token that can be used in subsequent - [ListPolicyEngines](https://docs.aws.amazon.com/bedrock-agentcore-control/latest/APIReference/API_ListPolicyEngines.html) - calls to retrieve additional results. This token is only present when - there are more results available. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_POLICY_ENGINES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_policy_engines( - serializer, - _SCHEMA_LIST_POLICY_ENGINES_OUTPUT.members["policyEngines"], - self.policy_engines, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_POLICY_ENGINES_OUTPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_engines"] = _deserialize_policy_engines( - de, _SCHEMA_LIST_POLICY_ENGINES_OUTPUT.members["policyEngines"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_POLICY_ENGINES_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_POLICY_ENGINES_OUTPUT, consumer=_consumer) - if "policy_engines" not in kwargs: - kwargs["policy_engines"] = [] - return kwargs - - -LIST_POLICY_ENGINES = APIOperation( - input=ListPolicyEnginesInput, - output=ListPolicyEnginesOutput, - schema=_SCHEMA_LIST_POLICY_ENGINES, - input_schema=_SCHEMA_LIST_POLICY_ENGINES_INPUT, - output_schema=_SCHEMA_LIST_POLICY_ENGINES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListPolicyEngineSummariesInput: - """Dataclass for ListPolicyEngineSummariesInput structure.""" - - next_token: str | None = None - """ - A pagination token returned from a previous - [ListPolicyEngineSummaries](https://docs.aws.amazon.com/bedrock-agentcore-control/latest/APIReference/API_ListPolicyEngineSummaries.html) - call. Use this token to retrieve the next page of results when the - response is paginated. - """ - - max_results: int | None = None - """ - The maximum number of policy engine summaries to return in a single - response. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_POLICY_ENGINE_SUMMARIES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_POLICY_ENGINE_SUMMARIES_INPUT.members["nextToken"], - self.next_token, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_POLICY_ENGINE_SUMMARIES_INPUT.members["maxResults"], - self.max_results, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_POLICY_ENGINE_SUMMARIES_INPUT.members["nextToken"] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_POLICY_ENGINE_SUMMARIES_INPUT.members["maxResults"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_POLICY_ENGINE_SUMMARIES_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class PolicyEngineSummary: - """ - Represents a metadata-only summary of a policy engine resource. This - structure contains resource identifiers, status, and timestamps without - customer-encrypted fields such as description or status reasons. Policy - engine summaries are returned by operations that do not require access - to the customer's KMS key. - """ - - policy_engine_id: str - """The unique identifier for the policy engine.""" - - name: str - """The customer-assigned name of the policy engine.""" - - created_at: datetime - """The timestamp when the policy engine was originally created.""" - - updated_at: datetime - """The timestamp when the policy engine was last modified.""" - - policy_engine_arn: str - """The Amazon Resource Name (ARN) of the policy engine.""" - - status: str - """The current status of the policy engine.""" - - encryption_key_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the KMS key used to encrypt the policy - engine data. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_POLICY_ENGINE_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_POLICY_ENGINE_SUMMARY.members["policyEngineId"], - self.policy_engine_id, - ) - serializer.write_string( - _SCHEMA_POLICY_ENGINE_SUMMARY.members["name"], self.name - ) - serializer.write_timestamp( - _SCHEMA_POLICY_ENGINE_SUMMARY.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_POLICY_ENGINE_SUMMARY.members["updatedAt"], self.updated_at - ) - serializer.write_string( - _SCHEMA_POLICY_ENGINE_SUMMARY.members["policyEngineArn"], - self.policy_engine_arn, - ) - serializer.write_string( - _SCHEMA_POLICY_ENGINE_SUMMARY.members["status"], self.status - ) - if self.encryption_key_arn is not None: - serializer.write_string( - _SCHEMA_POLICY_ENGINE_SUMMARY.members["encryptionKeyArn"], - self.encryption_key_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_engine_id"] = de.read_string( - _SCHEMA_POLICY_ENGINE_SUMMARY.members["policyEngineId"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_POLICY_ENGINE_SUMMARY.members["name"] - ) - - case 2: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_POLICY_ENGINE_SUMMARY.members["createdAt"] - ) - - case 3: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_POLICY_ENGINE_SUMMARY.members["updatedAt"] - ) - - case 4: - kwargs["policy_engine_arn"] = de.read_string( - _SCHEMA_POLICY_ENGINE_SUMMARY.members["policyEngineArn"] - ) - - case 5: - kwargs["status"] = PolicyEngineStatus( - de.read_string(_SCHEMA_POLICY_ENGINE_SUMMARY.members["status"]) - ) - - case 6: - kwargs["encryption_key_arn"] = de.read_string( - _SCHEMA_POLICY_ENGINE_SUMMARY.members["encryptionKeyArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_POLICY_ENGINE_SUMMARY, consumer=_consumer) - if "policy_engine_id" not in kwargs: - kwargs["policy_engine_id"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "policy_engine_arn" not in kwargs: - kwargs["policy_engine_arn"] = "" - if "status" not in kwargs: - kwargs["status"] = PolicyEngineStatus._corrected("") - return kwargs - - -def _serialize_policy_engine_summary_list( - serializer: ShapeSerializer, schema: Schema, value: list[PolicyEngineSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_policy_engine_summary_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[PolicyEngineSummary]: - result: list[PolicyEngineSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(PolicyEngineSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListPolicyEngineSummariesOutput: - """Dataclass for ListPolicyEngineSummariesOutput structure.""" - - policy_engines: list[PolicyEngineSummary] - """ - An array of policy engine summary objects that exist in the account. - Each summary contains resource identifiers, status, and timestamps - without customer-encrypted content. - """ - - next_token: str | None = None - """ - A pagination token that can be used in subsequent - [ListPolicyEngineSummaries](https://docs.aws.amazon.com/bedrock-agentcore-control/latest/APIReference/API_ListPolicyEngineSummaries.html) - calls to retrieve additional results. This token is only present when - there are more results available. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_POLICY_ENGINE_SUMMARIES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_policy_engine_summary_list( - serializer, - _SCHEMA_LIST_POLICY_ENGINE_SUMMARIES_OUTPUT.members["policyEngines"], - self.policy_engines, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_POLICY_ENGINE_SUMMARIES_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_engines"] = _deserialize_policy_engine_summary_list( - de, - _SCHEMA_LIST_POLICY_ENGINE_SUMMARIES_OUTPUT.members[ - "policyEngines" - ], - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_POLICY_ENGINE_SUMMARIES_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_POLICY_ENGINE_SUMMARIES_OUTPUT, consumer=_consumer - ) - if "policy_engines" not in kwargs: - kwargs["policy_engines"] = [] - return kwargs - - -LIST_POLICY_ENGINE_SUMMARIES = APIOperation( - input=ListPolicyEngineSummariesInput, - output=ListPolicyEngineSummariesOutput, - schema=_SCHEMA_LIST_POLICY_ENGINE_SUMMARIES, - input_schema=_SCHEMA_LIST_POLICY_ENGINE_SUMMARIES_INPUT, - output_schema=_SCHEMA_LIST_POLICY_ENGINE_SUMMARIES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdatePolicyEngineInput: - """Dataclass for UpdatePolicyEngineInput structure.""" - - policy_engine_id: str | None = None - """The unique identifier of the policy engine to be updated.""" - - description: UpdatedDescription | None = None - """The new description for the policy engine.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_POLICY_ENGINE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.policy_engine_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_POLICY_ENGINE_INPUT.members["policyEngineId"], - self.policy_engine_id, - ) - - if self.description is not None: - serializer.write_struct( - _SCHEMA_UPDATE_POLICY_ENGINE_INPUT.members["description"], - self.description, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_engine_id"] = de.read_string( - _SCHEMA_UPDATE_POLICY_ENGINE_INPUT.members["policyEngineId"] - ) - - case 1: - kwargs["description"] = UpdatedDescription.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_POLICY_ENGINE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdatePolicyEngineOutput: - """Dataclass for UpdatePolicyEngineOutput structure.""" - - policy_engine_id: str - """The unique identifier of the updated policy engine.""" - - name: str - """The name of the updated policy engine.""" - - created_at: datetime - """The original creation timestamp of the policy engine.""" - - updated_at: datetime - """The timestamp when the policy engine was last updated.""" - - policy_engine_arn: str - """The ARN of the updated policy engine.""" - - status: str - """The current status of the updated policy engine.""" - - status_reasons: list[str] - """Additional information about the update status.""" - - encryption_key_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the KMS key used to encrypt the policy - engine data. - """ - - description: str | None = field(repr=False, default=None) - """The updated description of the policy engine.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_POLICY_ENGINE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_UPDATE_POLICY_ENGINE_OUTPUT.members["policyEngineId"], - self.policy_engine_id, - ) - serializer.write_string( - _SCHEMA_UPDATE_POLICY_ENGINE_OUTPUT.members["name"], self.name - ) - serializer.write_timestamp( - _SCHEMA_UPDATE_POLICY_ENGINE_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_UPDATE_POLICY_ENGINE_OUTPUT.members["updatedAt"], self.updated_at - ) - serializer.write_string( - _SCHEMA_UPDATE_POLICY_ENGINE_OUTPUT.members["policyEngineArn"], - self.policy_engine_arn, - ) - serializer.write_string( - _SCHEMA_UPDATE_POLICY_ENGINE_OUTPUT.members["status"], self.status - ) - if self.encryption_key_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_POLICY_ENGINE_OUTPUT.members["encryptionKeyArn"], - self.encryption_key_arn, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_POLICY_ENGINE_OUTPUT.members["description"], - self.description, - ) - - _serialize_policy_status_reasons( - serializer, - _SCHEMA_UPDATE_POLICY_ENGINE_OUTPUT.members["statusReasons"], - self.status_reasons, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_engine_id"] = de.read_string( - _SCHEMA_UPDATE_POLICY_ENGINE_OUTPUT.members["policyEngineId"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_POLICY_ENGINE_OUTPUT.members["name"] - ) - - case 2: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_UPDATE_POLICY_ENGINE_OUTPUT.members["createdAt"] - ) - - case 3: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_UPDATE_POLICY_ENGINE_OUTPUT.members["updatedAt"] - ) - - case 4: - kwargs["policy_engine_arn"] = de.read_string( - _SCHEMA_UPDATE_POLICY_ENGINE_OUTPUT.members["policyEngineArn"] - ) - - case 5: - kwargs["status"] = PolicyEngineStatus( - de.read_string( - _SCHEMA_UPDATE_POLICY_ENGINE_OUTPUT.members["status"] - ) - ) - - case 6: - kwargs["encryption_key_arn"] = de.read_string( - _SCHEMA_UPDATE_POLICY_ENGINE_OUTPUT.members["encryptionKeyArn"] - ) - - case 7: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_POLICY_ENGINE_OUTPUT.members["description"] - ) - - case 8: - kwargs["status_reasons"] = _deserialize_policy_status_reasons( - de, _SCHEMA_UPDATE_POLICY_ENGINE_OUTPUT.members["statusReasons"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_POLICY_ENGINE_OUTPUT, consumer=_consumer - ) - if "policy_engine_id" not in kwargs: - kwargs["policy_engine_id"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "policy_engine_arn" not in kwargs: - kwargs["policy_engine_arn"] = "" - if "status" not in kwargs: - kwargs["status"] = PolicyEngineStatus._corrected("") - if "status_reasons" not in kwargs: - kwargs["status_reasons"] = [] - return kwargs - - -UPDATE_POLICY_ENGINE = APIOperation( - input=UpdatePolicyEngineInput, - output=UpdatePolicyEngineOutput, - schema=_SCHEMA_UPDATE_POLICY_ENGINE, - input_schema=_SCHEMA_UPDATE_POLICY_ENGINE_INPUT, - output_schema=_SCHEMA_UPDATE_POLICY_ENGINE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetPolicyGenerationInput: - """Dataclass for GetPolicyGenerationInput structure.""" - - policy_generation_id: str | None = None - """ - The unique identifier of the policy generation request to be retrieved. - This must be a valid generation ID from a previous - [StartPolicyGeneration](https://docs.aws.amazon.com/bedrock-agentcore-control/latest/APIReference/API_StartPolicyGeneration.html) - call. - """ - - policy_engine_id: str | None = None - """ - The identifier of the policy engine associated with the policy - generation request. This provides the context for the generation - operation and schema validation. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_POLICY_GENERATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.policy_generation_id is not None: - serializer.write_string( - _SCHEMA_GET_POLICY_GENERATION_INPUT.members["policyGenerationId"], - self.policy_generation_id, - ) - - if self.policy_engine_id is not None: - serializer.write_string( - _SCHEMA_GET_POLICY_GENERATION_INPUT.members["policyEngineId"], - self.policy_engine_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_generation_id"] = de.read_string( - _SCHEMA_GET_POLICY_GENERATION_INPUT.members[ - "policyGenerationId" - ] - ) - - case 1: - kwargs["policy_engine_id"] = de.read_string( - _SCHEMA_GET_POLICY_GENERATION_INPUT.members["policyEngineId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_POLICY_GENERATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass -class ResourceArn: - """ - The Amazon Resource Name (ARN) of the resource. This globally unique - identifier specifies the exact resource that policies will be evaluated - against for access control decisions. - """ - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_RESOURCE.members["arn"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=deserializer.read_string(_SCHEMA_RESOURCE.members["arn"])) - - -@dataclass -class ResourceUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -Resource = Union[ResourceArn | ResourceUnknown] -""" -Represents a resource within the AgentCore Policy system. Resources are -the targets of policy evaluation. Currently, only AgentCore Gateways are -supported as resources for policy enforcement. -""" - - -class _ResourceDeserializer: - _result: Resource | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> Resource: - self._result = None - deserializer.read_struct(_SCHEMA_RESOURCE, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(ResourceArn.deserialize(de)) - - case _: - self._set_result(ResourceUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: Resource) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class PolicyGenerationStatus(UnknownEnumMixin, StrEnum): - GENERATING = "GENERATING" - GENERATED = "GENERATED" - GENERATE_FAILED = "GENERATE_FAILED" - DELETE_FAILED = "DELETE_FAILED" - - -@dataclass(kw_only=True) -class GetPolicyGenerationOutput: - """Dataclass for GetPolicyGenerationOutput structure.""" - - policy_engine_id: str - """ - The identifier of the policy engine associated with this policy - generation. This confirms the policy engine context for the generation - operation. - """ - - policy_generation_id: str - """ - The unique identifier of the policy generation request. This matches the - generation ID provided in the request and serves as the tracking - identifier. - """ - - name: str - """ - The customer-assigned name for the policy generation request. This helps - identify and track generation operations across multiple requests. - """ - - policy_generation_arn: str - """ - The Amazon Resource Name (ARN) of the policy generation. This globally - unique identifier can be used for tracking, auditing, and cross-service - references. - """ - - resource: Resource - """ - The resource information associated with the policy generation. This - provides context about the target resources for which the policies are - being generated. - """ - - created_at: datetime - """ - The timestamp when the policy generation request was created. This is - used for tracking and auditing generation operations and their - lifecycle. - """ - - updated_at: datetime - """ - The timestamp when the policy generation was last updated. This tracks - the progress of the generation process and any status changes. - """ - - status: str - """ - The current status of the policy generation. This indicates whether the - generation is in progress, completed successfully, or failed during - processing. - """ - - status_reasons: list[str] - """ - Additional information about the generation status. This provides - details about any failures, warnings, or the current state of the - generation process. - """ - - findings: str | None = None - """ - The findings and results from the policy generation process. This - includes any issues, recommendations, validation results, or insights - from the generated policies. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_POLICY_GENERATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_POLICY_GENERATION_OUTPUT.members["policyEngineId"], - self.policy_engine_id, - ) - serializer.write_string( - _SCHEMA_GET_POLICY_GENERATION_OUTPUT.members["policyGenerationId"], - self.policy_generation_id, - ) - serializer.write_string( - _SCHEMA_GET_POLICY_GENERATION_OUTPUT.members["name"], self.name - ) - serializer.write_string( - _SCHEMA_GET_POLICY_GENERATION_OUTPUT.members["policyGenerationArn"], - self.policy_generation_arn, - ) - serializer.write_struct( - _SCHEMA_GET_POLICY_GENERATION_OUTPUT.members["resource"], self.resource - ) - serializer.write_timestamp( - _SCHEMA_GET_POLICY_GENERATION_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_GET_POLICY_GENERATION_OUTPUT.members["updatedAt"], self.updated_at - ) - serializer.write_string( - _SCHEMA_GET_POLICY_GENERATION_OUTPUT.members["status"], self.status - ) - if self.findings is not None: - serializer.write_string( - _SCHEMA_GET_POLICY_GENERATION_OUTPUT.members["findings"], self.findings - ) - - _serialize_policy_status_reasons( - serializer, - _SCHEMA_GET_POLICY_GENERATION_OUTPUT.members["statusReasons"], - self.status_reasons, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_engine_id"] = de.read_string( - _SCHEMA_GET_POLICY_GENERATION_OUTPUT.members["policyEngineId"] - ) - - case 1: - kwargs["policy_generation_id"] = de.read_string( - _SCHEMA_GET_POLICY_GENERATION_OUTPUT.members[ - "policyGenerationId" - ] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_GET_POLICY_GENERATION_OUTPUT.members["name"] - ) - - case 3: - kwargs["policy_generation_arn"] = de.read_string( - _SCHEMA_GET_POLICY_GENERATION_OUTPUT.members[ - "policyGenerationArn" - ] - ) - - case 4: - kwargs["resource"] = _ResourceDeserializer().deserialize(de) - - case 5: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_POLICY_GENERATION_OUTPUT.members["createdAt"] - ) - - case 6: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_GET_POLICY_GENERATION_OUTPUT.members["updatedAt"] - ) - - case 7: - kwargs["status"] = PolicyGenerationStatus( - de.read_string( - _SCHEMA_GET_POLICY_GENERATION_OUTPUT.members["status"] - ) - ) - - case 8: - kwargs["findings"] = de.read_string( - _SCHEMA_GET_POLICY_GENERATION_OUTPUT.members["findings"] - ) - - case 9: - kwargs["status_reasons"] = _deserialize_policy_status_reasons( - de, - _SCHEMA_GET_POLICY_GENERATION_OUTPUT.members["statusReasons"], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_POLICY_GENERATION_OUTPUT, consumer=_consumer - ) - if "policy_engine_id" not in kwargs: - kwargs["policy_engine_id"] = "" - if "policy_generation_id" not in kwargs: - kwargs["policy_generation_id"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "policy_generation_arn" not in kwargs: - kwargs["policy_generation_arn"] = "" - if "resource" not in kwargs: - kwargs["resource"] = ResourceUnknown(tag="") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "status" not in kwargs: - kwargs["status"] = PolicyGenerationStatus._corrected("") - if "status_reasons" not in kwargs: - kwargs["status_reasons"] = [] - return kwargs - - -GET_POLICY_GENERATION = APIOperation( - input=GetPolicyGenerationInput, - output=GetPolicyGenerationOutput, - schema=_SCHEMA_GET_POLICY_GENERATION, - input_schema=_SCHEMA_GET_POLICY_GENERATION_INPUT, - output_schema=_SCHEMA_GET_POLICY_GENERATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetPolicyGenerationSummaryInput: - """Dataclass for GetPolicyGenerationSummaryInput structure.""" - - policy_generation_id: str | None = None - """ - The unique identifier of the policy generation request to retrieve the - summary for. - """ - - policy_engine_id: str | None = None - """ - The identifier of the policy engine associated with the policy - generation request. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_POLICY_GENERATION_SUMMARY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.policy_generation_id is not None: - serializer.write_string( - _SCHEMA_GET_POLICY_GENERATION_SUMMARY_INPUT.members[ - "policyGenerationId" - ], - self.policy_generation_id, - ) - - if self.policy_engine_id is not None: - serializer.write_string( - _SCHEMA_GET_POLICY_GENERATION_SUMMARY_INPUT.members["policyEngineId"], - self.policy_engine_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_generation_id"] = de.read_string( - _SCHEMA_GET_POLICY_GENERATION_SUMMARY_INPUT.members[ - "policyGenerationId" - ] - ) - - case 1: - kwargs["policy_engine_id"] = de.read_string( - _SCHEMA_GET_POLICY_GENERATION_SUMMARY_INPUT.members[ - "policyEngineId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_POLICY_GENERATION_SUMMARY_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetPolicyGenerationSummaryOutput: - """Dataclass for GetPolicyGenerationSummaryOutput structure.""" - - policy_engine_id: str - """ - The identifier of the policy engine associated with this policy - generation. - """ - - policy_generation_id: str - """The unique identifier of the policy generation request.""" - - name: str - """The customer-assigned name for the policy generation request.""" - - policy_generation_arn: str - """The Amazon Resource Name (ARN) of the policy generation request.""" - - resource: Resource - """The resource information associated with the policy generation.""" - - created_at: datetime - """The timestamp when the policy generation request was created.""" - - updated_at: datetime - """The timestamp when the policy generation was last updated.""" - - status: str - """The current status of the policy generation request.""" - - findings: str | None = None - """The findings from the policy generation process, if available.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_POLICY_GENERATION_SUMMARY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_POLICY_GENERATION_SUMMARY_OUTPUT.members["policyEngineId"], - self.policy_engine_id, - ) - serializer.write_string( - _SCHEMA_GET_POLICY_GENERATION_SUMMARY_OUTPUT.members["policyGenerationId"], - self.policy_generation_id, - ) - serializer.write_string( - _SCHEMA_GET_POLICY_GENERATION_SUMMARY_OUTPUT.members["name"], self.name - ) - serializer.write_string( - _SCHEMA_GET_POLICY_GENERATION_SUMMARY_OUTPUT.members["policyGenerationArn"], - self.policy_generation_arn, - ) - serializer.write_struct( - _SCHEMA_GET_POLICY_GENERATION_SUMMARY_OUTPUT.members["resource"], - self.resource, - ) - serializer.write_timestamp( - _SCHEMA_GET_POLICY_GENERATION_SUMMARY_OUTPUT.members["createdAt"], - self.created_at, - ) - serializer.write_timestamp( - _SCHEMA_GET_POLICY_GENERATION_SUMMARY_OUTPUT.members["updatedAt"], - self.updated_at, - ) - serializer.write_string( - _SCHEMA_GET_POLICY_GENERATION_SUMMARY_OUTPUT.members["status"], self.status - ) - if self.findings is not None: - serializer.write_string( - _SCHEMA_GET_POLICY_GENERATION_SUMMARY_OUTPUT.members["findings"], - self.findings, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_engine_id"] = de.read_string( - _SCHEMA_GET_POLICY_GENERATION_SUMMARY_OUTPUT.members[ - "policyEngineId" - ] - ) - - case 1: - kwargs["policy_generation_id"] = de.read_string( - _SCHEMA_GET_POLICY_GENERATION_SUMMARY_OUTPUT.members[ - "policyGenerationId" - ] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_GET_POLICY_GENERATION_SUMMARY_OUTPUT.members["name"] - ) - - case 3: - kwargs["policy_generation_arn"] = de.read_string( - _SCHEMA_GET_POLICY_GENERATION_SUMMARY_OUTPUT.members[ - "policyGenerationArn" - ] - ) - - case 4: - kwargs["resource"] = _ResourceDeserializer().deserialize(de) - - case 5: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_POLICY_GENERATION_SUMMARY_OUTPUT.members[ - "createdAt" - ] - ) - - case 6: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_GET_POLICY_GENERATION_SUMMARY_OUTPUT.members[ - "updatedAt" - ] - ) - - case 7: - kwargs["status"] = PolicyGenerationStatus( - de.read_string( - _SCHEMA_GET_POLICY_GENERATION_SUMMARY_OUTPUT.members[ - "status" - ] - ) - ) - - case 8: - kwargs["findings"] = de.read_string( - _SCHEMA_GET_POLICY_GENERATION_SUMMARY_OUTPUT.members["findings"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_POLICY_GENERATION_SUMMARY_OUTPUT, consumer=_consumer - ) - if "policy_engine_id" not in kwargs: - kwargs["policy_engine_id"] = "" - if "policy_generation_id" not in kwargs: - kwargs["policy_generation_id"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "policy_generation_arn" not in kwargs: - kwargs["policy_generation_arn"] = "" - if "resource" not in kwargs: - kwargs["resource"] = ResourceUnknown(tag="") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "status" not in kwargs: - kwargs["status"] = PolicyGenerationStatus._corrected("") - return kwargs - - -GET_POLICY_GENERATION_SUMMARY = APIOperation( - input=GetPolicyGenerationSummaryInput, - output=GetPolicyGenerationSummaryOutput, - schema=_SCHEMA_GET_POLICY_GENERATION_SUMMARY, - input_schema=_SCHEMA_GET_POLICY_GENERATION_SUMMARY_INPUT, - output_schema=_SCHEMA_GET_POLICY_GENERATION_SUMMARY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListPolicyGenerationAssetsInput: - """Dataclass for ListPolicyGenerationAssetsInput structure.""" - - policy_generation_id: str | None = None - """ - The unique identifier of the policy generation request whose assets are - to be retrieved. This must be a valid generation ID from a previous - [StartPolicyGeneration](https://docs.aws.amazon.com/bedrock-agentcore-control/latest/APIReference/API_StartPolicyGeneration.html) - call that has completed processing. - """ - - policy_engine_id: str | None = None - """ - The unique identifier of the policy engine associated with the policy - generation request. This provides the context for the generation - operation and ensures assets are retrieved from the correct policy - engine. - """ - - next_token: str | None = None - """ - A pagination token returned from a previous - [ListPolicyGenerationAssets](https://docs.aws.amazon.com/bedrock-agentcore-control/latest/APIReference/API_ListPolicyGenerationAssets.html) - call. Use this token to retrieve the next page of assets when the - response is paginated due to large numbers of generated policy options. - """ - - max_results: int | None = None - """ - The maximum number of policy generation assets to return in a single - response. If not specified, the default is 10 assets per page, with a - maximum of 100 per page. This helps control response size when dealing - with policy generations that produce many alternative policy options. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_POLICY_GENERATION_ASSETS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.policy_generation_id is not None: - serializer.write_string( - _SCHEMA_LIST_POLICY_GENERATION_ASSETS_INPUT.members[ - "policyGenerationId" - ], - self.policy_generation_id, - ) - - if self.policy_engine_id is not None: - serializer.write_string( - _SCHEMA_LIST_POLICY_GENERATION_ASSETS_INPUT.members["policyEngineId"], - self.policy_engine_id, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_POLICY_GENERATION_ASSETS_INPUT.members["nextToken"], - self.next_token, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_POLICY_GENERATION_ASSETS_INPUT.members["maxResults"], - self.max_results, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_generation_id"] = de.read_string( - _SCHEMA_LIST_POLICY_GENERATION_ASSETS_INPUT.members[ - "policyGenerationId" - ] - ) - - case 1: - kwargs["policy_engine_id"] = de.read_string( - _SCHEMA_LIST_POLICY_GENERATION_ASSETS_INPUT.members[ - "policyEngineId" - ] - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_POLICY_GENERATION_ASSETS_INPUT.members["nextToken"] - ) - - case 3: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_POLICY_GENERATION_ASSETS_INPUT.members[ - "maxResults" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_POLICY_GENERATION_ASSETS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CedarPolicy: - """ - Represents a Cedar policy statement within the AgentCore Policy system. - Cedar is a policy language designed for authorization that provides - human-readable, analyzable, and high-performance policy evaluation for - controlling agent behavior and access decisions. - """ - - statement: str - """ - The Cedar policy statement that defines the authorization logic. This - statement follows Cedar syntax and specifies principals, actions, - resources, and conditions that determine when access should be allowed - or denied. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CEDAR_POLICY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CEDAR_POLICY.members["statement"], self.statement - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["statement"] = de.read_string( - _SCHEMA_CEDAR_POLICY.members["statement"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CEDAR_POLICY, consumer=_consumer) - if "statement" not in kwargs: - kwargs["statement"] = "" - return kwargs - - -@dataclass(kw_only=True) -class PolicyStatement: - """ - An AgentCore Cedar or Dogwood policy statement, which supports plain - Cedar policies, temporal policies, and guardrails definitions. - """ - - statement: str - """ - The body of the AgentCore Cedar or Dogwood policy statement. Contains - the policy logic, which can be a Cedar policy, a temporal policy, or a - guardrails definition. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_POLICY_STATEMENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_POLICY_STATEMENT.members["statement"], self.statement - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["statement"] = de.read_string( - _SCHEMA_POLICY_STATEMENT.members["statement"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_POLICY_STATEMENT, consumer=_consumer) - if "statement" not in kwargs: - kwargs["statement"] = "" - return kwargs - - -@dataclass(kw_only=True) -class PolicyGenerationDetails: - """ - Represents the information identifying a generated policy asset from the - AI-powered policy generation process within the AgentCore Policy system. - Each asset contains a Dogwood policy statement generated from natural - language input, along with associated metadata and analysis findings to - help users evaluate and select the most appropriate policy option. - """ - - policy_generation_id: str - """The unique identifier for this policy generation request.""" - - policy_generation_asset_id: str - """ - The unique identifier for this generated policy asset within the policy - generation request. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_POLICY_GENERATION_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_POLICY_GENERATION_DETAILS.members["policyGenerationId"], - self.policy_generation_id, - ) - serializer.write_string( - _SCHEMA_POLICY_GENERATION_DETAILS.members["policyGenerationAssetId"], - self.policy_generation_asset_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_generation_id"] = de.read_string( - _SCHEMA_POLICY_GENERATION_DETAILS.members["policyGenerationId"] - ) - - case 1: - kwargs["policy_generation_asset_id"] = de.read_string( - _SCHEMA_POLICY_GENERATION_DETAILS.members[ - "policyGenerationAssetId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_POLICY_GENERATION_DETAILS, consumer=_consumer) - if "policy_generation_id" not in kwargs: - kwargs["policy_generation_id"] = "" - if "policy_generation_asset_id" not in kwargs: - kwargs["policy_generation_asset_id"] = "" - return kwargs - - -@dataclass -class PolicyDefinitionCedar: - """ - The Cedar policy definition within the policy definition structure. This - contains the Cedar policy statement that defines the authorization logic - using Cedar's human-readable, analyzable policy language. Cedar - policies specify principals (who can access), actions (what operations - are allowed), resources (what can be accessed), and optional conditions - for fine-grained control. Cedar provides a formal policy language - designed for authorization with deterministic evaluation, making - policies testable, reviewable, and auditable. All Cedar policies follow - a default-deny model where actions are denied unless explicitly - permitted, and forbid policies always override permit policies. - """ - - value: CedarPolicy - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_POLICY_DEFINITION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_POLICY_DEFINITION.members["cedar"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=CedarPolicy.deserialize(deserializer)) - - -@dataclass -class PolicyDefinitionPolicyGeneration: - """ - The generated policy asset information within the policy definition - structure. This contains information identifying a generated policy - asset from the AI-powered policy generation process within the AgentCore - Policy system. Each asset contains a Dogwood policy statement generated - from natural language input, along with associated metadata and analysis - findings to help users evaluate and select the most appropriate policy - option. - """ - - value: PolicyGenerationDetails - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_POLICY_DEFINITION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_POLICY_DEFINITION.members["policyGeneration"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=PolicyGenerationDetails.deserialize(deserializer)) - - -@dataclass -class PolicyDefinitionPolicy: - """ - The Dogwood policy statement that defines the access control rules. This - policy definition can include Dogwood policies and supports temporal - conditions and information providers such as guardrails. - """ - - value: PolicyStatement - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_POLICY_DEFINITION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_POLICY_DEFINITION.members["policy"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=PolicyStatement.deserialize(deserializer)) - - -@dataclass -class PolicyDefinitionUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -PolicyDefinition = Union[ - PolicyDefinitionCedar - | PolicyDefinitionPolicyGeneration - | PolicyDefinitionPolicy - | PolicyDefinitionUnknown -] -""" -Represents the definition structure for policies within the AgentCore -Policy system. This structure encapsulates different policy formats and -languages that can be used to define access control rules. -""" - - -class _PolicyDefinitionDeserializer: - _result: PolicyDefinition | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> PolicyDefinition: - self._result = None - deserializer.read_struct(_SCHEMA_POLICY_DEFINITION, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(PolicyDefinitionCedar.deserialize(de)) - - case 1: - self._set_result(PolicyDefinitionPolicyGeneration.deserialize(de)) - - case 2: - self._set_result(PolicyDefinitionPolicy.deserialize(de)) - - case _: - self._set_result( - PolicyDefinitionUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: PolicyDefinition) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class FindingType(UnknownEnumMixin, StrEnum): - VALID = "VALID" - INVALID = "INVALID" - NOT_TRANSLATABLE = "NOT_TRANSLATABLE" - ALLOW_ALL = "ALLOW_ALL" - ALLOW_NONE = "ALLOW_NONE" - DENY_ALL = "DENY_ALL" - DENY_NONE = "DENY_NONE" - - -@dataclass(kw_only=True) -class Finding: - """ - Represents a finding or issue discovered during policy generation or - validation. Findings provide insights about potential problems, - recommendations, or validation results from policy analysis operations. - Finding types include: VALID (policy is ready to use), INVALID (policy - has validation errors that must be fixed), NOT_TRANSLATABLE (input - couldn't be converted to policy), ALLOW_ALL (policy would allow all - actions, potential security risk), ALLOW_NONE (policy would allow no - actions, unusable), DENY_ALL (policy would deny all actions, may be too - restrictive), and DENY_NONE (policy would deny no actions, ineffective). - Review all findings before creating policies from generated assets to - ensure they match your security requirements. - """ - - type: str | None = None - """ - The type or category of the finding. This classifies the finding as an - error, warning, recommendation, or informational message to help users - understand the severity and nature of the issue. - """ - - description: str | None = None - """ - A human-readable description of the finding. This provides detailed - information about the issue, recommendation, or validation result to - help users understand and address the finding. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FINDING, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string(_SCHEMA_FINDING.members["type"], self.type) - - if self.description is not None: - serializer.write_string( - _SCHEMA_FINDING.members["description"], self.description - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = FindingType( - de.read_string(_SCHEMA_FINDING.members["type"]) - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_FINDING.members["description"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FINDING, consumer=_consumer) - return kwargs - - -def _serialize_findings( - serializer: ShapeSerializer, schema: Schema, value: list[Finding] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_findings( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Finding]: - result: list[Finding] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Finding.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class PolicyGenerationAsset: - """ - Represents a generated policy asset from the AI-powered policy - generation process within the AgentCore Policy system. Each asset - contains a Dogwood policy statement generated from natural language - input, along with associated metadata and analysis findings to help - users evaluate and select the most appropriate policy option. - """ - - policy_generation_asset_id: str - """ - The unique identifier for this generated policy asset within the policy - generation request. This ID can be used to reference specific generated - policy options when creating actual policies from the generation - results. - """ - - raw_text_fragment: str - """ - The portion of the original natural language input that this generated - policy asset addresses. This helps users understand which part of their - policy description was translated into this specific Dogwood policy - statement, enabling better policy selection and refinement. When a - single natural language input describes multiple authorization - requirements, the generation process creates separate policy assets for - each requirement, with each asset's rawTextFragment showing which - requirement it addresses. Use this mapping to verify that all parts of - your natural language input were correctly translated into Dogwood - policies. - """ - - findings: list[Finding] - """ - Analysis findings and insights related to this specific generated policy - asset. These findings may include validation results, potential issues, - or recommendations for improvement to help users evaluate the quality - and appropriateness of the generated policy. - """ - - definition: PolicyDefinition | None = None - """ - Represents the definition structure for policies within the AgentCore - Policy system. This structure encapsulates different policy formats and - languages that can be used to define access control rules. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_POLICY_GENERATION_ASSET, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_POLICY_GENERATION_ASSET.members["policyGenerationAssetId"], - self.policy_generation_asset_id, - ) - if self.definition is not None: - serializer.write_struct( - _SCHEMA_POLICY_GENERATION_ASSET.members["definition"], self.definition - ) - - serializer.write_string( - _SCHEMA_POLICY_GENERATION_ASSET.members["rawTextFragment"], - self.raw_text_fragment, - ) - _serialize_findings( - serializer, - _SCHEMA_POLICY_GENERATION_ASSET.members["findings"], - self.findings, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_generation_asset_id"] = de.read_string( - _SCHEMA_POLICY_GENERATION_ASSET.members[ - "policyGenerationAssetId" - ] - ) - - case 1: - kwargs["definition"] = _PolicyDefinitionDeserializer().deserialize( - de - ) - - case 2: - kwargs["raw_text_fragment"] = de.read_string( - _SCHEMA_POLICY_GENERATION_ASSET.members["rawTextFragment"] - ) - - case 3: - kwargs["findings"] = _deserialize_findings( - de, _SCHEMA_POLICY_GENERATION_ASSET.members["findings"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_POLICY_GENERATION_ASSET, consumer=_consumer) - if "policy_generation_asset_id" not in kwargs: - kwargs["policy_generation_asset_id"] = "" - if "raw_text_fragment" not in kwargs: - kwargs["raw_text_fragment"] = "" - if "findings" not in kwargs: - kwargs["findings"] = [] - return kwargs - - -def _serialize_policy_generation_assets( - serializer: ShapeSerializer, schema: Schema, value: list[PolicyGenerationAsset] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_policy_generation_assets( - deserializer: ShapeDeserializer, schema: Schema -) -> list[PolicyGenerationAsset]: - result: list[PolicyGenerationAsset] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(PolicyGenerationAsset.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListPolicyGenerationAssetsOutput: - """Dataclass for ListPolicyGenerationAssetsOutput structure.""" - - policy_generation_assets: list[PolicyGenerationAsset] | None = None - """ - An array of generated policy assets including Dogwood policies and - related artifacts from the AI-powered policy generation process. Each - asset represents a different policy option or variation generated from - the original natural language input. - """ - - next_token: str | None = None - """ - A pagination token that can be used in subsequent - [ListPolicyGenerationAssets](https://docs.aws.amazon.com/bedrock-agentcore-control/latest/APIReference/API_ListPolicyGenerationAssets.html) - calls to retrieve additional assets. This token is only present when - there are more generated policy assets available beyond the current - response. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_POLICY_GENERATION_ASSETS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.policy_generation_assets is not None: - _serialize_policy_generation_assets( - serializer, - _SCHEMA_LIST_POLICY_GENERATION_ASSETS_OUTPUT.members[ - "policyGenerationAssets" - ], - self.policy_generation_assets, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_POLICY_GENERATION_ASSETS_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_generation_assets"] = ( - _deserialize_policy_generation_assets( - de, - _SCHEMA_LIST_POLICY_GENERATION_ASSETS_OUTPUT.members[ - "policyGenerationAssets" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_POLICY_GENERATION_ASSETS_OUTPUT.members[ - "nextToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_POLICY_GENERATION_ASSETS_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_POLICY_GENERATION_ASSETS = APIOperation( - input=ListPolicyGenerationAssetsInput, - output=ListPolicyGenerationAssetsOutput, - schema=_SCHEMA_LIST_POLICY_GENERATION_ASSETS, - input_schema=_SCHEMA_LIST_POLICY_GENERATION_ASSETS_INPUT, - output_schema=_SCHEMA_LIST_POLICY_GENERATION_ASSETS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListPolicyGenerationsInput: - """Dataclass for ListPolicyGenerationsInput structure.""" - - next_token: str | None = None - """ - A pagination token for retrieving additional policy generations when - results are paginated. - """ - - max_results: int | None = None - """The maximum number of policy generations to return in a single response.""" - - policy_engine_id: str | None = None - """ - The identifier of the policy engine whose policy generations to - retrieve. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_POLICY_GENERATIONS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_POLICY_GENERATIONS_INPUT.members["nextToken"], - self.next_token, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_POLICY_GENERATIONS_INPUT.members["maxResults"], - self.max_results, - ) - - if self.policy_engine_id is not None: - serializer.write_string( - _SCHEMA_LIST_POLICY_GENERATIONS_INPUT.members["policyEngineId"], - self.policy_engine_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_POLICY_GENERATIONS_INPUT.members["nextToken"] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_POLICY_GENERATIONS_INPUT.members["maxResults"] - ) - - case 2: - kwargs["policy_engine_id"] = de.read_string( - _SCHEMA_LIST_POLICY_GENERATIONS_INPUT.members["policyEngineId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_POLICY_GENERATIONS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class PolicyGeneration: - """ - Represents a policy generation request within the AgentCore Policy - system. Tracks the AI-powered conversion of natural language - descriptions into Dogwood policy statements, enabling users to author - policies by describing authorization requirements in plain English. The - generation process analyzes the natural language input along with the - Gateway's tool context and Cedar schema to produce one or more - validated policy options. Each generation request tracks the status of - the conversion process and maintains findings about the generated - policies, including validation results and potential issues. Generated - policy assets remain available for one week after successful generation, - allowing time to review and create policies from the generated options. - """ - - policy_engine_id: str - """ - The identifier of the policy engine associated with this generation - request. - """ - - policy_generation_id: str - """The unique identifier for this policy generation request.""" - - name: str - """The customer-assigned name for this policy generation request.""" - - policy_generation_arn: str - """The ARN of this policy generation request.""" - - resource: Resource - """The resource information associated with this policy generation.""" - - created_at: datetime - """The timestamp when this policy generation request was created.""" - - updated_at: datetime - """The timestamp when this policy generation was last updated.""" - - status: str - """The current status of this policy generation request.""" - - status_reasons: list[str] - """Additional information about the generation status.""" - - findings: str | None = None - """Findings and insights from this policy generation process.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_POLICY_GENERATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_POLICY_GENERATION.members["policyEngineId"], self.policy_engine_id - ) - serializer.write_string( - _SCHEMA_POLICY_GENERATION.members["policyGenerationId"], - self.policy_generation_id, - ) - serializer.write_string(_SCHEMA_POLICY_GENERATION.members["name"], self.name) - serializer.write_string( - _SCHEMA_POLICY_GENERATION.members["policyGenerationArn"], - self.policy_generation_arn, - ) - serializer.write_struct( - _SCHEMA_POLICY_GENERATION.members["resource"], self.resource - ) - serializer.write_timestamp( - _SCHEMA_POLICY_GENERATION.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_POLICY_GENERATION.members["updatedAt"], self.updated_at - ) - serializer.write_string( - _SCHEMA_POLICY_GENERATION.members["status"], self.status - ) - if self.findings is not None: - serializer.write_string( - _SCHEMA_POLICY_GENERATION.members["findings"], self.findings - ) - - _serialize_policy_status_reasons( - serializer, - _SCHEMA_POLICY_GENERATION.members["statusReasons"], - self.status_reasons, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_engine_id"] = de.read_string( - _SCHEMA_POLICY_GENERATION.members["policyEngineId"] - ) - - case 1: - kwargs["policy_generation_id"] = de.read_string( - _SCHEMA_POLICY_GENERATION.members["policyGenerationId"] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_POLICY_GENERATION.members["name"] - ) - - case 3: - kwargs["policy_generation_arn"] = de.read_string( - _SCHEMA_POLICY_GENERATION.members["policyGenerationArn"] - ) - - case 4: - kwargs["resource"] = _ResourceDeserializer().deserialize(de) - - case 5: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_POLICY_GENERATION.members["createdAt"] - ) - - case 6: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_POLICY_GENERATION.members["updatedAt"] - ) - - case 7: - kwargs["status"] = PolicyGenerationStatus( - de.read_string(_SCHEMA_POLICY_GENERATION.members["status"]) - ) - - case 8: - kwargs["findings"] = de.read_string( - _SCHEMA_POLICY_GENERATION.members["findings"] - ) - - case 9: - kwargs["status_reasons"] = _deserialize_policy_status_reasons( - de, _SCHEMA_POLICY_GENERATION.members["statusReasons"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_POLICY_GENERATION, consumer=_consumer) - if "policy_engine_id" not in kwargs: - kwargs["policy_engine_id"] = "" - if "policy_generation_id" not in kwargs: - kwargs["policy_generation_id"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "policy_generation_arn" not in kwargs: - kwargs["policy_generation_arn"] = "" - if "resource" not in kwargs: - kwargs["resource"] = ResourceUnknown(tag="") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "status" not in kwargs: - kwargs["status"] = PolicyGenerationStatus._corrected("") - if "status_reasons" not in kwargs: - kwargs["status_reasons"] = [] - return kwargs - - -def _serialize_policy_generations( - serializer: ShapeSerializer, schema: Schema, value: list[PolicyGeneration] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_policy_generations( - deserializer: ShapeDeserializer, schema: Schema -) -> list[PolicyGeneration]: - result: list[PolicyGeneration] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(PolicyGeneration.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListPolicyGenerationsOutput: - """Dataclass for ListPolicyGenerationsOutput structure.""" - - policy_generations: list[PolicyGeneration] - """An array of policy generation objects that match the specified criteria.""" - - next_token: str | None = None - """ - A pagination token for retrieving additional policy generations if more - results are available. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_POLICY_GENERATIONS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_policy_generations( - serializer, - _SCHEMA_LIST_POLICY_GENERATIONS_OUTPUT.members["policyGenerations"], - self.policy_generations, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_POLICY_GENERATIONS_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_generations"] = _deserialize_policy_generations( - de, - _SCHEMA_LIST_POLICY_GENERATIONS_OUTPUT.members[ - "policyGenerations" - ], - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_POLICY_GENERATIONS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_POLICY_GENERATIONS_OUTPUT, consumer=_consumer - ) - if "policy_generations" not in kwargs: - kwargs["policy_generations"] = [] - return kwargs - - -LIST_POLICY_GENERATIONS = APIOperation( - input=ListPolicyGenerationsInput, - output=ListPolicyGenerationsOutput, - schema=_SCHEMA_LIST_POLICY_GENERATIONS, - input_schema=_SCHEMA_LIST_POLICY_GENERATIONS_INPUT, - output_schema=_SCHEMA_LIST_POLICY_GENERATIONS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListPolicyGenerationSummariesInput: - """Dataclass for ListPolicyGenerationSummariesInput structure.""" - - next_token: str | None = None - """ - A pagination token returned from a previous - [ListPolicyGenerationSummaries](https://docs.aws.amazon.com/bedrock-agentcore-control/latest/APIReference/API_ListPolicyGenerationSummaries.html) - call. Use this token to retrieve the next page of results when the - response is paginated. - """ - - max_results: int | None = None - """ - The maximum number of policy generation summaries to return in a single - response. - """ - - policy_engine_id: str | None = None - """ - The identifier of the policy engine whose policy generation summaries to - retrieve. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_POLICY_GENERATION_SUMMARIES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_POLICY_GENERATION_SUMMARIES_INPUT.members["nextToken"], - self.next_token, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_POLICY_GENERATION_SUMMARIES_INPUT.members["maxResults"], - self.max_results, - ) - - if self.policy_engine_id is not None: - serializer.write_string( - _SCHEMA_LIST_POLICY_GENERATION_SUMMARIES_INPUT.members[ - "policyEngineId" - ], - self.policy_engine_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_POLICY_GENERATION_SUMMARIES_INPUT.members[ - "nextToken" - ] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_POLICY_GENERATION_SUMMARIES_INPUT.members[ - "maxResults" - ] - ) - - case 2: - kwargs["policy_engine_id"] = de.read_string( - _SCHEMA_LIST_POLICY_GENERATION_SUMMARIES_INPUT.members[ - "policyEngineId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_POLICY_GENERATION_SUMMARIES_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class PolicyGenerationSummary: - """ - Represents a metadata-only summary of a policy generation resource. This - structure contains resource identifiers, status, timestamps, and - findings without customer-encrypted fields such as status reasons. - Policy generation summaries are returned by operations that do not - require access to the customer's KMS key. - """ - - policy_engine_id: str - """ - The identifier of the policy engine associated with this generation - request. - """ - - policy_generation_id: str - """The unique identifier for this policy generation request.""" - - name: str - """The customer-assigned name for this policy generation request.""" - - policy_generation_arn: str - """The ARN of this policy generation request.""" - - resource: Resource - """The resource information associated with this policy generation.""" - - created_at: datetime - """The timestamp when this policy generation request was created.""" - - updated_at: datetime - """The timestamp when this policy generation was last updated.""" - - status: str - """The current status of this policy generation request.""" - - findings: str | None = None - """Findings and insights from this policy generation process.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_POLICY_GENERATION_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_POLICY_GENERATION_SUMMARY.members["policyEngineId"], - self.policy_engine_id, - ) - serializer.write_string( - _SCHEMA_POLICY_GENERATION_SUMMARY.members["policyGenerationId"], - self.policy_generation_id, - ) - serializer.write_string( - _SCHEMA_POLICY_GENERATION_SUMMARY.members["name"], self.name - ) - serializer.write_string( - _SCHEMA_POLICY_GENERATION_SUMMARY.members["policyGenerationArn"], - self.policy_generation_arn, - ) - serializer.write_struct( - _SCHEMA_POLICY_GENERATION_SUMMARY.members["resource"], self.resource - ) - serializer.write_timestamp( - _SCHEMA_POLICY_GENERATION_SUMMARY.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_POLICY_GENERATION_SUMMARY.members["updatedAt"], self.updated_at - ) - serializer.write_string( - _SCHEMA_POLICY_GENERATION_SUMMARY.members["status"], self.status - ) - if self.findings is not None: - serializer.write_string( - _SCHEMA_POLICY_GENERATION_SUMMARY.members["findings"], self.findings - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_engine_id"] = de.read_string( - _SCHEMA_POLICY_GENERATION_SUMMARY.members["policyEngineId"] - ) - - case 1: - kwargs["policy_generation_id"] = de.read_string( - _SCHEMA_POLICY_GENERATION_SUMMARY.members["policyGenerationId"] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_POLICY_GENERATION_SUMMARY.members["name"] - ) - - case 3: - kwargs["policy_generation_arn"] = de.read_string( - _SCHEMA_POLICY_GENERATION_SUMMARY.members["policyGenerationArn"] - ) - - case 4: - kwargs["resource"] = _ResourceDeserializer().deserialize(de) - - case 5: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_POLICY_GENERATION_SUMMARY.members["createdAt"] - ) - - case 6: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_POLICY_GENERATION_SUMMARY.members["updatedAt"] - ) - - case 7: - kwargs["status"] = PolicyGenerationStatus( - de.read_string( - _SCHEMA_POLICY_GENERATION_SUMMARY.members["status"] - ) - ) - - case 8: - kwargs["findings"] = de.read_string( - _SCHEMA_POLICY_GENERATION_SUMMARY.members["findings"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_POLICY_GENERATION_SUMMARY, consumer=_consumer) - if "policy_engine_id" not in kwargs: - kwargs["policy_engine_id"] = "" - if "policy_generation_id" not in kwargs: - kwargs["policy_generation_id"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "policy_generation_arn" not in kwargs: - kwargs["policy_generation_arn"] = "" - if "resource" not in kwargs: - kwargs["resource"] = ResourceUnknown(tag="") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "status" not in kwargs: - kwargs["status"] = PolicyGenerationStatus._corrected("") - return kwargs - - -def _serialize_policy_generation_summary_list( - serializer: ShapeSerializer, schema: Schema, value: list[PolicyGenerationSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_policy_generation_summary_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[PolicyGenerationSummary]: - result: list[PolicyGenerationSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(PolicyGenerationSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListPolicyGenerationSummariesOutput: - """Dataclass for ListPolicyGenerationSummariesOutput structure.""" - - policy_generations: list[PolicyGenerationSummary] - """ - An array of policy generation summary objects that match the specified - criteria. Each summary contains resource identifiers, status, - timestamps, and findings without customer-encrypted content. - """ - - next_token: str | None = None - """ - A pagination token that can be used in subsequent - [ListPolicyGenerationSummaries](https://docs.aws.amazon.com/bedrock-agentcore-control/latest/APIReference/API_ListPolicyGenerationSummaries.html) - calls to retrieve additional results. This token is only present when - there are more results available. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_POLICY_GENERATION_SUMMARIES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_policy_generation_summary_list( - serializer, - _SCHEMA_LIST_POLICY_GENERATION_SUMMARIES_OUTPUT.members[ - "policyGenerations" - ], - self.policy_generations, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_POLICY_GENERATION_SUMMARIES_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_generations"] = ( - _deserialize_policy_generation_summary_list( - de, - _SCHEMA_LIST_POLICY_GENERATION_SUMMARIES_OUTPUT.members[ - "policyGenerations" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_POLICY_GENERATION_SUMMARIES_OUTPUT.members[ - "nextToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_POLICY_GENERATION_SUMMARIES_OUTPUT, consumer=_consumer - ) - if "policy_generations" not in kwargs: - kwargs["policy_generations"] = [] - return kwargs - - -LIST_POLICY_GENERATION_SUMMARIES = APIOperation( - input=ListPolicyGenerationSummariesInput, - output=ListPolicyGenerationSummariesOutput, - schema=_SCHEMA_LIST_POLICY_GENERATION_SUMMARIES, - input_schema=_SCHEMA_LIST_POLICY_GENERATION_SUMMARIES_INPUT, - output_schema=_SCHEMA_LIST_POLICY_GENERATION_SUMMARIES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass -class ContentRawText: - """ - The raw text content containing natural language descriptions of desired - policy behavior. This text is processed by AI to generate corresponding - Dogwood policy statements that match the described intent. - """ - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_CONTENT.members["rawText"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=deserializer.read_string(_SCHEMA_CONTENT.members["rawText"])) - - -@dataclass -class ContentUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -Content = Union[ContentRawText | ContentUnknown] -""" -Represents content input for policy generation operations. This -structure encapsulates the natural language descriptions or other -content formats that are used as input for AI-powered policy generation. -""" - - -class _ContentDeserializer: - _result: Content | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> Content: - self._result = None - deserializer.read_struct(_SCHEMA_CONTENT, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(ContentRawText.deserialize(de)) - - case _: - self._set_result(ContentUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: Content) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class StartPolicyGenerationInput: - """Dataclass for StartPolicyGenerationInput structure.""" - - policy_engine_id: str | None = None - """ - The identifier of the policy engine that provides the context for policy - generation. This engine's schema and tool context are used to ensure - generated policies are valid and applicable. - """ - - resource: Resource | None = None - """ - The resource information that provides context for policy generation. - This helps the AI understand the target resources and generate - appropriate access control rules. - """ - - content: Content | None = None - """ - The natural language description of the desired policy behavior. This - content is processed by AI to generate corresponding Dogwood policy - statements that match the described intent. - """ - - name: str | None = None - """ - A customer-assigned name for the policy generation request. This helps - track and identify generation operations, especially when running - multiple generations simultaneously. - """ - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure the idempotency of the - request. The AWS SDK automatically generates this token, so you don't - need to provide it in most cases. If you retry a request with the same - client token, the service returns the same response without starting a - duplicate generation. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_POLICY_GENERATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.policy_engine_id is not None: - serializer.write_string( - _SCHEMA_START_POLICY_GENERATION_INPUT.members["policyEngineId"], - self.policy_engine_id, - ) - - if self.resource is not None: - serializer.write_struct( - _SCHEMA_START_POLICY_GENERATION_INPUT.members["resource"], self.resource - ) - - if self.content is not None: - serializer.write_struct( - _SCHEMA_START_POLICY_GENERATION_INPUT.members["content"], self.content - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_START_POLICY_GENERATION_INPUT.members["name"], self.name - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_START_POLICY_GENERATION_INPUT.members["clientToken"], - self.client_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_engine_id"] = de.read_string( - _SCHEMA_START_POLICY_GENERATION_INPUT.members["policyEngineId"] - ) - - case 1: - kwargs["resource"] = _ResourceDeserializer().deserialize(de) - - case 2: - kwargs["content"] = _ContentDeserializer().deserialize(de) - - case 3: - kwargs["name"] = de.read_string( - _SCHEMA_START_POLICY_GENERATION_INPUT.members["name"] - ) - - case 4: - kwargs["client_token"] = de.read_string( - _SCHEMA_START_POLICY_GENERATION_INPUT.members["clientToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_START_POLICY_GENERATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class StartPolicyGenerationOutput: - """Dataclass for StartPolicyGenerationOutput structure.""" - - policy_engine_id: str - """ - The identifier of the policy engine associated with the started policy - generation. - """ - - policy_generation_id: str - """ - The unique identifier assigned to the policy generation request for - tracking progress. - """ - - name: str - """The customer-assigned name for the policy generation request.""" - - policy_generation_arn: str - """The ARN of the created policy generation request.""" - - resource: Resource - """The resource information associated with the policy generation request.""" - - created_at: datetime - """The timestamp when the policy generation request was created.""" - - updated_at: datetime - """The timestamp when the policy generation was last updated.""" - - status: str - """The initial status of the policy generation request.""" - - status_reasons: list[str] - """Additional information about the generation status.""" - - findings: str | None = None - """Initial findings from the policy generation process.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_POLICY_GENERATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_START_POLICY_GENERATION_OUTPUT.members["policyEngineId"], - self.policy_engine_id, - ) - serializer.write_string( - _SCHEMA_START_POLICY_GENERATION_OUTPUT.members["policyGenerationId"], - self.policy_generation_id, - ) - serializer.write_string( - _SCHEMA_START_POLICY_GENERATION_OUTPUT.members["name"], self.name - ) - serializer.write_string( - _SCHEMA_START_POLICY_GENERATION_OUTPUT.members["policyGenerationArn"], - self.policy_generation_arn, - ) - serializer.write_struct( - _SCHEMA_START_POLICY_GENERATION_OUTPUT.members["resource"], self.resource - ) - serializer.write_timestamp( - _SCHEMA_START_POLICY_GENERATION_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_START_POLICY_GENERATION_OUTPUT.members["updatedAt"], self.updated_at - ) - serializer.write_string( - _SCHEMA_START_POLICY_GENERATION_OUTPUT.members["status"], self.status - ) - if self.findings is not None: - serializer.write_string( - _SCHEMA_START_POLICY_GENERATION_OUTPUT.members["findings"], - self.findings, - ) - - _serialize_policy_status_reasons( - serializer, - _SCHEMA_START_POLICY_GENERATION_OUTPUT.members["statusReasons"], - self.status_reasons, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_engine_id"] = de.read_string( - _SCHEMA_START_POLICY_GENERATION_OUTPUT.members["policyEngineId"] - ) - - case 1: - kwargs["policy_generation_id"] = de.read_string( - _SCHEMA_START_POLICY_GENERATION_OUTPUT.members[ - "policyGenerationId" - ] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_START_POLICY_GENERATION_OUTPUT.members["name"] - ) - - case 3: - kwargs["policy_generation_arn"] = de.read_string( - _SCHEMA_START_POLICY_GENERATION_OUTPUT.members[ - "policyGenerationArn" - ] - ) - - case 4: - kwargs["resource"] = _ResourceDeserializer().deserialize(de) - - case 5: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_START_POLICY_GENERATION_OUTPUT.members["createdAt"] - ) - - case 6: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_START_POLICY_GENERATION_OUTPUT.members["updatedAt"] - ) - - case 7: - kwargs["status"] = PolicyGenerationStatus( - de.read_string( - _SCHEMA_START_POLICY_GENERATION_OUTPUT.members["status"] - ) - ) - - case 8: - kwargs["findings"] = de.read_string( - _SCHEMA_START_POLICY_GENERATION_OUTPUT.members["findings"] - ) - - case 9: - kwargs["status_reasons"] = _deserialize_policy_status_reasons( - de, - _SCHEMA_START_POLICY_GENERATION_OUTPUT.members["statusReasons"], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_START_POLICY_GENERATION_OUTPUT, consumer=_consumer - ) - if "policy_engine_id" not in kwargs: - kwargs["policy_engine_id"] = "" - if "policy_generation_id" not in kwargs: - kwargs["policy_generation_id"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "policy_generation_arn" not in kwargs: - kwargs["policy_generation_arn"] = "" - if "resource" not in kwargs: - kwargs["resource"] = ResourceUnknown(tag="") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "status" not in kwargs: - kwargs["status"] = PolicyGenerationStatus._corrected("") - if "status_reasons" not in kwargs: - kwargs["status_reasons"] = [] - return kwargs - - -START_POLICY_GENERATION = APIOperation( - input=StartPolicyGenerationInput, - output=StartPolicyGenerationOutput, - schema=_SCHEMA_START_POLICY_GENERATION, - input_schema=_SCHEMA_START_POLICY_GENERATION_INPUT, - output_schema=_SCHEMA_START_POLICY_GENERATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class EnforcementMode(UnknownEnumMixin, StrEnum): - """ - The enforcement mode for a policy. Run this policy in `LOG_ONLY` mode to - collect data on how it affects your application. Once you are satisfied - with the data gathered, switch the policy to `ACTIVE`. - """ - - ACTIVE = "ACTIVE" - LOG_ONLY = "LOG_ONLY" - - -class PolicyValidationMode(UnknownEnumMixin, StrEnum): - FAIL_ON_ANY_FINDINGS = "FAIL_ON_ANY_FINDINGS" - IGNORE_ALL_FINDINGS = "IGNORE_ALL_FINDINGS" - - -@dataclass(kw_only=True) -class CreatePolicyInput: - """Dataclass for CreatePolicyInput structure.""" - - name: str | None = None - """ - The customer-assigned immutable name for the policy. Must be unique - within the account. This name is used for policy identification and - cannot be changed after creation. - """ - - definition: PolicyDefinition | None = None - """ - The Cedar or Dogwood policy statement that defines the access control - rules. This contains the actual policy logic written in Cedar or - Dogwood, specifying effect (permit or forbid), principals, actions, - resources, and conditions for agent behavior control. - """ - - description: str | None = field(repr=False, default=None) - """ - A human-readable description of the policy's purpose and functionality - (1-4,096 characters). This helps policy administrators understand the - policy's intent, business rules, and operational scope. Use this field - to document why the policy exists, what business requirement it - addresses, and any special considerations for maintenance. Clear - descriptions are essential for policy governance, auditing, and - troubleshooting. - """ - - validation_mode: str = PolicyValidationMode("FAIL_ON_ANY_FINDINGS") - """ - The validation mode for the policy creation. Determines how Cedar - analyzer validation results are handled during policy creation. - FAIL_ON_ANY_FINDINGS (default) runs the Cedar analyzer to validate the - policy against the Cedar schema and tool context, failing creation if - the analyzer detects any validation issues to ensure strict conformance. - IGNORE_ALL_FINDINGS runs the Cedar analyzer but allows policy creation - even if validation issues are detected, useful for testing or when the - policy schema is evolving. Use FAIL_ON_ANY_FINDINGS for production - policies to ensure correctness, and IGNORE_ALL_FINDINGS only when you - understand and accept the analyzer findings. - """ - - enforcement_mode: str = EnforcementMode("ACTIVE") - """ - The enforcement mode for the policy. Run this policy in `LOG_ONLY` mode - to collect data on how it affects your application. Once you are - satisfied with the data gathered, switch the policy to `ACTIVE`. - Defaults to `ACTIVE`. - """ - - policy_engine_id: str | None = None - """ - The identifier of the policy engine which contains this policy. Policy - engines group related policies and provide the execution context for - policy evaluation. - """ - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure the idempotency of the - request. The AWS SDK automatically generates this token, so you don't - need to provide it in most cases. If you retry a request with the same - client token, the service returns the same response without creating a - duplicate policy. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_POLICY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_POLICY_INPUT.members["name"], self.name - ) - - if self.definition is not None: - serializer.write_struct( - _SCHEMA_CREATE_POLICY_INPUT.members["definition"], self.definition - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_POLICY_INPUT.members["description"], self.description - ) - - if self.validation_mode is not None: - serializer.write_string( - _SCHEMA_CREATE_POLICY_INPUT.members["validationMode"], - self.validation_mode, - ) - - if self.enforcement_mode is not None: - serializer.write_string( - _SCHEMA_CREATE_POLICY_INPUT.members["enforcementMode"], - self.enforcement_mode, - ) - - if self.policy_engine_id is not None: - serializer.write_string( - _SCHEMA_CREATE_POLICY_INPUT.members["policyEngineId"], - self.policy_engine_id, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_POLICY_INPUT.members["clientToken"], self.client_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_POLICY_INPUT.members["name"] - ) - - case 1: - kwargs["definition"] = _PolicyDefinitionDeserializer().deserialize( - de - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_POLICY_INPUT.members["description"] - ) - - case 3: - kwargs["validation_mode"] = PolicyValidationMode( - de.read_string( - _SCHEMA_CREATE_POLICY_INPUT.members["validationMode"] - ) - ) - - case 4: - kwargs["enforcement_mode"] = EnforcementMode( - de.read_string( - _SCHEMA_CREATE_POLICY_INPUT.members["enforcementMode"] - ) - ) - - case 5: - kwargs["policy_engine_id"] = de.read_string( - _SCHEMA_CREATE_POLICY_INPUT.members["policyEngineId"] - ) - - case 6: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_POLICY_INPUT.members["clientToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_POLICY_INPUT, consumer=_consumer) - return kwargs - - -class PolicyStatus(UnknownEnumMixin, StrEnum): - CREATING = "CREATING" - ACTIVE = "ACTIVE" - UPDATING = "UPDATING" - DELETING = "DELETING" - CREATE_FAILED = "CREATE_FAILED" - UPDATE_FAILED = "UPDATE_FAILED" - DELETE_FAILED = "DELETE_FAILED" - - -@dataclass(kw_only=True) -class CreatePolicyOutput: - """Dataclass for CreatePolicyOutput structure.""" - - policy_id: str - """ - The unique identifier for the created policy. This is a system-generated - identifier consisting of the user name plus a 10-character generated - suffix, used for all subsequent policy operations. - """ - - name: str - """ - The customer-assigned name of the created policy. This matches the name - provided in the request and serves as the human-readable identifier for - the policy. - """ - - policy_engine_id: str - """ - The identifier of the policy engine that manages this policy. This - confirms the policy engine assignment and is used for policy evaluation - routing. - """ - - created_at: datetime - """ - The timestamp when the policy was created. This is automatically set by - the service and used for auditing and lifecycle management. - """ - - updated_at: datetime - """ - The timestamp when the policy was last updated. For newly created - policies, this matches the createdAt timestamp. - """ - - policy_arn: str - """ - The Amazon Resource Name (ARN) of the created policy. This globally - unique identifier can be used for cross-service references and IAM - policy statements. - """ - - status: str - """ - The current status of the policy. A status of `ACTIVE` indicates the - policy is ready for use. - """ - - definition: PolicyDefinition - """ - The Cedar or Dogwood policy statement that was created. This is the - validated policy definition that will be used for agent behavior control - and access decisions. - """ - - status_reasons: list[str] - """ - Additional information about the policy status. This provides details - about any failures or the current state of the policy creation process. - """ - - enforcement_mode: str = EnforcementMode("ACTIVE") - """The enforcement mode of the created policy.""" - - description: str | None = field(repr=False, default=None) - """ - The human-readable description of the policy's purpose and - functionality. This helps administrators understand and manage the - policy. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_POLICY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_POLICY_OUTPUT.members["policyId"], self.policy_id - ) - serializer.write_string(_SCHEMA_CREATE_POLICY_OUTPUT.members["name"], self.name) - serializer.write_string( - _SCHEMA_CREATE_POLICY_OUTPUT.members["policyEngineId"], - self.policy_engine_id, - ) - serializer.write_timestamp( - _SCHEMA_CREATE_POLICY_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_CREATE_POLICY_OUTPUT.members["updatedAt"], self.updated_at - ) - serializer.write_string( - _SCHEMA_CREATE_POLICY_OUTPUT.members["policyArn"], self.policy_arn - ) - serializer.write_string( - _SCHEMA_CREATE_POLICY_OUTPUT.members["status"], self.status - ) - serializer.write_string( - _SCHEMA_CREATE_POLICY_OUTPUT.members["enforcementMode"], - self.enforcement_mode, - ) - serializer.write_struct( - _SCHEMA_CREATE_POLICY_OUTPUT.members["definition"], self.definition - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_POLICY_OUTPUT.members["description"], self.description - ) - - _serialize_policy_status_reasons( - serializer, - _SCHEMA_CREATE_POLICY_OUTPUT.members["statusReasons"], - self.status_reasons, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_id"] = de.read_string( - _SCHEMA_CREATE_POLICY_OUTPUT.members["policyId"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_POLICY_OUTPUT.members["name"] - ) - - case 2: - kwargs["policy_engine_id"] = de.read_string( - _SCHEMA_CREATE_POLICY_OUTPUT.members["policyEngineId"] - ) - - case 3: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_CREATE_POLICY_OUTPUT.members["createdAt"] - ) - - case 4: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_CREATE_POLICY_OUTPUT.members["updatedAt"] - ) - - case 5: - kwargs["policy_arn"] = de.read_string( - _SCHEMA_CREATE_POLICY_OUTPUT.members["policyArn"] - ) - - case 6: - kwargs["status"] = PolicyStatus( - de.read_string(_SCHEMA_CREATE_POLICY_OUTPUT.members["status"]) - ) - - case 7: - kwargs["enforcement_mode"] = EnforcementMode( - de.read_string( - _SCHEMA_CREATE_POLICY_OUTPUT.members["enforcementMode"] - ) - ) - - case 8: - kwargs["definition"] = _PolicyDefinitionDeserializer().deserialize( - de - ) - - case 9: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_POLICY_OUTPUT.members["description"] - ) - - case 10: - kwargs["status_reasons"] = _deserialize_policy_status_reasons( - de, _SCHEMA_CREATE_POLICY_OUTPUT.members["statusReasons"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_POLICY_OUTPUT, consumer=_consumer) - if "policy_id" not in kwargs: - kwargs["policy_id"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "policy_engine_id" not in kwargs: - kwargs["policy_engine_id"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "policy_arn" not in kwargs: - kwargs["policy_arn"] = "" - if "status" not in kwargs: - kwargs["status"] = PolicyStatus._corrected("") - if "definition" not in kwargs: - kwargs["definition"] = PolicyDefinitionUnknown(tag="") - if "status_reasons" not in kwargs: - kwargs["status_reasons"] = [] - return kwargs - - -CREATE_POLICY = APIOperation( - input=CreatePolicyInput, - output=CreatePolicyOutput, - schema=_SCHEMA_CREATE_POLICY, - input_schema=_SCHEMA_CREATE_POLICY_INPUT, - output_schema=_SCHEMA_CREATE_POLICY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeletePolicyInput: - """Dataclass for DeletePolicyInput structure.""" - - policy_engine_id: str | None = None - """ - The identifier of the policy engine that manages the policy to be - deleted. This ensures the policy is deleted from the correct policy - engine context. - """ - - policy_id: str | None = None - """ - The unique identifier of the policy to be deleted. This must be a valid - policy ID that exists within the specified policy engine. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_POLICY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.policy_engine_id is not None: - serializer.write_string( - _SCHEMA_DELETE_POLICY_INPUT.members["policyEngineId"], - self.policy_engine_id, - ) - - if self.policy_id is not None: - serializer.write_string( - _SCHEMA_DELETE_POLICY_INPUT.members["policyId"], self.policy_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_engine_id"] = de.read_string( - _SCHEMA_DELETE_POLICY_INPUT.members["policyEngineId"] - ) - - case 1: - kwargs["policy_id"] = de.read_string( - _SCHEMA_DELETE_POLICY_INPUT.members["policyId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_POLICY_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeletePolicyOutput: - """Dataclass for DeletePolicyOutput structure.""" - - policy_id: str - """ - The unique identifier of the policy being deleted. This confirms which - policy the deletion operation targets. - """ - - name: str - """ - The customer-assigned name of the deleted policy. This confirms which - policy was successfully removed from the system and matches the name - that was originally assigned during policy creation. - """ - - policy_engine_id: str - """ - The identifier of the policy engine from which the policy was deleted. - This confirms the policy engine context for the deletion operation. - """ - - created_at: datetime - """The timestamp when the deleted policy was originally created.""" - - updated_at: datetime - """ - The timestamp when the deleted policy was last modified before deletion. - This tracks the final state of the policy before it was removed from the - system. - """ - - policy_arn: str - """ - The Amazon Resource Name (ARN) of the deleted policy. This globally - unique identifier confirms which policy resource was successfully - removed. - """ - - status: str - """ - The status of the policy deletion operation. This provides information - about any issues that occurred during the deletion process. - """ - - definition: PolicyDefinition - """ - Represents the definition structure for policies within the AgentCore - Policy system. This structure encapsulates different policy formats and - languages that can be used to define access control rules. - """ - - status_reasons: list[str] - """ - Additional information about the deletion status. This provides details - about the deletion process or any issues that may have occurred. - """ - - enforcement_mode: str = EnforcementMode("ACTIVE") - """The enforcement mode of the deleted policy.""" - - description: str | None = field(repr=False, default=None) - """The human-readable description of the deleted policy.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_POLICY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DELETE_POLICY_OUTPUT.members["policyId"], self.policy_id - ) - serializer.write_string(_SCHEMA_DELETE_POLICY_OUTPUT.members["name"], self.name) - serializer.write_string( - _SCHEMA_DELETE_POLICY_OUTPUT.members["policyEngineId"], - self.policy_engine_id, - ) - serializer.write_timestamp( - _SCHEMA_DELETE_POLICY_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_DELETE_POLICY_OUTPUT.members["updatedAt"], self.updated_at - ) - serializer.write_string( - _SCHEMA_DELETE_POLICY_OUTPUT.members["policyArn"], self.policy_arn - ) - serializer.write_string( - _SCHEMA_DELETE_POLICY_OUTPUT.members["status"], self.status - ) - serializer.write_string( - _SCHEMA_DELETE_POLICY_OUTPUT.members["enforcementMode"], - self.enforcement_mode, - ) - serializer.write_struct( - _SCHEMA_DELETE_POLICY_OUTPUT.members["definition"], self.definition - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_DELETE_POLICY_OUTPUT.members["description"], self.description - ) - - _serialize_policy_status_reasons( - serializer, - _SCHEMA_DELETE_POLICY_OUTPUT.members["statusReasons"], - self.status_reasons, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_id"] = de.read_string( - _SCHEMA_DELETE_POLICY_OUTPUT.members["policyId"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_DELETE_POLICY_OUTPUT.members["name"] - ) - - case 2: - kwargs["policy_engine_id"] = de.read_string( - _SCHEMA_DELETE_POLICY_OUTPUT.members["policyEngineId"] - ) - - case 3: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_DELETE_POLICY_OUTPUT.members["createdAt"] - ) - - case 4: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_DELETE_POLICY_OUTPUT.members["updatedAt"] - ) - - case 5: - kwargs["policy_arn"] = de.read_string( - _SCHEMA_DELETE_POLICY_OUTPUT.members["policyArn"] - ) - - case 6: - kwargs["status"] = PolicyStatus( - de.read_string(_SCHEMA_DELETE_POLICY_OUTPUT.members["status"]) - ) - - case 7: - kwargs["enforcement_mode"] = EnforcementMode( - de.read_string( - _SCHEMA_DELETE_POLICY_OUTPUT.members["enforcementMode"] - ) - ) - - case 8: - kwargs["definition"] = _PolicyDefinitionDeserializer().deserialize( - de - ) - - case 9: - kwargs["description"] = de.read_string( - _SCHEMA_DELETE_POLICY_OUTPUT.members["description"] - ) - - case 10: - kwargs["status_reasons"] = _deserialize_policy_status_reasons( - de, _SCHEMA_DELETE_POLICY_OUTPUT.members["statusReasons"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_POLICY_OUTPUT, consumer=_consumer) - if "policy_id" not in kwargs: - kwargs["policy_id"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "policy_engine_id" not in kwargs: - kwargs["policy_engine_id"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "policy_arn" not in kwargs: - kwargs["policy_arn"] = "" - if "status" not in kwargs: - kwargs["status"] = PolicyStatus._corrected("") - if "definition" not in kwargs: - kwargs["definition"] = PolicyDefinitionUnknown(tag="") - if "status_reasons" not in kwargs: - kwargs["status_reasons"] = [] - return kwargs - - -DELETE_POLICY = APIOperation( - input=DeletePolicyInput, - output=DeletePolicyOutput, - schema=_SCHEMA_DELETE_POLICY, - input_schema=_SCHEMA_DELETE_POLICY_INPUT, - output_schema=_SCHEMA_DELETE_POLICY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetPolicyInput: - """Dataclass for GetPolicyInput structure.""" - - policy_engine_id: str | None = None - """ - The identifier of the policy engine that manages the policy to be - retrieved. - """ - - policy_id: str | None = None - """ - The unique identifier of the policy to be retrieved. This must be a - valid policy ID that exists within the specified policy engine. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_POLICY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.policy_engine_id is not None: - serializer.write_string( - _SCHEMA_GET_POLICY_INPUT.members["policyEngineId"], - self.policy_engine_id, - ) - - if self.policy_id is not None: - serializer.write_string( - _SCHEMA_GET_POLICY_INPUT.members["policyId"], self.policy_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_engine_id"] = de.read_string( - _SCHEMA_GET_POLICY_INPUT.members["policyEngineId"] - ) - - case 1: - kwargs["policy_id"] = de.read_string( - _SCHEMA_GET_POLICY_INPUT.members["policyId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_POLICY_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetPolicyOutput: - """Dataclass for GetPolicyOutput structure.""" - - policy_id: str - """ - The unique identifier of the retrieved policy. This matches the policy - ID provided in the request and serves as the system identifier for the - policy. - """ - - name: str - """ - The customer-assigned name of the policy. This is the human-readable - identifier that was specified when the policy was created. - """ - - policy_engine_id: str - """ - The identifier of the policy engine that manages this policy. This - confirms the policy engine context for the retrieved policy. - """ - - created_at: datetime - """The timestamp when the policy was originally created.""" - - updated_at: datetime - """ - The timestamp when the policy was last modified. This tracks the most - recent changes to the policy configuration. - """ - - policy_arn: str - """ - The Amazon Resource Name (ARN) of the policy. This globally unique - identifier can be used for cross-service references and IAM policy - statements. - """ - - status: str - """The current status of the policy.""" - - definition: PolicyDefinition - """ - The Cedar or Dogwood policy statement that defines the access control - rules. This contains the actual policy logic used for agent behavior - control and access decisions. - """ - - status_reasons: list[str] - """ - Additional information about the policy status. This provides details - about any failures or the current state of the policy. - """ - - enforcement_mode: str = EnforcementMode("ACTIVE") - """The current enforcement mode of the policy.""" - - description: str | None = field(repr=False, default=None) - """ - The human-readable description of the policy's purpose and - functionality. This helps administrators understand and manage the - policy. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_POLICY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_POLICY_OUTPUT.members["policyId"], self.policy_id - ) - serializer.write_string(_SCHEMA_GET_POLICY_OUTPUT.members["name"], self.name) - serializer.write_string( - _SCHEMA_GET_POLICY_OUTPUT.members["policyEngineId"], self.policy_engine_id - ) - serializer.write_timestamp( - _SCHEMA_GET_POLICY_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_GET_POLICY_OUTPUT.members["updatedAt"], self.updated_at - ) - serializer.write_string( - _SCHEMA_GET_POLICY_OUTPUT.members["policyArn"], self.policy_arn - ) - serializer.write_string( - _SCHEMA_GET_POLICY_OUTPUT.members["status"], self.status - ) - serializer.write_string( - _SCHEMA_GET_POLICY_OUTPUT.members["enforcementMode"], self.enforcement_mode - ) - serializer.write_struct( - _SCHEMA_GET_POLICY_OUTPUT.members["definition"], self.definition - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_POLICY_OUTPUT.members["description"], self.description - ) - - _serialize_policy_status_reasons( - serializer, - _SCHEMA_GET_POLICY_OUTPUT.members["statusReasons"], - self.status_reasons, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_id"] = de.read_string( - _SCHEMA_GET_POLICY_OUTPUT.members["policyId"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_GET_POLICY_OUTPUT.members["name"] - ) - - case 2: - kwargs["policy_engine_id"] = de.read_string( - _SCHEMA_GET_POLICY_OUTPUT.members["policyEngineId"] - ) - - case 3: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_POLICY_OUTPUT.members["createdAt"] - ) - - case 4: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_GET_POLICY_OUTPUT.members["updatedAt"] - ) - - case 5: - kwargs["policy_arn"] = de.read_string( - _SCHEMA_GET_POLICY_OUTPUT.members["policyArn"] - ) - - case 6: - kwargs["status"] = PolicyStatus( - de.read_string(_SCHEMA_GET_POLICY_OUTPUT.members["status"]) - ) - - case 7: - kwargs["enforcement_mode"] = EnforcementMode( - de.read_string( - _SCHEMA_GET_POLICY_OUTPUT.members["enforcementMode"] - ) - ) - - case 8: - kwargs["definition"] = _PolicyDefinitionDeserializer().deserialize( - de - ) - - case 9: - kwargs["description"] = de.read_string( - _SCHEMA_GET_POLICY_OUTPUT.members["description"] - ) - - case 10: - kwargs["status_reasons"] = _deserialize_policy_status_reasons( - de, _SCHEMA_GET_POLICY_OUTPUT.members["statusReasons"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_POLICY_OUTPUT, consumer=_consumer) - if "policy_id" not in kwargs: - kwargs["policy_id"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "policy_engine_id" not in kwargs: - kwargs["policy_engine_id"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "policy_arn" not in kwargs: - kwargs["policy_arn"] = "" - if "status" not in kwargs: - kwargs["status"] = PolicyStatus._corrected("") - if "definition" not in kwargs: - kwargs["definition"] = PolicyDefinitionUnknown(tag="") - if "status_reasons" not in kwargs: - kwargs["status_reasons"] = [] - return kwargs - - -GET_POLICY = APIOperation( - input=GetPolicyInput, - output=GetPolicyOutput, - schema=_SCHEMA_GET_POLICY, - input_schema=_SCHEMA_GET_POLICY_INPUT, - output_schema=_SCHEMA_GET_POLICY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetPolicySummaryInput: - """Dataclass for GetPolicySummaryInput structure.""" - - policy_engine_id: str | None = None - """ - The identifier of the policy engine that manages the policy to retrieve - the summary for. - """ - - policy_id: str | None = None - """ - The unique identifier of the policy to retrieve the summary for. This - must be a valid policy ID that exists within the specified policy - engine. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_POLICY_SUMMARY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.policy_engine_id is not None: - serializer.write_string( - _SCHEMA_GET_POLICY_SUMMARY_INPUT.members["policyEngineId"], - self.policy_engine_id, - ) - - if self.policy_id is not None: - serializer.write_string( - _SCHEMA_GET_POLICY_SUMMARY_INPUT.members["policyId"], self.policy_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_engine_id"] = de.read_string( - _SCHEMA_GET_POLICY_SUMMARY_INPUT.members["policyEngineId"] - ) - - case 1: - kwargs["policy_id"] = de.read_string( - _SCHEMA_GET_POLICY_SUMMARY_INPUT.members["policyId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_POLICY_SUMMARY_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetPolicySummaryOutput: - """Dataclass for GetPolicySummaryOutput structure.""" - - policy_id: str - """The unique identifier of the policy.""" - - name: str - """The customer-assigned name of the policy.""" - - policy_engine_id: str - """The identifier of the policy engine that manages this policy.""" - - created_at: datetime - """The timestamp when the policy was originally created.""" - - updated_at: datetime - """The timestamp when the policy was last modified.""" - - policy_arn: str - """The Amazon Resource Name (ARN) of the policy.""" - - status: str - """The current status of the policy.""" - - enforcement_mode: str = EnforcementMode("ACTIVE") - """The current enforcement mode of the policy.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_POLICY_SUMMARY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_POLICY_SUMMARY_OUTPUT.members["policyId"], self.policy_id - ) - serializer.write_string( - _SCHEMA_GET_POLICY_SUMMARY_OUTPUT.members["name"], self.name - ) - serializer.write_string( - _SCHEMA_GET_POLICY_SUMMARY_OUTPUT.members["policyEngineId"], - self.policy_engine_id, - ) - serializer.write_timestamp( - _SCHEMA_GET_POLICY_SUMMARY_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_GET_POLICY_SUMMARY_OUTPUT.members["updatedAt"], self.updated_at - ) - serializer.write_string( - _SCHEMA_GET_POLICY_SUMMARY_OUTPUT.members["policyArn"], self.policy_arn - ) - serializer.write_string( - _SCHEMA_GET_POLICY_SUMMARY_OUTPUT.members["status"], self.status - ) - serializer.write_string( - _SCHEMA_GET_POLICY_SUMMARY_OUTPUT.members["enforcementMode"], - self.enforcement_mode, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_id"] = de.read_string( - _SCHEMA_GET_POLICY_SUMMARY_OUTPUT.members["policyId"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_GET_POLICY_SUMMARY_OUTPUT.members["name"] - ) - - case 2: - kwargs["policy_engine_id"] = de.read_string( - _SCHEMA_GET_POLICY_SUMMARY_OUTPUT.members["policyEngineId"] - ) - - case 3: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_POLICY_SUMMARY_OUTPUT.members["createdAt"] - ) - - case 4: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_GET_POLICY_SUMMARY_OUTPUT.members["updatedAt"] - ) - - case 5: - kwargs["policy_arn"] = de.read_string( - _SCHEMA_GET_POLICY_SUMMARY_OUTPUT.members["policyArn"] - ) - - case 6: - kwargs["status"] = PolicyStatus( - de.read_string( - _SCHEMA_GET_POLICY_SUMMARY_OUTPUT.members["status"] - ) - ) - - case 7: - kwargs["enforcement_mode"] = EnforcementMode( - de.read_string( - _SCHEMA_GET_POLICY_SUMMARY_OUTPUT.members["enforcementMode"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_POLICY_SUMMARY_OUTPUT, consumer=_consumer) - if "policy_id" not in kwargs: - kwargs["policy_id"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "policy_engine_id" not in kwargs: - kwargs["policy_engine_id"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "policy_arn" not in kwargs: - kwargs["policy_arn"] = "" - if "status" not in kwargs: - kwargs["status"] = PolicyStatus._corrected("") - return kwargs - - -GET_POLICY_SUMMARY = APIOperation( - input=GetPolicySummaryInput, - output=GetPolicySummaryOutput, - schema=_SCHEMA_GET_POLICY_SUMMARY, - input_schema=_SCHEMA_GET_POLICY_SUMMARY_INPUT, - output_schema=_SCHEMA_GET_POLICY_SUMMARY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListPoliciesInput: - """Dataclass for ListPoliciesInput structure.""" - - next_token: str | None = None - """ - A pagination token returned from a previous - [ListPolicies](https://docs.aws.amazon.com/bedrock-agentcore-control/latest/APIReference/API_ListPolicies.html) - call. Use this token to retrieve the next page of results when the - response is paginated. - """ - - max_results: int | None = None - """ - The maximum number of policies to return in a single response. If not - specified, the default is 10 policies per page, with a maximum of 100 - per page. - """ - - policy_engine_id: str | None = None - """The identifier of the policy engine whose policies to retrieve.""" - - target_resource_scope: str | None = None - """ - Optional filter to list policies that apply to a specific resource scope - or resource type. This helps narrow down policy results to those - relevant for particular Amazon Web Services resources, agent tools, or - operational contexts within the policy engine ecosystem. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_POLICIES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_POLICIES_INPUT.members["nextToken"], self.next_token - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_POLICIES_INPUT.members["maxResults"], self.max_results - ) - - if self.policy_engine_id is not None: - serializer.write_string( - _SCHEMA_LIST_POLICIES_INPUT.members["policyEngineId"], - self.policy_engine_id, - ) - - if self.target_resource_scope is not None: - serializer.write_string( - _SCHEMA_LIST_POLICIES_INPUT.members["targetResourceScope"], - self.target_resource_scope, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_POLICIES_INPUT.members["nextToken"] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_POLICIES_INPUT.members["maxResults"] - ) - - case 2: - kwargs["policy_engine_id"] = de.read_string( - _SCHEMA_LIST_POLICIES_INPUT.members["policyEngineId"] - ) - - case 3: - kwargs["target_resource_scope"] = de.read_string( - _SCHEMA_LIST_POLICIES_INPUT.members["targetResourceScope"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_POLICIES_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Policy: - """ - Represents a complete policy resource within the AgentCore Policy - system. Policies are ARN-able resources that contain Cedar or Dogwood - policy statements and associated metadata for controlling agent behavior - and access decisions. Each policy belongs to a policy engine and defines - fine-grained authorization rules that are evaluated in real-time as - agents interact with tools through Gateway. Policies use Cedar or - Dogwood to specify who (principals based on OAuth claims like username, - role, or scope) can perform what actions (tool calls) on which resources - (Gateways), with optional conditions for attribute-based access control. - Multiple policies can apply to a single request, with forbid-wins - semantics ensuring that security restrictions are never accidentally - overridden. - """ - - policy_id: str - """ - The unique identifier for the policy. This system-generated identifier - consists of the user name plus a 10-character generated suffix and - serves as the primary key for policy operations. - """ - - name: str - """ - The customer-assigned immutable name for the policy. This human-readable - identifier must be unique within the account and cannot exceed 48 - characters. - """ - - policy_engine_id: str - """ - The identifier of the policy engine that manages this policy. This - establishes the policy engine context for policy evaluation and - management. - """ - - created_at: datetime - """ - The timestamp when the policy was originally created. This is - automatically set by the service and used for auditing and lifecycle - management. - """ - - updated_at: datetime - """ - The timestamp when the policy was last modified. This tracks the most - recent changes to the policy configuration or metadata. - """ - - policy_arn: str - """ - The Amazon Resource Name (ARN) of the policy. This globally unique - identifier can be used for cross-service references and IAM policy - statements. - """ - - status: str - """The current status of the policy.""" - - definition: PolicyDefinition - """ - The Cedar or Dogwood policy statement that defines the access control - rules. This contains the actual policy logic used for agent behavior - control and access decisions. - """ - - status_reasons: list[str] - """ - Additional information about the policy status. This provides details - about any failures or the current state of the policy lifecycle. - """ - - enforcement_mode: str = EnforcementMode("ACTIVE") - """The current enforcement mode of the policy.""" - - description: str | None = field(repr=False, default=None) - """ - A human-readable description of the policy's purpose and functionality. - Limited to 4,096 characters, this helps administrators understand and - manage the policy. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_POLICY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_POLICY.members["policyId"], self.policy_id) - serializer.write_string(_SCHEMA_POLICY.members["name"], self.name) - serializer.write_string( - _SCHEMA_POLICY.members["policyEngineId"], self.policy_engine_id - ) - serializer.write_timestamp(_SCHEMA_POLICY.members["createdAt"], self.created_at) - serializer.write_timestamp(_SCHEMA_POLICY.members["updatedAt"], self.updated_at) - serializer.write_string(_SCHEMA_POLICY.members["policyArn"], self.policy_arn) - serializer.write_string(_SCHEMA_POLICY.members["status"], self.status) - serializer.write_string( - _SCHEMA_POLICY.members["enforcementMode"], self.enforcement_mode - ) - serializer.write_struct(_SCHEMA_POLICY.members["definition"], self.definition) - if self.description is not None: - serializer.write_string( - _SCHEMA_POLICY.members["description"], self.description - ) - - _serialize_policy_status_reasons( - serializer, _SCHEMA_POLICY.members["statusReasons"], self.status_reasons - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_id"] = de.read_string( - _SCHEMA_POLICY.members["policyId"] - ) - - case 1: - kwargs["name"] = de.read_string(_SCHEMA_POLICY.members["name"]) - - case 2: - kwargs["policy_engine_id"] = de.read_string( - _SCHEMA_POLICY.members["policyEngineId"] - ) - - case 3: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_POLICY.members["createdAt"] - ) - - case 4: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_POLICY.members["updatedAt"] - ) - - case 5: - kwargs["policy_arn"] = de.read_string( - _SCHEMA_POLICY.members["policyArn"] - ) - - case 6: - kwargs["status"] = PolicyStatus( - de.read_string(_SCHEMA_POLICY.members["status"]) - ) - - case 7: - kwargs["enforcement_mode"] = EnforcementMode( - de.read_string(_SCHEMA_POLICY.members["enforcementMode"]) - ) - - case 8: - kwargs["definition"] = _PolicyDefinitionDeserializer().deserialize( - de - ) - - case 9: - kwargs["description"] = de.read_string( - _SCHEMA_POLICY.members["description"] - ) - - case 10: - kwargs["status_reasons"] = _deserialize_policy_status_reasons( - de, _SCHEMA_POLICY.members["statusReasons"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_POLICY, consumer=_consumer) - if "policy_id" not in kwargs: - kwargs["policy_id"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "policy_engine_id" not in kwargs: - kwargs["policy_engine_id"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "policy_arn" not in kwargs: - kwargs["policy_arn"] = "" - if "status" not in kwargs: - kwargs["status"] = PolicyStatus._corrected("") - if "definition" not in kwargs: - kwargs["definition"] = PolicyDefinitionUnknown(tag="") - if "status_reasons" not in kwargs: - kwargs["status_reasons"] = [] - return kwargs - - -def _serialize_policies( - serializer: ShapeSerializer, schema: Schema, value: list[Policy] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_policies( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Policy]: - result: list[Policy] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Policy.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListPoliciesOutput: - """Dataclass for ListPoliciesOutput structure.""" - - policies: list[Policy] - """ - An array of policy objects that match the specified criteria. Each - policy object contains the policy metadata, status, and key identifiers - for further operations. - """ - - next_token: str | None = None - """ - A pagination token that can be used in subsequent ListPolicies calls to - retrieve additional results. This token is only present when there are - more results available. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_POLICIES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_policies( - serializer, _SCHEMA_LIST_POLICIES_OUTPUT.members["policies"], self.policies - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_POLICIES_OUTPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policies"] = _deserialize_policies( - de, _SCHEMA_LIST_POLICIES_OUTPUT.members["policies"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_POLICIES_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_POLICIES_OUTPUT, consumer=_consumer) - if "policies" not in kwargs: - kwargs["policies"] = [] - return kwargs - - -LIST_POLICIES = APIOperation( - input=ListPoliciesInput, - output=ListPoliciesOutput, - schema=_SCHEMA_LIST_POLICIES, - input_schema=_SCHEMA_LIST_POLICIES_INPUT, - output_schema=_SCHEMA_LIST_POLICIES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListPolicySummariesInput: - """Dataclass for ListPolicySummariesInput structure.""" - - next_token: str | None = None - """ - A pagination token returned from a previous - [ListPolicySummaries](https://docs.aws.amazon.com/bedrock-agentcore-control/latest/APIReference/API_ListPolicySummaries.html) - call. Use this token to retrieve the next page of results when the - response is paginated. - """ - - max_results: int | None = None - """The maximum number of policy summaries to return in a single response.""" - - policy_engine_id: str | None = None - """The identifier of the policy engine whose policy summaries to retrieve.""" - - target_resource_scope: str | None = None - """ - Optional filter to list policy summaries that apply to a specific - resource scope or resource type. This helps narrow down results to those - relevant for particular Amazon Web Services resources, agent tools, or - operational contexts within the policy engine ecosystem. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_POLICY_SUMMARIES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_POLICY_SUMMARIES_INPUT.members["nextToken"], - self.next_token, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_POLICY_SUMMARIES_INPUT.members["maxResults"], - self.max_results, - ) - - if self.policy_engine_id is not None: - serializer.write_string( - _SCHEMA_LIST_POLICY_SUMMARIES_INPUT.members["policyEngineId"], - self.policy_engine_id, - ) - - if self.target_resource_scope is not None: - serializer.write_string( - _SCHEMA_LIST_POLICY_SUMMARIES_INPUT.members["targetResourceScope"], - self.target_resource_scope, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_POLICY_SUMMARIES_INPUT.members["nextToken"] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_POLICY_SUMMARIES_INPUT.members["maxResults"] - ) - - case 2: - kwargs["policy_engine_id"] = de.read_string( - _SCHEMA_LIST_POLICY_SUMMARIES_INPUT.members["policyEngineId"] - ) - - case 3: - kwargs["target_resource_scope"] = de.read_string( - _SCHEMA_LIST_POLICY_SUMMARIES_INPUT.members[ - "targetResourceScope" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_POLICY_SUMMARIES_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class PolicySummary: - """ - Represents a metadata-only summary of a policy resource. This structure - contains resource identifiers, status, and timestamps without - customer-encrypted fields such as definition, description, or status - reasons. Policy summaries are returned by operations that do not require - access to the customer's KMS key. - """ - - policy_id: str - """The unique identifier for the policy.""" - - name: str - """The customer-assigned name of the policy.""" - - policy_engine_id: str - """The identifier of the policy engine that manages this policy.""" - - created_at: datetime - """The timestamp when the policy was originally created.""" - - updated_at: datetime - """The timestamp when the policy was last modified.""" - - policy_arn: str - """The Amazon Resource Name (ARN) of the policy.""" - - status: str - """The current status of the policy.""" - - enforcement_mode: str = EnforcementMode("ACTIVE") - """The current enforcement mode of the policy.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_POLICY_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_POLICY_SUMMARY.members["policyId"], self.policy_id - ) - serializer.write_string(_SCHEMA_POLICY_SUMMARY.members["name"], self.name) - serializer.write_string( - _SCHEMA_POLICY_SUMMARY.members["policyEngineId"], self.policy_engine_id - ) - serializer.write_timestamp( - _SCHEMA_POLICY_SUMMARY.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_POLICY_SUMMARY.members["updatedAt"], self.updated_at - ) - serializer.write_string( - _SCHEMA_POLICY_SUMMARY.members["policyArn"], self.policy_arn - ) - serializer.write_string(_SCHEMA_POLICY_SUMMARY.members["status"], self.status) - serializer.write_string( - _SCHEMA_POLICY_SUMMARY.members["enforcementMode"], self.enforcement_mode - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_id"] = de.read_string( - _SCHEMA_POLICY_SUMMARY.members["policyId"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_POLICY_SUMMARY.members["name"] - ) - - case 2: - kwargs["policy_engine_id"] = de.read_string( - _SCHEMA_POLICY_SUMMARY.members["policyEngineId"] - ) - - case 3: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_POLICY_SUMMARY.members["createdAt"] - ) - - case 4: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_POLICY_SUMMARY.members["updatedAt"] - ) - - case 5: - kwargs["policy_arn"] = de.read_string( - _SCHEMA_POLICY_SUMMARY.members["policyArn"] - ) - - case 6: - kwargs["status"] = PolicyStatus( - de.read_string(_SCHEMA_POLICY_SUMMARY.members["status"]) - ) - - case 7: - kwargs["enforcement_mode"] = EnforcementMode( - de.read_string( - _SCHEMA_POLICY_SUMMARY.members["enforcementMode"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_POLICY_SUMMARY, consumer=_consumer) - if "policy_id" not in kwargs: - kwargs["policy_id"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "policy_engine_id" not in kwargs: - kwargs["policy_engine_id"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "policy_arn" not in kwargs: - kwargs["policy_arn"] = "" - if "status" not in kwargs: - kwargs["status"] = PolicyStatus._corrected("") - return kwargs - - -def _serialize_policy_summary_list( - serializer: ShapeSerializer, schema: Schema, value: list[PolicySummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_policy_summary_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[PolicySummary]: - result: list[PolicySummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(PolicySummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListPolicySummariesOutput: - """Dataclass for ListPolicySummariesOutput structure.""" - - policies: list[PolicySummary] - """ - An array of policy summary objects that match the specified criteria. - Each summary contains resource identifiers, status, and timestamps - without customer-encrypted content. - """ - - next_token: str | None = None - """ - A pagination token that can be used in subsequent - [ListPolicySummaries](https://docs.aws.amazon.com/bedrock-agentcore-control/latest/APIReference/API_ListPolicySummaries.html) - calls to retrieve additional results. This token is only present when - there are more results available. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_POLICY_SUMMARIES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_policy_summary_list( - serializer, - _SCHEMA_LIST_POLICY_SUMMARIES_OUTPUT.members["policies"], - self.policies, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_POLICY_SUMMARIES_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policies"] = _deserialize_policy_summary_list( - de, _SCHEMA_LIST_POLICY_SUMMARIES_OUTPUT.members["policies"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_POLICY_SUMMARIES_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_POLICY_SUMMARIES_OUTPUT, consumer=_consumer - ) - if "policies" not in kwargs: - kwargs["policies"] = [] - return kwargs - - -LIST_POLICY_SUMMARIES = APIOperation( - input=ListPolicySummariesInput, - output=ListPolicySummariesOutput, - schema=_SCHEMA_LIST_POLICY_SUMMARIES, - input_schema=_SCHEMA_LIST_POLICY_SUMMARIES_INPUT, - output_schema=_SCHEMA_LIST_POLICY_SUMMARIES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdatePolicyInput: - """Dataclass for UpdatePolicyInput structure.""" - - policy_engine_id: str | None = None - """ - The identifier of the policy engine that manages the policy to be - updated. This ensures the policy is updated within the correct policy - engine context. - """ - - policy_id: str | None = None - """ - The unique identifier of the policy to be updated. This must be a valid - policy ID that exists within the specified policy engine. - """ - - description: UpdatedDescription | None = None - """ - The new human-readable description for the policy. This optional field - allows updating the policy's documentation while keeping the same - policy logic. - """ - - definition: PolicyDefinition | None = None - """ - The new Cedar or Dogwood policy statement that defines the access - control rules. This replaces the existing policy definition with new - logic while maintaining the policy's identity. - """ - - validation_mode: str = PolicyValidationMode("FAIL_ON_ANY_FINDINGS") - """ - The validation mode for the policy update. Determines how Cedar analyzer - validation results are handled during policy updates. - FAIL_ON_ANY_FINDINGS runs the Cedar analyzer and fails the update if - validation issues are detected, ensuring the policy conforms to the - Cedar schema and tool context. IGNORE_ALL_FINDINGS runs the Cedar - analyzer but allows updates despite validation warnings. Use - FAIL_ON_ANY_FINDINGS to ensure policy correctness during updates, - especially when modifying policy logic or conditions. - """ - - enforcement_mode: str | None = None - """ - The enforcement mode for the policy. Run this policy in `LOG_ONLY` mode - to collect data on how it affects your application. Once you are - satisfied with the data gathered, switch the policy to `ACTIVE`. If you - omit this field, the policy's existing enforcement mode is unchanged. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_POLICY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.policy_engine_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_POLICY_INPUT.members["policyEngineId"], - self.policy_engine_id, - ) - - if self.policy_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_POLICY_INPUT.members["policyId"], self.policy_id - ) - - if self.description is not None: - serializer.write_struct( - _SCHEMA_UPDATE_POLICY_INPUT.members["description"], self.description - ) - - if self.definition is not None: - serializer.write_struct( - _SCHEMA_UPDATE_POLICY_INPUT.members["definition"], self.definition - ) - - if self.validation_mode is not None: - serializer.write_string( - _SCHEMA_UPDATE_POLICY_INPUT.members["validationMode"], - self.validation_mode, - ) - - if self.enforcement_mode is not None: - serializer.write_string( - _SCHEMA_UPDATE_POLICY_INPUT.members["enforcementMode"], - self.enforcement_mode, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_engine_id"] = de.read_string( - _SCHEMA_UPDATE_POLICY_INPUT.members["policyEngineId"] - ) - - case 1: - kwargs["policy_id"] = de.read_string( - _SCHEMA_UPDATE_POLICY_INPUT.members["policyId"] - ) - - case 2: - kwargs["description"] = UpdatedDescription.deserialize(de) - - case 3: - kwargs["definition"] = _PolicyDefinitionDeserializer().deserialize( - de - ) - - case 4: - kwargs["validation_mode"] = PolicyValidationMode( - de.read_string( - _SCHEMA_UPDATE_POLICY_INPUT.members["validationMode"] - ) - ) - - case 5: - kwargs["enforcement_mode"] = EnforcementMode( - de.read_string( - _SCHEMA_UPDATE_POLICY_INPUT.members["enforcementMode"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_POLICY_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdatePolicyOutput: - """Dataclass for UpdatePolicyOutput structure.""" - - policy_id: str - """The unique identifier of the updated policy.""" - - name: str - """The name of the updated policy.""" - - policy_engine_id: str - """The identifier of the policy engine managing the updated policy.""" - - created_at: datetime - """The original creation timestamp of the policy.""" - - updated_at: datetime - """The timestamp when the policy was last updated.""" - - policy_arn: str - """The ARN of the updated policy.""" - - status: str - """The current status of the updated policy.""" - - definition: PolicyDefinition - """The updated Cedar or Dogwood policy statement.""" - - status_reasons: list[str] - """Additional information about the update status.""" - - enforcement_mode: str = EnforcementMode("ACTIVE") - """The current enforcement mode of the updated policy.""" - - description: str | None = field(repr=False, default=None) - """The updated description of the policy.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_POLICY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_UPDATE_POLICY_OUTPUT.members["policyId"], self.policy_id - ) - serializer.write_string(_SCHEMA_UPDATE_POLICY_OUTPUT.members["name"], self.name) - serializer.write_string( - _SCHEMA_UPDATE_POLICY_OUTPUT.members["policyEngineId"], - self.policy_engine_id, - ) - serializer.write_timestamp( - _SCHEMA_UPDATE_POLICY_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_UPDATE_POLICY_OUTPUT.members["updatedAt"], self.updated_at - ) - serializer.write_string( - _SCHEMA_UPDATE_POLICY_OUTPUT.members["policyArn"], self.policy_arn - ) - serializer.write_string( - _SCHEMA_UPDATE_POLICY_OUTPUT.members["status"], self.status - ) - serializer.write_string( - _SCHEMA_UPDATE_POLICY_OUTPUT.members["enforcementMode"], - self.enforcement_mode, - ) - serializer.write_struct( - _SCHEMA_UPDATE_POLICY_OUTPUT.members["definition"], self.definition - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_POLICY_OUTPUT.members["description"], self.description - ) - - _serialize_policy_status_reasons( - serializer, - _SCHEMA_UPDATE_POLICY_OUTPUT.members["statusReasons"], - self.status_reasons, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_id"] = de.read_string( - _SCHEMA_UPDATE_POLICY_OUTPUT.members["policyId"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_POLICY_OUTPUT.members["name"] - ) - - case 2: - kwargs["policy_engine_id"] = de.read_string( - _SCHEMA_UPDATE_POLICY_OUTPUT.members["policyEngineId"] - ) - - case 3: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_UPDATE_POLICY_OUTPUT.members["createdAt"] - ) - - case 4: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_UPDATE_POLICY_OUTPUT.members["updatedAt"] - ) - - case 5: - kwargs["policy_arn"] = de.read_string( - _SCHEMA_UPDATE_POLICY_OUTPUT.members["policyArn"] - ) - - case 6: - kwargs["status"] = PolicyStatus( - de.read_string(_SCHEMA_UPDATE_POLICY_OUTPUT.members["status"]) - ) - - case 7: - kwargs["enforcement_mode"] = EnforcementMode( - de.read_string( - _SCHEMA_UPDATE_POLICY_OUTPUT.members["enforcementMode"] - ) - ) - - case 8: - kwargs["definition"] = _PolicyDefinitionDeserializer().deserialize( - de - ) - - case 9: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_POLICY_OUTPUT.members["description"] - ) - - case 10: - kwargs["status_reasons"] = _deserialize_policy_status_reasons( - de, _SCHEMA_UPDATE_POLICY_OUTPUT.members["statusReasons"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_POLICY_OUTPUT, consumer=_consumer) - if "policy_id" not in kwargs: - kwargs["policy_id"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "policy_engine_id" not in kwargs: - kwargs["policy_engine_id"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "policy_arn" not in kwargs: - kwargs["policy_arn"] = "" - if "status" not in kwargs: - kwargs["status"] = PolicyStatus._corrected("") - if "definition" not in kwargs: - kwargs["definition"] = PolicyDefinitionUnknown(tag="") - if "status_reasons" not in kwargs: - kwargs["status_reasons"] = [] - return kwargs - - -UPDATE_POLICY = APIOperation( - input=UpdatePolicyInput, - output=UpdatePolicyOutput, - schema=_SCHEMA_UPDATE_POLICY, - input_schema=_SCHEMA_UPDATE_POLICY_INPUT, - output_schema=_SCHEMA_UPDATE_POLICY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class PutResourcePolicyInput: - """Dataclass for PutResourcePolicyInput structure.""" - - resource_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the resource for which to create or - update the resource policy. - """ - - policy: str | None = None - """The resource policy to create or update.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_RESOURCE_POLICY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_PUT_RESOURCE_POLICY_INPUT.members["resourceArn"], - self.resource_arn, - ) - - if self.policy is not None: - serializer.write_string( - _SCHEMA_PUT_RESOURCE_POLICY_INPUT.members["policy"], self.policy - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_PUT_RESOURCE_POLICY_INPUT.members["resourceArn"] - ) - - case 1: - kwargs["policy"] = de.read_string( - _SCHEMA_PUT_RESOURCE_POLICY_INPUT.members["policy"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUT_RESOURCE_POLICY_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class PutResourcePolicyOutput: - """Dataclass for PutResourcePolicyOutput structure.""" - - policy: str - """The resource policy that was created or updated.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_RESOURCE_POLICY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_PUT_RESOURCE_POLICY_OUTPUT.members["policy"], self.policy - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy"] = de.read_string( - _SCHEMA_PUT_RESOURCE_POLICY_OUTPUT.members["policy"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUT_RESOURCE_POLICY_OUTPUT, consumer=_consumer) - if "policy" not in kwargs: - kwargs["policy"] = "" - return kwargs - - -PUT_RESOURCE_POLICY = APIOperation( - input=PutResourcePolicyInput, - output=PutResourcePolicyOutput, - schema=_SCHEMA_PUT_RESOURCE_POLICY, - input_schema=_SCHEMA_PUT_RESOURCE_POLICY_INPUT, - output_schema=_SCHEMA_PUT_RESOURCE_POLICY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class CustomDescriptor: - """ - A custom descriptor for a registry record. Use this for resources such - as APIs, Lambda functions, or servers that do not conform to a standard - protocol like MCP or A2A. - """ - - inline_content: str | None = None - """ - The custom descriptor content as a valid JSON document. You can define - any custom schema that describes your resource. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOM_DESCRIPTOR, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.inline_content is not None: - serializer.write_string( - _SCHEMA_CUSTOM_DESCRIPTOR.members["inlineContent"], self.inline_content - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["inline_content"] = de.read_string( - _SCHEMA_CUSTOM_DESCRIPTOR.members["inlineContent"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CUSTOM_DESCRIPTOR, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ServerDefinition: - """ - The server definition for an MCP descriptor. Contains the schema version - and inline content for the MCP server configuration. - """ - - schema_version: str | None = None - """ - The schema version of the server definition based on the MCP protocol - specification. If not specified, the version is auto-detected from the - content. - """ - - inline_content: str | None = None - """ - The JSON content containing the MCP server definition, conforming to the - MCP protocol specification. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SERVER_DEFINITION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.schema_version is not None: - serializer.write_string( - _SCHEMA_SERVER_DEFINITION.members["schemaVersion"], self.schema_version - ) - - if self.inline_content is not None: - serializer.write_string( - _SCHEMA_SERVER_DEFINITION.members["inlineContent"], self.inline_content - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["schema_version"] = de.read_string( - _SCHEMA_SERVER_DEFINITION.members["schemaVersion"] - ) - - case 1: - kwargs["inline_content"] = de.read_string( - _SCHEMA_SERVER_DEFINITION.members["inlineContent"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SERVER_DEFINITION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ToolsDefinition: - """ - The tools definition for an MCP descriptor. Contains the protocol - version and inline content describing the available tools. - """ - - protocol_version: str | None = None - """ - The protocol version of the tools definition based on the MCP protocol - specification. If not specified, the version is auto-detected from the - content. - """ - - inline_content: str | None = None - """ - The JSON content containing the MCP tools definition, conforming to the - MCP protocol specification. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOLS_DEFINITION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.protocol_version is not None: - serializer.write_string( - _SCHEMA_TOOLS_DEFINITION.members["protocolVersion"], - self.protocol_version, - ) - - if self.inline_content is not None: - serializer.write_string( - _SCHEMA_TOOLS_DEFINITION.members["inlineContent"], self.inline_content - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["protocol_version"] = de.read_string( - _SCHEMA_TOOLS_DEFINITION.members["protocolVersion"] - ) - - case 1: - kwargs["inline_content"] = de.read_string( - _SCHEMA_TOOLS_DEFINITION.members["inlineContent"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TOOLS_DEFINITION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class McpDescriptor: - """ - The Model Context Protocol (MCP) descriptor for a registry record. - Contains the server definition and tools definition for an - MCP-compatible server. The schema is validated against the MCP protocol - specification. - """ - - server: ServerDefinition | None = None - """ - The MCP server definition, containing the server configuration and - schema as defined by the MCP protocol specification. - """ - - tools: ToolsDefinition | None = None - """ - The MCP tools definition, containing the tools available on the MCP - server as defined by the MCP protocol specification. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MCP_DESCRIPTOR, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.server is not None: - serializer.write_struct( - _SCHEMA_MCP_DESCRIPTOR.members["server"], self.server - ) - - if self.tools is not None: - serializer.write_struct(_SCHEMA_MCP_DESCRIPTOR.members["tools"], self.tools) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["server"] = ServerDefinition.deserialize(de) - - case 1: - kwargs["tools"] = ToolsDefinition.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MCP_DESCRIPTOR, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Descriptors: - """ - Contains descriptor-type-specific configurations for a registry record. - Only the descriptor matching the record's `descriptorType` should be - populated. - """ - - mcp: McpDescriptor | None = None - """ - The Model Context Protocol (MCP) descriptor configuration. Use this when - the `descriptorType` is `MCP`. - """ - - a2a: A2aDescriptor | None = None - """ - The Agent-to-Agent (A2A) protocol descriptor configuration. Use this - when the `descriptorType` is `A2A`. - """ - - custom: CustomDescriptor | None = None - """ - The custom descriptor configuration. Use this when the `descriptorType` - is `CUSTOM`. - """ - - agent_skills: AgentSkillsDescriptor | None = None - """ - The agent skills descriptor configuration. Use this when the - `descriptorType` is `AGENT_SKILLS`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DESCRIPTORS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.mcp is not None: - serializer.write_struct(_SCHEMA_DESCRIPTORS.members["mcp"], self.mcp) - - if self.a2a is not None: - serializer.write_struct(_SCHEMA_DESCRIPTORS.members["a2a"], self.a2a) - - if self.custom is not None: - serializer.write_struct(_SCHEMA_DESCRIPTORS.members["custom"], self.custom) - - if self.agent_skills is not None: - serializer.write_struct( - _SCHEMA_DESCRIPTORS.members["agentSkills"], self.agent_skills - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["mcp"] = McpDescriptor.deserialize(de) - - case 1: - kwargs["a2a"] = A2aDescriptor.deserialize(de) - - case 2: - kwargs["custom"] = CustomDescriptor.deserialize(de) - - case 3: - kwargs["agent_skills"] = AgentSkillsDescriptor.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DESCRIPTORS, consumer=_consumer) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls() - - -class DescriptorType(UnknownEnumMixin, StrEnum): - MCP = "MCP" - A2_A = "A2A" - CUSTOM = "CUSTOM" - AGENT_SKILLS = "AGENT_SKILLS" - - -@dataclass(kw_only=True) -class RegistryRecordIamCredentialProvider: - """ - IAM credential provider configuration for authenticating with an - external source using SigV4 signing during synchronization. - """ - - role_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the IAM role to assume for SigV4 - signing. - """ - - service: str | None = None - """ - The SigV4 signing service name (for example, `execute-api` or - `bedrock-agentcore`). - """ - - region: str | None = None - """ - The Amazon Web Services region for SigV4 signing (for example, - `us-west-2`). If not specified, the region is extracted from the MCP - server URL hostname, with fallback to the service's own region. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REGISTRY_RECORD_IAM_CREDENTIAL_PROVIDER, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.role_arn is not None: - serializer.write_string( - _SCHEMA_REGISTRY_RECORD_IAM_CREDENTIAL_PROVIDER.members["roleArn"], - self.role_arn, - ) - - if self.service is not None: - serializer.write_string( - _SCHEMA_REGISTRY_RECORD_IAM_CREDENTIAL_PROVIDER.members["service"], - self.service, - ) - - if self.region is not None: - serializer.write_string( - _SCHEMA_REGISTRY_RECORD_IAM_CREDENTIAL_PROVIDER.members["region"], - self.region, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["role_arn"] = de.read_string( - _SCHEMA_REGISTRY_RECORD_IAM_CREDENTIAL_PROVIDER.members[ - "roleArn" - ] - ) - - case 1: - kwargs["service"] = de.read_string( - _SCHEMA_REGISTRY_RECORD_IAM_CREDENTIAL_PROVIDER.members[ - "service" - ] - ) - - case 2: - kwargs["region"] = de.read_string( - _SCHEMA_REGISTRY_RECORD_IAM_CREDENTIAL_PROVIDER.members[ - "region" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_REGISTRY_RECORD_IAM_CREDENTIAL_PROVIDER, consumer=_consumer - ) - return kwargs - - -def _serialize_custom_parameter_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_custom_parameter_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -class RegistryRecordOAuthGrantType(UnknownEnumMixin, StrEnum): - CLIENT_CREDENTIALS = "CLIENT_CREDENTIALS" - - -def _serialize_scope_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_scope_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class RegistryRecordOAuthCredentialProvider: - """ - OAuth credential provider configuration for authenticating with an - external source during synchronization. - """ - - provider_arn: str - """ - The Amazon Resource Name (ARN) of the OAuth credential provider - resource. - """ - - grant_type: str | None = None - """The OAuth grant type. Currently only `CLIENT_CREDENTIALS` is supported.""" - - scopes: list[str] | None = None - """The OAuth scopes to request during authentication.""" - - custom_parameters: dict[str, str] | None = None - """Additional custom parameters for the OAuth flow.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_REGISTRY_RECORD_O_AUTH_CREDENTIAL_PROVIDER, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_REGISTRY_RECORD_O_AUTH_CREDENTIAL_PROVIDER.members["providerArn"], - self.provider_arn, - ) - if self.grant_type is not None: - serializer.write_string( - _SCHEMA_REGISTRY_RECORD_O_AUTH_CREDENTIAL_PROVIDER.members["grantType"], - self.grant_type, - ) - - if self.scopes is not None: - _serialize_scope_list( - serializer, - _SCHEMA_REGISTRY_RECORD_O_AUTH_CREDENTIAL_PROVIDER.members["scopes"], - self.scopes, - ) - - if self.custom_parameters is not None: - _serialize_custom_parameter_map( - serializer, - _SCHEMA_REGISTRY_RECORD_O_AUTH_CREDENTIAL_PROVIDER.members[ - "customParameters" - ], - self.custom_parameters, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["provider_arn"] = de.read_string( - _SCHEMA_REGISTRY_RECORD_O_AUTH_CREDENTIAL_PROVIDER.members[ - "providerArn" - ] - ) - - case 1: - kwargs["grant_type"] = RegistryRecordOAuthGrantType( - de.read_string( - _SCHEMA_REGISTRY_RECORD_O_AUTH_CREDENTIAL_PROVIDER.members[ - "grantType" - ] - ) - ) - - case 2: - kwargs["scopes"] = _deserialize_scope_list( - de, - _SCHEMA_REGISTRY_RECORD_O_AUTH_CREDENTIAL_PROVIDER.members[ - "scopes" - ], - ) - - case 3: - kwargs["custom_parameters"] = _deserialize_custom_parameter_map( - de, - _SCHEMA_REGISTRY_RECORD_O_AUTH_CREDENTIAL_PROVIDER.members[ - "customParameters" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_REGISTRY_RECORD_O_AUTH_CREDENTIAL_PROVIDER, consumer=_consumer - ) - if "provider_arn" not in kwargs: - kwargs["provider_arn"] = "" - return kwargs - - -@dataclass -class RegistryRecordCredentialProviderUnionOauthCredentialProvider: - """ - The OAuth credential provider configuration for authenticating with the - external source. - """ - - value: RegistryRecordOAuthCredentialProvider - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REGISTRY_RECORD_CREDENTIAL_PROVIDER_UNION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_REGISTRY_RECORD_CREDENTIAL_PROVIDER_UNION.members[ - "oauthCredentialProvider" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=RegistryRecordOAuthCredentialProvider.deserialize(deserializer) - ) - - -@dataclass -class RegistryRecordCredentialProviderUnionIamCredentialProvider: - """ - The IAM credential provider configuration for authenticating with the - external source using SigV4 signing. - """ - - value: RegistryRecordIamCredentialProvider - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REGISTRY_RECORD_CREDENTIAL_PROVIDER_UNION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_REGISTRY_RECORD_CREDENTIAL_PROVIDER_UNION.members[ - "iamCredentialProvider" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=RegistryRecordIamCredentialProvider.deserialize(deserializer)) - - -@dataclass -class RegistryRecordCredentialProviderUnionUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -RegistryRecordCredentialProviderUnion = Union[ - RegistryRecordCredentialProviderUnionOauthCredentialProvider - | RegistryRecordCredentialProviderUnionIamCredentialProvider - | RegistryRecordCredentialProviderUnionUnknown -] -""" -Union of supported credential provider types for registry record -synchronization. -""" - - -class _RegistryRecordCredentialProviderUnionDeserializer: - _result: RegistryRecordCredentialProviderUnion | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> RegistryRecordCredentialProviderUnion: - self._result = None - deserializer.read_struct( - _SCHEMA_REGISTRY_RECORD_CREDENTIAL_PROVIDER_UNION, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - RegistryRecordCredentialProviderUnionOauthCredentialProvider.deserialize( - de - ) - ) - - case 1: - self._set_result( - RegistryRecordCredentialProviderUnionIamCredentialProvider.deserialize( - de - ) - ) - - case _: - self._set_result( - RegistryRecordCredentialProviderUnionUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: RegistryRecordCredentialProviderUnion) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class RegistryRecordCredentialProviderType(UnknownEnumMixin, StrEnum): - OAUTH = "OAUTH" - IAM = "IAM" - - -@dataclass(kw_only=True) -class RegistryRecordCredentialProviderConfiguration: - """ - A pairing of a credential provider type with its corresponding provider - details for authenticating with external sources. - """ - - credential_provider_type: str - """ - The type of credential provider. - - - `OAUTH` - OAuth-based authentication. - - - `IAM` - Amazon Web Services IAM-based authentication using SigV4 - signing. - """ - - credential_provider: RegistryRecordCredentialProviderUnion - """ - The credential provider configuration details. The structure depends on - the `credentialProviderType`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_REGISTRY_RECORD_CREDENTIAL_PROVIDER_CONFIGURATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_REGISTRY_RECORD_CREDENTIAL_PROVIDER_CONFIGURATION.members[ - "credentialProviderType" - ], - self.credential_provider_type, - ) - serializer.write_struct( - _SCHEMA_REGISTRY_RECORD_CREDENTIAL_PROVIDER_CONFIGURATION.members[ - "credentialProvider" - ], - self.credential_provider, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["credential_provider_type"] = ( - RegistryRecordCredentialProviderType( - de.read_string( - _SCHEMA_REGISTRY_RECORD_CREDENTIAL_PROVIDER_CONFIGURATION.members[ - "credentialProviderType" - ] - ) - ) - ) - - case 1: - kwargs["credential_provider"] = ( - _RegistryRecordCredentialProviderUnionDeserializer().deserialize( - de - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_REGISTRY_RECORD_CREDENTIAL_PROVIDER_CONFIGURATION, - consumer=_consumer, - ) - if "credential_provider_type" not in kwargs: - kwargs["credential_provider_type"] = ( - RegistryRecordCredentialProviderType._corrected("") - ) - if "credential_provider" not in kwargs: - kwargs["credential_provider"] = ( - RegistryRecordCredentialProviderUnionUnknown(tag="") - ) - return kwargs - - -def _serialize_registry_record_credential_provider_configuration_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[RegistryRecordCredentialProviderConfiguration], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_registry_record_credential_provider_configuration_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[RegistryRecordCredentialProviderConfiguration]: - result: list[RegistryRecordCredentialProviderConfiguration] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(RegistryRecordCredentialProviderConfiguration.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class FromUrlSynchronizationConfiguration: - """Configuration for synchronizing from a URL-based MCP server.""" - - url: str - """The HTTPS URL of the MCP server to synchronize from.""" - - credential_provider_configurations: ( - list[RegistryRecordCredentialProviderConfiguration] | None - ) = None - """ - Optional list of credential provider configurations for authenticating - with the MCP server. At most one credential provider configuration can - be specified. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FROM_URL_SYNCHRONIZATION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_FROM_URL_SYNCHRONIZATION_CONFIGURATION.members["url"], self.url - ) - if self.credential_provider_configurations is not None: - _serialize_registry_record_credential_provider_configuration_list( - serializer, - _SCHEMA_FROM_URL_SYNCHRONIZATION_CONFIGURATION.members[ - "credentialProviderConfigurations" - ], - self.credential_provider_configurations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["url"] = de.read_string( - _SCHEMA_FROM_URL_SYNCHRONIZATION_CONFIGURATION.members["url"] - ) - - case 1: - kwargs["credential_provider_configurations"] = ( - _deserialize_registry_record_credential_provider_configuration_list( - de, - _SCHEMA_FROM_URL_SYNCHRONIZATION_CONFIGURATION.members[ - "credentialProviderConfigurations" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_FROM_URL_SYNCHRONIZATION_CONFIGURATION, consumer=_consumer - ) - if "url" not in kwargs: - kwargs["url"] = "" - return kwargs - - -@dataclass(kw_only=True) -class SynchronizationConfiguration: - """ - Configuration for synchronizing registry record metadata from an - external source. - """ - - from_url: FromUrlSynchronizationConfiguration | None = None - """Configuration for synchronizing from a URL-based source.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SYNCHRONIZATION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.from_url is not None: - serializer.write_struct( - _SCHEMA_SYNCHRONIZATION_CONFIGURATION.members["fromUrl"], self.from_url - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["from_url"] = ( - FromUrlSynchronizationConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SYNCHRONIZATION_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -class SynchronizationType(UnknownEnumMixin, StrEnum): - URL = "URL" - - -@dataclass(kw_only=True) -class CreateRegistryRecordInput: - """Dataclass for CreateRegistryRecordInput structure.""" - - registry_id: str | None = None - """ - The identifier of the registry where the record will be created. You can - specify either the Amazon Resource Name (ARN) or the ID of the registry. - """ - - name: str | None = None - """The name of the registry record.""" - - description: str | None = field(repr=False, default=None) - """A description of the registry record.""" - - descriptor_type: str | None = None - """ - The descriptor type of the registry record. - - - `MCP` - Model Context Protocol descriptor for MCP-compatible servers - and tools. - - - `A2A` - Agent-to-Agent protocol descriptor. - - - `CUSTOM` - Custom descriptor type for resources such as APIs, Lambda - functions, or servers not conforming to a standard protocol. - - - `AGENT_SKILLS` - Agent skills descriptor for defining agent skill - definitions. - """ - - descriptors: Descriptors | None = None - """ - The descriptor-type-specific configuration containing the resource - schema and metadata. The structure of this field depends on the - `descriptorType` you specify. - """ - - record_version: str | None = None - """ - The version of the registry record. Use this to track different versions - of the record's content. - """ - - synchronization_type: str | None = None - """ - The type of synchronization to use for keeping the record metadata up to - date from an external source. Possible values include `FROM_URL` and - `NONE`. - """ - - synchronization_configuration: SynchronizationConfiguration | None = None - """ - The configuration for synchronizing registry record metadata from an - external source, such as a URL-based MCP server. - """ - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If you don't specify this field, a - value is randomly generated for you. If this token matches a previous - request, the service ignores the request, but doesn't return an error. - For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_REGISTRY_RECORD_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.registry_id is not None: - serializer.write_string( - _SCHEMA_CREATE_REGISTRY_RECORD_INPUT.members["registryId"], - self.registry_id, - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_REGISTRY_RECORD_INPUT.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_REGISTRY_RECORD_INPUT.members["description"], - self.description, - ) - - if self.descriptor_type is not None: - serializer.write_string( - _SCHEMA_CREATE_REGISTRY_RECORD_INPUT.members["descriptorType"], - self.descriptor_type, - ) - - if self.descriptors is not None: - serializer.write_struct( - _SCHEMA_CREATE_REGISTRY_RECORD_INPUT.members["descriptors"], - self.descriptors, - ) - - if self.record_version is not None: - serializer.write_string( - _SCHEMA_CREATE_REGISTRY_RECORD_INPUT.members["recordVersion"], - self.record_version, - ) - - if self.synchronization_type is not None: - serializer.write_string( - _SCHEMA_CREATE_REGISTRY_RECORD_INPUT.members["synchronizationType"], - self.synchronization_type, - ) - - if self.synchronization_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_REGISTRY_RECORD_INPUT.members[ - "synchronizationConfiguration" - ], - self.synchronization_configuration, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_REGISTRY_RECORD_INPUT.members["clientToken"], - self.client_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["registry_id"] = de.read_string( - _SCHEMA_CREATE_REGISTRY_RECORD_INPUT.members["registryId"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_REGISTRY_RECORD_INPUT.members["name"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_REGISTRY_RECORD_INPUT.members["description"] - ) - - case 3: - kwargs["descriptor_type"] = DescriptorType( - de.read_string( - _SCHEMA_CREATE_REGISTRY_RECORD_INPUT.members[ - "descriptorType" - ] - ) - ) - - case 4: - kwargs["descriptors"] = Descriptors.deserialize(de) - - case 5: - kwargs["record_version"] = de.read_string( - _SCHEMA_CREATE_REGISTRY_RECORD_INPUT.members["recordVersion"] - ) - - case 6: - kwargs["synchronization_type"] = SynchronizationType( - de.read_string( - _SCHEMA_CREATE_REGISTRY_RECORD_INPUT.members[ - "synchronizationType" - ] - ) - ) - - case 7: - kwargs["synchronization_configuration"] = ( - SynchronizationConfiguration.deserialize(de) - ) - - case 8: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_REGISTRY_RECORD_INPUT.members["clientToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_REGISTRY_RECORD_INPUT, consumer=_consumer - ) - return kwargs - - -class RegistryRecordStatus(UnknownEnumMixin, StrEnum): - DRAFT = "DRAFT" - PENDING_APPROVAL = "PENDING_APPROVAL" - APPROVED = "APPROVED" - REJECTED = "REJECTED" - DEPRECATED = "DEPRECATED" - CREATING = "CREATING" - UPDATING = "UPDATING" - CREATE_FAILED = "CREATE_FAILED" - UPDATE_FAILED = "UPDATE_FAILED" - - -@dataclass(kw_only=True) -class CreateRegistryRecordOutput: - """Dataclass for CreateRegistryRecordOutput structure.""" - - record_arn: str - """The Amazon Resource Name (ARN) of the created registry record.""" - - status: str - """ - The status of the registry record. Set to `CREATING` while the - asynchronous workflow is in progress. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_REGISTRY_RECORD_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_REGISTRY_RECORD_OUTPUT.members["recordArn"], self.record_arn - ) - serializer.write_string( - _SCHEMA_CREATE_REGISTRY_RECORD_OUTPUT.members["status"], self.status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["record_arn"] = de.read_string( - _SCHEMA_CREATE_REGISTRY_RECORD_OUTPUT.members["recordArn"] - ) - - case 1: - kwargs["status"] = RegistryRecordStatus( - de.read_string( - _SCHEMA_CREATE_REGISTRY_RECORD_OUTPUT.members["status"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_REGISTRY_RECORD_OUTPUT, consumer=_consumer - ) - if "record_arn" not in kwargs: - kwargs["record_arn"] = "" - if "status" not in kwargs: - kwargs["status"] = RegistryRecordStatus._corrected("") - return kwargs - - -CREATE_REGISTRY_RECORD = APIOperation( - input=CreateRegistryRecordInput, - output=CreateRegistryRecordOutput, - schema=_SCHEMA_CREATE_REGISTRY_RECORD, - input_schema=_SCHEMA_CREATE_REGISTRY_RECORD_INPUT, - output_schema=_SCHEMA_CREATE_REGISTRY_RECORD_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteRegistryRecordInput: - """Dataclass for DeleteRegistryRecordInput structure.""" - - registry_id: str | None = None - """ - The identifier of the registry containing the record. You can specify - either the Amazon Resource Name (ARN) or the ID of the registry. - """ - - record_id: str | None = None - """ - The identifier of the registry record to delete. You can specify either - the Amazon Resource Name (ARN) or the ID of the record. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_REGISTRY_RECORD_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.registry_id is not None: - serializer.write_string( - _SCHEMA_DELETE_REGISTRY_RECORD_INPUT.members["registryId"], - self.registry_id, - ) - - if self.record_id is not None: - serializer.write_string( - _SCHEMA_DELETE_REGISTRY_RECORD_INPUT.members["recordId"], self.record_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["registry_id"] = de.read_string( - _SCHEMA_DELETE_REGISTRY_RECORD_INPUT.members["registryId"] - ) - - case 1: - kwargs["record_id"] = de.read_string( - _SCHEMA_DELETE_REGISTRY_RECORD_INPUT.members["recordId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_REGISTRY_RECORD_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteRegistryRecordOutput: - """Dataclass for DeleteRegistryRecordOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_REGISTRY_RECORD_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_REGISTRY_RECORD_OUTPUT, consumer=_consumer - ) - return kwargs - - -DELETE_REGISTRY_RECORD = APIOperation( - input=DeleteRegistryRecordInput, - output=DeleteRegistryRecordOutput, - schema=_SCHEMA_DELETE_REGISTRY_RECORD, - input_schema=_SCHEMA_DELETE_REGISTRY_RECORD_INPUT, - output_schema=_SCHEMA_DELETE_REGISTRY_RECORD_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetRegistryRecordInput: - """Dataclass for GetRegistryRecordInput structure.""" - - registry_id: str | None = None - """ - The identifier of the registry containing the record. You can specify - either the Amazon Resource Name (ARN) or the ID of the registry. - """ - - record_id: str | None = None - """ - The identifier of the registry record to retrieve. You can specify - either the Amazon Resource Name (ARN) or the ID of the record. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_REGISTRY_RECORD_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.registry_id is not None: - serializer.write_string( - _SCHEMA_GET_REGISTRY_RECORD_INPUT.members["registryId"], - self.registry_id, - ) - - if self.record_id is not None: - serializer.write_string( - _SCHEMA_GET_REGISTRY_RECORD_INPUT.members["recordId"], self.record_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["registry_id"] = de.read_string( - _SCHEMA_GET_REGISTRY_RECORD_INPUT.members["registryId"] - ) - - case 1: - kwargs["record_id"] = de.read_string( - _SCHEMA_GET_REGISTRY_RECORD_INPUT.members["recordId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_REGISTRY_RECORD_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetRegistryRecordOutput: - """Dataclass for GetRegistryRecordOutput structure.""" - - registry_arn: str - """The Amazon Resource Name (ARN) of the registry that contains the record.""" - - record_arn: str - """The Amazon Resource Name (ARN) of the registry record.""" - - record_id: str - """The unique identifier of the registry record.""" - - name: str - """The name of the registry record.""" - - descriptor_type: str - """ - The descriptor type of the registry record. Possible values are `MCP`, - `A2A`, `CUSTOM`, and `AGENT_SKILLS`. - """ - - descriptors: Descriptors - """ - The descriptor-type-specific configuration containing the resource - schema and metadata. For details, see the `Descriptors` data type. - """ - - status: str - """ - The current status of the registry record. Possible values include - `CREATING`, `DRAFT`, `APPROVED`, `PENDING_APPROVAL`, `REJECTED`, - `DEPRECATED`, `UPDATING`, `CREATE_FAILED`, and `UPDATE_FAILED`. A record - transitions from `CREATING` to `DRAFT`, then to `PENDING_APPROVAL` (via - `SubmitRegistryRecordForApproval`), and finally to `APPROVED` upon - approval. - """ - - created_at: datetime - """The timestamp when the registry record was created.""" - - updated_at: datetime - """The timestamp when the registry record was last updated.""" - - description: str | None = field(repr=False, default=None) - """The description of the registry record.""" - - record_version: str | None = None - """The version of the registry record.""" - - status_reason: str | None = None - """ - The reason for the current status, typically set when the status is a - failure state. - """ - - synchronization_type: str | None = None - """The type of synchronization used for this record.""" - - synchronization_configuration: SynchronizationConfiguration | None = None - """ - The configuration for synchronizing registry record metadata from an - external source. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_REGISTRY_RECORD_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_REGISTRY_RECORD_OUTPUT.members["registryArn"], self.registry_arn - ) - serializer.write_string( - _SCHEMA_GET_REGISTRY_RECORD_OUTPUT.members["recordArn"], self.record_arn - ) - serializer.write_string( - _SCHEMA_GET_REGISTRY_RECORD_OUTPUT.members["recordId"], self.record_id - ) - serializer.write_string( - _SCHEMA_GET_REGISTRY_RECORD_OUTPUT.members["name"], self.name - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_REGISTRY_RECORD_OUTPUT.members["description"], - self.description, - ) - - serializer.write_string( - _SCHEMA_GET_REGISTRY_RECORD_OUTPUT.members["descriptorType"], - self.descriptor_type, - ) - serializer.write_struct( - _SCHEMA_GET_REGISTRY_RECORD_OUTPUT.members["descriptors"], self.descriptors - ) - if self.record_version is not None: - serializer.write_string( - _SCHEMA_GET_REGISTRY_RECORD_OUTPUT.members["recordVersion"], - self.record_version, - ) - - serializer.write_string( - _SCHEMA_GET_REGISTRY_RECORD_OUTPUT.members["status"], self.status - ) - serializer.write_timestamp( - _SCHEMA_GET_REGISTRY_RECORD_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_GET_REGISTRY_RECORD_OUTPUT.members["updatedAt"], self.updated_at - ) - if self.status_reason is not None: - serializer.write_string( - _SCHEMA_GET_REGISTRY_RECORD_OUTPUT.members["statusReason"], - self.status_reason, - ) - - if self.synchronization_type is not None: - serializer.write_string( - _SCHEMA_GET_REGISTRY_RECORD_OUTPUT.members["synchronizationType"], - self.synchronization_type, - ) - - if self.synchronization_configuration is not None: - serializer.write_struct( - _SCHEMA_GET_REGISTRY_RECORD_OUTPUT.members[ - "synchronizationConfiguration" - ], - self.synchronization_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["registry_arn"] = de.read_string( - _SCHEMA_GET_REGISTRY_RECORD_OUTPUT.members["registryArn"] - ) - - case 1: - kwargs["record_arn"] = de.read_string( - _SCHEMA_GET_REGISTRY_RECORD_OUTPUT.members["recordArn"] - ) - - case 2: - kwargs["record_id"] = de.read_string( - _SCHEMA_GET_REGISTRY_RECORD_OUTPUT.members["recordId"] - ) - - case 3: - kwargs["name"] = de.read_string( - _SCHEMA_GET_REGISTRY_RECORD_OUTPUT.members["name"] - ) - - case 4: - kwargs["description"] = de.read_string( - _SCHEMA_GET_REGISTRY_RECORD_OUTPUT.members["description"] - ) - - case 5: - kwargs["descriptor_type"] = DescriptorType( - de.read_string( - _SCHEMA_GET_REGISTRY_RECORD_OUTPUT.members["descriptorType"] - ) - ) - - case 6: - kwargs["descriptors"] = Descriptors.deserialize(de) - - case 7: - kwargs["record_version"] = de.read_string( - _SCHEMA_GET_REGISTRY_RECORD_OUTPUT.members["recordVersion"] - ) - - case 8: - kwargs["status"] = RegistryRecordStatus( - de.read_string( - _SCHEMA_GET_REGISTRY_RECORD_OUTPUT.members["status"] - ) - ) - - case 9: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_REGISTRY_RECORD_OUTPUT.members["createdAt"] - ) - - case 10: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_GET_REGISTRY_RECORD_OUTPUT.members["updatedAt"] - ) - - case 11: - kwargs["status_reason"] = de.read_string( - _SCHEMA_GET_REGISTRY_RECORD_OUTPUT.members["statusReason"] - ) - - case 12: - kwargs["synchronization_type"] = SynchronizationType( - de.read_string( - _SCHEMA_GET_REGISTRY_RECORD_OUTPUT.members[ - "synchronizationType" - ] - ) - ) - - case 13: - kwargs["synchronization_configuration"] = ( - SynchronizationConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_REGISTRY_RECORD_OUTPUT, consumer=_consumer) - if "registry_arn" not in kwargs: - kwargs["registry_arn"] = "" - if "record_arn" not in kwargs: - kwargs["record_arn"] = "" - if "record_id" not in kwargs: - kwargs["record_id"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "descriptor_type" not in kwargs: - kwargs["descriptor_type"] = DescriptorType._corrected("") - if "descriptors" not in kwargs: - kwargs["descriptors"] = Descriptors._smithy_default() - if "status" not in kwargs: - kwargs["status"] = RegistryRecordStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -GET_REGISTRY_RECORD = APIOperation( - input=GetRegistryRecordInput, - output=GetRegistryRecordOutput, - schema=_SCHEMA_GET_REGISTRY_RECORD, - input_schema=_SCHEMA_GET_REGISTRY_RECORD_INPUT, - output_schema=_SCHEMA_GET_REGISTRY_RECORD_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListRegistryRecordsInput: - """Dataclass for ListRegistryRecordsInput structure.""" - - registry_id: str | None = None - """ - The identifier of the registry to list records from. You can specify - either the Amazon Resource Name (ARN) or the ID of the registry. - """ - - max_results: int | None = None - """ - The maximum number of results to return in the response. If the total - number of results is greater than this value, use the token returned in - the response in the `nextToken` field when making another request to - return the next batch of results. - """ - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, enter the token returned in the `nextToken` - field in the response in this field to return the next batch of results. - """ - - name: str | None = None - """Filter registry records by name.""" - - status: str | None = None - """ - Filter registry records by their current status. Possible values include - `CREATING`, `DRAFT`, `APPROVED`, `PENDING_APPROVAL`, `REJECTED`, - `DEPRECATED`, `UPDATING`, `CREATE_FAILED`, and `UPDATE_FAILED`. - """ - - descriptor_type: str | None = None - """ - Filter registry records by their descriptor type. Possible values are - `MCP`, `A2A`, `CUSTOM`, and `AGENT_SKILLS`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_REGISTRY_RECORDS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.registry_id is not None: - serializer.write_string( - _SCHEMA_LIST_REGISTRY_RECORDS_INPUT.members["registryId"], - self.registry_id, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_REGISTRY_RECORDS_INPUT.members["maxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_REGISTRY_RECORDS_INPUT.members["nextToken"], - self.next_token, - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_LIST_REGISTRY_RECORDS_INPUT.members["name"], self.name - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_LIST_REGISTRY_RECORDS_INPUT.members["status"], self.status - ) - - if self.descriptor_type is not None: - serializer.write_string( - _SCHEMA_LIST_REGISTRY_RECORDS_INPUT.members["descriptorType"], - self.descriptor_type, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["registry_id"] = de.read_string( - _SCHEMA_LIST_REGISTRY_RECORDS_INPUT.members["registryId"] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_REGISTRY_RECORDS_INPUT.members["maxResults"] - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_REGISTRY_RECORDS_INPUT.members["nextToken"] - ) - - case 3: - kwargs["name"] = de.read_string( - _SCHEMA_LIST_REGISTRY_RECORDS_INPUT.members["name"] - ) - - case 4: - kwargs["status"] = RegistryRecordStatus( - de.read_string( - _SCHEMA_LIST_REGISTRY_RECORDS_INPUT.members["status"] - ) - ) - - case 5: - kwargs["descriptor_type"] = DescriptorType( - de.read_string( - _SCHEMA_LIST_REGISTRY_RECORDS_INPUT.members[ - "descriptorType" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_REGISTRY_RECORDS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class RegistryRecordSummary: - """Contains summary information about a registry record.""" - - registry_arn: str - """The Amazon Resource Name (ARN) of the registry that contains the record.""" - - record_arn: str - """The Amazon Resource Name (ARN) of the registry record.""" - - record_id: str - """The unique identifier of the registry record.""" - - name: str - """The name of the registry record.""" - - descriptor_type: str - """ - The descriptor type of the registry record. Possible values are `MCP`, - `A2A`, `CUSTOM`, and `AGENT_SKILLS`. - """ - - record_version: str - """The version of the registry record.""" - - status: str - """ - The current status of the registry record. Possible values include - `CREATING`, `DRAFT`, `APPROVED`, `PENDING_APPROVAL`, `REJECTED`, - `DEPRECATED`, `UPDATING`, `CREATE_FAILED`, and `UPDATE_FAILED`. - """ - - created_at: datetime - """The timestamp when the registry record was created.""" - - updated_at: datetime - """The timestamp when the registry record was last updated.""" - - description: str | None = field(repr=False, default=None) - """The description of the registry record.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REGISTRY_RECORD_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_REGISTRY_RECORD_SUMMARY.members["registryArn"], self.registry_arn - ) - serializer.write_string( - _SCHEMA_REGISTRY_RECORD_SUMMARY.members["recordArn"], self.record_arn - ) - serializer.write_string( - _SCHEMA_REGISTRY_RECORD_SUMMARY.members["recordId"], self.record_id - ) - serializer.write_string( - _SCHEMA_REGISTRY_RECORD_SUMMARY.members["name"], self.name - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_REGISTRY_RECORD_SUMMARY.members["description"], self.description - ) - - serializer.write_string( - _SCHEMA_REGISTRY_RECORD_SUMMARY.members["descriptorType"], - self.descriptor_type, - ) - serializer.write_string( - _SCHEMA_REGISTRY_RECORD_SUMMARY.members["recordVersion"], - self.record_version, - ) - serializer.write_string( - _SCHEMA_REGISTRY_RECORD_SUMMARY.members["status"], self.status - ) - serializer.write_timestamp( - _SCHEMA_REGISTRY_RECORD_SUMMARY.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_REGISTRY_RECORD_SUMMARY.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["registry_arn"] = de.read_string( - _SCHEMA_REGISTRY_RECORD_SUMMARY.members["registryArn"] - ) - - case 1: - kwargs["record_arn"] = de.read_string( - _SCHEMA_REGISTRY_RECORD_SUMMARY.members["recordArn"] - ) - - case 2: - kwargs["record_id"] = de.read_string( - _SCHEMA_REGISTRY_RECORD_SUMMARY.members["recordId"] - ) - - case 3: - kwargs["name"] = de.read_string( - _SCHEMA_REGISTRY_RECORD_SUMMARY.members["name"] - ) - - case 4: - kwargs["description"] = de.read_string( - _SCHEMA_REGISTRY_RECORD_SUMMARY.members["description"] - ) - - case 5: - kwargs["descriptor_type"] = DescriptorType( - de.read_string( - _SCHEMA_REGISTRY_RECORD_SUMMARY.members["descriptorType"] - ) - ) - - case 6: - kwargs["record_version"] = de.read_string( - _SCHEMA_REGISTRY_RECORD_SUMMARY.members["recordVersion"] - ) - - case 7: - kwargs["status"] = RegistryRecordStatus( - de.read_string( - _SCHEMA_REGISTRY_RECORD_SUMMARY.members["status"] - ) - ) - - case 8: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_REGISTRY_RECORD_SUMMARY.members["createdAt"] - ) - - case 9: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_REGISTRY_RECORD_SUMMARY.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_REGISTRY_RECORD_SUMMARY, consumer=_consumer) - if "registry_arn" not in kwargs: - kwargs["registry_arn"] = "" - if "record_arn" not in kwargs: - kwargs["record_arn"] = "" - if "record_id" not in kwargs: - kwargs["record_id"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "descriptor_type" not in kwargs: - kwargs["descriptor_type"] = DescriptorType._corrected("") - if "record_version" not in kwargs: - kwargs["record_version"] = "" - if "status" not in kwargs: - kwargs["status"] = RegistryRecordStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_registry_record_summary_list( - serializer: ShapeSerializer, schema: Schema, value: list[RegistryRecordSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_registry_record_summary_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[RegistryRecordSummary]: - result: list[RegistryRecordSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(RegistryRecordSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListRegistryRecordsOutput: - """Dataclass for ListRegistryRecordsOutput structure.""" - - registry_records: list[RegistryRecordSummary] - """ - The list of registry record summaries. For details about the fields in - each summary, see the `RegistryRecordSummary` data type. - """ - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, use this token when making another request in - the `nextToken` field to return the next batch of results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_REGISTRY_RECORDS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_registry_record_summary_list( - serializer, - _SCHEMA_LIST_REGISTRY_RECORDS_OUTPUT.members["registryRecords"], - self.registry_records, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_REGISTRY_RECORDS_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["registry_records"] = ( - _deserialize_registry_record_summary_list( - de, - _SCHEMA_LIST_REGISTRY_RECORDS_OUTPUT.members[ - "registryRecords" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_REGISTRY_RECORDS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_REGISTRY_RECORDS_OUTPUT, consumer=_consumer - ) - if "registry_records" not in kwargs: - kwargs["registry_records"] = [] - return kwargs - - -LIST_REGISTRY_RECORDS = APIOperation( - input=ListRegistryRecordsInput, - output=ListRegistryRecordsOutput, - schema=_SCHEMA_LIST_REGISTRY_RECORDS, - input_schema=_SCHEMA_LIST_REGISTRY_RECORDS_INPUT, - output_schema=_SCHEMA_LIST_REGISTRY_RECORDS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class SubmitRegistryRecordForApprovalInput: - """Dataclass for SubmitRegistryRecordForApprovalInput structure.""" - - registry_id: str | None = None - """ - The identifier of the registry containing the record. You can specify - either the Amazon Resource Name (ARN) or the ID of the registry. - """ - - record_id: str | None = None - """ - The identifier of the registry record to submit for approval. You can - specify either the Amazon Resource Name (ARN) or the ID of the record. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SUBMIT_REGISTRY_RECORD_FOR_APPROVAL_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.registry_id is not None: - serializer.write_string( - _SCHEMA_SUBMIT_REGISTRY_RECORD_FOR_APPROVAL_INPUT.members["registryId"], - self.registry_id, - ) - - if self.record_id is not None: - serializer.write_string( - _SCHEMA_SUBMIT_REGISTRY_RECORD_FOR_APPROVAL_INPUT.members["recordId"], - self.record_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["registry_id"] = de.read_string( - _SCHEMA_SUBMIT_REGISTRY_RECORD_FOR_APPROVAL_INPUT.members[ - "registryId" - ] - ) - - case 1: - kwargs["record_id"] = de.read_string( - _SCHEMA_SUBMIT_REGISTRY_RECORD_FOR_APPROVAL_INPUT.members[ - "recordId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SUBMIT_REGISTRY_RECORD_FOR_APPROVAL_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class SubmitRegistryRecordForApprovalOutput: - """Dataclass for SubmitRegistryRecordForApprovalOutput structure.""" - - registry_arn: str - """The Amazon Resource Name (ARN) of the registry that contains the record.""" - - record_arn: str - """The Amazon Resource Name (ARN) of the registry record.""" - - record_id: str - """The unique identifier of the registry record.""" - - status: str - """The resulting status of the registry record after submission.""" - - updated_at: datetime - """The timestamp when the record was last updated.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_SUBMIT_REGISTRY_RECORD_FOR_APPROVAL_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SUBMIT_REGISTRY_RECORD_FOR_APPROVAL_OUTPUT.members["registryArn"], - self.registry_arn, - ) - serializer.write_string( - _SCHEMA_SUBMIT_REGISTRY_RECORD_FOR_APPROVAL_OUTPUT.members["recordArn"], - self.record_arn, - ) - serializer.write_string( - _SCHEMA_SUBMIT_REGISTRY_RECORD_FOR_APPROVAL_OUTPUT.members["recordId"], - self.record_id, - ) - serializer.write_string( - _SCHEMA_SUBMIT_REGISTRY_RECORD_FOR_APPROVAL_OUTPUT.members["status"], - self.status, - ) - serializer.write_timestamp( - _SCHEMA_SUBMIT_REGISTRY_RECORD_FOR_APPROVAL_OUTPUT.members["updatedAt"], - self.updated_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["registry_arn"] = de.read_string( - _SCHEMA_SUBMIT_REGISTRY_RECORD_FOR_APPROVAL_OUTPUT.members[ - "registryArn" - ] - ) - - case 1: - kwargs["record_arn"] = de.read_string( - _SCHEMA_SUBMIT_REGISTRY_RECORD_FOR_APPROVAL_OUTPUT.members[ - "recordArn" - ] - ) - - case 2: - kwargs["record_id"] = de.read_string( - _SCHEMA_SUBMIT_REGISTRY_RECORD_FOR_APPROVAL_OUTPUT.members[ - "recordId" - ] - ) - - case 3: - kwargs["status"] = RegistryRecordStatus( - de.read_string( - _SCHEMA_SUBMIT_REGISTRY_RECORD_FOR_APPROVAL_OUTPUT.members[ - "status" - ] - ) - ) - - case 4: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_SUBMIT_REGISTRY_RECORD_FOR_APPROVAL_OUTPUT.members[ - "updatedAt" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SUBMIT_REGISTRY_RECORD_FOR_APPROVAL_OUTPUT, consumer=_consumer - ) - if "registry_arn" not in kwargs: - kwargs["registry_arn"] = "" - if "record_arn" not in kwargs: - kwargs["record_arn"] = "" - if "record_id" not in kwargs: - kwargs["record_id"] = "" - if "status" not in kwargs: - kwargs["status"] = RegistryRecordStatus._corrected("") - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -SUBMIT_REGISTRY_RECORD_FOR_APPROVAL = APIOperation( - input=SubmitRegistryRecordForApprovalInput, - output=SubmitRegistryRecordForApprovalOutput, - schema=_SCHEMA_SUBMIT_REGISTRY_RECORD_FOR_APPROVAL, - input_schema=_SCHEMA_SUBMIT_REGISTRY_RECORD_FOR_APPROVAL_INPUT, - output_schema=_SCHEMA_SUBMIT_REGISTRY_RECORD_FOR_APPROVAL_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdatedA2aDescriptor: - """ - Wrapper for updating an A2A descriptor with PATCH semantics. When - present, the A2A descriptor is replaced with the provided value. When - absent, the A2A descriptor is left unchanged. To unset, include the - wrapper with the value set to null. - """ - - optional_value: A2aDescriptor | None = None - """The updated A2A descriptor value.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATED_A2A_DESCRIPTOR, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.optional_value is not None: - serializer.write_struct( - _SCHEMA_UPDATED_A2A_DESCRIPTOR.members["optionalValue"], - self.optional_value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["optional_value"] = A2aDescriptor.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATED_A2A_DESCRIPTOR, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdatedSkillDefinition: - """Wrapper for updating a skill definition with PATCH semantics.""" - - optional_value: SkillDefinition | None = None - """The updated skill definition value.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATED_SKILL_DEFINITION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.optional_value is not None: - serializer.write_struct( - _SCHEMA_UPDATED_SKILL_DEFINITION.members["optionalValue"], - self.optional_value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["optional_value"] = SkillDefinition.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATED_SKILL_DEFINITION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdatedSkillMdDefinition: - """Wrapper for updating a skill markdown definition with PATCH semantics.""" - - optional_value: SkillMdDefinition | None = None - """The updated skill markdown definition value.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATED_SKILL_MD_DEFINITION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.optional_value is not None: - serializer.write_struct( - _SCHEMA_UPDATED_SKILL_MD_DEFINITION.members["optionalValue"], - self.optional_value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["optional_value"] = SkillMdDefinition.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATED_SKILL_MD_DEFINITION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdatedAgentSkillsDescriptorFields: - """ - Individual agent skills descriptor fields that can be updated - independently. - """ - - skill_md: UpdatedSkillMdDefinition | None = None - """The updated skill markdown definition.""" - - skill_definition: UpdatedSkillDefinition | None = None - """The updated skill definition.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATED_AGENT_SKILLS_DESCRIPTOR_FIELDS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.skill_md is not None: - serializer.write_struct( - _SCHEMA_UPDATED_AGENT_SKILLS_DESCRIPTOR_FIELDS.members["skillMd"], - self.skill_md, - ) - - if self.skill_definition is not None: - serializer.write_struct( - _SCHEMA_UPDATED_AGENT_SKILLS_DESCRIPTOR_FIELDS.members[ - "skillDefinition" - ], - self.skill_definition, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["skill_md"] = UpdatedSkillMdDefinition.deserialize(de) - - case 1: - kwargs["skill_definition"] = UpdatedSkillDefinition.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATED_AGENT_SKILLS_DESCRIPTOR_FIELDS, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdatedAgentSkillsDescriptor: - """ - Wrapper for updating an agent skills descriptor with PATCH semantics. - When present with a value, individual fields can be updated - independently. When present with a null value, the entire agent skills - descriptor is unset. When absent, the agent skills descriptor is left - unchanged. - """ - - optional_value: UpdatedAgentSkillsDescriptorFields | None = None - """The updated agent skills descriptor fields.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATED_AGENT_SKILLS_DESCRIPTOR, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.optional_value is not None: - serializer.write_struct( - _SCHEMA_UPDATED_AGENT_SKILLS_DESCRIPTOR.members["optionalValue"], - self.optional_value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["optional_value"] = ( - UpdatedAgentSkillsDescriptorFields.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATED_AGENT_SKILLS_DESCRIPTOR, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdatedCustomDescriptor: - """ - Wrapper for updating a custom descriptor with PATCH semantics. When - present, the custom descriptor is replaced with the provided value. When - absent, the custom descriptor is left unchanged. To unset, include the - wrapper with the value set to null. - """ - - optional_value: CustomDescriptor | None = None - """The updated custom descriptor value.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATED_CUSTOM_DESCRIPTOR, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.optional_value is not None: - serializer.write_struct( - _SCHEMA_UPDATED_CUSTOM_DESCRIPTOR.members["optionalValue"], - self.optional_value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["optional_value"] = CustomDescriptor.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATED_CUSTOM_DESCRIPTOR, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdatedServerDefinition: - """ - Wrapper for updating a server definition with PATCH semantics. When - present, the server definition is replaced with the provided value. When - absent, the server definition is left unchanged. To unset, include the - wrapper with the value set to null. - """ - - optional_value: ServerDefinition | None = None - """The updated server definition value.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATED_SERVER_DEFINITION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.optional_value is not None: - serializer.write_struct( - _SCHEMA_UPDATED_SERVER_DEFINITION.members["optionalValue"], - self.optional_value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["optional_value"] = ServerDefinition.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATED_SERVER_DEFINITION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdatedToolsDefinition: - """ - Wrapper for updating a tools definition with PATCH semantics. When - present, the tools definition is replaced with the provided value. When - absent, the tools definition is left unchanged. To unset, include the - wrapper with the value set to null. - """ - - optional_value: ToolsDefinition | None = None - """The updated tools definition value.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATED_TOOLS_DEFINITION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.optional_value is not None: - serializer.write_struct( - _SCHEMA_UPDATED_TOOLS_DEFINITION.members["optionalValue"], - self.optional_value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["optional_value"] = ToolsDefinition.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATED_TOOLS_DEFINITION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdatedMcpDescriptorFields: - """Individual MCP descriptor fields that can be updated independently.""" - - server: UpdatedServerDefinition | None = None - """The updated server definition for the MCP descriptor.""" - - tools: UpdatedToolsDefinition | None = None - """The updated tools definition for the MCP descriptor.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATED_MCP_DESCRIPTOR_FIELDS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.server is not None: - serializer.write_struct( - _SCHEMA_UPDATED_MCP_DESCRIPTOR_FIELDS.members["server"], self.server - ) - - if self.tools is not None: - serializer.write_struct( - _SCHEMA_UPDATED_MCP_DESCRIPTOR_FIELDS.members["tools"], self.tools - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["server"] = UpdatedServerDefinition.deserialize(de) - - case 1: - kwargs["tools"] = UpdatedToolsDefinition.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATED_MCP_DESCRIPTOR_FIELDS, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdatedMcpDescriptor: - """ - Wrapper for updating an MCP descriptor with PATCH semantics. When - present with a value, individual MCP fields can be updated - independently. When present with a null value, the entire MCP descriptor - is unset. When absent, the MCP descriptor is left unchanged. - """ - - optional_value: UpdatedMcpDescriptorFields | None = None - """The updated MCP descriptor fields.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATED_MCP_DESCRIPTOR, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.optional_value is not None: - serializer.write_struct( - _SCHEMA_UPDATED_MCP_DESCRIPTOR.members["optionalValue"], - self.optional_value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["optional_value"] = UpdatedMcpDescriptorFields.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATED_MCP_DESCRIPTOR, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdatedDescriptorsUnion: - """ - Contains per-descriptor-type wrappers for updating descriptors. Each - descriptor type can be updated independently. - """ - - mcp: UpdatedMcpDescriptor | None = None - """The updated MCP descriptor.""" - - a2a: UpdatedA2aDescriptor | None = None - """The updated A2A descriptor.""" - - custom: UpdatedCustomDescriptor | None = None - """The updated custom descriptor.""" - - agent_skills: UpdatedAgentSkillsDescriptor | None = None - """The updated agent skills descriptor.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATED_DESCRIPTORS_UNION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.mcp is not None: - serializer.write_struct( - _SCHEMA_UPDATED_DESCRIPTORS_UNION.members["mcp"], self.mcp - ) - - if self.a2a is not None: - serializer.write_struct( - _SCHEMA_UPDATED_DESCRIPTORS_UNION.members["a2a"], self.a2a - ) - - if self.custom is not None: - serializer.write_struct( - _SCHEMA_UPDATED_DESCRIPTORS_UNION.members["custom"], self.custom - ) - - if self.agent_skills is not None: - serializer.write_struct( - _SCHEMA_UPDATED_DESCRIPTORS_UNION.members["agentSkills"], - self.agent_skills, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["mcp"] = UpdatedMcpDescriptor.deserialize(de) - - case 1: - kwargs["a2a"] = UpdatedA2aDescriptor.deserialize(de) - - case 2: - kwargs["custom"] = UpdatedCustomDescriptor.deserialize(de) - - case 3: - kwargs["agent_skills"] = UpdatedAgentSkillsDescriptor.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATED_DESCRIPTORS_UNION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdatedDescriptors: - """ - Wrapper for updating an optional descriptors field with PATCH semantics. - When present with a value, individual descriptors can be updated. When - present with a null value, all descriptors are unset. When absent, - descriptors are left unchanged. - """ - - optional_value: UpdatedDescriptorsUnion | None = None - """ - The updated descriptors value. Contains per-descriptor-type wrappers - that are each independently updatable. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATED_DESCRIPTORS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.optional_value is not None: - serializer.write_struct( - _SCHEMA_UPDATED_DESCRIPTORS.members["optionalValue"], - self.optional_value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["optional_value"] = UpdatedDescriptorsUnion.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATED_DESCRIPTORS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdatedSynchronizationConfiguration: - """ - Wrapper for updating the synchronization configuration with PATCH - semantics. Must be matched with `UpdatedSynchronizationType`. - """ - - optional_value: SynchronizationConfiguration | None = None - """The updated synchronization configuration value.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATED_SYNCHRONIZATION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.optional_value is not None: - serializer.write_struct( - _SCHEMA_UPDATED_SYNCHRONIZATION_CONFIGURATION.members["optionalValue"], - self.optional_value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["optional_value"] = SynchronizationConfiguration.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATED_SYNCHRONIZATION_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdatedSynchronizationType: - """ - Wrapper for updating the synchronization type with PATCH semantics. Must - be matched with `UpdatedSynchronizationConfiguration`. - """ - - optional_value: str | None = None - """The updated synchronization type value.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATED_SYNCHRONIZATION_TYPE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.optional_value is not None: - serializer.write_string( - _SCHEMA_UPDATED_SYNCHRONIZATION_TYPE.members["optionalValue"], - self.optional_value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["optional_value"] = SynchronizationType( - de.read_string( - _SCHEMA_UPDATED_SYNCHRONIZATION_TYPE.members[ - "optionalValue" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATED_SYNCHRONIZATION_TYPE, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateRegistryRecordInput: - """Dataclass for UpdateRegistryRecordInput structure.""" - - registry_id: str | None = None - """ - The identifier of the registry containing the record. You can specify - either the Amazon Resource Name (ARN) or the ID of the registry. - """ - - record_id: str | None = None - """ - The identifier of the registry record to update. You can specify either - the Amazon Resource Name (ARN) or the ID of the record. - """ - - name: str | None = None - """The updated name for the registry record.""" - - description: UpdatedDescription | None = None - """ - The updated description for the registry record. To clear the - description, include the `UpdatedDescription` wrapper with - `optionalValue` not specified. - """ - - descriptor_type: str | None = None - """ - The updated descriptor type for the registry record. Changing the - descriptor type may require updating the `descriptors` field to match - the new type's schema requirements. - """ - - descriptors: UpdatedDescriptors | None = None - """ - The updated descriptor-type-specific configuration containing the - resource schema and metadata. Uses PATCH semantics where individual - descriptor fields can be updated independently. - """ - - record_version: str | None = None - """ - The version of the registry record for optimistic locking. If provided, - it must match the current version of the record. The service - automatically increments the version after a successful update. - """ - - synchronization_type: UpdatedSynchronizationType | None = None - """The updated synchronization type for the registry record.""" - - synchronization_configuration: UpdatedSynchronizationConfiguration | None = None - """The updated synchronization configuration for the registry record.""" - - trigger_synchronization: bool | None = None - """ - Whether to trigger synchronization using the stored or provided - configuration. When set to `true`, the service will synchronize the - record metadata from the configured external source. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_REGISTRY_RECORD_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.registry_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_REGISTRY_RECORD_INPUT.members["registryId"], - self.registry_id, - ) - - if self.record_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_REGISTRY_RECORD_INPUT.members["recordId"], self.record_id - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_UPDATE_REGISTRY_RECORD_INPUT.members["name"], self.name - ) - - if self.description is not None: - serializer.write_struct( - _SCHEMA_UPDATE_REGISTRY_RECORD_INPUT.members["description"], - self.description, - ) - - if self.descriptor_type is not None: - serializer.write_string( - _SCHEMA_UPDATE_REGISTRY_RECORD_INPUT.members["descriptorType"], - self.descriptor_type, - ) - - if self.descriptors is not None: - serializer.write_struct( - _SCHEMA_UPDATE_REGISTRY_RECORD_INPUT.members["descriptors"], - self.descriptors, - ) - - if self.record_version is not None: - serializer.write_string( - _SCHEMA_UPDATE_REGISTRY_RECORD_INPUT.members["recordVersion"], - self.record_version, - ) - - if self.synchronization_type is not None: - serializer.write_struct( - _SCHEMA_UPDATE_REGISTRY_RECORD_INPUT.members["synchronizationType"], - self.synchronization_type, - ) - - if self.synchronization_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_REGISTRY_RECORD_INPUT.members[ - "synchronizationConfiguration" - ], - self.synchronization_configuration, - ) - - if self.trigger_synchronization is not None: - serializer.write_boolean( - _SCHEMA_UPDATE_REGISTRY_RECORD_INPUT.members["triggerSynchronization"], - self.trigger_synchronization, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["registry_id"] = de.read_string( - _SCHEMA_UPDATE_REGISTRY_RECORD_INPUT.members["registryId"] - ) - - case 1: - kwargs["record_id"] = de.read_string( - _SCHEMA_UPDATE_REGISTRY_RECORD_INPUT.members["recordId"] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_REGISTRY_RECORD_INPUT.members["name"] - ) - - case 3: - kwargs["description"] = UpdatedDescription.deserialize(de) - - case 4: - kwargs["descriptor_type"] = DescriptorType( - de.read_string( - _SCHEMA_UPDATE_REGISTRY_RECORD_INPUT.members[ - "descriptorType" - ] - ) - ) - - case 5: - kwargs["descriptors"] = UpdatedDescriptors.deserialize(de) - - case 6: - kwargs["record_version"] = de.read_string( - _SCHEMA_UPDATE_REGISTRY_RECORD_INPUT.members["recordVersion"] - ) - - case 7: - kwargs["synchronization_type"] = ( - UpdatedSynchronizationType.deserialize(de) - ) - - case 8: - kwargs["synchronization_configuration"] = ( - UpdatedSynchronizationConfiguration.deserialize(de) - ) - - case 9: - kwargs["trigger_synchronization"] = de.read_boolean( - _SCHEMA_UPDATE_REGISTRY_RECORD_INPUT.members[ - "triggerSynchronization" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_REGISTRY_RECORD_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateRegistryRecordOutput: - """Dataclass for UpdateRegistryRecordOutput structure.""" - - registry_arn: str - """ - The Amazon Resource Name (ARN) of the registry that contains the updated - record. - """ - - record_arn: str - """The Amazon Resource Name (ARN) of the updated registry record.""" - - record_id: str - """The unique identifier of the updated registry record.""" - - name: str - """The name of the updated registry record.""" - - descriptor_type: str - """ - The descriptor type of the updated registry record. Possible values are - `MCP`, `A2A`, `CUSTOM`, and `AGENT_SKILLS`. - """ - - descriptors: Descriptors - """ - The descriptor-type-specific configuration of the updated registry - record. For details, see the `Descriptors` data type. - """ - - status: str - """ - The current status of the updated registry record. Possible values - include `CREATING`, `DRAFT`, `APPROVED`, `PENDING_APPROVAL`, `REJECTED`, - `DEPRECATED`, `UPDATING`, `CREATE_FAILED`, and `UPDATE_FAILED`. - """ - - created_at: datetime - """The timestamp when the registry record was created.""" - - updated_at: datetime - """The timestamp when the registry record was last updated.""" - - description: str | None = field(repr=False, default=None) - """The description of the updated registry record.""" - - record_version: str | None = None - """The version of the updated registry record.""" - - status_reason: str | None = None - """The reason for the current status of the updated registry record.""" - - synchronization_type: str | None = None - """The synchronization type of the updated registry record.""" - - synchronization_configuration: SynchronizationConfiguration | None = None - """The synchronization configuration of the updated registry record.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_REGISTRY_RECORD_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_UPDATE_REGISTRY_RECORD_OUTPUT.members["registryArn"], - self.registry_arn, - ) - serializer.write_string( - _SCHEMA_UPDATE_REGISTRY_RECORD_OUTPUT.members["recordArn"], self.record_arn - ) - serializer.write_string( - _SCHEMA_UPDATE_REGISTRY_RECORD_OUTPUT.members["recordId"], self.record_id - ) - serializer.write_string( - _SCHEMA_UPDATE_REGISTRY_RECORD_OUTPUT.members["name"], self.name - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_REGISTRY_RECORD_OUTPUT.members["description"], - self.description, - ) - - serializer.write_string( - _SCHEMA_UPDATE_REGISTRY_RECORD_OUTPUT.members["descriptorType"], - self.descriptor_type, - ) - serializer.write_struct( - _SCHEMA_UPDATE_REGISTRY_RECORD_OUTPUT.members["descriptors"], - self.descriptors, - ) - if self.record_version is not None: - serializer.write_string( - _SCHEMA_UPDATE_REGISTRY_RECORD_OUTPUT.members["recordVersion"], - self.record_version, - ) - - serializer.write_string( - _SCHEMA_UPDATE_REGISTRY_RECORD_OUTPUT.members["status"], self.status - ) - serializer.write_timestamp( - _SCHEMA_UPDATE_REGISTRY_RECORD_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_UPDATE_REGISTRY_RECORD_OUTPUT.members["updatedAt"], self.updated_at - ) - if self.status_reason is not None: - serializer.write_string( - _SCHEMA_UPDATE_REGISTRY_RECORD_OUTPUT.members["statusReason"], - self.status_reason, - ) - - if self.synchronization_type is not None: - serializer.write_string( - _SCHEMA_UPDATE_REGISTRY_RECORD_OUTPUT.members["synchronizationType"], - self.synchronization_type, - ) - - if self.synchronization_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_REGISTRY_RECORD_OUTPUT.members[ - "synchronizationConfiguration" - ], - self.synchronization_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["registry_arn"] = de.read_string( - _SCHEMA_UPDATE_REGISTRY_RECORD_OUTPUT.members["registryArn"] - ) - - case 1: - kwargs["record_arn"] = de.read_string( - _SCHEMA_UPDATE_REGISTRY_RECORD_OUTPUT.members["recordArn"] - ) - - case 2: - kwargs["record_id"] = de.read_string( - _SCHEMA_UPDATE_REGISTRY_RECORD_OUTPUT.members["recordId"] - ) - - case 3: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_REGISTRY_RECORD_OUTPUT.members["name"] - ) - - case 4: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_REGISTRY_RECORD_OUTPUT.members["description"] - ) - - case 5: - kwargs["descriptor_type"] = DescriptorType( - de.read_string( - _SCHEMA_UPDATE_REGISTRY_RECORD_OUTPUT.members[ - "descriptorType" - ] - ) - ) - - case 6: - kwargs["descriptors"] = Descriptors.deserialize(de) - - case 7: - kwargs["record_version"] = de.read_string( - _SCHEMA_UPDATE_REGISTRY_RECORD_OUTPUT.members["recordVersion"] - ) - - case 8: - kwargs["status"] = RegistryRecordStatus( - de.read_string( - _SCHEMA_UPDATE_REGISTRY_RECORD_OUTPUT.members["status"] - ) - ) - - case 9: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_UPDATE_REGISTRY_RECORD_OUTPUT.members["createdAt"] - ) - - case 10: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_UPDATE_REGISTRY_RECORD_OUTPUT.members["updatedAt"] - ) - - case 11: - kwargs["status_reason"] = de.read_string( - _SCHEMA_UPDATE_REGISTRY_RECORD_OUTPUT.members["statusReason"] - ) - - case 12: - kwargs["synchronization_type"] = SynchronizationType( - de.read_string( - _SCHEMA_UPDATE_REGISTRY_RECORD_OUTPUT.members[ - "synchronizationType" - ] - ) - ) - - case 13: - kwargs["synchronization_configuration"] = ( - SynchronizationConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_REGISTRY_RECORD_OUTPUT, consumer=_consumer - ) - if "registry_arn" not in kwargs: - kwargs["registry_arn"] = "" - if "record_arn" not in kwargs: - kwargs["record_arn"] = "" - if "record_id" not in kwargs: - kwargs["record_id"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "descriptor_type" not in kwargs: - kwargs["descriptor_type"] = DescriptorType._corrected("") - if "descriptors" not in kwargs: - kwargs["descriptors"] = Descriptors._smithy_default() - if "status" not in kwargs: - kwargs["status"] = RegistryRecordStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -UPDATE_REGISTRY_RECORD = APIOperation( - input=UpdateRegistryRecordInput, - output=UpdateRegistryRecordOutput, - schema=_SCHEMA_UPDATE_REGISTRY_RECORD, - input_schema=_SCHEMA_UPDATE_REGISTRY_RECORD_INPUT, - output_schema=_SCHEMA_UPDATE_REGISTRY_RECORD_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateRegistryRecordStatusInput: - """Dataclass for UpdateRegistryRecordStatusInput structure.""" - - registry_id: str | None = None - """ - The identifier of the registry containing the record. You can specify - either the Amazon Resource Name (ARN) or the ID of the registry. - """ - - record_id: str | None = None - """ - The identifier of the registry record to update the status for. You can - specify either the Amazon Resource Name (ARN) or the ID of the record. - """ - - status: str | None = None - """The target status for the registry record.""" - - status_reason: str | None = None - """ - The reason for the status change, such as why the record was approved or - rejected. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_REGISTRY_RECORD_STATUS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.registry_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_REGISTRY_RECORD_STATUS_INPUT.members["registryId"], - self.registry_id, - ) - - if self.record_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_REGISTRY_RECORD_STATUS_INPUT.members["recordId"], - self.record_id, - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_UPDATE_REGISTRY_RECORD_STATUS_INPUT.members["status"], - self.status, - ) - - if self.status_reason is not None: - serializer.write_string( - _SCHEMA_UPDATE_REGISTRY_RECORD_STATUS_INPUT.members["statusReason"], - self.status_reason, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["registry_id"] = de.read_string( - _SCHEMA_UPDATE_REGISTRY_RECORD_STATUS_INPUT.members[ - "registryId" - ] - ) - - case 1: - kwargs["record_id"] = de.read_string( - _SCHEMA_UPDATE_REGISTRY_RECORD_STATUS_INPUT.members["recordId"] - ) - - case 2: - kwargs["status"] = RegistryRecordStatus( - de.read_string( - _SCHEMA_UPDATE_REGISTRY_RECORD_STATUS_INPUT.members[ - "status" - ] - ) - ) - - case 3: - kwargs["status_reason"] = de.read_string( - _SCHEMA_UPDATE_REGISTRY_RECORD_STATUS_INPUT.members[ - "statusReason" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_REGISTRY_RECORD_STATUS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateRegistryRecordStatusOutput: - """Dataclass for UpdateRegistryRecordStatusOutput structure.""" - - registry_arn: str - """The Amazon Resource Name (ARN) of the registry that contains the record.""" - - record_arn: str - """The Amazon Resource Name (ARN) of the registry record.""" - - record_id: str - """The unique identifier of the registry record.""" - - status: str - """The resulting status of the registry record.""" - - status_reason: str - """The reason for the status change.""" - - updated_at: datetime - """The timestamp when the record was last updated.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_REGISTRY_RECORD_STATUS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_UPDATE_REGISTRY_RECORD_STATUS_OUTPUT.members["registryArn"], - self.registry_arn, - ) - serializer.write_string( - _SCHEMA_UPDATE_REGISTRY_RECORD_STATUS_OUTPUT.members["recordArn"], - self.record_arn, - ) - serializer.write_string( - _SCHEMA_UPDATE_REGISTRY_RECORD_STATUS_OUTPUT.members["recordId"], - self.record_id, - ) - serializer.write_string( - _SCHEMA_UPDATE_REGISTRY_RECORD_STATUS_OUTPUT.members["status"], self.status - ) - serializer.write_string( - _SCHEMA_UPDATE_REGISTRY_RECORD_STATUS_OUTPUT.members["statusReason"], - self.status_reason, - ) - serializer.write_timestamp( - _SCHEMA_UPDATE_REGISTRY_RECORD_STATUS_OUTPUT.members["updatedAt"], - self.updated_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["registry_arn"] = de.read_string( - _SCHEMA_UPDATE_REGISTRY_RECORD_STATUS_OUTPUT.members[ - "registryArn" - ] - ) - - case 1: - kwargs["record_arn"] = de.read_string( - _SCHEMA_UPDATE_REGISTRY_RECORD_STATUS_OUTPUT.members[ - "recordArn" - ] - ) - - case 2: - kwargs["record_id"] = de.read_string( - _SCHEMA_UPDATE_REGISTRY_RECORD_STATUS_OUTPUT.members["recordId"] - ) - - case 3: - kwargs["status"] = RegistryRecordStatus( - de.read_string( - _SCHEMA_UPDATE_REGISTRY_RECORD_STATUS_OUTPUT.members[ - "status" - ] - ) - ) - - case 4: - kwargs["status_reason"] = de.read_string( - _SCHEMA_UPDATE_REGISTRY_RECORD_STATUS_OUTPUT.members[ - "statusReason" - ] - ) - - case 5: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_UPDATE_REGISTRY_RECORD_STATUS_OUTPUT.members[ - "updatedAt" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_REGISTRY_RECORD_STATUS_OUTPUT, consumer=_consumer - ) - if "registry_arn" not in kwargs: - kwargs["registry_arn"] = "" - if "record_arn" not in kwargs: - kwargs["record_arn"] = "" - if "record_id" not in kwargs: - kwargs["record_id"] = "" - if "status" not in kwargs: - kwargs["status"] = RegistryRecordStatus._corrected("") - if "status_reason" not in kwargs: - kwargs["status_reason"] = "" - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -UPDATE_REGISTRY_RECORD_STATUS = APIOperation( - input=UpdateRegistryRecordStatusInput, - output=UpdateRegistryRecordStatusOutput, - schema=_SCHEMA_UPDATE_REGISTRY_RECORD_STATUS, - input_schema=_SCHEMA_UPDATE_REGISTRY_RECORD_STATUS_INPUT, - output_schema=_SCHEMA_UPDATE_REGISTRY_RECORD_STATUS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ApprovalConfiguration: - """ - Configuration for the registry record approval workflow. Controls - whether records added to the registry require explicit approval before - becoming active. - """ - - auto_approval: bool = False - """ - Whether registry records are auto-approved. When set to `true`, records - are automatically approved upon creation. When set to `false` (the - default), records require explicit approval for security purposes. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_APPROVAL_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_boolean( - _SCHEMA_APPROVAL_CONFIGURATION.members["autoApproval"], self.auto_approval - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["auto_approval"] = de.read_boolean( - _SCHEMA_APPROVAL_CONFIGURATION.members["autoApproval"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_APPROVAL_CONFIGURATION, consumer=_consumer) - return kwargs - - -class RegistryAuthorizerType(UnknownEnumMixin, StrEnum): - CUSTOM_JWT = "CUSTOM_JWT" - AWS_IAM = "AWS_IAM" - - -@dataclass(kw_only=True) -class CreateRegistryInput: - """Dataclass for CreateRegistryInput structure.""" - - name: str | None = None - """ - The name of the registry. The name must be unique within your account - and can contain alphanumeric characters and underscores. - """ - - description: str | None = field(repr=False, default=None) - """A description of the registry.""" - - authorizer_type: str | None = None - """ - The type of authorizer to use for the registry. This controls the - authorization method for the Search and Invoke APIs used by consumers, - and does not affect the standard CRUDL APIs for registry and registry - record management used by administrators. - - - `CUSTOM_JWT` - Authorize with a bearer token. - - - `AWS_IAM` - Authorize with your Amazon Web Services IAM credentials. - """ - - authorizer_configuration: AuthorizerConfiguration | None = None - """ - The authorizer configuration for the registry. Required if - `authorizerType` is `CUSTOM_JWT`. For details, see the - `AuthorizerConfiguration` data type. - """ - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If you don't specify this field, a - value is randomly generated for you. If this token matches a previous - request, the service ignores the request, but doesn't return an error. - For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - approval_configuration: ApprovalConfiguration | None = None - """ - The approval configuration for registry records. Controls whether - records require explicit approval before becoming active. See the - `ApprovalConfiguration` data type for supported configuration options. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_REGISTRY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_REGISTRY_INPUT.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_REGISTRY_INPUT.members["description"], self.description - ) - - if self.authorizer_type is not None: - serializer.write_string( - _SCHEMA_CREATE_REGISTRY_INPUT.members["authorizerType"], - self.authorizer_type, - ) - - if self.authorizer_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_REGISTRY_INPUT.members["authorizerConfiguration"], - self.authorizer_configuration, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_REGISTRY_INPUT.members["clientToken"], self.client_token - ) - - if self.approval_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_REGISTRY_INPUT.members["approvalConfiguration"], - self.approval_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_REGISTRY_INPUT.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_REGISTRY_INPUT.members["description"] - ) - - case 2: - kwargs["authorizer_type"] = RegistryAuthorizerType( - de.read_string( - _SCHEMA_CREATE_REGISTRY_INPUT.members["authorizerType"] - ) - ) - - case 3: - kwargs["authorizer_configuration"] = ( - _AuthorizerConfigurationDeserializer().deserialize(de) - ) - - case 4: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_REGISTRY_INPUT.members["clientToken"] - ) - - case 5: - kwargs["approval_configuration"] = ( - ApprovalConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_REGISTRY_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CreateRegistryOutput: - """Dataclass for CreateRegistryOutput structure.""" - - registry_arn: str - """The Amazon Resource Name (ARN) of the created registry.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_REGISTRY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_REGISTRY_OUTPUT.members["registryArn"], self.registry_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["registry_arn"] = de.read_string( - _SCHEMA_CREATE_REGISTRY_OUTPUT.members["registryArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_REGISTRY_OUTPUT, consumer=_consumer) - if "registry_arn" not in kwargs: - kwargs["registry_arn"] = "" - return kwargs - - -CREATE_REGISTRY = APIOperation( - input=CreateRegistryInput, - output=CreateRegistryOutput, - schema=_SCHEMA_CREATE_REGISTRY, - input_schema=_SCHEMA_CREATE_REGISTRY_INPUT, - output_schema=_SCHEMA_CREATE_REGISTRY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteRegistryInput: - """Dataclass for DeleteRegistryInput structure.""" - - registry_id: str | None = None - """ - The identifier of the registry to delete. You can specify either the - Amazon Resource Name (ARN) or the ID of the registry. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_REGISTRY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.registry_id is not None: - serializer.write_string( - _SCHEMA_DELETE_REGISTRY_INPUT.members["registryId"], self.registry_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["registry_id"] = de.read_string( - _SCHEMA_DELETE_REGISTRY_INPUT.members["registryId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_REGISTRY_INPUT, consumer=_consumer) - return kwargs - - -class RegistryStatus(UnknownEnumMixin, StrEnum): - CREATING = "CREATING" - READY = "READY" - UPDATING = "UPDATING" - CREATE_FAILED = "CREATE_FAILED" - UPDATE_FAILED = "UPDATE_FAILED" - DELETING = "DELETING" - DELETE_FAILED = "DELETE_FAILED" - - -@dataclass(kw_only=True) -class DeleteRegistryOutput: - """Dataclass for DeleteRegistryOutput structure.""" - - status: str - """ - The current status of the registry, set to `DELETING` when deletion is - initiated. For a list of all possible registry statuses, see the - `RegistryStatus` data type. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_REGISTRY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DELETE_REGISTRY_OUTPUT.members["status"], self.status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["status"] = RegistryStatus( - de.read_string(_SCHEMA_DELETE_REGISTRY_OUTPUT.members["status"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_REGISTRY_OUTPUT, consumer=_consumer) - if "status" not in kwargs: - kwargs["status"] = RegistryStatus._corrected("") - return kwargs - - -DELETE_REGISTRY = APIOperation( - input=DeleteRegistryInput, - output=DeleteRegistryOutput, - schema=_SCHEMA_DELETE_REGISTRY, - input_schema=_SCHEMA_DELETE_REGISTRY_INPUT, - output_schema=_SCHEMA_DELETE_REGISTRY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetRegistryInput: - """Dataclass for GetRegistryInput structure.""" - - registry_id: str | None = None - """ - The identifier of the registry to retrieve. You can specify either the - Amazon Resource Name (ARN) or the ID of the registry. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_REGISTRY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.registry_id is not None: - serializer.write_string( - _SCHEMA_GET_REGISTRY_INPUT.members["registryId"], self.registry_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["registry_id"] = de.read_string( - _SCHEMA_GET_REGISTRY_INPUT.members["registryId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_REGISTRY_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetRegistryOutput: - """Dataclass for GetRegistryOutput structure.""" - - name: str - """The name of the registry.""" - - registry_id: str - """The unique identifier of the registry.""" - - registry_arn: str - """The Amazon Resource Name (ARN) of the registry.""" - - status: str - """ - The current status of the registry. Possible values include `CREATING`, - `READY`, `UPDATING`, `CREATE_FAILED`, `UPDATE_FAILED`, `DELETING`, and - `DELETE_FAILED`. - """ - - created_at: datetime - """The timestamp when the registry was created.""" - - updated_at: datetime - """The timestamp when the registry was last updated.""" - - description: str | None = field(repr=False, default=None) - """The description of the registry.""" - - authorizer_type: str | None = None - """ - The type of authorizer used by the registry. This controls the - authorization method for the Search and Invoke APIs used by consumers. - - - `CUSTOM_JWT` - Authorize with a bearer token. - - - `AWS_IAM` - Authorize with your Amazon Web Services IAM credentials. - """ - - authorizer_configuration: AuthorizerConfiguration | None = None - """ - The authorizer configuration for the registry. For details, see the - `AuthorizerConfiguration` data type. - """ - - approval_configuration: ApprovalConfiguration | None = None - """ - The approval configuration for registry records. For details, see the - `ApprovalConfiguration` data type. - """ - - status_reason: str | None = None - """ - The reason for the current status, typically set when the status is a - failure state. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_REGISTRY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_GET_REGISTRY_OUTPUT.members["name"], self.name) - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_REGISTRY_OUTPUT.members["description"], self.description - ) - - serializer.write_string( - _SCHEMA_GET_REGISTRY_OUTPUT.members["registryId"], self.registry_id - ) - serializer.write_string( - _SCHEMA_GET_REGISTRY_OUTPUT.members["registryArn"], self.registry_arn - ) - if self.authorizer_type is not None: - serializer.write_string( - _SCHEMA_GET_REGISTRY_OUTPUT.members["authorizerType"], - self.authorizer_type, - ) - - if self.authorizer_configuration is not None: - serializer.write_struct( - _SCHEMA_GET_REGISTRY_OUTPUT.members["authorizerConfiguration"], - self.authorizer_configuration, - ) - - if self.approval_configuration is not None: - serializer.write_struct( - _SCHEMA_GET_REGISTRY_OUTPUT.members["approvalConfiguration"], - self.approval_configuration, - ) - - serializer.write_string( - _SCHEMA_GET_REGISTRY_OUTPUT.members["status"], self.status - ) - if self.status_reason is not None: - serializer.write_string( - _SCHEMA_GET_REGISTRY_OUTPUT.members["statusReason"], self.status_reason - ) - - serializer.write_timestamp( - _SCHEMA_GET_REGISTRY_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_GET_REGISTRY_OUTPUT.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_GET_REGISTRY_OUTPUT.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_GET_REGISTRY_OUTPUT.members["description"] - ) - - case 2: - kwargs["registry_id"] = de.read_string( - _SCHEMA_GET_REGISTRY_OUTPUT.members["registryId"] - ) - - case 3: - kwargs["registry_arn"] = de.read_string( - _SCHEMA_GET_REGISTRY_OUTPUT.members["registryArn"] - ) - - case 4: - kwargs["authorizer_type"] = RegistryAuthorizerType( - de.read_string( - _SCHEMA_GET_REGISTRY_OUTPUT.members["authorizerType"] - ) - ) - - case 5: - kwargs["authorizer_configuration"] = ( - _AuthorizerConfigurationDeserializer().deserialize(de) - ) - - case 6: - kwargs["approval_configuration"] = ( - ApprovalConfiguration.deserialize(de) - ) - - case 7: - kwargs["status"] = RegistryStatus( - de.read_string(_SCHEMA_GET_REGISTRY_OUTPUT.members["status"]) - ) - - case 8: - kwargs["status_reason"] = de.read_string( - _SCHEMA_GET_REGISTRY_OUTPUT.members["statusReason"] - ) - - case 9: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_REGISTRY_OUTPUT.members["createdAt"] - ) - - case 10: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_GET_REGISTRY_OUTPUT.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_REGISTRY_OUTPUT, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "registry_id" not in kwargs: - kwargs["registry_id"] = "" - if "registry_arn" not in kwargs: - kwargs["registry_arn"] = "" - if "status" not in kwargs: - kwargs["status"] = RegistryStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -GET_REGISTRY = APIOperation( - input=GetRegistryInput, - output=GetRegistryOutput, - schema=_SCHEMA_GET_REGISTRY, - input_schema=_SCHEMA_GET_REGISTRY_INPUT, - output_schema=_SCHEMA_GET_REGISTRY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListRegistriesInput: - """Dataclass for ListRegistriesInput structure.""" - - max_results: int | None = None - """ - The maximum number of results to return in the response. If the total - number of results is greater than this value, use the token returned in - the response in the `nextToken` field when making another request to - return the next batch of results. - """ - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, enter the token returned in the `nextToken` - field in the response in this field to return the next batch of results. - """ - - status: str | None = None - """ - Filter registries by their current status. Possible values include - `CREATING`, `READY`, `UPDATING`, `CREATE_FAILED`, `UPDATE_FAILED`, - `DELETING`, and `DELETE_FAILED`. - """ - - authorizer_type: str | None = None - """ - Filter registries by their authorizer type. Possible values are - `CUSTOM_JWT` and `AWS_IAM`. For more information about authorizer types, - see the `RegistryAuthorizerType` enum. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_REGISTRIES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_REGISTRIES_INPUT.members["maxResults"], self.max_results - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_REGISTRIES_INPUT.members["nextToken"], self.next_token - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_LIST_REGISTRIES_INPUT.members["status"], self.status - ) - - if self.authorizer_type is not None: - serializer.write_string( - _SCHEMA_LIST_REGISTRIES_INPUT.members["authorizerType"], - self.authorizer_type, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_REGISTRIES_INPUT.members["maxResults"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_REGISTRIES_INPUT.members["nextToken"] - ) - - case 2: - kwargs["status"] = RegistryStatus( - de.read_string(_SCHEMA_LIST_REGISTRIES_INPUT.members["status"]) - ) - - case 3: - kwargs["authorizer_type"] = RegistryAuthorizerType( - de.read_string( - _SCHEMA_LIST_REGISTRIES_INPUT.members["authorizerType"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_REGISTRIES_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class RegistrySummary: - """Contains summary information about a registry.""" - - name: str - """The name of the registry.""" - - registry_id: str - """The unique identifier of the registry.""" - - registry_arn: str - """The Amazon Resource Name (ARN) of the registry.""" - - status: str - """ - The current status of the registry. Possible values include `CREATING`, - `READY`, `UPDATING`, `CREATE_FAILED`, `UPDATE_FAILED`, `DELETING`, and - `DELETE_FAILED`. - """ - - created_at: datetime - """The timestamp when the registry was created.""" - - updated_at: datetime - """The timestamp when the registry was last updated.""" - - description: str | None = field(repr=False, default=None) - """The description of the registry.""" - - authorizer_type: str | None = None - """ - The type of authorizer used by the registry. This controls the - authorization method for the Search and Invoke APIs used by consumers. - - - `CUSTOM_JWT` - Authorize with a bearer token. - - - `AWS_IAM` - Authorize with your Amazon Web Services IAM credentials. - """ - - status_reason: str | None = None - """ - The reason for the current status, typically set when the status is a - failure state. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REGISTRY_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_REGISTRY_SUMMARY.members["name"], self.name) - if self.description is not None: - serializer.write_string( - _SCHEMA_REGISTRY_SUMMARY.members["description"], self.description - ) - - serializer.write_string( - _SCHEMA_REGISTRY_SUMMARY.members["registryId"], self.registry_id - ) - serializer.write_string( - _SCHEMA_REGISTRY_SUMMARY.members["registryArn"], self.registry_arn - ) - if self.authorizer_type is not None: - serializer.write_string( - _SCHEMA_REGISTRY_SUMMARY.members["authorizerType"], self.authorizer_type - ) - - serializer.write_string(_SCHEMA_REGISTRY_SUMMARY.members["status"], self.status) - if self.status_reason is not None: - serializer.write_string( - _SCHEMA_REGISTRY_SUMMARY.members["statusReason"], self.status_reason - ) - - serializer.write_timestamp( - _SCHEMA_REGISTRY_SUMMARY.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_REGISTRY_SUMMARY.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_REGISTRY_SUMMARY.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_REGISTRY_SUMMARY.members["description"] - ) - - case 2: - kwargs["registry_id"] = de.read_string( - _SCHEMA_REGISTRY_SUMMARY.members["registryId"] - ) - - case 3: - kwargs["registry_arn"] = de.read_string( - _SCHEMA_REGISTRY_SUMMARY.members["registryArn"] - ) - - case 4: - kwargs["authorizer_type"] = RegistryAuthorizerType( - de.read_string( - _SCHEMA_REGISTRY_SUMMARY.members["authorizerType"] - ) - ) - - case 5: - kwargs["status"] = RegistryStatus( - de.read_string(_SCHEMA_REGISTRY_SUMMARY.members["status"]) - ) - - case 6: - kwargs["status_reason"] = de.read_string( - _SCHEMA_REGISTRY_SUMMARY.members["statusReason"] - ) - - case 7: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_REGISTRY_SUMMARY.members["createdAt"] - ) - - case 8: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_REGISTRY_SUMMARY.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_REGISTRY_SUMMARY, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "registry_id" not in kwargs: - kwargs["registry_id"] = "" - if "registry_arn" not in kwargs: - kwargs["registry_arn"] = "" - if "status" not in kwargs: - kwargs["status"] = RegistryStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_registry_summary_list( - serializer: ShapeSerializer, schema: Schema, value: list[RegistrySummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_registry_summary_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[RegistrySummary]: - result: list[RegistrySummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(RegistrySummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListRegistriesOutput: - """Dataclass for ListRegistriesOutput structure.""" - - registries: list[RegistrySummary] - """ - The list of registry summaries. For details about the fields in each - summary, see the `RegistrySummary` data type. - """ - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, use this token when making another request in - the `nextToken` field to return the next batch of results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_REGISTRIES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_registry_summary_list( - serializer, - _SCHEMA_LIST_REGISTRIES_OUTPUT.members["registries"], - self.registries, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_REGISTRIES_OUTPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["registries"] = _deserialize_registry_summary_list( - de, _SCHEMA_LIST_REGISTRIES_OUTPUT.members["registries"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_REGISTRIES_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_REGISTRIES_OUTPUT, consumer=_consumer) - if "registries" not in kwargs: - kwargs["registries"] = [] - return kwargs - - -LIST_REGISTRIES = APIOperation( - input=ListRegistriesInput, - output=ListRegistriesOutput, - schema=_SCHEMA_LIST_REGISTRIES, - input_schema=_SCHEMA_LIST_REGISTRIES_INPUT, - output_schema=_SCHEMA_LIST_REGISTRIES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdatedApprovalConfiguration: - """ - Wrapper for updating an optional approval configuration field with PATCH - semantics. When present in an update request, the approval configuration - is replaced with the provided value. When absent, the approval - configuration is left unchanged. - """ - - optional_value: ApprovalConfiguration | None = None - """ - The updated approval configuration value. Set to `null` to unset the - approval configuration. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATED_APPROVAL_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.optional_value is not None: - serializer.write_struct( - _SCHEMA_UPDATED_APPROVAL_CONFIGURATION.members["optionalValue"], - self.optional_value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["optional_value"] = ApprovalConfiguration.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATED_APPROVAL_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateRegistryInput: - """Dataclass for UpdateRegistryInput structure.""" - - registry_id: str | None = None - """ - The identifier of the registry to update. You can specify either the - Amazon Resource Name (ARN) or the ID of the registry. - """ - - name: str | None = None - """The updated name of the registry.""" - - description: UpdatedDescription | None = None - """ - The updated description of the registry. To clear the description, - include the `UpdatedDescription` wrapper with `optionalValue` not - specified. - """ - - authorizer_configuration: UpdatedAuthorizerConfiguration | None = None - """ - The updated authorizer configuration for the registry. Changing the - authorizer configuration can break existing consumers of the registry - who are using the authorization type prior to the update. - """ - - approval_configuration: UpdatedApprovalConfiguration | None = None - """ - The updated approval configuration for registry records. The updated - configuration only affects new records that move to `PENDING_APPROVAL` - status after the change. Existing records already in `PENDING_APPROVAL` - status are not affected. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_REGISTRY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.registry_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_REGISTRY_INPUT.members["registryId"], self.registry_id - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_UPDATE_REGISTRY_INPUT.members["name"], self.name - ) - - if self.description is not None: - serializer.write_struct( - _SCHEMA_UPDATE_REGISTRY_INPUT.members["description"], self.description - ) - - if self.authorizer_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_REGISTRY_INPUT.members["authorizerConfiguration"], - self.authorizer_configuration, - ) - - if self.approval_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_REGISTRY_INPUT.members["approvalConfiguration"], - self.approval_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["registry_id"] = de.read_string( - _SCHEMA_UPDATE_REGISTRY_INPUT.members["registryId"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_REGISTRY_INPUT.members["name"] - ) - - case 2: - kwargs["description"] = UpdatedDescription.deserialize(de) - - case 3: - kwargs["authorizer_configuration"] = ( - UpdatedAuthorizerConfiguration.deserialize(de) - ) - - case 4: - kwargs["approval_configuration"] = ( - UpdatedApprovalConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_REGISTRY_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateRegistryOutput: - """Dataclass for UpdateRegistryOutput structure.""" - - name: str - """The name of the updated registry.""" - - registry_id: str - """The unique identifier of the updated registry.""" - - registry_arn: str - """The Amazon Resource Name (ARN) of the updated registry.""" - - status: str - """ - The current status of the updated registry. Possible values include - `CREATING`, `READY`, `UPDATING`, `CREATE_FAILED`, `UPDATE_FAILED`, - `DELETING`, and `DELETE_FAILED`. - """ - - created_at: datetime - """The timestamp when the registry was created.""" - - updated_at: datetime - """The timestamp when the registry was last updated.""" - - description: str | None = field(repr=False, default=None) - """The description of the updated registry.""" - - authorizer_type: str | None = None - """ - The type of authorizer used by the updated registry. This controls the - authorization method for the Search and Invoke APIs used by consumers. - - - `CUSTOM_JWT` - Authorize with a bearer token. - - - `AWS_IAM` - Authorize with your Amazon Web Services IAM credentials. - """ - - authorizer_configuration: AuthorizerConfiguration | None = None - """ - The authorizer configuration for the updated registry. For details, see - the `AuthorizerConfiguration` data type. - """ - - approval_configuration: ApprovalConfiguration | None = None - """ - The approval configuration for the updated registry. For details, see - the `ApprovalConfiguration` data type. - """ - - status_reason: str | None = None - """The reason for the current status of the updated registry.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_REGISTRY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_UPDATE_REGISTRY_OUTPUT.members["name"], self.name - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_REGISTRY_OUTPUT.members["description"], self.description - ) - - serializer.write_string( - _SCHEMA_UPDATE_REGISTRY_OUTPUT.members["registryId"], self.registry_id - ) - serializer.write_string( - _SCHEMA_UPDATE_REGISTRY_OUTPUT.members["registryArn"], self.registry_arn - ) - if self.authorizer_type is not None: - serializer.write_string( - _SCHEMA_UPDATE_REGISTRY_OUTPUT.members["authorizerType"], - self.authorizer_type, - ) - - if self.authorizer_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_REGISTRY_OUTPUT.members["authorizerConfiguration"], - self.authorizer_configuration, - ) - - if self.approval_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_REGISTRY_OUTPUT.members["approvalConfiguration"], - self.approval_configuration, - ) - - serializer.write_string( - _SCHEMA_UPDATE_REGISTRY_OUTPUT.members["status"], self.status - ) - if self.status_reason is not None: - serializer.write_string( - _SCHEMA_UPDATE_REGISTRY_OUTPUT.members["statusReason"], - self.status_reason, - ) - - serializer.write_timestamp( - _SCHEMA_UPDATE_REGISTRY_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_UPDATE_REGISTRY_OUTPUT.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_REGISTRY_OUTPUT.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_REGISTRY_OUTPUT.members["description"] - ) - - case 2: - kwargs["registry_id"] = de.read_string( - _SCHEMA_UPDATE_REGISTRY_OUTPUT.members["registryId"] - ) - - case 3: - kwargs["registry_arn"] = de.read_string( - _SCHEMA_UPDATE_REGISTRY_OUTPUT.members["registryArn"] - ) - - case 4: - kwargs["authorizer_type"] = RegistryAuthorizerType( - de.read_string( - _SCHEMA_UPDATE_REGISTRY_OUTPUT.members["authorizerType"] - ) - ) - - case 5: - kwargs["authorizer_configuration"] = ( - _AuthorizerConfigurationDeserializer().deserialize(de) - ) - - case 6: - kwargs["approval_configuration"] = ( - ApprovalConfiguration.deserialize(de) - ) - - case 7: - kwargs["status"] = RegistryStatus( - de.read_string(_SCHEMA_UPDATE_REGISTRY_OUTPUT.members["status"]) - ) - - case 8: - kwargs["status_reason"] = de.read_string( - _SCHEMA_UPDATE_REGISTRY_OUTPUT.members["statusReason"] - ) - - case 9: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_UPDATE_REGISTRY_OUTPUT.members["createdAt"] - ) - - case 10: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_UPDATE_REGISTRY_OUTPUT.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_REGISTRY_OUTPUT, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "registry_id" not in kwargs: - kwargs["registry_id"] = "" - if "registry_arn" not in kwargs: - kwargs["registry_arn"] = "" - if "status" not in kwargs: - kwargs["status"] = RegistryStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -UPDATE_REGISTRY = APIOperation( - input=UpdateRegistryInput, - output=UpdateRegistryOutput, - schema=_SCHEMA_UPDATE_REGISTRY, - input_schema=_SCHEMA_UPDATE_REGISTRY_INPUT, - output_schema=_SCHEMA_UPDATE_REGISTRY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ConcurrentModificationException(ServiceError): - """ - Exception thrown when a resource is modified concurrently by multiple - requests. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONCURRENT_MODIFICATION_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CONCURRENT_MODIFICATION_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_CONCURRENT_MODIFICATION_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CONCURRENT_MODIFICATION_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class SetTokenVaultCMKInput: - """Dataclass for SetTokenVaultCMKInput structure.""" - - token_vault_id: str | None = None - """The unique identifier of the token vault to update.""" - - kms_configuration: KmsConfiguration | None = None - """ - The KMS configuration for the token vault, including the key type and - KMS key ARN. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SET_TOKEN_VAULT_CMK_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.token_vault_id is not None: - serializer.write_string( - _SCHEMA_SET_TOKEN_VAULT_CMK_INPUT.members["tokenVaultId"], - self.token_vault_id, - ) - - if self.kms_configuration is not None: - serializer.write_struct( - _SCHEMA_SET_TOKEN_VAULT_CMK_INPUT.members["kmsConfiguration"], - self.kms_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["token_vault_id"] = de.read_string( - _SCHEMA_SET_TOKEN_VAULT_CMK_INPUT.members["tokenVaultId"] - ) - - case 1: - kwargs["kms_configuration"] = KmsConfiguration.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SET_TOKEN_VAULT_CMK_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class SetTokenVaultCMKOutput: - """Dataclass for SetTokenVaultCMKOutput structure.""" - - token_vault_id: str - """The ID of the token vault.""" - - kms_configuration: KmsConfiguration - """The KMS configuration for the token vault.""" - - last_modified_date: datetime - """The timestamp when the token vault was last modified.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SET_TOKEN_VAULT_CMK_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SET_TOKEN_VAULT_CMK_OUTPUT.members["tokenVaultId"], - self.token_vault_id, - ) - serializer.write_struct( - _SCHEMA_SET_TOKEN_VAULT_CMK_OUTPUT.members["kmsConfiguration"], - self.kms_configuration, - ) - serializer.write_timestamp( - _SCHEMA_SET_TOKEN_VAULT_CMK_OUTPUT.members["lastModifiedDate"], - self.last_modified_date, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["token_vault_id"] = de.read_string( - _SCHEMA_SET_TOKEN_VAULT_CMK_OUTPUT.members["tokenVaultId"] - ) - - case 1: - kwargs["kms_configuration"] = KmsConfiguration.deserialize(de) - - case 2: - kwargs["last_modified_date"] = de.read_timestamp( - _SCHEMA_SET_TOKEN_VAULT_CMK_OUTPUT.members["lastModifiedDate"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SET_TOKEN_VAULT_CMK_OUTPUT, consumer=_consumer) - if "token_vault_id" not in kwargs: - kwargs["token_vault_id"] = "" - if "kms_configuration" not in kwargs: - kwargs["kms_configuration"] = KmsConfiguration._smithy_default() - if "last_modified_date" not in kwargs: - kwargs["last_modified_date"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -SET_TOKEN_VAULT_CMK = APIOperation( - input=SetTokenVaultCMKInput, - output=SetTokenVaultCMKOutput, - schema=_SCHEMA_SET_TOKEN_VAULT_CMK, - input_schema=_SCHEMA_SET_TOKEN_VAULT_CMK_INPUT, - output_schema=_SCHEMA_SET_TOKEN_VAULT_CMK_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConcurrentModificationException" - ): ConcurrentModificationException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#UnauthorizedException" - ): UnauthorizedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONCURRENT_MODIFICATION_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class TagResourceInput: - """Dataclass for TagResourceInput structure.""" - - resource_arn: str | None = None - """The Amazon Resource Name (ARN) of the resource that you want to tag.""" - - tags: dict[str, str] | None = None - """The tags to add to the resource. A tag is a key-value pair.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TAG_RESOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_TAG_RESOURCE_INPUT.members["resourceArn"], self.resource_arn - ) - - if self.tags is not None: - _serialize_tags_map( - serializer, _SCHEMA_TAG_RESOURCE_INPUT.members["tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_TAG_RESOURCE_INPUT.members["resourceArn"] - ) - - case 1: - kwargs["tags"] = _deserialize_tags_map( - de, _SCHEMA_TAG_RESOURCE_INPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TAG_RESOURCE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class TagResourceOutput: - """Dataclass for TagResourceOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TAG_RESOURCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TAG_RESOURCE_OUTPUT, consumer=_consumer) - return kwargs - - -TAG_RESOURCE = APIOperation( - input=TagResourceInput, - output=TagResourceOutput, - schema=_SCHEMA_TAG_RESOURCE, - input_schema=_SCHEMA_TAG_RESOURCE_INPUT, - output_schema=_SCHEMA_TAG_RESOURCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -def _serialize_tag_key_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_tag_key_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class UntagResourceInput: - """Dataclass for UntagResourceInput structure.""" - - resource_arn: str | None = None - """The Amazon Resource Name (ARN) of the resource that you want to untag.""" - - tag_keys: list[str] | None = None - """The tag keys of the tags to remove from the resource.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNTAG_RESOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_UNTAG_RESOURCE_INPUT.members["resourceArn"], self.resource_arn - ) - - if self.tag_keys is not None: - _serialize_tag_key_list( - serializer, - _SCHEMA_UNTAG_RESOURCE_INPUT.members["tagKeys"], - self.tag_keys, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_UNTAG_RESOURCE_INPUT.members["resourceArn"] - ) - - case 1: - kwargs["tag_keys"] = _deserialize_tag_key_list( - de, _SCHEMA_UNTAG_RESOURCE_INPUT.members["tagKeys"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UNTAG_RESOURCE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UntagResourceOutput: - """Dataclass for UntagResourceOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNTAG_RESOURCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UNTAG_RESOURCE_OUTPUT, consumer=_consumer) - return kwargs - - -UNTAG_RESOURCE = APIOperation( - input=UntagResourceInput, - output=UntagResourceOutput, - schema=_SCHEMA_UNTAG_RESOURCE, - input_schema=_SCHEMA_UNTAG_RESOURCE_INPUT, - output_schema=_SCHEMA_UNTAG_RESOURCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -def _serialize_resource_oauth2_return_url_list_type( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_resource_oauth2_return_url_list_type( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CreateWorkloadIdentityInput: - """Dataclass for CreateWorkloadIdentityInput structure.""" - - name: str | None = None - """ - The name of the workload identity. The name must be unique within your - account. - """ - - allowed_resource_oauth2_return_urls: list[str] | None = None - """ - The list of allowed OAuth2 return URLs for resources associated with - this workload identity. - """ - - tags: dict[str, str] | None = None - """ - A map of tag keys and values to assign to the workload identity. Tags - enable you to categorize your resources in different ways, for example, - by purpose, owner, or environment. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_WORKLOAD_IDENTITY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_WORKLOAD_IDENTITY_INPUT.members["name"], self.name - ) - - if self.allowed_resource_oauth2_return_urls is not None: - _serialize_resource_oauth2_return_url_list_type( - serializer, - _SCHEMA_CREATE_WORKLOAD_IDENTITY_INPUT.members[ - "allowedResourceOauth2ReturnUrls" - ], - self.allowed_resource_oauth2_return_urls, - ) - - if self.tags is not None: - _serialize_tags_map( - serializer, - _SCHEMA_CREATE_WORKLOAD_IDENTITY_INPUT.members["tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_WORKLOAD_IDENTITY_INPUT.members["name"] - ) - - case 1: - kwargs["allowed_resource_oauth2_return_urls"] = ( - _deserialize_resource_oauth2_return_url_list_type( - de, - _SCHEMA_CREATE_WORKLOAD_IDENTITY_INPUT.members[ - "allowedResourceOauth2ReturnUrls" - ], - ) - ) - - case 2: - kwargs["tags"] = _deserialize_tags_map( - de, _SCHEMA_CREATE_WORKLOAD_IDENTITY_INPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_WORKLOAD_IDENTITY_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CreateWorkloadIdentityOutput: - """Dataclass for CreateWorkloadIdentityOutput structure.""" - - name: str - """The name of the workload identity.""" - - workload_identity_arn: str - """The Amazon Resource Name (ARN) of the workload identity.""" - - allowed_resource_oauth2_return_urls: list[str] | None = None - """ - The list of allowed OAuth2 return URLs for resources associated with - this workload identity. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_WORKLOAD_IDENTITY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_WORKLOAD_IDENTITY_OUTPUT.members["name"], self.name - ) - serializer.write_string( - _SCHEMA_CREATE_WORKLOAD_IDENTITY_OUTPUT.members["workloadIdentityArn"], - self.workload_identity_arn, - ) - if self.allowed_resource_oauth2_return_urls is not None: - _serialize_resource_oauth2_return_url_list_type( - serializer, - _SCHEMA_CREATE_WORKLOAD_IDENTITY_OUTPUT.members[ - "allowedResourceOauth2ReturnUrls" - ], - self.allowed_resource_oauth2_return_urls, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_WORKLOAD_IDENTITY_OUTPUT.members["name"] - ) - - case 1: - kwargs["workload_identity_arn"] = de.read_string( - _SCHEMA_CREATE_WORKLOAD_IDENTITY_OUTPUT.members[ - "workloadIdentityArn" - ] - ) - - case 2: - kwargs["allowed_resource_oauth2_return_urls"] = ( - _deserialize_resource_oauth2_return_url_list_type( - de, - _SCHEMA_CREATE_WORKLOAD_IDENTITY_OUTPUT.members[ - "allowedResourceOauth2ReturnUrls" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_WORKLOAD_IDENTITY_OUTPUT, consumer=_consumer - ) - if "name" not in kwargs: - kwargs["name"] = "" - if "workload_identity_arn" not in kwargs: - kwargs["workload_identity_arn"] = "" - return kwargs - - -CREATE_WORKLOAD_IDENTITY = APIOperation( - input=CreateWorkloadIdentityInput, - output=CreateWorkloadIdentityOutput, - schema=_SCHEMA_CREATE_WORKLOAD_IDENTITY, - input_schema=_SCHEMA_CREATE_WORKLOAD_IDENTITY_INPUT, - output_schema=_SCHEMA_CREATE_WORKLOAD_IDENTITY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#UnauthorizedException" - ): UnauthorizedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteWorkloadIdentityInput: - """Dataclass for DeleteWorkloadIdentityInput structure.""" - - name: str | None = None - """The name of the workload identity to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_WORKLOAD_IDENTITY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_DELETE_WORKLOAD_IDENTITY_INPUT.members["name"], self.name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_DELETE_WORKLOAD_IDENTITY_INPUT.members["name"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_WORKLOAD_IDENTITY_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteWorkloadIdentityOutput: - """Dataclass for DeleteWorkloadIdentityOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_WORKLOAD_IDENTITY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_WORKLOAD_IDENTITY_OUTPUT, consumer=_consumer - ) - return kwargs - - -DELETE_WORKLOAD_IDENTITY = APIOperation( - input=DeleteWorkloadIdentityInput, - output=DeleteWorkloadIdentityOutput, - schema=_SCHEMA_DELETE_WORKLOAD_IDENTITY, - input_schema=_SCHEMA_DELETE_WORKLOAD_IDENTITY_INPUT, - output_schema=_SCHEMA_DELETE_WORKLOAD_IDENTITY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#UnauthorizedException" - ): UnauthorizedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetWorkloadIdentityInput: - """Dataclass for GetWorkloadIdentityInput structure.""" - - name: str | None = None - """The name of the workload identity to retrieve.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_WORKLOAD_IDENTITY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_GET_WORKLOAD_IDENTITY_INPUT.members["name"], self.name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_GET_WORKLOAD_IDENTITY_INPUT.members["name"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_WORKLOAD_IDENTITY_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetWorkloadIdentityOutput: - """Dataclass for GetWorkloadIdentityOutput structure.""" - - name: str - """The name of the workload identity.""" - - workload_identity_arn: str - """The Amazon Resource Name (ARN) of the workload identity.""" - - created_time: datetime - """The timestamp when the workload identity was created.""" - - last_updated_time: datetime - """The timestamp when the workload identity was last updated.""" - - allowed_resource_oauth2_return_urls: list[str] | None = None - """ - The list of allowed OAuth2 return URLs for resources associated with - this workload identity. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_WORKLOAD_IDENTITY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_WORKLOAD_IDENTITY_OUTPUT.members["name"], self.name - ) - serializer.write_string( - _SCHEMA_GET_WORKLOAD_IDENTITY_OUTPUT.members["workloadIdentityArn"], - self.workload_identity_arn, - ) - if self.allowed_resource_oauth2_return_urls is not None: - _serialize_resource_oauth2_return_url_list_type( - serializer, - _SCHEMA_GET_WORKLOAD_IDENTITY_OUTPUT.members[ - "allowedResourceOauth2ReturnUrls" - ], - self.allowed_resource_oauth2_return_urls, - ) - - serializer.write_timestamp( - _SCHEMA_GET_WORKLOAD_IDENTITY_OUTPUT.members["createdTime"], - self.created_time, - ) - serializer.write_timestamp( - _SCHEMA_GET_WORKLOAD_IDENTITY_OUTPUT.members["lastUpdatedTime"], - self.last_updated_time, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_GET_WORKLOAD_IDENTITY_OUTPUT.members["name"] - ) - - case 1: - kwargs["workload_identity_arn"] = de.read_string( - _SCHEMA_GET_WORKLOAD_IDENTITY_OUTPUT.members[ - "workloadIdentityArn" - ] - ) - - case 2: - kwargs["allowed_resource_oauth2_return_urls"] = ( - _deserialize_resource_oauth2_return_url_list_type( - de, - _SCHEMA_GET_WORKLOAD_IDENTITY_OUTPUT.members[ - "allowedResourceOauth2ReturnUrls" - ], - ) - ) - - case 3: - kwargs["created_time"] = de.read_timestamp( - _SCHEMA_GET_WORKLOAD_IDENTITY_OUTPUT.members["createdTime"] - ) - - case 4: - kwargs["last_updated_time"] = de.read_timestamp( - _SCHEMA_GET_WORKLOAD_IDENTITY_OUTPUT.members["lastUpdatedTime"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_WORKLOAD_IDENTITY_OUTPUT, consumer=_consumer - ) - if "name" not in kwargs: - kwargs["name"] = "" - if "workload_identity_arn" not in kwargs: - kwargs["workload_identity_arn"] = "" - if "created_time" not in kwargs: - kwargs["created_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "last_updated_time" not in kwargs: - kwargs["last_updated_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -GET_WORKLOAD_IDENTITY = APIOperation( - input=GetWorkloadIdentityInput, - output=GetWorkloadIdentityOutput, - schema=_SCHEMA_GET_WORKLOAD_IDENTITY, - input_schema=_SCHEMA_GET_WORKLOAD_IDENTITY_INPUT, - output_schema=_SCHEMA_GET_WORKLOAD_IDENTITY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#UnauthorizedException" - ): UnauthorizedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListWorkloadIdentitiesInput: - """Dataclass for ListWorkloadIdentitiesInput structure.""" - - next_token: str | None = None - """Pagination token.""" - - max_results: int = 10 - """Maximum number of results to return.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_WORKLOAD_IDENTITIES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_WORKLOAD_IDENTITIES_INPUT.members["nextToken"], - self.next_token, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_WORKLOAD_IDENTITIES_INPUT.members["maxResults"], - self.max_results, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_WORKLOAD_IDENTITIES_INPUT.members["nextToken"] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_WORKLOAD_IDENTITIES_INPUT.members["maxResults"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_WORKLOAD_IDENTITIES_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class WorkloadIdentityType: - """Contains information about a workload identity.""" - - name: str - """The name of the workload identity.""" - - workload_identity_arn: str - """The Amazon Resource Name (ARN) of the workload identity.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_WORKLOAD_IDENTITY_TYPE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_WORKLOAD_IDENTITY_TYPE.members["name"], self.name - ) - serializer.write_string( - _SCHEMA_WORKLOAD_IDENTITY_TYPE.members["workloadIdentityArn"], - self.workload_identity_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_WORKLOAD_IDENTITY_TYPE.members["name"] - ) - - case 1: - kwargs["workload_identity_arn"] = de.read_string( - _SCHEMA_WORKLOAD_IDENTITY_TYPE.members["workloadIdentityArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_WORKLOAD_IDENTITY_TYPE, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "workload_identity_arn" not in kwargs: - kwargs["workload_identity_arn"] = "" - return kwargs - - -def _serialize_workload_identity_list( - serializer: ShapeSerializer, schema: Schema, value: list[WorkloadIdentityType] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_workload_identity_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[WorkloadIdentityType]: - result: list[WorkloadIdentityType] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(WorkloadIdentityType.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListWorkloadIdentitiesOutput: - """Dataclass for ListWorkloadIdentitiesOutput structure.""" - - workload_identities: list[WorkloadIdentityType] - """The list of workload identities.""" - - next_token: str | None = None - """Pagination token for the next page of results.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_WORKLOAD_IDENTITIES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_workload_identity_list( - serializer, - _SCHEMA_LIST_WORKLOAD_IDENTITIES_OUTPUT.members["workloadIdentities"], - self.workload_identities, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_WORKLOAD_IDENTITIES_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["workload_identities"] = _deserialize_workload_identity_list( - de, - _SCHEMA_LIST_WORKLOAD_IDENTITIES_OUTPUT.members[ - "workloadIdentities" - ], - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_WORKLOAD_IDENTITIES_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_WORKLOAD_IDENTITIES_OUTPUT, consumer=_consumer - ) - if "workload_identities" not in kwargs: - kwargs["workload_identities"] = [] - return kwargs - - -LIST_WORKLOAD_IDENTITIES = APIOperation( - input=ListWorkloadIdentitiesInput, - output=ListWorkloadIdentitiesOutput, - schema=_SCHEMA_LIST_WORKLOAD_IDENTITIES, - input_schema=_SCHEMA_LIST_WORKLOAD_IDENTITIES_INPUT, - output_schema=_SCHEMA_LIST_WORKLOAD_IDENTITIES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#UnauthorizedException" - ): UnauthorizedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateWorkloadIdentityInput: - """Dataclass for UpdateWorkloadIdentityInput structure.""" - - name: str | None = None - """The name of the workload identity to update.""" - - allowed_resource_oauth2_return_urls: list[str] | None = None - """ - The new list of allowed OAuth2 return URLs for resources associated with - this workload identity. This list replaces the existing list. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_WORKLOAD_IDENTITY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_UPDATE_WORKLOAD_IDENTITY_INPUT.members["name"], self.name - ) - - if self.allowed_resource_oauth2_return_urls is not None: - _serialize_resource_oauth2_return_url_list_type( - serializer, - _SCHEMA_UPDATE_WORKLOAD_IDENTITY_INPUT.members[ - "allowedResourceOauth2ReturnUrls" - ], - self.allowed_resource_oauth2_return_urls, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_WORKLOAD_IDENTITY_INPUT.members["name"] - ) - - case 1: - kwargs["allowed_resource_oauth2_return_urls"] = ( - _deserialize_resource_oauth2_return_url_list_type( - de, - _SCHEMA_UPDATE_WORKLOAD_IDENTITY_INPUT.members[ - "allowedResourceOauth2ReturnUrls" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_WORKLOAD_IDENTITY_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateWorkloadIdentityOutput: - """Dataclass for UpdateWorkloadIdentityOutput structure.""" - - name: str - """The name of the workload identity.""" - - workload_identity_arn: str - """The Amazon Resource Name (ARN) of the workload identity.""" - - created_time: datetime - """The timestamp when the workload identity was created.""" - - last_updated_time: datetime - """The timestamp when the workload identity was last updated.""" - - allowed_resource_oauth2_return_urls: list[str] | None = None - """ - The list of allowed OAuth2 return URLs for resources associated with - this workload identity. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_WORKLOAD_IDENTITY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_UPDATE_WORKLOAD_IDENTITY_OUTPUT.members["name"], self.name - ) - serializer.write_string( - _SCHEMA_UPDATE_WORKLOAD_IDENTITY_OUTPUT.members["workloadIdentityArn"], - self.workload_identity_arn, - ) - if self.allowed_resource_oauth2_return_urls is not None: - _serialize_resource_oauth2_return_url_list_type( - serializer, - _SCHEMA_UPDATE_WORKLOAD_IDENTITY_OUTPUT.members[ - "allowedResourceOauth2ReturnUrls" - ], - self.allowed_resource_oauth2_return_urls, - ) - - serializer.write_timestamp( - _SCHEMA_UPDATE_WORKLOAD_IDENTITY_OUTPUT.members["createdTime"], - self.created_time, - ) - serializer.write_timestamp( - _SCHEMA_UPDATE_WORKLOAD_IDENTITY_OUTPUT.members["lastUpdatedTime"], - self.last_updated_time, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_WORKLOAD_IDENTITY_OUTPUT.members["name"] - ) - - case 1: - kwargs["workload_identity_arn"] = de.read_string( - _SCHEMA_UPDATE_WORKLOAD_IDENTITY_OUTPUT.members[ - "workloadIdentityArn" - ] - ) - - case 2: - kwargs["allowed_resource_oauth2_return_urls"] = ( - _deserialize_resource_oauth2_return_url_list_type( - de, - _SCHEMA_UPDATE_WORKLOAD_IDENTITY_OUTPUT.members[ - "allowedResourceOauth2ReturnUrls" - ], - ) - ) - - case 3: - kwargs["created_time"] = de.read_timestamp( - _SCHEMA_UPDATE_WORKLOAD_IDENTITY_OUTPUT.members["createdTime"] - ) - - case 4: - kwargs["last_updated_time"] = de.read_timestamp( - _SCHEMA_UPDATE_WORKLOAD_IDENTITY_OUTPUT.members[ - "lastUpdatedTime" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_WORKLOAD_IDENTITY_OUTPUT, consumer=_consumer - ) - if "name" not in kwargs: - kwargs["name"] = "" - if "workload_identity_arn" not in kwargs: - kwargs["workload_identity_arn"] = "" - if "created_time" not in kwargs: - kwargs["created_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "last_updated_time" not in kwargs: - kwargs["last_updated_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -UPDATE_WORKLOAD_IDENTITY = APIOperation( - input=UpdateWorkloadIdentityInput, - output=UpdateWorkloadIdentityOutput, - schema=_SCHEMA_UPDATE_WORKLOAD_IDENTITY, - input_schema=_SCHEMA_UPDATE_WORKLOAD_IDENTITY_INPUT, - output_schema=_SCHEMA_UPDATE_WORKLOAD_IDENTITY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#UnauthorizedException" - ): UnauthorizedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class SchemaDefinition: - """ - A schema definition for a gateway target. This structure defines the - structure of the API that the target exposes. - """ - - type: str - """ - The type of the schema definition. This field specifies the data type of - the schema. - """ - - properties: "dict[str, SchemaDefinition] | None" = None - """ - The properties of the schema definition. These properties define the - fields in the schema. - """ - - required: list[str] | None = None - """ - The required fields in the schema definition. These fields must be - provided when using the schema. - """ - - items: "SchemaDefinition | None" = None - """ - The items in the schema definition. This field is used for array types - to define the structure of the array elements. - """ - - description: str | None = None - """ - The description of the schema definition. This description provides - information about the purpose and usage of the schema. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SCHEMA_DEFINITION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_SCHEMA_DEFINITION.members["type"], self.type) - if self.properties is not None: - _serialize_schema_properties( - serializer, - _SCHEMA_SCHEMA_DEFINITION.members["properties"], - self.properties, - ) - - if self.required is not None: - _serialize_required_properties( - serializer, _SCHEMA_SCHEMA_DEFINITION.members["required"], self.required - ) - - if self.items is not None: - serializer.write_struct( - _SCHEMA_SCHEMA_DEFINITION.members["items"], self.items - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_SCHEMA_DEFINITION.members["description"], self.description - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = SchemaType( - de.read_string(_SCHEMA_SCHEMA_DEFINITION.members["type"]) - ) - - case 1: - kwargs["properties"] = _deserialize_schema_properties( - de, _SCHEMA_SCHEMA_DEFINITION.members["properties"] - ) - - case 2: - kwargs["required"] = _deserialize_required_properties( - de, _SCHEMA_SCHEMA_DEFINITION.members["required"] - ) - - case 3: - kwargs["items"] = SchemaDefinition.deserialize(de) - - case 4: - kwargs["description"] = de.read_string( - _SCHEMA_SCHEMA_DEFINITION.members["description"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SCHEMA_DEFINITION, consumer=_consumer) - if "type" not in kwargs: - kwargs["type"] = SchemaType._corrected("") - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(type=SchemaType._corrected("")) - - -def _serialize_schema_properties( - serializer: ShapeSerializer, schema: Schema, value: dict[str, SchemaDefinition] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_struct(value_schema, v)) - - -def _deserialize_schema_properties( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, SchemaDefinition]: - result: dict[str, SchemaDefinition] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = SchemaDefinition.deserialize(d) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ToolDefinition: - """ - A tool definition for a gateway target. This structure defines a tool - that the target exposes through the Model Context Protocol. - """ - - name: str - """ - The name of the tool. This name identifies the tool in the Model Context - Protocol. - """ - - description: str - """ - The description of the tool. This description provides information about - the purpose and usage of the tool. - """ - - input_schema: "SchemaDefinition" - """ - The input schema for the tool. This schema defines the structure of the - input that the tool accepts. - """ - - output_schema: "SchemaDefinition | None" = None - """ - The output schema for the tool. This schema defines the structure of the - output that the tool produces. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_DEFINITION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_TOOL_DEFINITION.members["name"], self.name) - serializer.write_string( - _SCHEMA_TOOL_DEFINITION.members["description"], self.description - ) - serializer.write_struct( - _SCHEMA_TOOL_DEFINITION.members["inputSchema"], self.input_schema - ) - if self.output_schema is not None: - serializer.write_struct( - _SCHEMA_TOOL_DEFINITION.members["outputSchema"], self.output_schema - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_TOOL_DEFINITION.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_TOOL_DEFINITION.members["description"] - ) - - case 2: - kwargs["input_schema"] = SchemaDefinition.deserialize(de) - - case 3: - kwargs["output_schema"] = SchemaDefinition.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TOOL_DEFINITION, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "description" not in kwargs: - kwargs["description"] = "" - if "input_schema" not in kwargs: - kwargs["input_schema"] = SchemaDefinition._smithy_default() - return kwargs - - -def _serialize_tool_definitions( - serializer: ShapeSerializer, schema: Schema, value: list[ToolDefinition] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_tool_definitions( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ToolDefinition]: - result: list[ToolDefinition] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ToolDefinition.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass -class ToolSchemaS3: - """ - The Amazon S3 location of the tool schema. This location contains the - schema definition file. - """ - - value: S3Configuration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_SCHEMA, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_SCHEMA.members["s3"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=S3Configuration.deserialize(deserializer)) - - -@dataclass -class ToolSchemaInlinePayload: - """ - The inline payload of the tool schema. This payload contains the schema - definition directly in the request. - """ - - value: "list[ToolDefinition]" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_SCHEMA, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_tool_definitions( - serializer, _SCHEMA_TOOL_SCHEMA.members["inlinePayload"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_deserialize_tool_definitions( - deserializer, _SCHEMA_TOOL_SCHEMA.members["inlinePayload"] - ) - ) - - -@dataclass -class ToolSchemaUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ToolSchema = Union[ToolSchemaS3 | ToolSchemaInlinePayload | ToolSchemaUnknown] -""" -A tool schema for a gateway target. This structure defines the schema -for a tool that the target exposes through the Model Context Protocol. -""" - - -class _ToolSchemaDeserializer: - _result: ToolSchema | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> ToolSchema: - self._result = None - deserializer.read_struct(_SCHEMA_TOOL_SCHEMA, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(ToolSchemaS3.deserialize(de)) - - case 1: - self._set_result(ToolSchemaInlinePayload.deserialize(de)) - - case _: - self._set_result(ToolSchemaUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: ToolSchema) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class McpLambdaTargetConfiguration: - """ - The Lambda configuration for a Model Context Protocol target. This - structure defines how the gateway uses a Lambda function to communicate - with the target. - """ - - lambda_arn: str - """ - The Amazon Resource Name (ARN) of the Lambda function. This function is - invoked by the gateway to communicate with the target. - """ - - tool_schema: "ToolSchema" - """ - The tool schema for the Lambda function. This schema defines the - structure of the tools that the Lambda function provides. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MCP_LAMBDA_TARGET_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MCP_LAMBDA_TARGET_CONFIGURATION.members["lambdaArn"], - self.lambda_arn, - ) - serializer.write_struct( - _SCHEMA_MCP_LAMBDA_TARGET_CONFIGURATION.members["toolSchema"], - self.tool_schema, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["lambda_arn"] = de.read_string( - _SCHEMA_MCP_LAMBDA_TARGET_CONFIGURATION.members["lambdaArn"] - ) - - case 1: - kwargs["tool_schema"] = _ToolSchemaDeserializer().deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MCP_LAMBDA_TARGET_CONFIGURATION, consumer=_consumer - ) - if "lambda_arn" not in kwargs: - kwargs["lambda_arn"] = "" - if "tool_schema" not in kwargs: - kwargs["tool_schema"] = ToolSchemaUnknown(tag="") - return kwargs - - -@dataclass -class McpTargetConfigurationOpenApiSchema: - """ - The OpenAPI schema for the Model Context Protocol target. This schema - defines the API structure of the target. - """ - - value: ApiSchemaConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MCP_TARGET_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MCP_TARGET_CONFIGURATION.members["openApiSchema"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_ApiSchemaConfigurationDeserializer().deserialize(deserializer) - ) - - -@dataclass -class McpTargetConfigurationSmithyModel: - """ - The Smithy model for the Model Context Protocol target. This model - defines the API structure of the target using the Smithy specification. - """ - - value: ApiSchemaConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MCP_TARGET_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MCP_TARGET_CONFIGURATION.members["smithyModel"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_ApiSchemaConfigurationDeserializer().deserialize(deserializer) - ) - - -@dataclass -class McpTargetConfigurationLambda: - """ - The Lambda configuration for the Model Context Protocol target. This - configuration defines how the gateway uses a Lambda function to - communicate with the target. - """ - - value: "McpLambdaTargetConfiguration" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MCP_TARGET_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MCP_TARGET_CONFIGURATION.members["lambda"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=McpLambdaTargetConfiguration.deserialize(deserializer)) - - -@dataclass -class McpTargetConfigurationMcpServer: - """The MCP server specified as the gateway target.""" - - value: McpServerTargetConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MCP_TARGET_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MCP_TARGET_CONFIGURATION.members["mcpServer"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=McpServerTargetConfiguration.deserialize(deserializer)) - - -@dataclass -class McpTargetConfigurationApiGateway: - """The configuration for an Amazon API Gateway target.""" - - value: ApiGatewayTargetConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MCP_TARGET_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MCP_TARGET_CONFIGURATION.members["apiGateway"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ApiGatewayTargetConfiguration.deserialize(deserializer)) - - -@dataclass -class McpTargetConfigurationConnector: - """ - The connector integration configuration for the Model Context Protocol - target. This configuration defines how the gateway uses a pre-built - connector to communicate with the target. - """ - - value: ConnectorTargetConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MCP_TARGET_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MCP_TARGET_CONFIGURATION.members["connector"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ConnectorTargetConfiguration.deserialize(deserializer)) - - -@dataclass -class McpTargetConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -McpTargetConfiguration = Union[ - McpTargetConfigurationOpenApiSchema - | McpTargetConfigurationSmithyModel - | McpTargetConfigurationLambda - | McpTargetConfigurationMcpServer - | McpTargetConfigurationApiGateway - | McpTargetConfigurationConnector - | McpTargetConfigurationUnknown -] -""" -The Model Context Protocol (MCP) configuration for a target. This -structure defines how the gateway uses MCP to communicate with the -target. -""" - - -class _McpTargetConfigurationDeserializer: - _result: McpTargetConfiguration | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> McpTargetConfiguration: - self._result = None - deserializer.read_struct(_SCHEMA_MCP_TARGET_CONFIGURATION, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(McpTargetConfigurationOpenApiSchema.deserialize(de)) - - case 1: - self._set_result(McpTargetConfigurationSmithyModel.deserialize(de)) - - case 2: - self._set_result(McpTargetConfigurationLambda.deserialize(de)) - - case 3: - self._set_result(McpTargetConfigurationMcpServer.deserialize(de)) - - case 4: - self._set_result(McpTargetConfigurationApiGateway.deserialize(de)) - - case 5: - self._set_result(McpTargetConfigurationConnector.deserialize(de)) - - case _: - self._set_result( - McpTargetConfigurationUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: McpTargetConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass -class TargetConfigurationMcp: - """ - The Model Context Protocol (MCP) configuration for the target. This - configuration defines how the gateway uses MCP to communicate with the - target. - """ - - value: "McpTargetConfiguration" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TARGET_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TARGET_CONFIGURATION.members["mcp"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_McpTargetConfigurationDeserializer().deserialize(deserializer) - ) - - -@dataclass -class TargetConfigurationHttp: - """ - The HTTP target configuration. Use this to route gateway requests to an - HTTP-based endpoint such as an AgentCore Runtime. - """ - - value: HttpTargetConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TARGET_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_TARGET_CONFIGURATION.members["http"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_HttpTargetConfigurationDeserializer().deserialize(deserializer) - ) - - -@dataclass -class TargetConfigurationInference: - """ - The inference configuration for the target. This configuration routes - requests to a large language model (LLM) provider. - """ - - value: InferenceTargetConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TARGET_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_TARGET_CONFIGURATION.members["inference"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_InferenceTargetConfigurationDeserializer().deserialize(deserializer) - ) - - -@dataclass -class TargetConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -TargetConfiguration = Union[ - TargetConfigurationMcp - | TargetConfigurationHttp - | TargetConfigurationInference - | TargetConfigurationUnknown -] -""" -The configuration for a gateway target. This structure defines how the -gateway connects to and interacts with the target endpoint. -""" - - -class _TargetConfigurationDeserializer: - _result: TargetConfiguration | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> TargetConfiguration: - self._result = None - deserializer.read_struct(_SCHEMA_TARGET_CONFIGURATION, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(TargetConfigurationMcp.deserialize(de)) - - case 1: - self._set_result(TargetConfigurationHttp.deserialize(de)) - - case 2: - self._set_result(TargetConfigurationInference.deserialize(de)) - - case _: - self._set_result( - TargetConfigurationUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: TargetConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class CreateGatewayTargetInput: - """Dataclass for CreateGatewayTargetInput structure.""" - - gateway_identifier: str | None = None - """The identifier of the gateway to create a target for.""" - - name: str | None = field(repr=False, default=None) - """ - The name of the gateway target. The name must be unique within the - gateway. - """ - - description: str | None = field(repr=False, default=None) - """The description of the gateway target.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If you don't specify this field, a - value is randomly generated for you. If this token matches a previous - request, the service ignores the request, but doesn't return an error. - For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - target_configuration: "TargetConfiguration | None" = None - """ - The configuration settings for the target, including endpoint - information and schema definitions. - """ - - credential_provider_configurations: list[CredentialProviderConfiguration] | None = ( - None - ) - """ - The credential provider configurations for the target. These - configurations specify how the gateway authenticates with the target - endpoint. - """ - - metadata_configuration: MetadataConfiguration | None = None - """ - Optional configuration for HTTP header and query parameter propagation - to and from the gateway target. - """ - - private_endpoint: PrivateEndpoint | None = None - """ - The private endpoint configuration for the gateway target. Use this to - connect the gateway to private resources in your VPC. - """ - - certificate_configurations: list[CertificateConfiguration] | None = None - """ - The private certificate authority (CA) configurations for the gateway - target. Use this to have the gateway trust a private CA when it - establishes TLS connections to the target endpoint. Provide each - certificate by reference to an Amazon S3 object or an Amazon Web - Services Secrets Manager secret. You can specify only one certificate - authority configuration in this list. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_GATEWAY_TARGET_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.gateway_identifier is not None: - serializer.write_string( - _SCHEMA_CREATE_GATEWAY_TARGET_INPUT.members["gatewayIdentifier"], - self.gateway_identifier, - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_GATEWAY_TARGET_INPUT.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_GATEWAY_TARGET_INPUT.members["description"], - self.description, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_GATEWAY_TARGET_INPUT.members["clientToken"], - self.client_token, - ) - - if self.target_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_GATEWAY_TARGET_INPUT.members["targetConfiguration"], - self.target_configuration, - ) - - if self.credential_provider_configurations is not None: - _serialize_credential_provider_configurations( - serializer, - _SCHEMA_CREATE_GATEWAY_TARGET_INPUT.members[ - "credentialProviderConfigurations" - ], - self.credential_provider_configurations, - ) - - if self.metadata_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_GATEWAY_TARGET_INPUT.members["metadataConfiguration"], - self.metadata_configuration, - ) - - if self.private_endpoint is not None: - serializer.write_struct( - _SCHEMA_CREATE_GATEWAY_TARGET_INPUT.members["privateEndpoint"], - self.private_endpoint, - ) - - if self.certificate_configurations is not None: - _serialize_certificate_configuration_list( - serializer, - _SCHEMA_CREATE_GATEWAY_TARGET_INPUT.members[ - "certificateConfigurations" - ], - self.certificate_configurations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["gateway_identifier"] = de.read_string( - _SCHEMA_CREATE_GATEWAY_TARGET_INPUT.members["gatewayIdentifier"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_GATEWAY_TARGET_INPUT.members["name"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_GATEWAY_TARGET_INPUT.members["description"] - ) - - case 3: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_GATEWAY_TARGET_INPUT.members["clientToken"] - ) - - case 4: - kwargs["target_configuration"] = ( - _TargetConfigurationDeserializer().deserialize(de) - ) - - case 5: - kwargs["credential_provider_configurations"] = ( - _deserialize_credential_provider_configurations( - de, - _SCHEMA_CREATE_GATEWAY_TARGET_INPUT.members[ - "credentialProviderConfigurations" - ], - ) - ) - - case 6: - kwargs["metadata_configuration"] = ( - MetadataConfiguration.deserialize(de) - ) - - case 7: - kwargs["private_endpoint"] = ( - _PrivateEndpointDeserializer().deserialize(de) - ) - - case 8: - kwargs["certificate_configurations"] = ( - _deserialize_certificate_configuration_list( - de, - _SCHEMA_CREATE_GATEWAY_TARGET_INPUT.members[ - "certificateConfigurations" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_GATEWAY_TARGET_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CreateGatewayTargetOutput: - """Dataclass for CreateGatewayTargetOutput structure.""" - - gateway_arn: str - """The Amazon Resource Name (ARN) of the gateway.""" - - target_id: str - """The unique identifier of the created target.""" - - created_at: datetime - """The timestamp when the target was created.""" - - updated_at: datetime - """The timestamp when the target was last updated.""" - - status: str - """The current status of the target.""" - - name: str = field(repr=False) - """The name of the target.""" - - target_configuration: "TargetConfiguration" - """The configuration settings for the target.""" - - credential_provider_configurations: list[CredentialProviderConfiguration] - """The credential provider configurations for the target.""" - - status_reasons: list[str] | None = None - """The reasons for the current status of the target.""" - - description: str | None = field(repr=False, default=None) - """The description of the target.""" - - last_synchronized_at: datetime | None = None - """The last synchronization of the target.""" - - metadata_configuration: MetadataConfiguration | None = None - """ - The metadata configuration that was applied to the created gateway - target. - """ - - private_endpoint: PrivateEndpoint | None = None - """The private endpoint configuration for the gateway target.""" - - private_endpoint_managed_resources: list[ManagedResourceDetails] | None = None - """ - The managed resources created by the gateway for private endpoint - connectivity. - """ - - authorization_data: AuthorizationData | None = None - """ - OAuth2 authorization data for the created gateway target. This data is - returned when a target is configured with a credential provider with - authorization code grant type and requires user federation. - """ - - protocol_type: str | None = None - """The protocol type of the created gateway target.""" - - certificate_configurations: list[CertificateConfiguration] | None = None - """ - The private certificate authority (CA) configurations for the gateway - target. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_GATEWAY_TARGET_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_GATEWAY_TARGET_OUTPUT.members["gatewayArn"], self.gateway_arn - ) - serializer.write_string( - _SCHEMA_CREATE_GATEWAY_TARGET_OUTPUT.members["targetId"], self.target_id - ) - serializer.write_timestamp( - _SCHEMA_CREATE_GATEWAY_TARGET_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_CREATE_GATEWAY_TARGET_OUTPUT.members["updatedAt"], self.updated_at - ) - serializer.write_string( - _SCHEMA_CREATE_GATEWAY_TARGET_OUTPUT.members["status"], self.status - ) - if self.status_reasons is not None: - _serialize_status_reasons( - serializer, - _SCHEMA_CREATE_GATEWAY_TARGET_OUTPUT.members["statusReasons"], - self.status_reasons, - ) - - serializer.write_string( - _SCHEMA_CREATE_GATEWAY_TARGET_OUTPUT.members["name"], self.name - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_GATEWAY_TARGET_OUTPUT.members["description"], - self.description, - ) - - serializer.write_struct( - _SCHEMA_CREATE_GATEWAY_TARGET_OUTPUT.members["targetConfiguration"], - self.target_configuration, - ) - _serialize_credential_provider_configurations( - serializer, - _SCHEMA_CREATE_GATEWAY_TARGET_OUTPUT.members[ - "credentialProviderConfigurations" - ], - self.credential_provider_configurations, - ) - if self.last_synchronized_at is not None: - serializer.write_timestamp( - _SCHEMA_CREATE_GATEWAY_TARGET_OUTPUT.members["lastSynchronizedAt"], - self.last_synchronized_at, - ) - - if self.metadata_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_GATEWAY_TARGET_OUTPUT.members["metadataConfiguration"], - self.metadata_configuration, - ) - - if self.private_endpoint is not None: - serializer.write_struct( - _SCHEMA_CREATE_GATEWAY_TARGET_OUTPUT.members["privateEndpoint"], - self.private_endpoint, - ) - - if self.private_endpoint_managed_resources is not None: - _serialize_private_endpoint_managed_resources( - serializer, - _SCHEMA_CREATE_GATEWAY_TARGET_OUTPUT.members[ - "privateEndpointManagedResources" - ], - self.private_endpoint_managed_resources, - ) - - if self.authorization_data is not None: - serializer.write_struct( - _SCHEMA_CREATE_GATEWAY_TARGET_OUTPUT.members["authorizationData"], - self.authorization_data, - ) - - if self.protocol_type is not None: - serializer.write_string( - _SCHEMA_CREATE_GATEWAY_TARGET_OUTPUT.members["protocolType"], - self.protocol_type, - ) - - if self.certificate_configurations is not None: - _serialize_certificate_configuration_list( - serializer, - _SCHEMA_CREATE_GATEWAY_TARGET_OUTPUT.members[ - "certificateConfigurations" - ], - self.certificate_configurations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["gateway_arn"] = de.read_string( - _SCHEMA_CREATE_GATEWAY_TARGET_OUTPUT.members["gatewayArn"] - ) - - case 1: - kwargs["target_id"] = de.read_string( - _SCHEMA_CREATE_GATEWAY_TARGET_OUTPUT.members["targetId"] - ) - - case 2: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_CREATE_GATEWAY_TARGET_OUTPUT.members["createdAt"] - ) - - case 3: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_CREATE_GATEWAY_TARGET_OUTPUT.members["updatedAt"] - ) - - case 4: - kwargs["status"] = TargetStatus( - de.read_string( - _SCHEMA_CREATE_GATEWAY_TARGET_OUTPUT.members["status"] - ) - ) - - case 5: - kwargs["status_reasons"] = _deserialize_status_reasons( - de, - _SCHEMA_CREATE_GATEWAY_TARGET_OUTPUT.members["statusReasons"], - ) - - case 6: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_GATEWAY_TARGET_OUTPUT.members["name"] - ) - - case 7: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_GATEWAY_TARGET_OUTPUT.members["description"] - ) - - case 8: - kwargs["target_configuration"] = ( - _TargetConfigurationDeserializer().deserialize(de) - ) - - case 9: - kwargs["credential_provider_configurations"] = ( - _deserialize_credential_provider_configurations( - de, - _SCHEMA_CREATE_GATEWAY_TARGET_OUTPUT.members[ - "credentialProviderConfigurations" - ], - ) - ) - - case 10: - kwargs["last_synchronized_at"] = de.read_timestamp( - _SCHEMA_CREATE_GATEWAY_TARGET_OUTPUT.members[ - "lastSynchronizedAt" - ] - ) - - case 11: - kwargs["metadata_configuration"] = ( - MetadataConfiguration.deserialize(de) - ) - - case 12: - kwargs["private_endpoint"] = ( - _PrivateEndpointDeserializer().deserialize(de) - ) - - case 13: - kwargs["private_endpoint_managed_resources"] = ( - _deserialize_private_endpoint_managed_resources( - de, - _SCHEMA_CREATE_GATEWAY_TARGET_OUTPUT.members[ - "privateEndpointManagedResources" - ], - ) - ) - - case 14: - kwargs["authorization_data"] = ( - _AuthorizationDataDeserializer().deserialize(de) - ) - - case 15: - kwargs["protocol_type"] = TargetProtocolType( - de.read_string( - _SCHEMA_CREATE_GATEWAY_TARGET_OUTPUT.members["protocolType"] - ) - ) - - case 16: - kwargs["certificate_configurations"] = ( - _deserialize_certificate_configuration_list( - de, - _SCHEMA_CREATE_GATEWAY_TARGET_OUTPUT.members[ - "certificateConfigurations" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_GATEWAY_TARGET_OUTPUT, consumer=_consumer - ) - if "gateway_arn" not in kwargs: - kwargs["gateway_arn"] = "" - if "target_id" not in kwargs: - kwargs["target_id"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "status" not in kwargs: - kwargs["status"] = TargetStatus._corrected("") - if "name" not in kwargs: - kwargs["name"] = "" - if "target_configuration" not in kwargs: - kwargs["target_configuration"] = TargetConfigurationUnknown(tag="") - if "credential_provider_configurations" not in kwargs: - kwargs["credential_provider_configurations"] = [] - return kwargs - - -@dataclass(kw_only=True) -class GatewayTarget: - """The gateway target.""" - - gateway_arn: str - """The Amazon Resource Name (ARN) of the gateway target.""" - - target_id: str - """The target ID.""" - - created_at: datetime - """The date and time at which the target was created.""" - - updated_at: datetime - """The date and time at which the target was updated.""" - - status: str - """The status of the gateway target.""" - - name: str = field(repr=False) - """The name of the gateway target.""" - - target_configuration: "TargetConfiguration" - """ - The configuration for a gateway target. This structure defines how the - gateway connects to and interacts with the target endpoint. - """ - - credential_provider_configurations: list[CredentialProviderConfiguration] - """The provider configurations.""" - - status_reasons: list[str] | None = None - """The status reasons for the target status.""" - - description: str | None = field(repr=False, default=None) - """The description for the gateway target.""" - - last_synchronized_at: datetime | None = None - """The last synchronization time.""" - - metadata_configuration: MetadataConfiguration | None = None - """ - The metadata configuration for HTTP header and query parameter - propagation to and from this gateway target. - """ - - private_endpoint: PrivateEndpoint | None = None - """ - The private endpoint configuration for a gateway target. Defines how the - gateway connects to private resources in your VPC. - """ - - private_endpoint_managed_resources: list[ManagedResourceDetails] | None = None - """ - A list of managed resources created by the gateway for private endpoint - connectivity. These resources are created in your account when you use a - managed VPC Lattice resource configuration. - """ - - authorization_data: AuthorizationData | None = None - """ - OAuth2 authorization data for the gateway target. This data is returned - when a target is configured with a credential provider with - authorization code grant type and requires user federation. - """ - - protocol_type: str | None = None - """The protocol type of the gateway target.""" - - certificate_configurations: list[CertificateConfiguration] | None = None - """ - The private certificate authority (CA) configurations for the gateway - target. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GATEWAY_TARGET, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GATEWAY_TARGET.members["gatewayArn"], self.gateway_arn - ) - serializer.write_string( - _SCHEMA_GATEWAY_TARGET.members["targetId"], self.target_id - ) - serializer.write_timestamp( - _SCHEMA_GATEWAY_TARGET.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_GATEWAY_TARGET.members["updatedAt"], self.updated_at - ) - serializer.write_string(_SCHEMA_GATEWAY_TARGET.members["status"], self.status) - if self.status_reasons is not None: - _serialize_status_reasons( - serializer, - _SCHEMA_GATEWAY_TARGET.members["statusReasons"], - self.status_reasons, - ) - - serializer.write_string(_SCHEMA_GATEWAY_TARGET.members["name"], self.name) - if self.description is not None: - serializer.write_string( - _SCHEMA_GATEWAY_TARGET.members["description"], self.description - ) - - serializer.write_struct( - _SCHEMA_GATEWAY_TARGET.members["targetConfiguration"], - self.target_configuration, - ) - _serialize_credential_provider_configurations( - serializer, - _SCHEMA_GATEWAY_TARGET.members["credentialProviderConfigurations"], - self.credential_provider_configurations, - ) - if self.last_synchronized_at is not None: - serializer.write_timestamp( - _SCHEMA_GATEWAY_TARGET.members["lastSynchronizedAt"], - self.last_synchronized_at, - ) - - if self.metadata_configuration is not None: - serializer.write_struct( - _SCHEMA_GATEWAY_TARGET.members["metadataConfiguration"], - self.metadata_configuration, - ) - - if self.private_endpoint is not None: - serializer.write_struct( - _SCHEMA_GATEWAY_TARGET.members["privateEndpoint"], self.private_endpoint - ) - - if self.private_endpoint_managed_resources is not None: - _serialize_private_endpoint_managed_resources( - serializer, - _SCHEMA_GATEWAY_TARGET.members["privateEndpointManagedResources"], - self.private_endpoint_managed_resources, - ) - - if self.authorization_data is not None: - serializer.write_struct( - _SCHEMA_GATEWAY_TARGET.members["authorizationData"], - self.authorization_data, - ) - - if self.protocol_type is not None: - serializer.write_string( - _SCHEMA_GATEWAY_TARGET.members["protocolType"], self.protocol_type - ) - - if self.certificate_configurations is not None: - _serialize_certificate_configuration_list( - serializer, - _SCHEMA_GATEWAY_TARGET.members["certificateConfigurations"], - self.certificate_configurations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["gateway_arn"] = de.read_string( - _SCHEMA_GATEWAY_TARGET.members["gatewayArn"] - ) - - case 1: - kwargs["target_id"] = de.read_string( - _SCHEMA_GATEWAY_TARGET.members["targetId"] - ) - - case 2: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GATEWAY_TARGET.members["createdAt"] - ) - - case 3: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_GATEWAY_TARGET.members["updatedAt"] - ) - - case 4: - kwargs["status"] = TargetStatus( - de.read_string(_SCHEMA_GATEWAY_TARGET.members["status"]) - ) - - case 5: - kwargs["status_reasons"] = _deserialize_status_reasons( - de, _SCHEMA_GATEWAY_TARGET.members["statusReasons"] - ) - - case 6: - kwargs["name"] = de.read_string( - _SCHEMA_GATEWAY_TARGET.members["name"] - ) - - case 7: - kwargs["description"] = de.read_string( - _SCHEMA_GATEWAY_TARGET.members["description"] - ) - - case 8: - kwargs["target_configuration"] = ( - _TargetConfigurationDeserializer().deserialize(de) - ) - - case 9: - kwargs["credential_provider_configurations"] = ( - _deserialize_credential_provider_configurations( - de, - _SCHEMA_GATEWAY_TARGET.members[ - "credentialProviderConfigurations" - ], - ) - ) - - case 10: - kwargs["last_synchronized_at"] = de.read_timestamp( - _SCHEMA_GATEWAY_TARGET.members["lastSynchronizedAt"] - ) - - case 11: - kwargs["metadata_configuration"] = ( - MetadataConfiguration.deserialize(de) - ) - - case 12: - kwargs["private_endpoint"] = ( - _PrivateEndpointDeserializer().deserialize(de) - ) - - case 13: - kwargs["private_endpoint_managed_resources"] = ( - _deserialize_private_endpoint_managed_resources( - de, - _SCHEMA_GATEWAY_TARGET.members[ - "privateEndpointManagedResources" - ], - ) - ) - - case 14: - kwargs["authorization_data"] = ( - _AuthorizationDataDeserializer().deserialize(de) - ) - - case 15: - kwargs["protocol_type"] = TargetProtocolType( - de.read_string(_SCHEMA_GATEWAY_TARGET.members["protocolType"]) - ) - - case 16: - kwargs["certificate_configurations"] = ( - _deserialize_certificate_configuration_list( - de, - _SCHEMA_GATEWAY_TARGET.members["certificateConfigurations"], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GATEWAY_TARGET, consumer=_consumer) - if "gateway_arn" not in kwargs: - kwargs["gateway_arn"] = "" - if "target_id" not in kwargs: - kwargs["target_id"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "status" not in kwargs: - kwargs["status"] = TargetStatus._corrected("") - if "name" not in kwargs: - kwargs["name"] = "" - if "target_configuration" not in kwargs: - kwargs["target_configuration"] = TargetConfigurationUnknown(tag="") - if "credential_provider_configurations" not in kwargs: - kwargs["credential_provider_configurations"] = [] - return kwargs - - -@dataclass(kw_only=True) -class GetGatewayTargetOutput: - """Dataclass for GetGatewayTargetOutput structure.""" - - gateway_arn: str - """The Amazon Resource Name (ARN) of the gateway.""" - - target_id: str - """The unique identifier of the gateway target.""" - - created_at: datetime - """The timestamp when the gateway target was created.""" - - updated_at: datetime - """The timestamp when the gateway target was last updated.""" - - status: str - """The current status of the gateway target.""" - - name: str = field(repr=False) - """The name of the gateway target.""" - - target_configuration: "TargetConfiguration" - """ - The configuration for a gateway target. This structure defines how the - gateway connects to and interacts with the target endpoint. - """ - - credential_provider_configurations: list[CredentialProviderConfiguration] - """The credential provider configurations for the gateway target.""" - - status_reasons: list[str] | None = None - """The reasons for the current status of the gateway target.""" - - description: str | None = field(repr=False, default=None) - """The description of the gateway target.""" - - last_synchronized_at: datetime | None = None - """The last synchronization of the target.""" - - metadata_configuration: MetadataConfiguration | None = None - """ - The metadata configuration for HTTP header and query parameter - propagation for the retrieved gateway target. - """ - - private_endpoint: PrivateEndpoint | None = None - """The private endpoint configuration for the gateway target.""" - - private_endpoint_managed_resources: list[ManagedResourceDetails] | None = None - """ - The managed resources created by the gateway for private endpoint - connectivity. - """ - - authorization_data: AuthorizationData | None = None - """ - OAuth2 authorization data for the gateway target. This data is returned - when a target is configured with a credential provider with - authorization code grant type and requires user federation. - """ - - protocol_type: str | None = None - """The protocol type of the gateway target.""" - - certificate_configurations: list[CertificateConfiguration] | None = None - """ - The private certificate authority (CA) configurations for the gateway - target. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_GATEWAY_TARGET_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_GATEWAY_TARGET_OUTPUT.members["gatewayArn"], self.gateway_arn - ) - serializer.write_string( - _SCHEMA_GET_GATEWAY_TARGET_OUTPUT.members["targetId"], self.target_id - ) - serializer.write_timestamp( - _SCHEMA_GET_GATEWAY_TARGET_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_GET_GATEWAY_TARGET_OUTPUT.members["updatedAt"], self.updated_at - ) - serializer.write_string( - _SCHEMA_GET_GATEWAY_TARGET_OUTPUT.members["status"], self.status - ) - if self.status_reasons is not None: - _serialize_status_reasons( - serializer, - _SCHEMA_GET_GATEWAY_TARGET_OUTPUT.members["statusReasons"], - self.status_reasons, - ) - - serializer.write_string( - _SCHEMA_GET_GATEWAY_TARGET_OUTPUT.members["name"], self.name - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_GATEWAY_TARGET_OUTPUT.members["description"], - self.description, - ) - - serializer.write_struct( - _SCHEMA_GET_GATEWAY_TARGET_OUTPUT.members["targetConfiguration"], - self.target_configuration, - ) - _serialize_credential_provider_configurations( - serializer, - _SCHEMA_GET_GATEWAY_TARGET_OUTPUT.members[ - "credentialProviderConfigurations" - ], - self.credential_provider_configurations, - ) - if self.last_synchronized_at is not None: - serializer.write_timestamp( - _SCHEMA_GET_GATEWAY_TARGET_OUTPUT.members["lastSynchronizedAt"], - self.last_synchronized_at, - ) - - if self.metadata_configuration is not None: - serializer.write_struct( - _SCHEMA_GET_GATEWAY_TARGET_OUTPUT.members["metadataConfiguration"], - self.metadata_configuration, - ) - - if self.private_endpoint is not None: - serializer.write_struct( - _SCHEMA_GET_GATEWAY_TARGET_OUTPUT.members["privateEndpoint"], - self.private_endpoint, - ) - - if self.private_endpoint_managed_resources is not None: - _serialize_private_endpoint_managed_resources( - serializer, - _SCHEMA_GET_GATEWAY_TARGET_OUTPUT.members[ - "privateEndpointManagedResources" - ], - self.private_endpoint_managed_resources, - ) - - if self.authorization_data is not None: - serializer.write_struct( - _SCHEMA_GET_GATEWAY_TARGET_OUTPUT.members["authorizationData"], - self.authorization_data, - ) - - if self.protocol_type is not None: - serializer.write_string( - _SCHEMA_GET_GATEWAY_TARGET_OUTPUT.members["protocolType"], - self.protocol_type, - ) - - if self.certificate_configurations is not None: - _serialize_certificate_configuration_list( - serializer, - _SCHEMA_GET_GATEWAY_TARGET_OUTPUT.members["certificateConfigurations"], - self.certificate_configurations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["gateway_arn"] = de.read_string( - _SCHEMA_GET_GATEWAY_TARGET_OUTPUT.members["gatewayArn"] - ) - - case 1: - kwargs["target_id"] = de.read_string( - _SCHEMA_GET_GATEWAY_TARGET_OUTPUT.members["targetId"] - ) - - case 2: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_GATEWAY_TARGET_OUTPUT.members["createdAt"] - ) - - case 3: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_GET_GATEWAY_TARGET_OUTPUT.members["updatedAt"] - ) - - case 4: - kwargs["status"] = TargetStatus( - de.read_string( - _SCHEMA_GET_GATEWAY_TARGET_OUTPUT.members["status"] - ) - ) - - case 5: - kwargs["status_reasons"] = _deserialize_status_reasons( - de, _SCHEMA_GET_GATEWAY_TARGET_OUTPUT.members["statusReasons"] - ) - - case 6: - kwargs["name"] = de.read_string( - _SCHEMA_GET_GATEWAY_TARGET_OUTPUT.members["name"] - ) - - case 7: - kwargs["description"] = de.read_string( - _SCHEMA_GET_GATEWAY_TARGET_OUTPUT.members["description"] - ) - - case 8: - kwargs["target_configuration"] = ( - _TargetConfigurationDeserializer().deserialize(de) - ) - - case 9: - kwargs["credential_provider_configurations"] = ( - _deserialize_credential_provider_configurations( - de, - _SCHEMA_GET_GATEWAY_TARGET_OUTPUT.members[ - "credentialProviderConfigurations" - ], - ) - ) - - case 10: - kwargs["last_synchronized_at"] = de.read_timestamp( - _SCHEMA_GET_GATEWAY_TARGET_OUTPUT.members["lastSynchronizedAt"] - ) - - case 11: - kwargs["metadata_configuration"] = ( - MetadataConfiguration.deserialize(de) - ) - - case 12: - kwargs["private_endpoint"] = ( - _PrivateEndpointDeserializer().deserialize(de) - ) - - case 13: - kwargs["private_endpoint_managed_resources"] = ( - _deserialize_private_endpoint_managed_resources( - de, - _SCHEMA_GET_GATEWAY_TARGET_OUTPUT.members[ - "privateEndpointManagedResources" - ], - ) - ) - - case 14: - kwargs["authorization_data"] = ( - _AuthorizationDataDeserializer().deserialize(de) - ) - - case 15: - kwargs["protocol_type"] = TargetProtocolType( - de.read_string( - _SCHEMA_GET_GATEWAY_TARGET_OUTPUT.members["protocolType"] - ) - ) - - case 16: - kwargs["certificate_configurations"] = ( - _deserialize_certificate_configuration_list( - de, - _SCHEMA_GET_GATEWAY_TARGET_OUTPUT.members[ - "certificateConfigurations" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_GATEWAY_TARGET_OUTPUT, consumer=_consumer) - if "gateway_arn" not in kwargs: - kwargs["gateway_arn"] = "" - if "target_id" not in kwargs: - kwargs["target_id"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "status" not in kwargs: - kwargs["status"] = TargetStatus._corrected("") - if "name" not in kwargs: - kwargs["name"] = "" - if "target_configuration" not in kwargs: - kwargs["target_configuration"] = TargetConfigurationUnknown(tag="") - if "credential_provider_configurations" not in kwargs: - kwargs["credential_provider_configurations"] = [] - return kwargs - - -@dataclass(kw_only=True) -class UpdateGatewayTargetInput: - """Dataclass for UpdateGatewayTargetInput structure.""" - - gateway_identifier: str | None = None - """The unique identifier of the gateway associated with the target.""" - - target_id: str | None = None - """The unique identifier of the gateway target to update.""" - - name: str | None = field(repr=False, default=None) - """The updated name for the gateway target.""" - - description: str | None = field(repr=False, default=None) - """The updated description for the gateway target.""" - - target_configuration: "TargetConfiguration | None" = None - """ - The configuration for a gateway target. This structure defines how the - gateway connects to and interacts with the target endpoint. - """ - - credential_provider_configurations: list[CredentialProviderConfiguration] | None = ( - None +DELETE_PAYMENT_CREDENTIAL_PROVIDER: APIOperation[ + DeletePaymentCredentialProviderInput, DeletePaymentCredentialProviderOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_PAYMENT_CREDENTIAL_PROVIDER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#UnauthorizedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +GET_PAYMENT_CREDENTIAL_PROVIDER: APIOperation[ + GetPaymentCredentialProviderInput, GetPaymentCredentialProviderOutput +] = APIOperation( + static_schema=_SCHEMA_GET_PAYMENT_CREDENTIAL_PROVIDER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#DecryptionFailure"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#UnauthorizedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +LIST_PAYMENT_CREDENTIAL_PROVIDERS: APIOperation[ + ListPaymentCredentialProvidersInput, ListPaymentCredentialProvidersOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_PAYMENT_CREDENTIAL_PROVIDERS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#UnauthorizedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +UPDATE_PAYMENT_CREDENTIAL_PROVIDER: APIOperation[ + UpdatePaymentCredentialProviderInput, UpdatePaymentCredentialProviderOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_PAYMENT_CREDENTIAL_PROVIDER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#DecryptionFailure"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#EncryptionFailure"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#UnauthorizedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +CREATE_PAYMENT_MANAGER: APIOperation[ + CreatePaymentManagerInput, CreatePaymentManagerOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_PAYMENT_MANAGER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +DELETE_PAYMENT_MANAGER: APIOperation[ + DeletePaymentManagerInput, DeletePaymentManagerOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_PAYMENT_MANAGER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +GET_PAYMENT_MANAGER: APIOperation[GetPaymentManagerInput, GetPaymentManagerOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_PAYMENT_MANAGER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) - """The updated credential provider configurations for the gateway target.""" - - metadata_configuration: MetadataConfiguration | None = None - """ - Configuration for HTTP header and query parameter propagation to the - gateway target. - """ - - private_endpoint: PrivateEndpoint | None = None - """ - The private endpoint configuration for the gateway target. Use this to - connect the gateway to private resources in your VPC. - """ - - certificate_configurations: list[CertificateConfiguration] | None = None - """ - The private certificate authority (CA) configurations for the gateway - target. Use this to have the gateway trust a private CA when it - establishes TLS connections to the target endpoint. Provide each - certificate by reference to an Amazon S3 object or an Amazon Web - Services Secrets Manager secret. You can specify only one certificate - authority configuration in this list. To remove a previously configured - certificate authority, omit this field on update. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_GATEWAY_TARGET_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.gateway_identifier is not None: - serializer.write_string( - _SCHEMA_UPDATE_GATEWAY_TARGET_INPUT.members["gatewayIdentifier"], - self.gateway_identifier, - ) - - if self.target_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_GATEWAY_TARGET_INPUT.members["targetId"], self.target_id - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_UPDATE_GATEWAY_TARGET_INPUT.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_GATEWAY_TARGET_INPUT.members["description"], - self.description, - ) - - if self.target_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_GATEWAY_TARGET_INPUT.members["targetConfiguration"], - self.target_configuration, - ) - - if self.credential_provider_configurations is not None: - _serialize_credential_provider_configurations( - serializer, - _SCHEMA_UPDATE_GATEWAY_TARGET_INPUT.members[ - "credentialProviderConfigurations" - ], - self.credential_provider_configurations, - ) - - if self.metadata_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_GATEWAY_TARGET_INPUT.members["metadataConfiguration"], - self.metadata_configuration, - ) - - if self.private_endpoint is not None: - serializer.write_struct( - _SCHEMA_UPDATE_GATEWAY_TARGET_INPUT.members["privateEndpoint"], - self.private_endpoint, - ) - - if self.certificate_configurations is not None: - _serialize_certificate_configuration_list( - serializer, - _SCHEMA_UPDATE_GATEWAY_TARGET_INPUT.members[ - "certificateConfigurations" - ], - self.certificate_configurations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["gateway_identifier"] = de.read_string( - _SCHEMA_UPDATE_GATEWAY_TARGET_INPUT.members["gatewayIdentifier"] - ) - - case 1: - kwargs["target_id"] = de.read_string( - _SCHEMA_UPDATE_GATEWAY_TARGET_INPUT.members["targetId"] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_GATEWAY_TARGET_INPUT.members["name"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_GATEWAY_TARGET_INPUT.members["description"] - ) - - case 4: - kwargs["target_configuration"] = ( - _TargetConfigurationDeserializer().deserialize(de) - ) - - case 5: - kwargs["credential_provider_configurations"] = ( - _deserialize_credential_provider_configurations( - de, - _SCHEMA_UPDATE_GATEWAY_TARGET_INPUT.members[ - "credentialProviderConfigurations" - ], - ) - ) - - case 6: - kwargs["metadata_configuration"] = ( - MetadataConfiguration.deserialize(de) - ) - - case 7: - kwargs["private_endpoint"] = ( - _PrivateEndpointDeserializer().deserialize(de) - ) - - case 8: - kwargs["certificate_configurations"] = ( - _deserialize_certificate_configuration_list( - de, - _SCHEMA_UPDATE_GATEWAY_TARGET_INPUT.members[ - "certificateConfigurations" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_GATEWAY_TARGET_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateGatewayTargetOutput: - """Dataclass for UpdateGatewayTargetOutput structure.""" - - gateway_arn: str - """The Amazon Resource Name (ARN) of the gateway.""" - - target_id: str - """The unique identifier of the updated gateway target.""" - - created_at: datetime - """The timestamp when the gateway target was created.""" - - updated_at: datetime - """The timestamp when the gateway target was last updated.""" - - status: str - """The current status of the updated gateway target.""" - - name: str = field(repr=False) - """The updated name of the gateway target.""" - - target_configuration: "TargetConfiguration" - """ - The configuration for a gateway target. This structure defines how the - gateway connects to and interacts with the target endpoint. - """ - - credential_provider_configurations: list[CredentialProviderConfiguration] - """The updated credential provider configurations for the gateway target.""" +) + +LIST_PAYMENT_MANAGERS: APIOperation[ + ListPaymentManagersInput, ListPaymentManagersOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_PAYMENT_MANAGERS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - status_reasons: list[str] | None = None - """The reasons for the current status of the updated gateway target.""" +CREATE_PAYMENT_CONNECTOR: APIOperation[ + CreatePaymentConnectorInput, CreatePaymentConnectorOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_PAYMENT_CONNECTOR, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#SubscriptionRequiredException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - description: str | None = field(repr=False, default=None) - """The updated description of the gateway target.""" +DELETE_PAYMENT_CONNECTOR: APIOperation[ + DeletePaymentConnectorInput, DeletePaymentConnectorOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_PAYMENT_CONNECTOR, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - last_synchronized_at: datetime | None = None - """The date and time at which the targets were last synchronized.""" +GET_PAYMENT_CONNECTOR: APIOperation[ + GetPaymentConnectorInput, GetPaymentConnectorOutput +] = APIOperation( + static_schema=_SCHEMA_GET_PAYMENT_CONNECTOR, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - metadata_configuration: MetadataConfiguration | None = None - """The metadata configuration that was applied to the gateway target.""" +LIST_PAYMENT_CONNECTORS: APIOperation[ + ListPaymentConnectorsInput, ListPaymentConnectorsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_PAYMENT_CONNECTORS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - private_endpoint: PrivateEndpoint | None = None - """The private endpoint configuration for the gateway target.""" +ROTATE_PAYMENT_CONNECTOR_CREDENTIALS: APIOperation[ + RotatePaymentConnectorCredentialsInput, RotatePaymentConnectorCredentialsOutput +] = APIOperation( + static_schema=_SCHEMA_ROTATE_PAYMENT_CONNECTOR_CREDENTIALS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - private_endpoint_managed_resources: list[ManagedResourceDetails] | None = None - """ - The managed resources created by the gateway for private endpoint - connectivity. - """ +UPDATE_PAYMENT_CONNECTOR: APIOperation[ + UpdatePaymentConnectorInput, UpdatePaymentConnectorOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_PAYMENT_CONNECTOR, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#SubscriptionRequiredException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - authorization_data: AuthorizationData | None = None - """ - OAuth2 authorization data for the updated gateway target. This data is - returned when a target is configured with a credential provider with - authorization code grant type and requires user federation. - """ +UPDATE_PAYMENT_MANAGER: APIOperation[ + UpdatePaymentManagerInput, UpdatePaymentManagerOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_PAYMENT_MANAGER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - protocol_type: str | None = None - """The protocol type of the updated gateway target.""" +CREATE_POLICY_ENGINE: APIOperation[ + CreatePolicyEngineInput, CreatePolicyEngineOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_POLICY_ENGINE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - certificate_configurations: list[CertificateConfiguration] | None = None - """ - The private certificate authority (CA) configurations for the gateway - target. - """ +DELETE_POLICY_ENGINE: APIOperation[ + DeletePolicyEngineInput, DeletePolicyEngineOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_POLICY_ENGINE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False +GET_POLICY_ENGINE: APIOperation[GetPolicyEngineInput, GetPolicyEngineOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_POLICY_ENGINE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_GATEWAY_TARGET_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_UPDATE_GATEWAY_TARGET_OUTPUT.members["gatewayArn"], self.gateway_arn - ) - serializer.write_string( - _SCHEMA_UPDATE_GATEWAY_TARGET_OUTPUT.members["targetId"], self.target_id - ) - serializer.write_timestamp( - _SCHEMA_UPDATE_GATEWAY_TARGET_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_UPDATE_GATEWAY_TARGET_OUTPUT.members["updatedAt"], self.updated_at - ) - serializer.write_string( - _SCHEMA_UPDATE_GATEWAY_TARGET_OUTPUT.members["status"], self.status - ) - if self.status_reasons is not None: - _serialize_status_reasons( - serializer, - _SCHEMA_UPDATE_GATEWAY_TARGET_OUTPUT.members["statusReasons"], - self.status_reasons, - ) - - serializer.write_string( - _SCHEMA_UPDATE_GATEWAY_TARGET_OUTPUT.members["name"], self.name - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_GATEWAY_TARGET_OUTPUT.members["description"], - self.description, - ) - - serializer.write_struct( - _SCHEMA_UPDATE_GATEWAY_TARGET_OUTPUT.members["targetConfiguration"], - self.target_configuration, - ) - _serialize_credential_provider_configurations( - serializer, - _SCHEMA_UPDATE_GATEWAY_TARGET_OUTPUT.members[ - "credentialProviderConfigurations" - ], - self.credential_provider_configurations, - ) - if self.last_synchronized_at is not None: - serializer.write_timestamp( - _SCHEMA_UPDATE_GATEWAY_TARGET_OUTPUT.members["lastSynchronizedAt"], - self.last_synchronized_at, - ) - - if self.metadata_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_GATEWAY_TARGET_OUTPUT.members["metadataConfiguration"], - self.metadata_configuration, - ) - - if self.private_endpoint is not None: - serializer.write_struct( - _SCHEMA_UPDATE_GATEWAY_TARGET_OUTPUT.members["privateEndpoint"], - self.private_endpoint, - ) - - if self.private_endpoint_managed_resources is not None: - _serialize_private_endpoint_managed_resources( - serializer, - _SCHEMA_UPDATE_GATEWAY_TARGET_OUTPUT.members[ - "privateEndpointManagedResources" - ], - self.private_endpoint_managed_resources, - ) - - if self.authorization_data is not None: - serializer.write_struct( - _SCHEMA_UPDATE_GATEWAY_TARGET_OUTPUT.members["authorizationData"], - self.authorization_data, - ) - - if self.protocol_type is not None: - serializer.write_string( - _SCHEMA_UPDATE_GATEWAY_TARGET_OUTPUT.members["protocolType"], - self.protocol_type, - ) - - if self.certificate_configurations is not None: - _serialize_certificate_configuration_list( - serializer, - _SCHEMA_UPDATE_GATEWAY_TARGET_OUTPUT.members[ - "certificateConfigurations" - ], - self.certificate_configurations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["gateway_arn"] = de.read_string( - _SCHEMA_UPDATE_GATEWAY_TARGET_OUTPUT.members["gatewayArn"] - ) - - case 1: - kwargs["target_id"] = de.read_string( - _SCHEMA_UPDATE_GATEWAY_TARGET_OUTPUT.members["targetId"] - ) - - case 2: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_UPDATE_GATEWAY_TARGET_OUTPUT.members["createdAt"] - ) - - case 3: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_UPDATE_GATEWAY_TARGET_OUTPUT.members["updatedAt"] - ) - - case 4: - kwargs["status"] = TargetStatus( - de.read_string( - _SCHEMA_UPDATE_GATEWAY_TARGET_OUTPUT.members["status"] - ) - ) - - case 5: - kwargs["status_reasons"] = _deserialize_status_reasons( - de, - _SCHEMA_UPDATE_GATEWAY_TARGET_OUTPUT.members["statusReasons"], - ) - - case 6: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_GATEWAY_TARGET_OUTPUT.members["name"] - ) +) + +GET_POLICY_ENGINE_SUMMARY: APIOperation[ + GetPolicyEngineSummaryInput, GetPolicyEngineSummaryOutput +] = APIOperation( + static_schema=_SCHEMA_GET_POLICY_ENGINE_SUMMARY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 7: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_GATEWAY_TARGET_OUTPUT.members["description"] - ) +LIST_POLICY_ENGINES: APIOperation[ListPolicyEnginesInput, ListPolicyEnginesOutput] = ( + APIOperation( + static_schema=_SCHEMA_LIST_POLICY_ENGINES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - case 8: - kwargs["target_configuration"] = ( - _TargetConfigurationDeserializer().deserialize(de) - ) +LIST_POLICY_ENGINE_SUMMARIES: APIOperation[ + ListPolicyEngineSummariesInput, ListPolicyEngineSummariesOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_POLICY_ENGINE_SUMMARIES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 9: - kwargs["credential_provider_configurations"] = ( - _deserialize_credential_provider_configurations( - de, - _SCHEMA_UPDATE_GATEWAY_TARGET_OUTPUT.members[ - "credentialProviderConfigurations" - ], - ) - ) +UPDATE_POLICY_ENGINE: APIOperation[ + UpdatePolicyEngineInput, UpdatePolicyEngineOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_POLICY_ENGINE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 10: - kwargs["last_synchronized_at"] = de.read_timestamp( - _SCHEMA_UPDATE_GATEWAY_TARGET_OUTPUT.members[ - "lastSynchronizedAt" - ] - ) +GET_POLICY_GENERATION: APIOperation[ + GetPolicyGenerationInput, GetPolicyGenerationOutput +] = APIOperation( + static_schema=_SCHEMA_GET_POLICY_GENERATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 11: - kwargs["metadata_configuration"] = ( - MetadataConfiguration.deserialize(de) - ) +GET_POLICY_GENERATION_SUMMARY: APIOperation[ + GetPolicyGenerationSummaryInput, GetPolicyGenerationSummaryOutput +] = APIOperation( + static_schema=_SCHEMA_GET_POLICY_GENERATION_SUMMARY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 12: - kwargs["private_endpoint"] = ( - _PrivateEndpointDeserializer().deserialize(de) - ) +LIST_POLICY_GENERATION_ASSETS: APIOperation[ + ListPolicyGenerationAssetsInput, ListPolicyGenerationAssetsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_POLICY_GENERATION_ASSETS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 13: - kwargs["private_endpoint_managed_resources"] = ( - _deserialize_private_endpoint_managed_resources( - de, - _SCHEMA_UPDATE_GATEWAY_TARGET_OUTPUT.members[ - "privateEndpointManagedResources" - ], - ) - ) +LIST_POLICY_GENERATIONS: APIOperation[ + ListPolicyGenerationsInput, ListPolicyGenerationsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_POLICY_GENERATIONS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 14: - kwargs["authorization_data"] = ( - _AuthorizationDataDeserializer().deserialize(de) - ) +LIST_POLICY_GENERATION_SUMMARIES: APIOperation[ + ListPolicyGenerationSummariesInput, ListPolicyGenerationSummariesOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_POLICY_GENERATION_SUMMARIES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 15: - kwargs["protocol_type"] = TargetProtocolType( - de.read_string( - _SCHEMA_UPDATE_GATEWAY_TARGET_OUTPUT.members["protocolType"] - ) - ) +START_POLICY_GENERATION: APIOperation[ + StartPolicyGenerationInput, StartPolicyGenerationOutput +] = APIOperation( + static_schema=_SCHEMA_START_POLICY_GENERATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 16: - kwargs["certificate_configurations"] = ( - _deserialize_certificate_configuration_list( - de, - _SCHEMA_UPDATE_GATEWAY_TARGET_OUTPUT.members[ - "certificateConfigurations" - ], - ) - ) +CREATE_POLICY: APIOperation[CreatePolicyInput, CreatePolicyOutput] = APIOperation( + static_schema=_SCHEMA_CREATE_POLICY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case _: - logger.debug("Unexpected member schema: %s", schema) +DELETE_POLICY: APIOperation[DeletePolicyInput, DeletePolicyOutput] = APIOperation( + static_schema=_SCHEMA_DELETE_POLICY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - deserializer.read_struct( - _SCHEMA_UPDATE_GATEWAY_TARGET_OUTPUT, consumer=_consumer - ) - if "gateway_arn" not in kwargs: - kwargs["gateway_arn"] = "" - if "target_id" not in kwargs: - kwargs["target_id"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "status" not in kwargs: - kwargs["status"] = TargetStatus._corrected("") - if "name" not in kwargs: - kwargs["name"] = "" - if "target_configuration" not in kwargs: - kwargs["target_configuration"] = TargetConfigurationUnknown(tag="") - if "credential_provider_configurations" not in kwargs: - kwargs["credential_provider_configurations"] = [] - return kwargs +GET_POLICY: APIOperation[GetPolicyInput, GetPolicyOutput] = APIOperation( + static_schema=_SCHEMA_GET_POLICY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +GET_POLICY_SUMMARY: APIOperation[GetPolicySummaryInput, GetPolicySummaryOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_POLICY_SUMMARY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) -GET_GATEWAY_TARGET = APIOperation( - input=GetGatewayTargetInput, - output=GetGatewayTargetOutput, - schema=_SCHEMA_GET_GATEWAY_TARGET, - input_schema=_SCHEMA_GET_GATEWAY_TARGET_INPUT, - output_schema=_SCHEMA_GET_GATEWAY_TARGET_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), +LIST_POLICIES: APIOperation[ListPoliciesInput, ListPoliciesOutput] = APIOperation( + static_schema=_SCHEMA_LIST_POLICIES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, +) + +LIST_POLICY_SUMMARIES: APIOperation[ + ListPolicySummariesInput, ListPolicySummariesOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_POLICY_SUMMARIES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +UPDATE_POLICY: APIOperation[UpdatePolicyInput, UpdatePolicyOutput] = APIOperation( + static_schema=_SCHEMA_UPDATE_POLICY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) +PUT_RESOURCE_POLICY: APIOperation[PutResourcePolicyInput, PutResourcePolicyOutput] = ( + APIOperation( + static_schema=_SCHEMA_PUT_RESOURCE_POLICY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) -def _serialize_gateway_target_list( - serializer: ShapeSerializer, schema: Schema, value: list[GatewayTarget] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - +CREATE_REGISTRY_RECORD: APIOperation[ + CreateRegistryRecordInput, CreateRegistryRecordOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_REGISTRY_RECORD, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +DELETE_REGISTRY_RECORD: APIOperation[ + DeleteRegistryRecordInput, DeleteRegistryRecordOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_REGISTRY_RECORD, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +GET_REGISTRY_RECORD: APIOperation[GetRegistryRecordInput, GetRegistryRecordOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_REGISTRY_RECORD, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) -def _deserialize_gateway_target_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GatewayTarget]: - result: list[GatewayTarget] = [] +LIST_REGISTRY_RECORDS: APIOperation[ + ListRegistryRecordsInput, ListRegistryRecordsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_REGISTRY_RECORDS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() +SUBMIT_REGISTRY_RECORD_FOR_APPROVAL: APIOperation[ + SubmitRegistryRecordForApprovalInput, SubmitRegistryRecordForApprovalOutput +] = APIOperation( + static_schema=_SCHEMA_SUBMIT_REGISTRY_RECORD_FOR_APPROVAL, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - else: - result.append(GatewayTarget.deserialize(d)) +UPDATE_REGISTRY_RECORD: APIOperation[ + UpdateRegistryRecordInput, UpdateRegistryRecordOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_REGISTRY_RECORD, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - deserializer.read_list(schema, _read_value) - return result +UPDATE_REGISTRY_RECORD_STATUS: APIOperation[ + UpdateRegistryRecordStatusInput, UpdateRegistryRecordStatusOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_REGISTRY_RECORD_STATUS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +CREATE_REGISTRY: APIOperation[CreateRegistryInput, CreateRegistryOutput] = APIOperation( + static_schema=_SCHEMA_CREATE_REGISTRY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -@dataclass(kw_only=True) -class SynchronizeGatewayTargetsOutput: - """Dataclass for SynchronizeGatewayTargetsOutput structure.""" +DELETE_REGISTRY: APIOperation[DeleteRegistryInput, DeleteRegistryOutput] = APIOperation( + static_schema=_SCHEMA_DELETE_REGISTRY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - targets: "list[GatewayTarget] | None" = None - """The gateway targets for synchronization.""" +GET_REGISTRY: APIOperation[GetRegistryInput, GetRegistryOutput] = APIOperation( + static_schema=_SCHEMA_GET_REGISTRY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ +LIST_REGISTRIES: APIOperation[ListRegistriesInput, ListRegistriesOutput] = APIOperation( + static_schema=_SCHEMA_LIST_REGISTRIES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SYNCHRONIZE_GATEWAY_TARGETS_OUTPUT, self) +UPDATE_REGISTRY: APIOperation[UpdateRegistryInput, UpdateRegistryOutput] = APIOperation( + static_schema=_SCHEMA_UPDATE_REGISTRY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize_members(self, serializer: ShapeSerializer): - if self.targets is not None: - _serialize_gateway_target_list( - serializer, - _SCHEMA_SYNCHRONIZE_GATEWAY_TARGETS_OUTPUT.members["targets"], - self.targets, - ) +SET_TOKEN_VAULT_CMK: APIOperation[SetTokenVaultCMKInput, SetTokenVaultCMKOutput] = ( + APIOperation( + static_schema=_SCHEMA_SET_TOKEN_VAULT_CMK, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID( + "com.amazonaws.bedrockagentcorecontrol#ConcurrentModificationException" + ), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#UnauthorizedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) +TAG_RESOURCE: APIOperation[TagResourceInput, TagResourceOutput] = APIOperation( + static_schema=_SCHEMA_TAG_RESOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +UNTAG_RESOURCE: APIOperation[UntagResourceInput, UntagResourceOutput] = APIOperation( + static_schema=_SCHEMA_UNTAG_RESOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["targets"] = _deserialize_gateway_target_list( - de, - _SCHEMA_SYNCHRONIZE_GATEWAY_TARGETS_OUTPUT.members["targets"], - ) +CREATE_WORKLOAD_IDENTITY: APIOperation[ + CreateWorkloadIdentityInput, CreateWorkloadIdentityOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_WORKLOAD_IDENTITY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#UnauthorizedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case _: - logger.debug("Unexpected member schema: %s", schema) +DELETE_WORKLOAD_IDENTITY: APIOperation[ + DeleteWorkloadIdentityInput, DeleteWorkloadIdentityOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_WORKLOAD_IDENTITY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#UnauthorizedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - deserializer.read_struct( - _SCHEMA_SYNCHRONIZE_GATEWAY_TARGETS_OUTPUT, consumer=_consumer - ) - return kwargs +GET_WORKLOAD_IDENTITY: APIOperation[ + GetWorkloadIdentityInput, GetWorkloadIdentityOutput +] = APIOperation( + static_schema=_SCHEMA_GET_WORKLOAD_IDENTITY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#UnauthorizedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +LIST_WORKLOAD_IDENTITIES: APIOperation[ + ListWorkloadIdentitiesInput, ListWorkloadIdentitiesOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_WORKLOAD_IDENTITIES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#UnauthorizedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +UPDATE_WORKLOAD_IDENTITY: APIOperation[ + UpdateWorkloadIdentityInput, UpdateWorkloadIdentityOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_WORKLOAD_IDENTITY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#UnauthorizedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +GET_GATEWAY_TARGET: APIOperation[GetGatewayTargetInput, GetGatewayTargetOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_GATEWAY_TARGET, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) -SYNCHRONIZE_GATEWAY_TARGETS = APIOperation( - input=SynchronizeGatewayTargetsInput, - output=SynchronizeGatewayTargetsOutput, - schema=_SCHEMA_SYNCHRONIZE_GATEWAY_TARGETS, - input_schema=_SCHEMA_SYNCHRONIZE_GATEWAY_TARGETS_INPUT, - output_schema=_SCHEMA_SYNCHRONIZE_GATEWAY_TARGETS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), +SYNCHRONIZE_GATEWAY_TARGETS: APIOperation[ + SynchronizeGatewayTargetsInput, SynchronizeGatewayTargetsOutput +] = APIOperation( + static_schema=_SCHEMA_SYNCHRONIZE_GATEWAY_TARGETS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), + ], effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], ) -CREATE_GATEWAY_TARGET = APIOperation( - input=CreateGatewayTargetInput, - output=CreateGatewayTargetOutput, - schema=_SCHEMA_CREATE_GATEWAY_TARGET, - input_schema=_SCHEMA_CREATE_GATEWAY_TARGET_INPUT, - output_schema=_SCHEMA_CREATE_GATEWAY_TARGET_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, +CREATE_GATEWAY_TARGET: APIOperation[ + CreateGatewayTargetInput, CreateGatewayTargetOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_GATEWAY_TARGET, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) -UPDATE_GATEWAY_TARGET = APIOperation( - input=UpdateGatewayTargetInput, - output=UpdateGatewayTargetOutput, - schema=_SCHEMA_UPDATE_GATEWAY_TARGET, - input_schema=_SCHEMA_UPDATE_GATEWAY_TARGET_INPUT, - output_schema=_SCHEMA_UPDATE_GATEWAY_TARGET_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcorecontrol#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, +UPDATE_GATEWAY_TARGET: APIOperation[ + UpdateGatewayTargetInput, UpdateGatewayTargetOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_GATEWAY_TARGET, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcorecontrol#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcorecontrol#ValidationException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) diff --git a/clients/aws-sdk-bedrock-agentcore-control/src/aws_sdk_bedrock_agentcore_control/models.pyi b/clients/aws-sdk-bedrock-agentcore-control/src/aws_sdk_bedrock_agentcore_control/models.pyi new file mode 100644 index 00000000..5c330e1c --- /dev/null +++ b/clients/aws-sdk-bedrock-agentcore-control/src/aws_sdk_bedrock_agentcore_control/models.pyi @@ -0,0 +1,19434 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. + +from dataclasses import dataclass +from datetime import datetime +from enum import StrEnum +from typing import Self, Union + +from smithy_core.deserializers import ShapeDeserializer +from smithy_core.documents import Document +from smithy_core.exceptions import ModeledError +from smithy_core.response import ResponseMetadata +from smithy_core.schemas import APIOperation +from smithy_core.serializers import ShapeSerializer +from smithy_core.types import UnknownEnumMixin + +class _SerdeShape: + def serialize(self, serializer: ShapeSerializer) -> None: ... + def serialize_members(self, serializer: ShapeSerializer) -> None: ... + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: ... + +class ServiceError(ModeledError): + """ + Base error for all errors in the service. + + Some exceptions do not extend from this class, including + synthetic, implicit, and shared exception types. + """ + +@dataclass(kw_only=True) +class A2aDescriptor(_SerdeShape): + """ + The Agent-to-Agent (A2A) protocol descriptor for a registry record. + Contains the agent card definition as defined by the A2A protocol + specification. + """ + + agent_card: AgentCardDefinition | None = ... + """ + The agent card definition for the A2A agent, as defined by the A2A + protocol specification. + """ + +@dataclass(kw_only=True) +class AccessDeniedException(ServiceError, _SerdeShape): + """This exception is thrown when a request is denied per access permissions""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass +class ActionConfigurationBundle(_SerdeShape): + """An action that applies a configuration bundle override to the request.""" + + value: ConfigurationBundleAction + +@dataclass +class ActionRouteToTarget(_SerdeShape): + """An action that routes the request to a specific target.""" + + value: RouteToTargetAction + +@dataclass +class ActionUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +Action = Union[ActionConfigurationBundle | ActionRouteToTarget | ActionUnknown] +"""An action to take when a gateway rule's conditions are met.""" + +class _ActionDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> Action: ... + +class ActorTokenContentType(UnknownEnumMixin, StrEnum): + NONE = "NONE" + M2_M = "M2M" + AWS_IAM_ID_TOKEN_JWT = "AWS_IAM_ID_TOKEN_JWT" + +@dataclass(kw_only=True) +class AddDatasetExamplesInput(_SerdeShape): + """Dataclass for AddDatasetExamplesInput structure.""" + + dataset_id: str | None = ... + """The unique identifier of the dataset to add examples to.""" + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If you don't specify this field, a + value is randomly generated for you. If this token matches a previous + request, the service ignores the request, but doesn't return an error. + For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + source: DataSourceType | None = ... + """ + Source of examples to add. Provide either inline examples or an S3 URI + pointing to a JSONL file. + """ + +@dataclass(kw_only=True) +class AddDatasetExamplesOutput(_SerdeShape): + """Dataclass for AddDatasetExamplesOutput structure.""" + + dataset_arn: str + """The Amazon Resource Name (ARN) of the dataset.""" + dataset_id: str + """The unique identifier of the dataset.""" + status: str + """The current status of the dataset.""" + added_count: int + """The number of examples added.""" + updated_at: datetime + """The timestamp when the examples were added.""" + example_ids: list[str] + """IDs of all added examples (auto-generated UUIDs).""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class AgentCardDefinition(_SerdeShape): + """ + The agent card definition for an A2A descriptor. Contains the schema + version and inline content for the agent card. + """ + + schema_version: str | None = ... + """ + The schema version of the agent card based on the A2A protocol + specification. + """ + inline_content: str | None = ... + """ + The JSON content containing the A2A agent card definition, conforming to + the A2A protocol specification. + """ + +class AgentManagedRuntimeType(UnknownEnumMixin, StrEnum): + PYTHON_3_10 = "PYTHON_3_10" + PYTHON_3_11 = "PYTHON_3_11" + PYTHON_3_12 = "PYTHON_3_12" + PYTHON_3_13 = "PYTHON_3_13" + PYTHON_3_14 = "PYTHON_3_14" + NODE_22 = "NODE_22" + +@dataclass(kw_only=True) +class AgentRuntime(_SerdeShape): + """ + Contains information about an agent runtime. An agent runtime is the + execution environment for a Amazon Bedrock AgentCore Agent. + """ + + agent_runtime_arn: str + """The Amazon Resource Name (ARN) of the agent runtime.""" + agent_runtime_id: str + """The unique identifier of the agent runtime.""" + agent_runtime_version: str + """The version of the agent runtime.""" + agent_runtime_name: str + """The name of the agent runtime.""" + description: str + """The description of the agent runtime.""" + last_updated_at: datetime + """The timestamp when the agent runtime was last updated.""" + status: str + """The current status of the agent runtime.""" + +@dataclass +class AgentRuntimeArtifactContainerConfiguration(_SerdeShape): + """The container configuration for the agent artifact.""" + + value: ContainerConfiguration + +@dataclass +class AgentRuntimeArtifactCodeConfiguration(_SerdeShape): + """ + The code configuration for the agent runtime artifact, including the + source code location and execution settings. + """ + + value: CodeConfiguration + +@dataclass +class AgentRuntimeArtifactUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +AgentRuntimeArtifact = Union[ + AgentRuntimeArtifactContainerConfiguration + | AgentRuntimeArtifactCodeConfiguration + | AgentRuntimeArtifactUnknown +] +"""The artifact of the agent.""" + +class _AgentRuntimeArtifactDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> AgentRuntimeArtifact: ... + +@dataclass(kw_only=True) +class AgentRuntimeEndpoint(_SerdeShape): + """ + Contains information about an agent runtime endpoint. An endpoint + provides a way to connect to and interact with an agent runtime. + """ + + name: str + """The name of the agent runtime endpoint.""" + live_version: str | None = ... + """ + The live version of the agent runtime endpoint. This is the version that + is currently serving requests. + """ + target_version: str | None = ... + """ + The target version of the agent runtime endpoint. This is the version + that the endpoint is being updated to. + """ + agent_runtime_endpoint_arn: str + """The Amazon Resource Name (ARN) of the agent runtime endpoint.""" + agent_runtime_arn: str + """ + The Amazon Resource Name (ARN) of the agent runtime associated with the + endpoint. + """ + status: str + """The current status of the agent runtime endpoint.""" + id: str + """The unique identifier of the agent runtime endpoint.""" + description: str | None = ... + """The description of the agent runtime endpoint.""" + created_at: datetime + """The timestamp when the agent runtime endpoint was created.""" + last_updated_at: datetime + """The timestamp when the agent runtime endpoint was last updated.""" + +class AgentRuntimeEndpointStatus(UnknownEnumMixin, StrEnum): + CREATING = "CREATING" + CREATE_FAILED = "CREATE_FAILED" + UPDATING = "UPDATING" + UPDATE_FAILED = "UPDATE_FAILED" + READY = "READY" + DELETING = "DELETING" + DELETE_FAILED = "DELETE_FAILED" + +class AgentRuntimeStatus(UnknownEnumMixin, StrEnum): + CREATING = "CREATING" + CREATE_FAILED = "CREATE_FAILED" + UPDATING = "UPDATING" + UPDATE_FAILED = "UPDATE_FAILED" + READY = "READY" + DELETING = "DELETING" + DELETE_FAILED = "DELETE_FAILED" + +@dataclass(kw_only=True) +class AgentRuntimeVersionSummary(_SerdeShape): + """ + Summary information about an agent runtime version associated with a + capacity provider. This is returned by + `ListAgentRuntimeVersionsByCapacityProvider`. + """ + + agent_runtime_arn: str + """The Amazon Resource Name (ARN) of the agent runtime.""" + agent_runtime_version: str + """The version of the agent runtime.""" + status: str + """The current status of the agent runtime version.""" + +@dataclass(kw_only=True) +class AgentSkillsDescriptor(_SerdeShape): + """ + The agent skills descriptor for a registry record. Contains an optional + skill markdown definition in human-readable format and an optional + structured skill definition. + """ + + skill_md: SkillMdDefinition | None = ... + """ + The optional skill markdown definition describing the agent's skills in + a human-readable format. + """ + skill_definition: SkillDefinition | None = ... + """The structured skill definition with schema version and content.""" + +@dataclass(kw_only=True) +class AllowedWorkloadConfiguration(_SerdeShape): + """ + The configuration that restricts which workloads in the request's + identity chain are allowed to invoke the target, identified by their + hosting environments and workload identities. At launch, this is + supported only for AgentCore Runtime targets, and the allowed workloads + are AgentCore Gateways. + """ + + hosting_environments: list[HostingEnvironment] | None = ... + """ + The list of hosting environments whose workloads are allowed to invoke + the target. At launch, the only supported hosting environment is + AgentCore Gateway. + """ + workload_identities: list[str] | None = ... + """The list of workload identities that are allowed to invoke the target.""" + +@dataclass(kw_only=True) +class ApiGatewayTargetConfiguration(_SerdeShape): + """The configuration for an Amazon API Gateway target.""" + + rest_api_id: str + """The ID of the API Gateway REST API.""" + stage: str + """The ID of the stage of the REST API to add as a target.""" + api_gateway_tool_configuration: ApiGatewayToolConfiguration + """ + The configuration for defining REST API tool filters and overrides for + the gateway target. + """ + +@dataclass(kw_only=True) +class ApiGatewayToolConfiguration(_SerdeShape): + """ + The configuration for defining REST API tool filters and overrides for + the gateway target. + """ + + tool_overrides: list[ApiGatewayToolOverride] | None = ... + """ + A list of explicit tool definitions with optional custom names and + descriptions. + """ + tool_filters: list[ApiGatewayToolFilter] + """ + A list of path and method patterns to expose as tools using metadata + from the REST API's OpenAPI specification. + """ + +@dataclass(kw_only=True) +class ApiGatewayToolFilter(_SerdeShape): + """ + Specifies which operations from an API Gateway REST API are exposed as + tools. Tool names and descriptions are derived from the operationId and + description fields in the API's exported OpenAPI specification. + """ + + filter_path: str + """ + Resource path to match in the REST API. Supports exact paths (for + example, `/pets`) or wildcard paths (for example, `/pets/*` to match all + paths under `/pets`). Must match existing paths in the REST API. + """ + methods: list[str] + """The methods to filter for.""" + +@dataclass(kw_only=True) +class ApiGatewayToolOverride(_SerdeShape): + """Settings to override configurations for a tool.""" + + name: str + """The name of tool. Identifies the tool in the Model Context Protocol.""" + description: str | None = ... + """ + The description of the tool. Provides information about the purpose and + usage of the tool. If not provided, uses the description from the API's + OpenAPI specification. + """ + path: str + """ + Resource path in the REST API (e.g., `/pets`). Must explicitly match an + existing path in the REST API. + """ + method: str + """The HTTP method to expose for the specified path.""" + +class ApiKeyCredentialLocation(UnknownEnumMixin, StrEnum): + HEADER = "HEADER" + QUERY_PARAMETER = "QUERY_PARAMETER" + +@dataclass(kw_only=True) +class ApiKeyCredentialProviderItem(_SerdeShape): + """Contains information about an API key credential provider.""" + + name: str + """The name of the API key credential provider.""" + credential_provider_arn: str + """The Amazon Resource Name (ARN) of the API key credential provider.""" + created_time: datetime + """The timestamp when the API key credential provider was created.""" + last_updated_time: datetime + """The timestamp when the API key credential provider was last updated.""" + +@dataclass +class ApiSchemaConfigurationS3(_SerdeShape): + """ + The Amazon S3 configuration for a gateway. This structure defines how + the gateway accesses files in Amazon S3. + """ + + value: S3Configuration + +@dataclass +class ApiSchemaConfigurationInlinePayload(_SerdeShape): + """The inline payload containing the API schema definition.""" + + value: str + +@dataclass +class ApiSchemaConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ApiSchemaConfiguration = Union[ + ApiSchemaConfigurationS3 + | ApiSchemaConfigurationInlinePayload + | ApiSchemaConfigurationUnknown +] +"""Configuration for API schema.""" + +class _ApiSchemaConfigurationDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> ApiSchemaConfiguration: ... + +@dataclass(kw_only=True) +class ApprovalConfiguration(_SerdeShape): + """ + Configuration for the registry record approval workflow. Controls + whether records added to the registry require explicit approval before + becoming active. + """ + + auto_approval: bool = ... + """ + Whether registry records are auto-approved. When set to `true`, records + are automatically approved upon creation. When set to `false` (the + default), records require explicit approval for security purposes. + """ + +@dataclass(kw_only=True) +class AtlassianOauth2ProviderConfigInput(_SerdeShape): + """ + Configuration settings for connecting to Atlassian services using OAuth2 + authentication. This includes the client credentials required to + authenticate with Atlassian's OAuth2 authorization server. + """ + + client_id: str + """ + The client ID for the Atlassian OAuth2 provider. This identifier is + assigned by Atlassian when you register your application. + """ + client_secret: str = ... + """ + The client secret for the Atlassian OAuth2 provider. This secret is + assigned by Atlassian and used along with the client ID to authenticate + your application. + """ + client_secret_config: SecretReference | None = ... + """ + A reference to the Amazon Web Services Secrets Manager secret that + stores the client secret. This includes the secret ID and the JSON key + used to extract the client secret value from the secret. Required when + `clientSecretSource` is set to `EXTERNAL`. + """ + client_secret_source: str | None = ... + """ + The source type of the client secret for the Atlassian OAuth2 provider. + Use `MANAGED` if the secret is managed by the service, or `EXTERNAL` if + you manage the secret yourself in Amazon Web Services Secrets Manager. + """ + +@dataclass(kw_only=True) +class AtlassianOauth2ProviderConfigOutput(_SerdeShape): + """ + The configuration details returned for an Atlassian OAuth2 provider, + including the client ID and OAuth2 discovery information. + """ + + oauth_discovery: Oauth2Discovery + """Contains the discovery information for an OAuth2 provider.""" + client_id: str | None = ... + """The client ID for the Atlassian OAuth2 provider.""" + +@dataclass +class AuthorizationDataOauth2(_SerdeShape): + """OAuth2 authorization data for the gateway target.""" + + value: OAuth2AuthorizationData + +@dataclass +class AuthorizationDataUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +AuthorizationData = Union[AuthorizationDataOauth2 | AuthorizationDataUnknown] +""" +Contains the authorization data that is returned when a gateway target +is configured with a credential provider with authorization code grant +type and requires user federation. +""" + +class _AuthorizationDataDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> AuthorizationData: ... + +@dataclass +class AuthorizerConfigurationCustomJWTAuthorizer(_SerdeShape): + """ + The inbound JWT-based authorization, specifying how incoming requests + should be authenticated. + """ + + value: CustomJWTAuthorizerConfiguration + +@dataclass +class AuthorizerConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +AuthorizerConfiguration = Union[ + AuthorizerConfigurationCustomJWTAuthorizer | AuthorizerConfigurationUnknown +] +""" +Represents inbound authorization configuration options used to +authenticate incoming requests. +""" + +class _AuthorizerConfigurationDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> AuthorizerConfiguration: ... + +class AuthorizerType(UnknownEnumMixin, StrEnum): + CUSTOM_JWT = "CUSTOM_JWT" + AWS_IAM = "AWS_IAM" + NONE = "NONE" + AUTHENTICATE_ONLY = "AUTHENTICATE_ONLY" + +@dataclass(kw_only=True) +class AuthorizingClaimMatchValueType(_SerdeShape): + """ + Defines the value or values to match for and the relationship of the + match. + """ + + claim_match_value: ClaimMatchValueType + """The value or values to match for.""" + claim_match_operator: str + """ + Defines the relationship between the claim field value and the value or + values you're matching for. + """ + +@dataclass(kw_only=True) +class BatchPutGatewayRateLimitsInput(_SerdeShape): + """Dataclass for BatchPutGatewayRateLimitsInput structure.""" + + gateway_identifier: str | None = ... + """The unique identifier of the gateway.""" + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If you don't specify this field, a + value is randomly generated for you. If this token matches a previous + request, the service ignores the request, but doesn't return an error. + For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + rate_limits: list[BatchPutLimitEntry] | None = ... + """ + The complete set of rate limits for this gateway. This operation + replaces all existing rate limits in a single request. If the operation + fails, no rate limits are changed. + """ + +@dataclass(kw_only=True) +class BatchPutGatewayRateLimitsOutput(_SerdeShape): + """Dataclass for BatchPutGatewayRateLimitsOutput structure.""" + + rate_limits: list[GatewayRateLimitDetail] + """The resulting set of rate limits after the batch operation.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class BatchPutLimitEntry(_SerdeShape): + """ + A rate limit definition within a batch put request. If you provide a + `rateLimitId`, the service uses it for upsert matching against existing + rate limits. + """ + + rate_limit_id: str | None = ... + """ + The unique identifier of the rate limit. If provided, the service uses + it for upsert matching against existing rate limits. + """ + description: str | None = ... + """ + An optional human-readable description for this rate limit. If not + provided, the rate limit is created without a description. + """ + dimension_keys: list[str] + """ + The ordered list of dimension key names that define the scope of this + rate limit. + """ + entries: list[LimitEntry] + """ + The list of rule entries that map dimension values to rate + configurations. + """ + +@dataclass(kw_only=True) +class BedrockEvaluatorModelConfig(_SerdeShape): + """ + The configuration for using Amazon Bedrock models in evaluator + assessments, including model selection and inference parameters. + """ + + model_id: str + """ + The identifier of the Amazon Bedrock model to use for evaluation. Must + be a supported foundation model available in your region. + """ + inference_config: InferenceConfiguration | None = ... + """ + The inference configuration parameters that control model behavior + during evaluation, including temperature, token limits, and sampling + settings. + """ + additional_model_request_fields: Document | None = ... + """ + Additional model-specific request fields to customize model behavior + beyond the standard inference configuration. + """ + +@dataclass(kw_only=True) +class BrowserEnterprisePolicy(_SerdeShape): + """Browser enterprise policy configuration.""" + + location: ResourceLocation + """The location of the enterprise policy file.""" + type: str | None = ... + """ + The type of browser enterprise policy. Available values are `MANAGED` + and `RECOMMENDED`. + """ + +class BrowserEnterprisePolicyType(UnknownEnumMixin, StrEnum): + MANAGED = "MANAGED" + RECOMMENDED = "RECOMMENDED" + +@dataclass(kw_only=True) +class BrowserNetworkConfiguration(_SerdeShape): + """ + The network configuration for a browser. This structure defines how the + browser connects to the network. + """ + + network_mode: str = ... + """ + The network mode for the browser. This field specifies how the browser + connects to the network. + """ + vpc_config: VpcConfig | None = ... + """ + The VPC configuration for the browser. This configuration is required + when the network mode is set to `VPC`. + """ + +class BrowserNetworkMode(UnknownEnumMixin, StrEnum): + PUBLIC = "PUBLIC" + VPC = "VPC" + +class BrowserProfileStatus(UnknownEnumMixin, StrEnum): + """The status of a browser profile.""" + + READY = "READY" + DELETING = "DELETING" + DELETED = "DELETED" + SAVING = "SAVING" + +@dataclass(kw_only=True) +class BrowserProfileSummary(_SerdeShape): + """ + Contains summary information about a browser profile. A browser profile + stores persistent browser data that can be reused across browser + sessions. + """ + + profile_id: str + """The unique identifier of the browser profile.""" + profile_arn: str + """The Amazon Resource Name (ARN) of the browser profile.""" + name: str + """The name of the browser profile.""" + description: str | None = ... + """The description of the browser profile.""" + status: str + """ + The current status of the browser profile. Possible values include + READY, SAVING, DELETING, and DELETED. + """ + created_at: datetime + """The timestamp when the browser profile was created.""" + last_updated_at: datetime + """The timestamp when the browser profile was last updated.""" + last_saved_at: datetime | None = ... + """The timestamp when browser session data was last saved to this profile.""" + last_saved_browser_session_id: str | None = ... + """ + The identifier of the browser session from which data was last saved to + this profile. + """ + last_saved_browser_id: str | None = ... + """ + The identifier of the browser from which data was last saved to this + profile. + """ + +@dataclass(kw_only=True) +class BrowserSigningConfigInput(_SerdeShape): + """ + Configuration for enabling browser signing capabilities that allow + agents to cryptographically identify themselves to websites using HTTP + message signatures. + """ + + enabled: bool = ... + """ + Specifies whether browser signing is enabled. When enabled, the browser + will cryptographically sign HTTP requests to identify itself as an AI + agent to bot control vendors. + """ + +@dataclass(kw_only=True) +class BrowserSigningConfigOutput(_SerdeShape): + """ + The current browser signing configuration that shows whether + cryptographic agent identification is enabled for web bot + authentication. + """ + + enabled: bool = ... + """ + Indicates whether browser signing is currently enabled for cryptographic + agent identification using HTTP message signatures. + """ + +class BrowserStatus(UnknownEnumMixin, StrEnum): + CREATING = "CREATING" + CREATE_FAILED = "CREATE_FAILED" + READY = "READY" + DELETING = "DELETING" + DELETE_FAILED = "DELETE_FAILED" + DELETED = "DELETED" + +@dataclass(kw_only=True) +class BrowserSummary(_SerdeShape): + """ + Contains summary information about a browser. A browser enables Amazon + Bedrock AgentCore Agent to interact with web content. + """ + + browser_id: str + """The unique identifier of the browser.""" + browser_arn: str + """The Amazon Resource Name (ARN) of the browser.""" + name: str | None = ... + """The name of the browser.""" + description: str | None = ... + """The description of the browser.""" + status: str + """The current status of the browser.""" + created_at: datetime + """The timestamp when the browser was created.""" + last_updated_at: datetime | None = ... + """The timestamp when the browser was last updated.""" + +@dataclass(kw_only=True) +class CapacityProviderConfiguration(_SerdeShape): + """ + Configuration for customer-managed compute capacity for the AgentCore + Runtime. A capacity provider runs the AgentCore Runtime on the Instances + compute type, using Amazon Web Services managed compute in your account. + """ + + capacity_provider_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the capacity provider to use for the + AgentCore Runtime. + """ + +class CapacityProviderStatus(UnknownEnumMixin, StrEnum): + """ + The status of a capacity provider. Possible values: + + - `CREATING` -- The service is creating the capacity provider and + validating its configuration. + + - `CREATE_FAILED` -- The service could not create the capacity provider. + For details, see `statusCode` and `statusReason`. + + - `UPDATING` -- The service is updating the capacity provider. + + - `UPDATE_FAILED` -- The service could not update the capacity provider. + For details, see `statusCode` and `statusReason`. + + - `READY` -- The capacity provider is available for use. + + - `DELETING` -- The service is deleting the capacity provider. + + - `DELETE_FAILED` -- The service could not delete the capacity provider. + You can retry the deletion. + """ + + CREATING = "CREATING" + CREATE_FAILED = "CREATE_FAILED" + UPDATING = "UPDATING" + UPDATE_FAILED = "UPDATE_FAILED" + READY = "READY" + DELETING = "DELETING" + DELETE_FAILED = "DELETE_FAILED" + +class CapacityProviderStatusCode(UnknownEnumMixin, StrEnum): + """ + A reason code for a capacity provider that is not in the `READY` state. + Possible values: + + - `VALIDATION_ERROR` -- A configuration error prevented the operation. + For example, missing permissions, invalid parameters, or a naming + conflict. + + - `QUOTA_EXCEEDED` -- An Amazon EC2 resource quota was exceeded. Request + a limit increase or remove unused resources. + + - `THROTTLED` -- The request was throttled. Retry after a short delay. + + - `INTERNAL_SERVER_EXCEPTION` -- An internal error occurred. + """ + + VALIDATION_ERROR = "VALIDATION_ERROR" + QUOTA_EXCEEDED = "QUOTA_EXCEEDED" + THROTTLED = "THROTTLED" + INTERNAL_SERVER_EXCEPTION = "INTERNAL_SERVER_EXCEPTION" + +@dataclass(kw_only=True) +class CapacityProviderSummary(_SerdeShape): + """ + A summary of a capacity provider, as returned by + `ListCapacityProviders`. Each summary includes the capacity provider + identifier, Amazon Resource Name (ARN), name, status, and last-updated + timestamp. + """ + + capacity_provider_id: str + """The unique identifier of the capacity provider.""" + capacity_provider_arn: str + """The Amazon Resource Name (ARN) of the capacity provider.""" + name: str + """The name of the capacity provider.""" + status: str + """ + The current status of the capacity provider. For possible values, see + `CapacityProviderStatus`. + """ + last_updated_at: datetime + """The timestamp when the capacity provider was last updated.""" + +@dataclass(kw_only=True) +class CapacityProviderVolumeConfiguration(_SerdeShape): + """ + Configuration for a capacity provider volume mounted into the AgentCore + Runtime. This references a persistent volume by its logical name, as + defined in the capacity provider's list of volumes. + """ + + volume_name: str + """ + The logical name of the capacity provider volume to mount. This name + must match a volume that is defined in the capacity provider's list of + volumes. + """ + mount_path: str + """ + The mount path for the capacity provider volume inside the AgentCore + Runtime. The path must be under `/mnt` with exactly one subdirectory + level (for example, `/mnt/data`). + """ + +class CapacityReservationPreference(UnknownEnumMixin, StrEnum): + CAPACITY_RESERVATIONS_ONLY = "capacity-reservations-only" + OPEN = "open" + NONE = "none" + +@dataclass(kw_only=True) +class CapacityReservationSpecification(_SerdeShape): + """The Capacity Reservation targeting option for the instances.""" + + capacity_reservation_preference: str | None = ... + """The Capacity Reservation preference for the instances.""" + capacity_reservation_target: CapacityReservationTarget | None = ... + """ + The target Capacity Reservation or Capacity Reservation group for the + instances. + """ + +@dataclass(kw_only=True) +class CapacityReservationTarget(_SerdeShape): + """ + Information about the target Capacity Reservation or Capacity + Reservation group for the instances. + """ + + capacity_reservation_id: str | None = ... + """The ID of the Capacity Reservation in which to run the instances.""" + capacity_reservation_resource_group_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the Capacity Reservation resource + group in which to run the instances. + """ + +@dataclass(kw_only=True) +class CategoricalScaleDefinition(_SerdeShape): + """ + The definition of a categorical rating scale option that provides a + named category with its description for evaluation scoring. + """ + + definition: str + """ + The description that explains what this categorical rating represents + and when it should be used. + """ + label: str + """The label or name of this categorical rating option.""" + +@dataclass(kw_only=True) +class CedarPolicy(_SerdeShape): + """ + Represents a Cedar policy statement within the AgentCore Policy system. + Cedar is a policy language designed for authorization that provides + human-readable, analyzable, and high-performance policy evaluation for + controlling agent behavior and access decisions. + """ + + statement: str + """ + The Cedar policy statement that defines the authorization logic. This + statement follows Cedar syntax and specifies principals, actions, + resources, and conditions that determine when access should be allowed + or denied. + """ + +@dataclass(kw_only=True) +class Certificate(_SerdeShape): + """A certificate to install in the browser or code interpreter.""" + + location: CertificateLocation + """The location of the certificate.""" + +@dataclass +class CertificateConfigurationS3(_SerdeShape): + """The Amazon S3 location of the PEM-encoded private CA certificate.""" + + value: S3CertificateConfiguration + +@dataclass +class CertificateConfigurationSecretsManager(_SerdeShape): + """ + The Amazon Web Services Secrets Manager location of the PEM-encoded + private CA certificate. + """ + + value: SecretsManagerCertificateConfiguration + +@dataclass +class CertificateConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +CertificateConfiguration = Union[ + CertificateConfigurationS3 + | CertificateConfigurationSecretsManager + | CertificateConfigurationUnknown +] +""" +A reference to a private certificate authority (CA) certificate that the +gateway uses to verify TLS connections to the target endpoint. Use this +when the target presents a certificate issued by a private CA that is +not trusted by default. Specify exactly one certificate source. The +configuration is a reference only and never contains the certificate +content. +""" + +class _CertificateConfigurationDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> CertificateConfiguration: ... + +@dataclass +class CertificateLocationSecretsManager(_SerdeShape): + """The Amazon Web Services Secrets Manager location of the certificate.""" + + value: SecretsManagerLocation + +@dataclass +class CertificateLocationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +CertificateLocation = Union[ + CertificateLocationSecretsManager | CertificateLocationUnknown +] +"""The location from which to retrieve a certificate.""" + +class _CertificateLocationDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> CertificateLocation: ... + +class ClaimMatchOperatorType(UnknownEnumMixin, StrEnum): + EQUALS = "EQUALS" + CONTAINS = "CONTAINS" + CONTAINS_ANY = "CONTAINS_ANY" + +@dataclass +class ClaimMatchValueTypeMatchValueString(_SerdeShape): + """The string value to match for.""" + + value: str + +@dataclass +class ClaimMatchValueTypeMatchValueStringList(_SerdeShape): + """An array of strings to check for a match.""" + + value: list[str] + +@dataclass +class ClaimMatchValueTypeUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ClaimMatchValueType = Union[ + ClaimMatchValueTypeMatchValueString + | ClaimMatchValueTypeMatchValueStringList + | ClaimMatchValueTypeUnknown +] +""" +The value or values to match for. + +- Include a `matchValueString` with the `EQUALS` operator to specify a + string that matches the claim field value. + +- Include a `matchValueArray` to specify an array of string values. You + can use the following operators: + + - Use `CONTAINS` to yield a match if the claim field value is in the + array. + + - Use `CONTAINS_ANY` to yield a match if the claim field value + contains any of the strings in the array. +""" + +class _ClaimMatchValueTypeDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> ClaimMatchValueType: ... + +class ClientAuthenticationMethodType(UnknownEnumMixin, StrEnum): + CLIENT_SECRET_BASIC = "CLIENT_SECRET_BASIC" + CLIENT_SECRET_POST = "CLIENT_SECRET_POST" + AWS_IAM_ID_TOKEN_JWT = "AWS_IAM_ID_TOKEN_JWT" + PRIVATE_KEY_JWT = "PRIVATE_KEY_JWT" + +@dataclass(kw_only=True) +class CloudWatchLogsInputConfig(_SerdeShape): + """ + The configuration for reading agent traces from CloudWatch logs as input + for online evaluation. + """ + + log_group_names: list[str] = ... + """The list of CloudWatch log group names to monitor for agent traces.""" + log_group_name_prefixes: list[str] | None = ... + """ + The list of CloudWatch log group name prefixes to monitor for agent + traces. Specify this instead of `logGroupNames` to match log groups by + prefix. Specify either `logGroupNames` or `logGroupNamePrefixes`, not + both. One of the two is required. + """ + service_names: list[str] + """ + The list of service names to filter traces within the specified log + groups. Used to identify relevant agent sessions. + """ + +@dataclass(kw_only=True) +class CloudWatchOutputConfig(_SerdeShape): + """ + The configuration for writing evaluation results to CloudWatch logs with + embedded metric format (EMF) for monitoring. + """ + + log_group_name: str = ... + """ + The name of the CloudWatch log group where evaluation results will be + written. An existing log group is used as-is; otherwise the service + creates it, which requires the evaluation execution role to grant + `logs:CreateLogGroup` on the log group. Don't specify this value when + `resultDestination` is `SOURCE_LOG_GROUP`. The name can't be under the + service-reserved `/aws/bedrock-agentcore/evaluations/` namespace, apart + from this configuration's own service-managed default group. + """ + metrics_namespace: str | None = ... + """ + The CloudWatch metrics namespace where evaluation result metrics are + published. If you omit this value, the service publishes metrics to + `Bedrock-AgentCore/Evaluations`. This value can't begin with `AWS/`. + """ + result_destination: str = ... + """ + The destination where evaluation results are written. Valid values: + + - `DEDICATED_LOG_GROUP` (default) -- Writes results to a dedicated + result log group. + + - `SOURCE_LOG_GROUP` -- Writes results back to the log group that the + agent traces were read from. If you use this value, don't specify + `logGroupName`. + """ + +@dataclass(kw_only=True) +class ClusteringConfig(_SerdeShape): + """ + Configuration for periodic batch evaluation clustering, specifying how + often clustering jobs run. + """ + + frequencies: list[str] + """ + The list of frequencies at which clustering batch evaluations are + triggered. + """ + +class ClusteringFrequency(UnknownEnumMixin, StrEnum): + DAILY = "DAILY" + WEEKLY = "WEEKLY" + MONTHLY = "MONTHLY" + +@dataclass +class CodeS3(_SerdeShape): + """ + The Amazon Amazon S3 object that contains the source code for the agent + runtime. + """ + + value: S3Location + +@dataclass +class CodeUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +Code = Union[CodeS3 | CodeUnknown] +""" +The source code configuration that specifies the location and details of +the code to be executed. +""" + +class _CodeDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> Code: ... + +@dataclass +class CodeBasedEvaluatorConfigLambdaConfig(_SerdeShape): + """The Lambda function configuration for code-based evaluation.""" + + value: LambdaEvaluatorConfig + +@dataclass +class CodeBasedEvaluatorConfigUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +CodeBasedEvaluatorConfig = Union[ + CodeBasedEvaluatorConfigLambdaConfig | CodeBasedEvaluatorConfigUnknown +] +""" +Configuration for a code-based evaluator. Specify the Lambda function to +use for evaluation. +""" + +class _CodeBasedEvaluatorConfigDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> CodeBasedEvaluatorConfig: ... + +@dataclass(kw_only=True) +class CodeConfiguration(_SerdeShape): + """ + The configuration for the source code that defines how the agent runtime + code should be executed, including the code location, runtime + environment, and entry point. + """ + + code: Code + """The source code location and configuration details.""" + runtime: str + """ + The runtime environment for executing the agent code. Specify the + programming language and version to use for the agent runtime. For valid + values, see the list of supported runtimes. + """ + entry_point: list[str] + """ + The entry point for the code execution, specifying the function or + method that should be invoked when the code runs. + """ + +@dataclass(kw_only=True) +class CodeInterpreterNetworkConfiguration(_SerdeShape): + """ + The network configuration for a code interpreter. This structure defines + how the code interpreter connects to the network. + """ + + network_mode: str = ... + """ + The network mode for the code interpreter. This field specifies how the + code interpreter connects to the network. + """ + vpc_config: VpcConfig | None = ... + """ + The VPC configuration for the code interpreter. This configuration is + required when the network mode is set to `VPC`. + """ + +class CodeInterpreterNetworkMode(UnknownEnumMixin, StrEnum): + PUBLIC = "PUBLIC" + SANDBOX = "SANDBOX" + VPC = "VPC" + +class CodeInterpreterStatus(UnknownEnumMixin, StrEnum): + CREATING = "CREATING" + CREATE_FAILED = "CREATE_FAILED" + READY = "READY" + DELETING = "DELETING" + DELETE_FAILED = "DELETE_FAILED" + DELETED = "DELETED" + +@dataclass(kw_only=True) +class CodeInterpreterSummary(_SerdeShape): + """ + Contains summary information about a code interpreter. A code + interpreter enables Amazon Bedrock AgentCore Agent to execute code. + """ + + code_interpreter_id: str + """The unique identifier of the code interpreter.""" + code_interpreter_arn: str + """The Amazon Resource Name (ARN) of the code interpreter.""" + name: str | None = ... + """The name of the code interpreter.""" + description: str | None = ... + """The description of the code interpreter.""" + status: str + """The current status of the code interpreter.""" + created_at: datetime + """The timestamp when the code interpreter was created.""" + last_updated_at: datetime | None = ... + """The timestamp when the code interpreter was last updated.""" + +@dataclass(kw_only=True) +class CoinbaseCdpConfigurationInput(_SerdeShape): + """ + Coinbase CDP configuration --- credentials provided by Coinbase + Developer Platform. + """ + + api_key_id: str + """The API key identifier provided by Coinbase Developer Platform.""" + api_key_secret: str = ... + """The API key secret provided by Coinbase Developer Platform.""" + api_key_secret_source: str | None = ... + """ + The source type of the API key secret for the Coinbase Developer + Platform. Use `MANAGED` if the secret is managed by the service, or + `EXTERNAL` if you manage the secret yourself in Amazon Web Services + Secrets Manager. + """ + api_key_secret_config: SecretReference | None = ... + """ + A reference to the Amazon Web Services Secrets Manager secret that + stores the API key secret. This includes the secret ID and the JSON key + used to extract the API key secret value from the secret. Required when + `apiKeySecretSource` is set to `EXTERNAL`. + """ + wallet_secret: str = ... + """The wallet secret provided by Coinbase Developer Platform.""" + wallet_secret_source: str | None = ... + """ + The source type of the wallet secret for the Coinbase Developer + Platform. Use `MANAGED` if the secret is managed by the service, or + `EXTERNAL` if you manage the secret yourself in Amazon Web Services + Secrets Manager. + """ + wallet_secret_config: SecretReference | None = ... + """ + A reference to the Amazon Web Services Secrets Manager secret that + stores the wallet secret. This includes the secret ID and the JSON key + used to extract the wallet secret value from the secret. Required when + `walletSecretSource` is set to `EXTERNAL`. + """ + +@dataclass(kw_only=True) +class CoinbaseCdpConfigurationOutput(_SerdeShape): + """Coinbase CDP configuration output with secret ARNs.""" + + api_key_id: str + """The API key identifier provided by Coinbase Developer Platform.""" + api_key_secret_arn: Secret + """ + Contains information about a secret in Amazon Web Services Secrets + Manager. + """ + api_key_secret_json_key: str | None = ... + """ + The JSON key used to extract the API key secret value from the Amazon + Web Services Secrets Manager secret. + """ + api_key_secret_source: str | None = ... + """ + The source type of the API key secret. Either `MANAGED` if the secret is + managed by the service, or `EXTERNAL` if managed by the user in Amazon + Web Services Secrets Manager. + """ + wallet_secret_arn: Secret + """ + Contains information about a secret in Amazon Web Services Secrets + Manager. + """ + wallet_secret_json_key: str | None = ... + """ + The JSON key used to extract the wallet secret value from the Amazon Web + Services Secrets Manager secret. + """ + wallet_secret_source: str | None = ... + """ + The source type of the wallet secret. Either `MANAGED` if the secret is + managed by the service, or `EXTERNAL` if managed by the user in Amazon + Web Services Secrets Manager. + """ + +@dataclass(kw_only=True) +class CoinbaseCdpRotationTargets(_SerdeShape): + """Specifies the service-managed Coinbase CDP secrets to rotate.""" + + secrets: list[str] + """ + The secrets to rotate. Specify at least one value. Each secret that you + specify is rotated independently. + + - `API_KEY` - The API key that the payment connector uses to call + Coinbase CDP. Rotate it as routine maintenance, or if you suspect that + it is compromised. + + - `WALLET_SECRET` - The wallet secret that signs transactions. Rotate it + only if it is lost or compromised. Coinbase CDP allows one wallet + secret per project, so it is replaced in place and signing can be + briefly interrupted. + """ + +class CoinbaseCdpSecret(UnknownEnumMixin, StrEnum): + API_KEY = "API_KEY" + WALLET_SECRET = "WALLET_SECRET" + +@dataclass(kw_only=True) +class ComponentConfiguration(_SerdeShape): + """ + The configuration for a component within a configuration bundle. The + component type is inferred from the component identifier ARN. + """ + + configuration: Document + """The configuration values as a flexible JSON document.""" + +@dataclass +class ComputeConfigurationEc2Configuration(_SerdeShape): + """The Amazon EC2 compute configuration for the capacity provider.""" + + value: Ec2Configuration + +@dataclass +class ComputeConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ComputeConfiguration = Union[ + ComputeConfigurationEc2Configuration | ComputeConfigurationUnknown +] +""" +The compute configuration for a capacity provider. This structure +defines the type and settings of the compute resources used to launch +instances. +""" + +class _ComputeConfigurationDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> ComputeConfiguration: ... + +@dataclass(kw_only=True) +class ConcurrentModificationException(ServiceError, _SerdeShape): + """ + Exception thrown when a resource is modified concurrently by multiple + requests. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass +class ConditionMatchPrincipals(_SerdeShape): + """ + A condition that matches on the identity of the caller making the + request. + """ + + value: MatchPrincipals + +@dataclass +class ConditionMatchPaths(_SerdeShape): + """A condition that matches on the request path.""" + + value: MatchPaths + +@dataclass +class ConditionUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +Condition = Union[ConditionMatchPrincipals | ConditionMatchPaths | ConditionUnknown] +""" +A condition that determines when a gateway rule applies. Conditions can +match on principals or request paths. +""" + +class _ConditionDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> Condition: ... + +@dataclass +class ConfigurationBundleActionStaticOverride(_SerdeShape): + """ + A static configuration bundle override that applies a single bundle + version to all matching requests. + """ + + value: StaticOverride + +@dataclass +class ConfigurationBundleActionWeightedOverride(_SerdeShape): + """ + A weighted configuration bundle override that splits traffic between + multiple bundle versions based on configured weights. + """ + + value: WeightedOverride + +@dataclass +class ConfigurationBundleActionUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ConfigurationBundleAction = Union[ + ConfigurationBundleActionStaticOverride + | ConfigurationBundleActionWeightedOverride + | ConfigurationBundleActionUnknown +] +""" +An action that applies a configuration bundle override, either as a +static override or a weighted split for A/B testing. +""" + +class _ConfigurationBundleActionDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> ConfigurationBundleAction: ... + +@dataclass(kw_only=True) +class ConfigurationBundleReference(_SerdeShape): + """A reference to a specific version of a configuration bundle.""" + + bundle_arn: str + """The Amazon Resource Name (ARN) of the configuration bundle.""" + bundle_version: str + """The version of the configuration bundle.""" + +class ConfigurationBundleStatus(UnknownEnumMixin, StrEnum): + ACTIVE = "ACTIVE" + CREATING = "CREATING" + CREATE_FAILED = "CREATE_FAILED" + UPDATING = "UPDATING" + UPDATE_FAILED = "UPDATE_FAILED" + DELETING = "DELETING" + DELETE_FAILED = "DELETE_FAILED" + +@dataclass(kw_only=True) +class ConfigurationBundleSummary(_SerdeShape): + """Summary information about a configuration bundle.""" + + bundle_arn: str + """The Amazon Resource Name (ARN) of the configuration bundle.""" + bundle_id: str + """The unique identifier of the configuration bundle.""" + bundle_name: str + """The name of the configuration bundle.""" + description: str | None = ... + """The description of the configuration bundle.""" + created_at: datetime | None = ... + """The timestamp when the configuration bundle was created.""" + +@dataclass(kw_only=True) +class ConfigurationBundleVersionSummary(_SerdeShape): + """Summary information about a configuration bundle version.""" + + bundle_arn: str + """The Amazon Resource Name (ARN) of the configuration bundle.""" + bundle_id: str + """The unique identifier of the configuration bundle.""" + version_id: str + """The version identifier of this configuration bundle version.""" + lineage_metadata: VersionLineageMetadata | None = ... + """ + The version lineage metadata, including parent versions, branch name, + and creation source. + """ + version_created_at: datetime + """The timestamp when this version was created.""" + +@dataclass(kw_only=True) +class ConflictException(ServiceError, _SerdeShape): + """ + This exception is thrown when there is a conflict performing an + operation + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ConnectorConfiguration(_SerdeShape): + """Configuration for a single tool within a connector.""" + + name: str + """The tool or operation name (for example, `retrieve` or `webSearch`).""" + description: str | None = ... + """An agent-facing description override for this tool.""" + parameter_values: Document | None = ... + """ + Parameters to set as fixed or default values when provisioning this + tool. + """ + parameter_overrides: list[ConnectorParameterOverride] | None = ... + """ + Parameters to expose to the agent at runtime, with optional description + overrides. + """ + +@dataclass(kw_only=True) +class ConnectorParameterOverride(_SerdeShape): + """ + Specifies a parameter override for a connector tool, allowing you to + control parameter visibility and descriptions. + """ + + path: str + """ + A JSON Pointer path identifying the parameter (for example, + `/numberOfResults` or `/filter`). + """ + description: str | None = ... + """An agent-facing description override for this parameter.""" + visible: bool | None = ... + """ + Whether this parameter is visible to the agent. If not specified, uses + the service default. + """ + +@dataclass(kw_only=True) +class ConnectorSource(_SerdeShape): + """The source identifying the connector integration.""" + + connector_id: str + """ + The identifier for the connector integration (for example, + `bedrock-knowledge-bases`). + """ + version: str | None = ... + """ + The version of the connector to use (for example, `1.1.0`). If you + don't specify a version, the service uses the latest available version. + """ + +@dataclass(kw_only=True) +class ConnectorTargetConfiguration(_SerdeShape): + """ + Configuration for a connector integration target. Connectors provide + pre-built integrations with Amazon Web Services services and third-party + tools. + """ + + source: ConnectorSource + """The source configuration identifying which connector to use.""" + enabled: list[str] | None = ... + """ + A list of tool names to enable from this connector. If absent, all tools + provided by the connector are enabled. + """ + configurations: list[ConnectorConfiguration] | None = ... + """A list of per-tool configurations for the connector.""" + +@dataclass(kw_only=True) +class ConsentPortalIdpConfig(_SerdeShape): + """ + The identity provider configuration used to authenticate end users to + the consent portal. + """ + + credential_provider_arn: str + """ + The Amazon Resource Name (ARN) of the OAuth2 credential provider used to + authenticate end users to the consent portal. + """ + scopes: list[str] + """ + The OAuth2 scopes that the consent portal requests when authenticating + end users. + """ + audience: str | None = ... + """ + The audience value that the consent portal includes when requesting + tokens from the identity provider. + """ + +@dataclass(kw_only=True) +class ConsentPortalSource(_SerdeShape): + """A resource served by the consent portal.""" + + identifier: str + """ + The identifier of the source resource. For an `agentcore-gateway` + source, this is the gateway ID or its Amazon Resource Name (ARN). + """ + type: str + """The type of the source resource.""" + +class ConsentPortalSourceType(UnknownEnumMixin, StrEnum): + """ + The type of a consent portal source. Currently, we only support type + `agentcore-gateway`. + """ + + AGENTCORE_GATEWAY = "agentcore-gateway" + +class ConsentPortalStatus(UnknownEnumMixin, StrEnum): + """The lifecycle status of a consent portal.""" + + CREATING = "CREATING" + ACTIVE = "ACTIVE" + UPDATING = "UPDATING" + UPDATE_FAILED = "UPDATE_FAILED" + DELETING = "DELETING" + FAILED = "FAILED" + +@dataclass(kw_only=True) +class ConsentPortalSummary(_SerdeShape): + """Summary information about a consent portal.""" + + sources: list[ConsentPortalSource] + """The resources served by the consent portal.""" + consent_portal_arn: str + """The Amazon Resource Name (ARN) of the consent portal.""" + consent_portal_id: str + """The unique identifier of the consent portal.""" + created_at: datetime + """The timestamp for when the consent portal was created.""" + description: str | None = ... + """The description of the consent portal.""" + name: str + """The name of the consent portal.""" + portal_url: str | None = ... + """The URL used to access the consent portal.""" + status: str + """The current status of the consent portal.""" + updated_at: datetime + """The timestamp for when the consent portal was last updated.""" + +@dataclass +class ConsolidationConfigurationCustomConsolidationConfiguration(_SerdeShape): + """The custom consolidation configuration.""" + + value: CustomConsolidationConfiguration + +@dataclass +class ConsolidationConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ConsolidationConfiguration = Union[ + ConsolidationConfigurationCustomConsolidationConfiguration + | ConsolidationConfigurationUnknown +] +"""Contains consolidation configuration information for a memory strategy.""" + +class _ConsolidationConfigurationDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> ConsolidationConfiguration: ... + +@dataclass(kw_only=True) +class ContainerConfiguration(_SerdeShape): + """Representation of a container configuration.""" + + container_uri: str + """The ECR URI of the container.""" + +@dataclass +class ContentRawText(_SerdeShape): + """ + The raw text content containing natural language descriptions of desired + policy behavior. This text is processed by AI to generate corresponding + Dogwood policy statements that match the described intent. + """ + + value: str + +@dataclass +class ContentUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +Content = Union[ContentRawText | ContentUnknown] +""" +Represents content input for policy generation operations. This +structure encapsulates the natural language descriptions or other +content formats that are used as input for AI-powered policy generation. +""" + +class _ContentDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> Content: ... + +@dataclass(kw_only=True) +class ContentConfiguration(_SerdeShape): + """Defines what content to stream and at what level of detail.""" + + type: str + """Type of content to stream.""" + level: str = ... + """Level of detail for streamed content.""" + +class ContentLevel(UnknownEnumMixin, StrEnum): + METADATA_ONLY = "METADATA_ONLY" + FULL_CONTENT = "FULL_CONTENT" + +class ContentType(UnknownEnumMixin, StrEnum): + MEMORY_RECORDS = "MEMORY_RECORDS" + +@dataclass(kw_only=True) +class CreateAgentRuntimeEndpointInput(_SerdeShape): + """Dataclass for CreateAgentRuntimeEndpointInput structure.""" + + agent_runtime_id: str | None = ... + """ + The unique identifier of the AgentCore Runtime to create an endpoint + for. + """ + name: str | None = ... + """The name of the AgentCore Runtime endpoint.""" + agent_runtime_version: str | None = ... + """The version of the AgentCore Runtime to use for the endpoint.""" + description: str | None = ... + """The description of the AgentCore Runtime endpoint.""" + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure idempotency of the + request. + """ + tags: dict[str, str] | None = ... + """ + A map of tag keys and values to assign to the agent runtime endpoint. + Tags enable you to categorize your resources in different ways, for + example, by purpose, owner, or environment. + """ + +@dataclass(kw_only=True) +class CreateAgentRuntimeEndpointOutput(_SerdeShape): + """Dataclass for CreateAgentRuntimeEndpointOutput structure.""" + + target_version: str + """The target version of the AgentCore Runtime for the endpoint.""" + agent_runtime_endpoint_arn: str + """The Amazon Resource Name (ARN) of the AgentCore Runtime endpoint.""" + agent_runtime_arn: str + """The Amazon Resource Name (ARN) of the AgentCore Runtime.""" + agent_runtime_id: str | None = ... + """The unique identifier of the AgentCore Runtime.""" + endpoint_name: str | None = ... + """The name of the AgentCore Runtime endpoint.""" + status: str + """The current status of the AgentCore Runtime endpoint.""" + created_at: datetime + """The timestamp when the AgentCore Runtime endpoint was created.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateAgentRuntimeInput(_SerdeShape): + """Dataclass for CreateAgentRuntimeInput structure.""" + + agent_runtime_name: str | None = ... + """The name of the AgentCore Runtime.""" + agent_runtime_artifact: AgentRuntimeArtifact | None = ... + """The artifact of the AgentCore Runtime.""" + role_arn: str | None = ... + """The IAM role ARN that provides permissions for the AgentCore Runtime.""" + network_configuration: NetworkConfiguration | None = ... + """The network configuration for the AgentCore Runtime.""" + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure idempotency of the + request. + """ + description: str | None = ... + """The description of the AgentCore Runtime.""" + authorizer_configuration: AuthorizerConfiguration | None = ... + """The authorizer configuration for the AgentCore Runtime.""" + request_header_configuration: RequestHeaderConfiguration | None = ... + """ + Configuration for HTTP request headers that will be passed through to + the runtime. + """ + protocol_configuration: ProtocolConfiguration | None = ... + """ + The protocol configuration for an agent runtime. This structure defines + how the agent runtime communicates with clients. + """ + lifecycle_configuration: LifecycleConfiguration | None = ... + """The life cycle configuration for the AgentCore Runtime.""" + environment_variables: dict[str, str] | None = ... + """Environment variables to set in the AgentCore Runtime environment.""" + filesystem_configurations: list[FilesystemConfiguration] | None = ... + """ + The filesystem configurations to mount into the AgentCore Runtime. Use + filesystem configurations to provide persistent storage to your + AgentCore Runtime sessions. + """ + capacity_provider_configuration: CapacityProviderConfiguration | None = ... + """ + The capacity provider configuration for the AgentCore Runtime. Use a + capacity provider to run the AgentCore Runtime on the Instances compute + type, which provisions Amazon Web Services managed compute in your + account. + """ + tags: dict[str, str] | None = ... + """ + A map of tag keys and values to assign to the agent runtime. Tags enable + you to categorize your resources in different ways, for example, by + purpose, owner, or environment. + """ + platform_version: str | None = ... + """The version of the runtime platform to use for the AgentCore Runtime.""" + +@dataclass(kw_only=True) +class CreateAgentRuntimeOutput(_SerdeShape): + """Dataclass for CreateAgentRuntimeOutput structure.""" + + agent_runtime_arn: str + """The Amazon Resource Name (ARN) of the AgentCore Runtime.""" + workload_identity_details: WorkloadIdentityDetails | None = ... + """The workload identity details for the AgentCore Runtime.""" + agent_runtime_id: str + """The unique identifier of the AgentCore Runtime.""" + agent_runtime_version: str + """The version of the AgentCore Runtime.""" + created_at: datetime + """The timestamp when the AgentCore Runtime was created.""" + status: str + """The current status of the AgentCore Runtime.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateApiKeyCredentialProviderInput(_SerdeShape): + """Dataclass for CreateApiKeyCredentialProviderInput structure.""" + + name: str | None = ... + """ + The name of the API key credential provider. The name must be unique + within your account. + """ + api_key: str = ... + """ + The API key to use for authentication. This value is encrypted and + stored securely. + """ + api_key_secret_config: SecretReference | None = ... + """ + A reference to the Amazon Web Services Secrets Manager secret that + stores the API key. This includes the secret ID and the JSON key used to + extract the API key value from the secret. Required when + `apiKeySecretSource` is set to `EXTERNAL`. + """ + api_key_secret_source: str | None = ... + """ + The source type of the API key secret. Use `MANAGED` if the secret is + managed by the service, or `EXTERNAL` if you manage the secret yourself + in Amazon Web Services Secrets Manager. + """ + tags: dict[str, str] | None = ... + """ + A map of tag keys and values to assign to the API key credential + provider. Tags enable you to categorize your resources in different + ways, for example, by purpose, owner, or environment. + """ + +@dataclass(kw_only=True) +class CreateApiKeyCredentialProviderOutput(_SerdeShape): + """Dataclass for CreateApiKeyCredentialProviderOutput structure.""" + + api_key_secret_arn: Secret + """The Amazon Resource Name (ARN) of the secret containing the API key.""" + api_key_secret_json_key: str | None = ... + """ + The JSON key used to extract the API key value from the Amazon Web + Services Secrets Manager secret. + """ + api_key_secret_source: str | None = ... + """ + The source type of the API key secret. Either `MANAGED` if the secret is + managed by the service, or `EXTERNAL` if managed by the user in Amazon + Web Services Secrets Manager. + """ + name: str + """The name of the created API key credential provider.""" + credential_provider_arn: str + """ + The Amazon Resource Name (ARN) of the created API key credential + provider. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateBrowserInput(_SerdeShape): + """Dataclass for CreateBrowserInput structure.""" + + name: str | None = ... + """The name of the browser. The name must be unique within your account.""" + description: str | None = ... + """The description of the browser.""" + execution_role_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the IAM role that provides permissions + for the browser to access Amazon Web Services services. + """ + network_configuration: BrowserNetworkConfiguration | None = ... + """ + The network configuration for the browser. This configuration specifies + the network mode for the browser. + """ + recording: RecordingConfig | None = ... + """ + The recording configuration for the browser. When enabled, browser + sessions are recorded and stored in the specified Amazon S3 location. + """ + browser_signing: BrowserSigningConfigInput | None = ... + """ + The browser signing configuration that enables cryptographic agent + identification using HTTP message signatures for web bot authentication. + """ + enterprise_policies: list[BrowserEnterprisePolicy] | None = ... + """A list of enterprise policy files for the browser.""" + certificates: list[Certificate] | None = ... + """A list of certificates to install in the browser.""" + filesystem_configurations: list[ToolsFileSystemConfiguration] | None = ... + """ + The file system configurations to mount into the browser. Use these + configurations to mount your own Amazon Simple Storage Service (Amazon + S3) Files or Amazon Elastic File System (Amazon EFS) access points. Your + sessions can then access your data. If you don't specify this field, no + file systems are mounted. + """ + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the operation + completes no more than one time. If this token matches a previous + request, Amazon Bedrock AgentCore ignores the request but does not + return an error. + """ + tags: dict[str, str] | None = ... + """ + A map of tag keys and values to assign to the browser. Tags enable you + to categorize your resources in different ways, for example, by purpose, + owner, or environment. + """ + +@dataclass(kw_only=True) +class CreateBrowserOutput(_SerdeShape): + """Dataclass for CreateBrowserOutput structure.""" + + browser_id: str + """The unique identifier of the created browser.""" + browser_arn: str + """The Amazon Resource Name (ARN) of the created browser.""" + created_at: datetime + """The timestamp when the browser was created.""" + status: str + """The current status of the browser.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateBrowserProfileInput(_SerdeShape): + """Dataclass for CreateBrowserProfileInput structure.""" + + name: str | None = ... + """ + The name of the browser profile. The name must be unique within your + account and can contain alphanumeric characters and underscores. + """ + description: str | None = ... + """ + A description of the browser profile. Use this field to describe the + purpose or contents of the profile. + """ + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the operation + completes no more than one time. If this token matches a previous + request, Amazon Bedrock AgentCore ignores the request but does not + return an error. + """ + tags: dict[str, str] | None = ... + """ + A map of tag keys and values to assign to the browser profile. Tags + enable you to categorize your resources in different ways, for example, + by purpose, owner, or environment. + """ + +@dataclass(kw_only=True) +class CreateBrowserProfileOutput(_SerdeShape): + """Dataclass for CreateBrowserProfileOutput structure.""" + + profile_id: str + """The unique identifier of the created browser profile.""" + profile_arn: str + """The Amazon Resource Name (ARN) of the created browser profile.""" + created_at: datetime + """The timestamp when the browser profile was created.""" + status: str + """The current status of the browser profile.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateCapacityProviderInput(_SerdeShape): + """Dataclass for CreateCapacityProviderInput structure.""" + + name: str | None = ... + """ + The name of the capacity provider. The name must be unique within your + account. + """ + description: str | None = ... + """ + An optional description of the capacity provider. If you don't specify + a description, the service creates the capacity provider without one. + """ + permissions_configuration: PermissionsConfiguration | None = ... + """ + The permissions configuration for the capacity provider. This specifies + the IAM role that AgentCore uses to manage the Amazon EC2 instances on + your behalf. + """ + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If you don't specify this field, a + value is randomly generated for you. If this token matches a previous + request, the service ignores the request, but doesn't return an error. + For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + tags: dict[str, str] | None = ... + """ + A map of tag keys and values to associate with the capacity provider. If + you don't specify tags, the capacity provider is created with no tags. + """ + compute_configuration: ComputeConfiguration | None = ... + """ + The compute configuration for the capacity provider. This defines the + Amazon EC2 compute resources used to launch instances: the operating + system, allowed instance types, networking, and storage. + """ + +@dataclass(kw_only=True) +class CreateCapacityProviderOutput(_SerdeShape): + """Dataclass for CreateCapacityProviderOutput structure.""" + + capacity_provider_id: str + """The unique identifier of the created capacity provider.""" + capacity_provider_arn: str + """The Amazon Resource Name (ARN) of the capacity provider.""" + name: str + """The name of the capacity provider.""" + status: str + """ + The current status of the capacity provider. For possible values, see + `CapacityProviderStatus`. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateCodeInterpreterInput(_SerdeShape): + """Dataclass for CreateCodeInterpreterInput structure.""" + + name: str | None = ... + """ + The name of the code interpreter. The name must be unique within your + account. + """ + description: str | None = ... + """The description of the code interpreter.""" + execution_role_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the IAM role that provides permissions + for the code interpreter to access Amazon Web Services services. + """ + network_configuration: CodeInterpreterNetworkConfiguration | None = ... + """ + The network configuration for the code interpreter. This configuration + specifies the network mode for the code interpreter. + """ + certificates: list[Certificate] | None = ... + """A list of certificates to install in the code interpreter.""" + filesystem_configurations: list[ToolsFileSystemConfiguration] | None = ... + """ + The file system configurations to mount into the code interpreter. Use + these configurations to mount your own Amazon Simple Storage Service + (Amazon S3) Files or Amazon Elastic File System (Amazon EFS) access + points. Your sessions can then access your data. If you don't specify + this field, no file systems are mounted. + """ + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the operation + completes no more than one time. If this token matches a previous + request, Amazon Bedrock AgentCore ignores the request but does not + return an error. + """ + tags: dict[str, str] | None = ... + """ + A map of tag keys and values to assign to the code interpreter. Tags + enable you to categorize your resources in different ways, for example, + by purpose, owner, or environment. + """ + +@dataclass(kw_only=True) +class CreateCodeInterpreterOutput(_SerdeShape): + """Dataclass for CreateCodeInterpreterOutput structure.""" + + code_interpreter_id: str + """The unique identifier of the created code interpreter.""" + code_interpreter_arn: str + """The Amazon Resource Name (ARN) of the created code interpreter.""" + created_at: datetime + """The timestamp when the code interpreter was created.""" + status: str + """The current status of the code interpreter.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateConfigurationBundleInput(_SerdeShape): + """Dataclass for CreateConfigurationBundleInput structure.""" + + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If you don't specify this field, a + value is randomly generated for you. If this token matches a previous + request, the service ignores the request, but doesn't return an error. + For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + bundle_name: str | None = ... + """ + The name for the configuration bundle. Names must be unique within your + account. + """ + description: str | None = ... + """The description for the configuration bundle.""" + components: dict[str, ComponentConfiguration] | None = ... + """ + A map of component identifiers to their configurations. Each component + represents a configurable element within the bundle. + """ + branch_name: str | None = ... + """ + The branch name for version tracking. Defaults to `mainline` if not + specified. + """ + commit_message: str | None = ... + """ + A commit message describing the initial version of the configuration + bundle. + """ + created_by: VersionCreatedBySource | None = ... + """ + The source that created this version, including the source name and + optional ARN. + """ + kms_key_arn: str | None = ... + """Optional KMS key ARN for encrypting component configurations.""" + tags: dict[str, str] | None = ... + """ + A map of tag keys and values to assign to the configuration bundle. Tags + enable you to categorize your resources in different ways, for example, + by purpose, owner, or environment. + """ + +@dataclass(kw_only=True) +class CreateConfigurationBundleOutput(_SerdeShape): + """Dataclass for CreateConfigurationBundleOutput structure.""" + + bundle_arn: str + """The Amazon Resource Name (ARN) of the created configuration bundle.""" + bundle_id: str + """The unique identifier of the created configuration bundle.""" + version_id: str + """The initial version identifier of the configuration bundle.""" + created_at: datetime + """The timestamp when the configuration bundle was created.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateConsentPortalInput(_SerdeShape): + """Dataclass for CreateConsentPortalInput structure.""" + + execution_role_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the IAM role that the consent portal + assumes to access the resources defined in its sources. + """ + idp_config: ConsentPortalIdpConfig | None = ... + """ + The identity provider configuration that the consent portal uses to + authenticate end users. + """ + name: str | None = ... + """ + The name of the consent portal. The name must be unique within your + account. + """ + sources: list[ConsentPortalSource] | None = ... + """ + The resources served by the consent portal. Currently, we only support + type `agentcore-gateway`. + """ + description: str | None = ... + """The description of the consent portal.""" + tags: dict[str, str] | None = ... + """ + A map of tag keys and values to assign to the consent portal. Tags + enable you to categorize your resources in different ways, for example, + by purpose, owner, or environment. + """ + +@dataclass(kw_only=True) +class CreateConsentPortalOutput(_SerdeShape): + """Dataclass for CreateConsentPortalOutput structure.""" + + sources: list[ConsentPortalSource] + """The resources served by the consent portal.""" + consent_portal_arn: str + """The Amazon Resource Name (ARN) of the consent portal.""" + consent_portal_id: str + """The unique identifier of the consent portal.""" + created_at: datetime + """The timestamp for when the consent portal was created.""" + description: str | None = ... + """The description of the consent portal.""" + execution_role_arn: str + """ + The Amazon Resource Name (ARN) of the IAM role that the consent portal + assumes to access the resources defined in its sources. + """ + idp_config: ConsentPortalIdpConfig + """ + The identity provider configuration that the consent portal uses to + authenticate end users. + """ + name: str + """The name of the consent portal.""" + portal_url: str | None = ... + """The URL used to access the consent portal.""" + status: str + """The current status of the consent portal.""" + status_reason: str | None = ... + """ + A message that provides additional information about the current status + of the consent portal. + """ + updated_at: datetime + """The timestamp for when the consent portal was last updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateDatasetInput(_SerdeShape): + """Dataclass for CreateDatasetInput structure.""" + + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If you don't specify this field, a + value is randomly generated for you. If this token matches a previous + request, the service ignores the request, but doesn't return an error. + For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + dataset_name: str | None = ... + """ + Human-readable name for the dataset. Must be unique within the account. + Immutable after creation. + """ + description: str | None = ... + """A description of the dataset.""" + source: DataSourceType | None = ... + """ + Source of initial examples. Provide either inline examples or an S3 URI + pointing to a JSONL file. + """ + schema_type: str | None = ... + """ + Versioned schema type governing the structure of examples. Immutable + after creation. + """ + kms_key_arn: str | None = ... + """ + Optional KMS key ARN for server-side encryption on service Amazon S3 + writes. + """ + tags: dict[str, str] | None = ... + """A map of tag keys and values to assign to the dataset.""" + +@dataclass(kw_only=True) +class CreateDatasetOutput(_SerdeShape): + """Dataclass for CreateDatasetOutput structure.""" + + dataset_arn: str + """The Amazon Resource Name (ARN) of the created dataset.""" + dataset_id: str + """The unique identifier of the created dataset.""" + status: str + """ + Always CREATING immediately after this call. Poll `GetDataset` until + status transitions to ACTIVE or CREATE_FAILED. + """ + created_at: datetime + """The timestamp when the dataset was created.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateDatasetVersionInput(_SerdeShape): + """Dataclass for CreateDatasetVersionInput structure.""" + + dataset_id: str | None = ... + """The unique identifier of the dataset to publish a version for.""" + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If you don't specify this field, a + value is randomly generated for you. If this token matches a previous + request, the service ignores the request, but doesn't return an error. + For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + +@dataclass(kw_only=True) +class CreateDatasetVersionOutput(_SerdeShape): + """Dataclass for CreateDatasetVersionOutput structure.""" + + dataset_arn: str + """The Amazon Resource Name (ARN) of the dataset.""" + dataset_id: str + """The unique identifier of the dataset.""" + status: str + """ + Always UPDATING immediately after this call. Poll `GetDataset` until + status transitions to ACTIVE or UPDATE_FAILED. + """ + dataset_version: str + """The version number being created.""" + created_at: datetime + """The timestamp when the version creation was initiated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateEvaluatorInput(_SerdeShape): + """Dataclass for CreateEvaluatorInput structure.""" + + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If you don't specify this field, a + value is randomly generated for you. If this token matches a previous + request, the service ignores the request, but doesn't return an error. + For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + evaluator_name: str | None = ... + """The name of the evaluator. Must be unique within your account.""" + description: str | None = ... + """ + The description of the evaluator that explains its purpose and + evaluation criteria. + """ + evaluator_config: EvaluatorConfig | None = ... + """ + The configuration for the evaluator. Specify either LLM-as-a-Judge + settings with instructions, rating scale, and model configuration, or + code-based settings with a customer-managed Lambda function. + """ + level: str | None = ... + """ + The evaluation level that determines the scope of evaluation. Valid + values are `TOOL_CALL` for individual tool invocations, `TRACE` for + single request-response interactions, or `SESSION` for entire + conversation sessions. + """ + kms_key_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of a customer managed KMS key to use for + encrypting sensitive evaluator data, including instructions and rating + scale. If you don't specify a KMS key, the evaluator data is encrypted + with an Amazon Web Services owned key. Only symmetric encryption KMS + keys are supported. For more information, see [Encryption at rest for + AgentCore + Evaluations](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/evaluations-encryption.html). + """ + tags: dict[str, str] | None = ... + """ + A map of tag keys and values to assign to an AgentCore Evaluator. Tags + enable you to categorize your resources in different ways, for example, + by purpose, owner, or environment. + """ + +@dataclass(kw_only=True) +class CreateEvaluatorOutput(_SerdeShape): + """Dataclass for CreateEvaluatorOutput structure.""" + + evaluator_arn: str + """The Amazon Resource Name (ARN) of the created evaluator.""" + evaluator_id: str + """The unique identifier of the created evaluator.""" + created_at: datetime + """The timestamp when the evaluator was created.""" + status: str + """The status of the evaluator creation operation.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateGatewayInput(_SerdeShape): + """Dataclass for CreateGatewayInput structure.""" + + name: str | None = ... + """The name of the gateway. The name must be unique within your account.""" + description: str | None = ... + """The description of the gateway.""" + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If you don't specify this field, a + value is randomly generated for you. If this token matches a previous + request, the service ignores the request, but doesn't return an error. + For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + role_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the IAM role that provides permissions + for the gateway to access Amazon Web Services services. + """ + protocol_type: str = ... + """The protocol type for the gateway.""" + protocol_configuration: GatewayProtocolConfiguration | None = ... + """ + The configuration settings for the protocol specified in the + `protocolType` parameter. + """ + authorizer_type: str | None = ... + """ + The type of authorizer to use for the gateway. + + - `CUSTOM_JWT` - Authorize with a bearer token. + + - `AWS_IAM` - Authorize with your Amazon Web Services IAM credentials. + + - `NONE` - No authorization + """ + authorizer_configuration: AuthorizerConfiguration | None = ... + """ + The authorizer configuration for the gateway. Required if + `authorizerType` is `CUSTOM_JWT`. + """ + kms_key_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the KMS key used to encrypt data + associated with the gateway. + """ + interceptor_configurations: list[GatewayInterceptorConfiguration] | None = ... + """ + A list of configuration settings for a gateway interceptor. Gateway + interceptors allow custom code to be invoked during gateway invocations. + """ + policy_engine_configuration: GatewayPolicyEngineConfiguration | None = ... + """ + The policy engine configuration for the gateway. A policy engine is a + collection of policies that evaluates and authorizes agent tool calls. + When associated with a gateway, the policy engine intercepts all agent + requests and determines whether to allow or deny each action based on + the defined policies. + """ + exception_level: str | None = ... + """ + The level of detail in error messages returned when invoking the + gateway. + + - If the value is `DEBUG`, granular exception messages are returned to + help a user debug the gateway. + + - If the value is omitted, a generic error message is returned to the + end user. + """ + tags: dict[str, str] | None = ... + """A map of key-value pairs to associate with the gateway as metadata tags.""" + +@dataclass(kw_only=True) +class CreateGatewayOutput(_SerdeShape): + """Dataclass for CreateGatewayOutput structure.""" + + gateway_arn: str + """The Amazon Resource Name (ARN) of the created gateway.""" + gateway_id: str + """The unique identifier of the created gateway.""" + gateway_url: str | None = ... + """The URL endpoint for the created gateway.""" + created_at: datetime + """The timestamp when the gateway was created.""" + updated_at: datetime + """The timestamp when the gateway was last updated.""" + status: str + """The current status of the gateway.""" + status_reasons: list[str] | None = ... + """The reasons for the current status of the gateway.""" + name: str + """The name of the gateway.""" + description: str | None = ... + """The description of the gateway.""" + role_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the IAM role associated with the + gateway. + """ + protocol_type: str = ... + """The protocol type of the gateway.""" + protocol_configuration: GatewayProtocolConfiguration | None = ... + """The configuration settings for the protocol used by the gateway.""" + authorizer_type: str + """The type of authorizer used by the gateway.""" + authorizer_configuration: AuthorizerConfiguration | None = ... + """The authorizer configuration for the created gateway.""" + kms_key_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the KMS key used to encrypt data + associated with the gateway. + """ + custom_transform_configuration: CustomTransformConfiguration | None = ... + """ + The custom transformation configuration for the gateway. This + configuration defines how the gateway transforms requests and responses. + """ + interceptor_configurations: list[GatewayInterceptorConfiguration] | None = ... + """The list of interceptor configurations for the created gateway.""" + policy_engine_configuration: GatewayPolicyEngineConfiguration | None = ... + """The policy engine configuration for the created gateway.""" + workload_identity_details: WorkloadIdentityDetails | None = ... + """The workload identity details for the created gateway.""" + exception_level: str | None = ... + """ + The level of detail in error messages returned when invoking the + gateway. + + - If the value is `DEBUG`, granular exception messages are returned to + help a user debug the gateway. + + - If the value is omitted, a generic error message is returned to the + end user. + """ + web_acl_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the Amazon Web Services WAF web ACL + associated with the gateway. + """ + waf_configuration: WafConfiguration | None = ... + """The Amazon Web Services WAF configuration for the gateway.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateGatewayRateLimitInput(_SerdeShape): + """Dataclass for CreateGatewayRateLimitInput structure.""" + + gateway_identifier: str | None = ... + """The unique identifier of the gateway to create the rate limit for.""" + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If you don't specify this field, a + value is randomly generated for you. If this token matches a previous + request, the service ignores the request, but doesn't return an error. + For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + rate_limit_id: str | None = ... + """ + An optional customer-defined identifier for the rate limit. If not + provided, the system generates one. + """ + description: str | None = ... + """ + An optional human-readable description for this rate limit. If not + provided, the rate limit is created without a description. + """ + dimension_keys: list[str] | None = ... + """ + The ordered list of dimension key names that define the scope of this + rate limit. Must be unique per gateway---no two rate limits can share + the same dimension keys. + """ + entries: list[LimitEntry] | None = ... + """The rule entries that map dimension values to rate configurations.""" + +@dataclass(kw_only=True) +class CreateGatewayRateLimitOutput(_SerdeShape): + """Shared fields for `GatewayRateLimit` responses.""" + + rate_limit_id: str + """The unique identifier of the created rate limit.""" + gateway_identifier: str + """The unique identifier of the gateway.""" + description: str | None = ... + """The human-readable description of the rate limit.""" + dimension_keys: list[str] + """ + The ordered list of dimension key names that define the scope of this + rate limit. + """ + entries: list[LimitEntry] + """ + The list of rule entries that map dimension values to rate + configurations. + """ + status: str + """The current status of the rate limit.""" + created_at: datetime + """The timestamp when the rate limit was created.""" + updated_at: datetime + """The timestamp when the rate limit was last updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateGatewayRuleInput(_SerdeShape): + """Dataclass for CreateGatewayRuleInput structure.""" + + gateway_identifier: str | None = ... + """The identifier of the gateway to create a rule for.""" + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If you don't specify this field, a + value is randomly generated for you. If this token matches a previous + request, the service ignores the request, but doesn't return an error. + For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + priority: int | None = ... + """ + The priority of the rule. Rules are evaluated in order of priority, with + lower numbers evaluated first. Must be between 1 and 1,000,000. + """ + conditions: list[Condition] | None = ... + """ + The conditions that must be met for the rule to apply. Conditions can + match on principals (IAM ARNs) or request paths. + """ + actions: list[Action] | None = ... + """ + The actions to take when the rule conditions are met. Actions can route + to a specific target or apply a configuration bundle override. + """ + description: str | None = ... + """The description of the gateway rule.""" + +@dataclass(kw_only=True) +class CreateGatewayRuleOutput(_SerdeShape): + """Dataclass for CreateGatewayRuleOutput structure.""" + + rule_id: str + """The unique identifier of the gateway rule.""" + gateway_arn: str + """The Amazon Resource Name (ARN) of the gateway that the rule belongs to.""" + priority: int + """ + The priority of the rule. Rules are evaluated in order of priority, with + lower numbers evaluated first. + """ + conditions: list[Condition] | None = ... + """The conditions that must be met for the rule to apply.""" + actions: list[Action] + """The actions to take when the rule conditions are met.""" + description: str | None = ... + """The description of the gateway rule.""" + created_at: datetime + """The timestamp when the rule was created.""" + status: str + """The current status of the rule.""" + system: SystemManagedBlock | None = ... + """System-managed metadata for rules created by automated processes.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateGatewayTargetInput(_SerdeShape): + """Dataclass for CreateGatewayTargetInput structure.""" + + gateway_identifier: str | None = ... + """The identifier of the gateway to create a target for.""" + name: str | None = ... + """ + The name of the gateway target. The name must be unique within the + gateway. + """ + description: str | None = ... + """The description of the gateway target.""" + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If you don't specify this field, a + value is randomly generated for you. If this token matches a previous + request, the service ignores the request, but doesn't return an error. + For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + target_configuration: TargetConfiguration | None = ... + """ + The configuration settings for the target, including endpoint + information and schema definitions. + """ + credential_provider_configurations: ( + list[CredentialProviderConfiguration] | None + ) = ... + """ + The credential provider configurations for the target. These + configurations specify how the gateway authenticates with the target + endpoint. + """ + metadata_configuration: MetadataConfiguration | None = ... + """ + Optional configuration for HTTP header and query parameter propagation + to and from the gateway target. + """ + private_endpoint: PrivateEndpoint | None = ... + """ + The private endpoint configuration for the gateway target. Use this to + connect the gateway to private resources in your VPC. + """ + certificate_configurations: list[CertificateConfiguration] | None = ... + """ + The private certificate authority (CA) configurations for the gateway + target. Use this to have the gateway trust a private CA when it + establishes TLS connections to the target endpoint. Provide each + certificate by reference to an Amazon S3 object or an Amazon Web + Services Secrets Manager secret. You can specify only one certificate + authority configuration in this list. + """ + +@dataclass(kw_only=True) +class CreateGatewayTargetOutput(_SerdeShape): + """Dataclass for CreateGatewayTargetOutput structure.""" + + gateway_arn: str + """The Amazon Resource Name (ARN) of the gateway.""" + target_id: str + """The unique identifier of the created target.""" + created_at: datetime + """The timestamp when the target was created.""" + updated_at: datetime + """The timestamp when the target was last updated.""" + status: str + """The current status of the target.""" + status_reasons: list[str] | None = ... + """The reasons for the current status of the target.""" + name: str + """The name of the target.""" + description: str | None = ... + """The description of the target.""" + target_configuration: TargetConfiguration + """The configuration settings for the target.""" + credential_provider_configurations: list[CredentialProviderConfiguration] + """The credential provider configurations for the target.""" + last_synchronized_at: datetime | None = ... + """The last synchronization of the target.""" + metadata_configuration: MetadataConfiguration | None = ... + """ + The metadata configuration that was applied to the created gateway + target. + """ + private_endpoint: PrivateEndpoint | None = ... + """The private endpoint configuration for the gateway target.""" + private_endpoint_managed_resources: list[ManagedResourceDetails] | None = ... + """ + The managed resources created by the gateway for private endpoint + connectivity. + """ + authorization_data: AuthorizationData | None = ... + """ + OAuth2 authorization data for the created gateway target. This data is + returned when a target is configured with a credential provider with + authorization code grant type and requires user federation. + """ + protocol_type: str | None = ... + """The protocol type of the created gateway target.""" + certificate_configurations: list[CertificateConfiguration] | None = ... + """ + The private certificate authority (CA) configurations for the gateway + target. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateHarnessEndpointInput(_SerdeShape): + """Dataclass for CreateHarnessEndpointInput structure.""" + + harness_id: str | None = ... + """The ID of the harness to create an endpoint for.""" + endpoint_name: str | None = ... + """ + The name of the endpoint. Must start with a letter and contain only + alphanumeric characters and underscores. + """ + target_version: str | None = ... + """ + The harness version that the endpoint points to and serves invocations + from. + """ + description: str | None = ... + """A description of the endpoint.""" + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure idempotency of the + request. + """ + tags: dict[str, str] | None = ... + """Tags to apply to the endpoint resource.""" + +@dataclass(kw_only=True) +class CreateHarnessEndpointOutput(_SerdeShape): + """Dataclass for CreateHarnessEndpointOutput structure.""" + + endpoint: HarnessEndpoint + """The endpoint that was created.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateHarnessInput(_SerdeShape): + """Dataclass for CreateHarnessInput structure.""" + + harness_name: str | None = ... + """ + The name of the harness. Must start with a letter and contain only + alphanumeric characters and underscores. + """ + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure idempotency of the + request. + """ + execution_role_arn: str | None = ... + """ + The ARN of the IAM role that the harness assumes when running. This role + must have permissions for the services the agent needs to access, such + as Amazon Bedrock for model invocation. + """ + environment: HarnessEnvironmentProviderRequest | None = ... + """ + The compute environment configuration for the harness, including network + and lifecycle settings. + """ + environment_artifact: HarnessEnvironmentArtifact | None = ... + """ + The environment artifact for the harness, such as a custom container + image containing additional dependencies. + """ + environment_variables: dict[str, str] | None = ... + """Environment variables to set in the harness runtime environment.""" + authorizer_configuration: AuthorizerConfiguration | None = ... + """ + Represents inbound authorization configuration options used to + authenticate incoming requests. + """ + model: HarnessModelConfiguration | None = ... + """ + The model configuration for the harness. Supports Amazon Bedrock, + OpenAI, and Google Gemini model providers. + """ + system_prompt: list[HarnessSystemContentBlock] | None = ... + """The system prompt that defines the agent's behavior and instructions.""" + tools: list[HarnessTool] | None = ... + """ + The tools available to the agent, such as remote MCP servers, AgentCore + Gateway, AgentCore Browser, Code Interpreter, or inline functions. + """ + skills: list[HarnessSkill] | None = ... + """ + The skills available to the agent. Skills are bundles of files that the + agent can pull into its context on demand. + """ + allowed_tools: list[str] | None = ... + """ + The tools that the agent is allowed to use. Supports glob patterns such + as * for all tools, @builtin for all built-in tools, or + @serverName/toolName for specific MCP server tools. + """ + memory: HarnessMemoryConfiguration | None = ... + """ + The AgentCore Memory configuration for persisting conversation context + across sessions. + """ + truncation: HarnessTruncationConfiguration | None = ... + """ + The truncation configuration for managing conversation context when it + exceeds model limits. + """ + hooks: list[HarnessHook] | None = ... + """The lifecycle hooks to run at defined points in the agent loop.""" + max_iterations: int | None = ... + """ + The maximum number of iterations the agent loop can execute per + invocation. + """ + max_tokens: int | None = ... + """ + The maximum total number of output tokens the agent can generate across + all model calls within a single invocation. + """ + timeout_seconds: int | None = ... + """ + The maximum duration in seconds for the agent loop execution per + invocation. + """ + tags: dict[str, str] | None = ... + """Tags to apply to the harness resource.""" + +@dataclass(kw_only=True) +class CreateHarnessOutput(_SerdeShape): + """Dataclass for CreateHarnessOutput structure.""" + + harness: Harness + """The harness that was created.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateMemoryInput(_SerdeShape): + """Dataclass for CreateMemoryInput structure.""" + + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the operation + completes no more than one time. If this token matches a previous + request, Amazon Bedrock ignores the request but does not return an + error. + """ + name: str | None = ... + """The name of the memory. The name must be unique within your account.""" + description: str | None = ... + """The description of the memory.""" + encryption_key_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the KMS key used to encrypt the memory + data. + """ + memory_execution_role_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the IAM role that provides permissions + for the memory to access Amazon Web Services services. + """ + event_expiry_duration: int | None = ... + """ + The duration after which memory events expire. Specified as an ISO 8601 + duration. + """ + memory_strategies: list[MemoryStrategyInput] | None = ... + """ + The memory strategies to use for this memory. Strategies define how + information is extracted, processed, and consolidated. + """ + indexed_keys: list[IndexedKey] | None = ... + """ + Metadata keys to index for filtering. Once declared, indexed keys cannot + be removed. + """ + namespace_keys: list[NamespaceKeyEntry] | None = ... + """ + The namespace variable key definitions with optional validation rules. + Use these `namespaceKeys` in `namespaceTemplates` to control namespace + hierarchy. + """ + stream_delivery_resources: StreamDeliveryResources | None = ... + """Configuration for streaming memory record data to external resources.""" + tags: dict[str, str] | None = ... + """ + A map of tag keys and values to assign to an AgentCore Memory. Tags + enable you to categorize your resources in different ways, for example, + by purpose, owner, or environment. + """ + +@dataclass(kw_only=True) +class CreateMemoryOutput(_SerdeShape): + """Dataclass for CreateMemoryOutput structure.""" + + memory: Memory | None = ... + """ + The details of the created memory, including its ID, ARN, name, + description, and configuration settings. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateOauth2CredentialProviderInput(_SerdeShape): + """Dataclass for CreateOauth2CredentialProviderInput structure.""" + + name: str | None = ... + """ + The name of the OAuth2 credential provider. The name must be unique + within your account. + """ + credential_provider_vendor: str | None = ... + """ + The vendor of the OAuth2 credential provider. This specifies which + OAuth2 implementation to use. + """ + oauth2_provider_config_input: Oauth2ProviderConfigInput | None = ... + """ + The configuration settings for the OAuth2 provider, including client ID, + client secret, and other vendor-specific settings. + """ + tags: dict[str, str] | None = ... + """ + A map of tag keys and values to assign to the OAuth2 credential + provider. Tags enable you to categorize your resources in different + ways, for example, by purpose, owner, or environment. + """ + +@dataclass(kw_only=True) +class CreateOauth2CredentialProviderOutput(_SerdeShape): + """Dataclass for CreateOauth2CredentialProviderOutput structure.""" + + client_secret_arn: Secret + """ + The Amazon Resource Name (ARN) of the client secret in Amazon Web + Services Secrets Manager. + """ + client_secret_json_key: str | None = ... + """ + The JSON key used to extract the client secret value from the Amazon Web + Services Secrets Manager secret. + """ + client_secret_source: str | None = ... + """ + The source type of the client secret. Either `MANAGED` if the secret is + managed by the service, or `EXTERNAL` if managed by the user in Amazon + Web Services Secrets Manager. + """ + name: str + """The name of the OAuth2 credential provider.""" + credential_provider_arn: str + """The Amazon Resource Name (ARN) of the OAuth2 credential provider.""" + callback_url: str | None = ... + """ + Callback URL to register on the OAuth2 credential provider as an allowed + callback URL. This URL is where the OAuth2 authorization server + redirects users after they complete the authorization flow. + """ + oauth2_provider_config_output: Oauth2ProviderConfigOutput | None = ... + """Contains the output configuration for an OAuth2 provider.""" + status: str | None = ... + """The current status of the OAuth2 credential provider.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateOnlineEvaluationConfigInput(_SerdeShape): + """Dataclass for CreateOnlineEvaluationConfigInput structure.""" + + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If you don't specify this field, a + value is randomly generated for you. If this token matches a previous + request, the service ignores the request, but doesn't return an error. + For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + online_evaluation_config_name: str | None = ... + """ + The name of the online evaluation configuration. Must be unique within + your account. + """ + description: str | None = ... + """ + The description of the online evaluation configuration that explains its + monitoring purpose and scope. + """ + rule: Rule | None = ... + """ + The evaluation rule that defines sampling configuration, filters, and + session detection settings for the online evaluation. + """ + data_source_config: DataSourceConfig | None = ... + """ + The data source configuration that specifies CloudWatch log groups and + service names to monitor for agent traces. + """ + evaluators: list[EvaluatorReference] | None = ... + """ + The list of evaluators to apply during online evaluation. Can include + both built-in evaluators and custom evaluators created with + `CreateEvaluator`. + """ + insights: list[Insight] | None = ... + """The list of insight types to run against agent sessions.""" + clustering_config: ClusteringConfig | None = ... + """ + Configuration for periodic batch evaluation clustering of insight + results. + """ + output_config: OutputConfig | None = ... + """ + The configuration that specifies where evaluation results should be + written for monitoring and analysis. + """ + evaluation_execution_role_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the IAM role that grants permissions + to read from CloudWatch logs, write evaluation results, and invoke + Amazon Bedrock models for evaluation. If the configuration references + evaluators encrypted with a customer managed KMS key, this role must + also have `kms:Decrypt` permission on the KMS key. The service validates + this permission at configuration creation time. For more information, + see [Encryption at rest for AgentCore + Evaluations](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/evaluations-encryption.html). + """ + enable_on_create: bool | None = ... + """ + Whether to enable the online evaluation configuration immediately upon + creation. If true, evaluation begins automatically. + """ + tags: dict[str, str] | None = ... + """ + A map of tag keys and values to assign to an AgentCore Online Evaluation + Config. Tags enable you to categorize your resources in different ways, + for example, by purpose, owner, or environment. + """ + +@dataclass(kw_only=True) +class CreateOnlineEvaluationConfigOutput(_SerdeShape): + """Dataclass for CreateOnlineEvaluationConfigOutput structure.""" + + online_evaluation_config_arn: str + """ + The Amazon Resource Name (ARN) of the created online evaluation + configuration. + """ + online_evaluation_config_id: str + """The unique identifier of the created online evaluation configuration.""" + created_at: datetime + """The timestamp when the online evaluation configuration was created.""" + output_config: OutputConfig | None = ... + """ + The configuration that specifies where evaluation results should be + written for monitoring and analysis. + """ + status: str + """The status of the online evaluation configuration.""" + execution_status: str + """ + The execution status indicating whether the online evaluation is + currently running. + """ + failure_reason: str | None = ... + """ + The reason for failure if the online evaluation configuration creation + or execution failed. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreatePaymentConnectorInput(_SerdeShape): + """Dataclass for CreatePaymentConnectorInput structure.""" + + payment_manager_id: str | None = ... + """ + The unique identifier of the payment manager to create the connector + for. + """ + name: str | None = ... + """The name of the payment connector.""" + description: str | None = ... + """A description of the payment connector.""" + type: str | None = ... + """ + The type of payment connector, which determines the payment provider + integration. + """ + credential_provider_configurations: ( + list[CredentialsProviderConfiguration] | None + ) = ... + """ + The credential provider configurations for the payment connector. These + configurations specify how the connector authenticates with the payment + provider. + """ + provision_mode: str | None = ... + """ + The provision mode for creating the payment connector. If you don't + specify a value, the default is `MANUAL`. + + - `MANUAL` - You provide the credential provider configurations + directly. + + - `QUICK_CREATE` - The service orchestrates OAuth consent and provisions + the credential provider for you. + """ + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If you don't specify this field, a + value is randomly generated for you. If this token matches a previous + request, the service ignores the request, but doesn't return an error. + For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + +@dataclass(kw_only=True) +class CreatePaymentConnectorOutput(_SerdeShape): + """Dataclass for CreatePaymentConnectorOutput structure.""" + + payment_connector_id: str + """The unique identifier of the created payment connector.""" + payment_manager_id: str + """The unique identifier of the parent payment manager.""" + name: str + """The name of the created payment connector.""" + type: str + """The type of the created payment connector.""" + credential_provider_configurations: list[CredentialsProviderConfiguration] + """ + The credential provider configurations for the created payment + connector. + """ + created_at: datetime + """The timestamp when the payment connector was created.""" + status: str + """ + The current status of the payment connector. Possible values include + `CREATING`, `READY`, `UPDATING`, `DELETING`, `CREATE_FAILED`, + `UPDATE_FAILED`, and `DELETE_FAILED`. + """ + authorization_url: str | None = ... + """ + The URL that the user must open to complete OAuth consent. This field is + only present when the payment connector status is + `PENDING_AUTHENTICATION`. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreatePaymentCredentialProviderInput(_SerdeShape): + """Dataclass for CreatePaymentCredentialProviderInput structure.""" + + name: str | None = ... + """Unique name for the payment credential provider.""" + credential_provider_vendor: str | None = ... + """ + The vendor type for the payment credential provider (e.g., CoinbaseCDP, + StripePrivy). + """ + provider_configuration_input: PaymentProviderConfigurationInput | None = ... + """Configuration specific to the vendor, including API credentials.""" + tags: dict[str, str] | None = ... + """Optional tags for resource organization.""" + +@dataclass(kw_only=True) +class CreatePaymentCredentialProviderOutput(_SerdeShape): + """Dataclass for CreatePaymentCredentialProviderOutput structure.""" + + name: str + """The name of the created payment credential provider.""" + credential_provider_vendor: str + """The vendor type for the created payment credential provider.""" + credential_provider_arn: str + """ + The Amazon Resource Name (ARN) of the created payment credential + provider. + """ + provider_configuration_output: PaymentProviderConfigurationOutput + """ + Output configuration (contains secret ARNs, excludes actual secret + values). + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreatePaymentManagerInput(_SerdeShape): + """Dataclass for CreatePaymentManagerInput structure.""" + + name: str | None = ... + """The name of the payment manager.""" + description: str | None = ... + """A description of the payment manager.""" + authorizer_type: str | None = ... + """ + The type of authorizer to use for the payment manager. + + - `CUSTOM_JWT` - Authorize with a bearer token. + + - `AWS_IAM` - Authorize with your Amazon Web Services IAM credentials. + """ + authorizer_configuration: AuthorizerConfiguration | None = ... + """The authorizer configuration for the payment manager.""" + role_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the IAM role that the payment manager + assumes to access resources on your behalf. + """ + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If you don't specify this field, a + value is randomly generated for you. If this token matches a previous + request, the service ignores the request, but doesn't return an error. + For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + tags: dict[str, str] | None = ... + """A map of tag keys and values to assign to the payment manager.""" + kms_key_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the customer managed KMS key to use + for encrypting sensitive payment manager data at rest. If you don't + specify a key, the data is encrypted with an Amazon Web Services owned + key. + """ + +@dataclass(kw_only=True) +class CreatePaymentManagerOutput(_SerdeShape): + """Dataclass for CreatePaymentManagerOutput structure.""" + + payment_manager_arn: str + """The Amazon Resource Name (ARN) of the created payment manager.""" + payment_manager_id: str + """The unique identifier of the created payment manager.""" + name: str + """The name of the created payment manager.""" + authorizer_type: str + """The type of authorizer for the created payment manager.""" + authorizer_configuration: AuthorizerConfiguration | None = ... + """ + Represents inbound authorization configuration options used to + authenticate incoming requests. + """ + role_arn: str + """ + The Amazon Resource Name (ARN) of the IAM role associated with the + created payment manager. + """ + workload_identity_details: WorkloadIdentityDetails | None = ... + """The information about the workload identity.""" + created_at: datetime + """The timestamp when the payment manager was created.""" + status: str + """ + The current status of the payment manager. Possible values include + `CREATING`, `READY`, `UPDATING`, `DELETING`, `CREATE_FAILED`, + `UPDATE_FAILED`, and `DELETE_FAILED`. + """ + tags: dict[str, str] | None = ... + """The tags associated with the created payment manager.""" + kms_key_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the KMS key used to encrypt sensitive + payment manager data at rest, if configured. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreatePolicyEngineInput(_SerdeShape): + """Dataclass for CreatePolicyEngineInput structure.""" + + name: str | None = ... + """ + The customer-assigned immutable name for the policy engine. This name + identifies the policy engine and cannot be changed after creation. + """ + description: str | None = ... + """ + A human-readable description of the policy engine's purpose and scope + (1-4,096 characters). This helps administrators understand the policy + engine's role in the overall governance strategy. Document which + Gateway this engine will be associated with, what types of tools or + workflows it governs, and the team or service responsible for + maintaining it. Clear descriptions are essential when managing multiple + policy engines across different services or environments. + """ + client_token: str | None = ... + """ + A unique, case-sensitive identifier that you provide to ensure the + idempotency of the request. If you retry a request with the same client + token, the service returns the same response without creating a + duplicate policy engine. + """ + encryption_key_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the KMS key used to encrypt the policy + engine data. + """ + tags: dict[str, str] | None = ... + """ + A map of tag keys and values to assign to an AgentCore Policy. Tags + enable you to categorize your resources in different ways, for example, + by purpose, owner, or environment. + """ + +@dataclass(kw_only=True) +class CreatePolicyEngineOutput(_SerdeShape): + """Dataclass for CreatePolicyEngineOutput structure.""" + + policy_engine_id: str + """ + The unique identifier for the created policy engine. This + system-generated identifier consists of the user name plus a + 10-character generated suffix and is used for all subsequent policy + engine operations. + """ + name: str + """ + The customer-assigned name of the created policy engine. This matches + the name provided in the request and serves as the human-readable + identifier. + """ + created_at: datetime + """ + The timestamp when the policy engine was created. This is automatically + set by the service and used for auditing and lifecycle management. + """ + updated_at: datetime + """ + The timestamp when the policy engine was last updated. For newly created + policy engines, this matches the `createdAt` timestamp. + """ + policy_engine_arn: str + """ + The Amazon Resource Name (ARN) of the created policy engine. This + globally unique identifier can be used for cross-service references and + IAM policy statements. + """ + status: str + """ + The current status of the policy engine. A status of `ACTIVE` indicates + the policy engine is ready for use. + """ + encryption_key_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the KMS key used to encrypt the policy + engine data. + """ + description: str | None = ... + """A human-readable description of the policy engine's purpose.""" + status_reasons: list[str] + """ + Additional information about the policy engine status. This provides + details about any failures or the current state of the policy engine + creation process. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreatePolicyInput(_SerdeShape): + """Dataclass for CreatePolicyInput structure.""" + + name: str | None = ... + """ + The customer-assigned immutable name for the policy. Must be unique + within the account. This name is used for policy identification and + cannot be changed after creation. + """ + definition: PolicyDefinition | None = ... + """ + The Cedar or Dogwood policy statement that defines the access control + rules. This contains the actual policy logic written in Cedar or + Dogwood, specifying effect (permit or forbid), principals, actions, + resources, and conditions for agent behavior control. + """ + description: str | None = ... + """ + A human-readable description of the policy's purpose and functionality + (1-4,096 characters). This helps policy administrators understand the + policy's intent, business rules, and operational scope. Use this field + to document why the policy exists, what business requirement it + addresses, and any special considerations for maintenance. Clear + descriptions are essential for policy governance, auditing, and + troubleshooting. + """ + validation_mode: str = ... + """ + The validation mode for the policy creation. Determines how Cedar + analyzer validation results are handled during policy creation. + FAIL_ON_ANY_FINDINGS (default) runs the Cedar analyzer to validate the + policy against the Cedar schema and tool context, failing creation if + the analyzer detects any validation issues to ensure strict conformance. + IGNORE_ALL_FINDINGS runs the Cedar analyzer but allows policy creation + even if validation issues are detected, useful for testing or when the + policy schema is evolving. Use FAIL_ON_ANY_FINDINGS for production + policies to ensure correctness, and IGNORE_ALL_FINDINGS only when you + understand and accept the analyzer findings. + """ + enforcement_mode: str = ... + """ + The enforcement mode for the policy. Run this policy in `LOG_ONLY` mode + to collect data on how it affects your application. Once you are + satisfied with the data gathered, switch the policy to `ACTIVE`. + Defaults to `ACTIVE`. + """ + policy_engine_id: str | None = ... + """ + The identifier of the policy engine which contains this policy. Policy + engines group related policies and provide the execution context for + policy evaluation. + """ + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure the idempotency of the + request. The AWS SDK automatically generates this token, so you don't + need to provide it in most cases. If you retry a request with the same + client token, the service returns the same response without creating a + duplicate policy. + """ + +@dataclass(kw_only=True) +class CreatePolicyOutput(_SerdeShape): + """Dataclass for CreatePolicyOutput structure.""" + + policy_id: str + """ + The unique identifier for the created policy. This is a system-generated + identifier consisting of the user name plus a 10-character generated + suffix, used for all subsequent policy operations. + """ + name: str + """ + The customer-assigned name of the created policy. This matches the name + provided in the request and serves as the human-readable identifier for + the policy. + """ + policy_engine_id: str + """ + The identifier of the policy engine that manages this policy. This + confirms the policy engine assignment and is used for policy evaluation + routing. + """ + created_at: datetime + """ + The timestamp when the policy was created. This is automatically set by + the service and used for auditing and lifecycle management. + """ + updated_at: datetime + """ + The timestamp when the policy was last updated. For newly created + policies, this matches the createdAt timestamp. + """ + policy_arn: str + """ + The Amazon Resource Name (ARN) of the created policy. This globally + unique identifier can be used for cross-service references and IAM + policy statements. + """ + status: str + """ + The current status of the policy. A status of `ACTIVE` indicates the + policy is ready for use. + """ + enforcement_mode: str = ... + """The enforcement mode of the created policy.""" + definition: PolicyDefinition + """ + The Cedar or Dogwood policy statement that was created. This is the + validated policy definition that will be used for agent behavior control + and access decisions. + """ + description: str | None = ... + """ + The human-readable description of the policy's purpose and + functionality. This helps administrators understand and manage the + policy. + """ + status_reasons: list[str] + """ + Additional information about the policy status. This provides details + about any failures or the current state of the policy creation process. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateRegistryInput(_SerdeShape): + """Dataclass for CreateRegistryInput structure.""" + + name: str | None = ... + """ + The name of the registry. The name must be unique within your account + and can contain alphanumeric characters and underscores. + """ + description: str | None = ... + """A description of the registry.""" + authorizer_type: str | None = ... + """ + The type of authorizer to use for the registry. This controls the + authorization method for the Search and Invoke APIs used by consumers, + and does not affect the standard CRUDL APIs for registry and registry + record management used by administrators. + + - `CUSTOM_JWT` - Authorize with a bearer token. + + - `AWS_IAM` - Authorize with your Amazon Web Services IAM credentials. + """ + authorizer_configuration: AuthorizerConfiguration | None = ... + """ + The authorizer configuration for the registry. Required if + `authorizerType` is `CUSTOM_JWT`. For details, see the + `AuthorizerConfiguration` data type. + """ + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If you don't specify this field, a + value is randomly generated for you. If this token matches a previous + request, the service ignores the request, but doesn't return an error. + For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + approval_configuration: ApprovalConfiguration | None = ... + """ + The approval configuration for registry records. Controls whether + records require explicit approval before becoming active. See the + `ApprovalConfiguration` data type for supported configuration options. + """ + +@dataclass(kw_only=True) +class CreateRegistryOutput(_SerdeShape): + """Dataclass for CreateRegistryOutput structure.""" + + registry_arn: str + """The Amazon Resource Name (ARN) of the created registry.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateRegistryRecordInput(_SerdeShape): + """Dataclass for CreateRegistryRecordInput structure.""" + + registry_id: str | None = ... + """ + The identifier of the registry where the record will be created. You can + specify either the Amazon Resource Name (ARN) or the ID of the registry. + """ + name: str | None = ... + """The name of the registry record.""" + description: str | None = ... + """A description of the registry record.""" + descriptor_type: str | None = ... + """ + The descriptor type of the registry record. + + - `MCP` - Model Context Protocol descriptor for MCP-compatible servers + and tools. + + - `A2A` - Agent-to-Agent protocol descriptor. + + - `CUSTOM` - Custom descriptor type for resources such as APIs, Lambda + functions, or servers not conforming to a standard protocol. + + - `AGENT_SKILLS` - Agent skills descriptor for defining agent skill + definitions. + """ + descriptors: Descriptors | None = ... + """ + The descriptor-type-specific configuration containing the resource + schema and metadata. The structure of this field depends on the + `descriptorType` you specify. + """ + record_version: str | None = ... + """ + The version of the registry record. Use this to track different versions + of the record's content. + """ + synchronization_type: str | None = ... + """ + The type of synchronization to use for keeping the record metadata up to + date from an external source. Possible values include `FROM_URL` and + `NONE`. + """ + synchronization_configuration: SynchronizationConfiguration | None = ... + """ + The configuration for synchronizing registry record metadata from an + external source, such as a URL-based MCP server. + """ + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If you don't specify this field, a + value is randomly generated for you. If this token matches a previous + request, the service ignores the request, but doesn't return an error. + For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + +@dataclass(kw_only=True) +class CreateRegistryRecordOutput(_SerdeShape): + """Dataclass for CreateRegistryRecordOutput structure.""" + + record_arn: str + """The Amazon Resource Name (ARN) of the created registry record.""" + status: str + """ + The status of the registry record. Set to `CREATING` while the + asynchronous workflow is in progress. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateWorkloadIdentityInput(_SerdeShape): + """Dataclass for CreateWorkloadIdentityInput structure.""" + + name: str | None = ... + """ + The name of the workload identity. The name must be unique within your + account. + """ + allowed_resource_oauth2_return_urls: list[str] | None = ... + """ + The list of allowed OAuth2 return URLs for resources associated with + this workload identity. + """ + tags: dict[str, str] | None = ... + """ + A map of tag keys and values to assign to the workload identity. Tags + enable you to categorize your resources in different ways, for example, + by purpose, owner, or environment. + """ + +@dataclass(kw_only=True) +class CreateWorkloadIdentityOutput(_SerdeShape): + """Dataclass for CreateWorkloadIdentityOutput structure.""" + + name: str + """The name of the workload identity.""" + workload_identity_arn: str + """The Amazon Resource Name (ARN) of the workload identity.""" + allowed_resource_oauth2_return_urls: list[str] | None = ... + """ + The list of allowed OAuth2 return URLs for resources associated with + this workload identity. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass +class CredentialProviderOauthCredentialProvider(_SerdeShape): + """ + The OAuth credential provider. This provider uses OAuth authentication + to access the target endpoint. + """ + + value: OAuthCredentialProvider + +@dataclass +class CredentialProviderApiKeyCredentialProvider(_SerdeShape): + """ + The API key credential provider. This provider uses an API key to + authenticate with the target endpoint. + """ + + value: GatewayApiKeyCredentialProvider + +@dataclass +class CredentialProviderIamCredentialProvider(_SerdeShape): + """ + The IAM credential provider. This provider uses IAM authentication with + SigV4 signing to access the target endpoint. + """ + + value: IamCredentialProvider + +@dataclass +class CredentialProviderUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +CredentialProvider = Union[ + CredentialProviderOauthCredentialProvider + | CredentialProviderApiKeyCredentialProvider + | CredentialProviderIamCredentialProvider + | CredentialProviderUnknown +] +""" +A credential provider for gateway authentication. This structure +contains the configuration for authenticating with the target endpoint. +""" + +class _CredentialProviderDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> CredentialProvider: ... + +@dataclass(kw_only=True) +class CredentialProviderConfiguration(_SerdeShape): + """ + The configuration for a credential provider. This structure defines how + the gateway authenticates with the target endpoint. + """ + + credential_provider_type: str + """ + The type of credential provider. This field specifies which + authentication method the gateway uses. + """ + credential_provider: CredentialProvider | None = ... + """ + The credential provider. This field contains the specific configuration + for the credential provider type. + """ + +class CredentialProviderType(UnknownEnumMixin, StrEnum): + GATEWAY_IAM_ROLE = "GATEWAY_IAM_ROLE" + OAUTH = "OAUTH" + API_KEY = "API_KEY" + CALLER_IAM_CREDENTIALS = "CALLER_IAM_CREDENTIALS" + JWT_PASSTHROUGH = "JWT_PASSTHROUGH" + +class CredentialProviderVendorType(UnknownEnumMixin, StrEnum): + GOOGLE_OAUTH2 = "GoogleOauth2" + GITHUB_OAUTH2 = "GithubOauth2" + SLACK_OAUTH2 = "SlackOauth2" + SALESFORCE_OAUTH2 = "SalesforceOauth2" + MICROSOFT_OAUTH2 = "MicrosoftOauth2" + CUSTOM_OAUTH2 = "CustomOauth2" + ATLASSIAN_OAUTH2 = "AtlassianOauth2" + LINKEDIN_OAUTH2 = "LinkedinOauth2" + X_OAUTH2 = "XOauth2" + OKTA_OAUTH2 = "OktaOauth2" + ONE_LOGIN_OAUTH2 = "OneLoginOauth2" + PING_ONE_OAUTH2 = "PingOneOauth2" + FACEBOOK_OAUTH2 = "FacebookOauth2" + YANDEX_OAUTH2 = "YandexOauth2" + REDDIT_OAUTH2 = "RedditOauth2" + ZOOM_OAUTH2 = "ZoomOauth2" + TWITCH_OAUTH2 = "TwitchOauth2" + SPOTIFY_OAUTH2 = "SpotifyOauth2" + DROPBOX_OAUTH2 = "DropboxOauth2" + NOTION_OAUTH2 = "NotionOauth2" + HUBSPOT_OAUTH2 = "HubspotOauth2" + CYBER_ARK_OAUTH2 = "CyberArkOauth2" + FUSION_AUTH_OAUTH2 = "FusionAuthOauth2" + AUTH0_OAUTH2 = "Auth0Oauth2" + COGNITO_OAUTH2 = "CognitoOauth2" + +@dataclass +class CredentialRotationConfigCoinbaseCDP(_SerdeShape): + """The credentials to rotate for a Coinbase CDP payment connector.""" + + value: CoinbaseCdpRotationTargets + +@dataclass +class CredentialRotationConfigUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +CredentialRotationConfig = Union[ + CredentialRotationConfigCoinbaseCDP | CredentialRotationConfigUnknown +] +""" +Specifies the service-managed credentials to rotate. Provide the member +that matches the payment connector's `type`. +""" + +class _CredentialRotationConfigDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> CredentialRotationConfig: ... + +@dataclass +class CredentialsProviderConfigurationCoinbaseCDP(_SerdeShape): + """ + The credential provider configuration for a Coinbase CDP payment + connector. + """ + + value: PaymentCredentialProviderConfiguration + +@dataclass +class CredentialsProviderConfigurationStripePrivy(_SerdeShape): + """ + The credential provider configuration for a Stripe Privy payment + connector. + """ + + value: PaymentCredentialProviderConfiguration + +@dataclass +class CredentialsProviderConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +CredentialsProviderConfiguration = Union[ + CredentialsProviderConfigurationCoinbaseCDP + | CredentialsProviderConfigurationStripePrivy + | CredentialsProviderConfigurationUnknown +] +""" +The credential provider configuration for a payment connector. Specifies +the payment provider type and its associated credential provider. +""" + +class _CredentialsProviderConfigurationDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> CredentialsProviderConfiguration: ... + +@dataclass(kw_only=True) +class CustomClaimValidationType(_SerdeShape): + """ + Defines the name of a custom claim field and rules for finding matches + to authenticate its value. + """ + + inbound_token_claim_name: str + """The name of the custom claim field to check.""" + inbound_token_claim_value_type: str + """ + The data type of the claim value to check for. + + - Use `STRING` if you want to find an exact match to a string you + define. + + - Use `STRING_ARRAY` if you want to fnd a match to at least one value in + an array you define. + """ + authorizing_claim_match_value: AuthorizingClaimMatchValueType + """ + Defines the value or values to match for and the relationship of the + match. + """ + +@dataclass +class CustomConfigurationInputSemanticOverride(_SerdeShape): + """The semantic override configuration for a custom memory strategy.""" + + value: SemanticOverrideConfigurationInput + +@dataclass +class CustomConfigurationInputSummaryOverride(_SerdeShape): + """The summary override configuration for a custom memory strategy.""" + + value: SummaryOverrideConfigurationInput + +@dataclass +class CustomConfigurationInputUserPreferenceOverride(_SerdeShape): + """The user preference override configuration for a custom memory strategy.""" + + value: UserPreferenceOverrideConfigurationInput + +@dataclass +class CustomConfigurationInputEpisodicOverride(_SerdeShape): + """ + The episodic memory strategy override configuration for a custom memory + strategy. + """ + + value: EpisodicOverrideConfigurationInput + +@dataclass +class CustomConfigurationInputSelfManagedConfiguration(_SerdeShape): + """The self managed configuration for a custom memory strategy.""" + + value: SelfManagedConfigurationInput + +@dataclass +class CustomConfigurationInputUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +CustomConfigurationInput = Union[ + CustomConfigurationInputSemanticOverride + | CustomConfigurationInputSummaryOverride + | CustomConfigurationInputUserPreferenceOverride + | CustomConfigurationInputEpisodicOverride + | CustomConfigurationInputSelfManagedConfiguration + | CustomConfigurationInputUnknown +] +"""Input for custom configuration of a memory strategy.""" + +class _CustomConfigurationInputDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> CustomConfigurationInput: ... + +@dataclass +class CustomConsolidationConfigurationSemanticConsolidationOverride(_SerdeShape): + """The semantic consolidation override configuration.""" + + value: SemanticConsolidationOverride + +@dataclass +class CustomConsolidationConfigurationSummaryConsolidationOverride(_SerdeShape): + """The summary consolidation override configuration.""" + + value: SummaryConsolidationOverride + +@dataclass +class CustomConsolidationConfigurationUserPreferenceConsolidationOverride(_SerdeShape): + """The user preference consolidation override configuration.""" + + value: UserPreferenceConsolidationOverride + +@dataclass +class CustomConsolidationConfigurationEpisodicConsolidationOverride(_SerdeShape): + """ + The configurations to override the default consolidation step for the + episodic memory strategy. + """ + + value: EpisodicConsolidationOverride + +@dataclass +class CustomConsolidationConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +CustomConsolidationConfiguration = Union[ + CustomConsolidationConfigurationSemanticConsolidationOverride + | CustomConsolidationConfigurationSummaryConsolidationOverride + | CustomConsolidationConfigurationUserPreferenceConsolidationOverride + | CustomConsolidationConfigurationEpisodicConsolidationOverride + | CustomConsolidationConfigurationUnknown +] +"""Contains custom consolidation configuration information.""" + +class _CustomConsolidationConfigurationDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> CustomConsolidationConfiguration: ... + +@dataclass +class CustomConsolidationConfigurationInputSemanticConsolidationOverride(_SerdeShape): + """The semantic consolidation override configuration input.""" + + value: SemanticOverrideConsolidationConfigurationInput + +@dataclass +class CustomConsolidationConfigurationInputSummaryConsolidationOverride(_SerdeShape): + """The summary consolidation override configuration input.""" + + value: SummaryOverrideConsolidationConfigurationInput + +@dataclass +class CustomConsolidationConfigurationInputUserPreferenceConsolidationOverride( + _SerdeShape +): + """The user preference consolidation override configuration input.""" + + value: UserPreferenceOverrideConsolidationConfigurationInput + +@dataclass +class CustomConsolidationConfigurationInputEpisodicConsolidationOverride(_SerdeShape): + """ + Configurations to override the consolidation step of the episodic + strategy. + """ + + value: EpisodicOverrideConsolidationConfigurationInput + +@dataclass +class CustomConsolidationConfigurationInputUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +CustomConsolidationConfigurationInput = Union[ + CustomConsolidationConfigurationInputSemanticConsolidationOverride + | CustomConsolidationConfigurationInputSummaryConsolidationOverride + | CustomConsolidationConfigurationInputUserPreferenceConsolidationOverride + | CustomConsolidationConfigurationInputEpisodicConsolidationOverride + | CustomConsolidationConfigurationInputUnknown +] +"""Input for a custom consolidation configuration.""" + +class _CustomConsolidationConfigurationInputDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> CustomConsolidationConfigurationInput: ... + +@dataclass(kw_only=True) +class CustomDescriptor(_SerdeShape): + """ + A custom descriptor for a registry record. Use this for resources such + as APIs, Lambda functions, or servers that do not conform to a standard + protocol like MCP or A2A. + """ + + inline_content: str | None = ... + """ + The custom descriptor content as a valid JSON document. You can define + any custom schema that describes your resource. + """ + +@dataclass +class CustomExtractionConfigurationSemanticExtractionOverride(_SerdeShape): + """The semantic extraction override configuration.""" + + value: SemanticExtractionOverride + +@dataclass +class CustomExtractionConfigurationUserPreferenceExtractionOverride(_SerdeShape): + """The user preference extraction override configuration.""" + + value: UserPreferenceExtractionOverride + +@dataclass +class CustomExtractionConfigurationEpisodicExtractionOverride(_SerdeShape): + """ + The configurations to override the default extraction step for the + episodic memory strategy. + """ + + value: EpisodicExtractionOverride + +@dataclass +class CustomExtractionConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +CustomExtractionConfiguration = Union[ + CustomExtractionConfigurationSemanticExtractionOverride + | CustomExtractionConfigurationUserPreferenceExtractionOverride + | CustomExtractionConfigurationEpisodicExtractionOverride + | CustomExtractionConfigurationUnknown +] +"""Contains custom extraction configuration information.""" + +class _CustomExtractionConfigurationDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> CustomExtractionConfiguration: ... + +@dataclass +class CustomExtractionConfigurationInputSemanticExtractionOverride(_SerdeShape): + """The semantic extraction override configuration input.""" + + value: SemanticOverrideExtractionConfigurationInput + +@dataclass +class CustomExtractionConfigurationInputUserPreferenceExtractionOverride(_SerdeShape): + """The user preference extraction override configuration input.""" + + value: UserPreferenceOverrideExtractionConfigurationInput + +@dataclass +class CustomExtractionConfigurationInputEpisodicExtractionOverride(_SerdeShape): + """Configurations to override the extraction step of the episodic strategy.""" + + value: EpisodicOverrideExtractionConfigurationInput + +@dataclass +class CustomExtractionConfigurationInputUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +CustomExtractionConfigurationInput = Union[ + CustomExtractionConfigurationInputSemanticExtractionOverride + | CustomExtractionConfigurationInputUserPreferenceExtractionOverride + | CustomExtractionConfigurationInputEpisodicExtractionOverride + | CustomExtractionConfigurationInputUnknown +] +"""Input for a custom extraction configuration.""" + +class _CustomExtractionConfigurationInputDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> CustomExtractionConfigurationInput: ... + +@dataclass(kw_only=True) +class CustomJWTAuthorizerConfiguration(_SerdeShape): + """ + Configuration for inbound JWT-based authorization, specifying how + incoming requests should be authenticated. + """ + + discovery_url: str + """ + This URL is used to fetch OpenID Connect configuration or authorization + server metadata for validating incoming tokens. + """ + allowed_audience: list[str] | None = ... + """ + Represents individual audience values that are validated in the incoming + JWT token validation process. + """ + allowed_clients: list[str] | None = ... + """ + Represents individual client IDs that are validated in the incoming JWT + token validation process. + """ + allowed_scopes: list[str] | None = ... + """An array of scopes that are allowed to access the token.""" + advertised_scope_mapping: dict[str, str] | None = ... + """ + A map that associates each scope in `allowedScopes` with a corresponding + advertised scope value. The advertised scope appears in OAuth protected + resource metadata and `WWW-Authenticate` response headers. Use this + parameter when the scope that clients request from your identity + provider differs from the scope in the validated token. Each key is a + scope from `allowedScopes` that the service uses for token validation. + Each value is the corresponding scope that the service advertises to + clients. Scopes without a mapping entry appear unchanged to clients. + """ + custom_claims: list[CustomClaimValidationType] | None = ... + """ + An array of objects that define a custom claim validation name, value, + and operation + """ + private_endpoint: PrivateEndpoint | None = ... + """ + The private endpoint configuration for a gateway target. Defines how the + gateway connects to private resources in your VPC. + """ + private_endpoint_overrides: list[PrivateEndpointOverride] | None = ... + """ + The private endpoint overrides for the custom JWT authorizer + configuration. + """ + allowed_workload_configuration: AllowedWorkloadConfiguration | None = ... + """ + The configuration that restricts which workloads in the request's + identity chain are allowed to invoke the target, identified by their + hosting environments and workload identities. At launch, this is + supported only for AgentCore Runtime targets, and the allowed workloads + are AgentCore Gateways. + """ + +@dataclass(kw_only=True) +class CustomMemoryStrategyInput(_SerdeShape): + """Input for creating a custom memory strategy.""" + + name: str + """The name of the custom memory strategy.""" + description: str | None = ... + """The description of the custom memory strategy.""" + namespaces: list[str] | None = ... + """ + This is a legacy parameter, use `namespaceTemplates`. The namespaces + associated with the custom memory strategy. + """ + namespace_templates: list[str] | None = ... + """The namespaceTemplates associated with the custom memory strategy.""" + configuration: CustomConfigurationInput | None = ... + """The configuration for the custom memory strategy.""" + memory_record_schema: MemoryRecordSchema | None = ... + """Schema for metadata fields on records generated by this strategy.""" + +@dataclass(kw_only=True) +class CustomOauth2ProviderConfigInput(_SerdeShape): + """Input configuration for a custom OAuth2 provider.""" + + oauth_discovery: Oauth2Discovery + """The OAuth2 discovery information for the custom provider.""" + client_id: str = ... + """The client ID for the custom OAuth2 provider.""" + client_secret: str = ... + """The client secret for the custom OAuth2 provider.""" + client_secret_config: SecretReference | None = ... + """ + A reference to the Amazon Web Services Secrets Manager secret that + stores the client secret. This includes the secret ID and the JSON key + used to extract the client secret value from the secret. Required when + `clientSecretSource` is set to `EXTERNAL`. + """ + client_secret_source: str | None = ... + """ + The source type of the client secret. Use `MANAGED` if the secret is + managed by the service, or `EXTERNAL` if you manage the secret yourself + in Amazon Web Services Secrets Manager. + """ + on_behalf_of_token_exchange_config: OnBehalfOfTokenExchangeConfigType | None = ... + """ + The configuration for on-behalf-of token exchange. This enables + authentication flows that use RFC 8693 token exchange or RFC 7523 JWT + authorization grants. + """ + client_authentication_method: str | None = ... + """ + The client authentication method to use when authenticating with the + token endpoint. + """ + private_key_jwt_config: PrivateKeyJwtConfig | None = ... + """ + The private_key_jwt client authentication configuration for this + credential provider. When specified, the credential provider uses JWT + client assertions to authenticate with the token endpoint. + """ + private_endpoint: PrivateEndpoint | None = ... + """ + The default private endpoint for the custom OAuth2 provider, enabling + secure connectivity through a VPC Lattice resource configuration. + """ + private_endpoint_overrides: list[PrivateEndpointOverride] | None = ... + """ + The private endpoint overrides for the custom OAuth2 provider + configuration. + """ + +@dataclass(kw_only=True) +class CustomOauth2ProviderConfigOutput(_SerdeShape): + """Output configuration for a custom OAuth2 provider.""" + + oauth_discovery: Oauth2Discovery + """The OAuth2 discovery information for the custom provider.""" + client_id: str | None = ... + """The client ID for the custom OAuth2 provider.""" + on_behalf_of_token_exchange_config: OnBehalfOfTokenExchangeConfigType | None = ... + """The configuration for on-behalf-of token exchange.""" + client_authentication_method: str | None = ... + """ + The client authentication method used when authenticating with the token + endpoint. + """ + private_endpoint: PrivateEndpoint | None = ... + """ + The default private endpoint for the custom OAuth2 provider, enabling + secure connectivity through a VPC Lattice resource configuration. + """ + private_endpoint_overrides: list[PrivateEndpointOverride] | None = ... + """ + The private endpoint overrides for the custom OAuth2 provider + configuration. + """ + private_key_jwt_config: PrivateKeyJwtConfig | None = ... + """ + The configuration for private_key_jwt client authentication used by this + OAuth2 credential provider. + """ + +@dataclass +class CustomReflectionConfigurationEpisodicReflectionOverride(_SerdeShape): + """The configuration for a reflection strategy to override the default one.""" + + value: EpisodicReflectionOverride + +@dataclass +class CustomReflectionConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +CustomReflectionConfiguration = Union[ + CustomReflectionConfigurationEpisodicReflectionOverride + | CustomReflectionConfigurationUnknown +] +"""Contains configurations for a custom reflection strategy.""" + +class _CustomReflectionConfigurationDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> CustomReflectionConfiguration: ... + +@dataclass +class CustomReflectionConfigurationInputEpisodicReflectionOverride(_SerdeShape): + """The reflection override configuration input.""" + + value: EpisodicOverrideReflectionConfigurationInput + +@dataclass +class CustomReflectionConfigurationInputUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +CustomReflectionConfigurationInput = Union[ + CustomReflectionConfigurationInputEpisodicReflectionOverride + | CustomReflectionConfigurationInputUnknown +] +"""Input for a custom reflection configuration.""" + +class _CustomReflectionConfigurationInputDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> CustomReflectionConfigurationInput: ... + +@dataclass(kw_only=True) +class CustomTransformConfiguration(_SerdeShape): + """ + The configuration for custom transformations applied to requests and + responses through the gateway. This structure defines how the gateway + transforms data. + """ + + lambda_: LambdaTransformConfiguration | None = ... + """ + The Lambda configuration for custom transformations. This configuration + defines how the gateway uses a Lambda function to transform data. + """ + +class DatasetSchemaType(UnknownEnumMixin, StrEnum): + """ + Versioned schema type for dataset examples. Each value identifies both + the source format and the version of that format's schema. + """ + + AGENTCORE_EVALUATION_PREDEFINED_V1 = "AGENTCORE_EVALUATION_PREDEFINED_V1" + """ + AgentCore predefined evaluation schema, version 1. Dataset with + pre-written inputs per conversation turn. + """ + AGENTCORE_EVALUATION_SIMULATED_V1 = "AGENTCORE_EVALUATION_SIMULATED_V1" + """ + AgentCore simulated evaluation schema, version 1. Dataset for synthetic + data generation where each example is a scenario used to generate full + conversations. + """ + THIRD_PARTY_EVALUATION_V1 = "THIRD_PARTY_EVALUATION_V1" + """ + Third-party evaluation schema, version 1. Supports single-turn (string + input) and multi-turn (message list input) across third-party evaluation + frameworks. + """ + +class DatasetStatus(UnknownEnumMixin, StrEnum): + """Dataset lifecycle and operation status.""" + + CREATING = "CREATING" + """CreateDataset async ingestion in progress. All writes are blocked.""" + UPDATING = "UPDATING" + """ + An async example mutation or CreateDatasetVersion is in progress. All + writes are blocked. + """ + DELETING = "DELETING" + """ + Full or version-specific delete is in progress. Read operations are + still allowed. + """ + ACTIVE = "ACTIVE" + """ + Dataset is stable. All operations are allowed per operation-specific + guards. + """ + CREATE_FAILED = "CREATE_FAILED" + """Initial ingestion failed. DRAFT record exists but contains no examples.""" + UPDATE_FAILED = "UPDATE_FAILED" + """ + Last example mutation or CreateDatasetVersion failed. DRAFT may be + partially modified. + """ + DELETE_FAILED = "DELETE_FAILED" + """ + Delete failed after retries. Dataset record may be in an inconsistent + state. + """ + +@dataclass(kw_only=True) +class DatasetSummary(_SerdeShape): + """Summary information about a dataset.""" + + dataset_arn: str + """The Amazon Resource Name (ARN) of the dataset.""" + dataset_id: str + """The unique identifier of the dataset.""" + dataset_name: str + """The name of the dataset.""" + description: str | None = ... + """The description of the dataset.""" + status: str + """The current status of the dataset.""" + draft_status: str | None = ... + """Publish synchronization state. Only authoritative when status is ACTIVE.""" + schema_type: str + """The schema type of the dataset.""" + example_count: int + """The number of examples in the dataset.""" + created_at: datetime + """The timestamp when the dataset was created.""" + updated_at: datetime + """The timestamp when the dataset was last updated.""" + +@dataclass(kw_only=True) +class DatasetVersionSummary(_SerdeShape): + """Summary information about a published dataset version.""" + + dataset_version: str + """The version number of this published snapshot.""" + example_count: int + """The number of examples in this version.""" + created_at: datetime + """The timestamp when this version was published.""" + +@dataclass +class DataSourceConfigCloudWatchLogs(_SerdeShape): + """ + The CloudWatch logs configuration for reading agent traces from log + groups. + """ + + value: CloudWatchLogsInputConfig + +@dataclass +class DataSourceConfigUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +DataSourceConfig = Union[DataSourceConfigCloudWatchLogs | DataSourceConfigUnknown] +""" +The configuration that specifies where to read agent traces for online +evaluation. +""" + +class _DataSourceConfigDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> DataSourceConfig: ... + +@dataclass +class DataSourceTypeInlineExamples(_SerdeShape): + """Inline examples provided directly in the request body.""" + + value: InlineExamplesSource + +@dataclass +class DataSourceTypeS3Source(_SerdeShape): + """Amazon S3 URI pointing to a JSONL file in the customer's bucket.""" + + value: S3Source + +@dataclass +class DataSourceTypeUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +DataSourceType = Union[ + DataSourceTypeInlineExamples | DataSourceTypeS3Source | DataSourceTypeUnknown +] +"""Source of examples to add to the dataset.""" + +class _DataSourceTypeDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> DataSourceType: ... + +@dataclass(kw_only=True) +class DecryptionFailure(ServiceError, _SerdeShape): + """Exception thrown when decryption of a secret fails.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteAgentRuntimeEndpointInput(_SerdeShape): + """Dataclass for DeleteAgentRuntimeEndpointInput structure.""" + + agent_runtime_id: str | None = ... + """ + The unique identifier of the AgentCore Runtime associated with the + endpoint. + """ + endpoint_name: str | None = ... + """The name of the AgentCore Runtime endpoint to delete.""" + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure idempotency of the + request. + """ + +@dataclass(kw_only=True) +class DeleteAgentRuntimeEndpointOutput(_SerdeShape): + """Dataclass for DeleteAgentRuntimeEndpointOutput structure.""" + + status: str + """The current status of the AgentCore Runtime endpoint deletion.""" + agent_runtime_id: str | None = ... + """The unique identifier of the AgentCore Runtime.""" + endpoint_name: str | None = ... + """The name of the AgentCore Runtime endpoint.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteAgentRuntimeInput(_SerdeShape): + """Dataclass for DeleteAgentRuntimeInput structure.""" + + agent_runtime_id: str | None = ... + """The unique identifier of the AgentCore Runtime to delete.""" + agent_runtime_version: str | None = ... + """ + The version of the AgentCore Runtime to delete. When you provide this + value, only that version is deleted. When you omit it, the entire + AgentCore Runtime and all of its versions are deleted. + """ + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the operation + completes no more than one time. If this token matches a previous + request, the service ignores the request but does not return an error. + """ + +@dataclass(kw_only=True) +class DeleteAgentRuntimeOutput(_SerdeShape): + """Dataclass for DeleteAgentRuntimeOutput structure.""" + + status: str + """The current status of the AgentCore Runtime deletion.""" + agent_runtime_id: str | None = ... + """The unique identifier of the AgentCore Runtime.""" + agent_runtime_version: str | None = ... + """ + The version of the AgentCore Runtime that was deleted. This value is + present only when you delete a single version. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteApiKeyCredentialProviderInput(_SerdeShape): + """Dataclass for DeleteApiKeyCredentialProviderInput structure.""" + + name: str | None = ... + """The name of the API key credential provider to delete.""" + +@dataclass(kw_only=True) +class DeleteApiKeyCredentialProviderOutput(_SerdeShape): + """Dataclass for DeleteApiKeyCredentialProviderOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteBrowserInput(_SerdeShape): + """Dataclass for DeleteBrowserInput structure.""" + + browser_id: str | None = ... + """The unique identifier of the browser to delete.""" + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure idempotency of the + request. + """ + +@dataclass(kw_only=True) +class DeleteBrowserOutput(_SerdeShape): + """Dataclass for DeleteBrowserOutput structure.""" + + browser_id: str + """The unique identifier of the deleted browser.""" + status: str + """The current status of the browser deletion.""" + last_updated_at: datetime + """The timestamp when the browser was last updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteBrowserProfileInput(_SerdeShape): + """Dataclass for DeleteBrowserProfileInput structure.""" + + profile_id: str | None = ... + """The unique identifier of the browser profile to delete.""" + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure idempotency of the + request. + """ + +@dataclass(kw_only=True) +class DeleteBrowserProfileOutput(_SerdeShape): + """Dataclass for DeleteBrowserProfileOutput structure.""" + + profile_id: str + """The unique identifier of the deleted browser profile.""" + profile_arn: str + """The Amazon Resource Name (ARN) of the deleted browser profile.""" + status: str + """The current status of the browser profile deletion.""" + last_updated_at: datetime + """The timestamp when the browser profile was last updated.""" + last_saved_at: datetime | None = ... + """ + The timestamp when browser session data was last saved to this profile + before deletion. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteCapacityProviderInput(_SerdeShape): + """Dataclass for DeleteCapacityProviderInput structure.""" + + capacity_provider_id: str | None = ... + """The unique identifier of the capacity provider to delete.""" + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If you don't specify this field, a + value is randomly generated for you. If this token matches a previous + request, the service ignores the request, but doesn't return an error. + For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + +@dataclass(kw_only=True) +class DeleteCapacityProviderOutput(_SerdeShape): + """Dataclass for DeleteCapacityProviderOutput structure.""" + + capacity_provider_id: str + """The unique identifier of the deleted capacity provider.""" + status: str + """ + The current status of the capacity provider. For possible values, see + `CapacityProviderStatus`. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteCodeInterpreterInput(_SerdeShape): + """Dataclass for DeleteCodeInterpreterInput structure.""" + + code_interpreter_id: str | None = ... + """The unique identifier of the code interpreter to delete.""" + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure idempotency of the + request. + """ + +@dataclass(kw_only=True) +class DeleteCodeInterpreterOutput(_SerdeShape): + """Dataclass for DeleteCodeInterpreterOutput structure.""" + + code_interpreter_id: str + """The unique identifier of the deleted code interpreter.""" + status: str + """The current status of the code interpreter deletion.""" + last_updated_at: datetime + """The timestamp when the code interpreter was last updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteConfigurationBundleInput(_SerdeShape): + """Dataclass for DeleteConfigurationBundleInput structure.""" + + bundle_id: str | None = ... + """The unique identifier of the configuration bundle to delete.""" + +@dataclass(kw_only=True) +class DeleteConfigurationBundleOutput(_SerdeShape): + """Dataclass for DeleteConfigurationBundleOutput structure.""" + + bundle_arn: str | None = ... + """The Amazon Resource Name (ARN) of the deleted configuration bundle.""" + bundle_id: str + """The unique identifier of the deleted configuration bundle.""" + status: str + """The status of the configuration bundle deletion operation.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteConsentPortalInput(_SerdeShape): + """Dataclass for DeleteConsentPortalInput structure.""" + + consent_portal_identifier: str | None = ... + """ + The identifier of the consent portal. You can specify either the consent + portal ID or its Amazon Resource Name (ARN). + """ + +@dataclass(kw_only=True) +class DeleteConsentPortalOutput(_SerdeShape): + """Dataclass for DeleteConsentPortalOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteDatasetExamplesInput(_SerdeShape): + """Dataclass for DeleteDatasetExamplesInput structure.""" + + dataset_id: str | None = ... + """The unique identifier of the dataset.""" + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If you don't specify this field, a + value is randomly generated for you. If this token matches a previous + request, the service ignores the request, but doesn't return an error. + For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + example_ids: list[str] | None = ... + """The IDs of the examples to delete.""" + +@dataclass(kw_only=True) +class DeleteDatasetExamplesOutput(_SerdeShape): + """Dataclass for DeleteDatasetExamplesOutput structure.""" + + dataset_arn: str + """The Amazon Resource Name (ARN) of the dataset.""" + dataset_id: str + """The unique identifier of the dataset.""" + status: str + """The current status of the dataset.""" + deleted_count: int + """The number of examples deleted.""" + updated_at: datetime + """The timestamp when the examples were deleted.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteDatasetInput(_SerdeShape): + """Dataclass for DeleteDatasetInput structure.""" + + dataset_id: str | None = ... + """The unique identifier of the dataset to delete.""" + dataset_version: str | None = ... + """ + Optional version to delete. If absent, deletes the entire dataset. If + provided, deletes only that specific version. + """ + +@dataclass(kw_only=True) +class DeleteDatasetOutput(_SerdeShape): + """Dataclass for DeleteDatasetOutput structure.""" + + dataset_arn: str + """The Amazon Resource Name (ARN) of the dataset.""" + dataset_id: str + """The unique identifier of the dataset.""" + status: str + """The current status of the dataset after the delete request.""" + dataset_version: str + """The version that was deleted.""" + updated_at: datetime + """The timestamp when the delete was initiated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteEvaluatorInput(_SerdeShape): + """Dataclass for DeleteEvaluatorInput structure.""" + + evaluator_id: str | None = ... + """The unique identifier of the evaluator to delete.""" + +@dataclass(kw_only=True) +class DeleteEvaluatorOutput(_SerdeShape): + """Dataclass for DeleteEvaluatorOutput structure.""" + + evaluator_arn: str + """The Amazon Resource Name (ARN) of the deleted evaluator.""" + evaluator_id: str + """The unique identifier of the deleted evaluator.""" + status: str + """The status of the evaluator deletion operation.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteGatewayInput(_SerdeShape): + """Dataclass for DeleteGatewayInput structure.""" + + gateway_identifier: str | None = ... + """The identifier of the gateway to delete.""" + +@dataclass(kw_only=True) +class DeleteGatewayOutput(_SerdeShape): + """Dataclass for DeleteGatewayOutput structure.""" + + gateway_id: str + """The unique identifier of the deleted gateway.""" + status: str + """The current status of the gateway deletion.""" + status_reasons: list[str] | None = ... + """The reasons for the current status of the gateway deletion.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteGatewayRateLimitInput(_SerdeShape): + """Dataclass for DeleteGatewayRateLimitInput structure.""" + + gateway_identifier: str | None = ... + """The unique identifier of the gateway.""" + rate_limit_id: str | None = ... + """The unique identifier of the rate limit to delete.""" + +@dataclass(kw_only=True) +class DeleteGatewayRateLimitOutput(_SerdeShape): + """Dataclass for DeleteGatewayRateLimitOutput structure.""" + + rate_limit_id: str + """The unique identifier of the deleted rate limit.""" + status: str + """The current status of the rate limit deletion.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteGatewayRuleInput(_SerdeShape): + """Dataclass for DeleteGatewayRuleInput structure.""" + + gateway_identifier: str | None = ... + """The identifier of the gateway containing the rule.""" + rule_id: str | None = ... + """The unique identifier of the rule to delete.""" + +@dataclass(kw_only=True) +class DeleteGatewayRuleOutput(_SerdeShape): + """Dataclass for DeleteGatewayRuleOutput structure.""" + + rule_id: str + """The unique identifier of the deleted rule.""" + status: str + """The status of the rule deletion operation.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteGatewayTargetInput(_SerdeShape): + """Dataclass for DeleteGatewayTargetInput structure.""" + + gateway_identifier: str | None = ... + """The unique identifier of the gateway associated with the target.""" + target_id: str | None = ... + """The unique identifier of the gateway target to delete.""" + +@dataclass(kw_only=True) +class DeleteGatewayTargetOutput(_SerdeShape): + """Dataclass for DeleteGatewayTargetOutput structure.""" + + gateway_arn: str + """The Amazon Resource Name (ARN) of the gateway.""" + target_id: str + """The unique identifier of the deleted gateway target.""" + status: str + """The current status of the gateway target deletion.""" + status_reasons: list[str] | None = ... + """The reasons for the current status of the gateway target deletion.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteHarnessEndpointInput(_SerdeShape): + """Dataclass for DeleteHarnessEndpointInput structure.""" + + harness_id: str | None = ... + """The ID of the harness that the endpoint belongs to.""" + endpoint_name: str | None = ... + """The name of the endpoint to delete.""" + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure idempotency of the + request. + """ + +@dataclass(kw_only=True) +class DeleteHarnessEndpointOutput(_SerdeShape): + """Dataclass for DeleteHarnessEndpointOutput structure.""" + + endpoint: HarnessEndpoint + """The endpoint that was deleted.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteHarnessInput(_SerdeShape): + """Dataclass for DeleteHarnessInput structure.""" + + harness_id: str | None = ... + """The ID of the harness to delete.""" + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure idempotency of the + request. + """ + delete_managed_memory: bool | None = ... + """ + Whether to delete the managed memory on harness deletion. Default: true. + If false, the memory is disassociated and becomes a regular + customer-owned resource. + """ + +@dataclass(kw_only=True) +class DeleteHarnessOutput(_SerdeShape): + """Dataclass for DeleteHarnessOutput structure.""" + + harness: Harness | None = ... + """The harness that was deleted.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteMemoryInput(_SerdeShape): + """Dataclass for DeleteMemoryInput structure.""" + + client_token: str | None = ... + """ + A client token is used for keeping track of idempotent requests. It can + contain a session id which can be around 250 chars, combined with a + unique AWS identifier. + """ + memory_id: str | None = ... + """The unique identifier of the memory to delete.""" + +@dataclass(kw_only=True) +class DeleteMemoryOutput(_SerdeShape): + """Dataclass for DeleteMemoryOutput structure.""" + + memory_id: str + """The unique identifier of the deleted AgentCore Memory resource.""" + status: str | None = ... + """The current status of the AgentCore Memory resource deletion.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteMemoryStrategyInput(_SerdeShape): + """Input for deleting a memory strategy.""" + + memory_strategy_id: str + """The unique identifier of the memory strategy to delete.""" + +@dataclass(kw_only=True) +class DeleteOauth2CredentialProviderInput(_SerdeShape): + """Dataclass for DeleteOauth2CredentialProviderInput structure.""" + + name: str | None = ... + """The name of the OAuth2 credential provider to delete.""" + +@dataclass(kw_only=True) +class DeleteOauth2CredentialProviderOutput(_SerdeShape): + """Dataclass for DeleteOauth2CredentialProviderOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteOnlineEvaluationConfigInput(_SerdeShape): + """Dataclass for DeleteOnlineEvaluationConfigInput structure.""" + + online_evaluation_config_id: str | None = ... + """The unique identifier of the online evaluation configuration to delete.""" + +@dataclass(kw_only=True) +class DeleteOnlineEvaluationConfigOutput(_SerdeShape): + """Dataclass for DeleteOnlineEvaluationConfigOutput structure.""" + + online_evaluation_config_arn: str + """ + The Amazon Resource Name (ARN) of the deleted online evaluation + configuration. + """ + online_evaluation_config_id: str + """The unique identifier of the deleted online evaluation configuration.""" + status: str + """The status of the online evaluation configuration deletion operation.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeletePaymentConnectorInput(_SerdeShape): + """Dataclass for DeletePaymentConnectorInput structure.""" + + payment_manager_id: str | None = ... + """The unique identifier of the parent payment manager.""" + payment_connector_id: str | None = ... + """The unique identifier of the payment connector to delete.""" + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If you don't specify this field, a + value is randomly generated for you. If this token matches a previous + request, the service ignores the request, but doesn't return an error. + For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + +@dataclass(kw_only=True) +class DeletePaymentConnectorOutput(_SerdeShape): + """Dataclass for DeletePaymentConnectorOutput structure.""" + + status: str + """ + The current status of the payment connector, set to `DELETING` when + deletion is initiated. Possible values include `CREATING`, `READY`, + `UPDATING`, `DELETING`, `CREATE_FAILED`, `UPDATE_FAILED`, and + `DELETE_FAILED`. + """ + payment_connector_id: str | None = ... + """The unique identifier of the deleted payment connector.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeletePaymentCredentialProviderInput(_SerdeShape): + """Dataclass for DeletePaymentCredentialProviderInput structure.""" + + name: str | None = ... + """The name of the payment credential provider to delete.""" + +@dataclass(kw_only=True) +class DeletePaymentCredentialProviderOutput(_SerdeShape): + """Dataclass for DeletePaymentCredentialProviderOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeletePaymentManagerInput(_SerdeShape): + """Dataclass for DeletePaymentManagerInput structure.""" + + payment_manager_id: str | None = ... + """The unique identifier of the payment manager to delete.""" + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If you don't specify this field, a + value is randomly generated for you. If this token matches a previous + request, the service ignores the request, but doesn't return an error. + For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + +@dataclass(kw_only=True) +class DeletePaymentManagerOutput(_SerdeShape): + """Dataclass for DeletePaymentManagerOutput structure.""" + + status: str + """ + The current status of the payment manager, set to `DELETING` when + deletion is initiated. Possible values include `CREATING`, `READY`, + `UPDATING`, `DELETING`, `CREATE_FAILED`, `UPDATE_FAILED`, and + `DELETE_FAILED`. + """ + payment_manager_id: str | None = ... + """The unique identifier of the deleted payment manager.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeletePolicyEngineInput(_SerdeShape): + """Dataclass for DeletePolicyEngineInput structure.""" + + policy_engine_id: str | None = ... + """ + The unique identifier of the policy engine to be deleted. This must be a + valid policy engine ID that exists within the account. + """ + +@dataclass(kw_only=True) +class DeletePolicyEngineOutput(_SerdeShape): + """Dataclass for DeletePolicyEngineOutput structure.""" + + policy_engine_id: str + """ + The unique identifier of the policy engine being deleted. This confirms + which policy engine the deletion operation targets. + """ + name: str + """The customer-assigned name of the deleted policy engine.""" + created_at: datetime + """The timestamp when the deleted policy engine was originally created.""" + updated_at: datetime + """ + The timestamp when the deleted policy engine was last modified before + deletion. This tracks the final state of the policy engine before it was + removed from the system. + """ + policy_engine_arn: str + """ + The Amazon Resource Name (ARN) of the deleted policy engine. This + globally unique identifier confirms which policy engine resource was + successfully removed. + """ + status: str + """ + The status of the policy engine deletion operation. This provides status + about any issues that occurred during the deletion process. + """ + encryption_key_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the KMS key used to encrypt the policy + engine data. + """ + description: str | None = ... + """The human-readable description of the deleted policy engine.""" + status_reasons: list[str] + """ + Additional information about the deletion status. This provides details + about the deletion process or any issues that may have occurred. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeletePolicyInput(_SerdeShape): + """Dataclass for DeletePolicyInput structure.""" + + policy_engine_id: str | None = ... + """ + The identifier of the policy engine that manages the policy to be + deleted. This ensures the policy is deleted from the correct policy + engine context. + """ + policy_id: str | None = ... + """ + The unique identifier of the policy to be deleted. This must be a valid + policy ID that exists within the specified policy engine. + """ + +@dataclass(kw_only=True) +class DeletePolicyOutput(_SerdeShape): + """Dataclass for DeletePolicyOutput structure.""" + + policy_id: str + """ + The unique identifier of the policy being deleted. This confirms which + policy the deletion operation targets. + """ + name: str + """ + The customer-assigned name of the deleted policy. This confirms which + policy was successfully removed from the system and matches the name + that was originally assigned during policy creation. + """ + policy_engine_id: str + """ + The identifier of the policy engine from which the policy was deleted. + This confirms the policy engine context for the deletion operation. + """ + created_at: datetime + """The timestamp when the deleted policy was originally created.""" + updated_at: datetime + """ + The timestamp when the deleted policy was last modified before deletion. + This tracks the final state of the policy before it was removed from the + system. + """ + policy_arn: str + """ + The Amazon Resource Name (ARN) of the deleted policy. This globally + unique identifier confirms which policy resource was successfully + removed. + """ + status: str + """ + The status of the policy deletion operation. This provides information + about any issues that occurred during the deletion process. + """ + enforcement_mode: str = ... + """The enforcement mode of the deleted policy.""" + definition: PolicyDefinition + """ + Represents the definition structure for policies within the AgentCore + Policy system. This structure encapsulates different policy formats and + languages that can be used to define access control rules. + """ + description: str | None = ... + """The human-readable description of the deleted policy.""" + status_reasons: list[str] + """ + Additional information about the deletion status. This provides details + about the deletion process or any issues that may have occurred. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteRegistryInput(_SerdeShape): + """Dataclass for DeleteRegistryInput structure.""" + + registry_id: str | None = ... + """ + The identifier of the registry to delete. You can specify either the + Amazon Resource Name (ARN) or the ID of the registry. + """ + +@dataclass(kw_only=True) +class DeleteRegistryOutput(_SerdeShape): + """Dataclass for DeleteRegistryOutput structure.""" + + status: str + """ + The current status of the registry, set to `DELETING` when deletion is + initiated. For a list of all possible registry statuses, see the + `RegistryStatus` data type. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteRegistryRecordInput(_SerdeShape): + """Dataclass for DeleteRegistryRecordInput structure.""" + + registry_id: str | None = ... + """ + The identifier of the registry containing the record. You can specify + either the Amazon Resource Name (ARN) or the ID of the registry. + """ + record_id: str | None = ... + """ + The identifier of the registry record to delete. You can specify either + the Amazon Resource Name (ARN) or the ID of the record. + """ + +@dataclass(kw_only=True) +class DeleteRegistryRecordOutput(_SerdeShape): + """Dataclass for DeleteRegistryRecordOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteResourcePolicyInput(_SerdeShape): + """Dataclass for DeleteResourcePolicyInput structure.""" + + resource_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the resource for which to delete the + resource policy. + """ + +@dataclass(kw_only=True) +class DeleteResourcePolicyOutput(_SerdeShape): + """Dataclass for DeleteResourcePolicyOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteWorkloadIdentityInput(_SerdeShape): + """Dataclass for DeleteWorkloadIdentityInput structure.""" + + name: str | None = ... + """The name of the workload identity to delete.""" + +@dataclass(kw_only=True) +class DeleteWorkloadIdentityOutput(_SerdeShape): + """Dataclass for DeleteWorkloadIdentityOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DerivedEvaluatorConfig(_SerdeShape): + """ + The configuration for a derived evaluator. It reuses an existing + evaluator's logic on your own model. + """ + + base_evaluator_id: str + """ + The identifier of the base evaluator whose logic to run (a `Builtin.*` + or `ThirdParty.*` evaluator). + """ + model_config: EvaluatorModelConfig + """The configuration of the evaluator model that you supply.""" + +@dataclass(kw_only=True) +class Descriptors(_SerdeShape): + """ + Contains descriptor-type-specific configurations for a registry record. + Only the descriptor matching the record's `descriptorType` should be + populated. + """ + + mcp: McpDescriptor | None = ... + """ + The Model Context Protocol (MCP) descriptor configuration. Use this when + the `descriptorType` is `MCP`. + """ + a2a: A2aDescriptor | None = ... + """ + The Agent-to-Agent (A2A) protocol descriptor configuration. Use this + when the `descriptorType` is `A2A`. + """ + custom: CustomDescriptor | None = ... + """ + The custom descriptor configuration. Use this when the `descriptorType` + is `CUSTOM`. + """ + agent_skills: AgentSkillsDescriptor | None = ... + """ + The agent skills descriptor configuration. Use this when the + `descriptorType` is `AGENT_SKILLS`. + """ + +class DescriptorType(UnknownEnumMixin, StrEnum): + MCP = "MCP" + A2_A = "A2A" + CUSTOM = "CUSTOM" + AGENT_SKILLS = "AGENT_SKILLS" + +class DraftStatus(UnknownEnumMixin, StrEnum): + """Publish synchronization state of the DRAFT working copy.""" + + MODIFIED = "MODIFIED" + """ + DRAFT has changes not yet reflected in any published version, or no + versions have been published yet. + """ + UNMODIFIED = "UNMODIFIED" + """DRAFT content matches the latest published version exactly.""" + +@dataclass(kw_only=True) +class EbsVolumeConfiguration(_SerdeShape): + """ + The configuration for an Amazon EBS-backed persistent volume. The + service creates persistent volumes when a session first launches, and + the volumes survive instance termination. The volumes persist until you + delete the session. + """ + + name: str + """ + The logical name of the volume. Use this name to reference the volume + when you mount it into an agent runtime. + """ + size_gi_b: int + """The size of the volume, in GiB.""" + volume_type: str = ... + """ + The Amazon EBS volume type. If you do not specify a type, the default is + `gp3`. + """ + iops: int | None = ... + """ + The number of IOPS to provision. Valid only for `gp3`, `io1`, and `io2` + volumes. + """ + throughput: int | None = ... + """The throughput, in MiB/s. Valid only for `gp3` volumes.""" + encrypted: bool | None = ... + """ + Specifies whether to encrypt the volume. If `true`, the service encrypts + the volume with the KMS key that you specify in `kmsKeyId`, or the + default KMS key for Amazon EBS if you do not specify one. The default is + `true`. + """ + kms_key_id: str | None = ... + """The identifier of the KMS key to use for encryption.""" + snapshot_id: str | None = ... + """ + An optional Amazon EBS snapshot ID. If provided, the volume is + initialized from this snapshot the first time it is created. On + subsequent restarts, the existing volume is used and the snapshot is + ignored. + """ + +class EbsVolumeType(UnknownEnumMixin, StrEnum): + """The type of Amazon EBS volume.""" + + STANDARD = "standard" + IO1 = "io1" + IO2 = "io2" + GP2 = "gp2" + SC1 = "sc1" + ST1 = "st1" + GP3 = "gp3" + +@dataclass(kw_only=True) +class Ec2Configuration(_SerdeShape): + """ + The configuration for Amazon EC2-based compute, including the launch + template source, networking, storage volumes, and instance lifecycle + settings. + """ + + launch_template_source: LaunchTemplateSource + """ + The source of the launch template configuration that defines how + instances are launched. + """ + vpc_configuration: VpcConfiguration + """ + The VPC configuration for launching instances, including subnets and + security groups. + """ + volumes: list[VolumeConfiguration] | None = ... + """ + The named persistent Amazon EBS volumes for the capacity provider. A + capacity provider can define up to five volumes. + """ + lifecycle_configuration: InstanceLifecycleConfiguration | None = ... + """The lifecycle configuration for instances in the capacity provider.""" + root_volume: RootVolumeConfiguration | None = ... + """ + The configuration for the instance root volume. Specify the amount of + free space to guarantee and, optionally, the Amazon EBS performance and + encryption settings. The device name and delete-on-termination behavior + are not configurable. + """ + +@dataclass(kw_only=True) +class EfsAccessPointConfiguration(_SerdeShape): + """ + Configuration for an Amazon EFS access point filesystem mounted into the + AgentCore Runtime. EFS access points provide shared file storage + accessible from your AgentCore Runtime sessions. + """ + + access_point_arn: str + """The ARN of the EFS access point to mount into the AgentCore Runtime.""" + mount_path: str + """ + The mount path for the EFS access point inside the AgentCore Runtime. + The path must be under `/mnt` with exactly one subdirectory level (for + example, `/mnt/data`). + """ + +@dataclass(kw_only=True) +class EfsConfiguration(_SerdeShape): + """ + The configuration for mounting an Amazon Elastic File System (Amazon + EFS) access point that you own into a session. + """ + + access_point_arn: str + """ + The Amazon Resource Name (ARN) of the Amazon Elastic File System (Amazon + EFS) access point to mount. + """ + mount_path: str + """ + The absolute path within the session at which the access point is + mounted, for example `/mnt/efs`. Each mount path must be unique across + all file system configurations in the session. + """ + file_system_arn: str + """ + The Amazon Resource Name (ARN) of the Amazon Elastic File System (Amazon + EFS) file system that owns the access point. + """ + +@dataclass(kw_only=True) +class EncryptionFailure(ServiceError, _SerdeShape): + """Exception thrown when encryption of a secret fails.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class EndpointIpAddressType(UnknownEnumMixin, StrEnum): + IPV4 = "IPV4" + IPV6 = "IPV6" + +class EnforcementMode(UnknownEnumMixin, StrEnum): + """ + The enforcement mode for a policy. Run this policy in `LOG_ONLY` mode to + collect data on how it affects your application. Once you are satisfied + with the data gathered, switch the policy to `ACTIVE`. + """ + + ACTIVE = "ACTIVE" + LOG_ONLY = "LOG_ONLY" + +@dataclass(kw_only=True) +class EphemeralBlockDeviceMapping(_SerdeShape): + """A block device mapping for an instance store (ephemeral) volume.""" + + device_name: str | None = ... + """The device name, for example `/dev/sdh` or `xvdh`.""" + virtual_name: str | None = ... + """ + The virtual device name (`ephemeralN`). Instance store volumes are + numbered starting from 0. The number of available instance store volumes + depends on the instance type. After you connect to the instance, you + must mount the volume. + """ + ebs: EphemeralEBSVolumeConfiguration | None = ... + """ + The shared Amazon EBS performance and encryption properties for a + volume. These properties are common across the different volume + configurations for a capacity provider. + """ + +@dataclass(kw_only=True) +class EphemeralEBSVolumeConfiguration(_SerdeShape): + """ + The shared Amazon EBS performance and encryption properties for a + volume. These properties are common across the different volume + configurations for a capacity provider. + """ + + volume_type: str = ... + """ + The Amazon EBS volume type. If you do not specify a type, the default is + `gp3`. + """ + iops: int | None = ... + """ + The number of IOPS to provision. For `gp3`, `io1`, and `io2` volumes, + this is the number of IOPS provisioned for the volume. For `gp2` + volumes, this sets the baseline IOPS performance. It also controls the + rate at which the volume accumulates I/O credits for bursting. Supported + values: `gp3`, 3,000--80,000; `io1`, 100--64,000; `io2`, 100--256,000. + """ + throughput: int | None = ... + """ + The throughput to provision, in MiB/s. Valid only for `gp3` volumes. + Valid range: 125--2,000 MiB/s. + """ + encrypted: bool | None = ... + """ + Specifies whether to encrypt the volume. Encrypted volumes can be + attached only to instances that support Amazon EBS encryption. If you + create a volume from a snapshot, you cannot specify an encryption value. + """ + kms_key_id: str | None = ... + """ + The identifier (key ID, key alias, key ARN, or alias ARN) of the + customer managed KMS key to use for Amazon EBS encryption. + """ + snapshot_id: str | None = ... + """The ID of the snapshot.""" + volume_size: int | None = ... + """ + The size of the volume, in GiB. You must specify either a snapshot ID or + a volume size. Supported sizes: `gp2`, 1--16,384; `gp3`, 1--65,536; + `io1`, 4--16,384; `io2`, 4--65,536. + """ + volume_initialization_rate: int | None = ... + """ + The rate at which the volume is initialized after creation, in MiB/s. + Supported only for volumes created from snapshots. Valid range: 100--300 + MiB/s. + """ + ebs_card_index: int | None = ... + """ + The index of the Amazon EBS card. Applies to instances with multiple + Amazon EBS cards. + """ + +@dataclass(kw_only=True) +class EpisodicConsolidationOverride(_SerdeShape): + """ + Contains configurations to override the default consolidation step for + the episodic memory strategy. + """ + + append_to_prompt: str + """ + The text appended to the prompt for the consolidation step of the + episodic memory strategy. + """ + model_id: str + """ + The model ID used for the consolidation step of the episodic memory + strategy. + """ + +@dataclass(kw_only=True) +class EpisodicExtractionOverride(_SerdeShape): + """ + Contains configurations to override the default extraction step for the + episodic memory strategy. + """ + + append_to_prompt: str + """ + The text appended to the prompt for the extraction step of the episodic + memory strategy. + """ + model_id: str + """ + The model ID used for the extraction step of the episodic memory + strategy. + """ + +@dataclass(kw_only=True) +class EpisodicMemoryStrategyInput(_SerdeShape): + """Input for creating an episodic memory strategy.""" + + name: str + """The name of the episodic memory strategy.""" + description: str | None = ... + """The description of the episodic memory strategy.""" + namespaces: list[str] | None = ... + """ + This is a legacy parameter, use `namespaceTemplates`. The namespaces for + which to create episodes. + """ + namespace_templates: list[str] | None = ... + """The namespaceTemplates for which to create episodes.""" + reflection_configuration: EpisodicReflectionConfigurationInput | None = ... + """ + The configuration for the reflections created with the episodic memory + strategy. + """ + memory_record_schema: MemoryRecordSchema | None = ... + """Schema for metadata fields on records generated by this strategy.""" + +@dataclass(kw_only=True) +class EpisodicOverrideConfigurationInput(_SerdeShape): + """Input for the configuration to override the episodic memory strategy.""" + + extraction: EpisodicOverrideExtractionConfigurationInput | None = ... + """ + Contains configurations for overriding the extraction step of the + episodic memory strategy. + """ + consolidation: EpisodicOverrideConsolidationConfigurationInput | None = ... + """ + Contains configurations for overriding the consolidation step of the + episodic memory strategy. + """ + reflection: EpisodicOverrideReflectionConfigurationInput | None = ... + """ + Contains configurations for overriding the reflection step of the + episodic memory strategy. + """ + +@dataclass(kw_only=True) +class EpisodicOverrideConsolidationConfigurationInput(_SerdeShape): + """ + Configurations for overriding the consolidation step of the episodic + memory strategy. + """ + + append_to_prompt: str + """ + The text to append to the prompt for the consolidation step of the + episodic memory strategy. + """ + model_id: str + """ + The model ID to use for the consolidation step of the episodic memory + strategy. + """ + +@dataclass(kw_only=True) +class EpisodicOverrideExtractionConfigurationInput(_SerdeShape): + """ + Configurations for overriding the extraction step of the episodic memory + strategy. + """ + + append_to_prompt: str + """ + The text to append to the prompt for the extraction step of the episodic + memory strategy. + """ + model_id: str + """ + The model ID to use for the extraction step of the episodic memory + strategy. + """ + +@dataclass(kw_only=True) +class EpisodicOverrideReflectionConfigurationInput(_SerdeShape): + """ + Configurations for overriding the reflection step of the episodic memory + strategy. + """ + + append_to_prompt: str + """ + The text to append to the prompt for reflection step of the episodic + memory strategy. + """ + model_id: str + """ + The model ID to use for the reflection step of the episodic memory + strategy. + """ + namespaces: list[str] | None = ... + """ + This is a legacy parameter, use `namespaceTemplates`. The namespaces to + use for episodic reflection. Can be less nested than the episodic + namespaces. + """ + namespace_templates: list[str] | None = ... + """ + The namespaceTemplates to use for episodic reflection. Can be less + nested than the episodic namespaces. + """ + memory_record_schema: MemoryRecordSchema | None = ... + """ + Schema for metadata fields on records generated by this reflection + override. + """ + +@dataclass(kw_only=True) +class EpisodicReflectionConfiguration(_SerdeShape): + """ + The configuration for the reflections created with the episodic memory + strategy. + """ + + namespaces: list[str] | None = ... + """ + This is a legacy parameter, use `namespaceTemplates`. The namespaces for + which to create reflections. Can be less nested than the episodic + namespaces. + """ + namespace_templates: list[str] | None = ... + """ + The namespaceTemplates for which to create reflections. Can be less + nested than the episodic namespaces. + """ + memory_record_schema: MemoryRecordSchema | None = ... + """\"Schema for metadata fields on records generated by reflections.""" + +@dataclass(kw_only=True) +class EpisodicReflectionConfigurationInput(_SerdeShape): + """An episodic reflection configuration input.""" + + namespaces: list[str] | None = ... + """ + This is a legacy parameter, use `namespaceTemplates`. The namespaces + over which to create reflections. Can be less nested than episode + namespaces. + """ + namespace_templates: list[str] | None = ... + """ + The namespaceTemplates over which to create reflections. Can be less + nested than episode namespaces. + """ + memory_record_schema: MemoryRecordSchema | None = ... + """Schema for metadata fields on records generated by reflections.""" + +@dataclass(kw_only=True) +class EpisodicReflectionOverride(_SerdeShape): + """ + Contains configurations to override the default reflection step for the + episodic memory strategy. + """ + + append_to_prompt: str + """ + The text appended to the prompt for the reflection step of the episodic + memory strategy. + """ + model_id: str + """ + The model ID used for the reflection step of the episodic memory + strategy. + """ + namespaces: list[str] | None = ... + """ + This is a legacy parameter. The namespaces over which reflections were + created. Can be less nested than the episodic namespaces. + """ + namespace_templates: list[str] | None = ... + """ + The namespaceTemplates over which reflections were created. Can be less + nested than the episodic namespaces. + """ + memory_record_schema: MemoryRecordSchema | None = ... + """ + Schema for metadata fields on records generated by this reflection + override. + """ + +@dataclass +class EvaluatorConfigLlmAsAJudge(_SerdeShape): + """ + The LLM-as-a-Judge configuration that uses a language model to evaluate + agent performance based on custom instructions and rating scales. + """ + + value: LlmAsAJudgeEvaluatorConfig + +@dataclass +class EvaluatorConfigCodeBased(_SerdeShape): + """ + Configuration for a code-based evaluator that uses a customer-managed + Lambda function to programmatically assess agent performance. + """ + + value: CodeBasedEvaluatorConfig + +@dataclass +class EvaluatorConfigDerived(_SerdeShape): + """ + The configuration for an evaluator derived from an existing base + evaluator (a built-in or third-party evaluator), run on your own model. + The base evaluator supplies the prompt and scoring. + """ + + value: DerivedEvaluatorConfig + +@dataclass +class EvaluatorConfigUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +EvaluatorConfig = Union[ + EvaluatorConfigLlmAsAJudge + | EvaluatorConfigCodeBased + | EvaluatorConfigDerived + | EvaluatorConfigUnknown +] +""" +The configuration that defines how an evaluator assesses agent +performance, including the evaluation method and parameters. +""" + +class _EvaluatorConfigDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> EvaluatorConfig: ... + +class EvaluatorLevel(UnknownEnumMixin, StrEnum): + TOOL_CALL = "TOOL_CALL" + TRACE = "TRACE" + SESSION = "SESSION" + +@dataclass +class EvaluatorModelConfigBedrockEvaluatorModelConfig(_SerdeShape): + """The Amazon Bedrock model configuration for evaluation.""" + + value: BedrockEvaluatorModelConfig + +@dataclass +class EvaluatorModelConfigResponsesEvaluatorModelConfig(_SerdeShape): + """The OpenResponses model configuration for evaluation.""" + + value: OpenResponsesEvaluatorModelConfig + +@dataclass +class EvaluatorModelConfigUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +EvaluatorModelConfig = Union[ + EvaluatorModelConfigBedrockEvaluatorModelConfig + | EvaluatorModelConfigResponsesEvaluatorModelConfig + | EvaluatorModelConfigUnknown +] +""" +The model configuration that specifies which foundation model to use for +evaluation and how to configure it. +""" + +class _EvaluatorModelConfigDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> EvaluatorModelConfig: ... + +@dataclass +class EvaluatorReferenceEvaluatorId(_SerdeShape): + """ + The unique identifier of the evaluator. Can reference builtin evaluators + (e.g., Builtin.Helpfulness) or custom evaluators. + """ + + value: str + +@dataclass +class EvaluatorReferenceUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +EvaluatorReference = Union[EvaluatorReferenceEvaluatorId | EvaluatorReferenceUnknown] +""" +The reference to an evaluator used in online evaluation configurations, +containing the evaluator identifier. +""" + +class _EvaluatorReferenceDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> EvaluatorReference: ... + +class EvaluatorStatus(UnknownEnumMixin, StrEnum): + ACTIVE = "ACTIVE" + CREATING = "CREATING" + CREATE_FAILED = "CREATE_FAILED" + UPDATING = "UPDATING" + UPDATE_FAILED = "UPDATE_FAILED" + DELETING = "DELETING" + +@dataclass(kw_only=True) +class EvaluatorSummary(_SerdeShape): + """ + The summary information about an evaluator, including basic metadata and + status information. + """ + + evaluator_arn: str + """The Amazon Resource Name (ARN) of the evaluator.""" + evaluator_id: str + """The unique identifier of the evaluator.""" + evaluator_name: str + """The name of the evaluator.""" + description: str | None = ... + """The description of the evaluator.""" + evaluator_type: str + """ + The type of evaluator, indicating whether it is a built-in evaluator + provided by the service or a custom evaluator created by the user. + """ + provider: str | None = ... + """ + The source of the evaluator's logic: Amazon Web Services, a third-party + library, or you. + """ + level: str | None = ... + """ + The evaluation level (`TOOL_CALL`, `TRACE`, or `SESSION`) that + determines the scope of evaluation. + """ + status: str + """The current status of the evaluator.""" + created_at: datetime + """The timestamp when the evaluator was created.""" + updated_at: datetime + """The timestamp when the evaluator was last updated.""" + locked_for_modification: bool | None = ... + """ + Whether the evaluator is locked for modification due to being referenced + by active online evaluation configurations. + """ + kms_key_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the customer managed KMS key used to + encrypt the evaluator's sensitive data. This field is only present for + evaluators encrypted with a customer managed key. + """ + +class EvaluatorType(UnknownEnumMixin, StrEnum): + BUILTIN = "Builtin" + THIRD_PARTY = "ThirdParty" + CUSTOM = "Custom" + CODE = "CustomCode" + CUSTOM_DERIVED = "CustomDerived" + +class ExceptionLevel(UnknownEnumMixin, StrEnum): + DEBUG = "DEBUG" + +@dataclass +class ExtractionConfigLlmExtractionConfig(_SerdeShape): + """Model-based extraction using a definition and instructions.""" + + value: LlmExtractionConfig + +@dataclass +class ExtractionConfigUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ExtractionConfig = Union[ExtractionConfigLlmExtractionConfig | ExtractionConfigUnknown] +"""Configuration for metadata extraction from conversational content.""" + +class _ExtractionConfigDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> ExtractionConfig: ... + +@dataclass +class ExtractionConfigurationCustomExtractionConfiguration(_SerdeShape): + """The custom extraction configuration.""" + + value: CustomExtractionConfiguration + +@dataclass +class ExtractionConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ExtractionConfiguration = Union[ + ExtractionConfigurationCustomExtractionConfiguration + | ExtractionConfigurationUnknown +] +"""Contains extraction configuration information for a memory strategy.""" + +class _ExtractionConfigurationDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> ExtractionConfiguration: ... + +class ExtractionType(UnknownEnumMixin, StrEnum): + """ + The extraction type for a metadata field, determining how the value is + obtained during memory processing. + """ + + LLM_INFERRED = "LLM_INFERRED" + STRICTLY_CONSISTENT = "STRICTLY_CONSISTENT" + +@dataclass +class FilesystemConfigurationSessionStorage(_SerdeShape): + """ + Configuration for session storage. Session storage provides persistent + storage that is preserved across AgentCore Runtime session invocations. + """ + + value: SessionStorageConfiguration + +@dataclass +class FilesystemConfigurationS3FilesAccessPoint(_SerdeShape): + """ + Configuration for an Amazon S3 Files access point to mount into the + AgentCore Runtime. + """ + + value: S3FilesAccessPointConfiguration + +@dataclass +class FilesystemConfigurationEfsAccessPoint(_SerdeShape): + """ + Configuration for an Amazon EFS access point to mount into the AgentCore + Runtime. + """ + + value: EfsAccessPointConfiguration + +@dataclass +class FilesystemConfigurationCapacityProviderVolume(_SerdeShape): + """ + Configuration for a capacity provider volume to mount into the AgentCore + Runtime. This mounts a persistent volume that is defined on the capacity + provider, referenced by its logical name. + """ + + value: CapacityProviderVolumeConfiguration + +@dataclass +class FilesystemConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +FilesystemConfiguration = Union[ + FilesystemConfigurationSessionStorage + | FilesystemConfigurationS3FilesAccessPoint + | FilesystemConfigurationEfsAccessPoint + | FilesystemConfigurationCapacityProviderVolume + | FilesystemConfigurationUnknown +] +""" +Configuration for a filesystem that can be mounted into the AgentCore +Runtime. +""" + +class _FilesystemConfigurationDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> FilesystemConfiguration: ... + +@dataclass(kw_only=True) +class Filter(_SerdeShape): + """ + The filter that applies conditions to agent traces during online + evaluation to determine which traces should be evaluated. + """ + + key: str + """The key or field name to filter on within the agent trace data.""" + operator: str + """The comparison operator to use for filtering.""" + value: FilterValue + """The value to compare against using the specified operator.""" + +class FilterOperator(UnknownEnumMixin, StrEnum): + EQUALS = "Equals" + NOT_EQUALS = "NotEquals" + GREATER_THAN = "GreaterThan" + LESS_THAN = "LessThan" + GREATER_THAN_OR_EQUAL = "GreaterThanOrEqual" + LESS_THAN_OR_EQUAL = "LessThanOrEqual" + CONTAINS = "Contains" + NOT_CONTAINS = "NotContains" + +@dataclass +class FilterValueStringValue(_SerdeShape): + """The string value for text-based filtering.""" + + value: str + +@dataclass +class FilterValueDoubleValue(_SerdeShape): + """The numeric value for numerical filtering and comparisons.""" + + value: float + +@dataclass +class FilterValueBooleanValue(_SerdeShape): + """The boolean value for true/false filtering conditions.""" + + value: bool + +@dataclass +class FilterValueUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +FilterValue = Union[ + FilterValueStringValue + | FilterValueDoubleValue + | FilterValueBooleanValue + | FilterValueUnknown +] +""" +The value used in filter comparisons, supporting different data types +for flexible filtering criteria. +""" + +class _FilterValueDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> FilterValue: ... + +@dataclass(kw_only=True) +class Finding(_SerdeShape): + """ + Represents a finding or issue discovered during policy generation or + validation. Findings provide insights about potential problems, + recommendations, or validation results from policy analysis operations. + Finding types include: VALID (policy is ready to use), INVALID (policy + has validation errors that must be fixed), NOT_TRANSLATABLE (input + couldn't be converted to policy), ALLOW_ALL (policy would allow all + actions, potential security risk), ALLOW_NONE (policy would allow no + actions, unusable), DENY_ALL (policy would deny all actions, may be too + restrictive), and DENY_NONE (policy would deny no actions, ineffective). + Review all findings before creating policies from generated assets to + ensure they match your security requirements. + """ + + type: str | None = ... + """ + The type or category of the finding. This classifies the finding as an + error, warning, recommendation, or informational message to help users + understand the severity and nature of the issue. + """ + description: str | None = ... + """ + A human-readable description of the finding. This provides detailed + information about the issue, recommendation, or validation result to + help users understand and address the finding. + """ + +class FindingType(UnknownEnumMixin, StrEnum): + VALID = "VALID" + INVALID = "INVALID" + NOT_TRANSLATABLE = "NOT_TRANSLATABLE" + ALLOW_ALL = "ALLOW_ALL" + ALLOW_NONE = "ALLOW_NONE" + DENY_ALL = "DENY_ALL" + DENY_NONE = "DENY_NONE" + +@dataclass(kw_only=True) +class FromUrlSynchronizationConfiguration(_SerdeShape): + """Configuration for synchronizing from a URL-based MCP server.""" + + url: str + """The HTTPS URL of the MCP server to synchronize from.""" + credential_provider_configurations: ( + list[RegistryRecordCredentialProviderConfiguration] | None + ) = ... + """ + Optional list of credential provider configurations for authenticating + with the MCP server. At most one credential provider configuration can + be specified. + """ + +@dataclass(kw_only=True) +class GatewayApiKeyCredentialProvider(_SerdeShape): + """ + An API key credential provider for gateway authentication. This + structure contains the configuration for authenticating with the target + endpoint using an API key. + """ + + provider_arn: str + """ + The Amazon Resource Name (ARN) of the API key credential provider. This + ARN identifies the provider in Amazon Web Services. + """ + credential_parameter_name: str | None = ... + """ + The name of the credential parameter for the API key. This parameter + name is used when sending the API key to the target endpoint. + """ + credential_prefix: str | None = ... + """ + The prefix for the API key credential. This prefix is added to the API + key when sending it to the target endpoint. + """ + credential_location: str | None = ... + """ + The location of the API key credential. This field specifies where in + the request the API key should be placed. + """ + +class GatewayInterceptionPoint(UnknownEnumMixin, StrEnum): + REQUEST = "REQUEST" + RESPONSE = "RESPONSE" + +@dataclass(kw_only=True) +class GatewayInterceptorConfiguration(_SerdeShape): + """ + The configuration for an interceptor on a gateway. This structure + defines settings for an interceptor that will be invoked during the + invocation of the gateway. + """ + + interceptor: InterceptorConfiguration + """ + The infrastructure settings of an interceptor configuration. This + structure defines how the interceptor can be invoked. + """ + interception_points: list[str] + """ + The supported points of interception. This field specifies which points + during the gateway invocation to invoke the interceptor + """ + input_configuration: InterceptorInputConfiguration | None = ... + """ + The configuration for the input of the interceptor. This field specifies + how the input to the interceptor is constructed + """ + +@dataclass(kw_only=True) +class GatewayPolicyEngineConfiguration(_SerdeShape): + """ + The configuration for a policy engine associated with a gateway. A + policy engine is a collection of policies that evaluates and authorizes + agent tool calls. When associated with a gateway, the policy engine + intercepts all agent requests and determines whether to allow or deny + each action based on the defined policies. + """ + + arn: str + """ + The ARN of the policy engine. The policy engine contains Cedar or + Dogwood policies that define fine-grained authorization rules specifying + who can perform what actions on which resources as agents interact + through the gateway. + """ + mode: str + """ + The enforcement mode for the policy engine. Valid values include: + + - `LOG_ONLY` - The policy engine evaluates each action against your + policies and adds traces on whether tool calls would be allowed or + denied, but does not enforce the decision. Use this mode to test and + validate policies before enabling enforcement. + + - `ENFORCE` - The policy engine evaluates actions against your policies + and enforces decisions by allowing or denying agent operations. Test + and validate policies in `LOG_ONLY` mode before enabling enforcement + to avoid unintended denials or adversely affecting production traffic. + """ + +class GatewayPolicyEngineMode(UnknownEnumMixin, StrEnum): + LOG_ONLY = "LOG_ONLY" + ENFORCE = "ENFORCE" + +@dataclass +class GatewayProtocolConfigurationMcp(_SerdeShape): + """ + The configuration for the Model Context Protocol (MCP). This protocol + enables communication between Amazon Bedrock Agent and external tools. + """ + + value: MCPGatewayConfiguration + +@dataclass +class GatewayProtocolConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +GatewayProtocolConfiguration = Union[ + GatewayProtocolConfigurationMcp | GatewayProtocolConfigurationUnknown +] +""" +The configuration for a gateway protocol. This structure defines how the +gateway communicates with external services. +""" + +class _GatewayProtocolConfigurationDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> GatewayProtocolConfiguration: ... + +class GatewayProtocolType(UnknownEnumMixin, StrEnum): + MCP = "MCP" + +@dataclass(kw_only=True) +class GatewayRateLimitDetail(_SerdeShape): + """ + Contains detailed information about a gateway rate limit, including its + configuration and current status. + """ + + rate_limit_id: str + """The unique identifier of the rate limit.""" + gateway_identifier: str + """The unique identifier of the gateway.""" + description: str | None = ... + """The human-readable description of the rate limit.""" + dimension_keys: list[str] + """ + The ordered list of dimension key names that define the scope of this + rate limit. + """ + entries: list[LimitEntry] + """ + The list of rule entries that map dimension values to rate + configurations. + """ + status: str + """The current status of the rate limit.""" + created_at: datetime + """The timestamp when the rate limit was created.""" + updated_at: datetime + """The timestamp when the rate limit was last updated.""" + +class GatewayRateLimitStatus(UnknownEnumMixin, StrEnum): + """The status of a gateway limit.""" + + CREATING = "CREATING" + ACTIVE = "ACTIVE" + UPDATING = "UPDATING" + DELETING = "DELETING" + +@dataclass(kw_only=True) +class GatewayRuleDetail(_SerdeShape): + """Detailed information about a gateway rule.""" + + rule_id: str + """The unique identifier of the gateway rule.""" + gateway_arn: str + """The Amazon Resource Name (ARN) of the gateway that the rule belongs to.""" + priority: int + """ + The priority of the rule. Rules are evaluated in order of priority, with + lower numbers evaluated first. + """ + conditions: list[Condition] | None = ... + """The conditions that must be met for the rule to apply.""" + actions: list[Action] + """The actions to take when the rule conditions are met.""" + description: str | None = ... + """The description of the gateway rule.""" + created_at: datetime + """The timestamp when the rule was created.""" + status: str + """The current status of the rule.""" + system: SystemManagedBlock | None = ... + """System-managed metadata for rules created by automated processes.""" + updated_at: datetime | None = ... + """The timestamp when the rule was last updated.""" + +class GatewayRuleStatus(UnknownEnumMixin, StrEnum): + CREATING = "CREATING" + ACTIVE = "ACTIVE" + UPDATING = "UPDATING" + DELETING = "DELETING" + +class GatewayStatus(UnknownEnumMixin, StrEnum): + CREATING = "CREATING" + UPDATING = "UPDATING" + UPDATE_UNSUCCESSFUL = "UPDATE_UNSUCCESSFUL" + DELETING = "DELETING" + READY = "READY" + FAILED = "FAILED" + +@dataclass(kw_only=True) +class GatewaySummary(_SerdeShape): + """Contains summary information about a gateway.""" + + gateway_id: str + """The unique identifier of the gateway.""" + name: str + """The name of the gateway.""" + status: str + """The current status of the gateway.""" + description: str | None = ... + """The description of the gateway.""" + created_at: datetime + """The timestamp when the gateway was created.""" + updated_at: datetime + """The timestamp when the gateway was last updated.""" + authorizer_type: str + """The type of authorizer used by the gateway.""" + protocol_type: str = ... + """The protocol type used by the gateway.""" + +@dataclass(kw_only=True) +class GatewayTarget(_SerdeShape): + """The gateway target.""" + + gateway_arn: str + """The Amazon Resource Name (ARN) of the gateway target.""" + target_id: str + """The target ID.""" + created_at: datetime + """The date and time at which the target was created.""" + updated_at: datetime + """The date and time at which the target was updated.""" + status: str + """The status of the gateway target.""" + status_reasons: list[str] | None = ... + """The status reasons for the target status.""" + name: str + """The name of the gateway target.""" + description: str | None = ... + """The description for the gateway target.""" + target_configuration: TargetConfiguration + """ + The configuration for a gateway target. This structure defines how the + gateway connects to and interacts with the target endpoint. + """ + credential_provider_configurations: list[CredentialProviderConfiguration] + """The provider configurations.""" + last_synchronized_at: datetime | None = ... + """The last synchronization time.""" + metadata_configuration: MetadataConfiguration | None = ... + """ + The metadata configuration for HTTP header and query parameter + propagation to and from this gateway target. + """ + private_endpoint: PrivateEndpoint | None = ... + """ + The private endpoint configuration for a gateway target. Defines how the + gateway connects to private resources in your VPC. + """ + private_endpoint_managed_resources: list[ManagedResourceDetails] | None = ... + """ + A list of managed resources created by the gateway for private endpoint + connectivity. These resources are created in your account when you use a + managed VPC Lattice resource configuration. + """ + authorization_data: AuthorizationData | None = ... + """ + OAuth2 authorization data for the gateway target. This data is returned + when a target is configured with a credential provider with + authorization code grant type and requires user federation. + """ + protocol_type: str | None = ... + """The protocol type of the gateway target.""" + certificate_configurations: list[CertificateConfiguration] | None = ... + """ + The private certificate authority (CA) configurations for the gateway + target. + """ + +@dataclass(kw_only=True) +class GetAgentRuntimeEndpointInput(_SerdeShape): + """Dataclass for GetAgentRuntimeEndpointInput structure.""" + + agent_runtime_id: str | None = ... + """ + The unique identifier of the AgentCore Runtime associated with the + endpoint. + """ + endpoint_name: str | None = ... + """The name of the AgentCore Runtime endpoint to retrieve.""" + +@dataclass(kw_only=True) +class GetAgentRuntimeEndpointOutput(_SerdeShape): + """Dataclass for GetAgentRuntimeEndpointOutput structure.""" + + live_version: str | None = ... + """The currently deployed version of the AgentCore Runtime on the endpoint.""" + target_version: str | None = ... + """The target version of the AgentCore Runtime for the endpoint.""" + agent_runtime_endpoint_arn: str + """The Amazon Resource Name (ARN) of the AgentCore Runtime endpoint.""" + agent_runtime_arn: str + """The Amazon Resource Name (ARN) of the AgentCore Runtime.""" + description: str | None = ... + """The description of the AgentCore Runtime endpoint.""" + status: str + """The current status of the AgentCore Runtime endpoint.""" + created_at: datetime + """The timestamp when the AgentCore Runtime endpoint was created.""" + last_updated_at: datetime + """The timestamp when the AgentCore Runtime endpoint was last updated.""" + failure_reason: str | None = ... + """ + The reason for failure if the AgentCore Runtime endpoint is in a failed + state. + """ + name: str + """The name of the AgentCore Runtime endpoint.""" + id: str + """The unique identifier of the AgentCore Runtime endpoint.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetAgentRuntimeInput(_SerdeShape): + """Dataclass for GetAgentRuntimeInput structure.""" + + agent_runtime_id: str | None = ... + """The unique identifier of the AgentCore Runtime to retrieve.""" + agent_runtime_version: str | None = ... + """The version of the AgentCore Runtime to retrieve.""" + +@dataclass(kw_only=True) +class GetAgentRuntimeOutput(_SerdeShape): + """Dataclass for GetAgentRuntimeOutput structure.""" + + agent_runtime_arn: str + """The Amazon Resource Name (ARN) of the AgentCore Runtime.""" + agent_runtime_name: str + """The name of the AgentCore Runtime.""" + agent_runtime_id: str + """The unique identifier of the AgentCore Runtime.""" + agent_runtime_version: str + """The version of the AgentCore Runtime.""" + created_at: datetime + """The timestamp when the AgentCore Runtime was created.""" + last_updated_at: datetime + """The timestamp when the AgentCore Runtime was last updated.""" + role_arn: str + """The IAM role ARN that provides permissions for the AgentCore Runtime.""" + network_configuration: NetworkConfiguration | None = ... + """The network configuration for the AgentCore Runtime.""" + status: str + """The current status of the AgentCore Runtime.""" + lifecycle_configuration: LifecycleConfiguration + """The life cycle configuration for the AgentCore Runtime.""" + failure_reason: str | None = ... + """The reason for failure if the AgentCore Runtime is in a failed state.""" + description: str | None = ... + """The description of the AgentCore Runtime.""" + workload_identity_details: WorkloadIdentityDetails | None = ... + """The workload identity details for the AgentCore Runtime.""" + agent_runtime_artifact: AgentRuntimeArtifact | None = ... + """The artifact of the AgentCore Runtime.""" + protocol_configuration: ProtocolConfiguration | None = ... + """ + The protocol configuration for an agent runtime. This structure defines + how the agent runtime communicates with clients. + """ + environment_variables: dict[str, str] | None = ... + """Environment variables set in the AgentCore Runtime environment.""" + authorizer_configuration: AuthorizerConfiguration | None = ... + """The authorizer configuration for the AgentCore Runtime.""" + request_header_configuration: RequestHeaderConfiguration | None = ... + """ + Configuration for HTTP request headers that will be passed through to + the runtime. + """ + metadata_configuration: RuntimeMetadataConfiguration | None = ... + """ + Configuration for microVM Metadata Service (MMDS) settings for the + AgentCore Runtime. + """ + filesystem_configurations: list[FilesystemConfiguration] | None = ... + """The filesystem configurations mounted into the AgentCore Runtime.""" + capacity_provider_configuration: CapacityProviderConfiguration | None = ... + """The capacity provider configuration for the AgentCore Runtime.""" + platform_version: str | None = ... + """The version of the runtime platform used by the AgentCore Runtime.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetApiKeyCredentialProviderInput(_SerdeShape): + """Dataclass for GetApiKeyCredentialProviderInput structure.""" + + name: str | None = ... + """The name of the API key credential provider to retrieve.""" + +@dataclass(kw_only=True) +class GetApiKeyCredentialProviderOutput(_SerdeShape): + """Dataclass for GetApiKeyCredentialProviderOutput structure.""" + + api_key_secret_arn: Secret + """ + The Amazon Resource Name (ARN) of the API key secret in Amazon Web + Services Secrets Manager. + """ + api_key_secret_json_key: str | None = ... + """ + The JSON key used to extract the API key value from the Amazon Web + Services Secrets Manager secret. + """ + api_key_secret_source: str | None = ... + """ + The source type of the API key secret. Either `MANAGED` if the secret is + managed by the service, or `EXTERNAL` if managed by the user in Amazon + Web Services Secrets Manager. + """ + name: str + """The name of the API key credential provider.""" + credential_provider_arn: str + """The Amazon Resource Name (ARN) of the API key credential provider.""" + created_time: datetime + """The timestamp when the API key credential provider was created.""" + last_updated_time: datetime + """The timestamp when the API key credential provider was last updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetBrowserInput(_SerdeShape): + """Dataclass for GetBrowserInput structure.""" + + browser_id: str | None = ... + """The unique identifier of the browser to retrieve.""" + +@dataclass(kw_only=True) +class GetBrowserOutput(_SerdeShape): + """Dataclass for GetBrowserOutput structure.""" + + browser_id: str + """The unique identifier of the browser.""" + browser_arn: str + """The Amazon Resource Name (ARN) of the browser.""" + name: str + """The name of the browser.""" + description: str | None = ... + """The description of the browser.""" + execution_role_arn: str | None = ... + """The IAM role ARN that provides permissions for the browser.""" + network_configuration: BrowserNetworkConfiguration + """ + The network configuration for a browser. This structure defines how the + browser connects to the network. + """ + recording: RecordingConfig | None = ... + """ + The recording configuration for a browser. This structure defines how + browser sessions are recorded. + """ + browser_signing: BrowserSigningConfigOutput | None = ... + """ + The browser signing configuration that shows whether cryptographic agent + identification is enabled for web bot authentication. + """ + enterprise_policies: list[BrowserEnterprisePolicy] | None = ... + """The list of enterprise policy files configured for the browser.""" + certificates: list[Certificate] | None = ... + """The list of certificates configured for the browser.""" + filesystem_configurations: list[ToolsFileSystemConfiguration] | None = ... + """ + The file system configurations mounted into the browser. Each entry + describes an access point and its mount path. + """ + status: str + """The current status of the browser.""" + failure_reason: str | None = ... + """The reason for failure if the browser is in a failed state.""" + created_at: datetime + """The timestamp when the browser was created.""" + last_updated_at: datetime + """The timestamp when the browser was last updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetBrowserProfileInput(_SerdeShape): + """Dataclass for GetBrowserProfileInput structure.""" + + profile_id: str | None = ... + """The unique identifier of the browser profile to retrieve.""" + +@dataclass(kw_only=True) +class GetBrowserProfileOutput(_SerdeShape): + """Dataclass for GetBrowserProfileOutput structure.""" + + profile_id: str + """The unique identifier of the browser profile.""" + profile_arn: str + """The Amazon Resource Name (ARN) of the browser profile.""" + name: str + """The name of the browser profile.""" + description: str | None = ... + """The description of the browser profile.""" + status: str + """The current status of the browser profile.""" + created_at: datetime + """The timestamp when the browser profile was created.""" + last_updated_at: datetime + """The timestamp when the browser profile was last updated.""" + last_saved_at: datetime | None = ... + """The timestamp when browser session data was last saved to this profile.""" + last_saved_browser_session_id: str | None = ... + """ + The identifier of the browser session from which data was last saved to + this profile. + """ + last_saved_browser_id: str | None = ... + """ + The identifier of the browser from which data was last saved to this + profile. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetCapacityProviderInput(_SerdeShape): + """Dataclass for GetCapacityProviderInput structure.""" + + capacity_provider_id: str | None = ... + """The unique identifier of the capacity provider.""" + +@dataclass(kw_only=True) +class GetCapacityProviderOutput(_SerdeShape): + """Dataclass for GetCapacityProviderOutput structure.""" + + capacity_provider_id: str + """The unique identifier of the capacity provider.""" + capacity_provider_arn: str + """The Amazon Resource Name (ARN) of the capacity provider.""" + name: str + """The name of the capacity provider.""" + status: str + """ + The current status of the capacity provider. For possible values, see + `CapacityProviderStatus`. + """ + description: str | None = ... + """The description of the capacity provider, if one was provided.""" + status_code: str | None = ... + """ + A reason code for a capacity provider that is not in the `READY` state. + Use this code for programmatic error handling. + """ + status_reason: str | None = ... + """ + A human-readable message that describes why the capacity provider is not + in the `READY` state. Because these messages can change, use + `statusCode` for programmatic error handling. + """ + permissions_configuration: PermissionsConfiguration + """The permissions configuration for the capacity provider.""" + compute_configuration: ComputeConfiguration + """The compute configuration for the capacity provider.""" + created_at: datetime + """The timestamp when the capacity provider was created.""" + last_updated_at: datetime + """The timestamp when the capacity provider was last updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetCodeInterpreterInput(_SerdeShape): + """Dataclass for GetCodeInterpreterInput structure.""" + + code_interpreter_id: str | None = ... + """The unique identifier of the code interpreter to retrieve.""" + +@dataclass(kw_only=True) +class GetCodeInterpreterOutput(_SerdeShape): + """Dataclass for GetCodeInterpreterOutput structure.""" + + code_interpreter_id: str + """The unique identifier of the code interpreter.""" + code_interpreter_arn: str + """The Amazon Resource Name (ARN) of the code interpreter.""" + name: str + """The name of the code interpreter.""" + description: str | None = ... + """The description of the code interpreter.""" + execution_role_arn: str | None = ... + """The IAM role ARN that provides permissions for the code interpreter.""" + network_configuration: CodeInterpreterNetworkConfiguration + """ + The network configuration for a code interpreter. This structure defines + how the code interpreter connects to the network. + """ + status: str + """The current status of the code interpreter.""" + certificates: list[Certificate] | None = ... + """The list of certificates configured for the code interpreter.""" + filesystem_configurations: list[ToolsFileSystemConfiguration] | None = ... + """ + The file system configurations mounted into the code interpreter. Each + entry describes an access point and its mount path. + """ + failure_reason: str | None = ... + """The reason for failure if the code interpreter is in a failed state.""" + created_at: datetime + """The timestamp when the code interpreter was created.""" + last_updated_at: datetime + """The timestamp when the code interpreter was last updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetConfigurationBundleInput(_SerdeShape): + """Dataclass for GetConfigurationBundleInput structure.""" + + bundle_id: str | None = ... + """The unique identifier of the configuration bundle to retrieve.""" + branch_name: str | None = ... + """ + The branch name to get the latest version from. If not specified, + returns the latest version on the mainline branch. + """ + +@dataclass(kw_only=True) +class GetConfigurationBundleOutput(_SerdeShape): + """Dataclass for GetConfigurationBundleOutput structure.""" + + bundle_arn: str + """The Amazon Resource Name (ARN) of the configuration bundle.""" + bundle_id: str + """The unique identifier of the configuration bundle.""" + bundle_name: str + """The name of the configuration bundle.""" + description: str | None = ... + """The description of the configuration bundle.""" + version_id: str + """The version identifier of this configuration bundle.""" + components: dict[str, ComponentConfiguration] + """A map of component identifiers to their configurations for this version.""" + lineage_metadata: VersionLineageMetadata | None = ... + """ + The version lineage metadata, including parent versions, branch name, + and creation source. + """ + created_at: datetime + """The timestamp when the configuration bundle was created.""" + updated_at: datetime + """The timestamp when the configuration bundle was last updated.""" + kms_key_arn: str | None = ... + """ + KMS key ARN used to encrypt component configurations, if CMK was + provided. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetConfigurationBundleVersionInput(_SerdeShape): + """Dataclass for GetConfigurationBundleVersionInput structure.""" + + bundle_id: str | None = ... + """The unique identifier of the configuration bundle.""" + version_id: str | None = ... + """The version identifier of the configuration bundle version to retrieve.""" + +@dataclass(kw_only=True) +class GetConfigurationBundleVersionOutput(_SerdeShape): + """Dataclass for GetConfigurationBundleVersionOutput structure.""" + + bundle_arn: str + """The Amazon Resource Name (ARN) of the configuration bundle.""" + bundle_id: str + """The unique identifier of the configuration bundle.""" + bundle_name: str + """The name of the configuration bundle.""" + description: str | None = ... + """The description of the configuration bundle.""" + version_id: str + """The version identifier of this configuration bundle version.""" + components: dict[str, ComponentConfiguration] + """A map of component identifiers to their configurations for this version.""" + lineage_metadata: VersionLineageMetadata | None = ... + """ + The version lineage metadata, including parent versions, branch name, + and creation source. + """ + created_at: datetime + """The timestamp when the configuration bundle was created.""" + version_created_at: datetime + """The timestamp when this specific version was created.""" + kms_key_arn: str | None = ... + """ + KMS key ARN used to encrypt component configurations, if CMK was + provided. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetConsentPortalInput(_SerdeShape): + """Dataclass for GetConsentPortalInput structure.""" + + consent_portal_identifier: str | None = ... + """ + The identifier of the consent portal. You can specify either the consent + portal ID or its Amazon Resource Name (ARN). + """ + +@dataclass(kw_only=True) +class GetConsentPortalOutput(_SerdeShape): + """Dataclass for GetConsentPortalOutput structure.""" + + sources: list[ConsentPortalSource] + """The resources served by the consent portal.""" + consent_portal_arn: str + """The Amazon Resource Name (ARN) of the consent portal.""" + consent_portal_id: str + """The unique identifier of the consent portal.""" + created_at: datetime + """The timestamp for when the consent portal was created.""" + description: str | None = ... + """The description of the consent portal.""" + execution_role_arn: str + """ + The Amazon Resource Name (ARN) of the IAM role that the consent portal + assumes to access the resources defined in its sources. + """ + idp_config: ConsentPortalIdpConfig + """ + The identity provider configuration that the consent portal uses to + authenticate end users. + """ + name: str + """The name of the consent portal.""" + portal_url: str | None = ... + """The URL used to access the consent portal.""" + status: str + """The current status of the consent portal.""" + status_reason: str | None = ... + """ + A message that provides additional information about the current status + of the consent portal. + """ + updated_at: datetime + """The timestamp for when the consent portal was last updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetDatasetInput(_SerdeShape): + """Dataclass for GetDatasetInput structure.""" + + dataset_id: str | None = ... + """The unique identifier of the dataset to retrieve.""" + dataset_version: str | None = ... + """ + Version to retrieve: \"DRAFT\" or a version number. Defaults to DRAFT if + absent. + """ + +@dataclass(kw_only=True) +class GetDatasetOutput(_SerdeShape): + """Dataclass for GetDatasetOutput structure.""" + + dataset_arn: str + """The Amazon Resource Name (ARN) of the dataset.""" + dataset_id: str + """The unique identifier of the dataset.""" + dataset_version: str + """ + The resolved version: \"DRAFT\" (default) or the requested version + number. + """ + dataset_name: str + """The name of the dataset.""" + description: str | None = ... + """The description of the dataset.""" + status: str + """The current status of the dataset.""" + draft_status: str | None = ... + """ + Publish synchronization state. Only authoritative when status is ACTIVE. + MODIFIED indicates DRAFT has unpublished changes. UNMODIFIED indicates + DRAFT matches the latest published version. + """ + failure_reason: str | None = ... + """ + Populated when status is CREATE_FAILED, UPDATE_FAILED, or DELETE_FAILED. + Describes the reason for the failure. + """ + schema_type: str + """The schema type declared at create time. Immutable after creation.""" + kms_key_arn: str | None = ... + """ + KMS key ARN used for server-side encryption on service Amazon S3 writes, + if configured. + """ + example_count: int + """The number of examples in the DRAFT.""" + download_url: str | None = ... + """ + Presigned Amazon S3 URL to download the consolidated dataset file for + the resolved version. Expires after 5 minutes. Omitted if the file does + not yet exist. + """ + download_url_expires_at: datetime | None = ... + """Expiry timestamp for the download URL.""" + created_at: datetime + """The timestamp when the dataset was created.""" + updated_at: datetime + """The timestamp when the dataset was last updated.""" + tags: dict[str, str] | None = ... + """The tags associated with the dataset.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetEvaluatorInput(_SerdeShape): + """Dataclass for GetEvaluatorInput structure.""" + + evaluator_id: str | None = ... + """ + The unique identifier of the evaluator to retrieve. Can be a built-in + evaluator ID (e.g., Builtin.Helpfulness) or a custom evaluator ID. + """ + included_data: str | None = ... + """ + Controls which data is returned in the response. `ALL_DATA` (default) + returns the full evaluator including decrypted instructions and rating + scale. For evaluators encrypted with a customer managed KMS key, this + requires `kms:Decrypt` permission on the key. `METADATA_ONLY` returns + evaluator metadata and model configuration without instructions or + rating scale, and does not require any KMS permissions. + """ + +@dataclass(kw_only=True) +class GetEvaluatorOutput(_SerdeShape): + """Dataclass for GetEvaluatorOutput structure.""" + + evaluator_arn: str + """The Amazon Resource Name (ARN) of the evaluator.""" + evaluator_id: str + """The unique identifier of the evaluator.""" + evaluator_name: str + """The name of the evaluator.""" + description: str | None = ... + """The description of the evaluator.""" + evaluator_config: EvaluatorConfig + """ + The configuration of the evaluator, including LLM-as-a-Judge or + code-based settings. + """ + evaluator_type: str | None = ... + """ + The kind of evaluator resource. Valid values: + + - `Builtin` -- An Amazon Web Services-managed global evaluator. + + - `ThirdParty` -- An Amazon Web Services-managed global evaluator from a + third-party provider. + + - `Custom` -- A customer-created evaluator. + + - `CustomCode` -- A customer-created code-based evaluator. + + - `CustomDerived` -- A customer-created evaluator derived from an + existing base evaluator. + """ + provider: str | None = ... + """ + The source of the evaluator's logic: Amazon Web Services, a third-party + library, or you. + """ + level: str + """ + The evaluation level (`TOOL_CALL`, `TRACE`, or `SESSION`) that + determines the scope of evaluation. + """ + status: str + """The current status of the evaluator.""" + created_at: datetime + """The timestamp when the evaluator was created.""" + updated_at: datetime + """The timestamp when the evaluator was last updated.""" + locked_for_modification: bool | None = ... + """ + Whether the evaluator is locked for modification due to being referenced + by active online evaluation configurations. + """ + kms_key_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the customer managed KMS key used to + encrypt the evaluator's sensitive data. This field is only present for + evaluators encrypted with a customer managed key. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetGatewayInput(_SerdeShape): + """Dataclass for GetGatewayInput structure.""" + + gateway_identifier: str | None = ... + """The identifier of the gateway to retrieve.""" + +@dataclass(kw_only=True) +class GetGatewayOutput(_SerdeShape): + """Dataclass for GetGatewayOutput structure.""" + + gateway_arn: str + """The Amazon Resource Name (ARN) of the gateway.""" + gateway_id: str + """The unique identifier of the gateway.""" + gateway_url: str | None = ... + """An endpoint for invoking gateway.""" + created_at: datetime + """The timestamp when the gateway was created.""" + updated_at: datetime + """The timestamp when the gateway was last updated.""" + status: str + """The current status of the gateway.""" + status_reasons: list[str] | None = ... + """The reasons for the current status of the gateway.""" + name: str + """The name of the gateway.""" + description: str | None = ... + """The description of the gateway.""" + role_arn: str | None = ... + """The IAM role ARN that provides permissions for the gateway.""" + protocol_type: str = ... + """Protocol applied to a gateway.""" + protocol_configuration: GatewayProtocolConfiguration | None = ... + """ + The configuration for a gateway protocol. This structure defines how the + gateway communicates with external services. + """ + authorizer_type: str + """Authorizer type for the gateway.""" + authorizer_configuration: AuthorizerConfiguration | None = ... + """The authorizer configuration for the gateway.""" + kms_key_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the KMS key used to encrypt the + gateway. + """ + custom_transform_configuration: CustomTransformConfiguration | None = ... + """ + The custom transformation configuration for the gateway. This + configuration defines how the gateway transforms requests and responses. + """ + interceptor_configurations: list[GatewayInterceptorConfiguration] | None = ... + """The interceptors configured on the gateway.""" + policy_engine_configuration: GatewayPolicyEngineConfiguration | None = ... + """The policy engine configuration for the gateway.""" + workload_identity_details: WorkloadIdentityDetails | None = ... + """The workload identity details for the gateway.""" + exception_level: str | None = ... + """ + The level of detail in error messages returned when invoking the + gateway. + + - If the value is `DEBUG`, granular exception messages are returned to + help a user debug the gateway. + + - If the value is omitted, a generic error message is returned to the + end user. + """ + web_acl_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the Amazon Web Services WAF web ACL + associated with the gateway. + """ + waf_configuration: WafConfiguration | None = ... + """The Amazon Web Services WAF configuration for the gateway.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetGatewayRateLimitInput(_SerdeShape): + """Dataclass for GetGatewayRateLimitInput structure.""" + + gateway_identifier: str | None = ... + """The unique identifier of the gateway.""" + rate_limit_id: str | None = ... + """The unique identifier of the rate limit to retrieve.""" + +@dataclass(kw_only=True) +class GetGatewayRateLimitOutput(_SerdeShape): + """Shared fields for `GatewayRateLimit` responses.""" + + rate_limit_id: str + """The unique identifier of the rate limit.""" + gateway_identifier: str + """The unique identifier of the gateway.""" + description: str | None = ... + """The human-readable description of the rate limit.""" + dimension_keys: list[str] + """ + The ordered list of dimension key names that define the scope of this + rate limit. + """ + entries: list[LimitEntry] + """ + The list of rule entries that map dimension values to rate + configurations. + """ + status: str + """The current status of the rate limit.""" + created_at: datetime + """The timestamp when the rate limit was created.""" + updated_at: datetime + """The timestamp when the rate limit was last updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetGatewayRuleInput(_SerdeShape): + """Dataclass for GetGatewayRuleInput structure.""" + + gateway_identifier: str | None = ... + """The identifier of the gateway containing the rule.""" + rule_id: str | None = ... + """The unique identifier of the rule to retrieve.""" + +@dataclass(kw_only=True) +class GetGatewayRuleOutput(_SerdeShape): + """ + Create response excludes updatedAt (redundant on create). Get/Update + responses include it via their own output structures. + """ + + rule_id: str + """The unique identifier of the gateway rule.""" + gateway_arn: str + """The Amazon Resource Name (ARN) of the gateway that the rule belongs to.""" + priority: int + """ + The priority of the rule. Rules are evaluated in order of priority, with + lower numbers evaluated first. + """ + conditions: list[Condition] | None = ... + """The conditions that must be met for the rule to apply.""" + actions: list[Action] + """The actions to take when the rule conditions are met.""" + description: str | None = ... + """The description of the gateway rule.""" + created_at: datetime + """The timestamp when the rule was created.""" + status: str + """The current status of the rule.""" + system: SystemManagedBlock | None = ... + """System-managed metadata for rules created by automated processes.""" + updated_at: datetime | None = ... + """The timestamp when the rule was last updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetGatewayTargetInput(_SerdeShape): + """Dataclass for GetGatewayTargetInput structure.""" + + gateway_identifier: str | None = ... + """The identifier of the gateway that contains the target.""" + target_id: str | None = ... + """The unique identifier of the target to retrieve.""" + +@dataclass(kw_only=True) +class GetGatewayTargetOutput(_SerdeShape): + """Dataclass for GetGatewayTargetOutput structure.""" + + gateway_arn: str + """The Amazon Resource Name (ARN) of the gateway.""" + target_id: str + """The unique identifier of the gateway target.""" + created_at: datetime + """The timestamp when the gateway target was created.""" + updated_at: datetime + """The timestamp when the gateway target was last updated.""" + status: str + """The current status of the gateway target.""" + status_reasons: list[str] | None = ... + """The reasons for the current status of the gateway target.""" + name: str + """The name of the gateway target.""" + description: str | None = ... + """The description of the gateway target.""" + target_configuration: TargetConfiguration + """ + The configuration for a gateway target. This structure defines how the + gateway connects to and interacts with the target endpoint. + """ + credential_provider_configurations: list[CredentialProviderConfiguration] + """The credential provider configurations for the gateway target.""" + last_synchronized_at: datetime | None = ... + """The last synchronization of the target.""" + metadata_configuration: MetadataConfiguration | None = ... + """ + The metadata configuration for HTTP header and query parameter + propagation for the retrieved gateway target. + """ + private_endpoint: PrivateEndpoint | None = ... + """The private endpoint configuration for the gateway target.""" + private_endpoint_managed_resources: list[ManagedResourceDetails] | None = ... + """ + The managed resources created by the gateway for private endpoint + connectivity. + """ + authorization_data: AuthorizationData | None = ... + """ + OAuth2 authorization data for the gateway target. This data is returned + when a target is configured with a credential provider with + authorization code grant type and requires user federation. + """ + protocol_type: str | None = ... + """The protocol type of the gateway target.""" + certificate_configurations: list[CertificateConfiguration] | None = ... + """ + The private certificate authority (CA) configurations for the gateway + target. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetHarnessEndpointInput(_SerdeShape): + """Dataclass for GetHarnessEndpointInput structure.""" + + harness_id: str | None = ... + """The ID of the harness that the endpoint belongs to.""" + endpoint_name: str | None = ... + """The name of the endpoint to retrieve.""" + +@dataclass(kw_only=True) +class GetHarnessEndpointOutput(_SerdeShape): + """Dataclass for GetHarnessEndpointOutput structure.""" + + endpoint: HarnessEndpoint + """The endpoint resource.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetHarnessInput(_SerdeShape): + """Dataclass for GetHarnessInput structure.""" + + harness_id: str | None = ... + """The ID of the harness to retrieve.""" + harness_version: str | None = ... + """ + Specific version of the harness to retrieve. If omitted, returns the + current Harness configuration, including its status. + """ + +@dataclass(kw_only=True) +class GetHarnessOutput(_SerdeShape): + """Dataclass for GetHarnessOutput structure.""" + + harness: Harness + """The harness resource.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetMemoryInput(_SerdeShape): + """Dataclass for GetMemoryInput structure.""" + + memory_id: str | None = ... + """The unique identifier of the memory to retrieve.""" + view: str = ... + """The level of detail to return for the memory.""" + +@dataclass(kw_only=True) +class GetMemoryOutput(_SerdeShape): + """Dataclass for GetMemoryOutput structure.""" + + memory: Memory + """The retrieved AgentCore Memory resource details.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetOauth2CredentialProviderInput(_SerdeShape): + """Dataclass for GetOauth2CredentialProviderInput structure.""" + + name: str | None = ... + """The name of the OAuth2 credential provider to retrieve.""" + +@dataclass(kw_only=True) +class GetOauth2CredentialProviderOutput(_SerdeShape): + """Dataclass for GetOauth2CredentialProviderOutput structure.""" + + client_secret_arn: Secret + """ + The Amazon Resource Name (ARN) of the client secret in Amazon Web + Services Secrets Manager. + """ + client_secret_json_key: str | None = ... + """ + The JSON key used to extract the client secret value from the Amazon Web + Services Secrets Manager secret. + """ + client_secret_source: str | None = ... + """ + The source type of the client secret. Either `MANAGED` if the secret is + managed by the service, or `EXTERNAL` if managed by the user in Amazon + Web Services Secrets Manager. + """ + name: str + """The name of the OAuth2 credential provider.""" + credential_provider_arn: str + """ARN of the credential provider requested.""" + credential_provider_vendor: str + """The vendor of the OAuth2 credential provider.""" + callback_url: str | None = ... + """ + Callback URL to register on the OAuth2 credential provider as an allowed + callback URL. This URL is where the OAuth2 authorization server + redirects users after they complete the authorization flow. + """ + oauth2_provider_config_output: Oauth2ProviderConfigOutput + """The configuration output for the OAuth2 provider.""" + created_time: datetime + """The timestamp when the OAuth2 credential provider was created.""" + last_updated_time: datetime + """The timestamp when the OAuth2 credential provider was last updated.""" + status: str | None = ... + """The current status of the OAuth2 credential provider.""" + failure_reason: str | None = ... + """ + The reason for failure if the OAuth2 credential provider is in a failed + state. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetOnlineEvaluationConfigInput(_SerdeShape): + """Dataclass for GetOnlineEvaluationConfigInput structure.""" + + online_evaluation_config_id: str | None = ... + """ + The unique identifier of the online evaluation configuration to + retrieve. + """ + +@dataclass(kw_only=True) +class GetOnlineEvaluationConfigOutput(_SerdeShape): + """Dataclass for GetOnlineEvaluationConfigOutput structure.""" + + online_evaluation_config_arn: str + """The Amazon Resource Name (ARN) of the online evaluation configuration.""" + online_evaluation_config_id: str + """The unique identifier of the online evaluation configuration.""" + online_evaluation_config_name: str + """The name of the online evaluation configuration.""" + description: str | None = ... + """The description of the online evaluation configuration.""" + rule: Rule + """ + The evaluation rule containing sampling configuration, filters, and + session settings. + """ + data_source_config: DataSourceConfig + """ + The data source configuration specifying CloudWatch log groups and + service names to monitor. + """ + evaluators: list[EvaluatorReference] = ... + """The list of evaluators applied during online evaluation.""" + insights: list[Insight] | None = ... + """The list of insight types configured for this evaluation.""" + clustering_config: ClusteringConfig | None = ... + """The clustering configuration for periodic batch evaluation.""" + output_config: OutputConfig | None = ... + """ + The output configuration specifying where evaluation results are + written. + """ + evaluation_execution_role_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the IAM role used for evaluation + execution. + """ + status: str + """The status of the online evaluation configuration.""" + execution_status: str + """ + The execution status indicating whether the online evaluation is + currently running. + """ + created_at: datetime + """The timestamp when the online evaluation configuration was created.""" + updated_at: datetime + """The timestamp when the online evaluation configuration was last updated.""" + failure_reason: str | None = ... + """ + The reason for failure if the online evaluation configuration execution + failed. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetPaymentConnectorInput(_SerdeShape): + """Dataclass for GetPaymentConnectorInput structure.""" + + payment_manager_id: str | None = ... + """The unique identifier of the parent payment manager.""" + payment_connector_id: str | None = ... + """The unique identifier of the payment connector to retrieve.""" + +@dataclass(kw_only=True) +class GetPaymentConnectorOutput(_SerdeShape): + """Dataclass for GetPaymentConnectorOutput structure.""" + + payment_connector_id: str + """The unique identifier of the payment connector.""" + name: str + """The name of the payment connector.""" + description: str | None = ... + """The description of the payment connector.""" + type: str + """ + The type of the payment connector, which determines the payment provider + integration. + """ + provision_mode: str | None = ... + """ + Specifies how the payment connector was provisioned. Payment connectors + that were created before this field was available return `MANUAL`. + + - `MANUAL` - You provided the credential provider configurations, so you + own the credentials. Rotate them with the payment provider, then call + `UpdatePaymentCredentialProvider`. + + - `QUICK_CREATE` - AgentCore provisioned the credential provider for + you, so the credentials are service-managed. You can rotate them with + `RotatePaymentConnectorCredentials`. + """ + credential_provider_configurations: list[CredentialsProviderConfiguration] + """The credential provider configurations for the payment connector.""" + created_at: datetime + """The timestamp when the payment connector was created.""" + last_updated_at: datetime + """The timestamp when the payment connector was last updated.""" + status: str + """ + The current status of the payment connector. Possible values include + `CREATING`, `READY`, `UPDATING`, `DELETING`, `CREATE_FAILED`, + `UPDATE_FAILED`, and `DELETE_FAILED`. + """ + authorization_url: str | None = ... + """ + The URL that the user must open to complete OAuth consent. This field is + only present when the payment connector status is + `PENDING_AUTHENTICATION`. + """ + credentials_updated_at: datetime | None = ... + """ + The timestamp when the payment connector's current service-managed + credentials took effect. It is first set when the credentials are + provisioned and is updated by each rotation. This field is present only + for payment connectors with a `provisionMode` of `QUICK_CREATE`. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetPaymentCredentialProviderInput(_SerdeShape): + """Dataclass for GetPaymentCredentialProviderInput structure.""" + + name: str | None = ... + """The name of the payment credential provider to retrieve.""" + +@dataclass(kw_only=True) +class GetPaymentCredentialProviderOutput(_SerdeShape): + """Dataclass for GetPaymentCredentialProviderOutput structure.""" + + name: str + """The name of the payment credential provider.""" + credential_provider_arn: str + """The Amazon Resource Name (ARN) of the payment credential provider.""" + credential_provider_vendor: str + """The vendor type for the payment credential provider.""" + provider_configuration_output: PaymentProviderConfigurationOutput + """ + Output configuration (contains secret ARNs, excludes actual secret + values). + """ + created_time: datetime + """The timestamp when the payment credential provider was created.""" + last_updated_time: datetime + """The timestamp when the payment credential provider was last updated.""" + tags: dict[str, str] | None = ... + """The tags associated with the payment credential provider.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetPaymentManagerInput(_SerdeShape): + """Dataclass for GetPaymentManagerInput structure.""" + + payment_manager_id: str | None = ... + """The unique identifier of the payment manager to retrieve.""" + +@dataclass(kw_only=True) +class GetPaymentManagerOutput(_SerdeShape): + """Dataclass for GetPaymentManagerOutput structure.""" + + payment_manager_arn: str + """The Amazon Resource Name (ARN) of the payment manager.""" + payment_manager_id: str + """The unique identifier of the payment manager.""" + name: str + """The name of the payment manager.""" + description: str | None = ... + """The description of the payment manager.""" + authorizer_type: str + """ + The type of authorizer used by the payment manager. + + - `CUSTOM_JWT` - Authorize with a bearer token. + + - `AWS_IAM` - Authorize with your Amazon Web Services IAM credentials. + """ + authorizer_configuration: AuthorizerConfiguration | None = ... + """ + Represents inbound authorization configuration options used to + authenticate incoming requests. + """ + role_arn: str + """ + The Amazon Resource Name (ARN) of the IAM role associated with the + payment manager. + """ + workload_identity_details: WorkloadIdentityDetails | None = ... + """The information about the workload identity.""" + created_at: datetime + """The timestamp when the payment manager was created.""" + last_updated_at: datetime + """The timestamp when the payment manager was last updated.""" + status: str + """ + The current status of the payment manager. Possible values include + `CREATING`, `READY`, `UPDATING`, `DELETING`, `CREATE_FAILED`, + `UPDATE_FAILED`, and `DELETE_FAILED`. + """ + tags: dict[str, str] | None = ... + """The tags associated with the payment manager.""" + kms_key_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the KMS key used to encrypt sensitive + payment manager data at rest, if configured. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetPolicyEngineInput(_SerdeShape): + """Dataclass for GetPolicyEngineInput structure.""" + + policy_engine_id: str | None = ... + """ + The unique identifier of the policy engine to be retrieved. This must be + a valid policy engine ID that exists within the account. + """ + +@dataclass(kw_only=True) +class GetPolicyEngineOutput(_SerdeShape): + """Dataclass for GetPolicyEngineOutput structure.""" + + policy_engine_id: str + """ + The unique identifier of the retrieved policy engine. This matches the + policy engine ID provided in the request and serves as the system + identifier. + """ + name: str + """ + The customer-assigned name of the policy engine. This is the + human-readable identifier that was specified when the policy engine was + created. + """ + created_at: datetime + """The timestamp when the policy engine was originally created.""" + updated_at: datetime + """ + The timestamp when the policy engine was last modified. This tracks the + most recent changes to the policy engine configuration. + """ + policy_engine_arn: str + """ + The Amazon Resource Name (ARN) of the policy engine. This globally + unique identifier can be used for cross-service references and IAM + policy statements. + """ + status: str + """The current status of the policy engine.""" + encryption_key_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the KMS key used to encrypt the policy + engine data. + """ + description: str | None = ... + """ + The human-readable description of the policy engine's purpose and + scope. This helps administrators understand the policy engine's role in + governance. + """ + status_reasons: list[str] + """ + Additional information about the policy engine status. This provides + details about any failures or the current state of the policy engine. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetPolicyEngineSummaryInput(_SerdeShape): + """Dataclass for GetPolicyEngineSummaryInput structure.""" + + policy_engine_id: str | None = ... + """ + The unique identifier of the policy engine to retrieve the summary for. + This must be a valid policy engine ID that exists within the account. + """ + +@dataclass(kw_only=True) +class GetPolicyEngineSummaryOutput(_SerdeShape): + """Dataclass for GetPolicyEngineSummaryOutput structure.""" + + policy_engine_id: str + """The unique identifier of the policy engine.""" + name: str + """The customer-assigned name of the policy engine.""" + created_at: datetime + """The timestamp when the policy engine was originally created.""" + updated_at: datetime + """The timestamp when the policy engine was last modified.""" + policy_engine_arn: str + """The Amazon Resource Name (ARN) of the policy engine.""" + status: str + """The current status of the policy engine.""" + encryption_key_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the KMS key used to encrypt the policy + engine data. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetPolicyGenerationInput(_SerdeShape): + """Dataclass for GetPolicyGenerationInput structure.""" + + policy_generation_id: str | None = ... + """ + The unique identifier of the policy generation request to be retrieved. + This must be a valid generation ID from a previous + [StartPolicyGeneration](https://docs.aws.amazon.com/bedrock-agentcore-control/latest/APIReference/API_StartPolicyGeneration.html) + call. + """ + policy_engine_id: str | None = ... + """ + The identifier of the policy engine associated with the policy + generation request. This provides the context for the generation + operation and schema validation. + """ + +@dataclass(kw_only=True) +class GetPolicyGenerationOutput(_SerdeShape): + """Dataclass for GetPolicyGenerationOutput structure.""" + + policy_engine_id: str + """ + The identifier of the policy engine associated with this policy + generation. This confirms the policy engine context for the generation + operation. + """ + policy_generation_id: str + """ + The unique identifier of the policy generation request. This matches the + generation ID provided in the request and serves as the tracking + identifier. + """ + name: str + """ + The customer-assigned name for the policy generation request. This helps + identify and track generation operations across multiple requests. + """ + policy_generation_arn: str + """ + The Amazon Resource Name (ARN) of the policy generation. This globally + unique identifier can be used for tracking, auditing, and cross-service + references. + """ + resource: Resource + """ + The resource information associated with the policy generation. This + provides context about the target resources for which the policies are + being generated. + """ + created_at: datetime + """ + The timestamp when the policy generation request was created. This is + used for tracking and auditing generation operations and their + lifecycle. + """ + updated_at: datetime + """ + The timestamp when the policy generation was last updated. This tracks + the progress of the generation process and any status changes. + """ + status: str + """ + The current status of the policy generation. This indicates whether the + generation is in progress, completed successfully, or failed during + processing. + """ + findings: str | None = ... + """ + The findings and results from the policy generation process. This + includes any issues, recommendations, validation results, or insights + from the generated policies. + """ + status_reasons: list[str] + """ + Additional information about the generation status. This provides + details about any failures, warnings, or the current state of the + generation process. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetPolicyGenerationSummaryInput(_SerdeShape): + """Dataclass for GetPolicyGenerationSummaryInput structure.""" + + policy_generation_id: str | None = ... + """ + The unique identifier of the policy generation request to retrieve the + summary for. + """ + policy_engine_id: str | None = ... + """ + The identifier of the policy engine associated with the policy + generation request. + """ + +@dataclass(kw_only=True) +class GetPolicyGenerationSummaryOutput(_SerdeShape): + """Dataclass for GetPolicyGenerationSummaryOutput structure.""" + + policy_engine_id: str + """ + The identifier of the policy engine associated with this policy + generation. + """ + policy_generation_id: str + """The unique identifier of the policy generation request.""" + name: str + """The customer-assigned name for the policy generation request.""" + policy_generation_arn: str + """The Amazon Resource Name (ARN) of the policy generation request.""" + resource: Resource + """The resource information associated with the policy generation.""" + created_at: datetime + """The timestamp when the policy generation request was created.""" + updated_at: datetime + """The timestamp when the policy generation was last updated.""" + status: str + """The current status of the policy generation request.""" + findings: str | None = ... + """The findings from the policy generation process, if available.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetPolicyInput(_SerdeShape): + """Dataclass for GetPolicyInput structure.""" + + policy_engine_id: str | None = ... + """ + The identifier of the policy engine that manages the policy to be + retrieved. + """ + policy_id: str | None = ... + """ + The unique identifier of the policy to be retrieved. This must be a + valid policy ID that exists within the specified policy engine. + """ + +@dataclass(kw_only=True) +class GetPolicyOutput(_SerdeShape): + """Dataclass for GetPolicyOutput structure.""" + + policy_id: str + """ + The unique identifier of the retrieved policy. This matches the policy + ID provided in the request and serves as the system identifier for the + policy. + """ + name: str + """ + The customer-assigned name of the policy. This is the human-readable + identifier that was specified when the policy was created. + """ + policy_engine_id: str + """ + The identifier of the policy engine that manages this policy. This + confirms the policy engine context for the retrieved policy. + """ + created_at: datetime + """The timestamp when the policy was originally created.""" + updated_at: datetime + """ + The timestamp when the policy was last modified. This tracks the most + recent changes to the policy configuration. + """ + policy_arn: str + """ + The Amazon Resource Name (ARN) of the policy. This globally unique + identifier can be used for cross-service references and IAM policy + statements. + """ + status: str + """The current status of the policy.""" + enforcement_mode: str = ... + """The current enforcement mode of the policy.""" + definition: PolicyDefinition + """ + The Cedar or Dogwood policy statement that defines the access control + rules. This contains the actual policy logic used for agent behavior + control and access decisions. + """ + description: str | None = ... + """ + The human-readable description of the policy's purpose and + functionality. This helps administrators understand and manage the + policy. + """ + status_reasons: list[str] + """ + Additional information about the policy status. This provides details + about any failures or the current state of the policy. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetPolicySummaryInput(_SerdeShape): + """Dataclass for GetPolicySummaryInput structure.""" + + policy_engine_id: str | None = ... + """ + The identifier of the policy engine that manages the policy to retrieve + the summary for. + """ + policy_id: str | None = ... + """ + The unique identifier of the policy to retrieve the summary for. This + must be a valid policy ID that exists within the specified policy + engine. + """ + +@dataclass(kw_only=True) +class GetPolicySummaryOutput(_SerdeShape): + """Dataclass for GetPolicySummaryOutput structure.""" + + policy_id: str + """The unique identifier of the policy.""" + name: str + """The customer-assigned name of the policy.""" + policy_engine_id: str + """The identifier of the policy engine that manages this policy.""" + created_at: datetime + """The timestamp when the policy was originally created.""" + updated_at: datetime + """The timestamp when the policy was last modified.""" + policy_arn: str + """The Amazon Resource Name (ARN) of the policy.""" + status: str + """The current status of the policy.""" + enforcement_mode: str = ... + """The current enforcement mode of the policy.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetRegistryInput(_SerdeShape): + """Dataclass for GetRegistryInput structure.""" + + registry_id: str | None = ... + """ + The identifier of the registry to retrieve. You can specify either the + Amazon Resource Name (ARN) or the ID of the registry. + """ + +@dataclass(kw_only=True) +class GetRegistryOutput(_SerdeShape): + """Dataclass for GetRegistryOutput structure.""" + + name: str + """The name of the registry.""" + description: str | None = ... + """The description of the registry.""" + registry_id: str + """The unique identifier of the registry.""" + registry_arn: str + """The Amazon Resource Name (ARN) of the registry.""" + authorizer_type: str | None = ... + """ + The type of authorizer used by the registry. This controls the + authorization method for the Search and Invoke APIs used by consumers. + + - `CUSTOM_JWT` - Authorize with a bearer token. + + - `AWS_IAM` - Authorize with your Amazon Web Services IAM credentials. + """ + authorizer_configuration: AuthorizerConfiguration | None = ... + """ + The authorizer configuration for the registry. For details, see the + `AuthorizerConfiguration` data type. + """ + approval_configuration: ApprovalConfiguration | None = ... + """ + The approval configuration for registry records. For details, see the + `ApprovalConfiguration` data type. + """ + status: str + """ + The current status of the registry. Possible values include `CREATING`, + `READY`, `UPDATING`, `CREATE_FAILED`, `UPDATE_FAILED`, `DELETING`, and + `DELETE_FAILED`. + """ + status_reason: str | None = ... + """ + The reason for the current status, typically set when the status is a + failure state. + """ + created_at: datetime + """The timestamp when the registry was created.""" + updated_at: datetime + """The timestamp when the registry was last updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetRegistryRecordInput(_SerdeShape): + """Dataclass for GetRegistryRecordInput structure.""" + + registry_id: str | None = ... + """ + The identifier of the registry containing the record. You can specify + either the Amazon Resource Name (ARN) or the ID of the registry. + """ + record_id: str | None = ... + """ + The identifier of the registry record to retrieve. You can specify + either the Amazon Resource Name (ARN) or the ID of the record. + """ + +@dataclass(kw_only=True) +class GetRegistryRecordOutput(_SerdeShape): + """Dataclass for GetRegistryRecordOutput structure.""" + + registry_arn: str + """The Amazon Resource Name (ARN) of the registry that contains the record.""" + record_arn: str + """The Amazon Resource Name (ARN) of the registry record.""" + record_id: str + """The unique identifier of the registry record.""" + name: str + """The name of the registry record.""" + description: str | None = ... + """The description of the registry record.""" + descriptor_type: str + """ + The descriptor type of the registry record. Possible values are `MCP`, + `A2A`, `CUSTOM`, and `AGENT_SKILLS`. + """ + descriptors: Descriptors + """ + The descriptor-type-specific configuration containing the resource + schema and metadata. For details, see the `Descriptors` data type. + """ + record_version: str | None = ... + """The version of the registry record.""" + status: str + """ + The current status of the registry record. Possible values include + `CREATING`, `DRAFT`, `APPROVED`, `PENDING_APPROVAL`, `REJECTED`, + `DEPRECATED`, `UPDATING`, `CREATE_FAILED`, and `UPDATE_FAILED`. A record + transitions from `CREATING` to `DRAFT`, then to `PENDING_APPROVAL` (via + `SubmitRegistryRecordForApproval`), and finally to `APPROVED` upon + approval. + """ + created_at: datetime + """The timestamp when the registry record was created.""" + updated_at: datetime + """The timestamp when the registry record was last updated.""" + status_reason: str | None = ... + """ + The reason for the current status, typically set when the status is a + failure state. + """ + synchronization_type: str | None = ... + """The type of synchronization used for this record.""" + synchronization_configuration: SynchronizationConfiguration | None = ... + """ + The configuration for synchronizing registry record metadata from an + external source. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetResourcePolicyInput(_SerdeShape): + """Dataclass for GetResourcePolicyInput structure.""" + + resource_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the resource for which to retrieve the + resource policy. + """ + +@dataclass(kw_only=True) +class GetResourcePolicyOutput(_SerdeShape): + """Dataclass for GetResourcePolicyOutput structure.""" + + policy: str | None = ... + """The resource policy associated with the specified resource.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetTokenVaultInput(_SerdeShape): + """Dataclass for GetTokenVaultInput structure.""" + + token_vault_id: str | None = ... + """The unique identifier of the token vault to retrieve.""" + +@dataclass(kw_only=True) +class GetTokenVaultOutput(_SerdeShape): + """Dataclass for GetTokenVaultOutput structure.""" + + token_vault_id: str + """The ID of the token vault.""" + kms_configuration: KmsConfiguration + """The KMS configuration for the token vault.""" + last_modified_date: datetime + """The timestamp when the token vault was last modified.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetWorkloadIdentityInput(_SerdeShape): + """Dataclass for GetWorkloadIdentityInput structure.""" + + name: str | None = ... + """The name of the workload identity to retrieve.""" + +@dataclass(kw_only=True) +class GetWorkloadIdentityOutput(_SerdeShape): + """Dataclass for GetWorkloadIdentityOutput structure.""" + + name: str + """The name of the workload identity.""" + workload_identity_arn: str + """The Amazon Resource Name (ARN) of the workload identity.""" + allowed_resource_oauth2_return_urls: list[str] | None = ... + """ + The list of allowed OAuth2 return URLs for resources associated with + this workload identity. + """ + created_time: datetime + """The timestamp when the workload identity was created.""" + last_updated_time: datetime + """The timestamp when the workload identity was last updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GithubOauth2ProviderConfigInput(_SerdeShape): + """Input configuration for a GitHub OAuth2 provider.""" + + client_id: str + """The client ID for the GitHub OAuth2 provider.""" + client_secret: str = ... + """The client secret for the GitHub OAuth2 provider.""" + client_secret_config: SecretReference | None = ... + """ + A reference to the Amazon Web Services Secrets Manager secret that + stores the client secret. This includes the secret ID and the JSON key + used to extract the client secret value from the secret. Required when + `clientSecretSource` is set to `EXTERNAL`. + """ + client_secret_source: str | None = ... + """ + The source type of the client secret. Use `MANAGED` if the secret is + managed by the service, or `EXTERNAL` if you manage the secret yourself + in Amazon Web Services Secrets Manager. + """ + +@dataclass(kw_only=True) +class GithubOauth2ProviderConfigOutput(_SerdeShape): + """Output configuration for a GitHub OAuth2 provider.""" + + oauth_discovery: Oauth2Discovery + """The OAuth2 discovery information for the GitHub provider.""" + client_id: str | None = ... + """The client ID for the GitHub OAuth2 provider.""" + +@dataclass(kw_only=True) +class GoogleOauth2ProviderConfigInput(_SerdeShape): + """Input configuration for a Google OAuth2 provider.""" + + client_id: str + """The client ID for the Google OAuth2 provider.""" + client_secret: str = ... + """The client secret for the Google OAuth2 provider.""" + client_secret_config: SecretReference | None = ... + """ + A reference to the Amazon Web Services Secrets Manager secret that + stores the client secret. This includes the secret ID and the JSON key + used to extract the client secret value from the secret. Required when + `clientSecretSource` is set to `EXTERNAL`. + """ + client_secret_source: str | None = ... + """ + The source type of the client secret. Use `MANAGED` if the secret is + managed by the service, or `EXTERNAL` if you manage the secret yourself + in Amazon Web Services Secrets Manager. + """ + +@dataclass(kw_only=True) +class GoogleOauth2ProviderConfigOutput(_SerdeShape): + """Output configuration for a Google OAuth2 provider.""" + + oauth_discovery: Oauth2Discovery + """The OAuth2 discovery information for the Google provider.""" + client_id: str | None = ... + """The client ID for the Google OAuth2 provider.""" + +@dataclass(kw_only=True) +class Harness(_SerdeShape): + """Representation of a harness.""" + + harness_id: str + """The ID of the harness.""" + harness_name: str + """The name of the harness.""" + arn: str + """The ARN of the harness.""" + status: str + """The status of the harness.""" + harness_version: str | None = ... + """ + The version of the harness. Incremented on every successful + UpdateHarness. + """ + execution_role_arn: str + """IAM role the harness assumes when running.""" + created_at: datetime + """The createdAt time of the harness.""" + updated_at: datetime + """The updatedAt time of the harness.""" + model: HarnessModelConfiguration + """The configuration of the default model used by the Harness.""" + system_prompt: list[HarnessSystemContentBlock] + """The system prompt of the harness.""" + tools: list[HarnessTool] + """The tools of the harness.""" + skills: list[HarnessSkill] + """The skills of the harness.""" + allowed_tools: list[str] + """The allowed tools of the harness. All tools are allowed by default.""" + truncation: HarnessTruncationConfiguration + """Configuration for truncating model context.""" + environment: HarnessEnvironmentProvider + """The compute environment on which the Harness runs.""" + environment_artifact: HarnessEnvironmentArtifact | None = ... + """ + The environment artifact (e.g., container) in which the Harness + operates. + """ + environment_variables: dict[str, str] | None = ... + """ + Environment variables exposed in the environment in which the harness + operates. + """ + authorizer_configuration: AuthorizerConfiguration | None = ... + """ + Represents inbound authorization configuration options used to + authenticate incoming requests. + """ + memory: HarnessMemoryConfiguration | None = ... + """AgentCore Memory instance configuration for short and long term memory.""" + hooks: list[HarnessHook] | None = ... + """The lifecycle hooks configured for the harness.""" + max_iterations: int | None = ... + """ + The maximum number of iterations in the agent loop allowed before + exiting per invocation. + """ + max_tokens: int | None = ... + """ + The maximum total number of output tokens the agent can generate across + all model calls within a single invocation. + """ + timeout_seconds: int | None = ... + """The maximum duration per invocation.""" + failure_reason: str | None = ... + """Reason why create or update operations fail.""" + +@dataclass(kw_only=True) +class HarnessAfterInvocationHook(_SerdeShape): + """The configuration for a hook that runs after an invocation completes.""" + + name: str + """The name of the hook.""" + target: HarnessHookTarget + """The target that receives the hook event.""" + +@dataclass(kw_only=True) +class HarnessAfterToolCallHook(_SerdeShape): + """The configuration for a hook that runs after a tool call completes.""" + + name: str + """The name of the hook.""" + target: HarnessHookTarget + """The target that receives the hook event.""" + +@dataclass(kw_only=True) +class HarnessAgentCoreBrowserConfig(_SerdeShape): + """Configuration for AgentCore Browser.""" + + browser_arn: str | None = ... + """If not populated, the built-in Browser ARN is used.""" + +@dataclass(kw_only=True) +class HarnessAgentCoreCodeInterpreterConfig(_SerdeShape): + """Configuration for AgentCore Code Interpreter.""" + + code_interpreter_arn: str | None = ... + """If not populated, the built-in Code Interpreter ARN is used.""" + +@dataclass(kw_only=True) +class HarnessAgentCoreGatewayConfig(_SerdeShape): + """Configuration for AgentCore Gateway.""" + + gateway_arn: str + """The ARN of the desired AgentCore Gateway.""" + outbound_auth: HarnessGatewayOutboundAuth | None = ... + """ + How harness authenticates to this Gateway. Defaults to AWS_IAM (SigV4) + if omitted. + """ + +@dataclass(kw_only=True) +class HarnessAgentCoreMemoryConfiguration(_SerdeShape): + """Configuration for AgentCore Memory integration.""" + + arn: str + """The ARN of the AgentCore Memory resource.""" + actor_id: str | None = ... + """The actor ID for memory operations.""" + messages_count: int | None = ... + """The number of messages to retrieve from memory.""" + retrieval_config: dict[str, HarnessAgentCoreMemoryRetrievalConfig] | None = ... + """ + The retrieval configuration for long-term memory, mapping namespace path + templates to retrieval settings. + """ + +@dataclass(kw_only=True) +class HarnessAgentCoreMemoryRetrievalConfig(_SerdeShape): + """Configuration for memory retrieval within a namespace.""" + + top_k: int | None = ... + """The maximum number of memory entries to retrieve.""" + relevance_score: float | None = ... + """The minimum relevance score for retrieved memories.""" + strategy_id: str | None = ... + """The ID of the retrieval strategy to use.""" + +@dataclass(kw_only=True) +class HarnessAgentCoreRuntimeEnvironment(_SerdeShape): + """The AgentCore Runtime environment for a harness.""" + + agent_runtime_arn: str + """The ARN of the underlying AgentCore Runtime.""" + agent_runtime_name: str + """The name of the underlying AgentCore Runtime.""" + agent_runtime_id: str + """The ID of the underlying AgentCore Runtime.""" + lifecycle_configuration: LifecycleConfiguration + """ + LifecycleConfiguration lets you manage the lifecycle of runtime sessions + and resources in AgentCore Runtime. This configuration helps optimize + resource utilization by automatically cleaning up idle sessions and + preventing long-running instances from consuming resources indefinitely. + """ + network_configuration: NetworkConfiguration + """SecurityConfig for the Agent.""" + filesystem_configurations: list[FilesystemConfiguration] | None = ... + """The filesystem configurations for the runtime environment.""" + +@dataclass(kw_only=True) +class HarnessAgentCoreRuntimeEnvironmentRequest(_SerdeShape): + """The AgentCore Runtime environment request configuration.""" + + lifecycle_configuration: LifecycleConfiguration | None = ... + """ + LifecycleConfiguration lets you manage the lifecycle of runtime sessions + and resources in AgentCore Runtime. This configuration helps optimize + resource utilization by automatically cleaning up idle sessions and + preventing long-running instances from consuming resources indefinitely. + """ + network_configuration: NetworkConfiguration | None = ... + """SecurityConfig for the Agent.""" + filesystem_configurations: list[FilesystemConfiguration] | None = ... + """The filesystem configurations for the runtime environment.""" + +class HarnessBedrockApiFormat(UnknownEnumMixin, StrEnum): + CONVERSE_STREAM = "converse_stream" + """Use the Bedrock Converse Stream API format.""" + RESPONSES = "responses" + """Use the Responses API format.""" + CHAT_COMPLETIONS = "chat_completions" + """Use the Chat Completions API format.""" + +@dataclass(kw_only=True) +class HarnessBedrockModelConfig(_SerdeShape): + """Configuration for an Amazon Bedrock model provider.""" + + model_id: str + """The Bedrock model ID.""" + max_tokens: int | None = ... + """ + The maximum number of tokens to allow in the generated response per + model call. + """ + temperature: float | None = ... + """The temperature to set when calling the model.""" + top_p: float | None = ... + """The topP set when calling the model.""" + api_format: str | None = ... + """The API format to use when calling the Bedrock provider.""" + additional_params: Document | None = ... + """ + Provider-specific parameters passed through to the model provider + unchanged. + """ + +@dataclass(kw_only=True) +class HarnessBeforeInvocationHook(_SerdeShape): + """The configuration for a hook that runs before an invocation begins.""" + + name: str + """The name of the hook.""" + target: HarnessHookTarget + """The target that receives the hook event.""" + +@dataclass(kw_only=True) +class HarnessBeforeToolCallHook(_SerdeShape): + """The configuration for a hook that runs before the agent calls a tool.""" + + name: str + """The name of the hook.""" + target: HarnessHookTarget + """The target that receives the hook event.""" + +@dataclass(kw_only=True) +class HarnessDisabledMemoryConfiguration(_SerdeShape): + """Explicitly opt out of memory.""" + +@dataclass(kw_only=True) +class HarnessEndpoint(_SerdeShape): + """ + Representation of a harness endpoint. An endpoint is a named, stable + reference to a specific version of a harness that callers invoke, + allowing the underlying version to be updated without changing how the + agent is invoked. + """ + + harness_id: str + """The ID of the harness that the endpoint belongs to.""" + harness_name: str + """The name of the harness that the endpoint belongs to.""" + endpoint_name: str + """The name of the endpoint.""" + arn: str + """The ARN of the endpoint.""" + status: str + """The status of the endpoint.""" + created_at: datetime + """The timestamp when the endpoint was created.""" + updated_at: datetime + """The timestamp when the endpoint was last updated.""" + live_version: str | None = ... + """The harness version that the endpoint is currently serving.""" + target_version: str | None = ... + """ + The harness version that the endpoint points to. While an update is in + progress, this can differ from the live version until the endpoint + finishes transitioning. + """ + description: str | None = ... + """The description of the endpoint.""" + failure_reason: str | None = ... + """The reason the endpoint's last create or update operation failed.""" + +class HarnessEndpointStatus(UnknownEnumMixin, StrEnum): + CREATING = "CREATING" + CREATE_FAILED = "CREATE_FAILED" + UPDATING = "UPDATING" + UPDATE_FAILED = "UPDATE_FAILED" + READY = "READY" + DELETING = "DELETING" + DELETE_FAILED = "DELETE_FAILED" + +@dataclass +class HarnessEnvironmentArtifactContainerConfiguration(_SerdeShape): + """Representation of a container configuration.""" + + value: ContainerConfiguration + +@dataclass +class HarnessEnvironmentArtifactUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +HarnessEnvironmentArtifact = Union[ + HarnessEnvironmentArtifactContainerConfiguration | HarnessEnvironmentArtifactUnknown +] +""" +The environment artifact for a harness, such as a container image +containing custom dependencies. +""" + +class _HarnessEnvironmentArtifactDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> HarnessEnvironmentArtifact: ... + +@dataclass +class HarnessEnvironmentProviderAgentCoreRuntimeEnvironment(_SerdeShape): + """The AgentCore Runtime environment configuration.""" + + value: HarnessAgentCoreRuntimeEnvironment + +@dataclass +class HarnessEnvironmentProviderUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +HarnessEnvironmentProvider = Union[ + HarnessEnvironmentProviderAgentCoreRuntimeEnvironment + | HarnessEnvironmentProviderUnknown +] +"""The environment provider for a harness.""" + +class _HarnessEnvironmentProviderDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> HarnessEnvironmentProvider: ... + +@dataclass +class HarnessEnvironmentProviderRequestAgentCoreRuntimeEnvironment(_SerdeShape): + """The AgentCore Runtime environment configuration.""" + + value: HarnessAgentCoreRuntimeEnvironmentRequest + +@dataclass +class HarnessEnvironmentProviderRequestUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +HarnessEnvironmentProviderRequest = Union[ + HarnessEnvironmentProviderRequestAgentCoreRuntimeEnvironment + | HarnessEnvironmentProviderRequestUnknown +] +"""The environment provider request configuration.""" + +class _HarnessEnvironmentProviderRequestDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> HarnessEnvironmentProviderRequest: ... + +@dataclass +class HarnessGatewayOutboundAuthAwsIam(_SerdeShape): + """SigV4-sign requests using the agent's execution role.""" + + value: Unit + +@dataclass +class HarnessGatewayOutboundAuthNone(_SerdeShape): + """No authentication.""" + + value: Unit + +@dataclass +class HarnessGatewayOutboundAuthOauth(_SerdeShape): + """Use OAuth credentials for outbound authentication to the gateway.""" + + value: OAuthCredentialProvider + +@dataclass +class HarnessGatewayOutboundAuthUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +HarnessGatewayOutboundAuth = Union[ + HarnessGatewayOutboundAuthAwsIam + | HarnessGatewayOutboundAuthNone + | HarnessGatewayOutboundAuthOauth + | HarnessGatewayOutboundAuthUnknown +] +"""Authentication method for calling a Gateway.""" + +class _HarnessGatewayOutboundAuthDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> HarnessGatewayOutboundAuth: ... + +@dataclass(kw_only=True) +class HarnessGeminiModelConfig(_SerdeShape): + """ + Configuration for a Google Gemini model provider. Requires an API key + stored in AgentCore Identity. + """ + + model_id: str + """The Gemini model ID.""" + api_key_arn: str + """The ARN of your Gemini API key on AgentCore Identity.""" + max_tokens: int | None = ... + """ + The maximum number of tokens to allow in the generated response per + model call. + """ + temperature: float | None = ... + """The temperature to set when calling the model.""" + top_p: float | None = ... + """The topP set when calling the model.""" + top_k: int | None = ... + """The topK set when calling the model.""" + additional_params: Document | None = ... + """ + Provider-specific parameters passed through to the Gemini model provider + unchanged. + """ + +@dataclass +class HarnessHookBeforeInvocation(_SerdeShape): + """A hook that runs before an invocation begins.""" + + value: HarnessBeforeInvocationHook + +@dataclass +class HarnessHookAfterInvocation(_SerdeShape): + """A hook that runs after an invocation completes.""" + + value: HarnessAfterInvocationHook + +@dataclass +class HarnessHookBeforeToolCall(_SerdeShape): + """A hook that runs before the agent calls a tool.""" + + value: HarnessBeforeToolCallHook + +@dataclass +class HarnessHookAfterToolCall(_SerdeShape): + """A hook that runs after a tool call completes.""" + + value: HarnessAfterToolCallHook + +@dataclass +class HarnessHookUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +HarnessHook = Union[ + HarnessHookBeforeInvocation + | HarnessHookAfterInvocation + | HarnessHookBeforeToolCall + | HarnessHookAfterToolCall + | HarnessHookUnknown +] +"""A lifecycle hook configuration. Specify one hook type.""" + +class _HarnessHookDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> HarnessHook: ... + +@dataclass(kw_only=True) +class HarnessHookEventBridgeTarget(_SerdeShape): + """The configuration for an Amazon EventBridge hook target.""" + + arn: str + """The ARN of the Amazon EventBridge event bus to send hook events to.""" + +class HarnessHookFailureMode(UnknownEnumMixin, StrEnum): + """The behavior when a synchronous hook target fails.""" + + ALLOW = "allow" + """Specifies that the current action continues when the hook target fails.""" + DENY = "deny" + """ + Specifies that the service denies the current action when the hook + target fails. + """ + +@dataclass(kw_only=True) +class HarnessHookLambdaTarget(_SerdeShape): + """The configuration for an AWS Lambda hook target.""" + + arn: str + """The ARN of the Lambda function to invoke.""" + timeout_seconds: int = ... + """ + The maximum number of seconds to wait for the Lambda function response. + The default is 60 seconds. + """ + failure_mode: str = ... + """ + The behavior when the Lambda function times out, returns an error, or + returns an invalid response. The default is `DENY`. + """ + +@dataclass(kw_only=True) +class HarnessHookSnsTarget(_SerdeShape): + """The configuration for an Amazon SNS hook target.""" + + arn: str + """The ARN of the Amazon SNS topic to publish hook events to.""" + +@dataclass +class HarnessHookTargetLambda(_SerdeShape): + """ + A Lambda hook target that invokes an AWS Lambda function synchronously + and waits for its response. + """ + + value: HarnessHookLambdaTarget + +@dataclass +class HarnessHookTargetSns(_SerdeShape): + """ + An Amazon SNS hook target that publishes the hook event without waiting + for a response. + """ + + value: HarnessHookSnsTarget + +@dataclass +class HarnessHookTargetEventBridge(_SerdeShape): + """ + An Amazon EventBridge hook target that sends the hook event without + waiting for a response. + """ + + value: HarnessHookEventBridgeTarget + +@dataclass +class HarnessHookTargetUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +HarnessHookTarget = Union[ + HarnessHookTargetLambda + | HarnessHookTargetSns + | HarnessHookTargetEventBridge + | HarnessHookTargetUnknown +] +"""The target that receives lifecycle hook events. Specify one target type.""" + +class _HarnessHookTargetDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> HarnessHookTarget: ... + +@dataclass(kw_only=True) +class HarnessInlineFunctionConfig(_SerdeShape): + """ + Configuration for an inline function tool. When the agent calls this + tool, the tool call is returned to the caller for external execution. + """ + + description: str + """Description of what the tool does, provided to the model.""" + input_schema: Document + """JSON Schema describing the tool's input parameters.""" + +@dataclass(kw_only=True) +class HarnessLiteLlmModelConfig(_SerdeShape): + """ + Configuration for a LiteLLM model provider, enabling connection to + third-party model providers. + """ + + model_id: str + """The LiteLLM model identifier (e.g., \"anthropic/claude-3-sonnet\").""" + api_key_arn: str | None = ... + """ + The ARN of the API key in AgentCore Identity for authenticating with the + model provider. + """ + api_base: str | None = ... + """The base URL for the model provider's API endpoint.""" + max_tokens: int | None = ... + """ + The maximum number of tokens to allow in the generated response per + iteration. + """ + temperature: float | None = ... + """The temperature to set when calling the model.""" + top_p: float | None = ... + """The topP set when calling the model.""" + additional_params: Document | None = ... + """ + Provider-specific parameters passed through to the model provider + unchanged. + """ + +@dataclass(kw_only=True) +class HarnessManagedMemoryConfiguration(_SerdeShape): + """Configuration for managed memory creation.""" + + arn: str | None = ... + """ + The ARN of the managed AgentCore Memory resource. Read-only on Get, + ignored on Create/Update input. + """ + strategies: list[str] | None = ... + """Strategy types to enable. Defaults to [SEMANTIC, SUMMARIZATION].""" + event_expiry_duration: int | None = ... + """Event retention in days. Defaults to 30.""" + encryption_key_arn: str | None = ... + """ + Customer-managed KMS key. Defaults to AWS-owned key. Not updatable after + creation. + """ + +class HarnessManagedMemoryStrategyType(UnknownEnumMixin, StrEnum): + SEMANTIC = "SEMANTIC" + SUMMARIZATION = "SUMMARIZATION" + USER_PREFERENCE = "USER_PREFERENCE" + EPISODIC = "EPISODIC" + +@dataclass +class HarnessMemoryConfigurationAgentCoreMemoryConfiguration(_SerdeShape): + """The AgentCore Memory configuration.""" + + value: HarnessAgentCoreMemoryConfiguration + +@dataclass +class HarnessMemoryConfigurationManagedMemoryConfiguration(_SerdeShape): + """ + Harness creates and manages a memory resource in the customer's + account. + """ + + value: HarnessManagedMemoryConfiguration + +@dataclass +class HarnessMemoryConfigurationDisabled(_SerdeShape): + """Explicitly opt out of memory.""" + + value: HarnessDisabledMemoryConfiguration + +@dataclass +class HarnessMemoryConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +HarnessMemoryConfiguration = Union[ + HarnessMemoryConfigurationAgentCoreMemoryConfiguration + | HarnessMemoryConfigurationManagedMemoryConfiguration + | HarnessMemoryConfigurationDisabled + | HarnessMemoryConfigurationUnknown +] +"""The memory configuration for a harness.""" + +class _HarnessMemoryConfigurationDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> HarnessMemoryConfiguration: ... + +@dataclass +class HarnessModelConfigurationBedrockModelConfig(_SerdeShape): + """Configuration for an Amazon Bedrock model.""" + + value: HarnessBedrockModelConfig + +@dataclass +class HarnessModelConfigurationOpenAiModelConfig(_SerdeShape): + """Configuration for an OpenAI model.""" + + value: HarnessOpenAiModelConfig + +@dataclass +class HarnessModelConfigurationGeminiModelConfig(_SerdeShape): + """Configuration for a Google Gemini model.""" + + value: HarnessGeminiModelConfig + +@dataclass +class HarnessModelConfigurationLiteLlmModelConfig(_SerdeShape): + """ + The LiteLLM model configuration for connecting to third-party model + providers. + """ + + value: HarnessLiteLlmModelConfig + +@dataclass +class HarnessModelConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +HarnessModelConfiguration = Union[ + HarnessModelConfigurationBedrockModelConfig + | HarnessModelConfigurationOpenAiModelConfig + | HarnessModelConfigurationGeminiModelConfig + | HarnessModelConfigurationLiteLlmModelConfig + | HarnessModelConfigurationUnknown +] +"""Specification of which model to use.""" + +class _HarnessModelConfigurationDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> HarnessModelConfiguration: ... + +class HarnessOpenAiApiFormat(UnknownEnumMixin, StrEnum): + CHAT_COMPLETIONS = "chat_completions" + """Use the Chat Completions API format.""" + RESPONSES = "responses" + """Use the Responses API format.""" + +@dataclass(kw_only=True) +class HarnessOpenAiModelConfig(_SerdeShape): + """ + Configuration for an OpenAI model provider. Requires an API key stored + in AgentCore Identity. + """ + + model_id: str + """The OpenAI model ID.""" + api_key_arn: str + """The ARN of your OpenAI API key on AgentCore Identity.""" + api_base: str | None = ... + """Optional custom endpoint URL for an OpenAI-compatible endpoint.""" + max_tokens: int | None = ... + """ + The maximum number of tokens to allow in the generated response per + model call. + """ + temperature: float | None = ... + """The temperature to set when calling the model.""" + top_p: float | None = ... + """The topP set when calling the model.""" + api_format: str | None = ... + """The API format to use when calling the OpenAI provider.""" + additional_params: Document | None = ... + """ + Provider-specific parameters passed through to the model provider + unchanged. + """ + +@dataclass(kw_only=True) +class HarnessRemoteMcpConfig(_SerdeShape): + """Configuration for connecting to a remote MCP server.""" + + url: str + """URL of the MCP endpoint.""" + headers: dict[str, str] | None = ... + """Custom headers to include when connecting to the remote MCP server.""" + +@dataclass +class HarnessSkillPath(_SerdeShape): + """The filesystem path to the skill definition.""" + + value: str + +@dataclass +class HarnessSkillS3(_SerdeShape): + """An S3 source containing the skill.""" + + value: HarnessSkillS3Source + +@dataclass +class HarnessSkillGit(_SerdeShape): + """A git repository containing the skill.""" + + value: HarnessSkillGitSource + +@dataclass +class HarnessSkillAwsSkills(_SerdeShape): + """AWS Skills baked into the harness's underlying Runtime.""" + + value: HarnessSkillAwsSkillsSource + +@dataclass +class HarnessSkillUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +HarnessSkill = Union[ + HarnessSkillPath + | HarnessSkillS3 + | HarnessSkillGit + | HarnessSkillAwsSkills + | HarnessSkillUnknown +] +"""A skill available to the agent.""" + +class _HarnessSkillDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> HarnessSkill: ... + +@dataclass(kw_only=True) +class HarnessSkillAwsSkillsSource(_SerdeShape): + """Passed to show that AWS Skills should be included.""" + + paths: list[str] | None = ... + """ + Optionally filter allowed skills with glob syntax, e.g., + ['core-skills/*']. + """ + +@dataclass(kw_only=True) +class HarnessSkillGitAuth(_SerdeShape): + """Authentication configuration for accessing a private git repository.""" + + credential_arn: str + """ + The ARN of the credential in AgentCore Identity containing the password + or personal access token. + """ + username: str | None = ... + """Username for authentication. Defaults to 'oauth2' if not specified.""" + +@dataclass(kw_only=True) +class HarnessSkillGitSource(_SerdeShape): + """A git repository source for a skill.""" + + url: str + """The HTTPS URL of the git repository.""" + path: str | None = ... + """Subdirectory within the repository containing the skill.""" + auth: HarnessSkillGitAuth | None = ... + """Authentication configuration for private repositories.""" + +@dataclass(kw_only=True) +class HarnessSkillS3Source(_SerdeShape): + """An S3 source for a skill.""" + + uri: str + """ + The S3 URI pointing to the skill directory (e.g., + s3://bucket/skills/my-skill/). + """ + +@dataclass(kw_only=True) +class HarnessSlidingWindowConfiguration(_SerdeShape): + """Configuration for sliding window truncation strategy.""" + + messages_count: int | None = ... + """The number of recent messages to retain in the context window.""" + +class HarnessStatus(UnknownEnumMixin, StrEnum): + CREATING = "CREATING" + CREATE_FAILED = "CREATE_FAILED" + UPDATING = "UPDATING" + UPDATE_FAILED = "UPDATE_FAILED" + READY = "READY" + DELETING = "DELETING" + DELETE_FAILED = "DELETE_FAILED" + +@dataclass(kw_only=True) +class HarnessSummarizationConfiguration(_SerdeShape): + """Configuration for summarization-based truncation strategy.""" + + summary_ratio: float | None = ... + """The ratio of content to summarize.""" + preserve_recent_messages: int | None = ... + """The number of recent messages to preserve without summarization.""" + summarization_system_prompt: str | None = ... + """The system prompt used for generating summaries.""" + +@dataclass(kw_only=True) +class HarnessSummary(_SerdeShape): + """Summary information about a harness.""" + + harness_id: str + """The ID of the harness.""" + harness_name: str + """The name of the harness.""" + arn: str + """The ARN of the harness.""" + status: str + """The current status of the harness.""" + created_at: datetime + """The timestamp when the harness was created.""" + updated_at: datetime + """The timestamp when the harness was last updated.""" + harness_version: str | None = ... + """The latest version of the harness.""" + +@dataclass +class HarnessSystemContentBlockText(_SerdeShape): + """The text content of the system prompt block.""" + + value: str + +@dataclass +class HarnessSystemContentBlockUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +HarnessSystemContentBlock = Union[ + HarnessSystemContentBlockText | HarnessSystemContentBlockUnknown +] +"""A content block in the system prompt.""" + +class _HarnessSystemContentBlockDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> HarnessSystemContentBlock: ... + +@dataclass(kw_only=True) +class HarnessTool(_SerdeShape): + """A tool available to the agent loop.""" + + type: str + """The type of tool.""" + name: str | None = ... + """ + Unique name for the tool. If not provided, a name will be inferred or + generated. + """ + config: HarnessToolConfiguration | None = ... + """Tool-specific configuration.""" + +@dataclass +class HarnessToolConfigurationRemoteMcp(_SerdeShape): + """Configuration for remote MCP server.""" + + value: HarnessRemoteMcpConfig + +@dataclass +class HarnessToolConfigurationAgentCoreBrowser(_SerdeShape): + """Configuration for AgentCore Browser.""" + + value: HarnessAgentCoreBrowserConfig + +@dataclass +class HarnessToolConfigurationAgentCoreGateway(_SerdeShape): + """Configuration for AgentCore Gateway.""" + + value: HarnessAgentCoreGatewayConfig + +@dataclass +class HarnessToolConfigurationInlineFunction(_SerdeShape): + """Configuration for an inline function tool.""" + + value: HarnessInlineFunctionConfig + +@dataclass +class HarnessToolConfigurationAgentCoreCodeInterpreter(_SerdeShape): + """Configuration for AgentCore Code Interpreter.""" + + value: HarnessAgentCoreCodeInterpreterConfig + +@dataclass +class HarnessToolConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +HarnessToolConfiguration = Union[ + HarnessToolConfigurationRemoteMcp + | HarnessToolConfigurationAgentCoreBrowser + | HarnessToolConfigurationAgentCoreGateway + | HarnessToolConfigurationInlineFunction + | HarnessToolConfigurationAgentCoreCodeInterpreter + | HarnessToolConfigurationUnknown +] +"""Configuration union for different tool types.""" + +class _HarnessToolConfigurationDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> HarnessToolConfiguration: ... + +class HarnessToolType(UnknownEnumMixin, StrEnum): + REMOTE_MCP = "remote_mcp" + AGENTCORE_BROWSER = "agentcore_browser" + AGENTCORE_GATEWAY = "agentcore_gateway" + INLINE_FUNCTION = "inline_function" + AGENTCORE_CODE_INTERPRETER = "agentcore_code_interpreter" + +@dataclass(kw_only=True) +class HarnessTruncationConfiguration(_SerdeShape): + """ + Configuration for truncating conversation context when it exceeds model + limits. + """ + + strategy: str + """The truncation strategy to use.""" + config: HarnessTruncationStrategyConfiguration | None = ... + """The strategy-specific configuration.""" + +class HarnessTruncationStrategy(UnknownEnumMixin, StrEnum): + SLIDING_WINDOW = "sliding_window" + SUMMARIZATION = "summarization" + NONE = "none" + +@dataclass +class HarnessTruncationStrategyConfigurationSlidingWindow(_SerdeShape): + """Configuration for sliding window truncation.""" + + value: HarnessSlidingWindowConfiguration + +@dataclass +class HarnessTruncationStrategyConfigurationSummarization(_SerdeShape): + """Configuration for summarization-based truncation.""" + + value: HarnessSummarizationConfiguration + +@dataclass +class HarnessTruncationStrategyConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +HarnessTruncationStrategyConfiguration = Union[ + HarnessTruncationStrategyConfigurationSlidingWindow + | HarnessTruncationStrategyConfigurationSummarization + | HarnessTruncationStrategyConfigurationUnknown +] +"""Strategy-specific truncation configuration.""" + +class _HarnessTruncationStrategyConfigurationDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> HarnessTruncationStrategyConfiguration: ... + +@dataclass(kw_only=True) +class HarnessVersionSummary(_SerdeShape): + """Summary information about a single version of a harness.""" + + harness_id: str + """The ID of the harness.""" + harness_name: str + """The name of the harness.""" + arn: str + """The ARN of the harness.""" + harness_version: str + """The version of the harness that this summary describes.""" + status: str + """The status of this harness version.""" + created_at: datetime + """The timestamp when this harness version was created.""" + updated_at: datetime + """The timestamp when this harness version was last updated.""" + failure_reason: str | None = ... + """ + Reason why the create or update operation for this harness version + failed. + """ + +@dataclass(kw_only=True) +class HostingEnvironment(_SerdeShape): + """ + A hosting environment whose workloads are allowed to invoke the target. + At launch, the only supported hosting environment is AgentCore Gateway. + """ + + arn: str + """The Amazon Resource Name (ARN) of the hosting environment.""" + +@dataclass(kw_only=True) +class HttpApiSchemaConfiguration(_SerdeShape): + """ + The API schema configuration for an HTTP target. This schema defines the + API structure that the target exposes. + """ + + source: ApiSchemaConfiguration + """Configuration for API schema.""" + +@dataclass(kw_only=True) +class HttpConnectorSource(_SerdeShape): + """The source identifying the HTTP connector integration.""" + + connector_id: str + """The identifier for the HTTP connector integration.""" + +@dataclass(kw_only=True) +class HttpConnectorTargetConfiguration(_SerdeShape): + """ + The configuration for an HTTP connector target. Use this configuration + when you want to route HTTP requests through a managed connector. + """ + + source: HttpConnectorSource + """The source configuration identifying which HTTP connector to use.""" + parameters: dict[str, str] | None = ... + """ + The resource parameters for this connector (for example, `memoryId`). + The service validates these parameters against the request path at + runtime. + """ + +@dataclass +class HttpTargetConfigurationAgentcoreRuntime(_SerdeShape): + """ + The AgentCore Runtime target configuration for HTTP-based communication + with an agent runtime. + """ + + value: RuntimeTargetConfiguration + +@dataclass +class HttpTargetConfigurationPassthrough(_SerdeShape): + """ + The passthrough configuration for the HTTP target. A passthrough target + forwards requests directly to an external HTTP endpoint. + """ + + value: PassthroughTargetConfiguration + +@dataclass +class HttpTargetConfigurationConnector(_SerdeShape): + """ + The connector-based configuration for the HTTP target. Use this + configuration when you want to route HTTP requests through a managed + connector. + """ + + value: HttpConnectorTargetConfiguration + +@dataclass +class HttpTargetConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +HttpTargetConfiguration = Union[ + HttpTargetConfigurationAgentcoreRuntime + | HttpTargetConfigurationPassthrough + | HttpTargetConfigurationConnector + | HttpTargetConfigurationUnknown +] +""" +The HTTP target configuration for a gateway target. Contains the +configuration for HTTP-based target endpoints. +""" + +class _HttpTargetConfigurationDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> HttpTargetConfiguration: ... + +@dataclass(kw_only=True) +class IamCredentialProvider(_SerdeShape): + """ + An IAM credential provider for gateway authentication. This structure + contains the configuration for authenticating with the target endpoint + using IAM credentials and SigV4 signing. + """ + + service: str + """ + The target Amazon Web Services service name used for SigV4 signing. This + value identifies the service that the gateway authenticates with when + making requests to the target endpoint. + """ + region: str | None = ... + """ + The Amazon Web Services Region used for SigV4 signing. If not specified, + defaults to the gateway's Region. + """ + +@dataclass(kw_only=True) +class IamPrincipal(_SerdeShape): + """An IAM principal specification for rule matching.""" + + arn: str + """ + The Amazon Resource Name (ARN) of the IAM principal. Supports user, + role, and assumed-role ARNs. Wildcards can be used with the `StringLike` + operator. + """ + operator: str | None = ... + """ + The match operator. `StringEquals` requires an exact match. `StringLike` + supports wildcard patterns using `*` and `?`. + """ + +class InboundTokenClaimValueType(UnknownEnumMixin, StrEnum): + STRING = "STRING" + STRING_ARRAY = "STRING_ARRAY" + +class IncludedData(UnknownEnumMixin, StrEnum): + ALL_DATA = "ALL_DATA" + METADATA_ONLY = "METADATA_ONLY" + +@dataclass(kw_only=True) +class IncludedOauth2ProviderConfigInput(_SerdeShape): + """ + Configuration settings for connecting to a supported OAuth2 provider. + This includes client credentials and OAuth2 discovery information for + providers that have built-in support. + """ + + client_id: str + """ + The client ID for the supported OAuth2 provider. This identifier is + assigned by the OAuth2 provider when you register your application. + """ + client_secret: str = ... + """ + The client secret for the supported OAuth2 provider. This secret is + assigned by the OAuth2 provider and used along with the client ID to + authenticate your application. + """ + client_secret_config: SecretReference | None = ... + """ + A reference to the Amazon Web Services Secrets Manager secret that + stores the client secret. This includes the secret ID and the JSON key + used to extract the client secret value from the secret. Required when + `clientSecretSource` is set to `EXTERNAL`. + """ + client_secret_source: str | None = ... + """ + The source type of the client secret. Use `MANAGED` if the secret is + managed by the service, or `EXTERNAL` if you manage the secret yourself + in Amazon Web Services Secrets Manager. + """ + issuer: str | None = ... + """ + Token issuer of your isolated OAuth2 application tenant. This URL + identifies the authorization server that issues tokens for this + provider. + """ + authorization_endpoint: str | None = ... + """ + OAuth2 authorization endpoint for your isolated OAuth2 application + tenant. This is where users are redirected to authenticate and authorize + access to their resources. + """ + token_endpoint: str | None = ... + """ + OAuth2 token endpoint for your isolated OAuth2 application tenant. This + is where authorization codes are exchanged for access tokens. + """ + +@dataclass(kw_only=True) +class IncludedOauth2ProviderConfigOutput(_SerdeShape): + """ + The configuration details returned for a supported OAuth2 provider, + including client credentials and OAuth2 discovery information. + """ + + oauth_discovery: Oauth2Discovery + """Contains the discovery information for an OAuth2 provider.""" + client_id: str | None = ... + """The client ID for the supported OAuth2 provider.""" + +@dataclass(kw_only=True) +class IndexedKey(_SerdeShape): + """A metadata key indexed for filtering.""" + + key: str + """The metadata key name to index.""" + type: str + """The data type of the indexed key.""" + +@dataclass(kw_only=True) +class InferenceConfiguration(_SerdeShape): + """ + The configuration parameters that control how the foundation model + behaves during evaluation, including response generation settings. + """ + + max_tokens: int | None = ... + """ + The maximum number of tokens to generate in the model response during + evaluation. + """ + temperature: float | None = ... + """ + The temperature value that controls randomness in the model's + responses. Lower values produce more deterministic outputs. + """ + top_p: float | None = ... + """ + The top-p sampling parameter that controls the diversity of the model's + responses by limiting the cumulative probability of token choices. + """ + stop_sequences: list[str] | None = ... + """ + The list of sequences that will cause the model to stop generating + tokens when encountered. + """ + +@dataclass(kw_only=True) +class InferenceConnectorSource(_SerdeShape): + """The source identifying the inference connector.""" + + connector_id: str + """ + The identifier for the inference connector (for example, + `bedrock-mantle`, `openai`, or `anthropic`). + """ + +@dataclass(kw_only=True) +class InferenceConnectorTargetConfiguration(_SerdeShape): + """ + The configuration for a connector-based inference target. This + configuration uses a built-in connector that provides predefined rules + for a large language model (LLM) provider. + """ + + source: InferenceConnectorSource + """The source configuration identifying which inference connector to use.""" + +@dataclass(kw_only=True) +class InferenceOperationConfiguration(_SerdeShape): + """ + The configuration for a specific inference operation, including its + request path and the models that the operation supports. + """ + + path: str + """ + The request path for this operation (for example, `/v1/messages` or + `/v1/responses`). + """ + provider_path: str | None = ... + """ + The provider path to forward requests to, if it differs from the request + path. For example, `/anthropic/v1/messages` when the provider expects a + different path than the client-facing `/v1/messages`. + """ + models: list[ModelEntry] | None = ... + """The list of models supported for this operation.""" + +@dataclass(kw_only=True) +class InferenceProviderTargetConfiguration(_SerdeShape): + """ + The configuration for a provider-based inference target. This + configuration explicitly defines the endpoint, model mapping, and + operations used to route requests to a large language model (LLM) + provider. + """ + + endpoint: str + """ + The HTTPS endpoint of the inference provider that the gateway forwards + requests to. + """ + model_mapping: ModelMapping | None = ... + """ + The configuration that translates client-facing model IDs to the model + IDs expected by the provider. + """ + operations: list[InferenceOperationConfiguration] | None = ... + """ + A list of per-operation configurations that map request paths to the + models supported for each operation. + """ + +@dataclass +class InferenceTargetConfigurationConnector(_SerdeShape): + """ + The connector-based inference configuration. Use this option to route + requests to an LLM provider through a built-in connector that includes + predefined provider rules. + """ + + value: InferenceConnectorTargetConfiguration + +@dataclass +class InferenceTargetConfigurationProvider(_SerdeShape): + """ + The provider-based inference configuration. Use this option to + explicitly configure the endpoint, model mapping, and operations for an + LLM provider. + """ + + value: InferenceProviderTargetConfiguration + +@dataclass +class InferenceTargetConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +InferenceTargetConfiguration = Union[ + InferenceTargetConfigurationConnector + | InferenceTargetConfigurationProvider + | InferenceTargetConfigurationUnknown +] +""" +The configuration for an inference target. An inference target routes +requests to a large language model (LLM) provider, either through a +built-in connector or an explicitly configured provider. +""" + +class _InferenceTargetConfigurationDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> InferenceTargetConfiguration: ... + +@dataclass(kw_only=True) +class InlineExamplesSource(_SerdeShape): + """Inline examples provided directly in the request body.""" + + examples: list[Document] + """Examples to add. Each example is assigned an auto-generated UUID.""" + +@dataclass(kw_only=True) +class Insight(_SerdeShape): + """ + A reference to an insight analysis to run against sessions during + evaluation. Insights provide deeper analysis beyond individual evaluator + scores, including failure detection, user intent clustering, and + execution summarization. + """ + + insight_id: str + """The unique identifier of the insight to run.""" + +@dataclass(kw_only=True) +class InstanceLifecycleConfiguration(_SerdeShape): + """ + The configuration that manages the lifecycle of instances in a capacity + provider, including idle timeout and maximum lifetime. + """ + + idle_instance_timeout: int | None = ... + """ + The number of seconds an instance can remain idle before it is stopped. + An instance is considered idle when all of its agents are idle. The + default is 900 seconds (15 minutes). + """ + max_lifetime: int | None = ... + """ + The maximum lifetime of an instance, in seconds. When an instance + reaches this limit, the service terminates it regardless of activity. + The default is 28800 seconds (8 hours). The maximum is 1209600 seconds + (14 days). + """ + +@dataclass(kw_only=True) +class InstanceRequirements(_SerdeShape): + """The requirements for Amazon EC2 instance types in a capacity provider.""" + + allowed_instance_types: list[str] + """ + The list of allowed instance types. You can specify up to 30 instance + types. + """ + +@dataclass +class InterceptorConfigurationLambda(_SerdeShape): + """The details of the lambda function used for the interceptor.""" + + value: LambdaInterceptorConfiguration + +@dataclass +class InterceptorConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +InterceptorConfiguration = Union[ + InterceptorConfigurationLambda | InterceptorConfigurationUnknown +] +"""The interceptor configuration.""" + +class _InterceptorConfigurationDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> InterceptorConfiguration: ... + +@dataclass(kw_only=True) +class InterceptorInputConfiguration(_SerdeShape): + """The input configuration of the interceptor.""" + + pass_request_headers: bool + """ + Indicates whether to pass request headers as input into the interceptor. + When set to true, request headers will be passed. + """ + payload_filter: InterceptorPayloadFilter | None = ... + """ + The filter that determines which parts of the request or response + payload are passed as input to the interceptor. + """ + +class InterceptorPayloadExclusion(UnknownEnumMixin, StrEnum): + RESPONSE_BODY = "RESPONSE_BODY" + +@dataclass +class InterceptorPayloadExclusionSelectorField(_SerdeShape): + """The field to exclude from the interceptor input.""" + + value: str + +@dataclass +class InterceptorPayloadExclusionSelectorUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +InterceptorPayloadExclusionSelector = Union[ + InterceptorPayloadExclusionSelectorField + | InterceptorPayloadExclusionSelectorUnknown +] +""" +A selector that identifies a payload field to exclude from the +interceptor input. +""" + +class _InterceptorPayloadExclusionSelectorDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> InterceptorPayloadExclusionSelector: ... + +@dataclass(kw_only=True) +class InterceptorPayloadFilter(_SerdeShape): + """ + The filter that controls which fields of the request or response payload + are included in the input to the interceptor. + """ + + exclude: list[InterceptorPayloadExclusionSelector] + """ + The list of selectors that identify payload fields to exclude from the + interceptor input. + """ + +@dataclass(kw_only=True) +class InternalServerException(ServiceError, _SerdeShape): + """ + This exception is thrown if there was an unexpected error during + processing of request + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvocationConfiguration(_SerdeShape): + """ + The configuration to invoke a self-managed memory processing pipeline + with. + """ + + topic_arn: str + """The ARN of the SNS topic for job notifications.""" + payload_delivery_bucket_name: str + """The S3 bucket name for event payload delivery.""" + +@dataclass(kw_only=True) +class InvocationConfigurationInput(_SerdeShape): + """ + The configuration to invoke a self-managed memory processing pipeline + with. + """ + + topic_arn: str + """The ARN of the SNS topic for job notifications.""" + payload_delivery_bucket_name: str + """The S3 bucket name for event payload delivery.""" + +class KeyType(UnknownEnumMixin, StrEnum): + CUSTOMER_MANAGED_KEY = "CustomerManagedKey" + SERVICE_MANAGED_KEY = "ServiceManagedKey" + +@dataclass(kw_only=True) +class KinesisResource(_SerdeShape): + """Configuration for Kinesis Data Stream delivery.""" + + data_stream_arn: str + """ARN of the Kinesis Data Stream.""" + content_configurations: list[ContentConfiguration] + """Content configurations for stream delivery.""" + +@dataclass(kw_only=True) +class KmsConfiguration(_SerdeShape): + """Contains the KMS configuration for a resource.""" + + key_type: str + """The type of KMS key (CustomerManagedKey or ServiceManagedKey).""" + kms_key_arn: str | None = ... + """The Amazon Resource Name (ARN) of the KMS key.""" + +@dataclass(kw_only=True) +class KmsKeySourceType(_SerdeShape): + """Contains the KMS key configuration for a JWT client assertion.""" + + kms_key_arn: str + """ + The Amazon Resource Name (ARN) of the KMS key used to sign the JWT + client assertion. The key must be an asymmetric key with key usage + SIGN_VERIFY and a key spec compatible with the configured signing + algorithm. + """ + +@dataclass(kw_only=True) +class LambdaEvaluatorConfig(_SerdeShape): + """Configuration for a Lambda function used as a code-based evaluator.""" + + lambda_arn: str + """ + The Amazon Resource Name (ARN) of the Lambda function that implements + the evaluation logic. + """ + lambda_timeout_in_seconds: int | None = ... + """ + The timeout in seconds for the Lambda function invocation. Defaults to + 60. Must be between 1 and 300. + """ + +@dataclass(kw_only=True) +class LambdaInterceptorConfiguration(_SerdeShape): + """The lambda configuration for the interceptor""" + + arn: str + """The arn of the lambda function to be invoked for the interceptor.""" + +@dataclass(kw_only=True) +class LambdaTransformConfiguration(_SerdeShape): + """ + The Lambda configuration for custom transformations. This structure + defines the Lambda function that the gateway invokes to transform data. + """ + + arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the Lambda function. This function is + invoked by the gateway to transform data. + """ + +@dataclass(kw_only=True) +class LaunchParameters(_SerdeShape): + """ + The parameters for launching Amazon EC2 instances in a capacity + provider. + """ + + operating_system: str + """The operating system and CPU architecture for the instances.""" + instance_requirements: InstanceRequirements + """The requirements that determine which instance types can be launched.""" + ephemeral_volumes: list[EphemeralBlockDeviceMapping] | None = ... + """ + The block device mappings for instance store (ephemeral) volumes. You + can specify up to five mappings. + """ + monitoring: str | None = ... + """The monitoring level for the instances.""" + license_specifications: list[LicenseSpecification] | None = ... + """ + The license configurations to associate with the instances. You can + specify up to five configurations. + """ + capacity_reservation_specification: CapacityReservationSpecification | None = ... + """The Capacity Reservation targeting option for the instances.""" + ssh_key_name: str | None = ... + """ + The name of the SSH key pair to configure on the instances for SSH + connectivity. + """ + instance_profile_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the IAM instance profile to associate + with launched instances. If provided, this overrides the default + instance profile. + """ + propagated_tags: dict[str, str] | None = ... + """ + The tags to propagate to all Amazon EC2 resources (instances, volumes, + and network interfaces) that the capacity provider creates. + """ + +@dataclass +class LaunchTemplateSourceLaunchParameters(_SerdeShape): + """The parameters that AgentCore uses to create the launch template.""" + + value: LaunchParameters + +@dataclass +class LaunchTemplateSourceUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +LaunchTemplateSource = Union[ + LaunchTemplateSourceLaunchParameters | LaunchTemplateSourceUnknown +] +""" +The source of the launch template configuration for a capacity provider. +The `launchParameters` member specifies the operating system, instance +requirements, and other settings used to launch instances. +""" + +class _LaunchTemplateSourceDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> LaunchTemplateSource: ... + +@dataclass(kw_only=True) +class LicenseSpecification(_SerdeShape): + """A license configuration to associate with the instances.""" + + license_configuration_arn: str + """The Amazon Resource Name (ARN) of the license configuration.""" + +@dataclass(kw_only=True) +class LifecycleConfiguration(_SerdeShape): + """ + LifecycleConfiguration lets you manage the lifecycle of runtime sessions + and resources in AgentCore Runtime. This configuration helps optimize + resource utilization by automatically cleaning up idle sessions and + preventing long-running instances from consuming resources indefinitely. + """ + + idle_runtime_session_timeout: int | None = ... + """ + Timeout in seconds for idle runtime sessions. When a session remains + idle for this duration, it will be automatically terminated. Default: + 900 seconds (15 minutes). + """ + max_lifetime: int | None = ... + """ + Maximum lifetime for the instance in seconds. Once reached, instances + will be automatically terminated and replaced. Default: 28800 seconds (8 + hours). + """ + +@dataclass(kw_only=True) +class LimitEntry(_SerdeShape): + """ + A single rule entry within a rate limit that maps dimension values to + rate configurations. Each entry defines the rate limits for a specific + combination of dimension values. + """ + + dimensions: dict[str, str] + """ + A map of dimension names to dimension values for this rule entry. Keys + must match the parent rate limit's dimension keys. Values may use `*` + as a wildcard, but only in trailing positions based on the dimension + keys ordering. + """ + requests: list[RateConfig] | None = ... + """ + The request rate limit configuration. Specifies the maximum number of + requests allowed per time period. + """ + tokens: list[RateConfig] | None = ... + """ + The token rate limit configuration. Specifies the maximum number of + tokens allowed per time period. + """ + connections: list[RateConfig] | None = ... + """ + The connection rate limit configuration. Specifies the maximum number of + concurrent connections allowed. + """ + +@dataclass(kw_only=True) +class LinkedinOauth2ProviderConfigInput(_SerdeShape): + """ + Configuration settings for connecting to LinkedIn services using OAuth2 + authentication. This includes the client credentials required to + authenticate with LinkedIn's OAuth2 authorization server. + """ + + client_id: str + """ + The client ID for the LinkedIn OAuth2 provider. This identifier is + assigned by LinkedIn when you register your application. + """ + client_secret: str = ... + """ + The client secret for the LinkedIn OAuth2 provider. This secret is + assigned by LinkedIn and used along with the client ID to authenticate + your application. + """ + client_secret_config: SecretReference | None = ... + """ + A reference to the Amazon Web Services Secrets Manager secret that + stores the client secret. This includes the secret ID and the JSON key + used to extract the client secret value from the secret. Required when + `clientSecretSource` is set to `EXTERNAL`. + """ + client_secret_source: str | None = ... + """ + The source type of the client secret. Use `MANAGED` if the secret is + managed by the service, or `EXTERNAL` if you manage the secret yourself + in Amazon Web Services Secrets Manager. + """ + +@dataclass(kw_only=True) +class LinkedinOauth2ProviderConfigOutput(_SerdeShape): + """ + The configuration details returned for a LinkedIn OAuth2 provider, + including the client ID and OAuth2 discovery information. + """ + + oauth_discovery: Oauth2Discovery + """Contains the discovery information for an OAuth2 provider.""" + client_id: str | None = ... + """The client ID for the LinkedIn OAuth2 provider.""" + +@dataclass(kw_only=True) +class ListAgentRuntimeEndpointsInput(_SerdeShape): + """Dataclass for ListAgentRuntimeEndpointsInput structure.""" + + agent_runtime_id: str | None = ... + """The unique identifier of the AgentCore Runtime to list endpoints for.""" + max_results: int | None = ... + """The maximum number of results to return in the response.""" + next_token: str | None = ... + """A token to retrieve the next page of results.""" + +@dataclass(kw_only=True) +class ListAgentRuntimeEndpointsOutput(_SerdeShape): + """Dataclass for ListAgentRuntimeEndpointsOutput structure.""" + + runtime_endpoints: list[AgentRuntimeEndpoint] + """The list of AgentCore Runtime endpoints.""" + next_token: str | None = ... + """A token to retrieve the next page of results.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListAgentRuntimesInput(_SerdeShape): + """Dataclass for ListAgentRuntimesInput structure.""" + + max_results: int | None = ... + """The maximum number of results to return in the response.""" + next_token: str | None = ... + """A token to retrieve the next page of results.""" + +@dataclass(kw_only=True) +class ListAgentRuntimesOutput(_SerdeShape): + """Dataclass for ListAgentRuntimesOutput structure.""" + + agent_runtimes: list[AgentRuntime] + """The list of AgentCore Runtime resources.""" + next_token: str | None = ... + """A token to retrieve the next page of results.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListAgentRuntimeVersionsByCapacityProviderInput(_SerdeShape): + """Dataclass for ListAgentRuntimeVersionsByCapacityProviderInput structure.""" + + capacity_provider_id: str | None = ... + """The unique identifier of the capacity provider.""" + max_results: int | None = ... + """ + The maximum number of results to return in the response. If the total + number of results is greater than this value, use the token returned in + the response in the `nextToken` field when making another request to + return the next batch of results. + """ + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, enter the token returned in the `nextToken` + field in the response in this field to return the next batch of results. + """ + +@dataclass(kw_only=True) +class ListAgentRuntimeVersionsByCapacityProviderOutput(_SerdeShape): + """ + Dataclass for ListAgentRuntimeVersionsByCapacityProviderOutput + structure. + """ + + agent_runtimes: list[AgentRuntimeVersionSummary] + """ + The list of agent runtime versions that are associated with the capacity + provider. + """ + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, use this token when making another request in + the `nextToken` field to return the next batch of results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListAgentRuntimeVersionsInput(_SerdeShape): + """Dataclass for ListAgentRuntimeVersionsInput structure.""" + + agent_runtime_id: str | None = ... + """The unique identifier of the AgentCore Runtime to list versions for.""" + max_results: int | None = ... + """The maximum number of results to return in the response.""" + next_token: str | None = ... + """A token to retrieve the next page of results.""" + +@dataclass(kw_only=True) +class ListAgentRuntimeVersionsOutput(_SerdeShape): + """Dataclass for ListAgentRuntimeVersionsOutput structure.""" + + agent_runtimes: list[AgentRuntime] + """The list of AgentCore Runtime versions.""" + next_token: str | None = ... + """A token to retrieve the next page of results.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListApiKeyCredentialProvidersInput(_SerdeShape): + """Dataclass for ListApiKeyCredentialProvidersInput structure.""" + + next_token: str | None = ... + """Pagination token.""" + max_results: int = ... + """Maximum number of results to return.""" + +@dataclass(kw_only=True) +class ListApiKeyCredentialProvidersOutput(_SerdeShape): + """Dataclass for ListApiKeyCredentialProvidersOutput structure.""" + + credential_providers: list[ApiKeyCredentialProviderItem] + """The list of API key credential providers.""" + next_token: str | None = ... + """Pagination token for the next page of results.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListBrowserProfilesInput(_SerdeShape): + """Dataclass for ListBrowserProfilesInput structure.""" + + max_results: int | None = ... + """The maximum number of results to return in the response.""" + next_token: str | None = ... + """A token to retrieve the next page of results.""" + name: str | None = ... + """The name of the browser profile to filter results by.""" + +@dataclass(kw_only=True) +class ListBrowserProfilesOutput(_SerdeShape): + """Dataclass for ListBrowserProfilesOutput structure.""" + + profile_summaries: list[BrowserProfileSummary] + """The list of browser profile summaries.""" + next_token: str | None = ... + """A token to retrieve the next page of results.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListBrowsersInput(_SerdeShape): + """Dataclass for ListBrowsersInput structure.""" + + max_results: int | None = ... + """ + The maximum number of results to return in a single call. The default + value is 10. The maximum value is 50. + """ + next_token: str | None = ... + """ + The token for the next set of results. Use the value returned in the + previous response in the next request to retrieve the next set of + results. + """ + type: str | None = ... + """ + The type of browsers to list. If not specified, all browser types are + returned. + """ + +@dataclass(kw_only=True) +class ListBrowsersOutput(_SerdeShape): + """Dataclass for ListBrowsersOutput structure.""" + + browser_summaries: list[BrowserSummary] + """The list of browser summaries.""" + next_token: str | None = ... + """A token to retrieve the next page of results.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListCapacityProvidersInput(_SerdeShape): + """Dataclass for ListCapacityProvidersInput structure.""" + + max_results: int | None = ... + """ + The maximum number of results to return in the response. If the total + number of results is greater than this value, use the token returned in + the response in the `nextToken` field when making another request to + return the next batch of results. + """ + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, enter the token returned in the `nextToken` + field in the response in this field to return the next batch of results. + """ + +@dataclass(kw_only=True) +class ListCapacityProvidersOutput(_SerdeShape): + """Dataclass for ListCapacityProvidersOutput structure.""" + + capacity_providers: list[CapacityProviderSummary] + """The list of capacity provider summaries.""" + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, use this token when making another request in + the `nextToken` field to return the next batch of results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListCodeInterpretersInput(_SerdeShape): + """Dataclass for ListCodeInterpretersInput structure.""" + + max_results: int | None = ... + """The maximum number of results to return in the response.""" + next_token: str | None = ... + """A token to retrieve the next page of results.""" + type: str | None = ... + """The type of code interpreters to list.""" + +@dataclass(kw_only=True) +class ListCodeInterpretersOutput(_SerdeShape): + """Dataclass for ListCodeInterpretersOutput structure.""" + + code_interpreter_summaries: list[CodeInterpreterSummary] + """The list of code interpreter summaries.""" + next_token: str | None = ... + """A token to retrieve the next page of results.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListConfigurationBundlesInput(_SerdeShape): + """Dataclass for ListConfigurationBundlesInput structure.""" + + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, enter the token returned in the `nextToken` + field in the response in this field to return the next batch of results. + """ + max_results: int | None = ... + """ + The maximum number of results to return in the response. If the total + number of results is greater than this value, use the token returned in + the response in the `nextToken` field when making another request to + return the next batch of results. + """ + +@dataclass(kw_only=True) +class ListConfigurationBundlesOutput(_SerdeShape): + """Dataclass for ListConfigurationBundlesOutput structure.""" + + bundles: list[ConfigurationBundleSummary] + """The list of configuration bundle summaries.""" + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, use this token when making another request in + the `nextToken` field to return the next batch of results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListConfigurationBundleVersionsInput(_SerdeShape): + """Dataclass for ListConfigurationBundleVersionsInput structure.""" + + bundle_id: str | None = ... + """The unique identifier of the configuration bundle to list versions for.""" + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, enter the token returned in the `nextToken` + field in the response in this field to return the next batch of results. + """ + max_results: int | None = ... + """ + The maximum number of results to return in the response. If the total + number of results is greater than this value, use the token returned in + the response in the `nextToken` field when making another request to + return the next batch of results. + """ + filter: VersionFilter | None = ... + """ + An optional filter for listing versions, including branch name, creation + source, and whether to return only the latest version per branch. + """ + +@dataclass(kw_only=True) +class ListConfigurationBundleVersionsOutput(_SerdeShape): + """Dataclass for ListConfigurationBundleVersionsOutput structure.""" + + versions: list[ConfigurationBundleVersionSummary] + """The list of configuration bundle version summaries.""" + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, use this token when making another request in + the `nextToken` field to return the next batch of results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListConsentPortalsInput(_SerdeShape): + """Dataclass for ListConsentPortalsInput structure.""" + + max_results: int | None = ... + """The maximum number of consent portals to return in a single call.""" + next_token: str | None = ... + """ + A token to retrieve the next page of results. Use the value returned in + a previous response to request the next page. + """ + +@dataclass(kw_only=True) +class ListConsentPortalsOutput(_SerdeShape): + """Dataclass for ListConsentPortalsOutput structure.""" + + consent_portals: list[ConsentPortalSummary] + """The list of consent portals.""" + next_token: str | None = ... + """ + The token to use in a subsequent request to retrieve the next page of + results. This value is null when there are no more results to return. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListDatasetExamplesInput(_SerdeShape): + """Dataclass for ListDatasetExamplesInput structure.""" + + dataset_id: str | None = ... + """The unique identifier of the dataset.""" + dataset_version: str | None = ... + """ + Version to paginate: \"DRAFT\" or a version number. Defaults to DRAFT if + absent. Only used on the first request; for subsequent pages, the + version is extracted from the pagination token. + """ + max_results: int | None = ... + """Maximum number of examples to return per page.""" + next_token: str | None = ... + """The token for the next page of results.""" + +@dataclass(kw_only=True) +class ListDatasetExamplesOutput(_SerdeShape): + """Dataclass for ListDatasetExamplesOutput structure.""" + + dataset_arn: str + """The Amazon Resource Name (ARN) of the dataset.""" + dataset_id: str + """The unique identifier of the dataset.""" + dataset_version: str + """The version returned.""" + examples: list[Document] + """ + Paginated example content. Each element is a JSON object containing at + least an `exampleId` field plus the schema-specific content fields. + """ + next_token: str | None = ... + """ + The token for the next page of results, or null if there are no more + results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListDatasetsInput(_SerdeShape): + """Dataclass for ListDatasetsInput structure.""" + + next_token: str | None = ... + """The token for the next page of results.""" + max_results: int | None = ... + """The maximum number of datasets to return per page.""" + +@dataclass(kw_only=True) +class ListDatasetsOutput(_SerdeShape): + """Dataclass for ListDatasetsOutput structure.""" + + datasets: list[DatasetSummary] + """The list of datasets.""" + next_token: str | None = ... + """ + The token for the next page of results, or null if there are no more + results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListDatasetVersionsInput(_SerdeShape): + """Dataclass for ListDatasetVersionsInput structure.""" + + dataset_id: str | None = ... + """The unique identifier of the dataset.""" + next_token: str | None = ... + """The token for the next page of results.""" + max_results: int | None = ... + """The maximum number of versions to return per page.""" + +@dataclass(kw_only=True) +class ListDatasetVersionsOutput(_SerdeShape): + """Dataclass for ListDatasetVersionsOutput structure.""" + + versions: list[DatasetVersionSummary] + """The list of published dataset versions.""" + next_token: str | None = ... + """ + The token for the next page of results, or null if there are no more + results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListEvaluatorsInput(_SerdeShape): + """Dataclass for ListEvaluatorsInput structure.""" + + next_token: str | None = ... + """ + The pagination token from a previous request to retrieve the next page + of results. + """ + max_results: int | None = ... + """The maximum number of evaluators to return in a single response.""" + +@dataclass(kw_only=True) +class ListEvaluatorsOutput(_SerdeShape): + """Dataclass for ListEvaluatorsOutput structure.""" + + evaluators: list[EvaluatorSummary] + """ + The list of evaluator summaries containing basic information about each + evaluator. + """ + next_token: str | None = ... + """ + The pagination token to use in a subsequent request to retrieve the next + page of results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListGatewayRateLimitsInput(_SerdeShape): + """Dataclass for ListGatewayRateLimitsInput structure.""" + + gateway_identifier: str | None = ... + """The unique identifier of the gateway.""" + max_results: int | None = ... + """ + The maximum number of results to return in the response. If the total + number of results is greater than this value, use the token returned in + the response in the `nextToken` field when making another request to + return the next batch of results. + """ + next_token: str | None = ... + """ + The token to use to retrieve the next page of results. Use the value + returned in a previous `ListGatewayRateLimits` response. + """ + +@dataclass(kw_only=True) +class ListGatewayRateLimitsOutput(_SerdeShape): + """Dataclass for ListGatewayRateLimitsOutput structure.""" + + rate_limits: list[GatewayRateLimitDetail] + """The list of rate limits for the gateway.""" + next_token: str | None = ... + """ + The token for the next page of results. If this value is absent, there + are no more results to retrieve. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListGatewayRulesInput(_SerdeShape): + """Dataclass for ListGatewayRulesInput structure.""" + + gateway_identifier: str | None = ... + """The identifier of the gateway to list rules for.""" + max_results: int | None = ... + """ + The maximum number of results to return in the response. If the total + number of results is greater than this value, use the token returned in + the response in the `nextToken` field when making another request to + return the next batch of results. + """ + next_token: str | None = ... + """The pagination token from a previous request.""" + +@dataclass(kw_only=True) +class ListGatewayRulesOutput(_SerdeShape): + """Dataclass for ListGatewayRulesOutput structure.""" + + gateway_rules: list[GatewayRuleDetail] + """The list of gateway rules.""" + next_token: str | None = ... + """The pagination token to use in a subsequent request.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListGatewaysInput(_SerdeShape): + """Dataclass for ListGatewaysInput structure.""" + + max_results: int | None = ... + """ + The maximum number of results to return in the response. If the total + number of results is greater than this value, use the token returned in + the response in the `nextToken` field when making another request to + return the next batch of results. + """ + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, enter the token returned in the `nextToken` + field in the response in this field to return the next batch of results. + """ + +@dataclass(kw_only=True) +class ListGatewaysOutput(_SerdeShape): + """Dataclass for ListGatewaysOutput structure.""" + + items: list[GatewaySummary] + """The list of gateway summaries.""" + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, use this token when making another request in + the `nextToken` field to return the next batch of results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListGatewayTargetsInput(_SerdeShape): + """Dataclass for ListGatewayTargetsInput structure.""" + + gateway_identifier: str | None = ... + """The identifier of the gateway to list targets for.""" + max_results: int | None = ... + """ + The maximum number of results to return in the response. If the total + number of results is greater than this value, use the token returned in + the response in the `nextToken` field when making another request to + return the next batch of results. + """ + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, enter the token returned in the `nextToken` + field in the response in this field to return the next batch of results. + """ + +@dataclass(kw_only=True) +class ListGatewayTargetsOutput(_SerdeShape): + """Dataclass for ListGatewayTargetsOutput structure.""" + + items: list[TargetSummary] + """The list of gateway target summaries.""" + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, use this token when making another request in + the `nextToken` field to return the next batch of results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListHarnessEndpointsInput(_SerdeShape): + """Dataclass for ListHarnessEndpointsInput structure.""" + + harness_id: str | None = ... + """The ID of the harness whose endpoints are listed.""" + max_results: int | None = ... + """The maximum number of results to return in a single call.""" + next_token: str | None = ... + """The token for the next set of results.""" + +@dataclass(kw_only=True) +class ListHarnessEndpointsOutput(_SerdeShape): + """Dataclass for ListHarnessEndpointsOutput structure.""" + + endpoints: list[HarnessEndpoint] + """The list of harness endpoints.""" + next_token: str | None = ... + """The token for the next set of results.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListHarnessesInput(_SerdeShape): + """Dataclass for ListHarnessesInput structure.""" + + max_results: int | None = ... + """The maximum number of results to return in a single call.""" + next_token: str | None = ... + """The token for the next set of results.""" + +@dataclass(kw_only=True) +class ListHarnessesOutput(_SerdeShape): + """Dataclass for ListHarnessesOutput structure.""" + + harnesses: list[HarnessSummary] + """The list of harness summaries.""" + next_token: str | None = ... + """The token for the next set of results.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListHarnessVersionsInput(_SerdeShape): + """Dataclass for ListHarnessVersionsInput structure.""" + + harness_id: str | None = ... + """The ID of the harness whose versions are listed.""" + max_results: int | None = ... + """The maximum number of results to return in a single call.""" + next_token: str | None = ... + """The token for the next set of results.""" + +@dataclass(kw_only=True) +class ListHarnessVersionsOutput(_SerdeShape): + """Dataclass for ListHarnessVersionsOutput structure.""" + + harness_versions: list[HarnessVersionSummary] + """The list of harness version summaries.""" + next_token: str | None = ... + """The token for the next set of results.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class ListingMode(UnknownEnumMixin, StrEnum): + DEFAULT = "DEFAULT" + DYNAMIC = "DYNAMIC" + +@dataclass(kw_only=True) +class ListMemoriesInput(_SerdeShape): + """Dataclass for ListMemoriesInput structure.""" + + max_results: int = ... + """ + The maximum number of results to return in a single call. The default + value is 10. The maximum value is 50. + """ + next_token: str | None = ... + """ + The token for the next set of results. Use the value returned in the + previous response in the next request to retrieve the next set of + results. + """ + +@dataclass(kw_only=True) +class ListMemoriesOutput(_SerdeShape): + """Dataclass for ListMemoriesOutput structure.""" + + memories: list[MemorySummary] + """The list of AgentCore Memory resource summaries.""" + next_token: str | None = ... + """A token to retrieve the next page of results.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListOauth2CredentialProvidersInput(_SerdeShape): + """Dataclass for ListOauth2CredentialProvidersInput structure.""" + + next_token: str | None = ... + """Pagination token.""" + max_results: int = ... + """Maximum number of results to return.""" + +@dataclass(kw_only=True) +class ListOauth2CredentialProvidersOutput(_SerdeShape): + """Dataclass for ListOauth2CredentialProvidersOutput structure.""" + + credential_providers: list[Oauth2CredentialProviderItem] + """The list of OAuth2 credential providers.""" + next_token: str | None = ... + """Pagination token for the next page of results.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListOnlineEvaluationConfigsInput(_SerdeShape): + """Dataclass for ListOnlineEvaluationConfigsInput structure.""" + + next_token: str | None = ... + """ + The pagination token from a previous request to retrieve the next page + of results. + """ + max_results: int | None = ... + """ + The maximum number of online evaluation configurations to return in a + single response. + """ + +@dataclass(kw_only=True) +class ListOnlineEvaluationConfigsOutput(_SerdeShape): + """Dataclass for ListOnlineEvaluationConfigsOutput structure.""" + + online_evaluation_configs: list[OnlineEvaluationConfigSummary] + """ + The list of online evaluation configuration summaries containing basic + information about each configuration. + """ + next_token: str | None = ... + """ + The pagination token to use in a subsequent request to retrieve the next + page of results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListPaymentConnectorsInput(_SerdeShape): + """Dataclass for ListPaymentConnectorsInput structure.""" + + payment_manager_id: str | None = ... + """The unique identifier of the payment manager whose connectors to list.""" + max_results: int | None = ... + """ + The maximum number of results to return in the response. If the total + number of results is greater than this value, use the token returned in + the response in the `nextToken` field when making another request to + return the next batch of results. + """ + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, enter the token returned in the `nextToken` + field in the response in this field to return the next batch of results. + """ + +@dataclass(kw_only=True) +class ListPaymentConnectorsOutput(_SerdeShape): + """Dataclass for ListPaymentConnectorsOutput structure.""" + + payment_connectors: list[PaymentConnectorSummary] + """ + The list of payment connector summaries. For details about the fields in + each summary, see the `PaymentConnectorSummary` data type. + """ + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, use this token when making another request in + the `nextToken` field to return the next batch of results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListPaymentCredentialProvidersInput(_SerdeShape): + """Dataclass for ListPaymentCredentialProvidersInput structure.""" + + next_token: str | None = ... + """Pagination token.""" + max_results: int = ... + """Maximum number of results to return.""" + +@dataclass(kw_only=True) +class ListPaymentCredentialProvidersOutput(_SerdeShape): + """Dataclass for ListPaymentCredentialProvidersOutput structure.""" + + credential_providers: list[PaymentCredentialProviderItem] + """The list of payment credential providers.""" + next_token: str | None = ... + """Pagination token for the next page of results.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListPaymentManagersInput(_SerdeShape): + """Dataclass for ListPaymentManagersInput structure.""" + + max_results: int | None = ... + """ + The maximum number of results to return in the response. If the total + number of results is greater than this value, use the token returned in + the response in the `nextToken` field when making another request to + return the next batch of results. + """ + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, enter the token returned in the `nextToken` + field in the response in this field to return the next batch of results. + """ + +@dataclass(kw_only=True) +class ListPaymentManagersOutput(_SerdeShape): + """Dataclass for ListPaymentManagersOutput structure.""" + + payment_managers: list[PaymentManagerSummary] + """ + The list of payment manager summaries. For details about the fields in + each summary, see the `PaymentManagerSummary` data type. + """ + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, use this token when making another request in + the `nextToken` field to return the next batch of results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListPoliciesInput(_SerdeShape): + """Dataclass for ListPoliciesInput structure.""" + + next_token: str | None = ... + """ + A pagination token returned from a previous + [ListPolicies](https://docs.aws.amazon.com/bedrock-agentcore-control/latest/APIReference/API_ListPolicies.html) + call. Use this token to retrieve the next page of results when the + response is paginated. + """ + max_results: int | None = ... + """ + The maximum number of policies to return in a single response. If not + specified, the default is 10 policies per page, with a maximum of 100 + per page. + """ + policy_engine_id: str | None = ... + """The identifier of the policy engine whose policies to retrieve.""" + target_resource_scope: str | None = ... + """ + Optional filter to list policies that apply to a specific resource scope + or resource type. This helps narrow down policy results to those + relevant for particular Amazon Web Services resources, agent tools, or + operational contexts within the policy engine ecosystem. + """ + +@dataclass(kw_only=True) +class ListPoliciesOutput(_SerdeShape): + """Dataclass for ListPoliciesOutput structure.""" + + policies: list[Policy] + """ + An array of policy objects that match the specified criteria. Each + policy object contains the policy metadata, status, and key identifiers + for further operations. + """ + next_token: str | None = ... + """ + A pagination token that can be used in subsequent ListPolicies calls to + retrieve additional results. This token is only present when there are + more results available. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListPolicyEnginesInput(_SerdeShape): + """Dataclass for ListPolicyEnginesInput structure.""" + + next_token: str | None = ... + """ + A pagination token returned from a previous + [ListPolicyEngines](https://docs.aws.amazon.com/bedrock-agentcore-control/latest/APIReference/API_ListPolicyEngines.html) + call. Use this token to retrieve the next page of results when the + response is paginated. + """ + max_results: int | None = ... + """ + The maximum number of policy engines to return in a single response. If + not specified, the default is 10 policy engines per page, with a maximum + of 100 per page. + """ + +@dataclass(kw_only=True) +class ListPolicyEnginesOutput(_SerdeShape): + """Dataclass for ListPolicyEnginesOutput structure.""" + + policy_engines: list[PolicyEngine] + """ + An array of policy engine objects that exist in the account. Each policy + engine object contains the engine metadata, status, and key identifiers + for further operations. + """ + next_token: str | None = ... + """ + A pagination token that can be used in subsequent + [ListPolicyEngines](https://docs.aws.amazon.com/bedrock-agentcore-control/latest/APIReference/API_ListPolicyEngines.html) + calls to retrieve additional results. This token is only present when + there are more results available. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListPolicyEngineSummariesInput(_SerdeShape): + """Dataclass for ListPolicyEngineSummariesInput structure.""" + + next_token: str | None = ... + """ + A pagination token returned from a previous + [ListPolicyEngineSummaries](https://docs.aws.amazon.com/bedrock-agentcore-control/latest/APIReference/API_ListPolicyEngineSummaries.html) + call. Use this token to retrieve the next page of results when the + response is paginated. + """ + max_results: int | None = ... + """ + The maximum number of policy engine summaries to return in a single + response. + """ + +@dataclass(kw_only=True) +class ListPolicyEngineSummariesOutput(_SerdeShape): + """Dataclass for ListPolicyEngineSummariesOutput structure.""" + + policy_engines: list[PolicyEngineSummary] + """ + An array of policy engine summary objects that exist in the account. + Each summary contains resource identifiers, status, and timestamps + without customer-encrypted content. + """ + next_token: str | None = ... + """ + A pagination token that can be used in subsequent + [ListPolicyEngineSummaries](https://docs.aws.amazon.com/bedrock-agentcore-control/latest/APIReference/API_ListPolicyEngineSummaries.html) + calls to retrieve additional results. This token is only present when + there are more results available. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListPolicyGenerationAssetsInput(_SerdeShape): + """Dataclass for ListPolicyGenerationAssetsInput structure.""" + + policy_generation_id: str | None = ... + """ + The unique identifier of the policy generation request whose assets are + to be retrieved. This must be a valid generation ID from a previous + [StartPolicyGeneration](https://docs.aws.amazon.com/bedrock-agentcore-control/latest/APIReference/API_StartPolicyGeneration.html) + call that has completed processing. + """ + policy_engine_id: str | None = ... + """ + The unique identifier of the policy engine associated with the policy + generation request. This provides the context for the generation + operation and ensures assets are retrieved from the correct policy + engine. + """ + next_token: str | None = ... + """ + A pagination token returned from a previous + [ListPolicyGenerationAssets](https://docs.aws.amazon.com/bedrock-agentcore-control/latest/APIReference/API_ListPolicyGenerationAssets.html) + call. Use this token to retrieve the next page of assets when the + response is paginated due to large numbers of generated policy options. + """ + max_results: int | None = ... + """ + The maximum number of policy generation assets to return in a single + response. If not specified, the default is 10 assets per page, with a + maximum of 100 per page. This helps control response size when dealing + with policy generations that produce many alternative policy options. + """ + +@dataclass(kw_only=True) +class ListPolicyGenerationAssetsOutput(_SerdeShape): + """Dataclass for ListPolicyGenerationAssetsOutput structure.""" + + policy_generation_assets: list[PolicyGenerationAsset] | None = ... + """ + An array of generated policy assets including Dogwood policies and + related artifacts from the AI-powered policy generation process. Each + asset represents a different policy option or variation generated from + the original natural language input. + """ + next_token: str | None = ... + """ + A pagination token that can be used in subsequent + [ListPolicyGenerationAssets](https://docs.aws.amazon.com/bedrock-agentcore-control/latest/APIReference/API_ListPolicyGenerationAssets.html) + calls to retrieve additional assets. This token is only present when + there are more generated policy assets available beyond the current + response. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListPolicyGenerationsInput(_SerdeShape): + """Dataclass for ListPolicyGenerationsInput structure.""" + + next_token: str | None = ... + """ + A pagination token for retrieving additional policy generations when + results are paginated. + """ + max_results: int | None = ... + """The maximum number of policy generations to return in a single response.""" + policy_engine_id: str | None = ... + """ + The identifier of the policy engine whose policy generations to + retrieve. + """ + +@dataclass(kw_only=True) +class ListPolicyGenerationsOutput(_SerdeShape): + """Dataclass for ListPolicyGenerationsOutput structure.""" + + policy_generations: list[PolicyGeneration] + """An array of policy generation objects that match the specified criteria.""" + next_token: str | None = ... + """ + A pagination token for retrieving additional policy generations if more + results are available. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListPolicyGenerationSummariesInput(_SerdeShape): + """Dataclass for ListPolicyGenerationSummariesInput structure.""" + + next_token: str | None = ... + """ + A pagination token returned from a previous + [ListPolicyGenerationSummaries](https://docs.aws.amazon.com/bedrock-agentcore-control/latest/APIReference/API_ListPolicyGenerationSummaries.html) + call. Use this token to retrieve the next page of results when the + response is paginated. + """ + max_results: int | None = ... + """ + The maximum number of policy generation summaries to return in a single + response. + """ + policy_engine_id: str | None = ... + """ + The identifier of the policy engine whose policy generation summaries to + retrieve. + """ + +@dataclass(kw_only=True) +class ListPolicyGenerationSummariesOutput(_SerdeShape): + """Dataclass for ListPolicyGenerationSummariesOutput structure.""" + + policy_generations: list[PolicyGenerationSummary] + """ + An array of policy generation summary objects that match the specified + criteria. Each summary contains resource identifiers, status, + timestamps, and findings without customer-encrypted content. + """ + next_token: str | None = ... + """ + A pagination token that can be used in subsequent + [ListPolicyGenerationSummaries](https://docs.aws.amazon.com/bedrock-agentcore-control/latest/APIReference/API_ListPolicyGenerationSummaries.html) + calls to retrieve additional results. This token is only present when + there are more results available. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListPolicySummariesInput(_SerdeShape): + """Dataclass for ListPolicySummariesInput structure.""" + + next_token: str | None = ... + """ + A pagination token returned from a previous + [ListPolicySummaries](https://docs.aws.amazon.com/bedrock-agentcore-control/latest/APIReference/API_ListPolicySummaries.html) + call. Use this token to retrieve the next page of results when the + response is paginated. + """ + max_results: int | None = ... + """The maximum number of policy summaries to return in a single response.""" + policy_engine_id: str | None = ... + """The identifier of the policy engine whose policy summaries to retrieve.""" + target_resource_scope: str | None = ... + """ + Optional filter to list policy summaries that apply to a specific + resource scope or resource type. This helps narrow down results to those + relevant for particular Amazon Web Services resources, agent tools, or + operational contexts within the policy engine ecosystem. + """ + +@dataclass(kw_only=True) +class ListPolicySummariesOutput(_SerdeShape): + """Dataclass for ListPolicySummariesOutput structure.""" + + policies: list[PolicySummary] + """ + An array of policy summary objects that match the specified criteria. + Each summary contains resource identifiers, status, and timestamps + without customer-encrypted content. + """ + next_token: str | None = ... + """ + A pagination token that can be used in subsequent + [ListPolicySummaries](https://docs.aws.amazon.com/bedrock-agentcore-control/latest/APIReference/API_ListPolicySummaries.html) + calls to retrieve additional results. This token is only present when + there are more results available. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListRegistriesInput(_SerdeShape): + """Dataclass for ListRegistriesInput structure.""" + + max_results: int | None = ... + """ + The maximum number of results to return in the response. If the total + number of results is greater than this value, use the token returned in + the response in the `nextToken` field when making another request to + return the next batch of results. + """ + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, enter the token returned in the `nextToken` + field in the response in this field to return the next batch of results. + """ + status: str | None = ... + """ + Filter registries by their current status. Possible values include + `CREATING`, `READY`, `UPDATING`, `CREATE_FAILED`, `UPDATE_FAILED`, + `DELETING`, and `DELETE_FAILED`. + """ + authorizer_type: str | None = ... + """ + Filter registries by their authorizer type. Possible values are + `CUSTOM_JWT` and `AWS_IAM`. For more information about authorizer types, + see the `RegistryAuthorizerType` enum. + """ + +@dataclass(kw_only=True) +class ListRegistriesOutput(_SerdeShape): + """Dataclass for ListRegistriesOutput structure.""" + + registries: list[RegistrySummary] + """ + The list of registry summaries. For details about the fields in each + summary, see the `RegistrySummary` data type. + """ + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, use this token when making another request in + the `nextToken` field to return the next batch of results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListRegistryRecordsInput(_SerdeShape): + """Dataclass for ListRegistryRecordsInput structure.""" + + registry_id: str | None = ... + """ + The identifier of the registry to list records from. You can specify + either the Amazon Resource Name (ARN) or the ID of the registry. + """ + max_results: int | None = ... + """ + The maximum number of results to return in the response. If the total + number of results is greater than this value, use the token returned in + the response in the `nextToken` field when making another request to + return the next batch of results. + """ + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, enter the token returned in the `nextToken` + field in the response in this field to return the next batch of results. + """ + name: str | None = ... + """Filter registry records by name.""" + status: str | None = ... + """ + Filter registry records by their current status. Possible values include + `CREATING`, `DRAFT`, `APPROVED`, `PENDING_APPROVAL`, `REJECTED`, + `DEPRECATED`, `UPDATING`, `CREATE_FAILED`, and `UPDATE_FAILED`. + """ + descriptor_type: str | None = ... + """ + Filter registry records by their descriptor type. Possible values are + `MCP`, `A2A`, `CUSTOM`, and `AGENT_SKILLS`. + """ + +@dataclass(kw_only=True) +class ListRegistryRecordsOutput(_SerdeShape): + """Dataclass for ListRegistryRecordsOutput structure.""" + + registry_records: list[RegistryRecordSummary] + """ + The list of registry record summaries. For details about the fields in + each summary, see the `RegistryRecordSummary` data type. + """ + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, use this token when making another request in + the `nextToken` field to return the next batch of results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListTagsForResourceInput(_SerdeShape): + """Dataclass for ListTagsForResourceInput structure.""" + + resource_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the resource for which you want to + list tags. + """ + +@dataclass(kw_only=True) +class ListTagsForResourceOutput(_SerdeShape): + """Dataclass for ListTagsForResourceOutput structure.""" + + tags: dict[str, str] | None = ... + """The tags associated with the resource.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListWorkloadIdentitiesInput(_SerdeShape): + """Dataclass for ListWorkloadIdentitiesInput structure.""" + + next_token: str | None = ... + """Pagination token.""" + max_results: int = ... + """Maximum number of results to return.""" + +@dataclass(kw_only=True) +class ListWorkloadIdentitiesOutput(_SerdeShape): + """Dataclass for ListWorkloadIdentitiesOutput structure.""" + + workload_identities: list[WorkloadIdentityType] + """The list of workload identities.""" + next_token: str | None = ... + """Pagination token for the next page of results.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class LlmAsAJudgeEvaluatorConfig(_SerdeShape): + """ + The configuration for LLM-as-a-Judge evaluation that uses a language + model to assess agent performance based on custom instructions and + rating scales. + """ + + instructions: str + """ + The evaluation instructions that guide the language model in assessing + agent performance, including criteria and evaluation guidelines. + """ + rating_scale: RatingScale + """ + The rating scale that defines how the evaluator should score agent + performance, either numerical or categorical. + """ + model_config: EvaluatorModelConfig + """ + The model configuration that specifies which foundation model to use and + how to configure it for evaluation. + """ + +@dataclass(kw_only=True) +class LlmExtractionConfig(_SerdeShape): + """Model-based metadata extraction configuration.""" + + llm_extraction_instruction: str | None = ... + """ + Instructions for extraction. Supports built-in operators like + LATEST_VALUE or custom natural-language instructions. + """ + definition: str + """Description of what this metadata field represents.""" + validation: Validation | None = ... + """Validation rules to constrain extracted values.""" + +@dataclass(kw_only=True) +class ManagedResourceDetails(_SerdeShape): + """ + Details of a resource created and managed by the gateway for private + endpoint connectivity. + """ + + domain: str | None = ... + """The domain associated with this managed resource.""" + resource_gateway_arn: str | None = ... + """The ARN of the VPC Lattice resource gateway created in your account.""" + resource_association_arn: str | None = ... + """The ARN of the service network resource association.""" + +@dataclass(kw_only=True) +class ManagedVpcResource(_SerdeShape): + """ + Configuration for a managed VPC Lattice resource. The gateway creates + and manages the VPC Lattice resource gateway and resource configuration + on your behalf using a service-linked role. + """ + + vpc_identifier: str + """The ID of the VPC that contains your private resource.""" + subnet_ids: list[str] + """ + The subnet IDs within the VPC where the VPC Lattice resource gateway is + placed. + """ + endpoint_ip_address_type: str + """The IP address type for the resource configuration endpoint.""" + security_group_ids: list[str] | None = ... + """ + The security group IDs to associate with the VPC Lattice resource + gateway. If not specified, the default security group for the VPC is + used. + """ + tags: dict[str, str] | None = ... + """Tags to apply to the managed VPC Lattice resource gateway.""" + routing_domain: str | None = ... + """ + An intermediate domain to use as the resource configuration endpoint + instead of the actual target domain. Use this when you want to route + traffic through an intermediate component such as a VPC endpoint or + internal load balancer. For more information, see + xref:lattice-vpc-egress-routing-domain[Route traffic through an + intermediate domain]. + """ + +@dataclass(kw_only=True) +class MatchPaths(_SerdeShape): + """A condition that matches requests based on the request path.""" + + any_of: list[str] + """ + A list of path patterns. The condition is met if the request path + matches any of the patterns. + """ + +@dataclass +class MatchPrincipalEntryIamPrincipal(_SerdeShape): + """An IAM principal to match against, specified by ARN.""" + + value: IamPrincipal + +@dataclass +class MatchPrincipalEntryUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +MatchPrincipalEntry = Union[ + MatchPrincipalEntryIamPrincipal | MatchPrincipalEntryUnknown +] +""" +Union for principal matching. Currently supports IAM principal ARN glob +matching. +""" + +class _MatchPrincipalEntryDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> MatchPrincipalEntry: ... + +@dataclass(kw_only=True) +class MatchPrincipals(_SerdeShape): + """A condition that matches requests based on the caller's identity.""" + + any_of: list[MatchPrincipalEntry] + """ + A list of principal entries. The condition is met if any of the entries + match the caller's identity. + """ + +@dataclass(kw_only=True) +class McpDescriptor(_SerdeShape): + """ + The Model Context Protocol (MCP) descriptor for a registry record. + Contains the server definition and tools definition for an + MCP-compatible server. The schema is validated against the MCP protocol + specification. + """ + + server: ServerDefinition | None = ... + """ + The MCP server definition, containing the server configuration and + schema as defined by the MCP protocol specification. + """ + tools: ToolsDefinition | None = ... + """ + The MCP tools definition, containing the tools available on the MCP + server as defined by the MCP protocol specification. + """ + +@dataclass(kw_only=True) +class MCPGatewayConfiguration(_SerdeShape): + """ + The configuration for a Model Context Protocol (MCP) gateway. This + structure defines how the gateway implements the MCP protocol. + """ + + supported_versions: list[str] | None = ... + """ + The supported versions of the Model Context Protocol. This field + specifies which versions of the protocol the gateway can use. + """ + instructions: str | None = ... + """ + The instructions for using the Model Context Protocol gateway. These + instructions provide guidance on how to interact with the gateway. + """ + search_type: str | None = ... + """ + The search type for the Model Context Protocol gateway. This field + specifies how the gateway handles search operations. + """ + session_configuration: SessionConfiguration | None = ... + """ + The session configuration for the MCP gateway. This configuration + controls session behavior, including session timeout settings. + """ + streaming_configuration: StreamingConfiguration | None = ... + """ + The streaming configuration for the MCP gateway. This configuration + controls whether response streaming is enabled for the gateway. + """ + disable_mcp_list_tools_pagination: bool | None = ... + """ + Specifies whether pagination is disabled for the Model Context Protocol + (MCP) `tools/list` operation. When set to `true`, the gateway returns + the complete list of tools in a single response without a pagination + cursor. When set to `false` or omitted, the gateway returns tools in + paginated responses. + """ + +@dataclass(kw_only=True) +class McpLambdaTargetConfiguration(_SerdeShape): + """ + The Lambda configuration for a Model Context Protocol target. This + structure defines how the gateway uses a Lambda function to communicate + with the target. + """ + + lambda_arn: str + """ + The Amazon Resource Name (ARN) of the Lambda function. This function is + invoked by the gateway to communicate with the target. + """ + tool_schema: ToolSchema + """ + The tool schema for the Lambda function. This schema defines the + structure of the tools that the Lambda function provides. + """ + +@dataclass(kw_only=True) +class McpServerTargetConfiguration(_SerdeShape): + """The target configuration for the MCP server.""" + + endpoint: str + """The endpoint for the MCP server target configuration.""" + mcp_tool_schema: McpToolSchemaConfiguration | None = ... + """ + A static tool list for the MCP server target. It is supported for all + credential providers. Dynamic tool discovery/synchronization will be + disabled when a target is configured with mcpToolSchema. + """ + listing_mode: str | None = ... + """ + The listing mode for the MCP server target configuration. MCP resources + for default targets are cached at the control plane for faster access. + MCP resources for dynamic targets will be dynamically retrieved when + listing tools. + """ + resource_priority: int | None = ... + """ + Priority for resolving MCP server targets with shared resource URIs. + Lower values take precedence. Defaults to 1000 when not set. + """ + +@dataclass +class McpTargetConfigurationOpenApiSchema(_SerdeShape): + """ + The OpenAPI schema for the Model Context Protocol target. This schema + defines the API structure of the target. + """ + + value: ApiSchemaConfiguration + +@dataclass +class McpTargetConfigurationSmithyModel(_SerdeShape): + """ + The Smithy model for the Model Context Protocol target. This model + defines the API structure of the target using the Smithy specification. + """ + + value: ApiSchemaConfiguration + +@dataclass +class McpTargetConfigurationLambda(_SerdeShape): + """ + The Lambda configuration for the Model Context Protocol target. This + configuration defines how the gateway uses a Lambda function to + communicate with the target. + """ + + value: McpLambdaTargetConfiguration + +@dataclass +class McpTargetConfigurationMcpServer(_SerdeShape): + """The MCP server specified as the gateway target.""" + + value: McpServerTargetConfiguration + +@dataclass +class McpTargetConfigurationApiGateway(_SerdeShape): + """The configuration for an Amazon API Gateway target.""" + + value: ApiGatewayTargetConfiguration + +@dataclass +class McpTargetConfigurationConnector(_SerdeShape): + """ + The connector integration configuration for the Model Context Protocol + target. This configuration defines how the gateway uses a pre-built + connector to communicate with the target. + """ + + value: ConnectorTargetConfiguration + +@dataclass +class McpTargetConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +McpTargetConfiguration = Union[ + McpTargetConfigurationOpenApiSchema + | McpTargetConfigurationSmithyModel + | McpTargetConfigurationLambda + | McpTargetConfigurationMcpServer + | McpTargetConfigurationApiGateway + | McpTargetConfigurationConnector + | McpTargetConfigurationUnknown +] +""" +The Model Context Protocol (MCP) configuration for a target. This +structure defines how the gateway uses MCP to communicate with the +target. +""" + +class _McpTargetConfigurationDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> McpTargetConfiguration: ... + +@dataclass +class McpToolSchemaConfigurationS3(_SerdeShape): + """ + The Amazon S3 location of the tool schema. This location contains the + schema definition file. + """ + + value: S3Configuration + +@dataclass +class McpToolSchemaConfigurationInlinePayload(_SerdeShape): + """The inline payload containing the MCP tool schema definition.""" + + value: str + +@dataclass +class McpToolSchemaConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +McpToolSchemaConfiguration = Union[ + McpToolSchemaConfigurationS3 + | McpToolSchemaConfigurationInlinePayload + | McpToolSchemaConfigurationUnknown +] +""" +The MCP tool schema configuration for an MCP server target. The tool +schema must be aligned with the MCP specification. +""" + +class _McpToolSchemaConfigurationDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> McpToolSchemaConfiguration: ... + +@dataclass(kw_only=True) +class Memory(_SerdeShape): + """Contains information about a memory resource.""" + + arn: str + """The Amazon Resource Name (ARN) of the memory.""" + id: str + """The unique identifier of the memory.""" + name: str + """The name of the memory.""" + description: str | None = ... + """The description of the memory.""" + encryption_key_arn: str | None = ... + """The ARN of the KMS key used to encrypt the memory.""" + memory_execution_role_arn: str | None = ... + """The ARN of the IAM role that provides permissions for the memory.""" + event_expiry_duration: int + """The number of days after which memory events will expire.""" + status: str + """The current status of the memory.""" + failure_reason: str | None = ... + """The reason for failure if the memory is in a failed state.""" + created_at: datetime + """The timestamp when the memory was created.""" + updated_at: datetime + """The timestamp when the memory was last updated.""" + strategies: list[MemoryStrategy] | None = ... + """The list of memory strategies associated with this memory.""" + indexed_keys: list[IndexedKey] | None = ... + """ + The indexed metadata keys for this memory. Only indexed keys can be used + in metadata filters. + """ + namespace_keys: list[NamespaceKeyEntry] | None = ... + """ + The namespace variable key definitions for this memory. Namespace keys + define custom variables used in `namespaceTemplates` with optional + validation rules. + """ + stream_delivery_resources: StreamDeliveryResources | None = ... + """Configuration for streaming memory record data to external resources.""" + managed_by_resource_arn: str | None = ... + """ + ARN of the resource managing this memory (e.g. a harness). When set, + strategy modifications and deletion are only allowed through the + managing resource. + """ + +@dataclass(kw_only=True) +class MemoryRecordSchema(_SerdeShape): + """Schema for metadata on memory records generated by a strategy.""" + + metadata_schema: list[MetadataSchemaEntry] | None = ... + """The metadata field definitions for this strategy.""" + +class MemoryStatus(UnknownEnumMixin, StrEnum): + CREATING = "CREATING" + ACTIVE = "ACTIVE" + FAILED = "FAILED" + DELETING = "DELETING" + UPDATING = "UPDATING" + +@dataclass(kw_only=True) +class MemoryStrategy(_SerdeShape): + """Contains information about a memory strategy.""" + + strategy_id: str + """The unique identifier of the memory strategy.""" + name: str + """The name of the memory strategy.""" + description: str | None = ... + """The description of the memory strategy.""" + configuration: StrategyConfiguration | None = ... + """The configuration of the memory strategy.""" + type: str + """The type of the memory strategy.""" + namespaces: list[str] + """ + This is a legacy parameter. The namespaces associated with the memory + strategy. + """ + namespace_templates: list[str] + """The namespaceTemplates associated with the memory strategy.""" + created_at: datetime | None = ... + """The timestamp when the memory strategy was created.""" + updated_at: datetime | None = ... + """The timestamp when the memory strategy was last updated.""" + status: str | None = ... + """The current status of the memory strategy.""" + memory_record_schema: MemoryRecordSchema | None = ... + """Schema for metadata fields on records generated by this strategy.""" + +@dataclass +class MemoryStrategyInputSemanticMemoryStrategy(_SerdeShape): + """Input for creating a semantic memory strategy.""" + + value: SemanticMemoryStrategyInput + +@dataclass +class MemoryStrategyInputSummaryMemoryStrategy(_SerdeShape): + """Input for creating a summary memory strategy.""" + + value: SummaryMemoryStrategyInput + +@dataclass +class MemoryStrategyInputUserPreferenceMemoryStrategy(_SerdeShape): + """Input for creating a user preference memory strategy.""" + + value: UserPreferenceMemoryStrategyInput + +@dataclass +class MemoryStrategyInputCustomMemoryStrategy(_SerdeShape): + """Input for creating a custom memory strategy.""" + + value: CustomMemoryStrategyInput + +@dataclass +class MemoryStrategyInputEpisodicMemoryStrategy(_SerdeShape): + """Input for creating an episodic memory strategy""" + + value: EpisodicMemoryStrategyInput + +@dataclass +class MemoryStrategyInputUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +MemoryStrategyInput = Union[ + MemoryStrategyInputSemanticMemoryStrategy + | MemoryStrategyInputSummaryMemoryStrategy + | MemoryStrategyInputUserPreferenceMemoryStrategy + | MemoryStrategyInputCustomMemoryStrategy + | MemoryStrategyInputEpisodicMemoryStrategy + | MemoryStrategyInputUnknown +] +"""Contains input information for creating a memory strategy.""" + +class _MemoryStrategyInputDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> MemoryStrategyInput: ... + +class MemoryStrategyStatus(UnknownEnumMixin, StrEnum): + CREATING = "CREATING" + ACTIVE = "ACTIVE" + DELETING = "DELETING" + FAILED = "FAILED" + +class MemoryStrategyType(UnknownEnumMixin, StrEnum): + SEMANTIC = "SEMANTIC" + SUMMARIZATION = "SUMMARIZATION" + USER_PREFERENCE = "USER_PREFERENCE" + CUSTOM = "CUSTOM" + EPISODIC = "EPISODIC" + +@dataclass(kw_only=True) +class MemorySummary(_SerdeShape): + """Contains summary information about a memory resource.""" + + arn: str | None = ... + """The Amazon Resource Name (ARN) of the memory.""" + id: str | None = ... + """The unique identifier of the memory.""" + status: str | None = ... + """The current status of the memory.""" + created_at: datetime + """The timestamp when the memory was created.""" + updated_at: datetime + """The timestamp when the memory was last updated.""" + managed_by_resource_arn: str | None = ... + """ + ARN of the resource managing this memory (e.g. a harness). Null if not + managed. + """ + +class MemoryView(UnknownEnumMixin, StrEnum): + FULL = "full" + WITHOUT_DECRYPTION = "without_decryption" + +@dataclass(kw_only=True) +class MessageBasedTrigger(_SerdeShape): + """The trigger configuration based on a message.""" + + message_count: int | None = ... + """The number of messages that trigger memory processing.""" + +@dataclass(kw_only=True) +class MessageBasedTriggerInput(_SerdeShape): + """The trigger configuration based on a message.""" + + message_count: int = ... + """The number of messages that trigger memory processing.""" + +@dataclass(kw_only=True) +class MetadataConfiguration(_SerdeShape): + """ + Configuration for HTTP header and query parameter propagation between + the gateway and target servers. + """ + + allowed_request_headers: list[str] | None = ... + """ + A list of HTTP headers that are allowed to be propagated from incoming + client requests to the target. + """ + allowed_query_parameters: list[str] | None = ... + """ + A list of URL query parameters that are allowed to be propagated from + incoming gateway URL to the target. + """ + allowed_response_headers: list[str] | None = ... + """ + A list of HTTP headers that are allowed to be propagated from the target + response back to the client. + """ + +@dataclass(kw_only=True) +class MetadataSchemaEntry(_SerdeShape): + """A metadata field definition within a strategy's schema.""" + + key: str + """ + The metadata field name. Must match an indexed key to be queryable via + metadata filters. + """ + type: str | None = ... + """The MetadataValueType.""" + extraction_type: str | None = ... + """ + Specifies whether the metadata value is extracted by the LLM or passed + through deterministically from the event. + """ + extraction_config: ExtractionConfig | None = ... + """ + Configuration for extracting this metadata value from conversational + content. Applicable only if extractionType is LLM inferred. + """ + +class MetadataValueType(UnknownEnumMixin, StrEnum): + STRING = "STRING" + STRINGLIST = "STRINGLIST" + NUMBER = "NUMBER" + +@dataclass(kw_only=True) +class MicrosoftOauth2ProviderConfigInput(_SerdeShape): + """Input configuration for a Microsoft OAuth2 provider.""" + + client_id: str + """The client ID for the Microsoft OAuth2 provider.""" + client_secret: str = ... + """The client secret for the Microsoft OAuth2 provider.""" + client_secret_config: SecretReference | None = ... + """ + A reference to the Amazon Web Services Secrets Manager secret that + stores the client secret. This includes the secret ID and the JSON key + used to extract the client secret value from the secret. Required when + `clientSecretSource` is set to `EXTERNAL`. + """ + client_secret_source: str | None = ... + """ + The source type of the client secret. Use `MANAGED` if the secret is + managed by the service, or `EXTERNAL` if you manage the secret yourself + in Amazon Web Services Secrets Manager. + """ + tenant_id: str | None = ... + """ + The Microsoft Entra ID (formerly Azure AD) tenant ID for your + organization. This identifies the specific tenant within Microsoft's + identity platform where your application is registered. + """ + +@dataclass(kw_only=True) +class MicrosoftOauth2ProviderConfigOutput(_SerdeShape): + """Output configuration for a Microsoft OAuth2 provider.""" + + oauth_discovery: Oauth2Discovery + """The OAuth2 discovery information for the Microsoft provider.""" + client_id: str | None = ... + """The client ID for the Microsoft OAuth2 provider.""" + +@dataclass(kw_only=True) +class ModelEntry(_SerdeShape): + """ + A model entry that specifies a model supported for an inference + operation. + """ + + model: str + """ + The model ID or glob pattern that identifies the model (for example, + `anthropic.claude-opus-*` or `openai.gpt-oss-*`). + """ + +@dataclass(kw_only=True) +class ModelMapping(_SerdeShape): + """ + The configuration that translates model IDs between client-facing names + and provider model IDs. + """ + + provider_prefix: ProviderPrefix | None = ... + """The provider prefix configuration used for model ID translation.""" + +@dataclass +class ModifyConsolidationConfigurationCustomConsolidationConfiguration(_SerdeShape): + """The updated custom consolidation configuration.""" + + value: CustomConsolidationConfigurationInput + +@dataclass +class ModifyConsolidationConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ModifyConsolidationConfiguration = Union[ + ModifyConsolidationConfigurationCustomConsolidationConfiguration + | ModifyConsolidationConfigurationUnknown +] +"""Contains information for modifying a consolidation configuration.""" + +class _ModifyConsolidationConfigurationDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> ModifyConsolidationConfiguration: ... + +@dataclass +class ModifyExtractionConfigurationCustomExtractionConfiguration(_SerdeShape): + """The updated custom extraction configuration.""" + + value: CustomExtractionConfigurationInput + +@dataclass +class ModifyExtractionConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ModifyExtractionConfiguration = Union[ + ModifyExtractionConfigurationCustomExtractionConfiguration + | ModifyExtractionConfigurationUnknown +] +"""Contains information for modifying an extraction configuration.""" + +class _ModifyExtractionConfigurationDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> ModifyExtractionConfiguration: ... + +@dataclass(kw_only=True) +class ModifyInvocationConfigurationInput(_SerdeShape): + """The configuration for updating invocation settings.""" + + topic_arn: str | None = ... + """The updated ARN of the SNS topic for job notifications.""" + payload_delivery_bucket_name: str | None = ... + """The updated S3 bucket name for event payload delivery.""" + +@dataclass(kw_only=True) +class ModifyMemoryStrategies(_SerdeShape): + """Contains information for modifying memory strategies.""" + + add_memory_strategies: list[MemoryStrategyInput] | None = ... + """The list of memory strategies to add.""" + modify_memory_strategies: list[ModifyMemoryStrategyInput] | None = ... + """The list of memory strategies to modify.""" + delete_memory_strategies: list[DeleteMemoryStrategyInput] | None = ... + """The list of memory strategies to delete.""" + +@dataclass(kw_only=True) +class ModifyMemoryStrategyInput(_SerdeShape): + """Input for modifying a memory strategy.""" + + memory_strategy_id: str + """The unique identifier of the memory strategy to modify.""" + description: str | None = ... + """The updated description of the memory strategy.""" + namespaces: list[str] | None = ... + """ + This is a legacy parameter, use `namespaceTemplates`. The updated + namespaces for the memory strategy. + """ + namespace_templates: list[str] | None = ... + """The updated namespaceTemplates for the memory strategy.""" + configuration: ModifyStrategyConfiguration | None = ... + """The updated configuration for the memory strategy.""" + memory_record_schema: MemoryRecordSchema | None = ... + """Updated metadata schema for records generated by this strategy.""" + +@dataclass +class ModifyReflectionConfigurationEpisodicReflectionConfiguration(_SerdeShape): + """The updated episodic reflection configuration.""" + + value: EpisodicReflectionConfigurationInput + +@dataclass +class ModifyReflectionConfigurationCustomReflectionConfiguration(_SerdeShape): + """The updated custom reflection configuration.""" + + value: CustomReflectionConfigurationInput + +@dataclass +class ModifyReflectionConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ModifyReflectionConfiguration = Union[ + ModifyReflectionConfigurationEpisodicReflectionConfiguration + | ModifyReflectionConfigurationCustomReflectionConfiguration + | ModifyReflectionConfigurationUnknown +] +"""Contains information for modifying a reflection configuration.""" + +class _ModifyReflectionConfigurationDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> ModifyReflectionConfiguration: ... + +@dataclass(kw_only=True) +class ModifySelfManagedConfiguration(_SerdeShape): + """The configuration for updating the self-managed memory strategy.""" + + trigger_conditions: list[TriggerConditionInput] | None = ... + """The updated list of conditions that trigger memory processing.""" + invocation_configuration: ModifyInvocationConfigurationInput | None = ... + """ + The updated configuration to invoke self-managed memory processing + pipeline. + """ + historical_context_window_size: int | None = ... + """ + The updated number of historical messages to include in processing + context. + """ + +@dataclass(kw_only=True) +class ModifyStrategyConfiguration(_SerdeShape): + """Contains information for modifying a strategy configuration.""" + + extraction: ModifyExtractionConfiguration | None = ... + """The updated extraction configuration.""" + consolidation: ModifyConsolidationConfiguration | None = ... + """The updated consolidation configuration.""" + reflection: ModifyReflectionConfiguration | None = ... + """The updated reflection configuration.""" + self_managed_configuration: ModifySelfManagedConfiguration | None = ... + """The updated self-managed configuration.""" + +class Monitoring(UnknownEnumMixin, StrEnum): + BASIC = "BASIC" + DETAILED = "DETAILED" + +@dataclass(kw_only=True) +class NamespaceKeyEntry(_SerdeShape): + """ + A namespace variable key definition with optional + `NamespaceKeyValidation` rules. + """ + + key: str + """The namespace variable key name.""" + validation: NamespaceKeyValidation | None = ... + """ + The validation rules that constrain values for this namespace variable + at runtime (`CreateEvent` API). + """ + +@dataclass(kw_only=True) +class NamespaceKeyValidation(_SerdeShape): + """ + The validation rules for namespace variable values. When you specify + multiple rules, the service enforces a logical `AND` across all provided + key-value pairs. + """ + + allowed_values: list[str] | None = ... + """The allowed values for this namespace variable key.""" + regex_pattern: str | None = ... + """A regex pattern that the namespace variable key-value must match.""" + +@dataclass(kw_only=True) +class NetworkConfiguration(_SerdeShape): + """SecurityConfig for the Agent.""" + + network_mode: str + """The network mode for the AgentCore Runtime.""" + network_mode_config: VpcConfig | None = ... + """The network mode configuration for the AgentCore Runtime.""" + +class NetworkMode(UnknownEnumMixin, StrEnum): + PUBLIC = "PUBLIC" + VPC = "VPC" + +@dataclass(kw_only=True) +class NumberValidation(_SerdeShape): + """Validation for NUMBER fields.""" + + min_value: float | None = ... + """Minimum allowed value.""" + max_value: float | None = ... + """Maximum allowed value.""" + +@dataclass(kw_only=True) +class NumericalScaleDefinition(_SerdeShape): + """ + The definition of a numerical rating scale option that provides a + numeric value with its description for evaluation scoring. + """ + + definition: str + """ + The description that explains what this numerical rating represents and + when it should be used. + """ + value: float + """The numerical value for this rating scale option.""" + label: str + """The label or name that describes this numerical rating option.""" + +@dataclass(kw_only=True) +class OAuth2AuthorizationData(_SerdeShape): + """ + OAuth2-specific authorization data, including the authorization URL and + user identifier for the authorization session. + """ + + authorization_url: str + """ + The URL to initiate the authorization process. This URL is provided when + the OAuth2 access token requires user authorization. + """ + user_id: str | None = ... + """ + The user identifier associated with the OAuth2 authorization session + that is defined by AgentCore Gateway. + """ + +@dataclass(kw_only=True) +class Oauth2AuthorizationServerMetadata(_SerdeShape): + """Contains the authorization server metadata for an OAuth2 provider.""" + + issuer: str + """The issuer URL for the OAuth2 authorization server.""" + authorization_endpoint: str + """The authorization endpoint URL for the OAuth2 authorization server.""" + token_endpoint: str + """The token endpoint URL for the OAuth2 authorization server.""" + response_types: list[str] | None = ... + """The supported response types for the OAuth2 authorization server.""" + token_endpoint_auth_methods: list[str] | None = ... + """ + The authentication methods supported by the token endpoint. This + specifies how clients can authenticate when requesting tokens from the + authorization server. + """ + +@dataclass(kw_only=True) +class Oauth2CredentialProviderItem(_SerdeShape): + """Contains information about an OAuth2 credential provider.""" + + name: str + """The name of the OAuth2 credential provider.""" + credential_provider_vendor: str + """The vendor of the OAuth2 credential provider.""" + credential_provider_arn: str + """The Amazon Resource Name (ARN) of the OAuth2 credential provider.""" + created_time: datetime + """The timestamp when the OAuth2 credential provider was created.""" + last_updated_time: datetime + """The timestamp when the OAuth2 credential provider was last updated.""" + +@dataclass +class Oauth2DiscoveryDiscoveryUrl(_SerdeShape): + """The discovery URL for the OAuth2 provider.""" + + value: str + +@dataclass +class Oauth2DiscoveryAuthorizationServerMetadata(_SerdeShape): + """The authorization server metadata for the OAuth2 provider.""" + + value: Oauth2AuthorizationServerMetadata + +@dataclass +class Oauth2DiscoveryUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +Oauth2Discovery = Union[ + Oauth2DiscoveryDiscoveryUrl + | Oauth2DiscoveryAuthorizationServerMetadata + | Oauth2DiscoveryUnknown +] +"""Contains the discovery information for an OAuth2 provider.""" + +class _Oauth2DiscoveryDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> Oauth2Discovery: ... + +@dataclass +class Oauth2ProviderConfigInputCustomOauth2ProviderConfig(_SerdeShape): + """The configuration for a custom OAuth2 provider.""" + + value: CustomOauth2ProviderConfigInput + +@dataclass +class Oauth2ProviderConfigInputGoogleOauth2ProviderConfig(_SerdeShape): + """The configuration for a Google OAuth2 provider.""" + + value: GoogleOauth2ProviderConfigInput + +@dataclass +class Oauth2ProviderConfigInputGithubOauth2ProviderConfig(_SerdeShape): + """The configuration for a GitHub OAuth2 provider.""" + + value: GithubOauth2ProviderConfigInput + +@dataclass +class Oauth2ProviderConfigInputSlackOauth2ProviderConfig(_SerdeShape): + """The configuration for a Slack OAuth2 provider.""" + + value: SlackOauth2ProviderConfigInput + +@dataclass +class Oauth2ProviderConfigInputSalesforceOauth2ProviderConfig(_SerdeShape): + """The configuration for a Salesforce OAuth2 provider.""" + + value: SalesforceOauth2ProviderConfigInput + +@dataclass +class Oauth2ProviderConfigInputMicrosoftOauth2ProviderConfig(_SerdeShape): + """The configuration for a Microsoft OAuth2 provider.""" + + value: MicrosoftOauth2ProviderConfigInput + +@dataclass +class Oauth2ProviderConfigInputAtlassianOauth2ProviderConfig(_SerdeShape): + """Configuration settings for Atlassian OAuth2 provider integration.""" + + value: AtlassianOauth2ProviderConfigInput + +@dataclass +class Oauth2ProviderConfigInputLinkedinOauth2ProviderConfig(_SerdeShape): + """Configuration settings for LinkedIn OAuth2 provider integration.""" + + value: LinkedinOauth2ProviderConfigInput + +@dataclass +class Oauth2ProviderConfigInputIncludedOauth2ProviderConfig(_SerdeShape): + """ + The configuration for a non-custom OAuth2 provider. This includes + settings for supported OAuth2 providers that have built-in integration + support. + """ + + value: IncludedOauth2ProviderConfigInput + +@dataclass +class Oauth2ProviderConfigInputUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +Oauth2ProviderConfigInput = Union[ + Oauth2ProviderConfigInputCustomOauth2ProviderConfig + | Oauth2ProviderConfigInputGoogleOauth2ProviderConfig + | Oauth2ProviderConfigInputGithubOauth2ProviderConfig + | Oauth2ProviderConfigInputSlackOauth2ProviderConfig + | Oauth2ProviderConfigInputSalesforceOauth2ProviderConfig + | Oauth2ProviderConfigInputMicrosoftOauth2ProviderConfig + | Oauth2ProviderConfigInputAtlassianOauth2ProviderConfig + | Oauth2ProviderConfigInputLinkedinOauth2ProviderConfig + | Oauth2ProviderConfigInputIncludedOauth2ProviderConfig + | Oauth2ProviderConfigInputUnknown +] +"""Contains the input configuration for an OAuth2 provider.""" + +class _Oauth2ProviderConfigInputDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> Oauth2ProviderConfigInput: ... + +@dataclass +class Oauth2ProviderConfigOutputCustomOauth2ProviderConfig(_SerdeShape): + """The output configuration for a custom OAuth2 provider.""" + + value: CustomOauth2ProviderConfigOutput + +@dataclass +class Oauth2ProviderConfigOutputGoogleOauth2ProviderConfig(_SerdeShape): + """The output configuration for a Google OAuth2 provider.""" + + value: GoogleOauth2ProviderConfigOutput + +@dataclass +class Oauth2ProviderConfigOutputGithubOauth2ProviderConfig(_SerdeShape): + """The output configuration for a GitHub OAuth2 provider.""" + + value: GithubOauth2ProviderConfigOutput + +@dataclass +class Oauth2ProviderConfigOutputSlackOauth2ProviderConfig(_SerdeShape): + """The output configuration for a Slack OAuth2 provider.""" + + value: SlackOauth2ProviderConfigOutput + +@dataclass +class Oauth2ProviderConfigOutputSalesforceOauth2ProviderConfig(_SerdeShape): + """The output configuration for a Salesforce OAuth2 provider.""" + + value: SalesforceOauth2ProviderConfigOutput + +@dataclass +class Oauth2ProviderConfigOutputMicrosoftOauth2ProviderConfig(_SerdeShape): + """The output configuration for a Microsoft OAuth2 provider.""" + + value: MicrosoftOauth2ProviderConfigOutput + +@dataclass +class Oauth2ProviderConfigOutputAtlassianOauth2ProviderConfig(_SerdeShape): + """The configuration details for the Atlassian OAuth2 provider.""" + + value: AtlassianOauth2ProviderConfigOutput + +@dataclass +class Oauth2ProviderConfigOutputLinkedinOauth2ProviderConfig(_SerdeShape): + """The configuration details for the LinkedIn OAuth2 provider.""" + + value: LinkedinOauth2ProviderConfigOutput + +@dataclass +class Oauth2ProviderConfigOutputIncludedOauth2ProviderConfig(_SerdeShape): + """ + The configuration for a non-custom OAuth2 provider. This includes the + configuration details for supported OAuth2 providers that have built-in + integration support. + """ + + value: IncludedOauth2ProviderConfigOutput + +@dataclass +class Oauth2ProviderConfigOutputUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +Oauth2ProviderConfigOutput = Union[ + Oauth2ProviderConfigOutputCustomOauth2ProviderConfig + | Oauth2ProviderConfigOutputGoogleOauth2ProviderConfig + | Oauth2ProviderConfigOutputGithubOauth2ProviderConfig + | Oauth2ProviderConfigOutputSlackOauth2ProviderConfig + | Oauth2ProviderConfigOutputSalesforceOauth2ProviderConfig + | Oauth2ProviderConfigOutputMicrosoftOauth2ProviderConfig + | Oauth2ProviderConfigOutputAtlassianOauth2ProviderConfig + | Oauth2ProviderConfigOutputLinkedinOauth2ProviderConfig + | Oauth2ProviderConfigOutputIncludedOauth2ProviderConfig + | Oauth2ProviderConfigOutputUnknown +] +"""Contains the output configuration for an OAuth2 provider.""" + +class _Oauth2ProviderConfigOutputDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> Oauth2ProviderConfigOutput: ... + +@dataclass(kw_only=True) +class OAuthCredentialProvider(_SerdeShape): + """ + An OAuth credential provider for gateway authentication. This structure + contains the configuration for authenticating with the target endpoint + using OAuth. + """ + + provider_arn: str + """ + The Amazon Resource Name (ARN) of the OAuth credential provider. This + ARN identifies the provider in Amazon Web Services. + """ + scopes: list[str] + """ + The OAuth scopes for the credential provider. These scopes define the + level of access requested from the OAuth provider. + """ + custom_parameters: dict[str, str] | None = ... + """ + The custom parameters for the OAuth credential provider. These + parameters provide additional configuration for the OAuth authentication + process. + """ + grant_type: str = ... + """ + Specifies the kind of credentials to use for authorization: + + - `CLIENT_CREDENTIALS` - Authorization with a client ID and secret. + + - `AUTHORIZATION_CODE` - Authorization with a token that is specific to + an individual end user. + + - `TOKEN_EXCHANGE` - Authorization using on-behalf-of token exchange. An + inbound user token is exchanged for a downstream access token scoped + to the target audience. + """ + default_return_url: str | None = ... + """ + The URL where the end user's browser is redirected after obtaining the + authorization code. Generally points to the customer's application. + """ + +class OAuthGrantType(UnknownEnumMixin, StrEnum): + CLIENT_CREDENTIALS = "CLIENT_CREDENTIALS" + AUTHORIZATION_CODE = "AUTHORIZATION_CODE" + TOKEN_EXCHANGE = "TOKEN_EXCHANGE" + +@dataclass(kw_only=True) +class OnBehalfOfTokenExchangeConfigType(_SerdeShape): + """Configuration for on-behalf-of token exchange.""" + + grant_type: str + """The grant type for the on-behalf-of token exchange.""" + token_exchange_grant_type_config: TokenExchangeGrantTypeConfigType | None = ... + """Configuration specific to the TOKEN_EXCHANGE grant type (RFC 8693).""" + +class OnBehalfOfTokenExchangeGrantTypeType(UnknownEnumMixin, StrEnum): + TOKEN_EXCHANGE = "TOKEN_EXCHANGE" + """ + RFC 8693 token exchange, adopted by the majority of identity providers + supporting on-behalf-of flows. + """ + JWT_AUTHORIZATION_GRANT = "JWT_AUTHORIZATION_GRANT" + """RFC 7523 JWT authorization grant, adopted by Microsoft Entra ID.""" + +class OnlineEvaluationConfigStatus(UnknownEnumMixin, StrEnum): + ACTIVE = "ACTIVE" + CREATING = "CREATING" + CREATE_FAILED = "CREATE_FAILED" + UPDATING = "UPDATING" + UPDATE_FAILED = "UPDATE_FAILED" + DELETING = "DELETING" + ERROR = "ERROR" + +@dataclass(kw_only=True) +class OnlineEvaluationConfigSummary(_SerdeShape): + """ + The summary information about an online evaluation configuration, + including basic metadata and execution status. + """ + + online_evaluation_config_arn: str + """The Amazon Resource Name (ARN) of the online evaluation configuration.""" + online_evaluation_config_id: str + """The unique identifier of the online evaluation configuration.""" + online_evaluation_config_name: str + """The name of the online evaluation configuration.""" + description: str | None = ... + """The description of the online evaluation configuration.""" + status: str + """The status of the online evaluation configuration.""" + execution_status: str + """ + The execution status indicating whether the online evaluation is + currently running. + """ + created_at: datetime + """The timestamp when the online evaluation configuration was created.""" + updated_at: datetime + """The timestamp when the online evaluation configuration was last updated.""" + failure_reason: str | None = ... + """ + The reason for failure if the online evaluation configuration execution + failed. + """ + insights: list[Insight] | None = ... + """The list of insight types configured for this evaluation.""" + clustering_config: ClusteringConfig | None = ... + """The clustering configuration for periodic batch evaluation.""" + +class OnlineEvaluationExecutionStatus(UnknownEnumMixin, StrEnum): + ENABLED = "ENABLED" + DISABLED = "DISABLED" + +@dataclass(kw_only=True) +class OpenResponsesEvaluatorModelConfig(_SerdeShape): + """ + The configuration for using models served through the OpenResponses API + in evaluator assessments, including model selection and inference + parameters. + """ + + model_id: str + """The identifier of the model to use for evaluation.""" + max_output_tokens: int | None = ... + """ + The maximum number of tokens to generate in the model response, + including visible output and reasoning tokens. + """ + temperature: float | None = ... + """ + The temperature value that controls randomness in the model's + responses. Lower values produce more deterministic outputs. + """ + top_p: float | None = ... + """ + The top-p sampling parameter that controls the diversity of the model's + responses by limiting the cumulative probability of token choices. + """ + reasoning: ReasoningConfiguration | None = ... + """ + The reasoning configuration for reasoning models. Non-reasoning models + ignore this configuration. + """ + +class OperatingSystem(UnknownEnumMixin, StrEnum): + """ + The operating system and CPU architecture for capacity provider + instances. + """ + + LINUX_X86_64 = "LINUX_X86_64" + LINUX_ARM64 = "LINUX_ARM64" + +@dataclass(kw_only=True) +class OutputConfig(_SerdeShape): + """ + The configuration that specifies where evaluation results should be + written for monitoring and analysis. + """ + + cloud_watch_config: CloudWatchOutputConfig + """ + The CloudWatch configuration for writing evaluation results to + CloudWatch logs with embedded metric format. + """ + +class OverrideType(UnknownEnumMixin, StrEnum): + SEMANTIC_OVERRIDE = "SEMANTIC_OVERRIDE" + SUMMARY_OVERRIDE = "SUMMARY_OVERRIDE" + USER_PREFERENCE_OVERRIDE = "USER_PREFERENCE_OVERRIDE" + SELF_MANAGED = "SELF_MANAGED" + EPISODIC_OVERRIDE = "EPISODIC_OVERRIDE" + +class PassthroughProtocolType(UnknownEnumMixin, StrEnum): + MCP = "MCP" + A2_A = "A2A" + INFERENCE = "INFERENCE" + CUSTOM = "CUSTOM" + +@dataclass(kw_only=True) +class PassthroughTargetConfiguration(_SerdeShape): + """ + The configuration for an HTTP passthrough target. A passthrough target + forwards requests directly to an external HTTP endpoint. + """ + + endpoint: str + """ + The HTTPS endpoint that the gateway forwards requests to for this + passthrough target. + """ + protocol_type: str + """ + The application protocol that the passthrough target implements. This + value is required for passthrough targets: + + - `MCP` - The Model Context Protocol. + + - `A2A` - The Agent-to-Agent protocol. + + - `INFERENCE` - The protocol for routing requests to a large language + model (LLM) provider. + + - `CUSTOM` - A custom application protocol. + """ + schema: HttpApiSchemaConfiguration | None = ... + """ + The API schema configuration that defines the structure of the + passthrough target's API. + """ + stickiness_configuration: StickinessConfiguration | None = ... + """ + The session stickiness configuration for the passthrough target. This + configuration routes requests within the same session to the same + target. + """ + static_query_parameters: dict[str, str] | None = ... + """ + A map of static query parameters that the gateway always appends to the + outbound URL when forwarding requests to the target. The total outbound + URL length, which includes the endpoint and the percent-encoded query + parameters, is enforced by the service. + """ + static_query_parameter_conflict_resolution: str | None = ... + """ + Controls precedence when a client request supplies a query parameter + whose name matches a configured static query parameter. If not set, + defaults to `CLIENT_OVERRIDE`: + + - `CLIENT_OVERRIDE` - The client-supplied value overrides the configured + static value for that parameter name. + + - `STATIC_OVERRIDE` - The configured static value is retained, + overriding the client-supplied value for that parameter name. + """ + +class PaymentConnectorProvisionMode(UnknownEnumMixin, StrEnum): + MANUAL = "MANUAL" + QUICK_CREATE = "QUICK_CREATE" + +class PaymentConnectorStatus(UnknownEnumMixin, StrEnum): + CREATING = "CREATING" + UPDATING = "UPDATING" + DELETING = "DELETING" + READY = "READY" + CREATE_FAILED = "CREATE_FAILED" + UPDATE_FAILED = "UPDATE_FAILED" + DELETE_FAILED = "DELETE_FAILED" + AWS_MARKETPLACE_SUBSCRIPTION_REQUIRED = "AWS_MARKETPLACE_SUBSCRIPTION_REQUIRED" + PENDING_AUTHENTICATION = "PENDING_AUTHENTICATION" + PROVISIONING = "PROVISIONING" + AUTHENTICATION_EXPIRED = "AUTHENTICATION_EXPIRED" + AUTHENTICATION_FAILED = "AUTHENTICATION_FAILED" + +@dataclass(kw_only=True) +class PaymentConnectorSummary(_SerdeShape): + """Contains summary information about a payment connector.""" + + payment_connector_id: str + """The unique identifier of the payment connector.""" + name: str + """The name of the payment connector.""" + type: str + """ + The type of the payment connector, which determines the payment provider + integration. + """ + provision_mode: str | None = ... + """ + Specifies how the payment connector was provisioned. Payment connectors + that were created before this field was available return `MANUAL`. + + - `MANUAL` - You provided the credential provider configurations, so you + own the credentials. + + - `QUICK_CREATE` - AgentCore provisioned the credential provider for + you, so the credentials are service-managed and you can rotate them + with `RotatePaymentConnectorCredentials`. + """ + status: str + """ + The current status of the payment connector. Possible values include + `CREATING`, `READY`, `UPDATING`, `DELETING`, `CREATE_FAILED`, + `UPDATE_FAILED`, and `DELETE_FAILED`. + """ + last_updated_at: datetime + """The timestamp when the payment connector was last updated.""" + +class PaymentConnectorType(UnknownEnumMixin, StrEnum): + COINBASE_CDP = "CoinbaseCDP" + STRIPE_PRIVY = "StripePrivy" + +@dataclass(kw_only=True) +class PaymentCredentialProviderConfiguration(_SerdeShape): + """ + Configuration for a payment credential provider that stores + authentication credentials for a payment provider. + """ + + credential_provider_arn: str + """ + The Amazon Resource Name (ARN) of the credential provider that stores + the authentication credentials for the payment provider. + """ + +@dataclass(kw_only=True) +class PaymentCredentialProviderItem(_SerdeShape): + """Contains summary information about a payment credential provider.""" + + name: str + """The name of the payment credential provider.""" + credential_provider_vendor: str + """The vendor type for the payment credential provider.""" + credential_provider_arn: str + """The Amazon Resource Name (ARN) of the payment credential provider.""" + created_time: datetime + """The timestamp when the payment credential provider was created.""" + last_updated_time: datetime + """The timestamp when the payment credential provider was last updated.""" + +class PaymentCredentialProviderVendorType(UnknownEnumMixin, StrEnum): + """ + Supported vendor types for payment providers using non-standard auth + protocols. + """ + + COINBASE_CDP = "CoinbaseCDP" + """Coinbase Developer Platform.""" + STRIPE_PRIVY = "StripePrivy" + """Stripe and Privy.""" + +class PaymentManagerStatus(UnknownEnumMixin, StrEnum): + CREATING = "CREATING" + UPDATING = "UPDATING" + DELETING = "DELETING" + READY = "READY" + CREATE_FAILED = "CREATE_FAILED" + UPDATE_FAILED = "UPDATE_FAILED" + DELETE_FAILED = "DELETE_FAILED" + +@dataclass(kw_only=True) +class PaymentManagerSummary(_SerdeShape): + """Contains summary information about a payment manager.""" + + payment_manager_arn: str + """The Amazon Resource Name (ARN) of the payment manager.""" + payment_manager_id: str + """The unique identifier of the payment manager.""" + name: str + """The name of the payment manager.""" + description: str | None = ... + """The description of the payment manager.""" + authorizer_type: str + """ + The type of authorizer used by the payment manager. + + - `CUSTOM_JWT` - Authorize with a bearer token. + + - `AWS_IAM` - Authorize with your Amazon Web Services IAM credentials. + """ + role_arn: str + """ + The Amazon Resource Name (ARN) of the IAM role associated with the + payment manager. + """ + status: str + """ + The current status of the payment manager. Possible values include + `CREATING`, `READY`, `UPDATING`, `DELETING`, `CREATE_FAILED`, + `UPDATE_FAILED`, and `DELETE_FAILED`. + """ + created_at: datetime | None = ... + """The timestamp when the payment manager was created.""" + last_updated_at: datetime + """The timestamp when the payment manager was last updated.""" + kms_key_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the KMS key used to encrypt sensitive + payment manager data at rest, if configured. + """ + +@dataclass +class PaymentProviderConfigurationInputCoinbaseCdpConfiguration(_SerdeShape): + """The Coinbase CDP configuration.""" + + value: CoinbaseCdpConfigurationInput + +@dataclass +class PaymentProviderConfigurationInputStripePrivyConfiguration(_SerdeShape): + """The Stripe Privy configuration.""" + + value: StripePrivyConfigurationInput + +@dataclass +class PaymentProviderConfigurationInputUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +PaymentProviderConfigurationInput = Union[ + PaymentProviderConfigurationInputCoinbaseCdpConfiguration + | PaymentProviderConfigurationInputStripePrivyConfiguration + | PaymentProviderConfigurationInputUnknown +] +""" +Provider configuration input --- contains secrets for creation and +update. Varies by vendor type. +""" + +class _PaymentProviderConfigurationInputDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> PaymentProviderConfigurationInput: ... + +@dataclass +class PaymentProviderConfigurationOutputCoinbaseCdpConfiguration(_SerdeShape): + """The Coinbase CDP configuration.""" + + value: CoinbaseCdpConfigurationOutput + +@dataclass +class PaymentProviderConfigurationOutputStripePrivyConfiguration(_SerdeShape): + """The Stripe Privy configuration.""" + + value: StripePrivyConfigurationOutput + +@dataclass +class PaymentProviderConfigurationOutputUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +PaymentProviderConfigurationOutput = Union[ + PaymentProviderConfigurationOutputCoinbaseCdpConfiguration + | PaymentProviderConfigurationOutputStripePrivyConfiguration + | PaymentProviderConfigurationOutputUnknown +] +""" +Provider configuration output --- no raw secrets, only ARNs. Varies by +vendor type. +""" + +class _PaymentProviderConfigurationOutputDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> PaymentProviderConfigurationOutput: ... + +class PaymentsAuthorizerType(UnknownEnumMixin, StrEnum): + CUSTOM_JWT = "CUSTOM_JWT" + AWS_IAM = "AWS_IAM" + +class Period(UnknownEnumMixin, StrEnum): + """The time period for rate limiting.""" + + SECOND = "second" + MINUTE = "minute" + +@dataclass(kw_only=True) +class PermissionsConfiguration(_SerdeShape): + """ + The permissions configuration for a capacity provider. This specifies + the IAM role that AgentCore uses to manage the Amazon EC2 instances for + the capacity provider on your behalf. + """ + + capacity_provider_operator_role_arn: str + """ + The Amazon Resource Name (ARN) of the IAM role that AgentCore assumes to + manage the capacity provider, including launching, tagging, and + terminating instances and their network interfaces. We recommend scoping + this role to the minimum permissions that your workloads require. + """ + +@dataclass(kw_only=True) +class Policy(_SerdeShape): + """ + Represents a complete policy resource within the AgentCore Policy + system. Policies are ARN-able resources that contain Cedar or Dogwood + policy statements and associated metadata for controlling agent behavior + and access decisions. Each policy belongs to a policy engine and defines + fine-grained authorization rules that are evaluated in real-time as + agents interact with tools through Gateway. Policies use Cedar or + Dogwood to specify who (principals based on OAuth claims like username, + role, or scope) can perform what actions (tool calls) on which resources + (Gateways), with optional conditions for attribute-based access control. + Multiple policies can apply to a single request, with forbid-wins + semantics ensuring that security restrictions are never accidentally + overridden. + """ + + policy_id: str + """ + The unique identifier for the policy. This system-generated identifier + consists of the user name plus a 10-character generated suffix and + serves as the primary key for policy operations. + """ + name: str + """ + The customer-assigned immutable name for the policy. This human-readable + identifier must be unique within the account and cannot exceed 48 + characters. + """ + policy_engine_id: str + """ + The identifier of the policy engine that manages this policy. This + establishes the policy engine context for policy evaluation and + management. + """ + created_at: datetime + """ + The timestamp when the policy was originally created. This is + automatically set by the service and used for auditing and lifecycle + management. + """ + updated_at: datetime + """ + The timestamp when the policy was last modified. This tracks the most + recent changes to the policy configuration or metadata. + """ + policy_arn: str + """ + The Amazon Resource Name (ARN) of the policy. This globally unique + identifier can be used for cross-service references and IAM policy + statements. + """ + status: str + """The current status of the policy.""" + enforcement_mode: str = ... + """The current enforcement mode of the policy.""" + definition: PolicyDefinition + """ + The Cedar or Dogwood policy statement that defines the access control + rules. This contains the actual policy logic used for agent behavior + control and access decisions. + """ + description: str | None = ... + """ + A human-readable description of the policy's purpose and functionality. + Limited to 4,096 characters, this helps administrators understand and + manage the policy. + """ + status_reasons: list[str] + """ + Additional information about the policy status. This provides details + about any failures or the current state of the policy lifecycle. + """ + +@dataclass +class PolicyDefinitionCedar(_SerdeShape): + """ + The Cedar policy definition within the policy definition structure. This + contains the Cedar policy statement that defines the authorization logic + using Cedar's human-readable, analyzable policy language. Cedar + policies specify principals (who can access), actions (what operations + are allowed), resources (what can be accessed), and optional conditions + for fine-grained control. Cedar provides a formal policy language + designed for authorization with deterministic evaluation, making + policies testable, reviewable, and auditable. All Cedar policies follow + a default-deny model where actions are denied unless explicitly + permitted, and forbid policies always override permit policies. + """ + + value: CedarPolicy + +@dataclass +class PolicyDefinitionPolicyGeneration(_SerdeShape): + """ + The generated policy asset information within the policy definition + structure. This contains information identifying a generated policy + asset from the AI-powered policy generation process within the AgentCore + Policy system. Each asset contains a Dogwood policy statement generated + from natural language input, along with associated metadata and analysis + findings to help users evaluate and select the most appropriate policy + option. + """ + + value: PolicyGenerationDetails + +@dataclass +class PolicyDefinitionPolicy(_SerdeShape): + """ + The Dogwood policy statement that defines the access control rules. This + policy definition can include Dogwood policies and supports temporal + conditions and information providers such as guardrails. + """ + + value: PolicyStatement + +@dataclass +class PolicyDefinitionUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +PolicyDefinition = Union[ + PolicyDefinitionCedar + | PolicyDefinitionPolicyGeneration + | PolicyDefinitionPolicy + | PolicyDefinitionUnknown +] +""" +Represents the definition structure for policies within the AgentCore +Policy system. This structure encapsulates different policy formats and +languages that can be used to define access control rules. +""" + +class _PolicyDefinitionDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> PolicyDefinition: ... + +@dataclass(kw_only=True) +class PolicyEngine(_SerdeShape): + """ + Represents a policy engine resource within the AgentCore Policy system. + Policy engines serve as containers for grouping related policies and + provide the execution context for policy evaluation and management. Each + policy engine can be associated with one Gateway (one engine per + Gateway), where it intercepts all agent tool calls and evaluates them + against the contained policies before allowing tools to execute. The + policy engine maintains the Cedar schema generated from the Gateway's + tool manifest, ensuring that policies are validated against the actual + tools and parameters available. Policy engines support two enforcement + modes that can be configured when associating with a Gateway: log-only + mode for testing (evaluates decisions without blocking) and enforce mode + for production (actively allows or denies based on policy evaluation). + """ + + policy_engine_id: str + """ + The unique identifier for the policy engine. This system-generated + identifier consists of the user name plus a 10-character generated + suffix and serves as the primary key for policy engine operations. + """ + name: str + """ + The customer-assigned immutable name for the policy engine. This + human-readable identifier must be unique within the account and cannot + exceed 48 characters. + """ + created_at: datetime + """ + The timestamp when the policy engine was originally created. This is + automatically set by the service and used for auditing and lifecycle + management. + """ + updated_at: datetime + """ + The timestamp when the policy engine was last modified. This tracks the + most recent changes to the policy engine configuration or metadata. + """ + policy_engine_arn: str + """ + The Amazon Resource Name (ARN) of the policy engine. This globally + unique identifier can be used for cross-service references and IAM + policy statements. + """ + status: str + """The current status of the policy engine.""" + encryption_key_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the KMS key used to encrypt the policy + engine data. + """ + description: str | None = ... + """ + A human-readable description of the policy engine's purpose and scope. + Limited to 4,096 characters, this helps administrators understand the + policy engine's role in the overall governance strategy. + """ + status_reasons: list[str] + """ + Additional information about the policy engine status. This provides + details about any failures or the current state of the policy engine + lifecycle. + """ + +class PolicyEngineStatus(UnknownEnumMixin, StrEnum): + CREATING = "CREATING" + ACTIVE = "ACTIVE" + UPDATING = "UPDATING" + DELETING = "DELETING" + CREATE_FAILED = "CREATE_FAILED" + UPDATE_FAILED = "UPDATE_FAILED" + DELETE_FAILED = "DELETE_FAILED" + +@dataclass(kw_only=True) +class PolicyEngineSummary(_SerdeShape): + """ + Represents a metadata-only summary of a policy engine resource. This + structure contains resource identifiers, status, and timestamps without + customer-encrypted fields such as description or status reasons. Policy + engine summaries are returned by operations that do not require access + to the customer's KMS key. + """ + + policy_engine_id: str + """The unique identifier for the policy engine.""" + name: str + """The customer-assigned name of the policy engine.""" + created_at: datetime + """The timestamp when the policy engine was originally created.""" + updated_at: datetime + """The timestamp when the policy engine was last modified.""" + policy_engine_arn: str + """The Amazon Resource Name (ARN) of the policy engine.""" + status: str + """The current status of the policy engine.""" + encryption_key_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the KMS key used to encrypt the policy + engine data. + """ + +@dataclass(kw_only=True) +class PolicyGeneration(_SerdeShape): + """ + Represents a policy generation request within the AgentCore Policy + system. Tracks the AI-powered conversion of natural language + descriptions into Dogwood policy statements, enabling users to author + policies by describing authorization requirements in plain English. The + generation process analyzes the natural language input along with the + Gateway's tool context and Cedar schema to produce one or more + validated policy options. Each generation request tracks the status of + the conversion process and maintains findings about the generated + policies, including validation results and potential issues. Generated + policy assets remain available for one week after successful generation, + allowing time to review and create policies from the generated options. + """ + + policy_engine_id: str + """ + The identifier of the policy engine associated with this generation + request. + """ + policy_generation_id: str + """The unique identifier for this policy generation request.""" + name: str + """The customer-assigned name for this policy generation request.""" + policy_generation_arn: str + """The ARN of this policy generation request.""" + resource: Resource + """The resource information associated with this policy generation.""" + created_at: datetime + """The timestamp when this policy generation request was created.""" + updated_at: datetime + """The timestamp when this policy generation was last updated.""" + status: str + """The current status of this policy generation request.""" + findings: str | None = ... + """Findings and insights from this policy generation process.""" + status_reasons: list[str] + """Additional information about the generation status.""" + +@dataclass(kw_only=True) +class PolicyGenerationAsset(_SerdeShape): + """ + Represents a generated policy asset from the AI-powered policy + generation process within the AgentCore Policy system. Each asset + contains a Dogwood policy statement generated from natural language + input, along with associated metadata and analysis findings to help + users evaluate and select the most appropriate policy option. + """ + + policy_generation_asset_id: str + """ + The unique identifier for this generated policy asset within the policy + generation request. This ID can be used to reference specific generated + policy options when creating actual policies from the generation + results. + """ + definition: PolicyDefinition | None = ... + """ + Represents the definition structure for policies within the AgentCore + Policy system. This structure encapsulates different policy formats and + languages that can be used to define access control rules. + """ + raw_text_fragment: str + """ + The portion of the original natural language input that this generated + policy asset addresses. This helps users understand which part of their + policy description was translated into this specific Dogwood policy + statement, enabling better policy selection and refinement. When a + single natural language input describes multiple authorization + requirements, the generation process creates separate policy assets for + each requirement, with each asset's rawTextFragment showing which + requirement it addresses. Use this mapping to verify that all parts of + your natural language input were correctly translated into Dogwood + policies. + """ + findings: list[Finding] + """ + Analysis findings and insights related to this specific generated policy + asset. These findings may include validation results, potential issues, + or recommendations for improvement to help users evaluate the quality + and appropriateness of the generated policy. + """ + +@dataclass(kw_only=True) +class PolicyGenerationDetails(_SerdeShape): + """ + Represents the information identifying a generated policy asset from the + AI-powered policy generation process within the AgentCore Policy system. + Each asset contains a Dogwood policy statement generated from natural + language input, along with associated metadata and analysis findings to + help users evaluate and select the most appropriate policy option. + """ + + policy_generation_id: str + """The unique identifier for this policy generation request.""" + policy_generation_asset_id: str + """ + The unique identifier for this generated policy asset within the policy + generation request. + """ + +class PolicyGenerationStatus(UnknownEnumMixin, StrEnum): + GENERATING = "GENERATING" + GENERATED = "GENERATED" + GENERATE_FAILED = "GENERATE_FAILED" + DELETE_FAILED = "DELETE_FAILED" + +@dataclass(kw_only=True) +class PolicyGenerationSummary(_SerdeShape): + """ + Represents a metadata-only summary of a policy generation resource. This + structure contains resource identifiers, status, timestamps, and + findings without customer-encrypted fields such as status reasons. + Policy generation summaries are returned by operations that do not + require access to the customer's KMS key. + """ + + policy_engine_id: str + """ + The identifier of the policy engine associated with this generation + request. + """ + policy_generation_id: str + """The unique identifier for this policy generation request.""" + name: str + """The customer-assigned name for this policy generation request.""" + policy_generation_arn: str + """The ARN of this policy generation request.""" + resource: Resource + """The resource information associated with this policy generation.""" + created_at: datetime + """The timestamp when this policy generation request was created.""" + updated_at: datetime + """The timestamp when this policy generation was last updated.""" + status: str + """The current status of this policy generation request.""" + findings: str | None = ... + """Findings and insights from this policy generation process.""" + +@dataclass(kw_only=True) +class PolicyStatement(_SerdeShape): + """ + An AgentCore Cedar or Dogwood policy statement, which supports plain + Cedar policies, temporal policies, and guardrails definitions. + """ + + statement: str + """ + The body of the AgentCore Cedar or Dogwood policy statement. Contains + the policy logic, which can be a Cedar policy, a temporal policy, or a + guardrails definition. + """ + +class PolicyStatus(UnknownEnumMixin, StrEnum): + CREATING = "CREATING" + ACTIVE = "ACTIVE" + UPDATING = "UPDATING" + DELETING = "DELETING" + CREATE_FAILED = "CREATE_FAILED" + UPDATE_FAILED = "UPDATE_FAILED" + DELETE_FAILED = "DELETE_FAILED" + +@dataclass(kw_only=True) +class PolicySummary(_SerdeShape): + """ + Represents a metadata-only summary of a policy resource. This structure + contains resource identifiers, status, and timestamps without + customer-encrypted fields such as definition, description, or status + reasons. Policy summaries are returned by operations that do not require + access to the customer's KMS key. + """ + + policy_id: str + """The unique identifier for the policy.""" + name: str + """The customer-assigned name of the policy.""" + policy_engine_id: str + """The identifier of the policy engine that manages this policy.""" + created_at: datetime + """The timestamp when the policy was originally created.""" + updated_at: datetime + """The timestamp when the policy was last modified.""" + policy_arn: str + """The Amazon Resource Name (ARN) of the policy.""" + status: str + """The current status of the policy.""" + enforcement_mode: str = ... + """The current enforcement mode of the policy.""" + +class PolicyValidationMode(UnknownEnumMixin, StrEnum): + FAIL_ON_ANY_FINDINGS = "FAIL_ON_ANY_FINDINGS" + IGNORE_ALL_FINDINGS = "IGNORE_ALL_FINDINGS" + +class PrincipalMatchOperator(UnknownEnumMixin, StrEnum): + STRING_EQUALS = "StringEquals" + STRING_LIKE = "StringLike" + +@dataclass +class PrivateEndpointSelfManagedLatticeResource(_SerdeShape): + """ + Configuration for connecting to a private resource using a self-managed + VPC Lattice resource configuration. + """ + + value: SelfManagedLatticeResource + +@dataclass +class PrivateEndpointManagedVpcResource(_SerdeShape): + """ + Configuration for connecting to a private resource using a managed VPC + Lattice resource. The gateway creates and manages the VPC Lattice + resources on your behalf. + """ + + value: ManagedVpcResource + +@dataclass +class PrivateEndpointUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +PrivateEndpoint = Union[ + PrivateEndpointSelfManagedLatticeResource + | PrivateEndpointManagedVpcResource + | PrivateEndpointUnknown +] +""" +The private endpoint configuration for a gateway target. Defines how the +gateway connects to private resources in your VPC. +""" + +class _PrivateEndpointDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> PrivateEndpoint: ... + +@dataclass(kw_only=True) +class PrivateEndpointOverride(_SerdeShape): + """ + A mapping of a specific domain to a private endpoint for secure + connectivity through a VPC Lattice resource configuration. + """ + + domain: str + """The domain to override with a private endpoint.""" + private_endpoint: PrivateEndpoint + """The private endpoint configuration for the specified domain.""" + +@dataclass(kw_only=True) +class PrivateKeyJwtConfig(_SerdeShape): + """The private key configuration for private_key_jwt client authentication.""" + + private_key_source: PrivateKeySource | None = ... + """The private key source for the JWT client assertion.""" + signing_algorithm: str | None = ... + """ + The algorithm used to sign the JWT client assertion. Valid values are + `RS256`, `PS256`, and `ES256`. + """ + additional_header_claims: dict[str, str] | None = ... + """ + A map of additional claims to include in the JWT client assertion + header. Standard header claims such as `alg` and `typ` cannot be added. + """ + additional_payload_claims: dict[str, str] | None = ... + """ + A map of additional claims to include in the JWT client assertion + payload. Payload claims generated by the service, such as `iss`, `sub`, + `jti`, and `exp`, cannot be added. + """ + +@dataclass +class PrivateKeySourceKmsKeySource(_SerdeShape): + """The KMS key source for the JWT client assertion.""" + + value: KmsKeySourceType + +@dataclass +class PrivateKeySourceUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +PrivateKeySource = Union[PrivateKeySourceKmsKeySource | PrivateKeySourceUnknown] +""" +Contains the private key source configuration for a JWT client +assertion. +""" + +class _PrivateKeySourceDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> PrivateKeySource: ... + +@dataclass(kw_only=True) +class ProtocolConfiguration(_SerdeShape): + """ + The protocol configuration for an agent runtime. This structure defines + how the agent runtime communicates with clients. + """ + + server_protocol: str + """ + The server protocol for the agent runtime. This field specifies which + protocol the agent runtime uses to communicate with clients. + """ + +class Provider(UnknownEnumMixin, StrEnum): + AWS = "AWS" + DEEP_EVAL = "DeepEval" + AUTO_EVAL = "AutoEval" + CUSTOM = "Custom" + +@dataclass(kw_only=True) +class ProviderPrefix(_SerdeShape): + """ + The configuration that controls how a provider prefix is applied to + model IDs during translation. + """ + + strip: bool = ... + """ + Whether clients can omit the provider prefix from model IDs. If `true`, + the gateway accepts model IDs without the prefix and restores the full + prefixed form before forwarding to the provider. The default is `false`. + """ + separator: str = ... + """ + The single character that separates the provider prefix from the model + name (for example, `.`). The default is `.`. + """ + +@dataclass(kw_only=True) +class PutResourcePolicyInput(_SerdeShape): + """Dataclass for PutResourcePolicyInput structure.""" + + resource_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the resource for which to create or + update the resource policy. + """ + policy: str | None = ... + """The resource policy to create or update.""" + +@dataclass(kw_only=True) +class PutResourcePolicyOutput(_SerdeShape): + """Dataclass for PutResourcePolicyOutput structure.""" + + policy: str + """The resource policy that was created or updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class RateConfig(_SerdeShape): + """ + Contains the rate configuration for a rate limit metric, specifying the + allowed rate and time period. + """ + + rate: float + """ + The rate value for the limit. For request limits, this is the number of + requests allowed per period. For token limits, this is the number of + tokens allowed per period. For connection limits, this is the number of + concurrent connections allowed. + """ + period: str + """ + The time period for the rate limit. Valid values: + + - `second`---Measures the rate limit over a one-second window. + + - `minute`---Measures the rate limit over a one-minute window. + """ + +@dataclass +class RatingScaleNumerical(_SerdeShape): + """ + The numerical rating scale with defined score values and descriptions + for quantitative evaluation. + """ + + value: list[NumericalScaleDefinition] + +@dataclass +class RatingScaleCategorical(_SerdeShape): + """ + The categorical rating scale with named categories and definitions for + qualitative evaluation. + """ + + value: list[CategoricalScaleDefinition] + +@dataclass +class RatingScaleUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +RatingScale = Union[RatingScaleNumerical | RatingScaleCategorical | RatingScaleUnknown] +""" +The rating scale that defines how evaluators should score agent +performance, supporting both numerical and categorical scales. +""" + +class _RatingScaleDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> RatingScale: ... + +@dataclass(kw_only=True) +class ReasoningConfiguration(_SerdeShape): + """ + The reasoning configuration that controls how a reasoning model + allocates effort during evaluation. + """ + + effort: str | None = ... + """ + The level of reasoning effort the model applies when generating a + response. For supported values, see the model provider's documentation. + """ + +@dataclass(kw_only=True) +class RecordingConfig(_SerdeShape): + """ + The recording configuration for a browser. This structure defines how + browser sessions are recorded. + """ + + enabled: bool = ... + """ + Indicates whether recording is enabled for the browser. When set to + true, browser sessions are recorded. + """ + s3_location: S3Location | None = ... + """ + The Amazon S3 location where browser recordings are stored. This + location contains the recorded browser sessions. + """ + +@dataclass +class ReflectionConfigurationCustomReflectionConfiguration(_SerdeShape): + """The configuration for a custom reflection strategy.""" + + value: CustomReflectionConfiguration + +@dataclass +class ReflectionConfigurationEpisodicReflectionConfiguration(_SerdeShape): + """The configuration for the episodic reflection strategy.""" + + value: EpisodicReflectionConfiguration + +@dataclass +class ReflectionConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ReflectionConfiguration = Union[ + ReflectionConfigurationCustomReflectionConfiguration + | ReflectionConfigurationEpisodicReflectionConfiguration + | ReflectionConfigurationUnknown +] +"""Contains reflection configuration information for a memory strategy.""" + +class _ReflectionConfigurationDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> ReflectionConfiguration: ... + +class RegistryAuthorizerType(UnknownEnumMixin, StrEnum): + CUSTOM_JWT = "CUSTOM_JWT" + AWS_IAM = "AWS_IAM" + +@dataclass(kw_only=True) +class RegistryRecordCredentialProviderConfiguration(_SerdeShape): + """ + A pairing of a credential provider type with its corresponding provider + details for authenticating with external sources. + """ + + credential_provider_type: str + """ + The type of credential provider. + + - `OAUTH` - OAuth-based authentication. + + - `IAM` - Amazon Web Services IAM-based authentication using SigV4 + signing. + """ + credential_provider: RegistryRecordCredentialProviderUnion + """ + The credential provider configuration details. The structure depends on + the `credentialProviderType`. + """ + +class RegistryRecordCredentialProviderType(UnknownEnumMixin, StrEnum): + OAUTH = "OAUTH" + IAM = "IAM" + +@dataclass +class RegistryRecordCredentialProviderUnionOauthCredentialProvider(_SerdeShape): + """ + The OAuth credential provider configuration for authenticating with the + external source. + """ + + value: RegistryRecordOAuthCredentialProvider + +@dataclass +class RegistryRecordCredentialProviderUnionIamCredentialProvider(_SerdeShape): + """ + The IAM credential provider configuration for authenticating with the + external source using SigV4 signing. + """ + + value: RegistryRecordIamCredentialProvider + +@dataclass +class RegistryRecordCredentialProviderUnionUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +RegistryRecordCredentialProviderUnion = Union[ + RegistryRecordCredentialProviderUnionOauthCredentialProvider + | RegistryRecordCredentialProviderUnionIamCredentialProvider + | RegistryRecordCredentialProviderUnionUnknown +] +""" +Union of supported credential provider types for registry record +synchronization. +""" + +class _RegistryRecordCredentialProviderUnionDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> RegistryRecordCredentialProviderUnion: ... + +@dataclass(kw_only=True) +class RegistryRecordIamCredentialProvider(_SerdeShape): + """ + IAM credential provider configuration for authenticating with an + external source using SigV4 signing during synchronization. + """ + + role_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the IAM role to assume for SigV4 + signing. + """ + service: str | None = ... + """ + The SigV4 signing service name (for example, `execute-api` or + `bedrock-agentcore`). + """ + region: str | None = ... + """ + The Amazon Web Services region for SigV4 signing (for example, + `us-west-2`). If not specified, the region is extracted from the MCP + server URL hostname, with fallback to the service's own region. + """ + +@dataclass(kw_only=True) +class RegistryRecordOAuthCredentialProvider(_SerdeShape): + """ + OAuth credential provider configuration for authenticating with an + external source during synchronization. + """ + + provider_arn: str + """ + The Amazon Resource Name (ARN) of the OAuth credential provider + resource. + """ + grant_type: str | None = ... + """The OAuth grant type. Currently only `CLIENT_CREDENTIALS` is supported.""" + scopes: list[str] | None = ... + """The OAuth scopes to request during authentication.""" + custom_parameters: dict[str, str] | None = ... + """Additional custom parameters for the OAuth flow.""" + +class RegistryRecordOAuthGrantType(UnknownEnumMixin, StrEnum): + CLIENT_CREDENTIALS = "CLIENT_CREDENTIALS" + +class RegistryRecordStatus(UnknownEnumMixin, StrEnum): + DRAFT = "DRAFT" + PENDING_APPROVAL = "PENDING_APPROVAL" + APPROVED = "APPROVED" + REJECTED = "REJECTED" + DEPRECATED = "DEPRECATED" + CREATING = "CREATING" + UPDATING = "UPDATING" + CREATE_FAILED = "CREATE_FAILED" + UPDATE_FAILED = "UPDATE_FAILED" + +@dataclass(kw_only=True) +class RegistryRecordSummary(_SerdeShape): + """Contains summary information about a registry record.""" + + registry_arn: str + """The Amazon Resource Name (ARN) of the registry that contains the record.""" + record_arn: str + """The Amazon Resource Name (ARN) of the registry record.""" + record_id: str + """The unique identifier of the registry record.""" + name: str + """The name of the registry record.""" + description: str | None = ... + """The description of the registry record.""" + descriptor_type: str + """ + The descriptor type of the registry record. Possible values are `MCP`, + `A2A`, `CUSTOM`, and `AGENT_SKILLS`. + """ + record_version: str + """The version of the registry record.""" + status: str + """ + The current status of the registry record. Possible values include + `CREATING`, `DRAFT`, `APPROVED`, `PENDING_APPROVAL`, `REJECTED`, + `DEPRECATED`, `UPDATING`, `CREATE_FAILED`, and `UPDATE_FAILED`. + """ + created_at: datetime + """The timestamp when the registry record was created.""" + updated_at: datetime + """The timestamp when the registry record was last updated.""" + +class RegistryStatus(UnknownEnumMixin, StrEnum): + CREATING = "CREATING" + READY = "READY" + UPDATING = "UPDATING" + CREATE_FAILED = "CREATE_FAILED" + UPDATE_FAILED = "UPDATE_FAILED" + DELETING = "DELETING" + DELETE_FAILED = "DELETE_FAILED" + +@dataclass(kw_only=True) +class RegistrySummary(_SerdeShape): + """Contains summary information about a registry.""" + + name: str + """The name of the registry.""" + description: str | None = ... + """The description of the registry.""" + registry_id: str + """The unique identifier of the registry.""" + registry_arn: str + """The Amazon Resource Name (ARN) of the registry.""" + authorizer_type: str | None = ... + """ + The type of authorizer used by the registry. This controls the + authorization method for the Search and Invoke APIs used by consumers. + + - `CUSTOM_JWT` - Authorize with a bearer token. + + - `AWS_IAM` - Authorize with your Amazon Web Services IAM credentials. + """ + status: str + """ + The current status of the registry. Possible values include `CREATING`, + `READY`, `UPDATING`, `CREATE_FAILED`, `UPDATE_FAILED`, `DELETING`, and + `DELETE_FAILED`. + """ + status_reason: str | None = ... + """ + The reason for the current status, typically set when the status is a + failure state. + """ + created_at: datetime + """The timestamp when the registry was created.""" + updated_at: datetime + """The timestamp when the registry was last updated.""" + +@dataclass +class RequestHeaderConfigurationRequestHeaderAllowlist(_SerdeShape): + """ + A list of HTTP request headers that are allowed to be passed through to + the runtime. + """ + + value: list[str] + +@dataclass +class RequestHeaderConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +RequestHeaderConfiguration = Union[ + RequestHeaderConfigurationRequestHeaderAllowlist | RequestHeaderConfigurationUnknown +] +""" +Configuration for HTTP request headers that will be passed through to +the runtime. +""" + +class _RequestHeaderConfigurationDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> RequestHeaderConfiguration: ... + +@dataclass +class ResourceArn(_SerdeShape): + """ + The Amazon Resource Name (ARN) of the resource. This globally unique + identifier specifies the exact resource that policies will be evaluated + against for access control decisions. + """ + + value: str + +@dataclass +class ResourceUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +Resource = Union[ResourceArn | ResourceUnknown] +""" +Represents a resource within the AgentCore Policy system. Resources are +the targets of policy evaluation. Currently, only AgentCore Gateways are +supported as resources for policy enforcement. +""" + +class _ResourceDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> Resource: ... + +@dataclass(kw_only=True) +class ResourceLimitExceededException(ServiceError, _SerdeShape): + """Exception thrown when a resource limit is exceeded.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass +class ResourceLocationS3(_SerdeShape): + """ + The Amazon S3 location for storing data. This structure defines where in + Amazon S3 data is stored. + """ + + value: S3Location + +@dataclass +class ResourceLocationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ResourceLocation = Union[ResourceLocationS3 | ResourceLocationUnknown] +"""The location of a resource.""" + +class _ResourceLocationDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> ResourceLocation: ... + +@dataclass(kw_only=True) +class ResourceNotFoundException(ServiceError, _SerdeShape): + """ + This exception is thrown when a resource referenced by the operation + does not exist + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class ResourceType(UnknownEnumMixin, StrEnum): + SYSTEM = "SYSTEM" + CUSTOM = "CUSTOM" + +class RestApiMethod(UnknownEnumMixin, StrEnum): + GET = "GET" + DELETE = "DELETE" + HEAD = "HEAD" + OPTIONS = "OPTIONS" + PATCH = "PATCH" + PUT = "PUT" + POST = "POST" + +class ResultDestination(UnknownEnumMixin, StrEnum): + """ + Where evaluation results are written: dedicated results log group + (default) or the source log group. + """ + + DEDICATED_LOG_GROUP = "DEDICATED_LOG_GROUP" + SOURCE_LOG_GROUP = "SOURCE_LOG_GROUP" + +@dataclass(kw_only=True) +class RetryableConflictException(ServiceError, _SerdeShape): + """ + The operation failed because of a conflicting request. Retry the + request. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class RootVolumeConfiguration(_SerdeShape): + """ + The configuration for the root volume of a capacity provider instance. + Specify the amount of free space to guarantee on the root volume. The + device name and delete-on-termination settings are fixed and cannot be + changed. + """ + + volume_type: str = ... + """ + The Amazon EBS volume type. If you do not specify a type, the default is + `gp3`. + """ + iops: int | None = ... + """ + The number of IOPS to provision. For `gp3`, `io1`, and `io2` volumes, + this is the number of IOPS provisioned for the volume. For `gp2` + volumes, this sets the baseline IOPS performance. It also controls the + rate at which the volume accumulates I/O credits for bursting. Supported + values: `gp3`, 3,000--80,000; `io1`, 100--64,000; `io2`, 100--256,000. + """ + throughput: int | None = ... + """ + The throughput to provision, in MiB/s. Valid only for `gp3` volumes. + Valid range: 125--2,000 MiB/s. + """ + encrypted: bool | None = ... + """ + Specifies whether to encrypt the volume. Encrypted volumes can be + attached only to instances that support Amazon EBS encryption. If you + create a volume from a snapshot, you cannot specify an encryption value. + """ + kms_key_id: str | None = ... + """ + The identifier (key ID, key alias, key ARN, or alias ARN) of the + customer managed KMS key to use for Amazon EBS encryption. + """ + free_space_gi_b: int | None = ... + """ + The free space guaranteed on the root volume, in GiB. AgentCore adds the + operating system overhead on top of this value. The default is 8 GiB. + """ + +@dataclass(kw_only=True) +class RotatePaymentConnectorCredentialsInput(_SerdeShape): + """Dataclass for RotatePaymentConnectorCredentialsInput structure.""" + + payment_manager_id: str | None = ... + """The unique identifier of the parent payment manager.""" + payment_connector_id: str | None = ... + """ + The unique identifier of the payment connector whose credentials you + want to rotate. + """ + credentials_to_rotate: CredentialRotationConfig | None = ... + """ + The credentials to rotate. Specify the member that matches the payment + connector's `type`. Each credential that you select is rotated + independently. + """ + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If you don't specify this field, a + value is randomly generated for you. If this token matches a previous + request, the service ignores the request, but doesn't return an error. + For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + +@dataclass(kw_only=True) +class RotatePaymentConnectorCredentialsOutput(_SerdeShape): + """Dataclass for RotatePaymentConnectorCredentialsOutput structure.""" + + payment_connector_id: str + """The unique identifier of the payment connector.""" + payment_manager_id: str + """The unique identifier of the parent payment manager.""" + last_updated_at: datetime + """ + The timestamp when the payment connector was last updated, which is when + the rotation completed. + """ + status: str + """ + The current status of the payment connector, which is `READY` after a + successful rotation. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass +class RouteToTargetActionStaticRoute(_SerdeShape): + """A static route that sends all matching requests to a single target.""" + + value: StaticRoute + +@dataclass +class RouteToTargetActionWeightedRoute(_SerdeShape): + """A weighted route that splits traffic between multiple targets.""" + + value: WeightedRoute + +@dataclass +class RouteToTargetActionUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +RouteToTargetAction = Union[ + RouteToTargetActionStaticRoute + | RouteToTargetActionWeightedRoute + | RouteToTargetActionUnknown +] +""" +An action that routes requests to a gateway target, either statically or +with weighted traffic splitting. +""" + +class _RouteToTargetActionDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> RouteToTargetAction: ... + +@dataclass(kw_only=True) +class Rule(_SerdeShape): + """ + The evaluation rule that defines sampling configuration, filtering + criteria, and session detection settings for online evaluation. + """ + + sampling_config: SamplingConfig + """ + The sampling configuration that determines what percentage of agent + traces to evaluate. + """ + filters: list[Filter] | None = ... + """ + The list of filters that determine which agent traces should be included + in the evaluation based on trace properties. + """ + session_config: SessionConfig | None = ... + """ + The session configuration that defines timeout settings for detecting + when agent sessions are complete and ready for evaluation. + """ + +@dataclass(kw_only=True) +class RuntimeMetadataConfiguration(_SerdeShape): + """Configuration for microVM metadata service settings.""" + + require_mmdsv2: bool + """ + Enables MMDSv2 (microVM Metadata Service Version 2) requirement for the + agent runtime. When set to `true`, the runtime microVM will only accept + MMDSv2 requests. + """ + +@dataclass(kw_only=True) +class RuntimeTargetConfiguration(_SerdeShape): + """ + Configuration for an AgentCore Runtime target. Specifies the agent + runtime to route requests to via HTTP. + """ + + arn: str + """ + The Amazon Resource Name (ARN) of the AgentCore Runtime to route + requests to. + """ + qualifier: str | None = ... + """ + The qualifier for the agent runtime, used to target a specific endpoint + version. If not specified, the default endpoint is used. + """ + schema: HttpApiSchemaConfiguration | None = ... + """ + The API schema configuration that defines the structure of the runtime + target's API. + """ + +@dataclass(kw_only=True) +class S3CertificateConfiguration(_SerdeShape): + """ + A reference to a PEM-encoded private CA certificate stored as an Amazon + S3 object. + """ + + uri: str + """ + The URI of the Amazon S3 object that contains the PEM-encoded + certificate. + """ + bucket_owner_account_id: str | None = ... + """ + The account ID of the Amazon S3 bucket owner. This ID is used for + cross-account access to the bucket. + """ + +@dataclass(kw_only=True) +class S3Configuration(_SerdeShape): + """ + The Amazon S3 configuration for a gateway. This structure defines how + the gateway accesses files in Amazon S3. + """ + + uri: str | None = ... + """ + The URI of the Amazon S3 object. This URI specifies the location of the + object in Amazon S3. + """ + bucket_owner_account_id: str | None = ... + """ + The account ID of the Amazon S3 bucket owner. This ID is used for + cross-account access to the bucket. + """ + +@dataclass(kw_only=True) +class S3FilesAccessPointConfiguration(_SerdeShape): + """ + Configuration for an Amazon S3 Files access point filesystem mounted + into the AgentCore Runtime. S3 Files access points provide shared file + storage accessible from your AgentCore Runtime sessions. + """ + + access_point_arn: str + """ + The ARN of the S3 Files access point to mount into the AgentCore + Runtime. + """ + mount_path: str + """ + The mount path for the S3 Files access point inside the AgentCore + Runtime. The path must be under `/mnt` with exactly one subdirectory + level (for example, `/mnt/data`). + """ + +@dataclass(kw_only=True) +class S3FilesConfiguration(_SerdeShape): + """ + The configuration for mounting an Amazon Simple Storage Service (Amazon + S3) Files access point that you own into a session. + """ + + access_point_arn: str + """ + The Amazon Resource Name (ARN) of the Amazon Simple Storage Service + (Amazon S3) Files access point to mount. + """ + mount_path: str + """ + The absolute path within the session at which the access point is + mounted, for example `/mnt/s3data`. Each mount path must be unique + across all file system configurations in the session. + """ + file_system_arn: str + """ + The Amazon Resource Name (ARN) of the Amazon Simple Storage Service + (Amazon S3) Files file system that owns the access point. + """ + +@dataclass(kw_only=True) +class S3Location(_SerdeShape): + """ + The Amazon S3 location for storing data. This structure defines where in + Amazon S3 data is stored. + """ + + bucket: str + """The name of the Amazon S3 bucket. This bucket contains the stored data.""" + prefix: str + """ + The prefix for objects in the Amazon S3 bucket. This prefix is added to + the object keys to organize the data. + """ + version_id: str | None = ... + """ + The version ID of the Amazon Amazon S3 object. If not specified, the + latest version of the object is used. + """ + +@dataclass(kw_only=True) +class S3Source(_SerdeShape): + """Amazon S3 location of a JSONL file containing dataset examples.""" + + s3_uri: str + """ + Amazon S3 URI of the JSONL file (for example, + `s3://my-bucket/path/to/examples.jsonl`). + """ + +@dataclass(kw_only=True) +class SalesforceOauth2ProviderConfigInput(_SerdeShape): + """Input configuration for a Salesforce OAuth2 provider.""" + + client_id: str + """The client ID for the Salesforce OAuth2 provider.""" + client_secret: str = ... + """The client secret for the Salesforce OAuth2 provider.""" + client_secret_config: SecretReference | None = ... + """ + A reference to the Amazon Web Services Secrets Manager secret that + stores the client secret. This includes the secret ID and the JSON key + used to extract the client secret value from the secret. Required when + `clientSecretSource` is set to `EXTERNAL`. + """ + client_secret_source: str | None = ... + """ + The source type of the client secret. Use `MANAGED` if the secret is + managed by the service, or `EXTERNAL` if you manage the secret yourself + in Amazon Web Services Secrets Manager. + """ + +@dataclass(kw_only=True) +class SalesforceOauth2ProviderConfigOutput(_SerdeShape): + """Output configuration for a Salesforce OAuth2 provider.""" + + oauth_discovery: Oauth2Discovery + """The OAuth2 discovery information for the Salesforce provider.""" + client_id: str | None = ... + """The client ID for the Salesforce OAuth2 provider.""" + +@dataclass(kw_only=True) +class SamplingConfig(_SerdeShape): + """ + The configuration that controls what percentage of agent traces are + sampled for evaluation to manage evaluation volume and costs. + """ + + sampling_percentage: float + """ + The percentage of agent traces to sample for evaluation, ranging from + 0.01% to 100%. + """ + +@dataclass(kw_only=True) +class SchemaDefinition(_SerdeShape): + """ + A schema definition for a gateway target. This structure defines the + structure of the API that the target exposes. + """ + + type: str + """ + The type of the schema definition. This field specifies the data type of + the schema. + """ + properties: dict[str, SchemaDefinition] | None = ... + """ + The properties of the schema definition. These properties define the + fields in the schema. + """ + required: list[str] | None = ... + """ + The required fields in the schema definition. These fields must be + provided when using the schema. + """ + items: SchemaDefinition | None = ... + """ + The items in the schema definition. This field is used for array types + to define the structure of the array elements. + """ + description: str | None = ... + """ + The description of the schema definition. This description provides + information about the purpose and usage of the schema. + """ + +class SchemaType(UnknownEnumMixin, StrEnum): + STRING = "string" + NUMBER = "number" + OBJECT = "object" + ARRAY = "array" + BOOLEAN = "boolean" + INTEGER = "integer" + +class SearchType(UnknownEnumMixin, StrEnum): + SEMANTIC = "SEMANTIC" + +@dataclass(kw_only=True) +class Secret(_SerdeShape): + """ + Contains information about a secret in Amazon Web Services Secrets + Manager. + """ + + secret_arn: str + """ + The Amazon Resource Name (ARN) of the secret in Amazon Web Services + Secrets Manager. + """ + +@dataclass(kw_only=True) +class SecretReference(_SerdeShape): + """ + Contains a reference to a secret stored in Amazon Web Services Secrets + Manager. + """ + + secret_id: str + """ + The ID of the Amazon Web Services Secrets Manager secret that stores the + secret value. + """ + json_key: str + """ + The JSON key used to extract the secret value from the Amazon Web + Services Secrets Manager secret. + """ + +@dataclass(kw_only=True) +class SecretsManagerCertificateConfiguration(_SerdeShape): + """ + A reference to a PEM-encoded private CA certificate stored in an Amazon + Web Services Secrets Manager secret. + """ + + secret_arn: str + """ + The Amazon Resource Name (ARN) of the Amazon Web Services Secrets + Manager secret that contains the PEM-encoded certificate. + """ + +@dataclass(kw_only=True) +class SecretsManagerLocation(_SerdeShape): + """The Amazon Web Services Secrets Manager location configuration.""" + + secret_arn: str + """ + The ARN of the Amazon Web Services Secrets Manager secret containing the + certificate. + """ + +class SecretSourceType(UnknownEnumMixin, StrEnum): + MANAGED = "MANAGED" + EXTERNAL = "EXTERNAL" + +@dataclass(kw_only=True) +class SelfManagedConfiguration(_SerdeShape): + """A configuration for a self-managed memory strategy.""" + + trigger_conditions: list[TriggerCondition] + """A list of conditions that trigger memory processing.""" + invocation_configuration: InvocationConfiguration + """The configuration to use when invoking memory processing.""" + historical_context_window_size: int + """The number of historical messages to include in processing context.""" + +@dataclass(kw_only=True) +class SelfManagedConfigurationInput(_SerdeShape): + """Input configuration for a self-managed memory strategy.""" + + trigger_conditions: list[TriggerConditionInput] | None = ... + """A list of conditions that trigger memory processing.""" + invocation_configuration: InvocationConfigurationInput + """Configuration to invoke a self-managed memory processing pipeline with.""" + historical_context_window_size: int = ... + """Number of historical messages to include in processing context.""" + +@dataclass +class SelfManagedLatticeResourceResourceConfigurationIdentifier(_SerdeShape): + """The ARN or ID of the VPC Lattice resource configuration.""" + + value: str + +@dataclass +class SelfManagedLatticeResourceUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +SelfManagedLatticeResource = Union[ + SelfManagedLatticeResourceResourceConfigurationIdentifier + | SelfManagedLatticeResourceUnknown +] +""" +Configuration for a self-managed VPC Lattice resource. You create and +manage the VPC Lattice resource gateway and resource configuration, then +provide the resource configuration identifier. +""" + +class _SelfManagedLatticeResourceDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> SelfManagedLatticeResource: ... + +@dataclass(kw_only=True) +class SemanticConsolidationOverride(_SerdeShape): + """Contains semantic consolidation override configuration.""" + + append_to_prompt: str + """The text to append to the prompt for semantic consolidation.""" + model_id: str + """The model ID to use for semantic consolidation.""" + +@dataclass(kw_only=True) +class SemanticExtractionOverride(_SerdeShape): + """Contains semantic extraction override configuration.""" + + append_to_prompt: str + """The text to append to the prompt for semantic extraction.""" + model_id: str + """The model ID to use for semantic extraction.""" + +@dataclass(kw_only=True) +class SemanticMemoryStrategyInput(_SerdeShape): + """Input for creating a semantic memory strategy.""" + + name: str + """The name of the semantic memory strategy.""" + description: str | None = ... + """The description of the semantic memory strategy.""" + namespaces: list[str] | None = ... + """ + This is a legacy parameter, use `namespaceTemplates`. The namespaces + associated with the semantic memory strategy. + """ + namespace_templates: list[str] | None = ... + """The namespaceTemplates associated with the semantic memory strategy.""" + memory_record_schema: MemoryRecordSchema | None = ... + """Schema for metadata on memory records generated by a strategy.""" + +@dataclass(kw_only=True) +class SemanticOverrideConfigurationInput(_SerdeShape): + """Input for semantic override configuration in a memory strategy.""" + + extraction: SemanticOverrideExtractionConfigurationInput | None = ... + """The extraction configuration for a semantic override.""" + consolidation: SemanticOverrideConsolidationConfigurationInput | None = ... + """The consolidation configuration for a semantic override.""" + +@dataclass(kw_only=True) +class SemanticOverrideConsolidationConfigurationInput(_SerdeShape): + """ + Input for semantic override consolidation configuration in a memory + strategy. + """ + + append_to_prompt: str + """The text to append to the prompt for semantic consolidation.""" + model_id: str + """The model ID to use for semantic consolidation.""" + +@dataclass(kw_only=True) +class SemanticOverrideExtractionConfigurationInput(_SerdeShape): + """ + Input for semantic override extraction configuration in a memory + strategy. + """ + + append_to_prompt: str + """The text to append to the prompt for semantic extraction.""" + model_id: str + """The model ID to use for semantic extraction.""" + +@dataclass(kw_only=True) +class ServerDefinition(_SerdeShape): + """ + The server definition for an MCP descriptor. Contains the schema version + and inline content for the MCP server configuration. + """ + + schema_version: str | None = ... + """ + The schema version of the server definition based on the MCP protocol + specification. If not specified, the version is auto-detected from the + content. + """ + inline_content: str | None = ... + """ + The JSON content containing the MCP server definition, conforming to the + MCP protocol specification. + """ + +class ServerProtocol(UnknownEnumMixin, StrEnum): + MCP = "MCP" + HTTP = "HTTP" + A2_A = "A2A" + AGUI = "AGUI" + +@dataclass(kw_only=True) +class ServiceException(ServiceError, _SerdeShape): + """An internal error occurred.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ServiceQuotaExceededException(ServiceError, _SerdeShape): + """This exception is thrown when a request is made beyond the service quota""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class SessionConfig(_SerdeShape): + """ + The configuration that defines how agent sessions are detected and when + they are considered complete for evaluation. + """ + + session_timeout_minutes: int + """ + The number of minutes of inactivity after which an agent session is + considered complete and ready for evaluation. Default is 15 minutes. + """ + +@dataclass(kw_only=True) +class SessionConfiguration(_SerdeShape): + """ + The session configuration for an MCP gateway. This structure defines + settings that control session behavior. + """ + + session_timeout_in_seconds: int | None = ... + """ + The session timeout in seconds. After this timeout, the session expires + and subsequent requests to this session will receive an error. The + minimum value is 900 seconds (15 minutes), the maximum value is 28800 + seconds (8 hours), and the default value is 3600 seconds (1 hour). + """ + +@dataclass(kw_only=True) +class SessionStorageConfiguration(_SerdeShape): + """ + Configuration for a session storage filesystem mounted into the + AgentCore Runtime. Session storage provides persistent storage that is + preserved across AgentCore Runtime session invocations. + """ + + mount_path: str + """ + The mount path for the session storage filesystem inside the AgentCore + Runtime. The path must be under `/mnt` with exactly one subdirectory + level (for example, `/mnt/data`). + """ + +@dataclass(kw_only=True) +class SetTokenVaultCMKInput(_SerdeShape): + """Dataclass for SetTokenVaultCMKInput structure.""" + + token_vault_id: str | None = ... + """The unique identifier of the token vault to update.""" + kms_configuration: KmsConfiguration | None = ... + """ + The KMS configuration for the token vault, including the key type and + KMS key ARN. + """ + +@dataclass(kw_only=True) +class SetTokenVaultCMKOutput(_SerdeShape): + """Dataclass for SetTokenVaultCMKOutput structure.""" + + token_vault_id: str + """The ID of the token vault.""" + kms_configuration: KmsConfiguration + """The KMS configuration for the token vault.""" + last_modified_date: datetime + """The timestamp when the token vault was last modified.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class SigningAlgorithm(UnknownEnumMixin, StrEnum): + RS256 = "RS256" + PS256 = "PS256" + ES256 = "ES256" + +@dataclass(kw_only=True) +class SkillDefinition(_SerdeShape): + """The structured skill definition with schema version and content.""" + + schema_version: str | None = ... + """The version of the skill definition schema.""" + inline_content: str | None = ... + """The JSON content containing the structured skill definition.""" + +@dataclass(kw_only=True) +class SkillMdDefinition(_SerdeShape): + """The skill markdown definition for an agent skills descriptor.""" + + inline_content: str | None = ... + """ + The markdown content describing the agent's skills in a human-readable + format. + """ + +@dataclass(kw_only=True) +class SlackOauth2ProviderConfigInput(_SerdeShape): + """Input configuration for a Slack OAuth2 provider.""" + + client_id: str + """The client ID for the Slack OAuth2 provider.""" + client_secret: str = ... + """The client secret for the Slack OAuth2 provider.""" + client_secret_config: SecretReference | None = ... + """ + A reference to the Amazon Web Services Secrets Manager secret that + stores the client secret. This includes the secret ID and the JSON key + used to extract the client secret value from the secret. Required when + `clientSecretSource` is set to `EXTERNAL`. + """ + client_secret_source: str | None = ... + """ + The source type of the client secret. Use `MANAGED` if the secret is + managed by the service, or `EXTERNAL` if you manage the secret yourself + in Amazon Web Services Secrets Manager. + """ + +@dataclass(kw_only=True) +class SlackOauth2ProviderConfigOutput(_SerdeShape): + """Output configuration for a Slack OAuth2 provider.""" + + oauth_discovery: Oauth2Discovery + """The OAuth2 discovery information for the Slack provider.""" + client_id: str | None = ... + """The client ID for the Slack OAuth2 provider.""" + +@dataclass(kw_only=True) +class StartPolicyGenerationInput(_SerdeShape): + """Dataclass for StartPolicyGenerationInput structure.""" + + policy_engine_id: str | None = ... + """ + The identifier of the policy engine that provides the context for policy + generation. This engine's schema and tool context are used to ensure + generated policies are valid and applicable. + """ + resource: Resource | None = ... + """ + The resource information that provides context for policy generation. + This helps the AI understand the target resources and generate + appropriate access control rules. + """ + content: Content | None = ... + """ + The natural language description of the desired policy behavior. This + content is processed by AI to generate corresponding Dogwood policy + statements that match the described intent. + """ + name: str | None = ... + """ + A customer-assigned name for the policy generation request. This helps + track and identify generation operations, especially when running + multiple generations simultaneously. + """ + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure the idempotency of the + request. The AWS SDK automatically generates this token, so you don't + need to provide it in most cases. If you retry a request with the same + client token, the service returns the same response without starting a + duplicate generation. + """ + +@dataclass(kw_only=True) +class StartPolicyGenerationOutput(_SerdeShape): + """Dataclass for StartPolicyGenerationOutput structure.""" + + policy_engine_id: str + """ + The identifier of the policy engine associated with the started policy + generation. + """ + policy_generation_id: str + """ + The unique identifier assigned to the policy generation request for + tracking progress. + """ + name: str + """The customer-assigned name for the policy generation request.""" + policy_generation_arn: str + """The ARN of the created policy generation request.""" + resource: Resource + """The resource information associated with the policy generation request.""" + created_at: datetime + """The timestamp when the policy generation request was created.""" + updated_at: datetime + """The timestamp when the policy generation was last updated.""" + status: str + """The initial status of the policy generation request.""" + findings: str | None = ... + """Initial findings from the policy generation process.""" + status_reasons: list[str] + """Additional information about the generation status.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class StaticOverride(_SerdeShape): + """A static configuration bundle override.""" + + bundle_arn: str + """The Amazon Resource Name (ARN) of the configuration bundle to apply.""" + bundle_version: str + """The version of the configuration bundle to apply.""" + +class StaticQueryParameterConflictResolution(UnknownEnumMixin, StrEnum): + """ + The precedence used when a client-supplied query parameter has the same + name as a configured static query parameter: + + - `CLIENT_OVERRIDE` - The client-supplied value overrides the configured + static value for that parameter name. This is the default. + + - `STATIC_OVERRIDE` - The configured static value is retained, + overriding the client-supplied value for that parameter name. + """ + + CLIENT_OVERRIDE = "CLIENT_OVERRIDE" + STATIC_OVERRIDE = "STATIC_OVERRIDE" + +@dataclass(kw_only=True) +class StaticRoute(_SerdeShape): + """A static route to a single gateway target.""" + + target_name: str + """The name of the target to route requests to.""" + +class Status(UnknownEnumMixin, StrEnum): + CREATING = "CREATING" + CREATE_FAILED = "CREATE_FAILED" + UPDATING = "UPDATING" + UPDATE_FAILED = "UPDATE_FAILED" + READY = "READY" + DELETING = "DELETING" + DELETE_FAILED = "DELETE_FAILED" + +@dataclass(kw_only=True) +class StickinessConfiguration(_SerdeShape): + """ + The configuration for session-sticky routing to a target. Session + stickiness routes requests that share a session identifier to the same + target. + """ + + identifier: str + """ + The expression that identifies where to extract the session identifier + from the request (for example, `$context.header.x-session-id`). + """ + timeout: int | None = ... + """ + The session stickiness timeout, in seconds. After this duration of + inactivity, the session affinity expires. Valid values range from 1 to + 86400. + """ + composite_identifier: list[str] | None = ... + """ + Additional headers to include in session affinity routing. When set, + requests are only considered part of the same session if both the + `identifier` and all composite identifier values match. + """ + +@dataclass(kw_only=True) +class StrategyConfiguration(_SerdeShape): + """Contains configuration information for a memory strategy.""" + + type: str | None = ... + """The type of override for the strategy configuration.""" + extraction: ExtractionConfiguration | None = ... + """The extraction configuration for the memory strategy.""" + consolidation: ConsolidationConfiguration | None = ... + """The consolidation configuration for the memory strategy.""" + reflection: ReflectionConfiguration | None = ... + """The reflection configuration for the memory strategy.""" + self_managed_configuration: SelfManagedConfiguration | None = ... + """Self-managed configuration settings.""" + +@dataclass +class StreamDeliveryResourceKinesis(_SerdeShape): + """Kinesis Data Stream configuration.""" + + value: KinesisResource + +@dataclass +class StreamDeliveryResourceUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +StreamDeliveryResource = Union[ + StreamDeliveryResourceKinesis | StreamDeliveryResourceUnknown +] +"""Supported stream delivery resource types.""" + +class _StreamDeliveryResourceDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> StreamDeliveryResource: ... + +@dataclass(kw_only=True) +class StreamDeliveryResources(_SerdeShape): + """Configuration for streaming memory record data to external resources.""" + + resources: list[StreamDeliveryResource] + """List of stream delivery resource configurations.""" + +@dataclass(kw_only=True) +class StreamingConfiguration(_SerdeShape): + """ + The streaming configuration for an MCP gateway. This structure defines + settings that control response streaming behavior. + """ + + enable_response_streaming: bool | None = ... + """ + Indicates whether response streaming is enabled for the gateway. When + set to `true`, the gateway streams responses from targets back to the + client. + """ + +@dataclass(kw_only=True) +class StringListValidation(_SerdeShape): + """Validation for STRINGLIST fields.""" + + allowed_values: list[str] | None = ... + """Allowed values for items in this STRINGLIST field.""" + max_items: int | None = ... + """Maximum number of items in the string list.""" + +@dataclass(kw_only=True) +class StringValidation(_SerdeShape): + """Validation for STRING fields.""" + + allowed_values: list[str] + """Allowed values for this STRING field.""" + +@dataclass(kw_only=True) +class StripePrivyConfigurationInput(_SerdeShape): + """Stripe Privy configuration --- credentials provided by Stripe and Privy.""" + + app_id: str + """The app ID provided by Privy.""" + app_secret: str = ... + """The app secret provided by Privy.""" + app_secret_source: str | None = ... + """ + The source type of the app secret. Use `MANAGED` if the secret is + managed by the service, or `EXTERNAL` if you manage the secret yourself + in Amazon Web Services Secrets Manager. + """ + app_secret_config: SecretReference | None = ... + """ + A reference to the Amazon Web Services Secrets Manager secret that + stores the app secret. This includes the secret ID and the JSON key used + to extract the app secret value from the secret. Required when + `appSecretSource` is set to `EXTERNAL`. + """ + authorization_private_key: str = ... + """The authorization private key for the Stripe Privy integration.""" + authorization_private_key_source: str | None = ... + """ + The source type of the authorization private key. Use `MANAGED` if the + secret is managed by the service, or `EXTERNAL` if you manage the secret + yourself in Amazon Web Services Secrets Manager. + """ + authorization_private_key_config: SecretReference | None = ... + """ + A reference to the Amazon Web Services Secrets Manager secret that + stores the authorization private key. This includes the secret ID and + the JSON key used to extract the authorization private key value from + the secret. Required when `authorizationPrivateKeySource` is set to + `EXTERNAL`. + """ + authorization_id: str + """The authorization ID for the Stripe Privy integration.""" + +@dataclass(kw_only=True) +class StripePrivyConfigurationOutput(_SerdeShape): + """Stripe Privy configuration output with secret ARNs.""" + + app_id: str + """The app ID provided by Privy.""" + app_secret_arn: Secret + """ + Contains information about a secret in Amazon Web Services Secrets + Manager. + """ + app_secret_json_key: str | None = ... + """ + The JSON key used to extract the app secret value from the Amazon Web + Services Secrets Manager secret. + """ + app_secret_source: str | None = ... + """ + The source type of the app secret. Either `MANAGED` if the secret is + managed by the service, or `EXTERNAL` if managed by the user in Amazon + Web Services Secrets Manager. + """ + authorization_private_key_arn: Secret + """ + Contains information about a secret in Amazon Web Services Secrets + Manager. + """ + authorization_private_key_json_key: str | None = ... + """ + The JSON key used to extract the authorization private key value from + the Amazon Web Services Secrets Manager secret. + """ + authorization_private_key_source: str | None = ... + """ + The source type of the authorization private key. Either `MANAGED` if + the secret is managed by the service, or `EXTERNAL` if managed by the + user in Amazon Web Services Secrets Manager. + """ + authorization_id: str + """The authorization ID for the Stripe Privy integration.""" + +@dataclass(kw_only=True) +class SubmitRegistryRecordForApprovalInput(_SerdeShape): + """Dataclass for SubmitRegistryRecordForApprovalInput structure.""" + + registry_id: str | None = ... + """ + The identifier of the registry containing the record. You can specify + either the Amazon Resource Name (ARN) or the ID of the registry. + """ + record_id: str | None = ... + """ + The identifier of the registry record to submit for approval. You can + specify either the Amazon Resource Name (ARN) or the ID of the record. + """ + +@dataclass(kw_only=True) +class SubmitRegistryRecordForApprovalOutput(_SerdeShape): + """Dataclass for SubmitRegistryRecordForApprovalOutput structure.""" + + registry_arn: str + """The Amazon Resource Name (ARN) of the registry that contains the record.""" + record_arn: str + """The Amazon Resource Name (ARN) of the registry record.""" + record_id: str + """The unique identifier of the registry record.""" + status: str + """The resulting status of the registry record after submission.""" + updated_at: datetime + """The timestamp when the record was last updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class SubscriptionRequiredException(ServiceError, _SerdeShape): + """ + The request failed because it requires an active Amazon Web Services + Marketplace subscription that is not present. Subscribe to the required + product in Amazon Web Services Marketplace and try again. + """ + + subscription_url: str | None = ... + """URL to the Marketplace listing for subscription""" + product_name: str | None = ... + """The product requiring subscription""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class SummaryConsolidationOverride(_SerdeShape): + """Contains summary consolidation override configuration.""" + + append_to_prompt: str + """The text to append to the prompt for summary consolidation.""" + model_id: str + """The model ID to use for summary consolidation.""" + +@dataclass(kw_only=True) +class SummaryMemoryStrategyInput(_SerdeShape): + """Input for creating a summary memory strategy.""" + + name: str + """The name of the summary memory strategy.""" + description: str | None = ... + """The description of the summary memory strategy.""" + namespaces: list[str] | None = ... + """ + This is a legacy parameter, use `namespaceTemplates`. The namespaces + associated with the summary memory strategy. + """ + namespace_templates: list[str] | None = ... + """The namespaceTemplates associated with the summary memory strategy.""" + memory_record_schema: MemoryRecordSchema | None = ... + """Schema for metadata fields on records generated by this strategy.""" + +@dataclass(kw_only=True) +class SummaryOverrideConfigurationInput(_SerdeShape): + """Input for summary override configuration in a memory strategy.""" + + consolidation: SummaryOverrideConsolidationConfigurationInput | None = ... + """The consolidation configuration for a summary override.""" + +@dataclass(kw_only=True) +class SummaryOverrideConsolidationConfigurationInput(_SerdeShape): + """ + Input for summary override consolidation configuration in a memory + strategy. + """ + + append_to_prompt: str + """The text to append to the prompt for summary consolidation.""" + model_id: str + """The model ID to use for summary consolidation.""" + +@dataclass(kw_only=True) +class SynchronizationConfiguration(_SerdeShape): + """ + Configuration for synchronizing registry record metadata from an + external source. + """ + + from_url: FromUrlSynchronizationConfiguration | None = ... + """Configuration for synchronizing from a URL-based source.""" + +class SynchronizationType(UnknownEnumMixin, StrEnum): + URL = "URL" + +@dataclass(kw_only=True) +class SynchronizeGatewayTargetsInput(_SerdeShape): + """Dataclass for SynchronizeGatewayTargetsInput structure.""" + + gateway_identifier: str | None = ... + """The gateway Identifier.""" + target_id_list: list[str] | None = ... + """The target ID list.""" + +@dataclass(kw_only=True) +class SynchronizeGatewayTargetsOutput(_SerdeShape): + """Dataclass for SynchronizeGatewayTargetsOutput structure.""" + + targets: list[GatewayTarget] | None = ... + """The gateway targets for synchronization.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class SystemManagedBlock(_SerdeShape): + """ + System-managed metadata for rules created by automated processes such as + A/B tests. + """ + + managed_by: str + """The identifier of the system or process that manages this rule.""" + +@dataclass(kw_only=True) +class TagResourceInput(_SerdeShape): + """Dataclass for TagResourceInput structure.""" + + resource_arn: str | None = ... + """The Amazon Resource Name (ARN) of the resource that you want to tag.""" + tags: dict[str, str] | None = ... + """The tags to add to the resource. A tag is a key-value pair.""" + +@dataclass(kw_only=True) +class TagResourceOutput(_SerdeShape): + """Dataclass for TagResourceOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass +class TargetConfigurationMcp(_SerdeShape): + """ + The Model Context Protocol (MCP) configuration for the target. This + configuration defines how the gateway uses MCP to communicate with the + target. + """ + + value: McpTargetConfiguration + +@dataclass +class TargetConfigurationHttp(_SerdeShape): + """ + The HTTP target configuration. Use this to route gateway requests to an + HTTP-based endpoint such as an AgentCore Runtime. + """ + + value: HttpTargetConfiguration + +@dataclass +class TargetConfigurationInference(_SerdeShape): + """ + The inference configuration for the target. This configuration routes + requests to a large language model (LLM) provider. + """ + + value: InferenceTargetConfiguration + +@dataclass +class TargetConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +TargetConfiguration = Union[ + TargetConfigurationMcp + | TargetConfigurationHttp + | TargetConfigurationInference + | TargetConfigurationUnknown +] +""" +The configuration for a gateway target. This structure defines how the +gateway connects to and interacts with the target endpoint. +""" + +class _TargetConfigurationDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> TargetConfiguration: ... + +class TargetProtocolType(UnknownEnumMixin, StrEnum): + MCP = "MCP" + HTTP = "HTTP" + +class TargetStatus(UnknownEnumMixin, StrEnum): + CREATING = "CREATING" + UPDATING = "UPDATING" + UPDATE_UNSUCCESSFUL = "UPDATE_UNSUCCESSFUL" + DELETING = "DELETING" + READY = "READY" + FAILED = "FAILED" + SYNCHRONIZING = "SYNCHRONIZING" + SYNCHRONIZE_UNSUCCESSFUL = "SYNCHRONIZE_UNSUCCESSFUL" + CREATE_PENDING_AUTH = "CREATE_PENDING_AUTH" + UPDATE_PENDING_AUTH = "UPDATE_PENDING_AUTH" + SYNCHRONIZE_PENDING_AUTH = "SYNCHRONIZE_PENDING_AUTH" + +@dataclass(kw_only=True) +class TargetSummary(_SerdeShape): + """ + Contains summary information about a gateway target. A target represents + an endpoint that the gateway can connect to. + """ + + target_id: str + """The unique identifier of the target.""" + name: str + """The name of the target.""" + status: str + """The current status of the target.""" + description: str | None = ... + """The description of the target.""" + created_at: datetime + """The timestamp when the target was created.""" + updated_at: datetime + """The timestamp when the target was last updated.""" + resource_priority: int | None = ... + """ + Priority for resolving resource URI conflicts across targets. Lower + values take precedence. Defaults to 1000 when not set. + """ + last_synchronized_at: datetime | None = ... + """The timestamp when the target was last synchronized.""" + authorization_data: AuthorizationData | None = ... + """ + Contains the authorization data that is returned when a gateway target + is configured with a credential provider with authorization code grant + type and requires user federation. + """ + target_type: str | None = ... + """The type of the target.""" + listing_mode: str | None = ... + """ + The listing mode for the target. MCP resources for `DEFAULT` targets are + cached at the control plane for faster access. MCP resources for + `DYNAMIC` targets are retrieved dynamically when listing tools. + """ + +@dataclass(kw_only=True) +class TargetTrafficSplitEntry(_SerdeShape): + """An entry in a target traffic split configuration.""" + + name: str + """The name of this traffic split variant.""" + weight: int + """The percentage of traffic to route to this variant.""" + target_name: str + """The name of the target to route traffic to.""" + description: str | None = ... + """The description of this traffic split variant.""" + metadata: dict[str, str] | None = ... + """Key-value metadata associated with this traffic split variant.""" + +class TargetType(UnknownEnumMixin, StrEnum): + OPEN_API_SCHEMA = "OPEN_API_SCHEMA" + SMITHY_MODEL = "SMITHY_MODEL" + MCP_SERVER = "MCP_SERVER" + LAMBDA_ = "LAMBDA" + API_GATEWAY = "API_GATEWAY" + CONNECTOR = "CONNECTOR" + AGENTCORE_RUNTIME = "AGENTCORE_RUNTIME" + PASSTHROUGH = "PASSTHROUGH" + PROVIDER = "PROVIDER" + HTTP_CONNECTOR = "HTTP_CONNECTOR" + +@dataclass(kw_only=True) +class ThrottledException(ServiceError, _SerdeShape): + """API rate limit has been exceeded.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ThrottlingException(ServiceError, _SerdeShape): + """This exception is thrown when the number of requests exceeds the limit""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class TimeBasedTrigger(_SerdeShape): + """Trigger configuration based on time.""" + + idle_session_timeout: int | None = ... + """Idle session timeout (seconds) that triggers memory processing.""" + +@dataclass(kw_only=True) +class TimeBasedTriggerInput(_SerdeShape): + """Trigger configuration based on time.""" + + idle_session_timeout: int = ... + """Idle session timeout (seconds) that triggers memory processing.""" + +@dataclass(kw_only=True) +class TokenBasedTrigger(_SerdeShape): + """Trigger configuration based on tokens.""" + + token_count: int | None = ... + """Number of tokens that trigger memory processing.""" + +@dataclass(kw_only=True) +class TokenBasedTriggerInput(_SerdeShape): + """Trigger configuration based on tokens.""" + + token_count: int = ... + """Number of tokens that trigger memory processing.""" + +@dataclass(kw_only=True) +class TokenExchangeGrantTypeConfigType(_SerdeShape): + """Configuration for RFC 8693 token exchange.""" + + actor_token_content: str + """The content type for the actor token in the token exchange.""" + actor_token_scopes: list[str] | None = ... + """ + The scopes for the actor token. Only valid when actorTokenContent is + M2M. + """ + +@dataclass(kw_only=True) +class ToolDefinition(_SerdeShape): + """ + A tool definition for a gateway target. This structure defines a tool + that the target exposes through the Model Context Protocol. + """ + + name: str + """ + The name of the tool. This name identifies the tool in the Model Context + Protocol. + """ + description: str + """ + The description of the tool. This description provides information about + the purpose and usage of the tool. + """ + input_schema: SchemaDefinition + """ + The input schema for the tool. This schema defines the structure of the + input that the tool accepts. + """ + output_schema: SchemaDefinition | None = ... + """ + The output schema for the tool. This schema defines the structure of the + output that the tool produces. + """ + +@dataclass +class ToolSchemaS3(_SerdeShape): + """ + The Amazon S3 location of the tool schema. This location contains the + schema definition file. + """ + + value: S3Configuration + +@dataclass +class ToolSchemaInlinePayload(_SerdeShape): + """ + The inline payload of the tool schema. This payload contains the schema + definition directly in the request. + """ + + value: list[ToolDefinition] + +@dataclass +class ToolSchemaUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ToolSchema = Union[ToolSchemaS3 | ToolSchemaInlinePayload | ToolSchemaUnknown] +""" +A tool schema for a gateway target. This structure defines the schema +for a tool that the target exposes through the Model Context Protocol. +""" + +class _ToolSchemaDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> ToolSchema: ... + +@dataclass(kw_only=True) +class ToolsDefinition(_SerdeShape): + """ + The tools definition for an MCP descriptor. Contains the protocol + version and inline content describing the available tools. + """ + + protocol_version: str | None = ... + """ + The protocol version of the tools definition based on the MCP protocol + specification. If not specified, the version is auto-detected from the + content. + """ + inline_content: str | None = ... + """ + The JSON content containing the MCP tools definition, conforming to the + MCP protocol specification. + """ + +@dataclass +class ToolsFileSystemConfigurationS3FilesConfiguration(_SerdeShape): + """ + The configuration for mounting your own Amazon Simple Storage Service + (Amazon S3) Files access point into the session. + """ + + value: S3FilesConfiguration + +@dataclass +class ToolsFileSystemConfigurationEfsConfiguration(_SerdeShape): + """ + The configuration for mounting your own Amazon Elastic File System + (Amazon EFS) access point into the session. + """ + + value: EfsConfiguration + +@dataclass +class ToolsFileSystemConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ToolsFileSystemConfiguration = Union[ + ToolsFileSystemConfigurationS3FilesConfiguration + | ToolsFileSystemConfigurationEfsConfiguration + | ToolsFileSystemConfigurationUnknown +] +""" +Specifies a file system to mount into the session by providing exactly +one of the following: + +- `s3FilesConfiguration` - Mounts an Amazon Simple Storage Service + (Amazon S3) Files access point. + +- `efsConfiguration` - Mounts an Amazon Elastic File System (Amazon EFS) + access point. +""" + +class _ToolsFileSystemConfigurationDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> ToolsFileSystemConfiguration: ... + +@dataclass(kw_only=True) +class TrafficSplitEntry(_SerdeShape): + """ + An entry in a traffic split configuration, defining a named variant with + a weight and configuration bundle reference. + """ + + name: str + """The name of this traffic split variant.""" + weight: int + """ + The percentage of traffic to route to this variant. Weights across all + entries must sum to 100. + """ + configuration_bundle: ConfigurationBundleReference + """The configuration bundle reference for this variant.""" + description: str | None = ... + """The description of this traffic split variant.""" + metadata: dict[str, str] | None = ... + """Key-value metadata associated with this traffic split variant.""" + +@dataclass +class TriggerConditionMessageBasedTrigger(_SerdeShape): + """Message based trigger configuration.""" + + value: MessageBasedTrigger + +@dataclass +class TriggerConditionTokenBasedTrigger(_SerdeShape): + """Token based trigger configuration.""" + + value: TokenBasedTrigger + +@dataclass +class TriggerConditionTimeBasedTrigger(_SerdeShape): + """Time based trigger configuration.""" + + value: TimeBasedTrigger + +@dataclass +class TriggerConditionUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +TriggerCondition = Union[ + TriggerConditionMessageBasedTrigger + | TriggerConditionTokenBasedTrigger + | TriggerConditionTimeBasedTrigger + | TriggerConditionUnknown +] +"""Condition that triggers memory processing.""" + +class _TriggerConditionDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> TriggerCondition: ... + +@dataclass +class TriggerConditionInputMessageBasedTrigger(_SerdeShape): + """Message based trigger configuration.""" + + value: MessageBasedTriggerInput + +@dataclass +class TriggerConditionInputTokenBasedTrigger(_SerdeShape): + """Token based trigger configuration.""" + + value: TokenBasedTriggerInput + +@dataclass +class TriggerConditionInputTimeBasedTrigger(_SerdeShape): + """Time based trigger configuration.""" + + value: TimeBasedTriggerInput + +@dataclass +class TriggerConditionInputUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +TriggerConditionInput = Union[ + TriggerConditionInputMessageBasedTrigger + | TriggerConditionInputTokenBasedTrigger + | TriggerConditionInputTimeBasedTrigger + | TriggerConditionInputUnknown +] +"""Condition that triggers memory processing.""" + +class _TriggerConditionInputDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> TriggerConditionInput: ... + +@dataclass(kw_only=True) +class UnauthorizedException(ServiceError, _SerdeShape): + """ + This exception is thrown when the JWT bearer token is invalid or not + found for OAuth bearer token based access + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UntagResourceInput(_SerdeShape): + """Dataclass for UntagResourceInput structure.""" + + resource_arn: str | None = ... + """The Amazon Resource Name (ARN) of the resource that you want to untag.""" + tag_keys: list[str] | None = ... + """The tag keys of the tags to remove from the resource.""" + +@dataclass(kw_only=True) +class UntagResourceOutput(_SerdeShape): + """Dataclass for UntagResourceOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateAgentRuntimeEndpointInput(_SerdeShape): + """Dataclass for UpdateAgentRuntimeEndpointInput structure.""" + + agent_runtime_id: str | None = ... + """ + The unique identifier of the AgentCore Runtime associated with the + endpoint. + """ + endpoint_name: str | None = ... + """The name of the AgentCore Runtime endpoint to update.""" + agent_runtime_version: str | None = ... + """The updated version of the AgentCore Runtime for the endpoint.""" + description: str | None = ... + """The updated description of the AgentCore Runtime endpoint.""" + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure idempotency of the + request. + """ + +@dataclass(kw_only=True) +class UpdateAgentRuntimeEndpointOutput(_SerdeShape): + """Dataclass for UpdateAgentRuntimeEndpointOutput structure.""" + + live_version: str | None = ... + """The currently deployed version of the AgentCore Runtime on the endpoint.""" + target_version: str | None = ... + """The target version of the AgentCore Runtime for the endpoint.""" + agent_runtime_endpoint_arn: str + """The Amazon Resource Name (ARN) of the AgentCore Runtime endpoint.""" + agent_runtime_arn: str + """The Amazon Resource Name (ARN) of the AgentCore Runtime.""" + status: str + """The current status of the updated AgentCore Runtime endpoint.""" + created_at: datetime + """The timestamp when the AgentCore Runtime endpoint was created.""" + last_updated_at: datetime + """The timestamp when the AgentCore Runtime endpoint was last updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateAgentRuntimeInput(_SerdeShape): + """Dataclass for UpdateAgentRuntimeInput structure.""" + + agent_runtime_id: str | None = ... + """The unique identifier of the AgentCore Runtime to update.""" + agent_runtime_artifact: AgentRuntimeArtifact | None = ... + """The updated artifact of the AgentCore Runtime.""" + role_arn: str | None = ... + """ + The updated IAM role ARN that provides permissions for the AgentCore + Runtime. + """ + network_configuration: NetworkConfiguration | None = ... + """The updated network configuration for the AgentCore Runtime.""" + description: str | None = ... + """The updated description of the AgentCore Runtime.""" + authorizer_configuration: AuthorizerConfiguration | None = ... + """The updated authorizer configuration for the AgentCore Runtime.""" + request_header_configuration: RequestHeaderConfiguration | None = ... + """ + The updated configuration for HTTP request headers that will be passed + through to the runtime. + """ + protocol_configuration: ProtocolConfiguration | None = ... + """ + The protocol configuration for an agent runtime. This structure defines + how the agent runtime communicates with clients. + """ + lifecycle_configuration: LifecycleConfiguration | None = ... + """The updated life cycle configuration for the AgentCore Runtime.""" + metadata_configuration: RuntimeMetadataConfiguration | None = ... + """ + The updated configuration for microVM Metadata Service (MMDS) settings + for the AgentCore Runtime. + """ + environment_variables: dict[str, str] | None = ... + """ + Updated environment variables to set in the AgentCore Runtime + environment. + """ + filesystem_configurations: list[FilesystemConfiguration] | None = ... + """ + The updated filesystem configurations to mount into the AgentCore + Runtime. + """ + capacity_provider_configuration: CapacityProviderConfiguration | None = ... + """The updated capacity provider configuration for the AgentCore Runtime.""" + platform_version: str | None = ... + """ + The updated version of the runtime platform to use for the AgentCore + Runtime. + """ + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure idempotency of the + request. + """ + +@dataclass(kw_only=True) +class UpdateAgentRuntimeOutput(_SerdeShape): + """Dataclass for UpdateAgentRuntimeOutput structure.""" + + agent_runtime_arn: str + """The Amazon Resource Name (ARN) of the updated AgentCore Runtime.""" + agent_runtime_id: str + """The unique identifier of the updated AgentCore Runtime.""" + workload_identity_details: WorkloadIdentityDetails | None = ... + """The workload identity details for the updated AgentCore Runtime.""" + agent_runtime_version: str + """The version of the updated AgentCore Runtime.""" + created_at: datetime + """The timestamp when the AgentCore Runtime was created.""" + last_updated_at: datetime + """The timestamp when the AgentCore Runtime was last updated.""" + status: str + """The current status of the updated AgentCore Runtime.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateApiKeyCredentialProviderInput(_SerdeShape): + """Dataclass for UpdateApiKeyCredentialProviderInput structure.""" + + name: str | None = ... + """The name of the API key credential provider to update.""" + api_key: str = ... + """ + The new API key to use for authentication. This value replaces the + existing API key and is encrypted and stored securely. + """ + api_key_secret_config: SecretReference | None = ... + """ + A reference to the Amazon Web Services Secrets Manager secret that + stores the API key. This includes the secret ID and the JSON key used to + extract the API key value from the secret. Required when + `apiKeySecretSource` is set to `EXTERNAL`. + """ + api_key_secret_source: str | None = ... + """ + The source type of the API key secret. Use `MANAGED` if the secret is + managed by the service, or `EXTERNAL` if you manage the secret yourself + in Amazon Web Services Secrets Manager. + """ + +@dataclass(kw_only=True) +class UpdateApiKeyCredentialProviderOutput(_SerdeShape): + """Dataclass for UpdateApiKeyCredentialProviderOutput structure.""" + + api_key_secret_arn: Secret + """ + The Amazon Resource Name (ARN) of the API key secret in Amazon Web + Services Secrets Manager. + """ + api_key_secret_json_key: str | None = ... + """ + The JSON key used to extract the API key value from the Amazon Web + Services Secrets Manager secret. + """ + api_key_secret_source: str | None = ... + """ + The source type of the API key secret. Either `MANAGED` if the secret is + managed by the service, or `EXTERNAL` if managed by the user in Amazon + Web Services Secrets Manager. + """ + name: str + """The name of the API key credential provider.""" + credential_provider_arn: str + """The Amazon Resource Name (ARN) of the API key credential provider.""" + created_time: datetime + """The timestamp when the API key credential provider was created.""" + last_updated_time: datetime + """The timestamp when the API key credential provider was last updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateCapacityProviderInput(_SerdeShape): + """Dataclass for UpdateCapacityProviderInput structure.""" + + capacity_provider_id: str | None = ... + """The unique identifier of the capacity provider to update.""" + description: UpdatedDescription | None = ... + """The updated description of the capacity provider.""" + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If you don't specify this field, a + value is randomly generated for you. If this token matches a previous + request, the service ignores the request, but doesn't return an error. + For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + +@dataclass(kw_only=True) +class UpdateCapacityProviderOutput(_SerdeShape): + """Dataclass for UpdateCapacityProviderOutput structure.""" + + capacity_provider_id: str + """The unique identifier of the capacity provider.""" + capacity_provider_arn: str + """The Amazon Resource Name (ARN) of the capacity provider.""" + name: str + """The name of the capacity provider.""" + status: str + """ + The current status of the capacity provider. For possible values, see + `CapacityProviderStatus`. + """ + created_at: datetime + """The timestamp when the capacity provider was created.""" + last_updated_at: datetime + """The timestamp when the capacity provider was last updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateConfigurationBundleInput(_SerdeShape): + """Dataclass for UpdateConfigurationBundleInput structure.""" + + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If you don't specify this field, a + value is randomly generated for you. If this token matches a previous + request, the service ignores the request, but doesn't return an error. + For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + bundle_id: str | None = ... + """The unique identifier of the configuration bundle to update.""" + bundle_name: str | None = ... + """The updated name for the configuration bundle.""" + description: str | None = ... + """The updated description for the configuration bundle.""" + components: dict[str, ComponentConfiguration] | None = ... + """ + The updated component configurations. Creates a new version of the + bundle. + """ + parent_version_ids: list[str] | None = ... + """ + A list of parent version identifiers for lineage tracking. Regular + commits have a single parent. Merge commits have two parents: the target + branch parent and the source branch parent. If the branch already + exists, the first parent must be the latest version on that branch. + """ + branch_name: str | None = ... + """ + The branch name for this version. If not specified, inherits the + parent's branch or defaults to `mainline`. + """ + commit_message: str | None = ... + """A commit message describing the changes in this version.""" + created_by: VersionCreatedBySource | None = ... + """ + The source that created this version, including the source name and + optional ARN. + """ + kms_key_arn: str | None = ... + """ + Optional KMS key ARN for encrypting component configurations. If + provided, components will be encrypted with this key. If the bundle + already has a KMS key, this rotates to the new key. + """ + +@dataclass(kw_only=True) +class UpdateConfigurationBundleOutput(_SerdeShape): + """Dataclass for UpdateConfigurationBundleOutput structure.""" + + bundle_arn: str + """The Amazon Resource Name (ARN) of the updated configuration bundle.""" + bundle_id: str + """The unique identifier of the updated configuration bundle.""" + version_id: str + """The new version identifier created by this update.""" + updated_at: datetime + """The timestamp when the configuration bundle was updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateConsentPortalInput(_SerdeShape): + """Dataclass for UpdateConsentPortalInput structure.""" + + consent_portal_identifier: str | None = ... + """ + The identifier of the consent portal. You can specify either the consent + portal ID or its Amazon Resource Name (ARN). + """ + execution_role_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the IAM role that the consent portal + assumes to access the resources defined in its sources. + """ + idp_config: ConsentPortalIdpConfig | None = ... + """ + The identity provider configuration that the consent portal uses to + authenticate end users. + """ + description: str | None = ... + """The description of the consent portal.""" + +@dataclass(kw_only=True) +class UpdateConsentPortalOutput(_SerdeShape): + """Dataclass for UpdateConsentPortalOutput structure.""" + + sources: list[ConsentPortalSource] + """The resources served by the consent portal.""" + consent_portal_arn: str + """The Amazon Resource Name (ARN) of the consent portal.""" + consent_portal_id: str + """The unique identifier of the consent portal.""" + created_at: datetime + """The timestamp for when the consent portal was created.""" + description: str | None = ... + """The description of the consent portal.""" + execution_role_arn: str + """ + The Amazon Resource Name (ARN) of the IAM role that the consent portal + assumes to access the resources defined in its sources. + """ + idp_config: ConsentPortalIdpConfig + """ + The identity provider configuration that the consent portal uses to + authenticate end users. + """ + name: str + """The name of the consent portal.""" + portal_url: str | None = ... + """The URL used to access the consent portal.""" + status: str + """The current status of the consent portal.""" + status_reason: str | None = ... + """ + A message that provides additional information about the current status + of the consent portal. + """ + updated_at: datetime + """The timestamp for when the consent portal was last updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdatedA2aDescriptor(_SerdeShape): + """ + Wrapper for updating an A2A descriptor with PATCH semantics. When + present, the A2A descriptor is replaced with the provided value. When + absent, the A2A descriptor is left unchanged. To unset, include the + wrapper with the value set to null. + """ + + optional_value: A2aDescriptor | None = ... + """The updated A2A descriptor value.""" + +@dataclass(kw_only=True) +class UpdatedAgentSkillsDescriptor(_SerdeShape): + """ + Wrapper for updating an agent skills descriptor with PATCH semantics. + When present with a value, individual fields can be updated + independently. When present with a null value, the entire agent skills + descriptor is unset. When absent, the agent skills descriptor is left + unchanged. + """ + + optional_value: UpdatedAgentSkillsDescriptorFields | None = ... + """The updated agent skills descriptor fields.""" + +@dataclass(kw_only=True) +class UpdatedAgentSkillsDescriptorFields(_SerdeShape): + """ + Individual agent skills descriptor fields that can be updated + independently. + """ + + skill_md: UpdatedSkillMdDefinition | None = ... + """The updated skill markdown definition.""" + skill_definition: UpdatedSkillDefinition | None = ... + """The updated skill definition.""" + +@dataclass(kw_only=True) +class UpdatedApprovalConfiguration(_SerdeShape): + """ + Wrapper for updating an optional approval configuration field with PATCH + semantics. When present in an update request, the approval configuration + is replaced with the provided value. When absent, the approval + configuration is left unchanged. + """ + + optional_value: ApprovalConfiguration | None = ... + """ + The updated approval configuration value. Set to `null` to unset the + approval configuration. + """ + +@dataclass(kw_only=True) +class UpdateDatasetExamplesInput(_SerdeShape): + """Dataclass for UpdateDatasetExamplesInput structure.""" + + dataset_id: str | None = ... + """The unique identifier of the dataset.""" + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If you don't specify this field, a + value is randomly generated for you. If this token matches a previous + request, the service ignores the request, but doesn't return an error. + For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + examples: list[Document] | None = ... + """ + Examples to update. Each element is a JSON object containing a required + `exampleId` field identifying the existing example, plus the replacement + fields. Maximum 1000 examples per call. + """ + +@dataclass(kw_only=True) +class UpdateDatasetExamplesOutput(_SerdeShape): + """Dataclass for UpdateDatasetExamplesOutput structure.""" + + dataset_arn: str + """The Amazon Resource Name (ARN) of the dataset.""" + dataset_id: str + """The unique identifier of the dataset.""" + status: str + """The current status of the dataset.""" + updated_count: int + """The number of examples updated.""" + updated_at: datetime + """The timestamp when the examples were updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateDatasetInput(_SerdeShape): + """Dataclass for UpdateDatasetInput structure.""" + + dataset_id: str | None = ... + """The unique identifier of the dataset to update.""" + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If you don't specify this field, a + value is randomly generated for you. If this token matches a previous + request, the service ignores the request, but doesn't return an error. + For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + description: str | None = ... + """The updated description for the dataset.""" + +@dataclass(kw_only=True) +class UpdateDatasetOutput(_SerdeShape): + """Dataclass for UpdateDatasetOutput structure.""" + + dataset_arn: str + """The Amazon Resource Name (ARN) of the updated dataset.""" + dataset_id: str + """The unique identifier of the updated dataset.""" + updated_at: datetime + """The timestamp when the dataset was updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdatedAuthorizerConfiguration(_SerdeShape): + """ + Wrapper for updating an optional AuthorizerConfiguration field with + PATCH semantics. When present in an update request, the authorizer + configuration is replaced with optionalValue. When absent, the + authorizer configuration is left unchanged. To unset, include the + wrapper with optionalValue not specified. + """ + + optional_value: AuthorizerConfiguration | None = ... + """ + The updated authorizer configuration value. If not specified, it will + clear the current authorizer configuration of the resource. + """ + +@dataclass(kw_only=True) +class UpdatedCustomDescriptor(_SerdeShape): + """ + Wrapper for updating a custom descriptor with PATCH semantics. When + present, the custom descriptor is replaced with the provided value. When + absent, the custom descriptor is left unchanged. To unset, include the + wrapper with the value set to null. + """ + + optional_value: CustomDescriptor | None = ... + """The updated custom descriptor value.""" + +@dataclass(kw_only=True) +class UpdatedDescription(_SerdeShape): + """ + Wrapper for updating an optional Description field with PATCH semantics. + When present in an update request, the description is replaced with + optionalValue. When absent, the description is left unchanged. To unset + the description, include the wrapper with optionalValue not specified. + """ + + optional_value: str | None = ... + """ + Represents an optional value that is used to update the human-readable + description of the resource. If not specified, it will clear the current + description of the resource. + """ + +@dataclass(kw_only=True) +class UpdatedDescriptors(_SerdeShape): + """ + Wrapper for updating an optional descriptors field with PATCH semantics. + When present with a value, individual descriptors can be updated. When + present with a null value, all descriptors are unset. When absent, + descriptors are left unchanged. + """ + + optional_value: UpdatedDescriptorsUnion | None = ... + """ + The updated descriptors value. Contains per-descriptor-type wrappers + that are each independently updatable. + """ + +@dataclass(kw_only=True) +class UpdatedDescriptorsUnion(_SerdeShape): + """ + Contains per-descriptor-type wrappers for updating descriptors. Each + descriptor type can be updated independently. + """ + + mcp: UpdatedMcpDescriptor | None = ... + """The updated MCP descriptor.""" + a2a: UpdatedA2aDescriptor | None = ... + """The updated A2A descriptor.""" + custom: UpdatedCustomDescriptor | None = ... + """The updated custom descriptor.""" + agent_skills: UpdatedAgentSkillsDescriptor | None = ... + """The updated agent skills descriptor.""" + +@dataclass(kw_only=True) +class UpdatedHarnessEnvironmentArtifact(_SerdeShape): + """Wrapper for updating the environment artifact configuration.""" + + optional_value: HarnessEnvironmentArtifact | None = ... + """ + The updated environment artifact value, or null to clear the existing + configuration. + """ + +@dataclass(kw_only=True) +class UpdatedHarnessMemoryConfiguration(_SerdeShape): + """Wrapper for updating the memory configuration.""" + + optional_value: HarnessMemoryConfiguration | None = ... + """ + The updated memory configuration value, or null to clear the existing + configuration. + """ + +@dataclass(kw_only=True) +class UpdatedMcpDescriptor(_SerdeShape): + """ + Wrapper for updating an MCP descriptor with PATCH semantics. When + present with a value, individual MCP fields can be updated + independently. When present with a null value, the entire MCP descriptor + is unset. When absent, the MCP descriptor is left unchanged. + """ + + optional_value: UpdatedMcpDescriptorFields | None = ... + """The updated MCP descriptor fields.""" + +@dataclass(kw_only=True) +class UpdatedMcpDescriptorFields(_SerdeShape): + """Individual MCP descriptor fields that can be updated independently.""" + + server: UpdatedServerDefinition | None = ... + """The updated server definition for the MCP descriptor.""" + tools: UpdatedToolsDefinition | None = ... + """The updated tools definition for the MCP descriptor.""" + +@dataclass(kw_only=True) +class UpdatedServerDefinition(_SerdeShape): + """ + Wrapper for updating a server definition with PATCH semantics. When + present, the server definition is replaced with the provided value. When + absent, the server definition is left unchanged. To unset, include the + wrapper with the value set to null. + """ + + optional_value: ServerDefinition | None = ... + """The updated server definition value.""" + +@dataclass(kw_only=True) +class UpdatedSkillDefinition(_SerdeShape): + """Wrapper for updating a skill definition with PATCH semantics.""" + + optional_value: SkillDefinition | None = ... + """The updated skill definition value.""" + +@dataclass(kw_only=True) +class UpdatedSkillMdDefinition(_SerdeShape): + """Wrapper for updating a skill markdown definition with PATCH semantics.""" + + optional_value: SkillMdDefinition | None = ... + """The updated skill markdown definition value.""" + +@dataclass(kw_only=True) +class UpdatedSynchronizationConfiguration(_SerdeShape): + """ + Wrapper for updating the synchronization configuration with PATCH + semantics. Must be matched with `UpdatedSynchronizationType`. + """ + + optional_value: SynchronizationConfiguration | None = ... + """The updated synchronization configuration value.""" + +@dataclass(kw_only=True) +class UpdatedSynchronizationType(_SerdeShape): + """ + Wrapper for updating the synchronization type with PATCH semantics. Must + be matched with `UpdatedSynchronizationConfiguration`. + """ + + optional_value: str | None = ... + """The updated synchronization type value.""" + +@dataclass(kw_only=True) +class UpdatedToolsDefinition(_SerdeShape): + """ + Wrapper for updating a tools definition with PATCH semantics. When + present, the tools definition is replaced with the provided value. When + absent, the tools definition is left unchanged. To unset, include the + wrapper with the value set to null. + """ + + optional_value: ToolsDefinition | None = ... + """The updated tools definition value.""" + +@dataclass(kw_only=True) +class UpdateEvaluatorInput(_SerdeShape): + """Dataclass for UpdateEvaluatorInput structure.""" + + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If you don't specify this field, a + value is randomly generated for you. If this token matches a previous + request, the service ignores the request, but doesn't return an error. + For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + evaluator_id: str | None = ... + """The unique identifier of the evaluator to update.""" + description: str | None = ... + """The updated description of the evaluator.""" + evaluator_config: EvaluatorConfig | None = ... + """ + The updated configuration for the evaluator. Specify either + LLM-as-a-Judge settings with instructions, rating scale, and model + configuration, or code-based settings with a customer-managed Lambda + function. + """ + level: str | None = ... + """ + The updated evaluation level (`TOOL_CALL`, `TRACE`, or `SESSION`) that + determines the scope of evaluation. + """ + kms_key_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of a customer managed KMS key to use for + encrypting sensitive evaluator data. Specify a new key ARN to rotate the + encryption key, or specify a key ARN to add encryption to an evaluator + that was previously created without one. When you rotate to a new key, + the service decrypts the existing data with the old key and re-encrypts + it with the new key. Only symmetric encryption KMS keys are supported. + For more information, see [Encryption at rest for AgentCore + Evaluations](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/evaluations-encryption.html). + """ + +@dataclass(kw_only=True) +class UpdateEvaluatorOutput(_SerdeShape): + """Dataclass for UpdateEvaluatorOutput structure.""" + + evaluator_arn: str + """The Amazon Resource Name (ARN) of the updated evaluator.""" + evaluator_id: str + """The unique identifier of the updated evaluator.""" + updated_at: datetime + """The timestamp when the evaluator was last updated.""" + status: str + """The status of the evaluator update operation.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateGatewayInput(_SerdeShape): + """Dataclass for UpdateGatewayInput structure.""" + + gateway_identifier: str | None = ... + """The identifier of the gateway to update.""" + name: str | None = ... + """ + The name of the gateway. This name must be the same as the one when the + gateway was created. + """ + description: str | None = ... + """The updated description for the gateway.""" + role_arn: str | None = ... + """The updated IAM role ARN that provides permissions for the gateway.""" + protocol_type: str = ... + """The updated protocol type for the gateway.""" + protocol_configuration: GatewayProtocolConfiguration | None = ... + """ + The configuration for a gateway protocol. This structure defines how the + gateway communicates with external services. + """ + authorizer_type: str | None = ... + """The updated authorizer type for the gateway.""" + authorizer_configuration: AuthorizerConfiguration | None = ... + """The updated authorizer configuration for the gateway.""" + kms_key_arn: str | None = ... + """The updated ARN of the KMS key used to encrypt the gateway.""" + custom_transform_configuration: CustomTransformConfiguration | None = ... + """ + The updated custom transformation configuration for the gateway. This + configuration defines how the gateway transforms requests and responses. + """ + interceptor_configurations: list[GatewayInterceptorConfiguration] | None = ... + """The updated interceptor configurations for the gateway.""" + policy_engine_configuration: GatewayPolicyEngineConfiguration | None = ... + """ + The updated policy engine configuration for the gateway. A policy engine + is a collection of policies that evaluates and authorizes agent tool + calls. When associated with a gateway, the policy engine intercepts all + agent requests and determines whether to allow or deny each action based + on the defined policies. + """ + exception_level: str | None = ... + """ + The level of detail in error messages returned when invoking the + gateway. + + - If the value is `DEBUG`, granular exception messages are returned to + help a user debug the gateway. + + - If the value is omitted, a generic error message is returned to the + end user. + """ + waf_configuration: WafConfiguration | None = ... + """The updated Amazon Web Services WAF configuration for the gateway.""" + +@dataclass(kw_only=True) +class UpdateGatewayOutput(_SerdeShape): + """Dataclass for UpdateGatewayOutput structure.""" + + gateway_arn: str + """The Amazon Resource Name (ARN) of the updated gateway.""" + gateway_id: str + """The unique identifier of the updated gateway.""" + gateway_url: str | None = ... + """An endpoint for invoking the updated gateway.""" + created_at: datetime + """The timestamp when the gateway was created.""" + updated_at: datetime + """The timestamp when the gateway was last updated.""" + status: str + """The current status of the updated gateway.""" + status_reasons: list[str] | None = ... + """The reasons for the current status of the updated gateway.""" + name: str + """The name of the gateway.""" + description: str | None = ... + """The updated description of the gateway.""" + role_arn: str | None = ... + """The updated IAM role ARN that provides permissions for the gateway.""" + protocol_type: str = ... + """The updated protocol type for the gateway.""" + protocol_configuration: GatewayProtocolConfiguration | None = ... + """ + The configuration for a gateway protocol. This structure defines how the + gateway communicates with external services. + """ + authorizer_type: str + """The updated authorizer type for the gateway.""" + authorizer_configuration: AuthorizerConfiguration | None = ... + """The updated authorizer configuration for the gateway.""" + kms_key_arn: str | None = ... + """The updated ARN of the KMS key used to encrypt the gateway.""" + custom_transform_configuration: CustomTransformConfiguration | None = ... + """ + The custom transformation configuration for the gateway. This + configuration defines how the gateway transforms requests and responses. + """ + interceptor_configurations: list[GatewayInterceptorConfiguration] | None = ... + """The updated interceptor configurations for the gateway.""" + policy_engine_configuration: GatewayPolicyEngineConfiguration | None = ... + """The updated policy engine configuration for the gateway.""" + workload_identity_details: WorkloadIdentityDetails | None = ... + """The workload identity details for the updated gateway.""" + exception_level: str | None = ... + """ + The level of detail in error messages returned when invoking the + gateway. + + - If the value is `DEBUG`, granular exception messages are returned to + help a user debug the gateway. + + - If the value is omitted, a generic error message is returned to the + end user. + """ + web_acl_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the Amazon Web Services WAF web ACL + associated with the gateway. + """ + waf_configuration: WafConfiguration | None = ... + """The Amazon Web Services WAF configuration for the gateway.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateGatewayRateLimitInput(_SerdeShape): + """Dataclass for UpdateGatewayRateLimitInput structure.""" + + gateway_identifier: str | None = ... + """The unique identifier of the gateway.""" + rate_limit_id: str | None = ... + """The unique identifier of the rate limit to update.""" + description: str | None = ... + """The updated human-readable description for this rate limit.""" + entries: list[LimitEntry] | None = ... + """ + The updated rule entries. The dimension keys are immutable after + creation and cannot be changed. + """ + +@dataclass(kw_only=True) +class UpdateGatewayRateLimitOutput(_SerdeShape): + """Shared fields for `GatewayRateLimit` responses.""" + + rate_limit_id: str + """The unique identifier of the rate limit.""" + gateway_identifier: str + """The unique identifier of the gateway.""" + description: str | None = ... + """The human-readable description of the rate limit.""" + dimension_keys: list[str] + """ + The ordered list of dimension key names that define the scope of this + rate limit. + """ + entries: list[LimitEntry] + """ + The list of rule entries that map dimension values to rate + configurations. + """ + status: str + """The current status of the rate limit.""" + created_at: datetime + """The timestamp when the rate limit was created.""" + updated_at: datetime + """The timestamp when the rate limit was last updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateGatewayRuleInput(_SerdeShape): + """Dataclass for UpdateGatewayRuleInput structure.""" + + gateway_identifier: str | None = ... + """The identifier of the gateway containing the rule.""" + rule_id: str | None = ... + """The unique identifier of the rule to update.""" + priority: int | None = ... + """The updated priority of the rule.""" + conditions: list[Condition] | None = ... + """The updated conditions for the rule.""" + actions: list[Action] | None = ... + """The updated actions for the rule.""" + description: str | None = ... + """The updated description of the rule.""" + +@dataclass(kw_only=True) +class UpdateGatewayRuleOutput(_SerdeShape): + """ + Create response excludes updatedAt (redundant on create). Get/Update + responses include it via their own output structures. + """ + + rule_id: str + """The unique identifier of the gateway rule.""" + gateway_arn: str + """The Amazon Resource Name (ARN) of the gateway that the rule belongs to.""" + priority: int + """ + The priority of the rule. Rules are evaluated in order of priority, with + lower numbers evaluated first. + """ + conditions: list[Condition] | None = ... + """The conditions that must be met for the rule to apply.""" + actions: list[Action] + """The actions to take when the rule conditions are met.""" + description: str | None = ... + """The description of the gateway rule.""" + created_at: datetime + """The timestamp when the rule was created.""" + status: str + """The current status of the rule.""" + system: SystemManagedBlock | None = ... + """System-managed metadata for rules created by automated processes.""" + updated_at: datetime | None = ... + """The timestamp when the rule was last updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateGatewayTargetInput(_SerdeShape): + """Dataclass for UpdateGatewayTargetInput structure.""" + + gateway_identifier: str | None = ... + """The unique identifier of the gateway associated with the target.""" + target_id: str | None = ... + """The unique identifier of the gateway target to update.""" + name: str | None = ... + """The updated name for the gateway target.""" + description: str | None = ... + """The updated description for the gateway target.""" + target_configuration: TargetConfiguration | None = ... + """ + The configuration for a gateway target. This structure defines how the + gateway connects to and interacts with the target endpoint. + """ + credential_provider_configurations: ( + list[CredentialProviderConfiguration] | None + ) = ... + """The updated credential provider configurations for the gateway target.""" + metadata_configuration: MetadataConfiguration | None = ... + """ + Configuration for HTTP header and query parameter propagation to the + gateway target. + """ + private_endpoint: PrivateEndpoint | None = ... + """ + The private endpoint configuration for the gateway target. Use this to + connect the gateway to private resources in your VPC. + """ + certificate_configurations: list[CertificateConfiguration] | None = ... + """ + The private certificate authority (CA) configurations for the gateway + target. Use this to have the gateway trust a private CA when it + establishes TLS connections to the target endpoint. Provide each + certificate by reference to an Amazon S3 object or an Amazon Web + Services Secrets Manager secret. You can specify only one certificate + authority configuration in this list. To remove a previously configured + certificate authority, omit this field on update. + """ + +@dataclass(kw_only=True) +class UpdateGatewayTargetOutput(_SerdeShape): + """Dataclass for UpdateGatewayTargetOutput structure.""" + + gateway_arn: str + """The Amazon Resource Name (ARN) of the gateway.""" + target_id: str + """The unique identifier of the updated gateway target.""" + created_at: datetime + """The timestamp when the gateway target was created.""" + updated_at: datetime + """The timestamp when the gateway target was last updated.""" + status: str + """The current status of the updated gateway target.""" + status_reasons: list[str] | None = ... + """The reasons for the current status of the updated gateway target.""" + name: str + """The updated name of the gateway target.""" + description: str | None = ... + """The updated description of the gateway target.""" + target_configuration: TargetConfiguration + """ + The configuration for a gateway target. This structure defines how the + gateway connects to and interacts with the target endpoint. + """ + credential_provider_configurations: list[CredentialProviderConfiguration] + """The updated credential provider configurations for the gateway target.""" + last_synchronized_at: datetime | None = ... + """The date and time at which the targets were last synchronized.""" + metadata_configuration: MetadataConfiguration | None = ... + """The metadata configuration that was applied to the gateway target.""" + private_endpoint: PrivateEndpoint | None = ... + """The private endpoint configuration for the gateway target.""" + private_endpoint_managed_resources: list[ManagedResourceDetails] | None = ... + """ + The managed resources created by the gateway for private endpoint + connectivity. + """ + authorization_data: AuthorizationData | None = ... + """ + OAuth2 authorization data for the updated gateway target. This data is + returned when a target is configured with a credential provider with + authorization code grant type and requires user federation. + """ + protocol_type: str | None = ... + """The protocol type of the updated gateway target.""" + certificate_configurations: list[CertificateConfiguration] | None = ... + """ + The private certificate authority (CA) configurations for the gateway + target. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateHarnessEndpointInput(_SerdeShape): + """Dataclass for UpdateHarnessEndpointInput structure.""" + + harness_id: str | None = ... + """The ID of the harness that the endpoint belongs to.""" + endpoint_name: str | None = ... + """The name of the endpoint to update.""" + target_version: str | None = ... + """ + The harness version that the endpoint points to. If not specified, the + existing value is retained. + """ + description: str | None = ... + """ + A description of the endpoint. If not specified, the existing value is + retained. + """ + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure idempotency of the + request. + """ + +@dataclass(kw_only=True) +class UpdateHarnessEndpointOutput(_SerdeShape): + """Dataclass for UpdateHarnessEndpointOutput structure.""" + + endpoint: HarnessEndpoint + """The updated endpoint.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateHarnessInput(_SerdeShape): + """Dataclass for UpdateHarnessInput structure.""" + + harness_id: str | None = ... + """The ID of the harness to update.""" + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure idempotency of the + request. + """ + execution_role_arn: str | None = ... + """ + The ARN of the IAM role that the harness assumes when running. If not + specified, the existing value is retained. + """ + environment: HarnessEnvironmentProviderRequest | None = ... + """ + The compute environment configuration for the harness. If not specified, + the existing value is retained. + """ + environment_artifact: UpdatedHarnessEnvironmentArtifact | None = ... + """ + The environment artifact for the harness. Use the optionalValue wrapper + to set a new value, or set it to null to clear the existing + configuration. + """ + environment_variables: dict[str, str] | None = ... + """ + Environment variables to set in the harness runtime environment. If + specified, this replaces all existing environment variables. If not + specified, the existing value is retained. + """ + authorizer_configuration: UpdatedAuthorizerConfiguration | None = ... + """ + Wrapper for updating an optional AuthorizerConfiguration field with + PATCH semantics. When present in an update request, the authorizer + configuration is replaced with optionalValue. When absent, the + authorizer configuration is left unchanged. To unset, include the + wrapper with optionalValue not specified. + """ + model: HarnessModelConfiguration | None = ... + """ + The model configuration for the harness. If not specified, the existing + value is retained. + """ + system_prompt: list[HarnessSystemContentBlock] | None = ... + """ + The system prompt that defines the agent's behavior. If not specified, + the existing value is retained. + """ + tools: list[HarnessTool] | None = ... + """ + The tools available to the agent. If specified, this replaces all + existing tools. If not specified, the existing value is retained. + """ + skills: list[HarnessSkill] | None = ... + """ + The skills available to the agent. If specified, this replaces all + existing skills. If not specified, the existing value is retained. + """ + allowed_tools: list[str] | None = ... + """ + The tools that the agent is allowed to use. If specified, this replaces + all existing allowed tools. If not specified, the existing value is + retained. + """ + memory: UpdatedHarnessMemoryConfiguration | None = ... + """ + The AgentCore Memory configuration. Use the optionalValue wrapper to set + a new value, or set it to null to clear the existing configuration. + """ + truncation: HarnessTruncationConfiguration | None = ... + """ + The truncation configuration for managing conversation context. If not + specified, the existing value is retained. + """ + hooks: list[HarnessHook] | None = ... + """ + The lifecycle hooks to run at defined points in the agent loop. If + specified, this replaces all existing hooks. If not specified, the + existing hooks are retained. + """ + max_iterations: int | None = ... + """ + The maximum number of iterations the agent loop can execute per + invocation. If not specified, the existing value is retained. + """ + max_tokens: int | None = ... + """ + The maximum total number of output tokens the agent can generate across + all model calls within a single invocation. If not specified, the + existing value is retained. + """ + timeout_seconds: int | None = ... + """ + The maximum duration in seconds for the agent loop execution per + invocation. If not specified, the existing value is retained. + """ + +@dataclass(kw_only=True) +class UpdateHarnessOutput(_SerdeShape): + """Dataclass for UpdateHarnessOutput structure.""" + + harness: Harness + """The updated harness.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateMemoryInput(_SerdeShape): + """Dataclass for UpdateMemoryInput structure.""" + + client_token: str | None = ... + """ + A client token is used for keeping track of idempotent requests. It can + contain a session id which can be around 250 chars, combined with a + unique AWS identifier. + """ + memory_id: str | None = ... + """The unique identifier of the memory to update.""" + description: str | None = ... + """The updated description of the AgentCore Memory resource.""" + event_expiry_duration: int | None = ... + """ + The number of days after which memory events will expire, between 7 and + 365 days. + """ + memory_execution_role_arn: str | None = ... + """ + The ARN of the IAM role that provides permissions for the AgentCore + Memory resource. + """ + memory_strategies: ModifyMemoryStrategies | None = ... + """The memory strategies to add, modify, or delete.""" + add_indexed_keys: list[IndexedKey] | None = ... + """ + Additional metadata keys to index. Previously indexed keys cannot be + removed. + """ + namespace_keys: list[NamespaceKeyEntry] | None = ... + """ + The namespace variable key definitions with validation rules for this + memory. This value fully replaces the existing set --- any key you omit + is removed. Any referenced `namespaceKey` omission will throw + ValidationException. + """ + stream_delivery_resources: StreamDeliveryResources | None = ... + """Configuration for streaming memory record data to external resources.""" + +@dataclass(kw_only=True) +class UpdateMemoryOutput(_SerdeShape): + """Dataclass for UpdateMemoryOutput structure.""" + + memory: Memory | None = ... + """The updated AgentCore Memory resource details.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateOauth2CredentialProviderInput(_SerdeShape): + """Dataclass for UpdateOauth2CredentialProviderInput structure.""" + + name: str | None = ... + """The name of the OAuth2 credential provider to update.""" + credential_provider_vendor: str | None = ... + """The vendor of the OAuth2 credential provider.""" + oauth2_provider_config_input: Oauth2ProviderConfigInput | None = ... + """The configuration input for the OAuth2 provider.""" + +@dataclass(kw_only=True) +class UpdateOauth2CredentialProviderOutput(_SerdeShape): + """Dataclass for UpdateOauth2CredentialProviderOutput structure.""" + + client_secret_arn: Secret + """ + The Amazon Resource Name (ARN) of the client secret in Amazon Web + Services Secrets Manager. + """ + client_secret_json_key: str | None = ... + """ + The JSON key used to extract the client secret value from the Amazon Web + Services Secrets Manager secret. + """ + client_secret_source: str | None = ... + """ + The source type of the client secret. Either `MANAGED` if the secret is + managed by the service, or `EXTERNAL` if managed by the user in Amazon + Web Services Secrets Manager. + """ + name: str + """The name of the OAuth2 credential provider.""" + credential_provider_vendor: str + """The vendor of the OAuth2 credential provider.""" + credential_provider_arn: str + """The Amazon Resource Name (ARN) of the OAuth2 credential provider.""" + callback_url: str | None = ... + """ + Callback URL to register on the OAuth2 credential provider as an allowed + callback URL. This URL is where the OAuth2 authorization server + redirects users after they complete the authorization flow. + """ + oauth2_provider_config_output: Oauth2ProviderConfigOutput + """The configuration output for the OAuth2 provider.""" + created_time: datetime + """The timestamp when the OAuth2 credential provider was created.""" + last_updated_time: datetime + """The timestamp when the OAuth2 credential provider was last updated.""" + status: str | None = ... + """The current status of the updated OAuth2 credential provider.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateOnlineEvaluationConfigInput(_SerdeShape): + """Dataclass for UpdateOnlineEvaluationConfigInput structure.""" + + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If you don't specify this field, a + value is randomly generated for you. If this token matches a previous + request, the service ignores the request, but doesn't return an error. + For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + online_evaluation_config_id: str | None = ... + """The unique identifier of the online evaluation configuration to update.""" + description: str | None = ... + """The updated description of the online evaluation configuration.""" + rule: Rule | None = ... + """ + The updated evaluation rule containing sampling configuration, filters, + and session settings. + """ + data_source_config: DataSourceConfig | None = ... + """ + The updated data source configuration specifying CloudWatch log groups + and service names to monitor. + """ + evaluators: list[EvaluatorReference] | None = ... + """The updated list of evaluators to apply during online evaluation.""" + insights: list[Insight] | None = ... + """The updated list of insight types to run against agent sessions.""" + clustering_config: ClusteringConfig | None = ... + """The updated clustering configuration for periodic batch evaluation.""" + output_config: OutputConfig | None = ... + """ + The configuration that specifies where evaluation results should be + written for monitoring and analysis. + """ + evaluation_execution_role_arn: str | None = ... + """ + The updated Amazon Resource Name (ARN) of the IAM role used for + evaluation execution. + """ + execution_status: str | None = ... + """The updated execution status to enable or disable the online evaluation.""" + +@dataclass(kw_only=True) +class UpdateOnlineEvaluationConfigOutput(_SerdeShape): + """Dataclass for UpdateOnlineEvaluationConfigOutput structure.""" + + online_evaluation_config_arn: str + """ + The Amazon Resource Name (ARN) of the updated online evaluation + configuration. + """ + online_evaluation_config_id: str + """The unique identifier of the updated online evaluation configuration.""" + updated_at: datetime + """The timestamp when the online evaluation configuration was last updated.""" + status: str + """The status of the online evaluation configuration.""" + execution_status: str + """ + The execution status indicating whether the online evaluation is + currently running. + """ + failure_reason: str | None = ... + """ + The reason for failure if the online evaluation configuration update or + execution failed. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdatePaymentConnectorInput(_SerdeShape): + """Dataclass for UpdatePaymentConnectorInput structure.""" + + payment_manager_id: str | None = ... + """The unique identifier of the parent payment manager.""" + payment_connector_id: str | None = ... + """The unique identifier of the payment connector to update.""" + description: str | None = ... + """The updated description of the payment connector.""" + type: str | None = ... + """The updated type of the payment connector.""" + credential_provider_configurations: ( + list[CredentialsProviderConfiguration] | None + ) = ... + """ + The updated credential provider configurations for the payment + connector. + """ + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If you don't specify this field, a + value is randomly generated for you. If this token matches a previous + request, the service ignores the request, but doesn't return an error. + For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + +@dataclass(kw_only=True) +class UpdatePaymentConnectorOutput(_SerdeShape): + """Dataclass for UpdatePaymentConnectorOutput structure.""" + + payment_connector_id: str + """The unique identifier of the updated payment connector.""" + payment_manager_id: str + """The unique identifier of the parent payment manager.""" + name: str + """The name of the updated payment connector.""" + type: str + """The type of the updated payment connector.""" + credential_provider_configurations: list[CredentialsProviderConfiguration] + """ + The credential provider configurations for the updated payment + connector. + """ + last_updated_at: datetime + """The timestamp when the payment connector was last updated.""" + status: str + """ + The current status of the updated payment connector. Possible values + include `CREATING`, `READY`, `UPDATING`, `DELETING`, `CREATE_FAILED`, + `UPDATE_FAILED`, and `DELETE_FAILED`. + """ + authorization_url: str | None = ... + """ + The URL that the user must open to complete OAuth consent. This field is + only present when the payment connector status is + `PENDING_AUTHENTICATION`. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdatePaymentCredentialProviderInput(_SerdeShape): + """Dataclass for UpdatePaymentCredentialProviderInput structure.""" + + name: str | None = ... + """The name of the payment credential provider to update.""" + credential_provider_vendor: str | None = ... + """ + The vendor type for the payment credential provider (e.g., CoinbaseCDP, + StripePrivy). + """ + provider_configuration_input: PaymentProviderConfigurationInput | None = ... + """Configuration specific to the vendor, including API credentials.""" + +@dataclass(kw_only=True) +class UpdatePaymentCredentialProviderOutput(_SerdeShape): + """Dataclass for UpdatePaymentCredentialProviderOutput structure.""" + + name: str + """The name of the updated payment credential provider.""" + credential_provider_vendor: str + """The vendor type for the updated payment credential provider.""" + credential_provider_arn: str + """ + The Amazon Resource Name (ARN) of the updated payment credential + provider. + """ + provider_configuration_output: PaymentProviderConfigurationOutput + """ + Output configuration (contains secret ARNs, excludes actual secret + values). + """ + created_time: datetime + """The timestamp when the payment credential provider was created.""" + last_updated_time: datetime + """The timestamp when the payment credential provider was last updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdatePaymentManagerInput(_SerdeShape): + """Dataclass for UpdatePaymentManagerInput structure.""" + + payment_manager_id: str | None = ... + """The unique identifier of the payment manager to update.""" + description: str | None = ... + """The updated description of the payment manager.""" + authorizer_type: str | None = ... + """The updated authorizer type for the payment manager.""" + authorizer_configuration: AuthorizerConfiguration | None = ... + """The updated authorizer configuration for the payment manager.""" + role_arn: str | None = ... + """ + The updated Amazon Resource Name (ARN) of the IAM role for the payment + manager. + """ + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If you don't specify this field, a + value is randomly generated for you. If this token matches a previous + request, the service ignores the request, but doesn't return an error. + For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + kms_key_arn: str | None = ... + """ + The updated Amazon Resource Name (ARN) of the customer managed KMS key + used to encrypt sensitive payment manager data at rest. + """ + +@dataclass(kw_only=True) +class UpdatePaymentManagerOutput(_SerdeShape): + """Dataclass for UpdatePaymentManagerOutput structure.""" + + payment_manager_arn: str + """The Amazon Resource Name (ARN) of the updated payment manager.""" + payment_manager_id: str + """The unique identifier of the updated payment manager.""" + name: str + """The name of the updated payment manager.""" + authorizer_type: str + """The type of authorizer for the updated payment manager.""" + role_arn: str + """ + The Amazon Resource Name (ARN) of the IAM role associated with the + updated payment manager. + """ + workload_identity_details: WorkloadIdentityDetails | None = ... + """The information about the workload identity.""" + last_updated_at: datetime + """The timestamp when the payment manager was last updated.""" + status: str + """ + The current status of the updated payment manager. Possible values + include `CREATING`, `READY`, `UPDATING`, `DELETING`, `CREATE_FAILED`, + `UPDATE_FAILED`, and `DELETE_FAILED`. + """ + kms_key_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the KMS key used to encrypt sensitive + payment manager data at rest, if configured. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdatePolicyEngineInput(_SerdeShape): + """Dataclass for UpdatePolicyEngineInput structure.""" + + policy_engine_id: str | None = ... + """The unique identifier of the policy engine to be updated.""" + description: UpdatedDescription | None = ... + """The new description for the policy engine.""" + +@dataclass(kw_only=True) +class UpdatePolicyEngineOutput(_SerdeShape): + """Dataclass for UpdatePolicyEngineOutput structure.""" + + policy_engine_id: str + """The unique identifier of the updated policy engine.""" + name: str + """The name of the updated policy engine.""" + created_at: datetime + """The original creation timestamp of the policy engine.""" + updated_at: datetime + """The timestamp when the policy engine was last updated.""" + policy_engine_arn: str + """The ARN of the updated policy engine.""" + status: str + """The current status of the updated policy engine.""" + encryption_key_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the KMS key used to encrypt the policy + engine data. + """ + description: str | None = ... + """The updated description of the policy engine.""" + status_reasons: list[str] + """Additional information about the update status.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdatePolicyInput(_SerdeShape): + """Dataclass for UpdatePolicyInput structure.""" + + policy_engine_id: str | None = ... + """ + The identifier of the policy engine that manages the policy to be + updated. This ensures the policy is updated within the correct policy + engine context. + """ + policy_id: str | None = ... + """ + The unique identifier of the policy to be updated. This must be a valid + policy ID that exists within the specified policy engine. + """ + description: UpdatedDescription | None = ... + """ + The new human-readable description for the policy. This optional field + allows updating the policy's documentation while keeping the same + policy logic. + """ + definition: PolicyDefinition | None = ... + """ + The new Cedar or Dogwood policy statement that defines the access + control rules. This replaces the existing policy definition with new + logic while maintaining the policy's identity. + """ + validation_mode: str = ... + """ + The validation mode for the policy update. Determines how Cedar analyzer + validation results are handled during policy updates. + FAIL_ON_ANY_FINDINGS runs the Cedar analyzer and fails the update if + validation issues are detected, ensuring the policy conforms to the + Cedar schema and tool context. IGNORE_ALL_FINDINGS runs the Cedar + analyzer but allows updates despite validation warnings. Use + FAIL_ON_ANY_FINDINGS to ensure policy correctness during updates, + especially when modifying policy logic or conditions. + """ + enforcement_mode: str | None = ... + """ + The enforcement mode for the policy. Run this policy in `LOG_ONLY` mode + to collect data on how it affects your application. Once you are + satisfied with the data gathered, switch the policy to `ACTIVE`. If you + omit this field, the policy's existing enforcement mode is unchanged. + """ + +@dataclass(kw_only=True) +class UpdatePolicyOutput(_SerdeShape): + """Dataclass for UpdatePolicyOutput structure.""" + + policy_id: str + """The unique identifier of the updated policy.""" + name: str + """The name of the updated policy.""" + policy_engine_id: str + """The identifier of the policy engine managing the updated policy.""" + created_at: datetime + """The original creation timestamp of the policy.""" + updated_at: datetime + """The timestamp when the policy was last updated.""" + policy_arn: str + """The ARN of the updated policy.""" + status: str + """The current status of the updated policy.""" + enforcement_mode: str = ... + """The current enforcement mode of the updated policy.""" + definition: PolicyDefinition + """The updated Cedar or Dogwood policy statement.""" + description: str | None = ... + """The updated description of the policy.""" + status_reasons: list[str] + """Additional information about the update status.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateRegistryInput(_SerdeShape): + """Dataclass for UpdateRegistryInput structure.""" + + registry_id: str | None = ... + """ + The identifier of the registry to update. You can specify either the + Amazon Resource Name (ARN) or the ID of the registry. + """ + name: str | None = ... + """The updated name of the registry.""" + description: UpdatedDescription | None = ... + """ + The updated description of the registry. To clear the description, + include the `UpdatedDescription` wrapper with `optionalValue` not + specified. + """ + authorizer_configuration: UpdatedAuthorizerConfiguration | None = ... + """ + The updated authorizer configuration for the registry. Changing the + authorizer configuration can break existing consumers of the registry + who are using the authorization type prior to the update. + """ + approval_configuration: UpdatedApprovalConfiguration | None = ... + """ + The updated approval configuration for registry records. The updated + configuration only affects new records that move to `PENDING_APPROVAL` + status after the change. Existing records already in `PENDING_APPROVAL` + status are not affected. + """ + +@dataclass(kw_only=True) +class UpdateRegistryOutput(_SerdeShape): + """Dataclass for UpdateRegistryOutput structure.""" + + name: str + """The name of the updated registry.""" + description: str | None = ... + """The description of the updated registry.""" + registry_id: str + """The unique identifier of the updated registry.""" + registry_arn: str + """The Amazon Resource Name (ARN) of the updated registry.""" + authorizer_type: str | None = ... + """ + The type of authorizer used by the updated registry. This controls the + authorization method for the Search and Invoke APIs used by consumers. + + - `CUSTOM_JWT` - Authorize with a bearer token. + + - `AWS_IAM` - Authorize with your Amazon Web Services IAM credentials. + """ + authorizer_configuration: AuthorizerConfiguration | None = ... + """ + The authorizer configuration for the updated registry. For details, see + the `AuthorizerConfiguration` data type. + """ + approval_configuration: ApprovalConfiguration | None = ... + """ + The approval configuration for the updated registry. For details, see + the `ApprovalConfiguration` data type. + """ + status: str + """ + The current status of the updated registry. Possible values include + `CREATING`, `READY`, `UPDATING`, `CREATE_FAILED`, `UPDATE_FAILED`, + `DELETING`, and `DELETE_FAILED`. + """ + status_reason: str | None = ... + """The reason for the current status of the updated registry.""" + created_at: datetime + """The timestamp when the registry was created.""" + updated_at: datetime + """The timestamp when the registry was last updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateRegistryRecordInput(_SerdeShape): + """Dataclass for UpdateRegistryRecordInput structure.""" + + registry_id: str | None = ... + """ + The identifier of the registry containing the record. You can specify + either the Amazon Resource Name (ARN) or the ID of the registry. + """ + record_id: str | None = ... + """ + The identifier of the registry record to update. You can specify either + the Amazon Resource Name (ARN) or the ID of the record. + """ + name: str | None = ... + """The updated name for the registry record.""" + description: UpdatedDescription | None = ... + """ + The updated description for the registry record. To clear the + description, include the `UpdatedDescription` wrapper with + `optionalValue` not specified. + """ + descriptor_type: str | None = ... + """ + The updated descriptor type for the registry record. Changing the + descriptor type may require updating the `descriptors` field to match + the new type's schema requirements. + """ + descriptors: UpdatedDescriptors | None = ... + """ + The updated descriptor-type-specific configuration containing the + resource schema and metadata. Uses PATCH semantics where individual + descriptor fields can be updated independently. + """ + record_version: str | None = ... + """ + The version of the registry record for optimistic locking. If provided, + it must match the current version of the record. The service + automatically increments the version after a successful update. + """ + synchronization_type: UpdatedSynchronizationType | None = ... + """The updated synchronization type for the registry record.""" + synchronization_configuration: UpdatedSynchronizationConfiguration | None = ... + """The updated synchronization configuration for the registry record.""" + trigger_synchronization: bool | None = ... + """ + Whether to trigger synchronization using the stored or provided + configuration. When set to `true`, the service will synchronize the + record metadata from the configured external source. + """ + +@dataclass(kw_only=True) +class UpdateRegistryRecordOutput(_SerdeShape): + """Dataclass for UpdateRegistryRecordOutput structure.""" + + registry_arn: str + """ + The Amazon Resource Name (ARN) of the registry that contains the updated + record. + """ + record_arn: str + """The Amazon Resource Name (ARN) of the updated registry record.""" + record_id: str + """The unique identifier of the updated registry record.""" + name: str + """The name of the updated registry record.""" + description: str | None = ... + """The description of the updated registry record.""" + descriptor_type: str + """ + The descriptor type of the updated registry record. Possible values are + `MCP`, `A2A`, `CUSTOM`, and `AGENT_SKILLS`. + """ + descriptors: Descriptors + """ + The descriptor-type-specific configuration of the updated registry + record. For details, see the `Descriptors` data type. + """ + record_version: str | None = ... + """The version of the updated registry record.""" + status: str + """ + The current status of the updated registry record. Possible values + include `CREATING`, `DRAFT`, `APPROVED`, `PENDING_APPROVAL`, `REJECTED`, + `DEPRECATED`, `UPDATING`, `CREATE_FAILED`, and `UPDATE_FAILED`. + """ + created_at: datetime + """The timestamp when the registry record was created.""" + updated_at: datetime + """The timestamp when the registry record was last updated.""" + status_reason: str | None = ... + """The reason for the current status of the updated registry record.""" + synchronization_type: str | None = ... + """The synchronization type of the updated registry record.""" + synchronization_configuration: SynchronizationConfiguration | None = ... + """The synchronization configuration of the updated registry record.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateRegistryRecordStatusInput(_SerdeShape): + """Dataclass for UpdateRegistryRecordStatusInput structure.""" + + registry_id: str | None = ... + """ + The identifier of the registry containing the record. You can specify + either the Amazon Resource Name (ARN) or the ID of the registry. + """ + record_id: str | None = ... + """ + The identifier of the registry record to update the status for. You can + specify either the Amazon Resource Name (ARN) or the ID of the record. + """ + status: str | None = ... + """The target status for the registry record.""" + status_reason: str | None = ... + """ + The reason for the status change, such as why the record was approved or + rejected. + """ + +@dataclass(kw_only=True) +class UpdateRegistryRecordStatusOutput(_SerdeShape): + """Dataclass for UpdateRegistryRecordStatusOutput structure.""" + + registry_arn: str + """The Amazon Resource Name (ARN) of the registry that contains the record.""" + record_arn: str + """The Amazon Resource Name (ARN) of the registry record.""" + record_id: str + """The unique identifier of the registry record.""" + status: str + """The resulting status of the registry record.""" + status_reason: str + """The reason for the status change.""" + updated_at: datetime + """The timestamp when the record was last updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateWorkloadIdentityInput(_SerdeShape): + """Dataclass for UpdateWorkloadIdentityInput structure.""" + + name: str | None = ... + """The name of the workload identity to update.""" + allowed_resource_oauth2_return_urls: list[str] | None = ... + """ + The new list of allowed OAuth2 return URLs for resources associated with + this workload identity. This list replaces the existing list. + """ + +@dataclass(kw_only=True) +class UpdateWorkloadIdentityOutput(_SerdeShape): + """Dataclass for UpdateWorkloadIdentityOutput structure.""" + + name: str + """The name of the workload identity.""" + workload_identity_arn: str + """The Amazon Resource Name (ARN) of the workload identity.""" + allowed_resource_oauth2_return_urls: list[str] | None = ... + """ + The list of allowed OAuth2 return URLs for resources associated with + this workload identity. + """ + created_time: datetime + """The timestamp when the workload identity was created.""" + last_updated_time: datetime + """The timestamp when the workload identity was last updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UserPreferenceConsolidationOverride(_SerdeShape): + """Contains user preference consolidation override configuration.""" + + append_to_prompt: str + """The text to append to the prompt for user preference consolidation.""" + model_id: str + """The model ID to use for user preference consolidation.""" + +@dataclass(kw_only=True) +class UserPreferenceExtractionOverride(_SerdeShape): + """Contains user preference extraction override configuration.""" + + append_to_prompt: str + """The text to append to the prompt for user preference extraction.""" + model_id: str + """The model ID to use for user preference extraction.""" + +@dataclass(kw_only=True) +class UserPreferenceMemoryStrategyInput(_SerdeShape): + """Input for creating a user preference memory strategy.""" + + name: str + """The name of the user preference memory strategy.""" + description: str | None = ... + """The description of the user preference memory strategy.""" + namespaces: list[str] | None = ... + """ + This is a legacy parameter, use `namespaceTemplates`. The namespaces + associated with the user preference memory strategy. + """ + namespace_templates: list[str] | None = ... + """ + The namespaceTemplates associated with the user preference memory + strategy. + """ + memory_record_schema: MemoryRecordSchema | None = ... + """Schema for metadata fields on records generated by this strategy.""" + +@dataclass(kw_only=True) +class UserPreferenceOverrideConfigurationInput(_SerdeShape): + """Input for user preference override configuration in a memory strategy.""" + + extraction: UserPreferenceOverrideExtractionConfigurationInput | None = ... + """The extraction configuration for a user preference override.""" + consolidation: UserPreferenceOverrideConsolidationConfigurationInput | None = ... + """The consolidation configuration for a user preference override.""" + +@dataclass(kw_only=True) +class UserPreferenceOverrideConsolidationConfigurationInput(_SerdeShape): + """ + Input for user preference override consolidation configuration in a + memory strategy. + """ + + append_to_prompt: str + """The text to append to the prompt for user preference consolidation.""" + model_id: str + """The model ID to use for user preference consolidation.""" + +@dataclass(kw_only=True) +class UserPreferenceOverrideExtractionConfigurationInput(_SerdeShape): + """ + Input for user preference override extraction configuration in a memory + strategy. + """ + + append_to_prompt: str + """The text to append to the prompt for user preference extraction.""" + model_id: str + """The model ID to use for user preference extraction.""" + +@dataclass +class ValidationStringValidation(_SerdeShape): + """Validation for STRING fields.""" + + value: StringValidation + +@dataclass +class ValidationStringListValidation(_SerdeShape): + """Validation for STRINGLIST fields.""" + + value: StringListValidation + +@dataclass +class ValidationNumberValidation(_SerdeShape): + """Validation for NUMBER fields.""" + + value: NumberValidation + +@dataclass +class ValidationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +Validation = Union[ + ValidationStringValidation + | ValidationStringListValidation + | ValidationNumberValidation + | ValidationUnknown +] +""" +Validation rules for extracted metadata values. Only one type can be +specified, matching the field's data type. +""" + +class _ValidationDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> Validation: ... + +@dataclass(kw_only=True) +class ValidationException(ServiceError, _SerdeShape): + """The input fails to satisfy the constraints specified by the service.""" + + reason: str + field_list: list[ValidationExceptionField] | None = ... + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ValidationExceptionField(_SerdeShape): + """ + Stores information about a field passed inside a request that resulted + in an exception. + """ + + name: str + """The name of the field.""" + message: str + """A message describing why this field failed validation.""" + +class ValidationExceptionReason(UnknownEnumMixin, StrEnum): + CANNOT_PARSE = "CannotParse" + FIELD_VALIDATION_FAILED = "FieldValidationFailed" + IDEMPOTENT_PARAMETER_MISMATCH_EXCEPTION = "IdempotentParameterMismatchException" + ROOT_EVENT_IN_OTHER_SESSION = "EventInOtherSession" + RESOURCE_CONFLICT = "ResourceConflict" + +@dataclass(kw_only=True) +class VersionCreatedBySource(_SerdeShape): + """The source that created a configuration bundle version.""" + + name: str + """ + The name of the source (for example, `user`, `optimization-job`, or + `system`). + """ + arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the source, if applicable (for + example, a user ARN or optimization job ARN). + """ + +@dataclass(kw_only=True) +class VersionFilter(_SerdeShape): + """A filter for listing configuration bundle versions.""" + + branch_name: str | None = ... + """Filter by branch name.""" + created_by_name: str | None = ... + """Filter by creation source name.""" + latest_per_branch: bool | None = ... + """ + When true, returns only the latest version for each branch. When false + or not specified, returns all versions. Can be combined with + `branchName` to get the latest version for a specific branch. + """ + +@dataclass(kw_only=True) +class VersionLineageMetadata(_SerdeShape): + """ + The version lineage metadata that tracks parent versions and creation + source. Supports git-like two-parent merges for branch management. + """ + + parent_version_ids: list[str] | None = ... + """ + A list of parent version identifiers. Regular commits have 0-1 parents. + Merge commits have 2 parents: the target branch parent and the source + branch parent. The first parent represents the primary lineage. + """ + branch_name: str | None = ... + """ + The branch name for this version. If not specified, inherits the + parent's branch or defaults to `mainline`. + """ + created_by: VersionCreatedBySource | None = ... + """The source that created this version.""" + commit_message: str | None = ... + """A commit message describing the changes in this version.""" + +@dataclass +class VolumeConfigurationEbsConfiguration(_SerdeShape): + """The configuration for an Amazon EBS-backed persistent volume.""" + + value: EbsVolumeConfiguration + +@dataclass +class VolumeConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +VolumeConfiguration = Union[ + VolumeConfigurationEbsConfiguration | VolumeConfigurationUnknown +] +""" +The configuration for a persistent volume attached to a capacity +provider. This structure defines the storage backing for the persistent +volumes used by agents that run on capacity provider instances. +""" + +class _VolumeConfigurationDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> VolumeConfiguration: ... + +@dataclass(kw_only=True) +class VpcConfig(_SerdeShape): + """VpcConfig for the Agent.""" + + security_groups: list[str] + """The security groups associated with the VPC configuration.""" + subnets: list[str] + """The subnets associated with the VPC configuration.""" + require_service_s3_endpoint: bool | None = ... + """ + Note: + This field applies only to Agent Runtimes. It is not applicable to + Browsers or Code Interpreters. + + Controls whether a service-managed Amazon S3 gateway endpoint is + provisioned in the VPC network topology for the agent runtime. This + gateway is used by Amazon Bedrock AgentCore Runtime to download code and + container images during agent startup. + + Starting May 5, 2026, Amazon Bedrock AgentCore Runtime is gradually + rolling out a change to how network isolation is configured for VPC mode + agents. Agent runtimes created on or after this rollout will no longer + include the service-managed Amazon S3 gateway. Instead, all network + access, including to Amazon S3, is governed exclusively by your VPC + configuration. This field cannot be set on agent runtimes created after + the rollout. Passing this field in an `UpdateAgentRuntime` request for + these agent runtimes returns a `ValidationException`. + + Agent runtimes created before the rollout are not affected and continue + to operate with the service-managed Amazon S3 gateway. To enforce full + VPC network isolation on these existing agent runtimes, set this field + to `false` via the `UpdateAgentRuntime` API. Before opting out, ensure + your VPC provides the Amazon S3 access required for agent startup. If + this field is not specified or is set to `true`, the service-managed + Amazon S3 gateway remains provisioned. + + This field is only supported in the `UpdateAgentRuntime` API for + pre-rollout agent runtimes. Passing this field in a `CreateAgentRuntime` + request returns a `ValidationException`. + """ + +@dataclass(kw_only=True) +class VpcConfiguration(_SerdeShape): + """The VPC configuration for launching Amazon EC2 instances.""" + + subnets: list[str] + """ + The IDs of the subnets in which to launch instances. You must specify at + least one subnet. + """ + security_groups: list[str] + """ + The IDs of the security groups to associate with the instances. You must + specify at least one security group. + """ + +@dataclass(kw_only=True) +class WafConfiguration(_SerdeShape): + """ + The Amazon Web Services WAF configuration for the gateway. This + configuration controls how the gateway behaves when the associated web + ACL cannot be evaluated. + """ + + failure_mode: str | None = ... + """ + The failure mode that determines how the gateway handles requests when + Amazon Web Services WAF is unreachable or times out. Valid values + include: + + - `FAIL_CLOSE` - The gateway blocks requests when Amazon Web Services + WAF cannot be evaluated. + + - `FAIL_OPEN` - The gateway allows requests when Amazon Web Services WAF + cannot be evaluated. + """ + +class WafFailureMode(UnknownEnumMixin, StrEnum): + FAIL_CLOSE = "FAIL_CLOSE" + FAIL_OPEN = "FAIL_OPEN" + +@dataclass(kw_only=True) +class WeightedOverride(_SerdeShape): + """ + A weighted configuration bundle override that splits traffic between + multiple bundle versions. + """ + + traffic_split: list[TrafficSplitEntry] + """ + The traffic split entries defining how traffic is distributed between + configuration bundle versions. + """ + +@dataclass(kw_only=True) +class WeightedRoute(_SerdeShape): + """A weighted route that splits traffic between multiple gateway targets.""" + + traffic_split: list[TargetTrafficSplitEntry] + """ + The traffic split entries defining how traffic is distributed between + targets. + """ + +@dataclass(kw_only=True) +class WorkloadIdentityDetails(_SerdeShape): + """The information about the workload identity.""" + + workload_identity_arn: str + """The ARN associated with the workload identity.""" + +@dataclass(kw_only=True) +class WorkloadIdentityType(_SerdeShape): + """Contains information about a workload identity.""" + + name: str + """The name of the workload identity.""" + workload_identity_arn: str + """The Amazon Resource Name (ARN) of the workload identity.""" + +@dataclass(kw_only=True) +class Unit(_SerdeShape): + """Dataclass for Unit structure.""" + +ADD_DATASET_EXAMPLES: APIOperation[AddDatasetExamplesInput, AddDatasetExamplesOutput] +BATCH_PUT_GATEWAY_RATE_LIMITS: APIOperation[ + BatchPutGatewayRateLimitsInput, BatchPutGatewayRateLimitsOutput +] +CREATE_AGENT_RUNTIME: APIOperation[CreateAgentRuntimeInput, CreateAgentRuntimeOutput] +CREATE_AGENT_RUNTIME_ENDPOINT: APIOperation[ + CreateAgentRuntimeEndpointInput, CreateAgentRuntimeEndpointOutput +] +CREATE_API_KEY_CREDENTIAL_PROVIDER: APIOperation[ + CreateApiKeyCredentialProviderInput, CreateApiKeyCredentialProviderOutput +] +CREATE_BROWSER: APIOperation[CreateBrowserInput, CreateBrowserOutput] +CREATE_BROWSER_PROFILE: APIOperation[ + CreateBrowserProfileInput, CreateBrowserProfileOutput +] +CREATE_CAPACITY_PROVIDER: APIOperation[ + CreateCapacityProviderInput, CreateCapacityProviderOutput +] +CREATE_CODE_INTERPRETER: APIOperation[ + CreateCodeInterpreterInput, CreateCodeInterpreterOutput +] +CREATE_CONFIGURATION_BUNDLE: APIOperation[ + CreateConfigurationBundleInput, CreateConfigurationBundleOutput +] +CREATE_CONSENT_PORTAL: APIOperation[CreateConsentPortalInput, CreateConsentPortalOutput] +CREATE_DATASET: APIOperation[CreateDatasetInput, CreateDatasetOutput] +CREATE_DATASET_VERSION: APIOperation[ + CreateDatasetVersionInput, CreateDatasetVersionOutput +] +CREATE_EVALUATOR: APIOperation[CreateEvaluatorInput, CreateEvaluatorOutput] +CREATE_GATEWAY: APIOperation[CreateGatewayInput, CreateGatewayOutput] +CREATE_GATEWAY_RATE_LIMIT: APIOperation[ + CreateGatewayRateLimitInput, CreateGatewayRateLimitOutput +] +CREATE_GATEWAY_RULE: APIOperation[CreateGatewayRuleInput, CreateGatewayRuleOutput] +CREATE_GATEWAY_TARGET: APIOperation[CreateGatewayTargetInput, CreateGatewayTargetOutput] +CREATE_HARNESS: APIOperation[CreateHarnessInput, CreateHarnessOutput] +CREATE_HARNESS_ENDPOINT: APIOperation[ + CreateHarnessEndpointInput, CreateHarnessEndpointOutput +] +CREATE_MEMORY: APIOperation[CreateMemoryInput, CreateMemoryOutput] +CREATE_OAUTH2_CREDENTIAL_PROVIDER: APIOperation[ + CreateOauth2CredentialProviderInput, CreateOauth2CredentialProviderOutput +] +CREATE_ONLINE_EVALUATION_CONFIG: APIOperation[ + CreateOnlineEvaluationConfigInput, CreateOnlineEvaluationConfigOutput +] +CREATE_PAYMENT_CONNECTOR: APIOperation[ + CreatePaymentConnectorInput, CreatePaymentConnectorOutput +] +CREATE_PAYMENT_CREDENTIAL_PROVIDER: APIOperation[ + CreatePaymentCredentialProviderInput, CreatePaymentCredentialProviderOutput +] +CREATE_PAYMENT_MANAGER: APIOperation[ + CreatePaymentManagerInput, CreatePaymentManagerOutput +] +CREATE_POLICY: APIOperation[CreatePolicyInput, CreatePolicyOutput] +CREATE_POLICY_ENGINE: APIOperation[CreatePolicyEngineInput, CreatePolicyEngineOutput] +CREATE_REGISTRY: APIOperation[CreateRegistryInput, CreateRegistryOutput] +CREATE_REGISTRY_RECORD: APIOperation[ + CreateRegistryRecordInput, CreateRegistryRecordOutput +] +CREATE_WORKLOAD_IDENTITY: APIOperation[ + CreateWorkloadIdentityInput, CreateWorkloadIdentityOutput +] +DELETE_AGENT_RUNTIME: APIOperation[DeleteAgentRuntimeInput, DeleteAgentRuntimeOutput] +DELETE_AGENT_RUNTIME_ENDPOINT: APIOperation[ + DeleteAgentRuntimeEndpointInput, DeleteAgentRuntimeEndpointOutput +] +DELETE_API_KEY_CREDENTIAL_PROVIDER: APIOperation[ + DeleteApiKeyCredentialProviderInput, DeleteApiKeyCredentialProviderOutput +] +DELETE_BROWSER: APIOperation[DeleteBrowserInput, DeleteBrowserOutput] +DELETE_BROWSER_PROFILE: APIOperation[ + DeleteBrowserProfileInput, DeleteBrowserProfileOutput +] +DELETE_CAPACITY_PROVIDER: APIOperation[ + DeleteCapacityProviderInput, DeleteCapacityProviderOutput +] +DELETE_CODE_INTERPRETER: APIOperation[ + DeleteCodeInterpreterInput, DeleteCodeInterpreterOutput +] +DELETE_CONFIGURATION_BUNDLE: APIOperation[ + DeleteConfigurationBundleInput, DeleteConfigurationBundleOutput +] +DELETE_CONSENT_PORTAL: APIOperation[DeleteConsentPortalInput, DeleteConsentPortalOutput] +DELETE_DATASET: APIOperation[DeleteDatasetInput, DeleteDatasetOutput] +DELETE_DATASET_EXAMPLES: APIOperation[ + DeleteDatasetExamplesInput, DeleteDatasetExamplesOutput +] +DELETE_EVALUATOR: APIOperation[DeleteEvaluatorInput, DeleteEvaluatorOutput] +DELETE_GATEWAY: APIOperation[DeleteGatewayInput, DeleteGatewayOutput] +DELETE_GATEWAY_RATE_LIMIT: APIOperation[ + DeleteGatewayRateLimitInput, DeleteGatewayRateLimitOutput +] +DELETE_GATEWAY_RULE: APIOperation[DeleteGatewayRuleInput, DeleteGatewayRuleOutput] +DELETE_GATEWAY_TARGET: APIOperation[DeleteGatewayTargetInput, DeleteGatewayTargetOutput] +DELETE_HARNESS: APIOperation[DeleteHarnessInput, DeleteHarnessOutput] +DELETE_HARNESS_ENDPOINT: APIOperation[ + DeleteHarnessEndpointInput, DeleteHarnessEndpointOutput +] +DELETE_MEMORY: APIOperation[DeleteMemoryInput, DeleteMemoryOutput] +DELETE_OAUTH2_CREDENTIAL_PROVIDER: APIOperation[ + DeleteOauth2CredentialProviderInput, DeleteOauth2CredentialProviderOutput +] +DELETE_ONLINE_EVALUATION_CONFIG: APIOperation[ + DeleteOnlineEvaluationConfigInput, DeleteOnlineEvaluationConfigOutput +] +DELETE_PAYMENT_CONNECTOR: APIOperation[ + DeletePaymentConnectorInput, DeletePaymentConnectorOutput +] +DELETE_PAYMENT_CREDENTIAL_PROVIDER: APIOperation[ + DeletePaymentCredentialProviderInput, DeletePaymentCredentialProviderOutput +] +DELETE_PAYMENT_MANAGER: APIOperation[ + DeletePaymentManagerInput, DeletePaymentManagerOutput +] +DELETE_POLICY: APIOperation[DeletePolicyInput, DeletePolicyOutput] +DELETE_POLICY_ENGINE: APIOperation[DeletePolicyEngineInput, DeletePolicyEngineOutput] +DELETE_REGISTRY: APIOperation[DeleteRegistryInput, DeleteRegistryOutput] +DELETE_REGISTRY_RECORD: APIOperation[ + DeleteRegistryRecordInput, DeleteRegistryRecordOutput +] +DELETE_RESOURCE_POLICY: APIOperation[ + DeleteResourcePolicyInput, DeleteResourcePolicyOutput +] +DELETE_WORKLOAD_IDENTITY: APIOperation[ + DeleteWorkloadIdentityInput, DeleteWorkloadIdentityOutput +] +GET_AGENT_RUNTIME: APIOperation[GetAgentRuntimeInput, GetAgentRuntimeOutput] +GET_AGENT_RUNTIME_ENDPOINT: APIOperation[ + GetAgentRuntimeEndpointInput, GetAgentRuntimeEndpointOutput +] +GET_API_KEY_CREDENTIAL_PROVIDER: APIOperation[ + GetApiKeyCredentialProviderInput, GetApiKeyCredentialProviderOutput +] +GET_BROWSER: APIOperation[GetBrowserInput, GetBrowserOutput] +GET_BROWSER_PROFILE: APIOperation[GetBrowserProfileInput, GetBrowserProfileOutput] +GET_CAPACITY_PROVIDER: APIOperation[GetCapacityProviderInput, GetCapacityProviderOutput] +GET_CODE_INTERPRETER: APIOperation[GetCodeInterpreterInput, GetCodeInterpreterOutput] +GET_CONFIGURATION_BUNDLE: APIOperation[ + GetConfigurationBundleInput, GetConfigurationBundleOutput +] +GET_CONFIGURATION_BUNDLE_VERSION: APIOperation[ + GetConfigurationBundleVersionInput, GetConfigurationBundleVersionOutput +] +GET_CONSENT_PORTAL: APIOperation[GetConsentPortalInput, GetConsentPortalOutput] +GET_DATASET: APIOperation[GetDatasetInput, GetDatasetOutput] +GET_EVALUATOR: APIOperation[GetEvaluatorInput, GetEvaluatorOutput] +GET_GATEWAY: APIOperation[GetGatewayInput, GetGatewayOutput] +GET_GATEWAY_RATE_LIMIT: APIOperation[ + GetGatewayRateLimitInput, GetGatewayRateLimitOutput +] +GET_GATEWAY_RULE: APIOperation[GetGatewayRuleInput, GetGatewayRuleOutput] +GET_GATEWAY_TARGET: APIOperation[GetGatewayTargetInput, GetGatewayTargetOutput] +GET_HARNESS: APIOperation[GetHarnessInput, GetHarnessOutput] +GET_HARNESS_ENDPOINT: APIOperation[GetHarnessEndpointInput, GetHarnessEndpointOutput] +GET_MEMORY: APIOperation[GetMemoryInput, GetMemoryOutput] +GET_OAUTH2_CREDENTIAL_PROVIDER: APIOperation[ + GetOauth2CredentialProviderInput, GetOauth2CredentialProviderOutput +] +GET_ONLINE_EVALUATION_CONFIG: APIOperation[ + GetOnlineEvaluationConfigInput, GetOnlineEvaluationConfigOutput +] +GET_PAYMENT_CONNECTOR: APIOperation[GetPaymentConnectorInput, GetPaymentConnectorOutput] +GET_PAYMENT_CREDENTIAL_PROVIDER: APIOperation[ + GetPaymentCredentialProviderInput, GetPaymentCredentialProviderOutput +] +GET_PAYMENT_MANAGER: APIOperation[GetPaymentManagerInput, GetPaymentManagerOutput] +GET_POLICY: APIOperation[GetPolicyInput, GetPolicyOutput] +GET_POLICY_ENGINE: APIOperation[GetPolicyEngineInput, GetPolicyEngineOutput] +GET_POLICY_ENGINE_SUMMARY: APIOperation[ + GetPolicyEngineSummaryInput, GetPolicyEngineSummaryOutput +] +GET_POLICY_GENERATION: APIOperation[GetPolicyGenerationInput, GetPolicyGenerationOutput] +GET_POLICY_GENERATION_SUMMARY: APIOperation[ + GetPolicyGenerationSummaryInput, GetPolicyGenerationSummaryOutput +] +GET_POLICY_SUMMARY: APIOperation[GetPolicySummaryInput, GetPolicySummaryOutput] +GET_REGISTRY: APIOperation[GetRegistryInput, GetRegistryOutput] +GET_REGISTRY_RECORD: APIOperation[GetRegistryRecordInput, GetRegistryRecordOutput] +GET_RESOURCE_POLICY: APIOperation[GetResourcePolicyInput, GetResourcePolicyOutput] +GET_TOKEN_VAULT: APIOperation[GetTokenVaultInput, GetTokenVaultOutput] +GET_WORKLOAD_IDENTITY: APIOperation[GetWorkloadIdentityInput, GetWorkloadIdentityOutput] +LIST_AGENT_RUNTIME_ENDPOINTS: APIOperation[ + ListAgentRuntimeEndpointsInput, ListAgentRuntimeEndpointsOutput +] +LIST_AGENT_RUNTIMES: APIOperation[ListAgentRuntimesInput, ListAgentRuntimesOutput] +LIST_AGENT_RUNTIME_VERSIONS: APIOperation[ + ListAgentRuntimeVersionsInput, ListAgentRuntimeVersionsOutput +] +LIST_AGENT_RUNTIME_VERSIONS_BY_CAPACITY_PROVIDER: APIOperation[ + ListAgentRuntimeVersionsByCapacityProviderInput, + ListAgentRuntimeVersionsByCapacityProviderOutput, +] +LIST_API_KEY_CREDENTIAL_PROVIDERS: APIOperation[ + ListApiKeyCredentialProvidersInput, ListApiKeyCredentialProvidersOutput +] +LIST_BROWSER_PROFILES: APIOperation[ListBrowserProfilesInput, ListBrowserProfilesOutput] +LIST_BROWSERS: APIOperation[ListBrowsersInput, ListBrowsersOutput] +LIST_CAPACITY_PROVIDERS: APIOperation[ + ListCapacityProvidersInput, ListCapacityProvidersOutput +] +LIST_CODE_INTERPRETERS: APIOperation[ + ListCodeInterpretersInput, ListCodeInterpretersOutput +] +LIST_CONFIGURATION_BUNDLES: APIOperation[ + ListConfigurationBundlesInput, ListConfigurationBundlesOutput +] +LIST_CONFIGURATION_BUNDLE_VERSIONS: APIOperation[ + ListConfigurationBundleVersionsInput, ListConfigurationBundleVersionsOutput +] +LIST_CONSENT_PORTALS: APIOperation[ListConsentPortalsInput, ListConsentPortalsOutput] +LIST_DATASET_EXAMPLES: APIOperation[ListDatasetExamplesInput, ListDatasetExamplesOutput] +LIST_DATASETS: APIOperation[ListDatasetsInput, ListDatasetsOutput] +LIST_DATASET_VERSIONS: APIOperation[ListDatasetVersionsInput, ListDatasetVersionsOutput] +LIST_EVALUATORS: APIOperation[ListEvaluatorsInput, ListEvaluatorsOutput] +LIST_GATEWAY_RATE_LIMITS: APIOperation[ + ListGatewayRateLimitsInput, ListGatewayRateLimitsOutput +] +LIST_GATEWAY_RULES: APIOperation[ListGatewayRulesInput, ListGatewayRulesOutput] +LIST_GATEWAYS: APIOperation[ListGatewaysInput, ListGatewaysOutput] +LIST_GATEWAY_TARGETS: APIOperation[ListGatewayTargetsInput, ListGatewayTargetsOutput] +LIST_HARNESS_ENDPOINTS: APIOperation[ + ListHarnessEndpointsInput, ListHarnessEndpointsOutput +] +LIST_HARNESSES: APIOperation[ListHarnessesInput, ListHarnessesOutput] +LIST_HARNESS_VERSIONS: APIOperation[ListHarnessVersionsInput, ListHarnessVersionsOutput] +LIST_MEMORIES: APIOperation[ListMemoriesInput, ListMemoriesOutput] +LIST_OAUTH2_CREDENTIAL_PROVIDERS: APIOperation[ + ListOauth2CredentialProvidersInput, ListOauth2CredentialProvidersOutput +] +LIST_ONLINE_EVALUATION_CONFIGS: APIOperation[ + ListOnlineEvaluationConfigsInput, ListOnlineEvaluationConfigsOutput +] +LIST_PAYMENT_CONNECTORS: APIOperation[ + ListPaymentConnectorsInput, ListPaymentConnectorsOutput +] +LIST_PAYMENT_CREDENTIAL_PROVIDERS: APIOperation[ + ListPaymentCredentialProvidersInput, ListPaymentCredentialProvidersOutput +] +LIST_PAYMENT_MANAGERS: APIOperation[ListPaymentManagersInput, ListPaymentManagersOutput] +LIST_POLICIES: APIOperation[ListPoliciesInput, ListPoliciesOutput] +LIST_POLICY_ENGINES: APIOperation[ListPolicyEnginesInput, ListPolicyEnginesOutput] +LIST_POLICY_ENGINE_SUMMARIES: APIOperation[ + ListPolicyEngineSummariesInput, ListPolicyEngineSummariesOutput +] +LIST_POLICY_GENERATION_ASSETS: APIOperation[ + ListPolicyGenerationAssetsInput, ListPolicyGenerationAssetsOutput +] +LIST_POLICY_GENERATIONS: APIOperation[ + ListPolicyGenerationsInput, ListPolicyGenerationsOutput +] +LIST_POLICY_GENERATION_SUMMARIES: APIOperation[ + ListPolicyGenerationSummariesInput, ListPolicyGenerationSummariesOutput +] +LIST_POLICY_SUMMARIES: APIOperation[ListPolicySummariesInput, ListPolicySummariesOutput] +LIST_REGISTRIES: APIOperation[ListRegistriesInput, ListRegistriesOutput] +LIST_REGISTRY_RECORDS: APIOperation[ListRegistryRecordsInput, ListRegistryRecordsOutput] +LIST_TAGS_FOR_RESOURCE: APIOperation[ + ListTagsForResourceInput, ListTagsForResourceOutput +] +LIST_WORKLOAD_IDENTITIES: APIOperation[ + ListWorkloadIdentitiesInput, ListWorkloadIdentitiesOutput +] +PUT_RESOURCE_POLICY: APIOperation[PutResourcePolicyInput, PutResourcePolicyOutput] +ROTATE_PAYMENT_CONNECTOR_CREDENTIALS: APIOperation[ + RotatePaymentConnectorCredentialsInput, RotatePaymentConnectorCredentialsOutput +] +SET_TOKEN_VAULT_CMK: APIOperation[SetTokenVaultCMKInput, SetTokenVaultCMKOutput] +START_POLICY_GENERATION: APIOperation[ + StartPolicyGenerationInput, StartPolicyGenerationOutput +] +SUBMIT_REGISTRY_RECORD_FOR_APPROVAL: APIOperation[ + SubmitRegistryRecordForApprovalInput, SubmitRegistryRecordForApprovalOutput +] +SYNCHRONIZE_GATEWAY_TARGETS: APIOperation[ + SynchronizeGatewayTargetsInput, SynchronizeGatewayTargetsOutput +] +TAG_RESOURCE: APIOperation[TagResourceInput, TagResourceOutput] +UNTAG_RESOURCE: APIOperation[UntagResourceInput, UntagResourceOutput] +UPDATE_AGENT_RUNTIME: APIOperation[UpdateAgentRuntimeInput, UpdateAgentRuntimeOutput] +UPDATE_AGENT_RUNTIME_ENDPOINT: APIOperation[ + UpdateAgentRuntimeEndpointInput, UpdateAgentRuntimeEndpointOutput +] +UPDATE_API_KEY_CREDENTIAL_PROVIDER: APIOperation[ + UpdateApiKeyCredentialProviderInput, UpdateApiKeyCredentialProviderOutput +] +UPDATE_CAPACITY_PROVIDER: APIOperation[ + UpdateCapacityProviderInput, UpdateCapacityProviderOutput +] +UPDATE_CONFIGURATION_BUNDLE: APIOperation[ + UpdateConfigurationBundleInput, UpdateConfigurationBundleOutput +] +UPDATE_CONSENT_PORTAL: APIOperation[UpdateConsentPortalInput, UpdateConsentPortalOutput] +UPDATE_DATASET: APIOperation[UpdateDatasetInput, UpdateDatasetOutput] +UPDATE_DATASET_EXAMPLES: APIOperation[ + UpdateDatasetExamplesInput, UpdateDatasetExamplesOutput +] +UPDATE_EVALUATOR: APIOperation[UpdateEvaluatorInput, UpdateEvaluatorOutput] +UPDATE_GATEWAY: APIOperation[UpdateGatewayInput, UpdateGatewayOutput] +UPDATE_GATEWAY_RATE_LIMIT: APIOperation[ + UpdateGatewayRateLimitInput, UpdateGatewayRateLimitOutput +] +UPDATE_GATEWAY_RULE: APIOperation[UpdateGatewayRuleInput, UpdateGatewayRuleOutput] +UPDATE_GATEWAY_TARGET: APIOperation[UpdateGatewayTargetInput, UpdateGatewayTargetOutput] +UPDATE_HARNESS: APIOperation[UpdateHarnessInput, UpdateHarnessOutput] +UPDATE_HARNESS_ENDPOINT: APIOperation[ + UpdateHarnessEndpointInput, UpdateHarnessEndpointOutput +] +UPDATE_MEMORY: APIOperation[UpdateMemoryInput, UpdateMemoryOutput] +UPDATE_OAUTH2_CREDENTIAL_PROVIDER: APIOperation[ + UpdateOauth2CredentialProviderInput, UpdateOauth2CredentialProviderOutput +] +UPDATE_ONLINE_EVALUATION_CONFIG: APIOperation[ + UpdateOnlineEvaluationConfigInput, UpdateOnlineEvaluationConfigOutput +] +UPDATE_PAYMENT_CONNECTOR: APIOperation[ + UpdatePaymentConnectorInput, UpdatePaymentConnectorOutput +] +UPDATE_PAYMENT_CREDENTIAL_PROVIDER: APIOperation[ + UpdatePaymentCredentialProviderInput, UpdatePaymentCredentialProviderOutput +] +UPDATE_PAYMENT_MANAGER: APIOperation[ + UpdatePaymentManagerInput, UpdatePaymentManagerOutput +] +UPDATE_POLICY: APIOperation[UpdatePolicyInput, UpdatePolicyOutput] +UPDATE_POLICY_ENGINE: APIOperation[UpdatePolicyEngineInput, UpdatePolicyEngineOutput] +UPDATE_REGISTRY: APIOperation[UpdateRegistryInput, UpdateRegistryOutput] +UPDATE_REGISTRY_RECORD: APIOperation[ + UpdateRegistryRecordInput, UpdateRegistryRecordOutput +] +UPDATE_REGISTRY_RECORD_STATUS: APIOperation[ + UpdateRegistryRecordStatusInput, UpdateRegistryRecordStatusOutput +] +UPDATE_WORKLOAD_IDENTITY: APIOperation[ + UpdateWorkloadIdentityInput, UpdateWorkloadIdentityOutput +] diff --git a/clients/aws-sdk-bedrock-agentcore/scripts/docs/generate_doc_stubs.py b/clients/aws-sdk-bedrock-agentcore/scripts/docs/generate_doc_stubs.py index 52d470bc..795f2e4b 100644 --- a/clients/aws-sdk-bedrock-agentcore/scripts/docs/generate_doc_stubs.py +++ b/clients/aws-sdk-bedrock-agentcore/scripts/docs/generate_doc_stubs.py @@ -126,7 +126,9 @@ class ClientInfo: class DocStubGenerator: """Generate markdown API Reference stubs for AWS SDK for Python v4 clients.""" - def __init__(self, client_dir: Path, output_dir: Path, service_name: str | None = None) -> None: + def __init__( + self, client_dir: Path, output_dir: Path, service_name: str | None = None + ) -> None: """ Initialize the documentation generator. @@ -190,7 +192,9 @@ def _analyze_client_package(self, package_name: str) -> ClientInfo: required = ("client", "config", "models") missing = [name for name in required if not package.modules.get(name)] if missing: - raise ValueError(f"Missing required modules in {package_name}: {', '.join(missing)}") + raise ValueError( + f"Missing required modules in {package_name}: {', '.join(missing)}" + ) # Parse submodules client_module = package.modules["client"] @@ -199,11 +203,15 @@ def _analyze_client_package(self, package_name: str) -> ClientInfo: client_class = self._find_class_with_suffix(client_module, "Client") if not client_class: - raise ValueError(f"No class ending with 'Client' found in {package_name}.client") + raise ValueError( + f"No class ending with 'Client' found in {package_name}.client" + ) config_class = self._find_class_with_suffix(config_module, "Config") if not config_class: - raise ValueError(f"No class ending with 'Config' found in {package_name}.config") + raise ValueError( + f"No class ending with 'Config' found in {package_name}.config" + ) plugin_alias = config_module.members.get("Plugin") if not plugin_alias: @@ -288,7 +296,9 @@ def _analyze_operation(self, operation: Function) -> OperationInfo: if output_type in stream_type_map: stream_type = stream_type_map[output_type] - stream_args = self._get_subscript_elements(returns, f"'{operation.name}' stream type") + stream_args = self._get_subscript_elements( + returns, f"'{operation.name}' stream type" + ) if stream_type in (StreamType.INPUT, StreamType.DUPLEX): event_input_type = stream_args[0].canonical_name @@ -316,7 +326,9 @@ def _analyze_operation(self, operation: Function) -> OperationInfo: def _get_expr(self, annotation: str | Expr | None, context: str) -> Expr: """Extract and validate an Expr from an annotation.""" if not isinstance(annotation, Expr): - raise TypeError(f"{context}: expected Expr, got {type(annotation).__name__}") + raise TypeError( + f"{context}: expected Expr, got {type(annotation).__name__}" + ) return annotation def _get_subscript_elements(self, expr: Expr, context: str) -> list[Expr]: @@ -330,7 +342,9 @@ def _get_subscript_elements(self, expr: Expr, context: str) -> list[Expr]: return [el for el in slice_expr.elements if isinstance(el, Expr)] return [slice_expr] - def _extract_models(self, models_module: Module, operations: list[OperationInfo]) -> ModelsInfo: + def _extract_models( + self, models_module: Module, operations: list[OperationInfo] + ) -> ModelsInfo: """Extract structures, unions, enums, and errors from models module.""" structures, unions, enums, errors = [], [], [], [] @@ -356,14 +370,16 @@ def _extract_models(self, models_module: Module, operations: list[OperationInfo] duplicates = [] for structure in structures: - if self._is_operation_io_type(structure.name, operations) or self._is_union_member( - structure.name, unions - ): + if self._is_operation_io_type( + structure.name, operations + ) or self._is_union_member(structure.name, unions): duplicates.append(structure) structures = [struct for struct in structures if struct not in duplicates] - return ModelsInfo(structures=structures, unions=unions, enums=enums, errors=errors) + return ModelsInfo( + structures=structures, unions=unions, enums=enums, errors=errors + ) def _is_union(self, member: Object | Alias) -> TypeGuard[Attribute]: """Check if a module member is a union type.""" @@ -399,7 +415,9 @@ def _extract_union_members( for name in member_names: if not (member_object := models_module.members.get(name)): raise ValueError(f"Union member '{name}' not found in models module") - members.append(TypeInfo(name=member_object.name, module_path=member_object.path)) + members.append( + TypeInfo(name=member_object.name, module_path=member_object.path) + ) return members @@ -408,7 +426,8 @@ def _is_enum(self, member: Object | Alias) -> TypeGuard[Class]: if not isinstance(member, Class): return False return any( - isinstance(base, ExprName) and base.name in ENUM_BASE_CLASSES for base in member.bases + isinstance(base, ExprName) and base.name in ENUM_BASE_CLASSES + for base in member.bases ) def _is_error(self, member: Object | Alias) -> TypeGuard[Class]: @@ -416,10 +435,13 @@ def _is_error(self, member: Object | Alias) -> TypeGuard[Class]: if not isinstance(member, Class): return False return any( - isinstance(base, ExprName) and base.name in ERROR_BASE_CLASSES for base in member.bases + isinstance(base, ExprName) and base.name in ERROR_BASE_CLASSES + for base in member.bases ) - def _is_operation_io_type(self, type_name: str, operations: list[OperationInfo]) -> bool: + def _is_operation_io_type( + self, type_name: str, operations: list[OperationInfo] + ) -> bool: """Check if a type is used as operation input/output.""" return any(type_name in (op.input.name, op.output.name) for op in operations) @@ -437,8 +459,12 @@ def _generate_client_docs(self, client_info: ClientInfo) -> bool: self._generate_type_stubs( client_info.models.structures, "structures", "Structure Class" ) - self._generate_type_stubs(client_info.models.errors, "errors", "Error Class") - self._generate_type_stubs(client_info.models.enums, "enums", "Enum Class", members=True) + self._generate_type_stubs( + client_info.models.errors, "errors", "Error Class" + ) + self._generate_type_stubs( + client_info.models.enums, "enums", "Enum Class", members=True + ) self._generate_union_stubs(client_info.models.unions) except OSError as e: logger.error(f"Failed to write documentation files: {e}") @@ -470,7 +496,9 @@ def _generate_index(self, client_info: ClientInfo) -> None: ] for method in sorted(client_info.client_methods, key=lambda x: x.name): - lines.extend([*self._mkdocs_directive(method.module_path, heading_level=4), ""]) + lines.extend( + [*self._mkdocs_directive(method.module_path, heading_level=4), ""] + ) # Operations section if client_info.operations: @@ -578,7 +606,9 @@ def _generate_operation_stubs(self, operations: list[OperationInfo]) -> None: output_path = self.output_dir / "operations" / f"{op.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb("Operations", op.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb("Operations", op.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(operations)} operation file(s)") @@ -600,7 +630,9 @@ def _generate_type_stubs( output_path = self.output_dir / category / f"{item.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb(category.title(), item.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb(category.title(), item.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(items)} {category} file(s)") @@ -624,7 +656,9 @@ def _generate_union_stubs(self, unions: list[UnionInfo]) -> None: output_path = self.output_dir / "unions" / f"{union.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb("Unions", union.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb("Unions", union.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(unions)} union file(s)") diff --git a/clients/aws-sdk-bedrock-agentcore/src/aws_sdk_bedrock_agentcore/_private/schemas.py b/clients/aws-sdk-bedrock-agentcore/src/aws_sdk_bedrock_agentcore/_private/schemas.py index 60a18bef..947decc6 100644 --- a/clients/aws-sdk-bedrock-agentcore/src/aws_sdk_bedrock_agentcore/_private/schemas.py +++ b/clients/aws-sdk-bedrock-agentcore/src/aws_sdk_bedrock_agentcore/_private/schemas.py @@ -2,10641 +2,9502 @@ from types import MappingProxyType -from smithy_core.prelude import ( - BLOB, - BOOLEAN, - DOCUMENT, - DOUBLE, - INTEGER, - LONG, - STRING, - TIMESTAMP, - UNIT, +from smithy_core._schema_compact import StaticOperationSchema, StaticSchema + + +n0 = "com.amazonaws.bedrockagentcore" +_IC = "InlineContent" +_SV = "SchemaVersion" +_ACD = "AgentCardDefinition" +_sV = "schemaVersion" +_iC = "inlineContent" +_AD = "A2aDescriptor" +_aC = "agentCard" +_s = "smithy.api#required" +_ABTA = "ABTestArn" +_ABTD = "ABTestDescription" +_OECA = "OnlineEvaluationConfigArn" +_VN = "VariantName" +_PVOEC = "PerVariantOnlineEvaluationConfig" +_n = "name" +_oECA = "onlineEvaluationConfigArn" +_PVOECL = "PerVariantOnlineEvaluationConfigList" +_m = "member" +_ABTEC = "ABTestEvaluationConfig" +_pVOEC = "perVariantOnlineEvaluationConfig" +_ABTES = "ABTestExecutionStatus" +_PAUSED = "PAUSED" +_sVm = "smithy.api#enumValue" +_RUNNING = "RUNNING" +_STOPPED = "STOPPED" +_NS = "NOT_STARTED" +_ABTI = "ABTestId" +_ABTN = "ABTestName" +_CS = "ControlStats" +_vN = "variantName" +_sS = "sampleSize" +_me = "mean" +_CI = "ConfidenceInterval" +_l = "lower" +_u = "upper" +_VR = "VariantResult" +_aCb = "absoluteChange" +_pC = "percentChange" +_pV = "pValue" +_cI = "confidenceInterval" +_iS = "isSignificant" +_VRL = "VariantResultList" +_EM = "EvaluatorMetric" +_eA = "evaluatorArn" +_cS = "controlStats" +_vR = "variantResults" +_EML = "EvaluatorMetricList" +_ABTR = "ABTestResults" +_aT = "analysisTimestamp" +_eM = "evaluatorMetrics" +_ABTS = "ABTestStatus" +_CREATING = "CREATING" +_ACTIVE = "ACTIVE" +_CF = "CREATE_FAILED" +_UPDATING = "UPDATING" +_UF = "UPDATE_FAILED" +_DELETING = "DELETING" +_DF = "DELETE_FAILED" +_FAILED = "FAILED" +_GA = "GatewayArn" +_ABTSe = "ABTestSummary" +_aTI = "abTestId" +_aTA = "abTestArn" +_st = "status" +_eS = "executionStatus" +_d = "description" +_gA = "gatewayArn" +_cA = "createdAt" +_uA = "updatedAt" +_ABTSL = "ABTestSummaryList" +_NBS = "NonBlankString" +_ADE = "AccessDeniedException" +_sm = "smithy.api#error" +_c = "client" +_sE = "smithy.api#httpError" +_mes = "message" +_ATT = "AccessTokenType" +_smi = "smithy.api#sensitive" +_AI = "ActorId" +_AS = "ActorSummary" +_aI = "actorId" +_ASL = "ActorSummaryList" +_IFC = "InsightsFailureCategory" +_EEA = "EXECUTION_ERROR_AUTHENTICATION" +_eeca = "execution-error-category-authentication" +_EERNF = "EXECUTION_ERROR_RESOURCE_NOT_FOUND" +_eecrnf = "execution-error-category-resource-not-found" +_EESE = "EXECUTION_ERROR_SERVICE_ERRORS" +_eecse = "execution-error-category-service-errors" +_EERL = "EXECUTION_ERROR_RATE_LIMITING" +_eecrl = "execution-error-category-rate-limiting" +_EEF = "EXECUTION_ERROR_FORMATTING" +_eecf = "execution-error-category-formatting" +_EET = "EXECUTION_ERROR_TIMEOUT" +_eect = "execution-error-category-timeout" +_EERE = "EXECUTION_ERROR_RESOURCE_EXHAUSTION" +_eecre = "execution-error-category-resource-exhaustion" +_EEE = "EXECUTION_ERROR_ENVIRONMENT" +_eece = "execution-error-category-environment" +_EETS = "EXECUTION_ERROR_TOOL_SCHEMA" +_eects = "execution-error-category-tool-schema" +_TINC = "TASK_INSTRUCTION_NON_COMPLIANCE" +_ticnc = "task-instruction-category-non-compliance" +_TIPI = "TASK_INSTRUCTION_PROBLEM_ID" +_ticpi = "task-instruction-category-problem-id" +_IATS = "INCORRECT_ACTIONS_TOOL_SELECTION" +_iacts = "incorrect-actions-category-tool-selection" +_IAPIR = "INCORRECT_ACTIONS_POOR_INFORMATION_RETRIEVAL" +_iacpir = "incorrect-actions-category-poor-information-retrieval" +_IAC = "INCORRECT_ACTIONS_CLARIFICATION" +_iacc = "incorrect-actions-category-clarification" +_IAIIR = "INCORRECT_ACTIONS_INAPPROPRIATE_INFO_REQUEST" +_iaciir = "incorrect-actions-category-inappropriate-info-request" +_CHF = "CONTEXT_HANDLING_FAILURES" +_checchf = "context-handling-error-category-context-handling-failures" +_HC = "HALLUCINATION_CAPABILITIES" +_hchc = "hallucination-category-hall-capabilities" +_HM = "HALLUCINATION_MISUNDERSTAND" +_hchm = "hallucination-category-hall-misunderstand" +_HU = "HALLUCINATION_USAGE" +_hchu = "hallucination-category-hall-usage" +_HH = "HALLUCINATION_HISTORY" +_hchh = "hallucination-category-hall-history" +_HP = "HALLUCINATION_PARAMS" +_hchp = "hallucination-category-hall-params" +_HFTO = "HALLUCINATION_FABRICATE_TOOL_OUTPUTS" +_hcfto = "hallucination-category-fabricate-tool-outputs" +_RBT = "REPETITIVE_BEHAVIOR_TOOL" +_rbcrt = "repetitive-behavior-category-repetition-tool" +_RBI = "REPETITIVE_BEHAVIOR_INFO" +_rbcri = "repetitive-behavior-category-repetition-info" +_RBS = "REPETITIVE_BEHAVIOR_STEP" +_rbcsr = "repetitive-behavior-category-step-repetition" +_ORM = "ORCHESTRATION_REASONING_MISMATCH" +_orecrm = "orchestration-related-errors-category-reasoning-mismatch" +_OGD = "ORCHESTRATION_GOAL_DEVIATION" +_orecgd = "orchestration-related-errors-category-goal-deviation" +_OPT = "ORCHESTRATION_PREMATURE_TERMINATION" +_orecpt = "orchestration-related-errors-category-premature-termination" +_OUT = "ORCHESTRATION_UNAWARE_TERMINATION" +_orecut = "orchestration-related-errors-category-unaware-termination" +_LON = "LLM_OUTPUT_NONSENSICAL" +_locn = "llm-output-category-nonsensical" +_CMTD = "CONFIGURATION_MISMATCH_TOOL_DEFINITION" +_cmctd = "configuration-mismatch-category-tool-definition" +_CECO = "CODING_EDGE_CASE_OVERSIGHTS" +_cucsftceco = "coding-use-case-specific-failure-types-category-edge-case-oversights" +_CDI = "CODING_DEPENDENCY_ISSUES" +_cucsftcdi = "coding-use-case-specific-failure-types-category-dependency-issues" +_OTHER = "OTHER" +_o = "other" +_IFS = "InsightsFailureSignal" +_ca = "category" +_e = "evidence" +_co = "confidence" +_IFSL = "InsightsFailureSignalList" +_FSD = "FailureSpanDetail" +_sI = "spanId" +_tI = "traceId" +_si = "signals" +_FSDL = "FailureSpanDetailList" +_ASf = "AffectedSession" +_sIe = "sessionId" +_ex = "explanation" +_fT = "fixType" +_r = "recommendation" +_fS = "failureSpans" +_ASLf = "AffectedSessionList" +_AC = "AgentCard" +_ST = "SessionType" +_GACI = "GetAgentCardInput" +_sSI = "smithy.synthetic#originalShapeId" +_cGACR = "com.amazonaws.bedrockagentcore#GetAgentCardRequest" +_smit = "smithy.api#input" +_rSI = "runtimeSessionId" +_sH = "smithy.api#httpHeader" +_XABARSI = "X-Amzn-Bedrock-AgentCore-Runtime-Session-Id" +_sT = "smithy.api#idempotencyToken" +_aRA = "agentRuntimeArn" +_sL = "smithy.api#httpLabel" +_q = "qualifier" +_sQ = "smithy.api#httpQuery" +_SI = "SessionId" +_HRC = "HttpResponseCode" +_GACO = "GetAgentCardOutput" +_cGACRo = "com.amazonaws.bedrockagentcore#GetAgentCardResponse" +_smith = "smithy.api#output" +_sP = "smithy.api#httpPayload" +_sC = "statusCode" +_sRC = "smithy.api#httpResponseCode" +_ISE = "InternalServerException" +_se = "server" +_RNFE = "ResourceNotFoundException" +_RCE = "RetryableConflictException" +_RCEu = "RuntimeClientError" +_SQEE = "ServiceQuotaExceededException" +_TE = "ThrottlingException" +_VEF = "ValidationExceptionField" +_VEFL = "ValidationExceptionFieldList" +_VER = "ValidationExceptionReason" +_CP = "CANNOT_PARSE" +_CPa = "CannotParse" +_FVF = "FIELD_VALIDATION_FAILED" +_FVFi = "FieldValidationFailed" +_IPME = "IDEMPOTENT_PARAMETER_MISMATCH_EXCEPTION" +_IPMEd = "IdempotentParameterMismatchException" +_REIOS = "ROOT_EVENT_IN_OTHER_SESSION" +_EIOS = "EventInOtherSession" +_RC = "RESOURCE_CONFLICT" +_RCe = "ResourceConflict" +_VE = "ValidationException" +_re = "reason" +_fL = "fieldList" +_GAC = "GetAgentCard" +_smithy = "smithy.api#http" +_MT = "MimeType" +_STt = "StringType" +_B = "Body" +_IARI = "InvokeAgentRuntimeInput" +_cIARR = "com.amazonaws.bedrockagentcore#InvokeAgentRuntimeRequest" +_cT = "contentType" +_CT = "Content-Type" +_a = "accept" +_A = "Accept" +_mSI = "mcpSessionId" +_MSI = "Mcp-Session-Id" +_mPV = "mcpProtocolVersion" +_MPV = "Mcp-Protocol-Version" +_mM = "mcpMethod" +_MM = "Mcp-Method" +_mN = "mcpName" +_MN = "Mcp-Name" +_rUI = "runtimeUserId" +_XABARUI = "X-Amzn-Bedrock-AgentCore-Runtime-User-Id" +_XATI = "X-Amzn-Trace-Id" +_tP = "traceParent" +_t = "traceparent" +_tS = "traceState" +_tr = "tracestate" +_b = "baggage" +_aIc = "accountId" +_p = "payload" +_RS = "ResponseStream" +_smithya = "smithy.api#streaming" +_IARO = "InvokeAgentRuntimeOutput" +_cIARRo = "com.amazonaws.bedrockagentcore#InvokeAgentRuntimeResponse" +_res = "response" +_smithyap = "smithy.api#default" +_v = "" +_IAR = "InvokeAgentRuntime" +_IARCRB = "InvokeAgentRuntimeCommandRequestBody" +_com = "command" +_ti = "timeout" +_IARCI = "InvokeAgentRuntimeCommandInput" +_cIARCR = "com.amazonaws.bedrockagentcore#InvokeAgentRuntimeCommandRequest" +_bo = "body" +_CDE = "ContentDeltaEvent" +_std = "stdout" +_stde = "stderr" +_CSE = "ContentStartEvent" +_CES = "CommandExecutionStatus" +_COMPLETED = "COMPLETED" +_TO = "TIMED_OUT" +_CSEo = "ContentStopEvent" +_eC = "exitCode" +_RCes = "ResponseChunk" +_cSo = "contentStart" +_cD = "contentDelta" +_cSon = "contentStop" +_IARCSO = "InvokeAgentRuntimeCommandStreamOutput" +_ch = "chunk" +_aDE = "accessDeniedException" +_iSE = "internalServerException" +_rNFE = "resourceNotFoundException" +_sQEE = "serviceQuotaExceededException" +_tE = "throttlingException" +_vE = "validationException" +_rCE = "runtimeClientError" +_IARCO = "InvokeAgentRuntimeCommandOutput" +_cIARCRo = "com.amazonaws.bedrockagentcore#InvokeAgentRuntimeCommandResponse" +_str = "stream" +_IARC = "InvokeAgentRuntimeCommand" +_CE = "ConflictException" +_CTl = "ClientToken" +_SRSI = "StopRuntimeSessionInput" +_cSRSR = "com.amazonaws.bedrockagentcore#StopRuntimeSessionRequest" +_cTl = "clientToken" +_SRSO = "StopRuntimeSessionOutput" +_cSRSRo = "com.amazonaws.bedrockagentcore#StopRuntimeSessionResponse" +_UE = "UnauthorizedException" +_SRS = "StopRuntimeSession" +_SD = "SkillDefinition" +_SMD = "SkillMdDefinition" +_ASD = "AgentSkillsDescriptor" +_sM = "skillMd" +_sD = "skillDefinition" +_BEA = "BatchEvaluationArn" +_BETC = "BatchEvaluationTraceConfig" +_bEA = "batchEvaluationArn" +_LGAL = "LogGroupArnList" +_CWLFO = "CloudWatchLogsFilterOperator" +_EQUALS = "EQUALS" +_E = "Equals" +_NE = "NOT_EQUALS" +_NEo = "NotEquals" +_GT = "GREATER_THAN" +_GTr = "GreaterThan" +_LT = "LESS_THAN" +_LTe = "LessThan" +_GTOE = "GREATER_THAN_OR_EQUAL" +_GTOEr = "GreaterThanOrEqual" +_LTOE = "LESS_THAN_OR_EQUAL" +_LTOEe = "LessThanOrEqual" +_CONTAINS = "CONTAINS" +_C = "Contains" +_NC = "NOT_CONTAINS" +_NCo = "NotContains" +_FSV = "FilterStringValue" +_FV = "FilterValue" +_sVt = "stringValue" +_dV = "doubleValue" +_bV = "booleanValue" +_CWLF = "CloudWatchLogsFilter" +_k = "key" +_op = "operator" +_va = "value" +_CWLFL = "CloudWatchLogsFilterList" +_CWLR = "CloudWatchLogsRule" +_f = "filters" +_SN = "ServiceName" +_SNL = "ServiceNameList" +_CWLTC = "CloudWatchLogsTraceConfig" +_lGA = "logGroupArns" +_sN = "serviceNames" +_sTt = "startTime" +_sF = "smithy.api#timestampFormat" +_dt = "date-time" +_eT = "endTime" +_ru = "rule" +_OETC = "OnlineEvaluationTraceConfig" +_S = "Span" +_Sp = "Spans" +_ATC = "AgentTracesConfig" +_sSe = "sessionSpans" +_cL = "cloudwatchLogs" +_bE = "batchEvaluation" +_oE = "onlineEvaluation" +_BPI = "BrowserProfileId" +_BSI = "BrowserSessionId" +_SBSPI = "SaveBrowserSessionProfileInput" +_cSBSPR = "com.amazonaws.bedrockagentcore#SaveBrowserSessionProfileRequest" +_pI = "profileIdentifier" +_bI = "browserIdentifier" +_DT = "DateTimestamp" +_SBSPO = "SaveBrowserSessionProfileOutput" +_cSBSPRo = "com.amazonaws.bedrockagentcore#SaveBrowserSessionProfileResponse" +_lUA = "lastUpdatedAt" +_SBSP = "SaveBrowserSessionProfile" +_GBSI = "GetBrowserSessionInput" +_cGBSR = "com.amazonaws.bedrockagentcore#GetBrowserSessionRequest" +_SA = "SecretArn" +_SML = "SecretsManagerLocation" +_sA = "secretArn" +_CL = "CertificateLocation" +_sMe = "secretsManager" +_Ce = "Certificate" +_lo = "location" +_Cer = "Certificates" +_SL = "S3Location" +_bu = "bucket" +_pr = "prefix" +_vI = "versionId" +_RL = "ResourceLocation" +_s_ = "s3" +_BEPT = "BrowserEnterprisePolicyType" +_MANAGED = "MANAGED" +_RECOMMENDED = "RECOMMENDED" +_BEP = "BrowserEnterprisePolicy" +_ty = "type" +_BEPr = "BrowserEnterprisePolicies" +_BE = "BrowserExtension" +_BEr = "BrowserExtensions" +_EAPA = "EfsAccessPointArn" +_EFSA = "EfsFileSystemArn" +_MP = "MountPath" +_EC = "EfsConfiguration" +_aPA = "accessPointArn" +_mP = "mountPath" +_fSA = "fileSystemArn" +_SFAPA = "S3FilesAccessPointArn" +_SFFSA = "S3FilesFileSystemArn" +_SFC = "S3FilesConfiguration" +_TFSC = "ToolsFileSystemConfiguration" +_sFC = "s3FilesConfiguration" +_eCf = "efsConfiguration" +_TFSCo = "ToolsFileSystemConfigurations" +_N = "Name" +_BPC = "BrowserProfileConfiguration" +_DP = "DomainPattern" +_DPo = "DomainPatterns" +_PB = "ProxyBypass" +_dP = "domainPatterns" +_BA = "BasicAuth" +_PC = "ProxyCredentials" +_bA = "basicAuth" +_HN = "HostName" +_EP = "ExternalProxy" +_po = "port" +_cr = "credentials" +_P = "Proxy" +_eP = "externalProxy" +_Pr = "Proxies" +_PCr = "ProxyConfiguration" +_pro = "proxies" +_by = "bypass" +_BST = "BrowserSessionTimeout" +_BSS = "BrowserSessionStatus" +_READY = "READY" +_TERMINATED = "TERMINATED" +_BSE = "BrowserStreamEndpoint" +_ASS = "AutomationStreamStatus" +_ENABLED = "ENABLED" +_DISABLED = "DISABLED" +_ASu = "AutomationStream" +_sEt = "streamEndpoint" +_sSt = "streamStatus" +_LVS = "LiveViewStream" +_BSSr = "BrowserSessionStream" +_aS = "automationStream" +_lVS = "liveViewStream" +_VPH = "ViewPortHeight" +_VPW = "ViewPortWidth" +_VP = "ViewPort" +_w = "width" +_h = "height" +_GBSO = "GetBrowserSessionOutput" +_cGBSRo = "com.amazonaws.bedrockagentcore#GetBrowserSessionResponse" +_vP = "viewPort" +_ext = "extensions" +_ePn = "enterprisePolicies" +_pCr = "profileConfiguration" +_sTS = "sessionTimeoutSeconds" +_stre = "streams" +_pCro = "proxyConfiguration" +_ce = "certificates" +_fC = "filesystemConfigurations" +_sRA = "sessionReplayArtifact" +_GBS = "GetBrowserSession" +_KPA = "KeyPressArguments" +_pre = "presses" +_KL = "KeyList" +_KSA = "KeyShortcutArguments" +_ke = "keys" +_KTA = "KeyTypeArguments" +_te = "text" +_MB = "MouseButton" +_LEFT = "LEFT" +_RIGHT = "RIGHT" +_MIDDLE = "MIDDLE" +_MCA = "MouseClickArguments" +_x = "x" +_y = "y" +_but = "button" +_cC = "clickCount" +_MDA = "MouseDragArguments" +_eX = "endX" +_eY = "endY" +_sX = "startX" +_sY = "startY" +_MMA = "MouseMoveArguments" +_MSA = "MouseScrollArguments" +_dX = "deltaX" +_dY = "deltaY" +_SF = "ScreenshotFormat" +_PNG = "PNG" +_SAc = "ScreenshotArguments" +_fo = "format" +_BAr = "BrowserAction" +_mC = "mouseClick" +_mMo = "mouseMove" +_mD = "mouseDrag" +_mS = "mouseScroll" +_kT = "keyType" +_kP = "keyPress" +_kS = "keyShortcut" +_sc = "screenshot" +_IBI = "InvokeBrowserInput" +_cIBR = "com.amazonaws.bedrockagentcore#InvokeBrowserRequest" +_xabsi = "x-amzn-browser-session-id" +_ac = "action" +_BAS = "BrowserActionStatus" +_SUCCESS = "SUCCESS" +_KPR = "KeyPressResult" +_er = "error" +_KSR = "KeyShortcutResult" +_KTR = "KeyTypeResult" +_MCR = "MouseClickResult" +_MDR = "MouseDragResult" +_MMR = "MouseMoveResult" +_MSR = "MouseScrollResult" +_SR = "ScreenshotResult" +_da = "data" +_BAR = "BrowserActionResult" +_IBO = "InvokeBrowserOutput" +_cIBRo = "com.amazonaws.bedrockagentcore#InvokeBrowserResponse" +_resu = "result" +_IB = "InvokeBrowser" +_MR = "MaxResults" +_NT = "NextToken" +_LBSI = "ListBrowserSessionsInput" +_cLBSR = "com.amazonaws.bedrockagentcore#ListBrowserSessionsRequest" +_mR = "maxResults" +_nT = "nextToken" +_BSSro = "BrowserSessionSummary" +_BSSrow = "BrowserSessionSummaries" +_LBSO = "ListBrowserSessionsOutput" +_cLBSRo = "com.amazonaws.bedrockagentcore#ListBrowserSessionsResponse" +_i = "items" +_LBS = "ListBrowserSessions" +_SBSI = "StartBrowserSessionInput" +_cSBSR = "com.amazonaws.bedrockagentcore#StartBrowserSessionRequest" +_SBSO = "StartBrowserSessionOutput" +_cSBSRo = "com.amazonaws.bedrockagentcore#StartBrowserSessionResponse" +_SBS = "StartBrowserSession" +_SBSIt = "StopBrowserSessionInput" +_cSBSRom = "com.amazonaws.bedrockagentcore#StopBrowserSessionRequest" +_SBSOt = "StopBrowserSessionOutput" +_cSBSRoma = "com.amazonaws.bedrockagentcore#StopBrowserSessionResponse" +_SBSt = "StopBrowserSession" +_ASU = "AutomationStreamUpdate" +_SU = "StreamUpdate" +_aSU = "automationStreamUpdate" +_UBSI = "UpdateBrowserStreamInput" +_cUBSR = "com.amazonaws.bedrockagentcore#UpdateBrowserStreamRequest" +_sU = "streamUpdate" +_UBSO = "UpdateBrowserStreamOutput" +_cUBSRo = "com.amazonaws.bedrockagentcore#UpdateBrowserStreamResponse" +_UBS = "UpdateBrowserStream" +_CPI = "CapacityProviderId" +_DCPSI = "DeleteCapacityProviderSessionInput" +_cDCPSR = "com.amazonaws.bedrockagentcore#DeleteCapacityProviderSessionRequest" +_cPI = "capacityProviderId" +_CPA = "CapacityProviderArn" +_CPSS = "CapacityProviderSessionStatus" +_PROVISIONING = "PROVISIONING" +_Pro = "Provisioning" +_DEPROVISIONING = "DEPROVISIONING" +_D = "Deprovisioning" +_Ac = "Active" +_De = "Deleting" +_DELETED = "DELETED" +_Del = "Deleted" +_St = "Stopped" +_DCPSO = "DeleteCapacityProviderSessionOutput" +_cDCPSRo = "com.amazonaws.bedrockagentcore#DeleteCapacityProviderSessionResponse" +_cPA = "capacityProviderArn" +_DCPS = "DeleteCapacityProviderSession" +_CISI = "CodeInterpreterSessionId" +_GCISI = "GetCodeInterpreterSessionInput" +_cGCISR = "com.amazonaws.bedrockagentcore#GetCodeInterpreterSessionRequest" +_cII = "codeInterpreterIdentifier" +_CIST = "CodeInterpreterSessionTimeout" +_CISS = "CodeInterpreterSessionStatus" +_GCISO = "GetCodeInterpreterSessionOutput" +_cGCISRo = "com.amazonaws.bedrockagentcore#GetCodeInterpreterSessionResponse" +_GCIS = "GetCodeInterpreterSession" +_LCISI = "ListCodeInterpreterSessionsInput" +_cLCISR = "com.amazonaws.bedrockagentcore#ListCodeInterpreterSessionsRequest" +_CISSo = "CodeInterpreterSessionSummary" +_CISSod = "CodeInterpreterSessionSummaries" +_LCISO = "ListCodeInterpreterSessionsOutput" +_cLCISRo = "com.amazonaws.bedrockagentcore#ListCodeInterpreterSessionsResponse" +_LCIS = "ListCodeInterpreterSessions" +_SCISI = "StartCodeInterpreterSessionInput" +_cSCISR = "com.amazonaws.bedrockagentcore#StartCodeInterpreterSessionRequest" +_SCISO = "StartCodeInterpreterSessionOutput" +_cSCISRo = "com.amazonaws.bedrockagentcore#StartCodeInterpreterSessionResponse" +_SCIS = "StartCodeInterpreterSession" +_SCISIt = "StopCodeInterpreterSessionInput" +_cSCISRom = "com.amazonaws.bedrockagentcore#StopCodeInterpreterSessionRequest" +_SCISOt = "StopCodeInterpreterSessionOutput" +_cSCISRoma = "com.amazonaws.bedrockagentcore#StopCodeInterpreterSessionResponse" +_SCISt = "StopCodeInterpreterSession" +_RU = "RequestUri" +_UIT = "UserIdType" +_UTT = "UserTokenType" +_UI = "UserIdentifier" +_uT = "userToken" +_uI = "userId" +_CRTAI = "CompleteResourceTokenAuthInput" +_cCRTAR = "com.amazonaws.bedrockagentcore#CompleteResourceTokenAuthRequest" +_uIs = "userIdentifier" +_sUe = "sessionUri" +_CRTAO = "CompleteResourceTokenAuthOutput" +_cCRTARo = "com.amazonaws.bedrockagentcore#CompleteResourceTokenAuthResponse" +_CRTA = "CompleteResourceTokenAuth" +_PP = "PathPattern" +_TPL = "TargetPathList" +_GF = "GatewayFilter" +_tPa = "targetPaths" +_RA = "RoleArn" +_TK = "TagKey" +_TV = "TagValue" +_TM = "TagsMap" +_CBA = "ConfigurationBundleArn" +_CBV = "ConfigurationBundleVersion" +_CBR = "ConfigurationBundleRef" +_bAu = "bundleArn" +_bVu = "bundleVersion" +_TN = "TargetName" +_TR = "TargetRef" +_VC = "VariantConfiguration" +_cB = "configurationBundle" +_ta = "target" +_V = "Variant" +_we = "weight" +_vC = "variantConfiguration" +_VL = "VariantList" +_CABTI = "CreateABTestInput" +_cCABTR = "com.amazonaws.bedrockagentcore#CreateABTestRequest" +_var = "variants" +_gF = "gatewayFilter" +_eCv = "evaluationConfig" +_rA = "roleArn" +_eOC = "enableOnCreate" +_tag = "tags" +_CABTO = "CreateABTestOutput" +_cCABTRo = "com.amazonaws.bedrockagentcore#CreateABTestResponse" +_CABT = "CreateABTest" +_DABTI = "DeleteABTestInput" +_cDABTR = "com.amazonaws.bedrockagentcore#DeleteABTestRequest" +_DABTO = "DeleteABTestOutput" +_cDABTRo = "com.amazonaws.bedrockagentcore#DeleteABTestResponse" +_DABT = "DeleteABTest" +_BEI = "BatchEvaluationId" +_DBEI = "DeleteBatchEvaluationInput" +_cDBER = "com.amazonaws.bedrockagentcore#DeleteBatchEvaluationRequest" +_bEI = "batchEvaluationId" +_BES = "BatchEvaluationStatus" +_PENDING = "PENDING" +_IP = "IN_PROGRESS" +_CWE = "COMPLETED_WITH_ERRORS" +_STOPPING = "STOPPING" +_DBEO = "DeleteBatchEvaluationOutput" +_cDBERo = "com.amazonaws.bedrockagentcore#DeleteBatchEvaluationResponse" +_DBE = "DeleteBatchEvaluation" +_RI = "RecommendationId" +_DRI = "DeleteRecommendationInput" +_cDRR = "com.amazonaws.bedrockagentcore#DeleteRecommendationRequest" +_rI = "recommendationId" +_RSe = "RecommendationStatus" +_DRO = "DeleteRecommendationOutput" +_cDRRo = "com.amazonaws.bedrockagentcore#DeleteRecommendationResponse" +_DR = "DeleteRecommendation" +_DIE = "DuplicateIdException" +_EI = "EvaluationInput" +_ECv = "EvaluationContent" +_ECL = "EvaluationContentList" +_SC = "SpanContext" +_Co = "Context" +_sCp = "spanContext" +_ETN = "EvaluationToolName" +_ETNv = "EvaluationToolNames" +_EETv = "EvaluationExpectedTrajectory" +_tN = "toolNames" +_ERI = "EvaluationReferenceInput" +_con = "context" +_eR = "expectedResponse" +_as = "assertions" +_eTx = "expectedTrajectory" +_ERIv = "EvaluationReferenceInputs" +_SIp = "SpanId" +_SIpa = "SpanIds" +_TI = "TraceId" +_TIr = "TraceIds" +_ET = "EvaluationTarget" +_sIp = "spanIds" +_tIr = "traceIds" +_EIv = "EvaluatorId" +_EIva = "EvaluateInput" +_cER = "com.amazonaws.bedrockagentcore#EvaluateRequest" +_eI = "evaluatorId" +_eIv = "evaluationInput" +_eTv = "evaluationTarget" +_eRI = "evaluationReferenceInputs" +_EEC = "EvaluationErrorCode" +_EEM = "EvaluationErrorMessage" +_EA = "EvaluatorArn" +_EN = "EvaluatorName" +_EE = "EvaluationExplanation" +_IRIF = "IgnoredReferenceInputField" +_IRIFg = "IgnoredReferenceInputFields" +_TU = "TokenUsage" +_iT = "inputTokens" +_oT = "outputTokens" +_tT = "totalTokens" +_ERC = "EvaluationResultContent" +_eN = "evaluatorName" +_la = "label" +_tU = "tokenUsage" +_eMr = "errorMessage" +_eCr = "errorCode" +_iRIF = "ignoredReferenceInputFields" +_ER = "EvaluationResults" +_EO = "EvaluateOutput" +_cERo = "com.amazonaws.bedrockagentcore#EvaluateResponse" +_eRv = "evaluationResults" +_Ev = "Evaluate" +_GABTI = "GetABTestInput" +_cGABTR = "com.amazonaws.bedrockagentcore#GetABTestRequest" +_EDL = "ErrorDetailsList" +_GABTO = "GetABTestOutput" +_cGABTRo = "com.amazonaws.bedrockagentcore#GetABTestResponse" +_cRI = "currentRunId" +_eD = "errorDetails" +_sAt = "startedAt" +_sAto = "stoppedAt" +_mDEA = "maxDurationExpiresAt" +_resul = "results" +_GABT = "GetABTest" +_GBEI = "GetBatchEvaluationInput" +_cGBER = "com.amazonaws.bedrockagentcore#GetBatchEvaluationRequest" +_BEN = "BatchEvaluationName" +_ESL = "EvaluationStringList" +_TIL = "TraceIdList" +_STI = "SessionTraceIds" +_STIL = "SessionTraceIdsList" +_SFCe = "SessionFilterConfig" +_CWFC = "CloudWatchFilterConfig" +_sIes = "sessionIds" +_tR = "timeRange" +_sTI = "sessionTraceIds" +_LGNP = "LogGroupNamePrefix" +_LGNPL = "LogGroupNamePrefixList" +_LGN = "LogGroupName" +_LGNL = "LogGroupNameList" +_CWLS = "CloudWatchLogsSource" +_lGN = "logGroupNames" +_lGNP = "logGroupNamePrefixes" +_fCi = "filterConfig" +_OECS = "OnlineEvaluationConfigSource" +_DSC = "DataSourceConfig" +_cWL = "cloudWatchLogs" +_oECS = "onlineEvaluationConfigSource" +_BED = "BatchEvaluationDescription" +_ES = "EvaluatorStatistics" +_aSv = "averageScore" +_ESv = "EvaluatorSummary" +_sta = "statistics" +_tEo = "totalEvaluated" +_tF = "totalFailed" +_ESLv = "EvaluatorSummaryList" +_EJR = "EvaluationJobResults" +_nOSC = "numberOfSessionsCompleted" +_nOSIP = "numberOfSessionsInProgress" +_nOSF = "numberOfSessionsFailed" +_tNOS = "totalNumberOfSessions" +_nOSI = "numberOfSessionsIgnored" +_eSv = "evaluatorSummaries" +_Eva = "Evaluator" +_EL = "EvaluatorList" +_ESAS = "ExecutionSummaryAffectedSession" +_aTp = "approachTaken" +_fO = "finalOutcome" +_ESASL = "ExecutionSummaryAffectedSessionList" +_ESC = "ExecutionSummaryCluster" +_cIl = "clusterId" +_aSC = "affectedSessionCount" +_aSf = "affectedSessions" +_ESCL = "ExecutionSummaryClusterList" +_ESCRC = "ExecutionSummaryClusteringResultContent" +_eSx = "executionSummaries" +_RCC = "RootCauseCluster" +_rC = "rootCause" +_RCCL = "RootCauseClusterList" +_FSCC = "FailureSubCategoryCluster" +_rCo = "rootCauses" +_FSCCL = "FailureSubCategoryClusterList" +_FCC = "FailureCategoryCluster" +_sCu = "subCategories" +_FCCL = "FailureCategoryClusterList" +_FARC = "FailureAnalysisResultContent" +_fa = "failures" +_II = "InsightId" +_I = "Insight" +_iI = "insightId" +_IL = "InsightList" +_KKA = "KmsKeyArn" +_OLGN = "OptionalLogGroupName" +_LSN = "LogStreamName" +_MNe = "MetricsNamespace" +_RD = "ResultDestination" +_DLG = "DEDICATED_LOG_GROUP" +_SLG = "SOURCE_LOG_GROUP" +_CWOC = "CloudWatchOutputConfig" +_lGNo = "logGroupName" +_lSN = "logStreamName" +_mNe = "metricsNamespace" +_rD = "resultDestination" +_OC = "OutputConfig" +_cWC = "cloudWatchConfig" +_UIL = "UserIntentList" +_UIAS = "UserIntentAffectedSession" +_uM = "userMessages" +_UIASL = "UserIntentAffectedSessionList" +_UIC = "UserIntentCluster" +_UICL = "UserIntentClusterList" +_UICRC = "UserIntentClusteringResultContent" +_uIse = "userIntents" +_GBEO = "GetBatchEvaluationOutput" +_cGBERo = "com.amazonaws.bedrockagentcore#GetBatchEvaluationResponse" +_bEN = "batchEvaluationName" +_ev = "evaluators" +_in = "insights" +_dSC = "dataSourceConfig" +_oC = "outputConfig" +_fAR = "failureAnalysisResult" +_uIR = "userIntentResult" +_eSR = "executionSummaryResult" +_kKA = "kmsKeyArn" +_GBE = "GetBatchEvaluation" +_GRI = "GetRecommendationInput" +_cGRR = "com.amazonaws.bedrockagentcore#GetRecommendationRequest" +_RDe = "RecommendationDescription" +_RN = "RecommendationName" +_RAe = "RecommendationArn" +_RER = "RecommendationEvaluatorReference" +_REL = "RecommendationEvaluatorList" +_REC = "RecommendationEvaluationConfig" +_CBVI = "ConfigurationBundleVersionId" +_SPCB = "SystemPromptConfigurationBundle" +_sPJP = "systemPromptJsonPath" +_SPT = "SystemPromptText" +_SPC = "SystemPromptConfig" +_SPRC = "SystemPromptRecommendationConfig" +_sPy = "systemPrompt" +_aTg = "agentTraces" +_RTN = "RecommendationToolName" +_CBTE = "ConfigurationBundleToolEntry" +_tNo = "toolName" +_tDJP = "toolDescriptionJsonPath" +_CBTEL = "ConfigurationBundleToolEntryList" +_TDCB = "ToolDescriptionConfigurationBundle" +_to = "tools" +_TDT = "ToolDescriptionText" +_TDC = "ToolDescriptionConfig" +_TDI = "ToolDescriptionInput" +_tD = "toolDescription" +_TDL = "ToolDescriptionList" +_TDTI = "ToolDescriptionTextInput" +_TDS = "ToolDescriptionSource" +_tDT = "toolDescriptionText" +_TDRC = "ToolDescriptionRecommendationConfig" +_RCec = "RecommendationConfig" +_sPRC = "systemPromptRecommendationConfig" +_tDRC = "toolDescriptionRecommendationConfig" +_RRCB = "RecommendationResultConfigurationBundle" +_RECe = "RecommendationErrorCode" +_REM = "RecommendationErrorMessage" +_RE = "RecommendationExplanation" +_SPRR = "SystemPromptRecommendationResult" +_rSP = "recommendedSystemPrompt" +_TDO = "ToolDescriptionOutput" +_rTD = "recommendedToolDescription" +_TDRL = "ToolDescriptionResultList" +_TDRR = "ToolDescriptionRecommendationResult" +_RR = "RecommendationResult" +_sPRR = "systemPromptRecommendationResult" +_tDRR = "toolDescriptionRecommendationResult" +_RT = "RecommendationType" +_SPR = "SYSTEM_PROMPT_RECOMMENDATION" +_TDR = "TOOL_DESCRIPTION_RECOMMENDATION" +_GRO = "GetRecommendationOutput" +_cGRRo = "com.amazonaws.bedrockagentcore#GetRecommendationResponse" +_rAe = "recommendationArn" +_rCe = "recommendationConfig" +_rR = "recommendationResult" +_GR = "GetRecommendation" +_LABTI = "ListABTestsInput" +_cLABTR = "com.amazonaws.bedrockagentcore#ListABTestsRequest" +_LABTO = "ListABTestsOutput" +_cLABTRo = "com.amazonaws.bedrockagentcore#ListABTestsResponse" +_aTb = "abTests" +_LABT = "ListABTests" +_LBEI = "ListBatchEvaluationsInput" +_cLBER = "com.amazonaws.bedrockagentcore#ListBatchEvaluationsRequest" +_BESa = "BatchEvaluationSummary" +_BESL = "BatchEvaluationSummaryList" +_LBEO = "ListBatchEvaluationsOutput" +_cLBERo = "com.amazonaws.bedrockagentcore#ListBatchEvaluationsResponse" +_bEa = "batchEvaluations" +_LBE = "ListBatchEvaluations" +_LRI = "ListRecommendationsInput" +_cLRR = "com.amazonaws.bedrockagentcore#ListRecommendationsRequest" +_sFt = "statusFilter" +_RSec = "RecommendationSummary" +_RSL = "RecommendationSummaryList" +_LRO = "ListRecommendationsOutput" +_cLRRo = "com.amazonaws.bedrockagentcore#ListRecommendationsResponse" +_rS = "recommendationSummaries" +_LR = "ListRecommendations" +_GTTI = "GroundTruthTurnInput" +_prom = "prompt" +_GTT = "GroundTruthTurn" +_inp = "input" +_GTTL = "GroundTruthTurnList" +_IGT = "InlineGroundTruth" +_tu = "turns" +_GTS = "GroundTruthSource" +_inl = "inline" +_SM = "StringMap" +_SMS = "SessionMetadataShape" +_tSI = "testScenarioId" +_gT = "groundTruth" +_met = "metadata" +_SMLe = "SessionMetadataList" +_EMv = "EvaluationMetadata" +_sMes = "sessionMetadata" +_SBEI = "StartBatchEvaluationInput" +_cSBER = "com.amazonaws.bedrockagentcore#StartBatchEvaluationRequest" +_eMv = "evaluationMetadata" +_SBEO = "StartBatchEvaluationOutput" +_cSBERo = "com.amazonaws.bedrockagentcore#StartBatchEvaluationResponse" +_SBE = "StartBatchEvaluation" +_SRI = "StartRecommendationInput" +_cSRR = "com.amazonaws.bedrockagentcore#StartRecommendationRequest" +_SRO = "StartRecommendationOutput" +_cSRRo = "com.amazonaws.bedrockagentcore#StartRecommendationResponse" +_SRt = "StartRecommendation" +_SBEIt = "StopBatchEvaluationInput" +_cSBERom = "com.amazonaws.bedrockagentcore#StopBatchEvaluationRequest" +_SBEOt = "StopBatchEvaluationOutput" +_cSBERoma = "com.amazonaws.bedrockagentcore#StopBatchEvaluationResponse" +_SBEt = "StopBatchEvaluation" +_UABTI = "UpdateABTestInput" +_cUABTR = "com.amazonaws.bedrockagentcore#UpdateABTestRequest" +_UABTO = "UpdateABTestOutput" +_cUABTRo = "com.amazonaws.bedrockagentcore#UpdateABTestResponse" +_UABT = "UpdateABTest" +_CPN = "CredentialProviderName" +_WITT = "WorkloadIdentityTokenType" +_GRAKI = "GetResourceApiKeyInput" +_cGRAKR = "com.amazonaws.bedrockagentcore#GetResourceApiKeyRequest" +_wIT = "workloadIdentityToken" +_rCPN = "resourceCredentialProviderName" +_AKT = "ApiKeyType" +_GRAKO = "GetResourceApiKeyOutput" +_cGRAKRo = "com.amazonaws.bedrockagentcore#GetResourceApiKeyResponse" +_aK = "apiKey" +_GRAK = "GetResourceApiKey" +_AT = "AudienceType" +_ALT = "AudiencesListType" +_CRKT = "CustomRequestKeyType" +_CRVT = "CustomRequestValueType" +_CRPT = "CustomRequestParametersType" +_Sta = "State" +_OFT = "Oauth2FlowType" +_UF_ = "USER_FEDERATION" +_MM_ = "M2M" +_OBOTE = "ON_BEHALF_OF_TOKEN_EXCHANGE" +_RORUT = "ResourceOauth2ReturnUrlType" +_RTe = "ResourceType" +_RLT = "ResourcesListType" +_STc = "ScopeType" +_SLT = "ScopesListType" +_GROTI = "GetResourceOauth2TokenInput" +_cGROTR = "com.amazonaws.bedrockagentcore#GetResourceOauth2TokenRequest" +_sco = "scopes" +_oF = "oauth2Flow" +_rORU = "resourceOauth2ReturnUrl" +_fA = "forceAuthentication" +_cP = "customParameters" +_cSu = "customState" +_reso = "resources" +_au = "audiences" +_AUT = "AuthorizationUrlType" +_SS = "SessionStatus" +_GROTO = "GetResourceOauth2TokenOutput" +_cGROTRo = "com.amazonaws.bedrockagentcore#GetResourceOauth2TokenResponse" +_aU = "authorizationUrl" +_aTc = "accessToken" +_sSes = "sessionStatus" +_GROT = "GetResourceOauth2Token" +_CCPRBT = "CoinbaseCdpPaymentRequestBodyType" +_PRHT = "PaymentRequestHostType" +_PHMT = "PaymentHttpMethodType" +_GET = "GET" +_POST = "POST" +_PUT = "PUT" +_DELETE = "DELETE" +_PATCH = "PATCH" +_PRPT = "PaymentRequestPathType" +_CCTRI = "CoinbaseCdpTokenRequestInput" +_rM = "requestMethod" +_rH = "requestHost" +_rP = "requestPath" +_iWAT = "includeWalletAuthToken" +_rB = "requestBody" +_SPRBT = "StripePrivyRequestBodyType" +_SPRHT = "StripePrivyRequestHostType" +_SPRPT = "StripePrivyRequestPathType" +_SPTRI = "StripePrivyTokenRequestInput" +_iAS = "includeAuthorizationSignature" +_PTRI = "PaymentTokenRequestInput" +_cCTR = "coinbaseCdpTokenRequest" +_sPTR = "stripePrivyTokenRequest" +_GRPTI = "GetResourcePaymentTokenInput" +_cGRPTR = "com.amazonaws.bedrockagentcore#GetResourcePaymentTokenRequest" +_pTR = "paymentTokenRequest" +_CCPJTT = "CoinbaseCdpPaymentJwtTokenType" +_CCTRO = "CoinbaseCdpTokenResponseOutput" +_bT = "bearerToken" +_wAT = "walletAuthToken" +_SPAIT = "StripePrivyAppIdType" +_SPAST = "StripePrivyAuthorizationSignatureType" +_SPBATT = "StripePrivyBasicAuthTokenType" +_SPTRO = "StripePrivyTokenResponseOutput" +_aSu = "authorizationSignature" +_rE = "requestExpiry" +_aIp = "appId" +_bAT = "basicAuthToken" +_PTRO = "PaymentTokenResponseOutput" +_cCTRo = "coinbaseCdpTokenResponse" +_sPTRt = "stripePrivyTokenResponse" +_GRPTO = "GetResourcePaymentTokenOutput" +_cGRPTRo = "com.amazonaws.bedrockagentcore#GetResourcePaymentTokenResponse" +_pTRa = "paymentTokenResponse" +_GRPT = "GetResourcePaymentToken" +_WINT = "WorkloadIdentityNameType" +_GWATI = "GetWorkloadAccessTokenInput" +_cGWATR = "com.amazonaws.bedrockagentcore#GetWorkloadAccessTokenRequest" +_wN = "workloadName" +_GWATO = "GetWorkloadAccessTokenOutput" +_cGWATRo = "com.amazonaws.bedrockagentcore#GetWorkloadAccessTokenResponse" +_wATo = "workloadAccessToken" +_GWAT = "GetWorkloadAccessToken" +_GWATFJWTI = "GetWorkloadAccessTokenForJWTInput" +_cGWATFJWTR = "com.amazonaws.bedrockagentcore#GetWorkloadAccessTokenForJWTRequest" +_GWATFJWTO = "GetWorkloadAccessTokenForJWTOutput" +_cGWATFJWTRo = "com.amazonaws.bedrockagentcore#GetWorkloadAccessTokenForJWTResponse" +_GWATFJWT = "GetWorkloadAccessTokenForJWT" +_GWATFUII = "GetWorkloadAccessTokenForUserIdInput" +_cGWATFUIR = "com.amazonaws.bedrockagentcore#GetWorkloadAccessTokenForUserIdRequest" +_GWATFUIO = "GetWorkloadAccessTokenForUserIdOutput" +_cGWATFUIRo = "com.amazonaws.bedrockagentcore#GetWorkloadAccessTokenForUserIdResponse" +_GWATFUI = "GetWorkloadAccessTokenForUserId" +_MLS = "MaxLenString" +_ICB = "InputContentBlock" +_pa = "path" +_bl = "blob" +_ICBL = "InputContentBlockList" +_PL = "ProgrammingLanguage" +_PYTHON = "PYTHON" +_py = "python" +_JAVASCRIPT = "JAVASCRIPT" +_j = "javascript" +_TYPESCRIPT = "TYPESCRIPT" +_typ = "typescript" +_SLt = "StringList" +_LRa = "LanguageRuntime" +_NODEJS = "NODEJS" +_no = "nodejs" +_DENO = "DENO" +_de = "deno" +_TA = "ToolArguments" +_cod = "code" +_lan = "language" +_cCl = "clearContext" +_pat = "paths" +_cont = "content" +_dPi = "directoryPath" +_tIa = "taskId" +_run = "runtime" +_TNo = "ToolName" +_EC_ = "EXECUTE_CODE" +_eCx = "executeCode" +_EC__ = "EXECUTE_COMMAND" +_eCxe = "executeCommand" +_RF = "READ_FILES" +_rF = "readFiles" +_LF = "LIST_FILES" +_lF = "listFiles" +_RF_ = "REMOVE_FILES" +_rFe = "removeFiles" +_WF = "WRITE_FILES" +_wF = "writeFiles" +_SCE = "START_COMMAND_EXECUTION" +_sCE = "startCommandExecution" +_GT_ = "GET_TASK" +_gTe = "getTask" +_ST_ = "STOP_TASK" +_sTto = "stopTask" +_ICII = "InvokeCodeInterpreterInput" +_cICIR = "com.amazonaws.bedrockagentcore#InvokeCodeInterpreterRequest" +_xacisi = "x-amzn-code-interpreter-session-id" +_ar = "arguments" +_RCT = "ResourceContentType" +_TEXT = "TEXT" +_BLOB = "BLOB" +_RCeso = "ResourceContent" +_ur = "uri" +_mT = "mimeType" +_CBT = "ContentBlockType" +_IMAGE = "IMAGE" +_im = "image" +_ER_ = "EMBEDDED_RESOURCE" +_resou = "resource" +_RL_ = "RESOURCE_LINK" +_rl = "resource_link" +_CB = "ContentBlock" +_siz = "size" +_CBL = "ContentBlockList" +_TS = "TaskStatus" +_SUBMITTED = "SUBMITTED" +_su = "submitted" +_WORKING = "WORKING" +_wo = "working" +_comp = "completed" +_CANCELED = "CANCELED" +_can = "canceled" +_fai = "failed" +_TRSC = "ToolResultStructuredContent" +_tSa = "taskStatus" +_eTxe = "executionTime" +_CIR = "CodeInterpreterResult" +_sCt = "structuredContent" +_iE = "isError" +_CISO = "CodeInterpreterStreamOutput" +_cE = "conflictException" +_ICIO = "InvokeCodeInterpreterOutput" +_cICIRo = "com.amazonaws.bedrockagentcore#InvokeCodeInterpreterResponse" +_ICI = "InvokeCodeInterpreter" +_HAT = "HarnessAllowedTool" +_HATa = "HarnessAllowedTools" +_HA = "HarnessArn" +_HRTB = "HarnessReasoningTextBlock" +_sig = "signature" +_HRCB = "HarnessReasoningContentBlock" +_rT = "reasoningText" +_rCed = "redactedContent" +_STe = "SensitiveText" +_SJ = "SensitiveJson" +_HTRCB = "HarnessToolResultContentBlock" +_js = "json" +_HTRCBa = "HarnessToolResultContentBlocks" +_HTUS = "HarnessToolUseStatus" +_suc = "success" +_ERROR = "ERROR" +_HTUI = "HarnessToolUseId" +_HTUT = "HarnessToolUseType" +_TU_ = "TOOL_USE" +_tu_ = "tool_use" +_STU = "SERVER_TOOL_USE" +_stu = "server_tool_use" +_MTU = "MCP_TOOL_USE" +_mtu = "mcp_tool_use" +_HTRB = "HarnessToolResultBlock" +_tUI = "toolUseId" +_HTN = "HarnessToolName" +_HTUB = "HarnessToolUseBlock" +_sNe = "serverName" +_HCB = "HarnessContentBlock" +_tUo = "toolUse" +_tRo = "toolResult" +_rCea = "reasoningContent" +_HCBa = "HarnessContentBlocks" +_HCR = "HarnessConversationRole" +_USER = "USER" +_us = "user" +_ASSISTANT = "ASSISTANT" +_ass = "assistant" +_HMa = "HarnessMessage" +_ro = "role" +_HMar = "HarnessMessages" +_HBAF = "HarnessBedrockApiFormat" +_CS_ = "CONVERSE_STREAM" +_cs = "converse_stream" +_RESPONSES = "RESPONSES" +_resp = "responses" +_CC = "CHAT_COMPLETIONS" +_cc = "chat_completions" +_MTa = "MaxTokens" +_MI = "ModelId" +_T = "Temperature" +_TP = "TopP" +_HBMC = "HarnessBedrockModelConfig" +_mI = "modelId" +_mTa = "maxTokens" +_tem = "temperature" +_tPo = "topP" +_aF = "apiFormat" +_aP = "additionalParams" +_AKA = "ApiKeyArn" +_TKo = "TopK" +_HGMC = "HarnessGeminiModelConfig" +_aKA = "apiKeyArn" +_tK = "topK" +_HLLAB = "HarnessLiteLlmApiBase" +_HLLMC = "HarnessLiteLlmModelConfig" +_aB = "apiBase" +_HOAAB = "HarnessOpenAiApiBase" +_HOAAF = "HarnessOpenAiApiFormat" +_HOAMC = "HarnessOpenAiModelConfig" +_HMC = "HarnessModelConfiguration" +_bMC = "bedrockModelConfig" +_oAMC = "openAiModelConfig" +_gMC = "geminiModelConfig" +_lLMC = "liteLlmModelConfig" +_HEN = "HarnessEndpointName" +_HASP = "HarnessAwsSkillPath" +_HASPa = "HarnessAwsSkillPaths" +_HSASS = "HarnessSkillAwsSkillsSource" +_HSGA = "HarnessSkillGitAuth" +_cAr = "credentialArn" +_use = "username" +_HSGU = "HarnessSkillGitUrl" +_HSGS = "HarnessSkillGitSource" +_url = "url" +_aut = "auth" +_HSP = "HarnessSkillPath" +_HSSU = "HarnessSkillS3Uri" +_HSSS = "HarnessSkillS3Source" +_HS = "HarnessSkill" +_g = "git" +_aSw = "awsSkills" +_HSa = "HarnessSkills" +_HSCB = "HarnessSystemContentBlock" +_HSPa = "HarnessSystemPrompt" +_HBA = "HarnessBrowserArn" +_HACBC = "HarnessAgentCoreBrowserConfig" +_bAr = "browserArn" +_HCIA = "HarnessCodeInterpreterArn" +_HACCIC = "HarnessAgentCoreCodeInterpreterConfig" +_cIA = "codeInterpreterArn" +_OACPK = "OAuthCustomParametersKey" +_OACPV = "OAuthCustomParametersValue" +_OACP = "OAuthCustomParameters" +_OADRU = "OAuthDefaultReturnUrl" +_OAGT = "OAuthGrantType" +_CC_ = "CLIENT_CREDENTIALS" +_AC_ = "AUTHORIZATION_CODE" +_TE_ = "TOKEN_EXCHANGE" +_OACPA = "OAuthCredentialProviderArn" +_OAS = "OAuthScope" +_OASu = "OAuthScopes" +_OACPu = "OAuthCredentialProvider" +_pA = "providerArn" +_gTr = "grantType" +_dRU = "defaultReturnUrl" +_HGOA = "HarnessGatewayOutboundAuth" +_aIw = "awsIam" +_non = "none" +_oa = "oauth" +_HACGC = "HarnessAgentCoreGatewayConfig" +_oA = "outboundAuth" +_HIFD = "HarnessInlineFunctionDescription" +_HIFC = "HarnessInlineFunctionConfig" +_iSn = "inputSchema" +_HHK = "HttpHeaderKey" +_HHV = "HttpHeaderValue" +_HHM = "HttpHeadersMap" +_HRMU = "HarnessRemoteMcpUrl" +_HRMC = "HarnessRemoteMcpConfig" +_he = "headers" +_HTC = "HarnessToolConfiguration" +_rMe = "remoteMcp" +_aCB = "agentCoreBrowser" +_aCG = "agentCoreGateway" +_iF = "inlineFunction" +_aCCI = "agentCoreCodeInterpreter" +_HTT = "HarnessToolType" +_RM = "REMOTE_MCP" +_rm = "remote_mcp" +_AB = "AGENTCORE_BROWSER" +_ab = "agentcore_browser" +_AG = "AGENTCORE_GATEWAY" +_ag = "agentcore_gateway" +_IF = "INLINE_FUNCTION" +_if = "inline_function" +_ACI = "AGENTCORE_CODE_INTERPRETER" +_aci = "agentcore_code_interpreter" +_HT = "HarnessTool" +_conf = "config" +_HTa = "HarnessTools" +_IHI = "InvokeHarnessInput" +_cIHR = "com.amazonaws.bedrockagentcore#InvokeHarnessRequest" +_hA = "harnessArn" +_mess = "messages" +_mo = "model" +_sk = "skills" +_aTl = "allowedTools" +_mIa = "maxIterations" +_tSi = "timeoutSeconds" +_HRCBD = "HarnessReasoningContentBlockDelta" +_HTRBD = "HarnessToolResultBlockDelta" +_HTRBDa = "HarnessToolResultBlocksDelta" +_HTRMBD = "HarnessToolResultMetadataBlockDelta" +_HTUBD = "HarnessToolUseBlockDelta" +_HCBD = "HarnessContentBlockDelta" +_tRM = "toolResultMetadata" +_HCBDE = "HarnessContentBlockDeltaEvent" +_cBI = "contentBlockIndex" +_del = "delta" +_HTRBS = "HarnessToolResultBlockStart" +_HTUBS = "HarnessToolUseBlockStart" +_HCBS = "HarnessContentBlockStart" +_HCBSE = "HarnessContentBlockStartEvent" +_star = "start" +_HCBSEa = "HarnessContentBlockStopEvent" +_HHD = "HarnessHookDecision" +_ALLOW = "ALLOW" +_al = "allow" +_DENY = "DENY" +_den = "deny" +_HHEI = "HarnessHookEventId" +_HHN = "HarnessHookName" +_HHET = "HarnessHookEventType" +_BTC = "BEFORE_TOOL_CALL" +_btc = "before_tool_call" +_ATC_ = "AFTER_TOOL_CALL" +_atc = "after_tool_call" +_BI = "BEFORE_INVOCATION" +_bi = "before_invocation" +_AI_ = "AFTER_INVOCATION" +_ai = "after_invocation" +_HHE = "HarnessHookEvent" +_hEI = "hookEventId" +_dec = "decision" +_HMSE = "HarnessMessageStartEvent" +_HSR = "HarnessStopReason" +_ET_ = "END_TURN" +_et = "end_turn" +_TR_ = "TOOL_RESULT" +_tr_ = "tool_result" +_MT_ = "MAX_TOKENS" +_mt = "max_tokens" +_SS_ = "STOP_SEQUENCE" +_ss = "stop_sequence" +_CF_ = "CONTENT_FILTERED" +_cf = "content_filtered" +_MMO = "MALFORMED_MODEL_OUTPUT" +_mmo = "malformed_model_output" +_MTU_ = "MALFORMED_TOOL_USE" +_mtu_ = "malformed_tool_use" +_INTERRUPTED = "INTERRUPTED" +_int = "interrupted" +_PT = "PARTIAL_TURN" +_pt = "partial_turn" +_MCWE = "MODEL_CONTEXT_WINDOW_EXCEEDED" +_mcwe = "model_context_window_exceeded" +_MIE = "MAX_ITERATIONS_EXCEEDED" +_mie = "max_iterations_exceeded" +_MOTE = "MAX_OUTPUT_TOKENS_EXCEEDED" +_mote = "max_output_tokens_exceeded" +_TE__ = "TIMEOUT_EXCEEDED" +_te_ = "timeout_exceeded" +_HS_ = "HOOK_STOPPED" +_hs = "hook_stopped" +_HMSEa = "HarnessMessageStopEvent" +_sR = "stopReason" +_HSM = "HarnessStreamMetrics" +_lM = "latencyMs" +_HTU = "HarnessTokenUsage" +_cRIT = "cacheReadInputTokens" +_cWIT = "cacheWriteInputTokens" +_HME = "HarnessMetadataEvent" +_usa = "usage" +_metr = "metrics" +_IHSO = "InvokeHarnessStreamOutput" +_mSe = "messageStart" +_cBS = "contentBlockStart" +_cBD = "contentBlockDelta" +_cBSo = "contentBlockStop" +_mSes = "messageStop" +_hE = "hookEvent" +_IHO = "InvokeHarnessOutput" +_cIHRo = "com.amazonaws.bedrockagentcore#InvokeHarnessResponse" +_IH = "InvokeHarness" +_MIe = "MemoryId" +_SSe = "SensitiveString" +_MC = "MemoryContent" +_MSIe = "MemoryStrategyId" +_MK = "MetadataKey" +_SLMV = "StringListMemberValue" +_SVL = "StringValueList" +_SVt = "StringValue" +_MRMV = "MemoryRecordMetadataValue" +_sLV = "stringListValue" +_nV = "numberValue" +_dTV = "dateTimeValue" +_MRMM = "MemoryRecordMetadataMap" +_Na = "Namespace" +_NL = "NamespacesList" +_RIe = "RequestIdentifier" +_MRCI = "MemoryRecordCreateInput" +_rIe = "requestIdentifier" +_na = "namespaces" +_tim = "timestamp" +_mSIe = "memoryStrategyId" +_MRCIL = "MemoryRecordsCreateInputList" +_BCMRI = "BatchCreateMemoryRecordsInput" +_mIe = "memoryId" +_rec = "records" +_MRI = "MemoryRecordId" +_MRS = "MemoryRecordStatus" +_SUCCEEDED = "SUCCEEDED" +_MRO = "MemoryRecordOutput" +_mRI = "memoryRecordId" +_MROL = "MemoryRecordsOutputList" +_BCMRO = "BatchCreateMemoryRecordsOutput" +_sRu = "successfulRecords" +_fR = "failedRecords" +_SE = "ServiceException" +_TEh = "ThrottledException" +_BCMR = "BatchCreateMemoryRecords" +_MRDI = "MemoryRecordDeleteInput" +_nam = "namespace" +_MRDIL = "MemoryRecordsDeleteInputList" +_BDMRI = "BatchDeleteMemoryRecordsInput" +_BDMRO = "BatchDeleteMemoryRecordsOutput" +_BDMR = "BatchDeleteMemoryRecords" +_MRUI = "MemoryRecordUpdateInput" +_sNo = "sourceNamespaces" +_MRUIL = "MemoryRecordsUpdateInputList" +_BUMRI = "BatchUpdateMemoryRecordsInput" +_BUMRO = "BatchUpdateMemoryRecordsOutput" +_BUMR = "BatchUpdateMemoryRecords" +_BN = "BranchName" +_EIve = "EventId" +_Br = "Branch" +_rEI = "rootEventId" +_NVN = "NamespaceVariableName" +_NVV = "NamespaceVariableValue" +_NVM = "NamespaceVariablesMap" +_ECx = "ExtractionConfig" +_nVa = "namespaceVariables" +_EMx = "ExtractionMode" +_SKIP = "SKIP" +_MV = "MetadataValue" +_MMe = "MetadataMap" +_MD = "MemoryDocument" +_Con = "Content" +_R = "Role" +_TOOL = "TOOL" +_Conv = "Conversational" +_MJDC = "MemoryJsonDataContent" +_MJD = "MemoryJsonData" +_PTa = "PayloadType" +_conv = "conversational" +_PTL = "PayloadTypeList" +_CEI = "CreateEventInput" +_eTve = "eventTimestamp" +_br = "branch" +_eMx = "extractionMode" +_eCxt = "extractionConfig" +_Eve = "Event" +_eIve = "eventId" +_CEO = "CreateEventOutput" +_eve = "event" +_IIE = "InvalidInputException" +_CEr = "CreateEvent" +_DEI = "DeleteEventInput" +_DEO = "DeleteEventOutput" +_DE = "DeleteEvent" +_DMRI = "DeleteMemoryRecordInput" +_DMRO = "DeleteMemoryRecordOutput" +_DMR = "DeleteMemoryRecord" +_GEI = "GetEventInput" +_GEO = "GetEventOutput" +_GE = "GetEvent" +_GMRI = "GetMemoryRecordInput" +_MRe = "MemoryRecord" +_GMRO = "GetMemoryRecordOutput" +_mRe = "memoryRecord" +_GMR = "GetMemoryRecord" +_IPT = "IngestPayloadType" +_IPL = "IngestPayloadList" +_IMC = "InlineMemoryContent" +_CSo = "ContentSource" +_IDI = "IngestDataInput" +_so = "source" +_cTo = "contentTimestamp" +_IDO = "IngestDataOutput" +_ID = "IngestData" +_PTag = "PaginationToken" +_LAI = "ListActorsInput" +_LAO = "ListActorsOutput" +_aSc = "actorSummaries" +_LA = "ListActors" +_BF = "BranchFilter" +_iPB = "includeParentBranches" +_LE = "LeftExpression" +_mK = "metadataKey" +_OT = "OperatorType" +_ET__ = "EQUALS_TO" +_EXISTS = "EXISTS" +_NE_ = "NOT_EXISTS" +_REi = "RightExpression" +_mV = "metadataValue" +_EMFE = "EventMetadataFilterExpression" +_le = "left" +_ri = "right" +_EMFL = "EventMetadataFilterList" +_FI = "FilterInput" +_eMve = "eventMetadata" +_LEI = "ListEventsInput" +_iP = "includePayloads" +_fi = "filter" +_ELv = "EventList" +_LEO = "ListEventsOutput" +_even = "events" +_LEi = "ListEvents" +_EJS = "ExtractionJobStatus" +_EJFI = "ExtractionJobFilterInput" +_sIt = "strategyId" +_LMEJI = "ListMemoryExtractionJobsInput" +_MMes = "MessageMetadata" +_mIes = "messageIndex" +_ML = "MessagesList" +_EJM = "ExtractionJobMessages" +_mL = "messagesList" +_EJMx = "ExtractionJobMetadata" +_jID = "jobID" +_fRa = "failureReason" +_EJML = "ExtractionJobMetadataList" +_LMEJO = "ListMemoryExtractionJobsOutput" +_jo = "jobs" +_LMEJ = "ListMemoryExtractionJobs" +_MRLE = "MemoryRecordLeftExpression" +_MROT = "MemoryRecordOperatorType" +_BEFORE = "BEFORE" +_AFTER = "AFTER" +_GTOE_ = "GREATER_THAN_OR_EQUALS" +_LTOE_ = "LESS_THAN_OR_EQUALS" +_MRRE = "MemoryRecordRightExpression" +_MMFE = "MemoryMetadataFilterExpression" +_MMFL = "MemoryMetadataFilterList" +_LMRI = "ListMemoryRecordsInput" +_nP = "namespacePath" +_mF = "metadataFilters" +_MRSe = "MemoryRecordSummary" +_scor = "score" +_MRSL = "MemoryRecordSummaryList" +_LMRO = "ListMemoryRecordsOutput" +_mRS = "memoryRecordSummaries" +_LMR = "ListMemoryRecords" +_EFC = "EventFilterCondition" +_HE = "HAS_EVENTS" +_SFe = "SessionFilter" +_eF = "eventFilter" +_LSI = "ListSessionsInput" +_SSes = "SessionSummary" +_SSL = "SessionSummaryList" +_LSO = "ListSessionsOutput" +_sSess = "sessionSummaries" +_LS = "ListSessions" +_SCe = "SearchCriteria" +_sQe = "searchQuery" +_RMRI = "RetrieveMemoryRecordsInput" +_sCe = "searchCriteria" +_RMRO = "RetrieveMemoryRecordsOutput" +_RMR = "RetrieveMemoryRecords" +_EJ = "ExtractionJob" +_jI = "jobId" +_SMEJI = "StartMemoryExtractionJobInput" +_eJ = "extractionJob" +_SMEJO = "StartMemoryExtractionJobOutput" +_SMEJ = "StartMemoryExtractionJob" +_PAN = "PaymentAgentName" +_PCI = "PaymentConnectorId" +_JKI = "JwtKeyId" +_LADJ = "LinkedAccountDeveloperJwt" +_ki = "kid" +_sub = "sub" +_Em = "Email" +_LAE = "LinkedAccountEmail" +_eAm = "emailAddress" +_OAA = "OAuth2Authentication" +_LAOA = "LinkedAccountOAuth2" +_go = "google" +_ap = "apple" +_tel = "telegram" +_gi = "github" +_PN = "PhoneNumber" +_LAS = "LinkedAccountSms" +_pN = "phoneNumber" +_LAi = "LinkedAccount" +_em = "email" +_sms = "sms" +_dJ = "developerJwt" +_oAu = "oAuth2" +_LAL = "LinkedAccountList" +_CWN = "CryptoWalletNetwork" +_ETHEREUM = "ETHEREUM" +_SOLANA = "SOLANA" +_ECW = "EmbeddedCryptoWallet" +_ne = "network" +_lA = "linkedAccounts" +_wA = "walletAddress" +_rU = "redirectUrl" +_PID = "PaymentInstrumentDetails" +_eCW = "embeddedCryptoWallet" +_PIT = "PaymentInstrumentType" +_ECW_ = "EMBEDDED_CRYPTO_WALLET" +_PMA = "PaymentManagerArn" +_UIs = "UserId" +_CPII = "CreatePaymentInstrumentInput" +_cCPIR = "com.amazonaws.bedrockagentcore#CreatePaymentInstrumentRequest" +_XABAPUI = "X-Amzn-Bedrock-AgentCore-Payments-User-Id" +_aN = "agentName" +_XABAPAN = "X-Amzn-Bedrock-AgentCore-Payments-Agent-Name" +_pMA = "paymentManagerArn" +_pCI = "paymentConnectorId" +_pIT = "paymentInstrumentType" +_pID = "paymentInstrumentDetails" +_PII = "PaymentInstrumentId" +_PIS = "PaymentInstrumentStatus" +_INITIATED = "INITIATED" +_BLOCKED = "BLOCKED" +_PI = "PaymentInstrument" +_pII = "paymentInstrumentId" +_CPIO = "CreatePaymentInstrumentOutput" +_cCPIRo = "com.amazonaws.bedrockagentcore#CreatePaymentInstrumentResponse" +_pIa = "paymentInstrument" +_SRE = "SubscriptionRequiredException" +_sUu = "subscriptionUrl" +_pNr = "productName" +_CPIr = "CreatePaymentInstrument" +_DPII = "DeletePaymentInstrumentInput" +_cDPIR = "com.amazonaws.bedrockagentcore#DeletePaymentInstrumentRequest" +_DPIO = "DeletePaymentInstrumentOutput" +_cDPIRo = "com.amazonaws.bedrockagentcore#DeletePaymentInstrumentResponse" +_DPI = "DeletePaymentInstrument" +_GPII = "GetPaymentInstrumentInput" +_cGPIR = "com.amazonaws.bedrockagentcore#GetPaymentInstrumentRequest" +_GPIO = "GetPaymentInstrumentOutput" +_cGPIRo = "com.amazonaws.bedrockagentcore#GetPaymentInstrumentResponse" +_GPI = "GetPaymentInstrument" +_BCI = "BlockchainChainId" +_BASE = "BASE" +_BS = "BASE_SEPOLIA" +_SD_ = "SOLANA_DEVNET" +_IBT = "InstrumentBalanceToken" +_USDC = "USDC" +_GPIBI = "GetPaymentInstrumentBalanceInput" +_cGPIBR = "com.amazonaws.bedrockagentcore#GetPaymentInstrumentBalanceRequest" +_cha = "chain" +_tok = "token" +_TB = "TokenBalance" +_am = "amount" +_deci = "decimals" +_GPIBO = "GetPaymentInstrumentBalanceOutput" +_cGPIBRo = "com.amazonaws.bedrockagentcore#GetPaymentInstrumentBalanceResponse" +_tB = "tokenBalance" +_GPIB = "GetPaymentInstrumentBalance" +_LPII = "ListPaymentInstrumentsInput" +_cLPIR = "com.amazonaws.bedrockagentcore#ListPaymentInstrumentsRequest" +_PISa = "PaymentInstrumentSummary" +_PISL = "PaymentInstrumentSummaryList" +_LPIO = "ListPaymentInstrumentsOutput" +_cLPIRo = "com.amazonaws.bedrockagentcore#ListPaymentInstrumentsResponse" +_pIay = "paymentInstruments" +_LPI = "ListPaymentInstruments" +_Cu = "Currency" +_USD = "USD" +_Am = "Amount" +_cu = "currency" +_SLe = "SessionLimits" +_mSA = "maxSpendAmount" +_CPSI = "CreatePaymentSessionInput" +_cCPSR = "com.amazonaws.bedrockagentcore#CreatePaymentSessionRequest" +_li = "limits" +_eTIM = "expiryTimeInMinutes" +_AL = "AvailableLimits" +_aSA = "availableSpendAmount" +_PSI = "PaymentSessionId" +_PS = "PaymentSession" +_pSI = "paymentSessionId" +_aL = "availableLimits" +_CPSO = "CreatePaymentSessionOutput" +_cCPSRo = "com.amazonaws.bedrockagentcore#CreatePaymentSessionResponse" +_pS = "paymentSession" +_CPS = "CreatePaymentSession" +_DPSI = "DeletePaymentSessionInput" +_cDPSR = "com.amazonaws.bedrockagentcore#DeletePaymentSessionRequest" +_PSS = "PaymentSessionStatus" +_EXPIRED = "EXPIRED" +_DPSO = "DeletePaymentSessionOutput" +_cDPSRo = "com.amazonaws.bedrockagentcore#DeletePaymentSessionResponse" +_DPS = "DeletePaymentSession" +_GPSI = "GetPaymentSessionInput" +_cGPSR = "com.amazonaws.bedrockagentcore#GetPaymentSessionRequest" +_GPSO = "GetPaymentSessionOutput" +_cGPSRo = "com.amazonaws.bedrockagentcore#GetPaymentSessionResponse" +_GPS = "GetPaymentSession" +_LPSI = "ListPaymentSessionsInput" +_cLPSR = "com.amazonaws.bedrockagentcore#ListPaymentSessionsRequest" +_PSSa = "PaymentSessionSummary" +_PSSL = "PaymentSessionSummaryList" +_LPSO = "ListPaymentSessionsOutput" +_cLPSRo = "com.amazonaws.bedrockagentcore#ListPaymentSessionsResponse" +_pSa = "paymentSessions" +_LPS = "ListPaymentSessions" +_PD = "PaymentDocument" +_PAL = "Permit2AllowanceLimit" +_CXPI = "CryptoX402PaymentInput" +_ve = "version" +_pAL = "permit2AllowanceLimit" +_Ve = "Version" +_WAH = "WwwAuthenticateHeader" +_WAHL = "WwwAuthenticateHeaderList" +_MPI = "MppPaymentInput" +_wAH = "wwwAuthenticateHeaders" +_bPGF = "buyerPaysGasFees" +_PIa = "PaymentInput" +_cX = "cryptoX402" +_mp = "mpp" +_PTay = "PaymentType" +_CX = "CRYPTO_X402" +_MPP = "MPP" +_PPI = "ProcessPaymentInput" +_cPPR = "com.amazonaws.bedrockagentcore#ProcessPaymentRequest" +_pT = "paymentType" +_pIaym = "paymentInput" +_CXPO = "CryptoX402PaymentOutput" +_MPC = "MppPaymentCredential" +_MPO = "MppPaymentOutput" +_sPI = "selectedPaymentId" +_pCa = "paymentCredential" +_PO = "PaymentOutput" +_PPIr = "ProcessPaymentId" +_PSa = "PaymentStatus" +_PG = "PROOF_GENERATED" +_PPO = "ProcessPaymentOutput" +_cPPRo = "com.amazonaws.bedrockagentcore#ProcessPaymentResponse" +_pPI = "processPaymentId" +_pO = "paymentOutput" +_PPr = "ProcessPayment" +_MFE = "MetadataFilterExpression" +_RIeg = "RegistryIdentifier" +_RIL = "RegistryIdList" +_SRRI = "SearchRegistryRecordsInput" +_cSRRR = "com.amazonaws.bedrockagentcore#SearchRegistryRecordsRequest" +_rIeg = "registryIds" +_Des = "Description" +_CD = "CustomDescriptor" +_SDe = "ServerDefinition" +_TD = "ToolsDefinition" +_pVr = "protocolVersion" +_MDc = "McpDescriptor" +_Desc = "Descriptors" +_mc = "mcp" +_aa = "a2a" +_cus = "custom" +_aSg = "agentSkills" +_DTe = "DescriptorType" +_MCP = "MCP" +_AA = "A2A" +_CUSTOM = "CUSTOM" +_AS_ = "AGENT_SKILLS" +_RRN = "RegistryRecordName" +_RRA = "RegistryRecordArn" +_RRI = "RegistryRecordId" +_RAeg = "RegistryArn" +_RRS = "RegistryRecordStatus" +_DRAFT = "DRAFT" +_PA = "PENDING_APPROVAL" +_APPROVED = "APPROVED" +_REJECTED = "REJECTED" +_DEPRECATED = "DEPRECATED" +_RRV = "RegistryRecordVersion" +_RRSe = "RegistryRecordSummary" +_rAeg = "registryArn" +_rAec = "recordArn" +_rIec = "recordId" +_dT = "descriptorType" +_des = "descriptors" +_RRSL = "RegistryRecordSummaryList" +_SRRO = "SearchRegistryRecordsOutput" +_cSRRRo = "com.amazonaws.bedrockagentcore#SearchRegistryRecordsResponse" +_rRe = "registryRecords" +_SRR = "SearchRegistryRecords" +_ABAC = "AmazonBedrockAgentCore" +_aw = "aws.auth#sigv4" +_sB = "smithy.rules#endpointBdd" +_aws = "aws.api#service" +_aJ = "aws.protocols#restJson1" + +INLINE_CONTENT: StaticSchema = (3, n0, _IC, 0) + +SCHEMA_VERSION: StaticSchema = (3, n0, _SV, 0) + +AGENT_CARD_DEFINITION: StaticSchema = ( + 18, + n0, + _ACD, + 0, + (_sV, _iC), + ((SCHEMA_VERSION, 0), (INLINE_CONTENT, 0)), +) + +A2A_DESCRIPTOR: StaticSchema = (18, n0, _AD, 0, (_aC,), ((AGENT_CARD_DEFINITION, 1),)) + +AB_TEST_ARN: StaticSchema = (3, n0, _ABTA, 0) + +AB_TEST_DESCRIPTION: StaticSchema = (3, n0, _ABTD, 0) + +ONLINE_EVALUATION_CONFIG_ARN: StaticSchema = (3, n0, _OECA, 0) + +VARIANT_NAME: StaticSchema = (3, n0, _VN, 0) + +PER_VARIANT_ONLINE_EVALUATION_CONFIG: StaticSchema = ( + 18, + n0, + _PVOEC, + 0, + (_n, _oECA), + ((VARIANT_NAME, 1), (ONLINE_EVALUATION_CONFIG_ARN, 1)), +) + +PER_VARIANT_ONLINE_EVALUATION_CONFIG_LIST: StaticSchema = ( + 16, + n0, + _PVOECL, + 0, + (_m,), + ((PER_VARIANT_ONLINE_EVALUATION_CONFIG, 0),), +) + +AB_TEST_EVALUATION_CONFIG: StaticSchema = ( + 19, + n0, + _ABTEC, + 0, + (_oECA, _pVOEC), + ((ONLINE_EVALUATION_CONFIG_ARN, 0), (PER_VARIANT_ONLINE_EVALUATION_CONFIG_LIST, 0)), +) + +AB_TEST_EXECUTION_STATUS: StaticSchema = ( + 14, + n0, + _ABTES, + 0, + (_PAUSED, _RUNNING, _STOPPED, _NS), + ( + (-1, {_sVm: _PAUSED}), + (-1, {_sVm: _RUNNING}), + (-1, {_sVm: _STOPPED}), + (-1, {_sVm: _NS}), + ), ) -from smithy_core.schemas import Schema -from smithy_core.shapes import ShapeID, ShapeType -from smithy_core.traits import Trait - -INLINE_CONTENT = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#InlineContent"), - shape_type=ShapeType.STRING, +AB_TEST_ID: StaticSchema = (3, n0, _ABTI, 0) + +AB_TEST_NAME: StaticSchema = (3, n0, _ABTN, 0) + +CONTROL_STATS: StaticSchema = ( + 18, + n0, + _CS, + 0, + (_vN, _sS, _me), + ((3, 1), (7, 1), (10, 1)), +) + +CONFIDENCE_INTERVAL: StaticSchema = (18, n0, _CI, 0, (_l, _u), ((10, 0), (10, 0))) + +VARIANT_RESULT: StaticSchema = ( + 18, + n0, + _VR, + 0, + (_vN, _sS, _me, _aCb, _pC, _pV, _cI, _iS), + ( + (3, 1), + (7, 1), + (10, 1), + (10, 0), + (10, 0), + (10, 0), + (CONFIDENCE_INTERVAL, 0), + (2, 1), + ), ) -SCHEMA_VERSION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#SchemaVersion"), - shape_type=ShapeType.STRING, +VARIANT_RESULT_LIST: StaticSchema = (16, n0, _VRL, 0, (_m,), ((VARIANT_RESULT, 0),)) + +EVALUATOR_METRIC: StaticSchema = ( + 18, + n0, + _EM, + 0, + (_eA, _cS, _vR), + ((3, 1), (CONTROL_STATS, 1), (VARIANT_RESULT_LIST, 1)), +) + +EVALUATOR_METRIC_LIST: StaticSchema = (16, n0, _EML, 0, (_m,), ((EVALUATOR_METRIC, 0),)) + +AB_TEST_RESULTS: StaticSchema = ( + 18, + n0, + _ABTR, + 0, + (_aT, _eM), + ((4, 0), (EVALUATOR_METRIC_LIST, 1)), +) + +AB_TEST_STATUS: StaticSchema = ( + 14, + n0, + _ABTS, + 0, + (_CREATING, _ACTIVE, _CF, _UPDATING, _UF, _DELETING, _DF, _FAILED), + ( + (-1, {_sVm: _CREATING}), + (-1, {_sVm: _ACTIVE}), + (-1, {_sVm: _CF}), + (-1, {_sVm: _UPDATING}), + (-1, {_sVm: _UF}), + (-1, {_sVm: _DELETING}), + (-1, {_sVm: _DF}), + (-1, {_sVm: _FAILED}), + ), ) -AGENT_CARD_DEFINITION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#AgentCardDefinition"), - members={ - "schemaVersion": {"target": SCHEMA_VERSION}, - "inlineContent": {"target": INLINE_CONTENT}, - }, +GATEWAY_ARN: StaticSchema = (3, n0, _GA, 0) + +AB_TEST_SUMMARY: StaticSchema = ( + 18, + n0, + _ABTSe, + 0, + (_aTI, _aTA, _n, _st, _eS, _d, _gA, _cA, _uA), + ( + (AB_TEST_ID, 1), + (AB_TEST_ARN, 1), + (AB_TEST_NAME, 1), + (AB_TEST_STATUS, 1), + (AB_TEST_EXECUTION_STATUS, 1), + (AB_TEST_DESCRIPTION, 0), + (GATEWAY_ARN, 0), + (4, 1), + (4, 1), + ), ) -A2A_DESCRIPTOR = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#A2aDescriptor"), - members={ - "agentCard": { - "target": AGENT_CARD_DEFINITION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +AB_TEST_SUMMARY_LIST: StaticSchema = (16, n0, _ABTSL, 0, (_m,), ((AB_TEST_SUMMARY, 0),)) + +NON_BLANK_STRING: StaticSchema = (3, n0, _NBS, 0) + +ACCESS_DENIED_EXCEPTION: StaticSchema = ( + 18, + n0, + _ADE, + {_sm: _c, _sE: 403}, + (_mes,), + ((NON_BLANK_STRING, 0),), +) + +ACCESS_TOKEN_TYPE: StaticSchema = (3, n0, _ATT, 4) + +ACTOR_ID: StaticSchema = (3, n0, _AI, 0) + +ACTOR_SUMMARY: StaticSchema = (18, n0, _AS, 0, (_aI,), ((ACTOR_ID, 1),)) + +ACTOR_SUMMARY_LIST: StaticSchema = (16, n0, _ASL, 0, (_m,), ((ACTOR_SUMMARY, 0),)) + +INSIGHTS_FAILURE_CATEGORY: StaticSchema = ( + 14, + n0, + _IFC, + 0, + ( + _EEA, + _EERNF, + _EESE, + _EERL, + _EEF, + _EET, + _EERE, + _EEE, + _EETS, + _TINC, + _TIPI, + _IATS, + _IAPIR, + _IAC, + _IAIIR, + _CHF, + _HC, + _HM, + _HU, + _HH, + _HP, + _HFTO, + _RBT, + _RBI, + _RBS, + _ORM, + _OGD, + _OPT, + _OUT, + _LON, + _CMTD, + _CECO, + _CDI, + _OTHER, + ), + ( + (-1, {_sVm: _eeca}), + (-1, {_sVm: _eecrnf}), + (-1, {_sVm: _eecse}), + (-1, {_sVm: _eecrl}), + (-1, {_sVm: _eecf}), + (-1, {_sVm: _eect}), + (-1, {_sVm: _eecre}), + (-1, {_sVm: _eece}), + (-1, {_sVm: _eects}), + (-1, {_sVm: _ticnc}), + (-1, {_sVm: _ticpi}), + (-1, {_sVm: _iacts}), + (-1, {_sVm: _iacpir}), + (-1, {_sVm: _iacc}), + (-1, {_sVm: _iaciir}), + (-1, {_sVm: _checchf}), + (-1, {_sVm: _hchc}), + (-1, {_sVm: _hchm}), + (-1, {_sVm: _hchu}), + (-1, {_sVm: _hchh}), + (-1, {_sVm: _hchp}), + (-1, {_sVm: _hcfto}), + (-1, {_sVm: _rbcrt}), + (-1, {_sVm: _rbcri}), + (-1, {_sVm: _rbcsr}), + (-1, {_sVm: _orecrm}), + (-1, {_sVm: _orecgd}), + (-1, {_sVm: _orecpt}), + (-1, {_sVm: _orecut}), + (-1, {_sVm: _locn}), + (-1, {_sVm: _cmctd}), + (-1, {_sVm: _cucsftceco}), + (-1, {_sVm: _cucsftcdi}), + (-1, {_sVm: _o}), + ), ) -AB_TEST_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#ABTestArn"), shape_type=ShapeType.STRING +INSIGHTS_FAILURE_SIGNAL: StaticSchema = ( + 18, + n0, + _IFS, + 0, + (_ca, _e, _co), + ((INSIGHTS_FAILURE_CATEGORY, 1), (3, 1), (10, 1)), ) -AB_TEST_DESCRIPTION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#ABTestDescription"), - shape_type=ShapeType.STRING, +INSIGHTS_FAILURE_SIGNAL_LIST: StaticSchema = ( + 16, + n0, + _IFSL, + 0, + (_m,), + ((INSIGHTS_FAILURE_SIGNAL, 0),), ) -ONLINE_EVALUATION_CONFIG_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#OnlineEvaluationConfigArn"), - shape_type=ShapeType.STRING, +FAILURE_SPAN_DETAIL: StaticSchema = ( + 18, + n0, + _FSD, + 0, + (_sI, _tI, _si), + ((3, 1), (3, 1), (INSIGHTS_FAILURE_SIGNAL_LIST, 1)), ) -VARIANT_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#VariantName"), - shape_type=ShapeType.STRING, +FAILURE_SPAN_DETAIL_LIST: StaticSchema = ( + 16, + n0, + _FSDL, + 0, + (_m,), + ((FAILURE_SPAN_DETAIL, 0),), ) -PER_VARIANT_ONLINE_EVALUATION_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#PerVariantOnlineEvaluationConfig"), - members={ - "name": { - "target": VARIANT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "onlineEvaluationConfigArn": { - "target": ONLINE_EVALUATION_CONFIG_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +AFFECTED_SESSION: StaticSchema = ( + 18, + n0, + _ASf, + 0, + (_sIe, _ex, _fT, _r, _fS), + ((3, 1), (3, 1), (3, 1), (3, 1), (FAILURE_SPAN_DETAIL_LIST, 1)), ) -PER_VARIANT_ONLINE_EVALUATION_CONFIG_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#PerVariantOnlineEvaluationConfigList"), - shape_type=ShapeType.LIST, - members={"member": {"target": PER_VARIANT_ONLINE_EVALUATION_CONFIG}}, +AFFECTED_SESSION_LIST: StaticSchema = ( + 16, + n0, + _ASLf, + 0, + (_m,), + ((AFFECTED_SESSION, 0),), ) - -AB_TEST_EVALUATION_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ABTestEvaluationConfig"), - shape_type=ShapeType.UNION, - members={ - "onlineEvaluationConfigArn": {"target": ONLINE_EVALUATION_CONFIG_ARN}, - "perVariantOnlineEvaluationConfig": { - "target": PER_VARIANT_ONLINE_EVALUATION_CONFIG_LIST - }, - }, + +AGENT_CARD: StaticSchema = (13, n0, _AC, 0) + +SESSION_TYPE: StaticSchema = (3, n0, _ST, 0) + +GET_AGENT_CARD_INPUT: StaticSchema = ( + 18, + n0, + _GACI, + {_sSI: _cGACR, _smit: None}, + (_rSI, _aRA, _q), + ((SESSION_TYPE, {_sH: _XABARSI, _sT: None}), (3, 9), (3, {_sQ: _q})), +) + +SESSION_ID: StaticSchema = (3, n0, _SI, 0) + +HTTP_RESPONSE_CODE: StaticSchema = (7, n0, _HRC, 0) + +GET_AGENT_CARD_OUTPUT: StaticSchema = ( + 18, + n0, + _GACO, + {_sSI: _cGACRo, _smith: None}, + (_rSI, _aC, _sC), + ((SESSION_ID, {_sH: _XABARSI}), (AGENT_CARD, 17), (HTTP_RESPONSE_CODE, 128)), +) + +INTERNAL_SERVER_EXCEPTION: StaticSchema = ( + 18, + n0, + _ISE, + {_sm: _se, _sE: 500}, + (_mes,), + ((NON_BLANK_STRING, 0),), +) + +RESOURCE_NOT_FOUND_EXCEPTION: StaticSchema = ( + 18, + n0, + _RNFE, + {_sm: _c, _sE: 404}, + (_mes,), + ((NON_BLANK_STRING, 0),), +) + +RETRYABLE_CONFLICT_EXCEPTION: StaticSchema = ( + 18, + n0, + _RCE, + {_sm: _c, _sE: 409}, + (_mes,), + ((3, 1),), +) + +RUNTIME_CLIENT_ERROR: StaticSchema = ( + 18, + n0, + _RCEu, + {_sm: _c, _sE: 424}, + (_mes,), + ((NON_BLANK_STRING, 0),), +) + +SERVICE_QUOTA_EXCEEDED_EXCEPTION: StaticSchema = ( + 18, + n0, + _SQEE, + {_sm: _c, _sE: 402}, + (_mes,), + ((NON_BLANK_STRING, 0),), +) + +THROTTLING_EXCEPTION: StaticSchema = ( + 18, + n0, + _TE, + {_sm: _c, _sE: 429}, + (_mes,), + ((NON_BLANK_STRING, 0),), +) + +VALIDATION_EXCEPTION_FIELD: StaticSchema = ( + 18, + n0, + _VEF, + 0, + (_n, _mes), + ((3, 1), (3, 1)), +) + +VALIDATION_EXCEPTION_FIELD_LIST: StaticSchema = ( + 16, + n0, + _VEFL, + 0, + (_m,), + ((VALIDATION_EXCEPTION_FIELD, 0),), +) + +VALIDATION_EXCEPTION_REASON: StaticSchema = ( + 14, + n0, + _VER, + 0, + (_CP, _FVF, _IPME, _REIOS, _RC), + ( + (-1, {_sVm: _CPa}), + (-1, {_sVm: _FVFi}), + (-1, {_sVm: _IPMEd}), + (-1, {_sVm: _EIOS}), + (-1, {_sVm: _RCe}), + ), ) -AB_TEST_EXECUTION_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ABTestExecutionStatus"), - shape_type=ShapeType.ENUM, - members={ - "PAUSED": {"target": UNIT}, - "RUNNING": {"target": UNIT}, - "STOPPED": {"target": UNIT}, - "NOT_STARTED": {"target": UNIT}, - }, +VALIDATION_EXCEPTION: StaticSchema = ( + 18, + n0, + _VE, + {_sm: _c, _sE: 400}, + (_mes, _re, _fL), + ((3, 1), (VALIDATION_EXCEPTION_REASON, 1), (VALIDATION_EXCEPTION_FIELD_LIST, 0)), +) + +GET_AGENT_CARD: StaticOperationSchema = ( + 23, + n0, + _GAC, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/runtimes/{agentRuntimeArn}/invocations/.well-known/agent-card.json", + "code": 200, + } + ) + }, + GET_AGENT_CARD_INPUT, + GET_AGENT_CARD_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + RETRYABLE_CONFLICT_EXCEPTION, + RUNTIME_CLIENT_ERROR, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AB_TEST_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#ABTestId"), shape_type=ShapeType.STRING +MIME_TYPE: StaticSchema = (3, n0, _MT, 0) + +STRING_TYPE: StaticSchema = (3, n0, _STt, 0) + +BODY: StaticSchema = (1, n0, _B, 4) + +INVOKE_AGENT_RUNTIME_INPUT: StaticSchema = ( + 18, + n0, + _IARI, + {_sSI: _cIARR, _smit: None}, + (_cT, _a, _mSI, _rSI, _mPV, _mM, _mN, _rUI, _tI, _tP, _tS, _b, _aRA, _q, _aIc, _p), + ( + (MIME_TYPE, {_sH: _CT}), + (MIME_TYPE, {_sH: _A}), + (STRING_TYPE, {_sH: _MSI}), + (SESSION_TYPE, {_sH: _XABARSI, _sT: None}), + (STRING_TYPE, {_sH: _MPV}), + (STRING_TYPE, {_sH: _MM}), + (STRING_TYPE, {_sH: _MN}), + (STRING_TYPE, {_sH: _XABARUI}), + (3, {_sH: _XATI}), + (3, {_sH: _t}), + (3, {_sH: _tr}), + (3, {_sH: _b}), + (3, 9), + (3, {_sQ: _q}), + (3, {_sQ: _aIc}), + (BODY, 17), + ), ) -AB_TEST_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#ABTestName"), shape_type=ShapeType.STRING +RESPONSE_STREAM: StaticSchema = (1, n0, _RS, {_smithya: None, _smi: None}) + +INVOKE_AGENT_RUNTIME_OUTPUT: StaticSchema = ( + 18, + n0, + _IARO, + {_sSI: _cIARRo, _smith: None}, + (_rSI, _mSI, _mPV, _tI, _tP, _tS, _b, _cT, _res, _sC), + ( + (SESSION_ID, {_sH: _XABARSI}), + (SESSION_ID, {_sH: _MSI}), + (3, {_sH: _MPV}), + (3, {_sH: _XATI}), + (3, {_sH: _t}), + (3, {_sH: _tr}), + (3, {_sH: _b}), + (3, {_sH: _CT, _s: None}), + (RESPONSE_STREAM, {_smithyap: _v, _sP: None}), + (HTTP_RESPONSE_CODE, 128), + ), ) -CONTROL_STATS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ControlStats"), - members={ - "variantName": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "sampleSize": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "mean": { - "target": DOUBLE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +INVOKE_AGENT_RUNTIME: StaticOperationSchema = ( + 23, + n0, + _IAR, + { + _smithy: MappingProxyType( + { + "method": "POST", + "uri": "/runtimes/{agentRuntimeArn}/invocations", + "code": 200, + } + ) + }, + INVOKE_AGENT_RUNTIME_INPUT, + INVOKE_AGENT_RUNTIME_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + RETRYABLE_CONFLICT_EXCEPTION, + RUNTIME_CLIENT_ERROR, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CONFIDENCE_INTERVAL = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ConfidenceInterval"), - members={"lower": {"target": DOUBLE}, "upper": {"target": DOUBLE}}, -) - -VARIANT_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#VariantResult"), - members={ - "variantName": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "sampleSize": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "mean": { - "target": DOUBLE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "absoluteChange": {"target": DOUBLE}, - "percentChange": {"target": DOUBLE}, - "pValue": {"target": DOUBLE}, - "confidenceInterval": {"target": CONFIDENCE_INTERVAL}, - "isSignificant": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +INVOKE_AGENT_RUNTIME_COMMAND_REQUEST_BODY: StaticSchema = ( + 18, + n0, + _IARCRB, + 0, + (_com, _ti), + ((3, 1), (7, 0)), +) + +INVOKE_AGENT_RUNTIME_COMMAND_INPUT: StaticSchema = ( + 18, + n0, + _IARCI, + {_sSI: _cIARCR, _smit: None}, + (_cT, _a, _rSI, _tI, _tP, _tS, _b, _aRA, _q, _aIc, _bo), + ( + (MIME_TYPE, {_sH: _CT}), + (MIME_TYPE, {_sH: _A}), + (SESSION_TYPE, {_sH: _XABARSI, _sT: None}), + (3, {_sH: _XATI}), + (3, {_sH: _t}), + (3, {_sH: _tr}), + (3, {_sH: _b}), + (3, 9), + (3, {_sQ: _q}), + (3, {_sQ: _aIc}), + (INVOKE_AGENT_RUNTIME_COMMAND_REQUEST_BODY, 17), + ), ) -VARIANT_RESULT_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#VariantResultList"), - shape_type=ShapeType.LIST, - members={"member": {"target": VARIANT_RESULT}}, -) - -EVALUATOR_METRIC = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#EvaluatorMetric"), - members={ - "evaluatorArn": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "controlStats": { - "target": CONTROL_STATS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "variantResults": { - "target": VARIANT_RESULT_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +CONTENT_DELTA_EVENT: StaticSchema = (18, n0, _CDE, 0, (_std, _stde), ((3, 0), (3, 0))) + +CONTENT_START_EVENT: StaticSchema = (18, n0, _CSE, 0) + +COMMAND_EXECUTION_STATUS: StaticSchema = ( + 14, + n0, + _CES, + 0, + (_COMPLETED, _TO), + ((-1, {_sVm: _COMPLETED}), (-1, {_sVm: _TO})), +) + +CONTENT_STOP_EVENT: StaticSchema = ( + 18, + n0, + _CSEo, + 0, + (_eC, _st), + ((7, 1), (COMMAND_EXECUTION_STATUS, 1)), +) + +RESPONSE_CHUNK: StaticSchema = ( + 18, + n0, + _RCes, + 0, + (_cSo, _cD, _cSon), + ((CONTENT_START_EVENT, 0), (CONTENT_DELTA_EVENT, 0), (CONTENT_STOP_EVENT, 0)), +) + +INVOKE_AGENT_RUNTIME_COMMAND_STREAM_OUTPUT: StaticSchema = ( + 19, + n0, + _IARCSO, + {_smithya: None}, + (_ch, _aDE, _iSE, _rNFE, _sQEE, _tE, _vE, _rCE), + ( + (RESPONSE_CHUNK, 0), + (ACCESS_DENIED_EXCEPTION, 0), + (INTERNAL_SERVER_EXCEPTION, 0), + (RESOURCE_NOT_FOUND_EXCEPTION, 0), + (SERVICE_QUOTA_EXCEEDED_EXCEPTION, 0), + (THROTTLING_EXCEPTION, 0), + (VALIDATION_EXCEPTION, 0), + (RUNTIME_CLIENT_ERROR, 0), + ), ) -EVALUATOR_METRIC_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#EvaluatorMetricList"), - shape_type=ShapeType.LIST, - members={"member": {"target": EVALUATOR_METRIC}}, +INVOKE_AGENT_RUNTIME_COMMAND_OUTPUT: StaticSchema = ( + 18, + n0, + _IARCO, + {_sSI: _cIARCRo, _smith: None}, + (_rSI, _tI, _tP, _tS, _b, _cT, _sC, _str), + ( + (SESSION_ID, {_sH: _XABARSI}), + (3, {_sH: _XATI}), + (3, {_sH: _t}), + (3, {_sH: _tr}), + (3, {_sH: _b}), + (3, {_sH: _CT, _s: None}), + (HTTP_RESPONSE_CODE, 128), + (INVOKE_AGENT_RUNTIME_COMMAND_STREAM_OUTPUT, 17), + ), ) -AB_TEST_RESULTS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ABTestResults"), - members={ - "analysisTimestamp": {"target": TIMESTAMP}, - "evaluatorMetrics": { - "target": EVALUATOR_METRIC_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +INVOKE_AGENT_RUNTIME_COMMAND: StaticOperationSchema = ( + 23, + n0, + _IARC, + { + _smithy: MappingProxyType( + { + "method": "POST", + "uri": "/runtimes/{agentRuntimeArn}/commands", + "code": 200, + } + ) + }, + INVOKE_AGENT_RUNTIME_COMMAND_INPUT, + INVOKE_AGENT_RUNTIME_COMMAND_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + RETRYABLE_CONFLICT_EXCEPTION, + RUNTIME_CLIENT_ERROR, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AB_TEST_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ABTestStatus"), - shape_type=ShapeType.ENUM, - members={ - "CREATING": {"target": UNIT}, - "ACTIVE": {"target": UNIT}, - "CREATE_FAILED": {"target": UNIT}, - "UPDATING": {"target": UNIT}, - "UPDATE_FAILED": {"target": UNIT}, - "DELETING": {"target": UNIT}, - "DELETE_FAILED": {"target": UNIT}, - "FAILED": {"target": UNIT}, - }, +CONFLICT_EXCEPTION: StaticSchema = ( + 18, + n0, + _CE, + {_sm: _c, _sE: 409}, + (_mes,), + ((NON_BLANK_STRING, 0),), +) + +CLIENT_TOKEN: StaticSchema = (3, n0, _CTl, 0) + +STOP_RUNTIME_SESSION_INPUT: StaticSchema = ( + 18, + n0, + _SRSI, + {_sSI: _cSRSR, _smit: None}, + (_rSI, _aRA, _q, _cTl), + ( + (SESSION_TYPE, {_sH: _XABARSI, _s: None}), + (3, 9), + (3, {_sQ: _q}), + (CLIENT_TOKEN, 2), + ), ) -GATEWAY_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#GatewayArn"), shape_type=ShapeType.STRING -) - -AB_TEST_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ABTestSummary"), - members={ - "abTestId": { - "target": AB_TEST_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "abTestArn": { - "target": AB_TEST_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": AB_TEST_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": AB_TEST_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "executionStatus": { - "target": AB_TEST_EXECUTION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": AB_TEST_DESCRIPTION}, - "gatewayArn": {"target": GATEWAY_ARN}, - "createdAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +STOP_RUNTIME_SESSION_OUTPUT: StaticSchema = ( + 18, + n0, + _SRSO, + {_sSI: _cSRSRo, _smith: None}, + (_rSI, _sC), + ((SESSION_ID, {_sH: _XABARSI}), (HTTP_RESPONSE_CODE, 128)), +) + +UNAUTHORIZED_EXCEPTION: StaticSchema = ( + 18, + n0, + _UE, + {_sm: _c, _sE: 401}, + (_mes,), + ((NON_BLANK_STRING, 0),), +) + +STOP_RUNTIME_SESSION: StaticOperationSchema = ( + 23, + n0, + _SRS, + { + _smithy: MappingProxyType( + { + "method": "POST", + "uri": "/runtimes/{agentRuntimeArn}/stopruntimesession", + "code": 200, + } + ) + }, + STOP_RUNTIME_SESSION_INPUT, + STOP_RUNTIME_SESSION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + RETRYABLE_CONFLICT_EXCEPTION, + RUNTIME_CLIENT_ERROR, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AB_TEST_SUMMARY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ABTestSummaryList"), - shape_type=ShapeType.LIST, - members={"member": {"target": AB_TEST_SUMMARY}}, +SKILL_DEFINITION: StaticSchema = ( + 18, + n0, + _SD, + 0, + (_sV, _iC), + ((SCHEMA_VERSION, 0), (INLINE_CONTENT, 0)), +) + +SKILL_MD_DEFINITION: StaticSchema = (18, n0, _SMD, 0, (_iC,), ((INLINE_CONTENT, 0),)) + +AGENT_SKILLS_DESCRIPTOR: StaticSchema = ( + 18, + n0, + _ASD, + 0, + (_sM, _sD), + ((SKILL_MD_DEFINITION, 1), (SKILL_DEFINITION, 0)), +) + +BATCH_EVALUATION_ARN: StaticSchema = (3, n0, _BEA, 0) + +BATCH_EVALUATION_TRACE_CONFIG: StaticSchema = ( + 18, + n0, + _BETC, + 0, + (_bEA,), + ((BATCH_EVALUATION_ARN, 1),), +) + +LOG_GROUP_ARN_LIST: StaticSchema = (16, n0, _LGAL, 0, (_m,), ((3, 0),)) + +CLOUD_WATCH_LOGS_FILTER_OPERATOR: StaticSchema = ( + 14, + n0, + _CWLFO, + 0, + (_EQUALS, _NE, _GT, _LT, _GTOE, _LTOE, _CONTAINS, _NC), + ( + (-1, {_sVm: _E}), + (-1, {_sVm: _NEo}), + (-1, {_sVm: _GTr}), + (-1, {_sVm: _LTe}), + (-1, {_sVm: _GTOEr}), + (-1, {_sVm: _LTOEe}), + (-1, {_sVm: _C}), + (-1, {_sVm: _NCo}), + ), ) -NON_BLANK_STRING = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#NonBlankString"), - shape_type=ShapeType.STRING, +FILTER_STRING_VALUE: StaticSchema = (3, n0, _FSV, 0) + +FILTER_VALUE: StaticSchema = ( + 19, + n0, + _FV, + 0, + (_sVt, _dV, _bV), + ((FILTER_STRING_VALUE, 0), (10, 0), (2, 0)), +) + +CLOUD_WATCH_LOGS_FILTER: StaticSchema = ( + 18, + n0, + _CWLF, + 0, + (_k, _op, _va), + ((3, 1), (CLOUD_WATCH_LOGS_FILTER_OPERATOR, 1), (FILTER_VALUE, 1)), +) + +CLOUD_WATCH_LOGS_FILTER_LIST: StaticSchema = ( + 16, + n0, + _CWLFL, + 0, + (_m,), + ((CLOUD_WATCH_LOGS_FILTER, 0),), +) + +CLOUD_WATCH_LOGS_RULE: StaticSchema = ( + 18, + n0, + _CWLR, + 0, + (_f,), + ((CLOUD_WATCH_LOGS_FILTER_LIST, 0),), +) + +SERVICE_NAME: StaticSchema = (3, n0, _SN, 0) + +SERVICE_NAME_LIST: StaticSchema = (16, n0, _SNL, 0, (_m,), ((SERVICE_NAME, 0),)) + +CLOUD_WATCH_LOGS_TRACE_CONFIG: StaticSchema = ( + 18, + n0, + _CWLTC, + 0, + (_lGA, _sN, _sTt, _eT, _ru), + ( + (LOG_GROUP_ARN_LIST, 1), + (SERVICE_NAME_LIST, 1), + (4, {_sF: _dt, _s: None}), + (4, {_sF: _dt, _s: None}), + (CLOUD_WATCH_LOGS_RULE, 0), + ), ) -ACCESS_DENIED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=403), - ], - members={"message": {"target": NON_BLANK_STRING}}, +ONLINE_EVALUATION_TRACE_CONFIG: StaticSchema = ( + 18, + n0, + _OETC, + 0, + (_oECA, _sTt, _eT), + ( + (ONLINE_EVALUATION_CONFIG_ARN, 1), + (4, {_sF: _dt, _s: None}), + (4, {_sF: _dt, _s: None}), + ), ) -ACCESS_TOKEN_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#AccessTokenType"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) +SPAN: StaticSchema = (13, n0, _S, 0) -ACTOR_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#ActorId"), shape_type=ShapeType.STRING -) +SPANS: StaticSchema = (16, n0, _Sp, 4, (_m,), ((SPAN, 0),)) -ACTOR_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ActorSummary"), - members={ - "actorId": { - "target": ACTOR_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +AGENT_TRACES_CONFIG: StaticSchema = ( + 19, + n0, + _ATC, + 0, + (_sSe, _cL, _bE, _oE), + ( + (SPANS, 0), + (CLOUD_WATCH_LOGS_TRACE_CONFIG, 0), + (BATCH_EVALUATION_TRACE_CONFIG, 0), + (ONLINE_EVALUATION_TRACE_CONFIG, 0), + ), ) -ACTOR_SUMMARY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ActorSummaryList"), - shape_type=ShapeType.LIST, - members={"member": {"target": ACTOR_SUMMARY}}, -) - -INSIGHTS_FAILURE_CATEGORY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#InsightsFailureCategory"), - shape_type=ShapeType.ENUM, - members={ - "EXECUTION_ERROR_AUTHENTICATION": {"target": UNIT}, - "EXECUTION_ERROR_RESOURCE_NOT_FOUND": {"target": UNIT}, - "EXECUTION_ERROR_SERVICE_ERRORS": {"target": UNIT}, - "EXECUTION_ERROR_RATE_LIMITING": {"target": UNIT}, - "EXECUTION_ERROR_FORMATTING": {"target": UNIT}, - "EXECUTION_ERROR_TIMEOUT": {"target": UNIT}, - "EXECUTION_ERROR_RESOURCE_EXHAUSTION": {"target": UNIT}, - "EXECUTION_ERROR_ENVIRONMENT": {"target": UNIT}, - "EXECUTION_ERROR_TOOL_SCHEMA": {"target": UNIT}, - "TASK_INSTRUCTION_NON_COMPLIANCE": {"target": UNIT}, - "TASK_INSTRUCTION_PROBLEM_ID": {"target": UNIT}, - "INCORRECT_ACTIONS_TOOL_SELECTION": {"target": UNIT}, - "INCORRECT_ACTIONS_POOR_INFORMATION_RETRIEVAL": {"target": UNIT}, - "INCORRECT_ACTIONS_CLARIFICATION": {"target": UNIT}, - "INCORRECT_ACTIONS_INAPPROPRIATE_INFO_REQUEST": {"target": UNIT}, - "CONTEXT_HANDLING_FAILURES": {"target": UNIT}, - "HALLUCINATION_CAPABILITIES": {"target": UNIT}, - "HALLUCINATION_MISUNDERSTAND": {"target": UNIT}, - "HALLUCINATION_USAGE": {"target": UNIT}, - "HALLUCINATION_HISTORY": {"target": UNIT}, - "HALLUCINATION_PARAMS": {"target": UNIT}, - "HALLUCINATION_FABRICATE_TOOL_OUTPUTS": {"target": UNIT}, - "REPETITIVE_BEHAVIOR_TOOL": {"target": UNIT}, - "REPETITIVE_BEHAVIOR_INFO": {"target": UNIT}, - "REPETITIVE_BEHAVIOR_STEP": {"target": UNIT}, - "ORCHESTRATION_REASONING_MISMATCH": {"target": UNIT}, - "ORCHESTRATION_GOAL_DEVIATION": {"target": UNIT}, - "ORCHESTRATION_PREMATURE_TERMINATION": {"target": UNIT}, - "ORCHESTRATION_UNAWARE_TERMINATION": {"target": UNIT}, - "LLM_OUTPUT_NONSENSICAL": {"target": UNIT}, - "CONFIGURATION_MISMATCH_TOOL_DEFINITION": {"target": UNIT}, - "CODING_EDGE_CASE_OVERSIGHTS": {"target": UNIT}, - "CODING_DEPENDENCY_ISSUES": {"target": UNIT}, - "OTHER": {"target": UNIT}, - }, -) +BROWSER_PROFILE_ID: StaticSchema = (3, n0, _BPI, 0) -INSIGHTS_FAILURE_SIGNAL = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#InsightsFailureSignal"), - members={ - "category": { - "target": INSIGHTS_FAILURE_CATEGORY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "evidence": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "confidence": { - "target": DOUBLE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +BROWSER_SESSION_ID: StaticSchema = (3, n0, _BSI, 0) -INSIGHTS_FAILURE_SIGNAL_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#InsightsFailureSignalList"), - shape_type=ShapeType.LIST, - members={"member": {"target": INSIGHTS_FAILURE_SIGNAL}}, -) - -FAILURE_SPAN_DETAIL = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#FailureSpanDetail"), - members={ - "spanId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "traceId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "signals": { - "target": INSIGHTS_FAILURE_SIGNAL_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +SAVE_BROWSER_SESSION_PROFILE_INPUT: StaticSchema = ( + 18, + n0, + _SBSPI, + {_sSI: _cSBSPR, _smit: None}, + (_tI, _tP, _pI, _bI, _sIe, _cTl), + ( + (3, {_sH: _XATI}), + (3, {_sH: _t}), + (BROWSER_PROFILE_ID, 9), + (3, 1), + (BROWSER_SESSION_ID, 1), + (CLIENT_TOKEN, 2), + ), ) -FAILURE_SPAN_DETAIL_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#FailureSpanDetailList"), - shape_type=ShapeType.LIST, - members={"member": {"target": FAILURE_SPAN_DETAIL}}, -) - -AFFECTED_SESSION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#AffectedSession"), - members={ - "sessionId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "explanation": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "fixType": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "recommendation": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "failureSpans": { - "target": FAILURE_SPAN_DETAIL_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +DATE_TIMESTAMP: StaticSchema = (4, n0, _DT, {_sF: _dt}) + +SAVE_BROWSER_SESSION_PROFILE_OUTPUT: StaticSchema = ( + 18, + n0, + _SBSPO, + {_sSI: _cSBSPRo, _smith: None}, + (_pI, _bI, _sIe, _lUA), + ((BROWSER_PROFILE_ID, 1), (3, 1), (BROWSER_SESSION_ID, 1), (DATE_TIMESTAMP, 1)), +) + +SAVE_BROWSER_SESSION_PROFILE: StaticOperationSchema = ( + 23, + n0, + _SBSP, + { + _smithy: MappingProxyType( + { + "method": "PUT", + "uri": "/browser-profiles/{profileIdentifier}/save", + "code": 200, + } + ) + }, + SAVE_BROWSER_SESSION_PROFILE_INPUT, + SAVE_BROWSER_SESSION_PROFILE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AFFECTED_SESSION_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#AffectedSessionList"), - shape_type=ShapeType.LIST, - members={"member": {"target": AFFECTED_SESSION}}, +GET_BROWSER_SESSION_INPUT: StaticSchema = ( + 18, + n0, + _GBSI, + {_sSI: _cGBSR, _smit: None}, + (_bI, _sIe), + ((3, 9), (BROWSER_SESSION_ID, {_sQ: _sIe, _s: None})), ) -AGENT_CARD = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#AgentCard"), - shape_type=ShapeType.DOCUMENT, -) +SECRET_ARN: StaticSchema = (3, n0, _SA, 0) -SESSION_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#SessionType"), - shape_type=ShapeType.STRING, -) +SECRETS_MANAGER_LOCATION: StaticSchema = (18, n0, _SML, 0, (_sA,), ((SECRET_ARN, 1),)) -GET_AGENT_CARD_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#GetAgentCardInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#GetAgentCardRequest", - ) - ], - members={ - "runtimeSessionId": { - "target": SESSION_TYPE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="X-Amzn-Bedrock-AgentCore-Runtime-Session-Id", - ), - Trait.new(id=ShapeID("smithy.api#idempotencyToken")), - ], - }, - "agentRuntimeArn": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "qualifier": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="qualifier") - ], - }, - }, +CERTIFICATE_LOCATION: StaticSchema = ( + 19, + n0, + _CL, + 0, + (_sMe,), + ((SECRETS_MANAGER_LOCATION, 0),), ) -SESSION_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#SessionId"), shape_type=ShapeType.STRING -) +CERTIFICATE: StaticSchema = (18, n0, _Ce, 0, (_lo,), ((CERTIFICATE_LOCATION, 1),)) -HTTP_RESPONSE_CODE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#HttpResponseCode"), - shape_type=ShapeType.INTEGER, -) +CERTIFICATES: StaticSchema = (16, n0, _Cer, 0, (_m,), ((CERTIFICATE, 0),)) -GET_AGENT_CARD_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#GetAgentCardOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#GetAgentCardResponse", - ) - ], - members={ - "runtimeSessionId": { - "target": SESSION_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="X-Amzn-Bedrock-AgentCore-Runtime-Session-Id", - ) - ], - }, - "agentCard": { - "target": AGENT_CARD, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpPayload")), - ], - }, - "statusCode": { - "target": HTTP_RESPONSE_CODE, - "traits": [Trait.new(id=ShapeID("smithy.api#httpResponseCode"))], - }, - }, -) +S3_LOCATION: StaticSchema = (18, n0, _SL, 0, (_bu, _pr, _vI), ((3, 1), (3, 1), (3, 0))) -INTERNAL_SERVER_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="server"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=500), - ], - members={"message": {"target": NON_BLANK_STRING}}, -) - -RESOURCE_NOT_FOUND_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=404), - ], - members={"message": {"target": NON_BLANK_STRING}}, -) - -RETRYABLE_CONFLICT_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#RetryableConflictException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=409), - ], - members={ - "message": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +RESOURCE_LOCATION: StaticSchema = (19, n0, _RL, 0, (_s_,), ((S3_LOCATION, 0),)) -RUNTIME_CLIENT_ERROR = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#RuntimeClientError"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=424), - ], - members={"message": {"target": NON_BLANK_STRING}}, -) - -SERVICE_QUOTA_EXCEEDED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ServiceQuotaExceededException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=402), - ], - members={"message": {"target": NON_BLANK_STRING}}, -) - -THROTTLING_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=429), - ], - members={"message": {"target": NON_BLANK_STRING}}, -) - -VALIDATION_EXCEPTION_FIELD = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ValidationExceptionField"), - members={ - "name": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "message": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +BROWSER_ENTERPRISE_POLICY_TYPE: StaticSchema = ( + 14, + n0, + _BEPT, + 0, + (_MANAGED, _RECOMMENDED), + ((-1, {_sVm: _MANAGED}), (-1, {_sVm: _RECOMMENDED})), ) -VALIDATION_EXCEPTION_FIELD_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ValidationExceptionFieldList"), - shape_type=ShapeType.LIST, - members={"member": {"target": VALIDATION_EXCEPTION_FIELD}}, +BROWSER_ENTERPRISE_POLICY: StaticSchema = ( + 18, + n0, + _BEP, + 0, + (_lo, _ty), + ((RESOURCE_LOCATION, 1), (BROWSER_ENTERPRISE_POLICY_TYPE, 0)), ) -VALIDATION_EXCEPTION_REASON = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ValidationExceptionReason"), - shape_type=ShapeType.ENUM, - members={ - "CANNOT_PARSE": {"target": UNIT}, - "FIELD_VALIDATION_FAILED": {"target": UNIT}, - "IDEMPOTENT_PARAMETER_MISMATCH_EXCEPTION": {"target": UNIT}, - "ROOT_EVENT_IN_OTHER_SESSION": {"target": UNIT}, - "RESOURCE_CONFLICT": {"target": UNIT}, - }, +BROWSER_ENTERPRISE_POLICIES: StaticSchema = ( + 16, + n0, + _BEPr, + 0, + (_m,), + ((BROWSER_ENTERPRISE_POLICY, 0),), ) -VALIDATION_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={ - "message": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "reason": { - "target": VALIDATION_EXCEPTION_REASON, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "fieldList": {"target": VALIDATION_EXCEPTION_FIELD_LIST}, - }, -) +BROWSER_EXTENSION: StaticSchema = (18, n0, _BE, 0, (_lo,), ((RESOURCE_LOCATION, 1),)) -GET_AGENT_CARD = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#GetAgentCard"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/runtimes/{agentRuntimeArn}/invocations/.well-known/agent-card.json", - "code": 200, - } - ), - ) - ], -) +BROWSER_EXTENSIONS: StaticSchema = (16, n0, _BEr, 0, (_m,), ((BROWSER_EXTENSION, 0),)) -MIME_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#MimeType"), shape_type=ShapeType.STRING -) +EFS_ACCESS_POINT_ARN: StaticSchema = (3, n0, _EAPA, 0) -STRING_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#StringType"), shape_type=ShapeType.STRING +EFS_FILE_SYSTEM_ARN: StaticSchema = (3, n0, _EFSA, 0) + +MOUNT_PATH: StaticSchema = (3, n0, _MP, 0) + +EFS_CONFIGURATION: StaticSchema = ( + 18, + n0, + _EC, + 0, + (_aPA, _mP, _fSA), + ((EFS_ACCESS_POINT_ARN, 1), (MOUNT_PATH, 1), (EFS_FILE_SYSTEM_ARN, 1)), ) -BODY = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#Body"), - shape_type=ShapeType.BLOB, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +S3_FILES_ACCESS_POINT_ARN: StaticSchema = (3, n0, _SFAPA, 0) + +S3_FILES_FILE_SYSTEM_ARN: StaticSchema = (3, n0, _SFFSA, 0) + +S3_FILES_CONFIGURATION: StaticSchema = ( + 18, + n0, + _SFC, + 0, + (_aPA, _mP, _fSA), + ((S3_FILES_ACCESS_POINT_ARN, 1), (MOUNT_PATH, 1), (S3_FILES_FILE_SYSTEM_ARN, 1)), ) -INVOKE_AGENT_RUNTIME_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#InvokeAgentRuntimeInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#InvokeAgentRuntimeRequest", - ) - ], - members={ - "contentType": { - "target": MIME_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="Content-Type") - ], - }, - "accept": { - "target": MIME_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#httpHeader"), value="Accept")], - }, - "mcpSessionId": { - "target": STRING_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="Mcp-Session-Id") - ], - }, - "runtimeSessionId": { - "target": SESSION_TYPE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="X-Amzn-Bedrock-AgentCore-Runtime-Session-Id", - ), - Trait.new(id=ShapeID("smithy.api#idempotencyToken")), - ], - }, - "mcpProtocolVersion": { - "target": STRING_TYPE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), value="Mcp-Protocol-Version" - ) - ], - }, - "mcpMethod": { - "target": STRING_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="Mcp-Method") - ], - }, - "mcpName": { - "target": STRING_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="Mcp-Name") - ], - }, - "runtimeUserId": { - "target": STRING_TYPE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="X-Amzn-Bedrock-AgentCore-Runtime-User-Id", - ) - ], - }, - "traceId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="X-Amzn-Trace-Id") - ], - }, - "traceParent": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="traceparent") - ], - }, - "traceState": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="tracestate") - ], - }, - "baggage": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpHeader"), value="baggage")], - }, - "agentRuntimeArn": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "qualifier": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="qualifier") - ], - }, - "accountId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="accountId") - ], - }, - "payload": { - "target": BODY, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpPayload")), - ], - }, - }, +TOOLS_FILE_SYSTEM_CONFIGURATION: StaticSchema = ( + 19, + n0, + _TFSC, + 0, + (_sFC, _eCf), + ((S3_FILES_CONFIGURATION, 0), (EFS_CONFIGURATION, 0)), ) -RESPONSE_STREAM = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#ResponseStream"), - shape_type=ShapeType.BLOB, - traits=[ - Trait.new(id=ShapeID("smithy.api#streaming")), - Trait.new(id=ShapeID("smithy.api#sensitive")), - ], +TOOLS_FILE_SYSTEM_CONFIGURATIONS: StaticSchema = ( + 16, + n0, + _TFSCo, + 0, + (_m,), + ((TOOLS_FILE_SYSTEM_CONFIGURATION, 0),), ) -INVOKE_AGENT_RUNTIME_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#InvokeAgentRuntimeOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#InvokeAgentRuntimeResponse", - ) - ], - members={ - "runtimeSessionId": { - "target": SESSION_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="X-Amzn-Bedrock-AgentCore-Runtime-Session-Id", - ) - ], - }, - "mcpSessionId": { - "target": SESSION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="Mcp-Session-Id") - ], - }, - "mcpProtocolVersion": { - "target": STRING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), value="Mcp-Protocol-Version" - ) - ], - }, - "traceId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="X-Amzn-Trace-Id") - ], - }, - "traceParent": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="traceparent") - ], - }, - "traceState": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="tracestate") - ], - }, - "baggage": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpHeader"), value="baggage")], - }, - "contentType": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="Content-Type"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "response": { - "target": RESPONSE_STREAM, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=""), - Trait.new(id=ShapeID("smithy.api#httpPayload")), - ], - }, - "statusCode": { - "target": HTTP_RESPONSE_CODE, - "traits": [Trait.new(id=ShapeID("smithy.api#httpResponseCode"))], - }, - }, +NAME: StaticSchema = (3, n0, _N, 0) + +BROWSER_PROFILE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _BPC, + 0, + (_pI,), + ((BROWSER_PROFILE_ID, 1),), ) -INVOKE_AGENT_RUNTIME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#InvokeAgentRuntime"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/runtimes/{agentRuntimeArn}/invocations", - "code": 200, - } - ), - ) - ], +DOMAIN_PATTERN: StaticSchema = (3, n0, _DP, 0) + +DOMAIN_PATTERNS: StaticSchema = (16, n0, _DPo, 0, (_m,), ((DOMAIN_PATTERN, 0),)) + +PROXY_BYPASS: StaticSchema = (18, n0, _PB, 0, (_dP,), ((DOMAIN_PATTERNS, 0),)) + +BASIC_AUTH: StaticSchema = (18, n0, _BA, 0, (_sA,), ((SECRET_ARN, 1),)) + +PROXY_CREDENTIALS: StaticSchema = (19, n0, _PC, 0, (_bA,), ((BASIC_AUTH, 0),)) + +HOST_NAME: StaticSchema = (3, n0, _HN, 0) + +EXTERNAL_PROXY: StaticSchema = ( + 18, + n0, + _EP, + 0, + (_se, _po, _dP, _cr), + ((HOST_NAME, 1), (7, 1), (DOMAIN_PATTERNS, 0), (PROXY_CREDENTIALS, 0)), ) -INVOKE_AGENT_RUNTIME_COMMAND_REQUEST_BODY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#InvokeAgentRuntimeCommandRequestBody"), - members={ - "command": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "timeout": {"target": INTEGER}, - }, +PROXY: StaticSchema = (19, n0, _P, 0, (_eP,), ((EXTERNAL_PROXY, 0),)) + +PROXIES: StaticSchema = (16, n0, _Pr, 0, (_m,), ((PROXY, 0),)) + +PROXY_CONFIGURATION: StaticSchema = ( + 18, + n0, + _PCr, + 0, + (_pro, _by), + ((PROXIES, 1), (PROXY_BYPASS, 0)), ) -INVOKE_AGENT_RUNTIME_COMMAND_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#InvokeAgentRuntimeCommandInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#InvokeAgentRuntimeCommandRequest", - ) - ], - members={ - "contentType": { - "target": MIME_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="Content-Type") - ], - }, - "accept": { - "target": MIME_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#httpHeader"), value="Accept")], - }, - "runtimeSessionId": { - "target": SESSION_TYPE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="X-Amzn-Bedrock-AgentCore-Runtime-Session-Id", - ), - Trait.new(id=ShapeID("smithy.api#idempotencyToken")), - ], - }, - "traceId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="X-Amzn-Trace-Id") - ], - }, - "traceParent": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="traceparent") - ], - }, - "traceState": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="tracestate") - ], - }, - "baggage": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpHeader"), value="baggage")], - }, - "agentRuntimeArn": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "qualifier": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="qualifier") - ], - }, - "accountId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="accountId") - ], - }, - "body": { - "target": INVOKE_AGENT_RUNTIME_COMMAND_REQUEST_BODY, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpPayload")), - ], - }, - }, +BROWSER_SESSION_TIMEOUT: StaticSchema = (7, n0, _BST, 0) + +BROWSER_SESSION_STATUS: StaticSchema = ( + 14, + n0, + _BSS, + 0, + (_READY, _TERMINATED), + ((-1, {_sVm: _READY}), (-1, {_sVm: _TERMINATED})), ) -CONTENT_DELTA_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ContentDeltaEvent"), - members={"stdout": {"target": STRING}, "stderr": {"target": STRING}}, +BROWSER_STREAM_ENDPOINT: StaticSchema = (3, n0, _BSE, 0) + +AUTOMATION_STREAM_STATUS: StaticSchema = ( + 14, + n0, + _ASS, + 0, + (_ENABLED, _DISABLED), + ((-1, {_sVm: _ENABLED}), (-1, {_sVm: _DISABLED})), +) + +AUTOMATION_STREAM: StaticSchema = ( + 18, + n0, + _ASu, + 0, + (_sEt, _sSt), + ((BROWSER_STREAM_ENDPOINT, 1), (AUTOMATION_STREAM_STATUS, 1)), +) + +LIVE_VIEW_STREAM: StaticSchema = ( + 18, + n0, + _LVS, + 0, + (_sEt,), + ((BROWSER_STREAM_ENDPOINT, 0),), +) + +BROWSER_SESSION_STREAM: StaticSchema = ( + 18, + n0, + _BSSr, + 0, + (_aS, _lVS), + ((AUTOMATION_STREAM, 1), (LIVE_VIEW_STREAM, 0)), +) + +VIEW_PORT_HEIGHT: StaticSchema = (7, n0, _VPH, 0) + +VIEW_PORT_WIDTH: StaticSchema = (7, n0, _VPW, 0) + +VIEW_PORT: StaticSchema = ( + 18, + n0, + _VP, + 0, + (_w, _h), + ((VIEW_PORT_WIDTH, 1), (VIEW_PORT_HEIGHT, 1)), ) -CONTENT_START_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ContentStartEvent") +GET_BROWSER_SESSION_OUTPUT: StaticSchema = ( + 18, + n0, + _GBSO, + {_sSI: _cGBSRo, _smith: None}, + ( + _bI, + _sIe, + _n, + _cA, + _vP, + _ext, + _ePn, + _pCr, + _sTS, + _st, + _stre, + _pCro, + _ce, + _fC, + _sRA, + _lUA, + ), + ( + (3, 1), + (BROWSER_SESSION_ID, 1), + (NAME, 0), + (DATE_TIMESTAMP, 1), + (VIEW_PORT, 0), + (BROWSER_EXTENSIONS, 0), + (BROWSER_ENTERPRISE_POLICIES, 0), + (BROWSER_PROFILE_CONFIGURATION, 0), + (BROWSER_SESSION_TIMEOUT, 0), + (BROWSER_SESSION_STATUS, 0), + (BROWSER_SESSION_STREAM, 0), + (PROXY_CONFIGURATION, 0), + (CERTIFICATES, 0), + (TOOLS_FILE_SYSTEM_CONFIGURATIONS, 0), + (3, 0), + (DATE_TIMESTAMP, 0), + ), ) -COMMAND_EXECUTION_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#CommandExecutionStatus"), - shape_type=ShapeType.ENUM, - members={"COMPLETED": {"target": UNIT}, "TIMED_OUT": {"target": UNIT}}, +GET_BROWSER_SESSION: StaticOperationSchema = ( + 23, + n0, + _GBS, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/browsers/{browserIdentifier}/sessions/get", + "code": 200, + } + ) + }, + GET_BROWSER_SESSION_INPUT, + GET_BROWSER_SESSION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CONTENT_STOP_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ContentStopEvent"), - members={ - "exitCode": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": COMMAND_EXECUTION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +KEY_PRESS_ARGUMENTS: StaticSchema = (18, n0, _KPA, 0, (_k, _pre), ((3, 1), (7, 0))) + +KEY_LIST: StaticSchema = (16, n0, _KL, 0, (_m,), ((3, 0),)) + +KEY_SHORTCUT_ARGUMENTS: StaticSchema = (18, n0, _KSA, 0, (_ke,), ((KEY_LIST, 1),)) + +KEY_TYPE_ARGUMENTS: StaticSchema = (18, n0, _KTA, 0, (_te,), ((3, 1),)) + +MOUSE_BUTTON: StaticSchema = ( + 14, + n0, + _MB, + 0, + (_LEFT, _RIGHT, _MIDDLE), + ((-1, {_sVm: _LEFT}), (-1, {_sVm: _RIGHT}), (-1, {_sVm: _MIDDLE})), ) -RESPONSE_CHUNK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ResponseChunk"), - members={ - "contentStart": {"target": CONTENT_START_EVENT}, - "contentDelta": {"target": CONTENT_DELTA_EVENT}, - "contentStop": {"target": CONTENT_STOP_EVENT}, - }, +MOUSE_CLICK_ARGUMENTS: StaticSchema = ( + 18, + n0, + _MCA, + 0, + (_x, _y, _but, _cC), + ((7, 1), (7, 1), (MOUSE_BUTTON, 0), (7, 0)), ) -INVOKE_AGENT_RUNTIME_COMMAND_STREAM_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#InvokeAgentRuntimeCommandStreamOutput"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#streaming"))], - members={ - "chunk": {"target": RESPONSE_CHUNK}, - "accessDeniedException": {"target": ACCESS_DENIED_EXCEPTION}, - "internalServerException": {"target": INTERNAL_SERVER_EXCEPTION}, - "resourceNotFoundException": {"target": RESOURCE_NOT_FOUND_EXCEPTION}, - "serviceQuotaExceededException": {"target": SERVICE_QUOTA_EXCEEDED_EXCEPTION}, - "throttlingException": {"target": THROTTLING_EXCEPTION}, - "validationException": {"target": VALIDATION_EXCEPTION}, - "runtimeClientError": {"target": RUNTIME_CLIENT_ERROR}, - }, +MOUSE_DRAG_ARGUMENTS: StaticSchema = ( + 18, + n0, + _MDA, + 0, + (_eX, _eY, _sX, _sY, _but), + ((7, 1), (7, 1), (7, 1), (7, 1), (MOUSE_BUTTON, 0)), ) -INVOKE_AGENT_RUNTIME_COMMAND_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#InvokeAgentRuntimeCommandOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#InvokeAgentRuntimeCommandResponse", - ) - ], - members={ - "runtimeSessionId": { - "target": SESSION_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="X-Amzn-Bedrock-AgentCore-Runtime-Session-Id", - ) - ], - }, - "traceId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="X-Amzn-Trace-Id") - ], - }, - "traceParent": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="traceparent") - ], - }, - "traceState": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="tracestate") - ], - }, - "baggage": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpHeader"), value="baggage")], - }, - "contentType": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="Content-Type"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "statusCode": { - "target": HTTP_RESPONSE_CODE, - "traits": [Trait.new(id=ShapeID("smithy.api#httpResponseCode"))], - }, - "stream": { - "target": INVOKE_AGENT_RUNTIME_COMMAND_STREAM_OUTPUT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpPayload")), - ], - }, - }, +MOUSE_MOVE_ARGUMENTS: StaticSchema = (18, n0, _MMA, 0, (_x, _y), ((7, 1), (7, 1))) + +MOUSE_SCROLL_ARGUMENTS: StaticSchema = ( + 18, + n0, + _MSA, + 0, + (_x, _y, _dX, _dY), + ((7, 1), (7, 1), (7, 0), (7, 0)), ) -INVOKE_AGENT_RUNTIME_COMMAND = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#InvokeAgentRuntimeCommand"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/runtimes/{agentRuntimeArn}/commands", - "code": 200, - } - ), - ) - ], +SCREENSHOT_FORMAT: StaticSchema = (14, n0, _SF, 0, (_PNG,), ((-1, {_sVm: _PNG}),)) + +SCREENSHOT_ARGUMENTS: StaticSchema = ( + 18, + n0, + _SAc, + 0, + (_fo,), + ((SCREENSHOT_FORMAT, 0),), ) -CONFLICT_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ConflictException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=409), - ], - members={"message": {"target": NON_BLANK_STRING}}, +BROWSER_ACTION: StaticSchema = ( + 19, + n0, + _BAr, + 0, + (_mC, _mMo, _mD, _mS, _kT, _kP, _kS, _sc), + ( + (MOUSE_CLICK_ARGUMENTS, 0), + (MOUSE_MOVE_ARGUMENTS, 0), + (MOUSE_DRAG_ARGUMENTS, 0), + (MOUSE_SCROLL_ARGUMENTS, 0), + (KEY_TYPE_ARGUMENTS, 0), + (KEY_PRESS_ARGUMENTS, 0), + (KEY_SHORTCUT_ARGUMENTS, 0), + (SCREENSHOT_ARGUMENTS, 0), + ), ) -CLIENT_TOKEN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#ClientToken"), - shape_type=ShapeType.STRING, +INVOKE_BROWSER_INPUT: StaticSchema = ( + 18, + n0, + _IBI, + {_sSI: _cIBR, _smit: None}, + (_bI, _sIe, _ac), + ((3, 9), (BROWSER_SESSION_ID, {_sH: _xabsi, _s: None}), (BROWSER_ACTION, 1)), +) + +BROWSER_ACTION_STATUS: StaticSchema = ( + 14, + n0, + _BAS, + 0, + (_SUCCESS, _FAILED), + ((-1, {_sVm: _SUCCESS}), (-1, {_sVm: _FAILED})), +) + +KEY_PRESS_RESULT: StaticSchema = ( + 18, + n0, + _KPR, + 0, + (_st, _er), + ((BROWSER_ACTION_STATUS, 1), (3, 0)), +) + +KEY_SHORTCUT_RESULT: StaticSchema = ( + 18, + n0, + _KSR, + 0, + (_st, _er), + ((BROWSER_ACTION_STATUS, 1), (3, 0)), +) + +KEY_TYPE_RESULT: StaticSchema = ( + 18, + n0, + _KTR, + 0, + (_st, _er), + ((BROWSER_ACTION_STATUS, 1), (3, 0)), +) + +MOUSE_CLICK_RESULT: StaticSchema = ( + 18, + n0, + _MCR, + 0, + (_st, _er), + ((BROWSER_ACTION_STATUS, 1), (3, 0)), +) + +MOUSE_DRAG_RESULT: StaticSchema = ( + 18, + n0, + _MDR, + 0, + (_st, _er), + ((BROWSER_ACTION_STATUS, 1), (3, 0)), +) + +MOUSE_MOVE_RESULT: StaticSchema = ( + 18, + n0, + _MMR, + 0, + (_st, _er), + ((BROWSER_ACTION_STATUS, 1), (3, 0)), +) + +MOUSE_SCROLL_RESULT: StaticSchema = ( + 18, + n0, + _MSR, + 0, + (_st, _er), + ((BROWSER_ACTION_STATUS, 1), (3, 0)), +) + +SCREENSHOT_RESULT: StaticSchema = ( + 18, + n0, + _SR, + 0, + (_st, _er, _da), + ((BROWSER_ACTION_STATUS, 1), (3, 0), (1, 0)), +) + +BROWSER_ACTION_RESULT: StaticSchema = ( + 19, + n0, + _BAR, + 0, + (_mC, _mMo, _mD, _mS, _kT, _kP, _kS, _sc), + ( + (MOUSE_CLICK_RESULT, 0), + (MOUSE_MOVE_RESULT, 0), + (MOUSE_DRAG_RESULT, 0), + (MOUSE_SCROLL_RESULT, 0), + (KEY_TYPE_RESULT, 0), + (KEY_PRESS_RESULT, 0), + (KEY_SHORTCUT_RESULT, 0), + (SCREENSHOT_RESULT, 0), + ), ) -STOP_RUNTIME_SESSION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#StopRuntimeSessionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#StopRuntimeSessionRequest", - ) - ], - members={ - "runtimeSessionId": { - "target": SESSION_TYPE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="X-Amzn-Bedrock-AgentCore-Runtime-Session-Id", - ), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "agentRuntimeArn": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "qualifier": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="qualifier") - ], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - }, +INVOKE_BROWSER_OUTPUT: StaticSchema = ( + 18, + n0, + _IBO, + {_sSI: _cIBRo, _smith: None}, + (_resu, _sIe), + ((BROWSER_ACTION_RESULT, 1), (BROWSER_SESSION_ID, {_sH: _xabsi, _s: None})), +) + +INVOKE_BROWSER: StaticOperationSchema = ( + 23, + n0, + _IB, + { + _smithy: MappingProxyType( + { + "method": "POST", + "uri": "/browsers/{browserIdentifier}/sessions/invoke", + "code": 200, + } + ) + }, + INVOKE_BROWSER_INPUT, + INVOKE_BROWSER_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -STOP_RUNTIME_SESSION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#StopRuntimeSessionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#StopRuntimeSessionResponse", - ) - ], - members={ - "runtimeSessionId": { - "target": SESSION_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="X-Amzn-Bedrock-AgentCore-Runtime-Session-Id", - ) - ], - }, - "statusCode": { - "target": HTTP_RESPONSE_CODE, - "traits": [Trait.new(id=ShapeID("smithy.api#httpResponseCode"))], - }, - }, +MAX_RESULTS: StaticSchema = (7, n0, _MR, 0) + +NEXT_TOKEN: StaticSchema = (3, n0, _NT, 0) + +LIST_BROWSER_SESSIONS_INPUT: StaticSchema = ( + 18, + n0, + _LBSI, + {_sSI: _cLBSR, _smit: None}, + (_bI, _mR, _nT, _st), + ((3, 9), (MAX_RESULTS, 0), (NEXT_TOKEN, 0), (BROWSER_SESSION_STATUS, 0)), +) + +BROWSER_SESSION_SUMMARY: StaticSchema = ( + 18, + n0, + _BSSro, + 0, + (_bI, _sIe, _n, _st, _cA, _lUA), + ( + (3, 1), + (BROWSER_SESSION_ID, 1), + (NAME, 0), + (BROWSER_SESSION_STATUS, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 0), + ), ) -UNAUTHORIZED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#UnauthorizedException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=401), - ], - members={"message": {"target": NON_BLANK_STRING}}, -) - -STOP_RUNTIME_SESSION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#StopRuntimeSession"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/runtimes/{agentRuntimeArn}/stopruntimesession", - "code": 200, - } - ), - ) - ], +BROWSER_SESSION_SUMMARIES: StaticSchema = ( + 16, + n0, + _BSSrow, + 0, + (_m,), + ((BROWSER_SESSION_SUMMARY, 0),), +) + +LIST_BROWSER_SESSIONS_OUTPUT: StaticSchema = ( + 18, + n0, + _LBSO, + {_sSI: _cLBSRo, _smith: None}, + (_i, _nT), + ((BROWSER_SESSION_SUMMARIES, 1), (NEXT_TOKEN, 0)), +) + +LIST_BROWSER_SESSIONS: StaticOperationSchema = ( + 23, + n0, + _LBS, + { + _smithy: MappingProxyType( + { + "method": "POST", + "uri": "/browsers/{browserIdentifier}/sessions/list", + "code": 200, + } + ) + }, + LIST_BROWSER_SESSIONS_INPUT, + LIST_BROWSER_SESSIONS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -SKILL_DEFINITION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#SkillDefinition"), - members={ - "schemaVersion": {"target": SCHEMA_VERSION}, - "inlineContent": {"target": INLINE_CONTENT}, - }, +START_BROWSER_SESSION_INPUT: StaticSchema = ( + 18, + n0, + _SBSI, + {_sSI: _cSBSR, _smit: None}, + (_tI, _tP, _bI, _n, _sTS, _vP, _ext, _pCr, _pCro, _ePn, _ce, _fC, _cTl), + ( + (3, {_sH: _XATI}), + (3, {_sH: _t}), + (3, 9), + (NAME, 0), + (BROWSER_SESSION_TIMEOUT, {_smithyap: 3600}), + (VIEW_PORT, 0), + (BROWSER_EXTENSIONS, 0), + (BROWSER_PROFILE_CONFIGURATION, 0), + (PROXY_CONFIGURATION, 0), + (BROWSER_ENTERPRISE_POLICIES, 0), + (CERTIFICATES, 0), + (TOOLS_FILE_SYSTEM_CONFIGURATIONS, 0), + (CLIENT_TOKEN, 2), + ), ) -SKILL_MD_DEFINITION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#SkillMdDefinition"), - members={"inlineContent": {"target": INLINE_CONTENT}}, +START_BROWSER_SESSION_OUTPUT: StaticSchema = ( + 18, + n0, + _SBSO, + {_sSI: _cSBSRo, _smith: None}, + (_bI, _sIe, _cA, _stre), + ((3, 1), (BROWSER_SESSION_ID, 1), (DATE_TIMESTAMP, 1), (BROWSER_SESSION_STREAM, 0)), +) + +START_BROWSER_SESSION: StaticOperationSchema = ( + 23, + n0, + _SBS, + { + _smithy: MappingProxyType( + { + "method": "PUT", + "uri": "/browsers/{browserIdentifier}/sessions/start", + "code": 200, + } + ) + }, + START_BROWSER_SESSION_INPUT, + START_BROWSER_SESSION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AGENT_SKILLS_DESCRIPTOR = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#AgentSkillsDescriptor"), - members={ - "skillMd": { - "target": SKILL_MD_DEFINITION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "skillDefinition": {"target": SKILL_DEFINITION}, - }, +STOP_BROWSER_SESSION_INPUT: StaticSchema = ( + 18, + n0, + _SBSIt, + {_sSI: _cSBSRom, _smit: None}, + (_tI, _tP, _bI, _sIe, _cTl), + ( + (3, {_sH: _XATI}), + (3, {_sH: _t}), + (3, 9), + (BROWSER_SESSION_ID, {_sQ: _sIe, _s: None}), + (CLIENT_TOKEN, 2), + ), ) -BATCH_EVALUATION_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#BatchEvaluationArn"), - shape_type=ShapeType.STRING, +STOP_BROWSER_SESSION_OUTPUT: StaticSchema = ( + 18, + n0, + _SBSOt, + {_sSI: _cSBSRoma, _smith: None}, + (_bI, _sIe, _lUA), + ((3, 1), (BROWSER_SESSION_ID, 1), (DATE_TIMESTAMP, 1)), +) + +STOP_BROWSER_SESSION: StaticOperationSchema = ( + 23, + n0, + _SBSt, + { + _smithy: MappingProxyType( + { + "method": "PUT", + "uri": "/browsers/{browserIdentifier}/sessions/stop", + "code": 200, + } + ) + }, + STOP_BROWSER_SESSION_INPUT, + STOP_BROWSER_SESSION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -BATCH_EVALUATION_TRACE_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#BatchEvaluationTraceConfig"), - members={ - "batchEvaluationArn": { - "target": BATCH_EVALUATION_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +AUTOMATION_STREAM_UPDATE: StaticSchema = ( + 18, + n0, + _ASU, + 0, + (_sSt,), + ((AUTOMATION_STREAM_STATUS, 0),), +) + +STREAM_UPDATE: StaticSchema = ( + 19, + n0, + _SU, + 0, + (_aSU,), + ((AUTOMATION_STREAM_UPDATE, 0),), +) + +UPDATE_BROWSER_STREAM_INPUT: StaticSchema = ( + 18, + n0, + _UBSI, + {_sSI: _cUBSR, _smit: None}, + (_bI, _sIe, _sU, _cTl), + ( + (3, 9), + (BROWSER_SESSION_ID, {_sQ: _sIe, _s: None}), + (STREAM_UPDATE, 1), + (CLIENT_TOKEN, 2), + ), ) -LOG_GROUP_ARN_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#LogGroupArnList"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, -) - -CLOUD_WATCH_LOGS_FILTER_OPERATOR = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#CloudWatchLogsFilterOperator"), - shape_type=ShapeType.ENUM, - members={ - "EQUALS": {"target": UNIT}, - "NOT_EQUALS": {"target": UNIT}, - "GREATER_THAN": {"target": UNIT}, - "LESS_THAN": {"target": UNIT}, - "GREATER_THAN_OR_EQUAL": {"target": UNIT}, - "LESS_THAN_OR_EQUAL": {"target": UNIT}, - "CONTAINS": {"target": UNIT}, - "NOT_CONTAINS": {"target": UNIT}, - }, +UPDATE_BROWSER_STREAM_OUTPUT: StaticSchema = ( + 18, + n0, + _UBSO, + {_sSI: _cUBSRo, _smith: None}, + (_bI, _sIe, _stre, _uA), + ((3, 1), (BROWSER_SESSION_ID, 1), (BROWSER_SESSION_STREAM, 1), (DATE_TIMESTAMP, 1)), +) + +UPDATE_BROWSER_STREAM: StaticOperationSchema = ( + 23, + n0, + _UBS, + { + _smithy: MappingProxyType( + { + "method": "PUT", + "uri": "/browsers/{browserIdentifier}/sessions/streams/update", + "code": 200, + } + ) + }, + UPDATE_BROWSER_STREAM_INPUT, + UPDATE_BROWSER_STREAM_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -FILTER_STRING_VALUE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#FilterStringValue"), - shape_type=ShapeType.STRING, +CAPACITY_PROVIDER_ID: StaticSchema = (3, n0, _CPI, 0) + +DELETE_CAPACITY_PROVIDER_SESSION_INPUT: StaticSchema = ( + 18, + n0, + _DCPSI, + {_sSI: _cDCPSR, _smit: None}, + (_cPI, _sIe), + ((CAPACITY_PROVIDER_ID, 9), (SESSION_ID, 9)), +) + +CAPACITY_PROVIDER_ARN: StaticSchema = (3, n0, _CPA, 0) + +CAPACITY_PROVIDER_SESSION_STATUS: StaticSchema = ( + 14, + n0, + _CPSS, + 0, + (_PROVISIONING, _DEPROVISIONING, _ACTIVE, _DELETING, _DELETED, _STOPPED), + ( + (-1, {_sVm: _Pro}), + (-1, {_sVm: _D}), + (-1, {_sVm: _Ac}), + (-1, {_sVm: _De}), + (-1, {_sVm: _Del}), + (-1, {_sVm: _St}), + ), ) -FILTER_VALUE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#FilterValue"), - shape_type=ShapeType.UNION, - members={ - "stringValue": {"target": FILTER_STRING_VALUE}, - "doubleValue": {"target": DOUBLE}, - "booleanValue": {"target": BOOLEAN}, - }, +DELETE_CAPACITY_PROVIDER_SESSION_OUTPUT: StaticSchema = ( + 18, + n0, + _DCPSO, + {_sSI: _cDCPSRo, _smith: None}, + (_cPA, _sIe, _st), + ( + (CAPACITY_PROVIDER_ARN, 1), + (SESSION_ID, 1), + (CAPACITY_PROVIDER_SESSION_STATUS, 1), + ), ) -CLOUD_WATCH_LOGS_FILTER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#CloudWatchLogsFilter"), - members={ - "key": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "operator": { - "target": CLOUD_WATCH_LOGS_FILTER_OPERATOR, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "value": { - "target": FILTER_VALUE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +DELETE_CAPACITY_PROVIDER_SESSION: StaticOperationSchema = ( + 23, + n0, + _DCPS, + { + _smithy: MappingProxyType( + { + "method": "DELETE", + "uri": "/capacity-providers/{capacityProviderId}/sessions/{sessionId}", + "code": 202, + } + ) + }, + DELETE_CAPACITY_PROVIDER_SESSION_INPUT, + DELETE_CAPACITY_PROVIDER_SESSION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CLOUD_WATCH_LOGS_FILTER_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#CloudWatchLogsFilterList"), - shape_type=ShapeType.LIST, - members={"member": {"target": CLOUD_WATCH_LOGS_FILTER}}, -) - -CLOUD_WATCH_LOGS_RULE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#CloudWatchLogsRule"), - members={"filters": {"target": CLOUD_WATCH_LOGS_FILTER_LIST}}, -) - -SERVICE_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#ServiceName"), - shape_type=ShapeType.STRING, -) - -SERVICE_NAME_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ServiceNameList"), - shape_type=ShapeType.LIST, - members={"member": {"target": SERVICE_NAME}}, -) - -CLOUD_WATCH_LOGS_TRACE_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#CloudWatchLogsTraceConfig"), - members={ - "logGroupArns": { - "target": LOG_GROUP_ARN_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "serviceNames": { - "target": SERVICE_NAME_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "startTime": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#timestampFormat"), value="date-time"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "endTime": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#timestampFormat"), value="date-time"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "rule": {"target": CLOUD_WATCH_LOGS_RULE}, - }, +CODE_INTERPRETER_SESSION_ID: StaticSchema = (3, n0, _CISI, 0) + +GET_CODE_INTERPRETER_SESSION_INPUT: StaticSchema = ( + 18, + n0, + _GCISI, + {_sSI: _cGCISR, _smit: None}, + (_cII, _sIe), + ((3, 9), (CODE_INTERPRETER_SESSION_ID, {_sQ: _sIe, _s: None})), +) + +CODE_INTERPRETER_SESSION_TIMEOUT: StaticSchema = (7, n0, _CIST, 0) + +CODE_INTERPRETER_SESSION_STATUS: StaticSchema = ( + 14, + n0, + _CISS, + 0, + (_READY, _TERMINATED), + ((-1, {_sVm: _READY}), (-1, {_sVm: _TERMINATED})), +) + +GET_CODE_INTERPRETER_SESSION_OUTPUT: StaticSchema = ( + 18, + n0, + _GCISO, + {_sSI: _cGCISRo, _smith: None}, + (_cII, _sIe, _n, _cA, _sTS, _st, _ce, _fC), + ( + (3, 1), + (CODE_INTERPRETER_SESSION_ID, 1), + (NAME, 0), + (DATE_TIMESTAMP, 1), + (CODE_INTERPRETER_SESSION_TIMEOUT, 0), + (CODE_INTERPRETER_SESSION_STATUS, 0), + (CERTIFICATES, 0), + (TOOLS_FILE_SYSTEM_CONFIGURATIONS, 0), + ), ) -ONLINE_EVALUATION_TRACE_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#OnlineEvaluationTraceConfig"), - members={ - "onlineEvaluationConfigArn": { - "target": ONLINE_EVALUATION_CONFIG_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "startTime": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#timestampFormat"), value="date-time"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "endTime": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#timestampFormat"), value="date-time"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - }, +GET_CODE_INTERPRETER_SESSION: StaticOperationSchema = ( + 23, + n0, + _GCIS, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/code-interpreters/{codeInterpreterIdentifier}/sessions/get", + "code": 200, + } + ) + }, + GET_CODE_INTERPRETER_SESSION_INPUT, + GET_CODE_INTERPRETER_SESSION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -SPAN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#Span"), shape_type=ShapeType.DOCUMENT +LIST_CODE_INTERPRETER_SESSIONS_INPUT: StaticSchema = ( + 18, + n0, + _LCISI, + {_sSI: _cLCISR, _smit: None}, + (_cII, _mR, _nT, _st), + ((3, 9), (MAX_RESULTS, 0), (NEXT_TOKEN, 0), (CODE_INTERPRETER_SESSION_STATUS, 0)), +) + +CODE_INTERPRETER_SESSION_SUMMARY: StaticSchema = ( + 18, + n0, + _CISSo, + 0, + (_cII, _sIe, _n, _st, _cA, _lUA), + ( + (3, 1), + (CODE_INTERPRETER_SESSION_ID, 1), + (NAME, 0), + (CODE_INTERPRETER_SESSION_STATUS, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 0), + ), ) -SPANS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#Spans"), - shape_type=ShapeType.LIST, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"member": {"target": SPAN}}, +CODE_INTERPRETER_SESSION_SUMMARIES: StaticSchema = ( + 16, + n0, + _CISSod, + 0, + (_m,), + ((CODE_INTERPRETER_SESSION_SUMMARY, 0),), +) + +LIST_CODE_INTERPRETER_SESSIONS_OUTPUT: StaticSchema = ( + 18, + n0, + _LCISO, + {_sSI: _cLCISRo, _smith: None}, + (_i, _nT), + ((CODE_INTERPRETER_SESSION_SUMMARIES, 1), (NEXT_TOKEN, 0)), +) + +LIST_CODE_INTERPRETER_SESSIONS: StaticOperationSchema = ( + 23, + n0, + _LCIS, + { + _smithy: MappingProxyType( + { + "method": "POST", + "uri": "/code-interpreters/{codeInterpreterIdentifier}/sessions/list", + "code": 200, + } + ) + }, + LIST_CODE_INTERPRETER_SESSIONS_INPUT, + LIST_CODE_INTERPRETER_SESSIONS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AGENT_TRACES_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#AgentTracesConfig"), - shape_type=ShapeType.UNION, - members={ - "sessionSpans": {"target": SPANS}, - "cloudwatchLogs": {"target": CLOUD_WATCH_LOGS_TRACE_CONFIG}, - "batchEvaluation": {"target": BATCH_EVALUATION_TRACE_CONFIG}, - "onlineEvaluation": {"target": ONLINE_EVALUATION_TRACE_CONFIG}, - }, +START_CODE_INTERPRETER_SESSION_INPUT: StaticSchema = ( + 18, + n0, + _SCISI, + {_sSI: _cSCISR, _smit: None}, + (_tI, _tP, _cII, _n, _sTS, _ce, _fC, _cTl), + ( + (3, {_sH: _XATI}), + (3, {_sH: _t}), + (3, 9), + (NAME, 0), + (CODE_INTERPRETER_SESSION_TIMEOUT, {_smithyap: 900}), + (CERTIFICATES, 0), + (TOOLS_FILE_SYSTEM_CONFIGURATIONS, 0), + (CLIENT_TOKEN, 2), + ), ) -BROWSER_PROFILE_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#BrowserProfileId"), - shape_type=ShapeType.STRING, +START_CODE_INTERPRETER_SESSION_OUTPUT: StaticSchema = ( + 18, + n0, + _SCISO, + {_sSI: _cSCISRo, _smith: None}, + (_cII, _sIe, _cA), + ((3, 1), (CODE_INTERPRETER_SESSION_ID, 1), (DATE_TIMESTAMP, 1)), +) + +START_CODE_INTERPRETER_SESSION: StaticOperationSchema = ( + 23, + n0, + _SCIS, + { + _smithy: MappingProxyType( + { + "method": "PUT", + "uri": "/code-interpreters/{codeInterpreterIdentifier}/sessions/start", + "code": 200, + } + ) + }, + START_CODE_INTERPRETER_SESSION_INPUT, + START_CODE_INTERPRETER_SESSION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -BROWSER_SESSION_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#BrowserSessionId"), - shape_type=ShapeType.STRING, +STOP_CODE_INTERPRETER_SESSION_INPUT: StaticSchema = ( + 18, + n0, + _SCISIt, + {_sSI: _cSCISRom, _smit: None}, + (_tI, _tP, _cII, _sIe, _cTl), + ( + (3, {_sH: _XATI}), + (3, {_sH: _t}), + (3, 9), + (CODE_INTERPRETER_SESSION_ID, {_sQ: _sIe, _s: None}), + (CLIENT_TOKEN, 2), + ), ) -SAVE_BROWSER_SESSION_PROFILE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#SaveBrowserSessionProfileInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#SaveBrowserSessionProfileRequest", - ) - ], - members={ - "traceId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="X-Amzn-Trace-Id") - ], - }, - "traceParent": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="traceparent") - ], - }, - "profileIdentifier": { - "target": BROWSER_PROFILE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "browserIdentifier": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "sessionId": { - "target": BROWSER_SESSION_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - }, +STOP_CODE_INTERPRETER_SESSION_OUTPUT: StaticSchema = ( + 18, + n0, + _SCISOt, + {_sSI: _cSCISRoma, _smith: None}, + (_cII, _sIe, _lUA), + ((3, 1), (CODE_INTERPRETER_SESSION_ID, 1), (DATE_TIMESTAMP, 1)), +) + +STOP_CODE_INTERPRETER_SESSION: StaticOperationSchema = ( + 23, + n0, + _SCISt, + { + _smithy: MappingProxyType( + { + "method": "PUT", + "uri": "/code-interpreters/{codeInterpreterIdentifier}/sessions/stop", + "code": 200, + } + ) + }, + STOP_CODE_INTERPRETER_SESSION_INPUT, + STOP_CODE_INTERPRETER_SESSION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -DATE_TIMESTAMP = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#DateTimestamp"), - shape_type=ShapeType.TIMESTAMP, - traits=[Trait.new(id=ShapeID("smithy.api#timestampFormat"), value="date-time")], +REQUEST_URI: StaticSchema = (3, n0, _RU, 0) + +USER_ID_TYPE: StaticSchema = (3, n0, _UIT, 0) + +USER_TOKEN_TYPE: StaticSchema = (3, n0, _UTT, 4) + +USER_IDENTIFIER: StaticSchema = ( + 19, + n0, + _UI, + 0, + (_uT, _uI), + ((USER_TOKEN_TYPE, 0), (USER_ID_TYPE, 0)), ) -SAVE_BROWSER_SESSION_PROFILE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#SaveBrowserSessionProfileOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#SaveBrowserSessionProfileResponse", - ) - ], - members={ - "profileIdentifier": { - "target": BROWSER_PROFILE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "browserIdentifier": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "sessionId": { - "target": BROWSER_SESSION_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastUpdatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +COMPLETE_RESOURCE_TOKEN_AUTH_INPUT: StaticSchema = ( + 18, + n0, + _CRTAI, + {_sSI: _cCRTAR, _smit: None}, + (_uIs, _sUe), + ((USER_IDENTIFIER, 1), (REQUEST_URI, 1)), ) -SAVE_BROWSER_SESSION_PROFILE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#SaveBrowserSessionProfile"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PUT", - "uri": "/browser-profiles/{profileIdentifier}/save", - "code": 200, - } - ), - ) - ], +COMPLETE_RESOURCE_TOKEN_AUTH_OUTPUT: StaticSchema = ( + 18, + n0, + _CRTAO, + {_sSI: _cCRTARo, _smith: None}, ) -GET_BROWSER_SESSION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#GetBrowserSessionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#GetBrowserSessionRequest", +COMPLETE_RESOURCE_TOKEN_AUTH: StaticOperationSchema = ( + 23, + n0, + _CRTA, + { + _smithy: MappingProxyType( + {"uri": "/identities/CompleteResourceTokenAuth", "method": "POST"} ) - ], - members={ - "browserIdentifier": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "sessionId": { - "target": BROWSER_SESSION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="sessionId"), - ], - }, }, + COMPLETE_RESOURCE_TOKEN_AUTH_INPUT, + COMPLETE_RESOURCE_TOKEN_AUTH_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -SECRET_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#SecretArn"), shape_type=ShapeType.STRING -) +PATH_PATTERN: StaticSchema = (3, n0, _PP, 0) -SECRETS_MANAGER_LOCATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#SecretsManagerLocation"), - members={ - "secretArn": { - "target": SECRET_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +TARGET_PATH_LIST: StaticSchema = (16, n0, _TPL, 0, (_m,), ((PATH_PATTERN, 0),)) -CERTIFICATE_LOCATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#CertificateLocation"), - shape_type=ShapeType.UNION, - members={"secretsManager": {"target": SECRETS_MANAGER_LOCATION}}, -) +GATEWAY_FILTER: StaticSchema = (18, n0, _GF, 0, (_tPa,), ((TARGET_PATH_LIST, 0),)) -CERTIFICATE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#Certificate"), - members={ - "location": { - "target": CERTIFICATE_LOCATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +ROLE_ARN: StaticSchema = (3, n0, _RA, 0) -CERTIFICATES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#Certificates"), - shape_type=ShapeType.LIST, - members={"member": {"target": CERTIFICATE}}, -) - -S3_LOCATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#S3Location"), - members={ - "bucket": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "prefix": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "versionId": {"target": STRING}, - }, -) +TAG_KEY: StaticSchema = (3, n0, _TK, 0) -RESOURCE_LOCATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ResourceLocation"), - shape_type=ShapeType.UNION, - members={"s3": {"target": S3_LOCATION}}, -) +TAG_VALUE: StaticSchema = (3, n0, _TV, 0) -BROWSER_ENTERPRISE_POLICY_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#BrowserEnterprisePolicyType"), - shape_type=ShapeType.ENUM, - members={"MANAGED": {"target": UNIT}, "RECOMMENDED": {"target": UNIT}}, -) +TAGS_MAP: StaticSchema = (17, n0, _TM, 0, (_k, _va), ((TAG_KEY, 0), (TAG_VALUE, 0))) -BROWSER_ENTERPRISE_POLICY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#BrowserEnterprisePolicy"), - members={ - "location": { - "target": RESOURCE_LOCATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "type": {"target": BROWSER_ENTERPRISE_POLICY_TYPE}, - }, -) +CONFIGURATION_BUNDLE_ARN: StaticSchema = (3, n0, _CBA, 0) -BROWSER_ENTERPRISE_POLICIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#BrowserEnterprisePolicies"), - shape_type=ShapeType.LIST, - members={"member": {"target": BROWSER_ENTERPRISE_POLICY}}, -) +CONFIGURATION_BUNDLE_VERSION: StaticSchema = (3, n0, _CBV, 0) -BROWSER_EXTENSION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#BrowserExtension"), - members={ - "location": { - "target": RESOURCE_LOCATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +CONFIGURATION_BUNDLE_REF: StaticSchema = ( + 18, + n0, + _CBR, + 0, + (_bAu, _bVu), + ((CONFIGURATION_BUNDLE_ARN, 1), (CONFIGURATION_BUNDLE_VERSION, 1)), ) -BROWSER_EXTENSIONS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#BrowserExtensions"), - shape_type=ShapeType.LIST, - members={"member": {"target": BROWSER_EXTENSION}}, -) +TARGET_NAME: StaticSchema = (3, n0, _TN, 0) -EFS_ACCESS_POINT_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#EfsAccessPointArn"), - shape_type=ShapeType.STRING, -) +TARGET_REF: StaticSchema = (18, n0, _TR, 0, (_n,), ((TARGET_NAME, 1),)) -EFS_FILE_SYSTEM_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#EfsFileSystemArn"), - shape_type=ShapeType.STRING, +VARIANT_CONFIGURATION: StaticSchema = ( + 18, + n0, + _VC, + 0, + (_cB, _ta), + ((CONFIGURATION_BUNDLE_REF, 0), (TARGET_REF, 0)), ) -MOUNT_PATH = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#MountPath"), shape_type=ShapeType.STRING +VARIANT: StaticSchema = ( + 18, + n0, + _V, + 0, + (_n, _we, _vC), + ((VARIANT_NAME, 1), (7, 1), (VARIANT_CONFIGURATION, 1)), ) -EFS_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#EfsConfiguration"), - members={ - "accessPointArn": { - "target": EFS_ACCESS_POINT_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "mountPath": { - "target": MOUNT_PATH, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "fileSystemArn": { - "target": EFS_FILE_SYSTEM_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +VARIANT_LIST: StaticSchema = (16, n0, _VL, 0, (_m,), ((VARIANT, 0),)) -S3_FILES_ACCESS_POINT_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#S3FilesAccessPointArn"), - shape_type=ShapeType.STRING, +CREATE_AB_TEST_INPUT: StaticSchema = ( + 18, + n0, + _CABTI, + {_sSI: _cCABTR, _smit: None}, + (_n, _d, _gA, _var, _gF, _eCv, _rA, _eOC, _cTl, _tag), + ( + (AB_TEST_NAME, 1), + (AB_TEST_DESCRIPTION, 0), + (GATEWAY_ARN, 1), + (VARIANT_LIST, 1), + (GATEWAY_FILTER, 0), + (AB_TEST_EVALUATION_CONFIG, 1), + (ROLE_ARN, 1), + (2, 0), + (CLIENT_TOKEN, 2), + (TAGS_MAP, 0), + ), ) -S3_FILES_FILE_SYSTEM_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#S3FilesFileSystemArn"), - shape_type=ShapeType.STRING, +CREATE_AB_TEST_OUTPUT: StaticSchema = ( + 18, + n0, + _CABTO, + {_sSI: _cCABTRo, _smith: None}, + (_aTI, _aTA, _n, _st, _eS, _cA), + ( + (AB_TEST_ID, 1), + (AB_TEST_ARN, 1), + (AB_TEST_NAME, 0), + (AB_TEST_STATUS, 1), + (AB_TEST_EXECUTION_STATUS, 1), + (4, 1), + ), ) -S3_FILES_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#S3FilesConfiguration"), - members={ - "accessPointArn": { - "target": S3_FILES_ACCESS_POINT_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "mountPath": { - "target": MOUNT_PATH, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "fileSystemArn": { - "target": S3_FILES_FILE_SYSTEM_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +CREATE_AB_TEST: StaticOperationSchema = ( + 23, + n0, + _CABT, + {_smithy: MappingProxyType({"method": "POST", "uri": "/ab-tests", "code": 202})}, + CREATE_AB_TEST_INPUT, + CREATE_AB_TEST_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -TOOLS_FILE_SYSTEM_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ToolsFileSystemConfiguration"), - shape_type=ShapeType.UNION, - members={ - "s3FilesConfiguration": {"target": S3_FILES_CONFIGURATION}, - "efsConfiguration": {"target": EFS_CONFIGURATION}, - }, +DELETE_AB_TEST_INPUT: StaticSchema = ( + 18, + n0, + _DABTI, + {_sSI: _cDABTR, _smit: None}, + (_aTI,), + ((AB_TEST_ID, 9),), +) + +DELETE_AB_TEST_OUTPUT: StaticSchema = ( + 18, + n0, + _DABTO, + {_sSI: _cDABTRo, _smith: None}, + (_aTI, _aTA, _st), + ((AB_TEST_ID, 1), (AB_TEST_ARN, 1), (AB_TEST_STATUS, 1)), +) + +DELETE_AB_TEST: StaticOperationSchema = ( + 23, + n0, + _DABT, + { + _smithy: MappingProxyType( + {"method": "DELETE", "uri": "/ab-tests/{abTestId}", "code": 202} + ) + }, + DELETE_AB_TEST_INPUT, + DELETE_AB_TEST_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -TOOLS_FILE_SYSTEM_CONFIGURATIONS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ToolsFileSystemConfigurations"), - shape_type=ShapeType.LIST, - members={"member": {"target": TOOLS_FILE_SYSTEM_CONFIGURATION}}, +BATCH_EVALUATION_ID: StaticSchema = (3, n0, _BEI, 0) + +DELETE_BATCH_EVALUATION_INPUT: StaticSchema = ( + 18, + n0, + _DBEI, + {_sSI: _cDBER, _smit: None}, + (_bEI,), + ((BATCH_EVALUATION_ID, 9),), +) + +BATCH_EVALUATION_STATUS: StaticSchema = ( + 14, + n0, + _BES, + 0, + (_PENDING, _IP, _COMPLETED, _CWE, _FAILED, _STOPPING, _STOPPED, _DELETING), + ( + (-1, {_sVm: _PENDING}), + (-1, {_sVm: _IP}), + (-1, {_sVm: _COMPLETED}), + (-1, {_sVm: _CWE}), + (-1, {_sVm: _FAILED}), + (-1, {_sVm: _STOPPING}), + (-1, {_sVm: _STOPPED}), + (-1, {_sVm: _DELETING}), + ), ) -NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#Name"), shape_type=ShapeType.STRING +DELETE_BATCH_EVALUATION_OUTPUT: StaticSchema = ( + 18, + n0, + _DBEO, + {_sSI: _cDBERo, _smith: None}, + (_bEI, _bEA, _st), + ((BATCH_EVALUATION_ID, 1), (BATCH_EVALUATION_ARN, 1), (BATCH_EVALUATION_STATUS, 1)), +) + +DELETE_BATCH_EVALUATION: StaticOperationSchema = ( + 23, + n0, + _DBE, + { + _smithy: MappingProxyType( + { + "method": "DELETE", + "uri": "/evaluations/batch-evaluate/{batchEvaluationId}", + "code": 202, + } + ) + }, + DELETE_BATCH_EVALUATION_INPUT, + DELETE_BATCH_EVALUATION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -BROWSER_PROFILE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#BrowserProfileConfiguration"), - members={ - "profileIdentifier": { - "target": BROWSER_PROFILE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +RECOMMENDATION_ID: StaticSchema = (3, n0, _RI, 0) + +DELETE_RECOMMENDATION_INPUT: StaticSchema = ( + 18, + n0, + _DRI, + {_sSI: _cDRR, _smit: None}, + (_rI,), + ((RECOMMENDATION_ID, 9),), +) + +RECOMMENDATION_STATUS: StaticSchema = ( + 14, + n0, + _RSe, + 0, + (_PENDING, _IP, _COMPLETED, _FAILED, _DELETING), + ( + (-1, {_sVm: _PENDING}), + (-1, {_sVm: _IP}), + (-1, {_sVm: _COMPLETED}), + (-1, {_sVm: _FAILED}), + (-1, {_sVm: _DELETING}), + ), ) -DOMAIN_PATTERN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#DomainPattern"), - shape_type=ShapeType.STRING, +DELETE_RECOMMENDATION_OUTPUT: StaticSchema = ( + 18, + n0, + _DRO, + {_sSI: _cDRRo, _smith: None}, + (_rI, _st), + ((RECOMMENDATION_ID, 1), (RECOMMENDATION_STATUS, 1)), +) + +DELETE_RECOMMENDATION: StaticOperationSchema = ( + 23, + n0, + _DR, + { + _smithy: MappingProxyType( + { + "method": "DELETE", + "uri": "/recommendations/{recommendationId}", + "code": 202, + } + ) + }, + DELETE_RECOMMENDATION_INPUT, + DELETE_RECOMMENDATION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -DOMAIN_PATTERNS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#DomainPatterns"), - shape_type=ShapeType.LIST, - members={"member": {"target": DOMAIN_PATTERN}}, +DUPLICATE_ID_EXCEPTION: StaticSchema = ( + 18, + n0, + _DIE, + {_sm: _c, _sE: 409}, + (_mes,), + ((NON_BLANK_STRING, 0),), ) -PROXY_BYPASS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ProxyBypass"), - members={"domainPatterns": {"target": DOMAIN_PATTERNS}}, -) +EVALUATION_INPUT: StaticSchema = (19, n0, _EI, 0, (_sSe,), ((SPANS, 0),)) -BASIC_AUTH = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#BasicAuth"), - members={ - "secretArn": { - "target": SECRET_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +EVALUATION_CONTENT: StaticSchema = (19, n0, _ECv, 0, (_te,), ((3, 0),)) -PROXY_CREDENTIALS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ProxyCredentials"), - shape_type=ShapeType.UNION, - members={"basicAuth": {"target": BASIC_AUTH}}, +EVALUATION_CONTENT_LIST: StaticSchema = ( + 16, + n0, + _ECL, + 0, + (_m,), + ((EVALUATION_CONTENT, 0),), ) -HOST_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#HostName"), shape_type=ShapeType.STRING +SPAN_CONTEXT: StaticSchema = ( + 18, + n0, + _SC, + 0, + (_sIe, _tI, _sI), + ((3, 1), (3, 0), (3, 0)), ) -EXTERNAL_PROXY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ExternalProxy"), - members={ - "server": { - "target": HOST_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "port": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "domainPatterns": {"target": DOMAIN_PATTERNS}, - "credentials": {"target": PROXY_CREDENTIALS}, - }, -) +CONTEXT: StaticSchema = (19, n0, _Co, 0, (_sCp,), ((SPAN_CONTEXT, 0),)) -PROXY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#Proxy"), - shape_type=ShapeType.UNION, - members={"externalProxy": {"target": EXTERNAL_PROXY}}, -) +EVALUATION_TOOL_NAME: StaticSchema = (3, n0, _ETN, 0) -PROXIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#Proxies"), - shape_type=ShapeType.LIST, - members={"member": {"target": PROXY}}, +EVALUATION_TOOL_NAMES: StaticSchema = ( + 16, + n0, + _ETNv, + 0, + (_m,), + ((EVALUATION_TOOL_NAME, 0),), ) -PROXY_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ProxyConfiguration"), - members={ - "proxies": { - "target": PROXIES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "bypass": {"target": PROXY_BYPASS}, - }, +EVALUATION_EXPECTED_TRAJECTORY: StaticSchema = ( + 18, + n0, + _EETv, + 0, + (_tN,), + ((EVALUATION_TOOL_NAMES, 0),), ) -BROWSER_SESSION_TIMEOUT = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#BrowserSessionTimeout"), - shape_type=ShapeType.INTEGER, +EVALUATION_REFERENCE_INPUT: StaticSchema = ( + 18, + n0, + _ERI, + 0, + (_con, _eR, _as, _eTx), + ( + (CONTEXT, 1), + (EVALUATION_CONTENT, 0), + (EVALUATION_CONTENT_LIST, 0), + (EVALUATION_EXPECTED_TRAJECTORY, 0), + ), ) -BROWSER_SESSION_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#BrowserSessionStatus"), - shape_type=ShapeType.ENUM, - members={"READY": {"target": UNIT}, "TERMINATED": {"target": UNIT}}, +EVALUATION_REFERENCE_INPUTS: StaticSchema = ( + 16, + n0, + _ERIv, + 4, + (_m,), + ((EVALUATION_REFERENCE_INPUT, 0),), ) -BROWSER_STREAM_ENDPOINT = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#BrowserStreamEndpoint"), - shape_type=ShapeType.STRING, -) +SPAN_ID: StaticSchema = (3, n0, _SIp, 0) -AUTOMATION_STREAM_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#AutomationStreamStatus"), - shape_type=ShapeType.ENUM, - members={"ENABLED": {"target": UNIT}, "DISABLED": {"target": UNIT}}, -) +SPAN_IDS: StaticSchema = (16, n0, _SIpa, 0, (_m,), ((SPAN_ID, 0),)) -AUTOMATION_STREAM = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#AutomationStream"), - members={ - "streamEndpoint": { - "target": BROWSER_STREAM_ENDPOINT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "streamStatus": { - "target": AUTOMATION_STREAM_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +TRACE_ID: StaticSchema = (3, n0, _TI, 0) -LIVE_VIEW_STREAM = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#LiveViewStream"), - members={"streamEndpoint": {"target": BROWSER_STREAM_ENDPOINT}}, -) +TRACE_IDS: StaticSchema = (16, n0, _TIr, 0, (_m,), ((TRACE_ID, 0),)) -BROWSER_SESSION_STREAM = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#BrowserSessionStream"), - members={ - "automationStream": { - "target": AUTOMATION_STREAM, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "liveViewStream": {"target": LIVE_VIEW_STREAM}, - }, +EVALUATION_TARGET: StaticSchema = ( + 19, + n0, + _ET, + 0, + (_sIp, _tIr), + ((SPAN_IDS, 0), (TRACE_IDS, 0)), ) -VIEW_PORT_HEIGHT = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#ViewPortHeight"), - shape_type=ShapeType.INTEGER, -) +EVALUATOR_ID: StaticSchema = (3, n0, _EIv, 0) -VIEW_PORT_WIDTH = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#ViewPortWidth"), - shape_type=ShapeType.INTEGER, +EVALUATE_INPUT: StaticSchema = ( + 18, + n0, + _EIva, + {_sSI: _cER, _smit: None}, + (_eI, _eIv, _eTv, _eRI), + ( + (EVALUATOR_ID, 9), + (EVALUATION_INPUT, 1), + (EVALUATION_TARGET, 0), + (EVALUATION_REFERENCE_INPUTS, 0), + ), ) -VIEW_PORT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ViewPort"), - members={ - "width": { - "target": VIEW_PORT_WIDTH, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "height": { - "target": VIEW_PORT_HEIGHT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +EVALUATION_ERROR_CODE: StaticSchema = (3, n0, _EEC, 0) -GET_BROWSER_SESSION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#GetBrowserSessionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#GetBrowserSessionResponse", - ) - ], - members={ - "browserIdentifier": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "sessionId": { - "target": BROWSER_SESSION_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": {"target": NAME}, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "viewPort": {"target": VIEW_PORT}, - "extensions": {"target": BROWSER_EXTENSIONS}, - "enterprisePolicies": {"target": BROWSER_ENTERPRISE_POLICIES}, - "profileConfiguration": {"target": BROWSER_PROFILE_CONFIGURATION}, - "sessionTimeoutSeconds": {"target": BROWSER_SESSION_TIMEOUT}, - "status": {"target": BROWSER_SESSION_STATUS}, - "streams": {"target": BROWSER_SESSION_STREAM}, - "proxyConfiguration": {"target": PROXY_CONFIGURATION}, - "certificates": {"target": CERTIFICATES}, - "filesystemConfigurations": {"target": TOOLS_FILE_SYSTEM_CONFIGURATIONS}, - "sessionReplayArtifact": {"target": STRING}, - "lastUpdatedAt": {"target": DATE_TIMESTAMP}, - }, -) +EVALUATION_ERROR_MESSAGE: StaticSchema = (3, n0, _EEM, 0) -GET_BROWSER_SESSION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#GetBrowserSession"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/browsers/{browserIdentifier}/sessions/get", - "code": 200, - } - ), - ) - ], -) +EVALUATOR_ARN: StaticSchema = (3, n0, _EA, 0) -KEY_PRESS_ARGUMENTS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#KeyPressArguments"), - members={ - "key": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "presses": {"target": INTEGER}, - }, -) +EVALUATOR_NAME: StaticSchema = (3, n0, _EN, 0) -KEY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#KeyList"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, -) +EVALUATION_EXPLANATION: StaticSchema = (3, n0, _EE, 4) -KEY_SHORTCUT_ARGUMENTS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#KeyShortcutArguments"), - members={ - "keys": { - "target": KEY_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +IGNORED_REFERENCE_INPUT_FIELD: StaticSchema = (3, n0, _IRIF, 0) -KEY_TYPE_ARGUMENTS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#KeyTypeArguments"), - members={ - "text": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +IGNORED_REFERENCE_INPUT_FIELDS: StaticSchema = ( + 16, + n0, + _IRIFg, + 0, + (_m,), + ((IGNORED_REFERENCE_INPUT_FIELD, 0),), ) -MOUSE_BUTTON = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#MouseButton"), - shape_type=ShapeType.ENUM, - members={ - "LEFT": {"target": UNIT}, - "RIGHT": {"target": UNIT}, - "MIDDLE": {"target": UNIT}, - }, -) +TOKEN_USAGE: StaticSchema = (18, n0, _TU, 0, (_iT, _oT, _tT), ((7, 0), (7, 0), (7, 0))) -MOUSE_CLICK_ARGUMENTS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#MouseClickArguments"), - members={ - "x": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "y": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "button": {"target": MOUSE_BUTTON}, - "clickCount": {"target": INTEGER}, - }, +EVALUATION_RESULT_CONTENT: StaticSchema = ( + 18, + n0, + _ERC, + 0, + (_eA, _eI, _eN, _ex, _con, _va, _la, _tU, _eMr, _eCr, _iRIF), + ( + (EVALUATOR_ARN, 1), + (EVALUATOR_ID, 1), + (EVALUATOR_NAME, 1), + (EVALUATION_EXPLANATION, 0), + (CONTEXT, 1), + (10, 0), + (3, 0), + (TOKEN_USAGE, 0), + (EVALUATION_ERROR_MESSAGE, 0), + (EVALUATION_ERROR_CODE, 0), + (IGNORED_REFERENCE_INPUT_FIELDS, 0), + ), ) -MOUSE_DRAG_ARGUMENTS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#MouseDragArguments"), - members={ - "endX": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "endY": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "startX": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "startY": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "button": {"target": MOUSE_BUTTON}, - }, +EVALUATION_RESULTS: StaticSchema = ( + 16, + n0, + _ER, + 0, + (_m,), + ((EVALUATION_RESULT_CONTENT, 0),), +) + +EVALUATE_OUTPUT: StaticSchema = ( + 18, + n0, + _EO, + {_sSI: _cERo, _smith: None}, + (_eRv,), + ((EVALUATION_RESULTS, 1),), +) + +EVALUATE: StaticOperationSchema = ( + 23, + n0, + _Ev, + { + _smithy: MappingProxyType( + {"method": "POST", "uri": "/evaluations/evaluate/{evaluatorId}"} + ) + }, + EVALUATE_INPUT, + EVALUATE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + DUPLICATE_ID_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -MOUSE_MOVE_ARGUMENTS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#MouseMoveArguments"), - members={ - "x": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "y": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +GET_AB_TEST_INPUT: StaticSchema = ( + 18, + n0, + _GABTI, + {_sSI: _cGABTR, _smit: None}, + (_aTI,), + ((AB_TEST_ID, 9),), +) + +ERROR_DETAILS_LIST: StaticSchema = (16, n0, _EDL, 0, (_m,), ((3, 0),)) + +GET_AB_TEST_OUTPUT: StaticSchema = ( + 18, + n0, + _GABTO, + {_sSI: _cGABTRo, _smith: None}, + ( + _aTI, + _aTA, + _n, + _d, + _st, + _eS, + _gA, + _var, + _gF, + _eCv, + _rA, + _cRI, + _eD, + _sAt, + _sAto, + _mDEA, + _cA, + _uA, + _resul, + ), + ( + (AB_TEST_ID, 1), + (AB_TEST_ARN, 1), + (AB_TEST_NAME, 1), + (AB_TEST_DESCRIPTION, 0), + (AB_TEST_STATUS, 1), + (AB_TEST_EXECUTION_STATUS, 1), + (GATEWAY_ARN, 1), + (VARIANT_LIST, 1), + (GATEWAY_FILTER, 0), + (AB_TEST_EVALUATION_CONFIG, 1), + (ROLE_ARN, 0), + (3, 0), + (ERROR_DETAILS_LIST, 0), + (4, 0), + (4, 0), + (4, 0), + (4, 1), + (4, 1), + (AB_TEST_RESULTS, 0), + ), ) -MOUSE_SCROLL_ARGUMENTS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#MouseScrollArguments"), - members={ - "x": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "y": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "deltaX": {"target": INTEGER}, - "deltaY": {"target": INTEGER}, - }, +GET_AB_TEST: StaticOperationSchema = ( + 23, + n0, + _GABT, + {_smithy: MappingProxyType({"method": "GET", "uri": "/ab-tests/{abTestId}"})}, + GET_AB_TEST_INPUT, + GET_AB_TEST_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -SCREENSHOT_FORMAT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ScreenshotFormat"), - shape_type=ShapeType.ENUM, - members={"PNG": {"target": UNIT}}, +GET_BATCH_EVALUATION_INPUT: StaticSchema = ( + 18, + n0, + _GBEI, + {_sSI: _cGBER, _smit: None}, + (_bEI,), + ((BATCH_EVALUATION_ID, 9),), ) -SCREENSHOT_ARGUMENTS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ScreenshotArguments"), - members={"format": {"target": SCREENSHOT_FORMAT}}, -) +BATCH_EVALUATION_NAME: StaticSchema = (3, n0, _BEN, 0) -BROWSER_ACTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#BrowserAction"), - shape_type=ShapeType.UNION, - members={ - "mouseClick": {"target": MOUSE_CLICK_ARGUMENTS}, - "mouseMove": {"target": MOUSE_MOVE_ARGUMENTS}, - "mouseDrag": {"target": MOUSE_DRAG_ARGUMENTS}, - "mouseScroll": {"target": MOUSE_SCROLL_ARGUMENTS}, - "keyType": {"target": KEY_TYPE_ARGUMENTS}, - "keyPress": {"target": KEY_PRESS_ARGUMENTS}, - "keyShortcut": {"target": KEY_SHORTCUT_ARGUMENTS}, - "screenshot": {"target": SCREENSHOT_ARGUMENTS}, - }, -) +EVALUATION_STRING_LIST: StaticSchema = (16, n0, _ESL, 0, (_m,), ((3, 0),)) -INVOKE_BROWSER_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#InvokeBrowserInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#InvokeBrowserRequest", - ) - ], - members={ - "browserIdentifier": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "sessionId": { - "target": BROWSER_SESSION_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-browser-session-id", - ), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "action": { - "target": BROWSER_ACTION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +TRACE_ID_LIST: StaticSchema = (16, n0, _TIL, 0, (_m,), ((TRACE_ID, 0),)) -BROWSER_ACTION_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#BrowserActionStatus"), - shape_type=ShapeType.ENUM, - members={"SUCCESS": {"target": UNIT}, "FAILED": {"target": UNIT}}, +SESSION_TRACE_IDS: StaticSchema = ( + 18, + n0, + _STI, + 0, + (_sIe, _tIr), + ((3, 1), (TRACE_ID_LIST, 1)), ) -KEY_PRESS_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#KeyPressResult"), - members={ - "status": { - "target": BROWSER_ACTION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "error": {"target": STRING}, - }, +SESSION_TRACE_IDS_LIST: StaticSchema = ( + 16, + n0, + _STIL, + 0, + (_m,), + ((SESSION_TRACE_IDS, 0),), ) -KEY_SHORTCUT_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#KeyShortcutResult"), - members={ - "status": { - "target": BROWSER_ACTION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "error": {"target": STRING}, - }, +SESSION_FILTER_CONFIG: StaticSchema = ( + 18, + n0, + _SFCe, + 0, + (_sTt, _eT), + ((4, {_sF: _dt}), (4, {_sF: _dt})), ) -KEY_TYPE_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#KeyTypeResult"), - members={ - "status": { - "target": BROWSER_ACTION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "error": {"target": STRING}, - }, +CLOUD_WATCH_FILTER_CONFIG: StaticSchema = ( + 18, + n0, + _CWFC, + 0, + (_sIes, _tR, _sTI), + ( + (EVALUATION_STRING_LIST, 0), + (SESSION_FILTER_CONFIG, 0), + (SESSION_TRACE_IDS_LIST, 0), + ), ) -MOUSE_CLICK_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#MouseClickResult"), - members={ - "status": { - "target": BROWSER_ACTION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "error": {"target": STRING}, - }, -) +LOG_GROUP_NAME_PREFIX: StaticSchema = (3, n0, _LGNP, 0) -MOUSE_DRAG_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#MouseDragResult"), - members={ - "status": { - "target": BROWSER_ACTION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "error": {"target": STRING}, - }, +LOG_GROUP_NAME_PREFIX_LIST: StaticSchema = ( + 16, + n0, + _LGNPL, + 0, + (_m,), + ((LOG_GROUP_NAME_PREFIX, 0),), ) -MOUSE_MOVE_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#MouseMoveResult"), - members={ - "status": { - "target": BROWSER_ACTION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "error": {"target": STRING}, - }, -) +LOG_GROUP_NAME: StaticSchema = (3, n0, _LGN, 0) -MOUSE_SCROLL_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#MouseScrollResult"), - members={ - "status": { - "target": BROWSER_ACTION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "error": {"target": STRING}, - }, -) +LOG_GROUP_NAME_LIST: StaticSchema = (16, n0, _LGNL, 0, (_m,), ((LOG_GROUP_NAME, 0),)) -SCREENSHOT_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ScreenshotResult"), - members={ - "status": { - "target": BROWSER_ACTION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "error": {"target": STRING}, - "data": {"target": BLOB}, - }, +CLOUD_WATCH_LOGS_SOURCE: StaticSchema = ( + 18, + n0, + _CWLS, + 0, + (_sN, _lGN, _lGNP, _fCi), + ( + (EVALUATION_STRING_LIST, 1), + (LOG_GROUP_NAME_LIST, {_smithyap: ()}), + (LOG_GROUP_NAME_PREFIX_LIST, 0), + (CLOUD_WATCH_FILTER_CONFIG, 0), + ), ) -BROWSER_ACTION_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#BrowserActionResult"), - shape_type=ShapeType.UNION, - members={ - "mouseClick": {"target": MOUSE_CLICK_RESULT}, - "mouseMove": {"target": MOUSE_MOVE_RESULT}, - "mouseDrag": {"target": MOUSE_DRAG_RESULT}, - "mouseScroll": {"target": MOUSE_SCROLL_RESULT}, - "keyType": {"target": KEY_TYPE_RESULT}, - "keyPress": {"target": KEY_PRESS_RESULT}, - "keyShortcut": {"target": KEY_SHORTCUT_RESULT}, - "screenshot": {"target": SCREENSHOT_RESULT}, - }, +ONLINE_EVALUATION_CONFIG_SOURCE: StaticSchema = ( + 18, + n0, + _OECS, + 0, + (_oECA, _tR), + ((ONLINE_EVALUATION_CONFIG_ARN, 1), (SESSION_FILTER_CONFIG, 0)), ) -INVOKE_BROWSER_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#InvokeBrowserOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#InvokeBrowserResponse", - ) - ], - members={ - "result": { - "target": BROWSER_ACTION_RESULT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "sessionId": { - "target": BROWSER_SESSION_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-browser-session-id", - ), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - }, +DATA_SOURCE_CONFIG: StaticSchema = ( + 19, + n0, + _DSC, + 0, + (_cWL, _oECS), + ((CLOUD_WATCH_LOGS_SOURCE, 0), (ONLINE_EVALUATION_CONFIG_SOURCE, 0)), ) -INVOKE_BROWSER = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#InvokeBrowser"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/browsers/{browserIdentifier}/sessions/invoke", - "code": 200, - } - ), - ) - ], -) +BATCH_EVALUATION_DESCRIPTION: StaticSchema = (3, n0, _BED, 0) -MAX_RESULTS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#MaxResults"), - shape_type=ShapeType.INTEGER, -) +EVALUATOR_STATISTICS: StaticSchema = (18, n0, _ES, 0, (_aSv,), ((10, 0),)) + +EVALUATOR_SUMMARY: StaticSchema = ( + 18, + n0, + _ESv, + 0, + (_eI, _sta, _tEo, _tF), + ((3, 0), (EVALUATOR_STATISTICS, 0), (7, 0), (7, 0)), +) + +EVALUATOR_SUMMARY_LIST: StaticSchema = ( + 16, + n0, + _ESLv, + 0, + (_m,), + ((EVALUATOR_SUMMARY, 0),), +) + +EVALUATION_JOB_RESULTS: StaticSchema = ( + 18, + n0, + _EJR, + 0, + (_nOSC, _nOSIP, _nOSF, _tNOS, _nOSI, _eSv), + ((7, 0), (7, 0), (7, 0), (7, 0), (7, 0), (EVALUATOR_SUMMARY_LIST, 0)), +) + +EVALUATOR: StaticSchema = (18, n0, _Eva, 0, (_eI,), ((EVALUATOR_ID, 1),)) + +EVALUATOR_LIST: StaticSchema = (16, n0, _EL, 0, (_m,), ((EVALUATOR, 0),)) -NEXT_TOKEN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#NextToken"), shape_type=ShapeType.STRING +EXECUTION_SUMMARY_AFFECTED_SESSION: StaticSchema = ( + 18, + n0, + _ESAS, + 0, + (_sIe, _aTp, _fO), + ((3, 1), (3, 1), (3, 1)), +) + +EXECUTION_SUMMARY_AFFECTED_SESSION_LIST: StaticSchema = ( + 16, + n0, + _ESASL, + 0, + (_m,), + ((EXECUTION_SUMMARY_AFFECTED_SESSION, 0),), ) -LIST_BROWSER_SESSIONS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ListBrowserSessionsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#ListBrowserSessionsRequest", - ) - ], - members={ - "browserIdentifier": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "maxResults": {"target": MAX_RESULTS}, - "nextToken": {"target": NEXT_TOKEN}, - "status": {"target": BROWSER_SESSION_STATUS}, - }, +EXECUTION_SUMMARY_CLUSTER: StaticSchema = ( + 18, + n0, + _ESC, + 0, + (_cIl, _n, _d, _aSC, _aSf), + ((7, 1), (3, 1), (3, 1), (7, 1), (EXECUTION_SUMMARY_AFFECTED_SESSION_LIST, 1)), ) -BROWSER_SESSION_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#BrowserSessionSummary"), - members={ - "browserIdentifier": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "sessionId": { - "target": BROWSER_SESSION_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": {"target": NAME}, - "status": { - "target": BROWSER_SESSION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastUpdatedAt": {"target": DATE_TIMESTAMP}, - }, +EXECUTION_SUMMARY_CLUSTER_LIST: StaticSchema = ( + 16, + n0, + _ESCL, + 0, + (_m,), + ((EXECUTION_SUMMARY_CLUSTER, 0),), ) -BROWSER_SESSION_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#BrowserSessionSummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": BROWSER_SESSION_SUMMARY}}, +EXECUTION_SUMMARY_CLUSTERING_RESULT_CONTENT: StaticSchema = ( + 18, + n0, + _ESCRC, + 0, + (_eSx,), + ((EXECUTION_SUMMARY_CLUSTER_LIST, 1),), ) -LIST_BROWSER_SESSIONS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ListBrowserSessionsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#ListBrowserSessionsResponse", - ) - ], - members={ - "items": { - "target": BROWSER_SESSION_SUMMARIES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": NEXT_TOKEN}, - }, +ROOT_CAUSE_CLUSTER: StaticSchema = ( + 18, + n0, + _RCC, + 0, + (_cIl, _n, _rC, _r, _aSC, _aSf), + ((7, 1), (3, 1), (3, 1), (3, 1), (7, 1), (AFFECTED_SESSION_LIST, 1)), ) -LIST_BROWSER_SESSIONS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#ListBrowserSessions"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/browsers/{browserIdentifier}/sessions/list", - "code": 200, - } - ), - ) - ], +ROOT_CAUSE_CLUSTER_LIST: StaticSchema = ( + 16, + n0, + _RCCL, + 0, + (_m,), + ((ROOT_CAUSE_CLUSTER, 0),), ) -START_BROWSER_SESSION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#StartBrowserSessionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#StartBrowserSessionRequest", - ) - ], - members={ - "traceId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="X-Amzn-Trace-Id") - ], - }, - "traceParent": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="traceparent") - ], - }, - "browserIdentifier": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "name": {"target": NAME}, - "sessionTimeoutSeconds": { - "target": BROWSER_SESSION_TIMEOUT, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=3600)], - }, - "viewPort": {"target": VIEW_PORT}, - "extensions": {"target": BROWSER_EXTENSIONS}, - "profileConfiguration": {"target": BROWSER_PROFILE_CONFIGURATION}, - "proxyConfiguration": {"target": PROXY_CONFIGURATION}, - "enterprisePolicies": {"target": BROWSER_ENTERPRISE_POLICIES}, - "certificates": {"target": CERTIFICATES}, - "filesystemConfigurations": {"target": TOOLS_FILE_SYSTEM_CONFIGURATIONS}, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - }, -) +FAILURE_SUB_CATEGORY_CLUSTER: StaticSchema = ( + 18, + n0, + _FSCC, + 0, + (_cIl, _n, _d, _aSC, _rCo), + ((7, 1), (3, 1), (3, 1), (7, 1), (ROOT_CAUSE_CLUSTER_LIST, 1)), +) + +FAILURE_SUB_CATEGORY_CLUSTER_LIST: StaticSchema = ( + 16, + n0, + _FSCCL, + 0, + (_m,), + ((FAILURE_SUB_CATEGORY_CLUSTER, 0),), +) + +FAILURE_CATEGORY_CLUSTER: StaticSchema = ( + 18, + n0, + _FCC, + 0, + (_cIl, _n, _d, _aSC, _sCu), + ((7, 1), (3, 1), (3, 1), (7, 1), (FAILURE_SUB_CATEGORY_CLUSTER_LIST, 1)), +) + +FAILURE_CATEGORY_CLUSTER_LIST: StaticSchema = ( + 16, + n0, + _FCCL, + 0, + (_m,), + ((FAILURE_CATEGORY_CLUSTER, 0),), +) + +FAILURE_ANALYSIS_RESULT_CONTENT: StaticSchema = ( + 18, + n0, + _FARC, + 0, + (_fa,), + ((FAILURE_CATEGORY_CLUSTER_LIST, 1),), +) -START_BROWSER_SESSION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#StartBrowserSessionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#StartBrowserSessionResponse", - ) - ], - members={ - "browserIdentifier": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "sessionId": { - "target": BROWSER_SESSION_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "streams": {"target": BROWSER_SESSION_STREAM}, - }, -) +INSIGHT_ID: StaticSchema = (3, n0, _II, 0) + +INSIGHT: StaticSchema = (18, n0, _I, 0, (_iI,), ((INSIGHT_ID, 1),)) + +INSIGHT_LIST: StaticSchema = (16, n0, _IL, 0, (_m,), ((INSIGHT, 0),)) + +KMS_KEY_ARN: StaticSchema = (3, n0, _KKA, 0) -START_BROWSER_SESSION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#StartBrowserSession"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PUT", - "uri": "/browsers/{browserIdentifier}/sessions/start", - "code": 200, - } - ), - ) - ], +OPTIONAL_LOG_GROUP_NAME: StaticSchema = (3, n0, _OLGN, 0) + +LOG_STREAM_NAME: StaticSchema = (3, n0, _LSN, 0) + +METRICS_NAMESPACE: StaticSchema = (3, n0, _MNe, 0) + +RESULT_DESTINATION: StaticSchema = ( + 14, + n0, + _RD, + 0, + (_DLG, _SLG), + ((-1, {_sVm: _DLG}), (-1, {_sVm: _SLG})), +) + +CLOUD_WATCH_OUTPUT_CONFIG: StaticSchema = ( + 18, + n0, + _CWOC, + 0, + (_lGNo, _lSN, _mNe, _rD), + ( + (OPTIONAL_LOG_GROUP_NAME, {_smithyap: _v}), + (LOG_STREAM_NAME, {_smithyap: _v}), + (METRICS_NAMESPACE, 0), + (RESULT_DESTINATION, {_smithyap: _DLG}), + ), ) -STOP_BROWSER_SESSION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#StopBrowserSessionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#StopBrowserSessionRequest", - ) - ], - members={ - "traceId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="X-Amzn-Trace-Id") - ], - }, - "traceParent": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="traceparent") - ], - }, - "browserIdentifier": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "sessionId": { - "target": BROWSER_SESSION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="sessionId"), - ], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - }, +OUTPUT_CONFIG: StaticSchema = ( + 19, + n0, + _OC, + 0, + (_cWC,), + ((CLOUD_WATCH_OUTPUT_CONFIG, 0),), +) + +USER_INTENT_LIST: StaticSchema = (16, n0, _UIL, 0, (_m,), ((3, 0),)) + +USER_INTENT_AFFECTED_SESSION: StaticSchema = ( + 18, + n0, + _UIAS, + 0, + (_sIe, _uM), + ((3, 1), (USER_INTENT_LIST, 1)), +) + +USER_INTENT_AFFECTED_SESSION_LIST: StaticSchema = ( + 16, + n0, + _UIASL, + 0, + (_m,), + ((USER_INTENT_AFFECTED_SESSION, 0),), +) + +USER_INTENT_CLUSTER: StaticSchema = ( + 18, + n0, + _UIC, + 0, + (_cIl, _n, _d, _aSC, _aSf), + ((7, 1), (3, 1), (3, 1), (7, 1), (USER_INTENT_AFFECTED_SESSION_LIST, 1)), +) + +USER_INTENT_CLUSTER_LIST: StaticSchema = ( + 16, + n0, + _UICL, + 0, + (_m,), + ((USER_INTENT_CLUSTER, 0),), +) + +USER_INTENT_CLUSTERING_RESULT_CONTENT: StaticSchema = ( + 18, + n0, + _UICRC, + 0, + (_uIse,), + ((USER_INTENT_CLUSTER_LIST, 1),), +) + +GET_BATCH_EVALUATION_OUTPUT: StaticSchema = ( + 18, + n0, + _GBEO, + {_sSI: _cGBERo, _smith: None}, + ( + _bEI, + _bEA, + _bEN, + _st, + _cA, + _ev, + _in, + _dSC, + _oC, + _eRv, + _fAR, + _uIR, + _eSR, + _eD, + _d, + _uA, + _kKA, + ), + ( + (BATCH_EVALUATION_ID, 1), + (BATCH_EVALUATION_ARN, 1), + (BATCH_EVALUATION_NAME, 1), + (BATCH_EVALUATION_STATUS, 1), + (4, {_sF: _dt, _s: None}), + (EVALUATOR_LIST, 0), + (INSIGHT_LIST, 0), + (DATA_SOURCE_CONFIG, 0), + (OUTPUT_CONFIG, 0), + (EVALUATION_JOB_RESULTS, 0), + (FAILURE_ANALYSIS_RESULT_CONTENT, 0), + (USER_INTENT_CLUSTERING_RESULT_CONTENT, 0), + (EXECUTION_SUMMARY_CLUSTERING_RESULT_CONTENT, 0), + (ERROR_DETAILS_LIST, 0), + (BATCH_EVALUATION_DESCRIPTION, 0), + (4, {_sF: _dt}), + (KMS_KEY_ARN, 0), + ), ) -STOP_BROWSER_SESSION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#StopBrowserSessionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#StopBrowserSessionResponse", - ) - ], - members={ - "browserIdentifier": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "sessionId": { - "target": BROWSER_SESSION_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastUpdatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +GET_BATCH_EVALUATION: StaticOperationSchema = ( + 23, + n0, + _GBE, + { + _smithy: MappingProxyType( + {"method": "GET", "uri": "/evaluations/batch-evaluate/{batchEvaluationId}"} + ) + }, + GET_BATCH_EVALUATION_INPUT, + GET_BATCH_EVALUATION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -STOP_BROWSER_SESSION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#StopBrowserSession"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PUT", - "uri": "/browsers/{browserIdentifier}/sessions/stop", - "code": 200, - } - ), - ) - ], +GET_RECOMMENDATION_INPUT: StaticSchema = ( + 18, + n0, + _GRI, + {_sSI: _cGRR, _smit: None}, + (_rI,), + ((RECOMMENDATION_ID, 9),), ) -AUTOMATION_STREAM_UPDATE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#AutomationStreamUpdate"), - members={"streamStatus": {"target": AUTOMATION_STREAM_STATUS}}, -) +RECOMMENDATION_DESCRIPTION: StaticSchema = (3, n0, _RDe, 0) -STREAM_UPDATE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#StreamUpdate"), - shape_type=ShapeType.UNION, - members={"automationStreamUpdate": {"target": AUTOMATION_STREAM_UPDATE}}, -) +RECOMMENDATION_NAME: StaticSchema = (3, n0, _RN, 0) -UPDATE_BROWSER_STREAM_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#UpdateBrowserStreamInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#UpdateBrowserStreamRequest", - ) - ], - members={ - "browserIdentifier": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "sessionId": { - "target": BROWSER_SESSION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="sessionId"), - ], - }, - "streamUpdate": { - "target": STREAM_UPDATE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - }, -) +RECOMMENDATION_ARN: StaticSchema = (3, n0, _RAe, 0) -UPDATE_BROWSER_STREAM_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#UpdateBrowserStreamOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#UpdateBrowserStreamResponse", - ) - ], - members={ - "browserIdentifier": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "sessionId": { - "target": BROWSER_SESSION_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "streams": { - "target": BROWSER_SESSION_STREAM, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +RECOMMENDATION_EVALUATOR_REFERENCE: StaticSchema = ( + 18, + n0, + _RER, + 0, + (_eA,), + ((EVALUATOR_ARN, 1),), ) -UPDATE_BROWSER_STREAM = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#UpdateBrowserStream"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PUT", - "uri": "/browsers/{browserIdentifier}/sessions/streams/update", - "code": 200, - } - ), - ) - ], +RECOMMENDATION_EVALUATOR_LIST: StaticSchema = ( + 16, + n0, + _REL, + 0, + (_m,), + ((RECOMMENDATION_EVALUATOR_REFERENCE, 0),), ) -CAPACITY_PROVIDER_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#CapacityProviderId"), - shape_type=ShapeType.STRING, +RECOMMENDATION_EVALUATION_CONFIG: StaticSchema = ( + 18, + n0, + _REC, + 0, + (_ev,), + ((RECOMMENDATION_EVALUATOR_LIST, 1),), ) -DELETE_CAPACITY_PROVIDER_SESSION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#DeleteCapacityProviderSessionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#DeleteCapacityProviderSessionRequest", - ) - ], - members={ - "capacityProviderId": { - "target": CAPACITY_PROVIDER_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "sessionId": { - "target": SESSION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) +CONFIGURATION_BUNDLE_VERSION_ID: StaticSchema = (3, n0, _CBVI, 0) -CAPACITY_PROVIDER_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#CapacityProviderArn"), - shape_type=ShapeType.STRING, +SYSTEM_PROMPT_CONFIGURATION_BUNDLE: StaticSchema = ( + 18, + n0, + _SPCB, + 0, + (_bAu, _vI, _sPJP), + ((CONFIGURATION_BUNDLE_ARN, 1), (CONFIGURATION_BUNDLE_VERSION_ID, 1), (3, 1)), ) -CAPACITY_PROVIDER_SESSION_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#CapacityProviderSessionStatus"), - shape_type=ShapeType.ENUM, - members={ - "PROVISIONING": {"target": UNIT}, - "DEPROVISIONING": {"target": UNIT}, - "ACTIVE": {"target": UNIT}, - "DELETING": {"target": UNIT}, - "DELETED": {"target": UNIT}, - "STOPPED": {"target": UNIT}, - }, -) +SYSTEM_PROMPT_TEXT: StaticSchema = (3, n0, _SPT, 4) -DELETE_CAPACITY_PROVIDER_SESSION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#DeleteCapacityProviderSessionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#DeleteCapacityProviderSessionResponse", - ) - ], - members={ - "capacityProviderArn": { - "target": CAPACITY_PROVIDER_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "sessionId": { - "target": SESSION_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": CAPACITY_PROVIDER_SESSION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +SYSTEM_PROMPT_CONFIG: StaticSchema = ( + 19, + n0, + _SPC, + 0, + (_te, _cB), + ((SYSTEM_PROMPT_TEXT, 0), (SYSTEM_PROMPT_CONFIGURATION_BUNDLE, 0)), ) -DELETE_CAPACITY_PROVIDER_SESSION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#DeleteCapacityProviderSession"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/capacity-providers/{capacityProviderId}/sessions/{sessionId}", - "code": 202, - } - ), - ) - ], +SYSTEM_PROMPT_RECOMMENDATION_CONFIG: StaticSchema = ( + 18, + n0, + _SPRC, + 0, + (_sPy, _aTg, _eCv), + ( + (SYSTEM_PROMPT_CONFIG, 1), + (AGENT_TRACES_CONFIG, 1), + (RECOMMENDATION_EVALUATION_CONFIG, 0), + ), ) -CODE_INTERPRETER_SESSION_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#CodeInterpreterSessionId"), - shape_type=ShapeType.STRING, +RECOMMENDATION_TOOL_NAME: StaticSchema = (3, n0, _RTN, 0) + +CONFIGURATION_BUNDLE_TOOL_ENTRY: StaticSchema = ( + 18, + n0, + _CBTE, + 0, + (_tNo, _tDJP), + ((RECOMMENDATION_TOOL_NAME, 1), (3, 1)), +) + +CONFIGURATION_BUNDLE_TOOL_ENTRY_LIST: StaticSchema = ( + 16, + n0, + _CBTEL, + 0, + (_m,), + ((CONFIGURATION_BUNDLE_TOOL_ENTRY, 0),), +) + +TOOL_DESCRIPTION_CONFIGURATION_BUNDLE: StaticSchema = ( + 18, + n0, + _TDCB, + 0, + (_bAu, _vI, _to), + ( + (CONFIGURATION_BUNDLE_ARN, 1), + (CONFIGURATION_BUNDLE_VERSION_ID, 1), + (CONFIGURATION_BUNDLE_TOOL_ENTRY_LIST, 1), + ), ) -GET_CODE_INTERPRETER_SESSION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#GetCodeInterpreterSessionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#GetCodeInterpreterSessionRequest", - ) - ], - members={ - "codeInterpreterIdentifier": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "sessionId": { - "target": CODE_INTERPRETER_SESSION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="sessionId"), - ], - }, - }, +TOOL_DESCRIPTION_TEXT: StaticSchema = (3, n0, _TDT, 4) + +TOOL_DESCRIPTION_CONFIG: StaticSchema = ( + 19, + n0, + _TDC, + 0, + (_te,), + ((TOOL_DESCRIPTION_TEXT, 0),), +) + +TOOL_DESCRIPTION_INPUT: StaticSchema = ( + 18, + n0, + _TDI, + 0, + (_tNo, _tD), + ((RECOMMENDATION_TOOL_NAME, 1), (TOOL_DESCRIPTION_CONFIG, 1)), +) + +TOOL_DESCRIPTION_LIST: StaticSchema = ( + 16, + n0, + _TDL, + 0, + (_m,), + ((TOOL_DESCRIPTION_INPUT, 0),), +) + +TOOL_DESCRIPTION_TEXT_INPUT: StaticSchema = ( + 18, + n0, + _TDTI, + 0, + (_to,), + ((TOOL_DESCRIPTION_LIST, 1),), +) + +TOOL_DESCRIPTION_SOURCE: StaticSchema = ( + 19, + n0, + _TDS, + 0, + (_tDT, _cB), + ((TOOL_DESCRIPTION_TEXT_INPUT, 0), (TOOL_DESCRIPTION_CONFIGURATION_BUNDLE, 0)), +) + +TOOL_DESCRIPTION_RECOMMENDATION_CONFIG: StaticSchema = ( + 18, + n0, + _TDRC, + 0, + (_tD, _aTg), + ((TOOL_DESCRIPTION_SOURCE, 1), (AGENT_TRACES_CONFIG, 1)), +) + +RECOMMENDATION_CONFIG: StaticSchema = ( + 19, + n0, + _RCec, + 0, + (_sPRC, _tDRC), + ( + (SYSTEM_PROMPT_RECOMMENDATION_CONFIG, 0), + (TOOL_DESCRIPTION_RECOMMENDATION_CONFIG, 0), + ), ) -CODE_INTERPRETER_SESSION_TIMEOUT = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#CodeInterpreterSessionTimeout"), - shape_type=ShapeType.INTEGER, +RECOMMENDATION_RESULT_CONFIGURATION_BUNDLE: StaticSchema = ( + 18, + n0, + _RRCB, + 0, + (_bAu, _vI), + ((CONFIGURATION_BUNDLE_ARN, 1), (CONFIGURATION_BUNDLE_VERSION_ID, 1)), ) -CODE_INTERPRETER_SESSION_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#CodeInterpreterSessionStatus"), - shape_type=ShapeType.ENUM, - members={"READY": {"target": UNIT}, "TERMINATED": {"target": UNIT}}, -) +RECOMMENDATION_ERROR_CODE: StaticSchema = (3, n0, _RECe, 0) -GET_CODE_INTERPRETER_SESSION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#GetCodeInterpreterSessionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#GetCodeInterpreterSessionResponse", - ) - ], - members={ - "codeInterpreterIdentifier": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "sessionId": { - "target": CODE_INTERPRETER_SESSION_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": {"target": NAME}, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "sessionTimeoutSeconds": {"target": CODE_INTERPRETER_SESSION_TIMEOUT}, - "status": {"target": CODE_INTERPRETER_SESSION_STATUS}, - "certificates": {"target": CERTIFICATES}, - "filesystemConfigurations": {"target": TOOLS_FILE_SYSTEM_CONFIGURATIONS}, - }, -) +RECOMMENDATION_ERROR_MESSAGE: StaticSchema = (3, n0, _REM, 0) -GET_CODE_INTERPRETER_SESSION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#GetCodeInterpreterSession"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/code-interpreters/{codeInterpreterIdentifier}/sessions/get", - "code": 200, - } - ), - ) - ], -) +RECOMMENDATION_EXPLANATION: StaticSchema = (3, n0, _RE, 0) -LIST_CODE_INTERPRETER_SESSIONS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ListCodeInterpreterSessionsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#ListCodeInterpreterSessionsRequest", - ) - ], - members={ - "codeInterpreterIdentifier": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "maxResults": {"target": MAX_RESULTS}, - "nextToken": {"target": NEXT_TOKEN}, - "status": {"target": CODE_INTERPRETER_SESSION_STATUS}, - }, +SYSTEM_PROMPT_RECOMMENDATION_RESULT: StaticSchema = ( + 18, + n0, + _SPRR, + 0, + (_rSP, _cB, _ex, _eCr, _eMr), + ( + (SYSTEM_PROMPT_TEXT, 0), + (RECOMMENDATION_RESULT_CONFIGURATION_BUNDLE, 0), + (RECOMMENDATION_EXPLANATION, 0), + (RECOMMENDATION_ERROR_CODE, 0), + (RECOMMENDATION_ERROR_MESSAGE, 0), + ), ) -CODE_INTERPRETER_SESSION_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#CodeInterpreterSessionSummary"), - members={ - "codeInterpreterIdentifier": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "sessionId": { - "target": CODE_INTERPRETER_SESSION_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": {"target": NAME}, - "status": { - "target": CODE_INTERPRETER_SESSION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastUpdatedAt": {"target": DATE_TIMESTAMP}, - }, +TOOL_DESCRIPTION_OUTPUT: StaticSchema = ( + 18, + n0, + _TDO, + 0, + (_tNo, _rTD, _ex), + ( + (RECOMMENDATION_TOOL_NAME, 1), + (TOOL_DESCRIPTION_TEXT, 0), + (RECOMMENDATION_EXPLANATION, 0), + ), ) -CODE_INTERPRETER_SESSION_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#CodeInterpreterSessionSummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": CODE_INTERPRETER_SESSION_SUMMARY}}, +TOOL_DESCRIPTION_RESULT_LIST: StaticSchema = ( + 16, + n0, + _TDRL, + 0, + (_m,), + ((TOOL_DESCRIPTION_OUTPUT, 0),), +) + +TOOL_DESCRIPTION_RECOMMENDATION_RESULT: StaticSchema = ( + 18, + n0, + _TDRR, + 0, + (_to, _cB, _eCr, _eMr), + ( + (TOOL_DESCRIPTION_RESULT_LIST, 0), + (RECOMMENDATION_RESULT_CONFIGURATION_BUNDLE, 0), + (RECOMMENDATION_ERROR_CODE, 0), + (RECOMMENDATION_ERROR_MESSAGE, 0), + ), ) -LIST_CODE_INTERPRETER_SESSIONS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ListCodeInterpreterSessionsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#ListCodeInterpreterSessionsResponse", - ) - ], - members={ - "items": { - "target": CODE_INTERPRETER_SESSION_SUMMARIES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": NEXT_TOKEN}, - }, +RECOMMENDATION_RESULT: StaticSchema = ( + 19, + n0, + _RR, + 0, + (_sPRR, _tDRR), + ( + (SYSTEM_PROMPT_RECOMMENDATION_RESULT, 0), + (TOOL_DESCRIPTION_RECOMMENDATION_RESULT, 0), + ), ) -LIST_CODE_INTERPRETER_SESSIONS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#ListCodeInterpreterSessions"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/code-interpreters/{codeInterpreterIdentifier}/sessions/list", - "code": 200, - } - ), - ) - ], +RECOMMENDATION_TYPE: StaticSchema = ( + 14, + n0, + _RT, + 0, + (_SPR, _TDR), + ((-1, {_sVm: _SPR}), (-1, {_sVm: _TDR})), +) + +GET_RECOMMENDATION_OUTPUT: StaticSchema = ( + 18, + n0, + _GRO, + {_sSI: _cGRRo, _smith: None}, + (_rI, _rAe, _n, _d, _ty, _rCe, _st, _cA, _uA, _rR, _kKA), + ( + (RECOMMENDATION_ID, 1), + (RECOMMENDATION_ARN, 1), + (RECOMMENDATION_NAME, 1), + (RECOMMENDATION_DESCRIPTION, 0), + (RECOMMENDATION_TYPE, 1), + (RECOMMENDATION_CONFIG, 1), + (RECOMMENDATION_STATUS, 1), + (4, {_sF: _dt, _s: None}), + (4, {_sF: _dt, _s: None}), + (RECOMMENDATION_RESULT, 0), + (KMS_KEY_ARN, 0), + ), ) -START_CODE_INTERPRETER_SESSION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#StartCodeInterpreterSessionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#StartCodeInterpreterSessionRequest", +GET_RECOMMENDATION: StaticOperationSchema = ( + 23, + n0, + _GR, + { + _smithy: MappingProxyType( + {"method": "GET", "uri": "/recommendations/{recommendationId}"} ) - ], - members={ - "traceId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="X-Amzn-Trace-Id") - ], - }, - "traceParent": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="traceparent") - ], - }, - "codeInterpreterIdentifier": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "name": {"target": NAME}, - "sessionTimeoutSeconds": { - "target": CODE_INTERPRETER_SESSION_TIMEOUT, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=900)], - }, - "certificates": {"target": CERTIFICATES}, - "filesystemConfigurations": {"target": TOOLS_FILE_SYSTEM_CONFIGURATIONS}, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, }, + GET_RECOMMENDATION_INPUT, + GET_RECOMMENDATION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -START_CODE_INTERPRETER_SESSION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#StartCodeInterpreterSessionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#StartCodeInterpreterSessionResponse", - ) - ], - members={ - "codeInterpreterIdentifier": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "sessionId": { - "target": CODE_INTERPRETER_SESSION_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +LIST_AB_TESTS_INPUT: StaticSchema = ( + 18, + n0, + _LABTI, + {_sSI: _cLABTR, _smit: None}, + (_mR, _nT), + ((7, {_sQ: _mR}), (3, {_sQ: _nT})), +) + +LIST_AB_TESTS_OUTPUT: StaticSchema = ( + 18, + n0, + _LABTO, + {_sSI: _cLABTRo, _smith: None}, + (_aTb, _nT), + ((AB_TEST_SUMMARY_LIST, 1), (3, 0)), +) + +LIST_AB_TESTS: StaticOperationSchema = ( + 23, + n0, + _LABT, + {_smithy: MappingProxyType({"method": "GET", "uri": "/ab-tests"})}, + LIST_AB_TESTS_INPUT, + LIST_AB_TESTS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -START_CODE_INTERPRETER_SESSION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#StartCodeInterpreterSession"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PUT", - "uri": "/code-interpreters/{codeInterpreterIdentifier}/sessions/start", - "code": 200, - } - ), - ) - ], +LIST_BATCH_EVALUATIONS_INPUT: StaticSchema = ( + 18, + n0, + _LBEI, + {_sSI: _cLBER, _smit: None}, + (_mR, _nT), + ((7, {_sQ: _mR}), (3, {_sQ: _nT})), +) + +BATCH_EVALUATION_SUMMARY: StaticSchema = ( + 18, + n0, + _BESa, + 0, + (_bEI, _bEA, _bEN, _st, _cA, _d, _ev, _in, _eRv, _eD, _kKA, _uA), + ( + (BATCH_EVALUATION_ID, 1), + (BATCH_EVALUATION_ARN, 1), + (BATCH_EVALUATION_NAME, 1), + (BATCH_EVALUATION_STATUS, 1), + (4, {_sF: _dt, _s: None}), + (BATCH_EVALUATION_DESCRIPTION, 0), + (EVALUATOR_LIST, 0), + (INSIGHT_LIST, 0), + (EVALUATION_JOB_RESULTS, 0), + (ERROR_DETAILS_LIST, 0), + (KMS_KEY_ARN, 0), + (4, {_sF: _dt}), + ), ) -STOP_CODE_INTERPRETER_SESSION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#StopCodeInterpreterSessionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#StopCodeInterpreterSessionRequest", - ) - ], - members={ - "traceId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="X-Amzn-Trace-Id") - ], - }, - "traceParent": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="traceparent") - ], - }, - "codeInterpreterIdentifier": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "sessionId": { - "target": CODE_INTERPRETER_SESSION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="sessionId"), - ], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - }, +BATCH_EVALUATION_SUMMARY_LIST: StaticSchema = ( + 16, + n0, + _BESL, + 0, + (_m,), + ((BATCH_EVALUATION_SUMMARY, 0),), +) + +LIST_BATCH_EVALUATIONS_OUTPUT: StaticSchema = ( + 18, + n0, + _LBEO, + {_sSI: _cLBERo, _smith: None}, + (_bEa, _nT), + ((BATCH_EVALUATION_SUMMARY_LIST, 1), (3, 0)), +) + +LIST_BATCH_EVALUATIONS: StaticOperationSchema = ( + 23, + n0, + _LBE, + { + _smithy: MappingProxyType( + {"method": "GET", "uri": "/evaluations/batch-evaluate"} + ) + }, + LIST_BATCH_EVALUATIONS_INPUT, + LIST_BATCH_EVALUATIONS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -STOP_CODE_INTERPRETER_SESSION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#StopCodeInterpreterSessionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#StopCodeInterpreterSessionResponse", - ) - ], - members={ - "codeInterpreterIdentifier": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "sessionId": { - "target": CODE_INTERPRETER_SESSION_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastUpdatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +LIST_RECOMMENDATIONS_INPUT: StaticSchema = ( + 18, + n0, + _LRI, + {_sSI: _cLRR, _smit: None}, + (_mR, _nT, _sFt), + ((7, {_sQ: _mR}), (NEXT_TOKEN, {_sQ: _nT}), (RECOMMENDATION_STATUS, {_sQ: _st})), +) + +RECOMMENDATION_SUMMARY: StaticSchema = ( + 18, + n0, + _RSec, + 0, + (_rI, _rAe, _n, _d, _ty, _st, _cA, _uA), + ( + (RECOMMENDATION_ID, 1), + (RECOMMENDATION_ARN, 1), + (RECOMMENDATION_NAME, 1), + (RECOMMENDATION_DESCRIPTION, 0), + (RECOMMENDATION_TYPE, 1), + (RECOMMENDATION_STATUS, 1), + (4, {_sF: _dt, _s: None}), + (4, {_sF: _dt, _s: None}), + ), ) -STOP_CODE_INTERPRETER_SESSION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#StopCodeInterpreterSession"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PUT", - "uri": "/code-interpreters/{codeInterpreterIdentifier}/sessions/stop", - "code": 200, - } - ), - ) - ], +RECOMMENDATION_SUMMARY_LIST: StaticSchema = ( + 16, + n0, + _RSL, + 0, + (_m,), + ((RECOMMENDATION_SUMMARY, 0),), +) + +LIST_RECOMMENDATIONS_OUTPUT: StaticSchema = ( + 18, + n0, + _LRO, + {_sSI: _cLRRo, _smith: None}, + (_rS, _nT), + ((RECOMMENDATION_SUMMARY_LIST, 1), (NEXT_TOKEN, 0)), +) + +LIST_RECOMMENDATIONS: StaticOperationSchema = ( + 23, + n0, + _LR, + {_smithy: MappingProxyType({"method": "GET", "uri": "/recommendations"})}, + LIST_RECOMMENDATIONS_INPUT, + LIST_RECOMMENDATIONS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -REQUEST_URI = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#RequestUri"), shape_type=ShapeType.STRING +GROUND_TRUTH_TURN_INPUT: StaticSchema = (19, n0, _GTTI, 0, (_prom,), ((3, 0),)) + +GROUND_TRUTH_TURN: StaticSchema = ( + 18, + n0, + _GTT, + 0, + (_inp, _eR), + ((GROUND_TRUTH_TURN_INPUT, 0), (EVALUATION_CONTENT, 0)), +) + +GROUND_TRUTH_TURN_LIST: StaticSchema = ( + 16, + n0, + _GTTL, + 0, + (_m,), + ((GROUND_TRUTH_TURN, 0),), +) + +INLINE_GROUND_TRUTH: StaticSchema = ( + 18, + n0, + _IGT, + 0, + (_as, _eTx, _tu), + ( + (EVALUATION_CONTENT_LIST, 0), + (EVALUATION_EXPECTED_TRAJECTORY, 0), + (GROUND_TRUTH_TURN_LIST, 0), + ), ) -USER_ID_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#UserIdType"), shape_type=ShapeType.STRING +GROUND_TRUTH_SOURCE: StaticSchema = ( + 19, + n0, + _GTS, + 0, + (_inl,), + ((INLINE_GROUND_TRUTH, 0),), +) + +STRING_MAP: StaticSchema = (17, n0, _SM, 0, (_k, _va), ((3, 0), (3, 0))) + +SESSION_METADATA_SHAPE: StaticSchema = ( + 18, + n0, + _SMS, + 0, + (_sIe, _tSI, _gT, _met), + ((3, 1), (3, 0), (GROUND_TRUTH_SOURCE, 0), (STRING_MAP, 0)), +) + +SESSION_METADATA_LIST: StaticSchema = ( + 16, + n0, + _SMLe, + 0, + (_m,), + ((SESSION_METADATA_SHAPE, 0),), +) + +EVALUATION_METADATA: StaticSchema = ( + 19, + n0, + _EMv, + 0, + (_sMes,), + ((SESSION_METADATA_LIST, 0),), +) + +START_BATCH_EVALUATION_INPUT: StaticSchema = ( + 18, + n0, + _SBEI, + {_sSI: _cSBER, _smit: None}, + (_bEN, _ev, _in, _dSC, _cTl, _eMv, _tag, _kKA, _d, _oC), + ( + (BATCH_EVALUATION_NAME, 1), + (EVALUATOR_LIST, 0), + (INSIGHT_LIST, 0), + (DATA_SOURCE_CONFIG, 1), + (CLIENT_TOKEN, 2), + (EVALUATION_METADATA, 0), + (TAGS_MAP, 0), + (KMS_KEY_ARN, 0), + (BATCH_EVALUATION_DESCRIPTION, 0), + (OUTPUT_CONFIG, 0), + ), ) -USER_TOKEN_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#UserTokenType"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +START_BATCH_EVALUATION_OUTPUT: StaticSchema = ( + 18, + n0, + _SBEO, + {_sSI: _cSBERo, _smith: None}, + (_bEI, _bEA, _bEN, _ev, _in, _st, _cA, _oC, _tag, _kKA, _d), + ( + (BATCH_EVALUATION_ID, 1), + (BATCH_EVALUATION_ARN, 1), + (BATCH_EVALUATION_NAME, 1), + (EVALUATOR_LIST, 0), + (INSIGHT_LIST, 0), + (BATCH_EVALUATION_STATUS, 1), + (4, {_sF: _dt, _s: None}), + (OUTPUT_CONFIG, 0), + (TAGS_MAP, 0), + (KMS_KEY_ARN, 0), + (BATCH_EVALUATION_DESCRIPTION, 0), + ), ) -USER_IDENTIFIER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#UserIdentifier"), - shape_type=ShapeType.UNION, - members={ - "userToken": {"target": USER_TOKEN_TYPE}, - "userId": {"target": USER_ID_TYPE}, - }, +START_BATCH_EVALUATION: StaticOperationSchema = ( + 23, + n0, + _SBE, + { + _smithy: MappingProxyType( + {"method": "POST", "uri": "/evaluations/batch-evaluate", "code": 202} + ) + }, + START_BATCH_EVALUATION_INPUT, + START_BATCH_EVALUATION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -COMPLETE_RESOURCE_TOKEN_AUTH_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#CompleteResourceTokenAuthInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#CompleteResourceTokenAuthRequest", - ) - ], - members={ - "userIdentifier": { - "target": USER_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "sessionUri": { - "target": REQUEST_URI, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +START_RECOMMENDATION_INPUT: StaticSchema = ( + 18, + n0, + _SRI, + {_sSI: _cSRR, _smit: None}, + (_n, _d, _ty, _rCe, _kKA, _cTl, _tag), + ( + (RECOMMENDATION_NAME, 1), + (RECOMMENDATION_DESCRIPTION, 0), + (RECOMMENDATION_TYPE, 1), + (RECOMMENDATION_CONFIG, 1), + (KMS_KEY_ARN, 0), + (CLIENT_TOKEN, 2), + (TAGS_MAP, 0), + ), ) -COMPLETE_RESOURCE_TOKEN_AUTH_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#CompleteResourceTokenAuthOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#CompleteResourceTokenAuthResponse", - ) - ], -) - -COMPLETE_RESOURCE_TOKEN_AUTH = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#CompleteResourceTokenAuth"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"uri": "/identities/CompleteResourceTokenAuth", "method": "POST"} - ), - ) - ], +START_RECOMMENDATION_OUTPUT: StaticSchema = ( + 18, + n0, + _SRO, + {_sSI: _cSRRo, _smith: None}, + (_rI, _rAe, _n, _d, _ty, _rCe, _st, _cA, _uA), + ( + (RECOMMENDATION_ID, 1), + (RECOMMENDATION_ARN, 1), + (RECOMMENDATION_NAME, 1), + (RECOMMENDATION_DESCRIPTION, 0), + (RECOMMENDATION_TYPE, 1), + (RECOMMENDATION_CONFIG, 1), + (RECOMMENDATION_STATUS, 1), + (4, {_sF: _dt, _s: None}), + (4, {_sF: _dt, _s: None}), + ), ) -PATH_PATTERN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#PathPattern"), - shape_type=ShapeType.STRING, +START_RECOMMENDATION: StaticOperationSchema = ( + 23, + n0, + _SRt, + { + _smithy: MappingProxyType( + {"method": "POST", "uri": "/recommendations", "code": 202} + ) + }, + START_RECOMMENDATION_INPUT, + START_RECOMMENDATION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -TARGET_PATH_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#TargetPathList"), - shape_type=ShapeType.LIST, - members={"member": {"target": PATH_PATTERN}}, +STOP_BATCH_EVALUATION_INPUT: StaticSchema = ( + 18, + n0, + _SBEIt, + {_sSI: _cSBERom, _smit: None}, + (_bEI,), + ((BATCH_EVALUATION_ID, 9),), +) + +STOP_BATCH_EVALUATION_OUTPUT: StaticSchema = ( + 18, + n0, + _SBEOt, + {_sSI: _cSBERoma, _smith: None}, + (_bEI, _bEA, _st, _d), + ( + (BATCH_EVALUATION_ID, 1), + (BATCH_EVALUATION_ARN, 1), + (BATCH_EVALUATION_STATUS, 1), + (BATCH_EVALUATION_DESCRIPTION, 0), + ), ) -GATEWAY_FILTER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#GatewayFilter"), - members={"targetPaths": {"target": TARGET_PATH_LIST}}, +STOP_BATCH_EVALUATION: StaticOperationSchema = ( + 23, + n0, + _SBEt, + { + _smithy: MappingProxyType( + { + "method": "POST", + "uri": "/evaluations/batch-evaluate/{batchEvaluationId}/stop", + "code": 202, + } + ) + }, + STOP_BATCH_EVALUATION_INPUT, + STOP_BATCH_EVALUATION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -ROLE_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#RoleArn"), shape_type=ShapeType.STRING +UPDATE_AB_TEST_INPUT: StaticSchema = ( + 18, + n0, + _UABTI, + {_sSI: _cUABTR, _smit: None}, + (_aTI, _cTl, _n, _d, _var, _gF, _eCv, _rA, _eS), + ( + (AB_TEST_ID, 9), + (CLIENT_TOKEN, 2), + (AB_TEST_NAME, 0), + (AB_TEST_DESCRIPTION, 0), + (VARIANT_LIST, 0), + (GATEWAY_FILTER, 0), + (AB_TEST_EVALUATION_CONFIG, 0), + (ROLE_ARN, 0), + (AB_TEST_EXECUTION_STATUS, 0), + ), ) -TAG_KEY = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#TagKey"), shape_type=ShapeType.STRING +UPDATE_AB_TEST_OUTPUT: StaticSchema = ( + 18, + n0, + _UABTO, + {_sSI: _cUABTRo, _smith: None}, + (_aTI, _aTA, _st, _eS, _uA), + ( + (AB_TEST_ID, 1), + (AB_TEST_ARN, 1), + (AB_TEST_STATUS, 1), + (AB_TEST_EXECUTION_STATUS, 1), + (4, 1), + ), ) -TAG_VALUE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#TagValue"), shape_type=ShapeType.STRING +UPDATE_AB_TEST: StaticOperationSchema = ( + 23, + n0, + _UABT, + { + _smithy: MappingProxyType( + {"method": "PUT", "uri": "/ab-tests/{abTestId}", "code": 202} + ) + }, + UPDATE_AB_TEST_INPUT, + UPDATE_AB_TEST_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -TAGS_MAP = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#TagsMap"), - shape_type=ShapeType.MAP, - members={"key": {"target": TAG_KEY}, "value": {"target": TAG_VALUE}}, +CREDENTIAL_PROVIDER_NAME: StaticSchema = (3, n0, _CPN, 0) + +WORKLOAD_IDENTITY_TOKEN_TYPE: StaticSchema = (3, n0, _WITT, 4) + +GET_RESOURCE_API_KEY_INPUT: StaticSchema = ( + 18, + n0, + _GRAKI, + {_sSI: _cGRAKR, _smit: None}, + (_wIT, _rCPN), + ((WORKLOAD_IDENTITY_TOKEN_TYPE, 1), (CREDENTIAL_PROVIDER_NAME, 1)), +) + +API_KEY_TYPE: StaticSchema = (3, n0, _AKT, 4) + +GET_RESOURCE_API_KEY_OUTPUT: StaticSchema = ( + 18, + n0, + _GRAKO, + {_sSI: _cGRAKRo, _smith: None}, + (_aK,), + ((API_KEY_TYPE, 1),), +) + +GET_RESOURCE_API_KEY: StaticOperationSchema = ( + 23, + n0, + _GRAK, + {_smithy: MappingProxyType({"uri": "/identities/api-key", "method": "POST"})}, + GET_RESOURCE_API_KEY_INPUT, + GET_RESOURCE_API_KEY_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CONFIGURATION_BUNDLE_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#ConfigurationBundleArn"), - shape_type=ShapeType.STRING, -) +AUDIENCE_TYPE: StaticSchema = (3, n0, _AT, 0) -CONFIGURATION_BUNDLE_VERSION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#ConfigurationBundleVersion"), - shape_type=ShapeType.STRING, -) +AUDIENCES_LIST_TYPE: StaticSchema = (16, n0, _ALT, 0, (_m,), ((AUDIENCE_TYPE, 0),)) -CONFIGURATION_BUNDLE_REF = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ConfigurationBundleRef"), - members={ - "bundleArn": { - "target": CONFIGURATION_BUNDLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "bundleVersion": { - "target": CONFIGURATION_BUNDLE_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +CUSTOM_REQUEST_KEY_TYPE: StaticSchema = (3, n0, _CRKT, 0) -TARGET_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#TargetName"), shape_type=ShapeType.STRING -) +CUSTOM_REQUEST_VALUE_TYPE: StaticSchema = (3, n0, _CRVT, 4) -TARGET_REF = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#TargetRef"), - members={ - "name": { - "target": TARGET_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +CUSTOM_REQUEST_PARAMETERS_TYPE: StaticSchema = ( + 17, + n0, + _CRPT, + 0, + (_k, _va), + ((CUSTOM_REQUEST_KEY_TYPE, 0), (CUSTOM_REQUEST_VALUE_TYPE, 0)), ) -VARIANT_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#VariantConfiguration"), - members={ - "configurationBundle": {"target": CONFIGURATION_BUNDLE_REF}, - "target": {"target": TARGET_REF}, - }, -) +STATE: StaticSchema = (3, n0, _Sta, 4) -VARIANT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#Variant"), - members={ - "name": { - "target": VARIANT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "weight": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "variantConfiguration": { - "target": VARIANT_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +OAUTH2_FLOW_TYPE: StaticSchema = ( + 14, + n0, + _OFT, + 0, + (_UF_, _MM_, _OBOTE), + ((-1, {_sVm: _UF_}), (-1, {_sVm: _MM_}), (-1, {_sVm: _OBOTE})), ) -VARIANT_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#VariantList"), - shape_type=ShapeType.LIST, - members={"member": {"target": VARIANT}}, -) +RESOURCE_OAUTH2_RETURN_URL_TYPE: StaticSchema = (3, n0, _RORUT, 0) -CREATE_AB_TEST_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#CreateABTestInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#CreateABTestRequest", - ) - ], - members={ - "name": { - "target": AB_TEST_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": AB_TEST_DESCRIPTION}, - "gatewayArn": { - "target": GATEWAY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "variants": { - "target": VARIANT_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "gatewayFilter": {"target": GATEWAY_FILTER}, - "evaluationConfig": { - "target": AB_TEST_EVALUATION_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "roleArn": { - "target": ROLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "enableOnCreate": {"target": BOOLEAN}, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "tags": {"target": TAGS_MAP}, - }, -) +RESOURCE_TYPE: StaticSchema = (3, n0, _RTe, 0) -CREATE_AB_TEST_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#CreateABTestOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#CreateABTestResponse", - ) - ], - members={ - "abTestId": { - "target": AB_TEST_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "abTestArn": { - "target": AB_TEST_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": {"target": AB_TEST_NAME}, - "status": { - "target": AB_TEST_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "executionStatus": { - "target": AB_TEST_EXECUTION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +RESOURCES_LIST_TYPE: StaticSchema = (16, n0, _RLT, 0, (_m,), ((RESOURCE_TYPE, 0),)) -CREATE_AB_TEST = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#CreateABTest"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType({"method": "POST", "uri": "/ab-tests", "code": 202}), - ) - ], -) +SCOPE_TYPE: StaticSchema = (3, n0, _STc, 0) -DELETE_AB_TEST_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#DeleteABTestInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#DeleteABTestRequest", - ) - ], - members={ - "abTestId": { - "target": AB_TEST_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) +SCOPES_LIST_TYPE: StaticSchema = (16, n0, _SLT, 0, (_m,), ((SCOPE_TYPE, 0),)) -DELETE_AB_TEST_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#DeleteABTestOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#DeleteABTestResponse", - ) - ], - members={ - "abTestId": { - "target": AB_TEST_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "abTestArn": { - "target": AB_TEST_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": AB_TEST_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +GET_RESOURCE_OAUTH2_TOKEN_INPUT: StaticSchema = ( + 18, + n0, + _GROTI, + {_sSI: _cGROTR, _smit: None}, + (_wIT, _rCPN, _sco, _oF, _sUe, _rORU, _fA, _cP, _cSu, _reso, _au), + ( + (WORKLOAD_IDENTITY_TOKEN_TYPE, 1), + (CREDENTIAL_PROVIDER_NAME, 1), + (SCOPES_LIST_TYPE, 1), + (OAUTH2_FLOW_TYPE, 1), + (REQUEST_URI, 0), + (RESOURCE_OAUTH2_RETURN_URL_TYPE, 0), + (2, 0), + (CUSTOM_REQUEST_PARAMETERS_TYPE, 0), + (STATE, 0), + (RESOURCES_LIST_TYPE, 0), + (AUDIENCES_LIST_TYPE, 0), + ), ) -DELETE_AB_TEST = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#DeleteABTest"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "DELETE", "uri": "/ab-tests/{abTestId}", "code": 202} - ), - ) - ], +AUTHORIZATION_URL_TYPE: StaticSchema = (3, n0, _AUT, 4) + +SESSION_STATUS: StaticSchema = ( + 14, + n0, + _SS, + 0, + (_IP, _FAILED), + ((-1, {_sVm: _IP}), (-1, {_sVm: _FAILED})), +) + +GET_RESOURCE_OAUTH2_TOKEN_OUTPUT: StaticSchema = ( + 18, + n0, + _GROTO, + {_sSI: _cGROTRo, _smith: None}, + (_aU, _aTc, _sUe, _sSes), + ( + (AUTHORIZATION_URL_TYPE, 0), + (ACCESS_TOKEN_TYPE, 0), + (REQUEST_URI, 0), + (SESSION_STATUS, 0), + ), ) -BATCH_EVALUATION_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#BatchEvaluationId"), - shape_type=ShapeType.STRING, +GET_RESOURCE_OAUTH2_TOKEN: StaticOperationSchema = ( + 23, + n0, + _GROT, + {_smithy: MappingProxyType({"uri": "/identities/oauth2/token", "method": "POST"})}, + GET_RESOURCE_OAUTH2_TOKEN_INPUT, + GET_RESOURCE_OAUTH2_TOKEN_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -DELETE_BATCH_EVALUATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#DeleteBatchEvaluationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#DeleteBatchEvaluationRequest", - ) - ], - members={ - "batchEvaluationId": { - "target": BATCH_EVALUATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) +COINBASE_CDP_PAYMENT_REQUEST_BODY_TYPE: StaticSchema = (3, n0, _CCPRBT, 0) -BATCH_EVALUATION_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#BatchEvaluationStatus"), - shape_type=ShapeType.ENUM, - members={ - "PENDING": {"target": UNIT}, - "IN_PROGRESS": {"target": UNIT}, - "COMPLETED": {"target": UNIT}, - "COMPLETED_WITH_ERRORS": {"target": UNIT}, - "FAILED": {"target": UNIT}, - "STOPPING": {"target": UNIT}, - "STOPPED": {"target": UNIT}, - "DELETING": {"target": UNIT}, - }, -) +PAYMENT_REQUEST_HOST_TYPE: StaticSchema = (3, n0, _PRHT, 0) -DELETE_BATCH_EVALUATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#DeleteBatchEvaluationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#DeleteBatchEvaluationResponse", - ) - ], - members={ - "batchEvaluationId": { - "target": BATCH_EVALUATION_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "batchEvaluationArn": { - "target": BATCH_EVALUATION_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": BATCH_EVALUATION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +PAYMENT_HTTP_METHOD_TYPE: StaticSchema = ( + 14, + n0, + _PHMT, + 0, + (_GET, _POST, _PUT, _DELETE, _PATCH), + ( + (-1, {_sVm: _GET}), + (-1, {_sVm: _POST}), + (-1, {_sVm: _PUT}), + (-1, {_sVm: _DELETE}), + (-1, {_sVm: _PATCH}), + ), ) -DELETE_BATCH_EVALUATION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#DeleteBatchEvaluation"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/evaluations/batch-evaluate/{batchEvaluationId}", - "code": 202, - } - ), - ) - ], +PAYMENT_REQUEST_PATH_TYPE: StaticSchema = (3, n0, _PRPT, 0) + +COINBASE_CDP_TOKEN_REQUEST_INPUT: StaticSchema = ( + 18, + n0, + _CCTRI, + 0, + (_rM, _rH, _rP, _iWAT, _rB), + ( + (PAYMENT_HTTP_METHOD_TYPE, 1), + (PAYMENT_REQUEST_HOST_TYPE, 0), + (PAYMENT_REQUEST_PATH_TYPE, 1), + (2, {_smithyap: False}), + (COINBASE_CDP_PAYMENT_REQUEST_BODY_TYPE, 0), + ), ) -RECOMMENDATION_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#RecommendationId"), - shape_type=ShapeType.STRING, -) +STRIPE_PRIVY_REQUEST_BODY_TYPE: StaticSchema = (3, n0, _SPRBT, 4) -DELETE_RECOMMENDATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#DeleteRecommendationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#DeleteRecommendationRequest", - ) - ], - members={ - "recommendationId": { - "target": RECOMMENDATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) +STRIPE_PRIVY_REQUEST_HOST_TYPE: StaticSchema = (3, n0, _SPRHT, 0) -RECOMMENDATION_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#RecommendationStatus"), - shape_type=ShapeType.ENUM, - members={ - "PENDING": {"target": UNIT}, - "IN_PROGRESS": {"target": UNIT}, - "COMPLETED": {"target": UNIT}, - "FAILED": {"target": UNIT}, - "DELETING": {"target": UNIT}, - }, -) +STRIPE_PRIVY_REQUEST_PATH_TYPE: StaticSchema = (3, n0, _SPRPT, 0) -DELETE_RECOMMENDATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#DeleteRecommendationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#DeleteRecommendationResponse", - ) - ], - members={ - "recommendationId": { - "target": RECOMMENDATION_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": RECOMMENDATION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +STRIPE_PRIVY_TOKEN_REQUEST_INPUT: StaticSchema = ( + 18, + n0, + _SPTRI, + 0, + (_rH, _rP, _rB, _iAS), + ( + (STRIPE_PRIVY_REQUEST_HOST_TYPE, 0), + (STRIPE_PRIVY_REQUEST_PATH_TYPE, 1), + (STRIPE_PRIVY_REQUEST_BODY_TYPE, 1), + (2, {_smithyap: False}), + ), ) -DELETE_RECOMMENDATION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#DeleteRecommendation"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/recommendations/{recommendationId}", - "code": 202, - } - ), - ) - ], +PAYMENT_TOKEN_REQUEST_INPUT: StaticSchema = ( + 19, + n0, + _PTRI, + 0, + (_cCTR, _sPTR), + ((COINBASE_CDP_TOKEN_REQUEST_INPUT, 0), (STRIPE_PRIVY_TOKEN_REQUEST_INPUT, 0)), +) + +GET_RESOURCE_PAYMENT_TOKEN_INPUT: StaticSchema = ( + 18, + n0, + _GRPTI, + {_sSI: _cGRPTR, _smit: None}, + (_wIT, _rCPN, _pTR), + ( + (WORKLOAD_IDENTITY_TOKEN_TYPE, 1), + (CREDENTIAL_PROVIDER_NAME, 1), + (PAYMENT_TOKEN_REQUEST_INPUT, 1), + ), ) -DUPLICATE_ID_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#DuplicateIdException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=409), - ], - members={"message": {"target": NON_BLANK_STRING}}, -) +COINBASE_CDP_PAYMENT_JWT_TOKEN_TYPE: StaticSchema = (3, n0, _CCPJTT, 4) -EVALUATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#EvaluationInput"), - shape_type=ShapeType.UNION, - members={"sessionSpans": {"target": SPANS}}, +COINBASE_CDP_TOKEN_RESPONSE_OUTPUT: StaticSchema = ( + 18, + n0, + _CCTRO, + 0, + (_bT, _wAT), + ( + (COINBASE_CDP_PAYMENT_JWT_TOKEN_TYPE, 1), + (COINBASE_CDP_PAYMENT_JWT_TOKEN_TYPE, 0), + ), ) -EVALUATION_CONTENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#EvaluationContent"), - shape_type=ShapeType.UNION, - members={"text": {"target": STRING}}, -) +STRIPE_PRIVY_APP_ID_TYPE: StaticSchema = (3, n0, _SPAIT, 0) -EVALUATION_CONTENT_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#EvaluationContentList"), - shape_type=ShapeType.LIST, - members={"member": {"target": EVALUATION_CONTENT}}, -) +STRIPE_PRIVY_AUTHORIZATION_SIGNATURE_TYPE: StaticSchema = (3, n0, _SPAST, 4) -SPAN_CONTEXT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#SpanContext"), - members={ - "sessionId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "traceId": {"target": STRING}, - "spanId": {"target": STRING}, - }, -) +STRIPE_PRIVY_BASIC_AUTH_TOKEN_TYPE: StaticSchema = (3, n0, _SPBATT, 4) -CONTEXT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#Context"), - shape_type=ShapeType.UNION, - members={"spanContext": {"target": SPAN_CONTEXT}}, +STRIPE_PRIVY_TOKEN_RESPONSE_OUTPUT: StaticSchema = ( + 18, + n0, + _SPTRO, + 0, + (_aSu, _rE, _aIp, _bAT), + ( + (STRIPE_PRIVY_AUTHORIZATION_SIGNATURE_TYPE, 0), + (8, 0), + (STRIPE_PRIVY_APP_ID_TYPE, 1), + (STRIPE_PRIVY_BASIC_AUTH_TOKEN_TYPE, 1), + ), ) -EVALUATION_TOOL_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#EvaluationToolName"), - shape_type=ShapeType.STRING, +PAYMENT_TOKEN_RESPONSE_OUTPUT: StaticSchema = ( + 19, + n0, + _PTRO, + 0, + (_cCTRo, _sPTRt), + ((COINBASE_CDP_TOKEN_RESPONSE_OUTPUT, 0), (STRIPE_PRIVY_TOKEN_RESPONSE_OUTPUT, 0)), +) + +GET_RESOURCE_PAYMENT_TOKEN_OUTPUT: StaticSchema = ( + 18, + n0, + _GRPTO, + {_sSI: _cGRPTRo, _smith: None}, + (_pTRa,), + ((PAYMENT_TOKEN_RESPONSE_OUTPUT, 1),), +) + +GET_RESOURCE_PAYMENT_TOKEN: StaticOperationSchema = ( + 23, + n0, + _GRPT, + {_smithy: MappingProxyType({"uri": "/identities/payment/token", "method": "POST"})}, + GET_RESOURCE_PAYMENT_TOKEN_INPUT, + GET_RESOURCE_PAYMENT_TOKEN_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -EVALUATION_TOOL_NAMES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#EvaluationToolNames"), - shape_type=ShapeType.LIST, - members={"member": {"target": EVALUATION_TOOL_NAME}}, +WORKLOAD_IDENTITY_NAME_TYPE: StaticSchema = (3, n0, _WINT, 0) + +GET_WORKLOAD_ACCESS_TOKEN_INPUT: StaticSchema = ( + 18, + n0, + _GWATI, + {_sSI: _cGWATR, _smit: None}, + (_wN,), + ((WORKLOAD_IDENTITY_NAME_TYPE, 1),), +) + +GET_WORKLOAD_ACCESS_TOKEN_OUTPUT: StaticSchema = ( + 18, + n0, + _GWATO, + {_sSI: _cGWATRo, _smith: None}, + (_wATo,), + ((WORKLOAD_IDENTITY_TOKEN_TYPE, 1),), +) + +GET_WORKLOAD_ACCESS_TOKEN: StaticOperationSchema = ( + 23, + n0, + _GWAT, + { + _smithy: MappingProxyType( + {"uri": "/identities/GetWorkloadAccessToken", "method": "POST"} + ) + }, + GET_WORKLOAD_ACCESS_TOKEN_INPUT, + GET_WORKLOAD_ACCESS_TOKEN_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -EVALUATION_EXPECTED_TRAJECTORY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#EvaluationExpectedTrajectory"), - members={"toolNames": {"target": EVALUATION_TOOL_NAMES}}, +GET_WORKLOAD_ACCESS_TOKEN_FOR_JWT_INPUT: StaticSchema = ( + 18, + n0, + _GWATFJWTI, + {_sSI: _cGWATFJWTR, _smit: None}, + (_wN, _uT), + ((WORKLOAD_IDENTITY_NAME_TYPE, 1), (USER_TOKEN_TYPE, 1)), +) + +GET_WORKLOAD_ACCESS_TOKEN_FOR_JWT_OUTPUT: StaticSchema = ( + 18, + n0, + _GWATFJWTO, + {_sSI: _cGWATFJWTRo, _smith: None}, + (_wATo,), + ((WORKLOAD_IDENTITY_TOKEN_TYPE, 1),), +) + +GET_WORKLOAD_ACCESS_TOKEN_FOR_JWT: StaticOperationSchema = ( + 23, + n0, + _GWATFJWT, + { + _smithy: MappingProxyType( + {"uri": "/identities/GetWorkloadAccessTokenForJWT", "method": "POST"} + ) + }, + GET_WORKLOAD_ACCESS_TOKEN_FOR_JWT_INPUT, + GET_WORKLOAD_ACCESS_TOKEN_FOR_JWT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -EVALUATION_REFERENCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#EvaluationReferenceInput"), - members={ - "context": { - "target": CONTEXT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "expectedResponse": {"target": EVALUATION_CONTENT}, - "assertions": {"target": EVALUATION_CONTENT_LIST}, - "expectedTrajectory": {"target": EVALUATION_EXPECTED_TRAJECTORY}, - }, +GET_WORKLOAD_ACCESS_TOKEN_FOR_USER_ID_INPUT: StaticSchema = ( + 18, + n0, + _GWATFUII, + {_sSI: _cGWATFUIR, _smit: None}, + (_wN, _uI), + ((WORKLOAD_IDENTITY_NAME_TYPE, 1), (USER_ID_TYPE, 1)), +) + +GET_WORKLOAD_ACCESS_TOKEN_FOR_USER_ID_OUTPUT: StaticSchema = ( + 18, + n0, + _GWATFUIO, + {_sSI: _cGWATFUIRo, _smith: None}, + (_wATo,), + ((WORKLOAD_IDENTITY_TOKEN_TYPE, 1),), +) + +GET_WORKLOAD_ACCESS_TOKEN_FOR_USER_ID: StaticOperationSchema = ( + 23, + n0, + _GWATFUI, + { + _smithy: MappingProxyType( + {"uri": "/identities/GetWorkloadAccessTokenForUserId", "method": "POST"} + ) + }, + GET_WORKLOAD_ACCESS_TOKEN_FOR_USER_ID_INPUT, + GET_WORKLOAD_ACCESS_TOKEN_FOR_USER_ID_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -EVALUATION_REFERENCE_INPUTS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#EvaluationReferenceInputs"), - shape_type=ShapeType.LIST, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"member": {"target": EVALUATION_REFERENCE_INPUT}}, +MAX_LEN_STRING: StaticSchema = (3, n0, _MLS, 0) + +INPUT_CONTENT_BLOCK: StaticSchema = ( + 18, + n0, + _ICB, + 0, + (_pa, _te, _bl), + ((MAX_LEN_STRING, 1), (MAX_LEN_STRING, 0), (BODY, 0)), +) + +INPUT_CONTENT_BLOCK_LIST: StaticSchema = ( + 16, + n0, + _ICBL, + 0, + (_m,), + ((INPUT_CONTENT_BLOCK, 0),), +) + +PROGRAMMING_LANGUAGE: StaticSchema = ( + 14, + n0, + _PL, + 0, + (_PYTHON, _JAVASCRIPT, _TYPESCRIPT), + ((-1, {_sVm: _py}), (-1, {_sVm: _j}), (-1, {_sVm: _typ})), +) + +STRING_LIST: StaticSchema = (16, n0, _SLt, 0, (_m,), ((MAX_LEN_STRING, 0),)) + +LANGUAGE_RUNTIME: StaticSchema = ( + 14, + n0, + _LRa, + 0, + (_NODEJS, _DENO, _PYTHON), + ((-1, {_sVm: _no}), (-1, {_sVm: _de}), (-1, {_sVm: _py})), +) + +TOOL_ARGUMENTS: StaticSchema = ( + 18, + n0, + _TA, + 0, + (_cod, _lan, _cCl, _com, _pa, _pat, _cont, _dPi, _tIa, _run), + ( + (MAX_LEN_STRING, 0), + (PROGRAMMING_LANGUAGE, 0), + (2, 0), + (MAX_LEN_STRING, 0), + (MAX_LEN_STRING, 0), + (STRING_LIST, 0), + (INPUT_CONTENT_BLOCK_LIST, 0), + (MAX_LEN_STRING, 0), + (MAX_LEN_STRING, 0), + (LANGUAGE_RUNTIME, 0), + ), ) -SPAN_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#SpanId"), shape_type=ShapeType.STRING +TOOL_NAME: StaticSchema = ( + 14, + n0, + _TNo, + 0, + (_EC_, _EC__, _RF, _LF, _RF_, _WF, _SCE, _GT_, _ST_), + ( + (-1, {_sVm: _eCx}), + (-1, {_sVm: _eCxe}), + (-1, {_sVm: _rF}), + (-1, {_sVm: _lF}), + (-1, {_sVm: _rFe}), + (-1, {_sVm: _wF}), + (-1, {_sVm: _sCE}), + (-1, {_sVm: _gTe}), + (-1, {_sVm: _sTto}), + ), ) -SPAN_IDS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#SpanIds"), - shape_type=ShapeType.LIST, - members={"member": {"target": SPAN_ID}}, +INVOKE_CODE_INTERPRETER_INPUT: StaticSchema = ( + 18, + n0, + _ICII, + {_sSI: _cICIR, _smit: None}, + (_cII, _sIe, _tI, _tP, _n, _ar), + ( + (3, 9), + (CODE_INTERPRETER_SESSION_ID, {_sH: _xacisi}), + (3, {_sH: _XATI}), + (3, {_sH: _t}), + (TOOL_NAME, 1), + (TOOL_ARGUMENTS, 0), + ), ) -TRACE_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#TraceId"), shape_type=ShapeType.STRING +RESOURCE_CONTENT_TYPE: StaticSchema = ( + 14, + n0, + _RCT, + 0, + (_TEXT, _BLOB), + ((-1, {_sVm: _te}), (-1, {_sVm: _bl})), +) + +RESOURCE_CONTENT: StaticSchema = ( + 18, + n0, + _RCeso, + 0, + (_ty, _ur, _mT, _te, _bl), + ((RESOURCE_CONTENT_TYPE, 1), (3, 0), (3, 0), (3, 0), (1, 0)), +) + +CONTENT_BLOCK_TYPE: StaticSchema = ( + 14, + n0, + _CBT, + 0, + (_TEXT, _IMAGE, _ER_, _RL_), + ((-1, {_sVm: _te}), (-1, {_sVm: _im}), (-1, {_sVm: _resou}), (-1, {_sVm: _rl})), +) + +CONTENT_BLOCK: StaticSchema = ( + 18, + n0, + _CB, + 0, + (_ty, _te, _da, _mT, _ur, _n, _d, _siz, _resou), + ( + (CONTENT_BLOCK_TYPE, 1), + (3, 0), + (1, 0), + (3, 0), + (3, 0), + (3, 0), + (3, 0), + (8, 0), + (RESOURCE_CONTENT, 0), + ), ) -TRACE_IDS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#TraceIds"), - shape_type=ShapeType.LIST, - members={"member": {"target": TRACE_ID}}, +CONTENT_BLOCK_LIST: StaticSchema = (16, n0, _CBL, 0, (_m,), ((CONTENT_BLOCK, 0),)) + +TASK_STATUS: StaticSchema = ( + 14, + n0, + _TS, + 0, + (_SUBMITTED, _WORKING, _COMPLETED, _CANCELED, _FAILED), + ( + (-1, {_sVm: _su}), + (-1, {_sVm: _wo}), + (-1, {_sVm: _comp}), + (-1, {_sVm: _can}), + (-1, {_sVm: _fai}), + ), ) -EVALUATION_TARGET = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#EvaluationTarget"), - shape_type=ShapeType.UNION, - members={"spanIds": {"target": SPAN_IDS}, "traceIds": {"target": TRACE_IDS}}, +TOOL_RESULT_STRUCTURED_CONTENT: StaticSchema = ( + 18, + n0, + _TRSC, + 0, + (_tIa, _tSa, _std, _stde, _eC, _eTxe), + ((3, 0), (TASK_STATUS, 0), (3, 0), (3, 0), (7, 0), (10, 0)), +) + +CODE_INTERPRETER_RESULT: StaticSchema = ( + 18, + n0, + _CIR, + 0, + (_cont, _sCt, _iE), + ((CONTENT_BLOCK_LIST, 1), (TOOL_RESULT_STRUCTURED_CONTENT, 0), (2, 0)), +) + +CODE_INTERPRETER_STREAM_OUTPUT: StaticSchema = ( + 19, + n0, + _CISO, + {_smithya: None}, + (_resu, _aDE, _cE, _iSE, _rNFE, _sQEE, _tE, _vE), + ( + (CODE_INTERPRETER_RESULT, 0), + (ACCESS_DENIED_EXCEPTION, 0), + (CONFLICT_EXCEPTION, 0), + (INTERNAL_SERVER_EXCEPTION, 0), + (RESOURCE_NOT_FOUND_EXCEPTION, 0), + (SERVICE_QUOTA_EXCEEDED_EXCEPTION, 0), + (THROTTLING_EXCEPTION, 0), + (VALIDATION_EXCEPTION, 0), + ), ) -EVALUATOR_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#EvaluatorId"), - shape_type=ShapeType.STRING, +INVOKE_CODE_INTERPRETER_OUTPUT: StaticSchema = ( + 18, + n0, + _ICIO, + {_sSI: _cICIRo, _smith: None}, + (_sIe, _str), + ( + (CODE_INTERPRETER_SESSION_ID, {_sH: _xacisi}), + (CODE_INTERPRETER_STREAM_OUTPUT, 17), + ), ) -EVALUATE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#EvaluateInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#EvaluateRequest", - ) - ], - members={ - "evaluatorId": { - "target": EVALUATOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "evaluationInput": { - "target": EVALUATION_INPUT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "evaluationTarget": {"target": EVALUATION_TARGET}, - "evaluationReferenceInputs": {"target": EVALUATION_REFERENCE_INPUTS}, - }, +INVOKE_CODE_INTERPRETER: StaticOperationSchema = ( + 23, + n0, + _ICI, + { + _smithy: MappingProxyType( + { + "method": "POST", + "uri": "/code-interpreters/{codeInterpreterIdentifier}/tools/invoke", + "code": 200, + } + ) + }, + INVOKE_CODE_INTERPRETER_INPUT, + INVOKE_CODE_INTERPRETER_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -EVALUATION_ERROR_CODE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#EvaluationErrorCode"), - shape_type=ShapeType.STRING, -) +HARNESS_ALLOWED_TOOL: StaticSchema = (3, n0, _HAT, 0) -EVALUATION_ERROR_MESSAGE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#EvaluationErrorMessage"), - shape_type=ShapeType.STRING, +HARNESS_ALLOWED_TOOLS: StaticSchema = ( + 16, + n0, + _HATa, + 0, + (_m,), + ((HARNESS_ALLOWED_TOOL, 0),), ) -EVALUATOR_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#EvaluatorArn"), - shape_type=ShapeType.STRING, -) +HARNESS_ARN: StaticSchema = (3, n0, _HA, 0) -EVALUATOR_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#EvaluatorName"), - shape_type=ShapeType.STRING, +HARNESS_REASONING_TEXT_BLOCK: StaticSchema = ( + 18, + n0, + _HRTB, + 4, + (_te, _sig), + ((3, 1), (3, 0)), ) -EVALUATION_EXPLANATION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#EvaluationExplanation"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +HARNESS_REASONING_CONTENT_BLOCK: StaticSchema = ( + 19, + n0, + _HRCB, + 4, + (_rT, _rCed), + ((HARNESS_REASONING_TEXT_BLOCK, 0), (1, 0)), ) -IGNORED_REFERENCE_INPUT_FIELD = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#IgnoredReferenceInputField"), - shape_type=ShapeType.STRING, -) +SENSITIVE_TEXT: StaticSchema = (3, n0, _STe, 4) -IGNORED_REFERENCE_INPUT_FIELDS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#IgnoredReferenceInputFields"), - shape_type=ShapeType.LIST, - members={"member": {"target": IGNORED_REFERENCE_INPUT_FIELD}}, -) +SENSITIVE_JSON: StaticSchema = (13, n0, _SJ, 4) -TOKEN_USAGE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#TokenUsage"), - members={ - "inputTokens": {"target": INTEGER}, - "outputTokens": {"target": INTEGER}, - "totalTokens": {"target": INTEGER}, - }, +HARNESS_TOOL_RESULT_CONTENT_BLOCK: StaticSchema = ( + 19, + n0, + _HTRCB, + 0, + (_te, _js), + ((SENSITIVE_TEXT, 0), (SENSITIVE_JSON, 0)), ) -EVALUATION_RESULT_CONTENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#EvaluationResultContent"), - members={ - "evaluatorArn": { - "target": EVALUATOR_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "evaluatorId": { - "target": EVALUATOR_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "evaluatorName": { - "target": EVALUATOR_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "explanation": {"target": EVALUATION_EXPLANATION}, - "context": { - "target": CONTEXT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "value": {"target": DOUBLE}, - "label": {"target": STRING}, - "tokenUsage": {"target": TOKEN_USAGE}, - "errorMessage": {"target": EVALUATION_ERROR_MESSAGE}, - "errorCode": {"target": EVALUATION_ERROR_CODE}, - "ignoredReferenceInputFields": {"target": IGNORED_REFERENCE_INPUT_FIELDS}, - }, +HARNESS_TOOL_RESULT_CONTENT_BLOCKS: StaticSchema = ( + 16, + n0, + _HTRCBa, + 0, + (_m,), + ((HARNESS_TOOL_RESULT_CONTENT_BLOCK, 0),), ) -EVALUATION_RESULTS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#EvaluationResults"), - shape_type=ShapeType.LIST, - members={"member": {"target": EVALUATION_RESULT_CONTENT}}, +HARNESS_TOOL_USE_STATUS: StaticSchema = ( + 14, + n0, + _HTUS, + 0, + (_SUCCESS, _ERROR), + ((-1, {_sVm: _suc}), (-1, {_sVm: _er})), ) -EVALUATE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#EvaluateOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#EvaluateResponse", - ) - ], - members={ - "evaluationResults": { - "target": EVALUATION_RESULTS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +HARNESS_TOOL_USE_ID: StaticSchema = (3, n0, _HTUI, 0) -EVALUATE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#Evaluate"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/evaluations/evaluate/{evaluatorId}"} - ), - ) - ], +HARNESS_TOOL_USE_TYPE: StaticSchema = ( + 14, + n0, + _HTUT, + 0, + (_TU_, _STU, _MTU), + ((-1, {_sVm: _tu_}), (-1, {_sVm: _stu}), (-1, {_sVm: _mtu})), ) -GET_AB_TEST_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#GetABTestInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#GetABTestRequest", - ) - ], - members={ - "abTestId": { - "target": AB_TEST_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, +HARNESS_TOOL_RESULT_BLOCK: StaticSchema = ( + 18, + n0, + _HTRB, + 0, + (_tUI, _cont, _st, _ty), + ( + (HARNESS_TOOL_USE_ID, 1), + (HARNESS_TOOL_RESULT_CONTENT_BLOCKS, 1), + (HARNESS_TOOL_USE_STATUS, 0), + (HARNESS_TOOL_USE_TYPE, 0), + ), ) -ERROR_DETAILS_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ErrorDetailsList"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, +HARNESS_TOOL_NAME: StaticSchema = (3, n0, _HTN, 0) + +HARNESS_TOOL_USE_BLOCK: StaticSchema = ( + 18, + n0, + _HTUB, + 0, + (_n, _tUI, _inp, _ty, _sNe), + ( + (HARNESS_TOOL_NAME, 1), + (HARNESS_TOOL_USE_ID, 1), + (SENSITIVE_JSON, 1), + (HARNESS_TOOL_USE_TYPE, 0), + (3, 0), + ), ) -GET_AB_TEST_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#GetABTestOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#GetABTestResponse", - ) - ], - members={ - "abTestId": { - "target": AB_TEST_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "abTestArn": { - "target": AB_TEST_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": AB_TEST_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": AB_TEST_DESCRIPTION}, - "status": { - "target": AB_TEST_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "executionStatus": { - "target": AB_TEST_EXECUTION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "gatewayArn": { - "target": GATEWAY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "variants": { - "target": VARIANT_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "gatewayFilter": {"target": GATEWAY_FILTER}, - "evaluationConfig": { - "target": AB_TEST_EVALUATION_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "roleArn": {"target": ROLE_ARN}, - "currentRunId": {"target": STRING}, - "errorDetails": {"target": ERROR_DETAILS_LIST}, - "startedAt": {"target": TIMESTAMP}, - "stoppedAt": {"target": TIMESTAMP}, - "maxDurationExpiresAt": {"target": TIMESTAMP}, - "createdAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "results": {"target": AB_TEST_RESULTS}, - }, +HARNESS_CONTENT_BLOCK: StaticSchema = ( + 19, + n0, + _HCB, + 0, + (_te, _tUo, _tRo, _rCea), + ( + (SENSITIVE_TEXT, 0), + (HARNESS_TOOL_USE_BLOCK, 0), + (HARNESS_TOOL_RESULT_BLOCK, 0), + (HARNESS_REASONING_CONTENT_BLOCK, 0), + ), ) -GET_AB_TEST = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#GetABTest"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType({"method": "GET", "uri": "/ab-tests/{abTestId}"}), - ) - ], +HARNESS_CONTENT_BLOCKS: StaticSchema = ( + 16, + n0, + _HCBa, + 0, + (_m,), + ((HARNESS_CONTENT_BLOCK, 0),), ) -GET_BATCH_EVALUATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#GetBatchEvaluationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#GetBatchEvaluationRequest", - ) - ], - members={ - "batchEvaluationId": { - "target": BATCH_EVALUATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, +HARNESS_CONVERSATION_ROLE: StaticSchema = ( + 14, + n0, + _HCR, + 0, + (_USER, _ASSISTANT), + ((-1, {_sVm: _us}), (-1, {_sVm: _ass})), ) -BATCH_EVALUATION_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#BatchEvaluationName"), - shape_type=ShapeType.STRING, +HARNESS_MESSAGE: StaticSchema = ( + 18, + n0, + _HMa, + 0, + (_ro, _cont), + ((HARNESS_CONVERSATION_ROLE, 1), (HARNESS_CONTENT_BLOCKS, 1)), ) -EVALUATION_STRING_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#EvaluationStringList"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, -) +HARNESS_MESSAGES: StaticSchema = (16, n0, _HMar, 0, (_m,), ((HARNESS_MESSAGE, 0),)) -TRACE_ID_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#TraceIdList"), - shape_type=ShapeType.LIST, - members={"member": {"target": TRACE_ID}}, +HARNESS_BEDROCK_API_FORMAT: StaticSchema = ( + 14, + n0, + _HBAF, + 0, + (_CS_, _RESPONSES, _CC), + ((-1, {_sVm: _cs}), (-1, {_sVm: _resp}), (-1, {_sVm: _cc})), ) -SESSION_TRACE_IDS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#SessionTraceIds"), - members={ - "sessionId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "traceIds": { - "target": TRACE_ID_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +MAX_TOKENS: StaticSchema = (7, n0, _MTa, 0) -SESSION_TRACE_IDS_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#SessionTraceIdsList"), - shape_type=ShapeType.LIST, - members={"member": {"target": SESSION_TRACE_IDS}}, -) - -SESSION_FILTER_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#SessionFilterConfig"), - members={ - "startTime": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#timestampFormat"), value="date-time") - ], - }, - "endTime": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#timestampFormat"), value="date-time") - ], - }, - }, -) +MODEL_ID: StaticSchema = (3, n0, _MI, 0) -CLOUD_WATCH_FILTER_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#CloudWatchFilterConfig"), - members={ - "sessionIds": {"target": EVALUATION_STRING_LIST}, - "timeRange": {"target": SESSION_FILTER_CONFIG}, - "sessionTraceIds": {"target": SESSION_TRACE_IDS_LIST}, - }, -) +TEMPERATURE: StaticSchema = (9, n0, _T, 0) -LOG_GROUP_NAME_PREFIX = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#LogGroupNamePrefix"), - shape_type=ShapeType.STRING, -) +TOP_P: StaticSchema = (9, n0, _TP, 0) -LOG_GROUP_NAME_PREFIX_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#LogGroupNamePrefixList"), - shape_type=ShapeType.LIST, - members={"member": {"target": LOG_GROUP_NAME_PREFIX}}, +HARNESS_BEDROCK_MODEL_CONFIG: StaticSchema = ( + 18, + n0, + _HBMC, + 0, + (_mI, _mTa, _tem, _tPo, _aF, _aP), + ( + (MODEL_ID, 1), + (MAX_TOKENS, 0), + (TEMPERATURE, 0), + (TOP_P, 0), + (HARNESS_BEDROCK_API_FORMAT, 0), + (13, 0), + ), ) -LOG_GROUP_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#LogGroupName"), - shape_type=ShapeType.STRING, +API_KEY_ARN: StaticSchema = (3, n0, _AKA, 0) + +TOP_K: StaticSchema = (7, n0, _TKo, 0) + +HARNESS_GEMINI_MODEL_CONFIG: StaticSchema = ( + 18, + n0, + _HGMC, + 0, + (_mI, _aKA, _mTa, _tem, _tPo, _tK, _aP), + ( + (MODEL_ID, 1), + (API_KEY_ARN, 1), + (MAX_TOKENS, 0), + (TEMPERATURE, 0), + (TOP_P, 0), + (TOP_K, 0), + (13, 0), + ), ) -LOG_GROUP_NAME_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#LogGroupNameList"), - shape_type=ShapeType.LIST, - members={"member": {"target": LOG_GROUP_NAME}}, +HARNESS_LITE_LLM_API_BASE: StaticSchema = (3, n0, _HLLAB, 4) + +HARNESS_LITE_LLM_MODEL_CONFIG: StaticSchema = ( + 18, + n0, + _HLLMC, + 0, + (_mI, _aKA, _aB, _mTa, _tem, _tPo, _aP), + ( + (MODEL_ID, 1), + (API_KEY_ARN, 0), + (HARNESS_LITE_LLM_API_BASE, 0), + (MAX_TOKENS, 0), + (TEMPERATURE, 0), + (TOP_P, 0), + (13, 0), + ), ) -CLOUD_WATCH_LOGS_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#CloudWatchLogsSource"), - members={ - "serviceNames": { - "target": EVALUATION_STRING_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "logGroupNames": { - "target": LOG_GROUP_NAME_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=())], - }, - "logGroupNamePrefixes": {"target": LOG_GROUP_NAME_PREFIX_LIST}, - "filterConfig": {"target": CLOUD_WATCH_FILTER_CONFIG}, - }, +HARNESS_OPEN_AI_API_BASE: StaticSchema = (3, n0, _HOAAB, 4) + +HARNESS_OPEN_AI_API_FORMAT: StaticSchema = ( + 14, + n0, + _HOAAF, + 0, + (_CC, _RESPONSES), + ((-1, {_sVm: _cc}), (-1, {_sVm: _resp})), +) + +HARNESS_OPEN_AI_MODEL_CONFIG: StaticSchema = ( + 18, + n0, + _HOAMC, + 0, + (_mI, _aKA, _aB, _mTa, _tem, _tPo, _aF, _aP), + ( + (MODEL_ID, 1), + (API_KEY_ARN, 1), + (HARNESS_OPEN_AI_API_BASE, 0), + (MAX_TOKENS, 0), + (TEMPERATURE, 0), + (TOP_P, 0), + (HARNESS_OPEN_AI_API_FORMAT, 0), + (13, 0), + ), ) -ONLINE_EVALUATION_CONFIG_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#OnlineEvaluationConfigSource"), - members={ - "onlineEvaluationConfigArn": { - "target": ONLINE_EVALUATION_CONFIG_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "timeRange": {"target": SESSION_FILTER_CONFIG}, - }, +HARNESS_MODEL_CONFIGURATION: StaticSchema = ( + 19, + n0, + _HMC, + 0, + (_bMC, _oAMC, _gMC, _lLMC), + ( + (HARNESS_BEDROCK_MODEL_CONFIG, 0), + (HARNESS_OPEN_AI_MODEL_CONFIG, 0), + (HARNESS_GEMINI_MODEL_CONFIG, 0), + (HARNESS_LITE_LLM_MODEL_CONFIG, 0), + ), ) -DATA_SOURCE_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#DataSourceConfig"), - shape_type=ShapeType.UNION, - members={ - "cloudWatchLogs": {"target": CLOUD_WATCH_LOGS_SOURCE}, - "onlineEvaluationConfigSource": {"target": ONLINE_EVALUATION_CONFIG_SOURCE}, - }, -) +HARNESS_ENDPOINT_NAME: StaticSchema = (3, n0, _HEN, 0) -BATCH_EVALUATION_DESCRIPTION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#BatchEvaluationDescription"), - shape_type=ShapeType.STRING, -) +HARNESS_AWS_SKILL_PATH: StaticSchema = (3, n0, _HASP, 0) -EVALUATOR_STATISTICS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#EvaluatorStatistics"), - members={"averageScore": {"target": DOUBLE}}, +HARNESS_AWS_SKILL_PATHS: StaticSchema = ( + 16, + n0, + _HASPa, + 0, + (_m,), + ((HARNESS_AWS_SKILL_PATH, 0),), ) -EVALUATOR_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#EvaluatorSummary"), - members={ - "evaluatorId": {"target": STRING}, - "statistics": {"target": EVALUATOR_STATISTICS}, - "totalEvaluated": {"target": INTEGER}, - "totalFailed": {"target": INTEGER}, - }, +HARNESS_SKILL_AWS_SKILLS_SOURCE: StaticSchema = ( + 18, + n0, + _HSASS, + 0, + (_pat,), + ((HARNESS_AWS_SKILL_PATHS, 0),), ) -EVALUATOR_SUMMARY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#EvaluatorSummaryList"), - shape_type=ShapeType.LIST, - members={"member": {"target": EVALUATOR_SUMMARY}}, +HARNESS_SKILL_GIT_AUTH: StaticSchema = ( + 18, + n0, + _HSGA, + 0, + (_cAr, _use), + ((API_KEY_ARN, 1), (3, 0)), ) -EVALUATION_JOB_RESULTS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#EvaluationJobResults"), - members={ - "numberOfSessionsCompleted": {"target": INTEGER}, - "numberOfSessionsInProgress": {"target": INTEGER}, - "numberOfSessionsFailed": {"target": INTEGER}, - "totalNumberOfSessions": {"target": INTEGER}, - "numberOfSessionsIgnored": {"target": INTEGER}, - "evaluatorSummaries": {"target": EVALUATOR_SUMMARY_LIST}, - }, -) +HARNESS_SKILL_GIT_URL: StaticSchema = (3, n0, _HSGU, 0) -EVALUATOR = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#Evaluator"), - members={ - "evaluatorId": { - "target": EVALUATOR_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +HARNESS_SKILL_GIT_SOURCE: StaticSchema = ( + 18, + n0, + _HSGS, + 0, + (_url, _pa, _aut), + ((HARNESS_SKILL_GIT_URL, 1), (3, 0), (HARNESS_SKILL_GIT_AUTH, 0)), ) -EVALUATOR_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#EvaluatorList"), - shape_type=ShapeType.LIST, - members={"member": {"target": EVALUATOR}}, -) - -EXECUTION_SUMMARY_AFFECTED_SESSION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ExecutionSummaryAffectedSession"), - members={ - "sessionId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "approachTaken": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "finalOutcome": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +HARNESS_SKILL_PATH: StaticSchema = (3, n0, _HSP, 0) -EXECUTION_SUMMARY_AFFECTED_SESSION_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ExecutionSummaryAffectedSessionList"), - shape_type=ShapeType.LIST, - members={"member": {"target": EXECUTION_SUMMARY_AFFECTED_SESSION}}, -) - -EXECUTION_SUMMARY_CLUSTER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ExecutionSummaryCluster"), - members={ - "clusterId": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "affectedSessionCount": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "affectedSessions": { - "target": EXECUTION_SUMMARY_AFFECTED_SESSION_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +HARNESS_SKILL_S3_URI: StaticSchema = (3, n0, _HSSU, 0) -EXECUTION_SUMMARY_CLUSTER_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ExecutionSummaryClusterList"), - shape_type=ShapeType.LIST, - members={"member": {"target": EXECUTION_SUMMARY_CLUSTER}}, +HARNESS_SKILL_S3_SOURCE: StaticSchema = ( + 18, + n0, + _HSSS, + 0, + (_ur,), + ((HARNESS_SKILL_S3_URI, 1),), ) -EXECUTION_SUMMARY_CLUSTERING_RESULT_CONTENT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcore#ExecutionSummaryClusteringResultContent" +HARNESS_SKILL: StaticSchema = ( + 19, + n0, + _HS, + 0, + (_pa, _s_, _g, _aSw), + ( + (HARNESS_SKILL_PATH, 0), + (HARNESS_SKILL_S3_SOURCE, 0), + (HARNESS_SKILL_GIT_SOURCE, 0), + (HARNESS_SKILL_AWS_SKILLS_SOURCE, 0), ), - members={ - "executionSummaries": { - "target": EXECUTION_SUMMARY_CLUSTER_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, ) -ROOT_CAUSE_CLUSTER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#RootCauseCluster"), - members={ - "clusterId": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "rootCause": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "recommendation": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "affectedSessionCount": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "affectedSessions": { - "target": AFFECTED_SESSION_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +HARNESS_SKILLS: StaticSchema = (16, n0, _HSa, 0, (_m,), ((HARNESS_SKILL, 0),)) -ROOT_CAUSE_CLUSTER_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#RootCauseClusterList"), - shape_type=ShapeType.LIST, - members={"member": {"target": ROOT_CAUSE_CLUSTER}}, -) - -FAILURE_SUB_CATEGORY_CLUSTER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#FailureSubCategoryCluster"), - members={ - "clusterId": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "affectedSessionCount": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "rootCauses": { - "target": ROOT_CAUSE_CLUSTER_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +HARNESS_SYSTEM_CONTENT_BLOCK: StaticSchema = ( + 19, + n0, + _HSCB, + 0, + (_te,), + ((SENSITIVE_TEXT, 0),), ) -FAILURE_SUB_CATEGORY_CLUSTER_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#FailureSubCategoryClusterList"), - shape_type=ShapeType.LIST, - members={"member": {"target": FAILURE_SUB_CATEGORY_CLUSTER}}, -) - -FAILURE_CATEGORY_CLUSTER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#FailureCategoryCluster"), - members={ - "clusterId": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "affectedSessionCount": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "subCategories": { - "target": FAILURE_SUB_CATEGORY_CLUSTER_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +HARNESS_SYSTEM_PROMPT: StaticSchema = ( + 16, + n0, + _HSPa, + 0, + (_m,), + ((HARNESS_SYSTEM_CONTENT_BLOCK, 0),), ) -FAILURE_CATEGORY_CLUSTER_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#FailureCategoryClusterList"), - shape_type=ShapeType.LIST, - members={"member": {"target": FAILURE_CATEGORY_CLUSTER}}, -) +HARNESS_BROWSER_ARN: StaticSchema = (3, n0, _HBA, 0) -FAILURE_ANALYSIS_RESULT_CONTENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#FailureAnalysisResultContent"), - members={ - "failures": { - "target": FAILURE_CATEGORY_CLUSTER_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +HARNESS_AGENT_CORE_BROWSER_CONFIG: StaticSchema = ( + 18, + n0, + _HACBC, + 0, + (_bAr,), + ((HARNESS_BROWSER_ARN, 0),), ) -INSIGHT_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#InsightId"), shape_type=ShapeType.STRING -) +HARNESS_CODE_INTERPRETER_ARN: StaticSchema = (3, n0, _HCIA, 0) -INSIGHT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#Insight"), - members={ - "insightId": { - "target": INSIGHT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +HARNESS_AGENT_CORE_CODE_INTERPRETER_CONFIG: StaticSchema = ( + 18, + n0, + _HACCIC, + 0, + (_cIA,), + ((HARNESS_CODE_INTERPRETER_ARN, 0),), ) -INSIGHT_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#InsightList"), - shape_type=ShapeType.LIST, - members={"member": {"target": INSIGHT}}, -) +O_AUTH_CUSTOM_PARAMETERS_KEY: StaticSchema = (3, n0, _OACPK, 0) -KMS_KEY_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#KmsKeyArn"), shape_type=ShapeType.STRING -) +O_AUTH_CUSTOM_PARAMETERS_VALUE: StaticSchema = (3, n0, _OACPV, 4) -OPTIONAL_LOG_GROUP_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#OptionalLogGroupName"), - shape_type=ShapeType.STRING, +O_AUTH_CUSTOM_PARAMETERS: StaticSchema = ( + 17, + n0, + _OACP, + 0, + (_k, _va), + ((O_AUTH_CUSTOM_PARAMETERS_KEY, 0), (O_AUTH_CUSTOM_PARAMETERS_VALUE, 0)), ) -LOG_STREAM_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#LogStreamName"), - shape_type=ShapeType.STRING, -) +O_AUTH_DEFAULT_RETURN_URL: StaticSchema = (3, n0, _OADRU, 0) -METRICS_NAMESPACE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#MetricsNamespace"), - shape_type=ShapeType.STRING, +O_AUTH_GRANT_TYPE: StaticSchema = ( + 14, + n0, + _OAGT, + 0, + (_CC_, _AC_, _TE_), + ((-1, {_sVm: _CC_}), (-1, {_sVm: _AC_}), (-1, {_sVm: _TE_})), ) -RESULT_DESTINATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ResultDestination"), - shape_type=ShapeType.ENUM, - members={ - "DEDICATED_LOG_GROUP": {"target": UNIT}, - "SOURCE_LOG_GROUP": {"target": UNIT}, - }, -) +O_AUTH_CREDENTIAL_PROVIDER_ARN: StaticSchema = (3, n0, _OACPA, 0) -CLOUD_WATCH_OUTPUT_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#CloudWatchOutputConfig"), - members={ - "logGroupName": { - "target": OPTIONAL_LOG_GROUP_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="")], - }, - "logStreamName": { - "target": LOG_STREAM_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="")], - }, - "metricsNamespace": {"target": METRICS_NAMESPACE}, - "resultDestination": { - "target": RESULT_DESTINATION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value="DEDICATED_LOG_GROUP") - ], - }, - }, -) +O_AUTH_SCOPE: StaticSchema = (3, n0, _OAS, 0) -OUTPUT_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#OutputConfig"), - shape_type=ShapeType.UNION, - members={"cloudWatchConfig": {"target": CLOUD_WATCH_OUTPUT_CONFIG}}, -) +O_AUTH_SCOPES: StaticSchema = (16, n0, _OASu, 0, (_m,), ((O_AUTH_SCOPE, 0),)) -USER_INTENT_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#UserIntentList"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, +O_AUTH_CREDENTIAL_PROVIDER: StaticSchema = ( + 18, + n0, + _OACPu, + 0, + (_pA, _sco, _cP, _gTr, _dRU), + ( + (O_AUTH_CREDENTIAL_PROVIDER_ARN, 1), + (O_AUTH_SCOPES, 1), + (O_AUTH_CUSTOM_PARAMETERS, 0), + (O_AUTH_GRANT_TYPE, {_smithyap: _CC_}), + (O_AUTH_DEFAULT_RETURN_URL, 0), + ), ) -USER_INTENT_AFFECTED_SESSION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#UserIntentAffectedSession"), - members={ - "sessionId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "userMessages": { - "target": USER_INTENT_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +HARNESS_GATEWAY_OUTBOUND_AUTH: StaticSchema = ( + 19, + n0, + _HGOA, + 0, + (_aIw, _non, _oa), + ((-1, 0), (-1, 0), (O_AUTH_CREDENTIAL_PROVIDER, 0)), ) -USER_INTENT_AFFECTED_SESSION_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#UserIntentAffectedSessionList"), - shape_type=ShapeType.LIST, - members={"member": {"target": USER_INTENT_AFFECTED_SESSION}}, -) - -USER_INTENT_CLUSTER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#UserIntentCluster"), - members={ - "clusterId": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "affectedSessionCount": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "affectedSessions": { - "target": USER_INTENT_AFFECTED_SESSION_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +HARNESS_AGENT_CORE_GATEWAY_CONFIG: StaticSchema = ( + 18, + n0, + _HACGC, + 0, + (_gA, _oA), + ((GATEWAY_ARN, 1), (HARNESS_GATEWAY_OUTBOUND_AUTH, 0)), ) -USER_INTENT_CLUSTER_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#UserIntentClusterList"), - shape_type=ShapeType.LIST, - members={"member": {"target": USER_INTENT_CLUSTER}}, -) +HARNESS_INLINE_FUNCTION_DESCRIPTION: StaticSchema = (3, n0, _HIFD, 4) -USER_INTENT_CLUSTERING_RESULT_CONTENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#UserIntentClusteringResultContent"), - members={ - "userIntents": { - "target": USER_INTENT_CLUSTER_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +HARNESS_INLINE_FUNCTION_CONFIG: StaticSchema = ( + 18, + n0, + _HIFC, + 0, + (_d, _iSn), + ((HARNESS_INLINE_FUNCTION_DESCRIPTION, 1), (SENSITIVE_JSON, 1)), ) -GET_BATCH_EVALUATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#GetBatchEvaluationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#GetBatchEvaluationResponse", - ) - ], - members={ - "batchEvaluationId": { - "target": BATCH_EVALUATION_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "batchEvaluationArn": { - "target": BATCH_EVALUATION_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "batchEvaluationName": { - "target": BATCH_EVALUATION_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": BATCH_EVALUATION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#timestampFormat"), value="date-time"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "evaluators": {"target": EVALUATOR_LIST}, - "insights": {"target": INSIGHT_LIST}, - "dataSourceConfig": {"target": DATA_SOURCE_CONFIG}, - "outputConfig": {"target": OUTPUT_CONFIG}, - "evaluationResults": {"target": EVALUATION_JOB_RESULTS}, - "failureAnalysisResult": {"target": FAILURE_ANALYSIS_RESULT_CONTENT}, - "userIntentResult": {"target": USER_INTENT_CLUSTERING_RESULT_CONTENT}, - "executionSummaryResult": { - "target": EXECUTION_SUMMARY_CLUSTERING_RESULT_CONTENT - }, - "errorDetails": {"target": ERROR_DETAILS_LIST}, - "description": {"target": BATCH_EVALUATION_DESCRIPTION}, - "updatedAt": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#timestampFormat"), value="date-time") - ], - }, - "kmsKeyArn": {"target": KMS_KEY_ARN}, - }, -) +HTTP_HEADER_KEY: StaticSchema = (3, n0, _HHK, 0) -GET_BATCH_EVALUATION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#GetBatchEvaluation"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/evaluations/batch-evaluate/{batchEvaluationId}", - } - ), - ) - ], -) +HTTP_HEADER_VALUE: StaticSchema = (3, n0, _HHV, 0) -GET_RECOMMENDATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#GetRecommendationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#GetRecommendationRequest", - ) - ], - members={ - "recommendationId": { - "target": RECOMMENDATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, +HTTP_HEADERS_MAP: StaticSchema = ( + 17, + n0, + _HHM, + 4, + (_k, _va), + ((HTTP_HEADER_KEY, 0), (HTTP_HEADER_VALUE, 0)), ) -RECOMMENDATION_DESCRIPTION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#RecommendationDescription"), - shape_type=ShapeType.STRING, -) +HARNESS_REMOTE_MCP_URL: StaticSchema = (3, n0, _HRMU, 4) -RECOMMENDATION_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#RecommendationName"), - shape_type=ShapeType.STRING, +HARNESS_REMOTE_MCP_CONFIG: StaticSchema = ( + 18, + n0, + _HRMC, + 0, + (_url, _he), + ((HARNESS_REMOTE_MCP_URL, 1), (HTTP_HEADERS_MAP, 0)), ) -RECOMMENDATION_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#RecommendationArn"), - shape_type=ShapeType.STRING, +HARNESS_TOOL_CONFIGURATION: StaticSchema = ( + 19, + n0, + _HTC, + 0, + (_rMe, _aCB, _aCG, _iF, _aCCI), + ( + (HARNESS_REMOTE_MCP_CONFIG, 0), + (HARNESS_AGENT_CORE_BROWSER_CONFIG, 0), + (HARNESS_AGENT_CORE_GATEWAY_CONFIG, 0), + (HARNESS_INLINE_FUNCTION_CONFIG, 0), + (HARNESS_AGENT_CORE_CODE_INTERPRETER_CONFIG, 0), + ), ) -RECOMMENDATION_EVALUATOR_REFERENCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#RecommendationEvaluatorReference"), - members={ - "evaluatorArn": { - "target": EVALUATOR_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +HARNESS_TOOL_TYPE: StaticSchema = ( + 14, + n0, + _HTT, + 0, + (_RM, _AB, _AG, _IF, _ACI), + ( + (-1, {_sVm: _rm}), + (-1, {_sVm: _ab}), + (-1, {_sVm: _ag}), + (-1, {_sVm: _if}), + (-1, {_sVm: _aci}), + ), ) -RECOMMENDATION_EVALUATOR_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#RecommendationEvaluatorList"), - shape_type=ShapeType.LIST, - members={"member": {"target": RECOMMENDATION_EVALUATOR_REFERENCE}}, +HARNESS_TOOL: StaticSchema = ( + 18, + n0, + _HT, + 0, + (_ty, _n, _conf), + ((HARNESS_TOOL_TYPE, 1), (HARNESS_TOOL_NAME, 0), (HARNESS_TOOL_CONFIGURATION, 0)), +) + +HARNESS_TOOLS: StaticSchema = (16, n0, _HTa, 0, (_m,), ((HARNESS_TOOL, 0),)) + +INVOKE_HARNESS_INPUT: StaticSchema = ( + 18, + n0, + _IHI, + {_sSI: _cIHR, _smit: None}, + ( + _hA, + _q, + _rSI, + _rUI, + _tP, + _tS, + _tI, + _b, + _mess, + _mo, + _sPy, + _to, + _sk, + _aTl, + _mIa, + _mTa, + _tSi, + _aI, + ), + ( + (HARNESS_ARN, {_sQ: _hA, _s: None}), + (HARNESS_ENDPOINT_NAME, {_sQ: _q}), + (SESSION_ID, {_sH: _XABARSI, _s: None}), + (3, {_sH: _XABARUI}), + (3, {_sH: _t}), + (3, {_sH: _tr}), + (3, {_sH: _XATI}), + (3, {_sH: _b}), + (HARNESS_MESSAGES, 1), + (HARNESS_MODEL_CONFIGURATION, 0), + (HARNESS_SYSTEM_PROMPT, 0), + (HARNESS_TOOLS, 0), + (HARNESS_SKILLS, 0), + (HARNESS_ALLOWED_TOOLS, 0), + (7, 0), + (7, 0), + (7, 0), + (3, 0), + ), ) -RECOMMENDATION_EVALUATION_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#RecommendationEvaluationConfig"), - members={ - "evaluators": { - "target": RECOMMENDATION_EVALUATOR_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +HARNESS_REASONING_CONTENT_BLOCK_DELTA: StaticSchema = ( + 19, + n0, + _HRCBD, + 4, + (_te, _rCed, _sig), + ((3, 0), (BODY, 0), (3, 0)), +) + +HARNESS_TOOL_RESULT_BLOCK_DELTA: StaticSchema = ( + 19, + n0, + _HTRBD, + 0, + (_te, _js), + ((SENSITIVE_TEXT, 0), (SENSITIVE_JSON, 0)), +) + +HARNESS_TOOL_RESULT_BLOCKS_DELTA: StaticSchema = ( + 16, + n0, + _HTRBDa, + 0, + (_m,), + ((HARNESS_TOOL_RESULT_BLOCK_DELTA, 0),), +) + +HARNESS_TOOL_RESULT_METADATA_BLOCK_DELTA: StaticSchema = ( + 18, + n0, + _HTRMBD, + 0, + (_met,), + ((SENSITIVE_TEXT, 1),), +) + +HARNESS_TOOL_USE_BLOCK_DELTA: StaticSchema = ( + 18, + n0, + _HTUBD, + 0, + (_inp,), + ((SENSITIVE_TEXT, 1),), +) + +HARNESS_CONTENT_BLOCK_DELTA: StaticSchema = ( + 19, + n0, + _HCBD, + 0, + (_te, _tUo, _tRo, _rCea, _tRM), + ( + (SENSITIVE_TEXT, 0), + (HARNESS_TOOL_USE_BLOCK_DELTA, 0), + (HARNESS_TOOL_RESULT_BLOCKS_DELTA, 0), + (HARNESS_REASONING_CONTENT_BLOCK_DELTA, 0), + (HARNESS_TOOL_RESULT_METADATA_BLOCK_DELTA, 0), + ), ) -CONFIGURATION_BUNDLE_VERSION_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#ConfigurationBundleVersionId"), - shape_type=ShapeType.STRING, -) - -SYSTEM_PROMPT_CONFIGURATION_BUNDLE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#SystemPromptConfigurationBundle"), - members={ - "bundleArn": { - "target": CONFIGURATION_BUNDLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "versionId": { - "target": CONFIGURATION_BUNDLE_VERSION_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "systemPromptJsonPath": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +HARNESS_CONTENT_BLOCK_DELTA_EVENT: StaticSchema = ( + 18, + n0, + _HCBDE, + 0, + (_cBI, _del), + ((7, 1), (HARNESS_CONTENT_BLOCK_DELTA, 1)), +) + +HARNESS_TOOL_RESULT_BLOCK_START: StaticSchema = ( + 18, + n0, + _HTRBS, + 0, + (_tUI, _st), + ((HARNESS_TOOL_USE_ID, 1), (HARNESS_TOOL_USE_STATUS, 0)), +) + +HARNESS_TOOL_USE_BLOCK_START: StaticSchema = ( + 18, + n0, + _HTUBS, + 0, + (_tUI, _n, _ty, _sNe), + ( + (HARNESS_TOOL_USE_ID, 1), + (HARNESS_TOOL_NAME, 1), + (HARNESS_TOOL_USE_TYPE, 0), + (3, 0), + ), ) -SYSTEM_PROMPT_TEXT = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#SystemPromptText"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +HARNESS_CONTENT_BLOCK_START: StaticSchema = ( + 19, + n0, + _HCBS, + 0, + (_tUo, _tRo), + ((HARNESS_TOOL_USE_BLOCK_START, 0), (HARNESS_TOOL_RESULT_BLOCK_START, 0)), +) + +HARNESS_CONTENT_BLOCK_START_EVENT: StaticSchema = ( + 18, + n0, + _HCBSE, + 0, + (_cBI, _star), + ((7, 1), (HARNESS_CONTENT_BLOCK_START, 1)), +) + +HARNESS_CONTENT_BLOCK_STOP_EVENT: StaticSchema = ( + 18, + n0, + _HCBSEa, + 0, + (_cBI,), + ((7, 1),), +) + +HARNESS_HOOK_DECISION: StaticSchema = ( + 14, + n0, + _HHD, + 0, + (_ALLOW, _DENY), + ((-1, {_sVm: _al}), (-1, {_sVm: _den})), +) + +HARNESS_HOOK_EVENT_ID: StaticSchema = (3, n0, _HHEI, 0) + +HARNESS_HOOK_NAME: StaticSchema = (3, n0, _HHN, 0) + +HARNESS_HOOK_EVENT_TYPE: StaticSchema = ( + 14, + n0, + _HHET, + 0, + (_BTC, _ATC_, _BI, _AI_), + ((-1, {_sVm: _btc}), (-1, {_sVm: _atc}), (-1, {_sVm: _bi}), (-1, {_sVm: _ai})), +) + +HARNESS_HOOK_EVENT: StaticSchema = ( + 18, + n0, + _HHE, + 0, + (_hEI, _n, _ty, _dec, _re), + ( + (HARNESS_HOOK_EVENT_ID, 1), + (HARNESS_HOOK_NAME, 1), + (HARNESS_HOOK_EVENT_TYPE, 1), + (HARNESS_HOOK_DECISION, 0), + (3, 0), + ), ) -SYSTEM_PROMPT_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#SystemPromptConfig"), - shape_type=ShapeType.UNION, - members={ - "text": {"target": SYSTEM_PROMPT_TEXT}, - "configurationBundle": {"target": SYSTEM_PROMPT_CONFIGURATION_BUNDLE}, - }, +HARNESS_MESSAGE_START_EVENT: StaticSchema = ( + 18, + n0, + _HMSE, + 0, + (_ro,), + ((HARNESS_CONVERSATION_ROLE, 1),), +) + +HARNESS_STOP_REASON: StaticSchema = ( + 14, + n0, + _HSR, + 0, + ( + _ET_, + _TU_, + _TR_, + _MT_, + _SS_, + _CF_, + _MMO, + _MTU_, + _INTERRUPTED, + _PT, + _MCWE, + _MIE, + _MOTE, + _TE__, + _HS_, + ), + ( + (-1, {_sVm: _et}), + (-1, {_sVm: _tu_}), + (-1, {_sVm: _tr_}), + (-1, {_sVm: _mt}), + (-1, {_sVm: _ss}), + (-1, {_sVm: _cf}), + (-1, {_sVm: _mmo}), + (-1, {_sVm: _mtu_}), + (-1, {_sVm: _int}), + (-1, {_sVm: _pt}), + (-1, {_sVm: _mcwe}), + (-1, {_sVm: _mie}), + (-1, {_sVm: _mote}), + (-1, {_sVm: _te_}), + (-1, {_sVm: _hs}), + ), ) -SYSTEM_PROMPT_RECOMMENDATION_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#SystemPromptRecommendationConfig"), - members={ - "systemPrompt": { - "target": SYSTEM_PROMPT_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentTraces": { - "target": AGENT_TRACES_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "evaluationConfig": {"target": RECOMMENDATION_EVALUATION_CONFIG}, - }, +HARNESS_MESSAGE_STOP_EVENT: StaticSchema = ( + 18, + n0, + _HMSEa, + 0, + (_sR,), + ((HARNESS_STOP_REASON, 1),), +) + +HARNESS_STREAM_METRICS: StaticSchema = (18, n0, _HSM, 0, (_lM,), ((8, 1),)) + +HARNESS_TOKEN_USAGE: StaticSchema = ( + 18, + n0, + _HTU, + 0, + (_iT, _oT, _tT, _cRIT, _cWIT), + ((7, 1), (7, 1), (7, 1), (7, 0), (7, 0)), +) + +HARNESS_METADATA_EVENT: StaticSchema = ( + 18, + n0, + _HME, + 0, + (_usa, _metr), + ((HARNESS_TOKEN_USAGE, 1), (HARNESS_STREAM_METRICS, 1)), +) + +INVOKE_HARNESS_STREAM_OUTPUT: StaticSchema = ( + 19, + n0, + _IHSO, + {_smithya: None}, + (_mSe, _cBS, _cBD, _cBSo, _mSes, _met, _iSE, _vE, _rCE, _hE), + ( + (HARNESS_MESSAGE_START_EVENT, 0), + (HARNESS_CONTENT_BLOCK_START_EVENT, 0), + (HARNESS_CONTENT_BLOCK_DELTA_EVENT, 0), + (HARNESS_CONTENT_BLOCK_STOP_EVENT, 0), + (HARNESS_MESSAGE_STOP_EVENT, 0), + (HARNESS_METADATA_EVENT, 0), + (INTERNAL_SERVER_EXCEPTION, 0), + (VALIDATION_EXCEPTION, 0), + (RUNTIME_CLIENT_ERROR, 0), + (HARNESS_HOOK_EVENT, 0), + ), ) -RECOMMENDATION_TOOL_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#RecommendationToolName"), - shape_type=ShapeType.STRING, +INVOKE_HARNESS_OUTPUT: StaticSchema = ( + 18, + n0, + _IHO, + {_sSI: _cIHRo, _smith: None}, + (_str,), + ((INVOKE_HARNESS_STREAM_OUTPUT, 17),), +) + +INVOKE_HARNESS: StaticOperationSchema = ( + 23, + n0, + _IH, + { + _smithy: MappingProxyType( + {"code": 200, "method": "POST", "uri": "/harnesses/invoke"} + ) + }, + INVOKE_HARNESS_INPUT, + INVOKE_HARNESS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + RUNTIME_CLIENT_ERROR, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CONFIGURATION_BUNDLE_TOOL_ENTRY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ConfigurationBundleToolEntry"), - members={ - "toolName": { - "target": RECOMMENDATION_TOOL_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "toolDescriptionJsonPath": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +MEMORY_ID: StaticSchema = (3, n0, _MIe, 0) -CONFIGURATION_BUNDLE_TOOL_ENTRY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ConfigurationBundleToolEntryList"), - shape_type=ShapeType.LIST, - members={"member": {"target": CONFIGURATION_BUNDLE_TOOL_ENTRY}}, -) - -TOOL_DESCRIPTION_CONFIGURATION_BUNDLE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ToolDescriptionConfigurationBundle"), - members={ - "bundleArn": { - "target": CONFIGURATION_BUNDLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "versionId": { - "target": CONFIGURATION_BUNDLE_VERSION_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "tools": { - "target": CONFIGURATION_BUNDLE_TOOL_ENTRY_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +SENSITIVE_STRING: StaticSchema = (3, n0, _SSe, 4) -TOOL_DESCRIPTION_TEXT = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#ToolDescriptionText"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) +MEMORY_CONTENT: StaticSchema = (19, n0, _MC, 0, (_te,), ((SENSITIVE_STRING, 0),)) -TOOL_DESCRIPTION_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ToolDescriptionConfig"), - shape_type=ShapeType.UNION, - members={"text": {"target": TOOL_DESCRIPTION_TEXT}}, -) +MEMORY_STRATEGY_ID: StaticSchema = (3, n0, _MSIe, 0) -TOOL_DESCRIPTION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ToolDescriptionInput"), - members={ - "toolName": { - "target": RECOMMENDATION_TOOL_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "toolDescription": { - "target": TOOL_DESCRIPTION_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +METADATA_KEY: StaticSchema = (3, n0, _MK, 0) -TOOL_DESCRIPTION_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ToolDescriptionList"), - shape_type=ShapeType.LIST, - members={"member": {"target": TOOL_DESCRIPTION_INPUT}}, -) - -TOOL_DESCRIPTION_TEXT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ToolDescriptionTextInput"), - members={ - "tools": { - "target": TOOL_DESCRIPTION_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -TOOL_DESCRIPTION_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ToolDescriptionSource"), - shape_type=ShapeType.UNION, - members={ - "toolDescriptionText": {"target": TOOL_DESCRIPTION_TEXT_INPUT}, - "configurationBundle": {"target": TOOL_DESCRIPTION_CONFIGURATION_BUNDLE}, - }, -) - -TOOL_DESCRIPTION_RECOMMENDATION_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ToolDescriptionRecommendationConfig"), - members={ - "toolDescription": { - "target": TOOL_DESCRIPTION_SOURCE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agentTraces": { - "target": AGENT_TRACES_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -RECOMMENDATION_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#RecommendationConfig"), - shape_type=ShapeType.UNION, - members={ - "systemPromptRecommendationConfig": { - "target": SYSTEM_PROMPT_RECOMMENDATION_CONFIG - }, - "toolDescriptionRecommendationConfig": { - "target": TOOL_DESCRIPTION_RECOMMENDATION_CONFIG - }, - }, -) - -RECOMMENDATION_RESULT_CONFIGURATION_BUNDLE = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockagentcore#RecommendationResultConfigurationBundle" - ), - members={ - "bundleArn": { - "target": CONFIGURATION_BUNDLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "versionId": { - "target": CONFIGURATION_BUNDLE_VERSION_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -RECOMMENDATION_ERROR_CODE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#RecommendationErrorCode"), - shape_type=ShapeType.STRING, -) - -RECOMMENDATION_ERROR_MESSAGE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#RecommendationErrorMessage"), - shape_type=ShapeType.STRING, -) - -RECOMMENDATION_EXPLANATION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#RecommendationExplanation"), - shape_type=ShapeType.STRING, -) - -SYSTEM_PROMPT_RECOMMENDATION_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#SystemPromptRecommendationResult"), - members={ - "recommendedSystemPrompt": {"target": SYSTEM_PROMPT_TEXT}, - "configurationBundle": {"target": RECOMMENDATION_RESULT_CONFIGURATION_BUNDLE}, - "explanation": {"target": RECOMMENDATION_EXPLANATION}, - "errorCode": {"target": RECOMMENDATION_ERROR_CODE}, - "errorMessage": {"target": RECOMMENDATION_ERROR_MESSAGE}, - }, -) - -TOOL_DESCRIPTION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ToolDescriptionOutput"), - members={ - "toolName": { - "target": RECOMMENDATION_TOOL_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "recommendedToolDescription": {"target": TOOL_DESCRIPTION_TEXT}, - "explanation": {"target": RECOMMENDATION_EXPLANATION}, - }, -) - -TOOL_DESCRIPTION_RESULT_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ToolDescriptionResultList"), - shape_type=ShapeType.LIST, - members={"member": {"target": TOOL_DESCRIPTION_OUTPUT}}, -) - -TOOL_DESCRIPTION_RECOMMENDATION_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ToolDescriptionRecommendationResult"), - members={ - "tools": {"target": TOOL_DESCRIPTION_RESULT_LIST}, - "configurationBundle": {"target": RECOMMENDATION_RESULT_CONFIGURATION_BUNDLE}, - "errorCode": {"target": RECOMMENDATION_ERROR_CODE}, - "errorMessage": {"target": RECOMMENDATION_ERROR_MESSAGE}, - }, -) - -RECOMMENDATION_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#RecommendationResult"), - shape_type=ShapeType.UNION, - members={ - "systemPromptRecommendationResult": { - "target": SYSTEM_PROMPT_RECOMMENDATION_RESULT - }, - "toolDescriptionRecommendationResult": { - "target": TOOL_DESCRIPTION_RECOMMENDATION_RESULT - }, - }, -) - -RECOMMENDATION_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#RecommendationType"), - shape_type=ShapeType.ENUM, - members={ - "SYSTEM_PROMPT_RECOMMENDATION": {"target": UNIT}, - "TOOL_DESCRIPTION_RECOMMENDATION": {"target": UNIT}, - }, -) - -GET_RECOMMENDATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#GetRecommendationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#GetRecommendationResponse", - ) - ], - members={ - "recommendationId": { - "target": RECOMMENDATION_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "recommendationArn": { - "target": RECOMMENDATION_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": RECOMMENDATION_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": RECOMMENDATION_DESCRIPTION}, - "type": { - "target": RECOMMENDATION_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "recommendationConfig": { - "target": RECOMMENDATION_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": RECOMMENDATION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#timestampFormat"), value="date-time"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "updatedAt": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#timestampFormat"), value="date-time"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "recommendationResult": {"target": RECOMMENDATION_RESULT}, - "kmsKeyArn": {"target": KMS_KEY_ARN}, - }, -) - -GET_RECOMMENDATION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#GetRecommendation"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/recommendations/{recommendationId}"} - ), - ) - ], -) - -LIST_AB_TESTS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ListABTestsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#ListABTestsRequest", - ) - ], - members={ - "maxResults": { - "target": INTEGER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "nextToken": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - }, -) - -LIST_AB_TESTS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ListABTestsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#ListABTestsResponse", - ) - ], - members={ - "abTests": { - "target": AB_TEST_SUMMARY_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": STRING}, - }, -) - -LIST_AB_TESTS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#ListABTests"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType({"method": "GET", "uri": "/ab-tests"}), - ) - ], -) - -LIST_BATCH_EVALUATIONS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ListBatchEvaluationsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#ListBatchEvaluationsRequest", - ) - ], - members={ - "maxResults": { - "target": INTEGER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "nextToken": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - }, -) +STRING_LIST_MEMBER_VALUE: StaticSchema = (3, n0, _SLMV, 0) -BATCH_EVALUATION_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#BatchEvaluationSummary"), - members={ - "batchEvaluationId": { - "target": BATCH_EVALUATION_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "batchEvaluationArn": { - "target": BATCH_EVALUATION_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "batchEvaluationName": { - "target": BATCH_EVALUATION_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": BATCH_EVALUATION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#timestampFormat"), value="date-time"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "description": {"target": BATCH_EVALUATION_DESCRIPTION}, - "evaluators": {"target": EVALUATOR_LIST}, - "insights": {"target": INSIGHT_LIST}, - "evaluationResults": {"target": EVALUATION_JOB_RESULTS}, - "errorDetails": {"target": ERROR_DETAILS_LIST}, - "kmsKeyArn": {"target": KMS_KEY_ARN}, - "updatedAt": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#timestampFormat"), value="date-time") - ], - }, - }, +STRING_VALUE_LIST: StaticSchema = ( + 16, + n0, + _SVL, + 0, + (_m,), + ((STRING_LIST_MEMBER_VALUE, 0),), ) -BATCH_EVALUATION_SUMMARY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#BatchEvaluationSummaryList"), - shape_type=ShapeType.LIST, - members={"member": {"target": BATCH_EVALUATION_SUMMARY}}, -) +STRING_VALUE: StaticSchema = (3, n0, _SVt, 0) -LIST_BATCH_EVALUATIONS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ListBatchEvaluationsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#ListBatchEvaluationsResponse", - ) - ], - members={ - "batchEvaluations": { - "target": BATCH_EVALUATION_SUMMARY_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": STRING}, - }, +MEMORY_RECORD_METADATA_VALUE: StaticSchema = ( + 19, + n0, + _MRMV, + 0, + (_sVt, _sLV, _nV, _dTV), + ((STRING_VALUE, 0), (STRING_VALUE_LIST, 0), (10, 0), (4, 0)), ) -LIST_BATCH_EVALUATIONS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#ListBatchEvaluations"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/evaluations/batch-evaluate"} - ), - ) - ], +MEMORY_RECORD_METADATA_MAP: StaticSchema = ( + 17, + n0, + _MRMM, + 0, + (_k, _va), + ((METADATA_KEY, 0), (MEMORY_RECORD_METADATA_VALUE, 0)), ) -LIST_RECOMMENDATIONS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ListRecommendationsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#ListRecommendationsRequest", - ) - ], - members={ - "maxResults": { - "target": INTEGER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "statusFilter": { - "target": RECOMMENDATION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="status")], - }, - }, -) +NAMESPACE: StaticSchema = (3, n0, _Na, 0) -RECOMMENDATION_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#RecommendationSummary"), - members={ - "recommendationId": { - "target": RECOMMENDATION_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "recommendationArn": { - "target": RECOMMENDATION_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": RECOMMENDATION_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": RECOMMENDATION_DESCRIPTION}, - "type": { - "target": RECOMMENDATION_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": RECOMMENDATION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#timestampFormat"), value="date-time"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "updatedAt": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#timestampFormat"), value="date-time"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - }, -) +NAMESPACES_LIST: StaticSchema = (16, n0, _NL, 0, (_m,), ((NAMESPACE, 0),)) -RECOMMENDATION_SUMMARY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#RecommendationSummaryList"), - shape_type=ShapeType.LIST, - members={"member": {"target": RECOMMENDATION_SUMMARY}}, -) +REQUEST_IDENTIFIER: StaticSchema = (3, n0, _RIe, 0) -LIST_RECOMMENDATIONS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ListRecommendationsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#ListRecommendationsResponse", - ) - ], - members={ - "recommendationSummaries": { - "target": RECOMMENDATION_SUMMARY_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": NEXT_TOKEN}, - }, +MEMORY_RECORD_CREATE_INPUT: StaticSchema = ( + 18, + n0, + _MRCI, + 0, + (_rIe, _na, _cont, _tim, _mSIe, _met), + ( + (REQUEST_IDENTIFIER, 1), + (NAMESPACES_LIST, 1), + (MEMORY_CONTENT, 1), + (4, 1), + (MEMORY_STRATEGY_ID, 0), + (MEMORY_RECORD_METADATA_MAP, 0), + ), ) -LIST_RECOMMENDATIONS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#ListRecommendations"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType({"method": "GET", "uri": "/recommendations"}), - ) - ], +MEMORY_RECORDS_CREATE_INPUT_LIST: StaticSchema = ( + 16, + n0, + _MRCIL, + 0, + (_m,), + ((MEMORY_RECORD_CREATE_INPUT, 0),), +) + +BATCH_CREATE_MEMORY_RECORDS_INPUT: StaticSchema = ( + 18, + n0, + _BCMRI, + {_smit: None}, + (_mIe, _rec, _cTl), + ((MEMORY_ID, 9), (MEMORY_RECORDS_CREATE_INPUT_LIST, 1), (3, 2)), +) + +MEMORY_RECORD_ID: StaticSchema = (3, n0, _MRI, 0) + +MEMORY_RECORD_STATUS: StaticSchema = ( + 14, + n0, + _MRS, + 0, + (_SUCCEEDED, _FAILED), + ((-1, {_sVm: _SUCCEEDED}), (-1, {_sVm: _FAILED})), +) + +MEMORY_RECORD_OUTPUT: StaticSchema = ( + 18, + n0, + _MRO, + 0, + (_mRI, _st, _rIe, _eCr, _eMr), + ( + (MEMORY_RECORD_ID, 1), + (MEMORY_RECORD_STATUS, 1), + (REQUEST_IDENTIFIER, 0), + (7, 0), + (3, 0), + ), ) -GROUND_TRUTH_TURN_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#GroundTruthTurnInput"), - shape_type=ShapeType.UNION, - members={"prompt": {"target": STRING}}, +MEMORY_RECORDS_OUTPUT_LIST: StaticSchema = ( + 16, + n0, + _MROL, + 0, + (_m,), + ((MEMORY_RECORD_OUTPUT, 0),), +) + +BATCH_CREATE_MEMORY_RECORDS_OUTPUT: StaticSchema = ( + 18, + n0, + _BCMRO, + {_smith: None}, + (_sRu, _fR), + ((MEMORY_RECORDS_OUTPUT_LIST, 1), (MEMORY_RECORDS_OUTPUT_LIST, 1)), +) + +SERVICE_EXCEPTION: StaticSchema = ( + 18, + n0, + _SE, + {_sm: _se, _sE: 500}, + (_mes,), + ((3, 1),), +) + +THROTTLED_EXCEPTION: StaticSchema = ( + 18, + n0, + _TEh, + {_sm: _c, _sE: 429}, + (_mes,), + ((3, 1),), +) + +BATCH_CREATE_MEMORY_RECORDS: StaticOperationSchema = ( + 23, + n0, + _BCMR, + { + _smithy: MappingProxyType( + { + "code": 201, + "method": "POST", + "uri": "/memories/{memoryId}/memoryRecords/batchCreate", + } + ) + }, + BATCH_CREATE_MEMORY_RECORDS_INPUT, + BATCH_CREATE_MEMORY_RECORDS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -GROUND_TRUTH_TURN = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#GroundTruthTurn"), - members={ - "input": {"target": GROUND_TRUTH_TURN_INPUT}, - "expectedResponse": {"target": EVALUATION_CONTENT}, - }, +MEMORY_RECORD_DELETE_INPUT: StaticSchema = ( + 18, + n0, + _MRDI, + 0, + (_mRI, _nam), + ((MEMORY_RECORD_ID, 1), (NAMESPACE, 0)), +) + +MEMORY_RECORDS_DELETE_INPUT_LIST: StaticSchema = ( + 16, + n0, + _MRDIL, + 0, + (_m,), + ((MEMORY_RECORD_DELETE_INPUT, 0),), +) + +BATCH_DELETE_MEMORY_RECORDS_INPUT: StaticSchema = ( + 18, + n0, + _BDMRI, + {_smit: None}, + (_mIe, _rec), + ((MEMORY_ID, 9), (MEMORY_RECORDS_DELETE_INPUT_LIST, 1)), +) + +BATCH_DELETE_MEMORY_RECORDS_OUTPUT: StaticSchema = ( + 18, + n0, + _BDMRO, + {_smith: None}, + (_sRu, _fR), + ((MEMORY_RECORDS_OUTPUT_LIST, 1), (MEMORY_RECORDS_OUTPUT_LIST, 1)), +) + +BATCH_DELETE_MEMORY_RECORDS: StaticOperationSchema = ( + 23, + n0, + _BDMR, + { + _smithy: MappingProxyType( + {"method": "POST", "uri": "/memories/{memoryId}/memoryRecords/batchDelete"} + ) + }, + BATCH_DELETE_MEMORY_RECORDS_INPUT, + BATCH_DELETE_MEMORY_RECORDS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -GROUND_TRUTH_TURN_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#GroundTruthTurnList"), - shape_type=ShapeType.LIST, - members={"member": {"target": GROUND_TRUTH_TURN}}, +MEMORY_RECORD_UPDATE_INPUT: StaticSchema = ( + 18, + n0, + _MRUI, + 0, + (_mRI, _tim, _cont, _na, _sNo, _mSIe, _met), + ( + (MEMORY_RECORD_ID, 1), + (4, 1), + (MEMORY_CONTENT, 0), + (NAMESPACES_LIST, 0), + (NAMESPACES_LIST, 0), + (MEMORY_STRATEGY_ID, 0), + (MEMORY_RECORD_METADATA_MAP, 0), + ), ) -INLINE_GROUND_TRUTH = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#InlineGroundTruth"), - members={ - "assertions": {"target": EVALUATION_CONTENT_LIST}, - "expectedTrajectory": {"target": EVALUATION_EXPECTED_TRAJECTORY}, - "turns": {"target": GROUND_TRUTH_TURN_LIST}, - }, +MEMORY_RECORDS_UPDATE_INPUT_LIST: StaticSchema = ( + 16, + n0, + _MRUIL, + 0, + (_m,), + ((MEMORY_RECORD_UPDATE_INPUT, 0),), +) + +BATCH_UPDATE_MEMORY_RECORDS_INPUT: StaticSchema = ( + 18, + n0, + _BUMRI, + {_smit: None}, + (_mIe, _rec), + ((MEMORY_ID, 9), (MEMORY_RECORDS_UPDATE_INPUT_LIST, 1)), +) + +BATCH_UPDATE_MEMORY_RECORDS_OUTPUT: StaticSchema = ( + 18, + n0, + _BUMRO, + {_smith: None}, + (_sRu, _fR), + ((MEMORY_RECORDS_OUTPUT_LIST, 1), (MEMORY_RECORDS_OUTPUT_LIST, 1)), +) + +BATCH_UPDATE_MEMORY_RECORDS: StaticOperationSchema = ( + 23, + n0, + _BUMR, + { + _smithy: MappingProxyType( + {"method": "POST", "uri": "/memories/{memoryId}/memoryRecords/batchUpdate"} + ) + }, + BATCH_UPDATE_MEMORY_RECORDS_INPUT, + BATCH_UPDATE_MEMORY_RECORDS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -GROUND_TRUTH_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#GroundTruthSource"), - shape_type=ShapeType.UNION, - members={"inline": {"target": INLINE_GROUND_TRUTH}}, -) +BRANCH_NAME: StaticSchema = (3, n0, _BN, 0) -STRING_MAP = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#StringMap"), - shape_type=ShapeType.MAP, - members={"key": {"target": STRING}, "value": {"target": STRING}}, -) +EVENT_ID: StaticSchema = (3, n0, _EIve, 0) -SESSION_METADATA_SHAPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#SessionMetadataShape"), - members={ - "sessionId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "testScenarioId": {"target": STRING}, - "groundTruth": {"target": GROUND_TRUTH_SOURCE}, - "metadata": {"target": STRING_MAP}, - }, -) +BRANCH: StaticSchema = (18, n0, _Br, 0, (_rEI, _n), ((EVENT_ID, 0), (BRANCH_NAME, 1))) -SESSION_METADATA_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#SessionMetadataList"), - shape_type=ShapeType.LIST, - members={"member": {"target": SESSION_METADATA_SHAPE}}, -) +NAMESPACE_VARIABLE_NAME: StaticSchema = (3, n0, _NVN, 0) -EVALUATION_METADATA = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#EvaluationMetadata"), - shape_type=ShapeType.UNION, - members={"sessionMetadata": {"target": SESSION_METADATA_LIST}}, -) +NAMESPACE_VARIABLE_VALUE: StaticSchema = (3, n0, _NVV, 0) -START_BATCH_EVALUATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#StartBatchEvaluationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#StartBatchEvaluationRequest", - ) - ], - members={ - "batchEvaluationName": { - "target": BATCH_EVALUATION_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "evaluators": {"target": EVALUATOR_LIST}, - "insights": {"target": INSIGHT_LIST}, - "dataSourceConfig": { - "target": DATA_SOURCE_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "evaluationMetadata": {"target": EVALUATION_METADATA}, - "tags": {"target": TAGS_MAP}, - "kmsKeyArn": {"target": KMS_KEY_ARN}, - "description": {"target": BATCH_EVALUATION_DESCRIPTION}, - "outputConfig": {"target": OUTPUT_CONFIG}, - }, +NAMESPACE_VARIABLES_MAP: StaticSchema = ( + 17, + n0, + _NVM, + 0, + (_k, _va), + ((NAMESPACE_VARIABLE_NAME, 0), (NAMESPACE_VARIABLE_VALUE, 0)), ) -START_BATCH_EVALUATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#StartBatchEvaluationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#StartBatchEvaluationResponse", - ) - ], - members={ - "batchEvaluationId": { - "target": BATCH_EVALUATION_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "batchEvaluationArn": { - "target": BATCH_EVALUATION_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "batchEvaluationName": { - "target": BATCH_EVALUATION_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "evaluators": {"target": EVALUATOR_LIST}, - "insights": {"target": INSIGHT_LIST}, - "status": { - "target": BATCH_EVALUATION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#timestampFormat"), value="date-time"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "outputConfig": {"target": OUTPUT_CONFIG}, - "tags": {"target": TAGS_MAP}, - "kmsKeyArn": {"target": KMS_KEY_ARN}, - "description": {"target": BATCH_EVALUATION_DESCRIPTION}, - }, +EXTRACTION_CONFIG: StaticSchema = ( + 18, + n0, + _ECx, + 0, + (_nVa,), + ((NAMESPACE_VARIABLES_MAP, 0),), ) -START_BATCH_EVALUATION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#StartBatchEvaluation"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/evaluations/batch-evaluate", "code": 202} - ), - ) - ], -) +EXTRACTION_MODE: StaticSchema = (14, n0, _EMx, 0, (_SKIP,), ((-1, {_sVm: _SKIP}),)) -START_RECOMMENDATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#StartRecommendationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#StartRecommendationRequest", - ) - ], - members={ - "name": { - "target": RECOMMENDATION_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": RECOMMENDATION_DESCRIPTION}, - "type": { - "target": RECOMMENDATION_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "recommendationConfig": { - "target": RECOMMENDATION_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "kmsKeyArn": {"target": KMS_KEY_ARN}, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "tags": {"target": TAGS_MAP}, - }, -) +METADATA_VALUE: StaticSchema = (19, n0, _MV, 0, (_sVt,), ((3, 0),)) -START_RECOMMENDATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#StartRecommendationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#StartRecommendationResponse", - ) - ], - members={ - "recommendationId": { - "target": RECOMMENDATION_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "recommendationArn": { - "target": RECOMMENDATION_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": RECOMMENDATION_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": RECOMMENDATION_DESCRIPTION}, - "type": { - "target": RECOMMENDATION_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "recommendationConfig": { - "target": RECOMMENDATION_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": RECOMMENDATION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#timestampFormat"), value="date-time"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "updatedAt": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#timestampFormat"), value="date-time"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - }, +METADATA_MAP: StaticSchema = ( + 17, + n0, + _MMe, + 0, + (_k, _va), + ((METADATA_KEY, 0), (METADATA_VALUE, 0)), ) -START_RECOMMENDATION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#StartRecommendation"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/recommendations", "code": 202} - ), - ) - ], -) +MEMORY_DOCUMENT: StaticSchema = (13, n0, _MD, 4) -STOP_BATCH_EVALUATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#StopBatchEvaluationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#StopBatchEvaluationRequest", - ) - ], - members={ - "batchEvaluationId": { - "target": BATCH_EVALUATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) +CONTENT: StaticSchema = (19, n0, _Con, 0, (_te,), ((SENSITIVE_STRING, 0),)) -STOP_BATCH_EVALUATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#StopBatchEvaluationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#StopBatchEvaluationResponse", - ) - ], - members={ - "batchEvaluationId": { - "target": BATCH_EVALUATION_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "batchEvaluationArn": { - "target": BATCH_EVALUATION_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": BATCH_EVALUATION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": BATCH_EVALUATION_DESCRIPTION}, - }, +ROLE: StaticSchema = ( + 14, + n0, + _R, + 0, + (_ASSISTANT, _USER, _TOOL, _OTHER), + ( + (-1, {_sVm: _ASSISTANT}), + (-1, {_sVm: _USER}), + (-1, {_sVm: _TOOL}), + (-1, {_sVm: _OTHER}), + ), ) -STOP_BATCH_EVALUATION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#StopBatchEvaluation"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/evaluations/batch-evaluate/{batchEvaluationId}/stop", - "code": 202, - } - ), - ) - ], +CONVERSATIONAL: StaticSchema = ( + 18, + n0, + _Conv, + 0, + (_cont, _ro), + ((CONTENT, 1), (ROLE, 1)), +) + +MEMORY_JSON_DATA_CONTENT: StaticSchema = (13, n0, _MJDC, 4) + +MEMORY_JSON_DATA: StaticSchema = ( + 18, + n0, + _MJD, + 4, + (_cont,), + ((MEMORY_JSON_DATA_CONTENT, 1),), +) + +PAYLOAD_TYPE: StaticSchema = ( + 19, + n0, + _PTa, + 0, + (_conv, _bl, _js), + ((CONVERSATIONAL, 0), (MEMORY_DOCUMENT, 0), (MEMORY_JSON_DATA, 0)), +) + +PAYLOAD_TYPE_LIST: StaticSchema = (16, n0, _PTL, 0, (_m,), ((PAYLOAD_TYPE, 0),)) + +CREATE_EVENT_INPUT: StaticSchema = ( + 18, + n0, + _CEI, + {_smit: None}, + (_mIe, _aI, _sIe, _eTve, _p, _br, _cTl, _met, _eMx, _eCxt), + ( + (MEMORY_ID, 9), + (ACTOR_ID, 1), + (SESSION_ID, 0), + (4, 1), + (PAYLOAD_TYPE_LIST, 1), + (BRANCH, 0), + (3, 2), + (METADATA_MAP, 0), + (EXTRACTION_MODE, 0), + (EXTRACTION_CONFIG, 0), + ), ) -UPDATE_AB_TEST_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#UpdateABTestInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#UpdateABTestRequest", - ) - ], - members={ - "abTestId": { - "target": AB_TEST_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "name": {"target": AB_TEST_NAME}, - "description": {"target": AB_TEST_DESCRIPTION}, - "variants": {"target": VARIANT_LIST}, - "gatewayFilter": {"target": GATEWAY_FILTER}, - "evaluationConfig": {"target": AB_TEST_EVALUATION_CONFIG}, - "roleArn": {"target": ROLE_ARN}, - "executionStatus": {"target": AB_TEST_EXECUTION_STATUS}, - }, +EVENT: StaticSchema = ( + 18, + n0, + _Eve, + 0, + (_mIe, _aI, _sIe, _eIve, _eTve, _p, _br, _met), + ( + (MEMORY_ID, 1), + (ACTOR_ID, 1), + (SESSION_ID, 1), + (EVENT_ID, 1), + (4, 1), + (PAYLOAD_TYPE_LIST, 1), + (BRANCH, 0), + (METADATA_MAP, 0), + ), ) -UPDATE_AB_TEST_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#UpdateABTestOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#UpdateABTestResponse", - ) - ], - members={ - "abTestId": { - "target": AB_TEST_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "abTestArn": { - "target": AB_TEST_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": AB_TEST_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "executionStatus": { - "target": AB_TEST_EXECUTION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +CREATE_EVENT_OUTPUT: StaticSchema = ( + 18, + n0, + _CEO, + {_smith: None}, + (_eve,), + ((EVENT, 1),), +) + +INVALID_INPUT_EXCEPTION: StaticSchema = ( + 18, + n0, + _IIE, + {_sm: _c, _sE: 400}, + (_mes,), + ((3, 1),), +) + +CREATE_EVENT: StaticOperationSchema = ( + 23, + n0, + _CEr, + { + _smithy: MappingProxyType( + {"code": 201, "method": "POST", "uri": "/memories/{memoryId}/events"} + ) + }, + CREATE_EVENT_INPUT, + CREATE_EVENT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INVALID_INPUT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + RETRYABLE_CONFLICT_EXCEPTION, + SERVICE_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -UPDATE_AB_TEST = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#UpdateABTest"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "PUT", "uri": "/ab-tests/{abTestId}", "code": 202} - ), - ) - ], +DELETE_EVENT_INPUT: StaticSchema = ( + 18, + n0, + _DEI, + {_smit: None}, + (_mIe, _sIe, _eIve, _aI), + ((MEMORY_ID, 9), (SESSION_ID, 9), (EVENT_ID, 9), (ACTOR_ID, 9)), +) + +DELETE_EVENT_OUTPUT: StaticSchema = ( + 18, + n0, + _DEO, + {_smith: None}, + (_eIve,), + ((EVENT_ID, 1),), +) + +DELETE_EVENT: StaticOperationSchema = ( + 23, + n0, + _DE, + { + _smithy: MappingProxyType( + { + "method": "DELETE", + "uri": "/memories/{memoryId}/actor/{actorId}/sessions/{sessionId}/events/{eventId}", + } + ) + }, + DELETE_EVENT_INPUT, + DELETE_EVENT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INVALID_INPUT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CREDENTIAL_PROVIDER_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#CredentialProviderName"), - shape_type=ShapeType.STRING, +DELETE_MEMORY_RECORD_INPUT: StaticSchema = ( + 18, + n0, + _DMRI, + {_smit: None}, + (_mIe, _mRI, _nam), + ((MEMORY_ID, 9), (MEMORY_RECORD_ID, 9), (NAMESPACE, {_sQ: _nam})), +) + +DELETE_MEMORY_RECORD_OUTPUT: StaticSchema = ( + 18, + n0, + _DMRO, + {_smith: None}, + (_mRI,), + ((MEMORY_RECORD_ID, 1),), +) + +DELETE_MEMORY_RECORD: StaticOperationSchema = ( + 23, + n0, + _DMR, + { + _smithy: MappingProxyType( + { + "method": "DELETE", + "uri": "/memories/{memoryId}/memoryRecords/{memoryRecordId}", + } + ) + }, + DELETE_MEMORY_RECORD_INPUT, + DELETE_MEMORY_RECORD_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INVALID_INPUT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -WORKLOAD_IDENTITY_TOKEN_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#WorkloadIdentityTokenType"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +GET_EVENT_INPUT: StaticSchema = ( + 18, + n0, + _GEI, + {_smit: None}, + (_mIe, _sIe, _aI, _eIve), + ((MEMORY_ID, 9), (SESSION_ID, 9), (ACTOR_ID, 9), (EVENT_ID, 9)), +) + +GET_EVENT_OUTPUT: StaticSchema = (18, n0, _GEO, {_smith: None}, (_eve,), ((EVENT, 1),)) + +GET_EVENT: StaticOperationSchema = ( + 23, + n0, + _GE, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/memories/{memoryId}/actor/{actorId}/sessions/{sessionId}/events/{eventId}", + } + ) + }, + GET_EVENT_INPUT, + GET_EVENT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INVALID_INPUT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -GET_RESOURCE_API_KEY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#GetResourceApiKeyInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#GetResourceApiKeyRequest", - ) - ], - members={ - "workloadIdentityToken": { - "target": WORKLOAD_IDENTITY_TOKEN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "resourceCredentialProviderName": { - "target": CREDENTIAL_PROVIDER_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +GET_MEMORY_RECORD_INPUT: StaticSchema = ( + 18, + n0, + _GMRI, + {_smit: None}, + (_mIe, _mRI, _nam), + ((MEMORY_ID, 9), (MEMORY_RECORD_ID, 9), (NAMESPACE, {_sQ: _nam})), +) + +MEMORY_RECORD: StaticSchema = ( + 18, + n0, + _MRe, + 0, + (_mRI, _cont, _mSIe, _na, _cA, _met), + ( + (MEMORY_RECORD_ID, 1), + (MEMORY_CONTENT, 1), + (MEMORY_STRATEGY_ID, 1), + (NAMESPACES_LIST, 1), + (4, 1), + (MEMORY_RECORD_METADATA_MAP, 0), + ), ) -API_KEY_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#ApiKeyType"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +GET_MEMORY_RECORD_OUTPUT: StaticSchema = ( + 18, + n0, + _GMRO, + {_smith: None}, + (_mRe,), + ((MEMORY_RECORD, 1),), +) + +GET_MEMORY_RECORD: StaticOperationSchema = ( + 23, + n0, + _GMR, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/memories/{memoryId}/memoryRecord/{memoryRecordId}", + } + ) + }, + GET_MEMORY_RECORD_INPUT, + GET_MEMORY_RECORD_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INVALID_INPUT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -GET_RESOURCE_API_KEY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#GetResourceApiKeyOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#GetResourceApiKeyResponse", - ) - ], - members={ - "apiKey": { - "target": API_KEY_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +INGEST_PAYLOAD_TYPE: StaticSchema = ( + 19, + n0, + _IPT, + 0, + (_conv, _js), + ((CONVERSATIONAL, 0), (MEMORY_JSON_DATA, 0)), +) + +INGEST_PAYLOAD_LIST: StaticSchema = ( + 16, + n0, + _IPL, + 0, + (_m,), + ((INGEST_PAYLOAD_TYPE, 0),), +) + +INLINE_MEMORY_CONTENT: StaticSchema = ( + 18, + n0, + _IMC, + 0, + (_p,), + ((INGEST_PAYLOAD_LIST, 1),), +) + +CONTENT_SOURCE: StaticSchema = (19, n0, _CSo, 0, (_inl,), ((INLINE_MEMORY_CONTENT, 0),)) + +INGEST_DATA_INPUT: StaticSchema = ( + 18, + n0, + _IDI, + {_smit: None}, + (_mIe, _so, _cTo, _aI, _sIe, _eCxt, _met, _cTl), + ( + (MEMORY_ID, 9), + (CONTENT_SOURCE, 1), + (4, 1), + (ACTOR_ID, 1), + (SESSION_ID, 0), + (EXTRACTION_CONFIG, 0), + (METADATA_MAP, 0), + (3, 2), + ), ) -GET_RESOURCE_API_KEY = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#GetResourceApiKey"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType({"uri": "/identities/api-key", "method": "POST"}), - ) - ], +INGEST_DATA_OUTPUT: StaticSchema = ( + 18, + n0, + _IDO, + {_smith: None}, + (_sIe,), + ((SESSION_ID, 1),), +) + +INGEST_DATA: StaticOperationSchema = ( + 23, + n0, + _ID, + { + _smithy: MappingProxyType( + {"code": 202, "method": "POST", "uri": "/memories/{memoryId}/ingest"} + ) + }, + INGEST_DATA_INPUT, + INGEST_DATA_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AUDIENCE_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#AudienceType"), - shape_type=ShapeType.STRING, +PAGINATION_TOKEN: StaticSchema = (3, n0, _PTag, 0) + +LIST_ACTORS_INPUT: StaticSchema = ( + 18, + n0, + _LAI, + {_smit: None}, + (_mIe, _mR, _nT), + ((MEMORY_ID, 9), (MAX_RESULTS, {_smithyap: 100}), (PAGINATION_TOKEN, 0)), +) + +LIST_ACTORS_OUTPUT: StaticSchema = ( + 18, + n0, + _LAO, + {_smith: None}, + (_aSc, _nT), + ((ACTOR_SUMMARY_LIST, 1), (PAGINATION_TOKEN, 0)), +) + +LIST_ACTORS: StaticOperationSchema = ( + 23, + n0, + _LA, + { + _smithy: MappingProxyType( + {"method": "POST", "uri": "/memories/{memoryId}/actors"} + ) + }, + LIST_ACTORS_INPUT, + LIST_ACTORS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INVALID_INPUT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AUDIENCES_LIST_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#AudiencesListType"), - shape_type=ShapeType.LIST, - members={"member": {"target": AUDIENCE_TYPE}}, +BRANCH_FILTER: StaticSchema = ( + 18, + n0, + _BF, + 0, + (_n, _iPB), + ((BRANCH_NAME, 1), (2, {_smithyap: True})), +) + +LEFT_EXPRESSION: StaticSchema = (19, n0, _LE, 0, (_mK,), ((METADATA_KEY, 0),)) + +OPERATOR_TYPE: StaticSchema = ( + 14, + n0, + _OT, + 0, + (_ET__, _EXISTS, _NE_), + ((-1, {_sVm: _ET__}), (-1, {_sVm: _EXISTS}), (-1, {_sVm: _NE_})), +) + +RIGHT_EXPRESSION: StaticSchema = (19, n0, _REi, 0, (_mV,), ((METADATA_VALUE, 0),)) + +EVENT_METADATA_FILTER_EXPRESSION: StaticSchema = ( + 18, + n0, + _EMFE, + 0, + (_le, _op, _ri), + ((LEFT_EXPRESSION, 1), (OPERATOR_TYPE, 1), (RIGHT_EXPRESSION, 0)), +) + +EVENT_METADATA_FILTER_LIST: StaticSchema = ( + 16, + n0, + _EMFL, + 0, + (_m,), + ((EVENT_METADATA_FILTER_EXPRESSION, 0),), +) + +FILTER_INPUT: StaticSchema = ( + 18, + n0, + _FI, + 0, + (_br, _eMve), + ((BRANCH_FILTER, 0), (EVENT_METADATA_FILTER_LIST, 0)), +) + +LIST_EVENTS_INPUT: StaticSchema = ( + 18, + n0, + _LEI, + {_smit: None}, + (_mIe, _sIe, _aI, _iP, _fi, _mR, _nT), + ( + (MEMORY_ID, 9), + (SESSION_ID, 9), + (ACTOR_ID, 9), + (2, {_smithyap: True}), + (FILTER_INPUT, 0), + (MAX_RESULTS, {_smithyap: 100}), + (PAGINATION_TOKEN, 0), + ), ) -CUSTOM_REQUEST_KEY_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#CustomRequestKeyType"), - shape_type=ShapeType.STRING, +EVENT_LIST: StaticSchema = (16, n0, _ELv, 0, (_m,), ((EVENT, 0),)) + +LIST_EVENTS_OUTPUT: StaticSchema = ( + 18, + n0, + _LEO, + {_smith: None}, + (_even, _nT), + ((EVENT_LIST, 1), (PAGINATION_TOKEN, 0)), +) + +LIST_EVENTS: StaticOperationSchema = ( + 23, + n0, + _LEi, + { + _smithy: MappingProxyType( + { + "method": "POST", + "uri": "/memories/{memoryId}/actor/{actorId}/sessions/{sessionId}", + } + ) + }, + LIST_EVENTS_INPUT, + LIST_EVENTS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INVALID_INPUT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CUSTOM_REQUEST_VALUE_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#CustomRequestValueType"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +EXTRACTION_JOB_STATUS: StaticSchema = ( + 14, + n0, + _EJS, + 0, + (_FAILED,), + ((-1, {_sVm: _FAILED}),), +) + +EXTRACTION_JOB_FILTER_INPUT: StaticSchema = ( + 18, + n0, + _EJFI, + 0, + (_sIt, _sIe, _aI, _st), + ((3, 0), (3, 0), (3, 0), (EXTRACTION_JOB_STATUS, 0)), +) + +LIST_MEMORY_EXTRACTION_JOBS_INPUT: StaticSchema = ( + 18, + n0, + _LMEJI, + {_smit: None}, + (_mIe, _mR, _fi, _nT), + ( + (MEMORY_ID, 9), + (7, {_smithyap: 20}), + (EXTRACTION_JOB_FILTER_INPUT, 0), + (PAGINATION_TOKEN, 0), + ), ) -CUSTOM_REQUEST_PARAMETERS_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#CustomRequestParametersType"), - shape_type=ShapeType.MAP, - members={ - "key": {"target": CUSTOM_REQUEST_KEY_TYPE}, - "value": {"target": CUSTOM_REQUEST_VALUE_TYPE}, - }, -) +MESSAGE_METADATA: StaticSchema = (18, n0, _MMes, 0, (_eIve, _mIes), ((3, 1), (7, 1))) -STATE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#State"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) +MESSAGES_LIST: StaticSchema = (16, n0, _ML, 0, (_m,), ((MESSAGE_METADATA, 0),)) -OAUTH2_FLOW_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#Oauth2FlowType"), - shape_type=ShapeType.ENUM, - members={ - "USER_FEDERATION": {"target": UNIT}, - "M2M": {"target": UNIT}, - "ON_BEHALF_OF_TOKEN_EXCHANGE": {"target": UNIT}, - }, -) +EXTRACTION_JOB_MESSAGES: StaticSchema = (19, n0, _EJM, 0, (_mL,), ((MESSAGES_LIST, 0),)) -RESOURCE_OAUTH2_RETURN_URL_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#ResourceOauth2ReturnUrlType"), - shape_type=ShapeType.STRING, +EXTRACTION_JOB_METADATA: StaticSchema = ( + 18, + n0, + _EJMx, + 0, + (_jID, _mess, _st, _fRa, _sIt, _sIe, _aI), + ( + (3, 1), + (EXTRACTION_JOB_MESSAGES, 1), + (EXTRACTION_JOB_STATUS, 0), + (3, 0), + (3, 0), + (3, 0), + (3, 0), + ), ) -RESOURCE_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#ResourceType"), - shape_type=ShapeType.STRING, +EXTRACTION_JOB_METADATA_LIST: StaticSchema = ( + 16, + n0, + _EJML, + 0, + (_m,), + ((EXTRACTION_JOB_METADATA, 0),), +) + +LIST_MEMORY_EXTRACTION_JOBS_OUTPUT: StaticSchema = ( + 18, + n0, + _LMEJO, + {_smith: None}, + (_jo, _nT), + ((EXTRACTION_JOB_METADATA_LIST, 1), (PAGINATION_TOKEN, 0)), +) + +LIST_MEMORY_EXTRACTION_JOBS: StaticOperationSchema = ( + 23, + n0, + _LMEJ, + { + _smithy: MappingProxyType( + {"method": "POST", "uri": "/memories/{memoryId}/extractionJobs"} + ) + }, + LIST_MEMORY_EXTRACTION_JOBS_INPUT, + LIST_MEMORY_EXTRACTION_JOBS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -RESOURCES_LIST_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ResourcesListType"), - shape_type=ShapeType.LIST, - members={"member": {"target": RESOURCE_TYPE}}, +MEMORY_RECORD_LEFT_EXPRESSION: StaticSchema = ( + 19, + n0, + _MRLE, + 0, + (_mK,), + ((METADATA_KEY, 0),), +) + +MEMORY_RECORD_OPERATOR_TYPE: StaticSchema = ( + 14, + n0, + _MROT, + 0, + (_ET__, _EXISTS, _NE_, _BEFORE, _AFTER, _CONTAINS, _GT, _GTOE_, _LT, _LTOE_), + ( + (-1, {_sVm: _ET__}), + (-1, {_sVm: _EXISTS}), + (-1, {_sVm: _NE_}), + (-1, {_sVm: _BEFORE}), + (-1, {_sVm: _AFTER}), + (-1, {_sVm: _CONTAINS}), + (-1, {_sVm: _GT}), + (-1, {_sVm: _GTOE_}), + (-1, {_sVm: _LT}), + (-1, {_sVm: _LTOE_}), + ), ) -SCOPE_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#ScopeType"), shape_type=ShapeType.STRING +MEMORY_RECORD_RIGHT_EXPRESSION: StaticSchema = ( + 19, + n0, + _MRRE, + 0, + (_mV,), + ((MEMORY_RECORD_METADATA_VALUE, 0),), +) + +MEMORY_METADATA_FILTER_EXPRESSION: StaticSchema = ( + 18, + n0, + _MMFE, + 0, + (_le, _op, _ri), + ( + (MEMORY_RECORD_LEFT_EXPRESSION, 1), + (MEMORY_RECORD_OPERATOR_TYPE, 1), + (MEMORY_RECORD_RIGHT_EXPRESSION, 0), + ), ) -SCOPES_LIST_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ScopesListType"), - shape_type=ShapeType.LIST, - members={"member": {"target": SCOPE_TYPE}}, +MEMORY_METADATA_FILTER_LIST: StaticSchema = ( + 16, + n0, + _MMFL, + 0, + (_m,), + ((MEMORY_METADATA_FILTER_EXPRESSION, 0),), +) + +LIST_MEMORY_RECORDS_INPUT: StaticSchema = ( + 18, + n0, + _LMRI, + {_smit: None}, + (_mIe, _nam, _nP, _mSIe, _mR, _nT, _mF), + ( + (MEMORY_ID, 9), + (NAMESPACE, 0), + (NAMESPACE, 0), + (MEMORY_STRATEGY_ID, 0), + (MAX_RESULTS, {_smithyap: 100}), + (PAGINATION_TOKEN, 0), + (MEMORY_METADATA_FILTER_LIST, 0), + ), ) -GET_RESOURCE_OAUTH2_TOKEN_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#GetResourceOauth2TokenInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#GetResourceOauth2TokenRequest", - ) - ], - members={ - "workloadIdentityToken": { - "target": WORKLOAD_IDENTITY_TOKEN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "resourceCredentialProviderName": { - "target": CREDENTIAL_PROVIDER_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "scopes": { - "target": SCOPES_LIST_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "oauth2Flow": { - "target": OAUTH2_FLOW_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "sessionUri": {"target": REQUEST_URI}, - "resourceOauth2ReturnUrl": {"target": RESOURCE_OAUTH2_RETURN_URL_TYPE}, - "forceAuthentication": {"target": BOOLEAN}, - "customParameters": {"target": CUSTOM_REQUEST_PARAMETERS_TYPE}, - "customState": {"target": STATE}, - "resources": {"target": RESOURCES_LIST_TYPE}, - "audiences": {"target": AUDIENCES_LIST_TYPE}, - }, +MEMORY_RECORD_SUMMARY: StaticSchema = ( + 18, + n0, + _MRSe, + 0, + (_mRI, _cont, _mSIe, _na, _cA, _scor, _met), + ( + (MEMORY_RECORD_ID, 1), + (MEMORY_CONTENT, 1), + (MEMORY_STRATEGY_ID, 1), + (NAMESPACES_LIST, 1), + (4, 1), + (10, 0), + (MEMORY_RECORD_METADATA_MAP, 0), + ), ) -AUTHORIZATION_URL_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#AuthorizationUrlType"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +MEMORY_RECORD_SUMMARY_LIST: StaticSchema = ( + 16, + n0, + _MRSL, + 0, + (_m,), + ((MEMORY_RECORD_SUMMARY, 0),), +) + +LIST_MEMORY_RECORDS_OUTPUT: StaticSchema = ( + 18, + n0, + _LMRO, + {_smith: None}, + (_mRS, _nT), + ((MEMORY_RECORD_SUMMARY_LIST, 1), (PAGINATION_TOKEN, 0)), +) + +LIST_MEMORY_RECORDS: StaticOperationSchema = ( + 23, + n0, + _LMR, + { + _smithy: MappingProxyType( + {"method": "POST", "uri": "/memories/{memoryId}/memoryRecords"} + ) + }, + LIST_MEMORY_RECORDS_INPUT, + LIST_MEMORY_RECORDS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INVALID_INPUT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -SESSION_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#SessionStatus"), - shape_type=ShapeType.ENUM, - members={"IN_PROGRESS": {"target": UNIT}, "FAILED": {"target": UNIT}}, -) +EVENT_FILTER_CONDITION: StaticSchema = (14, n0, _EFC, 0, (_HE,), ((-1, {_sVm: _HE}),)) -GET_RESOURCE_OAUTH2_TOKEN_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#GetResourceOauth2TokenOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#GetResourceOauth2TokenResponse", - ) - ], - members={ - "authorizationUrl": {"target": AUTHORIZATION_URL_TYPE}, - "accessToken": {"target": ACCESS_TOKEN_TYPE}, - "sessionUri": {"target": REQUEST_URI}, - "sessionStatus": {"target": SESSION_STATUS}, - }, -) +SESSION_FILTER: StaticSchema = (18, n0, _SFe, 0, (_eF,), ((EVENT_FILTER_CONDITION, 0),)) -GET_RESOURCE_OAUTH2_TOKEN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#GetResourceOauth2Token"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"uri": "/identities/oauth2/token", "method": "POST"} - ), - ) - ], +LIST_SESSIONS_INPUT: StaticSchema = ( + 18, + n0, + _LSI, + {_smit: None}, + (_mIe, _aI, _mR, _nT, _fi), + ( + (MEMORY_ID, 9), + (ACTOR_ID, 9), + (MAX_RESULTS, {_smithyap: 100}), + (PAGINATION_TOKEN, 0), + (SESSION_FILTER, 0), + ), ) -COINBASE_CDP_PAYMENT_REQUEST_BODY_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#CoinbaseCdpPaymentRequestBodyType"), - shape_type=ShapeType.STRING, +SESSION_SUMMARY: StaticSchema = ( + 18, + n0, + _SSes, + 0, + (_sIe, _aI, _cA), + ((SESSION_ID, 1), (ACTOR_ID, 1), (4, 1)), +) + +SESSION_SUMMARY_LIST: StaticSchema = (16, n0, _SSL, 0, (_m,), ((SESSION_SUMMARY, 0),)) + +LIST_SESSIONS_OUTPUT: StaticSchema = ( + 18, + n0, + _LSO, + {_smith: None}, + (_sSess, _nT), + ((SESSION_SUMMARY_LIST, 1), (PAGINATION_TOKEN, 0)), +) + +LIST_SESSIONS: StaticOperationSchema = ( + 23, + n0, + _LS, + { + _smithy: MappingProxyType( + {"method": "POST", "uri": "/memories/{memoryId}/actor/{actorId}/sessions"} + ) + }, + LIST_SESSIONS_INPUT, + LIST_SESSIONS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INVALID_INPUT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -PAYMENT_REQUEST_HOST_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#PaymentRequestHostType"), - shape_type=ShapeType.STRING, +SEARCH_CRITERIA: StaticSchema = ( + 18, + n0, + _SCe, + 0, + (_sQe, _mSIe, _tK, _mF), + ( + (SENSITIVE_STRING, 1), + (MEMORY_STRATEGY_ID, 0), + (7, {_smithyap: 10}), + (MEMORY_METADATA_FILTER_LIST, 0), + ), ) -PAYMENT_HTTP_METHOD_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#PaymentHttpMethodType"), - shape_type=ShapeType.ENUM, - members={ - "GET": {"target": UNIT}, - "POST": {"target": UNIT}, - "PUT": {"target": UNIT}, - "DELETE": {"target": UNIT}, - "PATCH": {"target": UNIT}, - }, +RETRIEVE_MEMORY_RECORDS_INPUT: StaticSchema = ( + 18, + n0, + _RMRI, + {_smit: None}, + (_mIe, _nam, _nP, _sCe, _nT, _mR), + ( + (MEMORY_ID, 9), + (NAMESPACE, 0), + (NAMESPACE, 0), + (SEARCH_CRITERIA, 1), + (PAGINATION_TOKEN, 0), + (MAX_RESULTS, {_smithyap: 100}), + ), ) -PAYMENT_REQUEST_PATH_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#PaymentRequestPathType"), - shape_type=ShapeType.STRING, -) - -COINBASE_CDP_TOKEN_REQUEST_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#CoinbaseCdpTokenRequestInput"), - members={ - "requestMethod": { - "target": PAYMENT_HTTP_METHOD_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "requestHost": {"target": PAYMENT_REQUEST_HOST_TYPE}, - "requestPath": { - "target": PAYMENT_REQUEST_PATH_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "includeWalletAuthToken": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "requestBody": {"target": COINBASE_CDP_PAYMENT_REQUEST_BODY_TYPE}, - }, +RETRIEVE_MEMORY_RECORDS_OUTPUT: StaticSchema = ( + 18, + n0, + _RMRO, + {_smith: None}, + (_mRS, _nT), + ((MEMORY_RECORD_SUMMARY_LIST, 1), (PAGINATION_TOKEN, 0)), +) + +RETRIEVE_MEMORY_RECORDS: StaticOperationSchema = ( + 23, + n0, + _RMR, + { + _smithy: MappingProxyType( + {"method": "POST", "uri": "/memories/{memoryId}/retrieve"} + ) + }, + RETRIEVE_MEMORY_RECORDS_INPUT, + RETRIEVE_MEMORY_RECORDS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INVALID_INPUT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -STRIPE_PRIVY_REQUEST_BODY_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#StripePrivyRequestBodyType"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +EXTRACTION_JOB: StaticSchema = (18, n0, _EJ, 0, (_jI,), ((3, 1),)) + +START_MEMORY_EXTRACTION_JOB_INPUT: StaticSchema = ( + 18, + n0, + _SMEJI, + {_smit: None}, + (_mIe, _eJ, _cTl), + ((MEMORY_ID, 9), (EXTRACTION_JOB, 1), (3, 2)), +) + +START_MEMORY_EXTRACTION_JOB_OUTPUT: StaticSchema = ( + 18, + n0, + _SMEJO, + {_smith: None}, + (_jI,), + ((3, 1),), +) + +START_MEMORY_EXTRACTION_JOB: StaticOperationSchema = ( + 23, + n0, + _SMEJ, + { + _smithy: MappingProxyType( + {"method": "POST", "uri": "/memories/{memoryId}/extractionJobs/start"} + ) + }, + START_MEMORY_EXTRACTION_JOB_INPUT, + START_MEMORY_EXTRACTION_JOB_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -STRIPE_PRIVY_REQUEST_HOST_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#StripePrivyRequestHostType"), - shape_type=ShapeType.STRING, -) +PAYMENT_AGENT_NAME: StaticSchema = (3, n0, _PAN, 0) -STRIPE_PRIVY_REQUEST_PATH_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#StripePrivyRequestPathType"), - shape_type=ShapeType.STRING, -) +PAYMENT_CONNECTOR_ID: StaticSchema = (3, n0, _PCI, 0) -STRIPE_PRIVY_TOKEN_REQUEST_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#StripePrivyTokenRequestInput"), - members={ - "requestHost": {"target": STRIPE_PRIVY_REQUEST_HOST_TYPE}, - "requestPath": { - "target": STRIPE_PRIVY_REQUEST_PATH_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "requestBody": { - "target": STRIPE_PRIVY_REQUEST_BODY_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "includeAuthorizationSignature": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - }, -) +JWT_KEY_ID: StaticSchema = (3, n0, _JKI, 0) -PAYMENT_TOKEN_REQUEST_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#PaymentTokenRequestInput"), - shape_type=ShapeType.UNION, - members={ - "coinbaseCdpTokenRequest": {"target": COINBASE_CDP_TOKEN_REQUEST_INPUT}, - "stripePrivyTokenRequest": {"target": STRIPE_PRIVY_TOKEN_REQUEST_INPUT}, - }, +LINKED_ACCOUNT_DEVELOPER_JWT: StaticSchema = ( + 18, + n0, + _LADJ, + 0, + (_ki, _sub), + ((JWT_KEY_ID, 1), (3, 1)), ) -GET_RESOURCE_PAYMENT_TOKEN_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#GetResourcePaymentTokenInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#GetResourcePaymentTokenRequest", - ) - ], - members={ - "workloadIdentityToken": { - "target": WORKLOAD_IDENTITY_TOKEN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "resourceCredentialProviderName": { - "target": CREDENTIAL_PROVIDER_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "paymentTokenRequest": { - "target": PAYMENT_TOKEN_REQUEST_INPUT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +EMAIL: StaticSchema = (3, n0, _Em, 4) -COINBASE_CDP_PAYMENT_JWT_TOKEN_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#CoinbaseCdpPaymentJwtTokenType"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) +LINKED_ACCOUNT_EMAIL: StaticSchema = (18, n0, _LAE, 4, (_eAm,), ((EMAIL, 1),)) -COINBASE_CDP_TOKEN_RESPONSE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#CoinbaseCdpTokenResponseOutput"), - members={ - "bearerToken": { - "target": COINBASE_CDP_PAYMENT_JWT_TOKEN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "walletAuthToken": {"target": COINBASE_CDP_PAYMENT_JWT_TOKEN_TYPE}, - }, +O_AUTH2_AUTHENTICATION: StaticSchema = ( + 18, + n0, + _OAA, + 4, + (_sub, _eAm, _n, _use), + ((3, 1), (EMAIL, 0), (3, 0), (3, 0)), ) -STRIPE_PRIVY_APP_ID_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#StripePrivyAppIdType"), - shape_type=ShapeType.STRING, +LINKED_ACCOUNT_O_AUTH2: StaticSchema = ( + 19, + n0, + _LAOA, + 0, + (_go, _ap, _x, _tel, _gi), + ( + (O_AUTH2_AUTHENTICATION, 0), + (O_AUTH2_AUTHENTICATION, 0), + (O_AUTH2_AUTHENTICATION, 0), + (O_AUTH2_AUTHENTICATION, 0), + (O_AUTH2_AUTHENTICATION, 0), + ), ) -STRIPE_PRIVY_AUTHORIZATION_SIGNATURE_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#StripePrivyAuthorizationSignatureType"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) +PHONE_NUMBER: StaticSchema = (3, n0, _PN, 4) -STRIPE_PRIVY_BASIC_AUTH_TOKEN_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#StripePrivyBasicAuthTokenType"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) +LINKED_ACCOUNT_SMS: StaticSchema = (18, n0, _LAS, 4, (_pN,), ((PHONE_NUMBER, 1),)) -STRIPE_PRIVY_TOKEN_RESPONSE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#StripePrivyTokenResponseOutput"), - members={ - "authorizationSignature": {"target": STRIPE_PRIVY_AUTHORIZATION_SIGNATURE_TYPE}, - "requestExpiry": {"target": LONG}, - "appId": { - "target": STRIPE_PRIVY_APP_ID_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "basicAuthToken": { - "target": STRIPE_PRIVY_BASIC_AUTH_TOKEN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +LINKED_ACCOUNT: StaticSchema = ( + 19, + n0, + _LAi, + 4, + (_em, _sms, _dJ, _oAu), + ( + (LINKED_ACCOUNT_EMAIL, 0), + (LINKED_ACCOUNT_SMS, 0), + (LINKED_ACCOUNT_DEVELOPER_JWT, 0), + (LINKED_ACCOUNT_O_AUTH2, 0), + ), ) -PAYMENT_TOKEN_RESPONSE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#PaymentTokenResponseOutput"), - shape_type=ShapeType.UNION, - members={ - "coinbaseCdpTokenResponse": {"target": COINBASE_CDP_TOKEN_RESPONSE_OUTPUT}, - "stripePrivyTokenResponse": {"target": STRIPE_PRIVY_TOKEN_RESPONSE_OUTPUT}, - }, +LINKED_ACCOUNT_LIST: StaticSchema = (16, n0, _LAL, 0, (_m,), ((LINKED_ACCOUNT, 0),)) + +CRYPTO_WALLET_NETWORK: StaticSchema = ( + 14, + n0, + _CWN, + 0, + (_ETHEREUM, _SOLANA), + ((-1, {_sVm: _ETHEREUM}), (-1, {_sVm: _SOLANA})), +) + +EMBEDDED_CRYPTO_WALLET: StaticSchema = ( + 18, + n0, + _ECW, + 0, + (_ne, _lA, _wA, _rU), + ((CRYPTO_WALLET_NETWORK, 1), (LINKED_ACCOUNT_LIST, 1), (3, 0), (3, 0)), +) + +PAYMENT_INSTRUMENT_DETAILS: StaticSchema = ( + 19, + n0, + _PID, + 0, + (_eCW,), + ((EMBEDDED_CRYPTO_WALLET, 0),), +) + +PAYMENT_INSTRUMENT_TYPE: StaticSchema = ( + 14, + n0, + _PIT, + 0, + (_ECW_,), + ((-1, {_sVm: _ECW_}),), +) + +PAYMENT_MANAGER_ARN: StaticSchema = (3, n0, _PMA, 0) + +USER_ID: StaticSchema = (3, n0, _UIs, 0) + +CREATE_PAYMENT_INSTRUMENT_INPUT: StaticSchema = ( + 18, + n0, + _CPII, + {_sSI: _cCPIR, _smit: None}, + (_uI, _aN, _pMA, _pCI, _pIT, _pID, _cTl), + ( + (USER_ID, {_sH: _XABAPUI}), + (PAYMENT_AGENT_NAME, {_sH: _XABAPAN}), + (PAYMENT_MANAGER_ARN, 1), + (PAYMENT_CONNECTOR_ID, 1), + (PAYMENT_INSTRUMENT_TYPE, 1), + (PAYMENT_INSTRUMENT_DETAILS, 1), + (CLIENT_TOKEN, 2), + ), ) -GET_RESOURCE_PAYMENT_TOKEN_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#GetResourcePaymentTokenOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#GetResourcePaymentTokenResponse", - ) - ], - members={ - "paymentTokenResponse": { - "target": PAYMENT_TOKEN_RESPONSE_OUTPUT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +PAYMENT_INSTRUMENT_ID: StaticSchema = (3, n0, _PII, 0) + +PAYMENT_INSTRUMENT_STATUS: StaticSchema = ( + 14, + n0, + _PIS, + 0, + (_INITIATED, _ACTIVE, _FAILED, _DELETED, _BLOCKED), + ( + (-1, {_sVm: _INITIATED}), + (-1, {_sVm: _ACTIVE}), + (-1, {_sVm: _FAILED}), + (-1, {_sVm: _DELETED}), + (-1, {_sVm: _BLOCKED}), + ), ) -GET_RESOURCE_PAYMENT_TOKEN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#GetResourcePaymentToken"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"uri": "/identities/payment/token", "method": "POST"} - ), - ) - ], +PAYMENT_INSTRUMENT: StaticSchema = ( + 18, + n0, + _PI, + 0, + (_pII, _pMA, _pCI, _uI, _pIT, _pID, _cA, _st, _uA), + ( + (PAYMENT_INSTRUMENT_ID, 1), + (PAYMENT_MANAGER_ARN, 1), + (PAYMENT_CONNECTOR_ID, 1), + (USER_ID, 1), + (PAYMENT_INSTRUMENT_TYPE, 1), + (PAYMENT_INSTRUMENT_DETAILS, 1), + (DATE_TIMESTAMP, 1), + (PAYMENT_INSTRUMENT_STATUS, 1), + (DATE_TIMESTAMP, 1), + ), ) -WORKLOAD_IDENTITY_NAME_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#WorkloadIdentityNameType"), - shape_type=ShapeType.STRING, +CREATE_PAYMENT_INSTRUMENT_OUTPUT: StaticSchema = ( + 18, + n0, + _CPIO, + {_sSI: _cCPIRo, _smith: None}, + (_pIa,), + ((PAYMENT_INSTRUMENT, 1),), +) + +SUBSCRIPTION_REQUIRED_EXCEPTION: StaticSchema = ( + 18, + n0, + _SRE, + {_sm: _c, _sE: 403}, + (_mes, _sUu, _pNr), + ((3, 1), (3, 0), (3, 0)), +) + +CREATE_PAYMENT_INSTRUMENT: StaticOperationSchema = ( + 23, + n0, + _CPIr, + { + _smithy: MappingProxyType( + {"code": 201, "method": "POST", "uri": "/payments/createPaymentInstrument"} + ) + }, + CREATE_PAYMENT_INSTRUMENT_INPUT, + CREATE_PAYMENT_INSTRUMENT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + SUBSCRIPTION_REQUIRED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -GET_WORKLOAD_ACCESS_TOKEN_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#GetWorkloadAccessTokenInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#GetWorkloadAccessTokenRequest", - ) - ], - members={ - "workloadName": { - "target": WORKLOAD_IDENTITY_NAME_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +DELETE_PAYMENT_INSTRUMENT_INPUT: StaticSchema = ( + 18, + n0, + _DPII, + {_sSI: _cDPIR, _smit: None}, + (_uI, _pMA, _pCI, _pII), + ( + (USER_ID, {_sH: _XABAPUI}), + (PAYMENT_MANAGER_ARN, 1), + (PAYMENT_CONNECTOR_ID, 1), + (PAYMENT_INSTRUMENT_ID, 1), + ), ) -GET_WORKLOAD_ACCESS_TOKEN_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#GetWorkloadAccessTokenOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#GetWorkloadAccessTokenResponse", - ) - ], - members={ - "workloadAccessToken": { - "target": WORKLOAD_IDENTITY_TOKEN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +DELETE_PAYMENT_INSTRUMENT_OUTPUT: StaticSchema = ( + 18, + n0, + _DPIO, + {_sSI: _cDPIRo, _smith: None}, + (_st,), + ((PAYMENT_INSTRUMENT_STATUS, 1),), +) + +DELETE_PAYMENT_INSTRUMENT: StaticOperationSchema = ( + 23, + n0, + _DPI, + { + _smithy: MappingProxyType( + {"code": 200, "method": "POST", "uri": "/payments/deletePaymentInstrument"} + ) + }, + DELETE_PAYMENT_INSTRUMENT_INPUT, + DELETE_PAYMENT_INSTRUMENT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -GET_WORKLOAD_ACCESS_TOKEN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#GetWorkloadAccessToken"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"uri": "/identities/GetWorkloadAccessToken", "method": "POST"} - ), - ) - ], +GET_PAYMENT_INSTRUMENT_INPUT: StaticSchema = ( + 18, + n0, + _GPII, + {_sSI: _cGPIR, _smit: None}, + (_uI, _aN, _pMA, _pCI, _pII), + ( + (USER_ID, {_sH: _XABAPUI}), + (PAYMENT_AGENT_NAME, {_sH: _XABAPAN}), + (PAYMENT_MANAGER_ARN, 1), + (PAYMENT_CONNECTOR_ID, 0), + (PAYMENT_INSTRUMENT_ID, 1), + ), ) -GET_WORKLOAD_ACCESS_TOKEN_FOR_JWT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#GetWorkloadAccessTokenForJWTInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#GetWorkloadAccessTokenForJWTRequest", - ) - ], - members={ - "workloadName": { - "target": WORKLOAD_IDENTITY_NAME_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "userToken": { - "target": USER_TOKEN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +GET_PAYMENT_INSTRUMENT_OUTPUT: StaticSchema = ( + 18, + n0, + _GPIO, + {_sSI: _cGPIRo, _smith: None}, + (_pIa,), + ((PAYMENT_INSTRUMENT, 1),), +) + +GET_PAYMENT_INSTRUMENT: StaticOperationSchema = ( + 23, + n0, + _GPI, + { + _smithy: MappingProxyType( + {"code": 200, "method": "POST", "uri": "/payments/getPaymentInstrument"} + ) + }, + GET_PAYMENT_INSTRUMENT_INPUT, + GET_PAYMENT_INSTRUMENT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -GET_WORKLOAD_ACCESS_TOKEN_FOR_JWT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#GetWorkloadAccessTokenForJWTOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#GetWorkloadAccessTokenForJWTResponse", - ) - ], - members={ - "workloadAccessToken": { - "target": WORKLOAD_IDENTITY_TOKEN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +BLOCKCHAIN_CHAIN_ID: StaticSchema = ( + 14, + n0, + _BCI, + 0, + (_BASE, _BS, _ETHEREUM, _SOLANA, _SD_), + ( + (-1, {_sVm: _BASE}), + (-1, {_sVm: _BS}), + (-1, {_sVm: _ETHEREUM}), + (-1, {_sVm: _SOLANA}), + (-1, {_sVm: _SD_}), + ), ) -GET_WORKLOAD_ACCESS_TOKEN_FOR_JWT = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#GetWorkloadAccessTokenForJWT"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"uri": "/identities/GetWorkloadAccessTokenForJWT", "method": "POST"} - ), - ) - ], +INSTRUMENT_BALANCE_TOKEN: StaticSchema = ( + 14, + n0, + _IBT, + 0, + (_USDC,), + ((-1, {_sVm: _USDC}),), +) + +GET_PAYMENT_INSTRUMENT_BALANCE_INPUT: StaticSchema = ( + 18, + n0, + _GPIBI, + {_sSI: _cGPIBR, _smit: None}, + (_uI, _aN, _pMA, _pCI, _pII, _cha, _tok), + ( + (USER_ID, {_sH: _XABAPUI}), + (PAYMENT_AGENT_NAME, {_sH: _XABAPAN}), + (PAYMENT_MANAGER_ARN, 1), + (PAYMENT_CONNECTOR_ID, 1), + (PAYMENT_INSTRUMENT_ID, 1), + (BLOCKCHAIN_CHAIN_ID, 1), + (INSTRUMENT_BALANCE_TOKEN, 1), + ), ) -GET_WORKLOAD_ACCESS_TOKEN_FOR_USER_ID_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#GetWorkloadAccessTokenForUserIdInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#GetWorkloadAccessTokenForUserIdRequest", - ) - ], - members={ - "workloadName": { - "target": WORKLOAD_IDENTITY_NAME_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "userId": { - "target": USER_ID_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +TOKEN_BALANCE: StaticSchema = ( + 18, + n0, + _TB, + 0, + (_am, _deci, _tok, _ne, _cha), + ( + (3, 1), + (7, 1), + (INSTRUMENT_BALANCE_TOKEN, 1), + (CRYPTO_WALLET_NETWORK, 1), + (BLOCKCHAIN_CHAIN_ID, 1), + ), ) -GET_WORKLOAD_ACCESS_TOKEN_FOR_USER_ID_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#GetWorkloadAccessTokenForUserIdOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#GetWorkloadAccessTokenForUserIdResponse", - ) - ], - members={ - "workloadAccessToken": { - "target": WORKLOAD_IDENTITY_TOKEN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +GET_PAYMENT_INSTRUMENT_BALANCE_OUTPUT: StaticSchema = ( + 18, + n0, + _GPIBO, + {_sSI: _cGPIBRo, _smith: None}, + (_pII, _tB), + ((PAYMENT_INSTRUMENT_ID, 1), (TOKEN_BALANCE, 1)), +) + +GET_PAYMENT_INSTRUMENT_BALANCE: StaticOperationSchema = ( + 23, + n0, + _GPIB, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "POST", + "uri": "/payments/getPaymentInstrumentBalance", + } + ) + }, + GET_PAYMENT_INSTRUMENT_BALANCE_INPUT, + GET_PAYMENT_INSTRUMENT_BALANCE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -GET_WORKLOAD_ACCESS_TOKEN_FOR_USER_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#GetWorkloadAccessTokenForUserId"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"uri": "/identities/GetWorkloadAccessTokenForUserId", "method": "POST"} - ), - ) - ], +LIST_PAYMENT_INSTRUMENTS_INPUT: StaticSchema = ( + 18, + n0, + _LPII, + {_sSI: _cLPIR, _smit: None}, + (_uI, _aN, _pMA, _pCI, _nT, _mR), + ( + (USER_ID, {_sH: _XABAPUI}), + (PAYMENT_AGENT_NAME, {_sH: _XABAPAN}), + (PAYMENT_MANAGER_ARN, 1), + (PAYMENT_CONNECTOR_ID, 0), + (NEXT_TOKEN, 0), + (7, 0), + ), ) -MAX_LEN_STRING = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#MaxLenString"), - shape_type=ShapeType.STRING, +PAYMENT_INSTRUMENT_SUMMARY: StaticSchema = ( + 18, + n0, + _PISa, + 0, + (_pII, _pMA, _pCI, _uI, _pIT, _st, _cA, _uA), + ( + (PAYMENT_INSTRUMENT_ID, 1), + (PAYMENT_MANAGER_ARN, 1), + (PAYMENT_CONNECTOR_ID, 1), + (USER_ID, 1), + (PAYMENT_INSTRUMENT_TYPE, 1), + (PAYMENT_INSTRUMENT_STATUS, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + ), ) -INPUT_CONTENT_BLOCK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#InputContentBlock"), - members={ - "path": { - "target": MAX_LEN_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "text": {"target": MAX_LEN_STRING}, - "blob": {"target": BODY}, - }, +PAYMENT_INSTRUMENT_SUMMARY_LIST: StaticSchema = ( + 16, + n0, + _PISL, + 0, + (_m,), + ((PAYMENT_INSTRUMENT_SUMMARY, 0),), +) + +LIST_PAYMENT_INSTRUMENTS_OUTPUT: StaticSchema = ( + 18, + n0, + _LPIO, + {_sSI: _cLPIRo, _smith: None}, + (_pIay, _nT), + ((PAYMENT_INSTRUMENT_SUMMARY_LIST, 1), (3, 0)), +) + +LIST_PAYMENT_INSTRUMENTS: StaticOperationSchema = ( + 23, + n0, + _LPI, + { + _smithy: MappingProxyType( + {"code": 200, "method": "POST", "uri": "/payments/listPaymentInstruments"} + ) + }, + LIST_PAYMENT_INSTRUMENTS_INPUT, + LIST_PAYMENT_INSTRUMENTS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -INPUT_CONTENT_BLOCK_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#InputContentBlockList"), - shape_type=ShapeType.LIST, - members={"member": {"target": INPUT_CONTENT_BLOCK}}, -) +CURRENCY: StaticSchema = (14, n0, _Cu, 0, (_USD,), ((-1, {_sVm: _USD}),)) -PROGRAMMING_LANGUAGE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ProgrammingLanguage"), - shape_type=ShapeType.ENUM, - members={ - "PYTHON": {"target": UNIT}, - "JAVASCRIPT": {"target": UNIT}, - "TYPESCRIPT": {"target": UNIT}, - }, -) +AMOUNT: StaticSchema = (18, n0, _Am, 0, (_va, _cu), ((3, 1), (CURRENCY, 1))) -STRING_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#StringList"), - shape_type=ShapeType.LIST, - members={"member": {"target": MAX_LEN_STRING}}, -) +SESSION_LIMITS: StaticSchema = (18, n0, _SLe, 0, (_mSA,), ((AMOUNT, 1),)) -LANGUAGE_RUNTIME = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#LanguageRuntime"), - shape_type=ShapeType.ENUM, - members={ - "NODEJS": {"target": UNIT}, - "DENO": {"target": UNIT}, - "PYTHON": {"target": UNIT}, - }, +CREATE_PAYMENT_SESSION_INPUT: StaticSchema = ( + 18, + n0, + _CPSI, + {_sSI: _cCPSR, _smit: None}, + (_uI, _aN, _pMA, _li, _eTIM, _cTl), + ( + (USER_ID, {_sH: _XABAPUI}), + (PAYMENT_AGENT_NAME, {_sH: _XABAPAN}), + (PAYMENT_MANAGER_ARN, 1), + (SESSION_LIMITS, 0), + (7, 1), + (CLIENT_TOKEN, 2), + ), ) -TOOL_ARGUMENTS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ToolArguments"), - members={ - "code": {"target": MAX_LEN_STRING}, - "language": {"target": PROGRAMMING_LANGUAGE}, - "clearContext": {"target": BOOLEAN}, - "command": {"target": MAX_LEN_STRING}, - "path": {"target": MAX_LEN_STRING}, - "paths": {"target": STRING_LIST}, - "content": {"target": INPUT_CONTENT_BLOCK_LIST}, - "directoryPath": {"target": MAX_LEN_STRING}, - "taskId": {"target": MAX_LEN_STRING}, - "runtime": {"target": LANGUAGE_RUNTIME}, - }, +AVAILABLE_LIMITS: StaticSchema = ( + 18, + n0, + _AL, + 0, + (_aSA, _uA), + ((AMOUNT, 0), (DATE_TIMESTAMP, 0)), +) + +PAYMENT_SESSION_ID: StaticSchema = (3, n0, _PSI, 0) + +PAYMENT_SESSION: StaticSchema = ( + 18, + n0, + _PS, + 0, + (_pSI, _pMA, _li, _uI, _eTIM, _cA, _aL, _uA), + ( + (PAYMENT_SESSION_ID, 1), + (PAYMENT_MANAGER_ARN, 1), + (SESSION_LIMITS, 0), + (USER_ID, 1), + (7, 1), + (DATE_TIMESTAMP, 1), + (AVAILABLE_LIMITS, 0), + (DATE_TIMESTAMP, 1), + ), ) -TOOL_NAME = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ToolName"), - shape_type=ShapeType.ENUM, - members={ - "EXECUTE_CODE": {"target": UNIT}, - "EXECUTE_COMMAND": {"target": UNIT}, - "READ_FILES": {"target": UNIT}, - "LIST_FILES": {"target": UNIT}, - "REMOVE_FILES": {"target": UNIT}, - "WRITE_FILES": {"target": UNIT}, - "START_COMMAND_EXECUTION": {"target": UNIT}, - "GET_TASK": {"target": UNIT}, - "STOP_TASK": {"target": UNIT}, - }, +CREATE_PAYMENT_SESSION_OUTPUT: StaticSchema = ( + 18, + n0, + _CPSO, + {_sSI: _cCPSRo, _smith: None}, + (_pS,), + ((PAYMENT_SESSION, 1),), +) + +CREATE_PAYMENT_SESSION: StaticOperationSchema = ( + 23, + n0, + _CPS, + { + _smithy: MappingProxyType( + {"code": 201, "method": "POST", "uri": "/payments/createPaymentSession"} + ) + }, + CREATE_PAYMENT_SESSION_INPUT, + CREATE_PAYMENT_SESSION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + SUBSCRIPTION_REQUIRED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -INVOKE_CODE_INTERPRETER_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#InvokeCodeInterpreterInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#InvokeCodeInterpreterRequest", - ) - ], - members={ - "codeInterpreterIdentifier": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "sessionId": { - "target": CODE_INTERPRETER_SESSION_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-code-interpreter-session-id", - ) - ], - }, - "traceId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="X-Amzn-Trace-Id") - ], - }, - "traceParent": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="traceparent") - ], - }, - "name": { - "target": TOOL_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "arguments": {"target": TOOL_ARGUMENTS}, - }, +DELETE_PAYMENT_SESSION_INPUT: StaticSchema = ( + 18, + n0, + _DPSI, + {_sSI: _cDPSR, _smit: None}, + (_uI, _pMA, _pSI), + ((USER_ID, {_sH: _XABAPUI}), (PAYMENT_MANAGER_ARN, 1), (PAYMENT_SESSION_ID, 1)), +) + +PAYMENT_SESSION_STATUS: StaticSchema = ( + 14, + n0, + _PSS, + 0, + (_ACTIVE, _EXPIRED, _DELETED), + ((-1, {_sVm: _ACTIVE}), (-1, {_sVm: _EXPIRED}), (-1, {_sVm: _DELETED})), +) + +DELETE_PAYMENT_SESSION_OUTPUT: StaticSchema = ( + 18, + n0, + _DPSO, + {_sSI: _cDPSRo, _smith: None}, + (_st,), + ((PAYMENT_SESSION_STATUS, 1),), +) + +DELETE_PAYMENT_SESSION: StaticOperationSchema = ( + 23, + n0, + _DPS, + { + _smithy: MappingProxyType( + {"code": 200, "method": "POST", "uri": "/payments/deletePaymentSession"} + ) + }, + DELETE_PAYMENT_SESSION_INPUT, + DELETE_PAYMENT_SESSION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -RESOURCE_CONTENT_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ResourceContentType"), - shape_type=ShapeType.ENUM, - members={"TEXT": {"target": UNIT}, "BLOB": {"target": UNIT}}, +GET_PAYMENT_SESSION_INPUT: StaticSchema = ( + 18, + n0, + _GPSI, + {_sSI: _cGPSR, _smit: None}, + (_uI, _aN, _pMA, _pSI), + ( + (USER_ID, {_sH: _XABAPUI}), + (PAYMENT_AGENT_NAME, {_sH: _XABAPAN}), + (PAYMENT_MANAGER_ARN, 1), + (PAYMENT_SESSION_ID, 1), + ), ) -RESOURCE_CONTENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ResourceContent"), - members={ - "type": { - "target": RESOURCE_CONTENT_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "uri": {"target": STRING}, - "mimeType": {"target": STRING}, - "text": {"target": STRING}, - "blob": {"target": BLOB}, - }, +GET_PAYMENT_SESSION_OUTPUT: StaticSchema = ( + 18, + n0, + _GPSO, + {_sSI: _cGPSRo, _smith: None}, + (_pS,), + ((PAYMENT_SESSION, 1),), +) + +GET_PAYMENT_SESSION: StaticOperationSchema = ( + 23, + n0, + _GPS, + { + _smithy: MappingProxyType( + {"code": 200, "method": "POST", "uri": "/payments/getPaymentSession"} + ) + }, + GET_PAYMENT_SESSION_INPUT, + GET_PAYMENT_SESSION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CONTENT_BLOCK_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ContentBlockType"), - shape_type=ShapeType.ENUM, - members={ - "TEXT": {"target": UNIT}, - "IMAGE": {"target": UNIT}, - "EMBEDDED_RESOURCE": {"target": UNIT}, - "RESOURCE_LINK": {"target": UNIT}, - }, +LIST_PAYMENT_SESSIONS_INPUT: StaticSchema = ( + 18, + n0, + _LPSI, + {_sSI: _cLPSR, _smit: None}, + (_uI, _aN, _pMA, _nT, _mR), + ( + (USER_ID, {_sH: _XABAPUI}), + (PAYMENT_AGENT_NAME, {_sH: _XABAPAN}), + (PAYMENT_MANAGER_ARN, 1), + (NEXT_TOKEN, 0), + (7, 0), + ), ) -CONTENT_BLOCK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ContentBlock"), - members={ - "type": { - "target": CONTENT_BLOCK_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "text": {"target": STRING}, - "data": {"target": BLOB}, - "mimeType": {"target": STRING}, - "uri": {"target": STRING}, - "name": {"target": STRING}, - "description": {"target": STRING}, - "size": {"target": LONG}, - "resource": {"target": RESOURCE_CONTENT}, - }, +PAYMENT_SESSION_SUMMARY: StaticSchema = ( + 18, + n0, + _PSSa, + 0, + (_pSI, _pMA, _uI, _eTIM, _cA, _uA), + ( + (PAYMENT_SESSION_ID, 1), + (PAYMENT_MANAGER_ARN, 1), + (USER_ID, 1), + (7, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + ), ) -CONTENT_BLOCK_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ContentBlockList"), - shape_type=ShapeType.LIST, - members={"member": {"target": CONTENT_BLOCK}}, +PAYMENT_SESSION_SUMMARY_LIST: StaticSchema = ( + 16, + n0, + _PSSL, + 0, + (_m,), + ((PAYMENT_SESSION_SUMMARY, 0),), +) + +LIST_PAYMENT_SESSIONS_OUTPUT: StaticSchema = ( + 18, + n0, + _LPSO, + {_sSI: _cLPSRo, _smith: None}, + (_pSa, _nT), + ((PAYMENT_SESSION_SUMMARY_LIST, 1), (NEXT_TOKEN, 0)), +) + +LIST_PAYMENT_SESSIONS: StaticOperationSchema = ( + 23, + n0, + _LPS, + { + _smithy: MappingProxyType( + {"code": 200, "method": "POST", "uri": "/payments/listPaymentSessions"} + ) + }, + LIST_PAYMENT_SESSIONS_INPUT, + LIST_PAYMENT_SESSIONS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -TASK_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#TaskStatus"), - shape_type=ShapeType.ENUM, - members={ - "SUBMITTED": {"target": UNIT}, - "WORKING": {"target": UNIT}, - "COMPLETED": {"target": UNIT}, - "CANCELED": {"target": UNIT}, - "FAILED": {"target": UNIT}, - }, +PAYMENT_DOCUMENT: StaticSchema = (13, n0, _PD, 4) + +PERMIT2_ALLOWANCE_LIMIT: StaticSchema = (3, n0, _PAL, 0) + +CRYPTO_X402_PAYMENT_INPUT: StaticSchema = ( + 18, + n0, + _CXPI, + 0, + (_ve, _p, _pAL), + ((3, 1), (PAYMENT_DOCUMENT, 1), (PERMIT2_ALLOWANCE_LIMIT, 0)), +) + +VERSION: StaticSchema = (3, n0, _Ve, 0) + +WWW_AUTHENTICATE_HEADER: StaticSchema = (3, n0, _WAH, 0) + +WWW_AUTHENTICATE_HEADER_LIST: StaticSchema = ( + 16, + n0, + _WAHL, + 0, + (_m,), + ((WWW_AUTHENTICATE_HEADER, 0),), +) + +MPP_PAYMENT_INPUT: StaticSchema = ( + 18, + n0, + _MPI, + 0, + (_ve, _wAH, _bPGF), + ((VERSION, 1), (WWW_AUTHENTICATE_HEADER_LIST, 1), (2, 0)), +) + +PAYMENT_INPUT: StaticSchema = ( + 19, + n0, + _PIa, + 0, + (_cX, _mp), + ((CRYPTO_X402_PAYMENT_INPUT, 0), (MPP_PAYMENT_INPUT, 0)), +) + +PAYMENT_TYPE: StaticSchema = ( + 14, + n0, + _PTay, + 0, + (_CX, _MPP), + ((-1, {_sVm: _CX}), (-1, {_sVm: _MPP})), +) + +PROCESS_PAYMENT_INPUT: StaticSchema = ( + 18, + n0, + _PPI, + {_sSI: _cPPR, _smit: None}, + (_uI, _aN, _pMA, _pSI, _pII, _pT, _pIaym, _cTl), + ( + (USER_ID, {_sH: _XABAPUI}), + (PAYMENT_AGENT_NAME, {_sH: _XABAPAN}), + (PAYMENT_MANAGER_ARN, 1), + (PAYMENT_SESSION_ID, 1), + (PAYMENT_INSTRUMENT_ID, 1), + (PAYMENT_TYPE, 1), + (PAYMENT_INPUT, 1), + (CLIENT_TOKEN, 2), + ), ) -TOOL_RESULT_STRUCTURED_CONTENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ToolResultStructuredContent"), - members={ - "taskId": {"target": STRING}, - "taskStatus": {"target": TASK_STATUS}, - "stdout": {"target": STRING}, - "stderr": {"target": STRING}, - "exitCode": {"target": INTEGER}, - "executionTime": {"target": DOUBLE}, - }, +CRYPTO_X402_PAYMENT_OUTPUT: StaticSchema = ( + 18, + n0, + _CXPO, + 0, + (_ve, _p), + ((3, 1), (PAYMENT_DOCUMENT, 1)), +) + +MPP_PAYMENT_CREDENTIAL: StaticSchema = (3, n0, _MPC, 4) + +MPP_PAYMENT_OUTPUT: StaticSchema = ( + 18, + n0, + _MPO, + 0, + (_ve, _sPI, _pCa), + ((VERSION, 1), (3, 1), (MPP_PAYMENT_CREDENTIAL, 1)), +) + +PAYMENT_OUTPUT: StaticSchema = ( + 19, + n0, + _PO, + 0, + (_cX, _mp), + ((CRYPTO_X402_PAYMENT_OUTPUT, 0), (MPP_PAYMENT_OUTPUT, 0)), +) + +PROCESS_PAYMENT_ID: StaticSchema = (3, n0, _PPIr, 0) + +PAYMENT_STATUS: StaticSchema = (14, n0, _PSa, 0, (_PG,), ((-1, {_sVm: _PG}),)) + +PROCESS_PAYMENT_OUTPUT: StaticSchema = ( + 18, + n0, + _PPO, + {_sSI: _cPPRo, _smith: None}, + (_pPI, _pMA, _pSI, _pII, _pT, _st, _pO, _cA, _uA), + ( + (PROCESS_PAYMENT_ID, 1), + (PAYMENT_MANAGER_ARN, 1), + (PAYMENT_SESSION_ID, 1), + (PAYMENT_INSTRUMENT_ID, 1), + (PAYMENT_TYPE, 1), + (PAYMENT_STATUS, 1), + (PAYMENT_OUTPUT, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + ), ) -CODE_INTERPRETER_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#CodeInterpreterResult"), - members={ - "content": { - "target": CONTENT_BLOCK_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "structuredContent": {"target": TOOL_RESULT_STRUCTURED_CONTENT}, - "isError": {"target": BOOLEAN}, - }, +PROCESS_PAYMENT: StaticOperationSchema = ( + 23, + n0, + _PPr, + { + _smithy: MappingProxyType( + {"code": 200, "method": "POST", "uri": "/payments/processPayment"} + ) + }, + PROCESS_PAYMENT_INPUT, + PROCESS_PAYMENT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + SUBSCRIPTION_REQUIRED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CODE_INTERPRETER_STREAM_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#CodeInterpreterStreamOutput"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#streaming"))], - members={ - "result": {"target": CODE_INTERPRETER_RESULT}, - "accessDeniedException": {"target": ACCESS_DENIED_EXCEPTION}, - "conflictException": {"target": CONFLICT_EXCEPTION}, - "internalServerException": {"target": INTERNAL_SERVER_EXCEPTION}, - "resourceNotFoundException": {"target": RESOURCE_NOT_FOUND_EXCEPTION}, - "serviceQuotaExceededException": {"target": SERVICE_QUOTA_EXCEEDED_EXCEPTION}, - "throttlingException": {"target": THROTTLING_EXCEPTION}, - "validationException": {"target": VALIDATION_EXCEPTION}, - }, -) +METADATA_FILTER_EXPRESSION: StaticSchema = (13, n0, _MFE, 0) -INVOKE_CODE_INTERPRETER_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#InvokeCodeInterpreterOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#InvokeCodeInterpreterResponse", - ) - ], - members={ - "sessionId": { - "target": CODE_INTERPRETER_SESSION_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-code-interpreter-session-id", - ) - ], - }, - "stream": { - "target": CODE_INTERPRETER_STREAM_OUTPUT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpPayload")), - ], - }, - }, -) +REGISTRY_IDENTIFIER: StaticSchema = (3, n0, _RIeg, 0) -INVOKE_CODE_INTERPRETER = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#InvokeCodeInterpreter"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/code-interpreters/{codeInterpreterIdentifier}/tools/invoke", - "code": 200, - } - ), - ) - ], -) +REGISTRY_ID_LIST: StaticSchema = (16, n0, _RIL, 0, (_m,), ((REGISTRY_IDENTIFIER, 0),)) -HARNESS_ALLOWED_TOOL = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessAllowedTool"), - shape_type=ShapeType.STRING, +SEARCH_REGISTRY_RECORDS_INPUT: StaticSchema = ( + 18, + n0, + _SRRI, + {_sSI: _cSRRR, _smit: None}, + (_sQe, _rIeg, _mR, _f), + ( + (3, 1), + (REGISTRY_ID_LIST, 1), + (7, {_smithyap: 10}), + (METADATA_FILTER_EXPRESSION, 0), + ), ) -HARNESS_ALLOWED_TOOLS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessAllowedTools"), - shape_type=ShapeType.LIST, - members={"member": {"target": HARNESS_ALLOWED_TOOL}}, +DESCRIPTION: StaticSchema = (3, n0, _Des, 4) + +CUSTOM_DESCRIPTOR: StaticSchema = (18, n0, _CD, 0, (_iC,), ((INLINE_CONTENT, 0),)) + +SERVER_DEFINITION: StaticSchema = ( + 18, + n0, + _SDe, + 0, + (_sV, _iC), + ((SCHEMA_VERSION, 0), (INLINE_CONTENT, 0)), +) + +TOOLS_DEFINITION: StaticSchema = ( + 18, + n0, + _TD, + 0, + (_pVr, _iC), + ((SCHEMA_VERSION, 0), (INLINE_CONTENT, 0)), +) + +MCP_DESCRIPTOR: StaticSchema = ( + 18, + n0, + _MDc, + 0, + (_se, _to), + ((SERVER_DEFINITION, 1), (TOOLS_DEFINITION, 1)), +) + +DESCRIPTORS: StaticSchema = ( + 18, + n0, + _Desc, + 0, + (_mc, _aa, _cus, _aSg), + ( + (MCP_DESCRIPTOR, 0), + (A2A_DESCRIPTOR, 0), + (CUSTOM_DESCRIPTOR, 0), + (AGENT_SKILLS_DESCRIPTOR, 0), + ), ) -HARNESS_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessArn"), shape_type=ShapeType.STRING +DESCRIPTOR_TYPE: StaticSchema = ( + 14, + n0, + _DTe, + 0, + (_MCP, _AA, _CUSTOM, _AS_), + ((-1, {_sVm: _MCP}), (-1, {_sVm: _AA}), (-1, {_sVm: _CUSTOM}), (-1, {_sVm: _AS_})), ) -HARNESS_REASONING_TEXT_BLOCK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessReasoningTextBlock"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "text": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "signature": {"target": STRING}, - }, -) +REGISTRY_RECORD_NAME: StaticSchema = (3, n0, _RRN, 0) -HARNESS_REASONING_CONTENT_BLOCK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessReasoningContentBlock"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "reasoningText": {"target": HARNESS_REASONING_TEXT_BLOCK}, - "redactedContent": {"target": BLOB}, - }, -) +REGISTRY_RECORD_ARN: StaticSchema = (3, n0, _RRA, 0) -SENSITIVE_TEXT = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#SensitiveText"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) +REGISTRY_RECORD_ID: StaticSchema = (3, n0, _RRI, 0) -SENSITIVE_JSON = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#SensitiveJson"), - shape_type=ShapeType.DOCUMENT, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) +REGISTRY_ARN: StaticSchema = (3, n0, _RAeg, 0) -HARNESS_TOOL_RESULT_CONTENT_BLOCK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessToolResultContentBlock"), - shape_type=ShapeType.UNION, - members={"text": {"target": SENSITIVE_TEXT}, "json": {"target": SENSITIVE_JSON}}, +REGISTRY_RECORD_STATUS: StaticSchema = ( + 14, + n0, + _RRS, + 0, + (_DRAFT, _PA, _APPROVED, _REJECTED, _DEPRECATED), + ( + (-1, {_sVm: _DRAFT}), + (-1, {_sVm: _PA}), + (-1, {_sVm: _APPROVED}), + (-1, {_sVm: _REJECTED}), + (-1, {_sVm: _DEPRECATED}), + ), ) -HARNESS_TOOL_RESULT_CONTENT_BLOCKS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessToolResultContentBlocks"), - shape_type=ShapeType.LIST, - members={"member": {"target": HARNESS_TOOL_RESULT_CONTENT_BLOCK}}, +REGISTRY_RECORD_VERSION: StaticSchema = (3, n0, _RRV, 0) + +REGISTRY_RECORD_SUMMARY: StaticSchema = ( + 18, + n0, + _RRSe, + 0, + (_rAeg, _rAec, _rIec, _n, _d, _dT, _des, _ve, _st, _cA, _uA), + ( + (REGISTRY_ARN, 1), + (REGISTRY_RECORD_ARN, 1), + (REGISTRY_RECORD_ID, 1), + (REGISTRY_RECORD_NAME, 1), + (DESCRIPTION, 0), + (DESCRIPTOR_TYPE, 1), + (DESCRIPTORS, 1), + (REGISTRY_RECORD_VERSION, 1), + (REGISTRY_RECORD_STATUS, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + ), ) -HARNESS_TOOL_USE_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessToolUseStatus"), - shape_type=ShapeType.ENUM, - members={"SUCCESS": {"target": UNIT}, "ERROR": {"target": UNIT}}, +REGISTRY_RECORD_SUMMARY_LIST: StaticSchema = ( + 16, + n0, + _RRSL, + 0, + (_m,), + ((REGISTRY_RECORD_SUMMARY, 0),), +) + +SEARCH_REGISTRY_RECORDS_OUTPUT: StaticSchema = ( + 18, + n0, + _SRRO, + {_sSI: _cSRRRo, _smith: None}, + (_rRe,), + ((REGISTRY_RECORD_SUMMARY_LIST, 1),), +) + +SEARCH_REGISTRY_RECORDS: StaticOperationSchema = ( + 23, + n0, + _SRR, + { + _smithy: MappingProxyType( + {"method": "POST", "uri": "/registry-records/search", "code": 200} + ) + }, + SEARCH_REGISTRY_RECORDS_INPUT, + SEARCH_REGISTRY_RECORDS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + UNAUTHORIZED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -HARNESS_TOOL_USE_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessToolUseId"), - shape_type=ShapeType.STRING, -) - -HARNESS_TOOL_USE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessToolUseType"), - shape_type=ShapeType.ENUM, - members={ - "TOOL_USE": {"target": UNIT}, - "SERVER_TOOL_USE": {"target": UNIT}, - "MCP_TOOL_USE": {"target": UNIT}, - }, -) - -HARNESS_TOOL_RESULT_BLOCK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessToolResultBlock"), - members={ - "toolUseId": { - "target": HARNESS_TOOL_USE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "content": { - "target": HARNESS_TOOL_RESULT_CONTENT_BLOCKS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": {"target": HARNESS_TOOL_USE_STATUS}, - "type": {"target": HARNESS_TOOL_USE_TYPE}, - }, -) - -HARNESS_TOOL_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessToolName"), - shape_type=ShapeType.STRING, -) - -HARNESS_TOOL_USE_BLOCK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessToolUseBlock"), - members={ - "name": { - "target": HARNESS_TOOL_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "toolUseId": { - "target": HARNESS_TOOL_USE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "input": { - "target": SENSITIVE_JSON, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "type": {"target": HARNESS_TOOL_USE_TYPE}, - "serverName": {"target": STRING}, - }, -) - -HARNESS_CONTENT_BLOCK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessContentBlock"), - shape_type=ShapeType.UNION, - members={ - "text": {"target": SENSITIVE_TEXT}, - "toolUse": {"target": HARNESS_TOOL_USE_BLOCK}, - "toolResult": {"target": HARNESS_TOOL_RESULT_BLOCK}, - "reasoningContent": {"target": HARNESS_REASONING_CONTENT_BLOCK}, - }, -) - -HARNESS_CONTENT_BLOCKS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessContentBlocks"), - shape_type=ShapeType.LIST, - members={"member": {"target": HARNESS_CONTENT_BLOCK}}, -) - -HARNESS_CONVERSATION_ROLE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessConversationRole"), - shape_type=ShapeType.ENUM, - members={"USER": {"target": UNIT}, "ASSISTANT": {"target": UNIT}}, -) - -HARNESS_MESSAGE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessMessage"), - members={ - "role": { - "target": HARNESS_CONVERSATION_ROLE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "content": { - "target": HARNESS_CONTENT_BLOCKS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -HARNESS_MESSAGES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessMessages"), - shape_type=ShapeType.LIST, - members={"member": {"target": HARNESS_MESSAGE}}, -) - -HARNESS_BEDROCK_API_FORMAT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessBedrockApiFormat"), - shape_type=ShapeType.ENUM, - members={ - "CONVERSE_STREAM": {"target": UNIT}, - "RESPONSES": {"target": UNIT}, - "CHAT_COMPLETIONS": {"target": UNIT}, - }, -) - -MAX_TOKENS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#MaxTokens"), shape_type=ShapeType.INTEGER -) - -MODEL_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#ModelId"), shape_type=ShapeType.STRING -) - -TEMPERATURE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#Temperature"), shape_type=ShapeType.FLOAT -) - -TOP_P = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#TopP"), shape_type=ShapeType.FLOAT -) - -HARNESS_BEDROCK_MODEL_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessBedrockModelConfig"), - members={ - "modelId": { - "target": MODEL_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "maxTokens": {"target": MAX_TOKENS}, - "temperature": {"target": TEMPERATURE}, - "topP": {"target": TOP_P}, - "apiFormat": {"target": HARNESS_BEDROCK_API_FORMAT}, - "additionalParams": {"target": DOCUMENT}, - }, -) - -API_KEY_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#ApiKeyArn"), shape_type=ShapeType.STRING -) - -TOP_K = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#TopK"), shape_type=ShapeType.INTEGER -) - -HARNESS_GEMINI_MODEL_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessGeminiModelConfig"), - members={ - "modelId": { - "target": MODEL_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "apiKeyArn": { - "target": API_KEY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "maxTokens": {"target": MAX_TOKENS}, - "temperature": {"target": TEMPERATURE}, - "topP": {"target": TOP_P}, - "topK": {"target": TOP_K}, - "additionalParams": {"target": DOCUMENT}, - }, -) - -HARNESS_LITE_LLM_API_BASE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessLiteLlmApiBase"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -HARNESS_LITE_LLM_MODEL_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessLiteLlmModelConfig"), - members={ - "modelId": { - "target": MODEL_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "apiKeyArn": {"target": API_KEY_ARN}, - "apiBase": {"target": HARNESS_LITE_LLM_API_BASE}, - "maxTokens": {"target": MAX_TOKENS}, - "temperature": {"target": TEMPERATURE}, - "topP": {"target": TOP_P}, - "additionalParams": {"target": DOCUMENT}, - }, -) - -HARNESS_OPEN_AI_API_BASE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessOpenAiApiBase"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -HARNESS_OPEN_AI_API_FORMAT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessOpenAiApiFormat"), - shape_type=ShapeType.ENUM, - members={"CHAT_COMPLETIONS": {"target": UNIT}, "RESPONSES": {"target": UNIT}}, -) - -HARNESS_OPEN_AI_MODEL_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessOpenAiModelConfig"), - members={ - "modelId": { - "target": MODEL_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "apiKeyArn": { - "target": API_KEY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "apiBase": {"target": HARNESS_OPEN_AI_API_BASE}, - "maxTokens": {"target": MAX_TOKENS}, - "temperature": {"target": TEMPERATURE}, - "topP": {"target": TOP_P}, - "apiFormat": {"target": HARNESS_OPEN_AI_API_FORMAT}, - "additionalParams": {"target": DOCUMENT}, - }, -) - -HARNESS_MODEL_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessModelConfiguration"), - shape_type=ShapeType.UNION, - members={ - "bedrockModelConfig": {"target": HARNESS_BEDROCK_MODEL_CONFIG}, - "openAiModelConfig": {"target": HARNESS_OPEN_AI_MODEL_CONFIG}, - "geminiModelConfig": {"target": HARNESS_GEMINI_MODEL_CONFIG}, - "liteLlmModelConfig": {"target": HARNESS_LITE_LLM_MODEL_CONFIG}, - }, -) - -HARNESS_ENDPOINT_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessEndpointName"), - shape_type=ShapeType.STRING, -) - -HARNESS_AWS_SKILL_PATH = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessAwsSkillPath"), - shape_type=ShapeType.STRING, -) - -HARNESS_AWS_SKILL_PATHS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessAwsSkillPaths"), - shape_type=ShapeType.LIST, - members={"member": {"target": HARNESS_AWS_SKILL_PATH}}, -) - -HARNESS_SKILL_AWS_SKILLS_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessSkillAwsSkillsSource"), - members={"paths": {"target": HARNESS_AWS_SKILL_PATHS}}, -) - -HARNESS_SKILL_GIT_AUTH = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessSkillGitAuth"), - members={ - "credentialArn": { - "target": API_KEY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "username": {"target": STRING}, - }, -) - -HARNESS_SKILL_GIT_URL = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessSkillGitUrl"), - shape_type=ShapeType.STRING, -) - -HARNESS_SKILL_GIT_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessSkillGitSource"), - members={ - "url": { - "target": HARNESS_SKILL_GIT_URL, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "path": {"target": STRING}, - "auth": {"target": HARNESS_SKILL_GIT_AUTH}, - }, -) - -HARNESS_SKILL_PATH = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessSkillPath"), - shape_type=ShapeType.STRING, -) - -HARNESS_SKILL_S3_URI = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessSkillS3Uri"), - shape_type=ShapeType.STRING, -) - -HARNESS_SKILL_S3_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessSkillS3Source"), - members={ - "uri": { - "target": HARNESS_SKILL_S3_URI, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -HARNESS_SKILL = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessSkill"), - shape_type=ShapeType.UNION, - members={ - "path": {"target": HARNESS_SKILL_PATH}, - "s3": {"target": HARNESS_SKILL_S3_SOURCE}, - "git": {"target": HARNESS_SKILL_GIT_SOURCE}, - "awsSkills": {"target": HARNESS_SKILL_AWS_SKILLS_SOURCE}, - }, -) - -HARNESS_SKILLS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessSkills"), - shape_type=ShapeType.LIST, - members={"member": {"target": HARNESS_SKILL}}, -) - -HARNESS_SYSTEM_CONTENT_BLOCK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessSystemContentBlock"), - shape_type=ShapeType.UNION, - members={"text": {"target": SENSITIVE_TEXT}}, -) - -HARNESS_SYSTEM_PROMPT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessSystemPrompt"), - shape_type=ShapeType.LIST, - members={"member": {"target": HARNESS_SYSTEM_CONTENT_BLOCK}}, -) - -HARNESS_BROWSER_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessBrowserArn"), - shape_type=ShapeType.STRING, -) - -HARNESS_AGENT_CORE_BROWSER_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessAgentCoreBrowserConfig"), - members={"browserArn": {"target": HARNESS_BROWSER_ARN}}, -) - -HARNESS_CODE_INTERPRETER_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessCodeInterpreterArn"), - shape_type=ShapeType.STRING, -) - -HARNESS_AGENT_CORE_CODE_INTERPRETER_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessAgentCoreCodeInterpreterConfig"), - members={"codeInterpreterArn": {"target": HARNESS_CODE_INTERPRETER_ARN}}, -) - -O_AUTH_CUSTOM_PARAMETERS_KEY = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#OAuthCustomParametersKey"), - shape_type=ShapeType.STRING, -) - -O_AUTH_CUSTOM_PARAMETERS_VALUE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#OAuthCustomParametersValue"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -O_AUTH_CUSTOM_PARAMETERS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#OAuthCustomParameters"), - shape_type=ShapeType.MAP, - members={ - "key": {"target": O_AUTH_CUSTOM_PARAMETERS_KEY}, - "value": {"target": O_AUTH_CUSTOM_PARAMETERS_VALUE}, - }, -) - -O_AUTH_DEFAULT_RETURN_URL = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#OAuthDefaultReturnUrl"), - shape_type=ShapeType.STRING, -) - -O_AUTH_GRANT_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#OAuthGrantType"), - shape_type=ShapeType.ENUM, - members={ - "CLIENT_CREDENTIALS": {"target": UNIT}, - "AUTHORIZATION_CODE": {"target": UNIT}, - "TOKEN_EXCHANGE": {"target": UNIT}, - }, -) - -O_AUTH_CREDENTIAL_PROVIDER_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#OAuthCredentialProviderArn"), - shape_type=ShapeType.STRING, -) - -O_AUTH_SCOPE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#OAuthScope"), shape_type=ShapeType.STRING -) - -O_AUTH_SCOPES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#OAuthScopes"), - shape_type=ShapeType.LIST, - members={"member": {"target": O_AUTH_SCOPE}}, -) - -O_AUTH_CREDENTIAL_PROVIDER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#OAuthCredentialProvider"), - members={ - "providerArn": { - "target": O_AUTH_CREDENTIAL_PROVIDER_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "scopes": { - "target": O_AUTH_SCOPES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "customParameters": {"target": O_AUTH_CUSTOM_PARAMETERS}, - "grantType": { - "target": O_AUTH_GRANT_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value="CLIENT_CREDENTIALS") - ], - }, - "defaultReturnUrl": {"target": O_AUTH_DEFAULT_RETURN_URL}, - }, -) - -HARNESS_GATEWAY_OUTBOUND_AUTH = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessGatewayOutboundAuth"), - shape_type=ShapeType.UNION, - members={ - "awsIam": {"target": UNIT}, - "none": {"target": UNIT}, - "oauth": {"target": O_AUTH_CREDENTIAL_PROVIDER}, - }, -) - -HARNESS_AGENT_CORE_GATEWAY_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessAgentCoreGatewayConfig"), - members={ - "gatewayArn": { - "target": GATEWAY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "outboundAuth": {"target": HARNESS_GATEWAY_OUTBOUND_AUTH}, - }, -) - -HARNESS_INLINE_FUNCTION_DESCRIPTION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessInlineFunctionDescription"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -HARNESS_INLINE_FUNCTION_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessInlineFunctionConfig"), - members={ - "description": { - "target": HARNESS_INLINE_FUNCTION_DESCRIPTION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "inputSchema": { - "target": SENSITIVE_JSON, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -HTTP_HEADER_KEY = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#HttpHeaderKey"), - shape_type=ShapeType.STRING, -) - -HTTP_HEADER_VALUE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#HttpHeaderValue"), - shape_type=ShapeType.STRING, -) - -HTTP_HEADERS_MAP = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HttpHeadersMap"), - shape_type=ShapeType.MAP, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "key": {"target": HTTP_HEADER_KEY}, - "value": {"target": HTTP_HEADER_VALUE}, - }, -) - -HARNESS_REMOTE_MCP_URL = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessRemoteMcpUrl"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -HARNESS_REMOTE_MCP_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessRemoteMcpConfig"), - members={ - "url": { - "target": HARNESS_REMOTE_MCP_URL, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "headers": {"target": HTTP_HEADERS_MAP}, - }, -) - -HARNESS_TOOL_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessToolConfiguration"), - shape_type=ShapeType.UNION, - members={ - "remoteMcp": {"target": HARNESS_REMOTE_MCP_CONFIG}, - "agentCoreBrowser": {"target": HARNESS_AGENT_CORE_BROWSER_CONFIG}, - "agentCoreGateway": {"target": HARNESS_AGENT_CORE_GATEWAY_CONFIG}, - "inlineFunction": {"target": HARNESS_INLINE_FUNCTION_CONFIG}, - "agentCoreCodeInterpreter": { - "target": HARNESS_AGENT_CORE_CODE_INTERPRETER_CONFIG - }, - }, -) - -HARNESS_TOOL_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessToolType"), - shape_type=ShapeType.ENUM, - members={ - "REMOTE_MCP": {"target": UNIT}, - "AGENTCORE_BROWSER": {"target": UNIT}, - "AGENTCORE_GATEWAY": {"target": UNIT}, - "INLINE_FUNCTION": {"target": UNIT}, - "AGENTCORE_CODE_INTERPRETER": {"target": UNIT}, - }, -) - -HARNESS_TOOL = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessTool"), - members={ - "type": { - "target": HARNESS_TOOL_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": {"target": HARNESS_TOOL_NAME}, - "config": {"target": HARNESS_TOOL_CONFIGURATION}, - }, -) - -HARNESS_TOOLS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessTools"), - shape_type=ShapeType.LIST, - members={"member": {"target": HARNESS_TOOL}}, -) - -INVOKE_HARNESS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#InvokeHarnessInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#InvokeHarnessRequest", - ) - ], - members={ - "harnessArn": { - "target": HARNESS_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="harnessArn"), - ], - }, - "qualifier": { - "target": HARNESS_ENDPOINT_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="qualifier") - ], - }, - "runtimeSessionId": { - "target": SESSION_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="X-Amzn-Bedrock-AgentCore-Runtime-Session-Id", - ), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "runtimeUserId": { - "target": STRING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="X-Amzn-Bedrock-AgentCore-Runtime-User-Id", - ) - ], - }, - "traceParent": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="traceparent") - ], - }, - "traceState": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="tracestate") - ], - }, - "traceId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="X-Amzn-Trace-Id") - ], - }, - "baggage": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpHeader"), value="baggage")], - }, - "messages": { - "target": HARNESS_MESSAGES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "model": {"target": HARNESS_MODEL_CONFIGURATION}, - "systemPrompt": {"target": HARNESS_SYSTEM_PROMPT}, - "tools": {"target": HARNESS_TOOLS}, - "skills": {"target": HARNESS_SKILLS}, - "allowedTools": {"target": HARNESS_ALLOWED_TOOLS}, - "maxIterations": {"target": INTEGER}, - "maxTokens": {"target": INTEGER}, - "timeoutSeconds": {"target": INTEGER}, - "actorId": {"target": STRING}, - }, -) - -HARNESS_REASONING_CONTENT_BLOCK_DELTA = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessReasoningContentBlockDelta"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "text": {"target": STRING}, - "redactedContent": {"target": BODY}, - "signature": {"target": STRING}, - }, -) - -HARNESS_TOOL_RESULT_BLOCK_DELTA = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessToolResultBlockDelta"), - shape_type=ShapeType.UNION, - members={"text": {"target": SENSITIVE_TEXT}, "json": {"target": SENSITIVE_JSON}}, -) - -HARNESS_TOOL_RESULT_BLOCKS_DELTA = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessToolResultBlocksDelta"), - shape_type=ShapeType.LIST, - members={"member": {"target": HARNESS_TOOL_RESULT_BLOCK_DELTA}}, -) - -HARNESS_TOOL_RESULT_METADATA_BLOCK_DELTA = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessToolResultMetadataBlockDelta"), - members={ - "metadata": { - "target": SENSITIVE_TEXT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -HARNESS_TOOL_USE_BLOCK_DELTA = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessToolUseBlockDelta"), - members={ - "input": { - "target": SENSITIVE_TEXT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -HARNESS_CONTENT_BLOCK_DELTA = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessContentBlockDelta"), - shape_type=ShapeType.UNION, - members={ - "text": {"target": SENSITIVE_TEXT}, - "toolUse": {"target": HARNESS_TOOL_USE_BLOCK_DELTA}, - "toolResult": {"target": HARNESS_TOOL_RESULT_BLOCKS_DELTA}, - "reasoningContent": {"target": HARNESS_REASONING_CONTENT_BLOCK_DELTA}, - "toolResultMetadata": {"target": HARNESS_TOOL_RESULT_METADATA_BLOCK_DELTA}, - }, -) - -HARNESS_CONTENT_BLOCK_DELTA_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessContentBlockDeltaEvent"), - members={ - "contentBlockIndex": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "delta": { - "target": HARNESS_CONTENT_BLOCK_DELTA, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -HARNESS_TOOL_RESULT_BLOCK_START = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessToolResultBlockStart"), - members={ - "toolUseId": { - "target": HARNESS_TOOL_USE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": {"target": HARNESS_TOOL_USE_STATUS}, - }, -) - -HARNESS_TOOL_USE_BLOCK_START = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessToolUseBlockStart"), - members={ - "toolUseId": { - "target": HARNESS_TOOL_USE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": HARNESS_TOOL_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "type": {"target": HARNESS_TOOL_USE_TYPE}, - "serverName": {"target": STRING}, - }, -) - -HARNESS_CONTENT_BLOCK_START = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessContentBlockStart"), - shape_type=ShapeType.UNION, - members={ - "toolUse": {"target": HARNESS_TOOL_USE_BLOCK_START}, - "toolResult": {"target": HARNESS_TOOL_RESULT_BLOCK_START}, - }, -) - -HARNESS_CONTENT_BLOCK_START_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessContentBlockStartEvent"), - members={ - "contentBlockIndex": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "start": { - "target": HARNESS_CONTENT_BLOCK_START, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -HARNESS_CONTENT_BLOCK_STOP_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessContentBlockStopEvent"), - members={ - "contentBlockIndex": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -HARNESS_HOOK_DECISION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessHookDecision"), - shape_type=ShapeType.ENUM, - members={"ALLOW": {"target": UNIT}, "DENY": {"target": UNIT}}, -) - -HARNESS_HOOK_EVENT_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessHookEventId"), - shape_type=ShapeType.STRING, -) - -HARNESS_HOOK_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessHookName"), - shape_type=ShapeType.STRING, -) - -HARNESS_HOOK_EVENT_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessHookEventType"), - shape_type=ShapeType.ENUM, - members={ - "BEFORE_TOOL_CALL": {"target": UNIT}, - "AFTER_TOOL_CALL": {"target": UNIT}, - "BEFORE_INVOCATION": {"target": UNIT}, - "AFTER_INVOCATION": {"target": UNIT}, - }, -) - -HARNESS_HOOK_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessHookEvent"), - members={ - "hookEventId": { - "target": HARNESS_HOOK_EVENT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": HARNESS_HOOK_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "type": { - "target": HARNESS_HOOK_EVENT_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "decision": {"target": HARNESS_HOOK_DECISION}, - "reason": {"target": STRING}, - }, -) - -HARNESS_MESSAGE_START_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessMessageStartEvent"), - members={ - "role": { - "target": HARNESS_CONVERSATION_ROLE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -HARNESS_STOP_REASON = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessStopReason"), - shape_type=ShapeType.ENUM, - members={ - "END_TURN": {"target": UNIT}, - "TOOL_USE": {"target": UNIT}, - "TOOL_RESULT": {"target": UNIT}, - "MAX_TOKENS": {"target": UNIT}, - "STOP_SEQUENCE": {"target": UNIT}, - "CONTENT_FILTERED": {"target": UNIT}, - "MALFORMED_MODEL_OUTPUT": {"target": UNIT}, - "MALFORMED_TOOL_USE": {"target": UNIT}, - "INTERRUPTED": {"target": UNIT}, - "PARTIAL_TURN": {"target": UNIT}, - "MODEL_CONTEXT_WINDOW_EXCEEDED": {"target": UNIT}, - "MAX_ITERATIONS_EXCEEDED": {"target": UNIT}, - "MAX_OUTPUT_TOKENS_EXCEEDED": {"target": UNIT}, - "TIMEOUT_EXCEEDED": {"target": UNIT}, - "HOOK_STOPPED": {"target": UNIT}, - }, -) - -HARNESS_MESSAGE_STOP_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessMessageStopEvent"), - members={ - "stopReason": { - "target": HARNESS_STOP_REASON, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -HARNESS_STREAM_METRICS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessStreamMetrics"), - members={ - "latencyMs": { - "target": LONG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -HARNESS_TOKEN_USAGE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessTokenUsage"), - members={ - "inputTokens": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "outputTokens": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "totalTokens": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "cacheReadInputTokens": {"target": INTEGER}, - "cacheWriteInputTokens": {"target": INTEGER}, - }, -) - -HARNESS_METADATA_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#HarnessMetadataEvent"), - members={ - "usage": { - "target": HARNESS_TOKEN_USAGE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "metrics": { - "target": HARNESS_STREAM_METRICS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -INVOKE_HARNESS_STREAM_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#InvokeHarnessStreamOutput"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#streaming"))], - members={ - "messageStart": {"target": HARNESS_MESSAGE_START_EVENT}, - "contentBlockStart": {"target": HARNESS_CONTENT_BLOCK_START_EVENT}, - "contentBlockDelta": {"target": HARNESS_CONTENT_BLOCK_DELTA_EVENT}, - "contentBlockStop": {"target": HARNESS_CONTENT_BLOCK_STOP_EVENT}, - "messageStop": {"target": HARNESS_MESSAGE_STOP_EVENT}, - "metadata": {"target": HARNESS_METADATA_EVENT}, - "internalServerException": {"target": INTERNAL_SERVER_EXCEPTION}, - "validationException": {"target": VALIDATION_EXCEPTION}, - "runtimeClientError": {"target": RUNTIME_CLIENT_ERROR}, - "hookEvent": {"target": HARNESS_HOOK_EVENT}, - }, -) - -INVOKE_HARNESS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#InvokeHarnessOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#InvokeHarnessResponse", - ) - ], - members={ - "stream": { - "target": INVOKE_HARNESS_STREAM_OUTPUT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpPayload")), - ], - } - }, -) - -INVOKE_HARNESS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#InvokeHarness"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "POST", "uri": "/harnesses/invoke"} - ), - ) - ], -) - -MEMORY_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#MemoryId"), shape_type=ShapeType.STRING -) - -SENSITIVE_STRING = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#SensitiveString"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -MEMORY_CONTENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#MemoryContent"), - shape_type=ShapeType.UNION, - members={"text": {"target": SENSITIVE_STRING}}, -) - -MEMORY_STRATEGY_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#MemoryStrategyId"), - shape_type=ShapeType.STRING, -) - -METADATA_KEY = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#MetadataKey"), - shape_type=ShapeType.STRING, -) - -STRING_LIST_MEMBER_VALUE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#StringListMemberValue"), - shape_type=ShapeType.STRING, -) - -STRING_VALUE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#StringValueList"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING_LIST_MEMBER_VALUE}}, -) - -STRING_VALUE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#StringValue"), - shape_type=ShapeType.STRING, -) - -MEMORY_RECORD_METADATA_VALUE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#MemoryRecordMetadataValue"), - shape_type=ShapeType.UNION, - members={ - "stringValue": {"target": STRING_VALUE}, - "stringListValue": {"target": STRING_VALUE_LIST}, - "numberValue": {"target": DOUBLE}, - "dateTimeValue": {"target": TIMESTAMP}, - }, -) - -MEMORY_RECORD_METADATA_MAP = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#MemoryRecordMetadataMap"), - shape_type=ShapeType.MAP, - members={ - "key": {"target": METADATA_KEY}, - "value": {"target": MEMORY_RECORD_METADATA_VALUE}, - }, -) - -NAMESPACE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#Namespace"), shape_type=ShapeType.STRING -) - -NAMESPACES_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#NamespacesList"), - shape_type=ShapeType.LIST, - members={"member": {"target": NAMESPACE}}, -) - -REQUEST_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#RequestIdentifier"), - shape_type=ShapeType.STRING, -) - -MEMORY_RECORD_CREATE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#MemoryRecordCreateInput"), - members={ - "requestIdentifier": { - "target": REQUEST_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "namespaces": { - "target": NAMESPACES_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "content": { - "target": MEMORY_CONTENT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "timestamp": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "memoryStrategyId": {"target": MEMORY_STRATEGY_ID}, - "metadata": {"target": MEMORY_RECORD_METADATA_MAP}, - }, -) - -MEMORY_RECORDS_CREATE_INPUT_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#MemoryRecordsCreateInputList"), - shape_type=ShapeType.LIST, - members={"member": {"target": MEMORY_RECORD_CREATE_INPUT}}, -) - -BATCH_CREATE_MEMORY_RECORDS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#BatchCreateMemoryRecordsInput"), - members={ - "memoryId": { - "target": MEMORY_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "records": { - "target": MEMORY_RECORDS_CREATE_INPUT_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientToken": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - }, -) - -MEMORY_RECORD_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#MemoryRecordId"), - shape_type=ShapeType.STRING, -) - -MEMORY_RECORD_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#MemoryRecordStatus"), - shape_type=ShapeType.ENUM, - members={"SUCCEEDED": {"target": UNIT}, "FAILED": {"target": UNIT}}, -) - -MEMORY_RECORD_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#MemoryRecordOutput"), - members={ - "memoryRecordId": { - "target": MEMORY_RECORD_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": MEMORY_RECORD_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "requestIdentifier": {"target": REQUEST_IDENTIFIER}, - "errorCode": {"target": INTEGER}, - "errorMessage": {"target": STRING}, - }, -) - -MEMORY_RECORDS_OUTPUT_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#MemoryRecordsOutputList"), - shape_type=ShapeType.LIST, - members={"member": {"target": MEMORY_RECORD_OUTPUT}}, -) - -BATCH_CREATE_MEMORY_RECORDS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#BatchCreateMemoryRecordsOutput"), - members={ - "successfulRecords": { - "target": MEMORY_RECORDS_OUTPUT_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "failedRecords": { - "target": MEMORY_RECORDS_OUTPUT_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -SERVICE_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ServiceException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="server"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=500), - ], - members={ - "message": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -THROTTLED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ThrottledException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=429), - ], - members={ - "message": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -BATCH_CREATE_MEMORY_RECORDS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#BatchCreateMemoryRecords"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 201, - "method": "POST", - "uri": "/memories/{memoryId}/memoryRecords/batchCreate", - } - ), - ) - ], -) - -MEMORY_RECORD_DELETE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#MemoryRecordDeleteInput"), - members={ - "memoryRecordId": { - "target": MEMORY_RECORD_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "namespace": {"target": NAMESPACE}, - }, -) - -MEMORY_RECORDS_DELETE_INPUT_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#MemoryRecordsDeleteInputList"), - shape_type=ShapeType.LIST, - members={"member": {"target": MEMORY_RECORD_DELETE_INPUT}}, -) - -BATCH_DELETE_MEMORY_RECORDS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#BatchDeleteMemoryRecordsInput"), - members={ - "memoryId": { - "target": MEMORY_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "records": { - "target": MEMORY_RECORDS_DELETE_INPUT_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -BATCH_DELETE_MEMORY_RECORDS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#BatchDeleteMemoryRecordsOutput"), - members={ - "successfulRecords": { - "target": MEMORY_RECORDS_OUTPUT_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "failedRecords": { - "target": MEMORY_RECORDS_OUTPUT_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -BATCH_DELETE_MEMORY_RECORDS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#BatchDeleteMemoryRecords"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/memories/{memoryId}/memoryRecords/batchDelete", - } - ), - ) - ], -) - -MEMORY_RECORD_UPDATE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#MemoryRecordUpdateInput"), - members={ - "memoryRecordId": { - "target": MEMORY_RECORD_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "timestamp": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "content": {"target": MEMORY_CONTENT}, - "namespaces": {"target": NAMESPACES_LIST}, - "sourceNamespaces": {"target": NAMESPACES_LIST}, - "memoryStrategyId": {"target": MEMORY_STRATEGY_ID}, - "metadata": {"target": MEMORY_RECORD_METADATA_MAP}, - }, -) - -MEMORY_RECORDS_UPDATE_INPUT_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#MemoryRecordsUpdateInputList"), - shape_type=ShapeType.LIST, - members={"member": {"target": MEMORY_RECORD_UPDATE_INPUT}}, -) - -BATCH_UPDATE_MEMORY_RECORDS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#BatchUpdateMemoryRecordsInput"), - members={ - "memoryId": { - "target": MEMORY_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "records": { - "target": MEMORY_RECORDS_UPDATE_INPUT_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -BATCH_UPDATE_MEMORY_RECORDS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#BatchUpdateMemoryRecordsOutput"), - members={ - "successfulRecords": { - "target": MEMORY_RECORDS_OUTPUT_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "failedRecords": { - "target": MEMORY_RECORDS_OUTPUT_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -BATCH_UPDATE_MEMORY_RECORDS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#BatchUpdateMemoryRecords"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/memories/{memoryId}/memoryRecords/batchUpdate", - } - ), - ) - ], -) - -BRANCH_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#BranchName"), shape_type=ShapeType.STRING -) - -EVENT_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#EventId"), shape_type=ShapeType.STRING -) - -BRANCH = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#Branch"), - members={ - "rootEventId": {"target": EVENT_ID}, - "name": { - "target": BRANCH_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -NAMESPACE_VARIABLE_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#NamespaceVariableName"), - shape_type=ShapeType.STRING, -) - -NAMESPACE_VARIABLE_VALUE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#NamespaceVariableValue"), - shape_type=ShapeType.STRING, -) - -NAMESPACE_VARIABLES_MAP = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#NamespaceVariablesMap"), - shape_type=ShapeType.MAP, - members={ - "key": {"target": NAMESPACE_VARIABLE_NAME}, - "value": {"target": NAMESPACE_VARIABLE_VALUE}, - }, -) - -EXTRACTION_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ExtractionConfig"), - members={"namespaceVariables": {"target": NAMESPACE_VARIABLES_MAP}}, -) - -EXTRACTION_MODE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ExtractionMode"), - shape_type=ShapeType.ENUM, - members={"SKIP": {"target": UNIT}}, -) - -METADATA_VALUE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#MetadataValue"), - shape_type=ShapeType.UNION, - members={"stringValue": {"target": STRING}}, -) - -METADATA_MAP = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#MetadataMap"), - shape_type=ShapeType.MAP, - members={"key": {"target": METADATA_KEY}, "value": {"target": METADATA_VALUE}}, -) - -MEMORY_DOCUMENT = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#MemoryDocument"), - shape_type=ShapeType.DOCUMENT, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -CONTENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#Content"), - shape_type=ShapeType.UNION, - members={"text": {"target": SENSITIVE_STRING}}, -) - -ROLE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#Role"), - shape_type=ShapeType.ENUM, - members={ - "ASSISTANT": {"target": UNIT}, - "USER": {"target": UNIT}, - "TOOL": {"target": UNIT}, - "OTHER": {"target": UNIT}, - }, -) - -CONVERSATIONAL = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#Conversational"), - members={ - "content": { - "target": CONTENT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "role": { - "target": ROLE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -MEMORY_JSON_DATA_CONTENT = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#MemoryJsonDataContent"), - shape_type=ShapeType.DOCUMENT, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -MEMORY_JSON_DATA = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#MemoryJsonData"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "content": { - "target": MEMORY_JSON_DATA_CONTENT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -PAYLOAD_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#PayloadType"), - shape_type=ShapeType.UNION, - members={ - "conversational": {"target": CONVERSATIONAL}, - "blob": {"target": MEMORY_DOCUMENT}, - "json": {"target": MEMORY_JSON_DATA}, - }, -) - -PAYLOAD_TYPE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#PayloadTypeList"), - shape_type=ShapeType.LIST, - members={"member": {"target": PAYLOAD_TYPE}}, -) - -CREATE_EVENT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#CreateEventInput"), - members={ - "memoryId": { - "target": MEMORY_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "actorId": { - "target": ACTOR_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "sessionId": {"target": SESSION_ID}, - "eventTimestamp": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "payload": { - "target": PAYLOAD_TYPE_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "branch": {"target": BRANCH}, - "clientToken": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "metadata": {"target": METADATA_MAP}, - "extractionMode": {"target": EXTRACTION_MODE}, - "extractionConfig": {"target": EXTRACTION_CONFIG}, - }, -) - -EVENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#Event"), - members={ - "memoryId": { - "target": MEMORY_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "actorId": { - "target": ACTOR_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "sessionId": { - "target": SESSION_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "eventId": { - "target": EVENT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "eventTimestamp": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "payload": { - "target": PAYLOAD_TYPE_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "branch": {"target": BRANCH}, - "metadata": {"target": METADATA_MAP}, - }, -) - -CREATE_EVENT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#CreateEventOutput"), - members={ - "event": { - "target": EVENT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -INVALID_INPUT_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#InvalidInputException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={ - "message": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -CREATE_EVENT = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#CreateEvent"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 201, "method": "POST", "uri": "/memories/{memoryId}/events"} - ), - ) - ], -) - -DELETE_EVENT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#DeleteEventInput"), - members={ - "memoryId": { - "target": MEMORY_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "sessionId": { - "target": SESSION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "eventId": { - "target": EVENT_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "actorId": { - "target": ACTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -DELETE_EVENT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#DeleteEventOutput"), - members={ - "eventId": { - "target": EVENT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -DELETE_EVENT = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#DeleteEvent"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/memories/{memoryId}/actor/{actorId}/sessions/{sessionId}/events/{eventId}", - } - ), - ) - ], -) - -DELETE_MEMORY_RECORD_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#DeleteMemoryRecordInput"), - members={ - "memoryId": { - "target": MEMORY_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "memoryRecordId": { - "target": MEMORY_RECORD_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "namespace": { - "target": NAMESPACE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="namespace") - ], - }, - }, -) - -DELETE_MEMORY_RECORD_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#DeleteMemoryRecordOutput"), - members={ - "memoryRecordId": { - "target": MEMORY_RECORD_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -DELETE_MEMORY_RECORD = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#DeleteMemoryRecord"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/memories/{memoryId}/memoryRecords/{memoryRecordId}", - } - ), - ) - ], -) - -GET_EVENT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#GetEventInput"), - members={ - "memoryId": { - "target": MEMORY_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "sessionId": { - "target": SESSION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "actorId": { - "target": ACTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "eventId": { - "target": EVENT_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -GET_EVENT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#GetEventOutput"), - members={ - "event": { - "target": EVENT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -GET_EVENT = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#GetEvent"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/memories/{memoryId}/actor/{actorId}/sessions/{sessionId}/events/{eventId}", - } - ), - ) - ], -) - -GET_MEMORY_RECORD_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#GetMemoryRecordInput"), - members={ - "memoryId": { - "target": MEMORY_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "memoryRecordId": { - "target": MEMORY_RECORD_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "namespace": { - "target": NAMESPACE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="namespace") - ], - }, - }, -) - -MEMORY_RECORD = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#MemoryRecord"), - members={ - "memoryRecordId": { - "target": MEMORY_RECORD_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "content": { - "target": MEMORY_CONTENT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "memoryStrategyId": { - "target": MEMORY_STRATEGY_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "namespaces": { - "target": NAMESPACES_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "metadata": {"target": MEMORY_RECORD_METADATA_MAP}, - }, -) - -GET_MEMORY_RECORD_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#GetMemoryRecordOutput"), - members={ - "memoryRecord": { - "target": MEMORY_RECORD, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -GET_MEMORY_RECORD = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#GetMemoryRecord"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/memories/{memoryId}/memoryRecord/{memoryRecordId}", - } - ), - ) - ], -) - -INGEST_PAYLOAD_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#IngestPayloadType"), - shape_type=ShapeType.UNION, - members={ - "conversational": {"target": CONVERSATIONAL}, - "json": {"target": MEMORY_JSON_DATA}, - }, -) - -INGEST_PAYLOAD_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#IngestPayloadList"), - shape_type=ShapeType.LIST, - members={"member": {"target": INGEST_PAYLOAD_TYPE}}, -) - -INLINE_MEMORY_CONTENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#InlineMemoryContent"), - members={ - "payload": { - "target": INGEST_PAYLOAD_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -CONTENT_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ContentSource"), - shape_type=ShapeType.UNION, - members={"inline": {"target": INLINE_MEMORY_CONTENT}}, -) - -INGEST_DATA_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#IngestDataInput"), - members={ - "memoryId": { - "target": MEMORY_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "source": { - "target": CONTENT_SOURCE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "contentTimestamp": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "actorId": { - "target": ACTOR_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "sessionId": {"target": SESSION_ID}, - "extractionConfig": {"target": EXTRACTION_CONFIG}, - "metadata": {"target": METADATA_MAP}, - "clientToken": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - }, -) - -INGEST_DATA_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#IngestDataOutput"), - members={ - "sessionId": { - "target": SESSION_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -INGEST_DATA = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#IngestData"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 202, "method": "POST", "uri": "/memories/{memoryId}/ingest"} - ), - ) - ], -) - -PAGINATION_TOKEN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#PaginationToken"), - shape_type=ShapeType.STRING, -) - -LIST_ACTORS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ListActorsInput"), - members={ - "memoryId": { - "target": MEMORY_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "maxResults": { - "target": MAX_RESULTS, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=100)], - }, - "nextToken": {"target": PAGINATION_TOKEN}, - }, -) - -LIST_ACTORS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ListActorsOutput"), - members={ - "actorSummaries": { - "target": ACTOR_SUMMARY_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": PAGINATION_TOKEN}, - }, -) - -LIST_ACTORS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#ListActors"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/memories/{memoryId}/actors"} - ), - ) - ], -) - -BRANCH_FILTER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#BranchFilter"), - members={ - "name": { - "target": BRANCH_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "includeParentBranches": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=True)], - }, - }, -) - -LEFT_EXPRESSION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#LeftExpression"), - shape_type=ShapeType.UNION, - members={"metadataKey": {"target": METADATA_KEY}}, -) - -OPERATOR_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#OperatorType"), - shape_type=ShapeType.ENUM, - members={ - "EQUALS_TO": {"target": UNIT}, - "EXISTS": {"target": UNIT}, - "NOT_EXISTS": {"target": UNIT}, - }, -) - -RIGHT_EXPRESSION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#RightExpression"), - shape_type=ShapeType.UNION, - members={"metadataValue": {"target": METADATA_VALUE}}, -) - -EVENT_METADATA_FILTER_EXPRESSION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#EventMetadataFilterExpression"), - members={ - "left": { - "target": LEFT_EXPRESSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "operator": { - "target": OPERATOR_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "right": {"target": RIGHT_EXPRESSION}, - }, -) - -EVENT_METADATA_FILTER_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#EventMetadataFilterList"), - shape_type=ShapeType.LIST, - members={"member": {"target": EVENT_METADATA_FILTER_EXPRESSION}}, -) - -FILTER_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#FilterInput"), - members={ - "branch": {"target": BRANCH_FILTER}, - "eventMetadata": {"target": EVENT_METADATA_FILTER_LIST}, - }, -) - -LIST_EVENTS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ListEventsInput"), - members={ - "memoryId": { - "target": MEMORY_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "sessionId": { - "target": SESSION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "actorId": { - "target": ACTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "includePayloads": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=True)], - }, - "filter": {"target": FILTER_INPUT}, - "maxResults": { - "target": MAX_RESULTS, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=100)], - }, - "nextToken": {"target": PAGINATION_TOKEN}, - }, -) - -EVENT_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#EventList"), - shape_type=ShapeType.LIST, - members={"member": {"target": EVENT}}, -) - -LIST_EVENTS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ListEventsOutput"), - members={ - "events": { - "target": EVENT_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": PAGINATION_TOKEN}, - }, -) - -LIST_EVENTS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#ListEvents"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/memories/{memoryId}/actor/{actorId}/sessions/{sessionId}", - } - ), - ) - ], -) - -EXTRACTION_JOB_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ExtractionJobStatus"), - shape_type=ShapeType.ENUM, - members={"FAILED": {"target": UNIT}}, -) - -EXTRACTION_JOB_FILTER_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ExtractionJobFilterInput"), - members={ - "strategyId": {"target": STRING}, - "sessionId": {"target": STRING}, - "actorId": {"target": STRING}, - "status": {"target": EXTRACTION_JOB_STATUS}, - }, -) - -LIST_MEMORY_EXTRACTION_JOBS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ListMemoryExtractionJobsInput"), - members={ - "memoryId": { - "target": MEMORY_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "maxResults": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=20)], - }, - "filter": {"target": EXTRACTION_JOB_FILTER_INPUT}, - "nextToken": {"target": PAGINATION_TOKEN}, - }, -) - -MESSAGE_METADATA = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#MessageMetadata"), - members={ - "eventId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "messageIndex": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -MESSAGES_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#MessagesList"), - shape_type=ShapeType.LIST, - members={"member": {"target": MESSAGE_METADATA}}, -) - -EXTRACTION_JOB_MESSAGES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ExtractionJobMessages"), - shape_type=ShapeType.UNION, - members={"messagesList": {"target": MESSAGES_LIST}}, -) - -EXTRACTION_JOB_METADATA = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ExtractionJobMetadata"), - members={ - "jobID": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "messages": { - "target": EXTRACTION_JOB_MESSAGES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": {"target": EXTRACTION_JOB_STATUS}, - "failureReason": {"target": STRING}, - "strategyId": {"target": STRING}, - "sessionId": {"target": STRING}, - "actorId": {"target": STRING}, - }, -) - -EXTRACTION_JOB_METADATA_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ExtractionJobMetadataList"), - shape_type=ShapeType.LIST, - members={"member": {"target": EXTRACTION_JOB_METADATA}}, -) - -LIST_MEMORY_EXTRACTION_JOBS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ListMemoryExtractionJobsOutput"), - members={ - "jobs": { - "target": EXTRACTION_JOB_METADATA_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": PAGINATION_TOKEN}, - }, -) - -LIST_MEMORY_EXTRACTION_JOBS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#ListMemoryExtractionJobs"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/memories/{memoryId}/extractionJobs"} - ), - ) - ], -) - -MEMORY_RECORD_LEFT_EXPRESSION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#MemoryRecordLeftExpression"), - shape_type=ShapeType.UNION, - members={"metadataKey": {"target": METADATA_KEY}}, -) - -MEMORY_RECORD_OPERATOR_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#MemoryRecordOperatorType"), - shape_type=ShapeType.ENUM, - members={ - "EQUALS_TO": {"target": UNIT}, - "EXISTS": {"target": UNIT}, - "NOT_EXISTS": {"target": UNIT}, - "BEFORE": {"target": UNIT}, - "AFTER": {"target": UNIT}, - "CONTAINS": {"target": UNIT}, - "GREATER_THAN": {"target": UNIT}, - "GREATER_THAN_OR_EQUALS": {"target": UNIT}, - "LESS_THAN": {"target": UNIT}, - "LESS_THAN_OR_EQUALS": {"target": UNIT}, - }, -) - -MEMORY_RECORD_RIGHT_EXPRESSION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#MemoryRecordRightExpression"), - shape_type=ShapeType.UNION, - members={"metadataValue": {"target": MEMORY_RECORD_METADATA_VALUE}}, -) - -MEMORY_METADATA_FILTER_EXPRESSION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#MemoryMetadataFilterExpression"), - members={ - "left": { - "target": MEMORY_RECORD_LEFT_EXPRESSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "operator": { - "target": MEMORY_RECORD_OPERATOR_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "right": {"target": MEMORY_RECORD_RIGHT_EXPRESSION}, - }, -) - -MEMORY_METADATA_FILTER_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#MemoryMetadataFilterList"), - shape_type=ShapeType.LIST, - members={"member": {"target": MEMORY_METADATA_FILTER_EXPRESSION}}, -) - -LIST_MEMORY_RECORDS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ListMemoryRecordsInput"), - members={ - "memoryId": { - "target": MEMORY_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "namespace": {"target": NAMESPACE}, - "namespacePath": {"target": NAMESPACE}, - "memoryStrategyId": {"target": MEMORY_STRATEGY_ID}, - "maxResults": { - "target": MAX_RESULTS, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=100)], - }, - "nextToken": {"target": PAGINATION_TOKEN}, - "metadataFilters": {"target": MEMORY_METADATA_FILTER_LIST}, - }, -) - -MEMORY_RECORD_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#MemoryRecordSummary"), - members={ - "memoryRecordId": { - "target": MEMORY_RECORD_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "content": { - "target": MEMORY_CONTENT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "memoryStrategyId": { - "target": MEMORY_STRATEGY_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "namespaces": { - "target": NAMESPACES_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "score": {"target": DOUBLE}, - "metadata": {"target": MEMORY_RECORD_METADATA_MAP}, - }, -) - -MEMORY_RECORD_SUMMARY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#MemoryRecordSummaryList"), - shape_type=ShapeType.LIST, - members={"member": {"target": MEMORY_RECORD_SUMMARY}}, -) - -LIST_MEMORY_RECORDS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ListMemoryRecordsOutput"), - members={ - "memoryRecordSummaries": { - "target": MEMORY_RECORD_SUMMARY_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": PAGINATION_TOKEN}, - }, -) - -LIST_MEMORY_RECORDS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#ListMemoryRecords"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/memories/{memoryId}/memoryRecords"} - ), - ) - ], -) - -EVENT_FILTER_CONDITION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#EventFilterCondition"), - shape_type=ShapeType.ENUM, - members={"HAS_EVENTS": {"target": UNIT}}, -) - -SESSION_FILTER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#SessionFilter"), - members={"eventFilter": {"target": EVENT_FILTER_CONDITION}}, -) - -LIST_SESSIONS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ListSessionsInput"), - members={ - "memoryId": { - "target": MEMORY_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "actorId": { - "target": ACTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "maxResults": { - "target": MAX_RESULTS, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=100)], - }, - "nextToken": {"target": PAGINATION_TOKEN}, - "filter": {"target": SESSION_FILTER}, - }, -) - -SESSION_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#SessionSummary"), - members={ - "sessionId": { - "target": SESSION_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "actorId": { - "target": ACTOR_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -SESSION_SUMMARY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#SessionSummaryList"), - shape_type=ShapeType.LIST, - members={"member": {"target": SESSION_SUMMARY}}, -) - -LIST_SESSIONS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ListSessionsOutput"), - members={ - "sessionSummaries": { - "target": SESSION_SUMMARY_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": PAGINATION_TOKEN}, - }, -) - -LIST_SESSIONS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#ListSessions"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/memories/{memoryId}/actor/{actorId}/sessions", - } - ), - ) - ], -) - -SEARCH_CRITERIA = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#SearchCriteria"), - members={ - "searchQuery": { - "target": SENSITIVE_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "memoryStrategyId": {"target": MEMORY_STRATEGY_ID}, - "topK": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=10)], - }, - "metadataFilters": {"target": MEMORY_METADATA_FILTER_LIST}, - }, -) - -RETRIEVE_MEMORY_RECORDS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#RetrieveMemoryRecordsInput"), - members={ - "memoryId": { - "target": MEMORY_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "namespace": {"target": NAMESPACE}, - "namespacePath": {"target": NAMESPACE}, - "searchCriteria": { - "target": SEARCH_CRITERIA, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": PAGINATION_TOKEN}, - "maxResults": { - "target": MAX_RESULTS, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=100)], - }, - }, -) - -RETRIEVE_MEMORY_RECORDS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#RetrieveMemoryRecordsOutput"), - members={ - "memoryRecordSummaries": { - "target": MEMORY_RECORD_SUMMARY_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": PAGINATION_TOKEN}, - }, -) - -RETRIEVE_MEMORY_RECORDS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#RetrieveMemoryRecords"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/memories/{memoryId}/retrieve"} - ), - ) - ], -) - -EXTRACTION_JOB = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ExtractionJob"), - members={ - "jobId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -START_MEMORY_EXTRACTION_JOB_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#StartMemoryExtractionJobInput"), - members={ - "memoryId": { - "target": MEMORY_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "extractionJob": { - "target": EXTRACTION_JOB, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientToken": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - }, -) - -START_MEMORY_EXTRACTION_JOB_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#StartMemoryExtractionJobOutput"), - members={ - "jobId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -START_MEMORY_EXTRACTION_JOB = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#StartMemoryExtractionJob"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/memories/{memoryId}/extractionJobs/start"} - ), - ) - ], -) - -PAYMENT_AGENT_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#PaymentAgentName"), - shape_type=ShapeType.STRING, -) - -PAYMENT_CONNECTOR_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#PaymentConnectorId"), - shape_type=ShapeType.STRING, -) - -JWT_KEY_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#JwtKeyId"), shape_type=ShapeType.STRING -) - -LINKED_ACCOUNT_DEVELOPER_JWT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#LinkedAccountDeveloperJwt"), - members={ - "kid": { - "target": JWT_KEY_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "sub": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -EMAIL = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#Email"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -LINKED_ACCOUNT_EMAIL = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#LinkedAccountEmail"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "emailAddress": { - "target": EMAIL, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -O_AUTH2_AUTHENTICATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#OAuth2Authentication"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "sub": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "emailAddress": {"target": EMAIL}, - "name": {"target": STRING}, - "username": {"target": STRING}, - }, -) - -LINKED_ACCOUNT_O_AUTH2 = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#LinkedAccountOAuth2"), - shape_type=ShapeType.UNION, - members={ - "google": {"target": O_AUTH2_AUTHENTICATION}, - "apple": {"target": O_AUTH2_AUTHENTICATION}, - "x": {"target": O_AUTH2_AUTHENTICATION}, - "telegram": {"target": O_AUTH2_AUTHENTICATION}, - "github": {"target": O_AUTH2_AUTHENTICATION}, - }, -) - -PHONE_NUMBER = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#PhoneNumber"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -LINKED_ACCOUNT_SMS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#LinkedAccountSms"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "phoneNumber": { - "target": PHONE_NUMBER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -LINKED_ACCOUNT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#LinkedAccount"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "email": {"target": LINKED_ACCOUNT_EMAIL}, - "sms": {"target": LINKED_ACCOUNT_SMS}, - "developerJwt": {"target": LINKED_ACCOUNT_DEVELOPER_JWT}, - "oAuth2": {"target": LINKED_ACCOUNT_O_AUTH2}, - }, -) - -LINKED_ACCOUNT_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#LinkedAccountList"), - shape_type=ShapeType.LIST, - members={"member": {"target": LINKED_ACCOUNT}}, -) - -CRYPTO_WALLET_NETWORK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#CryptoWalletNetwork"), - shape_type=ShapeType.ENUM, - members={"ETHEREUM": {"target": UNIT}, "SOLANA": {"target": UNIT}}, -) - -EMBEDDED_CRYPTO_WALLET = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#EmbeddedCryptoWallet"), - members={ - "network": { - "target": CRYPTO_WALLET_NETWORK, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "linkedAccounts": { - "target": LINKED_ACCOUNT_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "walletAddress": {"target": STRING}, - "redirectUrl": {"target": STRING}, - }, -) - -PAYMENT_INSTRUMENT_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#PaymentInstrumentDetails"), - shape_type=ShapeType.UNION, - members={"embeddedCryptoWallet": {"target": EMBEDDED_CRYPTO_WALLET}}, -) - -PAYMENT_INSTRUMENT_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#PaymentInstrumentType"), - shape_type=ShapeType.ENUM, - members={"EMBEDDED_CRYPTO_WALLET": {"target": UNIT}}, -) - -PAYMENT_MANAGER_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#PaymentManagerArn"), - shape_type=ShapeType.STRING, -) - -USER_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#UserId"), shape_type=ShapeType.STRING -) - -CREATE_PAYMENT_INSTRUMENT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#CreatePaymentInstrumentInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#CreatePaymentInstrumentRequest", - ) - ], - members={ - "userId": { - "target": USER_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="X-Amzn-Bedrock-AgentCore-Payments-User-Id", - ) - ], - }, - "agentName": { - "target": PAYMENT_AGENT_NAME, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="X-Amzn-Bedrock-AgentCore-Payments-Agent-Name", - ) - ], - }, - "paymentManagerArn": { - "target": PAYMENT_MANAGER_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "paymentConnectorId": { - "target": PAYMENT_CONNECTOR_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "paymentInstrumentType": { - "target": PAYMENT_INSTRUMENT_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "paymentInstrumentDetails": { - "target": PAYMENT_INSTRUMENT_DETAILS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - }, -) - -PAYMENT_INSTRUMENT_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#PaymentInstrumentId"), - shape_type=ShapeType.STRING, -) - -PAYMENT_INSTRUMENT_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#PaymentInstrumentStatus"), - shape_type=ShapeType.ENUM, - members={ - "INITIATED": {"target": UNIT}, - "ACTIVE": {"target": UNIT}, - "FAILED": {"target": UNIT}, - "DELETED": {"target": UNIT}, - "BLOCKED": {"target": UNIT}, - }, -) - -PAYMENT_INSTRUMENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#PaymentInstrument"), - members={ - "paymentInstrumentId": { - "target": PAYMENT_INSTRUMENT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "paymentManagerArn": { - "target": PAYMENT_MANAGER_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "paymentConnectorId": { - "target": PAYMENT_CONNECTOR_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "userId": { - "target": USER_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "paymentInstrumentType": { - "target": PAYMENT_INSTRUMENT_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "paymentInstrumentDetails": { - "target": PAYMENT_INSTRUMENT_DETAILS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": PAYMENT_INSTRUMENT_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -CREATE_PAYMENT_INSTRUMENT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#CreatePaymentInstrumentOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#CreatePaymentInstrumentResponse", - ) - ], - members={ - "paymentInstrument": { - "target": PAYMENT_INSTRUMENT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -SUBSCRIPTION_REQUIRED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#SubscriptionRequiredException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=403), - ], - members={ - "message": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "subscriptionUrl": {"target": STRING}, - "productName": {"target": STRING}, - }, -) - -CREATE_PAYMENT_INSTRUMENT = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#CreatePaymentInstrument"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 201, - "method": "POST", - "uri": "/payments/createPaymentInstrument", - } - ), - ) - ], -) - -DELETE_PAYMENT_INSTRUMENT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#DeletePaymentInstrumentInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#DeletePaymentInstrumentRequest", - ) - ], - members={ - "userId": { - "target": USER_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="X-Amzn-Bedrock-AgentCore-Payments-User-Id", - ) - ], - }, - "paymentManagerArn": { - "target": PAYMENT_MANAGER_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "paymentConnectorId": { - "target": PAYMENT_CONNECTOR_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "paymentInstrumentId": { - "target": PAYMENT_INSTRUMENT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -DELETE_PAYMENT_INSTRUMENT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#DeletePaymentInstrumentOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#DeletePaymentInstrumentResponse", - ) - ], - members={ - "status": { - "target": PAYMENT_INSTRUMENT_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -DELETE_PAYMENT_INSTRUMENT = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#DeletePaymentInstrument"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "POST", - "uri": "/payments/deletePaymentInstrument", - } - ), - ) - ], -) - -GET_PAYMENT_INSTRUMENT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#GetPaymentInstrumentInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#GetPaymentInstrumentRequest", - ) - ], - members={ - "userId": { - "target": USER_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="X-Amzn-Bedrock-AgentCore-Payments-User-Id", - ) - ], - }, - "agentName": { - "target": PAYMENT_AGENT_NAME, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="X-Amzn-Bedrock-AgentCore-Payments-Agent-Name", - ) - ], - }, - "paymentManagerArn": { - "target": PAYMENT_MANAGER_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "paymentConnectorId": {"target": PAYMENT_CONNECTOR_ID}, - "paymentInstrumentId": { - "target": PAYMENT_INSTRUMENT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -GET_PAYMENT_INSTRUMENT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#GetPaymentInstrumentOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#GetPaymentInstrumentResponse", - ) - ], - members={ - "paymentInstrument": { - "target": PAYMENT_INSTRUMENT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -GET_PAYMENT_INSTRUMENT = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#GetPaymentInstrument"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "POST", "uri": "/payments/getPaymentInstrument"} - ), - ) - ], -) - -BLOCKCHAIN_CHAIN_ID = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#BlockchainChainId"), - shape_type=ShapeType.ENUM, - members={ - "BASE": {"target": UNIT}, - "BASE_SEPOLIA": {"target": UNIT}, - "ETHEREUM": {"target": UNIT}, - "SOLANA": {"target": UNIT}, - "SOLANA_DEVNET": {"target": UNIT}, - }, -) - -INSTRUMENT_BALANCE_TOKEN = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#InstrumentBalanceToken"), - shape_type=ShapeType.ENUM, - members={"USDC": {"target": UNIT}}, -) - -GET_PAYMENT_INSTRUMENT_BALANCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#GetPaymentInstrumentBalanceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#GetPaymentInstrumentBalanceRequest", - ) - ], - members={ - "userId": { - "target": USER_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="X-Amzn-Bedrock-AgentCore-Payments-User-Id", - ) - ], - }, - "agentName": { - "target": PAYMENT_AGENT_NAME, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="X-Amzn-Bedrock-AgentCore-Payments-Agent-Name", - ) - ], - }, - "paymentManagerArn": { - "target": PAYMENT_MANAGER_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "paymentConnectorId": { - "target": PAYMENT_CONNECTOR_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "paymentInstrumentId": { - "target": PAYMENT_INSTRUMENT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "chain": { - "target": BLOCKCHAIN_CHAIN_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "token": { - "target": INSTRUMENT_BALANCE_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -TOKEN_BALANCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#TokenBalance"), - members={ - "amount": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "decimals": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "token": { - "target": INSTRUMENT_BALANCE_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "network": { - "target": CRYPTO_WALLET_NETWORK, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "chain": { - "target": BLOCKCHAIN_CHAIN_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -GET_PAYMENT_INSTRUMENT_BALANCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#GetPaymentInstrumentBalanceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#GetPaymentInstrumentBalanceResponse", - ) - ], - members={ - "paymentInstrumentId": { - "target": PAYMENT_INSTRUMENT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "tokenBalance": { - "target": TOKEN_BALANCE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -GET_PAYMENT_INSTRUMENT_BALANCE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#GetPaymentInstrumentBalance"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "POST", - "uri": "/payments/getPaymentInstrumentBalance", - } - ), - ) - ], -) - -LIST_PAYMENT_INSTRUMENTS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ListPaymentInstrumentsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#ListPaymentInstrumentsRequest", - ) - ], - members={ - "userId": { - "target": USER_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="X-Amzn-Bedrock-AgentCore-Payments-User-Id", - ) - ], - }, - "agentName": { - "target": PAYMENT_AGENT_NAME, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="X-Amzn-Bedrock-AgentCore-Payments-Agent-Name", - ) - ], - }, - "paymentManagerArn": { - "target": PAYMENT_MANAGER_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "paymentConnectorId": {"target": PAYMENT_CONNECTOR_ID}, - "nextToken": {"target": NEXT_TOKEN}, - "maxResults": {"target": INTEGER}, - }, -) - -PAYMENT_INSTRUMENT_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#PaymentInstrumentSummary"), - members={ - "paymentInstrumentId": { - "target": PAYMENT_INSTRUMENT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "paymentManagerArn": { - "target": PAYMENT_MANAGER_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "paymentConnectorId": { - "target": PAYMENT_CONNECTOR_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "userId": { - "target": USER_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "paymentInstrumentType": { - "target": PAYMENT_INSTRUMENT_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": PAYMENT_INSTRUMENT_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -PAYMENT_INSTRUMENT_SUMMARY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#PaymentInstrumentSummaryList"), - shape_type=ShapeType.LIST, - members={"member": {"target": PAYMENT_INSTRUMENT_SUMMARY}}, -) - -LIST_PAYMENT_INSTRUMENTS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ListPaymentInstrumentsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#ListPaymentInstrumentsResponse", - ) - ], - members={ - "paymentInstruments": { - "target": PAYMENT_INSTRUMENT_SUMMARY_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": STRING}, - }, -) - -LIST_PAYMENT_INSTRUMENTS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#ListPaymentInstruments"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "POST", - "uri": "/payments/listPaymentInstruments", - } - ), - ) - ], -) - -CURRENCY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#Currency"), - shape_type=ShapeType.ENUM, - members={"USD": {"target": UNIT}}, -) - -AMOUNT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#Amount"), - members={ - "value": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "currency": { - "target": CURRENCY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -SESSION_LIMITS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#SessionLimits"), - members={ - "maxSpendAmount": { - "target": AMOUNT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -CREATE_PAYMENT_SESSION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#CreatePaymentSessionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#CreatePaymentSessionRequest", - ) - ], - members={ - "userId": { - "target": USER_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="X-Amzn-Bedrock-AgentCore-Payments-User-Id", - ) - ], - }, - "agentName": { - "target": PAYMENT_AGENT_NAME, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="X-Amzn-Bedrock-AgentCore-Payments-Agent-Name", - ) - ], - }, - "paymentManagerArn": { - "target": PAYMENT_MANAGER_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "limits": {"target": SESSION_LIMITS}, - "expiryTimeInMinutes": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - }, -) - -AVAILABLE_LIMITS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#AvailableLimits"), - members={ - "availableSpendAmount": {"target": AMOUNT}, - "updatedAt": {"target": DATE_TIMESTAMP}, - }, -) - -PAYMENT_SESSION_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#PaymentSessionId"), - shape_type=ShapeType.STRING, -) - -PAYMENT_SESSION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#PaymentSession"), - members={ - "paymentSessionId": { - "target": PAYMENT_SESSION_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "paymentManagerArn": { - "target": PAYMENT_MANAGER_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "limits": {"target": SESSION_LIMITS}, - "userId": { - "target": USER_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "expiryTimeInMinutes": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "availableLimits": {"target": AVAILABLE_LIMITS}, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -CREATE_PAYMENT_SESSION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#CreatePaymentSessionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#CreatePaymentSessionResponse", - ) - ], - members={ - "paymentSession": { - "target": PAYMENT_SESSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -CREATE_PAYMENT_SESSION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#CreatePaymentSession"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 201, "method": "POST", "uri": "/payments/createPaymentSession"} - ), - ) - ], -) - -DELETE_PAYMENT_SESSION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#DeletePaymentSessionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#DeletePaymentSessionRequest", - ) - ], - members={ - "userId": { - "target": USER_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="X-Amzn-Bedrock-AgentCore-Payments-User-Id", - ) - ], - }, - "paymentManagerArn": { - "target": PAYMENT_MANAGER_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "paymentSessionId": { - "target": PAYMENT_SESSION_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -PAYMENT_SESSION_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#PaymentSessionStatus"), - shape_type=ShapeType.ENUM, - members={ - "ACTIVE": {"target": UNIT}, - "EXPIRED": {"target": UNIT}, - "DELETED": {"target": UNIT}, - }, -) - -DELETE_PAYMENT_SESSION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#DeletePaymentSessionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#DeletePaymentSessionResponse", - ) - ], - members={ - "status": { - "target": PAYMENT_SESSION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -DELETE_PAYMENT_SESSION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#DeletePaymentSession"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "POST", "uri": "/payments/deletePaymentSession"} - ), - ) - ], -) - -GET_PAYMENT_SESSION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#GetPaymentSessionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#GetPaymentSessionRequest", - ) - ], - members={ - "userId": { - "target": USER_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="X-Amzn-Bedrock-AgentCore-Payments-User-Id", - ) - ], - }, - "agentName": { - "target": PAYMENT_AGENT_NAME, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="X-Amzn-Bedrock-AgentCore-Payments-Agent-Name", - ) - ], - }, - "paymentManagerArn": { - "target": PAYMENT_MANAGER_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "paymentSessionId": { - "target": PAYMENT_SESSION_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -GET_PAYMENT_SESSION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#GetPaymentSessionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#GetPaymentSessionResponse", - ) - ], - members={ - "paymentSession": { - "target": PAYMENT_SESSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -GET_PAYMENT_SESSION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#GetPaymentSession"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "POST", "uri": "/payments/getPaymentSession"} - ), - ) - ], -) - -LIST_PAYMENT_SESSIONS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ListPaymentSessionsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#ListPaymentSessionsRequest", - ) - ], - members={ - "userId": { - "target": USER_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="X-Amzn-Bedrock-AgentCore-Payments-User-Id", - ) - ], - }, - "agentName": { - "target": PAYMENT_AGENT_NAME, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="X-Amzn-Bedrock-AgentCore-Payments-Agent-Name", - ) - ], - }, - "paymentManagerArn": { - "target": PAYMENT_MANAGER_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": NEXT_TOKEN}, - "maxResults": {"target": INTEGER}, - }, -) - -PAYMENT_SESSION_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#PaymentSessionSummary"), - members={ - "paymentSessionId": { - "target": PAYMENT_SESSION_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "paymentManagerArn": { - "target": PAYMENT_MANAGER_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "userId": { - "target": USER_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "expiryTimeInMinutes": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -PAYMENT_SESSION_SUMMARY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#PaymentSessionSummaryList"), - shape_type=ShapeType.LIST, - members={"member": {"target": PAYMENT_SESSION_SUMMARY}}, -) - -LIST_PAYMENT_SESSIONS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ListPaymentSessionsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#ListPaymentSessionsResponse", - ) - ], - members={ - "paymentSessions": { - "target": PAYMENT_SESSION_SUMMARY_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": NEXT_TOKEN}, - }, -) - -LIST_PAYMENT_SESSIONS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#ListPaymentSessions"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "POST", "uri": "/payments/listPaymentSessions"} - ), - ) - ], -) - -PAYMENT_DOCUMENT = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#PaymentDocument"), - shape_type=ShapeType.DOCUMENT, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -PERMIT2_ALLOWANCE_LIMIT = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#Permit2AllowanceLimit"), - shape_type=ShapeType.STRING, -) - -CRYPTO_X402_PAYMENT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#CryptoX402PaymentInput"), - members={ - "version": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "payload": { - "target": PAYMENT_DOCUMENT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "permit2AllowanceLimit": {"target": PERMIT2_ALLOWANCE_LIMIT}, - }, -) - -VERSION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#Version"), shape_type=ShapeType.STRING -) - -WWW_AUTHENTICATE_HEADER = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#WwwAuthenticateHeader"), - shape_type=ShapeType.STRING, -) - -WWW_AUTHENTICATE_HEADER_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#WwwAuthenticateHeaderList"), - shape_type=ShapeType.LIST, - members={"member": {"target": WWW_AUTHENTICATE_HEADER}}, -) - -MPP_PAYMENT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#MppPaymentInput"), - members={ - "version": { - "target": VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "wwwAuthenticateHeaders": { - "target": WWW_AUTHENTICATE_HEADER_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "buyerPaysGasFees": {"target": BOOLEAN}, - }, -) - -PAYMENT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#PaymentInput"), - shape_type=ShapeType.UNION, - members={ - "cryptoX402": {"target": CRYPTO_X402_PAYMENT_INPUT}, - "mpp": {"target": MPP_PAYMENT_INPUT}, - }, -) - -PAYMENT_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#PaymentType"), - shape_type=ShapeType.ENUM, - members={"CRYPTO_X402": {"target": UNIT}, "MPP": {"target": UNIT}}, -) - -PROCESS_PAYMENT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ProcessPaymentInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#ProcessPaymentRequest", - ) - ], - members={ - "userId": { - "target": USER_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="X-Amzn-Bedrock-AgentCore-Payments-User-Id", - ) - ], - }, - "agentName": { - "target": PAYMENT_AGENT_NAME, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="X-Amzn-Bedrock-AgentCore-Payments-Agent-Name", - ) - ], - }, - "paymentManagerArn": { - "target": PAYMENT_MANAGER_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "paymentSessionId": { - "target": PAYMENT_SESSION_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "paymentInstrumentId": { - "target": PAYMENT_INSTRUMENT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "paymentType": { - "target": PAYMENT_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "paymentInput": { - "target": PAYMENT_INPUT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - }, -) - -CRYPTO_X402_PAYMENT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#CryptoX402PaymentOutput"), - members={ - "version": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "payload": { - "target": PAYMENT_DOCUMENT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -MPP_PAYMENT_CREDENTIAL = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#MppPaymentCredential"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -MPP_PAYMENT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#MppPaymentOutput"), - members={ - "version": { - "target": VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "selectedPaymentId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "paymentCredential": { - "target": MPP_PAYMENT_CREDENTIAL, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -PAYMENT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#PaymentOutput"), - shape_type=ShapeType.UNION, - members={ - "cryptoX402": {"target": CRYPTO_X402_PAYMENT_OUTPUT}, - "mpp": {"target": MPP_PAYMENT_OUTPUT}, - }, -) - -PROCESS_PAYMENT_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#ProcessPaymentId"), - shape_type=ShapeType.STRING, -) - -PAYMENT_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#PaymentStatus"), - shape_type=ShapeType.ENUM, - members={"PROOF_GENERATED": {"target": UNIT}}, -) - -PROCESS_PAYMENT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ProcessPaymentOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#ProcessPaymentResponse", - ) - ], - members={ - "processPaymentId": { - "target": PROCESS_PAYMENT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "paymentManagerArn": { - "target": PAYMENT_MANAGER_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "paymentSessionId": { - "target": PAYMENT_SESSION_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "paymentInstrumentId": { - "target": PAYMENT_INSTRUMENT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "paymentType": { - "target": PAYMENT_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": PAYMENT_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "paymentOutput": { - "target": PAYMENT_OUTPUT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -PROCESS_PAYMENT = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#ProcessPayment"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "POST", "uri": "/payments/processPayment"} - ), - ) - ], -) - -METADATA_FILTER_EXPRESSION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#MetadataFilterExpression"), - shape_type=ShapeType.DOCUMENT, -) - -REGISTRY_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#RegistryIdentifier"), - shape_type=ShapeType.STRING, -) - -REGISTRY_ID_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#RegistryIdList"), - shape_type=ShapeType.LIST, - members={"member": {"target": REGISTRY_IDENTIFIER}}, -) - -SEARCH_REGISTRY_RECORDS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#SearchRegistryRecordsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#SearchRegistryRecordsRequest", - ) - ], - members={ - "searchQuery": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "registryIds": { - "target": REGISTRY_ID_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "maxResults": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=10)], - }, - "filters": {"target": METADATA_FILTER_EXPRESSION}, - }, -) - -DESCRIPTION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#Description"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -CUSTOM_DESCRIPTOR = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#CustomDescriptor"), - members={"inlineContent": {"target": INLINE_CONTENT}}, -) - -SERVER_DEFINITION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ServerDefinition"), - members={ - "schemaVersion": {"target": SCHEMA_VERSION}, - "inlineContent": {"target": INLINE_CONTENT}, - }, -) - -TOOLS_DEFINITION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#ToolsDefinition"), - members={ - "protocolVersion": {"target": SCHEMA_VERSION}, - "inlineContent": {"target": INLINE_CONTENT}, - }, -) - -MCP_DESCRIPTOR = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#McpDescriptor"), - members={ - "server": { - "target": SERVER_DEFINITION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "tools": { - "target": TOOLS_DEFINITION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -DESCRIPTORS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#Descriptors"), - members={ - "mcp": {"target": MCP_DESCRIPTOR}, - "a2a": {"target": A2A_DESCRIPTOR}, - "custom": {"target": CUSTOM_DESCRIPTOR}, - "agentSkills": {"target": AGENT_SKILLS_DESCRIPTOR}, - }, -) - -DESCRIPTOR_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#DescriptorType"), - shape_type=ShapeType.ENUM, - members={ - "MCP": {"target": UNIT}, - "A2A": {"target": UNIT}, - "CUSTOM": {"target": UNIT}, - "AGENT_SKILLS": {"target": UNIT}, - }, -) - -REGISTRY_RECORD_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#RegistryRecordName"), - shape_type=ShapeType.STRING, -) - -REGISTRY_RECORD_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#RegistryRecordArn"), - shape_type=ShapeType.STRING, -) - -REGISTRY_RECORD_ID = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#RegistryRecordId"), - shape_type=ShapeType.STRING, -) - -REGISTRY_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#RegistryArn"), - shape_type=ShapeType.STRING, -) - -REGISTRY_RECORD_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#RegistryRecordStatus"), - shape_type=ShapeType.ENUM, - members={ - "DRAFT": {"target": UNIT}, - "PENDING_APPROVAL": {"target": UNIT}, - "APPROVED": {"target": UNIT}, - "REJECTED": {"target": UNIT}, - "DEPRECATED": {"target": UNIT}, - }, -) - -REGISTRY_RECORD_VERSION = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#RegistryRecordVersion"), - shape_type=ShapeType.STRING, -) - -REGISTRY_RECORD_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#RegistryRecordSummary"), - members={ - "registryArn": { - "target": REGISTRY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "recordArn": { - "target": REGISTRY_RECORD_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "recordId": { - "target": REGISTRY_RECORD_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": REGISTRY_RECORD_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "descriptorType": { - "target": DESCRIPTOR_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "descriptors": { - "target": DESCRIPTORS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "version": { - "target": REGISTRY_RECORD_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": REGISTRY_RECORD_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -REGISTRY_RECORD_SUMMARY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#RegistryRecordSummaryList"), - shape_type=ShapeType.LIST, - members={"member": {"target": REGISTRY_RECORD_SUMMARY}}, -) - -SEARCH_REGISTRY_RECORDS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockagentcore#SearchRegistryRecordsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockagentcore#SearchRegistryRecordsResponse", - ) - ], - members={ - "registryRecords": { - "target": REGISTRY_RECORD_SUMMARY_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -SEARCH_REGISTRY_RECORDS = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#SearchRegistryRecords"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/registry-records/search", "code": 200} - ), - ) - ], -) - -AMAZON_BEDROCK_AGENT_CORE = Schema( - id=ShapeID("com.amazonaws.bedrockagentcore#AmazonBedrockAgentCore"), - shape_type=ShapeType.SERVICE, - traits=[ - Trait.new( - id=ShapeID("aws.auth#sigv4"), - value=MappingProxyType({"name": "bedrock-agentcore"}), - ), - Trait.new( - id=ShapeID("smithy.rules#endpointBdd"), - value=MappingProxyType( - { - "version": "1.1", - "parameters": MappingProxyType( - { - "Region": MappingProxyType( - { - "builtIn": "AWS::Region", - "required": False, - "documentation": "The AWS region used to dispatch the request.", - "type": "string", - } - ), - "UseDualStack": MappingProxyType( - { - "builtIn": "AWS::UseDualStack", - "required": True, - "default": False, - "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", - "type": "boolean", - } - ), - "UseFIPS": MappingProxyType( - { - "builtIn": "AWS::UseFIPS", - "required": True, - "default": False, - "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", - "type": "boolean", - } - ), - "Endpoint": MappingProxyType( - { - "builtIn": "SDK::Endpoint", - "required": False, - "documentation": "Override the endpoint used to send this request", - "type": "string", - } - ), - } - ), - "conditions": ( - MappingProxyType( - { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "Endpoint"}),), - } - ), - MappingProxyType( - { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "Region"}),), - } - ), - MappingProxyType( - { - "fn": "aws.partition", - "argv": (MappingProxyType({"ref": "Region"}),), - "assign": "PartitionResult", - } - ), - MappingProxyType( +AMAZON_BEDROCK_AGENT_CORE: StaticSchema = ( + 21, + n0, + _ABAC, + { + _aw: MappingProxyType({"name": "bedrock-agentcore"}), + _sB: MappingProxyType( + { + "version": "1.1", + "parameters": MappingProxyType( + { + "Region": MappingProxyType( { - "fn": "booleanEquals", - "argv": (MappingProxyType({"ref": "UseFIPS"}), True), + "builtIn": "AWS::Region", + "required": False, + "documentation": "The AWS region used to dispatch the request.", + "type": "string", } ), - MappingProxyType( + "UseDualStack": MappingProxyType( { - "fn": "booleanEquals", - "argv": ( - MappingProxyType({"ref": "UseDualStack"}), - True, - ), + "builtIn": "AWS::UseDualStack", + "required": True, + "default": False, + "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", + "type": "boolean", } ), - MappingProxyType( + "UseFIPS": MappingProxyType( { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "supportsDualStack", - ), - } - ), - True, - ), + "builtIn": "AWS::UseFIPS", + "required": True, + "default": False, + "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", + "type": "boolean", } ), - MappingProxyType( + "Endpoint": MappingProxyType( { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "supportsFIPS", - ), - } - ), - True, - ), + "builtIn": "SDK::Endpoint", + "required": False, + "documentation": "Override the endpoint used to send this request", + "type": "string", } ), + } + ), + "conditions": ( + MappingProxyType( + { + "fn": "isSet", + "argv": (MappingProxyType({"ref": "Endpoint"}),), + } ), - "results": ( - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: FIPS and custom endpoint are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": MappingProxyType({"ref": "Endpoint"}), - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://bedrock-agentcore-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "FIPS and DualStack are enabled, but this partition does not support one or both", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://bedrock-agentcore-fips.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "FIPS is enabled but this partition does not support FIPS", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + MappingProxyType( + {"fn": "isSet", "argv": (MappingProxyType({"ref": "Region"}),)} + ), + MappingProxyType( + { + "fn": "aws.partition", + "argv": (MappingProxyType({"ref": "Region"}),), + "assign": "PartitionResult", + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": (MappingProxyType({"ref": "UseFIPS"}), True), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": (MappingProxyType({"ref": "UseDualStack"}), True), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( { - "url": "https://bedrock-agentcore.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "supportsDualStack", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "DualStack is enabled but this partition does not support DualStack", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + True, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( { - "url": "https://bedrock-agentcore.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "supportsFIPS", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: Missing Region", - "type": "error", - } - ), + True, + ), + } + ), + ), + "results": ( + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: FIPS and custom endpoint are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": MappingProxyType({"ref": "Endpoint"}), + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://bedrock-agentcore-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } ), - "root": 2, - "nodeCount": 13, - "nodes": "/////wAAAAH/////AAAAAAAAAAwAAAADAAAAAQAAAAQF9eELAAAAAgAAAAUF9eELAAAAAwAAAAgAAAAGAAAABAAAAAcF9eEKAAAABQX14QgF9eEJAAAABAAAAAoAAAAJAAAABgX14QYF9eEHAAAABQAAAAsF9eEFAAAABgX14QQF9eEFAAAAAwX14QEAAAANAAAABAX14QIF9eED", - } - ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS and DualStack are enabled, but this partition does not support one or both", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://bedrock-agentcore-fips.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS is enabled but this partition does not support FIPS", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://bedrock-agentcore.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "DualStack is enabled but this partition does not support DualStack", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://bedrock-agentcore.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Missing Region", + "type": "error", + } + ), + ), + "root": 2, + "nodeCount": 13, + "nodes": "/////wAAAAH/////AAAAAAAAAAwAAAADAAAAAQAAAAQF9eELAAAAAgAAAAUF9eELAAAAAwAAAAgAAAAGAAAABAAAAAcF9eEKAAAABQX14QgF9eEJAAAABAAAAAoAAAAJAAAABgX14QYF9eEHAAAABQAAAAsF9eEFAAAABgX14QQF9eEFAAAAAwX14QEAAAANAAAABAX14QIF9eED", + } ), - Trait.new( - id=ShapeID("aws.api#service"), - value=MappingProxyType( - { - "sdkId": "Bedrock AgentCore", - "arnNamespace": "bedrock-agentcore", - "endpointPrefix": "bedrock-agentcore", - } - ), + _aws: MappingProxyType( + { + "sdkId": "Bedrock AgentCore", + "arnNamespace": "bedrock-agentcore", + "endpointPrefix": "bedrock-agentcore", + } ), - Trait.new( - id=ShapeID("aws.protocols#restJson1"), - value=MappingProxyType( - {"http": ("http/1.1",), "eventStreamHttp": ("http/1.1",)} - ), + _aJ: MappingProxyType( + {"http": ("http/1.1",), "eventStreamHttp": ("http/1.1",)} ), - ], + }, ) diff --git a/clients/aws-sdk-bedrock-agentcore/src/aws_sdk_bedrock_agentcore/client.py b/clients/aws-sdk-bedrock-agentcore/src/aws_sdk_bedrock_agentcore/client.py index 46cf32c6..fb78014f 100644 --- a/clients/aws-sdk-bedrock-agentcore/src/aws_sdk_bedrock_agentcore/client.py +++ b/clients/aws-sdk-bedrock-agentcore/src/aws_sdk_bedrock_agentcore/client.py @@ -1,19 +1,21 @@ # Code generated by smithy-python-codegen DO NOT EDIT. +from __future__ import annotations + from copy import deepcopy import logging from typing import Any, cast +from smithy_aws_core.aio.identity.chain import AsyncIdentityChain from smithy_aws_core.config import ConfigSource from smithy_aws_core.identity import AWSCredentialsIdentity -from smithy_aws_core.identity.chain import IdentityChain -from smithy_core.aio.client import AsyncClient, ClientCall, RequestPipeline -from smithy_core.aio.eventstream import OutputEventStream +from smithy_core.aio.client import AsyncClient, AsyncClientCall, AsyncRequestPipeline +from smithy_core.aio.eventstream import AsyncOutputEventStream from smithy_core.deserializers import DeserializeableShape from smithy_core.exceptions import ExpectationNotMetError from smithy_core.schemas import APIOperation from smithy_core.serializers import SerializeableShape -from smithy_http.aio.interfaces import HTTPClient +from smithy_http.aio.interfaces import AsyncHTTPClient from smithy_http.plugins import user_agent_plugin from .config import AsyncBedrockAgentCoreConfig, Plugin @@ -21,28 +23,12 @@ BATCH_CREATE_MEMORY_RECORDS, BATCH_DELETE_MEMORY_RECORDS, BATCH_UPDATE_MEMORY_RECORDS, - BatchCreateMemoryRecordsInput, - BatchCreateMemoryRecordsOutput, - BatchDeleteMemoryRecordsInput, - BatchDeleteMemoryRecordsOutput, - BatchUpdateMemoryRecordsInput, - BatchUpdateMemoryRecordsOutput, COMPLETE_RESOURCE_TOKEN_AUTH, CREATE_AB_TEST, CREATE_EVENT, CREATE_PAYMENT_INSTRUMENT, CREATE_PAYMENT_SESSION, CodeInterpreterStreamOutput, - CompleteResourceTokenAuthInput, - CompleteResourceTokenAuthOutput, - CreateABTestInput, - CreateABTestOutput, - CreateEventInput, - CreateEventOutput, - CreatePaymentInstrumentInput, - CreatePaymentInstrumentOutput, - CreatePaymentSessionInput, - CreatePaymentSessionOutput, DELETE_AB_TEST, DELETE_BATCH_EVALUATION, DELETE_CAPACITY_PROVIDER_SESSION, @@ -51,25 +37,7 @@ DELETE_PAYMENT_INSTRUMENT, DELETE_PAYMENT_SESSION, DELETE_RECOMMENDATION, - DeleteABTestInput, - DeleteABTestOutput, - DeleteBatchEvaluationInput, - DeleteBatchEvaluationOutput, - DeleteCapacityProviderSessionInput, - DeleteCapacityProviderSessionOutput, - DeleteEventInput, - DeleteEventOutput, - DeleteMemoryRecordInput, - DeleteMemoryRecordOutput, - DeletePaymentInstrumentInput, - DeletePaymentInstrumentOutput, - DeletePaymentSessionInput, - DeletePaymentSessionOutput, - DeleteRecommendationInput, - DeleteRecommendationOutput, EVALUATE, - EvaluateInput, - EvaluateOutput, GET_AB_TEST, GET_AGENT_CARD, GET_BATCH_EVALUATION, @@ -87,55 +55,15 @@ GET_WORKLOAD_ACCESS_TOKEN, GET_WORKLOAD_ACCESS_TOKEN_FOR_JWT, GET_WORKLOAD_ACCESS_TOKEN_FOR_USER_ID, - GetABTestInput, - GetABTestOutput, - GetAgentCardInput, - GetAgentCardOutput, - GetBatchEvaluationInput, - GetBatchEvaluationOutput, - GetBrowserSessionInput, - GetBrowserSessionOutput, - GetCodeInterpreterSessionInput, - GetCodeInterpreterSessionOutput, - GetEventInput, - GetEventOutput, - GetMemoryRecordInput, - GetMemoryRecordOutput, - GetPaymentInstrumentBalanceInput, - GetPaymentInstrumentBalanceOutput, - GetPaymentInstrumentInput, - GetPaymentInstrumentOutput, - GetPaymentSessionInput, - GetPaymentSessionOutput, - GetRecommendationInput, - GetRecommendationOutput, - GetResourceApiKeyInput, - GetResourceApiKeyOutput, - GetResourceOauth2TokenInput, - GetResourceOauth2TokenOutput, - GetResourcePaymentTokenInput, - GetResourcePaymentTokenOutput, - GetWorkloadAccessTokenForJWTInput, - GetWorkloadAccessTokenForJWTOutput, - GetWorkloadAccessTokenForUserIdInput, - GetWorkloadAccessTokenForUserIdOutput, - GetWorkloadAccessTokenInput, - GetWorkloadAccessTokenOutput, INGEST_DATA, INVOKE_AGENT_RUNTIME, INVOKE_AGENT_RUNTIME_COMMAND, INVOKE_BROWSER, INVOKE_CODE_INTERPRETER, INVOKE_HARNESS, - IngestDataInput, - IngestDataOutput, InvokeAgentRuntimeCommandInput, InvokeAgentRuntimeCommandOutput, InvokeAgentRuntimeCommandStreamOutput, - InvokeAgentRuntimeInput, - InvokeAgentRuntimeOutput, - InvokeBrowserInput, - InvokeBrowserOutput, InvokeCodeInterpreterInput, InvokeCodeInterpreterOutput, InvokeHarnessInput, @@ -153,36 +81,8 @@ LIST_PAYMENT_SESSIONS, LIST_RECOMMENDATIONS, LIST_SESSIONS, - ListABTestsInput, - ListABTestsOutput, - ListActorsInput, - ListActorsOutput, - ListBatchEvaluationsInput, - ListBatchEvaluationsOutput, - ListBrowserSessionsInput, - ListBrowserSessionsOutput, - ListCodeInterpreterSessionsInput, - ListCodeInterpreterSessionsOutput, - ListEventsInput, - ListEventsOutput, - ListMemoryExtractionJobsInput, - ListMemoryExtractionJobsOutput, - ListMemoryRecordsInput, - ListMemoryRecordsOutput, - ListPaymentInstrumentsInput, - ListPaymentInstrumentsOutput, - ListPaymentSessionsInput, - ListPaymentSessionsOutput, - ListRecommendationsInput, - ListRecommendationsOutput, - ListSessionsInput, - ListSessionsOutput, PROCESS_PAYMENT, - ProcessPaymentInput, - ProcessPaymentOutput, RETRIEVE_MEMORY_RECORDS, - RetrieveMemoryRecordsInput, - RetrieveMemoryRecordsOutput, SAVE_BROWSER_SESSION_PROFILE, SEARCH_REGISTRY_RECORDS, START_BATCH_EVALUATION, @@ -194,40 +94,148 @@ STOP_BROWSER_SESSION, STOP_CODE_INTERPRETER_SESSION, STOP_RUNTIME_SESSION, - SaveBrowserSessionProfileInput, - SaveBrowserSessionProfileOutput, - SearchRegistryRecordsInput, - SearchRegistryRecordsOutput, - StartBatchEvaluationInput, - StartBatchEvaluationOutput, - StartBrowserSessionInput, - StartBrowserSessionOutput, - StartCodeInterpreterSessionInput, - StartCodeInterpreterSessionOutput, - StartMemoryExtractionJobInput, - StartMemoryExtractionJobOutput, - StartRecommendationInput, - StartRecommendationOutput, - StopBatchEvaluationInput, - StopBatchEvaluationOutput, - StopBrowserSessionInput, - StopBrowserSessionOutput, - StopCodeInterpreterSessionInput, - StopCodeInterpreterSessionOutput, - StopRuntimeSessionInput, - StopRuntimeSessionOutput, UPDATE_AB_TEST, UPDATE_BROWSER_STREAM, - UpdateABTestInput, - UpdateABTestOutput, - UpdateBrowserStreamInput, - UpdateBrowserStreamOutput, _CodeInterpreterStreamOutputDeserializer, _InvokeAgentRuntimeCommandStreamOutputDeserializer, _InvokeHarnessStreamOutputDeserializer, ) from .user_agent import aws_user_agent_plugin +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .models import ( + BatchCreateMemoryRecordsInput, + BatchCreateMemoryRecordsOutput, + BatchDeleteMemoryRecordsInput, + BatchDeleteMemoryRecordsOutput, + BatchUpdateMemoryRecordsInput, + BatchUpdateMemoryRecordsOutput, + CompleteResourceTokenAuthInput, + CompleteResourceTokenAuthOutput, + CreateABTestInput, + CreateABTestOutput, + CreateEventInput, + CreateEventOutput, + CreatePaymentInstrumentInput, + CreatePaymentInstrumentOutput, + CreatePaymentSessionInput, + CreatePaymentSessionOutput, + DeleteABTestInput, + DeleteABTestOutput, + DeleteBatchEvaluationInput, + DeleteBatchEvaluationOutput, + DeleteCapacityProviderSessionInput, + DeleteCapacityProviderSessionOutput, + DeleteEventInput, + DeleteEventOutput, + DeleteMemoryRecordInput, + DeleteMemoryRecordOutput, + DeletePaymentInstrumentInput, + DeletePaymentInstrumentOutput, + DeletePaymentSessionInput, + DeletePaymentSessionOutput, + DeleteRecommendationInput, + DeleteRecommendationOutput, + EvaluateInput, + EvaluateOutput, + GetABTestInput, + GetABTestOutput, + GetAgentCardInput, + GetAgentCardOutput, + GetBatchEvaluationInput, + GetBatchEvaluationOutput, + GetBrowserSessionInput, + GetBrowserSessionOutput, + GetCodeInterpreterSessionInput, + GetCodeInterpreterSessionOutput, + GetEventInput, + GetEventOutput, + GetMemoryRecordInput, + GetMemoryRecordOutput, + GetPaymentInstrumentBalanceInput, + GetPaymentInstrumentBalanceOutput, + GetPaymentInstrumentInput, + GetPaymentInstrumentOutput, + GetPaymentSessionInput, + GetPaymentSessionOutput, + GetRecommendationInput, + GetRecommendationOutput, + GetResourceApiKeyInput, + GetResourceApiKeyOutput, + GetResourceOauth2TokenInput, + GetResourceOauth2TokenOutput, + GetResourcePaymentTokenInput, + GetResourcePaymentTokenOutput, + GetWorkloadAccessTokenForJWTInput, + GetWorkloadAccessTokenForJWTOutput, + GetWorkloadAccessTokenForUserIdInput, + GetWorkloadAccessTokenForUserIdOutput, + GetWorkloadAccessTokenInput, + GetWorkloadAccessTokenOutput, + IngestDataInput, + IngestDataOutput, + InvokeAgentRuntimeInput, + InvokeAgentRuntimeOutput, + InvokeBrowserInput, + InvokeBrowserOutput, + ListABTestsInput, + ListABTestsOutput, + ListActorsInput, + ListActorsOutput, + ListBatchEvaluationsInput, + ListBatchEvaluationsOutput, + ListBrowserSessionsInput, + ListBrowserSessionsOutput, + ListCodeInterpreterSessionsInput, + ListCodeInterpreterSessionsOutput, + ListEventsInput, + ListEventsOutput, + ListMemoryExtractionJobsInput, + ListMemoryExtractionJobsOutput, + ListMemoryRecordsInput, + ListMemoryRecordsOutput, + ListPaymentInstrumentsInput, + ListPaymentInstrumentsOutput, + ListPaymentSessionsInput, + ListPaymentSessionsOutput, + ListRecommendationsInput, + ListRecommendationsOutput, + ListSessionsInput, + ListSessionsOutput, + ProcessPaymentInput, + ProcessPaymentOutput, + RetrieveMemoryRecordsInput, + RetrieveMemoryRecordsOutput, + SaveBrowserSessionProfileInput, + SaveBrowserSessionProfileOutput, + SearchRegistryRecordsInput, + SearchRegistryRecordsOutput, + StartBatchEvaluationInput, + StartBatchEvaluationOutput, + StartBrowserSessionInput, + StartBrowserSessionOutput, + StartCodeInterpreterSessionInput, + StartCodeInterpreterSessionOutput, + StartMemoryExtractionJobInput, + StartMemoryExtractionJobOutput, + StartRecommendationInput, + StartRecommendationOutput, + StopBatchEvaluationInput, + StopBatchEvaluationOutput, + StopBrowserSessionInput, + StopBrowserSessionOutput, + StopCodeInterpreterSessionInput, + StopCodeInterpreterSessionOutput, + StopRuntimeSessionInput, + StopRuntimeSessionOutput, + UpdateABTestInput, + UpdateABTestOutput, + UpdateBrowserStreamInput, + UpdateBrowserStreamOutput, + ) + logger = logging.getLogger(__name__) @@ -297,12 +305,12 @@ async def _post_setup(self, config: AsyncBedrockAgentCoreConfig) -> None: config_file = await config_context.parsed_profiles() if config_context.profile_source is ConfigSource.OVERRIDE: profile_name = config_context.profile_name - config.aws_credentials_identity_resolver = await IdentityChain.create( + config.aws_credentials_identity_resolver = await AsyncIdentityChain.create( AWSCredentialsIdentity, config_file=config_file, profile_name=profile_name, region_override=config.region, - http_client=cast(HTTPClient | None, config.transport), + http_client=cast(AsyncHTTPClient | None, config.transport), ) async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( @@ -311,7 +319,7 @@ async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( operation: APIOperation[I, O], default_plugins: list[Plugin], plugins: list[Plugin] | None, - ) -> tuple[RequestPipeline[Any, Any], ClientCall[I, O]]: + ) -> tuple[AsyncRequestPipeline[Any, Any], AsyncClientCall[I, O]]: if self._closed: raise RuntimeError( "Cannot invoke an operation on a client that has been closed." @@ -1267,7 +1275,7 @@ async def invoke_agent_runtime( async def invoke_agent_runtime_command( self, input: InvokeAgentRuntimeCommandInput, plugins: list[Plugin] | None = None - ) -> OutputEventStream[ + ) -> AsyncOutputEventStream[ InvokeAgentRuntimeCommandStreamOutput, InvokeAgentRuntimeCommandOutput ]: """ @@ -1294,7 +1302,7 @@ async def invoke_agent_runtime_command( invocations. Returns: - An `OutputEventStream` for server-to-client streaming. + An `AsyncOutputEventStream` for server-to-client streaming. """ pipeline, call = await self._prepare_call( input, INVOKE_AGENT_RUNTIME_COMMAND, [], plugins @@ -1344,7 +1352,9 @@ async def invoke_browser( async def invoke_code_interpreter( self, input: InvokeCodeInterpreterInput, plugins: list[Plugin] | None = None - ) -> OutputEventStream[CodeInterpreterStreamOutput, InvokeCodeInterpreterOutput]: + ) -> AsyncOutputEventStream[ + CodeInterpreterStreamOutput, InvokeCodeInterpreterOutput + ]: """ Executes code within an active code interpreter session in Amazon Bedrock AgentCore. This operation processes the provided code, runs it @@ -1375,7 +1385,7 @@ async def invoke_code_interpreter( invocations. Returns: - An `OutputEventStream` for server-to-client streaming. + An `AsyncOutputEventStream` for server-to-client streaming. """ pipeline, call = await self._prepare_call( input, INVOKE_CODE_INTERPRETER, [], plugins @@ -1388,7 +1398,7 @@ async def invoke_code_interpreter( async def invoke_harness( self, input: InvokeHarnessInput, plugins: list[Plugin] | None = None - ) -> OutputEventStream[InvokeHarnessStreamOutput, InvokeHarnessOutput]: + ) -> AsyncOutputEventStream[InvokeHarnessStreamOutput, InvokeHarnessOutput]: """ Operation to invoke a Harness. @@ -1402,7 +1412,7 @@ async def invoke_harness( invocations. Returns: - An `OutputEventStream` for server-to-client streaming. + An `AsyncOutputEventStream` for server-to-client streaming. """ pipeline, call = await self._prepare_call(input, INVOKE_HARNESS, [], plugins) return await pipeline.output_stream( diff --git a/clients/aws-sdk-bedrock-agentcore/src/aws_sdk_bedrock_agentcore/config.py b/clients/aws-sdk-bedrock-agentcore/src/aws_sdk_bedrock_agentcore/config.py index 6f5037c9..909cf059 100644 --- a/clients/aws-sdk-bedrock-agentcore/src/aws_sdk_bedrock_agentcore/config.py +++ b/clients/aws-sdk-bedrock-agentcore/src/aws_sdk_bedrock_agentcore/config.py @@ -1,288 +1,327 @@ # Code generated by smithy-python-codegen DO NOT EDIT. from dataclasses import dataclass, field -from typing import Any, Callable, ClassVar, Self, TypeAlias, Union, Unpack +from typing import ( + Any, + Callable, + ClassVar, + Self, + TYPE_CHECKING, + TypeAlias, + Union, + Unpack, +) -from smithy_aws_core.aio.protocols import RestJsonClientProtocol -from smithy_aws_core.auth import SigV4AuthScheme -from smithy_aws_core.config import AwsConfigOverrides, FileSystem -from smithy_aws_core.config.aws_config import AsyncAwsConfig -from smithy_aws_core.config.resolvers import EndpointUriResolver -from smithy_aws_core.config.types import FieldSpec -from smithy_aws_core.endpoints.standard_regional import ( - StandardRegionalEndpointsResolver, +from smithy_aws_core.aio.auth.sigv4 import AsyncSigV4AuthScheme +from smithy_aws_core.aio.config import AsyncFileSystem +from smithy_aws_core.aio.config.aws_config import AsyncAwsConfig, AwsConfigOverrides +from smithy_aws_core.aio.config.resolvers import EndpointUriResolver +from smithy_aws_core.aio.endpoints.standard_regional import ( + AsyncStandardRegionalEndpointsResolver, ) +from smithy_aws_core.aio.protocols import AsyncRestJsonClientProtocol +from smithy_aws_core.config.types import FieldSpec from smithy_aws_core.identity import AWSCredentialsIdentity, AWSIdentityProperties -from smithy_core.aio.interfaces import ( - ClientProtocol, - EndpointResolver, - ProtocolConstructor, - ProtocolSettings, -) -from smithy_core.aio.interfaces.auth import AuthScheme -from smithy_core.aio.interfaces.identity import IdentityResolver -from smithy_core.interceptors import Interceptor +from smithy_core.aio.interfaces import AsyncClientProtocol, AsyncEndpointResolver +from smithy_core.aio.interfaces.auth import AsyncAuthScheme +from smithy_core.aio.interfaces.identity import AsyncIdentityResolver +from smithy_core.interfaces import ProtocolConstructor, ProtocolSettings from smithy_core.interfaces.auth import AuthSchemeResolver from smithy_core.shapes import ShapeID from smithy_http.aio.aiohttp import AIOHTTPClient +from ._private.schemas import AMAZON_BEDROCK_AGENT_CORE from .auth import HTTPAuthSchemeResolver -from .models import ( - BatchCreateMemoryRecordsInput, - BatchCreateMemoryRecordsOutput, - BatchDeleteMemoryRecordsInput, - BatchDeleteMemoryRecordsOutput, - BatchUpdateMemoryRecordsInput, - BatchUpdateMemoryRecordsOutput, - CompleteResourceTokenAuthInput, - CompleteResourceTokenAuthOutput, - CreateABTestInput, - CreateABTestOutput, - CreateEventInput, - CreateEventOutput, - CreatePaymentInstrumentInput, - CreatePaymentInstrumentOutput, - CreatePaymentSessionInput, - CreatePaymentSessionOutput, - DeleteABTestInput, - DeleteABTestOutput, - DeleteBatchEvaluationInput, - DeleteBatchEvaluationOutput, - DeleteCapacityProviderSessionInput, - DeleteCapacityProviderSessionOutput, - DeleteEventInput, - DeleteEventOutput, - DeleteMemoryRecordInput, - DeleteMemoryRecordOutput, - DeletePaymentInstrumentInput, - DeletePaymentInstrumentOutput, - DeletePaymentSessionInput, - DeletePaymentSessionOutput, - DeleteRecommendationInput, - DeleteRecommendationOutput, - EvaluateInput, - EvaluateOutput, - GetABTestInput, - GetABTestOutput, - GetAgentCardInput, - GetAgentCardOutput, - GetBatchEvaluationInput, - GetBatchEvaluationOutput, - GetBrowserSessionInput, - GetBrowserSessionOutput, - GetCodeInterpreterSessionInput, - GetCodeInterpreterSessionOutput, - GetEventInput, - GetEventOutput, - GetMemoryRecordInput, - GetMemoryRecordOutput, - GetPaymentInstrumentBalanceInput, - GetPaymentInstrumentBalanceOutput, - GetPaymentInstrumentInput, - GetPaymentInstrumentOutput, - GetPaymentSessionInput, - GetPaymentSessionOutput, - GetRecommendationInput, - GetRecommendationOutput, - GetResourceApiKeyInput, - GetResourceApiKeyOutput, - GetResourceOauth2TokenInput, - GetResourceOauth2TokenOutput, - GetResourcePaymentTokenInput, - GetResourcePaymentTokenOutput, - GetWorkloadAccessTokenForJWTInput, - GetWorkloadAccessTokenForJWTOutput, - GetWorkloadAccessTokenForUserIdInput, - GetWorkloadAccessTokenForUserIdOutput, - GetWorkloadAccessTokenInput, - GetWorkloadAccessTokenOutput, - IngestDataInput, - IngestDataOutput, - InvokeAgentRuntimeCommandInput, - InvokeAgentRuntimeCommandOutput, - InvokeAgentRuntimeInput, - InvokeAgentRuntimeOutput, - InvokeBrowserInput, - InvokeBrowserOutput, - InvokeCodeInterpreterInput, - InvokeCodeInterpreterOutput, - InvokeHarnessInput, - InvokeHarnessOutput, - ListABTestsInput, - ListABTestsOutput, - ListActorsInput, - ListActorsOutput, - ListBatchEvaluationsInput, - ListBatchEvaluationsOutput, - ListBrowserSessionsInput, - ListBrowserSessionsOutput, - ListCodeInterpreterSessionsInput, - ListCodeInterpreterSessionsOutput, - ListEventsInput, - ListEventsOutput, - ListMemoryExtractionJobsInput, - ListMemoryExtractionJobsOutput, - ListMemoryRecordsInput, - ListMemoryRecordsOutput, - ListPaymentInstrumentsInput, - ListPaymentInstrumentsOutput, - ListPaymentSessionsInput, - ListPaymentSessionsOutput, - ListRecommendationsInput, - ListRecommendationsOutput, - ListSessionsInput, - ListSessionsOutput, - ProcessPaymentInput, - ProcessPaymentOutput, - RetrieveMemoryRecordsInput, - RetrieveMemoryRecordsOutput, - SaveBrowserSessionProfileInput, - SaveBrowserSessionProfileOutput, - SearchRegistryRecordsInput, - SearchRegistryRecordsOutput, - StartBatchEvaluationInput, - StartBatchEvaluationOutput, - StartBrowserSessionInput, - StartBrowserSessionOutput, - StartCodeInterpreterSessionInput, - StartCodeInterpreterSessionOutput, - StartMemoryExtractionJobInput, - StartMemoryExtractionJobOutput, - StartRecommendationInput, - StartRecommendationOutput, - StopBatchEvaluationInput, - StopBatchEvaluationOutput, - StopBrowserSessionInput, - StopBrowserSessionOutput, - StopCodeInterpreterSessionInput, - StopCodeInterpreterSessionOutput, - StopRuntimeSessionInput, - StopRuntimeSessionOutput, - UpdateABTestInput, - UpdateABTestOutput, - UpdateBrowserStreamInput, - UpdateBrowserStreamOutput, -) -_ServiceInterceptor = Union[ - Interceptor[ - BatchCreateMemoryRecordsInput, BatchCreateMemoryRecordsOutput, Any, Any - ], - Interceptor[ - BatchDeleteMemoryRecordsInput, BatchDeleteMemoryRecordsOutput, Any, Any - ], - Interceptor[ - BatchUpdateMemoryRecordsInput, BatchUpdateMemoryRecordsOutput, Any, Any - ], - Interceptor[ - CompleteResourceTokenAuthInput, CompleteResourceTokenAuthOutput, Any, Any - ], - Interceptor[CreateABTestInput, CreateABTestOutput, Any, Any], - Interceptor[CreateEventInput, CreateEventOutput, Any, Any], - Interceptor[CreatePaymentInstrumentInput, CreatePaymentInstrumentOutput, Any, Any], - Interceptor[CreatePaymentSessionInput, CreatePaymentSessionOutput, Any, Any], - Interceptor[DeleteABTestInput, DeleteABTestOutput, Any, Any], - Interceptor[DeleteBatchEvaluationInput, DeleteBatchEvaluationOutput, Any, Any], - Interceptor[ +if TYPE_CHECKING: + from smithy_core.interceptors import Interceptor + from .models import ( + BatchCreateMemoryRecordsInput, + BatchCreateMemoryRecordsOutput, + BatchDeleteMemoryRecordsInput, + BatchDeleteMemoryRecordsOutput, + BatchUpdateMemoryRecordsInput, + BatchUpdateMemoryRecordsOutput, + CompleteResourceTokenAuthInput, + CompleteResourceTokenAuthOutput, + CreateABTestInput, + CreateABTestOutput, + CreateEventInput, + CreateEventOutput, + CreatePaymentInstrumentInput, + CreatePaymentInstrumentOutput, + CreatePaymentSessionInput, + CreatePaymentSessionOutput, + DeleteABTestInput, + DeleteABTestOutput, + DeleteBatchEvaluationInput, + DeleteBatchEvaluationOutput, DeleteCapacityProviderSessionInput, DeleteCapacityProviderSessionOutput, - Any, - Any, - ], - Interceptor[DeleteEventInput, DeleteEventOutput, Any, Any], - Interceptor[DeleteMemoryRecordInput, DeleteMemoryRecordOutput, Any, Any], - Interceptor[DeletePaymentInstrumentInput, DeletePaymentInstrumentOutput, Any, Any], - Interceptor[DeletePaymentSessionInput, DeletePaymentSessionOutput, Any, Any], - Interceptor[DeleteRecommendationInput, DeleteRecommendationOutput, Any, Any], - Interceptor[EvaluateInput, EvaluateOutput, Any, Any], - Interceptor[GetABTestInput, GetABTestOutput, Any, Any], - Interceptor[GetAgentCardInput, GetAgentCardOutput, Any, Any], - Interceptor[GetBatchEvaluationInput, GetBatchEvaluationOutput, Any, Any], - Interceptor[GetBrowserSessionInput, GetBrowserSessionOutput, Any, Any], - Interceptor[ - GetCodeInterpreterSessionInput, GetCodeInterpreterSessionOutput, Any, Any - ], - Interceptor[GetEventInput, GetEventOutput, Any, Any], - Interceptor[GetMemoryRecordInput, GetMemoryRecordOutput, Any, Any], - Interceptor[GetPaymentInstrumentInput, GetPaymentInstrumentOutput, Any, Any], - Interceptor[ - GetPaymentInstrumentBalanceInput, GetPaymentInstrumentBalanceOutput, Any, Any - ], - Interceptor[GetPaymentSessionInput, GetPaymentSessionOutput, Any, Any], - Interceptor[GetRecommendationInput, GetRecommendationOutput, Any, Any], - Interceptor[GetResourceApiKeyInput, GetResourceApiKeyOutput, Any, Any], - Interceptor[GetResourceOauth2TokenInput, GetResourceOauth2TokenOutput, Any, Any], - Interceptor[GetResourcePaymentTokenInput, GetResourcePaymentTokenOutput, Any, Any], - Interceptor[GetWorkloadAccessTokenInput, GetWorkloadAccessTokenOutput, Any, Any], - Interceptor[ - GetWorkloadAccessTokenForJWTInput, GetWorkloadAccessTokenForJWTOutput, Any, Any - ], - Interceptor[ + DeleteEventInput, + DeleteEventOutput, + DeleteMemoryRecordInput, + DeleteMemoryRecordOutput, + DeletePaymentInstrumentInput, + DeletePaymentInstrumentOutput, + DeletePaymentSessionInput, + DeletePaymentSessionOutput, + DeleteRecommendationInput, + DeleteRecommendationOutput, + EvaluateInput, + EvaluateOutput, + GetABTestInput, + GetABTestOutput, + GetAgentCardInput, + GetAgentCardOutput, + GetBatchEvaluationInput, + GetBatchEvaluationOutput, + GetBrowserSessionInput, + GetBrowserSessionOutput, + GetCodeInterpreterSessionInput, + GetCodeInterpreterSessionOutput, + GetEventInput, + GetEventOutput, + GetMemoryRecordInput, + GetMemoryRecordOutput, + GetPaymentInstrumentBalanceInput, + GetPaymentInstrumentBalanceOutput, + GetPaymentInstrumentInput, + GetPaymentInstrumentOutput, + GetPaymentSessionInput, + GetPaymentSessionOutput, + GetRecommendationInput, + GetRecommendationOutput, + GetResourceApiKeyInput, + GetResourceApiKeyOutput, + GetResourceOauth2TokenInput, + GetResourceOauth2TokenOutput, + GetResourcePaymentTokenInput, + GetResourcePaymentTokenOutput, + GetWorkloadAccessTokenForJWTInput, + GetWorkloadAccessTokenForJWTOutput, GetWorkloadAccessTokenForUserIdInput, GetWorkloadAccessTokenForUserIdOutput, - Any, - Any, - ], - Interceptor[IngestDataInput, IngestDataOutput, Any, Any], - Interceptor[InvokeAgentRuntimeInput, InvokeAgentRuntimeOutput, Any, Any], - Interceptor[ - InvokeAgentRuntimeCommandInput, InvokeAgentRuntimeCommandOutput, Any, Any - ], - Interceptor[InvokeBrowserInput, InvokeBrowserOutput, Any, Any], - Interceptor[InvokeCodeInterpreterInput, InvokeCodeInterpreterOutput, Any, Any], - Interceptor[InvokeHarnessInput, InvokeHarnessOutput, Any, Any], - Interceptor[ListABTestsInput, ListABTestsOutput, Any, Any], - Interceptor[ListActorsInput, ListActorsOutput, Any, Any], - Interceptor[ListBatchEvaluationsInput, ListBatchEvaluationsOutput, Any, Any], - Interceptor[ListBrowserSessionsInput, ListBrowserSessionsOutput, Any, Any], - Interceptor[ - ListCodeInterpreterSessionsInput, ListCodeInterpreterSessionsOutput, Any, Any - ], - Interceptor[ListEventsInput, ListEventsOutput, Any, Any], - Interceptor[ - ListMemoryExtractionJobsInput, ListMemoryExtractionJobsOutput, Any, Any - ], - Interceptor[ListMemoryRecordsInput, ListMemoryRecordsOutput, Any, Any], - Interceptor[ListPaymentInstrumentsInput, ListPaymentInstrumentsOutput, Any, Any], - Interceptor[ListPaymentSessionsInput, ListPaymentSessionsOutput, Any, Any], - Interceptor[ListRecommendationsInput, ListRecommendationsOutput, Any, Any], - Interceptor[ListSessionsInput, ListSessionsOutput, Any, Any], - Interceptor[ProcessPaymentInput, ProcessPaymentOutput, Any, Any], - Interceptor[RetrieveMemoryRecordsInput, RetrieveMemoryRecordsOutput, Any, Any], - Interceptor[ - SaveBrowserSessionProfileInput, SaveBrowserSessionProfileOutput, Any, Any - ], - Interceptor[SearchRegistryRecordsInput, SearchRegistryRecordsOutput, Any, Any], - Interceptor[StartBatchEvaluationInput, StartBatchEvaluationOutput, Any, Any], - Interceptor[StartBrowserSessionInput, StartBrowserSessionOutput, Any, Any], - Interceptor[ - StartCodeInterpreterSessionInput, StartCodeInterpreterSessionOutput, Any, Any - ], - Interceptor[ - StartMemoryExtractionJobInput, StartMemoryExtractionJobOutput, Any, Any - ], - Interceptor[StartRecommendationInput, StartRecommendationOutput, Any, Any], - Interceptor[StopBatchEvaluationInput, StopBatchEvaluationOutput, Any, Any], - Interceptor[StopBrowserSessionInput, StopBrowserSessionOutput, Any, Any], - Interceptor[ - StopCodeInterpreterSessionInput, StopCodeInterpreterSessionOutput, Any, Any - ], - Interceptor[StopRuntimeSessionInput, StopRuntimeSessionOutput, Any, Any], - Interceptor[UpdateABTestInput, UpdateABTestOutput, Any, Any], - Interceptor[UpdateBrowserStreamInput, UpdateBrowserStreamOutput, Any, Any], -] + GetWorkloadAccessTokenInput, + GetWorkloadAccessTokenOutput, + IngestDataInput, + IngestDataOutput, + InvokeAgentRuntimeCommandInput, + InvokeAgentRuntimeCommandOutput, + InvokeAgentRuntimeInput, + InvokeAgentRuntimeOutput, + InvokeBrowserInput, + InvokeBrowserOutput, + InvokeCodeInterpreterInput, + InvokeCodeInterpreterOutput, + InvokeHarnessInput, + InvokeHarnessOutput, + ListABTestsInput, + ListABTestsOutput, + ListActorsInput, + ListActorsOutput, + ListBatchEvaluationsInput, + ListBatchEvaluationsOutput, + ListBrowserSessionsInput, + ListBrowserSessionsOutput, + ListCodeInterpreterSessionsInput, + ListCodeInterpreterSessionsOutput, + ListEventsInput, + ListEventsOutput, + ListMemoryExtractionJobsInput, + ListMemoryExtractionJobsOutput, + ListMemoryRecordsInput, + ListMemoryRecordsOutput, + ListPaymentInstrumentsInput, + ListPaymentInstrumentsOutput, + ListPaymentSessionsInput, + ListPaymentSessionsOutput, + ListRecommendationsInput, + ListRecommendationsOutput, + ListSessionsInput, + ListSessionsOutput, + ProcessPaymentInput, + ProcessPaymentOutput, + RetrieveMemoryRecordsInput, + RetrieveMemoryRecordsOutput, + SaveBrowserSessionProfileInput, + SaveBrowserSessionProfileOutput, + SearchRegistryRecordsInput, + SearchRegistryRecordsOutput, + StartBatchEvaluationInput, + StartBatchEvaluationOutput, + StartBrowserSessionInput, + StartBrowserSessionOutput, + StartCodeInterpreterSessionInput, + StartCodeInterpreterSessionOutput, + StartMemoryExtractionJobInput, + StartMemoryExtractionJobOutput, + StartRecommendationInput, + StartRecommendationOutput, + StopBatchEvaluationInput, + StopBatchEvaluationOutput, + StopBrowserSessionInput, + StopBrowserSessionOutput, + StopCodeInterpreterSessionInput, + StopCodeInterpreterSessionOutput, + StopRuntimeSessionInput, + StopRuntimeSessionOutput, + UpdateABTestInput, + UpdateABTestOutput, + UpdateBrowserStreamInput, + UpdateBrowserStreamOutput, + ) + + _ServiceInterceptor = Union[ + Interceptor[ + BatchCreateMemoryRecordsInput, BatchCreateMemoryRecordsOutput, Any, Any + ], + Interceptor[ + BatchDeleteMemoryRecordsInput, BatchDeleteMemoryRecordsOutput, Any, Any + ], + Interceptor[ + BatchUpdateMemoryRecordsInput, BatchUpdateMemoryRecordsOutput, Any, Any + ], + Interceptor[ + CompleteResourceTokenAuthInput, CompleteResourceTokenAuthOutput, Any, Any + ], + Interceptor[CreateABTestInput, CreateABTestOutput, Any, Any], + Interceptor[CreateEventInput, CreateEventOutput, Any, Any], + Interceptor[ + CreatePaymentInstrumentInput, CreatePaymentInstrumentOutput, Any, Any + ], + Interceptor[CreatePaymentSessionInput, CreatePaymentSessionOutput, Any, Any], + Interceptor[DeleteABTestInput, DeleteABTestOutput, Any, Any], + Interceptor[DeleteBatchEvaluationInput, DeleteBatchEvaluationOutput, Any, Any], + Interceptor[ + DeleteCapacityProviderSessionInput, + DeleteCapacityProviderSessionOutput, + Any, + Any, + ], + Interceptor[DeleteEventInput, DeleteEventOutput, Any, Any], + Interceptor[DeleteMemoryRecordInput, DeleteMemoryRecordOutput, Any, Any], + Interceptor[ + DeletePaymentInstrumentInput, DeletePaymentInstrumentOutput, Any, Any + ], + Interceptor[DeletePaymentSessionInput, DeletePaymentSessionOutput, Any, Any], + Interceptor[DeleteRecommendationInput, DeleteRecommendationOutput, Any, Any], + Interceptor[EvaluateInput, EvaluateOutput, Any, Any], + Interceptor[GetABTestInput, GetABTestOutput, Any, Any], + Interceptor[GetAgentCardInput, GetAgentCardOutput, Any, Any], + Interceptor[GetBatchEvaluationInput, GetBatchEvaluationOutput, Any, Any], + Interceptor[GetBrowserSessionInput, GetBrowserSessionOutput, Any, Any], + Interceptor[ + GetCodeInterpreterSessionInput, GetCodeInterpreterSessionOutput, Any, Any + ], + Interceptor[GetEventInput, GetEventOutput, Any, Any], + Interceptor[GetMemoryRecordInput, GetMemoryRecordOutput, Any, Any], + Interceptor[GetPaymentInstrumentInput, GetPaymentInstrumentOutput, Any, Any], + Interceptor[ + GetPaymentInstrumentBalanceInput, + GetPaymentInstrumentBalanceOutput, + Any, + Any, + ], + Interceptor[GetPaymentSessionInput, GetPaymentSessionOutput, Any, Any], + Interceptor[GetRecommendationInput, GetRecommendationOutput, Any, Any], + Interceptor[GetResourceApiKeyInput, GetResourceApiKeyOutput, Any, Any], + Interceptor[ + GetResourceOauth2TokenInput, GetResourceOauth2TokenOutput, Any, Any + ], + Interceptor[ + GetResourcePaymentTokenInput, GetResourcePaymentTokenOutput, Any, Any + ], + Interceptor[ + GetWorkloadAccessTokenInput, GetWorkloadAccessTokenOutput, Any, Any + ], + Interceptor[ + GetWorkloadAccessTokenForJWTInput, + GetWorkloadAccessTokenForJWTOutput, + Any, + Any, + ], + Interceptor[ + GetWorkloadAccessTokenForUserIdInput, + GetWorkloadAccessTokenForUserIdOutput, + Any, + Any, + ], + Interceptor[IngestDataInput, IngestDataOutput, Any, Any], + Interceptor[InvokeAgentRuntimeInput, InvokeAgentRuntimeOutput, Any, Any], + Interceptor[ + InvokeAgentRuntimeCommandInput, InvokeAgentRuntimeCommandOutput, Any, Any + ], + Interceptor[InvokeBrowserInput, InvokeBrowserOutput, Any, Any], + Interceptor[InvokeCodeInterpreterInput, InvokeCodeInterpreterOutput, Any, Any], + Interceptor[InvokeHarnessInput, InvokeHarnessOutput, Any, Any], + Interceptor[ListABTestsInput, ListABTestsOutput, Any, Any], + Interceptor[ListActorsInput, ListActorsOutput, Any, Any], + Interceptor[ListBatchEvaluationsInput, ListBatchEvaluationsOutput, Any, Any], + Interceptor[ListBrowserSessionsInput, ListBrowserSessionsOutput, Any, Any], + Interceptor[ + ListCodeInterpreterSessionsInput, + ListCodeInterpreterSessionsOutput, + Any, + Any, + ], + Interceptor[ListEventsInput, ListEventsOutput, Any, Any], + Interceptor[ + ListMemoryExtractionJobsInput, ListMemoryExtractionJobsOutput, Any, Any + ], + Interceptor[ListMemoryRecordsInput, ListMemoryRecordsOutput, Any, Any], + Interceptor[ + ListPaymentInstrumentsInput, ListPaymentInstrumentsOutput, Any, Any + ], + Interceptor[ListPaymentSessionsInput, ListPaymentSessionsOutput, Any, Any], + Interceptor[ListRecommendationsInput, ListRecommendationsOutput, Any, Any], + Interceptor[ListSessionsInput, ListSessionsOutput, Any, Any], + Interceptor[ProcessPaymentInput, ProcessPaymentOutput, Any, Any], + Interceptor[RetrieveMemoryRecordsInput, RetrieveMemoryRecordsOutput, Any, Any], + Interceptor[ + SaveBrowserSessionProfileInput, SaveBrowserSessionProfileOutput, Any, Any + ], + Interceptor[SearchRegistryRecordsInput, SearchRegistryRecordsOutput, Any, Any], + Interceptor[StartBatchEvaluationInput, StartBatchEvaluationOutput, Any, Any], + Interceptor[StartBrowserSessionInput, StartBrowserSessionOutput, Any, Any], + Interceptor[ + StartCodeInterpreterSessionInput, + StartCodeInterpreterSessionOutput, + Any, + Any, + ], + Interceptor[ + StartMemoryExtractionJobInput, StartMemoryExtractionJobOutput, Any, Any + ], + Interceptor[StartRecommendationInput, StartRecommendationOutput, Any, Any], + Interceptor[StopBatchEvaluationInput, StopBatchEvaluationOutput, Any, Any], + Interceptor[StopBrowserSessionInput, StopBrowserSessionOutput, Any, Any], + Interceptor[ + StopCodeInterpreterSessionInput, StopCodeInterpreterSessionOutput, Any, Any + ], + Interceptor[StopRuntimeSessionInput, StopRuntimeSessionOutput, Any, Any], + Interceptor[UpdateABTestInput, UpdateABTestOutput, Any, Any], + Interceptor[UpdateBrowserStreamInput, UpdateBrowserStreamOutput, Any, Any], + ] +else: + _ServiceInterceptor = Any + _PROTOCOL_SETTINGS = ProtocolSettings( - namespace="com.amazonaws.bedrockagentcore", service_target="AmazonBedrockAgentCore" + namespace="com.amazonaws.bedrockagentcore", + service_target="AmazonBedrockAgentCore", + service_schema=AMAZON_BEDROCK_AGENT_CORE, ) class _AsyncBedrockAgentCoreConfigOverrides(AwsConfigOverrides, total=False): - endpoint_resolver: EndpointResolver | None + endpoint_resolver: AsyncEndpointResolver | None protocol: ( - ClientProtocol[Any, Any] | ProtocolConstructor[ClientProtocol[Any, Any]] | None + AsyncClientProtocol[Any, Any] + | ProtocolConstructor[AsyncClientProtocol[Any, Any]] + | None ) - auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None + auth_schemes: dict[ShapeID, AsyncAuthScheme[Any, Any, Any, Any]] | None auth_scheme_resolver: AuthSchemeResolver | None @@ -290,17 +329,17 @@ class _AsyncBedrockAgentCoreConfigOverrides(AwsConfigOverrides, total=False): class AsyncBedrockAgentCoreConfig(AsyncAwsConfig): """Bedrock AgentCore configuration (async-resolved).""" - endpoint_resolver: EndpointResolver | None = None + endpoint_resolver: AsyncEndpointResolver | None = None """ The endpoint resolver used to resolve the final endpoint per-operation based on the configuration. """ - protocol: ClientProtocol[Any, Any] | None = None + protocol: AsyncClientProtocol[Any, Any] | None = None """ Pass a protocol class reference from smithy_aws_core.aio.protocols to - select the protocol, e.g. protocol=AwsJson10ClientProtocol. For custom - protocols a protocol instance may also be passed. + select the protocol, e.g. protocol=AsyncAwsJson10ClientProtocol. For + custom protocols a protocol instance may also be passed. """ interceptors: list[_ServiceInterceptor] = field(default_factory=lambda: []) @@ -309,7 +348,7 @@ class AsyncBedrockAgentCoreConfig(AsyncAwsConfig): execution of a request. """ - auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None = None + auth_schemes: dict[ShapeID, AsyncAuthScheme[Any, Any, Any, Any]] | None = None """A map of auth scheme ids to auth schemes.""" auth_scheme_resolver: AuthSchemeResolver | None = None @@ -319,7 +358,7 @@ class AsyncBedrockAgentCoreConfig(AsyncAwsConfig): """ aws_credentials_identity_resolver: ( - IdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None + AsyncIdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None ) = None """Resolves AWS Credentials. Required for operations that use Sigv4 Auth.""" @@ -360,24 +399,26 @@ class AsyncBedrockAgentCoreConfig(AsyncAwsConfig): default=None, resolver=EndpointUriResolver("bedrock_agentcore") ), "endpoint_resolver": FieldSpec( - default_factory=lambda: StandardRegionalEndpointsResolver( + default_factory=lambda: AsyncStandardRegionalEndpointsResolver( endpoint_prefix="bedrock-agentcore" ) ), "protocol": FieldSpec( - default_factory=lambda: RestJsonClientProtocol(_PROTOCOL_SETTINGS), + default_factory=lambda: AsyncRestJsonClientProtocol(_PROTOCOL_SETTINGS), converter=lambda p: p(_PROTOCOL_SETTINGS) if isinstance(p, type) else p, ), "auth_schemes": FieldSpec( default_factory=lambda: { - ShapeID("aws.auth#sigv4"): SigV4AuthScheme(service="bedrock-agentcore") + ShapeID("aws.auth#sigv4"): AsyncSigV4AuthScheme( + service="bedrock-agentcore" + ) } ), "auth_scheme_resolver": FieldSpec(default_factory=HTTPAuthSchemeResolver), "transport": FieldSpec(default_factory=lambda: AIOHTTPClient()), } - def set_auth_scheme(self, scheme: AuthScheme[Any, Any, Any, Any]) -> None: + def set_auth_scheme(self, scheme: AsyncAuthScheme[Any, Any, Any, Any]) -> None: """ Set an auth scheme implementation using its scheme ID. :param scheme: The auth scheme to add or replace. @@ -391,7 +432,7 @@ async def resolve( # pyright: ignore[reportIncompatibleMethodOverride] cls, *, profile: str | None = None, - fs: FileSystem | None = None, + fs: AsyncFileSystem | None = None, config_file_path: str | None = None, credentials_file_path: str | None = None, **overrides: Unpack[_AsyncBedrockAgentCoreConfigOverrides], diff --git a/clients/aws-sdk-bedrock-agentcore/src/aws_sdk_bedrock_agentcore/models.py b/clients/aws-sdk-bedrock-agentcore/src/aws_sdk_bedrock_agentcore/models.py index e5c0dba3..4d53c1d8 100644 --- a/clients/aws-sdk-bedrock-agentcore/src/aws_sdk_bedrock_agentcore/models.py +++ b/clients/aws-sdk-bedrock-agentcore/src/aws_sdk_bedrock_agentcore/models.py @@ -1,503 +1,222 @@ # Code generated by smithy-python-codegen DO NOT EDIT. -from base64 import b64decode -from dataclasses import dataclass, field -from datetime import datetime, timezone -from enum import StrEnum -import logging -from typing import Any, Literal, Self, Union +from __future__ import annotations -from smithy_core.aio.interfaces import StreamingBlob -from smithy_core.deserializers import ShapeDeserializer -from smithy_core.documents import Document, TypeRegistry -from smithy_core.exceptions import ModeledError, SerializationError -from smithy_core.prelude import UNIT as _SCHEMA_UNIT -from smithy_core.response import EMPTY_RESPONSE_METADATA, ResponseMetadata -from smithy_core.schemas import APIOperation, Schema -from smithy_core.serializers import ShapeSerializer +from ._private import schemas as _schemas +from smithy_core._dynamic_models import ModelRegistry +from smithy_core.exceptions import ModeledError +from smithy_core.schemas import APIOperation from smithy_core.shapes import ShapeID -from smithy_core.types import UnknownEnumMixin from ._private.schemas import ( - A2A_DESCRIPTOR as _SCHEMA_A2A_DESCRIPTOR, - AB_TEST_EVALUATION_CONFIG as _SCHEMA_AB_TEST_EVALUATION_CONFIG, - AB_TEST_RESULTS as _SCHEMA_AB_TEST_RESULTS, - AB_TEST_SUMMARY as _SCHEMA_AB_TEST_SUMMARY, - ACCESS_DENIED_EXCEPTION as _SCHEMA_ACCESS_DENIED_EXCEPTION, - ACTOR_SUMMARY as _SCHEMA_ACTOR_SUMMARY, - AFFECTED_SESSION as _SCHEMA_AFFECTED_SESSION, - AGENT_CARD_DEFINITION as _SCHEMA_AGENT_CARD_DEFINITION, - AGENT_SKILLS_DESCRIPTOR as _SCHEMA_AGENT_SKILLS_DESCRIPTOR, - AGENT_TRACES_CONFIG as _SCHEMA_AGENT_TRACES_CONFIG, - AMOUNT as _SCHEMA_AMOUNT, - AUTOMATION_STREAM as _SCHEMA_AUTOMATION_STREAM, - AUTOMATION_STREAM_UPDATE as _SCHEMA_AUTOMATION_STREAM_UPDATE, - AVAILABLE_LIMITS as _SCHEMA_AVAILABLE_LIMITS, - BASIC_AUTH as _SCHEMA_BASIC_AUTH, BATCH_CREATE_MEMORY_RECORDS as _SCHEMA_BATCH_CREATE_MEMORY_RECORDS, - BATCH_CREATE_MEMORY_RECORDS_INPUT as _SCHEMA_BATCH_CREATE_MEMORY_RECORDS_INPUT, - BATCH_CREATE_MEMORY_RECORDS_OUTPUT as _SCHEMA_BATCH_CREATE_MEMORY_RECORDS_OUTPUT, BATCH_DELETE_MEMORY_RECORDS as _SCHEMA_BATCH_DELETE_MEMORY_RECORDS, - BATCH_DELETE_MEMORY_RECORDS_INPUT as _SCHEMA_BATCH_DELETE_MEMORY_RECORDS_INPUT, - BATCH_DELETE_MEMORY_RECORDS_OUTPUT as _SCHEMA_BATCH_DELETE_MEMORY_RECORDS_OUTPUT, - BATCH_EVALUATION_SUMMARY as _SCHEMA_BATCH_EVALUATION_SUMMARY, - BATCH_EVALUATION_TRACE_CONFIG as _SCHEMA_BATCH_EVALUATION_TRACE_CONFIG, BATCH_UPDATE_MEMORY_RECORDS as _SCHEMA_BATCH_UPDATE_MEMORY_RECORDS, - BATCH_UPDATE_MEMORY_RECORDS_INPUT as _SCHEMA_BATCH_UPDATE_MEMORY_RECORDS_INPUT, - BATCH_UPDATE_MEMORY_RECORDS_OUTPUT as _SCHEMA_BATCH_UPDATE_MEMORY_RECORDS_OUTPUT, - BRANCH as _SCHEMA_BRANCH, - BRANCH_FILTER as _SCHEMA_BRANCH_FILTER, - BROWSER_ACTION as _SCHEMA_BROWSER_ACTION, - BROWSER_ACTION_RESULT as _SCHEMA_BROWSER_ACTION_RESULT, - BROWSER_ENTERPRISE_POLICY as _SCHEMA_BROWSER_ENTERPRISE_POLICY, - BROWSER_EXTENSION as _SCHEMA_BROWSER_EXTENSION, - BROWSER_PROFILE_CONFIGURATION as _SCHEMA_BROWSER_PROFILE_CONFIGURATION, - BROWSER_SESSION_STREAM as _SCHEMA_BROWSER_SESSION_STREAM, - BROWSER_SESSION_SUMMARY as _SCHEMA_BROWSER_SESSION_SUMMARY, - CERTIFICATE as _SCHEMA_CERTIFICATE, - CERTIFICATE_LOCATION as _SCHEMA_CERTIFICATE_LOCATION, - CLOUD_WATCH_FILTER_CONFIG as _SCHEMA_CLOUD_WATCH_FILTER_CONFIG, - CLOUD_WATCH_LOGS_FILTER as _SCHEMA_CLOUD_WATCH_LOGS_FILTER, - CLOUD_WATCH_LOGS_RULE as _SCHEMA_CLOUD_WATCH_LOGS_RULE, - CLOUD_WATCH_LOGS_SOURCE as _SCHEMA_CLOUD_WATCH_LOGS_SOURCE, - CLOUD_WATCH_LOGS_TRACE_CONFIG as _SCHEMA_CLOUD_WATCH_LOGS_TRACE_CONFIG, - CLOUD_WATCH_OUTPUT_CONFIG as _SCHEMA_CLOUD_WATCH_OUTPUT_CONFIG, - CODE_INTERPRETER_RESULT as _SCHEMA_CODE_INTERPRETER_RESULT, - CODE_INTERPRETER_SESSION_SUMMARY as _SCHEMA_CODE_INTERPRETER_SESSION_SUMMARY, - CODE_INTERPRETER_STREAM_OUTPUT as _SCHEMA_CODE_INTERPRETER_STREAM_OUTPUT, - COINBASE_CDP_TOKEN_REQUEST_INPUT as _SCHEMA_COINBASE_CDP_TOKEN_REQUEST_INPUT, - COINBASE_CDP_TOKEN_RESPONSE_OUTPUT as _SCHEMA_COINBASE_CDP_TOKEN_RESPONSE_OUTPUT, COMPLETE_RESOURCE_TOKEN_AUTH as _SCHEMA_COMPLETE_RESOURCE_TOKEN_AUTH, - COMPLETE_RESOURCE_TOKEN_AUTH_INPUT as _SCHEMA_COMPLETE_RESOURCE_TOKEN_AUTH_INPUT, - COMPLETE_RESOURCE_TOKEN_AUTH_OUTPUT as _SCHEMA_COMPLETE_RESOURCE_TOKEN_AUTH_OUTPUT, - CONFIDENCE_INTERVAL as _SCHEMA_CONFIDENCE_INTERVAL, - CONFIGURATION_BUNDLE_REF as _SCHEMA_CONFIGURATION_BUNDLE_REF, - CONFIGURATION_BUNDLE_TOOL_ENTRY as _SCHEMA_CONFIGURATION_BUNDLE_TOOL_ENTRY, - CONFLICT_EXCEPTION as _SCHEMA_CONFLICT_EXCEPTION, - CONTENT as _SCHEMA_CONTENT, - CONTENT_BLOCK as _SCHEMA_CONTENT_BLOCK, - CONTENT_DELTA_EVENT as _SCHEMA_CONTENT_DELTA_EVENT, - CONTENT_SOURCE as _SCHEMA_CONTENT_SOURCE, - CONTENT_START_EVENT as _SCHEMA_CONTENT_START_EVENT, - CONTENT_STOP_EVENT as _SCHEMA_CONTENT_STOP_EVENT, - CONTEXT as _SCHEMA_CONTEXT, - CONTROL_STATS as _SCHEMA_CONTROL_STATS, - CONVERSATIONAL as _SCHEMA_CONVERSATIONAL, CREATE_AB_TEST as _SCHEMA_CREATE_AB_TEST, - CREATE_AB_TEST_INPUT as _SCHEMA_CREATE_AB_TEST_INPUT, - CREATE_AB_TEST_OUTPUT as _SCHEMA_CREATE_AB_TEST_OUTPUT, CREATE_EVENT as _SCHEMA_CREATE_EVENT, - CREATE_EVENT_INPUT as _SCHEMA_CREATE_EVENT_INPUT, - CREATE_EVENT_OUTPUT as _SCHEMA_CREATE_EVENT_OUTPUT, CREATE_PAYMENT_INSTRUMENT as _SCHEMA_CREATE_PAYMENT_INSTRUMENT, - CREATE_PAYMENT_INSTRUMENT_INPUT as _SCHEMA_CREATE_PAYMENT_INSTRUMENT_INPUT, - CREATE_PAYMENT_INSTRUMENT_OUTPUT as _SCHEMA_CREATE_PAYMENT_INSTRUMENT_OUTPUT, CREATE_PAYMENT_SESSION as _SCHEMA_CREATE_PAYMENT_SESSION, - CREATE_PAYMENT_SESSION_INPUT as _SCHEMA_CREATE_PAYMENT_SESSION_INPUT, - CREATE_PAYMENT_SESSION_OUTPUT as _SCHEMA_CREATE_PAYMENT_SESSION_OUTPUT, - CRYPTO_X402_PAYMENT_INPUT as _SCHEMA_CRYPTO_X402_PAYMENT_INPUT, - CRYPTO_X402_PAYMENT_OUTPUT as _SCHEMA_CRYPTO_X402_PAYMENT_OUTPUT, - CUSTOM_DESCRIPTOR as _SCHEMA_CUSTOM_DESCRIPTOR, - DATA_SOURCE_CONFIG as _SCHEMA_DATA_SOURCE_CONFIG, DELETE_AB_TEST as _SCHEMA_DELETE_AB_TEST, - DELETE_AB_TEST_INPUT as _SCHEMA_DELETE_AB_TEST_INPUT, - DELETE_AB_TEST_OUTPUT as _SCHEMA_DELETE_AB_TEST_OUTPUT, DELETE_BATCH_EVALUATION as _SCHEMA_DELETE_BATCH_EVALUATION, - DELETE_BATCH_EVALUATION_INPUT as _SCHEMA_DELETE_BATCH_EVALUATION_INPUT, - DELETE_BATCH_EVALUATION_OUTPUT as _SCHEMA_DELETE_BATCH_EVALUATION_OUTPUT, DELETE_CAPACITY_PROVIDER_SESSION as _SCHEMA_DELETE_CAPACITY_PROVIDER_SESSION, - DELETE_CAPACITY_PROVIDER_SESSION_INPUT as _SCHEMA_DELETE_CAPACITY_PROVIDER_SESSION_INPUT, - DELETE_CAPACITY_PROVIDER_SESSION_OUTPUT as _SCHEMA_DELETE_CAPACITY_PROVIDER_SESSION_OUTPUT, DELETE_EVENT as _SCHEMA_DELETE_EVENT, - DELETE_EVENT_INPUT as _SCHEMA_DELETE_EVENT_INPUT, - DELETE_EVENT_OUTPUT as _SCHEMA_DELETE_EVENT_OUTPUT, DELETE_MEMORY_RECORD as _SCHEMA_DELETE_MEMORY_RECORD, - DELETE_MEMORY_RECORD_INPUT as _SCHEMA_DELETE_MEMORY_RECORD_INPUT, - DELETE_MEMORY_RECORD_OUTPUT as _SCHEMA_DELETE_MEMORY_RECORD_OUTPUT, DELETE_PAYMENT_INSTRUMENT as _SCHEMA_DELETE_PAYMENT_INSTRUMENT, - DELETE_PAYMENT_INSTRUMENT_INPUT as _SCHEMA_DELETE_PAYMENT_INSTRUMENT_INPUT, - DELETE_PAYMENT_INSTRUMENT_OUTPUT as _SCHEMA_DELETE_PAYMENT_INSTRUMENT_OUTPUT, DELETE_PAYMENT_SESSION as _SCHEMA_DELETE_PAYMENT_SESSION, - DELETE_PAYMENT_SESSION_INPUT as _SCHEMA_DELETE_PAYMENT_SESSION_INPUT, - DELETE_PAYMENT_SESSION_OUTPUT as _SCHEMA_DELETE_PAYMENT_SESSION_OUTPUT, DELETE_RECOMMENDATION as _SCHEMA_DELETE_RECOMMENDATION, - DELETE_RECOMMENDATION_INPUT as _SCHEMA_DELETE_RECOMMENDATION_INPUT, - DELETE_RECOMMENDATION_OUTPUT as _SCHEMA_DELETE_RECOMMENDATION_OUTPUT, - DESCRIPTORS as _SCHEMA_DESCRIPTORS, - DUPLICATE_ID_EXCEPTION as _SCHEMA_DUPLICATE_ID_EXCEPTION, - EFS_CONFIGURATION as _SCHEMA_EFS_CONFIGURATION, - EMBEDDED_CRYPTO_WALLET as _SCHEMA_EMBEDDED_CRYPTO_WALLET, EVALUATE as _SCHEMA_EVALUATE, - EVALUATE_INPUT as _SCHEMA_EVALUATE_INPUT, - EVALUATE_OUTPUT as _SCHEMA_EVALUATE_OUTPUT, - EVALUATION_CONTENT as _SCHEMA_EVALUATION_CONTENT, - EVALUATION_EXPECTED_TRAJECTORY as _SCHEMA_EVALUATION_EXPECTED_TRAJECTORY, - EVALUATION_INPUT as _SCHEMA_EVALUATION_INPUT, - EVALUATION_JOB_RESULTS as _SCHEMA_EVALUATION_JOB_RESULTS, - EVALUATION_METADATA as _SCHEMA_EVALUATION_METADATA, - EVALUATION_REFERENCE_INPUT as _SCHEMA_EVALUATION_REFERENCE_INPUT, - EVALUATION_RESULT_CONTENT as _SCHEMA_EVALUATION_RESULT_CONTENT, - EVALUATION_TARGET as _SCHEMA_EVALUATION_TARGET, - EVALUATOR as _SCHEMA_EVALUATOR, - EVALUATOR_METRIC as _SCHEMA_EVALUATOR_METRIC, - EVALUATOR_STATISTICS as _SCHEMA_EVALUATOR_STATISTICS, - EVALUATOR_SUMMARY as _SCHEMA_EVALUATOR_SUMMARY, - EVENT as _SCHEMA_EVENT, - EVENT_METADATA_FILTER_EXPRESSION as _SCHEMA_EVENT_METADATA_FILTER_EXPRESSION, - EXECUTION_SUMMARY_AFFECTED_SESSION as _SCHEMA_EXECUTION_SUMMARY_AFFECTED_SESSION, - EXECUTION_SUMMARY_CLUSTER as _SCHEMA_EXECUTION_SUMMARY_CLUSTER, - EXECUTION_SUMMARY_CLUSTERING_RESULT_CONTENT as _SCHEMA_EXECUTION_SUMMARY_CLUSTERING_RESULT_CONTENT, - EXTERNAL_PROXY as _SCHEMA_EXTERNAL_PROXY, - EXTRACTION_CONFIG as _SCHEMA_EXTRACTION_CONFIG, - EXTRACTION_JOB as _SCHEMA_EXTRACTION_JOB, - EXTRACTION_JOB_FILTER_INPUT as _SCHEMA_EXTRACTION_JOB_FILTER_INPUT, - EXTRACTION_JOB_MESSAGES as _SCHEMA_EXTRACTION_JOB_MESSAGES, - EXTRACTION_JOB_METADATA as _SCHEMA_EXTRACTION_JOB_METADATA, - FAILURE_ANALYSIS_RESULT_CONTENT as _SCHEMA_FAILURE_ANALYSIS_RESULT_CONTENT, - FAILURE_CATEGORY_CLUSTER as _SCHEMA_FAILURE_CATEGORY_CLUSTER, - FAILURE_SPAN_DETAIL as _SCHEMA_FAILURE_SPAN_DETAIL, - FAILURE_SUB_CATEGORY_CLUSTER as _SCHEMA_FAILURE_SUB_CATEGORY_CLUSTER, - FILTER_INPUT as _SCHEMA_FILTER_INPUT, - FILTER_VALUE as _SCHEMA_FILTER_VALUE, - GATEWAY_FILTER as _SCHEMA_GATEWAY_FILTER, GET_AB_TEST as _SCHEMA_GET_AB_TEST, - GET_AB_TEST_INPUT as _SCHEMA_GET_AB_TEST_INPUT, - GET_AB_TEST_OUTPUT as _SCHEMA_GET_AB_TEST_OUTPUT, GET_AGENT_CARD as _SCHEMA_GET_AGENT_CARD, - GET_AGENT_CARD_INPUT as _SCHEMA_GET_AGENT_CARD_INPUT, - GET_AGENT_CARD_OUTPUT as _SCHEMA_GET_AGENT_CARD_OUTPUT, GET_BATCH_EVALUATION as _SCHEMA_GET_BATCH_EVALUATION, - GET_BATCH_EVALUATION_INPUT as _SCHEMA_GET_BATCH_EVALUATION_INPUT, - GET_BATCH_EVALUATION_OUTPUT as _SCHEMA_GET_BATCH_EVALUATION_OUTPUT, GET_BROWSER_SESSION as _SCHEMA_GET_BROWSER_SESSION, - GET_BROWSER_SESSION_INPUT as _SCHEMA_GET_BROWSER_SESSION_INPUT, - GET_BROWSER_SESSION_OUTPUT as _SCHEMA_GET_BROWSER_SESSION_OUTPUT, GET_CODE_INTERPRETER_SESSION as _SCHEMA_GET_CODE_INTERPRETER_SESSION, - GET_CODE_INTERPRETER_SESSION_INPUT as _SCHEMA_GET_CODE_INTERPRETER_SESSION_INPUT, - GET_CODE_INTERPRETER_SESSION_OUTPUT as _SCHEMA_GET_CODE_INTERPRETER_SESSION_OUTPUT, GET_EVENT as _SCHEMA_GET_EVENT, - GET_EVENT_INPUT as _SCHEMA_GET_EVENT_INPUT, - GET_EVENT_OUTPUT as _SCHEMA_GET_EVENT_OUTPUT, GET_MEMORY_RECORD as _SCHEMA_GET_MEMORY_RECORD, - GET_MEMORY_RECORD_INPUT as _SCHEMA_GET_MEMORY_RECORD_INPUT, - GET_MEMORY_RECORD_OUTPUT as _SCHEMA_GET_MEMORY_RECORD_OUTPUT, GET_PAYMENT_INSTRUMENT as _SCHEMA_GET_PAYMENT_INSTRUMENT, GET_PAYMENT_INSTRUMENT_BALANCE as _SCHEMA_GET_PAYMENT_INSTRUMENT_BALANCE, - GET_PAYMENT_INSTRUMENT_BALANCE_INPUT as _SCHEMA_GET_PAYMENT_INSTRUMENT_BALANCE_INPUT, - GET_PAYMENT_INSTRUMENT_BALANCE_OUTPUT as _SCHEMA_GET_PAYMENT_INSTRUMENT_BALANCE_OUTPUT, - GET_PAYMENT_INSTRUMENT_INPUT as _SCHEMA_GET_PAYMENT_INSTRUMENT_INPUT, - GET_PAYMENT_INSTRUMENT_OUTPUT as _SCHEMA_GET_PAYMENT_INSTRUMENT_OUTPUT, GET_PAYMENT_SESSION as _SCHEMA_GET_PAYMENT_SESSION, - GET_PAYMENT_SESSION_INPUT as _SCHEMA_GET_PAYMENT_SESSION_INPUT, - GET_PAYMENT_SESSION_OUTPUT as _SCHEMA_GET_PAYMENT_SESSION_OUTPUT, GET_RECOMMENDATION as _SCHEMA_GET_RECOMMENDATION, - GET_RECOMMENDATION_INPUT as _SCHEMA_GET_RECOMMENDATION_INPUT, - GET_RECOMMENDATION_OUTPUT as _SCHEMA_GET_RECOMMENDATION_OUTPUT, GET_RESOURCE_API_KEY as _SCHEMA_GET_RESOURCE_API_KEY, - GET_RESOURCE_API_KEY_INPUT as _SCHEMA_GET_RESOURCE_API_KEY_INPUT, - GET_RESOURCE_API_KEY_OUTPUT as _SCHEMA_GET_RESOURCE_API_KEY_OUTPUT, GET_RESOURCE_OAUTH2_TOKEN as _SCHEMA_GET_RESOURCE_OAUTH2_TOKEN, - GET_RESOURCE_OAUTH2_TOKEN_INPUT as _SCHEMA_GET_RESOURCE_OAUTH2_TOKEN_INPUT, - GET_RESOURCE_OAUTH2_TOKEN_OUTPUT as _SCHEMA_GET_RESOURCE_OAUTH2_TOKEN_OUTPUT, GET_RESOURCE_PAYMENT_TOKEN as _SCHEMA_GET_RESOURCE_PAYMENT_TOKEN, - GET_RESOURCE_PAYMENT_TOKEN_INPUT as _SCHEMA_GET_RESOURCE_PAYMENT_TOKEN_INPUT, - GET_RESOURCE_PAYMENT_TOKEN_OUTPUT as _SCHEMA_GET_RESOURCE_PAYMENT_TOKEN_OUTPUT, GET_WORKLOAD_ACCESS_TOKEN as _SCHEMA_GET_WORKLOAD_ACCESS_TOKEN, GET_WORKLOAD_ACCESS_TOKEN_FOR_JWT as _SCHEMA_GET_WORKLOAD_ACCESS_TOKEN_FOR_JWT, - GET_WORKLOAD_ACCESS_TOKEN_FOR_JWT_INPUT as _SCHEMA_GET_WORKLOAD_ACCESS_TOKEN_FOR_JWT_INPUT, - GET_WORKLOAD_ACCESS_TOKEN_FOR_JWT_OUTPUT as _SCHEMA_GET_WORKLOAD_ACCESS_TOKEN_FOR_JWT_OUTPUT, GET_WORKLOAD_ACCESS_TOKEN_FOR_USER_ID as _SCHEMA_GET_WORKLOAD_ACCESS_TOKEN_FOR_USER_ID, - GET_WORKLOAD_ACCESS_TOKEN_FOR_USER_ID_INPUT as _SCHEMA_GET_WORKLOAD_ACCESS_TOKEN_FOR_USER_ID_INPUT, - GET_WORKLOAD_ACCESS_TOKEN_FOR_USER_ID_OUTPUT as _SCHEMA_GET_WORKLOAD_ACCESS_TOKEN_FOR_USER_ID_OUTPUT, - GET_WORKLOAD_ACCESS_TOKEN_INPUT as _SCHEMA_GET_WORKLOAD_ACCESS_TOKEN_INPUT, - GET_WORKLOAD_ACCESS_TOKEN_OUTPUT as _SCHEMA_GET_WORKLOAD_ACCESS_TOKEN_OUTPUT, - GROUND_TRUTH_SOURCE as _SCHEMA_GROUND_TRUTH_SOURCE, - GROUND_TRUTH_TURN as _SCHEMA_GROUND_TRUTH_TURN, - GROUND_TRUTH_TURN_INPUT as _SCHEMA_GROUND_TRUTH_TURN_INPUT, - HARNESS_AGENT_CORE_BROWSER_CONFIG as _SCHEMA_HARNESS_AGENT_CORE_BROWSER_CONFIG, - HARNESS_AGENT_CORE_CODE_INTERPRETER_CONFIG as _SCHEMA_HARNESS_AGENT_CORE_CODE_INTERPRETER_CONFIG, - HARNESS_AGENT_CORE_GATEWAY_CONFIG as _SCHEMA_HARNESS_AGENT_CORE_GATEWAY_CONFIG, - HARNESS_BEDROCK_MODEL_CONFIG as _SCHEMA_HARNESS_BEDROCK_MODEL_CONFIG, - HARNESS_CONTENT_BLOCK as _SCHEMA_HARNESS_CONTENT_BLOCK, - HARNESS_CONTENT_BLOCK_DELTA as _SCHEMA_HARNESS_CONTENT_BLOCK_DELTA, - HARNESS_CONTENT_BLOCK_DELTA_EVENT as _SCHEMA_HARNESS_CONTENT_BLOCK_DELTA_EVENT, - HARNESS_CONTENT_BLOCK_START as _SCHEMA_HARNESS_CONTENT_BLOCK_START, - HARNESS_CONTENT_BLOCK_START_EVENT as _SCHEMA_HARNESS_CONTENT_BLOCK_START_EVENT, - HARNESS_CONTENT_BLOCK_STOP_EVENT as _SCHEMA_HARNESS_CONTENT_BLOCK_STOP_EVENT, - HARNESS_GATEWAY_OUTBOUND_AUTH as _SCHEMA_HARNESS_GATEWAY_OUTBOUND_AUTH, - HARNESS_GEMINI_MODEL_CONFIG as _SCHEMA_HARNESS_GEMINI_MODEL_CONFIG, - HARNESS_HOOK_EVENT as _SCHEMA_HARNESS_HOOK_EVENT, - HARNESS_INLINE_FUNCTION_CONFIG as _SCHEMA_HARNESS_INLINE_FUNCTION_CONFIG, - HARNESS_LITE_LLM_MODEL_CONFIG as _SCHEMA_HARNESS_LITE_LLM_MODEL_CONFIG, - HARNESS_MESSAGE as _SCHEMA_HARNESS_MESSAGE, - HARNESS_MESSAGE_START_EVENT as _SCHEMA_HARNESS_MESSAGE_START_EVENT, - HARNESS_MESSAGE_STOP_EVENT as _SCHEMA_HARNESS_MESSAGE_STOP_EVENT, - HARNESS_METADATA_EVENT as _SCHEMA_HARNESS_METADATA_EVENT, - HARNESS_MODEL_CONFIGURATION as _SCHEMA_HARNESS_MODEL_CONFIGURATION, - HARNESS_OPEN_AI_MODEL_CONFIG as _SCHEMA_HARNESS_OPEN_AI_MODEL_CONFIG, - HARNESS_REASONING_CONTENT_BLOCK as _SCHEMA_HARNESS_REASONING_CONTENT_BLOCK, - HARNESS_REASONING_CONTENT_BLOCK_DELTA as _SCHEMA_HARNESS_REASONING_CONTENT_BLOCK_DELTA, - HARNESS_REASONING_TEXT_BLOCK as _SCHEMA_HARNESS_REASONING_TEXT_BLOCK, - HARNESS_REMOTE_MCP_CONFIG as _SCHEMA_HARNESS_REMOTE_MCP_CONFIG, - HARNESS_SKILL as _SCHEMA_HARNESS_SKILL, - HARNESS_SKILL_AWS_SKILLS_SOURCE as _SCHEMA_HARNESS_SKILL_AWS_SKILLS_SOURCE, - HARNESS_SKILL_GIT_AUTH as _SCHEMA_HARNESS_SKILL_GIT_AUTH, - HARNESS_SKILL_GIT_SOURCE as _SCHEMA_HARNESS_SKILL_GIT_SOURCE, - HARNESS_SKILL_S3_SOURCE as _SCHEMA_HARNESS_SKILL_S3_SOURCE, - HARNESS_STREAM_METRICS as _SCHEMA_HARNESS_STREAM_METRICS, - HARNESS_SYSTEM_CONTENT_BLOCK as _SCHEMA_HARNESS_SYSTEM_CONTENT_BLOCK, - HARNESS_TOKEN_USAGE as _SCHEMA_HARNESS_TOKEN_USAGE, - HARNESS_TOOL as _SCHEMA_HARNESS_TOOL, - HARNESS_TOOL_CONFIGURATION as _SCHEMA_HARNESS_TOOL_CONFIGURATION, - HARNESS_TOOL_RESULT_BLOCK as _SCHEMA_HARNESS_TOOL_RESULT_BLOCK, - HARNESS_TOOL_RESULT_BLOCK_DELTA as _SCHEMA_HARNESS_TOOL_RESULT_BLOCK_DELTA, - HARNESS_TOOL_RESULT_BLOCK_START as _SCHEMA_HARNESS_TOOL_RESULT_BLOCK_START, - HARNESS_TOOL_RESULT_CONTENT_BLOCK as _SCHEMA_HARNESS_TOOL_RESULT_CONTENT_BLOCK, - HARNESS_TOOL_RESULT_METADATA_BLOCK_DELTA as _SCHEMA_HARNESS_TOOL_RESULT_METADATA_BLOCK_DELTA, - HARNESS_TOOL_USE_BLOCK as _SCHEMA_HARNESS_TOOL_USE_BLOCK, - HARNESS_TOOL_USE_BLOCK_DELTA as _SCHEMA_HARNESS_TOOL_USE_BLOCK_DELTA, - HARNESS_TOOL_USE_BLOCK_START as _SCHEMA_HARNESS_TOOL_USE_BLOCK_START, INGEST_DATA as _SCHEMA_INGEST_DATA, - INGEST_DATA_INPUT as _SCHEMA_INGEST_DATA_INPUT, - INGEST_DATA_OUTPUT as _SCHEMA_INGEST_DATA_OUTPUT, - INGEST_PAYLOAD_TYPE as _SCHEMA_INGEST_PAYLOAD_TYPE, - INLINE_GROUND_TRUTH as _SCHEMA_INLINE_GROUND_TRUTH, - INLINE_MEMORY_CONTENT as _SCHEMA_INLINE_MEMORY_CONTENT, - INPUT_CONTENT_BLOCK as _SCHEMA_INPUT_CONTENT_BLOCK, - INSIGHT as _SCHEMA_INSIGHT, - INSIGHTS_FAILURE_SIGNAL as _SCHEMA_INSIGHTS_FAILURE_SIGNAL, - INTERNAL_SERVER_EXCEPTION as _SCHEMA_INTERNAL_SERVER_EXCEPTION, - INVALID_INPUT_EXCEPTION as _SCHEMA_INVALID_INPUT_EXCEPTION, INVOKE_AGENT_RUNTIME as _SCHEMA_INVOKE_AGENT_RUNTIME, INVOKE_AGENT_RUNTIME_COMMAND as _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND, - INVOKE_AGENT_RUNTIME_COMMAND_INPUT as _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_INPUT, - INVOKE_AGENT_RUNTIME_COMMAND_OUTPUT as _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_OUTPUT, - INVOKE_AGENT_RUNTIME_COMMAND_REQUEST_BODY as _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_REQUEST_BODY, - INVOKE_AGENT_RUNTIME_COMMAND_STREAM_OUTPUT as _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_STREAM_OUTPUT, - INVOKE_AGENT_RUNTIME_INPUT as _SCHEMA_INVOKE_AGENT_RUNTIME_INPUT, - INVOKE_AGENT_RUNTIME_OUTPUT as _SCHEMA_INVOKE_AGENT_RUNTIME_OUTPUT, INVOKE_BROWSER as _SCHEMA_INVOKE_BROWSER, - INVOKE_BROWSER_INPUT as _SCHEMA_INVOKE_BROWSER_INPUT, - INVOKE_BROWSER_OUTPUT as _SCHEMA_INVOKE_BROWSER_OUTPUT, INVOKE_CODE_INTERPRETER as _SCHEMA_INVOKE_CODE_INTERPRETER, - INVOKE_CODE_INTERPRETER_INPUT as _SCHEMA_INVOKE_CODE_INTERPRETER_INPUT, - INVOKE_CODE_INTERPRETER_OUTPUT as _SCHEMA_INVOKE_CODE_INTERPRETER_OUTPUT, INVOKE_HARNESS as _SCHEMA_INVOKE_HARNESS, - INVOKE_HARNESS_INPUT as _SCHEMA_INVOKE_HARNESS_INPUT, - INVOKE_HARNESS_OUTPUT as _SCHEMA_INVOKE_HARNESS_OUTPUT, - INVOKE_HARNESS_STREAM_OUTPUT as _SCHEMA_INVOKE_HARNESS_STREAM_OUTPUT, - KEY_PRESS_ARGUMENTS as _SCHEMA_KEY_PRESS_ARGUMENTS, - KEY_PRESS_RESULT as _SCHEMA_KEY_PRESS_RESULT, - KEY_SHORTCUT_ARGUMENTS as _SCHEMA_KEY_SHORTCUT_ARGUMENTS, - KEY_SHORTCUT_RESULT as _SCHEMA_KEY_SHORTCUT_RESULT, - KEY_TYPE_ARGUMENTS as _SCHEMA_KEY_TYPE_ARGUMENTS, - KEY_TYPE_RESULT as _SCHEMA_KEY_TYPE_RESULT, - LEFT_EXPRESSION as _SCHEMA_LEFT_EXPRESSION, - LINKED_ACCOUNT as _SCHEMA_LINKED_ACCOUNT, - LINKED_ACCOUNT_DEVELOPER_JWT as _SCHEMA_LINKED_ACCOUNT_DEVELOPER_JWT, - LINKED_ACCOUNT_EMAIL as _SCHEMA_LINKED_ACCOUNT_EMAIL, - LINKED_ACCOUNT_O_AUTH2 as _SCHEMA_LINKED_ACCOUNT_O_AUTH2, - LINKED_ACCOUNT_SMS as _SCHEMA_LINKED_ACCOUNT_SMS, LIST_AB_TESTS as _SCHEMA_LIST_AB_TESTS, - LIST_AB_TESTS_INPUT as _SCHEMA_LIST_AB_TESTS_INPUT, - LIST_AB_TESTS_OUTPUT as _SCHEMA_LIST_AB_TESTS_OUTPUT, LIST_ACTORS as _SCHEMA_LIST_ACTORS, - LIST_ACTORS_INPUT as _SCHEMA_LIST_ACTORS_INPUT, - LIST_ACTORS_OUTPUT as _SCHEMA_LIST_ACTORS_OUTPUT, LIST_BATCH_EVALUATIONS as _SCHEMA_LIST_BATCH_EVALUATIONS, - LIST_BATCH_EVALUATIONS_INPUT as _SCHEMA_LIST_BATCH_EVALUATIONS_INPUT, - LIST_BATCH_EVALUATIONS_OUTPUT as _SCHEMA_LIST_BATCH_EVALUATIONS_OUTPUT, LIST_BROWSER_SESSIONS as _SCHEMA_LIST_BROWSER_SESSIONS, - LIST_BROWSER_SESSIONS_INPUT as _SCHEMA_LIST_BROWSER_SESSIONS_INPUT, - LIST_BROWSER_SESSIONS_OUTPUT as _SCHEMA_LIST_BROWSER_SESSIONS_OUTPUT, LIST_CODE_INTERPRETER_SESSIONS as _SCHEMA_LIST_CODE_INTERPRETER_SESSIONS, - LIST_CODE_INTERPRETER_SESSIONS_INPUT as _SCHEMA_LIST_CODE_INTERPRETER_SESSIONS_INPUT, - LIST_CODE_INTERPRETER_SESSIONS_OUTPUT as _SCHEMA_LIST_CODE_INTERPRETER_SESSIONS_OUTPUT, LIST_EVENTS as _SCHEMA_LIST_EVENTS, - LIST_EVENTS_INPUT as _SCHEMA_LIST_EVENTS_INPUT, - LIST_EVENTS_OUTPUT as _SCHEMA_LIST_EVENTS_OUTPUT, LIST_MEMORY_EXTRACTION_JOBS as _SCHEMA_LIST_MEMORY_EXTRACTION_JOBS, - LIST_MEMORY_EXTRACTION_JOBS_INPUT as _SCHEMA_LIST_MEMORY_EXTRACTION_JOBS_INPUT, - LIST_MEMORY_EXTRACTION_JOBS_OUTPUT as _SCHEMA_LIST_MEMORY_EXTRACTION_JOBS_OUTPUT, LIST_MEMORY_RECORDS as _SCHEMA_LIST_MEMORY_RECORDS, - LIST_MEMORY_RECORDS_INPUT as _SCHEMA_LIST_MEMORY_RECORDS_INPUT, - LIST_MEMORY_RECORDS_OUTPUT as _SCHEMA_LIST_MEMORY_RECORDS_OUTPUT, LIST_PAYMENT_INSTRUMENTS as _SCHEMA_LIST_PAYMENT_INSTRUMENTS, - LIST_PAYMENT_INSTRUMENTS_INPUT as _SCHEMA_LIST_PAYMENT_INSTRUMENTS_INPUT, - LIST_PAYMENT_INSTRUMENTS_OUTPUT as _SCHEMA_LIST_PAYMENT_INSTRUMENTS_OUTPUT, LIST_PAYMENT_SESSIONS as _SCHEMA_LIST_PAYMENT_SESSIONS, - LIST_PAYMENT_SESSIONS_INPUT as _SCHEMA_LIST_PAYMENT_SESSIONS_INPUT, - LIST_PAYMENT_SESSIONS_OUTPUT as _SCHEMA_LIST_PAYMENT_SESSIONS_OUTPUT, LIST_RECOMMENDATIONS as _SCHEMA_LIST_RECOMMENDATIONS, - LIST_RECOMMENDATIONS_INPUT as _SCHEMA_LIST_RECOMMENDATIONS_INPUT, - LIST_RECOMMENDATIONS_OUTPUT as _SCHEMA_LIST_RECOMMENDATIONS_OUTPUT, LIST_SESSIONS as _SCHEMA_LIST_SESSIONS, - LIST_SESSIONS_INPUT as _SCHEMA_LIST_SESSIONS_INPUT, - LIST_SESSIONS_OUTPUT as _SCHEMA_LIST_SESSIONS_OUTPUT, - LIVE_VIEW_STREAM as _SCHEMA_LIVE_VIEW_STREAM, - MCP_DESCRIPTOR as _SCHEMA_MCP_DESCRIPTOR, - MEMORY_CONTENT as _SCHEMA_MEMORY_CONTENT, - MEMORY_JSON_DATA as _SCHEMA_MEMORY_JSON_DATA, - MEMORY_METADATA_FILTER_EXPRESSION as _SCHEMA_MEMORY_METADATA_FILTER_EXPRESSION, - MEMORY_RECORD as _SCHEMA_MEMORY_RECORD, - MEMORY_RECORD_CREATE_INPUT as _SCHEMA_MEMORY_RECORD_CREATE_INPUT, - MEMORY_RECORD_DELETE_INPUT as _SCHEMA_MEMORY_RECORD_DELETE_INPUT, - MEMORY_RECORD_LEFT_EXPRESSION as _SCHEMA_MEMORY_RECORD_LEFT_EXPRESSION, - MEMORY_RECORD_METADATA_VALUE as _SCHEMA_MEMORY_RECORD_METADATA_VALUE, - MEMORY_RECORD_OUTPUT as _SCHEMA_MEMORY_RECORD_OUTPUT, - MEMORY_RECORD_RIGHT_EXPRESSION as _SCHEMA_MEMORY_RECORD_RIGHT_EXPRESSION, - MEMORY_RECORD_SUMMARY as _SCHEMA_MEMORY_RECORD_SUMMARY, - MEMORY_RECORD_UPDATE_INPUT as _SCHEMA_MEMORY_RECORD_UPDATE_INPUT, - MESSAGE_METADATA as _SCHEMA_MESSAGE_METADATA, - METADATA_VALUE as _SCHEMA_METADATA_VALUE, - MOUSE_CLICK_ARGUMENTS as _SCHEMA_MOUSE_CLICK_ARGUMENTS, - MOUSE_CLICK_RESULT as _SCHEMA_MOUSE_CLICK_RESULT, - MOUSE_DRAG_ARGUMENTS as _SCHEMA_MOUSE_DRAG_ARGUMENTS, - MOUSE_DRAG_RESULT as _SCHEMA_MOUSE_DRAG_RESULT, - MOUSE_MOVE_ARGUMENTS as _SCHEMA_MOUSE_MOVE_ARGUMENTS, - MOUSE_MOVE_RESULT as _SCHEMA_MOUSE_MOVE_RESULT, - MOUSE_SCROLL_ARGUMENTS as _SCHEMA_MOUSE_SCROLL_ARGUMENTS, - MOUSE_SCROLL_RESULT as _SCHEMA_MOUSE_SCROLL_RESULT, - MPP_PAYMENT_INPUT as _SCHEMA_MPP_PAYMENT_INPUT, - MPP_PAYMENT_OUTPUT as _SCHEMA_MPP_PAYMENT_OUTPUT, - ONLINE_EVALUATION_CONFIG_SOURCE as _SCHEMA_ONLINE_EVALUATION_CONFIG_SOURCE, - ONLINE_EVALUATION_TRACE_CONFIG as _SCHEMA_ONLINE_EVALUATION_TRACE_CONFIG, - OUTPUT_CONFIG as _SCHEMA_OUTPUT_CONFIG, - O_AUTH2_AUTHENTICATION as _SCHEMA_O_AUTH2_AUTHENTICATION, - O_AUTH_CREDENTIAL_PROVIDER as _SCHEMA_O_AUTH_CREDENTIAL_PROVIDER, - PAYLOAD_TYPE as _SCHEMA_PAYLOAD_TYPE, - PAYMENT_INPUT as _SCHEMA_PAYMENT_INPUT, - PAYMENT_INSTRUMENT as _SCHEMA_PAYMENT_INSTRUMENT, - PAYMENT_INSTRUMENT_DETAILS as _SCHEMA_PAYMENT_INSTRUMENT_DETAILS, - PAYMENT_INSTRUMENT_SUMMARY as _SCHEMA_PAYMENT_INSTRUMENT_SUMMARY, - PAYMENT_OUTPUT as _SCHEMA_PAYMENT_OUTPUT, - PAYMENT_SESSION as _SCHEMA_PAYMENT_SESSION, - PAYMENT_SESSION_SUMMARY as _SCHEMA_PAYMENT_SESSION_SUMMARY, - PAYMENT_TOKEN_REQUEST_INPUT as _SCHEMA_PAYMENT_TOKEN_REQUEST_INPUT, - PAYMENT_TOKEN_RESPONSE_OUTPUT as _SCHEMA_PAYMENT_TOKEN_RESPONSE_OUTPUT, - PER_VARIANT_ONLINE_EVALUATION_CONFIG as _SCHEMA_PER_VARIANT_ONLINE_EVALUATION_CONFIG, PROCESS_PAYMENT as _SCHEMA_PROCESS_PAYMENT, - PROCESS_PAYMENT_INPUT as _SCHEMA_PROCESS_PAYMENT_INPUT, - PROCESS_PAYMENT_OUTPUT as _SCHEMA_PROCESS_PAYMENT_OUTPUT, - PROXY as _SCHEMA_PROXY, - PROXY_BYPASS as _SCHEMA_PROXY_BYPASS, - PROXY_CONFIGURATION as _SCHEMA_PROXY_CONFIGURATION, - PROXY_CREDENTIALS as _SCHEMA_PROXY_CREDENTIALS, - RECOMMENDATION_CONFIG as _SCHEMA_RECOMMENDATION_CONFIG, - RECOMMENDATION_EVALUATION_CONFIG as _SCHEMA_RECOMMENDATION_EVALUATION_CONFIG, - RECOMMENDATION_EVALUATOR_REFERENCE as _SCHEMA_RECOMMENDATION_EVALUATOR_REFERENCE, - RECOMMENDATION_RESULT as _SCHEMA_RECOMMENDATION_RESULT, - RECOMMENDATION_RESULT_CONFIGURATION_BUNDLE as _SCHEMA_RECOMMENDATION_RESULT_CONFIGURATION_BUNDLE, - RECOMMENDATION_SUMMARY as _SCHEMA_RECOMMENDATION_SUMMARY, - REGISTRY_RECORD_SUMMARY as _SCHEMA_REGISTRY_RECORD_SUMMARY, - RESOURCE_CONTENT as _SCHEMA_RESOURCE_CONTENT, - RESOURCE_LOCATION as _SCHEMA_RESOURCE_LOCATION, - RESOURCE_NOT_FOUND_EXCEPTION as _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - RESPONSE_CHUNK as _SCHEMA_RESPONSE_CHUNK, RETRIEVE_MEMORY_RECORDS as _SCHEMA_RETRIEVE_MEMORY_RECORDS, - RETRIEVE_MEMORY_RECORDS_INPUT as _SCHEMA_RETRIEVE_MEMORY_RECORDS_INPUT, - RETRIEVE_MEMORY_RECORDS_OUTPUT as _SCHEMA_RETRIEVE_MEMORY_RECORDS_OUTPUT, - RETRYABLE_CONFLICT_EXCEPTION as _SCHEMA_RETRYABLE_CONFLICT_EXCEPTION, - RIGHT_EXPRESSION as _SCHEMA_RIGHT_EXPRESSION, - ROOT_CAUSE_CLUSTER as _SCHEMA_ROOT_CAUSE_CLUSTER, - RUNTIME_CLIENT_ERROR as _SCHEMA_RUNTIME_CLIENT_ERROR, - S3_FILES_CONFIGURATION as _SCHEMA_S3_FILES_CONFIGURATION, - S3_LOCATION as _SCHEMA_S3_LOCATION, SAVE_BROWSER_SESSION_PROFILE as _SCHEMA_SAVE_BROWSER_SESSION_PROFILE, - SAVE_BROWSER_SESSION_PROFILE_INPUT as _SCHEMA_SAVE_BROWSER_SESSION_PROFILE_INPUT, - SAVE_BROWSER_SESSION_PROFILE_OUTPUT as _SCHEMA_SAVE_BROWSER_SESSION_PROFILE_OUTPUT, - SCREENSHOT_ARGUMENTS as _SCHEMA_SCREENSHOT_ARGUMENTS, - SCREENSHOT_RESULT as _SCHEMA_SCREENSHOT_RESULT, - SEARCH_CRITERIA as _SCHEMA_SEARCH_CRITERIA, SEARCH_REGISTRY_RECORDS as _SCHEMA_SEARCH_REGISTRY_RECORDS, - SEARCH_REGISTRY_RECORDS_INPUT as _SCHEMA_SEARCH_REGISTRY_RECORDS_INPUT, - SEARCH_REGISTRY_RECORDS_OUTPUT as _SCHEMA_SEARCH_REGISTRY_RECORDS_OUTPUT, - SECRETS_MANAGER_LOCATION as _SCHEMA_SECRETS_MANAGER_LOCATION, - SERVER_DEFINITION as _SCHEMA_SERVER_DEFINITION, - SERVICE_EXCEPTION as _SCHEMA_SERVICE_EXCEPTION, - SERVICE_QUOTA_EXCEEDED_EXCEPTION as _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - SESSION_FILTER as _SCHEMA_SESSION_FILTER, - SESSION_FILTER_CONFIG as _SCHEMA_SESSION_FILTER_CONFIG, - SESSION_LIMITS as _SCHEMA_SESSION_LIMITS, - SESSION_METADATA_SHAPE as _SCHEMA_SESSION_METADATA_SHAPE, - SESSION_SUMMARY as _SCHEMA_SESSION_SUMMARY, - SESSION_TRACE_IDS as _SCHEMA_SESSION_TRACE_IDS, - SKILL_DEFINITION as _SCHEMA_SKILL_DEFINITION, - SKILL_MD_DEFINITION as _SCHEMA_SKILL_MD_DEFINITION, - SPAN_CONTEXT as _SCHEMA_SPAN_CONTEXT, START_BATCH_EVALUATION as _SCHEMA_START_BATCH_EVALUATION, - START_BATCH_EVALUATION_INPUT as _SCHEMA_START_BATCH_EVALUATION_INPUT, - START_BATCH_EVALUATION_OUTPUT as _SCHEMA_START_BATCH_EVALUATION_OUTPUT, START_BROWSER_SESSION as _SCHEMA_START_BROWSER_SESSION, - START_BROWSER_SESSION_INPUT as _SCHEMA_START_BROWSER_SESSION_INPUT, - START_BROWSER_SESSION_OUTPUT as _SCHEMA_START_BROWSER_SESSION_OUTPUT, START_CODE_INTERPRETER_SESSION as _SCHEMA_START_CODE_INTERPRETER_SESSION, - START_CODE_INTERPRETER_SESSION_INPUT as _SCHEMA_START_CODE_INTERPRETER_SESSION_INPUT, - START_CODE_INTERPRETER_SESSION_OUTPUT as _SCHEMA_START_CODE_INTERPRETER_SESSION_OUTPUT, START_MEMORY_EXTRACTION_JOB as _SCHEMA_START_MEMORY_EXTRACTION_JOB, - START_MEMORY_EXTRACTION_JOB_INPUT as _SCHEMA_START_MEMORY_EXTRACTION_JOB_INPUT, - START_MEMORY_EXTRACTION_JOB_OUTPUT as _SCHEMA_START_MEMORY_EXTRACTION_JOB_OUTPUT, START_RECOMMENDATION as _SCHEMA_START_RECOMMENDATION, - START_RECOMMENDATION_INPUT as _SCHEMA_START_RECOMMENDATION_INPUT, - START_RECOMMENDATION_OUTPUT as _SCHEMA_START_RECOMMENDATION_OUTPUT, STOP_BATCH_EVALUATION as _SCHEMA_STOP_BATCH_EVALUATION, - STOP_BATCH_EVALUATION_INPUT as _SCHEMA_STOP_BATCH_EVALUATION_INPUT, - STOP_BATCH_EVALUATION_OUTPUT as _SCHEMA_STOP_BATCH_EVALUATION_OUTPUT, STOP_BROWSER_SESSION as _SCHEMA_STOP_BROWSER_SESSION, - STOP_BROWSER_SESSION_INPUT as _SCHEMA_STOP_BROWSER_SESSION_INPUT, - STOP_BROWSER_SESSION_OUTPUT as _SCHEMA_STOP_BROWSER_SESSION_OUTPUT, STOP_CODE_INTERPRETER_SESSION as _SCHEMA_STOP_CODE_INTERPRETER_SESSION, - STOP_CODE_INTERPRETER_SESSION_INPUT as _SCHEMA_STOP_CODE_INTERPRETER_SESSION_INPUT, - STOP_CODE_INTERPRETER_SESSION_OUTPUT as _SCHEMA_STOP_CODE_INTERPRETER_SESSION_OUTPUT, STOP_RUNTIME_SESSION as _SCHEMA_STOP_RUNTIME_SESSION, - STOP_RUNTIME_SESSION_INPUT as _SCHEMA_STOP_RUNTIME_SESSION_INPUT, - STOP_RUNTIME_SESSION_OUTPUT as _SCHEMA_STOP_RUNTIME_SESSION_OUTPUT, - STREAM_UPDATE as _SCHEMA_STREAM_UPDATE, - STRIPE_PRIVY_TOKEN_REQUEST_INPUT as _SCHEMA_STRIPE_PRIVY_TOKEN_REQUEST_INPUT, - STRIPE_PRIVY_TOKEN_RESPONSE_OUTPUT as _SCHEMA_STRIPE_PRIVY_TOKEN_RESPONSE_OUTPUT, - SUBSCRIPTION_REQUIRED_EXCEPTION as _SCHEMA_SUBSCRIPTION_REQUIRED_EXCEPTION, - SYSTEM_PROMPT_CONFIG as _SCHEMA_SYSTEM_PROMPT_CONFIG, - SYSTEM_PROMPT_CONFIGURATION_BUNDLE as _SCHEMA_SYSTEM_PROMPT_CONFIGURATION_BUNDLE, - SYSTEM_PROMPT_RECOMMENDATION_CONFIG as _SCHEMA_SYSTEM_PROMPT_RECOMMENDATION_CONFIG, - SYSTEM_PROMPT_RECOMMENDATION_RESULT as _SCHEMA_SYSTEM_PROMPT_RECOMMENDATION_RESULT, - TARGET_REF as _SCHEMA_TARGET_REF, - THROTTLED_EXCEPTION as _SCHEMA_THROTTLED_EXCEPTION, - THROTTLING_EXCEPTION as _SCHEMA_THROTTLING_EXCEPTION, - TOKEN_BALANCE as _SCHEMA_TOKEN_BALANCE, - TOKEN_USAGE as _SCHEMA_TOKEN_USAGE, - TOOLS_DEFINITION as _SCHEMA_TOOLS_DEFINITION, - TOOLS_FILE_SYSTEM_CONFIGURATION as _SCHEMA_TOOLS_FILE_SYSTEM_CONFIGURATION, - TOOL_ARGUMENTS as _SCHEMA_TOOL_ARGUMENTS, - TOOL_DESCRIPTION_CONFIG as _SCHEMA_TOOL_DESCRIPTION_CONFIG, - TOOL_DESCRIPTION_CONFIGURATION_BUNDLE as _SCHEMA_TOOL_DESCRIPTION_CONFIGURATION_BUNDLE, - TOOL_DESCRIPTION_INPUT as _SCHEMA_TOOL_DESCRIPTION_INPUT, - TOOL_DESCRIPTION_OUTPUT as _SCHEMA_TOOL_DESCRIPTION_OUTPUT, - TOOL_DESCRIPTION_RECOMMENDATION_CONFIG as _SCHEMA_TOOL_DESCRIPTION_RECOMMENDATION_CONFIG, - TOOL_DESCRIPTION_RECOMMENDATION_RESULT as _SCHEMA_TOOL_DESCRIPTION_RECOMMENDATION_RESULT, - TOOL_DESCRIPTION_SOURCE as _SCHEMA_TOOL_DESCRIPTION_SOURCE, - TOOL_DESCRIPTION_TEXT_INPUT as _SCHEMA_TOOL_DESCRIPTION_TEXT_INPUT, - TOOL_RESULT_STRUCTURED_CONTENT as _SCHEMA_TOOL_RESULT_STRUCTURED_CONTENT, - UNAUTHORIZED_EXCEPTION as _SCHEMA_UNAUTHORIZED_EXCEPTION, UPDATE_AB_TEST as _SCHEMA_UPDATE_AB_TEST, - UPDATE_AB_TEST_INPUT as _SCHEMA_UPDATE_AB_TEST_INPUT, - UPDATE_AB_TEST_OUTPUT as _SCHEMA_UPDATE_AB_TEST_OUTPUT, UPDATE_BROWSER_STREAM as _SCHEMA_UPDATE_BROWSER_STREAM, - UPDATE_BROWSER_STREAM_INPUT as _SCHEMA_UPDATE_BROWSER_STREAM_INPUT, - UPDATE_BROWSER_STREAM_OUTPUT as _SCHEMA_UPDATE_BROWSER_STREAM_OUTPUT, - USER_IDENTIFIER as _SCHEMA_USER_IDENTIFIER, - USER_INTENT_AFFECTED_SESSION as _SCHEMA_USER_INTENT_AFFECTED_SESSION, - USER_INTENT_CLUSTER as _SCHEMA_USER_INTENT_CLUSTER, - USER_INTENT_CLUSTERING_RESULT_CONTENT as _SCHEMA_USER_INTENT_CLUSTERING_RESULT_CONTENT, - VALIDATION_EXCEPTION as _SCHEMA_VALIDATION_EXCEPTION, - VALIDATION_EXCEPTION_FIELD as _SCHEMA_VALIDATION_EXCEPTION_FIELD, - VARIANT as _SCHEMA_VARIANT, - VARIANT_CONFIGURATION as _SCHEMA_VARIANT_CONFIGURATION, - VARIANT_RESULT as _SCHEMA_VARIANT_RESULT, - VIEW_PORT as _SCHEMA_VIEW_PORT, ) - -logger = logging.getLogger(__name__) +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .models import ( + BatchCreateMemoryRecordsInput, + BatchCreateMemoryRecordsOutput, + BatchDeleteMemoryRecordsInput, + BatchDeleteMemoryRecordsOutput, + BatchUpdateMemoryRecordsInput, + BatchUpdateMemoryRecordsOutput, + CompleteResourceTokenAuthInput, + CompleteResourceTokenAuthOutput, + CreateABTestInput, + CreateABTestOutput, + CreateEventInput, + CreateEventOutput, + CreatePaymentInstrumentInput, + CreatePaymentInstrumentOutput, + CreatePaymentSessionInput, + CreatePaymentSessionOutput, + DeleteABTestInput, + DeleteABTestOutput, + DeleteBatchEvaluationInput, + DeleteBatchEvaluationOutput, + DeleteCapacityProviderSessionInput, + DeleteCapacityProviderSessionOutput, + DeleteEventInput, + DeleteEventOutput, + DeleteMemoryRecordInput, + DeleteMemoryRecordOutput, + DeletePaymentInstrumentInput, + DeletePaymentInstrumentOutput, + DeletePaymentSessionInput, + DeletePaymentSessionOutput, + DeleteRecommendationInput, + DeleteRecommendationOutput, + EvaluateInput, + EvaluateOutput, + GetABTestInput, + GetABTestOutput, + GetAgentCardInput, + GetAgentCardOutput, + GetBatchEvaluationInput, + GetBatchEvaluationOutput, + GetBrowserSessionInput, + GetBrowserSessionOutput, + GetCodeInterpreterSessionInput, + GetCodeInterpreterSessionOutput, + GetEventInput, + GetEventOutput, + GetMemoryRecordInput, + GetMemoryRecordOutput, + GetPaymentInstrumentBalanceInput, + GetPaymentInstrumentBalanceOutput, + GetPaymentInstrumentInput, + GetPaymentInstrumentOutput, + GetPaymentSessionInput, + GetPaymentSessionOutput, + GetRecommendationInput, + GetRecommendationOutput, + GetResourceApiKeyInput, + GetResourceApiKeyOutput, + GetResourceOauth2TokenInput, + GetResourceOauth2TokenOutput, + GetResourcePaymentTokenInput, + GetResourcePaymentTokenOutput, + GetWorkloadAccessTokenForJWTInput, + GetWorkloadAccessTokenForJWTOutput, + GetWorkloadAccessTokenForUserIdInput, + GetWorkloadAccessTokenForUserIdOutput, + GetWorkloadAccessTokenInput, + GetWorkloadAccessTokenOutput, + IngestDataInput, + IngestDataOutput, + InvokeAgentRuntimeCommandInput, + InvokeAgentRuntimeCommandOutput, + InvokeAgentRuntimeInput, + InvokeAgentRuntimeOutput, + InvokeBrowserInput, + InvokeBrowserOutput, + InvokeCodeInterpreterInput, + InvokeCodeInterpreterOutput, + InvokeHarnessInput, + InvokeHarnessOutput, + ListABTestsInput, + ListABTestsOutput, + ListActorsInput, + ListActorsOutput, + ListBatchEvaluationsInput, + ListBatchEvaluationsOutput, + ListBrowserSessionsInput, + ListBrowserSessionsOutput, + ListCodeInterpreterSessionsInput, + ListCodeInterpreterSessionsOutput, + ListEventsInput, + ListEventsOutput, + ListMemoryExtractionJobsInput, + ListMemoryExtractionJobsOutput, + ListMemoryRecordsInput, + ListMemoryRecordsOutput, + ListPaymentInstrumentsInput, + ListPaymentInstrumentsOutput, + ListPaymentSessionsInput, + ListPaymentSessionsOutput, + ListRecommendationsInput, + ListRecommendationsOutput, + ListSessionsInput, + ListSessionsOutput, + ProcessPaymentInput, + ProcessPaymentOutput, + RetrieveMemoryRecordsInput, + RetrieveMemoryRecordsOutput, + SaveBrowserSessionProfileInput, + SaveBrowserSessionProfileOutput, + SearchRegistryRecordsInput, + SearchRegistryRecordsOutput, + StartBatchEvaluationInput, + StartBatchEvaluationOutput, + StartBrowserSessionInput, + StartBrowserSessionOutput, + StartCodeInterpreterSessionInput, + StartCodeInterpreterSessionOutput, + StartMemoryExtractionJobInput, + StartMemoryExtractionJobOutput, + StartRecommendationInput, + StartRecommendationOutput, + StopBatchEvaluationInput, + StopBatchEvaluationOutput, + StopBrowserSessionInput, + StopBrowserSessionOutput, + StopCodeInterpreterSessionInput, + StopCodeInterpreterSessionOutput, + StopRuntimeSessionInput, + StopRuntimeSessionOutput, + UpdateABTestInput, + UpdateABTestOutput, + UpdateBrowserStreamInput, + UpdateBrowserStreamOutput, + ) class ServiceError(ModeledError): @@ -509,41600 +228,2220 @@ class ServiceError(ModeledError): """ -@dataclass(kw_only=True) -class AgentCardDefinition: - """ - The agent card definition for A2A descriptors, including the schema - version and inline content that describes the agent's capabilities. - """ - - schema_version: str | None = None - """The schema version of the agent card definition.""" - - inline_content: str | None = None - """The inline content of the agent card definition.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENT_CARD_DEFINITION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.schema_version is not None: - serializer.write_string( - _SCHEMA_AGENT_CARD_DEFINITION.members["schemaVersion"], - self.schema_version, - ) - - if self.inline_content is not None: - serializer.write_string( - _SCHEMA_AGENT_CARD_DEFINITION.members["inlineContent"], - self.inline_content, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["schema_version"] = de.read_string( - _SCHEMA_AGENT_CARD_DEFINITION.members["schemaVersion"] - ) - - case 1: - kwargs["inline_content"] = de.read_string( - _SCHEMA_AGENT_CARD_DEFINITION.members["inlineContent"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AGENT_CARD_DEFINITION, consumer=_consumer) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls() - - -@dataclass(kw_only=True) -class A2aDescriptor: - """The A2A (Agent-to-Agent) descriptor configuration for a registry record.""" - - agent_card: AgentCardDefinition - """ - The agent card definition that describes the agent's capabilities and - interface. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_A2A_DESCRIPTOR, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_A2A_DESCRIPTOR.members["agentCard"], self.agent_card - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agent_card"] = AgentCardDefinition.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_A2A_DESCRIPTOR, consumer=_consumer) - if "agent_card" not in kwargs: - kwargs["agent_card"] = AgentCardDefinition._smithy_default() - return kwargs - - -@dataclass(kw_only=True) -class PerVariantOnlineEvaluationConfig: - """ - An online evaluation configuration associated with a specific A/B test - variant. - """ - - name: str - """The name of the variant this evaluation configuration applies to.""" - - online_evaluation_config_arn: str - """ - The Amazon Resource Name (ARN) of the online evaluation configuration - for this variant. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PER_VARIANT_ONLINE_EVALUATION_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_PER_VARIANT_ONLINE_EVALUATION_CONFIG.members["name"], self.name - ) - serializer.write_string( - _SCHEMA_PER_VARIANT_ONLINE_EVALUATION_CONFIG.members[ - "onlineEvaluationConfigArn" - ], - self.online_evaluation_config_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_PER_VARIANT_ONLINE_EVALUATION_CONFIG.members["name"] - ) - - case 1: - kwargs["online_evaluation_config_arn"] = de.read_string( - _SCHEMA_PER_VARIANT_ONLINE_EVALUATION_CONFIG.members[ - "onlineEvaluationConfigArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PER_VARIANT_ONLINE_EVALUATION_CONFIG, consumer=_consumer - ) - if "name" not in kwargs: - kwargs["name"] = "" - if "online_evaluation_config_arn" not in kwargs: - kwargs["online_evaluation_config_arn"] = "" - return kwargs - - -def _serialize_per_variant_online_evaluation_config_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[PerVariantOnlineEvaluationConfig], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_per_variant_online_evaluation_config_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[PerVariantOnlineEvaluationConfig]: - result: list[PerVariantOnlineEvaluationConfig] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(PerVariantOnlineEvaluationConfig.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass -class ABTestEvaluationConfigOnlineEvaluationConfigArn: - """ - The Amazon Resource Name (ARN) of a single online evaluation - configuration to use for both variants. - """ - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AB_TEST_EVALUATION_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AB_TEST_EVALUATION_CONFIG.members["onlineEvaluationConfigArn"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string( - _SCHEMA_AB_TEST_EVALUATION_CONFIG.members["onlineEvaluationConfigArn"] - ) - ) - - -@dataclass -class ABTestEvaluationConfigPerVariantOnlineEvaluationConfig: - """ - Per-variant online evaluation configurations, allowing different - evaluation settings for each variant. - """ - - value: list[PerVariantOnlineEvaluationConfig] - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AB_TEST_EVALUATION_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_per_variant_online_evaluation_config_list( - serializer, - _SCHEMA_AB_TEST_EVALUATION_CONFIG.members[ - "perVariantOnlineEvaluationConfig" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_deserialize_per_variant_online_evaluation_config_list( - deserializer, - _SCHEMA_AB_TEST_EVALUATION_CONFIG.members[ - "perVariantOnlineEvaluationConfig" - ], - ) - ) - - -@dataclass -class ABTestEvaluationConfigUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ABTestEvaluationConfig = Union[ - ABTestEvaluationConfigOnlineEvaluationConfigArn - | ABTestEvaluationConfigPerVariantOnlineEvaluationConfig - | ABTestEvaluationConfigUnknown -] -""" -The evaluation configuration for an A/B test, specifying which online -evaluation configurations to use for measuring variant performance. -""" - +_registry = ModelRegistry( + _schemas, + renames={}, + index={ + "A2aDescriptor": "A2A_DESCRIPTOR", + "ABTestEvaluationConfig": "AB_TEST_EVALUATION_CONFIG", + "ABTestEvaluationConfigOnlineEvaluationConfigArn": "AB_TEST_EVALUATION_CONFIG", + "ABTestEvaluationConfigPerVariantOnlineEvaluationConfig": "AB_TEST_EVALUATION_CONFIG", + "ABTestEvaluationConfigUnknown": "AB_TEST_EVALUATION_CONFIG", + "ABTestExecutionStatus": "AB_TEST_EXECUTION_STATUS", + "ABTestResults": "AB_TEST_RESULTS", + "ABTestStatus": "AB_TEST_STATUS", + "ABTestSummary": "AB_TEST_SUMMARY", + "AccessDeniedException": "ACCESS_DENIED_EXCEPTION", + "ActorSummary": "ACTOR_SUMMARY", + "AffectedSession": "AFFECTED_SESSION", + "AgentCardDefinition": "AGENT_CARD_DEFINITION", + "AgentSkillsDescriptor": "AGENT_SKILLS_DESCRIPTOR", + "AgentTracesConfig": "AGENT_TRACES_CONFIG", + "AgentTracesConfigSessionSpans": "AGENT_TRACES_CONFIG", + "AgentTracesConfigCloudwatchLogs": "AGENT_TRACES_CONFIG", + "AgentTracesConfigBatchEvaluation": "AGENT_TRACES_CONFIG", + "AgentTracesConfigOnlineEvaluation": "AGENT_TRACES_CONFIG", + "AgentTracesConfigUnknown": "AGENT_TRACES_CONFIG", + "Amount": "AMOUNT", + "AutomationStream": "AUTOMATION_STREAM", + "AutomationStreamStatus": "AUTOMATION_STREAM_STATUS", + "AutomationStreamUpdate": "AUTOMATION_STREAM_UPDATE", + "AvailableLimits": "AVAILABLE_LIMITS", + "BasicAuth": "BASIC_AUTH", + "BatchCreateMemoryRecordsInput": "BATCH_CREATE_MEMORY_RECORDS_INPUT", + "BatchCreateMemoryRecordsOutput": "BATCH_CREATE_MEMORY_RECORDS_OUTPUT", + "BatchDeleteMemoryRecordsInput": "BATCH_DELETE_MEMORY_RECORDS_INPUT", + "BatchDeleteMemoryRecordsOutput": "BATCH_DELETE_MEMORY_RECORDS_OUTPUT", + "BatchEvaluationStatus": "BATCH_EVALUATION_STATUS", + "BatchEvaluationSummary": "BATCH_EVALUATION_SUMMARY", + "BatchEvaluationTraceConfig": "BATCH_EVALUATION_TRACE_CONFIG", + "BatchUpdateMemoryRecordsInput": "BATCH_UPDATE_MEMORY_RECORDS_INPUT", + "BatchUpdateMemoryRecordsOutput": "BATCH_UPDATE_MEMORY_RECORDS_OUTPUT", + "BlockchainChainId": "BLOCKCHAIN_CHAIN_ID", + "Branch": "BRANCH", + "BranchFilter": "BRANCH_FILTER", + "BrowserAction": "BROWSER_ACTION", + "BrowserActionMouseClick": "BROWSER_ACTION", + "BrowserActionMouseMove": "BROWSER_ACTION", + "BrowserActionMouseDrag": "BROWSER_ACTION", + "BrowserActionMouseScroll": "BROWSER_ACTION", + "BrowserActionKeyType": "BROWSER_ACTION", + "BrowserActionKeyPress": "BROWSER_ACTION", + "BrowserActionKeyShortcut": "BROWSER_ACTION", + "BrowserActionScreenshot": "BROWSER_ACTION", + "BrowserActionUnknown": "BROWSER_ACTION", + "BrowserActionResult": "BROWSER_ACTION_RESULT", + "BrowserActionResultMouseClick": "BROWSER_ACTION_RESULT", + "BrowserActionResultMouseMove": "BROWSER_ACTION_RESULT", + "BrowserActionResultMouseDrag": "BROWSER_ACTION_RESULT", + "BrowserActionResultMouseScroll": "BROWSER_ACTION_RESULT", + "BrowserActionResultKeyType": "BROWSER_ACTION_RESULT", + "BrowserActionResultKeyPress": "BROWSER_ACTION_RESULT", + "BrowserActionResultKeyShortcut": "BROWSER_ACTION_RESULT", + "BrowserActionResultScreenshot": "BROWSER_ACTION_RESULT", + "BrowserActionResultUnknown": "BROWSER_ACTION_RESULT", + "BrowserActionStatus": "BROWSER_ACTION_STATUS", + "BrowserEnterprisePolicy": "BROWSER_ENTERPRISE_POLICY", + "BrowserEnterprisePolicyType": "BROWSER_ENTERPRISE_POLICY_TYPE", + "BrowserExtension": "BROWSER_EXTENSION", + "BrowserProfileConfiguration": "BROWSER_PROFILE_CONFIGURATION", + "BrowserSessionStatus": "BROWSER_SESSION_STATUS", + "BrowserSessionStream": "BROWSER_SESSION_STREAM", + "BrowserSessionSummary": "BROWSER_SESSION_SUMMARY", + "CapacityProviderSessionStatus": "CAPACITY_PROVIDER_SESSION_STATUS", + "Certificate": "CERTIFICATE", + "CertificateLocation": "CERTIFICATE_LOCATION", + "CertificateLocationSecretsManager": "CERTIFICATE_LOCATION", + "CertificateLocationUnknown": "CERTIFICATE_LOCATION", + "CloudWatchFilterConfig": "CLOUD_WATCH_FILTER_CONFIG", + "CloudWatchLogsFilter": "CLOUD_WATCH_LOGS_FILTER", + "CloudWatchLogsFilterOperator": "CLOUD_WATCH_LOGS_FILTER_OPERATOR", + "CloudWatchLogsRule": "CLOUD_WATCH_LOGS_RULE", + "CloudWatchLogsSource": "CLOUD_WATCH_LOGS_SOURCE", + "CloudWatchLogsTraceConfig": "CLOUD_WATCH_LOGS_TRACE_CONFIG", + "CloudWatchOutputConfig": "CLOUD_WATCH_OUTPUT_CONFIG", + "CodeInterpreterResult": "CODE_INTERPRETER_RESULT", + "CodeInterpreterSessionStatus": "CODE_INTERPRETER_SESSION_STATUS", + "CodeInterpreterSessionSummary": "CODE_INTERPRETER_SESSION_SUMMARY", + "CodeInterpreterStreamOutput": "CODE_INTERPRETER_STREAM_OUTPUT", + "CodeInterpreterStreamOutputResult": "CODE_INTERPRETER_STREAM_OUTPUT", + "CodeInterpreterStreamOutputAccessDeniedException": "CODE_INTERPRETER_STREAM_OUTPUT", + "CodeInterpreterStreamOutputConflictException": "CODE_INTERPRETER_STREAM_OUTPUT", + "CodeInterpreterStreamOutputInternalServerException": "CODE_INTERPRETER_STREAM_OUTPUT", + "CodeInterpreterStreamOutputResourceNotFoundException": "CODE_INTERPRETER_STREAM_OUTPUT", + "CodeInterpreterStreamOutputServiceQuotaExceededException": "CODE_INTERPRETER_STREAM_OUTPUT", + "CodeInterpreterStreamOutputThrottlingException": "CODE_INTERPRETER_STREAM_OUTPUT", + "CodeInterpreterStreamOutputValidationException": "CODE_INTERPRETER_STREAM_OUTPUT", + "CodeInterpreterStreamOutputUnknown": "CODE_INTERPRETER_STREAM_OUTPUT", + "CoinbaseCdpTokenRequestInput": "COINBASE_CDP_TOKEN_REQUEST_INPUT", + "CoinbaseCdpTokenResponseOutput": "COINBASE_CDP_TOKEN_RESPONSE_OUTPUT", + "CommandExecutionStatus": "COMMAND_EXECUTION_STATUS", + "CompleteResourceTokenAuthInput": "COMPLETE_RESOURCE_TOKEN_AUTH_INPUT", + "CompleteResourceTokenAuthOutput": "COMPLETE_RESOURCE_TOKEN_AUTH_OUTPUT", + "ConfidenceInterval": "CONFIDENCE_INTERVAL", + "ConfigurationBundleRef": "CONFIGURATION_BUNDLE_REF", + "ConfigurationBundleToolEntry": "CONFIGURATION_BUNDLE_TOOL_ENTRY", + "ConflictException": "CONFLICT_EXCEPTION", + "Content": "CONTENT", + "ContentText": "CONTENT", + "ContentUnknown": "CONTENT", + "ContentBlock": "CONTENT_BLOCK", + "ContentBlockType": "CONTENT_BLOCK_TYPE", + "ContentDeltaEvent": "CONTENT_DELTA_EVENT", + "ContentSource": "CONTENT_SOURCE", + "ContentSourceInline": "CONTENT_SOURCE", + "ContentSourceUnknown": "CONTENT_SOURCE", + "ContentStartEvent": "CONTENT_START_EVENT", + "ContentStopEvent": "CONTENT_STOP_EVENT", + "Context": "CONTEXT", + "ContextSpanContext": "CONTEXT", + "ContextUnknown": "CONTEXT", + "ControlStats": "CONTROL_STATS", + "Conversational": "CONVERSATIONAL", + "CreateABTestInput": "CREATE_AB_TEST_INPUT", + "CreateABTestOutput": "CREATE_AB_TEST_OUTPUT", + "CreateEventInput": "CREATE_EVENT_INPUT", + "CreateEventOutput": "CREATE_EVENT_OUTPUT", + "CreatePaymentInstrumentInput": "CREATE_PAYMENT_INSTRUMENT_INPUT", + "CreatePaymentInstrumentOutput": "CREATE_PAYMENT_INSTRUMENT_OUTPUT", + "CreatePaymentSessionInput": "CREATE_PAYMENT_SESSION_INPUT", + "CreatePaymentSessionOutput": "CREATE_PAYMENT_SESSION_OUTPUT", + "CryptoWalletNetwork": "CRYPTO_WALLET_NETWORK", + "CryptoX402PaymentInput": "CRYPTO_X402_PAYMENT_INPUT", + "CryptoX402PaymentOutput": "CRYPTO_X402_PAYMENT_OUTPUT", + "Currency": "CURRENCY", + "CustomDescriptor": "CUSTOM_DESCRIPTOR", + "DataSourceConfig": "DATA_SOURCE_CONFIG", + "DataSourceConfigCloudWatchLogs": "DATA_SOURCE_CONFIG", + "DataSourceConfigOnlineEvaluationConfigSource": "DATA_SOURCE_CONFIG", + "DataSourceConfigUnknown": "DATA_SOURCE_CONFIG", + "DeleteABTestInput": "DELETE_AB_TEST_INPUT", + "DeleteABTestOutput": "DELETE_AB_TEST_OUTPUT", + "DeleteBatchEvaluationInput": "DELETE_BATCH_EVALUATION_INPUT", + "DeleteBatchEvaluationOutput": "DELETE_BATCH_EVALUATION_OUTPUT", + "DeleteCapacityProviderSessionInput": "DELETE_CAPACITY_PROVIDER_SESSION_INPUT", + "DeleteCapacityProviderSessionOutput": "DELETE_CAPACITY_PROVIDER_SESSION_OUTPUT", + "DeleteEventInput": "DELETE_EVENT_INPUT", + "DeleteEventOutput": "DELETE_EVENT_OUTPUT", + "DeleteMemoryRecordInput": "DELETE_MEMORY_RECORD_INPUT", + "DeleteMemoryRecordOutput": "DELETE_MEMORY_RECORD_OUTPUT", + "DeletePaymentInstrumentInput": "DELETE_PAYMENT_INSTRUMENT_INPUT", + "DeletePaymentInstrumentOutput": "DELETE_PAYMENT_INSTRUMENT_OUTPUT", + "DeletePaymentSessionInput": "DELETE_PAYMENT_SESSION_INPUT", + "DeletePaymentSessionOutput": "DELETE_PAYMENT_SESSION_OUTPUT", + "DeleteRecommendationInput": "DELETE_RECOMMENDATION_INPUT", + "DeleteRecommendationOutput": "DELETE_RECOMMENDATION_OUTPUT", + "Descriptors": "DESCRIPTORS", + "DescriptorType": "DESCRIPTOR_TYPE", + "DuplicateIdException": "DUPLICATE_ID_EXCEPTION", + "EfsConfiguration": "EFS_CONFIGURATION", + "EmbeddedCryptoWallet": "EMBEDDED_CRYPTO_WALLET", + "EvaluateInput": "EVALUATE_INPUT", + "EvaluateOutput": "EVALUATE_OUTPUT", + "EvaluationContent": "EVALUATION_CONTENT", + "EvaluationContentText": "EVALUATION_CONTENT", + "EvaluationContentUnknown": "EVALUATION_CONTENT", + "EvaluationExpectedTrajectory": "EVALUATION_EXPECTED_TRAJECTORY", + "EvaluationInput": "EVALUATION_INPUT", + "EvaluationInputSessionSpans": "EVALUATION_INPUT", + "EvaluationInputUnknown": "EVALUATION_INPUT", + "EvaluationJobResults": "EVALUATION_JOB_RESULTS", + "EvaluationMetadata": "EVALUATION_METADATA", + "EvaluationMetadataSessionMetadata": "EVALUATION_METADATA", + "EvaluationMetadataUnknown": "EVALUATION_METADATA", + "EvaluationReferenceInput": "EVALUATION_REFERENCE_INPUT", + "EvaluationResultContent": "EVALUATION_RESULT_CONTENT", + "EvaluationTarget": "EVALUATION_TARGET", + "EvaluationTargetSpanIds": "EVALUATION_TARGET", + "EvaluationTargetTraceIds": "EVALUATION_TARGET", + "EvaluationTargetUnknown": "EVALUATION_TARGET", + "Evaluator": "EVALUATOR", + "EvaluatorMetric": "EVALUATOR_METRIC", + "EvaluatorStatistics": "EVALUATOR_STATISTICS", + "EvaluatorSummary": "EVALUATOR_SUMMARY", + "Event": "EVENT", + "EventFilterCondition": "EVENT_FILTER_CONDITION", + "EventMetadataFilterExpression": "EVENT_METADATA_FILTER_EXPRESSION", + "ExecutionSummaryAffectedSession": "EXECUTION_SUMMARY_AFFECTED_SESSION", + "ExecutionSummaryCluster": "EXECUTION_SUMMARY_CLUSTER", + "ExecutionSummaryClusteringResultContent": "EXECUTION_SUMMARY_CLUSTERING_RESULT_CONTENT", + "ExternalProxy": "EXTERNAL_PROXY", + "ExtractionConfig": "EXTRACTION_CONFIG", + "ExtractionJob": "EXTRACTION_JOB", + "ExtractionJobFilterInput": "EXTRACTION_JOB_FILTER_INPUT", + "ExtractionJobMessages": "EXTRACTION_JOB_MESSAGES", + "ExtractionJobMessagesMessagesList": "EXTRACTION_JOB_MESSAGES", + "ExtractionJobMessagesUnknown": "EXTRACTION_JOB_MESSAGES", + "ExtractionJobMetadata": "EXTRACTION_JOB_METADATA", + "ExtractionJobStatus": "EXTRACTION_JOB_STATUS", + "ExtractionMode": "EXTRACTION_MODE", + "FailureAnalysisResultContent": "FAILURE_ANALYSIS_RESULT_CONTENT", + "FailureCategoryCluster": "FAILURE_CATEGORY_CLUSTER", + "FailureSpanDetail": "FAILURE_SPAN_DETAIL", + "FailureSubCategoryCluster": "FAILURE_SUB_CATEGORY_CLUSTER", + "FilterInput": "FILTER_INPUT", + "FilterValue": "FILTER_VALUE", + "FilterValueStringValue": "FILTER_VALUE", + "FilterValueDoubleValue": "FILTER_VALUE", + "FilterValueBooleanValue": "FILTER_VALUE", + "FilterValueUnknown": "FILTER_VALUE", + "GatewayFilter": "GATEWAY_FILTER", + "GetABTestInput": "GET_AB_TEST_INPUT", + "GetABTestOutput": "GET_AB_TEST_OUTPUT", + "GetAgentCardInput": "GET_AGENT_CARD_INPUT", + "GetAgentCardOutput": "GET_AGENT_CARD_OUTPUT", + "GetBatchEvaluationInput": "GET_BATCH_EVALUATION_INPUT", + "GetBatchEvaluationOutput": "GET_BATCH_EVALUATION_OUTPUT", + "GetBrowserSessionInput": "GET_BROWSER_SESSION_INPUT", + "GetBrowserSessionOutput": "GET_BROWSER_SESSION_OUTPUT", + "GetCodeInterpreterSessionInput": "GET_CODE_INTERPRETER_SESSION_INPUT", + "GetCodeInterpreterSessionOutput": "GET_CODE_INTERPRETER_SESSION_OUTPUT", + "GetEventInput": "GET_EVENT_INPUT", + "GetEventOutput": "GET_EVENT_OUTPUT", + "GetMemoryRecordInput": "GET_MEMORY_RECORD_INPUT", + "GetMemoryRecordOutput": "GET_MEMORY_RECORD_OUTPUT", + "GetPaymentInstrumentBalanceInput": "GET_PAYMENT_INSTRUMENT_BALANCE_INPUT", + "GetPaymentInstrumentBalanceOutput": "GET_PAYMENT_INSTRUMENT_BALANCE_OUTPUT", + "GetPaymentInstrumentInput": "GET_PAYMENT_INSTRUMENT_INPUT", + "GetPaymentInstrumentOutput": "GET_PAYMENT_INSTRUMENT_OUTPUT", + "GetPaymentSessionInput": "GET_PAYMENT_SESSION_INPUT", + "GetPaymentSessionOutput": "GET_PAYMENT_SESSION_OUTPUT", + "GetRecommendationInput": "GET_RECOMMENDATION_INPUT", + "GetRecommendationOutput": "GET_RECOMMENDATION_OUTPUT", + "GetResourceApiKeyInput": "GET_RESOURCE_API_KEY_INPUT", + "GetResourceApiKeyOutput": "GET_RESOURCE_API_KEY_OUTPUT", + "GetResourceOauth2TokenInput": "GET_RESOURCE_OAUTH2_TOKEN_INPUT", + "GetResourceOauth2TokenOutput": "GET_RESOURCE_OAUTH2_TOKEN_OUTPUT", + "GetResourcePaymentTokenInput": "GET_RESOURCE_PAYMENT_TOKEN_INPUT", + "GetResourcePaymentTokenOutput": "GET_RESOURCE_PAYMENT_TOKEN_OUTPUT", + "GetWorkloadAccessTokenForJWTInput": "GET_WORKLOAD_ACCESS_TOKEN_FOR_JWT_INPUT", + "GetWorkloadAccessTokenForJWTOutput": "GET_WORKLOAD_ACCESS_TOKEN_FOR_JWT_OUTPUT", + "GetWorkloadAccessTokenForUserIdInput": "GET_WORKLOAD_ACCESS_TOKEN_FOR_USER_ID_INPUT", + "GetWorkloadAccessTokenForUserIdOutput": "GET_WORKLOAD_ACCESS_TOKEN_FOR_USER_ID_OUTPUT", + "GetWorkloadAccessTokenInput": "GET_WORKLOAD_ACCESS_TOKEN_INPUT", + "GetWorkloadAccessTokenOutput": "GET_WORKLOAD_ACCESS_TOKEN_OUTPUT", + "GroundTruthSource": "GROUND_TRUTH_SOURCE", + "GroundTruthSourceInline": "GROUND_TRUTH_SOURCE", + "GroundTruthSourceUnknown": "GROUND_TRUTH_SOURCE", + "GroundTruthTurn": "GROUND_TRUTH_TURN", + "GroundTruthTurnInput": "GROUND_TRUTH_TURN_INPUT", + "GroundTruthTurnInputPrompt": "GROUND_TRUTH_TURN_INPUT", + "GroundTruthTurnInputUnknown": "GROUND_TRUTH_TURN_INPUT", + "HarnessAgentCoreBrowserConfig": "HARNESS_AGENT_CORE_BROWSER_CONFIG", + "HarnessAgentCoreCodeInterpreterConfig": "HARNESS_AGENT_CORE_CODE_INTERPRETER_CONFIG", + "HarnessAgentCoreGatewayConfig": "HARNESS_AGENT_CORE_GATEWAY_CONFIG", + "HarnessBedrockApiFormat": "HARNESS_BEDROCK_API_FORMAT", + "HarnessBedrockModelConfig": "HARNESS_BEDROCK_MODEL_CONFIG", + "HarnessContentBlock": "HARNESS_CONTENT_BLOCK", + "HarnessContentBlockText": "HARNESS_CONTENT_BLOCK", + "HarnessContentBlockToolUse": "HARNESS_CONTENT_BLOCK", + "HarnessContentBlockToolResult": "HARNESS_CONTENT_BLOCK", + "HarnessContentBlockReasoningContent": "HARNESS_CONTENT_BLOCK", + "HarnessContentBlockUnknown": "HARNESS_CONTENT_BLOCK", + "HarnessContentBlockDelta": "HARNESS_CONTENT_BLOCK_DELTA", + "HarnessContentBlockDeltaText": "HARNESS_CONTENT_BLOCK_DELTA", + "HarnessContentBlockDeltaToolUse": "HARNESS_CONTENT_BLOCK_DELTA", + "HarnessContentBlockDeltaToolResult": "HARNESS_CONTENT_BLOCK_DELTA", + "HarnessContentBlockDeltaReasoningContent": "HARNESS_CONTENT_BLOCK_DELTA", + "HarnessContentBlockDeltaToolResultMetadata": "HARNESS_CONTENT_BLOCK_DELTA", + "HarnessContentBlockDeltaUnknown": "HARNESS_CONTENT_BLOCK_DELTA", + "HarnessContentBlockDeltaEvent": "HARNESS_CONTENT_BLOCK_DELTA_EVENT", + "HarnessContentBlockStart": "HARNESS_CONTENT_BLOCK_START", + "HarnessContentBlockStartToolUse": "HARNESS_CONTENT_BLOCK_START", + "HarnessContentBlockStartToolResult": "HARNESS_CONTENT_BLOCK_START", + "HarnessContentBlockStartUnknown": "HARNESS_CONTENT_BLOCK_START", + "HarnessContentBlockStartEvent": "HARNESS_CONTENT_BLOCK_START_EVENT", + "HarnessContentBlockStopEvent": "HARNESS_CONTENT_BLOCK_STOP_EVENT", + "HarnessConversationRole": "HARNESS_CONVERSATION_ROLE", + "HarnessGatewayOutboundAuth": "HARNESS_GATEWAY_OUTBOUND_AUTH", + "HarnessGatewayOutboundAuthAwsIam": "HARNESS_GATEWAY_OUTBOUND_AUTH", + "HarnessGatewayOutboundAuthNone": "HARNESS_GATEWAY_OUTBOUND_AUTH", + "HarnessGatewayOutboundAuthOauth": "HARNESS_GATEWAY_OUTBOUND_AUTH", + "HarnessGatewayOutboundAuthUnknown": "HARNESS_GATEWAY_OUTBOUND_AUTH", + "HarnessGeminiModelConfig": "HARNESS_GEMINI_MODEL_CONFIG", + "HarnessHookDecision": "HARNESS_HOOK_DECISION", + "HarnessHookEvent": "HARNESS_HOOK_EVENT", + "HarnessHookEventType": "HARNESS_HOOK_EVENT_TYPE", + "HarnessInlineFunctionConfig": "HARNESS_INLINE_FUNCTION_CONFIG", + "HarnessLiteLlmModelConfig": "HARNESS_LITE_LLM_MODEL_CONFIG", + "HarnessMessage": "HARNESS_MESSAGE", + "HarnessMessageStartEvent": "HARNESS_MESSAGE_START_EVENT", + "HarnessMessageStopEvent": "HARNESS_MESSAGE_STOP_EVENT", + "HarnessMetadataEvent": "HARNESS_METADATA_EVENT", + "HarnessModelConfiguration": "HARNESS_MODEL_CONFIGURATION", + "HarnessModelConfigurationBedrockModelConfig": "HARNESS_MODEL_CONFIGURATION", + "HarnessModelConfigurationOpenAiModelConfig": "HARNESS_MODEL_CONFIGURATION", + "HarnessModelConfigurationGeminiModelConfig": "HARNESS_MODEL_CONFIGURATION", + "HarnessModelConfigurationLiteLlmModelConfig": "HARNESS_MODEL_CONFIGURATION", + "HarnessModelConfigurationUnknown": "HARNESS_MODEL_CONFIGURATION", + "HarnessOpenAiApiFormat": "HARNESS_OPEN_AI_API_FORMAT", + "HarnessOpenAiModelConfig": "HARNESS_OPEN_AI_MODEL_CONFIG", + "HarnessReasoningContentBlock": "HARNESS_REASONING_CONTENT_BLOCK", + "HarnessReasoningContentBlockReasoningText": "HARNESS_REASONING_CONTENT_BLOCK", + "HarnessReasoningContentBlockRedactedContent": "HARNESS_REASONING_CONTENT_BLOCK", + "HarnessReasoningContentBlockUnknown": "HARNESS_REASONING_CONTENT_BLOCK", + "HarnessReasoningContentBlockDelta": "HARNESS_REASONING_CONTENT_BLOCK_DELTA", + "HarnessReasoningContentBlockDeltaText": "HARNESS_REASONING_CONTENT_BLOCK_DELTA", + "HarnessReasoningContentBlockDeltaRedactedContent": "HARNESS_REASONING_CONTENT_BLOCK_DELTA", + "HarnessReasoningContentBlockDeltaSignature": "HARNESS_REASONING_CONTENT_BLOCK_DELTA", + "HarnessReasoningContentBlockDeltaUnknown": "HARNESS_REASONING_CONTENT_BLOCK_DELTA", + "HarnessReasoningTextBlock": "HARNESS_REASONING_TEXT_BLOCK", + "HarnessRemoteMcpConfig": "HARNESS_REMOTE_MCP_CONFIG", + "HarnessSkill": "HARNESS_SKILL", + "HarnessSkillPath": "HARNESS_SKILL", + "HarnessSkillS3": "HARNESS_SKILL", + "HarnessSkillGit": "HARNESS_SKILL", + "HarnessSkillAwsSkills": "HARNESS_SKILL", + "HarnessSkillUnknown": "HARNESS_SKILL", + "HarnessSkillAwsSkillsSource": "HARNESS_SKILL_AWS_SKILLS_SOURCE", + "HarnessSkillGitAuth": "HARNESS_SKILL_GIT_AUTH", + "HarnessSkillGitSource": "HARNESS_SKILL_GIT_SOURCE", + "HarnessSkillS3Source": "HARNESS_SKILL_S3_SOURCE", + "HarnessStopReason": "HARNESS_STOP_REASON", + "HarnessStreamMetrics": "HARNESS_STREAM_METRICS", + "HarnessSystemContentBlock": "HARNESS_SYSTEM_CONTENT_BLOCK", + "HarnessSystemContentBlockText": "HARNESS_SYSTEM_CONTENT_BLOCK", + "HarnessSystemContentBlockUnknown": "HARNESS_SYSTEM_CONTENT_BLOCK", + "HarnessTokenUsage": "HARNESS_TOKEN_USAGE", + "HarnessTool": "HARNESS_TOOL", + "HarnessToolConfiguration": "HARNESS_TOOL_CONFIGURATION", + "HarnessToolConfigurationRemoteMcp": "HARNESS_TOOL_CONFIGURATION", + "HarnessToolConfigurationAgentCoreBrowser": "HARNESS_TOOL_CONFIGURATION", + "HarnessToolConfigurationAgentCoreGateway": "HARNESS_TOOL_CONFIGURATION", + "HarnessToolConfigurationInlineFunction": "HARNESS_TOOL_CONFIGURATION", + "HarnessToolConfigurationAgentCoreCodeInterpreter": "HARNESS_TOOL_CONFIGURATION", + "HarnessToolConfigurationUnknown": "HARNESS_TOOL_CONFIGURATION", + "HarnessToolResultBlock": "HARNESS_TOOL_RESULT_BLOCK", + "HarnessToolResultBlockDelta": "HARNESS_TOOL_RESULT_BLOCK_DELTA", + "HarnessToolResultBlockDeltaText": "HARNESS_TOOL_RESULT_BLOCK_DELTA", + "HarnessToolResultBlockDeltaJson": "HARNESS_TOOL_RESULT_BLOCK_DELTA", + "HarnessToolResultBlockDeltaUnknown": "HARNESS_TOOL_RESULT_BLOCK_DELTA", + "HarnessToolResultBlockStart": "HARNESS_TOOL_RESULT_BLOCK_START", + "HarnessToolResultContentBlock": "HARNESS_TOOL_RESULT_CONTENT_BLOCK", + "HarnessToolResultContentBlockText": "HARNESS_TOOL_RESULT_CONTENT_BLOCK", + "HarnessToolResultContentBlockJson": "HARNESS_TOOL_RESULT_CONTENT_BLOCK", + "HarnessToolResultContentBlockUnknown": "HARNESS_TOOL_RESULT_CONTENT_BLOCK", + "HarnessToolResultMetadataBlockDelta": "HARNESS_TOOL_RESULT_METADATA_BLOCK_DELTA", + "HarnessToolType": "HARNESS_TOOL_TYPE", + "HarnessToolUseBlock": "HARNESS_TOOL_USE_BLOCK", + "HarnessToolUseBlockDelta": "HARNESS_TOOL_USE_BLOCK_DELTA", + "HarnessToolUseBlockStart": "HARNESS_TOOL_USE_BLOCK_START", + "HarnessToolUseStatus": "HARNESS_TOOL_USE_STATUS", + "HarnessToolUseType": "HARNESS_TOOL_USE_TYPE", + "IngestDataInput": "INGEST_DATA_INPUT", + "IngestDataOutput": "INGEST_DATA_OUTPUT", + "IngestPayloadType": "INGEST_PAYLOAD_TYPE", + "IngestPayloadTypeConversational": "INGEST_PAYLOAD_TYPE", + "IngestPayloadTypeJson": "INGEST_PAYLOAD_TYPE", + "IngestPayloadTypeUnknown": "INGEST_PAYLOAD_TYPE", + "InlineGroundTruth": "INLINE_GROUND_TRUTH", + "InlineMemoryContent": "INLINE_MEMORY_CONTENT", + "InputContentBlock": "INPUT_CONTENT_BLOCK", + "Insight": "INSIGHT", + "InsightsFailureCategory": "INSIGHTS_FAILURE_CATEGORY", + "InsightsFailureSignal": "INSIGHTS_FAILURE_SIGNAL", + "InstrumentBalanceToken": "INSTRUMENT_BALANCE_TOKEN", + "InternalServerException": "INTERNAL_SERVER_EXCEPTION", + "InvalidInputException": "INVALID_INPUT_EXCEPTION", + "InvokeAgentRuntimeCommandInput": "INVOKE_AGENT_RUNTIME_COMMAND_INPUT", + "InvokeAgentRuntimeCommandOutput": "INVOKE_AGENT_RUNTIME_COMMAND_OUTPUT", + "InvokeAgentRuntimeCommandRequestBody": "INVOKE_AGENT_RUNTIME_COMMAND_REQUEST_BODY", + "InvokeAgentRuntimeCommandStreamOutput": "INVOKE_AGENT_RUNTIME_COMMAND_STREAM_OUTPUT", + "InvokeAgentRuntimeCommandStreamOutputChunk": "INVOKE_AGENT_RUNTIME_COMMAND_STREAM_OUTPUT", + "InvokeAgentRuntimeCommandStreamOutputAccessDeniedException": "INVOKE_AGENT_RUNTIME_COMMAND_STREAM_OUTPUT", + "InvokeAgentRuntimeCommandStreamOutputInternalServerException": "INVOKE_AGENT_RUNTIME_COMMAND_STREAM_OUTPUT", + "InvokeAgentRuntimeCommandStreamOutputResourceNotFoundException": "INVOKE_AGENT_RUNTIME_COMMAND_STREAM_OUTPUT", + "InvokeAgentRuntimeCommandStreamOutputServiceQuotaExceededException": "INVOKE_AGENT_RUNTIME_COMMAND_STREAM_OUTPUT", + "InvokeAgentRuntimeCommandStreamOutputThrottlingException": "INVOKE_AGENT_RUNTIME_COMMAND_STREAM_OUTPUT", + "InvokeAgentRuntimeCommandStreamOutputValidationException": "INVOKE_AGENT_RUNTIME_COMMAND_STREAM_OUTPUT", + "InvokeAgentRuntimeCommandStreamOutputRuntimeClientError": "INVOKE_AGENT_RUNTIME_COMMAND_STREAM_OUTPUT", + "InvokeAgentRuntimeCommandStreamOutputUnknown": "INVOKE_AGENT_RUNTIME_COMMAND_STREAM_OUTPUT", + "InvokeAgentRuntimeInput": "INVOKE_AGENT_RUNTIME_INPUT", + "InvokeAgentRuntimeOutput": "INVOKE_AGENT_RUNTIME_OUTPUT", + "InvokeBrowserInput": "INVOKE_BROWSER_INPUT", + "InvokeBrowserOutput": "INVOKE_BROWSER_OUTPUT", + "InvokeCodeInterpreterInput": "INVOKE_CODE_INTERPRETER_INPUT", + "InvokeCodeInterpreterOutput": "INVOKE_CODE_INTERPRETER_OUTPUT", + "InvokeHarnessInput": "INVOKE_HARNESS_INPUT", + "InvokeHarnessOutput": "INVOKE_HARNESS_OUTPUT", + "InvokeHarnessStreamOutput": "INVOKE_HARNESS_STREAM_OUTPUT", + "InvokeHarnessStreamOutputMessageStart": "INVOKE_HARNESS_STREAM_OUTPUT", + "InvokeHarnessStreamOutputContentBlockStart": "INVOKE_HARNESS_STREAM_OUTPUT", + "InvokeHarnessStreamOutputContentBlockDelta": "INVOKE_HARNESS_STREAM_OUTPUT", + "InvokeHarnessStreamOutputContentBlockStop": "INVOKE_HARNESS_STREAM_OUTPUT", + "InvokeHarnessStreamOutputMessageStop": "INVOKE_HARNESS_STREAM_OUTPUT", + "InvokeHarnessStreamOutputMetadata": "INVOKE_HARNESS_STREAM_OUTPUT", + "InvokeHarnessStreamOutputInternalServerException": "INVOKE_HARNESS_STREAM_OUTPUT", + "InvokeHarnessStreamOutputValidationException": "INVOKE_HARNESS_STREAM_OUTPUT", + "InvokeHarnessStreamOutputRuntimeClientError": "INVOKE_HARNESS_STREAM_OUTPUT", + "InvokeHarnessStreamOutputHookEvent": "INVOKE_HARNESS_STREAM_OUTPUT", + "InvokeHarnessStreamOutputUnknown": "INVOKE_HARNESS_STREAM_OUTPUT", + "KeyPressArguments": "KEY_PRESS_ARGUMENTS", + "KeyPressResult": "KEY_PRESS_RESULT", + "KeyShortcutArguments": "KEY_SHORTCUT_ARGUMENTS", + "KeyShortcutResult": "KEY_SHORTCUT_RESULT", + "KeyTypeArguments": "KEY_TYPE_ARGUMENTS", + "KeyTypeResult": "KEY_TYPE_RESULT", + "LanguageRuntime": "LANGUAGE_RUNTIME", + "LeftExpression": "LEFT_EXPRESSION", + "LeftExpressionMetadataKey": "LEFT_EXPRESSION", + "LeftExpressionUnknown": "LEFT_EXPRESSION", + "LinkedAccount": "LINKED_ACCOUNT", + "LinkedAccount_Email": "LINKED_ACCOUNT", + "LinkedAccount_Sms": "LINKED_ACCOUNT", + "LinkedAccount_DeveloperJwt": "LINKED_ACCOUNT", + "LinkedAccount_OAuth2": "LINKED_ACCOUNT", + "LinkedAccountUnknown": "LINKED_ACCOUNT", + "LinkedAccountDeveloperJwt": "LINKED_ACCOUNT_DEVELOPER_JWT", + "LinkedAccountEmail": "LINKED_ACCOUNT_EMAIL", + "LinkedAccountOAuth2": "LINKED_ACCOUNT_O_AUTH2", + "LinkedAccountOAuth2Google": "LINKED_ACCOUNT_O_AUTH2", + "LinkedAccountOAuth2Apple": "LINKED_ACCOUNT_O_AUTH2", + "LinkedAccountOAuth2X": "LINKED_ACCOUNT_O_AUTH2", + "LinkedAccountOAuth2Telegram": "LINKED_ACCOUNT_O_AUTH2", + "LinkedAccountOAuth2Github": "LINKED_ACCOUNT_O_AUTH2", + "LinkedAccountOAuth2Unknown": "LINKED_ACCOUNT_O_AUTH2", + "LinkedAccountSms": "LINKED_ACCOUNT_SMS", + "ListABTestsInput": "LIST_AB_TESTS_INPUT", + "ListABTestsOutput": "LIST_AB_TESTS_OUTPUT", + "ListActorsInput": "LIST_ACTORS_INPUT", + "ListActorsOutput": "LIST_ACTORS_OUTPUT", + "ListBatchEvaluationsInput": "LIST_BATCH_EVALUATIONS_INPUT", + "ListBatchEvaluationsOutput": "LIST_BATCH_EVALUATIONS_OUTPUT", + "ListBrowserSessionsInput": "LIST_BROWSER_SESSIONS_INPUT", + "ListBrowserSessionsOutput": "LIST_BROWSER_SESSIONS_OUTPUT", + "ListCodeInterpreterSessionsInput": "LIST_CODE_INTERPRETER_SESSIONS_INPUT", + "ListCodeInterpreterSessionsOutput": "LIST_CODE_INTERPRETER_SESSIONS_OUTPUT", + "ListEventsInput": "LIST_EVENTS_INPUT", + "ListEventsOutput": "LIST_EVENTS_OUTPUT", + "ListMemoryExtractionJobsInput": "LIST_MEMORY_EXTRACTION_JOBS_INPUT", + "ListMemoryExtractionJobsOutput": "LIST_MEMORY_EXTRACTION_JOBS_OUTPUT", + "ListMemoryRecordsInput": "LIST_MEMORY_RECORDS_INPUT", + "ListMemoryRecordsOutput": "LIST_MEMORY_RECORDS_OUTPUT", + "ListPaymentInstrumentsInput": "LIST_PAYMENT_INSTRUMENTS_INPUT", + "ListPaymentInstrumentsOutput": "LIST_PAYMENT_INSTRUMENTS_OUTPUT", + "ListPaymentSessionsInput": "LIST_PAYMENT_SESSIONS_INPUT", + "ListPaymentSessionsOutput": "LIST_PAYMENT_SESSIONS_OUTPUT", + "ListRecommendationsInput": "LIST_RECOMMENDATIONS_INPUT", + "ListRecommendationsOutput": "LIST_RECOMMENDATIONS_OUTPUT", + "ListSessionsInput": "LIST_SESSIONS_INPUT", + "ListSessionsOutput": "LIST_SESSIONS_OUTPUT", + "LiveViewStream": "LIVE_VIEW_STREAM", + "McpDescriptor": "MCP_DESCRIPTOR", + "MemoryContent": "MEMORY_CONTENT", + "MemoryContentText": "MEMORY_CONTENT", + "MemoryContentUnknown": "MEMORY_CONTENT", + "MemoryJsonData": "MEMORY_JSON_DATA", + "MemoryMetadataFilterExpression": "MEMORY_METADATA_FILTER_EXPRESSION", + "MemoryRecord": "MEMORY_RECORD", + "MemoryRecordCreateInput": "MEMORY_RECORD_CREATE_INPUT", + "MemoryRecordDeleteInput": "MEMORY_RECORD_DELETE_INPUT", + "MemoryRecordLeftExpression": "MEMORY_RECORD_LEFT_EXPRESSION", + "MemoryRecordLeftExpressionMetadataKey": "MEMORY_RECORD_LEFT_EXPRESSION", + "MemoryRecordLeftExpressionUnknown": "MEMORY_RECORD_LEFT_EXPRESSION", + "MemoryRecordMetadataValue": "MEMORY_RECORD_METADATA_VALUE", + "MemoryRecordMetadataValueStringValue": "MEMORY_RECORD_METADATA_VALUE", + "MemoryRecordMetadataValueStringListValue": "MEMORY_RECORD_METADATA_VALUE", + "MemoryRecordMetadataValueNumberValue": "MEMORY_RECORD_METADATA_VALUE", + "MemoryRecordMetadataValueDateTimeValue": "MEMORY_RECORD_METADATA_VALUE", + "MemoryRecordMetadataValueUnknown": "MEMORY_RECORD_METADATA_VALUE", + "MemoryRecordOperatorType": "MEMORY_RECORD_OPERATOR_TYPE", + "MemoryRecordOutput": "MEMORY_RECORD_OUTPUT", + "MemoryRecordRightExpression": "MEMORY_RECORD_RIGHT_EXPRESSION", + "MemoryRecordRightExpressionMetadataValue": "MEMORY_RECORD_RIGHT_EXPRESSION", + "MemoryRecordRightExpressionUnknown": "MEMORY_RECORD_RIGHT_EXPRESSION", + "MemoryRecordStatus": "MEMORY_RECORD_STATUS", + "MemoryRecordSummary": "MEMORY_RECORD_SUMMARY", + "MemoryRecordUpdateInput": "MEMORY_RECORD_UPDATE_INPUT", + "MessageMetadata": "MESSAGE_METADATA", + "MetadataValue": "METADATA_VALUE", + "MetadataValueStringValue": "METADATA_VALUE", + "MetadataValueUnknown": "METADATA_VALUE", + "MouseButton": "MOUSE_BUTTON", + "MouseClickArguments": "MOUSE_CLICK_ARGUMENTS", + "MouseClickResult": "MOUSE_CLICK_RESULT", + "MouseDragArguments": "MOUSE_DRAG_ARGUMENTS", + "MouseDragResult": "MOUSE_DRAG_RESULT", + "MouseMoveArguments": "MOUSE_MOVE_ARGUMENTS", + "MouseMoveResult": "MOUSE_MOVE_RESULT", + "MouseScrollArguments": "MOUSE_SCROLL_ARGUMENTS", + "MouseScrollResult": "MOUSE_SCROLL_RESULT", + "MppPaymentInput": "MPP_PAYMENT_INPUT", + "MppPaymentOutput": "MPP_PAYMENT_OUTPUT", + "OAuth2Authentication": "O_AUTH2_AUTHENTICATION", + "Oauth2FlowType": "OAUTH2_FLOW_TYPE", + "OAuthCredentialProvider": "O_AUTH_CREDENTIAL_PROVIDER", + "OAuthGrantType": "O_AUTH_GRANT_TYPE", + "OnlineEvaluationConfigSource": "ONLINE_EVALUATION_CONFIG_SOURCE", + "OnlineEvaluationTraceConfig": "ONLINE_EVALUATION_TRACE_CONFIG", + "OperatorType": "OPERATOR_TYPE", + "OutputConfig": "OUTPUT_CONFIG", + "OutputConfigCloudWatchConfig": "OUTPUT_CONFIG", + "OutputConfigUnknown": "OUTPUT_CONFIG", + "PayloadType": "PAYLOAD_TYPE", + "PayloadTypeConversational": "PAYLOAD_TYPE", + "PayloadTypeBlob": "PAYLOAD_TYPE", + "PayloadTypeJson": "PAYLOAD_TYPE", + "PayloadTypeUnknown": "PAYLOAD_TYPE", + "PaymentHttpMethodType": "PAYMENT_HTTP_METHOD_TYPE", + "PaymentInput": "PAYMENT_INPUT", + "PaymentInputCryptoX402": "PAYMENT_INPUT", + "PaymentInputMpp": "PAYMENT_INPUT", + "PaymentInputUnknown": "PAYMENT_INPUT", + "PaymentInstrument": "PAYMENT_INSTRUMENT", + "PaymentInstrumentDetails": "PAYMENT_INSTRUMENT_DETAILS", + "PaymentInstrumentDetailsEmbeddedCryptoWallet": "PAYMENT_INSTRUMENT_DETAILS", + "PaymentInstrumentDetailsUnknown": "PAYMENT_INSTRUMENT_DETAILS", + "PaymentInstrumentStatus": "PAYMENT_INSTRUMENT_STATUS", + "PaymentInstrumentSummary": "PAYMENT_INSTRUMENT_SUMMARY", + "PaymentInstrumentType": "PAYMENT_INSTRUMENT_TYPE", + "PaymentOutput": "PAYMENT_OUTPUT", + "PaymentOutputCryptoX402": "PAYMENT_OUTPUT", + "PaymentOutputMpp": "PAYMENT_OUTPUT", + "PaymentOutputUnknown": "PAYMENT_OUTPUT", + "PaymentSession": "PAYMENT_SESSION", + "PaymentSessionStatus": "PAYMENT_SESSION_STATUS", + "PaymentSessionSummary": "PAYMENT_SESSION_SUMMARY", + "PaymentStatus": "PAYMENT_STATUS", + "PaymentTokenRequestInput": "PAYMENT_TOKEN_REQUEST_INPUT", + "PaymentTokenRequestInputCoinbaseCdpTokenRequest": "PAYMENT_TOKEN_REQUEST_INPUT", + "PaymentTokenRequestInputStripePrivyTokenRequest": "PAYMENT_TOKEN_REQUEST_INPUT", + "PaymentTokenRequestInputUnknown": "PAYMENT_TOKEN_REQUEST_INPUT", + "PaymentTokenResponseOutput": "PAYMENT_TOKEN_RESPONSE_OUTPUT", + "PaymentTokenResponseOutputCoinbaseCdpTokenResponse": "PAYMENT_TOKEN_RESPONSE_OUTPUT", + "PaymentTokenResponseOutputStripePrivyTokenResponse": "PAYMENT_TOKEN_RESPONSE_OUTPUT", + "PaymentTokenResponseOutputUnknown": "PAYMENT_TOKEN_RESPONSE_OUTPUT", + "PaymentType": "PAYMENT_TYPE", + "PerVariantOnlineEvaluationConfig": "PER_VARIANT_ONLINE_EVALUATION_CONFIG", + "ProcessPaymentInput": "PROCESS_PAYMENT_INPUT", + "ProcessPaymentOutput": "PROCESS_PAYMENT_OUTPUT", + "ProgrammingLanguage": "PROGRAMMING_LANGUAGE", + "Proxy": "PROXY", + "ProxyExternalProxy": "PROXY", + "ProxyUnknown": "PROXY", + "ProxyBypass": "PROXY_BYPASS", + "ProxyConfiguration": "PROXY_CONFIGURATION", + "ProxyCredentials": "PROXY_CREDENTIALS", + "ProxyCredentialsBasicAuth": "PROXY_CREDENTIALS", + "ProxyCredentialsUnknown": "PROXY_CREDENTIALS", + "RecommendationConfig": "RECOMMENDATION_CONFIG", + "RecommendationConfigSystemPromptRecommendationConfig": "RECOMMENDATION_CONFIG", + "RecommendationConfigToolDescriptionRecommendationConfig": "RECOMMENDATION_CONFIG", + "RecommendationConfigUnknown": "RECOMMENDATION_CONFIG", + "RecommendationEvaluationConfig": "RECOMMENDATION_EVALUATION_CONFIG", + "RecommendationEvaluatorReference": "RECOMMENDATION_EVALUATOR_REFERENCE", + "RecommendationResult": "RECOMMENDATION_RESULT", + "RecommendationResultSystemPromptRecommendationResult": "RECOMMENDATION_RESULT", + "RecommendationResultToolDescriptionRecommendationResult": "RECOMMENDATION_RESULT", + "RecommendationResultUnknown": "RECOMMENDATION_RESULT", + "RecommendationResultConfigurationBundle": "RECOMMENDATION_RESULT_CONFIGURATION_BUNDLE", + "RecommendationStatus": "RECOMMENDATION_STATUS", + "RecommendationSummary": "RECOMMENDATION_SUMMARY", + "RecommendationType": "RECOMMENDATION_TYPE", + "RegistryRecordStatus": "REGISTRY_RECORD_STATUS", + "RegistryRecordSummary": "REGISTRY_RECORD_SUMMARY", + "ResourceContent": "RESOURCE_CONTENT", + "ResourceContentType": "RESOURCE_CONTENT_TYPE", + "ResourceLocation": "RESOURCE_LOCATION", + "ResourceLocationS3": "RESOURCE_LOCATION", + "ResourceLocationUnknown": "RESOURCE_LOCATION", + "ResourceNotFoundException": "RESOURCE_NOT_FOUND_EXCEPTION", + "ResponseChunk": "RESPONSE_CHUNK", + "ResultDestination": "RESULT_DESTINATION", + "RetrieveMemoryRecordsInput": "RETRIEVE_MEMORY_RECORDS_INPUT", + "RetrieveMemoryRecordsOutput": "RETRIEVE_MEMORY_RECORDS_OUTPUT", + "RetryableConflictException": "RETRYABLE_CONFLICT_EXCEPTION", + "RightExpression": "RIGHT_EXPRESSION", + "RightExpressionMetadataValue": "RIGHT_EXPRESSION", + "RightExpressionUnknown": "RIGHT_EXPRESSION", + "Role": "ROLE", + "RootCauseCluster": "ROOT_CAUSE_CLUSTER", + "RuntimeClientError": "RUNTIME_CLIENT_ERROR", + "S3FilesConfiguration": "S3_FILES_CONFIGURATION", + "S3Location": "S3_LOCATION", + "SaveBrowserSessionProfileInput": "SAVE_BROWSER_SESSION_PROFILE_INPUT", + "SaveBrowserSessionProfileOutput": "SAVE_BROWSER_SESSION_PROFILE_OUTPUT", + "ScreenshotArguments": "SCREENSHOT_ARGUMENTS", + "ScreenshotFormat": "SCREENSHOT_FORMAT", + "ScreenshotResult": "SCREENSHOT_RESULT", + "SearchCriteria": "SEARCH_CRITERIA", + "SearchRegistryRecordsInput": "SEARCH_REGISTRY_RECORDS_INPUT", + "SearchRegistryRecordsOutput": "SEARCH_REGISTRY_RECORDS_OUTPUT", + "SecretsManagerLocation": "SECRETS_MANAGER_LOCATION", + "ServerDefinition": "SERVER_DEFINITION", + "ServiceException": "SERVICE_EXCEPTION", + "ServiceQuotaExceededException": "SERVICE_QUOTA_EXCEEDED_EXCEPTION", + "SessionFilter": "SESSION_FILTER", + "SessionFilterConfig": "SESSION_FILTER_CONFIG", + "SessionLimits": "SESSION_LIMITS", + "SessionMetadataShape": "SESSION_METADATA_SHAPE", + "SessionStatus": "SESSION_STATUS", + "SessionSummary": "SESSION_SUMMARY", + "SessionTraceIds": "SESSION_TRACE_IDS", + "SkillDefinition": "SKILL_DEFINITION", + "SkillMdDefinition": "SKILL_MD_DEFINITION", + "SpanContext": "SPAN_CONTEXT", + "StartBatchEvaluationInput": "START_BATCH_EVALUATION_INPUT", + "StartBatchEvaluationOutput": "START_BATCH_EVALUATION_OUTPUT", + "StartBrowserSessionInput": "START_BROWSER_SESSION_INPUT", + "StartBrowserSessionOutput": "START_BROWSER_SESSION_OUTPUT", + "StartCodeInterpreterSessionInput": "START_CODE_INTERPRETER_SESSION_INPUT", + "StartCodeInterpreterSessionOutput": "START_CODE_INTERPRETER_SESSION_OUTPUT", + "StartMemoryExtractionJobInput": "START_MEMORY_EXTRACTION_JOB_INPUT", + "StartMemoryExtractionJobOutput": "START_MEMORY_EXTRACTION_JOB_OUTPUT", + "StartRecommendationInput": "START_RECOMMENDATION_INPUT", + "StartRecommendationOutput": "START_RECOMMENDATION_OUTPUT", + "StopBatchEvaluationInput": "STOP_BATCH_EVALUATION_INPUT", + "StopBatchEvaluationOutput": "STOP_BATCH_EVALUATION_OUTPUT", + "StopBrowserSessionInput": "STOP_BROWSER_SESSION_INPUT", + "StopBrowserSessionOutput": "STOP_BROWSER_SESSION_OUTPUT", + "StopCodeInterpreterSessionInput": "STOP_CODE_INTERPRETER_SESSION_INPUT", + "StopCodeInterpreterSessionOutput": "STOP_CODE_INTERPRETER_SESSION_OUTPUT", + "StopRuntimeSessionInput": "STOP_RUNTIME_SESSION_INPUT", + "StopRuntimeSessionOutput": "STOP_RUNTIME_SESSION_OUTPUT", + "StreamUpdate": "STREAM_UPDATE", + "StreamUpdateAutomationStreamUpdate": "STREAM_UPDATE", + "StreamUpdateUnknown": "STREAM_UPDATE", + "StripePrivyTokenRequestInput": "STRIPE_PRIVY_TOKEN_REQUEST_INPUT", + "StripePrivyTokenResponseOutput": "STRIPE_PRIVY_TOKEN_RESPONSE_OUTPUT", + "SubscriptionRequiredException": "SUBSCRIPTION_REQUIRED_EXCEPTION", + "SystemPromptConfig": "SYSTEM_PROMPT_CONFIG", + "SystemPromptConfigText": "SYSTEM_PROMPT_CONFIG", + "SystemPromptConfigConfigurationBundle": "SYSTEM_PROMPT_CONFIG", + "SystemPromptConfigUnknown": "SYSTEM_PROMPT_CONFIG", + "SystemPromptConfigurationBundle": "SYSTEM_PROMPT_CONFIGURATION_BUNDLE", + "SystemPromptRecommendationConfig": "SYSTEM_PROMPT_RECOMMENDATION_CONFIG", + "SystemPromptRecommendationResult": "SYSTEM_PROMPT_RECOMMENDATION_RESULT", + "TargetRef": "TARGET_REF", + "TaskStatus": "TASK_STATUS", + "ThrottledException": "THROTTLED_EXCEPTION", + "ThrottlingException": "THROTTLING_EXCEPTION", + "TokenBalance": "TOKEN_BALANCE", + "TokenUsage": "TOKEN_USAGE", + "ToolArguments": "TOOL_ARGUMENTS", + "ToolDescriptionConfig": "TOOL_DESCRIPTION_CONFIG", + "ToolDescriptionConfigText": "TOOL_DESCRIPTION_CONFIG", + "ToolDescriptionConfigUnknown": "TOOL_DESCRIPTION_CONFIG", + "ToolDescriptionConfigurationBundle": "TOOL_DESCRIPTION_CONFIGURATION_BUNDLE", + "ToolDescriptionInput": "TOOL_DESCRIPTION_INPUT", + "ToolDescriptionOutput": "TOOL_DESCRIPTION_OUTPUT", + "ToolDescriptionRecommendationConfig": "TOOL_DESCRIPTION_RECOMMENDATION_CONFIG", + "ToolDescriptionRecommendationResult": "TOOL_DESCRIPTION_RECOMMENDATION_RESULT", + "ToolDescriptionSource": "TOOL_DESCRIPTION_SOURCE", + "ToolDescriptionSourceToolDescriptionText": "TOOL_DESCRIPTION_SOURCE", + "ToolDescriptionSourceConfigurationBundle": "TOOL_DESCRIPTION_SOURCE", + "ToolDescriptionSourceUnknown": "TOOL_DESCRIPTION_SOURCE", + "ToolDescriptionTextInput": "TOOL_DESCRIPTION_TEXT_INPUT", + "ToolName": "TOOL_NAME", + "ToolResultStructuredContent": "TOOL_RESULT_STRUCTURED_CONTENT", + "ToolsDefinition": "TOOLS_DEFINITION", + "ToolsFileSystemConfiguration": "TOOLS_FILE_SYSTEM_CONFIGURATION", + "ToolsFileSystemConfigurationS3FilesConfiguration": "TOOLS_FILE_SYSTEM_CONFIGURATION", + "ToolsFileSystemConfigurationEfsConfiguration": "TOOLS_FILE_SYSTEM_CONFIGURATION", + "ToolsFileSystemConfigurationUnknown": "TOOLS_FILE_SYSTEM_CONFIGURATION", + "UnauthorizedException": "UNAUTHORIZED_EXCEPTION", + "UpdateABTestInput": "UPDATE_AB_TEST_INPUT", + "UpdateABTestOutput": "UPDATE_AB_TEST_OUTPUT", + "UpdateBrowserStreamInput": "UPDATE_BROWSER_STREAM_INPUT", + "UpdateBrowserStreamOutput": "UPDATE_BROWSER_STREAM_OUTPUT", + "UserIdentifier": "USER_IDENTIFIER", + "UserIdentifierUserToken": "USER_IDENTIFIER", + "UserIdentifierUserId": "USER_IDENTIFIER", + "UserIdentifierUnknown": "USER_IDENTIFIER", + "UserIntentAffectedSession": "USER_INTENT_AFFECTED_SESSION", + "UserIntentCluster": "USER_INTENT_CLUSTER", + "UserIntentClusteringResultContent": "USER_INTENT_CLUSTERING_RESULT_CONTENT", + "ValidationException": "VALIDATION_EXCEPTION", + "ValidationExceptionField": "VALIDATION_EXCEPTION_FIELD", + "ValidationExceptionReason": "VALIDATION_EXCEPTION_REASON", + "Variant": "VARIANT", + "VariantConfiguration": "VARIANT_CONFIGURATION", + "VariantResult": "VARIANT_RESULT", + "ViewPort": "VIEW_PORT", + }, + shape_names=frozenset( + { + "A2aDescriptor", + "ABTestEvaluationConfig", + "ABTestExecutionStatus", + "ABTestResults", + "ABTestStatus", + "ABTestSummary", + "AccessDeniedException", + "ActorSummary", + "AffectedSession", + "AgentCardDefinition", + "AgentSkillsDescriptor", + "AgentTracesConfig", + "Amount", + "AutomationStream", + "AutomationStreamStatus", + "AutomationStreamUpdate", + "AvailableLimits", + "BasicAuth", + "BatchCreateMemoryRecordsInput", + "BatchCreateMemoryRecordsOutput", + "BatchDeleteMemoryRecordsInput", + "BatchDeleteMemoryRecordsOutput", + "BatchEvaluationStatus", + "BatchEvaluationSummary", + "BatchEvaluationTraceConfig", + "BatchUpdateMemoryRecordsInput", + "BatchUpdateMemoryRecordsOutput", + "BlockchainChainId", + "Branch", + "BranchFilter", + "BrowserAction", + "BrowserActionResult", + "BrowserActionStatus", + "BrowserEnterprisePolicy", + "BrowserEnterprisePolicyType", + "BrowserExtension", + "BrowserProfileConfiguration", + "BrowserSessionStatus", + "BrowserSessionStream", + "BrowserSessionSummary", + "CapacityProviderSessionStatus", + "Certificate", + "CertificateLocation", + "CloudWatchFilterConfig", + "CloudWatchLogsFilter", + "CloudWatchLogsFilterOperator", + "CloudWatchLogsRule", + "CloudWatchLogsSource", + "CloudWatchLogsTraceConfig", + "CloudWatchOutputConfig", + "CodeInterpreterResult", + "CodeInterpreterSessionStatus", + "CodeInterpreterSessionSummary", + "CodeInterpreterStreamOutput", + "CoinbaseCdpTokenRequestInput", + "CoinbaseCdpTokenResponseOutput", + "CommandExecutionStatus", + "CompleteResourceTokenAuthInput", + "CompleteResourceTokenAuthOutput", + "ConfidenceInterval", + "ConfigurationBundleRef", + "ConfigurationBundleToolEntry", + "ConflictException", + "Content", + "ContentBlock", + "ContentBlockType", + "ContentDeltaEvent", + "ContentSource", + "ContentStartEvent", + "ContentStopEvent", + "Context", + "ControlStats", + "Conversational", + "CreateABTestInput", + "CreateABTestOutput", + "CreateEventInput", + "CreateEventOutput", + "CreatePaymentInstrumentInput", + "CreatePaymentInstrumentOutput", + "CreatePaymentSessionInput", + "CreatePaymentSessionOutput", + "CryptoWalletNetwork", + "CryptoX402PaymentInput", + "CryptoX402PaymentOutput", + "Currency", + "CustomDescriptor", + "DataSourceConfig", + "DeleteABTestInput", + "DeleteABTestOutput", + "DeleteBatchEvaluationInput", + "DeleteBatchEvaluationOutput", + "DeleteCapacityProviderSessionInput", + "DeleteCapacityProviderSessionOutput", + "DeleteEventInput", + "DeleteEventOutput", + "DeleteMemoryRecordInput", + "DeleteMemoryRecordOutput", + "DeletePaymentInstrumentInput", + "DeletePaymentInstrumentOutput", + "DeletePaymentSessionInput", + "DeletePaymentSessionOutput", + "DeleteRecommendationInput", + "DeleteRecommendationOutput", + "DescriptorType", + "Descriptors", + "DuplicateIdException", + "EfsConfiguration", + "EmbeddedCryptoWallet", + "EvaluateInput", + "EvaluateOutput", + "EvaluationContent", + "EvaluationExpectedTrajectory", + "EvaluationInput", + "EvaluationJobResults", + "EvaluationMetadata", + "EvaluationReferenceInput", + "EvaluationResultContent", + "EvaluationTarget", + "Evaluator", + "EvaluatorMetric", + "EvaluatorStatistics", + "EvaluatorSummary", + "Event", + "EventFilterCondition", + "EventMetadataFilterExpression", + "ExecutionSummaryAffectedSession", + "ExecutionSummaryCluster", + "ExecutionSummaryClusteringResultContent", + "ExternalProxy", + "ExtractionConfig", + "ExtractionJob", + "ExtractionJobFilterInput", + "ExtractionJobMessages", + "ExtractionJobMetadata", + "ExtractionJobStatus", + "ExtractionMode", + "FailureAnalysisResultContent", + "FailureCategoryCluster", + "FailureSpanDetail", + "FailureSubCategoryCluster", + "FilterInput", + "FilterValue", + "GatewayFilter", + "GetABTestInput", + "GetABTestOutput", + "GetAgentCardInput", + "GetAgentCardOutput", + "GetBatchEvaluationInput", + "GetBatchEvaluationOutput", + "GetBrowserSessionInput", + "GetBrowserSessionOutput", + "GetCodeInterpreterSessionInput", + "GetCodeInterpreterSessionOutput", + "GetEventInput", + "GetEventOutput", + "GetMemoryRecordInput", + "GetMemoryRecordOutput", + "GetPaymentInstrumentBalanceInput", + "GetPaymentInstrumentBalanceOutput", + "GetPaymentInstrumentInput", + "GetPaymentInstrumentOutput", + "GetPaymentSessionInput", + "GetPaymentSessionOutput", + "GetRecommendationInput", + "GetRecommendationOutput", + "GetResourceApiKeyInput", + "GetResourceApiKeyOutput", + "GetResourceOauth2TokenInput", + "GetResourceOauth2TokenOutput", + "GetResourcePaymentTokenInput", + "GetResourcePaymentTokenOutput", + "GetWorkloadAccessTokenForJWTInput", + "GetWorkloadAccessTokenForJWTOutput", + "GetWorkloadAccessTokenForUserIdInput", + "GetWorkloadAccessTokenForUserIdOutput", + "GetWorkloadAccessTokenInput", + "GetWorkloadAccessTokenOutput", + "GroundTruthSource", + "GroundTruthTurn", + "GroundTruthTurnInput", + "HarnessAgentCoreBrowserConfig", + "HarnessAgentCoreCodeInterpreterConfig", + "HarnessAgentCoreGatewayConfig", + "HarnessBedrockApiFormat", + "HarnessBedrockModelConfig", + "HarnessContentBlock", + "HarnessContentBlockDelta", + "HarnessContentBlockDeltaEvent", + "HarnessContentBlockStart", + "HarnessContentBlockStartEvent", + "HarnessContentBlockStopEvent", + "HarnessConversationRole", + "HarnessGatewayOutboundAuth", + "HarnessGeminiModelConfig", + "HarnessHookDecision", + "HarnessHookEvent", + "HarnessHookEventType", + "HarnessInlineFunctionConfig", + "HarnessLiteLlmModelConfig", + "HarnessMessage", + "HarnessMessageStartEvent", + "HarnessMessageStopEvent", + "HarnessMetadataEvent", + "HarnessModelConfiguration", + "HarnessOpenAiApiFormat", + "HarnessOpenAiModelConfig", + "HarnessReasoningContentBlock", + "HarnessReasoningContentBlockDelta", + "HarnessReasoningTextBlock", + "HarnessRemoteMcpConfig", + "HarnessSkill", + "HarnessSkillAwsSkillsSource", + "HarnessSkillGitAuth", + "HarnessSkillGitSource", + "HarnessSkillS3Source", + "HarnessStopReason", + "HarnessStreamMetrics", + "HarnessSystemContentBlock", + "HarnessTokenUsage", + "HarnessTool", + "HarnessToolConfiguration", + "HarnessToolResultBlock", + "HarnessToolResultBlockDelta", + "HarnessToolResultBlockStart", + "HarnessToolResultContentBlock", + "HarnessToolResultMetadataBlockDelta", + "HarnessToolType", + "HarnessToolUseBlock", + "HarnessToolUseBlockDelta", + "HarnessToolUseBlockStart", + "HarnessToolUseStatus", + "HarnessToolUseType", + "IngestDataInput", + "IngestDataOutput", + "IngestPayloadType", + "InlineGroundTruth", + "InlineMemoryContent", + "InputContentBlock", + "Insight", + "InsightsFailureCategory", + "InsightsFailureSignal", + "InstrumentBalanceToken", + "InternalServerException", + "InvalidInputException", + "InvokeAgentRuntimeCommandInput", + "InvokeAgentRuntimeCommandOutput", + "InvokeAgentRuntimeCommandRequestBody", + "InvokeAgentRuntimeCommandStreamOutput", + "InvokeAgentRuntimeInput", + "InvokeAgentRuntimeOutput", + "InvokeBrowserInput", + "InvokeBrowserOutput", + "InvokeCodeInterpreterInput", + "InvokeCodeInterpreterOutput", + "InvokeHarnessInput", + "InvokeHarnessOutput", + "InvokeHarnessStreamOutput", + "KeyPressArguments", + "KeyPressResult", + "KeyShortcutArguments", + "KeyShortcutResult", + "KeyTypeArguments", + "KeyTypeResult", + "LanguageRuntime", + "LeftExpression", + "LinkedAccount", + "LinkedAccountDeveloperJwt", + "LinkedAccountEmail", + "LinkedAccountOAuth2", + "LinkedAccountSms", + "ListABTestsInput", + "ListABTestsOutput", + "ListActorsInput", + "ListActorsOutput", + "ListBatchEvaluationsInput", + "ListBatchEvaluationsOutput", + "ListBrowserSessionsInput", + "ListBrowserSessionsOutput", + "ListCodeInterpreterSessionsInput", + "ListCodeInterpreterSessionsOutput", + "ListEventsInput", + "ListEventsOutput", + "ListMemoryExtractionJobsInput", + "ListMemoryExtractionJobsOutput", + "ListMemoryRecordsInput", + "ListMemoryRecordsOutput", + "ListPaymentInstrumentsInput", + "ListPaymentInstrumentsOutput", + "ListPaymentSessionsInput", + "ListPaymentSessionsOutput", + "ListRecommendationsInput", + "ListRecommendationsOutput", + "ListSessionsInput", + "ListSessionsOutput", + "LiveViewStream", + "McpDescriptor", + "MemoryContent", + "MemoryJsonData", + "MemoryMetadataFilterExpression", + "MemoryRecord", + "MemoryRecordCreateInput", + "MemoryRecordDeleteInput", + "MemoryRecordLeftExpression", + "MemoryRecordMetadataValue", + "MemoryRecordOperatorType", + "MemoryRecordOutput", + "MemoryRecordRightExpression", + "MemoryRecordStatus", + "MemoryRecordSummary", + "MemoryRecordUpdateInput", + "MessageMetadata", + "MetadataValue", + "MouseButton", + "MouseClickArguments", + "MouseClickResult", + "MouseDragArguments", + "MouseDragResult", + "MouseMoveArguments", + "MouseMoveResult", + "MouseScrollArguments", + "MouseScrollResult", + "MppPaymentInput", + "MppPaymentOutput", + "OAuth2Authentication", + "OAuthCredentialProvider", + "OAuthGrantType", + "Oauth2FlowType", + "OnlineEvaluationConfigSource", + "OnlineEvaluationTraceConfig", + "OperatorType", + "OutputConfig", + "PayloadType", + "PaymentHttpMethodType", + "PaymentInput", + "PaymentInstrument", + "PaymentInstrumentDetails", + "PaymentInstrumentStatus", + "PaymentInstrumentSummary", + "PaymentInstrumentType", + "PaymentOutput", + "PaymentSession", + "PaymentSessionStatus", + "PaymentSessionSummary", + "PaymentStatus", + "PaymentTokenRequestInput", + "PaymentTokenResponseOutput", + "PaymentType", + "PerVariantOnlineEvaluationConfig", + "ProcessPaymentInput", + "ProcessPaymentOutput", + "ProgrammingLanguage", + "Proxy", + "ProxyBypass", + "ProxyConfiguration", + "ProxyCredentials", + "RecommendationConfig", + "RecommendationEvaluationConfig", + "RecommendationEvaluatorReference", + "RecommendationResult", + "RecommendationResultConfigurationBundle", + "RecommendationStatus", + "RecommendationSummary", + "RecommendationType", + "RegistryRecordStatus", + "RegistryRecordSummary", + "ResourceContent", + "ResourceContentType", + "ResourceLocation", + "ResourceNotFoundException", + "ResponseChunk", + "ResultDestination", + "RetrieveMemoryRecordsInput", + "RetrieveMemoryRecordsOutput", + "RetryableConflictException", + "RightExpression", + "Role", + "RootCauseCluster", + "RuntimeClientError", + "S3FilesConfiguration", + "S3Location", + "SaveBrowserSessionProfileInput", + "SaveBrowserSessionProfileOutput", + "ScreenshotArguments", + "ScreenshotFormat", + "ScreenshotResult", + "SearchCriteria", + "SearchRegistryRecordsInput", + "SearchRegistryRecordsOutput", + "SecretsManagerLocation", + "ServerDefinition", + "ServiceException", + "ServiceQuotaExceededException", + "SessionFilter", + "SessionFilterConfig", + "SessionLimits", + "SessionMetadataShape", + "SessionStatus", + "SessionSummary", + "SessionTraceIds", + "SkillDefinition", + "SkillMdDefinition", + "SpanContext", + "StartBatchEvaluationInput", + "StartBatchEvaluationOutput", + "StartBrowserSessionInput", + "StartBrowserSessionOutput", + "StartCodeInterpreterSessionInput", + "StartCodeInterpreterSessionOutput", + "StartMemoryExtractionJobInput", + "StartMemoryExtractionJobOutput", + "StartRecommendationInput", + "StartRecommendationOutput", + "StopBatchEvaluationInput", + "StopBatchEvaluationOutput", + "StopBrowserSessionInput", + "StopBrowserSessionOutput", + "StopCodeInterpreterSessionInput", + "StopCodeInterpreterSessionOutput", + "StopRuntimeSessionInput", + "StopRuntimeSessionOutput", + "StreamUpdate", + "StripePrivyTokenRequestInput", + "StripePrivyTokenResponseOutput", + "SubscriptionRequiredException", + "SystemPromptConfig", + "SystemPromptConfigurationBundle", + "SystemPromptRecommendationConfig", + "SystemPromptRecommendationResult", + "TargetRef", + "TaskStatus", + "ThrottledException", + "ThrottlingException", + "TokenBalance", + "TokenUsage", + "ToolArguments", + "ToolDescriptionConfig", + "ToolDescriptionConfigurationBundle", + "ToolDescriptionInput", + "ToolDescriptionOutput", + "ToolDescriptionRecommendationConfig", + "ToolDescriptionRecommendationResult", + "ToolDescriptionSource", + "ToolDescriptionTextInput", + "ToolName", + "ToolResultStructuredContent", + "ToolsDefinition", + "ToolsFileSystemConfiguration", + "UnauthorizedException", + "UpdateABTestInput", + "UpdateABTestOutput", + "UpdateBrowserStreamInput", + "UpdateBrowserStreamOutput", + "UserIdentifier", + "UserIntentAffectedSession", + "UserIntentCluster", + "UserIntentClusteringResultContent", + "ValidationException", + "ValidationExceptionField", + "ValidationExceptionReason", + "Variant", + "VariantConfiguration", + "VariantResult", + "ViewPort", + } + ), + service_error="ServiceError", +) + + +def __getattr__(name: str): + return _registry.build(name) + + +GET_AGENT_CARD: APIOperation[GetAgentCardInput, GetAgentCardOutput] = APIOperation( + static_schema=_SCHEMA_GET_AGENT_CARD, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#RetryableConflictException"), + ShapeID("com.amazonaws.bedrockagentcore#RuntimeClientError"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +INVOKE_AGENT_RUNTIME: APIOperation[ + InvokeAgentRuntimeInput, InvokeAgentRuntimeOutput +] = APIOperation( + static_schema=_SCHEMA_INVOKE_AGENT_RUNTIME, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#RetryableConflictException"), + ShapeID("com.amazonaws.bedrockagentcore#RuntimeClientError"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +INVOKE_AGENT_RUNTIME_COMMAND: APIOperation[ + InvokeAgentRuntimeCommandInput, InvokeAgentRuntimeCommandOutput +] = APIOperation( + static_schema=_SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#RetryableConflictException"), + ShapeID("com.amazonaws.bedrockagentcore#RuntimeClientError"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +STOP_RUNTIME_SESSION: APIOperation[ + StopRuntimeSessionInput, StopRuntimeSessionOutput +] = APIOperation( + static_schema=_SCHEMA_STOP_RUNTIME_SESSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#RetryableConflictException"), + ShapeID("com.amazonaws.bedrockagentcore#RuntimeClientError"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#UnauthorizedException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +SAVE_BROWSER_SESSION_PROFILE: APIOperation[ + SaveBrowserSessionProfileInput, SaveBrowserSessionProfileOutput +] = APIOperation( + static_schema=_SCHEMA_SAVE_BROWSER_SESSION_PROFILE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -class _ABTestEvaluationConfigDeserializer: - _result: ABTestEvaluationConfig | None = None +GET_BROWSER_SESSION: APIOperation[GetBrowserSessionInput, GetBrowserSessionOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_BROWSER_SESSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +INVOKE_BROWSER: APIOperation[InvokeBrowserInput, InvokeBrowserOutput] = APIOperation( + static_schema=_SCHEMA_INVOKE_BROWSER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +LIST_BROWSER_SESSIONS: APIOperation[ + ListBrowserSessionsInput, ListBrowserSessionsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_BROWSER_SESSIONS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def deserialize(self, deserializer: ShapeDeserializer) -> ABTestEvaluationConfig: - self._result = None - deserializer.read_struct(_SCHEMA_AB_TEST_EVALUATION_CONFIG, self._consumer) +START_BROWSER_SESSION: APIOperation[ + StartBrowserSessionInput, StartBrowserSessionOutput +] = APIOperation( + static_schema=_SCHEMA_START_BROWSER_SESSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) +STOP_BROWSER_SESSION: APIOperation[ + StopBrowserSessionInput, StopBrowserSessionOutput +] = APIOperation( + static_schema=_SCHEMA_STOP_BROWSER_SESSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - return self._result +UPDATE_BROWSER_STREAM: APIOperation[ + UpdateBrowserStreamInput, UpdateBrowserStreamOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_BROWSER_STREAM, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - ABTestEvaluationConfigOnlineEvaluationConfigArn.deserialize(de) - ) +DELETE_CAPACITY_PROVIDER_SESSION: APIOperation[ + DeleteCapacityProviderSessionInput, DeleteCapacityProviderSessionOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_CAPACITY_PROVIDER_SESSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 1: - self._set_result( - ABTestEvaluationConfigPerVariantOnlineEvaluationConfig.deserialize( - de - ) - ) +GET_CODE_INTERPRETER_SESSION: APIOperation[ + GetCodeInterpreterSessionInput, GetCodeInterpreterSessionOutput +] = APIOperation( + static_schema=_SCHEMA_GET_CODE_INTERPRETER_SESSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case _: - self._set_result( - ABTestEvaluationConfigUnknown(tag=schema.expect_member_name()) - ) +LIST_CODE_INTERPRETER_SESSIONS: APIOperation[ + ListCodeInterpreterSessionsInput, ListCodeInterpreterSessionsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_CODE_INTERPRETER_SESSIONS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def _set_result(self, value: ABTestEvaluationConfig) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value +START_CODE_INTERPRETER_SESSION: APIOperation[ + StartCodeInterpreterSessionInput, StartCodeInterpreterSessionOutput +] = APIOperation( + static_schema=_SCHEMA_START_CODE_INTERPRETER_SESSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +STOP_CODE_INTERPRETER_SESSION: APIOperation[ + StopCodeInterpreterSessionInput, StopCodeInterpreterSessionOutput +] = APIOperation( + static_schema=_SCHEMA_STOP_CODE_INTERPRETER_SESSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -class ABTestExecutionStatus(UnknownEnumMixin, StrEnum): - PAUSED = "PAUSED" - RUNNING = "RUNNING" - STOPPED = "STOPPED" - NOT_STARTED = "NOT_STARTED" +COMPLETE_RESOURCE_TOKEN_AUTH: APIOperation[ + CompleteResourceTokenAuthInput, CompleteResourceTokenAuthOutput +] = APIOperation( + static_schema=_SCHEMA_COMPLETE_RESOURCE_TOKEN_AUTH, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#UnauthorizedException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +CREATE_AB_TEST: APIOperation[CreateABTestInput, CreateABTestOutput] = APIOperation( + static_schema=_SCHEMA_CREATE_AB_TEST, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#UnauthorizedException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -@dataclass(kw_only=True) -class ControlStats: - """Statistics for the control variant in an A/B test.""" +DELETE_AB_TEST: APIOperation[DeleteABTestInput, DeleteABTestOutput] = APIOperation( + static_schema=_SCHEMA_DELETE_AB_TEST, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#UnauthorizedException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - variant_name: str - """The name of the control variant.""" +DELETE_BATCH_EVALUATION: APIOperation[ + DeleteBatchEvaluationInput, DeleteBatchEvaluationOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_BATCH_EVALUATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#UnauthorizedException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - sample_size: int - """The number of sessions evaluated for the control variant.""" +DELETE_RECOMMENDATION: APIOperation[ + DeleteRecommendationInput, DeleteRecommendationOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_RECOMMENDATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - mean: float - """The mean evaluation score for the control variant.""" +EVALUATE: APIOperation[EvaluateInput, EvaluateOutput] = APIOperation( + static_schema=_SCHEMA_EVALUATE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcore#DuplicateIdException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#UnauthorizedException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTROL_STATS, self) +GET_AB_TEST: APIOperation[GetABTestInput, GetABTestOutput] = APIOperation( + static_schema=_SCHEMA_GET_AB_TEST, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#UnauthorizedException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CONTROL_STATS.members["variantName"], self.variant_name - ) - serializer.write_integer( - _SCHEMA_CONTROL_STATS.members["sampleSize"], self.sample_size - ) - serializer.write_double(_SCHEMA_CONTROL_STATS.members["mean"], self.mean) +GET_BATCH_EVALUATION: APIOperation[ + GetBatchEvaluationInput, GetBatchEvaluationOutput +] = APIOperation( + static_schema=_SCHEMA_GET_BATCH_EVALUATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#UnauthorizedException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) +GET_RECOMMENDATION: APIOperation[GetRecommendationInput, GetRecommendationOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_RECOMMENDATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +LIST_AB_TESTS: APIOperation[ListABTestsInput, ListABTestsOutput] = APIOperation( + static_schema=_SCHEMA_LIST_AB_TESTS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#UnauthorizedException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["variant_name"] = de.read_string( - _SCHEMA_CONTROL_STATS.members["variantName"] - ) +LIST_BATCH_EVALUATIONS: APIOperation[ + ListBatchEvaluationsInput, ListBatchEvaluationsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_BATCH_EVALUATIONS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#UnauthorizedException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 1: - kwargs["sample_size"] = de.read_integer( - _SCHEMA_CONTROL_STATS.members["sampleSize"] - ) +LIST_RECOMMENDATIONS: APIOperation[ + ListRecommendationsInput, ListRecommendationsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_RECOMMENDATIONS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 2: - kwargs["mean"] = de.read_double( - _SCHEMA_CONTROL_STATS.members["mean"] - ) +START_BATCH_EVALUATION: APIOperation[ + StartBatchEvaluationInput, StartBatchEvaluationOutput +] = APIOperation( + static_schema=_SCHEMA_START_BATCH_EVALUATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#UnauthorizedException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case _: - logger.debug("Unexpected member schema: %s", schema) +START_RECOMMENDATION: APIOperation[ + StartRecommendationInput, StartRecommendationOutput +] = APIOperation( + static_schema=_SCHEMA_START_RECOMMENDATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - deserializer.read_struct(_SCHEMA_CONTROL_STATS, consumer=_consumer) - if "variant_name" not in kwargs: - kwargs["variant_name"] = "" - if "sample_size" not in kwargs: - kwargs["sample_size"] = 0 - if "mean" not in kwargs: - kwargs["mean"] = 0.0 - return kwargs +STOP_BATCH_EVALUATION: APIOperation[ + StopBatchEvaluationInput, StopBatchEvaluationOutput +] = APIOperation( + static_schema=_SCHEMA_STOP_BATCH_EVALUATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#UnauthorizedException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def _smithy_default(cls) -> Self: - return cls(variant_name="", sample_size=0, mean=0.0) +UPDATE_AB_TEST: APIOperation[UpdateABTestInput, UpdateABTestOutput] = APIOperation( + static_schema=_SCHEMA_UPDATE_AB_TEST, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#UnauthorizedException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +GET_RESOURCE_API_KEY: APIOperation[GetResourceApiKeyInput, GetResourceApiKeyOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_RESOURCE_API_KEY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#UnauthorizedException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) -@dataclass(kw_only=True) -class ConfidenceInterval: - """A confidence interval for a statistical measurement.""" +GET_RESOURCE_OAUTH2_TOKEN: APIOperation[ + GetResourceOauth2TokenInput, GetResourceOauth2TokenOutput +] = APIOperation( + static_schema=_SCHEMA_GET_RESOURCE_OAUTH2_TOKEN, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#UnauthorizedException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - lower: float | None = None - """The lower bound of the confidence interval.""" +GET_RESOURCE_PAYMENT_TOKEN: APIOperation[ + GetResourcePaymentTokenInput, GetResourcePaymentTokenOutput +] = APIOperation( + static_schema=_SCHEMA_GET_RESOURCE_PAYMENT_TOKEN, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#UnauthorizedException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - upper: float | None = None - """The upper bound of the confidence interval.""" +GET_WORKLOAD_ACCESS_TOKEN: APIOperation[ + GetWorkloadAccessTokenInput, GetWorkloadAccessTokenOutput +] = APIOperation( + static_schema=_SCHEMA_GET_WORKLOAD_ACCESS_TOKEN, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#UnauthorizedException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONFIDENCE_INTERVAL, self) +GET_WORKLOAD_ACCESS_TOKEN_FOR_JWT: APIOperation[ + GetWorkloadAccessTokenForJWTInput, GetWorkloadAccessTokenForJWTOutput +] = APIOperation( + static_schema=_SCHEMA_GET_WORKLOAD_ACCESS_TOKEN_FOR_JWT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#UnauthorizedException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize_members(self, serializer: ShapeSerializer): - if self.lower is not None: - serializer.write_double( - _SCHEMA_CONFIDENCE_INTERVAL.members["lower"], self.lower - ) +GET_WORKLOAD_ACCESS_TOKEN_FOR_USER_ID: APIOperation[ + GetWorkloadAccessTokenForUserIdInput, GetWorkloadAccessTokenForUserIdOutput +] = APIOperation( + static_schema=_SCHEMA_GET_WORKLOAD_ACCESS_TOKEN_FOR_USER_ID, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#UnauthorizedException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - if self.upper is not None: - serializer.write_double( - _SCHEMA_CONFIDENCE_INTERVAL.members["upper"], self.upper - ) +INVOKE_CODE_INTERPRETER: APIOperation[ + InvokeCodeInterpreterInput, InvokeCodeInterpreterOutput +] = APIOperation( + static_schema=_SCHEMA_INVOKE_CODE_INTERPRETER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) +INVOKE_HARNESS: APIOperation[InvokeHarnessInput, InvokeHarnessOutput] = APIOperation( + static_schema=_SCHEMA_INVOKE_HARNESS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#RuntimeClientError"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +BATCH_CREATE_MEMORY_RECORDS: APIOperation[ + BatchCreateMemoryRecordsInput, BatchCreateMemoryRecordsOutput +] = APIOperation( + static_schema=_SCHEMA_BATCH_CREATE_MEMORY_RECORDS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceException"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottledException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["lower"] = de.read_double( - _SCHEMA_CONFIDENCE_INTERVAL.members["lower"] - ) +BATCH_DELETE_MEMORY_RECORDS: APIOperation[ + BatchDeleteMemoryRecordsInput, BatchDeleteMemoryRecordsOutput +] = APIOperation( + static_schema=_SCHEMA_BATCH_DELETE_MEMORY_RECORDS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceException"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottledException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 1: - kwargs["upper"] = de.read_double( - _SCHEMA_CONFIDENCE_INTERVAL.members["upper"] - ) +BATCH_UPDATE_MEMORY_RECORDS: APIOperation[ + BatchUpdateMemoryRecordsInput, BatchUpdateMemoryRecordsOutput +] = APIOperation( + static_schema=_SCHEMA_BATCH_UPDATE_MEMORY_RECORDS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceException"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottledException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case _: - logger.debug("Unexpected member schema: %s", schema) +CREATE_EVENT: APIOperation[CreateEventInput, CreateEventOutput] = APIOperation( + static_schema=_SCHEMA_CREATE_EVENT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#InvalidInputException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#RetryableConflictException"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceException"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottledException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - deserializer.read_struct(_SCHEMA_CONFIDENCE_INTERVAL, consumer=_consumer) - return kwargs +DELETE_EVENT: APIOperation[DeleteEventInput, DeleteEventOutput] = APIOperation( + static_schema=_SCHEMA_DELETE_EVENT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#InvalidInputException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceException"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottledException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +DELETE_MEMORY_RECORD: APIOperation[ + DeleteMemoryRecordInput, DeleteMemoryRecordOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_MEMORY_RECORD, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#InvalidInputException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceException"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottledException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -@dataclass(kw_only=True) -class VariantResult: - """ - Statistical results for a treatment variant compared against the - control. - """ +GET_EVENT: APIOperation[GetEventInput, GetEventOutput] = APIOperation( + static_schema=_SCHEMA_GET_EVENT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#InvalidInputException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceException"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottledException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - variant_name: str - """The name of the treatment variant.""" +GET_MEMORY_RECORD: APIOperation[GetMemoryRecordInput, GetMemoryRecordOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_MEMORY_RECORD, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#InvalidInputException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceException"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottledException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - sample_size: int - """The number of sessions evaluated for this variant.""" +INGEST_DATA: APIOperation[IngestDataInput, IngestDataOutput] = APIOperation( + static_schema=_SCHEMA_INGEST_DATA, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceException"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottledException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - mean: float - """The mean evaluation score for this variant.""" +LIST_ACTORS: APIOperation[ListActorsInput, ListActorsOutput] = APIOperation( + static_schema=_SCHEMA_LIST_ACTORS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#InvalidInputException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceException"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottledException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - is_significant: bool - """Whether the observed difference is statistically significant.""" +LIST_EVENTS: APIOperation[ListEventsInput, ListEventsOutput] = APIOperation( + static_schema=_SCHEMA_LIST_EVENTS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#InvalidInputException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceException"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottledException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - absolute_change: float | None = None - """The absolute change in mean score compared to the control variant.""" +LIST_MEMORY_EXTRACTION_JOBS: APIOperation[ + ListMemoryExtractionJobsInput, ListMemoryExtractionJobsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_MEMORY_EXTRACTION_JOBS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceException"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottledException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - percent_change: float | None = None - """The percentage change in mean score compared to the control variant.""" +LIST_MEMORY_RECORDS: APIOperation[ListMemoryRecordsInput, ListMemoryRecordsOutput] = ( + APIOperation( + static_schema=_SCHEMA_LIST_MEMORY_RECORDS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#InvalidInputException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceException"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottledException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - p_value: float | None = None - """ - The p-value indicating the statistical significance of the observed - difference. - """ +LIST_SESSIONS: APIOperation[ListSessionsInput, ListSessionsOutput] = APIOperation( + static_schema=_SCHEMA_LIST_SESSIONS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#InvalidInputException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceException"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottledException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - confidence_interval: ConfidenceInterval | None = None - """The confidence interval for the observed difference.""" +RETRIEVE_MEMORY_RECORDS: APIOperation[ + RetrieveMemoryRecordsInput, RetrieveMemoryRecordsOutput +] = APIOperation( + static_schema=_SCHEMA_RETRIEVE_MEMORY_RECORDS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#InvalidInputException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceException"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottledException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VARIANT_RESULT, self) +START_MEMORY_EXTRACTION_JOB: APIOperation[ + StartMemoryExtractionJobInput, StartMemoryExtractionJobOutput +] = APIOperation( + static_schema=_SCHEMA_START_MEMORY_EXTRACTION_JOB, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceException"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottledException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_VARIANT_RESULT.members["variantName"], self.variant_name - ) - serializer.write_integer( - _SCHEMA_VARIANT_RESULT.members["sampleSize"], self.sample_size - ) - serializer.write_double(_SCHEMA_VARIANT_RESULT.members["mean"], self.mean) - if self.absolute_change is not None: - serializer.write_double( - _SCHEMA_VARIANT_RESULT.members["absoluteChange"], self.absolute_change - ) +CREATE_PAYMENT_INSTRUMENT: APIOperation[ + CreatePaymentInstrumentInput, CreatePaymentInstrumentOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_PAYMENT_INSTRUMENT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcore#SubscriptionRequiredException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +DELETE_PAYMENT_INSTRUMENT: APIOperation[ + DeletePaymentInstrumentInput, DeletePaymentInstrumentOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_PAYMENT_INSTRUMENT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +GET_PAYMENT_INSTRUMENT: APIOperation[ + GetPaymentInstrumentInput, GetPaymentInstrumentOutput +] = APIOperation( + static_schema=_SCHEMA_GET_PAYMENT_INSTRUMENT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - if self.percent_change is not None: - serializer.write_double( - _SCHEMA_VARIANT_RESULT.members["percentChange"], self.percent_change - ) +GET_PAYMENT_INSTRUMENT_BALANCE: APIOperation[ + GetPaymentInstrumentBalanceInput, GetPaymentInstrumentBalanceOutput +] = APIOperation( + static_schema=_SCHEMA_GET_PAYMENT_INSTRUMENT_BALANCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - if self.p_value is not None: - serializer.write_double( - _SCHEMA_VARIANT_RESULT.members["pValue"], self.p_value - ) +LIST_PAYMENT_INSTRUMENTS: APIOperation[ + ListPaymentInstrumentsInput, ListPaymentInstrumentsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_PAYMENT_INSTRUMENTS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - if self.confidence_interval is not None: - serializer.write_struct( - _SCHEMA_VARIANT_RESULT.members["confidenceInterval"], - self.confidence_interval, - ) +CREATE_PAYMENT_SESSION: APIOperation[ + CreatePaymentSessionInput, CreatePaymentSessionOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_PAYMENT_SESSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcore#SubscriptionRequiredException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - serializer.write_boolean( - _SCHEMA_VARIANT_RESULT.members["isSignificant"], self.is_significant - ) +DELETE_PAYMENT_SESSION: APIOperation[ + DeletePaymentSessionInput, DeletePaymentSessionOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_PAYMENT_SESSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) +GET_PAYMENT_SESSION: APIOperation[GetPaymentSessionInput, GetPaymentSessionOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_PAYMENT_SESSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +LIST_PAYMENT_SESSIONS: APIOperation[ + ListPaymentSessionsInput, ListPaymentSessionsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_PAYMENT_SESSIONS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["variant_name"] = de.read_string( - _SCHEMA_VARIANT_RESULT.members["variantName"] - ) +PROCESS_PAYMENT: APIOperation[ProcessPaymentInput, ProcessPaymentOutput] = APIOperation( + static_schema=_SCHEMA_PROCESS_PAYMENT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#ConflictException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockagentcore#SubscriptionRequiredException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 1: - kwargs["sample_size"] = de.read_integer( - _SCHEMA_VARIANT_RESULT.members["sampleSize"] - ) - - case 2: - kwargs["mean"] = de.read_double( - _SCHEMA_VARIANT_RESULT.members["mean"] - ) - - case 3: - kwargs["absolute_change"] = de.read_double( - _SCHEMA_VARIANT_RESULT.members["absoluteChange"] - ) - - case 4: - kwargs["percent_change"] = de.read_double( - _SCHEMA_VARIANT_RESULT.members["percentChange"] - ) - - case 5: - kwargs["p_value"] = de.read_double( - _SCHEMA_VARIANT_RESULT.members["pValue"] - ) - - case 6: - kwargs["confidence_interval"] = ConfidenceInterval.deserialize(de) - - case 7: - kwargs["is_significant"] = de.read_boolean( - _SCHEMA_VARIANT_RESULT.members["isSignificant"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VARIANT_RESULT, consumer=_consumer) - if "variant_name" not in kwargs: - kwargs["variant_name"] = "" - if "sample_size" not in kwargs: - kwargs["sample_size"] = 0 - if "mean" not in kwargs: - kwargs["mean"] = 0.0 - if "is_significant" not in kwargs: - kwargs["is_significant"] = False - return kwargs - - -def _serialize_variant_result_list( - serializer: ShapeSerializer, schema: Schema, value: list[VariantResult] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_variant_result_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[VariantResult]: - result: list[VariantResult] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(VariantResult.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class EvaluatorMetric: - """ - Statistical metrics for a single evaluator comparing control and - treatment variants. - """ - - evaluator_arn: str - """The Amazon Resource Name (ARN) of the evaluator.""" - - control_stats: ControlStats - """The statistics for the control variant.""" - - variant_results: list[VariantResult] - """The results for each treatment variant compared against the control.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVALUATOR_METRIC, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_EVALUATOR_METRIC.members["evaluatorArn"], self.evaluator_arn - ) - serializer.write_struct( - _SCHEMA_EVALUATOR_METRIC.members["controlStats"], self.control_stats - ) - _serialize_variant_result_list( - serializer, - _SCHEMA_EVALUATOR_METRIC.members["variantResults"], - self.variant_results, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["evaluator_arn"] = de.read_string( - _SCHEMA_EVALUATOR_METRIC.members["evaluatorArn"] - ) - - case 1: - kwargs["control_stats"] = ControlStats.deserialize(de) - - case 2: - kwargs["variant_results"] = _deserialize_variant_result_list( - de, _SCHEMA_EVALUATOR_METRIC.members["variantResults"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EVALUATOR_METRIC, consumer=_consumer) - if "evaluator_arn" not in kwargs: - kwargs["evaluator_arn"] = "" - if "control_stats" not in kwargs: - kwargs["control_stats"] = ControlStats._smithy_default() - if "variant_results" not in kwargs: - kwargs["variant_results"] = [] - return kwargs - - -def _serialize_evaluator_metric_list( - serializer: ShapeSerializer, schema: Schema, value: list[EvaluatorMetric] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_evaluator_metric_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[EvaluatorMetric]: - result: list[EvaluatorMetric] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(EvaluatorMetric.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ABTestResults: - """The statistical results of an A/B test.""" - - evaluator_metrics: list[EvaluatorMetric] - """The per-evaluator metrics comparing control and treatment variants.""" - - analysis_timestamp: datetime | None = None - """The timestamp when the analysis was performed.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AB_TEST_RESULTS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.analysis_timestamp is not None: - serializer.write_timestamp( - _SCHEMA_AB_TEST_RESULTS.members["analysisTimestamp"], - self.analysis_timestamp, - ) - - _serialize_evaluator_metric_list( - serializer, - _SCHEMA_AB_TEST_RESULTS.members["evaluatorMetrics"], - self.evaluator_metrics, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["analysis_timestamp"] = de.read_timestamp( - _SCHEMA_AB_TEST_RESULTS.members["analysisTimestamp"] - ) - - case 1: - kwargs["evaluator_metrics"] = _deserialize_evaluator_metric_list( - de, _SCHEMA_AB_TEST_RESULTS.members["evaluatorMetrics"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AB_TEST_RESULTS, consumer=_consumer) - if "evaluator_metrics" not in kwargs: - kwargs["evaluator_metrics"] = [] - return kwargs - - -class ABTestStatus(UnknownEnumMixin, StrEnum): - CREATING = "CREATING" - ACTIVE = "ACTIVE" - CREATE_FAILED = "CREATE_FAILED" - UPDATING = "UPDATING" - UPDATE_FAILED = "UPDATE_FAILED" - DELETING = "DELETING" - DELETE_FAILED = "DELETE_FAILED" - FAILED = "FAILED" - - -@dataclass(kw_only=True) -class ABTestSummary: - """Summary information about an A/B test.""" - - ab_test_id: str - """The unique identifier of the A/B test.""" - - ab_test_arn: str - """The Amazon Resource Name (ARN) of the A/B test.""" - - name: str - """The name of the A/B test.""" - - status: str - """The current status of the A/B test.""" - - execution_status: str - """The execution status of the A/B test.""" - - created_at: datetime - """The timestamp when the A/B test was created.""" - - updated_at: datetime - """The timestamp when the A/B test was last updated.""" - - description: str | None = None - """The description of the A/B test.""" - - gateway_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the gateway used for traffic - splitting. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AB_TEST_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AB_TEST_SUMMARY.members["abTestId"], self.ab_test_id - ) - serializer.write_string( - _SCHEMA_AB_TEST_SUMMARY.members["abTestArn"], self.ab_test_arn - ) - serializer.write_string(_SCHEMA_AB_TEST_SUMMARY.members["name"], self.name) - serializer.write_string(_SCHEMA_AB_TEST_SUMMARY.members["status"], self.status) - serializer.write_string( - _SCHEMA_AB_TEST_SUMMARY.members["executionStatus"], self.execution_status - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_AB_TEST_SUMMARY.members["description"], self.description - ) - - if self.gateway_arn is not None: - serializer.write_string( - _SCHEMA_AB_TEST_SUMMARY.members["gatewayArn"], self.gateway_arn - ) - - serializer.write_timestamp( - _SCHEMA_AB_TEST_SUMMARY.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_AB_TEST_SUMMARY.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["ab_test_id"] = de.read_string( - _SCHEMA_AB_TEST_SUMMARY.members["abTestId"] - ) - - case 1: - kwargs["ab_test_arn"] = de.read_string( - _SCHEMA_AB_TEST_SUMMARY.members["abTestArn"] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_AB_TEST_SUMMARY.members["name"] - ) - - case 3: - kwargs["status"] = ABTestStatus( - de.read_string(_SCHEMA_AB_TEST_SUMMARY.members["status"]) - ) - - case 4: - kwargs["execution_status"] = ABTestExecutionStatus( - de.read_string( - _SCHEMA_AB_TEST_SUMMARY.members["executionStatus"] - ) - ) - - case 5: - kwargs["description"] = de.read_string( - _SCHEMA_AB_TEST_SUMMARY.members["description"] - ) - - case 6: - kwargs["gateway_arn"] = de.read_string( - _SCHEMA_AB_TEST_SUMMARY.members["gatewayArn"] - ) - - case 7: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_AB_TEST_SUMMARY.members["createdAt"] - ) - - case 8: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_AB_TEST_SUMMARY.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AB_TEST_SUMMARY, consumer=_consumer) - if "ab_test_id" not in kwargs: - kwargs["ab_test_id"] = "" - if "ab_test_arn" not in kwargs: - kwargs["ab_test_arn"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "status" not in kwargs: - kwargs["status"] = ABTestStatus._corrected("") - if "execution_status" not in kwargs: - kwargs["execution_status"] = ABTestExecutionStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_ab_test_summary_list( - serializer: ShapeSerializer, schema: Schema, value: list[ABTestSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_ab_test_summary_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ABTestSummary]: - result: list[ABTestSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ABTestSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AccessDeniedException(ServiceError): - """ - The exception that occurs when you do not have sufficient permissions to - perform an action. Verify that your IAM policy includes the necessary - permissions for the operation you are trying to perform. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACCESS_DENIED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_ACCESS_DENIED_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_ACCESS_DENIED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ACCESS_DENIED_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ActorSummary: - """ - Contains summary information about an actor in an AgentCore Memory - resource. - """ - - actor_id: str - """The unique identifier of the actor.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACTOR_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_ACTOR_SUMMARY.members["actorId"], self.actor_id) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["actor_id"] = de.read_string( - _SCHEMA_ACTOR_SUMMARY.members["actorId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ACTOR_SUMMARY, consumer=_consumer) - if "actor_id" not in kwargs: - kwargs["actor_id"] = "" - return kwargs - - -def _serialize_actor_summary_list( - serializer: ShapeSerializer, schema: Schema, value: list[ActorSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_actor_summary_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ActorSummary]: - result: list[ActorSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ActorSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class InsightsFailureCategory(UnknownEnumMixin, StrEnum): - """ - Failure category taxonomy for agent session insights. Values must stay - in sync with the category registry in AgentCoreLens - (amzn_agentcore_lens.config.failure_detection.FAILURE_CATEGORIES). - """ - - EXECUTION_ERROR_AUTHENTICATION = "execution-error-category-authentication" - EXECUTION_ERROR_RESOURCE_NOT_FOUND = "execution-error-category-resource-not-found" - EXECUTION_ERROR_SERVICE_ERRORS = "execution-error-category-service-errors" - EXECUTION_ERROR_RATE_LIMITING = "execution-error-category-rate-limiting" - EXECUTION_ERROR_FORMATTING = "execution-error-category-formatting" - EXECUTION_ERROR_TIMEOUT = "execution-error-category-timeout" - EXECUTION_ERROR_RESOURCE_EXHAUSTION = "execution-error-category-resource-exhaustion" - EXECUTION_ERROR_ENVIRONMENT = "execution-error-category-environment" - EXECUTION_ERROR_TOOL_SCHEMA = "execution-error-category-tool-schema" - TASK_INSTRUCTION_NON_COMPLIANCE = "task-instruction-category-non-compliance" - TASK_INSTRUCTION_PROBLEM_ID = "task-instruction-category-problem-id" - INCORRECT_ACTIONS_TOOL_SELECTION = "incorrect-actions-category-tool-selection" - INCORRECT_ACTIONS_POOR_INFORMATION_RETRIEVAL = ( - "incorrect-actions-category-poor-information-retrieval" - ) - INCORRECT_ACTIONS_CLARIFICATION = "incorrect-actions-category-clarification" - INCORRECT_ACTIONS_INAPPROPRIATE_INFO_REQUEST = ( - "incorrect-actions-category-inappropriate-info-request" - ) - CONTEXT_HANDLING_FAILURES = ( - "context-handling-error-category-context-handling-failures" - ) - HALLUCINATION_CAPABILITIES = "hallucination-category-hall-capabilities" - HALLUCINATION_MISUNDERSTAND = "hallucination-category-hall-misunderstand" - HALLUCINATION_USAGE = "hallucination-category-hall-usage" - HALLUCINATION_HISTORY = "hallucination-category-hall-history" - HALLUCINATION_PARAMS = "hallucination-category-hall-params" - HALLUCINATION_FABRICATE_TOOL_OUTPUTS = ( - "hallucination-category-fabricate-tool-outputs" - ) - REPETITIVE_BEHAVIOR_TOOL = "repetitive-behavior-category-repetition-tool" - REPETITIVE_BEHAVIOR_INFO = "repetitive-behavior-category-repetition-info" - REPETITIVE_BEHAVIOR_STEP = "repetitive-behavior-category-step-repetition" - ORCHESTRATION_REASONING_MISMATCH = ( - "orchestration-related-errors-category-reasoning-mismatch" - ) - ORCHESTRATION_GOAL_DEVIATION = ( - "orchestration-related-errors-category-goal-deviation" - ) - ORCHESTRATION_PREMATURE_TERMINATION = ( - "orchestration-related-errors-category-premature-termination" - ) - ORCHESTRATION_UNAWARE_TERMINATION = ( - "orchestration-related-errors-category-unaware-termination" - ) - LLM_OUTPUT_NONSENSICAL = "llm-output-category-nonsensical" - CONFIGURATION_MISMATCH_TOOL_DEFINITION = ( - "configuration-mismatch-category-tool-definition" - ) - CODING_EDGE_CASE_OVERSIGHTS = ( - "coding-use-case-specific-failure-types-category-edge-case-oversights" - ) - CODING_DEPENDENCY_ISSUES = ( - "coding-use-case-specific-failure-types-category-dependency-issues" - ) - OTHER = "other" - - -@dataclass(kw_only=True) -class InsightsFailureSignal: - """A signal indicating a detected failure within a span.""" - - category: str - """The failure category classification for this signal.""" - - evidence: str - """The evidence supporting the failure detection.""" - - confidence: float - """The confidence score of the failure detection.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INSIGHTS_FAILURE_SIGNAL, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_INSIGHTS_FAILURE_SIGNAL.members["category"], self.category - ) - serializer.write_string( - _SCHEMA_INSIGHTS_FAILURE_SIGNAL.members["evidence"], self.evidence - ) - serializer.write_double( - _SCHEMA_INSIGHTS_FAILURE_SIGNAL.members["confidence"], self.confidence - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["category"] = InsightsFailureCategory( - de.read_string( - _SCHEMA_INSIGHTS_FAILURE_SIGNAL.members["category"] - ) - ) - - case 1: - kwargs["evidence"] = de.read_string( - _SCHEMA_INSIGHTS_FAILURE_SIGNAL.members["evidence"] - ) - - case 2: - kwargs["confidence"] = de.read_double( - _SCHEMA_INSIGHTS_FAILURE_SIGNAL.members["confidence"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INSIGHTS_FAILURE_SIGNAL, consumer=_consumer) - if "category" not in kwargs: - kwargs["category"] = InsightsFailureCategory._corrected("") - if "evidence" not in kwargs: - kwargs["evidence"] = "" - if "confidence" not in kwargs: - kwargs["confidence"] = 0.0 - return kwargs - - -def _serialize_insights_failure_signal_list( - serializer: ShapeSerializer, schema: Schema, value: list[InsightsFailureSignal] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_insights_failure_signal_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[InsightsFailureSignal]: - result: list[InsightsFailureSignal] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(InsightsFailureSignal.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class FailureSpanDetail: - """Details about a specific span where a failure was detected.""" - - span_id: str - """The unique identifier of the span where the failure occurred.""" - - trace_id: str - """The trace identifier associated with the failure span.""" - - signals: list[InsightsFailureSignal] - """The failure signals detected in this span.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FAILURE_SPAN_DETAIL, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_FAILURE_SPAN_DETAIL.members["spanId"], self.span_id - ) - serializer.write_string( - _SCHEMA_FAILURE_SPAN_DETAIL.members["traceId"], self.trace_id - ) - _serialize_insights_failure_signal_list( - serializer, _SCHEMA_FAILURE_SPAN_DETAIL.members["signals"], self.signals - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["span_id"] = de.read_string( - _SCHEMA_FAILURE_SPAN_DETAIL.members["spanId"] - ) - - case 1: - kwargs["trace_id"] = de.read_string( - _SCHEMA_FAILURE_SPAN_DETAIL.members["traceId"] - ) - - case 2: - kwargs["signals"] = _deserialize_insights_failure_signal_list( - de, _SCHEMA_FAILURE_SPAN_DETAIL.members["signals"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FAILURE_SPAN_DETAIL, consumer=_consumer) - if "span_id" not in kwargs: - kwargs["span_id"] = "" - if "trace_id" not in kwargs: - kwargs["trace_id"] = "" - if "signals" not in kwargs: - kwargs["signals"] = [] - return kwargs - - -def _serialize_failure_span_detail_list( - serializer: ShapeSerializer, schema: Schema, value: list[FailureSpanDetail] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_failure_span_detail_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[FailureSpanDetail]: - result: list[FailureSpanDetail] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(FailureSpanDetail.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AffectedSession: - """ - A session affected by a detected failure pattern, including root cause - details. - """ - - session_id: str - """The unique identifier of the affected session.""" - - explanation: str - """An explanation of how the failure manifested in this session.""" - - fix_type: str - """The type of fix recommended for this failure.""" - - recommendation: str - """The specific fix recommendation for this session.""" - - failure_spans: list[FailureSpanDetail] - """The list of spans where failures were detected in this session.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AFFECTED_SESSION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AFFECTED_SESSION.members["sessionId"], self.session_id - ) - serializer.write_string( - _SCHEMA_AFFECTED_SESSION.members["explanation"], self.explanation - ) - serializer.write_string( - _SCHEMA_AFFECTED_SESSION.members["fixType"], self.fix_type - ) - serializer.write_string( - _SCHEMA_AFFECTED_SESSION.members["recommendation"], self.recommendation - ) - _serialize_failure_span_detail_list( - serializer, - _SCHEMA_AFFECTED_SESSION.members["failureSpans"], - self.failure_spans, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["session_id"] = de.read_string( - _SCHEMA_AFFECTED_SESSION.members["sessionId"] - ) - - case 1: - kwargs["explanation"] = de.read_string( - _SCHEMA_AFFECTED_SESSION.members["explanation"] - ) - - case 2: - kwargs["fix_type"] = de.read_string( - _SCHEMA_AFFECTED_SESSION.members["fixType"] - ) - - case 3: - kwargs["recommendation"] = de.read_string( - _SCHEMA_AFFECTED_SESSION.members["recommendation"] - ) - - case 4: - kwargs["failure_spans"] = _deserialize_failure_span_detail_list( - de, _SCHEMA_AFFECTED_SESSION.members["failureSpans"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AFFECTED_SESSION, consumer=_consumer) - if "session_id" not in kwargs: - kwargs["session_id"] = "" - if "explanation" not in kwargs: - kwargs["explanation"] = "" - if "fix_type" not in kwargs: - kwargs["fix_type"] = "" - if "recommendation" not in kwargs: - kwargs["recommendation"] = "" - if "failure_spans" not in kwargs: - kwargs["failure_spans"] = [] - return kwargs - - -def _serialize_affected_session_list( - serializer: ShapeSerializer, schema: Schema, value: list[AffectedSession] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_affected_session_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AffectedSession]: - result: list[AffectedSession] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AffectedSession.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GetAgentCardInput: - """Dataclass for GetAgentCardInput structure.""" - - runtime_session_id: str | None = None - """The session ID that the AgentCore Runtime agent is using.""" - - agent_runtime_arn: str | None = None - """ - The ARN of the AgentCore Runtime agent for which you want to get the A2A - agent card. - """ - - qualifier: str | None = None - """ - Optional qualifier to specify an agent alias, such as `prod`code> or - `dev`. If you don't provide a value, the DEFAULT alias is used. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_AGENT_CARD_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.runtime_session_id is not None: - serializer.write_string( - _SCHEMA_GET_AGENT_CARD_INPUT.members["runtimeSessionId"], - self.runtime_session_id, - ) - - if self.agent_runtime_arn is not None: - serializer.write_string( - _SCHEMA_GET_AGENT_CARD_INPUT.members["agentRuntimeArn"], - self.agent_runtime_arn, - ) - - if self.qualifier is not None: - serializer.write_string( - _SCHEMA_GET_AGENT_CARD_INPUT.members["qualifier"], self.qualifier - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["runtime_session_id"] = de.read_string( - _SCHEMA_GET_AGENT_CARD_INPUT.members["runtimeSessionId"] - ) - - case 1: - kwargs["agent_runtime_arn"] = de.read_string( - _SCHEMA_GET_AGENT_CARD_INPUT.members["agentRuntimeArn"] - ) - - case 2: - kwargs["qualifier"] = de.read_string( - _SCHEMA_GET_AGENT_CARD_INPUT.members["qualifier"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_AGENT_CARD_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetAgentCardOutput: - """Dataclass for GetAgentCardOutput structure.""" - - agent_card: Document - """ - An agent card document that contains metadata and capabilities for an - AgentCore Runtime agent. - """ - - runtime_session_id: str | None = None - """The ID of the session associated with the AgentCore Runtime agent.""" - - status_code: int | None = None - """The status code of the request.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_AGENT_CARD_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.runtime_session_id is not None: - serializer.write_string( - _SCHEMA_GET_AGENT_CARD_OUTPUT.members["runtimeSessionId"], - self.runtime_session_id, - ) - - serializer.write_document( - _SCHEMA_GET_AGENT_CARD_OUTPUT.members["agentCard"], self.agent_card - ) - if self.status_code is not None: - serializer.write_integer( - _SCHEMA_GET_AGENT_CARD_OUTPUT.members["statusCode"], self.status_code - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["runtime_session_id"] = de.read_string( - _SCHEMA_GET_AGENT_CARD_OUTPUT.members["runtimeSessionId"] - ) - - case 1: - kwargs["agent_card"] = de.read_document( - _SCHEMA_GET_AGENT_CARD_OUTPUT.members["agentCard"] - ) - - case 2: - kwargs["status_code"] = de.read_integer( - _SCHEMA_GET_AGENT_CARD_OUTPUT.members["statusCode"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_AGENT_CARD_OUTPUT, consumer=_consumer) - if "agent_card" not in kwargs: - kwargs["agent_card"] = Document(None) - return kwargs - - -@dataclass(kw_only=True) -class InternalServerException(ServiceError): - """ - The exception that occurs when the service encounters an unexpected - internal error. This is a temporary condition that will resolve itself - with retries. We recommend implementing exponential backoff retry logic - in your application. - """ - - fault: Literal["client", "server"] | None = "server" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INTERNAL_SERVER_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INTERNAL_SERVER_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INTERNAL_SERVER_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INTERNAL_SERVER_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ResourceNotFoundException(ServiceError): - """ - The exception that occurs when the specified resource does not exist. - This can happen when using an invalid identifier or when trying to - access a resource that has been deleted. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class RetryableConflictException(ServiceError): - """ - The exception that occurs when there is a retryable conflict performing - an operation. This is a temporary condition that may resolve itself with - retries. We recommend implementing exponential backoff retry logic in - your application. - """ - - fault: Literal["client", "server"] | None = "client" - is_retry_safe: bool | None = True - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRYABLE_CONFLICT_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_RETRYABLE_CONFLICT_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_RETRYABLE_CONFLICT_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RETRYABLE_CONFLICT_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class RuntimeClientError(ServiceError): - """ - The exception that occurs when there is an error in the runtime client. - This can happen due to network issues, invalid configuration, or other - client-side problems. Check the error message for specific details about - the error. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RUNTIME_CLIENT_ERROR, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_RUNTIME_CLIENT_ERROR.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_RUNTIME_CLIENT_ERROR.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RUNTIME_CLIENT_ERROR, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ServiceQuotaExceededException(ServiceError): - """ - The exception that occurs when the request would cause a service quota - to be exceeded. Review your service quotas and either reduce your - request rate or request a quota increase. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ThrottlingException(ServiceError): - """ - The exception that occurs when the request was denied due to request - throttling. This happens when you exceed the allowed request rate for an - operation. Reduce the frequency of requests or implement exponential - backoff retry logic in your application. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_THROTTLING_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_THROTTLING_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_THROTTLING_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_THROTTLING_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ValidationExceptionField: - """ - Stores information about a field passed inside a request that resulted - in an exception. - """ - - name: str - """The name of the field.""" - - message: str - """A message describing why this field failed validation.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VALIDATION_EXCEPTION_FIELD, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_VALIDATION_EXCEPTION_FIELD.members["name"], self.name - ) - serializer.write_string( - _SCHEMA_VALIDATION_EXCEPTION_FIELD.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_VALIDATION_EXCEPTION_FIELD.members["name"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_VALIDATION_EXCEPTION_FIELD.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VALIDATION_EXCEPTION_FIELD, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "message" not in kwargs: - kwargs["message"] = "" - return kwargs - - -def _serialize_validation_exception_field_list( - serializer: ShapeSerializer, schema: Schema, value: list[ValidationExceptionField] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_validation_exception_field_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ValidationExceptionField]: - result: list[ValidationExceptionField] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ValidationExceptionField.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class ValidationExceptionReason(UnknownEnumMixin, StrEnum): - CANNOT_PARSE = "CannotParse" - FIELD_VALIDATION_FAILED = "FieldValidationFailed" - IDEMPOTENT_PARAMETER_MISMATCH_EXCEPTION = "IdempotentParameterMismatchException" - ROOT_EVENT_IN_OTHER_SESSION = "EventInOtherSession" - RESOURCE_CONFLICT = "ResourceConflict" - - -@dataclass(kw_only=True) -class ValidationException(ServiceError): - """ - The exception that occurs when the input fails to satisfy the - constraints specified by the service. Check the error message for - details about which input parameter is invalid and correct your request. - """ - - fault: Literal["client", "server"] | None = "client" - - reason: str - - field_list: list[ValidationExceptionField] | None = None - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VALIDATION_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_VALIDATION_EXCEPTION.members["message"], self.message - ) - serializer.write_string( - _SCHEMA_VALIDATION_EXCEPTION.members["reason"], self.reason - ) - if self.field_list is not None: - _serialize_validation_exception_field_list( - serializer, - _SCHEMA_VALIDATION_EXCEPTION.members["fieldList"], - self.field_list, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_VALIDATION_EXCEPTION.members["message"] - ) - - case 1: - kwargs["reason"] = ValidationExceptionReason( - de.read_string(_SCHEMA_VALIDATION_EXCEPTION.members["reason"]) - ) - - case 2: - kwargs["field_list"] = _deserialize_validation_exception_field_list( - de, _SCHEMA_VALIDATION_EXCEPTION.members["fieldList"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VALIDATION_EXCEPTION, consumer=_consumer) - if "reason" not in kwargs: - kwargs["reason"] = ValidationExceptionReason._corrected("") - return kwargs - - -GET_AGENT_CARD = APIOperation( - input=GetAgentCardInput, - output=GetAgentCardOutput, - schema=_SCHEMA_GET_AGENT_CARD, - input_schema=_SCHEMA_GET_AGENT_CARD_INPUT, - output_schema=_SCHEMA_GET_AGENT_CARD_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#RetryableConflictException" - ): RetryableConflictException, - ShapeID( - "com.amazonaws.bedrockagentcore#RuntimeClientError" - ): RuntimeClientError, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_RETRYABLE_CONFLICT_EXCEPTION, - _SCHEMA_RUNTIME_CLIENT_ERROR, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class InvokeAgentRuntimeInput: - """Dataclass for InvokeAgentRuntimeInput structure.""" - - content_type: str | None = None - """ - The MIME type of the input data in the payload. This tells the agent - runtime how to interpret the payload data. Common values include - application/json for JSON data. - """ - - accept: str | None = None - """ - The desired MIME type for the response from the agent runtime. This - tells the agent runtime what format to use for the response data. Common - values include application/json for JSON data. - """ - - mcp_session_id: str | None = None - """The identifier of the MCP session.""" - - runtime_session_id: str | None = None - """The identifier of the runtime session.""" - - mcp_protocol_version: str | None = None - """The version of the MCP protocol being used.""" - - mcp_method: str | None = None - """ - The MCP method being invoked. For example, `tools/call`, - `resources/read`, or `prompts/get`. - """ - - mcp_name: str | None = None - """ - The name of the MCP resource, tool, or prompt being accessed. The value - depends on the method: - - - `tools/call` -- The tool name. - - - `resources/read` -- The resource URI. - - - `prompts/get` -- The prompt name. - """ - - runtime_user_id: str | None = None - """The identifier of the runtime user.""" - - trace_id: str | None = None - """The trace identifier for request tracking.""" - - trace_parent: str | None = None - """The parent trace information for distributed tracing.""" - - trace_state: str | None = None - """The trace state information for distributed tracing.""" - - baggage: str | None = None - """Additional context information for distributed tracing.""" - - agent_runtime_arn: str | None = None - """ - The identifier of the agent runtime to invoke. You can specify either - the full Amazon Web Services Resource Name (ARN) or the agent ID. If you - use the agent ID, you must also provide the `accountId` query parameter. - """ - - qualifier: str | None = None - """ - The qualifier to use for the agent runtime. This is an endpoint name - that points to a specific version. If not specified, Amazon Bedrock - AgentCore uses the default endpoint of the agent runtime. - """ - - account_id: str | None = None - """ - The identifier of the Amazon Web Services account for the agent runtime - resource. This parameter is required when you specify an agent ID - instead of the full ARN for `agentRuntimeArn`. - """ - - payload: bytes | None = field(repr=False, default=None) - """ - The input data to send to the agent runtime. The format of this data - depends on the specific agent configuration and must match the specified - content type. For most agents, this is a JSON object containing the - user's request. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOKE_AGENT_RUNTIME_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.content_type is not None: - serializer.write_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_INPUT.members["contentType"], - self.content_type, - ) - - if self.accept is not None: - serializer.write_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_INPUT.members["accept"], self.accept - ) - - if self.mcp_session_id is not None: - serializer.write_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_INPUT.members["mcpSessionId"], - self.mcp_session_id, - ) - - if self.runtime_session_id is not None: - serializer.write_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_INPUT.members["runtimeSessionId"], - self.runtime_session_id, - ) - - if self.mcp_protocol_version is not None: - serializer.write_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_INPUT.members["mcpProtocolVersion"], - self.mcp_protocol_version, - ) - - if self.mcp_method is not None: - serializer.write_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_INPUT.members["mcpMethod"], self.mcp_method - ) - - if self.mcp_name is not None: - serializer.write_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_INPUT.members["mcpName"], self.mcp_name - ) - - if self.runtime_user_id is not None: - serializer.write_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_INPUT.members["runtimeUserId"], - self.runtime_user_id, - ) - - if self.trace_id is not None: - serializer.write_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_INPUT.members["traceId"], self.trace_id - ) - - if self.trace_parent is not None: - serializer.write_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_INPUT.members["traceParent"], - self.trace_parent, - ) - - if self.trace_state is not None: - serializer.write_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_INPUT.members["traceState"], - self.trace_state, - ) - - if self.baggage is not None: - serializer.write_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_INPUT.members["baggage"], self.baggage - ) - - if self.agent_runtime_arn is not None: - serializer.write_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_INPUT.members["agentRuntimeArn"], - self.agent_runtime_arn, - ) - - if self.qualifier is not None: - serializer.write_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_INPUT.members["qualifier"], self.qualifier - ) - - if self.account_id is not None: - serializer.write_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_INPUT.members["accountId"], self.account_id - ) - - if self.payload is not None: - serializer.write_blob( - _SCHEMA_INVOKE_AGENT_RUNTIME_INPUT.members["payload"], self.payload - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["content_type"] = de.read_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_INPUT.members["contentType"] - ) - - case 1: - kwargs["accept"] = de.read_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_INPUT.members["accept"] - ) - - case 2: - kwargs["mcp_session_id"] = de.read_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_INPUT.members["mcpSessionId"] - ) - - case 3: - kwargs["runtime_session_id"] = de.read_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_INPUT.members["runtimeSessionId"] - ) - - case 4: - kwargs["mcp_protocol_version"] = de.read_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_INPUT.members["mcpProtocolVersion"] - ) - - case 5: - kwargs["mcp_method"] = de.read_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_INPUT.members["mcpMethod"] - ) - - case 6: - kwargs["mcp_name"] = de.read_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_INPUT.members["mcpName"] - ) - - case 7: - kwargs["runtime_user_id"] = de.read_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_INPUT.members["runtimeUserId"] - ) - - case 8: - kwargs["trace_id"] = de.read_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_INPUT.members["traceId"] - ) - - case 9: - kwargs["trace_parent"] = de.read_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_INPUT.members["traceParent"] - ) - - case 10: - kwargs["trace_state"] = de.read_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_INPUT.members["traceState"] - ) - - case 11: - kwargs["baggage"] = de.read_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_INPUT.members["baggage"] - ) - - case 12: - kwargs["agent_runtime_arn"] = de.read_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_INPUT.members["agentRuntimeArn"] - ) - - case 13: - kwargs["qualifier"] = de.read_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_INPUT.members["qualifier"] - ) - - case 14: - kwargs["account_id"] = de.read_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_INPUT.members["accountId"] - ) - - case 15: - kwargs["payload"] = de.read_blob( - _SCHEMA_INVOKE_AGENT_RUNTIME_INPUT.members["payload"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INVOKE_AGENT_RUNTIME_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class InvokeAgentRuntimeOutput: - """Dataclass for InvokeAgentRuntimeOutput structure.""" - - content_type: str - """ - The MIME type of the response data. This indicates how to interpret the - response data. Common values include application/json for JSON data. - """ - - runtime_session_id: str | None = None - """The identifier of the runtime session.""" - - mcp_session_id: str | None = None - """The identifier of the MCP session.""" - - mcp_protocol_version: str | None = None - """The version of the MCP protocol being used.""" - - trace_id: str | None = None - """The trace identifier for request tracking.""" - - trace_parent: str | None = None - """The parent trace information for distributed tracing.""" - - trace_state: str | None = None - """The trace state information for distributed tracing.""" - - baggage: str | None = None - """Additional context information for distributed tracing.""" - - response: StreamingBlob = field(repr=False, default=b64decode("")) - """ - The response data from the agent runtime. The format of this data - depends on the specific agent configuration and the requested accept - type. For most agents, this is a JSON object containing the agent's - response to the user's request. - """ - - status_code: int | None = None - """ - The HTTP status code of the response. A status code of 200 indicates a - successful operation. Other status codes indicate various error - conditions. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOKE_AGENT_RUNTIME_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.runtime_session_id is not None: - serializer.write_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_OUTPUT.members["runtimeSessionId"], - self.runtime_session_id, - ) - - if self.mcp_session_id is not None: - serializer.write_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_OUTPUT.members["mcpSessionId"], - self.mcp_session_id, - ) - - if self.mcp_protocol_version is not None: - serializer.write_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_OUTPUT.members["mcpProtocolVersion"], - self.mcp_protocol_version, - ) - - if self.trace_id is not None: - serializer.write_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_OUTPUT.members["traceId"], self.trace_id - ) - - if self.trace_parent is not None: - serializer.write_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_OUTPUT.members["traceParent"], - self.trace_parent, - ) - - if self.trace_state is not None: - serializer.write_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_OUTPUT.members["traceState"], - self.trace_state, - ) - - if self.baggage is not None: - serializer.write_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_OUTPUT.members["baggage"], self.baggage - ) - - serializer.write_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_OUTPUT.members["contentType"], - self.content_type, - ) - serializer.write_data_stream( - _SCHEMA_INVOKE_AGENT_RUNTIME_OUTPUT.members["response"], self.response - ) - if self.status_code is not None: - serializer.write_integer( - _SCHEMA_INVOKE_AGENT_RUNTIME_OUTPUT.members["statusCode"], - self.status_code, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["runtime_session_id"] = de.read_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_OUTPUT.members["runtimeSessionId"] - ) - - case 1: - kwargs["mcp_session_id"] = de.read_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_OUTPUT.members["mcpSessionId"] - ) - - case 2: - kwargs["mcp_protocol_version"] = de.read_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_OUTPUT.members[ - "mcpProtocolVersion" - ] - ) - - case 3: - kwargs["trace_id"] = de.read_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_OUTPUT.members["traceId"] - ) - - case 4: - kwargs["trace_parent"] = de.read_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_OUTPUT.members["traceParent"] - ) - - case 5: - kwargs["trace_state"] = de.read_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_OUTPUT.members["traceState"] - ) - - case 6: - kwargs["baggage"] = de.read_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_OUTPUT.members["baggage"] - ) - - case 7: - kwargs["content_type"] = de.read_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_OUTPUT.members["contentType"] - ) - - case 8: - kwargs["response"] = de.read_data_stream( - _SCHEMA_INVOKE_AGENT_RUNTIME_OUTPUT.members["response"] - ) - - case 9: - kwargs["status_code"] = de.read_integer( - _SCHEMA_INVOKE_AGENT_RUNTIME_OUTPUT.members["statusCode"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVOKE_AGENT_RUNTIME_OUTPUT, consumer=_consumer - ) - if "content_type" not in kwargs: - kwargs["content_type"] = "" - return kwargs - - -INVOKE_AGENT_RUNTIME = APIOperation( - input=InvokeAgentRuntimeInput, - output=InvokeAgentRuntimeOutput, - schema=_SCHEMA_INVOKE_AGENT_RUNTIME, - input_schema=_SCHEMA_INVOKE_AGENT_RUNTIME_INPUT, - output_schema=_SCHEMA_INVOKE_AGENT_RUNTIME_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#RetryableConflictException" - ): RetryableConflictException, - ShapeID( - "com.amazonaws.bedrockagentcore#RuntimeClientError" - ): RuntimeClientError, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_RETRYABLE_CONFLICT_EXCEPTION, - _SCHEMA_RUNTIME_CLIENT_ERROR, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class InvokeAgentRuntimeCommandRequestBody: - """ - The request body structure for the `InvokeAgentRuntimeCommand` - operation, containing the command to execute and optional configuration - parameters. - """ - - command: str - """ - The shell command to execute on the agent runtime. This command is - executed in the runtime environment and its output is streamed back to - the caller. - """ - - timeout: int | None = None - """ - The maximum duration in seconds to wait for the command to complete. If - the command execution exceeds this timeout, it will be terminated. - Default is 300 seconds. Minimum is 1 second. Maximum is 3600 seconds. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_REQUEST_BODY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_REQUEST_BODY.members["command"], - self.command, - ) - if self.timeout is not None: - serializer.write_integer( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_REQUEST_BODY.members["timeout"], - self.timeout, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["command"] = de.read_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_REQUEST_BODY.members[ - "command" - ] - ) - - case 1: - kwargs["timeout"] = de.read_integer( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_REQUEST_BODY.members[ - "timeout" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_REQUEST_BODY, consumer=_consumer - ) - if "command" not in kwargs: - kwargs["command"] = "" - return kwargs - - -@dataclass(kw_only=True) -class InvokeAgentRuntimeCommandInput: - """Request for InvokeAgentRuntimeCommand operation.""" - - content_type: str | None = None - """ - The MIME type of the input data in the request payload. This tells the - agent runtime how to interpret the payload data. Common values include - application/json for JSON data. - """ - - accept: str | None = None - """ - The desired MIME type for the response from the agent runtime command. - This tells the agent runtime what format to use for the response data. - Common values include application/json for JSON data. - """ - - runtime_session_id: str | None = None - """ - The unique identifier of the runtime session in which to execute the - command. This session ID is used to maintain state and context across - multiple command invocations. - """ - - trace_id: str | None = None - """The trace identifier for request tracking.""" - - trace_parent: str | None = None - """The parent trace information for distributed tracing.""" - - trace_state: str | None = None - """The trace state information for distributed tracing.""" - - baggage: str | None = None - """Additional context information for distributed tracing.""" - - agent_runtime_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the agent runtime on which to execute - the command. This identifies the specific agent runtime environment - where the command will run. - """ - - qualifier: str | None = None - """ - The qualifier to use for the agent runtime. This is an endpoint name - that points to a specific version. If not specified, Amazon Bedrock - AgentCore uses the default endpoint of the agent runtime. - """ - - account_id: str | None = None - """ - The identifier of the Amazon Web Services account for the agent runtime - resource. This parameter is required when you specify an agent ID - instead of the full ARN for `agentRuntimeArn`. - """ - - body: InvokeAgentRuntimeCommandRequestBody | None = None - """ - The request body containing the command to execute and optional - configuration parameters such as timeout settings. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.content_type is not None: - serializer.write_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_INPUT.members["contentType"], - self.content_type, - ) - - if self.accept is not None: - serializer.write_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_INPUT.members["accept"], - self.accept, - ) - - if self.runtime_session_id is not None: - serializer.write_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_INPUT.members["runtimeSessionId"], - self.runtime_session_id, - ) - - if self.trace_id is not None: - serializer.write_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_INPUT.members["traceId"], - self.trace_id, - ) - - if self.trace_parent is not None: - serializer.write_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_INPUT.members["traceParent"], - self.trace_parent, - ) - - if self.trace_state is not None: - serializer.write_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_INPUT.members["traceState"], - self.trace_state, - ) - - if self.baggage is not None: - serializer.write_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_INPUT.members["baggage"], - self.baggage, - ) - - if self.agent_runtime_arn is not None: - serializer.write_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_INPUT.members["agentRuntimeArn"], - self.agent_runtime_arn, - ) - - if self.qualifier is not None: - serializer.write_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_INPUT.members["qualifier"], - self.qualifier, - ) - - if self.account_id is not None: - serializer.write_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_INPUT.members["accountId"], - self.account_id, - ) - - if self.body is not None: - serializer.write_struct( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_INPUT.members["body"], self.body - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["content_type"] = de.read_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_INPUT.members[ - "contentType" - ] - ) - - case 1: - kwargs["accept"] = de.read_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_INPUT.members["accept"] - ) - - case 2: - kwargs["runtime_session_id"] = de.read_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_INPUT.members[ - "runtimeSessionId" - ] - ) - - case 3: - kwargs["trace_id"] = de.read_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_INPUT.members["traceId"] - ) - - case 4: - kwargs["trace_parent"] = de.read_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_INPUT.members[ - "traceParent" - ] - ) - - case 5: - kwargs["trace_state"] = de.read_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_INPUT.members["traceState"] - ) - - case 6: - kwargs["baggage"] = de.read_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_INPUT.members["baggage"] - ) - - case 7: - kwargs["agent_runtime_arn"] = de.read_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_INPUT.members[ - "agentRuntimeArn" - ] - ) - - case 8: - kwargs["qualifier"] = de.read_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_INPUT.members["qualifier"] - ) - - case 9: - kwargs["account_id"] = de.read_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_INPUT.members["accountId"] - ) - - case 10: - kwargs["body"] = InvokeAgentRuntimeCommandRequestBody.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ContentDeltaEvent: - """ - An event that contains incremental output from a command execution. This - event streams standard output and standard error content as it becomes - available during command execution. - """ - - stdout: str | None = None - """ - The standard output content from the command execution. This field - contains the incremental output written to stdout by the executing - command. - """ - - stderr: str | None = None - """ - The standard error content from the command execution. This field - contains the incremental output written to stderr by the executing - command. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT_DELTA_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.stdout is not None: - serializer.write_string( - _SCHEMA_CONTENT_DELTA_EVENT.members["stdout"], self.stdout - ) - - if self.stderr is not None: - serializer.write_string( - _SCHEMA_CONTENT_DELTA_EVENT.members["stderr"], self.stderr - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["stdout"] = de.read_string( - _SCHEMA_CONTENT_DELTA_EVENT.members["stdout"] - ) - - case 1: - kwargs["stderr"] = de.read_string( - _SCHEMA_CONTENT_DELTA_EVENT.members["stderr"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONTENT_DELTA_EVENT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ContentStartEvent: - """ - An event that signals the start of content streaming from a command - execution. This event is sent when the command begins producing output. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT_START_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONTENT_START_EVENT, consumer=_consumer) - return kwargs - - -class CommandExecutionStatus(UnknownEnumMixin, StrEnum): - COMPLETED = "COMPLETED" - TIMED_OUT = "TIMED_OUT" - - -@dataclass(kw_only=True) -class ContentStopEvent: - """ - An event that signals the completion of a command execution. This event - contains the final status and exit code of the executed command. - """ - - exit_code: int - """ - The exit code returned by the executed command. An exit code of 0 - indicates successful execution, -1 indicates a platform error, and - values greater than 0 indicate command-specific errors. - """ - - status: str - """ - The final status of the command execution. Valid values are `COMPLETED` - for successful completion or `TIMED_OUT` if the command exceeded the - specified timeout. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT_STOP_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer( - _SCHEMA_CONTENT_STOP_EVENT.members["exitCode"], self.exit_code - ) - serializer.write_string( - _SCHEMA_CONTENT_STOP_EVENT.members["status"], self.status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["exit_code"] = de.read_integer( - _SCHEMA_CONTENT_STOP_EVENT.members["exitCode"] - ) - - case 1: - kwargs["status"] = CommandExecutionStatus( - de.read_string(_SCHEMA_CONTENT_STOP_EVENT.members["status"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONTENT_STOP_EVENT, consumer=_consumer) - if "exit_code" not in kwargs: - kwargs["exit_code"] = 0 - if "status" not in kwargs: - kwargs["status"] = CommandExecutionStatus._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class ResponseChunk: - """ - A structure representing a response chunk that contains exactly one of - the possible event types: `contentStart`, `contentDelta`, or - `contentStop`. - """ - - content_start: ContentStartEvent | None = None - """ - An event indicating the start of content streaming from the command - execution. This is the first chunk received. - """ - - content_delta: ContentDeltaEvent | None = None - """ - An event containing incremental output (stdout or stderr) from the - command execution. These are the middle chunks. - """ - - content_stop: ContentStopEvent | None = None - """ - An event indicating the completion of the command execution, including - the exit code and final status. This is the last chunk received. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESPONSE_CHUNK, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.content_start is not None: - serializer.write_struct( - _SCHEMA_RESPONSE_CHUNK.members["contentStart"], self.content_start - ) - - if self.content_delta is not None: - serializer.write_struct( - _SCHEMA_RESPONSE_CHUNK.members["contentDelta"], self.content_delta - ) - - if self.content_stop is not None: - serializer.write_struct( - _SCHEMA_RESPONSE_CHUNK.members["contentStop"], self.content_stop - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["content_start"] = ContentStartEvent.deserialize(de) - - case 1: - kwargs["content_delta"] = ContentDeltaEvent.deserialize(de) - - case 2: - kwargs["content_stop"] = ContentStopEvent.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RESPONSE_CHUNK, consumer=_consumer) - return kwargs - - -@dataclass -class InvokeAgentRuntimeCommandStreamOutputChunk: - """ - A response chunk containing command execution events such as content - start, content delta, or content stop events. - """ - - value: ResponseChunk - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_STREAM_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_STREAM_OUTPUT.members["chunk"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ResponseChunk.deserialize(deserializer)) - - -@dataclass -class InvokeAgentRuntimeCommandStreamOutputAccessDeniedException: - """Exception events for error streaming.""" - - value: AccessDeniedException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_STREAM_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_STREAM_OUTPUT.members[ - "accessDeniedException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=AccessDeniedException.deserialize(deserializer)) - - -@dataclass -class InvokeAgentRuntimeCommandStreamOutputInternalServerException: - """ - The exception that occurs when the service encounters an unexpected - internal error. This is a temporary condition that will resolve itself - with retries. We recommend implementing exponential backoff retry logic - in your application. - """ - - value: InternalServerException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_STREAM_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_STREAM_OUTPUT.members[ - "internalServerException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=InternalServerException.deserialize(deserializer)) - - -@dataclass -class InvokeAgentRuntimeCommandStreamOutputResourceNotFoundException: - """ - The exception that occurs when the specified resource does not exist. - This can happen when using an invalid identifier or when trying to - access a resource that has been deleted. - """ - - value: ResourceNotFoundException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_STREAM_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_STREAM_OUTPUT.members[ - "resourceNotFoundException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ResourceNotFoundException.deserialize(deserializer)) - - -@dataclass -class InvokeAgentRuntimeCommandStreamOutputServiceQuotaExceededException: - """ - The exception that occurs when the request would cause a service quota - to be exceeded. Review your service quotas and either reduce your - request rate or request a quota increase. - """ - - value: ServiceQuotaExceededException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_STREAM_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_STREAM_OUTPUT.members[ - "serviceQuotaExceededException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ServiceQuotaExceededException.deserialize(deserializer)) - - -@dataclass -class InvokeAgentRuntimeCommandStreamOutputThrottlingException: - """ - The exception that occurs when the request was denied due to request - throttling. This happens when you exceed the allowed request rate for an - operation. Reduce the frequency of requests or implement exponential - backoff retry logic in your application. - """ - - value: ThrottlingException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_STREAM_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_STREAM_OUTPUT.members[ - "throttlingException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ThrottlingException.deserialize(deserializer)) - - -@dataclass -class InvokeAgentRuntimeCommandStreamOutputValidationException: - """ - The exception that occurs when the input fails to satisfy the - constraints specified by the service. Check the error message for - details about which input parameter is invalid and correct your request. - """ - - value: ValidationException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_STREAM_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_STREAM_OUTPUT.members[ - "validationException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ValidationException.deserialize(deserializer)) - - -@dataclass -class InvokeAgentRuntimeCommandStreamOutputRuntimeClientError: - """ - The exception that occurs when there is an error in the runtime client. - This can happen due to network issues, invalid configuration, or other - client-side problems. Check the error message for specific details about - the error. - """ - - value: RuntimeClientError - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_STREAM_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_STREAM_OUTPUT.members[ - "runtimeClientError" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=RuntimeClientError.deserialize(deserializer)) - - -@dataclass -class InvokeAgentRuntimeCommandStreamOutputUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -InvokeAgentRuntimeCommandStreamOutput = Union[ - InvokeAgentRuntimeCommandStreamOutputChunk - | InvokeAgentRuntimeCommandStreamOutputAccessDeniedException - | InvokeAgentRuntimeCommandStreamOutputInternalServerException - | InvokeAgentRuntimeCommandStreamOutputResourceNotFoundException - | InvokeAgentRuntimeCommandStreamOutputServiceQuotaExceededException - | InvokeAgentRuntimeCommandStreamOutputThrottlingException - | InvokeAgentRuntimeCommandStreamOutputValidationException - | InvokeAgentRuntimeCommandStreamOutputRuntimeClientError - | InvokeAgentRuntimeCommandStreamOutputUnknown -] -""" -The streaming output union for the `InvokeAgentRuntimeCommand` -operation. This union delivers typed events: `contentStart` (first), -`contentDelta` (middle), and `contentStop` (last). -""" - - -class _InvokeAgentRuntimeCommandStreamOutputDeserializer: - _result: InvokeAgentRuntimeCommandStreamOutput | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> InvokeAgentRuntimeCommandStreamOutput: - self._result = None - deserializer.read_struct( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_STREAM_OUTPUT, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - InvokeAgentRuntimeCommandStreamOutputChunk.deserialize(de) - ) - - case 1: - self._set_result( - InvokeAgentRuntimeCommandStreamOutputAccessDeniedException.deserialize( - de - ) - ) - - case 2: - self._set_result( - InvokeAgentRuntimeCommandStreamOutputInternalServerException.deserialize( - de - ) - ) - - case 3: - self._set_result( - InvokeAgentRuntimeCommandStreamOutputResourceNotFoundException.deserialize( - de - ) - ) - - case 4: - self._set_result( - InvokeAgentRuntimeCommandStreamOutputServiceQuotaExceededException.deserialize( - de - ) - ) - - case 5: - self._set_result( - InvokeAgentRuntimeCommandStreamOutputThrottlingException.deserialize( - de - ) - ) - - case 6: - self._set_result( - InvokeAgentRuntimeCommandStreamOutputValidationException.deserialize( - de - ) - ) - - case 7: - self._set_result( - InvokeAgentRuntimeCommandStreamOutputRuntimeClientError.deserialize( - de - ) - ) - - case _: - self._set_result( - InvokeAgentRuntimeCommandStreamOutputUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: InvokeAgentRuntimeCommandStreamOutput) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class InvokeAgentRuntimeCommandOutput: - """Response for InvokeAgentRuntimeCommand operation.""" - - content_type: str - """ - The MIME type of the response data. This indicates how to interpret the - response data. Common values include application/json for JSON data. - """ - - runtime_session_id: str | None = None - """ - The unique identifier of the runtime session in which the command was - executed. - """ - - trace_id: str | None = None - """The trace identifier for request tracking.""" - - trace_parent: str | None = None - """The parent trace information for distributed tracing.""" - - trace_state: str | None = None - """The trace state information for distributed tracing.""" - - baggage: str | None = None - """Additional context information for distributed tracing.""" - - status_code: int | None = None - """ - The HTTP status code of the response. A status code of 200 indicates a - successful operation. Other status codes indicate various error - conditions. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.runtime_session_id is not None: - serializer.write_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_OUTPUT.members["runtimeSessionId"], - self.runtime_session_id, - ) - - if self.trace_id is not None: - serializer.write_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_OUTPUT.members["traceId"], - self.trace_id, - ) - - if self.trace_parent is not None: - serializer.write_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_OUTPUT.members["traceParent"], - self.trace_parent, - ) - - if self.trace_state is not None: - serializer.write_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_OUTPUT.members["traceState"], - self.trace_state, - ) - - if self.baggage is not None: - serializer.write_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_OUTPUT.members["baggage"], - self.baggage, - ) - - serializer.write_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_OUTPUT.members["contentType"], - self.content_type, - ) - if self.status_code is not None: - serializer.write_integer( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_OUTPUT.members["statusCode"], - self.status_code, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["runtime_session_id"] = de.read_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_OUTPUT.members[ - "runtimeSessionId" - ] - ) - - case 1: - kwargs["trace_id"] = de.read_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_OUTPUT.members["traceId"] - ) - - case 2: - kwargs["trace_parent"] = de.read_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_OUTPUT.members[ - "traceParent" - ] - ) - - case 3: - kwargs["trace_state"] = de.read_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_OUTPUT.members[ - "traceState" - ] - ) - - case 4: - kwargs["baggage"] = de.read_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_OUTPUT.members["baggage"] - ) - - case 5: - kwargs["content_type"] = de.read_string( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_OUTPUT.members[ - "contentType" - ] - ) - - case 6: - kwargs["status_code"] = de.read_integer( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_OUTPUT.members[ - "statusCode" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_OUTPUT, consumer=_consumer - ) - if "content_type" not in kwargs: - kwargs["content_type"] = "" - return kwargs - - -INVOKE_AGENT_RUNTIME_COMMAND = APIOperation( - input=InvokeAgentRuntimeCommandInput, - output=InvokeAgentRuntimeCommandOutput, - schema=_SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND, - input_schema=_SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_INPUT, - output_schema=_SCHEMA_INVOKE_AGENT_RUNTIME_COMMAND_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#RetryableConflictException" - ): RetryableConflictException, - ShapeID( - "com.amazonaws.bedrockagentcore#RuntimeClientError" - ): RuntimeClientError, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_RETRYABLE_CONFLICT_EXCEPTION, - _SCHEMA_RUNTIME_CLIENT_ERROR, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ConflictException(ServiceError): - """ - The exception that occurs when the request conflicts with the current - state of the resource. This can happen when trying to modify a resource - that is currently being modified by another request, or when trying to - create a resource that already exists. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONFLICT_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_CONFLICT_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_CONFLICT_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONFLICT_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class StopRuntimeSessionInput: - """Dataclass for StopRuntimeSessionInput structure.""" - - runtime_session_id: str | None = None - """The ID of the session that you want to stop.""" - - agent_runtime_arn: str | None = None - """The ARN of the agent that contains the session that you want to stop.""" - - qualifier: str | None = None - """ - Optional qualifier to specify an agent alias, such as `prod`code> or - `dev`. If you don't provide a value, the DEFAULT alias is used. - """ - - client_token: str | None = None - """ - Idempotent token used to identify the request. If you use the same token - with multiple requests, the same response is returned. Use ClientToken - to prevent the same request from being processed more than once. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STOP_RUNTIME_SESSION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.runtime_session_id is not None: - serializer.write_string( - _SCHEMA_STOP_RUNTIME_SESSION_INPUT.members["runtimeSessionId"], - self.runtime_session_id, - ) - - if self.agent_runtime_arn is not None: - serializer.write_string( - _SCHEMA_STOP_RUNTIME_SESSION_INPUT.members["agentRuntimeArn"], - self.agent_runtime_arn, - ) - - if self.qualifier is not None: - serializer.write_string( - _SCHEMA_STOP_RUNTIME_SESSION_INPUT.members["qualifier"], self.qualifier - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_STOP_RUNTIME_SESSION_INPUT.members["clientToken"], - self.client_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["runtime_session_id"] = de.read_string( - _SCHEMA_STOP_RUNTIME_SESSION_INPUT.members["runtimeSessionId"] - ) - - case 1: - kwargs["agent_runtime_arn"] = de.read_string( - _SCHEMA_STOP_RUNTIME_SESSION_INPUT.members["agentRuntimeArn"] - ) - - case 2: - kwargs["qualifier"] = de.read_string( - _SCHEMA_STOP_RUNTIME_SESSION_INPUT.members["qualifier"] - ) - - case 3: - kwargs["client_token"] = de.read_string( - _SCHEMA_STOP_RUNTIME_SESSION_INPUT.members["clientToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_STOP_RUNTIME_SESSION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class StopRuntimeSessionOutput: - """Dataclass for StopRuntimeSessionOutput structure.""" - - runtime_session_id: str | None = None - """The ID of the session that you requested to stop.""" - - status_code: int | None = None - """The status code of the request to stop the session.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STOP_RUNTIME_SESSION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.runtime_session_id is not None: - serializer.write_string( - _SCHEMA_STOP_RUNTIME_SESSION_OUTPUT.members["runtimeSessionId"], - self.runtime_session_id, - ) - - if self.status_code is not None: - serializer.write_integer( - _SCHEMA_STOP_RUNTIME_SESSION_OUTPUT.members["statusCode"], - self.status_code, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["runtime_session_id"] = de.read_string( - _SCHEMA_STOP_RUNTIME_SESSION_OUTPUT.members["runtimeSessionId"] - ) - - case 1: - kwargs["status_code"] = de.read_integer( - _SCHEMA_STOP_RUNTIME_SESSION_OUTPUT.members["statusCode"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_STOP_RUNTIME_SESSION_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UnauthorizedException(ServiceError): - """ - This exception is thrown when the JWT bearer token is invalid or not - found for OAuth bearer token based access - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNAUTHORIZED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_UNAUTHORIZED_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_UNAUTHORIZED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UNAUTHORIZED_EXCEPTION, consumer=_consumer) - return kwargs - - -STOP_RUNTIME_SESSION = APIOperation( - input=StopRuntimeSessionInput, - output=StopRuntimeSessionOutput, - schema=_SCHEMA_STOP_RUNTIME_SESSION, - input_schema=_SCHEMA_STOP_RUNTIME_SESSION_INPUT, - output_schema=_SCHEMA_STOP_RUNTIME_SESSION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#RetryableConflictException" - ): RetryableConflictException, - ShapeID( - "com.amazonaws.bedrockagentcore#RuntimeClientError" - ): RuntimeClientError, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#UnauthorizedException" - ): UnauthorizedException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_RETRYABLE_CONFLICT_EXCEPTION, - _SCHEMA_RUNTIME_CLIENT_ERROR, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class SkillDefinition: - """ - The structured skill definition with a schema version and inline - content. - """ - - schema_version: str | None = None - """ - The schema version of the skill definition. If you don't specify a - version, the service detects it automatically. - """ - - inline_content: str | None = None - """The inline content of the skill definition.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SKILL_DEFINITION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.schema_version is not None: - serializer.write_string( - _SCHEMA_SKILL_DEFINITION.members["schemaVersion"], self.schema_version - ) - - if self.inline_content is not None: - serializer.write_string( - _SCHEMA_SKILL_DEFINITION.members["inlineContent"], self.inline_content - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["schema_version"] = de.read_string( - _SCHEMA_SKILL_DEFINITION.members["schemaVersion"] - ) - - case 1: - kwargs["inline_content"] = de.read_string( - _SCHEMA_SKILL_DEFINITION.members["inlineContent"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SKILL_DEFINITION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class SkillMdDefinition: - """The skill markdown definition for agent skills descriptors.""" - - inline_content: str | None = None - """The inline markdown content of the skill definition.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SKILL_MD_DEFINITION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.inline_content is not None: - serializer.write_string( - _SCHEMA_SKILL_MD_DEFINITION.members["inlineContent"], - self.inline_content, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["inline_content"] = de.read_string( - _SCHEMA_SKILL_MD_DEFINITION.members["inlineContent"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SKILL_MD_DEFINITION, consumer=_consumer) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls() - - -@dataclass(kw_only=True) -class AgentSkillsDescriptor: - """The agent skills descriptor configuration for a registry record.""" - - skill_md: SkillMdDefinition - """The skill description in markdown format.""" - - skill_definition: SkillDefinition | None = None - """The structured skill definition with a schema version and content.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENT_SKILLS_DESCRIPTOR, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AGENT_SKILLS_DESCRIPTOR.members["skillMd"], self.skill_md - ) - if self.skill_definition is not None: - serializer.write_struct( - _SCHEMA_AGENT_SKILLS_DESCRIPTOR.members["skillDefinition"], - self.skill_definition, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["skill_md"] = SkillMdDefinition.deserialize(de) - - case 1: - kwargs["skill_definition"] = SkillDefinition.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AGENT_SKILLS_DESCRIPTOR, consumer=_consumer) - if "skill_md" not in kwargs: - kwargs["skill_md"] = SkillMdDefinition._smithy_default() - return kwargs - - -@dataclass(kw_only=True) -class BatchEvaluationTraceConfig: - """ - Configuration for using a batch evaluation as the source of agent traces - for recommendations. - """ - - batch_evaluation_arn: str - """The ARN of the completed batch evaluation to use as the trace source.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BATCH_EVALUATION_TRACE_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_BATCH_EVALUATION_TRACE_CONFIG.members["batchEvaluationArn"], - self.batch_evaluation_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["batch_evaluation_arn"] = de.read_string( - _SCHEMA_BATCH_EVALUATION_TRACE_CONFIG.members[ - "batchEvaluationArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_BATCH_EVALUATION_TRACE_CONFIG, consumer=_consumer - ) - if "batch_evaluation_arn" not in kwargs: - kwargs["batch_evaluation_arn"] = "" - return kwargs - - -def _serialize_log_group_arn_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_log_group_arn_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -class CloudWatchLogsFilterOperator(UnknownEnumMixin, StrEnum): - """The comparison operator used to filter CloudWatch Logs entries.""" - - EQUALS = "Equals" - NOT_EQUALS = "NotEquals" - GREATER_THAN = "GreaterThan" - LESS_THAN = "LessThan" - GREATER_THAN_OR_EQUAL = "GreaterThanOrEqual" - LESS_THAN_OR_EQUAL = "LessThanOrEqual" - CONTAINS = "Contains" - NOT_CONTAINS = "NotContains" - - -@dataclass -class FilterValueStringValue: - """A string value for text-based filtering.""" - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FILTER_VALUE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_FILTER_VALUE.members["stringValue"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string(_SCHEMA_FILTER_VALUE.members["stringValue"]) - ) - - -@dataclass -class FilterValueDoubleValue: - """A numeric value for numerical filtering and comparisons.""" - - value: float - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FILTER_VALUE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_double(_SCHEMA_FILTER_VALUE.members["doubleValue"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_double(_SCHEMA_FILTER_VALUE.members["doubleValue"]) - ) - - -@dataclass -class FilterValueBooleanValue: - """A boolean value for true/false filtering conditions.""" - - value: bool - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FILTER_VALUE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_boolean( - _SCHEMA_FILTER_VALUE.members["booleanValue"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_boolean( - _SCHEMA_FILTER_VALUE.members["booleanValue"] - ) - ) - - -@dataclass -class FilterValueUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -FilterValue = Union[ - FilterValueStringValue - | FilterValueDoubleValue - | FilterValueBooleanValue - | FilterValueUnknown -] -"""A value used in filter comparisons, supporting different data types.""" - - -class _FilterValueDeserializer: - _result: FilterValue | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> FilterValue: - self._result = None - deserializer.read_struct(_SCHEMA_FILTER_VALUE, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(FilterValueStringValue.deserialize(de)) - - case 1: - self._set_result(FilterValueDoubleValue.deserialize(de)) - - case 2: - self._set_result(FilterValueBooleanValue.deserialize(de)) - - case _: - self._set_result(FilterValueUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: FilterValue) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class CloudWatchLogsFilter: - """ - A filter for narrowing down agent traces from CloudWatch Logs based on - key-value comparisons. - """ - - key: str - """The key or field name to filter on within the agent trace data.""" - - operator: str - """The comparison operator to use for filtering.""" - - value: FilterValue - """The value to compare against using the specified operator.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CLOUD_WATCH_LOGS_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CLOUD_WATCH_LOGS_FILTER.members["key"], self.key - ) - serializer.write_string( - _SCHEMA_CLOUD_WATCH_LOGS_FILTER.members["operator"], self.operator - ) - serializer.write_struct( - _SCHEMA_CLOUD_WATCH_LOGS_FILTER.members["value"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["key"] = de.read_string( - _SCHEMA_CLOUD_WATCH_LOGS_FILTER.members["key"] - ) - - case 1: - kwargs["operator"] = CloudWatchLogsFilterOperator( - de.read_string( - _SCHEMA_CLOUD_WATCH_LOGS_FILTER.members["operator"] - ) - ) - - case 2: - kwargs["value"] = _FilterValueDeserializer().deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CLOUD_WATCH_LOGS_FILTER, consumer=_consumer) - if "key" not in kwargs: - kwargs["key"] = "" - if "operator" not in kwargs: - kwargs["operator"] = CloudWatchLogsFilterOperator._corrected("") - if "value" not in kwargs: - kwargs["value"] = FilterValueUnknown(tag="") - return kwargs - - -def _serialize_cloud_watch_logs_filter_list( - serializer: ShapeSerializer, schema: Schema, value: list[CloudWatchLogsFilter] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_cloud_watch_logs_filter_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[CloudWatchLogsFilter]: - result: list[CloudWatchLogsFilter] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(CloudWatchLogsFilter.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CloudWatchLogsRule: - """A rule configuration for filtering agent traces from CloudWatch Logs.""" - - filters: list[CloudWatchLogsFilter] | None = None - """The list of filters to apply when reading agent traces.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CLOUD_WATCH_LOGS_RULE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.filters is not None: - _serialize_cloud_watch_logs_filter_list( - serializer, - _SCHEMA_CLOUD_WATCH_LOGS_RULE.members["filters"], - self.filters, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["filters"] = _deserialize_cloud_watch_logs_filter_list( - de, _SCHEMA_CLOUD_WATCH_LOGS_RULE.members["filters"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CLOUD_WATCH_LOGS_RULE, consumer=_consumer) - return kwargs - - -def _serialize_service_name_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_service_name_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CloudWatchLogsTraceConfig: - """ - Configuration for reading agent traces from CloudWatch Logs for - recommendation analysis. - """ - - log_group_arns: list[str] - """The list of CloudWatch log group ARNs to read agent traces from.""" - - service_names: list[str] - """ - The list of service names to filter traces within the specified log - groups. - """ - - start_time: datetime - """The start time of the time range to read traces from.""" - - end_time: datetime - """The end time of the time range to read traces from.""" - - rule: CloudWatchLogsRule | None = None - """Optional rule configuration for filtering traces.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CLOUD_WATCH_LOGS_TRACE_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_log_group_arn_list( - serializer, - _SCHEMA_CLOUD_WATCH_LOGS_TRACE_CONFIG.members["logGroupArns"], - self.log_group_arns, - ) - _serialize_service_name_list( - serializer, - _SCHEMA_CLOUD_WATCH_LOGS_TRACE_CONFIG.members["serviceNames"], - self.service_names, - ) - serializer.write_timestamp( - _SCHEMA_CLOUD_WATCH_LOGS_TRACE_CONFIG.members["startTime"], self.start_time - ) - serializer.write_timestamp( - _SCHEMA_CLOUD_WATCH_LOGS_TRACE_CONFIG.members["endTime"], self.end_time - ) - if self.rule is not None: - serializer.write_struct( - _SCHEMA_CLOUD_WATCH_LOGS_TRACE_CONFIG.members["rule"], self.rule - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["log_group_arns"] = _deserialize_log_group_arn_list( - de, - _SCHEMA_CLOUD_WATCH_LOGS_TRACE_CONFIG.members["logGroupArns"], - ) - - case 1: - kwargs["service_names"] = _deserialize_service_name_list( - de, - _SCHEMA_CLOUD_WATCH_LOGS_TRACE_CONFIG.members["serviceNames"], - ) - - case 2: - kwargs["start_time"] = de.read_timestamp( - _SCHEMA_CLOUD_WATCH_LOGS_TRACE_CONFIG.members["startTime"] - ) - - case 3: - kwargs["end_time"] = de.read_timestamp( - _SCHEMA_CLOUD_WATCH_LOGS_TRACE_CONFIG.members["endTime"] - ) - - case 4: - kwargs["rule"] = CloudWatchLogsRule.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CLOUD_WATCH_LOGS_TRACE_CONFIG, consumer=_consumer - ) - if "log_group_arns" not in kwargs: - kwargs["log_group_arns"] = [] - if "service_names" not in kwargs: - kwargs["service_names"] = [] - if "start_time" not in kwargs: - kwargs["start_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "end_time" not in kwargs: - kwargs["end_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -@dataclass(kw_only=True) -class OnlineEvaluationTraceConfig: - """ - Contains the configuration for reusing agent traces from an online - evaluation configuration for recommendation analysis. Because online - evaluation is a continuous stream, a time range specifies which - evaluated sessions the recommendation includes. - """ - - online_evaluation_config_arn: str - """The ARN of the online evaluation configuration to reuse sessions from.""" - - start_time: datetime - """ - The start time of the time range. Only sessions evaluated at or after - this timestamp are included. - """ - - end_time: datetime - """ - The end time of the time range. Only sessions evaluated before this - timestamp are included. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ONLINE_EVALUATION_TRACE_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_ONLINE_EVALUATION_TRACE_CONFIG.members["onlineEvaluationConfigArn"], - self.online_evaluation_config_arn, - ) - serializer.write_timestamp( - _SCHEMA_ONLINE_EVALUATION_TRACE_CONFIG.members["startTime"], self.start_time - ) - serializer.write_timestamp( - _SCHEMA_ONLINE_EVALUATION_TRACE_CONFIG.members["endTime"], self.end_time - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["online_evaluation_config_arn"] = de.read_string( - _SCHEMA_ONLINE_EVALUATION_TRACE_CONFIG.members[ - "onlineEvaluationConfigArn" - ] - ) - - case 1: - kwargs["start_time"] = de.read_timestamp( - _SCHEMA_ONLINE_EVALUATION_TRACE_CONFIG.members["startTime"] - ) - - case 2: - kwargs["end_time"] = de.read_timestamp( - _SCHEMA_ONLINE_EVALUATION_TRACE_CONFIG.members["endTime"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ONLINE_EVALUATION_TRACE_CONFIG, consumer=_consumer - ) - if "online_evaluation_config_arn" not in kwargs: - kwargs["online_evaluation_config_arn"] = "" - if "start_time" not in kwargs: - kwargs["start_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "end_time" not in kwargs: - kwargs["end_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_spans( - serializer: ShapeSerializer, schema: Schema, value: list[Document] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_document(member_schema, e) - - -def _deserialize_spans( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Document]: - result: list[Document] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_document(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass -class AgentTracesConfigSessionSpans: - """Agent traces provided as inline session spans in OpenTelemetry format.""" - - value: list[Document] - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENT_TRACES_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_spans( - serializer, _SCHEMA_AGENT_TRACES_CONFIG.members["sessionSpans"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_deserialize_spans( - deserializer, _SCHEMA_AGENT_TRACES_CONFIG.members["sessionSpans"] - ) - ) - - -@dataclass -class AgentTracesConfigCloudwatchLogs: - """Agent traces read from CloudWatch Logs.""" - - value: CloudWatchLogsTraceConfig - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENT_TRACES_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AGENT_TRACES_CONFIG.members["cloudwatchLogs"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=CloudWatchLogsTraceConfig.deserialize(deserializer)) - - -@dataclass -class AgentTracesConfigBatchEvaluation: - """Use a completed batch evaluation as the source of agent traces.""" - - value: BatchEvaluationTraceConfig - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENT_TRACES_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AGENT_TRACES_CONFIG.members["batchEvaluation"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=BatchEvaluationTraceConfig.deserialize(deserializer)) - - -@dataclass -class AgentTracesConfigOnlineEvaluation: - """ - Agent traces from an online evaluation configuration over a specified - time range. - """ - - value: OnlineEvaluationTraceConfig - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENT_TRACES_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AGENT_TRACES_CONFIG.members["onlineEvaluation"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=OnlineEvaluationTraceConfig.deserialize(deserializer)) - - -@dataclass -class AgentTracesConfigUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -AgentTracesConfig = Union[ - AgentTracesConfigSessionSpans - | AgentTracesConfigCloudwatchLogs - | AgentTracesConfigBatchEvaluation - | AgentTracesConfigOnlineEvaluation - | AgentTracesConfigUnknown -] -""" -The configuration specifying where to read agent traces from for -recommendation analysis. -""" - - -class _AgentTracesConfigDeserializer: - _result: AgentTracesConfig | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> AgentTracesConfig: - self._result = None - deserializer.read_struct(_SCHEMA_AGENT_TRACES_CONFIG, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(AgentTracesConfigSessionSpans.deserialize(de)) - - case 1: - self._set_result(AgentTracesConfigCloudwatchLogs.deserialize(de)) - - case 2: - self._set_result(AgentTracesConfigBatchEvaluation.deserialize(de)) - - case 3: - self._set_result(AgentTracesConfigOnlineEvaluation.deserialize(de)) - - case _: - self._set_result( - AgentTracesConfigUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: AgentTracesConfig) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class SaveBrowserSessionProfileInput: - """Dataclass for SaveBrowserSessionProfileInput structure.""" - - trace_id: str | None = None - """The trace identifier for request tracking.""" - - trace_parent: str | None = None - """The parent trace information for distributed tracing.""" - - profile_identifier: str | None = None - """ - The unique identifier for the browser profile. This identifier is used - to reference the profile when starting new browser sessions. The - identifier must follow the pattern of an alphanumeric name (up to 48 - characters) followed by a hyphen and a 10-character alphanumeric suffix. - """ - - browser_identifier: str | None = None - """ - The unique identifier of the browser associated with the session from - which to save the profile. - """ - - session_id: str | None = None - """ - The unique identifier of the browser session from which to save the - profile. The session must be active when saving the profile. - """ - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If this token matches a previous - request, Amazon Bedrock AgentCore ignores the request, but does not - return an error. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SAVE_BROWSER_SESSION_PROFILE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.trace_id is not None: - serializer.write_string( - _SCHEMA_SAVE_BROWSER_SESSION_PROFILE_INPUT.members["traceId"], - self.trace_id, - ) - - if self.trace_parent is not None: - serializer.write_string( - _SCHEMA_SAVE_BROWSER_SESSION_PROFILE_INPUT.members["traceParent"], - self.trace_parent, - ) - - if self.profile_identifier is not None: - serializer.write_string( - _SCHEMA_SAVE_BROWSER_SESSION_PROFILE_INPUT.members["profileIdentifier"], - self.profile_identifier, - ) - - if self.browser_identifier is not None: - serializer.write_string( - _SCHEMA_SAVE_BROWSER_SESSION_PROFILE_INPUT.members["browserIdentifier"], - self.browser_identifier, - ) - - if self.session_id is not None: - serializer.write_string( - _SCHEMA_SAVE_BROWSER_SESSION_PROFILE_INPUT.members["sessionId"], - self.session_id, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_SAVE_BROWSER_SESSION_PROFILE_INPUT.members["clientToken"], - self.client_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["trace_id"] = de.read_string( - _SCHEMA_SAVE_BROWSER_SESSION_PROFILE_INPUT.members["traceId"] - ) - - case 1: - kwargs["trace_parent"] = de.read_string( - _SCHEMA_SAVE_BROWSER_SESSION_PROFILE_INPUT.members[ - "traceParent" - ] - ) - - case 2: - kwargs["profile_identifier"] = de.read_string( - _SCHEMA_SAVE_BROWSER_SESSION_PROFILE_INPUT.members[ - "profileIdentifier" - ] - ) - - case 3: - kwargs["browser_identifier"] = de.read_string( - _SCHEMA_SAVE_BROWSER_SESSION_PROFILE_INPUT.members[ - "browserIdentifier" - ] - ) - - case 4: - kwargs["session_id"] = de.read_string( - _SCHEMA_SAVE_BROWSER_SESSION_PROFILE_INPUT.members["sessionId"] - ) - - case 5: - kwargs["client_token"] = de.read_string( - _SCHEMA_SAVE_BROWSER_SESSION_PROFILE_INPUT.members[ - "clientToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SAVE_BROWSER_SESSION_PROFILE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class SaveBrowserSessionProfileOutput: - """Dataclass for SaveBrowserSessionProfileOutput structure.""" - - profile_identifier: str - """The unique identifier of the saved browser profile.""" - - browser_identifier: str - """ - The unique identifier of the browser associated with the session from - which the profile was saved. - """ - - session_id: str - """ - The unique identifier of the browser session from which the profile was - saved. - """ - - last_updated_at: datetime - """ - The timestamp when the browser profile was last updated. This value is - in ISO 8601 format. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SAVE_BROWSER_SESSION_PROFILE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SAVE_BROWSER_SESSION_PROFILE_OUTPUT.members["profileIdentifier"], - self.profile_identifier, - ) - serializer.write_string( - _SCHEMA_SAVE_BROWSER_SESSION_PROFILE_OUTPUT.members["browserIdentifier"], - self.browser_identifier, - ) - serializer.write_string( - _SCHEMA_SAVE_BROWSER_SESSION_PROFILE_OUTPUT.members["sessionId"], - self.session_id, - ) - serializer.write_timestamp( - _SCHEMA_SAVE_BROWSER_SESSION_PROFILE_OUTPUT.members["lastUpdatedAt"], - self.last_updated_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["profile_identifier"] = de.read_string( - _SCHEMA_SAVE_BROWSER_SESSION_PROFILE_OUTPUT.members[ - "profileIdentifier" - ] - ) - - case 1: - kwargs["browser_identifier"] = de.read_string( - _SCHEMA_SAVE_BROWSER_SESSION_PROFILE_OUTPUT.members[ - "browserIdentifier" - ] - ) - - case 2: - kwargs["session_id"] = de.read_string( - _SCHEMA_SAVE_BROWSER_SESSION_PROFILE_OUTPUT.members["sessionId"] - ) - - case 3: - kwargs["last_updated_at"] = de.read_timestamp( - _SCHEMA_SAVE_BROWSER_SESSION_PROFILE_OUTPUT.members[ - "lastUpdatedAt" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SAVE_BROWSER_SESSION_PROFILE_OUTPUT, consumer=_consumer - ) - if "profile_identifier" not in kwargs: - kwargs["profile_identifier"] = "" - if "browser_identifier" not in kwargs: - kwargs["browser_identifier"] = "" - if "session_id" not in kwargs: - kwargs["session_id"] = "" - if "last_updated_at" not in kwargs: - kwargs["last_updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -SAVE_BROWSER_SESSION_PROFILE = APIOperation( - input=SaveBrowserSessionProfileInput, - output=SaveBrowserSessionProfileOutput, - schema=_SCHEMA_SAVE_BROWSER_SESSION_PROFILE, - input_schema=_SCHEMA_SAVE_BROWSER_SESSION_PROFILE_INPUT, - output_schema=_SCHEMA_SAVE_BROWSER_SESSION_PROFILE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetBrowserSessionInput: - """Dataclass for GetBrowserSessionInput structure.""" - - browser_identifier: str | None = None - """The unique identifier of the browser associated with the session.""" - - session_id: str | None = None - """The unique identifier of the browser session to retrieve.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_BROWSER_SESSION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.browser_identifier is not None: - serializer.write_string( - _SCHEMA_GET_BROWSER_SESSION_INPUT.members["browserIdentifier"], - self.browser_identifier, - ) - - if self.session_id is not None: - serializer.write_string( - _SCHEMA_GET_BROWSER_SESSION_INPUT.members["sessionId"], self.session_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["browser_identifier"] = de.read_string( - _SCHEMA_GET_BROWSER_SESSION_INPUT.members["browserIdentifier"] - ) - - case 1: - kwargs["session_id"] = de.read_string( - _SCHEMA_GET_BROWSER_SESSION_INPUT.members["sessionId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_BROWSER_SESSION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class SecretsManagerLocation: - """The Amazon Web Services Secrets Manager location configuration.""" - - secret_arn: str - """ - The ARN of the Amazon Web Services Secrets Manager secret containing the - certificate. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SECRETS_MANAGER_LOCATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SECRETS_MANAGER_LOCATION.members["secretArn"], self.secret_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["secret_arn"] = de.read_string( - _SCHEMA_SECRETS_MANAGER_LOCATION.members["secretArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SECRETS_MANAGER_LOCATION, consumer=_consumer) - if "secret_arn" not in kwargs: - kwargs["secret_arn"] = "" - return kwargs - - -@dataclass -class CertificateLocationSecretsManager: - """The Amazon Web Services Secrets Manager location of the certificate.""" - - value: SecretsManagerLocation - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CERTIFICATE_LOCATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CERTIFICATE_LOCATION.members["secretsManager"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=SecretsManagerLocation.deserialize(deserializer)) - - -@dataclass -class CertificateLocationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -CertificateLocation = Union[ - CertificateLocationSecretsManager | CertificateLocationUnknown -] -"""The location from which to retrieve a certificate.""" - - -class _CertificateLocationDeserializer: - _result: CertificateLocation | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> CertificateLocation: - self._result = None - deserializer.read_struct(_SCHEMA_CERTIFICATE_LOCATION, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(CertificateLocationSecretsManager.deserialize(de)) - - case _: - self._set_result( - CertificateLocationUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: CertificateLocation) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class Certificate: - """A certificate to install in the browser or code interpreter session.""" - - location: CertificateLocation - """The location of the certificate.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CERTIFICATE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CERTIFICATE.members["location"], self.location) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["location"] = _CertificateLocationDeserializer().deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CERTIFICATE, consumer=_consumer) - if "location" not in kwargs: - kwargs["location"] = CertificateLocationUnknown(tag="") - return kwargs - - -def _serialize_certificates( - serializer: ShapeSerializer, schema: Schema, value: list[Certificate] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_certificates( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Certificate]: - result: list[Certificate] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Certificate.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class S3Location: - """The Amazon S3 location configuration of a resource.""" - - bucket: str - """The name of the Amazon S3 bucket where the resource is stored.""" - - prefix: str - """The name of the Amazon S3 prefix/key where the resource is stored.""" - - version_id: str | None = None - """ - The name of the Amazon S3 version ID where the resource is stored - (Optional). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_S3_LOCATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_S3_LOCATION.members["bucket"], self.bucket) - serializer.write_string(_SCHEMA_S3_LOCATION.members["prefix"], self.prefix) - if self.version_id is not None: - serializer.write_string( - _SCHEMA_S3_LOCATION.members["versionId"], self.version_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bucket"] = de.read_string( - _SCHEMA_S3_LOCATION.members["bucket"] - ) - - case 1: - kwargs["prefix"] = de.read_string( - _SCHEMA_S3_LOCATION.members["prefix"] - ) - - case 2: - kwargs["version_id"] = de.read_string( - _SCHEMA_S3_LOCATION.members["versionId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_S3_LOCATION, consumer=_consumer) - if "bucket" not in kwargs: - kwargs["bucket"] = "" - if "prefix" not in kwargs: - kwargs["prefix"] = "" - return kwargs - - -@dataclass -class ResourceLocationS3: - """ - The Amazon S3 location of the resource. Use this when the resource is - stored in an Amazon S3 bucket. - """ - - value: S3Location - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESOURCE_LOCATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESOURCE_LOCATION.members["s3"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=S3Location.deserialize(deserializer)) - - -@dataclass -class ResourceLocationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ResourceLocation = Union[ResourceLocationS3 | ResourceLocationUnknown] -"""The location of the browser extension.""" - - -class _ResourceLocationDeserializer: - _result: ResourceLocation | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> ResourceLocation: - self._result = None - deserializer.read_struct(_SCHEMA_RESOURCE_LOCATION, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(ResourceLocationS3.deserialize(de)) - - case _: - self._set_result( - ResourceLocationUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: ResourceLocation) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class BrowserEnterprisePolicyType(UnknownEnumMixin, StrEnum): - """ - The type of browser enterprise policy. Available values are `MANAGED` - and `RECOMMENDED`. - """ - - MANAGED = "MANAGED" - RECOMMENDED = "RECOMMENDED" - - -@dataclass(kw_only=True) -class BrowserEnterprisePolicy: - """Browser enterprise policy configuration.""" - - location: ResourceLocation - """The location of the enterprise policy file.""" - - type: str | None = None - """The enterprise policy type. See BrowserEnterprisePolicyType.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BROWSER_ENTERPRISE_POLICY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_BROWSER_ENTERPRISE_POLICY.members["location"], self.location - ) - if self.type is not None: - serializer.write_string( - _SCHEMA_BROWSER_ENTERPRISE_POLICY.members["type"], self.type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["location"] = _ResourceLocationDeserializer().deserialize(de) - - case 1: - kwargs["type"] = BrowserEnterprisePolicyType( - de.read_string( - _SCHEMA_BROWSER_ENTERPRISE_POLICY.members["type"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BROWSER_ENTERPRISE_POLICY, consumer=_consumer) - if "location" not in kwargs: - kwargs["location"] = ResourceLocationUnknown(tag="") - return kwargs - - -def _serialize_browser_enterprise_policies( - serializer: ShapeSerializer, schema: Schema, value: list[BrowserEnterprisePolicy] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_browser_enterprise_policies( - deserializer: ShapeDeserializer, schema: Schema -) -> list[BrowserEnterprisePolicy]: - result: list[BrowserEnterprisePolicy] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(BrowserEnterprisePolicy.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class BrowserExtension: - """Browser extension configuration.""" - - location: ResourceLocation - """ - The location where the browser extension files are stored. This - specifies the source from which the extension will be loaded and - installed. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BROWSER_EXTENSION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_BROWSER_EXTENSION.members["location"], self.location - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["location"] = _ResourceLocationDeserializer().deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BROWSER_EXTENSION, consumer=_consumer) - if "location" not in kwargs: - kwargs["location"] = ResourceLocationUnknown(tag="") - return kwargs - - -def _serialize_browser_extensions( - serializer: ShapeSerializer, schema: Schema, value: list[BrowserExtension] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_browser_extensions( - deserializer: ShapeDeserializer, schema: Schema -) -> list[BrowserExtension]: - result: list[BrowserExtension] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(BrowserExtension.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class EfsConfiguration: - """ - The configuration for mounting an Amazon Elastic File System (Amazon - EFS) access point that you own into a session. - """ - - access_point_arn: str - """ - The Amazon Resource Name (ARN) of the Amazon Elastic File System (Amazon - EFS) access point to mount. - """ - - mount_path: str - """ - The absolute path within the session at which the access point is - mounted, for example `/mnt/efs`. Each mount path must be unique across - all file system configurations in the session. - """ - - file_system_arn: str - """ - The Amazon Resource Name (ARN) of the Amazon Elastic File System (Amazon - EFS) file system that owns the access point. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EFS_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_EFS_CONFIGURATION.members["accessPointArn"], self.access_point_arn - ) - serializer.write_string( - _SCHEMA_EFS_CONFIGURATION.members["mountPath"], self.mount_path - ) - serializer.write_string( - _SCHEMA_EFS_CONFIGURATION.members["fileSystemArn"], self.file_system_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["access_point_arn"] = de.read_string( - _SCHEMA_EFS_CONFIGURATION.members["accessPointArn"] - ) - - case 1: - kwargs["mount_path"] = de.read_string( - _SCHEMA_EFS_CONFIGURATION.members["mountPath"] - ) - - case 2: - kwargs["file_system_arn"] = de.read_string( - _SCHEMA_EFS_CONFIGURATION.members["fileSystemArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EFS_CONFIGURATION, consumer=_consumer) - if "access_point_arn" not in kwargs: - kwargs["access_point_arn"] = "" - if "mount_path" not in kwargs: - kwargs["mount_path"] = "" - if "file_system_arn" not in kwargs: - kwargs["file_system_arn"] = "" - return kwargs - - -@dataclass(kw_only=True) -class S3FilesConfiguration: - """ - The configuration for mounting an Amazon Simple Storage Service (Amazon - S3) Files access point that you own into a session. - """ - - access_point_arn: str - """ - The Amazon Resource Name (ARN) of the Amazon Simple Storage Service - (Amazon S3) Files access point to mount. - """ - - mount_path: str - """ - The absolute path within the session at which the access point is - mounted, for example `/mnt/s3data`. Each mount path must be unique - across all file system configurations in the session. - """ - - file_system_arn: str - """ - The Amazon Resource Name (ARN) of the Amazon Simple Storage Service - (Amazon S3) Files file system that owns the access point. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_S3_FILES_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_S3_FILES_CONFIGURATION.members["accessPointArn"], - self.access_point_arn, - ) - serializer.write_string( - _SCHEMA_S3_FILES_CONFIGURATION.members["mountPath"], self.mount_path - ) - serializer.write_string( - _SCHEMA_S3_FILES_CONFIGURATION.members["fileSystemArn"], - self.file_system_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["access_point_arn"] = de.read_string( - _SCHEMA_S3_FILES_CONFIGURATION.members["accessPointArn"] - ) - - case 1: - kwargs["mount_path"] = de.read_string( - _SCHEMA_S3_FILES_CONFIGURATION.members["mountPath"] - ) - - case 2: - kwargs["file_system_arn"] = de.read_string( - _SCHEMA_S3_FILES_CONFIGURATION.members["fileSystemArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_S3_FILES_CONFIGURATION, consumer=_consumer) - if "access_point_arn" not in kwargs: - kwargs["access_point_arn"] = "" - if "mount_path" not in kwargs: - kwargs["mount_path"] = "" - if "file_system_arn" not in kwargs: - kwargs["file_system_arn"] = "" - return kwargs - - -@dataclass -class ToolsFileSystemConfigurationS3FilesConfiguration: - """ - The configuration for mounting your own Amazon Simple Storage Service - (Amazon S3) Files access point into the session. - """ - - value: S3FilesConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOLS_FILE_SYSTEM_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_TOOLS_FILE_SYSTEM_CONFIGURATION.members["s3FilesConfiguration"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=S3FilesConfiguration.deserialize(deserializer)) - - -@dataclass -class ToolsFileSystemConfigurationEfsConfiguration: - """ - The configuration for mounting your own Amazon Elastic File System - (Amazon EFS) access point into the session. - """ - - value: EfsConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOLS_FILE_SYSTEM_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_TOOLS_FILE_SYSTEM_CONFIGURATION.members["efsConfiguration"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=EfsConfiguration.deserialize(deserializer)) - - -@dataclass -class ToolsFileSystemConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ToolsFileSystemConfiguration = Union[ - ToolsFileSystemConfigurationS3FilesConfiguration - | ToolsFileSystemConfigurationEfsConfiguration - | ToolsFileSystemConfigurationUnknown -] -""" -Specifies a file system to mount into the session by providing exactly -one of the following: - -- `s3FilesConfiguration` - Mounts an Amazon Simple Storage Service - (Amazon S3) Files access point. - -- `efsConfiguration` - Mounts an Amazon Elastic File System (Amazon EFS) - access point. -""" - - -class _ToolsFileSystemConfigurationDeserializer: - _result: ToolsFileSystemConfiguration | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> ToolsFileSystemConfiguration: - self._result = None - deserializer.read_struct( - _SCHEMA_TOOLS_FILE_SYSTEM_CONFIGURATION, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - ToolsFileSystemConfigurationS3FilesConfiguration.deserialize(de) - ) - - case 1: - self._set_result( - ToolsFileSystemConfigurationEfsConfiguration.deserialize(de) - ) - - case _: - self._set_result( - ToolsFileSystemConfigurationUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: ToolsFileSystemConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_tools_file_system_configurations( - serializer: ShapeSerializer, - schema: Schema, - value: list[ToolsFileSystemConfiguration], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_tools_file_system_configurations( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ToolsFileSystemConfiguration]: - result: list[ToolsFileSystemConfiguration] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_ToolsFileSystemConfigurationDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class BrowserProfileConfiguration: - """ - The configuration for a browser profile in Amazon Bedrock AgentCore. A - browser profile contains persistent browser data such as cookies and - local storage that can be saved from one browser session and reused in - subsequent sessions. Browser profiles enable continuity for tasks that - require authentication, maintain user preferences, or depend on - previously stored browser state. - """ - - profile_identifier: str - """ - The unique identifier of the browser profile. This identifier is used to - reference the profile when starting new browser sessions or saving - session data to the profile. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BROWSER_PROFILE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_BROWSER_PROFILE_CONFIGURATION.members["profileIdentifier"], - self.profile_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["profile_identifier"] = de.read_string( - _SCHEMA_BROWSER_PROFILE_CONFIGURATION.members[ - "profileIdentifier" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_BROWSER_PROFILE_CONFIGURATION, consumer=_consumer - ) - if "profile_identifier" not in kwargs: - kwargs["profile_identifier"] = "" - return kwargs - - -def _serialize_domain_patterns( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_domain_patterns( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ProxyBypass: - """ - Configuration for domains that should bypass all proxies and connect - directly to the internet. These bypass rules take precedence over all - proxy routing rules. - """ - - domain_patterns: list[str] | None = None - """ - Array of domain patterns that should bypass the proxy. Supports - `.amazonaws.com` for subdomain matching or `amazonaws.com` for exact - domain matching. Requests to these domains connect directly without - using any proxy. Maximum 253 characters per pattern. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PROXY_BYPASS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.domain_patterns is not None: - _serialize_domain_patterns( - serializer, - _SCHEMA_PROXY_BYPASS.members["domainPatterns"], - self.domain_patterns, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["domain_patterns"] = _deserialize_domain_patterns( - de, _SCHEMA_PROXY_BYPASS.members["domainPatterns"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PROXY_BYPASS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class BasicAuth: - """ - Configuration for HTTP Basic Authentication using credentials stored in - Amazon Web Services Secrets Manager. The secret must contain a JSON - object with `username` and `password` string fields. Username allows - alphanumeric characters and `@._+=-` symbols (pattern: - `^[a-zA-Z0-9@._+=\\-]+$`). Password allows alphanumeric characters and - `@._+=-!#$%&*` symbols (pattern: `^[a-zA-Z0-9@._+=\\-!#$%&*]+$`). Both - fields have a maximum length of 256 characters. - """ - - secret_arn: str - """ - The Amazon Resource Name (ARN) of the Amazon Web Services Secrets - Manager secret containing proxy credentials. The secret must be a JSON - object with `username` and `password` string fields that meet validation - requirements. The caller must have `secretsmanager:GetSecretValue` - permission for this ARN. Example secret format: - `{"username": "proxy_user", "password": "secure_password"}` - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BASIC_AUTH, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_BASIC_AUTH.members["secretArn"], self.secret_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["secret_arn"] = de.read_string( - _SCHEMA_BASIC_AUTH.members["secretArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BASIC_AUTH, consumer=_consumer) - if "secret_arn" not in kwargs: - kwargs["secret_arn"] = "" - return kwargs - - -@dataclass -class ProxyCredentialsBasicAuth: - """ - HTTP Basic Authentication credentials (username and password) stored in - Amazon Web Services Secrets Manager. - """ - - value: BasicAuth - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PROXY_CREDENTIALS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_PROXY_CREDENTIALS.members["basicAuth"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=BasicAuth.deserialize(deserializer)) - - -@dataclass -class ProxyCredentialsUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ProxyCredentials = Union[ProxyCredentialsBasicAuth | ProxyCredentialsUnknown] -""" -Union type representing different proxy authentication methods. -Currently supports HTTP Basic Authentication (username and password). -""" - - -class _ProxyCredentialsDeserializer: - _result: ProxyCredentials | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> ProxyCredentials: - self._result = None - deserializer.read_struct(_SCHEMA_PROXY_CREDENTIALS, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(ProxyCredentialsBasicAuth.deserialize(de)) - - case _: - self._set_result( - ProxyCredentialsUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: ProxyCredentials) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class ExternalProxy: - """ - Configuration for a customer-managed external proxy server. Includes - server location, optional domain-based routing patterns, and - authentication credentials. - """ - - server: str - """ - The hostname of the proxy server. Must be a valid DNS hostname (maximum - 253 characters). - """ - - port: int - """The port number of the proxy server. Valid range: 1-65535.""" - - domain_patterns: list[str] | None = None - """ - Optional array of domain patterns that should route through this - specific proxy. Supports `.example.com` for subdomain matching (matches - any subdomain of example.com) or `example.com` for exact domain - matching. If omitted, this proxy acts as a catch-all for domains not - matched by other proxies. Maximum 100 patterns per proxy, each up to 253 - characters. - """ - - credentials: ProxyCredentials | None = None - """ - Optional authentication credentials for the proxy server. If omitted, - the proxy is accessed without authentication (useful for IP-allowlisted - proxies). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EXTERNAL_PROXY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_EXTERNAL_PROXY.members["server"], self.server) - serializer.write_integer(_SCHEMA_EXTERNAL_PROXY.members["port"], self.port) - if self.domain_patterns is not None: - _serialize_domain_patterns( - serializer, - _SCHEMA_EXTERNAL_PROXY.members["domainPatterns"], - self.domain_patterns, - ) - - if self.credentials is not None: - serializer.write_struct( - _SCHEMA_EXTERNAL_PROXY.members["credentials"], self.credentials - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["server"] = de.read_string( - _SCHEMA_EXTERNAL_PROXY.members["server"] - ) - - case 1: - kwargs["port"] = de.read_integer( - _SCHEMA_EXTERNAL_PROXY.members["port"] - ) - - case 2: - kwargs["domain_patterns"] = _deserialize_domain_patterns( - de, _SCHEMA_EXTERNAL_PROXY.members["domainPatterns"] - ) - - case 3: - kwargs["credentials"] = _ProxyCredentialsDeserializer().deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EXTERNAL_PROXY, consumer=_consumer) - if "server" not in kwargs: - kwargs["server"] = "" - if "port" not in kwargs: - kwargs["port"] = 0 - return kwargs - - -@dataclass -class ProxyExternalProxy: - """Configuration for an external customer-managed proxy server.""" - - value: ExternalProxy - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PROXY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PROXY.members["externalProxy"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ExternalProxy.deserialize(deserializer)) - - -@dataclass -class ProxyUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -Proxy = Union[ProxyExternalProxy | ProxyUnknown] -""" -Union type representing different proxy configurations. Currently -supports external customer-managed proxies. -""" - - -class _ProxyDeserializer: - _result: Proxy | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> Proxy: - self._result = None - deserializer.read_struct(_SCHEMA_PROXY, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(ProxyExternalProxy.deserialize(de)) - - case _: - self._set_result(ProxyUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: Proxy) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_proxies( - serializer: ShapeSerializer, schema: Schema, value: list[Proxy] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_proxies( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Proxy]: - result: list[Proxy] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_ProxyDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ProxyConfiguration: - """ - Configuration for routing browser traffic through customer-managed proxy - servers. Supports 1-5 proxy servers for domain-based routing and proxy - bypass rules. - """ - - proxies: list[Proxy] - """ - An array of 1-5 proxy server configurations for domain-based routing. - Each proxy can specify which domains it handles via `domainPatterns`, - enabling flexible routing of different traffic through different proxies - based on destination domain. - """ - - bypass: ProxyBypass | None = None - """ - Optional configuration for domains that should bypass all proxies and - connect directly to their destination, like the internet. Takes - precedence over all proxy routing rules. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PROXY_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_proxies( - serializer, _SCHEMA_PROXY_CONFIGURATION.members["proxies"], self.proxies - ) - if self.bypass is not None: - serializer.write_struct( - _SCHEMA_PROXY_CONFIGURATION.members["bypass"], self.bypass - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["proxies"] = _deserialize_proxies( - de, _SCHEMA_PROXY_CONFIGURATION.members["proxies"] - ) - - case 1: - kwargs["bypass"] = ProxyBypass.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PROXY_CONFIGURATION, consumer=_consumer) - if "proxies" not in kwargs: - kwargs["proxies"] = [] - return kwargs - - -class BrowserSessionStatus(UnknownEnumMixin, StrEnum): - READY = "READY" - TERMINATED = "TERMINATED" - - -class AutomationStreamStatus(UnknownEnumMixin, StrEnum): - ENABLED = "ENABLED" - DISABLED = "DISABLED" - - -@dataclass(kw_only=True) -class AutomationStream: - """ - The configuration for a stream that enables programmatic control of a - browser session in Amazon Bedrock AgentCore. This stream provides a - bidirectional communication channel for sending commands to the browser - and receiving responses, allowing agents to automate web interactions - such as navigation, form filling, and element clicking. - """ - - stream_endpoint: str - """ - The endpoint URL for the automation stream. This URL is used to - establish a WebSocket connection to the stream for sending commands and - receiving responses. - """ - - stream_status: str - """ - The current status of the automation stream. This indicates whether the - stream is available for use. Possible values include ACTIVE, CONNECTING, - and DISCONNECTED. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATION_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AUTOMATION_STREAM.members["streamEndpoint"], self.stream_endpoint - ) - serializer.write_string( - _SCHEMA_AUTOMATION_STREAM.members["streamStatus"], self.stream_status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["stream_endpoint"] = de.read_string( - _SCHEMA_AUTOMATION_STREAM.members["streamEndpoint"] - ) - - case 1: - kwargs["stream_status"] = AutomationStreamStatus( - de.read_string( - _SCHEMA_AUTOMATION_STREAM.members["streamStatus"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AUTOMATION_STREAM, consumer=_consumer) - if "stream_endpoint" not in kwargs: - kwargs["stream_endpoint"] = "" - if "stream_status" not in kwargs: - kwargs["stream_status"] = AutomationStreamStatus._corrected("") - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls( - stream_endpoint="", stream_status=AutomationStreamStatus._corrected("") - ) - - -@dataclass(kw_only=True) -class LiveViewStream: - """ - The configuration for a stream that provides a visual representation of - a browser session in Amazon Bedrock AgentCore. This stream enables - agents to observe the current state of the browser, including rendered - web pages, visual elements, and the results of interactions. - """ - - stream_endpoint: str | None = None - """ - The endpoint URL for the live view stream. This URL is used to establish - a connection to receive visual updates from the browser session. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIVE_VIEW_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.stream_endpoint is not None: - serializer.write_string( - _SCHEMA_LIVE_VIEW_STREAM.members["streamEndpoint"], self.stream_endpoint - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["stream_endpoint"] = de.read_string( - _SCHEMA_LIVE_VIEW_STREAM.members["streamEndpoint"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIVE_VIEW_STREAM, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class BrowserSessionStream: - """ - The collection of streams associated with a browser session in Amazon - Bedrock AgentCore. These streams provide different ways to interact with - and observe the browser session, including programmatic control and - visual representation of the browser content. - """ - - automation_stream: AutomationStream - """ - The stream that enables programmatic control of the browser. This stream - allows agents to perform actions such as navigating to URLs, clicking - elements, and filling forms. - """ - - live_view_stream: LiveViewStream | None = None - """ - The stream that provides a visual representation of the browser content. - This stream allows agents to observe the current state of the browser, - including rendered web pages and visual elements. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BROWSER_SESSION_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_BROWSER_SESSION_STREAM.members["automationStream"], - self.automation_stream, - ) - if self.live_view_stream is not None: - serializer.write_struct( - _SCHEMA_BROWSER_SESSION_STREAM.members["liveViewStream"], - self.live_view_stream, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["automation_stream"] = AutomationStream.deserialize(de) - - case 1: - kwargs["live_view_stream"] = LiveViewStream.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BROWSER_SESSION_STREAM, consumer=_consumer) - if "automation_stream" not in kwargs: - kwargs["automation_stream"] = AutomationStream._smithy_default() - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(automation_stream=AutomationStream._smithy_default()) - - -@dataclass(kw_only=True) -class ViewPort: - """ - The configuration that defines the dimensions of a browser viewport in a - browser session. The viewport determines the visible area of web content - and affects how web pages are rendered and displayed. Proper viewport - configuration ensures that web content is displayed correctly for the - agent's browsing tasks. - """ - - width: int - """ - The width of the viewport in pixels. This value determines the - horizontal dimension of the visible area. Valid values range from 800 to - 1920 pixels. - """ - - height: int - """ - The height of the viewport in pixels. This value determines the vertical - dimension of the visible area. Valid values range from 600 to 1080 - pixels. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VIEW_PORT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer(_SCHEMA_VIEW_PORT.members["width"], self.width) - serializer.write_integer(_SCHEMA_VIEW_PORT.members["height"], self.height) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["width"] = de.read_integer( - _SCHEMA_VIEW_PORT.members["width"] - ) - - case 1: - kwargs["height"] = de.read_integer( - _SCHEMA_VIEW_PORT.members["height"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VIEW_PORT, consumer=_consumer) - if "width" not in kwargs: - kwargs["width"] = 0 - if "height" not in kwargs: - kwargs["height"] = 0 - return kwargs - - -@dataclass(kw_only=True) -class GetBrowserSessionOutput: - """Dataclass for GetBrowserSessionOutput structure.""" - - browser_identifier: str - """The identifier of the browser.""" - - session_id: str - """The identifier of the browser session.""" - - created_at: datetime - """The time at which the browser session was created.""" - - name: str | None = None - """The name of the browser session.""" - - view_port: ViewPort | None = None - """ - The configuration that defines the dimensions of a browser viewport in a - browser session. The viewport determines the visible area of web content - and affects how web pages are rendered and displayed. Proper viewport - configuration ensures that web content is displayed correctly for the - agent's browsing tasks. - """ - - extensions: list[BrowserExtension] | None = None - """ - The list of browser extensions that are configured in the browser - session. - """ - - enterprise_policies: list[BrowserEnterprisePolicy] | None = None - """A list of files containing enterprise policies for the browser session.""" - - profile_configuration: BrowserProfileConfiguration | None = None - """ - The browser profile configuration associated with this session. Contains - the profile identifier that links to persistent browser data such as - cookies and local storage. - """ - - session_timeout_seconds: int | None = None - """The timeout period for the browser session in seconds.""" - - status: str | None = None - """ - The current status of the browser session. Possible values include - ACTIVE, STOPPING, and STOPPED. - """ - - streams: BrowserSessionStream | None = None - """ - The streams associated with this browser session. These include the - automation stream and live view stream. - """ - - proxy_configuration: ProxyConfiguration | None = None - """ - The active proxy configuration for this browser session. This field is - only present if proxy configuration was provided when the session was - started using `StartBrowserSession`. The configuration includes proxy - servers, domain bypass rules and the proxy authentication credentials. - """ - - certificates: list[Certificate] | None = None - """The list of certificates installed in the browser session.""" - - filesystem_configurations: list[ToolsFileSystemConfiguration] | None = None - """ - The file system configurations for the browser session. Each entry - describes an access point and its mount path. - """ - - session_replay_artifact: str | None = None - """The artifact containing the session replay information.""" - - last_updated_at: datetime | None = None - """The time at which the browser session was last updated.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_BROWSER_SESSION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_BROWSER_SESSION_OUTPUT.members["browserIdentifier"], - self.browser_identifier, - ) - serializer.write_string( - _SCHEMA_GET_BROWSER_SESSION_OUTPUT.members["sessionId"], self.session_id - ) - if self.name is not None: - serializer.write_string( - _SCHEMA_GET_BROWSER_SESSION_OUTPUT.members["name"], self.name - ) - - serializer.write_timestamp( - _SCHEMA_GET_BROWSER_SESSION_OUTPUT.members["createdAt"], self.created_at - ) - if self.view_port is not None: - serializer.write_struct( - _SCHEMA_GET_BROWSER_SESSION_OUTPUT.members["viewPort"], self.view_port - ) - - if self.extensions is not None: - _serialize_browser_extensions( - serializer, - _SCHEMA_GET_BROWSER_SESSION_OUTPUT.members["extensions"], - self.extensions, - ) - - if self.enterprise_policies is not None: - _serialize_browser_enterprise_policies( - serializer, - _SCHEMA_GET_BROWSER_SESSION_OUTPUT.members["enterprisePolicies"], - self.enterprise_policies, - ) - - if self.profile_configuration is not None: - serializer.write_struct( - _SCHEMA_GET_BROWSER_SESSION_OUTPUT.members["profileConfiguration"], - self.profile_configuration, - ) - - if self.session_timeout_seconds is not None: - serializer.write_integer( - _SCHEMA_GET_BROWSER_SESSION_OUTPUT.members["sessionTimeoutSeconds"], - self.session_timeout_seconds, - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_GET_BROWSER_SESSION_OUTPUT.members["status"], self.status - ) - - if self.streams is not None: - serializer.write_struct( - _SCHEMA_GET_BROWSER_SESSION_OUTPUT.members["streams"], self.streams - ) - - if self.proxy_configuration is not None: - serializer.write_struct( - _SCHEMA_GET_BROWSER_SESSION_OUTPUT.members["proxyConfiguration"], - self.proxy_configuration, - ) - - if self.certificates is not None: - _serialize_certificates( - serializer, - _SCHEMA_GET_BROWSER_SESSION_OUTPUT.members["certificates"], - self.certificates, - ) - - if self.filesystem_configurations is not None: - _serialize_tools_file_system_configurations( - serializer, - _SCHEMA_GET_BROWSER_SESSION_OUTPUT.members["filesystemConfigurations"], - self.filesystem_configurations, - ) - - if self.session_replay_artifact is not None: - serializer.write_string( - _SCHEMA_GET_BROWSER_SESSION_OUTPUT.members["sessionReplayArtifact"], - self.session_replay_artifact, - ) - - if self.last_updated_at is not None: - serializer.write_timestamp( - _SCHEMA_GET_BROWSER_SESSION_OUTPUT.members["lastUpdatedAt"], - self.last_updated_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["browser_identifier"] = de.read_string( - _SCHEMA_GET_BROWSER_SESSION_OUTPUT.members["browserIdentifier"] - ) - - case 1: - kwargs["session_id"] = de.read_string( - _SCHEMA_GET_BROWSER_SESSION_OUTPUT.members["sessionId"] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_GET_BROWSER_SESSION_OUTPUT.members["name"] - ) - - case 3: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_BROWSER_SESSION_OUTPUT.members["createdAt"] - ) - - case 4: - kwargs["view_port"] = ViewPort.deserialize(de) - - case 5: - kwargs["extensions"] = _deserialize_browser_extensions( - de, _SCHEMA_GET_BROWSER_SESSION_OUTPUT.members["extensions"] - ) - - case 6: - kwargs["enterprise_policies"] = ( - _deserialize_browser_enterprise_policies( - de, - _SCHEMA_GET_BROWSER_SESSION_OUTPUT.members[ - "enterprisePolicies" - ], - ) - ) - - case 7: - kwargs["profile_configuration"] = ( - BrowserProfileConfiguration.deserialize(de) - ) - - case 8: - kwargs["session_timeout_seconds"] = de.read_integer( - _SCHEMA_GET_BROWSER_SESSION_OUTPUT.members[ - "sessionTimeoutSeconds" - ] - ) - - case 9: - kwargs["status"] = BrowserSessionStatus( - de.read_string( - _SCHEMA_GET_BROWSER_SESSION_OUTPUT.members["status"] - ) - ) - - case 10: - kwargs["streams"] = BrowserSessionStream.deserialize(de) - - case 11: - kwargs["proxy_configuration"] = ProxyConfiguration.deserialize(de) - - case 12: - kwargs["certificates"] = _deserialize_certificates( - de, _SCHEMA_GET_BROWSER_SESSION_OUTPUT.members["certificates"] - ) - - case 13: - kwargs["filesystem_configurations"] = ( - _deserialize_tools_file_system_configurations( - de, - _SCHEMA_GET_BROWSER_SESSION_OUTPUT.members[ - "filesystemConfigurations" - ], - ) - ) - - case 14: - kwargs["session_replay_artifact"] = de.read_string( - _SCHEMA_GET_BROWSER_SESSION_OUTPUT.members[ - "sessionReplayArtifact" - ] - ) - - case 15: - kwargs["last_updated_at"] = de.read_timestamp( - _SCHEMA_GET_BROWSER_SESSION_OUTPUT.members["lastUpdatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_BROWSER_SESSION_OUTPUT, consumer=_consumer) - if "browser_identifier" not in kwargs: - kwargs["browser_identifier"] = "" - if "session_id" not in kwargs: - kwargs["session_id"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -GET_BROWSER_SESSION = APIOperation( - input=GetBrowserSessionInput, - output=GetBrowserSessionOutput, - schema=_SCHEMA_GET_BROWSER_SESSION, - input_schema=_SCHEMA_GET_BROWSER_SESSION_INPUT, - output_schema=_SCHEMA_GET_BROWSER_SESSION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class KeyPressArguments: - """Arguments for a key press action.""" - - key: str - """The key name to press (for example, `enter`, `tab`, `escape`).""" - - presses: int | None = None - """ - The number of times to press the key. Valid range: 1--100. Defaults to - 1. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KEY_PRESS_ARGUMENTS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_KEY_PRESS_ARGUMENTS.members["key"], self.key) - if self.presses is not None: - serializer.write_integer( - _SCHEMA_KEY_PRESS_ARGUMENTS.members["presses"], self.presses - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["key"] = de.read_string( - _SCHEMA_KEY_PRESS_ARGUMENTS.members["key"] - ) - - case 1: - kwargs["presses"] = de.read_integer( - _SCHEMA_KEY_PRESS_ARGUMENTS.members["presses"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_KEY_PRESS_ARGUMENTS, consumer=_consumer) - if "key" not in kwargs: - kwargs["key"] = "" - return kwargs - - -def _serialize_key_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_key_list(deserializer: ShapeDeserializer, schema: Schema) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class KeyShortcutArguments: - """Arguments for a key shortcut action.""" - - keys: list[str] - """ - The key combination to press (for example, `["ctrl", "s"]`). Maximum 5 - keys. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KEY_SHORTCUT_ARGUMENTS, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_key_list( - serializer, _SCHEMA_KEY_SHORTCUT_ARGUMENTS.members["keys"], self.keys - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["keys"] = _deserialize_key_list( - de, _SCHEMA_KEY_SHORTCUT_ARGUMENTS.members["keys"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_KEY_SHORTCUT_ARGUMENTS, consumer=_consumer) - if "keys" not in kwargs: - kwargs["keys"] = [] - return kwargs - - -@dataclass(kw_only=True) -class KeyTypeArguments: - """Arguments for a key type action.""" - - text: str - """The text string to type. Maximum length: 10,000 characters.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KEY_TYPE_ARGUMENTS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_KEY_TYPE_ARGUMENTS.members["text"], self.text) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["text"] = de.read_string( - _SCHEMA_KEY_TYPE_ARGUMENTS.members["text"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_KEY_TYPE_ARGUMENTS, consumer=_consumer) - if "text" not in kwargs: - kwargs["text"] = "" - return kwargs - - -class MouseButton(UnknownEnumMixin, StrEnum): - """The mouse button to use for a browser mouse action.""" - - LEFT = "LEFT" - RIGHT = "RIGHT" - MIDDLE = "MIDDLE" - - -@dataclass(kw_only=True) -class MouseClickArguments: - """Arguments for a mouse click action.""" - - x: int - """The X coordinate on screen where the click occurs.""" - - y: int - """The Y coordinate on screen where the click occurs.""" - - button: str | None = None - """The mouse button to use. Defaults to `LEFT`.""" - - click_count: int | None = None - """The number of clicks to perform. Valid range: 1--10. Defaults to 1.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MOUSE_CLICK_ARGUMENTS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer(_SCHEMA_MOUSE_CLICK_ARGUMENTS.members["x"], self.x) - serializer.write_integer(_SCHEMA_MOUSE_CLICK_ARGUMENTS.members["y"], self.y) - if self.button is not None: - serializer.write_string( - _SCHEMA_MOUSE_CLICK_ARGUMENTS.members["button"], self.button - ) - - if self.click_count is not None: - serializer.write_integer( - _SCHEMA_MOUSE_CLICK_ARGUMENTS.members["clickCount"], self.click_count - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["x"] = de.read_integer( - _SCHEMA_MOUSE_CLICK_ARGUMENTS.members["x"] - ) - - case 1: - kwargs["y"] = de.read_integer( - _SCHEMA_MOUSE_CLICK_ARGUMENTS.members["y"] - ) - - case 2: - kwargs["button"] = MouseButton( - de.read_string(_SCHEMA_MOUSE_CLICK_ARGUMENTS.members["button"]) - ) - - case 3: - kwargs["click_count"] = de.read_integer( - _SCHEMA_MOUSE_CLICK_ARGUMENTS.members["clickCount"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MOUSE_CLICK_ARGUMENTS, consumer=_consumer) - if "x" not in kwargs: - kwargs["x"] = 0 - if "y" not in kwargs: - kwargs["y"] = 0 - return kwargs - - -@dataclass(kw_only=True) -class MouseDragArguments: - """Arguments for a mouse drag action.""" - - end_x: int - """The ending X coordinate for the drag.""" - - end_y: int - """The ending Y coordinate for the drag.""" - - start_x: int - """The starting X coordinate for the drag.""" - - start_y: int - """The starting Y coordinate for the drag.""" - - button: str | None = None - """The mouse button to use for the drag. Defaults to `LEFT`.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MOUSE_DRAG_ARGUMENTS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer( - _SCHEMA_MOUSE_DRAG_ARGUMENTS.members["endX"], self.end_x - ) - serializer.write_integer( - _SCHEMA_MOUSE_DRAG_ARGUMENTS.members["endY"], self.end_y - ) - serializer.write_integer( - _SCHEMA_MOUSE_DRAG_ARGUMENTS.members["startX"], self.start_x - ) - serializer.write_integer( - _SCHEMA_MOUSE_DRAG_ARGUMENTS.members["startY"], self.start_y - ) - if self.button is not None: - serializer.write_string( - _SCHEMA_MOUSE_DRAG_ARGUMENTS.members["button"], self.button - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["end_x"] = de.read_integer( - _SCHEMA_MOUSE_DRAG_ARGUMENTS.members["endX"] - ) - - case 1: - kwargs["end_y"] = de.read_integer( - _SCHEMA_MOUSE_DRAG_ARGUMENTS.members["endY"] - ) - - case 2: - kwargs["start_x"] = de.read_integer( - _SCHEMA_MOUSE_DRAG_ARGUMENTS.members["startX"] - ) - - case 3: - kwargs["start_y"] = de.read_integer( - _SCHEMA_MOUSE_DRAG_ARGUMENTS.members["startY"] - ) - - case 4: - kwargs["button"] = MouseButton( - de.read_string(_SCHEMA_MOUSE_DRAG_ARGUMENTS.members["button"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MOUSE_DRAG_ARGUMENTS, consumer=_consumer) - if "end_x" not in kwargs: - kwargs["end_x"] = 0 - if "end_y" not in kwargs: - kwargs["end_y"] = 0 - if "start_x" not in kwargs: - kwargs["start_x"] = 0 - if "start_y" not in kwargs: - kwargs["start_y"] = 0 - return kwargs - - -@dataclass(kw_only=True) -class MouseMoveArguments: - """Arguments for a mouse move action.""" - - x: int - """The target X coordinate on screen.""" - - y: int - """The target Y coordinate on screen.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MOUSE_MOVE_ARGUMENTS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer(_SCHEMA_MOUSE_MOVE_ARGUMENTS.members["x"], self.x) - serializer.write_integer(_SCHEMA_MOUSE_MOVE_ARGUMENTS.members["y"], self.y) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["x"] = de.read_integer( - _SCHEMA_MOUSE_MOVE_ARGUMENTS.members["x"] - ) - - case 1: - kwargs["y"] = de.read_integer( - _SCHEMA_MOUSE_MOVE_ARGUMENTS.members["y"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MOUSE_MOVE_ARGUMENTS, consumer=_consumer) - if "x" not in kwargs: - kwargs["x"] = 0 - if "y" not in kwargs: - kwargs["y"] = 0 - return kwargs - - -@dataclass(kw_only=True) -class MouseScrollArguments: - """Arguments for a mouse scroll action.""" - - x: int - """The X coordinate on screen where the scroll occurs.""" - - y: int - """The Y coordinate on screen where the scroll occurs.""" - - delta_x: int | None = None - """The horizontal scroll delta. Valid range: -1000 to 1000.""" - - delta_y: int | None = None - """ - The vertical scroll delta. Valid range: -1000 to 1000. Negative values - scroll down. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MOUSE_SCROLL_ARGUMENTS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer(_SCHEMA_MOUSE_SCROLL_ARGUMENTS.members["x"], self.x) - serializer.write_integer(_SCHEMA_MOUSE_SCROLL_ARGUMENTS.members["y"], self.y) - if self.delta_x is not None: - serializer.write_integer( - _SCHEMA_MOUSE_SCROLL_ARGUMENTS.members["deltaX"], self.delta_x - ) - - if self.delta_y is not None: - serializer.write_integer( - _SCHEMA_MOUSE_SCROLL_ARGUMENTS.members["deltaY"], self.delta_y - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["x"] = de.read_integer( - _SCHEMA_MOUSE_SCROLL_ARGUMENTS.members["x"] - ) - - case 1: - kwargs["y"] = de.read_integer( - _SCHEMA_MOUSE_SCROLL_ARGUMENTS.members["y"] - ) - - case 2: - kwargs["delta_x"] = de.read_integer( - _SCHEMA_MOUSE_SCROLL_ARGUMENTS.members["deltaX"] - ) - - case 3: - kwargs["delta_y"] = de.read_integer( - _SCHEMA_MOUSE_SCROLL_ARGUMENTS.members["deltaY"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MOUSE_SCROLL_ARGUMENTS, consumer=_consumer) - if "x" not in kwargs: - kwargs["x"] = 0 - if "y" not in kwargs: - kwargs["y"] = 0 - return kwargs - - -class ScreenshotFormat(UnknownEnumMixin, StrEnum): - """The image format for a browser screenshot.""" - - PNG = "PNG" - - -@dataclass(kw_only=True) -class ScreenshotArguments: - """Arguments for a screenshot action.""" - - format: str | None = None - """The image format for the screenshot. Defaults to `PNG`.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SCREENSHOT_ARGUMENTS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.format is not None: - serializer.write_string( - _SCHEMA_SCREENSHOT_ARGUMENTS.members["format"], self.format - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["format"] = ScreenshotFormat( - de.read_string(_SCHEMA_SCREENSHOT_ARGUMENTS.members["format"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SCREENSHOT_ARGUMENTS, consumer=_consumer) - return kwargs - - -@dataclass -class BrowserActionMouseClick: - """Click at the specified coordinates.""" - - value: MouseClickArguments - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BROWSER_ACTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_BROWSER_ACTION.members["mouseClick"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=MouseClickArguments.deserialize(deserializer)) - - -@dataclass -class BrowserActionMouseMove: - """Move the cursor to the specified coordinates.""" - - value: MouseMoveArguments - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BROWSER_ACTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BROWSER_ACTION.members["mouseMove"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=MouseMoveArguments.deserialize(deserializer)) - - -@dataclass -class BrowserActionMouseDrag: - """Drag from a start position to an end position.""" - - value: MouseDragArguments - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BROWSER_ACTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BROWSER_ACTION.members["mouseDrag"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=MouseDragArguments.deserialize(deserializer)) - - -@dataclass -class BrowserActionMouseScroll: - """Scroll at the specified position.""" - - value: MouseScrollArguments - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BROWSER_ACTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_BROWSER_ACTION.members["mouseScroll"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=MouseScrollArguments.deserialize(deserializer)) - - -@dataclass -class BrowserActionKeyType: - """Type a string of text.""" - - value: KeyTypeArguments - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BROWSER_ACTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BROWSER_ACTION.members["keyType"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=KeyTypeArguments.deserialize(deserializer)) - - -@dataclass -class BrowserActionKeyPress: - """Press a key one or more times.""" - - value: KeyPressArguments - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BROWSER_ACTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BROWSER_ACTION.members["keyPress"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=KeyPressArguments.deserialize(deserializer)) - - -@dataclass -class BrowserActionKeyShortcut: - """Press a key combination.""" - - value: KeyShortcutArguments - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BROWSER_ACTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_BROWSER_ACTION.members["keyShortcut"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=KeyShortcutArguments.deserialize(deserializer)) - - -@dataclass -class BrowserActionScreenshot: - """Capture a full-screen screenshot.""" - - value: ScreenshotArguments - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BROWSER_ACTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_BROWSER_ACTION.members["screenshot"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ScreenshotArguments.deserialize(deserializer)) - - -@dataclass -class BrowserActionUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -BrowserAction = Union[ - BrowserActionMouseClick - | BrowserActionMouseMove - | BrowserActionMouseDrag - | BrowserActionMouseScroll - | BrowserActionKeyType - | BrowserActionKeyPress - | BrowserActionKeyShortcut - | BrowserActionScreenshot - | BrowserActionUnknown -] -""" -The browser action to perform. Exactly one member must be set per -request. -""" - - -class _BrowserActionDeserializer: - _result: BrowserAction | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> BrowserAction: - self._result = None - deserializer.read_struct(_SCHEMA_BROWSER_ACTION, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(BrowserActionMouseClick.deserialize(de)) - - case 1: - self._set_result(BrowserActionMouseMove.deserialize(de)) - - case 2: - self._set_result(BrowserActionMouseDrag.deserialize(de)) - - case 3: - self._set_result(BrowserActionMouseScroll.deserialize(de)) - - case 4: - self._set_result(BrowserActionKeyType.deserialize(de)) - - case 5: - self._set_result(BrowserActionKeyPress.deserialize(de)) - - case 6: - self._set_result(BrowserActionKeyShortcut.deserialize(de)) - - case 7: - self._set_result(BrowserActionScreenshot.deserialize(de)) - - case _: - self._set_result(BrowserActionUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: BrowserAction) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class InvokeBrowserInput: - """Request for the InvokeBrowser operation.""" - - browser_identifier: str | None = None - """ - The unique identifier of the browser associated with the session. This - must match the identifier used when creating the session with - `StartBrowserSession`. - """ - - session_id: str | None = None - """ - The unique identifier of the browser session on which to perform the - action. This must be an active session created with - `StartBrowserSession`. - """ - - action: BrowserAction | None = None - """ - The browser action to perform. Exactly one member of the `BrowserAction` - union must be set per request. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOKE_BROWSER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.browser_identifier is not None: - serializer.write_string( - _SCHEMA_INVOKE_BROWSER_INPUT.members["browserIdentifier"], - self.browser_identifier, - ) - - if self.session_id is not None: - serializer.write_string( - _SCHEMA_INVOKE_BROWSER_INPUT.members["sessionId"], self.session_id - ) - - if self.action is not None: - serializer.write_struct( - _SCHEMA_INVOKE_BROWSER_INPUT.members["action"], self.action - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["browser_identifier"] = de.read_string( - _SCHEMA_INVOKE_BROWSER_INPUT.members["browserIdentifier"] - ) - - case 1: - kwargs["session_id"] = de.read_string( - _SCHEMA_INVOKE_BROWSER_INPUT.members["sessionId"] - ) - - case 2: - kwargs["action"] = _BrowserActionDeserializer().deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INVOKE_BROWSER_INPUT, consumer=_consumer) - return kwargs - - -class BrowserActionStatus(UnknownEnumMixin, StrEnum): - """The status of a browser action execution.""" - - SUCCESS = "SUCCESS" - FAILED = "FAILED" - - -@dataclass(kw_only=True) -class KeyPressResult: - """The result of a key press action.""" - - status: str - """The status of the action execution.""" - - error: str | None = None - """The error message. Present only when the action failed.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KEY_PRESS_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_KEY_PRESS_RESULT.members["status"], self.status) - if self.error is not None: - serializer.write_string( - _SCHEMA_KEY_PRESS_RESULT.members["error"], self.error - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["status"] = BrowserActionStatus( - de.read_string(_SCHEMA_KEY_PRESS_RESULT.members["status"]) - ) - - case 1: - kwargs["error"] = de.read_string( - _SCHEMA_KEY_PRESS_RESULT.members["error"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_KEY_PRESS_RESULT, consumer=_consumer) - if "status" not in kwargs: - kwargs["status"] = BrowserActionStatus._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class KeyShortcutResult: - """The result of a key shortcut action.""" - - status: str - """The status of the action execution.""" - - error: str | None = None - """The error message. Present only when the action failed.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KEY_SHORTCUT_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_KEY_SHORTCUT_RESULT.members["status"], self.status - ) - if self.error is not None: - serializer.write_string( - _SCHEMA_KEY_SHORTCUT_RESULT.members["error"], self.error - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["status"] = BrowserActionStatus( - de.read_string(_SCHEMA_KEY_SHORTCUT_RESULT.members["status"]) - ) - - case 1: - kwargs["error"] = de.read_string( - _SCHEMA_KEY_SHORTCUT_RESULT.members["error"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_KEY_SHORTCUT_RESULT, consumer=_consumer) - if "status" not in kwargs: - kwargs["status"] = BrowserActionStatus._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class KeyTypeResult: - """The result of a key type action.""" - - status: str - """The status of the action execution.""" - - error: str | None = None - """The error message. Present only when the action failed.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KEY_TYPE_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_KEY_TYPE_RESULT.members["status"], self.status) - if self.error is not None: - serializer.write_string( - _SCHEMA_KEY_TYPE_RESULT.members["error"], self.error - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["status"] = BrowserActionStatus( - de.read_string(_SCHEMA_KEY_TYPE_RESULT.members["status"]) - ) - - case 1: - kwargs["error"] = de.read_string( - _SCHEMA_KEY_TYPE_RESULT.members["error"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_KEY_TYPE_RESULT, consumer=_consumer) - if "status" not in kwargs: - kwargs["status"] = BrowserActionStatus._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class MouseClickResult: - """The result of a mouse click action.""" - - status: str - """The status of the action execution.""" - - error: str | None = None - """The error message. Present only when the action failed.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MOUSE_CLICK_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MOUSE_CLICK_RESULT.members["status"], self.status - ) - if self.error is not None: - serializer.write_string( - _SCHEMA_MOUSE_CLICK_RESULT.members["error"], self.error - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["status"] = BrowserActionStatus( - de.read_string(_SCHEMA_MOUSE_CLICK_RESULT.members["status"]) - ) - - case 1: - kwargs["error"] = de.read_string( - _SCHEMA_MOUSE_CLICK_RESULT.members["error"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MOUSE_CLICK_RESULT, consumer=_consumer) - if "status" not in kwargs: - kwargs["status"] = BrowserActionStatus._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class MouseDragResult: - """The result of a mouse drag action.""" - - status: str - """The status of the action execution.""" - - error: str | None = None - """The error message. Present only when the action failed.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MOUSE_DRAG_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MOUSE_DRAG_RESULT.members["status"], self.status - ) - if self.error is not None: - serializer.write_string( - _SCHEMA_MOUSE_DRAG_RESULT.members["error"], self.error - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["status"] = BrowserActionStatus( - de.read_string(_SCHEMA_MOUSE_DRAG_RESULT.members["status"]) - ) - - case 1: - kwargs["error"] = de.read_string( - _SCHEMA_MOUSE_DRAG_RESULT.members["error"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MOUSE_DRAG_RESULT, consumer=_consumer) - if "status" not in kwargs: - kwargs["status"] = BrowserActionStatus._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class MouseMoveResult: - """The result of a mouse move action.""" - - status: str - """The status of the action execution.""" - - error: str | None = None - """The error message. Present only when the action failed.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MOUSE_MOVE_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MOUSE_MOVE_RESULT.members["status"], self.status - ) - if self.error is not None: - serializer.write_string( - _SCHEMA_MOUSE_MOVE_RESULT.members["error"], self.error - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["status"] = BrowserActionStatus( - de.read_string(_SCHEMA_MOUSE_MOVE_RESULT.members["status"]) - ) - - case 1: - kwargs["error"] = de.read_string( - _SCHEMA_MOUSE_MOVE_RESULT.members["error"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MOUSE_MOVE_RESULT, consumer=_consumer) - if "status" not in kwargs: - kwargs["status"] = BrowserActionStatus._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class MouseScrollResult: - """The result of a mouse scroll action.""" - - status: str - """The status of the action execution.""" - - error: str | None = None - """The error message. Present only when the action failed.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MOUSE_SCROLL_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MOUSE_SCROLL_RESULT.members["status"], self.status - ) - if self.error is not None: - serializer.write_string( - _SCHEMA_MOUSE_SCROLL_RESULT.members["error"], self.error - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["status"] = BrowserActionStatus( - de.read_string(_SCHEMA_MOUSE_SCROLL_RESULT.members["status"]) - ) - - case 1: - kwargs["error"] = de.read_string( - _SCHEMA_MOUSE_SCROLL_RESULT.members["error"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MOUSE_SCROLL_RESULT, consumer=_consumer) - if "status" not in kwargs: - kwargs["status"] = BrowserActionStatus._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class ScreenshotResult: - """The result of a screenshot action.""" - - status: str - """The status of the action execution.""" - - error: str | None = None - """The error message. Present only when the action failed.""" - - data: bytes | None = None - """The base64-encoded image data. Present only when the action succeeded.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SCREENSHOT_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SCREENSHOT_RESULT.members["status"], self.status - ) - if self.error is not None: - serializer.write_string( - _SCHEMA_SCREENSHOT_RESULT.members["error"], self.error - ) - - if self.data is not None: - serializer.write_blob(_SCHEMA_SCREENSHOT_RESULT.members["data"], self.data) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["status"] = BrowserActionStatus( - de.read_string(_SCHEMA_SCREENSHOT_RESULT.members["status"]) - ) - - case 1: - kwargs["error"] = de.read_string( - _SCHEMA_SCREENSHOT_RESULT.members["error"] - ) - - case 2: - kwargs["data"] = de.read_blob( - _SCHEMA_SCREENSHOT_RESULT.members["data"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SCREENSHOT_RESULT, consumer=_consumer) - if "status" not in kwargs: - kwargs["status"] = BrowserActionStatus._corrected("") - return kwargs - - -@dataclass -class BrowserActionResultMouseClick: - """The result of a mouse click action.""" - - value: MouseClickResult - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BROWSER_ACTION_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_BROWSER_ACTION_RESULT.members["mouseClick"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=MouseClickResult.deserialize(deserializer)) - - -@dataclass -class BrowserActionResultMouseMove: - """The result of a mouse move action.""" - - value: MouseMoveResult - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BROWSER_ACTION_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_BROWSER_ACTION_RESULT.members["mouseMove"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=MouseMoveResult.deserialize(deserializer)) - - -@dataclass -class BrowserActionResultMouseDrag: - """The result of a mouse drag action.""" - - value: MouseDragResult - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BROWSER_ACTION_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_BROWSER_ACTION_RESULT.members["mouseDrag"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=MouseDragResult.deserialize(deserializer)) - - -@dataclass -class BrowserActionResultMouseScroll: - """The result of a mouse scroll action.""" - - value: MouseScrollResult - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BROWSER_ACTION_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_BROWSER_ACTION_RESULT.members["mouseScroll"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=MouseScrollResult.deserialize(deserializer)) - - -@dataclass -class BrowserActionResultKeyType: - """The result of a key type action.""" - - value: KeyTypeResult - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BROWSER_ACTION_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_BROWSER_ACTION_RESULT.members["keyType"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=KeyTypeResult.deserialize(deserializer)) - - -@dataclass -class BrowserActionResultKeyPress: - """The result of a key press action.""" - - value: KeyPressResult - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BROWSER_ACTION_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_BROWSER_ACTION_RESULT.members["keyPress"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=KeyPressResult.deserialize(deserializer)) - - -@dataclass -class BrowserActionResultKeyShortcut: - """The result of a key shortcut action.""" - - value: KeyShortcutResult - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BROWSER_ACTION_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_BROWSER_ACTION_RESULT.members["keyShortcut"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=KeyShortcutResult.deserialize(deserializer)) - - -@dataclass -class BrowserActionResultScreenshot: - """The result of a screenshot action.""" - - value: ScreenshotResult - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BROWSER_ACTION_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_BROWSER_ACTION_RESULT.members["screenshot"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ScreenshotResult.deserialize(deserializer)) - - -@dataclass -class BrowserActionResultUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -BrowserActionResult = Union[ - BrowserActionResultMouseClick - | BrowserActionResultMouseMove - | BrowserActionResultMouseDrag - | BrowserActionResultMouseScroll - | BrowserActionResultKeyType - | BrowserActionResultKeyPress - | BrowserActionResultKeyShortcut - | BrowserActionResultScreenshot - | BrowserActionResultUnknown -] -""" -The result of a browser action execution. Exactly one member is set, -matching the action that was performed. -""" - - -class _BrowserActionResultDeserializer: - _result: BrowserActionResult | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> BrowserActionResult: - self._result = None - deserializer.read_struct(_SCHEMA_BROWSER_ACTION_RESULT, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(BrowserActionResultMouseClick.deserialize(de)) - - case 1: - self._set_result(BrowserActionResultMouseMove.deserialize(de)) - - case 2: - self._set_result(BrowserActionResultMouseDrag.deserialize(de)) - - case 3: - self._set_result(BrowserActionResultMouseScroll.deserialize(de)) - - case 4: - self._set_result(BrowserActionResultKeyType.deserialize(de)) - - case 5: - self._set_result(BrowserActionResultKeyPress.deserialize(de)) - - case 6: - self._set_result(BrowserActionResultKeyShortcut.deserialize(de)) - - case 7: - self._set_result(BrowserActionResultScreenshot.deserialize(de)) - - case _: - self._set_result( - BrowserActionResultUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: BrowserActionResult) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class InvokeBrowserOutput: - """Response for the InvokeBrowser operation.""" - - result: BrowserActionResult - """ - The result of the browser action. The member set in the result - corresponds to the action that was performed. - """ - - session_id: str - """ - The unique identifier of the browser session on which the action was - performed. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOKE_BROWSER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_BROWSER_OUTPUT.members["result"], self.result - ) - serializer.write_string( - _SCHEMA_INVOKE_BROWSER_OUTPUT.members["sessionId"], self.session_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["result"] = _BrowserActionResultDeserializer().deserialize( - de - ) - - case 1: - kwargs["session_id"] = de.read_string( - _SCHEMA_INVOKE_BROWSER_OUTPUT.members["sessionId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INVOKE_BROWSER_OUTPUT, consumer=_consumer) - if "result" not in kwargs: - kwargs["result"] = BrowserActionResultUnknown(tag="") - if "session_id" not in kwargs: - kwargs["session_id"] = "" - return kwargs - - -INVOKE_BROWSER = APIOperation( - input=InvokeBrowserInput, - output=InvokeBrowserOutput, - schema=_SCHEMA_INVOKE_BROWSER, - input_schema=_SCHEMA_INVOKE_BROWSER_INPUT, - output_schema=_SCHEMA_INVOKE_BROWSER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListBrowserSessionsInput: - """Dataclass for ListBrowserSessionsInput structure.""" - - browser_identifier: str | None = None - """ - The unique identifier of the browser to list sessions for. If specified, - only sessions for this browser are returned. If not specified, sessions - for all browsers are returned. - """ - - max_results: int | None = None - """ - The maximum number of results to return in a single call. The default - value is 10. Valid values range from 1 to 100. To retrieve the remaining - results, make another call with the returned `nextToken` value. - """ - - next_token: str | None = None - """ - The token for the next set of results. Use the value returned in the - previous response in the next request to retrieve the next set of - results. If not specified, Amazon Bedrock AgentCore returns the first - page of results. - """ - - status: str | None = None - """ - The status of the browser sessions to list. Valid values include ACTIVE, - STOPPING, and STOPPED. If not specified, sessions with any status are - returned. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_BROWSER_SESSIONS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.browser_identifier is not None: - serializer.write_string( - _SCHEMA_LIST_BROWSER_SESSIONS_INPUT.members["browserIdentifier"], - self.browser_identifier, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_BROWSER_SESSIONS_INPUT.members["maxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_BROWSER_SESSIONS_INPUT.members["nextToken"], - self.next_token, - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_LIST_BROWSER_SESSIONS_INPUT.members["status"], self.status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["browser_identifier"] = de.read_string( - _SCHEMA_LIST_BROWSER_SESSIONS_INPUT.members["browserIdentifier"] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_BROWSER_SESSIONS_INPUT.members["maxResults"] - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_BROWSER_SESSIONS_INPUT.members["nextToken"] - ) - - case 3: - kwargs["status"] = BrowserSessionStatus( - de.read_string( - _SCHEMA_LIST_BROWSER_SESSIONS_INPUT.members["status"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_BROWSER_SESSIONS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class BrowserSessionSummary: - """ - A condensed representation of a browser session in Amazon Bedrock - AgentCore. This structure contains key information about a browser - session, including identifiers, status, and timestamps, without the full - details of the session configuration and streams. - """ - - browser_identifier: str - """ - The unique identifier of the browser associated with the session. This - identifier specifies which browser environment is used for the session. - """ - - session_id: str - """ - The unique identifier of the browser session. This identifier is used in - operations that interact with the session. - """ - - status: str - """ - The current status of the browser session. Possible values include - ACTIVE, STOPPING, and STOPPED. - """ - - created_at: datetime - """ - The timestamp when the browser session was created. This value is in ISO - 8601 format. - """ - - name: str | None = None - """ - The name of the browser session. This name helps identify and manage the - session. - """ - - last_updated_at: datetime | None = None - """ - The timestamp when the browser session was last updated. This value is - in ISO 8601 format. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BROWSER_SESSION_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_BROWSER_SESSION_SUMMARY.members["browserIdentifier"], - self.browser_identifier, - ) - serializer.write_string( - _SCHEMA_BROWSER_SESSION_SUMMARY.members["sessionId"], self.session_id - ) - if self.name is not None: - serializer.write_string( - _SCHEMA_BROWSER_SESSION_SUMMARY.members["name"], self.name - ) - - serializer.write_string( - _SCHEMA_BROWSER_SESSION_SUMMARY.members["status"], self.status - ) - serializer.write_timestamp( - _SCHEMA_BROWSER_SESSION_SUMMARY.members["createdAt"], self.created_at - ) - if self.last_updated_at is not None: - serializer.write_timestamp( - _SCHEMA_BROWSER_SESSION_SUMMARY.members["lastUpdatedAt"], - self.last_updated_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["browser_identifier"] = de.read_string( - _SCHEMA_BROWSER_SESSION_SUMMARY.members["browserIdentifier"] - ) - - case 1: - kwargs["session_id"] = de.read_string( - _SCHEMA_BROWSER_SESSION_SUMMARY.members["sessionId"] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_BROWSER_SESSION_SUMMARY.members["name"] - ) - - case 3: - kwargs["status"] = BrowserSessionStatus( - de.read_string( - _SCHEMA_BROWSER_SESSION_SUMMARY.members["status"] - ) - ) - - case 4: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_BROWSER_SESSION_SUMMARY.members["createdAt"] - ) - - case 5: - kwargs["last_updated_at"] = de.read_timestamp( - _SCHEMA_BROWSER_SESSION_SUMMARY.members["lastUpdatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BROWSER_SESSION_SUMMARY, consumer=_consumer) - if "browser_identifier" not in kwargs: - kwargs["browser_identifier"] = "" - if "session_id" not in kwargs: - kwargs["session_id"] = "" - if "status" not in kwargs: - kwargs["status"] = BrowserSessionStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_browser_session_summaries( - serializer: ShapeSerializer, schema: Schema, value: list[BrowserSessionSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_browser_session_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[BrowserSessionSummary]: - result: list[BrowserSessionSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(BrowserSessionSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListBrowserSessionsOutput: - """Dataclass for ListBrowserSessionsOutput structure.""" - - items: list[BrowserSessionSummary] - """The list of browser sessions that match the specified criteria.""" - - next_token: str | None = None - """ - The token to use in a subsequent `ListBrowserSessions` request to get - the next set of results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_BROWSER_SESSIONS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_browser_session_summaries( - serializer, - _SCHEMA_LIST_BROWSER_SESSIONS_OUTPUT.members["items"], - self.items, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_BROWSER_SESSIONS_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["items"] = _deserialize_browser_session_summaries( - de, _SCHEMA_LIST_BROWSER_SESSIONS_OUTPUT.members["items"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_BROWSER_SESSIONS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_BROWSER_SESSIONS_OUTPUT, consumer=_consumer - ) - if "items" not in kwargs: - kwargs["items"] = [] - return kwargs - - -LIST_BROWSER_SESSIONS = APIOperation( - input=ListBrowserSessionsInput, - output=ListBrowserSessionsOutput, - schema=_SCHEMA_LIST_BROWSER_SESSIONS, - input_schema=_SCHEMA_LIST_BROWSER_SESSIONS_INPUT, - output_schema=_SCHEMA_LIST_BROWSER_SESSIONS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class StartBrowserSessionInput: - """Dataclass for StartBrowserSessionInput structure.""" - - trace_id: str | None = None - """The trace identifier for request tracking.""" - - trace_parent: str | None = None - """The parent trace information for distributed tracing.""" - - browser_identifier: str | None = None - """ - The unique identifier of the browser to use for this session. This - identifier specifies which browser environment to initialize for the - session. - """ - - name: str | None = None - """ - The name of the browser session. This name helps you identify and manage - the session. The name does not need to be unique. - """ - - session_timeout_seconds: int = 3600 - """ - The duration in seconds (time-to-live) after which the session - automatically terminates, regardless of ongoing activity. Defaults to - 3600 seconds (1 hour). Recommended minimum: 60 seconds. Maximum allowed: - 28,800 seconds (8 hours). - """ - - view_port: ViewPort | None = None - """ - The dimensions of the browser viewport for this session. This determines - the visible area of the web content and affects how web pages are - rendered. If not specified, Amazon Bedrock AgentCore uses a default - viewport size. - """ - - extensions: list[BrowserExtension] | None = None - """A list of browser extensions to load into the browser session.""" - - profile_configuration: BrowserProfileConfiguration | None = None - """ - The browser profile configuration to use for this session. A browser - profile contains persistent data such as cookies and local storage that - can be reused across multiple browser sessions. If specified, the - session initializes with the profile's stored data, enabling continuity - for tasks that require authentication or personalized settings. - """ - - proxy_configuration: ProxyConfiguration | None = None - """ - Optional proxy configuration for routing browser traffic through - customer-specified proxy servers. When provided, enables HTTP Basic - authentication via Amazon Web Services Secrets Manager and domain-based - routing rules. Requires `secretsmanager:GetSecretValue` IAM permission - for the specified secret ARNs. - """ - - enterprise_policies: list[BrowserEnterprisePolicy] | None = None - """A list of files containing enterprise policies for the browser.""" - - certificates: list[Certificate] | None = None - """A list of certificates to install in the browser session.""" - - filesystem_configurations: list[ToolsFileSystemConfiguration] | None = None - """ - The file system configurations to mount into the browser session. Use - these configurations to mount your own Amazon Simple Storage Service - (Amazon S3) Files or Amazon Elastic File System (Amazon EFS) access - points. Your session can then read and write your data. If you don't - specify this field, no additional file systems are mounted. - """ - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If this token matches a previous - request, Amazon Bedrock AgentCore ignores the request, but does not - return an error. This parameter helps prevent the creation of duplicate - sessions if there are temporary network issues. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_BROWSER_SESSION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.trace_id is not None: - serializer.write_string( - _SCHEMA_START_BROWSER_SESSION_INPUT.members["traceId"], self.trace_id - ) - - if self.trace_parent is not None: - serializer.write_string( - _SCHEMA_START_BROWSER_SESSION_INPUT.members["traceParent"], - self.trace_parent, - ) - - if self.browser_identifier is not None: - serializer.write_string( - _SCHEMA_START_BROWSER_SESSION_INPUT.members["browserIdentifier"], - self.browser_identifier, - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_START_BROWSER_SESSION_INPUT.members["name"], self.name - ) - - if self.session_timeout_seconds is not None: - serializer.write_integer( - _SCHEMA_START_BROWSER_SESSION_INPUT.members["sessionTimeoutSeconds"], - self.session_timeout_seconds, - ) - - if self.view_port is not None: - serializer.write_struct( - _SCHEMA_START_BROWSER_SESSION_INPUT.members["viewPort"], self.view_port - ) - - if self.extensions is not None: - _serialize_browser_extensions( - serializer, - _SCHEMA_START_BROWSER_SESSION_INPUT.members["extensions"], - self.extensions, - ) - - if self.profile_configuration is not None: - serializer.write_struct( - _SCHEMA_START_BROWSER_SESSION_INPUT.members["profileConfiguration"], - self.profile_configuration, - ) - - if self.proxy_configuration is not None: - serializer.write_struct( - _SCHEMA_START_BROWSER_SESSION_INPUT.members["proxyConfiguration"], - self.proxy_configuration, - ) - - if self.enterprise_policies is not None: - _serialize_browser_enterprise_policies( - serializer, - _SCHEMA_START_BROWSER_SESSION_INPUT.members["enterprisePolicies"], - self.enterprise_policies, - ) - - if self.certificates is not None: - _serialize_certificates( - serializer, - _SCHEMA_START_BROWSER_SESSION_INPUT.members["certificates"], - self.certificates, - ) - - if self.filesystem_configurations is not None: - _serialize_tools_file_system_configurations( - serializer, - _SCHEMA_START_BROWSER_SESSION_INPUT.members["filesystemConfigurations"], - self.filesystem_configurations, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_START_BROWSER_SESSION_INPUT.members["clientToken"], - self.client_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["trace_id"] = de.read_string( - _SCHEMA_START_BROWSER_SESSION_INPUT.members["traceId"] - ) - - case 1: - kwargs["trace_parent"] = de.read_string( - _SCHEMA_START_BROWSER_SESSION_INPUT.members["traceParent"] - ) - - case 2: - kwargs["browser_identifier"] = de.read_string( - _SCHEMA_START_BROWSER_SESSION_INPUT.members["browserIdentifier"] - ) - - case 3: - kwargs["name"] = de.read_string( - _SCHEMA_START_BROWSER_SESSION_INPUT.members["name"] - ) - - case 4: - kwargs["session_timeout_seconds"] = de.read_integer( - _SCHEMA_START_BROWSER_SESSION_INPUT.members[ - "sessionTimeoutSeconds" - ] - ) - - case 5: - kwargs["view_port"] = ViewPort.deserialize(de) - - case 6: - kwargs["extensions"] = _deserialize_browser_extensions( - de, _SCHEMA_START_BROWSER_SESSION_INPUT.members["extensions"] - ) - - case 7: - kwargs["profile_configuration"] = ( - BrowserProfileConfiguration.deserialize(de) - ) - - case 8: - kwargs["proxy_configuration"] = ProxyConfiguration.deserialize(de) - - case 9: - kwargs["enterprise_policies"] = ( - _deserialize_browser_enterprise_policies( - de, - _SCHEMA_START_BROWSER_SESSION_INPUT.members[ - "enterprisePolicies" - ], - ) - ) - - case 10: - kwargs["certificates"] = _deserialize_certificates( - de, _SCHEMA_START_BROWSER_SESSION_INPUT.members["certificates"] - ) - - case 11: - kwargs["filesystem_configurations"] = ( - _deserialize_tools_file_system_configurations( - de, - _SCHEMA_START_BROWSER_SESSION_INPUT.members[ - "filesystemConfigurations" - ], - ) - ) - - case 12: - kwargs["client_token"] = de.read_string( - _SCHEMA_START_BROWSER_SESSION_INPUT.members["clientToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_START_BROWSER_SESSION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class StartBrowserSessionOutput: - """Dataclass for StartBrowserSessionOutput structure.""" - - browser_identifier: str - """The identifier of the browser.""" - - session_id: str - """The unique identifier of the created browser session.""" - - created_at: datetime - """The timestamp when the browser session was created.""" - - streams: BrowserSessionStream | None = None - """ - The streams associated with this browser session. These include the - automation stream and live view stream. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_BROWSER_SESSION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_START_BROWSER_SESSION_OUTPUT.members["browserIdentifier"], - self.browser_identifier, - ) - serializer.write_string( - _SCHEMA_START_BROWSER_SESSION_OUTPUT.members["sessionId"], self.session_id - ) - serializer.write_timestamp( - _SCHEMA_START_BROWSER_SESSION_OUTPUT.members["createdAt"], self.created_at - ) - if self.streams is not None: - serializer.write_struct( - _SCHEMA_START_BROWSER_SESSION_OUTPUT.members["streams"], self.streams - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["browser_identifier"] = de.read_string( - _SCHEMA_START_BROWSER_SESSION_OUTPUT.members[ - "browserIdentifier" - ] - ) - - case 1: - kwargs["session_id"] = de.read_string( - _SCHEMA_START_BROWSER_SESSION_OUTPUT.members["sessionId"] - ) - - case 2: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_START_BROWSER_SESSION_OUTPUT.members["createdAt"] - ) - - case 3: - kwargs["streams"] = BrowserSessionStream.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_START_BROWSER_SESSION_OUTPUT, consumer=_consumer - ) - if "browser_identifier" not in kwargs: - kwargs["browser_identifier"] = "" - if "session_id" not in kwargs: - kwargs["session_id"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -START_BROWSER_SESSION = APIOperation( - input=StartBrowserSessionInput, - output=StartBrowserSessionOutput, - schema=_SCHEMA_START_BROWSER_SESSION, - input_schema=_SCHEMA_START_BROWSER_SESSION_INPUT, - output_schema=_SCHEMA_START_BROWSER_SESSION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class StopBrowserSessionInput: - """Dataclass for StopBrowserSessionInput structure.""" - - trace_id: str | None = None - """The trace identifier for request tracking.""" - - trace_parent: str | None = None - """The parent trace information for distributed tracing.""" - - browser_identifier: str | None = None - """The unique identifier of the browser associated with the session.""" - - session_id: str | None = None - """The unique identifier of the browser session to stop.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If this token matches a previous - request, Amazon Bedrock AgentCore ignores the request, but does not - return an error. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STOP_BROWSER_SESSION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.trace_id is not None: - serializer.write_string( - _SCHEMA_STOP_BROWSER_SESSION_INPUT.members["traceId"], self.trace_id - ) - - if self.trace_parent is not None: - serializer.write_string( - _SCHEMA_STOP_BROWSER_SESSION_INPUT.members["traceParent"], - self.trace_parent, - ) - - if self.browser_identifier is not None: - serializer.write_string( - _SCHEMA_STOP_BROWSER_SESSION_INPUT.members["browserIdentifier"], - self.browser_identifier, - ) - - if self.session_id is not None: - serializer.write_string( - _SCHEMA_STOP_BROWSER_SESSION_INPUT.members["sessionId"], self.session_id - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_STOP_BROWSER_SESSION_INPUT.members["clientToken"], - self.client_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["trace_id"] = de.read_string( - _SCHEMA_STOP_BROWSER_SESSION_INPUT.members["traceId"] - ) - - case 1: - kwargs["trace_parent"] = de.read_string( - _SCHEMA_STOP_BROWSER_SESSION_INPUT.members["traceParent"] - ) - - case 2: - kwargs["browser_identifier"] = de.read_string( - _SCHEMA_STOP_BROWSER_SESSION_INPUT.members["browserIdentifier"] - ) - - case 3: - kwargs["session_id"] = de.read_string( - _SCHEMA_STOP_BROWSER_SESSION_INPUT.members["sessionId"] - ) - - case 4: - kwargs["client_token"] = de.read_string( - _SCHEMA_STOP_BROWSER_SESSION_INPUT.members["clientToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_STOP_BROWSER_SESSION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class StopBrowserSessionOutput: - """Dataclass for StopBrowserSessionOutput structure.""" - - browser_identifier: str - """The identifier of the browser.""" - - session_id: str - """The identifier of the browser session.""" - - last_updated_at: datetime - """The time at which the browser session was last updated.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STOP_BROWSER_SESSION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_STOP_BROWSER_SESSION_OUTPUT.members["browserIdentifier"], - self.browser_identifier, - ) - serializer.write_string( - _SCHEMA_STOP_BROWSER_SESSION_OUTPUT.members["sessionId"], self.session_id - ) - serializer.write_timestamp( - _SCHEMA_STOP_BROWSER_SESSION_OUTPUT.members["lastUpdatedAt"], - self.last_updated_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["browser_identifier"] = de.read_string( - _SCHEMA_STOP_BROWSER_SESSION_OUTPUT.members["browserIdentifier"] - ) - - case 1: - kwargs["session_id"] = de.read_string( - _SCHEMA_STOP_BROWSER_SESSION_OUTPUT.members["sessionId"] - ) - - case 2: - kwargs["last_updated_at"] = de.read_timestamp( - _SCHEMA_STOP_BROWSER_SESSION_OUTPUT.members["lastUpdatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_STOP_BROWSER_SESSION_OUTPUT, consumer=_consumer - ) - if "browser_identifier" not in kwargs: - kwargs["browser_identifier"] = "" - if "session_id" not in kwargs: - kwargs["session_id"] = "" - if "last_updated_at" not in kwargs: - kwargs["last_updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -STOP_BROWSER_SESSION = APIOperation( - input=StopBrowserSessionInput, - output=StopBrowserSessionOutput, - schema=_SCHEMA_STOP_BROWSER_SESSION, - input_schema=_SCHEMA_STOP_BROWSER_SESSION_INPUT, - output_schema=_SCHEMA_STOP_BROWSER_SESSION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class AutomationStreamUpdate: - """Contains information about an update to an automation stream.""" - - stream_status: str | None = None - """The status of the automation stream.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATION_STREAM_UPDATE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.stream_status is not None: - serializer.write_string( - _SCHEMA_AUTOMATION_STREAM_UPDATE.members["streamStatus"], - self.stream_status, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["stream_status"] = AutomationStreamStatus( - de.read_string( - _SCHEMA_AUTOMATION_STREAM_UPDATE.members["streamStatus"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AUTOMATION_STREAM_UPDATE, consumer=_consumer) - return kwargs - - -@dataclass -class StreamUpdateAutomationStreamUpdate: - """The update to an automation stream.""" - - value: AutomationStreamUpdate - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STREAM_UPDATE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_STREAM_UPDATE.members["automationStreamUpdate"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=AutomationStreamUpdate.deserialize(deserializer)) - - -@dataclass -class StreamUpdateUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -StreamUpdate = Union[StreamUpdateAutomationStreamUpdate | StreamUpdateUnknown] -"""Contains information about an update to a stream.""" - - -class _StreamUpdateDeserializer: - _result: StreamUpdate | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> StreamUpdate: - self._result = None - deserializer.read_struct(_SCHEMA_STREAM_UPDATE, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(StreamUpdateAutomationStreamUpdate.deserialize(de)) - - case _: - self._set_result(StreamUpdateUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: StreamUpdate) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class UpdateBrowserStreamInput: - """Dataclass for UpdateBrowserStreamInput structure.""" - - browser_identifier: str | None = None - """The identifier of the browser.""" - - session_id: str | None = None - """The identifier of the browser session.""" - - stream_update: StreamUpdate | None = None - """The update to apply to the browser stream.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the operation - completes no more than one time. If this token matches a previous - request, Amazon Bedrock ignores the request, but does not return an - error. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_BROWSER_STREAM_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.browser_identifier is not None: - serializer.write_string( - _SCHEMA_UPDATE_BROWSER_STREAM_INPUT.members["browserIdentifier"], - self.browser_identifier, - ) - - if self.session_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_BROWSER_STREAM_INPUT.members["sessionId"], - self.session_id, - ) - - if self.stream_update is not None: - serializer.write_struct( - _SCHEMA_UPDATE_BROWSER_STREAM_INPUT.members["streamUpdate"], - self.stream_update, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_UPDATE_BROWSER_STREAM_INPUT.members["clientToken"], - self.client_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["browser_identifier"] = de.read_string( - _SCHEMA_UPDATE_BROWSER_STREAM_INPUT.members["browserIdentifier"] - ) - - case 1: - kwargs["session_id"] = de.read_string( - _SCHEMA_UPDATE_BROWSER_STREAM_INPUT.members["sessionId"] - ) - - case 2: - kwargs["stream_update"] = _StreamUpdateDeserializer().deserialize( - de - ) - - case 3: - kwargs["client_token"] = de.read_string( - _SCHEMA_UPDATE_BROWSER_STREAM_INPUT.members["clientToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_BROWSER_STREAM_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateBrowserStreamOutput: - """Dataclass for UpdateBrowserStreamOutput structure.""" - - browser_identifier: str - """The identifier of the browser.""" - - session_id: str - """The identifier of the browser session.""" - - streams: BrowserSessionStream - """ - The collection of streams associated with a browser session in Amazon - Bedrock AgentCore. These streams provide different ways to interact with - and observe the browser session, including programmatic control and - visual representation of the browser content. - """ - - updated_at: datetime - """The time at which the browser stream was updated.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_BROWSER_STREAM_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_UPDATE_BROWSER_STREAM_OUTPUT.members["browserIdentifier"], - self.browser_identifier, - ) - serializer.write_string( - _SCHEMA_UPDATE_BROWSER_STREAM_OUTPUT.members["sessionId"], self.session_id - ) - serializer.write_struct( - _SCHEMA_UPDATE_BROWSER_STREAM_OUTPUT.members["streams"], self.streams - ) - serializer.write_timestamp( - _SCHEMA_UPDATE_BROWSER_STREAM_OUTPUT.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["browser_identifier"] = de.read_string( - _SCHEMA_UPDATE_BROWSER_STREAM_OUTPUT.members[ - "browserIdentifier" - ] - ) - - case 1: - kwargs["session_id"] = de.read_string( - _SCHEMA_UPDATE_BROWSER_STREAM_OUTPUT.members["sessionId"] - ) - - case 2: - kwargs["streams"] = BrowserSessionStream.deserialize(de) - - case 3: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_UPDATE_BROWSER_STREAM_OUTPUT.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_BROWSER_STREAM_OUTPUT, consumer=_consumer - ) - if "browser_identifier" not in kwargs: - kwargs["browser_identifier"] = "" - if "session_id" not in kwargs: - kwargs["session_id"] = "" - if "streams" not in kwargs: - kwargs["streams"] = BrowserSessionStream._smithy_default() - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -UPDATE_BROWSER_STREAM = APIOperation( - input=UpdateBrowserStreamInput, - output=UpdateBrowserStreamOutput, - schema=_SCHEMA_UPDATE_BROWSER_STREAM, - input_schema=_SCHEMA_UPDATE_BROWSER_STREAM_INPUT, - output_schema=_SCHEMA_UPDATE_BROWSER_STREAM_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteCapacityProviderSessionInput: - """Dataclass for DeleteCapacityProviderSessionInput structure.""" - - capacity_provider_id: str | None = None - """ - The unique identifier of the capacity provider associated with the - session. - """ - - session_id: str | None = None - """The unique identifier of the capacity provider session to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_CAPACITY_PROVIDER_SESSION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.capacity_provider_id is not None: - serializer.write_string( - _SCHEMA_DELETE_CAPACITY_PROVIDER_SESSION_INPUT.members[ - "capacityProviderId" - ], - self.capacity_provider_id, - ) - - if self.session_id is not None: - serializer.write_string( - _SCHEMA_DELETE_CAPACITY_PROVIDER_SESSION_INPUT.members["sessionId"], - self.session_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["capacity_provider_id"] = de.read_string( - _SCHEMA_DELETE_CAPACITY_PROVIDER_SESSION_INPUT.members[ - "capacityProviderId" - ] - ) - - case 1: - kwargs["session_id"] = de.read_string( - _SCHEMA_DELETE_CAPACITY_PROVIDER_SESSION_INPUT.members[ - "sessionId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_CAPACITY_PROVIDER_SESSION_INPUT, consumer=_consumer - ) - return kwargs - - -class CapacityProviderSessionStatus(UnknownEnumMixin, StrEnum): - PROVISIONING = "Provisioning" - DEPROVISIONING = "Deprovisioning" - ACTIVE = "Active" - DELETING = "Deleting" - DELETED = "Deleted" - STOPPED = "Stopped" - - -@dataclass(kw_only=True) -class DeleteCapacityProviderSessionOutput: - """Dataclass for DeleteCapacityProviderSessionOutput structure.""" - - capacity_provider_arn: str - """ - The Amazon Resource Name (ARN) of the capacity provider associated with - the deleted session. - """ - - session_id: str - """The unique identifier of the deleted capacity provider session.""" - - status: str - """ - The current status of the capacity provider session. When the status is - `Deleting`, the session is being deleted and is not available. When the - status is `Deleted`, the session is no longer available. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_CAPACITY_PROVIDER_SESSION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DELETE_CAPACITY_PROVIDER_SESSION_OUTPUT.members[ - "capacityProviderArn" - ], - self.capacity_provider_arn, - ) - serializer.write_string( - _SCHEMA_DELETE_CAPACITY_PROVIDER_SESSION_OUTPUT.members["sessionId"], - self.session_id, - ) - serializer.write_string( - _SCHEMA_DELETE_CAPACITY_PROVIDER_SESSION_OUTPUT.members["status"], - self.status, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["capacity_provider_arn"] = de.read_string( - _SCHEMA_DELETE_CAPACITY_PROVIDER_SESSION_OUTPUT.members[ - "capacityProviderArn" - ] - ) - - case 1: - kwargs["session_id"] = de.read_string( - _SCHEMA_DELETE_CAPACITY_PROVIDER_SESSION_OUTPUT.members[ - "sessionId" - ] - ) - - case 2: - kwargs["status"] = CapacityProviderSessionStatus( - de.read_string( - _SCHEMA_DELETE_CAPACITY_PROVIDER_SESSION_OUTPUT.members[ - "status" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_CAPACITY_PROVIDER_SESSION_OUTPUT, consumer=_consumer - ) - if "capacity_provider_arn" not in kwargs: - kwargs["capacity_provider_arn"] = "" - if "session_id" not in kwargs: - kwargs["session_id"] = "" - if "status" not in kwargs: - kwargs["status"] = CapacityProviderSessionStatus._corrected("") - return kwargs - - -DELETE_CAPACITY_PROVIDER_SESSION = APIOperation( - input=DeleteCapacityProviderSessionInput, - output=DeleteCapacityProviderSessionOutput, - schema=_SCHEMA_DELETE_CAPACITY_PROVIDER_SESSION, - input_schema=_SCHEMA_DELETE_CAPACITY_PROVIDER_SESSION_INPUT, - output_schema=_SCHEMA_DELETE_CAPACITY_PROVIDER_SESSION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetCodeInterpreterSessionInput: - """Dataclass for GetCodeInterpreterSessionInput structure.""" - - code_interpreter_identifier: str | None = None - """ - The unique identifier of the code interpreter associated with the - session. - """ - - session_id: str | None = None - """The unique identifier of the code interpreter session to retrieve.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_CODE_INTERPRETER_SESSION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.code_interpreter_identifier is not None: - serializer.write_string( - _SCHEMA_GET_CODE_INTERPRETER_SESSION_INPUT.members[ - "codeInterpreterIdentifier" - ], - self.code_interpreter_identifier, - ) - - if self.session_id is not None: - serializer.write_string( - _SCHEMA_GET_CODE_INTERPRETER_SESSION_INPUT.members["sessionId"], - self.session_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["code_interpreter_identifier"] = de.read_string( - _SCHEMA_GET_CODE_INTERPRETER_SESSION_INPUT.members[ - "codeInterpreterIdentifier" - ] - ) - - case 1: - kwargs["session_id"] = de.read_string( - _SCHEMA_GET_CODE_INTERPRETER_SESSION_INPUT.members["sessionId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_CODE_INTERPRETER_SESSION_INPUT, consumer=_consumer - ) - return kwargs - - -class CodeInterpreterSessionStatus(UnknownEnumMixin, StrEnum): - READY = "READY" - TERMINATED = "TERMINATED" - - -@dataclass(kw_only=True) -class GetCodeInterpreterSessionOutput: - """Dataclass for GetCodeInterpreterSessionOutput structure.""" - - code_interpreter_identifier: str - """The identifier of the code interpreter.""" - - session_id: str - """The identifier of the code interpreter session.""" - - created_at: datetime - """The time at which the code interpreter session was created.""" - - name: str | None = None - """The name of the code interpreter session.""" - - session_timeout_seconds: int | None = None - """The timeout period for the code interpreter session in seconds.""" - - status: str | None = None - """ - The current status of the code interpreter session. Possible values - include ACTIVE, STOPPING, and STOPPED. - """ - - certificates: list[Certificate] | None = None - """The list of certificates installed in the code interpreter session.""" - - filesystem_configurations: list[ToolsFileSystemConfiguration] | None = None - """ - The file system configurations for the code interpreter session. Each - entry describes an access point and its mount path. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_CODE_INTERPRETER_SESSION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_CODE_INTERPRETER_SESSION_OUTPUT.members[ - "codeInterpreterIdentifier" - ], - self.code_interpreter_identifier, - ) - serializer.write_string( - _SCHEMA_GET_CODE_INTERPRETER_SESSION_OUTPUT.members["sessionId"], - self.session_id, - ) - if self.name is not None: - serializer.write_string( - _SCHEMA_GET_CODE_INTERPRETER_SESSION_OUTPUT.members["name"], self.name - ) - - serializer.write_timestamp( - _SCHEMA_GET_CODE_INTERPRETER_SESSION_OUTPUT.members["createdAt"], - self.created_at, - ) - if self.session_timeout_seconds is not None: - serializer.write_integer( - _SCHEMA_GET_CODE_INTERPRETER_SESSION_OUTPUT.members[ - "sessionTimeoutSeconds" - ], - self.session_timeout_seconds, - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_GET_CODE_INTERPRETER_SESSION_OUTPUT.members["status"], - self.status, - ) - - if self.certificates is not None: - _serialize_certificates( - serializer, - _SCHEMA_GET_CODE_INTERPRETER_SESSION_OUTPUT.members["certificates"], - self.certificates, - ) - - if self.filesystem_configurations is not None: - _serialize_tools_file_system_configurations( - serializer, - _SCHEMA_GET_CODE_INTERPRETER_SESSION_OUTPUT.members[ - "filesystemConfigurations" - ], - self.filesystem_configurations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["code_interpreter_identifier"] = de.read_string( - _SCHEMA_GET_CODE_INTERPRETER_SESSION_OUTPUT.members[ - "codeInterpreterIdentifier" - ] - ) - - case 1: - kwargs["session_id"] = de.read_string( - _SCHEMA_GET_CODE_INTERPRETER_SESSION_OUTPUT.members["sessionId"] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_GET_CODE_INTERPRETER_SESSION_OUTPUT.members["name"] - ) - - case 3: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_CODE_INTERPRETER_SESSION_OUTPUT.members["createdAt"] - ) - - case 4: - kwargs["session_timeout_seconds"] = de.read_integer( - _SCHEMA_GET_CODE_INTERPRETER_SESSION_OUTPUT.members[ - "sessionTimeoutSeconds" - ] - ) - - case 5: - kwargs["status"] = CodeInterpreterSessionStatus( - de.read_string( - _SCHEMA_GET_CODE_INTERPRETER_SESSION_OUTPUT.members[ - "status" - ] - ) - ) - - case 6: - kwargs["certificates"] = _deserialize_certificates( - de, - _SCHEMA_GET_CODE_INTERPRETER_SESSION_OUTPUT.members[ - "certificates" - ], - ) - - case 7: - kwargs["filesystem_configurations"] = ( - _deserialize_tools_file_system_configurations( - de, - _SCHEMA_GET_CODE_INTERPRETER_SESSION_OUTPUT.members[ - "filesystemConfigurations" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_CODE_INTERPRETER_SESSION_OUTPUT, consumer=_consumer - ) - if "code_interpreter_identifier" not in kwargs: - kwargs["code_interpreter_identifier"] = "" - if "session_id" not in kwargs: - kwargs["session_id"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -GET_CODE_INTERPRETER_SESSION = APIOperation( - input=GetCodeInterpreterSessionInput, - output=GetCodeInterpreterSessionOutput, - schema=_SCHEMA_GET_CODE_INTERPRETER_SESSION, - input_schema=_SCHEMA_GET_CODE_INTERPRETER_SESSION_INPUT, - output_schema=_SCHEMA_GET_CODE_INTERPRETER_SESSION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListCodeInterpreterSessionsInput: - """Dataclass for ListCodeInterpreterSessionsInput structure.""" - - code_interpreter_identifier: str | None = None - """ - The unique identifier of the code interpreter to list sessions for. If - specified, only sessions for this code interpreter are returned. If not - specified, sessions for all code interpreters are returned. - """ - - max_results: int | None = None - """ - The maximum number of results to return in a single call. The default - value is 10. Valid values range from 1 to 100. To retrieve the remaining - results, make another call with the returned `nextToken` value. - """ - - next_token: str | None = None - """ - The token for the next set of results. Use the value returned in the - previous response in the next request to retrieve the next set of - results. If not specified, Amazon Bedrock AgentCore returns the first - page of results. - """ - - status: str | None = None - """ - The status of the code interpreter sessions to list. Valid values - include ACTIVE, STOPPING, and STOPPED. If not specified, sessions with - any status are returned. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_CODE_INTERPRETER_SESSIONS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.code_interpreter_identifier is not None: - serializer.write_string( - _SCHEMA_LIST_CODE_INTERPRETER_SESSIONS_INPUT.members[ - "codeInterpreterIdentifier" - ], - self.code_interpreter_identifier, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_CODE_INTERPRETER_SESSIONS_INPUT.members["maxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_CODE_INTERPRETER_SESSIONS_INPUT.members["nextToken"], - self.next_token, - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_LIST_CODE_INTERPRETER_SESSIONS_INPUT.members["status"], - self.status, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["code_interpreter_identifier"] = de.read_string( - _SCHEMA_LIST_CODE_INTERPRETER_SESSIONS_INPUT.members[ - "codeInterpreterIdentifier" - ] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_CODE_INTERPRETER_SESSIONS_INPUT.members[ - "maxResults" - ] - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_CODE_INTERPRETER_SESSIONS_INPUT.members[ - "nextToken" - ] - ) - - case 3: - kwargs["status"] = CodeInterpreterSessionStatus( - de.read_string( - _SCHEMA_LIST_CODE_INTERPRETER_SESSIONS_INPUT.members[ - "status" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_CODE_INTERPRETER_SESSIONS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CodeInterpreterSessionSummary: - """ - A condensed representation of a code interpreter session in Amazon - Bedrock AgentCore. This structure contains key information about a code - interpreter session, including identifiers, status, and timestamps, - without the full details of the session configuration. - """ - - code_interpreter_identifier: str - """ - The unique identifier of the code interpreter associated with the - session. This identifier specifies which code interpreter environment is - used for the session. - """ - - session_id: str - """ - The unique identifier of the code interpreter session. This identifier - is used in operations that interact with the session. - """ - - status: str - """ - The current status of the code interpreter session. Possible values - include ACTIVE, STOPPING, and STOPPED. - """ - - created_at: datetime - """ - The timestamp when the code interpreter session was created. This value - is in ISO 8601 format. - """ - - name: str | None = None - """ - The name of the code interpreter session. This name helps identify and - manage the session. - """ - - last_updated_at: datetime | None = None - """ - The timestamp when the code interpreter session was last updated. This - value is in ISO 8601 format. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CODE_INTERPRETER_SESSION_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CODE_INTERPRETER_SESSION_SUMMARY.members[ - "codeInterpreterIdentifier" - ], - self.code_interpreter_identifier, - ) - serializer.write_string( - _SCHEMA_CODE_INTERPRETER_SESSION_SUMMARY.members["sessionId"], - self.session_id, - ) - if self.name is not None: - serializer.write_string( - _SCHEMA_CODE_INTERPRETER_SESSION_SUMMARY.members["name"], self.name - ) - - serializer.write_string( - _SCHEMA_CODE_INTERPRETER_SESSION_SUMMARY.members["status"], self.status - ) - serializer.write_timestamp( - _SCHEMA_CODE_INTERPRETER_SESSION_SUMMARY.members["createdAt"], - self.created_at, - ) - if self.last_updated_at is not None: - serializer.write_timestamp( - _SCHEMA_CODE_INTERPRETER_SESSION_SUMMARY.members["lastUpdatedAt"], - self.last_updated_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["code_interpreter_identifier"] = de.read_string( - _SCHEMA_CODE_INTERPRETER_SESSION_SUMMARY.members[ - "codeInterpreterIdentifier" - ] - ) - - case 1: - kwargs["session_id"] = de.read_string( - _SCHEMA_CODE_INTERPRETER_SESSION_SUMMARY.members["sessionId"] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_CODE_INTERPRETER_SESSION_SUMMARY.members["name"] - ) - - case 3: - kwargs["status"] = CodeInterpreterSessionStatus( - de.read_string( - _SCHEMA_CODE_INTERPRETER_SESSION_SUMMARY.members["status"] - ) - ) - - case 4: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_CODE_INTERPRETER_SESSION_SUMMARY.members["createdAt"] - ) - - case 5: - kwargs["last_updated_at"] = de.read_timestamp( - _SCHEMA_CODE_INTERPRETER_SESSION_SUMMARY.members[ - "lastUpdatedAt" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CODE_INTERPRETER_SESSION_SUMMARY, consumer=_consumer - ) - if "code_interpreter_identifier" not in kwargs: - kwargs["code_interpreter_identifier"] = "" - if "session_id" not in kwargs: - kwargs["session_id"] = "" - if "status" not in kwargs: - kwargs["status"] = CodeInterpreterSessionStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_code_interpreter_session_summaries( - serializer: ShapeSerializer, - schema: Schema, - value: list[CodeInterpreterSessionSummary], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_code_interpreter_session_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[CodeInterpreterSessionSummary]: - result: list[CodeInterpreterSessionSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(CodeInterpreterSessionSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListCodeInterpreterSessionsOutput: - """Dataclass for ListCodeInterpreterSessionsOutput structure.""" - - items: list[CodeInterpreterSessionSummary] - """The list of code interpreter sessions that match the specified criteria.""" - - next_token: str | None = None - """ - The token to use in a subsequent `ListCodeInterpreterSessions` request - to get the next set of results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_CODE_INTERPRETER_SESSIONS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_code_interpreter_session_summaries( - serializer, - _SCHEMA_LIST_CODE_INTERPRETER_SESSIONS_OUTPUT.members["items"], - self.items, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_CODE_INTERPRETER_SESSIONS_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["items"] = _deserialize_code_interpreter_session_summaries( - de, - _SCHEMA_LIST_CODE_INTERPRETER_SESSIONS_OUTPUT.members["items"], - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_CODE_INTERPRETER_SESSIONS_OUTPUT.members[ - "nextToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_CODE_INTERPRETER_SESSIONS_OUTPUT, consumer=_consumer - ) - if "items" not in kwargs: - kwargs["items"] = [] - return kwargs - - -LIST_CODE_INTERPRETER_SESSIONS = APIOperation( - input=ListCodeInterpreterSessionsInput, - output=ListCodeInterpreterSessionsOutput, - schema=_SCHEMA_LIST_CODE_INTERPRETER_SESSIONS, - input_schema=_SCHEMA_LIST_CODE_INTERPRETER_SESSIONS_INPUT, - output_schema=_SCHEMA_LIST_CODE_INTERPRETER_SESSIONS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class StartCodeInterpreterSessionInput: - """Dataclass for StartCodeInterpreterSessionInput structure.""" - - trace_id: str | None = None - """The trace identifier for request tracking.""" - - trace_parent: str | None = None - """The parent trace information for distributed tracing.""" - - code_interpreter_identifier: str | None = None - """ - The unique identifier of the code interpreter to use for this session. - This identifier specifies which code interpreter environment to - initialize for the session. - """ - - name: str | None = None - """ - The name of the code interpreter session. This name helps you identify - and manage the session. The name does not need to be unique. - """ - - session_timeout_seconds: int = 900 - """ - The duration in seconds (time-to-live) after which the session - automatically terminates, regardless of ongoing activity. Defaults to - 900 seconds (15 minutes). Recommended minimum: 60 seconds. Maximum - allowed: 28,800 seconds (8 hours). - """ - - certificates: list[Certificate] | None = None - """A list of certificates to install in the code interpreter session.""" - - filesystem_configurations: list[ToolsFileSystemConfiguration] | None = None - """ - The file system configurations to mount into the code interpreter - session. Use these configurations to mount your own Amazon Simple - Storage Service (Amazon S3) Files or Amazon Elastic File System (Amazon - EFS) access points. Your session can then read and write your data. If - you don't specify this field, no additional file systems are mounted. - """ - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If this token matches a previous - request, Amazon Bedrock AgentCore ignores the request, but does not - return an error. This parameter helps prevent the creation of duplicate - sessions if there are temporary network issues. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_CODE_INTERPRETER_SESSION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.trace_id is not None: - serializer.write_string( - _SCHEMA_START_CODE_INTERPRETER_SESSION_INPUT.members["traceId"], - self.trace_id, - ) - - if self.trace_parent is not None: - serializer.write_string( - _SCHEMA_START_CODE_INTERPRETER_SESSION_INPUT.members["traceParent"], - self.trace_parent, - ) - - if self.code_interpreter_identifier is not None: - serializer.write_string( - _SCHEMA_START_CODE_INTERPRETER_SESSION_INPUT.members[ - "codeInterpreterIdentifier" - ], - self.code_interpreter_identifier, - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_START_CODE_INTERPRETER_SESSION_INPUT.members["name"], self.name - ) - - if self.session_timeout_seconds is not None: - serializer.write_integer( - _SCHEMA_START_CODE_INTERPRETER_SESSION_INPUT.members[ - "sessionTimeoutSeconds" - ], - self.session_timeout_seconds, - ) - - if self.certificates is not None: - _serialize_certificates( - serializer, - _SCHEMA_START_CODE_INTERPRETER_SESSION_INPUT.members["certificates"], - self.certificates, - ) - - if self.filesystem_configurations is not None: - _serialize_tools_file_system_configurations( - serializer, - _SCHEMA_START_CODE_INTERPRETER_SESSION_INPUT.members[ - "filesystemConfigurations" - ], - self.filesystem_configurations, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_START_CODE_INTERPRETER_SESSION_INPUT.members["clientToken"], - self.client_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["trace_id"] = de.read_string( - _SCHEMA_START_CODE_INTERPRETER_SESSION_INPUT.members["traceId"] - ) - - case 1: - kwargs["trace_parent"] = de.read_string( - _SCHEMA_START_CODE_INTERPRETER_SESSION_INPUT.members[ - "traceParent" - ] - ) - - case 2: - kwargs["code_interpreter_identifier"] = de.read_string( - _SCHEMA_START_CODE_INTERPRETER_SESSION_INPUT.members[ - "codeInterpreterIdentifier" - ] - ) - - case 3: - kwargs["name"] = de.read_string( - _SCHEMA_START_CODE_INTERPRETER_SESSION_INPUT.members["name"] - ) - - case 4: - kwargs["session_timeout_seconds"] = de.read_integer( - _SCHEMA_START_CODE_INTERPRETER_SESSION_INPUT.members[ - "sessionTimeoutSeconds" - ] - ) - - case 5: - kwargs["certificates"] = _deserialize_certificates( - de, - _SCHEMA_START_CODE_INTERPRETER_SESSION_INPUT.members[ - "certificates" - ], - ) - - case 6: - kwargs["filesystem_configurations"] = ( - _deserialize_tools_file_system_configurations( - de, - _SCHEMA_START_CODE_INTERPRETER_SESSION_INPUT.members[ - "filesystemConfigurations" - ], - ) - ) - - case 7: - kwargs["client_token"] = de.read_string( - _SCHEMA_START_CODE_INTERPRETER_SESSION_INPUT.members[ - "clientToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_START_CODE_INTERPRETER_SESSION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class StartCodeInterpreterSessionOutput: - """Dataclass for StartCodeInterpreterSessionOutput structure.""" - - code_interpreter_identifier: str - """The identifier of the code interpreter.""" - - session_id: str - """The unique identifier of the created code interpreter session.""" - - created_at: datetime - """The time at which the code interpreter session was created.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_CODE_INTERPRETER_SESSION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_START_CODE_INTERPRETER_SESSION_OUTPUT.members[ - "codeInterpreterIdentifier" - ], - self.code_interpreter_identifier, - ) - serializer.write_string( - _SCHEMA_START_CODE_INTERPRETER_SESSION_OUTPUT.members["sessionId"], - self.session_id, - ) - serializer.write_timestamp( - _SCHEMA_START_CODE_INTERPRETER_SESSION_OUTPUT.members["createdAt"], - self.created_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["code_interpreter_identifier"] = de.read_string( - _SCHEMA_START_CODE_INTERPRETER_SESSION_OUTPUT.members[ - "codeInterpreterIdentifier" - ] - ) - - case 1: - kwargs["session_id"] = de.read_string( - _SCHEMA_START_CODE_INTERPRETER_SESSION_OUTPUT.members[ - "sessionId" - ] - ) - - case 2: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_START_CODE_INTERPRETER_SESSION_OUTPUT.members[ - "createdAt" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_START_CODE_INTERPRETER_SESSION_OUTPUT, consumer=_consumer - ) - if "code_interpreter_identifier" not in kwargs: - kwargs["code_interpreter_identifier"] = "" - if "session_id" not in kwargs: - kwargs["session_id"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -START_CODE_INTERPRETER_SESSION = APIOperation( - input=StartCodeInterpreterSessionInput, - output=StartCodeInterpreterSessionOutput, - schema=_SCHEMA_START_CODE_INTERPRETER_SESSION, - input_schema=_SCHEMA_START_CODE_INTERPRETER_SESSION_INPUT, - output_schema=_SCHEMA_START_CODE_INTERPRETER_SESSION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class StopCodeInterpreterSessionInput: - """Dataclass for StopCodeInterpreterSessionInput structure.""" - - trace_id: str | None = None - """The trace identifier for request tracking.""" - - trace_parent: str | None = None - """The parent trace information for distributed tracing.""" - - code_interpreter_identifier: str | None = None - """ - The unique identifier of the code interpreter associated with the - session. - """ - - session_id: str | None = None - """The unique identifier of the code interpreter session to stop.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If this token matches a previous - request, Amazon Bedrock AgentCore ignores the request, but does not - return an error. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STOP_CODE_INTERPRETER_SESSION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.trace_id is not None: - serializer.write_string( - _SCHEMA_STOP_CODE_INTERPRETER_SESSION_INPUT.members["traceId"], - self.trace_id, - ) - - if self.trace_parent is not None: - serializer.write_string( - _SCHEMA_STOP_CODE_INTERPRETER_SESSION_INPUT.members["traceParent"], - self.trace_parent, - ) - - if self.code_interpreter_identifier is not None: - serializer.write_string( - _SCHEMA_STOP_CODE_INTERPRETER_SESSION_INPUT.members[ - "codeInterpreterIdentifier" - ], - self.code_interpreter_identifier, - ) - - if self.session_id is not None: - serializer.write_string( - _SCHEMA_STOP_CODE_INTERPRETER_SESSION_INPUT.members["sessionId"], - self.session_id, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_STOP_CODE_INTERPRETER_SESSION_INPUT.members["clientToken"], - self.client_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["trace_id"] = de.read_string( - _SCHEMA_STOP_CODE_INTERPRETER_SESSION_INPUT.members["traceId"] - ) - - case 1: - kwargs["trace_parent"] = de.read_string( - _SCHEMA_STOP_CODE_INTERPRETER_SESSION_INPUT.members[ - "traceParent" - ] - ) - - case 2: - kwargs["code_interpreter_identifier"] = de.read_string( - _SCHEMA_STOP_CODE_INTERPRETER_SESSION_INPUT.members[ - "codeInterpreterIdentifier" - ] - ) - - case 3: - kwargs["session_id"] = de.read_string( - _SCHEMA_STOP_CODE_INTERPRETER_SESSION_INPUT.members["sessionId"] - ) - - case 4: - kwargs["client_token"] = de.read_string( - _SCHEMA_STOP_CODE_INTERPRETER_SESSION_INPUT.members[ - "clientToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_STOP_CODE_INTERPRETER_SESSION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class StopCodeInterpreterSessionOutput: - """Dataclass for StopCodeInterpreterSessionOutput structure.""" - - code_interpreter_identifier: str - """The identifier of the code interpreter.""" - - session_id: str - """The identifier of the code interpreter session.""" - - last_updated_at: datetime - """The timestamp when the code interpreter session was last updated.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STOP_CODE_INTERPRETER_SESSION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_STOP_CODE_INTERPRETER_SESSION_OUTPUT.members[ - "codeInterpreterIdentifier" - ], - self.code_interpreter_identifier, - ) - serializer.write_string( - _SCHEMA_STOP_CODE_INTERPRETER_SESSION_OUTPUT.members["sessionId"], - self.session_id, - ) - serializer.write_timestamp( - _SCHEMA_STOP_CODE_INTERPRETER_SESSION_OUTPUT.members["lastUpdatedAt"], - self.last_updated_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["code_interpreter_identifier"] = de.read_string( - _SCHEMA_STOP_CODE_INTERPRETER_SESSION_OUTPUT.members[ - "codeInterpreterIdentifier" - ] - ) - - case 1: - kwargs["session_id"] = de.read_string( - _SCHEMA_STOP_CODE_INTERPRETER_SESSION_OUTPUT.members[ - "sessionId" - ] - ) - - case 2: - kwargs["last_updated_at"] = de.read_timestamp( - _SCHEMA_STOP_CODE_INTERPRETER_SESSION_OUTPUT.members[ - "lastUpdatedAt" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_STOP_CODE_INTERPRETER_SESSION_OUTPUT, consumer=_consumer - ) - if "code_interpreter_identifier" not in kwargs: - kwargs["code_interpreter_identifier"] = "" - if "session_id" not in kwargs: - kwargs["session_id"] = "" - if "last_updated_at" not in kwargs: - kwargs["last_updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -STOP_CODE_INTERPRETER_SESSION = APIOperation( - input=StopCodeInterpreterSessionInput, - output=StopCodeInterpreterSessionOutput, - schema=_SCHEMA_STOP_CODE_INTERPRETER_SESSION, - input_schema=_SCHEMA_STOP_CODE_INTERPRETER_SESSION_INPUT, - output_schema=_SCHEMA_STOP_CODE_INTERPRETER_SESSION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass -class UserIdentifierUserToken: - """ - The OAuth2.0 token issued by the user's identity provider that was used - to generate the workload access token - """ - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_USER_IDENTIFIER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_USER_IDENTIFIER.members["userToken"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string(_SCHEMA_USER_IDENTIFIER.members["userToken"]) - ) - - -@dataclass -class UserIdentifierUserId: - """ - The ID of the user for whom you have retrieved a workload access token - for - """ - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_USER_IDENTIFIER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_USER_IDENTIFIER.members["userId"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string(_SCHEMA_USER_IDENTIFIER.members["userId"]) - ) - - -@dataclass -class UserIdentifierUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -UserIdentifier = Union[ - UserIdentifierUserToken | UserIdentifierUserId | UserIdentifierUnknown -] -""" -The OAuth2.0 token or user ID that was used to generate the workload -access token used for initiating the user authorization flow to retrieve -OAuth2.0 tokens. -""" - - -class _UserIdentifierDeserializer: - _result: UserIdentifier | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> UserIdentifier: - self._result = None - deserializer.read_struct(_SCHEMA_USER_IDENTIFIER, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(UserIdentifierUserToken.deserialize(de)) - - case 1: - self._set_result(UserIdentifierUserId.deserialize(de)) - - case _: - self._set_result(UserIdentifierUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: UserIdentifier) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class CompleteResourceTokenAuthInput: - """Dataclass for CompleteResourceTokenAuthInput structure.""" - - user_identifier: UserIdentifier | None = None - """ - The OAuth2.0 token or user ID that was used to generate the workload - access token used for initiating the user authorization flow to retrieve - OAuth2.0 tokens. - """ - - session_uri: str | None = None - """ - Unique identifier for the user's authentication session for retrieving - OAuth2 tokens. This ID tracks the authorization flow state across - multiple requests and responses during the OAuth2 authentication - process. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_COMPLETE_RESOURCE_TOKEN_AUTH_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.user_identifier is not None: - serializer.write_struct( - _SCHEMA_COMPLETE_RESOURCE_TOKEN_AUTH_INPUT.members["userIdentifier"], - self.user_identifier, - ) - - if self.session_uri is not None: - serializer.write_string( - _SCHEMA_COMPLETE_RESOURCE_TOKEN_AUTH_INPUT.members["sessionUri"], - self.session_uri, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["user_identifier"] = ( - _UserIdentifierDeserializer().deserialize(de) - ) - - case 1: - kwargs["session_uri"] = de.read_string( - _SCHEMA_COMPLETE_RESOURCE_TOKEN_AUTH_INPUT.members["sessionUri"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_COMPLETE_RESOURCE_TOKEN_AUTH_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CompleteResourceTokenAuthOutput: - """Dataclass for CompleteResourceTokenAuthOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_COMPLETE_RESOURCE_TOKEN_AUTH_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_COMPLETE_RESOURCE_TOKEN_AUTH_OUTPUT, consumer=_consumer - ) - return kwargs - - -COMPLETE_RESOURCE_TOKEN_AUTH = APIOperation( - input=CompleteResourceTokenAuthInput, - output=CompleteResourceTokenAuthOutput, - schema=_SCHEMA_COMPLETE_RESOURCE_TOKEN_AUTH, - input_schema=_SCHEMA_COMPLETE_RESOURCE_TOKEN_AUTH_INPUT, - output_schema=_SCHEMA_COMPLETE_RESOURCE_TOKEN_AUTH_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#UnauthorizedException" - ): UnauthorizedException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -def _serialize_target_path_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_target_path_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GatewayFilter: - """ - A filter to restrict which gateway target paths are included in the A/B - test. - """ - - target_paths: list[str] | None = None - """A list of target path patterns to include in the A/B test.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GATEWAY_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.target_paths is not None: - _serialize_target_path_list( - serializer, - _SCHEMA_GATEWAY_FILTER.members["targetPaths"], - self.target_paths, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["target_paths"] = _deserialize_target_path_list( - de, _SCHEMA_GATEWAY_FILTER.members["targetPaths"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GATEWAY_FILTER, consumer=_consumer) - return kwargs - - -def _serialize_tags_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_tags_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ConfigurationBundleRef: - """A reference to a specific version of a configuration bundle.""" - - bundle_arn: str - """The Amazon Resource Name (ARN) of the configuration bundle.""" - - bundle_version: str - """The version of the configuration bundle.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONFIGURATION_BUNDLE_REF, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CONFIGURATION_BUNDLE_REF.members["bundleArn"], self.bundle_arn - ) - serializer.write_string( - _SCHEMA_CONFIGURATION_BUNDLE_REF.members["bundleVersion"], - self.bundle_version, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bundle_arn"] = de.read_string( - _SCHEMA_CONFIGURATION_BUNDLE_REF.members["bundleArn"] - ) - - case 1: - kwargs["bundle_version"] = de.read_string( - _SCHEMA_CONFIGURATION_BUNDLE_REF.members["bundleVersion"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONFIGURATION_BUNDLE_REF, consumer=_consumer) - if "bundle_arn" not in kwargs: - kwargs["bundle_arn"] = "" - if "bundle_version" not in kwargs: - kwargs["bundle_version"] = "" - return kwargs - - -@dataclass(kw_only=True) -class TargetRef: - """A reference to a gateway target.""" - - name: str - """The name of the gateway target.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TARGET_REF, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_TARGET_REF.members["name"], self.name) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string(_SCHEMA_TARGET_REF.members["name"]) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TARGET_REF, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - return kwargs - - -@dataclass(kw_only=True) -class VariantConfiguration: - """The configuration for an A/B test variant.""" - - configuration_bundle: ConfigurationBundleRef | None = None - """A reference to a configuration bundle version to use for this variant.""" - - target: TargetRef | None = None - """A reference to a gateway target to route traffic to for this variant.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VARIANT_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.configuration_bundle is not None: - serializer.write_struct( - _SCHEMA_VARIANT_CONFIGURATION.members["configurationBundle"], - self.configuration_bundle, - ) - - if self.target is not None: - serializer.write_struct( - _SCHEMA_VARIANT_CONFIGURATION.members["target"], self.target - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["configuration_bundle"] = ConfigurationBundleRef.deserialize( - de - ) - - case 1: - kwargs["target"] = TargetRef.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VARIANT_CONFIGURATION, consumer=_consumer) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls() - - -@dataclass(kw_only=True) -class Variant: - """ - A variant in an A/B test, representing either the control (C) or - treatment (T1) configuration. - """ - - name: str - """The name of the variant. Must be `C` for control or `T1` for treatment.""" - - weight: int - """ - The percentage of traffic to route to this variant. Weights across all - variants must sum to 100. - """ - - variant_configuration: VariantConfiguration - """ - The configuration for this variant, including the configuration bundle - or target reference. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VARIANT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_VARIANT.members["name"], self.name) - serializer.write_integer(_SCHEMA_VARIANT.members["weight"], self.weight) - serializer.write_struct( - _SCHEMA_VARIANT.members["variantConfiguration"], self.variant_configuration - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string(_SCHEMA_VARIANT.members["name"]) - - case 1: - kwargs["weight"] = de.read_integer( - _SCHEMA_VARIANT.members["weight"] - ) - - case 2: - kwargs["variant_configuration"] = VariantConfiguration.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VARIANT, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "weight" not in kwargs: - kwargs["weight"] = 0 - if "variant_configuration" not in kwargs: - kwargs["variant_configuration"] = VariantConfiguration._smithy_default() - return kwargs - - -def _serialize_variant_list( - serializer: ShapeSerializer, schema: Schema, value: list[Variant] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_variant_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Variant]: - result: list[Variant] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Variant.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CreateABTestInput: - """Dataclass for CreateABTestInput structure.""" - - name: str | None = None - """The name of the A/B test. Must be unique within your account.""" - - description: str | None = None - """The description of the A/B test.""" - - gateway_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the gateway to use for traffic - splitting. - """ - - variants: list[Variant] | None = None - """ - The list of variants for the A/B test. Must contain exactly two - variants: a control (C) and a treatment (T1), each with a configuration - bundle or target reference and a traffic weight. - """ - - gateway_filter: GatewayFilter | None = None - """ - Optional filter to restrict which gateway target paths are included in - the A/B test. - """ - - evaluation_config: ABTestEvaluationConfig | None = None - """ - The evaluation configuration specifying which online evaluation - configurations to use for measuring variant performance. - """ - - role_arn: str | None = None - """ - The IAM role ARN that grants permissions for the A/B test to access - gateway and evaluation resources. - """ - - enable_on_create: bool | None = None - """ - Whether to enable the A/B test immediately upon creation. If true, - traffic splitting begins automatically. - """ - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If this token matches a previous - request, the service ignores the request, but does not return an error. - """ - - tags: dict[str, str] | None = None - """A map of tag keys and values to associate with the A/B test.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_AB_TEST_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_AB_TEST_INPUT.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_AB_TEST_INPUT.members["description"], self.description - ) - - if self.gateway_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_AB_TEST_INPUT.members["gatewayArn"], self.gateway_arn - ) - - if self.variants is not None: - _serialize_variant_list( - serializer, - _SCHEMA_CREATE_AB_TEST_INPUT.members["variants"], - self.variants, - ) - - if self.gateway_filter is not None: - serializer.write_struct( - _SCHEMA_CREATE_AB_TEST_INPUT.members["gatewayFilter"], - self.gateway_filter, - ) - - if self.evaluation_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_AB_TEST_INPUT.members["evaluationConfig"], - self.evaluation_config, - ) - - if self.role_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_AB_TEST_INPUT.members["roleArn"], self.role_arn - ) - - if self.enable_on_create is not None: - serializer.write_boolean( - _SCHEMA_CREATE_AB_TEST_INPUT.members["enableOnCreate"], - self.enable_on_create, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_AB_TEST_INPUT.members["clientToken"], self.client_token - ) - - if self.tags is not None: - _serialize_tags_map( - serializer, _SCHEMA_CREATE_AB_TEST_INPUT.members["tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_AB_TEST_INPUT.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_AB_TEST_INPUT.members["description"] - ) - - case 2: - kwargs["gateway_arn"] = de.read_string( - _SCHEMA_CREATE_AB_TEST_INPUT.members["gatewayArn"] - ) - - case 3: - kwargs["variants"] = _deserialize_variant_list( - de, _SCHEMA_CREATE_AB_TEST_INPUT.members["variants"] - ) - - case 4: - kwargs["gateway_filter"] = GatewayFilter.deserialize(de) - - case 5: - kwargs["evaluation_config"] = ( - _ABTestEvaluationConfigDeserializer().deserialize(de) - ) - - case 6: - kwargs["role_arn"] = de.read_string( - _SCHEMA_CREATE_AB_TEST_INPUT.members["roleArn"] - ) - - case 7: - kwargs["enable_on_create"] = de.read_boolean( - _SCHEMA_CREATE_AB_TEST_INPUT.members["enableOnCreate"] - ) - - case 8: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_AB_TEST_INPUT.members["clientToken"] - ) - - case 9: - kwargs["tags"] = _deserialize_tags_map( - de, _SCHEMA_CREATE_AB_TEST_INPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_AB_TEST_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CreateABTestOutput: - """Dataclass for CreateABTestOutput structure.""" - - ab_test_id: str - """The unique identifier of the created A/B test.""" - - ab_test_arn: str - """The Amazon Resource Name (ARN) of the created A/B test.""" - - status: str - """The status of the A/B test.""" - - execution_status: str - """ - The execution status indicating whether the A/B test is currently - running. - """ - - created_at: datetime - """The timestamp when the A/B test was created.""" - - name: str | None = None - """The name of the A/B test.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_AB_TEST_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_AB_TEST_OUTPUT.members["abTestId"], self.ab_test_id - ) - serializer.write_string( - _SCHEMA_CREATE_AB_TEST_OUTPUT.members["abTestArn"], self.ab_test_arn - ) - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_AB_TEST_OUTPUT.members["name"], self.name - ) - - serializer.write_string( - _SCHEMA_CREATE_AB_TEST_OUTPUT.members["status"], self.status - ) - serializer.write_string( - _SCHEMA_CREATE_AB_TEST_OUTPUT.members["executionStatus"], - self.execution_status, - ) - serializer.write_timestamp( - _SCHEMA_CREATE_AB_TEST_OUTPUT.members["createdAt"], self.created_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["ab_test_id"] = de.read_string( - _SCHEMA_CREATE_AB_TEST_OUTPUT.members["abTestId"] - ) - - case 1: - kwargs["ab_test_arn"] = de.read_string( - _SCHEMA_CREATE_AB_TEST_OUTPUT.members["abTestArn"] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_AB_TEST_OUTPUT.members["name"] - ) - - case 3: - kwargs["status"] = ABTestStatus( - de.read_string(_SCHEMA_CREATE_AB_TEST_OUTPUT.members["status"]) - ) - - case 4: - kwargs["execution_status"] = ABTestExecutionStatus( - de.read_string( - _SCHEMA_CREATE_AB_TEST_OUTPUT.members["executionStatus"] - ) - ) - - case 5: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_CREATE_AB_TEST_OUTPUT.members["createdAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_AB_TEST_OUTPUT, consumer=_consumer) - if "ab_test_id" not in kwargs: - kwargs["ab_test_id"] = "" - if "ab_test_arn" not in kwargs: - kwargs["ab_test_arn"] = "" - if "status" not in kwargs: - kwargs["status"] = ABTestStatus._corrected("") - if "execution_status" not in kwargs: - kwargs["execution_status"] = ABTestExecutionStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -CREATE_AB_TEST = APIOperation( - input=CreateABTestInput, - output=CreateABTestOutput, - schema=_SCHEMA_CREATE_AB_TEST, - input_schema=_SCHEMA_CREATE_AB_TEST_INPUT, - output_schema=_SCHEMA_CREATE_AB_TEST_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#UnauthorizedException" - ): UnauthorizedException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteABTestInput: - """Dataclass for DeleteABTestInput structure.""" - - ab_test_id: str | None = None - """The unique identifier of the A/B test to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_AB_TEST_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.ab_test_id is not None: - serializer.write_string( - _SCHEMA_DELETE_AB_TEST_INPUT.members["abTestId"], self.ab_test_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["ab_test_id"] = de.read_string( - _SCHEMA_DELETE_AB_TEST_INPUT.members["abTestId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_AB_TEST_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteABTestOutput: - """Dataclass for DeleteABTestOutput structure.""" - - ab_test_id: str - """The unique identifier of the deleted A/B test.""" - - ab_test_arn: str - """The Amazon Resource Name (ARN) of the deleted A/B test.""" - - status: str - """The status of the A/B test deletion operation.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_AB_TEST_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DELETE_AB_TEST_OUTPUT.members["abTestId"], self.ab_test_id - ) - serializer.write_string( - _SCHEMA_DELETE_AB_TEST_OUTPUT.members["abTestArn"], self.ab_test_arn - ) - serializer.write_string( - _SCHEMA_DELETE_AB_TEST_OUTPUT.members["status"], self.status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["ab_test_id"] = de.read_string( - _SCHEMA_DELETE_AB_TEST_OUTPUT.members["abTestId"] - ) - - case 1: - kwargs["ab_test_arn"] = de.read_string( - _SCHEMA_DELETE_AB_TEST_OUTPUT.members["abTestArn"] - ) - - case 2: - kwargs["status"] = ABTestStatus( - de.read_string(_SCHEMA_DELETE_AB_TEST_OUTPUT.members["status"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_AB_TEST_OUTPUT, consumer=_consumer) - if "ab_test_id" not in kwargs: - kwargs["ab_test_id"] = "" - if "ab_test_arn" not in kwargs: - kwargs["ab_test_arn"] = "" - if "status" not in kwargs: - kwargs["status"] = ABTestStatus._corrected("") - return kwargs - - -DELETE_AB_TEST = APIOperation( - input=DeleteABTestInput, - output=DeleteABTestOutput, - schema=_SCHEMA_DELETE_AB_TEST, - input_schema=_SCHEMA_DELETE_AB_TEST_INPUT, - output_schema=_SCHEMA_DELETE_AB_TEST_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#UnauthorizedException" - ): UnauthorizedException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteBatchEvaluationInput: - """Dataclass for DeleteBatchEvaluationInput structure.""" - - batch_evaluation_id: str | None = None - """The unique identifier of the batch evaluation to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_BATCH_EVALUATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.batch_evaluation_id is not None: - serializer.write_string( - _SCHEMA_DELETE_BATCH_EVALUATION_INPUT.members["batchEvaluationId"], - self.batch_evaluation_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["batch_evaluation_id"] = de.read_string( - _SCHEMA_DELETE_BATCH_EVALUATION_INPUT.members[ - "batchEvaluationId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_BATCH_EVALUATION_INPUT, consumer=_consumer - ) - return kwargs - - -class BatchEvaluationStatus(UnknownEnumMixin, StrEnum): - """The lifecycle status of a batch evaluation job.""" - - PENDING = "PENDING" - IN_PROGRESS = "IN_PROGRESS" - COMPLETED = "COMPLETED" - COMPLETED_WITH_ERRORS = "COMPLETED_WITH_ERRORS" - FAILED = "FAILED" - STOPPING = "STOPPING" - STOPPED = "STOPPED" - DELETING = "DELETING" - - -@dataclass(kw_only=True) -class DeleteBatchEvaluationOutput: - """Dataclass for DeleteBatchEvaluationOutput structure.""" - - batch_evaluation_id: str - """The unique identifier of the deleted batch evaluation.""" - - batch_evaluation_arn: str - """The Amazon Resource Name (ARN) of the deleted batch evaluation.""" - - status: str - """The status of the batch evaluation deletion operation.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_BATCH_EVALUATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DELETE_BATCH_EVALUATION_OUTPUT.members["batchEvaluationId"], - self.batch_evaluation_id, - ) - serializer.write_string( - _SCHEMA_DELETE_BATCH_EVALUATION_OUTPUT.members["batchEvaluationArn"], - self.batch_evaluation_arn, - ) - serializer.write_string( - _SCHEMA_DELETE_BATCH_EVALUATION_OUTPUT.members["status"], self.status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["batch_evaluation_id"] = de.read_string( - _SCHEMA_DELETE_BATCH_EVALUATION_OUTPUT.members[ - "batchEvaluationId" - ] - ) - - case 1: - kwargs["batch_evaluation_arn"] = de.read_string( - _SCHEMA_DELETE_BATCH_EVALUATION_OUTPUT.members[ - "batchEvaluationArn" - ] - ) - - case 2: - kwargs["status"] = BatchEvaluationStatus( - de.read_string( - _SCHEMA_DELETE_BATCH_EVALUATION_OUTPUT.members["status"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_BATCH_EVALUATION_OUTPUT, consumer=_consumer - ) - if "batch_evaluation_id" not in kwargs: - kwargs["batch_evaluation_id"] = "" - if "batch_evaluation_arn" not in kwargs: - kwargs["batch_evaluation_arn"] = "" - if "status" not in kwargs: - kwargs["status"] = BatchEvaluationStatus._corrected("") - return kwargs - - -DELETE_BATCH_EVALUATION = APIOperation( - input=DeleteBatchEvaluationInput, - output=DeleteBatchEvaluationOutput, - schema=_SCHEMA_DELETE_BATCH_EVALUATION, - input_schema=_SCHEMA_DELETE_BATCH_EVALUATION_INPUT, - output_schema=_SCHEMA_DELETE_BATCH_EVALUATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#UnauthorizedException" - ): UnauthorizedException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteRecommendationInput: - """Dataclass for DeleteRecommendationInput structure.""" - - recommendation_id: str | None = None - """The unique identifier of the recommendation to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_RECOMMENDATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.recommendation_id is not None: - serializer.write_string( - _SCHEMA_DELETE_RECOMMENDATION_INPUT.members["recommendationId"], - self.recommendation_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["recommendation_id"] = de.read_string( - _SCHEMA_DELETE_RECOMMENDATION_INPUT.members["recommendationId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_RECOMMENDATION_INPUT, consumer=_consumer - ) - return kwargs - - -class RecommendationStatus(UnknownEnumMixin, StrEnum): - """The lifecycle status of a recommendation.""" - - PENDING = "PENDING" - IN_PROGRESS = "IN_PROGRESS" - COMPLETED = "COMPLETED" - FAILED = "FAILED" - DELETING = "DELETING" - - -@dataclass(kw_only=True) -class DeleteRecommendationOutput: - """Dataclass for DeleteRecommendationOutput structure.""" - - recommendation_id: str - """The unique identifier of the deleted recommendation.""" - - status: str - """The status of the recommendation deletion operation.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_RECOMMENDATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DELETE_RECOMMENDATION_OUTPUT.members["recommendationId"], - self.recommendation_id, - ) - serializer.write_string( - _SCHEMA_DELETE_RECOMMENDATION_OUTPUT.members["status"], self.status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["recommendation_id"] = de.read_string( - _SCHEMA_DELETE_RECOMMENDATION_OUTPUT.members["recommendationId"] - ) - - case 1: - kwargs["status"] = RecommendationStatus( - de.read_string( - _SCHEMA_DELETE_RECOMMENDATION_OUTPUT.members["status"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_RECOMMENDATION_OUTPUT, consumer=_consumer - ) - if "recommendation_id" not in kwargs: - kwargs["recommendation_id"] = "" - if "status" not in kwargs: - kwargs["status"] = RecommendationStatus._corrected("") - return kwargs - - -DELETE_RECOMMENDATION = APIOperation( - input=DeleteRecommendationInput, - output=DeleteRecommendationOutput, - schema=_SCHEMA_DELETE_RECOMMENDATION, - input_schema=_SCHEMA_DELETE_RECOMMENDATION_INPUT, - output_schema=_SCHEMA_DELETE_RECOMMENDATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DuplicateIdException(ServiceError): - """ - An exception thrown when attempting to create a resource with an - identifier that already exists. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DUPLICATE_ID_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_DUPLICATE_ID_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_DUPLICATE_ID_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DUPLICATE_ID_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass -class EvaluationInputSessionSpans: - """ - The collection of spans representing agent execution traces within a - session. Each span contains detailed information about tool calls, model - interactions, and other agent activities that can be evaluated for - quality and performance. - """ - - value: list[Document] - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVALUATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_spans( - serializer, _SCHEMA_EVALUATION_INPUT.members["sessionSpans"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_deserialize_spans( - deserializer, _SCHEMA_EVALUATION_INPUT.members["sessionSpans"] - ) - ) - - -@dataclass -class EvaluationInputUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -EvaluationInput = Union[EvaluationInputSessionSpans | EvaluationInputUnknown] -""" -The input data structure containing agent session spans in OpenTelemetry -format. Supports traces from frameworks like Strands (AgentCore Runtime) -and LangGraph with OpenInference instrumentation for comprehensive -evaluation. -""" - - -class _EvaluationInputDeserializer: - _result: EvaluationInput | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> EvaluationInput: - self._result = None - deserializer.read_struct(_SCHEMA_EVALUATION_INPUT, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(EvaluationInputSessionSpans.deserialize(de)) - - case _: - self._set_result( - EvaluationInputUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: EvaluationInput) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass -class EvaluationContentText: - """ - The text content of the ground truth data. Used for expected response - text and assertion statements. - """ - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVALUATION_CONTENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_EVALUATION_CONTENT.members["text"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string(_SCHEMA_EVALUATION_CONTENT.members["text"]) - ) - - -@dataclass -class EvaluationContentUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -EvaluationContent = Union[EvaluationContentText | EvaluationContentUnknown] -""" -A content block for ground truth data in evaluation reference inputs. -Supports text content for expected responses and assertions. -""" - - -class _EvaluationContentDeserializer: - _result: EvaluationContent | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> EvaluationContent: - self._result = None - deserializer.read_struct(_SCHEMA_EVALUATION_CONTENT, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(EvaluationContentText.deserialize(de)) - - case _: - self._set_result( - EvaluationContentUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: EvaluationContent) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_evaluation_content_list( - serializer: ShapeSerializer, schema: Schema, value: list[EvaluationContent] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_evaluation_content_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[EvaluationContent]: - result: list[EvaluationContent] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_EvaluationContentDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class SpanContext: - """ - The contextual information that uniquely identifies a span within the - distributed tracing system. Contains session, trace, and span - identifiers used to correlate evaluation results with specific agent - execution points. - """ - - session_id: str - """ - The unique identifier of the session containing this span. Sessions - represent complete conversation flows and are detected using - configurable `SessionTimeoutMinutes` (default 15 minutes). - """ - - trace_id: str | None = None - """ - The unique identifier of the trace containing this span. Traces - represent individual request-response interactions within a session and - group related spans together. - """ - - span_id: str | None = None - """ - The unique identifier of the specific span being referenced. Spans - represent individual operations like tool calls, model invocations, or - other discrete actions within the agent's execution. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SPAN_CONTEXT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SPAN_CONTEXT.members["sessionId"], self.session_id - ) - if self.trace_id is not None: - serializer.write_string( - _SCHEMA_SPAN_CONTEXT.members["traceId"], self.trace_id - ) - - if self.span_id is not None: - serializer.write_string( - _SCHEMA_SPAN_CONTEXT.members["spanId"], self.span_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["session_id"] = de.read_string( - _SCHEMA_SPAN_CONTEXT.members["sessionId"] - ) - - case 1: - kwargs["trace_id"] = de.read_string( - _SCHEMA_SPAN_CONTEXT.members["traceId"] - ) - - case 2: - kwargs["span_id"] = de.read_string( - _SCHEMA_SPAN_CONTEXT.members["spanId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SPAN_CONTEXT, consumer=_consumer) - if "session_id" not in kwargs: - kwargs["session_id"] = "" - return kwargs - - -@dataclass -class ContextSpanContext: - """ - The span context information that uniquely identifies the trace and span - being evaluated, including session ID, trace ID, and span ID for precise - targeting within the agent's execution flow. - """ - - value: SpanContext - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTEXT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTEXT.members["spanContext"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=SpanContext.deserialize(deserializer)) - - -@dataclass -class ContextUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -Context = Union[ContextSpanContext | ContextUnknown] -""" -The contextual information associated with an evaluation, including span -context details that identify the specific traces and sessions being -evaluated within the agent's execution flow. -""" - - -class _ContextDeserializer: - _result: Context | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> Context: - self._result = None - deserializer.read_struct(_SCHEMA_CONTEXT, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(ContextSpanContext.deserialize(de)) - - case _: - self._set_result(ContextUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: Context) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_evaluation_tool_names( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_evaluation_tool_names( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class EvaluationExpectedTrajectory: - """The expected tool call trajectory for trajectory-based evaluation.""" - - tool_names: list[str] | None = None - """The list of tool names representing the expected tool call sequence.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVALUATION_EXPECTED_TRAJECTORY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.tool_names is not None: - _serialize_evaluation_tool_names( - serializer, - _SCHEMA_EVALUATION_EXPECTED_TRAJECTORY.members["toolNames"], - self.tool_names, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["tool_names"] = _deserialize_evaluation_tool_names( - de, _SCHEMA_EVALUATION_EXPECTED_TRAJECTORY.members["toolNames"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EVALUATION_EXPECTED_TRAJECTORY, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class EvaluationReferenceInput: - """ - A reference input containing ground truth data for evaluation, scoped to - a specific context level (session or trace) through its span context. - """ - - context: Context - """ - The span context that identifies which session or trace this reference - input applies to, used for correlating ground truth with agent output. - """ - - expected_response: EvaluationContent | None = None - """ - The expected response for trace-level evaluation. Built-in evaluators - that support this field compare the agent's actual response against - this value for assessment. Custom evaluators can access it through the - `{expected_response}` placeholder in their instructions. - """ - - assertions: list[EvaluationContent] | None = None - """ - A list of assertion statements for session-level evaluation. Each - assertion describes an expected behavior or outcome the agent should - demonstrate during the session. - """ - - expected_trajectory: EvaluationExpectedTrajectory | None = None - """ - The expected tool call sequence for session-level trajectory evaluation. - Contains a list of tool names representing the tools the agent is - expected to invoke. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVALUATION_REFERENCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_EVALUATION_REFERENCE_INPUT.members["context"], self.context - ) - if self.expected_response is not None: - serializer.write_struct( - _SCHEMA_EVALUATION_REFERENCE_INPUT.members["expectedResponse"], - self.expected_response, - ) - - if self.assertions is not None: - _serialize_evaluation_content_list( - serializer, - _SCHEMA_EVALUATION_REFERENCE_INPUT.members["assertions"], - self.assertions, - ) - - if self.expected_trajectory is not None: - serializer.write_struct( - _SCHEMA_EVALUATION_REFERENCE_INPUT.members["expectedTrajectory"], - self.expected_trajectory, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["context"] = _ContextDeserializer().deserialize(de) - - case 1: - kwargs["expected_response"] = ( - _EvaluationContentDeserializer().deserialize(de) - ) - - case 2: - kwargs["assertions"] = _deserialize_evaluation_content_list( - de, _SCHEMA_EVALUATION_REFERENCE_INPUT.members["assertions"] - ) - - case 3: - kwargs["expected_trajectory"] = ( - EvaluationExpectedTrajectory.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EVALUATION_REFERENCE_INPUT, consumer=_consumer) - if "context" not in kwargs: - kwargs["context"] = ContextUnknown(tag="") - return kwargs - - -def _serialize_evaluation_reference_inputs( - serializer: ShapeSerializer, schema: Schema, value: list[EvaluationReferenceInput] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_evaluation_reference_inputs( - deserializer: ShapeDeserializer, schema: Schema -) -> list[EvaluationReferenceInput]: - result: list[EvaluationReferenceInput] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(EvaluationReferenceInput.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_span_ids( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_span_ids(deserializer: ShapeDeserializer, schema: Schema) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_trace_ids( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_trace_ids( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass -class EvaluationTargetSpanIds: - """ - The list of specific span IDs to evaluate within the provided traces. - Used to target evaluation at individual tool calls or specific - operations within the agent's execution flow. - """ - - value: list[str] - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVALUATION_TARGET, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_span_ids( - serializer, _SCHEMA_EVALUATION_TARGET.members["spanIds"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_deserialize_span_ids( - deserializer, _SCHEMA_EVALUATION_TARGET.members["spanIds"] - ) - ) - - -@dataclass -class EvaluationTargetTraceIds: - """ - The list of trace IDs to evaluate, representing complete - request-response interactions. Used to evaluate entire conversation - turns or specific agent interactions within a session. - """ - - value: list[str] - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVALUATION_TARGET, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_trace_ids( - serializer, _SCHEMA_EVALUATION_TARGET.members["traceIds"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_deserialize_trace_ids( - deserializer, _SCHEMA_EVALUATION_TARGET.members["traceIds"] - ) - ) - - -@dataclass -class EvaluationTargetUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -EvaluationTarget = Union[ - EvaluationTargetSpanIds | EvaluationTargetTraceIds | EvaluationTargetUnknown -] -""" -The specification of which trace or span IDs to evaluate within the -provided input data. Allows precise targeting of evaluation at different -levels: tool calls, traces, or sessions. -""" - - -class _EvaluationTargetDeserializer: - _result: EvaluationTarget | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> EvaluationTarget: - self._result = None - deserializer.read_struct(_SCHEMA_EVALUATION_TARGET, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(EvaluationTargetSpanIds.deserialize(de)) - - case 1: - self._set_result(EvaluationTargetTraceIds.deserialize(de)) - - case _: - self._set_result( - EvaluationTargetUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: EvaluationTarget) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class EvaluateInput: - """Dataclass for EvaluateInput structure.""" - - evaluator_id: str | None = None - """ - The unique identifier of the evaluator to use for scoring. Can be a - built-in evaluator (e.g., `Builtin.Helpfulness`, `Builtin.Correctness`) - or a custom evaluator Id created through the control plane API. - """ - - evaluation_input: EvaluationInput | None = None - """ - The input data containing agent session spans to be evaluated. Includes - a list of spans in OpenTelemetry format from supported frameworks like - Strands (AgentCore Runtime) or LangGraph with OpenInference - instrumentation. - """ - - evaluation_target: EvaluationTarget | None = None - """ - The specific trace or span IDs to evaluate within the provided input. - Allows targeting evaluation at different levels: individual tool calls, - single request-response interactions (traces), or entire conversation - sessions. - """ - - evaluation_reference_inputs: list[EvaluationReferenceInput] | None = field( - repr=False, default=None - ) - """ - Ground truth data to compare against agent responses during evaluation. - Allows to provide expected responses, assertions, and expected tool - trajectories at different evaluation levels. Session-level reference - inputs apply to the entire conversation, while trace-level reference - inputs target specific request-response interactions identified by trace - ID. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVALUATE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.evaluator_id is not None: - serializer.write_string( - _SCHEMA_EVALUATE_INPUT.members["evaluatorId"], self.evaluator_id - ) - - if self.evaluation_input is not None: - serializer.write_struct( - _SCHEMA_EVALUATE_INPUT.members["evaluationInput"], self.evaluation_input - ) - - if self.evaluation_target is not None: - serializer.write_struct( - _SCHEMA_EVALUATE_INPUT.members["evaluationTarget"], - self.evaluation_target, - ) - - if self.evaluation_reference_inputs is not None: - _serialize_evaluation_reference_inputs( - serializer, - _SCHEMA_EVALUATE_INPUT.members["evaluationReferenceInputs"], - self.evaluation_reference_inputs, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["evaluator_id"] = de.read_string( - _SCHEMA_EVALUATE_INPUT.members["evaluatorId"] - ) - - case 1: - kwargs["evaluation_input"] = ( - _EvaluationInputDeserializer().deserialize(de) - ) - - case 2: - kwargs["evaluation_target"] = ( - _EvaluationTargetDeserializer().deserialize(de) - ) - - case 3: - kwargs["evaluation_reference_inputs"] = ( - _deserialize_evaluation_reference_inputs( - de, - _SCHEMA_EVALUATE_INPUT.members["evaluationReferenceInputs"], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EVALUATE_INPUT, consumer=_consumer) - return kwargs - - -def _serialize_ignored_reference_input_fields( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_ignored_reference_input_fields( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class TokenUsage: - """ - The token consumption statistics for language model operations during - evaluation. Provides detailed breakdown of input, output, and total - tokens used for cost tracking and performance monitoring. - """ - - input_tokens: int | None = None - """ - The number of tokens consumed for input processing during the - evaluation. Includes tokens from the evaluation prompt, agent traces, - and any additional context provided to the evaluator model. - """ - - output_tokens: int | None = None - """ - The number of tokens generated by the evaluator model in its response. - Includes tokens for the score, explanation, and any additional output - produced during the evaluation process. - """ - - total_tokens: int | None = None - """ - The total number of tokens consumed during the evaluation, calculated as - the sum of input and output tokens. Used for cost calculation and rate - limiting within the service limits. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOKEN_USAGE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.input_tokens is not None: - serializer.write_integer( - _SCHEMA_TOKEN_USAGE.members["inputTokens"], self.input_tokens - ) - - if self.output_tokens is not None: - serializer.write_integer( - _SCHEMA_TOKEN_USAGE.members["outputTokens"], self.output_tokens - ) - - if self.total_tokens is not None: - serializer.write_integer( - _SCHEMA_TOKEN_USAGE.members["totalTokens"], self.total_tokens - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["input_tokens"] = de.read_integer( - _SCHEMA_TOKEN_USAGE.members["inputTokens"] - ) - - case 1: - kwargs["output_tokens"] = de.read_integer( - _SCHEMA_TOKEN_USAGE.members["outputTokens"] - ) - - case 2: - kwargs["total_tokens"] = de.read_integer( - _SCHEMA_TOKEN_USAGE.members["totalTokens"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TOKEN_USAGE, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class EvaluationResultContent: - """ - The comprehensive result of an evaluation containing the score, - explanation, evaluator metadata, and execution details. Provides both - quantitative ratings and qualitative insights about agent performance. - """ - - evaluator_arn: str - """ - The Amazon Resource Name (ARN) of the evaluator used to generate this - result. For custom evaluators, this is the full ARN; for built-in - evaluators, this follows the pattern `Builtin.{EvaluatorName}`. - """ - - evaluator_id: str - """ - The unique identifier of the evaluator that produced this result. This - matches the `evaluatorId` provided in the evaluation request and can be - used to identify which evaluator generated specific results. - """ - - evaluator_name: str - """ - The human-readable name of the evaluator used for this evaluation. For - built-in evaluators, this is the descriptive name (e.g., - \"Helpfulness\", \"Correctness\"); for custom evaluators, this is the - user-defined name. - """ - - context: Context - """ - The contextual information associated with this evaluation result, - including span context details that identify the specific traces and - sessions that were evaluated. - """ - - explanation: str | None = field(repr=False, default=None) - """ - The detailed explanation provided by the evaluator describing the - reasoning behind the assigned score. This qualitative feedback helps - understand why specific ratings were given and provides actionable - insights for improvement. - """ - - value: float | None = None - """ - The numerical score assigned by the evaluator according to its - configured rating scale. For numerical scales, this is a decimal value - within the defined range. This field is not allowed for categorical - scales. - """ - - label: str | None = None - """ - The categorical label assigned by the evaluator when using a categorical - rating scale. This provides a human-readable description of the - evaluation result (e.g., \"Excellent\", \"Good\", \"Poor\") - corresponding to the numerical value. For numerical scales, this field - is optional and provides a natural language explanation of what the - value means (e.g., value 0.5 = \"Somewhat Helpful\"). - """ - - token_usage: TokenUsage | None = None - """ - The token consumption statistics for this evaluation, including input - tokens, output tokens, and total tokens used by the underlying language - model during the evaluation process. - """ - - error_message: str | None = None - """ - The error message describing what went wrong if the evaluation failed. - Provides detailed information about evaluation failures to help diagnose - and resolve issues with evaluator configuration or input data. - """ - - error_code: str | None = None - """ - The error code indicating the type of failure that occurred during - evaluation. Used to programmatically identify and handle different - categories of evaluation errors. - """ - - ignored_reference_input_fields: list[str] | None = None - """ - The list of reference input field names that were provided but not used - by the evaluator. Helps identify which ground truth data was not - consumed during evaluation. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVALUATION_RESULT_CONTENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_EVALUATION_RESULT_CONTENT.members["evaluatorArn"], - self.evaluator_arn, - ) - serializer.write_string( - _SCHEMA_EVALUATION_RESULT_CONTENT.members["evaluatorId"], self.evaluator_id - ) - serializer.write_string( - _SCHEMA_EVALUATION_RESULT_CONTENT.members["evaluatorName"], - self.evaluator_name, - ) - if self.explanation is not None: - serializer.write_string( - _SCHEMA_EVALUATION_RESULT_CONTENT.members["explanation"], - self.explanation, - ) - - serializer.write_struct( - _SCHEMA_EVALUATION_RESULT_CONTENT.members["context"], self.context - ) - if self.value is not None: - serializer.write_double( - _SCHEMA_EVALUATION_RESULT_CONTENT.members["value"], self.value - ) - - if self.label is not None: - serializer.write_string( - _SCHEMA_EVALUATION_RESULT_CONTENT.members["label"], self.label - ) - - if self.token_usage is not None: - serializer.write_struct( - _SCHEMA_EVALUATION_RESULT_CONTENT.members["tokenUsage"], - self.token_usage, - ) - - if self.error_message is not None: - serializer.write_string( - _SCHEMA_EVALUATION_RESULT_CONTENT.members["errorMessage"], - self.error_message, - ) - - if self.error_code is not None: - serializer.write_string( - _SCHEMA_EVALUATION_RESULT_CONTENT.members["errorCode"], self.error_code - ) - - if self.ignored_reference_input_fields is not None: - _serialize_ignored_reference_input_fields( - serializer, - _SCHEMA_EVALUATION_RESULT_CONTENT.members[ - "ignoredReferenceInputFields" - ], - self.ignored_reference_input_fields, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["evaluator_arn"] = de.read_string( - _SCHEMA_EVALUATION_RESULT_CONTENT.members["evaluatorArn"] - ) - - case 1: - kwargs["evaluator_id"] = de.read_string( - _SCHEMA_EVALUATION_RESULT_CONTENT.members["evaluatorId"] - ) - - case 2: - kwargs["evaluator_name"] = de.read_string( - _SCHEMA_EVALUATION_RESULT_CONTENT.members["evaluatorName"] - ) - - case 3: - kwargs["explanation"] = de.read_string( - _SCHEMA_EVALUATION_RESULT_CONTENT.members["explanation"] - ) - - case 4: - kwargs["context"] = _ContextDeserializer().deserialize(de) - - case 5: - kwargs["value"] = de.read_double( - _SCHEMA_EVALUATION_RESULT_CONTENT.members["value"] - ) - - case 6: - kwargs["label"] = de.read_string( - _SCHEMA_EVALUATION_RESULT_CONTENT.members["label"] - ) - - case 7: - kwargs["token_usage"] = TokenUsage.deserialize(de) - - case 8: - kwargs["error_message"] = de.read_string( - _SCHEMA_EVALUATION_RESULT_CONTENT.members["errorMessage"] - ) - - case 9: - kwargs["error_code"] = de.read_string( - _SCHEMA_EVALUATION_RESULT_CONTENT.members["errorCode"] - ) - - case 10: - kwargs["ignored_reference_input_fields"] = ( - _deserialize_ignored_reference_input_fields( - de, - _SCHEMA_EVALUATION_RESULT_CONTENT.members[ - "ignoredReferenceInputFields" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EVALUATION_RESULT_CONTENT, consumer=_consumer) - if "evaluator_arn" not in kwargs: - kwargs["evaluator_arn"] = "" - if "evaluator_id" not in kwargs: - kwargs["evaluator_id"] = "" - if "evaluator_name" not in kwargs: - kwargs["evaluator_name"] = "" - if "context" not in kwargs: - kwargs["context"] = ContextUnknown(tag="") - return kwargs - - -def _serialize_evaluation_results( - serializer: ShapeSerializer, schema: Schema, value: list[EvaluationResultContent] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_evaluation_results( - deserializer: ShapeDeserializer, schema: Schema -) -> list[EvaluationResultContent]: - result: list[EvaluationResultContent] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(EvaluationResultContent.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class EvaluateOutput: - """Dataclass for EvaluateOutput structure.""" - - evaluation_results: list[EvaluationResultContent] - """ - The detailed evaluation results containing scores, explanations, and - metadata. Includes the evaluator information, numerical or categorical - ratings based on the evaluator's rating scale, and token usage - statistics for the evaluation process. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVALUATE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_evaluation_results( - serializer, - _SCHEMA_EVALUATE_OUTPUT.members["evaluationResults"], - self.evaluation_results, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["evaluation_results"] = _deserialize_evaluation_results( - de, _SCHEMA_EVALUATE_OUTPUT.members["evaluationResults"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EVALUATE_OUTPUT, consumer=_consumer) - if "evaluation_results" not in kwargs: - kwargs["evaluation_results"] = [] - return kwargs - - -EVALUATE = APIOperation( - input=EvaluateInput, - output=EvaluateOutput, - schema=_SCHEMA_EVALUATE, - input_schema=_SCHEMA_EVALUATE_INPUT, - output_schema=_SCHEMA_EVALUATE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcore#DuplicateIdException" - ): DuplicateIdException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#UnauthorizedException" - ): UnauthorizedException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_DUPLICATE_ID_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetABTestInput: - """Dataclass for GetABTestInput structure.""" - - ab_test_id: str | None = None - """The unique identifier of the A/B test to retrieve.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_AB_TEST_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.ab_test_id is not None: - serializer.write_string( - _SCHEMA_GET_AB_TEST_INPUT.members["abTestId"], self.ab_test_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["ab_test_id"] = de.read_string( - _SCHEMA_GET_AB_TEST_INPUT.members["abTestId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_AB_TEST_INPUT, consumer=_consumer) - return kwargs - - -def _serialize_error_details_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_error_details_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GetABTestOutput: - """Dataclass for GetABTestOutput structure.""" - - ab_test_id: str - """The unique identifier of the A/B test.""" - - ab_test_arn: str - """The Amazon Resource Name (ARN) of the A/B test.""" - - name: str - """The name of the A/B test.""" - - status: str - """The current status of the A/B test.""" - - execution_status: str - """ - The execution status indicating whether the A/B test is currently - running. - """ - - gateway_arn: str - """ - The Amazon Resource Name (ARN) of the gateway used for traffic - splitting. - """ - - variants: list[Variant] - """The list of variants in the A/B test.""" - - evaluation_config: ABTestEvaluationConfig - """The evaluation configuration for measuring variant performance.""" - - created_at: datetime - """The timestamp when the A/B test was created.""" - - updated_at: datetime - """The timestamp when the A/B test was last updated.""" - - description: str | None = None - """The description of the A/B test.""" - - gateway_filter: GatewayFilter | None = None - """The gateway filter restricting which target paths are included.""" - - role_arn: str | None = None - """The IAM role ARN used by the A/B test.""" - - current_run_id: str | None = None - """The identifier of the current run of the A/B test.""" - - error_details: list[str] | None = None - """The error details if the A/B test encountered failures.""" - - started_at: datetime | None = None - """The timestamp when the A/B test was started.""" - - stopped_at: datetime | None = None - """The timestamp when the A/B test was stopped.""" - - max_duration_expires_at: datetime | None = None - """The timestamp when the A/B test will automatically expire.""" - - results: ABTestResults | None = None - """ - The statistical results of the A/B test, including per-evaluator metrics - and significance analysis. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_AB_TEST_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_AB_TEST_OUTPUT.members["abTestId"], self.ab_test_id - ) - serializer.write_string( - _SCHEMA_GET_AB_TEST_OUTPUT.members["abTestArn"], self.ab_test_arn - ) - serializer.write_string(_SCHEMA_GET_AB_TEST_OUTPUT.members["name"], self.name) - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_AB_TEST_OUTPUT.members["description"], self.description - ) - - serializer.write_string( - _SCHEMA_GET_AB_TEST_OUTPUT.members["status"], self.status - ) - serializer.write_string( - _SCHEMA_GET_AB_TEST_OUTPUT.members["executionStatus"], self.execution_status - ) - serializer.write_string( - _SCHEMA_GET_AB_TEST_OUTPUT.members["gatewayArn"], self.gateway_arn - ) - _serialize_variant_list( - serializer, _SCHEMA_GET_AB_TEST_OUTPUT.members["variants"], self.variants - ) - if self.gateway_filter is not None: - serializer.write_struct( - _SCHEMA_GET_AB_TEST_OUTPUT.members["gatewayFilter"], self.gateway_filter - ) - - serializer.write_struct( - _SCHEMA_GET_AB_TEST_OUTPUT.members["evaluationConfig"], - self.evaluation_config, - ) - if self.role_arn is not None: - serializer.write_string( - _SCHEMA_GET_AB_TEST_OUTPUT.members["roleArn"], self.role_arn - ) - - if self.current_run_id is not None: - serializer.write_string( - _SCHEMA_GET_AB_TEST_OUTPUT.members["currentRunId"], self.current_run_id - ) - - if self.error_details is not None: - _serialize_error_details_list( - serializer, - _SCHEMA_GET_AB_TEST_OUTPUT.members["errorDetails"], - self.error_details, - ) - - if self.started_at is not None: - serializer.write_timestamp( - _SCHEMA_GET_AB_TEST_OUTPUT.members["startedAt"], self.started_at - ) - - if self.stopped_at is not None: - serializer.write_timestamp( - _SCHEMA_GET_AB_TEST_OUTPUT.members["stoppedAt"], self.stopped_at - ) - - if self.max_duration_expires_at is not None: - serializer.write_timestamp( - _SCHEMA_GET_AB_TEST_OUTPUT.members["maxDurationExpiresAt"], - self.max_duration_expires_at, - ) - - serializer.write_timestamp( - _SCHEMA_GET_AB_TEST_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_GET_AB_TEST_OUTPUT.members["updatedAt"], self.updated_at - ) - if self.results is not None: - serializer.write_struct( - _SCHEMA_GET_AB_TEST_OUTPUT.members["results"], self.results - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["ab_test_id"] = de.read_string( - _SCHEMA_GET_AB_TEST_OUTPUT.members["abTestId"] - ) - - case 1: - kwargs["ab_test_arn"] = de.read_string( - _SCHEMA_GET_AB_TEST_OUTPUT.members["abTestArn"] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_GET_AB_TEST_OUTPUT.members["name"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_GET_AB_TEST_OUTPUT.members["description"] - ) - - case 4: - kwargs["status"] = ABTestStatus( - de.read_string(_SCHEMA_GET_AB_TEST_OUTPUT.members["status"]) - ) - - case 5: - kwargs["execution_status"] = ABTestExecutionStatus( - de.read_string( - _SCHEMA_GET_AB_TEST_OUTPUT.members["executionStatus"] - ) - ) - - case 6: - kwargs["gateway_arn"] = de.read_string( - _SCHEMA_GET_AB_TEST_OUTPUT.members["gatewayArn"] - ) - - case 7: - kwargs["variants"] = _deserialize_variant_list( - de, _SCHEMA_GET_AB_TEST_OUTPUT.members["variants"] - ) - - case 8: - kwargs["gateway_filter"] = GatewayFilter.deserialize(de) - - case 9: - kwargs["evaluation_config"] = ( - _ABTestEvaluationConfigDeserializer().deserialize(de) - ) - - case 10: - kwargs["role_arn"] = de.read_string( - _SCHEMA_GET_AB_TEST_OUTPUT.members["roleArn"] - ) - - case 11: - kwargs["current_run_id"] = de.read_string( - _SCHEMA_GET_AB_TEST_OUTPUT.members["currentRunId"] - ) - - case 12: - kwargs["error_details"] = _deserialize_error_details_list( - de, _SCHEMA_GET_AB_TEST_OUTPUT.members["errorDetails"] - ) - - case 13: - kwargs["started_at"] = de.read_timestamp( - _SCHEMA_GET_AB_TEST_OUTPUT.members["startedAt"] - ) - - case 14: - kwargs["stopped_at"] = de.read_timestamp( - _SCHEMA_GET_AB_TEST_OUTPUT.members["stoppedAt"] - ) - - case 15: - kwargs["max_duration_expires_at"] = de.read_timestamp( - _SCHEMA_GET_AB_TEST_OUTPUT.members["maxDurationExpiresAt"] - ) - - case 16: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_AB_TEST_OUTPUT.members["createdAt"] - ) - - case 17: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_GET_AB_TEST_OUTPUT.members["updatedAt"] - ) - - case 18: - kwargs["results"] = ABTestResults.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_AB_TEST_OUTPUT, consumer=_consumer) - if "ab_test_id" not in kwargs: - kwargs["ab_test_id"] = "" - if "ab_test_arn" not in kwargs: - kwargs["ab_test_arn"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "status" not in kwargs: - kwargs["status"] = ABTestStatus._corrected("") - if "execution_status" not in kwargs: - kwargs["execution_status"] = ABTestExecutionStatus._corrected("") - if "gateway_arn" not in kwargs: - kwargs["gateway_arn"] = "" - if "variants" not in kwargs: - kwargs["variants"] = [] - if "evaluation_config" not in kwargs: - kwargs["evaluation_config"] = ABTestEvaluationConfigUnknown(tag="") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -GET_AB_TEST = APIOperation( - input=GetABTestInput, - output=GetABTestOutput, - schema=_SCHEMA_GET_AB_TEST, - input_schema=_SCHEMA_GET_AB_TEST_INPUT, - output_schema=_SCHEMA_GET_AB_TEST_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#UnauthorizedException" - ): UnauthorizedException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetBatchEvaluationInput: - """Dataclass for GetBatchEvaluationInput structure.""" - - batch_evaluation_id: str | None = None - """The unique identifier of the batch evaluation to retrieve.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_BATCH_EVALUATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.batch_evaluation_id is not None: - serializer.write_string( - _SCHEMA_GET_BATCH_EVALUATION_INPUT.members["batchEvaluationId"], - self.batch_evaluation_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["batch_evaluation_id"] = de.read_string( - _SCHEMA_GET_BATCH_EVALUATION_INPUT.members["batchEvaluationId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_BATCH_EVALUATION_INPUT, consumer=_consumer) - return kwargs - - -def _serialize_evaluation_string_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_evaluation_string_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_trace_id_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_trace_id_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class SessionTraceIds: - """ - A pairing of a session with the specific trace IDs to evaluate within - that session. Use this to evaluate individual traces rather than an - entire session. - """ - - session_id: str - """ - The unique identifier of the session that contains the traces to - evaluate. - """ - - trace_ids: list[str] - """The list of trace IDs within the session to evaluate.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SESSION_TRACE_IDS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SESSION_TRACE_IDS.members["sessionId"], self.session_id - ) - _serialize_trace_id_list( - serializer, _SCHEMA_SESSION_TRACE_IDS.members["traceIds"], self.trace_ids - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["session_id"] = de.read_string( - _SCHEMA_SESSION_TRACE_IDS.members["sessionId"] - ) - - case 1: - kwargs["trace_ids"] = _deserialize_trace_id_list( - de, _SCHEMA_SESSION_TRACE_IDS.members["traceIds"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SESSION_TRACE_IDS, consumer=_consumer) - if "session_id" not in kwargs: - kwargs["session_id"] = "" - if "trace_ids" not in kwargs: - kwargs["trace_ids"] = [] - return kwargs - - -def _serialize_session_trace_ids_list( - serializer: ShapeSerializer, schema: Schema, value: list[SessionTraceIds] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_session_trace_ids_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[SessionTraceIds]: - result: list[SessionTraceIds] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(SessionTraceIds.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class SessionFilterConfig: - """ - A time range filter for selecting sessions. Specifies the start and end - times to narrow down which sessions are included. - """ - - start_time: datetime | None = None - """ - The start time of the time range. Only sessions with activity at or - after this timestamp are included. - """ - - end_time: datetime | None = None - """ - The end time of the time range. Only sessions with activity before this - timestamp are included. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SESSION_FILTER_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.start_time is not None: - serializer.write_timestamp( - _SCHEMA_SESSION_FILTER_CONFIG.members["startTime"], self.start_time - ) - - if self.end_time is not None: - serializer.write_timestamp( - _SCHEMA_SESSION_FILTER_CONFIG.members["endTime"], self.end_time - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["start_time"] = de.read_timestamp( - _SCHEMA_SESSION_FILTER_CONFIG.members["startTime"] - ) - - case 1: - kwargs["end_time"] = de.read_timestamp( - _SCHEMA_SESSION_FILTER_CONFIG.members["endTime"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SESSION_FILTER_CONFIG, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CloudWatchFilterConfig: - """ - Filter configuration for narrowing down CloudWatch Logs sessions for - evaluation. - """ - - session_ids: list[str] | None = None - """ - A list of specific session IDs to evaluate. If specified, only these - sessions are included in the evaluation. - """ - - time_range: SessionFilterConfig | None = None - """The time range filter for selecting sessions to evaluate.""" - - session_trace_ids: list[SessionTraceIds] | None = None - """ - A list of session and trace ID pairs that restrict evaluation to - specific traces within a session. If specified, only the listed traces - are evaluated instead of the entire session. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CLOUD_WATCH_FILTER_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.session_ids is not None: - _serialize_evaluation_string_list( - serializer, - _SCHEMA_CLOUD_WATCH_FILTER_CONFIG.members["sessionIds"], - self.session_ids, - ) - - if self.time_range is not None: - serializer.write_struct( - _SCHEMA_CLOUD_WATCH_FILTER_CONFIG.members["timeRange"], self.time_range - ) - - if self.session_trace_ids is not None: - _serialize_session_trace_ids_list( - serializer, - _SCHEMA_CLOUD_WATCH_FILTER_CONFIG.members["sessionTraceIds"], - self.session_trace_ids, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["session_ids"] = _deserialize_evaluation_string_list( - de, _SCHEMA_CLOUD_WATCH_FILTER_CONFIG.members["sessionIds"] - ) - - case 1: - kwargs["time_range"] = SessionFilterConfig.deserialize(de) - - case 2: - kwargs["session_trace_ids"] = _deserialize_session_trace_ids_list( - de, _SCHEMA_CLOUD_WATCH_FILTER_CONFIG.members["sessionTraceIds"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CLOUD_WATCH_FILTER_CONFIG, consumer=_consumer) - return kwargs - - -def _serialize_log_group_name_prefix_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_log_group_name_prefix_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_log_group_name_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_log_group_name_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CloudWatchLogsSource: - """The configuration for reading agent traces from CloudWatch Logs.""" - - service_names: list[str] - """ - The list of agent service names to filter traces within the specified - log groups. - """ - - log_group_names: list[str] = field(default_factory=list[str]) - """ - The list of CloudWatch log group names to read agent traces from. - Maximum of 10 log groups. - """ - - log_group_name_prefixes: list[str] | None = None - """ - The list of CloudWatch log group name prefixes to read agent traces - from. Specify this instead of `logGroupNames` to match log groups by - prefix. Maximum of 5 prefixes. Specify either `logGroupNames` or - `logGroupNamePrefixes`, not both. One of the two is required. - """ - - filter_config: CloudWatchFilterConfig | None = None - """Optional filter configuration to narrow down which sessions to evaluate.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CLOUD_WATCH_LOGS_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_evaluation_string_list( - serializer, - _SCHEMA_CLOUD_WATCH_LOGS_SOURCE.members["serviceNames"], - self.service_names, - ) - _serialize_log_group_name_list( - serializer, - _SCHEMA_CLOUD_WATCH_LOGS_SOURCE.members["logGroupNames"], - self.log_group_names, - ) - if self.log_group_name_prefixes is not None: - _serialize_log_group_name_prefix_list( - serializer, - _SCHEMA_CLOUD_WATCH_LOGS_SOURCE.members["logGroupNamePrefixes"], - self.log_group_name_prefixes, - ) - - if self.filter_config is not None: - serializer.write_struct( - _SCHEMA_CLOUD_WATCH_LOGS_SOURCE.members["filterConfig"], - self.filter_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["service_names"] = _deserialize_evaluation_string_list( - de, _SCHEMA_CLOUD_WATCH_LOGS_SOURCE.members["serviceNames"] - ) - - case 1: - kwargs["log_group_names"] = _deserialize_log_group_name_list( - de, _SCHEMA_CLOUD_WATCH_LOGS_SOURCE.members["logGroupNames"] - ) - - case 2: - kwargs["log_group_name_prefixes"] = ( - _deserialize_log_group_name_prefix_list( - de, - _SCHEMA_CLOUD_WATCH_LOGS_SOURCE.members[ - "logGroupNamePrefixes" - ], - ) - ) - - case 3: - kwargs["filter_config"] = CloudWatchFilterConfig.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CLOUD_WATCH_LOGS_SOURCE, consumer=_consumer) - if "service_names" not in kwargs: - kwargs["service_names"] = [] - return kwargs - - -@dataclass(kw_only=True) -class OnlineEvaluationConfigSource: - """ - A reference to an existing online evaluation configuration to use as the - data source for batch evaluation. - """ - - online_evaluation_config_arn: str - """ - The Amazon Resource Name (ARN) of the online evaluation configuration to - use as the session source. - """ - - time_range: SessionFilterConfig | None = None - """ - Optional session filter configuration to narrow down which sessions from - the online evaluation configuration to include. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ONLINE_EVALUATION_CONFIG_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_ONLINE_EVALUATION_CONFIG_SOURCE.members[ - "onlineEvaluationConfigArn" - ], - self.online_evaluation_config_arn, - ) - if self.time_range is not None: - serializer.write_struct( - _SCHEMA_ONLINE_EVALUATION_CONFIG_SOURCE.members["timeRange"], - self.time_range, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["online_evaluation_config_arn"] = de.read_string( - _SCHEMA_ONLINE_EVALUATION_CONFIG_SOURCE.members[ - "onlineEvaluationConfigArn" - ] - ) - - case 1: - kwargs["time_range"] = SessionFilterConfig.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ONLINE_EVALUATION_CONFIG_SOURCE, consumer=_consumer - ) - if "online_evaluation_config_arn" not in kwargs: - kwargs["online_evaluation_config_arn"] = "" - return kwargs - - -@dataclass -class DataSourceConfigCloudWatchLogs: - """Configuration for pulling agent session traces from CloudWatch Logs.""" - - value: CloudWatchLogsSource - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DATA_SOURCE_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DATA_SOURCE_CONFIG.members["cloudWatchLogs"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=CloudWatchLogsSource.deserialize(deserializer)) - - -@dataclass -class DataSourceConfigOnlineEvaluationConfigSource: - """Reference an existing OnlineEvaluationConfig as session source""" - - value: OnlineEvaluationConfigSource - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DATA_SOURCE_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DATA_SOURCE_CONFIG.members["onlineEvaluationConfigSource"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=OnlineEvaluationConfigSource.deserialize(deserializer)) - - -@dataclass -class DataSourceConfigUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -DataSourceConfig = Union[ - DataSourceConfigCloudWatchLogs - | DataSourceConfigOnlineEvaluationConfigSource - | DataSourceConfigUnknown -] -"""Configuration for the data source used in evaluation.""" - - -class _DataSourceConfigDeserializer: - _result: DataSourceConfig | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> DataSourceConfig: - self._result = None - deserializer.read_struct(_SCHEMA_DATA_SOURCE_CONFIG, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(DataSourceConfigCloudWatchLogs.deserialize(de)) - - case 1: - self._set_result( - DataSourceConfigOnlineEvaluationConfigSource.deserialize(de) - ) - - case _: - self._set_result( - DataSourceConfigUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: DataSourceConfig) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class EvaluatorStatistics: - """Aggregated statistics for an evaluator.""" - - average_score: float | None = None - """The average score across all evaluated sessions for this evaluator.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVALUATOR_STATISTICS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.average_score is not None: - serializer.write_double( - _SCHEMA_EVALUATOR_STATISTICS.members["averageScore"], self.average_score - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["average_score"] = de.read_double( - _SCHEMA_EVALUATOR_STATISTICS.members["averageScore"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EVALUATOR_STATISTICS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class EvaluatorSummary: - """Summary statistics for a single evaluator within a batch evaluation.""" - - evaluator_id: str | None = None - """The unique identifier of the evaluator.""" - - statistics: EvaluatorStatistics | None = None - """The aggregated statistics for this evaluator.""" - - total_evaluated: int | None = None - """The total number of sessions evaluated by this evaluator.""" - - total_failed: int | None = None - """The total number of sessions that failed evaluation by this evaluator.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVALUATOR_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.evaluator_id is not None: - serializer.write_string( - _SCHEMA_EVALUATOR_SUMMARY.members["evaluatorId"], self.evaluator_id - ) - - if self.statistics is not None: - serializer.write_struct( - _SCHEMA_EVALUATOR_SUMMARY.members["statistics"], self.statistics - ) - - if self.total_evaluated is not None: - serializer.write_integer( - _SCHEMA_EVALUATOR_SUMMARY.members["totalEvaluated"], - self.total_evaluated, - ) - - if self.total_failed is not None: - serializer.write_integer( - _SCHEMA_EVALUATOR_SUMMARY.members["totalFailed"], self.total_failed - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["evaluator_id"] = de.read_string( - _SCHEMA_EVALUATOR_SUMMARY.members["evaluatorId"] - ) - - case 1: - kwargs["statistics"] = EvaluatorStatistics.deserialize(de) - - case 2: - kwargs["total_evaluated"] = de.read_integer( - _SCHEMA_EVALUATOR_SUMMARY.members["totalEvaluated"] - ) - - case 3: - kwargs["total_failed"] = de.read_integer( - _SCHEMA_EVALUATOR_SUMMARY.members["totalFailed"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EVALUATOR_SUMMARY, consumer=_consumer) - return kwargs - - -def _serialize_evaluator_summary_list( - serializer: ShapeSerializer, schema: Schema, value: list[EvaluatorSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_evaluator_summary_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[EvaluatorSummary]: - result: list[EvaluatorSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(EvaluatorSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class EvaluationJobResults: - """ - Aggregated results from a batch evaluation, including session completion - counts and evaluator score summaries. - """ - - number_of_sessions_completed: int | None = None - """The number of sessions that have been successfully evaluated.""" - - number_of_sessions_in_progress: int | None = None - """The number of sessions currently being evaluated.""" - - number_of_sessions_failed: int | None = None - """The number of sessions that failed evaluation.""" - - total_number_of_sessions: int | None = None - """The total number of sessions included in the batch evaluation.""" - - number_of_sessions_ignored: int | None = None - """The number of sessions that were ignored during evaluation.""" - - evaluator_summaries: list[EvaluatorSummary] | None = None - """A list of per-evaluator summary statistics.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVALUATION_JOB_RESULTS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.number_of_sessions_completed is not None: - serializer.write_integer( - _SCHEMA_EVALUATION_JOB_RESULTS.members["numberOfSessionsCompleted"], - self.number_of_sessions_completed, - ) - - if self.number_of_sessions_in_progress is not None: - serializer.write_integer( - _SCHEMA_EVALUATION_JOB_RESULTS.members["numberOfSessionsInProgress"], - self.number_of_sessions_in_progress, - ) - - if self.number_of_sessions_failed is not None: - serializer.write_integer( - _SCHEMA_EVALUATION_JOB_RESULTS.members["numberOfSessionsFailed"], - self.number_of_sessions_failed, - ) - - if self.total_number_of_sessions is not None: - serializer.write_integer( - _SCHEMA_EVALUATION_JOB_RESULTS.members["totalNumberOfSessions"], - self.total_number_of_sessions, - ) - - if self.number_of_sessions_ignored is not None: - serializer.write_integer( - _SCHEMA_EVALUATION_JOB_RESULTS.members["numberOfSessionsIgnored"], - self.number_of_sessions_ignored, - ) - - if self.evaluator_summaries is not None: - _serialize_evaluator_summary_list( - serializer, - _SCHEMA_EVALUATION_JOB_RESULTS.members["evaluatorSummaries"], - self.evaluator_summaries, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["number_of_sessions_completed"] = de.read_integer( - _SCHEMA_EVALUATION_JOB_RESULTS.members[ - "numberOfSessionsCompleted" - ] - ) - - case 1: - kwargs["number_of_sessions_in_progress"] = de.read_integer( - _SCHEMA_EVALUATION_JOB_RESULTS.members[ - "numberOfSessionsInProgress" - ] - ) - - case 2: - kwargs["number_of_sessions_failed"] = de.read_integer( - _SCHEMA_EVALUATION_JOB_RESULTS.members["numberOfSessionsFailed"] - ) - - case 3: - kwargs["total_number_of_sessions"] = de.read_integer( - _SCHEMA_EVALUATION_JOB_RESULTS.members["totalNumberOfSessions"] - ) - - case 4: - kwargs["number_of_sessions_ignored"] = de.read_integer( - _SCHEMA_EVALUATION_JOB_RESULTS.members[ - "numberOfSessionsIgnored" - ] - ) - - case 5: - kwargs["evaluator_summaries"] = _deserialize_evaluator_summary_list( - de, _SCHEMA_EVALUATION_JOB_RESULTS.members["evaluatorSummaries"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EVALUATION_JOB_RESULTS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Evaluator: - """An evaluator to run against sessions during batch evaluation.""" - - evaluator_id: str - """ - The unique identifier of the evaluator. Can reference built-in - evaluators (e.g., `Builtin.Helpfulness`) or custom evaluators. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVALUATOR, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_EVALUATOR.members["evaluatorId"], self.evaluator_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["evaluator_id"] = de.read_string( - _SCHEMA_EVALUATOR.members["evaluatorId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EVALUATOR, consumer=_consumer) - if "evaluator_id" not in kwargs: - kwargs["evaluator_id"] = "" - return kwargs - - -def _serialize_evaluator_list( - serializer: ShapeSerializer, schema: Schema, value: list[Evaluator] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_evaluator_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Evaluator]: - result: list[Evaluator] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Evaluator.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ExecutionSummaryAffectedSession: - """A session associated with an execution summary cluster.""" - - session_id: str - """The unique identifier of the session.""" - - approach_taken: str - """The approach taken by the agent during this session.""" - - final_outcome: str - """The final outcome of the session.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EXECUTION_SUMMARY_AFFECTED_SESSION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_EXECUTION_SUMMARY_AFFECTED_SESSION.members["sessionId"], - self.session_id, - ) - serializer.write_string( - _SCHEMA_EXECUTION_SUMMARY_AFFECTED_SESSION.members["approachTaken"], - self.approach_taken, - ) - serializer.write_string( - _SCHEMA_EXECUTION_SUMMARY_AFFECTED_SESSION.members["finalOutcome"], - self.final_outcome, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["session_id"] = de.read_string( - _SCHEMA_EXECUTION_SUMMARY_AFFECTED_SESSION.members["sessionId"] - ) - - case 1: - kwargs["approach_taken"] = de.read_string( - _SCHEMA_EXECUTION_SUMMARY_AFFECTED_SESSION.members[ - "approachTaken" - ] - ) - - case 2: - kwargs["final_outcome"] = de.read_string( - _SCHEMA_EXECUTION_SUMMARY_AFFECTED_SESSION.members[ - "finalOutcome" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EXECUTION_SUMMARY_AFFECTED_SESSION, consumer=_consumer - ) - if "session_id" not in kwargs: - kwargs["session_id"] = "" - if "approach_taken" not in kwargs: - kwargs["approach_taken"] = "" - if "final_outcome" not in kwargs: - kwargs["final_outcome"] = "" - return kwargs - - -def _serialize_execution_summary_affected_session_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[ExecutionSummaryAffectedSession], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_execution_summary_affected_session_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ExecutionSummaryAffectedSession]: - result: list[ExecutionSummaryAffectedSession] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ExecutionSummaryAffectedSession.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ExecutionSummaryCluster: - """A cluster of similar execution patterns identified across sessions.""" - - cluster_id: int - """The unique identifier of the execution summary cluster.""" - - name: str - """The name of the execution pattern cluster.""" - - description: str - """A description of the execution pattern.""" - - affected_session_count: int - """The number of sessions with this execution pattern.""" - - affected_sessions: list[ExecutionSummaryAffectedSession] - """The list of sessions with this execution pattern.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EXECUTION_SUMMARY_CLUSTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer( - _SCHEMA_EXECUTION_SUMMARY_CLUSTER.members["clusterId"], self.cluster_id - ) - serializer.write_string( - _SCHEMA_EXECUTION_SUMMARY_CLUSTER.members["name"], self.name - ) - serializer.write_string( - _SCHEMA_EXECUTION_SUMMARY_CLUSTER.members["description"], self.description - ) - serializer.write_integer( - _SCHEMA_EXECUTION_SUMMARY_CLUSTER.members["affectedSessionCount"], - self.affected_session_count, - ) - _serialize_execution_summary_affected_session_list( - serializer, - _SCHEMA_EXECUTION_SUMMARY_CLUSTER.members["affectedSessions"], - self.affected_sessions, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["cluster_id"] = de.read_integer( - _SCHEMA_EXECUTION_SUMMARY_CLUSTER.members["clusterId"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_EXECUTION_SUMMARY_CLUSTER.members["name"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_EXECUTION_SUMMARY_CLUSTER.members["description"] - ) - - case 3: - kwargs["affected_session_count"] = de.read_integer( - _SCHEMA_EXECUTION_SUMMARY_CLUSTER.members[ - "affectedSessionCount" - ] - ) - - case 4: - kwargs["affected_sessions"] = ( - _deserialize_execution_summary_affected_session_list( - de, - _SCHEMA_EXECUTION_SUMMARY_CLUSTER.members[ - "affectedSessions" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EXECUTION_SUMMARY_CLUSTER, consumer=_consumer) - if "cluster_id" not in kwargs: - kwargs["cluster_id"] = 0 - if "name" not in kwargs: - kwargs["name"] = "" - if "description" not in kwargs: - kwargs["description"] = "" - if "affected_session_count" not in kwargs: - kwargs["affected_session_count"] = 0 - if "affected_sessions" not in kwargs: - kwargs["affected_sessions"] = [] - return kwargs - - -def _serialize_execution_summary_cluster_list( - serializer: ShapeSerializer, schema: Schema, value: list[ExecutionSummaryCluster] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_execution_summary_cluster_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ExecutionSummaryCluster]: - result: list[ExecutionSummaryCluster] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ExecutionSummaryCluster.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ExecutionSummaryClusteringResultContent: - """ - The execution summary clustering result containing grouped execution - patterns identified across evaluated sessions. - """ - - execution_summaries: list[ExecutionSummaryCluster] - """ - The list of execution summary clusters identified across analyzed - sessions. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_EXECUTION_SUMMARY_CLUSTERING_RESULT_CONTENT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_execution_summary_cluster_list( - serializer, - _SCHEMA_EXECUTION_SUMMARY_CLUSTERING_RESULT_CONTENT.members[ - "executionSummaries" - ], - self.execution_summaries, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["execution_summaries"] = ( - _deserialize_execution_summary_cluster_list( - de, - _SCHEMA_EXECUTION_SUMMARY_CLUSTERING_RESULT_CONTENT.members[ - "executionSummaries" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EXECUTION_SUMMARY_CLUSTERING_RESULT_CONTENT, consumer=_consumer - ) - if "execution_summaries" not in kwargs: - kwargs["execution_summaries"] = [] - return kwargs - - -@dataclass(kw_only=True) -class RootCauseCluster: - """ - A cluster of similar root causes identified within a failure - subcategory. - """ - - cluster_id: int - """The unique identifier of the root cause cluster.""" - - name: str - """The name of the root cause cluster.""" - - root_cause: str - """The root cause explanation for this cluster of failures.""" - - recommendation: str - """The recommended fix for this root cause.""" - - affected_session_count: int - """The number of sessions affected by this root cause.""" - - affected_sessions: list[AffectedSession] - """The list of sessions affected by this root cause.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ROOT_CAUSE_CLUSTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer( - _SCHEMA_ROOT_CAUSE_CLUSTER.members["clusterId"], self.cluster_id - ) - serializer.write_string(_SCHEMA_ROOT_CAUSE_CLUSTER.members["name"], self.name) - serializer.write_string( - _SCHEMA_ROOT_CAUSE_CLUSTER.members["rootCause"], self.root_cause - ) - serializer.write_string( - _SCHEMA_ROOT_CAUSE_CLUSTER.members["recommendation"], self.recommendation - ) - serializer.write_integer( - _SCHEMA_ROOT_CAUSE_CLUSTER.members["affectedSessionCount"], - self.affected_session_count, - ) - _serialize_affected_session_list( - serializer, - _SCHEMA_ROOT_CAUSE_CLUSTER.members["affectedSessions"], - self.affected_sessions, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["cluster_id"] = de.read_integer( - _SCHEMA_ROOT_CAUSE_CLUSTER.members["clusterId"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_ROOT_CAUSE_CLUSTER.members["name"] - ) - - case 2: - kwargs["root_cause"] = de.read_string( - _SCHEMA_ROOT_CAUSE_CLUSTER.members["rootCause"] - ) - - case 3: - kwargs["recommendation"] = de.read_string( - _SCHEMA_ROOT_CAUSE_CLUSTER.members["recommendation"] - ) - - case 4: - kwargs["affected_session_count"] = de.read_integer( - _SCHEMA_ROOT_CAUSE_CLUSTER.members["affectedSessionCount"] - ) - - case 5: - kwargs["affected_sessions"] = _deserialize_affected_session_list( - de, _SCHEMA_ROOT_CAUSE_CLUSTER.members["affectedSessions"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ROOT_CAUSE_CLUSTER, consumer=_consumer) - if "cluster_id" not in kwargs: - kwargs["cluster_id"] = 0 - if "name" not in kwargs: - kwargs["name"] = "" - if "root_cause" not in kwargs: - kwargs["root_cause"] = "" - if "recommendation" not in kwargs: - kwargs["recommendation"] = "" - if "affected_session_count" not in kwargs: - kwargs["affected_session_count"] = 0 - if "affected_sessions" not in kwargs: - kwargs["affected_sessions"] = [] - return kwargs - - -def _serialize_root_cause_cluster_list( - serializer: ShapeSerializer, schema: Schema, value: list[RootCauseCluster] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_root_cause_cluster_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[RootCauseCluster]: - result: list[RootCauseCluster] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(RootCauseCluster.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class FailureSubCategoryCluster: - """A subcategory of failures within a top-level failure category.""" - - cluster_id: int - """The unique identifier of the failure subcategory cluster.""" - - name: str - """The name of the failure subcategory.""" - - description: str - """A description of the failure subcategory pattern.""" - - affected_session_count: int - """The number of sessions affected by this failure subcategory.""" - - root_causes: list[RootCauseCluster] - """The list of root cause clusters identified within this subcategory.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FAILURE_SUB_CATEGORY_CLUSTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer( - _SCHEMA_FAILURE_SUB_CATEGORY_CLUSTER.members["clusterId"], self.cluster_id - ) - serializer.write_string( - _SCHEMA_FAILURE_SUB_CATEGORY_CLUSTER.members["name"], self.name - ) - serializer.write_string( - _SCHEMA_FAILURE_SUB_CATEGORY_CLUSTER.members["description"], - self.description, - ) - serializer.write_integer( - _SCHEMA_FAILURE_SUB_CATEGORY_CLUSTER.members["affectedSessionCount"], - self.affected_session_count, - ) - _serialize_root_cause_cluster_list( - serializer, - _SCHEMA_FAILURE_SUB_CATEGORY_CLUSTER.members["rootCauses"], - self.root_causes, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["cluster_id"] = de.read_integer( - _SCHEMA_FAILURE_SUB_CATEGORY_CLUSTER.members["clusterId"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_FAILURE_SUB_CATEGORY_CLUSTER.members["name"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_FAILURE_SUB_CATEGORY_CLUSTER.members["description"] - ) - - case 3: - kwargs["affected_session_count"] = de.read_integer( - _SCHEMA_FAILURE_SUB_CATEGORY_CLUSTER.members[ - "affectedSessionCount" - ] - ) - - case 4: - kwargs["root_causes"] = _deserialize_root_cause_cluster_list( - de, _SCHEMA_FAILURE_SUB_CATEGORY_CLUSTER.members["rootCauses"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_FAILURE_SUB_CATEGORY_CLUSTER, consumer=_consumer - ) - if "cluster_id" not in kwargs: - kwargs["cluster_id"] = 0 - if "name" not in kwargs: - kwargs["name"] = "" - if "description" not in kwargs: - kwargs["description"] = "" - if "affected_session_count" not in kwargs: - kwargs["affected_session_count"] = 0 - if "root_causes" not in kwargs: - kwargs["root_causes"] = [] - return kwargs - - -def _serialize_failure_sub_category_cluster_list( - serializer: ShapeSerializer, schema: Schema, value: list[FailureSubCategoryCluster] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_failure_sub_category_cluster_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[FailureSubCategoryCluster]: - result: list[FailureSubCategoryCluster] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(FailureSubCategoryCluster.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class FailureCategoryCluster: - """ - A top-level failure category identified by clustering similar failure - patterns across sessions. - """ - - cluster_id: int - """The unique identifier of the failure category cluster.""" - - name: str - """The name of the failure category.""" - - description: str - """A description of the failure category pattern.""" - - affected_session_count: int - """The number of sessions affected by this failure category.""" - - sub_categories: list[FailureSubCategoryCluster] - """The list of failure subcategories within this category.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FAILURE_CATEGORY_CLUSTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer( - _SCHEMA_FAILURE_CATEGORY_CLUSTER.members["clusterId"], self.cluster_id - ) - serializer.write_string( - _SCHEMA_FAILURE_CATEGORY_CLUSTER.members["name"], self.name - ) - serializer.write_string( - _SCHEMA_FAILURE_CATEGORY_CLUSTER.members["description"], self.description - ) - serializer.write_integer( - _SCHEMA_FAILURE_CATEGORY_CLUSTER.members["affectedSessionCount"], - self.affected_session_count, - ) - _serialize_failure_sub_category_cluster_list( - serializer, - _SCHEMA_FAILURE_CATEGORY_CLUSTER.members["subCategories"], - self.sub_categories, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["cluster_id"] = de.read_integer( - _SCHEMA_FAILURE_CATEGORY_CLUSTER.members["clusterId"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_FAILURE_CATEGORY_CLUSTER.members["name"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_FAILURE_CATEGORY_CLUSTER.members["description"] - ) - - case 3: - kwargs["affected_session_count"] = de.read_integer( - _SCHEMA_FAILURE_CATEGORY_CLUSTER.members["affectedSessionCount"] - ) - - case 4: - kwargs["sub_categories"] = ( - _deserialize_failure_sub_category_cluster_list( - de, - _SCHEMA_FAILURE_CATEGORY_CLUSTER.members["subCategories"], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FAILURE_CATEGORY_CLUSTER, consumer=_consumer) - if "cluster_id" not in kwargs: - kwargs["cluster_id"] = 0 - if "name" not in kwargs: - kwargs["name"] = "" - if "description" not in kwargs: - kwargs["description"] = "" - if "affected_session_count" not in kwargs: - kwargs["affected_session_count"] = 0 - if "sub_categories" not in kwargs: - kwargs["sub_categories"] = [] - return kwargs - - -def _serialize_failure_category_cluster_list( - serializer: ShapeSerializer, schema: Schema, value: list[FailureCategoryCluster] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_failure_category_cluster_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[FailureCategoryCluster]: - result: list[FailureCategoryCluster] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(FailureCategoryCluster.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class FailureAnalysisResultContent: - """ - The failure analysis clustering result containing categorized failure - clusters with root causes and remediation recommendations. - """ - - failures: list[FailureCategoryCluster] - """ - The list of failure category clusters identified across analyzed - sessions. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FAILURE_ANALYSIS_RESULT_CONTENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_failure_category_cluster_list( - serializer, - _SCHEMA_FAILURE_ANALYSIS_RESULT_CONTENT.members["failures"], - self.failures, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["failures"] = _deserialize_failure_category_cluster_list( - de, _SCHEMA_FAILURE_ANALYSIS_RESULT_CONTENT.members["failures"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_FAILURE_ANALYSIS_RESULT_CONTENT, consumer=_consumer - ) - if "failures" not in kwargs: - kwargs["failures"] = [] - return kwargs - - -@dataclass(kw_only=True) -class Insight: - """ - A reference to an insight analysis to run against sessions during batch - evaluation. Insights provide deeper analysis beyond individual evaluator - scores, including failure detection, user intent clustering, and - execution summarization. - """ - - insight_id: str - """The unique identifier of the insight to run.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INSIGHT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_INSIGHT.members["insightId"], self.insight_id) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["insight_id"] = de.read_string( - _SCHEMA_INSIGHT.members["insightId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INSIGHT, consumer=_consumer) - if "insight_id" not in kwargs: - kwargs["insight_id"] = "" - return kwargs - - -def _serialize_insight_list( - serializer: ShapeSerializer, schema: Schema, value: list[Insight] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_insight_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Insight]: - result: list[Insight] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Insight.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class ResultDestination(UnknownEnumMixin, StrEnum): - """ - Where evaluation results are written: dedicated results log group - (default) or the source log group. - """ - - DEDICATED_LOG_GROUP = "DEDICATED_LOG_GROUP" - SOURCE_LOG_GROUP = "SOURCE_LOG_GROUP" - - -@dataclass(kw_only=True) -class CloudWatchOutputConfig: - """CloudWatch Logs destination for batch evaluation results.""" - - log_group_name: str = "" - """ - The name of the CloudWatch log group where evaluation results will be - written. This value doesn't apply when `resultDestination` is - `SOURCE_LOG_GROUP`, because results are written back to the trace source - log group. The name can't be under the service-reserved - `/aws/bedrock-agentcore/evaluations/` namespace, apart from the - service-managed default group. - """ - - log_stream_name: str = "" - """ - The name of the CloudWatch log stream where evaluation results will be - written. - """ - - metrics_namespace: str | None = None - """ - The CloudWatch metrics namespace where evaluation result metrics are - published. If you omit this value, the service publishes metrics to - `Bedrock-AgentCore/Evaluations`. This value can't begin with `AWS/`. - """ - - result_destination: str = ResultDestination("DEDICATED_LOG_GROUP") - """ - The destination where evaluation results are written. Valid values: - - - `DEDICATED_LOG_GROUP` (default) -- Writes results to a dedicated - result log group. - - - `SOURCE_LOG_GROUP` -- Writes results back to the log group that the - agent traces were read from. If you use this value, don't specify - `logGroupName`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CLOUD_WATCH_OUTPUT_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CLOUD_WATCH_OUTPUT_CONFIG.members["logGroupName"], - self.log_group_name, - ) - serializer.write_string( - _SCHEMA_CLOUD_WATCH_OUTPUT_CONFIG.members["logStreamName"], - self.log_stream_name, - ) - if self.metrics_namespace is not None: - serializer.write_string( - _SCHEMA_CLOUD_WATCH_OUTPUT_CONFIG.members["metricsNamespace"], - self.metrics_namespace, - ) - - serializer.write_string( - _SCHEMA_CLOUD_WATCH_OUTPUT_CONFIG.members["resultDestination"], - self.result_destination, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["log_group_name"] = de.read_string( - _SCHEMA_CLOUD_WATCH_OUTPUT_CONFIG.members["logGroupName"] - ) - - case 1: - kwargs["log_stream_name"] = de.read_string( - _SCHEMA_CLOUD_WATCH_OUTPUT_CONFIG.members["logStreamName"] - ) - - case 2: - kwargs["metrics_namespace"] = de.read_string( - _SCHEMA_CLOUD_WATCH_OUTPUT_CONFIG.members["metricsNamespace"] - ) - - case 3: - kwargs["result_destination"] = ResultDestination( - de.read_string( - _SCHEMA_CLOUD_WATCH_OUTPUT_CONFIG.members[ - "resultDestination" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CLOUD_WATCH_OUTPUT_CONFIG, consumer=_consumer) - return kwargs - - -@dataclass -class OutputConfigCloudWatchConfig: - """The CloudWatch Logs configuration for writing evaluation results.""" - - value: CloudWatchOutputConfig - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OUTPUT_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_OUTPUT_CONFIG.members["cloudWatchConfig"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=CloudWatchOutputConfig.deserialize(deserializer)) - - -@dataclass -class OutputConfigUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -OutputConfig = Union[OutputConfigCloudWatchConfig | OutputConfigUnknown] -"""Output destination configuration.""" - - -class _OutputConfigDeserializer: - _result: OutputConfig | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> OutputConfig: - self._result = None - deserializer.read_struct(_SCHEMA_OUTPUT_CONFIG, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(OutputConfigCloudWatchConfig.deserialize(de)) - - case _: - self._set_result(OutputConfigUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: OutputConfig) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_user_intent_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_user_intent_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class UserIntentAffectedSession: - """A session associated with a user intent cluster.""" - - session_id: str - """The unique identifier of the session.""" - - user_messages: list[str] - """ - The user messages from this session that contributed to the intent - cluster. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_USER_INTENT_AFFECTED_SESSION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_USER_INTENT_AFFECTED_SESSION.members["sessionId"], self.session_id - ) - _serialize_user_intent_list( - serializer, - _SCHEMA_USER_INTENT_AFFECTED_SESSION.members["userMessages"], - self.user_messages, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["session_id"] = de.read_string( - _SCHEMA_USER_INTENT_AFFECTED_SESSION.members["sessionId"] - ) - - case 1: - kwargs["user_messages"] = _deserialize_user_intent_list( - de, _SCHEMA_USER_INTENT_AFFECTED_SESSION.members["userMessages"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_USER_INTENT_AFFECTED_SESSION, consumer=_consumer - ) - if "session_id" not in kwargs: - kwargs["session_id"] = "" - if "user_messages" not in kwargs: - kwargs["user_messages"] = [] - return kwargs - - -def _serialize_user_intent_affected_session_list( - serializer: ShapeSerializer, schema: Schema, value: list[UserIntentAffectedSession] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_user_intent_affected_session_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[UserIntentAffectedSession]: - result: list[UserIntentAffectedSession] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(UserIntentAffectedSession.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class UserIntentCluster: - """A cluster of similar user intents identified across sessions.""" - - cluster_id: int - """The unique identifier of the user intent cluster.""" - - name: str - """The name of the user intent cluster.""" - - description: str - """A description of the user intent pattern.""" - - affected_session_count: int - """The number of sessions with this user intent.""" - - affected_sessions: list[UserIntentAffectedSession] - """The list of sessions with this user intent.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_USER_INTENT_CLUSTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer( - _SCHEMA_USER_INTENT_CLUSTER.members["clusterId"], self.cluster_id - ) - serializer.write_string(_SCHEMA_USER_INTENT_CLUSTER.members["name"], self.name) - serializer.write_string( - _SCHEMA_USER_INTENT_CLUSTER.members["description"], self.description - ) - serializer.write_integer( - _SCHEMA_USER_INTENT_CLUSTER.members["affectedSessionCount"], - self.affected_session_count, - ) - _serialize_user_intent_affected_session_list( - serializer, - _SCHEMA_USER_INTENT_CLUSTER.members["affectedSessions"], - self.affected_sessions, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["cluster_id"] = de.read_integer( - _SCHEMA_USER_INTENT_CLUSTER.members["clusterId"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_USER_INTENT_CLUSTER.members["name"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_USER_INTENT_CLUSTER.members["description"] - ) - - case 3: - kwargs["affected_session_count"] = de.read_integer( - _SCHEMA_USER_INTENT_CLUSTER.members["affectedSessionCount"] - ) - - case 4: - kwargs["affected_sessions"] = ( - _deserialize_user_intent_affected_session_list( - de, _SCHEMA_USER_INTENT_CLUSTER.members["affectedSessions"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_USER_INTENT_CLUSTER, consumer=_consumer) - if "cluster_id" not in kwargs: - kwargs["cluster_id"] = 0 - if "name" not in kwargs: - kwargs["name"] = "" - if "description" not in kwargs: - kwargs["description"] = "" - if "affected_session_count" not in kwargs: - kwargs["affected_session_count"] = 0 - if "affected_sessions" not in kwargs: - kwargs["affected_sessions"] = [] - return kwargs - - -def _serialize_user_intent_cluster_list( - serializer: ShapeSerializer, schema: Schema, value: list[UserIntentCluster] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_user_intent_cluster_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[UserIntentCluster]: - result: list[UserIntentCluster] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(UserIntentCluster.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class UserIntentClusteringResultContent: - """ - The user intent clustering result containing grouped user intents - identified across evaluated sessions. - """ - - user_intents: list[UserIntentCluster] - """The list of user intent clusters identified across analyzed sessions.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_USER_INTENT_CLUSTERING_RESULT_CONTENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_user_intent_cluster_list( - serializer, - _SCHEMA_USER_INTENT_CLUSTERING_RESULT_CONTENT.members["userIntents"], - self.user_intents, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["user_intents"] = _deserialize_user_intent_cluster_list( - de, - _SCHEMA_USER_INTENT_CLUSTERING_RESULT_CONTENT.members[ - "userIntents" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_USER_INTENT_CLUSTERING_RESULT_CONTENT, consumer=_consumer - ) - if "user_intents" not in kwargs: - kwargs["user_intents"] = [] - return kwargs - - -@dataclass(kw_only=True) -class GetBatchEvaluationOutput: - """Dataclass for GetBatchEvaluationOutput structure.""" - - batch_evaluation_id: str - """The unique identifier of the batch evaluation.""" - - batch_evaluation_arn: str - """The Amazon Resource Name (ARN) of the batch evaluation.""" - - batch_evaluation_name: str - """The name of the batch evaluation.""" - - status: str - """The current status of the batch evaluation.""" - - created_at: datetime - """The timestamp when the batch evaluation was created.""" - - evaluators: list[Evaluator] | None = None - """The list of evaluators applied during the batch evaluation.""" - - insights: list[Insight] | None = None - """The list of insight analyses applied during the batch evaluation.""" - - data_source_config: DataSourceConfig | None = None - """ - The data source configuration specifying where agent traces are pulled - from. - """ - - output_config: OutputConfig | None = None - """ - The output configuration specifying where evaluation results are - written. - """ - - evaluation_results: EvaluationJobResults | None = None - """ - The aggregated evaluation results, including session completion counts - and evaluator score summaries. - """ - - failure_analysis_result: FailureAnalysisResultContent | None = None - """ - The failure analysis results from insights, containing categorized - failure clusters with root causes and recommendations. - """ - - user_intent_result: UserIntentClusteringResultContent | None = None - """ - The user intent clustering results from insights, containing grouped - user intents across evaluated sessions. - """ - - execution_summary_result: ExecutionSummaryClusteringResultContent | None = None - """ - The execution summary clustering results from insights, containing - grouped execution patterns across evaluated sessions. - """ - - error_details: list[str] | None = None - """The error details if the batch evaluation encountered failures.""" - - description: str | None = None - """The description of the batch evaluation.""" - - updated_at: datetime | None = None - """The timestamp when the batch evaluation was last updated.""" - - kms_key_arn: str | None = None - """The ARN of the KMS key used to encrypt evaluation data.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_BATCH_EVALUATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_BATCH_EVALUATION_OUTPUT.members["batchEvaluationId"], - self.batch_evaluation_id, - ) - serializer.write_string( - _SCHEMA_GET_BATCH_EVALUATION_OUTPUT.members["batchEvaluationArn"], - self.batch_evaluation_arn, - ) - serializer.write_string( - _SCHEMA_GET_BATCH_EVALUATION_OUTPUT.members["batchEvaluationName"], - self.batch_evaluation_name, - ) - serializer.write_string( - _SCHEMA_GET_BATCH_EVALUATION_OUTPUT.members["status"], self.status - ) - serializer.write_timestamp( - _SCHEMA_GET_BATCH_EVALUATION_OUTPUT.members["createdAt"], self.created_at - ) - if self.evaluators is not None: - _serialize_evaluator_list( - serializer, - _SCHEMA_GET_BATCH_EVALUATION_OUTPUT.members["evaluators"], - self.evaluators, - ) - - if self.insights is not None: - _serialize_insight_list( - serializer, - _SCHEMA_GET_BATCH_EVALUATION_OUTPUT.members["insights"], - self.insights, - ) - - if self.data_source_config is not None: - serializer.write_struct( - _SCHEMA_GET_BATCH_EVALUATION_OUTPUT.members["dataSourceConfig"], - self.data_source_config, - ) - - if self.output_config is not None: - serializer.write_struct( - _SCHEMA_GET_BATCH_EVALUATION_OUTPUT.members["outputConfig"], - self.output_config, - ) - - if self.evaluation_results is not None: - serializer.write_struct( - _SCHEMA_GET_BATCH_EVALUATION_OUTPUT.members["evaluationResults"], - self.evaluation_results, - ) - - if self.failure_analysis_result is not None: - serializer.write_struct( - _SCHEMA_GET_BATCH_EVALUATION_OUTPUT.members["failureAnalysisResult"], - self.failure_analysis_result, - ) - - if self.user_intent_result is not None: - serializer.write_struct( - _SCHEMA_GET_BATCH_EVALUATION_OUTPUT.members["userIntentResult"], - self.user_intent_result, - ) - - if self.execution_summary_result is not None: - serializer.write_struct( - _SCHEMA_GET_BATCH_EVALUATION_OUTPUT.members["executionSummaryResult"], - self.execution_summary_result, - ) - - if self.error_details is not None: - _serialize_error_details_list( - serializer, - _SCHEMA_GET_BATCH_EVALUATION_OUTPUT.members["errorDetails"], - self.error_details, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_BATCH_EVALUATION_OUTPUT.members["description"], - self.description, - ) - - if self.updated_at is not None: - serializer.write_timestamp( - _SCHEMA_GET_BATCH_EVALUATION_OUTPUT.members["updatedAt"], - self.updated_at, - ) - - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_GET_BATCH_EVALUATION_OUTPUT.members["kmsKeyArn"], - self.kms_key_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["batch_evaluation_id"] = de.read_string( - _SCHEMA_GET_BATCH_EVALUATION_OUTPUT.members["batchEvaluationId"] - ) - - case 1: - kwargs["batch_evaluation_arn"] = de.read_string( - _SCHEMA_GET_BATCH_EVALUATION_OUTPUT.members[ - "batchEvaluationArn" - ] - ) - - case 2: - kwargs["batch_evaluation_name"] = de.read_string( - _SCHEMA_GET_BATCH_EVALUATION_OUTPUT.members[ - "batchEvaluationName" - ] - ) - - case 3: - kwargs["status"] = BatchEvaluationStatus( - de.read_string( - _SCHEMA_GET_BATCH_EVALUATION_OUTPUT.members["status"] - ) - ) - - case 4: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_BATCH_EVALUATION_OUTPUT.members["createdAt"] - ) - - case 5: - kwargs["evaluators"] = _deserialize_evaluator_list( - de, _SCHEMA_GET_BATCH_EVALUATION_OUTPUT.members["evaluators"] - ) - - case 6: - kwargs["insights"] = _deserialize_insight_list( - de, _SCHEMA_GET_BATCH_EVALUATION_OUTPUT.members["insights"] - ) - - case 7: - kwargs["data_source_config"] = ( - _DataSourceConfigDeserializer().deserialize(de) - ) - - case 8: - kwargs["output_config"] = _OutputConfigDeserializer().deserialize( - de - ) - - case 9: - kwargs["evaluation_results"] = EvaluationJobResults.deserialize(de) - - case 10: - kwargs["failure_analysis_result"] = ( - FailureAnalysisResultContent.deserialize(de) - ) - - case 11: - kwargs["user_intent_result"] = ( - UserIntentClusteringResultContent.deserialize(de) - ) - - case 12: - kwargs["execution_summary_result"] = ( - ExecutionSummaryClusteringResultContent.deserialize(de) - ) - - case 13: - kwargs["error_details"] = _deserialize_error_details_list( - de, _SCHEMA_GET_BATCH_EVALUATION_OUTPUT.members["errorDetails"] - ) - - case 14: - kwargs["description"] = de.read_string( - _SCHEMA_GET_BATCH_EVALUATION_OUTPUT.members["description"] - ) - - case 15: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_GET_BATCH_EVALUATION_OUTPUT.members["updatedAt"] - ) - - case 16: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_GET_BATCH_EVALUATION_OUTPUT.members["kmsKeyArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_BATCH_EVALUATION_OUTPUT, consumer=_consumer - ) - if "batch_evaluation_id" not in kwargs: - kwargs["batch_evaluation_id"] = "" - if "batch_evaluation_arn" not in kwargs: - kwargs["batch_evaluation_arn"] = "" - if "batch_evaluation_name" not in kwargs: - kwargs["batch_evaluation_name"] = "" - if "status" not in kwargs: - kwargs["status"] = BatchEvaluationStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -GET_BATCH_EVALUATION = APIOperation( - input=GetBatchEvaluationInput, - output=GetBatchEvaluationOutput, - schema=_SCHEMA_GET_BATCH_EVALUATION, - input_schema=_SCHEMA_GET_BATCH_EVALUATION_INPUT, - output_schema=_SCHEMA_GET_BATCH_EVALUATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#UnauthorizedException" - ): UnauthorizedException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetRecommendationInput: - """Dataclass for GetRecommendationInput structure.""" - - recommendation_id: str | None = None - """The unique identifier of the recommendation to retrieve.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_RECOMMENDATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.recommendation_id is not None: - serializer.write_string( - _SCHEMA_GET_RECOMMENDATION_INPUT.members["recommendationId"], - self.recommendation_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["recommendation_id"] = de.read_string( - _SCHEMA_GET_RECOMMENDATION_INPUT.members["recommendationId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_RECOMMENDATION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class RecommendationEvaluatorReference: - """A reference to an evaluator used for recommendation assessment.""" - - evaluator_arn: str - """The Amazon Resource Name (ARN) of the evaluator.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RECOMMENDATION_EVALUATOR_REFERENCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_RECOMMENDATION_EVALUATOR_REFERENCE.members["evaluatorArn"], - self.evaluator_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["evaluator_arn"] = de.read_string( - _SCHEMA_RECOMMENDATION_EVALUATOR_REFERENCE.members[ - "evaluatorArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RECOMMENDATION_EVALUATOR_REFERENCE, consumer=_consumer - ) - if "evaluator_arn" not in kwargs: - kwargs["evaluator_arn"] = "" - return kwargs - - -def _serialize_recommendation_evaluator_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[RecommendationEvaluatorReference], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_recommendation_evaluator_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[RecommendationEvaluatorReference]: - result: list[RecommendationEvaluatorReference] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(RecommendationEvaluatorReference.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class RecommendationEvaluationConfig: - """The evaluation configuration for assessing recommendation quality.""" - - evaluators: list[RecommendationEvaluatorReference] - """The list of evaluators to use for assessing recommendation quality.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RECOMMENDATION_EVALUATION_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_recommendation_evaluator_list( - serializer, - _SCHEMA_RECOMMENDATION_EVALUATION_CONFIG.members["evaluators"], - self.evaluators, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["evaluators"] = _deserialize_recommendation_evaluator_list( - de, - _SCHEMA_RECOMMENDATION_EVALUATION_CONFIG.members["evaluators"], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RECOMMENDATION_EVALUATION_CONFIG, consumer=_consumer - ) - if "evaluators" not in kwargs: - kwargs["evaluators"] = [] - return kwargs - - -@dataclass(kw_only=True) -class SystemPromptConfigurationBundle: - """A system prompt sourced from a configuration bundle version.""" - - bundle_arn: str - """The Amazon Resource Name (ARN) of the configuration bundle.""" - - version_id: str - """The version identifier of the configuration bundle.""" - - system_prompt_json_path: str - """ - The JSON path within the configuration bundle that contains the system - prompt. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SYSTEM_PROMPT_CONFIGURATION_BUNDLE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SYSTEM_PROMPT_CONFIGURATION_BUNDLE.members["bundleArn"], - self.bundle_arn, - ) - serializer.write_string( - _SCHEMA_SYSTEM_PROMPT_CONFIGURATION_BUNDLE.members["versionId"], - self.version_id, - ) - serializer.write_string( - _SCHEMA_SYSTEM_PROMPT_CONFIGURATION_BUNDLE.members["systemPromptJsonPath"], - self.system_prompt_json_path, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bundle_arn"] = de.read_string( - _SCHEMA_SYSTEM_PROMPT_CONFIGURATION_BUNDLE.members["bundleArn"] - ) - - case 1: - kwargs["version_id"] = de.read_string( - _SCHEMA_SYSTEM_PROMPT_CONFIGURATION_BUNDLE.members["versionId"] - ) - - case 2: - kwargs["system_prompt_json_path"] = de.read_string( - _SCHEMA_SYSTEM_PROMPT_CONFIGURATION_BUNDLE.members[ - "systemPromptJsonPath" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SYSTEM_PROMPT_CONFIGURATION_BUNDLE, consumer=_consumer - ) - if "bundle_arn" not in kwargs: - kwargs["bundle_arn"] = "" - if "version_id" not in kwargs: - kwargs["version_id"] = "" - if "system_prompt_json_path" not in kwargs: - kwargs["system_prompt_json_path"] = "" - return kwargs - - -@dataclass -class SystemPromptConfigText: - """The system prompt text provided inline.""" - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SYSTEM_PROMPT_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SYSTEM_PROMPT_CONFIG.members["text"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string(_SCHEMA_SYSTEM_PROMPT_CONFIG.members["text"]) - ) - - -@dataclass -class SystemPromptConfigConfigurationBundle: - """The system prompt sourced from a configuration bundle version.""" - - value: SystemPromptConfigurationBundle - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SYSTEM_PROMPT_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_SYSTEM_PROMPT_CONFIG.members["configurationBundle"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=SystemPromptConfigurationBundle.deserialize(deserializer)) - - -@dataclass -class SystemPromptConfigUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -SystemPromptConfig = Union[ - SystemPromptConfigText - | SystemPromptConfigConfigurationBundle - | SystemPromptConfigUnknown -] -""" -The system prompt input, either as inline text or from a configuration -bundle. -""" - - -class _SystemPromptConfigDeserializer: - _result: SystemPromptConfig | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> SystemPromptConfig: - self._result = None - deserializer.read_struct(_SCHEMA_SYSTEM_PROMPT_CONFIG, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(SystemPromptConfigText.deserialize(de)) - - case 1: - self._set_result(SystemPromptConfigConfigurationBundle.deserialize(de)) - - case _: - self._set_result( - SystemPromptConfigUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: SystemPromptConfig) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class SystemPromptRecommendationConfig: - """Configuration for generating system prompt optimization recommendations.""" - - system_prompt: SystemPromptConfig - """The current system prompt to optimize.""" - - agent_traces: AgentTracesConfig - """The agent traces to analyze for generating recommendations.""" - - evaluation_config: RecommendationEvaluationConfig | None = None - """ - The evaluation configuration specifying which evaluator to use for - assessing recommendation quality. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SYSTEM_PROMPT_RECOMMENDATION_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_SYSTEM_PROMPT_RECOMMENDATION_CONFIG.members["systemPrompt"], - self.system_prompt, - ) - serializer.write_struct( - _SCHEMA_SYSTEM_PROMPT_RECOMMENDATION_CONFIG.members["agentTraces"], - self.agent_traces, - ) - if self.evaluation_config is not None: - serializer.write_struct( - _SCHEMA_SYSTEM_PROMPT_RECOMMENDATION_CONFIG.members["evaluationConfig"], - self.evaluation_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["system_prompt"] = ( - _SystemPromptConfigDeserializer().deserialize(de) - ) - - case 1: - kwargs["agent_traces"] = ( - _AgentTracesConfigDeserializer().deserialize(de) - ) - - case 2: - kwargs["evaluation_config"] = ( - RecommendationEvaluationConfig.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SYSTEM_PROMPT_RECOMMENDATION_CONFIG, consumer=_consumer - ) - if "system_prompt" not in kwargs: - kwargs["system_prompt"] = SystemPromptConfigUnknown(tag="") - if "agent_traces" not in kwargs: - kwargs["agent_traces"] = AgentTracesConfigUnknown(tag="") - return kwargs - - -@dataclass(kw_only=True) -class ConfigurationBundleToolEntry: - """Maps a tool name to its JSON path within a configuration bundle.""" - - tool_name: str - """The name of the tool.""" - - tool_description_json_path: str - """ - The JSON path within the configuration bundle's components that - contains the tool description. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONFIGURATION_BUNDLE_TOOL_ENTRY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CONFIGURATION_BUNDLE_TOOL_ENTRY.members["toolName"], self.tool_name - ) - serializer.write_string( - _SCHEMA_CONFIGURATION_BUNDLE_TOOL_ENTRY.members["toolDescriptionJsonPath"], - self.tool_description_json_path, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["tool_name"] = de.read_string( - _SCHEMA_CONFIGURATION_BUNDLE_TOOL_ENTRY.members["toolName"] - ) - - case 1: - kwargs["tool_description_json_path"] = de.read_string( - _SCHEMA_CONFIGURATION_BUNDLE_TOOL_ENTRY.members[ - "toolDescriptionJsonPath" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CONFIGURATION_BUNDLE_TOOL_ENTRY, consumer=_consumer - ) - if "tool_name" not in kwargs: - kwargs["tool_name"] = "" - if "tool_description_json_path" not in kwargs: - kwargs["tool_description_json_path"] = "" - return kwargs - - -def _serialize_configuration_bundle_tool_entry_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[ConfigurationBundleToolEntry], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_configuration_bundle_tool_entry_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ConfigurationBundleToolEntry]: - result: list[ConfigurationBundleToolEntry] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ConfigurationBundleToolEntry.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ToolDescriptionConfigurationBundle: - """Tool descriptions sourced from a configuration bundle version.""" - - bundle_arn: str - """The Amazon Resource Name (ARN) of the configuration bundle.""" - - version_id: str - """The version identifier of the configuration bundle.""" - - tools: list[ConfigurationBundleToolEntry] - """ - The list of tool entries mapping tool names to their JSON paths within - the bundle. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_DESCRIPTION_CONFIGURATION_BUNDLE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_TOOL_DESCRIPTION_CONFIGURATION_BUNDLE.members["bundleArn"], - self.bundle_arn, - ) - serializer.write_string( - _SCHEMA_TOOL_DESCRIPTION_CONFIGURATION_BUNDLE.members["versionId"], - self.version_id, - ) - _serialize_configuration_bundle_tool_entry_list( - serializer, - _SCHEMA_TOOL_DESCRIPTION_CONFIGURATION_BUNDLE.members["tools"], - self.tools, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bundle_arn"] = de.read_string( - _SCHEMA_TOOL_DESCRIPTION_CONFIGURATION_BUNDLE.members[ - "bundleArn" - ] - ) - - case 1: - kwargs["version_id"] = de.read_string( - _SCHEMA_TOOL_DESCRIPTION_CONFIGURATION_BUNDLE.members[ - "versionId" - ] - ) - - case 2: - kwargs["tools"] = _deserialize_configuration_bundle_tool_entry_list( - de, - _SCHEMA_TOOL_DESCRIPTION_CONFIGURATION_BUNDLE.members["tools"], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_TOOL_DESCRIPTION_CONFIGURATION_BUNDLE, consumer=_consumer - ) - if "bundle_arn" not in kwargs: - kwargs["bundle_arn"] = "" - if "version_id" not in kwargs: - kwargs["version_id"] = "" - if "tools" not in kwargs: - kwargs["tools"] = [] - return kwargs - - -@dataclass -class ToolDescriptionConfigText: - """The tool description as inline text.""" - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_DESCRIPTION_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_TOOL_DESCRIPTION_CONFIG.members["text"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string( - _SCHEMA_TOOL_DESCRIPTION_CONFIG.members["text"] - ) - ) - - -@dataclass -class ToolDescriptionConfigUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ToolDescriptionConfig = Union[ToolDescriptionConfigText | ToolDescriptionConfigUnknown] -"""The tool description content.""" - - -class _ToolDescriptionConfigDeserializer: - _result: ToolDescriptionConfig | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> ToolDescriptionConfig: - self._result = None - deserializer.read_struct(_SCHEMA_TOOL_DESCRIPTION_CONFIG, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(ToolDescriptionConfigText.deserialize(de)) - - case _: - self._set_result( - ToolDescriptionConfigUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: ToolDescriptionConfig) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class ToolDescriptionInput: - """ - A tool description input containing the tool name and its current - description. - """ - - tool_name: str - """The name of the tool.""" - - tool_description: ToolDescriptionConfig - """The current description of the tool to optimize.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_DESCRIPTION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_TOOL_DESCRIPTION_INPUT.members["toolName"], self.tool_name - ) - serializer.write_struct( - _SCHEMA_TOOL_DESCRIPTION_INPUT.members["toolDescription"], - self.tool_description, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["tool_name"] = de.read_string( - _SCHEMA_TOOL_DESCRIPTION_INPUT.members["toolName"] - ) - - case 1: - kwargs["tool_description"] = ( - _ToolDescriptionConfigDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TOOL_DESCRIPTION_INPUT, consumer=_consumer) - if "tool_name" not in kwargs: - kwargs["tool_name"] = "" - if "tool_description" not in kwargs: - kwargs["tool_description"] = ToolDescriptionConfigUnknown(tag="") - return kwargs - - -def _serialize_tool_description_list( - serializer: ShapeSerializer, schema: Schema, value: list[ToolDescriptionInput] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_tool_description_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ToolDescriptionInput]: - result: list[ToolDescriptionInput] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ToolDescriptionInput.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ToolDescriptionTextInput: - """Inline tool description input containing a list of tools.""" - - tools: list[ToolDescriptionInput] - """The list of tool descriptions to optimize.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_DESCRIPTION_TEXT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_tool_description_list( - serializer, _SCHEMA_TOOL_DESCRIPTION_TEXT_INPUT.members["tools"], self.tools - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["tools"] = _deserialize_tool_description_list( - de, _SCHEMA_TOOL_DESCRIPTION_TEXT_INPUT.members["tools"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_TOOL_DESCRIPTION_TEXT_INPUT, consumer=_consumer - ) - if "tools" not in kwargs: - kwargs["tools"] = [] - return kwargs - - -@dataclass -class ToolDescriptionSourceToolDescriptionText: - """Tool descriptions provided as inline text.""" - - value: ToolDescriptionTextInput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_DESCRIPTION_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_TOOL_DESCRIPTION_SOURCE.members["toolDescriptionText"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ToolDescriptionTextInput.deserialize(deserializer)) - - -@dataclass -class ToolDescriptionSourceConfigurationBundle: - """Tool descriptions sourced from a configuration bundle version.""" - - value: ToolDescriptionConfigurationBundle - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_DESCRIPTION_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_TOOL_DESCRIPTION_SOURCE.members["configurationBundle"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ToolDescriptionConfigurationBundle.deserialize(deserializer)) - - -@dataclass -class ToolDescriptionSourceUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ToolDescriptionSource = Union[ - ToolDescriptionSourceToolDescriptionText - | ToolDescriptionSourceConfigurationBundle - | ToolDescriptionSourceUnknown -] -""" -The source of tool descriptions, either inline text or from a -configuration bundle. -""" - - -class _ToolDescriptionSourceDeserializer: - _result: ToolDescriptionSource | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> ToolDescriptionSource: - self._result = None - deserializer.read_struct(_SCHEMA_TOOL_DESCRIPTION_SOURCE, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - ToolDescriptionSourceToolDescriptionText.deserialize(de) - ) - - case 1: - self._set_result( - ToolDescriptionSourceConfigurationBundle.deserialize(de) - ) - - case _: - self._set_result( - ToolDescriptionSourceUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: ToolDescriptionSource) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class ToolDescriptionRecommendationConfig: - """ - Configuration for generating tool description optimization - recommendations. - """ - - tool_description: ToolDescriptionSource - """The current tool descriptions to optimize.""" - - agent_traces: AgentTracesConfig - """ - The agent traces to analyze for generating tool description - recommendations. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_DESCRIPTION_RECOMMENDATION_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_TOOL_DESCRIPTION_RECOMMENDATION_CONFIG.members["toolDescription"], - self.tool_description, - ) - serializer.write_struct( - _SCHEMA_TOOL_DESCRIPTION_RECOMMENDATION_CONFIG.members["agentTraces"], - self.agent_traces, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["tool_description"] = ( - _ToolDescriptionSourceDeserializer().deserialize(de) - ) - - case 1: - kwargs["agent_traces"] = ( - _AgentTracesConfigDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_TOOL_DESCRIPTION_RECOMMENDATION_CONFIG, consumer=_consumer - ) - if "tool_description" not in kwargs: - kwargs["tool_description"] = ToolDescriptionSourceUnknown(tag="") - if "agent_traces" not in kwargs: - kwargs["agent_traces"] = AgentTracesConfigUnknown(tag="") - return kwargs - - -@dataclass -class RecommendationConfigSystemPromptRecommendationConfig: - """The configuration for a system prompt recommendation.""" - - value: SystemPromptRecommendationConfig - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RECOMMENDATION_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RECOMMENDATION_CONFIG.members["systemPromptRecommendationConfig"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=SystemPromptRecommendationConfig.deserialize(deserializer)) - - -@dataclass -class RecommendationConfigToolDescriptionRecommendationConfig: - """The configuration for a tool description recommendation.""" - - value: ToolDescriptionRecommendationConfig - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RECOMMENDATION_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RECOMMENDATION_CONFIG.members[ - "toolDescriptionRecommendationConfig" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ToolDescriptionRecommendationConfig.deserialize(deserializer)) - - -@dataclass -class RecommendationConfigUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -RecommendationConfig = Union[ - RecommendationConfigSystemPromptRecommendationConfig - | RecommendationConfigToolDescriptionRecommendationConfig - | RecommendationConfigUnknown -] -"""The configuration for a recommendation, varying by recommendation type.""" - - -class _RecommendationConfigDeserializer: - _result: RecommendationConfig | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> RecommendationConfig: - self._result = None - deserializer.read_struct(_SCHEMA_RECOMMENDATION_CONFIG, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - RecommendationConfigSystemPromptRecommendationConfig.deserialize(de) - ) - - case 1: - self._set_result( - RecommendationConfigToolDescriptionRecommendationConfig.deserialize( - de - ) - ) - - case _: - self._set_result( - RecommendationConfigUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: RecommendationConfig) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class RecommendationResultConfigurationBundle: - """A configuration bundle reference in a recommendation result.""" - - bundle_arn: str - """The Amazon Resource Name (ARN) of the configuration bundle.""" - - version_id: str - """ - The version identifier of the configuration bundle containing the - recommendation. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RECOMMENDATION_RESULT_CONFIGURATION_BUNDLE, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_RECOMMENDATION_RESULT_CONFIGURATION_BUNDLE.members["bundleArn"], - self.bundle_arn, - ) - serializer.write_string( - _SCHEMA_RECOMMENDATION_RESULT_CONFIGURATION_BUNDLE.members["versionId"], - self.version_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bundle_arn"] = de.read_string( - _SCHEMA_RECOMMENDATION_RESULT_CONFIGURATION_BUNDLE.members[ - "bundleArn" - ] - ) - - case 1: - kwargs["version_id"] = de.read_string( - _SCHEMA_RECOMMENDATION_RESULT_CONFIGURATION_BUNDLE.members[ - "versionId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RECOMMENDATION_RESULT_CONFIGURATION_BUNDLE, consumer=_consumer - ) - if "bundle_arn" not in kwargs: - kwargs["bundle_arn"] = "" - if "version_id" not in kwargs: - kwargs["version_id"] = "" - return kwargs - - -@dataclass(kw_only=True) -class SystemPromptRecommendationResult: - """ - The result of a system prompt recommendation, containing the optimized - prompt. - """ - - recommended_system_prompt: str | None = field(repr=False, default=None) - """The optimized system prompt text generated by the recommendation.""" - - configuration_bundle: RecommendationResultConfigurationBundle | None = None - """ - The configuration bundle containing the recommended system prompt, if - the input was sourced from a configuration bundle. - """ - - explanation: str | None = None - """ - An explanation of why the recommendation was generated and what patterns - were identified in the agent traces. - """ - - error_code: str | None = None - """The error code if the recommendation failed.""" - - error_message: str | None = None - """The error message if the recommendation failed.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SYSTEM_PROMPT_RECOMMENDATION_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.recommended_system_prompt is not None: - serializer.write_string( - _SCHEMA_SYSTEM_PROMPT_RECOMMENDATION_RESULT.members[ - "recommendedSystemPrompt" - ], - self.recommended_system_prompt, - ) - - if self.configuration_bundle is not None: - serializer.write_struct( - _SCHEMA_SYSTEM_PROMPT_RECOMMENDATION_RESULT.members[ - "configurationBundle" - ], - self.configuration_bundle, - ) - - if self.explanation is not None: - serializer.write_string( - _SCHEMA_SYSTEM_PROMPT_RECOMMENDATION_RESULT.members["explanation"], - self.explanation, - ) - - if self.error_code is not None: - serializer.write_string( - _SCHEMA_SYSTEM_PROMPT_RECOMMENDATION_RESULT.members["errorCode"], - self.error_code, - ) - - if self.error_message is not None: - serializer.write_string( - _SCHEMA_SYSTEM_PROMPT_RECOMMENDATION_RESULT.members["errorMessage"], - self.error_message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["recommended_system_prompt"] = de.read_string( - _SCHEMA_SYSTEM_PROMPT_RECOMMENDATION_RESULT.members[ - "recommendedSystemPrompt" - ] - ) - - case 1: - kwargs["configuration_bundle"] = ( - RecommendationResultConfigurationBundle.deserialize(de) - ) - - case 2: - kwargs["explanation"] = de.read_string( - _SCHEMA_SYSTEM_PROMPT_RECOMMENDATION_RESULT.members[ - "explanation" - ] - ) - - case 3: - kwargs["error_code"] = de.read_string( - _SCHEMA_SYSTEM_PROMPT_RECOMMENDATION_RESULT.members["errorCode"] - ) - - case 4: - kwargs["error_message"] = de.read_string( - _SCHEMA_SYSTEM_PROMPT_RECOMMENDATION_RESULT.members[ - "errorMessage" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SYSTEM_PROMPT_RECOMMENDATION_RESULT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ToolDescriptionOutput: - """The output for a single tool description recommendation.""" - - tool_name: str - """The name of the tool.""" - - recommended_tool_description: str | None = field(repr=False, default=None) - """The optimized tool description text generated by the recommendation.""" - - explanation: str | None = None - """ - An explanation of why the recommendation was generated for this tool and - what patterns were identified in the agent traces. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_DESCRIPTION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_TOOL_DESCRIPTION_OUTPUT.members["toolName"], self.tool_name - ) - if self.recommended_tool_description is not None: - serializer.write_string( - _SCHEMA_TOOL_DESCRIPTION_OUTPUT.members["recommendedToolDescription"], - self.recommended_tool_description, - ) - - if self.explanation is not None: - serializer.write_string( - _SCHEMA_TOOL_DESCRIPTION_OUTPUT.members["explanation"], self.explanation - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["tool_name"] = de.read_string( - _SCHEMA_TOOL_DESCRIPTION_OUTPUT.members["toolName"] - ) - - case 1: - kwargs["recommended_tool_description"] = de.read_string( - _SCHEMA_TOOL_DESCRIPTION_OUTPUT.members[ - "recommendedToolDescription" - ] - ) - - case 2: - kwargs["explanation"] = de.read_string( - _SCHEMA_TOOL_DESCRIPTION_OUTPUT.members["explanation"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TOOL_DESCRIPTION_OUTPUT, consumer=_consumer) - if "tool_name" not in kwargs: - kwargs["tool_name"] = "" - return kwargs - - -def _serialize_tool_description_result_list( - serializer: ShapeSerializer, schema: Schema, value: list[ToolDescriptionOutput] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_tool_description_result_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ToolDescriptionOutput]: - result: list[ToolDescriptionOutput] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ToolDescriptionOutput.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ToolDescriptionRecommendationResult: - """ - The result of a tool description recommendation, containing optimized - descriptions. - """ - - tools: list[ToolDescriptionOutput] | None = None - """The list of tools with their recommended descriptions.""" - - configuration_bundle: RecommendationResultConfigurationBundle | None = None - """ - The configuration bundle containing the recommended tool descriptions, - if the input was sourced from a configuration bundle. - """ - - error_code: str | None = None - """The error code if the recommendation failed.""" - - error_message: str | None = None - """The error message if the recommendation failed.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_DESCRIPTION_RECOMMENDATION_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.tools is not None: - _serialize_tool_description_result_list( - serializer, - _SCHEMA_TOOL_DESCRIPTION_RECOMMENDATION_RESULT.members["tools"], - self.tools, - ) - - if self.configuration_bundle is not None: - serializer.write_struct( - _SCHEMA_TOOL_DESCRIPTION_RECOMMENDATION_RESULT.members[ - "configurationBundle" - ], - self.configuration_bundle, - ) - - if self.error_code is not None: - serializer.write_string( - _SCHEMA_TOOL_DESCRIPTION_RECOMMENDATION_RESULT.members["errorCode"], - self.error_code, - ) - - if self.error_message is not None: - serializer.write_string( - _SCHEMA_TOOL_DESCRIPTION_RECOMMENDATION_RESULT.members["errorMessage"], - self.error_message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["tools"] = _deserialize_tool_description_result_list( - de, - _SCHEMA_TOOL_DESCRIPTION_RECOMMENDATION_RESULT.members["tools"], - ) - - case 1: - kwargs["configuration_bundle"] = ( - RecommendationResultConfigurationBundle.deserialize(de) - ) - - case 2: - kwargs["error_code"] = de.read_string( - _SCHEMA_TOOL_DESCRIPTION_RECOMMENDATION_RESULT.members[ - "errorCode" - ] - ) - - case 3: - kwargs["error_message"] = de.read_string( - _SCHEMA_TOOL_DESCRIPTION_RECOMMENDATION_RESULT.members[ - "errorMessage" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_TOOL_DESCRIPTION_RECOMMENDATION_RESULT, consumer=_consumer - ) - return kwargs - - -@dataclass -class RecommendationResultSystemPromptRecommendationResult: - """The result of a system prompt recommendation.""" - - value: SystemPromptRecommendationResult - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RECOMMENDATION_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RECOMMENDATION_RESULT.members["systemPromptRecommendationResult"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=SystemPromptRecommendationResult.deserialize(deserializer)) - - -@dataclass -class RecommendationResultToolDescriptionRecommendationResult: - """The result of a tool description recommendation.""" - - value: ToolDescriptionRecommendationResult - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RECOMMENDATION_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RECOMMENDATION_RESULT.members[ - "toolDescriptionRecommendationResult" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ToolDescriptionRecommendationResult.deserialize(deserializer)) - - -@dataclass -class RecommendationResultUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -RecommendationResult = Union[ - RecommendationResultSystemPromptRecommendationResult - | RecommendationResultToolDescriptionRecommendationResult - | RecommendationResultUnknown -] -"""The result of a recommendation, containing the optimized output.""" - - -class _RecommendationResultDeserializer: - _result: RecommendationResult | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> RecommendationResult: - self._result = None - deserializer.read_struct(_SCHEMA_RECOMMENDATION_RESULT, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - RecommendationResultSystemPromptRecommendationResult.deserialize(de) - ) - - case 1: - self._set_result( - RecommendationResultToolDescriptionRecommendationResult.deserialize( - de - ) - ) - - case _: - self._set_result( - RecommendationResultUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: RecommendationResult) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class RecommendationType(UnknownEnumMixin, StrEnum): - """The type of recommendation to generate.""" - - SYSTEM_PROMPT_RECOMMENDATION = "SYSTEM_PROMPT_RECOMMENDATION" - TOOL_DESCRIPTION_RECOMMENDATION = "TOOL_DESCRIPTION_RECOMMENDATION" - - -@dataclass(kw_only=True) -class GetRecommendationOutput: - """Dataclass for GetRecommendationOutput structure.""" - - recommendation_id: str - """The unique identifier of the recommendation.""" - - recommendation_arn: str - """The Amazon Resource Name (ARN) of the recommendation.""" - - name: str - """The name of the recommendation.""" - - type: str - """The type of recommendation.""" - - recommendation_config: RecommendationConfig - """The configuration for the recommendation.""" - - status: str - """The current status of the recommendation.""" - - created_at: datetime - """The timestamp when the recommendation was created.""" - - updated_at: datetime - """The timestamp when the recommendation was last updated.""" - - description: str | None = None - """The description of the recommendation.""" - - recommendation_result: RecommendationResult | None = None - """ - The result of the recommendation, containing the optimized system prompt - or tool descriptions. Only present when the recommendation status is - `COMPLETED`. - """ - - kms_key_arn: str | None = None - """The ARN of the KMS key used to encrypt recommendation data.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_RECOMMENDATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_RECOMMENDATION_OUTPUT.members["recommendationId"], - self.recommendation_id, - ) - serializer.write_string( - _SCHEMA_GET_RECOMMENDATION_OUTPUT.members["recommendationArn"], - self.recommendation_arn, - ) - serializer.write_string( - _SCHEMA_GET_RECOMMENDATION_OUTPUT.members["name"], self.name - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_RECOMMENDATION_OUTPUT.members["description"], - self.description, - ) - - serializer.write_string( - _SCHEMA_GET_RECOMMENDATION_OUTPUT.members["type"], self.type - ) - serializer.write_struct( - _SCHEMA_GET_RECOMMENDATION_OUTPUT.members["recommendationConfig"], - self.recommendation_config, - ) - serializer.write_string( - _SCHEMA_GET_RECOMMENDATION_OUTPUT.members["status"], self.status - ) - serializer.write_timestamp( - _SCHEMA_GET_RECOMMENDATION_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_GET_RECOMMENDATION_OUTPUT.members["updatedAt"], self.updated_at - ) - if self.recommendation_result is not None: - serializer.write_struct( - _SCHEMA_GET_RECOMMENDATION_OUTPUT.members["recommendationResult"], - self.recommendation_result, - ) - - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_GET_RECOMMENDATION_OUTPUT.members["kmsKeyArn"], self.kms_key_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["recommendation_id"] = de.read_string( - _SCHEMA_GET_RECOMMENDATION_OUTPUT.members["recommendationId"] - ) - - case 1: - kwargs["recommendation_arn"] = de.read_string( - _SCHEMA_GET_RECOMMENDATION_OUTPUT.members["recommendationArn"] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_GET_RECOMMENDATION_OUTPUT.members["name"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_GET_RECOMMENDATION_OUTPUT.members["description"] - ) - - case 4: - kwargs["type"] = RecommendationType( - de.read_string( - _SCHEMA_GET_RECOMMENDATION_OUTPUT.members["type"] - ) - ) - - case 5: - kwargs["recommendation_config"] = ( - _RecommendationConfigDeserializer().deserialize(de) - ) - - case 6: - kwargs["status"] = RecommendationStatus( - de.read_string( - _SCHEMA_GET_RECOMMENDATION_OUTPUT.members["status"] - ) - ) - - case 7: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_RECOMMENDATION_OUTPUT.members["createdAt"] - ) - - case 8: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_GET_RECOMMENDATION_OUTPUT.members["updatedAt"] - ) - - case 9: - kwargs["recommendation_result"] = ( - _RecommendationResultDeserializer().deserialize(de) - ) - - case 10: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_GET_RECOMMENDATION_OUTPUT.members["kmsKeyArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_RECOMMENDATION_OUTPUT, consumer=_consumer) - if "recommendation_id" not in kwargs: - kwargs["recommendation_id"] = "" - if "recommendation_arn" not in kwargs: - kwargs["recommendation_arn"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "type" not in kwargs: - kwargs["type"] = RecommendationType._corrected("") - if "recommendation_config" not in kwargs: - kwargs["recommendation_config"] = RecommendationConfigUnknown(tag="") - if "status" not in kwargs: - kwargs["status"] = RecommendationStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -GET_RECOMMENDATION = APIOperation( - input=GetRecommendationInput, - output=GetRecommendationOutput, - schema=_SCHEMA_GET_RECOMMENDATION, - input_schema=_SCHEMA_GET_RECOMMENDATION_INPUT, - output_schema=_SCHEMA_GET_RECOMMENDATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListABTestsInput: - """Dataclass for ListABTestsInput structure.""" - - max_results: int | None = None - """ - The maximum number of results to return in the response. If the total - number of results is greater than this value, use the token returned in - the response in the `nextToken` field when making another request to - return the next batch of results. - """ - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, enter the token returned in the `nextToken` - field in the response in this field to return the next batch of results. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_AB_TESTS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_AB_TESTS_INPUT.members["maxResults"], self.max_results - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_AB_TESTS_INPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_AB_TESTS_INPUT.members["maxResults"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_AB_TESTS_INPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_AB_TESTS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ListABTestsOutput: - """Dataclass for ListABTestsOutput structure.""" - - ab_tests: list[ABTestSummary] - """The list of A/B test summaries.""" - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, use this token when making another request in - the `nextToken` field to return the next batch of results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_AB_TESTS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_ab_test_summary_list( - serializer, _SCHEMA_LIST_AB_TESTS_OUTPUT.members["abTests"], self.ab_tests - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_AB_TESTS_OUTPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["ab_tests"] = _deserialize_ab_test_summary_list( - de, _SCHEMA_LIST_AB_TESTS_OUTPUT.members["abTests"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_AB_TESTS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_AB_TESTS_OUTPUT, consumer=_consumer) - if "ab_tests" not in kwargs: - kwargs["ab_tests"] = [] - return kwargs - - -LIST_AB_TESTS = APIOperation( - input=ListABTestsInput, - output=ListABTestsOutput, - schema=_SCHEMA_LIST_AB_TESTS, - input_schema=_SCHEMA_LIST_AB_TESTS_INPUT, - output_schema=_SCHEMA_LIST_AB_TESTS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#UnauthorizedException" - ): UnauthorizedException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListBatchEvaluationsInput: - """Dataclass for ListBatchEvaluationsInput structure.""" - - max_results: int | None = None - """ - The maximum number of results to return in the response. If the total - number of results is greater than this value, use the token returned in - the response in the `nextToken` field when making another request to - return the next batch of results. - """ - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, enter the token returned in the `nextToken` - field in the response in this field to return the next batch of results. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_BATCH_EVALUATIONS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_BATCH_EVALUATIONS_INPUT.members["maxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_BATCH_EVALUATIONS_INPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_BATCH_EVALUATIONS_INPUT.members["maxResults"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_BATCH_EVALUATIONS_INPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_BATCH_EVALUATIONS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class BatchEvaluationSummary: - """Summary representation for list responses.""" - - batch_evaluation_id: str - """The unique identifier of the batch evaluation.""" - - batch_evaluation_arn: str - """The Amazon Resource Name (ARN) of the batch evaluation.""" - - batch_evaluation_name: str - """The name of the batch evaluation.""" - - status: str - """The current status of the batch evaluation.""" - - created_at: datetime - """The timestamp when the batch evaluation was created.""" - - description: str | None = None - """The description of the batch evaluation.""" - - evaluators: list[Evaluator] | None = None - """The list of evaluators applied during the batch evaluation.""" - - insights: list[Insight] | None = None - """The list of insight analyses applied during the batch evaluation.""" - - evaluation_results: EvaluationJobResults | None = None - """The aggregated evaluation results.""" - - error_details: list[str] | None = None - """The error details if the batch evaluation encountered failures.""" - - kms_key_arn: str | None = None - """The ARN of the KMS key used to encrypt evaluation data.""" - - updated_at: datetime | None = None - """The timestamp when the batch evaluation was last updated.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BATCH_EVALUATION_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_BATCH_EVALUATION_SUMMARY.members["batchEvaluationId"], - self.batch_evaluation_id, - ) - serializer.write_string( - _SCHEMA_BATCH_EVALUATION_SUMMARY.members["batchEvaluationArn"], - self.batch_evaluation_arn, - ) - serializer.write_string( - _SCHEMA_BATCH_EVALUATION_SUMMARY.members["batchEvaluationName"], - self.batch_evaluation_name, - ) - serializer.write_string( - _SCHEMA_BATCH_EVALUATION_SUMMARY.members["status"], self.status - ) - serializer.write_timestamp( - _SCHEMA_BATCH_EVALUATION_SUMMARY.members["createdAt"], self.created_at - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_BATCH_EVALUATION_SUMMARY.members["description"], - self.description, - ) - - if self.evaluators is not None: - _serialize_evaluator_list( - serializer, - _SCHEMA_BATCH_EVALUATION_SUMMARY.members["evaluators"], - self.evaluators, - ) - - if self.insights is not None: - _serialize_insight_list( - serializer, - _SCHEMA_BATCH_EVALUATION_SUMMARY.members["insights"], - self.insights, - ) - - if self.evaluation_results is not None: - serializer.write_struct( - _SCHEMA_BATCH_EVALUATION_SUMMARY.members["evaluationResults"], - self.evaluation_results, - ) - - if self.error_details is not None: - _serialize_error_details_list( - serializer, - _SCHEMA_BATCH_EVALUATION_SUMMARY.members["errorDetails"], - self.error_details, - ) - - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_BATCH_EVALUATION_SUMMARY.members["kmsKeyArn"], self.kms_key_arn - ) - - if self.updated_at is not None: - serializer.write_timestamp( - _SCHEMA_BATCH_EVALUATION_SUMMARY.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["batch_evaluation_id"] = de.read_string( - _SCHEMA_BATCH_EVALUATION_SUMMARY.members["batchEvaluationId"] - ) - - case 1: - kwargs["batch_evaluation_arn"] = de.read_string( - _SCHEMA_BATCH_EVALUATION_SUMMARY.members["batchEvaluationArn"] - ) - - case 2: - kwargs["batch_evaluation_name"] = de.read_string( - _SCHEMA_BATCH_EVALUATION_SUMMARY.members["batchEvaluationName"] - ) - - case 3: - kwargs["status"] = BatchEvaluationStatus( - de.read_string( - _SCHEMA_BATCH_EVALUATION_SUMMARY.members["status"] - ) - ) - - case 4: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_BATCH_EVALUATION_SUMMARY.members["createdAt"] - ) - - case 5: - kwargs["description"] = de.read_string( - _SCHEMA_BATCH_EVALUATION_SUMMARY.members["description"] - ) - - case 6: - kwargs["evaluators"] = _deserialize_evaluator_list( - de, _SCHEMA_BATCH_EVALUATION_SUMMARY.members["evaluators"] - ) - - case 7: - kwargs["insights"] = _deserialize_insight_list( - de, _SCHEMA_BATCH_EVALUATION_SUMMARY.members["insights"] - ) - - case 8: - kwargs["evaluation_results"] = EvaluationJobResults.deserialize(de) - - case 9: - kwargs["error_details"] = _deserialize_error_details_list( - de, _SCHEMA_BATCH_EVALUATION_SUMMARY.members["errorDetails"] - ) - - case 10: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_BATCH_EVALUATION_SUMMARY.members["kmsKeyArn"] - ) - - case 11: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_BATCH_EVALUATION_SUMMARY.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BATCH_EVALUATION_SUMMARY, consumer=_consumer) - if "batch_evaluation_id" not in kwargs: - kwargs["batch_evaluation_id"] = "" - if "batch_evaluation_arn" not in kwargs: - kwargs["batch_evaluation_arn"] = "" - if "batch_evaluation_name" not in kwargs: - kwargs["batch_evaluation_name"] = "" - if "status" not in kwargs: - kwargs["status"] = BatchEvaluationStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_batch_evaluation_summary_list( - serializer: ShapeSerializer, schema: Schema, value: list[BatchEvaluationSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_batch_evaluation_summary_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[BatchEvaluationSummary]: - result: list[BatchEvaluationSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(BatchEvaluationSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListBatchEvaluationsOutput: - """Dataclass for ListBatchEvaluationsOutput structure.""" - - batch_evaluations: list[BatchEvaluationSummary] - """The list of batch evaluation summaries.""" - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, use this token when making another request in - the `nextToken` field to return the next batch of results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_BATCH_EVALUATIONS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_batch_evaluation_summary_list( - serializer, - _SCHEMA_LIST_BATCH_EVALUATIONS_OUTPUT.members["batchEvaluations"], - self.batch_evaluations, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_BATCH_EVALUATIONS_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["batch_evaluations"] = ( - _deserialize_batch_evaluation_summary_list( - de, - _SCHEMA_LIST_BATCH_EVALUATIONS_OUTPUT.members[ - "batchEvaluations" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_BATCH_EVALUATIONS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_BATCH_EVALUATIONS_OUTPUT, consumer=_consumer - ) - if "batch_evaluations" not in kwargs: - kwargs["batch_evaluations"] = [] - return kwargs - - -LIST_BATCH_EVALUATIONS = APIOperation( - input=ListBatchEvaluationsInput, - output=ListBatchEvaluationsOutput, - schema=_SCHEMA_LIST_BATCH_EVALUATIONS, - input_schema=_SCHEMA_LIST_BATCH_EVALUATIONS_INPUT, - output_schema=_SCHEMA_LIST_BATCH_EVALUATIONS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#UnauthorizedException" - ): UnauthorizedException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListRecommendationsInput: - """Dataclass for ListRecommendationsInput structure.""" - - max_results: int | None = None - """ - The maximum number of results to return in the response. If the total - number of results is greater than this value, use the token returned in - the response in the `nextToken` field when making another request to - return the next batch of results. - """ - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, enter the token returned in the `nextToken` - field in the response in this field to return the next batch of results. - """ - - status_filter: str | None = None - """ - Optional filter to return only recommendations with the specified - status. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_RECOMMENDATIONS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_RECOMMENDATIONS_INPUT.members["maxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_RECOMMENDATIONS_INPUT.members["nextToken"], self.next_token - ) - - if self.status_filter is not None: - serializer.write_string( - _SCHEMA_LIST_RECOMMENDATIONS_INPUT.members["statusFilter"], - self.status_filter, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_RECOMMENDATIONS_INPUT.members["maxResults"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_RECOMMENDATIONS_INPUT.members["nextToken"] - ) - - case 2: - kwargs["status_filter"] = RecommendationStatus( - de.read_string( - _SCHEMA_LIST_RECOMMENDATIONS_INPUT.members["statusFilter"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_RECOMMENDATIONS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class RecommendationSummary: - """Summary information about a recommendation.""" - - recommendation_id: str - """The unique identifier of the recommendation.""" - - recommendation_arn: str - """The Amazon Resource Name (ARN) of the recommendation.""" - - name: str - """The name of the recommendation.""" - - type: str - """The type of recommendation.""" - - status: str - """The current status of the recommendation.""" - - created_at: datetime - """The timestamp when the recommendation was created.""" - - updated_at: datetime - """The timestamp when the recommendation was last updated.""" - - description: str | None = None - """The description of the recommendation.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RECOMMENDATION_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_RECOMMENDATION_SUMMARY.members["recommendationId"], - self.recommendation_id, - ) - serializer.write_string( - _SCHEMA_RECOMMENDATION_SUMMARY.members["recommendationArn"], - self.recommendation_arn, - ) - serializer.write_string( - _SCHEMA_RECOMMENDATION_SUMMARY.members["name"], self.name - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_RECOMMENDATION_SUMMARY.members["description"], self.description - ) - - serializer.write_string( - _SCHEMA_RECOMMENDATION_SUMMARY.members["type"], self.type - ) - serializer.write_string( - _SCHEMA_RECOMMENDATION_SUMMARY.members["status"], self.status - ) - serializer.write_timestamp( - _SCHEMA_RECOMMENDATION_SUMMARY.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_RECOMMENDATION_SUMMARY.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["recommendation_id"] = de.read_string( - _SCHEMA_RECOMMENDATION_SUMMARY.members["recommendationId"] - ) - - case 1: - kwargs["recommendation_arn"] = de.read_string( - _SCHEMA_RECOMMENDATION_SUMMARY.members["recommendationArn"] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_RECOMMENDATION_SUMMARY.members["name"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_RECOMMENDATION_SUMMARY.members["description"] - ) - - case 4: - kwargs["type"] = RecommendationType( - de.read_string(_SCHEMA_RECOMMENDATION_SUMMARY.members["type"]) - ) - - case 5: - kwargs["status"] = RecommendationStatus( - de.read_string(_SCHEMA_RECOMMENDATION_SUMMARY.members["status"]) - ) - - case 6: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_RECOMMENDATION_SUMMARY.members["createdAt"] - ) - - case 7: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_RECOMMENDATION_SUMMARY.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RECOMMENDATION_SUMMARY, consumer=_consumer) - if "recommendation_id" not in kwargs: - kwargs["recommendation_id"] = "" - if "recommendation_arn" not in kwargs: - kwargs["recommendation_arn"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "type" not in kwargs: - kwargs["type"] = RecommendationType._corrected("") - if "status" not in kwargs: - kwargs["status"] = RecommendationStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_recommendation_summary_list( - serializer: ShapeSerializer, schema: Schema, value: list[RecommendationSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_recommendation_summary_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[RecommendationSummary]: - result: list[RecommendationSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(RecommendationSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListRecommendationsOutput: - """Dataclass for ListRecommendationsOutput structure.""" - - recommendation_summaries: list[RecommendationSummary] - """The list of recommendation summaries.""" - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, use this token when making another request in - the `nextToken` field to return the next batch of results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_RECOMMENDATIONS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_recommendation_summary_list( - serializer, - _SCHEMA_LIST_RECOMMENDATIONS_OUTPUT.members["recommendationSummaries"], - self.recommendation_summaries, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_RECOMMENDATIONS_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["recommendation_summaries"] = ( - _deserialize_recommendation_summary_list( - de, - _SCHEMA_LIST_RECOMMENDATIONS_OUTPUT.members[ - "recommendationSummaries" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_RECOMMENDATIONS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_RECOMMENDATIONS_OUTPUT, consumer=_consumer - ) - if "recommendation_summaries" not in kwargs: - kwargs["recommendation_summaries"] = [] - return kwargs - - -LIST_RECOMMENDATIONS = APIOperation( - input=ListRecommendationsInput, - output=ListRecommendationsOutput, - schema=_SCHEMA_LIST_RECOMMENDATIONS, - input_schema=_SCHEMA_LIST_RECOMMENDATIONS_INPUT, - output_schema=_SCHEMA_LIST_RECOMMENDATIONS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass -class GroundTruthTurnInputPrompt: - """The text prompt for this conversation turn.""" - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GROUND_TRUTH_TURN_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GROUND_TRUTH_TURN_INPUT.members["prompt"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string( - _SCHEMA_GROUND_TRUTH_TURN_INPUT.members["prompt"] - ) - ) - - -@dataclass -class GroundTruthTurnInputUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -GroundTruthTurnInput = Union[GroundTruthTurnInputPrompt | GroundTruthTurnInputUnknown] -"""The input for a ground truth conversation turn.""" - - -class _GroundTruthTurnInputDeserializer: - _result: GroundTruthTurnInput | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> GroundTruthTurnInput: - self._result = None - deserializer.read_struct(_SCHEMA_GROUND_TRUTH_TURN_INPUT, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(GroundTruthTurnInputPrompt.deserialize(de)) - - case _: - self._set_result( - GroundTruthTurnInputUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: GroundTruthTurnInput) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class GroundTruthTurn: - """Ground truth data for a single conversation turn.""" - - input: GroundTruthTurnInput | None = None - """The input for this conversation turn.""" - - expected_response: EvaluationContent | None = None - """The expected response for this conversation turn.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GROUND_TRUTH_TURN, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.input is not None: - serializer.write_struct( - _SCHEMA_GROUND_TRUTH_TURN.members["input"], self.input - ) - - if self.expected_response is not None: - serializer.write_struct( - _SCHEMA_GROUND_TRUTH_TURN.members["expectedResponse"], - self.expected_response, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["input"] = _GroundTruthTurnInputDeserializer().deserialize( - de - ) - - case 1: - kwargs["expected_response"] = ( - _EvaluationContentDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GROUND_TRUTH_TURN, consumer=_consumer) - return kwargs - - -def _serialize_ground_truth_turn_list( - serializer: ShapeSerializer, schema: Schema, value: list[GroundTruthTurn] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_ground_truth_turn_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GroundTruthTurn]: - result: list[GroundTruthTurn] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GroundTruthTurn.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class InlineGroundTruth: - """ - Inline ground truth data containing assertions, expected trajectories, - and per-turn expected responses. - """ - - assertions: list[EvaluationContent] | None = None - """Assertions for evaluation, reuses common model EvaluationContentList.""" - - expected_trajectory: EvaluationExpectedTrajectory | None = None - """The expected tool call sequence for trajectory evaluation.""" - - turns: list[GroundTruthTurn] | None = None - """ - A list of per-turn ground truth data, each containing an input prompt - and expected response. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INLINE_GROUND_TRUTH, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.assertions is not None: - _serialize_evaluation_content_list( - serializer, - _SCHEMA_INLINE_GROUND_TRUTH.members["assertions"], - self.assertions, - ) - - if self.expected_trajectory is not None: - serializer.write_struct( - _SCHEMA_INLINE_GROUND_TRUTH.members["expectedTrajectory"], - self.expected_trajectory, - ) - - if self.turns is not None: - _serialize_ground_truth_turn_list( - serializer, _SCHEMA_INLINE_GROUND_TRUTH.members["turns"], self.turns - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["assertions"] = _deserialize_evaluation_content_list( - de, _SCHEMA_INLINE_GROUND_TRUTH.members["assertions"] - ) - - case 1: - kwargs["expected_trajectory"] = ( - EvaluationExpectedTrajectory.deserialize(de) - ) - - case 2: - kwargs["turns"] = _deserialize_ground_truth_turn_list( - de, _SCHEMA_INLINE_GROUND_TRUTH.members["turns"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INLINE_GROUND_TRUTH, consumer=_consumer) - return kwargs - - -@dataclass -class GroundTruthSourceInline: - """Inline ground truth data provided directly in the request.""" - - value: InlineGroundTruth - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GROUND_TRUTH_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GROUND_TRUTH_SOURCE.members["inline"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=InlineGroundTruth.deserialize(deserializer)) - - -@dataclass -class GroundTruthSourceUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -GroundTruthSource = Union[GroundTruthSourceInline | GroundTruthSourceUnknown] -"""Where to pull ground truth from.""" - - -class _GroundTruthSourceDeserializer: - _result: GroundTruthSource | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> GroundTruthSource: - self._result = None - deserializer.read_struct(_SCHEMA_GROUND_TRUTH_SOURCE, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(GroundTruthSourceInline.deserialize(de)) - - case _: - self._set_result( - GroundTruthSourceUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: GroundTruthSource) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_string_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_string_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class SessionMetadataShape: - """ - Metadata for a specific session in a batch evaluation, including ground - truth data and test scenario identifiers. - """ - - session_id: str - """The unique identifier of the session this metadata applies to.""" - - test_scenario_id: str | None = None - """ - An optional test scenario identifier for categorizing and tracking - evaluation results. - """ - - ground_truth: GroundTruthSource | None = None - """ - The ground truth data for this session, including expected responses and - assertions. - """ - - metadata: dict[str, str] | None = None - """Additional key-value metadata associated with this session.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SESSION_METADATA_SHAPE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SESSION_METADATA_SHAPE.members["sessionId"], self.session_id - ) - if self.test_scenario_id is not None: - serializer.write_string( - _SCHEMA_SESSION_METADATA_SHAPE.members["testScenarioId"], - self.test_scenario_id, - ) - - if self.ground_truth is not None: - serializer.write_struct( - _SCHEMA_SESSION_METADATA_SHAPE.members["groundTruth"], self.ground_truth - ) - - if self.metadata is not None: - _serialize_string_map( - serializer, - _SCHEMA_SESSION_METADATA_SHAPE.members["metadata"], - self.metadata, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["session_id"] = de.read_string( - _SCHEMA_SESSION_METADATA_SHAPE.members["sessionId"] - ) - - case 1: - kwargs["test_scenario_id"] = de.read_string( - _SCHEMA_SESSION_METADATA_SHAPE.members["testScenarioId"] - ) - - case 2: - kwargs["ground_truth"] = ( - _GroundTruthSourceDeserializer().deserialize(de) - ) - - case 3: - kwargs["metadata"] = _deserialize_string_map( - de, _SCHEMA_SESSION_METADATA_SHAPE.members["metadata"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SESSION_METADATA_SHAPE, consumer=_consumer) - if "session_id" not in kwargs: - kwargs["session_id"] = "" - return kwargs - - -def _serialize_session_metadata_list( - serializer: ShapeSerializer, schema: Schema, value: list[SessionMetadataShape] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_session_metadata_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[SessionMetadataShape]: - result: list[SessionMetadataShape] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(SessionMetadataShape.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass -class EvaluationMetadataSessionMetadata: - """ - A list of session metadata entries containing ground truth data and test - scenario identifiers for specific sessions. - """ - - value: list[SessionMetadataShape] - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVALUATION_METADATA, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_session_metadata_list( - serializer, - _SCHEMA_EVALUATION_METADATA.members["sessionMetadata"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_deserialize_session_metadata_list( - deserializer, _SCHEMA_EVALUATION_METADATA.members["sessionMetadata"] - ) - ) - - -@dataclass -class EvaluationMetadataUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -EvaluationMetadata = Union[ - EvaluationMetadataSessionMetadata | EvaluationMetadataUnknown -] -""" -Metadata for the evaluation, including session-specific ground truth -data. -""" - - -class _EvaluationMetadataDeserializer: - _result: EvaluationMetadata | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> EvaluationMetadata: - self._result = None - deserializer.read_struct(_SCHEMA_EVALUATION_METADATA, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(EvaluationMetadataSessionMetadata.deserialize(de)) - - case _: - self._set_result( - EvaluationMetadataUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: EvaluationMetadata) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class StartBatchEvaluationInput: - """Dataclass for StartBatchEvaluationInput structure.""" - - batch_evaluation_name: str | None = None - """The name of the batch evaluation. Must be unique within your account.""" - - evaluators: list[Evaluator] | None = None - """ - The list of evaluators to apply during the batch evaluation. Can include - both built-in evaluators and custom evaluators. Maximum of 10 - evaluators. - """ - - insights: list[Insight] | None = None - """ - The list of insight analyses to run against sessions during the batch - evaluation. Maximum of 10 insights. - """ - - data_source_config: DataSourceConfig | None = None - """ - The data source configuration that specifies where to pull agent session - traces from for evaluation. - """ - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If this token matches a previous - request, the service ignores the request, but does not return an error. - """ - - evaluation_metadata: EvaluationMetadata | None = None - """ - Optional metadata for the evaluation, including session-specific ground - truth data and test scenario identifiers. - """ - - tags: dict[str, str] | None = None - """A map of tag keys and values to associate with the batch evaluation.""" - - kms_key_arn: str | None = None - """ - The ARN of the KMS key used to encrypt evaluation data. If provided, - customer data is encrypted at rest with the specified key. - """ - - description: str | None = None - """The description of the batch evaluation.""" - - output_config: OutputConfig | None = None - """Output destination configuration.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_BATCH_EVALUATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.batch_evaluation_name is not None: - serializer.write_string( - _SCHEMA_START_BATCH_EVALUATION_INPUT.members["batchEvaluationName"], - self.batch_evaluation_name, - ) - - if self.evaluators is not None: - _serialize_evaluator_list( - serializer, - _SCHEMA_START_BATCH_EVALUATION_INPUT.members["evaluators"], - self.evaluators, - ) - - if self.insights is not None: - _serialize_insight_list( - serializer, - _SCHEMA_START_BATCH_EVALUATION_INPUT.members["insights"], - self.insights, - ) - - if self.data_source_config is not None: - serializer.write_struct( - _SCHEMA_START_BATCH_EVALUATION_INPUT.members["dataSourceConfig"], - self.data_source_config, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_START_BATCH_EVALUATION_INPUT.members["clientToken"], - self.client_token, - ) - - if self.evaluation_metadata is not None: - serializer.write_struct( - _SCHEMA_START_BATCH_EVALUATION_INPUT.members["evaluationMetadata"], - self.evaluation_metadata, - ) - - if self.tags is not None: - _serialize_tags_map( - serializer, - _SCHEMA_START_BATCH_EVALUATION_INPUT.members["tags"], - self.tags, - ) - - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_START_BATCH_EVALUATION_INPUT.members["kmsKeyArn"], - self.kms_key_arn, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_START_BATCH_EVALUATION_INPUT.members["description"], - self.description, - ) - - if self.output_config is not None: - serializer.write_struct( - _SCHEMA_START_BATCH_EVALUATION_INPUT.members["outputConfig"], - self.output_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["batch_evaluation_name"] = de.read_string( - _SCHEMA_START_BATCH_EVALUATION_INPUT.members[ - "batchEvaluationName" - ] - ) - - case 1: - kwargs["evaluators"] = _deserialize_evaluator_list( - de, _SCHEMA_START_BATCH_EVALUATION_INPUT.members["evaluators"] - ) - - case 2: - kwargs["insights"] = _deserialize_insight_list( - de, _SCHEMA_START_BATCH_EVALUATION_INPUT.members["insights"] - ) - - case 3: - kwargs["data_source_config"] = ( - _DataSourceConfigDeserializer().deserialize(de) - ) - - case 4: - kwargs["client_token"] = de.read_string( - _SCHEMA_START_BATCH_EVALUATION_INPUT.members["clientToken"] - ) - - case 5: - kwargs["evaluation_metadata"] = ( - _EvaluationMetadataDeserializer().deserialize(de) - ) - - case 6: - kwargs["tags"] = _deserialize_tags_map( - de, _SCHEMA_START_BATCH_EVALUATION_INPUT.members["tags"] - ) - - case 7: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_START_BATCH_EVALUATION_INPUT.members["kmsKeyArn"] - ) - - case 8: - kwargs["description"] = de.read_string( - _SCHEMA_START_BATCH_EVALUATION_INPUT.members["description"] - ) - - case 9: - kwargs["output_config"] = _OutputConfigDeserializer().deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_START_BATCH_EVALUATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class StartBatchEvaluationOutput: - """Dataclass for StartBatchEvaluationOutput structure.""" - - batch_evaluation_id: str - """The unique identifier of the created batch evaluation.""" - - batch_evaluation_arn: str - """The Amazon Resource Name (ARN) of the created batch evaluation.""" - - batch_evaluation_name: str - """The name of the batch evaluation.""" - - status: str - """The status of the batch evaluation.""" - - created_at: datetime - """The timestamp when the batch evaluation was created.""" - - evaluators: list[Evaluator] | None = None - """The list of evaluators applied during the batch evaluation.""" - - insights: list[Insight] | None = None - """The list of insight analyses applied during the batch evaluation.""" - - output_config: OutputConfig | None = None - """ - The output configuration specifying where evaluation results are - written. - """ - - tags: dict[str, str] | None = None - """The tags associated with the batch evaluation.""" - - kms_key_arn: str | None = None - """The ARN of the KMS key used to encrypt evaluation data.""" - - description: str | None = None - """The description of the batch evaluation.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_BATCH_EVALUATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_START_BATCH_EVALUATION_OUTPUT.members["batchEvaluationId"], - self.batch_evaluation_id, - ) - serializer.write_string( - _SCHEMA_START_BATCH_EVALUATION_OUTPUT.members["batchEvaluationArn"], - self.batch_evaluation_arn, - ) - serializer.write_string( - _SCHEMA_START_BATCH_EVALUATION_OUTPUT.members["batchEvaluationName"], - self.batch_evaluation_name, - ) - if self.evaluators is not None: - _serialize_evaluator_list( - serializer, - _SCHEMA_START_BATCH_EVALUATION_OUTPUT.members["evaluators"], - self.evaluators, - ) - - if self.insights is not None: - _serialize_insight_list( - serializer, - _SCHEMA_START_BATCH_EVALUATION_OUTPUT.members["insights"], - self.insights, - ) - - serializer.write_string( - _SCHEMA_START_BATCH_EVALUATION_OUTPUT.members["status"], self.status - ) - serializer.write_timestamp( - _SCHEMA_START_BATCH_EVALUATION_OUTPUT.members["createdAt"], self.created_at - ) - if self.output_config is not None: - serializer.write_struct( - _SCHEMA_START_BATCH_EVALUATION_OUTPUT.members["outputConfig"], - self.output_config, - ) - - if self.tags is not None: - _serialize_tags_map( - serializer, - _SCHEMA_START_BATCH_EVALUATION_OUTPUT.members["tags"], - self.tags, - ) - - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_START_BATCH_EVALUATION_OUTPUT.members["kmsKeyArn"], - self.kms_key_arn, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_START_BATCH_EVALUATION_OUTPUT.members["description"], - self.description, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["batch_evaluation_id"] = de.read_string( - _SCHEMA_START_BATCH_EVALUATION_OUTPUT.members[ - "batchEvaluationId" - ] - ) - - case 1: - kwargs["batch_evaluation_arn"] = de.read_string( - _SCHEMA_START_BATCH_EVALUATION_OUTPUT.members[ - "batchEvaluationArn" - ] - ) - - case 2: - kwargs["batch_evaluation_name"] = de.read_string( - _SCHEMA_START_BATCH_EVALUATION_OUTPUT.members[ - "batchEvaluationName" - ] - ) - - case 3: - kwargs["evaluators"] = _deserialize_evaluator_list( - de, _SCHEMA_START_BATCH_EVALUATION_OUTPUT.members["evaluators"] - ) - - case 4: - kwargs["insights"] = _deserialize_insight_list( - de, _SCHEMA_START_BATCH_EVALUATION_OUTPUT.members["insights"] - ) - - case 5: - kwargs["status"] = BatchEvaluationStatus( - de.read_string( - _SCHEMA_START_BATCH_EVALUATION_OUTPUT.members["status"] - ) - ) - - case 6: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_START_BATCH_EVALUATION_OUTPUT.members["createdAt"] - ) - - case 7: - kwargs["output_config"] = _OutputConfigDeserializer().deserialize( - de - ) - - case 8: - kwargs["tags"] = _deserialize_tags_map( - de, _SCHEMA_START_BATCH_EVALUATION_OUTPUT.members["tags"] - ) - - case 9: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_START_BATCH_EVALUATION_OUTPUT.members["kmsKeyArn"] - ) - - case 10: - kwargs["description"] = de.read_string( - _SCHEMA_START_BATCH_EVALUATION_OUTPUT.members["description"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_START_BATCH_EVALUATION_OUTPUT, consumer=_consumer - ) - if "batch_evaluation_id" not in kwargs: - kwargs["batch_evaluation_id"] = "" - if "batch_evaluation_arn" not in kwargs: - kwargs["batch_evaluation_arn"] = "" - if "batch_evaluation_name" not in kwargs: - kwargs["batch_evaluation_name"] = "" - if "status" not in kwargs: - kwargs["status"] = BatchEvaluationStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -START_BATCH_EVALUATION = APIOperation( - input=StartBatchEvaluationInput, - output=StartBatchEvaluationOutput, - schema=_SCHEMA_START_BATCH_EVALUATION, - input_schema=_SCHEMA_START_BATCH_EVALUATION_INPUT, - output_schema=_SCHEMA_START_BATCH_EVALUATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#UnauthorizedException" - ): UnauthorizedException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class StartRecommendationInput: - """Dataclass for StartRecommendationInput structure.""" - - name: str | None = None - """The name of the recommendation. Must be unique within your account.""" - - description: str | None = None - """The description of the recommendation.""" - - type: str | None = None - """ - The type of recommendation to generate. Valid values are - `SYSTEM_PROMPT_RECOMMENDATION` for system prompt optimization or - `TOOL_DESCRIPTION_RECOMMENDATION` for tool description optimization. - """ - - recommendation_config: RecommendationConfig | None = None - """ - The configuration for the recommendation, including the input to - optimize, agent traces to analyze, and evaluation settings. - """ - - kms_key_arn: str | None = None - """ - The ARN of the KMS key used to encrypt recommendation data. If provided, - customer data is encrypted at rest with the specified key. - """ - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If this token matches a previous - request, the service ignores the request, but does not return an error. - """ - - tags: dict[str, str] | None = None - """A map of tag keys and values to associate with the recommendation.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_RECOMMENDATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_START_RECOMMENDATION_INPUT.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_START_RECOMMENDATION_INPUT.members["description"], - self.description, - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_START_RECOMMENDATION_INPUT.members["type"], self.type - ) - - if self.recommendation_config is not None: - serializer.write_struct( - _SCHEMA_START_RECOMMENDATION_INPUT.members["recommendationConfig"], - self.recommendation_config, - ) - - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_START_RECOMMENDATION_INPUT.members["kmsKeyArn"], - self.kms_key_arn, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_START_RECOMMENDATION_INPUT.members["clientToken"], - self.client_token, - ) - - if self.tags is not None: - _serialize_tags_map( - serializer, - _SCHEMA_START_RECOMMENDATION_INPUT.members["tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_START_RECOMMENDATION_INPUT.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_START_RECOMMENDATION_INPUT.members["description"] - ) - - case 2: - kwargs["type"] = RecommendationType( - de.read_string( - _SCHEMA_START_RECOMMENDATION_INPUT.members["type"] - ) - ) - - case 3: - kwargs["recommendation_config"] = ( - _RecommendationConfigDeserializer().deserialize(de) - ) - - case 4: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_START_RECOMMENDATION_INPUT.members["kmsKeyArn"] - ) - - case 5: - kwargs["client_token"] = de.read_string( - _SCHEMA_START_RECOMMENDATION_INPUT.members["clientToken"] - ) - - case 6: - kwargs["tags"] = _deserialize_tags_map( - de, _SCHEMA_START_RECOMMENDATION_INPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_START_RECOMMENDATION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class StartRecommendationOutput: - """Dataclass for StartRecommendationOutput structure.""" - - recommendation_id: str - """The unique identifier of the created recommendation.""" - - recommendation_arn: str - """The Amazon Resource Name (ARN) of the created recommendation.""" - - name: str - """The name of the recommendation.""" - - type: str - """The type of recommendation.""" - - recommendation_config: RecommendationConfig - """The configuration for the recommendation.""" - - status: str - """The status of the recommendation.""" - - created_at: datetime - """The timestamp when the recommendation was created.""" - - updated_at: datetime - """The timestamp when the recommendation was last updated.""" - - description: str | None = None - """The description of the recommendation.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_RECOMMENDATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_START_RECOMMENDATION_OUTPUT.members["recommendationId"], - self.recommendation_id, - ) - serializer.write_string( - _SCHEMA_START_RECOMMENDATION_OUTPUT.members["recommendationArn"], - self.recommendation_arn, - ) - serializer.write_string( - _SCHEMA_START_RECOMMENDATION_OUTPUT.members["name"], self.name - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_START_RECOMMENDATION_OUTPUT.members["description"], - self.description, - ) - - serializer.write_string( - _SCHEMA_START_RECOMMENDATION_OUTPUT.members["type"], self.type - ) - serializer.write_struct( - _SCHEMA_START_RECOMMENDATION_OUTPUT.members["recommendationConfig"], - self.recommendation_config, - ) - serializer.write_string( - _SCHEMA_START_RECOMMENDATION_OUTPUT.members["status"], self.status - ) - serializer.write_timestamp( - _SCHEMA_START_RECOMMENDATION_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_START_RECOMMENDATION_OUTPUT.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["recommendation_id"] = de.read_string( - _SCHEMA_START_RECOMMENDATION_OUTPUT.members["recommendationId"] - ) - - case 1: - kwargs["recommendation_arn"] = de.read_string( - _SCHEMA_START_RECOMMENDATION_OUTPUT.members["recommendationArn"] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_START_RECOMMENDATION_OUTPUT.members["name"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_START_RECOMMENDATION_OUTPUT.members["description"] - ) - - case 4: - kwargs["type"] = RecommendationType( - de.read_string( - _SCHEMA_START_RECOMMENDATION_OUTPUT.members["type"] - ) - ) - - case 5: - kwargs["recommendation_config"] = ( - _RecommendationConfigDeserializer().deserialize(de) - ) - - case 6: - kwargs["status"] = RecommendationStatus( - de.read_string( - _SCHEMA_START_RECOMMENDATION_OUTPUT.members["status"] - ) - ) - - case 7: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_START_RECOMMENDATION_OUTPUT.members["createdAt"] - ) - - case 8: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_START_RECOMMENDATION_OUTPUT.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_START_RECOMMENDATION_OUTPUT, consumer=_consumer - ) - if "recommendation_id" not in kwargs: - kwargs["recommendation_id"] = "" - if "recommendation_arn" not in kwargs: - kwargs["recommendation_arn"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "type" not in kwargs: - kwargs["type"] = RecommendationType._corrected("") - if "recommendation_config" not in kwargs: - kwargs["recommendation_config"] = RecommendationConfigUnknown(tag="") - if "status" not in kwargs: - kwargs["status"] = RecommendationStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -START_RECOMMENDATION = APIOperation( - input=StartRecommendationInput, - output=StartRecommendationOutput, - schema=_SCHEMA_START_RECOMMENDATION, - input_schema=_SCHEMA_START_RECOMMENDATION_INPUT, - output_schema=_SCHEMA_START_RECOMMENDATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class StopBatchEvaluationInput: - """Dataclass for StopBatchEvaluationInput structure.""" - - batch_evaluation_id: str | None = None - """The unique identifier of the batch evaluation to stop.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STOP_BATCH_EVALUATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.batch_evaluation_id is not None: - serializer.write_string( - _SCHEMA_STOP_BATCH_EVALUATION_INPUT.members["batchEvaluationId"], - self.batch_evaluation_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["batch_evaluation_id"] = de.read_string( - _SCHEMA_STOP_BATCH_EVALUATION_INPUT.members["batchEvaluationId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_STOP_BATCH_EVALUATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class StopBatchEvaluationOutput: - """Dataclass for StopBatchEvaluationOutput structure.""" - - batch_evaluation_id: str - """The unique identifier of the stopped batch evaluation.""" - - batch_evaluation_arn: str - """The Amazon Resource Name (ARN) of the stopped batch evaluation.""" - - status: str - """The status of the batch evaluation after the stop request.""" - - description: str | None = None - """The description of the batch evaluation.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STOP_BATCH_EVALUATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_STOP_BATCH_EVALUATION_OUTPUT.members["batchEvaluationId"], - self.batch_evaluation_id, - ) - serializer.write_string( - _SCHEMA_STOP_BATCH_EVALUATION_OUTPUT.members["batchEvaluationArn"], - self.batch_evaluation_arn, - ) - serializer.write_string( - _SCHEMA_STOP_BATCH_EVALUATION_OUTPUT.members["status"], self.status - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_STOP_BATCH_EVALUATION_OUTPUT.members["description"], - self.description, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["batch_evaluation_id"] = de.read_string( - _SCHEMA_STOP_BATCH_EVALUATION_OUTPUT.members[ - "batchEvaluationId" - ] - ) - - case 1: - kwargs["batch_evaluation_arn"] = de.read_string( - _SCHEMA_STOP_BATCH_EVALUATION_OUTPUT.members[ - "batchEvaluationArn" - ] - ) - - case 2: - kwargs["status"] = BatchEvaluationStatus( - de.read_string( - _SCHEMA_STOP_BATCH_EVALUATION_OUTPUT.members["status"] - ) - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_STOP_BATCH_EVALUATION_OUTPUT.members["description"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_STOP_BATCH_EVALUATION_OUTPUT, consumer=_consumer - ) - if "batch_evaluation_id" not in kwargs: - kwargs["batch_evaluation_id"] = "" - if "batch_evaluation_arn" not in kwargs: - kwargs["batch_evaluation_arn"] = "" - if "status" not in kwargs: - kwargs["status"] = BatchEvaluationStatus._corrected("") - return kwargs - - -STOP_BATCH_EVALUATION = APIOperation( - input=StopBatchEvaluationInput, - output=StopBatchEvaluationOutput, - schema=_SCHEMA_STOP_BATCH_EVALUATION, - input_schema=_SCHEMA_STOP_BATCH_EVALUATION_INPUT, - output_schema=_SCHEMA_STOP_BATCH_EVALUATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#UnauthorizedException" - ): UnauthorizedException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateABTestInput: - """Dataclass for UpdateABTestInput structure.""" - - ab_test_id: str | None = None - """The unique identifier of the A/B test to update.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If this token matches a previous - request, the service ignores the request, but does not return an error. - """ - - name: str | None = None - """The updated name of the A/B test.""" - - description: str | None = None - """The updated description of the A/B test.""" - - variants: list[Variant] | None = None - """The updated list of variants.""" - - gateway_filter: GatewayFilter | None = None - """The updated gateway filter.""" - - evaluation_config: ABTestEvaluationConfig | None = None - """The updated evaluation configuration.""" - - role_arn: str | None = None - """The updated IAM role ARN.""" - - execution_status: str | None = None - """The updated execution status to enable or disable the A/B test.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_AB_TEST_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.ab_test_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_AB_TEST_INPUT.members["abTestId"], self.ab_test_id - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_UPDATE_AB_TEST_INPUT.members["clientToken"], self.client_token - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_UPDATE_AB_TEST_INPUT.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_AB_TEST_INPUT.members["description"], self.description - ) - - if self.variants is not None: - _serialize_variant_list( - serializer, - _SCHEMA_UPDATE_AB_TEST_INPUT.members["variants"], - self.variants, - ) - - if self.gateway_filter is not None: - serializer.write_struct( - _SCHEMA_UPDATE_AB_TEST_INPUT.members["gatewayFilter"], - self.gateway_filter, - ) - - if self.evaluation_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_AB_TEST_INPUT.members["evaluationConfig"], - self.evaluation_config, - ) - - if self.role_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_AB_TEST_INPUT.members["roleArn"], self.role_arn - ) - - if self.execution_status is not None: - serializer.write_string( - _SCHEMA_UPDATE_AB_TEST_INPUT.members["executionStatus"], - self.execution_status, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["ab_test_id"] = de.read_string( - _SCHEMA_UPDATE_AB_TEST_INPUT.members["abTestId"] - ) - - case 1: - kwargs["client_token"] = de.read_string( - _SCHEMA_UPDATE_AB_TEST_INPUT.members["clientToken"] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_AB_TEST_INPUT.members["name"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_AB_TEST_INPUT.members["description"] - ) - - case 4: - kwargs["variants"] = _deserialize_variant_list( - de, _SCHEMA_UPDATE_AB_TEST_INPUT.members["variants"] - ) - - case 5: - kwargs["gateway_filter"] = GatewayFilter.deserialize(de) - - case 6: - kwargs["evaluation_config"] = ( - _ABTestEvaluationConfigDeserializer().deserialize(de) - ) - - case 7: - kwargs["role_arn"] = de.read_string( - _SCHEMA_UPDATE_AB_TEST_INPUT.members["roleArn"] - ) - - case 8: - kwargs["execution_status"] = ABTestExecutionStatus( - de.read_string( - _SCHEMA_UPDATE_AB_TEST_INPUT.members["executionStatus"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_AB_TEST_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateABTestOutput: - """Dataclass for UpdateABTestOutput structure.""" - - ab_test_id: str - """The unique identifier of the updated A/B test.""" - - ab_test_arn: str - """The Amazon Resource Name (ARN) of the updated A/B test.""" - - status: str - """The status of the A/B test.""" - - execution_status: str - """The execution status of the A/B test.""" - - updated_at: datetime - """The timestamp when the A/B test was updated.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_AB_TEST_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_UPDATE_AB_TEST_OUTPUT.members["abTestId"], self.ab_test_id - ) - serializer.write_string( - _SCHEMA_UPDATE_AB_TEST_OUTPUT.members["abTestArn"], self.ab_test_arn - ) - serializer.write_string( - _SCHEMA_UPDATE_AB_TEST_OUTPUT.members["status"], self.status - ) - serializer.write_string( - _SCHEMA_UPDATE_AB_TEST_OUTPUT.members["executionStatus"], - self.execution_status, - ) - serializer.write_timestamp( - _SCHEMA_UPDATE_AB_TEST_OUTPUT.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["ab_test_id"] = de.read_string( - _SCHEMA_UPDATE_AB_TEST_OUTPUT.members["abTestId"] - ) - - case 1: - kwargs["ab_test_arn"] = de.read_string( - _SCHEMA_UPDATE_AB_TEST_OUTPUT.members["abTestArn"] - ) - - case 2: - kwargs["status"] = ABTestStatus( - de.read_string(_SCHEMA_UPDATE_AB_TEST_OUTPUT.members["status"]) - ) - - case 3: - kwargs["execution_status"] = ABTestExecutionStatus( - de.read_string( - _SCHEMA_UPDATE_AB_TEST_OUTPUT.members["executionStatus"] - ) - ) - - case 4: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_UPDATE_AB_TEST_OUTPUT.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_AB_TEST_OUTPUT, consumer=_consumer) - if "ab_test_id" not in kwargs: - kwargs["ab_test_id"] = "" - if "ab_test_arn" not in kwargs: - kwargs["ab_test_arn"] = "" - if "status" not in kwargs: - kwargs["status"] = ABTestStatus._corrected("") - if "execution_status" not in kwargs: - kwargs["execution_status"] = ABTestExecutionStatus._corrected("") - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -UPDATE_AB_TEST = APIOperation( - input=UpdateABTestInput, - output=UpdateABTestOutput, - schema=_SCHEMA_UPDATE_AB_TEST, - input_schema=_SCHEMA_UPDATE_AB_TEST_INPUT, - output_schema=_SCHEMA_UPDATE_AB_TEST_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#UnauthorizedException" - ): UnauthorizedException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetResourceApiKeyInput: - """Dataclass for GetResourceApiKeyInput structure.""" - - workload_identity_token: str | None = field(repr=False, default=None) - """ - The identity token of the workload from which you want to retrieve the - API key. - """ - - resource_credential_provider_name: str | None = None - """ - The credential provider name for the resource from which you are - retrieving the API key. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_RESOURCE_API_KEY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.workload_identity_token is not None: - serializer.write_string( - _SCHEMA_GET_RESOURCE_API_KEY_INPUT.members["workloadIdentityToken"], - self.workload_identity_token, - ) - - if self.resource_credential_provider_name is not None: - serializer.write_string( - _SCHEMA_GET_RESOURCE_API_KEY_INPUT.members[ - "resourceCredentialProviderName" - ], - self.resource_credential_provider_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["workload_identity_token"] = de.read_string( - _SCHEMA_GET_RESOURCE_API_KEY_INPUT.members[ - "workloadIdentityToken" - ] - ) - - case 1: - kwargs["resource_credential_provider_name"] = de.read_string( - _SCHEMA_GET_RESOURCE_API_KEY_INPUT.members[ - "resourceCredentialProviderName" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_RESOURCE_API_KEY_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetResourceApiKeyOutput: - """Dataclass for GetResourceApiKeyOutput structure.""" - - api_key: str = field(repr=False) - """The API key associated with the resource requested.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_RESOURCE_API_KEY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_RESOURCE_API_KEY_OUTPUT.members["apiKey"], self.api_key - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["api_key"] = de.read_string( - _SCHEMA_GET_RESOURCE_API_KEY_OUTPUT.members["apiKey"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_RESOURCE_API_KEY_OUTPUT, consumer=_consumer - ) - if "api_key" not in kwargs: - kwargs["api_key"] = "" - return kwargs - - -GET_RESOURCE_API_KEY = APIOperation( - input=GetResourceApiKeyInput, - output=GetResourceApiKeyOutput, - schema=_SCHEMA_GET_RESOURCE_API_KEY, - input_schema=_SCHEMA_GET_RESOURCE_API_KEY_INPUT, - output_schema=_SCHEMA_GET_RESOURCE_API_KEY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#UnauthorizedException" - ): UnauthorizedException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -def _serialize_audiences_list_type( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_audiences_list_type( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_custom_request_parameters_type( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_custom_request_parameters_type( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -class Oauth2FlowType(UnknownEnumMixin, StrEnum): - USER_FEDERATION = "USER_FEDERATION" - M2_M = "M2M" - ON_BEHALF_OF_TOKEN_EXCHANGE = "ON_BEHALF_OF_TOKEN_EXCHANGE" - - -def _serialize_resources_list_type( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_resources_list_type( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_scopes_list_type( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_scopes_list_type( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GetResourceOauth2TokenInput: - """Dataclass for GetResourceOauth2TokenInput structure.""" - - workload_identity_token: str | None = field(repr=False, default=None) - """ - The identity token of the workload from which you want to retrieve the - OAuth2 token. - """ - - resource_credential_provider_name: str | None = None - """The name of the resource's credential provider.""" - - scopes: list[str] | None = None - """The OAuth scopes being requested.""" - - oauth2_flow: str | None = None - """The type of flow to be performed.""" - - session_uri: str | None = None - """ - Unique identifier for the user's authentication session for retrieving - OAuth2 tokens. This ID tracks the authorization flow state across - multiple requests and responses during the OAuth2 authentication - process. - """ - - resource_oauth2_return_url: str | None = None - """ - The callback URL to redirect to after the OAuth 2.0 token retrieval is - complete. This URL must be one of the provided URLs configured for the - workload identity. - """ - - force_authentication: bool | None = None - """ - Indicates whether to always initiate a new three-legged OAuth (3LO) - flow, regardless of any existing session. - """ - - custom_parameters: dict[str, str] | None = None - """ - A map of custom parameters to include in the authorization request to - the resource credential provider. These parameters are in addition to - the standard OAuth 2.0 flow parameters, and will not override them. - """ - - custom_state: str | None = field(repr=False, default=None) - """ - An opaque string that will be sent back to the callback URL provided in - resourceOauth2ReturnUrl. This state should be used to protect the - callback URL of your application against CSRF attacks by ensuring the - response corresponds to the original request. - """ - - resources: list[str] | None = None - """ - The resources to include in the token request. These are used to specify - the target resources for which the OAuth2 token is being requested. - """ - - audiences: list[str] | None = None - """ - The audiences to include in the token request. These are used to specify - the intended recipients of the OAuth2 token. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_RESOURCE_OAUTH2_TOKEN_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.workload_identity_token is not None: - serializer.write_string( - _SCHEMA_GET_RESOURCE_OAUTH2_TOKEN_INPUT.members[ - "workloadIdentityToken" - ], - self.workload_identity_token, - ) - - if self.resource_credential_provider_name is not None: - serializer.write_string( - _SCHEMA_GET_RESOURCE_OAUTH2_TOKEN_INPUT.members[ - "resourceCredentialProviderName" - ], - self.resource_credential_provider_name, - ) - - if self.scopes is not None: - _serialize_scopes_list_type( - serializer, - _SCHEMA_GET_RESOURCE_OAUTH2_TOKEN_INPUT.members["scopes"], - self.scopes, - ) - - if self.oauth2_flow is not None: - serializer.write_string( - _SCHEMA_GET_RESOURCE_OAUTH2_TOKEN_INPUT.members["oauth2Flow"], - self.oauth2_flow, - ) - - if self.session_uri is not None: - serializer.write_string( - _SCHEMA_GET_RESOURCE_OAUTH2_TOKEN_INPUT.members["sessionUri"], - self.session_uri, - ) - - if self.resource_oauth2_return_url is not None: - serializer.write_string( - _SCHEMA_GET_RESOURCE_OAUTH2_TOKEN_INPUT.members[ - "resourceOauth2ReturnUrl" - ], - self.resource_oauth2_return_url, - ) - - if self.force_authentication is not None: - serializer.write_boolean( - _SCHEMA_GET_RESOURCE_OAUTH2_TOKEN_INPUT.members["forceAuthentication"], - self.force_authentication, - ) - - if self.custom_parameters is not None: - _serialize_custom_request_parameters_type( - serializer, - _SCHEMA_GET_RESOURCE_OAUTH2_TOKEN_INPUT.members["customParameters"], - self.custom_parameters, - ) - - if self.custom_state is not None: - serializer.write_string( - _SCHEMA_GET_RESOURCE_OAUTH2_TOKEN_INPUT.members["customState"], - self.custom_state, - ) - - if self.resources is not None: - _serialize_resources_list_type( - serializer, - _SCHEMA_GET_RESOURCE_OAUTH2_TOKEN_INPUT.members["resources"], - self.resources, - ) - - if self.audiences is not None: - _serialize_audiences_list_type( - serializer, - _SCHEMA_GET_RESOURCE_OAUTH2_TOKEN_INPUT.members["audiences"], - self.audiences, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["workload_identity_token"] = de.read_string( - _SCHEMA_GET_RESOURCE_OAUTH2_TOKEN_INPUT.members[ - "workloadIdentityToken" - ] - ) - - case 1: - kwargs["resource_credential_provider_name"] = de.read_string( - _SCHEMA_GET_RESOURCE_OAUTH2_TOKEN_INPUT.members[ - "resourceCredentialProviderName" - ] - ) - - case 2: - kwargs["scopes"] = _deserialize_scopes_list_type( - de, _SCHEMA_GET_RESOURCE_OAUTH2_TOKEN_INPUT.members["scopes"] - ) - - case 3: - kwargs["oauth2_flow"] = Oauth2FlowType( - de.read_string( - _SCHEMA_GET_RESOURCE_OAUTH2_TOKEN_INPUT.members[ - "oauth2Flow" - ] - ) - ) - - case 4: - kwargs["session_uri"] = de.read_string( - _SCHEMA_GET_RESOURCE_OAUTH2_TOKEN_INPUT.members["sessionUri"] - ) - - case 5: - kwargs["resource_oauth2_return_url"] = de.read_string( - _SCHEMA_GET_RESOURCE_OAUTH2_TOKEN_INPUT.members[ - "resourceOauth2ReturnUrl" - ] - ) - - case 6: - kwargs["force_authentication"] = de.read_boolean( - _SCHEMA_GET_RESOURCE_OAUTH2_TOKEN_INPUT.members[ - "forceAuthentication" - ] - ) - - case 7: - kwargs["custom_parameters"] = ( - _deserialize_custom_request_parameters_type( - de, - _SCHEMA_GET_RESOURCE_OAUTH2_TOKEN_INPUT.members[ - "customParameters" - ], - ) - ) - - case 8: - kwargs["custom_state"] = de.read_string( - _SCHEMA_GET_RESOURCE_OAUTH2_TOKEN_INPUT.members["customState"] - ) - - case 9: - kwargs["resources"] = _deserialize_resources_list_type( - de, _SCHEMA_GET_RESOURCE_OAUTH2_TOKEN_INPUT.members["resources"] - ) - - case 10: - kwargs["audiences"] = _deserialize_audiences_list_type( - de, _SCHEMA_GET_RESOURCE_OAUTH2_TOKEN_INPUT.members["audiences"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_RESOURCE_OAUTH2_TOKEN_INPUT, consumer=_consumer - ) - return kwargs - - -class SessionStatus(UnknownEnumMixin, StrEnum): - IN_PROGRESS = "IN_PROGRESS" - FAILED = "FAILED" - - -@dataclass(kw_only=True) -class GetResourceOauth2TokenOutput: - """Dataclass for GetResourceOauth2TokenOutput structure.""" - - authorization_url: str | None = field(repr=False, default=None) - """ - The URL to initiate the authorization process, provided when the access - token requires user authorization. - """ - - access_token: str | None = field(repr=False, default=None) - """The OAuth 2.0 access token to use.""" - - session_uri: str | None = None - """ - Unique identifier for the user's authorization session for retrieving - OAuth2 tokens. This matches the sessionId from the request and can be - used to track the session state. - """ - - session_status: str | None = None - """ - Status indicating whether the user's authorization session is in - progress or has failed. This helps determine the next steps in the - OAuth2 authentication flow. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_RESOURCE_OAUTH2_TOKEN_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.authorization_url is not None: - serializer.write_string( - _SCHEMA_GET_RESOURCE_OAUTH2_TOKEN_OUTPUT.members["authorizationUrl"], - self.authorization_url, - ) - - if self.access_token is not None: - serializer.write_string( - _SCHEMA_GET_RESOURCE_OAUTH2_TOKEN_OUTPUT.members["accessToken"], - self.access_token, - ) - - if self.session_uri is not None: - serializer.write_string( - _SCHEMA_GET_RESOURCE_OAUTH2_TOKEN_OUTPUT.members["sessionUri"], - self.session_uri, - ) - - if self.session_status is not None: - serializer.write_string( - _SCHEMA_GET_RESOURCE_OAUTH2_TOKEN_OUTPUT.members["sessionStatus"], - self.session_status, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["authorization_url"] = de.read_string( - _SCHEMA_GET_RESOURCE_OAUTH2_TOKEN_OUTPUT.members[ - "authorizationUrl" - ] - ) - - case 1: - kwargs["access_token"] = de.read_string( - _SCHEMA_GET_RESOURCE_OAUTH2_TOKEN_OUTPUT.members["accessToken"] - ) - - case 2: - kwargs["session_uri"] = de.read_string( - _SCHEMA_GET_RESOURCE_OAUTH2_TOKEN_OUTPUT.members["sessionUri"] - ) - - case 3: - kwargs["session_status"] = SessionStatus( - de.read_string( - _SCHEMA_GET_RESOURCE_OAUTH2_TOKEN_OUTPUT.members[ - "sessionStatus" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_RESOURCE_OAUTH2_TOKEN_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_RESOURCE_OAUTH2_TOKEN = APIOperation( - input=GetResourceOauth2TokenInput, - output=GetResourceOauth2TokenOutput, - schema=_SCHEMA_GET_RESOURCE_OAUTH2_TOKEN, - input_schema=_SCHEMA_GET_RESOURCE_OAUTH2_TOKEN_INPUT, - output_schema=_SCHEMA_GET_RESOURCE_OAUTH2_TOKEN_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#UnauthorizedException" - ): UnauthorizedException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class PaymentHttpMethodType(UnknownEnumMixin, StrEnum): - GET = "GET" - POST = "POST" - PUT = "PUT" - DELETE = "DELETE" - PATCH = "PATCH" - - -@dataclass(kw_only=True) -class CoinbaseCdpTokenRequestInput: - """Coinbase CDP token request parameters.""" - - request_method: str - """The HTTP method for the payment API request.""" - - request_path: str - """The path of the payment API request.""" - - request_host: str | None = None - """ - The host for the payment API request. Defaults to - \"api.cdp.coinbase.com\". - """ - - include_wallet_auth_token: bool = False - """ - Set to true for wallet write operations (requires walletSecret - configured). - """ - - request_body: str | None = None - """Request body JSON --- used to generate wallet auth JWT.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_COINBASE_CDP_TOKEN_REQUEST_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_COINBASE_CDP_TOKEN_REQUEST_INPUT.members["requestMethod"], - self.request_method, - ) - if self.request_host is not None: - serializer.write_string( - _SCHEMA_COINBASE_CDP_TOKEN_REQUEST_INPUT.members["requestHost"], - self.request_host, - ) - - serializer.write_string( - _SCHEMA_COINBASE_CDP_TOKEN_REQUEST_INPUT.members["requestPath"], - self.request_path, - ) - serializer.write_boolean( - _SCHEMA_COINBASE_CDP_TOKEN_REQUEST_INPUT.members["includeWalletAuthToken"], - self.include_wallet_auth_token, - ) - if self.request_body is not None: - serializer.write_string( - _SCHEMA_COINBASE_CDP_TOKEN_REQUEST_INPUT.members["requestBody"], - self.request_body, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["request_method"] = PaymentHttpMethodType( - de.read_string( - _SCHEMA_COINBASE_CDP_TOKEN_REQUEST_INPUT.members[ - "requestMethod" - ] - ) - ) - - case 1: - kwargs["request_host"] = de.read_string( - _SCHEMA_COINBASE_CDP_TOKEN_REQUEST_INPUT.members["requestHost"] - ) - - case 2: - kwargs["request_path"] = de.read_string( - _SCHEMA_COINBASE_CDP_TOKEN_REQUEST_INPUT.members["requestPath"] - ) - - case 3: - kwargs["include_wallet_auth_token"] = de.read_boolean( - _SCHEMA_COINBASE_CDP_TOKEN_REQUEST_INPUT.members[ - "includeWalletAuthToken" - ] - ) - - case 4: - kwargs["request_body"] = de.read_string( - _SCHEMA_COINBASE_CDP_TOKEN_REQUEST_INPUT.members["requestBody"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_COINBASE_CDP_TOKEN_REQUEST_INPUT, consumer=_consumer - ) - if "request_method" not in kwargs: - kwargs["request_method"] = PaymentHttpMethodType._corrected("") - if "request_path" not in kwargs: - kwargs["request_path"] = "" - return kwargs - - -@dataclass(kw_only=True) -class StripePrivyTokenRequestInput: - """Stripe Privy token request parameters.""" - - request_path: str - """The path of the Stripe Privy API request.""" - - request_body: str = field(repr=False) - """Request body JSON for the Privy API call.""" - - request_host: str | None = None - """The host for the Privy API request. Defaults to \"api.privy.io\".""" - - include_authorization_signature: bool = False - """Set to true to generate privy-authorization-signature.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STRIPE_PRIVY_TOKEN_REQUEST_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.request_host is not None: - serializer.write_string( - _SCHEMA_STRIPE_PRIVY_TOKEN_REQUEST_INPUT.members["requestHost"], - self.request_host, - ) - - serializer.write_string( - _SCHEMA_STRIPE_PRIVY_TOKEN_REQUEST_INPUT.members["requestPath"], - self.request_path, - ) - serializer.write_string( - _SCHEMA_STRIPE_PRIVY_TOKEN_REQUEST_INPUT.members["requestBody"], - self.request_body, - ) - serializer.write_boolean( - _SCHEMA_STRIPE_PRIVY_TOKEN_REQUEST_INPUT.members[ - "includeAuthorizationSignature" - ], - self.include_authorization_signature, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["request_host"] = de.read_string( - _SCHEMA_STRIPE_PRIVY_TOKEN_REQUEST_INPUT.members["requestHost"] - ) - - case 1: - kwargs["request_path"] = de.read_string( - _SCHEMA_STRIPE_PRIVY_TOKEN_REQUEST_INPUT.members["requestPath"] - ) - - case 2: - kwargs["request_body"] = de.read_string( - _SCHEMA_STRIPE_PRIVY_TOKEN_REQUEST_INPUT.members["requestBody"] - ) - - case 3: - kwargs["include_authorization_signature"] = de.read_boolean( - _SCHEMA_STRIPE_PRIVY_TOKEN_REQUEST_INPUT.members[ - "includeAuthorizationSignature" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_STRIPE_PRIVY_TOKEN_REQUEST_INPUT, consumer=_consumer - ) - if "request_path" not in kwargs: - kwargs["request_path"] = "" - if "request_body" not in kwargs: - kwargs["request_body"] = "" - return kwargs - - -@dataclass -class PaymentTokenRequestInputCoinbaseCdpTokenRequest: - """The Coinbase CDP token request.""" - - value: CoinbaseCdpTokenRequestInput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PAYMENT_TOKEN_REQUEST_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_PAYMENT_TOKEN_REQUEST_INPUT.members["coinbaseCdpTokenRequest"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=CoinbaseCdpTokenRequestInput.deserialize(deserializer)) - - -@dataclass -class PaymentTokenRequestInputStripePrivyTokenRequest: - """The Stripe Privy token request.""" - - value: StripePrivyTokenRequestInput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PAYMENT_TOKEN_REQUEST_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_PAYMENT_TOKEN_REQUEST_INPUT.members["stripePrivyTokenRequest"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=StripePrivyTokenRequestInput.deserialize(deserializer)) - - -@dataclass -class PaymentTokenRequestInputUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -PaymentTokenRequestInput = Union[ - PaymentTokenRequestInputCoinbaseCdpTokenRequest - | PaymentTokenRequestInputStripePrivyTokenRequest - | PaymentTokenRequestInputUnknown -] -"""Vendor-specific token request configuration.""" - - -class _PaymentTokenRequestInputDeserializer: - _result: PaymentTokenRequestInput | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> PaymentTokenRequestInput: - self._result = None - deserializer.read_struct(_SCHEMA_PAYMENT_TOKEN_REQUEST_INPUT, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - PaymentTokenRequestInputCoinbaseCdpTokenRequest.deserialize(de) - ) - - case 1: - self._set_result( - PaymentTokenRequestInputStripePrivyTokenRequest.deserialize(de) - ) - - case _: - self._set_result( - PaymentTokenRequestInputUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: PaymentTokenRequestInput) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class GetResourcePaymentTokenInput: - """Dataclass for GetResourcePaymentTokenInput structure.""" - - workload_identity_token: str | None = field(repr=False, default=None) - """Workload access token for authorization.""" - - resource_credential_provider_name: str | None = None - """Name of the payment credential provider to use.""" - - payment_token_request: PaymentTokenRequestInput | None = None - """ - Vendor-specific token request input. Contains all request parameters in - a type-safe, vendor-specific structure. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_RESOURCE_PAYMENT_TOKEN_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.workload_identity_token is not None: - serializer.write_string( - _SCHEMA_GET_RESOURCE_PAYMENT_TOKEN_INPUT.members[ - "workloadIdentityToken" - ], - self.workload_identity_token, - ) - - if self.resource_credential_provider_name is not None: - serializer.write_string( - _SCHEMA_GET_RESOURCE_PAYMENT_TOKEN_INPUT.members[ - "resourceCredentialProviderName" - ], - self.resource_credential_provider_name, - ) - - if self.payment_token_request is not None: - serializer.write_struct( - _SCHEMA_GET_RESOURCE_PAYMENT_TOKEN_INPUT.members["paymentTokenRequest"], - self.payment_token_request, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["workload_identity_token"] = de.read_string( - _SCHEMA_GET_RESOURCE_PAYMENT_TOKEN_INPUT.members[ - "workloadIdentityToken" - ] - ) - - case 1: - kwargs["resource_credential_provider_name"] = de.read_string( - _SCHEMA_GET_RESOURCE_PAYMENT_TOKEN_INPUT.members[ - "resourceCredentialProviderName" - ] - ) - - case 2: - kwargs["payment_token_request"] = ( - _PaymentTokenRequestInputDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_RESOURCE_PAYMENT_TOKEN_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CoinbaseCdpTokenResponseOutput: - """Coinbase CDP token response.""" - - bearer_token: str = field(repr=False) - """Bearer Token for Authorization header.""" - - wallet_auth_token: str | None = field(repr=False, default=None) - """Wallet Auth Token for X-Wallet-Auth header.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_COINBASE_CDP_TOKEN_RESPONSE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_COINBASE_CDP_TOKEN_RESPONSE_OUTPUT.members["bearerToken"], - self.bearer_token, - ) - if self.wallet_auth_token is not None: - serializer.write_string( - _SCHEMA_COINBASE_CDP_TOKEN_RESPONSE_OUTPUT.members["walletAuthToken"], - self.wallet_auth_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bearer_token"] = de.read_string( - _SCHEMA_COINBASE_CDP_TOKEN_RESPONSE_OUTPUT.members[ - "bearerToken" - ] - ) - - case 1: - kwargs["wallet_auth_token"] = de.read_string( - _SCHEMA_COINBASE_CDP_TOKEN_RESPONSE_OUTPUT.members[ - "walletAuthToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_COINBASE_CDP_TOKEN_RESPONSE_OUTPUT, consumer=_consumer - ) - if "bearer_token" not in kwargs: - kwargs["bearer_token"] = "" - return kwargs - - -@dataclass(kw_only=True) -class StripePrivyTokenResponseOutput: - """ - Stripe Privy token response containing appId, basicAuthToken, and - optionally authorizationSignature. - """ - - app_id: str - """The Privy app ID for the privy-app-id header.""" - - basic_auth_token: str = field(repr=False) - """ - Base64-encoded Basic Auth token (appId:appSecret) for the Authorization - header. - """ - - authorization_signature: str | None = field(repr=False, default=None) - """ - Base64-encoded ECDSA P-256 authorization signature (only present when - includeAuthorizationSignature is true). - """ - - request_expiry: int | None = None - """Unix timestamp in milliseconds when the authorization signature expires.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STRIPE_PRIVY_TOKEN_RESPONSE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.authorization_signature is not None: - serializer.write_string( - _SCHEMA_STRIPE_PRIVY_TOKEN_RESPONSE_OUTPUT.members[ - "authorizationSignature" - ], - self.authorization_signature, - ) - - if self.request_expiry is not None: - serializer.write_long( - _SCHEMA_STRIPE_PRIVY_TOKEN_RESPONSE_OUTPUT.members["requestExpiry"], - self.request_expiry, - ) - - serializer.write_string( - _SCHEMA_STRIPE_PRIVY_TOKEN_RESPONSE_OUTPUT.members["appId"], self.app_id - ) - serializer.write_string( - _SCHEMA_STRIPE_PRIVY_TOKEN_RESPONSE_OUTPUT.members["basicAuthToken"], - self.basic_auth_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["authorization_signature"] = de.read_string( - _SCHEMA_STRIPE_PRIVY_TOKEN_RESPONSE_OUTPUT.members[ - "authorizationSignature" - ] - ) - - case 1: - kwargs["request_expiry"] = de.read_long( - _SCHEMA_STRIPE_PRIVY_TOKEN_RESPONSE_OUTPUT.members[ - "requestExpiry" - ] - ) - - case 2: - kwargs["app_id"] = de.read_string( - _SCHEMA_STRIPE_PRIVY_TOKEN_RESPONSE_OUTPUT.members["appId"] - ) - - case 3: - kwargs["basic_auth_token"] = de.read_string( - _SCHEMA_STRIPE_PRIVY_TOKEN_RESPONSE_OUTPUT.members[ - "basicAuthToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_STRIPE_PRIVY_TOKEN_RESPONSE_OUTPUT, consumer=_consumer - ) - if "app_id" not in kwargs: - kwargs["app_id"] = "" - if "basic_auth_token" not in kwargs: - kwargs["basic_auth_token"] = "" - return kwargs - - -@dataclass -class PaymentTokenResponseOutputCoinbaseCdpTokenResponse: - """The Coinbase CDP token response.""" - - value: CoinbaseCdpTokenResponseOutput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PAYMENT_TOKEN_RESPONSE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_PAYMENT_TOKEN_RESPONSE_OUTPUT.members["coinbaseCdpTokenResponse"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=CoinbaseCdpTokenResponseOutput.deserialize(deserializer)) - - -@dataclass -class PaymentTokenResponseOutputStripePrivyTokenResponse: - """The Stripe Privy token response.""" - - value: StripePrivyTokenResponseOutput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PAYMENT_TOKEN_RESPONSE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_PAYMENT_TOKEN_RESPONSE_OUTPUT.members["stripePrivyTokenResponse"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=StripePrivyTokenResponseOutput.deserialize(deserializer)) - - -@dataclass -class PaymentTokenResponseOutputUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -PaymentTokenResponseOutput = Union[ - PaymentTokenResponseOutputCoinbaseCdpTokenResponse - | PaymentTokenResponseOutputStripePrivyTokenResponse - | PaymentTokenResponseOutputUnknown -] -"""Vendor-specific token response configuration.""" - - -class _PaymentTokenResponseOutputDeserializer: - _result: PaymentTokenResponseOutput | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> PaymentTokenResponseOutput: - self._result = None - deserializer.read_struct(_SCHEMA_PAYMENT_TOKEN_RESPONSE_OUTPUT, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - PaymentTokenResponseOutputCoinbaseCdpTokenResponse.deserialize(de) - ) - - case 1: - self._set_result( - PaymentTokenResponseOutputStripePrivyTokenResponse.deserialize(de) - ) - - case _: - self._set_result( - PaymentTokenResponseOutputUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: PaymentTokenResponseOutput) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class GetResourcePaymentTokenOutput: - """Dataclass for GetResourcePaymentTokenOutput structure.""" - - payment_token_response: PaymentTokenResponseOutput - """ - Vendor-specific token response output. Contains all response data in a - type-safe, vendor-specific structure. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_RESOURCE_PAYMENT_TOKEN_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_RESOURCE_PAYMENT_TOKEN_OUTPUT.members["paymentTokenResponse"], - self.payment_token_response, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["payment_token_response"] = ( - _PaymentTokenResponseOutputDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_RESOURCE_PAYMENT_TOKEN_OUTPUT, consumer=_consumer - ) - if "payment_token_response" not in kwargs: - kwargs["payment_token_response"] = PaymentTokenResponseOutputUnknown(tag="") - return kwargs - - -GET_RESOURCE_PAYMENT_TOKEN = APIOperation( - input=GetResourcePaymentTokenInput, - output=GetResourcePaymentTokenOutput, - schema=_SCHEMA_GET_RESOURCE_PAYMENT_TOKEN, - input_schema=_SCHEMA_GET_RESOURCE_PAYMENT_TOKEN_INPUT, - output_schema=_SCHEMA_GET_RESOURCE_PAYMENT_TOKEN_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#UnauthorizedException" - ): UnauthorizedException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetWorkloadAccessTokenInput: - """Dataclass for GetWorkloadAccessTokenInput structure.""" - - workload_name: str | None = None - """The unique identifier for the registered workload.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_WORKLOAD_ACCESS_TOKEN_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.workload_name is not None: - serializer.write_string( - _SCHEMA_GET_WORKLOAD_ACCESS_TOKEN_INPUT.members["workloadName"], - self.workload_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["workload_name"] = de.read_string( - _SCHEMA_GET_WORKLOAD_ACCESS_TOKEN_INPUT.members["workloadName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_WORKLOAD_ACCESS_TOKEN_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetWorkloadAccessTokenOutput: - """Dataclass for GetWorkloadAccessTokenOutput structure.""" - - workload_access_token: str = field(repr=False) - """ - An opaque token representing the identity of both the workload and the - user. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_WORKLOAD_ACCESS_TOKEN_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_WORKLOAD_ACCESS_TOKEN_OUTPUT.members["workloadAccessToken"], - self.workload_access_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["workload_access_token"] = de.read_string( - _SCHEMA_GET_WORKLOAD_ACCESS_TOKEN_OUTPUT.members[ - "workloadAccessToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_WORKLOAD_ACCESS_TOKEN_OUTPUT, consumer=_consumer - ) - if "workload_access_token" not in kwargs: - kwargs["workload_access_token"] = "" - return kwargs - - -GET_WORKLOAD_ACCESS_TOKEN = APIOperation( - input=GetWorkloadAccessTokenInput, - output=GetWorkloadAccessTokenOutput, - schema=_SCHEMA_GET_WORKLOAD_ACCESS_TOKEN, - input_schema=_SCHEMA_GET_WORKLOAD_ACCESS_TOKEN_INPUT, - output_schema=_SCHEMA_GET_WORKLOAD_ACCESS_TOKEN_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#UnauthorizedException" - ): UnauthorizedException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetWorkloadAccessTokenForJWTInput: - """Dataclass for GetWorkloadAccessTokenForJWTInput structure.""" - - workload_name: str | None = None - """The unique identifier for the registered workload.""" - - user_token: str | None = field(repr=False, default=None) - """The OAuth 2.0 token issued by the user's identity provider.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_WORKLOAD_ACCESS_TOKEN_FOR_JWT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.workload_name is not None: - serializer.write_string( - _SCHEMA_GET_WORKLOAD_ACCESS_TOKEN_FOR_JWT_INPUT.members["workloadName"], - self.workload_name, - ) - - if self.user_token is not None: - serializer.write_string( - _SCHEMA_GET_WORKLOAD_ACCESS_TOKEN_FOR_JWT_INPUT.members["userToken"], - self.user_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["workload_name"] = de.read_string( - _SCHEMA_GET_WORKLOAD_ACCESS_TOKEN_FOR_JWT_INPUT.members[ - "workloadName" - ] - ) - - case 1: - kwargs["user_token"] = de.read_string( - _SCHEMA_GET_WORKLOAD_ACCESS_TOKEN_FOR_JWT_INPUT.members[ - "userToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_WORKLOAD_ACCESS_TOKEN_FOR_JWT_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetWorkloadAccessTokenForJWTOutput: - """Dataclass for GetWorkloadAccessTokenForJWTOutput structure.""" - - workload_access_token: str = field(repr=False) - """ - An opaque token representing the identity of both the workload and the - user. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_WORKLOAD_ACCESS_TOKEN_FOR_JWT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_WORKLOAD_ACCESS_TOKEN_FOR_JWT_OUTPUT.members[ - "workloadAccessToken" - ], - self.workload_access_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["workload_access_token"] = de.read_string( - _SCHEMA_GET_WORKLOAD_ACCESS_TOKEN_FOR_JWT_OUTPUT.members[ - "workloadAccessToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_WORKLOAD_ACCESS_TOKEN_FOR_JWT_OUTPUT, consumer=_consumer - ) - if "workload_access_token" not in kwargs: - kwargs["workload_access_token"] = "" - return kwargs - - -GET_WORKLOAD_ACCESS_TOKEN_FOR_JWT = APIOperation( - input=GetWorkloadAccessTokenForJWTInput, - output=GetWorkloadAccessTokenForJWTOutput, - schema=_SCHEMA_GET_WORKLOAD_ACCESS_TOKEN_FOR_JWT, - input_schema=_SCHEMA_GET_WORKLOAD_ACCESS_TOKEN_FOR_JWT_INPUT, - output_schema=_SCHEMA_GET_WORKLOAD_ACCESS_TOKEN_FOR_JWT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#UnauthorizedException" - ): UnauthorizedException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetWorkloadAccessTokenForUserIdInput: - """Dataclass for GetWorkloadAccessTokenForUserIdInput structure.""" - - workload_name: str | None = None - """ - The name of the workload from which you want to retrieve the access - token. - """ - - user_id: str | None = None - """The ID of the user for whom you are retrieving the access token.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_WORKLOAD_ACCESS_TOKEN_FOR_USER_ID_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.workload_name is not None: - serializer.write_string( - _SCHEMA_GET_WORKLOAD_ACCESS_TOKEN_FOR_USER_ID_INPUT.members[ - "workloadName" - ], - self.workload_name, - ) - - if self.user_id is not None: - serializer.write_string( - _SCHEMA_GET_WORKLOAD_ACCESS_TOKEN_FOR_USER_ID_INPUT.members["userId"], - self.user_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["workload_name"] = de.read_string( - _SCHEMA_GET_WORKLOAD_ACCESS_TOKEN_FOR_USER_ID_INPUT.members[ - "workloadName" - ] - ) - - case 1: - kwargs["user_id"] = de.read_string( - _SCHEMA_GET_WORKLOAD_ACCESS_TOKEN_FOR_USER_ID_INPUT.members[ - "userId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_WORKLOAD_ACCESS_TOKEN_FOR_USER_ID_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetWorkloadAccessTokenForUserIdOutput: - """Dataclass for GetWorkloadAccessTokenForUserIdOutput structure.""" - - workload_access_token: str = field(repr=False) - """The access token for the specified workload.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_WORKLOAD_ACCESS_TOKEN_FOR_USER_ID_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_WORKLOAD_ACCESS_TOKEN_FOR_USER_ID_OUTPUT.members[ - "workloadAccessToken" - ], - self.workload_access_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["workload_access_token"] = de.read_string( - _SCHEMA_GET_WORKLOAD_ACCESS_TOKEN_FOR_USER_ID_OUTPUT.members[ - "workloadAccessToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_WORKLOAD_ACCESS_TOKEN_FOR_USER_ID_OUTPUT, consumer=_consumer - ) - if "workload_access_token" not in kwargs: - kwargs["workload_access_token"] = "" - return kwargs - - -GET_WORKLOAD_ACCESS_TOKEN_FOR_USER_ID = APIOperation( - input=GetWorkloadAccessTokenForUserIdInput, - output=GetWorkloadAccessTokenForUserIdOutput, - schema=_SCHEMA_GET_WORKLOAD_ACCESS_TOKEN_FOR_USER_ID, - input_schema=_SCHEMA_GET_WORKLOAD_ACCESS_TOKEN_FOR_USER_ID_INPUT, - output_schema=_SCHEMA_GET_WORKLOAD_ACCESS_TOKEN_FOR_USER_ID_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#UnauthorizedException" - ): UnauthorizedException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class InputContentBlock: - """A block of input content.""" - - path: str - """The path to the input content.""" - - text: str | None = None - """The text input content.""" - - blob: bytes | None = field(repr=False, default=None) - """The binary input content.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INPUT_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_INPUT_CONTENT_BLOCK.members["path"], self.path) - if self.text is not None: - serializer.write_string( - _SCHEMA_INPUT_CONTENT_BLOCK.members["text"], self.text - ) - - if self.blob is not None: - serializer.write_blob( - _SCHEMA_INPUT_CONTENT_BLOCK.members["blob"], self.blob - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["path"] = de.read_string( - _SCHEMA_INPUT_CONTENT_BLOCK.members["path"] - ) - - case 1: - kwargs["text"] = de.read_string( - _SCHEMA_INPUT_CONTENT_BLOCK.members["text"] - ) - - case 2: - kwargs["blob"] = de.read_blob( - _SCHEMA_INPUT_CONTENT_BLOCK.members["blob"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INPUT_CONTENT_BLOCK, consumer=_consumer) - if "path" not in kwargs: - kwargs["path"] = "" - return kwargs - - -def _serialize_input_content_block_list( - serializer: ShapeSerializer, schema: Schema, value: list[InputContentBlock] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_input_content_block_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[InputContentBlock]: - result: list[InputContentBlock] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(InputContentBlock.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class ProgrammingLanguage(UnknownEnumMixin, StrEnum): - PYTHON = "python" - JAVASCRIPT = "javascript" - TYPESCRIPT = "typescript" - - -def _serialize_string_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_string_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -class LanguageRuntime(UnknownEnumMixin, StrEnum): - NODEJS = "nodejs" - DENO = "deno" - PYTHON = "python" - - -@dataclass(kw_only=True) -class ToolArguments: - """ - The collection of arguments that specify the operation to perform and - its parameters when invoking a tool in Amazon Bedrock AgentCore. - Different tools require different arguments, and this structure provides - a flexible way to pass the appropriate arguments to each tool type. - """ - - code: str | None = None - """ - The code to execute in a code interpreter session. This is the source - code in the specified programming language that will be executed by the - code interpreter. - """ - - language: str | None = None - """ - The programming language of the code to execute. This tells the code - interpreter which language runtime to use for execution. - """ - - clear_context: bool | None = None - """Whether to clear the context for the tool.""" - - command: str | None = None - """The command to execute with the tool.""" - - path: str | None = None - """The path for the tool operation.""" - - paths: list[str] | None = None - """The paths for the tool operation.""" - - content: list[InputContentBlock] | None = None - """The content for the tool operation.""" - - directory_path: str | None = None - """The directory path for the tool operation.""" - - task_id: str | None = None - """The identifier of the task for the tool operation.""" - - runtime: str | None = None - """ - The runtime environment to use for code execution. If not specified, - defaults to `deno` for JavaScript and TypeScript. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_ARGUMENTS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.code is not None: - serializer.write_string(_SCHEMA_TOOL_ARGUMENTS.members["code"], self.code) - - if self.language is not None: - serializer.write_string( - _SCHEMA_TOOL_ARGUMENTS.members["language"], self.language - ) - - if self.clear_context is not None: - serializer.write_boolean( - _SCHEMA_TOOL_ARGUMENTS.members["clearContext"], self.clear_context - ) - - if self.command is not None: - serializer.write_string( - _SCHEMA_TOOL_ARGUMENTS.members["command"], self.command - ) - - if self.path is not None: - serializer.write_string(_SCHEMA_TOOL_ARGUMENTS.members["path"], self.path) - - if self.paths is not None: - _serialize_string_list( - serializer, _SCHEMA_TOOL_ARGUMENTS.members["paths"], self.paths - ) - - if self.content is not None: - _serialize_input_content_block_list( - serializer, _SCHEMA_TOOL_ARGUMENTS.members["content"], self.content - ) - - if self.directory_path is not None: - serializer.write_string( - _SCHEMA_TOOL_ARGUMENTS.members["directoryPath"], self.directory_path - ) - - if self.task_id is not None: - serializer.write_string( - _SCHEMA_TOOL_ARGUMENTS.members["taskId"], self.task_id - ) - - if self.runtime is not None: - serializer.write_string( - _SCHEMA_TOOL_ARGUMENTS.members["runtime"], self.runtime - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["code"] = de.read_string( - _SCHEMA_TOOL_ARGUMENTS.members["code"] - ) - - case 1: - kwargs["language"] = ProgrammingLanguage( - de.read_string(_SCHEMA_TOOL_ARGUMENTS.members["language"]) - ) - - case 2: - kwargs["clear_context"] = de.read_boolean( - _SCHEMA_TOOL_ARGUMENTS.members["clearContext"] - ) - - case 3: - kwargs["command"] = de.read_string( - _SCHEMA_TOOL_ARGUMENTS.members["command"] - ) - - case 4: - kwargs["path"] = de.read_string( - _SCHEMA_TOOL_ARGUMENTS.members["path"] - ) - - case 5: - kwargs["paths"] = _deserialize_string_list( - de, _SCHEMA_TOOL_ARGUMENTS.members["paths"] - ) - - case 6: - kwargs["content"] = _deserialize_input_content_block_list( - de, _SCHEMA_TOOL_ARGUMENTS.members["content"] - ) - - case 7: - kwargs["directory_path"] = de.read_string( - _SCHEMA_TOOL_ARGUMENTS.members["directoryPath"] - ) - - case 8: - kwargs["task_id"] = de.read_string( - _SCHEMA_TOOL_ARGUMENTS.members["taskId"] - ) - - case 9: - kwargs["runtime"] = LanguageRuntime( - de.read_string(_SCHEMA_TOOL_ARGUMENTS.members["runtime"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TOOL_ARGUMENTS, consumer=_consumer) - return kwargs - - -class ToolName(UnknownEnumMixin, StrEnum): - EXECUTE_CODE = "executeCode" - EXECUTE_COMMAND = "executeCommand" - READ_FILES = "readFiles" - LIST_FILES = "listFiles" - REMOVE_FILES = "removeFiles" - WRITE_FILES = "writeFiles" - START_COMMAND_EXECUTION = "startCommandExecution" - GET_TASK = "getTask" - STOP_TASK = "stopTask" - - -@dataclass(kw_only=True) -class InvokeCodeInterpreterInput: - """Dataclass for InvokeCodeInterpreterInput structure.""" - - code_interpreter_identifier: str | None = None - """ - The unique identifier of the code interpreter associated with the - session. This must match the identifier used when creating the session - with `StartCodeInterpreterSession`. - """ - - session_id: str | None = None - """ - The unique identifier of the code interpreter session to use. This must - be an active session created with `StartCodeInterpreterSession`. If the - session has expired or been stopped, the request will fail. - """ - - trace_id: str | None = None - """The trace identifier for request tracking.""" - - trace_parent: str | None = None - """The parent trace information for distributed tracing.""" - - name: str | None = None - """The name of the code interpreter to invoke.""" - - arguments: ToolArguments | None = None - """ - The arguments for the code interpreter. This includes the code to - execute and any additional parameters such as the programming language, - whether to clear the execution context, and other execution options. The - structure of this parameter depends on the specific code interpreter - being used. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOKE_CODE_INTERPRETER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.code_interpreter_identifier is not None: - serializer.write_string( - _SCHEMA_INVOKE_CODE_INTERPRETER_INPUT.members[ - "codeInterpreterIdentifier" - ], - self.code_interpreter_identifier, - ) - - if self.session_id is not None: - serializer.write_string( - _SCHEMA_INVOKE_CODE_INTERPRETER_INPUT.members["sessionId"], - self.session_id, - ) - - if self.trace_id is not None: - serializer.write_string( - _SCHEMA_INVOKE_CODE_INTERPRETER_INPUT.members["traceId"], self.trace_id - ) - - if self.trace_parent is not None: - serializer.write_string( - _SCHEMA_INVOKE_CODE_INTERPRETER_INPUT.members["traceParent"], - self.trace_parent, - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_INVOKE_CODE_INTERPRETER_INPUT.members["name"], self.name - ) - - if self.arguments is not None: - serializer.write_struct( - _SCHEMA_INVOKE_CODE_INTERPRETER_INPUT.members["arguments"], - self.arguments, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["code_interpreter_identifier"] = de.read_string( - _SCHEMA_INVOKE_CODE_INTERPRETER_INPUT.members[ - "codeInterpreterIdentifier" - ] - ) - - case 1: - kwargs["session_id"] = de.read_string( - _SCHEMA_INVOKE_CODE_INTERPRETER_INPUT.members["sessionId"] - ) - - case 2: - kwargs["trace_id"] = de.read_string( - _SCHEMA_INVOKE_CODE_INTERPRETER_INPUT.members["traceId"] - ) - - case 3: - kwargs["trace_parent"] = de.read_string( - _SCHEMA_INVOKE_CODE_INTERPRETER_INPUT.members["traceParent"] - ) - - case 4: - kwargs["name"] = ToolName( - de.read_string( - _SCHEMA_INVOKE_CODE_INTERPRETER_INPUT.members["name"] - ) - ) - - case 5: - kwargs["arguments"] = ToolArguments.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVOKE_CODE_INTERPRETER_INPUT, consumer=_consumer - ) - return kwargs - - -class ResourceContentType(UnknownEnumMixin, StrEnum): - TEXT = "text" - BLOB = "blob" - - -@dataclass(kw_only=True) -class ResourceContent: - """Contains information about resource content.""" - - type: str - """The type of resource content.""" - - uri: str | None = None - """The URI of the resource content.""" - - mime_type: str | None = None - """The MIME type of the resource content.""" - - text: str | None = None - """The text resource content.""" - - blob: bytes | None = None - """The binary resource content.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESOURCE_CONTENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_RESOURCE_CONTENT.members["type"], self.type) - if self.uri is not None: - serializer.write_string(_SCHEMA_RESOURCE_CONTENT.members["uri"], self.uri) - - if self.mime_type is not None: - serializer.write_string( - _SCHEMA_RESOURCE_CONTENT.members["mimeType"], self.mime_type - ) - - if self.text is not None: - serializer.write_string(_SCHEMA_RESOURCE_CONTENT.members["text"], self.text) - - if self.blob is not None: - serializer.write_blob(_SCHEMA_RESOURCE_CONTENT.members["blob"], self.blob) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = ResourceContentType( - de.read_string(_SCHEMA_RESOURCE_CONTENT.members["type"]) - ) - - case 1: - kwargs["uri"] = de.read_string( - _SCHEMA_RESOURCE_CONTENT.members["uri"] - ) - - case 2: - kwargs["mime_type"] = de.read_string( - _SCHEMA_RESOURCE_CONTENT.members["mimeType"] - ) - - case 3: - kwargs["text"] = de.read_string( - _SCHEMA_RESOURCE_CONTENT.members["text"] - ) - - case 4: - kwargs["blob"] = de.read_blob( - _SCHEMA_RESOURCE_CONTENT.members["blob"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RESOURCE_CONTENT, consumer=_consumer) - if "type" not in kwargs: - kwargs["type"] = ResourceContentType._corrected("") - return kwargs - - -class ContentBlockType(UnknownEnumMixin, StrEnum): - TEXT = "text" - IMAGE = "image" - EMBEDDED_RESOURCE = "resource" - RESOURCE_LINK = "resource_link" - - -@dataclass(kw_only=True) -class ContentBlock: - """A block of content in a response.""" - - type: str - """The type of content in the block.""" - - text: str | None = None - """The text content of the block.""" - - data: bytes | None = None - """The binary data content of the block.""" - - mime_type: str | None = None - """The MIME type of the content.""" - - uri: str | None = None - """The URI of the content.""" - - name: str | None = None - """The name of the content block.""" - - description: str | None = None - """The description of the content block.""" - - size: int | None = None - """The size of the content in bytes.""" - - resource: ResourceContent | None = None - """The resource associated with the content block.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_CONTENT_BLOCK.members["type"], self.type) - if self.text is not None: - serializer.write_string(_SCHEMA_CONTENT_BLOCK.members["text"], self.text) - - if self.data is not None: - serializer.write_blob(_SCHEMA_CONTENT_BLOCK.members["data"], self.data) - - if self.mime_type is not None: - serializer.write_string( - _SCHEMA_CONTENT_BLOCK.members["mimeType"], self.mime_type - ) - - if self.uri is not None: - serializer.write_string(_SCHEMA_CONTENT_BLOCK.members["uri"], self.uri) - - if self.name is not None: - serializer.write_string(_SCHEMA_CONTENT_BLOCK.members["name"], self.name) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CONTENT_BLOCK.members["description"], self.description - ) - - if self.size is not None: - serializer.write_long(_SCHEMA_CONTENT_BLOCK.members["size"], self.size) - - if self.resource is not None: - serializer.write_struct( - _SCHEMA_CONTENT_BLOCK.members["resource"], self.resource - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = ContentBlockType( - de.read_string(_SCHEMA_CONTENT_BLOCK.members["type"]) - ) - - case 1: - kwargs["text"] = de.read_string( - _SCHEMA_CONTENT_BLOCK.members["text"] - ) - - case 2: - kwargs["data"] = de.read_blob(_SCHEMA_CONTENT_BLOCK.members["data"]) - - case 3: - kwargs["mime_type"] = de.read_string( - _SCHEMA_CONTENT_BLOCK.members["mimeType"] - ) - - case 4: - kwargs["uri"] = de.read_string(_SCHEMA_CONTENT_BLOCK.members["uri"]) - - case 5: - kwargs["name"] = de.read_string( - _SCHEMA_CONTENT_BLOCK.members["name"] - ) - - case 6: - kwargs["description"] = de.read_string( - _SCHEMA_CONTENT_BLOCK.members["description"] - ) - - case 7: - kwargs["size"] = de.read_long(_SCHEMA_CONTENT_BLOCK.members["size"]) - - case 8: - kwargs["resource"] = ResourceContent.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONTENT_BLOCK, consumer=_consumer) - if "type" not in kwargs: - kwargs["type"] = ContentBlockType._corrected("") - return kwargs - - -def _serialize_content_block_list( - serializer: ShapeSerializer, schema: Schema, value: list[ContentBlock] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_content_block_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ContentBlock]: - result: list[ContentBlock] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ContentBlock.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class TaskStatus(UnknownEnumMixin, StrEnum): - SUBMITTED = "submitted" - WORKING = "working" - COMPLETED = "completed" - CANCELED = "canceled" - FAILED = "failed" - - -@dataclass(kw_only=True) -class ToolResultStructuredContent: - """Contains structured content from a tool result.""" - - task_id: str | None = None - """The identifier of the task that produced the result.""" - - task_status: str | None = None - """The status of the task that produced the result.""" - - stdout: str | None = None - """The standard output from the tool execution.""" - - stderr: str | None = None - """The standard error output from the tool execution.""" - - exit_code: int | None = None - """The exit code from the tool execution.""" - - execution_time: float | None = None - """The execution time of the tool operation in milliseconds.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_RESULT_STRUCTURED_CONTENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.task_id is not None: - serializer.write_string( - _SCHEMA_TOOL_RESULT_STRUCTURED_CONTENT.members["taskId"], self.task_id - ) - - if self.task_status is not None: - serializer.write_string( - _SCHEMA_TOOL_RESULT_STRUCTURED_CONTENT.members["taskStatus"], - self.task_status, - ) - - if self.stdout is not None: - serializer.write_string( - _SCHEMA_TOOL_RESULT_STRUCTURED_CONTENT.members["stdout"], self.stdout - ) - - if self.stderr is not None: - serializer.write_string( - _SCHEMA_TOOL_RESULT_STRUCTURED_CONTENT.members["stderr"], self.stderr - ) - - if self.exit_code is not None: - serializer.write_integer( - _SCHEMA_TOOL_RESULT_STRUCTURED_CONTENT.members["exitCode"], - self.exit_code, - ) - - if self.execution_time is not None: - serializer.write_double( - _SCHEMA_TOOL_RESULT_STRUCTURED_CONTENT.members["executionTime"], - self.execution_time, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["task_id"] = de.read_string( - _SCHEMA_TOOL_RESULT_STRUCTURED_CONTENT.members["taskId"] - ) - - case 1: - kwargs["task_status"] = TaskStatus( - de.read_string( - _SCHEMA_TOOL_RESULT_STRUCTURED_CONTENT.members["taskStatus"] - ) - ) - - case 2: - kwargs["stdout"] = de.read_string( - _SCHEMA_TOOL_RESULT_STRUCTURED_CONTENT.members["stdout"] - ) - - case 3: - kwargs["stderr"] = de.read_string( - _SCHEMA_TOOL_RESULT_STRUCTURED_CONTENT.members["stderr"] - ) - - case 4: - kwargs["exit_code"] = de.read_integer( - _SCHEMA_TOOL_RESULT_STRUCTURED_CONTENT.members["exitCode"] - ) - - case 5: - kwargs["execution_time"] = de.read_double( - _SCHEMA_TOOL_RESULT_STRUCTURED_CONTENT.members["executionTime"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_TOOL_RESULT_STRUCTURED_CONTENT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CodeInterpreterResult: - """ - The output produced by executing code in a code interpreter session in - Amazon Bedrock AgentCore. This structure contains the results of code - execution, including textual output, structured data, and error - information. Agents use these results to generate responses that - incorporate computation, data analysis, and visualization. - """ - - content: list[ContentBlock] - """ - The textual content of the execution result. This includes standard - output from the code execution, such as print statements, console - output, and text representations of results. - """ - - structured_content: ToolResultStructuredContent | None = None - """ - The structured content of the execution result. This includes additional - metadata about the execution, such as execution time, memory usage, and - structured representations of output data. The format depends on the - specific code interpreter and execution context. - """ - - is_error: bool | None = None - """ - Indicates whether the result represents an error. If true, the content - contains error messages or exception information. If false, the content - contains successful execution results. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CODE_INTERPRETER_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_content_block_list( - serializer, _SCHEMA_CODE_INTERPRETER_RESULT.members["content"], self.content - ) - if self.structured_content is not None: - serializer.write_struct( - _SCHEMA_CODE_INTERPRETER_RESULT.members["structuredContent"], - self.structured_content, - ) - - if self.is_error is not None: - serializer.write_boolean( - _SCHEMA_CODE_INTERPRETER_RESULT.members["isError"], self.is_error - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["content"] = _deserialize_content_block_list( - de, _SCHEMA_CODE_INTERPRETER_RESULT.members["content"] - ) - - case 1: - kwargs["structured_content"] = ( - ToolResultStructuredContent.deserialize(de) - ) - - case 2: - kwargs["is_error"] = de.read_boolean( - _SCHEMA_CODE_INTERPRETER_RESULT.members["isError"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CODE_INTERPRETER_RESULT, consumer=_consumer) - if "content" not in kwargs: - kwargs["content"] = [] - return kwargs - - -@dataclass -class CodeInterpreterStreamOutputResult: - """ - The output produced by executing code in a code interpreter session in - Amazon Bedrock AgentCore. This structure contains the results of code - execution, including textual output, structured data, and error - information. Agents use these results to generate responses that - incorporate computation, data analysis, and visualization. - """ - - value: CodeInterpreterResult - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CODE_INTERPRETER_STREAM_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CODE_INTERPRETER_STREAM_OUTPUT.members["result"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=CodeInterpreterResult.deserialize(deserializer)) - - -@dataclass -class CodeInterpreterStreamOutputAccessDeniedException: - """ - The exception that occurs when you do not have sufficient permissions to - perform an action. Verify that your IAM policy includes the necessary - permissions for the operation you are trying to perform. - """ - - value: AccessDeniedException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CODE_INTERPRETER_STREAM_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CODE_INTERPRETER_STREAM_OUTPUT.members["accessDeniedException"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=AccessDeniedException.deserialize(deserializer)) - - -@dataclass -class CodeInterpreterStreamOutputConflictException: - """ - The exception that occurs when the request conflicts with the current - state of the resource. This can happen when trying to modify a resource - that is currently being modified by another request, or when trying to - create a resource that already exists. - """ - - value: ConflictException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CODE_INTERPRETER_STREAM_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CODE_INTERPRETER_STREAM_OUTPUT.members["conflictException"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ConflictException.deserialize(deserializer)) - - -@dataclass -class CodeInterpreterStreamOutputInternalServerException: - """ - The exception that occurs when the service encounters an unexpected - internal error. This is a temporary condition that will resolve itself - with retries. We recommend implementing exponential backoff retry logic - in your application. - """ - - value: InternalServerException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CODE_INTERPRETER_STREAM_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CODE_INTERPRETER_STREAM_OUTPUT.members["internalServerException"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=InternalServerException.deserialize(deserializer)) - - -@dataclass -class CodeInterpreterStreamOutputResourceNotFoundException: - """ - The exception that occurs when the specified resource does not exist. - This can happen when using an invalid identifier or when trying to - access a resource that has been deleted. - """ - - value: ResourceNotFoundException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CODE_INTERPRETER_STREAM_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CODE_INTERPRETER_STREAM_OUTPUT.members["resourceNotFoundException"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ResourceNotFoundException.deserialize(deserializer)) - - -@dataclass -class CodeInterpreterStreamOutputServiceQuotaExceededException: - """ - The exception that occurs when the request would cause a service quota - to be exceeded. Review your service quotas and either reduce your - request rate or request a quota increase. - """ - - value: ServiceQuotaExceededException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CODE_INTERPRETER_STREAM_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CODE_INTERPRETER_STREAM_OUTPUT.members[ - "serviceQuotaExceededException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ServiceQuotaExceededException.deserialize(deserializer)) - - -@dataclass -class CodeInterpreterStreamOutputThrottlingException: - """ - The exception that occurs when the request was denied due to request - throttling. This happens when you exceed the allowed request rate for an - operation. Reduce the frequency of requests or implement exponential - backoff retry logic in your application. - """ - - value: ThrottlingException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CODE_INTERPRETER_STREAM_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CODE_INTERPRETER_STREAM_OUTPUT.members["throttlingException"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ThrottlingException.deserialize(deserializer)) - - -@dataclass -class CodeInterpreterStreamOutputValidationException: - """ - The exception that occurs when the input fails to satisfy the - constraints specified by the service. Check the error message for - details about which input parameter is invalid and correct your request. - """ - - value: ValidationException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CODE_INTERPRETER_STREAM_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CODE_INTERPRETER_STREAM_OUTPUT.members["validationException"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ValidationException.deserialize(deserializer)) - - -@dataclass -class CodeInterpreterStreamOutputUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -CodeInterpreterStreamOutput = Union[ - CodeInterpreterStreamOutputResult - | CodeInterpreterStreamOutputAccessDeniedException - | CodeInterpreterStreamOutputConflictException - | CodeInterpreterStreamOutputInternalServerException - | CodeInterpreterStreamOutputResourceNotFoundException - | CodeInterpreterStreamOutputServiceQuotaExceededException - | CodeInterpreterStreamOutputThrottlingException - | CodeInterpreterStreamOutputValidationException - | CodeInterpreterStreamOutputUnknown -] -"""Contains output from a code interpreter stream.""" - - -class _CodeInterpreterStreamOutputDeserializer: - _result: CodeInterpreterStreamOutput | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> CodeInterpreterStreamOutput: - self._result = None - deserializer.read_struct(_SCHEMA_CODE_INTERPRETER_STREAM_OUTPUT, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(CodeInterpreterStreamOutputResult.deserialize(de)) - - case 1: - self._set_result( - CodeInterpreterStreamOutputAccessDeniedException.deserialize(de) - ) - - case 2: - self._set_result( - CodeInterpreterStreamOutputConflictException.deserialize(de) - ) - - case 3: - self._set_result( - CodeInterpreterStreamOutputInternalServerException.deserialize(de) - ) - - case 4: - self._set_result( - CodeInterpreterStreamOutputResourceNotFoundException.deserialize(de) - ) - - case 5: - self._set_result( - CodeInterpreterStreamOutputServiceQuotaExceededException.deserialize( - de - ) - ) - - case 6: - self._set_result( - CodeInterpreterStreamOutputThrottlingException.deserialize(de) - ) - - case 7: - self._set_result( - CodeInterpreterStreamOutputValidationException.deserialize(de) - ) - - case _: - self._set_result( - CodeInterpreterStreamOutputUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: CodeInterpreterStreamOutput) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class InvokeCodeInterpreterOutput: - """Dataclass for InvokeCodeInterpreterOutput structure.""" - - session_id: str | None = None - """The identifier of the code interpreter session.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOKE_CODE_INTERPRETER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.session_id is not None: - serializer.write_string( - _SCHEMA_INVOKE_CODE_INTERPRETER_OUTPUT.members["sessionId"], - self.session_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["session_id"] = de.read_string( - _SCHEMA_INVOKE_CODE_INTERPRETER_OUTPUT.members["sessionId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVOKE_CODE_INTERPRETER_OUTPUT, consumer=_consumer - ) - return kwargs - - -INVOKE_CODE_INTERPRETER = APIOperation( - input=InvokeCodeInterpreterInput, - output=InvokeCodeInterpreterOutput, - schema=_SCHEMA_INVOKE_CODE_INTERPRETER, - input_schema=_SCHEMA_INVOKE_CODE_INTERPRETER_INPUT, - output_schema=_SCHEMA_INVOKE_CODE_INTERPRETER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -def _serialize_harness_allowed_tools( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_harness_allowed_tools( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class HarnessReasoningTextBlock: - """A block of reasoning text from the model.""" - - text: str - """The reasoning text.""" - - signature: str | None = None - """Signature for verifying the reasoning content.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_REASONING_TEXT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_REASONING_TEXT_BLOCK.members["text"], self.text - ) - if self.signature is not None: - serializer.write_string( - _SCHEMA_HARNESS_REASONING_TEXT_BLOCK.members["signature"], - self.signature, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["text"] = de.read_string( - _SCHEMA_HARNESS_REASONING_TEXT_BLOCK.members["text"] - ) - - case 1: - kwargs["signature"] = de.read_string( - _SCHEMA_HARNESS_REASONING_TEXT_BLOCK.members["signature"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_HARNESS_REASONING_TEXT_BLOCK, consumer=_consumer - ) - if "text" not in kwargs: - kwargs["text"] = "" - return kwargs - - -@dataclass -class HarnessReasoningContentBlockReasoningText: - """The reasoning text.""" - - value: HarnessReasoningTextBlock - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_REASONING_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_REASONING_CONTENT_BLOCK.members["reasoningText"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HarnessReasoningTextBlock.deserialize(deserializer)) - - -@dataclass -class HarnessReasoningContentBlockRedactedContent: - """Redacted reasoning content.""" - - value: bytes - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_REASONING_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_blob( - _SCHEMA_HARNESS_REASONING_CONTENT_BLOCK.members["redactedContent"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_blob( - _SCHEMA_HARNESS_REASONING_CONTENT_BLOCK.members["redactedContent"] - ) - ) - - -@dataclass -class HarnessReasoningContentBlockUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -HarnessReasoningContentBlock = Union[ - HarnessReasoningContentBlockReasoningText - | HarnessReasoningContentBlockRedactedContent - | HarnessReasoningContentBlockUnknown -] -"""Reasoning content from the model.""" - - -class _HarnessReasoningContentBlockDeserializer: - _result: HarnessReasoningContentBlock | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> HarnessReasoningContentBlock: - self._result = None - deserializer.read_struct( - _SCHEMA_HARNESS_REASONING_CONTENT_BLOCK, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - HarnessReasoningContentBlockReasoningText.deserialize(de) - ) - - case 1: - self._set_result( - HarnessReasoningContentBlockRedactedContent.deserialize(de) - ) - - case _: - self._set_result( - HarnessReasoningContentBlockUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: HarnessReasoningContentBlock) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass -class HarnessToolResultContentBlockText: - """Text content.""" - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_TOOL_RESULT_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_TOOL_RESULT_CONTENT_BLOCK.members["text"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string( - _SCHEMA_HARNESS_TOOL_RESULT_CONTENT_BLOCK.members["text"] - ) - ) - - -@dataclass -class HarnessToolResultContentBlockJson: - """JSON content.""" - - value: Document - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_TOOL_RESULT_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_document( - _SCHEMA_HARNESS_TOOL_RESULT_CONTENT_BLOCK.members["json"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_document( - _SCHEMA_HARNESS_TOOL_RESULT_CONTENT_BLOCK.members["json"] - ) - ) - - -@dataclass -class HarnessToolResultContentBlockUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -HarnessToolResultContentBlock = Union[ - HarnessToolResultContentBlockText - | HarnessToolResultContentBlockJson - | HarnessToolResultContentBlockUnknown -] -"""A content block within a tool result.""" - - -class _HarnessToolResultContentBlockDeserializer: - _result: HarnessToolResultContentBlock | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> HarnessToolResultContentBlock: - self._result = None - deserializer.read_struct( - _SCHEMA_HARNESS_TOOL_RESULT_CONTENT_BLOCK, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(HarnessToolResultContentBlockText.deserialize(de)) - - case 1: - self._set_result(HarnessToolResultContentBlockJson.deserialize(de)) - - case _: - self._set_result( - HarnessToolResultContentBlockUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: HarnessToolResultContentBlock) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_harness_tool_result_content_blocks( - serializer: ShapeSerializer, - schema: Schema, - value: list[HarnessToolResultContentBlock], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_harness_tool_result_content_blocks( - deserializer: ShapeDeserializer, schema: Schema -) -> list[HarnessToolResultContentBlock]: - result: list[HarnessToolResultContentBlock] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_HarnessToolResultContentBlockDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class HarnessToolUseStatus(UnknownEnumMixin, StrEnum): - SUCCESS = "success" - ERROR = "error" - - -class HarnessToolUseType(UnknownEnumMixin, StrEnum): - TOOL_USE = "tool_use" - SERVER_TOOL_USE = "server_tool_use" - MCP_TOOL_USE = "mcp_tool_use" - - -@dataclass(kw_only=True) -class HarnessToolResultBlock: - """The result of a tool execution.""" - - tool_use_id: str - """The tool use ID that this result corresponds to.""" - - content: list[HarnessToolResultContentBlock] - """The content of the tool result.""" - - status: str | None = None - """The status of the tool execution.""" - - type: str | None = None - """The type of tool use that produced this result.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_TOOL_RESULT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_TOOL_RESULT_BLOCK.members["toolUseId"], self.tool_use_id - ) - _serialize_harness_tool_result_content_blocks( - serializer, - _SCHEMA_HARNESS_TOOL_RESULT_BLOCK.members["content"], - self.content, - ) - if self.status is not None: - serializer.write_string( - _SCHEMA_HARNESS_TOOL_RESULT_BLOCK.members["status"], self.status - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_HARNESS_TOOL_RESULT_BLOCK.members["type"], self.type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["tool_use_id"] = de.read_string( - _SCHEMA_HARNESS_TOOL_RESULT_BLOCK.members["toolUseId"] - ) - - case 1: - kwargs["content"] = _deserialize_harness_tool_result_content_blocks( - de, _SCHEMA_HARNESS_TOOL_RESULT_BLOCK.members["content"] - ) - - case 2: - kwargs["status"] = HarnessToolUseStatus( - de.read_string( - _SCHEMA_HARNESS_TOOL_RESULT_BLOCK.members["status"] - ) - ) - - case 3: - kwargs["type"] = HarnessToolUseType( - de.read_string( - _SCHEMA_HARNESS_TOOL_RESULT_BLOCK.members["type"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_HARNESS_TOOL_RESULT_BLOCK, consumer=_consumer) - if "tool_use_id" not in kwargs: - kwargs["tool_use_id"] = "" - if "content" not in kwargs: - kwargs["content"] = [] - return kwargs - - -@dataclass(kw_only=True) -class HarnessToolUseBlock: - """A tool use request from the model.""" - - name: str - """The name of the tool to call.""" - - tool_use_id: str - """The unique ID of this tool use.""" - - input: Document = field(repr=False) - """The JSON input to pass to the tool.""" - - type: str | None = None - """The type of tool use.""" - - server_name: str | None = None - """The name of the MCP server providing this tool.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_TOOL_USE_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_TOOL_USE_BLOCK.members["name"], self.name - ) - serializer.write_string( - _SCHEMA_HARNESS_TOOL_USE_BLOCK.members["toolUseId"], self.tool_use_id - ) - serializer.write_document( - _SCHEMA_HARNESS_TOOL_USE_BLOCK.members["input"], self.input - ) - if self.type is not None: - serializer.write_string( - _SCHEMA_HARNESS_TOOL_USE_BLOCK.members["type"], self.type - ) - - if self.server_name is not None: - serializer.write_string( - _SCHEMA_HARNESS_TOOL_USE_BLOCK.members["serverName"], self.server_name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_HARNESS_TOOL_USE_BLOCK.members["name"] - ) - - case 1: - kwargs["tool_use_id"] = de.read_string( - _SCHEMA_HARNESS_TOOL_USE_BLOCK.members["toolUseId"] - ) - - case 2: - kwargs["input"] = de.read_document( - _SCHEMA_HARNESS_TOOL_USE_BLOCK.members["input"] - ) - - case 3: - kwargs["type"] = HarnessToolUseType( - de.read_string(_SCHEMA_HARNESS_TOOL_USE_BLOCK.members["type"]) - ) - - case 4: - kwargs["server_name"] = de.read_string( - _SCHEMA_HARNESS_TOOL_USE_BLOCK.members["serverName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_HARNESS_TOOL_USE_BLOCK, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "tool_use_id" not in kwargs: - kwargs["tool_use_id"] = "" - if "input" not in kwargs: - kwargs["input"] = Document(None) - return kwargs - - -@dataclass -class HarnessContentBlockText: - """Text content.""" - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_CONTENT_BLOCK.members["text"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string( - _SCHEMA_HARNESS_CONTENT_BLOCK.members["text"] - ) - ) - - -@dataclass -class HarnessContentBlockToolUse: - """A tool use request from the model.""" - - value: HarnessToolUseBlock - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_CONTENT_BLOCK.members["toolUse"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HarnessToolUseBlock.deserialize(deserializer)) - - -@dataclass -class HarnessContentBlockToolResult: - """A tool execution result.""" - - value: HarnessToolResultBlock - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_CONTENT_BLOCK.members["toolResult"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HarnessToolResultBlock.deserialize(deserializer)) - - -@dataclass -class HarnessContentBlockReasoningContent: - """Model reasoning content.""" - - value: HarnessReasoningContentBlock - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_CONTENT_BLOCK.members["reasoningContent"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_HarnessReasoningContentBlockDeserializer().deserialize(deserializer) - ) - - -@dataclass -class HarnessContentBlockUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -HarnessContentBlock = Union[ - HarnessContentBlockText - | HarnessContentBlockToolUse - | HarnessContentBlockToolResult - | HarnessContentBlockReasoningContent - | HarnessContentBlockUnknown -] -"""A content block within a message.""" - - -class _HarnessContentBlockDeserializer: - _result: HarnessContentBlock | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> HarnessContentBlock: - self._result = None - deserializer.read_struct(_SCHEMA_HARNESS_CONTENT_BLOCK, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(HarnessContentBlockText.deserialize(de)) - - case 1: - self._set_result(HarnessContentBlockToolUse.deserialize(de)) - - case 2: - self._set_result(HarnessContentBlockToolResult.deserialize(de)) - - case 3: - self._set_result(HarnessContentBlockReasoningContent.deserialize(de)) - - case _: - self._set_result( - HarnessContentBlockUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: HarnessContentBlock) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_harness_content_blocks( - serializer: ShapeSerializer, schema: Schema, value: list[HarnessContentBlock] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_harness_content_blocks( - deserializer: ShapeDeserializer, schema: Schema -) -> list[HarnessContentBlock]: - result: list[HarnessContentBlock] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_HarnessContentBlockDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class HarnessConversationRole(UnknownEnumMixin, StrEnum): - USER = "user" - ASSISTANT = "assistant" - - -@dataclass(kw_only=True) -class HarnessMessage: - """A message in the conversation.""" - - role: str - """The role of the message sender.""" - - content: list[HarnessContentBlock] - """The content blocks of the message.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_MESSAGE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_HARNESS_MESSAGE.members["role"], self.role) - _serialize_harness_content_blocks( - serializer, _SCHEMA_HARNESS_MESSAGE.members["content"], self.content - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["role"] = HarnessConversationRole( - de.read_string(_SCHEMA_HARNESS_MESSAGE.members["role"]) - ) - - case 1: - kwargs["content"] = _deserialize_harness_content_blocks( - de, _SCHEMA_HARNESS_MESSAGE.members["content"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_HARNESS_MESSAGE, consumer=_consumer) - if "role" not in kwargs: - kwargs["role"] = HarnessConversationRole._corrected("") - if "content" not in kwargs: - kwargs["content"] = [] - return kwargs - - -def _serialize_harness_messages( - serializer: ShapeSerializer, schema: Schema, value: list[HarnessMessage] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_harness_messages( - deserializer: ShapeDeserializer, schema: Schema -) -> list[HarnessMessage]: - result: list[HarnessMessage] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(HarnessMessage.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class HarnessBedrockApiFormat(UnknownEnumMixin, StrEnum): - CONVERSE_STREAM = "converse_stream" - """Use the Bedrock Converse Stream API format.""" - RESPONSES = "responses" - """Use the Responses API format.""" - CHAT_COMPLETIONS = "chat_completions" - """Use the Chat Completions API format.""" - - -@dataclass(kw_only=True) -class HarnessBedrockModelConfig: - """Configuration for an Amazon Bedrock model provider.""" - - model_id: str - """The Bedrock model ID.""" - - max_tokens: int | None = None - """ - The maximum number of tokens to allow in the generated response per - iteration. - """ - - temperature: float | None = None - """The temperature to set when calling the model.""" - - top_p: float | None = None - """The topP set when calling the model.""" - - api_format: str | None = None - """The API format to use when calling the Bedrock provider.""" - - additional_params: Document | None = None - """ - Provider-specific parameters passed through to the model provider - unchanged. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_BEDROCK_MODEL_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_BEDROCK_MODEL_CONFIG.members["modelId"], self.model_id - ) - if self.max_tokens is not None: - serializer.write_integer( - _SCHEMA_HARNESS_BEDROCK_MODEL_CONFIG.members["maxTokens"], - self.max_tokens, - ) - - if self.temperature is not None: - serializer.write_float( - _SCHEMA_HARNESS_BEDROCK_MODEL_CONFIG.members["temperature"], - self.temperature, - ) - - if self.top_p is not None: - serializer.write_float( - _SCHEMA_HARNESS_BEDROCK_MODEL_CONFIG.members["topP"], self.top_p - ) - - if self.api_format is not None: - serializer.write_string( - _SCHEMA_HARNESS_BEDROCK_MODEL_CONFIG.members["apiFormat"], - self.api_format, - ) - - if self.additional_params is not None: - serializer.write_document( - _SCHEMA_HARNESS_BEDROCK_MODEL_CONFIG.members["additionalParams"], - self.additional_params, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_id"] = de.read_string( - _SCHEMA_HARNESS_BEDROCK_MODEL_CONFIG.members["modelId"] - ) - - case 1: - kwargs["max_tokens"] = de.read_integer( - _SCHEMA_HARNESS_BEDROCK_MODEL_CONFIG.members["maxTokens"] - ) - - case 2: - kwargs["temperature"] = de.read_float( - _SCHEMA_HARNESS_BEDROCK_MODEL_CONFIG.members["temperature"] - ) - - case 3: - kwargs["top_p"] = de.read_float( - _SCHEMA_HARNESS_BEDROCK_MODEL_CONFIG.members["topP"] - ) - - case 4: - kwargs["api_format"] = HarnessBedrockApiFormat( - de.read_string( - _SCHEMA_HARNESS_BEDROCK_MODEL_CONFIG.members["apiFormat"] - ) - ) - - case 5: - kwargs["additional_params"] = de.read_document( - _SCHEMA_HARNESS_BEDROCK_MODEL_CONFIG.members["additionalParams"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_HARNESS_BEDROCK_MODEL_CONFIG, consumer=_consumer - ) - if "model_id" not in kwargs: - kwargs["model_id"] = "" - return kwargs - - -@dataclass(kw_only=True) -class HarnessGeminiModelConfig: - """ - Configuration for a Google Gemini model provider. Requires an API key - stored in AgentCore Identity. - """ - - model_id: str - """The Gemini model ID.""" - - api_key_arn: str - """The ARN of your Gemini API key on AgentCore Identity.""" - - max_tokens: int | None = None - """ - The maximum number of tokens to allow in the generated response per - iteration. - """ - - temperature: float | None = None - """The temperature to set when calling the model.""" - - top_p: float | None = None - """The topP set when calling the model.""" - - top_k: int | None = None - """The topK set when calling the model.""" - - additional_params: Document | None = None - """ - Provider-specific parameters passed through to the Gemini model provider - unchanged. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_GEMINI_MODEL_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_GEMINI_MODEL_CONFIG.members["modelId"], self.model_id - ) - serializer.write_string( - _SCHEMA_HARNESS_GEMINI_MODEL_CONFIG.members["apiKeyArn"], self.api_key_arn - ) - if self.max_tokens is not None: - serializer.write_integer( - _SCHEMA_HARNESS_GEMINI_MODEL_CONFIG.members["maxTokens"], - self.max_tokens, - ) - - if self.temperature is not None: - serializer.write_float( - _SCHEMA_HARNESS_GEMINI_MODEL_CONFIG.members["temperature"], - self.temperature, - ) - - if self.top_p is not None: - serializer.write_float( - _SCHEMA_HARNESS_GEMINI_MODEL_CONFIG.members["topP"], self.top_p - ) - - if self.top_k is not None: - serializer.write_integer( - _SCHEMA_HARNESS_GEMINI_MODEL_CONFIG.members["topK"], self.top_k - ) - - if self.additional_params is not None: - serializer.write_document( - _SCHEMA_HARNESS_GEMINI_MODEL_CONFIG.members["additionalParams"], - self.additional_params, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_id"] = de.read_string( - _SCHEMA_HARNESS_GEMINI_MODEL_CONFIG.members["modelId"] - ) - - case 1: - kwargs["api_key_arn"] = de.read_string( - _SCHEMA_HARNESS_GEMINI_MODEL_CONFIG.members["apiKeyArn"] - ) - - case 2: - kwargs["max_tokens"] = de.read_integer( - _SCHEMA_HARNESS_GEMINI_MODEL_CONFIG.members["maxTokens"] - ) - - case 3: - kwargs["temperature"] = de.read_float( - _SCHEMA_HARNESS_GEMINI_MODEL_CONFIG.members["temperature"] - ) - - case 4: - kwargs["top_p"] = de.read_float( - _SCHEMA_HARNESS_GEMINI_MODEL_CONFIG.members["topP"] - ) - - case 5: - kwargs["top_k"] = de.read_integer( - _SCHEMA_HARNESS_GEMINI_MODEL_CONFIG.members["topK"] - ) - - case 6: - kwargs["additional_params"] = de.read_document( - _SCHEMA_HARNESS_GEMINI_MODEL_CONFIG.members["additionalParams"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_HARNESS_GEMINI_MODEL_CONFIG, consumer=_consumer - ) - if "model_id" not in kwargs: - kwargs["model_id"] = "" - if "api_key_arn" not in kwargs: - kwargs["api_key_arn"] = "" - return kwargs - - -@dataclass(kw_only=True) -class HarnessLiteLlmModelConfig: - """ - Configuration for a LiteLLM model provider, enabling connection to - third-party model providers. - """ - - model_id: str - """The LiteLLM model identifier (e.g., \"anthropic/claude-3-sonnet\").""" - - api_key_arn: str | None = None - """ - The ARN of the API key in AgentCore Identity for authenticating with the - model provider. - """ - - api_base: str | None = field(repr=False, default=None) - """The base URL for the model provider's API endpoint.""" - - max_tokens: int | None = None - """ - The maximum number of tokens to allow in the generated response per - iteration. - """ - - temperature: float | None = None - """The temperature to set when calling the model.""" - - top_p: float | None = None - """The topP set when calling the model.""" - - additional_params: Document | None = None - """ - Provider-specific parameters passed through to the model provider - unchanged. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_LITE_LLM_MODEL_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_LITE_LLM_MODEL_CONFIG.members["modelId"], self.model_id - ) - if self.api_key_arn is not None: - serializer.write_string( - _SCHEMA_HARNESS_LITE_LLM_MODEL_CONFIG.members["apiKeyArn"], - self.api_key_arn, - ) - - if self.api_base is not None: - serializer.write_string( - _SCHEMA_HARNESS_LITE_LLM_MODEL_CONFIG.members["apiBase"], self.api_base - ) - - if self.max_tokens is not None: - serializer.write_integer( - _SCHEMA_HARNESS_LITE_LLM_MODEL_CONFIG.members["maxTokens"], - self.max_tokens, - ) - - if self.temperature is not None: - serializer.write_float( - _SCHEMA_HARNESS_LITE_LLM_MODEL_CONFIG.members["temperature"], - self.temperature, - ) - - if self.top_p is not None: - serializer.write_float( - _SCHEMA_HARNESS_LITE_LLM_MODEL_CONFIG.members["topP"], self.top_p - ) - - if self.additional_params is not None: - serializer.write_document( - _SCHEMA_HARNESS_LITE_LLM_MODEL_CONFIG.members["additionalParams"], - self.additional_params, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_id"] = de.read_string( - _SCHEMA_HARNESS_LITE_LLM_MODEL_CONFIG.members["modelId"] - ) - - case 1: - kwargs["api_key_arn"] = de.read_string( - _SCHEMA_HARNESS_LITE_LLM_MODEL_CONFIG.members["apiKeyArn"] - ) - - case 2: - kwargs["api_base"] = de.read_string( - _SCHEMA_HARNESS_LITE_LLM_MODEL_CONFIG.members["apiBase"] - ) - - case 3: - kwargs["max_tokens"] = de.read_integer( - _SCHEMA_HARNESS_LITE_LLM_MODEL_CONFIG.members["maxTokens"] - ) - - case 4: - kwargs["temperature"] = de.read_float( - _SCHEMA_HARNESS_LITE_LLM_MODEL_CONFIG.members["temperature"] - ) - - case 5: - kwargs["top_p"] = de.read_float( - _SCHEMA_HARNESS_LITE_LLM_MODEL_CONFIG.members["topP"] - ) - - case 6: - kwargs["additional_params"] = de.read_document( - _SCHEMA_HARNESS_LITE_LLM_MODEL_CONFIG.members[ - "additionalParams" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_HARNESS_LITE_LLM_MODEL_CONFIG, consumer=_consumer - ) - if "model_id" not in kwargs: - kwargs["model_id"] = "" - return kwargs - - -class HarnessOpenAiApiFormat(UnknownEnumMixin, StrEnum): - CHAT_COMPLETIONS = "chat_completions" - """Use the Chat Completions API format.""" - RESPONSES = "responses" - """Use the Responses API format.""" - - -@dataclass(kw_only=True) -class HarnessOpenAiModelConfig: - """ - Configuration for an OpenAI model provider. Requires an API key stored - in AgentCore Identity. - """ - - model_id: str - """The OpenAI model ID.""" - - api_key_arn: str - """The ARN of your OpenAI API key on AgentCore Identity.""" - - api_base: str | None = field(repr=False, default=None) - """Optional custom endpoint URL for an OpenAI-compatible endpoint.""" - - max_tokens: int | None = None - """ - The maximum number of tokens to allow in the generated response per - iteration. - """ - - temperature: float | None = None - """The temperature to set when calling the model.""" - - top_p: float | None = None - """The topP set when calling the model.""" - - api_format: str | None = None - """The API format to use when calling the OpenAI provider.""" - - additional_params: Document | None = None - """ - Provider-specific parameters passed through to the model provider - unchanged. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_OPEN_AI_MODEL_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_OPEN_AI_MODEL_CONFIG.members["modelId"], self.model_id - ) - serializer.write_string( - _SCHEMA_HARNESS_OPEN_AI_MODEL_CONFIG.members["apiKeyArn"], self.api_key_arn - ) - if self.api_base is not None: - serializer.write_string( - _SCHEMA_HARNESS_OPEN_AI_MODEL_CONFIG.members["apiBase"], self.api_base - ) - - if self.max_tokens is not None: - serializer.write_integer( - _SCHEMA_HARNESS_OPEN_AI_MODEL_CONFIG.members["maxTokens"], - self.max_tokens, - ) - - if self.temperature is not None: - serializer.write_float( - _SCHEMA_HARNESS_OPEN_AI_MODEL_CONFIG.members["temperature"], - self.temperature, - ) - - if self.top_p is not None: - serializer.write_float( - _SCHEMA_HARNESS_OPEN_AI_MODEL_CONFIG.members["topP"], self.top_p - ) - - if self.api_format is not None: - serializer.write_string( - _SCHEMA_HARNESS_OPEN_AI_MODEL_CONFIG.members["apiFormat"], - self.api_format, - ) - - if self.additional_params is not None: - serializer.write_document( - _SCHEMA_HARNESS_OPEN_AI_MODEL_CONFIG.members["additionalParams"], - self.additional_params, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_id"] = de.read_string( - _SCHEMA_HARNESS_OPEN_AI_MODEL_CONFIG.members["modelId"] - ) - - case 1: - kwargs["api_key_arn"] = de.read_string( - _SCHEMA_HARNESS_OPEN_AI_MODEL_CONFIG.members["apiKeyArn"] - ) - - case 2: - kwargs["api_base"] = de.read_string( - _SCHEMA_HARNESS_OPEN_AI_MODEL_CONFIG.members["apiBase"] - ) - - case 3: - kwargs["max_tokens"] = de.read_integer( - _SCHEMA_HARNESS_OPEN_AI_MODEL_CONFIG.members["maxTokens"] - ) - - case 4: - kwargs["temperature"] = de.read_float( - _SCHEMA_HARNESS_OPEN_AI_MODEL_CONFIG.members["temperature"] - ) - - case 5: - kwargs["top_p"] = de.read_float( - _SCHEMA_HARNESS_OPEN_AI_MODEL_CONFIG.members["topP"] - ) - - case 6: - kwargs["api_format"] = HarnessOpenAiApiFormat( - de.read_string( - _SCHEMA_HARNESS_OPEN_AI_MODEL_CONFIG.members["apiFormat"] - ) - ) - - case 7: - kwargs["additional_params"] = de.read_document( - _SCHEMA_HARNESS_OPEN_AI_MODEL_CONFIG.members["additionalParams"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_HARNESS_OPEN_AI_MODEL_CONFIG, consumer=_consumer - ) - if "model_id" not in kwargs: - kwargs["model_id"] = "" - if "api_key_arn" not in kwargs: - kwargs["api_key_arn"] = "" - return kwargs - - -@dataclass -class HarnessModelConfigurationBedrockModelConfig: - """Configuration for an Amazon Bedrock model.""" - - value: HarnessBedrockModelConfig - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_MODEL_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_MODEL_CONFIGURATION.members["bedrockModelConfig"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HarnessBedrockModelConfig.deserialize(deserializer)) - - -@dataclass -class HarnessModelConfigurationOpenAiModelConfig: - """Configuration for an OpenAI model.""" - - value: HarnessOpenAiModelConfig - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_MODEL_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_MODEL_CONFIGURATION.members["openAiModelConfig"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HarnessOpenAiModelConfig.deserialize(deserializer)) - - -@dataclass -class HarnessModelConfigurationGeminiModelConfig: - """Configuration for a Google Gemini model.""" - - value: HarnessGeminiModelConfig - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_MODEL_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_MODEL_CONFIGURATION.members["geminiModelConfig"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HarnessGeminiModelConfig.deserialize(deserializer)) - - -@dataclass -class HarnessModelConfigurationLiteLlmModelConfig: - """ - The LiteLLM model configuration for connecting to third-party model - providers. - """ - - value: HarnessLiteLlmModelConfig - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_MODEL_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_MODEL_CONFIGURATION.members["liteLlmModelConfig"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HarnessLiteLlmModelConfig.deserialize(deserializer)) - - -@dataclass -class HarnessModelConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -HarnessModelConfiguration = Union[ - HarnessModelConfigurationBedrockModelConfig - | HarnessModelConfigurationOpenAiModelConfig - | HarnessModelConfigurationGeminiModelConfig - | HarnessModelConfigurationLiteLlmModelConfig - | HarnessModelConfigurationUnknown -] -"""Specification of which model to use.""" - - -class _HarnessModelConfigurationDeserializer: - _result: HarnessModelConfiguration | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> HarnessModelConfiguration: - self._result = None - deserializer.read_struct(_SCHEMA_HARNESS_MODEL_CONFIGURATION, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - HarnessModelConfigurationBedrockModelConfig.deserialize(de) - ) - - case 1: - self._set_result( - HarnessModelConfigurationOpenAiModelConfig.deserialize(de) - ) - - case 2: - self._set_result( - HarnessModelConfigurationGeminiModelConfig.deserialize(de) - ) - - case 3: - self._set_result( - HarnessModelConfigurationLiteLlmModelConfig.deserialize(de) - ) - - case _: - self._set_result( - HarnessModelConfigurationUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: HarnessModelConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_harness_aws_skill_paths( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_harness_aws_skill_paths( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class HarnessSkillAwsSkillsSource: - """Passed to show that AWS Skills should be included.""" - - paths: list[str] | None = None - """ - Optionally filter allowed skills with glob syntax, e.g., - ['core-skills/*']. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_SKILL_AWS_SKILLS_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.paths is not None: - _serialize_harness_aws_skill_paths( - serializer, - _SCHEMA_HARNESS_SKILL_AWS_SKILLS_SOURCE.members["paths"], - self.paths, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["paths"] = _deserialize_harness_aws_skill_paths( - de, _SCHEMA_HARNESS_SKILL_AWS_SKILLS_SOURCE.members["paths"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_HARNESS_SKILL_AWS_SKILLS_SOURCE, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class HarnessSkillGitAuth: - """Authentication configuration for accessing a private git repository.""" - - credential_arn: str - """ - The ARN of the credential in AgentCore Identity containing the password - or personal access token. - """ - - username: str | None = None - """Username for authentication. Defaults to 'oauth2' if not specified.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_SKILL_GIT_AUTH, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_SKILL_GIT_AUTH.members["credentialArn"], self.credential_arn - ) - if self.username is not None: - serializer.write_string( - _SCHEMA_HARNESS_SKILL_GIT_AUTH.members["username"], self.username - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["credential_arn"] = de.read_string( - _SCHEMA_HARNESS_SKILL_GIT_AUTH.members["credentialArn"] - ) - - case 1: - kwargs["username"] = de.read_string( - _SCHEMA_HARNESS_SKILL_GIT_AUTH.members["username"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_HARNESS_SKILL_GIT_AUTH, consumer=_consumer) - if "credential_arn" not in kwargs: - kwargs["credential_arn"] = "" - return kwargs - - -@dataclass(kw_only=True) -class HarnessSkillGitSource: - """A git repository source for a skill.""" - - url: str - """The HTTPS URL of the git repository.""" - - path: str | None = None - """Subdirectory within the repository containing the skill.""" - - auth: HarnessSkillGitAuth | None = None - """Authentication configuration for private repositories.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_SKILL_GIT_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_SKILL_GIT_SOURCE.members["url"], self.url - ) - if self.path is not None: - serializer.write_string( - _SCHEMA_HARNESS_SKILL_GIT_SOURCE.members["path"], self.path - ) - - if self.auth is not None: - serializer.write_struct( - _SCHEMA_HARNESS_SKILL_GIT_SOURCE.members["auth"], self.auth - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["url"] = de.read_string( - _SCHEMA_HARNESS_SKILL_GIT_SOURCE.members["url"] - ) - - case 1: - kwargs["path"] = de.read_string( - _SCHEMA_HARNESS_SKILL_GIT_SOURCE.members["path"] - ) - - case 2: - kwargs["auth"] = HarnessSkillGitAuth.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_HARNESS_SKILL_GIT_SOURCE, consumer=_consumer) - if "url" not in kwargs: - kwargs["url"] = "" - return kwargs - - -@dataclass(kw_only=True) -class HarnessSkillS3Source: - """An S3 source for a skill.""" - - uri: str - """ - The S3 URI pointing to the skill directory (e.g., - s3://bucket/skills/my-skill/). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_SKILL_S3_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_SKILL_S3_SOURCE.members["uri"], self.uri - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["uri"] = de.read_string( - _SCHEMA_HARNESS_SKILL_S3_SOURCE.members["uri"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_HARNESS_SKILL_S3_SOURCE, consumer=_consumer) - if "uri" not in kwargs: - kwargs["uri"] = "" - return kwargs - - -@dataclass -class HarnessSkillPath: - """The filesystem path to the skill definition.""" - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_SKILL, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_HARNESS_SKILL.members["path"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string(_SCHEMA_HARNESS_SKILL.members["path"]) - ) - - -@dataclass -class HarnessSkillS3: - """An S3 source containing the skill.""" - - value: HarnessSkillS3Source - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_SKILL, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_SKILL.members["s3"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HarnessSkillS3Source.deserialize(deserializer)) - - -@dataclass -class HarnessSkillGit: - """A git repository containing the skill.""" - - value: HarnessSkillGitSource - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_SKILL, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_SKILL.members["git"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HarnessSkillGitSource.deserialize(deserializer)) - - -@dataclass -class HarnessSkillAwsSkills: - """AWS Skills baked into the Harness's underlying Runtime.""" - - value: HarnessSkillAwsSkillsSource - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_SKILL, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_SKILL.members["awsSkills"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HarnessSkillAwsSkillsSource.deserialize(deserializer)) - - -@dataclass -class HarnessSkillUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -HarnessSkill = Union[ - HarnessSkillPath - | HarnessSkillS3 - | HarnessSkillGit - | HarnessSkillAwsSkills - | HarnessSkillUnknown -] -"""A skill available to the agent.""" - - -class _HarnessSkillDeserializer: - _result: HarnessSkill | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> HarnessSkill: - self._result = None - deserializer.read_struct(_SCHEMA_HARNESS_SKILL, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(HarnessSkillPath.deserialize(de)) - - case 1: - self._set_result(HarnessSkillS3.deserialize(de)) - - case 2: - self._set_result(HarnessSkillGit.deserialize(de)) - - case 3: - self._set_result(HarnessSkillAwsSkills.deserialize(de)) - - case _: - self._set_result(HarnessSkillUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: HarnessSkill) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_harness_skills( - serializer: ShapeSerializer, schema: Schema, value: list[HarnessSkill] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_harness_skills( - deserializer: ShapeDeserializer, schema: Schema -) -> list[HarnessSkill]: - result: list[HarnessSkill] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_HarnessSkillDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass -class HarnessSystemContentBlockText: - """The text content of the system prompt block.""" - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_SYSTEM_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_SYSTEM_CONTENT_BLOCK.members["text"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string( - _SCHEMA_HARNESS_SYSTEM_CONTENT_BLOCK.members["text"] - ) - ) - - -@dataclass -class HarnessSystemContentBlockUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -HarnessSystemContentBlock = Union[ - HarnessSystemContentBlockText | HarnessSystemContentBlockUnknown -] -"""A content block in the system prompt.""" - - -class _HarnessSystemContentBlockDeserializer: - _result: HarnessSystemContentBlock | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> HarnessSystemContentBlock: - self._result = None - deserializer.read_struct(_SCHEMA_HARNESS_SYSTEM_CONTENT_BLOCK, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(HarnessSystemContentBlockText.deserialize(de)) - - case _: - self._set_result( - HarnessSystemContentBlockUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: HarnessSystemContentBlock) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_harness_system_prompt( - serializer: ShapeSerializer, schema: Schema, value: list[HarnessSystemContentBlock] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_harness_system_prompt( - deserializer: ShapeDeserializer, schema: Schema -) -> list[HarnessSystemContentBlock]: - result: list[HarnessSystemContentBlock] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_HarnessSystemContentBlockDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class HarnessAgentCoreBrowserConfig: - """Configuration for AgentCore Browser.""" - - browser_arn: str | None = None - """If not populated, the built-in Browser ARN is used.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_AGENT_CORE_BROWSER_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.browser_arn is not None: - serializer.write_string( - _SCHEMA_HARNESS_AGENT_CORE_BROWSER_CONFIG.members["browserArn"], - self.browser_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["browser_arn"] = de.read_string( - _SCHEMA_HARNESS_AGENT_CORE_BROWSER_CONFIG.members["browserArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_HARNESS_AGENT_CORE_BROWSER_CONFIG, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class HarnessAgentCoreCodeInterpreterConfig: - """Configuration for AgentCore Code Interpreter.""" - - code_interpreter_arn: str | None = None - """If not populated, the built-in Code Interpreter ARN is used.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_AGENT_CORE_CODE_INTERPRETER_CONFIG, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.code_interpreter_arn is not None: - serializer.write_string( - _SCHEMA_HARNESS_AGENT_CORE_CODE_INTERPRETER_CONFIG.members[ - "codeInterpreterArn" - ], - self.code_interpreter_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["code_interpreter_arn"] = de.read_string( - _SCHEMA_HARNESS_AGENT_CORE_CODE_INTERPRETER_CONFIG.members[ - "codeInterpreterArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_HARNESS_AGENT_CORE_CODE_INTERPRETER_CONFIG, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class Unit: - """Dataclass for Unit structure.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNIT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UNIT, consumer=_consumer) - return kwargs - - -def _serialize_o_auth_custom_parameters( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_o_auth_custom_parameters( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -class OAuthGrantType(UnknownEnumMixin, StrEnum): - CLIENT_CREDENTIALS = "CLIENT_CREDENTIALS" - AUTHORIZATION_CODE = "AUTHORIZATION_CODE" - TOKEN_EXCHANGE = "TOKEN_EXCHANGE" - - -def _serialize_o_auth_scopes( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_o_auth_scopes( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class OAuthCredentialProvider: - """ - Configuration for an OAuth 2.0 credential provider used to authenticate - tool calls. - """ - - provider_arn: str - """The ARN of the OAuth 2.0 credential provider in AgentCore Identity.""" - - scopes: list[str] - """The OAuth 2.0 scopes to request when obtaining an access token.""" - - custom_parameters: dict[str, str] | None = None - """Additional custom parameters to include in the OAuth 2.0 token request.""" - - grant_type: str = OAuthGrantType("CLIENT_CREDENTIALS") - """The OAuth 2.0 grant type to use for authentication.""" - - default_return_url: str | None = None - """The default return URL for the OAuth 2.0 authorization flow.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_O_AUTH_CREDENTIAL_PROVIDER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_O_AUTH_CREDENTIAL_PROVIDER.members["providerArn"], self.provider_arn - ) - _serialize_o_auth_scopes( - serializer, - _SCHEMA_O_AUTH_CREDENTIAL_PROVIDER.members["scopes"], - self.scopes, - ) - if self.custom_parameters is not None: - _serialize_o_auth_custom_parameters( - serializer, - _SCHEMA_O_AUTH_CREDENTIAL_PROVIDER.members["customParameters"], - self.custom_parameters, - ) - - serializer.write_string( - _SCHEMA_O_AUTH_CREDENTIAL_PROVIDER.members["grantType"], self.grant_type - ) - if self.default_return_url is not None: - serializer.write_string( - _SCHEMA_O_AUTH_CREDENTIAL_PROVIDER.members["defaultReturnUrl"], - self.default_return_url, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["provider_arn"] = de.read_string( - _SCHEMA_O_AUTH_CREDENTIAL_PROVIDER.members["providerArn"] - ) - - case 1: - kwargs["scopes"] = _deserialize_o_auth_scopes( - de, _SCHEMA_O_AUTH_CREDENTIAL_PROVIDER.members["scopes"] - ) - - case 2: - kwargs["custom_parameters"] = _deserialize_o_auth_custom_parameters( - de, - _SCHEMA_O_AUTH_CREDENTIAL_PROVIDER.members["customParameters"], - ) - - case 3: - kwargs["grant_type"] = OAuthGrantType( - de.read_string( - _SCHEMA_O_AUTH_CREDENTIAL_PROVIDER.members["grantType"] - ) - ) - - case 4: - kwargs["default_return_url"] = de.read_string( - _SCHEMA_O_AUTH_CREDENTIAL_PROVIDER.members["defaultReturnUrl"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_O_AUTH_CREDENTIAL_PROVIDER, consumer=_consumer) - if "provider_arn" not in kwargs: - kwargs["provider_arn"] = "" - if "scopes" not in kwargs: - kwargs["scopes"] = [] - return kwargs - - -@dataclass -class HarnessGatewayOutboundAuthAwsIam: - """SigV4-sign requests using the agent's execution role.""" - - value: Unit - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_GATEWAY_OUTBOUND_AUTH, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_GATEWAY_OUTBOUND_AUTH.members["awsIam"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=Unit.deserialize(deserializer)) - - -@dataclass -class HarnessGatewayOutboundAuthNone: - """No authentication.""" - - value: Unit - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_GATEWAY_OUTBOUND_AUTH, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_GATEWAY_OUTBOUND_AUTH.members["none"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=Unit.deserialize(deserializer)) - - -@dataclass -class HarnessGatewayOutboundAuthOauth: - """OAuth 2.0 authentication via AgentCore Identity.""" - - value: OAuthCredentialProvider - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_GATEWAY_OUTBOUND_AUTH, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_GATEWAY_OUTBOUND_AUTH.members["oauth"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=OAuthCredentialProvider.deserialize(deserializer)) - - -@dataclass -class HarnessGatewayOutboundAuthUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -HarnessGatewayOutboundAuth = Union[ - HarnessGatewayOutboundAuthAwsIam - | HarnessGatewayOutboundAuthNone - | HarnessGatewayOutboundAuthOauth - | HarnessGatewayOutboundAuthUnknown -] -"""Authentication method for calling a Gateway.""" - - -class _HarnessGatewayOutboundAuthDeserializer: - _result: HarnessGatewayOutboundAuth | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> HarnessGatewayOutboundAuth: - self._result = None - deserializer.read_struct(_SCHEMA_HARNESS_GATEWAY_OUTBOUND_AUTH, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(HarnessGatewayOutboundAuthAwsIam.deserialize(de)) - - case 1: - self._set_result(HarnessGatewayOutboundAuthNone.deserialize(de)) - - case 2: - self._set_result(HarnessGatewayOutboundAuthOauth.deserialize(de)) - - case _: - self._set_result( - HarnessGatewayOutboundAuthUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: HarnessGatewayOutboundAuth) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class HarnessAgentCoreGatewayConfig: - """Configuration for AgentCore Gateway.""" - - gateway_arn: str - """The ARN of the desired AgentCore Gateway.""" - - outbound_auth: HarnessGatewayOutboundAuth | None = None - """ - How harness authenticates to this Gateway. Defaults to AWS_IAM (SigV4) - if omitted. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_AGENT_CORE_GATEWAY_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_AGENT_CORE_GATEWAY_CONFIG.members["gatewayArn"], - self.gateway_arn, - ) - if self.outbound_auth is not None: - serializer.write_struct( - _SCHEMA_HARNESS_AGENT_CORE_GATEWAY_CONFIG.members["outboundAuth"], - self.outbound_auth, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["gateway_arn"] = de.read_string( - _SCHEMA_HARNESS_AGENT_CORE_GATEWAY_CONFIG.members["gatewayArn"] - ) - - case 1: - kwargs["outbound_auth"] = ( - _HarnessGatewayOutboundAuthDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_HARNESS_AGENT_CORE_GATEWAY_CONFIG, consumer=_consumer - ) - if "gateway_arn" not in kwargs: - kwargs["gateway_arn"] = "" - return kwargs - - -@dataclass(kw_only=True) -class HarnessInlineFunctionConfig: - """ - Configuration for an inline function tool. When the agent calls this - tool, the tool call is returned to the caller for external execution. - """ - - description: str = field(repr=False) - """Description of what the tool does, provided to the model.""" - - input_schema: Document = field(repr=False) - """JSON Schema describing the tool's input parameters.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_INLINE_FUNCTION_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_INLINE_FUNCTION_CONFIG.members["description"], - self.description, - ) - serializer.write_document( - _SCHEMA_HARNESS_INLINE_FUNCTION_CONFIG.members["inputSchema"], - self.input_schema, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["description"] = de.read_string( - _SCHEMA_HARNESS_INLINE_FUNCTION_CONFIG.members["description"] - ) - - case 1: - kwargs["input_schema"] = de.read_document( - _SCHEMA_HARNESS_INLINE_FUNCTION_CONFIG.members["inputSchema"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_HARNESS_INLINE_FUNCTION_CONFIG, consumer=_consumer - ) - if "description" not in kwargs: - kwargs["description"] = "" - if "input_schema" not in kwargs: - kwargs["input_schema"] = Document(None) - return kwargs - - -def _serialize_http_headers_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_http_headers_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class HarnessRemoteMcpConfig: - """Configuration for connecting to a remote MCP server.""" - - url: str = field(repr=False) - """URL of the MCP endpoint.""" - - headers: dict[str, str] | None = field(repr=False, default=None) - """Custom headers to include when connecting to the remote MCP server.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_REMOTE_MCP_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_REMOTE_MCP_CONFIG.members["url"], self.url - ) - if self.headers is not None: - _serialize_http_headers_map( - serializer, - _SCHEMA_HARNESS_REMOTE_MCP_CONFIG.members["headers"], - self.headers, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["url"] = de.read_string( - _SCHEMA_HARNESS_REMOTE_MCP_CONFIG.members["url"] - ) - - case 1: - kwargs["headers"] = _deserialize_http_headers_map( - de, _SCHEMA_HARNESS_REMOTE_MCP_CONFIG.members["headers"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_HARNESS_REMOTE_MCP_CONFIG, consumer=_consumer) - if "url" not in kwargs: - kwargs["url"] = "" - return kwargs - - -@dataclass -class HarnessToolConfigurationRemoteMcp: - """Configuration for remote MCP server.""" - - value: HarnessRemoteMcpConfig - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_TOOL_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_TOOL_CONFIGURATION.members["remoteMcp"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HarnessRemoteMcpConfig.deserialize(deserializer)) - - -@dataclass -class HarnessToolConfigurationAgentCoreBrowser: - """Configuration for AgentCore Browser.""" - - value: HarnessAgentCoreBrowserConfig - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_TOOL_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_TOOL_CONFIGURATION.members["agentCoreBrowser"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HarnessAgentCoreBrowserConfig.deserialize(deserializer)) - - -@dataclass -class HarnessToolConfigurationAgentCoreGateway: - """Configuration for AgentCore Gateway.""" - - value: HarnessAgentCoreGatewayConfig - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_TOOL_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_TOOL_CONFIGURATION.members["agentCoreGateway"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HarnessAgentCoreGatewayConfig.deserialize(deserializer)) - - -@dataclass -class HarnessToolConfigurationInlineFunction: - """Configuration for an inline function tool.""" - - value: HarnessInlineFunctionConfig - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_TOOL_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_TOOL_CONFIGURATION.members["inlineFunction"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HarnessInlineFunctionConfig.deserialize(deserializer)) - - -@dataclass -class HarnessToolConfigurationAgentCoreCodeInterpreter: - """Configuration for AgentCore Code Interpreter.""" - - value: HarnessAgentCoreCodeInterpreterConfig - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_TOOL_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_TOOL_CONFIGURATION.members["agentCoreCodeInterpreter"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=HarnessAgentCoreCodeInterpreterConfig.deserialize(deserializer) - ) - - -@dataclass -class HarnessToolConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -HarnessToolConfiguration = Union[ - HarnessToolConfigurationRemoteMcp - | HarnessToolConfigurationAgentCoreBrowser - | HarnessToolConfigurationAgentCoreGateway - | HarnessToolConfigurationInlineFunction - | HarnessToolConfigurationAgentCoreCodeInterpreter - | HarnessToolConfigurationUnknown -] -"""Configuration union for different tool types.""" - - -class _HarnessToolConfigurationDeserializer: - _result: HarnessToolConfiguration | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> HarnessToolConfiguration: - self._result = None - deserializer.read_struct(_SCHEMA_HARNESS_TOOL_CONFIGURATION, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(HarnessToolConfigurationRemoteMcp.deserialize(de)) - - case 1: - self._set_result( - HarnessToolConfigurationAgentCoreBrowser.deserialize(de) - ) - - case 2: - self._set_result( - HarnessToolConfigurationAgentCoreGateway.deserialize(de) - ) - - case 3: - self._set_result(HarnessToolConfigurationInlineFunction.deserialize(de)) - - case 4: - self._set_result( - HarnessToolConfigurationAgentCoreCodeInterpreter.deserialize(de) - ) - - case _: - self._set_result( - HarnessToolConfigurationUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: HarnessToolConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class HarnessToolType(UnknownEnumMixin, StrEnum): - REMOTE_MCP = "remote_mcp" - AGENTCORE_BROWSER = "agentcore_browser" - AGENTCORE_GATEWAY = "agentcore_gateway" - INLINE_FUNCTION = "inline_function" - AGENTCORE_CODE_INTERPRETER = "agentcore_code_interpreter" - - -@dataclass(kw_only=True) -class HarnessTool: - """A tool available to the agent loop.""" - - type: str - """The type of tool.""" - - name: str | None = None - """ - Unique name for the tool. If not provided, a name will be inferred or - generated. - """ - - config: HarnessToolConfiguration | None = None - """Tool-specific configuration.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_TOOL, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_HARNESS_TOOL.members["type"], self.type) - if self.name is not None: - serializer.write_string(_SCHEMA_HARNESS_TOOL.members["name"], self.name) - - if self.config is not None: - serializer.write_struct(_SCHEMA_HARNESS_TOOL.members["config"], self.config) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = HarnessToolType( - de.read_string(_SCHEMA_HARNESS_TOOL.members["type"]) - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_HARNESS_TOOL.members["name"] - ) - - case 2: - kwargs["config"] = ( - _HarnessToolConfigurationDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_HARNESS_TOOL, consumer=_consumer) - if "type" not in kwargs: - kwargs["type"] = HarnessToolType._corrected("") - return kwargs - - -def _serialize_harness_tools( - serializer: ShapeSerializer, schema: Schema, value: list[HarnessTool] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_harness_tools( - deserializer: ShapeDeserializer, schema: Schema -) -> list[HarnessTool]: - result: list[HarnessTool] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(HarnessTool.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class InvokeHarnessInput: - """Dataclass for InvokeHarnessInput structure.""" - - harness_arn: str | None = None - """The ARN of the harness to invoke.""" - - qualifier: str | None = None - """The endpoint name to invoke. If omitted, the DEFAULT endpoint is used.""" - - runtime_session_id: str | None = None - """ - The session ID for the invocation. Use the same session ID across - requests to continue a conversation. - """ - - runtime_user_id: str | None = None - """ - An identifier for the end user making the request. This value is passed - through to the runtime container. - """ - - trace_parent: str | None = None - """ - W3C trace context parent header containing version, trace ID, parent - span ID, and trace flags. - """ - - trace_state: str | None = None - """W3C trace context state header for vendor-specific trace information.""" - - trace_id: str | None = None - """Trace ID for maintaining observability through the operation.""" - - baggage: str | None = None - """ - W3C Baggage header for user-defined context propagation. Format: - key1=value1,key2=value2 - """ - - messages: list[HarnessMessage] | None = None - """The messages to send to the agent.""" - - model: HarnessModelConfiguration | None = None - """ - The model configuration to use for this invocation. If specified, - overrides the harness default. - """ - - system_prompt: list[HarnessSystemContentBlock] | None = None - """ - The system prompt to use for this invocation. If specified, overrides - the harness default. - """ - - tools: list[HarnessTool] | None = None - """ - The tools available to the agent for this invocation. If specified, - overrides the harness default. - """ - - skills: list[HarnessSkill] | None = None - """ - The skills available to the agent for this invocation. If specified, - overrides the harness default. - """ - - allowed_tools: list[str] | None = None - """ - The tools that the agent is allowed to use for this invocation. If - specified, overrides the harness default. - """ - - max_iterations: int | None = None - """ - The maximum number of iterations the agent loop can execute. If - specified, overrides the harness default. - """ - - max_tokens: int | None = None - """ - The maximum number of tokens the agent can generate per iteration. If - specified, overrides the harness default. - """ - - timeout_seconds: int | None = None - """ - The maximum duration in seconds for the agent loop execution. If - specified, overrides the harness default. - """ - - actor_id: str | None = None - """ - The actor ID for memory operations. Overrides the actor ID configured on - the harness. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOKE_HARNESS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.harness_arn is not None: - serializer.write_string( - _SCHEMA_INVOKE_HARNESS_INPUT.members["harnessArn"], self.harness_arn - ) - - if self.qualifier is not None: - serializer.write_string( - _SCHEMA_INVOKE_HARNESS_INPUT.members["qualifier"], self.qualifier - ) - - if self.runtime_session_id is not None: - serializer.write_string( - _SCHEMA_INVOKE_HARNESS_INPUT.members["runtimeSessionId"], - self.runtime_session_id, - ) - - if self.runtime_user_id is not None: - serializer.write_string( - _SCHEMA_INVOKE_HARNESS_INPUT.members["runtimeUserId"], - self.runtime_user_id, - ) - - if self.trace_parent is not None: - serializer.write_string( - _SCHEMA_INVOKE_HARNESS_INPUT.members["traceParent"], self.trace_parent - ) - - if self.trace_state is not None: - serializer.write_string( - _SCHEMA_INVOKE_HARNESS_INPUT.members["traceState"], self.trace_state - ) - - if self.trace_id is not None: - serializer.write_string( - _SCHEMA_INVOKE_HARNESS_INPUT.members["traceId"], self.trace_id - ) - - if self.baggage is not None: - serializer.write_string( - _SCHEMA_INVOKE_HARNESS_INPUT.members["baggage"], self.baggage - ) - - if self.messages is not None: - _serialize_harness_messages( - serializer, - _SCHEMA_INVOKE_HARNESS_INPUT.members["messages"], - self.messages, - ) - - if self.model is not None: - serializer.write_struct( - _SCHEMA_INVOKE_HARNESS_INPUT.members["model"], self.model - ) - - if self.system_prompt is not None: - _serialize_harness_system_prompt( - serializer, - _SCHEMA_INVOKE_HARNESS_INPUT.members["systemPrompt"], - self.system_prompt, - ) - - if self.tools is not None: - _serialize_harness_tools( - serializer, _SCHEMA_INVOKE_HARNESS_INPUT.members["tools"], self.tools - ) - - if self.skills is not None: - _serialize_harness_skills( - serializer, _SCHEMA_INVOKE_HARNESS_INPUT.members["skills"], self.skills - ) - - if self.allowed_tools is not None: - _serialize_harness_allowed_tools( - serializer, - _SCHEMA_INVOKE_HARNESS_INPUT.members["allowedTools"], - self.allowed_tools, - ) - - if self.max_iterations is not None: - serializer.write_integer( - _SCHEMA_INVOKE_HARNESS_INPUT.members["maxIterations"], - self.max_iterations, - ) - - if self.max_tokens is not None: - serializer.write_integer( - _SCHEMA_INVOKE_HARNESS_INPUT.members["maxTokens"], self.max_tokens - ) - - if self.timeout_seconds is not None: - serializer.write_integer( - _SCHEMA_INVOKE_HARNESS_INPUT.members["timeoutSeconds"], - self.timeout_seconds, - ) - - if self.actor_id is not None: - serializer.write_string( - _SCHEMA_INVOKE_HARNESS_INPUT.members["actorId"], self.actor_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["harness_arn"] = de.read_string( - _SCHEMA_INVOKE_HARNESS_INPUT.members["harnessArn"] - ) - - case 1: - kwargs["qualifier"] = de.read_string( - _SCHEMA_INVOKE_HARNESS_INPUT.members["qualifier"] - ) - - case 2: - kwargs["runtime_session_id"] = de.read_string( - _SCHEMA_INVOKE_HARNESS_INPUT.members["runtimeSessionId"] - ) - - case 3: - kwargs["runtime_user_id"] = de.read_string( - _SCHEMA_INVOKE_HARNESS_INPUT.members["runtimeUserId"] - ) - - case 4: - kwargs["trace_parent"] = de.read_string( - _SCHEMA_INVOKE_HARNESS_INPUT.members["traceParent"] - ) - - case 5: - kwargs["trace_state"] = de.read_string( - _SCHEMA_INVOKE_HARNESS_INPUT.members["traceState"] - ) - - case 6: - kwargs["trace_id"] = de.read_string( - _SCHEMA_INVOKE_HARNESS_INPUT.members["traceId"] - ) - - case 7: - kwargs["baggage"] = de.read_string( - _SCHEMA_INVOKE_HARNESS_INPUT.members["baggage"] - ) - - case 8: - kwargs["messages"] = _deserialize_harness_messages( - de, _SCHEMA_INVOKE_HARNESS_INPUT.members["messages"] - ) - - case 9: - kwargs["model"] = ( - _HarnessModelConfigurationDeserializer().deserialize(de) - ) - - case 10: - kwargs["system_prompt"] = _deserialize_harness_system_prompt( - de, _SCHEMA_INVOKE_HARNESS_INPUT.members["systemPrompt"] - ) - - case 11: - kwargs["tools"] = _deserialize_harness_tools( - de, _SCHEMA_INVOKE_HARNESS_INPUT.members["tools"] - ) - - case 12: - kwargs["skills"] = _deserialize_harness_skills( - de, _SCHEMA_INVOKE_HARNESS_INPUT.members["skills"] - ) - - case 13: - kwargs["allowed_tools"] = _deserialize_harness_allowed_tools( - de, _SCHEMA_INVOKE_HARNESS_INPUT.members["allowedTools"] - ) - - case 14: - kwargs["max_iterations"] = de.read_integer( - _SCHEMA_INVOKE_HARNESS_INPUT.members["maxIterations"] - ) - - case 15: - kwargs["max_tokens"] = de.read_integer( - _SCHEMA_INVOKE_HARNESS_INPUT.members["maxTokens"] - ) - - case 16: - kwargs["timeout_seconds"] = de.read_integer( - _SCHEMA_INVOKE_HARNESS_INPUT.members["timeoutSeconds"] - ) - - case 17: - kwargs["actor_id"] = de.read_string( - _SCHEMA_INVOKE_HARNESS_INPUT.members["actorId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INVOKE_HARNESS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass -class HarnessReasoningContentBlockDeltaText: - """Reasoning text delta.""" - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_REASONING_CONTENT_BLOCK_DELTA, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_REASONING_CONTENT_BLOCK_DELTA.members["text"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string( - _SCHEMA_HARNESS_REASONING_CONTENT_BLOCK_DELTA.members["text"] - ) - ) - - -@dataclass -class HarnessReasoningContentBlockDeltaRedactedContent: - """Redacted reasoning content.""" - - value: bytes - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_REASONING_CONTENT_BLOCK_DELTA, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_blob( - _SCHEMA_HARNESS_REASONING_CONTENT_BLOCK_DELTA.members["redactedContent"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_blob( - _SCHEMA_HARNESS_REASONING_CONTENT_BLOCK_DELTA.members["redactedContent"] - ) - ) - - -@dataclass -class HarnessReasoningContentBlockDeltaSignature: - """Signature for the reasoning content.""" - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_REASONING_CONTENT_BLOCK_DELTA, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_REASONING_CONTENT_BLOCK_DELTA.members["signature"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string( - _SCHEMA_HARNESS_REASONING_CONTENT_BLOCK_DELTA.members["signature"] - ) - ) - - -@dataclass -class HarnessReasoningContentBlockDeltaUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -HarnessReasoningContentBlockDelta = Union[ - HarnessReasoningContentBlockDeltaText - | HarnessReasoningContentBlockDeltaRedactedContent - | HarnessReasoningContentBlockDeltaSignature - | HarnessReasoningContentBlockDeltaUnknown -] -"""A delta update to a reasoning content block.""" - - -class _HarnessReasoningContentBlockDeltaDeserializer: - _result: HarnessReasoningContentBlockDelta | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> HarnessReasoningContentBlockDelta: - self._result = None - deserializer.read_struct( - _SCHEMA_HARNESS_REASONING_CONTENT_BLOCK_DELTA, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(HarnessReasoningContentBlockDeltaText.deserialize(de)) - - case 1: - self._set_result( - HarnessReasoningContentBlockDeltaRedactedContent.deserialize(de) - ) - - case 2: - self._set_result( - HarnessReasoningContentBlockDeltaSignature.deserialize(de) - ) - - case _: - self._set_result( - HarnessReasoningContentBlockDeltaUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: HarnessReasoningContentBlockDelta) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass -class HarnessToolResultBlockDeltaText: - """A text tool result delta.""" - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_TOOL_RESULT_BLOCK_DELTA, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_TOOL_RESULT_BLOCK_DELTA.members["text"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string( - _SCHEMA_HARNESS_TOOL_RESULT_BLOCK_DELTA.members["text"] - ) - ) - - -@dataclass -class HarnessToolResultBlockDeltaJson: - """A JSON tool result delta.""" - - value: Document - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_TOOL_RESULT_BLOCK_DELTA, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_document( - _SCHEMA_HARNESS_TOOL_RESULT_BLOCK_DELTA.members["json"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_document( - _SCHEMA_HARNESS_TOOL_RESULT_BLOCK_DELTA.members["json"] - ) - ) - - -@dataclass -class HarnessToolResultBlockDeltaUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -HarnessToolResultBlockDelta = Union[ - HarnessToolResultBlockDeltaText - | HarnessToolResultBlockDeltaJson - | HarnessToolResultBlockDeltaUnknown -] -"""A delta update to a tool result content block.""" - - -class _HarnessToolResultBlockDeltaDeserializer: - _result: HarnessToolResultBlockDelta | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> HarnessToolResultBlockDelta: - self._result = None - deserializer.read_struct( - _SCHEMA_HARNESS_TOOL_RESULT_BLOCK_DELTA, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(HarnessToolResultBlockDeltaText.deserialize(de)) - - case 1: - self._set_result(HarnessToolResultBlockDeltaJson.deserialize(de)) - - case _: - self._set_result( - HarnessToolResultBlockDeltaUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: HarnessToolResultBlockDelta) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_harness_tool_result_blocks_delta( - serializer: ShapeSerializer, - schema: Schema, - value: list[HarnessToolResultBlockDelta], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_harness_tool_result_blocks_delta( - deserializer: ShapeDeserializer, schema: Schema -) -> list[HarnessToolResultBlockDelta]: - result: list[HarnessToolResultBlockDelta] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_HarnessToolResultBlockDeltaDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class HarnessToolResultMetadataBlockDelta: - """Delta payload for a tool result metadata.""" - - metadata: str = field(repr=False) - """The partial JSON-string fragment of the tool result metadata.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_TOOL_RESULT_METADATA_BLOCK_DELTA, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_TOOL_RESULT_METADATA_BLOCK_DELTA.members["metadata"], - self.metadata, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["metadata"] = de.read_string( - _SCHEMA_HARNESS_TOOL_RESULT_METADATA_BLOCK_DELTA.members[ - "metadata" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_HARNESS_TOOL_RESULT_METADATA_BLOCK_DELTA, consumer=_consumer - ) - if "metadata" not in kwargs: - kwargs["metadata"] = "" - return kwargs - - -@dataclass(kw_only=True) -class HarnessToolUseBlockDelta: - """Delta payload for tool use input.""" - - input: str = field(repr=False) - """The partial JSON input for the tool call.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_TOOL_USE_BLOCK_DELTA, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_TOOL_USE_BLOCK_DELTA.members["input"], self.input - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["input"] = de.read_string( - _SCHEMA_HARNESS_TOOL_USE_BLOCK_DELTA.members["input"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_HARNESS_TOOL_USE_BLOCK_DELTA, consumer=_consumer - ) - if "input" not in kwargs: - kwargs["input"] = "" - return kwargs - - -@dataclass -class HarnessContentBlockDeltaText: - """A text delta.""" - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_CONTENT_BLOCK_DELTA, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_CONTENT_BLOCK_DELTA.members["text"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string( - _SCHEMA_HARNESS_CONTENT_BLOCK_DELTA.members["text"] - ) - ) - - -@dataclass -class HarnessContentBlockDeltaToolUse: - """A tool use input delta.""" - - value: HarnessToolUseBlockDelta - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_CONTENT_BLOCK_DELTA, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_CONTENT_BLOCK_DELTA.members["toolUse"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HarnessToolUseBlockDelta.deserialize(deserializer)) - - -@dataclass -class HarnessContentBlockDeltaToolResult: - """A tool result delta.""" - - value: list[HarnessToolResultBlockDelta] - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_CONTENT_BLOCK_DELTA, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_harness_tool_result_blocks_delta( - serializer, - _SCHEMA_HARNESS_CONTENT_BLOCK_DELTA.members["toolResult"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_deserialize_harness_tool_result_blocks_delta( - deserializer, _SCHEMA_HARNESS_CONTENT_BLOCK_DELTA.members["toolResult"] - ) - ) - - -@dataclass -class HarnessContentBlockDeltaReasoningContent: - """A reasoning content delta.""" - - value: HarnessReasoningContentBlockDelta - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_CONTENT_BLOCK_DELTA, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_CONTENT_BLOCK_DELTA.members["reasoningContent"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_HarnessReasoningContentBlockDeltaDeserializer().deserialize( - deserializer - ) - ) - - -@dataclass -class HarnessContentBlockDeltaToolResultMetadata: - """A tool result metadata delta.""" - - value: HarnessToolResultMetadataBlockDelta - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_CONTENT_BLOCK_DELTA, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_CONTENT_BLOCK_DELTA.members["toolResultMetadata"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HarnessToolResultMetadataBlockDelta.deserialize(deserializer)) - - -@dataclass -class HarnessContentBlockDeltaUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -HarnessContentBlockDelta = Union[ - HarnessContentBlockDeltaText - | HarnessContentBlockDeltaToolUse - | HarnessContentBlockDeltaToolResult - | HarnessContentBlockDeltaReasoningContent - | HarnessContentBlockDeltaToolResultMetadata - | HarnessContentBlockDeltaUnknown -] -"""A delta update to a content block.""" - - -class _HarnessContentBlockDeltaDeserializer: - _result: HarnessContentBlockDelta | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> HarnessContentBlockDelta: - self._result = None - deserializer.read_struct(_SCHEMA_HARNESS_CONTENT_BLOCK_DELTA, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(HarnessContentBlockDeltaText.deserialize(de)) - - case 1: - self._set_result(HarnessContentBlockDeltaToolUse.deserialize(de)) - - case 2: - self._set_result(HarnessContentBlockDeltaToolResult.deserialize(de)) - - case 3: - self._set_result( - HarnessContentBlockDeltaReasoningContent.deserialize(de) - ) - - case 4: - self._set_result( - HarnessContentBlockDeltaToolResultMetadata.deserialize(de) - ) - - case _: - self._set_result( - HarnessContentBlockDeltaUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: HarnessContentBlockDelta) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class HarnessContentBlockDeltaEvent: - """Event containing a delta update to a content block.""" - - content_block_index: int - """The index of the content block being updated.""" - - delta: HarnessContentBlockDelta - """The delta payload.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_CONTENT_BLOCK_DELTA_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer( - _SCHEMA_HARNESS_CONTENT_BLOCK_DELTA_EVENT.members["contentBlockIndex"], - self.content_block_index, - ) - serializer.write_struct( - _SCHEMA_HARNESS_CONTENT_BLOCK_DELTA_EVENT.members["delta"], self.delta - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["content_block_index"] = de.read_integer( - _SCHEMA_HARNESS_CONTENT_BLOCK_DELTA_EVENT.members[ - "contentBlockIndex" - ] - ) - - case 1: - kwargs["delta"] = ( - _HarnessContentBlockDeltaDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_HARNESS_CONTENT_BLOCK_DELTA_EVENT, consumer=_consumer - ) - if "content_block_index" not in kwargs: - kwargs["content_block_index"] = 0 - if "delta" not in kwargs: - kwargs["delta"] = HarnessContentBlockDeltaUnknown(tag="") - return kwargs - - -@dataclass(kw_only=True) -class HarnessToolResultBlockStart: - """Start payload for a tool result content block.""" - - tool_use_id: str - """The tool use ID that this result corresponds to.""" - - status: str | None = None - """The status of the tool execution.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_TOOL_RESULT_BLOCK_START, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_TOOL_RESULT_BLOCK_START.members["toolUseId"], - self.tool_use_id, - ) - if self.status is not None: - serializer.write_string( - _SCHEMA_HARNESS_TOOL_RESULT_BLOCK_START.members["status"], self.status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["tool_use_id"] = de.read_string( - _SCHEMA_HARNESS_TOOL_RESULT_BLOCK_START.members["toolUseId"] - ) - - case 1: - kwargs["status"] = HarnessToolUseStatus( - de.read_string( - _SCHEMA_HARNESS_TOOL_RESULT_BLOCK_START.members["status"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_HARNESS_TOOL_RESULT_BLOCK_START, consumer=_consumer - ) - if "tool_use_id" not in kwargs: - kwargs["tool_use_id"] = "" - return kwargs - - -@dataclass(kw_only=True) -class HarnessToolUseBlockStart: - """Start payload for a tool use content block.""" - - tool_use_id: str - """The unique ID of this tool use.""" - - name: str - """The name of the tool being called.""" - - type: str | None = None - """The type of tool use.""" - - server_name: str | None = None - """The name of the MCP server providing this tool.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_TOOL_USE_BLOCK_START, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_TOOL_USE_BLOCK_START.members["toolUseId"], self.tool_use_id - ) - serializer.write_string( - _SCHEMA_HARNESS_TOOL_USE_BLOCK_START.members["name"], self.name - ) - if self.type is not None: - serializer.write_string( - _SCHEMA_HARNESS_TOOL_USE_BLOCK_START.members["type"], self.type - ) - - if self.server_name is not None: - serializer.write_string( - _SCHEMA_HARNESS_TOOL_USE_BLOCK_START.members["serverName"], - self.server_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["tool_use_id"] = de.read_string( - _SCHEMA_HARNESS_TOOL_USE_BLOCK_START.members["toolUseId"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_HARNESS_TOOL_USE_BLOCK_START.members["name"] - ) - - case 2: - kwargs["type"] = HarnessToolUseType( - de.read_string( - _SCHEMA_HARNESS_TOOL_USE_BLOCK_START.members["type"] - ) - ) - - case 3: - kwargs["server_name"] = de.read_string( - _SCHEMA_HARNESS_TOOL_USE_BLOCK_START.members["serverName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_HARNESS_TOOL_USE_BLOCK_START, consumer=_consumer - ) - if "tool_use_id" not in kwargs: - kwargs["tool_use_id"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - return kwargs - - -@dataclass -class HarnessContentBlockStartToolUse: - """Start of a tool use content block.""" - - value: HarnessToolUseBlockStart - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_CONTENT_BLOCK_START, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_CONTENT_BLOCK_START.members["toolUse"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HarnessToolUseBlockStart.deserialize(deserializer)) - - -@dataclass -class HarnessContentBlockStartToolResult: - """Start of a tool result content block.""" - - value: HarnessToolResultBlockStart - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_CONTENT_BLOCK_START, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_CONTENT_BLOCK_START.members["toolResult"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HarnessToolResultBlockStart.deserialize(deserializer)) - - -@dataclass -class HarnessContentBlockStartUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -HarnessContentBlockStart = Union[ - HarnessContentBlockStartToolUse - | HarnessContentBlockStartToolResult - | HarnessContentBlockStartUnknown -] -"""The start payload for a content block.""" - - -class _HarnessContentBlockStartDeserializer: - _result: HarnessContentBlockStart | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> HarnessContentBlockStart: - self._result = None - deserializer.read_struct(_SCHEMA_HARNESS_CONTENT_BLOCK_START, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(HarnessContentBlockStartToolUse.deserialize(de)) - - case 1: - self._set_result(HarnessContentBlockStartToolResult.deserialize(de)) - - case _: - self._set_result( - HarnessContentBlockStartUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: HarnessContentBlockStart) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class HarnessContentBlockStartEvent: - """Event indicating the start of a content block.""" - - content_block_index: int - """The index of the content block within the message.""" - - start: HarnessContentBlockStart - """The content block start payload.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_CONTENT_BLOCK_START_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer( - _SCHEMA_HARNESS_CONTENT_BLOCK_START_EVENT.members["contentBlockIndex"], - self.content_block_index, - ) - serializer.write_struct( - _SCHEMA_HARNESS_CONTENT_BLOCK_START_EVENT.members["start"], self.start - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["content_block_index"] = de.read_integer( - _SCHEMA_HARNESS_CONTENT_BLOCK_START_EVENT.members[ - "contentBlockIndex" - ] - ) - - case 1: - kwargs["start"] = ( - _HarnessContentBlockStartDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_HARNESS_CONTENT_BLOCK_START_EVENT, consumer=_consumer - ) - if "content_block_index" not in kwargs: - kwargs["content_block_index"] = 0 - if "start" not in kwargs: - kwargs["start"] = HarnessContentBlockStartUnknown(tag="") - return kwargs - - -@dataclass(kw_only=True) -class HarnessContentBlockStopEvent: - """Event indicating the end of a content block.""" - - content_block_index: int - """The index of the content block that ended.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_CONTENT_BLOCK_STOP_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer( - _SCHEMA_HARNESS_CONTENT_BLOCK_STOP_EVENT.members["contentBlockIndex"], - self.content_block_index, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["content_block_index"] = de.read_integer( - _SCHEMA_HARNESS_CONTENT_BLOCK_STOP_EVENT.members[ - "contentBlockIndex" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_HARNESS_CONTENT_BLOCK_STOP_EVENT, consumer=_consumer - ) - if "content_block_index" not in kwargs: - kwargs["content_block_index"] = 0 - return kwargs - - -class HarnessHookDecision(UnknownEnumMixin, StrEnum): - ALLOW = "allow" - DENY = "deny" - - -class HarnessHookEventType(UnknownEnumMixin, StrEnum): - BEFORE_TOOL_CALL = "before_tool_call" - AFTER_TOOL_CALL = "after_tool_call" - BEFORE_INVOCATION = "before_invocation" - AFTER_INVOCATION = "after_invocation" - - -@dataclass(kw_only=True) -class HarnessHookEvent: - """ - A lifecycle hook event emitted in the invocation stream for visibility - into hook decisions. - """ - - hook_event_id: str - """The unique identifier for this hook event.""" - - name: str - """The name of the hook that ran.""" - - type: str - """The type of lifecycle hook event.""" - - decision: str | None = None - """ - The decision applied to the hook event. This field is present only for - blocking Lambda targets. - """ - - reason: str | None = None - """The optional reason for the applied decision.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_HOOK_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_HOOK_EVENT.members["hookEventId"], self.hook_event_id - ) - serializer.write_string(_SCHEMA_HARNESS_HOOK_EVENT.members["name"], self.name) - serializer.write_string(_SCHEMA_HARNESS_HOOK_EVENT.members["type"], self.type) - if self.decision is not None: - serializer.write_string( - _SCHEMA_HARNESS_HOOK_EVENT.members["decision"], self.decision - ) - - if self.reason is not None: - serializer.write_string( - _SCHEMA_HARNESS_HOOK_EVENT.members["reason"], self.reason - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["hook_event_id"] = de.read_string( - _SCHEMA_HARNESS_HOOK_EVENT.members["hookEventId"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_HARNESS_HOOK_EVENT.members["name"] - ) - - case 2: - kwargs["type"] = HarnessHookEventType( - de.read_string(_SCHEMA_HARNESS_HOOK_EVENT.members["type"]) - ) - - case 3: - kwargs["decision"] = HarnessHookDecision( - de.read_string(_SCHEMA_HARNESS_HOOK_EVENT.members["decision"]) - ) - - case 4: - kwargs["reason"] = de.read_string( - _SCHEMA_HARNESS_HOOK_EVENT.members["reason"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_HARNESS_HOOK_EVENT, consumer=_consumer) - if "hook_event_id" not in kwargs: - kwargs["hook_event_id"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "type" not in kwargs: - kwargs["type"] = HarnessHookEventType._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class HarnessMessageStartEvent: - """Event indicating the start of a message.""" - - role: str - """The role of the message sender.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_MESSAGE_START_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_MESSAGE_START_EVENT.members["role"], self.role - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["role"] = HarnessConversationRole( - de.read_string( - _SCHEMA_HARNESS_MESSAGE_START_EVENT.members["role"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_HARNESS_MESSAGE_START_EVENT, consumer=_consumer - ) - if "role" not in kwargs: - kwargs["role"] = HarnessConversationRole._corrected("") - return kwargs - - -class HarnessStopReason(UnknownEnumMixin, StrEnum): - END_TURN = "end_turn" - TOOL_USE = "tool_use" - TOOL_RESULT = "tool_result" - MAX_TOKENS = "max_tokens" - STOP_SEQUENCE = "stop_sequence" - CONTENT_FILTERED = "content_filtered" - MALFORMED_MODEL_OUTPUT = "malformed_model_output" - MALFORMED_TOOL_USE = "malformed_tool_use" - INTERRUPTED = "interrupted" - PARTIAL_TURN = "partial_turn" - MODEL_CONTEXT_WINDOW_EXCEEDED = "model_context_window_exceeded" - MAX_ITERATIONS_EXCEEDED = "max_iterations_exceeded" - MAX_OUTPUT_TOKENS_EXCEEDED = "max_output_tokens_exceeded" - TIMEOUT_EXCEEDED = "timeout_exceeded" - HOOK_STOPPED = "hook_stopped" - - -@dataclass(kw_only=True) -class HarnessMessageStopEvent: - """Event indicating the end of a message.""" - - stop_reason: str - """The reason the agent stopped generating.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_MESSAGE_STOP_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HARNESS_MESSAGE_STOP_EVENT.members["stopReason"], self.stop_reason - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["stop_reason"] = HarnessStopReason( - de.read_string( - _SCHEMA_HARNESS_MESSAGE_STOP_EVENT.members["stopReason"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_HARNESS_MESSAGE_STOP_EVENT, consumer=_consumer) - if "stop_reason" not in kwargs: - kwargs["stop_reason"] = HarnessStopReason._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class HarnessStreamMetrics: - """Latency metrics for the invocation.""" - - latency_ms: int - """The end-to-end latency of the invocation in milliseconds.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_STREAM_METRICS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_long( - _SCHEMA_HARNESS_STREAM_METRICS.members["latencyMs"], self.latency_ms - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["latency_ms"] = de.read_long( - _SCHEMA_HARNESS_STREAM_METRICS.members["latencyMs"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_HARNESS_STREAM_METRICS, consumer=_consumer) - if "latency_ms" not in kwargs: - kwargs["latency_ms"] = 0 - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(latency_ms=0) - - -@dataclass(kw_only=True) -class HarnessTokenUsage: - """Token usage counts for the invocation.""" - - input_tokens: int - """The number of input tokens consumed.""" - - output_tokens: int - """The number of output tokens generated.""" - - total_tokens: int - """The total number of tokens consumed.""" - - cache_read_input_tokens: int | None = None - """The number of input tokens read from cache.""" - - cache_write_input_tokens: int | None = None - """The number of input tokens written to cache.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_TOKEN_USAGE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer( - _SCHEMA_HARNESS_TOKEN_USAGE.members["inputTokens"], self.input_tokens - ) - serializer.write_integer( - _SCHEMA_HARNESS_TOKEN_USAGE.members["outputTokens"], self.output_tokens - ) - serializer.write_integer( - _SCHEMA_HARNESS_TOKEN_USAGE.members["totalTokens"], self.total_tokens - ) - if self.cache_read_input_tokens is not None: - serializer.write_integer( - _SCHEMA_HARNESS_TOKEN_USAGE.members["cacheReadInputTokens"], - self.cache_read_input_tokens, - ) - - if self.cache_write_input_tokens is not None: - serializer.write_integer( - _SCHEMA_HARNESS_TOKEN_USAGE.members["cacheWriteInputTokens"], - self.cache_write_input_tokens, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["input_tokens"] = de.read_integer( - _SCHEMA_HARNESS_TOKEN_USAGE.members["inputTokens"] - ) - - case 1: - kwargs["output_tokens"] = de.read_integer( - _SCHEMA_HARNESS_TOKEN_USAGE.members["outputTokens"] - ) - - case 2: - kwargs["total_tokens"] = de.read_integer( - _SCHEMA_HARNESS_TOKEN_USAGE.members["totalTokens"] - ) - - case 3: - kwargs["cache_read_input_tokens"] = de.read_integer( - _SCHEMA_HARNESS_TOKEN_USAGE.members["cacheReadInputTokens"] - ) - - case 4: - kwargs["cache_write_input_tokens"] = de.read_integer( - _SCHEMA_HARNESS_TOKEN_USAGE.members["cacheWriteInputTokens"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_HARNESS_TOKEN_USAGE, consumer=_consumer) - if "input_tokens" not in kwargs: - kwargs["input_tokens"] = 0 - if "output_tokens" not in kwargs: - kwargs["output_tokens"] = 0 - if "total_tokens" not in kwargs: - kwargs["total_tokens"] = 0 - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(input_tokens=0, output_tokens=0, total_tokens=0) - - -@dataclass(kw_only=True) -class HarnessMetadataEvent: - """Token usage and latency metrics for the invocation.""" - - usage: HarnessTokenUsage - """Token usage counts.""" - - metrics: HarnessStreamMetrics - """Latency metrics.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HARNESS_METADATA_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_HARNESS_METADATA_EVENT.members["usage"], self.usage - ) - serializer.write_struct( - _SCHEMA_HARNESS_METADATA_EVENT.members["metrics"], self.metrics - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["usage"] = HarnessTokenUsage.deserialize(de) - - case 1: - kwargs["metrics"] = HarnessStreamMetrics.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_HARNESS_METADATA_EVENT, consumer=_consumer) - if "usage" not in kwargs: - kwargs["usage"] = HarnessTokenUsage._smithy_default() - if "metrics" not in kwargs: - kwargs["metrics"] = HarnessStreamMetrics._smithy_default() - return kwargs - - -@dataclass -class InvokeHarnessStreamOutputMessageStart: - """Indicates the start of a new message from the agent.""" - - value: HarnessMessageStartEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOKE_HARNESS_STREAM_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_HARNESS_STREAM_OUTPUT.members["messageStart"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HarnessMessageStartEvent.deserialize(deserializer)) - - -@dataclass -class InvokeHarnessStreamOutputContentBlockStart: - """Indicates the start of a new content block.""" - - value: HarnessContentBlockStartEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOKE_HARNESS_STREAM_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_HARNESS_STREAM_OUTPUT.members["contentBlockStart"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HarnessContentBlockStartEvent.deserialize(deserializer)) - - -@dataclass -class InvokeHarnessStreamOutputContentBlockDelta: - """A delta update to the current content block.""" - - value: HarnessContentBlockDeltaEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOKE_HARNESS_STREAM_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_HARNESS_STREAM_OUTPUT.members["contentBlockDelta"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HarnessContentBlockDeltaEvent.deserialize(deserializer)) - - -@dataclass -class InvokeHarnessStreamOutputContentBlockStop: - """Indicates the end of the current content block.""" - - value: HarnessContentBlockStopEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOKE_HARNESS_STREAM_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_HARNESS_STREAM_OUTPUT.members["contentBlockStop"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HarnessContentBlockStopEvent.deserialize(deserializer)) - - -@dataclass -class InvokeHarnessStreamOutputMessageStop: - """Indicates the end of the current message.""" - - value: HarnessMessageStopEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOKE_HARNESS_STREAM_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_HARNESS_STREAM_OUTPUT.members["messageStop"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HarnessMessageStopEvent.deserialize(deserializer)) - - -@dataclass -class InvokeHarnessStreamOutputMetadata: - """Token usage and latency metrics for the invocation.""" - - value: HarnessMetadataEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOKE_HARNESS_STREAM_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_HARNESS_STREAM_OUTPUT.members["metadata"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HarnessMetadataEvent.deserialize(deserializer)) - - -@dataclass -class InvokeHarnessStreamOutputInternalServerException: - """ - The exception that occurs when the service encounters an unexpected - internal error. This is a temporary condition that will resolve itself - with retries. We recommend implementing exponential backoff retry logic - in your application. - """ - - value: InternalServerException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOKE_HARNESS_STREAM_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_HARNESS_STREAM_OUTPUT.members["internalServerException"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=InternalServerException.deserialize(deserializer)) - - -@dataclass -class InvokeHarnessStreamOutputValidationException: - """ - The exception that occurs when the input fails to satisfy the - constraints specified by the service. Check the error message for - details about which input parameter is invalid and correct your request. - """ - - value: ValidationException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOKE_HARNESS_STREAM_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_HARNESS_STREAM_OUTPUT.members["validationException"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ValidationException.deserialize(deserializer)) - - -@dataclass -class InvokeHarnessStreamOutputRuntimeClientError: - """An error returned by the runtime container during agent execution.""" - - value: RuntimeClientError - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOKE_HARNESS_STREAM_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_HARNESS_STREAM_OUTPUT.members["runtimeClientError"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=RuntimeClientError.deserialize(deserializer)) - - -@dataclass -class InvokeHarnessStreamOutputHookEvent: - """A lifecycle hook event emitted when a configured hook runs.""" - - value: HarnessHookEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOKE_HARNESS_STREAM_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_HARNESS_STREAM_OUTPUT.members["hookEvent"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HarnessHookEvent.deserialize(deserializer)) - - -@dataclass -class InvokeHarnessStreamOutputUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -InvokeHarnessStreamOutput = Union[ - InvokeHarnessStreamOutputMessageStart - | InvokeHarnessStreamOutputContentBlockStart - | InvokeHarnessStreamOutputContentBlockDelta - | InvokeHarnessStreamOutputContentBlockStop - | InvokeHarnessStreamOutputMessageStop - | InvokeHarnessStreamOutputMetadata - | InvokeHarnessStreamOutputInternalServerException - | InvokeHarnessStreamOutputValidationException - | InvokeHarnessStreamOutputRuntimeClientError - | InvokeHarnessStreamOutputHookEvent - | InvokeHarnessStreamOutputUnknown -] -"""The streaming events returned by a harness invocation.""" - - -class _InvokeHarnessStreamOutputDeserializer: - _result: InvokeHarnessStreamOutput | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> InvokeHarnessStreamOutput: - self._result = None - deserializer.read_struct(_SCHEMA_INVOKE_HARNESS_STREAM_OUTPUT, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(InvokeHarnessStreamOutputMessageStart.deserialize(de)) - - case 1: - self._set_result( - InvokeHarnessStreamOutputContentBlockStart.deserialize(de) - ) - - case 2: - self._set_result( - InvokeHarnessStreamOutputContentBlockDelta.deserialize(de) - ) - - case 3: - self._set_result( - InvokeHarnessStreamOutputContentBlockStop.deserialize(de) - ) - - case 4: - self._set_result(InvokeHarnessStreamOutputMessageStop.deserialize(de)) - - case 5: - self._set_result(InvokeHarnessStreamOutputMetadata.deserialize(de)) - - case 6: - self._set_result( - InvokeHarnessStreamOutputInternalServerException.deserialize(de) - ) - - case 7: - self._set_result( - InvokeHarnessStreamOutputValidationException.deserialize(de) - ) - - case 8: - self._set_result( - InvokeHarnessStreamOutputRuntimeClientError.deserialize(de) - ) - - case 9: - self._set_result(InvokeHarnessStreamOutputHookEvent.deserialize(de)) - - case _: - self._set_result( - InvokeHarnessStreamOutputUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: InvokeHarnessStreamOutput) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class InvokeHarnessOutput: - """Dataclass for InvokeHarnessOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOKE_HARNESS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INVOKE_HARNESS_OUTPUT, consumer=_consumer) - return kwargs - - -INVOKE_HARNESS = APIOperation( - input=InvokeHarnessInput, - output=InvokeHarnessOutput, - schema=_SCHEMA_INVOKE_HARNESS, - input_schema=_SCHEMA_INVOKE_HARNESS_INPUT, - output_schema=_SCHEMA_INVOKE_HARNESS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#RuntimeClientError" - ): RuntimeClientError, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_RUNTIME_CLIENT_ERROR, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass -class MemoryContentText: - """The text content of the memory record.""" - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEMORY_CONTENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_MEMORY_CONTENT.members["text"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string(_SCHEMA_MEMORY_CONTENT.members["text"]) - ) - - -@dataclass -class MemoryContentUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -MemoryContent = Union[MemoryContentText | MemoryContentUnknown] -"""Contains the content of a memory record.""" - - -class _MemoryContentDeserializer: - _result: MemoryContent | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> MemoryContent: - self._result = None - deserializer.read_struct(_SCHEMA_MEMORY_CONTENT, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(MemoryContentText.deserialize(de)) - - case _: - self._set_result(MemoryContentUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: MemoryContent) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_string_value_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_string_value_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass -class MemoryRecordMetadataValueStringValue: - """A string value.""" - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEMORY_RECORD_METADATA_VALUE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MEMORY_RECORD_METADATA_VALUE.members["stringValue"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string( - _SCHEMA_MEMORY_RECORD_METADATA_VALUE.members["stringValue"] - ) - ) - - -@dataclass -class MemoryRecordMetadataValueStringListValue: - """A list of string values.""" - - value: list[str] - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEMORY_RECORD_METADATA_VALUE, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_string_value_list( - serializer, - _SCHEMA_MEMORY_RECORD_METADATA_VALUE.members["stringListValue"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_deserialize_string_value_list( - deserializer, - _SCHEMA_MEMORY_RECORD_METADATA_VALUE.members["stringListValue"], - ) - ) - - -@dataclass -class MemoryRecordMetadataValueNumberValue: - """A numeric value.""" - - value: float - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEMORY_RECORD_METADATA_VALUE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_double( - _SCHEMA_MEMORY_RECORD_METADATA_VALUE.members["numberValue"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_double( - _SCHEMA_MEMORY_RECORD_METADATA_VALUE.members["numberValue"] - ) - ) - - -@dataclass -class MemoryRecordMetadataValueDateTimeValue: - """A timestamp value in ISO 8601 UTC format.""" - - value: datetime - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEMORY_RECORD_METADATA_VALUE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_timestamp( - _SCHEMA_MEMORY_RECORD_METADATA_VALUE.members["dateTimeValue"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_timestamp( - _SCHEMA_MEMORY_RECORD_METADATA_VALUE.members["dateTimeValue"] - ) - ) - - -@dataclass -class MemoryRecordMetadataValueUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -MemoryRecordMetadataValue = Union[ - MemoryRecordMetadataValueStringValue - | MemoryRecordMetadataValueStringListValue - | MemoryRecordMetadataValueNumberValue - | MemoryRecordMetadataValueDateTimeValue - | MemoryRecordMetadataValueUnknown -] -"""The value of a memory record metadata entry.""" - - -class _MemoryRecordMetadataValueDeserializer: - _result: MemoryRecordMetadataValue | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> MemoryRecordMetadataValue: - self._result = None - deserializer.read_struct(_SCHEMA_MEMORY_RECORD_METADATA_VALUE, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(MemoryRecordMetadataValueStringValue.deserialize(de)) - - case 1: - self._set_result( - MemoryRecordMetadataValueStringListValue.deserialize(de) - ) - - case 2: - self._set_result(MemoryRecordMetadataValueNumberValue.deserialize(de)) - - case 3: - self._set_result(MemoryRecordMetadataValueDateTimeValue.deserialize(de)) - - case _: - self._set_result( - MemoryRecordMetadataValueUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: MemoryRecordMetadataValue) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_memory_record_metadata_map( - serializer: ShapeSerializer, - schema: Schema, - value: dict[str, MemoryRecordMetadataValue], -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_struct(value_schema, v)) - - -def _deserialize_memory_record_metadata_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, MemoryRecordMetadataValue]: - result: dict[str, MemoryRecordMetadataValue] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = _MemoryRecordMetadataValueDeserializer().deserialize(d) - - deserializer.read_map(schema, _read_value) - return result - - -def _serialize_namespaces_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_namespaces_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class MemoryRecordCreateInput: - """Input structure to create a new memory record.""" - - request_identifier: str - """ - A client-provided identifier for tracking this specific record creation - request. - """ - - namespaces: list[str] - """ - A list of namespace identifiers that categorize or group the memory - record. - """ - - content: MemoryContent - """The content to be stored within the memory record.""" - - timestamp: datetime - """Time at which the memory record was created.""" - - memory_strategy_id: str | None = None - """ - The ID of the memory strategy that defines how this memory record is - grouped. - """ - - metadata: dict[str, MemoryRecordMetadataValue] | None = None - """Metadata key-value pairs to be stored with the memory record.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEMORY_RECORD_CREATE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MEMORY_RECORD_CREATE_INPUT.members["requestIdentifier"], - self.request_identifier, - ) - _serialize_namespaces_list( - serializer, - _SCHEMA_MEMORY_RECORD_CREATE_INPUT.members["namespaces"], - self.namespaces, - ) - serializer.write_struct( - _SCHEMA_MEMORY_RECORD_CREATE_INPUT.members["content"], self.content - ) - serializer.write_timestamp( - _SCHEMA_MEMORY_RECORD_CREATE_INPUT.members["timestamp"], self.timestamp - ) - if self.memory_strategy_id is not None: - serializer.write_string( - _SCHEMA_MEMORY_RECORD_CREATE_INPUT.members["memoryStrategyId"], - self.memory_strategy_id, - ) - - if self.metadata is not None: - _serialize_memory_record_metadata_map( - serializer, - _SCHEMA_MEMORY_RECORD_CREATE_INPUT.members["metadata"], - self.metadata, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["request_identifier"] = de.read_string( - _SCHEMA_MEMORY_RECORD_CREATE_INPUT.members["requestIdentifier"] - ) - - case 1: - kwargs["namespaces"] = _deserialize_namespaces_list( - de, _SCHEMA_MEMORY_RECORD_CREATE_INPUT.members["namespaces"] - ) - - case 2: - kwargs["content"] = _MemoryContentDeserializer().deserialize(de) - - case 3: - kwargs["timestamp"] = de.read_timestamp( - _SCHEMA_MEMORY_RECORD_CREATE_INPUT.members["timestamp"] - ) - - case 4: - kwargs["memory_strategy_id"] = de.read_string( - _SCHEMA_MEMORY_RECORD_CREATE_INPUT.members["memoryStrategyId"] - ) - - case 5: - kwargs["metadata"] = _deserialize_memory_record_metadata_map( - de, _SCHEMA_MEMORY_RECORD_CREATE_INPUT.members["metadata"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MEMORY_RECORD_CREATE_INPUT, consumer=_consumer) - if "request_identifier" not in kwargs: - kwargs["request_identifier"] = "" - if "namespaces" not in kwargs: - kwargs["namespaces"] = [] - if "content" not in kwargs: - kwargs["content"] = MemoryContentUnknown(tag="") - if "timestamp" not in kwargs: - kwargs["timestamp"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_memory_records_create_input_list( - serializer: ShapeSerializer, schema: Schema, value: list[MemoryRecordCreateInput] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_memory_records_create_input_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[MemoryRecordCreateInput]: - result: list[MemoryRecordCreateInput] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(MemoryRecordCreateInput.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class BatchCreateMemoryRecordsInput: - """Dataclass for BatchCreateMemoryRecordsInput structure.""" - - memory_id: str | None = None - """The unique ID of the memory resource where records will be created.""" - - records: list[MemoryRecordCreateInput] | None = None - """ - A list of memory record creation inputs to be processed in the batch - operation. - """ - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure idempotent processing of - the batch request. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BATCH_CREATE_MEMORY_RECORDS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.memory_id is not None: - serializer.write_string( - _SCHEMA_BATCH_CREATE_MEMORY_RECORDS_INPUT.members["memoryId"], - self.memory_id, - ) - - if self.records is not None: - _serialize_memory_records_create_input_list( - serializer, - _SCHEMA_BATCH_CREATE_MEMORY_RECORDS_INPUT.members["records"], - self.records, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_BATCH_CREATE_MEMORY_RECORDS_INPUT.members["clientToken"], - self.client_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["memory_id"] = de.read_string( - _SCHEMA_BATCH_CREATE_MEMORY_RECORDS_INPUT.members["memoryId"] - ) - - case 1: - kwargs["records"] = _deserialize_memory_records_create_input_list( - de, _SCHEMA_BATCH_CREATE_MEMORY_RECORDS_INPUT.members["records"] - ) - - case 2: - kwargs["client_token"] = de.read_string( - _SCHEMA_BATCH_CREATE_MEMORY_RECORDS_INPUT.members["clientToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_BATCH_CREATE_MEMORY_RECORDS_INPUT, consumer=_consumer - ) - return kwargs - - -class MemoryRecordStatus(UnknownEnumMixin, StrEnum): - SUCCEEDED = "SUCCEEDED" - FAILED = "FAILED" - - -@dataclass(kw_only=True) -class MemoryRecordOutput: - """Output information returned after processing a memory record operation.""" - - memory_record_id: str - """The unique ID associated to the memory record.""" - - status: str - """The status of the memory record operation (e.g., SUCCEEDED, FAILED).""" - - request_identifier: str | None = None - """ - The client-provided identifier that was used to track this record - operation. - """ - - error_code: int | None = None - """The error code returned when the memory record operation fails.""" - - error_message: str | None = None - """ - A human-readable error message describing why the memory record - operation failed. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEMORY_RECORD_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MEMORY_RECORD_OUTPUT.members["memoryRecordId"], - self.memory_record_id, - ) - serializer.write_string( - _SCHEMA_MEMORY_RECORD_OUTPUT.members["status"], self.status - ) - if self.request_identifier is not None: - serializer.write_string( - _SCHEMA_MEMORY_RECORD_OUTPUT.members["requestIdentifier"], - self.request_identifier, - ) - - if self.error_code is not None: - serializer.write_integer( - _SCHEMA_MEMORY_RECORD_OUTPUT.members["errorCode"], self.error_code - ) - - if self.error_message is not None: - serializer.write_string( - _SCHEMA_MEMORY_RECORD_OUTPUT.members["errorMessage"], self.error_message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["memory_record_id"] = de.read_string( - _SCHEMA_MEMORY_RECORD_OUTPUT.members["memoryRecordId"] - ) - - case 1: - kwargs["status"] = MemoryRecordStatus( - de.read_string(_SCHEMA_MEMORY_RECORD_OUTPUT.members["status"]) - ) - - case 2: - kwargs["request_identifier"] = de.read_string( - _SCHEMA_MEMORY_RECORD_OUTPUT.members["requestIdentifier"] - ) - - case 3: - kwargs["error_code"] = de.read_integer( - _SCHEMA_MEMORY_RECORD_OUTPUT.members["errorCode"] - ) - - case 4: - kwargs["error_message"] = de.read_string( - _SCHEMA_MEMORY_RECORD_OUTPUT.members["errorMessage"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MEMORY_RECORD_OUTPUT, consumer=_consumer) - if "memory_record_id" not in kwargs: - kwargs["memory_record_id"] = "" - if "status" not in kwargs: - kwargs["status"] = MemoryRecordStatus._corrected("") - return kwargs - - -def _serialize_memory_records_output_list( - serializer: ShapeSerializer, schema: Schema, value: list[MemoryRecordOutput] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_memory_records_output_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[MemoryRecordOutput]: - result: list[MemoryRecordOutput] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(MemoryRecordOutput.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class BatchCreateMemoryRecordsOutput: - """Dataclass for BatchCreateMemoryRecordsOutput structure.""" - - successful_records: list[MemoryRecordOutput] - """ - A list of memory records that were successfully created during the batch - operation. - """ - - failed_records: list[MemoryRecordOutput] - """ - A list of memory records that failed to be created, including error - details for each failure. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BATCH_CREATE_MEMORY_RECORDS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_memory_records_output_list( - serializer, - _SCHEMA_BATCH_CREATE_MEMORY_RECORDS_OUTPUT.members["successfulRecords"], - self.successful_records, - ) - _serialize_memory_records_output_list( - serializer, - _SCHEMA_BATCH_CREATE_MEMORY_RECORDS_OUTPUT.members["failedRecords"], - self.failed_records, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["successful_records"] = ( - _deserialize_memory_records_output_list( - de, - _SCHEMA_BATCH_CREATE_MEMORY_RECORDS_OUTPUT.members[ - "successfulRecords" - ], - ) - ) - - case 1: - kwargs["failed_records"] = _deserialize_memory_records_output_list( - de, - _SCHEMA_BATCH_CREATE_MEMORY_RECORDS_OUTPUT.members[ - "failedRecords" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_BATCH_CREATE_MEMORY_RECORDS_OUTPUT, consumer=_consumer - ) - if "successful_records" not in kwargs: - kwargs["successful_records"] = [] - if "failed_records" not in kwargs: - kwargs["failed_records"] = [] - return kwargs - - -@dataclass(kw_only=True) -class ServiceException(ServiceError): - """The service encountered an internal error. Try your request again later.""" - - fault: Literal["client", "server"] | None = "server" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SERVICE_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SERVICE_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_SERVICE_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SERVICE_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ThrottledException(ServiceError): - """ - The request was denied due to request throttling. Reduce the frequency - of requests and try again. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_THROTTLED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_THROTTLED_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_THROTTLED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_THROTTLED_EXCEPTION, consumer=_consumer) - return kwargs - - -BATCH_CREATE_MEMORY_RECORDS = APIOperation( - input=BatchCreateMemoryRecordsInput, - output=BatchCreateMemoryRecordsOutput, - schema=_SCHEMA_BATCH_CREATE_MEMORY_RECORDS, - input_schema=_SCHEMA_BATCH_CREATE_MEMORY_RECORDS_INPUT, - output_schema=_SCHEMA_BATCH_CREATE_MEMORY_RECORDS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceException" - ): ServiceException, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottledException" - ): ThrottledException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class MemoryRecordDeleteInput: - """Input structure to delete an existing memory record.""" - - memory_record_id: str - """The unique ID of the memory record to be deleted.""" - - namespace: str | None = None - """ - The namespace of the memory record being deleted. This value is used for - IAM condition key authorization. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEMORY_RECORD_DELETE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MEMORY_RECORD_DELETE_INPUT.members["memoryRecordId"], - self.memory_record_id, - ) - if self.namespace is not None: - serializer.write_string( - _SCHEMA_MEMORY_RECORD_DELETE_INPUT.members["namespace"], self.namespace - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["memory_record_id"] = de.read_string( - _SCHEMA_MEMORY_RECORD_DELETE_INPUT.members["memoryRecordId"] - ) - - case 1: - kwargs["namespace"] = de.read_string( - _SCHEMA_MEMORY_RECORD_DELETE_INPUT.members["namespace"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MEMORY_RECORD_DELETE_INPUT, consumer=_consumer) - if "memory_record_id" not in kwargs: - kwargs["memory_record_id"] = "" - return kwargs - - -def _serialize_memory_records_delete_input_list( - serializer: ShapeSerializer, schema: Schema, value: list[MemoryRecordDeleteInput] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_memory_records_delete_input_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[MemoryRecordDeleteInput]: - result: list[MemoryRecordDeleteInput] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(MemoryRecordDeleteInput.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class BatchDeleteMemoryRecordsInput: - """Dataclass for BatchDeleteMemoryRecordsInput structure.""" - - memory_id: str | None = None - """The unique ID of the memory resource where records will be deleted.""" - - records: list[MemoryRecordDeleteInput] | None = None - """ - A list of memory record deletion inputs to be processed in the batch - operation. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BATCH_DELETE_MEMORY_RECORDS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.memory_id is not None: - serializer.write_string( - _SCHEMA_BATCH_DELETE_MEMORY_RECORDS_INPUT.members["memoryId"], - self.memory_id, - ) - - if self.records is not None: - _serialize_memory_records_delete_input_list( - serializer, - _SCHEMA_BATCH_DELETE_MEMORY_RECORDS_INPUT.members["records"], - self.records, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["memory_id"] = de.read_string( - _SCHEMA_BATCH_DELETE_MEMORY_RECORDS_INPUT.members["memoryId"] - ) - - case 1: - kwargs["records"] = _deserialize_memory_records_delete_input_list( - de, _SCHEMA_BATCH_DELETE_MEMORY_RECORDS_INPUT.members["records"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_BATCH_DELETE_MEMORY_RECORDS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class BatchDeleteMemoryRecordsOutput: - """Dataclass for BatchDeleteMemoryRecordsOutput structure.""" - - successful_records: list[MemoryRecordOutput] - """ - A list of memory records that were successfully deleted during the batch - operation. - """ - - failed_records: list[MemoryRecordOutput] - """ - A list of memory records that failed to be deleted, including error - details for each failure. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BATCH_DELETE_MEMORY_RECORDS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_memory_records_output_list( - serializer, - _SCHEMA_BATCH_DELETE_MEMORY_RECORDS_OUTPUT.members["successfulRecords"], - self.successful_records, - ) - _serialize_memory_records_output_list( - serializer, - _SCHEMA_BATCH_DELETE_MEMORY_RECORDS_OUTPUT.members["failedRecords"], - self.failed_records, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["successful_records"] = ( - _deserialize_memory_records_output_list( - de, - _SCHEMA_BATCH_DELETE_MEMORY_RECORDS_OUTPUT.members[ - "successfulRecords" - ], - ) - ) - - case 1: - kwargs["failed_records"] = _deserialize_memory_records_output_list( - de, - _SCHEMA_BATCH_DELETE_MEMORY_RECORDS_OUTPUT.members[ - "failedRecords" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_BATCH_DELETE_MEMORY_RECORDS_OUTPUT, consumer=_consumer - ) - if "successful_records" not in kwargs: - kwargs["successful_records"] = [] - if "failed_records" not in kwargs: - kwargs["failed_records"] = [] - return kwargs - - -BATCH_DELETE_MEMORY_RECORDS = APIOperation( - input=BatchDeleteMemoryRecordsInput, - output=BatchDeleteMemoryRecordsOutput, - schema=_SCHEMA_BATCH_DELETE_MEMORY_RECORDS, - input_schema=_SCHEMA_BATCH_DELETE_MEMORY_RECORDS_INPUT, - output_schema=_SCHEMA_BATCH_DELETE_MEMORY_RECORDS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceException" - ): ServiceException, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottledException" - ): ThrottledException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class MemoryRecordUpdateInput: - """Input structure to update an existing memory record.""" - - memory_record_id: str - """The unique ID of the memory record to be updated.""" - - timestamp: datetime - """Time at which the memory record was updated""" - - content: MemoryContent | None = None - """The content to be stored within the memory record.""" - - namespaces: list[str] | None = None - """ - The updated list of namespace identifiers for categorizing the memory - record. - """ - - source_namespaces: list[str] | None = None - """ - The namespaces of the source memory record being updated. This value is - used for IAM condition key authorization. - """ - - memory_strategy_id: str | None = None - """ - The updated ID of the memory strategy that defines how this memory - record is grouped. - """ - - metadata: dict[str, MemoryRecordMetadataValue] | None = None - """Metadata key-value pairs to be stored with the memory record.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEMORY_RECORD_UPDATE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MEMORY_RECORD_UPDATE_INPUT.members["memoryRecordId"], - self.memory_record_id, - ) - serializer.write_timestamp( - _SCHEMA_MEMORY_RECORD_UPDATE_INPUT.members["timestamp"], self.timestamp - ) - if self.content is not None: - serializer.write_struct( - _SCHEMA_MEMORY_RECORD_UPDATE_INPUT.members["content"], self.content - ) - - if self.namespaces is not None: - _serialize_namespaces_list( - serializer, - _SCHEMA_MEMORY_RECORD_UPDATE_INPUT.members["namespaces"], - self.namespaces, - ) - - if self.source_namespaces is not None: - _serialize_namespaces_list( - serializer, - _SCHEMA_MEMORY_RECORD_UPDATE_INPUT.members["sourceNamespaces"], - self.source_namespaces, - ) - - if self.memory_strategy_id is not None: - serializer.write_string( - _SCHEMA_MEMORY_RECORD_UPDATE_INPUT.members["memoryStrategyId"], - self.memory_strategy_id, - ) - - if self.metadata is not None: - _serialize_memory_record_metadata_map( - serializer, - _SCHEMA_MEMORY_RECORD_UPDATE_INPUT.members["metadata"], - self.metadata, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["memory_record_id"] = de.read_string( - _SCHEMA_MEMORY_RECORD_UPDATE_INPUT.members["memoryRecordId"] - ) - - case 1: - kwargs["timestamp"] = de.read_timestamp( - _SCHEMA_MEMORY_RECORD_UPDATE_INPUT.members["timestamp"] - ) - - case 2: - kwargs["content"] = _MemoryContentDeserializer().deserialize(de) - - case 3: - kwargs["namespaces"] = _deserialize_namespaces_list( - de, _SCHEMA_MEMORY_RECORD_UPDATE_INPUT.members["namespaces"] - ) - - case 4: - kwargs["source_namespaces"] = _deserialize_namespaces_list( - de, - _SCHEMA_MEMORY_RECORD_UPDATE_INPUT.members["sourceNamespaces"], - ) - - case 5: - kwargs["memory_strategy_id"] = de.read_string( - _SCHEMA_MEMORY_RECORD_UPDATE_INPUT.members["memoryStrategyId"] - ) - - case 6: - kwargs["metadata"] = _deserialize_memory_record_metadata_map( - de, _SCHEMA_MEMORY_RECORD_UPDATE_INPUT.members["metadata"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MEMORY_RECORD_UPDATE_INPUT, consumer=_consumer) - if "memory_record_id" not in kwargs: - kwargs["memory_record_id"] = "" - if "timestamp" not in kwargs: - kwargs["timestamp"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_memory_records_update_input_list( - serializer: ShapeSerializer, schema: Schema, value: list[MemoryRecordUpdateInput] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_memory_records_update_input_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[MemoryRecordUpdateInput]: - result: list[MemoryRecordUpdateInput] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(MemoryRecordUpdateInput.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class BatchUpdateMemoryRecordsInput: - """Dataclass for BatchUpdateMemoryRecordsInput structure.""" - - memory_id: str | None = None - """The unique ID of the memory resource where records will be updated.""" - - records: list[MemoryRecordUpdateInput] | None = None - """ - A list of memory record update inputs to be processed in the batch - operation. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BATCH_UPDATE_MEMORY_RECORDS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.memory_id is not None: - serializer.write_string( - _SCHEMA_BATCH_UPDATE_MEMORY_RECORDS_INPUT.members["memoryId"], - self.memory_id, - ) - - if self.records is not None: - _serialize_memory_records_update_input_list( - serializer, - _SCHEMA_BATCH_UPDATE_MEMORY_RECORDS_INPUT.members["records"], - self.records, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["memory_id"] = de.read_string( - _SCHEMA_BATCH_UPDATE_MEMORY_RECORDS_INPUT.members["memoryId"] - ) - - case 1: - kwargs["records"] = _deserialize_memory_records_update_input_list( - de, _SCHEMA_BATCH_UPDATE_MEMORY_RECORDS_INPUT.members["records"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_BATCH_UPDATE_MEMORY_RECORDS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class BatchUpdateMemoryRecordsOutput: - """Dataclass for BatchUpdateMemoryRecordsOutput structure.""" - - successful_records: list[MemoryRecordOutput] - """ - A list of memory records that were successfully updated during the batch - operation. - """ - - failed_records: list[MemoryRecordOutput] - """ - A list of memory records that failed to be updated, including error - details for each failure. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BATCH_UPDATE_MEMORY_RECORDS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_memory_records_output_list( - serializer, - _SCHEMA_BATCH_UPDATE_MEMORY_RECORDS_OUTPUT.members["successfulRecords"], - self.successful_records, - ) - _serialize_memory_records_output_list( - serializer, - _SCHEMA_BATCH_UPDATE_MEMORY_RECORDS_OUTPUT.members["failedRecords"], - self.failed_records, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["successful_records"] = ( - _deserialize_memory_records_output_list( - de, - _SCHEMA_BATCH_UPDATE_MEMORY_RECORDS_OUTPUT.members[ - "successfulRecords" - ], - ) - ) - - case 1: - kwargs["failed_records"] = _deserialize_memory_records_output_list( - de, - _SCHEMA_BATCH_UPDATE_MEMORY_RECORDS_OUTPUT.members[ - "failedRecords" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_BATCH_UPDATE_MEMORY_RECORDS_OUTPUT, consumer=_consumer - ) - if "successful_records" not in kwargs: - kwargs["successful_records"] = [] - if "failed_records" not in kwargs: - kwargs["failed_records"] = [] - return kwargs - - -BATCH_UPDATE_MEMORY_RECORDS = APIOperation( - input=BatchUpdateMemoryRecordsInput, - output=BatchUpdateMemoryRecordsOutput, - schema=_SCHEMA_BATCH_UPDATE_MEMORY_RECORDS, - input_schema=_SCHEMA_BATCH_UPDATE_MEMORY_RECORDS_INPUT, - output_schema=_SCHEMA_BATCH_UPDATE_MEMORY_RECORDS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceException" - ): ServiceException, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottledException" - ): ThrottledException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class Branch: - """ - Contains information about a branch in an AgentCore Memory resource. - Branches allow for organizing events into different conversation threads - or paths. - """ - - name: str - """The name of the branch.""" - - root_event_id: str | None = None - """The identifier of the root event for this branch.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BRANCH, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.root_event_id is not None: - serializer.write_string( - _SCHEMA_BRANCH.members["rootEventId"], self.root_event_id - ) - - serializer.write_string(_SCHEMA_BRANCH.members["name"], self.name) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["root_event_id"] = de.read_string( - _SCHEMA_BRANCH.members["rootEventId"] - ) - - case 1: - kwargs["name"] = de.read_string(_SCHEMA_BRANCH.members["name"]) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BRANCH, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - return kwargs - - -def _serialize_namespace_variables_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_namespace_variables_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ExtractionConfig: - """ - The configuration for extraction behavior. Use this structure to specify - namespace variable keys and their values for namespace substitution - during long-term memory extraction. - """ - - namespace_variables: dict[str, str] | None = None - """ - A map of `namespaceKeys` to their values. The service substitutes these - values into `namespaceTemplates` during long-term memory extraction to - control namespace hierarchy. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EXTRACTION_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.namespace_variables is not None: - _serialize_namespace_variables_map( - serializer, - _SCHEMA_EXTRACTION_CONFIG.members["namespaceVariables"], - self.namespace_variables, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["namespace_variables"] = ( - _deserialize_namespace_variables_map( - de, _SCHEMA_EXTRACTION_CONFIG.members["namespaceVariables"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EXTRACTION_CONFIG, consumer=_consumer) - return kwargs - - -class ExtractionMode(UnknownEnumMixin, StrEnum): - SKIP = "SKIP" - - -@dataclass -class MetadataValueStringValue: - """Value associated with the `eventMetadata` key.""" - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_METADATA_VALUE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_METADATA_VALUE.members["stringValue"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string( - _SCHEMA_METADATA_VALUE.members["stringValue"] - ) - ) - - -@dataclass -class MetadataValueUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -MetadataValue = Union[MetadataValueStringValue | MetadataValueUnknown] -"""Value associated with the `eventMetadata` key.""" - - -class _MetadataValueDeserializer: - _result: MetadataValue | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> MetadataValue: - self._result = None - deserializer.read_struct(_SCHEMA_METADATA_VALUE, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(MetadataValueStringValue.deserialize(de)) - - case _: - self._set_result(MetadataValueUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: MetadataValue) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_metadata_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, MetadataValue] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_struct(value_schema, v)) - - -def _deserialize_metadata_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, MetadataValue]: - result: dict[str, MetadataValue] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = _MetadataValueDeserializer().deserialize(d) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass -class ContentText: - """The text content of the memory item.""" - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_CONTENT.members["text"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=deserializer.read_string(_SCHEMA_CONTENT.members["text"])) - - -@dataclass -class ContentUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -Content = Union[ContentText | ContentUnknown] -"""Contains the content of a memory item.""" - - -class _ContentDeserializer: - _result: Content | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> Content: - self._result = None - deserializer.read_struct(_SCHEMA_CONTENT, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(ContentText.deserialize(de)) - - case _: - self._set_result(ContentUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: Content) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class Role(UnknownEnumMixin, StrEnum): - ASSISTANT = "ASSISTANT" - USER = "USER" - TOOL = "TOOL" - OTHER = "OTHER" - - -@dataclass(kw_only=True) -class Conversational: - """Contains conversational content for an event payload.""" - - content: Content - """The content of the conversation message.""" - - role: str - """ - The role of the participant in the conversation (for example, \"user\" - or \"assistant\"). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONVERSATIONAL, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONVERSATIONAL.members["content"], self.content) - serializer.write_string(_SCHEMA_CONVERSATIONAL.members["role"], self.role) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["content"] = _ContentDeserializer().deserialize(de) - - case 1: - kwargs["role"] = Role( - de.read_string(_SCHEMA_CONVERSATIONAL.members["role"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONVERSATIONAL, consumer=_consumer) - if "content" not in kwargs: - kwargs["content"] = ContentUnknown(tag="") - if "role" not in kwargs: - kwargs["role"] = Role._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class MemoryJsonData: - """ - Contains non-conversational, JSON-formatted content for an event - payload. JSON payloads are extracted into long-term memory. - """ - - content: Document = field(repr=False) - """ - The JSON content of the payload. Accepts any JSON value, including - objects, arrays, strings, numbers, booleans, and null. The maximum size - is 100 KB. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEMORY_JSON_DATA, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_document( - _SCHEMA_MEMORY_JSON_DATA.members["content"], self.content - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["content"] = de.read_document( - _SCHEMA_MEMORY_JSON_DATA.members["content"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MEMORY_JSON_DATA, consumer=_consumer) - if "content" not in kwargs: - kwargs["content"] = Document(None) - return kwargs - - -@dataclass -class PayloadTypeConversational: - """The conversational content of the payload.""" - - value: Conversational - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PAYLOAD_TYPE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_PAYLOAD_TYPE.members["conversational"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=Conversational.deserialize(deserializer)) - - -@dataclass -class PayloadTypeBlob: - """The binary content of the payload.""" - - value: Document - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PAYLOAD_TYPE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_document(_SCHEMA_PAYLOAD_TYPE.members["blob"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_document(_SCHEMA_PAYLOAD_TYPE.members["blob"]) - ) - - -@dataclass -class PayloadTypeJson: - """ - The JSON content of the payload. Use this type to store - non-conversational, JSON-formatted data, such as behavioral events, - activity logs, or system events. - """ - - value: MemoryJsonData - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PAYLOAD_TYPE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PAYLOAD_TYPE.members["json"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=MemoryJsonData.deserialize(deserializer)) - - -@dataclass -class PayloadTypeUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -PayloadType = Union[ - PayloadTypeConversational | PayloadTypeBlob | PayloadTypeJson | PayloadTypeUnknown -] -"""Contains the payload content for an event.""" - - -class _PayloadTypeDeserializer: - _result: PayloadType | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> PayloadType: - self._result = None - deserializer.read_struct(_SCHEMA_PAYLOAD_TYPE, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(PayloadTypeConversational.deserialize(de)) - - case 1: - self._set_result(PayloadTypeBlob.deserialize(de)) - - case 2: - self._set_result(PayloadTypeJson.deserialize(de)) - - case _: - self._set_result(PayloadTypeUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: PayloadType) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_payload_type_list( - serializer: ShapeSerializer, schema: Schema, value: list[PayloadType] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_payload_type_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[PayloadType]: - result: list[PayloadType] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_PayloadTypeDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CreateEventInput: - """Dataclass for CreateEventInput structure.""" - - memory_id: str | None = None - """ - The identifier of the AgentCore Memory resource in which to create the - event. - """ - - actor_id: str | None = None - """ - The identifier of the actor associated with this event. An actor - represents an entity that participates in sessions and generates events. - """ - - session_id: str | None = None - """ - The identifier of the session in which this event occurs. A session - represents a sequence of related events. - """ - - event_timestamp: datetime | None = None - """ - The timestamp when the event occurred. If not specified, the current - time is used. - """ - - payload: list[PayloadType] | None = None - """ - The content payload of the event. This can include conversational data, - JSON data, or binary content. - """ - - branch: Branch | None = None - """ - The branch information for this event. Branches allow for organizing - events into different conversation threads or paths. - """ - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the operation - completes no more than one time. If this token matches a previous - request, AgentCore ignores the request, but does not return an error. - """ - - metadata: dict[str, MetadataValue] | None = None - """The key-value metadata to attach to the event.""" - - extraction_mode: str | None = None - """ - Controls long-term memory extraction for this event. When set to `SKIP`, - the event is stored in short-term memory but is excluded from long-term - memory extraction. If not specified, the event is processed for - extraction as usual. - """ - - extraction_config: ExtractionConfig | None = None - """ - The extraction configuration for long-term memory records. Use this - parameter to specify namespace variable keys and their values for - namespace substitution during extraction. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_EVENT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.memory_id is not None: - serializer.write_string( - _SCHEMA_CREATE_EVENT_INPUT.members["memoryId"], self.memory_id - ) - - if self.actor_id is not None: - serializer.write_string( - _SCHEMA_CREATE_EVENT_INPUT.members["actorId"], self.actor_id - ) - - if self.session_id is not None: - serializer.write_string( - _SCHEMA_CREATE_EVENT_INPUT.members["sessionId"], self.session_id - ) - - if self.event_timestamp is not None: - serializer.write_timestamp( - _SCHEMA_CREATE_EVENT_INPUT.members["eventTimestamp"], - self.event_timestamp, - ) - - if self.payload is not None: - _serialize_payload_type_list( - serializer, _SCHEMA_CREATE_EVENT_INPUT.members["payload"], self.payload - ) - - if self.branch is not None: - serializer.write_struct( - _SCHEMA_CREATE_EVENT_INPUT.members["branch"], self.branch - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_EVENT_INPUT.members["clientToken"], self.client_token - ) - - if self.metadata is not None: - _serialize_metadata_map( - serializer, - _SCHEMA_CREATE_EVENT_INPUT.members["metadata"], - self.metadata, - ) - - if self.extraction_mode is not None: - serializer.write_string( - _SCHEMA_CREATE_EVENT_INPUT.members["extractionMode"], - self.extraction_mode, - ) - - if self.extraction_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_EVENT_INPUT.members["extractionConfig"], - self.extraction_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["memory_id"] = de.read_string( - _SCHEMA_CREATE_EVENT_INPUT.members["memoryId"] - ) - - case 1: - kwargs["actor_id"] = de.read_string( - _SCHEMA_CREATE_EVENT_INPUT.members["actorId"] - ) - - case 2: - kwargs["session_id"] = de.read_string( - _SCHEMA_CREATE_EVENT_INPUT.members["sessionId"] - ) - - case 3: - kwargs["event_timestamp"] = de.read_timestamp( - _SCHEMA_CREATE_EVENT_INPUT.members["eventTimestamp"] - ) - - case 4: - kwargs["payload"] = _deserialize_payload_type_list( - de, _SCHEMA_CREATE_EVENT_INPUT.members["payload"] - ) - - case 5: - kwargs["branch"] = Branch.deserialize(de) - - case 6: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_EVENT_INPUT.members["clientToken"] - ) - - case 7: - kwargs["metadata"] = _deserialize_metadata_map( - de, _SCHEMA_CREATE_EVENT_INPUT.members["metadata"] - ) - - case 8: - kwargs["extraction_mode"] = ExtractionMode( - de.read_string( - _SCHEMA_CREATE_EVENT_INPUT.members["extractionMode"] - ) - ) - - case 9: - kwargs["extraction_config"] = ExtractionConfig.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_EVENT_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Event: - """Contains information about an event in an AgentCore Memory resource.""" - - memory_id: str - """The identifier of the AgentCore Memory resource containing the event.""" - - actor_id: str - """The identifier of the actor associated with the event.""" - - session_id: str - """The identifier of the session containing the event.""" - - event_id: str - """The unique identifier of the event.""" - - event_timestamp: datetime - """The timestamp when the event occurred.""" - - payload: list[PayloadType] - """The content payload of the event.""" - - branch: Branch | None = None - """The branch information for the event.""" - - metadata: dict[str, MetadataValue] | None = None - """Metadata associated with an event.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_EVENT.members["memoryId"], self.memory_id) - serializer.write_string(_SCHEMA_EVENT.members["actorId"], self.actor_id) - serializer.write_string(_SCHEMA_EVENT.members["sessionId"], self.session_id) - serializer.write_string(_SCHEMA_EVENT.members["eventId"], self.event_id) - serializer.write_timestamp( - _SCHEMA_EVENT.members["eventTimestamp"], self.event_timestamp - ) - _serialize_payload_type_list( - serializer, _SCHEMA_EVENT.members["payload"], self.payload - ) - if self.branch is not None: - serializer.write_struct(_SCHEMA_EVENT.members["branch"], self.branch) - - if self.metadata is not None: - _serialize_metadata_map( - serializer, _SCHEMA_EVENT.members["metadata"], self.metadata - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["memory_id"] = de.read_string( - _SCHEMA_EVENT.members["memoryId"] - ) - - case 1: - kwargs["actor_id"] = de.read_string( - _SCHEMA_EVENT.members["actorId"] - ) - - case 2: - kwargs["session_id"] = de.read_string( - _SCHEMA_EVENT.members["sessionId"] - ) - - case 3: - kwargs["event_id"] = de.read_string( - _SCHEMA_EVENT.members["eventId"] - ) - - case 4: - kwargs["event_timestamp"] = de.read_timestamp( - _SCHEMA_EVENT.members["eventTimestamp"] - ) - - case 5: - kwargs["payload"] = _deserialize_payload_type_list( - de, _SCHEMA_EVENT.members["payload"] - ) - - case 6: - kwargs["branch"] = Branch.deserialize(de) - - case 7: - kwargs["metadata"] = _deserialize_metadata_map( - de, _SCHEMA_EVENT.members["metadata"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EVENT, consumer=_consumer) - if "memory_id" not in kwargs: - kwargs["memory_id"] = "" - if "actor_id" not in kwargs: - kwargs["actor_id"] = "" - if "session_id" not in kwargs: - kwargs["session_id"] = "" - if "event_id" not in kwargs: - kwargs["event_id"] = "" - if "event_timestamp" not in kwargs: - kwargs["event_timestamp"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "payload" not in kwargs: - kwargs["payload"] = [] - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls( - memory_id="", - actor_id="", - session_id="", - event_id="", - event_timestamp=datetime.fromtimestamp(0, tz=timezone.utc), - payload=[], - ) - - -@dataclass(kw_only=True) -class CreateEventOutput: - """Dataclass for CreateEventOutput structure.""" - - event: Event - """The event that was created.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_EVENT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CREATE_EVENT_OUTPUT.members["event"], self.event - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["event"] = Event.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_EVENT_OUTPUT, consumer=_consumer) - if "event" not in kwargs: - kwargs["event"] = Event._smithy_default() - return kwargs - - -@dataclass(kw_only=True) -class InvalidInputException(ServiceError): - """ - The input fails to satisfy the constraints specified by AgentCore. Check - your input values and try again. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_INPUT_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_INVALID_INPUT_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_INPUT_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INVALID_INPUT_EXCEPTION, consumer=_consumer) - return kwargs - - -CREATE_EVENT = APIOperation( - input=CreateEventInput, - output=CreateEventOutput, - schema=_SCHEMA_CREATE_EVENT, - input_schema=_SCHEMA_CREATE_EVENT_INPUT, - output_schema=_SCHEMA_CREATE_EVENT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#InvalidInputException" - ): InvalidInputException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#RetryableConflictException" - ): RetryableConflictException, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceException" - ): ServiceException, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottledException" - ): ThrottledException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INVALID_INPUT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_RETRYABLE_CONFLICT_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteEventInput: - """Dataclass for DeleteEventInput structure.""" - - memory_id: str | None = None - """ - The identifier of the AgentCore Memory resource from which to delete the - event. - """ - - session_id: str | None = None - """The identifier of the session containing the event to delete.""" - - event_id: str | None = None - """The identifier of the event to delete.""" - - actor_id: str | None = None - """The identifier of the actor associated with the event to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_EVENT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.memory_id is not None: - serializer.write_string( - _SCHEMA_DELETE_EVENT_INPUT.members["memoryId"], self.memory_id - ) - - if self.session_id is not None: - serializer.write_string( - _SCHEMA_DELETE_EVENT_INPUT.members["sessionId"], self.session_id - ) - - if self.event_id is not None: - serializer.write_string( - _SCHEMA_DELETE_EVENT_INPUT.members["eventId"], self.event_id - ) - - if self.actor_id is not None: - serializer.write_string( - _SCHEMA_DELETE_EVENT_INPUT.members["actorId"], self.actor_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["memory_id"] = de.read_string( - _SCHEMA_DELETE_EVENT_INPUT.members["memoryId"] - ) - - case 1: - kwargs["session_id"] = de.read_string( - _SCHEMA_DELETE_EVENT_INPUT.members["sessionId"] - ) - - case 2: - kwargs["event_id"] = de.read_string( - _SCHEMA_DELETE_EVENT_INPUT.members["eventId"] - ) - - case 3: - kwargs["actor_id"] = de.read_string( - _SCHEMA_DELETE_EVENT_INPUT.members["actorId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_EVENT_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteEventOutput: - """Dataclass for DeleteEventOutput structure.""" - - event_id: str - """The identifier of the event that was deleted.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_EVENT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DELETE_EVENT_OUTPUT.members["eventId"], self.event_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["event_id"] = de.read_string( - _SCHEMA_DELETE_EVENT_OUTPUT.members["eventId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_EVENT_OUTPUT, consumer=_consumer) - if "event_id" not in kwargs: - kwargs["event_id"] = "" - return kwargs - - -DELETE_EVENT = APIOperation( - input=DeleteEventInput, - output=DeleteEventOutput, - schema=_SCHEMA_DELETE_EVENT, - input_schema=_SCHEMA_DELETE_EVENT_INPUT, - output_schema=_SCHEMA_DELETE_EVENT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#InvalidInputException" - ): InvalidInputException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceException" - ): ServiceException, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottledException" - ): ThrottledException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INVALID_INPUT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteMemoryRecordInput: - """Dataclass for DeleteMemoryRecordInput structure.""" - - memory_id: str | None = None - """ - The identifier of the AgentCore Memory resource from which to delete the - memory record. - """ - - memory_record_id: str | None = None - """The identifier of the memory record to delete.""" - - namespace: str | None = None - """ - The namespace of the memory record to delete. This value is used for IAM - condition key authorization. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_MEMORY_RECORD_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.memory_id is not None: - serializer.write_string( - _SCHEMA_DELETE_MEMORY_RECORD_INPUT.members["memoryId"], self.memory_id - ) - - if self.memory_record_id is not None: - serializer.write_string( - _SCHEMA_DELETE_MEMORY_RECORD_INPUT.members["memoryRecordId"], - self.memory_record_id, - ) - - if self.namespace is not None: - serializer.write_string( - _SCHEMA_DELETE_MEMORY_RECORD_INPUT.members["namespace"], self.namespace - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["memory_id"] = de.read_string( - _SCHEMA_DELETE_MEMORY_RECORD_INPUT.members["memoryId"] - ) - - case 1: - kwargs["memory_record_id"] = de.read_string( - _SCHEMA_DELETE_MEMORY_RECORD_INPUT.members["memoryRecordId"] - ) - - case 2: - kwargs["namespace"] = de.read_string( - _SCHEMA_DELETE_MEMORY_RECORD_INPUT.members["namespace"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_MEMORY_RECORD_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteMemoryRecordOutput: - """Dataclass for DeleteMemoryRecordOutput structure.""" - - memory_record_id: str - """The identifier of the memory record that was deleted.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_MEMORY_RECORD_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DELETE_MEMORY_RECORD_OUTPUT.members["memoryRecordId"], - self.memory_record_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["memory_record_id"] = de.read_string( - _SCHEMA_DELETE_MEMORY_RECORD_OUTPUT.members["memoryRecordId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_MEMORY_RECORD_OUTPUT, consumer=_consumer - ) - if "memory_record_id" not in kwargs: - kwargs["memory_record_id"] = "" - return kwargs - - -DELETE_MEMORY_RECORD = APIOperation( - input=DeleteMemoryRecordInput, - output=DeleteMemoryRecordOutput, - schema=_SCHEMA_DELETE_MEMORY_RECORD, - input_schema=_SCHEMA_DELETE_MEMORY_RECORD_INPUT, - output_schema=_SCHEMA_DELETE_MEMORY_RECORD_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#InvalidInputException" - ): InvalidInputException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceException" - ): ServiceException, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottledException" - ): ThrottledException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INVALID_INPUT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetEventInput: - """Dataclass for GetEventInput structure.""" - - memory_id: str | None = None - """The identifier of the AgentCore Memory resource containing the event.""" - - session_id: str | None = None - """The identifier of the session containing the event.""" - - actor_id: str | None = None - """The identifier of the actor associated with the event.""" - - event_id: str | None = None - """The identifier of the event to retrieve.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_EVENT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.memory_id is not None: - serializer.write_string( - _SCHEMA_GET_EVENT_INPUT.members["memoryId"], self.memory_id - ) - - if self.session_id is not None: - serializer.write_string( - _SCHEMA_GET_EVENT_INPUT.members["sessionId"], self.session_id - ) - - if self.actor_id is not None: - serializer.write_string( - _SCHEMA_GET_EVENT_INPUT.members["actorId"], self.actor_id - ) - - if self.event_id is not None: - serializer.write_string( - _SCHEMA_GET_EVENT_INPUT.members["eventId"], self.event_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["memory_id"] = de.read_string( - _SCHEMA_GET_EVENT_INPUT.members["memoryId"] - ) - - case 1: - kwargs["session_id"] = de.read_string( - _SCHEMA_GET_EVENT_INPUT.members["sessionId"] - ) - - case 2: - kwargs["actor_id"] = de.read_string( - _SCHEMA_GET_EVENT_INPUT.members["actorId"] - ) - - case 3: - kwargs["event_id"] = de.read_string( - _SCHEMA_GET_EVENT_INPUT.members["eventId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_EVENT_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetEventOutput: - """Dataclass for GetEventOutput structure.""" - - event: Event - """The requested event information.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_EVENT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_EVENT_OUTPUT.members["event"], self.event) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["event"] = Event.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_EVENT_OUTPUT, consumer=_consumer) - if "event" not in kwargs: - kwargs["event"] = Event._smithy_default() - return kwargs - - -GET_EVENT = APIOperation( - input=GetEventInput, - output=GetEventOutput, - schema=_SCHEMA_GET_EVENT, - input_schema=_SCHEMA_GET_EVENT_INPUT, - output_schema=_SCHEMA_GET_EVENT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#InvalidInputException" - ): InvalidInputException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceException" - ): ServiceException, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottledException" - ): ThrottledException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INVALID_INPUT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetMemoryRecordInput: - """Dataclass for GetMemoryRecordInput structure.""" - - memory_id: str | None = None - """ - The identifier of the AgentCore Memory resource containing the memory - record. - """ - - memory_record_id: str | None = None - """The identifier of the memory record to retrieve.""" - - namespace: str | None = None - """ - The namespace of the memory record to retrieve. This value is used for - IAM condition key authorization. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_MEMORY_RECORD_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.memory_id is not None: - serializer.write_string( - _SCHEMA_GET_MEMORY_RECORD_INPUT.members["memoryId"], self.memory_id - ) - - if self.memory_record_id is not None: - serializer.write_string( - _SCHEMA_GET_MEMORY_RECORD_INPUT.members["memoryRecordId"], - self.memory_record_id, - ) - - if self.namespace is not None: - serializer.write_string( - _SCHEMA_GET_MEMORY_RECORD_INPUT.members["namespace"], self.namespace - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["memory_id"] = de.read_string( - _SCHEMA_GET_MEMORY_RECORD_INPUT.members["memoryId"] - ) - - case 1: - kwargs["memory_record_id"] = de.read_string( - _SCHEMA_GET_MEMORY_RECORD_INPUT.members["memoryRecordId"] - ) - - case 2: - kwargs["namespace"] = de.read_string( - _SCHEMA_GET_MEMORY_RECORD_INPUT.members["namespace"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_MEMORY_RECORD_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class MemoryRecord: - """ - Contains information about a memory record in an AgentCore Memory - resource. - """ - - memory_record_id: str - """The unique identifier of the memory record.""" - - content: MemoryContent - """The content of the memory record.""" - - memory_strategy_id: str - """The identifier of the memory strategy associated with this record.""" - - namespaces: list[str] - """ - The namespaces associated with this memory record. Namespaces help - organize and categorize memory records. - """ - - created_at: datetime - """The timestamp when the memory record was created.""" - - metadata: dict[str, MemoryRecordMetadataValue] | None = None - """A map of metadata key-value pairs associated with a memory record.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEMORY_RECORD, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MEMORY_RECORD.members["memoryRecordId"], self.memory_record_id - ) - serializer.write_struct(_SCHEMA_MEMORY_RECORD.members["content"], self.content) - serializer.write_string( - _SCHEMA_MEMORY_RECORD.members["memoryStrategyId"], self.memory_strategy_id - ) - _serialize_namespaces_list( - serializer, _SCHEMA_MEMORY_RECORD.members["namespaces"], self.namespaces - ) - serializer.write_timestamp( - _SCHEMA_MEMORY_RECORD.members["createdAt"], self.created_at - ) - if self.metadata is not None: - _serialize_memory_record_metadata_map( - serializer, _SCHEMA_MEMORY_RECORD.members["metadata"], self.metadata - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["memory_record_id"] = de.read_string( - _SCHEMA_MEMORY_RECORD.members["memoryRecordId"] - ) - - case 1: - kwargs["content"] = _MemoryContentDeserializer().deserialize(de) - - case 2: - kwargs["memory_strategy_id"] = de.read_string( - _SCHEMA_MEMORY_RECORD.members["memoryStrategyId"] - ) - - case 3: - kwargs["namespaces"] = _deserialize_namespaces_list( - de, _SCHEMA_MEMORY_RECORD.members["namespaces"] - ) - - case 4: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_MEMORY_RECORD.members["createdAt"] - ) - - case 5: - kwargs["metadata"] = _deserialize_memory_record_metadata_map( - de, _SCHEMA_MEMORY_RECORD.members["metadata"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MEMORY_RECORD, consumer=_consumer) - if "memory_record_id" not in kwargs: - kwargs["memory_record_id"] = "" - if "content" not in kwargs: - kwargs["content"] = MemoryContentUnknown(tag="") - if "memory_strategy_id" not in kwargs: - kwargs["memory_strategy_id"] = "" - if "namespaces" not in kwargs: - kwargs["namespaces"] = [] - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls( - memory_record_id="", - content=MemoryContentUnknown(tag=""), - memory_strategy_id="", - namespaces=[], - created_at=datetime.fromtimestamp(0, tz=timezone.utc), - ) - - -@dataclass(kw_only=True) -class GetMemoryRecordOutput: - """Dataclass for GetMemoryRecordOutput structure.""" - - memory_record: MemoryRecord - """The requested memory record.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_MEMORY_RECORD_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_MEMORY_RECORD_OUTPUT.members["memoryRecord"], self.memory_record - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["memory_record"] = MemoryRecord.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_MEMORY_RECORD_OUTPUT, consumer=_consumer) - if "memory_record" not in kwargs: - kwargs["memory_record"] = MemoryRecord._smithy_default() - return kwargs - - -GET_MEMORY_RECORD = APIOperation( - input=GetMemoryRecordInput, - output=GetMemoryRecordOutput, - schema=_SCHEMA_GET_MEMORY_RECORD, - input_schema=_SCHEMA_GET_MEMORY_RECORD_INPUT, - output_schema=_SCHEMA_GET_MEMORY_RECORD_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#InvalidInputException" - ): InvalidInputException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceException" - ): ServiceException, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottledException" - ): ThrottledException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INVALID_INPUT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass -class IngestPayloadTypeConversational: - """The conversational content for this payload item.""" - - value: Conversational - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INGEST_PAYLOAD_TYPE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INGEST_PAYLOAD_TYPE.members["conversational"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=Conversational.deserialize(deserializer)) - - -@dataclass -class IngestPayloadTypeJson: - """The JSON content for this payload item.""" - - value: MemoryJsonData - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INGEST_PAYLOAD_TYPE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INGEST_PAYLOAD_TYPE.members["json"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=MemoryJsonData.deserialize(deserializer)) - - -@dataclass -class IngestPayloadTypeUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -IngestPayloadType = Union[ - IngestPayloadTypeConversational | IngestPayloadTypeJson | IngestPayloadTypeUnknown -] -""" -A single content payload item to ingest. A payload item contains either -conversational or JSON content. -""" - - -class _IngestPayloadTypeDeserializer: - _result: IngestPayloadType | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> IngestPayloadType: - self._result = None - deserializer.read_struct(_SCHEMA_INGEST_PAYLOAD_TYPE, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(IngestPayloadTypeConversational.deserialize(de)) - - case 1: - self._set_result(IngestPayloadTypeJson.deserialize(de)) - - case _: - self._set_result( - IngestPayloadTypeUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: IngestPayloadType) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_ingest_payload_list( - serializer: ShapeSerializer, schema: Schema, value: list[IngestPayloadType] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_ingest_payload_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[IngestPayloadType]: - result: list[IngestPayloadType] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_IngestPayloadTypeDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class InlineMemoryContent: - """ - The content included directly in the request as one or more payload - items. - """ - - payload: list[IngestPayloadType] - """The list of content payload items to ingest.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INLINE_MEMORY_CONTENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_ingest_payload_list( - serializer, _SCHEMA_INLINE_MEMORY_CONTENT.members["payload"], self.payload - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["payload"] = _deserialize_ingest_payload_list( - de, _SCHEMA_INLINE_MEMORY_CONTENT.members["payload"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INLINE_MEMORY_CONTENT, consumer=_consumer) - if "payload" not in kwargs: - kwargs["payload"] = [] - return kwargs - - -@dataclass -class ContentSourceInline: - """The content included directly in the request.""" - - value: InlineMemoryContent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT_SOURCE.members["inline"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=InlineMemoryContent.deserialize(deserializer)) - - -@dataclass -class ContentSourceUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ContentSource = Union[ContentSourceInline | ContentSourceUnknown] -"""The source of the content to ingest. Only inline content is supported.""" - - -class _ContentSourceDeserializer: - _result: ContentSource | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> ContentSource: - self._result = None - deserializer.read_struct(_SCHEMA_CONTENT_SOURCE, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(ContentSourceInline.deserialize(de)) - - case _: - self._set_result(ContentSourceUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: ContentSource) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class IngestDataInput: - """Dataclass for IngestDataInput structure.""" - - memory_id: str | None = None - """The identifier of the AgentCore Memory resource to ingest content into.""" - - source: ContentSource | None = None - """The content to ingest. Only inline content is supported.""" - - content_timestamp: datetime | None = None - """The timestamp of when the content occurred.""" - - actor_id: str | None = None - """ - The identifier of the actor associated with this content. An actor - represents an entity that participates in sessions and generates - content. - """ - - session_id: str | None = None - """ - The identifier of the session that the content belongs to. If not - provided, a session identifier is generated and returned in the - response. - """ - - extraction_config: ExtractionConfig | None = None - """ - The extraction configuration for long-term memory records. Use this - parameter to specify namespace variable keys and their values for - namespace substitution during extraction. - """ - - metadata: dict[str, MetadataValue] | None = None - """The key-value metadata to attach to the content.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the operation - completes no more than one time. If this token matches a previous - request, AgentCore ignores the request, but does not return an error. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INGEST_DATA_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.memory_id is not None: - serializer.write_string( - _SCHEMA_INGEST_DATA_INPUT.members["memoryId"], self.memory_id - ) - - if self.source is not None: - serializer.write_struct( - _SCHEMA_INGEST_DATA_INPUT.members["source"], self.source - ) - - if self.content_timestamp is not None: - serializer.write_timestamp( - _SCHEMA_INGEST_DATA_INPUT.members["contentTimestamp"], - self.content_timestamp, - ) - - if self.actor_id is not None: - serializer.write_string( - _SCHEMA_INGEST_DATA_INPUT.members["actorId"], self.actor_id - ) - - if self.session_id is not None: - serializer.write_string( - _SCHEMA_INGEST_DATA_INPUT.members["sessionId"], self.session_id - ) - - if self.extraction_config is not None: - serializer.write_struct( - _SCHEMA_INGEST_DATA_INPUT.members["extractionConfig"], - self.extraction_config, - ) - - if self.metadata is not None: - _serialize_metadata_map( - serializer, _SCHEMA_INGEST_DATA_INPUT.members["metadata"], self.metadata - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_INGEST_DATA_INPUT.members["clientToken"], self.client_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["memory_id"] = de.read_string( - _SCHEMA_INGEST_DATA_INPUT.members["memoryId"] - ) - - case 1: - kwargs["source"] = _ContentSourceDeserializer().deserialize(de) - - case 2: - kwargs["content_timestamp"] = de.read_timestamp( - _SCHEMA_INGEST_DATA_INPUT.members["contentTimestamp"] - ) - - case 3: - kwargs["actor_id"] = de.read_string( - _SCHEMA_INGEST_DATA_INPUT.members["actorId"] - ) - - case 4: - kwargs["session_id"] = de.read_string( - _SCHEMA_INGEST_DATA_INPUT.members["sessionId"] - ) - - case 5: - kwargs["extraction_config"] = ExtractionConfig.deserialize(de) - - case 6: - kwargs["metadata"] = _deserialize_metadata_map( - de, _SCHEMA_INGEST_DATA_INPUT.members["metadata"] - ) - - case 7: - kwargs["client_token"] = de.read_string( - _SCHEMA_INGEST_DATA_INPUT.members["clientToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INGEST_DATA_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class IngestDataOutput: - """Dataclass for IngestDataOutput structure.""" - - session_id: str - """ - The identifier of the session that the service ingested the content - into. This value echoes the session identifier from the request, or the - identifier that the service generated when you did not provide one. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INGEST_DATA_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_INGEST_DATA_OUTPUT.members["sessionId"], self.session_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["session_id"] = de.read_string( - _SCHEMA_INGEST_DATA_OUTPUT.members["sessionId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INGEST_DATA_OUTPUT, consumer=_consumer) - if "session_id" not in kwargs: - kwargs["session_id"] = "" - return kwargs - - -INGEST_DATA = APIOperation( - input=IngestDataInput, - output=IngestDataOutput, - schema=_SCHEMA_INGEST_DATA, - input_schema=_SCHEMA_INGEST_DATA_INPUT, - output_schema=_SCHEMA_INGEST_DATA_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceException" - ): ServiceException, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottledException" - ): ThrottledException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListActorsInput: - """Dataclass for ListActorsInput structure.""" - - memory_id: str | None = None - """ - The identifier of the AgentCore Memory resource for which to list - actors. - """ - - max_results: int = 100 - """ - The maximum number of results to return in a single call. The default - value is 20. - """ - - next_token: str | None = None - """ - The token for the next set of results. Use the value returned in the - previous response in the next request to retrieve the next set of - results. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_ACTORS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.memory_id is not None: - serializer.write_string( - _SCHEMA_LIST_ACTORS_INPUT.members["memoryId"], self.memory_id - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_ACTORS_INPUT.members["maxResults"], self.max_results - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_ACTORS_INPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["memory_id"] = de.read_string( - _SCHEMA_LIST_ACTORS_INPUT.members["memoryId"] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_ACTORS_INPUT.members["maxResults"] - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_ACTORS_INPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_ACTORS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ListActorsOutput: - """Dataclass for ListActorsOutput structure.""" - - actor_summaries: list[ActorSummary] - """The list of actor summaries.""" - - next_token: str | None = None - """ - The token to use in a subsequent request to get the next set of results. - This value is null when there are no more results to return. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_ACTORS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_actor_summary_list( - serializer, - _SCHEMA_LIST_ACTORS_OUTPUT.members["actorSummaries"], - self.actor_summaries, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_ACTORS_OUTPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["actor_summaries"] = _deserialize_actor_summary_list( - de, _SCHEMA_LIST_ACTORS_OUTPUT.members["actorSummaries"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_ACTORS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_ACTORS_OUTPUT, consumer=_consumer) - if "actor_summaries" not in kwargs: - kwargs["actor_summaries"] = [] - return kwargs - - -LIST_ACTORS = APIOperation( - input=ListActorsInput, - output=ListActorsOutput, - schema=_SCHEMA_LIST_ACTORS, - input_schema=_SCHEMA_LIST_ACTORS_INPUT, - output_schema=_SCHEMA_LIST_ACTORS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#InvalidInputException" - ): InvalidInputException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceException" - ): ServiceException, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottledException" - ): ThrottledException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INVALID_INPUT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class BranchFilter: - """Contains filter criteria for branches when listing events.""" - - name: str - """The name of the branch to filter by.""" - - include_parent_branches: bool = True - """ - Specifies whether to include parent branches in the results. Set to true - to include parent branches, or false to exclude them. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BRANCH_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_BRANCH_FILTER.members["name"], self.name) - serializer.write_boolean( - _SCHEMA_BRANCH_FILTER.members["includeParentBranches"], - self.include_parent_branches, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_BRANCH_FILTER.members["name"] - ) - - case 1: - kwargs["include_parent_branches"] = de.read_boolean( - _SCHEMA_BRANCH_FILTER.members["includeParentBranches"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BRANCH_FILTER, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - return kwargs - - -@dataclass -class LeftExpressionMetadataKey: - """Key associated with the metadata in an event.""" - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LEFT_EXPRESSION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_LEFT_EXPRESSION.members["metadataKey"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string( - _SCHEMA_LEFT_EXPRESSION.members["metadataKey"] - ) - ) - - -@dataclass -class LeftExpressionUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -LeftExpression = Union[LeftExpressionMetadataKey | LeftExpressionUnknown] -"""Left expression of the event metadata filter.""" - - -class _LeftExpressionDeserializer: - _result: LeftExpression | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> LeftExpression: - self._result = None - deserializer.read_struct(_SCHEMA_LEFT_EXPRESSION, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(LeftExpressionMetadataKey.deserialize(de)) - - case _: - self._set_result(LeftExpressionUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: LeftExpression) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class OperatorType(UnknownEnumMixin, StrEnum): - EQUALS_TO = "EQUALS_TO" - EXISTS = "EXISTS" - NOT_EXISTS = "NOT_EXISTS" - - -@dataclass -class RightExpressionMetadataValue: - """Value associated with the key in `eventMetadata`.""" - - value: MetadataValue - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RIGHT_EXPRESSION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RIGHT_EXPRESSION.members["metadataValue"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=_MetadataValueDeserializer().deserialize(deserializer)) - - -@dataclass -class RightExpressionUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -RightExpression = Union[RightExpressionMetadataValue | RightExpressionUnknown] -"""Right expression of the `eventMetadata`filter.""" - - -class _RightExpressionDeserializer: - _result: RightExpression | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> RightExpression: - self._result = None - deserializer.read_struct(_SCHEMA_RIGHT_EXPRESSION, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(RightExpressionMetadataValue.deserialize(de)) - - case _: - self._set_result( - RightExpressionUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: RightExpression) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class EventMetadataFilterExpression: - """ - Filter expression for retrieving events based on metadata associated - with an event. - """ - - left: LeftExpression - """Left operand of the event metadata filter expression.""" - - operator: str - """Operator applied to the event metadata filter expression.""" - - right: RightExpression | None = None - """Right operand of the event metadata filter expression.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVENT_METADATA_FILTER_EXPRESSION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_EVENT_METADATA_FILTER_EXPRESSION.members["left"], self.left - ) - serializer.write_string( - _SCHEMA_EVENT_METADATA_FILTER_EXPRESSION.members["operator"], self.operator - ) - if self.right is not None: - serializer.write_struct( - _SCHEMA_EVENT_METADATA_FILTER_EXPRESSION.members["right"], self.right - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["left"] = _LeftExpressionDeserializer().deserialize(de) - - case 1: - kwargs["operator"] = OperatorType( - de.read_string( - _SCHEMA_EVENT_METADATA_FILTER_EXPRESSION.members["operator"] - ) - ) - - case 2: - kwargs["right"] = _RightExpressionDeserializer().deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EVENT_METADATA_FILTER_EXPRESSION, consumer=_consumer - ) - if "left" not in kwargs: - kwargs["left"] = LeftExpressionUnknown(tag="") - if "operator" not in kwargs: - kwargs["operator"] = OperatorType._corrected("") - return kwargs - - -def _serialize_event_metadata_filter_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[EventMetadataFilterExpression], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_event_metadata_filter_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[EventMetadataFilterExpression]: - result: list[EventMetadataFilterExpression] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(EventMetadataFilterExpression.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class FilterInput: - """Contains filter criteria for listing events.""" - - branch: BranchFilter | None = None - """The branch filter criteria to apply when listing events.""" - - event_metadata: list[EventMetadataFilterExpression] | None = None - """Event metadata filter criteria to apply when retrieving events.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FILTER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.branch is not None: - serializer.write_struct(_SCHEMA_FILTER_INPUT.members["branch"], self.branch) - - if self.event_metadata is not None: - _serialize_event_metadata_filter_list( - serializer, - _SCHEMA_FILTER_INPUT.members["eventMetadata"], - self.event_metadata, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["branch"] = BranchFilter.deserialize(de) - - case 1: - kwargs["event_metadata"] = _deserialize_event_metadata_filter_list( - de, _SCHEMA_FILTER_INPUT.members["eventMetadata"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FILTER_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ListEventsInput: - """Dataclass for ListEventsInput structure.""" - - memory_id: str | None = None - """ - The identifier of the AgentCore Memory resource for which to list - events. - """ - - session_id: str | None = None - """The identifier of the session for which to list events.""" - - actor_id: str | None = None - """The identifier of the actor for which to list events.""" - - include_payloads: bool = True - """ - Specifies whether to include event payloads in the response. Set to true - to include payloads, or false to exclude them. - """ - - filter: FilterInput | None = None - """Filter criteria to apply when listing events.""" - - max_results: int = 100 - """ - The maximum number of results to return in a single call. The default - value is 20. - """ - - next_token: str | None = None - """ - The token for the next set of results. Use the value returned in the - previous response in the next request to retrieve the next set of - results. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_EVENTS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.memory_id is not None: - serializer.write_string( - _SCHEMA_LIST_EVENTS_INPUT.members["memoryId"], self.memory_id - ) - - if self.session_id is not None: - serializer.write_string( - _SCHEMA_LIST_EVENTS_INPUT.members["sessionId"], self.session_id - ) - - if self.actor_id is not None: - serializer.write_string( - _SCHEMA_LIST_EVENTS_INPUT.members["actorId"], self.actor_id - ) - - if self.include_payloads is not None: - serializer.write_boolean( - _SCHEMA_LIST_EVENTS_INPUT.members["includePayloads"], - self.include_payloads, - ) - - if self.filter is not None: - serializer.write_struct( - _SCHEMA_LIST_EVENTS_INPUT.members["filter"], self.filter - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_EVENTS_INPUT.members["maxResults"], self.max_results - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_EVENTS_INPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["memory_id"] = de.read_string( - _SCHEMA_LIST_EVENTS_INPUT.members["memoryId"] - ) - - case 1: - kwargs["session_id"] = de.read_string( - _SCHEMA_LIST_EVENTS_INPUT.members["sessionId"] - ) - - case 2: - kwargs["actor_id"] = de.read_string( - _SCHEMA_LIST_EVENTS_INPUT.members["actorId"] - ) - - case 3: - kwargs["include_payloads"] = de.read_boolean( - _SCHEMA_LIST_EVENTS_INPUT.members["includePayloads"] - ) - - case 4: - kwargs["filter"] = FilterInput.deserialize(de) - - case 5: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_EVENTS_INPUT.members["maxResults"] - ) - - case 6: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_EVENTS_INPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_EVENTS_INPUT, consumer=_consumer) - return kwargs - - -def _serialize_event_list( - serializer: ShapeSerializer, schema: Schema, value: list[Event] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_event_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Event]: - result: list[Event] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Event.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListEventsOutput: - """Dataclass for ListEventsOutput structure.""" - - events: list[Event] - """The list of events that match the specified criteria.""" - - next_token: str | None = None - """ - The token to use in a subsequent request to get the next set of results. - This value is null when there are no more results to return. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_EVENTS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_event_list( - serializer, _SCHEMA_LIST_EVENTS_OUTPUT.members["events"], self.events - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_EVENTS_OUTPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["events"] = _deserialize_event_list( - de, _SCHEMA_LIST_EVENTS_OUTPUT.members["events"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_EVENTS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_EVENTS_OUTPUT, consumer=_consumer) - if "events" not in kwargs: - kwargs["events"] = [] - return kwargs - - -LIST_EVENTS = APIOperation( - input=ListEventsInput, - output=ListEventsOutput, - schema=_SCHEMA_LIST_EVENTS, - input_schema=_SCHEMA_LIST_EVENTS_INPUT, - output_schema=_SCHEMA_LIST_EVENTS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#InvalidInputException" - ): InvalidInputException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceException" - ): ServiceException, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottledException" - ): ThrottledException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INVALID_INPUT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class ExtractionJobStatus(UnknownEnumMixin, StrEnum): - FAILED = "FAILED" - - -@dataclass(kw_only=True) -class ExtractionJobFilterInput: - """Filters for querying memory extraction jobs based on various criteria.""" - - strategy_id: str | None = None - """ - The memory strategy identifier to filter extraction jobs by. If - specified, only extraction jobs with this strategy ID are returned. - """ - - session_id: str | None = None - """ - The unique identifier of the session. If specified, only extraction jobs - with this session ID are returned. - """ - - actor_id: str | None = None - """ - The identifier of the actor. If specified, only extraction jobs with - this actor ID are returned. - """ - - status: str | None = None - """ - The status of the extraction job. If specified, only extraction jobs - with this status are returned. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EXTRACTION_JOB_FILTER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.strategy_id is not None: - serializer.write_string( - _SCHEMA_EXTRACTION_JOB_FILTER_INPUT.members["strategyId"], - self.strategy_id, - ) - - if self.session_id is not None: - serializer.write_string( - _SCHEMA_EXTRACTION_JOB_FILTER_INPUT.members["sessionId"], - self.session_id, - ) - - if self.actor_id is not None: - serializer.write_string( - _SCHEMA_EXTRACTION_JOB_FILTER_INPUT.members["actorId"], self.actor_id - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_EXTRACTION_JOB_FILTER_INPUT.members["status"], self.status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["strategy_id"] = de.read_string( - _SCHEMA_EXTRACTION_JOB_FILTER_INPUT.members["strategyId"] - ) - - case 1: - kwargs["session_id"] = de.read_string( - _SCHEMA_EXTRACTION_JOB_FILTER_INPUT.members["sessionId"] - ) - - case 2: - kwargs["actor_id"] = de.read_string( - _SCHEMA_EXTRACTION_JOB_FILTER_INPUT.members["actorId"] - ) - - case 3: - kwargs["status"] = ExtractionJobStatus( - de.read_string( - _SCHEMA_EXTRACTION_JOB_FILTER_INPUT.members["status"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EXTRACTION_JOB_FILTER_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ListMemoryExtractionJobsInput: - """Dataclass for ListMemoryExtractionJobsInput structure.""" - - memory_id: str | None = None - """The unique identifier of the memory to list extraction jobs for.""" - - max_results: int = 20 - """ - The maximum number of results to return in a single call. The default - value is 20. - """ - - filter: ExtractionJobFilterInput | None = None - """Filter criteria to apply when listing extraction jobs.""" - - next_token: str | None = None - """ - The token for the next set of results. Use the value returned in the - previous response in the next request to retrieve the next set of - results. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_MEMORY_EXTRACTION_JOBS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.memory_id is not None: - serializer.write_string( - _SCHEMA_LIST_MEMORY_EXTRACTION_JOBS_INPUT.members["memoryId"], - self.memory_id, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_MEMORY_EXTRACTION_JOBS_INPUT.members["maxResults"], - self.max_results, - ) - - if self.filter is not None: - serializer.write_struct( - _SCHEMA_LIST_MEMORY_EXTRACTION_JOBS_INPUT.members["filter"], self.filter - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_MEMORY_EXTRACTION_JOBS_INPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["memory_id"] = de.read_string( - _SCHEMA_LIST_MEMORY_EXTRACTION_JOBS_INPUT.members["memoryId"] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_MEMORY_EXTRACTION_JOBS_INPUT.members["maxResults"] - ) - - case 2: - kwargs["filter"] = ExtractionJobFilterInput.deserialize(de) - - case 3: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_MEMORY_EXTRACTION_JOBS_INPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_MEMORY_EXTRACTION_JOBS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class MessageMetadata: - """Metadata information associated with this message.""" - - event_id: str - """The identifier of the event associated with this message.""" - - message_index: int - """ - The position of this message within that event's ordered list of - messages. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MESSAGE_METADATA, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MESSAGE_METADATA.members["eventId"], self.event_id - ) - serializer.write_integer( - _SCHEMA_MESSAGE_METADATA.members["messageIndex"], self.message_index - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["event_id"] = de.read_string( - _SCHEMA_MESSAGE_METADATA.members["eventId"] - ) - - case 1: - kwargs["message_index"] = de.read_integer( - _SCHEMA_MESSAGE_METADATA.members["messageIndex"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MESSAGE_METADATA, consumer=_consumer) - if "event_id" not in kwargs: - kwargs["event_id"] = "" - if "message_index" not in kwargs: - kwargs["message_index"] = 0 - return kwargs - - -def _serialize_messages_list( - serializer: ShapeSerializer, schema: Schema, value: list[MessageMetadata] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_messages_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[MessageMetadata]: - result: list[MessageMetadata] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(MessageMetadata.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass -class ExtractionJobMessagesMessagesList: - """The list of messages that compose this extraction job.""" - - value: list[MessageMetadata] - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EXTRACTION_JOB_MESSAGES, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_messages_list( - serializer, - _SCHEMA_EXTRACTION_JOB_MESSAGES.members["messagesList"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_deserialize_messages_list( - deserializer, _SCHEMA_EXTRACTION_JOB_MESSAGES.members["messagesList"] - ) - ) - - -@dataclass -class ExtractionJobMessagesUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ExtractionJobMessages = Union[ - ExtractionJobMessagesMessagesList | ExtractionJobMessagesUnknown -] -"""The list of messages that compose this extraction job.""" - - -class _ExtractionJobMessagesDeserializer: - _result: ExtractionJobMessages | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> ExtractionJobMessages: - self._result = None - deserializer.read_struct(_SCHEMA_EXTRACTION_JOB_MESSAGES, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(ExtractionJobMessagesMessagesList.deserialize(de)) - - case _: - self._set_result( - ExtractionJobMessagesUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: ExtractionJobMessages) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class ExtractionJobMetadata: - """Metadata information associated with this extraction job.""" - - job_id: str - """The unique identifier for the extraction job.""" - - messages: ExtractionJobMessages - """The messages associated with the extraction job.""" - - status: str | None = None - """The current status of the extraction job.""" - - failure_reason: str | None = None - """The cause of failure, if the job did not complete successfully.""" - - strategy_id: str | None = None - """The identifier of the memory strategy for this extraction job.""" - - session_id: str | None = None - """The identifier of the session for this extraction job.""" - - actor_id: str | None = None - """The identifier of the actor for this extraction job.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EXTRACTION_JOB_METADATA, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_EXTRACTION_JOB_METADATA.members["jobID"], self.job_id - ) - serializer.write_struct( - _SCHEMA_EXTRACTION_JOB_METADATA.members["messages"], self.messages - ) - if self.status is not None: - serializer.write_string( - _SCHEMA_EXTRACTION_JOB_METADATA.members["status"], self.status - ) - - if self.failure_reason is not None: - serializer.write_string( - _SCHEMA_EXTRACTION_JOB_METADATA.members["failureReason"], - self.failure_reason, - ) - - if self.strategy_id is not None: - serializer.write_string( - _SCHEMA_EXTRACTION_JOB_METADATA.members["strategyId"], self.strategy_id - ) - - if self.session_id is not None: - serializer.write_string( - _SCHEMA_EXTRACTION_JOB_METADATA.members["sessionId"], self.session_id - ) - - if self.actor_id is not None: - serializer.write_string( - _SCHEMA_EXTRACTION_JOB_METADATA.members["actorId"], self.actor_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["job_id"] = de.read_string( - _SCHEMA_EXTRACTION_JOB_METADATA.members["jobID"] - ) - - case 1: - kwargs["messages"] = ( - _ExtractionJobMessagesDeserializer().deserialize(de) - ) - - case 2: - kwargs["status"] = ExtractionJobStatus( - de.read_string( - _SCHEMA_EXTRACTION_JOB_METADATA.members["status"] - ) - ) - - case 3: - kwargs["failure_reason"] = de.read_string( - _SCHEMA_EXTRACTION_JOB_METADATA.members["failureReason"] - ) - - case 4: - kwargs["strategy_id"] = de.read_string( - _SCHEMA_EXTRACTION_JOB_METADATA.members["strategyId"] - ) - - case 5: - kwargs["session_id"] = de.read_string( - _SCHEMA_EXTRACTION_JOB_METADATA.members["sessionId"] - ) - - case 6: - kwargs["actor_id"] = de.read_string( - _SCHEMA_EXTRACTION_JOB_METADATA.members["actorId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EXTRACTION_JOB_METADATA, consumer=_consumer) - if "job_id" not in kwargs: - kwargs["job_id"] = "" - if "messages" not in kwargs: - kwargs["messages"] = ExtractionJobMessagesUnknown(tag="") - return kwargs - - -def _serialize_extraction_job_metadata_list( - serializer: ShapeSerializer, schema: Schema, value: list[ExtractionJobMetadata] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_extraction_job_metadata_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ExtractionJobMetadata]: - result: list[ExtractionJobMetadata] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ExtractionJobMetadata.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListMemoryExtractionJobsOutput: - """Dataclass for ListMemoryExtractionJobsOutput structure.""" - - jobs: list[ExtractionJobMetadata] - """List of extraction job metadata matching the specified criteria.""" - - next_token: str | None = None - """Token to retrieve the next page of results, if available.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_MEMORY_EXTRACTION_JOBS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_extraction_job_metadata_list( - serializer, - _SCHEMA_LIST_MEMORY_EXTRACTION_JOBS_OUTPUT.members["jobs"], - self.jobs, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_MEMORY_EXTRACTION_JOBS_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["jobs"] = _deserialize_extraction_job_metadata_list( - de, _SCHEMA_LIST_MEMORY_EXTRACTION_JOBS_OUTPUT.members["jobs"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_MEMORY_EXTRACTION_JOBS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_MEMORY_EXTRACTION_JOBS_OUTPUT, consumer=_consumer - ) - if "jobs" not in kwargs: - kwargs["jobs"] = [] - return kwargs - - -LIST_MEMORY_EXTRACTION_JOBS = APIOperation( - input=ListMemoryExtractionJobsInput, - output=ListMemoryExtractionJobsOutput, - schema=_SCHEMA_LIST_MEMORY_EXTRACTION_JOBS, - input_schema=_SCHEMA_LIST_MEMORY_EXTRACTION_JOBS_INPUT, - output_schema=_SCHEMA_LIST_MEMORY_EXTRACTION_JOBS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceException" - ): ServiceException, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottledException" - ): ThrottledException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass -class MemoryRecordLeftExpressionMetadataKey: - """The metadata key to filter on.""" - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEMORY_RECORD_LEFT_EXPRESSION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MEMORY_RECORD_LEFT_EXPRESSION.members["metadataKey"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string( - _SCHEMA_MEMORY_RECORD_LEFT_EXPRESSION.members["metadataKey"] - ) - ) - - -@dataclass -class MemoryRecordLeftExpressionUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -MemoryRecordLeftExpression = Union[ - MemoryRecordLeftExpressionMetadataKey | MemoryRecordLeftExpressionUnknown -] -"""The left-hand side of a memory record metadata filter expression.""" - - -class _MemoryRecordLeftExpressionDeserializer: - _result: MemoryRecordLeftExpression | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> MemoryRecordLeftExpression: - self._result = None - deserializer.read_struct(_SCHEMA_MEMORY_RECORD_LEFT_EXPRESSION, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(MemoryRecordLeftExpressionMetadataKey.deserialize(de)) - - case _: - self._set_result( - MemoryRecordLeftExpressionUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: MemoryRecordLeftExpression) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class MemoryRecordOperatorType(UnknownEnumMixin, StrEnum): - EQUALS_TO = "EQUALS_TO" - EXISTS = "EXISTS" - NOT_EXISTS = "NOT_EXISTS" - BEFORE = "BEFORE" - AFTER = "AFTER" - CONTAINS = "CONTAINS" - GREATER_THAN = "GREATER_THAN" - GREATER_THAN_OR_EQUALS = "GREATER_THAN_OR_EQUALS" - LESS_THAN = "LESS_THAN" - LESS_THAN_OR_EQUALS = "LESS_THAN_OR_EQUALS" - - -@dataclass -class MemoryRecordRightExpressionMetadataValue: - """The metadata value to compare against.""" - - value: MemoryRecordMetadataValue - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEMORY_RECORD_RIGHT_EXPRESSION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MEMORY_RECORD_RIGHT_EXPRESSION.members["metadataValue"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_MemoryRecordMetadataValueDeserializer().deserialize(deserializer) - ) - - -@dataclass -class MemoryRecordRightExpressionUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -MemoryRecordRightExpression = Union[ - MemoryRecordRightExpressionMetadataValue | MemoryRecordRightExpressionUnknown -] -"""The right-hand side of a memory record metadata filter expression.""" - - -class _MemoryRecordRightExpressionDeserializer: - _result: MemoryRecordRightExpression | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> MemoryRecordRightExpression: - self._result = None - deserializer.read_struct(_SCHEMA_MEMORY_RECORD_RIGHT_EXPRESSION, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - MemoryRecordRightExpressionMetadataValue.deserialize(de) - ) - - case _: - self._set_result( - MemoryRecordRightExpressionUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: MemoryRecordRightExpression) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class MemoryMetadataFilterExpression: - """ - Filters to apply to metadata associated with a memory. Specify the - metadata key and value in the `left` and `right` fields and use the - `operator` field to define the relationship to match. - """ - - left: MemoryRecordLeftExpression - """The metadata key to evaluate.""" - - operator: str - """ - The relationship between the metadata key and value to match when - applying the metadata filter. - """ - - right: MemoryRecordRightExpression | None = None - """ - The value to compare against. Required for all operators except EXISTS - and NOT_EXISTS. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEMORY_METADATA_FILTER_EXPRESSION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MEMORY_METADATA_FILTER_EXPRESSION.members["left"], self.left - ) - serializer.write_string( - _SCHEMA_MEMORY_METADATA_FILTER_EXPRESSION.members["operator"], self.operator - ) - if self.right is not None: - serializer.write_struct( - _SCHEMA_MEMORY_METADATA_FILTER_EXPRESSION.members["right"], self.right - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["left"] = ( - _MemoryRecordLeftExpressionDeserializer().deserialize(de) - ) - - case 1: - kwargs["operator"] = MemoryRecordOperatorType( - de.read_string( - _SCHEMA_MEMORY_METADATA_FILTER_EXPRESSION.members[ - "operator" - ] - ) - ) - - case 2: - kwargs["right"] = ( - _MemoryRecordRightExpressionDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MEMORY_METADATA_FILTER_EXPRESSION, consumer=_consumer - ) - if "left" not in kwargs: - kwargs["left"] = MemoryRecordLeftExpressionUnknown(tag="") - if "operator" not in kwargs: - kwargs["operator"] = MemoryRecordOperatorType._corrected("") - return kwargs - - -def _serialize_memory_metadata_filter_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[MemoryMetadataFilterExpression], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_memory_metadata_filter_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[MemoryMetadataFilterExpression]: - result: list[MemoryMetadataFilterExpression] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(MemoryMetadataFilterExpression.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListMemoryRecordsInput: - """Dataclass for ListMemoryRecordsInput structure.""" - - memory_id: str | None = None - """ - The identifier of the AgentCore Memory resource for which to list memory - records. - """ - - namespace: str | None = None - """ - The namespace prefix to filter memory records by. Returns all memory - records in namespaces that start with the provided prefix. Either - `namespace` or `namespacePath` is required. - """ - - namespace_path: str | None = None - """ - Use namespacePath for hierarchical retrievals. Return all memory records - where namespace falls under the same parent hierarchy. Either - `namespace` or `namespacePath` is required. - """ - - memory_strategy_id: str | None = None - """ - The memory strategy identifier to filter memory records by. If - specified, only memory records with this strategy ID are returned. - """ - - max_results: int = 100 - """ - The maximum number of results to return in a single call. The default - value is 20. - """ - - next_token: str | None = None - """ - The token for the next set of results. Use the value returned in the - previous response in the next request to retrieve the next set of - results. - """ - - metadata_filters: list[MemoryMetadataFilterExpression] | None = None - """ - A list of metadata filter expressions to scope the returned memory - records. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_MEMORY_RECORDS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.memory_id is not None: - serializer.write_string( - _SCHEMA_LIST_MEMORY_RECORDS_INPUT.members["memoryId"], self.memory_id - ) - - if self.namespace is not None: - serializer.write_string( - _SCHEMA_LIST_MEMORY_RECORDS_INPUT.members["namespace"], self.namespace - ) - - if self.namespace_path is not None: - serializer.write_string( - _SCHEMA_LIST_MEMORY_RECORDS_INPUT.members["namespacePath"], - self.namespace_path, - ) - - if self.memory_strategy_id is not None: - serializer.write_string( - _SCHEMA_LIST_MEMORY_RECORDS_INPUT.members["memoryStrategyId"], - self.memory_strategy_id, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_MEMORY_RECORDS_INPUT.members["maxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_MEMORY_RECORDS_INPUT.members["nextToken"], self.next_token - ) - - if self.metadata_filters is not None: - _serialize_memory_metadata_filter_list( - serializer, - _SCHEMA_LIST_MEMORY_RECORDS_INPUT.members["metadataFilters"], - self.metadata_filters, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["memory_id"] = de.read_string( - _SCHEMA_LIST_MEMORY_RECORDS_INPUT.members["memoryId"] - ) - - case 1: - kwargs["namespace"] = de.read_string( - _SCHEMA_LIST_MEMORY_RECORDS_INPUT.members["namespace"] - ) - - case 2: - kwargs["namespace_path"] = de.read_string( - _SCHEMA_LIST_MEMORY_RECORDS_INPUT.members["namespacePath"] - ) - - case 3: - kwargs["memory_strategy_id"] = de.read_string( - _SCHEMA_LIST_MEMORY_RECORDS_INPUT.members["memoryStrategyId"] - ) - - case 4: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_MEMORY_RECORDS_INPUT.members["maxResults"] - ) - - case 5: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_MEMORY_RECORDS_INPUT.members["nextToken"] - ) - - case 6: - kwargs["metadata_filters"] = ( - _deserialize_memory_metadata_filter_list( - de, - _SCHEMA_LIST_MEMORY_RECORDS_INPUT.members[ - "metadataFilters" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_MEMORY_RECORDS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class MemoryRecordSummary: - """Contains summary information about a memory record.""" - - memory_record_id: str - """The unique identifier of the memory record.""" - - content: MemoryContent - """The content of the memory record.""" - - memory_strategy_id: str - """The identifier of the memory strategy associated with this record.""" - - namespaces: list[str] - """The namespaces associated with this memory record.""" - - created_at: datetime - """The timestamp when the memory record was created.""" - - score: float | None = None - """ - The relevance score of the memory record when returned as part of a - search result. Higher values indicate greater relevance to the search - query. - """ - - metadata: dict[str, MemoryRecordMetadataValue] | None = None - """A map of metadata key-value pairs associated with a memory record.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEMORY_RECORD_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MEMORY_RECORD_SUMMARY.members["memoryRecordId"], - self.memory_record_id, - ) - serializer.write_struct( - _SCHEMA_MEMORY_RECORD_SUMMARY.members["content"], self.content - ) - serializer.write_string( - _SCHEMA_MEMORY_RECORD_SUMMARY.members["memoryStrategyId"], - self.memory_strategy_id, - ) - _serialize_namespaces_list( - serializer, - _SCHEMA_MEMORY_RECORD_SUMMARY.members["namespaces"], - self.namespaces, - ) - serializer.write_timestamp( - _SCHEMA_MEMORY_RECORD_SUMMARY.members["createdAt"], self.created_at - ) - if self.score is not None: - serializer.write_double( - _SCHEMA_MEMORY_RECORD_SUMMARY.members["score"], self.score - ) - - if self.metadata is not None: - _serialize_memory_record_metadata_map( - serializer, - _SCHEMA_MEMORY_RECORD_SUMMARY.members["metadata"], - self.metadata, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["memory_record_id"] = de.read_string( - _SCHEMA_MEMORY_RECORD_SUMMARY.members["memoryRecordId"] - ) - - case 1: - kwargs["content"] = _MemoryContentDeserializer().deserialize(de) - - case 2: - kwargs["memory_strategy_id"] = de.read_string( - _SCHEMA_MEMORY_RECORD_SUMMARY.members["memoryStrategyId"] - ) - - case 3: - kwargs["namespaces"] = _deserialize_namespaces_list( - de, _SCHEMA_MEMORY_RECORD_SUMMARY.members["namespaces"] - ) - - case 4: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_MEMORY_RECORD_SUMMARY.members["createdAt"] - ) - - case 5: - kwargs["score"] = de.read_double( - _SCHEMA_MEMORY_RECORD_SUMMARY.members["score"] - ) - - case 6: - kwargs["metadata"] = _deserialize_memory_record_metadata_map( - de, _SCHEMA_MEMORY_RECORD_SUMMARY.members["metadata"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MEMORY_RECORD_SUMMARY, consumer=_consumer) - if "memory_record_id" not in kwargs: - kwargs["memory_record_id"] = "" - if "content" not in kwargs: - kwargs["content"] = MemoryContentUnknown(tag="") - if "memory_strategy_id" not in kwargs: - kwargs["memory_strategy_id"] = "" - if "namespaces" not in kwargs: - kwargs["namespaces"] = [] - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_memory_record_summary_list( - serializer: ShapeSerializer, schema: Schema, value: list[MemoryRecordSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_memory_record_summary_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[MemoryRecordSummary]: - result: list[MemoryRecordSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(MemoryRecordSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListMemoryRecordsOutput: - """Dataclass for ListMemoryRecordsOutput structure.""" - - memory_record_summaries: list[MemoryRecordSummary] - """The list of memory record summaries that match the specified criteria.""" - - next_token: str | None = None - """ - The token to use in a subsequent request to get the next set of results. - This value is null when there are no more results to return. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_MEMORY_RECORDS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_memory_record_summary_list( - serializer, - _SCHEMA_LIST_MEMORY_RECORDS_OUTPUT.members["memoryRecordSummaries"], - self.memory_record_summaries, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_MEMORY_RECORDS_OUTPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["memory_record_summaries"] = ( - _deserialize_memory_record_summary_list( - de, - _SCHEMA_LIST_MEMORY_RECORDS_OUTPUT.members[ - "memoryRecordSummaries" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_MEMORY_RECORDS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_MEMORY_RECORDS_OUTPUT, consumer=_consumer) - if "memory_record_summaries" not in kwargs: - kwargs["memory_record_summaries"] = [] - return kwargs - - -LIST_MEMORY_RECORDS = APIOperation( - input=ListMemoryRecordsInput, - output=ListMemoryRecordsOutput, - schema=_SCHEMA_LIST_MEMORY_RECORDS, - input_schema=_SCHEMA_LIST_MEMORY_RECORDS_INPUT, - output_schema=_SCHEMA_LIST_MEMORY_RECORDS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#InvalidInputException" - ): InvalidInputException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceException" - ): ServiceException, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottledException" - ): ThrottledException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INVALID_INPUT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class EventFilterCondition(UnknownEnumMixin, StrEnum): - """The condition to use for filtering sessions by events.""" - - HAS_EVENTS = "HAS_EVENTS" - - -@dataclass(kw_only=True) -class SessionFilter: - """Contains filter criteria for listing sessions.""" - - event_filter: str | None = None - """ - The event filter condition to apply. Use this to filter sessions based - on event presence. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SESSION_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.event_filter is not None: - serializer.write_string( - _SCHEMA_SESSION_FILTER.members["eventFilter"], self.event_filter - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["event_filter"] = EventFilterCondition( - de.read_string(_SCHEMA_SESSION_FILTER.members["eventFilter"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SESSION_FILTER, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ListSessionsInput: - """Dataclass for ListSessionsInput structure.""" - - memory_id: str | None = None - """ - The identifier of the AgentCore Memory resource for which to list - sessions. - """ - - actor_id: str | None = None - """The identifier of the actor for which to list sessions.""" - - max_results: int = 100 - """ - The maximum number of results to return in a single call. The default - value is 20. - """ - - next_token: str | None = None - """ - The token for the next set of results. Use the value returned in the - previous response in the next request to retrieve the next set of - results. - """ - - filter: SessionFilter | None = None - """Filter criteria to apply when listing sessions.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_SESSIONS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.memory_id is not None: - serializer.write_string( - _SCHEMA_LIST_SESSIONS_INPUT.members["memoryId"], self.memory_id - ) - - if self.actor_id is not None: - serializer.write_string( - _SCHEMA_LIST_SESSIONS_INPUT.members["actorId"], self.actor_id - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_SESSIONS_INPUT.members["maxResults"], self.max_results - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_SESSIONS_INPUT.members["nextToken"], self.next_token - ) - - if self.filter is not None: - serializer.write_struct( - _SCHEMA_LIST_SESSIONS_INPUT.members["filter"], self.filter - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["memory_id"] = de.read_string( - _SCHEMA_LIST_SESSIONS_INPUT.members["memoryId"] - ) - - case 1: - kwargs["actor_id"] = de.read_string( - _SCHEMA_LIST_SESSIONS_INPUT.members["actorId"] - ) - - case 2: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_SESSIONS_INPUT.members["maxResults"] - ) - - case 3: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_SESSIONS_INPUT.members["nextToken"] - ) - - case 4: - kwargs["filter"] = SessionFilter.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_SESSIONS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class SessionSummary: - """ - Contains summary information about a session in an AgentCore Memory - resource. - """ - - session_id: str - """The unique identifier of the session.""" - - actor_id: str - """The identifier of the actor associated with the session.""" - - created_at: datetime - """The timestamp when the session was created.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SESSION_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SESSION_SUMMARY.members["sessionId"], self.session_id - ) - serializer.write_string( - _SCHEMA_SESSION_SUMMARY.members["actorId"], self.actor_id - ) - serializer.write_timestamp( - _SCHEMA_SESSION_SUMMARY.members["createdAt"], self.created_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["session_id"] = de.read_string( - _SCHEMA_SESSION_SUMMARY.members["sessionId"] - ) - - case 1: - kwargs["actor_id"] = de.read_string( - _SCHEMA_SESSION_SUMMARY.members["actorId"] - ) - - case 2: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_SESSION_SUMMARY.members["createdAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SESSION_SUMMARY, consumer=_consumer) - if "session_id" not in kwargs: - kwargs["session_id"] = "" - if "actor_id" not in kwargs: - kwargs["actor_id"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_session_summary_list( - serializer: ShapeSerializer, schema: Schema, value: list[SessionSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_session_summary_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[SessionSummary]: - result: list[SessionSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(SessionSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListSessionsOutput: - """Dataclass for ListSessionsOutput structure.""" - - session_summaries: list[SessionSummary] - """The list of session summaries that match the specified criteria.""" - - next_token: str | None = None - """ - The token to use in a subsequent request to get the next set of results. - This value is null when there are no more results to return. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_SESSIONS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_session_summary_list( - serializer, - _SCHEMA_LIST_SESSIONS_OUTPUT.members["sessionSummaries"], - self.session_summaries, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_SESSIONS_OUTPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["session_summaries"] = _deserialize_session_summary_list( - de, _SCHEMA_LIST_SESSIONS_OUTPUT.members["sessionSummaries"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_SESSIONS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_SESSIONS_OUTPUT, consumer=_consumer) - if "session_summaries" not in kwargs: - kwargs["session_summaries"] = [] - return kwargs - - -LIST_SESSIONS = APIOperation( - input=ListSessionsInput, - output=ListSessionsOutput, - schema=_SCHEMA_LIST_SESSIONS, - input_schema=_SCHEMA_LIST_SESSIONS_INPUT, - output_schema=_SCHEMA_LIST_SESSIONS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#InvalidInputException" - ): InvalidInputException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceException" - ): ServiceException, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottledException" - ): ThrottledException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INVALID_INPUT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class SearchCriteria: - """Contains search criteria for retrieving memory records.""" - - search_query: str = field(repr=False) - """The search query to use for finding relevant memory records.""" - - memory_strategy_id: str | None = None - """The memory strategy identifier to filter memory records by.""" - - top_k: int = 10 - """ - The maximum number of top-scoring memory records to return. This value - is used for semantic search ranking. - """ - - metadata_filters: list[MemoryMetadataFilterExpression] | None = None - """Filters to apply to metadata associated with a memory.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SEARCH_CRITERIA, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SEARCH_CRITERIA.members["searchQuery"], self.search_query - ) - if self.memory_strategy_id is not None: - serializer.write_string( - _SCHEMA_SEARCH_CRITERIA.members["memoryStrategyId"], - self.memory_strategy_id, - ) - - serializer.write_integer(_SCHEMA_SEARCH_CRITERIA.members["topK"], self.top_k) - if self.metadata_filters is not None: - _serialize_memory_metadata_filter_list( - serializer, - _SCHEMA_SEARCH_CRITERIA.members["metadataFilters"], - self.metadata_filters, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["search_query"] = de.read_string( - _SCHEMA_SEARCH_CRITERIA.members["searchQuery"] - ) - - case 1: - kwargs["memory_strategy_id"] = de.read_string( - _SCHEMA_SEARCH_CRITERIA.members["memoryStrategyId"] - ) - - case 2: - kwargs["top_k"] = de.read_integer( - _SCHEMA_SEARCH_CRITERIA.members["topK"] - ) - - case 3: - kwargs["metadata_filters"] = ( - _deserialize_memory_metadata_filter_list( - de, _SCHEMA_SEARCH_CRITERIA.members["metadataFilters"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SEARCH_CRITERIA, consumer=_consumer) - if "search_query" not in kwargs: - kwargs["search_query"] = "" - return kwargs - - -@dataclass(kw_only=True) -class RetrieveMemoryRecordsInput: - """Dataclass for RetrieveMemoryRecordsInput structure.""" - - memory_id: str | None = None - """ - The identifier of the AgentCore Memory resource from which to retrieve - memory records. - """ - - namespace: str | None = None - """ - The namespace prefix to filter memory records by. Searches for memory - records in namespaces that start with the provided prefix. Either - `namespace` or `namespacePath` is required. - """ - - namespace_path: str | None = None - """ - Use namespacePath for hierarchical retrievals. Return all memory records - where namespace falls under the same parent hierarchy. Either - `namespace` or `namespacePath` is required. - """ - - search_criteria: SearchCriteria | None = None - """ - The search criteria to use for finding relevant memory records. This - includes the search query, memory strategy ID, and other search - parameters. - """ - - next_token: str | None = None - """ - The token for the next set of results. Use the value returned in the - previous response in the next request to retrieve the next set of - results. - """ - - max_results: int = 100 - """ - The maximum number of results to return in a single call. The default - value is 20. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVE_MEMORY_RECORDS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.memory_id is not None: - serializer.write_string( - _SCHEMA_RETRIEVE_MEMORY_RECORDS_INPUT.members["memoryId"], - self.memory_id, - ) - - if self.namespace is not None: - serializer.write_string( - _SCHEMA_RETRIEVE_MEMORY_RECORDS_INPUT.members["namespace"], - self.namespace, - ) - - if self.namespace_path is not None: - serializer.write_string( - _SCHEMA_RETRIEVE_MEMORY_RECORDS_INPUT.members["namespacePath"], - self.namespace_path, - ) - - if self.search_criteria is not None: - serializer.write_struct( - _SCHEMA_RETRIEVE_MEMORY_RECORDS_INPUT.members["searchCriteria"], - self.search_criteria, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_RETRIEVE_MEMORY_RECORDS_INPUT.members["nextToken"], - self.next_token, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_RETRIEVE_MEMORY_RECORDS_INPUT.members["maxResults"], - self.max_results, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["memory_id"] = de.read_string( - _SCHEMA_RETRIEVE_MEMORY_RECORDS_INPUT.members["memoryId"] - ) - - case 1: - kwargs["namespace"] = de.read_string( - _SCHEMA_RETRIEVE_MEMORY_RECORDS_INPUT.members["namespace"] - ) - - case 2: - kwargs["namespace_path"] = de.read_string( - _SCHEMA_RETRIEVE_MEMORY_RECORDS_INPUT.members["namespacePath"] - ) - - case 3: - kwargs["search_criteria"] = SearchCriteria.deserialize(de) - - case 4: - kwargs["next_token"] = de.read_string( - _SCHEMA_RETRIEVE_MEMORY_RECORDS_INPUT.members["nextToken"] - ) - - case 5: - kwargs["max_results"] = de.read_integer( - _SCHEMA_RETRIEVE_MEMORY_RECORDS_INPUT.members["maxResults"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RETRIEVE_MEMORY_RECORDS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class RetrieveMemoryRecordsOutput: - """Dataclass for RetrieveMemoryRecordsOutput structure.""" - - memory_record_summaries: list[MemoryRecordSummary] - """ - The list of memory record summaries that match the search criteria, - ordered by relevance. - """ - - next_token: str | None = None - """ - The token to use in a subsequent request to get the next set of results. - This value is null when there are no more results to return. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVE_MEMORY_RECORDS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_memory_record_summary_list( - serializer, - _SCHEMA_RETRIEVE_MEMORY_RECORDS_OUTPUT.members["memoryRecordSummaries"], - self.memory_record_summaries, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_RETRIEVE_MEMORY_RECORDS_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["memory_record_summaries"] = ( - _deserialize_memory_record_summary_list( - de, - _SCHEMA_RETRIEVE_MEMORY_RECORDS_OUTPUT.members[ - "memoryRecordSummaries" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_RETRIEVE_MEMORY_RECORDS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RETRIEVE_MEMORY_RECORDS_OUTPUT, consumer=_consumer - ) - if "memory_record_summaries" not in kwargs: - kwargs["memory_record_summaries"] = [] - return kwargs - - -RETRIEVE_MEMORY_RECORDS = APIOperation( - input=RetrieveMemoryRecordsInput, - output=RetrieveMemoryRecordsOutput, - schema=_SCHEMA_RETRIEVE_MEMORY_RECORDS, - input_schema=_SCHEMA_RETRIEVE_MEMORY_RECORDS_INPUT, - output_schema=_SCHEMA_RETRIEVE_MEMORY_RECORDS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#InvalidInputException" - ): InvalidInputException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceException" - ): ServiceException, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottledException" - ): ThrottledException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INVALID_INPUT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ExtractionJob: - """ - Represents the metadata of a memory extraction job such as the message - identifiers that compose this job. - """ - - job_id: str - """The unique identifier of the extraction job.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EXTRACTION_JOB, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_EXTRACTION_JOB.members["jobId"], self.job_id) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["job_id"] = de.read_string( - _SCHEMA_EXTRACTION_JOB.members["jobId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EXTRACTION_JOB, consumer=_consumer) - if "job_id" not in kwargs: - kwargs["job_id"] = "" - return kwargs - - -@dataclass(kw_only=True) -class StartMemoryExtractionJobInput: - """Dataclass for StartMemoryExtractionJobInput structure.""" - - memory_id: str | None = None - """The unique identifier of the memory for which to start extraction jobs.""" - - extraction_job: ExtractionJob | None = None - """Extraction job to start in this operation.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure idempotent processing of - the request. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_MEMORY_EXTRACTION_JOB_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.memory_id is not None: - serializer.write_string( - _SCHEMA_START_MEMORY_EXTRACTION_JOB_INPUT.members["memoryId"], - self.memory_id, - ) - - if self.extraction_job is not None: - serializer.write_struct( - _SCHEMA_START_MEMORY_EXTRACTION_JOB_INPUT.members["extractionJob"], - self.extraction_job, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_START_MEMORY_EXTRACTION_JOB_INPUT.members["clientToken"], - self.client_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["memory_id"] = de.read_string( - _SCHEMA_START_MEMORY_EXTRACTION_JOB_INPUT.members["memoryId"] - ) - - case 1: - kwargs["extraction_job"] = ExtractionJob.deserialize(de) - - case 2: - kwargs["client_token"] = de.read_string( - _SCHEMA_START_MEMORY_EXTRACTION_JOB_INPUT.members["clientToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_START_MEMORY_EXTRACTION_JOB_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class StartMemoryExtractionJobOutput: - """Dataclass for StartMemoryExtractionJobOutput structure.""" - - job_id: str - """Extraction Job ID that was attempted to start.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_MEMORY_EXTRACTION_JOB_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_START_MEMORY_EXTRACTION_JOB_OUTPUT.members["jobId"], self.job_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["job_id"] = de.read_string( - _SCHEMA_START_MEMORY_EXTRACTION_JOB_OUTPUT.members["jobId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_START_MEMORY_EXTRACTION_JOB_OUTPUT, consumer=_consumer - ) - if "job_id" not in kwargs: - kwargs["job_id"] = "" - return kwargs - - -START_MEMORY_EXTRACTION_JOB = APIOperation( - input=StartMemoryExtractionJobInput, - output=StartMemoryExtractionJobOutput, - schema=_SCHEMA_START_MEMORY_EXTRACTION_JOB, - input_schema=_SCHEMA_START_MEMORY_EXTRACTION_JOB_INPUT, - output_schema=_SCHEMA_START_MEMORY_EXTRACTION_JOB_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceException" - ): ServiceException, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottledException" - ): ThrottledException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class LinkedAccountDeveloperJwt: - """Authentication method using JWT with key ID and subject claims.""" - - kid: str - """ - The key ID (kid) from the JWT header. Identifies which key was used to - sign the JWT. - """ - - sub: str - """ - The subject (sub) claim from the JWT payload. Identifies the principal - that is the subject of the JWT. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LINKED_ACCOUNT_DEVELOPER_JWT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_LINKED_ACCOUNT_DEVELOPER_JWT.members["kid"], self.kid - ) - serializer.write_string( - _SCHEMA_LINKED_ACCOUNT_DEVELOPER_JWT.members["sub"], self.sub - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["kid"] = de.read_string( - _SCHEMA_LINKED_ACCOUNT_DEVELOPER_JWT.members["kid"] - ) - - case 1: - kwargs["sub"] = de.read_string( - _SCHEMA_LINKED_ACCOUNT_DEVELOPER_JWT.members["sub"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LINKED_ACCOUNT_DEVELOPER_JWT, consumer=_consumer - ) - if "kid" not in kwargs: - kwargs["kid"] = "" - if "sub" not in kwargs: - kwargs["sub"] = "" - return kwargs - - -@dataclass(kw_only=True) -class LinkedAccountEmail: - """Linked account using an email address.""" - - email_address: str = field(repr=False) - """ - The email address used for the linked account. Must be a valid email - format. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LINKED_ACCOUNT_EMAIL, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_LINKED_ACCOUNT_EMAIL.members["emailAddress"], self.email_address - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["email_address"] = de.read_string( - _SCHEMA_LINKED_ACCOUNT_EMAIL.members["emailAddress"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LINKED_ACCOUNT_EMAIL, consumer=_consumer) - if "email_address" not in kwargs: - kwargs["email_address"] = "" - return kwargs - - -@dataclass(kw_only=True) -class OAuth2Authentication: - """OAuth2 authentication information for third-party providers.""" - - sub: str - """ - The subject (sub) claim from the OAuth2 provider. Uniquely identifies - the user at the provider. - """ - - email_address: str | None = field(repr=False, default=None) - """The email address from the OAuth2 provider.""" - - name: str | None = None - """The user's name from the OAuth2 provider.""" - - username: str | None = None - """The username from the OAuth2 provider.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_O_AUTH2_AUTHENTICATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_O_AUTH2_AUTHENTICATION.members["sub"], self.sub) - if self.email_address is not None: - serializer.write_string( - _SCHEMA_O_AUTH2_AUTHENTICATION.members["emailAddress"], - self.email_address, - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_O_AUTH2_AUTHENTICATION.members["name"], self.name - ) - - if self.username is not None: - serializer.write_string( - _SCHEMA_O_AUTH2_AUTHENTICATION.members["username"], self.username - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["sub"] = de.read_string( - _SCHEMA_O_AUTH2_AUTHENTICATION.members["sub"] - ) - - case 1: - kwargs["email_address"] = de.read_string( - _SCHEMA_O_AUTH2_AUTHENTICATION.members["emailAddress"] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_O_AUTH2_AUTHENTICATION.members["name"] - ) - - case 3: - kwargs["username"] = de.read_string( - _SCHEMA_O_AUTH2_AUTHENTICATION.members["username"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_O_AUTH2_AUTHENTICATION, consumer=_consumer) - if "sub" not in kwargs: - kwargs["sub"] = "" - return kwargs - - -@dataclass -class LinkedAccountOAuth2Google: - """Google OAuth2 authentication.""" - - value: OAuth2Authentication - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LINKED_ACCOUNT_O_AUTH2, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_LINKED_ACCOUNT_O_AUTH2.members["google"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=OAuth2Authentication.deserialize(deserializer)) - - -@dataclass -class LinkedAccountOAuth2Apple: - """Apple OAuth2 authentication.""" - - value: OAuth2Authentication - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LINKED_ACCOUNT_O_AUTH2, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_LINKED_ACCOUNT_O_AUTH2.members["apple"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=OAuth2Authentication.deserialize(deserializer)) - - -@dataclass -class LinkedAccountOAuth2X: - """X (formerly Twitter) OAuth2 authentication.""" - - value: OAuth2Authentication - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LINKED_ACCOUNT_O_AUTH2, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LINKED_ACCOUNT_O_AUTH2.members["x"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=OAuth2Authentication.deserialize(deserializer)) - - -@dataclass -class LinkedAccountOAuth2Telegram: - """Telegram OAuth2 authentication.""" - - value: OAuth2Authentication - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LINKED_ACCOUNT_O_AUTH2, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_LINKED_ACCOUNT_O_AUTH2.members["telegram"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=OAuth2Authentication.deserialize(deserializer)) - - -@dataclass -class LinkedAccountOAuth2Github: - """GitHub OAuth2 authentication.""" - - value: OAuth2Authentication - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LINKED_ACCOUNT_O_AUTH2, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_LINKED_ACCOUNT_O_AUTH2.members["github"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=OAuth2Authentication.deserialize(deserializer)) - - -@dataclass -class LinkedAccountOAuth2Unknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -LinkedAccountOAuth2 = Union[ - LinkedAccountOAuth2Google - | LinkedAccountOAuth2Apple - | LinkedAccountOAuth2X - | LinkedAccountOAuth2Telegram - | LinkedAccountOAuth2Github - | LinkedAccountOAuth2Unknown -] -""" -Authentication method using OAuth2 providers. Supports Google, Apple, X, -Telegram, and GitHub providers. -""" - - -class _LinkedAccountOAuth2Deserializer: - _result: LinkedAccountOAuth2 | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> LinkedAccountOAuth2: - self._result = None - deserializer.read_struct(_SCHEMA_LINKED_ACCOUNT_O_AUTH2, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(LinkedAccountOAuth2Google.deserialize(de)) - - case 1: - self._set_result(LinkedAccountOAuth2Apple.deserialize(de)) - - case 2: - self._set_result(LinkedAccountOAuth2X.deserialize(de)) - - case 3: - self._set_result(LinkedAccountOAuth2Telegram.deserialize(de)) - - case 4: - self._set_result(LinkedAccountOAuth2Github.deserialize(de)) - - case _: - self._set_result( - LinkedAccountOAuth2Unknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: LinkedAccountOAuth2) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class LinkedAccountSms: - """Linked account using a phone number in E.164 format.""" - - phone_number: str = field(repr=False) - """The phone number in E.164 format (e.g., +1234567890).""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LINKED_ACCOUNT_SMS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_LINKED_ACCOUNT_SMS.members["phoneNumber"], self.phone_number - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["phone_number"] = de.read_string( - _SCHEMA_LINKED_ACCOUNT_SMS.members["phoneNumber"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LINKED_ACCOUNT_SMS, consumer=_consumer) - if "phone_number" not in kwargs: - kwargs["phone_number"] = "" - return kwargs - - -@dataclass -class LinkedAccount_Email: - """Email-based linked account.""" - - value: LinkedAccountEmail - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LINKED_ACCOUNT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LINKED_ACCOUNT.members["email"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=LinkedAccountEmail.deserialize(deserializer)) - - -@dataclass -class LinkedAccount_Sms: - """SMS-based linked account using phone number.""" - - value: LinkedAccountSms - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LINKED_ACCOUNT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LINKED_ACCOUNT.members["sms"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=LinkedAccountSms.deserialize(deserializer)) - - -@dataclass -class LinkedAccount_DeveloperJwt: - """Developer JWT linked account with key ID and subject.""" - - value: LinkedAccountDeveloperJwt - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LINKED_ACCOUNT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_LINKED_ACCOUNT.members["developerJwt"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=LinkedAccountDeveloperJwt.deserialize(deserializer)) - - -@dataclass -class LinkedAccount_OAuth2: - """OAuth2 provider linked account (Google, Apple, X, Telegram, GitHub).""" - - value: LinkedAccountOAuth2 - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LINKED_ACCOUNT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LINKED_ACCOUNT.members["oAuth2"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=_LinkedAccountOAuth2Deserializer().deserialize(deserializer)) - - -@dataclass -class LinkedAccountUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -LinkedAccount = Union[ - LinkedAccount_Email - | LinkedAccount_Sms - | LinkedAccount_DeveloperJwt - | LinkedAccount_OAuth2 - | LinkedAccountUnknown -] -""" -Represents different linked accounts that can be linked to an embedded -wallet. Supports email, SMS, JWT, and OAuth2 approaches. -""" - - -class _LinkedAccountDeserializer: - _result: LinkedAccount | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> LinkedAccount: - self._result = None - deserializer.read_struct(_SCHEMA_LINKED_ACCOUNT, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(LinkedAccount_Email.deserialize(de)) - - case 1: - self._set_result(LinkedAccount_Sms.deserialize(de)) - - case 2: - self._set_result(LinkedAccount_DeveloperJwt.deserialize(de)) - - case 3: - self._set_result(LinkedAccount_OAuth2.deserialize(de)) - - case _: - self._set_result(LinkedAccountUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: LinkedAccount) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_linked_account_list( - serializer: ShapeSerializer, schema: Schema, value: list[LinkedAccount] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_linked_account_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[LinkedAccount]: - result: list[LinkedAccount] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_LinkedAccountDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class CryptoWalletNetwork(UnknownEnumMixin, StrEnum): - """Supported blockchain networks for crypto wallets.""" - - ETHEREUM = "ETHEREUM" - SOLANA = "SOLANA" - - -@dataclass(kw_only=True) -class EmbeddedCryptoWallet: - """Embedded crypto wallet instrument details.""" - - network: str - """ - The blockchain network for this embedded crypto wallet. Supported - networks: ETHEREUM, SOLANA. - """ - - linked_accounts: list[LinkedAccount] - """ - List of linked accounts linked to this wallet. Each represents a way the - end user can authenticate to this wallet. - """ - - wallet_address: str | None = None - """The wallet address on the specified blockchain network.""" - - redirect_url: str | None = None - """ - URL for the end user to complete a provider-specific action such as - wallet linking or onboarding. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EMBEDDED_CRYPTO_WALLET, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_EMBEDDED_CRYPTO_WALLET.members["network"], self.network - ) - _serialize_linked_account_list( - serializer, - _SCHEMA_EMBEDDED_CRYPTO_WALLET.members["linkedAccounts"], - self.linked_accounts, - ) - if self.wallet_address is not None: - serializer.write_string( - _SCHEMA_EMBEDDED_CRYPTO_WALLET.members["walletAddress"], - self.wallet_address, - ) - - if self.redirect_url is not None: - serializer.write_string( - _SCHEMA_EMBEDDED_CRYPTO_WALLET.members["redirectUrl"], self.redirect_url - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["network"] = CryptoWalletNetwork( - de.read_string( - _SCHEMA_EMBEDDED_CRYPTO_WALLET.members["network"] - ) - ) - - case 1: - kwargs["linked_accounts"] = _deserialize_linked_account_list( - de, _SCHEMA_EMBEDDED_CRYPTO_WALLET.members["linkedAccounts"] - ) - - case 2: - kwargs["wallet_address"] = de.read_string( - _SCHEMA_EMBEDDED_CRYPTO_WALLET.members["walletAddress"] - ) - - case 3: - kwargs["redirect_url"] = de.read_string( - _SCHEMA_EMBEDDED_CRYPTO_WALLET.members["redirectUrl"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EMBEDDED_CRYPTO_WALLET, consumer=_consumer) - if "network" not in kwargs: - kwargs["network"] = CryptoWalletNetwork._corrected("") - if "linked_accounts" not in kwargs: - kwargs["linked_accounts"] = [] - return kwargs - - -@dataclass -class PaymentInstrumentDetailsEmbeddedCryptoWallet: - """Embedded crypto wallet managed directly by end user.""" - - value: EmbeddedCryptoWallet - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PAYMENT_INSTRUMENT_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_PAYMENT_INSTRUMENT_DETAILS.members["embeddedCryptoWallet"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=EmbeddedCryptoWallet.deserialize(deserializer)) - - -@dataclass -class PaymentInstrumentDetailsUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -PaymentInstrumentDetails = Union[ - PaymentInstrumentDetailsEmbeddedCryptoWallet | PaymentInstrumentDetailsUnknown -] -"""Details specific to the instrument type.""" - - -class _PaymentInstrumentDetailsDeserializer: - _result: PaymentInstrumentDetails | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> PaymentInstrumentDetails: - self._result = None - deserializer.read_struct(_SCHEMA_PAYMENT_INSTRUMENT_DETAILS, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - PaymentInstrumentDetailsEmbeddedCryptoWallet.deserialize(de) - ) - - case _: - self._set_result( - PaymentInstrumentDetailsUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: PaymentInstrumentDetails) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class PaymentInstrumentType(UnknownEnumMixin, StrEnum): - """The type of payment instrument.""" - - EMBEDDED_CRYPTO_WALLET = "EMBEDDED_CRYPTO_WALLET" - - -@dataclass(kw_only=True) -class CreatePaymentInstrumentInput: - """Request structure for creating a payment instrument.""" - - user_id: str | None = None - """The user ID associated with this payment instrument.""" - - agent_name: str | None = None - """The agent name associated with this request, used for observability.""" - - payment_manager_arn: str | None = None - """The ARN of the payment manager that owns this payment instrument.""" - - payment_connector_id: str | None = None - """The ID of the payment connector to use for this instrument.""" - - payment_instrument_type: str | None = None - """The type of payment instrument being created.""" - - payment_instrument_details: PaymentInstrumentDetails | None = None - """The details of the payment instrument.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier that you provide to ensure the - idempotency of the request. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_PAYMENT_INSTRUMENT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.user_id is not None: - serializer.write_string( - _SCHEMA_CREATE_PAYMENT_INSTRUMENT_INPUT.members["userId"], self.user_id - ) - - if self.agent_name is not None: - serializer.write_string( - _SCHEMA_CREATE_PAYMENT_INSTRUMENT_INPUT.members["agentName"], - self.agent_name, - ) - - if self.payment_manager_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_PAYMENT_INSTRUMENT_INPUT.members["paymentManagerArn"], - self.payment_manager_arn, - ) - - if self.payment_connector_id is not None: - serializer.write_string( - _SCHEMA_CREATE_PAYMENT_INSTRUMENT_INPUT.members["paymentConnectorId"], - self.payment_connector_id, - ) - - if self.payment_instrument_type is not None: - serializer.write_string( - _SCHEMA_CREATE_PAYMENT_INSTRUMENT_INPUT.members[ - "paymentInstrumentType" - ], - self.payment_instrument_type, - ) - - if self.payment_instrument_details is not None: - serializer.write_struct( - _SCHEMA_CREATE_PAYMENT_INSTRUMENT_INPUT.members[ - "paymentInstrumentDetails" - ], - self.payment_instrument_details, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_PAYMENT_INSTRUMENT_INPUT.members["clientToken"], - self.client_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["user_id"] = de.read_string( - _SCHEMA_CREATE_PAYMENT_INSTRUMENT_INPUT.members["userId"] - ) - - case 1: - kwargs["agent_name"] = de.read_string( - _SCHEMA_CREATE_PAYMENT_INSTRUMENT_INPUT.members["agentName"] - ) - - case 2: - kwargs["payment_manager_arn"] = de.read_string( - _SCHEMA_CREATE_PAYMENT_INSTRUMENT_INPUT.members[ - "paymentManagerArn" - ] - ) - - case 3: - kwargs["payment_connector_id"] = de.read_string( - _SCHEMA_CREATE_PAYMENT_INSTRUMENT_INPUT.members[ - "paymentConnectorId" - ] - ) - - case 4: - kwargs["payment_instrument_type"] = PaymentInstrumentType( - de.read_string( - _SCHEMA_CREATE_PAYMENT_INSTRUMENT_INPUT.members[ - "paymentInstrumentType" - ] - ) - ) - - case 5: - kwargs["payment_instrument_details"] = ( - _PaymentInstrumentDetailsDeserializer().deserialize(de) - ) - - case 6: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_PAYMENT_INSTRUMENT_INPUT.members["clientToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_PAYMENT_INSTRUMENT_INPUT, consumer=_consumer - ) - return kwargs - - -class PaymentInstrumentStatus(UnknownEnumMixin, StrEnum): - """The status of a payment instrument.""" - - INITIATED = "INITIATED" - ACTIVE = "ACTIVE" - FAILED = "FAILED" - DELETED = "DELETED" - BLOCKED = "BLOCKED" - - -@dataclass(kw_only=True) -class PaymentInstrument: - """Represents a payment instrument.""" - - payment_instrument_id: str - """The unique identifier for this payment instrument.""" - - payment_manager_arn: str - """The ARN of the payment manager that owns this payment instrument.""" - - payment_connector_id: str - """The ID of the payment connector associated with this instrument.""" - - user_id: str - """The user ID associated with this payment instrument.""" - - payment_instrument_type: str - """The type of payment instrument (e.g., EMBEDDED_CRYPTO_WALLET).""" - - payment_instrument_details: PaymentInstrumentDetails - """The details specific to the payment instrument type.""" - - created_at: datetime - """The timestamp when this payment instrument was created.""" - - status: str - """The current status of this payment instrument.""" - - updated_at: datetime - """The timestamp when this payment instrument was last updated.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PAYMENT_INSTRUMENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_PAYMENT_INSTRUMENT.members["paymentInstrumentId"], - self.payment_instrument_id, - ) - serializer.write_string( - _SCHEMA_PAYMENT_INSTRUMENT.members["paymentManagerArn"], - self.payment_manager_arn, - ) - serializer.write_string( - _SCHEMA_PAYMENT_INSTRUMENT.members["paymentConnectorId"], - self.payment_connector_id, - ) - serializer.write_string( - _SCHEMA_PAYMENT_INSTRUMENT.members["userId"], self.user_id - ) - serializer.write_string( - _SCHEMA_PAYMENT_INSTRUMENT.members["paymentInstrumentType"], - self.payment_instrument_type, - ) - serializer.write_struct( - _SCHEMA_PAYMENT_INSTRUMENT.members["paymentInstrumentDetails"], - self.payment_instrument_details, - ) - serializer.write_timestamp( - _SCHEMA_PAYMENT_INSTRUMENT.members["createdAt"], self.created_at - ) - serializer.write_string( - _SCHEMA_PAYMENT_INSTRUMENT.members["status"], self.status - ) - serializer.write_timestamp( - _SCHEMA_PAYMENT_INSTRUMENT.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["payment_instrument_id"] = de.read_string( - _SCHEMA_PAYMENT_INSTRUMENT.members["paymentInstrumentId"] - ) - - case 1: - kwargs["payment_manager_arn"] = de.read_string( - _SCHEMA_PAYMENT_INSTRUMENT.members["paymentManagerArn"] - ) - - case 2: - kwargs["payment_connector_id"] = de.read_string( - _SCHEMA_PAYMENT_INSTRUMENT.members["paymentConnectorId"] - ) - - case 3: - kwargs["user_id"] = de.read_string( - _SCHEMA_PAYMENT_INSTRUMENT.members["userId"] - ) - - case 4: - kwargs["payment_instrument_type"] = PaymentInstrumentType( - de.read_string( - _SCHEMA_PAYMENT_INSTRUMENT.members["paymentInstrumentType"] - ) - ) - - case 5: - kwargs["payment_instrument_details"] = ( - _PaymentInstrumentDetailsDeserializer().deserialize(de) - ) - - case 6: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_PAYMENT_INSTRUMENT.members["createdAt"] - ) - - case 7: - kwargs["status"] = PaymentInstrumentStatus( - de.read_string(_SCHEMA_PAYMENT_INSTRUMENT.members["status"]) - ) - - case 8: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_PAYMENT_INSTRUMENT.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PAYMENT_INSTRUMENT, consumer=_consumer) - if "payment_instrument_id" not in kwargs: - kwargs["payment_instrument_id"] = "" - if "payment_manager_arn" not in kwargs: - kwargs["payment_manager_arn"] = "" - if "payment_connector_id" not in kwargs: - kwargs["payment_connector_id"] = "" - if "user_id" not in kwargs: - kwargs["user_id"] = "" - if "payment_instrument_type" not in kwargs: - kwargs["payment_instrument_type"] = PaymentInstrumentType._corrected("") - if "payment_instrument_details" not in kwargs: - kwargs["payment_instrument_details"] = PaymentInstrumentDetailsUnknown( - tag="" - ) - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "status" not in kwargs: - kwargs["status"] = PaymentInstrumentStatus._corrected("") - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls( - payment_instrument_id="", - payment_manager_arn="", - payment_connector_id="", - user_id="", - payment_instrument_type=PaymentInstrumentType._corrected(""), - payment_instrument_details=PaymentInstrumentDetailsUnknown(tag=""), - created_at=datetime.fromtimestamp(0, tz=timezone.utc), - status=PaymentInstrumentStatus._corrected(""), - updated_at=datetime.fromtimestamp(0, tz=timezone.utc), - ) - - -@dataclass(kw_only=True) -class CreatePaymentInstrumentOutput: - """Response structure for creating a payment instrument.""" - - payment_instrument: PaymentInstrument - """The created payment instrument.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_PAYMENT_INSTRUMENT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CREATE_PAYMENT_INSTRUMENT_OUTPUT.members["paymentInstrument"], - self.payment_instrument, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["payment_instrument"] = PaymentInstrument.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_PAYMENT_INSTRUMENT_OUTPUT, consumer=_consumer - ) - if "payment_instrument" not in kwargs: - kwargs["payment_instrument"] = PaymentInstrument._smithy_default() - return kwargs - - -@dataclass(kw_only=True) -class SubscriptionRequiredException(ServiceError): - """ - Returned when you attempt a wallet operation against a Coinbase - Marketplace connector whose account does not hold an active Marketplace - subscription and is not within the legacy exception period. Subscribe to - the Marketplace listing before you retry the operation. - """ - - fault: Literal["client", "server"] | None = "client" - - subscription_url: str | None = None - """The URL to the Marketplace listing where you can subscribe.""" - - product_name: str | None = None - """The name of the product that requires a Marketplace subscription.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SUBSCRIPTION_REQUIRED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SUBSCRIPTION_REQUIRED_EXCEPTION.members["message"], self.message - ) - if self.subscription_url is not None: - serializer.write_string( - _SCHEMA_SUBSCRIPTION_REQUIRED_EXCEPTION.members["subscriptionUrl"], - self.subscription_url, - ) - - if self.product_name is not None: - serializer.write_string( - _SCHEMA_SUBSCRIPTION_REQUIRED_EXCEPTION.members["productName"], - self.product_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_SUBSCRIPTION_REQUIRED_EXCEPTION.members["message"] - ) - - case 1: - kwargs["subscription_url"] = de.read_string( - _SCHEMA_SUBSCRIPTION_REQUIRED_EXCEPTION.members[ - "subscriptionUrl" - ] - ) - - case 2: - kwargs["product_name"] = de.read_string( - _SCHEMA_SUBSCRIPTION_REQUIRED_EXCEPTION.members["productName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SUBSCRIPTION_REQUIRED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -CREATE_PAYMENT_INSTRUMENT = APIOperation( - input=CreatePaymentInstrumentInput, - output=CreatePaymentInstrumentOutput, - schema=_SCHEMA_CREATE_PAYMENT_INSTRUMENT, - input_schema=_SCHEMA_CREATE_PAYMENT_INSTRUMENT_INPUT, - output_schema=_SCHEMA_CREATE_PAYMENT_INSTRUMENT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcore#SubscriptionRequiredException" - ): SubscriptionRequiredException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_SUBSCRIPTION_REQUIRED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeletePaymentInstrumentInput: - """Request structure for deleting a payment instrument.""" - - user_id: str | None = None - """ - The user ID making the delete request. Must match the instrument's - userId. - """ - - payment_manager_arn: str | None = None - """The payment manager ARN. Must match the instrument's paymentManagerArn.""" - - payment_connector_id: str | None = None - """ - The payment connector ID. Must match the instrument's - paymentConnectorId. - """ - - payment_instrument_id: str | None = None - """The payment instrument ID to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_PAYMENT_INSTRUMENT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.user_id is not None: - serializer.write_string( - _SCHEMA_DELETE_PAYMENT_INSTRUMENT_INPUT.members["userId"], self.user_id - ) - - if self.payment_manager_arn is not None: - serializer.write_string( - _SCHEMA_DELETE_PAYMENT_INSTRUMENT_INPUT.members["paymentManagerArn"], - self.payment_manager_arn, - ) - - if self.payment_connector_id is not None: - serializer.write_string( - _SCHEMA_DELETE_PAYMENT_INSTRUMENT_INPUT.members["paymentConnectorId"], - self.payment_connector_id, - ) - - if self.payment_instrument_id is not None: - serializer.write_string( - _SCHEMA_DELETE_PAYMENT_INSTRUMENT_INPUT.members["paymentInstrumentId"], - self.payment_instrument_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["user_id"] = de.read_string( - _SCHEMA_DELETE_PAYMENT_INSTRUMENT_INPUT.members["userId"] - ) - - case 1: - kwargs["payment_manager_arn"] = de.read_string( - _SCHEMA_DELETE_PAYMENT_INSTRUMENT_INPUT.members[ - "paymentManagerArn" - ] - ) - - case 2: - kwargs["payment_connector_id"] = de.read_string( - _SCHEMA_DELETE_PAYMENT_INSTRUMENT_INPUT.members[ - "paymentConnectorId" - ] - ) - - case 3: - kwargs["payment_instrument_id"] = de.read_string( - _SCHEMA_DELETE_PAYMENT_INSTRUMENT_INPUT.members[ - "paymentInstrumentId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_PAYMENT_INSTRUMENT_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeletePaymentInstrumentOutput: - """Response structure for deleting a payment instrument.""" - - status: str - """ - The status of the instrument after deletion. Always DELETED for - successful soft delete. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_PAYMENT_INSTRUMENT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DELETE_PAYMENT_INSTRUMENT_OUTPUT.members["status"], self.status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["status"] = PaymentInstrumentStatus( - de.read_string( - _SCHEMA_DELETE_PAYMENT_INSTRUMENT_OUTPUT.members["status"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_PAYMENT_INSTRUMENT_OUTPUT, consumer=_consumer - ) - if "status" not in kwargs: - kwargs["status"] = PaymentInstrumentStatus._corrected("") - return kwargs - - -DELETE_PAYMENT_INSTRUMENT = APIOperation( - input=DeletePaymentInstrumentInput, - output=DeletePaymentInstrumentOutput, - schema=_SCHEMA_DELETE_PAYMENT_INSTRUMENT, - input_schema=_SCHEMA_DELETE_PAYMENT_INSTRUMENT_INPUT, - output_schema=_SCHEMA_DELETE_PAYMENT_INSTRUMENT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetPaymentInstrumentInput: - """Request structure for getting a payment instrument.""" - - user_id: str | None = None - """The user ID associated with this payment instrument.""" - - agent_name: str | None = None - """The agent name associated with this request, used for observability.""" - - payment_manager_arn: str | None = None - """The ARN of the payment manager that owns this payment instrument.""" - - payment_connector_id: str | None = None - """The ID of the payment connector.""" - - payment_instrument_id: str | None = None - """The ID of the payment instrument to retrieve.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_PAYMENT_INSTRUMENT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.user_id is not None: - serializer.write_string( - _SCHEMA_GET_PAYMENT_INSTRUMENT_INPUT.members["userId"], self.user_id - ) - - if self.agent_name is not None: - serializer.write_string( - _SCHEMA_GET_PAYMENT_INSTRUMENT_INPUT.members["agentName"], - self.agent_name, - ) - - if self.payment_manager_arn is not None: - serializer.write_string( - _SCHEMA_GET_PAYMENT_INSTRUMENT_INPUT.members["paymentManagerArn"], - self.payment_manager_arn, - ) - - if self.payment_connector_id is not None: - serializer.write_string( - _SCHEMA_GET_PAYMENT_INSTRUMENT_INPUT.members["paymentConnectorId"], - self.payment_connector_id, - ) - - if self.payment_instrument_id is not None: - serializer.write_string( - _SCHEMA_GET_PAYMENT_INSTRUMENT_INPUT.members["paymentInstrumentId"], - self.payment_instrument_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["user_id"] = de.read_string( - _SCHEMA_GET_PAYMENT_INSTRUMENT_INPUT.members["userId"] - ) - - case 1: - kwargs["agent_name"] = de.read_string( - _SCHEMA_GET_PAYMENT_INSTRUMENT_INPUT.members["agentName"] - ) - - case 2: - kwargs["payment_manager_arn"] = de.read_string( - _SCHEMA_GET_PAYMENT_INSTRUMENT_INPUT.members[ - "paymentManagerArn" - ] - ) - - case 3: - kwargs["payment_connector_id"] = de.read_string( - _SCHEMA_GET_PAYMENT_INSTRUMENT_INPUT.members[ - "paymentConnectorId" - ] - ) - - case 4: - kwargs["payment_instrument_id"] = de.read_string( - _SCHEMA_GET_PAYMENT_INSTRUMENT_INPUT.members[ - "paymentInstrumentId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_PAYMENT_INSTRUMENT_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetPaymentInstrumentOutput: - """Response structure for getting a payment instrument.""" - - payment_instrument: PaymentInstrument - """The payment instrument details.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_PAYMENT_INSTRUMENT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_PAYMENT_INSTRUMENT_OUTPUT.members["paymentInstrument"], - self.payment_instrument, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["payment_instrument"] = PaymentInstrument.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_PAYMENT_INSTRUMENT_OUTPUT, consumer=_consumer - ) - if "payment_instrument" not in kwargs: - kwargs["payment_instrument"] = PaymentInstrument._smithy_default() - return kwargs - - -GET_PAYMENT_INSTRUMENT = APIOperation( - input=GetPaymentInstrumentInput, - output=GetPaymentInstrumentOutput, - schema=_SCHEMA_GET_PAYMENT_INSTRUMENT, - input_schema=_SCHEMA_GET_PAYMENT_INSTRUMENT_INPUT, - output_schema=_SCHEMA_GET_PAYMENT_INSTRUMENT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class BlockchainChainId(UnknownEnumMixin, StrEnum): - """ - Supported blockchain chain identifiers for balance queries. Each value - maps to a specific chain supported by the underlying providers (Privy, - Coinbase). - """ - - BASE = "BASE" - """Base Mainnet (EVM L2)""" - BASE_SEPOLIA = "BASE_SEPOLIA" - """Base Sepolia testnet (EVM L2)""" - ETHEREUM = "ETHEREUM" - """Ethereum Mainnet (EVM L1)""" - SOLANA = "SOLANA" - """Solana Mainnet""" - SOLANA_DEVNET = "SOLANA_DEVNET" - """Solana Devnet testnet""" - - -class InstrumentBalanceToken(UnknownEnumMixin, StrEnum): - """ - Supported tokens for instrument balance queries. Only tokens supported - for X402 payments are returned. - """ - - USDC = "USDC" - - -@dataclass(kw_only=True) -class GetPaymentInstrumentBalanceInput: - """Request structure for getting payment instrument balance.""" - - user_id: str | None = None - """The user ID associated with this payment instrument.""" - - agent_name: str | None = None - """The agent name associated with this request, used for observability.""" - - payment_manager_arn: str | None = None - """The ARN of the payment manager that owns this payment instrument.""" - - payment_connector_id: str | None = None - """The ID of the payment connector associated with this instrument.""" - - payment_instrument_id: str | None = None - """The ID of the payment instrument to query balance for.""" - - chain: str | None = None - """ - The specific blockchain chain to query balance on. Required because - balances are chain-specific. - """ - - token: str | None = None - """ - The token to query balance for. Only tokens supported for X402 payments - are returned. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_PAYMENT_INSTRUMENT_BALANCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.user_id is not None: - serializer.write_string( - _SCHEMA_GET_PAYMENT_INSTRUMENT_BALANCE_INPUT.members["userId"], - self.user_id, - ) - - if self.agent_name is not None: - serializer.write_string( - _SCHEMA_GET_PAYMENT_INSTRUMENT_BALANCE_INPUT.members["agentName"], - self.agent_name, - ) - - if self.payment_manager_arn is not None: - serializer.write_string( - _SCHEMA_GET_PAYMENT_INSTRUMENT_BALANCE_INPUT.members[ - "paymentManagerArn" - ], - self.payment_manager_arn, - ) - - if self.payment_connector_id is not None: - serializer.write_string( - _SCHEMA_GET_PAYMENT_INSTRUMENT_BALANCE_INPUT.members[ - "paymentConnectorId" - ], - self.payment_connector_id, - ) - - if self.payment_instrument_id is not None: - serializer.write_string( - _SCHEMA_GET_PAYMENT_INSTRUMENT_BALANCE_INPUT.members[ - "paymentInstrumentId" - ], - self.payment_instrument_id, - ) - - if self.chain is not None: - serializer.write_string( - _SCHEMA_GET_PAYMENT_INSTRUMENT_BALANCE_INPUT.members["chain"], - self.chain, - ) - - if self.token is not None: - serializer.write_string( - _SCHEMA_GET_PAYMENT_INSTRUMENT_BALANCE_INPUT.members["token"], - self.token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["user_id"] = de.read_string( - _SCHEMA_GET_PAYMENT_INSTRUMENT_BALANCE_INPUT.members["userId"] - ) - - case 1: - kwargs["agent_name"] = de.read_string( - _SCHEMA_GET_PAYMENT_INSTRUMENT_BALANCE_INPUT.members[ - "agentName" - ] - ) - - case 2: - kwargs["payment_manager_arn"] = de.read_string( - _SCHEMA_GET_PAYMENT_INSTRUMENT_BALANCE_INPUT.members[ - "paymentManagerArn" - ] - ) - - case 3: - kwargs["payment_connector_id"] = de.read_string( - _SCHEMA_GET_PAYMENT_INSTRUMENT_BALANCE_INPUT.members[ - "paymentConnectorId" - ] - ) - - case 4: - kwargs["payment_instrument_id"] = de.read_string( - _SCHEMA_GET_PAYMENT_INSTRUMENT_BALANCE_INPUT.members[ - "paymentInstrumentId" - ] - ) - - case 5: - kwargs["chain"] = BlockchainChainId( - de.read_string( - _SCHEMA_GET_PAYMENT_INSTRUMENT_BALANCE_INPUT.members[ - "chain" - ] - ) - ) - - case 6: - kwargs["token"] = InstrumentBalanceToken( - de.read_string( - _SCHEMA_GET_PAYMENT_INSTRUMENT_BALANCE_INPUT.members[ - "token" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_PAYMENT_INSTRUMENT_BALANCE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class TokenBalance: - """A single token balance entry.""" - - amount: str - """ - Raw balance in the smallest denomination (e.g., USDC base units where 1 - USDC = 1000000). - """ - - decimals: int - """Number of decimal places for the token (e.g., 6 for USDC).""" - - token: str - """The supported token for this balance.""" - - network: str - """The blockchain network family (ETHEREUM or SOLANA).""" - - chain: str - """The specific blockchain chain.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOKEN_BALANCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_TOKEN_BALANCE.members["amount"], self.amount) - serializer.write_integer( - _SCHEMA_TOKEN_BALANCE.members["decimals"], self.decimals - ) - serializer.write_string(_SCHEMA_TOKEN_BALANCE.members["token"], self.token) - serializer.write_string(_SCHEMA_TOKEN_BALANCE.members["network"], self.network) - serializer.write_string(_SCHEMA_TOKEN_BALANCE.members["chain"], self.chain) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["amount"] = de.read_string( - _SCHEMA_TOKEN_BALANCE.members["amount"] - ) - - case 1: - kwargs["decimals"] = de.read_integer( - _SCHEMA_TOKEN_BALANCE.members["decimals"] - ) - - case 2: - kwargs["token"] = InstrumentBalanceToken( - de.read_string(_SCHEMA_TOKEN_BALANCE.members["token"]) - ) - - case 3: - kwargs["network"] = CryptoWalletNetwork( - de.read_string(_SCHEMA_TOKEN_BALANCE.members["network"]) - ) - - case 4: - kwargs["chain"] = BlockchainChainId( - de.read_string(_SCHEMA_TOKEN_BALANCE.members["chain"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TOKEN_BALANCE, consumer=_consumer) - if "amount" not in kwargs: - kwargs["amount"] = "" - if "decimals" not in kwargs: - kwargs["decimals"] = 0 - if "token" not in kwargs: - kwargs["token"] = InstrumentBalanceToken._corrected("") - if "network" not in kwargs: - kwargs["network"] = CryptoWalletNetwork._corrected("") - if "chain" not in kwargs: - kwargs["chain"] = BlockchainChainId._corrected("") - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls( - amount="", - decimals=0, - token=InstrumentBalanceToken._corrected(""), - network=CryptoWalletNetwork._corrected(""), - chain=BlockchainChainId._corrected(""), - ) - - -@dataclass(kw_only=True) -class GetPaymentInstrumentBalanceOutput: - """Response structure for getting payment instrument balance.""" - - payment_instrument_id: str - """The ID of the payment instrument.""" - - token_balance: TokenBalance - """The balance of the supported token on the requested chain.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_PAYMENT_INSTRUMENT_BALANCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_PAYMENT_INSTRUMENT_BALANCE_OUTPUT.members[ - "paymentInstrumentId" - ], - self.payment_instrument_id, - ) - serializer.write_struct( - _SCHEMA_GET_PAYMENT_INSTRUMENT_BALANCE_OUTPUT.members["tokenBalance"], - self.token_balance, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["payment_instrument_id"] = de.read_string( - _SCHEMA_GET_PAYMENT_INSTRUMENT_BALANCE_OUTPUT.members[ - "paymentInstrumentId" - ] - ) - - case 1: - kwargs["token_balance"] = TokenBalance.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_PAYMENT_INSTRUMENT_BALANCE_OUTPUT, consumer=_consumer - ) - if "payment_instrument_id" not in kwargs: - kwargs["payment_instrument_id"] = "" - if "token_balance" not in kwargs: - kwargs["token_balance"] = TokenBalance._smithy_default() - return kwargs - - -GET_PAYMENT_INSTRUMENT_BALANCE = APIOperation( - input=GetPaymentInstrumentBalanceInput, - output=GetPaymentInstrumentBalanceOutput, - schema=_SCHEMA_GET_PAYMENT_INSTRUMENT_BALANCE, - input_schema=_SCHEMA_GET_PAYMENT_INSTRUMENT_BALANCE_INPUT, - output_schema=_SCHEMA_GET_PAYMENT_INSTRUMENT_BALANCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListPaymentInstrumentsInput: - """Request structure for listing payment instruments.""" - - user_id: str | None = None - """The user ID associated with the payment instruments.""" - - agent_name: str | None = None - """The agent name associated with this request, used for observability.""" - - payment_manager_arn: str | None = None - """The ARN of the payment manager that owns the payment instruments.""" - - payment_connector_id: str | None = None - """The ID of the payment connector to filter by.""" - - next_token: str | None = None - """Token for pagination to retrieve the next set of results.""" - - max_results: int | None = None - """Maximum number of results to return in a single response.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_PAYMENT_INSTRUMENTS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.user_id is not None: - serializer.write_string( - _SCHEMA_LIST_PAYMENT_INSTRUMENTS_INPUT.members["userId"], self.user_id - ) - - if self.agent_name is not None: - serializer.write_string( - _SCHEMA_LIST_PAYMENT_INSTRUMENTS_INPUT.members["agentName"], - self.agent_name, - ) - - if self.payment_manager_arn is not None: - serializer.write_string( - _SCHEMA_LIST_PAYMENT_INSTRUMENTS_INPUT.members["paymentManagerArn"], - self.payment_manager_arn, - ) - - if self.payment_connector_id is not None: - serializer.write_string( - _SCHEMA_LIST_PAYMENT_INSTRUMENTS_INPUT.members["paymentConnectorId"], - self.payment_connector_id, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_PAYMENT_INSTRUMENTS_INPUT.members["nextToken"], - self.next_token, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_PAYMENT_INSTRUMENTS_INPUT.members["maxResults"], - self.max_results, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["user_id"] = de.read_string( - _SCHEMA_LIST_PAYMENT_INSTRUMENTS_INPUT.members["userId"] - ) - - case 1: - kwargs["agent_name"] = de.read_string( - _SCHEMA_LIST_PAYMENT_INSTRUMENTS_INPUT.members["agentName"] - ) - - case 2: - kwargs["payment_manager_arn"] = de.read_string( - _SCHEMA_LIST_PAYMENT_INSTRUMENTS_INPUT.members[ - "paymentManagerArn" - ] - ) - - case 3: - kwargs["payment_connector_id"] = de.read_string( - _SCHEMA_LIST_PAYMENT_INSTRUMENTS_INPUT.members[ - "paymentConnectorId" - ] - ) - - case 4: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_PAYMENT_INSTRUMENTS_INPUT.members["nextToken"] - ) - - case 5: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_PAYMENT_INSTRUMENTS_INPUT.members["maxResults"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_PAYMENT_INSTRUMENTS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class PaymentInstrumentSummary: - """Summary of a payment instrument for list operations.""" - - payment_instrument_id: str - """The unique identifier for this payment instrument.""" - - payment_manager_arn: str - """The ARN of the payment manager that owns this payment instrument.""" - - payment_connector_id: str - """The ID of the payment connector associated with this instrument.""" - - user_id: str - """The user ID associated with this payment instrument.""" - - payment_instrument_type: str - """The type of payment instrument (e.g., EMBEDDED_CRYPTO_WALLET).""" - - status: str - """The current status of this payment instrument.""" - - created_at: datetime - """The timestamp when this payment instrument was created.""" - - updated_at: datetime - """The timestamp when this payment instrument was last updated.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PAYMENT_INSTRUMENT_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_PAYMENT_INSTRUMENT_SUMMARY.members["paymentInstrumentId"], - self.payment_instrument_id, - ) - serializer.write_string( - _SCHEMA_PAYMENT_INSTRUMENT_SUMMARY.members["paymentManagerArn"], - self.payment_manager_arn, - ) - serializer.write_string( - _SCHEMA_PAYMENT_INSTRUMENT_SUMMARY.members["paymentConnectorId"], - self.payment_connector_id, - ) - serializer.write_string( - _SCHEMA_PAYMENT_INSTRUMENT_SUMMARY.members["userId"], self.user_id - ) - serializer.write_string( - _SCHEMA_PAYMENT_INSTRUMENT_SUMMARY.members["paymentInstrumentType"], - self.payment_instrument_type, - ) - serializer.write_string( - _SCHEMA_PAYMENT_INSTRUMENT_SUMMARY.members["status"], self.status - ) - serializer.write_timestamp( - _SCHEMA_PAYMENT_INSTRUMENT_SUMMARY.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_PAYMENT_INSTRUMENT_SUMMARY.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["payment_instrument_id"] = de.read_string( - _SCHEMA_PAYMENT_INSTRUMENT_SUMMARY.members[ - "paymentInstrumentId" - ] - ) - - case 1: - kwargs["payment_manager_arn"] = de.read_string( - _SCHEMA_PAYMENT_INSTRUMENT_SUMMARY.members["paymentManagerArn"] - ) - - case 2: - kwargs["payment_connector_id"] = de.read_string( - _SCHEMA_PAYMENT_INSTRUMENT_SUMMARY.members["paymentConnectorId"] - ) - - case 3: - kwargs["user_id"] = de.read_string( - _SCHEMA_PAYMENT_INSTRUMENT_SUMMARY.members["userId"] - ) - - case 4: - kwargs["payment_instrument_type"] = PaymentInstrumentType( - de.read_string( - _SCHEMA_PAYMENT_INSTRUMENT_SUMMARY.members[ - "paymentInstrumentType" - ] - ) - ) - - case 5: - kwargs["status"] = PaymentInstrumentStatus( - de.read_string( - _SCHEMA_PAYMENT_INSTRUMENT_SUMMARY.members["status"] - ) - ) - - case 6: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_PAYMENT_INSTRUMENT_SUMMARY.members["createdAt"] - ) - - case 7: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_PAYMENT_INSTRUMENT_SUMMARY.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PAYMENT_INSTRUMENT_SUMMARY, consumer=_consumer) - if "payment_instrument_id" not in kwargs: - kwargs["payment_instrument_id"] = "" - if "payment_manager_arn" not in kwargs: - kwargs["payment_manager_arn"] = "" - if "payment_connector_id" not in kwargs: - kwargs["payment_connector_id"] = "" - if "user_id" not in kwargs: - kwargs["user_id"] = "" - if "payment_instrument_type" not in kwargs: - kwargs["payment_instrument_type"] = PaymentInstrumentType._corrected("") - if "status" not in kwargs: - kwargs["status"] = PaymentInstrumentStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_payment_instrument_summary_list( - serializer: ShapeSerializer, schema: Schema, value: list[PaymentInstrumentSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_payment_instrument_summary_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[PaymentInstrumentSummary]: - result: list[PaymentInstrumentSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(PaymentInstrumentSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListPaymentInstrumentsOutput: - """Response structure for listing payment instruments.""" - - payment_instruments: list[PaymentInstrumentSummary] - """List of payment instrument summaries matching the request criteria.""" - - next_token: str | None = None - """Token for pagination to retrieve the next set of results.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_PAYMENT_INSTRUMENTS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_payment_instrument_summary_list( - serializer, - _SCHEMA_LIST_PAYMENT_INSTRUMENTS_OUTPUT.members["paymentInstruments"], - self.payment_instruments, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_PAYMENT_INSTRUMENTS_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["payment_instruments"] = ( - _deserialize_payment_instrument_summary_list( - de, - _SCHEMA_LIST_PAYMENT_INSTRUMENTS_OUTPUT.members[ - "paymentInstruments" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_PAYMENT_INSTRUMENTS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_PAYMENT_INSTRUMENTS_OUTPUT, consumer=_consumer - ) - if "payment_instruments" not in kwargs: - kwargs["payment_instruments"] = [] - return kwargs - - -LIST_PAYMENT_INSTRUMENTS = APIOperation( - input=ListPaymentInstrumentsInput, - output=ListPaymentInstrumentsOutput, - schema=_SCHEMA_LIST_PAYMENT_INSTRUMENTS, - input_schema=_SCHEMA_LIST_PAYMENT_INSTRUMENTS_INPUT, - output_schema=_SCHEMA_LIST_PAYMENT_INSTRUMENTS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class Currency(UnknownEnumMixin, StrEnum): - """Supported currency codes.""" - - USD = "USD" - - -@dataclass(kw_only=True) -class Amount: - """Represents a monetary amount with a currency.""" - - value: str - """The numeric value of the amount.""" - - currency: str - """The currency code for the amount.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AMOUNT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_AMOUNT.members["value"], self.value) - serializer.write_string(_SCHEMA_AMOUNT.members["currency"], self.currency) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["value"] = de.read_string(_SCHEMA_AMOUNT.members["value"]) - - case 1: - kwargs["currency"] = Currency( - de.read_string(_SCHEMA_AMOUNT.members["currency"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AMOUNT, consumer=_consumer) - if "value" not in kwargs: - kwargs["value"] = "" - if "currency" not in kwargs: - kwargs["currency"] = Currency._corrected("") - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(value="", currency=Currency._corrected("")) - - -@dataclass(kw_only=True) -class SessionLimits: - """The spending limits configuration for a payment session.""" - - max_spend_amount: Amount - """The maximum amount that can be spent in the session.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SESSION_LIMITS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_SESSION_LIMITS.members["maxSpendAmount"], self.max_spend_amount - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["max_spend_amount"] = Amount.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SESSION_LIMITS, consumer=_consumer) - if "max_spend_amount" not in kwargs: - kwargs["max_spend_amount"] = Amount._smithy_default() - return kwargs - - -@dataclass(kw_only=True) -class CreatePaymentSessionInput: - """Request structure for creating a payment session.""" - - user_id: str | None = None - """The user ID associated with this payment session.""" - - agent_name: str | None = None - """The agent name associated with this request, used for observability.""" - - payment_manager_arn: str | None = None - """The ARN of the payment manager that owns this session.""" - - limits: SessionLimits | None = None - """The spending limits for this payment session.""" - - expiry_time_in_minutes: int | None = None - """The session expiry time in minutes. Must be between 15 and 480 minutes.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier that you provide to ensure the - idempotency of the request. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_PAYMENT_SESSION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.user_id is not None: - serializer.write_string( - _SCHEMA_CREATE_PAYMENT_SESSION_INPUT.members["userId"], self.user_id - ) - - if self.agent_name is not None: - serializer.write_string( - _SCHEMA_CREATE_PAYMENT_SESSION_INPUT.members["agentName"], - self.agent_name, - ) - - if self.payment_manager_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_PAYMENT_SESSION_INPUT.members["paymentManagerArn"], - self.payment_manager_arn, - ) - - if self.limits is not None: - serializer.write_struct( - _SCHEMA_CREATE_PAYMENT_SESSION_INPUT.members["limits"], self.limits - ) - - if self.expiry_time_in_minutes is not None: - serializer.write_integer( - _SCHEMA_CREATE_PAYMENT_SESSION_INPUT.members["expiryTimeInMinutes"], - self.expiry_time_in_minutes, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_PAYMENT_SESSION_INPUT.members["clientToken"], - self.client_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["user_id"] = de.read_string( - _SCHEMA_CREATE_PAYMENT_SESSION_INPUT.members["userId"] - ) - - case 1: - kwargs["agent_name"] = de.read_string( - _SCHEMA_CREATE_PAYMENT_SESSION_INPUT.members["agentName"] - ) - - case 2: - kwargs["payment_manager_arn"] = de.read_string( - _SCHEMA_CREATE_PAYMENT_SESSION_INPUT.members[ - "paymentManagerArn" - ] - ) - - case 3: - kwargs["limits"] = SessionLimits.deserialize(de) - - case 4: - kwargs["expiry_time_in_minutes"] = de.read_integer( - _SCHEMA_CREATE_PAYMENT_SESSION_INPUT.members[ - "expiryTimeInMinutes" - ] - ) - - case 5: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_PAYMENT_SESSION_INPUT.members["clientToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_PAYMENT_SESSION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class AvailableLimits: - """The available spending limits for a payment session.""" - - available_spend_amount: Amount | None = None - """The remaining available amount that can be spent.""" - - updated_at: datetime | None = None - """The timestamp when the available limits were last updated.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AVAILABLE_LIMITS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.available_spend_amount is not None: - serializer.write_struct( - _SCHEMA_AVAILABLE_LIMITS.members["availableSpendAmount"], - self.available_spend_amount, - ) - - if self.updated_at is not None: - serializer.write_timestamp( - _SCHEMA_AVAILABLE_LIMITS.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["available_spend_amount"] = Amount.deserialize(de) - - case 1: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_AVAILABLE_LIMITS.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AVAILABLE_LIMITS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class PaymentSession: - """A payment session for managing payment transactions.""" - - payment_session_id: str - """The unique identifier of the payment session.""" - - payment_manager_arn: str - """The ARN of the payment manager that owns this session.""" - - user_id: str - """The user ID associated with this session.""" - - expiry_time_in_minutes: int - """The session expiry time in minutes.""" - - created_at: datetime - """The timestamp when the session was created.""" - - updated_at: datetime - """The timestamp when the session was last updated.""" - - limits: SessionLimits | None = None - """The spending limits for the payment session.""" - - available_limits: AvailableLimits | None = None - """The current available spending limits.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PAYMENT_SESSION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_PAYMENT_SESSION.members["paymentSessionId"], self.payment_session_id - ) - serializer.write_string( - _SCHEMA_PAYMENT_SESSION.members["paymentManagerArn"], - self.payment_manager_arn, - ) - if self.limits is not None: - serializer.write_struct( - _SCHEMA_PAYMENT_SESSION.members["limits"], self.limits - ) - - serializer.write_string(_SCHEMA_PAYMENT_SESSION.members["userId"], self.user_id) - serializer.write_integer( - _SCHEMA_PAYMENT_SESSION.members["expiryTimeInMinutes"], - self.expiry_time_in_minutes, - ) - serializer.write_timestamp( - _SCHEMA_PAYMENT_SESSION.members["createdAt"], self.created_at - ) - if self.available_limits is not None: - serializer.write_struct( - _SCHEMA_PAYMENT_SESSION.members["availableLimits"], - self.available_limits, - ) - - serializer.write_timestamp( - _SCHEMA_PAYMENT_SESSION.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["payment_session_id"] = de.read_string( - _SCHEMA_PAYMENT_SESSION.members["paymentSessionId"] - ) - - case 1: - kwargs["payment_manager_arn"] = de.read_string( - _SCHEMA_PAYMENT_SESSION.members["paymentManagerArn"] - ) - - case 2: - kwargs["limits"] = SessionLimits.deserialize(de) - - case 3: - kwargs["user_id"] = de.read_string( - _SCHEMA_PAYMENT_SESSION.members["userId"] - ) - - case 4: - kwargs["expiry_time_in_minutes"] = de.read_integer( - _SCHEMA_PAYMENT_SESSION.members["expiryTimeInMinutes"] - ) - - case 5: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_PAYMENT_SESSION.members["createdAt"] - ) - - case 6: - kwargs["available_limits"] = AvailableLimits.deserialize(de) - - case 7: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_PAYMENT_SESSION.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PAYMENT_SESSION, consumer=_consumer) - if "payment_session_id" not in kwargs: - kwargs["payment_session_id"] = "" - if "payment_manager_arn" not in kwargs: - kwargs["payment_manager_arn"] = "" - if "user_id" not in kwargs: - kwargs["user_id"] = "" - if "expiry_time_in_minutes" not in kwargs: - kwargs["expiry_time_in_minutes"] = 0 - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls( - payment_session_id="", - payment_manager_arn="", - user_id="", - expiry_time_in_minutes=0, - created_at=datetime.fromtimestamp(0, tz=timezone.utc), - updated_at=datetime.fromtimestamp(0, tz=timezone.utc), - ) - - -@dataclass(kw_only=True) -class CreatePaymentSessionOutput: - """Response structure for creating a payment session.""" - - payment_session: PaymentSession - """The created payment session.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_PAYMENT_SESSION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CREATE_PAYMENT_SESSION_OUTPUT.members["paymentSession"], - self.payment_session, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["payment_session"] = PaymentSession.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_PAYMENT_SESSION_OUTPUT, consumer=_consumer - ) - if "payment_session" not in kwargs: - kwargs["payment_session"] = PaymentSession._smithy_default() - return kwargs - - -CREATE_PAYMENT_SESSION = APIOperation( - input=CreatePaymentSessionInput, - output=CreatePaymentSessionOutput, - schema=_SCHEMA_CREATE_PAYMENT_SESSION, - input_schema=_SCHEMA_CREATE_PAYMENT_SESSION_INPUT, - output_schema=_SCHEMA_CREATE_PAYMENT_SESSION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcore#SubscriptionRequiredException" - ): SubscriptionRequiredException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_SUBSCRIPTION_REQUIRED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeletePaymentSessionInput: - """Request structure for deleting a payment session.""" - - user_id: str | None = None - """The user ID making the delete request. Must match the session's userId.""" - - payment_manager_arn: str | None = None - """The payment manager ARN. Must match the session's paymentManagerArn.""" - - payment_session_id: str | None = None - """The payment session ID to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_PAYMENT_SESSION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.user_id is not None: - serializer.write_string( - _SCHEMA_DELETE_PAYMENT_SESSION_INPUT.members["userId"], self.user_id - ) - - if self.payment_manager_arn is not None: - serializer.write_string( - _SCHEMA_DELETE_PAYMENT_SESSION_INPUT.members["paymentManagerArn"], - self.payment_manager_arn, - ) - - if self.payment_session_id is not None: - serializer.write_string( - _SCHEMA_DELETE_PAYMENT_SESSION_INPUT.members["paymentSessionId"], - self.payment_session_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["user_id"] = de.read_string( - _SCHEMA_DELETE_PAYMENT_SESSION_INPUT.members["userId"] - ) - - case 1: - kwargs["payment_manager_arn"] = de.read_string( - _SCHEMA_DELETE_PAYMENT_SESSION_INPUT.members[ - "paymentManagerArn" - ] - ) - - case 2: - kwargs["payment_session_id"] = de.read_string( - _SCHEMA_DELETE_PAYMENT_SESSION_INPUT.members["paymentSessionId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_PAYMENT_SESSION_INPUT, consumer=_consumer - ) - return kwargs - - -class PaymentSessionStatus(UnknownEnumMixin, StrEnum): - """The status of a payment session.""" - - ACTIVE = "ACTIVE" - EXPIRED = "EXPIRED" - DELETED = "DELETED" - - -@dataclass(kw_only=True) -class DeletePaymentSessionOutput: - """Response structure for deleting a payment session.""" - - status: str - """The status of the deletion. Always DELETED for successful hard delete.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_PAYMENT_SESSION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DELETE_PAYMENT_SESSION_OUTPUT.members["status"], self.status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["status"] = PaymentSessionStatus( - de.read_string( - _SCHEMA_DELETE_PAYMENT_SESSION_OUTPUT.members["status"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_PAYMENT_SESSION_OUTPUT, consumer=_consumer - ) - if "status" not in kwargs: - kwargs["status"] = PaymentSessionStatus._corrected("") - return kwargs - - -DELETE_PAYMENT_SESSION = APIOperation( - input=DeletePaymentSessionInput, - output=DeletePaymentSessionOutput, - schema=_SCHEMA_DELETE_PAYMENT_SESSION, - input_schema=_SCHEMA_DELETE_PAYMENT_SESSION_INPUT, - output_schema=_SCHEMA_DELETE_PAYMENT_SESSION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetPaymentSessionInput: - """Request structure for getting a payment session.""" - - user_id: str | None = None - """The user ID associated with this payment session.""" - - agent_name: str | None = None - """The agent name associated with this request, used for observability.""" - - payment_manager_arn: str | None = None - """The ARN of the payment manager that owns this session.""" - - payment_session_id: str | None = None - """The ID of the payment session to retrieve.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_PAYMENT_SESSION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.user_id is not None: - serializer.write_string( - _SCHEMA_GET_PAYMENT_SESSION_INPUT.members["userId"], self.user_id - ) - - if self.agent_name is not None: - serializer.write_string( - _SCHEMA_GET_PAYMENT_SESSION_INPUT.members["agentName"], self.agent_name - ) - - if self.payment_manager_arn is not None: - serializer.write_string( - _SCHEMA_GET_PAYMENT_SESSION_INPUT.members["paymentManagerArn"], - self.payment_manager_arn, - ) - - if self.payment_session_id is not None: - serializer.write_string( - _SCHEMA_GET_PAYMENT_SESSION_INPUT.members["paymentSessionId"], - self.payment_session_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["user_id"] = de.read_string( - _SCHEMA_GET_PAYMENT_SESSION_INPUT.members["userId"] - ) - - case 1: - kwargs["agent_name"] = de.read_string( - _SCHEMA_GET_PAYMENT_SESSION_INPUT.members["agentName"] - ) - - case 2: - kwargs["payment_manager_arn"] = de.read_string( - _SCHEMA_GET_PAYMENT_SESSION_INPUT.members["paymentManagerArn"] - ) - - case 3: - kwargs["payment_session_id"] = de.read_string( - _SCHEMA_GET_PAYMENT_SESSION_INPUT.members["paymentSessionId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_PAYMENT_SESSION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetPaymentSessionOutput: - """Response structure for getting a payment session.""" - - payment_session: PaymentSession - """The payment session details.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_PAYMENT_SESSION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_PAYMENT_SESSION_OUTPUT.members["paymentSession"], - self.payment_session, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["payment_session"] = PaymentSession.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_PAYMENT_SESSION_OUTPUT, consumer=_consumer) - if "payment_session" not in kwargs: - kwargs["payment_session"] = PaymentSession._smithy_default() - return kwargs - - -GET_PAYMENT_SESSION = APIOperation( - input=GetPaymentSessionInput, - output=GetPaymentSessionOutput, - schema=_SCHEMA_GET_PAYMENT_SESSION, - input_schema=_SCHEMA_GET_PAYMENT_SESSION_INPUT, - output_schema=_SCHEMA_GET_PAYMENT_SESSION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListPaymentSessionsInput: - """Request structure for listing payment sessions.""" - - user_id: str | None = None - """The user ID associated with the payment sessions.""" - - agent_name: str | None = None - """The agent name associated with this request, used for observability.""" - - payment_manager_arn: str | None = None - """The ARN of the payment manager that owns the sessions.""" - - next_token: str | None = None - """Token for pagination to retrieve the next set of results.""" - - max_results: int | None = None - """Maximum number of results to return in a single response.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_PAYMENT_SESSIONS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.user_id is not None: - serializer.write_string( - _SCHEMA_LIST_PAYMENT_SESSIONS_INPUT.members["userId"], self.user_id - ) - - if self.agent_name is not None: - serializer.write_string( - _SCHEMA_LIST_PAYMENT_SESSIONS_INPUT.members["agentName"], - self.agent_name, - ) - - if self.payment_manager_arn is not None: - serializer.write_string( - _SCHEMA_LIST_PAYMENT_SESSIONS_INPUT.members["paymentManagerArn"], - self.payment_manager_arn, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_PAYMENT_SESSIONS_INPUT.members["nextToken"], - self.next_token, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_PAYMENT_SESSIONS_INPUT.members["maxResults"], - self.max_results, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["user_id"] = de.read_string( - _SCHEMA_LIST_PAYMENT_SESSIONS_INPUT.members["userId"] - ) - - case 1: - kwargs["agent_name"] = de.read_string( - _SCHEMA_LIST_PAYMENT_SESSIONS_INPUT.members["agentName"] - ) - - case 2: - kwargs["payment_manager_arn"] = de.read_string( - _SCHEMA_LIST_PAYMENT_SESSIONS_INPUT.members["paymentManagerArn"] - ) - - case 3: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_PAYMENT_SESSIONS_INPUT.members["nextToken"] - ) - - case 4: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_PAYMENT_SESSIONS_INPUT.members["maxResults"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_PAYMENT_SESSIONS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class PaymentSessionSummary: - """Summary information about a payment session.""" - - payment_session_id: str - """The unique identifier of the payment session.""" - - payment_manager_arn: str - """The ARN of the payment manager that owns this session.""" - - user_id: str - """The user ID associated with this session.""" - - expiry_time_in_minutes: int - """The session expiry time in minutes.""" - - created_at: datetime - """The timestamp when the session was created.""" - - updated_at: datetime - """The timestamp when the session was last updated.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PAYMENT_SESSION_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_PAYMENT_SESSION_SUMMARY.members["paymentSessionId"], - self.payment_session_id, - ) - serializer.write_string( - _SCHEMA_PAYMENT_SESSION_SUMMARY.members["paymentManagerArn"], - self.payment_manager_arn, - ) - serializer.write_string( - _SCHEMA_PAYMENT_SESSION_SUMMARY.members["userId"], self.user_id - ) - serializer.write_integer( - _SCHEMA_PAYMENT_SESSION_SUMMARY.members["expiryTimeInMinutes"], - self.expiry_time_in_minutes, - ) - serializer.write_timestamp( - _SCHEMA_PAYMENT_SESSION_SUMMARY.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_PAYMENT_SESSION_SUMMARY.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["payment_session_id"] = de.read_string( - _SCHEMA_PAYMENT_SESSION_SUMMARY.members["paymentSessionId"] - ) - - case 1: - kwargs["payment_manager_arn"] = de.read_string( - _SCHEMA_PAYMENT_SESSION_SUMMARY.members["paymentManagerArn"] - ) - - case 2: - kwargs["user_id"] = de.read_string( - _SCHEMA_PAYMENT_SESSION_SUMMARY.members["userId"] - ) - - case 3: - kwargs["expiry_time_in_minutes"] = de.read_integer( - _SCHEMA_PAYMENT_SESSION_SUMMARY.members["expiryTimeInMinutes"] - ) - - case 4: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_PAYMENT_SESSION_SUMMARY.members["createdAt"] - ) - - case 5: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_PAYMENT_SESSION_SUMMARY.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PAYMENT_SESSION_SUMMARY, consumer=_consumer) - if "payment_session_id" not in kwargs: - kwargs["payment_session_id"] = "" - if "payment_manager_arn" not in kwargs: - kwargs["payment_manager_arn"] = "" - if "user_id" not in kwargs: - kwargs["user_id"] = "" - if "expiry_time_in_minutes" not in kwargs: - kwargs["expiry_time_in_minutes"] = 0 - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_payment_session_summary_list( - serializer: ShapeSerializer, schema: Schema, value: list[PaymentSessionSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_payment_session_summary_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[PaymentSessionSummary]: - result: list[PaymentSessionSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(PaymentSessionSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListPaymentSessionsOutput: - """Response structure for listing payment sessions.""" - - payment_sessions: list[PaymentSessionSummary] - """List of payment session summaries matching the request criteria.""" - - next_token: str | None = None - """Token for pagination to retrieve the next set of results.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_PAYMENT_SESSIONS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_payment_session_summary_list( - serializer, - _SCHEMA_LIST_PAYMENT_SESSIONS_OUTPUT.members["paymentSessions"], - self.payment_sessions, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_PAYMENT_SESSIONS_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["payment_sessions"] = ( - _deserialize_payment_session_summary_list( - de, - _SCHEMA_LIST_PAYMENT_SESSIONS_OUTPUT.members[ - "paymentSessions" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_PAYMENT_SESSIONS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_PAYMENT_SESSIONS_OUTPUT, consumer=_consumer - ) - if "payment_sessions" not in kwargs: - kwargs["payment_sessions"] = [] - return kwargs - - -LIST_PAYMENT_SESSIONS = APIOperation( - input=ListPaymentSessionsInput, - output=ListPaymentSessionsOutput, - schema=_SCHEMA_LIST_PAYMENT_SESSIONS, - input_schema=_SCHEMA_LIST_PAYMENT_SESSIONS_INPUT, - output_schema=_SCHEMA_LIST_PAYMENT_SESSIONS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class CryptoX402PaymentInput: - """The input for a crypto X402 payment.""" - - version: str - """The version of the X402 protocol.""" - - payload: Document = field(repr=False) - """The X402 payment payload.""" - - permit2_allowance_limit: str | None = None - """ - The maximum on-chain Permit2 allowance to grant before signing the - payment authorization, in the asset's smallest denomination. This field - is valid only for the `upto` (metered) scheme; supplying it for the - `exact` scheme returns a validation error. - - When set, the service approves an ERC-20 allowance for this amount - before processing the payment. The approval sets, rather than adds to, - the wallet's allowance. Set this field only when the wallet needs - approving, for example on its first `upto` payment, to avoid a redundant - on-chain transaction. Omit the field to skip allowance handling. This is - the default, and the only behavior for the `exact` scheme. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CRYPTO_X402_PAYMENT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CRYPTO_X402_PAYMENT_INPUT.members["version"], self.version - ) - serializer.write_document( - _SCHEMA_CRYPTO_X402_PAYMENT_INPUT.members["payload"], self.payload - ) - if self.permit2_allowance_limit is not None: - serializer.write_string( - _SCHEMA_CRYPTO_X402_PAYMENT_INPUT.members["permit2AllowanceLimit"], - self.permit2_allowance_limit, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["version"] = de.read_string( - _SCHEMA_CRYPTO_X402_PAYMENT_INPUT.members["version"] - ) - - case 1: - kwargs["payload"] = de.read_document( - _SCHEMA_CRYPTO_X402_PAYMENT_INPUT.members["payload"] - ) - - case 2: - kwargs["permit2_allowance_limit"] = de.read_string( - _SCHEMA_CRYPTO_X402_PAYMENT_INPUT.members[ - "permit2AllowanceLimit" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CRYPTO_X402_PAYMENT_INPUT, consumer=_consumer) - if "version" not in kwargs: - kwargs["version"] = "" - if "payload" not in kwargs: - kwargs["payload"] = Document(None) - return kwargs - - -def _serialize_www_authenticate_header_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_www_authenticate_header_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class MppPaymentInput: - """ - Contains the payment challenge from a 402 Payment Required response. - Forward the raw `WWW-Authenticate: Payment` header value verbatim. In - response, you receive a payment credential that satisfies the challenge. - Provide exactly one challenge per request. - """ - - version: str - """The MPP protocol version, for example \"1\" or \"2\".""" - - www_authenticate_headers: list[str] - """ - The raw `WWW-Authenticate: Payment` header value from the 402 response, - passed verbatim. Provide exactly one entry. The service uses this value - to generate the payment credential. - """ - - buyer_pays_gas_fees: bool | None = None - """ - Authorizes the service to sign a payment whose blockchain network (gas) - fees are charged to your wallet, on top of the payment amount. - - The challenge indicates who sponsors the network fees. When the - challenge does not sponsor them, the service signs the payment only if - this field is `true`. Otherwise it returns a validation error, so you - can decide whether to pay the fees or obtain a challenge that sponsors - them. - - Optional. When omitted or `false`, you decline to pay network fees. This - field has no effect on challenges that already sponsor the fees. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MPP_PAYMENT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MPP_PAYMENT_INPUT.members["version"], self.version - ) - _serialize_www_authenticate_header_list( - serializer, - _SCHEMA_MPP_PAYMENT_INPUT.members["wwwAuthenticateHeaders"], - self.www_authenticate_headers, - ) - if self.buyer_pays_gas_fees is not None: - serializer.write_boolean( - _SCHEMA_MPP_PAYMENT_INPUT.members["buyerPaysGasFees"], - self.buyer_pays_gas_fees, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["version"] = de.read_string( - _SCHEMA_MPP_PAYMENT_INPUT.members["version"] - ) - - case 1: - kwargs["www_authenticate_headers"] = ( - _deserialize_www_authenticate_header_list( - de, - _SCHEMA_MPP_PAYMENT_INPUT.members["wwwAuthenticateHeaders"], - ) - ) - - case 2: - kwargs["buyer_pays_gas_fees"] = de.read_boolean( - _SCHEMA_MPP_PAYMENT_INPUT.members["buyerPaysGasFees"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MPP_PAYMENT_INPUT, consumer=_consumer) - if "version" not in kwargs: - kwargs["version"] = "" - if "www_authenticate_headers" not in kwargs: - kwargs["www_authenticate_headers"] = [] - return kwargs - - -@dataclass -class PaymentInputCryptoX402: - """Input for a crypto X402 payment.""" - - value: CryptoX402PaymentInput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PAYMENT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PAYMENT_INPUT.members["cryptoX402"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=CryptoX402PaymentInput.deserialize(deserializer)) - - -@dataclass -class PaymentInputMpp: - """ - Contains the payment challenge from a 402 Payment Required response. - Forward the raw `WWW-Authenticate: Payment` header value verbatim. In - response, you receive a payment credential that satisfies the challenge. - Provide exactly one challenge per request. - """ - - value: MppPaymentInput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PAYMENT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PAYMENT_INPUT.members["mpp"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=MppPaymentInput.deserialize(deserializer)) - - -@dataclass -class PaymentInputUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -PaymentInput = Union[PaymentInputCryptoX402 | PaymentInputMpp | PaymentInputUnknown] -"""The payment input details, which vary by payment type.""" - - -class _PaymentInputDeserializer: - _result: PaymentInput | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> PaymentInput: - self._result = None - deserializer.read_struct(_SCHEMA_PAYMENT_INPUT, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(PaymentInputCryptoX402.deserialize(de)) - - case 1: - self._set_result(PaymentInputMpp.deserialize(de)) - - case _: - self._set_result(PaymentInputUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: PaymentInput) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class PaymentType(UnknownEnumMixin, StrEnum): - """Payment type enum.""" - - CRYPTO_X402 = "CRYPTO_X402" - MPP = "MPP" - - -@dataclass(kw_only=True) -class ProcessPaymentInput: - """Request structure for processing a payment.""" - - user_id: str | None = None - """The user ID associated with this payment.""" - - agent_name: str | None = None - """The agent name associated with this request, used for observability.""" - - payment_manager_arn: str | None = None - """The ARN of the payment manager.""" - - payment_session_id: str | None = None - """The ID of the payment session.""" - - payment_instrument_id: str | None = None - """The ID of the payment instrument to use.""" - - payment_type: str | None = None - """The type of payment to process.""" - - payment_input: PaymentInput | None = None - """The payment input details specific to the payment type.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier that you provide to ensure the - idempotency of the request. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PROCESS_PAYMENT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.user_id is not None: - serializer.write_string( - _SCHEMA_PROCESS_PAYMENT_INPUT.members["userId"], self.user_id - ) - - if self.agent_name is not None: - serializer.write_string( - _SCHEMA_PROCESS_PAYMENT_INPUT.members["agentName"], self.agent_name - ) - - if self.payment_manager_arn is not None: - serializer.write_string( - _SCHEMA_PROCESS_PAYMENT_INPUT.members["paymentManagerArn"], - self.payment_manager_arn, - ) - - if self.payment_session_id is not None: - serializer.write_string( - _SCHEMA_PROCESS_PAYMENT_INPUT.members["paymentSessionId"], - self.payment_session_id, - ) - - if self.payment_instrument_id is not None: - serializer.write_string( - _SCHEMA_PROCESS_PAYMENT_INPUT.members["paymentInstrumentId"], - self.payment_instrument_id, - ) - - if self.payment_type is not None: - serializer.write_string( - _SCHEMA_PROCESS_PAYMENT_INPUT.members["paymentType"], self.payment_type - ) - - if self.payment_input is not None: - serializer.write_struct( - _SCHEMA_PROCESS_PAYMENT_INPUT.members["paymentInput"], - self.payment_input, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_PROCESS_PAYMENT_INPUT.members["clientToken"], self.client_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["user_id"] = de.read_string( - _SCHEMA_PROCESS_PAYMENT_INPUT.members["userId"] - ) - - case 1: - kwargs["agent_name"] = de.read_string( - _SCHEMA_PROCESS_PAYMENT_INPUT.members["agentName"] - ) - - case 2: - kwargs["payment_manager_arn"] = de.read_string( - _SCHEMA_PROCESS_PAYMENT_INPUT.members["paymentManagerArn"] - ) - - case 3: - kwargs["payment_session_id"] = de.read_string( - _SCHEMA_PROCESS_PAYMENT_INPUT.members["paymentSessionId"] - ) - - case 4: - kwargs["payment_instrument_id"] = de.read_string( - _SCHEMA_PROCESS_PAYMENT_INPUT.members["paymentInstrumentId"] - ) - - case 5: - kwargs["payment_type"] = PaymentType( - de.read_string( - _SCHEMA_PROCESS_PAYMENT_INPUT.members["paymentType"] - ) - ) - - case 6: - kwargs["payment_input"] = _PaymentInputDeserializer().deserialize( - de - ) - - case 7: - kwargs["client_token"] = de.read_string( - _SCHEMA_PROCESS_PAYMENT_INPUT.members["clientToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PROCESS_PAYMENT_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CryptoX402PaymentOutput: - """The output from a crypto X402 payment.""" - - version: str - """The version of the X402 protocol.""" - - payload: Document = field(repr=False) - """The X402 payment response payload.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CRYPTO_X402_PAYMENT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CRYPTO_X402_PAYMENT_OUTPUT.members["version"], self.version - ) - serializer.write_document( - _SCHEMA_CRYPTO_X402_PAYMENT_OUTPUT.members["payload"], self.payload - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["version"] = de.read_string( - _SCHEMA_CRYPTO_X402_PAYMENT_OUTPUT.members["version"] - ) - - case 1: - kwargs["payload"] = de.read_document( - _SCHEMA_CRYPTO_X402_PAYMENT_OUTPUT.members["payload"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CRYPTO_X402_PAYMENT_OUTPUT, consumer=_consumer) - if "version" not in kwargs: - kwargs["version"] = "" - if "payload" not in kwargs: - kwargs["payload"] = Document(None) - return kwargs - - -@dataclass(kw_only=True) -class MppPaymentOutput: - """Contains the payment credential, ready to retry the request.""" - - version: str - """The MPP protocol version, for example \"1\" or \"2\".""" - - selected_payment_id: str - """ - The id of the challenge that was paid, echoed from the input challenge - so you can correlate the result without decoding the credential. - """ - - payment_credential: str = field(repr=False) - """ - Ready-to-send value for the `Authorization` header, in the form - \"Payment \". Attach this header and retry the - original request. To inspect the full credential, base64url-decode the - token. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MPP_PAYMENT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MPP_PAYMENT_OUTPUT.members["version"], self.version - ) - serializer.write_string( - _SCHEMA_MPP_PAYMENT_OUTPUT.members["selectedPaymentId"], - self.selected_payment_id, - ) - serializer.write_string( - _SCHEMA_MPP_PAYMENT_OUTPUT.members["paymentCredential"], - self.payment_credential, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["version"] = de.read_string( - _SCHEMA_MPP_PAYMENT_OUTPUT.members["version"] - ) - - case 1: - kwargs["selected_payment_id"] = de.read_string( - _SCHEMA_MPP_PAYMENT_OUTPUT.members["selectedPaymentId"] - ) - - case 2: - kwargs["payment_credential"] = de.read_string( - _SCHEMA_MPP_PAYMENT_OUTPUT.members["paymentCredential"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MPP_PAYMENT_OUTPUT, consumer=_consumer) - if "version" not in kwargs: - kwargs["version"] = "" - if "selected_payment_id" not in kwargs: - kwargs["selected_payment_id"] = "" - if "payment_credential" not in kwargs: - kwargs["payment_credential"] = "" - return kwargs - - -@dataclass -class PaymentOutputCryptoX402: - """Output from a crypto X402 payment.""" - - value: CryptoX402PaymentOutput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PAYMENT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_PAYMENT_OUTPUT.members["cryptoX402"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=CryptoX402PaymentOutput.deserialize(deserializer)) - - -@dataclass -class PaymentOutputMpp: - """Contains the payment credential, ready to retry the request.""" - - value: MppPaymentOutput - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PAYMENT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PAYMENT_OUTPUT.members["mpp"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=MppPaymentOutput.deserialize(deserializer)) - - -@dataclass -class PaymentOutputUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -PaymentOutput = Union[PaymentOutputCryptoX402 | PaymentOutputMpp | PaymentOutputUnknown] -"""The payment output details, which vary by payment type.""" - - -class _PaymentOutputDeserializer: - _result: PaymentOutput | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> PaymentOutput: - self._result = None - deserializer.read_struct(_SCHEMA_PAYMENT_OUTPUT, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(PaymentOutputCryptoX402.deserialize(de)) - - case 1: - self._set_result(PaymentOutputMpp.deserialize(de)) - - case _: - self._set_result(PaymentOutputUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: PaymentOutput) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class PaymentStatus(UnknownEnumMixin, StrEnum): - """Transaction status enum.""" - - PROOF_GENERATED = "PROOF_GENERATED" - - -@dataclass(kw_only=True) -class ProcessPaymentOutput: - """Response structure for processing a payment.""" - - process_payment_id: str - """The unique identifier of the processed payment.""" - - payment_manager_arn: str - """The ARN of the payment manager.""" - - payment_session_id: str - """The ID of the payment session used.""" - - payment_instrument_id: str - """The ID of the payment instrument used.""" - - payment_type: str - """The type of payment processed.""" - - status: str - """The status of the payment.""" - - payment_output: PaymentOutput - """The payment output details specific to the payment type.""" - - created_at: datetime - """The timestamp when the payment was created.""" - - updated_at: datetime - """The timestamp when the payment was last updated.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PROCESS_PAYMENT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_PROCESS_PAYMENT_OUTPUT.members["processPaymentId"], - self.process_payment_id, - ) - serializer.write_string( - _SCHEMA_PROCESS_PAYMENT_OUTPUT.members["paymentManagerArn"], - self.payment_manager_arn, - ) - serializer.write_string( - _SCHEMA_PROCESS_PAYMENT_OUTPUT.members["paymentSessionId"], - self.payment_session_id, - ) - serializer.write_string( - _SCHEMA_PROCESS_PAYMENT_OUTPUT.members["paymentInstrumentId"], - self.payment_instrument_id, - ) - serializer.write_string( - _SCHEMA_PROCESS_PAYMENT_OUTPUT.members["paymentType"], self.payment_type - ) - serializer.write_string( - _SCHEMA_PROCESS_PAYMENT_OUTPUT.members["status"], self.status - ) - serializer.write_struct( - _SCHEMA_PROCESS_PAYMENT_OUTPUT.members["paymentOutput"], self.payment_output - ) - serializer.write_timestamp( - _SCHEMA_PROCESS_PAYMENT_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_PROCESS_PAYMENT_OUTPUT.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["process_payment_id"] = de.read_string( - _SCHEMA_PROCESS_PAYMENT_OUTPUT.members["processPaymentId"] - ) - - case 1: - kwargs["payment_manager_arn"] = de.read_string( - _SCHEMA_PROCESS_PAYMENT_OUTPUT.members["paymentManagerArn"] - ) - - case 2: - kwargs["payment_session_id"] = de.read_string( - _SCHEMA_PROCESS_PAYMENT_OUTPUT.members["paymentSessionId"] - ) - - case 3: - kwargs["payment_instrument_id"] = de.read_string( - _SCHEMA_PROCESS_PAYMENT_OUTPUT.members["paymentInstrumentId"] - ) - - case 4: - kwargs["payment_type"] = PaymentType( - de.read_string( - _SCHEMA_PROCESS_PAYMENT_OUTPUT.members["paymentType"] - ) - ) - - case 5: - kwargs["status"] = PaymentStatus( - de.read_string(_SCHEMA_PROCESS_PAYMENT_OUTPUT.members["status"]) - ) - - case 6: - kwargs["payment_output"] = _PaymentOutputDeserializer().deserialize( - de - ) - - case 7: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_PROCESS_PAYMENT_OUTPUT.members["createdAt"] - ) - - case 8: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_PROCESS_PAYMENT_OUTPUT.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PROCESS_PAYMENT_OUTPUT, consumer=_consumer) - if "process_payment_id" not in kwargs: - kwargs["process_payment_id"] = "" - if "payment_manager_arn" not in kwargs: - kwargs["payment_manager_arn"] = "" - if "payment_session_id" not in kwargs: - kwargs["payment_session_id"] = "" - if "payment_instrument_id" not in kwargs: - kwargs["payment_instrument_id"] = "" - if "payment_type" not in kwargs: - kwargs["payment_type"] = PaymentType._corrected("") - if "status" not in kwargs: - kwargs["status"] = PaymentStatus._corrected("") - if "payment_output" not in kwargs: - kwargs["payment_output"] = PaymentOutputUnknown(tag="") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -PROCESS_PAYMENT = APIOperation( - input=ProcessPaymentInput, - output=ProcessPaymentOutput, - schema=_SCHEMA_PROCESS_PAYMENT, - input_schema=_SCHEMA_PROCESS_PAYMENT_INPUT, - output_schema=_SCHEMA_PROCESS_PAYMENT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockagentcore#SubscriptionRequiredException" - ): SubscriptionRequiredException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_SUBSCRIPTION_REQUIRED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, +SEARCH_REGISTRY_RECORDS: APIOperation[ + SearchRegistryRecordsInput, SearchRegistryRecordsOutput +] = APIOperation( + static_schema=_SCHEMA_SEARCH_REGISTRY_RECORDS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockagentcore#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockagentcore#InternalServerException"), + ShapeID("com.amazonaws.bedrockagentcore#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockagentcore#ThrottlingException"), + ShapeID("com.amazonaws.bedrockagentcore#UnauthorizedException"), + ShapeID("com.amazonaws.bedrockagentcore#ValidationException"), ], -) - - -def _serialize_registry_id_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_registry_id_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class SearchRegistryRecordsInput: - """Dataclass for SearchRegistryRecordsInput structure.""" - - search_query: str | None = None - """The search query to find matching registry records.""" - - registry_ids: list[str] | None = None - """ - The list of registry identifiers to search within. Currently, you can - specify exactly one registry identifier. You can provide either the full - Amazon Web Services Resource Name (ARN) or the 12-character alphanumeric - registry ID. - """ - - max_results: int = 10 - """ - The maximum number of records to return in a single call. Valid values - are 1 through 20. The default value is 10. - """ - - filters: Document | None = None - """ - A metadata filter expression to narrow search results. Uses structured - JSON operators including field-level operators (`$eq`, `$ne`, `$in`) and - logical operators (`$and`, `$or`) on filterable fields (`name`, - `descriptorType`, `version`). For example, to filter by descriptor type: - `{"descriptorType": {"$eq": "MCP"}}`. To combine filters: - `{"$and": [{"descriptorType": {"$eq": "MCP"}}, {"name": {"$eq": "my-tool"}}]}`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SEARCH_REGISTRY_RECORDS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.search_query is not None: - serializer.write_string( - _SCHEMA_SEARCH_REGISTRY_RECORDS_INPUT.members["searchQuery"], - self.search_query, - ) - - if self.registry_ids is not None: - _serialize_registry_id_list( - serializer, - _SCHEMA_SEARCH_REGISTRY_RECORDS_INPUT.members["registryIds"], - self.registry_ids, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_SEARCH_REGISTRY_RECORDS_INPUT.members["maxResults"], - self.max_results, - ) - - if self.filters is not None: - serializer.write_document( - _SCHEMA_SEARCH_REGISTRY_RECORDS_INPUT.members["filters"], self.filters - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["search_query"] = de.read_string( - _SCHEMA_SEARCH_REGISTRY_RECORDS_INPUT.members["searchQuery"] - ) - - case 1: - kwargs["registry_ids"] = _deserialize_registry_id_list( - de, _SCHEMA_SEARCH_REGISTRY_RECORDS_INPUT.members["registryIds"] - ) - - case 2: - kwargs["max_results"] = de.read_integer( - _SCHEMA_SEARCH_REGISTRY_RECORDS_INPUT.members["maxResults"] - ) - - case 3: - kwargs["filters"] = de.read_document( - _SCHEMA_SEARCH_REGISTRY_RECORDS_INPUT.members["filters"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SEARCH_REGISTRY_RECORDS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CustomDescriptor: - """A custom descriptor configuration for a registry record.""" - - inline_content: str | None = None - """The inline content of the custom descriptor.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOM_DESCRIPTOR, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.inline_content is not None: - serializer.write_string( - _SCHEMA_CUSTOM_DESCRIPTOR.members["inlineContent"], self.inline_content - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["inline_content"] = de.read_string( - _SCHEMA_CUSTOM_DESCRIPTOR.members["inlineContent"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CUSTOM_DESCRIPTOR, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ServerDefinition: - """ - The MCP server definition with a schema version and inline content. The - `schemaVersion` identifies the version of the MCP server configuration - schema. - """ - - schema_version: str | None = None - """ - The schema version of the MCP server configuration. The schema version - identifies the format of the server definition content. - """ - - inline_content: str | None = None - """The inline content of the server definition.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SERVER_DEFINITION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.schema_version is not None: - serializer.write_string( - _SCHEMA_SERVER_DEFINITION.members["schemaVersion"], self.schema_version - ) - - if self.inline_content is not None: - serializer.write_string( - _SCHEMA_SERVER_DEFINITION.members["inlineContent"], self.inline_content - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["schema_version"] = de.read_string( - _SCHEMA_SERVER_DEFINITION.members["schemaVersion"] - ) - - case 1: - kwargs["inline_content"] = de.read_string( - _SCHEMA_SERVER_DEFINITION.members["inlineContent"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SERVER_DEFINITION, consumer=_consumer) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls() - - -@dataclass(kw_only=True) -class ToolsDefinition: - """ - The MCP tools definition with a protocol version and inline content. The - `protocolVersion` identifies the MCP protocol version that the tools - conform to. This differs from `schemaVersion` in the server definition, - which identifies the server configuration schema format. - """ - - protocol_version: str | None = None - """ - The MCP protocol version that the tools conform to. This differs from - the `schemaVersion` field in the server definition, which identifies the - server configuration schema format. - """ - - inline_content: str | None = None - """The inline content of the tools definition.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOLS_DEFINITION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.protocol_version is not None: - serializer.write_string( - _SCHEMA_TOOLS_DEFINITION.members["protocolVersion"], - self.protocol_version, - ) - - if self.inline_content is not None: - serializer.write_string( - _SCHEMA_TOOLS_DEFINITION.members["inlineContent"], self.inline_content - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["protocol_version"] = de.read_string( - _SCHEMA_TOOLS_DEFINITION.members["protocolVersion"] - ) - - case 1: - kwargs["inline_content"] = de.read_string( - _SCHEMA_TOOLS_DEFINITION.members["inlineContent"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TOOLS_DEFINITION, consumer=_consumer) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls() - - -@dataclass(kw_only=True) -class McpDescriptor: - """ - The MCP (Model Context Protocol) descriptor configuration for a registry - record. Contains the server definition and tools definition. - """ - - server: ServerDefinition - """The MCP server definition that describes the server configuration.""" - - tools: ToolsDefinition - """The MCP tools definition that describes the available tools.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MCP_DESCRIPTOR, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MCP_DESCRIPTOR.members["server"], self.server) - serializer.write_struct(_SCHEMA_MCP_DESCRIPTOR.members["tools"], self.tools) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["server"] = ServerDefinition.deserialize(de) - - case 1: - kwargs["tools"] = ToolsDefinition.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MCP_DESCRIPTOR, consumer=_consumer) - if "server" not in kwargs: - kwargs["server"] = ServerDefinition._smithy_default() - if "tools" not in kwargs: - kwargs["tools"] = ToolsDefinition._smithy_default() - return kwargs - - -@dataclass(kw_only=True) -class Descriptors: - """ - Contains the descriptor configuration for a registry record. Only the - field that matches the record's `descriptorType` is populated. - """ - - mcp: McpDescriptor | None = None - """ - The MCP (Model Context Protocol) descriptor configuration. Populated - when the record's `descriptorType` is `MCP`. - """ - - a2a: A2aDescriptor | None = None - """ - The A2A (Agent-to-Agent) descriptor configuration. Populated when the - record's `descriptorType` is `A2A`. - """ - - custom: CustomDescriptor | None = None - """ - The custom descriptor configuration. Populated when the record's - `descriptorType` is `CUSTOM`. - """ - - agent_skills: AgentSkillsDescriptor | None = None - """ - The agent skills descriptor configuration. Populated when the record's - `descriptorType` is `AGENT_SKILLS`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DESCRIPTORS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.mcp is not None: - serializer.write_struct(_SCHEMA_DESCRIPTORS.members["mcp"], self.mcp) - - if self.a2a is not None: - serializer.write_struct(_SCHEMA_DESCRIPTORS.members["a2a"], self.a2a) - - if self.custom is not None: - serializer.write_struct(_SCHEMA_DESCRIPTORS.members["custom"], self.custom) - - if self.agent_skills is not None: - serializer.write_struct( - _SCHEMA_DESCRIPTORS.members["agentSkills"], self.agent_skills - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["mcp"] = McpDescriptor.deserialize(de) - - case 1: - kwargs["a2a"] = A2aDescriptor.deserialize(de) - - case 2: - kwargs["custom"] = CustomDescriptor.deserialize(de) - - case 3: - kwargs["agent_skills"] = AgentSkillsDescriptor.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DESCRIPTORS, consumer=_consumer) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls() - - -class DescriptorType(UnknownEnumMixin, StrEnum): - """The type of descriptor associated with a registry record.""" - - MCP = "MCP" - A2_A = "A2A" - CUSTOM = "CUSTOM" - AGENT_SKILLS = "AGENT_SKILLS" - - -class RegistryRecordStatus(UnknownEnumMixin, StrEnum): - """The status of a registry record in its lifecycle.""" - - DRAFT = "DRAFT" - PENDING_APPROVAL = "PENDING_APPROVAL" - APPROVED = "APPROVED" - REJECTED = "REJECTED" - DEPRECATED = "DEPRECATED" - - -@dataclass(kw_only=True) -class RegistryRecordSummary: - """Summary information about a registry record.""" - - registry_arn: str - """ - The Amazon Resource Name (ARN) of the registry that this record belongs - to. - """ - - record_arn: str - """The Amazon Resource Name (ARN) of the registry record.""" - - record_id: str - """The unique identifier of the registry record.""" - - name: str - """The name of the registry record.""" - - descriptor_type: str - """The type of descriptor associated with this registry record.""" - - descriptors: Descriptors - """The descriptor configurations for this registry record.""" - - version: str - """The version of the registry record.""" - - status: str - """The current status of the registry record.""" - - created_at: datetime - """The date and time when the registry record was created.""" - - updated_at: datetime - """The date and time when the registry record was last updated.""" - - description: str | None = field(repr=False, default=None) - """A description of the registry record.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REGISTRY_RECORD_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_REGISTRY_RECORD_SUMMARY.members["registryArn"], self.registry_arn - ) - serializer.write_string( - _SCHEMA_REGISTRY_RECORD_SUMMARY.members["recordArn"], self.record_arn - ) - serializer.write_string( - _SCHEMA_REGISTRY_RECORD_SUMMARY.members["recordId"], self.record_id - ) - serializer.write_string( - _SCHEMA_REGISTRY_RECORD_SUMMARY.members["name"], self.name - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_REGISTRY_RECORD_SUMMARY.members["description"], self.description - ) - - serializer.write_string( - _SCHEMA_REGISTRY_RECORD_SUMMARY.members["descriptorType"], - self.descriptor_type, - ) - serializer.write_struct( - _SCHEMA_REGISTRY_RECORD_SUMMARY.members["descriptors"], self.descriptors - ) - serializer.write_string( - _SCHEMA_REGISTRY_RECORD_SUMMARY.members["version"], self.version - ) - serializer.write_string( - _SCHEMA_REGISTRY_RECORD_SUMMARY.members["status"], self.status - ) - serializer.write_timestamp( - _SCHEMA_REGISTRY_RECORD_SUMMARY.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_REGISTRY_RECORD_SUMMARY.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["registry_arn"] = de.read_string( - _SCHEMA_REGISTRY_RECORD_SUMMARY.members["registryArn"] - ) - - case 1: - kwargs["record_arn"] = de.read_string( - _SCHEMA_REGISTRY_RECORD_SUMMARY.members["recordArn"] - ) - - case 2: - kwargs["record_id"] = de.read_string( - _SCHEMA_REGISTRY_RECORD_SUMMARY.members["recordId"] - ) - - case 3: - kwargs["name"] = de.read_string( - _SCHEMA_REGISTRY_RECORD_SUMMARY.members["name"] - ) - - case 4: - kwargs["description"] = de.read_string( - _SCHEMA_REGISTRY_RECORD_SUMMARY.members["description"] - ) - - case 5: - kwargs["descriptor_type"] = DescriptorType( - de.read_string( - _SCHEMA_REGISTRY_RECORD_SUMMARY.members["descriptorType"] - ) - ) - - case 6: - kwargs["descriptors"] = Descriptors.deserialize(de) - - case 7: - kwargs["version"] = de.read_string( - _SCHEMA_REGISTRY_RECORD_SUMMARY.members["version"] - ) - - case 8: - kwargs["status"] = RegistryRecordStatus( - de.read_string( - _SCHEMA_REGISTRY_RECORD_SUMMARY.members["status"] - ) - ) - - case 9: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_REGISTRY_RECORD_SUMMARY.members["createdAt"] - ) - - case 10: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_REGISTRY_RECORD_SUMMARY.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_REGISTRY_RECORD_SUMMARY, consumer=_consumer) - if "registry_arn" not in kwargs: - kwargs["registry_arn"] = "" - if "record_arn" not in kwargs: - kwargs["record_arn"] = "" - if "record_id" not in kwargs: - kwargs["record_id"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "descriptor_type" not in kwargs: - kwargs["descriptor_type"] = DescriptorType._corrected("") - if "descriptors" not in kwargs: - kwargs["descriptors"] = Descriptors._smithy_default() - if "version" not in kwargs: - kwargs["version"] = "" - if "status" not in kwargs: - kwargs["status"] = RegistryRecordStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_registry_record_summary_list( - serializer: ShapeSerializer, schema: Schema, value: list[RegistryRecordSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_registry_record_summary_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[RegistryRecordSummary]: - result: list[RegistryRecordSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(RegistryRecordSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class SearchRegistryRecordsOutput: - """Dataclass for SearchRegistryRecordsOutput structure.""" - - registry_records: list[RegistryRecordSummary] - """ - The list of registry records that match the search query, ordered by - relevance. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SEARCH_REGISTRY_RECORDS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_registry_record_summary_list( - serializer, - _SCHEMA_SEARCH_REGISTRY_RECORDS_OUTPUT.members["registryRecords"], - self.registry_records, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["registry_records"] = ( - _deserialize_registry_record_summary_list( - de, - _SCHEMA_SEARCH_REGISTRY_RECORDS_OUTPUT.members[ - "registryRecords" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SEARCH_REGISTRY_RECORDS_OUTPUT, consumer=_consumer - ) - if "registry_records" not in kwargs: - kwargs["registry_records"] = [] - return kwargs - - -SEARCH_REGISTRY_RECORDS = APIOperation( - input=SearchRegistryRecordsInput, - output=SearchRegistryRecordsOutput, - schema=_SCHEMA_SEARCH_REGISTRY_RECORDS, - input_schema=_SCHEMA_SEARCH_REGISTRY_RECORDS_INPUT, - output_schema=_SCHEMA_SEARCH_REGISTRY_RECORDS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockagentcore#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockagentcore#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockagentcore#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockagentcore#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockagentcore#UnauthorizedException" - ): UnauthorizedException, - ShapeID( - "com.amazonaws.bedrockagentcore#ValidationException" - ): ValidationException, - } - ), effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_UNAUTHORIZED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], ) diff --git a/clients/aws-sdk-bedrock-agentcore/src/aws_sdk_bedrock_agentcore/models.pyi b/clients/aws-sdk-bedrock-agentcore/src/aws_sdk_bedrock_agentcore/models.pyi new file mode 100644 index 00000000..00dbdd06 --- /dev/null +++ b/clients/aws-sdk-bedrock-agentcore/src/aws_sdk_bedrock_agentcore/models.pyi @@ -0,0 +1,9419 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. + +from dataclasses import dataclass +from datetime import datetime +from enum import StrEnum +from typing import Self, Union + +from smithy_core.aio.interfaces import StreamingBlob +from smithy_core.deserializers import ShapeDeserializer +from smithy_core.documents import Document +from smithy_core.exceptions import ModeledError +from smithy_core.response import ResponseMetadata +from smithy_core.schemas import APIOperation +from smithy_core.serializers import ShapeSerializer +from smithy_core.types import UnknownEnumMixin + +class _SerdeShape: + def serialize(self, serializer: ShapeSerializer) -> None: ... + def serialize_members(self, serializer: ShapeSerializer) -> None: ... + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: ... + +class ServiceError(ModeledError): + """ + Base error for all errors in the service. + + Some exceptions do not extend from this class, including + synthetic, implicit, and shared exception types. + """ + +@dataclass(kw_only=True) +class A2aDescriptor(_SerdeShape): + """The A2A (Agent-to-Agent) descriptor configuration for a registry record.""" + + agent_card: AgentCardDefinition + """ + The agent card definition that describes the agent's capabilities and + interface. + """ + +@dataclass +class ABTestEvaluationConfigOnlineEvaluationConfigArn(_SerdeShape): + """ + The Amazon Resource Name (ARN) of a single online evaluation + configuration to use for both variants. + """ + + value: str + +@dataclass +class ABTestEvaluationConfigPerVariantOnlineEvaluationConfig(_SerdeShape): + """ + Per-variant online evaluation configurations, allowing different + evaluation settings for each variant. + """ + + value: list[PerVariantOnlineEvaluationConfig] + +@dataclass +class ABTestEvaluationConfigUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ABTestEvaluationConfig = Union[ + ABTestEvaluationConfigOnlineEvaluationConfigArn + | ABTestEvaluationConfigPerVariantOnlineEvaluationConfig + | ABTestEvaluationConfigUnknown +] +""" +The evaluation configuration for an A/B test, specifying which online +evaluation configurations to use for measuring variant performance. +""" + +class _ABTestEvaluationConfigDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> ABTestEvaluationConfig: ... + +class ABTestExecutionStatus(UnknownEnumMixin, StrEnum): + PAUSED = "PAUSED" + RUNNING = "RUNNING" + STOPPED = "STOPPED" + NOT_STARTED = "NOT_STARTED" + +@dataclass(kw_only=True) +class ABTestResults(_SerdeShape): + """The statistical results of an A/B test.""" + + analysis_timestamp: datetime | None = ... + """The timestamp when the analysis was performed.""" + evaluator_metrics: list[EvaluatorMetric] + """The per-evaluator metrics comparing control and treatment variants.""" + +class ABTestStatus(UnknownEnumMixin, StrEnum): + CREATING = "CREATING" + ACTIVE = "ACTIVE" + CREATE_FAILED = "CREATE_FAILED" + UPDATING = "UPDATING" + UPDATE_FAILED = "UPDATE_FAILED" + DELETING = "DELETING" + DELETE_FAILED = "DELETE_FAILED" + FAILED = "FAILED" + +@dataclass(kw_only=True) +class ABTestSummary(_SerdeShape): + """Summary information about an A/B test.""" + + ab_test_id: str + """The unique identifier of the A/B test.""" + ab_test_arn: str + """The Amazon Resource Name (ARN) of the A/B test.""" + name: str + """The name of the A/B test.""" + status: str + """The current status of the A/B test.""" + execution_status: str + """The execution status of the A/B test.""" + description: str | None = ... + """The description of the A/B test.""" + gateway_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the gateway used for traffic + splitting. + """ + created_at: datetime + """The timestamp when the A/B test was created.""" + updated_at: datetime + """The timestamp when the A/B test was last updated.""" + +@dataclass(kw_only=True) +class AccessDeniedException(ServiceError, _SerdeShape): + """ + The exception that occurs when you do not have sufficient permissions to + perform an action. Verify that your IAM policy includes the necessary + permissions for the operation you are trying to perform. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ActorSummary(_SerdeShape): + """ + Contains summary information about an actor in an AgentCore Memory + resource. + """ + + actor_id: str + """The unique identifier of the actor.""" + +@dataclass(kw_only=True) +class AffectedSession(_SerdeShape): + """ + A session affected by a detected failure pattern, including root cause + details. + """ + + session_id: str + """The unique identifier of the affected session.""" + explanation: str + """An explanation of how the failure manifested in this session.""" + fix_type: str + """The type of fix recommended for this failure.""" + recommendation: str + """The specific fix recommendation for this session.""" + failure_spans: list[FailureSpanDetail] + """The list of spans where failures were detected in this session.""" + +@dataclass(kw_only=True) +class AgentCardDefinition(_SerdeShape): + """ + The agent card definition for A2A descriptors, including the schema + version and inline content that describes the agent's capabilities. + """ + + schema_version: str | None = ... + """The schema version of the agent card definition.""" + inline_content: str | None = ... + """The inline content of the agent card definition.""" + +@dataclass(kw_only=True) +class AgentSkillsDescriptor(_SerdeShape): + """The agent skills descriptor configuration for a registry record.""" + + skill_md: SkillMdDefinition + """The skill description in markdown format.""" + skill_definition: SkillDefinition | None = ... + """The structured skill definition with a schema version and content.""" + +@dataclass +class AgentTracesConfigSessionSpans(_SerdeShape): + """Agent traces provided as inline session spans in OpenTelemetry format.""" + + value: list[Document] + +@dataclass +class AgentTracesConfigCloudwatchLogs(_SerdeShape): + """Agent traces read from CloudWatch Logs.""" + + value: CloudWatchLogsTraceConfig + +@dataclass +class AgentTracesConfigBatchEvaluation(_SerdeShape): + """Use a completed batch evaluation as the source of agent traces.""" + + value: BatchEvaluationTraceConfig + +@dataclass +class AgentTracesConfigOnlineEvaluation(_SerdeShape): + """ + Agent traces from an online evaluation configuration over a specified + time range. + """ + + value: OnlineEvaluationTraceConfig + +@dataclass +class AgentTracesConfigUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +AgentTracesConfig = Union[ + AgentTracesConfigSessionSpans + | AgentTracesConfigCloudwatchLogs + | AgentTracesConfigBatchEvaluation + | AgentTracesConfigOnlineEvaluation + | AgentTracesConfigUnknown +] +""" +The configuration specifying where to read agent traces from for +recommendation analysis. +""" + +class _AgentTracesConfigDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> AgentTracesConfig: ... + +@dataclass(kw_only=True) +class Amount(_SerdeShape): + """Represents a monetary amount with a currency.""" + + value: str + """The numeric value of the amount.""" + currency: str + """The currency code for the amount.""" + +@dataclass(kw_only=True) +class AutomationStream(_SerdeShape): + """ + The configuration for a stream that enables programmatic control of a + browser session in Amazon Bedrock AgentCore. This stream provides a + bidirectional communication channel for sending commands to the browser + and receiving responses, allowing agents to automate web interactions + such as navigation, form filling, and element clicking. + """ + + stream_endpoint: str + """ + The endpoint URL for the automation stream. This URL is used to + establish a WebSocket connection to the stream for sending commands and + receiving responses. + """ + stream_status: str + """ + The current status of the automation stream. This indicates whether the + stream is available for use. Possible values include ACTIVE, CONNECTING, + and DISCONNECTED. + """ + +class AutomationStreamStatus(UnknownEnumMixin, StrEnum): + ENABLED = "ENABLED" + DISABLED = "DISABLED" + +@dataclass(kw_only=True) +class AutomationStreamUpdate(_SerdeShape): + """Contains information about an update to an automation stream.""" + + stream_status: str | None = ... + """The status of the automation stream.""" + +@dataclass(kw_only=True) +class AvailableLimits(_SerdeShape): + """The available spending limits for a payment session.""" + + available_spend_amount: Amount | None = ... + """The remaining available amount that can be spent.""" + updated_at: datetime | None = ... + """The timestamp when the available limits were last updated.""" + +@dataclass(kw_only=True) +class BasicAuth(_SerdeShape): + """ + Configuration for HTTP Basic Authentication using credentials stored in + Amazon Web Services Secrets Manager. The secret must contain a JSON + object with `username` and `password` string fields. Username allows + alphanumeric characters and `@._+=-` symbols (pattern: + `^[a-zA-Z0-9@._+=\\-]+$`). Password allows alphanumeric characters and + `@._+=-!#$%&*` symbols (pattern: `^[a-zA-Z0-9@._+=\\-!#$%&*]+$`). Both + fields have a maximum length of 256 characters. + """ + + secret_arn: str + """ + The Amazon Resource Name (ARN) of the Amazon Web Services Secrets + Manager secret containing proxy credentials. The secret must be a JSON + object with `username` and `password` string fields that meet validation + requirements. The caller must have `secretsmanager:GetSecretValue` + permission for this ARN. Example secret format: + `{"username": "proxy_user", "password": "secure_password"}` + """ + +@dataclass(kw_only=True) +class BatchCreateMemoryRecordsInput(_SerdeShape): + """Dataclass for BatchCreateMemoryRecordsInput structure.""" + + memory_id: str | None = ... + """The unique ID of the memory resource where records will be created.""" + records: list[MemoryRecordCreateInput] | None = ... + """ + A list of memory record creation inputs to be processed in the batch + operation. + """ + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure idempotent processing of + the batch request. + """ + +@dataclass(kw_only=True) +class BatchCreateMemoryRecordsOutput(_SerdeShape): + """Dataclass for BatchCreateMemoryRecordsOutput structure.""" + + successful_records: list[MemoryRecordOutput] + """ + A list of memory records that were successfully created during the batch + operation. + """ + failed_records: list[MemoryRecordOutput] + """ + A list of memory records that failed to be created, including error + details for each failure. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class BatchDeleteMemoryRecordsInput(_SerdeShape): + """Dataclass for BatchDeleteMemoryRecordsInput structure.""" + + memory_id: str | None = ... + """The unique ID of the memory resource where records will be deleted.""" + records: list[MemoryRecordDeleteInput] | None = ... + """ + A list of memory record deletion inputs to be processed in the batch + operation. + """ + +@dataclass(kw_only=True) +class BatchDeleteMemoryRecordsOutput(_SerdeShape): + """Dataclass for BatchDeleteMemoryRecordsOutput structure.""" + + successful_records: list[MemoryRecordOutput] + """ + A list of memory records that were successfully deleted during the batch + operation. + """ + failed_records: list[MemoryRecordOutput] + """ + A list of memory records that failed to be deleted, including error + details for each failure. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class BatchEvaluationStatus(UnknownEnumMixin, StrEnum): + """The lifecycle status of a batch evaluation job.""" + + PENDING = "PENDING" + IN_PROGRESS = "IN_PROGRESS" + COMPLETED = "COMPLETED" + COMPLETED_WITH_ERRORS = "COMPLETED_WITH_ERRORS" + FAILED = "FAILED" + STOPPING = "STOPPING" + STOPPED = "STOPPED" + DELETING = "DELETING" + +@dataclass(kw_only=True) +class BatchEvaluationSummary(_SerdeShape): + """Summary representation for list responses.""" + + batch_evaluation_id: str + """The unique identifier of the batch evaluation.""" + batch_evaluation_arn: str + """The Amazon Resource Name (ARN) of the batch evaluation.""" + batch_evaluation_name: str + """The name of the batch evaluation.""" + status: str + """The current status of the batch evaluation.""" + created_at: datetime + """The timestamp when the batch evaluation was created.""" + description: str | None = ... + """The description of the batch evaluation.""" + evaluators: list[Evaluator] | None = ... + """The list of evaluators applied during the batch evaluation.""" + insights: list[Insight] | None = ... + """The list of insight analyses applied during the batch evaluation.""" + evaluation_results: EvaluationJobResults | None = ... + """The aggregated evaluation results.""" + error_details: list[str] | None = ... + """The error details if the batch evaluation encountered failures.""" + kms_key_arn: str | None = ... + """The ARN of the KMS key used to encrypt evaluation data.""" + updated_at: datetime | None = ... + """The timestamp when the batch evaluation was last updated.""" + +@dataclass(kw_only=True) +class BatchEvaluationTraceConfig(_SerdeShape): + """ + Configuration for using a batch evaluation as the source of agent traces + for recommendations. + """ + + batch_evaluation_arn: str + """The ARN of the completed batch evaluation to use as the trace source.""" + +@dataclass(kw_only=True) +class BatchUpdateMemoryRecordsInput(_SerdeShape): + """Dataclass for BatchUpdateMemoryRecordsInput structure.""" + + memory_id: str | None = ... + """The unique ID of the memory resource where records will be updated.""" + records: list[MemoryRecordUpdateInput] | None = ... + """ + A list of memory record update inputs to be processed in the batch + operation. + """ + +@dataclass(kw_only=True) +class BatchUpdateMemoryRecordsOutput(_SerdeShape): + """Dataclass for BatchUpdateMemoryRecordsOutput structure.""" + + successful_records: list[MemoryRecordOutput] + """ + A list of memory records that were successfully updated during the batch + operation. + """ + failed_records: list[MemoryRecordOutput] + """ + A list of memory records that failed to be updated, including error + details for each failure. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class BlockchainChainId(UnknownEnumMixin, StrEnum): + """ + Supported blockchain chain identifiers for balance queries. Each value + maps to a specific chain supported by the underlying providers (Privy, + Coinbase). + """ + + BASE = "BASE" + """Base Mainnet (EVM L2)""" + BASE_SEPOLIA = "BASE_SEPOLIA" + """Base Sepolia testnet (EVM L2)""" + ETHEREUM = "ETHEREUM" + """Ethereum Mainnet (EVM L1)""" + SOLANA = "SOLANA" + """Solana Mainnet""" + SOLANA_DEVNET = "SOLANA_DEVNET" + """Solana Devnet testnet""" + +@dataclass(kw_only=True) +class Branch(_SerdeShape): + """ + Contains information about a branch in an AgentCore Memory resource. + Branches allow for organizing events into different conversation threads + or paths. + """ + + root_event_id: str | None = ... + """The identifier of the root event for this branch.""" + name: str + """The name of the branch.""" + +@dataclass(kw_only=True) +class BranchFilter(_SerdeShape): + """Contains filter criteria for branches when listing events.""" + + name: str + """The name of the branch to filter by.""" + include_parent_branches: bool = ... + """ + Specifies whether to include parent branches in the results. Set to true + to include parent branches, or false to exclude them. + """ + +@dataclass +class BrowserActionMouseClick(_SerdeShape): + """Click at the specified coordinates.""" + + value: MouseClickArguments + +@dataclass +class BrowserActionMouseMove(_SerdeShape): + """Move the cursor to the specified coordinates.""" + + value: MouseMoveArguments + +@dataclass +class BrowserActionMouseDrag(_SerdeShape): + """Drag from a start position to an end position.""" + + value: MouseDragArguments + +@dataclass +class BrowserActionMouseScroll(_SerdeShape): + """Scroll at the specified position.""" + + value: MouseScrollArguments + +@dataclass +class BrowserActionKeyType(_SerdeShape): + """Type a string of text.""" + + value: KeyTypeArguments + +@dataclass +class BrowserActionKeyPress(_SerdeShape): + """Press a key one or more times.""" + + value: KeyPressArguments + +@dataclass +class BrowserActionKeyShortcut(_SerdeShape): + """Press a key combination.""" + + value: KeyShortcutArguments + +@dataclass +class BrowserActionScreenshot(_SerdeShape): + """Capture a full-screen screenshot.""" + + value: ScreenshotArguments + +@dataclass +class BrowserActionUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +BrowserAction = Union[ + BrowserActionMouseClick + | BrowserActionMouseMove + | BrowserActionMouseDrag + | BrowserActionMouseScroll + | BrowserActionKeyType + | BrowserActionKeyPress + | BrowserActionKeyShortcut + | BrowserActionScreenshot + | BrowserActionUnknown +] +""" +The browser action to perform. Exactly one member must be set per +request. +""" + +class _BrowserActionDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> BrowserAction: ... + +@dataclass +class BrowserActionResultMouseClick(_SerdeShape): + """The result of a mouse click action.""" + + value: MouseClickResult + +@dataclass +class BrowserActionResultMouseMove(_SerdeShape): + """The result of a mouse move action.""" + + value: MouseMoveResult + +@dataclass +class BrowserActionResultMouseDrag(_SerdeShape): + """The result of a mouse drag action.""" + + value: MouseDragResult + +@dataclass +class BrowserActionResultMouseScroll(_SerdeShape): + """The result of a mouse scroll action.""" + + value: MouseScrollResult + +@dataclass +class BrowserActionResultKeyType(_SerdeShape): + """The result of a key type action.""" + + value: KeyTypeResult + +@dataclass +class BrowserActionResultKeyPress(_SerdeShape): + """The result of a key press action.""" + + value: KeyPressResult + +@dataclass +class BrowserActionResultKeyShortcut(_SerdeShape): + """The result of a key shortcut action.""" + + value: KeyShortcutResult + +@dataclass +class BrowserActionResultScreenshot(_SerdeShape): + """The result of a screenshot action.""" + + value: ScreenshotResult + +@dataclass +class BrowserActionResultUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +BrowserActionResult = Union[ + BrowserActionResultMouseClick + | BrowserActionResultMouseMove + | BrowserActionResultMouseDrag + | BrowserActionResultMouseScroll + | BrowserActionResultKeyType + | BrowserActionResultKeyPress + | BrowserActionResultKeyShortcut + | BrowserActionResultScreenshot + | BrowserActionResultUnknown +] +""" +The result of a browser action execution. Exactly one member is set, +matching the action that was performed. +""" + +class _BrowserActionResultDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> BrowserActionResult: ... + +class BrowserActionStatus(UnknownEnumMixin, StrEnum): + """The status of a browser action execution.""" + + SUCCESS = "SUCCESS" + FAILED = "FAILED" + +@dataclass(kw_only=True) +class BrowserEnterprisePolicy(_SerdeShape): + """Browser enterprise policy configuration.""" + + location: ResourceLocation + """The location of the enterprise policy file.""" + type: str | None = ... + """The enterprise policy type. See BrowserEnterprisePolicyType.""" + +class BrowserEnterprisePolicyType(UnknownEnumMixin, StrEnum): + """ + The type of browser enterprise policy. Available values are `MANAGED` + and `RECOMMENDED`. + """ + + MANAGED = "MANAGED" + RECOMMENDED = "RECOMMENDED" + +@dataclass(kw_only=True) +class BrowserExtension(_SerdeShape): + """Browser extension configuration.""" + + location: ResourceLocation + """ + The location where the browser extension files are stored. This + specifies the source from which the extension will be loaded and + installed. + """ + +@dataclass(kw_only=True) +class BrowserProfileConfiguration(_SerdeShape): + """ + The configuration for a browser profile in Amazon Bedrock AgentCore. A + browser profile contains persistent browser data such as cookies and + local storage that can be saved from one browser session and reused in + subsequent sessions. Browser profiles enable continuity for tasks that + require authentication, maintain user preferences, or depend on + previously stored browser state. + """ + + profile_identifier: str + """ + The unique identifier of the browser profile. This identifier is used to + reference the profile when starting new browser sessions or saving + session data to the profile. + """ + +class BrowserSessionStatus(UnknownEnumMixin, StrEnum): + READY = "READY" + TERMINATED = "TERMINATED" + +@dataclass(kw_only=True) +class BrowserSessionStream(_SerdeShape): + """ + The collection of streams associated with a browser session in Amazon + Bedrock AgentCore. These streams provide different ways to interact with + and observe the browser session, including programmatic control and + visual representation of the browser content. + """ + + automation_stream: AutomationStream + """ + The stream that enables programmatic control of the browser. This stream + allows agents to perform actions such as navigating to URLs, clicking + elements, and filling forms. + """ + live_view_stream: LiveViewStream | None = ... + """ + The stream that provides a visual representation of the browser content. + This stream allows agents to observe the current state of the browser, + including rendered web pages and visual elements. + """ + +@dataclass(kw_only=True) +class BrowserSessionSummary(_SerdeShape): + """ + A condensed representation of a browser session in Amazon Bedrock + AgentCore. This structure contains key information about a browser + session, including identifiers, status, and timestamps, without the full + details of the session configuration and streams. + """ + + browser_identifier: str + """ + The unique identifier of the browser associated with the session. This + identifier specifies which browser environment is used for the session. + """ + session_id: str + """ + The unique identifier of the browser session. This identifier is used in + operations that interact with the session. + """ + name: str | None = ... + """ + The name of the browser session. This name helps identify and manage the + session. + """ + status: str + """ + The current status of the browser session. Possible values include + ACTIVE, STOPPING, and STOPPED. + """ + created_at: datetime + """ + The timestamp when the browser session was created. This value is in ISO + 8601 format. + """ + last_updated_at: datetime | None = ... + """ + The timestamp when the browser session was last updated. This value is + in ISO 8601 format. + """ + +class CapacityProviderSessionStatus(UnknownEnumMixin, StrEnum): + PROVISIONING = "Provisioning" + DEPROVISIONING = "Deprovisioning" + ACTIVE = "Active" + DELETING = "Deleting" + DELETED = "Deleted" + STOPPED = "Stopped" + +@dataclass(kw_only=True) +class Certificate(_SerdeShape): + """A certificate to install in the browser or code interpreter session.""" + + location: CertificateLocation + """The location of the certificate.""" + +@dataclass +class CertificateLocationSecretsManager(_SerdeShape): + """The Amazon Web Services Secrets Manager location of the certificate.""" + + value: SecretsManagerLocation + +@dataclass +class CertificateLocationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +CertificateLocation = Union[ + CertificateLocationSecretsManager | CertificateLocationUnknown +] +"""The location from which to retrieve a certificate.""" + +class _CertificateLocationDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> CertificateLocation: ... + +@dataclass(kw_only=True) +class CloudWatchFilterConfig(_SerdeShape): + """ + Filter configuration for narrowing down CloudWatch Logs sessions for + evaluation. + """ + + session_ids: list[str] | None = ... + """ + A list of specific session IDs to evaluate. If specified, only these + sessions are included in the evaluation. + """ + time_range: SessionFilterConfig | None = ... + """The time range filter for selecting sessions to evaluate.""" + session_trace_ids: list[SessionTraceIds] | None = ... + """ + A list of session and trace ID pairs that restrict evaluation to + specific traces within a session. If specified, only the listed traces + are evaluated instead of the entire session. + """ + +@dataclass(kw_only=True) +class CloudWatchLogsFilter(_SerdeShape): + """ + A filter for narrowing down agent traces from CloudWatch Logs based on + key-value comparisons. + """ + + key: str + """The key or field name to filter on within the agent trace data.""" + operator: str + """The comparison operator to use for filtering.""" + value: FilterValue + """The value to compare against using the specified operator.""" + +class CloudWatchLogsFilterOperator(UnknownEnumMixin, StrEnum): + """The comparison operator used to filter CloudWatch Logs entries.""" + + EQUALS = "Equals" + NOT_EQUALS = "NotEquals" + GREATER_THAN = "GreaterThan" + LESS_THAN = "LessThan" + GREATER_THAN_OR_EQUAL = "GreaterThanOrEqual" + LESS_THAN_OR_EQUAL = "LessThanOrEqual" + CONTAINS = "Contains" + NOT_CONTAINS = "NotContains" + +@dataclass(kw_only=True) +class CloudWatchLogsRule(_SerdeShape): + """A rule configuration for filtering agent traces from CloudWatch Logs.""" + + filters: list[CloudWatchLogsFilter] | None = ... + """The list of filters to apply when reading agent traces.""" + +@dataclass(kw_only=True) +class CloudWatchLogsSource(_SerdeShape): + """The configuration for reading agent traces from CloudWatch Logs.""" + + service_names: list[str] + """ + The list of agent service names to filter traces within the specified + log groups. + """ + log_group_names: list[str] = ... + """ + The list of CloudWatch log group names to read agent traces from. + Maximum of 10 log groups. + """ + log_group_name_prefixes: list[str] | None = ... + """ + The list of CloudWatch log group name prefixes to read agent traces + from. Specify this instead of `logGroupNames` to match log groups by + prefix. Maximum of 5 prefixes. Specify either `logGroupNames` or + `logGroupNamePrefixes`, not both. One of the two is required. + """ + filter_config: CloudWatchFilterConfig | None = ... + """Optional filter configuration to narrow down which sessions to evaluate.""" + +@dataclass(kw_only=True) +class CloudWatchLogsTraceConfig(_SerdeShape): + """ + Configuration for reading agent traces from CloudWatch Logs for + recommendation analysis. + """ + + log_group_arns: list[str] + """The list of CloudWatch log group ARNs to read agent traces from.""" + service_names: list[str] + """ + The list of service names to filter traces within the specified log + groups. + """ + start_time: datetime + """The start time of the time range to read traces from.""" + end_time: datetime + """The end time of the time range to read traces from.""" + rule: CloudWatchLogsRule | None = ... + """Optional rule configuration for filtering traces.""" + +@dataclass(kw_only=True) +class CloudWatchOutputConfig(_SerdeShape): + """CloudWatch Logs destination for batch evaluation results.""" + + log_group_name: str = ... + """ + The name of the CloudWatch log group where evaluation results will be + written. This value doesn't apply when `resultDestination` is + `SOURCE_LOG_GROUP`, because results are written back to the trace source + log group. The name can't be under the service-reserved + `/aws/bedrock-agentcore/evaluations/` namespace, apart from the + service-managed default group. + """ + log_stream_name: str = ... + """ + The name of the CloudWatch log stream where evaluation results will be + written. + """ + metrics_namespace: str | None = ... + """ + The CloudWatch metrics namespace where evaluation result metrics are + published. If you omit this value, the service publishes metrics to + `Bedrock-AgentCore/Evaluations`. This value can't begin with `AWS/`. + """ + result_destination: str = ... + """ + The destination where evaluation results are written. Valid values: + + - `DEDICATED_LOG_GROUP` (default) -- Writes results to a dedicated + result log group. + + - `SOURCE_LOG_GROUP` -- Writes results back to the log group that the + agent traces were read from. If you use this value, don't specify + `logGroupName`. + """ + +@dataclass(kw_only=True) +class CodeInterpreterResult(_SerdeShape): + """ + The output produced by executing code in a code interpreter session in + Amazon Bedrock AgentCore. This structure contains the results of code + execution, including textual output, structured data, and error + information. Agents use these results to generate responses that + incorporate computation, data analysis, and visualization. + """ + + content: list[ContentBlock] + """ + The textual content of the execution result. This includes standard + output from the code execution, such as print statements, console + output, and text representations of results. + """ + structured_content: ToolResultStructuredContent | None = ... + """ + The structured content of the execution result. This includes additional + metadata about the execution, such as execution time, memory usage, and + structured representations of output data. The format depends on the + specific code interpreter and execution context. + """ + is_error: bool | None = ... + """ + Indicates whether the result represents an error. If true, the content + contains error messages or exception information. If false, the content + contains successful execution results. + """ + +class CodeInterpreterSessionStatus(UnknownEnumMixin, StrEnum): + READY = "READY" + TERMINATED = "TERMINATED" + +@dataclass(kw_only=True) +class CodeInterpreterSessionSummary(_SerdeShape): + """ + A condensed representation of a code interpreter session in Amazon + Bedrock AgentCore. This structure contains key information about a code + interpreter session, including identifiers, status, and timestamps, + without the full details of the session configuration. + """ + + code_interpreter_identifier: str + """ + The unique identifier of the code interpreter associated with the + session. This identifier specifies which code interpreter environment is + used for the session. + """ + session_id: str + """ + The unique identifier of the code interpreter session. This identifier + is used in operations that interact with the session. + """ + name: str | None = ... + """ + The name of the code interpreter session. This name helps identify and + manage the session. + """ + status: str + """ + The current status of the code interpreter session. Possible values + include ACTIVE, STOPPING, and STOPPED. + """ + created_at: datetime + """ + The timestamp when the code interpreter session was created. This value + is in ISO 8601 format. + """ + last_updated_at: datetime | None = ... + """ + The timestamp when the code interpreter session was last updated. This + value is in ISO 8601 format. + """ + +@dataclass +class CodeInterpreterStreamOutputResult(_SerdeShape): + """ + The output produced by executing code in a code interpreter session in + Amazon Bedrock AgentCore. This structure contains the results of code + execution, including textual output, structured data, and error + information. Agents use these results to generate responses that + incorporate computation, data analysis, and visualization. + """ + + value: CodeInterpreterResult + +@dataclass +class CodeInterpreterStreamOutputAccessDeniedException(_SerdeShape): + """ + The exception that occurs when you do not have sufficient permissions to + perform an action. Verify that your IAM policy includes the necessary + permissions for the operation you are trying to perform. + """ + + value: AccessDeniedException + +@dataclass +class CodeInterpreterStreamOutputConflictException(_SerdeShape): + """ + The exception that occurs when the request conflicts with the current + state of the resource. This can happen when trying to modify a resource + that is currently being modified by another request, or when trying to + create a resource that already exists. + """ + + value: ConflictException + +@dataclass +class CodeInterpreterStreamOutputInternalServerException(_SerdeShape): + """ + The exception that occurs when the service encounters an unexpected + internal error. This is a temporary condition that will resolve itself + with retries. We recommend implementing exponential backoff retry logic + in your application. + """ + + value: InternalServerException + +@dataclass +class CodeInterpreterStreamOutputResourceNotFoundException(_SerdeShape): + """ + The exception that occurs when the specified resource does not exist. + This can happen when using an invalid identifier or when trying to + access a resource that has been deleted. + """ + + value: ResourceNotFoundException + +@dataclass +class CodeInterpreterStreamOutputServiceQuotaExceededException(_SerdeShape): + """ + The exception that occurs when the request would cause a service quota + to be exceeded. Review your service quotas and either reduce your + request rate or request a quota increase. + """ + + value: ServiceQuotaExceededException + +@dataclass +class CodeInterpreterStreamOutputThrottlingException(_SerdeShape): + """ + The exception that occurs when the request was denied due to request + throttling. This happens when you exceed the allowed request rate for an + operation. Reduce the frequency of requests or implement exponential + backoff retry logic in your application. + """ + + value: ThrottlingException + +@dataclass +class CodeInterpreterStreamOutputValidationException(_SerdeShape): + """ + The exception that occurs when the input fails to satisfy the + constraints specified by the service. Check the error message for + details about which input parameter is invalid and correct your request. + """ + + value: ValidationException + +@dataclass +class CodeInterpreterStreamOutputUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +CodeInterpreterStreamOutput = Union[ + CodeInterpreterStreamOutputResult + | CodeInterpreterStreamOutputAccessDeniedException + | CodeInterpreterStreamOutputConflictException + | CodeInterpreterStreamOutputInternalServerException + | CodeInterpreterStreamOutputResourceNotFoundException + | CodeInterpreterStreamOutputServiceQuotaExceededException + | CodeInterpreterStreamOutputThrottlingException + | CodeInterpreterStreamOutputValidationException + | CodeInterpreterStreamOutputUnknown +] +"""Contains output from a code interpreter stream.""" + +class _CodeInterpreterStreamOutputDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> CodeInterpreterStreamOutput: ... + +@dataclass(kw_only=True) +class CoinbaseCdpTokenRequestInput(_SerdeShape): + """Coinbase CDP token request parameters.""" + + request_method: str + """The HTTP method for the payment API request.""" + request_host: str | None = ... + """ + The host for the payment API request. Defaults to + \"api.cdp.coinbase.com\". + """ + request_path: str + """The path of the payment API request.""" + include_wallet_auth_token: bool = ... + """ + Set to true for wallet write operations (requires walletSecret + configured). + """ + request_body: str | None = ... + """Request body JSON --- used to generate wallet auth JWT.""" + +@dataclass(kw_only=True) +class CoinbaseCdpTokenResponseOutput(_SerdeShape): + """Coinbase CDP token response.""" + + bearer_token: str + """Bearer Token for Authorization header.""" + wallet_auth_token: str | None = ... + """Wallet Auth Token for X-Wallet-Auth header.""" + +class CommandExecutionStatus(UnknownEnumMixin, StrEnum): + COMPLETED = "COMPLETED" + TIMED_OUT = "TIMED_OUT" + +@dataclass(kw_only=True) +class CompleteResourceTokenAuthInput(_SerdeShape): + """Dataclass for CompleteResourceTokenAuthInput structure.""" + + user_identifier: UserIdentifier | None = ... + """ + The OAuth2.0 token or user ID that was used to generate the workload + access token used for initiating the user authorization flow to retrieve + OAuth2.0 tokens. + """ + session_uri: str | None = ... + """ + Unique identifier for the user's authentication session for retrieving + OAuth2 tokens. This ID tracks the authorization flow state across + multiple requests and responses during the OAuth2 authentication + process. + """ + +@dataclass(kw_only=True) +class CompleteResourceTokenAuthOutput(_SerdeShape): + """Dataclass for CompleteResourceTokenAuthOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ConfidenceInterval(_SerdeShape): + """A confidence interval for a statistical measurement.""" + + lower: float | None = ... + """The lower bound of the confidence interval.""" + upper: float | None = ... + """The upper bound of the confidence interval.""" + +@dataclass(kw_only=True) +class ConfigurationBundleRef(_SerdeShape): + """A reference to a specific version of a configuration bundle.""" + + bundle_arn: str + """The Amazon Resource Name (ARN) of the configuration bundle.""" + bundle_version: str + """The version of the configuration bundle.""" + +@dataclass(kw_only=True) +class ConfigurationBundleToolEntry(_SerdeShape): + """Maps a tool name to its JSON path within a configuration bundle.""" + + tool_name: str + """The name of the tool.""" + tool_description_json_path: str + """ + The JSON path within the configuration bundle's components that + contains the tool description. + """ + +@dataclass(kw_only=True) +class ConflictException(ServiceError, _SerdeShape): + """ + The exception that occurs when the request conflicts with the current + state of the resource. This can happen when trying to modify a resource + that is currently being modified by another request, or when trying to + create a resource that already exists. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass +class ContentText(_SerdeShape): + """The text content of the memory item.""" + + value: str + +@dataclass +class ContentUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +Content = Union[ContentText | ContentUnknown] +"""Contains the content of a memory item.""" + +class _ContentDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> Content: ... + +@dataclass(kw_only=True) +class ContentBlock(_SerdeShape): + """A block of content in a response.""" + + type: str + """The type of content in the block.""" + text: str | None = ... + """The text content of the block.""" + data: bytes | None = ... + """The binary data content of the block.""" + mime_type: str | None = ... + """The MIME type of the content.""" + uri: str | None = ... + """The URI of the content.""" + name: str | None = ... + """The name of the content block.""" + description: str | None = ... + """The description of the content block.""" + size: int | None = ... + """The size of the content in bytes.""" + resource: ResourceContent | None = ... + """The resource associated with the content block.""" + +class ContentBlockType(UnknownEnumMixin, StrEnum): + TEXT = "text" + IMAGE = "image" + EMBEDDED_RESOURCE = "resource" + RESOURCE_LINK = "resource_link" + +@dataclass(kw_only=True) +class ContentDeltaEvent(_SerdeShape): + """ + An event that contains incremental output from a command execution. This + event streams standard output and standard error content as it becomes + available during command execution. + """ + + stdout: str | None = ... + """ + The standard output content from the command execution. This field + contains the incremental output written to stdout by the executing + command. + """ + stderr: str | None = ... + """ + The standard error content from the command execution. This field + contains the incremental output written to stderr by the executing + command. + """ + +@dataclass +class ContentSourceInline(_SerdeShape): + """The content included directly in the request.""" + + value: InlineMemoryContent + +@dataclass +class ContentSourceUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ContentSource = Union[ContentSourceInline | ContentSourceUnknown] +"""The source of the content to ingest. Only inline content is supported.""" + +class _ContentSourceDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> ContentSource: ... + +@dataclass(kw_only=True) +class ContentStartEvent(_SerdeShape): + """ + An event that signals the start of content streaming from a command + execution. This event is sent when the command begins producing output. + """ + +@dataclass(kw_only=True) +class ContentStopEvent(_SerdeShape): + """ + An event that signals the completion of a command execution. This event + contains the final status and exit code of the executed command. + """ + + exit_code: int + """ + The exit code returned by the executed command. An exit code of 0 + indicates successful execution, -1 indicates a platform error, and + values greater than 0 indicate command-specific errors. + """ + status: str + """ + The final status of the command execution. Valid values are `COMPLETED` + for successful completion or `TIMED_OUT` if the command exceeded the + specified timeout. + """ + +@dataclass +class ContextSpanContext(_SerdeShape): + """ + The span context information that uniquely identifies the trace and span + being evaluated, including session ID, trace ID, and span ID for precise + targeting within the agent's execution flow. + """ + + value: SpanContext + +@dataclass +class ContextUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +Context = Union[ContextSpanContext | ContextUnknown] +""" +The contextual information associated with an evaluation, including span +context details that identify the specific traces and sessions being +evaluated within the agent's execution flow. +""" + +class _ContextDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> Context: ... + +@dataclass(kw_only=True) +class ControlStats(_SerdeShape): + """Statistics for the control variant in an A/B test.""" + + variant_name: str + """The name of the control variant.""" + sample_size: int + """The number of sessions evaluated for the control variant.""" + mean: float + """The mean evaluation score for the control variant.""" + +@dataclass(kw_only=True) +class Conversational(_SerdeShape): + """Contains conversational content for an event payload.""" + + content: Content + """The content of the conversation message.""" + role: str + """ + The role of the participant in the conversation (for example, \"user\" + or \"assistant\"). + """ + +@dataclass(kw_only=True) +class CreateABTestInput(_SerdeShape): + """Dataclass for CreateABTestInput structure.""" + + name: str | None = ... + """The name of the A/B test. Must be unique within your account.""" + description: str | None = ... + """The description of the A/B test.""" + gateway_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the gateway to use for traffic + splitting. + """ + variants: list[Variant] | None = ... + """ + The list of variants for the A/B test. Must contain exactly two + variants: a control (C) and a treatment (T1), each with a configuration + bundle or target reference and a traffic weight. + """ + gateway_filter: GatewayFilter | None = ... + """ + Optional filter to restrict which gateway target paths are included in + the A/B test. + """ + evaluation_config: ABTestEvaluationConfig | None = ... + """ + The evaluation configuration specifying which online evaluation + configurations to use for measuring variant performance. + """ + role_arn: str | None = ... + """ + The IAM role ARN that grants permissions for the A/B test to access + gateway and evaluation resources. + """ + enable_on_create: bool | None = ... + """ + Whether to enable the A/B test immediately upon creation. If true, + traffic splitting begins automatically. + """ + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If this token matches a previous + request, the service ignores the request, but does not return an error. + """ + tags: dict[str, str] | None = ... + """A map of tag keys and values to associate with the A/B test.""" + +@dataclass(kw_only=True) +class CreateABTestOutput(_SerdeShape): + """Dataclass for CreateABTestOutput structure.""" + + ab_test_id: str + """The unique identifier of the created A/B test.""" + ab_test_arn: str + """The Amazon Resource Name (ARN) of the created A/B test.""" + name: str | None = ... + """The name of the A/B test.""" + status: str + """The status of the A/B test.""" + execution_status: str + """ + The execution status indicating whether the A/B test is currently + running. + """ + created_at: datetime + """The timestamp when the A/B test was created.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateEventInput(_SerdeShape): + """Dataclass for CreateEventInput structure.""" + + memory_id: str | None = ... + """ + The identifier of the AgentCore Memory resource in which to create the + event. + """ + actor_id: str | None = ... + """ + The identifier of the actor associated with this event. An actor + represents an entity that participates in sessions and generates events. + """ + session_id: str | None = ... + """ + The identifier of the session in which this event occurs. A session + represents a sequence of related events. + """ + event_timestamp: datetime | None = ... + """ + The timestamp when the event occurred. If not specified, the current + time is used. + """ + payload: list[PayloadType] | None = ... + """ + The content payload of the event. This can include conversational data, + JSON data, or binary content. + """ + branch: Branch | None = ... + """ + The branch information for this event. Branches allow for organizing + events into different conversation threads or paths. + """ + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the operation + completes no more than one time. If this token matches a previous + request, AgentCore ignores the request, but does not return an error. + """ + metadata: dict[str, MetadataValue] | None = ... + """The key-value metadata to attach to the event.""" + extraction_mode: str | None = ... + """ + Controls long-term memory extraction for this event. When set to `SKIP`, + the event is stored in short-term memory but is excluded from long-term + memory extraction. If not specified, the event is processed for + extraction as usual. + """ + extraction_config: ExtractionConfig | None = ... + """ + The extraction configuration for long-term memory records. Use this + parameter to specify namespace variable keys and their values for + namespace substitution during extraction. + """ + +@dataclass(kw_only=True) +class CreateEventOutput(_SerdeShape): + """Dataclass for CreateEventOutput structure.""" + + event: Event + """The event that was created.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreatePaymentInstrumentInput(_SerdeShape): + """Request structure for creating a payment instrument.""" + + user_id: str | None = ... + """The user ID associated with this payment instrument.""" + agent_name: str | None = ... + """The agent name associated with this request, used for observability.""" + payment_manager_arn: str | None = ... + """The ARN of the payment manager that owns this payment instrument.""" + payment_connector_id: str | None = ... + """The ID of the payment connector to use for this instrument.""" + payment_instrument_type: str | None = ... + """The type of payment instrument being created.""" + payment_instrument_details: PaymentInstrumentDetails | None = ... + """The details of the payment instrument.""" + client_token: str | None = ... + """ + A unique, case-sensitive identifier that you provide to ensure the + idempotency of the request. + """ + +@dataclass(kw_only=True) +class CreatePaymentInstrumentOutput(_SerdeShape): + """Response structure for creating a payment instrument.""" + + payment_instrument: PaymentInstrument + """The created payment instrument.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreatePaymentSessionInput(_SerdeShape): + """Request structure for creating a payment session.""" + + user_id: str | None = ... + """The user ID associated with this payment session.""" + agent_name: str | None = ... + """The agent name associated with this request, used for observability.""" + payment_manager_arn: str | None = ... + """The ARN of the payment manager that owns this session.""" + limits: SessionLimits | None = ... + """The spending limits for this payment session.""" + expiry_time_in_minutes: int | None = ... + """The session expiry time in minutes. Must be between 15 and 480 minutes.""" + client_token: str | None = ... + """ + A unique, case-sensitive identifier that you provide to ensure the + idempotency of the request. + """ + +@dataclass(kw_only=True) +class CreatePaymentSessionOutput(_SerdeShape): + """Response structure for creating a payment session.""" + + payment_session: PaymentSession + """The created payment session.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class CryptoWalletNetwork(UnknownEnumMixin, StrEnum): + """Supported blockchain networks for crypto wallets.""" + + ETHEREUM = "ETHEREUM" + SOLANA = "SOLANA" + +@dataclass(kw_only=True) +class CryptoX402PaymentInput(_SerdeShape): + """The input for a crypto X402 payment.""" + + version: str + """The version of the X402 protocol.""" + payload: Document + """The X402 payment payload.""" + permit2_allowance_limit: str | None = ... + """ + The maximum on-chain Permit2 allowance to grant before signing the + payment authorization, in the asset's smallest denomination. This field + is valid only for the `upto` (metered) scheme; supplying it for the + `exact` scheme returns a validation error. + + When set, the service approves an ERC-20 allowance for this amount + before processing the payment. The approval sets, rather than adds to, + the wallet's allowance. Set this field only when the wallet needs + approving, for example on its first `upto` payment, to avoid a redundant + on-chain transaction. Omit the field to skip allowance handling. This is + the default, and the only behavior for the `exact` scheme. + """ + +@dataclass(kw_only=True) +class CryptoX402PaymentOutput(_SerdeShape): + """The output from a crypto X402 payment.""" + + version: str + """The version of the X402 protocol.""" + payload: Document + """The X402 payment response payload.""" + +class Currency(UnknownEnumMixin, StrEnum): + """Supported currency codes.""" + + USD = "USD" + +@dataclass(kw_only=True) +class CustomDescriptor(_SerdeShape): + """A custom descriptor configuration for a registry record.""" + + inline_content: str | None = ... + """The inline content of the custom descriptor.""" + +@dataclass +class DataSourceConfigCloudWatchLogs(_SerdeShape): + """Configuration for pulling agent session traces from CloudWatch Logs.""" + + value: CloudWatchLogsSource + +@dataclass +class DataSourceConfigOnlineEvaluationConfigSource(_SerdeShape): + """Reference an existing OnlineEvaluationConfig as session source""" + + value: OnlineEvaluationConfigSource + +@dataclass +class DataSourceConfigUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +DataSourceConfig = Union[ + DataSourceConfigCloudWatchLogs + | DataSourceConfigOnlineEvaluationConfigSource + | DataSourceConfigUnknown +] +"""Configuration for the data source used in evaluation.""" + +class _DataSourceConfigDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> DataSourceConfig: ... + +@dataclass(kw_only=True) +class DeleteABTestInput(_SerdeShape): + """Dataclass for DeleteABTestInput structure.""" + + ab_test_id: str | None = ... + """The unique identifier of the A/B test to delete.""" + +@dataclass(kw_only=True) +class DeleteABTestOutput(_SerdeShape): + """Dataclass for DeleteABTestOutput structure.""" + + ab_test_id: str + """The unique identifier of the deleted A/B test.""" + ab_test_arn: str + """The Amazon Resource Name (ARN) of the deleted A/B test.""" + status: str + """The status of the A/B test deletion operation.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteBatchEvaluationInput(_SerdeShape): + """Dataclass for DeleteBatchEvaluationInput structure.""" + + batch_evaluation_id: str | None = ... + """The unique identifier of the batch evaluation to delete.""" + +@dataclass(kw_only=True) +class DeleteBatchEvaluationOutput(_SerdeShape): + """Dataclass for DeleteBatchEvaluationOutput structure.""" + + batch_evaluation_id: str + """The unique identifier of the deleted batch evaluation.""" + batch_evaluation_arn: str + """The Amazon Resource Name (ARN) of the deleted batch evaluation.""" + status: str + """The status of the batch evaluation deletion operation.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteCapacityProviderSessionInput(_SerdeShape): + """Dataclass for DeleteCapacityProviderSessionInput structure.""" + + capacity_provider_id: str | None = ... + """ + The unique identifier of the capacity provider associated with the + session. + """ + session_id: str | None = ... + """The unique identifier of the capacity provider session to delete.""" + +@dataclass(kw_only=True) +class DeleteCapacityProviderSessionOutput(_SerdeShape): + """Dataclass for DeleteCapacityProviderSessionOutput structure.""" + + capacity_provider_arn: str + """ + The Amazon Resource Name (ARN) of the capacity provider associated with + the deleted session. + """ + session_id: str + """The unique identifier of the deleted capacity provider session.""" + status: str + """ + The current status of the capacity provider session. When the status is + `Deleting`, the session is being deleted and is not available. When the + status is `Deleted`, the session is no longer available. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteEventInput(_SerdeShape): + """Dataclass for DeleteEventInput structure.""" + + memory_id: str | None = ... + """ + The identifier of the AgentCore Memory resource from which to delete the + event. + """ + session_id: str | None = ... + """The identifier of the session containing the event to delete.""" + event_id: str | None = ... + """The identifier of the event to delete.""" + actor_id: str | None = ... + """The identifier of the actor associated with the event to delete.""" + +@dataclass(kw_only=True) +class DeleteEventOutput(_SerdeShape): + """Dataclass for DeleteEventOutput structure.""" + + event_id: str + """The identifier of the event that was deleted.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteMemoryRecordInput(_SerdeShape): + """Dataclass for DeleteMemoryRecordInput structure.""" + + memory_id: str | None = ... + """ + The identifier of the AgentCore Memory resource from which to delete the + memory record. + """ + memory_record_id: str | None = ... + """The identifier of the memory record to delete.""" + namespace: str | None = ... + """ + The namespace of the memory record to delete. This value is used for IAM + condition key authorization. + """ + +@dataclass(kw_only=True) +class DeleteMemoryRecordOutput(_SerdeShape): + """Dataclass for DeleteMemoryRecordOutput structure.""" + + memory_record_id: str + """The identifier of the memory record that was deleted.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeletePaymentInstrumentInput(_SerdeShape): + """Request structure for deleting a payment instrument.""" + + user_id: str | None = ... + """ + The user ID making the delete request. Must match the instrument's + userId. + """ + payment_manager_arn: str | None = ... + """The payment manager ARN. Must match the instrument's paymentManagerArn.""" + payment_connector_id: str | None = ... + """ + The payment connector ID. Must match the instrument's + paymentConnectorId. + """ + payment_instrument_id: str | None = ... + """The payment instrument ID to delete.""" + +@dataclass(kw_only=True) +class DeletePaymentInstrumentOutput(_SerdeShape): + """Response structure for deleting a payment instrument.""" + + status: str + """ + The status of the instrument after deletion. Always DELETED for + successful soft delete. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeletePaymentSessionInput(_SerdeShape): + """Request structure for deleting a payment session.""" + + user_id: str | None = ... + """The user ID making the delete request. Must match the session's userId.""" + payment_manager_arn: str | None = ... + """The payment manager ARN. Must match the session's paymentManagerArn.""" + payment_session_id: str | None = ... + """The payment session ID to delete.""" + +@dataclass(kw_only=True) +class DeletePaymentSessionOutput(_SerdeShape): + """Response structure for deleting a payment session.""" + + status: str + """The status of the deletion. Always DELETED for successful hard delete.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteRecommendationInput(_SerdeShape): + """Dataclass for DeleteRecommendationInput structure.""" + + recommendation_id: str | None = ... + """The unique identifier of the recommendation to delete.""" + +@dataclass(kw_only=True) +class DeleteRecommendationOutput(_SerdeShape): + """Dataclass for DeleteRecommendationOutput structure.""" + + recommendation_id: str + """The unique identifier of the deleted recommendation.""" + status: str + """The status of the recommendation deletion operation.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class Descriptors(_SerdeShape): + """ + Contains the descriptor configuration for a registry record. Only the + field that matches the record's `descriptorType` is populated. + """ + + mcp: McpDescriptor | None = ... + """ + The MCP (Model Context Protocol) descriptor configuration. Populated + when the record's `descriptorType` is `MCP`. + """ + a2a: A2aDescriptor | None = ... + """ + The A2A (Agent-to-Agent) descriptor configuration. Populated when the + record's `descriptorType` is `A2A`. + """ + custom: CustomDescriptor | None = ... + """ + The custom descriptor configuration. Populated when the record's + `descriptorType` is `CUSTOM`. + """ + agent_skills: AgentSkillsDescriptor | None = ... + """ + The agent skills descriptor configuration. Populated when the record's + `descriptorType` is `AGENT_SKILLS`. + """ + +class DescriptorType(UnknownEnumMixin, StrEnum): + """The type of descriptor associated with a registry record.""" + + MCP = "MCP" + A2_A = "A2A" + CUSTOM = "CUSTOM" + AGENT_SKILLS = "AGENT_SKILLS" + +@dataclass(kw_only=True) +class DuplicateIdException(ServiceError, _SerdeShape): + """ + An exception thrown when attempting to create a resource with an + identifier that already exists. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class EfsConfiguration(_SerdeShape): + """ + The configuration for mounting an Amazon Elastic File System (Amazon + EFS) access point that you own into a session. + """ + + access_point_arn: str + """ + The Amazon Resource Name (ARN) of the Amazon Elastic File System (Amazon + EFS) access point to mount. + """ + mount_path: str + """ + The absolute path within the session at which the access point is + mounted, for example `/mnt/efs`. Each mount path must be unique across + all file system configurations in the session. + """ + file_system_arn: str + """ + The Amazon Resource Name (ARN) of the Amazon Elastic File System (Amazon + EFS) file system that owns the access point. + """ + +@dataclass(kw_only=True) +class EmbeddedCryptoWallet(_SerdeShape): + """Embedded crypto wallet instrument details.""" + + network: str + """ + The blockchain network for this embedded crypto wallet. Supported + networks: ETHEREUM, SOLANA. + """ + linked_accounts: list[LinkedAccount] + """ + List of linked accounts linked to this wallet. Each represents a way the + end user can authenticate to this wallet. + """ + wallet_address: str | None = ... + """The wallet address on the specified blockchain network.""" + redirect_url: str | None = ... + """ + URL for the end user to complete a provider-specific action such as + wallet linking or onboarding. + """ + +@dataclass(kw_only=True) +class EvaluateInput(_SerdeShape): + """Dataclass for EvaluateInput structure.""" + + evaluator_id: str | None = ... + """ + The unique identifier of the evaluator to use for scoring. Can be a + built-in evaluator (e.g., `Builtin.Helpfulness`, `Builtin.Correctness`) + or a custom evaluator Id created through the control plane API. + """ + evaluation_input: EvaluationInput | None = ... + """ + The input data containing agent session spans to be evaluated. Includes + a list of spans in OpenTelemetry format from supported frameworks like + Strands (AgentCore Runtime) or LangGraph with OpenInference + instrumentation. + """ + evaluation_target: EvaluationTarget | None = ... + """ + The specific trace or span IDs to evaluate within the provided input. + Allows targeting evaluation at different levels: individual tool calls, + single request-response interactions (traces), or entire conversation + sessions. + """ + evaluation_reference_inputs: list[EvaluationReferenceInput] | None = ... + """ + Ground truth data to compare against agent responses during evaluation. + Allows to provide expected responses, assertions, and expected tool + trajectories at different evaluation levels. Session-level reference + inputs apply to the entire conversation, while trace-level reference + inputs target specific request-response interactions identified by trace + ID. + """ + +@dataclass(kw_only=True) +class EvaluateOutput(_SerdeShape): + """Dataclass for EvaluateOutput structure.""" + + evaluation_results: list[EvaluationResultContent] + """ + The detailed evaluation results containing scores, explanations, and + metadata. Includes the evaluator information, numerical or categorical + ratings based on the evaluator's rating scale, and token usage + statistics for the evaluation process. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass +class EvaluationContentText(_SerdeShape): + """ + The text content of the ground truth data. Used for expected response + text and assertion statements. + """ + + value: str + +@dataclass +class EvaluationContentUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +EvaluationContent = Union[EvaluationContentText | EvaluationContentUnknown] +""" +A content block for ground truth data in evaluation reference inputs. +Supports text content for expected responses and assertions. +""" + +class _EvaluationContentDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> EvaluationContent: ... + +@dataclass(kw_only=True) +class EvaluationExpectedTrajectory(_SerdeShape): + """The expected tool call trajectory for trajectory-based evaluation.""" + + tool_names: list[str] | None = ... + """The list of tool names representing the expected tool call sequence.""" + +@dataclass +class EvaluationInputSessionSpans(_SerdeShape): + """ + The collection of spans representing agent execution traces within a + session. Each span contains detailed information about tool calls, model + interactions, and other agent activities that can be evaluated for + quality and performance. + """ + + value: list[Document] + +@dataclass +class EvaluationInputUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +EvaluationInput = Union[EvaluationInputSessionSpans | EvaluationInputUnknown] +""" +The input data structure containing agent session spans in OpenTelemetry +format. Supports traces from frameworks like Strands (AgentCore Runtime) +and LangGraph with OpenInference instrumentation for comprehensive +evaluation. +""" + +class _EvaluationInputDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> EvaluationInput: ... + +@dataclass(kw_only=True) +class EvaluationJobResults(_SerdeShape): + """ + Aggregated results from a batch evaluation, including session completion + counts and evaluator score summaries. + """ + + number_of_sessions_completed: int | None = ... + """The number of sessions that have been successfully evaluated.""" + number_of_sessions_in_progress: int | None = ... + """The number of sessions currently being evaluated.""" + number_of_sessions_failed: int | None = ... + """The number of sessions that failed evaluation.""" + total_number_of_sessions: int | None = ... + """The total number of sessions included in the batch evaluation.""" + number_of_sessions_ignored: int | None = ... + """The number of sessions that were ignored during evaluation.""" + evaluator_summaries: list[EvaluatorSummary] | None = ... + """A list of per-evaluator summary statistics.""" + +@dataclass +class EvaluationMetadataSessionMetadata(_SerdeShape): + """ + A list of session metadata entries containing ground truth data and test + scenario identifiers for specific sessions. + """ + + value: list[SessionMetadataShape] + +@dataclass +class EvaluationMetadataUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +EvaluationMetadata = Union[ + EvaluationMetadataSessionMetadata | EvaluationMetadataUnknown +] +""" +Metadata for the evaluation, including session-specific ground truth +data. +""" + +class _EvaluationMetadataDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> EvaluationMetadata: ... + +@dataclass(kw_only=True) +class EvaluationReferenceInput(_SerdeShape): + """ + A reference input containing ground truth data for evaluation, scoped to + a specific context level (session or trace) through its span context. + """ + + context: Context + """ + The span context that identifies which session or trace this reference + input applies to, used for correlating ground truth with agent output. + """ + expected_response: EvaluationContent | None = ... + """ + The expected response for trace-level evaluation. Built-in evaluators + that support this field compare the agent's actual response against + this value for assessment. Custom evaluators can access it through the + `{expected_response}` placeholder in their instructions. + """ + assertions: list[EvaluationContent] | None = ... + """ + A list of assertion statements for session-level evaluation. Each + assertion describes an expected behavior or outcome the agent should + demonstrate during the session. + """ + expected_trajectory: EvaluationExpectedTrajectory | None = ... + """ + The expected tool call sequence for session-level trajectory evaluation. + Contains a list of tool names representing the tools the agent is + expected to invoke. + """ + +@dataclass(kw_only=True) +class EvaluationResultContent(_SerdeShape): + """ + The comprehensive result of an evaluation containing the score, + explanation, evaluator metadata, and execution details. Provides both + quantitative ratings and qualitative insights about agent performance. + """ + + evaluator_arn: str + """ + The Amazon Resource Name (ARN) of the evaluator used to generate this + result. For custom evaluators, this is the full ARN; for built-in + evaluators, this follows the pattern `Builtin.{EvaluatorName}`. + """ + evaluator_id: str + """ + The unique identifier of the evaluator that produced this result. This + matches the `evaluatorId` provided in the evaluation request and can be + used to identify which evaluator generated specific results. + """ + evaluator_name: str + """ + The human-readable name of the evaluator used for this evaluation. For + built-in evaluators, this is the descriptive name (e.g., + \"Helpfulness\", \"Correctness\"); for custom evaluators, this is the + user-defined name. + """ + explanation: str | None = ... + """ + The detailed explanation provided by the evaluator describing the + reasoning behind the assigned score. This qualitative feedback helps + understand why specific ratings were given and provides actionable + insights for improvement. + """ + context: Context + """ + The contextual information associated with this evaluation result, + including span context details that identify the specific traces and + sessions that were evaluated. + """ + value: float | None = ... + """ + The numerical score assigned by the evaluator according to its + configured rating scale. For numerical scales, this is a decimal value + within the defined range. This field is not allowed for categorical + scales. + """ + label: str | None = ... + """ + The categorical label assigned by the evaluator when using a categorical + rating scale. This provides a human-readable description of the + evaluation result (e.g., \"Excellent\", \"Good\", \"Poor\") + corresponding to the numerical value. For numerical scales, this field + is optional and provides a natural language explanation of what the + value means (e.g., value 0.5 = \"Somewhat Helpful\"). + """ + token_usage: TokenUsage | None = ... + """ + The token consumption statistics for this evaluation, including input + tokens, output tokens, and total tokens used by the underlying language + model during the evaluation process. + """ + error_message: str | None = ... + """ + The error message describing what went wrong if the evaluation failed. + Provides detailed information about evaluation failures to help diagnose + and resolve issues with evaluator configuration or input data. + """ + error_code: str | None = ... + """ + The error code indicating the type of failure that occurred during + evaluation. Used to programmatically identify and handle different + categories of evaluation errors. + """ + ignored_reference_input_fields: list[str] | None = ... + """ + The list of reference input field names that were provided but not used + by the evaluator. Helps identify which ground truth data was not + consumed during evaluation. + """ + +@dataclass +class EvaluationTargetSpanIds(_SerdeShape): + """ + The list of specific span IDs to evaluate within the provided traces. + Used to target evaluation at individual tool calls or specific + operations within the agent's execution flow. + """ + + value: list[str] + +@dataclass +class EvaluationTargetTraceIds(_SerdeShape): + """ + The list of trace IDs to evaluate, representing complete + request-response interactions. Used to evaluate entire conversation + turns or specific agent interactions within a session. + """ + + value: list[str] + +@dataclass +class EvaluationTargetUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +EvaluationTarget = Union[ + EvaluationTargetSpanIds | EvaluationTargetTraceIds | EvaluationTargetUnknown +] +""" +The specification of which trace or span IDs to evaluate within the +provided input data. Allows precise targeting of evaluation at different +levels: tool calls, traces, or sessions. +""" + +class _EvaluationTargetDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> EvaluationTarget: ... + +@dataclass(kw_only=True) +class Evaluator(_SerdeShape): + """An evaluator to run against sessions during batch evaluation.""" + + evaluator_id: str + """ + The unique identifier of the evaluator. Can reference built-in + evaluators (e.g., `Builtin.Helpfulness`) or custom evaluators. + """ + +@dataclass(kw_only=True) +class EvaluatorMetric(_SerdeShape): + """ + Statistical metrics for a single evaluator comparing control and + treatment variants. + """ + + evaluator_arn: str + """The Amazon Resource Name (ARN) of the evaluator.""" + control_stats: ControlStats + """The statistics for the control variant.""" + variant_results: list[VariantResult] + """The results for each treatment variant compared against the control.""" + +@dataclass(kw_only=True) +class EvaluatorStatistics(_SerdeShape): + """Aggregated statistics for an evaluator.""" + + average_score: float | None = ... + """The average score across all evaluated sessions for this evaluator.""" + +@dataclass(kw_only=True) +class EvaluatorSummary(_SerdeShape): + """Summary statistics for a single evaluator within a batch evaluation.""" + + evaluator_id: str | None = ... + """The unique identifier of the evaluator.""" + statistics: EvaluatorStatistics | None = ... + """The aggregated statistics for this evaluator.""" + total_evaluated: int | None = ... + """The total number of sessions evaluated by this evaluator.""" + total_failed: int | None = ... + """The total number of sessions that failed evaluation by this evaluator.""" + +@dataclass(kw_only=True) +class Event(_SerdeShape): + """Contains information about an event in an AgentCore Memory resource.""" + + memory_id: str + """The identifier of the AgentCore Memory resource containing the event.""" + actor_id: str + """The identifier of the actor associated with the event.""" + session_id: str + """The identifier of the session containing the event.""" + event_id: str + """The unique identifier of the event.""" + event_timestamp: datetime + """The timestamp when the event occurred.""" + payload: list[PayloadType] + """The content payload of the event.""" + branch: Branch | None = ... + """The branch information for the event.""" + metadata: dict[str, MetadataValue] | None = ... + """Metadata associated with an event.""" + +class EventFilterCondition(UnknownEnumMixin, StrEnum): + """The condition to use for filtering sessions by events.""" + + HAS_EVENTS = "HAS_EVENTS" + +@dataclass(kw_only=True) +class EventMetadataFilterExpression(_SerdeShape): + """ + Filter expression for retrieving events based on metadata associated + with an event. + """ + + left: LeftExpression + """Left operand of the event metadata filter expression.""" + operator: str + """Operator applied to the event metadata filter expression.""" + right: RightExpression | None = ... + """Right operand of the event metadata filter expression.""" + +@dataclass(kw_only=True) +class ExecutionSummaryAffectedSession(_SerdeShape): + """A session associated with an execution summary cluster.""" + + session_id: str + """The unique identifier of the session.""" + approach_taken: str + """The approach taken by the agent during this session.""" + final_outcome: str + """The final outcome of the session.""" + +@dataclass(kw_only=True) +class ExecutionSummaryCluster(_SerdeShape): + """A cluster of similar execution patterns identified across sessions.""" + + cluster_id: int + """The unique identifier of the execution summary cluster.""" + name: str + """The name of the execution pattern cluster.""" + description: str + """A description of the execution pattern.""" + affected_session_count: int + """The number of sessions with this execution pattern.""" + affected_sessions: list[ExecutionSummaryAffectedSession] + """The list of sessions with this execution pattern.""" + +@dataclass(kw_only=True) +class ExecutionSummaryClusteringResultContent(_SerdeShape): + """ + The execution summary clustering result containing grouped execution + patterns identified across evaluated sessions. + """ + + execution_summaries: list[ExecutionSummaryCluster] + """ + The list of execution summary clusters identified across analyzed + sessions. + """ + +@dataclass(kw_only=True) +class ExternalProxy(_SerdeShape): + """ + Configuration for a customer-managed external proxy server. Includes + server location, optional domain-based routing patterns, and + authentication credentials. + """ + + server: str + """ + The hostname of the proxy server. Must be a valid DNS hostname (maximum + 253 characters). + """ + port: int + """The port number of the proxy server. Valid range: 1-65535.""" + domain_patterns: list[str] | None = ... + """ + Optional array of domain patterns that should route through this + specific proxy. Supports `.example.com` for subdomain matching (matches + any subdomain of example.com) or `example.com` for exact domain + matching. If omitted, this proxy acts as a catch-all for domains not + matched by other proxies. Maximum 100 patterns per proxy, each up to 253 + characters. + """ + credentials: ProxyCredentials | None = ... + """ + Optional authentication credentials for the proxy server. If omitted, + the proxy is accessed without authentication (useful for IP-allowlisted + proxies). + """ + +@dataclass(kw_only=True) +class ExtractionConfig(_SerdeShape): + """ + The configuration for extraction behavior. Use this structure to specify + namespace variable keys and their values for namespace substitution + during long-term memory extraction. + """ + + namespace_variables: dict[str, str] | None = ... + """ + A map of `namespaceKeys` to their values. The service substitutes these + values into `namespaceTemplates` during long-term memory extraction to + control namespace hierarchy. + """ + +@dataclass(kw_only=True) +class ExtractionJob(_SerdeShape): + """ + Represents the metadata of a memory extraction job such as the message + identifiers that compose this job. + """ + + job_id: str + """The unique identifier of the extraction job.""" + +@dataclass(kw_only=True) +class ExtractionJobFilterInput(_SerdeShape): + """Filters for querying memory extraction jobs based on various criteria.""" + + strategy_id: str | None = ... + """ + The memory strategy identifier to filter extraction jobs by. If + specified, only extraction jobs with this strategy ID are returned. + """ + session_id: str | None = ... + """ + The unique identifier of the session. If specified, only extraction jobs + with this session ID are returned. + """ + actor_id: str | None = ... + """ + The identifier of the actor. If specified, only extraction jobs with + this actor ID are returned. + """ + status: str | None = ... + """ + The status of the extraction job. If specified, only extraction jobs + with this status are returned. + """ + +@dataclass +class ExtractionJobMessagesMessagesList(_SerdeShape): + """The list of messages that compose this extraction job.""" + + value: list[MessageMetadata] + +@dataclass +class ExtractionJobMessagesUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ExtractionJobMessages = Union[ + ExtractionJobMessagesMessagesList | ExtractionJobMessagesUnknown +] +"""The list of messages that compose this extraction job.""" + +class _ExtractionJobMessagesDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> ExtractionJobMessages: ... + +@dataclass(kw_only=True) +class ExtractionJobMetadata(_SerdeShape): + """Metadata information associated with this extraction job.""" + + job_id: str + """The unique identifier for the extraction job.""" + messages: ExtractionJobMessages + """The messages associated with the extraction job.""" + status: str | None = ... + """The current status of the extraction job.""" + failure_reason: str | None = ... + """The cause of failure, if the job did not complete successfully.""" + strategy_id: str | None = ... + """The identifier of the memory strategy for this extraction job.""" + session_id: str | None = ... + """The identifier of the session for this extraction job.""" + actor_id: str | None = ... + """The identifier of the actor for this extraction job.""" + +class ExtractionJobStatus(UnknownEnumMixin, StrEnum): + FAILED = "FAILED" + +class ExtractionMode(UnknownEnumMixin, StrEnum): + SKIP = "SKIP" + +@dataclass(kw_only=True) +class FailureAnalysisResultContent(_SerdeShape): + """ + The failure analysis clustering result containing categorized failure + clusters with root causes and remediation recommendations. + """ + + failures: list[FailureCategoryCluster] + """ + The list of failure category clusters identified across analyzed + sessions. + """ + +@dataclass(kw_only=True) +class FailureCategoryCluster(_SerdeShape): + """ + A top-level failure category identified by clustering similar failure + patterns across sessions. + """ + + cluster_id: int + """The unique identifier of the failure category cluster.""" + name: str + """The name of the failure category.""" + description: str + """A description of the failure category pattern.""" + affected_session_count: int + """The number of sessions affected by this failure category.""" + sub_categories: list[FailureSubCategoryCluster] + """The list of failure subcategories within this category.""" + +@dataclass(kw_only=True) +class FailureSpanDetail(_SerdeShape): + """Details about a specific span where a failure was detected.""" + + span_id: str + """The unique identifier of the span where the failure occurred.""" + trace_id: str + """The trace identifier associated with the failure span.""" + signals: list[InsightsFailureSignal] + """The failure signals detected in this span.""" + +@dataclass(kw_only=True) +class FailureSubCategoryCluster(_SerdeShape): + """A subcategory of failures within a top-level failure category.""" + + cluster_id: int + """The unique identifier of the failure subcategory cluster.""" + name: str + """The name of the failure subcategory.""" + description: str + """A description of the failure subcategory pattern.""" + affected_session_count: int + """The number of sessions affected by this failure subcategory.""" + root_causes: list[RootCauseCluster] + """The list of root cause clusters identified within this subcategory.""" + +@dataclass(kw_only=True) +class FilterInput(_SerdeShape): + """Contains filter criteria for listing events.""" + + branch: BranchFilter | None = ... + """The branch filter criteria to apply when listing events.""" + event_metadata: list[EventMetadataFilterExpression] | None = ... + """Event metadata filter criteria to apply when retrieving events.""" + +@dataclass +class FilterValueStringValue(_SerdeShape): + """A string value for text-based filtering.""" + + value: str + +@dataclass +class FilterValueDoubleValue(_SerdeShape): + """A numeric value for numerical filtering and comparisons.""" + + value: float + +@dataclass +class FilterValueBooleanValue(_SerdeShape): + """A boolean value for true/false filtering conditions.""" + + value: bool + +@dataclass +class FilterValueUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +FilterValue = Union[ + FilterValueStringValue + | FilterValueDoubleValue + | FilterValueBooleanValue + | FilterValueUnknown +] +"""A value used in filter comparisons, supporting different data types.""" + +class _FilterValueDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> FilterValue: ... + +@dataclass(kw_only=True) +class GatewayFilter(_SerdeShape): + """ + A filter to restrict which gateway target paths are included in the A/B + test. + """ + + target_paths: list[str] | None = ... + """A list of target path patterns to include in the A/B test.""" + +@dataclass(kw_only=True) +class GetABTestInput(_SerdeShape): + """Dataclass for GetABTestInput structure.""" + + ab_test_id: str | None = ... + """The unique identifier of the A/B test to retrieve.""" + +@dataclass(kw_only=True) +class GetABTestOutput(_SerdeShape): + """Dataclass for GetABTestOutput structure.""" + + ab_test_id: str + """The unique identifier of the A/B test.""" + ab_test_arn: str + """The Amazon Resource Name (ARN) of the A/B test.""" + name: str + """The name of the A/B test.""" + description: str | None = ... + """The description of the A/B test.""" + status: str + """The current status of the A/B test.""" + execution_status: str + """ + The execution status indicating whether the A/B test is currently + running. + """ + gateway_arn: str + """ + The Amazon Resource Name (ARN) of the gateway used for traffic + splitting. + """ + variants: list[Variant] + """The list of variants in the A/B test.""" + gateway_filter: GatewayFilter | None = ... + """The gateway filter restricting which target paths are included.""" + evaluation_config: ABTestEvaluationConfig + """The evaluation configuration for measuring variant performance.""" + role_arn: str | None = ... + """The IAM role ARN used by the A/B test.""" + current_run_id: str | None = ... + """The identifier of the current run of the A/B test.""" + error_details: list[str] | None = ... + """The error details if the A/B test encountered failures.""" + started_at: datetime | None = ... + """The timestamp when the A/B test was started.""" + stopped_at: datetime | None = ... + """The timestamp when the A/B test was stopped.""" + max_duration_expires_at: datetime | None = ... + """The timestamp when the A/B test will automatically expire.""" + created_at: datetime + """The timestamp when the A/B test was created.""" + updated_at: datetime + """The timestamp when the A/B test was last updated.""" + results: ABTestResults | None = ... + """ + The statistical results of the A/B test, including per-evaluator metrics + and significance analysis. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetAgentCardInput(_SerdeShape): + """Dataclass for GetAgentCardInput structure.""" + + runtime_session_id: str | None = ... + """The session ID that the AgentCore Runtime agent is using.""" + agent_runtime_arn: str | None = ... + """ + The ARN of the AgentCore Runtime agent for which you want to get the A2A + agent card. + """ + qualifier: str | None = ... + """ + Optional qualifier to specify an agent alias, such as `prod`code> or + `dev`. If you don't provide a value, the DEFAULT alias is used. + """ + +@dataclass(kw_only=True) +class GetAgentCardOutput(_SerdeShape): + """Dataclass for GetAgentCardOutput structure.""" + + runtime_session_id: str | None = ... + """The ID of the session associated with the AgentCore Runtime agent.""" + agent_card: Document + """ + An agent card document that contains metadata and capabilities for an + AgentCore Runtime agent. + """ + status_code: int | None = ... + """The status code of the request.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetBatchEvaluationInput(_SerdeShape): + """Dataclass for GetBatchEvaluationInput structure.""" + + batch_evaluation_id: str | None = ... + """The unique identifier of the batch evaluation to retrieve.""" + +@dataclass(kw_only=True) +class GetBatchEvaluationOutput(_SerdeShape): + """Dataclass for GetBatchEvaluationOutput structure.""" + + batch_evaluation_id: str + """The unique identifier of the batch evaluation.""" + batch_evaluation_arn: str + """The Amazon Resource Name (ARN) of the batch evaluation.""" + batch_evaluation_name: str + """The name of the batch evaluation.""" + status: str + """The current status of the batch evaluation.""" + created_at: datetime + """The timestamp when the batch evaluation was created.""" + evaluators: list[Evaluator] | None = ... + """The list of evaluators applied during the batch evaluation.""" + insights: list[Insight] | None = ... + """The list of insight analyses applied during the batch evaluation.""" + data_source_config: DataSourceConfig | None = ... + """ + The data source configuration specifying where agent traces are pulled + from. + """ + output_config: OutputConfig | None = ... + """ + The output configuration specifying where evaluation results are + written. + """ + evaluation_results: EvaluationJobResults | None = ... + """ + The aggregated evaluation results, including session completion counts + and evaluator score summaries. + """ + failure_analysis_result: FailureAnalysisResultContent | None = ... + """ + The failure analysis results from insights, containing categorized + failure clusters with root causes and recommendations. + """ + user_intent_result: UserIntentClusteringResultContent | None = ... + """ + The user intent clustering results from insights, containing grouped + user intents across evaluated sessions. + """ + execution_summary_result: ExecutionSummaryClusteringResultContent | None = ... + """ + The execution summary clustering results from insights, containing + grouped execution patterns across evaluated sessions. + """ + error_details: list[str] | None = ... + """The error details if the batch evaluation encountered failures.""" + description: str | None = ... + """The description of the batch evaluation.""" + updated_at: datetime | None = ... + """The timestamp when the batch evaluation was last updated.""" + kms_key_arn: str | None = ... + """The ARN of the KMS key used to encrypt evaluation data.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetBrowserSessionInput(_SerdeShape): + """Dataclass for GetBrowserSessionInput structure.""" + + browser_identifier: str | None = ... + """The unique identifier of the browser associated with the session.""" + session_id: str | None = ... + """The unique identifier of the browser session to retrieve.""" + +@dataclass(kw_only=True) +class GetBrowserSessionOutput(_SerdeShape): + """Dataclass for GetBrowserSessionOutput structure.""" + + browser_identifier: str + """The identifier of the browser.""" + session_id: str + """The identifier of the browser session.""" + name: str | None = ... + """The name of the browser session.""" + created_at: datetime + """The time at which the browser session was created.""" + view_port: ViewPort | None = ... + """ + The configuration that defines the dimensions of a browser viewport in a + browser session. The viewport determines the visible area of web content + and affects how web pages are rendered and displayed. Proper viewport + configuration ensures that web content is displayed correctly for the + agent's browsing tasks. + """ + extensions: list[BrowserExtension] | None = ... + """ + The list of browser extensions that are configured in the browser + session. + """ + enterprise_policies: list[BrowserEnterprisePolicy] | None = ... + """A list of files containing enterprise policies for the browser session.""" + profile_configuration: BrowserProfileConfiguration | None = ... + """ + The browser profile configuration associated with this session. Contains + the profile identifier that links to persistent browser data such as + cookies and local storage. + """ + session_timeout_seconds: int | None = ... + """The timeout period for the browser session in seconds.""" + status: str | None = ... + """ + The current status of the browser session. Possible values include + ACTIVE, STOPPING, and STOPPED. + """ + streams: BrowserSessionStream | None = ... + """ + The streams associated with this browser session. These include the + automation stream and live view stream. + """ + proxy_configuration: ProxyConfiguration | None = ... + """ + The active proxy configuration for this browser session. This field is + only present if proxy configuration was provided when the session was + started using `StartBrowserSession`. The configuration includes proxy + servers, domain bypass rules and the proxy authentication credentials. + """ + certificates: list[Certificate] | None = ... + """The list of certificates installed in the browser session.""" + filesystem_configurations: list[ToolsFileSystemConfiguration] | None = ... + """ + The file system configurations for the browser session. Each entry + describes an access point and its mount path. + """ + session_replay_artifact: str | None = ... + """The artifact containing the session replay information.""" + last_updated_at: datetime | None = ... + """The time at which the browser session was last updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetCodeInterpreterSessionInput(_SerdeShape): + """Dataclass for GetCodeInterpreterSessionInput structure.""" + + code_interpreter_identifier: str | None = ... + """ + The unique identifier of the code interpreter associated with the + session. + """ + session_id: str | None = ... + """The unique identifier of the code interpreter session to retrieve.""" + +@dataclass(kw_only=True) +class GetCodeInterpreterSessionOutput(_SerdeShape): + """Dataclass for GetCodeInterpreterSessionOutput structure.""" + + code_interpreter_identifier: str + """The identifier of the code interpreter.""" + session_id: str + """The identifier of the code interpreter session.""" + name: str | None = ... + """The name of the code interpreter session.""" + created_at: datetime + """The time at which the code interpreter session was created.""" + session_timeout_seconds: int | None = ... + """The timeout period for the code interpreter session in seconds.""" + status: str | None = ... + """ + The current status of the code interpreter session. Possible values + include ACTIVE, STOPPING, and STOPPED. + """ + certificates: list[Certificate] | None = ... + """The list of certificates installed in the code interpreter session.""" + filesystem_configurations: list[ToolsFileSystemConfiguration] | None = ... + """ + The file system configurations for the code interpreter session. Each + entry describes an access point and its mount path. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetEventInput(_SerdeShape): + """Dataclass for GetEventInput structure.""" + + memory_id: str | None = ... + """The identifier of the AgentCore Memory resource containing the event.""" + session_id: str | None = ... + """The identifier of the session containing the event.""" + actor_id: str | None = ... + """The identifier of the actor associated with the event.""" + event_id: str | None = ... + """The identifier of the event to retrieve.""" + +@dataclass(kw_only=True) +class GetEventOutput(_SerdeShape): + """Dataclass for GetEventOutput structure.""" + + event: Event + """The requested event information.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetMemoryRecordInput(_SerdeShape): + """Dataclass for GetMemoryRecordInput structure.""" + + memory_id: str | None = ... + """ + The identifier of the AgentCore Memory resource containing the memory + record. + """ + memory_record_id: str | None = ... + """The identifier of the memory record to retrieve.""" + namespace: str | None = ... + """ + The namespace of the memory record to retrieve. This value is used for + IAM condition key authorization. + """ + +@dataclass(kw_only=True) +class GetMemoryRecordOutput(_SerdeShape): + """Dataclass for GetMemoryRecordOutput structure.""" + + memory_record: MemoryRecord + """The requested memory record.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetPaymentInstrumentBalanceInput(_SerdeShape): + """Request structure for getting payment instrument balance.""" + + user_id: str | None = ... + """The user ID associated with this payment instrument.""" + agent_name: str | None = ... + """The agent name associated with this request, used for observability.""" + payment_manager_arn: str | None = ... + """The ARN of the payment manager that owns this payment instrument.""" + payment_connector_id: str | None = ... + """The ID of the payment connector associated with this instrument.""" + payment_instrument_id: str | None = ... + """The ID of the payment instrument to query balance for.""" + chain: str | None = ... + """ + The specific blockchain chain to query balance on. Required because + balances are chain-specific. + """ + token: str | None = ... + """ + The token to query balance for. Only tokens supported for X402 payments + are returned. + """ + +@dataclass(kw_only=True) +class GetPaymentInstrumentBalanceOutput(_SerdeShape): + """Response structure for getting payment instrument balance.""" + + payment_instrument_id: str + """The ID of the payment instrument.""" + token_balance: TokenBalance + """The balance of the supported token on the requested chain.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetPaymentInstrumentInput(_SerdeShape): + """Request structure for getting a payment instrument.""" + + user_id: str | None = ... + """The user ID associated with this payment instrument.""" + agent_name: str | None = ... + """The agent name associated with this request, used for observability.""" + payment_manager_arn: str | None = ... + """The ARN of the payment manager that owns this payment instrument.""" + payment_connector_id: str | None = ... + """The ID of the payment connector.""" + payment_instrument_id: str | None = ... + """The ID of the payment instrument to retrieve.""" + +@dataclass(kw_only=True) +class GetPaymentInstrumentOutput(_SerdeShape): + """Response structure for getting a payment instrument.""" + + payment_instrument: PaymentInstrument + """The payment instrument details.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetPaymentSessionInput(_SerdeShape): + """Request structure for getting a payment session.""" + + user_id: str | None = ... + """The user ID associated with this payment session.""" + agent_name: str | None = ... + """The agent name associated with this request, used for observability.""" + payment_manager_arn: str | None = ... + """The ARN of the payment manager that owns this session.""" + payment_session_id: str | None = ... + """The ID of the payment session to retrieve.""" + +@dataclass(kw_only=True) +class GetPaymentSessionOutput(_SerdeShape): + """Response structure for getting a payment session.""" + + payment_session: PaymentSession + """The payment session details.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetRecommendationInput(_SerdeShape): + """Dataclass for GetRecommendationInput structure.""" + + recommendation_id: str | None = ... + """The unique identifier of the recommendation to retrieve.""" + +@dataclass(kw_only=True) +class GetRecommendationOutput(_SerdeShape): + """Dataclass for GetRecommendationOutput structure.""" + + recommendation_id: str + """The unique identifier of the recommendation.""" + recommendation_arn: str + """The Amazon Resource Name (ARN) of the recommendation.""" + name: str + """The name of the recommendation.""" + description: str | None = ... + """The description of the recommendation.""" + type: str + """The type of recommendation.""" + recommendation_config: RecommendationConfig + """The configuration for the recommendation.""" + status: str + """The current status of the recommendation.""" + created_at: datetime + """The timestamp when the recommendation was created.""" + updated_at: datetime + """The timestamp when the recommendation was last updated.""" + recommendation_result: RecommendationResult | None = ... + """ + The result of the recommendation, containing the optimized system prompt + or tool descriptions. Only present when the recommendation status is + `COMPLETED`. + """ + kms_key_arn: str | None = ... + """The ARN of the KMS key used to encrypt recommendation data.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetResourceApiKeyInput(_SerdeShape): + """Dataclass for GetResourceApiKeyInput structure.""" + + workload_identity_token: str | None = ... + """ + The identity token of the workload from which you want to retrieve the + API key. + """ + resource_credential_provider_name: str | None = ... + """ + The credential provider name for the resource from which you are + retrieving the API key. + """ + +@dataclass(kw_only=True) +class GetResourceApiKeyOutput(_SerdeShape): + """Dataclass for GetResourceApiKeyOutput structure.""" + + api_key: str + """The API key associated with the resource requested.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetResourceOauth2TokenInput(_SerdeShape): + """Dataclass for GetResourceOauth2TokenInput structure.""" + + workload_identity_token: str | None = ... + """ + The identity token of the workload from which you want to retrieve the + OAuth2 token. + """ + resource_credential_provider_name: str | None = ... + """The name of the resource's credential provider.""" + scopes: list[str] | None = ... + """The OAuth scopes being requested.""" + oauth2_flow: str | None = ... + """The type of flow to be performed.""" + session_uri: str | None = ... + """ + Unique identifier for the user's authentication session for retrieving + OAuth2 tokens. This ID tracks the authorization flow state across + multiple requests and responses during the OAuth2 authentication + process. + """ + resource_oauth2_return_url: str | None = ... + """ + The callback URL to redirect to after the OAuth 2.0 token retrieval is + complete. This URL must be one of the provided URLs configured for the + workload identity. + """ + force_authentication: bool | None = ... + """ + Indicates whether to always initiate a new three-legged OAuth (3LO) + flow, regardless of any existing session. + """ + custom_parameters: dict[str, str] | None = ... + """ + A map of custom parameters to include in the authorization request to + the resource credential provider. These parameters are in addition to + the standard OAuth 2.0 flow parameters, and will not override them. + """ + custom_state: str | None = ... + """ + An opaque string that will be sent back to the callback URL provided in + resourceOauth2ReturnUrl. This state should be used to protect the + callback URL of your application against CSRF attacks by ensuring the + response corresponds to the original request. + """ + resources: list[str] | None = ... + """ + The resources to include in the token request. These are used to specify + the target resources for which the OAuth2 token is being requested. + """ + audiences: list[str] | None = ... + """ + The audiences to include in the token request. These are used to specify + the intended recipients of the OAuth2 token. + """ + +@dataclass(kw_only=True) +class GetResourceOauth2TokenOutput(_SerdeShape): + """Dataclass for GetResourceOauth2TokenOutput structure.""" + + authorization_url: str | None = ... + """ + The URL to initiate the authorization process, provided when the access + token requires user authorization. + """ + access_token: str | None = ... + """The OAuth 2.0 access token to use.""" + session_uri: str | None = ... + """ + Unique identifier for the user's authorization session for retrieving + OAuth2 tokens. This matches the sessionId from the request and can be + used to track the session state. + """ + session_status: str | None = ... + """ + Status indicating whether the user's authorization session is in + progress or has failed. This helps determine the next steps in the + OAuth2 authentication flow. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetResourcePaymentTokenInput(_SerdeShape): + """Dataclass for GetResourcePaymentTokenInput structure.""" + + workload_identity_token: str | None = ... + """Workload access token for authorization.""" + resource_credential_provider_name: str | None = ... + """Name of the payment credential provider to use.""" + payment_token_request: PaymentTokenRequestInput | None = ... + """ + Vendor-specific token request input. Contains all request parameters in + a type-safe, vendor-specific structure. + """ + +@dataclass(kw_only=True) +class GetResourcePaymentTokenOutput(_SerdeShape): + """Dataclass for GetResourcePaymentTokenOutput structure.""" + + payment_token_response: PaymentTokenResponseOutput + """ + Vendor-specific token response output. Contains all response data in a + type-safe, vendor-specific structure. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetWorkloadAccessTokenForJWTInput(_SerdeShape): + """Dataclass for GetWorkloadAccessTokenForJWTInput structure.""" + + workload_name: str | None = ... + """The unique identifier for the registered workload.""" + user_token: str | None = ... + """The OAuth 2.0 token issued by the user's identity provider.""" + +@dataclass(kw_only=True) +class GetWorkloadAccessTokenForJWTOutput(_SerdeShape): + """Dataclass for GetWorkloadAccessTokenForJWTOutput structure.""" + + workload_access_token: str + """ + An opaque token representing the identity of both the workload and the + user. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetWorkloadAccessTokenForUserIdInput(_SerdeShape): + """Dataclass for GetWorkloadAccessTokenForUserIdInput structure.""" + + workload_name: str | None = ... + """ + The name of the workload from which you want to retrieve the access + token. + """ + user_id: str | None = ... + """The ID of the user for whom you are retrieving the access token.""" + +@dataclass(kw_only=True) +class GetWorkloadAccessTokenForUserIdOutput(_SerdeShape): + """Dataclass for GetWorkloadAccessTokenForUserIdOutput structure.""" + + workload_access_token: str + """The access token for the specified workload.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetWorkloadAccessTokenInput(_SerdeShape): + """Dataclass for GetWorkloadAccessTokenInput structure.""" + + workload_name: str | None = ... + """The unique identifier for the registered workload.""" + +@dataclass(kw_only=True) +class GetWorkloadAccessTokenOutput(_SerdeShape): + """Dataclass for GetWorkloadAccessTokenOutput structure.""" + + workload_access_token: str + """ + An opaque token representing the identity of both the workload and the + user. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass +class GroundTruthSourceInline(_SerdeShape): + """Inline ground truth data provided directly in the request.""" + + value: InlineGroundTruth + +@dataclass +class GroundTruthSourceUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +GroundTruthSource = Union[GroundTruthSourceInline | GroundTruthSourceUnknown] +"""Where to pull ground truth from.""" + +class _GroundTruthSourceDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> GroundTruthSource: ... + +@dataclass(kw_only=True) +class GroundTruthTurn(_SerdeShape): + """Ground truth data for a single conversation turn.""" + + input: GroundTruthTurnInput | None = ... + """The input for this conversation turn.""" + expected_response: EvaluationContent | None = ... + """The expected response for this conversation turn.""" + +@dataclass +class GroundTruthTurnInputPrompt(_SerdeShape): + """The text prompt for this conversation turn.""" + + value: str + +@dataclass +class GroundTruthTurnInputUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +GroundTruthTurnInput = Union[GroundTruthTurnInputPrompt | GroundTruthTurnInputUnknown] +"""The input for a ground truth conversation turn.""" + +class _GroundTruthTurnInputDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> GroundTruthTurnInput: ... + +@dataclass(kw_only=True) +class HarnessAgentCoreBrowserConfig(_SerdeShape): + """Configuration for AgentCore Browser.""" + + browser_arn: str | None = ... + """If not populated, the built-in Browser ARN is used.""" + +@dataclass(kw_only=True) +class HarnessAgentCoreCodeInterpreterConfig(_SerdeShape): + """Configuration for AgentCore Code Interpreter.""" + + code_interpreter_arn: str | None = ... + """If not populated, the built-in Code Interpreter ARN is used.""" + +@dataclass(kw_only=True) +class HarnessAgentCoreGatewayConfig(_SerdeShape): + """Configuration for AgentCore Gateway.""" + + gateway_arn: str + """The ARN of the desired AgentCore Gateway.""" + outbound_auth: HarnessGatewayOutboundAuth | None = ... + """ + How harness authenticates to this Gateway. Defaults to AWS_IAM (SigV4) + if omitted. + """ + +class HarnessBedrockApiFormat(UnknownEnumMixin, StrEnum): + CONVERSE_STREAM = "converse_stream" + """Use the Bedrock Converse Stream API format.""" + RESPONSES = "responses" + """Use the Responses API format.""" + CHAT_COMPLETIONS = "chat_completions" + """Use the Chat Completions API format.""" + +@dataclass(kw_only=True) +class HarnessBedrockModelConfig(_SerdeShape): + """Configuration for an Amazon Bedrock model provider.""" + + model_id: str + """The Bedrock model ID.""" + max_tokens: int | None = ... + """ + The maximum number of tokens to allow in the generated response per + iteration. + """ + temperature: float | None = ... + """The temperature to set when calling the model.""" + top_p: float | None = ... + """The topP set when calling the model.""" + api_format: str | None = ... + """The API format to use when calling the Bedrock provider.""" + additional_params: Document | None = ... + """ + Provider-specific parameters passed through to the model provider + unchanged. + """ + +@dataclass +class HarnessContentBlockText(_SerdeShape): + """Text content.""" + + value: str + +@dataclass +class HarnessContentBlockToolUse(_SerdeShape): + """A tool use request from the model.""" + + value: HarnessToolUseBlock + +@dataclass +class HarnessContentBlockToolResult(_SerdeShape): + """A tool execution result.""" + + value: HarnessToolResultBlock + +@dataclass +class HarnessContentBlockReasoningContent(_SerdeShape): + """Model reasoning content.""" + + value: HarnessReasoningContentBlock + +@dataclass +class HarnessContentBlockUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +HarnessContentBlock = Union[ + HarnessContentBlockText + | HarnessContentBlockToolUse + | HarnessContentBlockToolResult + | HarnessContentBlockReasoningContent + | HarnessContentBlockUnknown +] +"""A content block within a message.""" + +class _HarnessContentBlockDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> HarnessContentBlock: ... + +@dataclass +class HarnessContentBlockDeltaText(_SerdeShape): + """A text delta.""" + + value: str + +@dataclass +class HarnessContentBlockDeltaToolUse(_SerdeShape): + """A tool use input delta.""" + + value: HarnessToolUseBlockDelta + +@dataclass +class HarnessContentBlockDeltaToolResult(_SerdeShape): + """A tool result delta.""" + + value: list[HarnessToolResultBlockDelta] + +@dataclass +class HarnessContentBlockDeltaReasoningContent(_SerdeShape): + """A reasoning content delta.""" + + value: HarnessReasoningContentBlockDelta + +@dataclass +class HarnessContentBlockDeltaToolResultMetadata(_SerdeShape): + """A tool result metadata delta.""" + + value: HarnessToolResultMetadataBlockDelta + +@dataclass +class HarnessContentBlockDeltaUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +HarnessContentBlockDelta = Union[ + HarnessContentBlockDeltaText + | HarnessContentBlockDeltaToolUse + | HarnessContentBlockDeltaToolResult + | HarnessContentBlockDeltaReasoningContent + | HarnessContentBlockDeltaToolResultMetadata + | HarnessContentBlockDeltaUnknown +] +"""A delta update to a content block.""" + +class _HarnessContentBlockDeltaDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> HarnessContentBlockDelta: ... + +@dataclass(kw_only=True) +class HarnessContentBlockDeltaEvent(_SerdeShape): + """Event containing a delta update to a content block.""" + + content_block_index: int + """The index of the content block being updated.""" + delta: HarnessContentBlockDelta + """The delta payload.""" + +@dataclass +class HarnessContentBlockStartToolUse(_SerdeShape): + """Start of a tool use content block.""" + + value: HarnessToolUseBlockStart + +@dataclass +class HarnessContentBlockStartToolResult(_SerdeShape): + """Start of a tool result content block.""" + + value: HarnessToolResultBlockStart + +@dataclass +class HarnessContentBlockStartUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +HarnessContentBlockStart = Union[ + HarnessContentBlockStartToolUse + | HarnessContentBlockStartToolResult + | HarnessContentBlockStartUnknown +] +"""The start payload for a content block.""" + +class _HarnessContentBlockStartDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> HarnessContentBlockStart: ... + +@dataclass(kw_only=True) +class HarnessContentBlockStartEvent(_SerdeShape): + """Event indicating the start of a content block.""" + + content_block_index: int + """The index of the content block within the message.""" + start: HarnessContentBlockStart + """The content block start payload.""" + +@dataclass(kw_only=True) +class HarnessContentBlockStopEvent(_SerdeShape): + """Event indicating the end of a content block.""" + + content_block_index: int + """The index of the content block that ended.""" + +class HarnessConversationRole(UnknownEnumMixin, StrEnum): + USER = "user" + ASSISTANT = "assistant" + +@dataclass +class HarnessGatewayOutboundAuthAwsIam(_SerdeShape): + """SigV4-sign requests using the agent's execution role.""" + + value: Unit + +@dataclass +class HarnessGatewayOutboundAuthNone(_SerdeShape): + """No authentication.""" + + value: Unit + +@dataclass +class HarnessGatewayOutboundAuthOauth(_SerdeShape): + """OAuth 2.0 authentication via AgentCore Identity.""" + + value: OAuthCredentialProvider + +@dataclass +class HarnessGatewayOutboundAuthUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +HarnessGatewayOutboundAuth = Union[ + HarnessGatewayOutboundAuthAwsIam + | HarnessGatewayOutboundAuthNone + | HarnessGatewayOutboundAuthOauth + | HarnessGatewayOutboundAuthUnknown +] +"""Authentication method for calling a Gateway.""" + +class _HarnessGatewayOutboundAuthDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> HarnessGatewayOutboundAuth: ... + +@dataclass(kw_only=True) +class HarnessGeminiModelConfig(_SerdeShape): + """ + Configuration for a Google Gemini model provider. Requires an API key + stored in AgentCore Identity. + """ + + model_id: str + """The Gemini model ID.""" + api_key_arn: str + """The ARN of your Gemini API key on AgentCore Identity.""" + max_tokens: int | None = ... + """ + The maximum number of tokens to allow in the generated response per + iteration. + """ + temperature: float | None = ... + """The temperature to set when calling the model.""" + top_p: float | None = ... + """The topP set when calling the model.""" + top_k: int | None = ... + """The topK set when calling the model.""" + additional_params: Document | None = ... + """ + Provider-specific parameters passed through to the Gemini model provider + unchanged. + """ + +class HarnessHookDecision(UnknownEnumMixin, StrEnum): + ALLOW = "allow" + DENY = "deny" + +@dataclass(kw_only=True) +class HarnessHookEvent(_SerdeShape): + """ + A lifecycle hook event emitted in the invocation stream for visibility + into hook decisions. + """ + + hook_event_id: str + """The unique identifier for this hook event.""" + name: str + """The name of the hook that ran.""" + type: str + """The type of lifecycle hook event.""" + decision: str | None = ... + """ + The decision applied to the hook event. This field is present only for + blocking Lambda targets. + """ + reason: str | None = ... + """The optional reason for the applied decision.""" + +class HarnessHookEventType(UnknownEnumMixin, StrEnum): + BEFORE_TOOL_CALL = "before_tool_call" + AFTER_TOOL_CALL = "after_tool_call" + BEFORE_INVOCATION = "before_invocation" + AFTER_INVOCATION = "after_invocation" + +@dataclass(kw_only=True) +class HarnessInlineFunctionConfig(_SerdeShape): + """ + Configuration for an inline function tool. When the agent calls this + tool, the tool call is returned to the caller for external execution. + """ + + description: str + """Description of what the tool does, provided to the model.""" + input_schema: Document + """JSON Schema describing the tool's input parameters.""" + +@dataclass(kw_only=True) +class HarnessLiteLlmModelConfig(_SerdeShape): + """ + Configuration for a LiteLLM model provider, enabling connection to + third-party model providers. + """ + + model_id: str + """The LiteLLM model identifier (e.g., \"anthropic/claude-3-sonnet\").""" + api_key_arn: str | None = ... + """ + The ARN of the API key in AgentCore Identity for authenticating with the + model provider. + """ + api_base: str | None = ... + """The base URL for the model provider's API endpoint.""" + max_tokens: int | None = ... + """ + The maximum number of tokens to allow in the generated response per + iteration. + """ + temperature: float | None = ... + """The temperature to set when calling the model.""" + top_p: float | None = ... + """The topP set when calling the model.""" + additional_params: Document | None = ... + """ + Provider-specific parameters passed through to the model provider + unchanged. + """ + +@dataclass(kw_only=True) +class HarnessMessage(_SerdeShape): + """A message in the conversation.""" + + role: str + """The role of the message sender.""" + content: list[HarnessContentBlock] + """The content blocks of the message.""" + +@dataclass(kw_only=True) +class HarnessMessageStartEvent(_SerdeShape): + """Event indicating the start of a message.""" + + role: str + """The role of the message sender.""" + +@dataclass(kw_only=True) +class HarnessMessageStopEvent(_SerdeShape): + """Event indicating the end of a message.""" + + stop_reason: str + """The reason the agent stopped generating.""" + +@dataclass(kw_only=True) +class HarnessMetadataEvent(_SerdeShape): + """Token usage and latency metrics for the invocation.""" + + usage: HarnessTokenUsage + """Token usage counts.""" + metrics: HarnessStreamMetrics + """Latency metrics.""" + +@dataclass +class HarnessModelConfigurationBedrockModelConfig(_SerdeShape): + """Configuration for an Amazon Bedrock model.""" + + value: HarnessBedrockModelConfig + +@dataclass +class HarnessModelConfigurationOpenAiModelConfig(_SerdeShape): + """Configuration for an OpenAI model.""" + + value: HarnessOpenAiModelConfig + +@dataclass +class HarnessModelConfigurationGeminiModelConfig(_SerdeShape): + """Configuration for a Google Gemini model.""" + + value: HarnessGeminiModelConfig + +@dataclass +class HarnessModelConfigurationLiteLlmModelConfig(_SerdeShape): + """ + The LiteLLM model configuration for connecting to third-party model + providers. + """ + + value: HarnessLiteLlmModelConfig + +@dataclass +class HarnessModelConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +HarnessModelConfiguration = Union[ + HarnessModelConfigurationBedrockModelConfig + | HarnessModelConfigurationOpenAiModelConfig + | HarnessModelConfigurationGeminiModelConfig + | HarnessModelConfigurationLiteLlmModelConfig + | HarnessModelConfigurationUnknown +] +"""Specification of which model to use.""" + +class _HarnessModelConfigurationDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> HarnessModelConfiguration: ... + +class HarnessOpenAiApiFormat(UnknownEnumMixin, StrEnum): + CHAT_COMPLETIONS = "chat_completions" + """Use the Chat Completions API format.""" + RESPONSES = "responses" + """Use the Responses API format.""" + +@dataclass(kw_only=True) +class HarnessOpenAiModelConfig(_SerdeShape): + """ + Configuration for an OpenAI model provider. Requires an API key stored + in AgentCore Identity. + """ + + model_id: str + """The OpenAI model ID.""" + api_key_arn: str + """The ARN of your OpenAI API key on AgentCore Identity.""" + api_base: str | None = ... + """Optional custom endpoint URL for an OpenAI-compatible endpoint.""" + max_tokens: int | None = ... + """ + The maximum number of tokens to allow in the generated response per + iteration. + """ + temperature: float | None = ... + """The temperature to set when calling the model.""" + top_p: float | None = ... + """The topP set when calling the model.""" + api_format: str | None = ... + """The API format to use when calling the OpenAI provider.""" + additional_params: Document | None = ... + """ + Provider-specific parameters passed through to the model provider + unchanged. + """ + +@dataclass +class HarnessReasoningContentBlockReasoningText(_SerdeShape): + """The reasoning text.""" + + value: HarnessReasoningTextBlock + +@dataclass +class HarnessReasoningContentBlockRedactedContent(_SerdeShape): + """Redacted reasoning content.""" + + value: bytes + +@dataclass +class HarnessReasoningContentBlockUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +HarnessReasoningContentBlock = Union[ + HarnessReasoningContentBlockReasoningText + | HarnessReasoningContentBlockRedactedContent + | HarnessReasoningContentBlockUnknown +] +"""Reasoning content from the model.""" + +class _HarnessReasoningContentBlockDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> HarnessReasoningContentBlock: ... + +@dataclass +class HarnessReasoningContentBlockDeltaText(_SerdeShape): + """Reasoning text delta.""" + + value: str + +@dataclass +class HarnessReasoningContentBlockDeltaRedactedContent(_SerdeShape): + """Redacted reasoning content.""" + + value: bytes + +@dataclass +class HarnessReasoningContentBlockDeltaSignature(_SerdeShape): + """Signature for the reasoning content.""" + + value: str + +@dataclass +class HarnessReasoningContentBlockDeltaUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +HarnessReasoningContentBlockDelta = Union[ + HarnessReasoningContentBlockDeltaText + | HarnessReasoningContentBlockDeltaRedactedContent + | HarnessReasoningContentBlockDeltaSignature + | HarnessReasoningContentBlockDeltaUnknown +] +"""A delta update to a reasoning content block.""" + +class _HarnessReasoningContentBlockDeltaDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> HarnessReasoningContentBlockDelta: ... + +@dataclass(kw_only=True) +class HarnessReasoningTextBlock(_SerdeShape): + """A block of reasoning text from the model.""" + + text: str + """The reasoning text.""" + signature: str | None = ... + """Signature for verifying the reasoning content.""" + +@dataclass(kw_only=True) +class HarnessRemoteMcpConfig(_SerdeShape): + """Configuration for connecting to a remote MCP server.""" + + url: str + """URL of the MCP endpoint.""" + headers: dict[str, str] | None = ... + """Custom headers to include when connecting to the remote MCP server.""" + +@dataclass +class HarnessSkillPath(_SerdeShape): + """The filesystem path to the skill definition.""" + + value: str + +@dataclass +class HarnessSkillS3(_SerdeShape): + """An S3 source containing the skill.""" + + value: HarnessSkillS3Source + +@dataclass +class HarnessSkillGit(_SerdeShape): + """A git repository containing the skill.""" + + value: HarnessSkillGitSource + +@dataclass +class HarnessSkillAwsSkills(_SerdeShape): + """AWS Skills baked into the Harness's underlying Runtime.""" + + value: HarnessSkillAwsSkillsSource + +@dataclass +class HarnessSkillUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +HarnessSkill = Union[ + HarnessSkillPath + | HarnessSkillS3 + | HarnessSkillGit + | HarnessSkillAwsSkills + | HarnessSkillUnknown +] +"""A skill available to the agent.""" + +class _HarnessSkillDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> HarnessSkill: ... + +@dataclass(kw_only=True) +class HarnessSkillAwsSkillsSource(_SerdeShape): + """Passed to show that AWS Skills should be included.""" + + paths: list[str] | None = ... + """ + Optionally filter allowed skills with glob syntax, e.g., + ['core-skills/*']. + """ + +@dataclass(kw_only=True) +class HarnessSkillGitAuth(_SerdeShape): + """Authentication configuration for accessing a private git repository.""" + + credential_arn: str + """ + The ARN of the credential in AgentCore Identity containing the password + or personal access token. + """ + username: str | None = ... + """Username for authentication. Defaults to 'oauth2' if not specified.""" + +@dataclass(kw_only=True) +class HarnessSkillGitSource(_SerdeShape): + """A git repository source for a skill.""" + + url: str + """The HTTPS URL of the git repository.""" + path: str | None = ... + """Subdirectory within the repository containing the skill.""" + auth: HarnessSkillGitAuth | None = ... + """Authentication configuration for private repositories.""" + +@dataclass(kw_only=True) +class HarnessSkillS3Source(_SerdeShape): + """An S3 source for a skill.""" + + uri: str + """ + The S3 URI pointing to the skill directory (e.g., + s3://bucket/skills/my-skill/). + """ + +class HarnessStopReason(UnknownEnumMixin, StrEnum): + END_TURN = "end_turn" + TOOL_USE = "tool_use" + TOOL_RESULT = "tool_result" + MAX_TOKENS = "max_tokens" + STOP_SEQUENCE = "stop_sequence" + CONTENT_FILTERED = "content_filtered" + MALFORMED_MODEL_OUTPUT = "malformed_model_output" + MALFORMED_TOOL_USE = "malformed_tool_use" + INTERRUPTED = "interrupted" + PARTIAL_TURN = "partial_turn" + MODEL_CONTEXT_WINDOW_EXCEEDED = "model_context_window_exceeded" + MAX_ITERATIONS_EXCEEDED = "max_iterations_exceeded" + MAX_OUTPUT_TOKENS_EXCEEDED = "max_output_tokens_exceeded" + TIMEOUT_EXCEEDED = "timeout_exceeded" + HOOK_STOPPED = "hook_stopped" + +@dataclass(kw_only=True) +class HarnessStreamMetrics(_SerdeShape): + """Latency metrics for the invocation.""" + + latency_ms: int + """The end-to-end latency of the invocation in milliseconds.""" + +@dataclass +class HarnessSystemContentBlockText(_SerdeShape): + """The text content of the system prompt block.""" + + value: str + +@dataclass +class HarnessSystemContentBlockUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +HarnessSystemContentBlock = Union[ + HarnessSystemContentBlockText | HarnessSystemContentBlockUnknown +] +"""A content block in the system prompt.""" + +class _HarnessSystemContentBlockDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> HarnessSystemContentBlock: ... + +@dataclass(kw_only=True) +class HarnessTokenUsage(_SerdeShape): + """Token usage counts for the invocation.""" + + input_tokens: int + """The number of input tokens consumed.""" + output_tokens: int + """The number of output tokens generated.""" + total_tokens: int + """The total number of tokens consumed.""" + cache_read_input_tokens: int | None = ... + """The number of input tokens read from cache.""" + cache_write_input_tokens: int | None = ... + """The number of input tokens written to cache.""" + +@dataclass(kw_only=True) +class HarnessTool(_SerdeShape): + """A tool available to the agent loop.""" + + type: str + """The type of tool.""" + name: str | None = ... + """ + Unique name for the tool. If not provided, a name will be inferred or + generated. + """ + config: HarnessToolConfiguration | None = ... + """Tool-specific configuration.""" + +@dataclass +class HarnessToolConfigurationRemoteMcp(_SerdeShape): + """Configuration for remote MCP server.""" + + value: HarnessRemoteMcpConfig + +@dataclass +class HarnessToolConfigurationAgentCoreBrowser(_SerdeShape): + """Configuration for AgentCore Browser.""" + + value: HarnessAgentCoreBrowserConfig + +@dataclass +class HarnessToolConfigurationAgentCoreGateway(_SerdeShape): + """Configuration for AgentCore Gateway.""" + + value: HarnessAgentCoreGatewayConfig + +@dataclass +class HarnessToolConfigurationInlineFunction(_SerdeShape): + """Configuration for an inline function tool.""" + + value: HarnessInlineFunctionConfig + +@dataclass +class HarnessToolConfigurationAgentCoreCodeInterpreter(_SerdeShape): + """Configuration for AgentCore Code Interpreter.""" + + value: HarnessAgentCoreCodeInterpreterConfig + +@dataclass +class HarnessToolConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +HarnessToolConfiguration = Union[ + HarnessToolConfigurationRemoteMcp + | HarnessToolConfigurationAgentCoreBrowser + | HarnessToolConfigurationAgentCoreGateway + | HarnessToolConfigurationInlineFunction + | HarnessToolConfigurationAgentCoreCodeInterpreter + | HarnessToolConfigurationUnknown +] +"""Configuration union for different tool types.""" + +class _HarnessToolConfigurationDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> HarnessToolConfiguration: ... + +@dataclass(kw_only=True) +class HarnessToolResultBlock(_SerdeShape): + """The result of a tool execution.""" + + tool_use_id: str + """The tool use ID that this result corresponds to.""" + content: list[HarnessToolResultContentBlock] + """The content of the tool result.""" + status: str | None = ... + """The status of the tool execution.""" + type: str | None = ... + """The type of tool use that produced this result.""" + +@dataclass +class HarnessToolResultBlockDeltaText(_SerdeShape): + """A text tool result delta.""" + + value: str + +@dataclass +class HarnessToolResultBlockDeltaJson(_SerdeShape): + """A JSON tool result delta.""" + + value: Document + +@dataclass +class HarnessToolResultBlockDeltaUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +HarnessToolResultBlockDelta = Union[ + HarnessToolResultBlockDeltaText + | HarnessToolResultBlockDeltaJson + | HarnessToolResultBlockDeltaUnknown +] +"""A delta update to a tool result content block.""" + +class _HarnessToolResultBlockDeltaDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> HarnessToolResultBlockDelta: ... + +@dataclass(kw_only=True) +class HarnessToolResultBlockStart(_SerdeShape): + """Start payload for a tool result content block.""" + + tool_use_id: str + """The tool use ID that this result corresponds to.""" + status: str | None = ... + """The status of the tool execution.""" + +@dataclass +class HarnessToolResultContentBlockText(_SerdeShape): + """Text content.""" + + value: str + +@dataclass +class HarnessToolResultContentBlockJson(_SerdeShape): + """JSON content.""" + + value: Document + +@dataclass +class HarnessToolResultContentBlockUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +HarnessToolResultContentBlock = Union[ + HarnessToolResultContentBlockText + | HarnessToolResultContentBlockJson + | HarnessToolResultContentBlockUnknown +] +"""A content block within a tool result.""" + +class _HarnessToolResultContentBlockDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> HarnessToolResultContentBlock: ... + +@dataclass(kw_only=True) +class HarnessToolResultMetadataBlockDelta(_SerdeShape): + """Delta payload for a tool result metadata.""" + + metadata: str + """The partial JSON-string fragment of the tool result metadata.""" + +class HarnessToolType(UnknownEnumMixin, StrEnum): + REMOTE_MCP = "remote_mcp" + AGENTCORE_BROWSER = "agentcore_browser" + AGENTCORE_GATEWAY = "agentcore_gateway" + INLINE_FUNCTION = "inline_function" + AGENTCORE_CODE_INTERPRETER = "agentcore_code_interpreter" + +@dataclass(kw_only=True) +class HarnessToolUseBlock(_SerdeShape): + """A tool use request from the model.""" + + name: str + """The name of the tool to call.""" + tool_use_id: str + """The unique ID of this tool use.""" + input: Document + """The JSON input to pass to the tool.""" + type: str | None = ... + """The type of tool use.""" + server_name: str | None = ... + """The name of the MCP server providing this tool.""" + +@dataclass(kw_only=True) +class HarnessToolUseBlockDelta(_SerdeShape): + """Delta payload for tool use input.""" + + input: str + """The partial JSON input for the tool call.""" + +@dataclass(kw_only=True) +class HarnessToolUseBlockStart(_SerdeShape): + """Start payload for a tool use content block.""" + + tool_use_id: str + """The unique ID of this tool use.""" + name: str + """The name of the tool being called.""" + type: str | None = ... + """The type of tool use.""" + server_name: str | None = ... + """The name of the MCP server providing this tool.""" + +class HarnessToolUseStatus(UnknownEnumMixin, StrEnum): + SUCCESS = "success" + ERROR = "error" + +class HarnessToolUseType(UnknownEnumMixin, StrEnum): + TOOL_USE = "tool_use" + SERVER_TOOL_USE = "server_tool_use" + MCP_TOOL_USE = "mcp_tool_use" + +@dataclass(kw_only=True) +class IngestDataInput(_SerdeShape): + """Dataclass for IngestDataInput structure.""" + + memory_id: str | None = ... + """The identifier of the AgentCore Memory resource to ingest content into.""" + source: ContentSource | None = ... + """The content to ingest. Only inline content is supported.""" + content_timestamp: datetime | None = ... + """The timestamp of when the content occurred.""" + actor_id: str | None = ... + """ + The identifier of the actor associated with this content. An actor + represents an entity that participates in sessions and generates + content. + """ + session_id: str | None = ... + """ + The identifier of the session that the content belongs to. If not + provided, a session identifier is generated and returned in the + response. + """ + extraction_config: ExtractionConfig | None = ... + """ + The extraction configuration for long-term memory records. Use this + parameter to specify namespace variable keys and their values for + namespace substitution during extraction. + """ + metadata: dict[str, MetadataValue] | None = ... + """The key-value metadata to attach to the content.""" + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the operation + completes no more than one time. If this token matches a previous + request, AgentCore ignores the request, but does not return an error. + """ + +@dataclass(kw_only=True) +class IngestDataOutput(_SerdeShape): + """Dataclass for IngestDataOutput structure.""" + + session_id: str + """ + The identifier of the session that the service ingested the content + into. This value echoes the session identifier from the request, or the + identifier that the service generated when you did not provide one. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass +class IngestPayloadTypeConversational(_SerdeShape): + """The conversational content for this payload item.""" + + value: Conversational + +@dataclass +class IngestPayloadTypeJson(_SerdeShape): + """The JSON content for this payload item.""" + + value: MemoryJsonData + +@dataclass +class IngestPayloadTypeUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +IngestPayloadType = Union[ + IngestPayloadTypeConversational | IngestPayloadTypeJson | IngestPayloadTypeUnknown +] +""" +A single content payload item to ingest. A payload item contains either +conversational or JSON content. +""" + +class _IngestPayloadTypeDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> IngestPayloadType: ... + +@dataclass(kw_only=True) +class InlineGroundTruth(_SerdeShape): + """ + Inline ground truth data containing assertions, expected trajectories, + and per-turn expected responses. + """ + + assertions: list[EvaluationContent] | None = ... + """Assertions for evaluation, reuses common model EvaluationContentList.""" + expected_trajectory: EvaluationExpectedTrajectory | None = ... + """The expected tool call sequence for trajectory evaluation.""" + turns: list[GroundTruthTurn] | None = ... + """ + A list of per-turn ground truth data, each containing an input prompt + and expected response. + """ + +@dataclass(kw_only=True) +class InlineMemoryContent(_SerdeShape): + """ + The content included directly in the request as one or more payload + items. + """ + + payload: list[IngestPayloadType] + """The list of content payload items to ingest.""" + +@dataclass(kw_only=True) +class InputContentBlock(_SerdeShape): + """A block of input content.""" + + path: str + """The path to the input content.""" + text: str | None = ... + """The text input content.""" + blob: bytes | None = ... + """The binary input content.""" + +@dataclass(kw_only=True) +class Insight(_SerdeShape): + """ + A reference to an insight analysis to run against sessions during batch + evaluation. Insights provide deeper analysis beyond individual evaluator + scores, including failure detection, user intent clustering, and + execution summarization. + """ + + insight_id: str + """The unique identifier of the insight to run.""" + +class InsightsFailureCategory(UnknownEnumMixin, StrEnum): + """ + Failure category taxonomy for agent session insights. Values must stay + in sync with the category registry in AgentCoreLens + (amzn_agentcore_lens.config.failure_detection.FAILURE_CATEGORIES). + """ + + EXECUTION_ERROR_AUTHENTICATION = "execution-error-category-authentication" + EXECUTION_ERROR_RESOURCE_NOT_FOUND = "execution-error-category-resource-not-found" + EXECUTION_ERROR_SERVICE_ERRORS = "execution-error-category-service-errors" + EXECUTION_ERROR_RATE_LIMITING = "execution-error-category-rate-limiting" + EXECUTION_ERROR_FORMATTING = "execution-error-category-formatting" + EXECUTION_ERROR_TIMEOUT = "execution-error-category-timeout" + EXECUTION_ERROR_RESOURCE_EXHAUSTION = "execution-error-category-resource-exhaustion" + EXECUTION_ERROR_ENVIRONMENT = "execution-error-category-environment" + EXECUTION_ERROR_TOOL_SCHEMA = "execution-error-category-tool-schema" + TASK_INSTRUCTION_NON_COMPLIANCE = "task-instruction-category-non-compliance" + TASK_INSTRUCTION_PROBLEM_ID = "task-instruction-category-problem-id" + INCORRECT_ACTIONS_TOOL_SELECTION = "incorrect-actions-category-tool-selection" + INCORRECT_ACTIONS_POOR_INFORMATION_RETRIEVAL = ( + "incorrect-actions-category-poor-information-retrieval" + ) + INCORRECT_ACTIONS_CLARIFICATION = "incorrect-actions-category-clarification" + INCORRECT_ACTIONS_INAPPROPRIATE_INFO_REQUEST = ( + "incorrect-actions-category-inappropriate-info-request" + ) + CONTEXT_HANDLING_FAILURES = ( + "context-handling-error-category-context-handling-failures" + ) + HALLUCINATION_CAPABILITIES = "hallucination-category-hall-capabilities" + HALLUCINATION_MISUNDERSTAND = "hallucination-category-hall-misunderstand" + HALLUCINATION_USAGE = "hallucination-category-hall-usage" + HALLUCINATION_HISTORY = "hallucination-category-hall-history" + HALLUCINATION_PARAMS = "hallucination-category-hall-params" + HALLUCINATION_FABRICATE_TOOL_OUTPUTS = ( + "hallucination-category-fabricate-tool-outputs" + ) + REPETITIVE_BEHAVIOR_TOOL = "repetitive-behavior-category-repetition-tool" + REPETITIVE_BEHAVIOR_INFO = "repetitive-behavior-category-repetition-info" + REPETITIVE_BEHAVIOR_STEP = "repetitive-behavior-category-step-repetition" + ORCHESTRATION_REASONING_MISMATCH = ( + "orchestration-related-errors-category-reasoning-mismatch" + ) + ORCHESTRATION_GOAL_DEVIATION = ( + "orchestration-related-errors-category-goal-deviation" + ) + ORCHESTRATION_PREMATURE_TERMINATION = ( + "orchestration-related-errors-category-premature-termination" + ) + ORCHESTRATION_UNAWARE_TERMINATION = ( + "orchestration-related-errors-category-unaware-termination" + ) + LLM_OUTPUT_NONSENSICAL = "llm-output-category-nonsensical" + CONFIGURATION_MISMATCH_TOOL_DEFINITION = ( + "configuration-mismatch-category-tool-definition" + ) + CODING_EDGE_CASE_OVERSIGHTS = ( + "coding-use-case-specific-failure-types-category-edge-case-oversights" + ) + CODING_DEPENDENCY_ISSUES = ( + "coding-use-case-specific-failure-types-category-dependency-issues" + ) + OTHER = "other" + +@dataclass(kw_only=True) +class InsightsFailureSignal(_SerdeShape): + """A signal indicating a detected failure within a span.""" + + category: str + """The failure category classification for this signal.""" + evidence: str + """The evidence supporting the failure detection.""" + confidence: float + """The confidence score of the failure detection.""" + +class InstrumentBalanceToken(UnknownEnumMixin, StrEnum): + """ + Supported tokens for instrument balance queries. Only tokens supported + for X402 payments are returned. + """ + + USDC = "USDC" + +@dataclass(kw_only=True) +class InternalServerException(ServiceError, _SerdeShape): + """ + The exception that occurs when the service encounters an unexpected + internal error. This is a temporary condition that will resolve itself + with retries. We recommend implementing exponential backoff retry logic + in your application. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidInputException(ServiceError, _SerdeShape): + """ + The input fails to satisfy the constraints specified by AgentCore. Check + your input values and try again. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvokeAgentRuntimeCommandInput(_SerdeShape): + """Request for InvokeAgentRuntimeCommand operation.""" + + content_type: str | None = ... + """ + The MIME type of the input data in the request payload. This tells the + agent runtime how to interpret the payload data. Common values include + application/json for JSON data. + """ + accept: str | None = ... + """ + The desired MIME type for the response from the agent runtime command. + This tells the agent runtime what format to use for the response data. + Common values include application/json for JSON data. + """ + runtime_session_id: str | None = ... + """ + The unique identifier of the runtime session in which to execute the + command. This session ID is used to maintain state and context across + multiple command invocations. + """ + trace_id: str | None = ... + """The trace identifier for request tracking.""" + trace_parent: str | None = ... + """The parent trace information for distributed tracing.""" + trace_state: str | None = ... + """The trace state information for distributed tracing.""" + baggage: str | None = ... + """Additional context information for distributed tracing.""" + agent_runtime_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the agent runtime on which to execute + the command. This identifies the specific agent runtime environment + where the command will run. + """ + qualifier: str | None = ... + """ + The qualifier to use for the agent runtime. This is an endpoint name + that points to a specific version. If not specified, Amazon Bedrock + AgentCore uses the default endpoint of the agent runtime. + """ + account_id: str | None = ... + """ + The identifier of the Amazon Web Services account for the agent runtime + resource. This parameter is required when you specify an agent ID + instead of the full ARN for `agentRuntimeArn`. + """ + body: InvokeAgentRuntimeCommandRequestBody | None = ... + """ + The request body containing the command to execute and optional + configuration parameters such as timeout settings. + """ + +@dataclass(kw_only=True) +class InvokeAgentRuntimeCommandOutput(_SerdeShape): + """Response for InvokeAgentRuntimeCommand operation.""" + + runtime_session_id: str | None = ... + """ + The unique identifier of the runtime session in which the command was + executed. + """ + trace_id: str | None = ... + """The trace identifier for request tracking.""" + trace_parent: str | None = ... + """The parent trace information for distributed tracing.""" + trace_state: str | None = ... + """The trace state information for distributed tracing.""" + baggage: str | None = ... + """Additional context information for distributed tracing.""" + content_type: str + """ + The MIME type of the response data. This indicates how to interpret the + response data. Common values include application/json for JSON data. + """ + status_code: int | None = ... + """ + The HTTP status code of the response. A status code of 200 indicates a + successful operation. Other status codes indicate various error + conditions. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvokeAgentRuntimeCommandRequestBody(_SerdeShape): + """ + The request body structure for the `InvokeAgentRuntimeCommand` + operation, containing the command to execute and optional configuration + parameters. + """ + + command: str + """ + The shell command to execute on the agent runtime. This command is + executed in the runtime environment and its output is streamed back to + the caller. + """ + timeout: int | None = ... + """ + The maximum duration in seconds to wait for the command to complete. If + the command execution exceeds this timeout, it will be terminated. + Default is 300 seconds. Minimum is 1 second. Maximum is 3600 seconds. + """ + +@dataclass +class InvokeAgentRuntimeCommandStreamOutputChunk(_SerdeShape): + """ + A response chunk containing command execution events such as content + start, content delta, or content stop events. + """ + + value: ResponseChunk + +@dataclass +class InvokeAgentRuntimeCommandStreamOutputAccessDeniedException(_SerdeShape): + """Exception events for error streaming.""" + + value: AccessDeniedException + +@dataclass +class InvokeAgentRuntimeCommandStreamOutputInternalServerException(_SerdeShape): + """ + The exception that occurs when the service encounters an unexpected + internal error. This is a temporary condition that will resolve itself + with retries. We recommend implementing exponential backoff retry logic + in your application. + """ + + value: InternalServerException + +@dataclass +class InvokeAgentRuntimeCommandStreamOutputResourceNotFoundException(_SerdeShape): + """ + The exception that occurs when the specified resource does not exist. + This can happen when using an invalid identifier or when trying to + access a resource that has been deleted. + """ + + value: ResourceNotFoundException + +@dataclass +class InvokeAgentRuntimeCommandStreamOutputServiceQuotaExceededException(_SerdeShape): + """ + The exception that occurs when the request would cause a service quota + to be exceeded. Review your service quotas and either reduce your + request rate or request a quota increase. + """ + + value: ServiceQuotaExceededException + +@dataclass +class InvokeAgentRuntimeCommandStreamOutputThrottlingException(_SerdeShape): + """ + The exception that occurs when the request was denied due to request + throttling. This happens when you exceed the allowed request rate for an + operation. Reduce the frequency of requests or implement exponential + backoff retry logic in your application. + """ + + value: ThrottlingException + +@dataclass +class InvokeAgentRuntimeCommandStreamOutputValidationException(_SerdeShape): + """ + The exception that occurs when the input fails to satisfy the + constraints specified by the service. Check the error message for + details about which input parameter is invalid and correct your request. + """ + + value: ValidationException + +@dataclass +class InvokeAgentRuntimeCommandStreamOutputRuntimeClientError(_SerdeShape): + """ + The exception that occurs when there is an error in the runtime client. + This can happen due to network issues, invalid configuration, or other + client-side problems. Check the error message for specific details about + the error. + """ + + value: RuntimeClientError + +@dataclass +class InvokeAgentRuntimeCommandStreamOutputUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +InvokeAgentRuntimeCommandStreamOutput = Union[ + InvokeAgentRuntimeCommandStreamOutputChunk + | InvokeAgentRuntimeCommandStreamOutputAccessDeniedException + | InvokeAgentRuntimeCommandStreamOutputInternalServerException + | InvokeAgentRuntimeCommandStreamOutputResourceNotFoundException + | InvokeAgentRuntimeCommandStreamOutputServiceQuotaExceededException + | InvokeAgentRuntimeCommandStreamOutputThrottlingException + | InvokeAgentRuntimeCommandStreamOutputValidationException + | InvokeAgentRuntimeCommandStreamOutputRuntimeClientError + | InvokeAgentRuntimeCommandStreamOutputUnknown +] +""" +The streaming output union for the `InvokeAgentRuntimeCommand` +operation. This union delivers typed events: `contentStart` (first), +`contentDelta` (middle), and `contentStop` (last). +""" + +class _InvokeAgentRuntimeCommandStreamOutputDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> InvokeAgentRuntimeCommandStreamOutput: ... + +@dataclass(kw_only=True) +class InvokeAgentRuntimeInput(_SerdeShape): + """Dataclass for InvokeAgentRuntimeInput structure.""" + + content_type: str | None = ... + """ + The MIME type of the input data in the payload. This tells the agent + runtime how to interpret the payload data. Common values include + application/json for JSON data. + """ + accept: str | None = ... + """ + The desired MIME type for the response from the agent runtime. This + tells the agent runtime what format to use for the response data. Common + values include application/json for JSON data. + """ + mcp_session_id: str | None = ... + """The identifier of the MCP session.""" + runtime_session_id: str | None = ... + """The identifier of the runtime session.""" + mcp_protocol_version: str | None = ... + """The version of the MCP protocol being used.""" + mcp_method: str | None = ... + """ + The MCP method being invoked. For example, `tools/call`, + `resources/read`, or `prompts/get`. + """ + mcp_name: str | None = ... + """ + The name of the MCP resource, tool, or prompt being accessed. The value + depends on the method: + + - `tools/call` -- The tool name. + + - `resources/read` -- The resource URI. + + - `prompts/get` -- The prompt name. + """ + runtime_user_id: str | None = ... + """The identifier of the runtime user.""" + trace_id: str | None = ... + """The trace identifier for request tracking.""" + trace_parent: str | None = ... + """The parent trace information for distributed tracing.""" + trace_state: str | None = ... + """The trace state information for distributed tracing.""" + baggage: str | None = ... + """Additional context information for distributed tracing.""" + agent_runtime_arn: str | None = ... + """ + The identifier of the agent runtime to invoke. You can specify either + the full Amazon Web Services Resource Name (ARN) or the agent ID. If you + use the agent ID, you must also provide the `accountId` query parameter. + """ + qualifier: str | None = ... + """ + The qualifier to use for the agent runtime. This is an endpoint name + that points to a specific version. If not specified, Amazon Bedrock + AgentCore uses the default endpoint of the agent runtime. + """ + account_id: str | None = ... + """ + The identifier of the Amazon Web Services account for the agent runtime + resource. This parameter is required when you specify an agent ID + instead of the full ARN for `agentRuntimeArn`. + """ + payload: bytes | None = ... + """ + The input data to send to the agent runtime. The format of this data + depends on the specific agent configuration and must match the specified + content type. For most agents, this is a JSON object containing the + user's request. + """ + +@dataclass(kw_only=True) +class InvokeAgentRuntimeOutput(_SerdeShape): + """Dataclass for InvokeAgentRuntimeOutput structure.""" + + runtime_session_id: str | None = ... + """The identifier of the runtime session.""" + mcp_session_id: str | None = ... + """The identifier of the MCP session.""" + mcp_protocol_version: str | None = ... + """The version of the MCP protocol being used.""" + trace_id: str | None = ... + """The trace identifier for request tracking.""" + trace_parent: str | None = ... + """The parent trace information for distributed tracing.""" + trace_state: str | None = ... + """The trace state information for distributed tracing.""" + baggage: str | None = ... + """Additional context information for distributed tracing.""" + content_type: str + """ + The MIME type of the response data. This indicates how to interpret the + response data. Common values include application/json for JSON data. + """ + response: StreamingBlob = ... + """ + The response data from the agent runtime. The format of this data + depends on the specific agent configuration and the requested accept + type. For most agents, this is a JSON object containing the agent's + response to the user's request. + """ + status_code: int | None = ... + """ + The HTTP status code of the response. A status code of 200 indicates a + successful operation. Other status codes indicate various error + conditions. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvokeBrowserInput(_SerdeShape): + """Request for the InvokeBrowser operation.""" + + browser_identifier: str | None = ... + """ + The unique identifier of the browser associated with the session. This + must match the identifier used when creating the session with + `StartBrowserSession`. + """ + session_id: str | None = ... + """ + The unique identifier of the browser session on which to perform the + action. This must be an active session created with + `StartBrowserSession`. + """ + action: BrowserAction | None = ... + """ + The browser action to perform. Exactly one member of the `BrowserAction` + union must be set per request. + """ + +@dataclass(kw_only=True) +class InvokeBrowserOutput(_SerdeShape): + """Response for the InvokeBrowser operation.""" + + result: BrowserActionResult + """ + The result of the browser action. The member set in the result + corresponds to the action that was performed. + """ + session_id: str + """ + The unique identifier of the browser session on which the action was + performed. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvokeCodeInterpreterInput(_SerdeShape): + """Dataclass for InvokeCodeInterpreterInput structure.""" + + code_interpreter_identifier: str | None = ... + """ + The unique identifier of the code interpreter associated with the + session. This must match the identifier used when creating the session + with `StartCodeInterpreterSession`. + """ + session_id: str | None = ... + """ + The unique identifier of the code interpreter session to use. This must + be an active session created with `StartCodeInterpreterSession`. If the + session has expired or been stopped, the request will fail. + """ + trace_id: str | None = ... + """The trace identifier for request tracking.""" + trace_parent: str | None = ... + """The parent trace information for distributed tracing.""" + name: str | None = ... + """The name of the code interpreter to invoke.""" + arguments: ToolArguments | None = ... + """ + The arguments for the code interpreter. This includes the code to + execute and any additional parameters such as the programming language, + whether to clear the execution context, and other execution options. The + structure of this parameter depends on the specific code interpreter + being used. + """ + +@dataclass(kw_only=True) +class InvokeCodeInterpreterOutput(_SerdeShape): + """Dataclass for InvokeCodeInterpreterOutput structure.""" + + session_id: str | None = ... + """The identifier of the code interpreter session.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvokeHarnessInput(_SerdeShape): + """Dataclass for InvokeHarnessInput structure.""" + + harness_arn: str | None = ... + """The ARN of the harness to invoke.""" + qualifier: str | None = ... + """The endpoint name to invoke. If omitted, the DEFAULT endpoint is used.""" + runtime_session_id: str | None = ... + """ + The session ID for the invocation. Use the same session ID across + requests to continue a conversation. + """ + runtime_user_id: str | None = ... + """ + An identifier for the end user making the request. This value is passed + through to the runtime container. + """ + trace_parent: str | None = ... + """ + W3C trace context parent header containing version, trace ID, parent + span ID, and trace flags. + """ + trace_state: str | None = ... + """W3C trace context state header for vendor-specific trace information.""" + trace_id: str | None = ... + """Trace ID for maintaining observability through the operation.""" + baggage: str | None = ... + """ + W3C Baggage header for user-defined context propagation. Format: + key1=value1,key2=value2 + """ + messages: list[HarnessMessage] | None = ... + """The messages to send to the agent.""" + model: HarnessModelConfiguration | None = ... + """ + The model configuration to use for this invocation. If specified, + overrides the harness default. + """ + system_prompt: list[HarnessSystemContentBlock] | None = ... + """ + The system prompt to use for this invocation. If specified, overrides + the harness default. + """ + tools: list[HarnessTool] | None = ... + """ + The tools available to the agent for this invocation. If specified, + overrides the harness default. + """ + skills: list[HarnessSkill] | None = ... + """ + The skills available to the agent for this invocation. If specified, + overrides the harness default. + """ + allowed_tools: list[str] | None = ... + """ + The tools that the agent is allowed to use for this invocation. If + specified, overrides the harness default. + """ + max_iterations: int | None = ... + """ + The maximum number of iterations the agent loop can execute. If + specified, overrides the harness default. + """ + max_tokens: int | None = ... + """ + The maximum number of tokens the agent can generate per iteration. If + specified, overrides the harness default. + """ + timeout_seconds: int | None = ... + """ + The maximum duration in seconds for the agent loop execution. If + specified, overrides the harness default. + """ + actor_id: str | None = ... + """ + The actor ID for memory operations. Overrides the actor ID configured on + the harness. + """ + +@dataclass(kw_only=True) +class InvokeHarnessOutput(_SerdeShape): + """Dataclass for InvokeHarnessOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass +class InvokeHarnessStreamOutputMessageStart(_SerdeShape): + """Indicates the start of a new message from the agent.""" + + value: HarnessMessageStartEvent + +@dataclass +class InvokeHarnessStreamOutputContentBlockStart(_SerdeShape): + """Indicates the start of a new content block.""" + + value: HarnessContentBlockStartEvent + +@dataclass +class InvokeHarnessStreamOutputContentBlockDelta(_SerdeShape): + """A delta update to the current content block.""" + + value: HarnessContentBlockDeltaEvent + +@dataclass +class InvokeHarnessStreamOutputContentBlockStop(_SerdeShape): + """Indicates the end of the current content block.""" + + value: HarnessContentBlockStopEvent + +@dataclass +class InvokeHarnessStreamOutputMessageStop(_SerdeShape): + """Indicates the end of the current message.""" + + value: HarnessMessageStopEvent + +@dataclass +class InvokeHarnessStreamOutputMetadata(_SerdeShape): + """Token usage and latency metrics for the invocation.""" + + value: HarnessMetadataEvent + +@dataclass +class InvokeHarnessStreamOutputInternalServerException(_SerdeShape): + """ + The exception that occurs when the service encounters an unexpected + internal error. This is a temporary condition that will resolve itself + with retries. We recommend implementing exponential backoff retry logic + in your application. + """ + + value: InternalServerException + +@dataclass +class InvokeHarnessStreamOutputValidationException(_SerdeShape): + """ + The exception that occurs when the input fails to satisfy the + constraints specified by the service. Check the error message for + details about which input parameter is invalid and correct your request. + """ + + value: ValidationException + +@dataclass +class InvokeHarnessStreamOutputRuntimeClientError(_SerdeShape): + """An error returned by the runtime container during agent execution.""" + + value: RuntimeClientError + +@dataclass +class InvokeHarnessStreamOutputHookEvent(_SerdeShape): + """A lifecycle hook event emitted when a configured hook runs.""" + + value: HarnessHookEvent + +@dataclass +class InvokeHarnessStreamOutputUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +InvokeHarnessStreamOutput = Union[ + InvokeHarnessStreamOutputMessageStart + | InvokeHarnessStreamOutputContentBlockStart + | InvokeHarnessStreamOutputContentBlockDelta + | InvokeHarnessStreamOutputContentBlockStop + | InvokeHarnessStreamOutputMessageStop + | InvokeHarnessStreamOutputMetadata + | InvokeHarnessStreamOutputInternalServerException + | InvokeHarnessStreamOutputValidationException + | InvokeHarnessStreamOutputRuntimeClientError + | InvokeHarnessStreamOutputHookEvent + | InvokeHarnessStreamOutputUnknown +] +"""The streaming events returned by a harness invocation.""" + +class _InvokeHarnessStreamOutputDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> InvokeHarnessStreamOutput: ... + +@dataclass(kw_only=True) +class KeyPressArguments(_SerdeShape): + """Arguments for a key press action.""" + + key: str + """The key name to press (for example, `enter`, `tab`, `escape`).""" + presses: int | None = ... + """ + The number of times to press the key. Valid range: 1--100. Defaults to + 1. + """ + +@dataclass(kw_only=True) +class KeyPressResult(_SerdeShape): + """The result of a key press action.""" + + status: str + """The status of the action execution.""" + error: str | None = ... + """The error message. Present only when the action failed.""" + +@dataclass(kw_only=True) +class KeyShortcutArguments(_SerdeShape): + """Arguments for a key shortcut action.""" + + keys: list[str] + """ + The key combination to press (for example, `["ctrl", "s"]`). Maximum 5 + keys. + """ + +@dataclass(kw_only=True) +class KeyShortcutResult(_SerdeShape): + """The result of a key shortcut action.""" + + status: str + """The status of the action execution.""" + error: str | None = ... + """The error message. Present only when the action failed.""" + +@dataclass(kw_only=True) +class KeyTypeArguments(_SerdeShape): + """Arguments for a key type action.""" + + text: str + """The text string to type. Maximum length: 10,000 characters.""" + +@dataclass(kw_only=True) +class KeyTypeResult(_SerdeShape): + """The result of a key type action.""" + + status: str + """The status of the action execution.""" + error: str | None = ... + """The error message. Present only when the action failed.""" + +class LanguageRuntime(UnknownEnumMixin, StrEnum): + NODEJS = "nodejs" + DENO = "deno" + PYTHON = "python" + +@dataclass +class LeftExpressionMetadataKey(_SerdeShape): + """Key associated with the metadata in an event.""" + + value: str + +@dataclass +class LeftExpressionUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +LeftExpression = Union[LeftExpressionMetadataKey | LeftExpressionUnknown] +"""Left expression of the event metadata filter.""" + +class _LeftExpressionDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> LeftExpression: ... + +@dataclass +class LinkedAccount_Email(_SerdeShape): + """Email-based linked account.""" + + value: LinkedAccountEmail + +@dataclass +class LinkedAccount_Sms(_SerdeShape): + """SMS-based linked account using phone number.""" + + value: LinkedAccountSms + +@dataclass +class LinkedAccount_DeveloperJwt(_SerdeShape): + """Developer JWT linked account with key ID and subject.""" + + value: LinkedAccountDeveloperJwt + +@dataclass +class LinkedAccount_OAuth2(_SerdeShape): + """OAuth2 provider linked account (Google, Apple, X, Telegram, GitHub).""" + + value: LinkedAccountOAuth2 + +@dataclass +class LinkedAccountUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +LinkedAccount = Union[ + LinkedAccount_Email + | LinkedAccount_Sms + | LinkedAccount_DeveloperJwt + | LinkedAccount_OAuth2 + | LinkedAccountUnknown +] +""" +Represents different linked accounts that can be linked to an embedded +wallet. Supports email, SMS, JWT, and OAuth2 approaches. +""" + +class _LinkedAccountDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> LinkedAccount: ... + +@dataclass(kw_only=True) +class LinkedAccountDeveloperJwt(_SerdeShape): + """Authentication method using JWT with key ID and subject claims.""" + + kid: str + """ + The key ID (kid) from the JWT header. Identifies which key was used to + sign the JWT. + """ + sub: str + """ + The subject (sub) claim from the JWT payload. Identifies the principal + that is the subject of the JWT. + """ + +@dataclass(kw_only=True) +class LinkedAccountEmail(_SerdeShape): + """Linked account using an email address.""" + + email_address: str + """ + The email address used for the linked account. Must be a valid email + format. + """ + +@dataclass +class LinkedAccountOAuth2Google(_SerdeShape): + """Google OAuth2 authentication.""" + + value: OAuth2Authentication + +@dataclass +class LinkedAccountOAuth2Apple(_SerdeShape): + """Apple OAuth2 authentication.""" + + value: OAuth2Authentication + +@dataclass +class LinkedAccountOAuth2X(_SerdeShape): + """X (formerly Twitter) OAuth2 authentication.""" + + value: OAuth2Authentication + +@dataclass +class LinkedAccountOAuth2Telegram(_SerdeShape): + """Telegram OAuth2 authentication.""" + + value: OAuth2Authentication + +@dataclass +class LinkedAccountOAuth2Github(_SerdeShape): + """GitHub OAuth2 authentication.""" + + value: OAuth2Authentication + +@dataclass +class LinkedAccountOAuth2Unknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +LinkedAccountOAuth2 = Union[ + LinkedAccountOAuth2Google + | LinkedAccountOAuth2Apple + | LinkedAccountOAuth2X + | LinkedAccountOAuth2Telegram + | LinkedAccountOAuth2Github + | LinkedAccountOAuth2Unknown +] +""" +Authentication method using OAuth2 providers. Supports Google, Apple, X, +Telegram, and GitHub providers. +""" + +class _LinkedAccountOAuth2Deserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> LinkedAccountOAuth2: ... + +@dataclass(kw_only=True) +class LinkedAccountSms(_SerdeShape): + """Linked account using a phone number in E.164 format.""" + + phone_number: str + """The phone number in E.164 format (e.g., +1234567890).""" + +@dataclass(kw_only=True) +class ListABTestsInput(_SerdeShape): + """Dataclass for ListABTestsInput structure.""" + + max_results: int | None = ... + """ + The maximum number of results to return in the response. If the total + number of results is greater than this value, use the token returned in + the response in the `nextToken` field when making another request to + return the next batch of results. + """ + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, enter the token returned in the `nextToken` + field in the response in this field to return the next batch of results. + """ + +@dataclass(kw_only=True) +class ListABTestsOutput(_SerdeShape): + """Dataclass for ListABTestsOutput structure.""" + + ab_tests: list[ABTestSummary] + """The list of A/B test summaries.""" + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, use this token when making another request in + the `nextToken` field to return the next batch of results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListActorsInput(_SerdeShape): + """Dataclass for ListActorsInput structure.""" + + memory_id: str | None = ... + """ + The identifier of the AgentCore Memory resource for which to list + actors. + """ + max_results: int = ... + """ + The maximum number of results to return in a single call. The default + value is 20. + """ + next_token: str | None = ... + """ + The token for the next set of results. Use the value returned in the + previous response in the next request to retrieve the next set of + results. + """ + +@dataclass(kw_only=True) +class ListActorsOutput(_SerdeShape): + """Dataclass for ListActorsOutput structure.""" + + actor_summaries: list[ActorSummary] + """The list of actor summaries.""" + next_token: str | None = ... + """ + The token to use in a subsequent request to get the next set of results. + This value is null when there are no more results to return. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListBatchEvaluationsInput(_SerdeShape): + """Dataclass for ListBatchEvaluationsInput structure.""" + + max_results: int | None = ... + """ + The maximum number of results to return in the response. If the total + number of results is greater than this value, use the token returned in + the response in the `nextToken` field when making another request to + return the next batch of results. + """ + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, enter the token returned in the `nextToken` + field in the response in this field to return the next batch of results. + """ + +@dataclass(kw_only=True) +class ListBatchEvaluationsOutput(_SerdeShape): + """Dataclass for ListBatchEvaluationsOutput structure.""" + + batch_evaluations: list[BatchEvaluationSummary] + """The list of batch evaluation summaries.""" + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, use this token when making another request in + the `nextToken` field to return the next batch of results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListBrowserSessionsInput(_SerdeShape): + """Dataclass for ListBrowserSessionsInput structure.""" + + browser_identifier: str | None = ... + """ + The unique identifier of the browser to list sessions for. If specified, + only sessions for this browser are returned. If not specified, sessions + for all browsers are returned. + """ + max_results: int | None = ... + """ + The maximum number of results to return in a single call. The default + value is 10. Valid values range from 1 to 100. To retrieve the remaining + results, make another call with the returned `nextToken` value. + """ + next_token: str | None = ... + """ + The token for the next set of results. Use the value returned in the + previous response in the next request to retrieve the next set of + results. If not specified, Amazon Bedrock AgentCore returns the first + page of results. + """ + status: str | None = ... + """ + The status of the browser sessions to list. Valid values include ACTIVE, + STOPPING, and STOPPED. If not specified, sessions with any status are + returned. + """ + +@dataclass(kw_only=True) +class ListBrowserSessionsOutput(_SerdeShape): + """Dataclass for ListBrowserSessionsOutput structure.""" + + items: list[BrowserSessionSummary] + """The list of browser sessions that match the specified criteria.""" + next_token: str | None = ... + """ + The token to use in a subsequent `ListBrowserSessions` request to get + the next set of results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListCodeInterpreterSessionsInput(_SerdeShape): + """Dataclass for ListCodeInterpreterSessionsInput structure.""" + + code_interpreter_identifier: str | None = ... + """ + The unique identifier of the code interpreter to list sessions for. If + specified, only sessions for this code interpreter are returned. If not + specified, sessions for all code interpreters are returned. + """ + max_results: int | None = ... + """ + The maximum number of results to return in a single call. The default + value is 10. Valid values range from 1 to 100. To retrieve the remaining + results, make another call with the returned `nextToken` value. + """ + next_token: str | None = ... + """ + The token for the next set of results. Use the value returned in the + previous response in the next request to retrieve the next set of + results. If not specified, Amazon Bedrock AgentCore returns the first + page of results. + """ + status: str | None = ... + """ + The status of the code interpreter sessions to list. Valid values + include ACTIVE, STOPPING, and STOPPED. If not specified, sessions with + any status are returned. + """ + +@dataclass(kw_only=True) +class ListCodeInterpreterSessionsOutput(_SerdeShape): + """Dataclass for ListCodeInterpreterSessionsOutput structure.""" + + items: list[CodeInterpreterSessionSummary] + """The list of code interpreter sessions that match the specified criteria.""" + next_token: str | None = ... + """ + The token to use in a subsequent `ListCodeInterpreterSessions` request + to get the next set of results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListEventsInput(_SerdeShape): + """Dataclass for ListEventsInput structure.""" + + memory_id: str | None = ... + """ + The identifier of the AgentCore Memory resource for which to list + events. + """ + session_id: str | None = ... + """The identifier of the session for which to list events.""" + actor_id: str | None = ... + """The identifier of the actor for which to list events.""" + include_payloads: bool = ... + """ + Specifies whether to include event payloads in the response. Set to true + to include payloads, or false to exclude them. + """ + filter: FilterInput | None = ... + """Filter criteria to apply when listing events.""" + max_results: int = ... + """ + The maximum number of results to return in a single call. The default + value is 20. + """ + next_token: str | None = ... + """ + The token for the next set of results. Use the value returned in the + previous response in the next request to retrieve the next set of + results. + """ + +@dataclass(kw_only=True) +class ListEventsOutput(_SerdeShape): + """Dataclass for ListEventsOutput structure.""" + + events: list[Event] + """The list of events that match the specified criteria.""" + next_token: str | None = ... + """ + The token to use in a subsequent request to get the next set of results. + This value is null when there are no more results to return. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListMemoryExtractionJobsInput(_SerdeShape): + """Dataclass for ListMemoryExtractionJobsInput structure.""" + + memory_id: str | None = ... + """The unique identifier of the memory to list extraction jobs for.""" + max_results: int = ... + """ + The maximum number of results to return in a single call. The default + value is 20. + """ + filter: ExtractionJobFilterInput | None = ... + """Filter criteria to apply when listing extraction jobs.""" + next_token: str | None = ... + """ + The token for the next set of results. Use the value returned in the + previous response in the next request to retrieve the next set of + results. + """ + +@dataclass(kw_only=True) +class ListMemoryExtractionJobsOutput(_SerdeShape): + """Dataclass for ListMemoryExtractionJobsOutput structure.""" + + jobs: list[ExtractionJobMetadata] + """List of extraction job metadata matching the specified criteria.""" + next_token: str | None = ... + """Token to retrieve the next page of results, if available.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListMemoryRecordsInput(_SerdeShape): + """Dataclass for ListMemoryRecordsInput structure.""" + + memory_id: str | None = ... + """ + The identifier of the AgentCore Memory resource for which to list memory + records. + """ + namespace: str | None = ... + """ + The namespace prefix to filter memory records by. Returns all memory + records in namespaces that start with the provided prefix. Either + `namespace` or `namespacePath` is required. + """ + namespace_path: str | None = ... + """ + Use namespacePath for hierarchical retrievals. Return all memory records + where namespace falls under the same parent hierarchy. Either + `namespace` or `namespacePath` is required. + """ + memory_strategy_id: str | None = ... + """ + The memory strategy identifier to filter memory records by. If + specified, only memory records with this strategy ID are returned. + """ + max_results: int = ... + """ + The maximum number of results to return in a single call. The default + value is 20. + """ + next_token: str | None = ... + """ + The token for the next set of results. Use the value returned in the + previous response in the next request to retrieve the next set of + results. + """ + metadata_filters: list[MemoryMetadataFilterExpression] | None = ... + """ + A list of metadata filter expressions to scope the returned memory + records. + """ + +@dataclass(kw_only=True) +class ListMemoryRecordsOutput(_SerdeShape): + """Dataclass for ListMemoryRecordsOutput structure.""" + + memory_record_summaries: list[MemoryRecordSummary] + """The list of memory record summaries that match the specified criteria.""" + next_token: str | None = ... + """ + The token to use in a subsequent request to get the next set of results. + This value is null when there are no more results to return. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListPaymentInstrumentsInput(_SerdeShape): + """Request structure for listing payment instruments.""" + + user_id: str | None = ... + """The user ID associated with the payment instruments.""" + agent_name: str | None = ... + """The agent name associated with this request, used for observability.""" + payment_manager_arn: str | None = ... + """The ARN of the payment manager that owns the payment instruments.""" + payment_connector_id: str | None = ... + """The ID of the payment connector to filter by.""" + next_token: str | None = ... + """Token for pagination to retrieve the next set of results.""" + max_results: int | None = ... + """Maximum number of results to return in a single response.""" + +@dataclass(kw_only=True) +class ListPaymentInstrumentsOutput(_SerdeShape): + """Response structure for listing payment instruments.""" + + payment_instruments: list[PaymentInstrumentSummary] + """List of payment instrument summaries matching the request criteria.""" + next_token: str | None = ... + """Token for pagination to retrieve the next set of results.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListPaymentSessionsInput(_SerdeShape): + """Request structure for listing payment sessions.""" + + user_id: str | None = ... + """The user ID associated with the payment sessions.""" + agent_name: str | None = ... + """The agent name associated with this request, used for observability.""" + payment_manager_arn: str | None = ... + """The ARN of the payment manager that owns the sessions.""" + next_token: str | None = ... + """Token for pagination to retrieve the next set of results.""" + max_results: int | None = ... + """Maximum number of results to return in a single response.""" + +@dataclass(kw_only=True) +class ListPaymentSessionsOutput(_SerdeShape): + """Response structure for listing payment sessions.""" + + payment_sessions: list[PaymentSessionSummary] + """List of payment session summaries matching the request criteria.""" + next_token: str | None = ... + """Token for pagination to retrieve the next set of results.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListRecommendationsInput(_SerdeShape): + """Dataclass for ListRecommendationsInput structure.""" + + max_results: int | None = ... + """ + The maximum number of results to return in the response. If the total + number of results is greater than this value, use the token returned in + the response in the `nextToken` field when making another request to + return the next batch of results. + """ + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, enter the token returned in the `nextToken` + field in the response in this field to return the next batch of results. + """ + status_filter: str | None = ... + """ + Optional filter to return only recommendations with the specified + status. + """ + +@dataclass(kw_only=True) +class ListRecommendationsOutput(_SerdeShape): + """Dataclass for ListRecommendationsOutput structure.""" + + recommendation_summaries: list[RecommendationSummary] + """The list of recommendation summaries.""" + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, use this token when making another request in + the `nextToken` field to return the next batch of results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListSessionsInput(_SerdeShape): + """Dataclass for ListSessionsInput structure.""" + + memory_id: str | None = ... + """ + The identifier of the AgentCore Memory resource for which to list + sessions. + """ + actor_id: str | None = ... + """The identifier of the actor for which to list sessions.""" + max_results: int = ... + """ + The maximum number of results to return in a single call. The default + value is 20. + """ + next_token: str | None = ... + """ + The token for the next set of results. Use the value returned in the + previous response in the next request to retrieve the next set of + results. + """ + filter: SessionFilter | None = ... + """Filter criteria to apply when listing sessions.""" + +@dataclass(kw_only=True) +class ListSessionsOutput(_SerdeShape): + """Dataclass for ListSessionsOutput structure.""" + + session_summaries: list[SessionSummary] + """The list of session summaries that match the specified criteria.""" + next_token: str | None = ... + """ + The token to use in a subsequent request to get the next set of results. + This value is null when there are no more results to return. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class LiveViewStream(_SerdeShape): + """ + The configuration for a stream that provides a visual representation of + a browser session in Amazon Bedrock AgentCore. This stream enables + agents to observe the current state of the browser, including rendered + web pages, visual elements, and the results of interactions. + """ + + stream_endpoint: str | None = ... + """ + The endpoint URL for the live view stream. This URL is used to establish + a connection to receive visual updates from the browser session. + """ + +@dataclass(kw_only=True) +class McpDescriptor(_SerdeShape): + """ + The MCP (Model Context Protocol) descriptor configuration for a registry + record. Contains the server definition and tools definition. + """ + + server: ServerDefinition + """The MCP server definition that describes the server configuration.""" + tools: ToolsDefinition + """The MCP tools definition that describes the available tools.""" + +@dataclass +class MemoryContentText(_SerdeShape): + """The text content of the memory record.""" + + value: str + +@dataclass +class MemoryContentUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +MemoryContent = Union[MemoryContentText | MemoryContentUnknown] +"""Contains the content of a memory record.""" + +class _MemoryContentDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> MemoryContent: ... + +@dataclass(kw_only=True) +class MemoryJsonData(_SerdeShape): + """ + Contains non-conversational, JSON-formatted content for an event + payload. JSON payloads are extracted into long-term memory. + """ + + content: Document + """ + The JSON content of the payload. Accepts any JSON value, including + objects, arrays, strings, numbers, booleans, and null. The maximum size + is 100 KB. + """ + +@dataclass(kw_only=True) +class MemoryMetadataFilterExpression(_SerdeShape): + """ + Filters to apply to metadata associated with a memory. Specify the + metadata key and value in the `left` and `right` fields and use the + `operator` field to define the relationship to match. + """ + + left: MemoryRecordLeftExpression + """The metadata key to evaluate.""" + operator: str + """ + The relationship between the metadata key and value to match when + applying the metadata filter. + """ + right: MemoryRecordRightExpression | None = ... + """ + The value to compare against. Required for all operators except EXISTS + and NOT_EXISTS. + """ + +@dataclass(kw_only=True) +class MemoryRecord(_SerdeShape): + """ + Contains information about a memory record in an AgentCore Memory + resource. + """ + + memory_record_id: str + """The unique identifier of the memory record.""" + content: MemoryContent + """The content of the memory record.""" + memory_strategy_id: str + """The identifier of the memory strategy associated with this record.""" + namespaces: list[str] + """ + The namespaces associated with this memory record. Namespaces help + organize and categorize memory records. + """ + created_at: datetime + """The timestamp when the memory record was created.""" + metadata: dict[str, MemoryRecordMetadataValue] | None = ... + """A map of metadata key-value pairs associated with a memory record.""" + +@dataclass(kw_only=True) +class MemoryRecordCreateInput(_SerdeShape): + """Input structure to create a new memory record.""" + + request_identifier: str + """ + A client-provided identifier for tracking this specific record creation + request. + """ + namespaces: list[str] + """ + A list of namespace identifiers that categorize or group the memory + record. + """ + content: MemoryContent + """The content to be stored within the memory record.""" + timestamp: datetime + """Time at which the memory record was created.""" + memory_strategy_id: str | None = ... + """ + The ID of the memory strategy that defines how this memory record is + grouped. + """ + metadata: dict[str, MemoryRecordMetadataValue] | None = ... + """Metadata key-value pairs to be stored with the memory record.""" + +@dataclass(kw_only=True) +class MemoryRecordDeleteInput(_SerdeShape): + """Input structure to delete an existing memory record.""" + + memory_record_id: str + """The unique ID of the memory record to be deleted.""" + namespace: str | None = ... + """ + The namespace of the memory record being deleted. This value is used for + IAM condition key authorization. + """ + +@dataclass +class MemoryRecordLeftExpressionMetadataKey(_SerdeShape): + """The metadata key to filter on.""" + + value: str + +@dataclass +class MemoryRecordLeftExpressionUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +MemoryRecordLeftExpression = Union[ + MemoryRecordLeftExpressionMetadataKey | MemoryRecordLeftExpressionUnknown +] +"""The left-hand side of a memory record metadata filter expression.""" + +class _MemoryRecordLeftExpressionDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> MemoryRecordLeftExpression: ... + +@dataclass +class MemoryRecordMetadataValueStringValue(_SerdeShape): + """A string value.""" + + value: str + +@dataclass +class MemoryRecordMetadataValueStringListValue(_SerdeShape): + """A list of string values.""" + + value: list[str] + +@dataclass +class MemoryRecordMetadataValueNumberValue(_SerdeShape): + """A numeric value.""" + + value: float + +@dataclass +class MemoryRecordMetadataValueDateTimeValue(_SerdeShape): + """A timestamp value in ISO 8601 UTC format.""" + + value: datetime + +@dataclass +class MemoryRecordMetadataValueUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +MemoryRecordMetadataValue = Union[ + MemoryRecordMetadataValueStringValue + | MemoryRecordMetadataValueStringListValue + | MemoryRecordMetadataValueNumberValue + | MemoryRecordMetadataValueDateTimeValue + | MemoryRecordMetadataValueUnknown +] +"""The value of a memory record metadata entry.""" + +class _MemoryRecordMetadataValueDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> MemoryRecordMetadataValue: ... + +class MemoryRecordOperatorType(UnknownEnumMixin, StrEnum): + EQUALS_TO = "EQUALS_TO" + EXISTS = "EXISTS" + NOT_EXISTS = "NOT_EXISTS" + BEFORE = "BEFORE" + AFTER = "AFTER" + CONTAINS = "CONTAINS" + GREATER_THAN = "GREATER_THAN" + GREATER_THAN_OR_EQUALS = "GREATER_THAN_OR_EQUALS" + LESS_THAN = "LESS_THAN" + LESS_THAN_OR_EQUALS = "LESS_THAN_OR_EQUALS" + +@dataclass(kw_only=True) +class MemoryRecordOutput(_SerdeShape): + """Output information returned after processing a memory record operation.""" + + memory_record_id: str + """The unique ID associated to the memory record.""" + status: str + """The status of the memory record operation (e.g., SUCCEEDED, FAILED).""" + request_identifier: str | None = ... + """ + The client-provided identifier that was used to track this record + operation. + """ + error_code: int | None = ... + """The error code returned when the memory record operation fails.""" + error_message: str | None = ... + """ + A human-readable error message describing why the memory record + operation failed. + """ + +@dataclass +class MemoryRecordRightExpressionMetadataValue(_SerdeShape): + """The metadata value to compare against.""" + + value: MemoryRecordMetadataValue + +@dataclass +class MemoryRecordRightExpressionUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +MemoryRecordRightExpression = Union[ + MemoryRecordRightExpressionMetadataValue | MemoryRecordRightExpressionUnknown +] +"""The right-hand side of a memory record metadata filter expression.""" + +class _MemoryRecordRightExpressionDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> MemoryRecordRightExpression: ... + +class MemoryRecordStatus(UnknownEnumMixin, StrEnum): + SUCCEEDED = "SUCCEEDED" + FAILED = "FAILED" + +@dataclass(kw_only=True) +class MemoryRecordSummary(_SerdeShape): + """Contains summary information about a memory record.""" + + memory_record_id: str + """The unique identifier of the memory record.""" + content: MemoryContent + """The content of the memory record.""" + memory_strategy_id: str + """The identifier of the memory strategy associated with this record.""" + namespaces: list[str] + """The namespaces associated with this memory record.""" + created_at: datetime + """The timestamp when the memory record was created.""" + score: float | None = ... + """ + The relevance score of the memory record when returned as part of a + search result. Higher values indicate greater relevance to the search + query. + """ + metadata: dict[str, MemoryRecordMetadataValue] | None = ... + """A map of metadata key-value pairs associated with a memory record.""" + +@dataclass(kw_only=True) +class MemoryRecordUpdateInput(_SerdeShape): + """Input structure to update an existing memory record.""" + + memory_record_id: str + """The unique ID of the memory record to be updated.""" + timestamp: datetime + """Time at which the memory record was updated""" + content: MemoryContent | None = ... + """The content to be stored within the memory record.""" + namespaces: list[str] | None = ... + """ + The updated list of namespace identifiers for categorizing the memory + record. + """ + source_namespaces: list[str] | None = ... + """ + The namespaces of the source memory record being updated. This value is + used for IAM condition key authorization. + """ + memory_strategy_id: str | None = ... + """ + The updated ID of the memory strategy that defines how this memory + record is grouped. + """ + metadata: dict[str, MemoryRecordMetadataValue] | None = ... + """Metadata key-value pairs to be stored with the memory record.""" + +@dataclass(kw_only=True) +class MessageMetadata(_SerdeShape): + """Metadata information associated with this message.""" + + event_id: str + """The identifier of the event associated with this message.""" + message_index: int + """ + The position of this message within that event's ordered list of + messages. + """ + +@dataclass +class MetadataValueStringValue(_SerdeShape): + """Value associated with the `eventMetadata` key.""" + + value: str + +@dataclass +class MetadataValueUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +MetadataValue = Union[MetadataValueStringValue | MetadataValueUnknown] +"""Value associated with the `eventMetadata` key.""" + +class _MetadataValueDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> MetadataValue: ... + +class MouseButton(UnknownEnumMixin, StrEnum): + """The mouse button to use for a browser mouse action.""" + + LEFT = "LEFT" + RIGHT = "RIGHT" + MIDDLE = "MIDDLE" + +@dataclass(kw_only=True) +class MouseClickArguments(_SerdeShape): + """Arguments for a mouse click action.""" + + x: int + """The X coordinate on screen where the click occurs.""" + y: int + """The Y coordinate on screen where the click occurs.""" + button: str | None = ... + """The mouse button to use. Defaults to `LEFT`.""" + click_count: int | None = ... + """The number of clicks to perform. Valid range: 1--10. Defaults to 1.""" + +@dataclass(kw_only=True) +class MouseClickResult(_SerdeShape): + """The result of a mouse click action.""" + + status: str + """The status of the action execution.""" + error: str | None = ... + """The error message. Present only when the action failed.""" + +@dataclass(kw_only=True) +class MouseDragArguments(_SerdeShape): + """Arguments for a mouse drag action.""" + + end_x: int + """The ending X coordinate for the drag.""" + end_y: int + """The ending Y coordinate for the drag.""" + start_x: int + """The starting X coordinate for the drag.""" + start_y: int + """The starting Y coordinate for the drag.""" + button: str | None = ... + """The mouse button to use for the drag. Defaults to `LEFT`.""" + +@dataclass(kw_only=True) +class MouseDragResult(_SerdeShape): + """The result of a mouse drag action.""" + + status: str + """The status of the action execution.""" + error: str | None = ... + """The error message. Present only when the action failed.""" + +@dataclass(kw_only=True) +class MouseMoveArguments(_SerdeShape): + """Arguments for a mouse move action.""" + + x: int + """The target X coordinate on screen.""" + y: int + """The target Y coordinate on screen.""" + +@dataclass(kw_only=True) +class MouseMoveResult(_SerdeShape): + """The result of a mouse move action.""" + + status: str + """The status of the action execution.""" + error: str | None = ... + """The error message. Present only when the action failed.""" + +@dataclass(kw_only=True) +class MouseScrollArguments(_SerdeShape): + """Arguments for a mouse scroll action.""" + + x: int + """The X coordinate on screen where the scroll occurs.""" + y: int + """The Y coordinate on screen where the scroll occurs.""" + delta_x: int | None = ... + """The horizontal scroll delta. Valid range: -1000 to 1000.""" + delta_y: int | None = ... + """ + The vertical scroll delta. Valid range: -1000 to 1000. Negative values + scroll down. + """ + +@dataclass(kw_only=True) +class MouseScrollResult(_SerdeShape): + """The result of a mouse scroll action.""" + + status: str + """The status of the action execution.""" + error: str | None = ... + """The error message. Present only when the action failed.""" + +@dataclass(kw_only=True) +class MppPaymentInput(_SerdeShape): + """ + Contains the payment challenge from a 402 Payment Required response. + Forward the raw `WWW-Authenticate: Payment` header value verbatim. In + response, you receive a payment credential that satisfies the challenge. + Provide exactly one challenge per request. + """ + + version: str + """The MPP protocol version, for example \"1\" or \"2\".""" + www_authenticate_headers: list[str] + """ + The raw `WWW-Authenticate: Payment` header value from the 402 response, + passed verbatim. Provide exactly one entry. The service uses this value + to generate the payment credential. + """ + buyer_pays_gas_fees: bool | None = ... + """ + Authorizes the service to sign a payment whose blockchain network (gas) + fees are charged to your wallet, on top of the payment amount. + + The challenge indicates who sponsors the network fees. When the + challenge does not sponsor them, the service signs the payment only if + this field is `true`. Otherwise it returns a validation error, so you + can decide whether to pay the fees or obtain a challenge that sponsors + them. + + Optional. When omitted or `false`, you decline to pay network fees. This + field has no effect on challenges that already sponsor the fees. + """ + +@dataclass(kw_only=True) +class MppPaymentOutput(_SerdeShape): + """Contains the payment credential, ready to retry the request.""" + + version: str + """The MPP protocol version, for example \"1\" or \"2\".""" + selected_payment_id: str + """ + The id of the challenge that was paid, echoed from the input challenge + so you can correlate the result without decoding the credential. + """ + payment_credential: str + """ + Ready-to-send value for the `Authorization` header, in the form + \"Payment \". Attach this header and retry the + original request. To inspect the full credential, base64url-decode the + token. + """ + +@dataclass(kw_only=True) +class OAuth2Authentication(_SerdeShape): + """OAuth2 authentication information for third-party providers.""" + + sub: str + """ + The subject (sub) claim from the OAuth2 provider. Uniquely identifies + the user at the provider. + """ + email_address: str | None = ... + """The email address from the OAuth2 provider.""" + name: str | None = ... + """The user's name from the OAuth2 provider.""" + username: str | None = ... + """The username from the OAuth2 provider.""" + +class Oauth2FlowType(UnknownEnumMixin, StrEnum): + USER_FEDERATION = "USER_FEDERATION" + M2_M = "M2M" + ON_BEHALF_OF_TOKEN_EXCHANGE = "ON_BEHALF_OF_TOKEN_EXCHANGE" + +@dataclass(kw_only=True) +class OAuthCredentialProvider(_SerdeShape): + """ + Configuration for an OAuth 2.0 credential provider used to authenticate + tool calls. + """ + + provider_arn: str + """The ARN of the OAuth 2.0 credential provider in AgentCore Identity.""" + scopes: list[str] + """The OAuth 2.0 scopes to request when obtaining an access token.""" + custom_parameters: dict[str, str] | None = ... + """Additional custom parameters to include in the OAuth 2.0 token request.""" + grant_type: str = ... + """The OAuth 2.0 grant type to use for authentication.""" + default_return_url: str | None = ... + """The default return URL for the OAuth 2.0 authorization flow.""" + +class OAuthGrantType(UnknownEnumMixin, StrEnum): + CLIENT_CREDENTIALS = "CLIENT_CREDENTIALS" + AUTHORIZATION_CODE = "AUTHORIZATION_CODE" + TOKEN_EXCHANGE = "TOKEN_EXCHANGE" + +@dataclass(kw_only=True) +class OnlineEvaluationConfigSource(_SerdeShape): + """ + A reference to an existing online evaluation configuration to use as the + data source for batch evaluation. + """ + + online_evaluation_config_arn: str + """ + The Amazon Resource Name (ARN) of the online evaluation configuration to + use as the session source. + """ + time_range: SessionFilterConfig | None = ... + """ + Optional session filter configuration to narrow down which sessions from + the online evaluation configuration to include. + """ + +@dataclass(kw_only=True) +class OnlineEvaluationTraceConfig(_SerdeShape): + """ + Contains the configuration for reusing agent traces from an online + evaluation configuration for recommendation analysis. Because online + evaluation is a continuous stream, a time range specifies which + evaluated sessions the recommendation includes. + """ + + online_evaluation_config_arn: str + """The ARN of the online evaluation configuration to reuse sessions from.""" + start_time: datetime + """ + The start time of the time range. Only sessions evaluated at or after + this timestamp are included. + """ + end_time: datetime + """ + The end time of the time range. Only sessions evaluated before this + timestamp are included. + """ + +class OperatorType(UnknownEnumMixin, StrEnum): + EQUALS_TO = "EQUALS_TO" + EXISTS = "EXISTS" + NOT_EXISTS = "NOT_EXISTS" + +@dataclass +class OutputConfigCloudWatchConfig(_SerdeShape): + """The CloudWatch Logs configuration for writing evaluation results.""" + + value: CloudWatchOutputConfig + +@dataclass +class OutputConfigUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +OutputConfig = Union[OutputConfigCloudWatchConfig | OutputConfigUnknown] +"""Output destination configuration.""" + +class _OutputConfigDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> OutputConfig: ... + +@dataclass +class PayloadTypeConversational(_SerdeShape): + """The conversational content of the payload.""" + + value: Conversational + +@dataclass +class PayloadTypeBlob(_SerdeShape): + """The binary content of the payload.""" + + value: Document + +@dataclass +class PayloadTypeJson(_SerdeShape): + """ + The JSON content of the payload. Use this type to store + non-conversational, JSON-formatted data, such as behavioral events, + activity logs, or system events. + """ + + value: MemoryJsonData + +@dataclass +class PayloadTypeUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +PayloadType = Union[ + PayloadTypeConversational | PayloadTypeBlob | PayloadTypeJson | PayloadTypeUnknown +] +"""Contains the payload content for an event.""" + +class _PayloadTypeDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> PayloadType: ... + +class PaymentHttpMethodType(UnknownEnumMixin, StrEnum): + GET = "GET" + POST = "POST" + PUT = "PUT" + DELETE = "DELETE" + PATCH = "PATCH" + +@dataclass +class PaymentInputCryptoX402(_SerdeShape): + """Input for a crypto X402 payment.""" + + value: CryptoX402PaymentInput + +@dataclass +class PaymentInputMpp(_SerdeShape): + """ + Contains the payment challenge from a 402 Payment Required response. + Forward the raw `WWW-Authenticate: Payment` header value verbatim. In + response, you receive a payment credential that satisfies the challenge. + Provide exactly one challenge per request. + """ + + value: MppPaymentInput + +@dataclass +class PaymentInputUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +PaymentInput = Union[PaymentInputCryptoX402 | PaymentInputMpp | PaymentInputUnknown] +"""The payment input details, which vary by payment type.""" + +class _PaymentInputDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> PaymentInput: ... + +@dataclass(kw_only=True) +class PaymentInstrument(_SerdeShape): + """Represents a payment instrument.""" + + payment_instrument_id: str + """The unique identifier for this payment instrument.""" + payment_manager_arn: str + """The ARN of the payment manager that owns this payment instrument.""" + payment_connector_id: str + """The ID of the payment connector associated with this instrument.""" + user_id: str + """The user ID associated with this payment instrument.""" + payment_instrument_type: str + """The type of payment instrument (e.g., EMBEDDED_CRYPTO_WALLET).""" + payment_instrument_details: PaymentInstrumentDetails + """The details specific to the payment instrument type.""" + created_at: datetime + """The timestamp when this payment instrument was created.""" + status: str + """The current status of this payment instrument.""" + updated_at: datetime + """The timestamp when this payment instrument was last updated.""" + +@dataclass +class PaymentInstrumentDetailsEmbeddedCryptoWallet(_SerdeShape): + """Embedded crypto wallet managed directly by end user.""" + + value: EmbeddedCryptoWallet + +@dataclass +class PaymentInstrumentDetailsUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +PaymentInstrumentDetails = Union[ + PaymentInstrumentDetailsEmbeddedCryptoWallet | PaymentInstrumentDetailsUnknown +] +"""Details specific to the instrument type.""" + +class _PaymentInstrumentDetailsDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> PaymentInstrumentDetails: ... + +class PaymentInstrumentStatus(UnknownEnumMixin, StrEnum): + """The status of a payment instrument.""" + + INITIATED = "INITIATED" + ACTIVE = "ACTIVE" + FAILED = "FAILED" + DELETED = "DELETED" + BLOCKED = "BLOCKED" + +@dataclass(kw_only=True) +class PaymentInstrumentSummary(_SerdeShape): + """Summary of a payment instrument for list operations.""" + + payment_instrument_id: str + """The unique identifier for this payment instrument.""" + payment_manager_arn: str + """The ARN of the payment manager that owns this payment instrument.""" + payment_connector_id: str + """The ID of the payment connector associated with this instrument.""" + user_id: str + """The user ID associated with this payment instrument.""" + payment_instrument_type: str + """The type of payment instrument (e.g., EMBEDDED_CRYPTO_WALLET).""" + status: str + """The current status of this payment instrument.""" + created_at: datetime + """The timestamp when this payment instrument was created.""" + updated_at: datetime + """The timestamp when this payment instrument was last updated.""" + +class PaymentInstrumentType(UnknownEnumMixin, StrEnum): + """The type of payment instrument.""" + + EMBEDDED_CRYPTO_WALLET = "EMBEDDED_CRYPTO_WALLET" + +@dataclass +class PaymentOutputCryptoX402(_SerdeShape): + """Output from a crypto X402 payment.""" + + value: CryptoX402PaymentOutput + +@dataclass +class PaymentOutputMpp(_SerdeShape): + """Contains the payment credential, ready to retry the request.""" + + value: MppPaymentOutput + +@dataclass +class PaymentOutputUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +PaymentOutput = Union[PaymentOutputCryptoX402 | PaymentOutputMpp | PaymentOutputUnknown] +"""The payment output details, which vary by payment type.""" + +class _PaymentOutputDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> PaymentOutput: ... + +@dataclass(kw_only=True) +class PaymentSession(_SerdeShape): + """A payment session for managing payment transactions.""" + + payment_session_id: str + """The unique identifier of the payment session.""" + payment_manager_arn: str + """The ARN of the payment manager that owns this session.""" + limits: SessionLimits | None = ... + """The spending limits for the payment session.""" + user_id: str + """The user ID associated with this session.""" + expiry_time_in_minutes: int + """The session expiry time in minutes.""" + created_at: datetime + """The timestamp when the session was created.""" + available_limits: AvailableLimits | None = ... + """The current available spending limits.""" + updated_at: datetime + """The timestamp when the session was last updated.""" + +class PaymentSessionStatus(UnknownEnumMixin, StrEnum): + """The status of a payment session.""" + + ACTIVE = "ACTIVE" + EXPIRED = "EXPIRED" + DELETED = "DELETED" + +@dataclass(kw_only=True) +class PaymentSessionSummary(_SerdeShape): + """Summary information about a payment session.""" + + payment_session_id: str + """The unique identifier of the payment session.""" + payment_manager_arn: str + """The ARN of the payment manager that owns this session.""" + user_id: str + """The user ID associated with this session.""" + expiry_time_in_minutes: int + """The session expiry time in minutes.""" + created_at: datetime + """The timestamp when the session was created.""" + updated_at: datetime + """The timestamp when the session was last updated.""" + +class PaymentStatus(UnknownEnumMixin, StrEnum): + """Transaction status enum.""" + + PROOF_GENERATED = "PROOF_GENERATED" + +@dataclass +class PaymentTokenRequestInputCoinbaseCdpTokenRequest(_SerdeShape): + """The Coinbase CDP token request.""" + + value: CoinbaseCdpTokenRequestInput + +@dataclass +class PaymentTokenRequestInputStripePrivyTokenRequest(_SerdeShape): + """The Stripe Privy token request.""" + + value: StripePrivyTokenRequestInput + +@dataclass +class PaymentTokenRequestInputUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +PaymentTokenRequestInput = Union[ + PaymentTokenRequestInputCoinbaseCdpTokenRequest + | PaymentTokenRequestInputStripePrivyTokenRequest + | PaymentTokenRequestInputUnknown +] +"""Vendor-specific token request configuration.""" + +class _PaymentTokenRequestInputDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> PaymentTokenRequestInput: ... + +@dataclass +class PaymentTokenResponseOutputCoinbaseCdpTokenResponse(_SerdeShape): + """The Coinbase CDP token response.""" + + value: CoinbaseCdpTokenResponseOutput + +@dataclass +class PaymentTokenResponseOutputStripePrivyTokenResponse(_SerdeShape): + """The Stripe Privy token response.""" + + value: StripePrivyTokenResponseOutput + +@dataclass +class PaymentTokenResponseOutputUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +PaymentTokenResponseOutput = Union[ + PaymentTokenResponseOutputCoinbaseCdpTokenResponse + | PaymentTokenResponseOutputStripePrivyTokenResponse + | PaymentTokenResponseOutputUnknown +] +"""Vendor-specific token response configuration.""" + +class _PaymentTokenResponseOutputDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> PaymentTokenResponseOutput: ... + +class PaymentType(UnknownEnumMixin, StrEnum): + """Payment type enum.""" + + CRYPTO_X402 = "CRYPTO_X402" + MPP = "MPP" + +@dataclass(kw_only=True) +class PerVariantOnlineEvaluationConfig(_SerdeShape): + """ + An online evaluation configuration associated with a specific A/B test + variant. + """ + + name: str + """The name of the variant this evaluation configuration applies to.""" + online_evaluation_config_arn: str + """ + The Amazon Resource Name (ARN) of the online evaluation configuration + for this variant. + """ + +@dataclass(kw_only=True) +class ProcessPaymentInput(_SerdeShape): + """Request structure for processing a payment.""" + + user_id: str | None = ... + """The user ID associated with this payment.""" + agent_name: str | None = ... + """The agent name associated with this request, used for observability.""" + payment_manager_arn: str | None = ... + """The ARN of the payment manager.""" + payment_session_id: str | None = ... + """The ID of the payment session.""" + payment_instrument_id: str | None = ... + """The ID of the payment instrument to use.""" + payment_type: str | None = ... + """The type of payment to process.""" + payment_input: PaymentInput | None = ... + """The payment input details specific to the payment type.""" + client_token: str | None = ... + """ + A unique, case-sensitive identifier that you provide to ensure the + idempotency of the request. + """ + +@dataclass(kw_only=True) +class ProcessPaymentOutput(_SerdeShape): + """Response structure for processing a payment.""" + + process_payment_id: str + """The unique identifier of the processed payment.""" + payment_manager_arn: str + """The ARN of the payment manager.""" + payment_session_id: str + """The ID of the payment session used.""" + payment_instrument_id: str + """The ID of the payment instrument used.""" + payment_type: str + """The type of payment processed.""" + status: str + """The status of the payment.""" + payment_output: PaymentOutput + """The payment output details specific to the payment type.""" + created_at: datetime + """The timestamp when the payment was created.""" + updated_at: datetime + """The timestamp when the payment was last updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class ProgrammingLanguage(UnknownEnumMixin, StrEnum): + PYTHON = "python" + JAVASCRIPT = "javascript" + TYPESCRIPT = "typescript" + +@dataclass +class ProxyExternalProxy(_SerdeShape): + """Configuration for an external customer-managed proxy server.""" + + value: ExternalProxy + +@dataclass +class ProxyUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +Proxy = Union[ProxyExternalProxy | ProxyUnknown] +""" +Union type representing different proxy configurations. Currently +supports external customer-managed proxies. +""" + +class _ProxyDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> Proxy: ... + +@dataclass(kw_only=True) +class ProxyBypass(_SerdeShape): + """ + Configuration for domains that should bypass all proxies and connect + directly to the internet. These bypass rules take precedence over all + proxy routing rules. + """ + + domain_patterns: list[str] | None = ... + """ + Array of domain patterns that should bypass the proxy. Supports + `.amazonaws.com` for subdomain matching or `amazonaws.com` for exact + domain matching. Requests to these domains connect directly without + using any proxy. Maximum 253 characters per pattern. + """ + +@dataclass(kw_only=True) +class ProxyConfiguration(_SerdeShape): + """ + Configuration for routing browser traffic through customer-managed proxy + servers. Supports 1-5 proxy servers for domain-based routing and proxy + bypass rules. + """ + + proxies: list[Proxy] + """ + An array of 1-5 proxy server configurations for domain-based routing. + Each proxy can specify which domains it handles via `domainPatterns`, + enabling flexible routing of different traffic through different proxies + based on destination domain. + """ + bypass: ProxyBypass | None = ... + """ + Optional configuration for domains that should bypass all proxies and + connect directly to their destination, like the internet. Takes + precedence over all proxy routing rules. + """ + +@dataclass +class ProxyCredentialsBasicAuth(_SerdeShape): + """ + HTTP Basic Authentication credentials (username and password) stored in + Amazon Web Services Secrets Manager. + """ + + value: BasicAuth + +@dataclass +class ProxyCredentialsUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ProxyCredentials = Union[ProxyCredentialsBasicAuth | ProxyCredentialsUnknown] +""" +Union type representing different proxy authentication methods. +Currently supports HTTP Basic Authentication (username and password). +""" + +class _ProxyCredentialsDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> ProxyCredentials: ... + +@dataclass +class RecommendationConfigSystemPromptRecommendationConfig(_SerdeShape): + """The configuration for a system prompt recommendation.""" + + value: SystemPromptRecommendationConfig + +@dataclass +class RecommendationConfigToolDescriptionRecommendationConfig(_SerdeShape): + """The configuration for a tool description recommendation.""" + + value: ToolDescriptionRecommendationConfig + +@dataclass +class RecommendationConfigUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +RecommendationConfig = Union[ + RecommendationConfigSystemPromptRecommendationConfig + | RecommendationConfigToolDescriptionRecommendationConfig + | RecommendationConfigUnknown +] +"""The configuration for a recommendation, varying by recommendation type.""" + +class _RecommendationConfigDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> RecommendationConfig: ... + +@dataclass(kw_only=True) +class RecommendationEvaluationConfig(_SerdeShape): + """The evaluation configuration for assessing recommendation quality.""" + + evaluators: list[RecommendationEvaluatorReference] + """The list of evaluators to use for assessing recommendation quality.""" + +@dataclass(kw_only=True) +class RecommendationEvaluatorReference(_SerdeShape): + """A reference to an evaluator used for recommendation assessment.""" + + evaluator_arn: str + """The Amazon Resource Name (ARN) of the evaluator.""" + +@dataclass +class RecommendationResultSystemPromptRecommendationResult(_SerdeShape): + """The result of a system prompt recommendation.""" + + value: SystemPromptRecommendationResult + +@dataclass +class RecommendationResultToolDescriptionRecommendationResult(_SerdeShape): + """The result of a tool description recommendation.""" + + value: ToolDescriptionRecommendationResult + +@dataclass +class RecommendationResultUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +RecommendationResult = Union[ + RecommendationResultSystemPromptRecommendationResult + | RecommendationResultToolDescriptionRecommendationResult + | RecommendationResultUnknown +] +"""The result of a recommendation, containing the optimized output.""" + +class _RecommendationResultDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> RecommendationResult: ... + +@dataclass(kw_only=True) +class RecommendationResultConfigurationBundle(_SerdeShape): + """A configuration bundle reference in a recommendation result.""" + + bundle_arn: str + """The Amazon Resource Name (ARN) of the configuration bundle.""" + version_id: str + """ + The version identifier of the configuration bundle containing the + recommendation. + """ + +class RecommendationStatus(UnknownEnumMixin, StrEnum): + """The lifecycle status of a recommendation.""" + + PENDING = "PENDING" + IN_PROGRESS = "IN_PROGRESS" + COMPLETED = "COMPLETED" + FAILED = "FAILED" + DELETING = "DELETING" + +@dataclass(kw_only=True) +class RecommendationSummary(_SerdeShape): + """Summary information about a recommendation.""" + + recommendation_id: str + """The unique identifier of the recommendation.""" + recommendation_arn: str + """The Amazon Resource Name (ARN) of the recommendation.""" + name: str + """The name of the recommendation.""" + description: str | None = ... + """The description of the recommendation.""" + type: str + """The type of recommendation.""" + status: str + """The current status of the recommendation.""" + created_at: datetime + """The timestamp when the recommendation was created.""" + updated_at: datetime + """The timestamp when the recommendation was last updated.""" + +class RecommendationType(UnknownEnumMixin, StrEnum): + """The type of recommendation to generate.""" + + SYSTEM_PROMPT_RECOMMENDATION = "SYSTEM_PROMPT_RECOMMENDATION" + TOOL_DESCRIPTION_RECOMMENDATION = "TOOL_DESCRIPTION_RECOMMENDATION" + +class RegistryRecordStatus(UnknownEnumMixin, StrEnum): + """The status of a registry record in its lifecycle.""" + + DRAFT = "DRAFT" + PENDING_APPROVAL = "PENDING_APPROVAL" + APPROVED = "APPROVED" + REJECTED = "REJECTED" + DEPRECATED = "DEPRECATED" + +@dataclass(kw_only=True) +class RegistryRecordSummary(_SerdeShape): + """Summary information about a registry record.""" + + registry_arn: str + """ + The Amazon Resource Name (ARN) of the registry that this record belongs + to. + """ + record_arn: str + """The Amazon Resource Name (ARN) of the registry record.""" + record_id: str + """The unique identifier of the registry record.""" + name: str + """The name of the registry record.""" + description: str | None = ... + """A description of the registry record.""" + descriptor_type: str + """The type of descriptor associated with this registry record.""" + descriptors: Descriptors + """The descriptor configurations for this registry record.""" + version: str + """The version of the registry record.""" + status: str + """The current status of the registry record.""" + created_at: datetime + """The date and time when the registry record was created.""" + updated_at: datetime + """The date and time when the registry record was last updated.""" + +@dataclass(kw_only=True) +class ResourceContent(_SerdeShape): + """Contains information about resource content.""" + + type: str + """The type of resource content.""" + uri: str | None = ... + """The URI of the resource content.""" + mime_type: str | None = ... + """The MIME type of the resource content.""" + text: str | None = ... + """The text resource content.""" + blob: bytes | None = ... + """The binary resource content.""" + +class ResourceContentType(UnknownEnumMixin, StrEnum): + TEXT = "text" + BLOB = "blob" + +@dataclass +class ResourceLocationS3(_SerdeShape): + """ + The Amazon S3 location of the resource. Use this when the resource is + stored in an Amazon S3 bucket. + """ + + value: S3Location + +@dataclass +class ResourceLocationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ResourceLocation = Union[ResourceLocationS3 | ResourceLocationUnknown] +"""The location of the browser extension.""" + +class _ResourceLocationDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> ResourceLocation: ... + +@dataclass(kw_only=True) +class ResourceNotFoundException(ServiceError, _SerdeShape): + """ + The exception that occurs when the specified resource does not exist. + This can happen when using an invalid identifier or when trying to + access a resource that has been deleted. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ResponseChunk(_SerdeShape): + """ + A structure representing a response chunk that contains exactly one of + the possible event types: `contentStart`, `contentDelta`, or + `contentStop`. + """ + + content_start: ContentStartEvent | None = ... + """ + An event indicating the start of content streaming from the command + execution. This is the first chunk received. + """ + content_delta: ContentDeltaEvent | None = ... + """ + An event containing incremental output (stdout or stderr) from the + command execution. These are the middle chunks. + """ + content_stop: ContentStopEvent | None = ... + """ + An event indicating the completion of the command execution, including + the exit code and final status. This is the last chunk received. + """ + +class ResultDestination(UnknownEnumMixin, StrEnum): + """ + Where evaluation results are written: dedicated results log group + (default) or the source log group. + """ + + DEDICATED_LOG_GROUP = "DEDICATED_LOG_GROUP" + SOURCE_LOG_GROUP = "SOURCE_LOG_GROUP" + +@dataclass(kw_only=True) +class RetrieveMemoryRecordsInput(_SerdeShape): + """Dataclass for RetrieveMemoryRecordsInput structure.""" + + memory_id: str | None = ... + """ + The identifier of the AgentCore Memory resource from which to retrieve + memory records. + """ + namespace: str | None = ... + """ + The namespace prefix to filter memory records by. Searches for memory + records in namespaces that start with the provided prefix. Either + `namespace` or `namespacePath` is required. + """ + namespace_path: str | None = ... + """ + Use namespacePath for hierarchical retrievals. Return all memory records + where namespace falls under the same parent hierarchy. Either + `namespace` or `namespacePath` is required. + """ + search_criteria: SearchCriteria | None = ... + """ + The search criteria to use for finding relevant memory records. This + includes the search query, memory strategy ID, and other search + parameters. + """ + next_token: str | None = ... + """ + The token for the next set of results. Use the value returned in the + previous response in the next request to retrieve the next set of + results. + """ + max_results: int = ... + """ + The maximum number of results to return in a single call. The default + value is 20. + """ + +@dataclass(kw_only=True) +class RetrieveMemoryRecordsOutput(_SerdeShape): + """Dataclass for RetrieveMemoryRecordsOutput structure.""" + + memory_record_summaries: list[MemoryRecordSummary] + """ + The list of memory record summaries that match the search criteria, + ordered by relevance. + """ + next_token: str | None = ... + """ + The token to use in a subsequent request to get the next set of results. + This value is null when there are no more results to return. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class RetryableConflictException(ServiceError, _SerdeShape): + """ + The exception that occurs when there is a retryable conflict performing + an operation. This is a temporary condition that may resolve itself with + retries. We recommend implementing exponential backoff retry logic in + your application. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass +class RightExpressionMetadataValue(_SerdeShape): + """Value associated with the key in `eventMetadata`.""" + + value: MetadataValue + +@dataclass +class RightExpressionUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +RightExpression = Union[RightExpressionMetadataValue | RightExpressionUnknown] +"""Right expression of the `eventMetadata`filter.""" + +class _RightExpressionDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> RightExpression: ... + +class Role(UnknownEnumMixin, StrEnum): + ASSISTANT = "ASSISTANT" + USER = "USER" + TOOL = "TOOL" + OTHER = "OTHER" + +@dataclass(kw_only=True) +class RootCauseCluster(_SerdeShape): + """ + A cluster of similar root causes identified within a failure + subcategory. + """ + + cluster_id: int + """The unique identifier of the root cause cluster.""" + name: str + """The name of the root cause cluster.""" + root_cause: str + """The root cause explanation for this cluster of failures.""" + recommendation: str + """The recommended fix for this root cause.""" + affected_session_count: int + """The number of sessions affected by this root cause.""" + affected_sessions: list[AffectedSession] + """The list of sessions affected by this root cause.""" + +@dataclass(kw_only=True) +class RuntimeClientError(ServiceError, _SerdeShape): + """ + The exception that occurs when there is an error in the runtime client. + This can happen due to network issues, invalid configuration, or other + client-side problems. Check the error message for specific details about + the error. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class S3FilesConfiguration(_SerdeShape): + """ + The configuration for mounting an Amazon Simple Storage Service (Amazon + S3) Files access point that you own into a session. + """ + + access_point_arn: str + """ + The Amazon Resource Name (ARN) of the Amazon Simple Storage Service + (Amazon S3) Files access point to mount. + """ + mount_path: str + """ + The absolute path within the session at which the access point is + mounted, for example `/mnt/s3data`. Each mount path must be unique + across all file system configurations in the session. + """ + file_system_arn: str + """ + The Amazon Resource Name (ARN) of the Amazon Simple Storage Service + (Amazon S3) Files file system that owns the access point. + """ + +@dataclass(kw_only=True) +class S3Location(_SerdeShape): + """The Amazon S3 location configuration of a resource.""" + + bucket: str + """The name of the Amazon S3 bucket where the resource is stored.""" + prefix: str + """The name of the Amazon S3 prefix/key where the resource is stored.""" + version_id: str | None = ... + """ + The name of the Amazon S3 version ID where the resource is stored + (Optional). + """ + +@dataclass(kw_only=True) +class SaveBrowserSessionProfileInput(_SerdeShape): + """Dataclass for SaveBrowserSessionProfileInput structure.""" + + trace_id: str | None = ... + """The trace identifier for request tracking.""" + trace_parent: str | None = ... + """The parent trace information for distributed tracing.""" + profile_identifier: str | None = ... + """ + The unique identifier for the browser profile. This identifier is used + to reference the profile when starting new browser sessions. The + identifier must follow the pattern of an alphanumeric name (up to 48 + characters) followed by a hyphen and a 10-character alphanumeric suffix. + """ + browser_identifier: str | None = ... + """ + The unique identifier of the browser associated with the session from + which to save the profile. + """ + session_id: str | None = ... + """ + The unique identifier of the browser session from which to save the + profile. The session must be active when saving the profile. + """ + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If this token matches a previous + request, Amazon Bedrock AgentCore ignores the request, but does not + return an error. + """ + +@dataclass(kw_only=True) +class SaveBrowserSessionProfileOutput(_SerdeShape): + """Dataclass for SaveBrowserSessionProfileOutput structure.""" + + profile_identifier: str + """The unique identifier of the saved browser profile.""" + browser_identifier: str + """ + The unique identifier of the browser associated with the session from + which the profile was saved. + """ + session_id: str + """ + The unique identifier of the browser session from which the profile was + saved. + """ + last_updated_at: datetime + """ + The timestamp when the browser profile was last updated. This value is + in ISO 8601 format. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ScreenshotArguments(_SerdeShape): + """Arguments for a screenshot action.""" + + format: str | None = ... + """The image format for the screenshot. Defaults to `PNG`.""" + +class ScreenshotFormat(UnknownEnumMixin, StrEnum): + """The image format for a browser screenshot.""" + + PNG = "PNG" + +@dataclass(kw_only=True) +class ScreenshotResult(_SerdeShape): + """The result of a screenshot action.""" + + status: str + """The status of the action execution.""" + error: str | None = ... + """The error message. Present only when the action failed.""" + data: bytes | None = ... + """The base64-encoded image data. Present only when the action succeeded.""" + +@dataclass(kw_only=True) +class SearchCriteria(_SerdeShape): + """Contains search criteria for retrieving memory records.""" + + search_query: str + """The search query to use for finding relevant memory records.""" + memory_strategy_id: str | None = ... + """The memory strategy identifier to filter memory records by.""" + top_k: int = ... + """ + The maximum number of top-scoring memory records to return. This value + is used for semantic search ranking. + """ + metadata_filters: list[MemoryMetadataFilterExpression] | None = ... + """Filters to apply to metadata associated with a memory.""" + +@dataclass(kw_only=True) +class SearchRegistryRecordsInput(_SerdeShape): + """Dataclass for SearchRegistryRecordsInput structure.""" + + search_query: str | None = ... + """The search query to find matching registry records.""" + registry_ids: list[str] | None = ... + """ + The list of registry identifiers to search within. Currently, you can + specify exactly one registry identifier. You can provide either the full + Amazon Web Services Resource Name (ARN) or the 12-character alphanumeric + registry ID. + """ + max_results: int = ... + """ + The maximum number of records to return in a single call. Valid values + are 1 through 20. The default value is 10. + """ + filters: Document | None = ... + """ + A metadata filter expression to narrow search results. Uses structured + JSON operators including field-level operators (`$eq`, `$ne`, `$in`) and + logical operators (`$and`, `$or`) on filterable fields (`name`, + `descriptorType`, `version`). For example, to filter by descriptor type: + `{"descriptorType": {"$eq": "MCP"}}`. To combine filters: + `{"$and": [{"descriptorType": {"$eq": "MCP"}}, {"name": {"$eq": "my-tool"}}]}`. + """ + +@dataclass(kw_only=True) +class SearchRegistryRecordsOutput(_SerdeShape): + """Dataclass for SearchRegistryRecordsOutput structure.""" + + registry_records: list[RegistryRecordSummary] + """ + The list of registry records that match the search query, ordered by + relevance. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class SecretsManagerLocation(_SerdeShape): + """The Amazon Web Services Secrets Manager location configuration.""" + + secret_arn: str + """ + The ARN of the Amazon Web Services Secrets Manager secret containing the + certificate. + """ + +@dataclass(kw_only=True) +class ServerDefinition(_SerdeShape): + """ + The MCP server definition with a schema version and inline content. The + `schemaVersion` identifies the version of the MCP server configuration + schema. + """ + + schema_version: str | None = ... + """ + The schema version of the MCP server configuration. The schema version + identifies the format of the server definition content. + """ + inline_content: str | None = ... + """The inline content of the server definition.""" + +@dataclass(kw_only=True) +class ServiceException(ServiceError, _SerdeShape): + """The service encountered an internal error. Try your request again later.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ServiceQuotaExceededException(ServiceError, _SerdeShape): + """ + The exception that occurs when the request would cause a service quota + to be exceeded. Review your service quotas and either reduce your + request rate or request a quota increase. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class SessionFilter(_SerdeShape): + """Contains filter criteria for listing sessions.""" + + event_filter: str | None = ... + """ + The event filter condition to apply. Use this to filter sessions based + on event presence. + """ + +@dataclass(kw_only=True) +class SessionFilterConfig(_SerdeShape): + """ + A time range filter for selecting sessions. Specifies the start and end + times to narrow down which sessions are included. + """ + + start_time: datetime | None = ... + """ + The start time of the time range. Only sessions with activity at or + after this timestamp are included. + """ + end_time: datetime | None = ... + """ + The end time of the time range. Only sessions with activity before this + timestamp are included. + """ + +@dataclass(kw_only=True) +class SessionLimits(_SerdeShape): + """The spending limits configuration for a payment session.""" + + max_spend_amount: Amount + """The maximum amount that can be spent in the session.""" + +@dataclass(kw_only=True) +class SessionMetadataShape(_SerdeShape): + """ + Metadata for a specific session in a batch evaluation, including ground + truth data and test scenario identifiers. + """ + + session_id: str + """The unique identifier of the session this metadata applies to.""" + test_scenario_id: str | None = ... + """ + An optional test scenario identifier for categorizing and tracking + evaluation results. + """ + ground_truth: GroundTruthSource | None = ... + """ + The ground truth data for this session, including expected responses and + assertions. + """ + metadata: dict[str, str] | None = ... + """Additional key-value metadata associated with this session.""" + +class SessionStatus(UnknownEnumMixin, StrEnum): + IN_PROGRESS = "IN_PROGRESS" + FAILED = "FAILED" + +@dataclass(kw_only=True) +class SessionSummary(_SerdeShape): + """ + Contains summary information about a session in an AgentCore Memory + resource. + """ + + session_id: str + """The unique identifier of the session.""" + actor_id: str + """The identifier of the actor associated with the session.""" + created_at: datetime + """The timestamp when the session was created.""" + +@dataclass(kw_only=True) +class SessionTraceIds(_SerdeShape): + """ + A pairing of a session with the specific trace IDs to evaluate within + that session. Use this to evaluate individual traces rather than an + entire session. + """ + + session_id: str + """ + The unique identifier of the session that contains the traces to + evaluate. + """ + trace_ids: list[str] + """The list of trace IDs within the session to evaluate.""" + +@dataclass(kw_only=True) +class SkillDefinition(_SerdeShape): + """ + The structured skill definition with a schema version and inline + content. + """ + + schema_version: str | None = ... + """ + The schema version of the skill definition. If you don't specify a + version, the service detects it automatically. + """ + inline_content: str | None = ... + """The inline content of the skill definition.""" + +@dataclass(kw_only=True) +class SkillMdDefinition(_SerdeShape): + """The skill markdown definition for agent skills descriptors.""" + + inline_content: str | None = ... + """The inline markdown content of the skill definition.""" + +@dataclass(kw_only=True) +class SpanContext(_SerdeShape): + """ + The contextual information that uniquely identifies a span within the + distributed tracing system. Contains session, trace, and span + identifiers used to correlate evaluation results with specific agent + execution points. + """ + + session_id: str + """ + The unique identifier of the session containing this span. Sessions + represent complete conversation flows and are detected using + configurable `SessionTimeoutMinutes` (default 15 minutes). + """ + trace_id: str | None = ... + """ + The unique identifier of the trace containing this span. Traces + represent individual request-response interactions within a session and + group related spans together. + """ + span_id: str | None = ... + """ + The unique identifier of the specific span being referenced. Spans + represent individual operations like tool calls, model invocations, or + other discrete actions within the agent's execution. + """ + +@dataclass(kw_only=True) +class StartBatchEvaluationInput(_SerdeShape): + """Dataclass for StartBatchEvaluationInput structure.""" + + batch_evaluation_name: str | None = ... + """The name of the batch evaluation. Must be unique within your account.""" + evaluators: list[Evaluator] | None = ... + """ + The list of evaluators to apply during the batch evaluation. Can include + both built-in evaluators and custom evaluators. Maximum of 10 + evaluators. + """ + insights: list[Insight] | None = ... + """ + The list of insight analyses to run against sessions during the batch + evaluation. Maximum of 10 insights. + """ + data_source_config: DataSourceConfig | None = ... + """ + The data source configuration that specifies where to pull agent session + traces from for evaluation. + """ + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If this token matches a previous + request, the service ignores the request, but does not return an error. + """ + evaluation_metadata: EvaluationMetadata | None = ... + """ + Optional metadata for the evaluation, including session-specific ground + truth data and test scenario identifiers. + """ + tags: dict[str, str] | None = ... + """A map of tag keys and values to associate with the batch evaluation.""" + kms_key_arn: str | None = ... + """ + The ARN of the KMS key used to encrypt evaluation data. If provided, + customer data is encrypted at rest with the specified key. + """ + description: str | None = ... + """The description of the batch evaluation.""" + output_config: OutputConfig | None = ... + """Output destination configuration.""" + +@dataclass(kw_only=True) +class StartBatchEvaluationOutput(_SerdeShape): + """Dataclass for StartBatchEvaluationOutput structure.""" + + batch_evaluation_id: str + """The unique identifier of the created batch evaluation.""" + batch_evaluation_arn: str + """The Amazon Resource Name (ARN) of the created batch evaluation.""" + batch_evaluation_name: str + """The name of the batch evaluation.""" + evaluators: list[Evaluator] | None = ... + """The list of evaluators applied during the batch evaluation.""" + insights: list[Insight] | None = ... + """The list of insight analyses applied during the batch evaluation.""" + status: str + """The status of the batch evaluation.""" + created_at: datetime + """The timestamp when the batch evaluation was created.""" + output_config: OutputConfig | None = ... + """ + The output configuration specifying where evaluation results are + written. + """ + tags: dict[str, str] | None = ... + """The tags associated with the batch evaluation.""" + kms_key_arn: str | None = ... + """The ARN of the KMS key used to encrypt evaluation data.""" + description: str | None = ... + """The description of the batch evaluation.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class StartBrowserSessionInput(_SerdeShape): + """Dataclass for StartBrowserSessionInput structure.""" + + trace_id: str | None = ... + """The trace identifier for request tracking.""" + trace_parent: str | None = ... + """The parent trace information for distributed tracing.""" + browser_identifier: str | None = ... + """ + The unique identifier of the browser to use for this session. This + identifier specifies which browser environment to initialize for the + session. + """ + name: str | None = ... + """ + The name of the browser session. This name helps you identify and manage + the session. The name does not need to be unique. + """ + session_timeout_seconds: int = ... + """ + The duration in seconds (time-to-live) after which the session + automatically terminates, regardless of ongoing activity. Defaults to + 3600 seconds (1 hour). Recommended minimum: 60 seconds. Maximum allowed: + 28,800 seconds (8 hours). + """ + view_port: ViewPort | None = ... + """ + The dimensions of the browser viewport for this session. This determines + the visible area of the web content and affects how web pages are + rendered. If not specified, Amazon Bedrock AgentCore uses a default + viewport size. + """ + extensions: list[BrowserExtension] | None = ... + """A list of browser extensions to load into the browser session.""" + profile_configuration: BrowserProfileConfiguration | None = ... + """ + The browser profile configuration to use for this session. A browser + profile contains persistent data such as cookies and local storage that + can be reused across multiple browser sessions. If specified, the + session initializes with the profile's stored data, enabling continuity + for tasks that require authentication or personalized settings. + """ + proxy_configuration: ProxyConfiguration | None = ... + """ + Optional proxy configuration for routing browser traffic through + customer-specified proxy servers. When provided, enables HTTP Basic + authentication via Amazon Web Services Secrets Manager and domain-based + routing rules. Requires `secretsmanager:GetSecretValue` IAM permission + for the specified secret ARNs. + """ + enterprise_policies: list[BrowserEnterprisePolicy] | None = ... + """A list of files containing enterprise policies for the browser.""" + certificates: list[Certificate] | None = ... + """A list of certificates to install in the browser session.""" + filesystem_configurations: list[ToolsFileSystemConfiguration] | None = ... + """ + The file system configurations to mount into the browser session. Use + these configurations to mount your own Amazon Simple Storage Service + (Amazon S3) Files or Amazon Elastic File System (Amazon EFS) access + points. Your session can then read and write your data. If you don't + specify this field, no additional file systems are mounted. + """ + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If this token matches a previous + request, Amazon Bedrock AgentCore ignores the request, but does not + return an error. This parameter helps prevent the creation of duplicate + sessions if there are temporary network issues. + """ + +@dataclass(kw_only=True) +class StartBrowserSessionOutput(_SerdeShape): + """Dataclass for StartBrowserSessionOutput structure.""" + + browser_identifier: str + """The identifier of the browser.""" + session_id: str + """The unique identifier of the created browser session.""" + created_at: datetime + """The timestamp when the browser session was created.""" + streams: BrowserSessionStream | None = ... + """ + The streams associated with this browser session. These include the + automation stream and live view stream. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class StartCodeInterpreterSessionInput(_SerdeShape): + """Dataclass for StartCodeInterpreterSessionInput structure.""" + + trace_id: str | None = ... + """The trace identifier for request tracking.""" + trace_parent: str | None = ... + """The parent trace information for distributed tracing.""" + code_interpreter_identifier: str | None = ... + """ + The unique identifier of the code interpreter to use for this session. + This identifier specifies which code interpreter environment to + initialize for the session. + """ + name: str | None = ... + """ + The name of the code interpreter session. This name helps you identify + and manage the session. The name does not need to be unique. + """ + session_timeout_seconds: int = ... + """ + The duration in seconds (time-to-live) after which the session + automatically terminates, regardless of ongoing activity. Defaults to + 900 seconds (15 minutes). Recommended minimum: 60 seconds. Maximum + allowed: 28,800 seconds (8 hours). + """ + certificates: list[Certificate] | None = ... + """A list of certificates to install in the code interpreter session.""" + filesystem_configurations: list[ToolsFileSystemConfiguration] | None = ... + """ + The file system configurations to mount into the code interpreter + session. Use these configurations to mount your own Amazon Simple + Storage Service (Amazon S3) Files or Amazon Elastic File System (Amazon + EFS) access points. Your session can then read and write your data. If + you don't specify this field, no additional file systems are mounted. + """ + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If this token matches a previous + request, Amazon Bedrock AgentCore ignores the request, but does not + return an error. This parameter helps prevent the creation of duplicate + sessions if there are temporary network issues. + """ + +@dataclass(kw_only=True) +class StartCodeInterpreterSessionOutput(_SerdeShape): + """Dataclass for StartCodeInterpreterSessionOutput structure.""" + + code_interpreter_identifier: str + """The identifier of the code interpreter.""" + session_id: str + """The unique identifier of the created code interpreter session.""" + created_at: datetime + """The time at which the code interpreter session was created.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class StartMemoryExtractionJobInput(_SerdeShape): + """Dataclass for StartMemoryExtractionJobInput structure.""" + + memory_id: str | None = ... + """The unique identifier of the memory for which to start extraction jobs.""" + extraction_job: ExtractionJob | None = ... + """Extraction job to start in this operation.""" + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure idempotent processing of + the request. + """ + +@dataclass(kw_only=True) +class StartMemoryExtractionJobOutput(_SerdeShape): + """Dataclass for StartMemoryExtractionJobOutput structure.""" + + job_id: str + """Extraction Job ID that was attempted to start.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class StartRecommendationInput(_SerdeShape): + """Dataclass for StartRecommendationInput structure.""" + + name: str | None = ... + """The name of the recommendation. Must be unique within your account.""" + description: str | None = ... + """The description of the recommendation.""" + type: str | None = ... + """ + The type of recommendation to generate. Valid values are + `SYSTEM_PROMPT_RECOMMENDATION` for system prompt optimization or + `TOOL_DESCRIPTION_RECOMMENDATION` for tool description optimization. + """ + recommendation_config: RecommendationConfig | None = ... + """ + The configuration for the recommendation, including the input to + optimize, agent traces to analyze, and evaluation settings. + """ + kms_key_arn: str | None = ... + """ + The ARN of the KMS key used to encrypt recommendation data. If provided, + customer data is encrypted at rest with the specified key. + """ + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If this token matches a previous + request, the service ignores the request, but does not return an error. + """ + tags: dict[str, str] | None = ... + """A map of tag keys and values to associate with the recommendation.""" + +@dataclass(kw_only=True) +class StartRecommendationOutput(_SerdeShape): + """Dataclass for StartRecommendationOutput structure.""" + + recommendation_id: str + """The unique identifier of the created recommendation.""" + recommendation_arn: str + """The Amazon Resource Name (ARN) of the created recommendation.""" + name: str + """The name of the recommendation.""" + description: str | None = ... + """The description of the recommendation.""" + type: str + """The type of recommendation.""" + recommendation_config: RecommendationConfig + """The configuration for the recommendation.""" + status: str + """The status of the recommendation.""" + created_at: datetime + """The timestamp when the recommendation was created.""" + updated_at: datetime + """The timestamp when the recommendation was last updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class StopBatchEvaluationInput(_SerdeShape): + """Dataclass for StopBatchEvaluationInput structure.""" + + batch_evaluation_id: str | None = ... + """The unique identifier of the batch evaluation to stop.""" + +@dataclass(kw_only=True) +class StopBatchEvaluationOutput(_SerdeShape): + """Dataclass for StopBatchEvaluationOutput structure.""" + + batch_evaluation_id: str + """The unique identifier of the stopped batch evaluation.""" + batch_evaluation_arn: str + """The Amazon Resource Name (ARN) of the stopped batch evaluation.""" + status: str + """The status of the batch evaluation after the stop request.""" + description: str | None = ... + """The description of the batch evaluation.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class StopBrowserSessionInput(_SerdeShape): + """Dataclass for StopBrowserSessionInput structure.""" + + trace_id: str | None = ... + """The trace identifier for request tracking.""" + trace_parent: str | None = ... + """The parent trace information for distributed tracing.""" + browser_identifier: str | None = ... + """The unique identifier of the browser associated with the session.""" + session_id: str | None = ... + """The unique identifier of the browser session to stop.""" + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If this token matches a previous + request, Amazon Bedrock AgentCore ignores the request, but does not + return an error. + """ + +@dataclass(kw_only=True) +class StopBrowserSessionOutput(_SerdeShape): + """Dataclass for StopBrowserSessionOutput structure.""" + + browser_identifier: str + """The identifier of the browser.""" + session_id: str + """The identifier of the browser session.""" + last_updated_at: datetime + """The time at which the browser session was last updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class StopCodeInterpreterSessionInput(_SerdeShape): + """Dataclass for StopCodeInterpreterSessionInput structure.""" + + trace_id: str | None = ... + """The trace identifier for request tracking.""" + trace_parent: str | None = ... + """The parent trace information for distributed tracing.""" + code_interpreter_identifier: str | None = ... + """ + The unique identifier of the code interpreter associated with the + session. + """ + session_id: str | None = ... + """The unique identifier of the code interpreter session to stop.""" + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If this token matches a previous + request, Amazon Bedrock AgentCore ignores the request, but does not + return an error. + """ + +@dataclass(kw_only=True) +class StopCodeInterpreterSessionOutput(_SerdeShape): + """Dataclass for StopCodeInterpreterSessionOutput structure.""" + + code_interpreter_identifier: str + """The identifier of the code interpreter.""" + session_id: str + """The identifier of the code interpreter session.""" + last_updated_at: datetime + """The timestamp when the code interpreter session was last updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class StopRuntimeSessionInput(_SerdeShape): + """Dataclass for StopRuntimeSessionInput structure.""" + + runtime_session_id: str | None = ... + """The ID of the session that you want to stop.""" + agent_runtime_arn: str | None = ... + """The ARN of the agent that contains the session that you want to stop.""" + qualifier: str | None = ... + """ + Optional qualifier to specify an agent alias, such as `prod`code> or + `dev`. If you don't provide a value, the DEFAULT alias is used. + """ + client_token: str | None = ... + """ + Idempotent token used to identify the request. If you use the same token + with multiple requests, the same response is returned. Use ClientToken + to prevent the same request from being processed more than once. + """ + +@dataclass(kw_only=True) +class StopRuntimeSessionOutput(_SerdeShape): + """Dataclass for StopRuntimeSessionOutput structure.""" + + runtime_session_id: str | None = ... + """The ID of the session that you requested to stop.""" + status_code: int | None = ... + """The status code of the request to stop the session.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass +class StreamUpdateAutomationStreamUpdate(_SerdeShape): + """The update to an automation stream.""" + + value: AutomationStreamUpdate + +@dataclass +class StreamUpdateUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +StreamUpdate = Union[StreamUpdateAutomationStreamUpdate | StreamUpdateUnknown] +"""Contains information about an update to a stream.""" + +class _StreamUpdateDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> StreamUpdate: ... + +@dataclass(kw_only=True) +class StripePrivyTokenRequestInput(_SerdeShape): + """Stripe Privy token request parameters.""" + + request_host: str | None = ... + """The host for the Privy API request. Defaults to \"api.privy.io\".""" + request_path: str + """The path of the Stripe Privy API request.""" + request_body: str + """Request body JSON for the Privy API call.""" + include_authorization_signature: bool = ... + """Set to true to generate privy-authorization-signature.""" + +@dataclass(kw_only=True) +class StripePrivyTokenResponseOutput(_SerdeShape): + """ + Stripe Privy token response containing appId, basicAuthToken, and + optionally authorizationSignature. + """ + + authorization_signature: str | None = ... + """ + Base64-encoded ECDSA P-256 authorization signature (only present when + includeAuthorizationSignature is true). + """ + request_expiry: int | None = ... + """Unix timestamp in milliseconds when the authorization signature expires.""" + app_id: str + """The Privy app ID for the privy-app-id header.""" + basic_auth_token: str + """ + Base64-encoded Basic Auth token (appId:appSecret) for the Authorization + header. + """ + +@dataclass(kw_only=True) +class SubscriptionRequiredException(ServiceError, _SerdeShape): + """ + Returned when you attempt a wallet operation against a Coinbase + Marketplace connector whose account does not hold an active Marketplace + subscription and is not within the legacy exception period. Subscribe to + the Marketplace listing before you retry the operation. + """ + + subscription_url: str | None = ... + """The URL to the Marketplace listing where you can subscribe.""" + product_name: str | None = ... + """The name of the product that requires a Marketplace subscription.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass +class SystemPromptConfigText(_SerdeShape): + """The system prompt text provided inline.""" + + value: str + +@dataclass +class SystemPromptConfigConfigurationBundle(_SerdeShape): + """The system prompt sourced from a configuration bundle version.""" + + value: SystemPromptConfigurationBundle + +@dataclass +class SystemPromptConfigUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +SystemPromptConfig = Union[ + SystemPromptConfigText + | SystemPromptConfigConfigurationBundle + | SystemPromptConfigUnknown +] +""" +The system prompt input, either as inline text or from a configuration +bundle. +""" + +class _SystemPromptConfigDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> SystemPromptConfig: ... + +@dataclass(kw_only=True) +class SystemPromptConfigurationBundle(_SerdeShape): + """A system prompt sourced from a configuration bundle version.""" + + bundle_arn: str + """The Amazon Resource Name (ARN) of the configuration bundle.""" + version_id: str + """The version identifier of the configuration bundle.""" + system_prompt_json_path: str + """ + The JSON path within the configuration bundle that contains the system + prompt. + """ + +@dataclass(kw_only=True) +class SystemPromptRecommendationConfig(_SerdeShape): + """Configuration for generating system prompt optimization recommendations.""" + + system_prompt: SystemPromptConfig + """The current system prompt to optimize.""" + agent_traces: AgentTracesConfig + """The agent traces to analyze for generating recommendations.""" + evaluation_config: RecommendationEvaluationConfig | None = ... + """ + The evaluation configuration specifying which evaluator to use for + assessing recommendation quality. + """ + +@dataclass(kw_only=True) +class SystemPromptRecommendationResult(_SerdeShape): + """ + The result of a system prompt recommendation, containing the optimized + prompt. + """ + + recommended_system_prompt: str | None = ... + """The optimized system prompt text generated by the recommendation.""" + configuration_bundle: RecommendationResultConfigurationBundle | None = ... + """ + The configuration bundle containing the recommended system prompt, if + the input was sourced from a configuration bundle. + """ + explanation: str | None = ... + """ + An explanation of why the recommendation was generated and what patterns + were identified in the agent traces. + """ + error_code: str | None = ... + """The error code if the recommendation failed.""" + error_message: str | None = ... + """The error message if the recommendation failed.""" + +@dataclass(kw_only=True) +class TargetRef(_SerdeShape): + """A reference to a gateway target.""" + + name: str + """The name of the gateway target.""" + +class TaskStatus(UnknownEnumMixin, StrEnum): + SUBMITTED = "submitted" + WORKING = "working" + COMPLETED = "completed" + CANCELED = "canceled" + FAILED = "failed" + +@dataclass(kw_only=True) +class ThrottledException(ServiceError, _SerdeShape): + """ + The request was denied due to request throttling. Reduce the frequency + of requests and try again. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ThrottlingException(ServiceError, _SerdeShape): + """ + The exception that occurs when the request was denied due to request + throttling. This happens when you exceed the allowed request rate for an + operation. Reduce the frequency of requests or implement exponential + backoff retry logic in your application. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class TokenBalance(_SerdeShape): + """A single token balance entry.""" + + amount: str + """ + Raw balance in the smallest denomination (e.g., USDC base units where 1 + USDC = 1000000). + """ + decimals: int + """Number of decimal places for the token (e.g., 6 for USDC).""" + token: str + """The supported token for this balance.""" + network: str + """The blockchain network family (ETHEREUM or SOLANA).""" + chain: str + """The specific blockchain chain.""" + +@dataclass(kw_only=True) +class TokenUsage(_SerdeShape): + """ + The token consumption statistics for language model operations during + evaluation. Provides detailed breakdown of input, output, and total + tokens used for cost tracking and performance monitoring. + """ + + input_tokens: int | None = ... + """ + The number of tokens consumed for input processing during the + evaluation. Includes tokens from the evaluation prompt, agent traces, + and any additional context provided to the evaluator model. + """ + output_tokens: int | None = ... + """ + The number of tokens generated by the evaluator model in its response. + Includes tokens for the score, explanation, and any additional output + produced during the evaluation process. + """ + total_tokens: int | None = ... + """ + The total number of tokens consumed during the evaluation, calculated as + the sum of input and output tokens. Used for cost calculation and rate + limiting within the service limits. + """ + +@dataclass(kw_only=True) +class ToolArguments(_SerdeShape): + """ + The collection of arguments that specify the operation to perform and + its parameters when invoking a tool in Amazon Bedrock AgentCore. + Different tools require different arguments, and this structure provides + a flexible way to pass the appropriate arguments to each tool type. + """ + + code: str | None = ... + """ + The code to execute in a code interpreter session. This is the source + code in the specified programming language that will be executed by the + code interpreter. + """ + language: str | None = ... + """ + The programming language of the code to execute. This tells the code + interpreter which language runtime to use for execution. + """ + clear_context: bool | None = ... + """Whether to clear the context for the tool.""" + command: str | None = ... + """The command to execute with the tool.""" + path: str | None = ... + """The path for the tool operation.""" + paths: list[str] | None = ... + """The paths for the tool operation.""" + content: list[InputContentBlock] | None = ... + """The content for the tool operation.""" + directory_path: str | None = ... + """The directory path for the tool operation.""" + task_id: str | None = ... + """The identifier of the task for the tool operation.""" + runtime: str | None = ... + """ + The runtime environment to use for code execution. If not specified, + defaults to `deno` for JavaScript and TypeScript. + """ + +@dataclass +class ToolDescriptionConfigText(_SerdeShape): + """The tool description as inline text.""" + + value: str + +@dataclass +class ToolDescriptionConfigUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ToolDescriptionConfig = Union[ToolDescriptionConfigText | ToolDescriptionConfigUnknown] +"""The tool description content.""" + +class _ToolDescriptionConfigDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> ToolDescriptionConfig: ... + +@dataclass(kw_only=True) +class ToolDescriptionConfigurationBundle(_SerdeShape): + """Tool descriptions sourced from a configuration bundle version.""" + + bundle_arn: str + """The Amazon Resource Name (ARN) of the configuration bundle.""" + version_id: str + """The version identifier of the configuration bundle.""" + tools: list[ConfigurationBundleToolEntry] + """ + The list of tool entries mapping tool names to their JSON paths within + the bundle. + """ + +@dataclass(kw_only=True) +class ToolDescriptionInput(_SerdeShape): + """ + A tool description input containing the tool name and its current + description. + """ + + tool_name: str + """The name of the tool.""" + tool_description: ToolDescriptionConfig + """The current description of the tool to optimize.""" + +@dataclass(kw_only=True) +class ToolDescriptionOutput(_SerdeShape): + """The output for a single tool description recommendation.""" + + tool_name: str + """The name of the tool.""" + recommended_tool_description: str | None = ... + """The optimized tool description text generated by the recommendation.""" + explanation: str | None = ... + """ + An explanation of why the recommendation was generated for this tool and + what patterns were identified in the agent traces. + """ + +@dataclass(kw_only=True) +class ToolDescriptionRecommendationConfig(_SerdeShape): + """ + Configuration for generating tool description optimization + recommendations. + """ + + tool_description: ToolDescriptionSource + """The current tool descriptions to optimize.""" + agent_traces: AgentTracesConfig + """ + The agent traces to analyze for generating tool description + recommendations. + """ + +@dataclass(kw_only=True) +class ToolDescriptionRecommendationResult(_SerdeShape): + """ + The result of a tool description recommendation, containing optimized + descriptions. + """ + + tools: list[ToolDescriptionOutput] | None = ... + """The list of tools with their recommended descriptions.""" + configuration_bundle: RecommendationResultConfigurationBundle | None = ... + """ + The configuration bundle containing the recommended tool descriptions, + if the input was sourced from a configuration bundle. + """ + error_code: str | None = ... + """The error code if the recommendation failed.""" + error_message: str | None = ... + """The error message if the recommendation failed.""" + +@dataclass +class ToolDescriptionSourceToolDescriptionText(_SerdeShape): + """Tool descriptions provided as inline text.""" + + value: ToolDescriptionTextInput + +@dataclass +class ToolDescriptionSourceConfigurationBundle(_SerdeShape): + """Tool descriptions sourced from a configuration bundle version.""" + + value: ToolDescriptionConfigurationBundle + +@dataclass +class ToolDescriptionSourceUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ToolDescriptionSource = Union[ + ToolDescriptionSourceToolDescriptionText + | ToolDescriptionSourceConfigurationBundle + | ToolDescriptionSourceUnknown +] +""" +The source of tool descriptions, either inline text or from a +configuration bundle. +""" + +class _ToolDescriptionSourceDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> ToolDescriptionSource: ... + +@dataclass(kw_only=True) +class ToolDescriptionTextInput(_SerdeShape): + """Inline tool description input containing a list of tools.""" + + tools: list[ToolDescriptionInput] + """The list of tool descriptions to optimize.""" + +class ToolName(UnknownEnumMixin, StrEnum): + EXECUTE_CODE = "executeCode" + EXECUTE_COMMAND = "executeCommand" + READ_FILES = "readFiles" + LIST_FILES = "listFiles" + REMOVE_FILES = "removeFiles" + WRITE_FILES = "writeFiles" + START_COMMAND_EXECUTION = "startCommandExecution" + GET_TASK = "getTask" + STOP_TASK = "stopTask" + +@dataclass(kw_only=True) +class ToolResultStructuredContent(_SerdeShape): + """Contains structured content from a tool result.""" + + task_id: str | None = ... + """The identifier of the task that produced the result.""" + task_status: str | None = ... + """The status of the task that produced the result.""" + stdout: str | None = ... + """The standard output from the tool execution.""" + stderr: str | None = ... + """The standard error output from the tool execution.""" + exit_code: int | None = ... + """The exit code from the tool execution.""" + execution_time: float | None = ... + """The execution time of the tool operation in milliseconds.""" + +@dataclass(kw_only=True) +class ToolsDefinition(_SerdeShape): + """ + The MCP tools definition with a protocol version and inline content. The + `protocolVersion` identifies the MCP protocol version that the tools + conform to. This differs from `schemaVersion` in the server definition, + which identifies the server configuration schema format. + """ + + protocol_version: str | None = ... + """ + The MCP protocol version that the tools conform to. This differs from + the `schemaVersion` field in the server definition, which identifies the + server configuration schema format. + """ + inline_content: str | None = ... + """The inline content of the tools definition.""" + +@dataclass +class ToolsFileSystemConfigurationS3FilesConfiguration(_SerdeShape): + """ + The configuration for mounting your own Amazon Simple Storage Service + (Amazon S3) Files access point into the session. + """ + + value: S3FilesConfiguration + +@dataclass +class ToolsFileSystemConfigurationEfsConfiguration(_SerdeShape): + """ + The configuration for mounting your own Amazon Elastic File System + (Amazon EFS) access point into the session. + """ + + value: EfsConfiguration + +@dataclass +class ToolsFileSystemConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ToolsFileSystemConfiguration = Union[ + ToolsFileSystemConfigurationS3FilesConfiguration + | ToolsFileSystemConfigurationEfsConfiguration + | ToolsFileSystemConfigurationUnknown +] +""" +Specifies a file system to mount into the session by providing exactly +one of the following: + +- `s3FilesConfiguration` - Mounts an Amazon Simple Storage Service + (Amazon S3) Files access point. + +- `efsConfiguration` - Mounts an Amazon Elastic File System (Amazon EFS) + access point. +""" + +class _ToolsFileSystemConfigurationDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> ToolsFileSystemConfiguration: ... + +@dataclass(kw_only=True) +class UnauthorizedException(ServiceError, _SerdeShape): + """ + This exception is thrown when the JWT bearer token is invalid or not + found for OAuth bearer token based access + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateABTestInput(_SerdeShape): + """Dataclass for UpdateABTestInput structure.""" + + ab_test_id: str | None = ... + """The unique identifier of the A/B test to update.""" + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If this token matches a previous + request, the service ignores the request, but does not return an error. + """ + name: str | None = ... + """The updated name of the A/B test.""" + description: str | None = ... + """The updated description of the A/B test.""" + variants: list[Variant] | None = ... + """The updated list of variants.""" + gateway_filter: GatewayFilter | None = ... + """The updated gateway filter.""" + evaluation_config: ABTestEvaluationConfig | None = ... + """The updated evaluation configuration.""" + role_arn: str | None = ... + """The updated IAM role ARN.""" + execution_status: str | None = ... + """The updated execution status to enable or disable the A/B test.""" + +@dataclass(kw_only=True) +class UpdateABTestOutput(_SerdeShape): + """Dataclass for UpdateABTestOutput structure.""" + + ab_test_id: str + """The unique identifier of the updated A/B test.""" + ab_test_arn: str + """The Amazon Resource Name (ARN) of the updated A/B test.""" + status: str + """The status of the A/B test.""" + execution_status: str + """The execution status of the A/B test.""" + updated_at: datetime + """The timestamp when the A/B test was updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateBrowserStreamInput(_SerdeShape): + """Dataclass for UpdateBrowserStreamInput structure.""" + + browser_identifier: str | None = ... + """The identifier of the browser.""" + session_id: str | None = ... + """The identifier of the browser session.""" + stream_update: StreamUpdate | None = ... + """The update to apply to the browser stream.""" + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the operation + completes no more than one time. If this token matches a previous + request, Amazon Bedrock ignores the request, but does not return an + error. + """ + +@dataclass(kw_only=True) +class UpdateBrowserStreamOutput(_SerdeShape): + """Dataclass for UpdateBrowserStreamOutput structure.""" + + browser_identifier: str + """The identifier of the browser.""" + session_id: str + """The identifier of the browser session.""" + streams: BrowserSessionStream + """ + The collection of streams associated with a browser session in Amazon + Bedrock AgentCore. These streams provide different ways to interact with + and observe the browser session, including programmatic control and + visual representation of the browser content. + """ + updated_at: datetime + """The time at which the browser stream was updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass +class UserIdentifierUserToken(_SerdeShape): + """ + The OAuth2.0 token issued by the user's identity provider that was used + to generate the workload access token + """ + + value: str + +@dataclass +class UserIdentifierUserId(_SerdeShape): + """ + The ID of the user for whom you have retrieved a workload access token + for + """ + + value: str + +@dataclass +class UserIdentifierUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +UserIdentifier = Union[ + UserIdentifierUserToken | UserIdentifierUserId | UserIdentifierUnknown +] +""" +The OAuth2.0 token or user ID that was used to generate the workload +access token used for initiating the user authorization flow to retrieve +OAuth2.0 tokens. +""" + +class _UserIdentifierDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> UserIdentifier: ... + +@dataclass(kw_only=True) +class UserIntentAffectedSession(_SerdeShape): + """A session associated with a user intent cluster.""" + + session_id: str + """The unique identifier of the session.""" + user_messages: list[str] + """ + The user messages from this session that contributed to the intent + cluster. + """ + +@dataclass(kw_only=True) +class UserIntentCluster(_SerdeShape): + """A cluster of similar user intents identified across sessions.""" + + cluster_id: int + """The unique identifier of the user intent cluster.""" + name: str + """The name of the user intent cluster.""" + description: str + """A description of the user intent pattern.""" + affected_session_count: int + """The number of sessions with this user intent.""" + affected_sessions: list[UserIntentAffectedSession] + """The list of sessions with this user intent.""" + +@dataclass(kw_only=True) +class UserIntentClusteringResultContent(_SerdeShape): + """ + The user intent clustering result containing grouped user intents + identified across evaluated sessions. + """ + + user_intents: list[UserIntentCluster] + """The list of user intent clusters identified across analyzed sessions.""" + +@dataclass(kw_only=True) +class ValidationException(ServiceError, _SerdeShape): + """ + The exception that occurs when the input fails to satisfy the + constraints specified by the service. Check the error message for + details about which input parameter is invalid and correct your request. + """ + + reason: str + field_list: list[ValidationExceptionField] | None = ... + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ValidationExceptionField(_SerdeShape): + """ + Stores information about a field passed inside a request that resulted + in an exception. + """ + + name: str + """The name of the field.""" + message: str + """A message describing why this field failed validation.""" + +class ValidationExceptionReason(UnknownEnumMixin, StrEnum): + CANNOT_PARSE = "CannotParse" + FIELD_VALIDATION_FAILED = "FieldValidationFailed" + IDEMPOTENT_PARAMETER_MISMATCH_EXCEPTION = "IdempotentParameterMismatchException" + ROOT_EVENT_IN_OTHER_SESSION = "EventInOtherSession" + RESOURCE_CONFLICT = "ResourceConflict" + +@dataclass(kw_only=True) +class Variant(_SerdeShape): + """ + A variant in an A/B test, representing either the control (C) or + treatment (T1) configuration. + """ + + name: str + """The name of the variant. Must be `C` for control or `T1` for treatment.""" + weight: int + """ + The percentage of traffic to route to this variant. Weights across all + variants must sum to 100. + """ + variant_configuration: VariantConfiguration + """ + The configuration for this variant, including the configuration bundle + or target reference. + """ + +@dataclass(kw_only=True) +class VariantConfiguration(_SerdeShape): + """The configuration for an A/B test variant.""" + + configuration_bundle: ConfigurationBundleRef | None = ... + """A reference to a configuration bundle version to use for this variant.""" + target: TargetRef | None = ... + """A reference to a gateway target to route traffic to for this variant.""" + +@dataclass(kw_only=True) +class VariantResult(_SerdeShape): + """ + Statistical results for a treatment variant compared against the + control. + """ + + variant_name: str + """The name of the treatment variant.""" + sample_size: int + """The number of sessions evaluated for this variant.""" + mean: float + """The mean evaluation score for this variant.""" + absolute_change: float | None = ... + """The absolute change in mean score compared to the control variant.""" + percent_change: float | None = ... + """The percentage change in mean score compared to the control variant.""" + p_value: float | None = ... + """ + The p-value indicating the statistical significance of the observed + difference. + """ + confidence_interval: ConfidenceInterval | None = ... + """The confidence interval for the observed difference.""" + is_significant: bool + """Whether the observed difference is statistically significant.""" + +@dataclass(kw_only=True) +class ViewPort(_SerdeShape): + """ + The configuration that defines the dimensions of a browser viewport in a + browser session. The viewport determines the visible area of web content + and affects how web pages are rendered and displayed. Proper viewport + configuration ensures that web content is displayed correctly for the + agent's browsing tasks. + """ + + width: int + """ + The width of the viewport in pixels. This value determines the + horizontal dimension of the visible area. Valid values range from 800 to + 1920 pixels. + """ + height: int + """ + The height of the viewport in pixels. This value determines the vertical + dimension of the visible area. Valid values range from 600 to 1080 + pixels. + """ + +@dataclass(kw_only=True) +class Unit(_SerdeShape): + """Dataclass for Unit structure.""" + +BATCH_CREATE_MEMORY_RECORDS: APIOperation[ + BatchCreateMemoryRecordsInput, BatchCreateMemoryRecordsOutput +] +BATCH_DELETE_MEMORY_RECORDS: APIOperation[ + BatchDeleteMemoryRecordsInput, BatchDeleteMemoryRecordsOutput +] +BATCH_UPDATE_MEMORY_RECORDS: APIOperation[ + BatchUpdateMemoryRecordsInput, BatchUpdateMemoryRecordsOutput +] +COMPLETE_RESOURCE_TOKEN_AUTH: APIOperation[ + CompleteResourceTokenAuthInput, CompleteResourceTokenAuthOutput +] +CREATE_AB_TEST: APIOperation[CreateABTestInput, CreateABTestOutput] +CREATE_EVENT: APIOperation[CreateEventInput, CreateEventOutput] +CREATE_PAYMENT_INSTRUMENT: APIOperation[ + CreatePaymentInstrumentInput, CreatePaymentInstrumentOutput +] +CREATE_PAYMENT_SESSION: APIOperation[ + CreatePaymentSessionInput, CreatePaymentSessionOutput +] +DELETE_AB_TEST: APIOperation[DeleteABTestInput, DeleteABTestOutput] +DELETE_BATCH_EVALUATION: APIOperation[ + DeleteBatchEvaluationInput, DeleteBatchEvaluationOutput +] +DELETE_CAPACITY_PROVIDER_SESSION: APIOperation[ + DeleteCapacityProviderSessionInput, DeleteCapacityProviderSessionOutput +] +DELETE_EVENT: APIOperation[DeleteEventInput, DeleteEventOutput] +DELETE_MEMORY_RECORD: APIOperation[DeleteMemoryRecordInput, DeleteMemoryRecordOutput] +DELETE_PAYMENT_INSTRUMENT: APIOperation[ + DeletePaymentInstrumentInput, DeletePaymentInstrumentOutput +] +DELETE_PAYMENT_SESSION: APIOperation[ + DeletePaymentSessionInput, DeletePaymentSessionOutput +] +DELETE_RECOMMENDATION: APIOperation[ + DeleteRecommendationInput, DeleteRecommendationOutput +] +EVALUATE: APIOperation[EvaluateInput, EvaluateOutput] +GET_AB_TEST: APIOperation[GetABTestInput, GetABTestOutput] +GET_AGENT_CARD: APIOperation[GetAgentCardInput, GetAgentCardOutput] +GET_BATCH_EVALUATION: APIOperation[GetBatchEvaluationInput, GetBatchEvaluationOutput] +GET_BROWSER_SESSION: APIOperation[GetBrowserSessionInput, GetBrowserSessionOutput] +GET_CODE_INTERPRETER_SESSION: APIOperation[ + GetCodeInterpreterSessionInput, GetCodeInterpreterSessionOutput +] +GET_EVENT: APIOperation[GetEventInput, GetEventOutput] +GET_MEMORY_RECORD: APIOperation[GetMemoryRecordInput, GetMemoryRecordOutput] +GET_PAYMENT_INSTRUMENT: APIOperation[ + GetPaymentInstrumentInput, GetPaymentInstrumentOutput +] +GET_PAYMENT_INSTRUMENT_BALANCE: APIOperation[ + GetPaymentInstrumentBalanceInput, GetPaymentInstrumentBalanceOutput +] +GET_PAYMENT_SESSION: APIOperation[GetPaymentSessionInput, GetPaymentSessionOutput] +GET_RECOMMENDATION: APIOperation[GetRecommendationInput, GetRecommendationOutput] +GET_RESOURCE_API_KEY: APIOperation[GetResourceApiKeyInput, GetResourceApiKeyOutput] +GET_RESOURCE_OAUTH2_TOKEN: APIOperation[ + GetResourceOauth2TokenInput, GetResourceOauth2TokenOutput +] +GET_RESOURCE_PAYMENT_TOKEN: APIOperation[ + GetResourcePaymentTokenInput, GetResourcePaymentTokenOutput +] +GET_WORKLOAD_ACCESS_TOKEN: APIOperation[ + GetWorkloadAccessTokenInput, GetWorkloadAccessTokenOutput +] +GET_WORKLOAD_ACCESS_TOKEN_FOR_JWT: APIOperation[ + GetWorkloadAccessTokenForJWTInput, GetWorkloadAccessTokenForJWTOutput +] +GET_WORKLOAD_ACCESS_TOKEN_FOR_USER_ID: APIOperation[ + GetWorkloadAccessTokenForUserIdInput, GetWorkloadAccessTokenForUserIdOutput +] +INGEST_DATA: APIOperation[IngestDataInput, IngestDataOutput] +INVOKE_AGENT_RUNTIME: APIOperation[InvokeAgentRuntimeInput, InvokeAgentRuntimeOutput] +INVOKE_AGENT_RUNTIME_COMMAND: APIOperation[ + InvokeAgentRuntimeCommandInput, InvokeAgentRuntimeCommandOutput +] +INVOKE_BROWSER: APIOperation[InvokeBrowserInput, InvokeBrowserOutput] +INVOKE_CODE_INTERPRETER: APIOperation[ + InvokeCodeInterpreterInput, InvokeCodeInterpreterOutput +] +INVOKE_HARNESS: APIOperation[InvokeHarnessInput, InvokeHarnessOutput] +LIST_AB_TESTS: APIOperation[ListABTestsInput, ListABTestsOutput] +LIST_ACTORS: APIOperation[ListActorsInput, ListActorsOutput] +LIST_BATCH_EVALUATIONS: APIOperation[ + ListBatchEvaluationsInput, ListBatchEvaluationsOutput +] +LIST_BROWSER_SESSIONS: APIOperation[ListBrowserSessionsInput, ListBrowserSessionsOutput] +LIST_CODE_INTERPRETER_SESSIONS: APIOperation[ + ListCodeInterpreterSessionsInput, ListCodeInterpreterSessionsOutput +] +LIST_EVENTS: APIOperation[ListEventsInput, ListEventsOutput] +LIST_MEMORY_EXTRACTION_JOBS: APIOperation[ + ListMemoryExtractionJobsInput, ListMemoryExtractionJobsOutput +] +LIST_MEMORY_RECORDS: APIOperation[ListMemoryRecordsInput, ListMemoryRecordsOutput] +LIST_PAYMENT_INSTRUMENTS: APIOperation[ + ListPaymentInstrumentsInput, ListPaymentInstrumentsOutput +] +LIST_PAYMENT_SESSIONS: APIOperation[ListPaymentSessionsInput, ListPaymentSessionsOutput] +LIST_RECOMMENDATIONS: APIOperation[ListRecommendationsInput, ListRecommendationsOutput] +LIST_SESSIONS: APIOperation[ListSessionsInput, ListSessionsOutput] +PROCESS_PAYMENT: APIOperation[ProcessPaymentInput, ProcessPaymentOutput] +RETRIEVE_MEMORY_RECORDS: APIOperation[ + RetrieveMemoryRecordsInput, RetrieveMemoryRecordsOutput +] +SAVE_BROWSER_SESSION_PROFILE: APIOperation[ + SaveBrowserSessionProfileInput, SaveBrowserSessionProfileOutput +] +SEARCH_REGISTRY_RECORDS: APIOperation[ + SearchRegistryRecordsInput, SearchRegistryRecordsOutput +] +START_BATCH_EVALUATION: APIOperation[ + StartBatchEvaluationInput, StartBatchEvaluationOutput +] +START_BROWSER_SESSION: APIOperation[StartBrowserSessionInput, StartBrowserSessionOutput] +START_CODE_INTERPRETER_SESSION: APIOperation[ + StartCodeInterpreterSessionInput, StartCodeInterpreterSessionOutput +] +START_MEMORY_EXTRACTION_JOB: APIOperation[ + StartMemoryExtractionJobInput, StartMemoryExtractionJobOutput +] +START_RECOMMENDATION: APIOperation[StartRecommendationInput, StartRecommendationOutput] +STOP_BATCH_EVALUATION: APIOperation[StopBatchEvaluationInput, StopBatchEvaluationOutput] +STOP_BROWSER_SESSION: APIOperation[StopBrowserSessionInput, StopBrowserSessionOutput] +STOP_CODE_INTERPRETER_SESSION: APIOperation[ + StopCodeInterpreterSessionInput, StopCodeInterpreterSessionOutput +] +STOP_RUNTIME_SESSION: APIOperation[StopRuntimeSessionInput, StopRuntimeSessionOutput] +UPDATE_AB_TEST: APIOperation[UpdateABTestInput, UpdateABTestOutput] +UPDATE_BROWSER_STREAM: APIOperation[UpdateBrowserStreamInput, UpdateBrowserStreamOutput] diff --git a/clients/aws-sdk-bedrock-data-automation-runtime/scripts/docs/generate_doc_stubs.py b/clients/aws-sdk-bedrock-data-automation-runtime/scripts/docs/generate_doc_stubs.py index 52d470bc..795f2e4b 100644 --- a/clients/aws-sdk-bedrock-data-automation-runtime/scripts/docs/generate_doc_stubs.py +++ b/clients/aws-sdk-bedrock-data-automation-runtime/scripts/docs/generate_doc_stubs.py @@ -126,7 +126,9 @@ class ClientInfo: class DocStubGenerator: """Generate markdown API Reference stubs for AWS SDK for Python v4 clients.""" - def __init__(self, client_dir: Path, output_dir: Path, service_name: str | None = None) -> None: + def __init__( + self, client_dir: Path, output_dir: Path, service_name: str | None = None + ) -> None: """ Initialize the documentation generator. @@ -190,7 +192,9 @@ def _analyze_client_package(self, package_name: str) -> ClientInfo: required = ("client", "config", "models") missing = [name for name in required if not package.modules.get(name)] if missing: - raise ValueError(f"Missing required modules in {package_name}: {', '.join(missing)}") + raise ValueError( + f"Missing required modules in {package_name}: {', '.join(missing)}" + ) # Parse submodules client_module = package.modules["client"] @@ -199,11 +203,15 @@ def _analyze_client_package(self, package_name: str) -> ClientInfo: client_class = self._find_class_with_suffix(client_module, "Client") if not client_class: - raise ValueError(f"No class ending with 'Client' found in {package_name}.client") + raise ValueError( + f"No class ending with 'Client' found in {package_name}.client" + ) config_class = self._find_class_with_suffix(config_module, "Config") if not config_class: - raise ValueError(f"No class ending with 'Config' found in {package_name}.config") + raise ValueError( + f"No class ending with 'Config' found in {package_name}.config" + ) plugin_alias = config_module.members.get("Plugin") if not plugin_alias: @@ -288,7 +296,9 @@ def _analyze_operation(self, operation: Function) -> OperationInfo: if output_type in stream_type_map: stream_type = stream_type_map[output_type] - stream_args = self._get_subscript_elements(returns, f"'{operation.name}' stream type") + stream_args = self._get_subscript_elements( + returns, f"'{operation.name}' stream type" + ) if stream_type in (StreamType.INPUT, StreamType.DUPLEX): event_input_type = stream_args[0].canonical_name @@ -316,7 +326,9 @@ def _analyze_operation(self, operation: Function) -> OperationInfo: def _get_expr(self, annotation: str | Expr | None, context: str) -> Expr: """Extract and validate an Expr from an annotation.""" if not isinstance(annotation, Expr): - raise TypeError(f"{context}: expected Expr, got {type(annotation).__name__}") + raise TypeError( + f"{context}: expected Expr, got {type(annotation).__name__}" + ) return annotation def _get_subscript_elements(self, expr: Expr, context: str) -> list[Expr]: @@ -330,7 +342,9 @@ def _get_subscript_elements(self, expr: Expr, context: str) -> list[Expr]: return [el for el in slice_expr.elements if isinstance(el, Expr)] return [slice_expr] - def _extract_models(self, models_module: Module, operations: list[OperationInfo]) -> ModelsInfo: + def _extract_models( + self, models_module: Module, operations: list[OperationInfo] + ) -> ModelsInfo: """Extract structures, unions, enums, and errors from models module.""" structures, unions, enums, errors = [], [], [], [] @@ -356,14 +370,16 @@ def _extract_models(self, models_module: Module, operations: list[OperationInfo] duplicates = [] for structure in structures: - if self._is_operation_io_type(structure.name, operations) or self._is_union_member( - structure.name, unions - ): + if self._is_operation_io_type( + structure.name, operations + ) or self._is_union_member(structure.name, unions): duplicates.append(structure) structures = [struct for struct in structures if struct not in duplicates] - return ModelsInfo(structures=structures, unions=unions, enums=enums, errors=errors) + return ModelsInfo( + structures=structures, unions=unions, enums=enums, errors=errors + ) def _is_union(self, member: Object | Alias) -> TypeGuard[Attribute]: """Check if a module member is a union type.""" @@ -399,7 +415,9 @@ def _extract_union_members( for name in member_names: if not (member_object := models_module.members.get(name)): raise ValueError(f"Union member '{name}' not found in models module") - members.append(TypeInfo(name=member_object.name, module_path=member_object.path)) + members.append( + TypeInfo(name=member_object.name, module_path=member_object.path) + ) return members @@ -408,7 +426,8 @@ def _is_enum(self, member: Object | Alias) -> TypeGuard[Class]: if not isinstance(member, Class): return False return any( - isinstance(base, ExprName) and base.name in ENUM_BASE_CLASSES for base in member.bases + isinstance(base, ExprName) and base.name in ENUM_BASE_CLASSES + for base in member.bases ) def _is_error(self, member: Object | Alias) -> TypeGuard[Class]: @@ -416,10 +435,13 @@ def _is_error(self, member: Object | Alias) -> TypeGuard[Class]: if not isinstance(member, Class): return False return any( - isinstance(base, ExprName) and base.name in ERROR_BASE_CLASSES for base in member.bases + isinstance(base, ExprName) and base.name in ERROR_BASE_CLASSES + for base in member.bases ) - def _is_operation_io_type(self, type_name: str, operations: list[OperationInfo]) -> bool: + def _is_operation_io_type( + self, type_name: str, operations: list[OperationInfo] + ) -> bool: """Check if a type is used as operation input/output.""" return any(type_name in (op.input.name, op.output.name) for op in operations) @@ -437,8 +459,12 @@ def _generate_client_docs(self, client_info: ClientInfo) -> bool: self._generate_type_stubs( client_info.models.structures, "structures", "Structure Class" ) - self._generate_type_stubs(client_info.models.errors, "errors", "Error Class") - self._generate_type_stubs(client_info.models.enums, "enums", "Enum Class", members=True) + self._generate_type_stubs( + client_info.models.errors, "errors", "Error Class" + ) + self._generate_type_stubs( + client_info.models.enums, "enums", "Enum Class", members=True + ) self._generate_union_stubs(client_info.models.unions) except OSError as e: logger.error(f"Failed to write documentation files: {e}") @@ -470,7 +496,9 @@ def _generate_index(self, client_info: ClientInfo) -> None: ] for method in sorted(client_info.client_methods, key=lambda x: x.name): - lines.extend([*self._mkdocs_directive(method.module_path, heading_level=4), ""]) + lines.extend( + [*self._mkdocs_directive(method.module_path, heading_level=4), ""] + ) # Operations section if client_info.operations: @@ -578,7 +606,9 @@ def _generate_operation_stubs(self, operations: list[OperationInfo]) -> None: output_path = self.output_dir / "operations" / f"{op.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb("Operations", op.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb("Operations", op.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(operations)} operation file(s)") @@ -600,7 +630,9 @@ def _generate_type_stubs( output_path = self.output_dir / category / f"{item.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb(category.title(), item.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb(category.title(), item.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(items)} {category} file(s)") @@ -624,7 +656,9 @@ def _generate_union_stubs(self, unions: list[UnionInfo]) -> None: output_path = self.output_dir / "unions" / f"{union.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb("Unions", union.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb("Unions", union.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(unions)} union file(s)") diff --git a/clients/aws-sdk-bedrock-data-automation-runtime/src/aws_sdk_bedrock_data_automation_runtime/_private/schemas.py b/clients/aws-sdk-bedrock-data-automation-runtime/src/aws_sdk_bedrock_data_automation_runtime/_private/schemas.py index 3322e651..4a5a9107 100644 --- a/clients/aws-sdk-bedrock-data-automation-runtime/src/aws_sdk_bedrock_data_automation_runtime/_private/schemas.py +++ b/clients/aws-sdk-bedrock-data-automation-runtime/src/aws_sdk_bedrock_data_automation_runtime/_private/schemas.py @@ -2,881 +2,887 @@ from types import MappingProxyType -from smithy_core.prelude import BLOB, BOOLEAN, INTEGER, LONG, STRING, TIMESTAMP, UNIT -from smithy_core.schemas import Schema -from smithy_core.shapes import ShapeID, ShapeType -from smithy_core.traits import Trait - - -NON_BLANK_STRING = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#NonBlankString"), - shape_type=ShapeType.STRING, -) - -ACCESS_DENIED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#AccessDeniedException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=403), - ], - members={"message": {"target": NON_BLANK_STRING}}, +from smithy_core._schema_compact import StaticOperationSchema, StaticSchema + + +n0 = "com.amazonaws.bedrockdataautomationruntime" +_NBS = "NonBlankString" +_ADE = "AccessDeniedException" +_s = "smithy.api#error" +_c = "client" +_sE = "smithy.api#httpError" +_m = "message" +_IA = "InvocationArn" +_GDASI = "GetDataAutomationStatusInput" +_sSI = "smithy.synthetic#originalShapeId" +_cGDASR = "com.amazonaws.bedrockdataautomationruntime#GetDataAutomationStatusRequest" +_sm = "smithy.api#input" +_iA = "invocationArn" +_smi = "smithy.api#required" +_sL = "smithy.api#httpLabel" +_SU = "S3Uri" +_OC = "OutputConfiguration" +_sU = "s3Uri" +_AJS = "AutomationJobStatus" +_CREATED = "CREATED" +_sV = "smithy.api#enumValue" +_C = "Created" +_IP = "IN_PROGRESS" +_IPn = "InProgress" +_SUCCESS = "SUCCESS" +_S = "Success" +_SE = "SERVICE_ERROR" +_SEe = "ServiceError" +_CE = "CLIENT_ERROR" +_CEl = "ClientError" +_GDASO = "GetDataAutomationStatusOutput" +_cGDASRo = "com.amazonaws.bedrockdataautomationruntime#GetDataAutomationStatusResponse" +_smit = "smithy.api#output" +_st = "status" +_eT = "errorType" +_eM = "errorMessage" +_oC = "outputConfiguration" +_jST = "jobSubmissionTime" +_sF = "smithy.api#timestampFormat" +_dt = "date-time" +_jCT = "jobCompletionTime" +_jDIS = "jobDurationInSeconds" +_ISE = "InternalServerException" +_se = "server" +_RNFE = "ResourceNotFoundException" +_TE = "ThrottlingException" +_VE = "ValidationException" +_GDAS = "GetDataAutomationStatus" +_BA = "BlueprintArn" +_BS = "BlueprintStage" +_DEVELOPMENT = "DEVELOPMENT" +_LIVE = "LIVE" +_BV = "BlueprintVersion" +_B = "Blueprint" +_bA = "blueprintArn" +_v = "version" +_sta = "stage" +_BL = "BlueprintList" +_me = "member" +_IT = "IdempotencyToken" +_DAA = "DataAutomationArn" +_DAS = "DataAutomationStage" +_DAC = "DataAutomationConfiguration" +_dAPA = "dataAutomationProjectArn" +_DAPA = "DataAutomationProfileArn" +_ECK = "EncryptionContextKey" +_ECV = "EncryptionContextValue" +_ECM = "EncryptionContextMap" +_k = "key" +_va = "value" +_KMSKI = "KMSKeyId" +_EC = "EncryptionConfiguration" +_kKI = "kmsKeyId" +_kEC = "kmsEncryptionContext" +_TS = "TimestampSegment" +_sTM = "startTimeMillis" +_eTM = "endTimeMillis" +_VSC = "VideoSegmentConfiguration" +_tS = "timestampSegment" +_VAPC = "VideoAssetProcessingConfiguration" +_sC = "segmentConfiguration" +_APC = "AssetProcessingConfiguration" +_vi = "video" +_IC = "InputConfiguration" +_aPC = "assetProcessingConfiguration" +_EBC = "EventBridgeConfiguration" +_eBE = "eventBridgeEnabled" +_NC = "NotificationConfiguration" +_eBC = "eventBridgeConfiguration" +_TK = "TagKey" +_TV = "TagValue" +_T = "Tag" +_TL = "TagList" +_IDAAI = "InvokeDataAutomationAsyncInput" +_cIDAAR = "com.amazonaws.bedrockdataautomationruntime#InvokeDataAutomationAsyncRequest" +_cT = "clientToken" +_sT = "smithy.api#idempotencyToken" +_iC = "inputConfiguration" +_dAC = "dataAutomationConfiguration" +_eC = "encryptionConfiguration" +_nC = "notificationConfiguration" +_b = "blueprints" +_dAPAa = "dataAutomationProfileArn" +_t = "tags" +_IDAAO = "InvokeDataAutomationAsyncOutput" +_cIDAARo = ( + "com.amazonaws.bedrockdataautomationruntime#InvokeDataAutomationAsyncResponse" +) +_SQEE = "ServiceQuotaExceededException" +_IDAA = "InvokeDataAutomationAsync" +_SIC = "SyncInputConfiguration" +_by = "bytes" +_IDAI = "InvokeDataAutomationInput" +_cIDAR = "com.amazonaws.bedrockdataautomationruntime#InvokeDataAutomationRequest" +_COS = "CustomOutputStatus" +_MATCH = "MATCH" +_NM = "NO_MATCH" +_OS = "OutputSegment" +_cOS = "customOutputStatus" +_cO = "customOutput" +_sO = "standardOutput" +_OSL = "OutputSegmentList" +_SM = "SemanticModality" +_DOCUMENT = "DOCUMENT" +_IMAGE = "IMAGE" +_AUDIO = "AUDIO" +_VIDEO = "VIDEO" +_IDAO = "InvokeDataAutomationOutput" +_cIDARo = "com.amazonaws.bedrockdataautomationruntime#InvokeDataAutomationResponse" +_sM = "semanticModality" +_oS = "outputSegments" +_smith = "smithy.api#default" +_SUE = "ServiceUnavailableException" +_IDA = "InvokeDataAutomation" +_TRA = "TaggableResourceArn" +_LTFRI = "ListTagsForResourceInput" +_cLTFRR = "com.amazonaws.bedrockdataautomationruntime#ListTagsForResourceRequest" +_rARN = "resourceARN" +_LTFRO = "ListTagsForResourceOutput" +_cLTFRRo = "com.amazonaws.bedrockdataautomationruntime#ListTagsForResourceResponse" +_LTFR = "ListTagsForResource" +_TRI = "TagResourceInput" +_cTRR = "com.amazonaws.bedrockdataautomationruntime#TagResourceRequest" +_TRO = "TagResourceOutput" +_cTRRo = "com.amazonaws.bedrockdataautomationruntime#TagResourceResponse" +_TR = "TagResource" +_TKL = "TagKeyList" +_URI = "UntagResourceInput" +_cURR = "com.amazonaws.bedrockdataautomationruntime#UntagResourceRequest" +_tK = "tagKeys" +_URO = "UntagResourceOutput" +_cURRo = "com.amazonaws.bedrockdataautomationruntime#UntagResourceResponse" +_UR = "UntagResource" +_ABKRS = "AmazonBedrockKeystoneRuntimeService" +_a = "aws.auth#sigv4" +_a_ = "aws.protocols#awsJson1_1" +_sB = "smithy.rules#endpointBdd" +_aw = "aws.api#service" + +NON_BLANK_STRING: StaticSchema = (3, n0, _NBS, 0) + +ACCESS_DENIED_EXCEPTION: StaticSchema = ( + 18, + n0, + _ADE, + {_s: _c, _sE: 403}, + (_m,), + ((NON_BLANK_STRING, 0),), +) + +INVOCATION_ARN: StaticSchema = (3, n0, _IA, 0) + +GET_DATA_AUTOMATION_STATUS_INPUT: StaticSchema = ( + 18, + n0, + _GDASI, + {_sSI: _cGDASR, _sm: None}, + (_iA,), + ((INVOCATION_ARN, 9),), +) + +S3_URI: StaticSchema = (3, n0, _SU, 0) + +OUTPUT_CONFIGURATION: StaticSchema = (18, n0, _OC, 0, (_sU,), ((S3_URI, 1),)) + +AUTOMATION_JOB_STATUS: StaticSchema = ( + 14, + n0, + _AJS, + 0, + (_CREATED, _IP, _SUCCESS, _SE, _CE), + ( + (-1, {_sV: _C}), + (-1, {_sV: _IPn}), + (-1, {_sV: _S}), + (-1, {_sV: _SEe}), + (-1, {_sV: _CEl}), + ), ) -INVOCATION_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#InvocationArn"), - shape_type=ShapeType.STRING, +GET_DATA_AUTOMATION_STATUS_OUTPUT: StaticSchema = ( + 18, + n0, + _GDASO, + {_sSI: _cGDASRo, _smit: None}, + (_st, _eT, _eM, _oC, _jST, _jCT, _jDIS), + ( + (AUTOMATION_JOB_STATUS, 0), + (3, 0), + (3, 0), + (OUTPUT_CONFIGURATION, 0), + (4, {_sF: _dt}), + (4, {_sF: _dt}), + (7, 0), + ), ) -GET_DATA_AUTOMATION_STATUS_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockdataautomationruntime#GetDataAutomationStatusInput" +INTERNAL_SERVER_EXCEPTION: StaticSchema = ( + 18, + n0, + _ISE, + {_s: _se, _sE: 500}, + (_m,), + ((NON_BLANK_STRING, 0),), +) + +RESOURCE_NOT_FOUND_EXCEPTION: StaticSchema = ( + 18, + n0, + _RNFE, + {_s: _c, _sE: 404}, + (_m,), + ((NON_BLANK_STRING, 0),), +) + +THROTTLING_EXCEPTION: StaticSchema = ( + 18, + n0, + _TE, + {_s: _c, _sE: 429}, + (_m,), + ((NON_BLANK_STRING, 0),), +) + +VALIDATION_EXCEPTION: StaticSchema = ( + 18, + n0, + _VE, + {_s: _c, _sE: 400}, + (_m,), + ((NON_BLANK_STRING, 0),), +) + +GET_DATA_AUTOMATION_STATUS: StaticOperationSchema = ( + 23, + n0, + _GDAS, + 0, + GET_DATA_AUTOMATION_STATUS_INPUT, + GET_DATA_AUTOMATION_STATUS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomationruntime#GetDataAutomationStatusRequest", - ) - ], - members={ - "invocationArn": { - "target": INVOCATION_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, ) -S3_URI = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#S3Uri"), - shape_type=ShapeType.STRING, -) +BLUEPRINT_ARN: StaticSchema = (3, n0, _BA, 0) -OUTPUT_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#OutputConfiguration"), - members={ - "s3Uri": { - "target": S3_URI, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +BLUEPRINT_STAGE: StaticSchema = ( + 14, + n0, + _BS, + 0, + (_DEVELOPMENT, _LIVE), + ((-1, {_sV: _DEVELOPMENT}), (-1, {_sV: _LIVE})), ) -AUTOMATION_JOB_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#AutomationJobStatus"), - shape_type=ShapeType.ENUM, - members={ - "CREATED": {"target": UNIT}, - "IN_PROGRESS": {"target": UNIT}, - "SUCCESS": {"target": UNIT}, - "SERVICE_ERROR": {"target": UNIT}, - "CLIENT_ERROR": {"target": UNIT}, - }, -) +BLUEPRINT_VERSION: StaticSchema = (3, n0, _BV, 0) -GET_DATA_AUTOMATION_STATUS_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockdataautomationruntime#GetDataAutomationStatusOutput" - ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomationruntime#GetDataAutomationStatusResponse", - ) - ], - members={ - "status": {"target": AUTOMATION_JOB_STATUS}, - "errorType": {"target": STRING}, - "errorMessage": {"target": STRING}, - "outputConfiguration": {"target": OUTPUT_CONFIGURATION}, - "jobSubmissionTime": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#timestampFormat"), value="date-time") - ], - }, - "jobCompletionTime": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#timestampFormat"), value="date-time") - ], - }, - "jobDurationInSeconds": {"target": INTEGER}, - }, +BLUEPRINT: StaticSchema = ( + 18, + n0, + _B, + 0, + (_bA, _v, _sta), + ((BLUEPRINT_ARN, 1), (BLUEPRINT_VERSION, 0), (BLUEPRINT_STAGE, 0)), ) -INTERNAL_SERVER_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#InternalServerException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="server"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=500), - ], - members={"message": {"target": NON_BLANK_STRING}}, -) +BLUEPRINT_LIST: StaticSchema = (16, n0, _BL, 0, (_me,), ((BLUEPRINT, 0),)) -RESOURCE_NOT_FOUND_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#ResourceNotFoundException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=404), - ], - members={"message": {"target": NON_BLANK_STRING}}, -) +IDEMPOTENCY_TOKEN: StaticSchema = (3, n0, _IT, 0) -THROTTLING_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#ThrottlingException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=429), - ], - members={"message": {"target": NON_BLANK_STRING}}, -) +DATA_AUTOMATION_ARN: StaticSchema = (3, n0, _DAA, 0) -VALIDATION_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#ValidationException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"message": {"target": NON_BLANK_STRING}}, +DATA_AUTOMATION_STAGE: StaticSchema = ( + 14, + n0, + _DAS, + 0, + (_LIVE, _DEVELOPMENT), + ((-1, {_sV: _LIVE}), (-1, {_sV: _DEVELOPMENT})), ) -GET_DATA_AUTOMATION_STATUS = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#GetDataAutomationStatus"), - shape_type=ShapeType.OPERATION, +DATA_AUTOMATION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _DAC, + 0, + (_dAPA, _sta), + ((DATA_AUTOMATION_ARN, 1), (DATA_AUTOMATION_STAGE, 0)), ) -BLUEPRINT_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#BlueprintArn"), - shape_type=ShapeType.STRING, -) +DATA_AUTOMATION_PROFILE_ARN: StaticSchema = (3, n0, _DAPA, 0) -BLUEPRINT_STAGE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#BlueprintStage"), - shape_type=ShapeType.ENUM, - members={"DEVELOPMENT": {"target": UNIT}, "LIVE": {"target": UNIT}}, -) +ENCRYPTION_CONTEXT_KEY: StaticSchema = (3, n0, _ECK, 0) -BLUEPRINT_VERSION = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#BlueprintVersion"), - shape_type=ShapeType.STRING, -) +ENCRYPTION_CONTEXT_VALUE: StaticSchema = (3, n0, _ECV, 0) -BLUEPRINT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#Blueprint"), - members={ - "blueprintArn": { - "target": BLUEPRINT_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "version": {"target": BLUEPRINT_VERSION}, - "stage": {"target": BLUEPRINT_STAGE}, - }, +ENCRYPTION_CONTEXT_MAP: StaticSchema = ( + 17, + n0, + _ECM, + 0, + (_k, _va), + ((ENCRYPTION_CONTEXT_KEY, 0), (ENCRYPTION_CONTEXT_VALUE, 0)), ) -BLUEPRINT_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#BlueprintList"), - shape_type=ShapeType.LIST, - members={"member": {"target": BLUEPRINT}}, -) +KMS_KEY_ID: StaticSchema = (3, n0, _KMSKI, 0) -IDEMPOTENCY_TOKEN = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#IdempotencyToken"), - shape_type=ShapeType.STRING, +ENCRYPTION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _EC, + 0, + (_kKI, _kEC), + ((KMS_KEY_ID, 1), (ENCRYPTION_CONTEXT_MAP, 0)), ) -DATA_AUTOMATION_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#DataAutomationArn"), - shape_type=ShapeType.STRING, -) +TIMESTAMP_SEGMENT: StaticSchema = (18, n0, _TS, 0, (_sTM, _eTM), ((8, 1), (8, 1))) -DATA_AUTOMATION_STAGE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#DataAutomationStage"), - shape_type=ShapeType.ENUM, - members={"LIVE": {"target": UNIT}, "DEVELOPMENT": {"target": UNIT}}, +VIDEO_SEGMENT_CONFIGURATION: StaticSchema = ( + 19, + n0, + _VSC, + 0, + (_tS,), + ((TIMESTAMP_SEGMENT, 0),), ) -DATA_AUTOMATION_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockdataautomationruntime#DataAutomationConfiguration" - ), - members={ - "dataAutomationProjectArn": { - "target": DATA_AUTOMATION_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "stage": {"target": DATA_AUTOMATION_STAGE}, - }, +VIDEO_ASSET_PROCESSING_CONFIGURATION: StaticSchema = ( + 18, + n0, + _VAPC, + 0, + (_sC,), + ((VIDEO_SEGMENT_CONFIGURATION, 0),), ) -DATA_AUTOMATION_PROFILE_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#DataAutomationProfileArn"), - shape_type=ShapeType.STRING, +ASSET_PROCESSING_CONFIGURATION: StaticSchema = ( + 18, + n0, + _APC, + 0, + (_vi,), + ((VIDEO_ASSET_PROCESSING_CONFIGURATION, 0),), ) -ENCRYPTION_CONTEXT_KEY = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#EncryptionContextKey"), - shape_type=ShapeType.STRING, +INPUT_CONFIGURATION: StaticSchema = ( + 18, + n0, + _IC, + 0, + (_sU, _aPC), + ((S3_URI, 1), (ASSET_PROCESSING_CONFIGURATION, 0)), ) -ENCRYPTION_CONTEXT_VALUE = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#EncryptionContextValue"), - shape_type=ShapeType.STRING, -) +EVENT_BRIDGE_CONFIGURATION: StaticSchema = (18, n0, _EBC, 0, (_eBE,), ((2, 1),)) -ENCRYPTION_CONTEXT_MAP = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#EncryptionContextMap"), - shape_type=ShapeType.MAP, - members={ - "key": {"target": ENCRYPTION_CONTEXT_KEY}, - "value": {"target": ENCRYPTION_CONTEXT_VALUE}, - }, +NOTIFICATION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _NC, + 0, + (_eBC,), + ((EVENT_BRIDGE_CONFIGURATION, 1),), ) -KMS_KEY_ID = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#KMSKeyId"), - shape_type=ShapeType.STRING, -) +TAG_KEY: StaticSchema = (3, n0, _TK, 0) -ENCRYPTION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#EncryptionConfiguration"), - members={ - "kmsKeyId": { - "target": KMS_KEY_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "kmsEncryptionContext": {"target": ENCRYPTION_CONTEXT_MAP}, - }, -) +TAG_VALUE: StaticSchema = (3, n0, _TV, 0) -TIMESTAMP_SEGMENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#TimestampSegment"), - members={ - "startTimeMillis": { - "target": LONG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "endTimeMillis": { - "target": LONG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +TAG: StaticSchema = (18, n0, _T, 0, (_k, _va), ((TAG_KEY, 1), (TAG_VALUE, 1))) -VIDEO_SEGMENT_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#VideoSegmentConfiguration"), - shape_type=ShapeType.UNION, - members={"timestampSegment": {"target": TIMESTAMP_SEGMENT}}, -) - -VIDEO_ASSET_PROCESSING_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockdataautomationruntime#VideoAssetProcessingConfiguration" +TAG_LIST: StaticSchema = (16, n0, _TL, 0, (_me,), ((TAG, 0),)) + +INVOKE_DATA_AUTOMATION_ASYNC_INPUT: StaticSchema = ( + 18, + n0, + _IDAAI, + {_sSI: _cIDAAR, _sm: None}, + (_cT, _iC, _oC, _dAC, _eC, _nC, _b, _dAPAa, _t), + ( + (IDEMPOTENCY_TOKEN, 2), + (INPUT_CONFIGURATION, 1), + (OUTPUT_CONFIGURATION, 1), + (DATA_AUTOMATION_CONFIGURATION, 0), + (ENCRYPTION_CONFIGURATION, 0), + (NOTIFICATION_CONFIGURATION, 0), + (BLUEPRINT_LIST, 0), + (DATA_AUTOMATION_PROFILE_ARN, 1), + (TAG_LIST, 0), ), - members={"segmentConfiguration": {"target": VIDEO_SEGMENT_CONFIGURATION}}, ) -ASSET_PROCESSING_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockdataautomationruntime#AssetProcessingConfiguration" +INVOKE_DATA_AUTOMATION_ASYNC_OUTPUT: StaticSchema = ( + 18, + n0, + _IDAAO, + {_sSI: _cIDAARo, _smit: None}, + (_iA,), + ((INVOCATION_ARN, 1),), +) + +SERVICE_QUOTA_EXCEEDED_EXCEPTION: StaticSchema = ( + 18, + n0, + _SQEE, + {_s: _c, _sE: 402}, + (_m,), + ((NON_BLANK_STRING, 0),), +) + +INVOKE_DATA_AUTOMATION_ASYNC: StaticOperationSchema = ( + 23, + n0, + _IDAA, + 0, + INVOKE_DATA_AUTOMATION_ASYNC_INPUT, + INVOKE_DATA_AUTOMATION_ASYNC_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, ), - members={"video": {"target": VIDEO_ASSET_PROCESSING_CONFIGURATION}}, -) - -INPUT_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#InputConfiguration"), - members={ - "s3Uri": { - "target": S3_URI, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "assetProcessingConfiguration": {"target": ASSET_PROCESSING_CONFIGURATION}, - }, -) - -EVENT_BRIDGE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#EventBridgeConfiguration"), - members={ - "eventBridgeEnabled": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -NOTIFICATION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#NotificationConfiguration"), - members={ - "eventBridgeConfiguration": { - "target": EVENT_BRIDGE_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, ) -TAG_KEY = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#TagKey"), - shape_type=ShapeType.STRING, -) - -TAG_VALUE = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#TagValue"), - shape_type=ShapeType.STRING, -) - -TAG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#Tag"), - members={ - "key": { - "target": TAG_KEY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "value": { - "target": TAG_VALUE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -TAG_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#TagList"), - shape_type=ShapeType.LIST, - members={"member": {"target": TAG}}, -) - -INVOKE_DATA_AUTOMATION_ASYNC_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockdataautomationruntime#InvokeDataAutomationAsyncInput" +SYNC_INPUT_CONFIGURATION: StaticSchema = ( + 18, + n0, + _SIC, + 0, + (_by, _sU), + ((1, 0), (S3_URI, 0)), +) + +INVOKE_DATA_AUTOMATION_INPUT: StaticSchema = ( + 18, + n0, + _IDAI, + {_sSI: _cIDAR, _sm: None}, + (_iC, _dAC, _b, _dAPAa, _eC, _oC), + ( + (SYNC_INPUT_CONFIGURATION, 1), + (DATA_AUTOMATION_CONFIGURATION, 0), + (BLUEPRINT_LIST, 0), + (DATA_AUTOMATION_PROFILE_ARN, 1), + (ENCRYPTION_CONFIGURATION, 0), + (OUTPUT_CONFIGURATION, 0), ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomationruntime#InvokeDataAutomationAsyncRequest", - ) - ], - members={ - "clientToken": { - "target": IDEMPOTENCY_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "inputConfiguration": { - "target": INPUT_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "outputConfiguration": { - "target": OUTPUT_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "dataAutomationConfiguration": {"target": DATA_AUTOMATION_CONFIGURATION}, - "encryptionConfiguration": {"target": ENCRYPTION_CONFIGURATION}, - "notificationConfiguration": {"target": NOTIFICATION_CONFIGURATION}, - "blueprints": {"target": BLUEPRINT_LIST}, - "dataAutomationProfileArn": { - "target": DATA_AUTOMATION_PROFILE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "tags": {"target": TAG_LIST}, - }, ) -INVOKE_DATA_AUTOMATION_ASYNC_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockdataautomationruntime#InvokeDataAutomationAsyncOutput" +CUSTOM_OUTPUT_STATUS: StaticSchema = ( + 14, + n0, + _COS, + 0, + (_MATCH, _NM), + ((-1, {_sV: _MATCH}), (-1, {_sV: _NM})), +) + +OUTPUT_SEGMENT: StaticSchema = ( + 18, + n0, + _OS, + 0, + (_cOS, _cO, _sO), + ((CUSTOM_OUTPUT_STATUS, 0), (3, 0), (3, 0)), +) + +OUTPUT_SEGMENT_LIST: StaticSchema = (16, n0, _OSL, 0, (_me,), ((OUTPUT_SEGMENT, 0),)) + +SEMANTIC_MODALITY: StaticSchema = ( + 14, + n0, + _SM, + 0, + (_DOCUMENT, _IMAGE, _AUDIO, _VIDEO), + ( + (-1, {_sV: _DOCUMENT}), + (-1, {_sV: _IMAGE}), + (-1, {_sV: _AUDIO}), + (-1, {_sV: _VIDEO}), ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomationruntime#InvokeDataAutomationAsyncResponse", - ) - ], - members={ - "invocationArn": { - "target": INVOCATION_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, ) -SERVICE_QUOTA_EXCEEDED_EXCEPTION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockdataautomationruntime#ServiceQuotaExceededException" +INVOKE_DATA_AUTOMATION_OUTPUT: StaticSchema = ( + 18, + n0, + _IDAO, + {_sSI: _cIDARo, _smit: None}, + (_oC, _sM, _oS), + ( + (OUTPUT_CONFIGURATION, 0), + (SEMANTIC_MODALITY, 1), + (OUTPUT_SEGMENT_LIST, {_smith: ()}), ), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=402), - ], - members={"message": {"target": NON_BLANK_STRING}}, -) - -INVOKE_DATA_AUTOMATION_ASYNC = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#InvokeDataAutomationAsync"), - shape_type=ShapeType.OPERATION, -) - -SYNC_INPUT_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#SyncInputConfiguration"), - members={"bytes": {"target": BLOB}, "s3Uri": {"target": S3_URI}}, -) - -INVOKE_DATA_AUTOMATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#InvokeDataAutomationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomationruntime#InvokeDataAutomationRequest", - ) - ], - members={ - "inputConfiguration": { - "target": SYNC_INPUT_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "dataAutomationConfiguration": {"target": DATA_AUTOMATION_CONFIGURATION}, - "blueprints": {"target": BLUEPRINT_LIST}, - "dataAutomationProfileArn": { - "target": DATA_AUTOMATION_PROFILE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "encryptionConfiguration": {"target": ENCRYPTION_CONFIGURATION}, - "outputConfiguration": {"target": OUTPUT_CONFIGURATION}, - }, ) -CUSTOM_OUTPUT_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#CustomOutputStatus"), - shape_type=ShapeType.ENUM, - members={"MATCH": {"target": UNIT}, "NO_MATCH": {"target": UNIT}}, -) - -OUTPUT_SEGMENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#OutputSegment"), - members={ - "customOutputStatus": {"target": CUSTOM_OUTPUT_STATUS}, - "customOutput": {"target": STRING}, - "standardOutput": {"target": STRING}, - }, -) - -OUTPUT_SEGMENT_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#OutputSegmentList"), - shape_type=ShapeType.LIST, - members={"member": {"target": OUTPUT_SEGMENT}}, -) - -SEMANTIC_MODALITY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#SemanticModality"), - shape_type=ShapeType.ENUM, - members={ - "DOCUMENT": {"target": UNIT}, - "IMAGE": {"target": UNIT}, - "AUDIO": {"target": UNIT}, - "VIDEO": {"target": UNIT}, - }, -) - -INVOKE_DATA_AUTOMATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#InvokeDataAutomationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomationruntime#InvokeDataAutomationResponse", - ) - ], - members={ - "outputConfiguration": {"target": OUTPUT_CONFIGURATION}, - "semanticModality": { - "target": SEMANTIC_MODALITY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "outputSegments": { - "target": OUTPUT_SEGMENT_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=())], - }, - }, -) - -SERVICE_UNAVAILABLE_EXCEPTION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockdataautomationruntime#ServiceUnavailableException" +SERVICE_UNAVAILABLE_EXCEPTION: StaticSchema = ( + 18, + n0, + _SUE, + {_s: _se, _sE: 503}, + (_m,), + ((NON_BLANK_STRING, 0),), +) + +INVOKE_DATA_AUTOMATION: StaticOperationSchema = ( + 23, + n0, + _IDA, + 0, + INVOKE_DATA_AUTOMATION_INPUT, + INVOKE_DATA_AUTOMATION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + SERVICE_UNAVAILABLE_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, ), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="server"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=503), - ], - members={"message": {"target": NON_BLANK_STRING}}, -) - -INVOKE_DATA_AUTOMATION = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#InvokeDataAutomation"), - shape_type=ShapeType.OPERATION, -) - -TAGGABLE_RESOURCE_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#TaggableResourceArn"), - shape_type=ShapeType.STRING, -) - -LIST_TAGS_FOR_RESOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#ListTagsForResourceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomationruntime#ListTagsForResourceRequest", - ) - ], - members={ - "resourceARN": { - "target": TAGGABLE_RESOURCE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, ) -LIST_TAGS_FOR_RESOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#ListTagsForResourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomationruntime#ListTagsForResourceResponse", - ) - ], - members={"tags": {"target": TAG_LIST}}, -) - -LIST_TAGS_FOR_RESOURCE = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#ListTagsForResource"), - shape_type=ShapeType.OPERATION, -) - -TAG_RESOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#TagResourceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomationruntime#TagResourceRequest", - ) - ], - members={ - "resourceARN": { - "target": TAGGABLE_RESOURCE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "tags": { - "target": TAG_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -TAG_RESOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#TagResourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomationruntime#TagResourceResponse", - ) - ], -) - -TAG_RESOURCE = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#TagResource"), - shape_type=ShapeType.OPERATION, -) - -TAG_KEY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#TagKeyList"), - shape_type=ShapeType.LIST, - members={"member": {"target": TAG_KEY}}, -) - -UNTAG_RESOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#UntagResourceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomationruntime#UntagResourceRequest", - ) - ], - members={ - "resourceARN": { - "target": TAGGABLE_RESOURCE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "tagKeys": { - "target": TAG_KEY_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +TAGGABLE_RESOURCE_ARN: StaticSchema = (3, n0, _TRA, 0) + +LIST_TAGS_FOR_RESOURCE_INPUT: StaticSchema = ( + 18, + n0, + _LTFRI, + {_sSI: _cLTFRR, _sm: None}, + (_rARN,), + ((TAGGABLE_RESOURCE_ARN, 1),), +) + +LIST_TAGS_FOR_RESOURCE_OUTPUT: StaticSchema = ( + 18, + n0, + _LTFRO, + {_sSI: _cLTFRRo, _smit: None}, + (_t,), + ((TAG_LIST, 0),), +) + +LIST_TAGS_FOR_RESOURCE: StaticOperationSchema = ( + 23, + n0, + _LTFR, + 0, + LIST_TAGS_FOR_RESOURCE_INPUT, + LIST_TAGS_FOR_RESOURCE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -UNTAG_RESOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#UntagResourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomationruntime#UntagResourceResponse", - ) - ], +TAG_RESOURCE_INPUT: StaticSchema = ( + 18, + n0, + _TRI, + {_sSI: _cTRR, _sm: None}, + (_rARN, _t), + ((TAGGABLE_RESOURCE_ARN, 1), (TAG_LIST, 1)), +) + +TAG_RESOURCE_OUTPUT: StaticSchema = (18, n0, _TRO, {_sSI: _cTRRo, _smit: None}) + +TAG_RESOURCE: StaticOperationSchema = ( + 23, + n0, + _TR, + 0, + TAG_RESOURCE_INPUT, + TAG_RESOURCE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -UNTAG_RESOURCE = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomationruntime#UntagResource"), - shape_type=ShapeType.OPERATION, +TAG_KEY_LIST: StaticSchema = (16, n0, _TKL, 0, (_me,), ((TAG_KEY, 0),)) + +UNTAG_RESOURCE_INPUT: StaticSchema = ( + 18, + n0, + _URI, + {_sSI: _cURR, _sm: None}, + (_rARN, _tK), + ((TAGGABLE_RESOURCE_ARN, 1), (TAG_KEY_LIST, 1)), +) + +UNTAG_RESOURCE_OUTPUT: StaticSchema = (18, n0, _URO, {_sSI: _cURRo, _smit: None}) + +UNTAG_RESOURCE: StaticOperationSchema = ( + 23, + n0, + _UR, + 0, + UNTAG_RESOURCE_INPUT, + UNTAG_RESOURCE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AMAZON_BEDROCK_KEYSTONE_RUNTIME_SERVICE = Schema( - id=ShapeID( - "com.amazonaws.bedrockdataautomationruntime#AmazonBedrockKeystoneRuntimeService" - ), - shape_type=ShapeType.SERVICE, - traits=[ - Trait.new( - id=ShapeID("aws.auth#sigv4"), value=MappingProxyType({"name": "bedrock"}) - ), - Trait.new(id=ShapeID("aws.protocols#awsJson1_1")), - Trait.new( - id=ShapeID("smithy.rules#endpointBdd"), - value=MappingProxyType( - { - "version": "1.1", - "parameters": MappingProxyType( - { - "Region": MappingProxyType( - { - "builtIn": "AWS::Region", - "required": False, - "documentation": "The AWS region used to dispatch the request.", - "type": "string", - } - ), - "UseDualStack": MappingProxyType( - { - "builtIn": "AWS::UseDualStack", - "required": True, - "default": False, - "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", - "type": "boolean", - } - ), - "UseFIPS": MappingProxyType( - { - "builtIn": "AWS::UseFIPS", - "required": True, - "default": False, - "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", - "type": "boolean", - } - ), - "Endpoint": MappingProxyType( - { - "builtIn": "SDK::Endpoint", - "required": False, - "documentation": "Override the endpoint used to send this request", - "type": "string", - } - ), - } - ), - "conditions": ( - MappingProxyType( +AMAZON_BEDROCK_KEYSTONE_RUNTIME_SERVICE: StaticSchema = ( + 21, + n0, + _ABKRS, + { + _a: MappingProxyType({"name": "bedrock"}), + _a_: None, + _sB: MappingProxyType( + { + "version": "1.1", + "parameters": MappingProxyType( + { + "Region": MappingProxyType( { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "Endpoint"}),), + "builtIn": "AWS::Region", + "required": False, + "documentation": "The AWS region used to dispatch the request.", + "type": "string", } ), - MappingProxyType( + "UseDualStack": MappingProxyType( { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "Region"}),), + "builtIn": "AWS::UseDualStack", + "required": True, + "default": False, + "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", + "type": "boolean", } ), - MappingProxyType( + "UseFIPS": MappingProxyType( { - "fn": "aws.partition", - "argv": (MappingProxyType({"ref": "Region"}),), - "assign": "PartitionResult", + "builtIn": "AWS::UseFIPS", + "required": True, + "default": False, + "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", + "type": "boolean", } ), - MappingProxyType( + "Endpoint": MappingProxyType( { - "fn": "booleanEquals", - "argv": (MappingProxyType({"ref": "UseFIPS"}), True), - } - ), - MappingProxyType( - { - "fn": "booleanEquals", - "argv": ( - MappingProxyType({"ref": "UseDualStack"}), - True, - ), - } - ), - MappingProxyType( - { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "supportsDualStack", - ), - } - ), - True, - ), - } - ), - MappingProxyType( - { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "supportsFIPS", - ), - } - ), - True, - ), + "builtIn": "SDK::Endpoint", + "required": False, + "documentation": "Override the endpoint used to send this request", + "type": "string", } ), + } + ), + "conditions": ( + MappingProxyType( + { + "fn": "isSet", + "argv": (MappingProxyType({"ref": "Endpoint"}),), + } ), - "results": ( - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: FIPS and custom endpoint are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": MappingProxyType({"ref": "Endpoint"}), - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://bedrock-data-automation-runtime-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "FIPS and DualStack are enabled, but this partition does not support one or both", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://bedrock-data-automation-runtime-fips.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "FIPS is enabled but this partition does not support FIPS", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + MappingProxyType( + {"fn": "isSet", "argv": (MappingProxyType({"ref": "Region"}),)} + ), + MappingProxyType( + { + "fn": "aws.partition", + "argv": (MappingProxyType({"ref": "Region"}),), + "assign": "PartitionResult", + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": (MappingProxyType({"ref": "UseFIPS"}), True), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": (MappingProxyType({"ref": "UseDualStack"}), True), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( { - "url": "https://bedrock-data-automation-runtime.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "supportsDualStack", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "DualStack is enabled but this partition does not support DualStack", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + True, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( { - "url": "https://bedrock-data-automation-runtime.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "supportsFIPS", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: Missing Region", - "type": "error", - } - ), + True, + ), + } + ), + ), + "results": ( + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: FIPS and custom endpoint are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": MappingProxyType({"ref": "Endpoint"}), + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://bedrock-data-automation-runtime-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS and DualStack are enabled, but this partition does not support one or both", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://bedrock-data-automation-runtime-fips.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS is enabled but this partition does not support FIPS", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://bedrock-data-automation-runtime.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } ), - "root": 2, - "nodeCount": 13, - "nodes": "/////wAAAAH/////AAAAAAAAAAwAAAADAAAAAQAAAAQF9eELAAAAAgAAAAUF9eELAAAAAwAAAAgAAAAGAAAABAAAAAcF9eEKAAAABQX14QgF9eEJAAAABAAAAAoAAAAJAAAABgX14QYF9eEHAAAABQAAAAsF9eEFAAAABgX14QQF9eEFAAAAAwX14QEAAAANAAAABAX14QIF9eED", - } - ), + MappingProxyType( + { + "conditions": (), + "error": "DualStack is enabled but this partition does not support DualStack", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://bedrock-data-automation-runtime.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Missing Region", + "type": "error", + } + ), + ), + "root": 2, + "nodeCount": 13, + "nodes": "/////wAAAAH/////AAAAAAAAAAwAAAADAAAAAQAAAAQF9eELAAAAAgAAAAUF9eELAAAAAwAAAAgAAAAGAAAABAAAAAcF9eEKAAAABQX14QgF9eEJAAAABAAAAAoAAAAJAAAABgX14QYF9eEHAAAABQAAAAsF9eEFAAAABgX14QQF9eEFAAAAAwX14QEAAAANAAAABAX14QIF9eED", + } ), - Trait.new( - id=ShapeID("aws.api#service"), - value=MappingProxyType( - { - "sdkId": "Bedrock Data Automation Runtime", - "arnNamespace": "bedrock", - "endpointPrefix": "bedrock-data-automation-runtime", - "cloudTrailEventSource": "bedrock.amazonaws.com", - } - ), + _aw: MappingProxyType( + { + "sdkId": "Bedrock Data Automation Runtime", + "arnNamespace": "bedrock", + "endpointPrefix": "bedrock-data-automation-runtime", + "cloudTrailEventSource": "bedrock.amazonaws.com", + } ), - ], + }, ) diff --git a/clients/aws-sdk-bedrock-data-automation-runtime/src/aws_sdk_bedrock_data_automation_runtime/client.py b/clients/aws-sdk-bedrock-data-automation-runtime/src/aws_sdk_bedrock_data_automation_runtime/client.py index 025af9c3..a9dc0f54 100644 --- a/clients/aws-sdk-bedrock-data-automation-runtime/src/aws_sdk_bedrock_data_automation_runtime/client.py +++ b/clients/aws-sdk-bedrock-data-automation-runtime/src/aws_sdk_bedrock_data_automation_runtime/client.py @@ -1,43 +1,51 @@ # Code generated by smithy-python-codegen DO NOT EDIT. +from __future__ import annotations + from copy import deepcopy import logging from typing import Any, cast +from smithy_aws_core.aio.identity.chain import AsyncIdentityChain from smithy_aws_core.config import ConfigSource from smithy_aws_core.identity import AWSCredentialsIdentity -from smithy_aws_core.identity.chain import IdentityChain -from smithy_core.aio.client import AsyncClient, ClientCall, RequestPipeline +from smithy_core.aio.client import AsyncClient, AsyncClientCall, AsyncRequestPipeline from smithy_core.deserializers import DeserializeableShape from smithy_core.exceptions import ExpectationNotMetError from smithy_core.schemas import APIOperation from smithy_core.serializers import SerializeableShape -from smithy_http.aio.interfaces import HTTPClient +from smithy_http.aio.interfaces import AsyncHTTPClient from smithy_http.plugins import user_agent_plugin from .config import AsyncBedrockDataAutomationRuntimeConfig, Plugin from .models import ( GET_DATA_AUTOMATION_STATUS, - GetDataAutomationStatusInput, - GetDataAutomationStatusOutput, INVOKE_DATA_AUTOMATION, INVOKE_DATA_AUTOMATION_ASYNC, - InvokeDataAutomationAsyncInput, - InvokeDataAutomationAsyncOutput, - InvokeDataAutomationInput, - InvokeDataAutomationOutput, LIST_TAGS_FOR_RESOURCE, - ListTagsForResourceInput, - ListTagsForResourceOutput, TAG_RESOURCE, - TagResourceInput, - TagResourceOutput, UNTAG_RESOURCE, - UntagResourceInput, - UntagResourceOutput, ) from .user_agent import aws_user_agent_plugin +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .models import ( + GetDataAutomationStatusInput, + GetDataAutomationStatusOutput, + InvokeDataAutomationAsyncInput, + InvokeDataAutomationAsyncOutput, + InvokeDataAutomationInput, + InvokeDataAutomationOutput, + ListTagsForResourceInput, + ListTagsForResourceOutput, + TagResourceInput, + TagResourceOutput, + UntagResourceInput, + UntagResourceOutput, + ) + logger = logging.getLogger(__name__) @@ -105,12 +113,12 @@ async def _post_setup( config_file = await config_context.parsed_profiles() if config_context.profile_source is ConfigSource.OVERRIDE: profile_name = config_context.profile_name - config.aws_credentials_identity_resolver = await IdentityChain.create( + config.aws_credentials_identity_resolver = await AsyncIdentityChain.create( AWSCredentialsIdentity, config_file=config_file, profile_name=profile_name, region_override=config.region, - http_client=cast(HTTPClient | None, config.transport), + http_client=cast(AsyncHTTPClient | None, config.transport), ) async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( @@ -119,7 +127,7 @@ async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( operation: APIOperation[I, O], default_plugins: list[Plugin], plugins: list[Plugin] | None, - ) -> tuple[RequestPipeline[Any, Any], ClientCall[I, O]]: + ) -> tuple[AsyncRequestPipeline[Any, Any], AsyncClientCall[I, O]]: if self._closed: raise RuntimeError( "Cannot invoke an operation on a client that has been closed." diff --git a/clients/aws-sdk-bedrock-data-automation-runtime/src/aws_sdk_bedrock_data_automation_runtime/config.py b/clients/aws-sdk-bedrock-data-automation-runtime/src/aws_sdk_bedrock_data_automation_runtime/config.py index eca4e084..46fb7f34 100644 --- a/clients/aws-sdk-bedrock-data-automation-runtime/src/aws_sdk_bedrock_data_automation_runtime/config.py +++ b/clients/aws-sdk-bedrock-data-automation-runtime/src/aws_sdk_bedrock_data_automation_runtime/config.py @@ -1,72 +1,88 @@ # Code generated by smithy-python-codegen DO NOT EDIT. from dataclasses import dataclass, field -from typing import Any, Callable, ClassVar, Self, TypeAlias, Union, Unpack +from typing import ( + Any, + Callable, + ClassVar, + Self, + TYPE_CHECKING, + TypeAlias, + Union, + Unpack, +) -from smithy_aws_core.aio.protocols import AwsJson11ClientProtocol -from smithy_aws_core.auth import SigV4AuthScheme -from smithy_aws_core.config import AwsConfigOverrides, FileSystem -from smithy_aws_core.config.aws_config import AsyncAwsConfig -from smithy_aws_core.config.resolvers import EndpointUriResolver -from smithy_aws_core.config.types import FieldSpec -from smithy_aws_core.endpoints.standard_regional import ( - StandardRegionalEndpointsResolver, +from smithy_aws_core.aio.auth.sigv4 import AsyncSigV4AuthScheme +from smithy_aws_core.aio.config import AsyncFileSystem +from smithy_aws_core.aio.config.aws_config import AsyncAwsConfig, AwsConfigOverrides +from smithy_aws_core.aio.config.resolvers import EndpointUriResolver +from smithy_aws_core.aio.endpoints.standard_regional import ( + AsyncStandardRegionalEndpointsResolver, ) +from smithy_aws_core.aio.protocols import AsyncAwsJson11ClientProtocol +from smithy_aws_core.config.types import FieldSpec from smithy_aws_core.identity import AWSCredentialsIdentity, AWSIdentityProperties -from smithy_core.aio.interfaces import ( - ClientProtocol, - EndpointResolver, - ProtocolConstructor, - ProtocolSettings, -) -from smithy_core.aio.interfaces.auth import AuthScheme -from smithy_core.aio.interfaces.identity import IdentityResolver -from smithy_core.interceptors import Interceptor +from smithy_core.aio.interfaces import AsyncClientProtocol, AsyncEndpointResolver +from smithy_core.aio.interfaces.auth import AsyncAuthScheme +from smithy_core.aio.interfaces.identity import AsyncIdentityResolver +from smithy_core.interfaces import ProtocolConstructor, ProtocolSettings from smithy_core.interfaces.auth import AuthSchemeResolver from smithy_core.shapes import ShapeID from smithy_http.aio.aiohttp import AIOHTTPClient +from ._private.schemas import AMAZON_BEDROCK_KEYSTONE_RUNTIME_SERVICE from .auth import HTTPAuthSchemeResolver -from .models import ( - GetDataAutomationStatusInput, - GetDataAutomationStatusOutput, - InvokeDataAutomationAsyncInput, - InvokeDataAutomationAsyncOutput, - InvokeDataAutomationInput, - InvokeDataAutomationOutput, - ListTagsForResourceInput, - ListTagsForResourceOutput, - TagResourceInput, - TagResourceOutput, - UntagResourceInput, - UntagResourceOutput, -) -_ServiceInterceptor = Union[ - Interceptor[GetDataAutomationStatusInput, GetDataAutomationStatusOutput, Any, Any], - Interceptor[InvokeDataAutomationInput, InvokeDataAutomationOutput, Any, Any], - Interceptor[ - InvokeDataAutomationAsyncInput, InvokeDataAutomationAsyncOutput, Any, Any - ], - Interceptor[ListTagsForResourceInput, ListTagsForResourceOutput, Any, Any], - Interceptor[TagResourceInput, TagResourceOutput, Any, Any], - Interceptor[UntagResourceInput, UntagResourceOutput, Any, Any], -] +if TYPE_CHECKING: + from smithy_core.interceptors import Interceptor + from .models import ( + GetDataAutomationStatusInput, + GetDataAutomationStatusOutput, + InvokeDataAutomationAsyncInput, + InvokeDataAutomationAsyncOutput, + InvokeDataAutomationInput, + InvokeDataAutomationOutput, + ListTagsForResourceInput, + ListTagsForResourceOutput, + TagResourceInput, + TagResourceOutput, + UntagResourceInput, + UntagResourceOutput, + ) + + _ServiceInterceptor = Union[ + Interceptor[ + GetDataAutomationStatusInput, GetDataAutomationStatusOutput, Any, Any + ], + Interceptor[InvokeDataAutomationInput, InvokeDataAutomationOutput, Any, Any], + Interceptor[ + InvokeDataAutomationAsyncInput, InvokeDataAutomationAsyncOutput, Any, Any + ], + Interceptor[ListTagsForResourceInput, ListTagsForResourceOutput, Any, Any], + Interceptor[TagResourceInput, TagResourceOutput, Any, Any], + Interceptor[UntagResourceInput, UntagResourceOutput, Any, Any], + ] +else: + _ServiceInterceptor = Any + _PROTOCOL_SETTINGS = ProtocolSettings( namespace="com.amazonaws.bedrockdataautomationruntime", service_target="AmazonBedrockKeystoneRuntimeService", + service_schema=AMAZON_BEDROCK_KEYSTONE_RUNTIME_SERVICE, ) class _AsyncBedrockDataAutomationRuntimeConfigOverrides( AwsConfigOverrides, total=False ): - endpoint_resolver: EndpointResolver | None + endpoint_resolver: AsyncEndpointResolver | None protocol: ( - ClientProtocol[Any, Any] | ProtocolConstructor[ClientProtocol[Any, Any]] | None + AsyncClientProtocol[Any, Any] + | ProtocolConstructor[AsyncClientProtocol[Any, Any]] + | None ) - auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None + auth_schemes: dict[ShapeID, AsyncAuthScheme[Any, Any, Any, Any]] | None auth_scheme_resolver: AuthSchemeResolver | None @@ -74,17 +90,17 @@ class _AsyncBedrockDataAutomationRuntimeConfigOverrides( class AsyncBedrockDataAutomationRuntimeConfig(AsyncAwsConfig): """Bedrock Data Automation Runtime configuration (async-resolved).""" - endpoint_resolver: EndpointResolver | None = None + endpoint_resolver: AsyncEndpointResolver | None = None """ The endpoint resolver used to resolve the final endpoint per-operation based on the configuration. """ - protocol: ClientProtocol[Any, Any] | None = None + protocol: AsyncClientProtocol[Any, Any] | None = None """ Pass a protocol class reference from smithy_aws_core.aio.protocols to - select the protocol, e.g. protocol=AwsJson10ClientProtocol. For custom - protocols a protocol instance may also be passed. + select the protocol, e.g. protocol=AsyncAwsJson10ClientProtocol. For + custom protocols a protocol instance may also be passed. """ interceptors: list[_ServiceInterceptor] = field(default_factory=lambda: []) @@ -93,7 +109,7 @@ class AsyncBedrockDataAutomationRuntimeConfig(AsyncAwsConfig): execution of a request. """ - auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None = None + auth_schemes: dict[ShapeID, AsyncAuthScheme[Any, Any, Any, Any]] | None = None """A map of auth scheme ids to auth schemes.""" auth_scheme_resolver: AuthSchemeResolver | None = None @@ -103,7 +119,7 @@ class AsyncBedrockDataAutomationRuntimeConfig(AsyncAwsConfig): """ aws_credentials_identity_resolver: ( - IdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None + AsyncIdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None ) = None """Resolves AWS Credentials. Required for operations that use Sigv4 Auth.""" @@ -145,24 +161,24 @@ class AsyncBedrockDataAutomationRuntimeConfig(AsyncAwsConfig): resolver=EndpointUriResolver("bedrock_data_automation_runtime"), ), "endpoint_resolver": FieldSpec( - default_factory=lambda: StandardRegionalEndpointsResolver( + default_factory=lambda: AsyncStandardRegionalEndpointsResolver( endpoint_prefix="bedrock-data-automation-runtime" ) ), "protocol": FieldSpec( - default_factory=lambda: AwsJson11ClientProtocol(_PROTOCOL_SETTINGS), + default_factory=lambda: AsyncAwsJson11ClientProtocol(_PROTOCOL_SETTINGS), converter=lambda p: p(_PROTOCOL_SETTINGS) if isinstance(p, type) else p, ), "auth_schemes": FieldSpec( default_factory=lambda: { - ShapeID("aws.auth#sigv4"): SigV4AuthScheme(service="bedrock") + ShapeID("aws.auth#sigv4"): AsyncSigV4AuthScheme(service="bedrock") } ), "auth_scheme_resolver": FieldSpec(default_factory=HTTPAuthSchemeResolver), "transport": FieldSpec(default_factory=lambda: AIOHTTPClient()), } - def set_auth_scheme(self, scheme: AuthScheme[Any, Any, Any, Any]) -> None: + def set_auth_scheme(self, scheme: AsyncAuthScheme[Any, Any, Any, Any]) -> None: """ Set an auth scheme implementation using its scheme ID. :param scheme: The auth scheme to add or replace. @@ -176,7 +192,7 @@ async def resolve( # pyright: ignore[reportIncompatibleMethodOverride] cls, *, profile: str | None = None, - fs: FileSystem | None = None, + fs: AsyncFileSystem | None = None, config_file_path: str | None = None, credentials_file_path: str | None = None, **overrides: Unpack[_AsyncBedrockDataAutomationRuntimeConfigOverrides], diff --git a/clients/aws-sdk-bedrock-data-automation-runtime/src/aws_sdk_bedrock_data_automation_runtime/models.py b/clients/aws-sdk-bedrock-data-automation-runtime/src/aws_sdk_bedrock_data_automation_runtime/models.py index 00575b31..ab20ae29 100644 --- a/clients/aws-sdk-bedrock-data-automation-runtime/src/aws_sdk_bedrock_data_automation_runtime/models.py +++ b/clients/aws-sdk-bedrock-data-automation-runtime/src/aws_sdk_bedrock_data_automation_runtime/models.py @@ -1,2340 +1,234 @@ # Code generated by smithy-python-codegen DO NOT EDIT. -from dataclasses import dataclass, field -from datetime import datetime -from enum import StrEnum -import logging -from typing import Any, Literal, Self, Union +from __future__ import annotations -from smithy_core.deserializers import ShapeDeserializer -from smithy_core.documents import TypeRegistry -from smithy_core.exceptions import ModeledError, SerializationError -from smithy_core.response import EMPTY_RESPONSE_METADATA, ResponseMetadata -from smithy_core.schemas import APIOperation, Schema -from smithy_core.serializers import ShapeSerializer +from ._private import schemas as _schemas +from smithy_core._dynamic_models import ModelRegistry +from smithy_core.exceptions import ModeledError +from smithy_core.schemas import APIOperation from smithy_core.shapes import ShapeID -from smithy_core.types import UnknownEnumMixin from ._private.schemas import ( - ACCESS_DENIED_EXCEPTION as _SCHEMA_ACCESS_DENIED_EXCEPTION, - ASSET_PROCESSING_CONFIGURATION as _SCHEMA_ASSET_PROCESSING_CONFIGURATION, - BLUEPRINT as _SCHEMA_BLUEPRINT, - DATA_AUTOMATION_CONFIGURATION as _SCHEMA_DATA_AUTOMATION_CONFIGURATION, - ENCRYPTION_CONFIGURATION as _SCHEMA_ENCRYPTION_CONFIGURATION, - EVENT_BRIDGE_CONFIGURATION as _SCHEMA_EVENT_BRIDGE_CONFIGURATION, GET_DATA_AUTOMATION_STATUS as _SCHEMA_GET_DATA_AUTOMATION_STATUS, - GET_DATA_AUTOMATION_STATUS_INPUT as _SCHEMA_GET_DATA_AUTOMATION_STATUS_INPUT, - GET_DATA_AUTOMATION_STATUS_OUTPUT as _SCHEMA_GET_DATA_AUTOMATION_STATUS_OUTPUT, - INPUT_CONFIGURATION as _SCHEMA_INPUT_CONFIGURATION, - INTERNAL_SERVER_EXCEPTION as _SCHEMA_INTERNAL_SERVER_EXCEPTION, INVOKE_DATA_AUTOMATION as _SCHEMA_INVOKE_DATA_AUTOMATION, INVOKE_DATA_AUTOMATION_ASYNC as _SCHEMA_INVOKE_DATA_AUTOMATION_ASYNC, - INVOKE_DATA_AUTOMATION_ASYNC_INPUT as _SCHEMA_INVOKE_DATA_AUTOMATION_ASYNC_INPUT, - INVOKE_DATA_AUTOMATION_ASYNC_OUTPUT as _SCHEMA_INVOKE_DATA_AUTOMATION_ASYNC_OUTPUT, - INVOKE_DATA_AUTOMATION_INPUT as _SCHEMA_INVOKE_DATA_AUTOMATION_INPUT, - INVOKE_DATA_AUTOMATION_OUTPUT as _SCHEMA_INVOKE_DATA_AUTOMATION_OUTPUT, LIST_TAGS_FOR_RESOURCE as _SCHEMA_LIST_TAGS_FOR_RESOURCE, - LIST_TAGS_FOR_RESOURCE_INPUT as _SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT, - LIST_TAGS_FOR_RESOURCE_OUTPUT as _SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT, - NOTIFICATION_CONFIGURATION as _SCHEMA_NOTIFICATION_CONFIGURATION, - OUTPUT_CONFIGURATION as _SCHEMA_OUTPUT_CONFIGURATION, - OUTPUT_SEGMENT as _SCHEMA_OUTPUT_SEGMENT, - RESOURCE_NOT_FOUND_EXCEPTION as _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - SERVICE_QUOTA_EXCEEDED_EXCEPTION as _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - SERVICE_UNAVAILABLE_EXCEPTION as _SCHEMA_SERVICE_UNAVAILABLE_EXCEPTION, - SYNC_INPUT_CONFIGURATION as _SCHEMA_SYNC_INPUT_CONFIGURATION, - TAG as _SCHEMA_TAG, TAG_RESOURCE as _SCHEMA_TAG_RESOURCE, - TAG_RESOURCE_INPUT as _SCHEMA_TAG_RESOURCE_INPUT, - TAG_RESOURCE_OUTPUT as _SCHEMA_TAG_RESOURCE_OUTPUT, - THROTTLING_EXCEPTION as _SCHEMA_THROTTLING_EXCEPTION, - TIMESTAMP_SEGMENT as _SCHEMA_TIMESTAMP_SEGMENT, UNTAG_RESOURCE as _SCHEMA_UNTAG_RESOURCE, - UNTAG_RESOURCE_INPUT as _SCHEMA_UNTAG_RESOURCE_INPUT, - UNTAG_RESOURCE_OUTPUT as _SCHEMA_UNTAG_RESOURCE_OUTPUT, - VALIDATION_EXCEPTION as _SCHEMA_VALIDATION_EXCEPTION, - VIDEO_ASSET_PROCESSING_CONFIGURATION as _SCHEMA_VIDEO_ASSET_PROCESSING_CONFIGURATION, - VIDEO_SEGMENT_CONFIGURATION as _SCHEMA_VIDEO_SEGMENT_CONFIGURATION, ) - -logger = logging.getLogger(__name__) - - -class ServiceError(ModeledError): - """ - Base error for all errors in the service. - - Some exceptions do not extend from this class, including - synthetic, implicit, and shared exception types. - """ - - -@dataclass(kw_only=True) -class AccessDeniedException(ServiceError): - """This exception will be thrown when customer does not have access to API.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACCESS_DENIED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_ACCESS_DENIED_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_ACCESS_DENIED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ACCESS_DENIED_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetDataAutomationStatusInput: - """Structure for request of GetDataAutomationStatus API.""" - - invocation_arn: str | None = None - """Invocation arn.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DATA_AUTOMATION_STATUS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.invocation_arn is not None: - serializer.write_string( - _SCHEMA_GET_DATA_AUTOMATION_STATUS_INPUT.members["invocationArn"], - self.invocation_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["invocation_arn"] = de.read_string( - _SCHEMA_GET_DATA_AUTOMATION_STATUS_INPUT.members[ - "invocationArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_DATA_AUTOMATION_STATUS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class OutputConfiguration: - """Output configuration.""" - - s3_uri: str - """S3 uri.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OUTPUT_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_OUTPUT_CONFIGURATION.members["s3Uri"], self.s3_uri - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["s3_uri"] = de.read_string( - _SCHEMA_OUTPUT_CONFIGURATION.members["s3Uri"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_OUTPUT_CONFIGURATION, consumer=_consumer) - if "s3_uri" not in kwargs: - kwargs["s3_uri"] = "" - return kwargs - - -class AutomationJobStatus(UnknownEnumMixin, StrEnum): - """List of status supported by automation jobs""" - - CREATED = "Created" - IN_PROGRESS = "InProgress" - SUCCESS = "Success" - SERVICE_ERROR = "ServiceError" - CLIENT_ERROR = "ClientError" - - -@dataclass(kw_only=True) -class GetDataAutomationStatusOutput: - """Response of GetDataAutomationStatus API.""" - - status: str | None = None - """Job Status.""" - - error_type: str | None = None - """Error Type.""" - - error_message: str | None = None - """Error Message.""" - - output_configuration: OutputConfiguration | None = None - """Output configuration.""" - - job_submission_time: datetime | None = None - """Job Submission time.""" - - job_completion_time: datetime | None = None - """Job completion time.""" - - job_duration_in_seconds: int | None = None - """Job duration in seconds.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DATA_AUTOMATION_STATUS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.status is not None: - serializer.write_string( - _SCHEMA_GET_DATA_AUTOMATION_STATUS_OUTPUT.members["status"], self.status - ) - - if self.error_type is not None: - serializer.write_string( - _SCHEMA_GET_DATA_AUTOMATION_STATUS_OUTPUT.members["errorType"], - self.error_type, - ) - - if self.error_message is not None: - serializer.write_string( - _SCHEMA_GET_DATA_AUTOMATION_STATUS_OUTPUT.members["errorMessage"], - self.error_message, - ) - - if self.output_configuration is not None: - serializer.write_struct( - _SCHEMA_GET_DATA_AUTOMATION_STATUS_OUTPUT.members[ - "outputConfiguration" - ], - self.output_configuration, - ) - - if self.job_submission_time is not None: - serializer.write_timestamp( - _SCHEMA_GET_DATA_AUTOMATION_STATUS_OUTPUT.members["jobSubmissionTime"], - self.job_submission_time, - ) - - if self.job_completion_time is not None: - serializer.write_timestamp( - _SCHEMA_GET_DATA_AUTOMATION_STATUS_OUTPUT.members["jobCompletionTime"], - self.job_completion_time, - ) - - if self.job_duration_in_seconds is not None: - serializer.write_integer( - _SCHEMA_GET_DATA_AUTOMATION_STATUS_OUTPUT.members[ - "jobDurationInSeconds" - ], - self.job_duration_in_seconds, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["status"] = AutomationJobStatus( - de.read_string( - _SCHEMA_GET_DATA_AUTOMATION_STATUS_OUTPUT.members["status"] - ) - ) - - case 1: - kwargs["error_type"] = de.read_string( - _SCHEMA_GET_DATA_AUTOMATION_STATUS_OUTPUT.members["errorType"] - ) - - case 2: - kwargs["error_message"] = de.read_string( - _SCHEMA_GET_DATA_AUTOMATION_STATUS_OUTPUT.members[ - "errorMessage" - ] - ) - - case 3: - kwargs["output_configuration"] = OutputConfiguration.deserialize(de) - - case 4: - kwargs["job_submission_time"] = de.read_timestamp( - _SCHEMA_GET_DATA_AUTOMATION_STATUS_OUTPUT.members[ - "jobSubmissionTime" - ] - ) - - case 5: - kwargs["job_completion_time"] = de.read_timestamp( - _SCHEMA_GET_DATA_AUTOMATION_STATUS_OUTPUT.members[ - "jobCompletionTime" - ] - ) - - case 6: - kwargs["job_duration_in_seconds"] = de.read_integer( - _SCHEMA_GET_DATA_AUTOMATION_STATUS_OUTPUT.members[ - "jobDurationInSeconds" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_DATA_AUTOMATION_STATUS_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InternalServerException(ServiceError): - """This exception is for any internal un-expected service errors.""" - - fault: Literal["client", "server"] | None = "server" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INTERNAL_SERVER_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INTERNAL_SERVER_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INTERNAL_SERVER_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INTERNAL_SERVER_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ResourceNotFoundException(ServiceError): - """ - This exception will be thrown when resource provided from customer not - found. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ThrottlingException(ServiceError): - """This exception will be thrown when customer reached API TPS limit.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_THROTTLING_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_THROTTLING_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_THROTTLING_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_THROTTLING_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ValidationException(ServiceError): - """This exception will be thrown when customer provided invalid parameters.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VALIDATION_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_VALIDATION_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_VALIDATION_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VALIDATION_EXCEPTION, consumer=_consumer) - return kwargs - - -GET_DATA_AUTOMATION_STATUS = APIOperation( - input=GetDataAutomationStatusInput, - output=GetDataAutomationStatusOutput, - schema=_SCHEMA_GET_DATA_AUTOMATION_STATUS, - input_schema=_SCHEMA_GET_DATA_AUTOMATION_STATUS_INPUT, - output_schema=_SCHEMA_GET_DATA_AUTOMATION_STATUS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockdataautomationruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockdataautomationruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockdataautomationruntime#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockdataautomationruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockdataautomationruntime#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class BlueprintStage(UnknownEnumMixin, StrEnum): - """Blueprint stage enum.""" - - DEVELOPMENT = "DEVELOPMENT" - LIVE = "LIVE" - - -@dataclass(kw_only=True) -class Blueprint: - """Structure for single blueprint entity.""" - - blueprint_arn: str - """Arn of blueprint.""" - - version: str | None = None - """Version of blueprint.""" - - stage: str | None = None - """Stage of blueprint.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BLUEPRINT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_BLUEPRINT.members["blueprintArn"], self.blueprint_arn - ) - if self.version is not None: - serializer.write_string(_SCHEMA_BLUEPRINT.members["version"], self.version) - - if self.stage is not None: - serializer.write_string(_SCHEMA_BLUEPRINT.members["stage"], self.stage) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["blueprint_arn"] = de.read_string( - _SCHEMA_BLUEPRINT.members["blueprintArn"] - ) - - case 1: - kwargs["version"] = de.read_string( - _SCHEMA_BLUEPRINT.members["version"] - ) - - case 2: - kwargs["stage"] = BlueprintStage( - de.read_string(_SCHEMA_BLUEPRINT.members["stage"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BLUEPRINT, consumer=_consumer) - if "blueprint_arn" not in kwargs: - kwargs["blueprint_arn"] = "" - return kwargs - - -def _serialize_blueprint_list( - serializer: ShapeSerializer, schema: Schema, value: list[Blueprint] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_blueprint_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Blueprint]: - result: list[Blueprint] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Blueprint.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class DataAutomationStage(UnknownEnumMixin, StrEnum): - """Data automation stage.""" - - LIVE = "LIVE" - DEVELOPMENT = "DEVELOPMENT" - - -@dataclass(kw_only=True) -class DataAutomationConfiguration: - """Data automation configuration.""" - - data_automation_project_arn: str - """Data automation project arn.""" - - stage: str | None = None - """Data automation stage.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DATA_AUTOMATION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DATA_AUTOMATION_CONFIGURATION.members["dataAutomationProjectArn"], - self.data_automation_project_arn, - ) - if self.stage is not None: - serializer.write_string( - _SCHEMA_DATA_AUTOMATION_CONFIGURATION.members["stage"], self.stage - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["data_automation_project_arn"] = de.read_string( - _SCHEMA_DATA_AUTOMATION_CONFIGURATION.members[ - "dataAutomationProjectArn" - ] - ) - - case 1: - kwargs["stage"] = DataAutomationStage( - de.read_string( - _SCHEMA_DATA_AUTOMATION_CONFIGURATION.members["stage"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DATA_AUTOMATION_CONFIGURATION, consumer=_consumer - ) - if "data_automation_project_arn" not in kwargs: - kwargs["data_automation_project_arn"] = "" - return kwargs - - -def _serialize_encryption_context_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_encryption_context_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class EncryptionConfiguration: - """Encryption configuration.""" - - kms_key_id: str - """Customer KMS key used for encryption""" - - kms_encryption_context: dict[str, str] | None = None - """KMS encryption context.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ENCRYPTION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_ENCRYPTION_CONFIGURATION.members["kmsKeyId"], self.kms_key_id - ) - if self.kms_encryption_context is not None: - _serialize_encryption_context_map( - serializer, - _SCHEMA_ENCRYPTION_CONFIGURATION.members["kmsEncryptionContext"], - self.kms_encryption_context, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["kms_key_id"] = de.read_string( - _SCHEMA_ENCRYPTION_CONFIGURATION.members["kmsKeyId"] - ) - - case 1: - kwargs["kms_encryption_context"] = ( - _deserialize_encryption_context_map( - de, - _SCHEMA_ENCRYPTION_CONFIGURATION.members[ - "kmsEncryptionContext" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ENCRYPTION_CONFIGURATION, consumer=_consumer) - if "kms_key_id" not in kwargs: - kwargs["kms_key_id"] = "" - return kwargs - - -@dataclass(kw_only=True) -class TimestampSegment: - """Timestamp segment""" - - start_time_millis: int - """Start timestamp in milliseconds""" - - end_time_millis: int - """End timestamp in milliseconds""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TIMESTAMP_SEGMENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_long( - _SCHEMA_TIMESTAMP_SEGMENT.members["startTimeMillis"], self.start_time_millis - ) - serializer.write_long( - _SCHEMA_TIMESTAMP_SEGMENT.members["endTimeMillis"], self.end_time_millis - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["start_time_millis"] = de.read_long( - _SCHEMA_TIMESTAMP_SEGMENT.members["startTimeMillis"] - ) - - case 1: - kwargs["end_time_millis"] = de.read_long( - _SCHEMA_TIMESTAMP_SEGMENT.members["endTimeMillis"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TIMESTAMP_SEGMENT, consumer=_consumer) - if "start_time_millis" not in kwargs: - kwargs["start_time_millis"] = 0 - if "end_time_millis" not in kwargs: - kwargs["end_time_millis"] = 0 - return kwargs - - -@dataclass -class VideoSegmentConfigurationTimestampSegment: - """Timestamp segment""" - - value: TimestampSegment - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VIDEO_SEGMENT_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_VIDEO_SEGMENT_CONFIGURATION.members["timestampSegment"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=TimestampSegment.deserialize(deserializer)) - - -@dataclass -class VideoSegmentConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -VideoSegmentConfiguration = Union[ - VideoSegmentConfigurationTimestampSegment | VideoSegmentConfigurationUnknown -] -"""Delimits the segment of the input that will be processed""" - - -class _VideoSegmentConfigurationDeserializer: - _result: VideoSegmentConfiguration | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> VideoSegmentConfiguration: - self._result = None - deserializer.read_struct(_SCHEMA_VIDEO_SEGMENT_CONFIGURATION, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - VideoSegmentConfigurationTimestampSegment.deserialize(de) - ) - - case _: - self._set_result( - VideoSegmentConfigurationUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: VideoSegmentConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class VideoAssetProcessingConfiguration: - """Video asset processing configuration""" - - segment_configuration: VideoSegmentConfiguration | None = None - """Delimits the segment of the input that will be processed""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VIDEO_ASSET_PROCESSING_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.segment_configuration is not None: - serializer.write_struct( - _SCHEMA_VIDEO_ASSET_PROCESSING_CONFIGURATION.members[ - "segmentConfiguration" - ], - self.segment_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["segment_configuration"] = ( - _VideoSegmentConfigurationDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_VIDEO_ASSET_PROCESSING_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class AssetProcessingConfiguration: - """Config containing asset processing related knobs for all modalities""" - - video: VideoAssetProcessingConfiguration | None = None - """Video asset processing configuration""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ASSET_PROCESSING_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.video is not None: - serializer.write_struct( - _SCHEMA_ASSET_PROCESSING_CONFIGURATION.members["video"], self.video - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["video"] = VideoAssetProcessingConfiguration.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ASSET_PROCESSING_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InputConfiguration: - """Input configuration.""" - - s3_uri: str - """S3 uri.""" - - asset_processing_configuration: AssetProcessingConfiguration | None = None - """Asset processing configuration""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INPUT_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_INPUT_CONFIGURATION.members["s3Uri"], self.s3_uri - ) - if self.asset_processing_configuration is not None: - serializer.write_struct( - _SCHEMA_INPUT_CONFIGURATION.members["assetProcessingConfiguration"], - self.asset_processing_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["s3_uri"] = de.read_string( - _SCHEMA_INPUT_CONFIGURATION.members["s3Uri"] - ) - - case 1: - kwargs["asset_processing_configuration"] = ( - AssetProcessingConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INPUT_CONFIGURATION, consumer=_consumer) - if "s3_uri" not in kwargs: - kwargs["s3_uri"] = "" - return kwargs - - -@dataclass(kw_only=True) -class EventBridgeConfiguration: - """Event bridge configuration.""" - - event_bridge_enabled: bool - """Event bridge flag.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVENT_BRIDGE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_boolean( - _SCHEMA_EVENT_BRIDGE_CONFIGURATION.members["eventBridgeEnabled"], - self.event_bridge_enabled, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["event_bridge_enabled"] = de.read_boolean( - _SCHEMA_EVENT_BRIDGE_CONFIGURATION.members["eventBridgeEnabled"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EVENT_BRIDGE_CONFIGURATION, consumer=_consumer) - if "event_bridge_enabled" not in kwargs: - kwargs["event_bridge_enabled"] = False - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(event_bridge_enabled=False) - - -@dataclass(kw_only=True) -class NotificationConfiguration: - """Notification configuration.""" - - event_bridge_configuration: EventBridgeConfiguration - """Event bridge configuration.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_NOTIFICATION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_NOTIFICATION_CONFIGURATION.members["eventBridgeConfiguration"], - self.event_bridge_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["event_bridge_configuration"] = ( - EventBridgeConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_NOTIFICATION_CONFIGURATION, consumer=_consumer) - if "event_bridge_configuration" not in kwargs: - kwargs["event_bridge_configuration"] = ( - EventBridgeConfiguration._smithy_default() - ) - return kwargs - - -@dataclass(kw_only=True) -class Tag: - """Key value pair of a tag""" - - key: str - """Defines the context of the tag.""" - - value: str - """ - Defines the value within the context. e.g. - ``{=html}. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TAG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_TAG.members["key"], self.key) - serializer.write_string(_SCHEMA_TAG.members["value"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["key"] = de.read_string(_SCHEMA_TAG.members["key"]) - - case 1: - kwargs["value"] = de.read_string(_SCHEMA_TAG.members["value"]) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TAG, consumer=_consumer) - if "key" not in kwargs: - kwargs["key"] = "" - if "value" not in kwargs: - kwargs["value"] = "" - return kwargs - - -def _serialize_tag_list( - serializer: ShapeSerializer, schema: Schema, value: list[Tag] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_tag_list(deserializer: ShapeDeserializer, schema: Schema) -> list[Tag]: - result: list[Tag] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Tag.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class InvokeDataAutomationAsyncInput: - """Invoke Data Automation Async Request""" - - client_token: str | None = None - """Idempotency token.""" - - input_configuration: InputConfiguration | None = None - """Input configuration.""" - - output_configuration: OutputConfiguration | None = None - """Output configuration.""" - - data_automation_configuration: DataAutomationConfiguration | None = None - """Data automation configuration.""" - - encryption_configuration: EncryptionConfiguration | None = None - """Encryption configuration.""" - - notification_configuration: NotificationConfiguration | None = None - """Notification configuration.""" - - blueprints: list[Blueprint] | None = None - """Blueprint list.""" - - data_automation_profile_arn: str | None = None - """Data automation profile ARN""" - - tags: list[Tag] | None = None - """List of tags.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOKE_DATA_AUTOMATION_ASYNC_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.client_token is not None: - serializer.write_string( - _SCHEMA_INVOKE_DATA_AUTOMATION_ASYNC_INPUT.members["clientToken"], - self.client_token, - ) - - if self.input_configuration is not None: - serializer.write_struct( - _SCHEMA_INVOKE_DATA_AUTOMATION_ASYNC_INPUT.members[ - "inputConfiguration" - ], - self.input_configuration, - ) - - if self.output_configuration is not None: - serializer.write_struct( - _SCHEMA_INVOKE_DATA_AUTOMATION_ASYNC_INPUT.members[ - "outputConfiguration" - ], - self.output_configuration, - ) - - if self.data_automation_configuration is not None: - serializer.write_struct( - _SCHEMA_INVOKE_DATA_AUTOMATION_ASYNC_INPUT.members[ - "dataAutomationConfiguration" - ], - self.data_automation_configuration, - ) - - if self.encryption_configuration is not None: - serializer.write_struct( - _SCHEMA_INVOKE_DATA_AUTOMATION_ASYNC_INPUT.members[ - "encryptionConfiguration" - ], - self.encryption_configuration, - ) - - if self.notification_configuration is not None: - serializer.write_struct( - _SCHEMA_INVOKE_DATA_AUTOMATION_ASYNC_INPUT.members[ - "notificationConfiguration" - ], - self.notification_configuration, - ) - - if self.blueprints is not None: - _serialize_blueprint_list( - serializer, - _SCHEMA_INVOKE_DATA_AUTOMATION_ASYNC_INPUT.members["blueprints"], - self.blueprints, - ) - - if self.data_automation_profile_arn is not None: - serializer.write_string( - _SCHEMA_INVOKE_DATA_AUTOMATION_ASYNC_INPUT.members[ - "dataAutomationProfileArn" - ], - self.data_automation_profile_arn, - ) - - if self.tags is not None: - _serialize_tag_list( - serializer, - _SCHEMA_INVOKE_DATA_AUTOMATION_ASYNC_INPUT.members["tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["client_token"] = de.read_string( - _SCHEMA_INVOKE_DATA_AUTOMATION_ASYNC_INPUT.members[ - "clientToken" - ] - ) - - case 1: - kwargs["input_configuration"] = InputConfiguration.deserialize(de) - - case 2: - kwargs["output_configuration"] = OutputConfiguration.deserialize(de) - - case 3: - kwargs["data_automation_configuration"] = ( - DataAutomationConfiguration.deserialize(de) - ) - - case 4: - kwargs["encryption_configuration"] = ( - EncryptionConfiguration.deserialize(de) - ) - - case 5: - kwargs["notification_configuration"] = ( - NotificationConfiguration.deserialize(de) - ) - - case 6: - kwargs["blueprints"] = _deserialize_blueprint_list( - de, - _SCHEMA_INVOKE_DATA_AUTOMATION_ASYNC_INPUT.members[ - "blueprints" - ], - ) - - case 7: - kwargs["data_automation_profile_arn"] = de.read_string( - _SCHEMA_INVOKE_DATA_AUTOMATION_ASYNC_INPUT.members[ - "dataAutomationProfileArn" - ] - ) - - case 8: - kwargs["tags"] = _deserialize_tag_list( - de, _SCHEMA_INVOKE_DATA_AUTOMATION_ASYNC_INPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVOKE_DATA_AUTOMATION_ASYNC_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InvokeDataAutomationAsyncOutput: - """Invoke Data Automation Async Response""" - - invocation_arn: str - """ARN of the automation job""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .models import ( + GetDataAutomationStatusInput, + GetDataAutomationStatusOutput, + InvokeDataAutomationAsyncInput, + InvokeDataAutomationAsyncOutput, + InvokeDataAutomationInput, + InvokeDataAutomationOutput, + ListTagsForResourceInput, + ListTagsForResourceOutput, + TagResourceInput, + TagResourceOutput, + UntagResourceInput, + UntagResourceOutput, ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOKE_DATA_AUTOMATION_ASYNC_OUTPUT, self) - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_INVOKE_DATA_AUTOMATION_ASYNC_OUTPUT.members["invocationArn"], - self.invocation_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["invocation_arn"] = de.read_string( - _SCHEMA_INVOKE_DATA_AUTOMATION_ASYNC_OUTPUT.members[ - "invocationArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVOKE_DATA_AUTOMATION_ASYNC_OUTPUT, consumer=_consumer - ) - if "invocation_arn" not in kwargs: - kwargs["invocation_arn"] = "" - return kwargs - - -@dataclass(kw_only=True) -class ServiceQuotaExceededException(ServiceError): - """This exception will be thrown when service quota is exceeded.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) +class ServiceError(ModeledError): + """ + Base error for all errors in the service. - deserializer.read_struct( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, consumer=_consumer - ) - return kwargs + Some exceptions do not extend from this class, including + synthetic, implicit, and shared exception types. + """ -INVOKE_DATA_AUTOMATION_ASYNC = APIOperation( - input=InvokeDataAutomationAsyncInput, - output=InvokeDataAutomationAsyncOutput, - schema=_SCHEMA_INVOKE_DATA_AUTOMATION_ASYNC, - input_schema=_SCHEMA_INVOKE_DATA_AUTOMATION_ASYNC_INPUT, - output_schema=_SCHEMA_INVOKE_DATA_AUTOMATION_ASYNC_OUTPUT, - error_registry=TypeRegistry( +_registry = ModelRegistry( + _schemas, + renames={}, + index={ + "AccessDeniedException": "ACCESS_DENIED_EXCEPTION", + "AssetProcessingConfiguration": "ASSET_PROCESSING_CONFIGURATION", + "AutomationJobStatus": "AUTOMATION_JOB_STATUS", + "Blueprint": "BLUEPRINT", + "BlueprintStage": "BLUEPRINT_STAGE", + "CustomOutputStatus": "CUSTOM_OUTPUT_STATUS", + "DataAutomationConfiguration": "DATA_AUTOMATION_CONFIGURATION", + "DataAutomationStage": "DATA_AUTOMATION_STAGE", + "EncryptionConfiguration": "ENCRYPTION_CONFIGURATION", + "EventBridgeConfiguration": "EVENT_BRIDGE_CONFIGURATION", + "GetDataAutomationStatusInput": "GET_DATA_AUTOMATION_STATUS_INPUT", + "GetDataAutomationStatusOutput": "GET_DATA_AUTOMATION_STATUS_OUTPUT", + "InputConfiguration": "INPUT_CONFIGURATION", + "InternalServerException": "INTERNAL_SERVER_EXCEPTION", + "InvokeDataAutomationAsyncInput": "INVOKE_DATA_AUTOMATION_ASYNC_INPUT", + "InvokeDataAutomationAsyncOutput": "INVOKE_DATA_AUTOMATION_ASYNC_OUTPUT", + "InvokeDataAutomationInput": "INVOKE_DATA_AUTOMATION_INPUT", + "InvokeDataAutomationOutput": "INVOKE_DATA_AUTOMATION_OUTPUT", + "ListTagsForResourceInput": "LIST_TAGS_FOR_RESOURCE_INPUT", + "ListTagsForResourceOutput": "LIST_TAGS_FOR_RESOURCE_OUTPUT", + "NotificationConfiguration": "NOTIFICATION_CONFIGURATION", + "OutputConfiguration": "OUTPUT_CONFIGURATION", + "OutputSegment": "OUTPUT_SEGMENT", + "ResourceNotFoundException": "RESOURCE_NOT_FOUND_EXCEPTION", + "SemanticModality": "SEMANTIC_MODALITY", + "ServiceQuotaExceededException": "SERVICE_QUOTA_EXCEEDED_EXCEPTION", + "ServiceUnavailableException": "SERVICE_UNAVAILABLE_EXCEPTION", + "SyncInputConfiguration": "SYNC_INPUT_CONFIGURATION", + "Tag": "TAG", + "TagResourceInput": "TAG_RESOURCE_INPUT", + "TagResourceOutput": "TAG_RESOURCE_OUTPUT", + "ThrottlingException": "THROTTLING_EXCEPTION", + "TimestampSegment": "TIMESTAMP_SEGMENT", + "UntagResourceInput": "UNTAG_RESOURCE_INPUT", + "UntagResourceOutput": "UNTAG_RESOURCE_OUTPUT", + "ValidationException": "VALIDATION_EXCEPTION", + "VideoAssetProcessingConfiguration": "VIDEO_ASSET_PROCESSING_CONFIGURATION", + "VideoSegmentConfiguration": "VIDEO_SEGMENT_CONFIGURATION", + "VideoSegmentConfigurationTimestampSegment": "VIDEO_SEGMENT_CONFIGURATION", + "VideoSegmentConfigurationUnknown": "VIDEO_SEGMENT_CONFIGURATION", + }, + shape_names=frozenset( { - ShapeID( - "com.amazonaws.bedrockdataautomationruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockdataautomationruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockdataautomationruntime#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockdataautomationruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockdataautomationruntime#ValidationException" - ): ValidationException, + "AccessDeniedException", + "AssetProcessingConfiguration", + "AutomationJobStatus", + "Blueprint", + "BlueprintStage", + "CustomOutputStatus", + "DataAutomationConfiguration", + "DataAutomationStage", + "EncryptionConfiguration", + "EventBridgeConfiguration", + "GetDataAutomationStatusInput", + "GetDataAutomationStatusOutput", + "InputConfiguration", + "InternalServerException", + "InvokeDataAutomationAsyncInput", + "InvokeDataAutomationAsyncOutput", + "InvokeDataAutomationInput", + "InvokeDataAutomationOutput", + "ListTagsForResourceInput", + "ListTagsForResourceOutput", + "NotificationConfiguration", + "OutputConfiguration", + "OutputSegment", + "ResourceNotFoundException", + "SemanticModality", + "ServiceQuotaExceededException", + "ServiceUnavailableException", + "SyncInputConfiguration", + "Tag", + "TagResourceInput", + "TagResourceOutput", + "ThrottlingException", + "TimestampSegment", + "UntagResourceInput", + "UntagResourceOutput", + "ValidationException", + "VideoAssetProcessingConfiguration", + "VideoSegmentConfiguration", } ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], + service_error="ServiceError", ) -@dataclass(kw_only=True) -class SyncInputConfiguration: - """Input configuration for synchronous API""" - - bytes_: bytes | None = None - """Input data as bytes""" - - s3_uri: str | None = None - """S3 URI of the input data""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SYNC_INPUT_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.bytes_ is not None: - serializer.write_blob( - _SCHEMA_SYNC_INPUT_CONFIGURATION.members["bytes"], self.bytes_ - ) - - if self.s3_uri is not None: - serializer.write_string( - _SCHEMA_SYNC_INPUT_CONFIGURATION.members["s3Uri"], self.s3_uri - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bytes_"] = de.read_blob( - _SCHEMA_SYNC_INPUT_CONFIGURATION.members["bytes"] - ) - - case 1: - kwargs["s3_uri"] = de.read_string( - _SCHEMA_SYNC_INPUT_CONFIGURATION.members["s3Uri"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SYNC_INPUT_CONFIGURATION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class InvokeDataAutomationInput: - """Invoke Data Automation Request""" - - input_configuration: SyncInputConfiguration | None = None - """Input configuration.""" - - data_automation_configuration: DataAutomationConfiguration | None = None - """Data automation configuration.""" - - blueprints: list[Blueprint] | None = None - """Blueprint list.""" - - data_automation_profile_arn: str | None = None - """Data automation profile ARN""" - - encryption_configuration: EncryptionConfiguration | None = None - """Encryption configuration.""" - - output_configuration: OutputConfiguration | None = None - """Output configuration.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOKE_DATA_AUTOMATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.input_configuration is not None: - serializer.write_struct( - _SCHEMA_INVOKE_DATA_AUTOMATION_INPUT.members["inputConfiguration"], - self.input_configuration, - ) - - if self.data_automation_configuration is not None: - serializer.write_struct( - _SCHEMA_INVOKE_DATA_AUTOMATION_INPUT.members[ - "dataAutomationConfiguration" - ], - self.data_automation_configuration, - ) - - if self.blueprints is not None: - _serialize_blueprint_list( - serializer, - _SCHEMA_INVOKE_DATA_AUTOMATION_INPUT.members["blueprints"], - self.blueprints, - ) - - if self.data_automation_profile_arn is not None: - serializer.write_string( - _SCHEMA_INVOKE_DATA_AUTOMATION_INPUT.members[ - "dataAutomationProfileArn" - ], - self.data_automation_profile_arn, - ) - - if self.encryption_configuration is not None: - serializer.write_struct( - _SCHEMA_INVOKE_DATA_AUTOMATION_INPUT.members["encryptionConfiguration"], - self.encryption_configuration, - ) - - if self.output_configuration is not None: - serializer.write_struct( - _SCHEMA_INVOKE_DATA_AUTOMATION_INPUT.members["outputConfiguration"], - self.output_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["input_configuration"] = SyncInputConfiguration.deserialize( - de - ) - - case 1: - kwargs["data_automation_configuration"] = ( - DataAutomationConfiguration.deserialize(de) - ) - - case 2: - kwargs["blueprints"] = _deserialize_blueprint_list( - de, _SCHEMA_INVOKE_DATA_AUTOMATION_INPUT.members["blueprints"] - ) - - case 3: - kwargs["data_automation_profile_arn"] = de.read_string( - _SCHEMA_INVOKE_DATA_AUTOMATION_INPUT.members[ - "dataAutomationProfileArn" - ] - ) - - case 4: - kwargs["encryption_configuration"] = ( - EncryptionConfiguration.deserialize(de) - ) - - case 5: - kwargs["output_configuration"] = OutputConfiguration.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVOKE_DATA_AUTOMATION_INPUT, consumer=_consumer - ) - return kwargs - - -class CustomOutputStatus(UnknownEnumMixin, StrEnum): - """Custom output status enum""" - - MATCH = "MATCH" - NO_MATCH = "NO_MATCH" - - -@dataclass(kw_only=True) -class OutputSegment: - """Results for an output segment""" - - custom_output_status: str | None = None - """Status of blueprint match""" - - custom_output: str | None = None - """Custom output response""" - - standard_output: str | None = None - """Standard output response""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OUTPUT_SEGMENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.custom_output_status is not None: - serializer.write_string( - _SCHEMA_OUTPUT_SEGMENT.members["customOutputStatus"], - self.custom_output_status, - ) - - if self.custom_output is not None: - serializer.write_string( - _SCHEMA_OUTPUT_SEGMENT.members["customOutput"], self.custom_output - ) - - if self.standard_output is not None: - serializer.write_string( - _SCHEMA_OUTPUT_SEGMENT.members["standardOutput"], self.standard_output - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["custom_output_status"] = CustomOutputStatus( - de.read_string( - _SCHEMA_OUTPUT_SEGMENT.members["customOutputStatus"] - ) - ) - - case 1: - kwargs["custom_output"] = de.read_string( - _SCHEMA_OUTPUT_SEGMENT.members["customOutput"] - ) - - case 2: - kwargs["standard_output"] = de.read_string( - _SCHEMA_OUTPUT_SEGMENT.members["standardOutput"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_OUTPUT_SEGMENT, consumer=_consumer) - return kwargs - - -def _serialize_output_segment_list( - serializer: ShapeSerializer, schema: Schema, value: list[OutputSegment] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_output_segment_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[OutputSegment]: - result: list[OutputSegment] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(OutputSegment.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class SemanticModality(UnknownEnumMixin, StrEnum): - """Semantic modality enum""" - - DOCUMENT = "DOCUMENT" - IMAGE = "IMAGE" - AUDIO = "AUDIO" - VIDEO = "VIDEO" - - -@dataclass(kw_only=True) -class InvokeDataAutomationOutput: - """Invoke Data Automation Response""" - - semantic_modality: str - """Detected semantic modality""" - - output_configuration: OutputConfiguration | None = None - """Output configuration""" - - output_segments: list[OutputSegment] = field(default_factory=list[OutputSegment]) - """List of outputs for each logical sub-doc""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOKE_DATA_AUTOMATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.output_configuration is not None: - serializer.write_struct( - _SCHEMA_INVOKE_DATA_AUTOMATION_OUTPUT.members["outputConfiguration"], - self.output_configuration, - ) - - serializer.write_string( - _SCHEMA_INVOKE_DATA_AUTOMATION_OUTPUT.members["semanticModality"], - self.semantic_modality, - ) - _serialize_output_segment_list( - serializer, - _SCHEMA_INVOKE_DATA_AUTOMATION_OUTPUT.members["outputSegments"], - self.output_segments, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["output_configuration"] = OutputConfiguration.deserialize(de) - - case 1: - kwargs["semantic_modality"] = SemanticModality( - de.read_string( - _SCHEMA_INVOKE_DATA_AUTOMATION_OUTPUT.members[ - "semanticModality" - ] - ) - ) - - case 2: - kwargs["output_segments"] = _deserialize_output_segment_list( - de, - _SCHEMA_INVOKE_DATA_AUTOMATION_OUTPUT.members["outputSegments"], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVOKE_DATA_AUTOMATION_OUTPUT, consumer=_consumer - ) - if "semantic_modality" not in kwargs: - kwargs["semantic_modality"] = SemanticModality._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class ServiceUnavailableException(ServiceError): - """This exception will be thrown when service is temporarily unavailable.""" - - fault: Literal["client", "server"] | None = "server" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SERVICE_UNAVAILABLE_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_SERVICE_UNAVAILABLE_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) +def __getattr__(name: str): + return _registry.build(name) - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_SERVICE_UNAVAILABLE_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SERVICE_UNAVAILABLE_EXCEPTION, consumer=_consumer - ) - return kwargs - - -INVOKE_DATA_AUTOMATION = APIOperation( - input=InvokeDataAutomationInput, - output=InvokeDataAutomationOutput, - schema=_SCHEMA_INVOKE_DATA_AUTOMATION, - input_schema=_SCHEMA_INVOKE_DATA_AUTOMATION_INPUT, - output_schema=_SCHEMA_INVOKE_DATA_AUTOMATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockdataautomationruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockdataautomationruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockdataautomationruntime#ServiceUnavailableException" - ): ServiceUnavailableException, - ShapeID( - "com.amazonaws.bedrockdataautomationruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockdataautomationruntime#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_SERVICE_UNAVAILABLE_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, +GET_DATA_AUTOMATION_STATUS: APIOperation[ + GetDataAutomationStatusInput, GetDataAutomationStatusOutput +] = APIOperation( + static_schema=_SCHEMA_GET_DATA_AUTOMATION_STATUS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockdataautomationruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockdataautomationruntime#InternalServerException"), + ShapeID("com.amazonaws.bedrockdataautomationruntime#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockdataautomationruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockdataautomationruntime#ValidationException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) - -@dataclass(kw_only=True) -class ListTagsForResourceInput: - """Dataclass for ListTagsForResourceInput structure.""" - - resource_arn: str | None = None - """ARN of a taggable resource""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT.members["resourceARN"], - self.resource_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT.members["resourceARN"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ListTagsForResourceOutput: - """Dataclass for ListTagsForResourceOutput structure.""" - - tags: list[Tag] | None = None - """List of tags""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.tags is not None: - _serialize_tag_list( - serializer, - _SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT.members["tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["tags"] = _deserialize_tag_list( - de, _SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_TAGS_FOR_RESOURCE = APIOperation( - input=ListTagsForResourceInput, - output=ListTagsForResourceOutput, - schema=_SCHEMA_LIST_TAGS_FOR_RESOURCE, - input_schema=_SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT, - output_schema=_SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockdataautomationruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockdataautomationruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockdataautomationruntime#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockdataautomationruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockdataautomationruntime#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, +INVOKE_DATA_AUTOMATION_ASYNC: APIOperation[ + InvokeDataAutomationAsyncInput, InvokeDataAutomationAsyncOutput +] = APIOperation( + static_schema=_SCHEMA_INVOKE_DATA_AUTOMATION_ASYNC, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockdataautomationruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockdataautomationruntime#InternalServerException"), + ShapeID( + "com.amazonaws.bedrockdataautomationruntime#ServiceQuotaExceededException" + ), + ShapeID("com.amazonaws.bedrockdataautomationruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockdataautomationruntime#ValidationException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) - -@dataclass(kw_only=True) -class TagResourceInput: - """Dataclass for TagResourceInput structure.""" - - resource_arn: str | None = None - """ARN of a taggable resource""" - - tags: list[Tag] | None = None - """List of tags""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TAG_RESOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_TAG_RESOURCE_INPUT.members["resourceARN"], self.resource_arn - ) - - if self.tags is not None: - _serialize_tag_list( - serializer, _SCHEMA_TAG_RESOURCE_INPUT.members["tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_TAG_RESOURCE_INPUT.members["resourceARN"] - ) - - case 1: - kwargs["tags"] = _deserialize_tag_list( - de, _SCHEMA_TAG_RESOURCE_INPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TAG_RESOURCE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class TagResourceOutput: - """Dataclass for TagResourceOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TAG_RESOURCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TAG_RESOURCE_OUTPUT, consumer=_consumer) - return kwargs - - -TAG_RESOURCE = APIOperation( - input=TagResourceInput, - output=TagResourceOutput, - schema=_SCHEMA_TAG_RESOURCE, - input_schema=_SCHEMA_TAG_RESOURCE_INPUT, - output_schema=_SCHEMA_TAG_RESOURCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockdataautomationruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockdataautomationruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockdataautomationruntime#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockdataautomationruntime#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockdataautomationruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockdataautomationruntime#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, +INVOKE_DATA_AUTOMATION: APIOperation[ + InvokeDataAutomationInput, InvokeDataAutomationOutput +] = APIOperation( + static_schema=_SCHEMA_INVOKE_DATA_AUTOMATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockdataautomationruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockdataautomationruntime#InternalServerException"), + ShapeID( + "com.amazonaws.bedrockdataautomationruntime#ServiceUnavailableException" + ), + ShapeID("com.amazonaws.bedrockdataautomationruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockdataautomationruntime#ValidationException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) +LIST_TAGS_FOR_RESOURCE: APIOperation[ + ListTagsForResourceInput, ListTagsForResourceOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_TAGS_FOR_RESOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockdataautomationruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockdataautomationruntime#InternalServerException"), + ShapeID("com.amazonaws.bedrockdataautomationruntime#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockdataautomationruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockdataautomationruntime#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -def _serialize_tag_key_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_tag_key_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class UntagResourceInput: - """Dataclass for UntagResourceInput structure.""" - - resource_arn: str | None = None - """ARN of a taggable resource""" - - tag_keys: list[str] | None = None - """List of tag keys""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNTAG_RESOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_UNTAG_RESOURCE_INPUT.members["resourceARN"], self.resource_arn - ) - - if self.tag_keys is not None: - _serialize_tag_key_list( - serializer, - _SCHEMA_UNTAG_RESOURCE_INPUT.members["tagKeys"], - self.tag_keys, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_UNTAG_RESOURCE_INPUT.members["resourceARN"] - ) - - case 1: - kwargs["tag_keys"] = _deserialize_tag_key_list( - de, _SCHEMA_UNTAG_RESOURCE_INPUT.members["tagKeys"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UNTAG_RESOURCE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UntagResourceOutput: - """Dataclass for UntagResourceOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNTAG_RESOURCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UNTAG_RESOURCE_OUTPUT, consumer=_consumer) - return kwargs - - -UNTAG_RESOURCE = APIOperation( - input=UntagResourceInput, - output=UntagResourceOutput, - schema=_SCHEMA_UNTAG_RESOURCE, - input_schema=_SCHEMA_UNTAG_RESOURCE_INPUT, - output_schema=_SCHEMA_UNTAG_RESOURCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockdataautomationruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockdataautomationruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockdataautomationruntime#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockdataautomationruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockdataautomationruntime#ValidationException" - ): ValidationException, - } - ), +TAG_RESOURCE: APIOperation[TagResourceInput, TagResourceOutput] = APIOperation( + static_schema=_SCHEMA_TAG_RESOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockdataautomationruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockdataautomationruntime#InternalServerException"), + ShapeID("com.amazonaws.bedrockdataautomationruntime#ResourceNotFoundException"), + ShapeID( + "com.amazonaws.bedrockdataautomationruntime#ServiceQuotaExceededException" + ), + ShapeID("com.amazonaws.bedrockdataautomationruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockdataautomationruntime#ValidationException"), + ], effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, +) + +UNTAG_RESOURCE: APIOperation[UntagResourceInput, UntagResourceOutput] = APIOperation( + static_schema=_SCHEMA_UNTAG_RESOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockdataautomationruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockdataautomationruntime#InternalServerException"), + ShapeID("com.amazonaws.bedrockdataautomationruntime#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockdataautomationruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockdataautomationruntime#ValidationException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) diff --git a/clients/aws-sdk-bedrock-data-automation-runtime/src/aws_sdk_bedrock_data_automation_runtime/models.pyi b/clients/aws-sdk-bedrock-data-automation-runtime/src/aws_sdk_bedrock_data_automation_runtime/models.pyi new file mode 100644 index 00000000..19b80e0e --- /dev/null +++ b/clients/aws-sdk-bedrock-data-automation-runtime/src/aws_sdk_bedrock_data_automation_runtime/models.pyi @@ -0,0 +1,472 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. + +from dataclasses import dataclass +from datetime import datetime +from enum import StrEnum +from typing import Self, Union + +from smithy_core.deserializers import ShapeDeserializer +from smithy_core.exceptions import ModeledError +from smithy_core.response import ResponseMetadata +from smithy_core.schemas import APIOperation +from smithy_core.serializers import ShapeSerializer +from smithy_core.types import UnknownEnumMixin + +class _SerdeShape: + def serialize(self, serializer: ShapeSerializer) -> None: ... + def serialize_members(self, serializer: ShapeSerializer) -> None: ... + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: ... + +class ServiceError(ModeledError): + """ + Base error for all errors in the service. + + Some exceptions do not extend from this class, including + synthetic, implicit, and shared exception types. + """ + +@dataclass(kw_only=True) +class AccessDeniedException(ServiceError, _SerdeShape): + """This exception will be thrown when customer does not have access to API.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class AssetProcessingConfiguration(_SerdeShape): + """Config containing asset processing related knobs for all modalities""" + + video: VideoAssetProcessingConfiguration | None = ... + """Video asset processing configuration""" + +class AutomationJobStatus(UnknownEnumMixin, StrEnum): + """List of status supported by automation jobs""" + + CREATED = "Created" + IN_PROGRESS = "InProgress" + SUCCESS = "Success" + SERVICE_ERROR = "ServiceError" + CLIENT_ERROR = "ClientError" + +@dataclass(kw_only=True) +class Blueprint(_SerdeShape): + """Structure for single blueprint entity.""" + + blueprint_arn: str + """Arn of blueprint.""" + version: str | None = ... + """Version of blueprint.""" + stage: str | None = ... + """Stage of blueprint.""" + +class BlueprintStage(UnknownEnumMixin, StrEnum): + """Blueprint stage enum.""" + + DEVELOPMENT = "DEVELOPMENT" + LIVE = "LIVE" + +class CustomOutputStatus(UnknownEnumMixin, StrEnum): + """Custom output status enum""" + + MATCH = "MATCH" + NO_MATCH = "NO_MATCH" + +@dataclass(kw_only=True) +class DataAutomationConfiguration(_SerdeShape): + """Data automation configuration.""" + + data_automation_project_arn: str + """Data automation project arn.""" + stage: str | None = ... + """Data automation stage.""" + +class DataAutomationStage(UnknownEnumMixin, StrEnum): + """Data automation stage.""" + + LIVE = "LIVE" + DEVELOPMENT = "DEVELOPMENT" + +@dataclass(kw_only=True) +class EncryptionConfiguration(_SerdeShape): + """Encryption configuration.""" + + kms_key_id: str + """Customer KMS key used for encryption""" + kms_encryption_context: dict[str, str] | None = ... + """KMS encryption context.""" + +@dataclass(kw_only=True) +class EventBridgeConfiguration(_SerdeShape): + """Event bridge configuration.""" + + event_bridge_enabled: bool + """Event bridge flag.""" + +@dataclass(kw_only=True) +class GetDataAutomationStatusInput(_SerdeShape): + """Structure for request of GetDataAutomationStatus API.""" + + invocation_arn: str | None = ... + """Invocation arn.""" + +@dataclass(kw_only=True) +class GetDataAutomationStatusOutput(_SerdeShape): + """Response of GetDataAutomationStatus API.""" + + status: str | None = ... + """Job Status.""" + error_type: str | None = ... + """Error Type.""" + error_message: str | None = ... + """Error Message.""" + output_configuration: OutputConfiguration | None = ... + """Output configuration.""" + job_submission_time: datetime | None = ... + """Job Submission time.""" + job_completion_time: datetime | None = ... + """Job completion time.""" + job_duration_in_seconds: int | None = ... + """Job duration in seconds.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InputConfiguration(_SerdeShape): + """Input configuration.""" + + s3_uri: str + """S3 uri.""" + asset_processing_configuration: AssetProcessingConfiguration | None = ... + """Asset processing configuration""" + +@dataclass(kw_only=True) +class InternalServerException(ServiceError, _SerdeShape): + """This exception is for any internal un-expected service errors.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvokeDataAutomationAsyncInput(_SerdeShape): + """Invoke Data Automation Async Request""" + + client_token: str | None = ... + """Idempotency token.""" + input_configuration: InputConfiguration | None = ... + """Input configuration.""" + output_configuration: OutputConfiguration | None = ... + """Output configuration.""" + data_automation_configuration: DataAutomationConfiguration | None = ... + """Data automation configuration.""" + encryption_configuration: EncryptionConfiguration | None = ... + """Encryption configuration.""" + notification_configuration: NotificationConfiguration | None = ... + """Notification configuration.""" + blueprints: list[Blueprint] | None = ... + """Blueprint list.""" + data_automation_profile_arn: str | None = ... + """Data automation profile ARN""" + tags: list[Tag] | None = ... + """List of tags.""" + +@dataclass(kw_only=True) +class InvokeDataAutomationAsyncOutput(_SerdeShape): + """Invoke Data Automation Async Response""" + + invocation_arn: str + """ARN of the automation job""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvokeDataAutomationInput(_SerdeShape): + """Invoke Data Automation Request""" + + input_configuration: SyncInputConfiguration | None = ... + """Input configuration.""" + data_automation_configuration: DataAutomationConfiguration | None = ... + """Data automation configuration.""" + blueprints: list[Blueprint] | None = ... + """Blueprint list.""" + data_automation_profile_arn: str | None = ... + """Data automation profile ARN""" + encryption_configuration: EncryptionConfiguration | None = ... + """Encryption configuration.""" + output_configuration: OutputConfiguration | None = ... + """Output configuration.""" + +@dataclass(kw_only=True) +class InvokeDataAutomationOutput(_SerdeShape): + """Invoke Data Automation Response""" + + output_configuration: OutputConfiguration | None = ... + """Output configuration""" + semantic_modality: str + """Detected semantic modality""" + output_segments: list[OutputSegment] = ... + """List of outputs for each logical sub-doc""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListTagsForResourceInput(_SerdeShape): + """Dataclass for ListTagsForResourceInput structure.""" + + resource_arn: str | None = ... + """ARN of a taggable resource""" + +@dataclass(kw_only=True) +class ListTagsForResourceOutput(_SerdeShape): + """Dataclass for ListTagsForResourceOutput structure.""" + + tags: list[Tag] | None = ... + """List of tags""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class NotificationConfiguration(_SerdeShape): + """Notification configuration.""" + + event_bridge_configuration: EventBridgeConfiguration + """Event bridge configuration.""" + +@dataclass(kw_only=True) +class OutputConfiguration(_SerdeShape): + """Output configuration.""" + + s3_uri: str + """S3 uri.""" + +@dataclass(kw_only=True) +class OutputSegment(_SerdeShape): + """Results for an output segment""" + + custom_output_status: str | None = ... + """Status of blueprint match""" + custom_output: str | None = ... + """Custom output response""" + standard_output: str | None = ... + """Standard output response""" + +@dataclass(kw_only=True) +class ResourceNotFoundException(ServiceError, _SerdeShape): + """ + This exception will be thrown when resource provided from customer not + found. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class SemanticModality(UnknownEnumMixin, StrEnum): + """Semantic modality enum""" + + DOCUMENT = "DOCUMENT" + IMAGE = "IMAGE" + AUDIO = "AUDIO" + VIDEO = "VIDEO" + +@dataclass(kw_only=True) +class ServiceQuotaExceededException(ServiceError, _SerdeShape): + """This exception will be thrown when service quota is exceeded.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ServiceUnavailableException(ServiceError, _SerdeShape): + """This exception will be thrown when service is temporarily unavailable.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class SyncInputConfiguration(_SerdeShape): + """Input configuration for synchronous API""" + + bytes_: bytes | None = ... + """Input data as bytes""" + s3_uri: str | None = ... + """S3 URI of the input data""" + +@dataclass(kw_only=True) +class Tag(_SerdeShape): + """Key value pair of a tag""" + + key: str + """Defines the context of the tag.""" + value: str + """ + Defines the value within the context. e.g. + ``{=html}. + """ + +@dataclass(kw_only=True) +class TagResourceInput(_SerdeShape): + """Dataclass for TagResourceInput structure.""" + + resource_arn: str | None = ... + """ARN of a taggable resource""" + tags: list[Tag] | None = ... + """List of tags""" + +@dataclass(kw_only=True) +class TagResourceOutput(_SerdeShape): + """Dataclass for TagResourceOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ThrottlingException(ServiceError, _SerdeShape): + """This exception will be thrown when customer reached API TPS limit.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class TimestampSegment(_SerdeShape): + """Timestamp segment""" + + start_time_millis: int + """Start timestamp in milliseconds""" + end_time_millis: int + """End timestamp in milliseconds""" + +@dataclass(kw_only=True) +class UntagResourceInput(_SerdeShape): + """Dataclass for UntagResourceInput structure.""" + + resource_arn: str | None = ... + """ARN of a taggable resource""" + tag_keys: list[str] | None = ... + """List of tag keys""" + +@dataclass(kw_only=True) +class UntagResourceOutput(_SerdeShape): + """Dataclass for UntagResourceOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ValidationException(ServiceError, _SerdeShape): + """This exception will be thrown when customer provided invalid parameters.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class VideoAssetProcessingConfiguration(_SerdeShape): + """Video asset processing configuration""" + + segment_configuration: VideoSegmentConfiguration | None = ... + """Delimits the segment of the input that will be processed""" + +@dataclass +class VideoSegmentConfigurationTimestampSegment(_SerdeShape): + """Timestamp segment""" + + value: TimestampSegment + +@dataclass +class VideoSegmentConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +VideoSegmentConfiguration = Union[ + VideoSegmentConfigurationTimestampSegment | VideoSegmentConfigurationUnknown +] +"""Delimits the segment of the input that will be processed""" + +class _VideoSegmentConfigurationDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> VideoSegmentConfiguration: ... + +GET_DATA_AUTOMATION_STATUS: APIOperation[ + GetDataAutomationStatusInput, GetDataAutomationStatusOutput +] +INVOKE_DATA_AUTOMATION: APIOperation[ + InvokeDataAutomationInput, InvokeDataAutomationOutput +] +INVOKE_DATA_AUTOMATION_ASYNC: APIOperation[ + InvokeDataAutomationAsyncInput, InvokeDataAutomationAsyncOutput +] +LIST_TAGS_FOR_RESOURCE: APIOperation[ + ListTagsForResourceInput, ListTagsForResourceOutput +] +TAG_RESOURCE: APIOperation[TagResourceInput, TagResourceOutput] +UNTAG_RESOURCE: APIOperation[UntagResourceInput, UntagResourceOutput] diff --git a/clients/aws-sdk-bedrock-data-automation/scripts/docs/generate_doc_stubs.py b/clients/aws-sdk-bedrock-data-automation/scripts/docs/generate_doc_stubs.py index 52d470bc..795f2e4b 100644 --- a/clients/aws-sdk-bedrock-data-automation/scripts/docs/generate_doc_stubs.py +++ b/clients/aws-sdk-bedrock-data-automation/scripts/docs/generate_doc_stubs.py @@ -126,7 +126,9 @@ class ClientInfo: class DocStubGenerator: """Generate markdown API Reference stubs for AWS SDK for Python v4 clients.""" - def __init__(self, client_dir: Path, output_dir: Path, service_name: str | None = None) -> None: + def __init__( + self, client_dir: Path, output_dir: Path, service_name: str | None = None + ) -> None: """ Initialize the documentation generator. @@ -190,7 +192,9 @@ def _analyze_client_package(self, package_name: str) -> ClientInfo: required = ("client", "config", "models") missing = [name for name in required if not package.modules.get(name)] if missing: - raise ValueError(f"Missing required modules in {package_name}: {', '.join(missing)}") + raise ValueError( + f"Missing required modules in {package_name}: {', '.join(missing)}" + ) # Parse submodules client_module = package.modules["client"] @@ -199,11 +203,15 @@ def _analyze_client_package(self, package_name: str) -> ClientInfo: client_class = self._find_class_with_suffix(client_module, "Client") if not client_class: - raise ValueError(f"No class ending with 'Client' found in {package_name}.client") + raise ValueError( + f"No class ending with 'Client' found in {package_name}.client" + ) config_class = self._find_class_with_suffix(config_module, "Config") if not config_class: - raise ValueError(f"No class ending with 'Config' found in {package_name}.config") + raise ValueError( + f"No class ending with 'Config' found in {package_name}.config" + ) plugin_alias = config_module.members.get("Plugin") if not plugin_alias: @@ -288,7 +296,9 @@ def _analyze_operation(self, operation: Function) -> OperationInfo: if output_type in stream_type_map: stream_type = stream_type_map[output_type] - stream_args = self._get_subscript_elements(returns, f"'{operation.name}' stream type") + stream_args = self._get_subscript_elements( + returns, f"'{operation.name}' stream type" + ) if stream_type in (StreamType.INPUT, StreamType.DUPLEX): event_input_type = stream_args[0].canonical_name @@ -316,7 +326,9 @@ def _analyze_operation(self, operation: Function) -> OperationInfo: def _get_expr(self, annotation: str | Expr | None, context: str) -> Expr: """Extract and validate an Expr from an annotation.""" if not isinstance(annotation, Expr): - raise TypeError(f"{context}: expected Expr, got {type(annotation).__name__}") + raise TypeError( + f"{context}: expected Expr, got {type(annotation).__name__}" + ) return annotation def _get_subscript_elements(self, expr: Expr, context: str) -> list[Expr]: @@ -330,7 +342,9 @@ def _get_subscript_elements(self, expr: Expr, context: str) -> list[Expr]: return [el for el in slice_expr.elements if isinstance(el, Expr)] return [slice_expr] - def _extract_models(self, models_module: Module, operations: list[OperationInfo]) -> ModelsInfo: + def _extract_models( + self, models_module: Module, operations: list[OperationInfo] + ) -> ModelsInfo: """Extract structures, unions, enums, and errors from models module.""" structures, unions, enums, errors = [], [], [], [] @@ -356,14 +370,16 @@ def _extract_models(self, models_module: Module, operations: list[OperationInfo] duplicates = [] for structure in structures: - if self._is_operation_io_type(structure.name, operations) or self._is_union_member( - structure.name, unions - ): + if self._is_operation_io_type( + structure.name, operations + ) or self._is_union_member(structure.name, unions): duplicates.append(structure) structures = [struct for struct in structures if struct not in duplicates] - return ModelsInfo(structures=structures, unions=unions, enums=enums, errors=errors) + return ModelsInfo( + structures=structures, unions=unions, enums=enums, errors=errors + ) def _is_union(self, member: Object | Alias) -> TypeGuard[Attribute]: """Check if a module member is a union type.""" @@ -399,7 +415,9 @@ def _extract_union_members( for name in member_names: if not (member_object := models_module.members.get(name)): raise ValueError(f"Union member '{name}' not found in models module") - members.append(TypeInfo(name=member_object.name, module_path=member_object.path)) + members.append( + TypeInfo(name=member_object.name, module_path=member_object.path) + ) return members @@ -408,7 +426,8 @@ def _is_enum(self, member: Object | Alias) -> TypeGuard[Class]: if not isinstance(member, Class): return False return any( - isinstance(base, ExprName) and base.name in ENUM_BASE_CLASSES for base in member.bases + isinstance(base, ExprName) and base.name in ENUM_BASE_CLASSES + for base in member.bases ) def _is_error(self, member: Object | Alias) -> TypeGuard[Class]: @@ -416,10 +435,13 @@ def _is_error(self, member: Object | Alias) -> TypeGuard[Class]: if not isinstance(member, Class): return False return any( - isinstance(base, ExprName) and base.name in ERROR_BASE_CLASSES for base in member.bases + isinstance(base, ExprName) and base.name in ERROR_BASE_CLASSES + for base in member.bases ) - def _is_operation_io_type(self, type_name: str, operations: list[OperationInfo]) -> bool: + def _is_operation_io_type( + self, type_name: str, operations: list[OperationInfo] + ) -> bool: """Check if a type is used as operation input/output.""" return any(type_name in (op.input.name, op.output.name) for op in operations) @@ -437,8 +459,12 @@ def _generate_client_docs(self, client_info: ClientInfo) -> bool: self._generate_type_stubs( client_info.models.structures, "structures", "Structure Class" ) - self._generate_type_stubs(client_info.models.errors, "errors", "Error Class") - self._generate_type_stubs(client_info.models.enums, "enums", "Enum Class", members=True) + self._generate_type_stubs( + client_info.models.errors, "errors", "Error Class" + ) + self._generate_type_stubs( + client_info.models.enums, "enums", "Enum Class", members=True + ) self._generate_union_stubs(client_info.models.unions) except OSError as e: logger.error(f"Failed to write documentation files: {e}") @@ -470,7 +496,9 @@ def _generate_index(self, client_info: ClientInfo) -> None: ] for method in sorted(client_info.client_methods, key=lambda x: x.name): - lines.extend([*self._mkdocs_directive(method.module_path, heading_level=4), ""]) + lines.extend( + [*self._mkdocs_directive(method.module_path, heading_level=4), ""] + ) # Operations section if client_info.operations: @@ -578,7 +606,9 @@ def _generate_operation_stubs(self, operations: list[OperationInfo]) -> None: output_path = self.output_dir / "operations" / f"{op.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb("Operations", op.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb("Operations", op.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(operations)} operation file(s)") @@ -600,7 +630,9 @@ def _generate_type_stubs( output_path = self.output_dir / category / f"{item.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb(category.title(), item.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb(category.title(), item.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(items)} {category} file(s)") @@ -624,7 +656,9 @@ def _generate_union_stubs(self, unions: list[UnionInfo]) -> None: output_path = self.output_dir / "unions" / f"{union.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb("Unions", union.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb("Unions", union.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(unions)} union file(s)") diff --git a/clients/aws-sdk-bedrock-data-automation/src/aws_sdk_bedrock_data_automation/_private/schemas.py b/clients/aws-sdk-bedrock-data-automation/src/aws_sdk_bedrock_data_automation/_private/schemas.py index c936da19..4bb84e95 100644 --- a/clients/aws-sdk-bedrock-data-automation/src/aws_sdk_bedrock_data_automation/_private/schemas.py +++ b/clients/aws-sdk-bedrock-data-automation/src/aws_sdk_bedrock_data_automation/_private/schemas.py @@ -2,3317 +2,3387 @@ from types import MappingProxyType -from smithy_core.prelude import BOOLEAN, INTEGER, STRING, UNIT -from smithy_core.schemas import Schema -from smithy_core.shapes import ShapeID, ShapeType -from smithy_core.traits import Trait - - -NON_BLANK_STRING = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#NonBlankString"), - shape_type=ShapeType.STRING, -) - -ACCESS_DENIED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#AccessDeniedException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=403), - ], - members={"message": {"target": NON_BLANK_STRING}}, -) - -BLUEPRINT_OPTIMIZATION_INVOCATION_ARN = Schema( - id=ShapeID( - "com.amazonaws.bedrockdataautomation#BlueprintOptimizationInvocationArn" - ), - shape_type=ShapeType.STRING, -) - -GET_BLUEPRINT_OPTIMIZATION_STATUS_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockdataautomation#GetBlueprintOptimizationStatusInput" +from smithy_core._schema_compact import StaticOperationSchema, StaticSchema + + +n0 = "com.amazonaws.bedrockdataautomation" +_NBS = "NonBlankString" +_ADE = "AccessDeniedException" +_s = "smithy.api#error" +_c = "client" +_sE = "smithy.api#httpError" +_m = "message" +_BOIA = "BlueprintOptimizationInvocationArn" +_GBOSI = "GetBlueprintOptimizationStatusInput" +_sSI = "smithy.synthetic#originalShapeId" +_cGBOSR = "com.amazonaws.bedrockdataautomation#GetBlueprintOptimizationStatusRequest" +_sm = "smithy.api#input" +_iA = "invocationArn" +_smi = "smithy.api#required" +_sL = "smithy.api#httpLabel" +_SU = "S3Uri" +_SOV = "S3ObjectVersion" +_SO = "S3Object" +_sU = "s3Uri" +_v = "version" +_BOOC = "BlueprintOptimizationOutputConfiguration" +_sO = "s3Object" +_BOJS = "BlueprintOptimizationJobStatus" +_CREATED = "CREATED" +_sV = "smithy.api#enumValue" +_C = "Created" +_IP = "IN_PROGRESS" +_IPn = "InProgress" +_SUCCESS = "SUCCESS" +_S = "Success" +_SE = "SERVICE_ERROR" +_SEe = "ServiceError" +_CE = "CLIENT_ERROR" +_CEl = "ClientError" +_GBOSO = "GetBlueprintOptimizationStatusOutput" +_cGBOSRo = "com.amazonaws.bedrockdataautomation#GetBlueprintOptimizationStatusResponse" +_smit = "smithy.api#output" +_st = "status" +_eT = "errorType" +_eM = "errorMessage" +_oC = "outputConfiguration" +_ISE = "InternalServerException" +_se = "server" +_RNFE = "ResourceNotFoundException" +_TE = "ThrottlingException" +_VEF = "ValidationExceptionField" +_n = "name" +_VEFL = "ValidationExceptionFieldList" +_me = "member" +_VE = "ValidationException" +_fL = "fieldList" +_GBOS = "GetBlueprintOptimizationStatus" +_smith = "smithy.api#http" +_BA = "BlueprintArn" +_BS = "BlueprintStage" +_DEVELOPMENT = "DEVELOPMENT" +_LIVE = "LIVE" +_BOO = "BlueprintOptimizationObject" +_bA = "blueprintArn" +_sta = "stage" +_DAPA = "DataAutomationProfileArn" +_ECK = "EncryptionContextKey" +_ECV = "EncryptionContextValue" +_KEC = "KmsEncryptionContext" +_k = "key" +_va = "value" +_KKI = "KmsKeyId" +_EC = "EncryptionConfiguration" +_kKI = "kmsKeyId" +_kEC = "kmsEncryptionContext" +_BOS = "BlueprintOptimizationSample" +_aSO = "assetS3Object" +_gTSO = "groundTruthS3Object" +_BOSl = "BlueprintOptimizationSamples" +_TK = "TagKey" +_TV = "TagValue" +_T = "Tag" +_TL = "TagList" +_IBOAI = "InvokeBlueprintOptimizationAsyncInput" +_cIBOAR = "com.amazonaws.bedrockdataautomation#InvokeBlueprintOptimizationAsyncRequest" +_b = "blueprint" +_sa = "samples" +_dAPA = "dataAutomationProfileArn" +_eC = "encryptionConfiguration" +_t = "tags" +_IBOAO = "InvokeBlueprintOptimizationAsyncOutput" +_cIBOARo = ( + "com.amazonaws.bedrockdataautomation#InvokeBlueprintOptimizationAsyncResponse" +) +_SQEE = "ServiceQuotaExceededException" +_IBOA = "InvokeBlueprintOptimizationAsync" +_CEo = "ConflictException" +_BN = "BlueprintName" +_smithy = "smithy.api#sensitive" +_CT = "ClientToken" +_BSl = "BlueprintSchema" +_Ty = "Type" +_DOCUMENT = "DOCUMENT" +_IMAGE = "IMAGE" +_AUDIO = "AUDIO" +_VIDEO = "VIDEO" +_CBI = "CreateBlueprintInput" +_cCBR = "com.amazonaws.bedrockdataautomation#CreateBlueprintRequest" +_bN = "blueprintName" +_ty = "type" +_bS = "blueprintStage" +_sc = "schema" +_cT = "clientToken" +_sT = "smithy.api#idempotencyToken" +_BV = "BlueprintVersion" +_DT = "DateTimestamp" +_sF = "smithy.api#timestampFormat" +_dt = "date-time" +_B = "Blueprint" +_cTr = "creationTime" +_lMT = "lastModifiedTime" +_bV = "blueprintVersion" +_oS = "optimizationSamples" +_oT = "optimizationTime" +_CBO = "CreateBlueprintOutput" +_cCBRo = "com.amazonaws.bedrockdataautomation#CreateBlueprintResponse" +_CB = "CreateBlueprint" +_DBI = "DeleteBlueprintInput" +_cDBR = "com.amazonaws.bedrockdataautomation#DeleteBlueprintRequest" +_sQ = "smithy.api#httpQuery" +_DBO = "DeleteBlueprintOutput" +_cDBRo = "com.amazonaws.bedrockdataautomation#DeleteBlueprintResponse" +_DB = "DeleteBlueprint" +_GBI = "GetBlueprintInput" +_cGBR = "com.amazonaws.bedrockdataautomation#GetBlueprintRequest" +_GBO = "GetBlueprintOutput" +_cGBRo = "com.amazonaws.bedrockdataautomation#GetBlueprintResponse" +_GB = "GetBlueprint" +_BSF = "BlueprintStageFilter" +_ALL = "ALL" +_MR = "MaxResults" +_NT = "NextToken" +_DAPAa = "DataAutomationProjectArn" +_DAPS = "DataAutomationProjectStage" +_DAPF = "DataAutomationProjectFilter" +_pA = "projectArn" +_pS = "projectStage" +_RO = "ResourceOwner" +_SERVICE = "SERVICE" +_ACCOUNT = "ACCOUNT" +_LBI = "ListBlueprintsInput" +_cLBR = "com.amazonaws.bedrockdataautomation#ListBlueprintsRequest" +_rO = "resourceOwner" +_bSF = "blueprintStageFilter" +_mR = "maxResults" +_nT = "nextToken" +_pF = "projectFilter" +_BSlu = "BlueprintSummary" +_Bl = "Blueprints" +_LBO = "ListBlueprintsOutput" +_cLBRo = "com.amazonaws.bedrockdataautomation#ListBlueprintsResponse" +_bl = "blueprints" +_LB = "ListBlueprints" +_UBI = "UpdateBlueprintInput" +_cUBR = "com.amazonaws.bedrockdataautomation#UpdateBlueprintRequest" +_UBO = "UpdateBlueprintOutput" +_cUBRo = "com.amazonaws.bedrockdataautomation#UpdateBlueprintResponse" +_UB = "UpdateBlueprint" +_CBSI = "CopyBlueprintStageInput" +_cCBSR = "com.amazonaws.bedrockdataautomation#CopyBlueprintStageRequest" +_sS = "sourceStage" +_tS = "targetStage" +_CBSO = "CopyBlueprintStageOutput" +_cCBSRo = "com.amazonaws.bedrockdataautomation#CopyBlueprintStageResponse" +_CBS = "CopyBlueprintStage" +_CBVI = "CreateBlueprintVersionInput" +_cCBVR = "com.amazonaws.bedrockdataautomation#CreateBlueprintVersionRequest" +_CBVO = "CreateBlueprintVersionOutput" +_cCBVRo = "com.amazonaws.bedrockdataautomation#CreateBlueprintVersionResponse" +_CBV = "CreateBlueprintVersion" +_DALIJA = "DataAutomationLibraryIngestionJobArn" +_DALA = "DataAutomationLibraryArn" +_GDALIJI = "GetDataAutomationLibraryIngestionJobInput" +_cGDALIJR = ( + "com.amazonaws.bedrockdataautomation#GetDataAutomationLibraryIngestionJobRequest" +) +_lA = "libraryArn" +_jA = "jobArn" +_ET = "EntityType" +_VOCABULARY = "VOCABULARY" +_LIJS = "LibraryIngestionJobStatus" +_COMPLETED = "COMPLETED" +_CWE = "COMPLETED_WITH_ERRORS" +_FAILED = "FAILED" +_LIJOT = "LibraryIngestionJobOperationType" +_UPSERT = "UPSERT" +_DELETE = "DELETE" +_OC = "OutputConfiguration" +_DALIJ = "DataAutomationLibraryIngestionJob" +_eTn = "entityType" +_oTp = "operationType" +_jS = "jobStatus" +_cTo = "completionTime" +_GDALIJO = "GetDataAutomationLibraryIngestionJobOutput" +_cGDALIJRo = ( + "com.amazonaws.bedrockdataautomation#GetDataAutomationLibraryIngestionJobResponse" +) +_j = "job" +_GDALIJ = "GetDataAutomationLibraryIngestionJob" +_EI = "EntityId" +_EIL = "EntityIdList" +_DEI = "DeleteEntitiesInfo" +_eI = "entityIds" +_ED = "EntityDescription" +_L = "Language" +_EN = "EN" +_DE = "DE" +_ES = "ES" +_FR = "FR" +_IT = "IT" +_PT = "PT" +_JA = "JA" +_KO = "KO" +_CN = "CN" +_TW = "TW" +_HK = "HK" +_PDAT = "PhraseDisplayAsText" +_PTh = "PhraseText" +_P = "Phrase" +_te = "text" +_dAT = "displayAsText" +_PL = "PhraseList" +_VEI = "VocabularyEntityInfo" +_eIn = "entityId" +_d = "description" +_l = "language" +_p = "phrases" +_UEI = "UpsertEntityInfo" +_vo = "vocabulary" +_UEIp = "UpsertEntitiesInfo" +_IPnl = "InlinePayload" +_uEI = "upsertEntitiesInfo" +_dEI = "deleteEntitiesInfo" +_IC = "InputConfiguration" +_iP = "inlinePayload" +_EBC = "EventBridgeConfiguration" +_eBE = "eventBridgeEnabled" +_NC = "NotificationConfiguration" +_eBC = "eventBridgeConfiguration" +_IDALIJI = "InvokeDataAutomationLibraryIngestionJobInput" +_cIDALIJR = ( + "com.amazonaws.bedrockdataautomation#InvokeDataAutomationLibraryIngestionJobRequest" +) +_iC = "inputConfiguration" +_nC = "notificationConfiguration" +_IDALIJO = "InvokeDataAutomationLibraryIngestionJobOutput" +_cIDALIJRo = "com.amazonaws.bedrockdataautomation#InvokeDataAutomationLibraryIngestionJobResponse" +_IDALIJ = "InvokeDataAutomationLibraryIngestionJob" +_LDALIJI = "ListDataAutomationLibraryIngestionJobsInput" +_cLDALIJR = ( + "com.amazonaws.bedrockdataautomation#ListDataAutomationLibraryIngestionJobsRequest" +) +_DALIJS = "DataAutomationLibraryIngestionJobSummary" +_DALIJSa = "DataAutomationLibraryIngestionJobSummaries" +_LDALIJO = "ListDataAutomationLibraryIngestionJobsOutput" +_cLDALIJRo = ( + "com.amazonaws.bedrockdataautomation#ListDataAutomationLibraryIngestionJobsResponse" +) +_jo = "jobs" +_LDALIJ = "ListDataAutomationLibraryIngestionJobs" +_DALD = "DataAutomationLibraryDescription" +_DALN = "DataAutomationLibraryName" +_CDALI = "CreateDataAutomationLibraryInput" +_cCDALR = "com.amazonaws.bedrockdataautomation#CreateDataAutomationLibraryRequest" +_lN = "libraryName" +_lD = "libraryDescription" +_DALS = "DataAutomationLibraryStatus" +_ACTIVE = "ACTIVE" +_DELETING = "DELETING" +_CDALO = "CreateDataAutomationLibraryOutput" +_cCDALRo = "com.amazonaws.bedrockdataautomation#CreateDataAutomationLibraryResponse" +_CDAL = "CreateDataAutomationLibrary" +_DDALI = "DeleteDataAutomationLibraryInput" +_cDDALR = "com.amazonaws.bedrockdataautomation#DeleteDataAutomationLibraryRequest" +_DDALO = "DeleteDataAutomationLibraryOutput" +_cDDALRo = "com.amazonaws.bedrockdataautomation#DeleteDataAutomationLibraryResponse" +_DDAL = "DeleteDataAutomationLibrary" +_GDALI = "GetDataAutomationLibraryInput" +_cGDALR = "com.amazonaws.bedrockdataautomation#GetDataAutomationLibraryRequest" +_EM = "EntityMetadata" +_ETI = "EntityTypeInfo" +_eMn = "entityMetadata" +_ETIL = "EntityTypeInfoList" +_DAL = "DataAutomationLibrary" +_eTnt = "entityTypes" +_GDALO = "GetDataAutomationLibraryOutput" +_cGDALRo = "com.amazonaws.bedrockdataautomation#GetDataAutomationLibraryResponse" +_li = "library" +_GDAL = "GetDataAutomationLibrary" +_LDALI = "ListDataAutomationLibrariesInput" +_cLDALR = "com.amazonaws.bedrockdataautomation#ListDataAutomationLibrariesRequest" +_DALSa = "DataAutomationLibrarySummary" +_DALSat = "DataAutomationLibrarySummaries" +_LDALO = "ListDataAutomationLibrariesOutput" +_cLDALRo = "com.amazonaws.bedrockdataautomation#ListDataAutomationLibrariesResponse" +_lib = "libraries" +_LDAL = "ListDataAutomationLibraries" +_UDALI = "UpdateDataAutomationLibraryInput" +_cUDALR = "com.amazonaws.bedrockdataautomation#UpdateDataAutomationLibraryRequest" +_UDALO = "UpdateDataAutomationLibraryOutput" +_cUDALRo = "com.amazonaws.bedrockdataautomation#UpdateDataAutomationLibraryResponse" +_UDAL = "UpdateDataAutomationLibrary" +_BI = "BlueprintItem" +_BIl = "BlueprintItems" +_FBI = "FallbackBlueprintItems" +_DCOC = "DocumentCustomOutputConfiguration" +_fB = "fallbackBlueprints" +_COC = "CustomOutputConfiguration" +_do = "document" +_DALI = "DataAutomationLibraryItem" +_DALIa = "DataAutomationLibraryItems" +_DALC = "DataAutomationLibraryConfiguration" +_AGOL = "AudioGenerativeOutputLanguage" +_DEFAULT = "DEFAULT" +_AIL = "AudioInputLanguages" +_ALC = "AudioLanguageConfiguration" +_iL = "inputLanguages" +_gOL = "generativeOutputLanguage" +_iML = "identifyMultipleLanguages" +_St = "State" +_ENABLED = "ENABLED" +_DISABLED = "DISABLED" +_MPC = "ModalityProcessingConfiguration" +_stat = "state" +_SDDM = "SensitiveDataDetectionMode" +_DETECTION = "DETECTION" +_DAR = "DETECTION_AND_REDACTION" +_SDDST = "SensitiveDataDetectionScopeType" +_STANDARD = "STANDARD" +_CUSTOM = "CUSTOM" +_SDDS = "SensitiveDataDetectionScope" +_PIIET = "PIIEntityType" +_ADDRESS = "ADDRESS" +_AGE = "AGE" +_NAME = "NAME" +_EMAIL = "EMAIL" +_PHONE = "PHONE" +_USERNAME = "USERNAME" +_PASSWORD = "PASSWORD" +_DI = "DRIVER_ID" +_LP = "LICENSE_PLATE" +_VIN = "VEHICLE_IDENTIFICATION_NUMBER" +_CDCC = "CREDIT_DEBIT_CARD_CVV" +_CDCE = "CREDIT_DEBIT_CARD_EXPIRY" +_CDCN = "CREDIT_DEBIT_CARD_NUMBER" +_PIN = "PIN" +_IBAN = "INTERNATIONAL_BANK_ACCOUNT_NUMBER" +_SC = "SWIFT_CODE" +_IA = "IP_ADDRESS" +_MA = "MAC_ADDRESS" +_URL = "URL" +_AAK = "AWS_ACCESS_KEY" +_ASK = "AWS_SECRET_KEY" +_UBAN = "US_BANK_ACCOUNT_NUMBER" +_UBRN = "US_BANK_ROUTING_NUMBER" +_UITIN = "US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER" +_UPN = "US_PASSPORT_NUMBER" +_USSN = "US_SOCIAL_SECURITY_NUMBER" +_CHN = "CA_HEALTH_NUMBER" +_CSIN = "CA_SOCIAL_INSURANCE_NUMBER" +_UNHSN = "UK_NATIONAL_HEALTH_SERVICE_NUMBER" +_UNIN = "UK_NATIONAL_INSURANCE_NUMBER" +_UUTRN = "UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER" +_PIIETn = "PIIEntityTypes" +_PIIRMM = "PIIRedactionMaskMode" +_PII = "PII" +_ET_ = "ENTITY_TYPE" +_PIIEC = "PIIEntitiesConfiguration" +_pET = "piiEntityTypes" +_rMM = "redactionMaskMode" +_SDC = "SensitiveDataConfiguration" +_dM = "detectionMode" +_dS = "detectionScope" +_pEC = "piiEntitiesConfiguration" +_AOC = "AudioOverrideConfiguration" +_mP = "modalityProcessing" +_lC = "languageConfiguration" +_sDC = "sensitiveDataConfiguration" +_SCp = "SplitterConfiguration" +_DOC = "DocumentOverrideConfiguration" +_sp = "splitter" +_IOC = "ImageOverrideConfiguration" +_DM = "DesiredModality" +_MRC = "ModalityRoutingConfiguration" +_jp = "jpeg" +_pn = "png" +_mp = "mp4" +_mo = "mov" +_VOC = "VideoOverrideConfiguration" +_OCv = "OverrideConfiguration" +_i = "image" +_vi = "video" +_a = "audio" +_mRo = "modalityRouting" +_DAPD = "DataAutomationProjectDescription" +_DAPN = "DataAutomationProjectName" +_DAPT = "DataAutomationProjectType" +_ASYNC = "ASYNC" +_SYNC = "SYNC" +_CLC = "ChannelLabelingConfiguration" +_SLC = "SpeakerLabelingConfiguration" +_TC = "TranscriptConfiguration" +_sLp = "speakerLabeling" +_cL = "channelLabeling" +_AECTC = "AudioExtractionCategoryTypeConfiguration" +_tr = "transcript" +_AECT = "AudioExtractionCategoryType" +_ACM = "AUDIO_CONTENT_MODERATION" +_TRANSCRIPT = "TRANSCRIPT" +_TCM = "TOPIC_CONTENT_MODERATION" +_AECTu = "AudioExtractionCategoryTypes" +_AEC = "AudioExtractionCategory" +_typ = "types" +_tC = "typeConfiguration" +_ASE = "AudioStandardExtraction" +_ca = "category" +_ASGFT = "AudioStandardGenerativeFieldType" +_AS = "AUDIO_SUMMARY" +_IAB = "IAB" +_TS = "TOPIC_SUMMARY" +_ASGFTu = "AudioStandardGenerativeFieldTypes" +_ASGF = "AudioStandardGenerativeField" +_ASOC = "AudioStandardOutputConfiguration" +_e = "extraction" +_gF = "generativeField" +_DBB = "DocumentBoundingBox" +_DEGT = "DocumentExtractionGranularityType" +_PAGE = "PAGE" +_ELEMENT = "ELEMENT" +_WORD = "WORD" +_LINE = "LINE" +_DEGTo = "DocumentExtractionGranularityTypes" +_DEG = "DocumentExtractionGranularity" +_DSE = "DocumentStandardExtraction" +_g = "granularity" +_bB = "boundingBox" +_DSGF = "DocumentStandardGenerativeField" +_DOAFF = "DocumentOutputAdditionalFileFormat" +_DOTFT = "DocumentOutputTextFormatType" +_PT_ = "PLAIN_TEXT" +_MARKDOWN = "MARKDOWN" +_HTML = "HTML" +_CSV = "CSV" +_DOTFTo = "DocumentOutputTextFormatTypes" +_DOTF = "DocumentOutputTextFormat" +_DOF = "DocumentOutputFormat" +_tF = "textFormat" +_aFF = "additionalFileFormat" +_DSOC = "DocumentStandardOutputConfiguration" +_oF = "outputFormat" +_IBB = "ImageBoundingBox" +_IECT = "ImageExtractionCategoryType" +_CM = "CONTENT_MODERATION" +_TD = "TEXT_DETECTION" +_LOGOS = "LOGOS" +_IECTm = "ImageExtractionCategoryTypes" +_IEC = "ImageExtractionCategory" +_ISEm = "ImageStandardExtraction" +_ISGFT = "ImageStandardGenerativeFieldType" +_IS = "IMAGE_SUMMARY" +_ISGFTm = "ImageStandardGenerativeFieldTypes" +_ISGF = "ImageStandardGenerativeField" +_ISOC = "ImageStandardOutputConfiguration" +_VBB = "VideoBoundingBox" +_VECT = "VideoExtractionCategoryType" +_VECTi = "VideoExtractionCategoryTypes" +_VEC = "VideoExtractionCategory" +_VSE = "VideoStandardExtraction" +_VSGFT = "VideoStandardGenerativeFieldType" +_VS = "VIDEO_SUMMARY" +_CS = "CHAPTER_SUMMARY" +_VSGFTi = "VideoStandardGenerativeFieldTypes" +_VSGF = "VideoStandardGenerativeField" +_VSOC = "VideoStandardOutputConfiguration" +_SOC = "StandardOutputConfiguration" +_CDAPI = "CreateDataAutomationProjectInput" +_cCDAPR = "com.amazonaws.bedrockdataautomation#CreateDataAutomationProjectRequest" +_pN = "projectName" +_pD = "projectDescription" +_pT = "projectType" +_smithya = "smithy.api#default" +_sOC = "standardOutputConfiguration" +_cOC = "customOutputConfiguration" +_oCv = "overrideConfiguration" +_dALC = "dataAutomationLibraryConfiguration" +_DAPSa = "DataAutomationProjectStatus" +_CDAPO = "CreateDataAutomationProjectOutput" +_cCDAPRo = "com.amazonaws.bedrockdataautomation#CreateDataAutomationProjectResponse" +_CDAP = "CreateDataAutomationProject" +_DDAPI = "DeleteDataAutomationProjectInput" +_cDDAPR = "com.amazonaws.bedrockdataautomation#DeleteDataAutomationProjectRequest" +_DDAPO = "DeleteDataAutomationProjectOutput" +_cDDAPRo = "com.amazonaws.bedrockdataautomation#DeleteDataAutomationProjectResponse" +_DDAP = "DeleteDataAutomationProject" +_GDAPI = "GetDataAutomationProjectInput" +_cGDAPR = "com.amazonaws.bedrockdataautomation#GetDataAutomationProjectRequest" +_DAP = "DataAutomationProject" +_GDAPO = "GetDataAutomationProjectOutput" +_cGDAPRo = "com.amazonaws.bedrockdataautomation#GetDataAutomationProjectResponse" +_pr = "project" +_GDAP = "GetDataAutomationProject" +_BF = "BlueprintFilter" +_DALF = "DataAutomationLibraryFilter" +_DAPSF = "DataAutomationProjectStageFilter" +_LDAPI = "ListDataAutomationProjectsInput" +_cLDAPR = "com.amazonaws.bedrockdataautomation#ListDataAutomationProjectsRequest" +_pSF = "projectStageFilter" +_bF = "blueprintFilter" +_lF = "libraryFilter" +_DAPSat = "DataAutomationProjectSummary" +_DAPSata = "DataAutomationProjectSummaries" +_LDAPO = "ListDataAutomationProjectsOutput" +_cLDAPRo = "com.amazonaws.bedrockdataautomation#ListDataAutomationProjectsResponse" +_pro = "projects" +_LDAP = "ListDataAutomationProjects" +_UDAPI = "UpdateDataAutomationProjectInput" +_cUDAPR = "com.amazonaws.bedrockdataautomation#UpdateDataAutomationProjectRequest" +_UDAPO = "UpdateDataAutomationProjectOutput" +_cUDAPRo = "com.amazonaws.bedrockdataautomation#UpdateDataAutomationProjectResponse" +_UDAP = "UpdateDataAutomationProject" +_GDALEI = "GetDataAutomationLibraryEntityInput" +_cGDALER = "com.amazonaws.bedrockdataautomation#GetDataAutomationLibraryEntityRequest" +_VEo = "VocabularyEntity" +_EDn = "EntityDetails" +_GDALEO = "GetDataAutomationLibraryEntityOutput" +_cGDALERo = "com.amazonaws.bedrockdataautomation#GetDataAutomationLibraryEntityResponse" +_en = "entity" +_GDALE = "GetDataAutomationLibraryEntity" +_LDALEI = "ListDataAutomationLibraryEntitiesInput" +_cLDALER = ( + "com.amazonaws.bedrockdataautomation#ListDataAutomationLibraryEntitiesRequest" +) +_VES = "VocabularyEntitySummary" +_nOP = "numOfPhrases" +_DALES = "DataAutomationLibraryEntitySummary" +_DALESa = "DataAutomationLibraryEntitySummaries" +_LDALEO = "ListDataAutomationLibraryEntitiesOutput" +_cLDALERo = ( + "com.amazonaws.bedrockdataautomation#ListDataAutomationLibraryEntitiesResponse" +) +_ent = "entities" +_LDALE = "ListDataAutomationLibraryEntities" +_TRA = "TaggableResourceArn" +_LTFRI = "ListTagsForResourceInput" +_cLTFRR = "com.amazonaws.bedrockdataautomation#ListTagsForResourceRequest" +_rARN = "resourceARN" +_LTFRO = "ListTagsForResourceOutput" +_cLTFRRo = "com.amazonaws.bedrockdataautomation#ListTagsForResourceResponse" +_LTFR = "ListTagsForResource" +_TRI = "TagResourceInput" +_cTRR = "com.amazonaws.bedrockdataautomation#TagResourceRequest" +_TRO = "TagResourceOutput" +_cTRRo = "com.amazonaws.bedrockdataautomation#TagResourceResponse" +_TR = "TagResource" +_TKL = "TagKeyList" +_URI = "UntagResourceInput" +_cURR = "com.amazonaws.bedrockdataautomation#UntagResourceRequest" +_tK = "tagKeys" +_URO = "UntagResourceOutput" +_cURRo = "com.amazonaws.bedrockdataautomation#UntagResourceResponse" +_UR = "UntagResource" +_ABKBTS = "AmazonBedrockKeystoneBuildTimeService" +_aw = "aws.auth#sigv4" +_sB = "smithy.rules#endpointBdd" +_aws = "aws.api#service" +_aJ = "aws.protocols#restJson1" + +NON_BLANK_STRING: StaticSchema = (3, n0, _NBS, 0) + +ACCESS_DENIED_EXCEPTION: StaticSchema = ( + 18, + n0, + _ADE, + {_s: _c, _sE: 403}, + (_m,), + ((NON_BLANK_STRING, 0),), +) + +BLUEPRINT_OPTIMIZATION_INVOCATION_ARN: StaticSchema = (3, n0, _BOIA, 0) + +GET_BLUEPRINT_OPTIMIZATION_STATUS_INPUT: StaticSchema = ( + 18, + n0, + _GBOSI, + {_sSI: _cGBOSR, _sm: None}, + (_iA,), + ((BLUEPRINT_OPTIMIZATION_INVOCATION_ARN, 9),), +) + +S3_URI: StaticSchema = (3, n0, _SU, 0) + +S3_OBJECT_VERSION: StaticSchema = (3, n0, _SOV, 0) + +S3_OBJECT: StaticSchema = ( + 18, + n0, + _SO, + 0, + (_sU, _v), + ((S3_URI, 1), (S3_OBJECT_VERSION, 0)), +) + +BLUEPRINT_OPTIMIZATION_OUTPUT_CONFIGURATION: StaticSchema = ( + 18, + n0, + _BOOC, + 0, + (_sO,), + ((S3_OBJECT, 1),), +) + +BLUEPRINT_OPTIMIZATION_JOB_STATUS: StaticSchema = ( + 14, + n0, + _BOJS, + 0, + (_CREATED, _IP, _SUCCESS, _SE, _CE), + ( + (-1, {_sV: _C}), + (-1, {_sV: _IPn}), + (-1, {_sV: _S}), + (-1, {_sV: _SEe}), + (-1, {_sV: _CEl}), ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#GetBlueprintOptimizationStatusRequest", - ) - ], - members={ - "invocationArn": { - "target": BLUEPRINT_OPTIMIZATION_INVOCATION_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -S3_URI = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#S3Uri"), shape_type=ShapeType.STRING -) - -S3_OBJECT_VERSION = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#S3ObjectVersion"), - shape_type=ShapeType.STRING, -) - -S3_OBJECT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#S3Object"), - members={ - "s3Uri": { - "target": S3_URI, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "version": {"target": S3_OBJECT_VERSION}, - }, ) -BLUEPRINT_OPTIMIZATION_OUTPUT_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockdataautomation#BlueprintOptimizationOutputConfiguration" +GET_BLUEPRINT_OPTIMIZATION_STATUS_OUTPUT: StaticSchema = ( + 18, + n0, + _GBOSO, + {_sSI: _cGBOSRo, _smit: None}, + (_st, _eT, _eM, _oC), + ( + (BLUEPRINT_OPTIMIZATION_JOB_STATUS, 0), + (3, 0), + (3, 0), + (BLUEPRINT_OPTIMIZATION_OUTPUT_CONFIGURATION, 0), ), - members={ - "s3Object": { - "target": S3_OBJECT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -BLUEPRINT_OPTIMIZATION_JOB_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#BlueprintOptimizationJobStatus"), - shape_type=ShapeType.ENUM, - members={ - "CREATED": {"target": UNIT}, - "IN_PROGRESS": {"target": UNIT}, - "SUCCESS": {"target": UNIT}, - "SERVICE_ERROR": {"target": UNIT}, - "CLIENT_ERROR": {"target": UNIT}, - }, ) -GET_BLUEPRINT_OPTIMIZATION_STATUS_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockdataautomation#GetBlueprintOptimizationStatusOutput" +INTERNAL_SERVER_EXCEPTION: StaticSchema = ( + 18, + n0, + _ISE, + {_s: _se, _sE: 500}, + (_m,), + ((NON_BLANK_STRING, 0),), +) + +RESOURCE_NOT_FOUND_EXCEPTION: StaticSchema = ( + 18, + n0, + _RNFE, + {_s: _c, _sE: 404}, + (_m,), + ((NON_BLANK_STRING, 0),), +) + +THROTTLING_EXCEPTION: StaticSchema = ( + 18, + n0, + _TE, + {_s: _c, _sE: 429}, + (_m,), + ((NON_BLANK_STRING, 0),), +) + +VALIDATION_EXCEPTION_FIELD: StaticSchema = ( + 18, + n0, + _VEF, + 0, + (_n, _m), + ((NON_BLANK_STRING, 1), (NON_BLANK_STRING, 1)), +) + +VALIDATION_EXCEPTION_FIELD_LIST: StaticSchema = ( + 16, + n0, + _VEFL, + 0, + (_me,), + ((VALIDATION_EXCEPTION_FIELD, 0),), +) + +VALIDATION_EXCEPTION: StaticSchema = ( + 18, + n0, + _VE, + {_s: _c, _sE: 400}, + (_m, _fL), + ((NON_BLANK_STRING, 0), (VALIDATION_EXCEPTION_FIELD_LIST, 0)), +) + +GET_BLUEPRINT_OPTIMIZATION_STATUS: StaticOperationSchema = ( + 23, + n0, + _GBOS, + { + _smith: MappingProxyType( + { + "code": 200, + "method": "POST", + "uri": "/getBlueprintOptimizationStatus/{invocationArn}", + } + ) + }, + GET_BLUEPRINT_OPTIMIZATION_STATUS_INPUT, + GET_BLUEPRINT_OPTIMIZATION_STATUS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#GetBlueprintOptimizationStatusResponse", - ) - ], - members={ - "status": {"target": BLUEPRINT_OPTIMIZATION_JOB_STATUS}, - "errorType": {"target": STRING}, - "errorMessage": {"target": STRING}, - "outputConfiguration": {"target": BLUEPRINT_OPTIMIZATION_OUTPUT_CONFIGURATION}, - }, -) - -INTERNAL_SERVER_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#InternalServerException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="server"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=500), - ], - members={"message": {"target": NON_BLANK_STRING}}, -) - -RESOURCE_NOT_FOUND_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#ResourceNotFoundException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=404), - ], - members={"message": {"target": NON_BLANK_STRING}}, -) - -THROTTLING_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#ThrottlingException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=429), - ], - members={"message": {"target": NON_BLANK_STRING}}, -) - -VALIDATION_EXCEPTION_FIELD = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#ValidationExceptionField"), - members={ - "name": { - "target": NON_BLANK_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "message": { - "target": NON_BLANK_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -VALIDATION_EXCEPTION_FIELD_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#ValidationExceptionFieldList"), - shape_type=ShapeType.LIST, - members={"member": {"target": VALIDATION_EXCEPTION_FIELD}}, -) - -VALIDATION_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#ValidationException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={ - "message": {"target": NON_BLANK_STRING}, - "fieldList": {"target": VALIDATION_EXCEPTION_FIELD_LIST}, - }, ) -GET_BLUEPRINT_OPTIMIZATION_STATUS = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#GetBlueprintOptimizationStatus"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "POST", - "uri": "/getBlueprintOptimizationStatus/{invocationArn}", - } - ), - ) - ], -) - -BLUEPRINT_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#BlueprintArn"), - shape_type=ShapeType.STRING, -) +BLUEPRINT_ARN: StaticSchema = (3, n0, _BA, 0) -BLUEPRINT_STAGE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#BlueprintStage"), - shape_type=ShapeType.ENUM, - members={"DEVELOPMENT": {"target": UNIT}, "LIVE": {"target": UNIT}}, +BLUEPRINT_STAGE: StaticSchema = ( + 14, + n0, + _BS, + 0, + (_DEVELOPMENT, _LIVE), + ((-1, {_sV: _DEVELOPMENT}), (-1, {_sV: _LIVE})), ) -BLUEPRINT_OPTIMIZATION_OBJECT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#BlueprintOptimizationObject"), - members={ - "blueprintArn": { - "target": BLUEPRINT_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "stage": {"target": BLUEPRINT_STAGE}, - }, +BLUEPRINT_OPTIMIZATION_OBJECT: StaticSchema = ( + 18, + n0, + _BOO, + 0, + (_bA, _sta), + ((BLUEPRINT_ARN, 1), (BLUEPRINT_STAGE, 0)), ) -DATA_AUTOMATION_PROFILE_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#DataAutomationProfileArn"), - shape_type=ShapeType.STRING, -) +DATA_AUTOMATION_PROFILE_ARN: StaticSchema = (3, n0, _DAPA, 0) -ENCRYPTION_CONTEXT_KEY = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#EncryptionContextKey"), - shape_type=ShapeType.STRING, -) +ENCRYPTION_CONTEXT_KEY: StaticSchema = (3, n0, _ECK, 0) -ENCRYPTION_CONTEXT_VALUE = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#EncryptionContextValue"), - shape_type=ShapeType.STRING, -) +ENCRYPTION_CONTEXT_VALUE: StaticSchema = (3, n0, _ECV, 0) -KMS_ENCRYPTION_CONTEXT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#KmsEncryptionContext"), - shape_type=ShapeType.MAP, - members={ - "key": {"target": ENCRYPTION_CONTEXT_KEY}, - "value": {"target": ENCRYPTION_CONTEXT_VALUE}, - }, +KMS_ENCRYPTION_CONTEXT: StaticSchema = ( + 17, + n0, + _KEC, + 0, + (_k, _va), + ((ENCRYPTION_CONTEXT_KEY, 0), (ENCRYPTION_CONTEXT_VALUE, 0)), ) -KMS_KEY_ID = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#KmsKeyId"), - shape_type=ShapeType.STRING, -) +KMS_KEY_ID: StaticSchema = (3, n0, _KKI, 0) -ENCRYPTION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#EncryptionConfiguration"), - members={ - "kmsKeyId": { - "target": KMS_KEY_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "kmsEncryptionContext": {"target": KMS_ENCRYPTION_CONTEXT}, - }, +ENCRYPTION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _EC, + 0, + (_kKI, _kEC), + ((KMS_KEY_ID, 1), (KMS_ENCRYPTION_CONTEXT, 0)), ) -BLUEPRINT_OPTIMIZATION_SAMPLE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#BlueprintOptimizationSample"), - members={ - "assetS3Object": { - "target": S3_OBJECT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "groundTruthS3Object": { - "target": S3_OBJECT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +BLUEPRINT_OPTIMIZATION_SAMPLE: StaticSchema = ( + 18, + n0, + _BOS, + 0, + (_aSO, _gTSO), + ((S3_OBJECT, 1), (S3_OBJECT, 1)), ) -BLUEPRINT_OPTIMIZATION_SAMPLES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#BlueprintOptimizationSamples"), - shape_type=ShapeType.LIST, - members={"member": {"target": BLUEPRINT_OPTIMIZATION_SAMPLE}}, +BLUEPRINT_OPTIMIZATION_SAMPLES: StaticSchema = ( + 16, + n0, + _BOSl, + 0, + (_me,), + ((BLUEPRINT_OPTIMIZATION_SAMPLE, 0),), ) -TAG_KEY = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#TagKey"), - shape_type=ShapeType.STRING, -) +TAG_KEY: StaticSchema = (3, n0, _TK, 0) -TAG_VALUE = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#TagValue"), - shape_type=ShapeType.STRING, -) +TAG_VALUE: StaticSchema = (3, n0, _TV, 0) -TAG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#Tag"), - members={ - "key": { - "target": TAG_KEY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "value": { - "target": TAG_VALUE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +TAG: StaticSchema = (18, n0, _T, 0, (_k, _va), ((TAG_KEY, 1), (TAG_VALUE, 1))) -TAG_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#TagList"), - shape_type=ShapeType.LIST, - members={"member": {"target": TAG}}, -) +TAG_LIST: StaticSchema = (16, n0, _TL, 0, (_me,), ((TAG, 0),)) -INVOKE_BLUEPRINT_OPTIMIZATION_ASYNC_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockdataautomation#InvokeBlueprintOptimizationAsyncInput" +INVOKE_BLUEPRINT_OPTIMIZATION_ASYNC_INPUT: StaticSchema = ( + 18, + n0, + _IBOAI, + {_sSI: _cIBOAR, _sm: None}, + (_b, _sa, _oC, _dAPA, _eC, _t), + ( + (BLUEPRINT_OPTIMIZATION_OBJECT, 1), + (BLUEPRINT_OPTIMIZATION_SAMPLES, 1), + (BLUEPRINT_OPTIMIZATION_OUTPUT_CONFIGURATION, 1), + (DATA_AUTOMATION_PROFILE_ARN, 1), + (ENCRYPTION_CONFIGURATION, 0), + (TAG_LIST, 0), ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#InvokeBlueprintOptimizationAsyncRequest", - ) - ], - members={ - "blueprint": { - "target": BLUEPRINT_OPTIMIZATION_OBJECT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "samples": { - "target": BLUEPRINT_OPTIMIZATION_SAMPLES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "outputConfiguration": { - "target": BLUEPRINT_OPTIMIZATION_OUTPUT_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "dataAutomationProfileArn": { - "target": DATA_AUTOMATION_PROFILE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "encryptionConfiguration": {"target": ENCRYPTION_CONFIGURATION}, - "tags": {"target": TAG_LIST}, - }, ) -INVOKE_BLUEPRINT_OPTIMIZATION_ASYNC_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockdataautomation#InvokeBlueprintOptimizationAsyncOutput" +INVOKE_BLUEPRINT_OPTIMIZATION_ASYNC_OUTPUT: StaticSchema = ( + 18, + n0, + _IBOAO, + {_sSI: _cIBOARo, _smit: None}, + (_iA,), + ((BLUEPRINT_OPTIMIZATION_INVOCATION_ARN, 1),), +) + +SERVICE_QUOTA_EXCEEDED_EXCEPTION: StaticSchema = ( + 18, + n0, + _SQEE, + {_s: _c, _sE: 402}, + (_m,), + ((NON_BLANK_STRING, 0),), +) + +INVOKE_BLUEPRINT_OPTIMIZATION_ASYNC: StaticOperationSchema = ( + 23, + n0, + _IBOA, + { + _smith: MappingProxyType( + {"code": 200, "method": "POST", "uri": "/invokeBlueprintOptimizationAsync"} + ) + }, + INVOKE_BLUEPRINT_OPTIMIZATION_ASYNC_INPUT, + INVOKE_BLUEPRINT_OPTIMIZATION_ASYNC_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#InvokeBlueprintOptimizationAsyncResponse", - ) - ], - members={ - "invocationArn": { - "target": BLUEPRINT_OPTIMIZATION_INVOCATION_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -SERVICE_QUOTA_EXCEEDED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#ServiceQuotaExceededException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=402), - ], - members={"message": {"target": NON_BLANK_STRING}}, -) - -INVOKE_BLUEPRINT_OPTIMIZATION_ASYNC = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#InvokeBlueprintOptimizationAsync"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "POST", - "uri": "/invokeBlueprintOptimizationAsync", - } - ), - ) - ], ) -CONFLICT_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#ConflictException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=409), - ], - members={"message": {"target": NON_BLANK_STRING}}, +CONFLICT_EXCEPTION: StaticSchema = ( + 18, + n0, + _CEo, + {_s: _c, _sE: 409}, + (_m,), + ((NON_BLANK_STRING, 0),), ) -BLUEPRINT_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#BlueprintName"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -CLIENT_TOKEN = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#ClientToken"), - shape_type=ShapeType.STRING, -) +BLUEPRINT_NAME: StaticSchema = (3, n0, _BN, 4) -BLUEPRINT_SCHEMA = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#BlueprintSchema"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) +CLIENT_TOKEN: StaticSchema = (3, n0, _CT, 0) -TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#Type"), - shape_type=ShapeType.ENUM, - members={ - "DOCUMENT": {"target": UNIT}, - "IMAGE": {"target": UNIT}, - "AUDIO": {"target": UNIT}, - "VIDEO": {"target": UNIT}, - }, -) +BLUEPRINT_SCHEMA: StaticSchema = (3, n0, _BSl, 4) -CREATE_BLUEPRINT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#CreateBlueprintInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#CreateBlueprintRequest", - ) - ], - members={ - "blueprintName": { - "target": BLUEPRINT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "type": { - "target": TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "blueprintStage": {"target": BLUEPRINT_STAGE}, - "schema": { - "target": BLUEPRINT_SCHEMA, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "encryptionConfiguration": {"target": ENCRYPTION_CONFIGURATION}, - "tags": {"target": TAG_LIST}, - }, +TYPE: StaticSchema = ( + 14, + n0, + _Ty, + 0, + (_DOCUMENT, _IMAGE, _AUDIO, _VIDEO), + ( + (-1, {_sV: _DOCUMENT}), + (-1, {_sV: _IMAGE}), + (-1, {_sV: _AUDIO}), + (-1, {_sV: _VIDEO}), + ), ) -BLUEPRINT_VERSION = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#BlueprintVersion"), - shape_type=ShapeType.STRING, -) - -DATE_TIMESTAMP = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#DateTimestamp"), - shape_type=ShapeType.TIMESTAMP, - traits=[Trait.new(id=ShapeID("smithy.api#timestampFormat"), value="date-time")], -) - -BLUEPRINT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#Blueprint"), - members={ - "blueprintArn": { - "target": BLUEPRINT_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "schema": { - "target": BLUEPRINT_SCHEMA, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "type": { - "target": TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "creationTime": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastModifiedTime": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "blueprintName": { - "target": BLUEPRINT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "blueprintVersion": {"target": BLUEPRINT_VERSION}, - "blueprintStage": {"target": BLUEPRINT_STAGE}, - "kmsKeyId": {"target": KMS_KEY_ID}, - "kmsEncryptionContext": {"target": KMS_ENCRYPTION_CONTEXT}, - "optimizationSamples": {"target": BLUEPRINT_OPTIMIZATION_SAMPLES}, - "optimizationTime": {"target": DATE_TIMESTAMP}, - }, +CREATE_BLUEPRINT_INPUT: StaticSchema = ( + 18, + n0, + _CBI, + {_sSI: _cCBR, _sm: None}, + (_bN, _ty, _bS, _sc, _cT, _eC, _t), + ( + (BLUEPRINT_NAME, 1), + (TYPE, 1), + (BLUEPRINT_STAGE, 0), + (BLUEPRINT_SCHEMA, 1), + (CLIENT_TOKEN, 2), + (ENCRYPTION_CONFIGURATION, 0), + (TAG_LIST, 0), + ), ) -CREATE_BLUEPRINT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#CreateBlueprintOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#CreateBlueprintResponse", - ) - ], - members={ - "blueprint": { - "target": BLUEPRINT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +BLUEPRINT_VERSION: StaticSchema = (3, n0, _BV, 0) + +DATE_TIMESTAMP: StaticSchema = (4, n0, _DT, {_sF: _dt}) + +BLUEPRINT: StaticSchema = ( + 18, + n0, + _B, + 0, + (_bA, _sc, _ty, _cTr, _lMT, _bN, _bV, _bS, _kKI, _kEC, _oS, _oT), + ( + (BLUEPRINT_ARN, 1), + (BLUEPRINT_SCHEMA, 1), + (TYPE, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (BLUEPRINT_NAME, 1), + (BLUEPRINT_VERSION, 0), + (BLUEPRINT_STAGE, 0), + (KMS_KEY_ID, 0), + (KMS_ENCRYPTION_CONTEXT, 0), + (BLUEPRINT_OPTIMIZATION_SAMPLES, 0), + (DATE_TIMESTAMP, 0), + ), ) -CREATE_BLUEPRINT = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#CreateBlueprint"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 201, "method": "PUT", "uri": "/blueprints/"} - ), - ) - ], +CREATE_BLUEPRINT_OUTPUT: StaticSchema = ( + 18, + n0, + _CBO, + {_sSI: _cCBRo, _smit: None}, + (_b,), + ((BLUEPRINT, 1),), +) + +CREATE_BLUEPRINT: StaticOperationSchema = ( + 23, + n0, + _CB, + {_smith: MappingProxyType({"code": 201, "method": "PUT", "uri": "/blueprints/"})}, + CREATE_BLUEPRINT_INPUT, + CREATE_BLUEPRINT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -DELETE_BLUEPRINT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#DeleteBlueprintInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#DeleteBlueprintRequest", - ) - ], - members={ - "blueprintArn": { - "target": BLUEPRINT_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "blueprintVersion": { - "target": BLUEPRINT_VERSION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="blueprintVersion") - ], - }, - }, +DELETE_BLUEPRINT_INPUT: StaticSchema = ( + 18, + n0, + _DBI, + {_sSI: _cDBR, _sm: None}, + (_bA, _bV), + ((BLUEPRINT_ARN, 9), (BLUEPRINT_VERSION, {_sQ: _bV})), ) -DELETE_BLUEPRINT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#DeleteBlueprintOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#DeleteBlueprintResponse", - ) - ], -) - -DELETE_BLUEPRINT = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#DeleteBlueprint"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "DELETE", "uri": "/blueprints/{blueprintArn}/"} - ), - ) - ], -) +DELETE_BLUEPRINT_OUTPUT: StaticSchema = (18, n0, _DBO, {_sSI: _cDBRo, _smit: None}) -GET_BLUEPRINT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#GetBlueprintInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#GetBlueprintRequest", +DELETE_BLUEPRINT: StaticOperationSchema = ( + 23, + n0, + _DB, + { + _smith: MappingProxyType( + {"code": 200, "method": "DELETE", "uri": "/blueprints/{blueprintArn}/"} ) - ], - members={ - "blueprintArn": { - "target": BLUEPRINT_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "blueprintVersion": {"target": BLUEPRINT_VERSION}, - "blueprintStage": {"target": BLUEPRINT_STAGE}, }, + DELETE_BLUEPRINT_INPUT, + DELETE_BLUEPRINT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -GET_BLUEPRINT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#GetBlueprintOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#GetBlueprintResponse", - ) - ], - members={ - "blueprint": { - "target": BLUEPRINT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +GET_BLUEPRINT_INPUT: StaticSchema = ( + 18, + n0, + _GBI, + {_sSI: _cGBR, _sm: None}, + (_bA, _bV, _bS), + ((BLUEPRINT_ARN, 9), (BLUEPRINT_VERSION, 0), (BLUEPRINT_STAGE, 0)), +) + +GET_BLUEPRINT_OUTPUT: StaticSchema = ( + 18, + n0, + _GBO, + {_sSI: _cGBRo, _smit: None}, + (_b,), + ((BLUEPRINT, 1),), +) + +GET_BLUEPRINT: StaticOperationSchema = ( + 23, + n0, + _GB, + { + _smith: MappingProxyType( + {"code": 200, "method": "POST", "uri": "/blueprints/{blueprintArn}/"} + ) + }, + GET_BLUEPRINT_INPUT, + GET_BLUEPRINT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -GET_BLUEPRINT = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#GetBlueprint"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "POST", "uri": "/blueprints/{blueprintArn}/"} - ), - ) - ], +BLUEPRINT_STAGE_FILTER: StaticSchema = ( + 14, + n0, + _BSF, + 0, + (_DEVELOPMENT, _LIVE, _ALL), + ((-1, {_sV: _DEVELOPMENT}), (-1, {_sV: _LIVE}), (-1, {_sV: _ALL})), +) + +MAX_RESULTS: StaticSchema = (7, n0, _MR, 0) + +NEXT_TOKEN: StaticSchema = (3, n0, _NT, 0) + +DATA_AUTOMATION_PROJECT_ARN: StaticSchema = (3, n0, _DAPAa, 0) + +DATA_AUTOMATION_PROJECT_STAGE: StaticSchema = ( + 14, + n0, + _DAPS, + 0, + (_DEVELOPMENT, _LIVE), + ((-1, {_sV: _DEVELOPMENT}), (-1, {_sV: _LIVE})), +) + +DATA_AUTOMATION_PROJECT_FILTER: StaticSchema = ( + 18, + n0, + _DAPF, + 0, + (_pA, _pS), + ((DATA_AUTOMATION_PROJECT_ARN, 1), (DATA_AUTOMATION_PROJECT_STAGE, 0)), +) + +RESOURCE_OWNER: StaticSchema = ( + 14, + n0, + _RO, + 0, + (_SERVICE, _ACCOUNT), + ((-1, {_sV: _SERVICE}), (-1, {_sV: _ACCOUNT})), +) + +LIST_BLUEPRINTS_INPUT: StaticSchema = ( + 18, + n0, + _LBI, + {_sSI: _cLBR, _sm: None}, + (_bA, _rO, _bSF, _mR, _nT, _pF), + ( + (BLUEPRINT_ARN, 0), + (RESOURCE_OWNER, 0), + (BLUEPRINT_STAGE_FILTER, 0), + (MAX_RESULTS, 0), + (NEXT_TOKEN, 0), + (DATA_AUTOMATION_PROJECT_FILTER, 0), + ), ) -BLUEPRINT_STAGE_FILTER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#BlueprintStageFilter"), - shape_type=ShapeType.ENUM, - members={ - "DEVELOPMENT": {"target": UNIT}, - "LIVE": {"target": UNIT}, - "ALL": {"target": UNIT}, - }, +BLUEPRINT_SUMMARY: StaticSchema = ( + 18, + n0, + _BSlu, + 0, + (_bA, _bV, _bS, _bN, _cTr, _lMT), + ( + (BLUEPRINT_ARN, 1), + (BLUEPRINT_VERSION, 0), + (BLUEPRINT_STAGE, 0), + (BLUEPRINT_NAME, 0), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 0), + ), ) -MAX_RESULTS = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#MaxResults"), - shape_type=ShapeType.INTEGER, +BLUEPRINTS: StaticSchema = (16, n0, _Bl, 0, (_me,), ((BLUEPRINT_SUMMARY, 0),)) + +LIST_BLUEPRINTS_OUTPUT: StaticSchema = ( + 18, + n0, + _LBO, + {_sSI: _cLBRo, _smit: None}, + (_bl, _nT), + ((BLUEPRINTS, 1), (NEXT_TOKEN, 0)), +) + +LIST_BLUEPRINTS: StaticOperationSchema = ( + 23, + n0, + _LB, + {_smith: MappingProxyType({"code": 200, "method": "POST", "uri": "/blueprints/"})}, + LIST_BLUEPRINTS_INPUT, + LIST_BLUEPRINTS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -NEXT_TOKEN = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#NextToken"), - shape_type=ShapeType.STRING, +UPDATE_BLUEPRINT_INPUT: StaticSchema = ( + 18, + n0, + _UBI, + {_sSI: _cUBR, _sm: None}, + (_bA, _sc, _bS, _eC), + ( + (BLUEPRINT_ARN, 9), + (BLUEPRINT_SCHEMA, 1), + (BLUEPRINT_STAGE, 0), + (ENCRYPTION_CONFIGURATION, 0), + ), ) -DATA_AUTOMATION_PROJECT_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#DataAutomationProjectArn"), - shape_type=ShapeType.STRING, +UPDATE_BLUEPRINT_OUTPUT: StaticSchema = ( + 18, + n0, + _UBO, + {_sSI: _cUBRo, _smit: None}, + (_b,), + ((BLUEPRINT, 1),), +) + +UPDATE_BLUEPRINT: StaticOperationSchema = ( + 23, + n0, + _UB, + { + _smith: MappingProxyType( + {"code": 200, "method": "PUT", "uri": "/blueprints/{blueprintArn}/"} + ) + }, + UPDATE_BLUEPRINT_INPUT, + UPDATE_BLUEPRINT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -DATA_AUTOMATION_PROJECT_STAGE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#DataAutomationProjectStage"), - shape_type=ShapeType.ENUM, - members={"DEVELOPMENT": {"target": UNIT}, "LIVE": {"target": UNIT}}, +COPY_BLUEPRINT_STAGE_INPUT: StaticSchema = ( + 18, + n0, + _CBSI, + {_sSI: _cCBSR, _sm: None}, + (_bA, _sS, _tS, _cT), + ((BLUEPRINT_ARN, 9), (BLUEPRINT_STAGE, 1), (BLUEPRINT_STAGE, 1), (CLIENT_TOKEN, 2)), +) + +COPY_BLUEPRINT_STAGE_OUTPUT: StaticSchema = ( + 18, + n0, + _CBSO, + {_sSI: _cCBSRo, _smit: None}, +) + +COPY_BLUEPRINT_STAGE: StaticOperationSchema = ( + 23, + n0, + _CBS, + { + _smith: MappingProxyType( + { + "code": 200, + "method": "PUT", + "uri": "/blueprints/{blueprintArn}/copy-stage", + } + ) + }, + COPY_BLUEPRINT_STAGE_INPUT, + COPY_BLUEPRINT_STAGE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -DATA_AUTOMATION_PROJECT_FILTER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#DataAutomationProjectFilter"), - members={ - "projectArn": { - "target": DATA_AUTOMATION_PROJECT_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "projectStage": {"target": DATA_AUTOMATION_PROJECT_STAGE}, - }, +CREATE_BLUEPRINT_VERSION_INPUT: StaticSchema = ( + 18, + n0, + _CBVI, + {_sSI: _cCBVR, _sm: None}, + (_bA, _cT), + ((BLUEPRINT_ARN, 9), (CLIENT_TOKEN, 2)), +) + +CREATE_BLUEPRINT_VERSION_OUTPUT: StaticSchema = ( + 18, + n0, + _CBVO, + {_sSI: _cCBVRo, _smit: None}, + (_b,), + ((BLUEPRINT, 1),), +) + +CREATE_BLUEPRINT_VERSION: StaticOperationSchema = ( + 23, + n0, + _CBV, + { + _smith: MappingProxyType( + { + "code": 201, + "method": "POST", + "uri": "/blueprints/{blueprintArn}/versions/", + } + ) + }, + CREATE_BLUEPRINT_VERSION_INPUT, + CREATE_BLUEPRINT_VERSION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -RESOURCE_OWNER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#ResourceOwner"), - shape_type=ShapeType.ENUM, - members={"SERVICE": {"target": UNIT}, "ACCOUNT": {"target": UNIT}}, -) +DATA_AUTOMATION_LIBRARY_INGESTION_JOB_ARN: StaticSchema = (3, n0, _DALIJA, 0) -LIST_BLUEPRINTS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#ListBlueprintsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#ListBlueprintsRequest", - ) - ], - members={ - "blueprintArn": {"target": BLUEPRINT_ARN}, - "resourceOwner": {"target": RESOURCE_OWNER}, - "blueprintStageFilter": {"target": BLUEPRINT_STAGE_FILTER}, - "maxResults": {"target": MAX_RESULTS}, - "nextToken": {"target": NEXT_TOKEN}, - "projectFilter": {"target": DATA_AUTOMATION_PROJECT_FILTER}, - }, -) +DATA_AUTOMATION_LIBRARY_ARN: StaticSchema = (3, n0, _DALA, 0) -BLUEPRINT_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#BlueprintSummary"), - members={ - "blueprintArn": { - "target": BLUEPRINT_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "blueprintVersion": {"target": BLUEPRINT_VERSION}, - "blueprintStage": {"target": BLUEPRINT_STAGE}, - "blueprintName": {"target": BLUEPRINT_NAME}, - "creationTime": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastModifiedTime": {"target": DATE_TIMESTAMP}, - }, +GET_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_INPUT: StaticSchema = ( + 18, + n0, + _GDALIJI, + {_sSI: _cGDALIJR, _sm: None}, + (_lA, _jA), + ((DATA_AUTOMATION_LIBRARY_ARN, 9), (DATA_AUTOMATION_LIBRARY_INGESTION_JOB_ARN, 9)), ) -BLUEPRINTS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#Blueprints"), - shape_type=ShapeType.LIST, - members={"member": {"target": BLUEPRINT_SUMMARY}}, +ENTITY_TYPE: StaticSchema = ( + 14, + n0, + _ET, + 0, + (_VOCABULARY,), + ((-1, {_sV: _VOCABULARY}),), ) -LIST_BLUEPRINTS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#ListBlueprintsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#ListBlueprintsResponse", - ) - ], - members={ - "blueprints": { - "target": BLUEPRINTS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": NEXT_TOKEN}, - }, +LIBRARY_INGESTION_JOB_STATUS: StaticSchema = ( + 14, + n0, + _LIJS, + 0, + (_IP, _COMPLETED, _CWE, _FAILED), + ( + (-1, {_sV: _IP}), + (-1, {_sV: _COMPLETED}), + (-1, {_sV: _CWE}), + (-1, {_sV: _FAILED}), + ), ) -LIST_BLUEPRINTS = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#ListBlueprints"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "POST", "uri": "/blueprints/"} - ), - ) - ], +LIBRARY_INGESTION_JOB_OPERATION_TYPE: StaticSchema = ( + 14, + n0, + _LIJOT, + 0, + (_UPSERT, _DELETE), + ((-1, {_sV: _UPSERT}), (-1, {_sV: _DELETE})), +) + +OUTPUT_CONFIGURATION: StaticSchema = (18, n0, _OC, 0, (_sU,), ((S3_URI, 1),)) + +DATA_AUTOMATION_LIBRARY_INGESTION_JOB: StaticSchema = ( + 18, + n0, + _DALIJ, + 0, + (_jA, _cTr, _eTn, _oTp, _jS, _oC, _cTo, _eM, _eT), + ( + (DATA_AUTOMATION_LIBRARY_INGESTION_JOB_ARN, 1), + (DATE_TIMESTAMP, 1), + (ENTITY_TYPE, 1), + (LIBRARY_INGESTION_JOB_OPERATION_TYPE, 1), + (LIBRARY_INGESTION_JOB_STATUS, 1), + (OUTPUT_CONFIGURATION, 1), + (DATE_TIMESTAMP, 0), + (3, 0), + (3, 0), + ), ) -UPDATE_BLUEPRINT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#UpdateBlueprintInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#UpdateBlueprintRequest", - ) - ], - members={ - "blueprintArn": { - "target": BLUEPRINT_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "schema": { - "target": BLUEPRINT_SCHEMA, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "blueprintStage": {"target": BLUEPRINT_STAGE}, - "encryptionConfiguration": {"target": ENCRYPTION_CONFIGURATION}, - }, +GET_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_OUTPUT: StaticSchema = ( + 18, + n0, + _GDALIJO, + {_sSI: _cGDALIJRo, _smit: None}, + (_j,), + ((DATA_AUTOMATION_LIBRARY_INGESTION_JOB, 0),), +) + +GET_DATA_AUTOMATION_LIBRARY_INGESTION_JOB: StaticOperationSchema = ( + 23, + n0, + _GDALIJ, + { + _smith: MappingProxyType( + { + "code": 200, + "method": "POST", + "uri": "/data-automation-libraries/{libraryArn}/library-ingestion-jobs/{jobArn}", + } + ) + }, + GET_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_INPUT, + GET_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -UPDATE_BLUEPRINT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#UpdateBlueprintOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#UpdateBlueprintResponse", - ) - ], - members={ - "blueprint": { - "target": BLUEPRINT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +ENTITY_ID: StaticSchema = (3, n0, _EI, 0) + +ENTITY_ID_LIST: StaticSchema = (16, n0, _EIL, 0, (_me,), ((ENTITY_ID, 0),)) + +DELETE_ENTITIES_INFO: StaticSchema = (18, n0, _DEI, 0, (_eI,), ((ENTITY_ID_LIST, 1),)) + +ENTITY_DESCRIPTION: StaticSchema = (3, n0, _ED, 4) + +LANGUAGE: StaticSchema = ( + 14, + n0, + _L, + 0, + (_EN, _DE, _ES, _FR, _IT, _PT, _JA, _KO, _CN, _TW, _HK), + ( + (-1, {_sV: _EN}), + (-1, {_sV: _DE}), + (-1, {_sV: _ES}), + (-1, {_sV: _FR}), + (-1, {_sV: _IT}), + (-1, {_sV: _PT}), + (-1, {_sV: _JA}), + (-1, {_sV: _KO}), + (-1, {_sV: _CN}), + (-1, {_sV: _TW}), + (-1, {_sV: _HK}), + ), ) -UPDATE_BLUEPRINT = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#UpdateBlueprint"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "PUT", "uri": "/blueprints/{blueprintArn}/"} - ), - ) - ], +PHRASE_DISPLAY_AS_TEXT: StaticSchema = (3, n0, _PDAT, 4) + +PHRASE_TEXT: StaticSchema = (3, n0, _PTh, 4) + +PHRASE: StaticSchema = ( + 18, + n0, + _P, + 0, + (_te, _dAT), + ((PHRASE_TEXT, 1), (PHRASE_DISPLAY_AS_TEXT, 0)), +) + +PHRASE_LIST: StaticSchema = (16, n0, _PL, 0, (_me,), ((PHRASE, 0),)) + +VOCABULARY_ENTITY_INFO: StaticSchema = ( + 18, + n0, + _VEI, + 0, + (_eIn, _d, _l, _p), + ((ENTITY_ID, 0), (ENTITY_DESCRIPTION, 0), (LANGUAGE, 1), (PHRASE_LIST, 1)), +) + +UPSERT_ENTITY_INFO: StaticSchema = ( + 19, + n0, + _UEI, + 0, + (_vo,), + ((VOCABULARY_ENTITY_INFO, 0),), +) + +UPSERT_ENTITIES_INFO: StaticSchema = ( + 16, + n0, + _UEIp, + 0, + (_me,), + ((UPSERT_ENTITY_INFO, 0),), +) + +INLINE_PAYLOAD: StaticSchema = ( + 19, + n0, + _IPnl, + 0, + (_uEI, _dEI), + ((UPSERT_ENTITIES_INFO, 0), (DELETE_ENTITIES_INFO, 0)), +) + +INPUT_CONFIGURATION: StaticSchema = ( + 18, + n0, + _IC, + 0, + (_sO, _iP), + ((S3_OBJECT, 0), (INLINE_PAYLOAD, 0)), +) + +EVENT_BRIDGE_CONFIGURATION: StaticSchema = (18, n0, _EBC, 0, (_eBE,), ((2, 1),)) + +NOTIFICATION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _NC, + 0, + (_eBC,), + ((EVENT_BRIDGE_CONFIGURATION, 1),), +) + +INVOKE_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_INPUT: StaticSchema = ( + 18, + n0, + _IDALIJI, + {_sSI: _cIDALIJR, _sm: None}, + (_lA, _cT, _iC, _eTn, _oTp, _oC, _nC, _t), + ( + (DATA_AUTOMATION_LIBRARY_ARN, 9), + (CLIENT_TOKEN, 2), + (INPUT_CONFIGURATION, 1), + (ENTITY_TYPE, 1), + (LIBRARY_INGESTION_JOB_OPERATION_TYPE, 1), + (OUTPUT_CONFIGURATION, 1), + (NOTIFICATION_CONFIGURATION, 0), + (TAG_LIST, 0), + ), ) -COPY_BLUEPRINT_STAGE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#CopyBlueprintStageInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#CopyBlueprintStageRequest", - ) - ], - members={ - "blueprintArn": { - "target": BLUEPRINT_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "sourceStage": { - "target": BLUEPRINT_STAGE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "targetStage": { - "target": BLUEPRINT_STAGE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - }, +INVOKE_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_OUTPUT: StaticSchema = ( + 18, + n0, + _IDALIJO, + {_sSI: _cIDALIJRo, _smit: None}, + (_jA,), + ((DATA_AUTOMATION_LIBRARY_INGESTION_JOB_ARN, 0),), +) + +INVOKE_DATA_AUTOMATION_LIBRARY_INGESTION_JOB: StaticOperationSchema = ( + 23, + n0, + _IDALIJ, + { + _smith: MappingProxyType( + { + "code": 201, + "method": "PUT", + "uri": "/data-automation-libraries/{libraryArn}/library-ingestion-jobs/", + } + ) + }, + INVOKE_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_INPUT, + INVOKE_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -COPY_BLUEPRINT_STAGE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#CopyBlueprintStageOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#CopyBlueprintStageResponse", - ) - ], -) - -COPY_BLUEPRINT_STAGE = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#CopyBlueprintStage"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "PUT", - "uri": "/blueprints/{blueprintArn}/copy-stage", - } - ), - ) - ], +LIST_DATA_AUTOMATION_LIBRARY_INGESTION_JOBS_INPUT: StaticSchema = ( + 18, + n0, + _LDALIJI, + {_sSI: _cLDALIJR, _sm: None}, + (_lA, _mR, _nT), + ((DATA_AUTOMATION_LIBRARY_ARN, 9), (MAX_RESULTS, 0), (NEXT_TOKEN, 0)), +) + +DATA_AUTOMATION_LIBRARY_INGESTION_JOB_SUMMARY: StaticSchema = ( + 18, + n0, + _DALIJS, + 0, + (_jA, _jS, _eTn, _oTp, _cTr, _cTo), + ( + (DATA_AUTOMATION_LIBRARY_INGESTION_JOB_ARN, 1), + (LIBRARY_INGESTION_JOB_STATUS, 1), + (ENTITY_TYPE, 1), + (LIBRARY_INGESTION_JOB_OPERATION_TYPE, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 0), + ), ) -CREATE_BLUEPRINT_VERSION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#CreateBlueprintVersionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#CreateBlueprintVersionRequest", - ) - ], - members={ - "blueprintArn": { - "target": BLUEPRINT_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - }, +DATA_AUTOMATION_LIBRARY_INGESTION_JOB_SUMMARIES: StaticSchema = ( + 16, + n0, + _DALIJSa, + 0, + (_me,), + ((DATA_AUTOMATION_LIBRARY_INGESTION_JOB_SUMMARY, 0),), +) + +LIST_DATA_AUTOMATION_LIBRARY_INGESTION_JOBS_OUTPUT: StaticSchema = ( + 18, + n0, + _LDALIJO, + {_sSI: _cLDALIJRo, _smit: None}, + (_jo, _nT), + ((DATA_AUTOMATION_LIBRARY_INGESTION_JOB_SUMMARIES, 0), (NEXT_TOKEN, 0)), +) + +LIST_DATA_AUTOMATION_LIBRARY_INGESTION_JOBS: StaticOperationSchema = ( + 23, + n0, + _LDALIJ, + { + _smith: MappingProxyType( + { + "code": 200, + "method": "POST", + "uri": "/data-automation-libraries/{libraryArn}/library-ingestion-jobs/", + } + ) + }, + LIST_DATA_AUTOMATION_LIBRARY_INGESTION_JOBS_INPUT, + LIST_DATA_AUTOMATION_LIBRARY_INGESTION_JOBS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CREATE_BLUEPRINT_VERSION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#CreateBlueprintVersionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#CreateBlueprintVersionResponse", - ) - ], - members={ - "blueprint": { - "target": BLUEPRINT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +DATA_AUTOMATION_LIBRARY_DESCRIPTION: StaticSchema = (3, n0, _DALD, 4) -CREATE_BLUEPRINT_VERSION = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#CreateBlueprintVersion"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 201, - "method": "POST", - "uri": "/blueprints/{blueprintArn}/versions/", - } - ), - ) - ], -) +DATA_AUTOMATION_LIBRARY_NAME: StaticSchema = (3, n0, _DALN, 4) -DATA_AUTOMATION_LIBRARY_INGESTION_JOB_ARN = Schema( - id=ShapeID( - "com.amazonaws.bedrockdataautomation#DataAutomationLibraryIngestionJobArn" +CREATE_DATA_AUTOMATION_LIBRARY_INPUT: StaticSchema = ( + 18, + n0, + _CDALI, + {_sSI: _cCDALR, _sm: None}, + (_lN, _lD, _cT, _eC, _t), + ( + (DATA_AUTOMATION_LIBRARY_NAME, 1), + (DATA_AUTOMATION_LIBRARY_DESCRIPTION, 0), + (CLIENT_TOKEN, 2), + (ENCRYPTION_CONFIGURATION, 0), + (TAG_LIST, 0), ), - shape_type=ShapeType.STRING, -) - -DATA_AUTOMATION_LIBRARY_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#DataAutomationLibraryArn"), - shape_type=ShapeType.STRING, ) -GET_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockdataautomation#GetDataAutomationLibraryIngestionJobInput" +DATA_AUTOMATION_LIBRARY_STATUS: StaticSchema = ( + 14, + n0, + _DALS, + 0, + (_ACTIVE, _DELETING), + ((-1, {_sV: _ACTIVE}), (-1, {_sV: _DELETING})), +) + +CREATE_DATA_AUTOMATION_LIBRARY_OUTPUT: StaticSchema = ( + 18, + n0, + _CDALO, + {_sSI: _cCDALRo, _smit: None}, + (_lA, _st), + ((DATA_AUTOMATION_LIBRARY_ARN, 0), (DATA_AUTOMATION_LIBRARY_STATUS, 0)), +) + +CREATE_DATA_AUTOMATION_LIBRARY: StaticOperationSchema = ( + 23, + n0, + _CDAL, + { + _smith: MappingProxyType( + {"code": 201, "method": "PUT", "uri": "/data-automation-libraries/"} + ) + }, + CREATE_DATA_AUTOMATION_LIBRARY_INPUT, + CREATE_DATA_AUTOMATION_LIBRARY_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#GetDataAutomationLibraryIngestionJobRequest", - ) - ], - members={ - "libraryArn": { - "target": DATA_AUTOMATION_LIBRARY_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "jobArn": { - "target": DATA_AUTOMATION_LIBRARY_INGESTION_JOB_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -ENTITY_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#EntityType"), - shape_type=ShapeType.ENUM, - members={"VOCABULARY": {"target": UNIT}}, -) - -LIBRARY_INGESTION_JOB_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#LibraryIngestionJobStatus"), - shape_type=ShapeType.ENUM, - members={ - "IN_PROGRESS": {"target": UNIT}, - "COMPLETED": {"target": UNIT}, - "COMPLETED_WITH_ERRORS": {"target": UNIT}, - "FAILED": {"target": UNIT}, - }, ) -LIBRARY_INGESTION_JOB_OPERATION_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#LibraryIngestionJobOperationType"), - shape_type=ShapeType.ENUM, - members={"UPSERT": {"target": UNIT}, "DELETE": {"target": UNIT}}, +DELETE_DATA_AUTOMATION_LIBRARY_INPUT: StaticSchema = ( + 18, + n0, + _DDALI, + {_sSI: _cDDALR, _sm: None}, + (_lA,), + ((DATA_AUTOMATION_LIBRARY_ARN, 9),), +) + +DELETE_DATA_AUTOMATION_LIBRARY_OUTPUT: StaticSchema = ( + 18, + n0, + _DDALO, + {_sSI: _cDDALRo, _smit: None}, + (_lA, _st), + ((DATA_AUTOMATION_LIBRARY_ARN, 0), (DATA_AUTOMATION_LIBRARY_STATUS, 0)), +) + +DELETE_DATA_AUTOMATION_LIBRARY: StaticOperationSchema = ( + 23, + n0, + _DDAL, + { + _smith: MappingProxyType( + { + "code": 200, + "method": "DELETE", + "uri": "/data-automation-libraries/{libraryArn}/", + } + ) + }, + DELETE_DATA_AUTOMATION_LIBRARY_INPUT, + DELETE_DATA_AUTOMATION_LIBRARY_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -OUTPUT_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#OutputConfiguration"), - members={ - "s3Uri": { - "target": S3_URI, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +GET_DATA_AUTOMATION_LIBRARY_INPUT: StaticSchema = ( + 18, + n0, + _GDALI, + {_sSI: _cGDALR, _sm: None}, + (_lA,), + ((DATA_AUTOMATION_LIBRARY_ARN, 9),), +) + +ENTITY_METADATA: StaticSchema = (3, n0, _EM, 0) + +ENTITY_TYPE_INFO: StaticSchema = ( + 18, + n0, + _ETI, + 0, + (_eTn, _eMn), + ((ENTITY_TYPE, 1), (ENTITY_METADATA, 0)), +) + +ENTITY_TYPE_INFO_LIST: StaticSchema = ( + 16, + n0, + _ETIL, + 0, + (_me,), + ((ENTITY_TYPE_INFO, 0),), +) + +DATA_AUTOMATION_LIBRARY: StaticSchema = ( + 18, + n0, + _DAL, + 0, + (_lA, _cTr, _lN, _lD, _st, _eTnt, _kKI, _kEC), + ( + (DATA_AUTOMATION_LIBRARY_ARN, 1), + (DATE_TIMESTAMP, 1), + (DATA_AUTOMATION_LIBRARY_NAME, 1), + (DATA_AUTOMATION_LIBRARY_DESCRIPTION, 0), + (DATA_AUTOMATION_LIBRARY_STATUS, 1), + (ENTITY_TYPE_INFO_LIST, 0), + (KMS_KEY_ID, 0), + (KMS_ENCRYPTION_CONTEXT, 0), + ), ) -DATA_AUTOMATION_LIBRARY_INGESTION_JOB = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#DataAutomationLibraryIngestionJob"), - members={ - "jobArn": { - "target": DATA_AUTOMATION_LIBRARY_INGESTION_JOB_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "creationTime": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "entityType": { - "target": ENTITY_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "operationType": { - "target": LIBRARY_INGESTION_JOB_OPERATION_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "jobStatus": { - "target": LIBRARY_INGESTION_JOB_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "outputConfiguration": { - "target": OUTPUT_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "completionTime": {"target": DATE_TIMESTAMP}, - "errorMessage": {"target": STRING}, - "errorType": {"target": STRING}, - }, +GET_DATA_AUTOMATION_LIBRARY_OUTPUT: StaticSchema = ( + 18, + n0, + _GDALO, + {_sSI: _cGDALRo, _smit: None}, + (_li,), + ((DATA_AUTOMATION_LIBRARY, 0),), +) + +GET_DATA_AUTOMATION_LIBRARY: StaticOperationSchema = ( + 23, + n0, + _GDAL, + { + _smith: MappingProxyType( + { + "code": 200, + "method": "POST", + "uri": "/data-automation-libraries/{libraryArn}/", + } + ) + }, + GET_DATA_AUTOMATION_LIBRARY_INPUT, + GET_DATA_AUTOMATION_LIBRARY_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -GET_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockdataautomation#GetDataAutomationLibraryIngestionJobOutput" +LIST_DATA_AUTOMATION_LIBRARIES_INPUT: StaticSchema = ( + 18, + n0, + _LDALI, + {_sSI: _cLDALR, _sm: None}, + (_mR, _nT, _pF), + ((MAX_RESULTS, 0), (NEXT_TOKEN, 0), (DATA_AUTOMATION_PROJECT_FILTER, 0)), +) + +DATA_AUTOMATION_LIBRARY_SUMMARY: StaticSchema = ( + 18, + n0, + _DALSa, + 0, + (_lA, _lN, _cTr), + ( + (DATA_AUTOMATION_LIBRARY_ARN, 1), + (DATA_AUTOMATION_LIBRARY_NAME, 0), + (DATE_TIMESTAMP, 1), ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#GetDataAutomationLibraryIngestionJobResponse", - ) - ], - members={"job": {"target": DATA_AUTOMATION_LIBRARY_INGESTION_JOB}}, -) - -GET_DATA_AUTOMATION_LIBRARY_INGESTION_JOB = Schema( - id=ShapeID( - "com.amazonaws.bedrockdataautomation#GetDataAutomationLibraryIngestionJob" - ), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "POST", - "uri": "/data-automation-libraries/{libraryArn}/library-ingestion-jobs/{jobArn}", - } - ), - ) - ], ) -ENTITY_ID = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#EntityId"), - shape_type=ShapeType.STRING, +DATA_AUTOMATION_LIBRARY_SUMMARIES: StaticSchema = ( + 16, + n0, + _DALSat, + 0, + (_me,), + ((DATA_AUTOMATION_LIBRARY_SUMMARY, 0),), +) + +LIST_DATA_AUTOMATION_LIBRARIES_OUTPUT: StaticSchema = ( + 18, + n0, + _LDALO, + {_sSI: _cLDALRo, _smit: None}, + (_lib, _nT), + ((DATA_AUTOMATION_LIBRARY_SUMMARIES, 0), (NEXT_TOKEN, 0)), +) + +LIST_DATA_AUTOMATION_LIBRARIES: StaticOperationSchema = ( + 23, + n0, + _LDAL, + { + _smith: MappingProxyType( + {"code": 200, "method": "POST", "uri": "/data-automation-libraries/"} + ) + }, + LIST_DATA_AUTOMATION_LIBRARIES_INPUT, + LIST_DATA_AUTOMATION_LIBRARIES_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -ENTITY_ID_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#EntityIdList"), - shape_type=ShapeType.LIST, - members={"member": {"target": ENTITY_ID}}, +UPDATE_DATA_AUTOMATION_LIBRARY_INPUT: StaticSchema = ( + 18, + n0, + _UDALI, + {_sSI: _cUDALR, _sm: None}, + (_lA, _lD, _cT), + ( + (DATA_AUTOMATION_LIBRARY_ARN, 9), + (DATA_AUTOMATION_LIBRARY_DESCRIPTION, 0), + (CLIENT_TOKEN, 2), + ), ) -DELETE_ENTITIES_INFO = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#DeleteEntitiesInfo"), - members={ - "entityIds": { - "target": ENTITY_ID_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +UPDATE_DATA_AUTOMATION_LIBRARY_OUTPUT: StaticSchema = ( + 18, + n0, + _UDALO, + {_sSI: _cUDALRo, _smit: None}, + (_lA, _st), + ((DATA_AUTOMATION_LIBRARY_ARN, 0), (DATA_AUTOMATION_LIBRARY_STATUS, 0)), +) + +UPDATE_DATA_AUTOMATION_LIBRARY: StaticOperationSchema = ( + 23, + n0, + _UDAL, + { + _smith: MappingProxyType( + { + "code": 200, + "method": "PUT", + "uri": "/data-automation-libraries/{libraryArn}/", + } + ) + }, + UPDATE_DATA_AUTOMATION_LIBRARY_INPUT, + UPDATE_DATA_AUTOMATION_LIBRARY_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -ENTITY_DESCRIPTION = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#EntityDescription"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -LANGUAGE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#Language"), - shape_type=ShapeType.ENUM, - members={ - "EN": {"target": UNIT}, - "DE": {"target": UNIT}, - "ES": {"target": UNIT}, - "FR": {"target": UNIT}, - "IT": {"target": UNIT}, - "PT": {"target": UNIT}, - "JA": {"target": UNIT}, - "KO": {"target": UNIT}, - "CN": {"target": UNIT}, - "TW": {"target": UNIT}, - "HK": {"target": UNIT}, - }, +BLUEPRINT_ITEM: StaticSchema = ( + 18, + n0, + _BI, + 0, + (_bA, _bV, _bS), + ((BLUEPRINT_ARN, 1), (BLUEPRINT_VERSION, 0), (BLUEPRINT_STAGE, 0)), +) + +BLUEPRINT_ITEMS: StaticSchema = (16, n0, _BIl, 0, (_me,), ((BLUEPRINT_ITEM, 0),)) + +FALLBACK_BLUEPRINT_ITEMS: StaticSchema = ( + 16, + n0, + _FBI, + 0, + (_me,), + ((BLUEPRINT_ITEM, 0),), +) + +DOCUMENT_CUSTOM_OUTPUT_CONFIGURATION: StaticSchema = ( + 18, + n0, + _DCOC, + 0, + (_fB,), + ((FALLBACK_BLUEPRINT_ITEMS, 0),), +) + +CUSTOM_OUTPUT_CONFIGURATION: StaticSchema = ( + 18, + n0, + _COC, + 0, + (_bl, _do), + ((BLUEPRINT_ITEMS, 0), (DOCUMENT_CUSTOM_OUTPUT_CONFIGURATION, 0)), +) + +DATA_AUTOMATION_LIBRARY_ITEM: StaticSchema = ( + 18, + n0, + _DALI, + 0, + (_lA,), + ((DATA_AUTOMATION_LIBRARY_ARN, 1),), +) + +DATA_AUTOMATION_LIBRARY_ITEMS: StaticSchema = ( + 16, + n0, + _DALIa, + 0, + (_me,), + ((DATA_AUTOMATION_LIBRARY_ITEM, 0),), +) + +DATA_AUTOMATION_LIBRARY_CONFIGURATION: StaticSchema = ( + 18, + n0, + _DALC, + 0, + (_lib,), + ((DATA_AUTOMATION_LIBRARY_ITEMS, 0),), +) + +AUDIO_GENERATIVE_OUTPUT_LANGUAGE: StaticSchema = ( + 14, + n0, + _AGOL, + 0, + (_DEFAULT, _EN), + ((-1, {_sV: _DEFAULT}), (-1, {_sV: _EN})), +) + +AUDIO_INPUT_LANGUAGES: StaticSchema = (16, n0, _AIL, 0, (_me,), ((LANGUAGE, 0),)) + +AUDIO_LANGUAGE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _ALC, + 0, + (_iL, _gOL, _iML), + ((AUDIO_INPUT_LANGUAGES, 0), (AUDIO_GENERATIVE_OUTPUT_LANGUAGE, 0), (2, 0)), +) + +STATE: StaticSchema = ( + 14, + n0, + _St, + 0, + (_ENABLED, _DISABLED), + ((-1, {_sV: _ENABLED}), (-1, {_sV: _DISABLED})), +) + +MODALITY_PROCESSING_CONFIGURATION: StaticSchema = ( + 18, + n0, + _MPC, + 0, + (_stat,), + ((STATE, 0),), +) + +SENSITIVE_DATA_DETECTION_MODE: StaticSchema = ( + 14, + n0, + _SDDM, + 0, + (_DETECTION, _DAR), + ((-1, {_sV: _DETECTION}), (-1, {_sV: _DAR})), +) + +SENSITIVE_DATA_DETECTION_SCOPE_TYPE: StaticSchema = ( + 14, + n0, + _SDDST, + 0, + (_STANDARD, _CUSTOM), + ((-1, {_sV: _STANDARD}), (-1, {_sV: _CUSTOM})), +) + +SENSITIVE_DATA_DETECTION_SCOPE: StaticSchema = ( + 16, + n0, + _SDDS, + 0, + (_me,), + ((SENSITIVE_DATA_DETECTION_SCOPE_TYPE, 0),), +) + +PII_ENTITY_TYPE: StaticSchema = ( + 14, + n0, + _PIIET, + 0, + ( + _ALL, + _ADDRESS, + _AGE, + _NAME, + _EMAIL, + _PHONE, + _USERNAME, + _PASSWORD, + _DI, + _LP, + _VIN, + _CDCC, + _CDCE, + _CDCN, + _PIN, + _IBAN, + _SC, + _IA, + _MA, + _URL, + _AAK, + _ASK, + _UBAN, + _UBRN, + _UITIN, + _UPN, + _USSN, + _CHN, + _CSIN, + _UNHSN, + _UNIN, + _UUTRN, + ), + ( + (-1, {_sV: _ALL}), + (-1, {_sV: _ADDRESS}), + (-1, {_sV: _AGE}), + (-1, {_sV: _NAME}), + (-1, {_sV: _EMAIL}), + (-1, {_sV: _PHONE}), + (-1, {_sV: _USERNAME}), + (-1, {_sV: _PASSWORD}), + (-1, {_sV: _DI}), + (-1, {_sV: _LP}), + (-1, {_sV: _VIN}), + (-1, {_sV: _CDCC}), + (-1, {_sV: _CDCE}), + (-1, {_sV: _CDCN}), + (-1, {_sV: _PIN}), + (-1, {_sV: _IBAN}), + (-1, {_sV: _SC}), + (-1, {_sV: _IA}), + (-1, {_sV: _MA}), + (-1, {_sV: _URL}), + (-1, {_sV: _AAK}), + (-1, {_sV: _ASK}), + (-1, {_sV: _UBAN}), + (-1, {_sV: _UBRN}), + (-1, {_sV: _UITIN}), + (-1, {_sV: _UPN}), + (-1, {_sV: _USSN}), + (-1, {_sV: _CHN}), + (-1, {_sV: _CSIN}), + (-1, {_sV: _UNHSN}), + (-1, {_sV: _UNIN}), + (-1, {_sV: _UUTRN}), + ), ) -PHRASE_DISPLAY_AS_TEXT = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#PhraseDisplayAsText"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +PII_ENTITY_TYPES: StaticSchema = (16, n0, _PIIETn, 0, (_me,), ((PII_ENTITY_TYPE, 0),)) + +PII_REDACTION_MASK_MODE: StaticSchema = ( + 14, + n0, + _PIIRMM, + 0, + (_PII, _ET_), + ((-1, {_sV: _PII}), (-1, {_sV: _ET_})), +) + +PII_ENTITIES_CONFIGURATION: StaticSchema = ( + 18, + n0, + _PIIEC, + 0, + (_pET, _rMM), + ((PII_ENTITY_TYPES, 0), (PII_REDACTION_MASK_MODE, 0)), +) + +SENSITIVE_DATA_CONFIGURATION: StaticSchema = ( + 18, + n0, + _SDC, + 0, + (_dM, _dS, _pEC), + ( + (SENSITIVE_DATA_DETECTION_MODE, 1), + (SENSITIVE_DATA_DETECTION_SCOPE, 0), + (PII_ENTITIES_CONFIGURATION, 0), + ), ) -PHRASE_TEXT = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#PhraseText"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +AUDIO_OVERRIDE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _AOC, + 0, + (_mP, _lC, _sDC), + ( + (MODALITY_PROCESSING_CONFIGURATION, 0), + (AUDIO_LANGUAGE_CONFIGURATION, 0), + (SENSITIVE_DATA_CONFIGURATION, 0), + ), ) -PHRASE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#Phrase"), - members={ - "text": { - "target": PHRASE_TEXT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "displayAsText": {"target": PHRASE_DISPLAY_AS_TEXT}, - }, -) +SPLITTER_CONFIGURATION: StaticSchema = (18, n0, _SCp, 0, (_stat,), ((STATE, 0),)) -PHRASE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#PhraseList"), - shape_type=ShapeType.LIST, - members={"member": {"target": PHRASE}}, -) - -VOCABULARY_ENTITY_INFO = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#VocabularyEntityInfo"), - members={ - "entityId": {"target": ENTITY_ID}, - "description": {"target": ENTITY_DESCRIPTION}, - "language": { - "target": LANGUAGE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "phrases": { - "target": PHRASE_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +DOCUMENT_OVERRIDE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _DOC, + 0, + (_sp, _mP, _sDC), + ( + (SPLITTER_CONFIGURATION, 0), + (MODALITY_PROCESSING_CONFIGURATION, 0), + (SENSITIVE_DATA_CONFIGURATION, 0), + ), ) -UPSERT_ENTITY_INFO = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#UpsertEntityInfo"), - shape_type=ShapeType.UNION, - members={"vocabulary": {"target": VOCABULARY_ENTITY_INFO}}, +IMAGE_OVERRIDE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _IOC, + 0, + (_mP, _sDC), + ((MODALITY_PROCESSING_CONFIGURATION, 0), (SENSITIVE_DATA_CONFIGURATION, 0)), +) + +DESIRED_MODALITY: StaticSchema = ( + 14, + n0, + _DM, + 0, + (_IMAGE, _DOCUMENT, _AUDIO, _VIDEO), + ( + (-1, {_sV: _IMAGE}), + (-1, {_sV: _DOCUMENT}), + (-1, {_sV: _AUDIO}), + (-1, {_sV: _VIDEO}), + ), ) -UPSERT_ENTITIES_INFO = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#UpsertEntitiesInfo"), - shape_type=ShapeType.LIST, - members={"member": {"target": UPSERT_ENTITY_INFO}}, +MODALITY_ROUTING_CONFIGURATION: StaticSchema = ( + 18, + n0, + _MRC, + 0, + (_jp, _pn, _mp, _mo), + ( + (DESIRED_MODALITY, 0), + (DESIRED_MODALITY, 0), + (DESIRED_MODALITY, 0), + (DESIRED_MODALITY, 0), + ), ) -INLINE_PAYLOAD = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#InlinePayload"), - shape_type=ShapeType.UNION, - members={ - "upsertEntitiesInfo": {"target": UPSERT_ENTITIES_INFO}, - "deleteEntitiesInfo": {"target": DELETE_ENTITIES_INFO}, - }, +VIDEO_OVERRIDE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _VOC, + 0, + (_mP, _sDC), + ((MODALITY_PROCESSING_CONFIGURATION, 0), (SENSITIVE_DATA_CONFIGURATION, 0)), +) + +OVERRIDE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _OCv, + 0, + (_do, _i, _vi, _a, _mRo), + ( + (DOCUMENT_OVERRIDE_CONFIGURATION, 0), + (IMAGE_OVERRIDE_CONFIGURATION, 0), + (VIDEO_OVERRIDE_CONFIGURATION, 0), + (AUDIO_OVERRIDE_CONFIGURATION, 0), + (MODALITY_ROUTING_CONFIGURATION, 0), + ), ) -INPUT_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#InputConfiguration"), - members={ - "s3Object": {"target": S3_OBJECT}, - "inlinePayload": {"target": INLINE_PAYLOAD}, - }, +DATA_AUTOMATION_PROJECT_DESCRIPTION: StaticSchema = (3, n0, _DAPD, 4) + +DATA_AUTOMATION_PROJECT_NAME: StaticSchema = (3, n0, _DAPN, 4) + +DATA_AUTOMATION_PROJECT_TYPE: StaticSchema = ( + 14, + n0, + _DAPT, + 0, + (_ASYNC, _SYNC), + ((-1, {_sV: _ASYNC}), (-1, {_sV: _SYNC})), +) + +CHANNEL_LABELING_CONFIGURATION: StaticSchema = ( + 18, + n0, + _CLC, + 0, + (_stat,), + ((STATE, 1),), +) + +SPEAKER_LABELING_CONFIGURATION: StaticSchema = ( + 18, + n0, + _SLC, + 0, + (_stat,), + ((STATE, 1),), +) + +TRANSCRIPT_CONFIGURATION: StaticSchema = ( + 18, + n0, + _TC, + 0, + (_sLp, _cL), + ((SPEAKER_LABELING_CONFIGURATION, 0), (CHANNEL_LABELING_CONFIGURATION, 0)), +) + +AUDIO_EXTRACTION_CATEGORY_TYPE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _AECTC, + 0, + (_tr,), + ((TRANSCRIPT_CONFIGURATION, 0),), +) + +AUDIO_EXTRACTION_CATEGORY_TYPE: StaticSchema = ( + 14, + n0, + _AECT, + 0, + (_ACM, _TRANSCRIPT, _TCM), + ((-1, {_sV: _ACM}), (-1, {_sV: _TRANSCRIPT}), (-1, {_sV: _TCM})), +) + +AUDIO_EXTRACTION_CATEGORY_TYPES: StaticSchema = ( + 16, + n0, + _AECTu, + 0, + (_me,), + ((AUDIO_EXTRACTION_CATEGORY_TYPE, 0),), +) + +AUDIO_EXTRACTION_CATEGORY: StaticSchema = ( + 18, + n0, + _AEC, + 0, + (_stat, _typ, _tC), + ( + (STATE, 1), + (AUDIO_EXTRACTION_CATEGORY_TYPES, 0), + (AUDIO_EXTRACTION_CATEGORY_TYPE_CONFIGURATION, 0), + ), ) -EVENT_BRIDGE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#EventBridgeConfiguration"), - members={ - "eventBridgeEnabled": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +AUDIO_STANDARD_EXTRACTION: StaticSchema = ( + 18, + n0, + _ASE, + 0, + (_ca,), + ((AUDIO_EXTRACTION_CATEGORY, 1),), +) + +AUDIO_STANDARD_GENERATIVE_FIELD_TYPE: StaticSchema = ( + 14, + n0, + _ASGFT, + 0, + (_AS, _IAB, _TS), + ((-1, {_sV: _AS}), (-1, {_sV: _IAB}), (-1, {_sV: _TS})), +) + +AUDIO_STANDARD_GENERATIVE_FIELD_TYPES: StaticSchema = ( + 16, + n0, + _ASGFTu, + 0, + (_me,), + ((AUDIO_STANDARD_GENERATIVE_FIELD_TYPE, 0),), +) + +AUDIO_STANDARD_GENERATIVE_FIELD: StaticSchema = ( + 18, + n0, + _ASGF, + 0, + (_stat, _typ), + ((STATE, 1), (AUDIO_STANDARD_GENERATIVE_FIELD_TYPES, 0)), +) + +AUDIO_STANDARD_OUTPUT_CONFIGURATION: StaticSchema = ( + 18, + n0, + _ASOC, + 0, + (_e, _gF), + ((AUDIO_STANDARD_EXTRACTION, 0), (AUDIO_STANDARD_GENERATIVE_FIELD, 0)), +) + +DOCUMENT_BOUNDING_BOX: StaticSchema = (18, n0, _DBB, 0, (_stat,), ((STATE, 1),)) + +DOCUMENT_EXTRACTION_GRANULARITY_TYPE: StaticSchema = ( + 14, + n0, + _DEGT, + 0, + (_DOCUMENT, _PAGE, _ELEMENT, _WORD, _LINE), + ( + (-1, {_sV: _DOCUMENT}), + (-1, {_sV: _PAGE}), + (-1, {_sV: _ELEMENT}), + (-1, {_sV: _WORD}), + (-1, {_sV: _LINE}), + ), ) -NOTIFICATION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#NotificationConfiguration"), - members={ - "eventBridgeConfiguration": { - "target": EVENT_BRIDGE_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +DOCUMENT_EXTRACTION_GRANULARITY_TYPES: StaticSchema = ( + 16, + n0, + _DEGTo, + 0, + (_me,), + ((DOCUMENT_EXTRACTION_GRANULARITY_TYPE, 0),), +) + +DOCUMENT_EXTRACTION_GRANULARITY: StaticSchema = ( + 18, + n0, + _DEG, + 0, + (_typ,), + ((DOCUMENT_EXTRACTION_GRANULARITY_TYPES, 0),), +) + +DOCUMENT_STANDARD_EXTRACTION: StaticSchema = ( + 18, + n0, + _DSE, + 0, + (_g, _bB), + ((DOCUMENT_EXTRACTION_GRANULARITY, 1), (DOCUMENT_BOUNDING_BOX, 1)), +) + +DOCUMENT_STANDARD_GENERATIVE_FIELD: StaticSchema = ( + 18, + n0, + _DSGF, + 0, + (_stat,), + ((STATE, 1),), +) + +DOCUMENT_OUTPUT_ADDITIONAL_FILE_FORMAT: StaticSchema = ( + 18, + n0, + _DOAFF, + 0, + (_stat,), + ((STATE, 1),), +) + +DOCUMENT_OUTPUT_TEXT_FORMAT_TYPE: StaticSchema = ( + 14, + n0, + _DOTFT, + 0, + (_PT_, _MARKDOWN, _HTML, _CSV), + ((-1, {_sV: _PT_}), (-1, {_sV: _MARKDOWN}), (-1, {_sV: _HTML}), (-1, {_sV: _CSV})), +) + +DOCUMENT_OUTPUT_TEXT_FORMAT_TYPES: StaticSchema = ( + 16, + n0, + _DOTFTo, + 0, + (_me,), + ((DOCUMENT_OUTPUT_TEXT_FORMAT_TYPE, 0),), +) + +DOCUMENT_OUTPUT_TEXT_FORMAT: StaticSchema = ( + 18, + n0, + _DOTF, + 0, + (_typ,), + ((DOCUMENT_OUTPUT_TEXT_FORMAT_TYPES, 0),), +) + +DOCUMENT_OUTPUT_FORMAT: StaticSchema = ( + 18, + n0, + _DOF, + 0, + (_tF, _aFF), + ((DOCUMENT_OUTPUT_TEXT_FORMAT, 1), (DOCUMENT_OUTPUT_ADDITIONAL_FILE_FORMAT, 1)), +) + +DOCUMENT_STANDARD_OUTPUT_CONFIGURATION: StaticSchema = ( + 18, + n0, + _DSOC, + 0, + (_e, _gF, _oF), + ( + (DOCUMENT_STANDARD_EXTRACTION, 0), + (DOCUMENT_STANDARD_GENERATIVE_FIELD, 0), + (DOCUMENT_OUTPUT_FORMAT, 0), + ), ) -INVOKE_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockdataautomation#InvokeDataAutomationLibraryIngestionJobInput" +IMAGE_BOUNDING_BOX: StaticSchema = (18, n0, _IBB, 0, (_stat,), ((STATE, 1),)) + +IMAGE_EXTRACTION_CATEGORY_TYPE: StaticSchema = ( + 14, + n0, + _IECT, + 0, + (_CM, _TD, _LOGOS), + ((-1, {_sV: _CM}), (-1, {_sV: _TD}), (-1, {_sV: _LOGOS})), +) + +IMAGE_EXTRACTION_CATEGORY_TYPES: StaticSchema = ( + 16, + n0, + _IECTm, + 0, + (_me,), + ((IMAGE_EXTRACTION_CATEGORY_TYPE, 0),), +) + +IMAGE_EXTRACTION_CATEGORY: StaticSchema = ( + 18, + n0, + _IEC, + 0, + (_stat, _typ), + ((STATE, 1), (IMAGE_EXTRACTION_CATEGORY_TYPES, 0)), +) + +IMAGE_STANDARD_EXTRACTION: StaticSchema = ( + 18, + n0, + _ISEm, + 0, + (_ca, _bB), + ((IMAGE_EXTRACTION_CATEGORY, 1), (IMAGE_BOUNDING_BOX, 1)), +) + +IMAGE_STANDARD_GENERATIVE_FIELD_TYPE: StaticSchema = ( + 14, + n0, + _ISGFT, + 0, + (_IS, _IAB), + ((-1, {_sV: _IS}), (-1, {_sV: _IAB})), +) + +IMAGE_STANDARD_GENERATIVE_FIELD_TYPES: StaticSchema = ( + 16, + n0, + _ISGFTm, + 0, + (_me,), + ((IMAGE_STANDARD_GENERATIVE_FIELD_TYPE, 0),), +) + +IMAGE_STANDARD_GENERATIVE_FIELD: StaticSchema = ( + 18, + n0, + _ISGF, + 0, + (_stat, _typ), + ((STATE, 1), (IMAGE_STANDARD_GENERATIVE_FIELD_TYPES, 0)), +) + +IMAGE_STANDARD_OUTPUT_CONFIGURATION: StaticSchema = ( + 18, + n0, + _ISOC, + 0, + (_e, _gF), + ((IMAGE_STANDARD_EXTRACTION, 0), (IMAGE_STANDARD_GENERATIVE_FIELD, 0)), +) + +VIDEO_BOUNDING_BOX: StaticSchema = (18, n0, _VBB, 0, (_stat,), ((STATE, 1),)) + +VIDEO_EXTRACTION_CATEGORY_TYPE: StaticSchema = ( + 14, + n0, + _VECT, + 0, + (_CM, _TD, _TRANSCRIPT, _LOGOS), + ((-1, {_sV: _CM}), (-1, {_sV: _TD}), (-1, {_sV: _TRANSCRIPT}), (-1, {_sV: _LOGOS})), +) + +VIDEO_EXTRACTION_CATEGORY_TYPES: StaticSchema = ( + 16, + n0, + _VECTi, + 0, + (_me,), + ((VIDEO_EXTRACTION_CATEGORY_TYPE, 0),), +) + +VIDEO_EXTRACTION_CATEGORY: StaticSchema = ( + 18, + n0, + _VEC, + 0, + (_stat, _typ), + ((STATE, 1), (VIDEO_EXTRACTION_CATEGORY_TYPES, 0)), +) + +VIDEO_STANDARD_EXTRACTION: StaticSchema = ( + 18, + n0, + _VSE, + 0, + (_ca, _bB), + ((VIDEO_EXTRACTION_CATEGORY, 1), (VIDEO_BOUNDING_BOX, 1)), +) + +VIDEO_STANDARD_GENERATIVE_FIELD_TYPE: StaticSchema = ( + 14, + n0, + _VSGFT, + 0, + (_VS, _IAB, _CS), + ((-1, {_sV: _VS}), (-1, {_sV: _IAB}), (-1, {_sV: _CS})), +) + +VIDEO_STANDARD_GENERATIVE_FIELD_TYPES: StaticSchema = ( + 16, + n0, + _VSGFTi, + 0, + (_me,), + ((VIDEO_STANDARD_GENERATIVE_FIELD_TYPE, 0),), +) + +VIDEO_STANDARD_GENERATIVE_FIELD: StaticSchema = ( + 18, + n0, + _VSGF, + 0, + (_stat, _typ), + ((STATE, 1), (VIDEO_STANDARD_GENERATIVE_FIELD_TYPES, 0)), +) + +VIDEO_STANDARD_OUTPUT_CONFIGURATION: StaticSchema = ( + 18, + n0, + _VSOC, + 0, + (_e, _gF), + ((VIDEO_STANDARD_EXTRACTION, 0), (VIDEO_STANDARD_GENERATIVE_FIELD, 0)), +) + +STANDARD_OUTPUT_CONFIGURATION: StaticSchema = ( + 18, + n0, + _SOC, + 0, + (_do, _i, _vi, _a), + ( + (DOCUMENT_STANDARD_OUTPUT_CONFIGURATION, 0), + (IMAGE_STANDARD_OUTPUT_CONFIGURATION, 0), + (VIDEO_STANDARD_OUTPUT_CONFIGURATION, 0), + (AUDIO_STANDARD_OUTPUT_CONFIGURATION, 0), ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#InvokeDataAutomationLibraryIngestionJobRequest", - ) - ], - members={ - "libraryArn": { - "target": DATA_AUTOMATION_LIBRARY_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "inputConfiguration": { - "target": INPUT_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "entityType": { - "target": ENTITY_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "operationType": { - "target": LIBRARY_INGESTION_JOB_OPERATION_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "outputConfiguration": { - "target": OUTPUT_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "notificationConfiguration": {"target": NOTIFICATION_CONFIGURATION}, - "tags": {"target": TAG_LIST}, - }, ) -INVOKE_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockdataautomation#InvokeDataAutomationLibraryIngestionJobOutput" +CREATE_DATA_AUTOMATION_PROJECT_INPUT: StaticSchema = ( + 18, + n0, + _CDAPI, + {_sSI: _cCDAPR, _sm: None}, + (_pN, _pD, _pS, _pT, _sOC, _cOC, _oCv, _dALC, _cT, _eC, _t), + ( + (DATA_AUTOMATION_PROJECT_NAME, 1), + (DATA_AUTOMATION_PROJECT_DESCRIPTION, 0), + (DATA_AUTOMATION_PROJECT_STAGE, 0), + (DATA_AUTOMATION_PROJECT_TYPE, {_smithya: _ASYNC}), + (STANDARD_OUTPUT_CONFIGURATION, 1), + (CUSTOM_OUTPUT_CONFIGURATION, 0), + (OVERRIDE_CONFIGURATION, 0), + (DATA_AUTOMATION_LIBRARY_CONFIGURATION, 0), + (CLIENT_TOKEN, 2), + (ENCRYPTION_CONFIGURATION, 0), + (TAG_LIST, 0), ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#InvokeDataAutomationLibraryIngestionJobResponse", - ) - ], - members={"jobArn": {"target": DATA_AUTOMATION_LIBRARY_INGESTION_JOB_ARN}}, -) - -INVOKE_DATA_AUTOMATION_LIBRARY_INGESTION_JOB = Schema( - id=ShapeID( - "com.amazonaws.bedrockdataautomation#InvokeDataAutomationLibraryIngestionJob" - ), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 201, - "method": "PUT", - "uri": "/data-automation-libraries/{libraryArn}/library-ingestion-jobs/", - } - ), - ) - ], ) -LIST_DATA_AUTOMATION_LIBRARY_INGESTION_JOBS_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockdataautomation#ListDataAutomationLibraryIngestionJobsInput" +DATA_AUTOMATION_PROJECT_STATUS: StaticSchema = ( + 14, + n0, + _DAPSa, + 0, + (_COMPLETED, _IP, _FAILED), + ((-1, {_sV: _COMPLETED}), (-1, {_sV: _IP}), (-1, {_sV: _FAILED})), +) + +CREATE_DATA_AUTOMATION_PROJECT_OUTPUT: StaticSchema = ( + 18, + n0, + _CDAPO, + {_sSI: _cCDAPRo, _smit: None}, + (_pA, _pS, _st), + ( + (DATA_AUTOMATION_PROJECT_ARN, 1), + (DATA_AUTOMATION_PROJECT_STAGE, 0), + (DATA_AUTOMATION_PROJECT_STATUS, 0), ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#ListDataAutomationLibraryIngestionJobsRequest", - ) - ], - members={ - "libraryArn": { - "target": DATA_AUTOMATION_LIBRARY_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "maxResults": {"target": MAX_RESULTS}, - "nextToken": {"target": NEXT_TOKEN}, - }, ) -DATA_AUTOMATION_LIBRARY_INGESTION_JOB_SUMMARY = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockdataautomation#DataAutomationLibraryIngestionJobSummary" - ), - members={ - "jobArn": { - "target": DATA_AUTOMATION_LIBRARY_INGESTION_JOB_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "jobStatus": { - "target": LIBRARY_INGESTION_JOB_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "entityType": { - "target": ENTITY_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "operationType": { - "target": LIBRARY_INGESTION_JOB_OPERATION_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "creationTime": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "completionTime": {"target": DATE_TIMESTAMP}, - }, +CREATE_DATA_AUTOMATION_PROJECT: StaticOperationSchema = ( + 23, + n0, + _CDAP, + { + _smith: MappingProxyType( + {"code": 201, "method": "PUT", "uri": "/data-automation-projects/"} + ) + }, + CREATE_DATA_AUTOMATION_PROJECT_INPUT, + CREATE_DATA_AUTOMATION_PROJECT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -DATA_AUTOMATION_LIBRARY_INGESTION_JOB_SUMMARIES = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockdataautomation#DataAutomationLibraryIngestionJobSummaries" +DELETE_DATA_AUTOMATION_PROJECT_INPUT: StaticSchema = ( + 18, + n0, + _DDAPI, + {_sSI: _cDDAPR, _sm: None}, + (_pA,), + ((DATA_AUTOMATION_PROJECT_ARN, 9),), +) + +DELETE_DATA_AUTOMATION_PROJECT_OUTPUT: StaticSchema = ( + 18, + n0, + _DDAPO, + {_sSI: _cDDAPRo, _smit: None}, + (_pA, _st), + ((DATA_AUTOMATION_PROJECT_ARN, 1), (DATA_AUTOMATION_PROJECT_STATUS, 0)), +) + +DELETE_DATA_AUTOMATION_PROJECT: StaticOperationSchema = ( + 23, + n0, + _DDAP, + { + _smith: MappingProxyType( + { + "code": 200, + "method": "DELETE", + "uri": "/data-automation-projects/{projectArn}/", + } + ) + }, + DELETE_DATA_AUTOMATION_PROJECT_INPUT, + DELETE_DATA_AUTOMATION_PROJECT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, ), - shape_type=ShapeType.LIST, - members={"member": {"target": DATA_AUTOMATION_LIBRARY_INGESTION_JOB_SUMMARY}}, ) -LIST_DATA_AUTOMATION_LIBRARY_INGESTION_JOBS_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockdataautomation#ListDataAutomationLibraryIngestionJobsOutput" +GET_DATA_AUTOMATION_PROJECT_INPUT: StaticSchema = ( + 18, + n0, + _GDAPI, + {_sSI: _cGDAPR, _sm: None}, + (_pA, _pS), + ((DATA_AUTOMATION_PROJECT_ARN, 9), (DATA_AUTOMATION_PROJECT_STAGE, 0)), +) + +DATA_AUTOMATION_PROJECT: StaticSchema = ( + 18, + n0, + _DAP, + 0, + (_pA, _cTr, _lMT, _pN, _pS, _pT, _pD, _sOC, _cOC, _oCv, _dALC, _st, _kKI, _kEC), + ( + (DATA_AUTOMATION_PROJECT_ARN, 1), + (DATE_TIMESTAMP, 1), + (DATE_TIMESTAMP, 1), + (DATA_AUTOMATION_PROJECT_NAME, 1), + (DATA_AUTOMATION_PROJECT_STAGE, 0), + (DATA_AUTOMATION_PROJECT_TYPE, 0), + (DATA_AUTOMATION_PROJECT_DESCRIPTION, 0), + (STANDARD_OUTPUT_CONFIGURATION, 0), + (CUSTOM_OUTPUT_CONFIGURATION, 0), + (OVERRIDE_CONFIGURATION, 0), + (DATA_AUTOMATION_LIBRARY_CONFIGURATION, 0), + (DATA_AUTOMATION_PROJECT_STATUS, 1), + (KMS_KEY_ID, 0), + (KMS_ENCRYPTION_CONTEXT, 0), ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#ListDataAutomationLibraryIngestionJobsResponse", - ) - ], - members={ - "jobs": {"target": DATA_AUTOMATION_LIBRARY_INGESTION_JOB_SUMMARIES}, - "nextToken": {"target": NEXT_TOKEN}, - }, ) -LIST_DATA_AUTOMATION_LIBRARY_INGESTION_JOBS = Schema( - id=ShapeID( - "com.amazonaws.bedrockdataautomation#ListDataAutomationLibraryIngestionJobs" - ), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "POST", - "uri": "/data-automation-libraries/{libraryArn}/library-ingestion-jobs/", - } - ), - ) - ], +GET_DATA_AUTOMATION_PROJECT_OUTPUT: StaticSchema = ( + 18, + n0, + _GDAPO, + {_sSI: _cGDAPRo, _smit: None}, + (_pr,), + ((DATA_AUTOMATION_PROJECT, 1),), +) + +GET_DATA_AUTOMATION_PROJECT: StaticOperationSchema = ( + 23, + n0, + _GDAP, + { + _smith: MappingProxyType( + { + "code": 200, + "method": "POST", + "uri": "/data-automation-projects/{projectArn}/", + } + ) + }, + GET_DATA_AUTOMATION_PROJECT_INPUT, + GET_DATA_AUTOMATION_PROJECT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -DATA_AUTOMATION_LIBRARY_DESCRIPTION = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#DataAutomationLibraryDescription"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +BLUEPRINT_FILTER: StaticSchema = ( + 18, + n0, + _BF, + 0, + (_bA, _bV, _bS), + ((BLUEPRINT_ARN, 1), (BLUEPRINT_VERSION, 0), (BLUEPRINT_STAGE, 0)), +) + +DATA_AUTOMATION_LIBRARY_FILTER: StaticSchema = ( + 18, + n0, + _DALF, + 0, + (_lA,), + ((DATA_AUTOMATION_LIBRARY_ARN, 1),), +) + +DATA_AUTOMATION_PROJECT_STAGE_FILTER: StaticSchema = ( + 14, + n0, + _DAPSF, + 0, + (_DEVELOPMENT, _LIVE, _ALL), + ((-1, {_sV: _DEVELOPMENT}), (-1, {_sV: _LIVE}), (-1, {_sV: _ALL})), +) + +LIST_DATA_AUTOMATION_PROJECTS_INPUT: StaticSchema = ( + 18, + n0, + _LDAPI, + {_sSI: _cLDAPR, _sm: None}, + (_mR, _nT, _pSF, _bF, _rO, _lF), + ( + (MAX_RESULTS, 0), + (NEXT_TOKEN, 0), + (DATA_AUTOMATION_PROJECT_STAGE_FILTER, 0), + (BLUEPRINT_FILTER, 0), + (RESOURCE_OWNER, 0), + (DATA_AUTOMATION_LIBRARY_FILTER, 0), + ), ) -DATA_AUTOMATION_LIBRARY_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#DataAutomationLibraryName"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +DATA_AUTOMATION_PROJECT_SUMMARY: StaticSchema = ( + 18, + n0, + _DAPSat, + 0, + (_pA, _pS, _pT, _pN, _cTr), + ( + (DATA_AUTOMATION_PROJECT_ARN, 1), + (DATA_AUTOMATION_PROJECT_STAGE, 0), + (DATA_AUTOMATION_PROJECT_TYPE, 0), + (DATA_AUTOMATION_PROJECT_NAME, 0), + (DATE_TIMESTAMP, 1), + ), ) -CREATE_DATA_AUTOMATION_LIBRARY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#CreateDataAutomationLibraryInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#CreateDataAutomationLibraryRequest", - ) - ], - members={ - "libraryName": { - "target": DATA_AUTOMATION_LIBRARY_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "libraryDescription": {"target": DATA_AUTOMATION_LIBRARY_DESCRIPTION}, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "encryptionConfiguration": {"target": ENCRYPTION_CONFIGURATION}, - "tags": {"target": TAG_LIST}, - }, +DATA_AUTOMATION_PROJECT_SUMMARIES: StaticSchema = ( + 16, + n0, + _DAPSata, + 0, + (_me,), + ((DATA_AUTOMATION_PROJECT_SUMMARY, 0),), +) + +LIST_DATA_AUTOMATION_PROJECTS_OUTPUT: StaticSchema = ( + 18, + n0, + _LDAPO, + {_sSI: _cLDAPRo, _smit: None}, + (_pro, _nT), + ((DATA_AUTOMATION_PROJECT_SUMMARIES, 1), (NEXT_TOKEN, 0)), +) + +LIST_DATA_AUTOMATION_PROJECTS: StaticOperationSchema = ( + 23, + n0, + _LDAP, + { + _smith: MappingProxyType( + {"code": 200, "method": "POST", "uri": "/data-automation-projects/"} + ) + }, + LIST_DATA_AUTOMATION_PROJECTS_INPUT, + LIST_DATA_AUTOMATION_PROJECTS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -DATA_AUTOMATION_LIBRARY_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#DataAutomationLibraryStatus"), - shape_type=ShapeType.ENUM, - members={"ACTIVE": {"target": UNIT}, "DELETING": {"target": UNIT}}, +UPDATE_DATA_AUTOMATION_PROJECT_INPUT: StaticSchema = ( + 18, + n0, + _UDAPI, + {_sSI: _cUDAPR, _sm: None}, + (_pA, _pS, _pD, _sOC, _cOC, _oCv, _dALC, _eC), + ( + (DATA_AUTOMATION_PROJECT_ARN, 9), + (DATA_AUTOMATION_PROJECT_STAGE, 0), + (DATA_AUTOMATION_PROJECT_DESCRIPTION, 0), + (STANDARD_OUTPUT_CONFIGURATION, 1), + (CUSTOM_OUTPUT_CONFIGURATION, 0), + (OVERRIDE_CONFIGURATION, 0), + (DATA_AUTOMATION_LIBRARY_CONFIGURATION, 0), + (ENCRYPTION_CONFIGURATION, 0), + ), ) -CREATE_DATA_AUTOMATION_LIBRARY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#CreateDataAutomationLibraryOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#CreateDataAutomationLibraryResponse", - ) - ], - members={ - "libraryArn": {"target": DATA_AUTOMATION_LIBRARY_ARN}, - "status": {"target": DATA_AUTOMATION_LIBRARY_STATUS}, - }, +UPDATE_DATA_AUTOMATION_PROJECT_OUTPUT: StaticSchema = ( + 18, + n0, + _UDAPO, + {_sSI: _cUDAPRo, _smit: None}, + (_pA, _pS, _st), + ( + (DATA_AUTOMATION_PROJECT_ARN, 1), + (DATA_AUTOMATION_PROJECT_STAGE, 0), + (DATA_AUTOMATION_PROJECT_STATUS, 0), + ), ) -CREATE_DATA_AUTOMATION_LIBRARY = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#CreateDataAutomationLibrary"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 201, "method": "PUT", "uri": "/data-automation-libraries/"} - ), - ) - ], +UPDATE_DATA_AUTOMATION_PROJECT: StaticOperationSchema = ( + 23, + n0, + _UDAP, + { + _smith: MappingProxyType( + { + "code": 200, + "method": "PUT", + "uri": "/data-automation-projects/{projectArn}/", + } + ) + }, + UPDATE_DATA_AUTOMATION_PROJECT_INPUT, + UPDATE_DATA_AUTOMATION_PROJECT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -DELETE_DATA_AUTOMATION_LIBRARY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#DeleteDataAutomationLibraryInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#DeleteDataAutomationLibraryRequest", - ) - ], - members={ - "libraryArn": { - "target": DATA_AUTOMATION_LIBRARY_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, +GET_DATA_AUTOMATION_LIBRARY_ENTITY_INPUT: StaticSchema = ( + 18, + n0, + _GDALEI, + {_sSI: _cGDALER, _sm: None}, + (_lA, _eTn, _eIn), + ((DATA_AUTOMATION_LIBRARY_ARN, 9), (ENTITY_TYPE, 9), (ENTITY_ID, 9)), +) + +VOCABULARY_ENTITY: StaticSchema = ( + 18, + n0, + _VEo, + 0, + (_eIn, _d, _l, _p, _lMT), + ( + (ENTITY_ID, 0), + (ENTITY_DESCRIPTION, 0), + (LANGUAGE, 0), + (PHRASE_LIST, 0), + (DATE_TIMESTAMP, 0), + ), ) -DELETE_DATA_AUTOMATION_LIBRARY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#DeleteDataAutomationLibraryOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#DeleteDataAutomationLibraryResponse", - ) - ], - members={ - "libraryArn": {"target": DATA_AUTOMATION_LIBRARY_ARN}, - "status": {"target": DATA_AUTOMATION_LIBRARY_STATUS}, - }, +ENTITY_DETAILS: StaticSchema = (19, n0, _EDn, 0, (_vo,), ((VOCABULARY_ENTITY, 0),)) + +GET_DATA_AUTOMATION_LIBRARY_ENTITY_OUTPUT: StaticSchema = ( + 18, + n0, + _GDALEO, + {_sSI: _cGDALERo, _smit: None}, + (_en,), + ((ENTITY_DETAILS, 0),), +) + +GET_DATA_AUTOMATION_LIBRARY_ENTITY: StaticOperationSchema = ( + 23, + n0, + _GDALE, + { + _smith: MappingProxyType( + { + "code": 200, + "method": "POST", + "uri": "/data-automation-libraries/{libraryArn}/entityType/{entityType}/entities/{entityId}", + } + ) + }, + GET_DATA_AUTOMATION_LIBRARY_ENTITY_INPUT, + GET_DATA_AUTOMATION_LIBRARY_ENTITY_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -DELETE_DATA_AUTOMATION_LIBRARY = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#DeleteDataAutomationLibrary"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "DELETE", - "uri": "/data-automation-libraries/{libraryArn}/", - } - ), - ) - ], +LIST_DATA_AUTOMATION_LIBRARY_ENTITIES_INPUT: StaticSchema = ( + 18, + n0, + _LDALEI, + {_sSI: _cLDALER, _sm: None}, + (_lA, _eTn, _mR, _nT), + ( + (DATA_AUTOMATION_LIBRARY_ARN, 9), + (ENTITY_TYPE, 9), + (MAX_RESULTS, 0), + (NEXT_TOKEN, 0), + ), ) -GET_DATA_AUTOMATION_LIBRARY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#GetDataAutomationLibraryInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#GetDataAutomationLibraryRequest", - ) - ], - members={ - "libraryArn": { - "target": DATA_AUTOMATION_LIBRARY_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, +VOCABULARY_ENTITY_SUMMARY: StaticSchema = ( + 18, + n0, + _VES, + 0, + (_eIn, _d, _l, _nOP, _lMT), + ( + (ENTITY_ID, 0), + (ENTITY_DESCRIPTION, 0), + (LANGUAGE, 0), + (7, 0), + (DATE_TIMESTAMP, 0), + ), ) -ENTITY_METADATA = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#EntityMetadata"), - shape_type=ShapeType.STRING, +DATA_AUTOMATION_LIBRARY_ENTITY_SUMMARY: StaticSchema = ( + 19, + n0, + _DALES, + 0, + (_vo,), + ((VOCABULARY_ENTITY_SUMMARY, 0),), +) + +DATA_AUTOMATION_LIBRARY_ENTITY_SUMMARIES: StaticSchema = ( + 16, + n0, + _DALESa, + 0, + (_me,), + ((DATA_AUTOMATION_LIBRARY_ENTITY_SUMMARY, 0),), +) + +LIST_DATA_AUTOMATION_LIBRARY_ENTITIES_OUTPUT: StaticSchema = ( + 18, + n0, + _LDALEO, + {_sSI: _cLDALERo, _smit: None}, + (_ent, _nT), + ((DATA_AUTOMATION_LIBRARY_ENTITY_SUMMARIES, 0), (NEXT_TOKEN, 0)), +) + +LIST_DATA_AUTOMATION_LIBRARY_ENTITIES: StaticOperationSchema = ( + 23, + n0, + _LDALE, + { + _smith: MappingProxyType( + { + "code": 200, + "method": "POST", + "uri": "/data-automation-libraries/{libraryArn}/entityType/{entityType}/entities/", + } + ) + }, + LIST_DATA_AUTOMATION_LIBRARY_ENTITIES_INPUT, + LIST_DATA_AUTOMATION_LIBRARY_ENTITIES_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -ENTITY_TYPE_INFO = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#EntityTypeInfo"), - members={ - "entityType": { - "target": ENTITY_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "entityMetadata": {"target": ENTITY_METADATA}, - }, -) +TAGGABLE_RESOURCE_ARN: StaticSchema = (3, n0, _TRA, 0) -ENTITY_TYPE_INFO_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#EntityTypeInfoList"), - shape_type=ShapeType.LIST, - members={"member": {"target": ENTITY_TYPE_INFO}}, -) - -DATA_AUTOMATION_LIBRARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#DataAutomationLibrary"), - members={ - "libraryArn": { - "target": DATA_AUTOMATION_LIBRARY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "creationTime": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "libraryName": { - "target": DATA_AUTOMATION_LIBRARY_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "libraryDescription": {"target": DATA_AUTOMATION_LIBRARY_DESCRIPTION}, - "status": { - "target": DATA_AUTOMATION_LIBRARY_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "entityTypes": {"target": ENTITY_TYPE_INFO_LIST}, - "kmsKeyId": {"target": KMS_KEY_ID}, - "kmsEncryptionContext": {"target": KMS_ENCRYPTION_CONTEXT}, - }, +LIST_TAGS_FOR_RESOURCE_INPUT: StaticSchema = ( + 18, + n0, + _LTFRI, + {_sSI: _cLTFRR, _sm: None}, + (_rARN,), + ((TAGGABLE_RESOURCE_ARN, 1),), ) -GET_DATA_AUTOMATION_LIBRARY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#GetDataAutomationLibraryOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#GetDataAutomationLibraryResponse", - ) - ], - members={"library": {"target": DATA_AUTOMATION_LIBRARY}}, -) - -GET_DATA_AUTOMATION_LIBRARY = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#GetDataAutomationLibrary"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "POST", - "uri": "/data-automation-libraries/{libraryArn}/", - } - ), - ) - ], +LIST_TAGS_FOR_RESOURCE_OUTPUT: StaticSchema = ( + 18, + n0, + _LTFRO, + {_sSI: _cLTFRRo, _smit: None}, + (_t,), + ((TAG_LIST, 0),), ) -LIST_DATA_AUTOMATION_LIBRARIES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#ListDataAutomationLibrariesInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#ListDataAutomationLibrariesRequest", +LIST_TAGS_FOR_RESOURCE: StaticOperationSchema = ( + 23, + n0, + _LTFR, + { + _smith: MappingProxyType( + {"code": 200, "method": "POST", "uri": "/listTagsForResource"} ) - ], - members={ - "maxResults": {"target": MAX_RESULTS}, - "nextToken": {"target": NEXT_TOKEN}, - "projectFilter": {"target": DATA_AUTOMATION_PROJECT_FILTER}, - }, -) - -DATA_AUTOMATION_LIBRARY_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#DataAutomationLibrarySummary"), - members={ - "libraryArn": { - "target": DATA_AUTOMATION_LIBRARY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "libraryName": {"target": DATA_AUTOMATION_LIBRARY_NAME}, - "creationTime": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, }, + LIST_TAGS_FOR_RESOURCE_INPUT, + LIST_TAGS_FOR_RESOURCE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -DATA_AUTOMATION_LIBRARY_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#DataAutomationLibrarySummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": DATA_AUTOMATION_LIBRARY_SUMMARY}}, -) - -LIST_DATA_AUTOMATION_LIBRARIES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#ListDataAutomationLibrariesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#ListDataAutomationLibrariesResponse", - ) - ], - members={ - "libraries": {"target": DATA_AUTOMATION_LIBRARY_SUMMARIES}, - "nextToken": {"target": NEXT_TOKEN}, - }, +TAG_RESOURCE_INPUT: StaticSchema = ( + 18, + n0, + _TRI, + {_sSI: _cTRR, _sm: None}, + (_rARN, _t), + ((TAGGABLE_RESOURCE_ARN, 1), (TAG_LIST, 1)), +) + +TAG_RESOURCE_OUTPUT: StaticSchema = (18, n0, _TRO, {_sSI: _cTRRo, _smit: None}) + +TAG_RESOURCE: StaticOperationSchema = ( + 23, + n0, + _TR, + {_smith: MappingProxyType({"code": 200, "method": "POST", "uri": "/tagResource"})}, + TAG_RESOURCE_INPUT, + TAG_RESOURCE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -LIST_DATA_AUTOMATION_LIBRARIES = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#ListDataAutomationLibraries"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "POST", "uri": "/data-automation-libraries/"} - ), - ) - ], -) +TAG_KEY_LIST: StaticSchema = (16, n0, _TKL, 0, (_me,), ((TAG_KEY, 0),)) -UPDATE_DATA_AUTOMATION_LIBRARY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#UpdateDataAutomationLibraryInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#UpdateDataAutomationLibraryRequest", - ) - ], - members={ - "libraryArn": { - "target": DATA_AUTOMATION_LIBRARY_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "libraryDescription": {"target": DATA_AUTOMATION_LIBRARY_DESCRIPTION}, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - }, +UNTAG_RESOURCE_INPUT: StaticSchema = ( + 18, + n0, + _URI, + {_sSI: _cURR, _sm: None}, + (_rARN, _tK), + ((TAGGABLE_RESOURCE_ARN, 1), (TAG_KEY_LIST, 1)), ) -UPDATE_DATA_AUTOMATION_LIBRARY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#UpdateDataAutomationLibraryOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#UpdateDataAutomationLibraryResponse", - ) - ], - members={ - "libraryArn": {"target": DATA_AUTOMATION_LIBRARY_ARN}, - "status": {"target": DATA_AUTOMATION_LIBRARY_STATUS}, - }, -) +UNTAG_RESOURCE_OUTPUT: StaticSchema = (18, n0, _URO, {_sSI: _cURRo, _smit: None}) -UPDATE_DATA_AUTOMATION_LIBRARY = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#UpdateDataAutomationLibrary"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "PUT", - "uri": "/data-automation-libraries/{libraryArn}/", - } - ), +UNTAG_RESOURCE: StaticOperationSchema = ( + 23, + n0, + _UR, + { + _smith: MappingProxyType( + {"code": 200, "method": "POST", "uri": "/untagResource"} ) - ], -) - -BLUEPRINT_ITEM = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#BlueprintItem"), - members={ - "blueprintArn": { - "target": BLUEPRINT_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "blueprintVersion": {"target": BLUEPRINT_VERSION}, - "blueprintStage": {"target": BLUEPRINT_STAGE}, - }, -) - -BLUEPRINT_ITEMS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#BlueprintItems"), - shape_type=ShapeType.LIST, - members={"member": {"target": BLUEPRINT_ITEM}}, -) - -FALLBACK_BLUEPRINT_ITEMS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#FallbackBlueprintItems"), - shape_type=ShapeType.LIST, - members={"member": {"target": BLUEPRINT_ITEM}}, -) - -DOCUMENT_CUSTOM_OUTPUT_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#DocumentCustomOutputConfiguration"), - members={"fallbackBlueprints": {"target": FALLBACK_BLUEPRINT_ITEMS}}, -) - -CUSTOM_OUTPUT_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#CustomOutputConfiguration"), - members={ - "blueprints": {"target": BLUEPRINT_ITEMS}, - "document": {"target": DOCUMENT_CUSTOM_OUTPUT_CONFIGURATION}, - }, -) - -DATA_AUTOMATION_LIBRARY_ITEM = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#DataAutomationLibraryItem"), - members={ - "libraryArn": { - "target": DATA_AUTOMATION_LIBRARY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } }, -) - -DATA_AUTOMATION_LIBRARY_ITEMS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#DataAutomationLibraryItems"), - shape_type=ShapeType.LIST, - members={"member": {"target": DATA_AUTOMATION_LIBRARY_ITEM}}, -) - -DATA_AUTOMATION_LIBRARY_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockdataautomation#DataAutomationLibraryConfiguration" + UNTAG_RESOURCE_INPUT, + UNTAG_RESOURCE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, ), - members={"libraries": {"target": DATA_AUTOMATION_LIBRARY_ITEMS}}, -) - -AUDIO_GENERATIVE_OUTPUT_LANGUAGE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#AudioGenerativeOutputLanguage"), - shape_type=ShapeType.ENUM, - members={"DEFAULT": {"target": UNIT}, "EN": {"target": UNIT}}, -) - -AUDIO_INPUT_LANGUAGES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#AudioInputLanguages"), - shape_type=ShapeType.LIST, - members={"member": {"target": LANGUAGE}}, -) - -AUDIO_LANGUAGE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#AudioLanguageConfiguration"), - members={ - "inputLanguages": {"target": AUDIO_INPUT_LANGUAGES}, - "generativeOutputLanguage": {"target": AUDIO_GENERATIVE_OUTPUT_LANGUAGE}, - "identifyMultipleLanguages": {"target": BOOLEAN}, - }, -) - -STATE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#State"), - shape_type=ShapeType.ENUM, - members={"ENABLED": {"target": UNIT}, "DISABLED": {"target": UNIT}}, -) - -MODALITY_PROCESSING_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#ModalityProcessingConfiguration"), - members={"state": {"target": STATE}}, -) - -SENSITIVE_DATA_DETECTION_MODE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#SensitiveDataDetectionMode"), - shape_type=ShapeType.ENUM, - members={ - "DETECTION": {"target": UNIT}, - "DETECTION_AND_REDACTION": {"target": UNIT}, - }, ) -SENSITIVE_DATA_DETECTION_SCOPE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#SensitiveDataDetectionScopeType"), - shape_type=ShapeType.ENUM, - members={"STANDARD": {"target": UNIT}, "CUSTOM": {"target": UNIT}}, -) - -SENSITIVE_DATA_DETECTION_SCOPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#SensitiveDataDetectionScope"), - shape_type=ShapeType.LIST, - members={"member": {"target": SENSITIVE_DATA_DETECTION_SCOPE_TYPE}}, -) - -PII_ENTITY_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#PIIEntityType"), - shape_type=ShapeType.ENUM, - members={ - "ALL": {"target": UNIT}, - "ADDRESS": {"target": UNIT}, - "AGE": {"target": UNIT}, - "NAME": {"target": UNIT}, - "EMAIL": {"target": UNIT}, - "PHONE": {"target": UNIT}, - "USERNAME": {"target": UNIT}, - "PASSWORD": {"target": UNIT}, - "DRIVER_ID": {"target": UNIT}, - "LICENSE_PLATE": {"target": UNIT}, - "VEHICLE_IDENTIFICATION_NUMBER": {"target": UNIT}, - "CREDIT_DEBIT_CARD_CVV": {"target": UNIT}, - "CREDIT_DEBIT_CARD_EXPIRY": {"target": UNIT}, - "CREDIT_DEBIT_CARD_NUMBER": {"target": UNIT}, - "PIN": {"target": UNIT}, - "INTERNATIONAL_BANK_ACCOUNT_NUMBER": {"target": UNIT}, - "SWIFT_CODE": {"target": UNIT}, - "IP_ADDRESS": {"target": UNIT}, - "MAC_ADDRESS": {"target": UNIT}, - "URL": {"target": UNIT}, - "AWS_ACCESS_KEY": {"target": UNIT}, - "AWS_SECRET_KEY": {"target": UNIT}, - "US_BANK_ACCOUNT_NUMBER": {"target": UNIT}, - "US_BANK_ROUTING_NUMBER": {"target": UNIT}, - "US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER": {"target": UNIT}, - "US_PASSPORT_NUMBER": {"target": UNIT}, - "US_SOCIAL_SECURITY_NUMBER": {"target": UNIT}, - "CA_HEALTH_NUMBER": {"target": UNIT}, - "CA_SOCIAL_INSURANCE_NUMBER": {"target": UNIT}, - "UK_NATIONAL_HEALTH_SERVICE_NUMBER": {"target": UNIT}, - "UK_NATIONAL_INSURANCE_NUMBER": {"target": UNIT}, - "UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER": {"target": UNIT}, - }, -) - -PII_ENTITY_TYPES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#PIIEntityTypes"), - shape_type=ShapeType.LIST, - members={"member": {"target": PII_ENTITY_TYPE}}, -) - -PII_REDACTION_MASK_MODE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#PIIRedactionMaskMode"), - shape_type=ShapeType.ENUM, - members={"PII": {"target": UNIT}, "ENTITY_TYPE": {"target": UNIT}}, -) - -PII_ENTITIES_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#PIIEntitiesConfiguration"), - members={ - "piiEntityTypes": {"target": PII_ENTITY_TYPES}, - "redactionMaskMode": {"target": PII_REDACTION_MASK_MODE}, - }, -) - -SENSITIVE_DATA_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#SensitiveDataConfiguration"), - members={ - "detectionMode": { - "target": SENSITIVE_DATA_DETECTION_MODE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "detectionScope": {"target": SENSITIVE_DATA_DETECTION_SCOPE}, - "piiEntitiesConfiguration": {"target": PII_ENTITIES_CONFIGURATION}, - }, -) - -AUDIO_OVERRIDE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#AudioOverrideConfiguration"), - members={ - "modalityProcessing": {"target": MODALITY_PROCESSING_CONFIGURATION}, - "languageConfiguration": {"target": AUDIO_LANGUAGE_CONFIGURATION}, - "sensitiveDataConfiguration": {"target": SENSITIVE_DATA_CONFIGURATION}, - }, -) - -SPLITTER_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#SplitterConfiguration"), - members={"state": {"target": STATE}}, -) - -DOCUMENT_OVERRIDE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#DocumentOverrideConfiguration"), - members={ - "splitter": {"target": SPLITTER_CONFIGURATION}, - "modalityProcessing": {"target": MODALITY_PROCESSING_CONFIGURATION}, - "sensitiveDataConfiguration": {"target": SENSITIVE_DATA_CONFIGURATION}, - }, -) - -IMAGE_OVERRIDE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#ImageOverrideConfiguration"), - members={ - "modalityProcessing": {"target": MODALITY_PROCESSING_CONFIGURATION}, - "sensitiveDataConfiguration": {"target": SENSITIVE_DATA_CONFIGURATION}, - }, -) - -DESIRED_MODALITY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#DesiredModality"), - shape_type=ShapeType.ENUM, - members={ - "IMAGE": {"target": UNIT}, - "DOCUMENT": {"target": UNIT}, - "AUDIO": {"target": UNIT}, - "VIDEO": {"target": UNIT}, - }, -) - -MODALITY_ROUTING_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#ModalityRoutingConfiguration"), - members={ - "jpeg": {"target": DESIRED_MODALITY}, - "png": {"target": DESIRED_MODALITY}, - "mp4": {"target": DESIRED_MODALITY}, - "mov": {"target": DESIRED_MODALITY}, - }, -) - -VIDEO_OVERRIDE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#VideoOverrideConfiguration"), - members={ - "modalityProcessing": {"target": MODALITY_PROCESSING_CONFIGURATION}, - "sensitiveDataConfiguration": {"target": SENSITIVE_DATA_CONFIGURATION}, - }, -) - -OVERRIDE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#OverrideConfiguration"), - members={ - "document": {"target": DOCUMENT_OVERRIDE_CONFIGURATION}, - "image": {"target": IMAGE_OVERRIDE_CONFIGURATION}, - "video": {"target": VIDEO_OVERRIDE_CONFIGURATION}, - "audio": {"target": AUDIO_OVERRIDE_CONFIGURATION}, - "modalityRouting": {"target": MODALITY_ROUTING_CONFIGURATION}, - }, -) - -DATA_AUTOMATION_PROJECT_DESCRIPTION = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#DataAutomationProjectDescription"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -DATA_AUTOMATION_PROJECT_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#DataAutomationProjectName"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -DATA_AUTOMATION_PROJECT_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#DataAutomationProjectType"), - shape_type=ShapeType.ENUM, - members={"ASYNC": {"target": UNIT}, "SYNC": {"target": UNIT}}, -) - -CHANNEL_LABELING_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#ChannelLabelingConfiguration"), - members={ - "state": { - "target": STATE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -SPEAKER_LABELING_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#SpeakerLabelingConfiguration"), - members={ - "state": { - "target": STATE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -TRANSCRIPT_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#TranscriptConfiguration"), - members={ - "speakerLabeling": {"target": SPEAKER_LABELING_CONFIGURATION}, - "channelLabeling": {"target": CHANNEL_LABELING_CONFIGURATION}, - }, -) - -AUDIO_EXTRACTION_CATEGORY_TYPE_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockdataautomation#AudioExtractionCategoryTypeConfiguration" - ), - members={"transcript": {"target": TRANSCRIPT_CONFIGURATION}}, -) - -AUDIO_EXTRACTION_CATEGORY_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#AudioExtractionCategoryType"), - shape_type=ShapeType.ENUM, - members={ - "AUDIO_CONTENT_MODERATION": {"target": UNIT}, - "TRANSCRIPT": {"target": UNIT}, - "TOPIC_CONTENT_MODERATION": {"target": UNIT}, - }, -) - -AUDIO_EXTRACTION_CATEGORY_TYPES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#AudioExtractionCategoryTypes"), - shape_type=ShapeType.LIST, - members={"member": {"target": AUDIO_EXTRACTION_CATEGORY_TYPE}}, -) - -AUDIO_EXTRACTION_CATEGORY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#AudioExtractionCategory"), - members={ - "state": { - "target": STATE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "types": {"target": AUDIO_EXTRACTION_CATEGORY_TYPES}, - "typeConfiguration": {"target": AUDIO_EXTRACTION_CATEGORY_TYPE_CONFIGURATION}, - }, -) - -AUDIO_STANDARD_EXTRACTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#AudioStandardExtraction"), - members={ - "category": { - "target": AUDIO_EXTRACTION_CATEGORY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -AUDIO_STANDARD_GENERATIVE_FIELD_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#AudioStandardGenerativeFieldType"), - shape_type=ShapeType.ENUM, - members={ - "AUDIO_SUMMARY": {"target": UNIT}, - "IAB": {"target": UNIT}, - "TOPIC_SUMMARY": {"target": UNIT}, - }, -) - -AUDIO_STANDARD_GENERATIVE_FIELD_TYPES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#AudioStandardGenerativeFieldTypes"), - shape_type=ShapeType.LIST, - members={"member": {"target": AUDIO_STANDARD_GENERATIVE_FIELD_TYPE}}, -) - -AUDIO_STANDARD_GENERATIVE_FIELD = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#AudioStandardGenerativeField"), - members={ - "state": { - "target": STATE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "types": {"target": AUDIO_STANDARD_GENERATIVE_FIELD_TYPES}, - }, -) - -AUDIO_STANDARD_OUTPUT_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#AudioStandardOutputConfiguration"), - members={ - "extraction": {"target": AUDIO_STANDARD_EXTRACTION}, - "generativeField": {"target": AUDIO_STANDARD_GENERATIVE_FIELD}, - }, -) - -DOCUMENT_BOUNDING_BOX = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#DocumentBoundingBox"), - members={ - "state": { - "target": STATE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -DOCUMENT_EXTRACTION_GRANULARITY_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#DocumentExtractionGranularityType"), - shape_type=ShapeType.ENUM, - members={ - "DOCUMENT": {"target": UNIT}, - "PAGE": {"target": UNIT}, - "ELEMENT": {"target": UNIT}, - "WORD": {"target": UNIT}, - "LINE": {"target": UNIT}, - }, -) - -DOCUMENT_EXTRACTION_GRANULARITY_TYPES = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockdataautomation#DocumentExtractionGranularityTypes" - ), - shape_type=ShapeType.LIST, - members={"member": {"target": DOCUMENT_EXTRACTION_GRANULARITY_TYPE}}, -) - -DOCUMENT_EXTRACTION_GRANULARITY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#DocumentExtractionGranularity"), - members={"types": {"target": DOCUMENT_EXTRACTION_GRANULARITY_TYPES}}, -) - -DOCUMENT_STANDARD_EXTRACTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#DocumentStandardExtraction"), - members={ - "granularity": { - "target": DOCUMENT_EXTRACTION_GRANULARITY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "boundingBox": { - "target": DOCUMENT_BOUNDING_BOX, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -DOCUMENT_STANDARD_GENERATIVE_FIELD = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#DocumentStandardGenerativeField"), - members={ - "state": { - "target": STATE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -DOCUMENT_OUTPUT_ADDITIONAL_FILE_FORMAT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockdataautomation#DocumentOutputAdditionalFileFormat" - ), - members={ - "state": { - "target": STATE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -DOCUMENT_OUTPUT_TEXT_FORMAT_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#DocumentOutputTextFormatType"), - shape_type=ShapeType.ENUM, - members={ - "PLAIN_TEXT": {"target": UNIT}, - "MARKDOWN": {"target": UNIT}, - "HTML": {"target": UNIT}, - "CSV": {"target": UNIT}, - }, -) - -DOCUMENT_OUTPUT_TEXT_FORMAT_TYPES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#DocumentOutputTextFormatTypes"), - shape_type=ShapeType.LIST, - members={"member": {"target": DOCUMENT_OUTPUT_TEXT_FORMAT_TYPE}}, -) - -DOCUMENT_OUTPUT_TEXT_FORMAT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#DocumentOutputTextFormat"), - members={"types": {"target": DOCUMENT_OUTPUT_TEXT_FORMAT_TYPES}}, -) - -DOCUMENT_OUTPUT_FORMAT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#DocumentOutputFormat"), - members={ - "textFormat": { - "target": DOCUMENT_OUTPUT_TEXT_FORMAT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "additionalFileFormat": { - "target": DOCUMENT_OUTPUT_ADDITIONAL_FILE_FORMAT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -DOCUMENT_STANDARD_OUTPUT_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockdataautomation#DocumentStandardOutputConfiguration" - ), - members={ - "extraction": {"target": DOCUMENT_STANDARD_EXTRACTION}, - "generativeField": {"target": DOCUMENT_STANDARD_GENERATIVE_FIELD}, - "outputFormat": {"target": DOCUMENT_OUTPUT_FORMAT}, - }, -) - -IMAGE_BOUNDING_BOX = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#ImageBoundingBox"), - members={ - "state": { - "target": STATE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -IMAGE_EXTRACTION_CATEGORY_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#ImageExtractionCategoryType"), - shape_type=ShapeType.ENUM, - members={ - "CONTENT_MODERATION": {"target": UNIT}, - "TEXT_DETECTION": {"target": UNIT}, - "LOGOS": {"target": UNIT}, - }, -) - -IMAGE_EXTRACTION_CATEGORY_TYPES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#ImageExtractionCategoryTypes"), - shape_type=ShapeType.LIST, - members={"member": {"target": IMAGE_EXTRACTION_CATEGORY_TYPE}}, -) - -IMAGE_EXTRACTION_CATEGORY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#ImageExtractionCategory"), - members={ - "state": { - "target": STATE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "types": {"target": IMAGE_EXTRACTION_CATEGORY_TYPES}, - }, -) - -IMAGE_STANDARD_EXTRACTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#ImageStandardExtraction"), - members={ - "category": { - "target": IMAGE_EXTRACTION_CATEGORY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "boundingBox": { - "target": IMAGE_BOUNDING_BOX, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -IMAGE_STANDARD_GENERATIVE_FIELD_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#ImageStandardGenerativeFieldType"), - shape_type=ShapeType.ENUM, - members={"IMAGE_SUMMARY": {"target": UNIT}, "IAB": {"target": UNIT}}, -) - -IMAGE_STANDARD_GENERATIVE_FIELD_TYPES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#ImageStandardGenerativeFieldTypes"), - shape_type=ShapeType.LIST, - members={"member": {"target": IMAGE_STANDARD_GENERATIVE_FIELD_TYPE}}, -) - -IMAGE_STANDARD_GENERATIVE_FIELD = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#ImageStandardGenerativeField"), - members={ - "state": { - "target": STATE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "types": {"target": IMAGE_STANDARD_GENERATIVE_FIELD_TYPES}, - }, -) - -IMAGE_STANDARD_OUTPUT_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#ImageStandardOutputConfiguration"), - members={ - "extraction": {"target": IMAGE_STANDARD_EXTRACTION}, - "generativeField": {"target": IMAGE_STANDARD_GENERATIVE_FIELD}, - }, -) - -VIDEO_BOUNDING_BOX = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#VideoBoundingBox"), - members={ - "state": { - "target": STATE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -VIDEO_EXTRACTION_CATEGORY_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#VideoExtractionCategoryType"), - shape_type=ShapeType.ENUM, - members={ - "CONTENT_MODERATION": {"target": UNIT}, - "TEXT_DETECTION": {"target": UNIT}, - "TRANSCRIPT": {"target": UNIT}, - "LOGOS": {"target": UNIT}, - }, -) - -VIDEO_EXTRACTION_CATEGORY_TYPES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#VideoExtractionCategoryTypes"), - shape_type=ShapeType.LIST, - members={"member": {"target": VIDEO_EXTRACTION_CATEGORY_TYPE}}, -) - -VIDEO_EXTRACTION_CATEGORY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#VideoExtractionCategory"), - members={ - "state": { - "target": STATE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "types": {"target": VIDEO_EXTRACTION_CATEGORY_TYPES}, - }, -) - -VIDEO_STANDARD_EXTRACTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#VideoStandardExtraction"), - members={ - "category": { - "target": VIDEO_EXTRACTION_CATEGORY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "boundingBox": { - "target": VIDEO_BOUNDING_BOX, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -VIDEO_STANDARD_GENERATIVE_FIELD_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#VideoStandardGenerativeFieldType"), - shape_type=ShapeType.ENUM, - members={ - "VIDEO_SUMMARY": {"target": UNIT}, - "IAB": {"target": UNIT}, - "CHAPTER_SUMMARY": {"target": UNIT}, - }, -) - -VIDEO_STANDARD_GENERATIVE_FIELD_TYPES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#VideoStandardGenerativeFieldTypes"), - shape_type=ShapeType.LIST, - members={"member": {"target": VIDEO_STANDARD_GENERATIVE_FIELD_TYPE}}, -) - -VIDEO_STANDARD_GENERATIVE_FIELD = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#VideoStandardGenerativeField"), - members={ - "state": { - "target": STATE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "types": {"target": VIDEO_STANDARD_GENERATIVE_FIELD_TYPES}, - }, -) - -VIDEO_STANDARD_OUTPUT_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#VideoStandardOutputConfiguration"), - members={ - "extraction": {"target": VIDEO_STANDARD_EXTRACTION}, - "generativeField": {"target": VIDEO_STANDARD_GENERATIVE_FIELD}, - }, -) - -STANDARD_OUTPUT_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#StandardOutputConfiguration"), - members={ - "document": {"target": DOCUMENT_STANDARD_OUTPUT_CONFIGURATION}, - "image": {"target": IMAGE_STANDARD_OUTPUT_CONFIGURATION}, - "video": {"target": VIDEO_STANDARD_OUTPUT_CONFIGURATION}, - "audio": {"target": AUDIO_STANDARD_OUTPUT_CONFIGURATION}, - }, -) - -CREATE_DATA_AUTOMATION_PROJECT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#CreateDataAutomationProjectInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#CreateDataAutomationProjectRequest", - ) - ], - members={ - "projectName": { - "target": DATA_AUTOMATION_PROJECT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "projectDescription": {"target": DATA_AUTOMATION_PROJECT_DESCRIPTION}, - "projectStage": {"target": DATA_AUTOMATION_PROJECT_STAGE}, - "projectType": { - "target": DATA_AUTOMATION_PROJECT_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="ASYNC")], - }, - "standardOutputConfiguration": { - "target": STANDARD_OUTPUT_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "customOutputConfiguration": {"target": CUSTOM_OUTPUT_CONFIGURATION}, - "overrideConfiguration": {"target": OVERRIDE_CONFIGURATION}, - "dataAutomationLibraryConfiguration": { - "target": DATA_AUTOMATION_LIBRARY_CONFIGURATION - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "encryptionConfiguration": {"target": ENCRYPTION_CONFIGURATION}, - "tags": {"target": TAG_LIST}, - }, -) - -DATA_AUTOMATION_PROJECT_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#DataAutomationProjectStatus"), - shape_type=ShapeType.ENUM, - members={ - "COMPLETED": {"target": UNIT}, - "IN_PROGRESS": {"target": UNIT}, - "FAILED": {"target": UNIT}, - }, -) - -CREATE_DATA_AUTOMATION_PROJECT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#CreateDataAutomationProjectOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#CreateDataAutomationProjectResponse", - ) - ], - members={ - "projectArn": { - "target": DATA_AUTOMATION_PROJECT_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "projectStage": {"target": DATA_AUTOMATION_PROJECT_STAGE}, - "status": {"target": DATA_AUTOMATION_PROJECT_STATUS}, - }, -) - -CREATE_DATA_AUTOMATION_PROJECT = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#CreateDataAutomationProject"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 201, "method": "PUT", "uri": "/data-automation-projects/"} - ), - ) - ], -) - -DELETE_DATA_AUTOMATION_PROJECT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#DeleteDataAutomationProjectInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#DeleteDataAutomationProjectRequest", - ) - ], - members={ - "projectArn": { - "target": DATA_AUTOMATION_PROJECT_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -DELETE_DATA_AUTOMATION_PROJECT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#DeleteDataAutomationProjectOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#DeleteDataAutomationProjectResponse", - ) - ], - members={ - "projectArn": { - "target": DATA_AUTOMATION_PROJECT_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": {"target": DATA_AUTOMATION_PROJECT_STATUS}, - }, -) - -DELETE_DATA_AUTOMATION_PROJECT = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#DeleteDataAutomationProject"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "DELETE", - "uri": "/data-automation-projects/{projectArn}/", - } - ), - ) - ], -) - -GET_DATA_AUTOMATION_PROJECT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#GetDataAutomationProjectInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#GetDataAutomationProjectRequest", - ) - ], - members={ - "projectArn": { - "target": DATA_AUTOMATION_PROJECT_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "projectStage": {"target": DATA_AUTOMATION_PROJECT_STAGE}, - }, -) - -DATA_AUTOMATION_PROJECT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#DataAutomationProject"), - members={ - "projectArn": { - "target": DATA_AUTOMATION_PROJECT_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "creationTime": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastModifiedTime": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "projectName": { - "target": DATA_AUTOMATION_PROJECT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "projectStage": {"target": DATA_AUTOMATION_PROJECT_STAGE}, - "projectType": {"target": DATA_AUTOMATION_PROJECT_TYPE}, - "projectDescription": {"target": DATA_AUTOMATION_PROJECT_DESCRIPTION}, - "standardOutputConfiguration": {"target": STANDARD_OUTPUT_CONFIGURATION}, - "customOutputConfiguration": {"target": CUSTOM_OUTPUT_CONFIGURATION}, - "overrideConfiguration": {"target": OVERRIDE_CONFIGURATION}, - "dataAutomationLibraryConfiguration": { - "target": DATA_AUTOMATION_LIBRARY_CONFIGURATION - }, - "status": { - "target": DATA_AUTOMATION_PROJECT_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "kmsKeyId": {"target": KMS_KEY_ID}, - "kmsEncryptionContext": {"target": KMS_ENCRYPTION_CONTEXT}, - }, -) - -GET_DATA_AUTOMATION_PROJECT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#GetDataAutomationProjectOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#GetDataAutomationProjectResponse", - ) - ], - members={ - "project": { - "target": DATA_AUTOMATION_PROJECT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -GET_DATA_AUTOMATION_PROJECT = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#GetDataAutomationProject"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "POST", - "uri": "/data-automation-projects/{projectArn}/", - } - ), - ) - ], -) - -BLUEPRINT_FILTER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#BlueprintFilter"), - members={ - "blueprintArn": { - "target": BLUEPRINT_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "blueprintVersion": {"target": BLUEPRINT_VERSION}, - "blueprintStage": {"target": BLUEPRINT_STAGE}, - }, -) - -DATA_AUTOMATION_LIBRARY_FILTER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#DataAutomationLibraryFilter"), - members={ - "libraryArn": { - "target": DATA_AUTOMATION_LIBRARY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -DATA_AUTOMATION_PROJECT_STAGE_FILTER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#DataAutomationProjectStageFilter"), - shape_type=ShapeType.ENUM, - members={ - "DEVELOPMENT": {"target": UNIT}, - "LIVE": {"target": UNIT}, - "ALL": {"target": UNIT}, - }, -) - -LIST_DATA_AUTOMATION_PROJECTS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#ListDataAutomationProjectsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#ListDataAutomationProjectsRequest", - ) - ], - members={ - "maxResults": {"target": MAX_RESULTS}, - "nextToken": {"target": NEXT_TOKEN}, - "projectStageFilter": {"target": DATA_AUTOMATION_PROJECT_STAGE_FILTER}, - "blueprintFilter": {"target": BLUEPRINT_FILTER}, - "resourceOwner": {"target": RESOURCE_OWNER}, - "libraryFilter": {"target": DATA_AUTOMATION_LIBRARY_FILTER}, - }, -) - -DATA_AUTOMATION_PROJECT_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#DataAutomationProjectSummary"), - members={ - "projectArn": { - "target": DATA_AUTOMATION_PROJECT_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "projectStage": {"target": DATA_AUTOMATION_PROJECT_STAGE}, - "projectType": {"target": DATA_AUTOMATION_PROJECT_TYPE}, - "projectName": {"target": DATA_AUTOMATION_PROJECT_NAME}, - "creationTime": { - "target": DATE_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -DATA_AUTOMATION_PROJECT_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#DataAutomationProjectSummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": DATA_AUTOMATION_PROJECT_SUMMARY}}, -) - -LIST_DATA_AUTOMATION_PROJECTS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#ListDataAutomationProjectsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#ListDataAutomationProjectsResponse", - ) - ], - members={ - "projects": { - "target": DATA_AUTOMATION_PROJECT_SUMMARIES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": NEXT_TOKEN}, - }, -) - -LIST_DATA_AUTOMATION_PROJECTS = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#ListDataAutomationProjects"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "POST", "uri": "/data-automation-projects/"} - ), - ) - ], -) - -UPDATE_DATA_AUTOMATION_PROJECT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#UpdateDataAutomationProjectInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#UpdateDataAutomationProjectRequest", - ) - ], - members={ - "projectArn": { - "target": DATA_AUTOMATION_PROJECT_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "projectStage": {"target": DATA_AUTOMATION_PROJECT_STAGE}, - "projectDescription": {"target": DATA_AUTOMATION_PROJECT_DESCRIPTION}, - "standardOutputConfiguration": { - "target": STANDARD_OUTPUT_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "customOutputConfiguration": {"target": CUSTOM_OUTPUT_CONFIGURATION}, - "overrideConfiguration": {"target": OVERRIDE_CONFIGURATION}, - "dataAutomationLibraryConfiguration": { - "target": DATA_AUTOMATION_LIBRARY_CONFIGURATION - }, - "encryptionConfiguration": {"target": ENCRYPTION_CONFIGURATION}, - }, -) - -UPDATE_DATA_AUTOMATION_PROJECT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#UpdateDataAutomationProjectOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#UpdateDataAutomationProjectResponse", - ) - ], - members={ - "projectArn": { - "target": DATA_AUTOMATION_PROJECT_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "projectStage": {"target": DATA_AUTOMATION_PROJECT_STAGE}, - "status": {"target": DATA_AUTOMATION_PROJECT_STATUS}, - }, -) - -UPDATE_DATA_AUTOMATION_PROJECT = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#UpdateDataAutomationProject"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "PUT", - "uri": "/data-automation-projects/{projectArn}/", - } - ), - ) - ], -) - -GET_DATA_AUTOMATION_LIBRARY_ENTITY_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockdataautomation#GetDataAutomationLibraryEntityInput" - ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#GetDataAutomationLibraryEntityRequest", - ) - ], - members={ - "libraryArn": { - "target": DATA_AUTOMATION_LIBRARY_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "entityType": { - "target": ENTITY_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "entityId": { - "target": ENTITY_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -VOCABULARY_ENTITY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#VocabularyEntity"), - members={ - "entityId": {"target": ENTITY_ID}, - "description": {"target": ENTITY_DESCRIPTION}, - "language": {"target": LANGUAGE}, - "phrases": {"target": PHRASE_LIST}, - "lastModifiedTime": {"target": DATE_TIMESTAMP}, - }, -) - -ENTITY_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#EntityDetails"), - shape_type=ShapeType.UNION, - members={"vocabulary": {"target": VOCABULARY_ENTITY}}, -) - -GET_DATA_AUTOMATION_LIBRARY_ENTITY_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockdataautomation#GetDataAutomationLibraryEntityOutput" - ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#GetDataAutomationLibraryEntityResponse", - ) - ], - members={"entity": {"target": ENTITY_DETAILS}}, -) - -GET_DATA_AUTOMATION_LIBRARY_ENTITY = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#GetDataAutomationLibraryEntity"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "POST", - "uri": "/data-automation-libraries/{libraryArn}/entityType/{entityType}/entities/{entityId}", - } - ), - ) - ], -) - -LIST_DATA_AUTOMATION_LIBRARY_ENTITIES_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockdataautomation#ListDataAutomationLibraryEntitiesInput" - ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#ListDataAutomationLibraryEntitiesRequest", - ) - ], - members={ - "libraryArn": { - "target": DATA_AUTOMATION_LIBRARY_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "entityType": { - "target": ENTITY_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "maxResults": {"target": MAX_RESULTS}, - "nextToken": {"target": NEXT_TOKEN}, - }, -) - -VOCABULARY_ENTITY_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#VocabularyEntitySummary"), - members={ - "entityId": {"target": ENTITY_ID}, - "description": {"target": ENTITY_DESCRIPTION}, - "language": {"target": LANGUAGE}, - "numOfPhrases": {"target": INTEGER}, - "lastModifiedTime": {"target": DATE_TIMESTAMP}, - }, -) - -DATA_AUTOMATION_LIBRARY_ENTITY_SUMMARY = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockdataautomation#DataAutomationLibraryEntitySummary" - ), - shape_type=ShapeType.UNION, - members={"vocabulary": {"target": VOCABULARY_ENTITY_SUMMARY}}, -) - -DATA_AUTOMATION_LIBRARY_ENTITY_SUMMARIES = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockdataautomation#DataAutomationLibraryEntitySummaries" - ), - shape_type=ShapeType.LIST, - members={"member": {"target": DATA_AUTOMATION_LIBRARY_ENTITY_SUMMARY}}, -) - -LIST_DATA_AUTOMATION_LIBRARY_ENTITIES_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockdataautomation#ListDataAutomationLibraryEntitiesOutput" - ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#ListDataAutomationLibraryEntitiesResponse", - ) - ], - members={ - "entities": {"target": DATA_AUTOMATION_LIBRARY_ENTITY_SUMMARIES}, - "nextToken": {"target": NEXT_TOKEN}, - }, -) - -LIST_DATA_AUTOMATION_LIBRARY_ENTITIES = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#ListDataAutomationLibraryEntities"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "POST", - "uri": "/data-automation-libraries/{libraryArn}/entityType/{entityType}/entities/", - } - ), - ) - ], -) - -TAGGABLE_RESOURCE_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#TaggableResourceArn"), - shape_type=ShapeType.STRING, -) - -LIST_TAGS_FOR_RESOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#ListTagsForResourceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#ListTagsForResourceRequest", - ) - ], - members={ - "resourceARN": { - "target": TAGGABLE_RESOURCE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -LIST_TAGS_FOR_RESOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#ListTagsForResourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#ListTagsForResourceResponse", - ) - ], - members={"tags": {"target": TAG_LIST}}, -) - -LIST_TAGS_FOR_RESOURCE = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#ListTagsForResource"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "POST", "uri": "/listTagsForResource"} - ), - ) - ], -) - -TAG_RESOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#TagResourceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#TagResourceRequest", - ) - ], - members={ - "resourceARN": { - "target": TAGGABLE_RESOURCE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "tags": { - "target": TAG_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -TAG_RESOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#TagResourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#TagResourceResponse", - ) - ], -) - -TAG_RESOURCE = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#TagResource"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "POST", "uri": "/tagResource"} - ), - ) - ], -) - -TAG_KEY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#TagKeyList"), - shape_type=ShapeType.LIST, - members={"member": {"target": TAG_KEY}}, -) - -UNTAG_RESOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#UntagResourceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#UntagResourceRequest", - ) - ], - members={ - "resourceARN": { - "target": TAGGABLE_RESOURCE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "tagKeys": { - "target": TAG_KEY_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -UNTAG_RESOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockdataautomation#UntagResourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockdataautomation#UntagResourceResponse", - ) - ], -) - -UNTAG_RESOURCE = Schema( - id=ShapeID("com.amazonaws.bedrockdataautomation#UntagResource"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "POST", "uri": "/untagResource"} - ), - ) - ], -) - -AMAZON_BEDROCK_KEYSTONE_BUILD_TIME_SERVICE = Schema( - id=ShapeID( - "com.amazonaws.bedrockdataautomation#AmazonBedrockKeystoneBuildTimeService" - ), - shape_type=ShapeType.SERVICE, - traits=[ - Trait.new( - id=ShapeID("aws.auth#sigv4"), value=MappingProxyType({"name": "bedrock"}) - ), - Trait.new( - id=ShapeID("smithy.rules#endpointBdd"), - value=MappingProxyType( - { - "version": "1.1", - "parameters": MappingProxyType( - { - "Region": MappingProxyType( - { - "builtIn": "AWS::Region", - "required": False, - "documentation": "The AWS region used to dispatch the request.", - "type": "string", - } - ), - "UseDualStack": MappingProxyType( - { - "builtIn": "AWS::UseDualStack", - "required": True, - "default": False, - "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", - "type": "boolean", - } - ), - "UseFIPS": MappingProxyType( - { - "builtIn": "AWS::UseFIPS", - "required": True, - "default": False, - "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", - "type": "boolean", - } - ), - "Endpoint": MappingProxyType( - { - "builtIn": "SDK::Endpoint", - "required": False, - "documentation": "Override the endpoint used to send this request", - "type": "string", - } - ), - } - ), - "conditions": ( - MappingProxyType( +AMAZON_BEDROCK_KEYSTONE_BUILD_TIME_SERVICE: StaticSchema = ( + 21, + n0, + _ABKBTS, + { + _aw: MappingProxyType({"name": "bedrock"}), + _sB: MappingProxyType( + { + "version": "1.1", + "parameters": MappingProxyType( + { + "Region": MappingProxyType( { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "Endpoint"}),), + "builtIn": "AWS::Region", + "required": False, + "documentation": "The AWS region used to dispatch the request.", + "type": "string", } ), - MappingProxyType( + "UseDualStack": MappingProxyType( { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "Region"}),), + "builtIn": "AWS::UseDualStack", + "required": True, + "default": False, + "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", + "type": "boolean", } ), - MappingProxyType( + "UseFIPS": MappingProxyType( { - "fn": "aws.partition", - "argv": (MappingProxyType({"ref": "Region"}),), - "assign": "PartitionResult", + "builtIn": "AWS::UseFIPS", + "required": True, + "default": False, + "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", + "type": "boolean", } ), - MappingProxyType( + "Endpoint": MappingProxyType( { - "fn": "booleanEquals", - "argv": (MappingProxyType({"ref": "UseFIPS"}), True), - } - ), - MappingProxyType( - { - "fn": "booleanEquals", - "argv": ( - MappingProxyType({"ref": "UseDualStack"}), - True, - ), - } - ), - MappingProxyType( - { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "supportsDualStack", - ), - } - ), - True, - ), - } - ), - MappingProxyType( - { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "supportsFIPS", - ), - } - ), - True, - ), + "builtIn": "SDK::Endpoint", + "required": False, + "documentation": "Override the endpoint used to send this request", + "type": "string", } ), + } + ), + "conditions": ( + MappingProxyType( + { + "fn": "isSet", + "argv": (MappingProxyType({"ref": "Endpoint"}),), + } ), - "results": ( - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: FIPS and custom endpoint are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": MappingProxyType({"ref": "Endpoint"}), - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://bedrock-data-automation-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "FIPS and DualStack are enabled, but this partition does not support one or both", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://bedrock-data-automation-fips.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "FIPS is enabled but this partition does not support FIPS", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + MappingProxyType( + {"fn": "isSet", "argv": (MappingProxyType({"ref": "Region"}),)} + ), + MappingProxyType( + { + "fn": "aws.partition", + "argv": (MappingProxyType({"ref": "Region"}),), + "assign": "PartitionResult", + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": (MappingProxyType({"ref": "UseFIPS"}), True), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": (MappingProxyType({"ref": "UseDualStack"}), True), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( { - "url": "https://bedrock-data-automation.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "supportsDualStack", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "DualStack is enabled but this partition does not support DualStack", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + True, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( { - "url": "https://bedrock-data-automation.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "supportsFIPS", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: Missing Region", - "type": "error", - } - ), + True, + ), + } + ), + ), + "results": ( + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: FIPS and custom endpoint are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": MappingProxyType({"ref": "Endpoint"}), + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://bedrock-data-automation-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS and DualStack are enabled, but this partition does not support one or both", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://bedrock-data-automation-fips.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS is enabled but this partition does not support FIPS", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://bedrock-data-automation.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } ), - "root": 2, - "nodeCount": 13, - "nodes": "/////wAAAAH/////AAAAAAAAAAwAAAADAAAAAQAAAAQF9eELAAAAAgAAAAUF9eELAAAAAwAAAAgAAAAGAAAABAAAAAcF9eEKAAAABQX14QgF9eEJAAAABAAAAAoAAAAJAAAABgX14QYF9eEHAAAABQAAAAsF9eEFAAAABgX14QQF9eEFAAAAAwX14QEAAAANAAAABAX14QIF9eED", - } - ), + MappingProxyType( + { + "conditions": (), + "error": "DualStack is enabled but this partition does not support DualStack", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://bedrock-data-automation.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Missing Region", + "type": "error", + } + ), + ), + "root": 2, + "nodeCount": 13, + "nodes": "/////wAAAAH/////AAAAAAAAAAwAAAADAAAAAQAAAAQF9eELAAAAAgAAAAUF9eELAAAAAwAAAAgAAAAGAAAABAAAAAcF9eEKAAAABQX14QgF9eEJAAAABAAAAAoAAAAJAAAABgX14QYF9eEHAAAABQAAAAsF9eEFAAAABgX14QQF9eEFAAAAAwX14QEAAAANAAAABAX14QIF9eED", + } ), - Trait.new( - id=ShapeID("aws.api#service"), - value=MappingProxyType( - { - "sdkId": "Bedrock Data Automation", - "arnNamespace": "bedrock", - "endpointPrefix": "bedrock-data-automation", - "cloudTrailEventSource": "bedrock.amazonaws.com", - } - ), + _aws: MappingProxyType( + { + "sdkId": "Bedrock Data Automation", + "arnNamespace": "bedrock", + "endpointPrefix": "bedrock-data-automation", + "cloudTrailEventSource": "bedrock.amazonaws.com", + } ), - Trait.new(id=ShapeID("aws.protocols#restJson1")), - ], + _aJ: None, + }, ) diff --git a/clients/aws-sdk-bedrock-data-automation/src/aws_sdk_bedrock_data_automation/client.py b/clients/aws-sdk-bedrock-data-automation/src/aws_sdk_bedrock_data_automation/client.py index 96092f43..55434898 100644 --- a/clients/aws-sdk-bedrock-data-automation/src/aws_sdk_bedrock_data_automation/client.py +++ b/clients/aws-sdk-bedrock-data-automation/src/aws_sdk_bedrock_data_automation/client.py @@ -1,18 +1,20 @@ # Code generated by smithy-python-codegen DO NOT EDIT. +from __future__ import annotations + from copy import deepcopy import logging from typing import Any, cast +from smithy_aws_core.aio.identity.chain import AsyncIdentityChain from smithy_aws_core.config import ConfigSource from smithy_aws_core.identity import AWSCredentialsIdentity -from smithy_aws_core.identity.chain import IdentityChain -from smithy_core.aio.client import AsyncClient, ClientCall, RequestPipeline +from smithy_core.aio.client import AsyncClient, AsyncClientCall, AsyncRequestPipeline from smithy_core.deserializers import DeserializeableShape from smithy_core.exceptions import ExpectationNotMetError from smithy_core.schemas import APIOperation from smithy_core.serializers import SerializeableShape -from smithy_http.aio.interfaces import HTTPClient +from smithy_http.aio.interfaces import AsyncHTTPClient from smithy_http.plugins import user_agent_plugin from .config import AsyncBedrockDataAutomationConfig, Plugin @@ -22,85 +24,91 @@ CREATE_BLUEPRINT_VERSION, CREATE_DATA_AUTOMATION_LIBRARY, CREATE_DATA_AUTOMATION_PROJECT, - CopyBlueprintStageInput, - CopyBlueprintStageOutput, - CreateBlueprintInput, - CreateBlueprintOutput, - CreateBlueprintVersionInput, - CreateBlueprintVersionOutput, - CreateDataAutomationLibraryInput, - CreateDataAutomationLibraryOutput, - CreateDataAutomationProjectInput, - CreateDataAutomationProjectOutput, DELETE_BLUEPRINT, DELETE_DATA_AUTOMATION_LIBRARY, DELETE_DATA_AUTOMATION_PROJECT, - DeleteBlueprintInput, - DeleteBlueprintOutput, - DeleteDataAutomationLibraryInput, - DeleteDataAutomationLibraryOutput, - DeleteDataAutomationProjectInput, - DeleteDataAutomationProjectOutput, GET_BLUEPRINT, GET_BLUEPRINT_OPTIMIZATION_STATUS, GET_DATA_AUTOMATION_LIBRARY, GET_DATA_AUTOMATION_LIBRARY_ENTITY, GET_DATA_AUTOMATION_LIBRARY_INGESTION_JOB, GET_DATA_AUTOMATION_PROJECT, - GetBlueprintInput, - GetBlueprintOptimizationStatusInput, - GetBlueprintOptimizationStatusOutput, - GetBlueprintOutput, - GetDataAutomationLibraryEntityInput, - GetDataAutomationLibraryEntityOutput, - GetDataAutomationLibraryIngestionJobInput, - GetDataAutomationLibraryIngestionJobOutput, - GetDataAutomationLibraryInput, - GetDataAutomationLibraryOutput, - GetDataAutomationProjectInput, - GetDataAutomationProjectOutput, INVOKE_BLUEPRINT_OPTIMIZATION_ASYNC, INVOKE_DATA_AUTOMATION_LIBRARY_INGESTION_JOB, - InvokeBlueprintOptimizationAsyncInput, - InvokeBlueprintOptimizationAsyncOutput, - InvokeDataAutomationLibraryIngestionJobInput, - InvokeDataAutomationLibraryIngestionJobOutput, LIST_BLUEPRINTS, LIST_DATA_AUTOMATION_LIBRARIES, LIST_DATA_AUTOMATION_LIBRARY_ENTITIES, LIST_DATA_AUTOMATION_LIBRARY_INGESTION_JOBS, LIST_DATA_AUTOMATION_PROJECTS, LIST_TAGS_FOR_RESOURCE, - ListBlueprintsInput, - ListBlueprintsOutput, - ListDataAutomationLibrariesInput, - ListDataAutomationLibrariesOutput, - ListDataAutomationLibraryEntitiesInput, - ListDataAutomationLibraryEntitiesOutput, - ListDataAutomationLibraryIngestionJobsInput, - ListDataAutomationLibraryIngestionJobsOutput, - ListDataAutomationProjectsInput, - ListDataAutomationProjectsOutput, - ListTagsForResourceInput, - ListTagsForResourceOutput, TAG_RESOURCE, - TagResourceInput, - TagResourceOutput, UNTAG_RESOURCE, UPDATE_BLUEPRINT, UPDATE_DATA_AUTOMATION_LIBRARY, UPDATE_DATA_AUTOMATION_PROJECT, - UntagResourceInput, - UntagResourceOutput, - UpdateBlueprintInput, - UpdateBlueprintOutput, - UpdateDataAutomationLibraryInput, - UpdateDataAutomationLibraryOutput, - UpdateDataAutomationProjectInput, - UpdateDataAutomationProjectOutput, ) from .user_agent import aws_user_agent_plugin +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .models import ( + CopyBlueprintStageInput, + CopyBlueprintStageOutput, + CreateBlueprintInput, + CreateBlueprintOutput, + CreateBlueprintVersionInput, + CreateBlueprintVersionOutput, + CreateDataAutomationLibraryInput, + CreateDataAutomationLibraryOutput, + CreateDataAutomationProjectInput, + CreateDataAutomationProjectOutput, + DeleteBlueprintInput, + DeleteBlueprintOutput, + DeleteDataAutomationLibraryInput, + DeleteDataAutomationLibraryOutput, + DeleteDataAutomationProjectInput, + DeleteDataAutomationProjectOutput, + GetBlueprintInput, + GetBlueprintOptimizationStatusInput, + GetBlueprintOptimizationStatusOutput, + GetBlueprintOutput, + GetDataAutomationLibraryEntityInput, + GetDataAutomationLibraryEntityOutput, + GetDataAutomationLibraryIngestionJobInput, + GetDataAutomationLibraryIngestionJobOutput, + GetDataAutomationLibraryInput, + GetDataAutomationLibraryOutput, + GetDataAutomationProjectInput, + GetDataAutomationProjectOutput, + InvokeBlueprintOptimizationAsyncInput, + InvokeBlueprintOptimizationAsyncOutput, + InvokeDataAutomationLibraryIngestionJobInput, + InvokeDataAutomationLibraryIngestionJobOutput, + ListBlueprintsInput, + ListBlueprintsOutput, + ListDataAutomationLibrariesInput, + ListDataAutomationLibrariesOutput, + ListDataAutomationLibraryEntitiesInput, + ListDataAutomationLibraryEntitiesOutput, + ListDataAutomationLibraryIngestionJobsInput, + ListDataAutomationLibraryIngestionJobsOutput, + ListDataAutomationProjectsInput, + ListDataAutomationProjectsOutput, + ListTagsForResourceInput, + ListTagsForResourceOutput, + TagResourceInput, + TagResourceOutput, + UntagResourceInput, + UntagResourceOutput, + UpdateBlueprintInput, + UpdateBlueprintOutput, + UpdateDataAutomationLibraryInput, + UpdateDataAutomationLibraryOutput, + UpdateDataAutomationProjectInput, + UpdateDataAutomationProjectOutput, + ) + logger = logging.getLogger(__name__) @@ -166,12 +174,12 @@ async def _post_setup(self, config: AsyncBedrockDataAutomationConfig) -> None: config_file = await config_context.parsed_profiles() if config_context.profile_source is ConfigSource.OVERRIDE: profile_name = config_context.profile_name - config.aws_credentials_identity_resolver = await IdentityChain.create( + config.aws_credentials_identity_resolver = await AsyncIdentityChain.create( AWSCredentialsIdentity, config_file=config_file, profile_name=profile_name, region_override=config.region, - http_client=cast(HTTPClient | None, config.transport), + http_client=cast(AsyncHTTPClient | None, config.transport), ) async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( @@ -180,7 +188,7 @@ async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( operation: APIOperation[I, O], default_plugins: list[Plugin], plugins: list[Plugin] | None, - ) -> tuple[RequestPipeline[Any, Any], ClientCall[I, O]]: + ) -> tuple[AsyncRequestPipeline[Any, Any], AsyncClientCall[I, O]]: if self._closed: raise RuntimeError( "Cannot invoke an operation on a client that has been closed." diff --git a/clients/aws-sdk-bedrock-data-automation/src/aws_sdk_bedrock_data_automation/config.py b/clients/aws-sdk-bedrock-data-automation/src/aws_sdk_bedrock_data_automation/config.py index f01b66b1..f196b4f9 100644 --- a/clients/aws-sdk-bedrock-data-automation/src/aws_sdk_bedrock_data_automation/config.py +++ b/clients/aws-sdk-bedrock-data-automation/src/aws_sdk_bedrock_data_automation/config.py @@ -1,186 +1,223 @@ # Code generated by smithy-python-codegen DO NOT EDIT. from dataclasses import dataclass, field -from typing import Any, Callable, ClassVar, Self, TypeAlias, Union, Unpack +from typing import ( + Any, + Callable, + ClassVar, + Self, + TYPE_CHECKING, + TypeAlias, + Union, + Unpack, +) -from smithy_aws_core.aio.protocols import RestJsonClientProtocol -from smithy_aws_core.auth import SigV4AuthScheme -from smithy_aws_core.config import AwsConfigOverrides, FileSystem -from smithy_aws_core.config.aws_config import AsyncAwsConfig -from smithy_aws_core.config.resolvers import EndpointUriResolver -from smithy_aws_core.config.types import FieldSpec -from smithy_aws_core.endpoints.standard_regional import ( - StandardRegionalEndpointsResolver, +from smithy_aws_core.aio.auth.sigv4 import AsyncSigV4AuthScheme +from smithy_aws_core.aio.config import AsyncFileSystem +from smithy_aws_core.aio.config.aws_config import AsyncAwsConfig, AwsConfigOverrides +from smithy_aws_core.aio.config.resolvers import EndpointUriResolver +from smithy_aws_core.aio.endpoints.standard_regional import ( + AsyncStandardRegionalEndpointsResolver, ) +from smithy_aws_core.aio.protocols import AsyncRestJsonClientProtocol +from smithy_aws_core.config.types import FieldSpec from smithy_aws_core.identity import AWSCredentialsIdentity, AWSIdentityProperties -from smithy_core.aio.interfaces import ( - ClientProtocol, - EndpointResolver, - ProtocolConstructor, - ProtocolSettings, -) -from smithy_core.aio.interfaces.auth import AuthScheme -from smithy_core.aio.interfaces.identity import IdentityResolver -from smithy_core.interceptors import Interceptor +from smithy_core.aio.interfaces import AsyncClientProtocol, AsyncEndpointResolver +from smithy_core.aio.interfaces.auth import AsyncAuthScheme +from smithy_core.aio.interfaces.identity import AsyncIdentityResolver +from smithy_core.interfaces import ProtocolConstructor, ProtocolSettings from smithy_core.interfaces.auth import AuthSchemeResolver from smithy_core.shapes import ShapeID from smithy_http.aio.aiohttp import AIOHTTPClient +from ._private.schemas import AMAZON_BEDROCK_KEYSTONE_BUILD_TIME_SERVICE from .auth import HTTPAuthSchemeResolver -from .models import ( - CopyBlueprintStageInput, - CopyBlueprintStageOutput, - CreateBlueprintInput, - CreateBlueprintOutput, - CreateBlueprintVersionInput, - CreateBlueprintVersionOutput, - CreateDataAutomationLibraryInput, - CreateDataAutomationLibraryOutput, - CreateDataAutomationProjectInput, - CreateDataAutomationProjectOutput, - DeleteBlueprintInput, - DeleteBlueprintOutput, - DeleteDataAutomationLibraryInput, - DeleteDataAutomationLibraryOutput, - DeleteDataAutomationProjectInput, - DeleteDataAutomationProjectOutput, - GetBlueprintInput, - GetBlueprintOptimizationStatusInput, - GetBlueprintOptimizationStatusOutput, - GetBlueprintOutput, - GetDataAutomationLibraryEntityInput, - GetDataAutomationLibraryEntityOutput, - GetDataAutomationLibraryIngestionJobInput, - GetDataAutomationLibraryIngestionJobOutput, - GetDataAutomationLibraryInput, - GetDataAutomationLibraryOutput, - GetDataAutomationProjectInput, - GetDataAutomationProjectOutput, - InvokeBlueprintOptimizationAsyncInput, - InvokeBlueprintOptimizationAsyncOutput, - InvokeDataAutomationLibraryIngestionJobInput, - InvokeDataAutomationLibraryIngestionJobOutput, - ListBlueprintsInput, - ListBlueprintsOutput, - ListDataAutomationLibrariesInput, - ListDataAutomationLibrariesOutput, - ListDataAutomationLibraryEntitiesInput, - ListDataAutomationLibraryEntitiesOutput, - ListDataAutomationLibraryIngestionJobsInput, - ListDataAutomationLibraryIngestionJobsOutput, - ListDataAutomationProjectsInput, - ListDataAutomationProjectsOutput, - ListTagsForResourceInput, - ListTagsForResourceOutput, - TagResourceInput, - TagResourceOutput, - UntagResourceInput, - UntagResourceOutput, - UpdateBlueprintInput, - UpdateBlueprintOutput, - UpdateDataAutomationLibraryInput, - UpdateDataAutomationLibraryOutput, - UpdateDataAutomationProjectInput, - UpdateDataAutomationProjectOutput, -) -_ServiceInterceptor = Union[ - Interceptor[CopyBlueprintStageInput, CopyBlueprintStageOutput, Any, Any], - Interceptor[CreateBlueprintInput, CreateBlueprintOutput, Any, Any], - Interceptor[CreateBlueprintVersionInput, CreateBlueprintVersionOutput, Any, Any], - Interceptor[ - CreateDataAutomationLibraryInput, CreateDataAutomationLibraryOutput, Any, Any - ], - Interceptor[ - CreateDataAutomationProjectInput, CreateDataAutomationProjectOutput, Any, Any - ], - Interceptor[DeleteBlueprintInput, DeleteBlueprintOutput, Any, Any], - Interceptor[ - DeleteDataAutomationLibraryInput, DeleteDataAutomationLibraryOutput, Any, Any - ], - Interceptor[ - DeleteDataAutomationProjectInput, DeleteDataAutomationProjectOutput, Any, Any - ], - Interceptor[GetBlueprintInput, GetBlueprintOutput, Any, Any], - Interceptor[ +if TYPE_CHECKING: + from smithy_core.interceptors import Interceptor + from .models import ( + CopyBlueprintStageInput, + CopyBlueprintStageOutput, + CreateBlueprintInput, + CreateBlueprintOutput, + CreateBlueprintVersionInput, + CreateBlueprintVersionOutput, + CreateDataAutomationLibraryInput, + CreateDataAutomationLibraryOutput, + CreateDataAutomationProjectInput, + CreateDataAutomationProjectOutput, + DeleteBlueprintInput, + DeleteBlueprintOutput, + DeleteDataAutomationLibraryInput, + DeleteDataAutomationLibraryOutput, + DeleteDataAutomationProjectInput, + DeleteDataAutomationProjectOutput, + GetBlueprintInput, GetBlueprintOptimizationStatusInput, GetBlueprintOptimizationStatusOutput, - Any, - Any, - ], - Interceptor[ - GetDataAutomationLibraryInput, GetDataAutomationLibraryOutput, Any, Any - ], - Interceptor[ + GetBlueprintOutput, GetDataAutomationLibraryEntityInput, GetDataAutomationLibraryEntityOutput, - Any, - Any, - ], - Interceptor[ GetDataAutomationLibraryIngestionJobInput, GetDataAutomationLibraryIngestionJobOutput, - Any, - Any, - ], - Interceptor[ - GetDataAutomationProjectInput, GetDataAutomationProjectOutput, Any, Any - ], - Interceptor[ + GetDataAutomationLibraryInput, + GetDataAutomationLibraryOutput, + GetDataAutomationProjectInput, + GetDataAutomationProjectOutput, InvokeBlueprintOptimizationAsyncInput, InvokeBlueprintOptimizationAsyncOutput, - Any, - Any, - ], - Interceptor[ InvokeDataAutomationLibraryIngestionJobInput, InvokeDataAutomationLibraryIngestionJobOutput, - Any, - Any, - ], - Interceptor[ListBlueprintsInput, ListBlueprintsOutput, Any, Any], - Interceptor[ - ListDataAutomationLibrariesInput, ListDataAutomationLibrariesOutput, Any, Any - ], - Interceptor[ + ListBlueprintsInput, + ListBlueprintsOutput, + ListDataAutomationLibrariesInput, + ListDataAutomationLibrariesOutput, ListDataAutomationLibraryEntitiesInput, ListDataAutomationLibraryEntitiesOutput, - Any, - Any, - ], - Interceptor[ ListDataAutomationLibraryIngestionJobsInput, ListDataAutomationLibraryIngestionJobsOutput, - Any, - Any, - ], - Interceptor[ - ListDataAutomationProjectsInput, ListDataAutomationProjectsOutput, Any, Any - ], - Interceptor[ListTagsForResourceInput, ListTagsForResourceOutput, Any, Any], - Interceptor[TagResourceInput, TagResourceOutput, Any, Any], - Interceptor[UntagResourceInput, UntagResourceOutput, Any, Any], - Interceptor[UpdateBlueprintInput, UpdateBlueprintOutput, Any, Any], - Interceptor[ - UpdateDataAutomationLibraryInput, UpdateDataAutomationLibraryOutput, Any, Any - ], - Interceptor[ - UpdateDataAutomationProjectInput, UpdateDataAutomationProjectOutput, Any, Any - ], -] + ListDataAutomationProjectsInput, + ListDataAutomationProjectsOutput, + ListTagsForResourceInput, + ListTagsForResourceOutput, + TagResourceInput, + TagResourceOutput, + UntagResourceInput, + UntagResourceOutput, + UpdateBlueprintInput, + UpdateBlueprintOutput, + UpdateDataAutomationLibraryInput, + UpdateDataAutomationLibraryOutput, + UpdateDataAutomationProjectInput, + UpdateDataAutomationProjectOutput, + ) + + _ServiceInterceptor = Union[ + Interceptor[CopyBlueprintStageInput, CopyBlueprintStageOutput, Any, Any], + Interceptor[CreateBlueprintInput, CreateBlueprintOutput, Any, Any], + Interceptor[ + CreateBlueprintVersionInput, CreateBlueprintVersionOutput, Any, Any + ], + Interceptor[ + CreateDataAutomationLibraryInput, + CreateDataAutomationLibraryOutput, + Any, + Any, + ], + Interceptor[ + CreateDataAutomationProjectInput, + CreateDataAutomationProjectOutput, + Any, + Any, + ], + Interceptor[DeleteBlueprintInput, DeleteBlueprintOutput, Any, Any], + Interceptor[ + DeleteDataAutomationLibraryInput, + DeleteDataAutomationLibraryOutput, + Any, + Any, + ], + Interceptor[ + DeleteDataAutomationProjectInput, + DeleteDataAutomationProjectOutput, + Any, + Any, + ], + Interceptor[GetBlueprintInput, GetBlueprintOutput, Any, Any], + Interceptor[ + GetBlueprintOptimizationStatusInput, + GetBlueprintOptimizationStatusOutput, + Any, + Any, + ], + Interceptor[ + GetDataAutomationLibraryInput, GetDataAutomationLibraryOutput, Any, Any + ], + Interceptor[ + GetDataAutomationLibraryEntityInput, + GetDataAutomationLibraryEntityOutput, + Any, + Any, + ], + Interceptor[ + GetDataAutomationLibraryIngestionJobInput, + GetDataAutomationLibraryIngestionJobOutput, + Any, + Any, + ], + Interceptor[ + GetDataAutomationProjectInput, GetDataAutomationProjectOutput, Any, Any + ], + Interceptor[ + InvokeBlueprintOptimizationAsyncInput, + InvokeBlueprintOptimizationAsyncOutput, + Any, + Any, + ], + Interceptor[ + InvokeDataAutomationLibraryIngestionJobInput, + InvokeDataAutomationLibraryIngestionJobOutput, + Any, + Any, + ], + Interceptor[ListBlueprintsInput, ListBlueprintsOutput, Any, Any], + Interceptor[ + ListDataAutomationLibrariesInput, + ListDataAutomationLibrariesOutput, + Any, + Any, + ], + Interceptor[ + ListDataAutomationLibraryEntitiesInput, + ListDataAutomationLibraryEntitiesOutput, + Any, + Any, + ], + Interceptor[ + ListDataAutomationLibraryIngestionJobsInput, + ListDataAutomationLibraryIngestionJobsOutput, + Any, + Any, + ], + Interceptor[ + ListDataAutomationProjectsInput, ListDataAutomationProjectsOutput, Any, Any + ], + Interceptor[ListTagsForResourceInput, ListTagsForResourceOutput, Any, Any], + Interceptor[TagResourceInput, TagResourceOutput, Any, Any], + Interceptor[UntagResourceInput, UntagResourceOutput, Any, Any], + Interceptor[UpdateBlueprintInput, UpdateBlueprintOutput, Any, Any], + Interceptor[ + UpdateDataAutomationLibraryInput, + UpdateDataAutomationLibraryOutput, + Any, + Any, + ], + Interceptor[ + UpdateDataAutomationProjectInput, + UpdateDataAutomationProjectOutput, + Any, + Any, + ], + ] +else: + _ServiceInterceptor = Any + _PROTOCOL_SETTINGS = ProtocolSettings( namespace="com.amazonaws.bedrockdataautomation", service_target="AmazonBedrockKeystoneBuildTimeService", + service_schema=AMAZON_BEDROCK_KEYSTONE_BUILD_TIME_SERVICE, ) class _AsyncBedrockDataAutomationConfigOverrides(AwsConfigOverrides, total=False): - endpoint_resolver: EndpointResolver | None + endpoint_resolver: AsyncEndpointResolver | None protocol: ( - ClientProtocol[Any, Any] | ProtocolConstructor[ClientProtocol[Any, Any]] | None + AsyncClientProtocol[Any, Any] + | ProtocolConstructor[AsyncClientProtocol[Any, Any]] + | None ) - auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None + auth_schemes: dict[ShapeID, AsyncAuthScheme[Any, Any, Any, Any]] | None auth_scheme_resolver: AuthSchemeResolver | None @@ -188,17 +225,17 @@ class _AsyncBedrockDataAutomationConfigOverrides(AwsConfigOverrides, total=False class AsyncBedrockDataAutomationConfig(AsyncAwsConfig): """Bedrock Data Automation configuration (async-resolved).""" - endpoint_resolver: EndpointResolver | None = None + endpoint_resolver: AsyncEndpointResolver | None = None """ The endpoint resolver used to resolve the final endpoint per-operation based on the configuration. """ - protocol: ClientProtocol[Any, Any] | None = None + protocol: AsyncClientProtocol[Any, Any] | None = None """ Pass a protocol class reference from smithy_aws_core.aio.protocols to - select the protocol, e.g. protocol=AwsJson10ClientProtocol. For custom - protocols a protocol instance may also be passed. + select the protocol, e.g. protocol=AsyncAwsJson10ClientProtocol. For + custom protocols a protocol instance may also be passed. """ interceptors: list[_ServiceInterceptor] = field(default_factory=lambda: []) @@ -207,7 +244,7 @@ class AsyncBedrockDataAutomationConfig(AsyncAwsConfig): execution of a request. """ - auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None = None + auth_schemes: dict[ShapeID, AsyncAuthScheme[Any, Any, Any, Any]] | None = None """A map of auth scheme ids to auth schemes.""" auth_scheme_resolver: AuthSchemeResolver | None = None @@ -217,7 +254,7 @@ class AsyncBedrockDataAutomationConfig(AsyncAwsConfig): """ aws_credentials_identity_resolver: ( - IdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None + AsyncIdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None ) = None """Resolves AWS Credentials. Required for operations that use Sigv4 Auth.""" @@ -258,24 +295,24 @@ class AsyncBedrockDataAutomationConfig(AsyncAwsConfig): default=None, resolver=EndpointUriResolver("bedrock_data_automation") ), "endpoint_resolver": FieldSpec( - default_factory=lambda: StandardRegionalEndpointsResolver( + default_factory=lambda: AsyncStandardRegionalEndpointsResolver( endpoint_prefix="bedrock-data-automation" ) ), "protocol": FieldSpec( - default_factory=lambda: RestJsonClientProtocol(_PROTOCOL_SETTINGS), + default_factory=lambda: AsyncRestJsonClientProtocol(_PROTOCOL_SETTINGS), converter=lambda p: p(_PROTOCOL_SETTINGS) if isinstance(p, type) else p, ), "auth_schemes": FieldSpec( default_factory=lambda: { - ShapeID("aws.auth#sigv4"): SigV4AuthScheme(service="bedrock") + ShapeID("aws.auth#sigv4"): AsyncSigV4AuthScheme(service="bedrock") } ), "auth_scheme_resolver": FieldSpec(default_factory=HTTPAuthSchemeResolver), "transport": FieldSpec(default_factory=lambda: AIOHTTPClient()), } - def set_auth_scheme(self, scheme: AuthScheme[Any, Any, Any, Any]) -> None: + def set_auth_scheme(self, scheme: AsyncAuthScheme[Any, Any, Any, Any]) -> None: """ Set an auth scheme implementation using its scheme ID. :param scheme: The auth scheme to add or replace. @@ -289,7 +326,7 @@ async def resolve( # pyright: ignore[reportIncompatibleMethodOverride] cls, *, profile: str | None = None, - fs: FileSystem | None = None, + fs: AsyncFileSystem | None = None, config_file_path: str | None = None, credentials_file_path: str | None = None, **overrides: Unpack[_AsyncBedrockDataAutomationConfigOverrides], diff --git a/clients/aws-sdk-bedrock-data-automation/src/aws_sdk_bedrock_data_automation/models.py b/clients/aws-sdk-bedrock-data-automation/src/aws_sdk_bedrock_data_automation/models.py index 40112eb3..bb1f67ae 100644 --- a/clients/aws-sdk-bedrock-data-automation/src/aws_sdk_bedrock_data_automation/models.py +++ b/clients/aws-sdk-bedrock-data-automation/src/aws_sdk_bedrock_data_automation/models.py @@ -1,11550 +1,879 @@ # Code generated by smithy-python-codegen DO NOT EDIT. -from dataclasses import dataclass, field -from datetime import datetime, timezone -from enum import StrEnum -import logging -from typing import Any, Literal, Self, Union +from __future__ import annotations -from smithy_core.deserializers import ShapeDeserializer -from smithy_core.documents import TypeRegistry -from smithy_core.exceptions import ModeledError, SerializationError -from smithy_core.response import EMPTY_RESPONSE_METADATA, ResponseMetadata -from smithy_core.schemas import APIOperation, Schema -from smithy_core.serializers import ShapeSerializer +from ._private import schemas as _schemas +from smithy_core._dynamic_models import ModelRegistry +from smithy_core.exceptions import ModeledError +from smithy_core.schemas import APIOperation from smithy_core.shapes import ShapeID -from smithy_core.types import UnknownEnumMixin from ._private.schemas import ( - ACCESS_DENIED_EXCEPTION as _SCHEMA_ACCESS_DENIED_EXCEPTION, - AUDIO_EXTRACTION_CATEGORY as _SCHEMA_AUDIO_EXTRACTION_CATEGORY, - AUDIO_EXTRACTION_CATEGORY_TYPE_CONFIGURATION as _SCHEMA_AUDIO_EXTRACTION_CATEGORY_TYPE_CONFIGURATION, - AUDIO_LANGUAGE_CONFIGURATION as _SCHEMA_AUDIO_LANGUAGE_CONFIGURATION, - AUDIO_OVERRIDE_CONFIGURATION as _SCHEMA_AUDIO_OVERRIDE_CONFIGURATION, - AUDIO_STANDARD_EXTRACTION as _SCHEMA_AUDIO_STANDARD_EXTRACTION, - AUDIO_STANDARD_GENERATIVE_FIELD as _SCHEMA_AUDIO_STANDARD_GENERATIVE_FIELD, - AUDIO_STANDARD_OUTPUT_CONFIGURATION as _SCHEMA_AUDIO_STANDARD_OUTPUT_CONFIGURATION, - BLUEPRINT as _SCHEMA_BLUEPRINT, - BLUEPRINT_FILTER as _SCHEMA_BLUEPRINT_FILTER, - BLUEPRINT_ITEM as _SCHEMA_BLUEPRINT_ITEM, - BLUEPRINT_OPTIMIZATION_OBJECT as _SCHEMA_BLUEPRINT_OPTIMIZATION_OBJECT, - BLUEPRINT_OPTIMIZATION_OUTPUT_CONFIGURATION as _SCHEMA_BLUEPRINT_OPTIMIZATION_OUTPUT_CONFIGURATION, - BLUEPRINT_OPTIMIZATION_SAMPLE as _SCHEMA_BLUEPRINT_OPTIMIZATION_SAMPLE, - BLUEPRINT_SUMMARY as _SCHEMA_BLUEPRINT_SUMMARY, - CHANNEL_LABELING_CONFIGURATION as _SCHEMA_CHANNEL_LABELING_CONFIGURATION, - CONFLICT_EXCEPTION as _SCHEMA_CONFLICT_EXCEPTION, COPY_BLUEPRINT_STAGE as _SCHEMA_COPY_BLUEPRINT_STAGE, - COPY_BLUEPRINT_STAGE_INPUT as _SCHEMA_COPY_BLUEPRINT_STAGE_INPUT, - COPY_BLUEPRINT_STAGE_OUTPUT as _SCHEMA_COPY_BLUEPRINT_STAGE_OUTPUT, CREATE_BLUEPRINT as _SCHEMA_CREATE_BLUEPRINT, - CREATE_BLUEPRINT_INPUT as _SCHEMA_CREATE_BLUEPRINT_INPUT, - CREATE_BLUEPRINT_OUTPUT as _SCHEMA_CREATE_BLUEPRINT_OUTPUT, CREATE_BLUEPRINT_VERSION as _SCHEMA_CREATE_BLUEPRINT_VERSION, - CREATE_BLUEPRINT_VERSION_INPUT as _SCHEMA_CREATE_BLUEPRINT_VERSION_INPUT, - CREATE_BLUEPRINT_VERSION_OUTPUT as _SCHEMA_CREATE_BLUEPRINT_VERSION_OUTPUT, CREATE_DATA_AUTOMATION_LIBRARY as _SCHEMA_CREATE_DATA_AUTOMATION_LIBRARY, - CREATE_DATA_AUTOMATION_LIBRARY_INPUT as _SCHEMA_CREATE_DATA_AUTOMATION_LIBRARY_INPUT, - CREATE_DATA_AUTOMATION_LIBRARY_OUTPUT as _SCHEMA_CREATE_DATA_AUTOMATION_LIBRARY_OUTPUT, CREATE_DATA_AUTOMATION_PROJECT as _SCHEMA_CREATE_DATA_AUTOMATION_PROJECT, - CREATE_DATA_AUTOMATION_PROJECT_INPUT as _SCHEMA_CREATE_DATA_AUTOMATION_PROJECT_INPUT, - CREATE_DATA_AUTOMATION_PROJECT_OUTPUT as _SCHEMA_CREATE_DATA_AUTOMATION_PROJECT_OUTPUT, - CUSTOM_OUTPUT_CONFIGURATION as _SCHEMA_CUSTOM_OUTPUT_CONFIGURATION, - DATA_AUTOMATION_LIBRARY as _SCHEMA_DATA_AUTOMATION_LIBRARY, - DATA_AUTOMATION_LIBRARY_CONFIGURATION as _SCHEMA_DATA_AUTOMATION_LIBRARY_CONFIGURATION, - DATA_AUTOMATION_LIBRARY_ENTITY_SUMMARY as _SCHEMA_DATA_AUTOMATION_LIBRARY_ENTITY_SUMMARY, - DATA_AUTOMATION_LIBRARY_FILTER as _SCHEMA_DATA_AUTOMATION_LIBRARY_FILTER, - DATA_AUTOMATION_LIBRARY_INGESTION_JOB as _SCHEMA_DATA_AUTOMATION_LIBRARY_INGESTION_JOB, - DATA_AUTOMATION_LIBRARY_INGESTION_JOB_SUMMARY as _SCHEMA_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_SUMMARY, - DATA_AUTOMATION_LIBRARY_ITEM as _SCHEMA_DATA_AUTOMATION_LIBRARY_ITEM, - DATA_AUTOMATION_LIBRARY_SUMMARY as _SCHEMA_DATA_AUTOMATION_LIBRARY_SUMMARY, - DATA_AUTOMATION_PROJECT as _SCHEMA_DATA_AUTOMATION_PROJECT, - DATA_AUTOMATION_PROJECT_FILTER as _SCHEMA_DATA_AUTOMATION_PROJECT_FILTER, - DATA_AUTOMATION_PROJECT_SUMMARY as _SCHEMA_DATA_AUTOMATION_PROJECT_SUMMARY, DELETE_BLUEPRINT as _SCHEMA_DELETE_BLUEPRINT, - DELETE_BLUEPRINT_INPUT as _SCHEMA_DELETE_BLUEPRINT_INPUT, - DELETE_BLUEPRINT_OUTPUT as _SCHEMA_DELETE_BLUEPRINT_OUTPUT, DELETE_DATA_AUTOMATION_LIBRARY as _SCHEMA_DELETE_DATA_AUTOMATION_LIBRARY, - DELETE_DATA_AUTOMATION_LIBRARY_INPUT as _SCHEMA_DELETE_DATA_AUTOMATION_LIBRARY_INPUT, - DELETE_DATA_AUTOMATION_LIBRARY_OUTPUT as _SCHEMA_DELETE_DATA_AUTOMATION_LIBRARY_OUTPUT, DELETE_DATA_AUTOMATION_PROJECT as _SCHEMA_DELETE_DATA_AUTOMATION_PROJECT, - DELETE_DATA_AUTOMATION_PROJECT_INPUT as _SCHEMA_DELETE_DATA_AUTOMATION_PROJECT_INPUT, - DELETE_DATA_AUTOMATION_PROJECT_OUTPUT as _SCHEMA_DELETE_DATA_AUTOMATION_PROJECT_OUTPUT, - DELETE_ENTITIES_INFO as _SCHEMA_DELETE_ENTITIES_INFO, - DOCUMENT_BOUNDING_BOX as _SCHEMA_DOCUMENT_BOUNDING_BOX, - DOCUMENT_CUSTOM_OUTPUT_CONFIGURATION as _SCHEMA_DOCUMENT_CUSTOM_OUTPUT_CONFIGURATION, - DOCUMENT_EXTRACTION_GRANULARITY as _SCHEMA_DOCUMENT_EXTRACTION_GRANULARITY, - DOCUMENT_OUTPUT_ADDITIONAL_FILE_FORMAT as _SCHEMA_DOCUMENT_OUTPUT_ADDITIONAL_FILE_FORMAT, - DOCUMENT_OUTPUT_FORMAT as _SCHEMA_DOCUMENT_OUTPUT_FORMAT, - DOCUMENT_OUTPUT_TEXT_FORMAT as _SCHEMA_DOCUMENT_OUTPUT_TEXT_FORMAT, - DOCUMENT_OVERRIDE_CONFIGURATION as _SCHEMA_DOCUMENT_OVERRIDE_CONFIGURATION, - DOCUMENT_STANDARD_EXTRACTION as _SCHEMA_DOCUMENT_STANDARD_EXTRACTION, - DOCUMENT_STANDARD_GENERATIVE_FIELD as _SCHEMA_DOCUMENT_STANDARD_GENERATIVE_FIELD, - DOCUMENT_STANDARD_OUTPUT_CONFIGURATION as _SCHEMA_DOCUMENT_STANDARD_OUTPUT_CONFIGURATION, - ENCRYPTION_CONFIGURATION as _SCHEMA_ENCRYPTION_CONFIGURATION, - ENTITY_DETAILS as _SCHEMA_ENTITY_DETAILS, - ENTITY_TYPE_INFO as _SCHEMA_ENTITY_TYPE_INFO, - EVENT_BRIDGE_CONFIGURATION as _SCHEMA_EVENT_BRIDGE_CONFIGURATION, GET_BLUEPRINT as _SCHEMA_GET_BLUEPRINT, - GET_BLUEPRINT_INPUT as _SCHEMA_GET_BLUEPRINT_INPUT, GET_BLUEPRINT_OPTIMIZATION_STATUS as _SCHEMA_GET_BLUEPRINT_OPTIMIZATION_STATUS, - GET_BLUEPRINT_OPTIMIZATION_STATUS_INPUT as _SCHEMA_GET_BLUEPRINT_OPTIMIZATION_STATUS_INPUT, - GET_BLUEPRINT_OPTIMIZATION_STATUS_OUTPUT as _SCHEMA_GET_BLUEPRINT_OPTIMIZATION_STATUS_OUTPUT, - GET_BLUEPRINT_OUTPUT as _SCHEMA_GET_BLUEPRINT_OUTPUT, GET_DATA_AUTOMATION_LIBRARY as _SCHEMA_GET_DATA_AUTOMATION_LIBRARY, GET_DATA_AUTOMATION_LIBRARY_ENTITY as _SCHEMA_GET_DATA_AUTOMATION_LIBRARY_ENTITY, - GET_DATA_AUTOMATION_LIBRARY_ENTITY_INPUT as _SCHEMA_GET_DATA_AUTOMATION_LIBRARY_ENTITY_INPUT, - GET_DATA_AUTOMATION_LIBRARY_ENTITY_OUTPUT as _SCHEMA_GET_DATA_AUTOMATION_LIBRARY_ENTITY_OUTPUT, GET_DATA_AUTOMATION_LIBRARY_INGESTION_JOB as _SCHEMA_GET_DATA_AUTOMATION_LIBRARY_INGESTION_JOB, - GET_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_INPUT as _SCHEMA_GET_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_INPUT, - GET_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_OUTPUT as _SCHEMA_GET_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_OUTPUT, - GET_DATA_AUTOMATION_LIBRARY_INPUT as _SCHEMA_GET_DATA_AUTOMATION_LIBRARY_INPUT, - GET_DATA_AUTOMATION_LIBRARY_OUTPUT as _SCHEMA_GET_DATA_AUTOMATION_LIBRARY_OUTPUT, GET_DATA_AUTOMATION_PROJECT as _SCHEMA_GET_DATA_AUTOMATION_PROJECT, - GET_DATA_AUTOMATION_PROJECT_INPUT as _SCHEMA_GET_DATA_AUTOMATION_PROJECT_INPUT, - GET_DATA_AUTOMATION_PROJECT_OUTPUT as _SCHEMA_GET_DATA_AUTOMATION_PROJECT_OUTPUT, - IMAGE_BOUNDING_BOX as _SCHEMA_IMAGE_BOUNDING_BOX, - IMAGE_EXTRACTION_CATEGORY as _SCHEMA_IMAGE_EXTRACTION_CATEGORY, - IMAGE_OVERRIDE_CONFIGURATION as _SCHEMA_IMAGE_OVERRIDE_CONFIGURATION, - IMAGE_STANDARD_EXTRACTION as _SCHEMA_IMAGE_STANDARD_EXTRACTION, - IMAGE_STANDARD_GENERATIVE_FIELD as _SCHEMA_IMAGE_STANDARD_GENERATIVE_FIELD, - IMAGE_STANDARD_OUTPUT_CONFIGURATION as _SCHEMA_IMAGE_STANDARD_OUTPUT_CONFIGURATION, - INLINE_PAYLOAD as _SCHEMA_INLINE_PAYLOAD, - INPUT_CONFIGURATION as _SCHEMA_INPUT_CONFIGURATION, - INTERNAL_SERVER_EXCEPTION as _SCHEMA_INTERNAL_SERVER_EXCEPTION, INVOKE_BLUEPRINT_OPTIMIZATION_ASYNC as _SCHEMA_INVOKE_BLUEPRINT_OPTIMIZATION_ASYNC, - INVOKE_BLUEPRINT_OPTIMIZATION_ASYNC_INPUT as _SCHEMA_INVOKE_BLUEPRINT_OPTIMIZATION_ASYNC_INPUT, - INVOKE_BLUEPRINT_OPTIMIZATION_ASYNC_OUTPUT as _SCHEMA_INVOKE_BLUEPRINT_OPTIMIZATION_ASYNC_OUTPUT, INVOKE_DATA_AUTOMATION_LIBRARY_INGESTION_JOB as _SCHEMA_INVOKE_DATA_AUTOMATION_LIBRARY_INGESTION_JOB, - INVOKE_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_INPUT as _SCHEMA_INVOKE_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_INPUT, - INVOKE_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_OUTPUT as _SCHEMA_INVOKE_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_OUTPUT, LIST_BLUEPRINTS as _SCHEMA_LIST_BLUEPRINTS, - LIST_BLUEPRINTS_INPUT as _SCHEMA_LIST_BLUEPRINTS_INPUT, - LIST_BLUEPRINTS_OUTPUT as _SCHEMA_LIST_BLUEPRINTS_OUTPUT, LIST_DATA_AUTOMATION_LIBRARIES as _SCHEMA_LIST_DATA_AUTOMATION_LIBRARIES, - LIST_DATA_AUTOMATION_LIBRARIES_INPUT as _SCHEMA_LIST_DATA_AUTOMATION_LIBRARIES_INPUT, - LIST_DATA_AUTOMATION_LIBRARIES_OUTPUT as _SCHEMA_LIST_DATA_AUTOMATION_LIBRARIES_OUTPUT, LIST_DATA_AUTOMATION_LIBRARY_ENTITIES as _SCHEMA_LIST_DATA_AUTOMATION_LIBRARY_ENTITIES, - LIST_DATA_AUTOMATION_LIBRARY_ENTITIES_INPUT as _SCHEMA_LIST_DATA_AUTOMATION_LIBRARY_ENTITIES_INPUT, - LIST_DATA_AUTOMATION_LIBRARY_ENTITIES_OUTPUT as _SCHEMA_LIST_DATA_AUTOMATION_LIBRARY_ENTITIES_OUTPUT, LIST_DATA_AUTOMATION_LIBRARY_INGESTION_JOBS as _SCHEMA_LIST_DATA_AUTOMATION_LIBRARY_INGESTION_JOBS, - LIST_DATA_AUTOMATION_LIBRARY_INGESTION_JOBS_INPUT as _SCHEMA_LIST_DATA_AUTOMATION_LIBRARY_INGESTION_JOBS_INPUT, - LIST_DATA_AUTOMATION_LIBRARY_INGESTION_JOBS_OUTPUT as _SCHEMA_LIST_DATA_AUTOMATION_LIBRARY_INGESTION_JOBS_OUTPUT, LIST_DATA_AUTOMATION_PROJECTS as _SCHEMA_LIST_DATA_AUTOMATION_PROJECTS, - LIST_DATA_AUTOMATION_PROJECTS_INPUT as _SCHEMA_LIST_DATA_AUTOMATION_PROJECTS_INPUT, - LIST_DATA_AUTOMATION_PROJECTS_OUTPUT as _SCHEMA_LIST_DATA_AUTOMATION_PROJECTS_OUTPUT, LIST_TAGS_FOR_RESOURCE as _SCHEMA_LIST_TAGS_FOR_RESOURCE, - LIST_TAGS_FOR_RESOURCE_INPUT as _SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT, - LIST_TAGS_FOR_RESOURCE_OUTPUT as _SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT, - MODALITY_PROCESSING_CONFIGURATION as _SCHEMA_MODALITY_PROCESSING_CONFIGURATION, - MODALITY_ROUTING_CONFIGURATION as _SCHEMA_MODALITY_ROUTING_CONFIGURATION, - NOTIFICATION_CONFIGURATION as _SCHEMA_NOTIFICATION_CONFIGURATION, - OUTPUT_CONFIGURATION as _SCHEMA_OUTPUT_CONFIGURATION, - OVERRIDE_CONFIGURATION as _SCHEMA_OVERRIDE_CONFIGURATION, - PHRASE as _SCHEMA_PHRASE, - PII_ENTITIES_CONFIGURATION as _SCHEMA_PII_ENTITIES_CONFIGURATION, - RESOURCE_NOT_FOUND_EXCEPTION as _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - S3_OBJECT as _SCHEMA_S3_OBJECT, - SENSITIVE_DATA_CONFIGURATION as _SCHEMA_SENSITIVE_DATA_CONFIGURATION, - SERVICE_QUOTA_EXCEEDED_EXCEPTION as _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - SPEAKER_LABELING_CONFIGURATION as _SCHEMA_SPEAKER_LABELING_CONFIGURATION, - SPLITTER_CONFIGURATION as _SCHEMA_SPLITTER_CONFIGURATION, - STANDARD_OUTPUT_CONFIGURATION as _SCHEMA_STANDARD_OUTPUT_CONFIGURATION, - TAG as _SCHEMA_TAG, TAG_RESOURCE as _SCHEMA_TAG_RESOURCE, - TAG_RESOURCE_INPUT as _SCHEMA_TAG_RESOURCE_INPUT, - TAG_RESOURCE_OUTPUT as _SCHEMA_TAG_RESOURCE_OUTPUT, - THROTTLING_EXCEPTION as _SCHEMA_THROTTLING_EXCEPTION, - TRANSCRIPT_CONFIGURATION as _SCHEMA_TRANSCRIPT_CONFIGURATION, UNTAG_RESOURCE as _SCHEMA_UNTAG_RESOURCE, - UNTAG_RESOURCE_INPUT as _SCHEMA_UNTAG_RESOURCE_INPUT, - UNTAG_RESOURCE_OUTPUT as _SCHEMA_UNTAG_RESOURCE_OUTPUT, UPDATE_BLUEPRINT as _SCHEMA_UPDATE_BLUEPRINT, - UPDATE_BLUEPRINT_INPUT as _SCHEMA_UPDATE_BLUEPRINT_INPUT, - UPDATE_BLUEPRINT_OUTPUT as _SCHEMA_UPDATE_BLUEPRINT_OUTPUT, UPDATE_DATA_AUTOMATION_LIBRARY as _SCHEMA_UPDATE_DATA_AUTOMATION_LIBRARY, - UPDATE_DATA_AUTOMATION_LIBRARY_INPUT as _SCHEMA_UPDATE_DATA_AUTOMATION_LIBRARY_INPUT, - UPDATE_DATA_AUTOMATION_LIBRARY_OUTPUT as _SCHEMA_UPDATE_DATA_AUTOMATION_LIBRARY_OUTPUT, UPDATE_DATA_AUTOMATION_PROJECT as _SCHEMA_UPDATE_DATA_AUTOMATION_PROJECT, - UPDATE_DATA_AUTOMATION_PROJECT_INPUT as _SCHEMA_UPDATE_DATA_AUTOMATION_PROJECT_INPUT, - UPDATE_DATA_AUTOMATION_PROJECT_OUTPUT as _SCHEMA_UPDATE_DATA_AUTOMATION_PROJECT_OUTPUT, - UPSERT_ENTITY_INFO as _SCHEMA_UPSERT_ENTITY_INFO, - VALIDATION_EXCEPTION as _SCHEMA_VALIDATION_EXCEPTION, - VALIDATION_EXCEPTION_FIELD as _SCHEMA_VALIDATION_EXCEPTION_FIELD, - VIDEO_BOUNDING_BOX as _SCHEMA_VIDEO_BOUNDING_BOX, - VIDEO_EXTRACTION_CATEGORY as _SCHEMA_VIDEO_EXTRACTION_CATEGORY, - VIDEO_OVERRIDE_CONFIGURATION as _SCHEMA_VIDEO_OVERRIDE_CONFIGURATION, - VIDEO_STANDARD_EXTRACTION as _SCHEMA_VIDEO_STANDARD_EXTRACTION, - VIDEO_STANDARD_GENERATIVE_FIELD as _SCHEMA_VIDEO_STANDARD_GENERATIVE_FIELD, - VIDEO_STANDARD_OUTPUT_CONFIGURATION as _SCHEMA_VIDEO_STANDARD_OUTPUT_CONFIGURATION, - VOCABULARY_ENTITY as _SCHEMA_VOCABULARY_ENTITY, - VOCABULARY_ENTITY_INFO as _SCHEMA_VOCABULARY_ENTITY_INFO, - VOCABULARY_ENTITY_SUMMARY as _SCHEMA_VOCABULARY_ENTITY_SUMMARY, ) +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .models import ( + CopyBlueprintStageInput, + CopyBlueprintStageOutput, + CreateBlueprintInput, + CreateBlueprintOutput, + CreateBlueprintVersionInput, + CreateBlueprintVersionOutput, + CreateDataAutomationLibraryInput, + CreateDataAutomationLibraryOutput, + CreateDataAutomationProjectInput, + CreateDataAutomationProjectOutput, + DeleteBlueprintInput, + DeleteBlueprintOutput, + DeleteDataAutomationLibraryInput, + DeleteDataAutomationLibraryOutput, + DeleteDataAutomationProjectInput, + DeleteDataAutomationProjectOutput, + GetBlueprintInput, + GetBlueprintOptimizationStatusInput, + GetBlueprintOptimizationStatusOutput, + GetBlueprintOutput, + GetDataAutomationLibraryEntityInput, + GetDataAutomationLibraryEntityOutput, + GetDataAutomationLibraryIngestionJobInput, + GetDataAutomationLibraryIngestionJobOutput, + GetDataAutomationLibraryInput, + GetDataAutomationLibraryOutput, + GetDataAutomationProjectInput, + GetDataAutomationProjectOutput, + InvokeBlueprintOptimizationAsyncInput, + InvokeBlueprintOptimizationAsyncOutput, + InvokeDataAutomationLibraryIngestionJobInput, + InvokeDataAutomationLibraryIngestionJobOutput, + ListBlueprintsInput, + ListBlueprintsOutput, + ListDataAutomationLibrariesInput, + ListDataAutomationLibrariesOutput, + ListDataAutomationLibraryEntitiesInput, + ListDataAutomationLibraryEntitiesOutput, + ListDataAutomationLibraryIngestionJobsInput, + ListDataAutomationLibraryIngestionJobsOutput, + ListDataAutomationProjectsInput, + ListDataAutomationProjectsOutput, + ListTagsForResourceInput, + ListTagsForResourceOutput, + TagResourceInput, + TagResourceOutput, + UntagResourceInput, + UntagResourceOutput, + UpdateBlueprintInput, + UpdateBlueprintOutput, + UpdateDataAutomationLibraryInput, + UpdateDataAutomationLibraryOutput, + UpdateDataAutomationProjectInput, + UpdateDataAutomationProjectOutput, + ) -logger = logging.getLogger(__name__) - - -class ServiceError(ModeledError): - """ - Base error for all errors in the service. - - Some exceptions do not extend from this class, including - synthetic, implicit, and shared exception types. - """ - - -@dataclass(kw_only=True) -class AccessDeniedException(ServiceError): - """This exception is thrown when a request is denied per access permissions""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACCESS_DENIED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_ACCESS_DENIED_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_ACCESS_DENIED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ACCESS_DENIED_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetBlueprintOptimizationStatusInput: - """Structure for request of GetBlueprintOptimizationStatus API.""" - - invocation_arn: str | None = None - """Invocation arn.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_BLUEPRINT_OPTIMIZATION_STATUS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.invocation_arn is not None: - serializer.write_string( - _SCHEMA_GET_BLUEPRINT_OPTIMIZATION_STATUS_INPUT.members[ - "invocationArn" - ], - self.invocation_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["invocation_arn"] = de.read_string( - _SCHEMA_GET_BLUEPRINT_OPTIMIZATION_STATUS_INPUT.members[ - "invocationArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_BLUEPRINT_OPTIMIZATION_STATUS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class S3Object: - """S3 object""" - - s3_uri: str - """S3 uri.""" - - version: str | None = None - """S3 object version.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_S3_OBJECT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_S3_OBJECT.members["s3Uri"], self.s3_uri) - if self.version is not None: - serializer.write_string(_SCHEMA_S3_OBJECT.members["version"], self.version) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["s3_uri"] = de.read_string( - _SCHEMA_S3_OBJECT.members["s3Uri"] - ) - - case 1: - kwargs["version"] = de.read_string( - _SCHEMA_S3_OBJECT.members["version"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_S3_OBJECT, consumer=_consumer) - if "s3_uri" not in kwargs: - kwargs["s3_uri"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(s3_uri="") - - -@dataclass(kw_only=True) -class BlueprintOptimizationOutputConfiguration: - """Blueprint Optimization Output configuration.""" - - s3_object: S3Object - """S3 object.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_BLUEPRINT_OPTIMIZATION_OUTPUT_CONFIGURATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_BLUEPRINT_OPTIMIZATION_OUTPUT_CONFIGURATION.members["s3Object"], - self.s3_object, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["s3_object"] = S3Object.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_BLUEPRINT_OPTIMIZATION_OUTPUT_CONFIGURATION, consumer=_consumer - ) - if "s3_object" not in kwargs: - kwargs["s3_object"] = S3Object._smithy_default() - return kwargs - - -class BlueprintOptimizationJobStatus(UnknownEnumMixin, StrEnum): - """List of status supported by optimization jobs""" - - CREATED = "Created" - IN_PROGRESS = "InProgress" - SUCCESS = "Success" - SERVICE_ERROR = "ServiceError" - CLIENT_ERROR = "ClientError" - - -@dataclass(kw_only=True) -class GetBlueprintOptimizationStatusOutput: - """Response of GetBlueprintOptimizationStatus API.""" - - status: str | None = None - """Job Status.""" - - error_type: str | None = None - """Error Type.""" - - error_message: str | None = None - """Error Message.""" - - output_configuration: BlueprintOptimizationOutputConfiguration | None = None - """Output configuration.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_BLUEPRINT_OPTIMIZATION_STATUS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.status is not None: - serializer.write_string( - _SCHEMA_GET_BLUEPRINT_OPTIMIZATION_STATUS_OUTPUT.members["status"], - self.status, - ) - - if self.error_type is not None: - serializer.write_string( - _SCHEMA_GET_BLUEPRINT_OPTIMIZATION_STATUS_OUTPUT.members["errorType"], - self.error_type, - ) - - if self.error_message is not None: - serializer.write_string( - _SCHEMA_GET_BLUEPRINT_OPTIMIZATION_STATUS_OUTPUT.members[ - "errorMessage" - ], - self.error_message, - ) - - if self.output_configuration is not None: - serializer.write_struct( - _SCHEMA_GET_BLUEPRINT_OPTIMIZATION_STATUS_OUTPUT.members[ - "outputConfiguration" - ], - self.output_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["status"] = BlueprintOptimizationJobStatus( - de.read_string( - _SCHEMA_GET_BLUEPRINT_OPTIMIZATION_STATUS_OUTPUT.members[ - "status" - ] - ) - ) - - case 1: - kwargs["error_type"] = de.read_string( - _SCHEMA_GET_BLUEPRINT_OPTIMIZATION_STATUS_OUTPUT.members[ - "errorType" - ] - ) - - case 2: - kwargs["error_message"] = de.read_string( - _SCHEMA_GET_BLUEPRINT_OPTIMIZATION_STATUS_OUTPUT.members[ - "errorMessage" - ] - ) - - case 3: - kwargs["output_configuration"] = ( - BlueprintOptimizationOutputConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_BLUEPRINT_OPTIMIZATION_STATUS_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InternalServerException(ServiceError): - """ - This exception is thrown if there was an unexpected error during - processing of request - """ - - fault: Literal["client", "server"] | None = "server" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INTERNAL_SERVER_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INTERNAL_SERVER_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INTERNAL_SERVER_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INTERNAL_SERVER_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ResourceNotFoundException(ServiceError): - """ - This exception is thrown when a resource referenced by the operation - does not exist - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ThrottlingException(ServiceError): - """This exception is thrown when the number of requests exceeds the limit""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_THROTTLING_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_THROTTLING_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_THROTTLING_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_THROTTLING_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ValidationExceptionField: - """ - Stores information about a field passed inside a request that resulted - in an exception - """ - - name: str - """Non Blank String""" - - message: str - """Non Blank String""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VALIDATION_EXCEPTION_FIELD, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_VALIDATION_EXCEPTION_FIELD.members["name"], self.name - ) - serializer.write_string( - _SCHEMA_VALIDATION_EXCEPTION_FIELD.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_VALIDATION_EXCEPTION_FIELD.members["name"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_VALIDATION_EXCEPTION_FIELD.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VALIDATION_EXCEPTION_FIELD, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "message" not in kwargs: - kwargs["message"] = "" - return kwargs - - -def _serialize_validation_exception_field_list( - serializer: ShapeSerializer, schema: Schema, value: list[ValidationExceptionField] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_validation_exception_field_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ValidationExceptionField]: - result: list[ValidationExceptionField] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ValidationExceptionField.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ValidationException(ServiceError): - """This exception is thrown when the request's input validation fails""" - - fault: Literal["client", "server"] | None = "client" - - field_list: list[ValidationExceptionField] | None = None - """list of ValidationExceptionField""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VALIDATION_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_VALIDATION_EXCEPTION.members["message"], self.message - ) - - if self.field_list is not None: - _serialize_validation_exception_field_list( - serializer, - _SCHEMA_VALIDATION_EXCEPTION.members["fieldList"], - self.field_list, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_VALIDATION_EXCEPTION.members["message"] - ) - - case 1: - kwargs["field_list"] = _deserialize_validation_exception_field_list( - de, _SCHEMA_VALIDATION_EXCEPTION.members["fieldList"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VALIDATION_EXCEPTION, consumer=_consumer) - return kwargs - - -GET_BLUEPRINT_OPTIMIZATION_STATUS = APIOperation( - input=GetBlueprintOptimizationStatusInput, - output=GetBlueprintOptimizationStatusOutput, - schema=_SCHEMA_GET_BLUEPRINT_OPTIMIZATION_STATUS, - input_schema=_SCHEMA_GET_BLUEPRINT_OPTIMIZATION_STATUS_INPUT, - output_schema=_SCHEMA_GET_BLUEPRINT_OPTIMIZATION_STATUS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockdataautomation#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockdataautomation#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class BlueprintStage(UnknownEnumMixin, StrEnum): - """Stage of the Blueprint""" - - DEVELOPMENT = "DEVELOPMENT" - LIVE = "LIVE" - - -@dataclass(kw_only=True) -class BlueprintOptimizationObject: - """Structure for single blueprint entity.""" - - blueprint_arn: str - """Arn of blueprint.""" - - stage: str | None = None - """Stage of blueprint.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BLUEPRINT_OPTIMIZATION_OBJECT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_BLUEPRINT_OPTIMIZATION_OBJECT.members["blueprintArn"], - self.blueprint_arn, - ) - if self.stage is not None: - serializer.write_string( - _SCHEMA_BLUEPRINT_OPTIMIZATION_OBJECT.members["stage"], self.stage - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["blueprint_arn"] = de.read_string( - _SCHEMA_BLUEPRINT_OPTIMIZATION_OBJECT.members["blueprintArn"] - ) - - case 1: - kwargs["stage"] = BlueprintStage( - de.read_string( - _SCHEMA_BLUEPRINT_OPTIMIZATION_OBJECT.members["stage"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_BLUEPRINT_OPTIMIZATION_OBJECT, consumer=_consumer - ) - if "blueprint_arn" not in kwargs: - kwargs["blueprint_arn"] = "" - return kwargs - - -def _serialize_kms_encryption_context( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_kms_encryption_context( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class EncryptionConfiguration: - """KMS Encryption Configuration""" - - kms_key_id: str - """KMS Key Identifier""" - - kms_encryption_context: dict[str, str] | None = None - """KMS Encryption Context""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ENCRYPTION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_ENCRYPTION_CONFIGURATION.members["kmsKeyId"], self.kms_key_id - ) - if self.kms_encryption_context is not None: - _serialize_kms_encryption_context( - serializer, - _SCHEMA_ENCRYPTION_CONFIGURATION.members["kmsEncryptionContext"], - self.kms_encryption_context, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["kms_key_id"] = de.read_string( - _SCHEMA_ENCRYPTION_CONFIGURATION.members["kmsKeyId"] - ) - - case 1: - kwargs["kms_encryption_context"] = ( - _deserialize_kms_encryption_context( - de, - _SCHEMA_ENCRYPTION_CONFIGURATION.members[ - "kmsEncryptionContext" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ENCRYPTION_CONFIGURATION, consumer=_consumer) - if "kms_key_id" not in kwargs: - kwargs["kms_key_id"] = "" - return kwargs - - -@dataclass(kw_only=True) -class BlueprintOptimizationSample: - """Blueprint Recommendation Sample""" - - asset_s3_object: S3Object - """S3 Object of the asset""" - - ground_truth_s3_object: S3Object - """Ground truth for the Blueprint and Asset combination""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BLUEPRINT_OPTIMIZATION_SAMPLE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_BLUEPRINT_OPTIMIZATION_SAMPLE.members["assetS3Object"], - self.asset_s3_object, - ) - serializer.write_struct( - _SCHEMA_BLUEPRINT_OPTIMIZATION_SAMPLE.members["groundTruthS3Object"], - self.ground_truth_s3_object, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["asset_s3_object"] = S3Object.deserialize(de) - - case 1: - kwargs["ground_truth_s3_object"] = S3Object.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_BLUEPRINT_OPTIMIZATION_SAMPLE, consumer=_consumer - ) - if "asset_s3_object" not in kwargs: - kwargs["asset_s3_object"] = S3Object._smithy_default() - if "ground_truth_s3_object" not in kwargs: - kwargs["ground_truth_s3_object"] = S3Object._smithy_default() - return kwargs - - -def _serialize_blueprint_optimization_samples( - serializer: ShapeSerializer, - schema: Schema, - value: list[BlueprintOptimizationSample], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_blueprint_optimization_samples( - deserializer: ShapeDeserializer, schema: Schema -) -> list[BlueprintOptimizationSample]: - result: list[BlueprintOptimizationSample] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(BlueprintOptimizationSample.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class Tag: - """Key value pair of a tag""" - - key: str - """Defines the context of the tag.""" - - value: str - """ - Defines the value within the context. e.g. - ``{=html}. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TAG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_TAG.members["key"], self.key) - serializer.write_string(_SCHEMA_TAG.members["value"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["key"] = de.read_string(_SCHEMA_TAG.members["key"]) - - case 1: - kwargs["value"] = de.read_string(_SCHEMA_TAG.members["value"]) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TAG, consumer=_consumer) - if "key" not in kwargs: - kwargs["key"] = "" - if "value" not in kwargs: - kwargs["value"] = "" - return kwargs - - -def _serialize_tag_list( - serializer: ShapeSerializer, schema: Schema, value: list[Tag] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_tag_list(deserializer: ShapeDeserializer, schema: Schema) -> list[Tag]: - result: list[Tag] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Tag.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class InvokeBlueprintOptimizationAsyncInput: - """Invoke Blueprint Optimization Async Request""" - - blueprint: BlueprintOptimizationObject | None = None - """Blueprint to be optimized""" - - samples: list[BlueprintOptimizationSample] | None = None - """List of Blueprint Optimization Samples""" - - output_configuration: BlueprintOptimizationOutputConfiguration | None = None - """Output configuration where the results should be placed""" - - data_automation_profile_arn: str | None = None - """Data automation profile ARN""" - - encryption_configuration: EncryptionConfiguration | None = None - """Encryption configuration.""" - - tags: list[Tag] | None = None - """List of tags.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOKE_BLUEPRINT_OPTIMIZATION_ASYNC_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.blueprint is not None: - serializer.write_struct( - _SCHEMA_INVOKE_BLUEPRINT_OPTIMIZATION_ASYNC_INPUT.members["blueprint"], - self.blueprint, - ) - - if self.samples is not None: - _serialize_blueprint_optimization_samples( - serializer, - _SCHEMA_INVOKE_BLUEPRINT_OPTIMIZATION_ASYNC_INPUT.members["samples"], - self.samples, - ) - - if self.output_configuration is not None: - serializer.write_struct( - _SCHEMA_INVOKE_BLUEPRINT_OPTIMIZATION_ASYNC_INPUT.members[ - "outputConfiguration" - ], - self.output_configuration, - ) - - if self.data_automation_profile_arn is not None: - serializer.write_string( - _SCHEMA_INVOKE_BLUEPRINT_OPTIMIZATION_ASYNC_INPUT.members[ - "dataAutomationProfileArn" - ], - self.data_automation_profile_arn, - ) - - if self.encryption_configuration is not None: - serializer.write_struct( - _SCHEMA_INVOKE_BLUEPRINT_OPTIMIZATION_ASYNC_INPUT.members[ - "encryptionConfiguration" - ], - self.encryption_configuration, - ) - - if self.tags is not None: - _serialize_tag_list( - serializer, - _SCHEMA_INVOKE_BLUEPRINT_OPTIMIZATION_ASYNC_INPUT.members["tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["blueprint"] = BlueprintOptimizationObject.deserialize(de) - - case 1: - kwargs["samples"] = _deserialize_blueprint_optimization_samples( - de, - _SCHEMA_INVOKE_BLUEPRINT_OPTIMIZATION_ASYNC_INPUT.members[ - "samples" - ], - ) - - case 2: - kwargs["output_configuration"] = ( - BlueprintOptimizationOutputConfiguration.deserialize(de) - ) - - case 3: - kwargs["data_automation_profile_arn"] = de.read_string( - _SCHEMA_INVOKE_BLUEPRINT_OPTIMIZATION_ASYNC_INPUT.members[ - "dataAutomationProfileArn" - ] - ) - - case 4: - kwargs["encryption_configuration"] = ( - EncryptionConfiguration.deserialize(de) - ) - - case 5: - kwargs["tags"] = _deserialize_tag_list( - de, - _SCHEMA_INVOKE_BLUEPRINT_OPTIMIZATION_ASYNC_INPUT.members[ - "tags" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVOKE_BLUEPRINT_OPTIMIZATION_ASYNC_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InvokeBlueprintOptimizationAsyncOutput: - """Invoke Blueprint Optimization Async Response""" - - invocation_arn: str - """ARN of the blueprint optimization job""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_BLUEPRINT_OPTIMIZATION_ASYNC_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_INVOKE_BLUEPRINT_OPTIMIZATION_ASYNC_OUTPUT.members["invocationArn"], - self.invocation_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["invocation_arn"] = de.read_string( - _SCHEMA_INVOKE_BLUEPRINT_OPTIMIZATION_ASYNC_OUTPUT.members[ - "invocationArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVOKE_BLUEPRINT_OPTIMIZATION_ASYNC_OUTPUT, consumer=_consumer - ) - if "invocation_arn" not in kwargs: - kwargs["invocation_arn"] = "" - return kwargs - - -@dataclass(kw_only=True) -class ServiceQuotaExceededException(ServiceError): - """This exception is thrown when a request is made beyond the service quota""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -INVOKE_BLUEPRINT_OPTIMIZATION_ASYNC = APIOperation( - input=InvokeBlueprintOptimizationAsyncInput, - output=InvokeBlueprintOptimizationAsyncOutput, - schema=_SCHEMA_INVOKE_BLUEPRINT_OPTIMIZATION_ASYNC, - input_schema=_SCHEMA_INVOKE_BLUEPRINT_OPTIMIZATION_ASYNC_INPUT, - output_schema=_SCHEMA_INVOKE_BLUEPRINT_OPTIMIZATION_ASYNC_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockdataautomation#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockdataautomation#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ConflictException(ServiceError): - """ - This exception is thrown when there is a conflict performing an - operation - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONFLICT_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_CONFLICT_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_CONFLICT_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONFLICT_EXCEPTION, consumer=_consumer) - return kwargs - - -class Type(UnknownEnumMixin, StrEnum): - """Type""" - - DOCUMENT = "DOCUMENT" - IMAGE = "IMAGE" - AUDIO = "AUDIO" - VIDEO = "VIDEO" - - -@dataclass(kw_only=True) -class CreateBlueprintInput: - """Create Blueprint Request""" - - blueprint_name: str | None = field(repr=False, default=None) - """Name of the Blueprint""" - - type: str | None = None - """Type""" - - blueprint_stage: str | None = None - """Stage of the Blueprint""" - - schema: str | None = field(repr=False, default=None) - """Schema of the blueprint""" - - client_token: str | None = None - """Client specified token used for idempotency checks""" - - encryption_configuration: EncryptionConfiguration | None = None - """KMS Encryption Configuration""" - - tags: list[Tag] | None = None - """List of tags""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_BLUEPRINT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.blueprint_name is not None: - serializer.write_string( - _SCHEMA_CREATE_BLUEPRINT_INPUT.members["blueprintName"], - self.blueprint_name, - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_CREATE_BLUEPRINT_INPUT.members["type"], self.type - ) - - if self.blueprint_stage is not None: - serializer.write_string( - _SCHEMA_CREATE_BLUEPRINT_INPUT.members["blueprintStage"], - self.blueprint_stage, - ) - - if self.schema is not None: - serializer.write_string( - _SCHEMA_CREATE_BLUEPRINT_INPUT.members["schema"], self.schema - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_BLUEPRINT_INPUT.members["clientToken"], self.client_token - ) - - if self.encryption_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_BLUEPRINT_INPUT.members["encryptionConfiguration"], - self.encryption_configuration, - ) - - if self.tags is not None: - _serialize_tag_list( - serializer, _SCHEMA_CREATE_BLUEPRINT_INPUT.members["tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["blueprint_name"] = de.read_string( - _SCHEMA_CREATE_BLUEPRINT_INPUT.members["blueprintName"] - ) - - case 1: - kwargs["type"] = Type( - de.read_string(_SCHEMA_CREATE_BLUEPRINT_INPUT.members["type"]) - ) - - case 2: - kwargs["blueprint_stage"] = BlueprintStage( - de.read_string( - _SCHEMA_CREATE_BLUEPRINT_INPUT.members["blueprintStage"] - ) - ) - - case 3: - kwargs["schema"] = de.read_string( - _SCHEMA_CREATE_BLUEPRINT_INPUT.members["schema"] - ) - - case 4: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_BLUEPRINT_INPUT.members["clientToken"] - ) - - case 5: - kwargs["encryption_configuration"] = ( - EncryptionConfiguration.deserialize(de) - ) - - case 6: - kwargs["tags"] = _deserialize_tag_list( - de, _SCHEMA_CREATE_BLUEPRINT_INPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_BLUEPRINT_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Blueprint: - """Contains the information of a Blueprint.""" - - blueprint_arn: str - """ARN of a Blueprint""" - - schema: str = field(repr=False) - """Schema of the blueprint""" - - type: str - """Type""" - - creation_time: datetime - """Time Stamp""" - - last_modified_time: datetime - """Time Stamp""" - - blueprint_name: str = field(repr=False) - """Name of the Blueprint""" - - blueprint_version: str | None = None - """Blueprint Version""" - - blueprint_stage: str | None = None - """Stage of the Blueprint""" - - kms_key_id: str | None = None - """KMS Key Identifier""" - - kms_encryption_context: dict[str, str] | None = None - """KMS Encryption Context""" - - optimization_samples: list[BlueprintOptimizationSample] | None = None - """List of Blueprint Optimization Samples""" - - optimization_time: datetime | None = None - """Time Stamp""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BLUEPRINT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_BLUEPRINT.members["blueprintArn"], self.blueprint_arn - ) - serializer.write_string(_SCHEMA_BLUEPRINT.members["schema"], self.schema) - serializer.write_string(_SCHEMA_BLUEPRINT.members["type"], self.type) - serializer.write_timestamp( - _SCHEMA_BLUEPRINT.members["creationTime"], self.creation_time - ) - serializer.write_timestamp( - _SCHEMA_BLUEPRINT.members["lastModifiedTime"], self.last_modified_time - ) - serializer.write_string( - _SCHEMA_BLUEPRINT.members["blueprintName"], self.blueprint_name - ) - if self.blueprint_version is not None: - serializer.write_string( - _SCHEMA_BLUEPRINT.members["blueprintVersion"], self.blueprint_version - ) - - if self.blueprint_stage is not None: - serializer.write_string( - _SCHEMA_BLUEPRINT.members["blueprintStage"], self.blueprint_stage - ) - - if self.kms_key_id is not None: - serializer.write_string( - _SCHEMA_BLUEPRINT.members["kmsKeyId"], self.kms_key_id - ) - - if self.kms_encryption_context is not None: - _serialize_kms_encryption_context( - serializer, - _SCHEMA_BLUEPRINT.members["kmsEncryptionContext"], - self.kms_encryption_context, - ) - - if self.optimization_samples is not None: - _serialize_blueprint_optimization_samples( - serializer, - _SCHEMA_BLUEPRINT.members["optimizationSamples"], - self.optimization_samples, - ) - - if self.optimization_time is not None: - serializer.write_timestamp( - _SCHEMA_BLUEPRINT.members["optimizationTime"], self.optimization_time - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["blueprint_arn"] = de.read_string( - _SCHEMA_BLUEPRINT.members["blueprintArn"] - ) - - case 1: - kwargs["schema"] = de.read_string( - _SCHEMA_BLUEPRINT.members["schema"] - ) - - case 2: - kwargs["type"] = Type( - de.read_string(_SCHEMA_BLUEPRINT.members["type"]) - ) - - case 3: - kwargs["creation_time"] = de.read_timestamp( - _SCHEMA_BLUEPRINT.members["creationTime"] - ) - - case 4: - kwargs["last_modified_time"] = de.read_timestamp( - _SCHEMA_BLUEPRINT.members["lastModifiedTime"] - ) - - case 5: - kwargs["blueprint_name"] = de.read_string( - _SCHEMA_BLUEPRINT.members["blueprintName"] - ) - - case 6: - kwargs["blueprint_version"] = de.read_string( - _SCHEMA_BLUEPRINT.members["blueprintVersion"] - ) - - case 7: - kwargs["blueprint_stage"] = BlueprintStage( - de.read_string(_SCHEMA_BLUEPRINT.members["blueprintStage"]) - ) - - case 8: - kwargs["kms_key_id"] = de.read_string( - _SCHEMA_BLUEPRINT.members["kmsKeyId"] - ) - - case 9: - kwargs["kms_encryption_context"] = ( - _deserialize_kms_encryption_context( - de, _SCHEMA_BLUEPRINT.members["kmsEncryptionContext"] - ) - ) - - case 10: - kwargs["optimization_samples"] = ( - _deserialize_blueprint_optimization_samples( - de, _SCHEMA_BLUEPRINT.members["optimizationSamples"] - ) - ) - - case 11: - kwargs["optimization_time"] = de.read_timestamp( - _SCHEMA_BLUEPRINT.members["optimizationTime"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BLUEPRINT, consumer=_consumer) - if "blueprint_arn" not in kwargs: - kwargs["blueprint_arn"] = "" - if "schema" not in kwargs: - kwargs["schema"] = "" - if "type" not in kwargs: - kwargs["type"] = Type._corrected("") - if "creation_time" not in kwargs: - kwargs["creation_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "last_modified_time" not in kwargs: - kwargs["last_modified_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "blueprint_name" not in kwargs: - kwargs["blueprint_name"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls( - blueprint_arn="", - schema="", - type=Type._corrected(""), - creation_time=datetime.fromtimestamp(0, tz=timezone.utc), - last_modified_time=datetime.fromtimestamp(0, tz=timezone.utc), - blueprint_name="", - ) - - -@dataclass(kw_only=True) -class CreateBlueprintOutput: - """Create Blueprint Response""" - - blueprint: Blueprint - """Contains the information of a Blueprint.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_BLUEPRINT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CREATE_BLUEPRINT_OUTPUT.members["blueprint"], self.blueprint - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["blueprint"] = Blueprint.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_BLUEPRINT_OUTPUT, consumer=_consumer) - if "blueprint" not in kwargs: - kwargs["blueprint"] = Blueprint._smithy_default() - return kwargs - - -CREATE_BLUEPRINT = APIOperation( - input=CreateBlueprintInput, - output=CreateBlueprintOutput, - schema=_SCHEMA_CREATE_BLUEPRINT, - input_schema=_SCHEMA_CREATE_BLUEPRINT_INPUT, - output_schema=_SCHEMA_CREATE_BLUEPRINT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockdataautomation#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockdataautomation#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteBlueprintInput: - """Delete Blueprint Request""" - - blueprint_arn: str | None = None - """ARN generated at the server side when a Blueprint is created""" - - blueprint_version: str | None = None - """Optional field to delete a specific Blueprint version""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_BLUEPRINT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.blueprint_arn is not None: - serializer.write_string( - _SCHEMA_DELETE_BLUEPRINT_INPUT.members["blueprintArn"], - self.blueprint_arn, - ) - - if self.blueprint_version is not None: - serializer.write_string( - _SCHEMA_DELETE_BLUEPRINT_INPUT.members["blueprintVersion"], - self.blueprint_version, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["blueprint_arn"] = de.read_string( - _SCHEMA_DELETE_BLUEPRINT_INPUT.members["blueprintArn"] - ) - - case 1: - kwargs["blueprint_version"] = de.read_string( - _SCHEMA_DELETE_BLUEPRINT_INPUT.members["blueprintVersion"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_BLUEPRINT_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteBlueprintOutput: - """Delete Blueprint Response""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_BLUEPRINT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_BLUEPRINT_OUTPUT, consumer=_consumer) - return kwargs - - -DELETE_BLUEPRINT = APIOperation( - input=DeleteBlueprintInput, - output=DeleteBlueprintOutput, - schema=_SCHEMA_DELETE_BLUEPRINT, - input_schema=_SCHEMA_DELETE_BLUEPRINT_INPUT, - output_schema=_SCHEMA_DELETE_BLUEPRINT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockdataautomation#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockdataautomation#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetBlueprintInput: - """Get Blueprint Request""" - - blueprint_arn: str | None = None - """ARN generated at the server side when a Blueprint is created""" - - blueprint_version: str | None = None - """Optional field to get a specific Blueprint version""" - - blueprint_stage: str | None = None - """Optional field to get a specific Blueprint stage""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_BLUEPRINT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.blueprint_arn is not None: - serializer.write_string( - _SCHEMA_GET_BLUEPRINT_INPUT.members["blueprintArn"], self.blueprint_arn - ) - - if self.blueprint_version is not None: - serializer.write_string( - _SCHEMA_GET_BLUEPRINT_INPUT.members["blueprintVersion"], - self.blueprint_version, - ) - - if self.blueprint_stage is not None: - serializer.write_string( - _SCHEMA_GET_BLUEPRINT_INPUT.members["blueprintStage"], - self.blueprint_stage, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["blueprint_arn"] = de.read_string( - _SCHEMA_GET_BLUEPRINT_INPUT.members["blueprintArn"] - ) - - case 1: - kwargs["blueprint_version"] = de.read_string( - _SCHEMA_GET_BLUEPRINT_INPUT.members["blueprintVersion"] - ) - - case 2: - kwargs["blueprint_stage"] = BlueprintStage( - de.read_string( - _SCHEMA_GET_BLUEPRINT_INPUT.members["blueprintStage"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_BLUEPRINT_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetBlueprintOutput: - """Get Blueprint Response""" - - blueprint: Blueprint - """Contains the information of a Blueprint.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_BLUEPRINT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_BLUEPRINT_OUTPUT.members["blueprint"], self.blueprint - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["blueprint"] = Blueprint.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_BLUEPRINT_OUTPUT, consumer=_consumer) - if "blueprint" not in kwargs: - kwargs["blueprint"] = Blueprint._smithy_default() - return kwargs - - -GET_BLUEPRINT = APIOperation( - input=GetBlueprintInput, - output=GetBlueprintOutput, - schema=_SCHEMA_GET_BLUEPRINT, - input_schema=_SCHEMA_GET_BLUEPRINT_INPUT, - output_schema=_SCHEMA_GET_BLUEPRINT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockdataautomation#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockdataautomation#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class BlueprintStageFilter(UnknownEnumMixin, StrEnum): - """Blueprint Stage filter""" - - DEVELOPMENT = "DEVELOPMENT" - LIVE = "LIVE" - ALL = "ALL" - - -class DataAutomationProjectStage(UnknownEnumMixin, StrEnum): - """Stage of the Project""" - - DEVELOPMENT = "DEVELOPMENT" - LIVE = "LIVE" - - -@dataclass(kw_only=True) -class DataAutomationProjectFilter: - """Data Automation Project Filter""" - - project_arn: str - """ARN of a DataAutomationProject""" - - project_stage: str | None = None - """Stage of the Project""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DATA_AUTOMATION_PROJECT_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DATA_AUTOMATION_PROJECT_FILTER.members["projectArn"], - self.project_arn, - ) - if self.project_stage is not None: - serializer.write_string( - _SCHEMA_DATA_AUTOMATION_PROJECT_FILTER.members["projectStage"], - self.project_stage, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["project_arn"] = de.read_string( - _SCHEMA_DATA_AUTOMATION_PROJECT_FILTER.members["projectArn"] - ) - - case 1: - kwargs["project_stage"] = DataAutomationProjectStage( - de.read_string( - _SCHEMA_DATA_AUTOMATION_PROJECT_FILTER.members[ - "projectStage" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DATA_AUTOMATION_PROJECT_FILTER, consumer=_consumer - ) - if "project_arn" not in kwargs: - kwargs["project_arn"] = "" - return kwargs - - -class ResourceOwner(UnknownEnumMixin, StrEnum): - """Resource Owner""" - - SERVICE = "SERVICE" - ACCOUNT = "ACCOUNT" - - -@dataclass(kw_only=True) -class ListBlueprintsInput: - """List Blueprint Request""" - - blueprint_arn: str | None = None - """ARN of a Blueprint""" - - resource_owner: str | None = None - """Resource Owner""" - - blueprint_stage_filter: str | None = None - """Blueprint Stage filter""" - - max_results: int | None = None - """Max Results""" - - next_token: str | None = None - """Pagination token""" - - project_filter: DataAutomationProjectFilter | None = None - """Data Automation Project Filter""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_BLUEPRINTS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.blueprint_arn is not None: - serializer.write_string( - _SCHEMA_LIST_BLUEPRINTS_INPUT.members["blueprintArn"], - self.blueprint_arn, - ) - - if self.resource_owner is not None: - serializer.write_string( - _SCHEMA_LIST_BLUEPRINTS_INPUT.members["resourceOwner"], - self.resource_owner, - ) - - if self.blueprint_stage_filter is not None: - serializer.write_string( - _SCHEMA_LIST_BLUEPRINTS_INPUT.members["blueprintStageFilter"], - self.blueprint_stage_filter, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_BLUEPRINTS_INPUT.members["maxResults"], self.max_results - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_BLUEPRINTS_INPUT.members["nextToken"], self.next_token - ) - - if self.project_filter is not None: - serializer.write_struct( - _SCHEMA_LIST_BLUEPRINTS_INPUT.members["projectFilter"], - self.project_filter, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["blueprint_arn"] = de.read_string( - _SCHEMA_LIST_BLUEPRINTS_INPUT.members["blueprintArn"] - ) - - case 1: - kwargs["resource_owner"] = ResourceOwner( - de.read_string( - _SCHEMA_LIST_BLUEPRINTS_INPUT.members["resourceOwner"] - ) - ) - - case 2: - kwargs["blueprint_stage_filter"] = BlueprintStageFilter( - de.read_string( - _SCHEMA_LIST_BLUEPRINTS_INPUT.members[ - "blueprintStageFilter" - ] - ) - ) - - case 3: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_BLUEPRINTS_INPUT.members["maxResults"] - ) - - case 4: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_BLUEPRINTS_INPUT.members["nextToken"] - ) - - case 5: - kwargs["project_filter"] = DataAutomationProjectFilter.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_BLUEPRINTS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class BlueprintSummary: - """Summary of a Blueprint""" - - blueprint_arn: str - """ARN of a Blueprint""" - - creation_time: datetime - """Time Stamp""" - - blueprint_version: str | None = None - """Blueprint Version""" - - blueprint_stage: str | None = None - """Stage of the Blueprint""" - - blueprint_name: str | None = field(repr=False, default=None) - """Name of the Blueprint""" - - last_modified_time: datetime | None = None - """Time Stamp""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BLUEPRINT_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_BLUEPRINT_SUMMARY.members["blueprintArn"], self.blueprint_arn - ) - if self.blueprint_version is not None: - serializer.write_string( - _SCHEMA_BLUEPRINT_SUMMARY.members["blueprintVersion"], - self.blueprint_version, - ) - - if self.blueprint_stage is not None: - serializer.write_string( - _SCHEMA_BLUEPRINT_SUMMARY.members["blueprintStage"], - self.blueprint_stage, - ) - - if self.blueprint_name is not None: - serializer.write_string( - _SCHEMA_BLUEPRINT_SUMMARY.members["blueprintName"], self.blueprint_name - ) - - serializer.write_timestamp( - _SCHEMA_BLUEPRINT_SUMMARY.members["creationTime"], self.creation_time - ) - if self.last_modified_time is not None: - serializer.write_timestamp( - _SCHEMA_BLUEPRINT_SUMMARY.members["lastModifiedTime"], - self.last_modified_time, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["blueprint_arn"] = de.read_string( - _SCHEMA_BLUEPRINT_SUMMARY.members["blueprintArn"] - ) - - case 1: - kwargs["blueprint_version"] = de.read_string( - _SCHEMA_BLUEPRINT_SUMMARY.members["blueprintVersion"] - ) - - case 2: - kwargs["blueprint_stage"] = BlueprintStage( - de.read_string( - _SCHEMA_BLUEPRINT_SUMMARY.members["blueprintStage"] - ) - ) - - case 3: - kwargs["blueprint_name"] = de.read_string( - _SCHEMA_BLUEPRINT_SUMMARY.members["blueprintName"] - ) - - case 4: - kwargs["creation_time"] = de.read_timestamp( - _SCHEMA_BLUEPRINT_SUMMARY.members["creationTime"] - ) - - case 5: - kwargs["last_modified_time"] = de.read_timestamp( - _SCHEMA_BLUEPRINT_SUMMARY.members["lastModifiedTime"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BLUEPRINT_SUMMARY, consumer=_consumer) - if "blueprint_arn" not in kwargs: - kwargs["blueprint_arn"] = "" - if "creation_time" not in kwargs: - kwargs["creation_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_blueprints( - serializer: ShapeSerializer, schema: Schema, value: list[BlueprintSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_blueprints( - deserializer: ShapeDeserializer, schema: Schema -) -> list[BlueprintSummary]: - result: list[BlueprintSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(BlueprintSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListBlueprintsOutput: - """List Blueprint Response""" - - blueprints: list[BlueprintSummary] - """List of Blueprints""" - - next_token: str | None = None - """Pagination token""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_BLUEPRINTS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_blueprints( - serializer, - _SCHEMA_LIST_BLUEPRINTS_OUTPUT.members["blueprints"], - self.blueprints, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_BLUEPRINTS_OUTPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["blueprints"] = _deserialize_blueprints( - de, _SCHEMA_LIST_BLUEPRINTS_OUTPUT.members["blueprints"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_BLUEPRINTS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_BLUEPRINTS_OUTPUT, consumer=_consumer) - if "blueprints" not in kwargs: - kwargs["blueprints"] = [] - return kwargs - - -LIST_BLUEPRINTS = APIOperation( - input=ListBlueprintsInput, - output=ListBlueprintsOutput, - schema=_SCHEMA_LIST_BLUEPRINTS, - input_schema=_SCHEMA_LIST_BLUEPRINTS_INPUT, - output_schema=_SCHEMA_LIST_BLUEPRINTS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockdataautomation#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockdataautomation#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateBlueprintInput: - """Update Blueprint Request""" - - blueprint_arn: str | None = None - """ARN generated at the server side when a Blueprint is created""" - - schema: str | None = field(repr=False, default=None) - """Schema of the blueprint""" - - blueprint_stage: str | None = None - """Stage of the Blueprint""" - - encryption_configuration: EncryptionConfiguration | None = None - """KMS Encryption Configuration""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_BLUEPRINT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.blueprint_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_BLUEPRINT_INPUT.members["blueprintArn"], - self.blueprint_arn, - ) - - if self.schema is not None: - serializer.write_string( - _SCHEMA_UPDATE_BLUEPRINT_INPUT.members["schema"], self.schema - ) - - if self.blueprint_stage is not None: - serializer.write_string( - _SCHEMA_UPDATE_BLUEPRINT_INPUT.members["blueprintStage"], - self.blueprint_stage, - ) - - if self.encryption_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_BLUEPRINT_INPUT.members["encryptionConfiguration"], - self.encryption_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["blueprint_arn"] = de.read_string( - _SCHEMA_UPDATE_BLUEPRINT_INPUT.members["blueprintArn"] - ) - - case 1: - kwargs["schema"] = de.read_string( - _SCHEMA_UPDATE_BLUEPRINT_INPUT.members["schema"] - ) - - case 2: - kwargs["blueprint_stage"] = BlueprintStage( - de.read_string( - _SCHEMA_UPDATE_BLUEPRINT_INPUT.members["blueprintStage"] - ) - ) - - case 3: - kwargs["encryption_configuration"] = ( - EncryptionConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_BLUEPRINT_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateBlueprintOutput: - """Update Blueprint Response""" - - blueprint: Blueprint - """Contains the information of a Blueprint.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_BLUEPRINT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_UPDATE_BLUEPRINT_OUTPUT.members["blueprint"], self.blueprint - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["blueprint"] = Blueprint.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_BLUEPRINT_OUTPUT, consumer=_consumer) - if "blueprint" not in kwargs: - kwargs["blueprint"] = Blueprint._smithy_default() - return kwargs - - -UPDATE_BLUEPRINT = APIOperation( - input=UpdateBlueprintInput, - output=UpdateBlueprintOutput, - schema=_SCHEMA_UPDATE_BLUEPRINT, - input_schema=_SCHEMA_UPDATE_BLUEPRINT_INPUT, - output_schema=_SCHEMA_UPDATE_BLUEPRINT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockdataautomation#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockdataautomation#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class CopyBlueprintStageInput: - """CopyBlueprintStage Request""" - - blueprint_arn: str | None = None - """Blueprint to be copied""" - - source_stage: str | None = None - """Source stage to copy from""" - - target_stage: str | None = None - """Target stage to copy to""" - - client_token: str | None = None - """Client token for idempotency""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_COPY_BLUEPRINT_STAGE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.blueprint_arn is not None: - serializer.write_string( - _SCHEMA_COPY_BLUEPRINT_STAGE_INPUT.members["blueprintArn"], - self.blueprint_arn, - ) - - if self.source_stage is not None: - serializer.write_string( - _SCHEMA_COPY_BLUEPRINT_STAGE_INPUT.members["sourceStage"], - self.source_stage, - ) - - if self.target_stage is not None: - serializer.write_string( - _SCHEMA_COPY_BLUEPRINT_STAGE_INPUT.members["targetStage"], - self.target_stage, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_COPY_BLUEPRINT_STAGE_INPUT.members["clientToken"], - self.client_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["blueprint_arn"] = de.read_string( - _SCHEMA_COPY_BLUEPRINT_STAGE_INPUT.members["blueprintArn"] - ) - - case 1: - kwargs["source_stage"] = BlueprintStage( - de.read_string( - _SCHEMA_COPY_BLUEPRINT_STAGE_INPUT.members["sourceStage"] - ) - ) - - case 2: - kwargs["target_stage"] = BlueprintStage( - de.read_string( - _SCHEMA_COPY_BLUEPRINT_STAGE_INPUT.members["targetStage"] - ) - ) - - case 3: - kwargs["client_token"] = de.read_string( - _SCHEMA_COPY_BLUEPRINT_STAGE_INPUT.members["clientToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_COPY_BLUEPRINT_STAGE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CopyBlueprintStageOutput: - """CopyBlueprintStage Response""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_COPY_BLUEPRINT_STAGE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_COPY_BLUEPRINT_STAGE_OUTPUT, consumer=_consumer - ) - return kwargs - - -COPY_BLUEPRINT_STAGE = APIOperation( - input=CopyBlueprintStageInput, - output=CopyBlueprintStageOutput, - schema=_SCHEMA_COPY_BLUEPRINT_STAGE, - input_schema=_SCHEMA_COPY_BLUEPRINT_STAGE_INPUT, - output_schema=_SCHEMA_COPY_BLUEPRINT_STAGE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockdataautomation#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockdataautomation#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class CreateBlueprintVersionInput: - """Create Blueprint Version Request""" - - blueprint_arn: str | None = None - """ARN generated at the server side when a Blueprint is created""" - - client_token: str | None = None - """Client specified token used for idempotency checks""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_BLUEPRINT_VERSION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.blueprint_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_BLUEPRINT_VERSION_INPUT.members["blueprintArn"], - self.blueprint_arn, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_BLUEPRINT_VERSION_INPUT.members["clientToken"], - self.client_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["blueprint_arn"] = de.read_string( - _SCHEMA_CREATE_BLUEPRINT_VERSION_INPUT.members["blueprintArn"] - ) - - case 1: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_BLUEPRINT_VERSION_INPUT.members["clientToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_BLUEPRINT_VERSION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CreateBlueprintVersionOutput: - """Create Blueprint Version Response""" - - blueprint: Blueprint - """Contains the information of a Blueprint.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_BLUEPRINT_VERSION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CREATE_BLUEPRINT_VERSION_OUTPUT.members["blueprint"], self.blueprint - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["blueprint"] = Blueprint.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_BLUEPRINT_VERSION_OUTPUT, consumer=_consumer - ) - if "blueprint" not in kwargs: - kwargs["blueprint"] = Blueprint._smithy_default() - return kwargs - - -CREATE_BLUEPRINT_VERSION = APIOperation( - input=CreateBlueprintVersionInput, - output=CreateBlueprintVersionOutput, - schema=_SCHEMA_CREATE_BLUEPRINT_VERSION, - input_schema=_SCHEMA_CREATE_BLUEPRINT_VERSION_INPUT, - output_schema=_SCHEMA_CREATE_BLUEPRINT_VERSION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockdataautomation#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockdataautomation#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetDataAutomationLibraryIngestionJobInput: - """Get DataAutomationLibraryIngestionJob Request""" - - library_arn: str | None = None - """ARN generated at the server side when a DataAutomationLibrary is created""" - - job_arn: str | None = None - """ARN of the DataAutomationLibraryIngestionJob""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.library_arn is not None: - serializer.write_string( - _SCHEMA_GET_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_INPUT.members[ - "libraryArn" - ], - self.library_arn, - ) - - if self.job_arn is not None: - serializer.write_string( - _SCHEMA_GET_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_INPUT.members[ - "jobArn" - ], - self.job_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["library_arn"] = de.read_string( - _SCHEMA_GET_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_INPUT.members[ - "libraryArn" - ] - ) - - case 1: - kwargs["job_arn"] = de.read_string( - _SCHEMA_GET_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_INPUT.members[ - "jobArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_INPUT, consumer=_consumer - ) - return kwargs - - -class EntityType(UnknownEnumMixin, StrEnum): - """Entity types supported in DataAutomationLibraries""" - - VOCABULARY = "VOCABULARY" - - -class LibraryIngestionJobStatus(UnknownEnumMixin, StrEnum): - """Status of DataAutomationLibraryIngestionJob""" - - IN_PROGRESS = "IN_PROGRESS" - COMPLETED = "COMPLETED" - COMPLETED_WITH_ERRORS = "COMPLETED_WITH_ERRORS" - FAILED = "FAILED" - - -class LibraryIngestionJobOperationType(UnknownEnumMixin, StrEnum): - """DataAutomationLibraryIngestionJob operation type""" - - UPSERT = "UPSERT" - DELETE = "DELETE" - - -@dataclass(kw_only=True) -class OutputConfiguration: - """Output configuration for DataAutomationLibraryIngestionJob""" - - s3_uri: str - """S3 Uri""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OUTPUT_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_OUTPUT_CONFIGURATION.members["s3Uri"], self.s3_uri - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["s3_uri"] = de.read_string( - _SCHEMA_OUTPUT_CONFIGURATION.members["s3Uri"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_OUTPUT_CONFIGURATION, consumer=_consumer) - if "s3_uri" not in kwargs: - kwargs["s3_uri"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(s3_uri="") - - -@dataclass(kw_only=True) -class DataAutomationLibraryIngestionJob: - """Contains the information of a DataAutomationLibraryIngestionJob""" - - job_arn: str - """ARN of the DataAutomationLibraryIngestionJob""" - - creation_time: datetime - """Timestamp when the DataAutomationLibraryIngestionJob was created""" - - entity_type: str - """The entity type associated with DataAutomationLibraryIngestionJob""" - - operation_type: str - """The operation associated with DataAutomationLibraryIngestionJob""" - - job_status: str - """The status of the DataAutomationLibraryIngestionJob""" - - output_configuration: OutputConfiguration - """Output configuration of DataAutomationLibraryIngestionJob""" - - completion_time: datetime | None = None - """Timestamp when the DataAutomationLibraryIngestionJob was completed""" - - error_message: str | None = None - """Error message""" - - error_type: str | None = None - """Error type""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DATA_AUTOMATION_LIBRARY_INGESTION_JOB, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DATA_AUTOMATION_LIBRARY_INGESTION_JOB.members["jobArn"], - self.job_arn, - ) - serializer.write_timestamp( - _SCHEMA_DATA_AUTOMATION_LIBRARY_INGESTION_JOB.members["creationTime"], - self.creation_time, - ) - serializer.write_string( - _SCHEMA_DATA_AUTOMATION_LIBRARY_INGESTION_JOB.members["entityType"], - self.entity_type, - ) - serializer.write_string( - _SCHEMA_DATA_AUTOMATION_LIBRARY_INGESTION_JOB.members["operationType"], - self.operation_type, - ) - serializer.write_string( - _SCHEMA_DATA_AUTOMATION_LIBRARY_INGESTION_JOB.members["jobStatus"], - self.job_status, - ) - serializer.write_struct( - _SCHEMA_DATA_AUTOMATION_LIBRARY_INGESTION_JOB.members[ - "outputConfiguration" - ], - self.output_configuration, - ) - if self.completion_time is not None: - serializer.write_timestamp( - _SCHEMA_DATA_AUTOMATION_LIBRARY_INGESTION_JOB.members["completionTime"], - self.completion_time, - ) - - if self.error_message is not None: - serializer.write_string( - _SCHEMA_DATA_AUTOMATION_LIBRARY_INGESTION_JOB.members["errorMessage"], - self.error_message, - ) - - if self.error_type is not None: - serializer.write_string( - _SCHEMA_DATA_AUTOMATION_LIBRARY_INGESTION_JOB.members["errorType"], - self.error_type, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["job_arn"] = de.read_string( - _SCHEMA_DATA_AUTOMATION_LIBRARY_INGESTION_JOB.members["jobArn"] - ) - - case 1: - kwargs["creation_time"] = de.read_timestamp( - _SCHEMA_DATA_AUTOMATION_LIBRARY_INGESTION_JOB.members[ - "creationTime" - ] - ) - - case 2: - kwargs["entity_type"] = EntityType( - de.read_string( - _SCHEMA_DATA_AUTOMATION_LIBRARY_INGESTION_JOB.members[ - "entityType" - ] - ) - ) - - case 3: - kwargs["operation_type"] = LibraryIngestionJobOperationType( - de.read_string( - _SCHEMA_DATA_AUTOMATION_LIBRARY_INGESTION_JOB.members[ - "operationType" - ] - ) - ) - - case 4: - kwargs["job_status"] = LibraryIngestionJobStatus( - de.read_string( - _SCHEMA_DATA_AUTOMATION_LIBRARY_INGESTION_JOB.members[ - "jobStatus" - ] - ) - ) - - case 5: - kwargs["output_configuration"] = OutputConfiguration.deserialize(de) - - case 6: - kwargs["completion_time"] = de.read_timestamp( - _SCHEMA_DATA_AUTOMATION_LIBRARY_INGESTION_JOB.members[ - "completionTime" - ] - ) - - case 7: - kwargs["error_message"] = de.read_string( - _SCHEMA_DATA_AUTOMATION_LIBRARY_INGESTION_JOB.members[ - "errorMessage" - ] - ) - - case 8: - kwargs["error_type"] = de.read_string( - _SCHEMA_DATA_AUTOMATION_LIBRARY_INGESTION_JOB.members[ - "errorType" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DATA_AUTOMATION_LIBRARY_INGESTION_JOB, consumer=_consumer - ) - if "job_arn" not in kwargs: - kwargs["job_arn"] = "" - if "creation_time" not in kwargs: - kwargs["creation_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "entity_type" not in kwargs: - kwargs["entity_type"] = EntityType._corrected("") - if "operation_type" not in kwargs: - kwargs["operation_type"] = LibraryIngestionJobOperationType._corrected("") - if "job_status" not in kwargs: - kwargs["job_status"] = LibraryIngestionJobStatus._corrected("") - if "output_configuration" not in kwargs: - kwargs["output_configuration"] = OutputConfiguration._smithy_default() - return kwargs - - -@dataclass(kw_only=True) -class GetDataAutomationLibraryIngestionJobOutput: - """Get DataAutomationLibraryIngestionJob Response""" - - job: DataAutomationLibraryIngestionJob | None = None - """Contains the information of a library ingestion job""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.job is not None: - serializer.write_struct( - _SCHEMA_GET_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_OUTPUT.members["job"], - self.job, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["job"] = DataAutomationLibraryIngestionJob.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_DATA_AUTOMATION_LIBRARY_INGESTION_JOB = APIOperation( - input=GetDataAutomationLibraryIngestionJobInput, - output=GetDataAutomationLibraryIngestionJobOutput, - schema=_SCHEMA_GET_DATA_AUTOMATION_LIBRARY_INGESTION_JOB, - input_schema=_SCHEMA_GET_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_INPUT, - output_schema=_SCHEMA_GET_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockdataautomation#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockdataautomation#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -def _serialize_entity_id_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_entity_id_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class DeleteEntitiesInfo: - """Input for entities needed to be deleted""" - - entity_ids: list[str] - """List of EntityId""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_ENTITIES_INFO, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_entity_id_list( - serializer, - _SCHEMA_DELETE_ENTITIES_INFO.members["entityIds"], - self.entity_ids, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["entity_ids"] = _deserialize_entity_id_list( - de, _SCHEMA_DELETE_ENTITIES_INFO.members["entityIds"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_ENTITIES_INFO, consumer=_consumer) - if "entity_ids" not in kwargs: - kwargs["entity_ids"] = [] - return kwargs - - -class Language(UnknownEnumMixin, StrEnum): - """Supported input languages""" - - EN = "EN" - DE = "DE" - ES = "ES" - FR = "FR" - IT = "IT" - PT = "PT" - JA = "JA" - KO = "KO" - CN = "CN" - TW = "TW" - HK = "HK" - - -@dataclass(kw_only=True) -class Phrase: - """Phrase structure for vocabulary""" - - text: str = field(repr=False) - """Text content of the phrase""" - - display_as_text: str | None = field(repr=False, default=None) - """Text to configure how phrase is displayed in Transcript""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PHRASE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_PHRASE.members["text"], self.text) - if self.display_as_text is not None: - serializer.write_string( - _SCHEMA_PHRASE.members["displayAsText"], self.display_as_text - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["text"] = de.read_string(_SCHEMA_PHRASE.members["text"]) - - case 1: - kwargs["display_as_text"] = de.read_string( - _SCHEMA_PHRASE.members["displayAsText"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PHRASE, consumer=_consumer) - if "text" not in kwargs: - kwargs["text"] = "" - return kwargs - - -def _serialize_phrase_list( - serializer: ShapeSerializer, schema: Schema, value: list[Phrase] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_phrase_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Phrase]: - result: list[Phrase] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Phrase.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class VocabularyEntityInfo: - """Vocabulary entity info with detailed information""" - - language: str - """Supported input languages""" - - phrases: list[Phrase] - """List of phrases""" - - entity_id: str | None = None - """Unique identifier for the entity""" - - description: str | None = field(repr=False, default=None) - """Description of the entity""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VOCABULARY_ENTITY_INFO, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.entity_id is not None: - serializer.write_string( - _SCHEMA_VOCABULARY_ENTITY_INFO.members["entityId"], self.entity_id - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_VOCABULARY_ENTITY_INFO.members["description"], self.description - ) - - serializer.write_string( - _SCHEMA_VOCABULARY_ENTITY_INFO.members["language"], self.language - ) - _serialize_phrase_list( - serializer, _SCHEMA_VOCABULARY_ENTITY_INFO.members["phrases"], self.phrases - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["entity_id"] = de.read_string( - _SCHEMA_VOCABULARY_ENTITY_INFO.members["entityId"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_VOCABULARY_ENTITY_INFO.members["description"] - ) - - case 2: - kwargs["language"] = Language( - de.read_string( - _SCHEMA_VOCABULARY_ENTITY_INFO.members["language"] - ) - ) - - case 3: - kwargs["phrases"] = _deserialize_phrase_list( - de, _SCHEMA_VOCABULARY_ENTITY_INFO.members["phrases"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VOCABULARY_ENTITY_INFO, consumer=_consumer) - if "language" not in kwargs: - kwargs["language"] = Language._corrected("") - if "phrases" not in kwargs: - kwargs["phrases"] = [] - return kwargs - - -@dataclass -class UpsertEntityInfoVocabulary: - """Vocabulary entity info with detailed information""" - - value: VocabularyEntityInfo - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPSERT_ENTITY_INFO, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_UPSERT_ENTITY_INFO.members["vocabulary"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=VocabularyEntityInfo.deserialize(deserializer)) - - -@dataclass -class UpsertEntityInfoUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -UpsertEntityInfo = Union[UpsertEntityInfoVocabulary | UpsertEntityInfoUnknown] -""" -Input configuration for upserting data in a -DataAutomationLibraryIngestionJob -""" - - -class _UpsertEntityInfoDeserializer: - _result: UpsertEntityInfo | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> UpsertEntityInfo: - self._result = None - deserializer.read_struct(_SCHEMA_UPSERT_ENTITY_INFO, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(UpsertEntityInfoVocabulary.deserialize(de)) - - case _: - self._set_result( - UpsertEntityInfoUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: UpsertEntityInfo) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_upsert_entities_info( - serializer: ShapeSerializer, schema: Schema, value: list[UpsertEntityInfo] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_upsert_entities_info( - deserializer: ShapeDeserializer, schema: Schema -) -> list[UpsertEntityInfo]: - result: list[UpsertEntityInfo] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_UpsertEntityInfoDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass -class InlinePayloadUpsertEntitiesInfo: - """ - List of UpsertEntityInfo for upserting data in a - DataAutomationLibraryIngestionJob - """ - - value: list[UpsertEntityInfo] - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INLINE_PAYLOAD, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_upsert_entities_info( - serializer, _SCHEMA_INLINE_PAYLOAD.members["upsertEntitiesInfo"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_deserialize_upsert_entities_info( - deserializer, _SCHEMA_INLINE_PAYLOAD.members["upsertEntitiesInfo"] - ) - ) - - -@dataclass -class InlinePayloadDeleteEntitiesInfo: - """Input for entities needed to be deleted""" - - value: DeleteEntitiesInfo - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INLINE_PAYLOAD, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INLINE_PAYLOAD.members["deleteEntitiesInfo"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=DeleteEntitiesInfo.deserialize(deserializer)) - - -@dataclass -class InlinePayloadUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -InlinePayload = Union[ - InlinePayloadUpsertEntitiesInfo - | InlinePayloadDeleteEntitiesInfo - | InlinePayloadUnknown -] -"""Input payload structure definition""" - - -class _InlinePayloadDeserializer: - _result: InlinePayload | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> InlinePayload: - self._result = None - deserializer.read_struct(_SCHEMA_INLINE_PAYLOAD, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(InlinePayloadUpsertEntitiesInfo.deserialize(de)) - - case 1: - self._set_result(InlinePayloadDeleteEntitiesInfo.deserialize(de)) - - case _: - self._set_result(InlinePayloadUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: InlinePayload) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class InputConfiguration: - """Input configuration for DataAutomationLibraryIngestionJob""" - - s3_object: S3Object | None = None - """S3 object""" - - inline_payload: InlinePayload | None = None - """Input Payload""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INPUT_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.s3_object is not None: - serializer.write_struct( - _SCHEMA_INPUT_CONFIGURATION.members["s3Object"], self.s3_object - ) - - if self.inline_payload is not None: - serializer.write_struct( - _SCHEMA_INPUT_CONFIGURATION.members["inlinePayload"], - self.inline_payload, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["s3_object"] = S3Object.deserialize(de) - - case 1: - kwargs["inline_payload"] = _InlinePayloadDeserializer().deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INPUT_CONFIGURATION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class EventBridgeConfiguration: - """Event bridge configuration.""" - - event_bridge_enabled: bool - """Event bridge flag.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVENT_BRIDGE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_boolean( - _SCHEMA_EVENT_BRIDGE_CONFIGURATION.members["eventBridgeEnabled"], - self.event_bridge_enabled, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["event_bridge_enabled"] = de.read_boolean( - _SCHEMA_EVENT_BRIDGE_CONFIGURATION.members["eventBridgeEnabled"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EVENT_BRIDGE_CONFIGURATION, consumer=_consumer) - if "event_bridge_enabled" not in kwargs: - kwargs["event_bridge_enabled"] = False - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(event_bridge_enabled=False) - - -@dataclass(kw_only=True) -class NotificationConfiguration: - """Notification configuration.""" - - event_bridge_configuration: EventBridgeConfiguration - """Event bridge configuration.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_NOTIFICATION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_NOTIFICATION_CONFIGURATION.members["eventBridgeConfiguration"], - self.event_bridge_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["event_bridge_configuration"] = ( - EventBridgeConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_NOTIFICATION_CONFIGURATION, consumer=_consumer) - if "event_bridge_configuration" not in kwargs: - kwargs["event_bridge_configuration"] = ( - EventBridgeConfiguration._smithy_default() - ) - return kwargs - - -@dataclass(kw_only=True) -class InvokeDataAutomationLibraryIngestionJobInput: - """Invoke DataAutomationLibraryIngestionJob Request""" - - library_arn: str | None = None - """ARN generated at the server side when a DataAutomationLibrary is created""" - - client_token: str | None = None - """Idempotency token""" - - input_configuration: InputConfiguration | None = None - """Input configuration of DataAutomationLibraryIngestionJob request""" - - entity_type: str | None = None - """The entity type for which DataAutomationLibraryIngestionJob is being run""" - - operation_type: str | None = None - """The operation to be performed by DataAutomationLibraryIngestionJob""" - - output_configuration: OutputConfiguration | None = None - """Output configuration of DataAutomationLibraryIngestionJob""" - - notification_configuration: NotificationConfiguration | None = None - """Notification configuration.""" - - tags: list[Tag] | None = None - """List of tags""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.library_arn is not None: - serializer.write_string( - _SCHEMA_INVOKE_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_INPUT.members[ - "libraryArn" - ], - self.library_arn, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_INVOKE_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_INPUT.members[ - "clientToken" - ], - self.client_token, - ) - - if self.input_configuration is not None: - serializer.write_struct( - _SCHEMA_INVOKE_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_INPUT.members[ - "inputConfiguration" - ], - self.input_configuration, - ) - - if self.entity_type is not None: - serializer.write_string( - _SCHEMA_INVOKE_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_INPUT.members[ - "entityType" - ], - self.entity_type, - ) - - if self.operation_type is not None: - serializer.write_string( - _SCHEMA_INVOKE_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_INPUT.members[ - "operationType" - ], - self.operation_type, - ) - - if self.output_configuration is not None: - serializer.write_struct( - _SCHEMA_INVOKE_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_INPUT.members[ - "outputConfiguration" - ], - self.output_configuration, - ) - - if self.notification_configuration is not None: - serializer.write_struct( - _SCHEMA_INVOKE_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_INPUT.members[ - "notificationConfiguration" - ], - self.notification_configuration, - ) - - if self.tags is not None: - _serialize_tag_list( - serializer, - _SCHEMA_INVOKE_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_INPUT.members[ - "tags" - ], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["library_arn"] = de.read_string( - _SCHEMA_INVOKE_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_INPUT.members[ - "libraryArn" - ] - ) - - case 1: - kwargs["client_token"] = de.read_string( - _SCHEMA_INVOKE_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_INPUT.members[ - "clientToken" - ] - ) - - case 2: - kwargs["input_configuration"] = InputConfiguration.deserialize(de) - - case 3: - kwargs["entity_type"] = EntityType( - de.read_string( - _SCHEMA_INVOKE_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_INPUT.members[ - "entityType" - ] - ) - ) - - case 4: - kwargs["operation_type"] = LibraryIngestionJobOperationType( - de.read_string( - _SCHEMA_INVOKE_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_INPUT.members[ - "operationType" - ] - ) - ) - - case 5: - kwargs["output_configuration"] = OutputConfiguration.deserialize(de) - - case 6: - kwargs["notification_configuration"] = ( - NotificationConfiguration.deserialize(de) - ) - - case 7: - kwargs["tags"] = _deserialize_tag_list( - de, - _SCHEMA_INVOKE_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_INPUT.members[ - "tags" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVOKE_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_INPUT, - consumer=_consumer, - ) - return kwargs - - -@dataclass(kw_only=True) -class InvokeDataAutomationLibraryIngestionJobOutput: - """Invoke DataAutomationLibraryIngestionJob Response""" - - job_arn: str | None = None - """ARN of the DataAutomationLibraryIngestionJob""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.job_arn is not None: - serializer.write_string( - _SCHEMA_INVOKE_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_OUTPUT.members[ - "jobArn" - ], - self.job_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["job_arn"] = de.read_string( - _SCHEMA_INVOKE_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_OUTPUT.members[ - "jobArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVOKE_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_OUTPUT, - consumer=_consumer, - ) - return kwargs - - -INVOKE_DATA_AUTOMATION_LIBRARY_INGESTION_JOB = APIOperation( - input=InvokeDataAutomationLibraryIngestionJobInput, - output=InvokeDataAutomationLibraryIngestionJobOutput, - schema=_SCHEMA_INVOKE_DATA_AUTOMATION_LIBRARY_INGESTION_JOB, - input_schema=_SCHEMA_INVOKE_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_INPUT, - output_schema=_SCHEMA_INVOKE_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockdataautomation#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockdataautomation#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListDataAutomationLibraryIngestionJobsInput: - """List DataAutomationLibraryIngestionJobs Request""" - - library_arn: str | None = None - """ARN generated at the server side when a DataAutomationLibrary is created""" - - max_results: int | None = None - """Max Results""" - - next_token: str | None = None - """Pagination token for retrieving the next set of results""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_LIST_DATA_AUTOMATION_LIBRARY_INGESTION_JOBS_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.library_arn is not None: - serializer.write_string( - _SCHEMA_LIST_DATA_AUTOMATION_LIBRARY_INGESTION_JOBS_INPUT.members[ - "libraryArn" - ], - self.library_arn, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_DATA_AUTOMATION_LIBRARY_INGESTION_JOBS_INPUT.members[ - "maxResults" - ], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_DATA_AUTOMATION_LIBRARY_INGESTION_JOBS_INPUT.members[ - "nextToken" - ], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["library_arn"] = de.read_string( - _SCHEMA_LIST_DATA_AUTOMATION_LIBRARY_INGESTION_JOBS_INPUT.members[ - "libraryArn" - ] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_DATA_AUTOMATION_LIBRARY_INGESTION_JOBS_INPUT.members[ - "maxResults" - ] - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_DATA_AUTOMATION_LIBRARY_INGESTION_JOBS_INPUT.members[ - "nextToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_DATA_AUTOMATION_LIBRARY_INGESTION_JOBS_INPUT, - consumer=_consumer, - ) - return kwargs - - -@dataclass(kw_only=True) -class DataAutomationLibraryIngestionJobSummary: - """Summary of a DataAutomationLibraryIngestionJob""" - - job_arn: str - """ARN of the DataAutomationLibraryIngestionJob""" - - job_status: str - """Status of DataAutomationLibraryIngestionJob""" - - entity_type: str - """Entity types supported in DataAutomationLibraries""" - - operation_type: str - """DataAutomationLibraryIngestionJob operation type""" - - creation_time: datetime - """Time Stamp""" - - completion_time: datetime | None = None - """Time Stamp""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_SUMMARY, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_SUMMARY.members["jobArn"], - self.job_arn, - ) - serializer.write_string( - _SCHEMA_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_SUMMARY.members["jobStatus"], - self.job_status, - ) - serializer.write_string( - _SCHEMA_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_SUMMARY.members["entityType"], - self.entity_type, - ) - serializer.write_string( - _SCHEMA_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_SUMMARY.members[ - "operationType" - ], - self.operation_type, - ) - serializer.write_timestamp( - _SCHEMA_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_SUMMARY.members[ - "creationTime" - ], - self.creation_time, - ) - if self.completion_time is not None: - serializer.write_timestamp( - _SCHEMA_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_SUMMARY.members[ - "completionTime" - ], - self.completion_time, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["job_arn"] = de.read_string( - _SCHEMA_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_SUMMARY.members[ - "jobArn" - ] - ) - - case 1: - kwargs["job_status"] = LibraryIngestionJobStatus( - de.read_string( - _SCHEMA_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_SUMMARY.members[ - "jobStatus" - ] - ) - ) - - case 2: - kwargs["entity_type"] = EntityType( - de.read_string( - _SCHEMA_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_SUMMARY.members[ - "entityType" - ] - ) - ) - - case 3: - kwargs["operation_type"] = LibraryIngestionJobOperationType( - de.read_string( - _SCHEMA_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_SUMMARY.members[ - "operationType" - ] - ) - ) - - case 4: - kwargs["creation_time"] = de.read_timestamp( - _SCHEMA_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_SUMMARY.members[ - "creationTime" - ] - ) - - case 5: - kwargs["completion_time"] = de.read_timestamp( - _SCHEMA_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_SUMMARY.members[ - "completionTime" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_SUMMARY, consumer=_consumer - ) - if "job_arn" not in kwargs: - kwargs["job_arn"] = "" - if "job_status" not in kwargs: - kwargs["job_status"] = LibraryIngestionJobStatus._corrected("") - if "entity_type" not in kwargs: - kwargs["entity_type"] = EntityType._corrected("") - if "operation_type" not in kwargs: - kwargs["operation_type"] = LibraryIngestionJobOperationType._corrected("") - if "creation_time" not in kwargs: - kwargs["creation_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_data_automation_library_ingestion_job_summaries( - serializer: ShapeSerializer, - schema: Schema, - value: list[DataAutomationLibraryIngestionJobSummary], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_data_automation_library_ingestion_job_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[DataAutomationLibraryIngestionJobSummary]: - result: list[DataAutomationLibraryIngestionJobSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(DataAutomationLibraryIngestionJobSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListDataAutomationLibraryIngestionJobsOutput: - """List DataAutomationLibraryIngestionJobs Response""" - - jobs: list[DataAutomationLibraryIngestionJobSummary] | None = None - """List of data automation library ingestion jobs""" - - next_token: str | None = None - """Pagination token for retrieving the next set of results""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_LIST_DATA_AUTOMATION_LIBRARY_INGESTION_JOBS_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.jobs is not None: - _serialize_data_automation_library_ingestion_job_summaries( - serializer, - _SCHEMA_LIST_DATA_AUTOMATION_LIBRARY_INGESTION_JOBS_OUTPUT.members[ - "jobs" - ], - self.jobs, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_DATA_AUTOMATION_LIBRARY_INGESTION_JOBS_OUTPUT.members[ - "nextToken" - ], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["jobs"] = ( - _deserialize_data_automation_library_ingestion_job_summaries( - de, - _SCHEMA_LIST_DATA_AUTOMATION_LIBRARY_INGESTION_JOBS_OUTPUT.members[ - "jobs" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_DATA_AUTOMATION_LIBRARY_INGESTION_JOBS_OUTPUT.members[ - "nextToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_DATA_AUTOMATION_LIBRARY_INGESTION_JOBS_OUTPUT, - consumer=_consumer, - ) - return kwargs - - -LIST_DATA_AUTOMATION_LIBRARY_INGESTION_JOBS = APIOperation( - input=ListDataAutomationLibraryIngestionJobsInput, - output=ListDataAutomationLibraryIngestionJobsOutput, - schema=_SCHEMA_LIST_DATA_AUTOMATION_LIBRARY_INGESTION_JOBS, - input_schema=_SCHEMA_LIST_DATA_AUTOMATION_LIBRARY_INGESTION_JOBS_INPUT, - output_schema=_SCHEMA_LIST_DATA_AUTOMATION_LIBRARY_INGESTION_JOBS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockdataautomation#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockdataautomation#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class CreateDataAutomationLibraryInput: - """Create DataAutomationLibrary Request""" - - library_name: str | None = field(repr=False, default=None) - """Name of the DataAutomationLibrary""" - - library_description: str | None = field(repr=False, default=None) - """Description of the DataAutomationLibrary""" - - client_token: str | None = None - """Client specified token used for idempotency checks""" - - encryption_configuration: EncryptionConfiguration | None = None - """KMS Encryption Configuration""" - - tags: list[Tag] | None = None - """List of tags""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_DATA_AUTOMATION_LIBRARY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.library_name is not None: - serializer.write_string( - _SCHEMA_CREATE_DATA_AUTOMATION_LIBRARY_INPUT.members["libraryName"], - self.library_name, - ) - - if self.library_description is not None: - serializer.write_string( - _SCHEMA_CREATE_DATA_AUTOMATION_LIBRARY_INPUT.members[ - "libraryDescription" - ], - self.library_description, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_DATA_AUTOMATION_LIBRARY_INPUT.members["clientToken"], - self.client_token, - ) - - if self.encryption_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_DATA_AUTOMATION_LIBRARY_INPUT.members[ - "encryptionConfiguration" - ], - self.encryption_configuration, - ) - - if self.tags is not None: - _serialize_tag_list( - serializer, - _SCHEMA_CREATE_DATA_AUTOMATION_LIBRARY_INPUT.members["tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["library_name"] = de.read_string( - _SCHEMA_CREATE_DATA_AUTOMATION_LIBRARY_INPUT.members[ - "libraryName" - ] - ) - - case 1: - kwargs["library_description"] = de.read_string( - _SCHEMA_CREATE_DATA_AUTOMATION_LIBRARY_INPUT.members[ - "libraryDescription" - ] - ) - - case 2: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_DATA_AUTOMATION_LIBRARY_INPUT.members[ - "clientToken" - ] - ) - - case 3: - kwargs["encryption_configuration"] = ( - EncryptionConfiguration.deserialize(de) - ) - - case 4: - kwargs["tags"] = _deserialize_tag_list( - de, _SCHEMA_CREATE_DATA_AUTOMATION_LIBRARY_INPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_DATA_AUTOMATION_LIBRARY_INPUT, consumer=_consumer - ) - return kwargs - - -class DataAutomationLibraryStatus(UnknownEnumMixin, StrEnum): - """Status of DataAutomationLibrary""" - - ACTIVE = "ACTIVE" - DELETING = "DELETING" - - -@dataclass(kw_only=True) -class CreateDataAutomationLibraryOutput: - """Create DataAutomationLibrary Response""" - - library_arn: str | None = None - """ARN generated at the server side when a DataAutomationLibrary is created""" - - status: str | None = None - """Status of DataAutomationLibrary""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_DATA_AUTOMATION_LIBRARY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.library_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_DATA_AUTOMATION_LIBRARY_OUTPUT.members["libraryArn"], - self.library_arn, - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_CREATE_DATA_AUTOMATION_LIBRARY_OUTPUT.members["status"], - self.status, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["library_arn"] = de.read_string( - _SCHEMA_CREATE_DATA_AUTOMATION_LIBRARY_OUTPUT.members[ - "libraryArn" - ] - ) - - case 1: - kwargs["status"] = DataAutomationLibraryStatus( - de.read_string( - _SCHEMA_CREATE_DATA_AUTOMATION_LIBRARY_OUTPUT.members[ - "status" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_DATA_AUTOMATION_LIBRARY_OUTPUT, consumer=_consumer - ) - return kwargs - - -CREATE_DATA_AUTOMATION_LIBRARY = APIOperation( - input=CreateDataAutomationLibraryInput, - output=CreateDataAutomationLibraryOutput, - schema=_SCHEMA_CREATE_DATA_AUTOMATION_LIBRARY, - input_schema=_SCHEMA_CREATE_DATA_AUTOMATION_LIBRARY_INPUT, - output_schema=_SCHEMA_CREATE_DATA_AUTOMATION_LIBRARY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockdataautomation#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockdataautomation#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteDataAutomationLibraryInput: - """Delete DataAutomationLibrary Request""" - - library_arn: str | None = None - """ARN generated at the server side when a DataAutomationLibrary is created""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_DATA_AUTOMATION_LIBRARY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.library_arn is not None: - serializer.write_string( - _SCHEMA_DELETE_DATA_AUTOMATION_LIBRARY_INPUT.members["libraryArn"], - self.library_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["library_arn"] = de.read_string( - _SCHEMA_DELETE_DATA_AUTOMATION_LIBRARY_INPUT.members[ - "libraryArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_DATA_AUTOMATION_LIBRARY_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteDataAutomationLibraryOutput: - """Delete DataAutomationLibrary Response""" - - library_arn: str | None = None - """ARN generated at the server side when a DataAutomationLibrary is created""" - - status: str | None = None - """Status of DataAutomationLibrary""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_DATA_AUTOMATION_LIBRARY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.library_arn is not None: - serializer.write_string( - _SCHEMA_DELETE_DATA_AUTOMATION_LIBRARY_OUTPUT.members["libraryArn"], - self.library_arn, - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_DELETE_DATA_AUTOMATION_LIBRARY_OUTPUT.members["status"], - self.status, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["library_arn"] = de.read_string( - _SCHEMA_DELETE_DATA_AUTOMATION_LIBRARY_OUTPUT.members[ - "libraryArn" - ] - ) - - case 1: - kwargs["status"] = DataAutomationLibraryStatus( - de.read_string( - _SCHEMA_DELETE_DATA_AUTOMATION_LIBRARY_OUTPUT.members[ - "status" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_DATA_AUTOMATION_LIBRARY_OUTPUT, consumer=_consumer - ) - return kwargs - - -DELETE_DATA_AUTOMATION_LIBRARY = APIOperation( - input=DeleteDataAutomationLibraryInput, - output=DeleteDataAutomationLibraryOutput, - schema=_SCHEMA_DELETE_DATA_AUTOMATION_LIBRARY, - input_schema=_SCHEMA_DELETE_DATA_AUTOMATION_LIBRARY_INPUT, - output_schema=_SCHEMA_DELETE_DATA_AUTOMATION_LIBRARY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockdataautomation#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockdataautomation#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetDataAutomationLibraryInput: - """Get DataAutomationLibrary Request""" - - library_arn: str | None = None - """ARN generated at the server side when a DataAutomationLibrary is created""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DATA_AUTOMATION_LIBRARY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.library_arn is not None: - serializer.write_string( - _SCHEMA_GET_DATA_AUTOMATION_LIBRARY_INPUT.members["libraryArn"], - self.library_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["library_arn"] = de.read_string( - _SCHEMA_GET_DATA_AUTOMATION_LIBRARY_INPUT.members["libraryArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_DATA_AUTOMATION_LIBRARY_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class EntityTypeInfo: - """Information about an entity type in the DataAutomationLibrary""" - - entity_type: str - """Entity types supported in DataAutomationLibraries""" - - entity_metadata: str | None = None - """JSON string representing relevant metadata for the entity type""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ENTITY_TYPE_INFO, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_ENTITY_TYPE_INFO.members["entityType"], self.entity_type - ) - if self.entity_metadata is not None: - serializer.write_string( - _SCHEMA_ENTITY_TYPE_INFO.members["entityMetadata"], self.entity_metadata - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["entity_type"] = EntityType( - de.read_string(_SCHEMA_ENTITY_TYPE_INFO.members["entityType"]) - ) - - case 1: - kwargs["entity_metadata"] = de.read_string( - _SCHEMA_ENTITY_TYPE_INFO.members["entityMetadata"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ENTITY_TYPE_INFO, consumer=_consumer) - if "entity_type" not in kwargs: - kwargs["entity_type"] = EntityType._corrected("") - return kwargs - - -def _serialize_entity_type_info_list( - serializer: ShapeSerializer, schema: Schema, value: list[EntityTypeInfo] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_entity_type_info_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[EntityTypeInfo]: - result: list[EntityTypeInfo] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(EntityTypeInfo.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class DataAutomationLibrary: - """Contains the information of a DataAutomationLibrary.""" - - library_arn: str - """ARN generated at the server side when a DataAutomationLibrary is created""" - - creation_time: datetime - """Time Stamp""" - - library_name: str = field(repr=False) - """Name of the DataAutomationLibrary""" - - status: str - """Status of DataAutomationLibrary""" - - library_description: str | None = field(repr=False, default=None) - """Description of the DataAutomationLibrary""" - - entity_types: list[EntityTypeInfo] | None = None - """List of info for each entity type in the DataAutomationLibrary""" - - kms_key_id: str | None = None - """KMS Key Identifier""" - - kms_encryption_context: dict[str, str] | None = None - """KMS Encryption Context""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DATA_AUTOMATION_LIBRARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DATA_AUTOMATION_LIBRARY.members["libraryArn"], self.library_arn - ) - serializer.write_timestamp( - _SCHEMA_DATA_AUTOMATION_LIBRARY.members["creationTime"], self.creation_time - ) - serializer.write_string( - _SCHEMA_DATA_AUTOMATION_LIBRARY.members["libraryName"], self.library_name - ) - if self.library_description is not None: - serializer.write_string( - _SCHEMA_DATA_AUTOMATION_LIBRARY.members["libraryDescription"], - self.library_description, - ) - - serializer.write_string( - _SCHEMA_DATA_AUTOMATION_LIBRARY.members["status"], self.status - ) - if self.entity_types is not None: - _serialize_entity_type_info_list( - serializer, - _SCHEMA_DATA_AUTOMATION_LIBRARY.members["entityTypes"], - self.entity_types, - ) - - if self.kms_key_id is not None: - serializer.write_string( - _SCHEMA_DATA_AUTOMATION_LIBRARY.members["kmsKeyId"], self.kms_key_id - ) - - if self.kms_encryption_context is not None: - _serialize_kms_encryption_context( - serializer, - _SCHEMA_DATA_AUTOMATION_LIBRARY.members["kmsEncryptionContext"], - self.kms_encryption_context, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["library_arn"] = de.read_string( - _SCHEMA_DATA_AUTOMATION_LIBRARY.members["libraryArn"] - ) - - case 1: - kwargs["creation_time"] = de.read_timestamp( - _SCHEMA_DATA_AUTOMATION_LIBRARY.members["creationTime"] - ) - - case 2: - kwargs["library_name"] = de.read_string( - _SCHEMA_DATA_AUTOMATION_LIBRARY.members["libraryName"] - ) - - case 3: - kwargs["library_description"] = de.read_string( - _SCHEMA_DATA_AUTOMATION_LIBRARY.members["libraryDescription"] - ) - - case 4: - kwargs["status"] = DataAutomationLibraryStatus( - de.read_string( - _SCHEMA_DATA_AUTOMATION_LIBRARY.members["status"] - ) - ) - - case 5: - kwargs["entity_types"] = _deserialize_entity_type_info_list( - de, _SCHEMA_DATA_AUTOMATION_LIBRARY.members["entityTypes"] - ) - - case 6: - kwargs["kms_key_id"] = de.read_string( - _SCHEMA_DATA_AUTOMATION_LIBRARY.members["kmsKeyId"] - ) - - case 7: - kwargs["kms_encryption_context"] = ( - _deserialize_kms_encryption_context( - de, - _SCHEMA_DATA_AUTOMATION_LIBRARY.members[ - "kmsEncryptionContext" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DATA_AUTOMATION_LIBRARY, consumer=_consumer) - if "library_arn" not in kwargs: - kwargs["library_arn"] = "" - if "creation_time" not in kwargs: - kwargs["creation_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "library_name" not in kwargs: - kwargs["library_name"] = "" - if "status" not in kwargs: - kwargs["status"] = DataAutomationLibraryStatus._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class GetDataAutomationLibraryOutput: - """Get DataAutomationLibrary Response""" - - library: DataAutomationLibrary | None = None - """Contains the information of a DataAutomationLibrary.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DATA_AUTOMATION_LIBRARY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.library is not None: - serializer.write_struct( - _SCHEMA_GET_DATA_AUTOMATION_LIBRARY_OUTPUT.members["library"], - self.library, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["library"] = DataAutomationLibrary.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_DATA_AUTOMATION_LIBRARY_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_DATA_AUTOMATION_LIBRARY = APIOperation( - input=GetDataAutomationLibraryInput, - output=GetDataAutomationLibraryOutput, - schema=_SCHEMA_GET_DATA_AUTOMATION_LIBRARY, - input_schema=_SCHEMA_GET_DATA_AUTOMATION_LIBRARY_INPUT, - output_schema=_SCHEMA_GET_DATA_AUTOMATION_LIBRARY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockdataautomation#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockdataautomation#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListDataAutomationLibrariesInput: - """List DataAutomationLibraries Request""" - - max_results: int | None = None - """Max Results""" - - next_token: str | None = None - """Pagination token""" - - project_filter: DataAutomationProjectFilter | None = None - """Data Automation Project Filter""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_DATA_AUTOMATION_LIBRARIES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_DATA_AUTOMATION_LIBRARIES_INPUT.members["maxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_DATA_AUTOMATION_LIBRARIES_INPUT.members["nextToken"], - self.next_token, - ) - - if self.project_filter is not None: - serializer.write_struct( - _SCHEMA_LIST_DATA_AUTOMATION_LIBRARIES_INPUT.members["projectFilter"], - self.project_filter, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_DATA_AUTOMATION_LIBRARIES_INPUT.members[ - "maxResults" - ] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_DATA_AUTOMATION_LIBRARIES_INPUT.members[ - "nextToken" - ] - ) - - case 2: - kwargs["project_filter"] = DataAutomationProjectFilter.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_DATA_AUTOMATION_LIBRARIES_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DataAutomationLibrarySummary: - """Summary of a DataAutomationLibrary""" - - library_arn: str - """ARN generated at the server side when a DataAutomationLibrary is created""" - - creation_time: datetime - """Time Stamp""" - - library_name: str | None = field(repr=False, default=None) - """Name of the DataAutomationLibrary""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DATA_AUTOMATION_LIBRARY_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DATA_AUTOMATION_LIBRARY_SUMMARY.members["libraryArn"], - self.library_arn, - ) - if self.library_name is not None: - serializer.write_string( - _SCHEMA_DATA_AUTOMATION_LIBRARY_SUMMARY.members["libraryName"], - self.library_name, - ) - - serializer.write_timestamp( - _SCHEMA_DATA_AUTOMATION_LIBRARY_SUMMARY.members["creationTime"], - self.creation_time, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["library_arn"] = de.read_string( - _SCHEMA_DATA_AUTOMATION_LIBRARY_SUMMARY.members["libraryArn"] - ) - - case 1: - kwargs["library_name"] = de.read_string( - _SCHEMA_DATA_AUTOMATION_LIBRARY_SUMMARY.members["libraryName"] - ) - - case 2: - kwargs["creation_time"] = de.read_timestamp( - _SCHEMA_DATA_AUTOMATION_LIBRARY_SUMMARY.members["creationTime"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DATA_AUTOMATION_LIBRARY_SUMMARY, consumer=_consumer - ) - if "library_arn" not in kwargs: - kwargs["library_arn"] = "" - if "creation_time" not in kwargs: - kwargs["creation_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_data_automation_library_summaries( - serializer: ShapeSerializer, - schema: Schema, - value: list[DataAutomationLibrarySummary], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_data_automation_library_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[DataAutomationLibrarySummary]: - result: list[DataAutomationLibrarySummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(DataAutomationLibrarySummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListDataAutomationLibrariesOutput: - """List DataAutomationLibraries Response""" - - libraries: list[DataAutomationLibrarySummary] | None = None - """List of DataAutomationLibrarySummary objects""" - - next_token: str | None = None - """Pagination token""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_DATA_AUTOMATION_LIBRARIES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.libraries is not None: - _serialize_data_automation_library_summaries( - serializer, - _SCHEMA_LIST_DATA_AUTOMATION_LIBRARIES_OUTPUT.members["libraries"], - self.libraries, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_DATA_AUTOMATION_LIBRARIES_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["libraries"] = ( - _deserialize_data_automation_library_summaries( - de, - _SCHEMA_LIST_DATA_AUTOMATION_LIBRARIES_OUTPUT.members[ - "libraries" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_DATA_AUTOMATION_LIBRARIES_OUTPUT.members[ - "nextToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_DATA_AUTOMATION_LIBRARIES_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_DATA_AUTOMATION_LIBRARIES = APIOperation( - input=ListDataAutomationLibrariesInput, - output=ListDataAutomationLibrariesOutput, - schema=_SCHEMA_LIST_DATA_AUTOMATION_LIBRARIES, - input_schema=_SCHEMA_LIST_DATA_AUTOMATION_LIBRARIES_INPUT, - output_schema=_SCHEMA_LIST_DATA_AUTOMATION_LIBRARIES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockdataautomation#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockdataautomation#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateDataAutomationLibraryInput: - """Update DataAutomationLibrary Request""" - - library_arn: str | None = None - """ARN generated at the server side when a DataAutomationLibrary is created""" - - library_description: str | None = field(repr=False, default=None) - """Description of the DataAutomationLibrary""" - - client_token: str | None = None - """Client specified token used for idempotency checks""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_DATA_AUTOMATION_LIBRARY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.library_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_DATA_AUTOMATION_LIBRARY_INPUT.members["libraryArn"], - self.library_arn, - ) - - if self.library_description is not None: - serializer.write_string( - _SCHEMA_UPDATE_DATA_AUTOMATION_LIBRARY_INPUT.members[ - "libraryDescription" - ], - self.library_description, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_UPDATE_DATA_AUTOMATION_LIBRARY_INPUT.members["clientToken"], - self.client_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["library_arn"] = de.read_string( - _SCHEMA_UPDATE_DATA_AUTOMATION_LIBRARY_INPUT.members[ - "libraryArn" - ] - ) - - case 1: - kwargs["library_description"] = de.read_string( - _SCHEMA_UPDATE_DATA_AUTOMATION_LIBRARY_INPUT.members[ - "libraryDescription" - ] - ) - - case 2: - kwargs["client_token"] = de.read_string( - _SCHEMA_UPDATE_DATA_AUTOMATION_LIBRARY_INPUT.members[ - "clientToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_DATA_AUTOMATION_LIBRARY_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateDataAutomationLibraryOutput: - """Update DataAutomationLibrary Response""" - - library_arn: str | None = None - """ARN generated at the server side when a DataAutomationLibrary is created""" - - status: str | None = None - """Status of DataAutomationLibrary""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_DATA_AUTOMATION_LIBRARY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.library_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_DATA_AUTOMATION_LIBRARY_OUTPUT.members["libraryArn"], - self.library_arn, - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_UPDATE_DATA_AUTOMATION_LIBRARY_OUTPUT.members["status"], - self.status, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["library_arn"] = de.read_string( - _SCHEMA_UPDATE_DATA_AUTOMATION_LIBRARY_OUTPUT.members[ - "libraryArn" - ] - ) - - case 1: - kwargs["status"] = DataAutomationLibraryStatus( - de.read_string( - _SCHEMA_UPDATE_DATA_AUTOMATION_LIBRARY_OUTPUT.members[ - "status" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_DATA_AUTOMATION_LIBRARY_OUTPUT, consumer=_consumer - ) - return kwargs - - -UPDATE_DATA_AUTOMATION_LIBRARY = APIOperation( - input=UpdateDataAutomationLibraryInput, - output=UpdateDataAutomationLibraryOutput, - schema=_SCHEMA_UPDATE_DATA_AUTOMATION_LIBRARY, - input_schema=_SCHEMA_UPDATE_DATA_AUTOMATION_LIBRARY_INPUT, - output_schema=_SCHEMA_UPDATE_DATA_AUTOMATION_LIBRARY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockdataautomation#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockdataautomation#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class BlueprintItem: - """Blueprint Item""" - - blueprint_arn: str - """ARN of a Blueprint""" - - blueprint_version: str | None = None - """Blueprint Version""" - - blueprint_stage: str | None = None - """Stage of the Blueprint""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BLUEPRINT_ITEM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_BLUEPRINT_ITEM.members["blueprintArn"], self.blueprint_arn - ) - if self.blueprint_version is not None: - serializer.write_string( - _SCHEMA_BLUEPRINT_ITEM.members["blueprintVersion"], - self.blueprint_version, - ) - - if self.blueprint_stage is not None: - serializer.write_string( - _SCHEMA_BLUEPRINT_ITEM.members["blueprintStage"], self.blueprint_stage - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["blueprint_arn"] = de.read_string( - _SCHEMA_BLUEPRINT_ITEM.members["blueprintArn"] - ) - - case 1: - kwargs["blueprint_version"] = de.read_string( - _SCHEMA_BLUEPRINT_ITEM.members["blueprintVersion"] - ) - - case 2: - kwargs["blueprint_stage"] = BlueprintStage( - de.read_string(_SCHEMA_BLUEPRINT_ITEM.members["blueprintStage"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BLUEPRINT_ITEM, consumer=_consumer) - if "blueprint_arn" not in kwargs: - kwargs["blueprint_arn"] = "" - return kwargs - - -def _serialize_blueprint_items( - serializer: ShapeSerializer, schema: Schema, value: list[BlueprintItem] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_blueprint_items( - deserializer: ShapeDeserializer, schema: Schema -) -> list[BlueprintItem]: - result: list[BlueprintItem] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(BlueprintItem.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_fallback_blueprint_items( - serializer: ShapeSerializer, schema: Schema, value: list[BlueprintItem] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_fallback_blueprint_items( - deserializer: ShapeDeserializer, schema: Schema -) -> list[BlueprintItem]: - result: list[BlueprintItem] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(BlueprintItem.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class DocumentCustomOutputConfiguration: - """Custom Configuration of Document""" - - fallback_blueprints: list[BlueprintItem] | None = None - """List of Fallback Blueprint Items""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_CUSTOM_OUTPUT_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.fallback_blueprints is not None: - _serialize_fallback_blueprint_items( - serializer, - _SCHEMA_DOCUMENT_CUSTOM_OUTPUT_CONFIGURATION.members[ - "fallbackBlueprints" - ], - self.fallback_blueprints, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["fallback_blueprints"] = ( - _deserialize_fallback_blueprint_items( - de, - _SCHEMA_DOCUMENT_CUSTOM_OUTPUT_CONFIGURATION.members[ - "fallbackBlueprints" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DOCUMENT_CUSTOM_OUTPUT_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CustomOutputConfiguration: - """Custom output configuration""" - - blueprints: list[BlueprintItem] | None = None - """List of Blueprint Item""" - - document: DocumentCustomOutputConfiguration | None = None - """Custom Configuration of Document""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOM_OUTPUT_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.blueprints is not None: - _serialize_blueprint_items( - serializer, - _SCHEMA_CUSTOM_OUTPUT_CONFIGURATION.members["blueprints"], - self.blueprints, - ) - - if self.document is not None: - serializer.write_struct( - _SCHEMA_CUSTOM_OUTPUT_CONFIGURATION.members["document"], self.document - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["blueprints"] = _deserialize_blueprint_items( - de, _SCHEMA_CUSTOM_OUTPUT_CONFIGURATION.members["blueprints"] - ) - - case 1: - kwargs["document"] = DocumentCustomOutputConfiguration.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CUSTOM_OUTPUT_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DataAutomationLibraryItem: - """DataAutomationLibrary Item""" - - library_arn: str - """ARN generated at the server side when a DataAutomationLibrary is created""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DATA_AUTOMATION_LIBRARY_ITEM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DATA_AUTOMATION_LIBRARY_ITEM.members["libraryArn"], self.library_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["library_arn"] = de.read_string( - _SCHEMA_DATA_AUTOMATION_LIBRARY_ITEM.members["libraryArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DATA_AUTOMATION_LIBRARY_ITEM, consumer=_consumer - ) - if "library_arn" not in kwargs: - kwargs["library_arn"] = "" - return kwargs - - -def _serialize_data_automation_library_items( - serializer: ShapeSerializer, schema: Schema, value: list[DataAutomationLibraryItem] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_data_automation_library_items( - deserializer: ShapeDeserializer, schema: Schema -) -> list[DataAutomationLibraryItem]: - result: list[DataAutomationLibraryItem] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(DataAutomationLibraryItem.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class DataAutomationLibraryConfiguration: - """DataAutomation Library configuration""" - - libraries: list[DataAutomationLibraryItem] | None = None - """List of DataAutomationLibrary Items""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DATA_AUTOMATION_LIBRARY_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.libraries is not None: - _serialize_data_automation_library_items( - serializer, - _SCHEMA_DATA_AUTOMATION_LIBRARY_CONFIGURATION.members["libraries"], - self.libraries, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["libraries"] = _deserialize_data_automation_library_items( - de, - _SCHEMA_DATA_AUTOMATION_LIBRARY_CONFIGURATION.members[ - "libraries" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DATA_AUTOMATION_LIBRARY_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -class AudioGenerativeOutputLanguage(UnknownEnumMixin, StrEnum): - """Configuration for Audio output language""" - - DEFAULT = "DEFAULT" - EN = "EN" - - -def _serialize_audio_input_languages( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_audio_input_languages( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Language(d.read_string(member_schema))) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AudioLanguageConfiguration: - """Optional configuration for audio language settings""" - - input_languages: list[str] | None = None - """List of supported audio languages""" - - generative_output_language: str | None = None - """Configuration for Audio output language""" - - identify_multiple_languages: bool | None = None - """Enable multiple language identification in audio""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUDIO_LANGUAGE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.input_languages is not None: - _serialize_audio_input_languages( - serializer, - _SCHEMA_AUDIO_LANGUAGE_CONFIGURATION.members["inputLanguages"], - self.input_languages, - ) - - if self.generative_output_language is not None: - serializer.write_string( - _SCHEMA_AUDIO_LANGUAGE_CONFIGURATION.members[ - "generativeOutputLanguage" - ], - self.generative_output_language, - ) - - if self.identify_multiple_languages is not None: - serializer.write_boolean( - _SCHEMA_AUDIO_LANGUAGE_CONFIGURATION.members[ - "identifyMultipleLanguages" - ], - self.identify_multiple_languages, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["input_languages"] = _deserialize_audio_input_languages( - de, - _SCHEMA_AUDIO_LANGUAGE_CONFIGURATION.members["inputLanguages"], - ) - - case 1: - kwargs["generative_output_language"] = ( - AudioGenerativeOutputLanguage( - de.read_string( - _SCHEMA_AUDIO_LANGUAGE_CONFIGURATION.members[ - "generativeOutputLanguage" - ] - ) - ) - ) - - case 2: - kwargs["identify_multiple_languages"] = de.read_boolean( - _SCHEMA_AUDIO_LANGUAGE_CONFIGURATION.members[ - "identifyMultipleLanguages" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUDIO_LANGUAGE_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -class State(UnknownEnumMixin, StrEnum): - """State""" - - ENABLED = "ENABLED" - DISABLED = "DISABLED" - - -@dataclass(kw_only=True) -class ModalityProcessingConfiguration: - """Configuration to enable/disable processing of modality""" - - state: str | None = None - """State""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MODALITY_PROCESSING_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.state is not None: - serializer.write_string( - _SCHEMA_MODALITY_PROCESSING_CONFIGURATION.members["state"], self.state - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["state"] = State( - de.read_string( - _SCHEMA_MODALITY_PROCESSING_CONFIGURATION.members["state"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MODALITY_PROCESSING_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -class SensitiveDataDetectionMode(UnknownEnumMixin, StrEnum): - """Mode for sensitive data detection""" - - DETECTION = "DETECTION" - """Only detect sensitive data without redaction""" - DETECTION_AND_REDACTION = "DETECTION_AND_REDACTION" - """Detect and redact sensitive data""" - - -class SensitiveDataDetectionScopeType(UnknownEnumMixin, StrEnum): - """Types of sensitive data detection scope""" - - STANDARD = "STANDARD" - """Standard PII detection""" - CUSTOM = "CUSTOM" - """Custom PII detection""" - - -def _serialize_sensitive_data_detection_scope( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_sensitive_data_detection_scope( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(SensitiveDataDetectionScopeType(d.read_string(member_schema))) - - deserializer.read_list(schema, _read_value) - return result - - -class PIIEntityType(UnknownEnumMixin, StrEnum): - """ - Types of PII entities that can be detected, we will support every types - that Guardrails can support - """ - - ALL = "ALL" - """All supported PII entity types""" - ADDRESS = "ADDRESS" - """ - A physical address, such as '100 Main Street, Anytown, USA' or 'Suite - #12, Building 123' - """ - AGE = "AGE" - """An individual's age, including the quantity and unit of time""" - NAME = "NAME" - """ - An individual's name. Does not include titles such as Dr., Mr., Mrs., - or Miss - """ - EMAIL = "EMAIL" - """An email address, such as marymajor@email.com""" - PHONE = "PHONE" - """A phone number. Also includes fax and pager numbers""" - USERNAME = "USERNAME" - """ - A user name that identifies an account, such as a login name, screen - name, nick name, or handle - """ - PASSWORD = "PASSWORD" - """An alphanumeric string that is used as a password""" - DRIVER_ID = "DRIVER_ID" - """The number assigned to a driver's license""" - LICENSE_PLATE = "LICENSE_PLATE" - """ - A license plate for a vehicle issued by the state or country where the - vehicle is registered - """ - VEHICLE_IDENTIFICATION_NUMBER = "VEHICLE_IDENTIFICATION_NUMBER" - """A Vehicle Identification Number (VIN) that uniquely identifies a vehicle""" - CREDIT_DEBIT_CARD_CVV = "CREDIT_DEBIT_CARD_CVV" - """ - A three-digit card verification code (CVV) for VISA, MasterCard, and - Discover cards, or four-digit for American Express - """ - CREDIT_DEBIT_CARD_EXPIRY = "CREDIT_DEBIT_CARD_EXPIRY" - """The expiration date for a credit or debit card""" - CREDIT_DEBIT_CARD_NUMBER = "CREDIT_DEBIT_CARD_NUMBER" - """The number for a credit or debit card""" - PIN = "PIN" - """A four-digit personal identification number (PIN)""" - INTERNATIONAL_BANK_ACCOUNT_NUMBER = "INTERNATIONAL_BANK_ACCOUNT_NUMBER" - """ - An International Bank Account Number with specific formats for each - country - """ - SWIFT_CODE = "SWIFT_CODE" - """A SWIFT code - standard format of Bank Identifier Code (BIC)""" - IP_ADDRESS = "IP_ADDRESS" - """An IPv4 address, such as 198.51.100.0""" - MAC_ADDRESS = "MAC_ADDRESS" - """ - A media access control (MAC) address - unique identifier for network - interface controller - """ - URL = "URL" - """A web address, such as www.example.com""" - AWS_ACCESS_KEY = "AWS_ACCESS_KEY" - """A unique identifier associated with AWS secret access key""" - AWS_SECRET_KEY = "AWS_SECRET_KEY" - """ - A unique identifier associated with AWS access key for signing - programmatic requests - """ - US_BANK_ACCOUNT_NUMBER = "US_BANK_ACCOUNT_NUMBER" - """A US bank account number, typically 10 to 12 digits long""" - US_BANK_ROUTING_NUMBER = "US_BANK_ROUTING_NUMBER" - """A US bank account routing number, typically nine digits long""" - US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER = "US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER" - """A US Individual Taxpayer Identification Number (ITIN)""" - US_PASSPORT_NUMBER = "US_PASSPORT_NUMBER" - """A US passport number, ranging from six to nine alphanumeric characters""" - US_SOCIAL_SECURITY_NUMBER = "US_SOCIAL_SECURITY_NUMBER" - """ - A US Social Security Number (SSN) - nine-digit number for US citizens - and residents - """ - CA_HEALTH_NUMBER = "CA_HEALTH_NUMBER" - """ - A Canadian Health Service Number - 10-digit unique identifier for - healthcare benefits - """ - CA_SOCIAL_INSURANCE_NUMBER = "CA_SOCIAL_INSURANCE_NUMBER" - """A Canadian Social Insurance Number (SIN) - nine-digit unique identifier""" - UK_NATIONAL_HEALTH_SERVICE_NUMBER = "UK_NATIONAL_HEALTH_SERVICE_NUMBER" - """A UK National Health Service Number - 10-17 digit number""" - UK_NATIONAL_INSURANCE_NUMBER = "UK_NATIONAL_INSURANCE_NUMBER" - """ - A UK National Insurance Number (NINO) for accessing National Insurance - benefits - """ - UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER = "UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER" - """ - A UK Unique Taxpayer Reference (UTR) - 10-digit number identifying - taxpayer or business - """ - - -def _serialize_pii_entity_types( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_pii_entity_types( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(PIIEntityType(d.read_string(member_schema))) - - deserializer.read_list(schema, _read_value) - return result - - -class PIIRedactionMaskMode(UnknownEnumMixin, StrEnum): - """Mode for redacting detected PII""" - - PII = "PII" - """Replace with generic PII marker [PII]""" - ENTITY_TYPE = "ENTITY_TYPE" - """Replace with specific entity type marker, e.g. [NAME]/[SSN] etc.""" - - -@dataclass(kw_only=True) -class PIIEntitiesConfiguration: - """Configuration for PII entities detection and redaction""" - - pii_entity_types: list[str] | None = None - """Types of PII entities to detect""" - - redaction_mask_mode: str | None = None - """Mode for redacting detected PII""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PII_ENTITIES_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.pii_entity_types is not None: - _serialize_pii_entity_types( - serializer, - _SCHEMA_PII_ENTITIES_CONFIGURATION.members["piiEntityTypes"], - self.pii_entity_types, - ) - - if self.redaction_mask_mode is not None: - serializer.write_string( - _SCHEMA_PII_ENTITIES_CONFIGURATION.members["redactionMaskMode"], - self.redaction_mask_mode, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["pii_entity_types"] = _deserialize_pii_entity_types( - de, _SCHEMA_PII_ENTITIES_CONFIGURATION.members["piiEntityTypes"] - ) - - case 1: - kwargs["redaction_mask_mode"] = PIIRedactionMaskMode( - de.read_string( - _SCHEMA_PII_ENTITIES_CONFIGURATION.members[ - "redactionMaskMode" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PII_ENTITIES_CONFIGURATION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class SensitiveDataConfiguration: - """Configuration for sensitive data detection and redaction""" - - detection_mode: str - """Mode for sensitive data detection""" - - detection_scope: list[str] | None = None - """Scope of detection - what types of sensitive data to detect""" - - pii_entities_configuration: PIIEntitiesConfiguration | None = None - """Configuration for PII entities detection and redaction""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SENSITIVE_DATA_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SENSITIVE_DATA_CONFIGURATION.members["detectionMode"], - self.detection_mode, - ) - if self.detection_scope is not None: - _serialize_sensitive_data_detection_scope( - serializer, - _SCHEMA_SENSITIVE_DATA_CONFIGURATION.members["detectionScope"], - self.detection_scope, - ) - - if self.pii_entities_configuration is not None: - serializer.write_struct( - _SCHEMA_SENSITIVE_DATA_CONFIGURATION.members[ - "piiEntitiesConfiguration" - ], - self.pii_entities_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detection_mode"] = SensitiveDataDetectionMode( - de.read_string( - _SCHEMA_SENSITIVE_DATA_CONFIGURATION.members[ - "detectionMode" - ] - ) - ) - - case 1: - kwargs["detection_scope"] = ( - _deserialize_sensitive_data_detection_scope( - de, - _SCHEMA_SENSITIVE_DATA_CONFIGURATION.members[ - "detectionScope" - ], - ) - ) - - case 2: - kwargs["pii_entities_configuration"] = ( - PIIEntitiesConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SENSITIVE_DATA_CONFIGURATION, consumer=_consumer - ) - if "detection_mode" not in kwargs: - kwargs["detection_mode"] = SensitiveDataDetectionMode._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class AudioOverrideConfiguration: - """Override Configuration of Audio""" - - modality_processing: ModalityProcessingConfiguration | None = None - """Configuration to enable/disable processing of modality""" - - language_configuration: AudioLanguageConfiguration | None = None - """Optional configuration for audio language settings""" - - sensitive_data_configuration: SensitiveDataConfiguration | None = None - """Configuration for sensitive data detection and redaction""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUDIO_OVERRIDE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.modality_processing is not None: - serializer.write_struct( - _SCHEMA_AUDIO_OVERRIDE_CONFIGURATION.members["modalityProcessing"], - self.modality_processing, - ) - - if self.language_configuration is not None: - serializer.write_struct( - _SCHEMA_AUDIO_OVERRIDE_CONFIGURATION.members["languageConfiguration"], - self.language_configuration, - ) - - if self.sensitive_data_configuration is not None: - serializer.write_struct( - _SCHEMA_AUDIO_OVERRIDE_CONFIGURATION.members[ - "sensitiveDataConfiguration" - ], - self.sensitive_data_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["modality_processing"] = ( - ModalityProcessingConfiguration.deserialize(de) - ) - - case 1: - kwargs["language_configuration"] = ( - AudioLanguageConfiguration.deserialize(de) - ) - - case 2: - kwargs["sensitive_data_configuration"] = ( - SensitiveDataConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUDIO_OVERRIDE_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class SplitterConfiguration: - """Configuration of Splitter""" - - state: str | None = None - """State""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SPLITTER_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.state is not None: - serializer.write_string( - _SCHEMA_SPLITTER_CONFIGURATION.members["state"], self.state - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["state"] = State( - de.read_string(_SCHEMA_SPLITTER_CONFIGURATION.members["state"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SPLITTER_CONFIGURATION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DocumentOverrideConfiguration: - """Override Configuration of Document""" - - splitter: SplitterConfiguration | None = None - """Configuration of Splitter""" - - modality_processing: ModalityProcessingConfiguration | None = None - """Configuration to enable/disable processing of modality""" - - sensitive_data_configuration: SensitiveDataConfiguration | None = None - """Configuration for sensitive data detection and redaction""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_OVERRIDE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.splitter is not None: - serializer.write_struct( - _SCHEMA_DOCUMENT_OVERRIDE_CONFIGURATION.members["splitter"], - self.splitter, - ) - - if self.modality_processing is not None: - serializer.write_struct( - _SCHEMA_DOCUMENT_OVERRIDE_CONFIGURATION.members["modalityProcessing"], - self.modality_processing, - ) - - if self.sensitive_data_configuration is not None: - serializer.write_struct( - _SCHEMA_DOCUMENT_OVERRIDE_CONFIGURATION.members[ - "sensitiveDataConfiguration" - ], - self.sensitive_data_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["splitter"] = SplitterConfiguration.deserialize(de) - - case 1: - kwargs["modality_processing"] = ( - ModalityProcessingConfiguration.deserialize(de) - ) - - case 2: - kwargs["sensitive_data_configuration"] = ( - SensitiveDataConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DOCUMENT_OVERRIDE_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ImageOverrideConfiguration: - """Override Configuration of Image""" - - modality_processing: ModalityProcessingConfiguration | None = None - """Configuration to enable/disable processing of modality""" - - sensitive_data_configuration: SensitiveDataConfiguration | None = None - """Configuration for sensitive data detection and redaction""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IMAGE_OVERRIDE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.modality_processing is not None: - serializer.write_struct( - _SCHEMA_IMAGE_OVERRIDE_CONFIGURATION.members["modalityProcessing"], - self.modality_processing, - ) - - if self.sensitive_data_configuration is not None: - serializer.write_struct( - _SCHEMA_IMAGE_OVERRIDE_CONFIGURATION.members[ - "sensitiveDataConfiguration" - ], - self.sensitive_data_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["modality_processing"] = ( - ModalityProcessingConfiguration.deserialize(de) - ) - - case 1: - kwargs["sensitive_data_configuration"] = ( - SensitiveDataConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_IMAGE_OVERRIDE_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -class DesiredModality(UnknownEnumMixin, StrEnum): - """Desired Modality types""" - - IMAGE = "IMAGE" - DOCUMENT = "DOCUMENT" - AUDIO = "AUDIO" - VIDEO = "VIDEO" - - -@dataclass(kw_only=True) -class ModalityRoutingConfiguration: - """Configuration for routing file type to desired modality""" - - jpeg: str | None = None - """Desired Modality types""" - - png: str | None = None - """Desired Modality types""" - - mp4: str | None = None - """Desired Modality types""" - - mov: str | None = None - """Desired Modality types""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MODALITY_ROUTING_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.jpeg is not None: - serializer.write_string( - _SCHEMA_MODALITY_ROUTING_CONFIGURATION.members["jpeg"], self.jpeg - ) - - if self.png is not None: - serializer.write_string( - _SCHEMA_MODALITY_ROUTING_CONFIGURATION.members["png"], self.png - ) - - if self.mp4 is not None: - serializer.write_string( - _SCHEMA_MODALITY_ROUTING_CONFIGURATION.members["mp4"], self.mp4 - ) - - if self.mov is not None: - serializer.write_string( - _SCHEMA_MODALITY_ROUTING_CONFIGURATION.members["mov"], self.mov - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["jpeg"] = DesiredModality( - de.read_string( - _SCHEMA_MODALITY_ROUTING_CONFIGURATION.members["jpeg"] - ) - ) - - case 1: - kwargs["png"] = DesiredModality( - de.read_string( - _SCHEMA_MODALITY_ROUTING_CONFIGURATION.members["png"] - ) - ) - - case 2: - kwargs["mp4"] = DesiredModality( - de.read_string( - _SCHEMA_MODALITY_ROUTING_CONFIGURATION.members["mp4"] - ) - ) - - case 3: - kwargs["mov"] = DesiredModality( - de.read_string( - _SCHEMA_MODALITY_ROUTING_CONFIGURATION.members["mov"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MODALITY_ROUTING_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class VideoOverrideConfiguration: - """Override Configuration of Video""" - - modality_processing: ModalityProcessingConfiguration | None = None - """Configuration to enable/disable processing of modality""" - - sensitive_data_configuration: SensitiveDataConfiguration | None = None - """Configuration for sensitive data detection and redaction""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VIDEO_OVERRIDE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.modality_processing is not None: - serializer.write_struct( - _SCHEMA_VIDEO_OVERRIDE_CONFIGURATION.members["modalityProcessing"], - self.modality_processing, - ) - - if self.sensitive_data_configuration is not None: - serializer.write_struct( - _SCHEMA_VIDEO_OVERRIDE_CONFIGURATION.members[ - "sensitiveDataConfiguration" - ], - self.sensitive_data_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["modality_processing"] = ( - ModalityProcessingConfiguration.deserialize(de) - ) - - case 1: - kwargs["sensitive_data_configuration"] = ( - SensitiveDataConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_VIDEO_OVERRIDE_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class OverrideConfiguration: - """Override configuration""" - - document: DocumentOverrideConfiguration | None = None - """Override Configuration of Document""" - - image: ImageOverrideConfiguration | None = None - """Override Configuration of Image""" - - video: VideoOverrideConfiguration | None = None - """Override Configuration of Video""" - - audio: AudioOverrideConfiguration | None = None - """Override Configuration of Audio""" - - modality_routing: ModalityRoutingConfiguration | None = None - """Configuration for routing file type to desired modality""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OVERRIDE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.document is not None: - serializer.write_struct( - _SCHEMA_OVERRIDE_CONFIGURATION.members["document"], self.document - ) - - if self.image is not None: - serializer.write_struct( - _SCHEMA_OVERRIDE_CONFIGURATION.members["image"], self.image - ) - - if self.video is not None: - serializer.write_struct( - _SCHEMA_OVERRIDE_CONFIGURATION.members["video"], self.video - ) - - if self.audio is not None: - serializer.write_struct( - _SCHEMA_OVERRIDE_CONFIGURATION.members["audio"], self.audio - ) - - if self.modality_routing is not None: - serializer.write_struct( - _SCHEMA_OVERRIDE_CONFIGURATION.members["modalityRouting"], - self.modality_routing, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["document"] = DocumentOverrideConfiguration.deserialize(de) - - case 1: - kwargs["image"] = ImageOverrideConfiguration.deserialize(de) - - case 2: - kwargs["video"] = VideoOverrideConfiguration.deserialize(de) - - case 3: - kwargs["audio"] = AudioOverrideConfiguration.deserialize(de) - - case 4: - kwargs["modality_routing"] = ( - ModalityRoutingConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_OVERRIDE_CONFIGURATION, consumer=_consumer) - return kwargs - - -class DataAutomationProjectType(UnknownEnumMixin, StrEnum): - """Type of the DataAutomationProject""" - - ASYNC_ = "ASYNC" - SYNC = "SYNC" - - -@dataclass(kw_only=True) -class ChannelLabelingConfiguration: - """Channel labeling configuration""" - - state: str - """State""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CHANNEL_LABELING_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CHANNEL_LABELING_CONFIGURATION.members["state"], self.state - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["state"] = State( - de.read_string( - _SCHEMA_CHANNEL_LABELING_CONFIGURATION.members["state"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CHANNEL_LABELING_CONFIGURATION, consumer=_consumer - ) - if "state" not in kwargs: - kwargs["state"] = State._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class SpeakerLabelingConfiguration: - """Speaker labeling configuration""" - - state: str - """State""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SPEAKER_LABELING_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SPEAKER_LABELING_CONFIGURATION.members["state"], self.state - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["state"] = State( - de.read_string( - _SCHEMA_SPEAKER_LABELING_CONFIGURATION.members["state"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SPEAKER_LABELING_CONFIGURATION, consumer=_consumer - ) - if "state" not in kwargs: - kwargs["state"] = State._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class TranscriptConfiguration: - """Configuration for transcript related features""" - - speaker_labeling: SpeakerLabelingConfiguration | None = None - """Speaker labeling configuration""" - - channel_labeling: ChannelLabelingConfiguration | None = None - """Channel labeling configuration""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRANSCRIPT_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.speaker_labeling is not None: - serializer.write_struct( - _SCHEMA_TRANSCRIPT_CONFIGURATION.members["speakerLabeling"], - self.speaker_labeling, - ) - - if self.channel_labeling is not None: - serializer.write_struct( - _SCHEMA_TRANSCRIPT_CONFIGURATION.members["channelLabeling"], - self.channel_labeling, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["speaker_labeling"] = ( - SpeakerLabelingConfiguration.deserialize(de) - ) - - case 1: - kwargs["channel_labeling"] = ( - ChannelLabelingConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TRANSCRIPT_CONFIGURATION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class AudioExtractionCategoryTypeConfiguration: - """Configuration for different audio extraction category types""" - - transcript: TranscriptConfiguration | None = None - """Configuration for transcript related features""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUDIO_EXTRACTION_CATEGORY_TYPE_CONFIGURATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.transcript is not None: - serializer.write_struct( - _SCHEMA_AUDIO_EXTRACTION_CATEGORY_TYPE_CONFIGURATION.members[ - "transcript" - ], - self.transcript, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["transcript"] = TranscriptConfiguration.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUDIO_EXTRACTION_CATEGORY_TYPE_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -class AudioExtractionCategoryType(UnknownEnumMixin, StrEnum): - AUDIO_CONTENT_MODERATION = "AUDIO_CONTENT_MODERATION" - TRANSCRIPT = "TRANSCRIPT" - TOPIC_CONTENT_MODERATION = "TOPIC_CONTENT_MODERATION" - - -def _serialize_audio_extraction_category_types( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_audio_extraction_category_types( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AudioExtractionCategoryType(d.read_string(member_schema))) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AudioExtractionCategory: - """Category of Audio Extraction""" - - state: str - """State""" - - types: list[str] | None = None - """List of Audio Extraction Category Type""" - - type_configuration: AudioExtractionCategoryTypeConfiguration | None = None - """Configuration for different audio extraction category types""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUDIO_EXTRACTION_CATEGORY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AUDIO_EXTRACTION_CATEGORY.members["state"], self.state - ) - if self.types is not None: - _serialize_audio_extraction_category_types( - serializer, - _SCHEMA_AUDIO_EXTRACTION_CATEGORY.members["types"], - self.types, - ) - - if self.type_configuration is not None: - serializer.write_struct( - _SCHEMA_AUDIO_EXTRACTION_CATEGORY.members["typeConfiguration"], - self.type_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["state"] = State( - de.read_string( - _SCHEMA_AUDIO_EXTRACTION_CATEGORY.members["state"] - ) - ) - - case 1: - kwargs["types"] = _deserialize_audio_extraction_category_types( - de, _SCHEMA_AUDIO_EXTRACTION_CATEGORY.members["types"] - ) - - case 2: - kwargs["type_configuration"] = ( - AudioExtractionCategoryTypeConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AUDIO_EXTRACTION_CATEGORY, consumer=_consumer) - if "state" not in kwargs: - kwargs["state"] = State._corrected("") - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(state=State._corrected("")) - - -@dataclass(kw_only=True) -class AudioStandardExtraction: - """Standard Extraction Configuration of Audio""" - - category: AudioExtractionCategory - """Category of Audio Extraction""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUDIO_STANDARD_EXTRACTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUDIO_STANDARD_EXTRACTION.members["category"], self.category - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["category"] = AudioExtractionCategory.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AUDIO_STANDARD_EXTRACTION, consumer=_consumer) - if "category" not in kwargs: - kwargs["category"] = AudioExtractionCategory._smithy_default() - return kwargs - - -class AudioStandardGenerativeFieldType(UnknownEnumMixin, StrEnum): - AUDIO_SUMMARY = "AUDIO_SUMMARY" - IAB = "IAB" - TOPIC_SUMMARY = "TOPIC_SUMMARY" - - -def _serialize_audio_standard_generative_field_types( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_audio_standard_generative_field_types( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append( - AudioStandardGenerativeFieldType(d.read_string(member_schema)) - ) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AudioStandardGenerativeField: - """Standard Generative Field Configuration of Audio""" - - state: str - """State""" - - types: list[str] | None = None - """List of Audio Standard Generative Field Type""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUDIO_STANDARD_GENERATIVE_FIELD, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AUDIO_STANDARD_GENERATIVE_FIELD.members["state"], self.state - ) - if self.types is not None: - _serialize_audio_standard_generative_field_types( - serializer, - _SCHEMA_AUDIO_STANDARD_GENERATIVE_FIELD.members["types"], - self.types, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["state"] = State( - de.read_string( - _SCHEMA_AUDIO_STANDARD_GENERATIVE_FIELD.members["state"] - ) - ) - - case 1: - kwargs["types"] = ( - _deserialize_audio_standard_generative_field_types( - de, _SCHEMA_AUDIO_STANDARD_GENERATIVE_FIELD.members["types"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUDIO_STANDARD_GENERATIVE_FIELD, consumer=_consumer - ) - if "state" not in kwargs: - kwargs["state"] = State._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class AudioStandardOutputConfiguration: - """Standard Output Configuration of Audio""" - - extraction: AudioStandardExtraction | None = None - """Standard Extraction Configuration of Audio""" - - generative_field: AudioStandardGenerativeField | None = None - """Standard Generative Field Configuration of Audio""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUDIO_STANDARD_OUTPUT_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.extraction is not None: - serializer.write_struct( - _SCHEMA_AUDIO_STANDARD_OUTPUT_CONFIGURATION.members["extraction"], - self.extraction, - ) - - if self.generative_field is not None: - serializer.write_struct( - _SCHEMA_AUDIO_STANDARD_OUTPUT_CONFIGURATION.members["generativeField"], - self.generative_field, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["extraction"] = AudioStandardExtraction.deserialize(de) - - case 1: - kwargs["generative_field"] = ( - AudioStandardGenerativeField.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUDIO_STANDARD_OUTPUT_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DocumentBoundingBox: - """Bounding Box Configuration of Document Extraction""" - - state: str - """State""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_BOUNDING_BOX, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DOCUMENT_BOUNDING_BOX.members["state"], self.state - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["state"] = State( - de.read_string(_SCHEMA_DOCUMENT_BOUNDING_BOX.members["state"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DOCUMENT_BOUNDING_BOX, consumer=_consumer) - if "state" not in kwargs: - kwargs["state"] = State._corrected("") - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(state=State._corrected("")) - - -class DocumentExtractionGranularityType(UnknownEnumMixin, StrEnum): - DOCUMENT = "DOCUMENT" - PAGE = "PAGE" - ELEMENT = "ELEMENT" - WORD = "WORD" - LINE = "LINE" - - -def _serialize_document_extraction_granularity_types( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_document_extraction_granularity_types( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append( - DocumentExtractionGranularityType(d.read_string(member_schema)) - ) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class DocumentExtractionGranularity: - """Granularity of Document Extraction""" - - types: list[str] | None = None - """List of Document Extraction Granularity Type""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_EXTRACTION_GRANULARITY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.types is not None: - _serialize_document_extraction_granularity_types( - serializer, - _SCHEMA_DOCUMENT_EXTRACTION_GRANULARITY.members["types"], - self.types, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["types"] = ( - _deserialize_document_extraction_granularity_types( - de, _SCHEMA_DOCUMENT_EXTRACTION_GRANULARITY.members["types"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DOCUMENT_EXTRACTION_GRANULARITY, consumer=_consumer - ) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls() - - -@dataclass(kw_only=True) -class DocumentStandardExtraction: - """Standard Extraction Configuration of Document""" - - granularity: DocumentExtractionGranularity - """Granularity of Document Extraction""" - - bounding_box: DocumentBoundingBox - """Bounding Box Configuration of Document Extraction""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_STANDARD_EXTRACTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DOCUMENT_STANDARD_EXTRACTION.members["granularity"], - self.granularity, - ) - serializer.write_struct( - _SCHEMA_DOCUMENT_STANDARD_EXTRACTION.members["boundingBox"], - self.bounding_box, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["granularity"] = DocumentExtractionGranularity.deserialize( - de - ) - - case 1: - kwargs["bounding_box"] = DocumentBoundingBox.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DOCUMENT_STANDARD_EXTRACTION, consumer=_consumer - ) - if "granularity" not in kwargs: - kwargs["granularity"] = DocumentExtractionGranularity._smithy_default() - if "bounding_box" not in kwargs: - kwargs["bounding_box"] = DocumentBoundingBox._smithy_default() - return kwargs - - -@dataclass(kw_only=True) -class DocumentStandardGenerativeField: - """Standard Generative Field Configuration of Document""" - - state: str - """State""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_STANDARD_GENERATIVE_FIELD, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DOCUMENT_STANDARD_GENERATIVE_FIELD.members["state"], self.state - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["state"] = State( - de.read_string( - _SCHEMA_DOCUMENT_STANDARD_GENERATIVE_FIELD.members["state"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DOCUMENT_STANDARD_GENERATIVE_FIELD, consumer=_consumer - ) - if "state" not in kwargs: - kwargs["state"] = State._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class DocumentOutputAdditionalFileFormat: - """Additional File Format of Document Output""" - - state: str - """State""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_OUTPUT_ADDITIONAL_FILE_FORMAT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DOCUMENT_OUTPUT_ADDITIONAL_FILE_FORMAT.members["state"], self.state - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["state"] = State( - de.read_string( - _SCHEMA_DOCUMENT_OUTPUT_ADDITIONAL_FILE_FORMAT.members[ - "state" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DOCUMENT_OUTPUT_ADDITIONAL_FILE_FORMAT, consumer=_consumer - ) - if "state" not in kwargs: - kwargs["state"] = State._corrected("") - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(state=State._corrected("")) - - -class DocumentOutputTextFormatType(UnknownEnumMixin, StrEnum): - PLAIN_TEXT = "PLAIN_TEXT" - MARKDOWN = "MARKDOWN" - HTML = "HTML" - CSV = "CSV" - - -def _serialize_document_output_text_format_types( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_document_output_text_format_types( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(DocumentOutputTextFormatType(d.read_string(member_schema))) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class DocumentOutputTextFormat: - """Text Format of Document Output""" - - types: list[str] | None = None - """List of Document Output Text Format Type""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_OUTPUT_TEXT_FORMAT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.types is not None: - _serialize_document_output_text_format_types( - serializer, - _SCHEMA_DOCUMENT_OUTPUT_TEXT_FORMAT.members["types"], - self.types, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["types"] = _deserialize_document_output_text_format_types( - de, _SCHEMA_DOCUMENT_OUTPUT_TEXT_FORMAT.members["types"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DOCUMENT_OUTPUT_TEXT_FORMAT, consumer=_consumer - ) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls() - - -@dataclass(kw_only=True) -class DocumentOutputFormat: - """Output Format of Document""" - - text_format: DocumentOutputTextFormat - """Text Format of Document Output""" - - additional_file_format: DocumentOutputAdditionalFileFormat - """Additional File Format of Document Output""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_OUTPUT_FORMAT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DOCUMENT_OUTPUT_FORMAT.members["textFormat"], self.text_format - ) - serializer.write_struct( - _SCHEMA_DOCUMENT_OUTPUT_FORMAT.members["additionalFileFormat"], - self.additional_file_format, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["text_format"] = DocumentOutputTextFormat.deserialize(de) - - case 1: - kwargs["additional_file_format"] = ( - DocumentOutputAdditionalFileFormat.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DOCUMENT_OUTPUT_FORMAT, consumer=_consumer) - if "text_format" not in kwargs: - kwargs["text_format"] = DocumentOutputTextFormat._smithy_default() - if "additional_file_format" not in kwargs: - kwargs["additional_file_format"] = ( - DocumentOutputAdditionalFileFormat._smithy_default() - ) - return kwargs - - -@dataclass(kw_only=True) -class DocumentStandardOutputConfiguration: - """Standard Output Configuration of Document""" - - extraction: DocumentStandardExtraction | None = None - """Standard Extraction Configuration of Document""" - - generative_field: DocumentStandardGenerativeField | None = None - """Standard Generative Field Configuration of Document""" - - output_format: DocumentOutputFormat | None = None - """Output Format of Document""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_STANDARD_OUTPUT_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.extraction is not None: - serializer.write_struct( - _SCHEMA_DOCUMENT_STANDARD_OUTPUT_CONFIGURATION.members["extraction"], - self.extraction, - ) - - if self.generative_field is not None: - serializer.write_struct( - _SCHEMA_DOCUMENT_STANDARD_OUTPUT_CONFIGURATION.members[ - "generativeField" - ], - self.generative_field, - ) - - if self.output_format is not None: - serializer.write_struct( - _SCHEMA_DOCUMENT_STANDARD_OUTPUT_CONFIGURATION.members["outputFormat"], - self.output_format, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["extraction"] = DocumentStandardExtraction.deserialize(de) - - case 1: - kwargs["generative_field"] = ( - DocumentStandardGenerativeField.deserialize(de) - ) - - case 2: - kwargs["output_format"] = DocumentOutputFormat.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DOCUMENT_STANDARD_OUTPUT_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ImageBoundingBox: - """Bounding Box Configuration of Image Extraction""" - - state: str - """State""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IMAGE_BOUNDING_BOX, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_IMAGE_BOUNDING_BOX.members["state"], self.state) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["state"] = State( - de.read_string(_SCHEMA_IMAGE_BOUNDING_BOX.members["state"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_IMAGE_BOUNDING_BOX, consumer=_consumer) - if "state" not in kwargs: - kwargs["state"] = State._corrected("") - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(state=State._corrected("")) - - -class ImageExtractionCategoryType(UnknownEnumMixin, StrEnum): - CONTENT_MODERATION = "CONTENT_MODERATION" - TEXT_DETECTION = "TEXT_DETECTION" - LOGOS = "LOGOS" - - -def _serialize_image_extraction_category_types( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_image_extraction_category_types( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ImageExtractionCategoryType(d.read_string(member_schema))) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ImageExtractionCategory: - """Category of Image Extraction""" - - state: str - """State""" - - types: list[str] | None = None - """List of Image Extraction Category""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IMAGE_EXTRACTION_CATEGORY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_IMAGE_EXTRACTION_CATEGORY.members["state"], self.state - ) - if self.types is not None: - _serialize_image_extraction_category_types( - serializer, - _SCHEMA_IMAGE_EXTRACTION_CATEGORY.members["types"], - self.types, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["state"] = State( - de.read_string( - _SCHEMA_IMAGE_EXTRACTION_CATEGORY.members["state"] - ) - ) - - case 1: - kwargs["types"] = _deserialize_image_extraction_category_types( - de, _SCHEMA_IMAGE_EXTRACTION_CATEGORY.members["types"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_IMAGE_EXTRACTION_CATEGORY, consumer=_consumer) - if "state" not in kwargs: - kwargs["state"] = State._corrected("") - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(state=State._corrected("")) - - -@dataclass(kw_only=True) -class ImageStandardExtraction: - """Standard Extraction Configuration of Image""" - - category: ImageExtractionCategory - """Category of Image Extraction""" - - bounding_box: ImageBoundingBox - """Bounding Box Configuration of Image Extraction""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IMAGE_STANDARD_EXTRACTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_IMAGE_STANDARD_EXTRACTION.members["category"], self.category - ) - serializer.write_struct( - _SCHEMA_IMAGE_STANDARD_EXTRACTION.members["boundingBox"], self.bounding_box - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["category"] = ImageExtractionCategory.deserialize(de) - - case 1: - kwargs["bounding_box"] = ImageBoundingBox.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_IMAGE_STANDARD_EXTRACTION, consumer=_consumer) - if "category" not in kwargs: - kwargs["category"] = ImageExtractionCategory._smithy_default() - if "bounding_box" not in kwargs: - kwargs["bounding_box"] = ImageBoundingBox._smithy_default() - return kwargs - - -class ImageStandardGenerativeFieldType(UnknownEnumMixin, StrEnum): - IMAGE_SUMMARY = "IMAGE_SUMMARY" - IAB = "IAB" - - -def _serialize_image_standard_generative_field_types( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_image_standard_generative_field_types( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append( - ImageStandardGenerativeFieldType(d.read_string(member_schema)) - ) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ImageStandardGenerativeField: - """Standard Generative Field Configuration of Image""" - - state: str - """State""" - - types: list[str] | None = None - """List of Image Standard Generative Field Type""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IMAGE_STANDARD_GENERATIVE_FIELD, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_IMAGE_STANDARD_GENERATIVE_FIELD.members["state"], self.state - ) - if self.types is not None: - _serialize_image_standard_generative_field_types( - serializer, - _SCHEMA_IMAGE_STANDARD_GENERATIVE_FIELD.members["types"], - self.types, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["state"] = State( - de.read_string( - _SCHEMA_IMAGE_STANDARD_GENERATIVE_FIELD.members["state"] - ) - ) - - case 1: - kwargs["types"] = ( - _deserialize_image_standard_generative_field_types( - de, _SCHEMA_IMAGE_STANDARD_GENERATIVE_FIELD.members["types"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_IMAGE_STANDARD_GENERATIVE_FIELD, consumer=_consumer - ) - if "state" not in kwargs: - kwargs["state"] = State._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class ImageStandardOutputConfiguration: - """Standard Output Configuration of Image""" - - extraction: ImageStandardExtraction | None = None - """Standard Extraction Configuration of Image""" - - generative_field: ImageStandardGenerativeField | None = None - """Standard Generative Field Configuration of Image""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IMAGE_STANDARD_OUTPUT_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.extraction is not None: - serializer.write_struct( - _SCHEMA_IMAGE_STANDARD_OUTPUT_CONFIGURATION.members["extraction"], - self.extraction, - ) - - if self.generative_field is not None: - serializer.write_struct( - _SCHEMA_IMAGE_STANDARD_OUTPUT_CONFIGURATION.members["generativeField"], - self.generative_field, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["extraction"] = ImageStandardExtraction.deserialize(de) - - case 1: - kwargs["generative_field"] = ( - ImageStandardGenerativeField.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_IMAGE_STANDARD_OUTPUT_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class VideoBoundingBox: - """Bounding Box Configuration of Video Extraction""" - - state: str - """State""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VIDEO_BOUNDING_BOX, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_VIDEO_BOUNDING_BOX.members["state"], self.state) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["state"] = State( - de.read_string(_SCHEMA_VIDEO_BOUNDING_BOX.members["state"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VIDEO_BOUNDING_BOX, consumer=_consumer) - if "state" not in kwargs: - kwargs["state"] = State._corrected("") - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(state=State._corrected("")) - - -class VideoExtractionCategoryType(UnknownEnumMixin, StrEnum): - CONTENT_MODERATION = "CONTENT_MODERATION" - TEXT_DETECTION = "TEXT_DETECTION" - TRANSCRIPT = "TRANSCRIPT" - LOGOS = "LOGOS" - - -def _serialize_video_extraction_category_types( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_video_extraction_category_types( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(VideoExtractionCategoryType(d.read_string(member_schema))) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class VideoExtractionCategory: - """Category of Video Extraction""" - - state: str - """State""" - - types: list[str] | None = None - """List of Video Extraction Category Type""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VIDEO_EXTRACTION_CATEGORY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_VIDEO_EXTRACTION_CATEGORY.members["state"], self.state - ) - if self.types is not None: - _serialize_video_extraction_category_types( - serializer, - _SCHEMA_VIDEO_EXTRACTION_CATEGORY.members["types"], - self.types, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["state"] = State( - de.read_string( - _SCHEMA_VIDEO_EXTRACTION_CATEGORY.members["state"] - ) - ) - - case 1: - kwargs["types"] = _deserialize_video_extraction_category_types( - de, _SCHEMA_VIDEO_EXTRACTION_CATEGORY.members["types"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VIDEO_EXTRACTION_CATEGORY, consumer=_consumer) - if "state" not in kwargs: - kwargs["state"] = State._corrected("") - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(state=State._corrected("")) - - -@dataclass(kw_only=True) -class VideoStandardExtraction: - """Standard Extraction Configuration of Video""" - - category: VideoExtractionCategory - """Category of Video Extraction""" - - bounding_box: VideoBoundingBox - """Bounding Box Configuration of Video Extraction""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VIDEO_STANDARD_EXTRACTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_VIDEO_STANDARD_EXTRACTION.members["category"], self.category - ) - serializer.write_struct( - _SCHEMA_VIDEO_STANDARD_EXTRACTION.members["boundingBox"], self.bounding_box - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["category"] = VideoExtractionCategory.deserialize(de) - - case 1: - kwargs["bounding_box"] = VideoBoundingBox.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VIDEO_STANDARD_EXTRACTION, consumer=_consumer) - if "category" not in kwargs: - kwargs["category"] = VideoExtractionCategory._smithy_default() - if "bounding_box" not in kwargs: - kwargs["bounding_box"] = VideoBoundingBox._smithy_default() - return kwargs - - -class VideoStandardGenerativeFieldType(UnknownEnumMixin, StrEnum): - VIDEO_SUMMARY = "VIDEO_SUMMARY" - IAB = "IAB" - CHAPTER_SUMMARY = "CHAPTER_SUMMARY" - - -def _serialize_video_standard_generative_field_types( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_video_standard_generative_field_types( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append( - VideoStandardGenerativeFieldType(d.read_string(member_schema)) - ) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class VideoStandardGenerativeField: - """Standard Generative Field Configuration of Video""" - - state: str - """State""" - - types: list[str] | None = None - """List of Video Standard Generative Field Type""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VIDEO_STANDARD_GENERATIVE_FIELD, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_VIDEO_STANDARD_GENERATIVE_FIELD.members["state"], self.state - ) - if self.types is not None: - _serialize_video_standard_generative_field_types( - serializer, - _SCHEMA_VIDEO_STANDARD_GENERATIVE_FIELD.members["types"], - self.types, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["state"] = State( - de.read_string( - _SCHEMA_VIDEO_STANDARD_GENERATIVE_FIELD.members["state"] - ) - ) - - case 1: - kwargs["types"] = ( - _deserialize_video_standard_generative_field_types( - de, _SCHEMA_VIDEO_STANDARD_GENERATIVE_FIELD.members["types"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_VIDEO_STANDARD_GENERATIVE_FIELD, consumer=_consumer - ) - if "state" not in kwargs: - kwargs["state"] = State._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class VideoStandardOutputConfiguration: - """Standard Output Configuration of Video""" - - extraction: VideoStandardExtraction | None = None - """Standard Extraction Configuration of Video""" - - generative_field: VideoStandardGenerativeField | None = None - """Standard Generative Field Configuration of Video""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VIDEO_STANDARD_OUTPUT_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.extraction is not None: - serializer.write_struct( - _SCHEMA_VIDEO_STANDARD_OUTPUT_CONFIGURATION.members["extraction"], - self.extraction, - ) - - if self.generative_field is not None: - serializer.write_struct( - _SCHEMA_VIDEO_STANDARD_OUTPUT_CONFIGURATION.members["generativeField"], - self.generative_field, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["extraction"] = VideoStandardExtraction.deserialize(de) - - case 1: - kwargs["generative_field"] = ( - VideoStandardGenerativeField.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_VIDEO_STANDARD_OUTPUT_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class StandardOutputConfiguration: - """Standard output configuration""" - - document: DocumentStandardOutputConfiguration | None = None - """Standard Output Configuration of Document""" - - image: ImageStandardOutputConfiguration | None = None - """Standard Output Configuration of Image""" - - video: VideoStandardOutputConfiguration | None = None - """Standard Output Configuration of Video""" - - audio: AudioStandardOutputConfiguration | None = None - """Standard Output Configuration of Audio""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STANDARD_OUTPUT_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.document is not None: - serializer.write_struct( - _SCHEMA_STANDARD_OUTPUT_CONFIGURATION.members["document"], self.document - ) - - if self.image is not None: - serializer.write_struct( - _SCHEMA_STANDARD_OUTPUT_CONFIGURATION.members["image"], self.image - ) - - if self.video is not None: - serializer.write_struct( - _SCHEMA_STANDARD_OUTPUT_CONFIGURATION.members["video"], self.video - ) - - if self.audio is not None: - serializer.write_struct( - _SCHEMA_STANDARD_OUTPUT_CONFIGURATION.members["audio"], self.audio - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["document"] = ( - DocumentStandardOutputConfiguration.deserialize(de) - ) - - case 1: - kwargs["image"] = ImageStandardOutputConfiguration.deserialize(de) - - case 2: - kwargs["video"] = VideoStandardOutputConfiguration.deserialize(de) - - case 3: - kwargs["audio"] = AudioStandardOutputConfiguration.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_STANDARD_OUTPUT_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CreateDataAutomationProjectInput: - """Create DataAutomationProject Request""" - - project_name: str | None = field(repr=False, default=None) - """Name of the DataAutomationProject""" - - project_description: str | None = field(repr=False, default=None) - """Description of the DataAutomationProject""" - - project_stage: str | None = None - """Stage of the Project""" - - project_type: str = DataAutomationProjectType("ASYNC") - """Type of the DataAutomationProject""" - - standard_output_configuration: StandardOutputConfiguration | None = None - """Standard output configuration""" - - custom_output_configuration: CustomOutputConfiguration | None = None - """Custom output configuration""" - - override_configuration: OverrideConfiguration | None = None - """Override configuration""" - - data_automation_library_configuration: DataAutomationLibraryConfiguration | None = ( - None - ) - """DataAutomation Library configuration""" - - client_token: str | None = None - """Client specified token used for idempotency checks""" - - encryption_configuration: EncryptionConfiguration | None = None - """KMS Encryption Configuration""" - - tags: list[Tag] | None = None - """List of tags""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_DATA_AUTOMATION_PROJECT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.project_name is not None: - serializer.write_string( - _SCHEMA_CREATE_DATA_AUTOMATION_PROJECT_INPUT.members["projectName"], - self.project_name, - ) - - if self.project_description is not None: - serializer.write_string( - _SCHEMA_CREATE_DATA_AUTOMATION_PROJECT_INPUT.members[ - "projectDescription" - ], - self.project_description, - ) - - if self.project_stage is not None: - serializer.write_string( - _SCHEMA_CREATE_DATA_AUTOMATION_PROJECT_INPUT.members["projectStage"], - self.project_stage, - ) - - if self.project_type is not None: - serializer.write_string( - _SCHEMA_CREATE_DATA_AUTOMATION_PROJECT_INPUT.members["projectType"], - self.project_type, - ) - - if self.standard_output_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_DATA_AUTOMATION_PROJECT_INPUT.members[ - "standardOutputConfiguration" - ], - self.standard_output_configuration, - ) - - if self.custom_output_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_DATA_AUTOMATION_PROJECT_INPUT.members[ - "customOutputConfiguration" - ], - self.custom_output_configuration, - ) - - if self.override_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_DATA_AUTOMATION_PROJECT_INPUT.members[ - "overrideConfiguration" - ], - self.override_configuration, - ) - - if self.data_automation_library_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_DATA_AUTOMATION_PROJECT_INPUT.members[ - "dataAutomationLibraryConfiguration" - ], - self.data_automation_library_configuration, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_DATA_AUTOMATION_PROJECT_INPUT.members["clientToken"], - self.client_token, - ) - - if self.encryption_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_DATA_AUTOMATION_PROJECT_INPUT.members[ - "encryptionConfiguration" - ], - self.encryption_configuration, - ) - - if self.tags is not None: - _serialize_tag_list( - serializer, - _SCHEMA_CREATE_DATA_AUTOMATION_PROJECT_INPUT.members["tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["project_name"] = de.read_string( - _SCHEMA_CREATE_DATA_AUTOMATION_PROJECT_INPUT.members[ - "projectName" - ] - ) - - case 1: - kwargs["project_description"] = de.read_string( - _SCHEMA_CREATE_DATA_AUTOMATION_PROJECT_INPUT.members[ - "projectDescription" - ] - ) - - case 2: - kwargs["project_stage"] = DataAutomationProjectStage( - de.read_string( - _SCHEMA_CREATE_DATA_AUTOMATION_PROJECT_INPUT.members[ - "projectStage" - ] - ) - ) - - case 3: - kwargs["project_type"] = DataAutomationProjectType( - de.read_string( - _SCHEMA_CREATE_DATA_AUTOMATION_PROJECT_INPUT.members[ - "projectType" - ] - ) - ) - - case 4: - kwargs["standard_output_configuration"] = ( - StandardOutputConfiguration.deserialize(de) - ) - - case 5: - kwargs["custom_output_configuration"] = ( - CustomOutputConfiguration.deserialize(de) - ) - - case 6: - kwargs["override_configuration"] = ( - OverrideConfiguration.deserialize(de) - ) - - case 7: - kwargs["data_automation_library_configuration"] = ( - DataAutomationLibraryConfiguration.deserialize(de) - ) - - case 8: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_DATA_AUTOMATION_PROJECT_INPUT.members[ - "clientToken" - ] - ) - - case 9: - kwargs["encryption_configuration"] = ( - EncryptionConfiguration.deserialize(de) - ) - - case 10: - kwargs["tags"] = _deserialize_tag_list( - de, _SCHEMA_CREATE_DATA_AUTOMATION_PROJECT_INPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_DATA_AUTOMATION_PROJECT_INPUT, consumer=_consumer - ) - return kwargs - - -class DataAutomationProjectStatus(UnknownEnumMixin, StrEnum): - """Status of Data Automation Project""" - - COMPLETED = "COMPLETED" - IN_PROGRESS = "IN_PROGRESS" - FAILED = "FAILED" - - -@dataclass(kw_only=True) -class CreateDataAutomationProjectOutput: - """Create DataAutomationProject Response""" - - project_arn: str - """ARN of a DataAutomationProject""" - - project_stage: str | None = None - """Stage of the Project""" - - status: str | None = None - """Status of Data Automation Project""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_DATA_AUTOMATION_PROJECT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_DATA_AUTOMATION_PROJECT_OUTPUT.members["projectArn"], - self.project_arn, - ) - if self.project_stage is not None: - serializer.write_string( - _SCHEMA_CREATE_DATA_AUTOMATION_PROJECT_OUTPUT.members["projectStage"], - self.project_stage, - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_CREATE_DATA_AUTOMATION_PROJECT_OUTPUT.members["status"], - self.status, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["project_arn"] = de.read_string( - _SCHEMA_CREATE_DATA_AUTOMATION_PROJECT_OUTPUT.members[ - "projectArn" - ] - ) - - case 1: - kwargs["project_stage"] = DataAutomationProjectStage( - de.read_string( - _SCHEMA_CREATE_DATA_AUTOMATION_PROJECT_OUTPUT.members[ - "projectStage" - ] - ) - ) - - case 2: - kwargs["status"] = DataAutomationProjectStatus( - de.read_string( - _SCHEMA_CREATE_DATA_AUTOMATION_PROJECT_OUTPUT.members[ - "status" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_DATA_AUTOMATION_PROJECT_OUTPUT, consumer=_consumer - ) - if "project_arn" not in kwargs: - kwargs["project_arn"] = "" - return kwargs - - -CREATE_DATA_AUTOMATION_PROJECT = APIOperation( - input=CreateDataAutomationProjectInput, - output=CreateDataAutomationProjectOutput, - schema=_SCHEMA_CREATE_DATA_AUTOMATION_PROJECT, - input_schema=_SCHEMA_CREATE_DATA_AUTOMATION_PROJECT_INPUT, - output_schema=_SCHEMA_CREATE_DATA_AUTOMATION_PROJECT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockdataautomation#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockdataautomation#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteDataAutomationProjectInput: - """Delete DataAutomationProject Request""" - - project_arn: str | None = None - """ARN generated at the server side when a DataAutomationProject is created""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_DATA_AUTOMATION_PROJECT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.project_arn is not None: - serializer.write_string( - _SCHEMA_DELETE_DATA_AUTOMATION_PROJECT_INPUT.members["projectArn"], - self.project_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["project_arn"] = de.read_string( - _SCHEMA_DELETE_DATA_AUTOMATION_PROJECT_INPUT.members[ - "projectArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_DATA_AUTOMATION_PROJECT_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteDataAutomationProjectOutput: - """Delete DataAutomationProject Response""" - - project_arn: str - """ARN of a DataAutomationProject""" - - status: str | None = None - """Status of Data Automation Project""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_DATA_AUTOMATION_PROJECT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DELETE_DATA_AUTOMATION_PROJECT_OUTPUT.members["projectArn"], - self.project_arn, - ) - if self.status is not None: - serializer.write_string( - _SCHEMA_DELETE_DATA_AUTOMATION_PROJECT_OUTPUT.members["status"], - self.status, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["project_arn"] = de.read_string( - _SCHEMA_DELETE_DATA_AUTOMATION_PROJECT_OUTPUT.members[ - "projectArn" - ] - ) - - case 1: - kwargs["status"] = DataAutomationProjectStatus( - de.read_string( - _SCHEMA_DELETE_DATA_AUTOMATION_PROJECT_OUTPUT.members[ - "status" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_DATA_AUTOMATION_PROJECT_OUTPUT, consumer=_consumer - ) - if "project_arn" not in kwargs: - kwargs["project_arn"] = "" - return kwargs - - -DELETE_DATA_AUTOMATION_PROJECT = APIOperation( - input=DeleteDataAutomationProjectInput, - output=DeleteDataAutomationProjectOutput, - schema=_SCHEMA_DELETE_DATA_AUTOMATION_PROJECT, - input_schema=_SCHEMA_DELETE_DATA_AUTOMATION_PROJECT_INPUT, - output_schema=_SCHEMA_DELETE_DATA_AUTOMATION_PROJECT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockdataautomation#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockdataautomation#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetDataAutomationProjectInput: - """Get DataAutomationProject Request""" - - project_arn: str | None = None - """ARN generated at the server side when a DataAutomationProject is created""" - - project_stage: str | None = None - """Optional field to delete a specific DataAutomationProject stage""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DATA_AUTOMATION_PROJECT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.project_arn is not None: - serializer.write_string( - _SCHEMA_GET_DATA_AUTOMATION_PROJECT_INPUT.members["projectArn"], - self.project_arn, - ) - - if self.project_stage is not None: - serializer.write_string( - _SCHEMA_GET_DATA_AUTOMATION_PROJECT_INPUT.members["projectStage"], - self.project_stage, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["project_arn"] = de.read_string( - _SCHEMA_GET_DATA_AUTOMATION_PROJECT_INPUT.members["projectArn"] - ) - - case 1: - kwargs["project_stage"] = DataAutomationProjectStage( - de.read_string( - _SCHEMA_GET_DATA_AUTOMATION_PROJECT_INPUT.members[ - "projectStage" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_DATA_AUTOMATION_PROJECT_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DataAutomationProject: - """Contains the information of a DataAutomationProject.""" - - project_arn: str - """ARN of a DataAutomationProject""" - - creation_time: datetime - """Time Stamp""" - - last_modified_time: datetime - """Time Stamp""" - - project_name: str = field(repr=False) - """Name of the DataAutomationProject""" - - status: str - """Status of Data Automation Project""" - - project_stage: str | None = None - """Stage of the Project""" - - project_type: str | None = None - """Type of the DataAutomationProject""" - - project_description: str | None = field(repr=False, default=None) - """Description of the DataAutomationProject""" - - standard_output_configuration: StandardOutputConfiguration | None = None - """Standard output configuration""" - - custom_output_configuration: CustomOutputConfiguration | None = None - """Custom output configuration""" - - override_configuration: OverrideConfiguration | None = None - """Override configuration""" - - data_automation_library_configuration: DataAutomationLibraryConfiguration | None = ( - None - ) - """DataAutomation Library configuration""" - - kms_key_id: str | None = None - """KMS Key Identifier""" - - kms_encryption_context: dict[str, str] | None = None - """KMS Encryption Context""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DATA_AUTOMATION_PROJECT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DATA_AUTOMATION_PROJECT.members["projectArn"], self.project_arn - ) - serializer.write_timestamp( - _SCHEMA_DATA_AUTOMATION_PROJECT.members["creationTime"], self.creation_time - ) - serializer.write_timestamp( - _SCHEMA_DATA_AUTOMATION_PROJECT.members["lastModifiedTime"], - self.last_modified_time, - ) - serializer.write_string( - _SCHEMA_DATA_AUTOMATION_PROJECT.members["projectName"], self.project_name - ) - if self.project_stage is not None: - serializer.write_string( - _SCHEMA_DATA_AUTOMATION_PROJECT.members["projectStage"], - self.project_stage, - ) - - if self.project_type is not None: - serializer.write_string( - _SCHEMA_DATA_AUTOMATION_PROJECT.members["projectType"], - self.project_type, - ) - - if self.project_description is not None: - serializer.write_string( - _SCHEMA_DATA_AUTOMATION_PROJECT.members["projectDescription"], - self.project_description, - ) - - if self.standard_output_configuration is not None: - serializer.write_struct( - _SCHEMA_DATA_AUTOMATION_PROJECT.members["standardOutputConfiguration"], - self.standard_output_configuration, - ) - - if self.custom_output_configuration is not None: - serializer.write_struct( - _SCHEMA_DATA_AUTOMATION_PROJECT.members["customOutputConfiguration"], - self.custom_output_configuration, - ) - - if self.override_configuration is not None: - serializer.write_struct( - _SCHEMA_DATA_AUTOMATION_PROJECT.members["overrideConfiguration"], - self.override_configuration, - ) - - if self.data_automation_library_configuration is not None: - serializer.write_struct( - _SCHEMA_DATA_AUTOMATION_PROJECT.members[ - "dataAutomationLibraryConfiguration" - ], - self.data_automation_library_configuration, - ) - - serializer.write_string( - _SCHEMA_DATA_AUTOMATION_PROJECT.members["status"], self.status - ) - if self.kms_key_id is not None: - serializer.write_string( - _SCHEMA_DATA_AUTOMATION_PROJECT.members["kmsKeyId"], self.kms_key_id - ) - - if self.kms_encryption_context is not None: - _serialize_kms_encryption_context( - serializer, - _SCHEMA_DATA_AUTOMATION_PROJECT.members["kmsEncryptionContext"], - self.kms_encryption_context, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["project_arn"] = de.read_string( - _SCHEMA_DATA_AUTOMATION_PROJECT.members["projectArn"] - ) - - case 1: - kwargs["creation_time"] = de.read_timestamp( - _SCHEMA_DATA_AUTOMATION_PROJECT.members["creationTime"] - ) - - case 2: - kwargs["last_modified_time"] = de.read_timestamp( - _SCHEMA_DATA_AUTOMATION_PROJECT.members["lastModifiedTime"] - ) - - case 3: - kwargs["project_name"] = de.read_string( - _SCHEMA_DATA_AUTOMATION_PROJECT.members["projectName"] - ) - - case 4: - kwargs["project_stage"] = DataAutomationProjectStage( - de.read_string( - _SCHEMA_DATA_AUTOMATION_PROJECT.members["projectStage"] - ) - ) - - case 5: - kwargs["project_type"] = DataAutomationProjectType( - de.read_string( - _SCHEMA_DATA_AUTOMATION_PROJECT.members["projectType"] - ) - ) - - case 6: - kwargs["project_description"] = de.read_string( - _SCHEMA_DATA_AUTOMATION_PROJECT.members["projectDescription"] - ) - - case 7: - kwargs["standard_output_configuration"] = ( - StandardOutputConfiguration.deserialize(de) - ) - - case 8: - kwargs["custom_output_configuration"] = ( - CustomOutputConfiguration.deserialize(de) - ) - - case 9: - kwargs["override_configuration"] = ( - OverrideConfiguration.deserialize(de) - ) - - case 10: - kwargs["data_automation_library_configuration"] = ( - DataAutomationLibraryConfiguration.deserialize(de) - ) - - case 11: - kwargs["status"] = DataAutomationProjectStatus( - de.read_string( - _SCHEMA_DATA_AUTOMATION_PROJECT.members["status"] - ) - ) - - case 12: - kwargs["kms_key_id"] = de.read_string( - _SCHEMA_DATA_AUTOMATION_PROJECT.members["kmsKeyId"] - ) - - case 13: - kwargs["kms_encryption_context"] = ( - _deserialize_kms_encryption_context( - de, - _SCHEMA_DATA_AUTOMATION_PROJECT.members[ - "kmsEncryptionContext" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DATA_AUTOMATION_PROJECT, consumer=_consumer) - if "project_arn" not in kwargs: - kwargs["project_arn"] = "" - if "creation_time" not in kwargs: - kwargs["creation_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "last_modified_time" not in kwargs: - kwargs["last_modified_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "project_name" not in kwargs: - kwargs["project_name"] = "" - if "status" not in kwargs: - kwargs["status"] = DataAutomationProjectStatus._corrected("") - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls( - project_arn="", - creation_time=datetime.fromtimestamp(0, tz=timezone.utc), - last_modified_time=datetime.fromtimestamp(0, tz=timezone.utc), - project_name="", - status=DataAutomationProjectStatus._corrected(""), - ) - - -@dataclass(kw_only=True) -class GetDataAutomationProjectOutput: - """Get DataAutomationProject Response""" - - project: DataAutomationProject - """Contains the information of a DataAutomationProject.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DATA_AUTOMATION_PROJECT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_DATA_AUTOMATION_PROJECT_OUTPUT.members["project"], self.project - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["project"] = DataAutomationProject.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_DATA_AUTOMATION_PROJECT_OUTPUT, consumer=_consumer - ) - if "project" not in kwargs: - kwargs["project"] = DataAutomationProject._smithy_default() - return kwargs - - -GET_DATA_AUTOMATION_PROJECT = APIOperation( - input=GetDataAutomationProjectInput, - output=GetDataAutomationProjectOutput, - schema=_SCHEMA_GET_DATA_AUTOMATION_PROJECT, - input_schema=_SCHEMA_GET_DATA_AUTOMATION_PROJECT_INPUT, - output_schema=_SCHEMA_GET_DATA_AUTOMATION_PROJECT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockdataautomation#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockdataautomation#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class BlueprintFilter: - """Blueprint Filter""" - - blueprint_arn: str - """ARN of a Blueprint""" - - blueprint_version: str | None = None - """Blueprint Version""" - - blueprint_stage: str | None = None - """Stage of the Blueprint""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BLUEPRINT_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_BLUEPRINT_FILTER.members["blueprintArn"], self.blueprint_arn - ) - if self.blueprint_version is not None: - serializer.write_string( - _SCHEMA_BLUEPRINT_FILTER.members["blueprintVersion"], - self.blueprint_version, - ) - - if self.blueprint_stage is not None: - serializer.write_string( - _SCHEMA_BLUEPRINT_FILTER.members["blueprintStage"], self.blueprint_stage - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["blueprint_arn"] = de.read_string( - _SCHEMA_BLUEPRINT_FILTER.members["blueprintArn"] - ) - - case 1: - kwargs["blueprint_version"] = de.read_string( - _SCHEMA_BLUEPRINT_FILTER.members["blueprintVersion"] - ) - - case 2: - kwargs["blueprint_stage"] = BlueprintStage( - de.read_string( - _SCHEMA_BLUEPRINT_FILTER.members["blueprintStage"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BLUEPRINT_FILTER, consumer=_consumer) - if "blueprint_arn" not in kwargs: - kwargs["blueprint_arn"] = "" - return kwargs - - -@dataclass(kw_only=True) -class DataAutomationLibraryFilter: - """Data Automation Library Filter""" - - library_arn: str - """ARN generated at the server side when a DataAutomationLibrary is created""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DATA_AUTOMATION_LIBRARY_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DATA_AUTOMATION_LIBRARY_FILTER.members["libraryArn"], - self.library_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["library_arn"] = de.read_string( - _SCHEMA_DATA_AUTOMATION_LIBRARY_FILTER.members["libraryArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DATA_AUTOMATION_LIBRARY_FILTER, consumer=_consumer - ) - if "library_arn" not in kwargs: - kwargs["library_arn"] = "" - return kwargs - - -class DataAutomationProjectStageFilter(UnknownEnumMixin, StrEnum): - """Project Stage filter""" - - DEVELOPMENT = "DEVELOPMENT" - LIVE = "LIVE" - ALL = "ALL" - - -@dataclass(kw_only=True) -class ListDataAutomationProjectsInput: - """List DataAutomationProject Request""" - - max_results: int | None = None - """Max Results""" - - next_token: str | None = None - """Pagination token""" - - project_stage_filter: str | None = None - """Project Stage filter""" - - blueprint_filter: BlueprintFilter | None = None - """Blueprint Filter""" - - resource_owner: str | None = None - """Resource Owner""" - - library_filter: DataAutomationLibraryFilter | None = None - """Data Automation Library Filter""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_DATA_AUTOMATION_PROJECTS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_DATA_AUTOMATION_PROJECTS_INPUT.members["maxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_DATA_AUTOMATION_PROJECTS_INPUT.members["nextToken"], - self.next_token, - ) - - if self.project_stage_filter is not None: - serializer.write_string( - _SCHEMA_LIST_DATA_AUTOMATION_PROJECTS_INPUT.members[ - "projectStageFilter" - ], - self.project_stage_filter, - ) - - if self.blueprint_filter is not None: - serializer.write_struct( - _SCHEMA_LIST_DATA_AUTOMATION_PROJECTS_INPUT.members["blueprintFilter"], - self.blueprint_filter, - ) - - if self.resource_owner is not None: - serializer.write_string( - _SCHEMA_LIST_DATA_AUTOMATION_PROJECTS_INPUT.members["resourceOwner"], - self.resource_owner, - ) - - if self.library_filter is not None: - serializer.write_struct( - _SCHEMA_LIST_DATA_AUTOMATION_PROJECTS_INPUT.members["libraryFilter"], - self.library_filter, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_DATA_AUTOMATION_PROJECTS_INPUT.members[ - "maxResults" - ] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_DATA_AUTOMATION_PROJECTS_INPUT.members["nextToken"] - ) - - case 2: - kwargs["project_stage_filter"] = DataAutomationProjectStageFilter( - de.read_string( - _SCHEMA_LIST_DATA_AUTOMATION_PROJECTS_INPUT.members[ - "projectStageFilter" - ] - ) - ) - - case 3: - kwargs["blueprint_filter"] = BlueprintFilter.deserialize(de) - - case 4: - kwargs["resource_owner"] = ResourceOwner( - de.read_string( - _SCHEMA_LIST_DATA_AUTOMATION_PROJECTS_INPUT.members[ - "resourceOwner" - ] - ) - ) - - case 5: - kwargs["library_filter"] = DataAutomationLibraryFilter.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_DATA_AUTOMATION_PROJECTS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DataAutomationProjectSummary: - """Summary of a DataAutomationProject""" - - project_arn: str - """ARN of a DataAutomationProject""" - - creation_time: datetime - """Time Stamp""" - - project_stage: str | None = None - """Stage of the Project""" - - project_type: str | None = None - """Type of the DataAutomationProject""" - - project_name: str | None = field(repr=False, default=None) - """Name of the DataAutomationProject""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DATA_AUTOMATION_PROJECT_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DATA_AUTOMATION_PROJECT_SUMMARY.members["projectArn"], - self.project_arn, - ) - if self.project_stage is not None: - serializer.write_string( - _SCHEMA_DATA_AUTOMATION_PROJECT_SUMMARY.members["projectStage"], - self.project_stage, - ) - - if self.project_type is not None: - serializer.write_string( - _SCHEMA_DATA_AUTOMATION_PROJECT_SUMMARY.members["projectType"], - self.project_type, - ) - - if self.project_name is not None: - serializer.write_string( - _SCHEMA_DATA_AUTOMATION_PROJECT_SUMMARY.members["projectName"], - self.project_name, - ) - - serializer.write_timestamp( - _SCHEMA_DATA_AUTOMATION_PROJECT_SUMMARY.members["creationTime"], - self.creation_time, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["project_arn"] = de.read_string( - _SCHEMA_DATA_AUTOMATION_PROJECT_SUMMARY.members["projectArn"] - ) - - case 1: - kwargs["project_stage"] = DataAutomationProjectStage( - de.read_string( - _SCHEMA_DATA_AUTOMATION_PROJECT_SUMMARY.members[ - "projectStage" - ] - ) - ) - - case 2: - kwargs["project_type"] = DataAutomationProjectType( - de.read_string( - _SCHEMA_DATA_AUTOMATION_PROJECT_SUMMARY.members[ - "projectType" - ] - ) - ) - - case 3: - kwargs["project_name"] = de.read_string( - _SCHEMA_DATA_AUTOMATION_PROJECT_SUMMARY.members["projectName"] - ) - - case 4: - kwargs["creation_time"] = de.read_timestamp( - _SCHEMA_DATA_AUTOMATION_PROJECT_SUMMARY.members["creationTime"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DATA_AUTOMATION_PROJECT_SUMMARY, consumer=_consumer - ) - if "project_arn" not in kwargs: - kwargs["project_arn"] = "" - if "creation_time" not in kwargs: - kwargs["creation_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_data_automation_project_summaries( - serializer: ShapeSerializer, - schema: Schema, - value: list[DataAutomationProjectSummary], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_data_automation_project_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[DataAutomationProjectSummary]: - result: list[DataAutomationProjectSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(DataAutomationProjectSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListDataAutomationProjectsOutput: - """List DataAutomationProject Response""" - - projects: list[DataAutomationProjectSummary] - """List of DataAutomationProjectSummary""" - - next_token: str | None = None - """Pagination token""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_DATA_AUTOMATION_PROJECTS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_data_automation_project_summaries( - serializer, - _SCHEMA_LIST_DATA_AUTOMATION_PROJECTS_OUTPUT.members["projects"], - self.projects, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_DATA_AUTOMATION_PROJECTS_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["projects"] = _deserialize_data_automation_project_summaries( - de, - _SCHEMA_LIST_DATA_AUTOMATION_PROJECTS_OUTPUT.members[ - "projects" - ], - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_DATA_AUTOMATION_PROJECTS_OUTPUT.members[ - "nextToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_DATA_AUTOMATION_PROJECTS_OUTPUT, consumer=_consumer - ) - if "projects" not in kwargs: - kwargs["projects"] = [] - return kwargs - - -LIST_DATA_AUTOMATION_PROJECTS = APIOperation( - input=ListDataAutomationProjectsInput, - output=ListDataAutomationProjectsOutput, - schema=_SCHEMA_LIST_DATA_AUTOMATION_PROJECTS, - input_schema=_SCHEMA_LIST_DATA_AUTOMATION_PROJECTS_INPUT, - output_schema=_SCHEMA_LIST_DATA_AUTOMATION_PROJECTS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockdataautomation#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockdataautomation#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateDataAutomationProjectInput: - """Update DataAutomationProject Request""" - - project_arn: str | None = None - """ARN generated at the server side when a DataAutomationProject is created""" - - project_stage: str | None = None - """Stage of the Project""" - - project_description: str | None = field(repr=False, default=None) - """Description of the DataAutomationProject""" - - standard_output_configuration: StandardOutputConfiguration | None = None - """Standard output configuration""" - - custom_output_configuration: CustomOutputConfiguration | None = None - """Custom output configuration""" - - override_configuration: OverrideConfiguration | None = None - """Override configuration""" - - data_automation_library_configuration: DataAutomationLibraryConfiguration | None = ( - None - ) - """DataAutomation Library configuration""" - - encryption_configuration: EncryptionConfiguration | None = None - """KMS Encryption Configuration""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_DATA_AUTOMATION_PROJECT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.project_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_DATA_AUTOMATION_PROJECT_INPUT.members["projectArn"], - self.project_arn, - ) - - if self.project_stage is not None: - serializer.write_string( - _SCHEMA_UPDATE_DATA_AUTOMATION_PROJECT_INPUT.members["projectStage"], - self.project_stage, - ) - - if self.project_description is not None: - serializer.write_string( - _SCHEMA_UPDATE_DATA_AUTOMATION_PROJECT_INPUT.members[ - "projectDescription" - ], - self.project_description, - ) - - if self.standard_output_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_DATA_AUTOMATION_PROJECT_INPUT.members[ - "standardOutputConfiguration" - ], - self.standard_output_configuration, - ) - - if self.custom_output_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_DATA_AUTOMATION_PROJECT_INPUT.members[ - "customOutputConfiguration" - ], - self.custom_output_configuration, - ) - - if self.override_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_DATA_AUTOMATION_PROJECT_INPUT.members[ - "overrideConfiguration" - ], - self.override_configuration, - ) - - if self.data_automation_library_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_DATA_AUTOMATION_PROJECT_INPUT.members[ - "dataAutomationLibraryConfiguration" - ], - self.data_automation_library_configuration, - ) - - if self.encryption_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_DATA_AUTOMATION_PROJECT_INPUT.members[ - "encryptionConfiguration" - ], - self.encryption_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["project_arn"] = de.read_string( - _SCHEMA_UPDATE_DATA_AUTOMATION_PROJECT_INPUT.members[ - "projectArn" - ] - ) - - case 1: - kwargs["project_stage"] = DataAutomationProjectStage( - de.read_string( - _SCHEMA_UPDATE_DATA_AUTOMATION_PROJECT_INPUT.members[ - "projectStage" - ] - ) - ) - - case 2: - kwargs["project_description"] = de.read_string( - _SCHEMA_UPDATE_DATA_AUTOMATION_PROJECT_INPUT.members[ - "projectDescription" - ] - ) - - case 3: - kwargs["standard_output_configuration"] = ( - StandardOutputConfiguration.deserialize(de) - ) - - case 4: - kwargs["custom_output_configuration"] = ( - CustomOutputConfiguration.deserialize(de) - ) - - case 5: - kwargs["override_configuration"] = ( - OverrideConfiguration.deserialize(de) - ) - - case 6: - kwargs["data_automation_library_configuration"] = ( - DataAutomationLibraryConfiguration.deserialize(de) - ) - - case 7: - kwargs["encryption_configuration"] = ( - EncryptionConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_DATA_AUTOMATION_PROJECT_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateDataAutomationProjectOutput: - """Update DataAutomationProject Response""" - - project_arn: str - """ARN of a DataAutomationProject""" - - project_stage: str | None = None - """Stage of the Project""" - - status: str | None = None - """Status of Data Automation Project""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_DATA_AUTOMATION_PROJECT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_UPDATE_DATA_AUTOMATION_PROJECT_OUTPUT.members["projectArn"], - self.project_arn, - ) - if self.project_stage is not None: - serializer.write_string( - _SCHEMA_UPDATE_DATA_AUTOMATION_PROJECT_OUTPUT.members["projectStage"], - self.project_stage, - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_UPDATE_DATA_AUTOMATION_PROJECT_OUTPUT.members["status"], - self.status, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["project_arn"] = de.read_string( - _SCHEMA_UPDATE_DATA_AUTOMATION_PROJECT_OUTPUT.members[ - "projectArn" - ] - ) - - case 1: - kwargs["project_stage"] = DataAutomationProjectStage( - de.read_string( - _SCHEMA_UPDATE_DATA_AUTOMATION_PROJECT_OUTPUT.members[ - "projectStage" - ] - ) - ) - - case 2: - kwargs["status"] = DataAutomationProjectStatus( - de.read_string( - _SCHEMA_UPDATE_DATA_AUTOMATION_PROJECT_OUTPUT.members[ - "status" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_DATA_AUTOMATION_PROJECT_OUTPUT, consumer=_consumer - ) - if "project_arn" not in kwargs: - kwargs["project_arn"] = "" - return kwargs - - -UPDATE_DATA_AUTOMATION_PROJECT = APIOperation( - input=UpdateDataAutomationProjectInput, - output=UpdateDataAutomationProjectOutput, - schema=_SCHEMA_UPDATE_DATA_AUTOMATION_PROJECT, - input_schema=_SCHEMA_UPDATE_DATA_AUTOMATION_PROJECT_INPUT, - output_schema=_SCHEMA_UPDATE_DATA_AUTOMATION_PROJECT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockdataautomation#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockdataautomation#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetDataAutomationLibraryEntityInput: - """Get DataAutomationLibraryEntity Request""" - - library_arn: str | None = None - """ARN generated at the server side when a DataAutomationLibrary is created""" - - entity_type: str | None = None - """The entity type for which the entity is requested""" - - entity_id: str | None = None - """Unique identifier for the entity""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DATA_AUTOMATION_LIBRARY_ENTITY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.library_arn is not None: - serializer.write_string( - _SCHEMA_GET_DATA_AUTOMATION_LIBRARY_ENTITY_INPUT.members["libraryArn"], - self.library_arn, - ) - - if self.entity_type is not None: - serializer.write_string( - _SCHEMA_GET_DATA_AUTOMATION_LIBRARY_ENTITY_INPUT.members["entityType"], - self.entity_type, - ) - - if self.entity_id is not None: - serializer.write_string( - _SCHEMA_GET_DATA_AUTOMATION_LIBRARY_ENTITY_INPUT.members["entityId"], - self.entity_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["library_arn"] = de.read_string( - _SCHEMA_GET_DATA_AUTOMATION_LIBRARY_ENTITY_INPUT.members[ - "libraryArn" - ] - ) - - case 1: - kwargs["entity_type"] = EntityType( - de.read_string( - _SCHEMA_GET_DATA_AUTOMATION_LIBRARY_ENTITY_INPUT.members[ - "entityType" - ] - ) - ) - - case 2: - kwargs["entity_id"] = de.read_string( - _SCHEMA_GET_DATA_AUTOMATION_LIBRARY_ENTITY_INPUT.members[ - "entityId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_DATA_AUTOMATION_LIBRARY_ENTITY_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class VocabularyEntity: - """Vocabulary entity with detailed information""" - - entity_id: str | None = None - """Unique identifier for the entity""" - - description: str | None = field(repr=False, default=None) - """Description of the entity""" - - language: str | None = None - """Supported input languages""" - - phrases: list[Phrase] | None = None - """List of phrases""" - - last_modified_time: datetime | None = None - """Time Stamp""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VOCABULARY_ENTITY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.entity_id is not None: - serializer.write_string( - _SCHEMA_VOCABULARY_ENTITY.members["entityId"], self.entity_id - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_VOCABULARY_ENTITY.members["description"], self.description - ) - - if self.language is not None: - serializer.write_string( - _SCHEMA_VOCABULARY_ENTITY.members["language"], self.language - ) - - if self.phrases is not None: - _serialize_phrase_list( - serializer, _SCHEMA_VOCABULARY_ENTITY.members["phrases"], self.phrases - ) - - if self.last_modified_time is not None: - serializer.write_timestamp( - _SCHEMA_VOCABULARY_ENTITY.members["lastModifiedTime"], - self.last_modified_time, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["entity_id"] = de.read_string( - _SCHEMA_VOCABULARY_ENTITY.members["entityId"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_VOCABULARY_ENTITY.members["description"] - ) - - case 2: - kwargs["language"] = Language( - de.read_string(_SCHEMA_VOCABULARY_ENTITY.members["language"]) - ) - - case 3: - kwargs["phrases"] = _deserialize_phrase_list( - de, _SCHEMA_VOCABULARY_ENTITY.members["phrases"] - ) - - case 4: - kwargs["last_modified_time"] = de.read_timestamp( - _SCHEMA_VOCABULARY_ENTITY.members["lastModifiedTime"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VOCABULARY_ENTITY, consumer=_consumer) - return kwargs - - -@dataclass -class EntityDetailsVocabulary: - """Vocabulary entity with detailed information""" - - value: VocabularyEntity - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ENTITY_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_ENTITY_DETAILS.members["vocabulary"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=VocabularyEntity.deserialize(deserializer)) - - -@dataclass -class EntityDetailsUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -EntityDetails = Union[EntityDetailsVocabulary | EntityDetailsUnknown] -"""Detailed information about an entity""" - - -class _EntityDetailsDeserializer: - _result: EntityDetails | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> EntityDetails: - self._result = None - deserializer.read_struct(_SCHEMA_ENTITY_DETAILS, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(EntityDetailsVocabulary.deserialize(de)) - - case _: - self._set_result(EntityDetailsUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: EntityDetails) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class GetDataAutomationLibraryEntityOutput: - """Get DataAutomationLibraryEntity Response""" - - entity: EntityDetails | None = None - """Detailed information about the entity""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DATA_AUTOMATION_LIBRARY_ENTITY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.entity is not None: - serializer.write_struct( - _SCHEMA_GET_DATA_AUTOMATION_LIBRARY_ENTITY_OUTPUT.members["entity"], - self.entity, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["entity"] = _EntityDetailsDeserializer().deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_DATA_AUTOMATION_LIBRARY_ENTITY_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_DATA_AUTOMATION_LIBRARY_ENTITY = APIOperation( - input=GetDataAutomationLibraryEntityInput, - output=GetDataAutomationLibraryEntityOutput, - schema=_SCHEMA_GET_DATA_AUTOMATION_LIBRARY_ENTITY, - input_schema=_SCHEMA_GET_DATA_AUTOMATION_LIBRARY_ENTITY_INPUT, - output_schema=_SCHEMA_GET_DATA_AUTOMATION_LIBRARY_ENTITY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockdataautomation#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockdataautomation#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListDataAutomationLibraryEntitiesInput: - """List DataAutomationLibraryEntities Request""" - - library_arn: str | None = None - """ARN generated at the server side when a DataAutomationLibrary is created""" - - entity_type: str | None = None - """The entity type for which the entity list is requested""" - - max_results: int | None = None - """Max Results""" - - next_token: str | None = None - """Pagination token for retrieving the next set of results""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_LIST_DATA_AUTOMATION_LIBRARY_ENTITIES_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.library_arn is not None: - serializer.write_string( - _SCHEMA_LIST_DATA_AUTOMATION_LIBRARY_ENTITIES_INPUT.members[ - "libraryArn" - ], - self.library_arn, - ) - - if self.entity_type is not None: - serializer.write_string( - _SCHEMA_LIST_DATA_AUTOMATION_LIBRARY_ENTITIES_INPUT.members[ - "entityType" - ], - self.entity_type, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_DATA_AUTOMATION_LIBRARY_ENTITIES_INPUT.members[ - "maxResults" - ], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_DATA_AUTOMATION_LIBRARY_ENTITIES_INPUT.members[ - "nextToken" - ], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["library_arn"] = de.read_string( - _SCHEMA_LIST_DATA_AUTOMATION_LIBRARY_ENTITIES_INPUT.members[ - "libraryArn" - ] - ) - - case 1: - kwargs["entity_type"] = EntityType( - de.read_string( - _SCHEMA_LIST_DATA_AUTOMATION_LIBRARY_ENTITIES_INPUT.members[ - "entityType" - ] - ) - ) - - case 2: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_DATA_AUTOMATION_LIBRARY_ENTITIES_INPUT.members[ - "maxResults" - ] - ) - - case 3: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_DATA_AUTOMATION_LIBRARY_ENTITIES_INPUT.members[ - "nextToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_DATA_AUTOMATION_LIBRARY_ENTITIES_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class VocabularyEntitySummary: - """Summary of a Vocabulary entity""" - - entity_id: str | None = None - """Unique identifier for the entity""" - - description: str | None = field(repr=False, default=None) - """Description of the entity""" - - language: str | None = None - """Supported input languages""" - - num_of_phrases: int | None = None - """num of phrases in the entity""" - - last_modified_time: datetime | None = None - """Time Stamp""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VOCABULARY_ENTITY_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.entity_id is not None: - serializer.write_string( - _SCHEMA_VOCABULARY_ENTITY_SUMMARY.members["entityId"], self.entity_id - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_VOCABULARY_ENTITY_SUMMARY.members["description"], - self.description, - ) - - if self.language is not None: - serializer.write_string( - _SCHEMA_VOCABULARY_ENTITY_SUMMARY.members["language"], self.language - ) - - if self.num_of_phrases is not None: - serializer.write_integer( - _SCHEMA_VOCABULARY_ENTITY_SUMMARY.members["numOfPhrases"], - self.num_of_phrases, - ) - - if self.last_modified_time is not None: - serializer.write_timestamp( - _SCHEMA_VOCABULARY_ENTITY_SUMMARY.members["lastModifiedTime"], - self.last_modified_time, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["entity_id"] = de.read_string( - _SCHEMA_VOCABULARY_ENTITY_SUMMARY.members["entityId"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_VOCABULARY_ENTITY_SUMMARY.members["description"] - ) - - case 2: - kwargs["language"] = Language( - de.read_string( - _SCHEMA_VOCABULARY_ENTITY_SUMMARY.members["language"] - ) - ) - - case 3: - kwargs["num_of_phrases"] = de.read_integer( - _SCHEMA_VOCABULARY_ENTITY_SUMMARY.members["numOfPhrases"] - ) - - case 4: - kwargs["last_modified_time"] = de.read_timestamp( - _SCHEMA_VOCABULARY_ENTITY_SUMMARY.members["lastModifiedTime"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VOCABULARY_ENTITY_SUMMARY, consumer=_consumer) - return kwargs - - -@dataclass -class DataAutomationLibraryEntitySummaryVocabulary: - """Summary of a Vocabulary entity""" - - value: VocabularyEntitySummary - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DATA_AUTOMATION_LIBRARY_ENTITY_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DATA_AUTOMATION_LIBRARY_ENTITY_SUMMARY.members["vocabulary"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=VocabularyEntitySummary.deserialize(deserializer)) - - -@dataclass -class DataAutomationLibraryEntitySummaryUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - This value may not be deliberately sent. +class ServiceError(ModeledError): """ + Base error for all errors in the service. - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -DataAutomationLibraryEntitySummary = Union[ - DataAutomationLibraryEntitySummaryVocabulary - | DataAutomationLibraryEntitySummaryUnknown -] -"""Summarized information about an entity""" - - -class _DataAutomationLibraryEntitySummaryDeserializer: - _result: DataAutomationLibraryEntitySummary | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> DataAutomationLibraryEntitySummary: - self._result = None - deserializer.read_struct( - _SCHEMA_DATA_AUTOMATION_LIBRARY_ENTITY_SUMMARY, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - DataAutomationLibraryEntitySummaryVocabulary.deserialize(de) - ) - - case _: - self._set_result( - DataAutomationLibraryEntitySummaryUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: DataAutomationLibraryEntitySummary) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_data_automation_library_entity_summaries( - serializer: ShapeSerializer, - schema: Schema, - value: list[DataAutomationLibraryEntitySummary], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_data_automation_library_entity_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[DataAutomationLibraryEntitySummary]: - result: list[DataAutomationLibraryEntitySummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append( - _DataAutomationLibraryEntitySummaryDeserializer().deserialize(d) - ) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListDataAutomationLibraryEntitiesOutput: - """List DataAutomationLibraryEntities Response""" - - entities: list[DataAutomationLibraryEntitySummary] | None = None - """List of entities""" - - next_token: str | None = None - """Pagination token for retrieving the next set of results""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. + Some exceptions do not extend from this class, including + synthetic, implicit, and shared exception types. """ - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_LIST_DATA_AUTOMATION_LIBRARY_ENTITIES_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.entities is not None: - _serialize_data_automation_library_entity_summaries( - serializer, - _SCHEMA_LIST_DATA_AUTOMATION_LIBRARY_ENTITIES_OUTPUT.members[ - "entities" - ], - self.entities, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_DATA_AUTOMATION_LIBRARY_ENTITIES_OUTPUT.members[ - "nextToken" - ], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["entities"] = ( - _deserialize_data_automation_library_entity_summaries( - de, - _SCHEMA_LIST_DATA_AUTOMATION_LIBRARY_ENTITIES_OUTPUT.members[ - "entities" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_DATA_AUTOMATION_LIBRARY_ENTITIES_OUTPUT.members[ - "nextToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_DATA_AUTOMATION_LIBRARY_ENTITIES_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_DATA_AUTOMATION_LIBRARY_ENTITIES = APIOperation( - input=ListDataAutomationLibraryEntitiesInput, - output=ListDataAutomationLibraryEntitiesOutput, - schema=_SCHEMA_LIST_DATA_AUTOMATION_LIBRARY_ENTITIES, - input_schema=_SCHEMA_LIST_DATA_AUTOMATION_LIBRARY_ENTITIES_INPUT, - output_schema=_SCHEMA_LIST_DATA_AUTOMATION_LIBRARY_ENTITIES_OUTPUT, - error_registry=TypeRegistry( +_registry = ModelRegistry( + _schemas, + renames={}, + index={ + "AccessDeniedException": "ACCESS_DENIED_EXCEPTION", + "AudioExtractionCategory": "AUDIO_EXTRACTION_CATEGORY", + "AudioExtractionCategoryType": "AUDIO_EXTRACTION_CATEGORY_TYPE", + "AudioExtractionCategoryTypeConfiguration": "AUDIO_EXTRACTION_CATEGORY_TYPE_CONFIGURATION", + "AudioGenerativeOutputLanguage": "AUDIO_GENERATIVE_OUTPUT_LANGUAGE", + "AudioLanguageConfiguration": "AUDIO_LANGUAGE_CONFIGURATION", + "AudioOverrideConfiguration": "AUDIO_OVERRIDE_CONFIGURATION", + "AudioStandardExtraction": "AUDIO_STANDARD_EXTRACTION", + "AudioStandardGenerativeField": "AUDIO_STANDARD_GENERATIVE_FIELD", + "AudioStandardGenerativeFieldType": "AUDIO_STANDARD_GENERATIVE_FIELD_TYPE", + "AudioStandardOutputConfiguration": "AUDIO_STANDARD_OUTPUT_CONFIGURATION", + "Blueprint": "BLUEPRINT", + "BlueprintFilter": "BLUEPRINT_FILTER", + "BlueprintItem": "BLUEPRINT_ITEM", + "BlueprintOptimizationJobStatus": "BLUEPRINT_OPTIMIZATION_JOB_STATUS", + "BlueprintOptimizationObject": "BLUEPRINT_OPTIMIZATION_OBJECT", + "BlueprintOptimizationOutputConfiguration": "BLUEPRINT_OPTIMIZATION_OUTPUT_CONFIGURATION", + "BlueprintOptimizationSample": "BLUEPRINT_OPTIMIZATION_SAMPLE", + "BlueprintStage": "BLUEPRINT_STAGE", + "BlueprintStageFilter": "BLUEPRINT_STAGE_FILTER", + "BlueprintSummary": "BLUEPRINT_SUMMARY", + "ChannelLabelingConfiguration": "CHANNEL_LABELING_CONFIGURATION", + "ConflictException": "CONFLICT_EXCEPTION", + "CopyBlueprintStageInput": "COPY_BLUEPRINT_STAGE_INPUT", + "CopyBlueprintStageOutput": "COPY_BLUEPRINT_STAGE_OUTPUT", + "CreateBlueprintInput": "CREATE_BLUEPRINT_INPUT", + "CreateBlueprintOutput": "CREATE_BLUEPRINT_OUTPUT", + "CreateBlueprintVersionInput": "CREATE_BLUEPRINT_VERSION_INPUT", + "CreateBlueprintVersionOutput": "CREATE_BLUEPRINT_VERSION_OUTPUT", + "CreateDataAutomationLibraryInput": "CREATE_DATA_AUTOMATION_LIBRARY_INPUT", + "CreateDataAutomationLibraryOutput": "CREATE_DATA_AUTOMATION_LIBRARY_OUTPUT", + "CreateDataAutomationProjectInput": "CREATE_DATA_AUTOMATION_PROJECT_INPUT", + "CreateDataAutomationProjectOutput": "CREATE_DATA_AUTOMATION_PROJECT_OUTPUT", + "CustomOutputConfiguration": "CUSTOM_OUTPUT_CONFIGURATION", + "DataAutomationLibrary": "DATA_AUTOMATION_LIBRARY", + "DataAutomationLibraryConfiguration": "DATA_AUTOMATION_LIBRARY_CONFIGURATION", + "DataAutomationLibraryEntitySummary": "DATA_AUTOMATION_LIBRARY_ENTITY_SUMMARY", + "DataAutomationLibraryEntitySummaryVocabulary": "DATA_AUTOMATION_LIBRARY_ENTITY_SUMMARY", + "DataAutomationLibraryEntitySummaryUnknown": "DATA_AUTOMATION_LIBRARY_ENTITY_SUMMARY", + "DataAutomationLibraryFilter": "DATA_AUTOMATION_LIBRARY_FILTER", + "DataAutomationLibraryIngestionJob": "DATA_AUTOMATION_LIBRARY_INGESTION_JOB", + "DataAutomationLibraryIngestionJobSummary": "DATA_AUTOMATION_LIBRARY_INGESTION_JOB_SUMMARY", + "DataAutomationLibraryItem": "DATA_AUTOMATION_LIBRARY_ITEM", + "DataAutomationLibraryStatus": "DATA_AUTOMATION_LIBRARY_STATUS", + "DataAutomationLibrarySummary": "DATA_AUTOMATION_LIBRARY_SUMMARY", + "DataAutomationProject": "DATA_AUTOMATION_PROJECT", + "DataAutomationProjectFilter": "DATA_AUTOMATION_PROJECT_FILTER", + "DataAutomationProjectStage": "DATA_AUTOMATION_PROJECT_STAGE", + "DataAutomationProjectStageFilter": "DATA_AUTOMATION_PROJECT_STAGE_FILTER", + "DataAutomationProjectStatus": "DATA_AUTOMATION_PROJECT_STATUS", + "DataAutomationProjectSummary": "DATA_AUTOMATION_PROJECT_SUMMARY", + "DataAutomationProjectType": "DATA_AUTOMATION_PROJECT_TYPE", + "DeleteBlueprintInput": "DELETE_BLUEPRINT_INPUT", + "DeleteBlueprintOutput": "DELETE_BLUEPRINT_OUTPUT", + "DeleteDataAutomationLibraryInput": "DELETE_DATA_AUTOMATION_LIBRARY_INPUT", + "DeleteDataAutomationLibraryOutput": "DELETE_DATA_AUTOMATION_LIBRARY_OUTPUT", + "DeleteDataAutomationProjectInput": "DELETE_DATA_AUTOMATION_PROJECT_INPUT", + "DeleteDataAutomationProjectOutput": "DELETE_DATA_AUTOMATION_PROJECT_OUTPUT", + "DeleteEntitiesInfo": "DELETE_ENTITIES_INFO", + "DesiredModality": "DESIRED_MODALITY", + "DocumentBoundingBox": "DOCUMENT_BOUNDING_BOX", + "DocumentCustomOutputConfiguration": "DOCUMENT_CUSTOM_OUTPUT_CONFIGURATION", + "DocumentExtractionGranularity": "DOCUMENT_EXTRACTION_GRANULARITY", + "DocumentExtractionGranularityType": "DOCUMENT_EXTRACTION_GRANULARITY_TYPE", + "DocumentOutputAdditionalFileFormat": "DOCUMENT_OUTPUT_ADDITIONAL_FILE_FORMAT", + "DocumentOutputFormat": "DOCUMENT_OUTPUT_FORMAT", + "DocumentOutputTextFormat": "DOCUMENT_OUTPUT_TEXT_FORMAT", + "DocumentOutputTextFormatType": "DOCUMENT_OUTPUT_TEXT_FORMAT_TYPE", + "DocumentOverrideConfiguration": "DOCUMENT_OVERRIDE_CONFIGURATION", + "DocumentStandardExtraction": "DOCUMENT_STANDARD_EXTRACTION", + "DocumentStandardGenerativeField": "DOCUMENT_STANDARD_GENERATIVE_FIELD", + "DocumentStandardOutputConfiguration": "DOCUMENT_STANDARD_OUTPUT_CONFIGURATION", + "EncryptionConfiguration": "ENCRYPTION_CONFIGURATION", + "EntityDetails": "ENTITY_DETAILS", + "EntityDetailsVocabulary": "ENTITY_DETAILS", + "EntityDetailsUnknown": "ENTITY_DETAILS", + "EntityType": "ENTITY_TYPE", + "EntityTypeInfo": "ENTITY_TYPE_INFO", + "EventBridgeConfiguration": "EVENT_BRIDGE_CONFIGURATION", + "GetBlueprintInput": "GET_BLUEPRINT_INPUT", + "GetBlueprintOptimizationStatusInput": "GET_BLUEPRINT_OPTIMIZATION_STATUS_INPUT", + "GetBlueprintOptimizationStatusOutput": "GET_BLUEPRINT_OPTIMIZATION_STATUS_OUTPUT", + "GetBlueprintOutput": "GET_BLUEPRINT_OUTPUT", + "GetDataAutomationLibraryEntityInput": "GET_DATA_AUTOMATION_LIBRARY_ENTITY_INPUT", + "GetDataAutomationLibraryEntityOutput": "GET_DATA_AUTOMATION_LIBRARY_ENTITY_OUTPUT", + "GetDataAutomationLibraryIngestionJobInput": "GET_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_INPUT", + "GetDataAutomationLibraryIngestionJobOutput": "GET_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_OUTPUT", + "GetDataAutomationLibraryInput": "GET_DATA_AUTOMATION_LIBRARY_INPUT", + "GetDataAutomationLibraryOutput": "GET_DATA_AUTOMATION_LIBRARY_OUTPUT", + "GetDataAutomationProjectInput": "GET_DATA_AUTOMATION_PROJECT_INPUT", + "GetDataAutomationProjectOutput": "GET_DATA_AUTOMATION_PROJECT_OUTPUT", + "ImageBoundingBox": "IMAGE_BOUNDING_BOX", + "ImageExtractionCategory": "IMAGE_EXTRACTION_CATEGORY", + "ImageExtractionCategoryType": "IMAGE_EXTRACTION_CATEGORY_TYPE", + "ImageOverrideConfiguration": "IMAGE_OVERRIDE_CONFIGURATION", + "ImageStandardExtraction": "IMAGE_STANDARD_EXTRACTION", + "ImageStandardGenerativeField": "IMAGE_STANDARD_GENERATIVE_FIELD", + "ImageStandardGenerativeFieldType": "IMAGE_STANDARD_GENERATIVE_FIELD_TYPE", + "ImageStandardOutputConfiguration": "IMAGE_STANDARD_OUTPUT_CONFIGURATION", + "InlinePayload": "INLINE_PAYLOAD", + "InlinePayloadUpsertEntitiesInfo": "INLINE_PAYLOAD", + "InlinePayloadDeleteEntitiesInfo": "INLINE_PAYLOAD", + "InlinePayloadUnknown": "INLINE_PAYLOAD", + "InputConfiguration": "INPUT_CONFIGURATION", + "InternalServerException": "INTERNAL_SERVER_EXCEPTION", + "InvokeBlueprintOptimizationAsyncInput": "INVOKE_BLUEPRINT_OPTIMIZATION_ASYNC_INPUT", + "InvokeBlueprintOptimizationAsyncOutput": "INVOKE_BLUEPRINT_OPTIMIZATION_ASYNC_OUTPUT", + "InvokeDataAutomationLibraryIngestionJobInput": "INVOKE_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_INPUT", + "InvokeDataAutomationLibraryIngestionJobOutput": "INVOKE_DATA_AUTOMATION_LIBRARY_INGESTION_JOB_OUTPUT", + "Language": "LANGUAGE", + "LibraryIngestionJobOperationType": "LIBRARY_INGESTION_JOB_OPERATION_TYPE", + "LibraryIngestionJobStatus": "LIBRARY_INGESTION_JOB_STATUS", + "ListBlueprintsInput": "LIST_BLUEPRINTS_INPUT", + "ListBlueprintsOutput": "LIST_BLUEPRINTS_OUTPUT", + "ListDataAutomationLibrariesInput": "LIST_DATA_AUTOMATION_LIBRARIES_INPUT", + "ListDataAutomationLibrariesOutput": "LIST_DATA_AUTOMATION_LIBRARIES_OUTPUT", + "ListDataAutomationLibraryEntitiesInput": "LIST_DATA_AUTOMATION_LIBRARY_ENTITIES_INPUT", + "ListDataAutomationLibraryEntitiesOutput": "LIST_DATA_AUTOMATION_LIBRARY_ENTITIES_OUTPUT", + "ListDataAutomationLibraryIngestionJobsInput": "LIST_DATA_AUTOMATION_LIBRARY_INGESTION_JOBS_INPUT", + "ListDataAutomationLibraryIngestionJobsOutput": "LIST_DATA_AUTOMATION_LIBRARY_INGESTION_JOBS_OUTPUT", + "ListDataAutomationProjectsInput": "LIST_DATA_AUTOMATION_PROJECTS_INPUT", + "ListDataAutomationProjectsOutput": "LIST_DATA_AUTOMATION_PROJECTS_OUTPUT", + "ListTagsForResourceInput": "LIST_TAGS_FOR_RESOURCE_INPUT", + "ListTagsForResourceOutput": "LIST_TAGS_FOR_RESOURCE_OUTPUT", + "ModalityProcessingConfiguration": "MODALITY_PROCESSING_CONFIGURATION", + "ModalityRoutingConfiguration": "MODALITY_ROUTING_CONFIGURATION", + "NotificationConfiguration": "NOTIFICATION_CONFIGURATION", + "OutputConfiguration": "OUTPUT_CONFIGURATION", + "OverrideConfiguration": "OVERRIDE_CONFIGURATION", + "Phrase": "PHRASE", + "PIIEntitiesConfiguration": "PII_ENTITIES_CONFIGURATION", + "PIIEntityType": "PII_ENTITY_TYPE", + "PIIRedactionMaskMode": "PII_REDACTION_MASK_MODE", + "ResourceNotFoundException": "RESOURCE_NOT_FOUND_EXCEPTION", + "ResourceOwner": "RESOURCE_OWNER", + "S3Object": "S3_OBJECT", + "SensitiveDataConfiguration": "SENSITIVE_DATA_CONFIGURATION", + "SensitiveDataDetectionMode": "SENSITIVE_DATA_DETECTION_MODE", + "SensitiveDataDetectionScopeType": "SENSITIVE_DATA_DETECTION_SCOPE_TYPE", + "ServiceQuotaExceededException": "SERVICE_QUOTA_EXCEEDED_EXCEPTION", + "SpeakerLabelingConfiguration": "SPEAKER_LABELING_CONFIGURATION", + "SplitterConfiguration": "SPLITTER_CONFIGURATION", + "StandardOutputConfiguration": "STANDARD_OUTPUT_CONFIGURATION", + "State": "STATE", + "Tag": "TAG", + "TagResourceInput": "TAG_RESOURCE_INPUT", + "TagResourceOutput": "TAG_RESOURCE_OUTPUT", + "ThrottlingException": "THROTTLING_EXCEPTION", + "TranscriptConfiguration": "TRANSCRIPT_CONFIGURATION", + "Type": "TYPE", + "UntagResourceInput": "UNTAG_RESOURCE_INPUT", + "UntagResourceOutput": "UNTAG_RESOURCE_OUTPUT", + "UpdateBlueprintInput": "UPDATE_BLUEPRINT_INPUT", + "UpdateBlueprintOutput": "UPDATE_BLUEPRINT_OUTPUT", + "UpdateDataAutomationLibraryInput": "UPDATE_DATA_AUTOMATION_LIBRARY_INPUT", + "UpdateDataAutomationLibraryOutput": "UPDATE_DATA_AUTOMATION_LIBRARY_OUTPUT", + "UpdateDataAutomationProjectInput": "UPDATE_DATA_AUTOMATION_PROJECT_INPUT", + "UpdateDataAutomationProjectOutput": "UPDATE_DATA_AUTOMATION_PROJECT_OUTPUT", + "UpsertEntityInfo": "UPSERT_ENTITY_INFO", + "UpsertEntityInfoVocabulary": "UPSERT_ENTITY_INFO", + "UpsertEntityInfoUnknown": "UPSERT_ENTITY_INFO", + "ValidationException": "VALIDATION_EXCEPTION", + "ValidationExceptionField": "VALIDATION_EXCEPTION_FIELD", + "VideoBoundingBox": "VIDEO_BOUNDING_BOX", + "VideoExtractionCategory": "VIDEO_EXTRACTION_CATEGORY", + "VideoExtractionCategoryType": "VIDEO_EXTRACTION_CATEGORY_TYPE", + "VideoOverrideConfiguration": "VIDEO_OVERRIDE_CONFIGURATION", + "VideoStandardExtraction": "VIDEO_STANDARD_EXTRACTION", + "VideoStandardGenerativeField": "VIDEO_STANDARD_GENERATIVE_FIELD", + "VideoStandardGenerativeFieldType": "VIDEO_STANDARD_GENERATIVE_FIELD_TYPE", + "VideoStandardOutputConfiguration": "VIDEO_STANDARD_OUTPUT_CONFIGURATION", + "VocabularyEntity": "VOCABULARY_ENTITY", + "VocabularyEntityInfo": "VOCABULARY_ENTITY_INFO", + "VocabularyEntitySummary": "VOCABULARY_ENTITY_SUMMARY", + }, + shape_names=frozenset( { - ShapeID( - "com.amazonaws.bedrockdataautomation#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockdataautomation#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ValidationException" - ): ValidationException, + "AccessDeniedException", + "AudioExtractionCategory", + "AudioExtractionCategoryType", + "AudioExtractionCategoryTypeConfiguration", + "AudioGenerativeOutputLanguage", + "AudioLanguageConfiguration", + "AudioOverrideConfiguration", + "AudioStandardExtraction", + "AudioStandardGenerativeField", + "AudioStandardGenerativeFieldType", + "AudioStandardOutputConfiguration", + "Blueprint", + "BlueprintFilter", + "BlueprintItem", + "BlueprintOptimizationJobStatus", + "BlueprintOptimizationObject", + "BlueprintOptimizationOutputConfiguration", + "BlueprintOptimizationSample", + "BlueprintStage", + "BlueprintStageFilter", + "BlueprintSummary", + "ChannelLabelingConfiguration", + "ConflictException", + "CopyBlueprintStageInput", + "CopyBlueprintStageOutput", + "CreateBlueprintInput", + "CreateBlueprintOutput", + "CreateBlueprintVersionInput", + "CreateBlueprintVersionOutput", + "CreateDataAutomationLibraryInput", + "CreateDataAutomationLibraryOutput", + "CreateDataAutomationProjectInput", + "CreateDataAutomationProjectOutput", + "CustomOutputConfiguration", + "DataAutomationLibrary", + "DataAutomationLibraryConfiguration", + "DataAutomationLibraryEntitySummary", + "DataAutomationLibraryFilter", + "DataAutomationLibraryIngestionJob", + "DataAutomationLibraryIngestionJobSummary", + "DataAutomationLibraryItem", + "DataAutomationLibraryStatus", + "DataAutomationLibrarySummary", + "DataAutomationProject", + "DataAutomationProjectFilter", + "DataAutomationProjectStage", + "DataAutomationProjectStageFilter", + "DataAutomationProjectStatus", + "DataAutomationProjectSummary", + "DataAutomationProjectType", + "DeleteBlueprintInput", + "DeleteBlueprintOutput", + "DeleteDataAutomationLibraryInput", + "DeleteDataAutomationLibraryOutput", + "DeleteDataAutomationProjectInput", + "DeleteDataAutomationProjectOutput", + "DeleteEntitiesInfo", + "DesiredModality", + "DocumentBoundingBox", + "DocumentCustomOutputConfiguration", + "DocumentExtractionGranularity", + "DocumentExtractionGranularityType", + "DocumentOutputAdditionalFileFormat", + "DocumentOutputFormat", + "DocumentOutputTextFormat", + "DocumentOutputTextFormatType", + "DocumentOverrideConfiguration", + "DocumentStandardExtraction", + "DocumentStandardGenerativeField", + "DocumentStandardOutputConfiguration", + "EncryptionConfiguration", + "EntityDetails", + "EntityType", + "EntityTypeInfo", + "EventBridgeConfiguration", + "GetBlueprintInput", + "GetBlueprintOptimizationStatusInput", + "GetBlueprintOptimizationStatusOutput", + "GetBlueprintOutput", + "GetDataAutomationLibraryEntityInput", + "GetDataAutomationLibraryEntityOutput", + "GetDataAutomationLibraryIngestionJobInput", + "GetDataAutomationLibraryIngestionJobOutput", + "GetDataAutomationLibraryInput", + "GetDataAutomationLibraryOutput", + "GetDataAutomationProjectInput", + "GetDataAutomationProjectOutput", + "ImageBoundingBox", + "ImageExtractionCategory", + "ImageExtractionCategoryType", + "ImageOverrideConfiguration", + "ImageStandardExtraction", + "ImageStandardGenerativeField", + "ImageStandardGenerativeFieldType", + "ImageStandardOutputConfiguration", + "InlinePayload", + "InputConfiguration", + "InternalServerException", + "InvokeBlueprintOptimizationAsyncInput", + "InvokeBlueprintOptimizationAsyncOutput", + "InvokeDataAutomationLibraryIngestionJobInput", + "InvokeDataAutomationLibraryIngestionJobOutput", + "Language", + "LibraryIngestionJobOperationType", + "LibraryIngestionJobStatus", + "ListBlueprintsInput", + "ListBlueprintsOutput", + "ListDataAutomationLibrariesInput", + "ListDataAutomationLibrariesOutput", + "ListDataAutomationLibraryEntitiesInput", + "ListDataAutomationLibraryEntitiesOutput", + "ListDataAutomationLibraryIngestionJobsInput", + "ListDataAutomationLibraryIngestionJobsOutput", + "ListDataAutomationProjectsInput", + "ListDataAutomationProjectsOutput", + "ListTagsForResourceInput", + "ListTagsForResourceOutput", + "ModalityProcessingConfiguration", + "ModalityRoutingConfiguration", + "NotificationConfiguration", + "OutputConfiguration", + "OverrideConfiguration", + "PIIEntitiesConfiguration", + "PIIEntityType", + "PIIRedactionMaskMode", + "Phrase", + "ResourceNotFoundException", + "ResourceOwner", + "S3Object", + "SensitiveDataConfiguration", + "SensitiveDataDetectionMode", + "SensitiveDataDetectionScopeType", + "ServiceQuotaExceededException", + "SpeakerLabelingConfiguration", + "SplitterConfiguration", + "StandardOutputConfiguration", + "State", + "Tag", + "TagResourceInput", + "TagResourceOutput", + "ThrottlingException", + "TranscriptConfiguration", + "Type", + "UntagResourceInput", + "UntagResourceOutput", + "UpdateBlueprintInput", + "UpdateBlueprintOutput", + "UpdateDataAutomationLibraryInput", + "UpdateDataAutomationLibraryOutput", + "UpdateDataAutomationProjectInput", + "UpdateDataAutomationProjectOutput", + "UpsertEntityInfo", + "ValidationException", + "ValidationExceptionField", + "VideoBoundingBox", + "VideoExtractionCategory", + "VideoExtractionCategoryType", + "VideoOverrideConfiguration", + "VideoStandardExtraction", + "VideoStandardGenerativeField", + "VideoStandardGenerativeFieldType", + "VideoStandardOutputConfiguration", + "VocabularyEntity", + "VocabularyEntityInfo", + "VocabularyEntitySummary", } ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], + service_error="ServiceError", ) -@dataclass(kw_only=True) -class ListTagsForResourceInput: - """Dataclass for ListTagsForResourceInput structure.""" - - resource_arn: str | None = None - """ARN of a taggable resource""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT.members["resourceARN"], - self.resource_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) +def __getattr__(name: str): + return _registry.build(name) - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT.members["resourceARN"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ListTagsForResourceOutput: - """Dataclass for ListTagsForResourceOutput structure.""" +GET_BLUEPRINT_OPTIMIZATION_STATUS: APIOperation[ + GetBlueprintOptimizationStatusInput, GetBlueprintOptimizationStatusOutput +] = APIOperation( + static_schema=_SCHEMA_GET_BLUEPRINT_OPTIMIZATION_STATUS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockdataautomation#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockdataautomation#InternalServerException"), + ShapeID("com.amazonaws.bedrockdataautomation#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockdataautomation#ThrottlingException"), + ShapeID("com.amazonaws.bedrockdataautomation#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - tags: list[Tag] | None = None - """List of tags""" +INVOKE_BLUEPRINT_OPTIMIZATION_ASYNC: APIOperation[ + InvokeBlueprintOptimizationAsyncInput, InvokeBlueprintOptimizationAsyncOutput +] = APIOperation( + static_schema=_SCHEMA_INVOKE_BLUEPRINT_OPTIMIZATION_ASYNC, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockdataautomation#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockdataautomation#InternalServerException"), + ShapeID("com.amazonaws.bedrockdataautomation#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockdataautomation#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockdataautomation#ThrottlingException"), + ShapeID("com.amazonaws.bedrockdataautomation#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False +CREATE_BLUEPRINT: APIOperation[CreateBlueprintInput, CreateBlueprintOutput] = ( + APIOperation( + static_schema=_SCHEMA_CREATE_BLUEPRINT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockdataautomation#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockdataautomation#ConflictException"), + ShapeID("com.amazonaws.bedrockdataautomation#InternalServerException"), + ShapeID( + "com.amazonaws.bedrockdataautomation#ServiceQuotaExceededException" + ), + ShapeID("com.amazonaws.bedrockdataautomation#ThrottlingException"), + ShapeID("com.amazonaws.bedrockdataautomation#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.tags is not None: - _serialize_tag_list( - serializer, - _SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT.members["tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["tags"] = _deserialize_tag_list( - de, _SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT, consumer=_consumer - ) - return kwargs +) +DELETE_BLUEPRINT: APIOperation[DeleteBlueprintInput, DeleteBlueprintOutput] = ( + APIOperation( + static_schema=_SCHEMA_DELETE_BLUEPRINT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockdataautomation#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockdataautomation#InternalServerException"), + ShapeID("com.amazonaws.bedrockdataautomation#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockdataautomation#ThrottlingException"), + ShapeID("com.amazonaws.bedrockdataautomation#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) -LIST_TAGS_FOR_RESOURCE = APIOperation( - input=ListTagsForResourceInput, - output=ListTagsForResourceOutput, - schema=_SCHEMA_LIST_TAGS_FOR_RESOURCE, - input_schema=_SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT, - output_schema=_SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockdataautomation#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockdataautomation#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, +GET_BLUEPRINT: APIOperation[GetBlueprintInput, GetBlueprintOutput] = APIOperation( + static_schema=_SCHEMA_GET_BLUEPRINT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockdataautomation#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockdataautomation#InternalServerException"), + ShapeID("com.amazonaws.bedrockdataautomation#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockdataautomation#ThrottlingException"), + ShapeID("com.amazonaws.bedrockdataautomation#ValidationException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) +LIST_BLUEPRINTS: APIOperation[ListBlueprintsInput, ListBlueprintsOutput] = APIOperation( + static_schema=_SCHEMA_LIST_BLUEPRINTS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockdataautomation#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockdataautomation#InternalServerException"), + ShapeID("com.amazonaws.bedrockdataautomation#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockdataautomation#ThrottlingException"), + ShapeID("com.amazonaws.bedrockdataautomation#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -@dataclass(kw_only=True) -class TagResourceInput: - """Dataclass for TagResourceInput structure.""" - - resource_arn: str | None = None - """ARN of a taggable resource""" - - tags: list[Tag] | None = None - """List of tags""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TAG_RESOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_TAG_RESOURCE_INPUT.members["resourceARN"], self.resource_arn - ) - - if self.tags is not None: - _serialize_tag_list( - serializer, _SCHEMA_TAG_RESOURCE_INPUT.members["tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_TAG_RESOURCE_INPUT.members["resourceARN"] - ) - - case 1: - kwargs["tags"] = _deserialize_tag_list( - de, _SCHEMA_TAG_RESOURCE_INPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TAG_RESOURCE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class TagResourceOutput: - """Dataclass for TagResourceOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False +UPDATE_BLUEPRINT: APIOperation[UpdateBlueprintInput, UpdateBlueprintOutput] = ( + APIOperation( + static_schema=_SCHEMA_UPDATE_BLUEPRINT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockdataautomation#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockdataautomation#ConflictException"), + ShapeID("com.amazonaws.bedrockdataautomation#InternalServerException"), + ShapeID("com.amazonaws.bedrockdataautomation#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockdataautomation#ThrottlingException"), + ShapeID("com.amazonaws.bedrockdataautomation#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TAG_RESOURCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TAG_RESOURCE_OUTPUT, consumer=_consumer) - return kwargs - +) -TAG_RESOURCE = APIOperation( - input=TagResourceInput, - output=TagResourceOutput, - schema=_SCHEMA_TAG_RESOURCE, - input_schema=_SCHEMA_TAG_RESOURCE_INPUT, - output_schema=_SCHEMA_TAG_RESOURCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockdataautomation#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockdataautomation#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, +COPY_BLUEPRINT_STAGE: APIOperation[ + CopyBlueprintStageInput, CopyBlueprintStageOutput +] = APIOperation( + static_schema=_SCHEMA_COPY_BLUEPRINT_STAGE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockdataautomation#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockdataautomation#InternalServerException"), + ShapeID("com.amazonaws.bedrockdataautomation#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockdataautomation#ThrottlingException"), + ShapeID("com.amazonaws.bedrockdataautomation#ValidationException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) +CREATE_BLUEPRINT_VERSION: APIOperation[ + CreateBlueprintVersionInput, CreateBlueprintVersionOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_BLUEPRINT_VERSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockdataautomation#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockdataautomation#InternalServerException"), + ShapeID("com.amazonaws.bedrockdataautomation#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockdataautomation#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockdataautomation#ThrottlingException"), + ShapeID("com.amazonaws.bedrockdataautomation#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -def _serialize_tag_key_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_tag_key_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class UntagResourceInput: - """Dataclass for UntagResourceInput structure.""" - - resource_arn: str | None = None - """ARN of a taggable resource""" - - tag_keys: list[str] | None = None - """List of tag keys""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNTAG_RESOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_UNTAG_RESOURCE_INPUT.members["resourceARN"], self.resource_arn - ) - - if self.tag_keys is not None: - _serialize_tag_key_list( - serializer, - _SCHEMA_UNTAG_RESOURCE_INPUT.members["tagKeys"], - self.tag_keys, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) +GET_DATA_AUTOMATION_LIBRARY_INGESTION_JOB: APIOperation[ + GetDataAutomationLibraryIngestionJobInput, + GetDataAutomationLibraryIngestionJobOutput, +] = APIOperation( + static_schema=_SCHEMA_GET_DATA_AUTOMATION_LIBRARY_INGESTION_JOB, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockdataautomation#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockdataautomation#InternalServerException"), + ShapeID("com.amazonaws.bedrockdataautomation#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockdataautomation#ThrottlingException"), + ShapeID("com.amazonaws.bedrockdataautomation#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +INVOKE_DATA_AUTOMATION_LIBRARY_INGESTION_JOB: APIOperation[ + InvokeDataAutomationLibraryIngestionJobInput, + InvokeDataAutomationLibraryIngestionJobOutput, +] = APIOperation( + static_schema=_SCHEMA_INVOKE_DATA_AUTOMATION_LIBRARY_INGESTION_JOB, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockdataautomation#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockdataautomation#ConflictException"), + ShapeID("com.amazonaws.bedrockdataautomation#InternalServerException"), + ShapeID("com.amazonaws.bedrockdataautomation#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockdataautomation#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockdataautomation#ThrottlingException"), + ShapeID("com.amazonaws.bedrockdataautomation#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_UNTAG_RESOURCE_INPUT.members["resourceARN"] - ) +LIST_DATA_AUTOMATION_LIBRARY_INGESTION_JOBS: APIOperation[ + ListDataAutomationLibraryIngestionJobsInput, + ListDataAutomationLibraryIngestionJobsOutput, +] = APIOperation( + static_schema=_SCHEMA_LIST_DATA_AUTOMATION_LIBRARY_INGESTION_JOBS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockdataautomation#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockdataautomation#InternalServerException"), + ShapeID("com.amazonaws.bedrockdataautomation#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockdataautomation#ThrottlingException"), + ShapeID("com.amazonaws.bedrockdataautomation#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 1: - kwargs["tag_keys"] = _deserialize_tag_key_list( - de, _SCHEMA_UNTAG_RESOURCE_INPUT.members["tagKeys"] - ) +CREATE_DATA_AUTOMATION_LIBRARY: APIOperation[ + CreateDataAutomationLibraryInput, CreateDataAutomationLibraryOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_DATA_AUTOMATION_LIBRARY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockdataautomation#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockdataautomation#ConflictException"), + ShapeID("com.amazonaws.bedrockdataautomation#InternalServerException"), + ShapeID("com.amazonaws.bedrockdataautomation#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockdataautomation#ThrottlingException"), + ShapeID("com.amazonaws.bedrockdataautomation#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case _: - logger.debug("Unexpected member schema: %s", schema) +DELETE_DATA_AUTOMATION_LIBRARY: APIOperation[ + DeleteDataAutomationLibraryInput, DeleteDataAutomationLibraryOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_DATA_AUTOMATION_LIBRARY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockdataautomation#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockdataautomation#ConflictException"), + ShapeID("com.amazonaws.bedrockdataautomation#InternalServerException"), + ShapeID("com.amazonaws.bedrockdataautomation#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockdataautomation#ThrottlingException"), + ShapeID("com.amazonaws.bedrockdataautomation#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - deserializer.read_struct(_SCHEMA_UNTAG_RESOURCE_INPUT, consumer=_consumer) - return kwargs +GET_DATA_AUTOMATION_LIBRARY: APIOperation[ + GetDataAutomationLibraryInput, GetDataAutomationLibraryOutput +] = APIOperation( + static_schema=_SCHEMA_GET_DATA_AUTOMATION_LIBRARY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockdataautomation#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockdataautomation#InternalServerException"), + ShapeID("com.amazonaws.bedrockdataautomation#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockdataautomation#ThrottlingException"), + ShapeID("com.amazonaws.bedrockdataautomation#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +LIST_DATA_AUTOMATION_LIBRARIES: APIOperation[ + ListDataAutomationLibrariesInput, ListDataAutomationLibrariesOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_DATA_AUTOMATION_LIBRARIES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockdataautomation#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockdataautomation#InternalServerException"), + ShapeID("com.amazonaws.bedrockdataautomation#ThrottlingException"), + ShapeID("com.amazonaws.bedrockdataautomation#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -@dataclass(kw_only=True) -class UntagResourceOutput: - """Dataclass for UntagResourceOutput structure.""" +UPDATE_DATA_AUTOMATION_LIBRARY: APIOperation[ + UpdateDataAutomationLibraryInput, UpdateDataAutomationLibraryOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_DATA_AUTOMATION_LIBRARY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockdataautomation#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockdataautomation#ConflictException"), + ShapeID("com.amazonaws.bedrockdataautomation#InternalServerException"), + ShapeID("com.amazonaws.bedrockdataautomation#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockdataautomation#ThrottlingException"), + ShapeID("com.amazonaws.bedrockdataautomation#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ +CREATE_DATA_AUTOMATION_PROJECT: APIOperation[ + CreateDataAutomationProjectInput, CreateDataAutomationProjectOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_DATA_AUTOMATION_PROJECT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockdataautomation#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockdataautomation#ConflictException"), + ShapeID("com.amazonaws.bedrockdataautomation#InternalServerException"), + ShapeID("com.amazonaws.bedrockdataautomation#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockdataautomation#ThrottlingException"), + ShapeID("com.amazonaws.bedrockdataautomation#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNTAG_RESOURCE_OUTPUT, self) +DELETE_DATA_AUTOMATION_PROJECT: APIOperation[ + DeleteDataAutomationProjectInput, DeleteDataAutomationProjectOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_DATA_AUTOMATION_PROJECT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockdataautomation#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockdataautomation#InternalServerException"), + ShapeID("com.amazonaws.bedrockdataautomation#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockdataautomation#ThrottlingException"), + ShapeID("com.amazonaws.bedrockdataautomation#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize_members(self, serializer: ShapeSerializer): - pass +GET_DATA_AUTOMATION_PROJECT: APIOperation[ + GetDataAutomationProjectInput, GetDataAutomationProjectOutput +] = APIOperation( + static_schema=_SCHEMA_GET_DATA_AUTOMATION_PROJECT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockdataautomation#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockdataautomation#InternalServerException"), + ShapeID("com.amazonaws.bedrockdataautomation#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockdataautomation#ThrottlingException"), + ShapeID("com.amazonaws.bedrockdataautomation#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) +LIST_DATA_AUTOMATION_PROJECTS: APIOperation[ + ListDataAutomationProjectsInput, ListDataAutomationProjectsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_DATA_AUTOMATION_PROJECTS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockdataautomation#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockdataautomation#InternalServerException"), + ShapeID("com.amazonaws.bedrockdataautomation#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockdataautomation#ThrottlingException"), + ShapeID("com.amazonaws.bedrockdataautomation#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +UPDATE_DATA_AUTOMATION_PROJECT: APIOperation[ + UpdateDataAutomationProjectInput, UpdateDataAutomationProjectOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_DATA_AUTOMATION_PROJECT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockdataautomation#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockdataautomation#ConflictException"), + ShapeID("com.amazonaws.bedrockdataautomation#InternalServerException"), + ShapeID("com.amazonaws.bedrockdataautomation#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockdataautomation#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockdataautomation#ThrottlingException"), + ShapeID("com.amazonaws.bedrockdataautomation#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) +GET_DATA_AUTOMATION_LIBRARY_ENTITY: APIOperation[ + GetDataAutomationLibraryEntityInput, GetDataAutomationLibraryEntityOutput +] = APIOperation( + static_schema=_SCHEMA_GET_DATA_AUTOMATION_LIBRARY_ENTITY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockdataautomation#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockdataautomation#InternalServerException"), + ShapeID("com.amazonaws.bedrockdataautomation#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockdataautomation#ThrottlingException"), + ShapeID("com.amazonaws.bedrockdataautomation#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - deserializer.read_struct(_SCHEMA_UNTAG_RESOURCE_OUTPUT, consumer=_consumer) - return kwargs +LIST_DATA_AUTOMATION_LIBRARY_ENTITIES: APIOperation[ + ListDataAutomationLibraryEntitiesInput, ListDataAutomationLibraryEntitiesOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_DATA_AUTOMATION_LIBRARY_ENTITIES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockdataautomation#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockdataautomation#InternalServerException"), + ShapeID("com.amazonaws.bedrockdataautomation#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockdataautomation#ThrottlingException"), + ShapeID("com.amazonaws.bedrockdataautomation#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +LIST_TAGS_FOR_RESOURCE: APIOperation[ + ListTagsForResourceInput, ListTagsForResourceOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_TAGS_FOR_RESOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockdataautomation#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockdataautomation#InternalServerException"), + ShapeID("com.amazonaws.bedrockdataautomation#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockdataautomation#ThrottlingException"), + ShapeID("com.amazonaws.bedrockdataautomation#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -UNTAG_RESOURCE = APIOperation( - input=UntagResourceInput, - output=UntagResourceOutput, - schema=_SCHEMA_UNTAG_RESOURCE, - input_schema=_SCHEMA_UNTAG_RESOURCE_INPUT, - output_schema=_SCHEMA_UNTAG_RESOURCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockdataautomation#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockdataautomation#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockdataautomation#ValidationException" - ): ValidationException, - } - ), +TAG_RESOURCE: APIOperation[TagResourceInput, TagResourceOutput] = APIOperation( + static_schema=_SCHEMA_TAG_RESOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockdataautomation#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockdataautomation#InternalServerException"), + ShapeID("com.amazonaws.bedrockdataautomation#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockdataautomation#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockdataautomation#ThrottlingException"), + ShapeID("com.amazonaws.bedrockdataautomation#ValidationException"), + ], effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, +) + +UNTAG_RESOURCE: APIOperation[UntagResourceInput, UntagResourceOutput] = APIOperation( + static_schema=_SCHEMA_UNTAG_RESOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockdataautomation#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockdataautomation#InternalServerException"), + ShapeID("com.amazonaws.bedrockdataautomation#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockdataautomation#ThrottlingException"), + ShapeID("com.amazonaws.bedrockdataautomation#ValidationException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) diff --git a/clients/aws-sdk-bedrock-data-automation/src/aws_sdk_bedrock_data_automation/models.pyi b/clients/aws-sdk-bedrock-data-automation/src/aws_sdk_bedrock_data_automation/models.pyi new file mode 100644 index 00000000..9f24b9a5 --- /dev/null +++ b/clients/aws-sdk-bedrock-data-automation/src/aws_sdk_bedrock_data_automation/models.pyi @@ -0,0 +1,2082 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. + +from dataclasses import dataclass +from datetime import datetime +from enum import StrEnum +from typing import Self, Union + +from smithy_core.deserializers import ShapeDeserializer +from smithy_core.exceptions import ModeledError +from smithy_core.response import ResponseMetadata +from smithy_core.schemas import APIOperation +from smithy_core.serializers import ShapeSerializer +from smithy_core.types import UnknownEnumMixin + +class _SerdeShape: + def serialize(self, serializer: ShapeSerializer) -> None: ... + def serialize_members(self, serializer: ShapeSerializer) -> None: ... + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: ... + +class ServiceError(ModeledError): + """ + Base error for all errors in the service. + + Some exceptions do not extend from this class, including + synthetic, implicit, and shared exception types. + """ + +@dataclass(kw_only=True) +class AccessDeniedException(ServiceError, _SerdeShape): + """This exception is thrown when a request is denied per access permissions""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class AudioExtractionCategory(_SerdeShape): + """Category of Audio Extraction""" + + state: str + """State""" + types: list[str] | None = ... + """List of Audio Extraction Category Type""" + type_configuration: AudioExtractionCategoryTypeConfiguration | None = ... + """Configuration for different audio extraction category types""" + +class AudioExtractionCategoryType(UnknownEnumMixin, StrEnum): + AUDIO_CONTENT_MODERATION = "AUDIO_CONTENT_MODERATION" + TRANSCRIPT = "TRANSCRIPT" + TOPIC_CONTENT_MODERATION = "TOPIC_CONTENT_MODERATION" + +@dataclass(kw_only=True) +class AudioExtractionCategoryTypeConfiguration(_SerdeShape): + """Configuration for different audio extraction category types""" + + transcript: TranscriptConfiguration | None = ... + """Configuration for transcript related features""" + +class AudioGenerativeOutputLanguage(UnknownEnumMixin, StrEnum): + """Configuration for Audio output language""" + + DEFAULT = "DEFAULT" + EN = "EN" + +@dataclass(kw_only=True) +class AudioLanguageConfiguration(_SerdeShape): + """Optional configuration for audio language settings""" + + input_languages: list[str] | None = ... + """List of supported audio languages""" + generative_output_language: str | None = ... + """Configuration for Audio output language""" + identify_multiple_languages: bool | None = ... + """Enable multiple language identification in audio""" + +@dataclass(kw_only=True) +class AudioOverrideConfiguration(_SerdeShape): + """Override Configuration of Audio""" + + modality_processing: ModalityProcessingConfiguration | None = ... + """Configuration to enable/disable processing of modality""" + language_configuration: AudioLanguageConfiguration | None = ... + """Optional configuration for audio language settings""" + sensitive_data_configuration: SensitiveDataConfiguration | None = ... + """Configuration for sensitive data detection and redaction""" + +@dataclass(kw_only=True) +class AudioStandardExtraction(_SerdeShape): + """Standard Extraction Configuration of Audio""" + + category: AudioExtractionCategory + """Category of Audio Extraction""" + +@dataclass(kw_only=True) +class AudioStandardGenerativeField(_SerdeShape): + """Standard Generative Field Configuration of Audio""" + + state: str + """State""" + types: list[str] | None = ... + """List of Audio Standard Generative Field Type""" + +class AudioStandardGenerativeFieldType(UnknownEnumMixin, StrEnum): + AUDIO_SUMMARY = "AUDIO_SUMMARY" + IAB = "IAB" + TOPIC_SUMMARY = "TOPIC_SUMMARY" + +@dataclass(kw_only=True) +class AudioStandardOutputConfiguration(_SerdeShape): + """Standard Output Configuration of Audio""" + + extraction: AudioStandardExtraction | None = ... + """Standard Extraction Configuration of Audio""" + generative_field: AudioStandardGenerativeField | None = ... + """Standard Generative Field Configuration of Audio""" + +@dataclass(kw_only=True) +class Blueprint(_SerdeShape): + """Contains the information of a Blueprint.""" + + blueprint_arn: str + """ARN of a Blueprint""" + schema: str + """Schema of the blueprint""" + type: str + """Type""" + creation_time: datetime + """Time Stamp""" + last_modified_time: datetime + """Time Stamp""" + blueprint_name: str + """Name of the Blueprint""" + blueprint_version: str | None = ... + """Blueprint Version""" + blueprint_stage: str | None = ... + """Stage of the Blueprint""" + kms_key_id: str | None = ... + """KMS Key Identifier""" + kms_encryption_context: dict[str, str] | None = ... + """KMS Encryption Context""" + optimization_samples: list[BlueprintOptimizationSample] | None = ... + """List of Blueprint Optimization Samples""" + optimization_time: datetime | None = ... + """Time Stamp""" + +@dataclass(kw_only=True) +class BlueprintFilter(_SerdeShape): + """Blueprint Filter""" + + blueprint_arn: str + """ARN of a Blueprint""" + blueprint_version: str | None = ... + """Blueprint Version""" + blueprint_stage: str | None = ... + """Stage of the Blueprint""" + +@dataclass(kw_only=True) +class BlueprintItem(_SerdeShape): + """Blueprint Item""" + + blueprint_arn: str + """ARN of a Blueprint""" + blueprint_version: str | None = ... + """Blueprint Version""" + blueprint_stage: str | None = ... + """Stage of the Blueprint""" + +class BlueprintOptimizationJobStatus(UnknownEnumMixin, StrEnum): + """List of status supported by optimization jobs""" + + CREATED = "Created" + IN_PROGRESS = "InProgress" + SUCCESS = "Success" + SERVICE_ERROR = "ServiceError" + CLIENT_ERROR = "ClientError" + +@dataclass(kw_only=True) +class BlueprintOptimizationObject(_SerdeShape): + """Structure for single blueprint entity.""" + + blueprint_arn: str + """Arn of blueprint.""" + stage: str | None = ... + """Stage of blueprint.""" + +@dataclass(kw_only=True) +class BlueprintOptimizationOutputConfiguration(_SerdeShape): + """Blueprint Optimization Output configuration.""" + + s3_object: S3Object + """S3 object.""" + +@dataclass(kw_only=True) +class BlueprintOptimizationSample(_SerdeShape): + """Blueprint Recommendation Sample""" + + asset_s3_object: S3Object + """S3 Object of the asset""" + ground_truth_s3_object: S3Object + """Ground truth for the Blueprint and Asset combination""" + +class BlueprintStage(UnknownEnumMixin, StrEnum): + """Stage of the Blueprint""" + + DEVELOPMENT = "DEVELOPMENT" + LIVE = "LIVE" + +class BlueprintStageFilter(UnknownEnumMixin, StrEnum): + """Blueprint Stage filter""" + + DEVELOPMENT = "DEVELOPMENT" + LIVE = "LIVE" + ALL = "ALL" + +@dataclass(kw_only=True) +class BlueprintSummary(_SerdeShape): + """Summary of a Blueprint""" + + blueprint_arn: str + """ARN of a Blueprint""" + blueprint_version: str | None = ... + """Blueprint Version""" + blueprint_stage: str | None = ... + """Stage of the Blueprint""" + blueprint_name: str | None = ... + """Name of the Blueprint""" + creation_time: datetime + """Time Stamp""" + last_modified_time: datetime | None = ... + """Time Stamp""" + +@dataclass(kw_only=True) +class ChannelLabelingConfiguration(_SerdeShape): + """Channel labeling configuration""" + + state: str + """State""" + +@dataclass(kw_only=True) +class ConflictException(ServiceError, _SerdeShape): + """ + This exception is thrown when there is a conflict performing an + operation + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CopyBlueprintStageInput(_SerdeShape): + """CopyBlueprintStage Request""" + + blueprint_arn: str | None = ... + """Blueprint to be copied""" + source_stage: str | None = ... + """Source stage to copy from""" + target_stage: str | None = ... + """Target stage to copy to""" + client_token: str | None = ... + """Client token for idempotency""" + +@dataclass(kw_only=True) +class CopyBlueprintStageOutput(_SerdeShape): + """CopyBlueprintStage Response""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateBlueprintInput(_SerdeShape): + """Create Blueprint Request""" + + blueprint_name: str | None = ... + """Name of the Blueprint""" + type: str | None = ... + """Type""" + blueprint_stage: str | None = ... + """Stage of the Blueprint""" + schema: str | None = ... + """Schema of the blueprint""" + client_token: str | None = ... + """Client specified token used for idempotency checks""" + encryption_configuration: EncryptionConfiguration | None = ... + """KMS Encryption Configuration""" + tags: list[Tag] | None = ... + """List of tags""" + +@dataclass(kw_only=True) +class CreateBlueprintOutput(_SerdeShape): + """Create Blueprint Response""" + + blueprint: Blueprint + """Contains the information of a Blueprint.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateBlueprintVersionInput(_SerdeShape): + """Create Blueprint Version Request""" + + blueprint_arn: str | None = ... + """ARN generated at the server side when a Blueprint is created""" + client_token: str | None = ... + """Client specified token used for idempotency checks""" + +@dataclass(kw_only=True) +class CreateBlueprintVersionOutput(_SerdeShape): + """Create Blueprint Version Response""" + + blueprint: Blueprint + """Contains the information of a Blueprint.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateDataAutomationLibraryInput(_SerdeShape): + """Create DataAutomationLibrary Request""" + + library_name: str | None = ... + """Name of the DataAutomationLibrary""" + library_description: str | None = ... + """Description of the DataAutomationLibrary""" + client_token: str | None = ... + """Client specified token used for idempotency checks""" + encryption_configuration: EncryptionConfiguration | None = ... + """KMS Encryption Configuration""" + tags: list[Tag] | None = ... + """List of tags""" + +@dataclass(kw_only=True) +class CreateDataAutomationLibraryOutput(_SerdeShape): + """Create DataAutomationLibrary Response""" + + library_arn: str | None = ... + """ARN generated at the server side when a DataAutomationLibrary is created""" + status: str | None = ... + """Status of DataAutomationLibrary""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateDataAutomationProjectInput(_SerdeShape): + """Create DataAutomationProject Request""" + + project_name: str | None = ... + """Name of the DataAutomationProject""" + project_description: str | None = ... + """Description of the DataAutomationProject""" + project_stage: str | None = ... + """Stage of the Project""" + project_type: str = ... + """Type of the DataAutomationProject""" + standard_output_configuration: StandardOutputConfiguration | None = ... + """Standard output configuration""" + custom_output_configuration: CustomOutputConfiguration | None = ... + """Custom output configuration""" + override_configuration: OverrideConfiguration | None = ... + """Override configuration""" + data_automation_library_configuration: ( + DataAutomationLibraryConfiguration | None + ) = ... + """DataAutomation Library configuration""" + client_token: str | None = ... + """Client specified token used for idempotency checks""" + encryption_configuration: EncryptionConfiguration | None = ... + """KMS Encryption Configuration""" + tags: list[Tag] | None = ... + """List of tags""" + +@dataclass(kw_only=True) +class CreateDataAutomationProjectOutput(_SerdeShape): + """Create DataAutomationProject Response""" + + project_arn: str + """ARN of a DataAutomationProject""" + project_stage: str | None = ... + """Stage of the Project""" + status: str | None = ... + """Status of Data Automation Project""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CustomOutputConfiguration(_SerdeShape): + """Custom output configuration""" + + blueprints: list[BlueprintItem] | None = ... + """List of Blueprint Item""" + document: DocumentCustomOutputConfiguration | None = ... + """Custom Configuration of Document""" + +@dataclass(kw_only=True) +class DataAutomationLibrary(_SerdeShape): + """Contains the information of a DataAutomationLibrary.""" + + library_arn: str + """ARN generated at the server side when a DataAutomationLibrary is created""" + creation_time: datetime + """Time Stamp""" + library_name: str + """Name of the DataAutomationLibrary""" + library_description: str | None = ... + """Description of the DataAutomationLibrary""" + status: str + """Status of DataAutomationLibrary""" + entity_types: list[EntityTypeInfo] | None = ... + """List of info for each entity type in the DataAutomationLibrary""" + kms_key_id: str | None = ... + """KMS Key Identifier""" + kms_encryption_context: dict[str, str] | None = ... + """KMS Encryption Context""" + +@dataclass(kw_only=True) +class DataAutomationLibraryConfiguration(_SerdeShape): + """DataAutomation Library configuration""" + + libraries: list[DataAutomationLibraryItem] | None = ... + """List of DataAutomationLibrary Items""" + +@dataclass +class DataAutomationLibraryEntitySummaryVocabulary(_SerdeShape): + """Summary of a Vocabulary entity""" + + value: VocabularyEntitySummary + +@dataclass +class DataAutomationLibraryEntitySummaryUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +DataAutomationLibraryEntitySummary = Union[ + DataAutomationLibraryEntitySummaryVocabulary + | DataAutomationLibraryEntitySummaryUnknown +] +"""Summarized information about an entity""" + +class _DataAutomationLibraryEntitySummaryDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> DataAutomationLibraryEntitySummary: ... + +@dataclass(kw_only=True) +class DataAutomationLibraryFilter(_SerdeShape): + """Data Automation Library Filter""" + + library_arn: str + """ARN generated at the server side when a DataAutomationLibrary is created""" + +@dataclass(kw_only=True) +class DataAutomationLibraryIngestionJob(_SerdeShape): + """Contains the information of a DataAutomationLibraryIngestionJob""" + + job_arn: str + """ARN of the DataAutomationLibraryIngestionJob""" + creation_time: datetime + """Timestamp when the DataAutomationLibraryIngestionJob was created""" + entity_type: str + """The entity type associated with DataAutomationLibraryIngestionJob""" + operation_type: str + """The operation associated with DataAutomationLibraryIngestionJob""" + job_status: str + """The status of the DataAutomationLibraryIngestionJob""" + output_configuration: OutputConfiguration + """Output configuration of DataAutomationLibraryIngestionJob""" + completion_time: datetime | None = ... + """Timestamp when the DataAutomationLibraryIngestionJob was completed""" + error_message: str | None = ... + """Error message""" + error_type: str | None = ... + """Error type""" + +@dataclass(kw_only=True) +class DataAutomationLibraryIngestionJobSummary(_SerdeShape): + """Summary of a DataAutomationLibraryIngestionJob""" + + job_arn: str + """ARN of the DataAutomationLibraryIngestionJob""" + job_status: str + """Status of DataAutomationLibraryIngestionJob""" + entity_type: str + """Entity types supported in DataAutomationLibraries""" + operation_type: str + """DataAutomationLibraryIngestionJob operation type""" + creation_time: datetime + """Time Stamp""" + completion_time: datetime | None = ... + """Time Stamp""" + +@dataclass(kw_only=True) +class DataAutomationLibraryItem(_SerdeShape): + """DataAutomationLibrary Item""" + + library_arn: str + """ARN generated at the server side when a DataAutomationLibrary is created""" + +class DataAutomationLibraryStatus(UnknownEnumMixin, StrEnum): + """Status of DataAutomationLibrary""" + + ACTIVE = "ACTIVE" + DELETING = "DELETING" + +@dataclass(kw_only=True) +class DataAutomationLibrarySummary(_SerdeShape): + """Summary of a DataAutomationLibrary""" + + library_arn: str + """ARN generated at the server side when a DataAutomationLibrary is created""" + library_name: str | None = ... + """Name of the DataAutomationLibrary""" + creation_time: datetime + """Time Stamp""" + +@dataclass(kw_only=True) +class DataAutomationProject(_SerdeShape): + """Contains the information of a DataAutomationProject.""" + + project_arn: str + """ARN of a DataAutomationProject""" + creation_time: datetime + """Time Stamp""" + last_modified_time: datetime + """Time Stamp""" + project_name: str + """Name of the DataAutomationProject""" + project_stage: str | None = ... + """Stage of the Project""" + project_type: str | None = ... + """Type of the DataAutomationProject""" + project_description: str | None = ... + """Description of the DataAutomationProject""" + standard_output_configuration: StandardOutputConfiguration | None = ... + """Standard output configuration""" + custom_output_configuration: CustomOutputConfiguration | None = ... + """Custom output configuration""" + override_configuration: OverrideConfiguration | None = ... + """Override configuration""" + data_automation_library_configuration: ( + DataAutomationLibraryConfiguration | None + ) = ... + """DataAutomation Library configuration""" + status: str + """Status of Data Automation Project""" + kms_key_id: str | None = ... + """KMS Key Identifier""" + kms_encryption_context: dict[str, str] | None = ... + """KMS Encryption Context""" + +@dataclass(kw_only=True) +class DataAutomationProjectFilter(_SerdeShape): + """Data Automation Project Filter""" + + project_arn: str + """ARN of a DataAutomationProject""" + project_stage: str | None = ... + """Stage of the Project""" + +class DataAutomationProjectStage(UnknownEnumMixin, StrEnum): + """Stage of the Project""" + + DEVELOPMENT = "DEVELOPMENT" + LIVE = "LIVE" + +class DataAutomationProjectStageFilter(UnknownEnumMixin, StrEnum): + """Project Stage filter""" + + DEVELOPMENT = "DEVELOPMENT" + LIVE = "LIVE" + ALL = "ALL" + +class DataAutomationProjectStatus(UnknownEnumMixin, StrEnum): + """Status of Data Automation Project""" + + COMPLETED = "COMPLETED" + IN_PROGRESS = "IN_PROGRESS" + FAILED = "FAILED" + +@dataclass(kw_only=True) +class DataAutomationProjectSummary(_SerdeShape): + """Summary of a DataAutomationProject""" + + project_arn: str + """ARN of a DataAutomationProject""" + project_stage: str | None = ... + """Stage of the Project""" + project_type: str | None = ... + """Type of the DataAutomationProject""" + project_name: str | None = ... + """Name of the DataAutomationProject""" + creation_time: datetime + """Time Stamp""" + +class DataAutomationProjectType(UnknownEnumMixin, StrEnum): + """Type of the DataAutomationProject""" + + ASYNC_ = "ASYNC" + SYNC = "SYNC" + +@dataclass(kw_only=True) +class DeleteBlueprintInput(_SerdeShape): + """Delete Blueprint Request""" + + blueprint_arn: str | None = ... + """ARN generated at the server side when a Blueprint is created""" + blueprint_version: str | None = ... + """Optional field to delete a specific Blueprint version""" + +@dataclass(kw_only=True) +class DeleteBlueprintOutput(_SerdeShape): + """Delete Blueprint Response""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteDataAutomationLibraryInput(_SerdeShape): + """Delete DataAutomationLibrary Request""" + + library_arn: str | None = ... + """ARN generated at the server side when a DataAutomationLibrary is created""" + +@dataclass(kw_only=True) +class DeleteDataAutomationLibraryOutput(_SerdeShape): + """Delete DataAutomationLibrary Response""" + + library_arn: str | None = ... + """ARN generated at the server side when a DataAutomationLibrary is created""" + status: str | None = ... + """Status of DataAutomationLibrary""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteDataAutomationProjectInput(_SerdeShape): + """Delete DataAutomationProject Request""" + + project_arn: str | None = ... + """ARN generated at the server side when a DataAutomationProject is created""" + +@dataclass(kw_only=True) +class DeleteDataAutomationProjectOutput(_SerdeShape): + """Delete DataAutomationProject Response""" + + project_arn: str + """ARN of a DataAutomationProject""" + status: str | None = ... + """Status of Data Automation Project""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteEntitiesInfo(_SerdeShape): + """Input for entities needed to be deleted""" + + entity_ids: list[str] + """List of EntityId""" + +class DesiredModality(UnknownEnumMixin, StrEnum): + """Desired Modality types""" + + IMAGE = "IMAGE" + DOCUMENT = "DOCUMENT" + AUDIO = "AUDIO" + VIDEO = "VIDEO" + +@dataclass(kw_only=True) +class DocumentBoundingBox(_SerdeShape): + """Bounding Box Configuration of Document Extraction""" + + state: str + """State""" + +@dataclass(kw_only=True) +class DocumentCustomOutputConfiguration(_SerdeShape): + """Custom Configuration of Document""" + + fallback_blueprints: list[BlueprintItem] | None = ... + """List of Fallback Blueprint Items""" + +@dataclass(kw_only=True) +class DocumentExtractionGranularity(_SerdeShape): + """Granularity of Document Extraction""" + + types: list[str] | None = ... + """List of Document Extraction Granularity Type""" + +class DocumentExtractionGranularityType(UnknownEnumMixin, StrEnum): + DOCUMENT = "DOCUMENT" + PAGE = "PAGE" + ELEMENT = "ELEMENT" + WORD = "WORD" + LINE = "LINE" + +@dataclass(kw_only=True) +class DocumentOutputAdditionalFileFormat(_SerdeShape): + """Additional File Format of Document Output""" + + state: str + """State""" + +@dataclass(kw_only=True) +class DocumentOutputFormat(_SerdeShape): + """Output Format of Document""" + + text_format: DocumentOutputTextFormat + """Text Format of Document Output""" + additional_file_format: DocumentOutputAdditionalFileFormat + """Additional File Format of Document Output""" + +@dataclass(kw_only=True) +class DocumentOutputTextFormat(_SerdeShape): + """Text Format of Document Output""" + + types: list[str] | None = ... + """List of Document Output Text Format Type""" + +class DocumentOutputTextFormatType(UnknownEnumMixin, StrEnum): + PLAIN_TEXT = "PLAIN_TEXT" + MARKDOWN = "MARKDOWN" + HTML = "HTML" + CSV = "CSV" + +@dataclass(kw_only=True) +class DocumentOverrideConfiguration(_SerdeShape): + """Override Configuration of Document""" + + splitter: SplitterConfiguration | None = ... + """Configuration of Splitter""" + modality_processing: ModalityProcessingConfiguration | None = ... + """Configuration to enable/disable processing of modality""" + sensitive_data_configuration: SensitiveDataConfiguration | None = ... + """Configuration for sensitive data detection and redaction""" + +@dataclass(kw_only=True) +class DocumentStandardExtraction(_SerdeShape): + """Standard Extraction Configuration of Document""" + + granularity: DocumentExtractionGranularity + """Granularity of Document Extraction""" + bounding_box: DocumentBoundingBox + """Bounding Box Configuration of Document Extraction""" + +@dataclass(kw_only=True) +class DocumentStandardGenerativeField(_SerdeShape): + """Standard Generative Field Configuration of Document""" + + state: str + """State""" + +@dataclass(kw_only=True) +class DocumentStandardOutputConfiguration(_SerdeShape): + """Standard Output Configuration of Document""" + + extraction: DocumentStandardExtraction | None = ... + """Standard Extraction Configuration of Document""" + generative_field: DocumentStandardGenerativeField | None = ... + """Standard Generative Field Configuration of Document""" + output_format: DocumentOutputFormat | None = ... + """Output Format of Document""" + +@dataclass(kw_only=True) +class EncryptionConfiguration(_SerdeShape): + """KMS Encryption Configuration""" + + kms_key_id: str + """KMS Key Identifier""" + kms_encryption_context: dict[str, str] | None = ... + """KMS Encryption Context""" + +@dataclass +class EntityDetailsVocabulary(_SerdeShape): + """Vocabulary entity with detailed information""" + + value: VocabularyEntity + +@dataclass +class EntityDetailsUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +EntityDetails = Union[EntityDetailsVocabulary | EntityDetailsUnknown] +"""Detailed information about an entity""" + +class _EntityDetailsDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> EntityDetails: ... + +class EntityType(UnknownEnumMixin, StrEnum): + """Entity types supported in DataAutomationLibraries""" + + VOCABULARY = "VOCABULARY" + +@dataclass(kw_only=True) +class EntityTypeInfo(_SerdeShape): + """Information about an entity type in the DataAutomationLibrary""" + + entity_type: str + """Entity types supported in DataAutomationLibraries""" + entity_metadata: str | None = ... + """JSON string representing relevant metadata for the entity type""" + +@dataclass(kw_only=True) +class EventBridgeConfiguration(_SerdeShape): + """Event bridge configuration.""" + + event_bridge_enabled: bool + """Event bridge flag.""" + +@dataclass(kw_only=True) +class GetBlueprintInput(_SerdeShape): + """Get Blueprint Request""" + + blueprint_arn: str | None = ... + """ARN generated at the server side when a Blueprint is created""" + blueprint_version: str | None = ... + """Optional field to get a specific Blueprint version""" + blueprint_stage: str | None = ... + """Optional field to get a specific Blueprint stage""" + +@dataclass(kw_only=True) +class GetBlueprintOptimizationStatusInput(_SerdeShape): + """Structure for request of GetBlueprintOptimizationStatus API.""" + + invocation_arn: str | None = ... + """Invocation arn.""" + +@dataclass(kw_only=True) +class GetBlueprintOptimizationStatusOutput(_SerdeShape): + """Response of GetBlueprintOptimizationStatus API.""" + + status: str | None = ... + """Job Status.""" + error_type: str | None = ... + """Error Type.""" + error_message: str | None = ... + """Error Message.""" + output_configuration: BlueprintOptimizationOutputConfiguration | None = ... + """Output configuration.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetBlueprintOutput(_SerdeShape): + """Get Blueprint Response""" + + blueprint: Blueprint + """Contains the information of a Blueprint.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetDataAutomationLibraryEntityInput(_SerdeShape): + """Get DataAutomationLibraryEntity Request""" + + library_arn: str | None = ... + """ARN generated at the server side when a DataAutomationLibrary is created""" + entity_type: str | None = ... + """The entity type for which the entity is requested""" + entity_id: str | None = ... + """Unique identifier for the entity""" + +@dataclass(kw_only=True) +class GetDataAutomationLibraryEntityOutput(_SerdeShape): + """Get DataAutomationLibraryEntity Response""" + + entity: EntityDetails | None = ... + """Detailed information about the entity""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetDataAutomationLibraryIngestionJobInput(_SerdeShape): + """Get DataAutomationLibraryIngestionJob Request""" + + library_arn: str | None = ... + """ARN generated at the server side when a DataAutomationLibrary is created""" + job_arn: str | None = ... + """ARN of the DataAutomationLibraryIngestionJob""" + +@dataclass(kw_only=True) +class GetDataAutomationLibraryIngestionJobOutput(_SerdeShape): + """Get DataAutomationLibraryIngestionJob Response""" + + job: DataAutomationLibraryIngestionJob | None = ... + """Contains the information of a library ingestion job""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetDataAutomationLibraryInput(_SerdeShape): + """Get DataAutomationLibrary Request""" + + library_arn: str | None = ... + """ARN generated at the server side when a DataAutomationLibrary is created""" + +@dataclass(kw_only=True) +class GetDataAutomationLibraryOutput(_SerdeShape): + """Get DataAutomationLibrary Response""" + + library: DataAutomationLibrary | None = ... + """Contains the information of a DataAutomationLibrary.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetDataAutomationProjectInput(_SerdeShape): + """Get DataAutomationProject Request""" + + project_arn: str | None = ... + """ARN generated at the server side when a DataAutomationProject is created""" + project_stage: str | None = ... + """Optional field to delete a specific DataAutomationProject stage""" + +@dataclass(kw_only=True) +class GetDataAutomationProjectOutput(_SerdeShape): + """Get DataAutomationProject Response""" + + project: DataAutomationProject + """Contains the information of a DataAutomationProject.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ImageBoundingBox(_SerdeShape): + """Bounding Box Configuration of Image Extraction""" + + state: str + """State""" + +@dataclass(kw_only=True) +class ImageExtractionCategory(_SerdeShape): + """Category of Image Extraction""" + + state: str + """State""" + types: list[str] | None = ... + """List of Image Extraction Category""" + +class ImageExtractionCategoryType(UnknownEnumMixin, StrEnum): + CONTENT_MODERATION = "CONTENT_MODERATION" + TEXT_DETECTION = "TEXT_DETECTION" + LOGOS = "LOGOS" + +@dataclass(kw_only=True) +class ImageOverrideConfiguration(_SerdeShape): + """Override Configuration of Image""" + + modality_processing: ModalityProcessingConfiguration | None = ... + """Configuration to enable/disable processing of modality""" + sensitive_data_configuration: SensitiveDataConfiguration | None = ... + """Configuration for sensitive data detection and redaction""" + +@dataclass(kw_only=True) +class ImageStandardExtraction(_SerdeShape): + """Standard Extraction Configuration of Image""" + + category: ImageExtractionCategory + """Category of Image Extraction""" + bounding_box: ImageBoundingBox + """Bounding Box Configuration of Image Extraction""" + +@dataclass(kw_only=True) +class ImageStandardGenerativeField(_SerdeShape): + """Standard Generative Field Configuration of Image""" + + state: str + """State""" + types: list[str] | None = ... + """List of Image Standard Generative Field Type""" + +class ImageStandardGenerativeFieldType(UnknownEnumMixin, StrEnum): + IMAGE_SUMMARY = "IMAGE_SUMMARY" + IAB = "IAB" + +@dataclass(kw_only=True) +class ImageStandardOutputConfiguration(_SerdeShape): + """Standard Output Configuration of Image""" + + extraction: ImageStandardExtraction | None = ... + """Standard Extraction Configuration of Image""" + generative_field: ImageStandardGenerativeField | None = ... + """Standard Generative Field Configuration of Image""" + +@dataclass +class InlinePayloadUpsertEntitiesInfo(_SerdeShape): + """ + List of UpsertEntityInfo for upserting data in a + DataAutomationLibraryIngestionJob + """ + + value: list[UpsertEntityInfo] + +@dataclass +class InlinePayloadDeleteEntitiesInfo(_SerdeShape): + """Input for entities needed to be deleted""" + + value: DeleteEntitiesInfo + +@dataclass +class InlinePayloadUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +InlinePayload = Union[ + InlinePayloadUpsertEntitiesInfo + | InlinePayloadDeleteEntitiesInfo + | InlinePayloadUnknown +] +"""Input payload structure definition""" + +class _InlinePayloadDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> InlinePayload: ... + +@dataclass(kw_only=True) +class InputConfiguration(_SerdeShape): + """Input configuration for DataAutomationLibraryIngestionJob""" + + s3_object: S3Object | None = ... + """S3 object""" + inline_payload: InlinePayload | None = ... + """Input Payload""" + +@dataclass(kw_only=True) +class InternalServerException(ServiceError, _SerdeShape): + """ + This exception is thrown if there was an unexpected error during + processing of request + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvokeBlueprintOptimizationAsyncInput(_SerdeShape): + """Invoke Blueprint Optimization Async Request""" + + blueprint: BlueprintOptimizationObject | None = ... + """Blueprint to be optimized""" + samples: list[BlueprintOptimizationSample] | None = ... + """List of Blueprint Optimization Samples""" + output_configuration: BlueprintOptimizationOutputConfiguration | None = ... + """Output configuration where the results should be placed""" + data_automation_profile_arn: str | None = ... + """Data automation profile ARN""" + encryption_configuration: EncryptionConfiguration | None = ... + """Encryption configuration.""" + tags: list[Tag] | None = ... + """List of tags.""" + +@dataclass(kw_only=True) +class InvokeBlueprintOptimizationAsyncOutput(_SerdeShape): + """Invoke Blueprint Optimization Async Response""" + + invocation_arn: str + """ARN of the blueprint optimization job""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvokeDataAutomationLibraryIngestionJobInput(_SerdeShape): + """Invoke DataAutomationLibraryIngestionJob Request""" + + library_arn: str | None = ... + """ARN generated at the server side when a DataAutomationLibrary is created""" + client_token: str | None = ... + """Idempotency token""" + input_configuration: InputConfiguration | None = ... + """Input configuration of DataAutomationLibraryIngestionJob request""" + entity_type: str | None = ... + """The entity type for which DataAutomationLibraryIngestionJob is being run""" + operation_type: str | None = ... + """The operation to be performed by DataAutomationLibraryIngestionJob""" + output_configuration: OutputConfiguration | None = ... + """Output configuration of DataAutomationLibraryIngestionJob""" + notification_configuration: NotificationConfiguration | None = ... + """Notification configuration.""" + tags: list[Tag] | None = ... + """List of tags""" + +@dataclass(kw_only=True) +class InvokeDataAutomationLibraryIngestionJobOutput(_SerdeShape): + """Invoke DataAutomationLibraryIngestionJob Response""" + + job_arn: str | None = ... + """ARN of the DataAutomationLibraryIngestionJob""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class Language(UnknownEnumMixin, StrEnum): + """Supported input languages""" + + EN = "EN" + DE = "DE" + ES = "ES" + FR = "FR" + IT = "IT" + PT = "PT" + JA = "JA" + KO = "KO" + CN = "CN" + TW = "TW" + HK = "HK" + +class LibraryIngestionJobOperationType(UnknownEnumMixin, StrEnum): + """DataAutomationLibraryIngestionJob operation type""" + + UPSERT = "UPSERT" + DELETE = "DELETE" + +class LibraryIngestionJobStatus(UnknownEnumMixin, StrEnum): + """Status of DataAutomationLibraryIngestionJob""" + + IN_PROGRESS = "IN_PROGRESS" + COMPLETED = "COMPLETED" + COMPLETED_WITH_ERRORS = "COMPLETED_WITH_ERRORS" + FAILED = "FAILED" + +@dataclass(kw_only=True) +class ListBlueprintsInput(_SerdeShape): + """List Blueprint Request""" + + blueprint_arn: str | None = ... + """ARN of a Blueprint""" + resource_owner: str | None = ... + """Resource Owner""" + blueprint_stage_filter: str | None = ... + """Blueprint Stage filter""" + max_results: int | None = ... + """Max Results""" + next_token: str | None = ... + """Pagination token""" + project_filter: DataAutomationProjectFilter | None = ... + """Data Automation Project Filter""" + +@dataclass(kw_only=True) +class ListBlueprintsOutput(_SerdeShape): + """List Blueprint Response""" + + blueprints: list[BlueprintSummary] + """List of Blueprints""" + next_token: str | None = ... + """Pagination token""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListDataAutomationLibrariesInput(_SerdeShape): + """List DataAutomationLibraries Request""" + + max_results: int | None = ... + """Max Results""" + next_token: str | None = ... + """Pagination token""" + project_filter: DataAutomationProjectFilter | None = ... + """Data Automation Project Filter""" + +@dataclass(kw_only=True) +class ListDataAutomationLibrariesOutput(_SerdeShape): + """List DataAutomationLibraries Response""" + + libraries: list[DataAutomationLibrarySummary] | None = ... + """List of DataAutomationLibrarySummary objects""" + next_token: str | None = ... + """Pagination token""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListDataAutomationLibraryEntitiesInput(_SerdeShape): + """List DataAutomationLibraryEntities Request""" + + library_arn: str | None = ... + """ARN generated at the server side when a DataAutomationLibrary is created""" + entity_type: str | None = ... + """The entity type for which the entity list is requested""" + max_results: int | None = ... + """Max Results""" + next_token: str | None = ... + """Pagination token for retrieving the next set of results""" + +@dataclass(kw_only=True) +class ListDataAutomationLibraryEntitiesOutput(_SerdeShape): + """List DataAutomationLibraryEntities Response""" + + entities: list[DataAutomationLibraryEntitySummary] | None = ... + """List of entities""" + next_token: str | None = ... + """Pagination token for retrieving the next set of results""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListDataAutomationLibraryIngestionJobsInput(_SerdeShape): + """List DataAutomationLibraryIngestionJobs Request""" + + library_arn: str | None = ... + """ARN generated at the server side when a DataAutomationLibrary is created""" + max_results: int | None = ... + """Max Results""" + next_token: str | None = ... + """Pagination token for retrieving the next set of results""" + +@dataclass(kw_only=True) +class ListDataAutomationLibraryIngestionJobsOutput(_SerdeShape): + """List DataAutomationLibraryIngestionJobs Response""" + + jobs: list[DataAutomationLibraryIngestionJobSummary] | None = ... + """List of data automation library ingestion jobs""" + next_token: str | None = ... + """Pagination token for retrieving the next set of results""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListDataAutomationProjectsInput(_SerdeShape): + """List DataAutomationProject Request""" + + max_results: int | None = ... + """Max Results""" + next_token: str | None = ... + """Pagination token""" + project_stage_filter: str | None = ... + """Project Stage filter""" + blueprint_filter: BlueprintFilter | None = ... + """Blueprint Filter""" + resource_owner: str | None = ... + """Resource Owner""" + library_filter: DataAutomationLibraryFilter | None = ... + """Data Automation Library Filter""" + +@dataclass(kw_only=True) +class ListDataAutomationProjectsOutput(_SerdeShape): + """List DataAutomationProject Response""" + + projects: list[DataAutomationProjectSummary] + """List of DataAutomationProjectSummary""" + next_token: str | None = ... + """Pagination token""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListTagsForResourceInput(_SerdeShape): + """Dataclass for ListTagsForResourceInput structure.""" + + resource_arn: str | None = ... + """ARN of a taggable resource""" + +@dataclass(kw_only=True) +class ListTagsForResourceOutput(_SerdeShape): + """Dataclass for ListTagsForResourceOutput structure.""" + + tags: list[Tag] | None = ... + """List of tags""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ModalityProcessingConfiguration(_SerdeShape): + """Configuration to enable/disable processing of modality""" + + state: str | None = ... + """State""" + +@dataclass(kw_only=True) +class ModalityRoutingConfiguration(_SerdeShape): + """Configuration for routing file type to desired modality""" + + jpeg: str | None = ... + """Desired Modality types""" + png: str | None = ... + """Desired Modality types""" + mp4: str | None = ... + """Desired Modality types""" + mov: str | None = ... + """Desired Modality types""" + +@dataclass(kw_only=True) +class NotificationConfiguration(_SerdeShape): + """Notification configuration.""" + + event_bridge_configuration: EventBridgeConfiguration + """Event bridge configuration.""" + +@dataclass(kw_only=True) +class OutputConfiguration(_SerdeShape): + """Output configuration for DataAutomationLibraryIngestionJob""" + + s3_uri: str + """S3 Uri""" + +@dataclass(kw_only=True) +class OverrideConfiguration(_SerdeShape): + """Override configuration""" + + document: DocumentOverrideConfiguration | None = ... + """Override Configuration of Document""" + image: ImageOverrideConfiguration | None = ... + """Override Configuration of Image""" + video: VideoOverrideConfiguration | None = ... + """Override Configuration of Video""" + audio: AudioOverrideConfiguration | None = ... + """Override Configuration of Audio""" + modality_routing: ModalityRoutingConfiguration | None = ... + """Configuration for routing file type to desired modality""" + +@dataclass(kw_only=True) +class Phrase(_SerdeShape): + """Phrase structure for vocabulary""" + + text: str + """Text content of the phrase""" + display_as_text: str | None = ... + """Text to configure how phrase is displayed in Transcript""" + +@dataclass(kw_only=True) +class PIIEntitiesConfiguration(_SerdeShape): + """Configuration for PII entities detection and redaction""" + + pii_entity_types: list[str] | None = ... + """Types of PII entities to detect""" + redaction_mask_mode: str | None = ... + """Mode for redacting detected PII""" + +class PIIEntityType(UnknownEnumMixin, StrEnum): + """ + Types of PII entities that can be detected, we will support every types + that Guardrails can support + """ + + ALL = "ALL" + """All supported PII entity types""" + ADDRESS = "ADDRESS" + """ + A physical address, such as '100 Main Street, Anytown, USA' or 'Suite + #12, Building 123' + """ + AGE = "AGE" + """An individual's age, including the quantity and unit of time""" + NAME = "NAME" + """ + An individual's name. Does not include titles such as Dr., Mr., Mrs., + or Miss + """ + EMAIL = "EMAIL" + """An email address, such as marymajor@email.com""" + PHONE = "PHONE" + """A phone number. Also includes fax and pager numbers""" + USERNAME = "USERNAME" + """ + A user name that identifies an account, such as a login name, screen + name, nick name, or handle + """ + PASSWORD = "PASSWORD" + """An alphanumeric string that is used as a password""" + DRIVER_ID = "DRIVER_ID" + """The number assigned to a driver's license""" + LICENSE_PLATE = "LICENSE_PLATE" + """ + A license plate for a vehicle issued by the state or country where the + vehicle is registered + """ + VEHICLE_IDENTIFICATION_NUMBER = "VEHICLE_IDENTIFICATION_NUMBER" + """A Vehicle Identification Number (VIN) that uniquely identifies a vehicle""" + CREDIT_DEBIT_CARD_CVV = "CREDIT_DEBIT_CARD_CVV" + """ + A three-digit card verification code (CVV) for VISA, MasterCard, and + Discover cards, or four-digit for American Express + """ + CREDIT_DEBIT_CARD_EXPIRY = "CREDIT_DEBIT_CARD_EXPIRY" + """The expiration date for a credit or debit card""" + CREDIT_DEBIT_CARD_NUMBER = "CREDIT_DEBIT_CARD_NUMBER" + """The number for a credit or debit card""" + PIN = "PIN" + """A four-digit personal identification number (PIN)""" + INTERNATIONAL_BANK_ACCOUNT_NUMBER = "INTERNATIONAL_BANK_ACCOUNT_NUMBER" + """ + An International Bank Account Number with specific formats for each + country + """ + SWIFT_CODE = "SWIFT_CODE" + """A SWIFT code - standard format of Bank Identifier Code (BIC)""" + IP_ADDRESS = "IP_ADDRESS" + """An IPv4 address, such as 198.51.100.0""" + MAC_ADDRESS = "MAC_ADDRESS" + """ + A media access control (MAC) address - unique identifier for network + interface controller + """ + URL = "URL" + """A web address, such as www.example.com""" + AWS_ACCESS_KEY = "AWS_ACCESS_KEY" + """A unique identifier associated with AWS secret access key""" + AWS_SECRET_KEY = "AWS_SECRET_KEY" + """ + A unique identifier associated with AWS access key for signing + programmatic requests + """ + US_BANK_ACCOUNT_NUMBER = "US_BANK_ACCOUNT_NUMBER" + """A US bank account number, typically 10 to 12 digits long""" + US_BANK_ROUTING_NUMBER = "US_BANK_ROUTING_NUMBER" + """A US bank account routing number, typically nine digits long""" + US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER = "US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER" + """A US Individual Taxpayer Identification Number (ITIN)""" + US_PASSPORT_NUMBER = "US_PASSPORT_NUMBER" + """A US passport number, ranging from six to nine alphanumeric characters""" + US_SOCIAL_SECURITY_NUMBER = "US_SOCIAL_SECURITY_NUMBER" + """ + A US Social Security Number (SSN) - nine-digit number for US citizens + and residents + """ + CA_HEALTH_NUMBER = "CA_HEALTH_NUMBER" + """ + A Canadian Health Service Number - 10-digit unique identifier for + healthcare benefits + """ + CA_SOCIAL_INSURANCE_NUMBER = "CA_SOCIAL_INSURANCE_NUMBER" + """A Canadian Social Insurance Number (SIN) - nine-digit unique identifier""" + UK_NATIONAL_HEALTH_SERVICE_NUMBER = "UK_NATIONAL_HEALTH_SERVICE_NUMBER" + """A UK National Health Service Number - 10-17 digit number""" + UK_NATIONAL_INSURANCE_NUMBER = "UK_NATIONAL_INSURANCE_NUMBER" + """ + A UK National Insurance Number (NINO) for accessing National Insurance + benefits + """ + UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER = "UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER" + """ + A UK Unique Taxpayer Reference (UTR) - 10-digit number identifying + taxpayer or business + """ + +class PIIRedactionMaskMode(UnknownEnumMixin, StrEnum): + """Mode for redacting detected PII""" + + PII = "PII" + """Replace with generic PII marker [PII]""" + ENTITY_TYPE = "ENTITY_TYPE" + """Replace with specific entity type marker, e.g. [NAME]/[SSN] etc.""" + +@dataclass(kw_only=True) +class ResourceNotFoundException(ServiceError, _SerdeShape): + """ + This exception is thrown when a resource referenced by the operation + does not exist + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class ResourceOwner(UnknownEnumMixin, StrEnum): + """Resource Owner""" + + SERVICE = "SERVICE" + ACCOUNT = "ACCOUNT" + +@dataclass(kw_only=True) +class S3Object(_SerdeShape): + """S3 object""" + + s3_uri: str + """S3 uri.""" + version: str | None = ... + """S3 object version.""" + +@dataclass(kw_only=True) +class SensitiveDataConfiguration(_SerdeShape): + """Configuration for sensitive data detection and redaction""" + + detection_mode: str + """Mode for sensitive data detection""" + detection_scope: list[str] | None = ... + """Scope of detection - what types of sensitive data to detect""" + pii_entities_configuration: PIIEntitiesConfiguration | None = ... + """Configuration for PII entities detection and redaction""" + +class SensitiveDataDetectionMode(UnknownEnumMixin, StrEnum): + """Mode for sensitive data detection""" + + DETECTION = "DETECTION" + """Only detect sensitive data without redaction""" + DETECTION_AND_REDACTION = "DETECTION_AND_REDACTION" + """Detect and redact sensitive data""" + +class SensitiveDataDetectionScopeType(UnknownEnumMixin, StrEnum): + """Types of sensitive data detection scope""" + + STANDARD = "STANDARD" + """Standard PII detection""" + CUSTOM = "CUSTOM" + """Custom PII detection""" + +@dataclass(kw_only=True) +class ServiceQuotaExceededException(ServiceError, _SerdeShape): + """This exception is thrown when a request is made beyond the service quota""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class SpeakerLabelingConfiguration(_SerdeShape): + """Speaker labeling configuration""" + + state: str + """State""" + +@dataclass(kw_only=True) +class SplitterConfiguration(_SerdeShape): + """Configuration of Splitter""" + + state: str | None = ... + """State""" + +@dataclass(kw_only=True) +class StandardOutputConfiguration(_SerdeShape): + """Standard output configuration""" + + document: DocumentStandardOutputConfiguration | None = ... + """Standard Output Configuration of Document""" + image: ImageStandardOutputConfiguration | None = ... + """Standard Output Configuration of Image""" + video: VideoStandardOutputConfiguration | None = ... + """Standard Output Configuration of Video""" + audio: AudioStandardOutputConfiguration | None = ... + """Standard Output Configuration of Audio""" + +class State(UnknownEnumMixin, StrEnum): + """State""" + + ENABLED = "ENABLED" + DISABLED = "DISABLED" + +@dataclass(kw_only=True) +class Tag(_SerdeShape): + """Key value pair of a tag""" + + key: str + """Defines the context of the tag.""" + value: str + """ + Defines the value within the context. e.g. + ``{=html}. + """ + +@dataclass(kw_only=True) +class TagResourceInput(_SerdeShape): + """Dataclass for TagResourceInput structure.""" + + resource_arn: str | None = ... + """ARN of a taggable resource""" + tags: list[Tag] | None = ... + """List of tags""" + +@dataclass(kw_only=True) +class TagResourceOutput(_SerdeShape): + """Dataclass for TagResourceOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ThrottlingException(ServiceError, _SerdeShape): + """This exception is thrown when the number of requests exceeds the limit""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class TranscriptConfiguration(_SerdeShape): + """Configuration for transcript related features""" + + speaker_labeling: SpeakerLabelingConfiguration | None = ... + """Speaker labeling configuration""" + channel_labeling: ChannelLabelingConfiguration | None = ... + """Channel labeling configuration""" + +class Type(UnknownEnumMixin, StrEnum): + """Type""" + + DOCUMENT = "DOCUMENT" + IMAGE = "IMAGE" + AUDIO = "AUDIO" + VIDEO = "VIDEO" + +@dataclass(kw_only=True) +class UntagResourceInput(_SerdeShape): + """Dataclass for UntagResourceInput structure.""" + + resource_arn: str | None = ... + """ARN of a taggable resource""" + tag_keys: list[str] | None = ... + """List of tag keys""" + +@dataclass(kw_only=True) +class UntagResourceOutput(_SerdeShape): + """Dataclass for UntagResourceOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateBlueprintInput(_SerdeShape): + """Update Blueprint Request""" + + blueprint_arn: str | None = ... + """ARN generated at the server side when a Blueprint is created""" + schema: str | None = ... + """Schema of the blueprint""" + blueprint_stage: str | None = ... + """Stage of the Blueprint""" + encryption_configuration: EncryptionConfiguration | None = ... + """KMS Encryption Configuration""" + +@dataclass(kw_only=True) +class UpdateBlueprintOutput(_SerdeShape): + """Update Blueprint Response""" + + blueprint: Blueprint + """Contains the information of a Blueprint.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateDataAutomationLibraryInput(_SerdeShape): + """Update DataAutomationLibrary Request""" + + library_arn: str | None = ... + """ARN generated at the server side when a DataAutomationLibrary is created""" + library_description: str | None = ... + """Description of the DataAutomationLibrary""" + client_token: str | None = ... + """Client specified token used for idempotency checks""" + +@dataclass(kw_only=True) +class UpdateDataAutomationLibraryOutput(_SerdeShape): + """Update DataAutomationLibrary Response""" + + library_arn: str | None = ... + """ARN generated at the server side when a DataAutomationLibrary is created""" + status: str | None = ... + """Status of DataAutomationLibrary""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateDataAutomationProjectInput(_SerdeShape): + """Update DataAutomationProject Request""" + + project_arn: str | None = ... + """ARN generated at the server side when a DataAutomationProject is created""" + project_stage: str | None = ... + """Stage of the Project""" + project_description: str | None = ... + """Description of the DataAutomationProject""" + standard_output_configuration: StandardOutputConfiguration | None = ... + """Standard output configuration""" + custom_output_configuration: CustomOutputConfiguration | None = ... + """Custom output configuration""" + override_configuration: OverrideConfiguration | None = ... + """Override configuration""" + data_automation_library_configuration: ( + DataAutomationLibraryConfiguration | None + ) = ... + """DataAutomation Library configuration""" + encryption_configuration: EncryptionConfiguration | None = ... + """KMS Encryption Configuration""" + +@dataclass(kw_only=True) +class UpdateDataAutomationProjectOutput(_SerdeShape): + """Update DataAutomationProject Response""" + + project_arn: str + """ARN of a DataAutomationProject""" + project_stage: str | None = ... + """Stage of the Project""" + status: str | None = ... + """Status of Data Automation Project""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass +class UpsertEntityInfoVocabulary(_SerdeShape): + """Vocabulary entity info with detailed information""" + + value: VocabularyEntityInfo + +@dataclass +class UpsertEntityInfoUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +UpsertEntityInfo = Union[UpsertEntityInfoVocabulary | UpsertEntityInfoUnknown] +""" +Input configuration for upserting data in a +DataAutomationLibraryIngestionJob +""" + +class _UpsertEntityInfoDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> UpsertEntityInfo: ... + +@dataclass(kw_only=True) +class ValidationException(ServiceError, _SerdeShape): + """This exception is thrown when the request's input validation fails""" + + field_list: list[ValidationExceptionField] | None = ... + """list of ValidationExceptionField""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ValidationExceptionField(_SerdeShape): + """ + Stores information about a field passed inside a request that resulted + in an exception + """ + + name: str + """Non Blank String""" + message: str + """Non Blank String""" + +@dataclass(kw_only=True) +class VideoBoundingBox(_SerdeShape): + """Bounding Box Configuration of Video Extraction""" + + state: str + """State""" + +@dataclass(kw_only=True) +class VideoExtractionCategory(_SerdeShape): + """Category of Video Extraction""" + + state: str + """State""" + types: list[str] | None = ... + """List of Video Extraction Category Type""" + +class VideoExtractionCategoryType(UnknownEnumMixin, StrEnum): + CONTENT_MODERATION = "CONTENT_MODERATION" + TEXT_DETECTION = "TEXT_DETECTION" + TRANSCRIPT = "TRANSCRIPT" + LOGOS = "LOGOS" + +@dataclass(kw_only=True) +class VideoOverrideConfiguration(_SerdeShape): + """Override Configuration of Video""" + + modality_processing: ModalityProcessingConfiguration | None = ... + """Configuration to enable/disable processing of modality""" + sensitive_data_configuration: SensitiveDataConfiguration | None = ... + """Configuration for sensitive data detection and redaction""" + +@dataclass(kw_only=True) +class VideoStandardExtraction(_SerdeShape): + """Standard Extraction Configuration of Video""" + + category: VideoExtractionCategory + """Category of Video Extraction""" + bounding_box: VideoBoundingBox + """Bounding Box Configuration of Video Extraction""" + +@dataclass(kw_only=True) +class VideoStandardGenerativeField(_SerdeShape): + """Standard Generative Field Configuration of Video""" + + state: str + """State""" + types: list[str] | None = ... + """List of Video Standard Generative Field Type""" + +class VideoStandardGenerativeFieldType(UnknownEnumMixin, StrEnum): + VIDEO_SUMMARY = "VIDEO_SUMMARY" + IAB = "IAB" + CHAPTER_SUMMARY = "CHAPTER_SUMMARY" + +@dataclass(kw_only=True) +class VideoStandardOutputConfiguration(_SerdeShape): + """Standard Output Configuration of Video""" + + extraction: VideoStandardExtraction | None = ... + """Standard Extraction Configuration of Video""" + generative_field: VideoStandardGenerativeField | None = ... + """Standard Generative Field Configuration of Video""" + +@dataclass(kw_only=True) +class VocabularyEntity(_SerdeShape): + """Vocabulary entity with detailed information""" + + entity_id: str | None = ... + """Unique identifier for the entity""" + description: str | None = ... + """Description of the entity""" + language: str | None = ... + """Supported input languages""" + phrases: list[Phrase] | None = ... + """List of phrases""" + last_modified_time: datetime | None = ... + """Time Stamp""" + +@dataclass(kw_only=True) +class VocabularyEntityInfo(_SerdeShape): + """Vocabulary entity info with detailed information""" + + entity_id: str | None = ... + """Unique identifier for the entity""" + description: str | None = ... + """Description of the entity""" + language: str + """Supported input languages""" + phrases: list[Phrase] + """List of phrases""" + +@dataclass(kw_only=True) +class VocabularyEntitySummary(_SerdeShape): + """Summary of a Vocabulary entity""" + + entity_id: str | None = ... + """Unique identifier for the entity""" + description: str | None = ... + """Description of the entity""" + language: str | None = ... + """Supported input languages""" + num_of_phrases: int | None = ... + """num of phrases in the entity""" + last_modified_time: datetime | None = ... + """Time Stamp""" + +COPY_BLUEPRINT_STAGE: APIOperation[CopyBlueprintStageInput, CopyBlueprintStageOutput] +CREATE_BLUEPRINT: APIOperation[CreateBlueprintInput, CreateBlueprintOutput] +CREATE_BLUEPRINT_VERSION: APIOperation[ + CreateBlueprintVersionInput, CreateBlueprintVersionOutput +] +CREATE_DATA_AUTOMATION_LIBRARY: APIOperation[ + CreateDataAutomationLibraryInput, CreateDataAutomationLibraryOutput +] +CREATE_DATA_AUTOMATION_PROJECT: APIOperation[ + CreateDataAutomationProjectInput, CreateDataAutomationProjectOutput +] +DELETE_BLUEPRINT: APIOperation[DeleteBlueprintInput, DeleteBlueprintOutput] +DELETE_DATA_AUTOMATION_LIBRARY: APIOperation[ + DeleteDataAutomationLibraryInput, DeleteDataAutomationLibraryOutput +] +DELETE_DATA_AUTOMATION_PROJECT: APIOperation[ + DeleteDataAutomationProjectInput, DeleteDataAutomationProjectOutput +] +GET_BLUEPRINT: APIOperation[GetBlueprintInput, GetBlueprintOutput] +GET_BLUEPRINT_OPTIMIZATION_STATUS: APIOperation[ + GetBlueprintOptimizationStatusInput, GetBlueprintOptimizationStatusOutput +] +GET_DATA_AUTOMATION_LIBRARY: APIOperation[ + GetDataAutomationLibraryInput, GetDataAutomationLibraryOutput +] +GET_DATA_AUTOMATION_LIBRARY_ENTITY: APIOperation[ + GetDataAutomationLibraryEntityInput, GetDataAutomationLibraryEntityOutput +] +GET_DATA_AUTOMATION_LIBRARY_INGESTION_JOB: APIOperation[ + GetDataAutomationLibraryIngestionJobInput, + GetDataAutomationLibraryIngestionJobOutput, +] +GET_DATA_AUTOMATION_PROJECT: APIOperation[ + GetDataAutomationProjectInput, GetDataAutomationProjectOutput +] +INVOKE_BLUEPRINT_OPTIMIZATION_ASYNC: APIOperation[ + InvokeBlueprintOptimizationAsyncInput, InvokeBlueprintOptimizationAsyncOutput +] +INVOKE_DATA_AUTOMATION_LIBRARY_INGESTION_JOB: APIOperation[ + InvokeDataAutomationLibraryIngestionJobInput, + InvokeDataAutomationLibraryIngestionJobOutput, +] +LIST_BLUEPRINTS: APIOperation[ListBlueprintsInput, ListBlueprintsOutput] +LIST_DATA_AUTOMATION_LIBRARIES: APIOperation[ + ListDataAutomationLibrariesInput, ListDataAutomationLibrariesOutput +] +LIST_DATA_AUTOMATION_LIBRARY_ENTITIES: APIOperation[ + ListDataAutomationLibraryEntitiesInput, ListDataAutomationLibraryEntitiesOutput +] +LIST_DATA_AUTOMATION_LIBRARY_INGESTION_JOBS: APIOperation[ + ListDataAutomationLibraryIngestionJobsInput, + ListDataAutomationLibraryIngestionJobsOutput, +] +LIST_DATA_AUTOMATION_PROJECTS: APIOperation[ + ListDataAutomationProjectsInput, ListDataAutomationProjectsOutput +] +LIST_TAGS_FOR_RESOURCE: APIOperation[ + ListTagsForResourceInput, ListTagsForResourceOutput +] +TAG_RESOURCE: APIOperation[TagResourceInput, TagResourceOutput] +UNTAG_RESOURCE: APIOperation[UntagResourceInput, UntagResourceOutput] +UPDATE_BLUEPRINT: APIOperation[UpdateBlueprintInput, UpdateBlueprintOutput] +UPDATE_DATA_AUTOMATION_LIBRARY: APIOperation[ + UpdateDataAutomationLibraryInput, UpdateDataAutomationLibraryOutput +] +UPDATE_DATA_AUTOMATION_PROJECT: APIOperation[ + UpdateDataAutomationProjectInput, UpdateDataAutomationProjectOutput +] diff --git a/clients/aws-sdk-bedrock-runtime/scripts/docs/generate_doc_stubs.py b/clients/aws-sdk-bedrock-runtime/scripts/docs/generate_doc_stubs.py index 52d470bc..795f2e4b 100644 --- a/clients/aws-sdk-bedrock-runtime/scripts/docs/generate_doc_stubs.py +++ b/clients/aws-sdk-bedrock-runtime/scripts/docs/generate_doc_stubs.py @@ -126,7 +126,9 @@ class ClientInfo: class DocStubGenerator: """Generate markdown API Reference stubs for AWS SDK for Python v4 clients.""" - def __init__(self, client_dir: Path, output_dir: Path, service_name: str | None = None) -> None: + def __init__( + self, client_dir: Path, output_dir: Path, service_name: str | None = None + ) -> None: """ Initialize the documentation generator. @@ -190,7 +192,9 @@ def _analyze_client_package(self, package_name: str) -> ClientInfo: required = ("client", "config", "models") missing = [name for name in required if not package.modules.get(name)] if missing: - raise ValueError(f"Missing required modules in {package_name}: {', '.join(missing)}") + raise ValueError( + f"Missing required modules in {package_name}: {', '.join(missing)}" + ) # Parse submodules client_module = package.modules["client"] @@ -199,11 +203,15 @@ def _analyze_client_package(self, package_name: str) -> ClientInfo: client_class = self._find_class_with_suffix(client_module, "Client") if not client_class: - raise ValueError(f"No class ending with 'Client' found in {package_name}.client") + raise ValueError( + f"No class ending with 'Client' found in {package_name}.client" + ) config_class = self._find_class_with_suffix(config_module, "Config") if not config_class: - raise ValueError(f"No class ending with 'Config' found in {package_name}.config") + raise ValueError( + f"No class ending with 'Config' found in {package_name}.config" + ) plugin_alias = config_module.members.get("Plugin") if not plugin_alias: @@ -288,7 +296,9 @@ def _analyze_operation(self, operation: Function) -> OperationInfo: if output_type in stream_type_map: stream_type = stream_type_map[output_type] - stream_args = self._get_subscript_elements(returns, f"'{operation.name}' stream type") + stream_args = self._get_subscript_elements( + returns, f"'{operation.name}' stream type" + ) if stream_type in (StreamType.INPUT, StreamType.DUPLEX): event_input_type = stream_args[0].canonical_name @@ -316,7 +326,9 @@ def _analyze_operation(self, operation: Function) -> OperationInfo: def _get_expr(self, annotation: str | Expr | None, context: str) -> Expr: """Extract and validate an Expr from an annotation.""" if not isinstance(annotation, Expr): - raise TypeError(f"{context}: expected Expr, got {type(annotation).__name__}") + raise TypeError( + f"{context}: expected Expr, got {type(annotation).__name__}" + ) return annotation def _get_subscript_elements(self, expr: Expr, context: str) -> list[Expr]: @@ -330,7 +342,9 @@ def _get_subscript_elements(self, expr: Expr, context: str) -> list[Expr]: return [el for el in slice_expr.elements if isinstance(el, Expr)] return [slice_expr] - def _extract_models(self, models_module: Module, operations: list[OperationInfo]) -> ModelsInfo: + def _extract_models( + self, models_module: Module, operations: list[OperationInfo] + ) -> ModelsInfo: """Extract structures, unions, enums, and errors from models module.""" structures, unions, enums, errors = [], [], [], [] @@ -356,14 +370,16 @@ def _extract_models(self, models_module: Module, operations: list[OperationInfo] duplicates = [] for structure in structures: - if self._is_operation_io_type(structure.name, operations) or self._is_union_member( - structure.name, unions - ): + if self._is_operation_io_type( + structure.name, operations + ) or self._is_union_member(structure.name, unions): duplicates.append(structure) structures = [struct for struct in structures if struct not in duplicates] - return ModelsInfo(structures=structures, unions=unions, enums=enums, errors=errors) + return ModelsInfo( + structures=structures, unions=unions, enums=enums, errors=errors + ) def _is_union(self, member: Object | Alias) -> TypeGuard[Attribute]: """Check if a module member is a union type.""" @@ -399,7 +415,9 @@ def _extract_union_members( for name in member_names: if not (member_object := models_module.members.get(name)): raise ValueError(f"Union member '{name}' not found in models module") - members.append(TypeInfo(name=member_object.name, module_path=member_object.path)) + members.append( + TypeInfo(name=member_object.name, module_path=member_object.path) + ) return members @@ -408,7 +426,8 @@ def _is_enum(self, member: Object | Alias) -> TypeGuard[Class]: if not isinstance(member, Class): return False return any( - isinstance(base, ExprName) and base.name in ENUM_BASE_CLASSES for base in member.bases + isinstance(base, ExprName) and base.name in ENUM_BASE_CLASSES + for base in member.bases ) def _is_error(self, member: Object | Alias) -> TypeGuard[Class]: @@ -416,10 +435,13 @@ def _is_error(self, member: Object | Alias) -> TypeGuard[Class]: if not isinstance(member, Class): return False return any( - isinstance(base, ExprName) and base.name in ERROR_BASE_CLASSES for base in member.bases + isinstance(base, ExprName) and base.name in ERROR_BASE_CLASSES + for base in member.bases ) - def _is_operation_io_type(self, type_name: str, operations: list[OperationInfo]) -> bool: + def _is_operation_io_type( + self, type_name: str, operations: list[OperationInfo] + ) -> bool: """Check if a type is used as operation input/output.""" return any(type_name in (op.input.name, op.output.name) for op in operations) @@ -437,8 +459,12 @@ def _generate_client_docs(self, client_info: ClientInfo) -> bool: self._generate_type_stubs( client_info.models.structures, "structures", "Structure Class" ) - self._generate_type_stubs(client_info.models.errors, "errors", "Error Class") - self._generate_type_stubs(client_info.models.enums, "enums", "Enum Class", members=True) + self._generate_type_stubs( + client_info.models.errors, "errors", "Error Class" + ) + self._generate_type_stubs( + client_info.models.enums, "enums", "Enum Class", members=True + ) self._generate_union_stubs(client_info.models.unions) except OSError as e: logger.error(f"Failed to write documentation files: {e}") @@ -470,7 +496,9 @@ def _generate_index(self, client_info: ClientInfo) -> None: ] for method in sorted(client_info.client_methods, key=lambda x: x.name): - lines.extend([*self._mkdocs_directive(method.module_path, heading_level=4), ""]) + lines.extend( + [*self._mkdocs_directive(method.module_path, heading_level=4), ""] + ) # Operations section if client_info.operations: @@ -578,7 +606,9 @@ def _generate_operation_stubs(self, operations: list[OperationInfo]) -> None: output_path = self.output_dir / "operations" / f"{op.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb("Operations", op.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb("Operations", op.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(operations)} operation file(s)") @@ -600,7 +630,9 @@ def _generate_type_stubs( output_path = self.output_dir / category / f"{item.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb(category.title(), item.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb(category.title(), item.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(items)} {category} file(s)") @@ -624,7 +656,9 @@ def _generate_union_stubs(self, unions: list[UnionInfo]) -> None: output_path = self.output_dir / "unions" / f"{union.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb("Unions", union.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb("Unions", union.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(unions)} union file(s)") diff --git a/clients/aws-sdk-bedrock-runtime/src/aws_sdk_bedrock_runtime/_private/schemas.py b/clients/aws-sdk-bedrock-runtime/src/aws_sdk_bedrock_runtime/_private/schemas.py index e7478788..fa456531 100644 --- a/clients/aws-sdk-bedrock-runtime/src/aws_sdk_bedrock_runtime/_private/schemas.py +++ b/clients/aws-sdk-bedrock-runtime/src/aws_sdk_bedrock_runtime/_private/schemas.py @@ -2,4166 +2,4275 @@ from types import MappingProxyType -from smithy_core.prelude import ( - BLOB, - BOOLEAN, - DOCUMENT, - DOUBLE, - FLOAT, - INTEGER, - LONG, - STRING, - UNIT, -) -from smithy_core.schemas import Schema -from smithy_core.shapes import ShapeID, ShapeType -from smithy_core.traits import Trait - - -NON_BLANK_STRING = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#NonBlankString"), - shape_type=ShapeType.STRING, -) - -ACCESS_DENIED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#AccessDeniedException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=403), - ], - members={"message": {"target": NON_BLANK_STRING}}, -) - -ACCOUNT_ID = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#AccountId"), shape_type=ShapeType.STRING -) - -ADDITIONAL_MODEL_RESPONSE_FIELD_PATHS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#AdditionalModelResponseFieldPaths"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, -) - -INVOCATION_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#InvocationArn"), - shape_type=ShapeType.STRING, +from smithy_core._schema_compact import StaticOperationSchema, StaticSchema + + +n0 = "com.amazonaws.bedrockruntime" +_NBS = "NonBlankString" +_ADE = "AccessDeniedException" +_s = "smithy.api#error" +_c = "client" +_sE = "smithy.api#httpError" +_m = "message" +_AI = "AccountId" +_AMRFP = "AdditionalModelResponseFieldPaths" +_me = "member" +_IA = "InvocationArn" +_GAII = "GetAsyncInvokeInput" +_sSI = "smithy.synthetic#originalShapeId" +_cGAIR = "com.amazonaws.bedrockruntime#GetAsyncInvokeRequest" +_sm = "smithy.api#input" +_iA = "invocationArn" +_smi = "smithy.api#required" +_sL = "smithy.api#httpLabel" +_AIIT = "AsyncInvokeIdempotencyToken" +_T = "Timestamp" +_sF = "smithy.api#timestampFormat" +_dt = "date-time" +_AIM = "AsyncInvokeMessage" +_smit = "smithy.api#sensitive" +_AIA = "AsyncInvokeArn" +_KKI = "KmsKeyId" +_SU = "S3Uri" +_AISODC = "AsyncInvokeS3OutputDataConfig" +_sU = "s3Uri" +_kKI = "kmsKeyId" +_bO = "bucketOwner" +_AIODC = "AsyncInvokeOutputDataConfig" +_sODC = "s3OutputDataConfig" +_AIS = "AsyncInvokeStatus" +_IP = "IN_PROGRESS" +_sV = "smithy.api#enumValue" +_IPn = "InProgress" +_COMPLETED = "COMPLETED" +_C = "Completed" +_FAILED = "FAILED" +_F = "Failed" +_GAIO = "GetAsyncInvokeOutput" +_cGAIRo = "com.amazonaws.bedrockruntime#GetAsyncInvokeResponse" +_smith = "smithy.api#output" +_mA = "modelArn" +_cRT = "clientRequestToken" +_st = "status" +_fM = "failureMessage" +_sT = "submitTime" +_lMT = "lastModifiedTime" +_eT = "endTime" +_oDC = "outputDataConfig" +_ISE = "InternalServerException" +_se = "server" +_TE = "ThrottlingException" +_VE = "ValidationException" +_GAI = "GetAsyncInvoke" +_smithy = "smithy.api#http" +_MR = "MaxResults" +_PT = "PaginationToken" +_SAIB = "SortAsyncInvocationBy" +_ST = "SUBMISSION_TIME" +_STu = "SubmissionTime" +_SO = "SortOrder" +_ASCENDING = "ASCENDING" +_A = "Ascending" +_DESCENDING = "DESCENDING" +_D = "Descending" +_LAII = "ListAsyncInvokesInput" +_cLAIR = "com.amazonaws.bedrockruntime#ListAsyncInvokesRequest" +_sTA = "submitTimeAfter" +_sQ = "smithy.api#httpQuery" +_sTB = "submitTimeBefore" +_sEt = "statusEquals" +_mR = "maxResults" +_nT = "nextToken" +_sB = "sortBy" +_smithya = "smithy.api#default" +_sO = "sortOrder" +_AISs = "AsyncInvokeSummary" +_AISsy = "AsyncInvokeSummaries" +_LAIO = "ListAsyncInvokesOutput" +_cLAIRo = "com.amazonaws.bedrockruntime#ListAsyncInvokesResponse" +_aIS = "asyncInvokeSummaries" +_LAI = "ListAsyncInvokes" +_CE = "ConflictException" +_RNFE = "ResourceNotFoundException" +_SQEE = "ServiceQuotaExceededException" +_SUE = "ServiceUnavailableException" +_AII = "AsyncInvokeIdentifier" +_MIP = "ModelInputPayload" +_TK = "TagKey" +_TV = "TagValue" +_Ta = "Tag" +_k = "key" +_v = "value" +_TL = "TagList" +_SAII = "StartAsyncInvokeInput" +_cSAIR = "com.amazonaws.bedrockruntime#StartAsyncInvokeRequest" +_sTm = "smithy.api#idempotencyToken" +_mI = "modelId" +_mIo = "modelInput" +_t = "tags" +_SAIO = "StartAsyncInvokeOutput" +_cSAIRo = "com.amazonaws.bedrockruntime#StartAsyncInvokeResponse" +_SAI = "StartAsyncInvoke" +_GIF = "GuardrailImageFormat" +_PNG = "PNG" +_p = "png" +_JPEG = "JPEG" +_j = "jpeg" +_GIS = "GuardrailImageSource" +_b = "bytes" +_GIB = "GuardrailImageBlock" +_f = "format" +_so = "source" +_GCQ = "GuardrailContentQualifier" +_GS = "GROUNDING_SOURCE" +_gs = "grounding_source" +_QUERY = "QUERY" +_q = "query" +_GC = "GUARD_CONTENT" +_gc = "guard_content" +_GCQL = "GuardrailContentQualifierList" +_GTB = "GuardrailTextBlock" +_te = "text" +_qu = "qualifiers" +_GCB = "GuardrailContentBlock" +_i = "image" +_GCBL = "GuardrailContentBlockList" +_GI = "GuardrailIdentifier" +_GV = "GuardrailVersion" +_GOS = "GuardrailOutputScope" +_INTERVENTIONS = "INTERVENTIONS" +_FULL = "FULL" +_GCS = "GuardrailContentSource" +_INPUT = "INPUT" +_OUTPUT = "OUTPUT" +_AGI = "ApplyGuardrailInput" +_cAGR = "com.amazonaws.bedrockruntime#ApplyGuardrailRequest" +_gI = "guardrailIdentifier" +_gV = "guardrailVersion" +_co = "content" +_oS = "outputScope" +_GA = "GuardrailAction" +_NONE = "NONE" +_GI_ = "GUARDRAIL_INTERVENED" +_GAu = "GuardrailArn" +_GIu = "GuardrailId" +_GO = "GuardrailOrigin" +_REQUEST = "REQUEST" +_AE = "ACCOUNT_ENFORCED" +_OE = "ORGANIZATION_ENFORCED" +_GOL = "GuardrailOriginList" +_GOu = "GuardrailOwnership" +_SELF = "SELF" +_CA = "CROSS_ACCOUNT" +_AGD = "AppliedGuardrailDetails" +_gIu = "guardrailId" +_gA = "guardrailArn" +_gO = "guardrailOrigin" +_gOu = "guardrailOwnership" +_ARRI = "AutomatedReasoningRuleIdentifier" +_GARPVA = "GuardrailAutomatedReasoningPolicyVersionArn" +_GARR = "GuardrailAutomatedReasoningRule" +_id = "identifier" +_pVA = "policyVersionArn" +_GARRL = "GuardrailAutomatedReasoningRuleList" +_GARSLC = "GuardrailAutomatedReasoningStatementLogicContent" +_GARSNLC = "GuardrailAutomatedReasoningStatementNaturalLanguageContent" +_GARS = "GuardrailAutomatedReasoningStatement" +_l = "logic" +_nL = "naturalLanguage" +_GARSL = "GuardrailAutomatedReasoningStatementList" +_GARLWT = "GuardrailAutomatedReasoningLogicWarningType" +_AF = "ALWAYS_FALSE" +_AT = "ALWAYS_TRUE" +_GARLW = "GuardrailAutomatedReasoningLogicWarning" +_ty = "type" +_pr = "premises" +_cl = "claims" +_GARTC = "GuardrailAutomatedReasoningTranslationConfidence" +_GARITR = "GuardrailAutomatedReasoningInputTextReference" +_GARITRL = "GuardrailAutomatedReasoningInputTextReferenceList" +_GART = "GuardrailAutomatedReasoningTranslation" +_uP = "untranslatedPremises" +_uC = "untranslatedClaims" +_con = "confidence" +_GARIF = "GuardrailAutomatedReasoningImpossibleFinding" +_tr = "translation" +_cR = "contradictingRules" +_lW = "logicWarning" +_GARIFu = "GuardrailAutomatedReasoningInvalidFinding" +_GARNTF = "GuardrailAutomatedReasoningNoTranslationsFinding" +_GARSu = "GuardrailAutomatedReasoningScenario" +_sta = "statements" +_GARSF = "GuardrailAutomatedReasoningSatisfiableFinding" +_cTS = "claimsTrueScenario" +_cFS = "claimsFalseScenario" +_GARTCF = "GuardrailAutomatedReasoningTooComplexFinding" +_GARDSL = "GuardrailAutomatedReasoningDifferenceScenarioList" +_GARTL = "GuardrailAutomatedReasoningTranslationList" +_GARTO = "GuardrailAutomatedReasoningTranslationOption" +_tra = "translations" +_GARTOL = "GuardrailAutomatedReasoningTranslationOptionList" +_GARTAF = "GuardrailAutomatedReasoningTranslationAmbiguousFinding" +_o = "options" +_dS = "differenceScenarios" +_GARVF = "GuardrailAutomatedReasoningValidFinding" +_sR = "supportingRules" +_GARF = "GuardrailAutomatedReasoningFinding" +_va = "valid" +_in = "invalid" +_sa = "satisfiable" +_im = "impossible" +_tA = "translationAmbiguous" +_tC = "tooComplex" +_nTo = "noTranslations" +_GARFL = "GuardrailAutomatedReasoningFindingList" +_GARPA = "GuardrailAutomatedReasoningPolicyAssessment" +_fi = "findings" +_GCPA = "GuardrailContentPolicyAction" +_BLOCKED = "BLOCKED" +_GCFC = "GuardrailContentFilterConfidence" +_LOW = "LOW" +_MEDIUM = "MEDIUM" +_HIGH = "HIGH" +_GCFS = "GuardrailContentFilterStrength" +_GCFT = "GuardrailContentFilterType" +_INSULTS = "INSULTS" +_HATE = "HATE" +_SEXUAL = "SEXUAL" +_VIOLENCE = "VIOLENCE" +_MISCONDUCT = "MISCONDUCT" +_PA = "PROMPT_ATTACK" +_GCF = "GuardrailContentFilter" +_fS = "filterStrength" +_a = "action" +_d = "detected" +_GCFL = "GuardrailContentFilterList" +_GCPAu = "GuardrailContentPolicyAssessment" +_fil = "filters" +_GCGPA = "GuardrailContextualGroundingPolicyAction" +_GCGFT = "GuardrailContextualGroundingFilterType" +_GROUNDING = "GROUNDING" +_RELEVANCE = "RELEVANCE" +_GCGF = "GuardrailContextualGroundingFilter" +_th = "threshold" +_sc = "score" +_GCGFu = "GuardrailContextualGroundingFilters" +_GCGPAu = "GuardrailContextualGroundingPolicyAssessment" +_IG = "ImagesGuarded" +_IT = "ImagesTotal" +_GIC = "GuardrailImageCoverage" +_g = "guarded" +_to = "total" +_TCG = "TextCharactersGuarded" +_TCT = "TextCharactersTotal" +_GTCC = "GuardrailTextCharactersCoverage" +_GCu = "GuardrailCoverage" +_tCe = "textCharacters" +_ima = "images" +_GPL = "GuardrailProcessingLatency" +_GARPP = "GuardrailAutomatedReasoningPoliciesProcessed" +_GARPUP = "GuardrailAutomatedReasoningPolicyUnitsProcessed" +_GCPIUP = "GuardrailContentPolicyImageUnitsProcessed" +_GCPUP = "GuardrailContentPolicyUnitsProcessed" +_GCGPUP = "GuardrailContextualGroundingPolicyUnitsProcessed" +_GSIPFUP = "GuardrailSensitiveInformationPolicyFreeUnitsProcessed" +_GSIPUP = "GuardrailSensitiveInformationPolicyUnitsProcessed" +_GTPUP = "GuardrailTopicPolicyUnitsProcessed" +_GWPUP = "GuardrailWordPolicyUnitsProcessed" +_GU = "GuardrailUsage" +_tPU = "topicPolicyUnits" +_cPU = "contentPolicyUnits" +_wPU = "wordPolicyUnits" +_sIPU = "sensitiveInformationPolicyUnits" +_sIPFU = "sensitiveInformationPolicyFreeUnits" +_cGPU = "contextualGroundingPolicyUnits" +_cPIU = "contentPolicyImageUnits" +_aRPU = "automatedReasoningPolicyUnits" +_aRP = "automatedReasoningPolicies" +_GIM = "GuardrailInvocationMetrics" +_gPL = "guardrailProcessingLatency" +_u = "usage" +_gC = "guardrailCoverage" +_GSIPA = "GuardrailSensitiveInformationPolicyAction" +_ANONYMIZED = "ANONYMIZED" +_GPET = "GuardrailPiiEntityType" +_ADDRESS = "ADDRESS" +_AGE = "AGE" +_AAK = "AWS_ACCESS_KEY" +_ASK = "AWS_SECRET_KEY" +_CHN = "CA_HEALTH_NUMBER" +_CSIN = "CA_SOCIAL_INSURANCE_NUMBER" +_CDCC = "CREDIT_DEBIT_CARD_CVV" +_CDCE = "CREDIT_DEBIT_CARD_EXPIRY" +_CDCN = "CREDIT_DEBIT_CARD_NUMBER" +_DI = "DRIVER_ID" +_EMAIL = "EMAIL" +_IBAN = "INTERNATIONAL_BANK_ACCOUNT_NUMBER" +_IA_ = "IP_ADDRESS" +_LP = "LICENSE_PLATE" +_MA = "MAC_ADDRESS" +_NAME = "NAME" +_PASSWORD = "PASSWORD" +_PHONE = "PHONE" +_PIN = "PIN" +_SC = "SWIFT_CODE" +_UNHSN = "UK_NATIONAL_HEALTH_SERVICE_NUMBER" +_UNIN = "UK_NATIONAL_INSURANCE_NUMBER" +_UUTRN = "UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER" +_URL = "URL" +_USERNAME = "USERNAME" +_UBAN = "US_BANK_ACCOUNT_NUMBER" +_UBRN = "US_BANK_ROUTING_NUMBER" +_UITIN = "US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER" +_UPN = "US_PASSPORT_NUMBER" +_USSN = "US_SOCIAL_SECURITY_NUMBER" +_VIN = "VEHICLE_IDENTIFICATION_NUMBER" +_GPEF = "GuardrailPiiEntityFilter" +_ma = "match" +_GPEFL = "GuardrailPiiEntityFilterList" +_GRF = "GuardrailRegexFilter" +_n = "name" +_r = "regex" +_GRFL = "GuardrailRegexFilterList" +_GSIPAu = "GuardrailSensitiveInformationPolicyAssessment" +_pE = "piiEntities" +_re = "regexes" +_GTPA = "GuardrailTopicPolicyAction" +_GTT = "GuardrailTopicType" +_DENY = "DENY" +_GT = "GuardrailTopic" +_GTL = "GuardrailTopicList" +_GTPAu = "GuardrailTopicPolicyAssessment" +_top = "topics" +_GWPA = "GuardrailWordPolicyAction" +_GCW = "GuardrailCustomWord" +_GCWL = "GuardrailCustomWordList" +_GMWT = "GuardrailManagedWordType" +_PROFANITY = "PROFANITY" +_GMW = "GuardrailManagedWord" +_GMWL = "GuardrailManagedWordList" +_GWPAu = "GuardrailWordPolicyAssessment" +_cW = "customWords" +_mWL = "managedWordLists" +_GAua = "GuardrailAssessment" +_tP = "topicPolicy" +_cP = "contentPolicy" +_wP = "wordPolicy" +_sIP = "sensitiveInformationPolicy" +_cGP = "contextualGroundingPolicy" +_aRPu = "automatedReasoningPolicy" +_iM = "invocationMetrics" +_aGD = "appliedGuardrailDetails" +_GAL = "GuardrailAssessmentList" +_GOT = "GuardrailOutputText" +_GOC = "GuardrailOutputContent" +_GOCL = "GuardrailOutputContentList" +_AGO = "ApplyGuardrailOutput" +_cAGRo = "com.amazonaws.bedrockruntime#ApplyGuardrailResponse" +_aR = "actionReason" +_ou = "outputs" +_as = "assessments" +_AG = "ApplyGuardrail" +_GCCFC = "GuardrailChecksContentFilterCategory" +_GCCFCC = "GuardrailChecksContentFilterCategoryConfig" +_ca = "category" +_GCCFCCL = "GuardrailChecksContentFilterCategoryConfigList" +_GCCFCu = "GuardrailChecksContentFilterConfig" +_cat = "categories" +_GCPAC = "GuardrailChecksPromptAttackCategory" +_JAILBREAK = "JAILBREAK" +_PI = "PROMPT_INJECTION" +_PL = "PROMPT_LEAKAGE" +_GCPACC = "GuardrailChecksPromptAttackCategoryConfig" +_GCPACCL = "GuardrailChecksPromptAttackCategoryConfigList" +_GCPACu = "GuardrailChecksPromptAttackConfig" +_GCSIET = "GuardrailChecksSensitiveInformationEntityType" +_GCSIEC = "GuardrailChecksSensitiveInformationEntityConfig" +_GCSIECL = "GuardrailChecksSensitiveInformationEntityConfigList" +_GCSIC = "GuardrailChecksSensitiveInformationConfig" +_e = "entities" +_GCC = "GuardrailChecksConfig" +_cF = "contentFilter" +_pA = "promptAttack" +_sI = "sensitiveInformation" +_GCTC = "GuardrailChecksTextContent" +_GCCB = "GuardrailChecksContentBlock" +_GCCBL = "GuardrailChecksContentBlockList" +_GCR = "GuardrailChecksRole" +_USER = "USER" +_us = "user" +_ASSISTANT = "ASSISTANT" +_ass = "assistant" +_SYSTEM = "SYSTEM" +_sy = "system" +_GCM = "GuardrailChecksMessage" +_ro = "role" +_GCML = "GuardrailChecksMessageList" +_IGCI = "InvokeGuardrailChecksInput" +_cIGCR = "com.amazonaws.bedrockruntime#InvokeGuardrailChecksRequest" +_mes = "messages" +_ch = "checks" +_GCCFRE = "GuardrailChecksContentFilterResultEntry" +_sS = "severityScore" +_GCCFRL = "GuardrailChecksContentFilterResultList" +_GCCFR = "GuardrailChecksContentFilterResult" +_res = "results" +_GCPARE = "GuardrailChecksPromptAttackResultEntry" +_GCPARL = "GuardrailChecksPromptAttackResultList" +_GCPAR = "GuardrailChecksPromptAttackResult" +_GCSIRE = "GuardrailChecksSensitiveInformationResultEntry" +_cS = "confidenceScore" +_bOe = "beginOffset" +_eO = "endOffset" +_mIe = "messageIndex" +_cI = "contentIndex" +_GCSIRL = "GuardrailChecksSensitiveInformationResultList" +_GCSIR = "GuardrailChecksSensitiveInformationResult" +_tru = "truncated" +_GCRu = "GuardrailChecksResults" +_GCCFU = "GuardrailChecksContentFilterUsage" +_tU = "textUnits" +_GCPAU = "GuardrailChecksPromptAttackUsage" +_GCSIU = "GuardrailChecksSensitiveInformationUsage" +_GCUR = "GuardrailChecksUsageResults" +_IGCO = "InvokeGuardrailChecksOutput" +_cIGCRo = "com.amazonaws.bedrockruntime#InvokeGuardrailChecksResponse" +_IGC = "InvokeGuardrailChecks" +_GTu = "GuardrailTrace" +_ENABLED = "ENABLED" +_en = "enabled" +_DISABLED = "DISABLED" +_di = "disabled" +_EF = "ENABLED_FULL" +_ef = "enabled_full" +_GCua = "GuardrailConfiguration" +_v_ = "" +_trac = "trace" +_NES = "NonEmptyString" +_NESL = "NonEmptyStringList" +_IC = "InferenceConfiguration" +_mT = "maxTokens" +_tem = "temperature" +_tPo = "topP" +_sSt = "stopSequences" +_EB = "ErrorBlock" +_AFu = "AudioFormat" +_MP = "MP3" +_mp = "mp3" +_OPUS = "OPUS" +_op = "opus" +_WAV = "WAV" +_w = "wav" +_AAC = "AAC" +_aa = "aac" +_FLAC = "FLAC" +_fl = "flac" +_MP_ = "MP4" +_mp_ = "mp4" +_OGG = "OGG" +_og = "ogg" +_MKV = "MKV" +_mk = "mkv" +_MKA = "MKA" +_mka = "mka" +_XA = "X_AAC" +_xa = "x-aac" +_MA_ = "M4A" +_ma_ = "m4a" +_MPEG = "MPEG" +_mpe = "mpeg" +_MPGA = "MPGA" +_mpg = "mpga" +_PCM = "PCM" +_pc = "pcm" +_WEBM = "WEBM" +_we = "webm" +_SL = "S3Location" +_ur = "uri" +_AS = "AudioSource" +_sLo = "s3Location" +_AB = "AudioBlock" +_er = "error" +_CTTL = "CacheTTL" +_FM = "FIVE_MINUTES" +_m_ = "5m" +_OH = "ONE_HOUR" +_h = "1h" +_CPT = "CachePointType" +_DEFAULT = "DEFAULT" +_de = "default" +_CPB = "CachePointBlock" +_tt = "ttl" +_DCL = "DocumentCharLocation" +_dI = "documentIndex" +_star = "start" +_end = "end" +_DCLo = "DocumentChunkLocation" +_DPL = "DocumentPageLocation" +_SRL = "SearchResultLocation" +_sRI = "searchResultIndex" +_WL = "WebLocation" +_url = "url" +_do = "domain" +_CL = "CitationLocation" +_web = "web" +_dC = "documentChar" +_dP = "documentPage" +_dCo = "documentChunk" +_sRL = "searchResultLocation" +_CSC = "CitationSourceContent" +_CSCL = "CitationSourceContentList" +_Ci = "Citation" +_ti = "title" +_sC = "sourceContent" +_lo = "location" +_Cit = "Citations" +_CGC = "CitationGeneratedContent" +_CGCL = "CitationGeneratedContentList" +_CCB = "CitationsContentBlock" +_ci = "citations" +_CC = "CitationsConfig" +_DF = "DocumentFormat" +_PDF = "PDF" +_pd = "pdf" +_CSV = "CSV" +_cs = "csv" +_DOC = "DOC" +_doc = "doc" +_DOCX = "DOCX" +_docx = "docx" +_XLS = "XLS" +_x = "xls" +_XLSX = "XLSX" +_xl = "xlsx" +_HTML = "HTML" +_ht = "html" +_TXT = "TXT" +_tx = "txt" +_MD = "MD" +_md = "md" +_DCB = "DocumentContentBlock" +_DCBo = "DocumentContentBlocks" +_DS = "DocumentSource" +_DB = "DocumentBlock" +_cont = "context" +_GCIF = "GuardrailConverseImageFormat" +_GCIS = "GuardrailConverseImageSource" +_GCIB = "GuardrailConverseImageBlock" +_GCCQ = "GuardrailConverseContentQualifier" +_GCCQL = "GuardrailConverseContentQualifierList" +_GCTB = "GuardrailConverseTextBlock" +_GCCBu = "GuardrailConverseContentBlock" +_IF = "ImageFormat" +_GIF_ = "GIF" +_gi = "gif" +_WEBP = "WEBP" +_webp = "webp" +_IS = "ImageSource" +_IB = "ImageBlock" +_RTB = "ReasoningTextBlock" +_si = "signature" +_RCB = "ReasoningContentBlock" +_rT = "reasoningText" +_rC = "redactedContent" +_SRCB = "SearchResultContentBlock" +_SRCBe = "SearchResultContentBlocks" +_SRB = "SearchResultBlock" +_TR = "ToolReference" +_sN = "serverName" +_TAB = "ToolAdditionBlock" +_too = "tool" +_TRB = "ToolRemovalBlock" +_VF = "VideoFormat" +_MOV = "MOV" +_mo = "mov" +_FLV = "FLV" +_flv = "flv" +_MPG = "MPG" +_mpg_ = "mpg" +_WMV = "WMV" +_wm = "wmv" +_TG = "THREE_GP" +_tg = "three_gp" +_VS = "VideoSource" +_VB = "VideoBlock" +_TRCB = "ToolResultContentBlock" +_js = "json" +_docu = "document" +_vi = "video" +_sRe = "searchResult" +_TRCBo = "ToolResultContentBlocks" +_TRS = "ToolResultStatus" +_SUCCESS = "SUCCESS" +_su = "success" +_ERROR = "ERROR" +_TUI = "ToolUseId" +_TRBo = "ToolResultBlock" +_tUI = "toolUseId" +_TN = "ToolName" +_TUT = "ToolUseType" +_STU = "SERVER_TOOL_USE" +_stu = "server_tool_use" +_TUB = "ToolUseBlock" +_inp = "input" +_CB = "ContentBlock" +_au = "audio" +_tUo = "toolUse" +_tR = "toolResult" +_gCu = "guardContent" +_cPa = "cachePoint" +_rCe = "reasoningContent" +_cC = "citationsContent" +_tAo = "toolAddition" +_tRo = "toolRemoval" +_CBo = "ContentBlocks" +_CR = "ConversationRole" +_M = "Message" +_Me = "Messages" +_CMI = "ConversationalModelId" +_JSD = "JsonSchemaDefinition" +_sch = "schema" +_des = "description" +_OFS = "OutputFormatStructure" +_jS = "jsonSchema" +_OFT = "OutputFormatType" +_JS = "JSON_SCHEMA" +_js_ = "json_schema" +_OF = "OutputFormat" +_str = "structure" +_OC = "OutputConfig" +_tF = "textFormat" +_eff = "effort" +_PCL = "PerformanceConfigLatency" +_STANDARD = "STANDARD" +_stan = "standard" +_OPTIMIZED = "OPTIMIZED" +_opt = "optimized" +_PC = "PerformanceConfiguration" +_la = "latency" +_PVV = "PromptVariableValues" +_PVM = "PromptVariableMap" +_RM = "RequestMetadata" +_STT = "ServiceTierType" +_PRIORITY = "PRIORITY" +_pri = "priority" +_FLEX = "FLEX" +_fle = "flex" +_RESERVED = "RESERVED" +_rese = "reserved" +_STe = "ServiceTier" +_SCB = "SystemContentBlock" +_SCBy = "SystemContentBlocks" +_ATC = "AnyToolChoice" +_ATCu = "AutoToolChoice" +_STC = "SpecificToolChoice" +_TC = "ToolChoice" +_aut = "auto" +_an = "any" +_STy = "SystemTool" +_TIS = "ToolInputSchema" +_TS = "ToolSpecification" +_iS = "inputSchema" +_stri = "strict" +_To = "Tool" +_tS = "toolSpec" +_sTy = "systemTool" +_Too = "Tools" +_TCo = "ToolConfiguration" +_tool = "tools" +_tCo = "toolChoice" +_CI = "ConverseInput" +_cCR = "com.amazonaws.bedrockruntime#ConverseRequest" +_iC = "inferenceConfig" +_tCoo = "toolConfig" +_gCua = "guardrailConfig" +_aMRF = "additionalModelRequestFields" +_pV = "promptVariables" +_aMRFP = "additionalModelResponseFieldPaths" +_rM = "requestMetadata" +_pC = "performanceConfig" +_sTe = "serviceTier" +_oC = "outputConfig" +_CM = "ConverseMetrics" +_lM = "latencyMs" +_CO = "ConverseOutput" +_SR = "StopReason" +_ET = "END_TURN" +_et = "end_turn" +_TU = "TOOL_USE" +_tu = "tool_use" +_MT = "MAX_TOKENS" +_mt = "max_tokens" +_SS = "STOP_SEQUENCE" +_ss = "stop_sequence" +_gi_ = "guardrail_intervened" +_CF = "CONTENT_FILTERED" +_cf = "content_filtered" +_MMO = "MALFORMED_MODEL_OUTPUT" +_mmo = "malformed_model_output" +_MTU = "MALFORMED_TOOL_USE" +_mtu = "malformed_tool_use" +_MCWE = "MODEL_CONTEXT_WINDOW_EXCEEDED" +_mcwe = "model_context_window_exceeded" +_GAM = "GuardrailAssessmentMap" +_MO = "ModelOutputs" +_GALM = "GuardrailAssessmentListMap" +_GTA = "GuardrailTraceAssessment" +_mO = "modelOutput" +_iAn = "inputAssessment" +_oA = "outputAssessments" +_IMI = "InvokedModelId" +_PRT = "PromptRouterTrace" +_iMI = "invokedModelId" +_CT = "ConverseTrace" +_gu = "guardrail" +_pR = "promptRouter" +_CD = "CacheDetail" +_iT = "inputTokens" +_CDL = "CacheDetailsList" +_TUo = "TokenUsage" +_oT = "outputTokens" +_tT = "totalTokens" +_cRIT = "cacheReadInputTokens" +_cWIT = "cacheWriteInputTokens" +_cD = "cacheDetails" +_COO = "ConverseOperationOutput" +_cCRo = "com.amazonaws.bedrockruntime#ConverseResponse" +_out = "output" +_sRt = "stopReason" +_met = "metrics" +_aMRFd = "additionalModelResponseFields" +_SCt = "StatusCode" +_MEE = "ModelErrorException" +_oSC = "originalStatusCode" +_rN = "resourceName" +_MNRE = "ModelNotReadyException" +_MTE = "ModelTimeoutException" +_Co = "Converse" +_GSPM = "GuardrailStreamProcessingMode" +_SYNC = "SYNC" +_syn = "sync" +_ASYNC = "ASYNC" +_asy = "async" +_GSC = "GuardrailStreamConfiguration" +_sPM = "streamProcessingMode" +_CSI = "ConverseStreamInput" +_cCSR = "com.amazonaws.bedrockruntime#ConverseStreamRequest" +_NNI = "NonNegativeInteger" +_CSCD = "CitationSourceContentDelta" +_CSCLD = "CitationSourceContentListDelta" +_CDi = "CitationsDelta" +_IBD = "ImageBlockDelta" +_RCBD = "ReasoningContentBlockDelta" +_TRBD = "ToolResultBlockDelta" +_TRBDo = "ToolResultBlocksDelta" +_TUBD = "ToolUseBlockDelta" +_CBD = "ContentBlockDelta" +_cit = "citation" +_CBDE = "ContentBlockDeltaEvent" +_del = "delta" +_cBI = "contentBlockIndex" +_IBS = "ImageBlockStart" +_TRBS = "ToolResultBlockStart" +_TUBS = "ToolUseBlockStart" +_CBS = "ContentBlockStart" +_CBSE = "ContentBlockStartEvent" +_CBSEo = "ContentBlockStopEvent" +_MSE = "MessageStartEvent" +_MSEe = "MessageStopEvent" +_CSM = "ConverseStreamMetrics" +_CST = "ConverseStreamTrace" +_CSME = "ConverseStreamMetadataEvent" +_MSEE = "ModelStreamErrorException" +_oM = "originalMessage" +_CSO = "ConverseStreamOutput" +_smithyap = "smithy.api#streaming" +_mS = "messageStart" +_cBS = "contentBlockStart" +_cBD = "contentBlockDelta" +_cBSo = "contentBlockStop" +_mSe = "messageStop" +_meta = "metadata" +_iSE = "internalServerException" +_mSEE = "modelStreamErrorException" +_vE = "validationException" +_tE = "throttlingException" +_sUE = "serviceUnavailableException" +_CSOO = "ConverseStreamOperationOutput" +_cCSRo = "com.amazonaws.bedrockruntime#ConverseStreamResponse" +_stre = "stream" +_sP = "smithy.api#httpPayload" +_CS = "ConverseStream" +_MTi = "MimeType" +_B = "Body" +_IMIn = "InvokeModelIdentifier" +_RMJ = "RequestMetadataJson" +_Tr = "Trace" +_IMInv = "InvokeModelInput" +_cIMR = "com.amazonaws.bedrockruntime#InvokeModelRequest" +_bo = "body" +_cT = "contentType" +_sH = "smithy.api#httpHeader" +_CT_ = "Content-Type" +_ac = "accept" +_Ac = "Accept" +_XABT = "X-Amzn-Bedrock-Trace" +_XABG = "X-Amzn-Bedrock-GuardrailIdentifier" +_XABG_ = "X-Amzn-Bedrock-GuardrailVersion" +_pCL = "performanceConfigLatency" +_XABPL = "X-Amzn-Bedrock-PerformanceConfig-Latency" +_XABST = "X-Amzn-Bedrock-Service-Tier" +_XABRM = "X-Amzn-Bedrock-Request-Metadata" +_IMO = "InvokeModelOutput" +_cIMRo = "com.amazonaws.bedrockruntime#InvokeModelResponse" +_IM = "InvokeModel" +_PB = "PartBody" +_BIPP = "BidirectionalInputPayloadPart" +_IMWBSI = "InvokeModelWithBidirectionalStreamInput" +_chu = "chunk" +_IMWBSOI = "InvokeModelWithBidirectionalStreamOperationInput" +_cIMWBSR = "com.amazonaws.bedrockruntime#InvokeModelWithBidirectionalStreamRequest" +_BOPP = "BidirectionalOutputPayloadPart" +_IMWBSO = "InvokeModelWithBidirectionalStreamOutput" +_mTE = "modelTimeoutException" +_IMWBSOO = "InvokeModelWithBidirectionalStreamOperationOutput" +_cIMWBSRo = "com.amazonaws.bedrockruntime#InvokeModelWithBidirectionalStreamResponse" +_IMWBS = "InvokeModelWithBidirectionalStream" +_IMWRSI = "InvokeModelWithResponseStreamInput" +_cIMWRSR = "com.amazonaws.bedrockruntime#InvokeModelWithResponseStreamRequest" +_XABA = "X-Amzn-Bedrock-Accept" +_PP = "PayloadPart" +_RS = "ResponseStream" +_IMWRSO = "InvokeModelWithResponseStreamOutput" +_cIMWRSRo = "com.amazonaws.bedrockruntime#InvokeModelWithResponseStreamResponse" +_XABCT = "X-Amzn-Bedrock-Content-Type" +_IMWRS = "InvokeModelWithResponseStream" +_CTR = "ConverseTokensRequest" +_IMTR = "InvokeModelTokensRequest" +_CTI = "CountTokensInput" +_iMn = "invokeModel" +_conv = "converse" +_FMVI = "FoundationModelVersionIdentifier" +_CTOI = "CountTokensOperationInput" +_cCTR = "com.amazonaws.bedrockruntime#CountTokensRequest" +_CTO = "CountTokensOutput" +_cCTRo = "com.amazonaws.bedrockruntime#CountTokensResponse" +_CTo = "CountTokens" +_ABFS = "AmazonBedrockFrontendService" +_aw = "aws.auth#sigv4" +_sBm = "smithy.rules#endpointBdd" +_aws = "aws.api#service" +_aJ = "aws.protocols#restJson1" +_sBA = "smithy.api#httpBearerAuth" + +NON_BLANK_STRING: StaticSchema = (3, n0, _NBS, 0) + +ACCESS_DENIED_EXCEPTION: StaticSchema = ( + 18, + n0, + _ADE, + {_s: _c, _sE: 403}, + (_m,), + ((NON_BLANK_STRING, 0),), +) + +ACCOUNT_ID: StaticSchema = (3, n0, _AI, 0) + +ADDITIONAL_MODEL_RESPONSE_FIELD_PATHS: StaticSchema = ( + 16, + n0, + _AMRFP, + 0, + (_me,), + ((3, 0),), +) + +INVOCATION_ARN: StaticSchema = (3, n0, _IA, 0) + +GET_ASYNC_INVOKE_INPUT: StaticSchema = ( + 18, + n0, + _GAII, + {_sSI: _cGAIR, _sm: None}, + (_iA,), + ((INVOCATION_ARN, 9),), +) + +ASYNC_INVOKE_IDEMPOTENCY_TOKEN: StaticSchema = (3, n0, _AIIT, 0) + +TIMESTAMP: StaticSchema = (4, n0, _T, {_sF: _dt}) + +ASYNC_INVOKE_MESSAGE: StaticSchema = (3, n0, _AIM, 4) + +ASYNC_INVOKE_ARN: StaticSchema = (3, n0, _AIA, 0) + +KMS_KEY_ID: StaticSchema = (3, n0, _KKI, 0) + +S3_URI: StaticSchema = (3, n0, _SU, 0) + +ASYNC_INVOKE_S3_OUTPUT_DATA_CONFIG: StaticSchema = ( + 18, + n0, + _AISODC, + 0, + (_sU, _kKI, _bO), + ((S3_URI, 1), (KMS_KEY_ID, 0), (ACCOUNT_ID, 0)), +) + +ASYNC_INVOKE_OUTPUT_DATA_CONFIG: StaticSchema = ( + 19, + n0, + _AIODC, + 0, + (_sODC,), + ((ASYNC_INVOKE_S3_OUTPUT_DATA_CONFIG, 0),), +) + +ASYNC_INVOKE_STATUS: StaticSchema = ( + 14, + n0, + _AIS, + 0, + (_IP, _COMPLETED, _FAILED), + ((-1, {_sV: _IPn}), (-1, {_sV: _C}), (-1, {_sV: _F})), +) + +GET_ASYNC_INVOKE_OUTPUT: StaticSchema = ( + 18, + n0, + _GAIO, + {_sSI: _cGAIRo, _smith: None}, + (_iA, _mA, _cRT, _st, _fM, _sT, _lMT, _eT, _oDC), + ( + (INVOCATION_ARN, 1), + (ASYNC_INVOKE_ARN, 1), + (ASYNC_INVOKE_IDEMPOTENCY_TOKEN, 0), + (ASYNC_INVOKE_STATUS, 1), + (ASYNC_INVOKE_MESSAGE, 0), + (TIMESTAMP, 1), + (TIMESTAMP, 0), + (TIMESTAMP, 0), + (ASYNC_INVOKE_OUTPUT_DATA_CONFIG, 1), + ), ) -GET_ASYNC_INVOKE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GetAsyncInvokeInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockruntime#GetAsyncInvokeRequest", +INTERNAL_SERVER_EXCEPTION: StaticSchema = ( + 18, + n0, + _ISE, + {_s: _se, _sE: 500}, + (_m,), + ((NON_BLANK_STRING, 0),), +) + +THROTTLING_EXCEPTION: StaticSchema = ( + 18, + n0, + _TE, + {_s: _c, _sE: 429}, + (_m,), + ((NON_BLANK_STRING, 0),), +) + +VALIDATION_EXCEPTION: StaticSchema = ( + 18, + n0, + _VE, + {_s: _c, _sE: 400}, + (_m,), + ((NON_BLANK_STRING, 0),), +) + +GET_ASYNC_INVOKE: StaticOperationSchema = ( + 23, + n0, + _GAI, + { + _smithy: MappingProxyType( + {"code": 200, "method": "GET", "uri": "/async-invoke/{invocationArn}"} ) - ], - members={ - "invocationArn": { - "target": INVOCATION_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } }, + GET_ASYNC_INVOKE_INPUT, + GET_ASYNC_INVOKE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -ASYNC_INVOKE_IDEMPOTENCY_TOKEN = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#AsyncInvokeIdempotencyToken"), - shape_type=ShapeType.STRING, +MAX_RESULTS: StaticSchema = (7, n0, _MR, 0) + +PAGINATION_TOKEN: StaticSchema = (3, n0, _PT, 0) + +SORT_ASYNC_INVOCATION_BY: StaticSchema = ( + 14, + n0, + _SAIB, + 0, + (_ST,), + ((-1, {_sV: _STu}),), +) + +SORT_ORDER: StaticSchema = ( + 14, + n0, + _SO, + 0, + (_ASCENDING, _DESCENDING), + ((-1, {_sV: _A}), (-1, {_sV: _D})), +) + +LIST_ASYNC_INVOKES_INPUT: StaticSchema = ( + 18, + n0, + _LAII, + {_sSI: _cLAIR, _sm: None}, + (_sTA, _sTB, _sEt, _mR, _nT, _sB, _sO), + ( + (TIMESTAMP, {_sQ: _sTA}), + (TIMESTAMP, {_sQ: _sTB}), + (ASYNC_INVOKE_STATUS, {_sQ: _sEt}), + (MAX_RESULTS, {_sQ: _mR}), + (PAGINATION_TOKEN, {_sQ: _nT}), + (SORT_ASYNC_INVOCATION_BY, {_smithya: _STu, _sQ: _sB}), + (SORT_ORDER, {_smithya: _D, _sQ: _sO}), + ), ) -TIMESTAMP = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#Timestamp"), - shape_type=ShapeType.TIMESTAMP, - traits=[Trait.new(id=ShapeID("smithy.api#timestampFormat"), value="date-time")], +ASYNC_INVOKE_SUMMARY: StaticSchema = ( + 18, + n0, + _AISs, + 0, + (_iA, _mA, _cRT, _st, _fM, _sT, _lMT, _eT, _oDC), + ( + (INVOCATION_ARN, 1), + (ASYNC_INVOKE_ARN, 1), + (ASYNC_INVOKE_IDEMPOTENCY_TOKEN, 0), + (ASYNC_INVOKE_STATUS, 0), + (ASYNC_INVOKE_MESSAGE, 0), + (TIMESTAMP, 1), + (TIMESTAMP, 0), + (TIMESTAMP, 0), + (ASYNC_INVOKE_OUTPUT_DATA_CONFIG, 1), + ), ) -ASYNC_INVOKE_MESSAGE = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#AsyncInvokeMessage"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +ASYNC_INVOKE_SUMMARIES: StaticSchema = ( + 16, + n0, + _AISsy, + 0, + (_me,), + ((ASYNC_INVOKE_SUMMARY, 0),), +) + +LIST_ASYNC_INVOKES_OUTPUT: StaticSchema = ( + 18, + n0, + _LAIO, + {_sSI: _cLAIRo, _smith: None}, + (_nT, _aIS), + ((PAGINATION_TOKEN, 0), (ASYNC_INVOKE_SUMMARIES, 0)), +) + +LIST_ASYNC_INVOKES: StaticOperationSchema = ( + 23, + n0, + _LAI, + {_smithy: MappingProxyType({"code": 200, "method": "GET", "uri": "/async-invoke"})}, + LIST_ASYNC_INVOKES_INPUT, + LIST_ASYNC_INVOKES_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -ASYNC_INVOKE_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#AsyncInvokeArn"), - shape_type=ShapeType.STRING, +CONFLICT_EXCEPTION: StaticSchema = ( + 18, + n0, + _CE, + {_s: _c, _sE: 400}, + (_m,), + ((NON_BLANK_STRING, 0),), ) -KMS_KEY_ID = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#KmsKeyId"), shape_type=ShapeType.STRING +RESOURCE_NOT_FOUND_EXCEPTION: StaticSchema = ( + 18, + n0, + _RNFE, + {_s: _c, _sE: 404}, + (_m,), + ((NON_BLANK_STRING, 0),), ) -S3_URI = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#S3Uri"), shape_type=ShapeType.STRING +SERVICE_QUOTA_EXCEEDED_EXCEPTION: StaticSchema = ( + 18, + n0, + _SQEE, + {_s: _c, _sE: 400}, + (_m,), + ((NON_BLANK_STRING, 0),), ) -ASYNC_INVOKE_S3_OUTPUT_DATA_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#AsyncInvokeS3OutputDataConfig"), - members={ - "s3Uri": { - "target": S3_URI, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "kmsKeyId": {"target": KMS_KEY_ID}, - "bucketOwner": {"target": ACCOUNT_ID}, - }, +SERVICE_UNAVAILABLE_EXCEPTION: StaticSchema = ( + 18, + n0, + _SUE, + {_s: _se, _sE: 503}, + (_m,), + ((NON_BLANK_STRING, 0),), ) -ASYNC_INVOKE_OUTPUT_DATA_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#AsyncInvokeOutputDataConfig"), - shape_type=ShapeType.UNION, - members={"s3OutputDataConfig": {"target": ASYNC_INVOKE_S3_OUTPUT_DATA_CONFIG}}, -) +ASYNC_INVOKE_IDENTIFIER: StaticSchema = (3, n0, _AII, 0) -ASYNC_INVOKE_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#AsyncInvokeStatus"), - shape_type=ShapeType.ENUM, - members={ - "IN_PROGRESS": {"target": UNIT}, - "COMPLETED": {"target": UNIT}, - "FAILED": {"target": UNIT}, - }, -) +MODEL_INPUT_PAYLOAD: StaticSchema = (13, n0, _MIP, 4) -GET_ASYNC_INVOKE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GetAsyncInvokeOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockruntime#GetAsyncInvokeResponse", - ) - ], - members={ - "invocationArn": { - "target": INVOCATION_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelArn": { - "target": ASYNC_INVOKE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientRequestToken": {"target": ASYNC_INVOKE_IDEMPOTENCY_TOKEN}, - "status": { - "target": ASYNC_INVOKE_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "failureMessage": {"target": ASYNC_INVOKE_MESSAGE}, - "submitTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastModifiedTime": {"target": TIMESTAMP}, - "endTime": {"target": TIMESTAMP}, - "outputDataConfig": { - "target": ASYNC_INVOKE_OUTPUT_DATA_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +TAG_KEY: StaticSchema = (3, n0, _TK, 0) -INTERNAL_SERVER_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#InternalServerException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="server"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=500), - ], - members={"message": {"target": NON_BLANK_STRING}}, -) - -THROTTLING_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ThrottlingException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=429), - ], - members={"message": {"target": NON_BLANK_STRING}}, -) - -VALIDATION_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ValidationException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"message": {"target": NON_BLANK_STRING}}, -) - -GET_ASYNC_INVOKE = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#GetAsyncInvoke"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "GET", "uri": "/async-invoke/{invocationArn}"} - ), - ) - ], -) +TAG_VALUE: StaticSchema = (3, n0, _TV, 0) -MAX_RESULTS = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#MaxResults"), shape_type=ShapeType.INTEGER -) +TAG: StaticSchema = (18, n0, _Ta, 0, (_k, _v), ((TAG_KEY, 1), (TAG_VALUE, 1))) -PAGINATION_TOKEN = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#PaginationToken"), - shape_type=ShapeType.STRING, -) +TAG_LIST: StaticSchema = (16, n0, _TL, 0, (_me,), ((TAG, 0),)) -SORT_ASYNC_INVOCATION_BY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#SortAsyncInvocationBy"), - shape_type=ShapeType.ENUM, - members={"SUBMISSION_TIME": {"target": UNIT}}, +START_ASYNC_INVOKE_INPUT: StaticSchema = ( + 18, + n0, + _SAII, + {_sSI: _cSAIR, _sm: None}, + (_cRT, _mI, _mIo, _oDC, _t), + ( + (ASYNC_INVOKE_IDEMPOTENCY_TOKEN, 2), + (ASYNC_INVOKE_IDENTIFIER, 1), + (MODEL_INPUT_PAYLOAD, 1), + (ASYNC_INVOKE_OUTPUT_DATA_CONFIG, 1), + (TAG_LIST, 0), + ), ) -SORT_ORDER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#SortOrder"), - shape_type=ShapeType.ENUM, - members={"ASCENDING": {"target": UNIT}, "DESCENDING": {"target": UNIT}}, +START_ASYNC_INVOKE_OUTPUT: StaticSchema = ( + 18, + n0, + _SAIO, + {_sSI: _cSAIRo, _smith: None}, + (_iA,), + ((INVOCATION_ARN, 1),), ) -LIST_ASYNC_INVOKES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ListAsyncInvokesInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockruntime#ListAsyncInvokesRequest", +START_ASYNC_INVOKE: StaticOperationSchema = ( + 23, + n0, + _SAI, + { + _smithy: MappingProxyType( + {"code": 200, "method": "POST", "uri": "/async-invoke"} ) - ], - members={ - "submitTimeAfter": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="submitTimeAfter") - ], - }, - "submitTimeBefore": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="submitTimeBefore") - ], - }, - "statusEquals": { - "target": ASYNC_INVOKE_STATUS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="statusEquals") - ], - }, - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "nextToken": { - "target": PAGINATION_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "sortBy": { - "target": SORT_ASYNC_INVOCATION_BY, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value="SubmissionTime"), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="sortBy"), - ], - }, - "sortOrder": { - "target": SORT_ORDER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value="Descending"), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="sortOrder"), - ], - }, }, + START_ASYNC_INVOKE_INPUT, + START_ASYNC_INVOKE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + SERVICE_UNAVAILABLE_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -ASYNC_INVOKE_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#AsyncInvokeSummary"), - members={ - "invocationArn": { - "target": INVOCATION_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelArn": { - "target": ASYNC_INVOKE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientRequestToken": {"target": ASYNC_INVOKE_IDEMPOTENCY_TOKEN}, - "status": {"target": ASYNC_INVOKE_STATUS}, - "failureMessage": {"target": ASYNC_INVOKE_MESSAGE}, - "submitTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastModifiedTime": {"target": TIMESTAMP}, - "endTime": {"target": TIMESTAMP}, - "outputDataConfig": { - "target": ASYNC_INVOKE_OUTPUT_DATA_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +GUARDRAIL_IMAGE_FORMAT: StaticSchema = ( + 14, + n0, + _GIF, + 0, + (_PNG, _JPEG), + ((-1, {_sV: _p}), (-1, {_sV: _j})), +) + +GUARDRAIL_IMAGE_SOURCE: StaticSchema = (19, n0, _GIS, 4, (_b,), ((1, 0),)) + +GUARDRAIL_IMAGE_BLOCK: StaticSchema = ( + 18, + n0, + _GIB, + 4, + (_f, _so), + ((GUARDRAIL_IMAGE_FORMAT, 1), (GUARDRAIL_IMAGE_SOURCE, 1)), +) + +GUARDRAIL_CONTENT_QUALIFIER: StaticSchema = ( + 14, + n0, + _GCQ, + 0, + (_GS, _QUERY, _GC), + ((-1, {_sV: _gs}), (-1, {_sV: _q}), (-1, {_sV: _gc})), +) + +GUARDRAIL_CONTENT_QUALIFIER_LIST: StaticSchema = ( + 16, + n0, + _GCQL, + 0, + (_me,), + ((GUARDRAIL_CONTENT_QUALIFIER, 0),), +) + +GUARDRAIL_TEXT_BLOCK: StaticSchema = ( + 18, + n0, + _GTB, + 0, + (_te, _qu), + ((3, 1), (GUARDRAIL_CONTENT_QUALIFIER_LIST, 0)), +) + +GUARDRAIL_CONTENT_BLOCK: StaticSchema = ( + 19, + n0, + _GCB, + 0, + (_te, _i), + ((GUARDRAIL_TEXT_BLOCK, 0), (GUARDRAIL_IMAGE_BLOCK, 0)), +) + +GUARDRAIL_CONTENT_BLOCK_LIST: StaticSchema = ( + 16, + n0, + _GCBL, + 0, + (_me,), + ((GUARDRAIL_CONTENT_BLOCK, 0),), +) + +GUARDRAIL_IDENTIFIER: StaticSchema = (3, n0, _GI, 0) + +GUARDRAIL_VERSION: StaticSchema = (3, n0, _GV, 0) + +GUARDRAIL_OUTPUT_SCOPE: StaticSchema = ( + 14, + n0, + _GOS, + 0, + (_INTERVENTIONS, _FULL), + ((-1, {_sV: _INTERVENTIONS}), (-1, {_sV: _FULL})), +) + +GUARDRAIL_CONTENT_SOURCE: StaticSchema = ( + 14, + n0, + _GCS, + 0, + (_INPUT, _OUTPUT), + ((-1, {_sV: _INPUT}), (-1, {_sV: _OUTPUT})), +) + +APPLY_GUARDRAIL_INPUT: StaticSchema = ( + 18, + n0, + _AGI, + {_sSI: _cAGR, _sm: None}, + (_gI, _gV, _so, _co, _oS), + ( + (GUARDRAIL_IDENTIFIER, 9), + (GUARDRAIL_VERSION, 9), + (GUARDRAIL_CONTENT_SOURCE, 1), + (GUARDRAIL_CONTENT_BLOCK_LIST, 1), + (GUARDRAIL_OUTPUT_SCOPE, 0), + ), ) -ASYNC_INVOKE_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#AsyncInvokeSummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": ASYNC_INVOKE_SUMMARY}}, +GUARDRAIL_ACTION: StaticSchema = ( + 14, + n0, + _GA, + 0, + (_NONE, _GI_), + ((-1, {_sV: _NONE}), (-1, {_sV: _GI_})), +) + +GUARDRAIL_ARN: StaticSchema = (3, n0, _GAu, 0) + +GUARDRAIL_ID: StaticSchema = (3, n0, _GIu, 0) + +GUARDRAIL_ORIGIN: StaticSchema = ( + 14, + n0, + _GO, + 0, + (_REQUEST, _AE, _OE), + ((-1, {_sV: _REQUEST}), (-1, {_sV: _AE}), (-1, {_sV: _OE})), +) + +GUARDRAIL_ORIGIN_LIST: StaticSchema = ( + 16, + n0, + _GOL, + 0, + (_me,), + ((GUARDRAIL_ORIGIN, 0),), +) + +GUARDRAIL_OWNERSHIP: StaticSchema = ( + 14, + n0, + _GOu, + 0, + (_SELF, _CA), + ((-1, {_sV: _SELF}), (-1, {_sV: _CA})), +) + +APPLIED_GUARDRAIL_DETAILS: StaticSchema = ( + 18, + n0, + _AGD, + 0, + (_gIu, _gV, _gA, _gO, _gOu), + ( + (GUARDRAIL_ID, 0), + (GUARDRAIL_VERSION, 0), + (GUARDRAIL_ARN, 0), + (GUARDRAIL_ORIGIN_LIST, 0), + (GUARDRAIL_OWNERSHIP, 0), + ), ) -LIST_ASYNC_INVOKES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ListAsyncInvokesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockruntime#ListAsyncInvokesResponse", - ) - ], - members={ - "nextToken": {"target": PAGINATION_TOKEN}, - "asyncInvokeSummaries": {"target": ASYNC_INVOKE_SUMMARIES}, - }, -) +AUTOMATED_REASONING_RULE_IDENTIFIER: StaticSchema = (3, n0, _ARRI, 0) -LIST_ASYNC_INVOKES = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#ListAsyncInvokes"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "GET", "uri": "/async-invoke"} - ), - ) - ], -) +GUARDRAIL_AUTOMATED_REASONING_POLICY_VERSION_ARN: StaticSchema = (3, n0, _GARPVA, 0) -CONFLICT_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ConflictException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"message": {"target": NON_BLANK_STRING}}, +GUARDRAIL_AUTOMATED_REASONING_RULE: StaticSchema = ( + 18, + n0, + _GARR, + 0, + (_id, _pVA), + ( + (AUTOMATED_REASONING_RULE_IDENTIFIER, 0), + (GUARDRAIL_AUTOMATED_REASONING_POLICY_VERSION_ARN, 0), + ), ) -RESOURCE_NOT_FOUND_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ResourceNotFoundException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=404), - ], - members={"message": {"target": NON_BLANK_STRING}}, +GUARDRAIL_AUTOMATED_REASONING_RULE_LIST: StaticSchema = ( + 16, + n0, + _GARRL, + 0, + (_me,), + ((GUARDRAIL_AUTOMATED_REASONING_RULE, 0),), ) -SERVICE_QUOTA_EXCEEDED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ServiceQuotaExceededException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"message": {"target": NON_BLANK_STRING}}, +GUARDRAIL_AUTOMATED_REASONING_STATEMENT_LOGIC_CONTENT: StaticSchema = ( + 3, + n0, + _GARSLC, + 4, ) -SERVICE_UNAVAILABLE_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ServiceUnavailableException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="server"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=503), - ], - members={"message": {"target": NON_BLANK_STRING}}, +GUARDRAIL_AUTOMATED_REASONING_STATEMENT_NATURAL_LANGUAGE_CONTENT: StaticSchema = ( + 3, + n0, + _GARSNLC, + 4, ) -ASYNC_INVOKE_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#AsyncInvokeIdentifier"), - shape_type=ShapeType.STRING, +GUARDRAIL_AUTOMATED_REASONING_STATEMENT: StaticSchema = ( + 18, + n0, + _GARS, + 0, + (_l, _nL), + ( + (GUARDRAIL_AUTOMATED_REASONING_STATEMENT_LOGIC_CONTENT, 0), + (GUARDRAIL_AUTOMATED_REASONING_STATEMENT_NATURAL_LANGUAGE_CONTENT, 0), + ), ) -MODEL_INPUT_PAYLOAD = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#ModelInputPayload"), - shape_type=ShapeType.DOCUMENT, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +GUARDRAIL_AUTOMATED_REASONING_STATEMENT_LIST: StaticSchema = ( + 16, + n0, + _GARSL, + 0, + (_me,), + ((GUARDRAIL_AUTOMATED_REASONING_STATEMENT, 0),), +) + +GUARDRAIL_AUTOMATED_REASONING_LOGIC_WARNING_TYPE: StaticSchema = ( + 14, + n0, + _GARLWT, + 0, + (_AF, _AT), + ((-1, {_sV: _AF}), (-1, {_sV: _AT})), +) + +GUARDRAIL_AUTOMATED_REASONING_LOGIC_WARNING: StaticSchema = ( + 18, + n0, + _GARLW, + 0, + (_ty, _pr, _cl), + ( + (GUARDRAIL_AUTOMATED_REASONING_LOGIC_WARNING_TYPE, 0), + (GUARDRAIL_AUTOMATED_REASONING_STATEMENT_LIST, 0), + (GUARDRAIL_AUTOMATED_REASONING_STATEMENT_LIST, 0), + ), ) -TAG_KEY = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#TagKey"), shape_type=ShapeType.STRING +GUARDRAIL_AUTOMATED_REASONING_TRANSLATION_CONFIDENCE: StaticSchema = (10, n0, _GARTC, 0) + +GUARDRAIL_AUTOMATED_REASONING_INPUT_TEXT_REFERENCE: StaticSchema = ( + 18, + n0, + _GARITR, + 0, + (_te,), + ((GUARDRAIL_AUTOMATED_REASONING_STATEMENT_NATURAL_LANGUAGE_CONTENT, 0),), +) + +GUARDRAIL_AUTOMATED_REASONING_INPUT_TEXT_REFERENCE_LIST: StaticSchema = ( + 16, + n0, + _GARITRL, + 0, + (_me,), + ((GUARDRAIL_AUTOMATED_REASONING_INPUT_TEXT_REFERENCE, 0),), +) + +GUARDRAIL_AUTOMATED_REASONING_TRANSLATION: StaticSchema = ( + 18, + n0, + _GART, + 0, + (_pr, _cl, _uP, _uC, _con), + ( + (GUARDRAIL_AUTOMATED_REASONING_STATEMENT_LIST, 0), + (GUARDRAIL_AUTOMATED_REASONING_STATEMENT_LIST, 0), + (GUARDRAIL_AUTOMATED_REASONING_INPUT_TEXT_REFERENCE_LIST, 0), + (GUARDRAIL_AUTOMATED_REASONING_INPUT_TEXT_REFERENCE_LIST, 0), + (GUARDRAIL_AUTOMATED_REASONING_TRANSLATION_CONFIDENCE, 0), + ), ) -TAG_VALUE = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#TagValue"), shape_type=ShapeType.STRING +GUARDRAIL_AUTOMATED_REASONING_IMPOSSIBLE_FINDING: StaticSchema = ( + 18, + n0, + _GARIF, + 0, + (_tr, _cR, _lW), + ( + (GUARDRAIL_AUTOMATED_REASONING_TRANSLATION, 0), + (GUARDRAIL_AUTOMATED_REASONING_RULE_LIST, 0), + (GUARDRAIL_AUTOMATED_REASONING_LOGIC_WARNING, 0), + ), ) -TAG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#Tag"), - members={ - "key": { - "target": TAG_KEY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "value": { - "target": TAG_VALUE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +GUARDRAIL_AUTOMATED_REASONING_INVALID_FINDING: StaticSchema = ( + 18, + n0, + _GARIFu, + 0, + (_tr, _cR, _lW), + ( + (GUARDRAIL_AUTOMATED_REASONING_TRANSLATION, 0), + (GUARDRAIL_AUTOMATED_REASONING_RULE_LIST, 0), + (GUARDRAIL_AUTOMATED_REASONING_LOGIC_WARNING, 0), + ), ) -TAG_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#TagList"), - shape_type=ShapeType.LIST, - members={"member": {"target": TAG}}, +GUARDRAIL_AUTOMATED_REASONING_NO_TRANSLATIONS_FINDING: StaticSchema = ( + 18, + n0, + _GARNTF, + 0, +) + +GUARDRAIL_AUTOMATED_REASONING_SCENARIO: StaticSchema = ( + 18, + n0, + _GARSu, + 0, + (_sta,), + ((GUARDRAIL_AUTOMATED_REASONING_STATEMENT_LIST, 0),), +) + +GUARDRAIL_AUTOMATED_REASONING_SATISFIABLE_FINDING: StaticSchema = ( + 18, + n0, + _GARSF, + 0, + (_tr, _cTS, _cFS, _lW), + ( + (GUARDRAIL_AUTOMATED_REASONING_TRANSLATION, 0), + (GUARDRAIL_AUTOMATED_REASONING_SCENARIO, 0), + (GUARDRAIL_AUTOMATED_REASONING_SCENARIO, 0), + (GUARDRAIL_AUTOMATED_REASONING_LOGIC_WARNING, 0), + ), ) -START_ASYNC_INVOKE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#StartAsyncInvokeInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockruntime#StartAsyncInvokeRequest", - ) - ], - members={ - "clientRequestToken": { - "target": ASYNC_INVOKE_IDEMPOTENCY_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "modelId": { - "target": ASYNC_INVOKE_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelInput": { - "target": MODEL_INPUT_PAYLOAD, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "outputDataConfig": { - "target": ASYNC_INVOKE_OUTPUT_DATA_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "tags": {"target": TAG_LIST}, - }, +GUARDRAIL_AUTOMATED_REASONING_TOO_COMPLEX_FINDING: StaticSchema = (18, n0, _GARTCF, 0) + +GUARDRAIL_AUTOMATED_REASONING_DIFFERENCE_SCENARIO_LIST: StaticSchema = ( + 16, + n0, + _GARDSL, + 0, + (_me,), + ((GUARDRAIL_AUTOMATED_REASONING_SCENARIO, 0),), +) + +GUARDRAIL_AUTOMATED_REASONING_TRANSLATION_LIST: StaticSchema = ( + 16, + n0, + _GARTL, + 0, + (_me,), + ((GUARDRAIL_AUTOMATED_REASONING_TRANSLATION, 0),), +) + +GUARDRAIL_AUTOMATED_REASONING_TRANSLATION_OPTION: StaticSchema = ( + 18, + n0, + _GARTO, + 0, + (_tra,), + ((GUARDRAIL_AUTOMATED_REASONING_TRANSLATION_LIST, 0),), +) + +GUARDRAIL_AUTOMATED_REASONING_TRANSLATION_OPTION_LIST: StaticSchema = ( + 16, + n0, + _GARTOL, + 0, + (_me,), + ((GUARDRAIL_AUTOMATED_REASONING_TRANSLATION_OPTION, 0),), +) + +GUARDRAIL_AUTOMATED_REASONING_TRANSLATION_AMBIGUOUS_FINDING: StaticSchema = ( + 18, + n0, + _GARTAF, + 0, + (_o, _dS), + ( + (GUARDRAIL_AUTOMATED_REASONING_TRANSLATION_OPTION_LIST, 0), + (GUARDRAIL_AUTOMATED_REASONING_DIFFERENCE_SCENARIO_LIST, 0), + ), ) -START_ASYNC_INVOKE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#StartAsyncInvokeOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockruntime#StartAsyncInvokeResponse", - ) - ], - members={ - "invocationArn": { - "target": INVOCATION_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +GUARDRAIL_AUTOMATED_REASONING_VALID_FINDING: StaticSchema = ( + 18, + n0, + _GARVF, + 0, + (_tr, _cTS, _sR, _lW), + ( + (GUARDRAIL_AUTOMATED_REASONING_TRANSLATION, 0), + (GUARDRAIL_AUTOMATED_REASONING_SCENARIO, 0), + (GUARDRAIL_AUTOMATED_REASONING_RULE_LIST, 0), + (GUARDRAIL_AUTOMATED_REASONING_LOGIC_WARNING, 0), + ), ) -START_ASYNC_INVOKE = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#StartAsyncInvoke"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "POST", "uri": "/async-invoke"} - ), - ) - ], -) - -GUARDRAIL_IMAGE_FORMAT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailImageFormat"), - shape_type=ShapeType.ENUM, - members={"PNG": {"target": UNIT}, "JPEG": {"target": UNIT}}, -) - -GUARDRAIL_IMAGE_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailImageSource"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"bytes": {"target": BLOB}}, -) - -GUARDRAIL_IMAGE_BLOCK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailImageBlock"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "format": { - "target": GUARDRAIL_IMAGE_FORMAT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "source": { - "target": GUARDRAIL_IMAGE_SOURCE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +GUARDRAIL_AUTOMATED_REASONING_FINDING: StaticSchema = ( + 19, + n0, + _GARF, + 0, + (_va, _in, _sa, _im, _tA, _tC, _nTo), + ( + (GUARDRAIL_AUTOMATED_REASONING_VALID_FINDING, 0), + (GUARDRAIL_AUTOMATED_REASONING_INVALID_FINDING, 0), + (GUARDRAIL_AUTOMATED_REASONING_SATISFIABLE_FINDING, 0), + (GUARDRAIL_AUTOMATED_REASONING_IMPOSSIBLE_FINDING, 0), + (GUARDRAIL_AUTOMATED_REASONING_TRANSLATION_AMBIGUOUS_FINDING, 0), + (GUARDRAIL_AUTOMATED_REASONING_TOO_COMPLEX_FINDING, 0), + (GUARDRAIL_AUTOMATED_REASONING_NO_TRANSLATIONS_FINDING, 0), + ), ) -GUARDRAIL_CONTENT_QUALIFIER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailContentQualifier"), - shape_type=ShapeType.ENUM, - members={ - "GROUNDING_SOURCE": {"target": UNIT}, - "QUERY": {"target": UNIT}, - "GUARD_CONTENT": {"target": UNIT}, - }, +GUARDRAIL_AUTOMATED_REASONING_FINDING_LIST: StaticSchema = ( + 16, + n0, + _GARFL, + 0, + (_me,), + ((GUARDRAIL_AUTOMATED_REASONING_FINDING, 0),), +) + +GUARDRAIL_AUTOMATED_REASONING_POLICY_ASSESSMENT: StaticSchema = ( + 18, + n0, + _GARPA, + 0, + (_fi,), + ((GUARDRAIL_AUTOMATED_REASONING_FINDING_LIST, 0),), +) + +GUARDRAIL_CONTENT_POLICY_ACTION: StaticSchema = ( + 14, + n0, + _GCPA, + 0, + (_BLOCKED, _NONE), + ((-1, {_sV: _BLOCKED}), (-1, {_sV: _NONE})), +) + +GUARDRAIL_CONTENT_FILTER_CONFIDENCE: StaticSchema = ( + 14, + n0, + _GCFC, + 0, + (_NONE, _LOW, _MEDIUM, _HIGH), + ((-1, {_sV: _NONE}), (-1, {_sV: _LOW}), (-1, {_sV: _MEDIUM}), (-1, {_sV: _HIGH})), +) + +GUARDRAIL_CONTENT_FILTER_STRENGTH: StaticSchema = ( + 14, + n0, + _GCFS, + 0, + (_NONE, _LOW, _MEDIUM, _HIGH), + ((-1, {_sV: _NONE}), (-1, {_sV: _LOW}), (-1, {_sV: _MEDIUM}), (-1, {_sV: _HIGH})), +) + +GUARDRAIL_CONTENT_FILTER_TYPE: StaticSchema = ( + 14, + n0, + _GCFT, + 0, + (_INSULTS, _HATE, _SEXUAL, _VIOLENCE, _MISCONDUCT, _PA), + ( + (-1, {_sV: _INSULTS}), + (-1, {_sV: _HATE}), + (-1, {_sV: _SEXUAL}), + (-1, {_sV: _VIOLENCE}), + (-1, {_sV: _MISCONDUCT}), + (-1, {_sV: _PA}), + ), ) -GUARDRAIL_CONTENT_QUALIFIER_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailContentQualifierList"), - shape_type=ShapeType.LIST, - members={"member": {"target": GUARDRAIL_CONTENT_QUALIFIER}}, +GUARDRAIL_CONTENT_FILTER: StaticSchema = ( + 18, + n0, + _GCF, + 0, + (_ty, _con, _fS, _a, _d), + ( + (GUARDRAIL_CONTENT_FILTER_TYPE, 1), + (GUARDRAIL_CONTENT_FILTER_CONFIDENCE, 1), + (GUARDRAIL_CONTENT_FILTER_STRENGTH, 0), + (GUARDRAIL_CONTENT_POLICY_ACTION, 1), + (2, 0), + ), ) -GUARDRAIL_TEXT_BLOCK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailTextBlock"), - members={ - "text": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "qualifiers": {"target": GUARDRAIL_CONTENT_QUALIFIER_LIST}, - }, +GUARDRAIL_CONTENT_FILTER_LIST: StaticSchema = ( + 16, + n0, + _GCFL, + 0, + (_me,), + ((GUARDRAIL_CONTENT_FILTER, 0),), +) + +GUARDRAIL_CONTENT_POLICY_ASSESSMENT: StaticSchema = ( + 18, + n0, + _GCPAu, + 0, + (_fil,), + ((GUARDRAIL_CONTENT_FILTER_LIST, 1),), +) + +GUARDRAIL_CONTEXTUAL_GROUNDING_POLICY_ACTION: StaticSchema = ( + 14, + n0, + _GCGPA, + 0, + (_BLOCKED, _NONE), + ((-1, {_sV: _BLOCKED}), (-1, {_sV: _NONE})), +) + +GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER_TYPE: StaticSchema = ( + 14, + n0, + _GCGFT, + 0, + (_GROUNDING, _RELEVANCE), + ((-1, {_sV: _GROUNDING}), (-1, {_sV: _RELEVANCE})), +) + +GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER: StaticSchema = ( + 18, + n0, + _GCGF, + 0, + (_ty, _th, _sc, _a, _d), + ( + (GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER_TYPE, 1), + (10, 1), + (10, 1), + (GUARDRAIL_CONTEXTUAL_GROUNDING_POLICY_ACTION, 1), + (2, 0), + ), ) -GUARDRAIL_CONTENT_BLOCK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailContentBlock"), - shape_type=ShapeType.UNION, - members={ - "text": {"target": GUARDRAIL_TEXT_BLOCK}, - "image": {"target": GUARDRAIL_IMAGE_BLOCK}, - }, +GUARDRAIL_CONTEXTUAL_GROUNDING_FILTERS: StaticSchema = ( + 16, + n0, + _GCGFu, + 0, + (_me,), + ((GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER, 0),), ) -GUARDRAIL_CONTENT_BLOCK_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailContentBlockList"), - shape_type=ShapeType.LIST, - members={"member": {"target": GUARDRAIL_CONTENT_BLOCK}}, +GUARDRAIL_CONTEXTUAL_GROUNDING_POLICY_ASSESSMENT: StaticSchema = ( + 18, + n0, + _GCGPAu, + 0, + (_fil,), + ((GUARDRAIL_CONTEXTUAL_GROUNDING_FILTERS, 0),), ) -GUARDRAIL_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailIdentifier"), - shape_type=ShapeType.STRING, -) +IMAGES_GUARDED: StaticSchema = (7, n0, _IG, 0) -GUARDRAIL_VERSION = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailVersion"), - shape_type=ShapeType.STRING, -) +IMAGES_TOTAL: StaticSchema = (7, n0, _IT, 0) -GUARDRAIL_OUTPUT_SCOPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailOutputScope"), - shape_type=ShapeType.ENUM, - members={"INTERVENTIONS": {"target": UNIT}, "FULL": {"target": UNIT}}, +GUARDRAIL_IMAGE_COVERAGE: StaticSchema = ( + 18, + n0, + _GIC, + 0, + (_g, _to), + ((IMAGES_GUARDED, 0), (IMAGES_TOTAL, 0)), ) -GUARDRAIL_CONTENT_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailContentSource"), - shape_type=ShapeType.ENUM, - members={"INPUT": {"target": UNIT}, "OUTPUT": {"target": UNIT}}, -) +TEXT_CHARACTERS_GUARDED: StaticSchema = (7, n0, _TCG, 0) -APPLY_GUARDRAIL_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ApplyGuardrailInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockruntime#ApplyGuardrailRequest", - ) - ], - members={ - "guardrailIdentifier": { - "target": GUARDRAIL_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "guardrailVersion": { - "target": GUARDRAIL_VERSION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "source": { - "target": GUARDRAIL_CONTENT_SOURCE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "content": { - "target": GUARDRAIL_CONTENT_BLOCK_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "outputScope": {"target": GUARDRAIL_OUTPUT_SCOPE}, - }, -) +TEXT_CHARACTERS_TOTAL: StaticSchema = (7, n0, _TCT, 0) -GUARDRAIL_ACTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailAction"), - shape_type=ShapeType.ENUM, - members={"NONE": {"target": UNIT}, "GUARDRAIL_INTERVENED": {"target": UNIT}}, +GUARDRAIL_TEXT_CHARACTERS_COVERAGE: StaticSchema = ( + 18, + n0, + _GTCC, + 0, + (_g, _to), + ((TEXT_CHARACTERS_GUARDED, 0), (TEXT_CHARACTERS_TOTAL, 0)), ) -GUARDRAIL_ARN = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailArn"), shape_type=ShapeType.STRING +GUARDRAIL_COVERAGE: StaticSchema = ( + 18, + n0, + _GCu, + 0, + (_tCe, _ima), + ((GUARDRAIL_TEXT_CHARACTERS_COVERAGE, 0), (GUARDRAIL_IMAGE_COVERAGE, 0)), ) -GUARDRAIL_ID = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailId"), shape_type=ShapeType.STRING -) +GUARDRAIL_PROCESSING_LATENCY: StaticSchema = (8, n0, _GPL, 0) -GUARDRAIL_ORIGIN = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailOrigin"), - shape_type=ShapeType.ENUM, - members={ - "REQUEST": {"target": UNIT}, - "ACCOUNT_ENFORCED": {"target": UNIT}, - "ORGANIZATION_ENFORCED": {"target": UNIT}, - }, -) +GUARDRAIL_AUTOMATED_REASONING_POLICIES_PROCESSED: StaticSchema = (7, n0, _GARPP, 0) -GUARDRAIL_ORIGIN_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailOriginList"), - shape_type=ShapeType.LIST, - members={"member": {"target": GUARDRAIL_ORIGIN}}, -) +GUARDRAIL_AUTOMATED_REASONING_POLICY_UNITS_PROCESSED: StaticSchema = (7, n0, _GARPUP, 0) -GUARDRAIL_OWNERSHIP = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailOwnership"), - shape_type=ShapeType.ENUM, - members={"SELF": {"target": UNIT}, "CROSS_ACCOUNT": {"target": UNIT}}, -) +GUARDRAIL_CONTENT_POLICY_IMAGE_UNITS_PROCESSED: StaticSchema = (7, n0, _GCPIUP, 0) -APPLIED_GUARDRAIL_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#AppliedGuardrailDetails"), - members={ - "guardrailId": {"target": GUARDRAIL_ID}, - "guardrailVersion": {"target": GUARDRAIL_VERSION}, - "guardrailArn": {"target": GUARDRAIL_ARN}, - "guardrailOrigin": {"target": GUARDRAIL_ORIGIN_LIST}, - "guardrailOwnership": {"target": GUARDRAIL_OWNERSHIP}, - }, -) +GUARDRAIL_CONTENT_POLICY_UNITS_PROCESSED: StaticSchema = (7, n0, _GCPUP, 0) -AUTOMATED_REASONING_RULE_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#AutomatedReasoningRuleIdentifier"), - shape_type=ShapeType.STRING, +GUARDRAIL_CONTEXTUAL_GROUNDING_POLICY_UNITS_PROCESSED: StaticSchema = ( + 7, + n0, + _GCGPUP, + 0, ) -GUARDRAIL_AUTOMATED_REASONING_POLICY_VERSION_ARN = Schema( - id=ShapeID( - "com.amazonaws.bedrockruntime#GuardrailAutomatedReasoningPolicyVersionArn" - ), - shape_type=ShapeType.STRING, +GUARDRAIL_SENSITIVE_INFORMATION_POLICY_FREE_UNITS_PROCESSED: StaticSchema = ( + 7, + n0, + _GSIPFUP, + 0, ) -GUARDRAIL_AUTOMATED_REASONING_RULE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailAutomatedReasoningRule"), - members={ - "identifier": {"target": AUTOMATED_REASONING_RULE_IDENTIFIER}, - "policyVersionArn": { - "target": GUARDRAIL_AUTOMATED_REASONING_POLICY_VERSION_ARN - }, - }, +GUARDRAIL_SENSITIVE_INFORMATION_POLICY_UNITS_PROCESSED: StaticSchema = ( + 7, + n0, + _GSIPUP, + 0, ) -GUARDRAIL_AUTOMATED_REASONING_RULE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailAutomatedReasoningRuleList"), - shape_type=ShapeType.LIST, - members={"member": {"target": GUARDRAIL_AUTOMATED_REASONING_RULE}}, -) +GUARDRAIL_TOPIC_POLICY_UNITS_PROCESSED: StaticSchema = (7, n0, _GTPUP, 0) -GUARDRAIL_AUTOMATED_REASONING_STATEMENT_LOGIC_CONTENT = Schema( - id=ShapeID( - "com.amazonaws.bedrockruntime#GuardrailAutomatedReasoningStatementLogicContent" - ), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) +GUARDRAIL_WORD_POLICY_UNITS_PROCESSED: StaticSchema = (7, n0, _GWPUP, 0) -GUARDRAIL_AUTOMATED_REASONING_STATEMENT_NATURAL_LANGUAGE_CONTENT = Schema( - id=ShapeID( - "com.amazonaws.bedrockruntime#GuardrailAutomatedReasoningStatementNaturalLanguageContent" +GUARDRAIL_USAGE: StaticSchema = ( + 18, + n0, + _GU, + 0, + (_tPU, _cPU, _wPU, _sIPU, _sIPFU, _cGPU, _cPIU, _aRPU, _aRP), + ( + (GUARDRAIL_TOPIC_POLICY_UNITS_PROCESSED, 1), + (GUARDRAIL_CONTENT_POLICY_UNITS_PROCESSED, 1), + (GUARDRAIL_WORD_POLICY_UNITS_PROCESSED, 1), + (GUARDRAIL_SENSITIVE_INFORMATION_POLICY_UNITS_PROCESSED, 1), + (GUARDRAIL_SENSITIVE_INFORMATION_POLICY_FREE_UNITS_PROCESSED, 1), + (GUARDRAIL_CONTEXTUAL_GROUNDING_POLICY_UNITS_PROCESSED, 1), + (GUARDRAIL_CONTENT_POLICY_IMAGE_UNITS_PROCESSED, 0), + (GUARDRAIL_AUTOMATED_REASONING_POLICY_UNITS_PROCESSED, 0), + (GUARDRAIL_AUTOMATED_REASONING_POLICIES_PROCESSED, 0), ), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -GUARDRAIL_AUTOMATED_REASONING_STATEMENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailAutomatedReasoningStatement"), - members={ - "logic": {"target": GUARDRAIL_AUTOMATED_REASONING_STATEMENT_LOGIC_CONTENT}, - "naturalLanguage": { - "target": GUARDRAIL_AUTOMATED_REASONING_STATEMENT_NATURAL_LANGUAGE_CONTENT - }, - }, -) - -GUARDRAIL_AUTOMATED_REASONING_STATEMENT_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailAutomatedReasoningStatementList"), - shape_type=ShapeType.LIST, - members={"member": {"target": GUARDRAIL_AUTOMATED_REASONING_STATEMENT}}, ) -GUARDRAIL_AUTOMATED_REASONING_LOGIC_WARNING_TYPE = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockruntime#GuardrailAutomatedReasoningLogicWarningType" +GUARDRAIL_INVOCATION_METRICS: StaticSchema = ( + 18, + n0, + _GIM, + 0, + (_gPL, _u, _gC), + ((GUARDRAIL_PROCESSING_LATENCY, 0), (GUARDRAIL_USAGE, 0), (GUARDRAIL_COVERAGE, 0)), +) + +GUARDRAIL_SENSITIVE_INFORMATION_POLICY_ACTION: StaticSchema = ( + 14, + n0, + _GSIPA, + 0, + (_ANONYMIZED, _BLOCKED, _NONE), + ((-1, {_sV: _ANONYMIZED}), (-1, {_sV: _BLOCKED}), (-1, {_sV: _NONE})), +) + +GUARDRAIL_PII_ENTITY_TYPE: StaticSchema = ( + 14, + n0, + _GPET, + 0, + ( + _ADDRESS, + _AGE, + _AAK, + _ASK, + _CHN, + _CSIN, + _CDCC, + _CDCE, + _CDCN, + _DI, + _EMAIL, + _IBAN, + _IA_, + _LP, + _MA, + _NAME, + _PASSWORD, + _PHONE, + _PIN, + _SC, + _UNHSN, + _UNIN, + _UUTRN, + _URL, + _USERNAME, + _UBAN, + _UBRN, + _UITIN, + _UPN, + _USSN, + _VIN, ), - shape_type=ShapeType.ENUM, - members={"ALWAYS_FALSE": {"target": UNIT}, "ALWAYS_TRUE": {"target": UNIT}}, -) - -GUARDRAIL_AUTOMATED_REASONING_LOGIC_WARNING = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailAutomatedReasoningLogicWarning"), - members={ - "type": {"target": GUARDRAIL_AUTOMATED_REASONING_LOGIC_WARNING_TYPE}, - "premises": {"target": GUARDRAIL_AUTOMATED_REASONING_STATEMENT_LIST}, - "claims": {"target": GUARDRAIL_AUTOMATED_REASONING_STATEMENT_LIST}, - }, -) - -GUARDRAIL_AUTOMATED_REASONING_TRANSLATION_CONFIDENCE = Schema( - id=ShapeID( - "com.amazonaws.bedrockruntime#GuardrailAutomatedReasoningTranslationConfidence" + ( + (-1, {_sV: _ADDRESS}), + (-1, {_sV: _AGE}), + (-1, {_sV: _AAK}), + (-1, {_sV: _ASK}), + (-1, {_sV: _CHN}), + (-1, {_sV: _CSIN}), + (-1, {_sV: _CDCC}), + (-1, {_sV: _CDCE}), + (-1, {_sV: _CDCN}), + (-1, {_sV: _DI}), + (-1, {_sV: _EMAIL}), + (-1, {_sV: _IBAN}), + (-1, {_sV: _IA_}), + (-1, {_sV: _LP}), + (-1, {_sV: _MA}), + (-1, {_sV: _NAME}), + (-1, {_sV: _PASSWORD}), + (-1, {_sV: _PHONE}), + (-1, {_sV: _PIN}), + (-1, {_sV: _SC}), + (-1, {_sV: _UNHSN}), + (-1, {_sV: _UNIN}), + (-1, {_sV: _UUTRN}), + (-1, {_sV: _URL}), + (-1, {_sV: _USERNAME}), + (-1, {_sV: _UBAN}), + (-1, {_sV: _UBRN}), + (-1, {_sV: _UITIN}), + (-1, {_sV: _UPN}), + (-1, {_sV: _USSN}), + (-1, {_sV: _VIN}), ), - shape_type=ShapeType.DOUBLE, ) -GUARDRAIL_AUTOMATED_REASONING_INPUT_TEXT_REFERENCE = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockruntime#GuardrailAutomatedReasoningInputTextReference" +GUARDRAIL_PII_ENTITY_FILTER: StaticSchema = ( + 18, + n0, + _GPEF, + 0, + (_ma, _ty, _a, _d), + ( + (3, 1), + (GUARDRAIL_PII_ENTITY_TYPE, 1), + (GUARDRAIL_SENSITIVE_INFORMATION_POLICY_ACTION, 1), + (2, 0), ), - members={ - "text": { - "target": GUARDRAIL_AUTOMATED_REASONING_STATEMENT_NATURAL_LANGUAGE_CONTENT - } - }, ) -GUARDRAIL_AUTOMATED_REASONING_INPUT_TEXT_REFERENCE_LIST = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockruntime#GuardrailAutomatedReasoningInputTextReferenceList" +GUARDRAIL_PII_ENTITY_FILTER_LIST: StaticSchema = ( + 16, + n0, + _GPEFL, + 0, + (_me,), + ((GUARDRAIL_PII_ENTITY_FILTER, 0),), +) + +GUARDRAIL_REGEX_FILTER: StaticSchema = ( + 18, + n0, + _GRF, + 0, + (_n, _ma, _r, _a, _d), + ( + (3, 0), + (3, 0), + (3, 0), + (GUARDRAIL_SENSITIVE_INFORMATION_POLICY_ACTION, 1), + (2, 0), ), - shape_type=ShapeType.LIST, - members={"member": {"target": GUARDRAIL_AUTOMATED_REASONING_INPUT_TEXT_REFERENCE}}, -) - -GUARDRAIL_AUTOMATED_REASONING_TRANSLATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailAutomatedReasoningTranslation"), - members={ - "premises": {"target": GUARDRAIL_AUTOMATED_REASONING_STATEMENT_LIST}, - "claims": {"target": GUARDRAIL_AUTOMATED_REASONING_STATEMENT_LIST}, - "untranslatedPremises": { - "target": GUARDRAIL_AUTOMATED_REASONING_INPUT_TEXT_REFERENCE_LIST - }, - "untranslatedClaims": { - "target": GUARDRAIL_AUTOMATED_REASONING_INPUT_TEXT_REFERENCE_LIST - }, - "confidence": {"target": GUARDRAIL_AUTOMATED_REASONING_TRANSLATION_CONFIDENCE}, - }, ) -GUARDRAIL_AUTOMATED_REASONING_IMPOSSIBLE_FINDING = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockruntime#GuardrailAutomatedReasoningImpossibleFinding" +GUARDRAIL_REGEX_FILTER_LIST: StaticSchema = ( + 16, + n0, + _GRFL, + 0, + (_me,), + ((GUARDRAIL_REGEX_FILTER, 0),), +) + +GUARDRAIL_SENSITIVE_INFORMATION_POLICY_ASSESSMENT: StaticSchema = ( + 18, + n0, + _GSIPAu, + 0, + (_pE, _re), + ((GUARDRAIL_PII_ENTITY_FILTER_LIST, 1), (GUARDRAIL_REGEX_FILTER_LIST, 1)), +) + +GUARDRAIL_TOPIC_POLICY_ACTION: StaticSchema = ( + 14, + n0, + _GTPA, + 0, + (_BLOCKED, _NONE), + ((-1, {_sV: _BLOCKED}), (-1, {_sV: _NONE})), +) + +GUARDRAIL_TOPIC_TYPE: StaticSchema = (14, n0, _GTT, 0, (_DENY,), ((-1, {_sV: _DENY}),)) + +GUARDRAIL_TOPIC: StaticSchema = ( + 18, + n0, + _GT, + 0, + (_n, _ty, _a, _d), + ((3, 1), (GUARDRAIL_TOPIC_TYPE, 1), (GUARDRAIL_TOPIC_POLICY_ACTION, 1), (2, 0)), +) + +GUARDRAIL_TOPIC_LIST: StaticSchema = (16, n0, _GTL, 0, (_me,), ((GUARDRAIL_TOPIC, 0),)) + +GUARDRAIL_TOPIC_POLICY_ASSESSMENT: StaticSchema = ( + 18, + n0, + _GTPAu, + 0, + (_top,), + ((GUARDRAIL_TOPIC_LIST, 1),), +) + +GUARDRAIL_WORD_POLICY_ACTION: StaticSchema = ( + 14, + n0, + _GWPA, + 0, + (_BLOCKED, _NONE), + ((-1, {_sV: _BLOCKED}), (-1, {_sV: _NONE})), +) + +GUARDRAIL_CUSTOM_WORD: StaticSchema = ( + 18, + n0, + _GCW, + 0, + (_ma, _a, _d), + ((3, 1), (GUARDRAIL_WORD_POLICY_ACTION, 1), (2, 0)), +) + +GUARDRAIL_CUSTOM_WORD_LIST: StaticSchema = ( + 16, + n0, + _GCWL, + 0, + (_me,), + ((GUARDRAIL_CUSTOM_WORD, 0),), +) + +GUARDRAIL_MANAGED_WORD_TYPE: StaticSchema = ( + 14, + n0, + _GMWT, + 0, + (_PROFANITY,), + ((-1, {_sV: _PROFANITY}),), +) + +GUARDRAIL_MANAGED_WORD: StaticSchema = ( + 18, + n0, + _GMW, + 0, + (_ma, _ty, _a, _d), + ( + (3, 1), + (GUARDRAIL_MANAGED_WORD_TYPE, 1), + (GUARDRAIL_WORD_POLICY_ACTION, 1), + (2, 0), ), - members={ - "translation": {"target": GUARDRAIL_AUTOMATED_REASONING_TRANSLATION}, - "contradictingRules": {"target": GUARDRAIL_AUTOMATED_REASONING_RULE_LIST}, - "logicWarning": {"target": GUARDRAIL_AUTOMATED_REASONING_LOGIC_WARNING}, - }, ) -GUARDRAIL_AUTOMATED_REASONING_INVALID_FINDING = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockruntime#GuardrailAutomatedReasoningInvalidFinding" +GUARDRAIL_MANAGED_WORD_LIST: StaticSchema = ( + 16, + n0, + _GMWL, + 0, + (_me,), + ((GUARDRAIL_MANAGED_WORD, 0),), +) + +GUARDRAIL_WORD_POLICY_ASSESSMENT: StaticSchema = ( + 18, + n0, + _GWPAu, + 0, + (_cW, _mWL), + ((GUARDRAIL_CUSTOM_WORD_LIST, 1), (GUARDRAIL_MANAGED_WORD_LIST, 1)), +) + +GUARDRAIL_ASSESSMENT: StaticSchema = ( + 18, + n0, + _GAua, + 0, + (_tP, _cP, _wP, _sIP, _cGP, _aRPu, _iM, _aGD), + ( + (GUARDRAIL_TOPIC_POLICY_ASSESSMENT, 0), + (GUARDRAIL_CONTENT_POLICY_ASSESSMENT, 0), + (GUARDRAIL_WORD_POLICY_ASSESSMENT, 0), + (GUARDRAIL_SENSITIVE_INFORMATION_POLICY_ASSESSMENT, 0), + (GUARDRAIL_CONTEXTUAL_GROUNDING_POLICY_ASSESSMENT, 0), + (GUARDRAIL_AUTOMATED_REASONING_POLICY_ASSESSMENT, 0), + (GUARDRAIL_INVOCATION_METRICS, 0), + (APPLIED_GUARDRAIL_DETAILS, 0), ), - members={ - "translation": {"target": GUARDRAIL_AUTOMATED_REASONING_TRANSLATION}, - "contradictingRules": {"target": GUARDRAIL_AUTOMATED_REASONING_RULE_LIST}, - "logicWarning": {"target": GUARDRAIL_AUTOMATED_REASONING_LOGIC_WARNING}, - }, -) - -GUARDRAIL_AUTOMATED_REASONING_NO_TRANSLATIONS_FINDING = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockruntime#GuardrailAutomatedReasoningNoTranslationsFinding" - ) -) - -GUARDRAIL_AUTOMATED_REASONING_SCENARIO = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailAutomatedReasoningScenario"), - members={"statements": {"target": GUARDRAIL_AUTOMATED_REASONING_STATEMENT_LIST}}, ) -GUARDRAIL_AUTOMATED_REASONING_SATISFIABLE_FINDING = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockruntime#GuardrailAutomatedReasoningSatisfiableFinding" +GUARDRAIL_ASSESSMENT_LIST: StaticSchema = ( + 16, + n0, + _GAL, + 0, + (_me,), + ((GUARDRAIL_ASSESSMENT, 0),), +) + +GUARDRAIL_OUTPUT_TEXT: StaticSchema = (3, n0, _GOT, 0) + +GUARDRAIL_OUTPUT_CONTENT: StaticSchema = ( + 18, + n0, + _GOC, + 0, + (_te,), + ((GUARDRAIL_OUTPUT_TEXT, 0),), +) + +GUARDRAIL_OUTPUT_CONTENT_LIST: StaticSchema = ( + 16, + n0, + _GOCL, + 0, + (_me,), + ((GUARDRAIL_OUTPUT_CONTENT, 0),), +) + +APPLY_GUARDRAIL_OUTPUT: StaticSchema = ( + 18, + n0, + _AGO, + {_sSI: _cAGRo, _smith: None}, + (_u, _a, _aR, _ou, _as, _gC), + ( + (GUARDRAIL_USAGE, 1), + (GUARDRAIL_ACTION, 1), + (3, 0), + (GUARDRAIL_OUTPUT_CONTENT_LIST, 1), + (GUARDRAIL_ASSESSMENT_LIST, 1), + (GUARDRAIL_COVERAGE, 0), ), - members={ - "translation": {"target": GUARDRAIL_AUTOMATED_REASONING_TRANSLATION}, - "claimsTrueScenario": {"target": GUARDRAIL_AUTOMATED_REASONING_SCENARIO}, - "claimsFalseScenario": {"target": GUARDRAIL_AUTOMATED_REASONING_SCENARIO}, - "logicWarning": {"target": GUARDRAIL_AUTOMATED_REASONING_LOGIC_WARNING}, - }, -) - -GUARDRAIL_AUTOMATED_REASONING_TOO_COMPLEX_FINDING = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockruntime#GuardrailAutomatedReasoningTooComplexFinding" - ) ) -GUARDRAIL_AUTOMATED_REASONING_DIFFERENCE_SCENARIO_LIST = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockruntime#GuardrailAutomatedReasoningDifferenceScenarioList" +APPLY_GUARDRAIL: StaticOperationSchema = ( + 23, + n0, + _AG, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "POST", + "uri": "/guardrail/{guardrailIdentifier}/version/{guardrailVersion}/apply", + } + ) + }, + APPLY_GUARDRAIL_INPUT, + APPLY_GUARDRAIL_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + SERVICE_UNAVAILABLE_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, ), - shape_type=ShapeType.LIST, - members={"member": {"target": GUARDRAIL_AUTOMATED_REASONING_SCENARIO}}, ) -GUARDRAIL_AUTOMATED_REASONING_TRANSLATION_LIST = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockruntime#GuardrailAutomatedReasoningTranslationList" +GUARDRAIL_CHECKS_CONTENT_FILTER_CATEGORY: StaticSchema = ( + 14, + n0, + _GCCFC, + 0, + (_VIOLENCE, _HATE, _SEXUAL, _MISCONDUCT, _INSULTS), + ( + (-1, {_sV: _VIOLENCE}), + (-1, {_sV: _HATE}), + (-1, {_sV: _SEXUAL}), + (-1, {_sV: _MISCONDUCT}), + (-1, {_sV: _INSULTS}), ), - shape_type=ShapeType.LIST, - members={"member": {"target": GUARDRAIL_AUTOMATED_REASONING_TRANSLATION}}, ) -GUARDRAIL_AUTOMATED_REASONING_TRANSLATION_OPTION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockruntime#GuardrailAutomatedReasoningTranslationOption" +GUARDRAIL_CHECKS_CONTENT_FILTER_CATEGORY_CONFIG: StaticSchema = ( + 18, + n0, + _GCCFCC, + 0, + (_ca,), + ((GUARDRAIL_CHECKS_CONTENT_FILTER_CATEGORY, 1),), +) + +GUARDRAIL_CHECKS_CONTENT_FILTER_CATEGORY_CONFIG_LIST: StaticSchema = ( + 16, + n0, + _GCCFCCL, + 0, + (_me,), + ((GUARDRAIL_CHECKS_CONTENT_FILTER_CATEGORY_CONFIG, 0),), +) + +GUARDRAIL_CHECKS_CONTENT_FILTER_CONFIG: StaticSchema = ( + 18, + n0, + _GCCFCu, + 0, + (_cat,), + ((GUARDRAIL_CHECKS_CONTENT_FILTER_CATEGORY_CONFIG_LIST, 1),), +) + +GUARDRAIL_CHECKS_PROMPT_ATTACK_CATEGORY: StaticSchema = ( + 14, + n0, + _GCPAC, + 0, + (_JAILBREAK, _PI, _PL), + ((-1, {_sV: _JAILBREAK}), (-1, {_sV: _PI}), (-1, {_sV: _PL})), +) + +GUARDRAIL_CHECKS_PROMPT_ATTACK_CATEGORY_CONFIG: StaticSchema = ( + 18, + n0, + _GCPACC, + 0, + (_ca,), + ((GUARDRAIL_CHECKS_PROMPT_ATTACK_CATEGORY, 1),), +) + +GUARDRAIL_CHECKS_PROMPT_ATTACK_CATEGORY_CONFIG_LIST: StaticSchema = ( + 16, + n0, + _GCPACCL, + 0, + (_me,), + ((GUARDRAIL_CHECKS_PROMPT_ATTACK_CATEGORY_CONFIG, 0),), +) + +GUARDRAIL_CHECKS_PROMPT_ATTACK_CONFIG: StaticSchema = ( + 18, + n0, + _GCPACu, + 0, + (_cat,), + ((GUARDRAIL_CHECKS_PROMPT_ATTACK_CATEGORY_CONFIG_LIST, 1),), +) + +GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_ENTITY_TYPE: StaticSchema = ( + 14, + n0, + _GCSIET, + 0, + ( + _ADDRESS, + _AGE, + _AAK, + _ASK, + _CHN, + _CSIN, + _CDCC, + _CDCE, + _CDCN, + _DI, + _EMAIL, + _IBAN, + _IA_, + _LP, + _MA, + _NAME, + _PASSWORD, + _PHONE, + _PIN, + _SC, + _UNHSN, + _UNIN, + _UUTRN, + _URL, + _USERNAME, + _UBAN, + _UBRN, + _UITIN, + _UPN, + _USSN, + _VIN, ), - members={ - "translations": {"target": GUARDRAIL_AUTOMATED_REASONING_TRANSLATION_LIST} - }, -) - -GUARDRAIL_AUTOMATED_REASONING_TRANSLATION_OPTION_LIST = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockruntime#GuardrailAutomatedReasoningTranslationOptionList" + ( + (-1, {_sV: _ADDRESS}), + (-1, {_sV: _AGE}), + (-1, {_sV: _AAK}), + (-1, {_sV: _ASK}), + (-1, {_sV: _CHN}), + (-1, {_sV: _CSIN}), + (-1, {_sV: _CDCC}), + (-1, {_sV: _CDCE}), + (-1, {_sV: _CDCN}), + (-1, {_sV: _DI}), + (-1, {_sV: _EMAIL}), + (-1, {_sV: _IBAN}), + (-1, {_sV: _IA_}), + (-1, {_sV: _LP}), + (-1, {_sV: _MA}), + (-1, {_sV: _NAME}), + (-1, {_sV: _PASSWORD}), + (-1, {_sV: _PHONE}), + (-1, {_sV: _PIN}), + (-1, {_sV: _SC}), + (-1, {_sV: _UNHSN}), + (-1, {_sV: _UNIN}), + (-1, {_sV: _UUTRN}), + (-1, {_sV: _URL}), + (-1, {_sV: _USERNAME}), + (-1, {_sV: _UBAN}), + (-1, {_sV: _UBRN}), + (-1, {_sV: _UITIN}), + (-1, {_sV: _UPN}), + (-1, {_sV: _USSN}), + (-1, {_sV: _VIN}), ), - shape_type=ShapeType.LIST, - members={"member": {"target": GUARDRAIL_AUTOMATED_REASONING_TRANSLATION_OPTION}}, ) -GUARDRAIL_AUTOMATED_REASONING_TRANSLATION_AMBIGUOUS_FINDING = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockruntime#GuardrailAutomatedReasoningTranslationAmbiguousFinding" +GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_ENTITY_CONFIG: StaticSchema = ( + 18, + n0, + _GCSIEC, + 0, + (_ty,), + ((GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_ENTITY_TYPE, 1),), +) + +GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_ENTITY_CONFIG_LIST: StaticSchema = ( + 16, + n0, + _GCSIECL, + 0, + (_me,), + ((GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_ENTITY_CONFIG, 0),), +) + +GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_CONFIG: StaticSchema = ( + 18, + n0, + _GCSIC, + 0, + (_e,), + ((GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_ENTITY_CONFIG_LIST, 1),), +) + +GUARDRAIL_CHECKS_CONFIG: StaticSchema = ( + 18, + n0, + _GCC, + 0, + (_cF, _pA, _sI), + ( + (GUARDRAIL_CHECKS_CONTENT_FILTER_CONFIG, 0), + (GUARDRAIL_CHECKS_PROMPT_ATTACK_CONFIG, 0), + (GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_CONFIG, 0), ), - members={ - "options": {"target": GUARDRAIL_AUTOMATED_REASONING_TRANSLATION_OPTION_LIST}, - "differenceScenarios": { - "target": GUARDRAIL_AUTOMATED_REASONING_DIFFERENCE_SCENARIO_LIST - }, - }, -) - -GUARDRAIL_AUTOMATED_REASONING_VALID_FINDING = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailAutomatedReasoningValidFinding"), - members={ - "translation": {"target": GUARDRAIL_AUTOMATED_REASONING_TRANSLATION}, - "claimsTrueScenario": {"target": GUARDRAIL_AUTOMATED_REASONING_SCENARIO}, - "supportingRules": {"target": GUARDRAIL_AUTOMATED_REASONING_RULE_LIST}, - "logicWarning": {"target": GUARDRAIL_AUTOMATED_REASONING_LOGIC_WARNING}, - }, -) - -GUARDRAIL_AUTOMATED_REASONING_FINDING = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailAutomatedReasoningFinding"), - shape_type=ShapeType.UNION, - members={ - "valid": {"target": GUARDRAIL_AUTOMATED_REASONING_VALID_FINDING}, - "invalid": {"target": GUARDRAIL_AUTOMATED_REASONING_INVALID_FINDING}, - "satisfiable": {"target": GUARDRAIL_AUTOMATED_REASONING_SATISFIABLE_FINDING}, - "impossible": {"target": GUARDRAIL_AUTOMATED_REASONING_IMPOSSIBLE_FINDING}, - "translationAmbiguous": { - "target": GUARDRAIL_AUTOMATED_REASONING_TRANSLATION_AMBIGUOUS_FINDING - }, - "tooComplex": {"target": GUARDRAIL_AUTOMATED_REASONING_TOO_COMPLEX_FINDING}, - "noTranslations": { - "target": GUARDRAIL_AUTOMATED_REASONING_NO_TRANSLATIONS_FINDING - }, - }, -) - -GUARDRAIL_AUTOMATED_REASONING_FINDING_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailAutomatedReasoningFindingList"), - shape_type=ShapeType.LIST, - members={"member": {"target": GUARDRAIL_AUTOMATED_REASONING_FINDING}}, ) -GUARDRAIL_AUTOMATED_REASONING_POLICY_ASSESSMENT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockruntime#GuardrailAutomatedReasoningPolicyAssessment" +GUARDRAIL_CHECKS_TEXT_CONTENT: StaticSchema = (3, n0, _GCTC, 4) + +GUARDRAIL_CHECKS_CONTENT_BLOCK: StaticSchema = ( + 19, + n0, + _GCCB, + 0, + (_te,), + ((GUARDRAIL_CHECKS_TEXT_CONTENT, 0),), +) + +GUARDRAIL_CHECKS_CONTENT_BLOCK_LIST: StaticSchema = ( + 16, + n0, + _GCCBL, + 0, + (_me,), + ((GUARDRAIL_CHECKS_CONTENT_BLOCK, 0),), +) + +GUARDRAIL_CHECKS_ROLE: StaticSchema = ( + 14, + n0, + _GCR, + 0, + (_USER, _ASSISTANT, _SYSTEM), + ((-1, {_sV: _us}), (-1, {_sV: _ass}), (-1, {_sV: _sy})), +) + +GUARDRAIL_CHECKS_MESSAGE: StaticSchema = ( + 18, + n0, + _GCM, + 0, + (_ro, _co), + ((GUARDRAIL_CHECKS_ROLE, 1), (GUARDRAIL_CHECKS_CONTENT_BLOCK_LIST, 1)), +) + +GUARDRAIL_CHECKS_MESSAGE_LIST: StaticSchema = ( + 16, + n0, + _GCML, + 0, + (_me,), + ((GUARDRAIL_CHECKS_MESSAGE, 0),), +) + +INVOKE_GUARDRAIL_CHECKS_INPUT: StaticSchema = ( + 18, + n0, + _IGCI, + {_sSI: _cIGCR, _sm: None}, + (_mes, _ch), + ((GUARDRAIL_CHECKS_MESSAGE_LIST, 1), (GUARDRAIL_CHECKS_CONFIG, 1)), +) + +GUARDRAIL_CHECKS_CONTENT_FILTER_RESULT_ENTRY: StaticSchema = ( + 18, + n0, + _GCCFRE, + 0, + (_ca, _sS), + ((GUARDRAIL_CHECKS_CONTENT_FILTER_CATEGORY, 1), (10, 1)), +) + +GUARDRAIL_CHECKS_CONTENT_FILTER_RESULT_LIST: StaticSchema = ( + 16, + n0, + _GCCFRL, + 0, + (_me,), + ((GUARDRAIL_CHECKS_CONTENT_FILTER_RESULT_ENTRY, 0),), +) + +GUARDRAIL_CHECKS_CONTENT_FILTER_RESULT: StaticSchema = ( + 18, + n0, + _GCCFR, + 0, + (_res,), + ((GUARDRAIL_CHECKS_CONTENT_FILTER_RESULT_LIST, 1),), +) + +GUARDRAIL_CHECKS_PROMPT_ATTACK_RESULT_ENTRY: StaticSchema = ( + 18, + n0, + _GCPARE, + 0, + (_ca, _sS), + ((GUARDRAIL_CHECKS_PROMPT_ATTACK_CATEGORY, 1), (10, 1)), +) + +GUARDRAIL_CHECKS_PROMPT_ATTACK_RESULT_LIST: StaticSchema = ( + 16, + n0, + _GCPARL, + 0, + (_me,), + ((GUARDRAIL_CHECKS_PROMPT_ATTACK_RESULT_ENTRY, 0),), +) + +GUARDRAIL_CHECKS_PROMPT_ATTACK_RESULT: StaticSchema = ( + 18, + n0, + _GCPAR, + 0, + (_res,), + ((GUARDRAIL_CHECKS_PROMPT_ATTACK_RESULT_LIST, 1),), +) + +GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_RESULT_ENTRY: StaticSchema = ( + 18, + n0, + _GCSIRE, + 0, + (_ty, _cS, _bOe, _eO, _mIe, _cI), + ( + (GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_ENTITY_TYPE, 1), + (10, 1), + (7, 1), + (7, 1), + (7, 1), + (7, 1), ), - members={"findings": {"target": GUARDRAIL_AUTOMATED_REASONING_FINDING_LIST}}, -) - -GUARDRAIL_CONTENT_POLICY_ACTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailContentPolicyAction"), - shape_type=ShapeType.ENUM, - members={"BLOCKED": {"target": UNIT}, "NONE": {"target": UNIT}}, -) - -GUARDRAIL_CONTENT_FILTER_CONFIDENCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailContentFilterConfidence"), - shape_type=ShapeType.ENUM, - members={ - "NONE": {"target": UNIT}, - "LOW": {"target": UNIT}, - "MEDIUM": {"target": UNIT}, - "HIGH": {"target": UNIT}, - }, -) - -GUARDRAIL_CONTENT_FILTER_STRENGTH = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailContentFilterStrength"), - shape_type=ShapeType.ENUM, - members={ - "NONE": {"target": UNIT}, - "LOW": {"target": UNIT}, - "MEDIUM": {"target": UNIT}, - "HIGH": {"target": UNIT}, - }, -) - -GUARDRAIL_CONTENT_FILTER_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailContentFilterType"), - shape_type=ShapeType.ENUM, - members={ - "INSULTS": {"target": UNIT}, - "HATE": {"target": UNIT}, - "SEXUAL": {"target": UNIT}, - "VIOLENCE": {"target": UNIT}, - "MISCONDUCT": {"target": UNIT}, - "PROMPT_ATTACK": {"target": UNIT}, - }, -) - -GUARDRAIL_CONTENT_FILTER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailContentFilter"), - members={ - "type": { - "target": GUARDRAIL_CONTENT_FILTER_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "confidence": { - "target": GUARDRAIL_CONTENT_FILTER_CONFIDENCE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "filterStrength": {"target": GUARDRAIL_CONTENT_FILTER_STRENGTH}, - "action": { - "target": GUARDRAIL_CONTENT_POLICY_ACTION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "detected": {"target": BOOLEAN}, - }, -) - -GUARDRAIL_CONTENT_FILTER_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailContentFilterList"), - shape_type=ShapeType.LIST, - members={"member": {"target": GUARDRAIL_CONTENT_FILTER}}, -) - -GUARDRAIL_CONTENT_POLICY_ASSESSMENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailContentPolicyAssessment"), - members={ - "filters": { - "target": GUARDRAIL_CONTENT_FILTER_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -GUARDRAIL_CONTEXTUAL_GROUNDING_POLICY_ACTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailContextualGroundingPolicyAction"), - shape_type=ShapeType.ENUM, - members={"BLOCKED": {"target": UNIT}, "NONE": {"target": UNIT}}, -) - -GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailContextualGroundingFilterType"), - shape_type=ShapeType.ENUM, - members={"GROUNDING": {"target": UNIT}, "RELEVANCE": {"target": UNIT}}, -) - -GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailContextualGroundingFilter"), - members={ - "type": { - "target": GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "threshold": { - "target": DOUBLE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "score": { - "target": DOUBLE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "action": { - "target": GUARDRAIL_CONTEXTUAL_GROUNDING_POLICY_ACTION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "detected": {"target": BOOLEAN}, - }, -) - -GUARDRAIL_CONTEXTUAL_GROUNDING_FILTERS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailContextualGroundingFilters"), - shape_type=ShapeType.LIST, - members={"member": {"target": GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER}}, ) -GUARDRAIL_CONTEXTUAL_GROUNDING_POLICY_ASSESSMENT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockruntime#GuardrailContextualGroundingPolicyAssessment" +GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_RESULT_LIST: StaticSchema = ( + 16, + n0, + _GCSIRL, + 0, + (_me,), + ((GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_RESULT_ENTRY, 0),), +) + +GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_RESULT: StaticSchema = ( + 18, + n0, + _GCSIR, + 0, + (_res, _tru), + ((GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_RESULT_LIST, 1), (2, 0)), +) + +GUARDRAIL_CHECKS_RESULTS: StaticSchema = ( + 18, + n0, + _GCRu, + 0, + (_cF, _pA, _sI), + ( + (GUARDRAIL_CHECKS_CONTENT_FILTER_RESULT, 0), + (GUARDRAIL_CHECKS_PROMPT_ATTACK_RESULT, 0), + (GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_RESULT, 0), ), - members={"filters": {"target": GUARDRAIL_CONTEXTUAL_GROUNDING_FILTERS}}, -) - -IMAGES_GUARDED = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#ImagesGuarded"), - shape_type=ShapeType.INTEGER, -) - -IMAGES_TOTAL = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#ImagesTotal"), shape_type=ShapeType.INTEGER -) - -GUARDRAIL_IMAGE_COVERAGE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailImageCoverage"), - members={"guarded": {"target": IMAGES_GUARDED}, "total": {"target": IMAGES_TOTAL}}, -) - -TEXT_CHARACTERS_GUARDED = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#TextCharactersGuarded"), - shape_type=ShapeType.INTEGER, ) -TEXT_CHARACTERS_TOTAL = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#TextCharactersTotal"), - shape_type=ShapeType.INTEGER, +GUARDRAIL_CHECKS_CONTENT_FILTER_USAGE: StaticSchema = ( + 18, + n0, + _GCCFU, + 0, + (_tU,), + ((7, 1),), +) + +GUARDRAIL_CHECKS_PROMPT_ATTACK_USAGE: StaticSchema = ( + 18, + n0, + _GCPAU, + 0, + (_tU,), + ((7, 1),), +) + +GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_USAGE: StaticSchema = ( + 18, + n0, + _GCSIU, + 0, + (_tU,), + ((7, 1),), +) + +GUARDRAIL_CHECKS_USAGE_RESULTS: StaticSchema = ( + 18, + n0, + _GCUR, + 0, + (_cF, _pA, _sI), + ( + (GUARDRAIL_CHECKS_CONTENT_FILTER_USAGE, 0), + (GUARDRAIL_CHECKS_PROMPT_ATTACK_USAGE, 0), + (GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_USAGE, 0), + ), ) -GUARDRAIL_TEXT_CHARACTERS_COVERAGE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailTextCharactersCoverage"), - members={ - "guarded": {"target": TEXT_CHARACTERS_GUARDED}, - "total": {"target": TEXT_CHARACTERS_TOTAL}, - }, +INVOKE_GUARDRAIL_CHECKS_OUTPUT: StaticSchema = ( + 18, + n0, + _IGCO, + {_sSI: _cIGCRo, _smith: None}, + (_res, _u), + ((GUARDRAIL_CHECKS_RESULTS, 1), (GUARDRAIL_CHECKS_USAGE_RESULTS, 1)), ) -GUARDRAIL_COVERAGE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailCoverage"), - members={ - "textCharacters": {"target": GUARDRAIL_TEXT_CHARACTERS_COVERAGE}, - "images": {"target": GUARDRAIL_IMAGE_COVERAGE}, +INVOKE_GUARDRAIL_CHECKS: StaticOperationSchema = ( + 23, + n0, + _IGC, + { + _smithy: MappingProxyType( + {"code": 200, "method": "POST", "uri": "/guardrail-checks/invoke"} + ) }, -) - -GUARDRAIL_PROCESSING_LATENCY = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailProcessingLatency"), - shape_type=ShapeType.LONG, -) - -GUARDRAIL_AUTOMATED_REASONING_POLICIES_PROCESSED = Schema( - id=ShapeID( - "com.amazonaws.bedrockruntime#GuardrailAutomatedReasoningPoliciesProcessed" + INVOKE_GUARDRAIL_CHECKS_INPUT, + INVOKE_GUARDRAIL_CHECKS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + SERVICE_UNAVAILABLE_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, ), - shape_type=ShapeType.INTEGER, ) -GUARDRAIL_AUTOMATED_REASONING_POLICY_UNITS_PROCESSED = Schema( - id=ShapeID( - "com.amazonaws.bedrockruntime#GuardrailAutomatedReasoningPolicyUnitsProcessed" +GUARDRAIL_TRACE: StaticSchema = ( + 14, + n0, + _GTu, + 0, + (_ENABLED, _DISABLED, _EF), + ((-1, {_sV: _en}), (-1, {_sV: _di}), (-1, {_sV: _ef})), +) + +GUARDRAIL_CONFIGURATION: StaticSchema = ( + 18, + n0, + _GCua, + 0, + (_gI, _gV, _trac), + ( + (GUARDRAIL_IDENTIFIER, {_smithya: _v_}), + (GUARDRAIL_VERSION, {_smithya: _v_}), + (GUARDRAIL_TRACE, {_smithya: _di}), ), - shape_type=ShapeType.INTEGER, ) -GUARDRAIL_CONTENT_POLICY_IMAGE_UNITS_PROCESSED = Schema( - id=ShapeID( - "com.amazonaws.bedrockruntime#GuardrailContentPolicyImageUnitsProcessed" +NON_EMPTY_STRING: StaticSchema = (3, n0, _NES, 0) + +NON_EMPTY_STRING_LIST: StaticSchema = ( + 16, + n0, + _NESL, + 0, + (_me,), + ((NON_EMPTY_STRING, 0),), +) + +INFERENCE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _IC, + 0, + (_mT, _tem, _tPo, _sSt), + ((7, 0), (9, 0), (9, 0), (NON_EMPTY_STRING_LIST, 0)), +) + +ERROR_BLOCK: StaticSchema = (18, n0, _EB, 4, (_m,), ((3, 0),)) + +AUDIO_FORMAT: StaticSchema = ( + 14, + n0, + _AFu, + 0, + ( + _MP, + _OPUS, + _WAV, + _AAC, + _FLAC, + _MP_, + _OGG, + _MKV, + _MKA, + _XA, + _MA_, + _MPEG, + _MPGA, + _PCM, + _WEBM, ), - shape_type=ShapeType.INTEGER, -) - -GUARDRAIL_CONTENT_POLICY_UNITS_PROCESSED = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailContentPolicyUnitsProcessed"), - shape_type=ShapeType.INTEGER, -) - -GUARDRAIL_CONTEXTUAL_GROUNDING_POLICY_UNITS_PROCESSED = Schema( - id=ShapeID( - "com.amazonaws.bedrockruntime#GuardrailContextualGroundingPolicyUnitsProcessed" + ( + (-1, {_sV: _mp}), + (-1, {_sV: _op}), + (-1, {_sV: _w}), + (-1, {_sV: _aa}), + (-1, {_sV: _fl}), + (-1, {_sV: _mp_}), + (-1, {_sV: _og}), + (-1, {_sV: _mk}), + (-1, {_sV: _mka}), + (-1, {_sV: _xa}), + (-1, {_sV: _ma_}), + (-1, {_sV: _mpe}), + (-1, {_sV: _mpg}), + (-1, {_sV: _pc}), + (-1, {_sV: _we}), ), - shape_type=ShapeType.INTEGER, ) -GUARDRAIL_SENSITIVE_INFORMATION_POLICY_FREE_UNITS_PROCESSED = Schema( - id=ShapeID( - "com.amazonaws.bedrockruntime#GuardrailSensitiveInformationPolicyFreeUnitsProcessed" +S3_LOCATION: StaticSchema = (18, n0, _SL, 0, (_ur, _bO), ((S3_URI, 1), (ACCOUNT_ID, 0))) + +AUDIO_SOURCE: StaticSchema = (19, n0, _AS, 4, (_b, _sLo), ((1, 0), (S3_LOCATION, 0))) + +AUDIO_BLOCK: StaticSchema = ( + 18, + n0, + _AB, + 0, + (_f, _so, _er), + ((AUDIO_FORMAT, 1), (AUDIO_SOURCE, 1), (ERROR_BLOCK, 0)), +) + +CACHE_TTL: StaticSchema = ( + 14, + n0, + _CTTL, + 0, + (_FM, _OH), + ((-1, {_sV: _m_}), (-1, {_sV: _h})), +) + +CACHE_POINT_TYPE: StaticSchema = (14, n0, _CPT, 0, (_DEFAULT,), ((-1, {_sV: _de}),)) + +CACHE_POINT_BLOCK: StaticSchema = ( + 18, + n0, + _CPB, + 0, + (_ty, _tt), + ((CACHE_POINT_TYPE, 1), (CACHE_TTL, 0)), +) + +DOCUMENT_CHAR_LOCATION: StaticSchema = ( + 18, + n0, + _DCL, + 0, + (_dI, _star, _end), + ((7, 0), (7, 0), (7, 0)), +) + +DOCUMENT_CHUNK_LOCATION: StaticSchema = ( + 18, + n0, + _DCLo, + 0, + (_dI, _star, _end), + ((7, 0), (7, 0), (7, 0)), +) + +DOCUMENT_PAGE_LOCATION: StaticSchema = ( + 18, + n0, + _DPL, + 0, + (_dI, _star, _end), + ((7, 0), (7, 0), (7, 0)), +) + +SEARCH_RESULT_LOCATION: StaticSchema = ( + 18, + n0, + _SRL, + 0, + (_sRI, _star, _end), + ((7, 0), (7, 0), (7, 0)), +) + +WEB_LOCATION: StaticSchema = (18, n0, _WL, 0, (_url, _do), ((3, 0), (3, 0))) + +CITATION_LOCATION: StaticSchema = ( + 19, + n0, + _CL, + 0, + (_web, _dC, _dP, _dCo, _sRL), + ( + (WEB_LOCATION, 0), + (DOCUMENT_CHAR_LOCATION, 0), + (DOCUMENT_PAGE_LOCATION, 0), + (DOCUMENT_CHUNK_LOCATION, 0), + (SEARCH_RESULT_LOCATION, 0), ), - shape_type=ShapeType.INTEGER, ) -GUARDRAIL_SENSITIVE_INFORMATION_POLICY_UNITS_PROCESSED = Schema( - id=ShapeID( - "com.amazonaws.bedrockruntime#GuardrailSensitiveInformationPolicyUnitsProcessed" +CITATION_SOURCE_CONTENT: StaticSchema = (19, n0, _CSC, 0, (_te,), ((3, 0),)) + +CITATION_SOURCE_CONTENT_LIST: StaticSchema = ( + 16, + n0, + _CSCL, + 0, + (_me,), + ((CITATION_SOURCE_CONTENT, 0),), +) + +CITATION: StaticSchema = ( + 18, + n0, + _Ci, + 0, + (_ti, _so, _sC, _lo), + ((3, 0), (3, 0), (CITATION_SOURCE_CONTENT_LIST, 0), (CITATION_LOCATION, 0)), +) + +CITATIONS: StaticSchema = (16, n0, _Cit, 0, (_me,), ((CITATION, 0),)) + +CITATION_GENERATED_CONTENT: StaticSchema = (19, n0, _CGC, 0, (_te,), ((3, 0),)) + +CITATION_GENERATED_CONTENT_LIST: StaticSchema = ( + 16, + n0, + _CGCL, + 0, + (_me,), + ((CITATION_GENERATED_CONTENT, 0),), +) + +CITATIONS_CONTENT_BLOCK: StaticSchema = ( + 18, + n0, + _CCB, + 0, + (_co, _ci), + ((CITATION_GENERATED_CONTENT_LIST, 0), (CITATIONS, 0)), +) + +CITATIONS_CONFIG: StaticSchema = (18, n0, _CC, 0, (_en,), ((2, 1),)) + +DOCUMENT_FORMAT: StaticSchema = ( + 14, + n0, + _DF, + 0, + (_PDF, _CSV, _DOC, _DOCX, _XLS, _XLSX, _HTML, _TXT, _MD), + ( + (-1, {_sV: _pd}), + (-1, {_sV: _cs}), + (-1, {_sV: _doc}), + (-1, {_sV: _docx}), + (-1, {_sV: _x}), + (-1, {_sV: _xl}), + (-1, {_sV: _ht}), + (-1, {_sV: _tx}), + (-1, {_sV: _md}), ), - shape_type=ShapeType.INTEGER, -) - -GUARDRAIL_TOPIC_POLICY_UNITS_PROCESSED = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailTopicPolicyUnitsProcessed"), - shape_type=ShapeType.INTEGER, -) - -GUARDRAIL_WORD_POLICY_UNITS_PROCESSED = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailWordPolicyUnitsProcessed"), - shape_type=ShapeType.INTEGER, -) - -GUARDRAIL_USAGE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailUsage"), - members={ - "topicPolicyUnits": { - "target": GUARDRAIL_TOPIC_POLICY_UNITS_PROCESSED, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "contentPolicyUnits": { - "target": GUARDRAIL_CONTENT_POLICY_UNITS_PROCESSED, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "wordPolicyUnits": { - "target": GUARDRAIL_WORD_POLICY_UNITS_PROCESSED, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "sensitiveInformationPolicyUnits": { - "target": GUARDRAIL_SENSITIVE_INFORMATION_POLICY_UNITS_PROCESSED, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "sensitiveInformationPolicyFreeUnits": { - "target": GUARDRAIL_SENSITIVE_INFORMATION_POLICY_FREE_UNITS_PROCESSED, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "contextualGroundingPolicyUnits": { - "target": GUARDRAIL_CONTEXTUAL_GROUNDING_POLICY_UNITS_PROCESSED, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "contentPolicyImageUnits": { - "target": GUARDRAIL_CONTENT_POLICY_IMAGE_UNITS_PROCESSED - }, - "automatedReasoningPolicyUnits": { - "target": GUARDRAIL_AUTOMATED_REASONING_POLICY_UNITS_PROCESSED - }, - "automatedReasoningPolicies": { - "target": GUARDRAIL_AUTOMATED_REASONING_POLICIES_PROCESSED - }, - }, -) - -GUARDRAIL_INVOCATION_METRICS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailInvocationMetrics"), - members={ - "guardrailProcessingLatency": {"target": GUARDRAIL_PROCESSING_LATENCY}, - "usage": {"target": GUARDRAIL_USAGE}, - "guardrailCoverage": {"target": GUARDRAIL_COVERAGE}, - }, ) -GUARDRAIL_SENSITIVE_INFORMATION_POLICY_ACTION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockruntime#GuardrailSensitiveInformationPolicyAction" +DOCUMENT_CONTENT_BLOCK: StaticSchema = (19, n0, _DCB, 0, (_te,), ((3, 0),)) + +DOCUMENT_CONTENT_BLOCKS: StaticSchema = ( + 16, + n0, + _DCBo, + 0, + (_me,), + ((DOCUMENT_CONTENT_BLOCK, 0),), +) + +DOCUMENT_SOURCE: StaticSchema = ( + 19, + n0, + _DS, + 0, + (_b, _sLo, _te, _co), + ((1, 0), (S3_LOCATION, 0), (3, 0), (DOCUMENT_CONTENT_BLOCKS, 0)), +) + +DOCUMENT_BLOCK: StaticSchema = ( + 18, + n0, + _DB, + 0, + (_f, _n, _so, _cont, _ci), + ( + (DOCUMENT_FORMAT, {_smithya: _tx}), + (3, 1), + (DOCUMENT_SOURCE, 1), + (3, 0), + (CITATIONS_CONFIG, 0), ), - shape_type=ShapeType.ENUM, - members={ - "ANONYMIZED": {"target": UNIT}, - "BLOCKED": {"target": UNIT}, - "NONE": {"target": UNIT}, - }, -) - -GUARDRAIL_PII_ENTITY_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailPiiEntityType"), - shape_type=ShapeType.ENUM, - members={ - "ADDRESS": {"target": UNIT}, - "AGE": {"target": UNIT}, - "AWS_ACCESS_KEY": {"target": UNIT}, - "AWS_SECRET_KEY": {"target": UNIT}, - "CA_HEALTH_NUMBER": {"target": UNIT}, - "CA_SOCIAL_INSURANCE_NUMBER": {"target": UNIT}, - "CREDIT_DEBIT_CARD_CVV": {"target": UNIT}, - "CREDIT_DEBIT_CARD_EXPIRY": {"target": UNIT}, - "CREDIT_DEBIT_CARD_NUMBER": {"target": UNIT}, - "DRIVER_ID": {"target": UNIT}, - "EMAIL": {"target": UNIT}, - "INTERNATIONAL_BANK_ACCOUNT_NUMBER": {"target": UNIT}, - "IP_ADDRESS": {"target": UNIT}, - "LICENSE_PLATE": {"target": UNIT}, - "MAC_ADDRESS": {"target": UNIT}, - "NAME": {"target": UNIT}, - "PASSWORD": {"target": UNIT}, - "PHONE": {"target": UNIT}, - "PIN": {"target": UNIT}, - "SWIFT_CODE": {"target": UNIT}, - "UK_NATIONAL_HEALTH_SERVICE_NUMBER": {"target": UNIT}, - "UK_NATIONAL_INSURANCE_NUMBER": {"target": UNIT}, - "UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER": {"target": UNIT}, - "URL": {"target": UNIT}, - "USERNAME": {"target": UNIT}, - "US_BANK_ACCOUNT_NUMBER": {"target": UNIT}, - "US_BANK_ROUTING_NUMBER": {"target": UNIT}, - "US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER": {"target": UNIT}, - "US_PASSPORT_NUMBER": {"target": UNIT}, - "US_SOCIAL_SECURITY_NUMBER": {"target": UNIT}, - "VEHICLE_IDENTIFICATION_NUMBER": {"target": UNIT}, - }, ) -GUARDRAIL_PII_ENTITY_FILTER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailPiiEntityFilter"), - members={ - "match": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "type": { - "target": GUARDRAIL_PII_ENTITY_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "action": { - "target": GUARDRAIL_SENSITIVE_INFORMATION_POLICY_ACTION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "detected": {"target": BOOLEAN}, - }, +GUARDRAIL_CONVERSE_IMAGE_FORMAT: StaticSchema = ( + 14, + n0, + _GCIF, + 0, + (_PNG, _JPEG), + ((-1, {_sV: _p}), (-1, {_sV: _j})), ) -GUARDRAIL_PII_ENTITY_FILTER_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailPiiEntityFilterList"), - shape_type=ShapeType.LIST, - members={"member": {"target": GUARDRAIL_PII_ENTITY_FILTER}}, -) +GUARDRAIL_CONVERSE_IMAGE_SOURCE: StaticSchema = (19, n0, _GCIS, 4, (_b,), ((1, 0),)) -GUARDRAIL_REGEX_FILTER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailRegexFilter"), - members={ - "name": {"target": STRING}, - "match": {"target": STRING}, - "regex": {"target": STRING}, - "action": { - "target": GUARDRAIL_SENSITIVE_INFORMATION_POLICY_ACTION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "detected": {"target": BOOLEAN}, - }, +GUARDRAIL_CONVERSE_IMAGE_BLOCK: StaticSchema = ( + 18, + n0, + _GCIB, + 4, + (_f, _so), + ((GUARDRAIL_CONVERSE_IMAGE_FORMAT, 1), (GUARDRAIL_CONVERSE_IMAGE_SOURCE, 1)), ) -GUARDRAIL_REGEX_FILTER_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailRegexFilterList"), - shape_type=ShapeType.LIST, - members={"member": {"target": GUARDRAIL_REGEX_FILTER}}, +GUARDRAIL_CONVERSE_CONTENT_QUALIFIER: StaticSchema = ( + 14, + n0, + _GCCQ, + 0, + (_GS, _QUERY, _GC), + ((-1, {_sV: _gs}), (-1, {_sV: _q}), (-1, {_sV: _gc})), ) -GUARDRAIL_SENSITIVE_INFORMATION_POLICY_ASSESSMENT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockruntime#GuardrailSensitiveInformationPolicyAssessment" +GUARDRAIL_CONVERSE_CONTENT_QUALIFIER_LIST: StaticSchema = ( + 16, + n0, + _GCCQL, + 0, + (_me,), + ((GUARDRAIL_CONVERSE_CONTENT_QUALIFIER, 0),), +) + +GUARDRAIL_CONVERSE_TEXT_BLOCK: StaticSchema = ( + 18, + n0, + _GCTB, + 0, + (_te, _qu), + ((3, 1), (GUARDRAIL_CONVERSE_CONTENT_QUALIFIER_LIST, 0)), +) + +GUARDRAIL_CONVERSE_CONTENT_BLOCK: StaticSchema = ( + 19, + n0, + _GCCBu, + 0, + (_te, _i), + ((GUARDRAIL_CONVERSE_TEXT_BLOCK, 0), (GUARDRAIL_CONVERSE_IMAGE_BLOCK, 0)), +) + +IMAGE_FORMAT: StaticSchema = ( + 14, + n0, + _IF, + 0, + (_PNG, _JPEG, _GIF_, _WEBP), + ((-1, {_sV: _p}), (-1, {_sV: _j}), (-1, {_sV: _gi}), (-1, {_sV: _webp})), +) + +IMAGE_SOURCE: StaticSchema = (19, n0, _IS, 4, (_b, _sLo), ((1, 0), (S3_LOCATION, 0))) + +IMAGE_BLOCK: StaticSchema = ( + 18, + n0, + _IB, + 0, + (_f, _so, _er), + ((IMAGE_FORMAT, 1), (IMAGE_SOURCE, 1), (ERROR_BLOCK, 0)), +) + +REASONING_TEXT_BLOCK: StaticSchema = (18, n0, _RTB, 4, (_te, _si), ((3, 1), (3, 0))) + +REASONING_CONTENT_BLOCK: StaticSchema = ( + 19, + n0, + _RCB, + 4, + (_rT, _rC), + ((REASONING_TEXT_BLOCK, 0), (1, 0)), +) + +SEARCH_RESULT_CONTENT_BLOCK: StaticSchema = (18, n0, _SRCB, 0, (_te,), ((3, 1),)) + +SEARCH_RESULT_CONTENT_BLOCKS: StaticSchema = ( + 16, + n0, + _SRCBe, + 0, + (_me,), + ((SEARCH_RESULT_CONTENT_BLOCK, 0),), +) + +SEARCH_RESULT_BLOCK: StaticSchema = ( + 18, + n0, + _SRB, + 0, + (_so, _ti, _co, _ci), + ((3, 1), (3, 1), (SEARCH_RESULT_CONTENT_BLOCKS, 1), (CITATIONS_CONFIG, 0)), +) + +TOOL_REFERENCE: StaticSchema = ( + 18, + n0, + _TR, + 0, + (_ty, _n, _sN), + ((3, 0), (3, 0), (3, 0)), +) + +TOOL_ADDITION_BLOCK: StaticSchema = (18, n0, _TAB, 0, (_too,), ((TOOL_REFERENCE, 1),)) + +TOOL_REMOVAL_BLOCK: StaticSchema = (18, n0, _TRB, 0, (_too,), ((TOOL_REFERENCE, 1),)) + +VIDEO_FORMAT: StaticSchema = ( + 14, + n0, + _VF, + 0, + (_MKV, _MOV, _MP_, _WEBM, _FLV, _MPEG, _MPG, _WMV, _TG), + ( + (-1, {_sV: _mk}), + (-1, {_sV: _mo}), + (-1, {_sV: _mp_}), + (-1, {_sV: _we}), + (-1, {_sV: _flv}), + (-1, {_sV: _mpe}), + (-1, {_sV: _mpg_}), + (-1, {_sV: _wm}), + (-1, {_sV: _tg}), ), - members={ - "piiEntities": { - "target": GUARDRAIL_PII_ENTITY_FILTER_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "regexes": { - "target": GUARDRAIL_REGEX_FILTER_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -GUARDRAIL_TOPIC_POLICY_ACTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailTopicPolicyAction"), - shape_type=ShapeType.ENUM, - members={"BLOCKED": {"target": UNIT}, "NONE": {"target": UNIT}}, -) - -GUARDRAIL_TOPIC_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailTopicType"), - shape_type=ShapeType.ENUM, - members={"DENY": {"target": UNIT}}, -) - -GUARDRAIL_TOPIC = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailTopic"), - members={ - "name": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "type": { - "target": GUARDRAIL_TOPIC_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "action": { - "target": GUARDRAIL_TOPIC_POLICY_ACTION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "detected": {"target": BOOLEAN}, - }, -) - -GUARDRAIL_TOPIC_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailTopicList"), - shape_type=ShapeType.LIST, - members={"member": {"target": GUARDRAIL_TOPIC}}, -) - -GUARDRAIL_TOPIC_POLICY_ASSESSMENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailTopicPolicyAssessment"), - members={ - "topics": { - "target": GUARDRAIL_TOPIC_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, ) -GUARDRAIL_WORD_POLICY_ACTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailWordPolicyAction"), - shape_type=ShapeType.ENUM, - members={"BLOCKED": {"target": UNIT}, "NONE": {"target": UNIT}}, -) - -GUARDRAIL_CUSTOM_WORD = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailCustomWord"), - members={ - "match": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "action": { - "target": GUARDRAIL_WORD_POLICY_ACTION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "detected": {"target": BOOLEAN}, - }, +VIDEO_SOURCE: StaticSchema = (19, n0, _VS, 0, (_b, _sLo), ((1, 0), (S3_LOCATION, 0))) + +VIDEO_BLOCK: StaticSchema = ( + 18, + n0, + _VB, + 0, + (_f, _so), + ((VIDEO_FORMAT, 1), (VIDEO_SOURCE, 1)), +) + +TOOL_RESULT_CONTENT_BLOCK: StaticSchema = ( + 19, + n0, + _TRCB, + 0, + (_js, _te, _i, _docu, _vi, _sRe), + ( + (13, 0), + (3, 0), + (IMAGE_BLOCK, 0), + (DOCUMENT_BLOCK, 0), + (VIDEO_BLOCK, 0), + (SEARCH_RESULT_BLOCK, 0), + ), ) -GUARDRAIL_CUSTOM_WORD_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailCustomWordList"), - shape_type=ShapeType.LIST, - members={"member": {"target": GUARDRAIL_CUSTOM_WORD}}, -) - -GUARDRAIL_MANAGED_WORD_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailManagedWordType"), - shape_type=ShapeType.ENUM, - members={"PROFANITY": {"target": UNIT}}, -) - -GUARDRAIL_MANAGED_WORD = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailManagedWord"), - members={ - "match": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "type": { - "target": GUARDRAIL_MANAGED_WORD_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "action": { - "target": GUARDRAIL_WORD_POLICY_ACTION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "detected": {"target": BOOLEAN}, - }, +TOOL_RESULT_CONTENT_BLOCKS: StaticSchema = ( + 16, + n0, + _TRCBo, + 0, + (_me,), + ((TOOL_RESULT_CONTENT_BLOCK, 0),), +) + +TOOL_RESULT_STATUS: StaticSchema = ( + 14, + n0, + _TRS, + 0, + (_SUCCESS, _ERROR), + ((-1, {_sV: _su}), (-1, {_sV: _er})), +) + +TOOL_USE_ID: StaticSchema = (3, n0, _TUI, 0) + +TOOL_RESULT_BLOCK: StaticSchema = ( + 18, + n0, + _TRBo, + 0, + (_tUI, _co, _st, _ty), + ( + (TOOL_USE_ID, 1), + (TOOL_RESULT_CONTENT_BLOCKS, 1), + (TOOL_RESULT_STATUS, 0), + (3, 0), + ), ) -GUARDRAIL_MANAGED_WORD_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailManagedWordList"), - shape_type=ShapeType.LIST, - members={"member": {"target": GUARDRAIL_MANAGED_WORD}}, +TOOL_NAME: StaticSchema = (3, n0, _TN, 0) + +TOOL_USE_TYPE: StaticSchema = (14, n0, _TUT, 0, (_STU,), ((-1, {_sV: _stu}),)) + +TOOL_USE_BLOCK: StaticSchema = ( + 18, + n0, + _TUB, + 0, + (_tUI, _n, _inp, _ty), + ((TOOL_USE_ID, 1), (TOOL_NAME, 1), (13, 1), (TOOL_USE_TYPE, 0)), +) + +CONTENT_BLOCK: StaticSchema = ( + 19, + n0, + _CB, + 0, + (_te, _i, _docu, _vi, _au, _tUo, _tR, _gCu, _cPa, _rCe, _cC, _sRe, _tAo, _tRo), + ( + (3, 0), + (IMAGE_BLOCK, 0), + (DOCUMENT_BLOCK, 0), + (VIDEO_BLOCK, 0), + (AUDIO_BLOCK, 0), + (TOOL_USE_BLOCK, 0), + (TOOL_RESULT_BLOCK, 0), + (GUARDRAIL_CONVERSE_CONTENT_BLOCK, 0), + (CACHE_POINT_BLOCK, 0), + (REASONING_CONTENT_BLOCK, 0), + (CITATIONS_CONTENT_BLOCK, 0), + (SEARCH_RESULT_BLOCK, 0), + (TOOL_ADDITION_BLOCK, 0), + (TOOL_REMOVAL_BLOCK, 0), + ), ) -GUARDRAIL_WORD_POLICY_ASSESSMENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailWordPolicyAssessment"), - members={ - "customWords": { - "target": GUARDRAIL_CUSTOM_WORD_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "managedWordLists": { - "target": GUARDRAIL_MANAGED_WORD_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +CONTENT_BLOCKS: StaticSchema = (16, n0, _CBo, 0, (_me,), ((CONTENT_BLOCK, 0),)) -GUARDRAIL_ASSESSMENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailAssessment"), - members={ - "topicPolicy": {"target": GUARDRAIL_TOPIC_POLICY_ASSESSMENT}, - "contentPolicy": {"target": GUARDRAIL_CONTENT_POLICY_ASSESSMENT}, - "wordPolicy": {"target": GUARDRAIL_WORD_POLICY_ASSESSMENT}, - "sensitiveInformationPolicy": { - "target": GUARDRAIL_SENSITIVE_INFORMATION_POLICY_ASSESSMENT - }, - "contextualGroundingPolicy": { - "target": GUARDRAIL_CONTEXTUAL_GROUNDING_POLICY_ASSESSMENT - }, - "automatedReasoningPolicy": { - "target": GUARDRAIL_AUTOMATED_REASONING_POLICY_ASSESSMENT - }, - "invocationMetrics": {"target": GUARDRAIL_INVOCATION_METRICS}, - "appliedGuardrailDetails": {"target": APPLIED_GUARDRAIL_DETAILS}, - }, +CONVERSATION_ROLE: StaticSchema = ( + 14, + n0, + _CR, + 0, + (_USER, _ASSISTANT, _SYSTEM), + ((-1, {_sV: _us}), (-1, {_sV: _ass}), (-1, {_sV: _sy})), ) -GUARDRAIL_ASSESSMENT_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailAssessmentList"), - shape_type=ShapeType.LIST, - members={"member": {"target": GUARDRAIL_ASSESSMENT}}, +MESSAGE: StaticSchema = ( + 18, + n0, + _M, + 0, + (_ro, _co), + ((CONVERSATION_ROLE, 1), (CONTENT_BLOCKS, 1)), ) -GUARDRAIL_OUTPUT_TEXT = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailOutputText"), - shape_type=ShapeType.STRING, -) +MESSAGES: StaticSchema = (16, n0, _Me, 0, (_me,), ((MESSAGE, 0),)) -GUARDRAIL_OUTPUT_CONTENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailOutputContent"), - members={"text": {"target": GUARDRAIL_OUTPUT_TEXT}}, -) +CONVERSATIONAL_MODEL_ID: StaticSchema = (3, n0, _CMI, 0) -GUARDRAIL_OUTPUT_CONTENT_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailOutputContentList"), - shape_type=ShapeType.LIST, - members={"member": {"target": GUARDRAIL_OUTPUT_CONTENT}}, +JSON_SCHEMA_DEFINITION: StaticSchema = ( + 18, + n0, + _JSD, + 0, + (_sch, _n, _des), + ((3, 1), (3, 0), (3, 0)), ) -APPLY_GUARDRAIL_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ApplyGuardrailOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockruntime#ApplyGuardrailResponse", - ) - ], - members={ - "usage": { - "target": GUARDRAIL_USAGE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "action": { - "target": GUARDRAIL_ACTION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "actionReason": {"target": STRING}, - "outputs": { - "target": GUARDRAIL_OUTPUT_CONTENT_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "assessments": { - "target": GUARDRAIL_ASSESSMENT_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "guardrailCoverage": {"target": GUARDRAIL_COVERAGE}, - }, +OUTPUT_FORMAT_STRUCTURE: StaticSchema = ( + 19, + n0, + _OFS, + 4, + (_jS,), + ((JSON_SCHEMA_DEFINITION, 0),), ) -APPLY_GUARDRAIL = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#ApplyGuardrail"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "POST", - "uri": "/guardrail/{guardrailIdentifier}/version/{guardrailVersion}/apply", - } - ), - ) - ], -) - -GUARDRAIL_CHECKS_CONTENT_FILTER_CATEGORY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailChecksContentFilterCategory"), - shape_type=ShapeType.ENUM, - members={ - "VIOLENCE": {"target": UNIT}, - "HATE": {"target": UNIT}, - "SEXUAL": {"target": UNIT}, - "MISCONDUCT": {"target": UNIT}, - "INSULTS": {"target": UNIT}, - }, -) +OUTPUT_FORMAT_TYPE: StaticSchema = (14, n0, _OFT, 0, (_JS,), ((-1, {_sV: _js_}),)) -GUARDRAIL_CHECKS_CONTENT_FILTER_CATEGORY_CONFIG = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockruntime#GuardrailChecksContentFilterCategoryConfig" - ), - members={ - "category": { - "target": GUARDRAIL_CHECKS_CONTENT_FILTER_CATEGORY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +OUTPUT_FORMAT: StaticSchema = ( + 18, + n0, + _OF, + 0, + (_ty, _str), + ((OUTPUT_FORMAT_TYPE, 1), (OUTPUT_FORMAT_STRUCTURE, 1)), ) -GUARDRAIL_CHECKS_CONTENT_FILTER_CATEGORY_CONFIG_LIST = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockruntime#GuardrailChecksContentFilterCategoryConfigList" - ), - shape_type=ShapeType.LIST, - members={"member": {"target": GUARDRAIL_CHECKS_CONTENT_FILTER_CATEGORY_CONFIG}}, +OUTPUT_CONFIG: StaticSchema = ( + 18, + n0, + _OC, + 0, + (_tF, _eff), + ((OUTPUT_FORMAT, 0), (3, 0)), ) -GUARDRAIL_CHECKS_CONTENT_FILTER_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailChecksContentFilterConfig"), - members={ - "categories": { - "target": GUARDRAIL_CHECKS_CONTENT_FILTER_CATEGORY_CONFIG_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +PERFORMANCE_CONFIG_LATENCY: StaticSchema = ( + 14, + n0, + _PCL, + 0, + (_STANDARD, _OPTIMIZED), + ((-1, {_sV: _stan}), (-1, {_sV: _opt})), ) -GUARDRAIL_CHECKS_PROMPT_ATTACK_CATEGORY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailChecksPromptAttackCategory"), - shape_type=ShapeType.ENUM, - members={ - "JAILBREAK": {"target": UNIT}, - "PROMPT_INJECTION": {"target": UNIT}, - "PROMPT_LEAKAGE": {"target": UNIT}, - }, +PERFORMANCE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _PC, + 0, + (_la,), + ((PERFORMANCE_CONFIG_LATENCY, {_smithya: _stan}),), ) -GUARDRAIL_CHECKS_PROMPT_ATTACK_CATEGORY_CONFIG = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockruntime#GuardrailChecksPromptAttackCategoryConfig" - ), - members={ - "category": { - "target": GUARDRAIL_CHECKS_PROMPT_ATTACK_CATEGORY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +PROMPT_VARIABLE_VALUES: StaticSchema = (19, n0, _PVV, 0, (_te,), ((3, 0),)) -GUARDRAIL_CHECKS_PROMPT_ATTACK_CATEGORY_CONFIG_LIST = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockruntime#GuardrailChecksPromptAttackCategoryConfigList" - ), - shape_type=ShapeType.LIST, - members={"member": {"target": GUARDRAIL_CHECKS_PROMPT_ATTACK_CATEGORY_CONFIG}}, +PROMPT_VARIABLE_MAP: StaticSchema = ( + 17, + n0, + _PVM, + 4, + (_k, _v), + ((3, 0), (PROMPT_VARIABLE_VALUES, 0)), ) -GUARDRAIL_CHECKS_PROMPT_ATTACK_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailChecksPromptAttackConfig"), - members={ - "categories": { - "target": GUARDRAIL_CHECKS_PROMPT_ATTACK_CATEGORY_CONFIG_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +REQUEST_METADATA: StaticSchema = (17, n0, _RM, 4, (_k, _v), ((3, 0), (3, 0))) -GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_ENTITY_TYPE = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockruntime#GuardrailChecksSensitiveInformationEntityType" +SERVICE_TIER_TYPE: StaticSchema = ( + 14, + n0, + _STT, + 0, + (_PRIORITY, _DEFAULT, _FLEX, _RESERVED), + ((-1, {_sV: _pri}), (-1, {_sV: _de}), (-1, {_sV: _fle}), (-1, {_sV: _rese})), +) + +SERVICE_TIER: StaticSchema = (18, n0, _STe, 0, (_ty,), ((SERVICE_TIER_TYPE, 1),)) + +SYSTEM_CONTENT_BLOCK: StaticSchema = ( + 19, + n0, + _SCB, + 0, + (_te, _gCu, _cPa), + ( + (NON_EMPTY_STRING, 0), + (GUARDRAIL_CONVERSE_CONTENT_BLOCK, 0), + (CACHE_POINT_BLOCK, 0), ), - shape_type=ShapeType.ENUM, - members={ - "ADDRESS": {"target": UNIT}, - "AGE": {"target": UNIT}, - "AWS_ACCESS_KEY": {"target": UNIT}, - "AWS_SECRET_KEY": {"target": UNIT}, - "CA_HEALTH_NUMBER": {"target": UNIT}, - "CA_SOCIAL_INSURANCE_NUMBER": {"target": UNIT}, - "CREDIT_DEBIT_CARD_CVV": {"target": UNIT}, - "CREDIT_DEBIT_CARD_EXPIRY": {"target": UNIT}, - "CREDIT_DEBIT_CARD_NUMBER": {"target": UNIT}, - "DRIVER_ID": {"target": UNIT}, - "EMAIL": {"target": UNIT}, - "INTERNATIONAL_BANK_ACCOUNT_NUMBER": {"target": UNIT}, - "IP_ADDRESS": {"target": UNIT}, - "LICENSE_PLATE": {"target": UNIT}, - "MAC_ADDRESS": {"target": UNIT}, - "NAME": {"target": UNIT}, - "PASSWORD": {"target": UNIT}, - "PHONE": {"target": UNIT}, - "PIN": {"target": UNIT}, - "SWIFT_CODE": {"target": UNIT}, - "UK_NATIONAL_HEALTH_SERVICE_NUMBER": {"target": UNIT}, - "UK_NATIONAL_INSURANCE_NUMBER": {"target": UNIT}, - "UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER": {"target": UNIT}, - "URL": {"target": UNIT}, - "USERNAME": {"target": UNIT}, - "US_BANK_ACCOUNT_NUMBER": {"target": UNIT}, - "US_BANK_ROUTING_NUMBER": {"target": UNIT}, - "US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER": {"target": UNIT}, - "US_PASSPORT_NUMBER": {"target": UNIT}, - "US_SOCIAL_SECURITY_NUMBER": {"target": UNIT}, - "VEHICLE_IDENTIFICATION_NUMBER": {"target": UNIT}, - }, ) -GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_ENTITY_CONFIG = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockruntime#GuardrailChecksSensitiveInformationEntityConfig" +SYSTEM_CONTENT_BLOCKS: StaticSchema = ( + 16, + n0, + _SCBy, + 0, + (_me,), + ((SYSTEM_CONTENT_BLOCK, 0),), +) + +ANY_TOOL_CHOICE: StaticSchema = (18, n0, _ATC, 0) + +AUTO_TOOL_CHOICE: StaticSchema = (18, n0, _ATCu, 0) + +SPECIFIC_TOOL_CHOICE: StaticSchema = (18, n0, _STC, 0, (_n,), ((TOOL_NAME, 1),)) + +TOOL_CHOICE: StaticSchema = ( + 19, + n0, + _TC, + 0, + (_aut, _an, _too), + ((AUTO_TOOL_CHOICE, 0), (ANY_TOOL_CHOICE, 0), (SPECIFIC_TOOL_CHOICE, 0)), +) + +SYSTEM_TOOL: StaticSchema = (18, n0, _STy, 0, (_n,), ((TOOL_NAME, 1),)) + +TOOL_INPUT_SCHEMA: StaticSchema = (19, n0, _TIS, 0, (_js,), ((13, 0),)) + +TOOL_SPECIFICATION: StaticSchema = ( + 18, + n0, + _TS, + 0, + (_n, _des, _iS, _stri), + ((TOOL_NAME, 1), (NON_EMPTY_STRING, 0), (TOOL_INPUT_SCHEMA, 1), (2, 0)), +) + +TOOL: StaticSchema = ( + 19, + n0, + _To, + 0, + (_tS, _sTy, _cPa), + ((TOOL_SPECIFICATION, 0), (SYSTEM_TOOL, 0), (CACHE_POINT_BLOCK, 0)), +) + +TOOLS: StaticSchema = (16, n0, _Too, 0, (_me,), ((TOOL, 0),)) + +TOOL_CONFIGURATION: StaticSchema = ( + 18, + n0, + _TCo, + 0, + (_tool, _tCo), + ((TOOLS, 1), (TOOL_CHOICE, 0)), +) + +CONVERSE_INPUT: StaticSchema = ( + 18, + n0, + _CI, + {_sSI: _cCR, _sm: None}, + (_mI, _mes, _sy, _iC, _tCoo, _gCua, _aMRF, _pV, _aMRFP, _rM, _pC, _sTe, _oC), + ( + (CONVERSATIONAL_MODEL_ID, 9), + (MESSAGES, 0), + (SYSTEM_CONTENT_BLOCKS, 0), + (INFERENCE_CONFIGURATION, 0), + (TOOL_CONFIGURATION, 0), + (GUARDRAIL_CONFIGURATION, 0), + (13, 0), + (PROMPT_VARIABLE_MAP, 0), + (ADDITIONAL_MODEL_RESPONSE_FIELD_PATHS, 0), + (REQUEST_METADATA, 0), + (PERFORMANCE_CONFIGURATION, 0), + (SERVICE_TIER, 0), + (OUTPUT_CONFIG, 0), ), - members={ - "type": { - "target": GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_ENTITY_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, ) -GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_ENTITY_CONFIG_LIST = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockruntime#GuardrailChecksSensitiveInformationEntityConfigList" +CONVERSE_METRICS: StaticSchema = (18, n0, _CM, 0, (_lM,), ((8, 1),)) + +CONVERSE_OUTPUT: StaticSchema = (19, n0, _CO, 0, (_m,), ((MESSAGE, 0),)) + +STOP_REASON: StaticSchema = ( + 14, + n0, + _SR, + 0, + (_ET, _TU, _MT, _SS, _GI_, _CF, _MMO, _MTU, _MCWE), + ( + (-1, {_sV: _et}), + (-1, {_sV: _tu}), + (-1, {_sV: _mt}), + (-1, {_sV: _ss}), + (-1, {_sV: _gi_}), + (-1, {_sV: _cf}), + (-1, {_sV: _mmo}), + (-1, {_sV: _mtu}), + (-1, {_sV: _mcwe}), ), - shape_type=ShapeType.LIST, - members={ - "member": {"target": GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_ENTITY_CONFIG} - }, ) -GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_CONFIG = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockruntime#GuardrailChecksSensitiveInformationConfig" +GUARDRAIL_ASSESSMENT_MAP: StaticSchema = ( + 17, + n0, + _GAM, + 0, + (_k, _v), + ((3, 0), (GUARDRAIL_ASSESSMENT, 0)), +) + +MODEL_OUTPUTS: StaticSchema = (16, n0, _MO, 0, (_me,), ((GUARDRAIL_OUTPUT_TEXT, 0),)) + +GUARDRAIL_ASSESSMENT_LIST_MAP: StaticSchema = ( + 17, + n0, + _GALM, + 0, + (_k, _v), + ((3, 0), (GUARDRAIL_ASSESSMENT_LIST, 0)), +) + +GUARDRAIL_TRACE_ASSESSMENT: StaticSchema = ( + 18, + n0, + _GTA, + 0, + (_mO, _iAn, _oA, _aR), + ( + (MODEL_OUTPUTS, 0), + (GUARDRAIL_ASSESSMENT_MAP, 0), + (GUARDRAIL_ASSESSMENT_LIST_MAP, 0), + (3, 0), ), - members={ - "entities": { - "target": GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_ENTITY_CONFIG_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, ) -GUARDRAIL_CHECKS_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailChecksConfig"), - members={ - "contentFilter": {"target": GUARDRAIL_CHECKS_CONTENT_FILTER_CONFIG}, - "promptAttack": {"target": GUARDRAIL_CHECKS_PROMPT_ATTACK_CONFIG}, - "sensitiveInformation": { - "target": GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_CONFIG - }, - }, -) +INVOKED_MODEL_ID: StaticSchema = (3, n0, _IMI, 0) -GUARDRAIL_CHECKS_TEXT_CONTENT = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailChecksTextContent"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) +PROMPT_ROUTER_TRACE: StaticSchema = (18, n0, _PRT, 0, (_iMI,), ((INVOKED_MODEL_ID, 0),)) -GUARDRAIL_CHECKS_CONTENT_BLOCK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailChecksContentBlock"), - shape_type=ShapeType.UNION, - members={"text": {"target": GUARDRAIL_CHECKS_TEXT_CONTENT}}, +CONVERSE_TRACE: StaticSchema = ( + 18, + n0, + _CT, + 0, + (_gu, _pR), + ((GUARDRAIL_TRACE_ASSESSMENT, 0), (PROMPT_ROUTER_TRACE, 0)), ) -GUARDRAIL_CHECKS_CONTENT_BLOCK_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailChecksContentBlockList"), - shape_type=ShapeType.LIST, - members={"member": {"target": GUARDRAIL_CHECKS_CONTENT_BLOCK}}, -) +CACHE_DETAIL: StaticSchema = (18, n0, _CD, 0, (_tt, _iT), ((CACHE_TTL, 1), (7, 1))) -GUARDRAIL_CHECKS_ROLE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailChecksRole"), - shape_type=ShapeType.ENUM, - members={ - "USER": {"target": UNIT}, - "ASSISTANT": {"target": UNIT}, - "SYSTEM": {"target": UNIT}, - }, -) +CACHE_DETAILS_LIST: StaticSchema = (16, n0, _CDL, 0, (_me,), ((CACHE_DETAIL, 0),)) -GUARDRAIL_CHECKS_MESSAGE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailChecksMessage"), - members={ - "role": { - "target": GUARDRAIL_CHECKS_ROLE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "content": { - "target": GUARDRAIL_CHECKS_CONTENT_BLOCK_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +TOKEN_USAGE: StaticSchema = ( + 18, + n0, + _TUo, + 0, + (_iT, _oT, _tT, _cRIT, _cWIT, _cD), + ((7, 1), (7, 1), (7, 1), (7, 0), (7, 0), (CACHE_DETAILS_LIST, 0)), ) -GUARDRAIL_CHECKS_MESSAGE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailChecksMessageList"), - shape_type=ShapeType.LIST, - members={"member": {"target": GUARDRAIL_CHECKS_MESSAGE}}, +CONVERSE_OPERATION_OUTPUT: StaticSchema = ( + 18, + n0, + _COO, + {_sSI: _cCRo, _smith: None}, + (_out, _sRt, _u, _met, _aMRFd, _trac, _pC, _sTe), + ( + (CONVERSE_OUTPUT, 1), + (STOP_REASON, 1), + (TOKEN_USAGE, 1), + (CONVERSE_METRICS, 1), + (13, 0), + (CONVERSE_TRACE, 0), + (PERFORMANCE_CONFIGURATION, 0), + (SERVICE_TIER, 0), + ), ) -INVOKE_GUARDRAIL_CHECKS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#InvokeGuardrailChecksInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockruntime#InvokeGuardrailChecksRequest", - ) - ], - members={ - "messages": { - "target": GUARDRAIL_CHECKS_MESSAGE_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "checks": { - "target": GUARDRAIL_CHECKS_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +STATUS_CODE: StaticSchema = (7, n0, _SCt, 0) -GUARDRAIL_CHECKS_CONTENT_FILTER_RESULT_ENTRY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailChecksContentFilterResultEntry"), - members={ - "category": { - "target": GUARDRAIL_CHECKS_CONTENT_FILTER_CATEGORY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "severityScore": { - "target": DOUBLE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +MODEL_ERROR_EXCEPTION: StaticSchema = ( + 18, + n0, + _MEE, + {_s: _c, _sE: 424}, + (_m, _oSC, _rN), + ((NON_BLANK_STRING, 0), (STATUS_CODE, 0), (NON_BLANK_STRING, 0)), ) -GUARDRAIL_CHECKS_CONTENT_FILTER_RESULT_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailChecksContentFilterResultList"), - shape_type=ShapeType.LIST, - members={"member": {"target": GUARDRAIL_CHECKS_CONTENT_FILTER_RESULT_ENTRY}}, +MODEL_NOT_READY_EXCEPTION: StaticSchema = ( + 18, + n0, + _MNRE, + {_s: _c, _sE: 429}, + (_m,), + ((NON_BLANK_STRING, 0),), ) -GUARDRAIL_CHECKS_CONTENT_FILTER_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailChecksContentFilterResult"), - members={ - "results": { - "target": GUARDRAIL_CHECKS_CONTENT_FILTER_RESULT_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +MODEL_TIMEOUT_EXCEPTION: StaticSchema = ( + 18, + n0, + _MTE, + {_s: _c, _sE: 408}, + (_m,), + ((NON_BLANK_STRING, 0),), ) -GUARDRAIL_CHECKS_PROMPT_ATTACK_RESULT_ENTRY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailChecksPromptAttackResultEntry"), - members={ - "category": { - "target": GUARDRAIL_CHECKS_PROMPT_ATTACK_CATEGORY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "severityScore": { - "target": DOUBLE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, +CONVERSE: StaticOperationSchema = ( + 23, + n0, + _Co, + { + _smithy: MappingProxyType( + {"code": 200, "method": "POST", "uri": "/model/{modelId}/converse"} + ) }, + CONVERSE_INPUT, + CONVERSE_OPERATION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + MODEL_ERROR_EXCEPTION, + MODEL_NOT_READY_EXCEPTION, + MODEL_TIMEOUT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_UNAVAILABLE_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -GUARDRAIL_CHECKS_PROMPT_ATTACK_RESULT_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailChecksPromptAttackResultList"), - shape_type=ShapeType.LIST, - members={"member": {"target": GUARDRAIL_CHECKS_PROMPT_ATTACK_RESULT_ENTRY}}, -) - -GUARDRAIL_CHECKS_PROMPT_ATTACK_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailChecksPromptAttackResult"), - members={ - "results": { - "target": GUARDRAIL_CHECKS_PROMPT_ATTACK_RESULT_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +GUARDRAIL_STREAM_PROCESSING_MODE: StaticSchema = ( + 14, + n0, + _GSPM, + 0, + (_SYNC, _ASYNC), + ((-1, {_sV: _syn}), (-1, {_sV: _asy})), +) + +GUARDRAIL_STREAM_CONFIGURATION: StaticSchema = ( + 18, + n0, + _GSC, + 0, + (_gI, _gV, _trac, _sPM), + ( + (GUARDRAIL_IDENTIFIER, {_smithya: _v_}), + (GUARDRAIL_VERSION, {_smithya: _v_}), + (GUARDRAIL_TRACE, {_smithya: _di}), + (GUARDRAIL_STREAM_PROCESSING_MODE, {_smithya: _syn}), + ), ) -GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_RESULT_ENTRY = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockruntime#GuardrailChecksSensitiveInformationResultEntry" +CONVERSE_STREAM_INPUT: StaticSchema = ( + 18, + n0, + _CSI, + {_sSI: _cCSR, _sm: None}, + (_mI, _mes, _sy, _iC, _tCoo, _gCua, _aMRF, _pV, _aMRFP, _rM, _pC, _sTe, _oC), + ( + (CONVERSATIONAL_MODEL_ID, 9), + (MESSAGES, 0), + (SYSTEM_CONTENT_BLOCKS, 0), + (INFERENCE_CONFIGURATION, 0), + (TOOL_CONFIGURATION, 0), + (GUARDRAIL_STREAM_CONFIGURATION, 0), + (13, 0), + (PROMPT_VARIABLE_MAP, 0), + (ADDITIONAL_MODEL_RESPONSE_FIELD_PATHS, 0), + (REQUEST_METADATA, 0), + (PERFORMANCE_CONFIGURATION, 0), + (SERVICE_TIER, 0), + (OUTPUT_CONFIG, 0), ), - members={ - "type": { - "target": GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_ENTITY_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "confidenceScore": { - "target": DOUBLE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "beginOffset": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "endOffset": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "messageIndex": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "contentIndex": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, ) -GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_RESULT_LIST = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockruntime#GuardrailChecksSensitiveInformationResultList" +NON_NEGATIVE_INTEGER: StaticSchema = (7, n0, _NNI, 0) + +CITATION_SOURCE_CONTENT_DELTA: StaticSchema = (18, n0, _CSCD, 0, (_te,), ((3, 0),)) + +CITATION_SOURCE_CONTENT_LIST_DELTA: StaticSchema = ( + 16, + n0, + _CSCLD, + 0, + (_me,), + ((CITATION_SOURCE_CONTENT_DELTA, 0),), +) + +CITATIONS_DELTA: StaticSchema = ( + 18, + n0, + _CDi, + 0, + (_ti, _so, _sC, _lo), + ((3, 0), (3, 0), (CITATION_SOURCE_CONTENT_LIST_DELTA, 0), (CITATION_LOCATION, 0)), +) + +IMAGE_BLOCK_DELTA: StaticSchema = ( + 18, + n0, + _IBD, + 0, + (_so, _er), + ((IMAGE_SOURCE, 0), (ERROR_BLOCK, 0)), +) + +REASONING_CONTENT_BLOCK_DELTA: StaticSchema = ( + 19, + n0, + _RCBD, + 4, + (_te, _rC, _si), + ((3, 0), (1, 0), (3, 0)), +) + +TOOL_RESULT_BLOCK_DELTA: StaticSchema = ( + 19, + n0, + _TRBD, + 0, + (_te, _js), + ((3, 0), (13, 0)), +) + +TOOL_RESULT_BLOCKS_DELTA: StaticSchema = ( + 16, + n0, + _TRBDo, + 0, + (_me,), + ((TOOL_RESULT_BLOCK_DELTA, 0),), +) + +TOOL_USE_BLOCK_DELTA: StaticSchema = (18, n0, _TUBD, 0, (_inp,), ((3, 1),)) + +CONTENT_BLOCK_DELTA: StaticSchema = ( + 19, + n0, + _CBD, + 0, + (_te, _tUo, _tR, _rCe, _cit, _i), + ( + (3, 0), + (TOOL_USE_BLOCK_DELTA, 0), + (TOOL_RESULT_BLOCKS_DELTA, 0), + (REASONING_CONTENT_BLOCK_DELTA, 0), + (CITATIONS_DELTA, 0), + (IMAGE_BLOCK_DELTA, 0), ), - shape_type=ShapeType.LIST, - members={"member": {"target": GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_RESULT_ENTRY}}, ) -GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_RESULT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockruntime#GuardrailChecksSensitiveInformationResult" +CONTENT_BLOCK_DELTA_EVENT: StaticSchema = ( + 18, + n0, + _CBDE, + 0, + (_del, _cBI), + ((CONTENT_BLOCK_DELTA, 1), (NON_NEGATIVE_INTEGER, 1)), +) + +IMAGE_BLOCK_START: StaticSchema = (18, n0, _IBS, 0, (_f,), ((IMAGE_FORMAT, 1),)) + +TOOL_RESULT_BLOCK_START: StaticSchema = ( + 18, + n0, + _TRBS, + 0, + (_tUI, _ty, _st), + ((TOOL_USE_ID, 1), (3, 0), (TOOL_RESULT_STATUS, 0)), +) + +TOOL_USE_BLOCK_START: StaticSchema = ( + 18, + n0, + _TUBS, + 0, + (_tUI, _n, _ty), + ((TOOL_USE_ID, 1), (TOOL_NAME, 1), (TOOL_USE_TYPE, 0)), +) + +CONTENT_BLOCK_START: StaticSchema = ( + 19, + n0, + _CBS, + 0, + (_tUo, _tR, _i), + ((TOOL_USE_BLOCK_START, 0), (TOOL_RESULT_BLOCK_START, 0), (IMAGE_BLOCK_START, 0)), +) + +CONTENT_BLOCK_START_EVENT: StaticSchema = ( + 18, + n0, + _CBSE, + 0, + (_star, _cBI), + ((CONTENT_BLOCK_START, 1), (NON_NEGATIVE_INTEGER, 1)), +) + +CONTENT_BLOCK_STOP_EVENT: StaticSchema = ( + 18, + n0, + _CBSEo, + 0, + (_cBI,), + ((NON_NEGATIVE_INTEGER, 1),), +) + +MESSAGE_START_EVENT: StaticSchema = (18, n0, _MSE, 0, (_ro,), ((CONVERSATION_ROLE, 1),)) + +MESSAGE_STOP_EVENT: StaticSchema = ( + 18, + n0, + _MSEe, + 0, + (_sRt, _aMRFd), + ((STOP_REASON, 1), (13, 0)), +) + +CONVERSE_STREAM_METRICS: StaticSchema = (18, n0, _CSM, 0, (_lM,), ((8, 1),)) + +CONVERSE_STREAM_TRACE: StaticSchema = ( + 18, + n0, + _CST, + 0, + (_gu, _pR), + ((GUARDRAIL_TRACE_ASSESSMENT, 0), (PROMPT_ROUTER_TRACE, 0)), +) + +CONVERSE_STREAM_METADATA_EVENT: StaticSchema = ( + 18, + n0, + _CSME, + 0, + (_u, _met, _trac, _pC, _sTe), + ( + (TOKEN_USAGE, 1), + (CONVERSE_STREAM_METRICS, 1), + (CONVERSE_STREAM_TRACE, 0), + (PERFORMANCE_CONFIGURATION, 0), + (SERVICE_TIER, 0), ), - members={ - "results": { - "target": GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_RESULT_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "truncated": {"target": BOOLEAN}, - }, ) -GUARDRAIL_CHECKS_RESULTS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailChecksResults"), - members={ - "contentFilter": {"target": GUARDRAIL_CHECKS_CONTENT_FILTER_RESULT}, - "promptAttack": {"target": GUARDRAIL_CHECKS_PROMPT_ATTACK_RESULT}, - "sensitiveInformation": { - "target": GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_RESULT - }, - }, +MODEL_STREAM_ERROR_EXCEPTION: StaticSchema = ( + 18, + n0, + _MSEE, + {_s: _c, _sE: 424}, + (_m, _oSC, _oM), + ((NON_BLANK_STRING, 0), (STATUS_CODE, 0), (NON_BLANK_STRING, 0)), +) + +CONVERSE_STREAM_OUTPUT: StaticSchema = ( + 19, + n0, + _CSO, + {_smithyap: None}, + (_mS, _cBS, _cBD, _cBSo, _mSe, _meta, _iSE, _mSEE, _vE, _tE, _sUE), + ( + (MESSAGE_START_EVENT, 0), + (CONTENT_BLOCK_START_EVENT, 0), + (CONTENT_BLOCK_DELTA_EVENT, 0), + (CONTENT_BLOCK_STOP_EVENT, 0), + (MESSAGE_STOP_EVENT, 0), + (CONVERSE_STREAM_METADATA_EVENT, 0), + (INTERNAL_SERVER_EXCEPTION, 0), + (MODEL_STREAM_ERROR_EXCEPTION, 0), + (VALIDATION_EXCEPTION, 0), + (THROTTLING_EXCEPTION, 0), + (SERVICE_UNAVAILABLE_EXCEPTION, 0), + ), ) -GUARDRAIL_CHECKS_CONTENT_FILTER_USAGE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailChecksContentFilterUsage"), - members={ - "textUnits": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +CONVERSE_STREAM_OPERATION_OUTPUT: StaticSchema = ( + 18, + n0, + _CSOO, + {_sSI: _cCSRo, _smith: None}, + (_stre,), + ((CONVERSE_STREAM_OUTPUT, 16),), ) -GUARDRAIL_CHECKS_PROMPT_ATTACK_USAGE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailChecksPromptAttackUsage"), - members={ - "textUnits": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } +CONVERSE_STREAM: StaticOperationSchema = ( + 23, + n0, + _CS, + { + _smithy: MappingProxyType( + {"code": 200, "method": "POST", "uri": "/model/{modelId}/converse-stream"} + ) }, + CONVERSE_STREAM_INPUT, + CONVERSE_STREAM_OPERATION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + MODEL_ERROR_EXCEPTION, + MODEL_NOT_READY_EXCEPTION, + MODEL_TIMEOUT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_UNAVAILABLE_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_USAGE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailChecksSensitiveInformationUsage"), - members={ - "textUnits": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +MIME_TYPE: StaticSchema = (3, n0, _MTi, 0) + +BODY: StaticSchema = (1, n0, _B, 4) + +INVOKE_MODEL_IDENTIFIER: StaticSchema = (3, n0, _IMIn, 0) + +REQUEST_METADATA_JSON: StaticSchema = (3, n0, _RMJ, 4) + +TRACE: StaticSchema = ( + 14, + n0, + _Tr, + 0, + (_ENABLED, _DISABLED, _EF), + ((-1, {_sV: _ENABLED}), (-1, {_sV: _DISABLED}), (-1, {_sV: _EF})), +) + +INVOKE_MODEL_INPUT: StaticSchema = ( + 18, + n0, + _IMInv, + {_sSI: _cIMR, _sm: None}, + (_bo, _cT, _ac, _mI, _trac, _gI, _gV, _pCL, _sTe, _rM), + ( + (BODY, 16), + (MIME_TYPE, {_sH: _CT_}), + (MIME_TYPE, {_sH: _Ac}), + (INVOKE_MODEL_IDENTIFIER, 9), + (TRACE, {_sH: _XABT}), + (GUARDRAIL_IDENTIFIER, {_sH: _XABG}), + (GUARDRAIL_VERSION, {_sH: _XABG_}), + (PERFORMANCE_CONFIG_LATENCY, {_smithya: _stan, _sH: _XABPL}), + (SERVICE_TIER_TYPE, {_sH: _XABST}), + (REQUEST_METADATA_JSON, {_sH: _XABRM}), + ), ) -GUARDRAIL_CHECKS_USAGE_RESULTS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailChecksUsageResults"), - members={ - "contentFilter": {"target": GUARDRAIL_CHECKS_CONTENT_FILTER_USAGE}, - "promptAttack": {"target": GUARDRAIL_CHECKS_PROMPT_ATTACK_USAGE}, - "sensitiveInformation": { - "target": GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_USAGE - }, - }, +INVOKE_MODEL_OUTPUT: StaticSchema = ( + 18, + n0, + _IMO, + {_sSI: _cIMRo, _smith: None}, + (_bo, _cT, _pCL, _sTe), + ( + (BODY, 17), + (MIME_TYPE, {_sH: _CT_, _smi: None}), + (PERFORMANCE_CONFIG_LATENCY, {_sH: _XABPL}), + (SERVICE_TIER_TYPE, {_sH: _XABST}), + ), ) -INVOKE_GUARDRAIL_CHECKS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#InvokeGuardrailChecksOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockruntime#InvokeGuardrailChecksResponse", +INVOKE_MODEL: StaticOperationSchema = ( + 23, + n0, + _IM, + { + _smithy: MappingProxyType( + {"code": 200, "method": "POST", "uri": "/model/{modelId}/invoke"} ) - ], - members={ - "results": { - "target": GUARDRAIL_CHECKS_RESULTS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "usage": { - "target": GUARDRAIL_CHECKS_USAGE_RESULTS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, }, + INVOKE_MODEL_INPUT, + INVOKE_MODEL_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + MODEL_ERROR_EXCEPTION, + MODEL_NOT_READY_EXCEPTION, + MODEL_TIMEOUT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + SERVICE_UNAVAILABLE_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -INVOKE_GUARDRAIL_CHECKS = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#InvokeGuardrailChecks"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "POST", "uri": "/guardrail-checks/invoke"} - ), - ) - ], +PART_BODY: StaticSchema = (1, n0, _PB, 4) + +BIDIRECTIONAL_INPUT_PAYLOAD_PART: StaticSchema = ( + 18, + n0, + _BIPP, + 4, + (_b,), + ((PART_BODY, 0),), +) + +INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_INPUT: StaticSchema = ( + 19, + n0, + _IMWBSI, + {_smithyap: None}, + (_chu,), + ((BIDIRECTIONAL_INPUT_PAYLOAD_PART, 0),), +) + +INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_OPERATION_INPUT: StaticSchema = ( + 18, + n0, + _IMWBSOI, + {_sSI: _cIMWBSR, _sm: None}, + (_mI, _bo), + ((INVOKE_MODEL_IDENTIFIER, 9), (INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_INPUT, 17)), +) + +BIDIRECTIONAL_OUTPUT_PAYLOAD_PART: StaticSchema = ( + 18, + n0, + _BOPP, + 4, + (_b,), + ((PART_BODY, 0),), +) + +INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_OUTPUT: StaticSchema = ( + 19, + n0, + _IMWBSO, + {_smithyap: None}, + (_chu, _iSE, _mSEE, _vE, _tE, _mTE, _sUE), + ( + (BIDIRECTIONAL_OUTPUT_PAYLOAD_PART, 0), + (INTERNAL_SERVER_EXCEPTION, 0), + (MODEL_STREAM_ERROR_EXCEPTION, 0), + (VALIDATION_EXCEPTION, 0), + (THROTTLING_EXCEPTION, 0), + (MODEL_TIMEOUT_EXCEPTION, 0), + (SERVICE_UNAVAILABLE_EXCEPTION, 0), + ), ) -GUARDRAIL_TRACE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailTrace"), - shape_type=ShapeType.ENUM, - members={ - "ENABLED": {"target": UNIT}, - "DISABLED": {"target": UNIT}, - "ENABLED_FULL": {"target": UNIT}, +INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_OPERATION_OUTPUT: StaticSchema = ( + 18, + n0, + _IMWBSOO, + {_sSI: _cIMWBSRo, _smith: None}, + (_bo,), + ((INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_OUTPUT, 17),), +) + +INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM: StaticOperationSchema = ( + 23, + n0, + _IMWBS, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "POST", + "uri": "/model/{modelId}/invoke-with-bidirectional-stream", + } + ) }, + INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_OPERATION_INPUT, + INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_OPERATION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + MODEL_ERROR_EXCEPTION, + MODEL_NOT_READY_EXCEPTION, + MODEL_STREAM_ERROR_EXCEPTION, + MODEL_TIMEOUT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + SERVICE_UNAVAILABLE_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -GUARDRAIL_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailConfiguration"), - members={ - "guardrailIdentifier": { - "target": GUARDRAIL_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="")], - }, - "guardrailVersion": { - "target": GUARDRAIL_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="")], - }, - "trace": { - "target": GUARDRAIL_TRACE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="disabled")], - }, - }, +INVOKE_MODEL_WITH_RESPONSE_STREAM_INPUT: StaticSchema = ( + 18, + n0, + _IMWRSI, + {_sSI: _cIMWRSR, _sm: None}, + (_bo, _cT, _ac, _mI, _trac, _gI, _gV, _pCL, _sTe, _rM), + ( + (BODY, 16), + (MIME_TYPE, {_sH: _CT_}), + (MIME_TYPE, {_sH: _XABA}), + (INVOKE_MODEL_IDENTIFIER, 9), + (TRACE, {_sH: _XABT}), + (GUARDRAIL_IDENTIFIER, {_sH: _XABG}), + (GUARDRAIL_VERSION, {_sH: _XABG_}), + (PERFORMANCE_CONFIG_LATENCY, {_smithya: _stan, _sH: _XABPL}), + (SERVICE_TIER_TYPE, {_sH: _XABST}), + (REQUEST_METADATA_JSON, {_sH: _XABRM}), + ), ) -NON_EMPTY_STRING = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#NonEmptyString"), - shape_type=ShapeType.STRING, +PAYLOAD_PART: StaticSchema = (18, n0, _PP, 4, (_b,), ((PART_BODY, 0),)) + +RESPONSE_STREAM: StaticSchema = ( + 19, + n0, + _RS, + {_smithyap: None}, + (_chu, _iSE, _mSEE, _vE, _tE, _mTE, _sUE), + ( + (PAYLOAD_PART, 0), + (INTERNAL_SERVER_EXCEPTION, 0), + (MODEL_STREAM_ERROR_EXCEPTION, 0), + (VALIDATION_EXCEPTION, 0), + (THROTTLING_EXCEPTION, 0), + (MODEL_TIMEOUT_EXCEPTION, 0), + (SERVICE_UNAVAILABLE_EXCEPTION, 0), + ), ) -NON_EMPTY_STRING_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#NonEmptyStringList"), - shape_type=ShapeType.LIST, - members={"member": {"target": NON_EMPTY_STRING}}, +INVOKE_MODEL_WITH_RESPONSE_STREAM_OUTPUT: StaticSchema = ( + 18, + n0, + _IMWRSO, + {_sSI: _cIMWRSRo, _smith: None}, + (_bo, _cT, _pCL, _sTe), + ( + (RESPONSE_STREAM, 17), + (MIME_TYPE, {_sH: _XABCT, _smi: None}), + (PERFORMANCE_CONFIG_LATENCY, {_sH: _XABPL}), + (SERVICE_TIER_TYPE, {_sH: _XABST}), + ), ) -INFERENCE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#InferenceConfiguration"), - members={ - "maxTokens": {"target": INTEGER}, - "temperature": {"target": FLOAT}, - "topP": {"target": FLOAT}, - "stopSequences": {"target": NON_EMPTY_STRING_LIST}, +INVOKE_MODEL_WITH_RESPONSE_STREAM: StaticOperationSchema = ( + 23, + n0, + _IMWRS, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "POST", + "uri": "/model/{modelId}/invoke-with-response-stream", + } + ) }, + INVOKE_MODEL_WITH_RESPONSE_STREAM_INPUT, + INVOKE_MODEL_WITH_RESPONSE_STREAM_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + MODEL_ERROR_EXCEPTION, + MODEL_NOT_READY_EXCEPTION, + MODEL_STREAM_ERROR_EXCEPTION, + MODEL_TIMEOUT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + SERVICE_UNAVAILABLE_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -ERROR_BLOCK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ErrorBlock"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"message": {"target": STRING}}, -) - -AUDIO_FORMAT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#AudioFormat"), - shape_type=ShapeType.ENUM, - members={ - "MP3": {"target": UNIT}, - "OPUS": {"target": UNIT}, - "WAV": {"target": UNIT}, - "AAC": {"target": UNIT}, - "FLAC": {"target": UNIT}, - "MP4": {"target": UNIT}, - "OGG": {"target": UNIT}, - "MKV": {"target": UNIT}, - "MKA": {"target": UNIT}, - "X_AAC": {"target": UNIT}, - "M4A": {"target": UNIT}, - "MPEG": {"target": UNIT}, - "MPGA": {"target": UNIT}, - "PCM": {"target": UNIT}, - "WEBM": {"target": UNIT}, - }, +CONVERSE_TOKENS_REQUEST: StaticSchema = ( + 18, + n0, + _CTR, + 0, + (_mes, _sy, _tCoo, _aMRF), + ((MESSAGES, 0), (SYSTEM_CONTENT_BLOCKS, 0), (TOOL_CONFIGURATION, 0), (13, 0)), ) -S3_LOCATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#S3Location"), - members={ - "uri": { - "target": S3_URI, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "bucketOwner": {"target": ACCOUNT_ID}, - }, -) +INVOKE_MODEL_TOKENS_REQUEST: StaticSchema = (18, n0, _IMTR, 0, (_bo,), ((BODY, 1),)) -AUDIO_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#AudioSource"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"bytes": {"target": BLOB}, "s3Location": {"target": S3_LOCATION}}, -) - -AUDIO_BLOCK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#AudioBlock"), - members={ - "format": { - "target": AUDIO_FORMAT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "source": { - "target": AUDIO_SOURCE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "error": {"target": ERROR_BLOCK}, - }, +COUNT_TOKENS_INPUT: StaticSchema = ( + 19, + n0, + _CTI, + 0, + (_iMn, _conv), + ((INVOKE_MODEL_TOKENS_REQUEST, 0), (CONVERSE_TOKENS_REQUEST, 0)), ) -CACHE_TTL = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#CacheTTL"), - shape_type=ShapeType.ENUM, - members={"FIVE_MINUTES": {"target": UNIT}, "ONE_HOUR": {"target": UNIT}}, -) +FOUNDATION_MODEL_VERSION_IDENTIFIER: StaticSchema = (3, n0, _FMVI, 0) -CACHE_POINT_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#CachePointType"), - shape_type=ShapeType.ENUM, - members={"DEFAULT": {"target": UNIT}}, +COUNT_TOKENS_OPERATION_INPUT: StaticSchema = ( + 18, + n0, + _CTOI, + {_sSI: _cCTR, _sm: None}, + (_mI, _inp), + ((FOUNDATION_MODEL_VERSION_IDENTIFIER, 9), (COUNT_TOKENS_INPUT, 1)), ) -CACHE_POINT_BLOCK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#CachePointBlock"), - members={ - "type": { - "target": CACHE_POINT_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ttl": {"target": CACHE_TTL}, - }, +COUNT_TOKENS_OUTPUT: StaticSchema = ( + 18, + n0, + _CTO, + {_sSI: _cCTRo, _smith: None}, + (_iT,), + ((7, 1),), ) -DOCUMENT_CHAR_LOCATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#DocumentCharLocation"), - members={ - "documentIndex": {"target": INTEGER}, - "start": {"target": INTEGER}, - "end": {"target": INTEGER}, +COUNT_TOKENS: StaticOperationSchema = ( + 23, + n0, + _CTo, + { + _smithy: MappingProxyType( + {"code": 200, "method": "POST", "uri": "/model/{modelId}/count-tokens"} + ) }, + COUNT_TOKENS_OPERATION_INPUT, + COUNT_TOKENS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_UNAVAILABLE_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -DOCUMENT_CHUNK_LOCATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#DocumentChunkLocation"), - members={ - "documentIndex": {"target": INTEGER}, - "start": {"target": INTEGER}, - "end": {"target": INTEGER}, - }, -) - -DOCUMENT_PAGE_LOCATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#DocumentPageLocation"), - members={ - "documentIndex": {"target": INTEGER}, - "start": {"target": INTEGER}, - "end": {"target": INTEGER}, - }, -) - -SEARCH_RESULT_LOCATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#SearchResultLocation"), - members={ - "searchResultIndex": {"target": INTEGER}, - "start": {"target": INTEGER}, - "end": {"target": INTEGER}, - }, -) - -WEB_LOCATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#WebLocation"), - members={"url": {"target": STRING}, "domain": {"target": STRING}}, -) - -CITATION_LOCATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#CitationLocation"), - shape_type=ShapeType.UNION, - members={ - "web": {"target": WEB_LOCATION}, - "documentChar": {"target": DOCUMENT_CHAR_LOCATION}, - "documentPage": {"target": DOCUMENT_PAGE_LOCATION}, - "documentChunk": {"target": DOCUMENT_CHUNK_LOCATION}, - "searchResultLocation": {"target": SEARCH_RESULT_LOCATION}, - }, -) - -CITATION_SOURCE_CONTENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#CitationSourceContent"), - shape_type=ShapeType.UNION, - members={"text": {"target": STRING}}, -) - -CITATION_SOURCE_CONTENT_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#CitationSourceContentList"), - shape_type=ShapeType.LIST, - members={"member": {"target": CITATION_SOURCE_CONTENT}}, -) - -CITATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#Citation"), - members={ - "title": {"target": STRING}, - "source": {"target": STRING}, - "sourceContent": {"target": CITATION_SOURCE_CONTENT_LIST}, - "location": {"target": CITATION_LOCATION}, - }, -) - -CITATIONS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#Citations"), - shape_type=ShapeType.LIST, - members={"member": {"target": CITATION}}, -) - -CITATION_GENERATED_CONTENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#CitationGeneratedContent"), - shape_type=ShapeType.UNION, - members={"text": {"target": STRING}}, -) - -CITATION_GENERATED_CONTENT_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#CitationGeneratedContentList"), - shape_type=ShapeType.LIST, - members={"member": {"target": CITATION_GENERATED_CONTENT}}, -) - -CITATIONS_CONTENT_BLOCK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#CitationsContentBlock"), - members={ - "content": {"target": CITATION_GENERATED_CONTENT_LIST}, - "citations": {"target": CITATIONS}, - }, -) - -CITATIONS_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#CitationsConfig"), - members={ - "enabled": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -DOCUMENT_FORMAT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#DocumentFormat"), - shape_type=ShapeType.ENUM, - members={ - "PDF": {"target": UNIT}, - "CSV": {"target": UNIT}, - "DOC": {"target": UNIT}, - "DOCX": {"target": UNIT}, - "XLS": {"target": UNIT}, - "XLSX": {"target": UNIT}, - "HTML": {"target": UNIT}, - "TXT": {"target": UNIT}, - "MD": {"target": UNIT}, - }, -) - -DOCUMENT_CONTENT_BLOCK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#DocumentContentBlock"), - shape_type=ShapeType.UNION, - members={"text": {"target": STRING}}, -) - -DOCUMENT_CONTENT_BLOCKS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#DocumentContentBlocks"), - shape_type=ShapeType.LIST, - members={"member": {"target": DOCUMENT_CONTENT_BLOCK}}, -) - -DOCUMENT_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#DocumentSource"), - shape_type=ShapeType.UNION, - members={ - "bytes": {"target": BLOB}, - "s3Location": {"target": S3_LOCATION}, - "text": {"target": STRING}, - "content": {"target": DOCUMENT_CONTENT_BLOCKS}, - }, -) - -DOCUMENT_BLOCK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#DocumentBlock"), - members={ - "format": { - "target": DOCUMENT_FORMAT, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="txt")], - }, - "name": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "source": { - "target": DOCUMENT_SOURCE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "context": {"target": STRING}, - "citations": {"target": CITATIONS_CONFIG}, - }, -) - -GUARDRAIL_CONVERSE_IMAGE_FORMAT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailConverseImageFormat"), - shape_type=ShapeType.ENUM, - members={"PNG": {"target": UNIT}, "JPEG": {"target": UNIT}}, -) - -GUARDRAIL_CONVERSE_IMAGE_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailConverseImageSource"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"bytes": {"target": BLOB}}, -) - -GUARDRAIL_CONVERSE_IMAGE_BLOCK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailConverseImageBlock"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "format": { - "target": GUARDRAIL_CONVERSE_IMAGE_FORMAT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "source": { - "target": GUARDRAIL_CONVERSE_IMAGE_SOURCE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -GUARDRAIL_CONVERSE_CONTENT_QUALIFIER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailConverseContentQualifier"), - shape_type=ShapeType.ENUM, - members={ - "GROUNDING_SOURCE": {"target": UNIT}, - "QUERY": {"target": UNIT}, - "GUARD_CONTENT": {"target": UNIT}, - }, -) - -GUARDRAIL_CONVERSE_CONTENT_QUALIFIER_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailConverseContentQualifierList"), - shape_type=ShapeType.LIST, - members={"member": {"target": GUARDRAIL_CONVERSE_CONTENT_QUALIFIER}}, -) - -GUARDRAIL_CONVERSE_TEXT_BLOCK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailConverseTextBlock"), - members={ - "text": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "qualifiers": {"target": GUARDRAIL_CONVERSE_CONTENT_QUALIFIER_LIST}, - }, -) - -GUARDRAIL_CONVERSE_CONTENT_BLOCK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailConverseContentBlock"), - shape_type=ShapeType.UNION, - members={ - "text": {"target": GUARDRAIL_CONVERSE_TEXT_BLOCK}, - "image": {"target": GUARDRAIL_CONVERSE_IMAGE_BLOCK}, - }, -) - -IMAGE_FORMAT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ImageFormat"), - shape_type=ShapeType.ENUM, - members={ - "PNG": {"target": UNIT}, - "JPEG": {"target": UNIT}, - "GIF": {"target": UNIT}, - "WEBP": {"target": UNIT}, - }, -) - -IMAGE_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ImageSource"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"bytes": {"target": BLOB}, "s3Location": {"target": S3_LOCATION}}, -) - -IMAGE_BLOCK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ImageBlock"), - members={ - "format": { - "target": IMAGE_FORMAT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "source": { - "target": IMAGE_SOURCE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "error": {"target": ERROR_BLOCK}, - }, -) - -REASONING_TEXT_BLOCK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ReasoningTextBlock"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "text": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "signature": {"target": STRING}, - }, -) - -REASONING_CONTENT_BLOCK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ReasoningContentBlock"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "reasoningText": {"target": REASONING_TEXT_BLOCK}, - "redactedContent": {"target": BLOB}, - }, -) - -SEARCH_RESULT_CONTENT_BLOCK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#SearchResultContentBlock"), - members={ - "text": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -SEARCH_RESULT_CONTENT_BLOCKS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#SearchResultContentBlocks"), - shape_type=ShapeType.LIST, - members={"member": {"target": SEARCH_RESULT_CONTENT_BLOCK}}, -) - -SEARCH_RESULT_BLOCK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#SearchResultBlock"), - members={ - "source": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "title": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "content": { - "target": SEARCH_RESULT_CONTENT_BLOCKS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "citations": {"target": CITATIONS_CONFIG}, - }, -) - -TOOL_REFERENCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ToolReference"), - members={ - "type": {"target": STRING}, - "name": {"target": STRING}, - "serverName": {"target": STRING}, - }, -) - -TOOL_ADDITION_BLOCK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ToolAdditionBlock"), - members={ - "tool": { - "target": TOOL_REFERENCE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -TOOL_REMOVAL_BLOCK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ToolRemovalBlock"), - members={ - "tool": { - "target": TOOL_REFERENCE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -VIDEO_FORMAT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#VideoFormat"), - shape_type=ShapeType.ENUM, - members={ - "MKV": {"target": UNIT}, - "MOV": {"target": UNIT}, - "MP4": {"target": UNIT}, - "WEBM": {"target": UNIT}, - "FLV": {"target": UNIT}, - "MPEG": {"target": UNIT}, - "MPG": {"target": UNIT}, - "WMV": {"target": UNIT}, - "THREE_GP": {"target": UNIT}, - }, -) - -VIDEO_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#VideoSource"), - shape_type=ShapeType.UNION, - members={"bytes": {"target": BLOB}, "s3Location": {"target": S3_LOCATION}}, -) - -VIDEO_BLOCK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#VideoBlock"), - members={ - "format": { - "target": VIDEO_FORMAT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "source": { - "target": VIDEO_SOURCE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -TOOL_RESULT_CONTENT_BLOCK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ToolResultContentBlock"), - shape_type=ShapeType.UNION, - members={ - "json": {"target": DOCUMENT}, - "text": {"target": STRING}, - "image": {"target": IMAGE_BLOCK}, - "document": {"target": DOCUMENT_BLOCK}, - "video": {"target": VIDEO_BLOCK}, - "searchResult": {"target": SEARCH_RESULT_BLOCK}, - }, -) - -TOOL_RESULT_CONTENT_BLOCKS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ToolResultContentBlocks"), - shape_type=ShapeType.LIST, - members={"member": {"target": TOOL_RESULT_CONTENT_BLOCK}}, -) - -TOOL_RESULT_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ToolResultStatus"), - shape_type=ShapeType.ENUM, - members={"SUCCESS": {"target": UNIT}, "ERROR": {"target": UNIT}}, -) - -TOOL_USE_ID = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#ToolUseId"), shape_type=ShapeType.STRING -) - -TOOL_RESULT_BLOCK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ToolResultBlock"), - members={ - "toolUseId": { - "target": TOOL_USE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "content": { - "target": TOOL_RESULT_CONTENT_BLOCKS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": {"target": TOOL_RESULT_STATUS}, - "type": {"target": STRING}, - }, -) - -TOOL_NAME = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#ToolName"), shape_type=ShapeType.STRING -) - -TOOL_USE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ToolUseType"), - shape_type=ShapeType.ENUM, - members={"SERVER_TOOL_USE": {"target": UNIT}}, -) - -TOOL_USE_BLOCK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ToolUseBlock"), - members={ - "toolUseId": { - "target": TOOL_USE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": TOOL_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "input": { - "target": DOCUMENT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "type": {"target": TOOL_USE_TYPE}, - }, -) - -CONTENT_BLOCK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ContentBlock"), - shape_type=ShapeType.UNION, - members={ - "text": {"target": STRING}, - "image": {"target": IMAGE_BLOCK}, - "document": {"target": DOCUMENT_BLOCK}, - "video": {"target": VIDEO_BLOCK}, - "audio": {"target": AUDIO_BLOCK}, - "toolUse": {"target": TOOL_USE_BLOCK}, - "toolResult": {"target": TOOL_RESULT_BLOCK}, - "guardContent": {"target": GUARDRAIL_CONVERSE_CONTENT_BLOCK}, - "cachePoint": {"target": CACHE_POINT_BLOCK}, - "reasoningContent": {"target": REASONING_CONTENT_BLOCK}, - "citationsContent": {"target": CITATIONS_CONTENT_BLOCK}, - "searchResult": {"target": SEARCH_RESULT_BLOCK}, - "toolAddition": {"target": TOOL_ADDITION_BLOCK}, - "toolRemoval": {"target": TOOL_REMOVAL_BLOCK}, - }, -) - -CONTENT_BLOCKS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ContentBlocks"), - shape_type=ShapeType.LIST, - members={"member": {"target": CONTENT_BLOCK}}, -) - -CONVERSATION_ROLE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ConversationRole"), - shape_type=ShapeType.ENUM, - members={ - "USER": {"target": UNIT}, - "ASSISTANT": {"target": UNIT}, - "SYSTEM": {"target": UNIT}, - }, -) - -MESSAGE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#Message"), - members={ - "role": { - "target": CONVERSATION_ROLE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "content": { - "target": CONTENT_BLOCKS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -MESSAGES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#Messages"), - shape_type=ShapeType.LIST, - members={"member": {"target": MESSAGE}}, -) - -CONVERSATIONAL_MODEL_ID = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#ConversationalModelId"), - shape_type=ShapeType.STRING, -) - -JSON_SCHEMA_DEFINITION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#JsonSchemaDefinition"), - members={ - "schema": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": {"target": STRING}, - "description": {"target": STRING}, - }, -) - -OUTPUT_FORMAT_STRUCTURE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#OutputFormatStructure"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"jsonSchema": {"target": JSON_SCHEMA_DEFINITION}}, -) - -OUTPUT_FORMAT_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#OutputFormatType"), - shape_type=ShapeType.ENUM, - members={"JSON_SCHEMA": {"target": UNIT}}, -) - -OUTPUT_FORMAT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#OutputFormat"), - members={ - "type": { - "target": OUTPUT_FORMAT_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "structure": { - "target": OUTPUT_FORMAT_STRUCTURE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -OUTPUT_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#OutputConfig"), - members={"textFormat": {"target": OUTPUT_FORMAT}, "effort": {"target": STRING}}, -) - -PERFORMANCE_CONFIG_LATENCY = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#PerformanceConfigLatency"), - shape_type=ShapeType.ENUM, - members={"STANDARD": {"target": UNIT}, "OPTIMIZED": {"target": UNIT}}, -) - -PERFORMANCE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#PerformanceConfiguration"), - members={ - "latency": { - "target": PERFORMANCE_CONFIG_LATENCY, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="standard")], - } - }, -) - -PROMPT_VARIABLE_VALUES = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#PromptVariableValues"), - shape_type=ShapeType.UNION, - members={"text": {"target": STRING}}, -) - -PROMPT_VARIABLE_MAP = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#PromptVariableMap"), - shape_type=ShapeType.MAP, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"key": {"target": STRING}, "value": {"target": PROMPT_VARIABLE_VALUES}}, -) - -REQUEST_METADATA = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#RequestMetadata"), - shape_type=ShapeType.MAP, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"key": {"target": STRING}, "value": {"target": STRING}}, -) - -SERVICE_TIER_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ServiceTierType"), - shape_type=ShapeType.ENUM, - members={ - "PRIORITY": {"target": UNIT}, - "DEFAULT": {"target": UNIT}, - "FLEX": {"target": UNIT}, - "RESERVED": {"target": UNIT}, - }, -) - -SERVICE_TIER = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ServiceTier"), - members={ - "type": { - "target": SERVICE_TIER_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -SYSTEM_CONTENT_BLOCK = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#SystemContentBlock"), - shape_type=ShapeType.UNION, - members={ - "text": {"target": NON_EMPTY_STRING}, - "guardContent": {"target": GUARDRAIL_CONVERSE_CONTENT_BLOCK}, - "cachePoint": {"target": CACHE_POINT_BLOCK}, - }, -) - -SYSTEM_CONTENT_BLOCKS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#SystemContentBlocks"), - shape_type=ShapeType.LIST, - members={"member": {"target": SYSTEM_CONTENT_BLOCK}}, -) - -ANY_TOOL_CHOICE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#AnyToolChoice") -) - -AUTO_TOOL_CHOICE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#AutoToolChoice") -) - -SPECIFIC_TOOL_CHOICE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#SpecificToolChoice"), - members={ - "name": { - "target": TOOL_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -TOOL_CHOICE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ToolChoice"), - shape_type=ShapeType.UNION, - members={ - "auto": {"target": AUTO_TOOL_CHOICE}, - "any": {"target": ANY_TOOL_CHOICE}, - "tool": {"target": SPECIFIC_TOOL_CHOICE}, - }, -) - -SYSTEM_TOOL = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#SystemTool"), - members={ - "name": { - "target": TOOL_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -TOOL_INPUT_SCHEMA = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ToolInputSchema"), - shape_type=ShapeType.UNION, - members={"json": {"target": DOCUMENT}}, -) - -TOOL_SPECIFICATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ToolSpecification"), - members={ - "name": { - "target": TOOL_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": NON_EMPTY_STRING}, - "inputSchema": { - "target": TOOL_INPUT_SCHEMA, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "strict": {"target": BOOLEAN}, - }, -) - -TOOL = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#Tool"), - shape_type=ShapeType.UNION, - members={ - "toolSpec": {"target": TOOL_SPECIFICATION}, - "systemTool": {"target": SYSTEM_TOOL}, - "cachePoint": {"target": CACHE_POINT_BLOCK}, - }, -) - -TOOLS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#Tools"), - shape_type=ShapeType.LIST, - members={"member": {"target": TOOL}}, -) - -TOOL_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ToolConfiguration"), - members={ - "tools": { - "target": TOOLS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "toolChoice": {"target": TOOL_CHOICE}, - }, -) - -CONVERSE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ConverseInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockruntime#ConverseRequest", - ) - ], - members={ - "modelId": { - "target": CONVERSATIONAL_MODEL_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "messages": {"target": MESSAGES}, - "system": {"target": SYSTEM_CONTENT_BLOCKS}, - "inferenceConfig": {"target": INFERENCE_CONFIGURATION}, - "toolConfig": {"target": TOOL_CONFIGURATION}, - "guardrailConfig": {"target": GUARDRAIL_CONFIGURATION}, - "additionalModelRequestFields": {"target": DOCUMENT}, - "promptVariables": {"target": PROMPT_VARIABLE_MAP}, - "additionalModelResponseFieldPaths": { - "target": ADDITIONAL_MODEL_RESPONSE_FIELD_PATHS - }, - "requestMetadata": {"target": REQUEST_METADATA}, - "performanceConfig": {"target": PERFORMANCE_CONFIGURATION}, - "serviceTier": {"target": SERVICE_TIER}, - "outputConfig": {"target": OUTPUT_CONFIG}, - }, -) - -CONVERSE_METRICS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ConverseMetrics"), - members={ - "latencyMs": { - "target": LONG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -CONVERSE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ConverseOutput"), - shape_type=ShapeType.UNION, - members={"message": {"target": MESSAGE}}, -) - -STOP_REASON = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#StopReason"), - shape_type=ShapeType.ENUM, - members={ - "END_TURN": {"target": UNIT}, - "TOOL_USE": {"target": UNIT}, - "MAX_TOKENS": {"target": UNIT}, - "STOP_SEQUENCE": {"target": UNIT}, - "GUARDRAIL_INTERVENED": {"target": UNIT}, - "CONTENT_FILTERED": {"target": UNIT}, - "MALFORMED_MODEL_OUTPUT": {"target": UNIT}, - "MALFORMED_TOOL_USE": {"target": UNIT}, - "MODEL_CONTEXT_WINDOW_EXCEEDED": {"target": UNIT}, - }, -) - -GUARDRAIL_ASSESSMENT_MAP = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailAssessmentMap"), - shape_type=ShapeType.MAP, - members={"key": {"target": STRING}, "value": {"target": GUARDRAIL_ASSESSMENT}}, -) - -MODEL_OUTPUTS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ModelOutputs"), - shape_type=ShapeType.LIST, - members={"member": {"target": GUARDRAIL_OUTPUT_TEXT}}, -) - -GUARDRAIL_ASSESSMENT_LIST_MAP = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailAssessmentListMap"), - shape_type=ShapeType.MAP, - members={"key": {"target": STRING}, "value": {"target": GUARDRAIL_ASSESSMENT_LIST}}, -) - -GUARDRAIL_TRACE_ASSESSMENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailTraceAssessment"), - members={ - "modelOutput": {"target": MODEL_OUTPUTS}, - "inputAssessment": {"target": GUARDRAIL_ASSESSMENT_MAP}, - "outputAssessments": {"target": GUARDRAIL_ASSESSMENT_LIST_MAP}, - "actionReason": {"target": STRING}, - }, -) - -INVOKED_MODEL_ID = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#InvokedModelId"), - shape_type=ShapeType.STRING, -) - -PROMPT_ROUTER_TRACE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#PromptRouterTrace"), - members={"invokedModelId": {"target": INVOKED_MODEL_ID}}, -) - -CONVERSE_TRACE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ConverseTrace"), - members={ - "guardrail": {"target": GUARDRAIL_TRACE_ASSESSMENT}, - "promptRouter": {"target": PROMPT_ROUTER_TRACE}, - }, -) - -CACHE_DETAIL = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#CacheDetail"), - members={ - "ttl": { - "target": CACHE_TTL, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "inputTokens": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -CACHE_DETAILS_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#CacheDetailsList"), - shape_type=ShapeType.LIST, - members={"member": {"target": CACHE_DETAIL}}, -) - -TOKEN_USAGE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#TokenUsage"), - members={ - "inputTokens": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "outputTokens": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "totalTokens": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "cacheReadInputTokens": {"target": INTEGER}, - "cacheWriteInputTokens": {"target": INTEGER}, - "cacheDetails": {"target": CACHE_DETAILS_LIST}, - }, -) - -CONVERSE_OPERATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ConverseOperationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockruntime#ConverseResponse", - ) - ], - members={ - "output": { - "target": CONVERSE_OUTPUT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "stopReason": { - "target": STOP_REASON, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "usage": { - "target": TOKEN_USAGE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "metrics": { - "target": CONVERSE_METRICS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "additionalModelResponseFields": {"target": DOCUMENT}, - "trace": {"target": CONVERSE_TRACE}, - "performanceConfig": {"target": PERFORMANCE_CONFIGURATION}, - "serviceTier": {"target": SERVICE_TIER}, - }, -) - -STATUS_CODE = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#StatusCode"), shape_type=ShapeType.INTEGER -) - -MODEL_ERROR_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ModelErrorException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=424), - ], - members={ - "message": {"target": NON_BLANK_STRING}, - "originalStatusCode": {"target": STATUS_CODE}, - "resourceName": {"target": NON_BLANK_STRING}, - }, -) - -MODEL_NOT_READY_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ModelNotReadyException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=429), - ], - members={"message": {"target": NON_BLANK_STRING}}, -) - -MODEL_TIMEOUT_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ModelTimeoutException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=408), - ], - members={"message": {"target": NON_BLANK_STRING}}, -) - -CONVERSE = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#Converse"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "POST", "uri": "/model/{modelId}/converse"} - ), - ) - ], -) - -GUARDRAIL_STREAM_PROCESSING_MODE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailStreamProcessingMode"), - shape_type=ShapeType.ENUM, - members={"SYNC": {"target": UNIT}, "ASYNC": {"target": UNIT}}, -) - -GUARDRAIL_STREAM_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#GuardrailStreamConfiguration"), - members={ - "guardrailIdentifier": { - "target": GUARDRAIL_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="")], - }, - "guardrailVersion": { - "target": GUARDRAIL_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="")], - }, - "trace": { - "target": GUARDRAIL_TRACE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="disabled")], - }, - "streamProcessingMode": { - "target": GUARDRAIL_STREAM_PROCESSING_MODE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="sync")], - }, - }, -) - -CONVERSE_STREAM_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ConverseStreamInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockruntime#ConverseStreamRequest", - ) - ], - members={ - "modelId": { - "target": CONVERSATIONAL_MODEL_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "messages": {"target": MESSAGES}, - "system": {"target": SYSTEM_CONTENT_BLOCKS}, - "inferenceConfig": {"target": INFERENCE_CONFIGURATION}, - "toolConfig": {"target": TOOL_CONFIGURATION}, - "guardrailConfig": {"target": GUARDRAIL_STREAM_CONFIGURATION}, - "additionalModelRequestFields": {"target": DOCUMENT}, - "promptVariables": {"target": PROMPT_VARIABLE_MAP}, - "additionalModelResponseFieldPaths": { - "target": ADDITIONAL_MODEL_RESPONSE_FIELD_PATHS - }, - "requestMetadata": {"target": REQUEST_METADATA}, - "performanceConfig": {"target": PERFORMANCE_CONFIGURATION}, - "serviceTier": {"target": SERVICE_TIER}, - "outputConfig": {"target": OUTPUT_CONFIG}, - }, -) - -NON_NEGATIVE_INTEGER = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#NonNegativeInteger"), - shape_type=ShapeType.INTEGER, -) - -CITATION_SOURCE_CONTENT_DELTA = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#CitationSourceContentDelta"), - members={"text": {"target": STRING}}, -) - -CITATION_SOURCE_CONTENT_LIST_DELTA = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#CitationSourceContentListDelta"), - shape_type=ShapeType.LIST, - members={"member": {"target": CITATION_SOURCE_CONTENT_DELTA}}, -) - -CITATIONS_DELTA = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#CitationsDelta"), - members={ - "title": {"target": STRING}, - "source": {"target": STRING}, - "sourceContent": {"target": CITATION_SOURCE_CONTENT_LIST_DELTA}, - "location": {"target": CITATION_LOCATION}, - }, -) - -IMAGE_BLOCK_DELTA = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ImageBlockDelta"), - members={"source": {"target": IMAGE_SOURCE}, "error": {"target": ERROR_BLOCK}}, -) - -REASONING_CONTENT_BLOCK_DELTA = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ReasoningContentBlockDelta"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "text": {"target": STRING}, - "redactedContent": {"target": BLOB}, - "signature": {"target": STRING}, - }, -) - -TOOL_RESULT_BLOCK_DELTA = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ToolResultBlockDelta"), - shape_type=ShapeType.UNION, - members={"text": {"target": STRING}, "json": {"target": DOCUMENT}}, -) - -TOOL_RESULT_BLOCKS_DELTA = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ToolResultBlocksDelta"), - shape_type=ShapeType.LIST, - members={"member": {"target": TOOL_RESULT_BLOCK_DELTA}}, -) - -TOOL_USE_BLOCK_DELTA = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ToolUseBlockDelta"), - members={ - "input": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -CONTENT_BLOCK_DELTA = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ContentBlockDelta"), - shape_type=ShapeType.UNION, - members={ - "text": {"target": STRING}, - "toolUse": {"target": TOOL_USE_BLOCK_DELTA}, - "toolResult": {"target": TOOL_RESULT_BLOCKS_DELTA}, - "reasoningContent": {"target": REASONING_CONTENT_BLOCK_DELTA}, - "citation": {"target": CITATIONS_DELTA}, - "image": {"target": IMAGE_BLOCK_DELTA}, - }, -) - -CONTENT_BLOCK_DELTA_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ContentBlockDeltaEvent"), - members={ - "delta": { - "target": CONTENT_BLOCK_DELTA, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "contentBlockIndex": { - "target": NON_NEGATIVE_INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -IMAGE_BLOCK_START = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ImageBlockStart"), - members={ - "format": { - "target": IMAGE_FORMAT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -TOOL_RESULT_BLOCK_START = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ToolResultBlockStart"), - members={ - "toolUseId": { - "target": TOOL_USE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "type": {"target": STRING}, - "status": {"target": TOOL_RESULT_STATUS}, - }, -) - -TOOL_USE_BLOCK_START = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ToolUseBlockStart"), - members={ - "toolUseId": { - "target": TOOL_USE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": TOOL_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "type": {"target": TOOL_USE_TYPE}, - }, -) - -CONTENT_BLOCK_START = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ContentBlockStart"), - shape_type=ShapeType.UNION, - members={ - "toolUse": {"target": TOOL_USE_BLOCK_START}, - "toolResult": {"target": TOOL_RESULT_BLOCK_START}, - "image": {"target": IMAGE_BLOCK_START}, - }, -) - -CONTENT_BLOCK_START_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ContentBlockStartEvent"), - members={ - "start": { - "target": CONTENT_BLOCK_START, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "contentBlockIndex": { - "target": NON_NEGATIVE_INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -CONTENT_BLOCK_STOP_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ContentBlockStopEvent"), - members={ - "contentBlockIndex": { - "target": NON_NEGATIVE_INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -MESSAGE_START_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#MessageStartEvent"), - members={ - "role": { - "target": CONVERSATION_ROLE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -MESSAGE_STOP_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#MessageStopEvent"), - members={ - "stopReason": { - "target": STOP_REASON, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "additionalModelResponseFields": {"target": DOCUMENT}, - }, -) - -CONVERSE_STREAM_METRICS = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ConverseStreamMetrics"), - members={ - "latencyMs": { - "target": LONG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -CONVERSE_STREAM_TRACE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ConverseStreamTrace"), - members={ - "guardrail": {"target": GUARDRAIL_TRACE_ASSESSMENT}, - "promptRouter": {"target": PROMPT_ROUTER_TRACE}, - }, -) - -CONVERSE_STREAM_METADATA_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ConverseStreamMetadataEvent"), - members={ - "usage": { - "target": TOKEN_USAGE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "metrics": { - "target": CONVERSE_STREAM_METRICS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "trace": {"target": CONVERSE_STREAM_TRACE}, - "performanceConfig": {"target": PERFORMANCE_CONFIGURATION}, - "serviceTier": {"target": SERVICE_TIER}, - }, -) - -MODEL_STREAM_ERROR_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ModelStreamErrorException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=424), - ], - members={ - "message": {"target": NON_BLANK_STRING}, - "originalStatusCode": {"target": STATUS_CODE}, - "originalMessage": {"target": NON_BLANK_STRING}, - }, -) - -CONVERSE_STREAM_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ConverseStreamOutput"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#streaming"))], - members={ - "messageStart": {"target": MESSAGE_START_EVENT}, - "contentBlockStart": {"target": CONTENT_BLOCK_START_EVENT}, - "contentBlockDelta": {"target": CONTENT_BLOCK_DELTA_EVENT}, - "contentBlockStop": {"target": CONTENT_BLOCK_STOP_EVENT}, - "messageStop": {"target": MESSAGE_STOP_EVENT}, - "metadata": {"target": CONVERSE_STREAM_METADATA_EVENT}, - "internalServerException": {"target": INTERNAL_SERVER_EXCEPTION}, - "modelStreamErrorException": {"target": MODEL_STREAM_ERROR_EXCEPTION}, - "validationException": {"target": VALIDATION_EXCEPTION}, - "throttlingException": {"target": THROTTLING_EXCEPTION}, - "serviceUnavailableException": {"target": SERVICE_UNAVAILABLE_EXCEPTION}, - }, -) - -CONVERSE_STREAM_OPERATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ConverseStreamOperationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockruntime#ConverseStreamResponse", - ) - ], - members={ - "stream": { - "target": CONVERSE_STREAM_OUTPUT, - "traits": [Trait.new(id=ShapeID("smithy.api#httpPayload"))], - } - }, -) - -CONVERSE_STREAM = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#ConverseStream"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "POST", - "uri": "/model/{modelId}/converse-stream", - } - ), - ) - ], -) - -MIME_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#MimeType"), shape_type=ShapeType.STRING -) - -BODY = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#Body"), - shape_type=ShapeType.BLOB, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -INVOKE_MODEL_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#InvokeModelIdentifier"), - shape_type=ShapeType.STRING, -) - -REQUEST_METADATA_JSON = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#RequestMetadataJson"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -TRACE = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#Trace"), - shape_type=ShapeType.ENUM, - members={ - "ENABLED": {"target": UNIT}, - "DISABLED": {"target": UNIT}, - "ENABLED_FULL": {"target": UNIT}, - }, -) - -INVOKE_MODEL_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#InvokeModelInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockruntime#InvokeModelRequest", - ) - ], - members={ - "body": { - "target": BODY, - "traits": [Trait.new(id=ShapeID("smithy.api#httpPayload"))], - }, - "contentType": { - "target": MIME_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="Content-Type") - ], - }, - "accept": { - "target": MIME_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#httpHeader"), value="Accept")], - }, - "modelId": { - "target": INVOKE_MODEL_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "trace": { - "target": TRACE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), value="X-Amzn-Bedrock-Trace" - ) - ], - }, - "guardrailIdentifier": { - "target": GUARDRAIL_IDENTIFIER, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="X-Amzn-Bedrock-GuardrailIdentifier", - ) - ], - }, - "guardrailVersion": { - "target": GUARDRAIL_VERSION, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="X-Amzn-Bedrock-GuardrailVersion", - ) - ], - }, - "performanceConfigLatency": { - "target": PERFORMANCE_CONFIG_LATENCY, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value="standard"), - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="X-Amzn-Bedrock-PerformanceConfig-Latency", - ), - ], - }, - "serviceTier": { - "target": SERVICE_TIER_TYPE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="X-Amzn-Bedrock-Service-Tier", - ) - ], - }, - "requestMetadata": { - "target": REQUEST_METADATA_JSON, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="X-Amzn-Bedrock-Request-Metadata", - ) - ], - }, - }, -) - -INVOKE_MODEL_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#InvokeModelOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockruntime#InvokeModelResponse", - ) - ], - members={ - "body": { - "target": BODY, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpPayload")), - ], - }, - "contentType": { - "target": MIME_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="Content-Type"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "performanceConfigLatency": { - "target": PERFORMANCE_CONFIG_LATENCY, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="X-Amzn-Bedrock-PerformanceConfig-Latency", - ) - ], - }, - "serviceTier": { - "target": SERVICE_TIER_TYPE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="X-Amzn-Bedrock-Service-Tier", - ) - ], - }, - }, -) - -INVOKE_MODEL = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#InvokeModel"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "POST", "uri": "/model/{modelId}/invoke"} - ), - ) - ], -) - -PART_BODY = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#PartBody"), - shape_type=ShapeType.BLOB, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -BIDIRECTIONAL_INPUT_PAYLOAD_PART = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#BidirectionalInputPayloadPart"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"bytes": {"target": PART_BODY}}, -) - -INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#InvokeModelWithBidirectionalStreamInput"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#streaming"))], - members={"chunk": {"target": BIDIRECTIONAL_INPUT_PAYLOAD_PART}}, -) - -INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_OPERATION_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockruntime#InvokeModelWithBidirectionalStreamOperationInput" - ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockruntime#InvokeModelWithBidirectionalStreamRequest", - ) - ], - members={ - "modelId": { - "target": INVOKE_MODEL_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "body": { - "target": INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_INPUT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpPayload")), - ], - }, - }, -) - -BIDIRECTIONAL_OUTPUT_PAYLOAD_PART = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#BidirectionalOutputPayloadPart"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"bytes": {"target": PART_BODY}}, -) - -INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#InvokeModelWithBidirectionalStreamOutput"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#streaming"))], - members={ - "chunk": {"target": BIDIRECTIONAL_OUTPUT_PAYLOAD_PART}, - "internalServerException": {"target": INTERNAL_SERVER_EXCEPTION}, - "modelStreamErrorException": {"target": MODEL_STREAM_ERROR_EXCEPTION}, - "validationException": {"target": VALIDATION_EXCEPTION}, - "throttlingException": {"target": THROTTLING_EXCEPTION}, - "modelTimeoutException": {"target": MODEL_TIMEOUT_EXCEPTION}, - "serviceUnavailableException": {"target": SERVICE_UNAVAILABLE_EXCEPTION}, - }, -) - -INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_OPERATION_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrockruntime#InvokeModelWithBidirectionalStreamOperationOutput" - ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockruntime#InvokeModelWithBidirectionalStreamResponse", - ) - ], - members={ - "body": { - "target": INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_OUTPUT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpPayload")), - ], - } - }, -) - -INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#InvokeModelWithBidirectionalStream"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "POST", - "uri": "/model/{modelId}/invoke-with-bidirectional-stream", - } - ), - ) - ], -) - -INVOKE_MODEL_WITH_RESPONSE_STREAM_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#InvokeModelWithResponseStreamInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockruntime#InvokeModelWithResponseStreamRequest", - ) - ], - members={ - "body": { - "target": BODY, - "traits": [Trait.new(id=ShapeID("smithy.api#httpPayload"))], - }, - "contentType": { - "target": MIME_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="Content-Type") - ], - }, - "accept": { - "target": MIME_TYPE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), value="X-Amzn-Bedrock-Accept" - ) - ], - }, - "modelId": { - "target": INVOKE_MODEL_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "trace": { - "target": TRACE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), value="X-Amzn-Bedrock-Trace" - ) - ], - }, - "guardrailIdentifier": { - "target": GUARDRAIL_IDENTIFIER, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="X-Amzn-Bedrock-GuardrailIdentifier", - ) - ], - }, - "guardrailVersion": { - "target": GUARDRAIL_VERSION, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="X-Amzn-Bedrock-GuardrailVersion", - ) - ], - }, - "performanceConfigLatency": { - "target": PERFORMANCE_CONFIG_LATENCY, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value="standard"), - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="X-Amzn-Bedrock-PerformanceConfig-Latency", - ), - ], - }, - "serviceTier": { - "target": SERVICE_TIER_TYPE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="X-Amzn-Bedrock-Service-Tier", - ) - ], - }, - "requestMetadata": { - "target": REQUEST_METADATA_JSON, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="X-Amzn-Bedrock-Request-Metadata", - ) - ], - }, - }, -) - -PAYLOAD_PART = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#PayloadPart"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"bytes": {"target": PART_BODY}}, -) - -RESPONSE_STREAM = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ResponseStream"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#streaming"))], - members={ - "chunk": {"target": PAYLOAD_PART}, - "internalServerException": {"target": INTERNAL_SERVER_EXCEPTION}, - "modelStreamErrorException": {"target": MODEL_STREAM_ERROR_EXCEPTION}, - "validationException": {"target": VALIDATION_EXCEPTION}, - "throttlingException": {"target": THROTTLING_EXCEPTION}, - "modelTimeoutException": {"target": MODEL_TIMEOUT_EXCEPTION}, - "serviceUnavailableException": {"target": SERVICE_UNAVAILABLE_EXCEPTION}, - }, -) - -INVOKE_MODEL_WITH_RESPONSE_STREAM_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#InvokeModelWithResponseStreamOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockruntime#InvokeModelWithResponseStreamResponse", - ) - ], - members={ - "body": { - "target": RESPONSE_STREAM, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpPayload")), - ], - }, - "contentType": { - "target": MIME_TYPE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="X-Amzn-Bedrock-Content-Type", - ), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "performanceConfigLatency": { - "target": PERFORMANCE_CONFIG_LATENCY, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="X-Amzn-Bedrock-PerformanceConfig-Latency", - ) - ], - }, - "serviceTier": { - "target": SERVICE_TIER_TYPE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="X-Amzn-Bedrock-Service-Tier", - ) - ], - }, - }, -) - -INVOKE_MODEL_WITH_RESPONSE_STREAM = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#InvokeModelWithResponseStream"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "POST", - "uri": "/model/{modelId}/invoke-with-response-stream", - } - ), - ) - ], -) - -CONVERSE_TOKENS_REQUEST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#ConverseTokensRequest"), - members={ - "messages": {"target": MESSAGES}, - "system": {"target": SYSTEM_CONTENT_BLOCKS}, - "toolConfig": {"target": TOOL_CONFIGURATION}, - "additionalModelRequestFields": {"target": DOCUMENT}, - }, -) - -INVOKE_MODEL_TOKENS_REQUEST = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#InvokeModelTokensRequest"), - members={ - "body": { - "target": BODY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -COUNT_TOKENS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#CountTokensInput"), - shape_type=ShapeType.UNION, - members={ - "invokeModel": {"target": INVOKE_MODEL_TOKENS_REQUEST}, - "converse": {"target": CONVERSE_TOKENS_REQUEST}, - }, -) - -FOUNDATION_MODEL_VERSION_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#FoundationModelVersionIdentifier"), - shape_type=ShapeType.STRING, -) - -COUNT_TOKENS_OPERATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#CountTokensOperationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockruntime#CountTokensRequest", - ) - ], - members={ - "modelId": { - "target": FOUNDATION_MODEL_VERSION_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "input": { - "target": COUNT_TOKENS_INPUT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -COUNT_TOKENS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrockruntime#CountTokensOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrockruntime#CountTokensResponse", - ) - ], - members={ - "inputTokens": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -COUNT_TOKENS = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#CountTokens"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "POST", "uri": "/model/{modelId}/count-tokens"} - ), - ) - ], -) - -AMAZON_BEDROCK_FRONTEND_SERVICE = Schema( - id=ShapeID("com.amazonaws.bedrockruntime#AmazonBedrockFrontendService"), - shape_type=ShapeType.SERVICE, - traits=[ - Trait.new( - id=ShapeID("aws.auth#sigv4"), value=MappingProxyType({"name": "bedrock"}) - ), - Trait.new( - id=ShapeID("smithy.rules#endpointBdd"), - value=MappingProxyType( - { - "version": "1.1", - "parameters": MappingProxyType( - { - "Region": MappingProxyType( - { - "builtIn": "AWS::Region", - "required": False, - "documentation": "The AWS region used to dispatch the request.", - "type": "string", - } - ), - "UseDualStack": MappingProxyType( - { - "builtIn": "AWS::UseDualStack", - "required": True, - "default": False, - "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", - "type": "boolean", - } - ), - "UseFIPS": MappingProxyType( - { - "builtIn": "AWS::UseFIPS", - "required": True, - "default": False, - "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", - "type": "boolean", - } - ), - "Endpoint": MappingProxyType( - { - "builtIn": "SDK::Endpoint", - "required": False, - "documentation": "Override the endpoint used to send this request", - "type": "string", - } - ), - } - ), - "conditions": ( - MappingProxyType( - { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "Endpoint"}),), - } - ), - MappingProxyType( - { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "Region"}),), - } - ), - MappingProxyType( - { - "fn": "aws.partition", - "argv": (MappingProxyType({"ref": "Region"}),), - "assign": "PartitionResult", - } - ), - MappingProxyType( +AMAZON_BEDROCK_FRONTEND_SERVICE: StaticSchema = ( + 21, + n0, + _ABFS, + { + _aw: MappingProxyType({"name": "bedrock"}), + _sBm: MappingProxyType( + { + "version": "1.1", + "parameters": MappingProxyType( + { + "Region": MappingProxyType( { - "fn": "booleanEquals", - "argv": (MappingProxyType({"ref": "UseFIPS"}), True), + "builtIn": "AWS::Region", + "required": False, + "documentation": "The AWS region used to dispatch the request.", + "type": "string", } ), - MappingProxyType( + "UseDualStack": MappingProxyType( { - "fn": "booleanEquals", - "argv": ( - MappingProxyType({"ref": "UseDualStack"}), - True, - ), + "builtIn": "AWS::UseDualStack", + "required": True, + "default": False, + "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", + "type": "boolean", } ), - MappingProxyType( + "UseFIPS": MappingProxyType( { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "supportsDualStack", - ), - } - ), - True, - ), + "builtIn": "AWS::UseFIPS", + "required": True, + "default": False, + "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", + "type": "boolean", } ), - MappingProxyType( + "Endpoint": MappingProxyType( { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "supportsFIPS", - ), - } - ), - True, - ), + "builtIn": "SDK::Endpoint", + "required": False, + "documentation": "Override the endpoint used to send this request", + "type": "string", } ), + } + ), + "conditions": ( + MappingProxyType( + { + "fn": "isSet", + "argv": (MappingProxyType({"ref": "Endpoint"}),), + } ), - "results": ( - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: FIPS and custom endpoint are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": MappingProxyType({"ref": "Endpoint"}), - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://bedrock-runtime-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "FIPS and DualStack are enabled, but this partition does not support one or both", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://bedrock-runtime-fips.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "FIPS is enabled but this partition does not support FIPS", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + MappingProxyType( + {"fn": "isSet", "argv": (MappingProxyType({"ref": "Region"}),)} + ), + MappingProxyType( + { + "fn": "aws.partition", + "argv": (MappingProxyType({"ref": "Region"}),), + "assign": "PartitionResult", + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": (MappingProxyType({"ref": "UseFIPS"}), True), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": (MappingProxyType({"ref": "UseDualStack"}), True), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( { - "url": "https://bedrock-runtime.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "supportsDualStack", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "DualStack is enabled but this partition does not support DualStack", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + True, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( { - "url": "https://bedrock-runtime.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "supportsFIPS", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: Missing Region", - "type": "error", - } - ), + True, + ), + } + ), + ), + "results": ( + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: FIPS and custom endpoint are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": MappingProxyType({"ref": "Endpoint"}), + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://bedrock-runtime-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } ), - "root": 2, - "nodeCount": 13, - "nodes": "/////wAAAAH/////AAAAAAAAAAwAAAADAAAAAQAAAAQF9eELAAAAAgAAAAUF9eELAAAAAwAAAAgAAAAGAAAABAAAAAcF9eEKAAAABQX14QgF9eEJAAAABAAAAAoAAAAJAAAABgX14QYF9eEHAAAABQAAAAsF9eEFAAAABgX14QQF9eEFAAAAAwX14QEAAAANAAAABAX14QIF9eED", - } - ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS and DualStack are enabled, but this partition does not support one or both", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://bedrock-runtime-fips.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS is enabled but this partition does not support FIPS", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://bedrock-runtime.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "DualStack is enabled but this partition does not support DualStack", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://bedrock-runtime.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Missing Region", + "type": "error", + } + ), + ), + "root": 2, + "nodeCount": 13, + "nodes": "/////wAAAAH/////AAAAAAAAAAwAAAADAAAAAQAAAAQF9eELAAAAAgAAAAUF9eELAAAAAwAAAAgAAAAGAAAABAAAAAcF9eEKAAAABQX14QgF9eEJAAAABAAAAAoAAAAJAAAABgX14QYF9eEHAAAABQAAAAsF9eEFAAAABgX14QQF9eEFAAAAAwX14QEAAAANAAAABAX14QIF9eED", + } ), - Trait.new( - id=ShapeID("aws.api#service"), - value=MappingProxyType( - { - "sdkId": "Bedrock Runtime", - "endpointPrefix": "bedrock-runtime", - "cloudTrailEventSource": "bedrock.amazonaws.com", - } - ), + _aws: MappingProxyType( + { + "sdkId": "Bedrock Runtime", + "endpointPrefix": "bedrock-runtime", + "cloudTrailEventSource": "bedrock.amazonaws.com", + } ), - Trait.new( - id=ShapeID("aws.protocols#restJson1"), - value=MappingProxyType( - {"http": ("h2", "http/1.1"), "eventStreamHttp": ("h2", "http/1.1")} - ), + _aJ: MappingProxyType( + {"http": ("h2", "http/1.1"), "eventStreamHttp": ("h2", "http/1.1")} ), - Trait.new(id=ShapeID("smithy.api#httpBearerAuth")), - ], + _sBA: None, + }, ) diff --git a/clients/aws-sdk-bedrock-runtime/src/aws_sdk_bedrock_runtime/client.py b/clients/aws-sdk-bedrock-runtime/src/aws_sdk_bedrock_runtime/client.py index 9307a5f4..37307036 100644 --- a/clients/aws-sdk-bedrock-runtime/src/aws_sdk_bedrock_runtime/client.py +++ b/clients/aws-sdk-bedrock-runtime/src/aws_sdk_bedrock_runtime/client.py @@ -1,47 +1,37 @@ # Code generated by smithy-python-codegen DO NOT EDIT. +from __future__ import annotations + from copy import deepcopy import logging from typing import Any, cast +from smithy_aws_core.aio.identity.chain import AsyncIdentityChain from smithy_aws_core.config import ConfigSource from smithy_aws_core.identity import AWSCredentialsIdentity -from smithy_aws_core.identity.chain import IdentityChain -from smithy_core.aio.client import AsyncClient, ClientCall, RequestPipeline -from smithy_core.aio.eventstream import DuplexEventStream, OutputEventStream +from smithy_core.aio.client import AsyncClient, AsyncClientCall, AsyncRequestPipeline +from smithy_core.aio.eventstream import AsyncDuplexEventStream, AsyncOutputEventStream from smithy_core.deserializers import DeserializeableShape from smithy_core.exceptions import ExpectationNotMetError from smithy_core.schemas import APIOperation from smithy_core.serializers import SerializeableShape -from smithy_http.aio.interfaces import HTTPClient +from smithy_http.aio.interfaces import AsyncHTTPClient from smithy_http.plugins import user_agent_plugin from .config import AsyncBedrockRuntimeConfig, Plugin from .models import ( APPLY_GUARDRAIL, - ApplyGuardrailInput, - ApplyGuardrailOutput, CONVERSE, CONVERSE_STREAM, COUNT_TOKENS, - ConverseInput, - ConverseOperationOutput, ConverseStreamInput, ConverseStreamOperationOutput, ConverseStreamOutput, - CountTokensOperationInput, - CountTokensOutput, GET_ASYNC_INVOKE, - GetAsyncInvokeInput, - GetAsyncInvokeOutput, INVOKE_GUARDRAIL_CHECKS, INVOKE_MODEL, INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM, INVOKE_MODEL_WITH_RESPONSE_STREAM, - InvokeGuardrailChecksInput, - InvokeGuardrailChecksOutput, - InvokeModelInput, - InvokeModelOutput, InvokeModelWithBidirectionalStreamInput, InvokeModelWithBidirectionalStreamOperationInput, InvokeModelWithBidirectionalStreamOperationOutput, @@ -49,18 +39,36 @@ InvokeModelWithResponseStreamInput, InvokeModelWithResponseStreamOutput, LIST_ASYNC_INVOKES, - ListAsyncInvokesInput, - ListAsyncInvokesOutput, ResponseStream, START_ASYNC_INVOKE, - StartAsyncInvokeInput, - StartAsyncInvokeOutput, _ConverseStreamOutputDeserializer, _InvokeModelWithBidirectionalStreamOutputDeserializer, _ResponseStreamDeserializer, ) from .user_agent import aws_user_agent_plugin +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .models import ( + ApplyGuardrailInput, + ApplyGuardrailOutput, + ConverseInput, + ConverseOperationOutput, + CountTokensOperationInput, + CountTokensOutput, + GetAsyncInvokeInput, + GetAsyncInvokeOutput, + InvokeGuardrailChecksInput, + InvokeGuardrailChecksOutput, + InvokeModelInput, + InvokeModelOutput, + ListAsyncInvokesInput, + ListAsyncInvokesOutput, + StartAsyncInvokeInput, + StartAsyncInvokeOutput, + ) + logger = logging.getLogger(__name__) @@ -129,12 +137,12 @@ async def _post_setup(self, config: AsyncBedrockRuntimeConfig) -> None: config_file = await config_context.parsed_profiles() if config_context.profile_source is ConfigSource.OVERRIDE: profile_name = config_context.profile_name - config.aws_credentials_identity_resolver = await IdentityChain.create( + config.aws_credentials_identity_resolver = await AsyncIdentityChain.create( AWSCredentialsIdentity, config_file=config_file, profile_name=profile_name, region_override=config.region, - http_client=cast(HTTPClient | None, config.transport), + http_client=cast(AsyncHTTPClient | None, config.transport), ) async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( @@ -143,7 +151,7 @@ async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( operation: APIOperation[I, O], default_plugins: list[Plugin], plugins: list[Plugin] | None, - ) -> tuple[RequestPipeline[Any, Any], ClientCall[I, O]]: + ) -> tuple[AsyncRequestPipeline[Any, Any], AsyncClientCall[I, O]]: if self._closed: raise RuntimeError( "Cannot invoke an operation on a client that has been closed." @@ -276,7 +284,7 @@ async def converse( async def converse_stream( self, input: ConverseStreamInput, plugins: list[Plugin] | None = None - ) -> OutputEventStream[ConverseStreamOutput, ConverseStreamOperationOutput]: + ) -> AsyncOutputEventStream[ConverseStreamOutput, ConverseStreamOperationOutput]: """ Sends messages to the specified Amazon Bedrock model and returns the response in a stream. `ConverseStream` provides a consistent API that @@ -350,7 +358,7 @@ async def converse_stream( invocations. Returns: - An `OutputEventStream` for server-to-client streaming. + An `AsyncOutputEventStream` for server-to-client streaming. """ pipeline, call = await self._prepare_call(input, CONVERSE_STREAM, [], plugins) return await pipeline.output_stream( @@ -501,7 +509,7 @@ async def invoke_model_with_bidirectional_stream( self, input: InvokeModelWithBidirectionalStreamOperationInput, plugins: list[Plugin] | None = None, - ) -> DuplexEventStream[ + ) -> AsyncDuplexEventStream[ InvokeModelWithBidirectionalStreamInput, InvokeModelWithBidirectionalStreamOutput, InvokeModelWithBidirectionalStreamOperationOutput, @@ -529,7 +537,7 @@ async def invoke_model_with_bidirectional_stream( invocations. Returns: - A `DuplexEventStream` for bidirectional streaming. + An `AsyncDuplexEventStream` for bidirectional streaming. """ pipeline, call = await self._prepare_call( input, INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM, [], plugins @@ -545,7 +553,7 @@ async def invoke_model_with_response_stream( self, input: InvokeModelWithResponseStreamInput, plugins: list[Plugin] | None = None, - ) -> OutputEventStream[ResponseStream, InvokeModelWithResponseStreamOutput]: + ) -> AsyncOutputEventStream[ResponseStream, InvokeModelWithResponseStreamOutput]: """ Invoke the specified Amazon Bedrock model to run inference using the prompt and inference parameters provided in the request body. The @@ -592,7 +600,7 @@ async def invoke_model_with_response_stream( invocations. Returns: - An `OutputEventStream` for server-to-client streaming. + An `AsyncOutputEventStream` for server-to-client streaming. """ pipeline, call = await self._prepare_call( input, INVOKE_MODEL_WITH_RESPONSE_STREAM, [], plugins diff --git a/clients/aws-sdk-bedrock-runtime/src/aws_sdk_bedrock_runtime/config.py b/clients/aws-sdk-bedrock-runtime/src/aws_sdk_bedrock_runtime/config.py index 01016847..ae942940 100644 --- a/clients/aws-sdk-bedrock-runtime/src/aws_sdk_bedrock_runtime/config.py +++ b/clients/aws-sdk-bedrock-runtime/src/aws_sdk_bedrock_runtime/config.py @@ -1,93 +1,107 @@ # Code generated by smithy-python-codegen DO NOT EDIT. from dataclasses import dataclass, field -from typing import Any, Callable, ClassVar, Self, TypeAlias, Union, Unpack +from typing import ( + Any, + Callable, + ClassVar, + Self, + TYPE_CHECKING, + TypeAlias, + Union, + Unpack, +) -from smithy_aws_core.aio.protocols import RestJsonClientProtocol -from smithy_aws_core.auth import SigV4AuthScheme -from smithy_aws_core.config import AwsConfigOverrides, FileSystem -from smithy_aws_core.config.aws_config import AsyncAwsConfig -from smithy_aws_core.config.resolvers import EndpointUriResolver -from smithy_aws_core.config.types import FieldSpec -from smithy_aws_core.endpoints.standard_regional import ( - StandardRegionalEndpointsResolver, +from smithy_aws_core.aio.auth.sigv4 import AsyncSigV4AuthScheme +from smithy_aws_core.aio.config import AsyncFileSystem +from smithy_aws_core.aio.config.aws_config import AsyncAwsConfig, AwsConfigOverrides +from smithy_aws_core.aio.config.resolvers import EndpointUriResolver +from smithy_aws_core.aio.endpoints.standard_regional import ( + AsyncStandardRegionalEndpointsResolver, ) +from smithy_aws_core.aio.protocols import AsyncRestJsonClientProtocol +from smithy_aws_core.config.types import FieldSpec from smithy_aws_core.identity import AWSCredentialsIdentity, AWSIdentityProperties -from smithy_core.aio.interfaces import ( - ClientProtocol, - EndpointResolver, - ProtocolConstructor, - ProtocolSettings, -) -from smithy_core.aio.interfaces.auth import AuthScheme -from smithy_core.aio.interfaces.identity import IdentityResolver -from smithy_core.interceptors import Interceptor +from smithy_core.aio.interfaces import AsyncClientProtocol, AsyncEndpointResolver +from smithy_core.aio.interfaces.auth import AsyncAuthScheme +from smithy_core.aio.interfaces.identity import AsyncIdentityResolver +from smithy_core.interfaces import ProtocolConstructor, ProtocolSettings from smithy_core.interfaces.auth import AuthSchemeResolver from smithy_core.shapes import ShapeID from smithy_http.aio.aiohttp import AIOHTTPClient +from ._private.schemas import AMAZON_BEDROCK_FRONTEND_SERVICE from .auth import HTTPAuthSchemeResolver -from .models import ( - ApplyGuardrailInput, - ApplyGuardrailOutput, - ConverseInput, - ConverseOperationOutput, - ConverseStreamInput, - ConverseStreamOperationOutput, - CountTokensOperationInput, - CountTokensOutput, - GetAsyncInvokeInput, - GetAsyncInvokeOutput, - InvokeGuardrailChecksInput, - InvokeGuardrailChecksOutput, - InvokeModelInput, - InvokeModelOutput, - InvokeModelWithBidirectionalStreamOperationInput, - InvokeModelWithBidirectionalStreamOperationOutput, - InvokeModelWithResponseStreamInput, - InvokeModelWithResponseStreamOutput, - ListAsyncInvokesInput, - ListAsyncInvokesOutput, - StartAsyncInvokeInput, - StartAsyncInvokeOutput, -) -_ServiceInterceptor = Union[ - Interceptor[ApplyGuardrailInput, ApplyGuardrailOutput, Any, Any], - Interceptor[ConverseInput, ConverseOperationOutput, Any, Any], - Interceptor[ConverseStreamInput, ConverseStreamOperationOutput, Any, Any], - Interceptor[CountTokensOperationInput, CountTokensOutput, Any, Any], - Interceptor[GetAsyncInvokeInput, GetAsyncInvokeOutput, Any, Any], - Interceptor[InvokeGuardrailChecksInput, InvokeGuardrailChecksOutput, Any, Any], - Interceptor[InvokeModelInput, InvokeModelOutput, Any, Any], - Interceptor[ +if TYPE_CHECKING: + from smithy_core.interceptors import Interceptor + from .models import ( + ApplyGuardrailInput, + ApplyGuardrailOutput, + ConverseInput, + ConverseOperationOutput, + ConverseStreamInput, + ConverseStreamOperationOutput, + CountTokensOperationInput, + CountTokensOutput, + GetAsyncInvokeInput, + GetAsyncInvokeOutput, + InvokeGuardrailChecksInput, + InvokeGuardrailChecksOutput, + InvokeModelInput, + InvokeModelOutput, InvokeModelWithBidirectionalStreamOperationInput, InvokeModelWithBidirectionalStreamOperationOutput, - Any, - Any, - ], - Interceptor[ InvokeModelWithResponseStreamInput, InvokeModelWithResponseStreamOutput, - Any, - Any, - ], - Interceptor[ListAsyncInvokesInput, ListAsyncInvokesOutput, Any, Any], - Interceptor[StartAsyncInvokeInput, StartAsyncInvokeOutput, Any, Any], -] + ListAsyncInvokesInput, + ListAsyncInvokesOutput, + StartAsyncInvokeInput, + StartAsyncInvokeOutput, + ) + + _ServiceInterceptor = Union[ + Interceptor[ApplyGuardrailInput, ApplyGuardrailOutput, Any, Any], + Interceptor[ConverseInput, ConverseOperationOutput, Any, Any], + Interceptor[ConverseStreamInput, ConverseStreamOperationOutput, Any, Any], + Interceptor[CountTokensOperationInput, CountTokensOutput, Any, Any], + Interceptor[GetAsyncInvokeInput, GetAsyncInvokeOutput, Any, Any], + Interceptor[InvokeGuardrailChecksInput, InvokeGuardrailChecksOutput, Any, Any], + Interceptor[InvokeModelInput, InvokeModelOutput, Any, Any], + Interceptor[ + InvokeModelWithBidirectionalStreamOperationInput, + InvokeModelWithBidirectionalStreamOperationOutput, + Any, + Any, + ], + Interceptor[ + InvokeModelWithResponseStreamInput, + InvokeModelWithResponseStreamOutput, + Any, + Any, + ], + Interceptor[ListAsyncInvokesInput, ListAsyncInvokesOutput, Any, Any], + Interceptor[StartAsyncInvokeInput, StartAsyncInvokeOutput, Any, Any], + ] +else: + _ServiceInterceptor = Any + _PROTOCOL_SETTINGS = ProtocolSettings( namespace="com.amazonaws.bedrockruntime", service_target="AmazonBedrockFrontendService", + service_schema=AMAZON_BEDROCK_FRONTEND_SERVICE, ) class _AsyncBedrockRuntimeConfigOverrides(AwsConfigOverrides, total=False): - endpoint_resolver: EndpointResolver | None + endpoint_resolver: AsyncEndpointResolver | None protocol: ( - ClientProtocol[Any, Any] | ProtocolConstructor[ClientProtocol[Any, Any]] | None + AsyncClientProtocol[Any, Any] + | ProtocolConstructor[AsyncClientProtocol[Any, Any]] + | None ) - auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None + auth_schemes: dict[ShapeID, AsyncAuthScheme[Any, Any, Any, Any]] | None auth_scheme_resolver: AuthSchemeResolver | None @@ -95,17 +109,17 @@ class _AsyncBedrockRuntimeConfigOverrides(AwsConfigOverrides, total=False): class AsyncBedrockRuntimeConfig(AsyncAwsConfig): """Bedrock Runtime configuration (async-resolved).""" - endpoint_resolver: EndpointResolver | None = None + endpoint_resolver: AsyncEndpointResolver | None = None """ The endpoint resolver used to resolve the final endpoint per-operation based on the configuration. """ - protocol: ClientProtocol[Any, Any] | None = None + protocol: AsyncClientProtocol[Any, Any] | None = None """ Pass a protocol class reference from smithy_aws_core.aio.protocols to - select the protocol, e.g. protocol=AwsJson10ClientProtocol. For custom - protocols a protocol instance may also be passed. + select the protocol, e.g. protocol=AsyncAwsJson10ClientProtocol. For + custom protocols a protocol instance may also be passed. """ interceptors: list[_ServiceInterceptor] = field(default_factory=lambda: []) @@ -114,7 +128,7 @@ class AsyncBedrockRuntimeConfig(AsyncAwsConfig): execution of a request. """ - auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None = None + auth_schemes: dict[ShapeID, AsyncAuthScheme[Any, Any, Any, Any]] | None = None """A map of auth scheme ids to auth schemes.""" auth_scheme_resolver: AuthSchemeResolver | None = None @@ -124,7 +138,7 @@ class AsyncBedrockRuntimeConfig(AsyncAwsConfig): """ aws_credentials_identity_resolver: ( - IdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None + AsyncIdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None ) = None """Resolves AWS Credentials. Required for operations that use Sigv4 Auth.""" @@ -165,24 +179,24 @@ class AsyncBedrockRuntimeConfig(AsyncAwsConfig): default=None, resolver=EndpointUriResolver("bedrock_runtime") ), "endpoint_resolver": FieldSpec( - default_factory=lambda: StandardRegionalEndpointsResolver( + default_factory=lambda: AsyncStandardRegionalEndpointsResolver( endpoint_prefix="bedrock-runtime" ) ), "protocol": FieldSpec( - default_factory=lambda: RestJsonClientProtocol(_PROTOCOL_SETTINGS), + default_factory=lambda: AsyncRestJsonClientProtocol(_PROTOCOL_SETTINGS), converter=lambda p: p(_PROTOCOL_SETTINGS) if isinstance(p, type) else p, ), "auth_schemes": FieldSpec( default_factory=lambda: { - ShapeID("aws.auth#sigv4"): SigV4AuthScheme(service="bedrock") + ShapeID("aws.auth#sigv4"): AsyncSigV4AuthScheme(service="bedrock") } ), "auth_scheme_resolver": FieldSpec(default_factory=HTTPAuthSchemeResolver), "transport": FieldSpec(default_factory=lambda: AIOHTTPClient()), } - def set_auth_scheme(self, scheme: AuthScheme[Any, Any, Any, Any]) -> None: + def set_auth_scheme(self, scheme: AsyncAuthScheme[Any, Any, Any, Any]) -> None: """ Set an auth scheme implementation using its scheme ID. :param scheme: The auth scheme to add or replace. @@ -196,7 +210,7 @@ async def resolve( # pyright: ignore[reportIncompatibleMethodOverride] cls, *, profile: str | None = None, - fs: FileSystem | None = None, + fs: AsyncFileSystem | None = None, config_file_path: str | None = None, credentials_file_path: str | None = None, **overrides: Unpack[_AsyncBedrockRuntimeConfigOverrides], diff --git a/clients/aws-sdk-bedrock-runtime/src/aws_sdk_bedrock_runtime/models.py b/clients/aws-sdk-bedrock-runtime/src/aws_sdk_bedrock_runtime/models.py index 03cb9490..69435b6a 100644 --- a/clients/aws-sdk-bedrock-runtime/src/aws_sdk_bedrock_runtime/models.py +++ b/clients/aws-sdk-bedrock-runtime/src/aws_sdk_bedrock_runtime/models.py @@ -1,229 +1,54 @@ # Code generated by smithy-python-codegen DO NOT EDIT. -from dataclasses import dataclass, field -from datetime import datetime, timezone -from enum import StrEnum -import logging -from typing import Any, Literal, Self, Union +from __future__ import annotations -from smithy_core.deserializers import ShapeDeserializer -from smithy_core.documents import Document, TypeRegistry -from smithy_core.exceptions import ModeledError, SerializationError -from smithy_core.response import EMPTY_RESPONSE_METADATA, ResponseMetadata -from smithy_core.schemas import APIOperation, Schema -from smithy_core.serializers import ShapeSerializer +from ._private import schemas as _schemas +from smithy_core._dynamic_models import ModelRegistry +from smithy_core.exceptions import ModeledError +from smithy_core.schemas import APIOperation from smithy_core.shapes import ShapeID -from smithy_core.types import UnknownEnumMixin from ._private.schemas import ( - ACCESS_DENIED_EXCEPTION as _SCHEMA_ACCESS_DENIED_EXCEPTION, - ANY_TOOL_CHOICE as _SCHEMA_ANY_TOOL_CHOICE, - APPLIED_GUARDRAIL_DETAILS as _SCHEMA_APPLIED_GUARDRAIL_DETAILS, APPLY_GUARDRAIL as _SCHEMA_APPLY_GUARDRAIL, - APPLY_GUARDRAIL_INPUT as _SCHEMA_APPLY_GUARDRAIL_INPUT, - APPLY_GUARDRAIL_OUTPUT as _SCHEMA_APPLY_GUARDRAIL_OUTPUT, - ASYNC_INVOKE_OUTPUT_DATA_CONFIG as _SCHEMA_ASYNC_INVOKE_OUTPUT_DATA_CONFIG, - ASYNC_INVOKE_S3_OUTPUT_DATA_CONFIG as _SCHEMA_ASYNC_INVOKE_S3_OUTPUT_DATA_CONFIG, - ASYNC_INVOKE_SUMMARY as _SCHEMA_ASYNC_INVOKE_SUMMARY, - AUDIO_BLOCK as _SCHEMA_AUDIO_BLOCK, - AUDIO_SOURCE as _SCHEMA_AUDIO_SOURCE, - AUTO_TOOL_CHOICE as _SCHEMA_AUTO_TOOL_CHOICE, - BIDIRECTIONAL_INPUT_PAYLOAD_PART as _SCHEMA_BIDIRECTIONAL_INPUT_PAYLOAD_PART, - BIDIRECTIONAL_OUTPUT_PAYLOAD_PART as _SCHEMA_BIDIRECTIONAL_OUTPUT_PAYLOAD_PART, - CACHE_DETAIL as _SCHEMA_CACHE_DETAIL, - CACHE_POINT_BLOCK as _SCHEMA_CACHE_POINT_BLOCK, - CITATION as _SCHEMA_CITATION, - CITATIONS_CONFIG as _SCHEMA_CITATIONS_CONFIG, - CITATIONS_CONTENT_BLOCK as _SCHEMA_CITATIONS_CONTENT_BLOCK, - CITATIONS_DELTA as _SCHEMA_CITATIONS_DELTA, - CITATION_GENERATED_CONTENT as _SCHEMA_CITATION_GENERATED_CONTENT, - CITATION_LOCATION as _SCHEMA_CITATION_LOCATION, - CITATION_SOURCE_CONTENT as _SCHEMA_CITATION_SOURCE_CONTENT, - CITATION_SOURCE_CONTENT_DELTA as _SCHEMA_CITATION_SOURCE_CONTENT_DELTA, - CONFLICT_EXCEPTION as _SCHEMA_CONFLICT_EXCEPTION, - CONTENT_BLOCK as _SCHEMA_CONTENT_BLOCK, - CONTENT_BLOCK_DELTA as _SCHEMA_CONTENT_BLOCK_DELTA, - CONTENT_BLOCK_DELTA_EVENT as _SCHEMA_CONTENT_BLOCK_DELTA_EVENT, - CONTENT_BLOCK_START as _SCHEMA_CONTENT_BLOCK_START, - CONTENT_BLOCK_START_EVENT as _SCHEMA_CONTENT_BLOCK_START_EVENT, - CONTENT_BLOCK_STOP_EVENT as _SCHEMA_CONTENT_BLOCK_STOP_EVENT, CONVERSE as _SCHEMA_CONVERSE, - CONVERSE_INPUT as _SCHEMA_CONVERSE_INPUT, - CONVERSE_METRICS as _SCHEMA_CONVERSE_METRICS, - CONVERSE_OPERATION_OUTPUT as _SCHEMA_CONVERSE_OPERATION_OUTPUT, - CONVERSE_OUTPUT as _SCHEMA_CONVERSE_OUTPUT, CONVERSE_STREAM as _SCHEMA_CONVERSE_STREAM, - CONVERSE_STREAM_INPUT as _SCHEMA_CONVERSE_STREAM_INPUT, - CONVERSE_STREAM_METADATA_EVENT as _SCHEMA_CONVERSE_STREAM_METADATA_EVENT, - CONVERSE_STREAM_METRICS as _SCHEMA_CONVERSE_STREAM_METRICS, - CONVERSE_STREAM_OPERATION_OUTPUT as _SCHEMA_CONVERSE_STREAM_OPERATION_OUTPUT, - CONVERSE_STREAM_OUTPUT as _SCHEMA_CONVERSE_STREAM_OUTPUT, - CONVERSE_STREAM_TRACE as _SCHEMA_CONVERSE_STREAM_TRACE, - CONVERSE_TOKENS_REQUEST as _SCHEMA_CONVERSE_TOKENS_REQUEST, - CONVERSE_TRACE as _SCHEMA_CONVERSE_TRACE, COUNT_TOKENS as _SCHEMA_COUNT_TOKENS, - COUNT_TOKENS_INPUT as _SCHEMA_COUNT_TOKENS_INPUT, - COUNT_TOKENS_OPERATION_INPUT as _SCHEMA_COUNT_TOKENS_OPERATION_INPUT, - COUNT_TOKENS_OUTPUT as _SCHEMA_COUNT_TOKENS_OUTPUT, - DOCUMENT_BLOCK as _SCHEMA_DOCUMENT_BLOCK, - DOCUMENT_CHAR_LOCATION as _SCHEMA_DOCUMENT_CHAR_LOCATION, - DOCUMENT_CHUNK_LOCATION as _SCHEMA_DOCUMENT_CHUNK_LOCATION, - DOCUMENT_CONTENT_BLOCK as _SCHEMA_DOCUMENT_CONTENT_BLOCK, - DOCUMENT_PAGE_LOCATION as _SCHEMA_DOCUMENT_PAGE_LOCATION, - DOCUMENT_SOURCE as _SCHEMA_DOCUMENT_SOURCE, - ERROR_BLOCK as _SCHEMA_ERROR_BLOCK, GET_ASYNC_INVOKE as _SCHEMA_GET_ASYNC_INVOKE, - GET_ASYNC_INVOKE_INPUT as _SCHEMA_GET_ASYNC_INVOKE_INPUT, - GET_ASYNC_INVOKE_OUTPUT as _SCHEMA_GET_ASYNC_INVOKE_OUTPUT, - GUARDRAIL_ASSESSMENT as _SCHEMA_GUARDRAIL_ASSESSMENT, - GUARDRAIL_AUTOMATED_REASONING_FINDING as _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_FINDING, - GUARDRAIL_AUTOMATED_REASONING_IMPOSSIBLE_FINDING as _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_IMPOSSIBLE_FINDING, - GUARDRAIL_AUTOMATED_REASONING_INPUT_TEXT_REFERENCE as _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_INPUT_TEXT_REFERENCE, - GUARDRAIL_AUTOMATED_REASONING_INVALID_FINDING as _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_INVALID_FINDING, - GUARDRAIL_AUTOMATED_REASONING_LOGIC_WARNING as _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_LOGIC_WARNING, - GUARDRAIL_AUTOMATED_REASONING_NO_TRANSLATIONS_FINDING as _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_NO_TRANSLATIONS_FINDING, - GUARDRAIL_AUTOMATED_REASONING_POLICY_ASSESSMENT as _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_POLICY_ASSESSMENT, - GUARDRAIL_AUTOMATED_REASONING_RULE as _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_RULE, - GUARDRAIL_AUTOMATED_REASONING_SATISFIABLE_FINDING as _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_SATISFIABLE_FINDING, - GUARDRAIL_AUTOMATED_REASONING_SCENARIO as _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_SCENARIO, - GUARDRAIL_AUTOMATED_REASONING_STATEMENT as _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_STATEMENT, - GUARDRAIL_AUTOMATED_REASONING_TOO_COMPLEX_FINDING as _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_TOO_COMPLEX_FINDING, - GUARDRAIL_AUTOMATED_REASONING_TRANSLATION as _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_TRANSLATION, - GUARDRAIL_AUTOMATED_REASONING_TRANSLATION_AMBIGUOUS_FINDING as _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_TRANSLATION_AMBIGUOUS_FINDING, - GUARDRAIL_AUTOMATED_REASONING_TRANSLATION_OPTION as _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_TRANSLATION_OPTION, - GUARDRAIL_AUTOMATED_REASONING_VALID_FINDING as _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_VALID_FINDING, - GUARDRAIL_CHECKS_CONFIG as _SCHEMA_GUARDRAIL_CHECKS_CONFIG, - GUARDRAIL_CHECKS_CONTENT_BLOCK as _SCHEMA_GUARDRAIL_CHECKS_CONTENT_BLOCK, - GUARDRAIL_CHECKS_CONTENT_FILTER_CATEGORY_CONFIG as _SCHEMA_GUARDRAIL_CHECKS_CONTENT_FILTER_CATEGORY_CONFIG, - GUARDRAIL_CHECKS_CONTENT_FILTER_CONFIG as _SCHEMA_GUARDRAIL_CHECKS_CONTENT_FILTER_CONFIG, - GUARDRAIL_CHECKS_CONTENT_FILTER_RESULT as _SCHEMA_GUARDRAIL_CHECKS_CONTENT_FILTER_RESULT, - GUARDRAIL_CHECKS_CONTENT_FILTER_RESULT_ENTRY as _SCHEMA_GUARDRAIL_CHECKS_CONTENT_FILTER_RESULT_ENTRY, - GUARDRAIL_CHECKS_CONTENT_FILTER_USAGE as _SCHEMA_GUARDRAIL_CHECKS_CONTENT_FILTER_USAGE, - GUARDRAIL_CHECKS_MESSAGE as _SCHEMA_GUARDRAIL_CHECKS_MESSAGE, - GUARDRAIL_CHECKS_PROMPT_ATTACK_CATEGORY_CONFIG as _SCHEMA_GUARDRAIL_CHECKS_PROMPT_ATTACK_CATEGORY_CONFIG, - GUARDRAIL_CHECKS_PROMPT_ATTACK_CONFIG as _SCHEMA_GUARDRAIL_CHECKS_PROMPT_ATTACK_CONFIG, - GUARDRAIL_CHECKS_PROMPT_ATTACK_RESULT as _SCHEMA_GUARDRAIL_CHECKS_PROMPT_ATTACK_RESULT, - GUARDRAIL_CHECKS_PROMPT_ATTACK_RESULT_ENTRY as _SCHEMA_GUARDRAIL_CHECKS_PROMPT_ATTACK_RESULT_ENTRY, - GUARDRAIL_CHECKS_PROMPT_ATTACK_USAGE as _SCHEMA_GUARDRAIL_CHECKS_PROMPT_ATTACK_USAGE, - GUARDRAIL_CHECKS_RESULTS as _SCHEMA_GUARDRAIL_CHECKS_RESULTS, - GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_CONFIG as _SCHEMA_GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_CONFIG, - GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_ENTITY_CONFIG as _SCHEMA_GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_ENTITY_CONFIG, - GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_RESULT as _SCHEMA_GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_RESULT, - GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_RESULT_ENTRY as _SCHEMA_GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_RESULT_ENTRY, - GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_USAGE as _SCHEMA_GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_USAGE, - GUARDRAIL_CHECKS_USAGE_RESULTS as _SCHEMA_GUARDRAIL_CHECKS_USAGE_RESULTS, - GUARDRAIL_CONFIGURATION as _SCHEMA_GUARDRAIL_CONFIGURATION, - GUARDRAIL_CONTENT_BLOCK as _SCHEMA_GUARDRAIL_CONTENT_BLOCK, - GUARDRAIL_CONTENT_FILTER as _SCHEMA_GUARDRAIL_CONTENT_FILTER, - GUARDRAIL_CONTENT_POLICY_ASSESSMENT as _SCHEMA_GUARDRAIL_CONTENT_POLICY_ASSESSMENT, - GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER as _SCHEMA_GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER, - GUARDRAIL_CONTEXTUAL_GROUNDING_POLICY_ASSESSMENT as _SCHEMA_GUARDRAIL_CONTEXTUAL_GROUNDING_POLICY_ASSESSMENT, - GUARDRAIL_CONVERSE_CONTENT_BLOCK as _SCHEMA_GUARDRAIL_CONVERSE_CONTENT_BLOCK, - GUARDRAIL_CONVERSE_IMAGE_BLOCK as _SCHEMA_GUARDRAIL_CONVERSE_IMAGE_BLOCK, - GUARDRAIL_CONVERSE_IMAGE_SOURCE as _SCHEMA_GUARDRAIL_CONVERSE_IMAGE_SOURCE, - GUARDRAIL_CONVERSE_TEXT_BLOCK as _SCHEMA_GUARDRAIL_CONVERSE_TEXT_BLOCK, - GUARDRAIL_COVERAGE as _SCHEMA_GUARDRAIL_COVERAGE, - GUARDRAIL_CUSTOM_WORD as _SCHEMA_GUARDRAIL_CUSTOM_WORD, - GUARDRAIL_IMAGE_BLOCK as _SCHEMA_GUARDRAIL_IMAGE_BLOCK, - GUARDRAIL_IMAGE_COVERAGE as _SCHEMA_GUARDRAIL_IMAGE_COVERAGE, - GUARDRAIL_IMAGE_SOURCE as _SCHEMA_GUARDRAIL_IMAGE_SOURCE, - GUARDRAIL_INVOCATION_METRICS as _SCHEMA_GUARDRAIL_INVOCATION_METRICS, - GUARDRAIL_MANAGED_WORD as _SCHEMA_GUARDRAIL_MANAGED_WORD, - GUARDRAIL_OUTPUT_CONTENT as _SCHEMA_GUARDRAIL_OUTPUT_CONTENT, - GUARDRAIL_PII_ENTITY_FILTER as _SCHEMA_GUARDRAIL_PII_ENTITY_FILTER, - GUARDRAIL_REGEX_FILTER as _SCHEMA_GUARDRAIL_REGEX_FILTER, - GUARDRAIL_SENSITIVE_INFORMATION_POLICY_ASSESSMENT as _SCHEMA_GUARDRAIL_SENSITIVE_INFORMATION_POLICY_ASSESSMENT, - GUARDRAIL_STREAM_CONFIGURATION as _SCHEMA_GUARDRAIL_STREAM_CONFIGURATION, - GUARDRAIL_TEXT_BLOCK as _SCHEMA_GUARDRAIL_TEXT_BLOCK, - GUARDRAIL_TEXT_CHARACTERS_COVERAGE as _SCHEMA_GUARDRAIL_TEXT_CHARACTERS_COVERAGE, - GUARDRAIL_TOPIC as _SCHEMA_GUARDRAIL_TOPIC, - GUARDRAIL_TOPIC_POLICY_ASSESSMENT as _SCHEMA_GUARDRAIL_TOPIC_POLICY_ASSESSMENT, - GUARDRAIL_TRACE_ASSESSMENT as _SCHEMA_GUARDRAIL_TRACE_ASSESSMENT, - GUARDRAIL_USAGE as _SCHEMA_GUARDRAIL_USAGE, - GUARDRAIL_WORD_POLICY_ASSESSMENT as _SCHEMA_GUARDRAIL_WORD_POLICY_ASSESSMENT, - IMAGE_BLOCK as _SCHEMA_IMAGE_BLOCK, - IMAGE_BLOCK_DELTA as _SCHEMA_IMAGE_BLOCK_DELTA, - IMAGE_BLOCK_START as _SCHEMA_IMAGE_BLOCK_START, - IMAGE_SOURCE as _SCHEMA_IMAGE_SOURCE, - INFERENCE_CONFIGURATION as _SCHEMA_INFERENCE_CONFIGURATION, - INTERNAL_SERVER_EXCEPTION as _SCHEMA_INTERNAL_SERVER_EXCEPTION, INVOKE_GUARDRAIL_CHECKS as _SCHEMA_INVOKE_GUARDRAIL_CHECKS, - INVOKE_GUARDRAIL_CHECKS_INPUT as _SCHEMA_INVOKE_GUARDRAIL_CHECKS_INPUT, - INVOKE_GUARDRAIL_CHECKS_OUTPUT as _SCHEMA_INVOKE_GUARDRAIL_CHECKS_OUTPUT, INVOKE_MODEL as _SCHEMA_INVOKE_MODEL, - INVOKE_MODEL_INPUT as _SCHEMA_INVOKE_MODEL_INPUT, - INVOKE_MODEL_OUTPUT as _SCHEMA_INVOKE_MODEL_OUTPUT, - INVOKE_MODEL_TOKENS_REQUEST as _SCHEMA_INVOKE_MODEL_TOKENS_REQUEST, INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM as _SCHEMA_INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM, - INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_INPUT as _SCHEMA_INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_INPUT, - INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_OPERATION_INPUT as _SCHEMA_INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_OPERATION_INPUT, - INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_OPERATION_OUTPUT as _SCHEMA_INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_OPERATION_OUTPUT, - INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_OUTPUT as _SCHEMA_INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_OUTPUT, INVOKE_MODEL_WITH_RESPONSE_STREAM as _SCHEMA_INVOKE_MODEL_WITH_RESPONSE_STREAM, - INVOKE_MODEL_WITH_RESPONSE_STREAM_INPUT as _SCHEMA_INVOKE_MODEL_WITH_RESPONSE_STREAM_INPUT, - INVOKE_MODEL_WITH_RESPONSE_STREAM_OUTPUT as _SCHEMA_INVOKE_MODEL_WITH_RESPONSE_STREAM_OUTPUT, - JSON_SCHEMA_DEFINITION as _SCHEMA_JSON_SCHEMA_DEFINITION, LIST_ASYNC_INVOKES as _SCHEMA_LIST_ASYNC_INVOKES, - LIST_ASYNC_INVOKES_INPUT as _SCHEMA_LIST_ASYNC_INVOKES_INPUT, - LIST_ASYNC_INVOKES_OUTPUT as _SCHEMA_LIST_ASYNC_INVOKES_OUTPUT, - MESSAGE as _SCHEMA_MESSAGE, - MESSAGE_START_EVENT as _SCHEMA_MESSAGE_START_EVENT, - MESSAGE_STOP_EVENT as _SCHEMA_MESSAGE_STOP_EVENT, - MODEL_ERROR_EXCEPTION as _SCHEMA_MODEL_ERROR_EXCEPTION, - MODEL_NOT_READY_EXCEPTION as _SCHEMA_MODEL_NOT_READY_EXCEPTION, - MODEL_STREAM_ERROR_EXCEPTION as _SCHEMA_MODEL_STREAM_ERROR_EXCEPTION, - MODEL_TIMEOUT_EXCEPTION as _SCHEMA_MODEL_TIMEOUT_EXCEPTION, - OUTPUT_CONFIG as _SCHEMA_OUTPUT_CONFIG, - OUTPUT_FORMAT as _SCHEMA_OUTPUT_FORMAT, - OUTPUT_FORMAT_STRUCTURE as _SCHEMA_OUTPUT_FORMAT_STRUCTURE, - PAYLOAD_PART as _SCHEMA_PAYLOAD_PART, - PERFORMANCE_CONFIGURATION as _SCHEMA_PERFORMANCE_CONFIGURATION, - PROMPT_ROUTER_TRACE as _SCHEMA_PROMPT_ROUTER_TRACE, - PROMPT_VARIABLE_VALUES as _SCHEMA_PROMPT_VARIABLE_VALUES, - REASONING_CONTENT_BLOCK as _SCHEMA_REASONING_CONTENT_BLOCK, - REASONING_CONTENT_BLOCK_DELTA as _SCHEMA_REASONING_CONTENT_BLOCK_DELTA, - REASONING_TEXT_BLOCK as _SCHEMA_REASONING_TEXT_BLOCK, - RESOURCE_NOT_FOUND_EXCEPTION as _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - RESPONSE_STREAM as _SCHEMA_RESPONSE_STREAM, - S3_LOCATION as _SCHEMA_S3_LOCATION, - SEARCH_RESULT_BLOCK as _SCHEMA_SEARCH_RESULT_BLOCK, - SEARCH_RESULT_CONTENT_BLOCK as _SCHEMA_SEARCH_RESULT_CONTENT_BLOCK, - SEARCH_RESULT_LOCATION as _SCHEMA_SEARCH_RESULT_LOCATION, - SERVICE_QUOTA_EXCEEDED_EXCEPTION as _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - SERVICE_TIER as _SCHEMA_SERVICE_TIER, - SERVICE_UNAVAILABLE_EXCEPTION as _SCHEMA_SERVICE_UNAVAILABLE_EXCEPTION, - SPECIFIC_TOOL_CHOICE as _SCHEMA_SPECIFIC_TOOL_CHOICE, START_ASYNC_INVOKE as _SCHEMA_START_ASYNC_INVOKE, - START_ASYNC_INVOKE_INPUT as _SCHEMA_START_ASYNC_INVOKE_INPUT, - START_ASYNC_INVOKE_OUTPUT as _SCHEMA_START_ASYNC_INVOKE_OUTPUT, - SYSTEM_CONTENT_BLOCK as _SCHEMA_SYSTEM_CONTENT_BLOCK, - SYSTEM_TOOL as _SCHEMA_SYSTEM_TOOL, - TAG as _SCHEMA_TAG, - THROTTLING_EXCEPTION as _SCHEMA_THROTTLING_EXCEPTION, - TOKEN_USAGE as _SCHEMA_TOKEN_USAGE, - TOOL as _SCHEMA_TOOL, - TOOL_ADDITION_BLOCK as _SCHEMA_TOOL_ADDITION_BLOCK, - TOOL_CHOICE as _SCHEMA_TOOL_CHOICE, - TOOL_CONFIGURATION as _SCHEMA_TOOL_CONFIGURATION, - TOOL_INPUT_SCHEMA as _SCHEMA_TOOL_INPUT_SCHEMA, - TOOL_REFERENCE as _SCHEMA_TOOL_REFERENCE, - TOOL_REMOVAL_BLOCK as _SCHEMA_TOOL_REMOVAL_BLOCK, - TOOL_RESULT_BLOCK as _SCHEMA_TOOL_RESULT_BLOCK, - TOOL_RESULT_BLOCK_DELTA as _SCHEMA_TOOL_RESULT_BLOCK_DELTA, - TOOL_RESULT_BLOCK_START as _SCHEMA_TOOL_RESULT_BLOCK_START, - TOOL_RESULT_CONTENT_BLOCK as _SCHEMA_TOOL_RESULT_CONTENT_BLOCK, - TOOL_SPECIFICATION as _SCHEMA_TOOL_SPECIFICATION, - TOOL_USE_BLOCK as _SCHEMA_TOOL_USE_BLOCK, - TOOL_USE_BLOCK_DELTA as _SCHEMA_TOOL_USE_BLOCK_DELTA, - TOOL_USE_BLOCK_START as _SCHEMA_TOOL_USE_BLOCK_START, - VALIDATION_EXCEPTION as _SCHEMA_VALIDATION_EXCEPTION, - VIDEO_BLOCK as _SCHEMA_VIDEO_BLOCK, - VIDEO_SOURCE as _SCHEMA_VIDEO_SOURCE, - WEB_LOCATION as _SCHEMA_WEB_LOCATION, ) - -logger = logging.getLogger(__name__) +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .models import ( + ApplyGuardrailInput, + ApplyGuardrailOutput, + ConverseInput, + ConverseOperationOutput, + ConverseStreamInput, + ConverseStreamOperationOutput, + CountTokensOperationInput, + CountTokensOutput, + GetAsyncInvokeInput, + GetAsyncInvokeOutput, + InvokeGuardrailChecksInput, + InvokeGuardrailChecksOutput, + InvokeModelInput, + InvokeModelOutput, + InvokeModelWithBidirectionalStreamOperationInput, + InvokeModelWithBidirectionalStreamOperationOutput, + InvokeModelWithResponseStreamInput, + InvokeModelWithResponseStreamOutput, + ListAsyncInvokesInput, + ListAsyncInvokesOutput, + StartAsyncInvokeInput, + StartAsyncInvokeOutput, + ) class ServiceError(ModeledError): @@ -235,18518 +60,859 @@ class ServiceError(ModeledError): """ -@dataclass(kw_only=True) -class AccessDeniedException(ServiceError): - """ - The request is denied because you do not have sufficient permissions to - perform the requested action. For troubleshooting this error, see - [AccessDeniedException](https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-access-denied) - in the Amazon Bedrock User Guide - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACCESS_DENIED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_ACCESS_DENIED_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_ACCESS_DENIED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ACCESS_DENIED_EXCEPTION, consumer=_consumer) - return kwargs - - -def _serialize_additional_model_response_field_paths( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_additional_model_response_field_paths( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GetAsyncInvokeInput: - """Dataclass for GetAsyncInvokeInput structure.""" - - invocation_arn: str | None = None - """The invocation's ARN.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_ASYNC_INVOKE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.invocation_arn is not None: - serializer.write_string( - _SCHEMA_GET_ASYNC_INVOKE_INPUT.members["invocationArn"], - self.invocation_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["invocation_arn"] = de.read_string( - _SCHEMA_GET_ASYNC_INVOKE_INPUT.members["invocationArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_ASYNC_INVOKE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class AsyncInvokeS3OutputDataConfig: - """Asynchronous invocation output data settings.""" - - s3_uri: str - """An object URI starting with `s3://`.""" - - kms_key_id: str | None = None - """A KMS encryption key ID.""" - - bucket_owner: str | None = None - """ - If the bucket belongs to another AWS account, specify that account's - ID. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ASYNC_INVOKE_S3_OUTPUT_DATA_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_ASYNC_INVOKE_S3_OUTPUT_DATA_CONFIG.members["s3Uri"], self.s3_uri - ) - if self.kms_key_id is not None: - serializer.write_string( - _SCHEMA_ASYNC_INVOKE_S3_OUTPUT_DATA_CONFIG.members["kmsKeyId"], - self.kms_key_id, - ) - - if self.bucket_owner is not None: - serializer.write_string( - _SCHEMA_ASYNC_INVOKE_S3_OUTPUT_DATA_CONFIG.members["bucketOwner"], - self.bucket_owner, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["s3_uri"] = de.read_string( - _SCHEMA_ASYNC_INVOKE_S3_OUTPUT_DATA_CONFIG.members["s3Uri"] - ) - - case 1: - kwargs["kms_key_id"] = de.read_string( - _SCHEMA_ASYNC_INVOKE_S3_OUTPUT_DATA_CONFIG.members["kmsKeyId"] - ) - - case 2: - kwargs["bucket_owner"] = de.read_string( - _SCHEMA_ASYNC_INVOKE_S3_OUTPUT_DATA_CONFIG.members[ - "bucketOwner" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ASYNC_INVOKE_S3_OUTPUT_DATA_CONFIG, consumer=_consumer - ) - if "s3_uri" not in kwargs: - kwargs["s3_uri"] = "" - return kwargs - - -@dataclass -class AsyncInvokeOutputDataConfigS3OutputDataConfig: - """A storage location for the output data in an S3 bucket""" - - value: AsyncInvokeS3OutputDataConfig - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ASYNC_INVOKE_OUTPUT_DATA_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_ASYNC_INVOKE_OUTPUT_DATA_CONFIG.members["s3OutputDataConfig"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=AsyncInvokeS3OutputDataConfig.deserialize(deserializer)) - - -@dataclass -class AsyncInvokeOutputDataConfigUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -AsyncInvokeOutputDataConfig = Union[ - AsyncInvokeOutputDataConfigS3OutputDataConfig | AsyncInvokeOutputDataConfigUnknown -] -"""Asynchronous invocation output data settings.""" - - -class _AsyncInvokeOutputDataConfigDeserializer: - _result: AsyncInvokeOutputDataConfig | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> AsyncInvokeOutputDataConfig: - self._result = None - deserializer.read_struct( - _SCHEMA_ASYNC_INVOKE_OUTPUT_DATA_CONFIG, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - AsyncInvokeOutputDataConfigS3OutputDataConfig.deserialize(de) - ) - - case _: - self._set_result( - AsyncInvokeOutputDataConfigUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: AsyncInvokeOutputDataConfig) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class AsyncInvokeStatus(UnknownEnumMixin, StrEnum): - IN_PROGRESS = "InProgress" - COMPLETED = "Completed" - FAILED = "Failed" - - -@dataclass(kw_only=True) -class GetAsyncInvokeOutput: - """Dataclass for GetAsyncInvokeOutput structure.""" - - invocation_arn: str - """The invocation's ARN.""" - - model_arn: str - """The invocation's model ARN.""" - - status: str - """The invocation's status.""" - - submit_time: datetime - """When the invocation request was submitted.""" - - output_data_config: AsyncInvokeOutputDataConfig - """Output data settings.""" - - client_request_token: str | None = None - """The invocation's idempotency token.""" - - failure_message: str | None = field(repr=False, default=None) - """An error message.""" - - last_modified_time: datetime | None = None - """The invocation's last modified time.""" +_registry = ModelRegistry( + _schemas, + renames={}, + index={ + "AccessDeniedException": "ACCESS_DENIED_EXCEPTION", + "AnyToolChoice": "ANY_TOOL_CHOICE", + "AppliedGuardrailDetails": "APPLIED_GUARDRAIL_DETAILS", + "ApplyGuardrailInput": "APPLY_GUARDRAIL_INPUT", + "ApplyGuardrailOutput": "APPLY_GUARDRAIL_OUTPUT", + "AsyncInvokeOutputDataConfig": "ASYNC_INVOKE_OUTPUT_DATA_CONFIG", + "AsyncInvokeOutputDataConfigS3OutputDataConfig": "ASYNC_INVOKE_OUTPUT_DATA_CONFIG", + "AsyncInvokeOutputDataConfigUnknown": "ASYNC_INVOKE_OUTPUT_DATA_CONFIG", + "AsyncInvokeS3OutputDataConfig": "ASYNC_INVOKE_S3_OUTPUT_DATA_CONFIG", + "AsyncInvokeStatus": "ASYNC_INVOKE_STATUS", + "AsyncInvokeSummary": "ASYNC_INVOKE_SUMMARY", + "AudioBlock": "AUDIO_BLOCK", + "AudioFormat": "AUDIO_FORMAT", + "AudioSource": "AUDIO_SOURCE", + "AudioSourceBytes": "AUDIO_SOURCE", + "AudioSourceS3Location": "AUDIO_SOURCE", + "AudioSourceUnknown": "AUDIO_SOURCE", + "AutoToolChoice": "AUTO_TOOL_CHOICE", + "BidirectionalInputPayloadPart": "BIDIRECTIONAL_INPUT_PAYLOAD_PART", + "BidirectionalOutputPayloadPart": "BIDIRECTIONAL_OUTPUT_PAYLOAD_PART", + "CacheDetail": "CACHE_DETAIL", + "CachePointBlock": "CACHE_POINT_BLOCK", + "CachePointType": "CACHE_POINT_TYPE", + "CacheTTL": "CACHE_TTL", + "Citation": "CITATION", + "CitationGeneratedContent": "CITATION_GENERATED_CONTENT", + "CitationGeneratedContentText": "CITATION_GENERATED_CONTENT", + "CitationGeneratedContentUnknown": "CITATION_GENERATED_CONTENT", + "CitationLocation": "CITATION_LOCATION", + "CitationLocationWeb": "CITATION_LOCATION", + "CitationLocationDocumentChar": "CITATION_LOCATION", + "CitationLocationDocumentPage": "CITATION_LOCATION", + "CitationLocationDocumentChunk": "CITATION_LOCATION", + "CitationLocationSearchResultLocation": "CITATION_LOCATION", + "CitationLocationUnknown": "CITATION_LOCATION", + "CitationsConfig": "CITATIONS_CONFIG", + "CitationsContentBlock": "CITATIONS_CONTENT_BLOCK", + "CitationsDelta": "CITATIONS_DELTA", + "CitationSourceContent": "CITATION_SOURCE_CONTENT", + "CitationSourceContentText": "CITATION_SOURCE_CONTENT", + "CitationSourceContentUnknown": "CITATION_SOURCE_CONTENT", + "CitationSourceContentDelta": "CITATION_SOURCE_CONTENT_DELTA", + "ConflictException": "CONFLICT_EXCEPTION", + "ContentBlock": "CONTENT_BLOCK", + "ContentBlockText": "CONTENT_BLOCK", + "ContentBlockImage": "CONTENT_BLOCK", + "ContentBlockDocument": "CONTENT_BLOCK", + "ContentBlockVideo": "CONTENT_BLOCK", + "ContentBlockAudio": "CONTENT_BLOCK", + "ContentBlockToolUse": "CONTENT_BLOCK", + "ContentBlockToolResult": "CONTENT_BLOCK", + "ContentBlockGuardContent": "CONTENT_BLOCK", + "ContentBlockCachePoint": "CONTENT_BLOCK", + "ContentBlockReasoningContent": "CONTENT_BLOCK", + "ContentBlockCitationsContent": "CONTENT_BLOCK", + "ContentBlockSearchResult": "CONTENT_BLOCK", + "ContentBlockToolAddition": "CONTENT_BLOCK", + "ContentBlockToolRemoval": "CONTENT_BLOCK", + "ContentBlockUnknown": "CONTENT_BLOCK", + "ContentBlockDelta": "CONTENT_BLOCK_DELTA", + "ContentBlockDeltaText": "CONTENT_BLOCK_DELTA", + "ContentBlockDeltaToolUse": "CONTENT_BLOCK_DELTA", + "ContentBlockDeltaToolResult": "CONTENT_BLOCK_DELTA", + "ContentBlockDeltaReasoningContent": "CONTENT_BLOCK_DELTA", + "ContentBlockDeltaCitation": "CONTENT_BLOCK_DELTA", + "ContentBlockDeltaImage": "CONTENT_BLOCK_DELTA", + "ContentBlockDeltaUnknown": "CONTENT_BLOCK_DELTA", + "ContentBlockDeltaEvent": "CONTENT_BLOCK_DELTA_EVENT", + "ContentBlockStart": "CONTENT_BLOCK_START", + "ContentBlockStartToolUse": "CONTENT_BLOCK_START", + "ContentBlockStartToolResult": "CONTENT_BLOCK_START", + "ContentBlockStartImage": "CONTENT_BLOCK_START", + "ContentBlockStartUnknown": "CONTENT_BLOCK_START", + "ContentBlockStartEvent": "CONTENT_BLOCK_START_EVENT", + "ContentBlockStopEvent": "CONTENT_BLOCK_STOP_EVENT", + "ConversationRole": "CONVERSATION_ROLE", + "ConverseInput": "CONVERSE_INPUT", + "ConverseMetrics": "CONVERSE_METRICS", + "ConverseOperationOutput": "CONVERSE_OPERATION_OUTPUT", + "ConverseOutput": "CONVERSE_OUTPUT", + "ConverseOutputMessage": "CONVERSE_OUTPUT", + "ConverseOutputUnknown": "CONVERSE_OUTPUT", + "ConverseStreamInput": "CONVERSE_STREAM_INPUT", + "ConverseStreamMetadataEvent": "CONVERSE_STREAM_METADATA_EVENT", + "ConverseStreamMetrics": "CONVERSE_STREAM_METRICS", + "ConverseStreamOperationOutput": "CONVERSE_STREAM_OPERATION_OUTPUT", + "ConverseStreamOutput": "CONVERSE_STREAM_OUTPUT", + "ConverseStreamOutputMessageStart": "CONVERSE_STREAM_OUTPUT", + "ConverseStreamOutputContentBlockStart": "CONVERSE_STREAM_OUTPUT", + "ConverseStreamOutputContentBlockDelta": "CONVERSE_STREAM_OUTPUT", + "ConverseStreamOutputContentBlockStop": "CONVERSE_STREAM_OUTPUT", + "ConverseStreamOutputMessageStop": "CONVERSE_STREAM_OUTPUT", + "ConverseStreamOutputMetadata": "CONVERSE_STREAM_OUTPUT", + "ConverseStreamOutputInternalServerException": "CONVERSE_STREAM_OUTPUT", + "ConverseStreamOutputModelStreamErrorException": "CONVERSE_STREAM_OUTPUT", + "ConverseStreamOutputValidationException": "CONVERSE_STREAM_OUTPUT", + "ConverseStreamOutputThrottlingException": "CONVERSE_STREAM_OUTPUT", + "ConverseStreamOutputServiceUnavailableException": "CONVERSE_STREAM_OUTPUT", + "ConverseStreamOutputUnknown": "CONVERSE_STREAM_OUTPUT", + "ConverseStreamTrace": "CONVERSE_STREAM_TRACE", + "ConverseTokensRequest": "CONVERSE_TOKENS_REQUEST", + "ConverseTrace": "CONVERSE_TRACE", + "CountTokensInput": "COUNT_TOKENS_INPUT", + "CountTokensInputInvokeModel": "COUNT_TOKENS_INPUT", + "CountTokensInputConverse": "COUNT_TOKENS_INPUT", + "CountTokensInputUnknown": "COUNT_TOKENS_INPUT", + "CountTokensOperationInput": "COUNT_TOKENS_OPERATION_INPUT", + "CountTokensOutput": "COUNT_TOKENS_OUTPUT", + "DocumentBlock": "DOCUMENT_BLOCK", + "DocumentCharLocation": "DOCUMENT_CHAR_LOCATION", + "DocumentChunkLocation": "DOCUMENT_CHUNK_LOCATION", + "DocumentContentBlock": "DOCUMENT_CONTENT_BLOCK", + "DocumentContentBlockText": "DOCUMENT_CONTENT_BLOCK", + "DocumentContentBlockUnknown": "DOCUMENT_CONTENT_BLOCK", + "DocumentFormat": "DOCUMENT_FORMAT", + "DocumentPageLocation": "DOCUMENT_PAGE_LOCATION", + "DocumentSource": "DOCUMENT_SOURCE", + "DocumentSourceBytes": "DOCUMENT_SOURCE", + "DocumentSourceS3Location": "DOCUMENT_SOURCE", + "DocumentSourceText": "DOCUMENT_SOURCE", + "DocumentSourceContent": "DOCUMENT_SOURCE", + "DocumentSourceUnknown": "DOCUMENT_SOURCE", + "ErrorBlock": "ERROR_BLOCK", + "GetAsyncInvokeInput": "GET_ASYNC_INVOKE_INPUT", + "GetAsyncInvokeOutput": "GET_ASYNC_INVOKE_OUTPUT", + "GuardrailAction": "GUARDRAIL_ACTION", + "GuardrailAssessment": "GUARDRAIL_ASSESSMENT", + "GuardrailAutomatedReasoningFinding": "GUARDRAIL_AUTOMATED_REASONING_FINDING", + "GuardrailAutomatedReasoningFindingValid": "GUARDRAIL_AUTOMATED_REASONING_FINDING", + "GuardrailAutomatedReasoningFindingInvalid": "GUARDRAIL_AUTOMATED_REASONING_FINDING", + "GuardrailAutomatedReasoningFindingSatisfiable": "GUARDRAIL_AUTOMATED_REASONING_FINDING", + "GuardrailAutomatedReasoningFindingImpossible": "GUARDRAIL_AUTOMATED_REASONING_FINDING", + "GuardrailAutomatedReasoningFindingTranslationAmbiguous": "GUARDRAIL_AUTOMATED_REASONING_FINDING", + "GuardrailAutomatedReasoningFindingTooComplex": "GUARDRAIL_AUTOMATED_REASONING_FINDING", + "GuardrailAutomatedReasoningFindingNoTranslations": "GUARDRAIL_AUTOMATED_REASONING_FINDING", + "GuardrailAutomatedReasoningFindingUnknown": "GUARDRAIL_AUTOMATED_REASONING_FINDING", + "GuardrailAutomatedReasoningImpossibleFinding": "GUARDRAIL_AUTOMATED_REASONING_IMPOSSIBLE_FINDING", + "GuardrailAutomatedReasoningInputTextReference": "GUARDRAIL_AUTOMATED_REASONING_INPUT_TEXT_REFERENCE", + "GuardrailAutomatedReasoningInvalidFinding": "GUARDRAIL_AUTOMATED_REASONING_INVALID_FINDING", + "GuardrailAutomatedReasoningLogicWarning": "GUARDRAIL_AUTOMATED_REASONING_LOGIC_WARNING", + "GuardrailAutomatedReasoningLogicWarningType": "GUARDRAIL_AUTOMATED_REASONING_LOGIC_WARNING_TYPE", + "GuardrailAutomatedReasoningNoTranslationsFinding": "GUARDRAIL_AUTOMATED_REASONING_NO_TRANSLATIONS_FINDING", + "GuardrailAutomatedReasoningPolicyAssessment": "GUARDRAIL_AUTOMATED_REASONING_POLICY_ASSESSMENT", + "GuardrailAutomatedReasoningRule": "GUARDRAIL_AUTOMATED_REASONING_RULE", + "GuardrailAutomatedReasoningSatisfiableFinding": "GUARDRAIL_AUTOMATED_REASONING_SATISFIABLE_FINDING", + "GuardrailAutomatedReasoningScenario": "GUARDRAIL_AUTOMATED_REASONING_SCENARIO", + "GuardrailAutomatedReasoningStatement": "GUARDRAIL_AUTOMATED_REASONING_STATEMENT", + "GuardrailAutomatedReasoningTooComplexFinding": "GUARDRAIL_AUTOMATED_REASONING_TOO_COMPLEX_FINDING", + "GuardrailAutomatedReasoningTranslation": "GUARDRAIL_AUTOMATED_REASONING_TRANSLATION", + "GuardrailAutomatedReasoningTranslationAmbiguousFinding": "GUARDRAIL_AUTOMATED_REASONING_TRANSLATION_AMBIGUOUS_FINDING", + "GuardrailAutomatedReasoningTranslationOption": "GUARDRAIL_AUTOMATED_REASONING_TRANSLATION_OPTION", + "GuardrailAutomatedReasoningValidFinding": "GUARDRAIL_AUTOMATED_REASONING_VALID_FINDING", + "GuardrailChecksConfig": "GUARDRAIL_CHECKS_CONFIG", + "GuardrailChecksContentBlock": "GUARDRAIL_CHECKS_CONTENT_BLOCK", + "GuardrailChecksContentBlockText": "GUARDRAIL_CHECKS_CONTENT_BLOCK", + "GuardrailChecksContentBlockUnknown": "GUARDRAIL_CHECKS_CONTENT_BLOCK", + "GuardrailChecksContentFilterCategory": "GUARDRAIL_CHECKS_CONTENT_FILTER_CATEGORY", + "GuardrailChecksContentFilterCategoryConfig": "GUARDRAIL_CHECKS_CONTENT_FILTER_CATEGORY_CONFIG", + "GuardrailChecksContentFilterConfig": "GUARDRAIL_CHECKS_CONTENT_FILTER_CONFIG", + "GuardrailChecksContentFilterResult": "GUARDRAIL_CHECKS_CONTENT_FILTER_RESULT", + "GuardrailChecksContentFilterResultEntry": "GUARDRAIL_CHECKS_CONTENT_FILTER_RESULT_ENTRY", + "GuardrailChecksContentFilterUsage": "GUARDRAIL_CHECKS_CONTENT_FILTER_USAGE", + "GuardrailChecksMessage": "GUARDRAIL_CHECKS_MESSAGE", + "GuardrailChecksPromptAttackCategory": "GUARDRAIL_CHECKS_PROMPT_ATTACK_CATEGORY", + "GuardrailChecksPromptAttackCategoryConfig": "GUARDRAIL_CHECKS_PROMPT_ATTACK_CATEGORY_CONFIG", + "GuardrailChecksPromptAttackConfig": "GUARDRAIL_CHECKS_PROMPT_ATTACK_CONFIG", + "GuardrailChecksPromptAttackResult": "GUARDRAIL_CHECKS_PROMPT_ATTACK_RESULT", + "GuardrailChecksPromptAttackResultEntry": "GUARDRAIL_CHECKS_PROMPT_ATTACK_RESULT_ENTRY", + "GuardrailChecksPromptAttackUsage": "GUARDRAIL_CHECKS_PROMPT_ATTACK_USAGE", + "GuardrailChecksResults": "GUARDRAIL_CHECKS_RESULTS", + "GuardrailChecksRole": "GUARDRAIL_CHECKS_ROLE", + "GuardrailChecksSensitiveInformationConfig": "GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_CONFIG", + "GuardrailChecksSensitiveInformationEntityConfig": "GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_ENTITY_CONFIG", + "GuardrailChecksSensitiveInformationEntityType": "GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_ENTITY_TYPE", + "GuardrailChecksSensitiveInformationResult": "GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_RESULT", + "GuardrailChecksSensitiveInformationResultEntry": "GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_RESULT_ENTRY", + "GuardrailChecksSensitiveInformationUsage": "GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_USAGE", + "GuardrailChecksUsageResults": "GUARDRAIL_CHECKS_USAGE_RESULTS", + "GuardrailConfiguration": "GUARDRAIL_CONFIGURATION", + "GuardrailContentBlock": "GUARDRAIL_CONTENT_BLOCK", + "GuardrailContentBlockText": "GUARDRAIL_CONTENT_BLOCK", + "GuardrailContentBlockImage": "GUARDRAIL_CONTENT_BLOCK", + "GuardrailContentBlockUnknown": "GUARDRAIL_CONTENT_BLOCK", + "GuardrailContentFilter": "GUARDRAIL_CONTENT_FILTER", + "GuardrailContentFilterConfidence": "GUARDRAIL_CONTENT_FILTER_CONFIDENCE", + "GuardrailContentFilterStrength": "GUARDRAIL_CONTENT_FILTER_STRENGTH", + "GuardrailContentFilterType": "GUARDRAIL_CONTENT_FILTER_TYPE", + "GuardrailContentPolicyAction": "GUARDRAIL_CONTENT_POLICY_ACTION", + "GuardrailContentPolicyAssessment": "GUARDRAIL_CONTENT_POLICY_ASSESSMENT", + "GuardrailContentQualifier": "GUARDRAIL_CONTENT_QUALIFIER", + "GuardrailContentSource": "GUARDRAIL_CONTENT_SOURCE", + "GuardrailContextualGroundingFilter": "GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER", + "GuardrailContextualGroundingFilterType": "GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER_TYPE", + "GuardrailContextualGroundingPolicyAction": "GUARDRAIL_CONTEXTUAL_GROUNDING_POLICY_ACTION", + "GuardrailContextualGroundingPolicyAssessment": "GUARDRAIL_CONTEXTUAL_GROUNDING_POLICY_ASSESSMENT", + "GuardrailConverseContentBlock": "GUARDRAIL_CONVERSE_CONTENT_BLOCK", + "GuardrailConverseContentBlockText": "GUARDRAIL_CONVERSE_CONTENT_BLOCK", + "GuardrailConverseContentBlockImage": "GUARDRAIL_CONVERSE_CONTENT_BLOCK", + "GuardrailConverseContentBlockUnknown": "GUARDRAIL_CONVERSE_CONTENT_BLOCK", + "GuardrailConverseContentQualifier": "GUARDRAIL_CONVERSE_CONTENT_QUALIFIER", + "GuardrailConverseImageBlock": "GUARDRAIL_CONVERSE_IMAGE_BLOCK", + "GuardrailConverseImageFormat": "GUARDRAIL_CONVERSE_IMAGE_FORMAT", + "GuardrailConverseImageSource": "GUARDRAIL_CONVERSE_IMAGE_SOURCE", + "GuardrailConverseImageSourceBytes": "GUARDRAIL_CONVERSE_IMAGE_SOURCE", + "GuardrailConverseImageSourceUnknown": "GUARDRAIL_CONVERSE_IMAGE_SOURCE", + "GuardrailConverseTextBlock": "GUARDRAIL_CONVERSE_TEXT_BLOCK", + "GuardrailCoverage": "GUARDRAIL_COVERAGE", + "GuardrailCustomWord": "GUARDRAIL_CUSTOM_WORD", + "GuardrailImageBlock": "GUARDRAIL_IMAGE_BLOCK", + "GuardrailImageCoverage": "GUARDRAIL_IMAGE_COVERAGE", + "GuardrailImageFormat": "GUARDRAIL_IMAGE_FORMAT", + "GuardrailImageSource": "GUARDRAIL_IMAGE_SOURCE", + "GuardrailImageSourceBytes": "GUARDRAIL_IMAGE_SOURCE", + "GuardrailImageSourceUnknown": "GUARDRAIL_IMAGE_SOURCE", + "GuardrailInvocationMetrics": "GUARDRAIL_INVOCATION_METRICS", + "GuardrailManagedWord": "GUARDRAIL_MANAGED_WORD", + "GuardrailManagedWordType": "GUARDRAIL_MANAGED_WORD_TYPE", + "GuardrailOrigin": "GUARDRAIL_ORIGIN", + "GuardrailOutputContent": "GUARDRAIL_OUTPUT_CONTENT", + "GuardrailOutputScope": "GUARDRAIL_OUTPUT_SCOPE", + "GuardrailOwnership": "GUARDRAIL_OWNERSHIP", + "GuardrailPiiEntityFilter": "GUARDRAIL_PII_ENTITY_FILTER", + "GuardrailPiiEntityType": "GUARDRAIL_PII_ENTITY_TYPE", + "GuardrailRegexFilter": "GUARDRAIL_REGEX_FILTER", + "GuardrailSensitiveInformationPolicyAction": "GUARDRAIL_SENSITIVE_INFORMATION_POLICY_ACTION", + "GuardrailSensitiveInformationPolicyAssessment": "GUARDRAIL_SENSITIVE_INFORMATION_POLICY_ASSESSMENT", + "GuardrailStreamConfiguration": "GUARDRAIL_STREAM_CONFIGURATION", + "GuardrailStreamProcessingMode": "GUARDRAIL_STREAM_PROCESSING_MODE", + "GuardrailTextBlock": "GUARDRAIL_TEXT_BLOCK", + "GuardrailTextCharactersCoverage": "GUARDRAIL_TEXT_CHARACTERS_COVERAGE", + "GuardrailTopic": "GUARDRAIL_TOPIC", + "GuardrailTopicPolicyAction": "GUARDRAIL_TOPIC_POLICY_ACTION", + "GuardrailTopicPolicyAssessment": "GUARDRAIL_TOPIC_POLICY_ASSESSMENT", + "GuardrailTopicType": "GUARDRAIL_TOPIC_TYPE", + "GuardrailTrace": "GUARDRAIL_TRACE", + "GuardrailTraceAssessment": "GUARDRAIL_TRACE_ASSESSMENT", + "GuardrailUsage": "GUARDRAIL_USAGE", + "GuardrailWordPolicyAction": "GUARDRAIL_WORD_POLICY_ACTION", + "GuardrailWordPolicyAssessment": "GUARDRAIL_WORD_POLICY_ASSESSMENT", + "ImageBlock": "IMAGE_BLOCK", + "ImageBlockDelta": "IMAGE_BLOCK_DELTA", + "ImageBlockStart": "IMAGE_BLOCK_START", + "ImageFormat": "IMAGE_FORMAT", + "ImageSource": "IMAGE_SOURCE", + "ImageSourceBytes": "IMAGE_SOURCE", + "ImageSourceS3Location": "IMAGE_SOURCE", + "ImageSourceUnknown": "IMAGE_SOURCE", + "InferenceConfiguration": "INFERENCE_CONFIGURATION", + "InternalServerException": "INTERNAL_SERVER_EXCEPTION", + "InvokeGuardrailChecksInput": "INVOKE_GUARDRAIL_CHECKS_INPUT", + "InvokeGuardrailChecksOutput": "INVOKE_GUARDRAIL_CHECKS_OUTPUT", + "InvokeModelInput": "INVOKE_MODEL_INPUT", + "InvokeModelOutput": "INVOKE_MODEL_OUTPUT", + "InvokeModelTokensRequest": "INVOKE_MODEL_TOKENS_REQUEST", + "InvokeModelWithBidirectionalStreamInput": "INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_INPUT", + "InvokeModelWithBidirectionalStreamInputChunk": "INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_INPUT", + "InvokeModelWithBidirectionalStreamInputUnknown": "INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_INPUT", + "InvokeModelWithBidirectionalStreamOperationInput": "INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_OPERATION_INPUT", + "InvokeModelWithBidirectionalStreamOperationOutput": "INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_OPERATION_OUTPUT", + "InvokeModelWithBidirectionalStreamOutput": "INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_OUTPUT", + "InvokeModelWithBidirectionalStreamOutputChunk": "INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_OUTPUT", + "InvokeModelWithBidirectionalStreamOutputInternalServerException": "INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_OUTPUT", + "InvokeModelWithBidirectionalStreamOutputModelStreamErrorException": "INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_OUTPUT", + "InvokeModelWithBidirectionalStreamOutputValidationException": "INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_OUTPUT", + "InvokeModelWithBidirectionalStreamOutputThrottlingException": "INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_OUTPUT", + "InvokeModelWithBidirectionalStreamOutputModelTimeoutException": "INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_OUTPUT", + "InvokeModelWithBidirectionalStreamOutputServiceUnavailableException": "INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_OUTPUT", + "InvokeModelWithBidirectionalStreamOutputUnknown": "INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_OUTPUT", + "InvokeModelWithResponseStreamInput": "INVOKE_MODEL_WITH_RESPONSE_STREAM_INPUT", + "InvokeModelWithResponseStreamOutput": "INVOKE_MODEL_WITH_RESPONSE_STREAM_OUTPUT", + "JsonSchemaDefinition": "JSON_SCHEMA_DEFINITION", + "ListAsyncInvokesInput": "LIST_ASYNC_INVOKES_INPUT", + "ListAsyncInvokesOutput": "LIST_ASYNC_INVOKES_OUTPUT", + "Message": "MESSAGE", + "MessageStartEvent": "MESSAGE_START_EVENT", + "MessageStopEvent": "MESSAGE_STOP_EVENT", + "ModelErrorException": "MODEL_ERROR_EXCEPTION", + "ModelNotReadyException": "MODEL_NOT_READY_EXCEPTION", + "ModelStreamErrorException": "MODEL_STREAM_ERROR_EXCEPTION", + "ModelTimeoutException": "MODEL_TIMEOUT_EXCEPTION", + "OutputConfig": "OUTPUT_CONFIG", + "OutputFormat": "OUTPUT_FORMAT", + "OutputFormatStructure": "OUTPUT_FORMAT_STRUCTURE", + "OutputFormatStructureJsonSchema": "OUTPUT_FORMAT_STRUCTURE", + "OutputFormatStructureUnknown": "OUTPUT_FORMAT_STRUCTURE", + "OutputFormatType": "OUTPUT_FORMAT_TYPE", + "PayloadPart": "PAYLOAD_PART", + "PerformanceConfigLatency": "PERFORMANCE_CONFIG_LATENCY", + "PerformanceConfiguration": "PERFORMANCE_CONFIGURATION", + "PromptRouterTrace": "PROMPT_ROUTER_TRACE", + "PromptVariableValues": "PROMPT_VARIABLE_VALUES", + "PromptVariableValuesText": "PROMPT_VARIABLE_VALUES", + "PromptVariableValuesUnknown": "PROMPT_VARIABLE_VALUES", + "ReasoningContentBlock": "REASONING_CONTENT_BLOCK", + "ReasoningContentBlockReasoningText": "REASONING_CONTENT_BLOCK", + "ReasoningContentBlockRedactedContent": "REASONING_CONTENT_BLOCK", + "ReasoningContentBlockUnknown": "REASONING_CONTENT_BLOCK", + "ReasoningContentBlockDelta": "REASONING_CONTENT_BLOCK_DELTA", + "ReasoningContentBlockDeltaText": "REASONING_CONTENT_BLOCK_DELTA", + "ReasoningContentBlockDeltaRedactedContent": "REASONING_CONTENT_BLOCK_DELTA", + "ReasoningContentBlockDeltaSignature": "REASONING_CONTENT_BLOCK_DELTA", + "ReasoningContentBlockDeltaUnknown": "REASONING_CONTENT_BLOCK_DELTA", + "ReasoningTextBlock": "REASONING_TEXT_BLOCK", + "ResourceNotFoundException": "RESOURCE_NOT_FOUND_EXCEPTION", + "ResponseStream": "RESPONSE_STREAM", + "ResponseStreamChunk": "RESPONSE_STREAM", + "ResponseStreamInternalServerException": "RESPONSE_STREAM", + "ResponseStreamModelStreamErrorException": "RESPONSE_STREAM", + "ResponseStreamValidationException": "RESPONSE_STREAM", + "ResponseStreamThrottlingException": "RESPONSE_STREAM", + "ResponseStreamModelTimeoutException": "RESPONSE_STREAM", + "ResponseStreamServiceUnavailableException": "RESPONSE_STREAM", + "ResponseStreamUnknown": "RESPONSE_STREAM", + "S3Location": "S3_LOCATION", + "SearchResultBlock": "SEARCH_RESULT_BLOCK", + "SearchResultContentBlock": "SEARCH_RESULT_CONTENT_BLOCK", + "SearchResultLocation": "SEARCH_RESULT_LOCATION", + "ServiceQuotaExceededException": "SERVICE_QUOTA_EXCEEDED_EXCEPTION", + "ServiceTier": "SERVICE_TIER", + "ServiceTierType": "SERVICE_TIER_TYPE", + "ServiceUnavailableException": "SERVICE_UNAVAILABLE_EXCEPTION", + "SortAsyncInvocationBy": "SORT_ASYNC_INVOCATION_BY", + "SortOrder": "SORT_ORDER", + "SpecificToolChoice": "SPECIFIC_TOOL_CHOICE", + "StartAsyncInvokeInput": "START_ASYNC_INVOKE_INPUT", + "StartAsyncInvokeOutput": "START_ASYNC_INVOKE_OUTPUT", + "StopReason": "STOP_REASON", + "SystemContentBlock": "SYSTEM_CONTENT_BLOCK", + "SystemContentBlockText": "SYSTEM_CONTENT_BLOCK", + "SystemContentBlockGuardContent": "SYSTEM_CONTENT_BLOCK", + "SystemContentBlockCachePoint": "SYSTEM_CONTENT_BLOCK", + "SystemContentBlockUnknown": "SYSTEM_CONTENT_BLOCK", + "SystemTool": "SYSTEM_TOOL", + "Tag": "TAG", + "ThrottlingException": "THROTTLING_EXCEPTION", + "TokenUsage": "TOKEN_USAGE", + "Tool": "TOOL", + "ToolToolSpec": "TOOL", + "ToolSystemTool": "TOOL", + "ToolCachePoint": "TOOL", + "ToolUnknown": "TOOL", + "ToolAdditionBlock": "TOOL_ADDITION_BLOCK", + "ToolChoice": "TOOL_CHOICE", + "ToolChoiceAuto": "TOOL_CHOICE", + "ToolChoiceAny": "TOOL_CHOICE", + "ToolChoiceTool": "TOOL_CHOICE", + "ToolChoiceUnknown": "TOOL_CHOICE", + "ToolConfiguration": "TOOL_CONFIGURATION", + "ToolInputSchema": "TOOL_INPUT_SCHEMA", + "ToolInputSchemaJson": "TOOL_INPUT_SCHEMA", + "ToolInputSchemaUnknown": "TOOL_INPUT_SCHEMA", + "ToolReference": "TOOL_REFERENCE", + "ToolRemovalBlock": "TOOL_REMOVAL_BLOCK", + "ToolResultBlock": "TOOL_RESULT_BLOCK", + "ToolResultBlockDelta": "TOOL_RESULT_BLOCK_DELTA", + "ToolResultBlockDeltaText": "TOOL_RESULT_BLOCK_DELTA", + "ToolResultBlockDeltaJson": "TOOL_RESULT_BLOCK_DELTA", + "ToolResultBlockDeltaUnknown": "TOOL_RESULT_BLOCK_DELTA", + "ToolResultBlockStart": "TOOL_RESULT_BLOCK_START", + "ToolResultContentBlock": "TOOL_RESULT_CONTENT_BLOCK", + "ToolResultContentBlockJson": "TOOL_RESULT_CONTENT_BLOCK", + "ToolResultContentBlockText": "TOOL_RESULT_CONTENT_BLOCK", + "ToolResultContentBlockImage": "TOOL_RESULT_CONTENT_BLOCK", + "ToolResultContentBlockDocument": "TOOL_RESULT_CONTENT_BLOCK", + "ToolResultContentBlockVideo": "TOOL_RESULT_CONTENT_BLOCK", + "ToolResultContentBlockSearchResult": "TOOL_RESULT_CONTENT_BLOCK", + "ToolResultContentBlockUnknown": "TOOL_RESULT_CONTENT_BLOCK", + "ToolResultStatus": "TOOL_RESULT_STATUS", + "ToolSpecification": "TOOL_SPECIFICATION", + "ToolUseBlock": "TOOL_USE_BLOCK", + "ToolUseBlockDelta": "TOOL_USE_BLOCK_DELTA", + "ToolUseBlockStart": "TOOL_USE_BLOCK_START", + "ToolUseType": "TOOL_USE_TYPE", + "Trace": "TRACE", + "ValidationException": "VALIDATION_EXCEPTION", + "VideoBlock": "VIDEO_BLOCK", + "VideoFormat": "VIDEO_FORMAT", + "VideoSource": "VIDEO_SOURCE", + "VideoSourceBytes": "VIDEO_SOURCE", + "VideoSourceS3Location": "VIDEO_SOURCE", + "VideoSourceUnknown": "VIDEO_SOURCE", + "WebLocation": "WEB_LOCATION", + }, + shape_names=frozenset( + { + "AccessDeniedException", + "AnyToolChoice", + "AppliedGuardrailDetails", + "ApplyGuardrailInput", + "ApplyGuardrailOutput", + "AsyncInvokeOutputDataConfig", + "AsyncInvokeS3OutputDataConfig", + "AsyncInvokeStatus", + "AsyncInvokeSummary", + "AudioBlock", + "AudioFormat", + "AudioSource", + "AutoToolChoice", + "BidirectionalInputPayloadPart", + "BidirectionalOutputPayloadPart", + "CacheDetail", + "CachePointBlock", + "CachePointType", + "CacheTTL", + "Citation", + "CitationGeneratedContent", + "CitationLocation", + "CitationSourceContent", + "CitationSourceContentDelta", + "CitationsConfig", + "CitationsContentBlock", + "CitationsDelta", + "ConflictException", + "ContentBlock", + "ContentBlockDelta", + "ContentBlockDeltaEvent", + "ContentBlockStart", + "ContentBlockStartEvent", + "ContentBlockStopEvent", + "ConversationRole", + "ConverseInput", + "ConverseMetrics", + "ConverseOperationOutput", + "ConverseOutput", + "ConverseStreamInput", + "ConverseStreamMetadataEvent", + "ConverseStreamMetrics", + "ConverseStreamOperationOutput", + "ConverseStreamOutput", + "ConverseStreamTrace", + "ConverseTokensRequest", + "ConverseTrace", + "CountTokensInput", + "CountTokensOperationInput", + "CountTokensOutput", + "DocumentBlock", + "DocumentCharLocation", + "DocumentChunkLocation", + "DocumentContentBlock", + "DocumentFormat", + "DocumentPageLocation", + "DocumentSource", + "ErrorBlock", + "GetAsyncInvokeInput", + "GetAsyncInvokeOutput", + "GuardrailAction", + "GuardrailAssessment", + "GuardrailAutomatedReasoningFinding", + "GuardrailAutomatedReasoningImpossibleFinding", + "GuardrailAutomatedReasoningInputTextReference", + "GuardrailAutomatedReasoningInvalidFinding", + "GuardrailAutomatedReasoningLogicWarning", + "GuardrailAutomatedReasoningLogicWarningType", + "GuardrailAutomatedReasoningNoTranslationsFinding", + "GuardrailAutomatedReasoningPolicyAssessment", + "GuardrailAutomatedReasoningRule", + "GuardrailAutomatedReasoningSatisfiableFinding", + "GuardrailAutomatedReasoningScenario", + "GuardrailAutomatedReasoningStatement", + "GuardrailAutomatedReasoningTooComplexFinding", + "GuardrailAutomatedReasoningTranslation", + "GuardrailAutomatedReasoningTranslationAmbiguousFinding", + "GuardrailAutomatedReasoningTranslationOption", + "GuardrailAutomatedReasoningValidFinding", + "GuardrailChecksConfig", + "GuardrailChecksContentBlock", + "GuardrailChecksContentFilterCategory", + "GuardrailChecksContentFilterCategoryConfig", + "GuardrailChecksContentFilterConfig", + "GuardrailChecksContentFilterResult", + "GuardrailChecksContentFilterResultEntry", + "GuardrailChecksContentFilterUsage", + "GuardrailChecksMessage", + "GuardrailChecksPromptAttackCategory", + "GuardrailChecksPromptAttackCategoryConfig", + "GuardrailChecksPromptAttackConfig", + "GuardrailChecksPromptAttackResult", + "GuardrailChecksPromptAttackResultEntry", + "GuardrailChecksPromptAttackUsage", + "GuardrailChecksResults", + "GuardrailChecksRole", + "GuardrailChecksSensitiveInformationConfig", + "GuardrailChecksSensitiveInformationEntityConfig", + "GuardrailChecksSensitiveInformationEntityType", + "GuardrailChecksSensitiveInformationResult", + "GuardrailChecksSensitiveInformationResultEntry", + "GuardrailChecksSensitiveInformationUsage", + "GuardrailChecksUsageResults", + "GuardrailConfiguration", + "GuardrailContentBlock", + "GuardrailContentFilter", + "GuardrailContentFilterConfidence", + "GuardrailContentFilterStrength", + "GuardrailContentFilterType", + "GuardrailContentPolicyAction", + "GuardrailContentPolicyAssessment", + "GuardrailContentQualifier", + "GuardrailContentSource", + "GuardrailContextualGroundingFilter", + "GuardrailContextualGroundingFilterType", + "GuardrailContextualGroundingPolicyAction", + "GuardrailContextualGroundingPolicyAssessment", + "GuardrailConverseContentBlock", + "GuardrailConverseContentQualifier", + "GuardrailConverseImageBlock", + "GuardrailConverseImageFormat", + "GuardrailConverseImageSource", + "GuardrailConverseTextBlock", + "GuardrailCoverage", + "GuardrailCustomWord", + "GuardrailImageBlock", + "GuardrailImageCoverage", + "GuardrailImageFormat", + "GuardrailImageSource", + "GuardrailInvocationMetrics", + "GuardrailManagedWord", + "GuardrailManagedWordType", + "GuardrailOrigin", + "GuardrailOutputContent", + "GuardrailOutputScope", + "GuardrailOwnership", + "GuardrailPiiEntityFilter", + "GuardrailPiiEntityType", + "GuardrailRegexFilter", + "GuardrailSensitiveInformationPolicyAction", + "GuardrailSensitiveInformationPolicyAssessment", + "GuardrailStreamConfiguration", + "GuardrailStreamProcessingMode", + "GuardrailTextBlock", + "GuardrailTextCharactersCoverage", + "GuardrailTopic", + "GuardrailTopicPolicyAction", + "GuardrailTopicPolicyAssessment", + "GuardrailTopicType", + "GuardrailTrace", + "GuardrailTraceAssessment", + "GuardrailUsage", + "GuardrailWordPolicyAction", + "GuardrailWordPolicyAssessment", + "ImageBlock", + "ImageBlockDelta", + "ImageBlockStart", + "ImageFormat", + "ImageSource", + "InferenceConfiguration", + "InternalServerException", + "InvokeGuardrailChecksInput", + "InvokeGuardrailChecksOutput", + "InvokeModelInput", + "InvokeModelOutput", + "InvokeModelTokensRequest", + "InvokeModelWithBidirectionalStreamInput", + "InvokeModelWithBidirectionalStreamOperationInput", + "InvokeModelWithBidirectionalStreamOperationOutput", + "InvokeModelWithBidirectionalStreamOutput", + "InvokeModelWithResponseStreamInput", + "InvokeModelWithResponseStreamOutput", + "JsonSchemaDefinition", + "ListAsyncInvokesInput", + "ListAsyncInvokesOutput", + "Message", + "MessageStartEvent", + "MessageStopEvent", + "ModelErrorException", + "ModelNotReadyException", + "ModelStreamErrorException", + "ModelTimeoutException", + "OutputConfig", + "OutputFormat", + "OutputFormatStructure", + "OutputFormatType", + "PayloadPart", + "PerformanceConfigLatency", + "PerformanceConfiguration", + "PromptRouterTrace", + "PromptVariableValues", + "ReasoningContentBlock", + "ReasoningContentBlockDelta", + "ReasoningTextBlock", + "ResourceNotFoundException", + "ResponseStream", + "S3Location", + "SearchResultBlock", + "SearchResultContentBlock", + "SearchResultLocation", + "ServiceQuotaExceededException", + "ServiceTier", + "ServiceTierType", + "ServiceUnavailableException", + "SortAsyncInvocationBy", + "SortOrder", + "SpecificToolChoice", + "StartAsyncInvokeInput", + "StartAsyncInvokeOutput", + "StopReason", + "SystemContentBlock", + "SystemTool", + "Tag", + "ThrottlingException", + "TokenUsage", + "Tool", + "ToolAdditionBlock", + "ToolChoice", + "ToolConfiguration", + "ToolInputSchema", + "ToolReference", + "ToolRemovalBlock", + "ToolResultBlock", + "ToolResultBlockDelta", + "ToolResultBlockStart", + "ToolResultContentBlock", + "ToolResultStatus", + "ToolSpecification", + "ToolUseBlock", + "ToolUseBlockDelta", + "ToolUseBlockStart", + "ToolUseType", + "Trace", + "ValidationException", + "VideoBlock", + "VideoFormat", + "VideoSource", + "WebLocation", + } + ), + service_error="ServiceError", +) - end_time: datetime | None = None - """When the invocation ended.""" - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False +def __getattr__(name: str): + return _registry.build(name) + + +GET_ASYNC_INVOKE: APIOperation[GetAsyncInvokeInput, GetAsyncInvokeOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_ASYNC_INVOKE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockruntime#InternalServerException"), + ShapeID("com.amazonaws.bedrockruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockruntime#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_ASYNC_INVOKE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_ASYNC_INVOKE_OUTPUT.members["invocationArn"], - self.invocation_arn, - ) - serializer.write_string( - _SCHEMA_GET_ASYNC_INVOKE_OUTPUT.members["modelArn"], self.model_arn - ) - if self.client_request_token is not None: - serializer.write_string( - _SCHEMA_GET_ASYNC_INVOKE_OUTPUT.members["clientRequestToken"], - self.client_request_token, - ) - - serializer.write_string( - _SCHEMA_GET_ASYNC_INVOKE_OUTPUT.members["status"], self.status - ) - if self.failure_message is not None: - serializer.write_string( - _SCHEMA_GET_ASYNC_INVOKE_OUTPUT.members["failureMessage"], - self.failure_message, - ) - - serializer.write_timestamp( - _SCHEMA_GET_ASYNC_INVOKE_OUTPUT.members["submitTime"], self.submit_time - ) - if self.last_modified_time is not None: - serializer.write_timestamp( - _SCHEMA_GET_ASYNC_INVOKE_OUTPUT.members["lastModifiedTime"], - self.last_modified_time, - ) - - if self.end_time is not None: - serializer.write_timestamp( - _SCHEMA_GET_ASYNC_INVOKE_OUTPUT.members["endTime"], self.end_time - ) - - serializer.write_struct( - _SCHEMA_GET_ASYNC_INVOKE_OUTPUT.members["outputDataConfig"], - self.output_data_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["invocation_arn"] = de.read_string( - _SCHEMA_GET_ASYNC_INVOKE_OUTPUT.members["invocationArn"] - ) - - case 1: - kwargs["model_arn"] = de.read_string( - _SCHEMA_GET_ASYNC_INVOKE_OUTPUT.members["modelArn"] - ) - - case 2: - kwargs["client_request_token"] = de.read_string( - _SCHEMA_GET_ASYNC_INVOKE_OUTPUT.members["clientRequestToken"] - ) - - case 3: - kwargs["status"] = AsyncInvokeStatus( - de.read_string( - _SCHEMA_GET_ASYNC_INVOKE_OUTPUT.members["status"] - ) - ) - - case 4: - kwargs["failure_message"] = de.read_string( - _SCHEMA_GET_ASYNC_INVOKE_OUTPUT.members["failureMessage"] - ) - - case 5: - kwargs["submit_time"] = de.read_timestamp( - _SCHEMA_GET_ASYNC_INVOKE_OUTPUT.members["submitTime"] - ) - - case 6: - kwargs["last_modified_time"] = de.read_timestamp( - _SCHEMA_GET_ASYNC_INVOKE_OUTPUT.members["lastModifiedTime"] - ) - - case 7: - kwargs["end_time"] = de.read_timestamp( - _SCHEMA_GET_ASYNC_INVOKE_OUTPUT.members["endTime"] - ) - - case 8: - kwargs["output_data_config"] = ( - _AsyncInvokeOutputDataConfigDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_ASYNC_INVOKE_OUTPUT, consumer=_consumer) - if "invocation_arn" not in kwargs: - kwargs["invocation_arn"] = "" - if "model_arn" not in kwargs: - kwargs["model_arn"] = "" - if "status" not in kwargs: - kwargs["status"] = AsyncInvokeStatus._corrected("") - if "submit_time" not in kwargs: - kwargs["submit_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "output_data_config" not in kwargs: - kwargs["output_data_config"] = AsyncInvokeOutputDataConfigUnknown(tag="") - return kwargs - - -@dataclass(kw_only=True) -class InternalServerException(ServiceError): - """ - An internal server error occurred. For troubleshooting this error, see - [InternalFailure](https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-internal-failure) - in the Amazon Bedrock User Guide - """ - - fault: Literal["client", "server"] | None = "server" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INTERNAL_SERVER_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INTERNAL_SERVER_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INTERNAL_SERVER_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INTERNAL_SERVER_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ThrottlingException(ServiceError): - """ - Your request was denied due to exceeding the account quotas for *Amazon - Bedrock*. For troubleshooting this error, see - [ThrottlingException](https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-throttling-exception) - in the Amazon Bedrock User Guide - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_THROTTLING_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_THROTTLING_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_THROTTLING_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_THROTTLING_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ValidationException(ServiceError): - """ - The input fails to satisfy the constraints specified by *Amazon - Bedrock*. For troubleshooting this error, see - [ValidationError](https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-validation-error) - in the Amazon Bedrock User Guide - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VALIDATION_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_VALIDATION_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_VALIDATION_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) +) - deserializer.read_struct(_SCHEMA_VALIDATION_EXCEPTION, consumer=_consumer) - return kwargs +LIST_ASYNC_INVOKES: APIOperation[ListAsyncInvokesInput, ListAsyncInvokesOutput] = ( + APIOperation( + static_schema=_SCHEMA_LIST_ASYNC_INVOKES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockruntime#InternalServerException"), + ShapeID("com.amazonaws.bedrockruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockruntime#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], + ) +) +START_ASYNC_INVOKE: APIOperation[StartAsyncInvokeInput, StartAsyncInvokeOutput] = ( + APIOperation( + static_schema=_SCHEMA_START_ASYNC_INVOKE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockruntime#ConflictException"), + ShapeID("com.amazonaws.bedrockruntime#InternalServerException"), + ShapeID("com.amazonaws.bedrockruntime#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockruntime#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockruntime#ServiceUnavailableException"), + ShapeID("com.amazonaws.bedrockruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockruntime#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], + ) +) -GET_ASYNC_INVOKE = APIOperation( - input=GetAsyncInvokeInput, - output=GetAsyncInvokeOutput, - schema=_SCHEMA_GET_ASYNC_INVOKE, - input_schema=_SCHEMA_GET_ASYNC_INVOKE_INPUT, - output_schema=_SCHEMA_GET_ASYNC_INVOKE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockruntime#ValidationException" - ): ValidationException, - } - ), +APPLY_GUARDRAIL: APIOperation[ApplyGuardrailInput, ApplyGuardrailOutput] = APIOperation( + static_schema=_SCHEMA_APPLY_GUARDRAIL, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockruntime#InternalServerException"), + ShapeID("com.amazonaws.bedrockruntime#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockruntime#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockruntime#ServiceUnavailableException"), + ShapeID("com.amazonaws.bedrockruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockruntime#ValidationException"), + ], effective_auth_schemes=[ ShapeID("aws.auth#sigv4"), ShapeID("smithy.api#httpBearerAuth"), ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], ) - -class SortAsyncInvocationBy(UnknownEnumMixin, StrEnum): - SUBMISSION_TIME = "SubmissionTime" - - -class SortOrder(UnknownEnumMixin, StrEnum): - ASCENDING = "Ascending" - DESCENDING = "Descending" - - -@dataclass(kw_only=True) -class ListAsyncInvokesInput: - """Dataclass for ListAsyncInvokesInput structure.""" - - submit_time_after: datetime | None = None - """Include invocations submitted after this time.""" - - submit_time_before: datetime | None = None - """Include invocations submitted before this time.""" - - status_equals: str | None = None - """Filter invocations by status.""" - - max_results: int | None = None - """The maximum number of invocations to return in one page of results.""" - - next_token: str | None = None - """ - Specify the pagination token from a previous request to retrieve the - next page of results. - """ - - sort_by: str = SortAsyncInvocationBy("SubmissionTime") - """How to sort the response.""" - - sort_order: str = SortOrder("Descending") - """The sorting order for the response.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_ASYNC_INVOKES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.submit_time_after is not None: - serializer.write_timestamp( - _SCHEMA_LIST_ASYNC_INVOKES_INPUT.members["submitTimeAfter"], - self.submit_time_after, - ) - - if self.submit_time_before is not None: - serializer.write_timestamp( - _SCHEMA_LIST_ASYNC_INVOKES_INPUT.members["submitTimeBefore"], - self.submit_time_before, - ) - - if self.status_equals is not None: - serializer.write_string( - _SCHEMA_LIST_ASYNC_INVOKES_INPUT.members["statusEquals"], - self.status_equals, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_ASYNC_INVOKES_INPUT.members["maxResults"], self.max_results - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_ASYNC_INVOKES_INPUT.members["nextToken"], self.next_token - ) - - if self.sort_by is not None: - serializer.write_string( - _SCHEMA_LIST_ASYNC_INVOKES_INPUT.members["sortBy"], self.sort_by - ) - - if self.sort_order is not None: - serializer.write_string( - _SCHEMA_LIST_ASYNC_INVOKES_INPUT.members["sortOrder"], self.sort_order - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["submit_time_after"] = de.read_timestamp( - _SCHEMA_LIST_ASYNC_INVOKES_INPUT.members["submitTimeAfter"] - ) - - case 1: - kwargs["submit_time_before"] = de.read_timestamp( - _SCHEMA_LIST_ASYNC_INVOKES_INPUT.members["submitTimeBefore"] - ) - - case 2: - kwargs["status_equals"] = AsyncInvokeStatus( - de.read_string( - _SCHEMA_LIST_ASYNC_INVOKES_INPUT.members["statusEquals"] - ) - ) - - case 3: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_ASYNC_INVOKES_INPUT.members["maxResults"] - ) - - case 4: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_ASYNC_INVOKES_INPUT.members["nextToken"] - ) - - case 5: - kwargs["sort_by"] = SortAsyncInvocationBy( - de.read_string( - _SCHEMA_LIST_ASYNC_INVOKES_INPUT.members["sortBy"] - ) - ) - - case 6: - kwargs["sort_order"] = SortOrder( - de.read_string( - _SCHEMA_LIST_ASYNC_INVOKES_INPUT.members["sortOrder"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_ASYNC_INVOKES_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class AsyncInvokeSummary: - """A summary of an asynchronous invocation.""" - - invocation_arn: str - """The invocation's ARN.""" - - model_arn: str - """The invoked model's ARN.""" - - submit_time: datetime - """When the invocation was submitted.""" - - output_data_config: AsyncInvokeOutputDataConfig - """The invocation's output data settings.""" - - client_request_token: str | None = None - """The invocation's idempotency token.""" - - status: str | None = None - """The invocation's status.""" - - failure_message: str | None = field(repr=False, default=None) - """An error message.""" - - last_modified_time: datetime | None = None - """When the invocation was last modified.""" - - end_time: datetime | None = None - """When the invocation ended.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ASYNC_INVOKE_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_ASYNC_INVOKE_SUMMARY.members["invocationArn"], self.invocation_arn - ) - serializer.write_string( - _SCHEMA_ASYNC_INVOKE_SUMMARY.members["modelArn"], self.model_arn - ) - if self.client_request_token is not None: - serializer.write_string( - _SCHEMA_ASYNC_INVOKE_SUMMARY.members["clientRequestToken"], - self.client_request_token, - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_ASYNC_INVOKE_SUMMARY.members["status"], self.status - ) - - if self.failure_message is not None: - serializer.write_string( - _SCHEMA_ASYNC_INVOKE_SUMMARY.members["failureMessage"], - self.failure_message, - ) - - serializer.write_timestamp( - _SCHEMA_ASYNC_INVOKE_SUMMARY.members["submitTime"], self.submit_time - ) - if self.last_modified_time is not None: - serializer.write_timestamp( - _SCHEMA_ASYNC_INVOKE_SUMMARY.members["lastModifiedTime"], - self.last_modified_time, - ) - - if self.end_time is not None: - serializer.write_timestamp( - _SCHEMA_ASYNC_INVOKE_SUMMARY.members["endTime"], self.end_time - ) - - serializer.write_struct( - _SCHEMA_ASYNC_INVOKE_SUMMARY.members["outputDataConfig"], - self.output_data_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["invocation_arn"] = de.read_string( - _SCHEMA_ASYNC_INVOKE_SUMMARY.members["invocationArn"] - ) - - case 1: - kwargs["model_arn"] = de.read_string( - _SCHEMA_ASYNC_INVOKE_SUMMARY.members["modelArn"] - ) - - case 2: - kwargs["client_request_token"] = de.read_string( - _SCHEMA_ASYNC_INVOKE_SUMMARY.members["clientRequestToken"] - ) - - case 3: - kwargs["status"] = AsyncInvokeStatus( - de.read_string(_SCHEMA_ASYNC_INVOKE_SUMMARY.members["status"]) - ) - - case 4: - kwargs["failure_message"] = de.read_string( - _SCHEMA_ASYNC_INVOKE_SUMMARY.members["failureMessage"] - ) - - case 5: - kwargs["submit_time"] = de.read_timestamp( - _SCHEMA_ASYNC_INVOKE_SUMMARY.members["submitTime"] - ) - - case 6: - kwargs["last_modified_time"] = de.read_timestamp( - _SCHEMA_ASYNC_INVOKE_SUMMARY.members["lastModifiedTime"] - ) - - case 7: - kwargs["end_time"] = de.read_timestamp( - _SCHEMA_ASYNC_INVOKE_SUMMARY.members["endTime"] - ) - - case 8: - kwargs["output_data_config"] = ( - _AsyncInvokeOutputDataConfigDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ASYNC_INVOKE_SUMMARY, consumer=_consumer) - if "invocation_arn" not in kwargs: - kwargs["invocation_arn"] = "" - if "model_arn" not in kwargs: - kwargs["model_arn"] = "" - if "submit_time" not in kwargs: - kwargs["submit_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "output_data_config" not in kwargs: - kwargs["output_data_config"] = AsyncInvokeOutputDataConfigUnknown(tag="") - return kwargs - - -def _serialize_async_invoke_summaries( - serializer: ShapeSerializer, schema: Schema, value: list[AsyncInvokeSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_async_invoke_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AsyncInvokeSummary]: - result: list[AsyncInvokeSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AsyncInvokeSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListAsyncInvokesOutput: - """Dataclass for ListAsyncInvokesOutput structure.""" - - next_token: str | None = None - """ - Specify the pagination token from a previous request to retrieve the - next page of results. - """ - - async_invoke_summaries: list[AsyncInvokeSummary] | None = None - """A list of invocation summaries.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_ASYNC_INVOKES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_ASYNC_INVOKES_OUTPUT.members["nextToken"], self.next_token - ) - - if self.async_invoke_summaries is not None: - _serialize_async_invoke_summaries( - serializer, - _SCHEMA_LIST_ASYNC_INVOKES_OUTPUT.members["asyncInvokeSummaries"], - self.async_invoke_summaries, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_ASYNC_INVOKES_OUTPUT.members["nextToken"] - ) - - case 1: - kwargs["async_invoke_summaries"] = ( - _deserialize_async_invoke_summaries( - de, - _SCHEMA_LIST_ASYNC_INVOKES_OUTPUT.members[ - "asyncInvokeSummaries" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_ASYNC_INVOKES_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_ASYNC_INVOKES = APIOperation( - input=ListAsyncInvokesInput, - output=ListAsyncInvokesOutput, - schema=_SCHEMA_LIST_ASYNC_INVOKES, - input_schema=_SCHEMA_LIST_ASYNC_INVOKES_INPUT, - output_schema=_SCHEMA_LIST_ASYNC_INVOKES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockruntime#ValidationException" - ): ValidationException, - } - ), +INVOKE_GUARDRAIL_CHECKS: APIOperation[ + InvokeGuardrailChecksInput, InvokeGuardrailChecksOutput +] = APIOperation( + static_schema=_SCHEMA_INVOKE_GUARDRAIL_CHECKS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockruntime#InternalServerException"), + ShapeID("com.amazonaws.bedrockruntime#ServiceUnavailableException"), + ShapeID("com.amazonaws.bedrockruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockruntime#ValidationException"), + ], effective_auth_schemes=[ ShapeID("aws.auth#sigv4"), ShapeID("smithy.api#httpBearerAuth"), ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, +) + +CONVERSE: APIOperation[ConverseInput, ConverseOperationOutput] = APIOperation( + static_schema=_SCHEMA_CONVERSE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockruntime#InternalServerException"), + ShapeID("com.amazonaws.bedrockruntime#ModelErrorException"), + ShapeID("com.amazonaws.bedrockruntime#ModelNotReadyException"), + ShapeID("com.amazonaws.bedrockruntime#ModelTimeoutException"), + ShapeID("com.amazonaws.bedrockruntime#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockruntime#ServiceUnavailableException"), + ShapeID("com.amazonaws.bedrockruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockruntime#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), ], ) - -@dataclass(kw_only=True) -class ConflictException(ServiceError): - """Error occurred because of a conflict while performing an operation.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONFLICT_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_CONFLICT_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_CONFLICT_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONFLICT_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ResourceNotFoundException(ServiceError): - """ - The specified resource ARN was not found. For troubleshooting this - error, see - [ResourceNotFound](https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-resource-not-found) - in the Amazon Bedrock User Guide - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ServiceQuotaExceededException(ServiceError): - """ - Your request exceeds the service quota for your account. You can view - your quotas at [Viewing service - quotas](https://docs.aws.amazon.com/servicequotas/latest/userguide/gs-request-quota.html). - You can resubmit your request later. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ServiceUnavailableException(ServiceError): - """ - The service isn't currently available. For troubleshooting this error, - see - [ServiceUnavailable](https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-service-unavailable) - in the Amazon Bedrock User Guide - """ - - fault: Literal["client", "server"] | None = "server" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SERVICE_UNAVAILABLE_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_SERVICE_UNAVAILABLE_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_SERVICE_UNAVAILABLE_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SERVICE_UNAVAILABLE_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class Tag: - """A tag.""" - - key: str - """The tag's key.""" - - value: str - """The tag's value.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TAG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_TAG.members["key"], self.key) - serializer.write_string(_SCHEMA_TAG.members["value"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["key"] = de.read_string(_SCHEMA_TAG.members["key"]) - - case 1: - kwargs["value"] = de.read_string(_SCHEMA_TAG.members["value"]) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TAG, consumer=_consumer) - if "key" not in kwargs: - kwargs["key"] = "" - if "value" not in kwargs: - kwargs["value"] = "" - return kwargs - - -def _serialize_tag_list( - serializer: ShapeSerializer, schema: Schema, value: list[Tag] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_tag_list(deserializer: ShapeDeserializer, schema: Schema) -> list[Tag]: - result: list[Tag] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Tag.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class StartAsyncInvokeInput: - """Dataclass for StartAsyncInvokeInput structure.""" - - client_request_token: str | None = None - """Specify idempotency token to ensure that requests are not duplicated.""" - - model_id: str | None = None - """The model to invoke.""" - - model_input: Document | None = field(repr=False, default=None) - """Input to send to the model.""" - - output_data_config: AsyncInvokeOutputDataConfig | None = None - """Where to store the output.""" - - tags: list[Tag] | None = None - """Tags to apply to the invocation.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_ASYNC_INVOKE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.client_request_token is not None: - serializer.write_string( - _SCHEMA_START_ASYNC_INVOKE_INPUT.members["clientRequestToken"], - self.client_request_token, - ) - - if self.model_id is not None: - serializer.write_string( - _SCHEMA_START_ASYNC_INVOKE_INPUT.members["modelId"], self.model_id - ) - - if self.model_input is not None: - serializer.write_document( - _SCHEMA_START_ASYNC_INVOKE_INPUT.members["modelInput"], self.model_input - ) - - if self.output_data_config is not None: - serializer.write_struct( - _SCHEMA_START_ASYNC_INVOKE_INPUT.members["outputDataConfig"], - self.output_data_config, - ) - - if self.tags is not None: - _serialize_tag_list( - serializer, _SCHEMA_START_ASYNC_INVOKE_INPUT.members["tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["client_request_token"] = de.read_string( - _SCHEMA_START_ASYNC_INVOKE_INPUT.members["clientRequestToken"] - ) - - case 1: - kwargs["model_id"] = de.read_string( - _SCHEMA_START_ASYNC_INVOKE_INPUT.members["modelId"] - ) - - case 2: - kwargs["model_input"] = de.read_document( - _SCHEMA_START_ASYNC_INVOKE_INPUT.members["modelInput"] - ) - - case 3: - kwargs["output_data_config"] = ( - _AsyncInvokeOutputDataConfigDeserializer().deserialize(de) - ) - - case 4: - kwargs["tags"] = _deserialize_tag_list( - de, _SCHEMA_START_ASYNC_INVOKE_INPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_START_ASYNC_INVOKE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class StartAsyncInvokeOutput: - """Dataclass for StartAsyncInvokeOutput structure.""" - - invocation_arn: str - """The ARN of the invocation.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_ASYNC_INVOKE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_START_ASYNC_INVOKE_OUTPUT.members["invocationArn"], - self.invocation_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["invocation_arn"] = de.read_string( - _SCHEMA_START_ASYNC_INVOKE_OUTPUT.members["invocationArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_START_ASYNC_INVOKE_OUTPUT, consumer=_consumer) - if "invocation_arn" not in kwargs: - kwargs["invocation_arn"] = "" - return kwargs - - -START_ASYNC_INVOKE = APIOperation( - input=StartAsyncInvokeInput, - output=StartAsyncInvokeOutput, - schema=_SCHEMA_START_ASYNC_INVOKE, - input_schema=_SCHEMA_START_ASYNC_INVOKE_INPUT, - output_schema=_SCHEMA_START_ASYNC_INVOKE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockruntime#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.bedrockruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockruntime#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockruntime#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockruntime#ServiceUnavailableException" - ): ServiceUnavailableException, - ShapeID( - "com.amazonaws.bedrockruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockruntime#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_SERVICE_UNAVAILABLE_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class GuardrailImageFormat(UnknownEnumMixin, StrEnum): - PNG = "png" - JPEG = "jpeg" - - -@dataclass -class GuardrailImageSourceBytes: - """ - The bytes details of the guardrail image source. Object used in - independent api. - """ - - value: bytes - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_IMAGE_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_blob( - _SCHEMA_GUARDRAIL_IMAGE_SOURCE.members["bytes"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_blob( - _SCHEMA_GUARDRAIL_IMAGE_SOURCE.members["bytes"] - ) - ) - - -@dataclass -class GuardrailImageSourceUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -GuardrailImageSource = Union[GuardrailImageSourceBytes | GuardrailImageSourceUnknown] -""" -The image source (image bytes) of the guardrail image source. Object -used in independent api. -""" - - -class _GuardrailImageSourceDeserializer: - _result: GuardrailImageSource | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> GuardrailImageSource: - self._result = None - deserializer.read_struct(_SCHEMA_GUARDRAIL_IMAGE_SOURCE, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(GuardrailImageSourceBytes.deserialize(de)) - - case _: - self._set_result( - GuardrailImageSourceUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: GuardrailImageSource) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class GuardrailImageBlock: - """ - Contain an image which user wants guarded. This block is accepted by the - guardrails independent API. - """ - - format: str - """ - The format details for the file type of the image blocked by the - guardrail. - """ - - source: GuardrailImageSource = field(repr=False) - """ - The image source (image bytes) details of the image blocked by the - guardrail. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_IMAGE_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GUARDRAIL_IMAGE_BLOCK.members["format"], self.format - ) - serializer.write_struct( - _SCHEMA_GUARDRAIL_IMAGE_BLOCK.members["source"], self.source - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["format"] = GuardrailImageFormat( - de.read_string(_SCHEMA_GUARDRAIL_IMAGE_BLOCK.members["format"]) - ) - - case 1: - kwargs["source"] = _GuardrailImageSourceDeserializer().deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GUARDRAIL_IMAGE_BLOCK, consumer=_consumer) - if "format" not in kwargs: - kwargs["format"] = GuardrailImageFormat._corrected("") - if "source" not in kwargs: - kwargs["source"] = GuardrailImageSourceUnknown(tag="") - return kwargs - - -class GuardrailContentQualifier(UnknownEnumMixin, StrEnum): - GROUNDING_SOURCE = "grounding_source" - QUERY = "query" - GUARD_CONTENT = "guard_content" - - -def _serialize_guardrail_content_qualifier_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_guardrail_content_qualifier_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GuardrailContentQualifier(d.read_string(member_schema))) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GuardrailTextBlock: - """The text block to be evaluated by the guardrail.""" - - text: str - """The input text details to be evaluated by the guardrail.""" - - qualifiers: list[str] | None = None - """The qualifiers describing the text block.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_TEXT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_GUARDRAIL_TEXT_BLOCK.members["text"], self.text) - if self.qualifiers is not None: - _serialize_guardrail_content_qualifier_list( - serializer, - _SCHEMA_GUARDRAIL_TEXT_BLOCK.members["qualifiers"], - self.qualifiers, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["text"] = de.read_string( - _SCHEMA_GUARDRAIL_TEXT_BLOCK.members["text"] - ) - - case 1: - kwargs["qualifiers"] = ( - _deserialize_guardrail_content_qualifier_list( - de, _SCHEMA_GUARDRAIL_TEXT_BLOCK.members["qualifiers"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GUARDRAIL_TEXT_BLOCK, consumer=_consumer) - if "text" not in kwargs: - kwargs["text"] = "" - return kwargs - - -@dataclass -class GuardrailContentBlockText: - """Text within content block to be evaluated by the guardrail.""" - - value: GuardrailTextBlock - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GUARDRAIL_CONTENT_BLOCK.members["text"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=GuardrailTextBlock.deserialize(deserializer)) - - -@dataclass -class GuardrailContentBlockImage: - """Image within guardrail content block to be evaluated by the guardrail.""" - - value: GuardrailImageBlock - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GUARDRAIL_CONTENT_BLOCK.members["image"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=GuardrailImageBlock.deserialize(deserializer)) - - -@dataclass -class GuardrailContentBlockUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -GuardrailContentBlock = Union[ - GuardrailContentBlockText - | GuardrailContentBlockImage - | GuardrailContentBlockUnknown -] -"""The content block to be evaluated by the guardrail.""" - - -class _GuardrailContentBlockDeserializer: - _result: GuardrailContentBlock | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> GuardrailContentBlock: - self._result = None - deserializer.read_struct(_SCHEMA_GUARDRAIL_CONTENT_BLOCK, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(GuardrailContentBlockText.deserialize(de)) - - case 1: - self._set_result(GuardrailContentBlockImage.deserialize(de)) - - case _: - self._set_result( - GuardrailContentBlockUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: GuardrailContentBlock) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_guardrail_content_block_list( - serializer: ShapeSerializer, schema: Schema, value: list[GuardrailContentBlock] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_guardrail_content_block_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GuardrailContentBlock]: - result: list[GuardrailContentBlock] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_GuardrailContentBlockDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class GuardrailOutputScope(UnknownEnumMixin, StrEnum): - INTERVENTIONS = "INTERVENTIONS" - FULL = "FULL" - - -class GuardrailContentSource(UnknownEnumMixin, StrEnum): - INPUT = "INPUT" - OUTPUT = "OUTPUT" - - -@dataclass(kw_only=True) -class ApplyGuardrailInput: - """Dataclass for ApplyGuardrailInput structure.""" - - guardrail_identifier: str | None = None - """The guardrail identifier used in the request to apply the guardrail.""" - - guardrail_version: str | None = None - """The guardrail version used in the request to apply the guardrail.""" - - source: str | None = None - """The source of data used in the request to apply the guardrail.""" - - content: list[GuardrailContentBlock] | None = None - """The content details used in the request to apply the guardrail.""" - - output_scope: str | None = None - """ - Specifies the scope of the output that you get in the response. Set to - `FULL` to return the entire output, including any detected and - non-detected entries in the response for enhanced debugging. - - Note that the full output scope doesn't apply to word filters or regex - in sensitive information filters. It does apply to all other filtering - policies, including sensitive information with filters that can detect - personally identifiable information (PII). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_APPLY_GUARDRAIL_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.guardrail_identifier is not None: - serializer.write_string( - _SCHEMA_APPLY_GUARDRAIL_INPUT.members["guardrailIdentifier"], - self.guardrail_identifier, - ) - - if self.guardrail_version is not None: - serializer.write_string( - _SCHEMA_APPLY_GUARDRAIL_INPUT.members["guardrailVersion"], - self.guardrail_version, - ) - - if self.source is not None: - serializer.write_string( - _SCHEMA_APPLY_GUARDRAIL_INPUT.members["source"], self.source - ) - - if self.content is not None: - _serialize_guardrail_content_block_list( - serializer, - _SCHEMA_APPLY_GUARDRAIL_INPUT.members["content"], - self.content, - ) - - if self.output_scope is not None: - serializer.write_string( - _SCHEMA_APPLY_GUARDRAIL_INPUT.members["outputScope"], self.output_scope - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["guardrail_identifier"] = de.read_string( - _SCHEMA_APPLY_GUARDRAIL_INPUT.members["guardrailIdentifier"] - ) - - case 1: - kwargs["guardrail_version"] = de.read_string( - _SCHEMA_APPLY_GUARDRAIL_INPUT.members["guardrailVersion"] - ) - - case 2: - kwargs["source"] = GuardrailContentSource( - de.read_string(_SCHEMA_APPLY_GUARDRAIL_INPUT.members["source"]) - ) - - case 3: - kwargs["content"] = _deserialize_guardrail_content_block_list( - de, _SCHEMA_APPLY_GUARDRAIL_INPUT.members["content"] - ) - - case 4: - kwargs["output_scope"] = GuardrailOutputScope( - de.read_string( - _SCHEMA_APPLY_GUARDRAIL_INPUT.members["outputScope"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_APPLY_GUARDRAIL_INPUT, consumer=_consumer) - return kwargs - - -class GuardrailAction(UnknownEnumMixin, StrEnum): - NONE = "NONE" - GUARDRAIL_INTERVENED = "GUARDRAIL_INTERVENED" - - -class GuardrailOrigin(UnknownEnumMixin, StrEnum): - REQUEST = "REQUEST" - ACCOUNT_ENFORCED = "ACCOUNT_ENFORCED" - ORGANIZATION_ENFORCED = "ORGANIZATION_ENFORCED" - - -def _serialize_guardrail_origin_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_guardrail_origin_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GuardrailOrigin(d.read_string(member_schema))) - - deserializer.read_list(schema, _read_value) - return result - - -class GuardrailOwnership(UnknownEnumMixin, StrEnum): - SELF = "SELF" - CROSS_ACCOUNT = "CROSS_ACCOUNT" - - -@dataclass(kw_only=True) -class AppliedGuardrailDetails: - """ - Details about the specific guardrail that was applied during this - assessment, including its identifier, version, ARN, origin, and - ownership information. - """ - - guardrail_id: str | None = None - """The unique ID of the guardrail that was applied.""" - - guardrail_version: str | None = None - """The version of the guardrail that was applied.""" - - guardrail_arn: str | None = None - """The ARN of the guardrail that was applied.""" - - guardrail_origin: list[str] | None = None - """ - The origin of how the guardrail was applied. This can be either - requested at the API level or enforced at the account or organization - level as a default guardrail. - """ - - guardrail_ownership: str | None = None - """ - The ownership type of the guardrail, indicating whether it is owned by - the requesting account or is a cross-account guardrail shared from - another AWS account. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_APPLIED_GUARDRAIL_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.guardrail_id is not None: - serializer.write_string( - _SCHEMA_APPLIED_GUARDRAIL_DETAILS.members["guardrailId"], - self.guardrail_id, - ) - - if self.guardrail_version is not None: - serializer.write_string( - _SCHEMA_APPLIED_GUARDRAIL_DETAILS.members["guardrailVersion"], - self.guardrail_version, - ) - - if self.guardrail_arn is not None: - serializer.write_string( - _SCHEMA_APPLIED_GUARDRAIL_DETAILS.members["guardrailArn"], - self.guardrail_arn, - ) - - if self.guardrail_origin is not None: - _serialize_guardrail_origin_list( - serializer, - _SCHEMA_APPLIED_GUARDRAIL_DETAILS.members["guardrailOrigin"], - self.guardrail_origin, - ) - - if self.guardrail_ownership is not None: - serializer.write_string( - _SCHEMA_APPLIED_GUARDRAIL_DETAILS.members["guardrailOwnership"], - self.guardrail_ownership, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["guardrail_id"] = de.read_string( - _SCHEMA_APPLIED_GUARDRAIL_DETAILS.members["guardrailId"] - ) - - case 1: - kwargs["guardrail_version"] = de.read_string( - _SCHEMA_APPLIED_GUARDRAIL_DETAILS.members["guardrailVersion"] - ) - - case 2: - kwargs["guardrail_arn"] = de.read_string( - _SCHEMA_APPLIED_GUARDRAIL_DETAILS.members["guardrailArn"] - ) - - case 3: - kwargs["guardrail_origin"] = _deserialize_guardrail_origin_list( - de, _SCHEMA_APPLIED_GUARDRAIL_DETAILS.members["guardrailOrigin"] - ) - - case 4: - kwargs["guardrail_ownership"] = GuardrailOwnership( - de.read_string( - _SCHEMA_APPLIED_GUARDRAIL_DETAILS.members[ - "guardrailOwnership" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_APPLIED_GUARDRAIL_DETAILS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GuardrailAutomatedReasoningRule: - """ - References a specific automated reasoning policy rule that was applied - during evaluation. - """ - - identifier: str | None = None - """The unique identifier of the automated reasoning rule.""" - - policy_version_arn: str | None = None - """ - The ARN of the automated reasoning policy version that contains this - rule. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_AUTOMATED_REASONING_RULE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.identifier is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_RULE.members["identifier"], - self.identifier, - ) - - if self.policy_version_arn is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_RULE.members["policyVersionArn"], - self.policy_version_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["identifier"] = de.read_string( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_RULE.members["identifier"] - ) - - case 1: - kwargs["policy_version_arn"] = de.read_string( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_RULE.members[ - "policyVersionArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_RULE, consumer=_consumer - ) - return kwargs - - -def _serialize_guardrail_automated_reasoning_rule_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[GuardrailAutomatedReasoningRule], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_guardrail_automated_reasoning_rule_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GuardrailAutomatedReasoningRule]: - result: list[GuardrailAutomatedReasoningRule] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GuardrailAutomatedReasoningRule.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GuardrailAutomatedReasoningStatement: - """ - A logical statement that includes both formal logic representation and - natural language explanation. - """ - - logic: str | None = field(repr=False, default=None) - """The formal logical representation of the statement.""" - - natural_language: str | None = field(repr=False, default=None) - """The natural language explanation of the logical statement.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_AUTOMATED_REASONING_STATEMENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.logic is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_STATEMENT.members["logic"], - self.logic, - ) - - if self.natural_language is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_STATEMENT.members[ - "naturalLanguage" - ], - self.natural_language, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["logic"] = de.read_string( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_STATEMENT.members["logic"] - ) - - case 1: - kwargs["natural_language"] = de.read_string( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_STATEMENT.members[ - "naturalLanguage" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_STATEMENT, consumer=_consumer - ) - return kwargs - - -def _serialize_guardrail_automated_reasoning_statement_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[GuardrailAutomatedReasoningStatement], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_guardrail_automated_reasoning_statement_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GuardrailAutomatedReasoningStatement]: - result: list[GuardrailAutomatedReasoningStatement] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GuardrailAutomatedReasoningStatement.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class GuardrailAutomatedReasoningLogicWarningType(UnknownEnumMixin, StrEnum): - ALWAYS_FALSE = "ALWAYS_FALSE" - ALWAYS_TRUE = "ALWAYS_TRUE" - - -@dataclass(kw_only=True) -class GuardrailAutomatedReasoningLogicWarning: - """ - Identifies logical issues in the translated statements that exist - independent of any policy rules, such as statements that are always true - or always false. - """ - - type: str | None = None - """ - The category of the detected logical issue, such as statements that are - always true or always false. - """ - - premises: list[GuardrailAutomatedReasoningStatement] | None = None - """ - The logical statements that serve as premises under which the claims are - validated. - """ - - claims: list[GuardrailAutomatedReasoningStatement] | None = None - """ - The logical statements that are validated while assuming the policy and - premises. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_LOGIC_WARNING, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_LOGIC_WARNING.members["type"], - self.type, - ) - - if self.premises is not None: - _serialize_guardrail_automated_reasoning_statement_list( - serializer, - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_LOGIC_WARNING.members["premises"], - self.premises, - ) - - if self.claims is not None: - _serialize_guardrail_automated_reasoning_statement_list( - serializer, - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_LOGIC_WARNING.members["claims"], - self.claims, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = GuardrailAutomatedReasoningLogicWarningType( - de.read_string( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_LOGIC_WARNING.members[ - "type" - ] - ) - ) - - case 1: - kwargs["premises"] = ( - _deserialize_guardrail_automated_reasoning_statement_list( - de, - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_LOGIC_WARNING.members[ - "premises" - ], - ) - ) - - case 2: - kwargs["claims"] = ( - _deserialize_guardrail_automated_reasoning_statement_list( - de, - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_LOGIC_WARNING.members[ - "claims" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_LOGIC_WARNING, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GuardrailAutomatedReasoningInputTextReference: - """ - References a portion of the original input text that corresponds to - logical elements. - """ - - text: str | None = field(repr=False, default=None) - """The specific text from the original input that this reference points to.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_INPUT_TEXT_REFERENCE, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.text is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_INPUT_TEXT_REFERENCE.members[ - "text" - ], - self.text, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["text"] = de.read_string( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_INPUT_TEXT_REFERENCE.members[ - "text" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_INPUT_TEXT_REFERENCE, - consumer=_consumer, - ) - return kwargs - - -def _serialize_guardrail_automated_reasoning_input_text_reference_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[GuardrailAutomatedReasoningInputTextReference], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_guardrail_automated_reasoning_input_text_reference_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GuardrailAutomatedReasoningInputTextReference]: - result: list[GuardrailAutomatedReasoningInputTextReference] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GuardrailAutomatedReasoningInputTextReference.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GuardrailAutomatedReasoningTranslation: - """ - Contains the logical translation of natural language input into formal - logical statements, including premises, claims, and confidence scores. - """ - - premises: list[GuardrailAutomatedReasoningStatement] | None = None - """ - The logical statements that serve as the foundation or assumptions for - the claims. - """ - - claims: list[GuardrailAutomatedReasoningStatement] | None = None - """ - The logical statements that are being validated against the premises and - policy rules. - """ - - untranslated_premises: ( - list[GuardrailAutomatedReasoningInputTextReference] | None - ) = None - """ - References to portions of the original input text that correspond to the - premises but could not be fully translated. - """ - - untranslated_claims: list[GuardrailAutomatedReasoningInputTextReference] | None = ( - None - ) - """ - References to portions of the original input text that correspond to the - claims but could not be fully translated. - """ - - confidence: float | None = None - """ - A confidence score between 0 and 1 indicating how certain the system is - about the logical translation. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_AUTOMATED_REASONING_TRANSLATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.premises is not None: - _serialize_guardrail_automated_reasoning_statement_list( - serializer, - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_TRANSLATION.members["premises"], - self.premises, - ) - - if self.claims is not None: - _serialize_guardrail_automated_reasoning_statement_list( - serializer, - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_TRANSLATION.members["claims"], - self.claims, - ) - - if self.untranslated_premises is not None: - _serialize_guardrail_automated_reasoning_input_text_reference_list( - serializer, - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_TRANSLATION.members[ - "untranslatedPremises" - ], - self.untranslated_premises, - ) - - if self.untranslated_claims is not None: - _serialize_guardrail_automated_reasoning_input_text_reference_list( - serializer, - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_TRANSLATION.members[ - "untranslatedClaims" - ], - self.untranslated_claims, - ) - - if self.confidence is not None: - serializer.write_double( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_TRANSLATION.members["confidence"], - self.confidence, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["premises"] = ( - _deserialize_guardrail_automated_reasoning_statement_list( - de, - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_TRANSLATION.members[ - "premises" - ], - ) - ) - - case 1: - kwargs["claims"] = ( - _deserialize_guardrail_automated_reasoning_statement_list( - de, - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_TRANSLATION.members[ - "claims" - ], - ) - ) - - case 2: - kwargs["untranslated_premises"] = ( - _deserialize_guardrail_automated_reasoning_input_text_reference_list( - de, - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_TRANSLATION.members[ - "untranslatedPremises" - ], - ) - ) - - case 3: - kwargs["untranslated_claims"] = ( - _deserialize_guardrail_automated_reasoning_input_text_reference_list( - de, - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_TRANSLATION.members[ - "untranslatedClaims" - ], - ) - ) - - case 4: - kwargs["confidence"] = de.read_double( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_TRANSLATION.members[ - "confidence" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_TRANSLATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GuardrailAutomatedReasoningImpossibleFinding: - """ - Indicates that no valid claims can be made due to logical contradictions - in the premises or rules. - """ - - translation: GuardrailAutomatedReasoningTranslation | None = None - """The logical translation of the input that this finding evaluates.""" - - contradicting_rules: list[GuardrailAutomatedReasoningRule] | None = None - """ - The automated reasoning policy rules that contradict the claims and/or - premises in the input. - """ - - logic_warning: GuardrailAutomatedReasoningLogicWarning | None = None - """ - Indication of a logic issue with the translation without needing to - consider the automated reasoning policy rules. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_IMPOSSIBLE_FINDING, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.translation is not None: - serializer.write_struct( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_IMPOSSIBLE_FINDING.members[ - "translation" - ], - self.translation, - ) - - if self.contradicting_rules is not None: - _serialize_guardrail_automated_reasoning_rule_list( - serializer, - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_IMPOSSIBLE_FINDING.members[ - "contradictingRules" - ], - self.contradicting_rules, - ) - - if self.logic_warning is not None: - serializer.write_struct( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_IMPOSSIBLE_FINDING.members[ - "logicWarning" - ], - self.logic_warning, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["translation"] = ( - GuardrailAutomatedReasoningTranslation.deserialize(de) - ) - - case 1: - kwargs["contradicting_rules"] = ( - _deserialize_guardrail_automated_reasoning_rule_list( - de, - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_IMPOSSIBLE_FINDING.members[ - "contradictingRules" - ], - ) - ) - - case 2: - kwargs["logic_warning"] = ( - GuardrailAutomatedReasoningLogicWarning.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_IMPOSSIBLE_FINDING, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GuardrailAutomatedReasoningInvalidFinding: - """ - Indicates that the claims are logically false and contradictory to the - established rules or premises. - """ - - translation: GuardrailAutomatedReasoningTranslation | None = None - """The logical translation of the input that this finding invalidates.""" - - contradicting_rules: list[GuardrailAutomatedReasoningRule] | None = None - """ - The automated reasoning policy rules that contradict the claims in the - input. - """ - - logic_warning: GuardrailAutomatedReasoningLogicWarning | None = None - """ - Indication of a logic issue with the translation without needing to - consider the automated reasoning policy rules. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_INVALID_FINDING, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.translation is not None: - serializer.write_struct( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_INVALID_FINDING.members[ - "translation" - ], - self.translation, - ) - - if self.contradicting_rules is not None: - _serialize_guardrail_automated_reasoning_rule_list( - serializer, - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_INVALID_FINDING.members[ - "contradictingRules" - ], - self.contradicting_rules, - ) - - if self.logic_warning is not None: - serializer.write_struct( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_INVALID_FINDING.members[ - "logicWarning" - ], - self.logic_warning, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["translation"] = ( - GuardrailAutomatedReasoningTranslation.deserialize(de) - ) - - case 1: - kwargs["contradicting_rules"] = ( - _deserialize_guardrail_automated_reasoning_rule_list( - de, - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_INVALID_FINDING.members[ - "contradictingRules" - ], - ) - ) - - case 2: - kwargs["logic_warning"] = ( - GuardrailAutomatedReasoningLogicWarning.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_INVALID_FINDING, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GuardrailAutomatedReasoningNoTranslationsFinding: - """ - Indicates that no relevant logical information could be extracted from - the input for validation. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_NO_TRANSLATIONS_FINDING, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_NO_TRANSLATIONS_FINDING, - consumer=_consumer, - ) - return kwargs - - -@dataclass(kw_only=True) -class GuardrailAutomatedReasoningScenario: - """ - Represents a logical scenario where claims can be evaluated as true or - false, containing specific logical assignments. - """ - - statements: list[GuardrailAutomatedReasoningStatement] | None = None - """List of logical assignments and statements that define this scenario.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_AUTOMATED_REASONING_SCENARIO, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.statements is not None: - _serialize_guardrail_automated_reasoning_statement_list( - serializer, - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_SCENARIO.members["statements"], - self.statements, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["statements"] = ( - _deserialize_guardrail_automated_reasoning_statement_list( - de, - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_SCENARIO.members[ - "statements" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_SCENARIO, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GuardrailAutomatedReasoningSatisfiableFinding: - """ - Indicates that the claims could be either true or false depending on - additional assumptions not provided in the input. - """ - - translation: GuardrailAutomatedReasoningTranslation | None = None - """The logical translation of the input that this finding evaluates.""" - - claims_true_scenario: GuardrailAutomatedReasoningScenario | None = None - """ - An example scenario demonstrating how the claims could be logically - true. - """ - - claims_false_scenario: GuardrailAutomatedReasoningScenario | None = None - """ - An example scenario demonstrating how the claims could be logically - false. - """ - - logic_warning: GuardrailAutomatedReasoningLogicWarning | None = None - """ - Indication of a logic issue with the translation without needing to - consider the automated reasoning policy rules. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_SATISFIABLE_FINDING, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.translation is not None: - serializer.write_struct( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_SATISFIABLE_FINDING.members[ - "translation" - ], - self.translation, - ) - - if self.claims_true_scenario is not None: - serializer.write_struct( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_SATISFIABLE_FINDING.members[ - "claimsTrueScenario" - ], - self.claims_true_scenario, - ) - - if self.claims_false_scenario is not None: - serializer.write_struct( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_SATISFIABLE_FINDING.members[ - "claimsFalseScenario" - ], - self.claims_false_scenario, - ) - - if self.logic_warning is not None: - serializer.write_struct( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_SATISFIABLE_FINDING.members[ - "logicWarning" - ], - self.logic_warning, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["translation"] = ( - GuardrailAutomatedReasoningTranslation.deserialize(de) - ) - - case 1: - kwargs["claims_true_scenario"] = ( - GuardrailAutomatedReasoningScenario.deserialize(de) - ) - - case 2: - kwargs["claims_false_scenario"] = ( - GuardrailAutomatedReasoningScenario.deserialize(de) - ) - - case 3: - kwargs["logic_warning"] = ( - GuardrailAutomatedReasoningLogicWarning.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_SATISFIABLE_FINDING, - consumer=_consumer, - ) - return kwargs - - -@dataclass(kw_only=True) -class GuardrailAutomatedReasoningTooComplexFinding: - """ - Indicates that the input exceeds the processing capacity due to the - volume or complexity of the logical information. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_TOO_COMPLEX_FINDING, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_TOO_COMPLEX_FINDING, - consumer=_consumer, - ) - return kwargs - - -def _serialize_guardrail_automated_reasoning_difference_scenario_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[GuardrailAutomatedReasoningScenario], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_guardrail_automated_reasoning_difference_scenario_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GuardrailAutomatedReasoningScenario]: - result: list[GuardrailAutomatedReasoningScenario] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GuardrailAutomatedReasoningScenario.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_guardrail_automated_reasoning_translation_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[GuardrailAutomatedReasoningTranslation], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_guardrail_automated_reasoning_translation_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GuardrailAutomatedReasoningTranslation]: - result: list[GuardrailAutomatedReasoningTranslation] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GuardrailAutomatedReasoningTranslation.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GuardrailAutomatedReasoningTranslationOption: - """ - Represents one possible logical interpretation of ambiguous input - content. - """ - - translations: list[GuardrailAutomatedReasoningTranslation] | None = None - """ - Example translations that provide this possible interpretation of the - input. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_TRANSLATION_OPTION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.translations is not None: - _serialize_guardrail_automated_reasoning_translation_list( - serializer, - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_TRANSLATION_OPTION.members[ - "translations" - ], - self.translations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["translations"] = ( - _deserialize_guardrail_automated_reasoning_translation_list( - de, - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_TRANSLATION_OPTION.members[ - "translations" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_TRANSLATION_OPTION, consumer=_consumer - ) - return kwargs - - -def _serialize_guardrail_automated_reasoning_translation_option_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[GuardrailAutomatedReasoningTranslationOption], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_guardrail_automated_reasoning_translation_option_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GuardrailAutomatedReasoningTranslationOption]: - result: list[GuardrailAutomatedReasoningTranslationOption] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GuardrailAutomatedReasoningTranslationOption.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GuardrailAutomatedReasoningTranslationAmbiguousFinding: - """ - Indicates that the input has multiple valid logical interpretations, - requiring additional context or clarification. - """ - - options: list[GuardrailAutomatedReasoningTranslationOption] | None = None - """ - Different logical interpretations that were detected during translation - of the input. - """ - - difference_scenarios: list[GuardrailAutomatedReasoningScenario] | None = None - """ - Scenarios showing how the different translation options differ in - meaning. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_TRANSLATION_AMBIGUOUS_FINDING, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.options is not None: - _serialize_guardrail_automated_reasoning_translation_option_list( - serializer, - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_TRANSLATION_AMBIGUOUS_FINDING.members[ - "options" - ], - self.options, - ) - - if self.difference_scenarios is not None: - _serialize_guardrail_automated_reasoning_difference_scenario_list( - serializer, - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_TRANSLATION_AMBIGUOUS_FINDING.members[ - "differenceScenarios" - ], - self.difference_scenarios, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["options"] = ( - _deserialize_guardrail_automated_reasoning_translation_option_list( - de, - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_TRANSLATION_AMBIGUOUS_FINDING.members[ - "options" - ], - ) - ) - - case 1: - kwargs["difference_scenarios"] = ( - _deserialize_guardrail_automated_reasoning_difference_scenario_list( - de, - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_TRANSLATION_AMBIGUOUS_FINDING.members[ - "differenceScenarios" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_TRANSLATION_AMBIGUOUS_FINDING, - consumer=_consumer, - ) - return kwargs - - -@dataclass(kw_only=True) -class GuardrailAutomatedReasoningValidFinding: - """ - Indicates that the claims are definitively true and logically implied by - the premises, with no possible alternative interpretations. - """ - - translation: GuardrailAutomatedReasoningTranslation | None = None - """The logical translation of the input that this finding validates.""" - - claims_true_scenario: GuardrailAutomatedReasoningScenario | None = None - """An example scenario demonstrating how the claims are logically true.""" - - supporting_rules: list[GuardrailAutomatedReasoningRule] | None = None - """ - The automated reasoning policy rules that support why this result is - considered valid. - """ - - logic_warning: GuardrailAutomatedReasoningLogicWarning | None = None - """ - Indication of a logic issue with the translation without needing to - consider the automated reasoning policy rules. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_VALID_FINDING, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.translation is not None: - serializer.write_struct( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_VALID_FINDING.members[ - "translation" - ], - self.translation, - ) - - if self.claims_true_scenario is not None: - serializer.write_struct( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_VALID_FINDING.members[ - "claimsTrueScenario" - ], - self.claims_true_scenario, - ) - - if self.supporting_rules is not None: - _serialize_guardrail_automated_reasoning_rule_list( - serializer, - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_VALID_FINDING.members[ - "supportingRules" - ], - self.supporting_rules, - ) - - if self.logic_warning is not None: - serializer.write_struct( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_VALID_FINDING.members[ - "logicWarning" - ], - self.logic_warning, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["translation"] = ( - GuardrailAutomatedReasoningTranslation.deserialize(de) - ) - - case 1: - kwargs["claims_true_scenario"] = ( - GuardrailAutomatedReasoningScenario.deserialize(de) - ) - - case 2: - kwargs["supporting_rules"] = ( - _deserialize_guardrail_automated_reasoning_rule_list( - de, - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_VALID_FINDING.members[ - "supportingRules" - ], - ) - ) - - case 3: - kwargs["logic_warning"] = ( - GuardrailAutomatedReasoningLogicWarning.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_VALID_FINDING, consumer=_consumer - ) - return kwargs - - -@dataclass -class GuardrailAutomatedReasoningFindingValid: - """ - Contains the result when the automated reasoning evaluation determines - that the claims in the input are logically valid and definitively true - based on the provided premises and policy rules. - """ - - value: GuardrailAutomatedReasoningValidFinding - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_AUTOMATED_REASONING_FINDING, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_FINDING.members["valid"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=GuardrailAutomatedReasoningValidFinding.deserialize(deserializer) - ) - - -@dataclass -class GuardrailAutomatedReasoningFindingInvalid: - """ - Contains the result when the automated reasoning evaluation determines - that the claims in the input are logically invalid and contradict the - established premises or policy rules. - """ - - value: GuardrailAutomatedReasoningInvalidFinding - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_AUTOMATED_REASONING_FINDING, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_FINDING.members["invalid"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=GuardrailAutomatedReasoningInvalidFinding.deserialize(deserializer) - ) - - -@dataclass -class GuardrailAutomatedReasoningFindingSatisfiable: - """ - Contains the result when the automated reasoning evaluation determines - that the claims in the input could be either true or false depending on - additional assumptions not provided in the input context. - """ - - value: GuardrailAutomatedReasoningSatisfiableFinding - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_AUTOMATED_REASONING_FINDING, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_FINDING.members["satisfiable"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=GuardrailAutomatedReasoningSatisfiableFinding.deserialize( - deserializer - ) - ) - - -@dataclass -class GuardrailAutomatedReasoningFindingImpossible: - """ - Contains the result when the automated reasoning evaluation determines - that no valid logical conclusions can be drawn due to contradictions in - the premises or policy rules themselves. - """ - - value: GuardrailAutomatedReasoningImpossibleFinding - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_AUTOMATED_REASONING_FINDING, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_FINDING.members["impossible"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=GuardrailAutomatedReasoningImpossibleFinding.deserialize(deserializer) - ) - - -@dataclass -class GuardrailAutomatedReasoningFindingTranslationAmbiguous: - """ - Contains the result when the automated reasoning evaluation detects that - the input has multiple valid logical interpretations, requiring - additional context or clarification to proceed with validation. - """ - - value: GuardrailAutomatedReasoningTranslationAmbiguousFinding - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_AUTOMATED_REASONING_FINDING, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_FINDING.members[ - "translationAmbiguous" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=GuardrailAutomatedReasoningTranslationAmbiguousFinding.deserialize( - deserializer - ) - ) - - -@dataclass -class GuardrailAutomatedReasoningFindingTooComplex: - """ - Contains the result when the automated reasoning evaluation cannot - process the input due to its complexity or volume exceeding the - system's processing capacity for logical analysis. - """ - - value: GuardrailAutomatedReasoningTooComplexFinding - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_AUTOMATED_REASONING_FINDING, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_FINDING.members["tooComplex"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=GuardrailAutomatedReasoningTooComplexFinding.deserialize(deserializer) - ) - - -@dataclass -class GuardrailAutomatedReasoningFindingNoTranslations: - """ - Contains the result when the automated reasoning evaluation cannot - extract any relevant logical information from the input that can be - validated against the policy rules. - """ - - value: GuardrailAutomatedReasoningNoTranslationsFinding - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_AUTOMATED_REASONING_FINDING, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_FINDING.members["noTranslations"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=GuardrailAutomatedReasoningNoTranslationsFinding.deserialize( - deserializer - ) - ) - - -@dataclass -class GuardrailAutomatedReasoningFindingUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -GuardrailAutomatedReasoningFinding = Union[ - GuardrailAutomatedReasoningFindingValid - | GuardrailAutomatedReasoningFindingInvalid - | GuardrailAutomatedReasoningFindingSatisfiable - | GuardrailAutomatedReasoningFindingImpossible - | GuardrailAutomatedReasoningFindingTranslationAmbiguous - | GuardrailAutomatedReasoningFindingTooComplex - | GuardrailAutomatedReasoningFindingNoTranslations - | GuardrailAutomatedReasoningFindingUnknown -] -""" -Represents a logical validation result from automated reasoning policy -evaluation. The finding indicates whether claims in the input are -logically valid, invalid, satisfiable, impossible, or have other logical -issues. -""" - - -class _GuardrailAutomatedReasoningFindingDeserializer: - _result: GuardrailAutomatedReasoningFinding | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> GuardrailAutomatedReasoningFinding: - self._result = None - deserializer.read_struct( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_FINDING, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - GuardrailAutomatedReasoningFindingValid.deserialize(de) - ) - - case 1: - self._set_result( - GuardrailAutomatedReasoningFindingInvalid.deserialize(de) - ) - - case 2: - self._set_result( - GuardrailAutomatedReasoningFindingSatisfiable.deserialize(de) - ) - - case 3: - self._set_result( - GuardrailAutomatedReasoningFindingImpossible.deserialize(de) - ) - - case 4: - self._set_result( - GuardrailAutomatedReasoningFindingTranslationAmbiguous.deserialize( - de - ) - ) - - case 5: - self._set_result( - GuardrailAutomatedReasoningFindingTooComplex.deserialize(de) - ) - - case 6: - self._set_result( - GuardrailAutomatedReasoningFindingNoTranslations.deserialize(de) - ) - - case _: - self._set_result( - GuardrailAutomatedReasoningFindingUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: GuardrailAutomatedReasoningFinding) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_guardrail_automated_reasoning_finding_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[GuardrailAutomatedReasoningFinding], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_guardrail_automated_reasoning_finding_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GuardrailAutomatedReasoningFinding]: - result: list[GuardrailAutomatedReasoningFinding] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append( - _GuardrailAutomatedReasoningFindingDeserializer().deserialize(d) - ) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GuardrailAutomatedReasoningPolicyAssessment: - """ - Contains the results of automated reasoning policy evaluation, including - logical findings about the validity of claims made in the input content. - """ - - findings: list[GuardrailAutomatedReasoningFinding] | None = None - """ - List of logical validation results produced by evaluating the input - content against automated reasoning policies. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_POLICY_ASSESSMENT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.findings is not None: - _serialize_guardrail_automated_reasoning_finding_list( - serializer, - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_POLICY_ASSESSMENT.members[ - "findings" - ], - self.findings, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["findings"] = ( - _deserialize_guardrail_automated_reasoning_finding_list( - de, - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_POLICY_ASSESSMENT.members[ - "findings" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_POLICY_ASSESSMENT, consumer=_consumer - ) - return kwargs - - -class GuardrailContentPolicyAction(UnknownEnumMixin, StrEnum): - BLOCKED = "BLOCKED" - NONE = "NONE" - - -class GuardrailContentFilterConfidence(UnknownEnumMixin, StrEnum): - NONE = "NONE" - LOW = "LOW" - MEDIUM = "MEDIUM" - HIGH = "HIGH" - - -class GuardrailContentFilterStrength(UnknownEnumMixin, StrEnum): - NONE = "NONE" - LOW = "LOW" - MEDIUM = "MEDIUM" - HIGH = "HIGH" - - -class GuardrailContentFilterType(UnknownEnumMixin, StrEnum): - INSULTS = "INSULTS" - HATE = "HATE" - SEXUAL = "SEXUAL" - VIOLENCE = "VIOLENCE" - MISCONDUCT = "MISCONDUCT" - PROMPT_ATTACK = "PROMPT_ATTACK" - - -@dataclass(kw_only=True) -class GuardrailContentFilter: - """The content filter for a guardrail.""" - - type: str - """The guardrail type.""" - - confidence: str - """The guardrail confidence.""" - - action: str - """The guardrail action.""" - - filter_strength: str | None = None - """The filter strength setting for the guardrail content filter.""" - - detected: bool | None = None - """ - Indicates whether content that breaches the guardrail configuration is - detected. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_CONTENT_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GUARDRAIL_CONTENT_FILTER.members["type"], self.type - ) - serializer.write_string( - _SCHEMA_GUARDRAIL_CONTENT_FILTER.members["confidence"], self.confidence - ) - if self.filter_strength is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_CONTENT_FILTER.members["filterStrength"], - self.filter_strength, - ) - - serializer.write_string( - _SCHEMA_GUARDRAIL_CONTENT_FILTER.members["action"], self.action - ) - if self.detected is not None: - serializer.write_boolean( - _SCHEMA_GUARDRAIL_CONTENT_FILTER.members["detected"], self.detected - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = GuardrailContentFilterType( - de.read_string(_SCHEMA_GUARDRAIL_CONTENT_FILTER.members["type"]) - ) - - case 1: - kwargs["confidence"] = GuardrailContentFilterConfidence( - de.read_string( - _SCHEMA_GUARDRAIL_CONTENT_FILTER.members["confidence"] - ) - ) - - case 2: - kwargs["filter_strength"] = GuardrailContentFilterStrength( - de.read_string( - _SCHEMA_GUARDRAIL_CONTENT_FILTER.members["filterStrength"] - ) - ) - - case 3: - kwargs["action"] = GuardrailContentPolicyAction( - de.read_string( - _SCHEMA_GUARDRAIL_CONTENT_FILTER.members["action"] - ) - ) - - case 4: - kwargs["detected"] = de.read_boolean( - _SCHEMA_GUARDRAIL_CONTENT_FILTER.members["detected"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GUARDRAIL_CONTENT_FILTER, consumer=_consumer) - if "type" not in kwargs: - kwargs["type"] = GuardrailContentFilterType._corrected("") - if "confidence" not in kwargs: - kwargs["confidence"] = GuardrailContentFilterConfidence._corrected("") - if "action" not in kwargs: - kwargs["action"] = GuardrailContentPolicyAction._corrected("") - return kwargs - - -def _serialize_guardrail_content_filter_list( - serializer: ShapeSerializer, schema: Schema, value: list[GuardrailContentFilter] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_guardrail_content_filter_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GuardrailContentFilter]: - result: list[GuardrailContentFilter] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GuardrailContentFilter.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GuardrailContentPolicyAssessment: - """An assessment of a content policy for a guardrail.""" - - filters: list[GuardrailContentFilter] - """The content policy filters.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_CONTENT_POLICY_ASSESSMENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_guardrail_content_filter_list( - serializer, - _SCHEMA_GUARDRAIL_CONTENT_POLICY_ASSESSMENT.members["filters"], - self.filters, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["filters"] = _deserialize_guardrail_content_filter_list( - de, - _SCHEMA_GUARDRAIL_CONTENT_POLICY_ASSESSMENT.members["filters"], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_CONTENT_POLICY_ASSESSMENT, consumer=_consumer - ) - if "filters" not in kwargs: - kwargs["filters"] = [] - return kwargs - - -class GuardrailContextualGroundingPolicyAction(UnknownEnumMixin, StrEnum): - BLOCKED = "BLOCKED" - NONE = "NONE" - - -class GuardrailContextualGroundingFilterType(UnknownEnumMixin, StrEnum): - GROUNDING = "GROUNDING" - RELEVANCE = "RELEVANCE" - - -@dataclass(kw_only=True) -class GuardrailContextualGroundingFilter: - """The details for the guardrails contextual grounding filter.""" - - type: str - """The contextual grounding filter type.""" - - threshold: float - """ - The threshold used by contextual grounding filter to determine whether - the content is grounded or not. - """ - - score: float - """The score generated by contextual grounding filter.""" - - action: str - """The action performed by the guardrails contextual grounding filter.""" - - detected: bool | None = None - """ - Indicates whether content that fails the contextual grounding evaluation - (grounding or relevance score less than the corresponding threshold) was - detected. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER.members["type"], self.type - ) - serializer.write_double( - _SCHEMA_GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER.members["threshold"], - self.threshold, - ) - serializer.write_double( - _SCHEMA_GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER.members["score"], self.score - ) - serializer.write_string( - _SCHEMA_GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER.members["action"], self.action - ) - if self.detected is not None: - serializer.write_boolean( - _SCHEMA_GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER.members["detected"], - self.detected, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = GuardrailContextualGroundingFilterType( - de.read_string( - _SCHEMA_GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER.members[ - "type" - ] - ) - ) - - case 1: - kwargs["threshold"] = de.read_double( - _SCHEMA_GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER.members[ - "threshold" - ] - ) - - case 2: - kwargs["score"] = de.read_double( - _SCHEMA_GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER.members["score"] - ) - - case 3: - kwargs["action"] = GuardrailContextualGroundingPolicyAction( - de.read_string( - _SCHEMA_GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER.members[ - "action" - ] - ) - ) - - case 4: - kwargs["detected"] = de.read_boolean( - _SCHEMA_GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER.members[ - "detected" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER, consumer=_consumer - ) - if "type" not in kwargs: - kwargs["type"] = GuardrailContextualGroundingFilterType._corrected("") - if "threshold" not in kwargs: - kwargs["threshold"] = 0.0 - if "score" not in kwargs: - kwargs["score"] = 0.0 - if "action" not in kwargs: - kwargs["action"] = GuardrailContextualGroundingPolicyAction._corrected("") - return kwargs - - -def _serialize_guardrail_contextual_grounding_filters( - serializer: ShapeSerializer, - schema: Schema, - value: list[GuardrailContextualGroundingFilter], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_guardrail_contextual_grounding_filters( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GuardrailContextualGroundingFilter]: - result: list[GuardrailContextualGroundingFilter] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GuardrailContextualGroundingFilter.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GuardrailContextualGroundingPolicyAssessment: - """ - The policy assessment details for the guardrails contextual grounding - filter. - """ - - filters: list[GuardrailContextualGroundingFilter] | None = None - """The filter details for the guardrails contextual grounding filter.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GUARDRAIL_CONTEXTUAL_GROUNDING_POLICY_ASSESSMENT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.filters is not None: - _serialize_guardrail_contextual_grounding_filters( - serializer, - _SCHEMA_GUARDRAIL_CONTEXTUAL_GROUNDING_POLICY_ASSESSMENT.members[ - "filters" - ], - self.filters, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["filters"] = ( - _deserialize_guardrail_contextual_grounding_filters( - de, - _SCHEMA_GUARDRAIL_CONTEXTUAL_GROUNDING_POLICY_ASSESSMENT.members[ - "filters" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_CONTEXTUAL_GROUNDING_POLICY_ASSESSMENT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GuardrailImageCoverage: - """The details of the guardrail image coverage.""" - - guarded: int | None = None - """The count (integer) of images guardrails guarded.""" - - total: int | None = None - """ - Represents the total number of images (integer) that were in the request - (guarded and unguarded). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_IMAGE_COVERAGE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.guarded is not None: - serializer.write_integer( - _SCHEMA_GUARDRAIL_IMAGE_COVERAGE.members["guarded"], self.guarded - ) - - if self.total is not None: - serializer.write_integer( - _SCHEMA_GUARDRAIL_IMAGE_COVERAGE.members["total"], self.total - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["guarded"] = de.read_integer( - _SCHEMA_GUARDRAIL_IMAGE_COVERAGE.members["guarded"] - ) - - case 1: - kwargs["total"] = de.read_integer( - _SCHEMA_GUARDRAIL_IMAGE_COVERAGE.members["total"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GUARDRAIL_IMAGE_COVERAGE, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GuardrailTextCharactersCoverage: - """The guardrail coverage for the text characters.""" - - guarded: int | None = None - """The text characters that were guarded by the guardrail coverage.""" - - total: int | None = None - """The total text characters by the guardrail coverage.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_TEXT_CHARACTERS_COVERAGE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.guarded is not None: - serializer.write_integer( - _SCHEMA_GUARDRAIL_TEXT_CHARACTERS_COVERAGE.members["guarded"], - self.guarded, - ) - - if self.total is not None: - serializer.write_integer( - _SCHEMA_GUARDRAIL_TEXT_CHARACTERS_COVERAGE.members["total"], self.total - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["guarded"] = de.read_integer( - _SCHEMA_GUARDRAIL_TEXT_CHARACTERS_COVERAGE.members["guarded"] - ) - - case 1: - kwargs["total"] = de.read_integer( - _SCHEMA_GUARDRAIL_TEXT_CHARACTERS_COVERAGE.members["total"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_TEXT_CHARACTERS_COVERAGE, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GuardrailCoverage: - """The action of the guardrail coverage details.""" - - text_characters: GuardrailTextCharactersCoverage | None = None - """The text characters of the guardrail coverage details.""" - - images: GuardrailImageCoverage | None = None - """ - The guardrail coverage for images (the number of images that guardrails - guarded). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_COVERAGE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.text_characters is not None: - serializer.write_struct( - _SCHEMA_GUARDRAIL_COVERAGE.members["textCharacters"], - self.text_characters, - ) - - if self.images is not None: - serializer.write_struct( - _SCHEMA_GUARDRAIL_COVERAGE.members["images"], self.images - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["text_characters"] = ( - GuardrailTextCharactersCoverage.deserialize(de) - ) - - case 1: - kwargs["images"] = GuardrailImageCoverage.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GUARDRAIL_COVERAGE, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GuardrailUsage: - """The details on the use of the guardrail.""" - - topic_policy_units: int - """The topic policy units processed by the guardrail.""" - - content_policy_units: int - """The content policy units processed by the guardrail.""" - - word_policy_units: int - """The word policy units processed by the guardrail.""" - - sensitive_information_policy_units: int - """The sensitive information policy units processed by the guardrail.""" - - sensitive_information_policy_free_units: int - """The sensitive information policy free units processed by the guardrail.""" - - contextual_grounding_policy_units: int - """The contextual grounding policy units processed by the guardrail.""" - - content_policy_image_units: int | None = None - """The content policy image units processed by the guardrail.""" - - automated_reasoning_policy_units: int | None = None - """The number of text units processed by the automated reasoning policy.""" - - automated_reasoning_policies: int | None = None - """ - The number of automated reasoning policies that were processed during - the guardrail evaluation. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_USAGE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer( - _SCHEMA_GUARDRAIL_USAGE.members["topicPolicyUnits"], self.topic_policy_units - ) - serializer.write_integer( - _SCHEMA_GUARDRAIL_USAGE.members["contentPolicyUnits"], - self.content_policy_units, - ) - serializer.write_integer( - _SCHEMA_GUARDRAIL_USAGE.members["wordPolicyUnits"], self.word_policy_units - ) - serializer.write_integer( - _SCHEMA_GUARDRAIL_USAGE.members["sensitiveInformationPolicyUnits"], - self.sensitive_information_policy_units, - ) - serializer.write_integer( - _SCHEMA_GUARDRAIL_USAGE.members["sensitiveInformationPolicyFreeUnits"], - self.sensitive_information_policy_free_units, - ) - serializer.write_integer( - _SCHEMA_GUARDRAIL_USAGE.members["contextualGroundingPolicyUnits"], - self.contextual_grounding_policy_units, - ) - if self.content_policy_image_units is not None: - serializer.write_integer( - _SCHEMA_GUARDRAIL_USAGE.members["contentPolicyImageUnits"], - self.content_policy_image_units, - ) - - if self.automated_reasoning_policy_units is not None: - serializer.write_integer( - _SCHEMA_GUARDRAIL_USAGE.members["automatedReasoningPolicyUnits"], - self.automated_reasoning_policy_units, - ) - - if self.automated_reasoning_policies is not None: - serializer.write_integer( - _SCHEMA_GUARDRAIL_USAGE.members["automatedReasoningPolicies"], - self.automated_reasoning_policies, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["topic_policy_units"] = de.read_integer( - _SCHEMA_GUARDRAIL_USAGE.members["topicPolicyUnits"] - ) - - case 1: - kwargs["content_policy_units"] = de.read_integer( - _SCHEMA_GUARDRAIL_USAGE.members["contentPolicyUnits"] - ) - - case 2: - kwargs["word_policy_units"] = de.read_integer( - _SCHEMA_GUARDRAIL_USAGE.members["wordPolicyUnits"] - ) - - case 3: - kwargs["sensitive_information_policy_units"] = de.read_integer( - _SCHEMA_GUARDRAIL_USAGE.members[ - "sensitiveInformationPolicyUnits" - ] - ) - - case 4: - kwargs["sensitive_information_policy_free_units"] = de.read_integer( - _SCHEMA_GUARDRAIL_USAGE.members[ - "sensitiveInformationPolicyFreeUnits" - ] - ) - - case 5: - kwargs["contextual_grounding_policy_units"] = de.read_integer( - _SCHEMA_GUARDRAIL_USAGE.members[ - "contextualGroundingPolicyUnits" - ] - ) - - case 6: - kwargs["content_policy_image_units"] = de.read_integer( - _SCHEMA_GUARDRAIL_USAGE.members["contentPolicyImageUnits"] - ) - - case 7: - kwargs["automated_reasoning_policy_units"] = de.read_integer( - _SCHEMA_GUARDRAIL_USAGE.members["automatedReasoningPolicyUnits"] - ) - - case 8: - kwargs["automated_reasoning_policies"] = de.read_integer( - _SCHEMA_GUARDRAIL_USAGE.members["automatedReasoningPolicies"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GUARDRAIL_USAGE, consumer=_consumer) - if "topic_policy_units" not in kwargs: - kwargs["topic_policy_units"] = 0 - if "content_policy_units" not in kwargs: - kwargs["content_policy_units"] = 0 - if "word_policy_units" not in kwargs: - kwargs["word_policy_units"] = 0 - if "sensitive_information_policy_units" not in kwargs: - kwargs["sensitive_information_policy_units"] = 0 - if "sensitive_information_policy_free_units" not in kwargs: - kwargs["sensitive_information_policy_free_units"] = 0 - if "contextual_grounding_policy_units" not in kwargs: - kwargs["contextual_grounding_policy_units"] = 0 - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls( - topic_policy_units=0, - content_policy_units=0, - word_policy_units=0, - sensitive_information_policy_units=0, - sensitive_information_policy_free_units=0, - contextual_grounding_policy_units=0, - ) - - -@dataclass(kw_only=True) -class GuardrailInvocationMetrics: - """The invocation metrics for the guardrail.""" - - guardrail_processing_latency: int | None = None - """The processing latency details for the guardrail invocation metrics.""" - - usage: GuardrailUsage | None = None - """The usage details for the guardrail invocation metrics.""" - - guardrail_coverage: GuardrailCoverage | None = None - """The coverage details for the guardrail invocation metrics.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_INVOCATION_METRICS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.guardrail_processing_latency is not None: - serializer.write_long( - _SCHEMA_GUARDRAIL_INVOCATION_METRICS.members[ - "guardrailProcessingLatency" - ], - self.guardrail_processing_latency, - ) - - if self.usage is not None: - serializer.write_struct( - _SCHEMA_GUARDRAIL_INVOCATION_METRICS.members["usage"], self.usage - ) - - if self.guardrail_coverage is not None: - serializer.write_struct( - _SCHEMA_GUARDRAIL_INVOCATION_METRICS.members["guardrailCoverage"], - self.guardrail_coverage, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["guardrail_processing_latency"] = de.read_long( - _SCHEMA_GUARDRAIL_INVOCATION_METRICS.members[ - "guardrailProcessingLatency" - ] - ) - - case 1: - kwargs["usage"] = GuardrailUsage.deserialize(de) - - case 2: - kwargs["guardrail_coverage"] = GuardrailCoverage.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_INVOCATION_METRICS, consumer=_consumer - ) - return kwargs - - -class GuardrailSensitiveInformationPolicyAction(UnknownEnumMixin, StrEnum): - ANONYMIZED = "ANONYMIZED" - BLOCKED = "BLOCKED" - NONE = "NONE" - - -class GuardrailPiiEntityType(UnknownEnumMixin, StrEnum): - ADDRESS = "ADDRESS" - AGE = "AGE" - AWS_ACCESS_KEY = "AWS_ACCESS_KEY" - AWS_SECRET_KEY = "AWS_SECRET_KEY" - CA_HEALTH_NUMBER = "CA_HEALTH_NUMBER" - CA_SOCIAL_INSURANCE_NUMBER = "CA_SOCIAL_INSURANCE_NUMBER" - CREDIT_DEBIT_CARD_CVV = "CREDIT_DEBIT_CARD_CVV" - CREDIT_DEBIT_CARD_EXPIRY = "CREDIT_DEBIT_CARD_EXPIRY" - CREDIT_DEBIT_CARD_NUMBER = "CREDIT_DEBIT_CARD_NUMBER" - DRIVER_ID = "DRIVER_ID" - EMAIL = "EMAIL" - INTERNATIONAL_BANK_ACCOUNT_NUMBER = "INTERNATIONAL_BANK_ACCOUNT_NUMBER" - IP_ADDRESS = "IP_ADDRESS" - LICENSE_PLATE = "LICENSE_PLATE" - MAC_ADDRESS = "MAC_ADDRESS" - NAME = "NAME" - PASSWORD = "PASSWORD" - PHONE = "PHONE" - PIN = "PIN" - SWIFT_CODE = "SWIFT_CODE" - UK_NATIONAL_HEALTH_SERVICE_NUMBER = "UK_NATIONAL_HEALTH_SERVICE_NUMBER" - UK_NATIONAL_INSURANCE_NUMBER = "UK_NATIONAL_INSURANCE_NUMBER" - UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER = "UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER" - URL = "URL" - USERNAME = "USERNAME" - US_BANK_ACCOUNT_NUMBER = "US_BANK_ACCOUNT_NUMBER" - US_BANK_ROUTING_NUMBER = "US_BANK_ROUTING_NUMBER" - US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER = "US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER" - US_PASSPORT_NUMBER = "US_PASSPORT_NUMBER" - US_SOCIAL_SECURITY_NUMBER = "US_SOCIAL_SECURITY_NUMBER" - VEHICLE_IDENTIFICATION_NUMBER = "VEHICLE_IDENTIFICATION_NUMBER" - - -@dataclass(kw_only=True) -class GuardrailPiiEntityFilter: - """ - A Personally Identifiable Information (PII) entity configured in a - guardrail. - """ - - match: str - """The PII entity filter match.""" - - type: str - """The PII entity filter type.""" - - action: str - """The PII entity filter action.""" - - detected: bool | None = None - """ - Indicates whether personally identifiable information (PII) that - breaches the guardrail configuration is detected. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_PII_ENTITY_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GUARDRAIL_PII_ENTITY_FILTER.members["match"], self.match - ) - serializer.write_string( - _SCHEMA_GUARDRAIL_PII_ENTITY_FILTER.members["type"], self.type - ) - serializer.write_string( - _SCHEMA_GUARDRAIL_PII_ENTITY_FILTER.members["action"], self.action - ) - if self.detected is not None: - serializer.write_boolean( - _SCHEMA_GUARDRAIL_PII_ENTITY_FILTER.members["detected"], self.detected - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["match"] = de.read_string( - _SCHEMA_GUARDRAIL_PII_ENTITY_FILTER.members["match"] - ) - - case 1: - kwargs["type"] = GuardrailPiiEntityType( - de.read_string( - _SCHEMA_GUARDRAIL_PII_ENTITY_FILTER.members["type"] - ) - ) - - case 2: - kwargs["action"] = GuardrailSensitiveInformationPolicyAction( - de.read_string( - _SCHEMA_GUARDRAIL_PII_ENTITY_FILTER.members["action"] - ) - ) - - case 3: - kwargs["detected"] = de.read_boolean( - _SCHEMA_GUARDRAIL_PII_ENTITY_FILTER.members["detected"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_PII_ENTITY_FILTER, consumer=_consumer - ) - if "match" not in kwargs: - kwargs["match"] = "" - if "type" not in kwargs: - kwargs["type"] = GuardrailPiiEntityType._corrected("") - if "action" not in kwargs: - kwargs["action"] = GuardrailSensitiveInformationPolicyAction._corrected("") - return kwargs - - -def _serialize_guardrail_pii_entity_filter_list( - serializer: ShapeSerializer, schema: Schema, value: list[GuardrailPiiEntityFilter] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_guardrail_pii_entity_filter_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GuardrailPiiEntityFilter]: - result: list[GuardrailPiiEntityFilter] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GuardrailPiiEntityFilter.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GuardrailRegexFilter: - """A Regex filter configured in a guardrail.""" - - action: str - """The region filter action.""" - - name: str | None = None - """The regex filter name.""" - - match: str | None = None - """The regesx filter match.""" - - regex: str | None = None - """The regex query.""" - - detected: bool | None = None - """ - Indicates whether custom regex entities that breach the guardrail - configuration are detected. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_REGEX_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_REGEX_FILTER.members["name"], self.name - ) - - if self.match is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_REGEX_FILTER.members["match"], self.match - ) - - if self.regex is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_REGEX_FILTER.members["regex"], self.regex - ) - - serializer.write_string( - _SCHEMA_GUARDRAIL_REGEX_FILTER.members["action"], self.action - ) - if self.detected is not None: - serializer.write_boolean( - _SCHEMA_GUARDRAIL_REGEX_FILTER.members["detected"], self.detected - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_GUARDRAIL_REGEX_FILTER.members["name"] - ) - - case 1: - kwargs["match"] = de.read_string( - _SCHEMA_GUARDRAIL_REGEX_FILTER.members["match"] - ) - - case 2: - kwargs["regex"] = de.read_string( - _SCHEMA_GUARDRAIL_REGEX_FILTER.members["regex"] - ) - - case 3: - kwargs["action"] = GuardrailSensitiveInformationPolicyAction( - de.read_string(_SCHEMA_GUARDRAIL_REGEX_FILTER.members["action"]) - ) - - case 4: - kwargs["detected"] = de.read_boolean( - _SCHEMA_GUARDRAIL_REGEX_FILTER.members["detected"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GUARDRAIL_REGEX_FILTER, consumer=_consumer) - if "action" not in kwargs: - kwargs["action"] = GuardrailSensitiveInformationPolicyAction._corrected("") - return kwargs - - -def _serialize_guardrail_regex_filter_list( - serializer: ShapeSerializer, schema: Schema, value: list[GuardrailRegexFilter] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_guardrail_regex_filter_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GuardrailRegexFilter]: - result: list[GuardrailRegexFilter] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GuardrailRegexFilter.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GuardrailSensitiveInformationPolicyAssessment: - """The assessment for a Personally Identifiable Information (PII) policy.""" - - pii_entities: list[GuardrailPiiEntityFilter] - """The PII entities in the assessment.""" - - regexes: list[GuardrailRegexFilter] - """The regex queries in the assessment.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GUARDRAIL_SENSITIVE_INFORMATION_POLICY_ASSESSMENT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_guardrail_pii_entity_filter_list( - serializer, - _SCHEMA_GUARDRAIL_SENSITIVE_INFORMATION_POLICY_ASSESSMENT.members[ - "piiEntities" - ], - self.pii_entities, - ) - _serialize_guardrail_regex_filter_list( - serializer, - _SCHEMA_GUARDRAIL_SENSITIVE_INFORMATION_POLICY_ASSESSMENT.members[ - "regexes" - ], - self.regexes, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["pii_entities"] = ( - _deserialize_guardrail_pii_entity_filter_list( - de, - _SCHEMA_GUARDRAIL_SENSITIVE_INFORMATION_POLICY_ASSESSMENT.members[ - "piiEntities" - ], - ) - ) - - case 1: - kwargs["regexes"] = _deserialize_guardrail_regex_filter_list( - de, - _SCHEMA_GUARDRAIL_SENSITIVE_INFORMATION_POLICY_ASSESSMENT.members[ - "regexes" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_SENSITIVE_INFORMATION_POLICY_ASSESSMENT, - consumer=_consumer, - ) - if "pii_entities" not in kwargs: - kwargs["pii_entities"] = [] - if "regexes" not in kwargs: - kwargs["regexes"] = [] - return kwargs - - -class GuardrailTopicPolicyAction(UnknownEnumMixin, StrEnum): - BLOCKED = "BLOCKED" - NONE = "NONE" - - -class GuardrailTopicType(UnknownEnumMixin, StrEnum): - DENY = "DENY" - - -@dataclass(kw_only=True) -class GuardrailTopic: - """Information about a topic guardrail.""" - - name: str - """The name for the guardrail.""" - - type: str - """ - The type behavior that the guardrail should perform when the model - detects the topic. - """ - - action: str - """The action the guardrail should take when it intervenes on a topic.""" - - detected: bool | None = None - """ - Indicates whether topic content that breaches the guardrail - configuration is detected. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_TOPIC, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_GUARDRAIL_TOPIC.members["name"], self.name) - serializer.write_string(_SCHEMA_GUARDRAIL_TOPIC.members["type"], self.type) - serializer.write_string(_SCHEMA_GUARDRAIL_TOPIC.members["action"], self.action) - if self.detected is not None: - serializer.write_boolean( - _SCHEMA_GUARDRAIL_TOPIC.members["detected"], self.detected - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_GUARDRAIL_TOPIC.members["name"] - ) - - case 1: - kwargs["type"] = GuardrailTopicType( - de.read_string(_SCHEMA_GUARDRAIL_TOPIC.members["type"]) - ) - - case 2: - kwargs["action"] = GuardrailTopicPolicyAction( - de.read_string(_SCHEMA_GUARDRAIL_TOPIC.members["action"]) - ) - - case 3: - kwargs["detected"] = de.read_boolean( - _SCHEMA_GUARDRAIL_TOPIC.members["detected"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GUARDRAIL_TOPIC, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "type" not in kwargs: - kwargs["type"] = GuardrailTopicType._corrected("") - if "action" not in kwargs: - kwargs["action"] = GuardrailTopicPolicyAction._corrected("") - return kwargs - - -def _serialize_guardrail_topic_list( - serializer: ShapeSerializer, schema: Schema, value: list[GuardrailTopic] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_guardrail_topic_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GuardrailTopic]: - result: list[GuardrailTopic] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GuardrailTopic.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GuardrailTopicPolicyAssessment: - """A behavior assessment of a topic policy.""" - - topics: list[GuardrailTopic] - """The topics in the assessment.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_TOPIC_POLICY_ASSESSMENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_guardrail_topic_list( - serializer, - _SCHEMA_GUARDRAIL_TOPIC_POLICY_ASSESSMENT.members["topics"], - self.topics, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["topics"] = _deserialize_guardrail_topic_list( - de, _SCHEMA_GUARDRAIL_TOPIC_POLICY_ASSESSMENT.members["topics"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_TOPIC_POLICY_ASSESSMENT, consumer=_consumer - ) - if "topics" not in kwargs: - kwargs["topics"] = [] - return kwargs - - -class GuardrailWordPolicyAction(UnknownEnumMixin, StrEnum): - BLOCKED = "BLOCKED" - NONE = "NONE" - - -@dataclass(kw_only=True) -class GuardrailCustomWord: - """A custom word configured in a guardrail.""" - - match: str - """The match for the custom word.""" - - action: str - """The action for the custom word.""" - - detected: bool | None = None - """ - Indicates whether custom word content that breaches the guardrail - configuration is detected. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_CUSTOM_WORD, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GUARDRAIL_CUSTOM_WORD.members["match"], self.match - ) - serializer.write_string( - _SCHEMA_GUARDRAIL_CUSTOM_WORD.members["action"], self.action - ) - if self.detected is not None: - serializer.write_boolean( - _SCHEMA_GUARDRAIL_CUSTOM_WORD.members["detected"], self.detected - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["match"] = de.read_string( - _SCHEMA_GUARDRAIL_CUSTOM_WORD.members["match"] - ) - - case 1: - kwargs["action"] = GuardrailWordPolicyAction( - de.read_string(_SCHEMA_GUARDRAIL_CUSTOM_WORD.members["action"]) - ) - - case 2: - kwargs["detected"] = de.read_boolean( - _SCHEMA_GUARDRAIL_CUSTOM_WORD.members["detected"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GUARDRAIL_CUSTOM_WORD, consumer=_consumer) - if "match" not in kwargs: - kwargs["match"] = "" - if "action" not in kwargs: - kwargs["action"] = GuardrailWordPolicyAction._corrected("") - return kwargs - - -def _serialize_guardrail_custom_word_list( - serializer: ShapeSerializer, schema: Schema, value: list[GuardrailCustomWord] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_guardrail_custom_word_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GuardrailCustomWord]: - result: list[GuardrailCustomWord] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GuardrailCustomWord.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class GuardrailManagedWordType(UnknownEnumMixin, StrEnum): - PROFANITY = "PROFANITY" - - -@dataclass(kw_only=True) -class GuardrailManagedWord: - """A managed word configured in a guardrail.""" - - match: str - """The match for the managed word.""" - - type: str - """The type for the managed word.""" - - action: str - """The action for the managed word.""" - - detected: bool | None = None - """ - Indicates whether managed word content that breaches the guardrail - configuration is detected. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_MANAGED_WORD, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GUARDRAIL_MANAGED_WORD.members["match"], self.match - ) - serializer.write_string( - _SCHEMA_GUARDRAIL_MANAGED_WORD.members["type"], self.type - ) - serializer.write_string( - _SCHEMA_GUARDRAIL_MANAGED_WORD.members["action"], self.action - ) - if self.detected is not None: - serializer.write_boolean( - _SCHEMA_GUARDRAIL_MANAGED_WORD.members["detected"], self.detected - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["match"] = de.read_string( - _SCHEMA_GUARDRAIL_MANAGED_WORD.members["match"] - ) - - case 1: - kwargs["type"] = GuardrailManagedWordType( - de.read_string(_SCHEMA_GUARDRAIL_MANAGED_WORD.members["type"]) - ) - - case 2: - kwargs["action"] = GuardrailWordPolicyAction( - de.read_string(_SCHEMA_GUARDRAIL_MANAGED_WORD.members["action"]) - ) - - case 3: - kwargs["detected"] = de.read_boolean( - _SCHEMA_GUARDRAIL_MANAGED_WORD.members["detected"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GUARDRAIL_MANAGED_WORD, consumer=_consumer) - if "match" not in kwargs: - kwargs["match"] = "" - if "type" not in kwargs: - kwargs["type"] = GuardrailManagedWordType._corrected("") - if "action" not in kwargs: - kwargs["action"] = GuardrailWordPolicyAction._corrected("") - return kwargs - - -def _serialize_guardrail_managed_word_list( - serializer: ShapeSerializer, schema: Schema, value: list[GuardrailManagedWord] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_guardrail_managed_word_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GuardrailManagedWord]: - result: list[GuardrailManagedWord] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GuardrailManagedWord.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GuardrailWordPolicyAssessment: - """The word policy assessment.""" - - custom_words: list[GuardrailCustomWord] - """Custom words in the assessment.""" - - managed_word_lists: list[GuardrailManagedWord] - """Managed word lists in the assessment.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_WORD_POLICY_ASSESSMENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_guardrail_custom_word_list( - serializer, - _SCHEMA_GUARDRAIL_WORD_POLICY_ASSESSMENT.members["customWords"], - self.custom_words, - ) - _serialize_guardrail_managed_word_list( - serializer, - _SCHEMA_GUARDRAIL_WORD_POLICY_ASSESSMENT.members["managedWordLists"], - self.managed_word_lists, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["custom_words"] = _deserialize_guardrail_custom_word_list( - de, - _SCHEMA_GUARDRAIL_WORD_POLICY_ASSESSMENT.members["customWords"], - ) - - case 1: - kwargs["managed_word_lists"] = ( - _deserialize_guardrail_managed_word_list( - de, - _SCHEMA_GUARDRAIL_WORD_POLICY_ASSESSMENT.members[ - "managedWordLists" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_WORD_POLICY_ASSESSMENT, consumer=_consumer - ) - if "custom_words" not in kwargs: - kwargs["custom_words"] = [] - if "managed_word_lists" not in kwargs: - kwargs["managed_word_lists"] = [] - return kwargs - - -@dataclass(kw_only=True) -class GuardrailAssessment: - """ - A behavior assessment of the guardrail policies used in a call to the - Converse API. - """ - - topic_policy: GuardrailTopicPolicyAssessment | None = None - """The topic policy.""" - - content_policy: GuardrailContentPolicyAssessment | None = None - """The content policy.""" - - word_policy: GuardrailWordPolicyAssessment | None = None - """The word policy.""" - - sensitive_information_policy: ( - GuardrailSensitiveInformationPolicyAssessment | None - ) = None - """The sensitive information policy.""" - - contextual_grounding_policy: GuardrailContextualGroundingPolicyAssessment | None = ( - None - ) - """The contextual grounding policy used for the guardrail assessment.""" - - automated_reasoning_policy: GuardrailAutomatedReasoningPolicyAssessment | None = ( - None - ) - """ - The automated reasoning policy assessment results, including logical - validation findings for the input content. - """ - - invocation_metrics: GuardrailInvocationMetrics | None = None - """The invocation metrics for the guardrail assessment.""" - - applied_guardrail_details: AppliedGuardrailDetails | None = None - """ - Details about the specific guardrail that was applied during this - assessment, including its identifier, version, ARN, origin, and - ownership information. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_ASSESSMENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.topic_policy is not None: - serializer.write_struct( - _SCHEMA_GUARDRAIL_ASSESSMENT.members["topicPolicy"], self.topic_policy - ) - - if self.content_policy is not None: - serializer.write_struct( - _SCHEMA_GUARDRAIL_ASSESSMENT.members["contentPolicy"], - self.content_policy, - ) - - if self.word_policy is not None: - serializer.write_struct( - _SCHEMA_GUARDRAIL_ASSESSMENT.members["wordPolicy"], self.word_policy - ) - - if self.sensitive_information_policy is not None: - serializer.write_struct( - _SCHEMA_GUARDRAIL_ASSESSMENT.members["sensitiveInformationPolicy"], - self.sensitive_information_policy, - ) - - if self.contextual_grounding_policy is not None: - serializer.write_struct( - _SCHEMA_GUARDRAIL_ASSESSMENT.members["contextualGroundingPolicy"], - self.contextual_grounding_policy, - ) - - if self.automated_reasoning_policy is not None: - serializer.write_struct( - _SCHEMA_GUARDRAIL_ASSESSMENT.members["automatedReasoningPolicy"], - self.automated_reasoning_policy, - ) - - if self.invocation_metrics is not None: - serializer.write_struct( - _SCHEMA_GUARDRAIL_ASSESSMENT.members["invocationMetrics"], - self.invocation_metrics, - ) - - if self.applied_guardrail_details is not None: - serializer.write_struct( - _SCHEMA_GUARDRAIL_ASSESSMENT.members["appliedGuardrailDetails"], - self.applied_guardrail_details, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["topic_policy"] = GuardrailTopicPolicyAssessment.deserialize( - de - ) - - case 1: - kwargs["content_policy"] = ( - GuardrailContentPolicyAssessment.deserialize(de) - ) - - case 2: - kwargs["word_policy"] = GuardrailWordPolicyAssessment.deserialize( - de - ) - - case 3: - kwargs["sensitive_information_policy"] = ( - GuardrailSensitiveInformationPolicyAssessment.deserialize(de) - ) - - case 4: - kwargs["contextual_grounding_policy"] = ( - GuardrailContextualGroundingPolicyAssessment.deserialize(de) - ) - - case 5: - kwargs["automated_reasoning_policy"] = ( - GuardrailAutomatedReasoningPolicyAssessment.deserialize(de) - ) - - case 6: - kwargs["invocation_metrics"] = ( - GuardrailInvocationMetrics.deserialize(de) - ) - - case 7: - kwargs["applied_guardrail_details"] = ( - AppliedGuardrailDetails.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GUARDRAIL_ASSESSMENT, consumer=_consumer) - return kwargs - - -def _serialize_guardrail_assessment_list( - serializer: ShapeSerializer, schema: Schema, value: list[GuardrailAssessment] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_guardrail_assessment_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GuardrailAssessment]: - result: list[GuardrailAssessment] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GuardrailAssessment.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GuardrailOutputContent: - """The output content produced by the guardrail.""" - - text: str | None = None - """The specific text for the output content produced by the guardrail.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_OUTPUT_CONTENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.text is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_OUTPUT_CONTENT.members["text"], self.text - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["text"] = de.read_string( - _SCHEMA_GUARDRAIL_OUTPUT_CONTENT.members["text"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GUARDRAIL_OUTPUT_CONTENT, consumer=_consumer) - return kwargs - - -def _serialize_guardrail_output_content_list( - serializer: ShapeSerializer, schema: Schema, value: list[GuardrailOutputContent] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_guardrail_output_content_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GuardrailOutputContent]: - result: list[GuardrailOutputContent] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GuardrailOutputContent.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ApplyGuardrailOutput: - """Dataclass for ApplyGuardrailOutput structure.""" - - usage: GuardrailUsage - """The usage details in the response from the guardrail.""" - - action: str - """The action taken in the response from the guardrail.""" - - outputs: list[GuardrailOutputContent] - """The output details in the response from the guardrail.""" - - assessments: list[GuardrailAssessment] - """The assessment details in the response from the guardrail.""" - - action_reason: str | None = None - """The reason for the action taken when harmful content is detected.""" - - guardrail_coverage: GuardrailCoverage | None = None - """The guardrail coverage details in the apply guardrail response.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_APPLY_GUARDRAIL_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_APPLY_GUARDRAIL_OUTPUT.members["usage"], self.usage - ) - serializer.write_string( - _SCHEMA_APPLY_GUARDRAIL_OUTPUT.members["action"], self.action - ) - if self.action_reason is not None: - serializer.write_string( - _SCHEMA_APPLY_GUARDRAIL_OUTPUT.members["actionReason"], - self.action_reason, - ) - - _serialize_guardrail_output_content_list( - serializer, _SCHEMA_APPLY_GUARDRAIL_OUTPUT.members["outputs"], self.outputs - ) - _serialize_guardrail_assessment_list( - serializer, - _SCHEMA_APPLY_GUARDRAIL_OUTPUT.members["assessments"], - self.assessments, - ) - if self.guardrail_coverage is not None: - serializer.write_struct( - _SCHEMA_APPLY_GUARDRAIL_OUTPUT.members["guardrailCoverage"], - self.guardrail_coverage, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["usage"] = GuardrailUsage.deserialize(de) - - case 1: - kwargs["action"] = GuardrailAction( - de.read_string(_SCHEMA_APPLY_GUARDRAIL_OUTPUT.members["action"]) - ) - - case 2: - kwargs["action_reason"] = de.read_string( - _SCHEMA_APPLY_GUARDRAIL_OUTPUT.members["actionReason"] - ) - - case 3: - kwargs["outputs"] = _deserialize_guardrail_output_content_list( - de, _SCHEMA_APPLY_GUARDRAIL_OUTPUT.members["outputs"] - ) - - case 4: - kwargs["assessments"] = _deserialize_guardrail_assessment_list( - de, _SCHEMA_APPLY_GUARDRAIL_OUTPUT.members["assessments"] - ) - - case 5: - kwargs["guardrail_coverage"] = GuardrailCoverage.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_APPLY_GUARDRAIL_OUTPUT, consumer=_consumer) - if "usage" not in kwargs: - kwargs["usage"] = GuardrailUsage._smithy_default() - if "action" not in kwargs: - kwargs["action"] = GuardrailAction._corrected("") - if "outputs" not in kwargs: - kwargs["outputs"] = [] - if "assessments" not in kwargs: - kwargs["assessments"] = [] - return kwargs - - -APPLY_GUARDRAIL = APIOperation( - input=ApplyGuardrailInput, - output=ApplyGuardrailOutput, - schema=_SCHEMA_APPLY_GUARDRAIL, - input_schema=_SCHEMA_APPLY_GUARDRAIL_INPUT, - output_schema=_SCHEMA_APPLY_GUARDRAIL_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockruntime#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockruntime#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockruntime#ServiceUnavailableException" - ): ServiceUnavailableException, - ShapeID( - "com.amazonaws.bedrockruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockruntime#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_SERVICE_UNAVAILABLE_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class GuardrailChecksContentFilterCategory(UnknownEnumMixin, StrEnum): - """The category for content filter evaluation.""" - - VIOLENCE = "VIOLENCE" - HATE = "HATE" - SEXUAL = "SEXUAL" - MISCONDUCT = "MISCONDUCT" - INSULTS = "INSULTS" - - -@dataclass(kw_only=True) -class GuardrailChecksContentFilterCategoryConfig: - """The configuration for a single content filter category to evaluate.""" - - category: str - """The content filter category to evaluate.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GUARDRAIL_CHECKS_CONTENT_FILTER_CATEGORY_CONFIG, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GUARDRAIL_CHECKS_CONTENT_FILTER_CATEGORY_CONFIG.members["category"], - self.category, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["category"] = GuardrailChecksContentFilterCategory( - de.read_string( - _SCHEMA_GUARDRAIL_CHECKS_CONTENT_FILTER_CATEGORY_CONFIG.members[ - "category" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_CHECKS_CONTENT_FILTER_CATEGORY_CONFIG, consumer=_consumer - ) - if "category" not in kwargs: - kwargs["category"] = GuardrailChecksContentFilterCategory._corrected("") - return kwargs - - -def _serialize_guardrail_checks_content_filter_category_config_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[GuardrailChecksContentFilterCategoryConfig], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_guardrail_checks_content_filter_category_config_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GuardrailChecksContentFilterCategoryConfig]: - result: list[GuardrailChecksContentFilterCategoryConfig] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GuardrailChecksContentFilterCategoryConfig.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GuardrailChecksContentFilterConfig: - """ - The configuration for the content filter check, specifying which - categories to evaluate. - """ - - categories: list[GuardrailChecksContentFilterCategoryConfig] - """The content filter categories to evaluate.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_CHECKS_CONTENT_FILTER_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_guardrail_checks_content_filter_category_config_list( - serializer, - _SCHEMA_GUARDRAIL_CHECKS_CONTENT_FILTER_CONFIG.members["categories"], - self.categories, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["categories"] = ( - _deserialize_guardrail_checks_content_filter_category_config_list( - de, - _SCHEMA_GUARDRAIL_CHECKS_CONTENT_FILTER_CONFIG.members[ - "categories" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_CHECKS_CONTENT_FILTER_CONFIG, consumer=_consumer - ) - if "categories" not in kwargs: - kwargs["categories"] = [] - return kwargs - - -class GuardrailChecksPromptAttackCategory(UnknownEnumMixin, StrEnum): - """The category for prompt attack evaluation.""" - - JAILBREAK = "JAILBREAK" - PROMPT_INJECTION = "PROMPT_INJECTION" - PROMPT_LEAKAGE = "PROMPT_LEAKAGE" - - -@dataclass(kw_only=True) -class GuardrailChecksPromptAttackCategoryConfig: - """The configuration for a single prompt attack category to evaluate.""" - - category: str - """The prompt attack category to evaluate.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GUARDRAIL_CHECKS_PROMPT_ATTACK_CATEGORY_CONFIG, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GUARDRAIL_CHECKS_PROMPT_ATTACK_CATEGORY_CONFIG.members["category"], - self.category, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["category"] = GuardrailChecksPromptAttackCategory( - de.read_string( - _SCHEMA_GUARDRAIL_CHECKS_PROMPT_ATTACK_CATEGORY_CONFIG.members[ - "category" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_CHECKS_PROMPT_ATTACK_CATEGORY_CONFIG, consumer=_consumer - ) - if "category" not in kwargs: - kwargs["category"] = GuardrailChecksPromptAttackCategory._corrected("") - return kwargs - - -def _serialize_guardrail_checks_prompt_attack_category_config_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[GuardrailChecksPromptAttackCategoryConfig], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_guardrail_checks_prompt_attack_category_config_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GuardrailChecksPromptAttackCategoryConfig]: - result: list[GuardrailChecksPromptAttackCategoryConfig] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GuardrailChecksPromptAttackCategoryConfig.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GuardrailChecksPromptAttackConfig: - """ - The configuration for the prompt attack check, specifying which - categories to evaluate. - """ - - categories: list[GuardrailChecksPromptAttackCategoryConfig] - """The prompt attack categories to evaluate.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_CHECKS_PROMPT_ATTACK_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_guardrail_checks_prompt_attack_category_config_list( - serializer, - _SCHEMA_GUARDRAIL_CHECKS_PROMPT_ATTACK_CONFIG.members["categories"], - self.categories, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["categories"] = ( - _deserialize_guardrail_checks_prompt_attack_category_config_list( - de, - _SCHEMA_GUARDRAIL_CHECKS_PROMPT_ATTACK_CONFIG.members[ - "categories" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_CHECKS_PROMPT_ATTACK_CONFIG, consumer=_consumer - ) - if "categories" not in kwargs: - kwargs["categories"] = [] - return kwargs - - -class GuardrailChecksSensitiveInformationEntityType(UnknownEnumMixin, StrEnum): - """The type of personally identifiable information (PII) entity to detect.""" - - ADDRESS = "ADDRESS" - AGE = "AGE" - AWS_ACCESS_KEY = "AWS_ACCESS_KEY" - AWS_SECRET_KEY = "AWS_SECRET_KEY" - CA_HEALTH_NUMBER = "CA_HEALTH_NUMBER" - CA_SOCIAL_INSURANCE_NUMBER = "CA_SOCIAL_INSURANCE_NUMBER" - CREDIT_DEBIT_CARD_CVV = "CREDIT_DEBIT_CARD_CVV" - CREDIT_DEBIT_CARD_EXPIRY = "CREDIT_DEBIT_CARD_EXPIRY" - CREDIT_DEBIT_CARD_NUMBER = "CREDIT_DEBIT_CARD_NUMBER" - DRIVER_ID = "DRIVER_ID" - EMAIL = "EMAIL" - INTERNATIONAL_BANK_ACCOUNT_NUMBER = "INTERNATIONAL_BANK_ACCOUNT_NUMBER" - IP_ADDRESS = "IP_ADDRESS" - LICENSE_PLATE = "LICENSE_PLATE" - MAC_ADDRESS = "MAC_ADDRESS" - NAME = "NAME" - PASSWORD = "PASSWORD" - PHONE = "PHONE" - PIN = "PIN" - SWIFT_CODE = "SWIFT_CODE" - UK_NATIONAL_HEALTH_SERVICE_NUMBER = "UK_NATIONAL_HEALTH_SERVICE_NUMBER" - UK_NATIONAL_INSURANCE_NUMBER = "UK_NATIONAL_INSURANCE_NUMBER" - UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER = "UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER" - URL = "URL" - USERNAME = "USERNAME" - US_BANK_ACCOUNT_NUMBER = "US_BANK_ACCOUNT_NUMBER" - US_BANK_ROUTING_NUMBER = "US_BANK_ROUTING_NUMBER" - US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER = "US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER" - US_PASSPORT_NUMBER = "US_PASSPORT_NUMBER" - US_SOCIAL_SECURITY_NUMBER = "US_SOCIAL_SECURITY_NUMBER" - VEHICLE_IDENTIFICATION_NUMBER = "VEHICLE_IDENTIFICATION_NUMBER" - - -@dataclass(kw_only=True) -class GuardrailChecksSensitiveInformationEntityConfig: - """ - The configuration for a single sensitive information entity type to - detect. - """ - - type: str - """The PII entity type to detect.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_ENTITY_CONFIG, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_ENTITY_CONFIG.members[ - "type" - ], - self.type, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = GuardrailChecksSensitiveInformationEntityType( - de.read_string( - _SCHEMA_GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_ENTITY_CONFIG.members[ - "type" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_ENTITY_CONFIG, - consumer=_consumer, - ) - if "type" not in kwargs: - kwargs["type"] = GuardrailChecksSensitiveInformationEntityType._corrected( - "" - ) - return kwargs - - -def _serialize_guardrail_checks_sensitive_information_entity_config_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[GuardrailChecksSensitiveInformationEntityConfig], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_guardrail_checks_sensitive_information_entity_config_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GuardrailChecksSensitiveInformationEntityConfig]: - result: list[GuardrailChecksSensitiveInformationEntityConfig] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append( - GuardrailChecksSensitiveInformationEntityConfig.deserialize(d) - ) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GuardrailChecksSensitiveInformationConfig: - """ - The configuration for the sensitive information check, specifying which - entity types to detect. - """ - - entities: list[GuardrailChecksSensitiveInformationEntityConfig] - """The sensitive information entity types to detect.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_CONFIG, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_guardrail_checks_sensitive_information_entity_config_list( - serializer, - _SCHEMA_GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_CONFIG.members["entities"], - self.entities, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["entities"] = ( - _deserialize_guardrail_checks_sensitive_information_entity_config_list( - de, - _SCHEMA_GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_CONFIG.members[ - "entities" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_CONFIG, consumer=_consumer - ) - if "entities" not in kwargs: - kwargs["entities"] = [] - return kwargs - - -@dataclass(kw_only=True) -class GuardrailChecksConfig: - """ - The configuration for inline guardrail checks. Specify one or more check - types to run against the messages. - """ - - content_filter: GuardrailChecksContentFilterConfig | None = None - """The content filter check configuration.""" - - prompt_attack: GuardrailChecksPromptAttackConfig | None = None - """The prompt attack check configuration.""" - - sensitive_information: GuardrailChecksSensitiveInformationConfig | None = None - """The sensitive information check configuration.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_CHECKS_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.content_filter is not None: - serializer.write_struct( - _SCHEMA_GUARDRAIL_CHECKS_CONFIG.members["contentFilter"], - self.content_filter, - ) - - if self.prompt_attack is not None: - serializer.write_struct( - _SCHEMA_GUARDRAIL_CHECKS_CONFIG.members["promptAttack"], - self.prompt_attack, - ) - - if self.sensitive_information is not None: - serializer.write_struct( - _SCHEMA_GUARDRAIL_CHECKS_CONFIG.members["sensitiveInformation"], - self.sensitive_information, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["content_filter"] = ( - GuardrailChecksContentFilterConfig.deserialize(de) - ) - - case 1: - kwargs["prompt_attack"] = ( - GuardrailChecksPromptAttackConfig.deserialize(de) - ) - - case 2: - kwargs["sensitive_information"] = ( - GuardrailChecksSensitiveInformationConfig.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GUARDRAIL_CHECKS_CONFIG, consumer=_consumer) - return kwargs - - -@dataclass -class GuardrailChecksContentBlockText: - """The text content to evaluate.""" - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_CHECKS_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GUARDRAIL_CHECKS_CONTENT_BLOCK.members["text"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string( - _SCHEMA_GUARDRAIL_CHECKS_CONTENT_BLOCK.members["text"] - ) - ) - - -@dataclass -class GuardrailChecksContentBlockUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -GuardrailChecksContentBlock = Union[ - GuardrailChecksContentBlockText | GuardrailChecksContentBlockUnknown -] -"""A content block within a message to evaluate.""" - - -class _GuardrailChecksContentBlockDeserializer: - _result: GuardrailChecksContentBlock | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> GuardrailChecksContentBlock: - self._result = None - deserializer.read_struct(_SCHEMA_GUARDRAIL_CHECKS_CONTENT_BLOCK, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(GuardrailChecksContentBlockText.deserialize(de)) - - case _: - self._set_result( - GuardrailChecksContentBlockUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: GuardrailChecksContentBlock) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_guardrail_checks_content_block_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[GuardrailChecksContentBlock], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_guardrail_checks_content_block_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GuardrailChecksContentBlock]: - result: list[GuardrailChecksContentBlock] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_GuardrailChecksContentBlockDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class GuardrailChecksRole(UnknownEnumMixin, StrEnum): - """The role of the message sender in the conversation.""" - - USER = "user" - ASSISTANT = "assistant" - SYSTEM = "system" - - -@dataclass(kw_only=True) -class GuardrailChecksMessage: - """ - A message to evaluate against guardrail checks, containing a role and - content blocks. - """ - - role: str - """The role of the message sender.""" - - content: list[GuardrailChecksContentBlock] - """The content blocks for the message.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_CHECKS_MESSAGE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GUARDRAIL_CHECKS_MESSAGE.members["role"], self.role - ) - _serialize_guardrail_checks_content_block_list( - serializer, - _SCHEMA_GUARDRAIL_CHECKS_MESSAGE.members["content"], - self.content, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["role"] = GuardrailChecksRole( - de.read_string(_SCHEMA_GUARDRAIL_CHECKS_MESSAGE.members["role"]) - ) - - case 1: - kwargs["content"] = ( - _deserialize_guardrail_checks_content_block_list( - de, _SCHEMA_GUARDRAIL_CHECKS_MESSAGE.members["content"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GUARDRAIL_CHECKS_MESSAGE, consumer=_consumer) - if "role" not in kwargs: - kwargs["role"] = GuardrailChecksRole._corrected("") - if "content" not in kwargs: - kwargs["content"] = [] - return kwargs - - -def _serialize_guardrail_checks_message_list( - serializer: ShapeSerializer, schema: Schema, value: list[GuardrailChecksMessage] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_guardrail_checks_message_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GuardrailChecksMessage]: - result: list[GuardrailChecksMessage] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GuardrailChecksMessage.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class InvokeGuardrailChecksInput: - """Dataclass for InvokeGuardrailChecksInput structure.""" - - messages: list[GuardrailChecksMessage] | None = None - """ - The messages to evaluate against the specified guardrail checks. Each - message includes a role and one or more content blocks. - """ - - checks: GuardrailChecksConfig | None = None - """ - The inline check configurations that specify which guardrail checks to - run against the messages. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOKE_GUARDRAIL_CHECKS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.messages is not None: - _serialize_guardrail_checks_message_list( - serializer, - _SCHEMA_INVOKE_GUARDRAIL_CHECKS_INPUT.members["messages"], - self.messages, - ) - - if self.checks is not None: - serializer.write_struct( - _SCHEMA_INVOKE_GUARDRAIL_CHECKS_INPUT.members["checks"], self.checks - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["messages"] = _deserialize_guardrail_checks_message_list( - de, _SCHEMA_INVOKE_GUARDRAIL_CHECKS_INPUT.members["messages"] - ) - - case 1: - kwargs["checks"] = GuardrailChecksConfig.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVOKE_GUARDRAIL_CHECKS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GuardrailChecksContentFilterResultEntry: - """The evaluation result for a single content filter category.""" - - category: str - """The content filter category that was evaluated.""" - - severity_score: float - """ - The severity score for the category, ranging from 0.0 to 1.0. Higher - values indicate greater severity. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GUARDRAIL_CHECKS_CONTENT_FILTER_RESULT_ENTRY, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GUARDRAIL_CHECKS_CONTENT_FILTER_RESULT_ENTRY.members["category"], - self.category, - ) - serializer.write_double( - _SCHEMA_GUARDRAIL_CHECKS_CONTENT_FILTER_RESULT_ENTRY.members[ - "severityScore" - ], - self.severity_score, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["category"] = GuardrailChecksContentFilterCategory( - de.read_string( - _SCHEMA_GUARDRAIL_CHECKS_CONTENT_FILTER_RESULT_ENTRY.members[ - "category" - ] - ) - ) - - case 1: - kwargs["severity_score"] = de.read_double( - _SCHEMA_GUARDRAIL_CHECKS_CONTENT_FILTER_RESULT_ENTRY.members[ - "severityScore" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_CHECKS_CONTENT_FILTER_RESULT_ENTRY, consumer=_consumer - ) - if "category" not in kwargs: - kwargs["category"] = GuardrailChecksContentFilterCategory._corrected("") - if "severity_score" not in kwargs: - kwargs["severity_score"] = 0.0 - return kwargs - - -def _serialize_guardrail_checks_content_filter_result_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[GuardrailChecksContentFilterResultEntry], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_guardrail_checks_content_filter_result_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GuardrailChecksContentFilterResultEntry]: - result: list[GuardrailChecksContentFilterResultEntry] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GuardrailChecksContentFilterResultEntry.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GuardrailChecksContentFilterResult: - """The content filter check results.""" - - results: list[GuardrailChecksContentFilterResultEntry] - """The per-category content filter results.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_CHECKS_CONTENT_FILTER_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_guardrail_checks_content_filter_result_list( - serializer, - _SCHEMA_GUARDRAIL_CHECKS_CONTENT_FILTER_RESULT.members["results"], - self.results, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["results"] = ( - _deserialize_guardrail_checks_content_filter_result_list( - de, - _SCHEMA_GUARDRAIL_CHECKS_CONTENT_FILTER_RESULT.members[ - "results" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_CHECKS_CONTENT_FILTER_RESULT, consumer=_consumer - ) - if "results" not in kwargs: - kwargs["results"] = [] - return kwargs - - -@dataclass(kw_only=True) -class GuardrailChecksPromptAttackResultEntry: - """The evaluation result for a single prompt attack category.""" - - category: str - """The prompt attack category that was evaluated.""" - - severity_score: float - """ - The severity score for the category, ranging from 0.0 to 1.0. Higher - values indicate greater severity. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GUARDRAIL_CHECKS_PROMPT_ATTACK_RESULT_ENTRY, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GUARDRAIL_CHECKS_PROMPT_ATTACK_RESULT_ENTRY.members["category"], - self.category, - ) - serializer.write_double( - _SCHEMA_GUARDRAIL_CHECKS_PROMPT_ATTACK_RESULT_ENTRY.members[ - "severityScore" - ], - self.severity_score, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["category"] = GuardrailChecksPromptAttackCategory( - de.read_string( - _SCHEMA_GUARDRAIL_CHECKS_PROMPT_ATTACK_RESULT_ENTRY.members[ - "category" - ] - ) - ) - - case 1: - kwargs["severity_score"] = de.read_double( - _SCHEMA_GUARDRAIL_CHECKS_PROMPT_ATTACK_RESULT_ENTRY.members[ - "severityScore" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_CHECKS_PROMPT_ATTACK_RESULT_ENTRY, consumer=_consumer - ) - if "category" not in kwargs: - kwargs["category"] = GuardrailChecksPromptAttackCategory._corrected("") - if "severity_score" not in kwargs: - kwargs["severity_score"] = 0.0 - return kwargs - - -def _serialize_guardrail_checks_prompt_attack_result_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[GuardrailChecksPromptAttackResultEntry], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_guardrail_checks_prompt_attack_result_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GuardrailChecksPromptAttackResultEntry]: - result: list[GuardrailChecksPromptAttackResultEntry] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GuardrailChecksPromptAttackResultEntry.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GuardrailChecksPromptAttackResult: - """The prompt attack check results.""" - - results: list[GuardrailChecksPromptAttackResultEntry] - """The per-category prompt attack results.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_CHECKS_PROMPT_ATTACK_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_guardrail_checks_prompt_attack_result_list( - serializer, - _SCHEMA_GUARDRAIL_CHECKS_PROMPT_ATTACK_RESULT.members["results"], - self.results, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["results"] = ( - _deserialize_guardrail_checks_prompt_attack_result_list( - de, - _SCHEMA_GUARDRAIL_CHECKS_PROMPT_ATTACK_RESULT.members[ - "results" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_CHECKS_PROMPT_ATTACK_RESULT, consumer=_consumer - ) - if "results" not in kwargs: - kwargs["results"] = [] - return kwargs - - -@dataclass(kw_only=True) -class GuardrailChecksSensitiveInformationResultEntry: - """ - The detection result for a single sensitive information entity found in - the evaluated messages. - """ - - type: str - """The PII entity type that was detected.""" - - confidence_score: float - """ - The confidence score for the detection, ranging from 0.0 to 1.0. Higher - values indicate greater confidence. - """ - - begin_offset: int - """ - The start character offset of the detected entity within the content - block. - """ - - end_offset: int - """ - The end character offset of the detected entity within the content - block. - """ - - message_index: int - """ - The zero-based index of the message in the input messages array where - the entity was detected. - """ - - content_index: int - """ - The zero-based index of the content block within the message where the - entity was detected. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_RESULT_ENTRY, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_RESULT_ENTRY.members["type"], - self.type, - ) - serializer.write_double( - _SCHEMA_GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_RESULT_ENTRY.members[ - "confidenceScore" - ], - self.confidence_score, - ) - serializer.write_integer( - _SCHEMA_GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_RESULT_ENTRY.members[ - "beginOffset" - ], - self.begin_offset, - ) - serializer.write_integer( - _SCHEMA_GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_RESULT_ENTRY.members[ - "endOffset" - ], - self.end_offset, - ) - serializer.write_integer( - _SCHEMA_GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_RESULT_ENTRY.members[ - "messageIndex" - ], - self.message_index, - ) - serializer.write_integer( - _SCHEMA_GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_RESULT_ENTRY.members[ - "contentIndex" - ], - self.content_index, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = GuardrailChecksSensitiveInformationEntityType( - de.read_string( - _SCHEMA_GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_RESULT_ENTRY.members[ - "type" - ] - ) - ) - - case 1: - kwargs["confidence_score"] = de.read_double( - _SCHEMA_GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_RESULT_ENTRY.members[ - "confidenceScore" - ] - ) - - case 2: - kwargs["begin_offset"] = de.read_integer( - _SCHEMA_GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_RESULT_ENTRY.members[ - "beginOffset" - ] - ) - - case 3: - kwargs["end_offset"] = de.read_integer( - _SCHEMA_GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_RESULT_ENTRY.members[ - "endOffset" - ] - ) - - case 4: - kwargs["message_index"] = de.read_integer( - _SCHEMA_GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_RESULT_ENTRY.members[ - "messageIndex" - ] - ) - - case 5: - kwargs["content_index"] = de.read_integer( - _SCHEMA_GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_RESULT_ENTRY.members[ - "contentIndex" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_RESULT_ENTRY, - consumer=_consumer, - ) - if "type" not in kwargs: - kwargs["type"] = GuardrailChecksSensitiveInformationEntityType._corrected( - "" - ) - if "confidence_score" not in kwargs: - kwargs["confidence_score"] = 0.0 - if "begin_offset" not in kwargs: - kwargs["begin_offset"] = 0 - if "end_offset" not in kwargs: - kwargs["end_offset"] = 0 - if "message_index" not in kwargs: - kwargs["message_index"] = 0 - if "content_index" not in kwargs: - kwargs["content_index"] = 0 - return kwargs - - -def _serialize_guardrail_checks_sensitive_information_result_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[GuardrailChecksSensitiveInformationResultEntry], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_guardrail_checks_sensitive_information_result_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GuardrailChecksSensitiveInformationResultEntry]: - result: list[GuardrailChecksSensitiveInformationResultEntry] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GuardrailChecksSensitiveInformationResultEntry.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GuardrailChecksSensitiveInformationResult: - """The sensitive information check results.""" - - results: list[GuardrailChecksSensitiveInformationResultEntry] - """The detected sensitive information entities.""" - - truncated: bool | None = None - """ - Specifies whether the results were truncated because the number of - detected entities exceeded the maximum limit. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_RESULT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_guardrail_checks_sensitive_information_result_list( - serializer, - _SCHEMA_GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_RESULT.members["results"], - self.results, - ) - if self.truncated is not None: - serializer.write_boolean( - _SCHEMA_GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_RESULT.members[ - "truncated" - ], - self.truncated, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["results"] = ( - _deserialize_guardrail_checks_sensitive_information_result_list( - de, - _SCHEMA_GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_RESULT.members[ - "results" - ], - ) - ) - - case 1: - kwargs["truncated"] = de.read_boolean( - _SCHEMA_GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_RESULT.members[ - "truncated" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_RESULT, consumer=_consumer - ) - if "results" not in kwargs: - kwargs["results"] = [] - return kwargs - - -@dataclass(kw_only=True) -class GuardrailChecksResults: - """ - The results from the guardrail checks evaluation, organized by check - type. - """ - - content_filter: GuardrailChecksContentFilterResult | None = None - """The content filter check results.""" - - prompt_attack: GuardrailChecksPromptAttackResult | None = None - """The prompt attack check results.""" - - sensitive_information: GuardrailChecksSensitiveInformationResult | None = None - """The sensitive information check results.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_CHECKS_RESULTS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.content_filter is not None: - serializer.write_struct( - _SCHEMA_GUARDRAIL_CHECKS_RESULTS.members["contentFilter"], - self.content_filter, - ) - - if self.prompt_attack is not None: - serializer.write_struct( - _SCHEMA_GUARDRAIL_CHECKS_RESULTS.members["promptAttack"], - self.prompt_attack, - ) - - if self.sensitive_information is not None: - serializer.write_struct( - _SCHEMA_GUARDRAIL_CHECKS_RESULTS.members["sensitiveInformation"], - self.sensitive_information, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["content_filter"] = ( - GuardrailChecksContentFilterResult.deserialize(de) - ) - - case 1: - kwargs["prompt_attack"] = ( - GuardrailChecksPromptAttackResult.deserialize(de) - ) - - case 2: - kwargs["sensitive_information"] = ( - GuardrailChecksSensitiveInformationResult.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GUARDRAIL_CHECKS_RESULTS, consumer=_consumer) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls() - - -@dataclass(kw_only=True) -class GuardrailChecksContentFilterUsage: - """The text unit usage for the content filter check.""" - - text_units: int - """The number of text units consumed by the content filter check.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_CHECKS_CONTENT_FILTER_USAGE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer( - _SCHEMA_GUARDRAIL_CHECKS_CONTENT_FILTER_USAGE.members["textUnits"], - self.text_units, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["text_units"] = de.read_integer( - _SCHEMA_GUARDRAIL_CHECKS_CONTENT_FILTER_USAGE.members[ - "textUnits" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_CHECKS_CONTENT_FILTER_USAGE, consumer=_consumer - ) - if "text_units" not in kwargs: - kwargs["text_units"] = 0 - return kwargs - - -@dataclass(kw_only=True) -class GuardrailChecksPromptAttackUsage: - """The text unit usage for the prompt attack check.""" - - text_units: int - """The number of text units consumed by the prompt attack check.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_CHECKS_PROMPT_ATTACK_USAGE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer( - _SCHEMA_GUARDRAIL_CHECKS_PROMPT_ATTACK_USAGE.members["textUnits"], - self.text_units, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["text_units"] = de.read_integer( - _SCHEMA_GUARDRAIL_CHECKS_PROMPT_ATTACK_USAGE.members[ - "textUnits" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_CHECKS_PROMPT_ATTACK_USAGE, consumer=_consumer - ) - if "text_units" not in kwargs: - kwargs["text_units"] = 0 - return kwargs - - -@dataclass(kw_only=True) -class GuardrailChecksSensitiveInformationUsage: - """The text unit usage for the sensitive information check.""" - - text_units: int - """The number of text units consumed by the sensitive information check.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_USAGE, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer( - _SCHEMA_GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_USAGE.members["textUnits"], - self.text_units, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["text_units"] = de.read_integer( - _SCHEMA_GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_USAGE.members[ - "textUnits" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_CHECKS_SENSITIVE_INFORMATION_USAGE, consumer=_consumer - ) - if "text_units" not in kwargs: - kwargs["text_units"] = 0 - return kwargs - - -@dataclass(kw_only=True) -class GuardrailChecksUsageResults: - """ - The text unit usage for the guardrail checks evaluation, organized by - check type. - """ - - content_filter: GuardrailChecksContentFilterUsage | None = None - """The text unit usage for the content filter check.""" - - prompt_attack: GuardrailChecksPromptAttackUsage | None = None - """The text unit usage for the prompt attack check.""" - - sensitive_information: GuardrailChecksSensitiveInformationUsage | None = None - """The text unit usage for the sensitive information check.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_CHECKS_USAGE_RESULTS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.content_filter is not None: - serializer.write_struct( - _SCHEMA_GUARDRAIL_CHECKS_USAGE_RESULTS.members["contentFilter"], - self.content_filter, - ) - - if self.prompt_attack is not None: - serializer.write_struct( - _SCHEMA_GUARDRAIL_CHECKS_USAGE_RESULTS.members["promptAttack"], - self.prompt_attack, - ) - - if self.sensitive_information is not None: - serializer.write_struct( - _SCHEMA_GUARDRAIL_CHECKS_USAGE_RESULTS.members["sensitiveInformation"], - self.sensitive_information, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["content_filter"] = ( - GuardrailChecksContentFilterUsage.deserialize(de) - ) - - case 1: - kwargs["prompt_attack"] = ( - GuardrailChecksPromptAttackUsage.deserialize(de) - ) - - case 2: - kwargs["sensitive_information"] = ( - GuardrailChecksSensitiveInformationUsage.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_CHECKS_USAGE_RESULTS, consumer=_consumer - ) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls() - - -@dataclass(kw_only=True) -class InvokeGuardrailChecksOutput: - """Dataclass for InvokeGuardrailChecksOutput structure.""" - - results: GuardrailChecksResults - """The per-check results containing findings from the guardrail evaluation.""" - - usage: GuardrailChecksUsageResults - """The per-check text unit consumption for the guardrail evaluation.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOKE_GUARDRAIL_CHECKS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_GUARDRAIL_CHECKS_OUTPUT.members["results"], self.results - ) - serializer.write_struct( - _SCHEMA_INVOKE_GUARDRAIL_CHECKS_OUTPUT.members["usage"], self.usage - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["results"] = GuardrailChecksResults.deserialize(de) - - case 1: - kwargs["usage"] = GuardrailChecksUsageResults.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVOKE_GUARDRAIL_CHECKS_OUTPUT, consumer=_consumer - ) - if "results" not in kwargs: - kwargs["results"] = GuardrailChecksResults._smithy_default() - if "usage" not in kwargs: - kwargs["usage"] = GuardrailChecksUsageResults._smithy_default() - return kwargs - - -INVOKE_GUARDRAIL_CHECKS = APIOperation( - input=InvokeGuardrailChecksInput, - output=InvokeGuardrailChecksOutput, - schema=_SCHEMA_INVOKE_GUARDRAIL_CHECKS, - input_schema=_SCHEMA_INVOKE_GUARDRAIL_CHECKS_INPUT, - output_schema=_SCHEMA_INVOKE_GUARDRAIL_CHECKS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockruntime#ServiceUnavailableException" - ): ServiceUnavailableException, - ShapeID( - "com.amazonaws.bedrockruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockruntime#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_SERVICE_UNAVAILABLE_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class GuardrailTrace(UnknownEnumMixin, StrEnum): - ENABLED = "enabled" - DISABLED = "disabled" - ENABLED_FULL = "enabled_full" - - -@dataclass(kw_only=True) -class GuardrailConfiguration: - """ - Configuration information for a guardrail that you use with the - [Converse](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html) - operation. - """ - - guardrail_identifier: str = "" - """The identifier for the guardrail.""" - - guardrail_version: str = "" - """The version of the guardrail.""" - - trace: str = GuardrailTrace("disabled") - """The trace behavior for the guardrail.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GUARDRAIL_CONFIGURATION.members["guardrailIdentifier"], - self.guardrail_identifier, - ) - serializer.write_string( - _SCHEMA_GUARDRAIL_CONFIGURATION.members["guardrailVersion"], - self.guardrail_version, - ) - serializer.write_string( - _SCHEMA_GUARDRAIL_CONFIGURATION.members["trace"], self.trace - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["guardrail_identifier"] = de.read_string( - _SCHEMA_GUARDRAIL_CONFIGURATION.members["guardrailIdentifier"] - ) - - case 1: - kwargs["guardrail_version"] = de.read_string( - _SCHEMA_GUARDRAIL_CONFIGURATION.members["guardrailVersion"] - ) - - case 2: - kwargs["trace"] = GuardrailTrace( - de.read_string(_SCHEMA_GUARDRAIL_CONFIGURATION.members["trace"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GUARDRAIL_CONFIGURATION, consumer=_consumer) - return kwargs - - -def _serialize_non_empty_string_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_non_empty_string_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class InferenceConfiguration: - """ - Base inference parameters to pass to a model in a call to - [Converse](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html) - or - [ConverseStream](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html). - For more information, see [Inference parameters for foundation - models](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). - - If you need to pass additional parameters that the model supports, use - the `additionalModelRequestFields` request field in the call to - `Converse` or `ConverseStream`. For more information, see [Model - parameters](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). - """ - - max_tokens: int | None = None - """ - The maximum number of tokens to allow in the generated response. The - default value is the maximum allowed value for the model that you are - using. For more information, see [Inference parameters for foundation - models](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). - """ - - temperature: float | None = None - """ - The likelihood of the model selecting higher-probability options while - generating a response. A lower value makes the model more likely to - choose higher-probability options, while a higher value makes the model - more likely to choose lower-probability options. - - The default value is the default value for the model that you are using. - For more information, see [Inference parameters for foundation - models](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). - """ - - top_p: float | None = None - """ - The percentage of most-likely candidates that the model considers for - the next token. For example, if you choose a value of 0.8 for `topP`, - the model selects from the top 80% of the probability distribution of - tokens that could be next in the sequence. - - The default value is the default value for the model that you are using. - For more information, see [Inference parameters for foundation - models](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). - """ - - stop_sequences: list[str] | None = None - """ - A list of stop sequences. A stop sequence is a sequence of characters - that causes the model to stop generating the response. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INFERENCE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.max_tokens is not None: - serializer.write_integer( - _SCHEMA_INFERENCE_CONFIGURATION.members["maxTokens"], self.max_tokens - ) - - if self.temperature is not None: - serializer.write_float( - _SCHEMA_INFERENCE_CONFIGURATION.members["temperature"], self.temperature - ) - - if self.top_p is not None: - serializer.write_float( - _SCHEMA_INFERENCE_CONFIGURATION.members["topP"], self.top_p - ) - - if self.stop_sequences is not None: - _serialize_non_empty_string_list( - serializer, - _SCHEMA_INFERENCE_CONFIGURATION.members["stopSequences"], - self.stop_sequences, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["max_tokens"] = de.read_integer( - _SCHEMA_INFERENCE_CONFIGURATION.members["maxTokens"] - ) - - case 1: - kwargs["temperature"] = de.read_float( - _SCHEMA_INFERENCE_CONFIGURATION.members["temperature"] - ) - - case 2: - kwargs["top_p"] = de.read_float( - _SCHEMA_INFERENCE_CONFIGURATION.members["topP"] - ) - - case 3: - kwargs["stop_sequences"] = _deserialize_non_empty_string_list( - de, _SCHEMA_INFERENCE_CONFIGURATION.members["stopSequences"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INFERENCE_CONFIGURATION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ErrorBlock: - """A block containing error information when content processing fails.""" - - message: str | None = None - """ - A human-readable error message describing what went wrong during content - processing. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ERROR_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_ERROR_BLOCK.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_ERROR_BLOCK.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ERROR_BLOCK, consumer=_consumer) - return kwargs - - -class AudioFormat(UnknownEnumMixin, StrEnum): - MP3 = "mp3" - OPUS = "opus" - WAV = "wav" - AAC = "aac" - FLAC = "flac" - MP4 = "mp4" - OGG = "ogg" - MKV = "mkv" - MKA = "mka" - X_AAC = "x-aac" - M4_A = "m4a" - MPEG = "mpeg" - MPGA = "mpga" - PCM = "pcm" - WEBM = "webm" - - -@dataclass(kw_only=True) -class S3Location: - """A storage location in an Amazon S3 bucket.""" - - uri: str - """An object URI starting with `s3://`.""" - - bucket_owner: str | None = None - """ - If the bucket belongs to another AWS account, specify that account's - ID. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_S3_LOCATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_S3_LOCATION.members["uri"], self.uri) - if self.bucket_owner is not None: - serializer.write_string( - _SCHEMA_S3_LOCATION.members["bucketOwner"], self.bucket_owner - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["uri"] = de.read_string(_SCHEMA_S3_LOCATION.members["uri"]) - - case 1: - kwargs["bucket_owner"] = de.read_string( - _SCHEMA_S3_LOCATION.members["bucketOwner"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_S3_LOCATION, consumer=_consumer) - if "uri" not in kwargs: - kwargs["uri"] = "" - return kwargs - - -@dataclass -class AudioSourceBytes: - """Audio data encoded in base64.""" - - value: bytes - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUDIO_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_blob(_SCHEMA_AUDIO_SOURCE.members["bytes"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=deserializer.read_blob(_SCHEMA_AUDIO_SOURCE.members["bytes"])) - - -@dataclass -class AudioSourceS3Location: - """ - A reference to audio data stored in an Amazon S3 bucket. To see which - models support S3 uploads, see [Supported models and features for - Converse](https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference-supported-models-features.html). - """ - - value: S3Location - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUDIO_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUDIO_SOURCE.members["s3Location"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=S3Location.deserialize(deserializer)) - - -@dataclass -class AudioSourceUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -AudioSource = Union[AudioSourceBytes | AudioSourceS3Location | AudioSourceUnknown] -""" -The source of audio data, which can be provided either as raw bytes or a -reference to an S3 location. -""" - - -class _AudioSourceDeserializer: - _result: AudioSource | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> AudioSource: - self._result = None - deserializer.read_struct(_SCHEMA_AUDIO_SOURCE, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(AudioSourceBytes.deserialize(de)) - - case 1: - self._set_result(AudioSourceS3Location.deserialize(de)) - - case _: - self._set_result(AudioSourceUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: AudioSource) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class AudioBlock: - """ - An audio content block that contains audio data in various supported - formats. - """ - - format: str - """ - The format of the audio data, such as MP3, WAV, FLAC, or other supported - audio formats. - """ - - source: AudioSource = field(repr=False) - """ - The source of the audio data, which can be provided as raw bytes or an - S3 location. - """ - - error: ErrorBlock | None = field(repr=False, default=None) - """ - Error information if the audio block could not be processed or contains - invalid data. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUDIO_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_AUDIO_BLOCK.members["format"], self.format) - serializer.write_struct(_SCHEMA_AUDIO_BLOCK.members["source"], self.source) - if self.error is not None: - serializer.write_struct(_SCHEMA_AUDIO_BLOCK.members["error"], self.error) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["format"] = AudioFormat( - de.read_string(_SCHEMA_AUDIO_BLOCK.members["format"]) - ) - - case 1: - kwargs["source"] = _AudioSourceDeserializer().deserialize(de) - - case 2: - kwargs["error"] = ErrorBlock.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AUDIO_BLOCK, consumer=_consumer) - if "format" not in kwargs: - kwargs["format"] = AudioFormat._corrected("") - if "source" not in kwargs: - kwargs["source"] = AudioSourceUnknown(tag="") - return kwargs - - -class CacheTTL(UnknownEnumMixin, StrEnum): - """Time-to-live duration for ephemeral cache entries""" - - FIVE_MINUTES = "5m" - ONE_HOUR = "1h" - - -class CachePointType(UnknownEnumMixin, StrEnum): - DEFAULT = "default" - - -@dataclass(kw_only=True) -class CachePointBlock: - """ - Defines a section of content to be cached for reuse in subsequent API - calls. - """ - - type: str - """Specifies the type of cache point within the CachePointBlock.""" - - ttl: str | None = None - """ - Optional TTL duration for cache entries. When specified, enables - extended TTL caching with the specified duration. When omitted, uses - `type` value for caching behavior. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CACHE_POINT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_CACHE_POINT_BLOCK.members["type"], self.type) - if self.ttl is not None: - serializer.write_string(_SCHEMA_CACHE_POINT_BLOCK.members["ttl"], self.ttl) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = CachePointType( - de.read_string(_SCHEMA_CACHE_POINT_BLOCK.members["type"]) - ) - - case 1: - kwargs["ttl"] = CacheTTL( - de.read_string(_SCHEMA_CACHE_POINT_BLOCK.members["ttl"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CACHE_POINT_BLOCK, consumer=_consumer) - if "type" not in kwargs: - kwargs["type"] = CachePointType._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class DocumentCharLocation: - """ - Specifies a character-level location within a document, providing - precise positioning information for cited content using start and end - character indices. - """ - - document_index: int | None = None - """ - The index of the document within the array of documents provided in the - request. - """ - - start: int | None = None - """ - The starting character position of the cited content within the - document. - """ - - end: int | None = None - """The ending character position of the cited content within the document.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_CHAR_LOCATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.document_index is not None: - serializer.write_integer( - _SCHEMA_DOCUMENT_CHAR_LOCATION.members["documentIndex"], - self.document_index, - ) - - if self.start is not None: - serializer.write_integer( - _SCHEMA_DOCUMENT_CHAR_LOCATION.members["start"], self.start - ) - - if self.end is not None: - serializer.write_integer( - _SCHEMA_DOCUMENT_CHAR_LOCATION.members["end"], self.end - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["document_index"] = de.read_integer( - _SCHEMA_DOCUMENT_CHAR_LOCATION.members["documentIndex"] - ) - - case 1: - kwargs["start"] = de.read_integer( - _SCHEMA_DOCUMENT_CHAR_LOCATION.members["start"] - ) - - case 2: - kwargs["end"] = de.read_integer( - _SCHEMA_DOCUMENT_CHAR_LOCATION.members["end"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DOCUMENT_CHAR_LOCATION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DocumentChunkLocation: - """ - Specifies a chunk-level location within a document, providing - positioning information for cited content using logical document - segments or chunks. - """ - - document_index: int | None = None - """ - The index of the document within the array of documents provided in the - request. - """ - - start: int | None = None - """ - The starting chunk identifier or index of the cited content within the - document. - """ - - end: int | None = None - """ - The ending chunk identifier or index of the cited content within the - document. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_CHUNK_LOCATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.document_index is not None: - serializer.write_integer( - _SCHEMA_DOCUMENT_CHUNK_LOCATION.members["documentIndex"], - self.document_index, - ) - - if self.start is not None: - serializer.write_integer( - _SCHEMA_DOCUMENT_CHUNK_LOCATION.members["start"], self.start - ) - - if self.end is not None: - serializer.write_integer( - _SCHEMA_DOCUMENT_CHUNK_LOCATION.members["end"], self.end - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["document_index"] = de.read_integer( - _SCHEMA_DOCUMENT_CHUNK_LOCATION.members["documentIndex"] - ) - - case 1: - kwargs["start"] = de.read_integer( - _SCHEMA_DOCUMENT_CHUNK_LOCATION.members["start"] - ) - - case 2: - kwargs["end"] = de.read_integer( - _SCHEMA_DOCUMENT_CHUNK_LOCATION.members["end"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DOCUMENT_CHUNK_LOCATION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DocumentPageLocation: - """ - Specifies a page-level location within a document, providing positioning - information for cited content using page numbers. - """ - - document_index: int | None = None - """ - The index of the document within the array of documents provided in the - request. - """ - - start: int | None = None - """The starting page number of the cited content within the document.""" - - end: int | None = None - """The ending page number of the cited content within the document.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_PAGE_LOCATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.document_index is not None: - serializer.write_integer( - _SCHEMA_DOCUMENT_PAGE_LOCATION.members["documentIndex"], - self.document_index, - ) - - if self.start is not None: - serializer.write_integer( - _SCHEMA_DOCUMENT_PAGE_LOCATION.members["start"], self.start - ) - - if self.end is not None: - serializer.write_integer( - _SCHEMA_DOCUMENT_PAGE_LOCATION.members["end"], self.end - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["document_index"] = de.read_integer( - _SCHEMA_DOCUMENT_PAGE_LOCATION.members["documentIndex"] - ) - - case 1: - kwargs["start"] = de.read_integer( - _SCHEMA_DOCUMENT_PAGE_LOCATION.members["start"] - ) - - case 2: - kwargs["end"] = de.read_integer( - _SCHEMA_DOCUMENT_PAGE_LOCATION.members["end"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DOCUMENT_PAGE_LOCATION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class SearchResultLocation: - """ - Specifies a search result location within the content array, providing - positioning information for cited content using search result index and - block positions. - """ - - search_result_index: int | None = None - """ - The index of the search result content block where the cited content is - found. - """ - - start: int | None = None - """ - The starting position in the content array where the cited content - begins. - """ - - end: int | None = None - """The ending position in the content array where the cited content ends.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SEARCH_RESULT_LOCATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.search_result_index is not None: - serializer.write_integer( - _SCHEMA_SEARCH_RESULT_LOCATION.members["searchResultIndex"], - self.search_result_index, - ) - - if self.start is not None: - serializer.write_integer( - _SCHEMA_SEARCH_RESULT_LOCATION.members["start"], self.start - ) - - if self.end is not None: - serializer.write_integer( - _SCHEMA_SEARCH_RESULT_LOCATION.members["end"], self.end - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["search_result_index"] = de.read_integer( - _SCHEMA_SEARCH_RESULT_LOCATION.members["searchResultIndex"] - ) - - case 1: - kwargs["start"] = de.read_integer( - _SCHEMA_SEARCH_RESULT_LOCATION.members["start"] - ) - - case 2: - kwargs["end"] = de.read_integer( - _SCHEMA_SEARCH_RESULT_LOCATION.members["end"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SEARCH_RESULT_LOCATION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class WebLocation: - """ - Provides the URL and domain information for the website that was cited - when performing a web search. - """ - - url: str | None = None - """The URL that was cited when performing a web search.""" - - domain: str | None = None - """The domain that was cited when performing a web search.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_WEB_LOCATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.url is not None: - serializer.write_string(_SCHEMA_WEB_LOCATION.members["url"], self.url) - - if self.domain is not None: - serializer.write_string(_SCHEMA_WEB_LOCATION.members["domain"], self.domain) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["url"] = de.read_string(_SCHEMA_WEB_LOCATION.members["url"]) - - case 1: - kwargs["domain"] = de.read_string( - _SCHEMA_WEB_LOCATION.members["domain"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_WEB_LOCATION, consumer=_consumer) - return kwargs - - -@dataclass -class CitationLocationWeb: - """The web URL that was cited for this reference.""" - - value: WebLocation - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CITATION_LOCATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CITATION_LOCATION.members["web"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=WebLocation.deserialize(deserializer)) - - -@dataclass -class CitationLocationDocumentChar: - """ - The character-level location within the document where the cited content - is found. - """ - - value: DocumentCharLocation - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CITATION_LOCATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CITATION_LOCATION.members["documentChar"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=DocumentCharLocation.deserialize(deserializer)) - - -@dataclass -class CitationLocationDocumentPage: - """ - The page-level location within the document where the cited content is - found. - """ - - value: DocumentPageLocation - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CITATION_LOCATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CITATION_LOCATION.members["documentPage"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=DocumentPageLocation.deserialize(deserializer)) - - -@dataclass -class CitationLocationDocumentChunk: - """ - The chunk-level location within the document where the cited content is - found, typically used for documents that have been segmented into - logical chunks. - """ - - value: DocumentChunkLocation - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CITATION_LOCATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CITATION_LOCATION.members["documentChunk"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=DocumentChunkLocation.deserialize(deserializer)) - - -@dataclass -class CitationLocationSearchResultLocation: - """ - The search result location where the cited content is found, including - the search result index and block positions within the content array. - """ - - value: SearchResultLocation - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CITATION_LOCATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CITATION_LOCATION.members["searchResultLocation"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=SearchResultLocation.deserialize(deserializer)) - - -@dataclass -class CitationLocationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -CitationLocation = Union[ - CitationLocationWeb - | CitationLocationDocumentChar - | CitationLocationDocumentPage - | CitationLocationDocumentChunk - | CitationLocationSearchResultLocation - | CitationLocationUnknown -] -""" -Specifies the precise location within a source document where cited -content can be found. This can include character-level positions, page -numbers, or document chunks depending on the document type and indexing -method. -""" - - -class _CitationLocationDeserializer: - _result: CitationLocation | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> CitationLocation: - self._result = None - deserializer.read_struct(_SCHEMA_CITATION_LOCATION, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(CitationLocationWeb.deserialize(de)) - - case 1: - self._set_result(CitationLocationDocumentChar.deserialize(de)) - - case 2: - self._set_result(CitationLocationDocumentPage.deserialize(de)) - - case 3: - self._set_result(CitationLocationDocumentChunk.deserialize(de)) - - case 4: - self._set_result(CitationLocationSearchResultLocation.deserialize(de)) - - case _: - self._set_result( - CitationLocationUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: CitationLocation) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass -class CitationSourceContentText: - """The text content from the source document that is being cited.""" - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CITATION_SOURCE_CONTENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CITATION_SOURCE_CONTENT.members["text"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string( - _SCHEMA_CITATION_SOURCE_CONTENT.members["text"] - ) - ) - - -@dataclass -class CitationSourceContentUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -CitationSourceContent = Union[CitationSourceContentText | CitationSourceContentUnknown] -""" -Contains the actual text content from a source document that is being -cited or referenced in the model's response. -""" - - -class _CitationSourceContentDeserializer: - _result: CitationSourceContent | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> CitationSourceContent: - self._result = None - deserializer.read_struct(_SCHEMA_CITATION_SOURCE_CONTENT, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(CitationSourceContentText.deserialize(de)) - - case _: - self._set_result( - CitationSourceContentUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: CitationSourceContent) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_citation_source_content_list( - serializer: ShapeSerializer, schema: Schema, value: list[CitationSourceContent] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_citation_source_content_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[CitationSourceContent]: - result: list[CitationSourceContent] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_CitationSourceContentDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class Citation: - """ - Contains information about a citation that references a specific source - document. Citations provide traceability between the model's generated - response and the source documents that informed that response. - """ - - title: str | None = None - """The title or identifier of the source document being cited.""" - - source: str | None = None - """ - The source from the original search result that provided the cited - content. - """ - - source_content: list[CitationSourceContent] | None = None - """ - The specific content from the source document that was referenced or - cited in the generated response. - """ - - location: CitationLocation | None = None - """ - The precise location within the source document where the cited content - can be found, including character positions, page numbers, or chunk - identifiers. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CITATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.title is not None: - serializer.write_string(_SCHEMA_CITATION.members["title"], self.title) - - if self.source is not None: - serializer.write_string(_SCHEMA_CITATION.members["source"], self.source) - - if self.source_content is not None: - _serialize_citation_source_content_list( - serializer, - _SCHEMA_CITATION.members["sourceContent"], - self.source_content, - ) - - if self.location is not None: - serializer.write_struct(_SCHEMA_CITATION.members["location"], self.location) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["title"] = de.read_string(_SCHEMA_CITATION.members["title"]) - - case 1: - kwargs["source"] = de.read_string( - _SCHEMA_CITATION.members["source"] - ) - - case 2: - kwargs["source_content"] = ( - _deserialize_citation_source_content_list( - de, _SCHEMA_CITATION.members["sourceContent"] - ) - ) - - case 3: - kwargs["location"] = _CitationLocationDeserializer().deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CITATION, consumer=_consumer) - return kwargs - - -def _serialize_citations( - serializer: ShapeSerializer, schema: Schema, value: list[Citation] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_citations( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Citation]: - result: list[Citation] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Citation.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass -class CitationGeneratedContentText: - """ - The text content that was generated by the model and is supported by the - associated citation. - """ - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CITATION_GENERATED_CONTENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CITATION_GENERATED_CONTENT.members["text"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string( - _SCHEMA_CITATION_GENERATED_CONTENT.members["text"] - ) - ) - - -@dataclass -class CitationGeneratedContentUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -CitationGeneratedContent = Union[ - CitationGeneratedContentText | CitationGeneratedContentUnknown -] -""" -Contains the generated text content that corresponds to or is supported -by a citation from a source document. -""" - - -class _CitationGeneratedContentDeserializer: - _result: CitationGeneratedContent | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> CitationGeneratedContent: - self._result = None - deserializer.read_struct(_SCHEMA_CITATION_GENERATED_CONTENT, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(CitationGeneratedContentText.deserialize(de)) - - case _: - self._set_result( - CitationGeneratedContentUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: CitationGeneratedContent) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_citation_generated_content_list( - serializer: ShapeSerializer, schema: Schema, value: list[CitationGeneratedContent] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_citation_generated_content_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[CitationGeneratedContent]: - result: list[CitationGeneratedContent] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_CitationGeneratedContentDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CitationsContentBlock: - """ - A content block that contains both generated text and associated - citation information. This block type is returned when document - citations are enabled, providing traceability between the generated - content and the source documents that informed the response. - """ - - content: list[CitationGeneratedContent] | None = None - """The generated content that is supported by the associated citations.""" - - citations: list[Citation] | None = None - """ - An array of citations that reference the source documents used to - generate the associated content. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CITATIONS_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.content is not None: - _serialize_citation_generated_content_list( - serializer, - _SCHEMA_CITATIONS_CONTENT_BLOCK.members["content"], - self.content, - ) - - if self.citations is not None: - _serialize_citations( - serializer, - _SCHEMA_CITATIONS_CONTENT_BLOCK.members["citations"], - self.citations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["content"] = _deserialize_citation_generated_content_list( - de, _SCHEMA_CITATIONS_CONTENT_BLOCK.members["content"] - ) - - case 1: - kwargs["citations"] = _deserialize_citations( - de, _SCHEMA_CITATIONS_CONTENT_BLOCK.members["citations"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CITATIONS_CONTENT_BLOCK, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CitationsConfig: - """ - Configuration settings for enabling and controlling document citations - in Converse API responses. When enabled, the model can include citation - information that links generated content back to specific source - documents. - """ - - enabled: bool - """ - Specifies whether citations from the selected document should be used in - the model's response. When set to true, the model can generate - citations that reference the source documents used to inform the - response. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CITATIONS_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_boolean( - _SCHEMA_CITATIONS_CONFIG.members["enabled"], self.enabled - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["enabled"] = de.read_boolean( - _SCHEMA_CITATIONS_CONFIG.members["enabled"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CITATIONS_CONFIG, consumer=_consumer) - if "enabled" not in kwargs: - kwargs["enabled"] = False - return kwargs - - -class DocumentFormat(UnknownEnumMixin, StrEnum): - PDF = "pdf" - CSV = "csv" - DOC = "doc" - DOCX = "docx" - XLS = "xls" - XLSX = "xlsx" - HTML = "html" - TXT = "txt" - MD = "md" - - -@dataclass -class DocumentContentBlockText: - """The text content of the document.""" - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DOCUMENT_CONTENT_BLOCK.members["text"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string( - _SCHEMA_DOCUMENT_CONTENT_BLOCK.members["text"] - ) - ) - - -@dataclass -class DocumentContentBlockUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -DocumentContentBlock = Union[DocumentContentBlockText | DocumentContentBlockUnknown] -""" -Contains the actual content of a document that can be processed by the -model and potentially cited in the response. -""" - - -class _DocumentContentBlockDeserializer: - _result: DocumentContentBlock | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> DocumentContentBlock: - self._result = None - deserializer.read_struct(_SCHEMA_DOCUMENT_CONTENT_BLOCK, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(DocumentContentBlockText.deserialize(de)) - - case _: - self._set_result( - DocumentContentBlockUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: DocumentContentBlock) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_document_content_blocks( - serializer: ShapeSerializer, schema: Schema, value: list[DocumentContentBlock] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_document_content_blocks( - deserializer: ShapeDeserializer, schema: Schema -) -> list[DocumentContentBlock]: - result: list[DocumentContentBlock] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_DocumentContentBlockDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass -class DocumentSourceBytes: - """ - The raw bytes for the document. If you use an Amazon Web Services SDK, - you don't need to encode the bytes in base64. - """ - - value: bytes - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_blob(_SCHEMA_DOCUMENT_SOURCE.members["bytes"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_blob(_SCHEMA_DOCUMENT_SOURCE.members["bytes"]) - ) - - -@dataclass -class DocumentSourceS3Location: - """ - The location of a document object in an Amazon S3 bucket. To see which - models support S3 uploads, see [Supported models and features for - Converse](https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference-supported-models-features.html). - """ - - value: S3Location - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DOCUMENT_SOURCE.members["s3Location"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=S3Location.deserialize(deserializer)) - - -@dataclass -class DocumentSourceText: - """The text content of the document source.""" - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_DOCUMENT_SOURCE.members["text"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string(_SCHEMA_DOCUMENT_SOURCE.members["text"]) - ) - - -@dataclass -class DocumentSourceContent: - """ - The structured content of the document source, which may include various - content blocks such as text, images, or other document elements. - """ - - value: list[DocumentContentBlock] - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_document_content_blocks( - serializer, _SCHEMA_DOCUMENT_SOURCE.members["content"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_deserialize_document_content_blocks( - deserializer, _SCHEMA_DOCUMENT_SOURCE.members["content"] - ) - ) - - -@dataclass -class DocumentSourceUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -DocumentSource = Union[ - DocumentSourceBytes - | DocumentSourceS3Location - | DocumentSourceText - | DocumentSourceContent - | DocumentSourceUnknown -] -"""Contains the content of a document.""" - - -class _DocumentSourceDeserializer: - _result: DocumentSource | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> DocumentSource: - self._result = None - deserializer.read_struct(_SCHEMA_DOCUMENT_SOURCE, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(DocumentSourceBytes.deserialize(de)) - - case 1: - self._set_result(DocumentSourceS3Location.deserialize(de)) - - case 2: - self._set_result(DocumentSourceText.deserialize(de)) - - case 3: - self._set_result(DocumentSourceContent.deserialize(de)) - - case _: - self._set_result(DocumentSourceUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: DocumentSource) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class DocumentBlock: - """A document to include in a message.""" - - name: str - """ - A name for the document. The name can only contain the following - characters: - - - Alphanumeric characters - - - Whitespace characters (no more than one in a row) - - - Hyphens - - - Parentheses - - - Square brackets - - Note: - This field is vulnerable to prompt injections, because the model might - inadvertently interpret it as instructions. Therefore, we recommend that - you specify a neutral name. - """ - - source: DocumentSource - """Contains the content of the document.""" - - format: str = DocumentFormat("txt") - """The format of a document, or its extension.""" - - context: str | None = None - """ - Contextual information about how the document should be processed or - interpreted by the model when generating citations. - """ - - citations: CitationsConfig | None = None - """ - Configuration settings that control how citations should be generated - for this specific document. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_DOCUMENT_BLOCK.members["format"], self.format) - serializer.write_string(_SCHEMA_DOCUMENT_BLOCK.members["name"], self.name) - serializer.write_struct(_SCHEMA_DOCUMENT_BLOCK.members["source"], self.source) - if self.context is not None: - serializer.write_string( - _SCHEMA_DOCUMENT_BLOCK.members["context"], self.context - ) - - if self.citations is not None: - serializer.write_struct( - _SCHEMA_DOCUMENT_BLOCK.members["citations"], self.citations - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["format"] = DocumentFormat( - de.read_string(_SCHEMA_DOCUMENT_BLOCK.members["format"]) - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_DOCUMENT_BLOCK.members["name"] - ) - - case 2: - kwargs["source"] = _DocumentSourceDeserializer().deserialize(de) - - case 3: - kwargs["context"] = de.read_string( - _SCHEMA_DOCUMENT_BLOCK.members["context"] - ) - - case 4: - kwargs["citations"] = CitationsConfig.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DOCUMENT_BLOCK, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "source" not in kwargs: - kwargs["source"] = DocumentSourceUnknown(tag="") - return kwargs - - -class GuardrailConverseImageFormat(UnknownEnumMixin, StrEnum): - PNG = "png" - JPEG = "jpeg" - - -@dataclass -class GuardrailConverseImageSourceBytes: - """The raw image bytes for the image.""" - - value: bytes - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_CONVERSE_IMAGE_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_blob( - _SCHEMA_GUARDRAIL_CONVERSE_IMAGE_SOURCE.members["bytes"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_blob( - _SCHEMA_GUARDRAIL_CONVERSE_IMAGE_SOURCE.members["bytes"] - ) - ) - - -@dataclass -class GuardrailConverseImageSourceUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -GuardrailConverseImageSource = Union[ - GuardrailConverseImageSourceBytes | GuardrailConverseImageSourceUnknown -] -"""The image source (image bytes) of the guardrail converse image source.""" - - -class _GuardrailConverseImageSourceDeserializer: - _result: GuardrailConverseImageSource | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> GuardrailConverseImageSource: - self._result = None - deserializer.read_struct( - _SCHEMA_GUARDRAIL_CONVERSE_IMAGE_SOURCE, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(GuardrailConverseImageSourceBytes.deserialize(de)) - - case _: - self._set_result( - GuardrailConverseImageSourceUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: GuardrailConverseImageSource) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class GuardrailConverseImageBlock: - """ - An image block that contains images that you want to assess with a - guardrail. - """ - - format: str - """ - The format details for the image type of the guardrail converse image - block. - """ - - source: GuardrailConverseImageSource = field(repr=False) - """The image source (image bytes) of the guardrail converse image block.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_CONVERSE_IMAGE_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GUARDRAIL_CONVERSE_IMAGE_BLOCK.members["format"], self.format - ) - serializer.write_struct( - _SCHEMA_GUARDRAIL_CONVERSE_IMAGE_BLOCK.members["source"], self.source - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["format"] = GuardrailConverseImageFormat( - de.read_string( - _SCHEMA_GUARDRAIL_CONVERSE_IMAGE_BLOCK.members["format"] - ) - ) - - case 1: - kwargs["source"] = ( - _GuardrailConverseImageSourceDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_CONVERSE_IMAGE_BLOCK, consumer=_consumer - ) - if "format" not in kwargs: - kwargs["format"] = GuardrailConverseImageFormat._corrected("") - if "source" not in kwargs: - kwargs["source"] = GuardrailConverseImageSourceUnknown(tag="") - return kwargs - - -class GuardrailConverseContentQualifier(UnknownEnumMixin, StrEnum): - GROUNDING_SOURCE = "grounding_source" - QUERY = "query" - GUARD_CONTENT = "guard_content" - - -def _serialize_guardrail_converse_content_qualifier_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_guardrail_converse_content_qualifier_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append( - GuardrailConverseContentQualifier(d.read_string(member_schema)) - ) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GuardrailConverseTextBlock: - """ - A text block that contains text that you want to assess with a - guardrail. For more information, see - [GuardrailConverseContentBlock](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_GuardrailConverseContentBlock.html). - """ - - text: str - """The text that you want to guard.""" - - qualifiers: list[str] | None = None - """The qualifier details for the guardrails contextual grounding filter.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_CONVERSE_TEXT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GUARDRAIL_CONVERSE_TEXT_BLOCK.members["text"], self.text - ) - if self.qualifiers is not None: - _serialize_guardrail_converse_content_qualifier_list( - serializer, - _SCHEMA_GUARDRAIL_CONVERSE_TEXT_BLOCK.members["qualifiers"], - self.qualifiers, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["text"] = de.read_string( - _SCHEMA_GUARDRAIL_CONVERSE_TEXT_BLOCK.members["text"] - ) - - case 1: - kwargs["qualifiers"] = ( - _deserialize_guardrail_converse_content_qualifier_list( - de, - _SCHEMA_GUARDRAIL_CONVERSE_TEXT_BLOCK.members["qualifiers"], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_CONVERSE_TEXT_BLOCK, consumer=_consumer - ) - if "text" not in kwargs: - kwargs["text"] = "" - return kwargs - - -@dataclass -class GuardrailConverseContentBlockText: - """The text to guard.""" - - value: GuardrailConverseTextBlock - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_CONVERSE_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GUARDRAIL_CONVERSE_CONTENT_BLOCK.members["text"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=GuardrailConverseTextBlock.deserialize(deserializer)) - - -@dataclass -class GuardrailConverseContentBlockImage: - """Image within converse content block to be evaluated by the guardrail.""" - - value: GuardrailConverseImageBlock - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_CONVERSE_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GUARDRAIL_CONVERSE_CONTENT_BLOCK.members["image"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=GuardrailConverseImageBlock.deserialize(deserializer)) - - -@dataclass -class GuardrailConverseContentBlockUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -GuardrailConverseContentBlock = Union[ - GuardrailConverseContentBlockText - | GuardrailConverseContentBlockImage - | GuardrailConverseContentBlockUnknown -] -""" -A content block for selective guarding with the -[Converse](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html) -or -[ConverseStream](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html) -API operations. -""" - - -class _GuardrailConverseContentBlockDeserializer: - _result: GuardrailConverseContentBlock | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> GuardrailConverseContentBlock: - self._result = None - deserializer.read_struct( - _SCHEMA_GUARDRAIL_CONVERSE_CONTENT_BLOCK, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(GuardrailConverseContentBlockText.deserialize(de)) - - case 1: - self._set_result(GuardrailConverseContentBlockImage.deserialize(de)) - - case _: - self._set_result( - GuardrailConverseContentBlockUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: GuardrailConverseContentBlock) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class ImageFormat(UnknownEnumMixin, StrEnum): - PNG = "png" - JPEG = "jpeg" - GIF = "gif" - WEBP = "webp" - - -@dataclass -class ImageSourceBytes: - """ - The raw image bytes for the image. If you use an AWS SDK, you don't - need to encode the image bytes in base64. - """ - - value: bytes - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IMAGE_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_blob(_SCHEMA_IMAGE_SOURCE.members["bytes"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=deserializer.read_blob(_SCHEMA_IMAGE_SOURCE.members["bytes"])) - - -@dataclass -class ImageSourceS3Location: - """ - The location of an image object in an Amazon S3 bucket. To see which - models support S3 uploads, see [Supported models and features for - Converse](https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference-supported-models-features.html). - """ - - value: S3Location - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IMAGE_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IMAGE_SOURCE.members["s3Location"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=S3Location.deserialize(deserializer)) - - -@dataclass -class ImageSourceUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ImageSource = Union[ImageSourceBytes | ImageSourceS3Location | ImageSourceUnknown] -"""The source for an image.""" - - -class _ImageSourceDeserializer: - _result: ImageSource | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> ImageSource: - self._result = None - deserializer.read_struct(_SCHEMA_IMAGE_SOURCE, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(ImageSourceBytes.deserialize(de)) - - case 1: - self._set_result(ImageSourceS3Location.deserialize(de)) - - case _: - self._set_result(ImageSourceUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: ImageSource) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class ImageBlock: - """Image content for a message.""" - - format: str - """The format of the image.""" - - source: ImageSource = field(repr=False) - """The source for the image.""" - - error: ErrorBlock | None = field(repr=False, default=None) - """ - Error information if the image block could not be processed or contains - invalid data. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IMAGE_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_IMAGE_BLOCK.members["format"], self.format) - serializer.write_struct(_SCHEMA_IMAGE_BLOCK.members["source"], self.source) - if self.error is not None: - serializer.write_struct(_SCHEMA_IMAGE_BLOCK.members["error"], self.error) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["format"] = ImageFormat( - de.read_string(_SCHEMA_IMAGE_BLOCK.members["format"]) - ) - - case 1: - kwargs["source"] = _ImageSourceDeserializer().deserialize(de) - - case 2: - kwargs["error"] = ErrorBlock.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_IMAGE_BLOCK, consumer=_consumer) - if "format" not in kwargs: - kwargs["format"] = ImageFormat._corrected("") - if "source" not in kwargs: - kwargs["source"] = ImageSourceUnknown(tag="") - return kwargs - - -@dataclass(kw_only=True) -class ReasoningTextBlock: - """Contains the reasoning that the model used to return the output.""" - - text: str - """The reasoning that the model used to return the output.""" - - signature: str | None = None - """ - A token that verifies that the reasoning text was generated by the - model. If you pass a reasoning block back to the API in a multi-turn - conversation, include the text and its signature unmodified. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REASONING_TEXT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_REASONING_TEXT_BLOCK.members["text"], self.text) - if self.signature is not None: - serializer.write_string( - _SCHEMA_REASONING_TEXT_BLOCK.members["signature"], self.signature - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["text"] = de.read_string( - _SCHEMA_REASONING_TEXT_BLOCK.members["text"] - ) - - case 1: - kwargs["signature"] = de.read_string( - _SCHEMA_REASONING_TEXT_BLOCK.members["signature"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_REASONING_TEXT_BLOCK, consumer=_consumer) - if "text" not in kwargs: - kwargs["text"] = "" - return kwargs - - -@dataclass -class ReasoningContentBlockReasoningText: - """The reasoning that the model used to return the output.""" - - value: ReasoningTextBlock - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REASONING_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_REASONING_CONTENT_BLOCK.members["reasoningText"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ReasoningTextBlock.deserialize(deserializer)) - - -@dataclass -class ReasoningContentBlockRedactedContent: - """ - The content in the reasoning that was encrypted by the model provider - for safety reasons. The encryption doesn't affect the quality of - responses. - """ - - value: bytes - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REASONING_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_blob( - _SCHEMA_REASONING_CONTENT_BLOCK.members["redactedContent"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_blob( - _SCHEMA_REASONING_CONTENT_BLOCK.members["redactedContent"] - ) - ) - - -@dataclass -class ReasoningContentBlockUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ReasoningContentBlock = Union[ - ReasoningContentBlockReasoningText - | ReasoningContentBlockRedactedContent - | ReasoningContentBlockUnknown -] -""" -Contains content regarding the reasoning that is carried out by the -model with respect to the content in the content block. Reasoning refers -to a Chain of Thought (CoT) that the model generates to enhance the -accuracy of its final response. -""" - - -class _ReasoningContentBlockDeserializer: - _result: ReasoningContentBlock | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> ReasoningContentBlock: - self._result = None - deserializer.read_struct(_SCHEMA_REASONING_CONTENT_BLOCK, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(ReasoningContentBlockReasoningText.deserialize(de)) - - case 1: - self._set_result(ReasoningContentBlockRedactedContent.deserialize(de)) - - case _: - self._set_result( - ReasoningContentBlockUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: ReasoningContentBlock) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class SearchResultContentBlock: - """A block within a search result that contains the content.""" - - text: str - """The actual text content""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SEARCH_RESULT_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SEARCH_RESULT_CONTENT_BLOCK.members["text"], self.text - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["text"] = de.read_string( - _SCHEMA_SEARCH_RESULT_CONTENT_BLOCK.members["text"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SEARCH_RESULT_CONTENT_BLOCK, consumer=_consumer - ) - if "text" not in kwargs: - kwargs["text"] = "" - return kwargs - - -def _serialize_search_result_content_blocks( - serializer: ShapeSerializer, schema: Schema, value: list[SearchResultContentBlock] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_search_result_content_blocks( - deserializer: ShapeDeserializer, schema: Schema -) -> list[SearchResultContentBlock]: - result: list[SearchResultContentBlock] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(SearchResultContentBlock.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class SearchResultBlock: - """ - A search result block that enables natural citations with proper source - attribution for retrieved content. - - Note: - This field is only supported by Anthropic Claude Opus 4.1, Opus 4, - Sonnet 4.5, Sonnet 4, Sonnet 3.7, and 3.5 Haiku models. - """ - - source: str - """The source URL or identifier for the content.""" - - title: str - """A descriptive title for the search result.""" - - content: list[SearchResultContentBlock] - """An array of search result content block.""" - - citations: CitationsConfig | None = None - """Configuration setting for citations""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SEARCH_RESULT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SEARCH_RESULT_BLOCK.members["source"], self.source - ) - serializer.write_string( - _SCHEMA_SEARCH_RESULT_BLOCK.members["title"], self.title - ) - _serialize_search_result_content_blocks( - serializer, _SCHEMA_SEARCH_RESULT_BLOCK.members["content"], self.content - ) - if self.citations is not None: - serializer.write_struct( - _SCHEMA_SEARCH_RESULT_BLOCK.members["citations"], self.citations - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["source"] = de.read_string( - _SCHEMA_SEARCH_RESULT_BLOCK.members["source"] - ) - - case 1: - kwargs["title"] = de.read_string( - _SCHEMA_SEARCH_RESULT_BLOCK.members["title"] - ) - - case 2: - kwargs["content"] = _deserialize_search_result_content_blocks( - de, _SCHEMA_SEARCH_RESULT_BLOCK.members["content"] - ) - - case 3: - kwargs["citations"] = CitationsConfig.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SEARCH_RESULT_BLOCK, consumer=_consumer) - if "source" not in kwargs: - kwargs["source"] = "" - if "title" not in kwargs: - kwargs["title"] = "" - if "content" not in kwargs: - kwargs["content"] = [] - return kwargs - - -@dataclass(kw_only=True) -class ToolReference: - """ - A reference to a tool in the tool configuration. Used with - `ToolAdditionBlock` and `ToolRemovalBlock` to identify which tool to add - or remove mid-conversation. - """ - - type: str | None = None - """The type of tool reference.""" - - name: str | None = None - """ - The name of the tool. Must match the name of a tool declared in the - top-level tool configuration. - """ - - server_name: str | None = None - """ - The name of the MCP server that provides the tool. Required when - referencing an MCP tool. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_REFERENCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string(_SCHEMA_TOOL_REFERENCE.members["type"], self.type) - - if self.name is not None: - serializer.write_string(_SCHEMA_TOOL_REFERENCE.members["name"], self.name) - - if self.server_name is not None: - serializer.write_string( - _SCHEMA_TOOL_REFERENCE.members["serverName"], self.server_name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_TOOL_REFERENCE.members["type"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_TOOL_REFERENCE.members["name"] - ) - - case 2: - kwargs["server_name"] = de.read_string( - _SCHEMA_TOOL_REFERENCE.members["serverName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TOOL_REFERENCE, consumer=_consumer) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls() - - -@dataclass(kw_only=True) -class ToolAdditionBlock: - """ - A content block for adding a tool to the available tool set - mid-conversation. Each block references a single tool via its `tool` - field. Use within a `system` role message to make a tool available - without re-sending the full tool configuration. - """ - - tool: ToolReference - """A reference to the tool to add to the available tool set.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_ADDITION_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_ADDITION_BLOCK.members["tool"], self.tool) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["tool"] = ToolReference.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TOOL_ADDITION_BLOCK, consumer=_consumer) - if "tool" not in kwargs: - kwargs["tool"] = ToolReference._smithy_default() - return kwargs - - -@dataclass(kw_only=True) -class ToolRemovalBlock: - """ - A content block for removing a tool from the available tool set - mid-conversation. Each block references a single tool via its `tool` - field. Use within a `system` role message to remove a tool without - re-sending the full tool configuration. - """ - - tool: ToolReference - """A reference to the tool to remove from the available tool set.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_REMOVAL_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_REMOVAL_BLOCK.members["tool"], self.tool) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["tool"] = ToolReference.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TOOL_REMOVAL_BLOCK, consumer=_consumer) - if "tool" not in kwargs: - kwargs["tool"] = ToolReference._smithy_default() - return kwargs - - -class VideoFormat(UnknownEnumMixin, StrEnum): - MKV = "mkv" - MOV = "mov" - MP4 = "mp4" - WEBM = "webm" - FLV = "flv" - MPEG = "mpeg" - MPG = "mpg" - WMV = "wmv" - THREE_GP = "three_gp" - - -@dataclass -class VideoSourceBytes: - """Video content encoded in base64.""" - - value: bytes - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VIDEO_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_blob(_SCHEMA_VIDEO_SOURCE.members["bytes"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=deserializer.read_blob(_SCHEMA_VIDEO_SOURCE.members["bytes"])) - - -@dataclass -class VideoSourceS3Location: - """ - The location of a video object in an Amazon S3 bucket. To see which - models support S3 uploads, see [Supported models and features for - Converse](https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference-supported-models-features.html). - """ - - value: S3Location - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VIDEO_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VIDEO_SOURCE.members["s3Location"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=S3Location.deserialize(deserializer)) - - -@dataclass -class VideoSourceUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -VideoSource = Union[VideoSourceBytes | VideoSourceS3Location | VideoSourceUnknown] -""" -A video source. You can upload a smaller video as a base64-encoded -string as long as the encoded file is less than 25MB. You can also -transfer videos up to 1GB in size from an S3 bucket. -""" - - -class _VideoSourceDeserializer: - _result: VideoSource | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> VideoSource: - self._result = None - deserializer.read_struct(_SCHEMA_VIDEO_SOURCE, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(VideoSourceBytes.deserialize(de)) - - case 1: - self._set_result(VideoSourceS3Location.deserialize(de)) - - case _: - self._set_result(VideoSourceUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: VideoSource) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class VideoBlock: - """A video block.""" - - format: str - """The block's format.""" - - source: VideoSource - """The block's source.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VIDEO_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_VIDEO_BLOCK.members["format"], self.format) - serializer.write_struct(_SCHEMA_VIDEO_BLOCK.members["source"], self.source) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["format"] = VideoFormat( - de.read_string(_SCHEMA_VIDEO_BLOCK.members["format"]) - ) - - case 1: - kwargs["source"] = _VideoSourceDeserializer().deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VIDEO_BLOCK, consumer=_consumer) - if "format" not in kwargs: - kwargs["format"] = VideoFormat._corrected("") - if "source" not in kwargs: - kwargs["source"] = VideoSourceUnknown(tag="") - return kwargs - - -@dataclass -class ToolResultContentBlockJson: - """A tool result that is JSON format data.""" - - value: Document - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_RESULT_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_document( - _SCHEMA_TOOL_RESULT_CONTENT_BLOCK.members["json"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_document( - _SCHEMA_TOOL_RESULT_CONTENT_BLOCK.members["json"] - ) - ) - - -@dataclass -class ToolResultContentBlockText: - """A tool result that is text.""" - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_RESULT_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_TOOL_RESULT_CONTENT_BLOCK.members["text"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string( - _SCHEMA_TOOL_RESULT_CONTENT_BLOCK.members["text"] - ) - ) - - -@dataclass -class ToolResultContentBlockImage: - """ - A tool result that is an image. - - Note: - This field is only supported by Amazon Nova and Anthropic Claude 3 and 4 - models. - """ - - value: ImageBlock - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_RESULT_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_TOOL_RESULT_CONTENT_BLOCK.members["image"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ImageBlock.deserialize(deserializer)) - - -@dataclass -class ToolResultContentBlockDocument: - """A tool result that is a document.""" - - value: DocumentBlock - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_RESULT_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_TOOL_RESULT_CONTENT_BLOCK.members["document"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=DocumentBlock.deserialize(deserializer)) - - -@dataclass -class ToolResultContentBlockVideo: - """A tool result that is video.""" - - value: VideoBlock - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_RESULT_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_TOOL_RESULT_CONTENT_BLOCK.members["video"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=VideoBlock.deserialize(deserializer)) - - -@dataclass -class ToolResultContentBlockSearchResult: - """A tool result that is a search result.""" - - value: SearchResultBlock - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_RESULT_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_TOOL_RESULT_CONTENT_BLOCK.members["searchResult"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=SearchResultBlock.deserialize(deserializer)) - - -@dataclass -class ToolResultContentBlockUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ToolResultContentBlock = Union[ - ToolResultContentBlockJson - | ToolResultContentBlockText - | ToolResultContentBlockImage - | ToolResultContentBlockDocument - | ToolResultContentBlockVideo - | ToolResultContentBlockSearchResult - | ToolResultContentBlockUnknown -] -""" -The tool result content block. For more information, see [Call a tool -with the Converse -API](https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html) -in the Amazon Bedrock User Guide. -""" - - -class _ToolResultContentBlockDeserializer: - _result: ToolResultContentBlock | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> ToolResultContentBlock: - self._result = None - deserializer.read_struct(_SCHEMA_TOOL_RESULT_CONTENT_BLOCK, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(ToolResultContentBlockJson.deserialize(de)) - - case 1: - self._set_result(ToolResultContentBlockText.deserialize(de)) - - case 2: - self._set_result(ToolResultContentBlockImage.deserialize(de)) - - case 3: - self._set_result(ToolResultContentBlockDocument.deserialize(de)) - - case 4: - self._set_result(ToolResultContentBlockVideo.deserialize(de)) - - case 5: - self._set_result(ToolResultContentBlockSearchResult.deserialize(de)) - - case _: - self._set_result( - ToolResultContentBlockUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: ToolResultContentBlock) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_tool_result_content_blocks( - serializer: ShapeSerializer, schema: Schema, value: list[ToolResultContentBlock] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_tool_result_content_blocks( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ToolResultContentBlock]: - result: list[ToolResultContentBlock] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_ToolResultContentBlockDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class ToolResultStatus(UnknownEnumMixin, StrEnum): - SUCCESS = "success" - ERROR = "error" - - -@dataclass(kw_only=True) -class ToolResultBlock: - """ - A tool result block that contains the results for a tool request that - the model previously made. For more information, see [Call a tool with - the Converse - API](https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html) - in the Amazon Bedrock User Guide. - """ - - tool_use_id: str - """The ID of the tool request that this is the result for.""" - - content: list[ToolResultContentBlock] - """The content for tool result content block.""" - - status: str | None = None - """ - The status for the tool result content block. - - Note: - This field is only supported by Amazon Nova and Anthropic Claude 3 and 4 - models. - """ - - type: str | None = None - """The type for the tool result content block.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_RESULT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_TOOL_RESULT_BLOCK.members["toolUseId"], self.tool_use_id - ) - _serialize_tool_result_content_blocks( - serializer, _SCHEMA_TOOL_RESULT_BLOCK.members["content"], self.content - ) - if self.status is not None: - serializer.write_string( - _SCHEMA_TOOL_RESULT_BLOCK.members["status"], self.status - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_TOOL_RESULT_BLOCK.members["type"], self.type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["tool_use_id"] = de.read_string( - _SCHEMA_TOOL_RESULT_BLOCK.members["toolUseId"] - ) - - case 1: - kwargs["content"] = _deserialize_tool_result_content_blocks( - de, _SCHEMA_TOOL_RESULT_BLOCK.members["content"] - ) - - case 2: - kwargs["status"] = ToolResultStatus( - de.read_string(_SCHEMA_TOOL_RESULT_BLOCK.members["status"]) - ) - - case 3: - kwargs["type"] = de.read_string( - _SCHEMA_TOOL_RESULT_BLOCK.members["type"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TOOL_RESULT_BLOCK, consumer=_consumer) - if "tool_use_id" not in kwargs: - kwargs["tool_use_id"] = "" - if "content" not in kwargs: - kwargs["content"] = [] - return kwargs - - -class ToolUseType(UnknownEnumMixin, StrEnum): - SERVER_TOOL_USE = "server_tool_use" - - -@dataclass(kw_only=True) -class ToolUseBlock: - """ - A tool use content block. Contains information about a tool that the - model is requesting be run., The model uses the result from the tool to - generate a response. For more information, see [Call a tool with the - Converse - API](https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html) - in the Amazon Bedrock User Guide. - """ - - tool_use_id: str - """The ID for the tool request.""" - - name: str - """The name of the tool that the model wants to use.""" - - input: Document - """The input to pass to the tool.""" - - type: str | None = None - """The type for the tool request.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_USE_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_TOOL_USE_BLOCK.members["toolUseId"], self.tool_use_id - ) - serializer.write_string(_SCHEMA_TOOL_USE_BLOCK.members["name"], self.name) - serializer.write_document(_SCHEMA_TOOL_USE_BLOCK.members["input"], self.input) - if self.type is not None: - serializer.write_string(_SCHEMA_TOOL_USE_BLOCK.members["type"], self.type) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["tool_use_id"] = de.read_string( - _SCHEMA_TOOL_USE_BLOCK.members["toolUseId"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_TOOL_USE_BLOCK.members["name"] - ) - - case 2: - kwargs["input"] = de.read_document( - _SCHEMA_TOOL_USE_BLOCK.members["input"] - ) - - case 3: - kwargs["type"] = ToolUseType( - de.read_string(_SCHEMA_TOOL_USE_BLOCK.members["type"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TOOL_USE_BLOCK, consumer=_consumer) - if "tool_use_id" not in kwargs: - kwargs["tool_use_id"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "input" not in kwargs: - kwargs["input"] = Document(None) - return kwargs - - -@dataclass -class ContentBlockText: - """Text to include in the message.""" - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_CONTENT_BLOCK.members["text"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string(_SCHEMA_CONTENT_BLOCK.members["text"]) - ) - - -@dataclass -class ContentBlockImage: - """ - Image to include in the message. - - Note: - This field is only supported by Anthropic Claude 3 models. - """ - - value: ImageBlock - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT_BLOCK.members["image"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ImageBlock.deserialize(deserializer)) - - -@dataclass -class ContentBlockDocument: - """A document to include in the message.""" - - value: DocumentBlock - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT_BLOCK.members["document"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=DocumentBlock.deserialize(deserializer)) - - -@dataclass -class ContentBlockVideo: - """Video to include in the message.""" - - value: VideoBlock - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT_BLOCK.members["video"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=VideoBlock.deserialize(deserializer)) - - -@dataclass -class ContentBlockAudio: - """An audio content block containing audio data in the conversation.""" - - value: AudioBlock - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT_BLOCK.members["audio"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=AudioBlock.deserialize(deserializer)) - - -@dataclass -class ContentBlockToolUse: - """Information about a tool use request from a model.""" - - value: ToolUseBlock - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT_BLOCK.members["toolUse"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ToolUseBlock.deserialize(deserializer)) - - -@dataclass -class ContentBlockToolResult: - """The result for a tool request that a model makes.""" - - value: ToolResultBlock - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT_BLOCK.members["toolResult"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ToolResultBlock.deserialize(deserializer)) - - -@dataclass -class ContentBlockGuardContent: - """ - Contains the content to assess with the guardrail. If you don't specify - `guardContent` in a call to the Converse API, the guardrail (if passed - in the Converse API) assesses the entire message. - - For more information, see *Use a guardrail with the Converse API* in the - *Amazon Bedrock User Guide*. - """ - - value: GuardrailConverseContentBlock - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CONTENT_BLOCK.members["guardContent"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_GuardrailConverseContentBlockDeserializer().deserialize(deserializer) - ) - - -@dataclass -class ContentBlockCachePoint: - """CachePoint to include in the message.""" - - value: CachePointBlock - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT_BLOCK.members["cachePoint"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=CachePointBlock.deserialize(deserializer)) - - -@dataclass -class ContentBlockReasoningContent: - """ - Contains content regarding the reasoning that is carried out by the - model. Reasoning refers to a Chain of Thought (CoT) that the model - generates to enhance the accuracy of its final response. - """ - - value: ReasoningContentBlock - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CONTENT_BLOCK.members["reasoningContent"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=_ReasoningContentBlockDeserializer().deserialize(deserializer)) - - -@dataclass -class ContentBlockCitationsContent: - """ - A content block that contains both generated text and associated - citation information, providing traceability between the response and - source documents. - """ - - value: CitationsContentBlock - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CONTENT_BLOCK.members["citationsContent"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=CitationsContentBlock.deserialize(deserializer)) - - -@dataclass -class ContentBlockSearchResult: - """Search result to include in the message.""" - - value: SearchResultBlock - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CONTENT_BLOCK.members["searchResult"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=SearchResultBlock.deserialize(deserializer)) - - -@dataclass -class ContentBlockToolAddition: - """ - A content block for adding a tool to the available tool set - mid-conversation. Each block references a single tool via its `tool` - field. Use within a `system` role message to make a tool available - without re-sending the full tool configuration. - """ - - value: ToolAdditionBlock - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CONTENT_BLOCK.members["toolAddition"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ToolAdditionBlock.deserialize(deserializer)) - - -@dataclass -class ContentBlockToolRemoval: - """ - A content block for removing a tool from the available tool set - mid-conversation. Each block references a single tool via its `tool` - field. Use within a `system` role message to remove a tool without - re-sending the full tool configuration. - """ - - value: ToolRemovalBlock - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CONTENT_BLOCK.members["toolRemoval"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ToolRemovalBlock.deserialize(deserializer)) - - -@dataclass -class ContentBlockUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ContentBlock = Union[ - ContentBlockText - | ContentBlockImage - | ContentBlockDocument - | ContentBlockVideo - | ContentBlockAudio - | ContentBlockToolUse - | ContentBlockToolResult - | ContentBlockGuardContent - | ContentBlockCachePoint - | ContentBlockReasoningContent - | ContentBlockCitationsContent - | ContentBlockSearchResult - | ContentBlockToolAddition - | ContentBlockToolRemoval - | ContentBlockUnknown -] -""" -A block of content for a message that you pass to, or receive from, a -model with the -[Converse](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html) -or -[ConverseStream](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html) -API operations. -""" - - -class _ContentBlockDeserializer: - _result: ContentBlock | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> ContentBlock: - self._result = None - deserializer.read_struct(_SCHEMA_CONTENT_BLOCK, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(ContentBlockText.deserialize(de)) - - case 1: - self._set_result(ContentBlockImage.deserialize(de)) - - case 2: - self._set_result(ContentBlockDocument.deserialize(de)) - - case 3: - self._set_result(ContentBlockVideo.deserialize(de)) - - case 4: - self._set_result(ContentBlockAudio.deserialize(de)) - - case 5: - self._set_result(ContentBlockToolUse.deserialize(de)) - - case 6: - self._set_result(ContentBlockToolResult.deserialize(de)) - - case 7: - self._set_result(ContentBlockGuardContent.deserialize(de)) - - case 8: - self._set_result(ContentBlockCachePoint.deserialize(de)) - - case 9: - self._set_result(ContentBlockReasoningContent.deserialize(de)) - - case 10: - self._set_result(ContentBlockCitationsContent.deserialize(de)) - - case 11: - self._set_result(ContentBlockSearchResult.deserialize(de)) - - case 12: - self._set_result(ContentBlockToolAddition.deserialize(de)) - - case 13: - self._set_result(ContentBlockToolRemoval.deserialize(de)) - - case _: - self._set_result(ContentBlockUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: ContentBlock) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_content_blocks( - serializer: ShapeSerializer, schema: Schema, value: list[ContentBlock] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_content_blocks( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ContentBlock]: - result: list[ContentBlock] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_ContentBlockDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class ConversationRole(UnknownEnumMixin, StrEnum): - USER = "user" - ASSISTANT = "assistant" - SYSTEM = "system" - - -@dataclass(kw_only=True) -class Message: - """ - A message input, or returned from, a call to - [Converse](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html) - or - [ConverseStream](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html). - """ - - role: str - """The role that the message plays in the message.""" - - content: list[ContentBlock] - """ - The message content. Note the following restrictions: - - - You can include up to 20 images. Each image's size, height, and width - must be no more than 3.75 MB, 8000 px, and 8000 px, respectively. - - - You can include up to five documents. Each document's size must be no - more than 4.5 MB. - - - If you include a `ContentBlock` with a `document` field in the array, - you must also include a `ContentBlock` with a `text` field. - - - You can only include images and documents if the `role` is `user`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MESSAGE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_MESSAGE.members["role"], self.role) - _serialize_content_blocks( - serializer, _SCHEMA_MESSAGE.members["content"], self.content - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["role"] = ConversationRole( - de.read_string(_SCHEMA_MESSAGE.members["role"]) - ) - - case 1: - kwargs["content"] = _deserialize_content_blocks( - de, _SCHEMA_MESSAGE.members["content"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MESSAGE, consumer=_consumer) - if "role" not in kwargs: - kwargs["role"] = ConversationRole._corrected("") - if "content" not in kwargs: - kwargs["content"] = [] - return kwargs - - -def _serialize_messages( - serializer: ShapeSerializer, schema: Schema, value: list[Message] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_messages( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Message]: - result: list[Message] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Message.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class JsonSchemaDefinition: - """JSON schema structured output format options.""" - - schema: str - """ - The JSON schema to constrain the model's output. For more information, - see [JSON Schema - Reference](https://json-schema.org/understanding-json-schema/reference). - """ - - name: str | None = None - """The name of the JSON schema.""" - - description: str | None = None - """A description of the JSON schema.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_JSON_SCHEMA_DEFINITION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_JSON_SCHEMA_DEFINITION.members["schema"], self.schema - ) - if self.name is not None: - serializer.write_string( - _SCHEMA_JSON_SCHEMA_DEFINITION.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_JSON_SCHEMA_DEFINITION.members["description"], self.description - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["schema"] = de.read_string( - _SCHEMA_JSON_SCHEMA_DEFINITION.members["schema"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_JSON_SCHEMA_DEFINITION.members["name"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_JSON_SCHEMA_DEFINITION.members["description"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_JSON_SCHEMA_DEFINITION, consumer=_consumer) - if "schema" not in kwargs: - kwargs["schema"] = "" - return kwargs - - -@dataclass -class OutputFormatStructureJsonSchema: - """A JSON schema structure that the model's output must adhere to.""" - - value: JsonSchemaDefinition - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OUTPUT_FORMAT_STRUCTURE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_OUTPUT_FORMAT_STRUCTURE.members["jsonSchema"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=JsonSchemaDefinition.deserialize(deserializer)) - - -@dataclass -class OutputFormatStructureUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -OutputFormatStructure = Union[ - OutputFormatStructureJsonSchema | OutputFormatStructureUnknown -] -"""The structure that the model's output must adhere to.""" - - -class _OutputFormatStructureDeserializer: - _result: OutputFormatStructure | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> OutputFormatStructure: - self._result = None - deserializer.read_struct(_SCHEMA_OUTPUT_FORMAT_STRUCTURE, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(OutputFormatStructureJsonSchema.deserialize(de)) - - case _: - self._set_result( - OutputFormatStructureUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: OutputFormatStructure) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class OutputFormatType(UnknownEnumMixin, StrEnum): - """ - The type of structured output format. Available options are: - json_schema. - """ - - JSON_SCHEMA = "json_schema" - - -@dataclass(kw_only=True) -class OutputFormat: - """Structured output parameters to control the model's response.""" - - type: str - """The type of structured output format.""" - - structure: OutputFormatStructure = field(repr=False) - """The structure that the model's output must adhere to.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OUTPUT_FORMAT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_OUTPUT_FORMAT.members["type"], self.type) - serializer.write_struct( - _SCHEMA_OUTPUT_FORMAT.members["structure"], self.structure - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = OutputFormatType( - de.read_string(_SCHEMA_OUTPUT_FORMAT.members["type"]) - ) - - case 1: - kwargs["structure"] = ( - _OutputFormatStructureDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_OUTPUT_FORMAT, consumer=_consumer) - if "type" not in kwargs: - kwargs["type"] = OutputFormatType._corrected("") - if "structure" not in kwargs: - kwargs["structure"] = OutputFormatStructureUnknown(tag="") - return kwargs - - -@dataclass(kw_only=True) -class OutputConfig: - """ - Output configuration for a model response in a call to - [Converse](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html) - or - [ConverseStream](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html). - """ - - text_format: OutputFormat | None = None - """Structured output parameters to control the model's text response.""" - - effort: str | None = None - """ - The effort level for the model to use when generating a response. Higher - effort levels allow the model to spend more time reasoning before - responding. Supported values are `low`, `medium`, `high`, `xhigh`, and - `max`. - - Note: - When extended thinking is disabled, the effort level is capped at - `high`. Use effort `high` or below, or enable thinking to use higher - effort levels. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OUTPUT_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.text_format is not None: - serializer.write_struct( - _SCHEMA_OUTPUT_CONFIG.members["textFormat"], self.text_format - ) - - if self.effort is not None: - serializer.write_string( - _SCHEMA_OUTPUT_CONFIG.members["effort"], self.effort - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["text_format"] = OutputFormat.deserialize(de) - - case 1: - kwargs["effort"] = de.read_string( - _SCHEMA_OUTPUT_CONFIG.members["effort"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_OUTPUT_CONFIG, consumer=_consumer) - return kwargs - - -class PerformanceConfigLatency(UnknownEnumMixin, StrEnum): - STANDARD = "standard" - OPTIMIZED = "optimized" - - -@dataclass(kw_only=True) -class PerformanceConfiguration: - """Performance settings for a model.""" - - latency: str = PerformanceConfigLatency("standard") - """To use a latency-optimized version of the model, set to `optimized`.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PERFORMANCE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_PERFORMANCE_CONFIGURATION.members["latency"], self.latency - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["latency"] = PerformanceConfigLatency( - de.read_string( - _SCHEMA_PERFORMANCE_CONFIGURATION.members["latency"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PERFORMANCE_CONFIGURATION, consumer=_consumer) - return kwargs - - -@dataclass -class PromptVariableValuesText: - """The text value that the variable maps to.""" - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PROMPT_VARIABLE_VALUES, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_PROMPT_VARIABLE_VALUES.members["text"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string( - _SCHEMA_PROMPT_VARIABLE_VALUES.members["text"] - ) - ) - - -@dataclass -class PromptVariableValuesUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -PromptVariableValues = Union[PromptVariableValuesText | PromptVariableValuesUnknown] -""" -Contains a map of variables in a prompt from Prompt management to an -object containing the values to fill in for them when running model -invocation. For more information, see [How Prompt management -works](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-how.html). -""" - - -class _PromptVariableValuesDeserializer: - _result: PromptVariableValues | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> PromptVariableValues: - self._result = None - deserializer.read_struct(_SCHEMA_PROMPT_VARIABLE_VALUES, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(PromptVariableValuesText.deserialize(de)) - - case _: - self._set_result( - PromptVariableValuesUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: PromptVariableValues) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_prompt_variable_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, PromptVariableValues] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_struct(value_schema, v)) - - -def _deserialize_prompt_variable_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, PromptVariableValues]: - result: dict[str, PromptVariableValues] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = _PromptVariableValuesDeserializer().deserialize(d) - - deserializer.read_map(schema, _read_value) - return result - - -def _serialize_request_metadata( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_request_metadata( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -class ServiceTierType(UnknownEnumMixin, StrEnum): - PRIORITY = "priority" - DEFAULT = "default" - FLEX = "flex" - RESERVED = "reserved" - - -@dataclass(kw_only=True) -class ServiceTier: - """ - Specifies the processing tier configuration used for serving the - request. - """ - - type: str - """Specifies the processing tier type used for serving the request.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SERVICE_TIER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_SERVICE_TIER.members["type"], self.type) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = ServiceTierType( - de.read_string(_SCHEMA_SERVICE_TIER.members["type"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SERVICE_TIER, consumer=_consumer) - if "type" not in kwargs: - kwargs["type"] = ServiceTierType._corrected("") - return kwargs - - -@dataclass -class SystemContentBlockText: - """A system prompt for the model.""" - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SYSTEM_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SYSTEM_CONTENT_BLOCK.members["text"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string(_SCHEMA_SYSTEM_CONTENT_BLOCK.members["text"]) - ) - - -@dataclass -class SystemContentBlockGuardContent: - """ - A content block to assess with the guardrail. Use with the - [Converse](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html) - or - [ConverseStream](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html) - API operations. - - For more information, see *Use a guardrail with the Converse API* in the - *Amazon Bedrock User Guide*. - """ - - value: GuardrailConverseContentBlock - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SYSTEM_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_SYSTEM_CONTENT_BLOCK.members["guardContent"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_GuardrailConverseContentBlockDeserializer().deserialize(deserializer) - ) - - -@dataclass -class SystemContentBlockCachePoint: - """CachePoint to include in the system prompt.""" - - value: CachePointBlock - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SYSTEM_CONTENT_BLOCK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_SYSTEM_CONTENT_BLOCK.members["cachePoint"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=CachePointBlock.deserialize(deserializer)) - - -@dataclass -class SystemContentBlockUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -SystemContentBlock = Union[ - SystemContentBlockText - | SystemContentBlockGuardContent - | SystemContentBlockCachePoint - | SystemContentBlockUnknown -] -""" -Contains configurations for instructions to provide the model for how to -handle input. To learn more, see [Using the Converse -API](https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference-call.html). -""" - - -class _SystemContentBlockDeserializer: - _result: SystemContentBlock | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> SystemContentBlock: - self._result = None - deserializer.read_struct(_SCHEMA_SYSTEM_CONTENT_BLOCK, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(SystemContentBlockText.deserialize(de)) - - case 1: - self._set_result(SystemContentBlockGuardContent.deserialize(de)) - - case 2: - self._set_result(SystemContentBlockCachePoint.deserialize(de)) - - case _: - self._set_result( - SystemContentBlockUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: SystemContentBlock) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_system_content_blocks( - serializer: ShapeSerializer, schema: Schema, value: list[SystemContentBlock] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_system_content_blocks( - deserializer: ShapeDeserializer, schema: Schema -) -> list[SystemContentBlock]: - result: list[SystemContentBlock] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_SystemContentBlockDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AnyToolChoice: - """ - The model must request at least one tool (no text is generated). For - example, `{"any" : {}}`. For more information, see [Call a tool with the - Converse - API](https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html) - in the Amazon Bedrock User Guide. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ANY_TOOL_CHOICE, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ANY_TOOL_CHOICE, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class AutoToolChoice: - """ - The Model automatically decides if a tool should be called or whether to - generate text instead. For example, `{"auto" : {}}`. For more - information, see [Call a tool with the Converse - API](https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html) - in the Amazon Bedrock User Guide - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTO_TOOL_CHOICE, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AUTO_TOOL_CHOICE, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class SpecificToolChoice: - """ - The model must request a specific tool. For example, - `{"tool" : {"name" : "Your tool name"}}`. For more information, see - [Call a tool with the Converse - API](https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html) - in the Amazon Bedrock User Guide - - Note: - This field is only supported by Anthropic Claude 3 models. - """ - - name: str - """The name of the tool that the model must request.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SPECIFIC_TOOL_CHOICE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_SPECIFIC_TOOL_CHOICE.members["name"], self.name) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_SPECIFIC_TOOL_CHOICE.members["name"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SPECIFIC_TOOL_CHOICE, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - return kwargs - - -@dataclass -class ToolChoiceAuto: - """ - (Default). The Model automatically decides if a tool should be called or - whether to generate text instead. - """ - - value: AutoToolChoice - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_CHOICE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_CHOICE.members["auto"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=AutoToolChoice.deserialize(deserializer)) - - -@dataclass -class ToolChoiceAny: - """The model must request at least one tool (no text is generated).""" - - value: AnyToolChoice - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_CHOICE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_CHOICE.members["any"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=AnyToolChoice.deserialize(deserializer)) - - -@dataclass -class ToolChoiceTool: - """ - The Model must request the specified tool. Only supported by Anthropic - Claude 3 and Amazon Nova models. - """ - - value: SpecificToolChoice - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_CHOICE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_CHOICE.members["tool"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=SpecificToolChoice.deserialize(deserializer)) - - -@dataclass -class ToolChoiceUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ToolChoice = Union[ToolChoiceAuto | ToolChoiceAny | ToolChoiceTool | ToolChoiceUnknown] -""" -Determines which tools the model should request in a call to `Converse` -or `ConverseStream`. For more information, see [Call a tool with the -Converse -API](https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html) -in the Amazon Bedrock User Guide. -""" - - -class _ToolChoiceDeserializer: - _result: ToolChoice | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> ToolChoice: - self._result = None - deserializer.read_struct(_SCHEMA_TOOL_CHOICE, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(ToolChoiceAuto.deserialize(de)) - - case 1: - self._set_result(ToolChoiceAny.deserialize(de)) - - case 2: - self._set_result(ToolChoiceTool.deserialize(de)) - - case _: - self._set_result(ToolChoiceUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: ToolChoice) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class SystemTool: - """ - Specifies a system-defined tool for the model to use. *System-defined - tools* are tools that are created and provided by the model provider. - """ - - name: str - """The name of the system-defined tool that you want to call.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SYSTEM_TOOL, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_SYSTEM_TOOL.members["name"], self.name) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string(_SCHEMA_SYSTEM_TOOL.members["name"]) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SYSTEM_TOOL, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - return kwargs - - -@dataclass -class ToolInputSchemaJson: - """ - The JSON schema for the tool. For more information, see [JSON Schema - Reference](https://json-schema.org/understanding-json-schema/reference). - """ - - value: Document - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_INPUT_SCHEMA, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_document(_SCHEMA_TOOL_INPUT_SCHEMA.members["json"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_document(_SCHEMA_TOOL_INPUT_SCHEMA.members["json"]) - ) - - -@dataclass -class ToolInputSchemaUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ToolInputSchema = Union[ToolInputSchemaJson | ToolInputSchemaUnknown] -""" -The schema for the tool. The top level schema type must be `object`. For -more information, see [Call a tool with the Converse -API](https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html) -in the Amazon Bedrock User Guide. -""" - - -class _ToolInputSchemaDeserializer: - _result: ToolInputSchema | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> ToolInputSchema: - self._result = None - deserializer.read_struct(_SCHEMA_TOOL_INPUT_SCHEMA, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(ToolInputSchemaJson.deserialize(de)) - - case _: - self._set_result( - ToolInputSchemaUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: ToolInputSchema) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class ToolSpecification: - """ - The specification for the tool. For more information, see [Call a tool - with the Converse - API](https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html) - in the Amazon Bedrock User Guide. - """ - - name: str - """The name for the tool.""" - - input_schema: ToolInputSchema - """The input schema for the tool in JSON format.""" - - description: str | None = None - """The description for the tool.""" - - strict: bool | None = None - """Flag to enable structured output enforcement on a tool usage response.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_SPECIFICATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_TOOL_SPECIFICATION.members["name"], self.name) - if self.description is not None: - serializer.write_string( - _SCHEMA_TOOL_SPECIFICATION.members["description"], self.description - ) - - serializer.write_struct( - _SCHEMA_TOOL_SPECIFICATION.members["inputSchema"], self.input_schema - ) - if self.strict is not None: - serializer.write_boolean( - _SCHEMA_TOOL_SPECIFICATION.members["strict"], self.strict - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_TOOL_SPECIFICATION.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_TOOL_SPECIFICATION.members["description"] - ) - - case 2: - kwargs["input_schema"] = _ToolInputSchemaDeserializer().deserialize( - de - ) - - case 3: - kwargs["strict"] = de.read_boolean( - _SCHEMA_TOOL_SPECIFICATION.members["strict"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TOOL_SPECIFICATION, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "input_schema" not in kwargs: - kwargs["input_schema"] = ToolInputSchemaUnknown(tag="") - return kwargs - - -@dataclass -class ToolToolSpec: - """The specfication for the tool.""" - - value: ToolSpecification - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL.members["toolSpec"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ToolSpecification.deserialize(deserializer)) - - -@dataclass -class ToolSystemTool: - """Specifies the system-defined tool that you want use.""" - - value: SystemTool - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL.members["systemTool"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=SystemTool.deserialize(deserializer)) - - -@dataclass -class ToolCachePoint: - """CachePoint to include in the tool configuration.""" - - value: CachePointBlock - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL.members["cachePoint"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=CachePointBlock.deserialize(deserializer)) - - -@dataclass -class ToolUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -Tool = Union[ToolToolSpec | ToolSystemTool | ToolCachePoint | ToolUnknown] -""" -Information about a tool that you can use with the Converse API. For -more information, see [Call a tool with the Converse -API](https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html) -in the Amazon Bedrock User Guide. -""" - - -class _ToolDeserializer: - _result: Tool | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> Tool: - self._result = None - deserializer.read_struct(_SCHEMA_TOOL, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(ToolToolSpec.deserialize(de)) - - case 1: - self._set_result(ToolSystemTool.deserialize(de)) - - case 2: - self._set_result(ToolCachePoint.deserialize(de)) - - case _: - self._set_result(ToolUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: Tool) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_tools( - serializer: ShapeSerializer, schema: Schema, value: list[Tool] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_tools(deserializer: ShapeDeserializer, schema: Schema) -> list[Tool]: - result: list[Tool] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_ToolDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ToolConfiguration: - """ - Configuration information for the tools that you pass to a model. For - more information, see [Tool use (function - calling)](https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html) - in the Amazon Bedrock User Guide. - """ - - tools: list[Tool] - """An array of tools that you want to pass to a model.""" - - tool_choice: ToolChoice | None = None - """If supported by model, forces the model to request a tool.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_tools( - serializer, _SCHEMA_TOOL_CONFIGURATION.members["tools"], self.tools - ) - if self.tool_choice is not None: - serializer.write_struct( - _SCHEMA_TOOL_CONFIGURATION.members["toolChoice"], self.tool_choice - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["tools"] = _deserialize_tools( - de, _SCHEMA_TOOL_CONFIGURATION.members["tools"] - ) - - case 1: - kwargs["tool_choice"] = _ToolChoiceDeserializer().deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TOOL_CONFIGURATION, consumer=_consumer) - if "tools" not in kwargs: - kwargs["tools"] = [] - return kwargs - - -@dataclass(kw_only=True) -class ConverseInput: - """Dataclass for ConverseInput structure.""" - - model_id: str | None = None - """ - Specifies the model or throughput with which to run inference, or the - prompt resource to use in inference. The value depends on the resource - that you use: - - - If you use a base model, specify the model ID or its ARN. For a list - of model IDs for base models, see [Amazon Bedrock base model IDs - (on-demand - throughput)](https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns) - in the Amazon Bedrock User Guide. - - - If you use an inference profile, specify the inference profile ID or - its ARN. For a list of inference profile IDs, see [Supported Regions - and models for cross-region - inference](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference-support.html) - in the Amazon Bedrock User Guide. - - - If you use a provisioned model, specify the ARN of the Provisioned - Throughput. For more information, see [Run inference using a - Provisioned - Throughput](https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html) - in the Amazon Bedrock User Guide. - - - If you use a custom model, first purchase Provisioned Throughput for - it. Then specify the ARN of the resulting provisioned model. For more - information, see [Use a custom model in Amazon - Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html) - in the Amazon Bedrock User Guide. - - - To include a prompt that was defined in [Prompt - management](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management.html), - specify the ARN of the prompt version to use. - - The Converse API doesn't support [imported - models](https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-import-model.html). - """ - - messages: list[Message] | None = None - """The messages that you want to send to the model.""" - - system: list[SystemContentBlock] | None = None - """ - A prompt that provides instructions or context to the model about the - task it should perform, or the persona it should adopt during the - conversation. - """ - - inference_config: InferenceConfiguration | None = None - """ - Inference parameters to pass to the model. `Converse` and - `ConverseStream` support a base set of inference parameters. If you need - to pass additional parameters that the model supports, use the - `additionalModelRequestFields` request field. - """ - - tool_config: ToolConfiguration | None = None - """ - Configuration information for the tools that the model can use when - generating a response. - - For information about models that support tool use, see [Supported - models and model - features](https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference.html#conversation-inference-supported-models-features). - """ - - guardrail_config: GuardrailConfiguration | None = None - """ - Configuration information for a guardrail that you want to use in the - request. If you include `guardContent` blocks in the `content` field in - the `messages` field, the guardrail operates only on those messages. If - you include no `guardContent` blocks, the guardrail operates on all - messages in the request body and in any included prompt resource. - """ - - additional_model_request_fields: Document | None = None - """ - Additional inference parameters that the model supports, beyond the base - set of inference parameters that `Converse` and `ConverseStream` support - in the `inferenceConfig` field. For more information, see [Model - parameters](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). - """ - - prompt_variables: dict[str, PromptVariableValues] | None = field( - repr=False, default=None - ) - """ - Contains a map of variables in a prompt from Prompt management to - objects containing the values to fill in for them when running model - invocation. This field is ignored if you don't specify a prompt - resource in the `modelId` field. - """ - - additional_model_response_field_paths: list[str] | None = None - """ - Additional model parameters field paths to return in the response. - `Converse` and `ConverseStream` return the requested fields as a JSON - Pointer object in the `additionalModelResponseFields` field. The - following is example JSON for `additionalModelResponseFieldPaths`. - - `[ "/stop_sequence" ]` - - For information about the JSON Pointer syntax, see the [Internet - Engineering Task Force - (IETF)](https://datatracker.ietf.org/doc/html/rfc6901) documentation. - - `Converse` and `ConverseStream` reject an empty JSON Pointer or - incorrectly structured JSON Pointer with a `400` error code. if the JSON - Pointer is valid, but the requested field is not in the model response, - it is ignored by `Converse`. - """ - - request_metadata: dict[str, str] | None = field(repr=False, default=None) - """Key-value pairs that you can use to filter invocation logs.""" - - performance_config: PerformanceConfiguration | None = None - """Model performance settings for the request.""" - - service_tier: ServiceTier | None = None - """ - Specifies the processing tier configuration used for serving the - request. - """ - - output_config: OutputConfig | None = None - """Output configuration for a model response.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONVERSE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.model_id is not None: - serializer.write_string( - _SCHEMA_CONVERSE_INPUT.members["modelId"], self.model_id - ) - - if self.messages is not None: - _serialize_messages( - serializer, _SCHEMA_CONVERSE_INPUT.members["messages"], self.messages - ) - - if self.system is not None: - _serialize_system_content_blocks( - serializer, _SCHEMA_CONVERSE_INPUT.members["system"], self.system - ) - - if self.inference_config is not None: - serializer.write_struct( - _SCHEMA_CONVERSE_INPUT.members["inferenceConfig"], self.inference_config - ) - - if self.tool_config is not None: - serializer.write_struct( - _SCHEMA_CONVERSE_INPUT.members["toolConfig"], self.tool_config - ) - - if self.guardrail_config is not None: - serializer.write_struct( - _SCHEMA_CONVERSE_INPUT.members["guardrailConfig"], self.guardrail_config - ) - - if self.additional_model_request_fields is not None: - serializer.write_document( - _SCHEMA_CONVERSE_INPUT.members["additionalModelRequestFields"], - self.additional_model_request_fields, - ) - - if self.prompt_variables is not None: - _serialize_prompt_variable_map( - serializer, - _SCHEMA_CONVERSE_INPUT.members["promptVariables"], - self.prompt_variables, - ) - - if self.additional_model_response_field_paths is not None: - _serialize_additional_model_response_field_paths( - serializer, - _SCHEMA_CONVERSE_INPUT.members["additionalModelResponseFieldPaths"], - self.additional_model_response_field_paths, - ) - - if self.request_metadata is not None: - _serialize_request_metadata( - serializer, - _SCHEMA_CONVERSE_INPUT.members["requestMetadata"], - self.request_metadata, - ) - - if self.performance_config is not None: - serializer.write_struct( - _SCHEMA_CONVERSE_INPUT.members["performanceConfig"], - self.performance_config, - ) - - if self.service_tier is not None: - serializer.write_struct( - _SCHEMA_CONVERSE_INPUT.members["serviceTier"], self.service_tier - ) - - if self.output_config is not None: - serializer.write_struct( - _SCHEMA_CONVERSE_INPUT.members["outputConfig"], self.output_config - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_id"] = de.read_string( - _SCHEMA_CONVERSE_INPUT.members["modelId"] - ) - - case 1: - kwargs["messages"] = _deserialize_messages( - de, _SCHEMA_CONVERSE_INPUT.members["messages"] - ) - - case 2: - kwargs["system"] = _deserialize_system_content_blocks( - de, _SCHEMA_CONVERSE_INPUT.members["system"] - ) - - case 3: - kwargs["inference_config"] = InferenceConfiguration.deserialize(de) - - case 4: - kwargs["tool_config"] = ToolConfiguration.deserialize(de) - - case 5: - kwargs["guardrail_config"] = GuardrailConfiguration.deserialize(de) - - case 6: - kwargs["additional_model_request_fields"] = de.read_document( - _SCHEMA_CONVERSE_INPUT.members["additionalModelRequestFields"] - ) - - case 7: - kwargs["prompt_variables"] = _deserialize_prompt_variable_map( - de, _SCHEMA_CONVERSE_INPUT.members["promptVariables"] - ) - - case 8: - kwargs["additional_model_response_field_paths"] = ( - _deserialize_additional_model_response_field_paths( - de, - _SCHEMA_CONVERSE_INPUT.members[ - "additionalModelResponseFieldPaths" - ], - ) - ) - - case 9: - kwargs["request_metadata"] = _deserialize_request_metadata( - de, _SCHEMA_CONVERSE_INPUT.members["requestMetadata"] - ) - - case 10: - kwargs["performance_config"] = PerformanceConfiguration.deserialize( - de - ) - - case 11: - kwargs["service_tier"] = ServiceTier.deserialize(de) - - case 12: - kwargs["output_config"] = OutputConfig.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONVERSE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ConverseMetrics: - """ - Metrics for a call to - [Converse](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html). - """ - - latency_ms: int - """The latency of the call to `Converse`, in milliseconds.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONVERSE_METRICS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_long( - _SCHEMA_CONVERSE_METRICS.members["latencyMs"], self.latency_ms - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["latency_ms"] = de.read_long( - _SCHEMA_CONVERSE_METRICS.members["latencyMs"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONVERSE_METRICS, consumer=_consumer) - if "latency_ms" not in kwargs: - kwargs["latency_ms"] = 0 - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(latency_ms=0) - - -@dataclass -class ConverseOutputMessage: - """The message that the model generates.""" - - value: Message - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONVERSE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONVERSE_OUTPUT.members["message"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=Message.deserialize(deserializer)) - - -@dataclass -class ConverseOutputUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ConverseOutput = Union[ConverseOutputMessage | ConverseOutputUnknown] -""" -The output from a call to -[Converse](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html). -""" - - -class _ConverseOutputDeserializer: - _result: ConverseOutput | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> ConverseOutput: - self._result = None - deserializer.read_struct(_SCHEMA_CONVERSE_OUTPUT, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(ConverseOutputMessage.deserialize(de)) - - case _: - self._set_result(ConverseOutputUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: ConverseOutput) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class StopReason(UnknownEnumMixin, StrEnum): - END_TURN = "end_turn" - TOOL_USE = "tool_use" - MAX_TOKENS = "max_tokens" - STOP_SEQUENCE = "stop_sequence" - GUARDRAIL_INTERVENED = "guardrail_intervened" - CONTENT_FILTERED = "content_filtered" - MALFORMED_MODEL_OUTPUT = "malformed_model_output" - MALFORMED_TOOL_USE = "malformed_tool_use" - MODEL_CONTEXT_WINDOW_EXCEEDED = "model_context_window_exceeded" - - -def _serialize_guardrail_assessment_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, GuardrailAssessment] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_struct(value_schema, v)) - - -def _deserialize_guardrail_assessment_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, GuardrailAssessment]: - result: dict[str, GuardrailAssessment] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = GuardrailAssessment.deserialize(d) - - deserializer.read_map(schema, _read_value) - return result - - -def _serialize_model_outputs( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_model_outputs( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_guardrail_assessment_list_map( - serializer: ShapeSerializer, - schema: Schema, - value: dict[str, list[GuardrailAssessment]], -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry( - k, lambda vs: _serialize_guardrail_assessment_list(vs, value_schema, v) - ) - - -def _deserialize_guardrail_assessment_list_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, list[GuardrailAssessment]]: - result: dict[str, list[GuardrailAssessment]] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = _deserialize_guardrail_assessment_list(d, value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GuardrailTraceAssessment: - """ - A Top level guardrail trace object. For more information, see - [ConverseTrace](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseTrace.html). - """ - - model_output: list[str] | None = None - """The output from the model.""" - - input_assessment: dict[str, GuardrailAssessment] | None = None - """The input assessment.""" - - output_assessments: dict[str, list[GuardrailAssessment]] | None = None - """the output assessments.""" - - action_reason: str | None = None - """ - Provides the reason for the action taken when harmful content is - detected. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_TRACE_ASSESSMENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.model_output is not None: - _serialize_model_outputs( - serializer, - _SCHEMA_GUARDRAIL_TRACE_ASSESSMENT.members["modelOutput"], - self.model_output, - ) - - if self.input_assessment is not None: - _serialize_guardrail_assessment_map( - serializer, - _SCHEMA_GUARDRAIL_TRACE_ASSESSMENT.members["inputAssessment"], - self.input_assessment, - ) - - if self.output_assessments is not None: - _serialize_guardrail_assessment_list_map( - serializer, - _SCHEMA_GUARDRAIL_TRACE_ASSESSMENT.members["outputAssessments"], - self.output_assessments, - ) - - if self.action_reason is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_TRACE_ASSESSMENT.members["actionReason"], - self.action_reason, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_output"] = _deserialize_model_outputs( - de, _SCHEMA_GUARDRAIL_TRACE_ASSESSMENT.members["modelOutput"] - ) - - case 1: - kwargs["input_assessment"] = _deserialize_guardrail_assessment_map( - de, - _SCHEMA_GUARDRAIL_TRACE_ASSESSMENT.members["inputAssessment"], - ) - - case 2: - kwargs["output_assessments"] = ( - _deserialize_guardrail_assessment_list_map( - de, - _SCHEMA_GUARDRAIL_TRACE_ASSESSMENT.members[ - "outputAssessments" - ], - ) - ) - - case 3: - kwargs["action_reason"] = de.read_string( - _SCHEMA_GUARDRAIL_TRACE_ASSESSMENT.members["actionReason"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GUARDRAIL_TRACE_ASSESSMENT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class PromptRouterTrace: - """A prompt router trace.""" - - invoked_model_id: str | None = None - """The ID of the invoked model.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PROMPT_ROUTER_TRACE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.invoked_model_id is not None: - serializer.write_string( - _SCHEMA_PROMPT_ROUTER_TRACE.members["invokedModelId"], - self.invoked_model_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["invoked_model_id"] = de.read_string( - _SCHEMA_PROMPT_ROUTER_TRACE.members["invokedModelId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PROMPT_ROUTER_TRACE, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ConverseTrace: - """ - The trace object in a response from - [Converse](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html). - """ - - guardrail: GuardrailTraceAssessment | None = None - """The guardrail trace object.""" - - prompt_router: PromptRouterTrace | None = None - """The request's prompt router.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONVERSE_TRACE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.guardrail is not None: - serializer.write_struct( - _SCHEMA_CONVERSE_TRACE.members["guardrail"], self.guardrail - ) - - if self.prompt_router is not None: - serializer.write_struct( - _SCHEMA_CONVERSE_TRACE.members["promptRouter"], self.prompt_router - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["guardrail"] = GuardrailTraceAssessment.deserialize(de) - - case 1: - kwargs["prompt_router"] = PromptRouterTrace.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONVERSE_TRACE, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CacheDetail: - """Cache creation metrics for a specific TTL duration""" - - ttl: str - """TTL duration for these cached tokens""" - - input_tokens: int - """Number of tokens written to cache with this TTL (cache creation tokens)""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CACHE_DETAIL, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_CACHE_DETAIL.members["ttl"], self.ttl) - serializer.write_integer( - _SCHEMA_CACHE_DETAIL.members["inputTokens"], self.input_tokens - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["ttl"] = CacheTTL( - de.read_string(_SCHEMA_CACHE_DETAIL.members["ttl"]) - ) - - case 1: - kwargs["input_tokens"] = de.read_integer( - _SCHEMA_CACHE_DETAIL.members["inputTokens"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CACHE_DETAIL, consumer=_consumer) - if "ttl" not in kwargs: - kwargs["ttl"] = CacheTTL._corrected("") - if "input_tokens" not in kwargs: - kwargs["input_tokens"] = 0 - return kwargs - - -def _serialize_cache_details_list( - serializer: ShapeSerializer, schema: Schema, value: list[CacheDetail] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_cache_details_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[CacheDetail]: - result: list[CacheDetail] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(CacheDetail.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class TokenUsage: - """The tokens used in a message API inference call.""" - - input_tokens: int - """The number of tokens sent in the request to the model.""" - - output_tokens: int - """The number of tokens that the model generated for the request.""" - - total_tokens: int - """The total of input tokens and tokens generated by the model.""" - - cache_read_input_tokens: int | None = None - """The number of input tokens read from the cache for the request.""" - - cache_write_input_tokens: int | None = None - """The number of input tokens written to the cache for the request.""" - - cache_details: list[CacheDetail] | None = None - """ - Detailed breakdown of cache writes by TTL. Empty if no cache creation - occurred. Sorted by TTL duration (1h before 5m). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOKEN_USAGE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer( - _SCHEMA_TOKEN_USAGE.members["inputTokens"], self.input_tokens - ) - serializer.write_integer( - _SCHEMA_TOKEN_USAGE.members["outputTokens"], self.output_tokens - ) - serializer.write_integer( - _SCHEMA_TOKEN_USAGE.members["totalTokens"], self.total_tokens - ) - if self.cache_read_input_tokens is not None: - serializer.write_integer( - _SCHEMA_TOKEN_USAGE.members["cacheReadInputTokens"], - self.cache_read_input_tokens, - ) - - if self.cache_write_input_tokens is not None: - serializer.write_integer( - _SCHEMA_TOKEN_USAGE.members["cacheWriteInputTokens"], - self.cache_write_input_tokens, - ) - - if self.cache_details is not None: - _serialize_cache_details_list( - serializer, - _SCHEMA_TOKEN_USAGE.members["cacheDetails"], - self.cache_details, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["input_tokens"] = de.read_integer( - _SCHEMA_TOKEN_USAGE.members["inputTokens"] - ) - - case 1: - kwargs["output_tokens"] = de.read_integer( - _SCHEMA_TOKEN_USAGE.members["outputTokens"] - ) - - case 2: - kwargs["total_tokens"] = de.read_integer( - _SCHEMA_TOKEN_USAGE.members["totalTokens"] - ) - - case 3: - kwargs["cache_read_input_tokens"] = de.read_integer( - _SCHEMA_TOKEN_USAGE.members["cacheReadInputTokens"] - ) - - case 4: - kwargs["cache_write_input_tokens"] = de.read_integer( - _SCHEMA_TOKEN_USAGE.members["cacheWriteInputTokens"] - ) - - case 5: - kwargs["cache_details"] = _deserialize_cache_details_list( - de, _SCHEMA_TOKEN_USAGE.members["cacheDetails"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TOKEN_USAGE, consumer=_consumer) - if "input_tokens" not in kwargs: - kwargs["input_tokens"] = 0 - if "output_tokens" not in kwargs: - kwargs["output_tokens"] = 0 - if "total_tokens" not in kwargs: - kwargs["total_tokens"] = 0 - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(input_tokens=0, output_tokens=0, total_tokens=0) - - -@dataclass(kw_only=True) -class ConverseOperationOutput: - """Dataclass for ConverseOperationOutput structure.""" - - output: ConverseOutput - """The result from the call to `Converse`.""" - - stop_reason: str - """The reason why the model stopped generating output.""" - - usage: TokenUsage - """ - The total number of tokens used in the call to `Converse`. The total - includes the tokens input to the model and the tokens generated by the - model. - """ - - metrics: ConverseMetrics - """Metrics for the call to `Converse`.""" - - additional_model_response_fields: Document | None = None - """Additional fields in the response that are unique to the model.""" - - trace: ConverseTrace | None = None - """A trace object that contains information about the Guardrail behavior.""" - - performance_config: PerformanceConfiguration | None = None - """Model performance settings for the request.""" - - service_tier: ServiceTier | None = None - """ - Specifies the processing tier configuration used for serving the - request. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONVERSE_OPERATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CONVERSE_OPERATION_OUTPUT.members["output"], self.output - ) - serializer.write_string( - _SCHEMA_CONVERSE_OPERATION_OUTPUT.members["stopReason"], self.stop_reason - ) - serializer.write_struct( - _SCHEMA_CONVERSE_OPERATION_OUTPUT.members["usage"], self.usage - ) - serializer.write_struct( - _SCHEMA_CONVERSE_OPERATION_OUTPUT.members["metrics"], self.metrics - ) - if self.additional_model_response_fields is not None: - serializer.write_document( - _SCHEMA_CONVERSE_OPERATION_OUTPUT.members[ - "additionalModelResponseFields" - ], - self.additional_model_response_fields, - ) - - if self.trace is not None: - serializer.write_struct( - _SCHEMA_CONVERSE_OPERATION_OUTPUT.members["trace"], self.trace - ) - - if self.performance_config is not None: - serializer.write_struct( - _SCHEMA_CONVERSE_OPERATION_OUTPUT.members["performanceConfig"], - self.performance_config, - ) - - if self.service_tier is not None: - serializer.write_struct( - _SCHEMA_CONVERSE_OPERATION_OUTPUT.members["serviceTier"], - self.service_tier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["output"] = _ConverseOutputDeserializer().deserialize(de) - - case 1: - kwargs["stop_reason"] = StopReason( - de.read_string( - _SCHEMA_CONVERSE_OPERATION_OUTPUT.members["stopReason"] - ) - ) - - case 2: - kwargs["usage"] = TokenUsage.deserialize(de) - - case 3: - kwargs["metrics"] = ConverseMetrics.deserialize(de) - - case 4: - kwargs["additional_model_response_fields"] = de.read_document( - _SCHEMA_CONVERSE_OPERATION_OUTPUT.members[ - "additionalModelResponseFields" - ] - ) - - case 5: - kwargs["trace"] = ConverseTrace.deserialize(de) - - case 6: - kwargs["performance_config"] = PerformanceConfiguration.deserialize( - de - ) - - case 7: - kwargs["service_tier"] = ServiceTier.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONVERSE_OPERATION_OUTPUT, consumer=_consumer) - if "output" not in kwargs: - kwargs["output"] = ConverseOutputUnknown(tag="") - if "stop_reason" not in kwargs: - kwargs["stop_reason"] = StopReason._corrected("") - if "usage" not in kwargs: - kwargs["usage"] = TokenUsage._smithy_default() - if "metrics" not in kwargs: - kwargs["metrics"] = ConverseMetrics._smithy_default() - return kwargs - - -@dataclass(kw_only=True) -class ModelErrorException(ServiceError): - """The request failed due to an error while processing the model.""" - - fault: Literal["client", "server"] | None = "client" - - original_status_code: int | None = None - """The original status code.""" - - resource_name: str | None = None - """The resource name.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MODEL_ERROR_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_MODEL_ERROR_EXCEPTION.members["message"], self.message - ) - - if self.original_status_code is not None: - serializer.write_integer( - _SCHEMA_MODEL_ERROR_EXCEPTION.members["originalStatusCode"], - self.original_status_code, - ) - - if self.resource_name is not None: - serializer.write_string( - _SCHEMA_MODEL_ERROR_EXCEPTION.members["resourceName"], - self.resource_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_MODEL_ERROR_EXCEPTION.members["message"] - ) - - case 1: - kwargs["original_status_code"] = de.read_integer( - _SCHEMA_MODEL_ERROR_EXCEPTION.members["originalStatusCode"] - ) - - case 2: - kwargs["resource_name"] = de.read_string( - _SCHEMA_MODEL_ERROR_EXCEPTION.members["resourceName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MODEL_ERROR_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ModelNotReadyException(ServiceError): - """ - The model specified in the request is not ready to serve inference - requests. The AWS SDK will automatically retry the operation up to 5 - times. For information about configuring automatic retries, see [Retry - behavior](https://docs.aws.amazon.com/sdkref/latest/guide/feature-retry-behavior.html) - in the *AWS SDKs and Tools* reference guide. - """ - - fault: Literal["client", "server"] | None = "client" - is_retry_safe: bool | None = True - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MODEL_NOT_READY_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_MODEL_NOT_READY_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_MODEL_NOT_READY_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MODEL_NOT_READY_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ModelTimeoutException(ServiceError): - """ - The request took too long to process. Processing time exceeded the model - timeout length. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MODEL_TIMEOUT_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_MODEL_TIMEOUT_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_MODEL_TIMEOUT_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MODEL_TIMEOUT_EXCEPTION, consumer=_consumer) - return kwargs - - -CONVERSE = APIOperation( - input=ConverseInput, - output=ConverseOperationOutput, - schema=_SCHEMA_CONVERSE, - input_schema=_SCHEMA_CONVERSE_INPUT, - output_schema=_SCHEMA_CONVERSE_OPERATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockruntime#ModelErrorException" - ): ModelErrorException, - ShapeID( - "com.amazonaws.bedrockruntime#ModelNotReadyException" - ): ModelNotReadyException, - ShapeID( - "com.amazonaws.bedrockruntime#ModelTimeoutException" - ): ModelTimeoutException, - ShapeID( - "com.amazonaws.bedrockruntime#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockruntime#ServiceUnavailableException" - ): ServiceUnavailableException, - ShapeID( - "com.amazonaws.bedrockruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockruntime#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_MODEL_ERROR_EXCEPTION, - _SCHEMA_MODEL_NOT_READY_EXCEPTION, - _SCHEMA_MODEL_TIMEOUT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_UNAVAILABLE_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class GuardrailStreamProcessingMode(UnknownEnumMixin, StrEnum): - SYNC = "sync" - ASYNC_ = "async" - - -@dataclass(kw_only=True) -class GuardrailStreamConfiguration: - """ - Configuration information for a guardrail that you use with the - [ConverseStream](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html) - action. - """ - - guardrail_identifier: str = "" - """The identifier for the guardrail.""" - - guardrail_version: str = "" - """The version of the guardrail.""" - - trace: str = GuardrailTrace("disabled") - """The trace behavior for the guardrail.""" - - stream_processing_mode: str = GuardrailStreamProcessingMode("sync") - """ - The processing mode. - - The processing mode. For more information, see *Configure streaming - response behavior* in the *Amazon Bedrock User Guide*. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_STREAM_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GUARDRAIL_STREAM_CONFIGURATION.members["guardrailIdentifier"], - self.guardrail_identifier, - ) - serializer.write_string( - _SCHEMA_GUARDRAIL_STREAM_CONFIGURATION.members["guardrailVersion"], - self.guardrail_version, - ) - serializer.write_string( - _SCHEMA_GUARDRAIL_STREAM_CONFIGURATION.members["trace"], self.trace - ) - serializer.write_string( - _SCHEMA_GUARDRAIL_STREAM_CONFIGURATION.members["streamProcessingMode"], - self.stream_processing_mode, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["guardrail_identifier"] = de.read_string( - _SCHEMA_GUARDRAIL_STREAM_CONFIGURATION.members[ - "guardrailIdentifier" - ] - ) - - case 1: - kwargs["guardrail_version"] = de.read_string( - _SCHEMA_GUARDRAIL_STREAM_CONFIGURATION.members[ - "guardrailVersion" - ] - ) - - case 2: - kwargs["trace"] = GuardrailTrace( - de.read_string( - _SCHEMA_GUARDRAIL_STREAM_CONFIGURATION.members["trace"] - ) - ) - - case 3: - kwargs["stream_processing_mode"] = GuardrailStreamProcessingMode( - de.read_string( - _SCHEMA_GUARDRAIL_STREAM_CONFIGURATION.members[ - "streamProcessingMode" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_STREAM_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ConverseStreamInput: - """Dataclass for ConverseStreamInput structure.""" - - model_id: str | None = None - """ - Specifies the model or throughput with which to run inference, or the - prompt resource to use in inference. The value depends on the resource - that you use: - - - If you use a base model, specify the model ID or its ARN. For a list - of model IDs for base models, see [Amazon Bedrock base model IDs - (on-demand - throughput)](https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns) - in the Amazon Bedrock User Guide. - - - If you use an inference profile, specify the inference profile ID or - its ARN. For a list of inference profile IDs, see [Supported Regions - and models for cross-region - inference](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference-support.html) - in the Amazon Bedrock User Guide. - - - If you use a provisioned model, specify the ARN of the Provisioned - Throughput. For more information, see [Run inference using a - Provisioned - Throughput](https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html) - in the Amazon Bedrock User Guide. - - - If you use a custom model, first purchase Provisioned Throughput for - it. Then specify the ARN of the resulting provisioned model. For more - information, see [Use a custom model in Amazon - Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html) - in the Amazon Bedrock User Guide. - - - To include a prompt that was defined in [Prompt - management](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management.html), - specify the ARN of the prompt version to use. - - The Converse API doesn't support [imported - models](https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-import-model.html). - """ - - messages: list[Message] | None = None - """The messages that you want to send to the model.""" - - system: list[SystemContentBlock] | None = None - """ - A prompt that provides instructions or context to the model about the - task it should perform, or the persona it should adopt during the - conversation. - """ - - inference_config: InferenceConfiguration | None = None - """ - Inference parameters to pass to the model. `Converse` and - `ConverseStream` support a base set of inference parameters. If you need - to pass additional parameters that the model supports, use the - `additionalModelRequestFields` request field. - """ - - tool_config: ToolConfiguration | None = None - """ - Configuration information for the tools that the model can use when - generating a response. - - For information about models that support streaming tool use, see - [Supported models and model - features](https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference.html#conversation-inference-supported-models-features). - """ - - guardrail_config: GuardrailStreamConfiguration | None = None - """ - Configuration information for a guardrail that you want to use in the - request. If you include `guardContent` blocks in the `content` field in - the `messages` field, the guardrail operates only on those messages. If - you include no `guardContent` blocks, the guardrail operates on all - messages in the request body and in any included prompt resource. - """ - - additional_model_request_fields: Document | None = None - """ - Additional inference parameters that the model supports, beyond the base - set of inference parameters that `Converse` and `ConverseStream` support - in the `inferenceConfig` field. For more information, see [Model - parameters](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). - """ - - prompt_variables: dict[str, PromptVariableValues] | None = field( - repr=False, default=None - ) - """ - Contains a map of variables in a prompt from Prompt management to - objects containing the values to fill in for them when running model - invocation. This field is ignored if you don't specify a prompt - resource in the `modelId` field. - """ - - additional_model_response_field_paths: list[str] | None = None - """ - Additional model parameters field paths to return in the response. - `Converse` and `ConverseStream` return the requested fields as a JSON - Pointer object in the `additionalModelResponseFields` field. The - following is example JSON for `additionalModelResponseFieldPaths`. - - `[ "/stop_sequence" ]` - - For information about the JSON Pointer syntax, see the [Internet - Engineering Task Force - (IETF)](https://datatracker.ietf.org/doc/html/rfc6901) documentation. - - `Converse` and `ConverseStream` reject an empty JSON Pointer or - incorrectly structured JSON Pointer with a `400` error code. if the JSON - Pointer is valid, but the requested field is not in the model response, - it is ignored by `Converse`. - """ - - request_metadata: dict[str, str] | None = field(repr=False, default=None) - """Key-value pairs that you can use to filter invocation logs.""" - - performance_config: PerformanceConfiguration | None = None - """Model performance settings for the request.""" - - service_tier: ServiceTier | None = None - """ - Specifies the processing tier configuration used for serving the - request. - """ - - output_config: OutputConfig | None = None - """Output configuration for a model response.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONVERSE_STREAM_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.model_id is not None: - serializer.write_string( - _SCHEMA_CONVERSE_STREAM_INPUT.members["modelId"], self.model_id - ) - - if self.messages is not None: - _serialize_messages( - serializer, - _SCHEMA_CONVERSE_STREAM_INPUT.members["messages"], - self.messages, - ) - - if self.system is not None: - _serialize_system_content_blocks( - serializer, _SCHEMA_CONVERSE_STREAM_INPUT.members["system"], self.system - ) - - if self.inference_config is not None: - serializer.write_struct( - _SCHEMA_CONVERSE_STREAM_INPUT.members["inferenceConfig"], - self.inference_config, - ) - - if self.tool_config is not None: - serializer.write_struct( - _SCHEMA_CONVERSE_STREAM_INPUT.members["toolConfig"], self.tool_config - ) - - if self.guardrail_config is not None: - serializer.write_struct( - _SCHEMA_CONVERSE_STREAM_INPUT.members["guardrailConfig"], - self.guardrail_config, - ) - - if self.additional_model_request_fields is not None: - serializer.write_document( - _SCHEMA_CONVERSE_STREAM_INPUT.members["additionalModelRequestFields"], - self.additional_model_request_fields, - ) - - if self.prompt_variables is not None: - _serialize_prompt_variable_map( - serializer, - _SCHEMA_CONVERSE_STREAM_INPUT.members["promptVariables"], - self.prompt_variables, - ) - - if self.additional_model_response_field_paths is not None: - _serialize_additional_model_response_field_paths( - serializer, - _SCHEMA_CONVERSE_STREAM_INPUT.members[ - "additionalModelResponseFieldPaths" - ], - self.additional_model_response_field_paths, - ) - - if self.request_metadata is not None: - _serialize_request_metadata( - serializer, - _SCHEMA_CONVERSE_STREAM_INPUT.members["requestMetadata"], - self.request_metadata, - ) - - if self.performance_config is not None: - serializer.write_struct( - _SCHEMA_CONVERSE_STREAM_INPUT.members["performanceConfig"], - self.performance_config, - ) - - if self.service_tier is not None: - serializer.write_struct( - _SCHEMA_CONVERSE_STREAM_INPUT.members["serviceTier"], self.service_tier - ) - - if self.output_config is not None: - serializer.write_struct( - _SCHEMA_CONVERSE_STREAM_INPUT.members["outputConfig"], - self.output_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_id"] = de.read_string( - _SCHEMA_CONVERSE_STREAM_INPUT.members["modelId"] - ) - - case 1: - kwargs["messages"] = _deserialize_messages( - de, _SCHEMA_CONVERSE_STREAM_INPUT.members["messages"] - ) - - case 2: - kwargs["system"] = _deserialize_system_content_blocks( - de, _SCHEMA_CONVERSE_STREAM_INPUT.members["system"] - ) - - case 3: - kwargs["inference_config"] = InferenceConfiguration.deserialize(de) - - case 4: - kwargs["tool_config"] = ToolConfiguration.deserialize(de) - - case 5: - kwargs["guardrail_config"] = ( - GuardrailStreamConfiguration.deserialize(de) - ) - - case 6: - kwargs["additional_model_request_fields"] = de.read_document( - _SCHEMA_CONVERSE_STREAM_INPUT.members[ - "additionalModelRequestFields" - ] - ) - - case 7: - kwargs["prompt_variables"] = _deserialize_prompt_variable_map( - de, _SCHEMA_CONVERSE_STREAM_INPUT.members["promptVariables"] - ) - - case 8: - kwargs["additional_model_response_field_paths"] = ( - _deserialize_additional_model_response_field_paths( - de, - _SCHEMA_CONVERSE_STREAM_INPUT.members[ - "additionalModelResponseFieldPaths" - ], - ) - ) - - case 9: - kwargs["request_metadata"] = _deserialize_request_metadata( - de, _SCHEMA_CONVERSE_STREAM_INPUT.members["requestMetadata"] - ) - - case 10: - kwargs["performance_config"] = PerformanceConfiguration.deserialize( - de - ) - - case 11: - kwargs["service_tier"] = ServiceTier.deserialize(de) - - case 12: - kwargs["output_config"] = OutputConfig.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONVERSE_STREAM_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CitationSourceContentDelta: - """ - Contains incremental updates to the source content text during streaming - responses, allowing clients to build up the cited content progressively. - """ - - text: str | None = None - """ - An incremental update to the text content from the source document that - is being cited. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CITATION_SOURCE_CONTENT_DELTA, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.text is not None: - serializer.write_string( - _SCHEMA_CITATION_SOURCE_CONTENT_DELTA.members["text"], self.text - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["text"] = de.read_string( - _SCHEMA_CITATION_SOURCE_CONTENT_DELTA.members["text"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CITATION_SOURCE_CONTENT_DELTA, consumer=_consumer - ) - return kwargs - - -def _serialize_citation_source_content_list_delta( - serializer: ShapeSerializer, schema: Schema, value: list[CitationSourceContentDelta] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_citation_source_content_list_delta( - deserializer: ShapeDeserializer, schema: Schema -) -> list[CitationSourceContentDelta]: - result: list[CitationSourceContentDelta] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(CitationSourceContentDelta.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CitationsDelta: - """ - Contains incremental updates to citation information during streaming - responses. This allows clients to build up citation data progressively - as the response is generated. - """ - - title: str | None = None - """The title or identifier of the source document being cited.""" - - source: str | None = None - """ - The source from the original search result that provided the cited - content. - """ - - source_content: list[CitationSourceContentDelta] | None = None - """ - The specific content from the source document that was referenced or - cited in the generated response. - """ - - location: CitationLocation | None = None - """ - Specifies the precise location within a source document where cited - content can be found. This can include character-level positions, page - numbers, or document chunks depending on the document type and indexing - method. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CITATIONS_DELTA, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.title is not None: - serializer.write_string( - _SCHEMA_CITATIONS_DELTA.members["title"], self.title - ) - - if self.source is not None: - serializer.write_string( - _SCHEMA_CITATIONS_DELTA.members["source"], self.source - ) - - if self.source_content is not None: - _serialize_citation_source_content_list_delta( - serializer, - _SCHEMA_CITATIONS_DELTA.members["sourceContent"], - self.source_content, - ) - - if self.location is not None: - serializer.write_struct( - _SCHEMA_CITATIONS_DELTA.members["location"], self.location - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["title"] = de.read_string( - _SCHEMA_CITATIONS_DELTA.members["title"] - ) - - case 1: - kwargs["source"] = de.read_string( - _SCHEMA_CITATIONS_DELTA.members["source"] - ) - - case 2: - kwargs["source_content"] = ( - _deserialize_citation_source_content_list_delta( - de, _SCHEMA_CITATIONS_DELTA.members["sourceContent"] - ) - ) - - case 3: - kwargs["location"] = _CitationLocationDeserializer().deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CITATIONS_DELTA, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ImageBlockDelta: - """ - A streaming delta event that contains incremental image data during - streaming responses. - """ - - source: ImageSource | None = field(repr=False, default=None) - """The incremental image source data for this delta event.""" - - error: ErrorBlock | None = field(repr=False, default=None) - """Error information if this image delta could not be processed.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IMAGE_BLOCK_DELTA, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.source is not None: - serializer.write_struct( - _SCHEMA_IMAGE_BLOCK_DELTA.members["source"], self.source - ) - - if self.error is not None: - serializer.write_struct( - _SCHEMA_IMAGE_BLOCK_DELTA.members["error"], self.error - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["source"] = _ImageSourceDeserializer().deserialize(de) - - case 1: - kwargs["error"] = ErrorBlock.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_IMAGE_BLOCK_DELTA, consumer=_consumer) - return kwargs - - -@dataclass -class ReasoningContentBlockDeltaText: - """The reasoning that the model used to return the output.""" - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REASONING_CONTENT_BLOCK_DELTA, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_REASONING_CONTENT_BLOCK_DELTA.members["text"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string( - _SCHEMA_REASONING_CONTENT_BLOCK_DELTA.members["text"] - ) - ) - - -@dataclass -class ReasoningContentBlockDeltaRedactedContent: - """ - The content in the reasoning that was encrypted by the model provider - for safety reasons. The encryption doesn't affect the quality of - responses. - """ - - value: bytes - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REASONING_CONTENT_BLOCK_DELTA, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_blob( - _SCHEMA_REASONING_CONTENT_BLOCK_DELTA.members["redactedContent"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_blob( - _SCHEMA_REASONING_CONTENT_BLOCK_DELTA.members["redactedContent"] - ) - ) - - -@dataclass -class ReasoningContentBlockDeltaSignature: - """ - A token that verifies that the reasoning text was generated by the - model. If you pass a reasoning block back to the API in a multi-turn - conversation, include the text and its signature unmodified. - """ - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REASONING_CONTENT_BLOCK_DELTA, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_REASONING_CONTENT_BLOCK_DELTA.members["signature"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string( - _SCHEMA_REASONING_CONTENT_BLOCK_DELTA.members["signature"] - ) - ) - - -@dataclass -class ReasoningContentBlockDeltaUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ReasoningContentBlockDelta = Union[ - ReasoningContentBlockDeltaText - | ReasoningContentBlockDeltaRedactedContent - | ReasoningContentBlockDeltaSignature - | ReasoningContentBlockDeltaUnknown -] -""" -Contains content regarding the reasoning that is carried out by the -model with respect to the content in the content block. Reasoning refers -to a Chain of Thought (CoT) that the model generates to enhance the -accuracy of its final response. -""" - - -class _ReasoningContentBlockDeltaDeserializer: - _result: ReasoningContentBlockDelta | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> ReasoningContentBlockDelta: - self._result = None - deserializer.read_struct(_SCHEMA_REASONING_CONTENT_BLOCK_DELTA, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(ReasoningContentBlockDeltaText.deserialize(de)) - - case 1: - self._set_result( - ReasoningContentBlockDeltaRedactedContent.deserialize(de) - ) - - case 2: - self._set_result(ReasoningContentBlockDeltaSignature.deserialize(de)) - - case _: - self._set_result( - ReasoningContentBlockDeltaUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: ReasoningContentBlockDelta) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass -class ToolResultBlockDeltaText: - """The reasoning the model used to return the output.""" - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_RESULT_BLOCK_DELTA, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_TOOL_RESULT_BLOCK_DELTA.members["text"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string( - _SCHEMA_TOOL_RESULT_BLOCK_DELTA.members["text"] - ) - ) - - -@dataclass -class ToolResultBlockDeltaJson: - """ - The JSON schema for the tool result content block. see [JSON Schema - Reference](https://json-schema.org/understanding-json-schema/reference). - """ - - value: Document - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_RESULT_BLOCK_DELTA, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_document( - _SCHEMA_TOOL_RESULT_BLOCK_DELTA.members["json"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_document( - _SCHEMA_TOOL_RESULT_BLOCK_DELTA.members["json"] - ) - ) - - -@dataclass -class ToolResultBlockDeltaUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ToolResultBlockDelta = Union[ - ToolResultBlockDeltaText | ToolResultBlockDeltaJson | ToolResultBlockDeltaUnknown -] -""" -Contains incremental updates to tool results information during -streaming responses. This allows clients to build up tool results data -progressively as the response is generated. -""" - - -class _ToolResultBlockDeltaDeserializer: - _result: ToolResultBlockDelta | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> ToolResultBlockDelta: - self._result = None - deserializer.read_struct(_SCHEMA_TOOL_RESULT_BLOCK_DELTA, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(ToolResultBlockDeltaText.deserialize(de)) - - case 1: - self._set_result(ToolResultBlockDeltaJson.deserialize(de)) - - case _: - self._set_result( - ToolResultBlockDeltaUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: ToolResultBlockDelta) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_tool_result_blocks_delta( - serializer: ShapeSerializer, schema: Schema, value: list[ToolResultBlockDelta] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_tool_result_blocks_delta( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ToolResultBlockDelta]: - result: list[ToolResultBlockDelta] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_ToolResultBlockDeltaDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ToolUseBlockDelta: - """The delta for a tool use block.""" - - input: str - """The input for a requested tool.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_USE_BLOCK_DELTA, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_TOOL_USE_BLOCK_DELTA.members["input"], self.input - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["input"] = de.read_string( - _SCHEMA_TOOL_USE_BLOCK_DELTA.members["input"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TOOL_USE_BLOCK_DELTA, consumer=_consumer) - if "input" not in kwargs: - kwargs["input"] = "" - return kwargs - - -@dataclass -class ContentBlockDeltaText: - """The content text.""" - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT_BLOCK_DELTA, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_CONTENT_BLOCK_DELTA.members["text"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string(_SCHEMA_CONTENT_BLOCK_DELTA.members["text"]) - ) - - -@dataclass -class ContentBlockDeltaToolUse: - """Information about a tool that the model is requesting to use.""" - - value: ToolUseBlockDelta - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT_BLOCK_DELTA, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CONTENT_BLOCK_DELTA.members["toolUse"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ToolUseBlockDelta.deserialize(deserializer)) - - -@dataclass -class ContentBlockDeltaToolResult: - """An incremental update that contains the results from a tool call.""" - - value: list[ToolResultBlockDelta] - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT_BLOCK_DELTA, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_tool_result_blocks_delta( - serializer, _SCHEMA_CONTENT_BLOCK_DELTA.members["toolResult"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_deserialize_tool_result_blocks_delta( - deserializer, _SCHEMA_CONTENT_BLOCK_DELTA.members["toolResult"] - ) - ) - - -@dataclass -class ContentBlockDeltaReasoningContent: - """ - Contains content regarding the reasoning that is carried out by the - model. Reasoning refers to a Chain of Thought (CoT) that the model - generates to enhance the accuracy of its final response. - """ - - value: ReasoningContentBlockDelta - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT_BLOCK_DELTA, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CONTENT_BLOCK_DELTA.members["reasoningContent"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_ReasoningContentBlockDeltaDeserializer().deserialize(deserializer) - ) - - -@dataclass -class ContentBlockDeltaCitation: - """ - Incremental citation information that is streamed as part of the - response generation process. - """ - - value: CitationsDelta - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT_BLOCK_DELTA, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CONTENT_BLOCK_DELTA.members["citation"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=CitationsDelta.deserialize(deserializer)) - - -@dataclass -class ContentBlockDeltaImage: - """A streaming delta event containing incremental image data.""" - - value: ImageBlockDelta - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT_BLOCK_DELTA, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CONTENT_BLOCK_DELTA.members["image"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ImageBlockDelta.deserialize(deserializer)) - - -@dataclass -class ContentBlockDeltaUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ContentBlockDelta = Union[ - ContentBlockDeltaText - | ContentBlockDeltaToolUse - | ContentBlockDeltaToolResult - | ContentBlockDeltaReasoningContent - | ContentBlockDeltaCitation - | ContentBlockDeltaImage - | ContentBlockDeltaUnknown -] -"""A block of content in a streaming response.""" - - -class _ContentBlockDeltaDeserializer: - _result: ContentBlockDelta | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> ContentBlockDelta: - self._result = None - deserializer.read_struct(_SCHEMA_CONTENT_BLOCK_DELTA, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(ContentBlockDeltaText.deserialize(de)) - - case 1: - self._set_result(ContentBlockDeltaToolUse.deserialize(de)) - - case 2: - self._set_result(ContentBlockDeltaToolResult.deserialize(de)) - - case 3: - self._set_result(ContentBlockDeltaReasoningContent.deserialize(de)) - - case 4: - self._set_result(ContentBlockDeltaCitation.deserialize(de)) - - case 5: - self._set_result(ContentBlockDeltaImage.deserialize(de)) - - case _: - self._set_result( - ContentBlockDeltaUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: ContentBlockDelta) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class ContentBlockDeltaEvent: - """The content block delta event.""" - - delta: ContentBlockDelta - """The delta for a content block delta event.""" - - content_block_index: int - """The block index for a content block delta event.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT_BLOCK_DELTA_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CONTENT_BLOCK_DELTA_EVENT.members["delta"], self.delta - ) - serializer.write_integer( - _SCHEMA_CONTENT_BLOCK_DELTA_EVENT.members["contentBlockIndex"], - self.content_block_index, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["delta"] = _ContentBlockDeltaDeserializer().deserialize(de) - - case 1: - kwargs["content_block_index"] = de.read_integer( - _SCHEMA_CONTENT_BLOCK_DELTA_EVENT.members["contentBlockIndex"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONTENT_BLOCK_DELTA_EVENT, consumer=_consumer) - if "delta" not in kwargs: - kwargs["delta"] = ContentBlockDeltaUnknown(tag="") - if "content_block_index" not in kwargs: - kwargs["content_block_index"] = 0 - return kwargs - - -@dataclass(kw_only=True) -class ImageBlockStart: - """ - The initial event in a streaming image block that indicates the start of - image content. - """ - - format: str - """ - The format of the image data that will be streamed in subsequent delta - events. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IMAGE_BLOCK_START, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_IMAGE_BLOCK_START.members["format"], self.format - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["format"] = ImageFormat( - de.read_string(_SCHEMA_IMAGE_BLOCK_START.members["format"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_IMAGE_BLOCK_START, consumer=_consumer) - if "format" not in kwargs: - kwargs["format"] = ImageFormat._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class ToolResultBlockStart: - """ - The start of a tool result block. For more information, see [Call a tool - with the Converse - API](https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html) - in the Amazon Bedrock User Guide. - """ - - tool_use_id: str - """The ID of the tool that was used to generate this tool result block.""" - - type: str | None = None - """The type for the tool that was used to generate this tool result block.""" - - status: str | None = None - """The status of the tool result block.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_RESULT_BLOCK_START, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_TOOL_RESULT_BLOCK_START.members["toolUseId"], self.tool_use_id - ) - if self.type is not None: - serializer.write_string( - _SCHEMA_TOOL_RESULT_BLOCK_START.members["type"], self.type - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_TOOL_RESULT_BLOCK_START.members["status"], self.status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["tool_use_id"] = de.read_string( - _SCHEMA_TOOL_RESULT_BLOCK_START.members["toolUseId"] - ) - - case 1: - kwargs["type"] = de.read_string( - _SCHEMA_TOOL_RESULT_BLOCK_START.members["type"] - ) - - case 2: - kwargs["status"] = ToolResultStatus( - de.read_string( - _SCHEMA_TOOL_RESULT_BLOCK_START.members["status"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TOOL_RESULT_BLOCK_START, consumer=_consumer) - if "tool_use_id" not in kwargs: - kwargs["tool_use_id"] = "" - return kwargs - - -@dataclass(kw_only=True) -class ToolUseBlockStart: - """ - The start of a tool use block. For more information, see [Call a tool - with the Converse - API](https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html) - in the Amazon Bedrock User Guide. - """ - - tool_use_id: str - """The ID for the tool request.""" - - name: str - """The name of the tool that the model is requesting to use.""" - - type: str | None = None - """The type for the tool request.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOOL_USE_BLOCK_START, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_TOOL_USE_BLOCK_START.members["toolUseId"], self.tool_use_id - ) - serializer.write_string(_SCHEMA_TOOL_USE_BLOCK_START.members["name"], self.name) - if self.type is not None: - serializer.write_string( - _SCHEMA_TOOL_USE_BLOCK_START.members["type"], self.type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["tool_use_id"] = de.read_string( - _SCHEMA_TOOL_USE_BLOCK_START.members["toolUseId"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_TOOL_USE_BLOCK_START.members["name"] - ) - - case 2: - kwargs["type"] = ToolUseType( - de.read_string(_SCHEMA_TOOL_USE_BLOCK_START.members["type"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TOOL_USE_BLOCK_START, consumer=_consumer) - if "tool_use_id" not in kwargs: - kwargs["tool_use_id"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - return kwargs - - -@dataclass -class ContentBlockStartToolUse: - """Information about a tool that the model is requesting to use.""" - - value: ToolUseBlockStart - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT_BLOCK_START, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CONTENT_BLOCK_START.members["toolUse"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ToolUseBlockStart.deserialize(deserializer)) - - -@dataclass -class ContentBlockStartToolResult: - """The""" - - value: ToolResultBlockStart - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT_BLOCK_START, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CONTENT_BLOCK_START.members["toolResult"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ToolResultBlockStart.deserialize(deserializer)) - - -@dataclass -class ContentBlockStartImage: - """The initial event indicating the start of a streaming image block.""" - - value: ImageBlockStart - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT_BLOCK_START, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CONTENT_BLOCK_START.members["image"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ImageBlockStart.deserialize(deserializer)) - - -@dataclass -class ContentBlockStartUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ContentBlockStart = Union[ - ContentBlockStartToolUse - | ContentBlockStartToolResult - | ContentBlockStartImage - | ContentBlockStartUnknown -] -"""Content block start information.""" - - -class _ContentBlockStartDeserializer: - _result: ContentBlockStart | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> ContentBlockStart: - self._result = None - deserializer.read_struct(_SCHEMA_CONTENT_BLOCK_START, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(ContentBlockStartToolUse.deserialize(de)) - - case 1: - self._set_result(ContentBlockStartToolResult.deserialize(de)) - - case 2: - self._set_result(ContentBlockStartImage.deserialize(de)) - - case _: - self._set_result( - ContentBlockStartUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: ContentBlockStart) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class ContentBlockStartEvent: - """Content block start event.""" - - start: ContentBlockStart - """Start information about a content block start event.""" - - content_block_index: int - """The index for a content block start event.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT_BLOCK_START_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CONTENT_BLOCK_START_EVENT.members["start"], self.start - ) - serializer.write_integer( - _SCHEMA_CONTENT_BLOCK_START_EVENT.members["contentBlockIndex"], - self.content_block_index, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["start"] = _ContentBlockStartDeserializer().deserialize(de) - - case 1: - kwargs["content_block_index"] = de.read_integer( - _SCHEMA_CONTENT_BLOCK_START_EVENT.members["contentBlockIndex"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONTENT_BLOCK_START_EVENT, consumer=_consumer) - if "start" not in kwargs: - kwargs["start"] = ContentBlockStartUnknown(tag="") - if "content_block_index" not in kwargs: - kwargs["content_block_index"] = 0 - return kwargs - - -@dataclass(kw_only=True) -class ContentBlockStopEvent: - """A content block stop event.""" - - content_block_index: int - """The index for a content block.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT_BLOCK_STOP_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer( - _SCHEMA_CONTENT_BLOCK_STOP_EVENT.members["contentBlockIndex"], - self.content_block_index, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["content_block_index"] = de.read_integer( - _SCHEMA_CONTENT_BLOCK_STOP_EVENT.members["contentBlockIndex"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONTENT_BLOCK_STOP_EVENT, consumer=_consumer) - if "content_block_index" not in kwargs: - kwargs["content_block_index"] = 0 - return kwargs - - -@dataclass(kw_only=True) -class MessageStartEvent: - """The start of a message.""" - - role: str - """The role for the message.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MESSAGE_START_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_MESSAGE_START_EVENT.members["role"], self.role) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["role"] = ConversationRole( - de.read_string(_SCHEMA_MESSAGE_START_EVENT.members["role"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MESSAGE_START_EVENT, consumer=_consumer) - if "role" not in kwargs: - kwargs["role"] = ConversationRole._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class MessageStopEvent: - """The stop event for a message.""" - - stop_reason: str - """The reason why the model stopped generating output.""" - - additional_model_response_fields: Document | None = None - """The additional model response fields.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MESSAGE_STOP_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MESSAGE_STOP_EVENT.members["stopReason"], self.stop_reason - ) - if self.additional_model_response_fields is not None: - serializer.write_document( - _SCHEMA_MESSAGE_STOP_EVENT.members["additionalModelResponseFields"], - self.additional_model_response_fields, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["stop_reason"] = StopReason( - de.read_string(_SCHEMA_MESSAGE_STOP_EVENT.members["stopReason"]) - ) - - case 1: - kwargs["additional_model_response_fields"] = de.read_document( - _SCHEMA_MESSAGE_STOP_EVENT.members[ - "additionalModelResponseFields" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MESSAGE_STOP_EVENT, consumer=_consumer) - if "stop_reason" not in kwargs: - kwargs["stop_reason"] = StopReason._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class ConverseStreamMetrics: - """Metrics for the stream.""" - - latency_ms: int - """The latency for the streaming request, in milliseconds.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONVERSE_STREAM_METRICS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_long( - _SCHEMA_CONVERSE_STREAM_METRICS.members["latencyMs"], self.latency_ms - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["latency_ms"] = de.read_long( - _SCHEMA_CONVERSE_STREAM_METRICS.members["latencyMs"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONVERSE_STREAM_METRICS, consumer=_consumer) - if "latency_ms" not in kwargs: - kwargs["latency_ms"] = 0 - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(latency_ms=0) - - -@dataclass(kw_only=True) -class ConverseStreamTrace: - """ - The trace object in a response from - [ConverseStream](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html). - """ - - guardrail: GuardrailTraceAssessment | None = None - """The guardrail trace object.""" - - prompt_router: PromptRouterTrace | None = None - """The request's prompt router.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONVERSE_STREAM_TRACE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.guardrail is not None: - serializer.write_struct( - _SCHEMA_CONVERSE_STREAM_TRACE.members["guardrail"], self.guardrail - ) - - if self.prompt_router is not None: - serializer.write_struct( - _SCHEMA_CONVERSE_STREAM_TRACE.members["promptRouter"], - self.prompt_router, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["guardrail"] = GuardrailTraceAssessment.deserialize(de) - - case 1: - kwargs["prompt_router"] = PromptRouterTrace.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONVERSE_STREAM_TRACE, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ConverseStreamMetadataEvent: - """A conversation stream metadata event.""" - - usage: TokenUsage - """Usage information for the conversation stream event.""" - - metrics: ConverseStreamMetrics - """The metrics for the conversation stream metadata event.""" - - trace: ConverseStreamTrace | None = None - """ - The trace object in the response from - [ConverseStream](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html) - that contains information about the guardrail behavior. - """ - - performance_config: PerformanceConfiguration | None = None - """ - Model performance configuration metadata for the conversation stream - event. - """ - - service_tier: ServiceTier | None = None - """ - Specifies the processing tier configuration used for serving the - request. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONVERSE_STREAM_METADATA_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CONVERSE_STREAM_METADATA_EVENT.members["usage"], self.usage - ) - serializer.write_struct( - _SCHEMA_CONVERSE_STREAM_METADATA_EVENT.members["metrics"], self.metrics - ) - if self.trace is not None: - serializer.write_struct( - _SCHEMA_CONVERSE_STREAM_METADATA_EVENT.members["trace"], self.trace - ) - - if self.performance_config is not None: - serializer.write_struct( - _SCHEMA_CONVERSE_STREAM_METADATA_EVENT.members["performanceConfig"], - self.performance_config, - ) - - if self.service_tier is not None: - serializer.write_struct( - _SCHEMA_CONVERSE_STREAM_METADATA_EVENT.members["serviceTier"], - self.service_tier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["usage"] = TokenUsage.deserialize(de) - - case 1: - kwargs["metrics"] = ConverseStreamMetrics.deserialize(de) - - case 2: - kwargs["trace"] = ConverseStreamTrace.deserialize(de) - - case 3: - kwargs["performance_config"] = PerformanceConfiguration.deserialize( - de - ) - - case 4: - kwargs["service_tier"] = ServiceTier.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CONVERSE_STREAM_METADATA_EVENT, consumer=_consumer - ) - if "usage" not in kwargs: - kwargs["usage"] = TokenUsage._smithy_default() - if "metrics" not in kwargs: - kwargs["metrics"] = ConverseStreamMetrics._smithy_default() - return kwargs - - -@dataclass(kw_only=True) -class ModelStreamErrorException(ServiceError): - """An error occurred while streaming the response. Retry your request.""" - - fault: Literal["client", "server"] | None = "client" - - original_status_code: int | None = None - """The original status code.""" - - original_message: str | None = None - """The original message.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MODEL_STREAM_ERROR_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_MODEL_STREAM_ERROR_EXCEPTION.members["message"], self.message - ) - - if self.original_status_code is not None: - serializer.write_integer( - _SCHEMA_MODEL_STREAM_ERROR_EXCEPTION.members["originalStatusCode"], - self.original_status_code, - ) - - if self.original_message is not None: - serializer.write_string( - _SCHEMA_MODEL_STREAM_ERROR_EXCEPTION.members["originalMessage"], - self.original_message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_MODEL_STREAM_ERROR_EXCEPTION.members["message"] - ) - - case 1: - kwargs["original_status_code"] = de.read_integer( - _SCHEMA_MODEL_STREAM_ERROR_EXCEPTION.members[ - "originalStatusCode" - ] - ) - - case 2: - kwargs["original_message"] = de.read_string( - _SCHEMA_MODEL_STREAM_ERROR_EXCEPTION.members["originalMessage"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MODEL_STREAM_ERROR_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass -class ConverseStreamOutputMessageStart: - """Message start information.""" - - value: MessageStartEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONVERSE_STREAM_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CONVERSE_STREAM_OUTPUT.members["messageStart"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=MessageStartEvent.deserialize(deserializer)) - - -@dataclass -class ConverseStreamOutputContentBlockStart: - """Start information for a content block.""" - - value: ContentBlockStartEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONVERSE_STREAM_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CONVERSE_STREAM_OUTPUT.members["contentBlockStart"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ContentBlockStartEvent.deserialize(deserializer)) - - -@dataclass -class ConverseStreamOutputContentBlockDelta: - """The messages output content block delta.""" - - value: ContentBlockDeltaEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONVERSE_STREAM_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CONVERSE_STREAM_OUTPUT.members["contentBlockDelta"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ContentBlockDeltaEvent.deserialize(deserializer)) - - -@dataclass -class ConverseStreamOutputContentBlockStop: - """Stop information for a content block.""" - - value: ContentBlockStopEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONVERSE_STREAM_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CONVERSE_STREAM_OUTPUT.members["contentBlockStop"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ContentBlockStopEvent.deserialize(deserializer)) - - -@dataclass -class ConverseStreamOutputMessageStop: - """Message stop information.""" - - value: MessageStopEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONVERSE_STREAM_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CONVERSE_STREAM_OUTPUT.members["messageStop"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=MessageStopEvent.deserialize(deserializer)) - - -@dataclass -class ConverseStreamOutputMetadata: - """Metadata for the converse output stream.""" - - value: ConverseStreamMetadataEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONVERSE_STREAM_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CONVERSE_STREAM_OUTPUT.members["metadata"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ConverseStreamMetadataEvent.deserialize(deserializer)) - - -@dataclass -class ConverseStreamOutputInternalServerException: - """An internal server error occurred. Retry your request.""" - - value: InternalServerException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONVERSE_STREAM_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CONVERSE_STREAM_OUTPUT.members["internalServerException"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=InternalServerException.deserialize(deserializer)) - - -@dataclass -class ConverseStreamOutputModelStreamErrorException: - """A streaming error occurred. Retry your request.""" - - value: ModelStreamErrorException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONVERSE_STREAM_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CONVERSE_STREAM_OUTPUT.members["modelStreamErrorException"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ModelStreamErrorException.deserialize(deserializer)) - - -@dataclass -class ConverseStreamOutputValidationException: - """ - The input fails to satisfy the constraints specified by *Amazon - Bedrock*. For troubleshooting this error, see - [ValidationError](https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-validation-error) - in the Amazon Bedrock User Guide. - """ - - value: ValidationException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONVERSE_STREAM_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CONVERSE_STREAM_OUTPUT.members["validationException"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ValidationException.deserialize(deserializer)) - - -@dataclass -class ConverseStreamOutputThrottlingException: - """ - Your request was denied due to exceeding the account quotas for *Amazon - Bedrock*. For troubleshooting this error, see - [ThrottlingException](https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-throttling-exception) - in the Amazon Bedrock User Guide. - """ - - value: ThrottlingException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONVERSE_STREAM_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CONVERSE_STREAM_OUTPUT.members["throttlingException"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ThrottlingException.deserialize(deserializer)) - - -@dataclass -class ConverseStreamOutputServiceUnavailableException: - """ - The service isn't currently available. For troubleshooting this error, - see - [ServiceUnavailable](https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-service-unavailable) - in the Amazon Bedrock User Guide - """ - - value: ServiceUnavailableException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONVERSE_STREAM_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CONVERSE_STREAM_OUTPUT.members["serviceUnavailableException"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ServiceUnavailableException.deserialize(deserializer)) - - -@dataclass -class ConverseStreamOutputUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ConverseStreamOutput = Union[ - ConverseStreamOutputMessageStart - | ConverseStreamOutputContentBlockStart - | ConverseStreamOutputContentBlockDelta - | ConverseStreamOutputContentBlockStop - | ConverseStreamOutputMessageStop - | ConverseStreamOutputMetadata - | ConverseStreamOutputInternalServerException - | ConverseStreamOutputModelStreamErrorException - | ConverseStreamOutputValidationException - | ConverseStreamOutputThrottlingException - | ConverseStreamOutputServiceUnavailableException - | ConverseStreamOutputUnknown -] -"""The messages output stream""" - - -class _ConverseStreamOutputDeserializer: - _result: ConverseStreamOutput | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> ConverseStreamOutput: - self._result = None - deserializer.read_struct(_SCHEMA_CONVERSE_STREAM_OUTPUT, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(ConverseStreamOutputMessageStart.deserialize(de)) - - case 1: - self._set_result(ConverseStreamOutputContentBlockStart.deserialize(de)) - - case 2: - self._set_result(ConverseStreamOutputContentBlockDelta.deserialize(de)) - - case 3: - self._set_result(ConverseStreamOutputContentBlockStop.deserialize(de)) - - case 4: - self._set_result(ConverseStreamOutputMessageStop.deserialize(de)) - - case 5: - self._set_result(ConverseStreamOutputMetadata.deserialize(de)) - - case 6: - self._set_result( - ConverseStreamOutputInternalServerException.deserialize(de) - ) - - case 7: - self._set_result( - ConverseStreamOutputModelStreamErrorException.deserialize(de) - ) - - case 8: - self._set_result( - ConverseStreamOutputValidationException.deserialize(de) - ) - - case 9: - self._set_result( - ConverseStreamOutputThrottlingException.deserialize(de) - ) - - case 10: - self._set_result( - ConverseStreamOutputServiceUnavailableException.deserialize(de) - ) - - case _: - self._set_result( - ConverseStreamOutputUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: ConverseStreamOutput) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class ConverseStreamOperationOutput: - """Dataclass for ConverseStreamOperationOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONVERSE_STREAM_OPERATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CONVERSE_STREAM_OPERATION_OUTPUT, consumer=_consumer - ) - return kwargs - - -CONVERSE_STREAM = APIOperation( - input=ConverseStreamInput, - output=ConverseStreamOperationOutput, - schema=_SCHEMA_CONVERSE_STREAM, - input_schema=_SCHEMA_CONVERSE_STREAM_INPUT, - output_schema=_SCHEMA_CONVERSE_STREAM_OPERATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockruntime#ModelErrorException" - ): ModelErrorException, - ShapeID( - "com.amazonaws.bedrockruntime#ModelNotReadyException" - ): ModelNotReadyException, - ShapeID( - "com.amazonaws.bedrockruntime#ModelTimeoutException" - ): ModelTimeoutException, - ShapeID( - "com.amazonaws.bedrockruntime#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockruntime#ServiceUnavailableException" - ): ServiceUnavailableException, - ShapeID( - "com.amazonaws.bedrockruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockruntime#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_MODEL_ERROR_EXCEPTION, - _SCHEMA_MODEL_NOT_READY_EXCEPTION, - _SCHEMA_MODEL_TIMEOUT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_UNAVAILABLE_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class Trace(UnknownEnumMixin, StrEnum): - ENABLED = "ENABLED" - DISABLED = "DISABLED" - ENABLED_FULL = "ENABLED_FULL" - - -@dataclass(kw_only=True) -class InvokeModelInput: - """Dataclass for InvokeModelInput structure.""" - - body: bytes | None = field(repr=False, default=None) - """ - The prompt and inference parameters in the format specified in the - `contentType` in the header. You must provide the body in JSON format. - To see the format and content of the request and response bodies for - different models, refer to [Inference - parameters](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). - For more information, see [Run - inference](https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html) - in the Bedrock User Guide. - """ - - content_type: str | None = None - """ - The MIME type of the input data in the request. You must specify - `application/json`. - """ - - accept: str | None = None - """ - The desired MIME type of the inference body in the response. The default - value is `application/json`. - """ - - model_id: str | None = None - """ - The unique identifier of the model to invoke to run inference. - - The `modelId` to provide depends on the type of model or throughput that - you use: - - - If you use a base model, specify the model ID or its ARN. For a list - of model IDs for base models, see [Amazon Bedrock base model IDs - (on-demand - throughput)](https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns) - in the Amazon Bedrock User Guide. - - - If you use an inference profile, specify the inference profile ID or - its ARN. For a list of inference profile IDs, see [Supported Regions - and models for cross-region - inference](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference-support.html) - in the Amazon Bedrock User Guide. - - - If you use a provisioned model, specify the ARN of the Provisioned - Throughput. For more information, see [Run inference using a - Provisioned - Throughput](https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html) - in the Amazon Bedrock User Guide. - - - If you use a custom model, specify the ARN of the custom model - deployment (for on-demand inference) or the ARN of your provisioned - model (for Provisioned Throughput). For more information, see [Use a - custom model in Amazon - Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html) - in the Amazon Bedrock User Guide. - - - If you use an [imported - model](https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-import-model.html), - specify the ARN of the imported model. You can get the model ARN from - a successful call to - [CreateModelImportJob](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_CreateModelImportJob.html) - or from the Imported models page in the Amazon Bedrock console. - """ - - trace: str | None = None - """ - Specifies whether to enable or disable the Bedrock trace. If enabled, - you can see the full Bedrock trace. - """ - - guardrail_identifier: str | None = None - """ - The unique identifier of the guardrail that you want to use. If you - don't provide a value, no guardrail is applied to the invocation. - - An error will be thrown in the following situations. - - - You don't provide a guardrail identifier but you specify the - `amazon-bedrock-guardrailConfig` field in the request body. - - - You enable the guardrail but the `contentType` isn't - `application/json`. - - - You provide a guardrail identifier, but `guardrailVersion` isn't - specified. - """ - - guardrail_version: str | None = None - """The version number for the guardrail. The value can also be `DRAFT`.""" - - performance_config_latency: str = PerformanceConfigLatency("standard") - """Model performance settings for the request.""" - - service_tier: str | None = None - """Specifies the processing tier type used for serving the request.""" - - request_metadata: str | None = field(repr=False, default=None) - """Key-value pairs that you can use to filter invocation logs.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOKE_MODEL_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.body is not None: - serializer.write_blob(_SCHEMA_INVOKE_MODEL_INPUT.members["body"], self.body) - - if self.content_type is not None: - serializer.write_string( - _SCHEMA_INVOKE_MODEL_INPUT.members["contentType"], self.content_type - ) - - if self.accept is not None: - serializer.write_string( - _SCHEMA_INVOKE_MODEL_INPUT.members["accept"], self.accept - ) - - if self.model_id is not None: - serializer.write_string( - _SCHEMA_INVOKE_MODEL_INPUT.members["modelId"], self.model_id - ) - - if self.trace is not None: - serializer.write_string( - _SCHEMA_INVOKE_MODEL_INPUT.members["trace"], self.trace - ) - - if self.guardrail_identifier is not None: - serializer.write_string( - _SCHEMA_INVOKE_MODEL_INPUT.members["guardrailIdentifier"], - self.guardrail_identifier, - ) - - if self.guardrail_version is not None: - serializer.write_string( - _SCHEMA_INVOKE_MODEL_INPUT.members["guardrailVersion"], - self.guardrail_version, - ) - - if self.performance_config_latency is not None: - serializer.write_string( - _SCHEMA_INVOKE_MODEL_INPUT.members["performanceConfigLatency"], - self.performance_config_latency, - ) - - if self.service_tier is not None: - serializer.write_string( - _SCHEMA_INVOKE_MODEL_INPUT.members["serviceTier"], self.service_tier - ) - - if self.request_metadata is not None: - serializer.write_string( - _SCHEMA_INVOKE_MODEL_INPUT.members["requestMetadata"], - self.request_metadata, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["body"] = de.read_blob( - _SCHEMA_INVOKE_MODEL_INPUT.members["body"] - ) - - case 1: - kwargs["content_type"] = de.read_string( - _SCHEMA_INVOKE_MODEL_INPUT.members["contentType"] - ) - - case 2: - kwargs["accept"] = de.read_string( - _SCHEMA_INVOKE_MODEL_INPUT.members["accept"] - ) - - case 3: - kwargs["model_id"] = de.read_string( - _SCHEMA_INVOKE_MODEL_INPUT.members["modelId"] - ) - - case 4: - kwargs["trace"] = Trace( - de.read_string(_SCHEMA_INVOKE_MODEL_INPUT.members["trace"]) - ) - - case 5: - kwargs["guardrail_identifier"] = de.read_string( - _SCHEMA_INVOKE_MODEL_INPUT.members["guardrailIdentifier"] - ) - - case 6: - kwargs["guardrail_version"] = de.read_string( - _SCHEMA_INVOKE_MODEL_INPUT.members["guardrailVersion"] - ) - - case 7: - kwargs["performance_config_latency"] = PerformanceConfigLatency( - de.read_string( - _SCHEMA_INVOKE_MODEL_INPUT.members[ - "performanceConfigLatency" - ] - ) - ) - - case 8: - kwargs["service_tier"] = ServiceTierType( - de.read_string( - _SCHEMA_INVOKE_MODEL_INPUT.members["serviceTier"] - ) - ) - - case 9: - kwargs["request_metadata"] = de.read_string( - _SCHEMA_INVOKE_MODEL_INPUT.members["requestMetadata"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INVOKE_MODEL_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class InvokeModelOutput: - """Dataclass for InvokeModelOutput structure.""" - - body: bytes = field(repr=False) - """ - Inference response from the model in the format specified in the - `contentType` header. To see the format and content of the request and - response bodies for different models, refer to [Inference - parameters](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). - """ - - content_type: str - """The MIME type of the inference result.""" - - performance_config_latency: str | None = None - """Model performance settings for the request.""" - - service_tier: str | None = None - """Specifies the processing tier type used for serving the request.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOKE_MODEL_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_blob(_SCHEMA_INVOKE_MODEL_OUTPUT.members["body"], self.body) - serializer.write_string( - _SCHEMA_INVOKE_MODEL_OUTPUT.members["contentType"], self.content_type - ) - if self.performance_config_latency is not None: - serializer.write_string( - _SCHEMA_INVOKE_MODEL_OUTPUT.members["performanceConfigLatency"], - self.performance_config_latency, - ) - - if self.service_tier is not None: - serializer.write_string( - _SCHEMA_INVOKE_MODEL_OUTPUT.members["serviceTier"], self.service_tier - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["body"] = de.read_blob( - _SCHEMA_INVOKE_MODEL_OUTPUT.members["body"] - ) - - case 1: - kwargs["content_type"] = de.read_string( - _SCHEMA_INVOKE_MODEL_OUTPUT.members["contentType"] - ) - - case 2: - kwargs["performance_config_latency"] = PerformanceConfigLatency( - de.read_string( - _SCHEMA_INVOKE_MODEL_OUTPUT.members[ - "performanceConfigLatency" - ] - ) - ) - - case 3: - kwargs["service_tier"] = ServiceTierType( - de.read_string( - _SCHEMA_INVOKE_MODEL_OUTPUT.members["serviceTier"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INVOKE_MODEL_OUTPUT, consumer=_consumer) - if "body" not in kwargs: - kwargs["body"] = b"" - if "content_type" not in kwargs: - kwargs["content_type"] = "" - return kwargs - - -INVOKE_MODEL = APIOperation( - input=InvokeModelInput, - output=InvokeModelOutput, - schema=_SCHEMA_INVOKE_MODEL, - input_schema=_SCHEMA_INVOKE_MODEL_INPUT, - output_schema=_SCHEMA_INVOKE_MODEL_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockruntime#ModelErrorException" - ): ModelErrorException, - ShapeID( - "com.amazonaws.bedrockruntime#ModelNotReadyException" - ): ModelNotReadyException, - ShapeID( - "com.amazonaws.bedrockruntime#ModelTimeoutException" - ): ModelTimeoutException, - ShapeID( - "com.amazonaws.bedrockruntime#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockruntime#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockruntime#ServiceUnavailableException" - ): ServiceUnavailableException, - ShapeID( - "com.amazonaws.bedrockruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockruntime#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_MODEL_ERROR_EXCEPTION, - _SCHEMA_MODEL_NOT_READY_EXCEPTION, - _SCHEMA_MODEL_TIMEOUT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_SERVICE_UNAVAILABLE_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class BidirectionalInputPayloadPart: - """ - Payload content for the bidirectional input. The input is an audio - stream. - """ - - bytes_: bytes | None = field(repr=False, default=None) - """The audio content for the bidirectional input.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BIDIRECTIONAL_INPUT_PAYLOAD_PART, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.bytes_ is not None: - serializer.write_blob( - _SCHEMA_BIDIRECTIONAL_INPUT_PAYLOAD_PART.members["bytes"], self.bytes_ - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bytes_"] = de.read_blob( - _SCHEMA_BIDIRECTIONAL_INPUT_PAYLOAD_PART.members["bytes"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_BIDIRECTIONAL_INPUT_PAYLOAD_PART, consumer=_consumer - ) - return kwargs - - -@dataclass -class InvokeModelWithBidirectionalStreamInputChunk: - """The audio chunk that is used as input for the invocation step.""" - - value: BidirectionalInputPayloadPart - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_INPUT.members["chunk"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=BidirectionalInputPayloadPart.deserialize(deserializer)) - - -@dataclass -class InvokeModelWithBidirectionalStreamInputUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -InvokeModelWithBidirectionalStreamInput = Union[ - InvokeModelWithBidirectionalStreamInputChunk - | InvokeModelWithBidirectionalStreamInputUnknown -] -""" -Payload content, the speech chunk, for the bidirectional input of the -invocation step. -""" - - -class _InvokeModelWithBidirectionalStreamInputDeserializer: - _result: InvokeModelWithBidirectionalStreamInput | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> InvokeModelWithBidirectionalStreamInput: - self._result = None - deserializer.read_struct( - _SCHEMA_INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_INPUT, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - InvokeModelWithBidirectionalStreamInputChunk.deserialize(de) - ) - - case _: - self._set_result( - InvokeModelWithBidirectionalStreamInputUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: InvokeModelWithBidirectionalStreamInput) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class InvokeModelWithBidirectionalStreamOperationInput: - """ - Dataclass for InvokeModelWithBidirectionalStreamOperationInput - structure. - """ - - model_id: str | None = None - """ - The model ID or ARN of the model ID to use. Currently, only - `amazon.nova-sonic-v1:0` is supported. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_OPERATION_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.model_id is not None: - serializer.write_string( - _SCHEMA_INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_OPERATION_INPUT.members[ - "modelId" - ], - self.model_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_id"] = de.read_string( - _SCHEMA_INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_OPERATION_INPUT.members[ - "modelId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_OPERATION_INPUT, - consumer=_consumer, - ) - return kwargs - - -@dataclass(kw_only=True) -class BidirectionalOutputPayloadPart: - """ - Output from the bidirectional stream. The output is speech and a text - transcription. - """ - - bytes_: bytes | None = field(repr=False, default=None) - """The speech output of the bidirectional stream.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BIDIRECTIONAL_OUTPUT_PAYLOAD_PART, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.bytes_ is not None: - serializer.write_blob( - _SCHEMA_BIDIRECTIONAL_OUTPUT_PAYLOAD_PART.members["bytes"], self.bytes_ - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bytes_"] = de.read_blob( - _SCHEMA_BIDIRECTIONAL_OUTPUT_PAYLOAD_PART.members["bytes"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_BIDIRECTIONAL_OUTPUT_PAYLOAD_PART, consumer=_consumer - ) - return kwargs - - -@dataclass -class InvokeModelWithBidirectionalStreamOutputChunk: - """The speech chunk that was provided as output from the invocation step.""" - - value: BidirectionalOutputPayloadPart - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_OUTPUT.members["chunk"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=BidirectionalOutputPayloadPart.deserialize(deserializer)) - - -@dataclass -class InvokeModelWithBidirectionalStreamOutputInternalServerException: - """The request encountered an unknown internal error.""" - - value: InternalServerException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_OUTPUT.members[ - "internalServerException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=InternalServerException.deserialize(deserializer)) - - -@dataclass -class InvokeModelWithBidirectionalStreamOutputModelStreamErrorException: - """The request encountered an error with the model stream.""" - - value: ModelStreamErrorException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_OUTPUT.members[ - "modelStreamErrorException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ModelStreamErrorException.deserialize(deserializer)) - - -@dataclass -class InvokeModelWithBidirectionalStreamOutputValidationException: - """ - The input fails to satisfy the constraints specified by an Amazon Web - Services service. - """ - - value: ValidationException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_OUTPUT.members[ - "validationException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ValidationException.deserialize(deserializer)) - - -@dataclass -class InvokeModelWithBidirectionalStreamOutputThrottlingException: - """The request was denied due to request throttling.""" - - value: ThrottlingException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_OUTPUT.members[ - "throttlingException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ThrottlingException.deserialize(deserializer)) - - -@dataclass -class InvokeModelWithBidirectionalStreamOutputModelTimeoutException: - """ - The connection was closed because a request was not received within the - timeout period. - """ - - value: ModelTimeoutException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_OUTPUT.members[ - "modelTimeoutException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ModelTimeoutException.deserialize(deserializer)) - - -@dataclass -class InvokeModelWithBidirectionalStreamOutputServiceUnavailableException: - """The request has failed due to a temporary failure of the server.""" - - value: ServiceUnavailableException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_OUTPUT.members[ - "serviceUnavailableException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ServiceUnavailableException.deserialize(deserializer)) - - -@dataclass -class InvokeModelWithBidirectionalStreamOutputUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -InvokeModelWithBidirectionalStreamOutput = Union[ - InvokeModelWithBidirectionalStreamOutputChunk - | InvokeModelWithBidirectionalStreamOutputInternalServerException - | InvokeModelWithBidirectionalStreamOutputModelStreamErrorException - | InvokeModelWithBidirectionalStreamOutputValidationException - | InvokeModelWithBidirectionalStreamOutputThrottlingException - | InvokeModelWithBidirectionalStreamOutputModelTimeoutException - | InvokeModelWithBidirectionalStreamOutputServiceUnavailableException - | InvokeModelWithBidirectionalStreamOutputUnknown -] -"""Output from the bidirectional stream that was used for model invocation.""" - - -class _InvokeModelWithBidirectionalStreamOutputDeserializer: - _result: InvokeModelWithBidirectionalStreamOutput | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> InvokeModelWithBidirectionalStreamOutput: - self._result = None - deserializer.read_struct( - _SCHEMA_INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_OUTPUT, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - InvokeModelWithBidirectionalStreamOutputChunk.deserialize(de) - ) - - case 1: - self._set_result( - InvokeModelWithBidirectionalStreamOutputInternalServerException.deserialize( - de - ) - ) - - case 2: - self._set_result( - InvokeModelWithBidirectionalStreamOutputModelStreamErrorException.deserialize( - de - ) - ) - - case 3: - self._set_result( - InvokeModelWithBidirectionalStreamOutputValidationException.deserialize( - de - ) - ) - - case 4: - self._set_result( - InvokeModelWithBidirectionalStreamOutputThrottlingException.deserialize( - de - ) - ) - - case 5: - self._set_result( - InvokeModelWithBidirectionalStreamOutputModelTimeoutException.deserialize( - de - ) - ) - - case 6: - self._set_result( - InvokeModelWithBidirectionalStreamOutputServiceUnavailableException.deserialize( - de - ) - ) - - case _: - self._set_result( - InvokeModelWithBidirectionalStreamOutputUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: InvokeModelWithBidirectionalStreamOutput) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class InvokeModelWithBidirectionalStreamOperationOutput: - """ - Dataclass for InvokeModelWithBidirectionalStreamOperationOutput - structure. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_OPERATION_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_OPERATION_OUTPUT, - consumer=_consumer, - ) - return kwargs - - -INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM = APIOperation( - input=InvokeModelWithBidirectionalStreamOperationInput, - output=InvokeModelWithBidirectionalStreamOperationOutput, - schema=_SCHEMA_INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM, - input_schema=_SCHEMA_INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_OPERATION_INPUT, - output_schema=_SCHEMA_INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM_OPERATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockruntime#ModelErrorException" - ): ModelErrorException, - ShapeID( - "com.amazonaws.bedrockruntime#ModelNotReadyException" - ): ModelNotReadyException, - ShapeID( - "com.amazonaws.bedrockruntime#ModelStreamErrorException" - ): ModelStreamErrorException, - ShapeID( - "com.amazonaws.bedrockruntime#ModelTimeoutException" - ): ModelTimeoutException, - ShapeID( - "com.amazonaws.bedrockruntime#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockruntime#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockruntime#ServiceUnavailableException" - ): ServiceUnavailableException, - ShapeID( - "com.amazonaws.bedrockruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockruntime#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_MODEL_ERROR_EXCEPTION, - _SCHEMA_MODEL_NOT_READY_EXCEPTION, - _SCHEMA_MODEL_STREAM_ERROR_EXCEPTION, - _SCHEMA_MODEL_TIMEOUT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_SERVICE_UNAVAILABLE_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class InvokeModelWithResponseStreamInput: - """Dataclass for InvokeModelWithResponseStreamInput structure.""" - - body: bytes | None = field(repr=False, default=None) - """ - The prompt and inference parameters in the format specified in the - `contentType` in the header. You must provide the body in JSON format. - To see the format and content of the request and response bodies for - different models, refer to [Inference - parameters](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). - For more information, see [Run - inference](https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html) - in the Bedrock User Guide. - """ - - content_type: str | None = None - """ - The MIME type of the input data in the request. You must specify - `application/json`. - """ - - accept: str | None = None - """ - The desired MIME type of the inference body in the response. The default - value is `application/json`. - """ - - model_id: str | None = None - """ - The unique identifier of the model to invoke to run inference. - - The `modelId` to provide depends on the type of model or throughput that - you use: - - - If you use a base model, specify the model ID or its ARN. For a list - of model IDs for base models, see [Amazon Bedrock base model IDs - (on-demand - throughput)](https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns) - in the Amazon Bedrock User Guide. - - - If you use an inference profile, specify the inference profile ID or - its ARN. For a list of inference profile IDs, see [Supported Regions - and models for cross-region - inference](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference-support.html) - in the Amazon Bedrock User Guide. - - - If you use a provisioned model, specify the ARN of the Provisioned - Throughput. For more information, see [Run inference using a - Provisioned - Throughput](https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html) - in the Amazon Bedrock User Guide. - - - If you use a custom model, specify the ARN of the custom model - deployment (for on-demand inference) or the ARN of your provisioned - model (for Provisioned Throughput). For more information, see [Use a - custom model in Amazon - Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html) - in the Amazon Bedrock User Guide. - - - If you use an [imported - model](https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-import-model.html), - specify the ARN of the imported model. You can get the model ARN from - a successful call to - [CreateModelImportJob](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_CreateModelImportJob.html) - or from the Imported models page in the Amazon Bedrock console. - """ - - trace: str | None = None - """ - Specifies whether to enable or disable the Bedrock trace. If enabled, - you can see the full Bedrock trace. - """ - - guardrail_identifier: str | None = None - """ - The unique identifier of the guardrail that you want to use. If you - don't provide a value, no guardrail is applied to the invocation. - - An error is thrown in the following situations. - - - You don't provide a guardrail identifier but you specify the - `amazon-bedrock-guardrailConfig` field in the request body. - - - You enable the guardrail but the `contentType` isn't - `application/json`. - - - You provide a guardrail identifier, but `guardrailVersion` isn't - specified. - """ - - guardrail_version: str | None = None - """The version number for the guardrail. The value can also be `DRAFT`.""" - - performance_config_latency: str = PerformanceConfigLatency("standard") - """Model performance settings for the request.""" - - service_tier: str | None = None - """Specifies the processing tier type used for serving the request.""" - - request_metadata: str | None = field(repr=False, default=None) - """Key-value pairs that you can use to filter invocation logs.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOKE_MODEL_WITH_RESPONSE_STREAM_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.body is not None: - serializer.write_blob( - _SCHEMA_INVOKE_MODEL_WITH_RESPONSE_STREAM_INPUT.members["body"], - self.body, - ) - - if self.content_type is not None: - serializer.write_string( - _SCHEMA_INVOKE_MODEL_WITH_RESPONSE_STREAM_INPUT.members["contentType"], - self.content_type, - ) - - if self.accept is not None: - serializer.write_string( - _SCHEMA_INVOKE_MODEL_WITH_RESPONSE_STREAM_INPUT.members["accept"], - self.accept, - ) - - if self.model_id is not None: - serializer.write_string( - _SCHEMA_INVOKE_MODEL_WITH_RESPONSE_STREAM_INPUT.members["modelId"], - self.model_id, - ) - - if self.trace is not None: - serializer.write_string( - _SCHEMA_INVOKE_MODEL_WITH_RESPONSE_STREAM_INPUT.members["trace"], - self.trace, - ) - - if self.guardrail_identifier is not None: - serializer.write_string( - _SCHEMA_INVOKE_MODEL_WITH_RESPONSE_STREAM_INPUT.members[ - "guardrailIdentifier" - ], - self.guardrail_identifier, - ) - - if self.guardrail_version is not None: - serializer.write_string( - _SCHEMA_INVOKE_MODEL_WITH_RESPONSE_STREAM_INPUT.members[ - "guardrailVersion" - ], - self.guardrail_version, - ) - - if self.performance_config_latency is not None: - serializer.write_string( - _SCHEMA_INVOKE_MODEL_WITH_RESPONSE_STREAM_INPUT.members[ - "performanceConfigLatency" - ], - self.performance_config_latency, - ) - - if self.service_tier is not None: - serializer.write_string( - _SCHEMA_INVOKE_MODEL_WITH_RESPONSE_STREAM_INPUT.members["serviceTier"], - self.service_tier, - ) - - if self.request_metadata is not None: - serializer.write_string( - _SCHEMA_INVOKE_MODEL_WITH_RESPONSE_STREAM_INPUT.members[ - "requestMetadata" - ], - self.request_metadata, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["body"] = de.read_blob( - _SCHEMA_INVOKE_MODEL_WITH_RESPONSE_STREAM_INPUT.members["body"] - ) - - case 1: - kwargs["content_type"] = de.read_string( - _SCHEMA_INVOKE_MODEL_WITH_RESPONSE_STREAM_INPUT.members[ - "contentType" - ] - ) - - case 2: - kwargs["accept"] = de.read_string( - _SCHEMA_INVOKE_MODEL_WITH_RESPONSE_STREAM_INPUT.members[ - "accept" - ] - ) - - case 3: - kwargs["model_id"] = de.read_string( - _SCHEMA_INVOKE_MODEL_WITH_RESPONSE_STREAM_INPUT.members[ - "modelId" - ] - ) - - case 4: - kwargs["trace"] = Trace( - de.read_string( - _SCHEMA_INVOKE_MODEL_WITH_RESPONSE_STREAM_INPUT.members[ - "trace" - ] - ) - ) - - case 5: - kwargs["guardrail_identifier"] = de.read_string( - _SCHEMA_INVOKE_MODEL_WITH_RESPONSE_STREAM_INPUT.members[ - "guardrailIdentifier" - ] - ) - - case 6: - kwargs["guardrail_version"] = de.read_string( - _SCHEMA_INVOKE_MODEL_WITH_RESPONSE_STREAM_INPUT.members[ - "guardrailVersion" - ] - ) - - case 7: - kwargs["performance_config_latency"] = PerformanceConfigLatency( - de.read_string( - _SCHEMA_INVOKE_MODEL_WITH_RESPONSE_STREAM_INPUT.members[ - "performanceConfigLatency" - ] - ) - ) - - case 8: - kwargs["service_tier"] = ServiceTierType( - de.read_string( - _SCHEMA_INVOKE_MODEL_WITH_RESPONSE_STREAM_INPUT.members[ - "serviceTier" - ] - ) - ) - - case 9: - kwargs["request_metadata"] = de.read_string( - _SCHEMA_INVOKE_MODEL_WITH_RESPONSE_STREAM_INPUT.members[ - "requestMetadata" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVOKE_MODEL_WITH_RESPONSE_STREAM_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class PayloadPart: - """Payload content included in the response.""" - - bytes_: bytes | None = field(repr=False, default=None) - """Base64-encoded bytes of payload data.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PAYLOAD_PART, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.bytes_ is not None: - serializer.write_blob(_SCHEMA_PAYLOAD_PART.members["bytes"], self.bytes_) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bytes_"] = de.read_blob( - _SCHEMA_PAYLOAD_PART.members["bytes"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PAYLOAD_PART, consumer=_consumer) - return kwargs - - -@dataclass -class ResponseStreamChunk: - """Content included in the response.""" - - value: PayloadPart - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESPONSE_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESPONSE_STREAM.members["chunk"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=PayloadPart.deserialize(deserializer)) - - -@dataclass -class ResponseStreamInternalServerException: - """An internal server error occurred. Retry your request.""" - - value: InternalServerException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESPONSE_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RESPONSE_STREAM.members["internalServerException"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=InternalServerException.deserialize(deserializer)) - - -@dataclass -class ResponseStreamModelStreamErrorException: - """An error occurred while streaming the response. Retry your request.""" - - value: ModelStreamErrorException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESPONSE_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RESPONSE_STREAM.members["modelStreamErrorException"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ModelStreamErrorException.deserialize(deserializer)) - - -@dataclass -class ResponseStreamValidationException: - """ - Input validation failed. Check your request parameters and retry the - request. - """ - - value: ValidationException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESPONSE_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RESPONSE_STREAM.members["validationException"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ValidationException.deserialize(deserializer)) - - -@dataclass -class ResponseStreamThrottlingException: - """ - Your request was throttled because of service-wide limitations. Resubmit - your request later or in a different region. You can also purchase - [Provisioned - Throughput](https://docs.aws.amazon.com/bedrock/latest/userguide/prov-throughput.html) - to increase the rate or number of tokens you can process. - """ - - value: ThrottlingException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESPONSE_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RESPONSE_STREAM.members["throttlingException"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ThrottlingException.deserialize(deserializer)) - - -@dataclass -class ResponseStreamModelTimeoutException: - """ - The request took too long to process. Processing time exceeded the model - timeout length. - """ - - value: ModelTimeoutException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESPONSE_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RESPONSE_STREAM.members["modelTimeoutException"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ModelTimeoutException.deserialize(deserializer)) - - -@dataclass -class ResponseStreamServiceUnavailableException: - """The service isn't available. Try again later.""" - - value: ServiceUnavailableException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESPONSE_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RESPONSE_STREAM.members["serviceUnavailableException"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ServiceUnavailableException.deserialize(deserializer)) - - -@dataclass -class ResponseStreamUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ResponseStream = Union[ - ResponseStreamChunk - | ResponseStreamInternalServerException - | ResponseStreamModelStreamErrorException - | ResponseStreamValidationException - | ResponseStreamThrottlingException - | ResponseStreamModelTimeoutException - | ResponseStreamServiceUnavailableException - | ResponseStreamUnknown -] -"""Definition of content in the response stream.""" - - -class _ResponseStreamDeserializer: - _result: ResponseStream | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> ResponseStream: - self._result = None - deserializer.read_struct(_SCHEMA_RESPONSE_STREAM, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(ResponseStreamChunk.deserialize(de)) - - case 1: - self._set_result(ResponseStreamInternalServerException.deserialize(de)) - - case 2: - self._set_result( - ResponseStreamModelStreamErrorException.deserialize(de) - ) - - case 3: - self._set_result(ResponseStreamValidationException.deserialize(de)) - - case 4: - self._set_result(ResponseStreamThrottlingException.deserialize(de)) - - case 5: - self._set_result(ResponseStreamModelTimeoutException.deserialize(de)) - - case 6: - self._set_result( - ResponseStreamServiceUnavailableException.deserialize(de) - ) - - case _: - self._set_result(ResponseStreamUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: ResponseStream) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class InvokeModelWithResponseStreamOutput: - """Dataclass for InvokeModelWithResponseStreamOutput structure.""" - - content_type: str - """The MIME type of the inference result.""" - - performance_config_latency: str | None = None - """Model performance settings for the request.""" - - service_tier: str | None = None - """Specifies the processing tier type used for serving the request.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False +CONVERSE_STREAM: APIOperation[ConverseStreamInput, ConverseStreamOperationOutput] = ( + APIOperation( + static_schema=_SCHEMA_CONVERSE_STREAM, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockruntime#InternalServerException"), + ShapeID("com.amazonaws.bedrockruntime#ModelErrorException"), + ShapeID("com.amazonaws.bedrockruntime#ModelNotReadyException"), + ShapeID("com.amazonaws.bedrockruntime#ModelTimeoutException"), + ShapeID("com.amazonaws.bedrockruntime#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockruntime#ServiceUnavailableException"), + ShapeID("com.amazonaws.bedrockruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockruntime#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOKE_MODEL_WITH_RESPONSE_STREAM_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_INVOKE_MODEL_WITH_RESPONSE_STREAM_OUTPUT.members["contentType"], - self.content_type, - ) - if self.performance_config_latency is not None: - serializer.write_string( - _SCHEMA_INVOKE_MODEL_WITH_RESPONSE_STREAM_OUTPUT.members[ - "performanceConfigLatency" - ], - self.performance_config_latency, - ) - - if self.service_tier is not None: - serializer.write_string( - _SCHEMA_INVOKE_MODEL_WITH_RESPONSE_STREAM_OUTPUT.members["serviceTier"], - self.service_tier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 1: - kwargs["content_type"] = de.read_string( - _SCHEMA_INVOKE_MODEL_WITH_RESPONSE_STREAM_OUTPUT.members[ - "contentType" - ] - ) - - case 2: - kwargs["performance_config_latency"] = PerformanceConfigLatency( - de.read_string( - _SCHEMA_INVOKE_MODEL_WITH_RESPONSE_STREAM_OUTPUT.members[ - "performanceConfigLatency" - ] - ) - ) - - case 3: - kwargs["service_tier"] = ServiceTierType( - de.read_string( - _SCHEMA_INVOKE_MODEL_WITH_RESPONSE_STREAM_OUTPUT.members[ - "serviceTier" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVOKE_MODEL_WITH_RESPONSE_STREAM_OUTPUT, consumer=_consumer - ) - if "content_type" not in kwargs: - kwargs["content_type"] = "" - return kwargs - +) -INVOKE_MODEL_WITH_RESPONSE_STREAM = APIOperation( - input=InvokeModelWithResponseStreamInput, - output=InvokeModelWithResponseStreamOutput, - schema=_SCHEMA_INVOKE_MODEL_WITH_RESPONSE_STREAM, - input_schema=_SCHEMA_INVOKE_MODEL_WITH_RESPONSE_STREAM_INPUT, - output_schema=_SCHEMA_INVOKE_MODEL_WITH_RESPONSE_STREAM_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockruntime#ModelErrorException" - ): ModelErrorException, - ShapeID( - "com.amazonaws.bedrockruntime#ModelNotReadyException" - ): ModelNotReadyException, - ShapeID( - "com.amazonaws.bedrockruntime#ModelStreamErrorException" - ): ModelStreamErrorException, - ShapeID( - "com.amazonaws.bedrockruntime#ModelTimeoutException" - ): ModelTimeoutException, - ShapeID( - "com.amazonaws.bedrockruntime#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockruntime#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.bedrockruntime#ServiceUnavailableException" - ): ServiceUnavailableException, - ShapeID( - "com.amazonaws.bedrockruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockruntime#ValidationException" - ): ValidationException, - } - ), +INVOKE_MODEL: APIOperation[InvokeModelInput, InvokeModelOutput] = APIOperation( + static_schema=_SCHEMA_INVOKE_MODEL, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockruntime#InternalServerException"), + ShapeID("com.amazonaws.bedrockruntime#ModelErrorException"), + ShapeID("com.amazonaws.bedrockruntime#ModelNotReadyException"), + ShapeID("com.amazonaws.bedrockruntime#ModelTimeoutException"), + ShapeID("com.amazonaws.bedrockruntime#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockruntime#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockruntime#ServiceUnavailableException"), + ShapeID("com.amazonaws.bedrockruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockruntime#ValidationException"), + ], effective_auth_schemes=[ ShapeID("aws.auth#sigv4"), ShapeID("smithy.api#httpBearerAuth"), ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_MODEL_ERROR_EXCEPTION, - _SCHEMA_MODEL_NOT_READY_EXCEPTION, - _SCHEMA_MODEL_STREAM_ERROR_EXCEPTION, - _SCHEMA_MODEL_TIMEOUT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_SERVICE_UNAVAILABLE_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], ) +INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM: APIOperation[ + InvokeModelWithBidirectionalStreamOperationInput, + InvokeModelWithBidirectionalStreamOperationOutput, +] = APIOperation( + static_schema=_SCHEMA_INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockruntime#InternalServerException"), + ShapeID("com.amazonaws.bedrockruntime#ModelErrorException"), + ShapeID("com.amazonaws.bedrockruntime#ModelNotReadyException"), + ShapeID("com.amazonaws.bedrockruntime#ModelStreamErrorException"), + ShapeID("com.amazonaws.bedrockruntime#ModelTimeoutException"), + ShapeID("com.amazonaws.bedrockruntime#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockruntime#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockruntime#ServiceUnavailableException"), + ShapeID("com.amazonaws.bedrockruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockruntime#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) -@dataclass(kw_only=True) -class ConverseTokensRequest: - """ - The inputs from a `Converse` API request for token counting. - - This structure mirrors the input format for the `Converse` operation, - allowing you to count tokens for conversation-based inference requests. - """ - - messages: list[Message] | None = None - """An array of messages to count tokens for.""" - - system: list[SystemContentBlock] | None = None - """ - The system content blocks to count tokens for. System content provides - instructions or context to the model about how it should behave or - respond. The token count will include any system content provided. - """ - - tool_config: ToolConfiguration | None = None - """ - The toolConfig of Converse input request to count tokens for. - Configuration information for the tools that the model can use when - generating a response. - """ - - additional_model_request_fields: Document | None = None - """ - The additionalModelRequestFields of Converse input request to count - tokens for. Use this field when you want to pass additional parameters - that the model supports. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONVERSE_TOKENS_REQUEST, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.messages is not None: - _serialize_messages( - serializer, - _SCHEMA_CONVERSE_TOKENS_REQUEST.members["messages"], - self.messages, - ) - - if self.system is not None: - _serialize_system_content_blocks( - serializer, - _SCHEMA_CONVERSE_TOKENS_REQUEST.members["system"], - self.system, - ) - - if self.tool_config is not None: - serializer.write_struct( - _SCHEMA_CONVERSE_TOKENS_REQUEST.members["toolConfig"], self.tool_config - ) - - if self.additional_model_request_fields is not None: - serializer.write_document( - _SCHEMA_CONVERSE_TOKENS_REQUEST.members["additionalModelRequestFields"], - self.additional_model_request_fields, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["messages"] = _deserialize_messages( - de, _SCHEMA_CONVERSE_TOKENS_REQUEST.members["messages"] - ) - - case 1: - kwargs["system"] = _deserialize_system_content_blocks( - de, _SCHEMA_CONVERSE_TOKENS_REQUEST.members["system"] - ) - - case 2: - kwargs["tool_config"] = ToolConfiguration.deserialize(de) - - case 3: - kwargs["additional_model_request_fields"] = de.read_document( - _SCHEMA_CONVERSE_TOKENS_REQUEST.members[ - "additionalModelRequestFields" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONVERSE_TOKENS_REQUEST, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class InvokeModelTokensRequest: - """ - The body of an `InvokeModel` API request for token counting. This - structure mirrors the input format for the `InvokeModel` operation, - allowing you to count tokens for raw text inference requests. - """ - - body: bytes = field(repr=False) - """ - The request body to count tokens for, formatted according to the - model's expected input format. To learn about the input format for - different models, see [Model inference parameters and - responses](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOKE_MODEL_TOKENS_REQUEST, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_blob( - _SCHEMA_INVOKE_MODEL_TOKENS_REQUEST.members["body"], self.body - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["body"] = de.read_blob( - _SCHEMA_INVOKE_MODEL_TOKENS_REQUEST.members["body"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVOKE_MODEL_TOKENS_REQUEST, consumer=_consumer - ) - if "body" not in kwargs: - kwargs["body"] = b"" - return kwargs - - -@dataclass -class CountTokensInputInvokeModel: - """ - An `InvokeModel` request for which to count tokens. Use this field when - you want to count tokens for a raw text input that would be sent to the - `InvokeModel` operation. - """ - - value: InvokeModelTokensRequest - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_COUNT_TOKENS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_COUNT_TOKENS_INPUT.members["invokeModel"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=InvokeModelTokensRequest.deserialize(deserializer)) - - -@dataclass -class CountTokensInputConverse: - """ - A `Converse` request for which to count tokens. Use this field when you - want to count tokens for a conversation-based input that would be sent - to the `Converse` operation. - """ - - value: ConverseTokensRequest - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_COUNT_TOKENS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_COUNT_TOKENS_INPUT.members["converse"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ConverseTokensRequest.deserialize(deserializer)) - - -@dataclass -class CountTokensInputUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -CountTokensInput = Union[ - CountTokensInputInvokeModel | CountTokensInputConverse | CountTokensInputUnknown -] -""" -The input value for token counting. The value should be either an -`InvokeModel` or `Converse` request body. -""" - - -class _CountTokensInputDeserializer: - _result: CountTokensInput | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> CountTokensInput: - self._result = None - deserializer.read_struct(_SCHEMA_COUNT_TOKENS_INPUT, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(CountTokensInputInvokeModel.deserialize(de)) - - case 1: - self._set_result(CountTokensInputConverse.deserialize(de)) - - case _: - self._set_result( - CountTokensInputUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: CountTokensInput) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class CountTokensOperationInput: - """Dataclass for CountTokensOperationInput structure.""" - - model_id: str | None = None - """ - The unique identifier or ARN of the foundation model to use for token - counting. Each model processes tokens differently, so the token count is - specific to the model you specify. - """ - - input: CountTokensInput | None = None - """ - The input for which to count tokens. The structure of this parameter - depends on whether you're counting tokens for an `InvokeModel` or - `Converse` request: - - - For `InvokeModel` requests, provide the request body in the - `invokeModel` field - - - For `Converse` requests, provide the messages and system content in - the `converse` field - - The input format must be compatible with the model specified in the - `modelId` parameter. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_COUNT_TOKENS_OPERATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.model_id is not None: - serializer.write_string( - _SCHEMA_COUNT_TOKENS_OPERATION_INPUT.members["modelId"], self.model_id - ) - - if self.input is not None: - serializer.write_struct( - _SCHEMA_COUNT_TOKENS_OPERATION_INPUT.members["input"], self.input - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_id"] = de.read_string( - _SCHEMA_COUNT_TOKENS_OPERATION_INPUT.members["modelId"] - ) - - case 1: - kwargs["input"] = _CountTokensInputDeserializer().deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_COUNT_TOKENS_OPERATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CountTokensOutput: - """Dataclass for CountTokensOutput structure.""" - - input_tokens: int - """ - The number of tokens in the provided input according to the specified - model's tokenization rules. This count represents the number of input - tokens that would be processed if the same input were sent to the model - in an inference request. Use this value to estimate costs and ensure - your inputs stay within model token limits. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_COUNT_TOKENS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer( - _SCHEMA_COUNT_TOKENS_OUTPUT.members["inputTokens"], self.input_tokens - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["input_tokens"] = de.read_integer( - _SCHEMA_COUNT_TOKENS_OUTPUT.members["inputTokens"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_COUNT_TOKENS_OUTPUT, consumer=_consumer) - if "input_tokens" not in kwargs: - kwargs["input_tokens"] = 0 - return kwargs - - -COUNT_TOKENS = APIOperation( - input=CountTokensOperationInput, - output=CountTokensOutput, - schema=_SCHEMA_COUNT_TOKENS, - input_schema=_SCHEMA_COUNT_TOKENS_OPERATION_INPUT, - output_schema=_SCHEMA_COUNT_TOKENS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrockruntime#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrockruntime#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrockruntime#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrockruntime#ServiceUnavailableException" - ): ServiceUnavailableException, - ShapeID( - "com.amazonaws.bedrockruntime#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.bedrockruntime#ValidationException" - ): ValidationException, - } - ), +INVOKE_MODEL_WITH_RESPONSE_STREAM: APIOperation[ + InvokeModelWithResponseStreamInput, InvokeModelWithResponseStreamOutput +] = APIOperation( + static_schema=_SCHEMA_INVOKE_MODEL_WITH_RESPONSE_STREAM, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockruntime#InternalServerException"), + ShapeID("com.amazonaws.bedrockruntime#ModelErrorException"), + ShapeID("com.amazonaws.bedrockruntime#ModelNotReadyException"), + ShapeID("com.amazonaws.bedrockruntime#ModelStreamErrorException"), + ShapeID("com.amazonaws.bedrockruntime#ModelTimeoutException"), + ShapeID("com.amazonaws.bedrockruntime#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockruntime#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrockruntime#ServiceUnavailableException"), + ShapeID("com.amazonaws.bedrockruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockruntime#ValidationException"), + ], effective_auth_schemes=[ ShapeID("aws.auth#sigv4"), ShapeID("smithy.api#httpBearerAuth"), ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_UNAVAILABLE_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, +) + +COUNT_TOKENS: APIOperation[CountTokensOperationInput, CountTokensOutput] = APIOperation( + static_schema=_SCHEMA_COUNT_TOKENS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrockruntime#AccessDeniedException"), + ShapeID("com.amazonaws.bedrockruntime#InternalServerException"), + ShapeID("com.amazonaws.bedrockruntime#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrockruntime#ServiceUnavailableException"), + ShapeID("com.amazonaws.bedrockruntime#ThrottlingException"), + ShapeID("com.amazonaws.bedrockruntime#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), ], ) diff --git a/clients/aws-sdk-bedrock-runtime/src/aws_sdk_bedrock_runtime/models.pyi b/clients/aws-sdk-bedrock-runtime/src/aws_sdk_bedrock_runtime/models.pyi new file mode 100644 index 00000000..be2b36f6 --- /dev/null +++ b/clients/aws-sdk-bedrock-runtime/src/aws_sdk_bedrock_runtime/models.pyi @@ -0,0 +1,4839 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. + +from dataclasses import dataclass +from datetime import datetime +from enum import StrEnum +from typing import Self, Union + +from smithy_core.deserializers import ShapeDeserializer +from smithy_core.documents import Document +from smithy_core.exceptions import ModeledError +from smithy_core.response import ResponseMetadata +from smithy_core.schemas import APIOperation +from smithy_core.serializers import ShapeSerializer +from smithy_core.types import UnknownEnumMixin + +class _SerdeShape: + def serialize(self, serializer: ShapeSerializer) -> None: ... + def serialize_members(self, serializer: ShapeSerializer) -> None: ... + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: ... + +class ServiceError(ModeledError): + """ + Base error for all errors in the service. + + Some exceptions do not extend from this class, including + synthetic, implicit, and shared exception types. + """ + +@dataclass(kw_only=True) +class AccessDeniedException(ServiceError, _SerdeShape): + """ + The request is denied because you do not have sufficient permissions to + perform the requested action. For troubleshooting this error, see + [AccessDeniedException](https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-access-denied) + in the Amazon Bedrock User Guide + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class AnyToolChoice(_SerdeShape): + """ + The model must request at least one tool (no text is generated). For + example, `{"any" : {}}`. For more information, see [Call a tool with the + Converse + API](https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html) + in the Amazon Bedrock User Guide. + """ + +@dataclass(kw_only=True) +class AppliedGuardrailDetails(_SerdeShape): + """ + Details about the specific guardrail that was applied during this + assessment, including its identifier, version, ARN, origin, and + ownership information. + """ + + guardrail_id: str | None = ... + """The unique ID of the guardrail that was applied.""" + guardrail_version: str | None = ... + """The version of the guardrail that was applied.""" + guardrail_arn: str | None = ... + """The ARN of the guardrail that was applied.""" + guardrail_origin: list[str] | None = ... + """ + The origin of how the guardrail was applied. This can be either + requested at the API level or enforced at the account or organization + level as a default guardrail. + """ + guardrail_ownership: str | None = ... + """ + The ownership type of the guardrail, indicating whether it is owned by + the requesting account or is a cross-account guardrail shared from + another AWS account. + """ + +@dataclass(kw_only=True) +class ApplyGuardrailInput(_SerdeShape): + """Dataclass for ApplyGuardrailInput structure.""" + + guardrail_identifier: str | None = ... + """The guardrail identifier used in the request to apply the guardrail.""" + guardrail_version: str | None = ... + """The guardrail version used in the request to apply the guardrail.""" + source: str | None = ... + """The source of data used in the request to apply the guardrail.""" + content: list[GuardrailContentBlock] | None = ... + """The content details used in the request to apply the guardrail.""" + output_scope: str | None = ... + """ + Specifies the scope of the output that you get in the response. Set to + `FULL` to return the entire output, including any detected and + non-detected entries in the response for enhanced debugging. + + Note that the full output scope doesn't apply to word filters or regex + in sensitive information filters. It does apply to all other filtering + policies, including sensitive information with filters that can detect + personally identifiable information (PII). + """ + +@dataclass(kw_only=True) +class ApplyGuardrailOutput(_SerdeShape): + """Dataclass for ApplyGuardrailOutput structure.""" + + usage: GuardrailUsage + """The usage details in the response from the guardrail.""" + action: str + """The action taken in the response from the guardrail.""" + action_reason: str | None = ... + """The reason for the action taken when harmful content is detected.""" + outputs: list[GuardrailOutputContent] + """The output details in the response from the guardrail.""" + assessments: list[GuardrailAssessment] + """The assessment details in the response from the guardrail.""" + guardrail_coverage: GuardrailCoverage | None = ... + """The guardrail coverage details in the apply guardrail response.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass +class AsyncInvokeOutputDataConfigS3OutputDataConfig(_SerdeShape): + """A storage location for the output data in an S3 bucket""" + + value: AsyncInvokeS3OutputDataConfig + +@dataclass +class AsyncInvokeOutputDataConfigUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +AsyncInvokeOutputDataConfig = Union[ + AsyncInvokeOutputDataConfigS3OutputDataConfig | AsyncInvokeOutputDataConfigUnknown +] +"""Asynchronous invocation output data settings.""" + +class _AsyncInvokeOutputDataConfigDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> AsyncInvokeOutputDataConfig: ... + +@dataclass(kw_only=True) +class AsyncInvokeS3OutputDataConfig(_SerdeShape): + """Asynchronous invocation output data settings.""" + + s3_uri: str + """An object URI starting with `s3://`.""" + kms_key_id: str | None = ... + """A KMS encryption key ID.""" + bucket_owner: str | None = ... + """ + If the bucket belongs to another AWS account, specify that account's + ID. + """ + +class AsyncInvokeStatus(UnknownEnumMixin, StrEnum): + IN_PROGRESS = "InProgress" + COMPLETED = "Completed" + FAILED = "Failed" + +@dataclass(kw_only=True) +class AsyncInvokeSummary(_SerdeShape): + """A summary of an asynchronous invocation.""" + + invocation_arn: str + """The invocation's ARN.""" + model_arn: str + """The invoked model's ARN.""" + client_request_token: str | None = ... + """The invocation's idempotency token.""" + status: str | None = ... + """The invocation's status.""" + failure_message: str | None = ... + """An error message.""" + submit_time: datetime + """When the invocation was submitted.""" + last_modified_time: datetime | None = ... + """When the invocation was last modified.""" + end_time: datetime | None = ... + """When the invocation ended.""" + output_data_config: AsyncInvokeOutputDataConfig + """The invocation's output data settings.""" + +@dataclass(kw_only=True) +class AudioBlock(_SerdeShape): + """ + An audio content block that contains audio data in various supported + formats. + """ + + format: str + """ + The format of the audio data, such as MP3, WAV, FLAC, or other supported + audio formats. + """ + source: AudioSource + """ + The source of the audio data, which can be provided as raw bytes or an + S3 location. + """ + error: ErrorBlock | None = ... + """ + Error information if the audio block could not be processed or contains + invalid data. + """ + +class AudioFormat(UnknownEnumMixin, StrEnum): + MP3 = "mp3" + OPUS = "opus" + WAV = "wav" + AAC = "aac" + FLAC = "flac" + MP4 = "mp4" + OGG = "ogg" + MKV = "mkv" + MKA = "mka" + X_AAC = "x-aac" + M4_A = "m4a" + MPEG = "mpeg" + MPGA = "mpga" + PCM = "pcm" + WEBM = "webm" + +@dataclass +class AudioSourceBytes(_SerdeShape): + """Audio data encoded in base64.""" + + value: bytes + +@dataclass +class AudioSourceS3Location(_SerdeShape): + """ + A reference to audio data stored in an Amazon S3 bucket. To see which + models support S3 uploads, see [Supported models and features for + Converse](https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference-supported-models-features.html). + """ + + value: S3Location + +@dataclass +class AudioSourceUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +AudioSource = Union[AudioSourceBytes | AudioSourceS3Location | AudioSourceUnknown] +""" +The source of audio data, which can be provided either as raw bytes or a +reference to an S3 location. +""" + +class _AudioSourceDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> AudioSource: ... + +@dataclass(kw_only=True) +class AutoToolChoice(_SerdeShape): + """ + The Model automatically decides if a tool should be called or whether to + generate text instead. For example, `{"auto" : {}}`. For more + information, see [Call a tool with the Converse + API](https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html) + in the Amazon Bedrock User Guide + """ + +@dataclass(kw_only=True) +class BidirectionalInputPayloadPart(_SerdeShape): + """ + Payload content for the bidirectional input. The input is an audio + stream. + """ + + bytes_: bytes | None = ... + """The audio content for the bidirectional input.""" + +@dataclass(kw_only=True) +class BidirectionalOutputPayloadPart(_SerdeShape): + """ + Output from the bidirectional stream. The output is speech and a text + transcription. + """ + + bytes_: bytes | None = ... + """The speech output of the bidirectional stream.""" + +@dataclass(kw_only=True) +class CacheDetail(_SerdeShape): + """Cache creation metrics for a specific TTL duration""" + + ttl: str + """TTL duration for these cached tokens""" + input_tokens: int + """Number of tokens written to cache with this TTL (cache creation tokens)""" + +@dataclass(kw_only=True) +class CachePointBlock(_SerdeShape): + """ + Defines a section of content to be cached for reuse in subsequent API + calls. + """ + + type: str + """Specifies the type of cache point within the CachePointBlock.""" + ttl: str | None = ... + """ + Optional TTL duration for cache entries. When specified, enables + extended TTL caching with the specified duration. When omitted, uses + `type` value for caching behavior. + """ + +class CachePointType(UnknownEnumMixin, StrEnum): + DEFAULT = "default" + +class CacheTTL(UnknownEnumMixin, StrEnum): + """Time-to-live duration for ephemeral cache entries""" + + FIVE_MINUTES = "5m" + ONE_HOUR = "1h" + +@dataclass(kw_only=True) +class Citation(_SerdeShape): + """ + Contains information about a citation that references a specific source + document. Citations provide traceability between the model's generated + response and the source documents that informed that response. + """ + + title: str | None = ... + """The title or identifier of the source document being cited.""" + source: str | None = ... + """ + The source from the original search result that provided the cited + content. + """ + source_content: list[CitationSourceContent] | None = ... + """ + The specific content from the source document that was referenced or + cited in the generated response. + """ + location: CitationLocation | None = ... + """ + The precise location within the source document where the cited content + can be found, including character positions, page numbers, or chunk + identifiers. + """ + +@dataclass +class CitationGeneratedContentText(_SerdeShape): + """ + The text content that was generated by the model and is supported by the + associated citation. + """ + + value: str + +@dataclass +class CitationGeneratedContentUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +CitationGeneratedContent = Union[ + CitationGeneratedContentText | CitationGeneratedContentUnknown +] +""" +Contains the generated text content that corresponds to or is supported +by a citation from a source document. +""" + +class _CitationGeneratedContentDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> CitationGeneratedContent: ... + +@dataclass +class CitationLocationWeb(_SerdeShape): + """The web URL that was cited for this reference.""" + + value: WebLocation + +@dataclass +class CitationLocationDocumentChar(_SerdeShape): + """ + The character-level location within the document where the cited content + is found. + """ + + value: DocumentCharLocation + +@dataclass +class CitationLocationDocumentPage(_SerdeShape): + """ + The page-level location within the document where the cited content is + found. + """ + + value: DocumentPageLocation + +@dataclass +class CitationLocationDocumentChunk(_SerdeShape): + """ + The chunk-level location within the document where the cited content is + found, typically used for documents that have been segmented into + logical chunks. + """ + + value: DocumentChunkLocation + +@dataclass +class CitationLocationSearchResultLocation(_SerdeShape): + """ + The search result location where the cited content is found, including + the search result index and block positions within the content array. + """ + + value: SearchResultLocation + +@dataclass +class CitationLocationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +CitationLocation = Union[ + CitationLocationWeb + | CitationLocationDocumentChar + | CitationLocationDocumentPage + | CitationLocationDocumentChunk + | CitationLocationSearchResultLocation + | CitationLocationUnknown +] +""" +Specifies the precise location within a source document where cited +content can be found. This can include character-level positions, page +numbers, or document chunks depending on the document type and indexing +method. +""" + +class _CitationLocationDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> CitationLocation: ... + +@dataclass(kw_only=True) +class CitationsConfig(_SerdeShape): + """ + Configuration settings for enabling and controlling document citations + in Converse API responses. When enabled, the model can include citation + information that links generated content back to specific source + documents. + """ + + enabled: bool + """ + Specifies whether citations from the selected document should be used in + the model's response. When set to true, the model can generate + citations that reference the source documents used to inform the + response. + """ + +@dataclass(kw_only=True) +class CitationsContentBlock(_SerdeShape): + """ + A content block that contains both generated text and associated + citation information. This block type is returned when document + citations are enabled, providing traceability between the generated + content and the source documents that informed the response. + """ + + content: list[CitationGeneratedContent] | None = ... + """The generated content that is supported by the associated citations.""" + citations: list[Citation] | None = ... + """ + An array of citations that reference the source documents used to + generate the associated content. + """ + +@dataclass(kw_only=True) +class CitationsDelta(_SerdeShape): + """ + Contains incremental updates to citation information during streaming + responses. This allows clients to build up citation data progressively + as the response is generated. + """ + + title: str | None = ... + """The title or identifier of the source document being cited.""" + source: str | None = ... + """ + The source from the original search result that provided the cited + content. + """ + source_content: list[CitationSourceContentDelta] | None = ... + """ + The specific content from the source document that was referenced or + cited in the generated response. + """ + location: CitationLocation | None = ... + """ + Specifies the precise location within a source document where cited + content can be found. This can include character-level positions, page + numbers, or document chunks depending on the document type and indexing + method. + """ + +@dataclass +class CitationSourceContentText(_SerdeShape): + """The text content from the source document that is being cited.""" + + value: str + +@dataclass +class CitationSourceContentUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +CitationSourceContent = Union[CitationSourceContentText | CitationSourceContentUnknown] +""" +Contains the actual text content from a source document that is being +cited or referenced in the model's response. +""" + +class _CitationSourceContentDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> CitationSourceContent: ... + +@dataclass(kw_only=True) +class CitationSourceContentDelta(_SerdeShape): + """ + Contains incremental updates to the source content text during streaming + responses, allowing clients to build up the cited content progressively. + """ + + text: str | None = ... + """ + An incremental update to the text content from the source document that + is being cited. + """ + +@dataclass(kw_only=True) +class ConflictException(ServiceError, _SerdeShape): + """Error occurred because of a conflict while performing an operation.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass +class ContentBlockText(_SerdeShape): + """Text to include in the message.""" + + value: str + +@dataclass +class ContentBlockImage(_SerdeShape): + """ + Image to include in the message. + + Note: + This field is only supported by Anthropic Claude 3 models. + """ + + value: ImageBlock + +@dataclass +class ContentBlockDocument(_SerdeShape): + """A document to include in the message.""" + + value: DocumentBlock + +@dataclass +class ContentBlockVideo(_SerdeShape): + """Video to include in the message.""" + + value: VideoBlock + +@dataclass +class ContentBlockAudio(_SerdeShape): + """An audio content block containing audio data in the conversation.""" + + value: AudioBlock + +@dataclass +class ContentBlockToolUse(_SerdeShape): + """Information about a tool use request from a model.""" + + value: ToolUseBlock + +@dataclass +class ContentBlockToolResult(_SerdeShape): + """The result for a tool request that a model makes.""" + + value: ToolResultBlock + +@dataclass +class ContentBlockGuardContent(_SerdeShape): + """ + Contains the content to assess with the guardrail. If you don't specify + `guardContent` in a call to the Converse API, the guardrail (if passed + in the Converse API) assesses the entire message. + + For more information, see *Use a guardrail with the Converse API* in the + *Amazon Bedrock User Guide*. + """ + + value: GuardrailConverseContentBlock + +@dataclass +class ContentBlockCachePoint(_SerdeShape): + """CachePoint to include in the message.""" + + value: CachePointBlock + +@dataclass +class ContentBlockReasoningContent(_SerdeShape): + """ + Contains content regarding the reasoning that is carried out by the + model. Reasoning refers to a Chain of Thought (CoT) that the model + generates to enhance the accuracy of its final response. + """ + + value: ReasoningContentBlock + +@dataclass +class ContentBlockCitationsContent(_SerdeShape): + """ + A content block that contains both generated text and associated + citation information, providing traceability between the response and + source documents. + """ + + value: CitationsContentBlock + +@dataclass +class ContentBlockSearchResult(_SerdeShape): + """Search result to include in the message.""" + + value: SearchResultBlock + +@dataclass +class ContentBlockToolAddition(_SerdeShape): + """ + A content block for adding a tool to the available tool set + mid-conversation. Each block references a single tool via its `tool` + field. Use within a `system` role message to make a tool available + without re-sending the full tool configuration. + """ + + value: ToolAdditionBlock + +@dataclass +class ContentBlockToolRemoval(_SerdeShape): + """ + A content block for removing a tool from the available tool set + mid-conversation. Each block references a single tool via its `tool` + field. Use within a `system` role message to remove a tool without + re-sending the full tool configuration. + """ + + value: ToolRemovalBlock + +@dataclass +class ContentBlockUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ContentBlock = Union[ + ContentBlockText + | ContentBlockImage + | ContentBlockDocument + | ContentBlockVideo + | ContentBlockAudio + | ContentBlockToolUse + | ContentBlockToolResult + | ContentBlockGuardContent + | ContentBlockCachePoint + | ContentBlockReasoningContent + | ContentBlockCitationsContent + | ContentBlockSearchResult + | ContentBlockToolAddition + | ContentBlockToolRemoval + | ContentBlockUnknown +] +""" +A block of content for a message that you pass to, or receive from, a +model with the +[Converse](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html) +or +[ConverseStream](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html) +API operations. +""" + +class _ContentBlockDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> ContentBlock: ... + +@dataclass +class ContentBlockDeltaText(_SerdeShape): + """The content text.""" + + value: str + +@dataclass +class ContentBlockDeltaToolUse(_SerdeShape): + """Information about a tool that the model is requesting to use.""" + + value: ToolUseBlockDelta + +@dataclass +class ContentBlockDeltaToolResult(_SerdeShape): + """An incremental update that contains the results from a tool call.""" + + value: list[ToolResultBlockDelta] + +@dataclass +class ContentBlockDeltaReasoningContent(_SerdeShape): + """ + Contains content regarding the reasoning that is carried out by the + model. Reasoning refers to a Chain of Thought (CoT) that the model + generates to enhance the accuracy of its final response. + """ + + value: ReasoningContentBlockDelta + +@dataclass +class ContentBlockDeltaCitation(_SerdeShape): + """ + Incremental citation information that is streamed as part of the + response generation process. + """ + + value: CitationsDelta + +@dataclass +class ContentBlockDeltaImage(_SerdeShape): + """A streaming delta event containing incremental image data.""" + + value: ImageBlockDelta + +@dataclass +class ContentBlockDeltaUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ContentBlockDelta = Union[ + ContentBlockDeltaText + | ContentBlockDeltaToolUse + | ContentBlockDeltaToolResult + | ContentBlockDeltaReasoningContent + | ContentBlockDeltaCitation + | ContentBlockDeltaImage + | ContentBlockDeltaUnknown +] +"""A block of content in a streaming response.""" + +class _ContentBlockDeltaDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> ContentBlockDelta: ... + +@dataclass(kw_only=True) +class ContentBlockDeltaEvent(_SerdeShape): + """The content block delta event.""" + + delta: ContentBlockDelta + """The delta for a content block delta event.""" + content_block_index: int + """The block index for a content block delta event.""" + +@dataclass +class ContentBlockStartToolUse(_SerdeShape): + """Information about a tool that the model is requesting to use.""" + + value: ToolUseBlockStart + +@dataclass +class ContentBlockStartToolResult(_SerdeShape): + """The""" + + value: ToolResultBlockStart + +@dataclass +class ContentBlockStartImage(_SerdeShape): + """The initial event indicating the start of a streaming image block.""" + + value: ImageBlockStart + +@dataclass +class ContentBlockStartUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ContentBlockStart = Union[ + ContentBlockStartToolUse + | ContentBlockStartToolResult + | ContentBlockStartImage + | ContentBlockStartUnknown +] +"""Content block start information.""" + +class _ContentBlockStartDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> ContentBlockStart: ... + +@dataclass(kw_only=True) +class ContentBlockStartEvent(_SerdeShape): + """Content block start event.""" + + start: ContentBlockStart + """Start information about a content block start event.""" + content_block_index: int + """The index for a content block start event.""" + +@dataclass(kw_only=True) +class ContentBlockStopEvent(_SerdeShape): + """A content block stop event.""" + + content_block_index: int + """The index for a content block.""" + +class ConversationRole(UnknownEnumMixin, StrEnum): + USER = "user" + ASSISTANT = "assistant" + SYSTEM = "system" + +@dataclass(kw_only=True) +class ConverseInput(_SerdeShape): + """Dataclass for ConverseInput structure.""" + + model_id: str | None = ... + """ + Specifies the model or throughput with which to run inference, or the + prompt resource to use in inference. The value depends on the resource + that you use: + + - If you use a base model, specify the model ID or its ARN. For a list + of model IDs for base models, see [Amazon Bedrock base model IDs + (on-demand + throughput)](https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns) + in the Amazon Bedrock User Guide. + + - If you use an inference profile, specify the inference profile ID or + its ARN. For a list of inference profile IDs, see [Supported Regions + and models for cross-region + inference](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference-support.html) + in the Amazon Bedrock User Guide. + + - If you use a provisioned model, specify the ARN of the Provisioned + Throughput. For more information, see [Run inference using a + Provisioned + Throughput](https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html) + in the Amazon Bedrock User Guide. + + - If you use a custom model, first purchase Provisioned Throughput for + it. Then specify the ARN of the resulting provisioned model. For more + information, see [Use a custom model in Amazon + Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html) + in the Amazon Bedrock User Guide. + + - To include a prompt that was defined in [Prompt + management](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management.html), + specify the ARN of the prompt version to use. + + The Converse API doesn't support [imported + models](https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-import-model.html). + """ + messages: list[Message] | None = ... + """The messages that you want to send to the model.""" + system: list[SystemContentBlock] | None = ... + """ + A prompt that provides instructions or context to the model about the + task it should perform, or the persona it should adopt during the + conversation. + """ + inference_config: InferenceConfiguration | None = ... + """ + Inference parameters to pass to the model. `Converse` and + `ConverseStream` support a base set of inference parameters. If you need + to pass additional parameters that the model supports, use the + `additionalModelRequestFields` request field. + """ + tool_config: ToolConfiguration | None = ... + """ + Configuration information for the tools that the model can use when + generating a response. + + For information about models that support tool use, see [Supported + models and model + features](https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference.html#conversation-inference-supported-models-features). + """ + guardrail_config: GuardrailConfiguration | None = ... + """ + Configuration information for a guardrail that you want to use in the + request. If you include `guardContent` blocks in the `content` field in + the `messages` field, the guardrail operates only on those messages. If + you include no `guardContent` blocks, the guardrail operates on all + messages in the request body and in any included prompt resource. + """ + additional_model_request_fields: Document | None = ... + """ + Additional inference parameters that the model supports, beyond the base + set of inference parameters that `Converse` and `ConverseStream` support + in the `inferenceConfig` field. For more information, see [Model + parameters](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). + """ + prompt_variables: dict[str, PromptVariableValues] | None = ... + """ + Contains a map of variables in a prompt from Prompt management to + objects containing the values to fill in for them when running model + invocation. This field is ignored if you don't specify a prompt + resource in the `modelId` field. + """ + additional_model_response_field_paths: list[str] | None = ... + """ + Additional model parameters field paths to return in the response. + `Converse` and `ConverseStream` return the requested fields as a JSON + Pointer object in the `additionalModelResponseFields` field. The + following is example JSON for `additionalModelResponseFieldPaths`. + + `[ "/stop_sequence" ]` + + For information about the JSON Pointer syntax, see the [Internet + Engineering Task Force + (IETF)](https://datatracker.ietf.org/doc/html/rfc6901) documentation. + + `Converse` and `ConverseStream` reject an empty JSON Pointer or + incorrectly structured JSON Pointer with a `400` error code. if the JSON + Pointer is valid, but the requested field is not in the model response, + it is ignored by `Converse`. + """ + request_metadata: dict[str, str] | None = ... + """Key-value pairs that you can use to filter invocation logs.""" + performance_config: PerformanceConfiguration | None = ... + """Model performance settings for the request.""" + service_tier: ServiceTier | None = ... + """ + Specifies the processing tier configuration used for serving the + request. + """ + output_config: OutputConfig | None = ... + """Output configuration for a model response.""" + +@dataclass(kw_only=True) +class ConverseMetrics(_SerdeShape): + """ + Metrics for a call to + [Converse](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html). + """ + + latency_ms: int + """The latency of the call to `Converse`, in milliseconds.""" + +@dataclass(kw_only=True) +class ConverseOperationOutput(_SerdeShape): + """Dataclass for ConverseOperationOutput structure.""" + + output: ConverseOutput + """The result from the call to `Converse`.""" + stop_reason: str + """The reason why the model stopped generating output.""" + usage: TokenUsage + """ + The total number of tokens used in the call to `Converse`. The total + includes the tokens input to the model and the tokens generated by the + model. + """ + metrics: ConverseMetrics + """Metrics for the call to `Converse`.""" + additional_model_response_fields: Document | None = ... + """Additional fields in the response that are unique to the model.""" + trace: ConverseTrace | None = ... + """A trace object that contains information about the Guardrail behavior.""" + performance_config: PerformanceConfiguration | None = ... + """Model performance settings for the request.""" + service_tier: ServiceTier | None = ... + """ + Specifies the processing tier configuration used for serving the + request. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass +class ConverseOutputMessage(_SerdeShape): + """The message that the model generates.""" + + value: Message + +@dataclass +class ConverseOutputUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ConverseOutput = Union[ConverseOutputMessage | ConverseOutputUnknown] +""" +The output from a call to +[Converse](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html). +""" + +class _ConverseOutputDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> ConverseOutput: ... + +@dataclass(kw_only=True) +class ConverseStreamInput(_SerdeShape): + """Dataclass for ConverseStreamInput structure.""" + + model_id: str | None = ... + """ + Specifies the model or throughput with which to run inference, or the + prompt resource to use in inference. The value depends on the resource + that you use: + + - If you use a base model, specify the model ID or its ARN. For a list + of model IDs for base models, see [Amazon Bedrock base model IDs + (on-demand + throughput)](https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns) + in the Amazon Bedrock User Guide. + + - If you use an inference profile, specify the inference profile ID or + its ARN. For a list of inference profile IDs, see [Supported Regions + and models for cross-region + inference](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference-support.html) + in the Amazon Bedrock User Guide. + + - If you use a provisioned model, specify the ARN of the Provisioned + Throughput. For more information, see [Run inference using a + Provisioned + Throughput](https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html) + in the Amazon Bedrock User Guide. + + - If you use a custom model, first purchase Provisioned Throughput for + it. Then specify the ARN of the resulting provisioned model. For more + information, see [Use a custom model in Amazon + Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html) + in the Amazon Bedrock User Guide. + + - To include a prompt that was defined in [Prompt + management](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management.html), + specify the ARN of the prompt version to use. + + The Converse API doesn't support [imported + models](https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-import-model.html). + """ + messages: list[Message] | None = ... + """The messages that you want to send to the model.""" + system: list[SystemContentBlock] | None = ... + """ + A prompt that provides instructions or context to the model about the + task it should perform, or the persona it should adopt during the + conversation. + """ + inference_config: InferenceConfiguration | None = ... + """ + Inference parameters to pass to the model. `Converse` and + `ConverseStream` support a base set of inference parameters. If you need + to pass additional parameters that the model supports, use the + `additionalModelRequestFields` request field. + """ + tool_config: ToolConfiguration | None = ... + """ + Configuration information for the tools that the model can use when + generating a response. + + For information about models that support streaming tool use, see + [Supported models and model + features](https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference.html#conversation-inference-supported-models-features). + """ + guardrail_config: GuardrailStreamConfiguration | None = ... + """ + Configuration information for a guardrail that you want to use in the + request. If you include `guardContent` blocks in the `content` field in + the `messages` field, the guardrail operates only on those messages. If + you include no `guardContent` blocks, the guardrail operates on all + messages in the request body and in any included prompt resource. + """ + additional_model_request_fields: Document | None = ... + """ + Additional inference parameters that the model supports, beyond the base + set of inference parameters that `Converse` and `ConverseStream` support + in the `inferenceConfig` field. For more information, see [Model + parameters](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). + """ + prompt_variables: dict[str, PromptVariableValues] | None = ... + """ + Contains a map of variables in a prompt from Prompt management to + objects containing the values to fill in for them when running model + invocation. This field is ignored if you don't specify a prompt + resource in the `modelId` field. + """ + additional_model_response_field_paths: list[str] | None = ... + """ + Additional model parameters field paths to return in the response. + `Converse` and `ConverseStream` return the requested fields as a JSON + Pointer object in the `additionalModelResponseFields` field. The + following is example JSON for `additionalModelResponseFieldPaths`. + + `[ "/stop_sequence" ]` + + For information about the JSON Pointer syntax, see the [Internet + Engineering Task Force + (IETF)](https://datatracker.ietf.org/doc/html/rfc6901) documentation. + + `Converse` and `ConverseStream` reject an empty JSON Pointer or + incorrectly structured JSON Pointer with a `400` error code. if the JSON + Pointer is valid, but the requested field is not in the model response, + it is ignored by `Converse`. + """ + request_metadata: dict[str, str] | None = ... + """Key-value pairs that you can use to filter invocation logs.""" + performance_config: PerformanceConfiguration | None = ... + """Model performance settings for the request.""" + service_tier: ServiceTier | None = ... + """ + Specifies the processing tier configuration used for serving the + request. + """ + output_config: OutputConfig | None = ... + """Output configuration for a model response.""" + +@dataclass(kw_only=True) +class ConverseStreamMetadataEvent(_SerdeShape): + """A conversation stream metadata event.""" + + usage: TokenUsage + """Usage information for the conversation stream event.""" + metrics: ConverseStreamMetrics + """The metrics for the conversation stream metadata event.""" + trace: ConverseStreamTrace | None = ... + """ + The trace object in the response from + [ConverseStream](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html) + that contains information about the guardrail behavior. + """ + performance_config: PerformanceConfiguration | None = ... + """ + Model performance configuration metadata for the conversation stream + event. + """ + service_tier: ServiceTier | None = ... + """ + Specifies the processing tier configuration used for serving the + request. + """ + +@dataclass(kw_only=True) +class ConverseStreamMetrics(_SerdeShape): + """Metrics for the stream.""" + + latency_ms: int + """The latency for the streaming request, in milliseconds.""" + +@dataclass(kw_only=True) +class ConverseStreamOperationOutput(_SerdeShape): + """Dataclass for ConverseStreamOperationOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass +class ConverseStreamOutputMessageStart(_SerdeShape): + """Message start information.""" + + value: MessageStartEvent + +@dataclass +class ConverseStreamOutputContentBlockStart(_SerdeShape): + """Start information for a content block.""" + + value: ContentBlockStartEvent + +@dataclass +class ConverseStreamOutputContentBlockDelta(_SerdeShape): + """The messages output content block delta.""" + + value: ContentBlockDeltaEvent + +@dataclass +class ConverseStreamOutputContentBlockStop(_SerdeShape): + """Stop information for a content block.""" + + value: ContentBlockStopEvent + +@dataclass +class ConverseStreamOutputMessageStop(_SerdeShape): + """Message stop information.""" + + value: MessageStopEvent + +@dataclass +class ConverseStreamOutputMetadata(_SerdeShape): + """Metadata for the converse output stream.""" + + value: ConverseStreamMetadataEvent + +@dataclass +class ConverseStreamOutputInternalServerException(_SerdeShape): + """An internal server error occurred. Retry your request.""" + + value: InternalServerException + +@dataclass +class ConverseStreamOutputModelStreamErrorException(_SerdeShape): + """A streaming error occurred. Retry your request.""" + + value: ModelStreamErrorException + +@dataclass +class ConverseStreamOutputValidationException(_SerdeShape): + """ + The input fails to satisfy the constraints specified by *Amazon + Bedrock*. For troubleshooting this error, see + [ValidationError](https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-validation-error) + in the Amazon Bedrock User Guide. + """ + + value: ValidationException + +@dataclass +class ConverseStreamOutputThrottlingException(_SerdeShape): + """ + Your request was denied due to exceeding the account quotas for *Amazon + Bedrock*. For troubleshooting this error, see + [ThrottlingException](https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-throttling-exception) + in the Amazon Bedrock User Guide. + """ + + value: ThrottlingException + +@dataclass +class ConverseStreamOutputServiceUnavailableException(_SerdeShape): + """ + The service isn't currently available. For troubleshooting this error, + see + [ServiceUnavailable](https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-service-unavailable) + in the Amazon Bedrock User Guide + """ + + value: ServiceUnavailableException + +@dataclass +class ConverseStreamOutputUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ConverseStreamOutput = Union[ + ConverseStreamOutputMessageStart + | ConverseStreamOutputContentBlockStart + | ConverseStreamOutputContentBlockDelta + | ConverseStreamOutputContentBlockStop + | ConverseStreamOutputMessageStop + | ConverseStreamOutputMetadata + | ConverseStreamOutputInternalServerException + | ConverseStreamOutputModelStreamErrorException + | ConverseStreamOutputValidationException + | ConverseStreamOutputThrottlingException + | ConverseStreamOutputServiceUnavailableException + | ConverseStreamOutputUnknown +] +"""The messages output stream""" + +class _ConverseStreamOutputDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> ConverseStreamOutput: ... + +@dataclass(kw_only=True) +class ConverseStreamTrace(_SerdeShape): + """ + The trace object in a response from + [ConverseStream](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html). + """ + + guardrail: GuardrailTraceAssessment | None = ... + """The guardrail trace object.""" + prompt_router: PromptRouterTrace | None = ... + """The request's prompt router.""" + +@dataclass(kw_only=True) +class ConverseTokensRequest(_SerdeShape): + """ + The inputs from a `Converse` API request for token counting. + + This structure mirrors the input format for the `Converse` operation, + allowing you to count tokens for conversation-based inference requests. + """ + + messages: list[Message] | None = ... + """An array of messages to count tokens for.""" + system: list[SystemContentBlock] | None = ... + """ + The system content blocks to count tokens for. System content provides + instructions or context to the model about how it should behave or + respond. The token count will include any system content provided. + """ + tool_config: ToolConfiguration | None = ... + """ + The toolConfig of Converse input request to count tokens for. + Configuration information for the tools that the model can use when + generating a response. + """ + additional_model_request_fields: Document | None = ... + """ + The additionalModelRequestFields of Converse input request to count + tokens for. Use this field when you want to pass additional parameters + that the model supports. + """ + +@dataclass(kw_only=True) +class ConverseTrace(_SerdeShape): + """ + The trace object in a response from + [Converse](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html). + """ + + guardrail: GuardrailTraceAssessment | None = ... + """The guardrail trace object.""" + prompt_router: PromptRouterTrace | None = ... + """The request's prompt router.""" + +@dataclass +class CountTokensInputInvokeModel(_SerdeShape): + """ + An `InvokeModel` request for which to count tokens. Use this field when + you want to count tokens for a raw text input that would be sent to the + `InvokeModel` operation. + """ + + value: InvokeModelTokensRequest + +@dataclass +class CountTokensInputConverse(_SerdeShape): + """ + A `Converse` request for which to count tokens. Use this field when you + want to count tokens for a conversation-based input that would be sent + to the `Converse` operation. + """ + + value: ConverseTokensRequest + +@dataclass +class CountTokensInputUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +CountTokensInput = Union[ + CountTokensInputInvokeModel | CountTokensInputConverse | CountTokensInputUnknown +] +""" +The input value for token counting. The value should be either an +`InvokeModel` or `Converse` request body. +""" + +class _CountTokensInputDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> CountTokensInput: ... + +@dataclass(kw_only=True) +class CountTokensOperationInput(_SerdeShape): + """Dataclass for CountTokensOperationInput structure.""" + + model_id: str | None = ... + """ + The unique identifier or ARN of the foundation model to use for token + counting. Each model processes tokens differently, so the token count is + specific to the model you specify. + """ + input: CountTokensInput | None = ... + """ + The input for which to count tokens. The structure of this parameter + depends on whether you're counting tokens for an `InvokeModel` or + `Converse` request: + + - For `InvokeModel` requests, provide the request body in the + `invokeModel` field + + - For `Converse` requests, provide the messages and system content in + the `converse` field + + The input format must be compatible with the model specified in the + `modelId` parameter. + """ + +@dataclass(kw_only=True) +class CountTokensOutput(_SerdeShape): + """Dataclass for CountTokensOutput structure.""" + + input_tokens: int + """ + The number of tokens in the provided input according to the specified + model's tokenization rules. This count represents the number of input + tokens that would be processed if the same input were sent to the model + in an inference request. Use this value to estimate costs and ensure + your inputs stay within model token limits. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DocumentBlock(_SerdeShape): + """A document to include in a message.""" + + format: str = ... + """The format of a document, or its extension.""" + name: str + """ + A name for the document. The name can only contain the following + characters: + + - Alphanumeric characters + + - Whitespace characters (no more than one in a row) + + - Hyphens + + - Parentheses + + - Square brackets + + Note: + This field is vulnerable to prompt injections, because the model might + inadvertently interpret it as instructions. Therefore, we recommend that + you specify a neutral name. + """ + source: DocumentSource + """Contains the content of the document.""" + context: str | None = ... + """ + Contextual information about how the document should be processed or + interpreted by the model when generating citations. + """ + citations: CitationsConfig | None = ... + """ + Configuration settings that control how citations should be generated + for this specific document. + """ + +@dataclass(kw_only=True) +class DocumentCharLocation(_SerdeShape): + """ + Specifies a character-level location within a document, providing + precise positioning information for cited content using start and end + character indices. + """ + + document_index: int | None = ... + """ + The index of the document within the array of documents provided in the + request. + """ + start: int | None = ... + """ + The starting character position of the cited content within the + document. + """ + end: int | None = ... + """The ending character position of the cited content within the document.""" + +@dataclass(kw_only=True) +class DocumentChunkLocation(_SerdeShape): + """ + Specifies a chunk-level location within a document, providing + positioning information for cited content using logical document + segments or chunks. + """ + + document_index: int | None = ... + """ + The index of the document within the array of documents provided in the + request. + """ + start: int | None = ... + """ + The starting chunk identifier or index of the cited content within the + document. + """ + end: int | None = ... + """ + The ending chunk identifier or index of the cited content within the + document. + """ + +@dataclass +class DocumentContentBlockText(_SerdeShape): + """The text content of the document.""" + + value: str + +@dataclass +class DocumentContentBlockUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +DocumentContentBlock = Union[DocumentContentBlockText | DocumentContentBlockUnknown] +""" +Contains the actual content of a document that can be processed by the +model and potentially cited in the response. +""" + +class _DocumentContentBlockDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> DocumentContentBlock: ... + +class DocumentFormat(UnknownEnumMixin, StrEnum): + PDF = "pdf" + CSV = "csv" + DOC = "doc" + DOCX = "docx" + XLS = "xls" + XLSX = "xlsx" + HTML = "html" + TXT = "txt" + MD = "md" + +@dataclass(kw_only=True) +class DocumentPageLocation(_SerdeShape): + """ + Specifies a page-level location within a document, providing positioning + information for cited content using page numbers. + """ + + document_index: int | None = ... + """ + The index of the document within the array of documents provided in the + request. + """ + start: int | None = ... + """The starting page number of the cited content within the document.""" + end: int | None = ... + """The ending page number of the cited content within the document.""" + +@dataclass +class DocumentSourceBytes(_SerdeShape): + """ + The raw bytes for the document. If you use an Amazon Web Services SDK, + you don't need to encode the bytes in base64. + """ + + value: bytes + +@dataclass +class DocumentSourceS3Location(_SerdeShape): + """ + The location of a document object in an Amazon S3 bucket. To see which + models support S3 uploads, see [Supported models and features for + Converse](https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference-supported-models-features.html). + """ + + value: S3Location + +@dataclass +class DocumentSourceText(_SerdeShape): + """The text content of the document source.""" + + value: str + +@dataclass +class DocumentSourceContent(_SerdeShape): + """ + The structured content of the document source, which may include various + content blocks such as text, images, or other document elements. + """ + + value: list[DocumentContentBlock] + +@dataclass +class DocumentSourceUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +DocumentSource = Union[ + DocumentSourceBytes + | DocumentSourceS3Location + | DocumentSourceText + | DocumentSourceContent + | DocumentSourceUnknown +] +"""Contains the content of a document.""" + +class _DocumentSourceDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> DocumentSource: ... + +@dataclass(kw_only=True) +class ErrorBlock(_SerdeShape): + """A block containing error information when content processing fails.""" + + message: str | None = ... + """ + A human-readable error message describing what went wrong during content + processing. + """ + +@dataclass(kw_only=True) +class GetAsyncInvokeInput(_SerdeShape): + """Dataclass for GetAsyncInvokeInput structure.""" + + invocation_arn: str | None = ... + """The invocation's ARN.""" + +@dataclass(kw_only=True) +class GetAsyncInvokeOutput(_SerdeShape): + """Dataclass for GetAsyncInvokeOutput structure.""" + + invocation_arn: str + """The invocation's ARN.""" + model_arn: str + """The invocation's model ARN.""" + client_request_token: str | None = ... + """The invocation's idempotency token.""" + status: str + """The invocation's status.""" + failure_message: str | None = ... + """An error message.""" + submit_time: datetime + """When the invocation request was submitted.""" + last_modified_time: datetime | None = ... + """The invocation's last modified time.""" + end_time: datetime | None = ... + """When the invocation ended.""" + output_data_config: AsyncInvokeOutputDataConfig + """Output data settings.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class GuardrailAction(UnknownEnumMixin, StrEnum): + NONE = "NONE" + GUARDRAIL_INTERVENED = "GUARDRAIL_INTERVENED" + +@dataclass(kw_only=True) +class GuardrailAssessment(_SerdeShape): + """ + A behavior assessment of the guardrail policies used in a call to the + Converse API. + """ + + topic_policy: GuardrailTopicPolicyAssessment | None = ... + """The topic policy.""" + content_policy: GuardrailContentPolicyAssessment | None = ... + """The content policy.""" + word_policy: GuardrailWordPolicyAssessment | None = ... + """The word policy.""" + sensitive_information_policy: ( + GuardrailSensitiveInformationPolicyAssessment | None + ) = ... + """The sensitive information policy.""" + contextual_grounding_policy: ( + GuardrailContextualGroundingPolicyAssessment | None + ) = ... + """The contextual grounding policy used for the guardrail assessment.""" + automated_reasoning_policy: GuardrailAutomatedReasoningPolicyAssessment | None = ... + """ + The automated reasoning policy assessment results, including logical + validation findings for the input content. + """ + invocation_metrics: GuardrailInvocationMetrics | None = ... + """The invocation metrics for the guardrail assessment.""" + applied_guardrail_details: AppliedGuardrailDetails | None = ... + """ + Details about the specific guardrail that was applied during this + assessment, including its identifier, version, ARN, origin, and + ownership information. + """ + +@dataclass +class GuardrailAutomatedReasoningFindingValid(_SerdeShape): + """ + Contains the result when the automated reasoning evaluation determines + that the claims in the input are logically valid and definitively true + based on the provided premises and policy rules. + """ + + value: GuardrailAutomatedReasoningValidFinding + +@dataclass +class GuardrailAutomatedReasoningFindingInvalid(_SerdeShape): + """ + Contains the result when the automated reasoning evaluation determines + that the claims in the input are logically invalid and contradict the + established premises or policy rules. + """ + + value: GuardrailAutomatedReasoningInvalidFinding + +@dataclass +class GuardrailAutomatedReasoningFindingSatisfiable(_SerdeShape): + """ + Contains the result when the automated reasoning evaluation determines + that the claims in the input could be either true or false depending on + additional assumptions not provided in the input context. + """ + + value: GuardrailAutomatedReasoningSatisfiableFinding + +@dataclass +class GuardrailAutomatedReasoningFindingImpossible(_SerdeShape): + """ + Contains the result when the automated reasoning evaluation determines + that no valid logical conclusions can be drawn due to contradictions in + the premises or policy rules themselves. + """ + + value: GuardrailAutomatedReasoningImpossibleFinding + +@dataclass +class GuardrailAutomatedReasoningFindingTranslationAmbiguous(_SerdeShape): + """ + Contains the result when the automated reasoning evaluation detects that + the input has multiple valid logical interpretations, requiring + additional context or clarification to proceed with validation. + """ + + value: GuardrailAutomatedReasoningTranslationAmbiguousFinding + +@dataclass +class GuardrailAutomatedReasoningFindingTooComplex(_SerdeShape): + """ + Contains the result when the automated reasoning evaluation cannot + process the input due to its complexity or volume exceeding the + system's processing capacity for logical analysis. + """ + + value: GuardrailAutomatedReasoningTooComplexFinding + +@dataclass +class GuardrailAutomatedReasoningFindingNoTranslations(_SerdeShape): + """ + Contains the result when the automated reasoning evaluation cannot + extract any relevant logical information from the input that can be + validated against the policy rules. + """ + + value: GuardrailAutomatedReasoningNoTranslationsFinding + +@dataclass +class GuardrailAutomatedReasoningFindingUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +GuardrailAutomatedReasoningFinding = Union[ + GuardrailAutomatedReasoningFindingValid + | GuardrailAutomatedReasoningFindingInvalid + | GuardrailAutomatedReasoningFindingSatisfiable + | GuardrailAutomatedReasoningFindingImpossible + | GuardrailAutomatedReasoningFindingTranslationAmbiguous + | GuardrailAutomatedReasoningFindingTooComplex + | GuardrailAutomatedReasoningFindingNoTranslations + | GuardrailAutomatedReasoningFindingUnknown +] +""" +Represents a logical validation result from automated reasoning policy +evaluation. The finding indicates whether claims in the input are +logically valid, invalid, satisfiable, impossible, or have other logical +issues. +""" + +class _GuardrailAutomatedReasoningFindingDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> GuardrailAutomatedReasoningFinding: ... + +@dataclass(kw_only=True) +class GuardrailAutomatedReasoningImpossibleFinding(_SerdeShape): + """ + Indicates that no valid claims can be made due to logical contradictions + in the premises or rules. + """ + + translation: GuardrailAutomatedReasoningTranslation | None = ... + """The logical translation of the input that this finding evaluates.""" + contradicting_rules: list[GuardrailAutomatedReasoningRule] | None = ... + """ + The automated reasoning policy rules that contradict the claims and/or + premises in the input. + """ + logic_warning: GuardrailAutomatedReasoningLogicWarning | None = ... + """ + Indication of a logic issue with the translation without needing to + consider the automated reasoning policy rules. + """ + +@dataclass(kw_only=True) +class GuardrailAutomatedReasoningInputTextReference(_SerdeShape): + """ + References a portion of the original input text that corresponds to + logical elements. + """ + + text: str | None = ... + """The specific text from the original input that this reference points to.""" + +@dataclass(kw_only=True) +class GuardrailAutomatedReasoningInvalidFinding(_SerdeShape): + """ + Indicates that the claims are logically false and contradictory to the + established rules or premises. + """ + + translation: GuardrailAutomatedReasoningTranslation | None = ... + """The logical translation of the input that this finding invalidates.""" + contradicting_rules: list[GuardrailAutomatedReasoningRule] | None = ... + """ + The automated reasoning policy rules that contradict the claims in the + input. + """ + logic_warning: GuardrailAutomatedReasoningLogicWarning | None = ... + """ + Indication of a logic issue with the translation without needing to + consider the automated reasoning policy rules. + """ + +@dataclass(kw_only=True) +class GuardrailAutomatedReasoningLogicWarning(_SerdeShape): + """ + Identifies logical issues in the translated statements that exist + independent of any policy rules, such as statements that are always true + or always false. + """ + + type: str | None = ... + """ + The category of the detected logical issue, such as statements that are + always true or always false. + """ + premises: list[GuardrailAutomatedReasoningStatement] | None = ... + """ + The logical statements that serve as premises under which the claims are + validated. + """ + claims: list[GuardrailAutomatedReasoningStatement] | None = ... + """ + The logical statements that are validated while assuming the policy and + premises. + """ + +class GuardrailAutomatedReasoningLogicWarningType(UnknownEnumMixin, StrEnum): + ALWAYS_FALSE = "ALWAYS_FALSE" + ALWAYS_TRUE = "ALWAYS_TRUE" + +@dataclass(kw_only=True) +class GuardrailAutomatedReasoningNoTranslationsFinding(_SerdeShape): + """ + Indicates that no relevant logical information could be extracted from + the input for validation. + """ + +@dataclass(kw_only=True) +class GuardrailAutomatedReasoningPolicyAssessment(_SerdeShape): + """ + Contains the results of automated reasoning policy evaluation, including + logical findings about the validity of claims made in the input content. + """ + + findings: list[GuardrailAutomatedReasoningFinding] | None = ... + """ + List of logical validation results produced by evaluating the input + content against automated reasoning policies. + """ + +@dataclass(kw_only=True) +class GuardrailAutomatedReasoningRule(_SerdeShape): + """ + References a specific automated reasoning policy rule that was applied + during evaluation. + """ + + identifier: str | None = ... + """The unique identifier of the automated reasoning rule.""" + policy_version_arn: str | None = ... + """ + The ARN of the automated reasoning policy version that contains this + rule. + """ + +@dataclass(kw_only=True) +class GuardrailAutomatedReasoningSatisfiableFinding(_SerdeShape): + """ + Indicates that the claims could be either true or false depending on + additional assumptions not provided in the input. + """ + + translation: GuardrailAutomatedReasoningTranslation | None = ... + """The logical translation of the input that this finding evaluates.""" + claims_true_scenario: GuardrailAutomatedReasoningScenario | None = ... + """ + An example scenario demonstrating how the claims could be logically + true. + """ + claims_false_scenario: GuardrailAutomatedReasoningScenario | None = ... + """ + An example scenario demonstrating how the claims could be logically + false. + """ + logic_warning: GuardrailAutomatedReasoningLogicWarning | None = ... + """ + Indication of a logic issue with the translation without needing to + consider the automated reasoning policy rules. + """ + +@dataclass(kw_only=True) +class GuardrailAutomatedReasoningScenario(_SerdeShape): + """ + Represents a logical scenario where claims can be evaluated as true or + false, containing specific logical assignments. + """ + + statements: list[GuardrailAutomatedReasoningStatement] | None = ... + """List of logical assignments and statements that define this scenario.""" + +@dataclass(kw_only=True) +class GuardrailAutomatedReasoningStatement(_SerdeShape): + """ + A logical statement that includes both formal logic representation and + natural language explanation. + """ + + logic: str | None = ... + """The formal logical representation of the statement.""" + natural_language: str | None = ... + """The natural language explanation of the logical statement.""" + +@dataclass(kw_only=True) +class GuardrailAutomatedReasoningTooComplexFinding(_SerdeShape): + """ + Indicates that the input exceeds the processing capacity due to the + volume or complexity of the logical information. + """ + +@dataclass(kw_only=True) +class GuardrailAutomatedReasoningTranslation(_SerdeShape): + """ + Contains the logical translation of natural language input into formal + logical statements, including premises, claims, and confidence scores. + """ + + premises: list[GuardrailAutomatedReasoningStatement] | None = ... + """ + The logical statements that serve as the foundation or assumptions for + the claims. + """ + claims: list[GuardrailAutomatedReasoningStatement] | None = ... + """ + The logical statements that are being validated against the premises and + policy rules. + """ + untranslated_premises: ( + list[GuardrailAutomatedReasoningInputTextReference] | None + ) = ... + """ + References to portions of the original input text that correspond to the + premises but could not be fully translated. + """ + untranslated_claims: ( + list[GuardrailAutomatedReasoningInputTextReference] | None + ) = ... + """ + References to portions of the original input text that correspond to the + claims but could not be fully translated. + """ + confidence: float | None = ... + """ + A confidence score between 0 and 1 indicating how certain the system is + about the logical translation. + """ + +@dataclass(kw_only=True) +class GuardrailAutomatedReasoningTranslationAmbiguousFinding(_SerdeShape): + """ + Indicates that the input has multiple valid logical interpretations, + requiring additional context or clarification. + """ + + options: list[GuardrailAutomatedReasoningTranslationOption] | None = ... + """ + Different logical interpretations that were detected during translation + of the input. + """ + difference_scenarios: list[GuardrailAutomatedReasoningScenario] | None = ... + """ + Scenarios showing how the different translation options differ in + meaning. + """ + +@dataclass(kw_only=True) +class GuardrailAutomatedReasoningTranslationOption(_SerdeShape): + """ + Represents one possible logical interpretation of ambiguous input + content. + """ + + translations: list[GuardrailAutomatedReasoningTranslation] | None = ... + """ + Example translations that provide this possible interpretation of the + input. + """ + +@dataclass(kw_only=True) +class GuardrailAutomatedReasoningValidFinding(_SerdeShape): + """ + Indicates that the claims are definitively true and logically implied by + the premises, with no possible alternative interpretations. + """ + + translation: GuardrailAutomatedReasoningTranslation | None = ... + """The logical translation of the input that this finding validates.""" + claims_true_scenario: GuardrailAutomatedReasoningScenario | None = ... + """An example scenario demonstrating how the claims are logically true.""" + supporting_rules: list[GuardrailAutomatedReasoningRule] | None = ... + """ + The automated reasoning policy rules that support why this result is + considered valid. + """ + logic_warning: GuardrailAutomatedReasoningLogicWarning | None = ... + """ + Indication of a logic issue with the translation without needing to + consider the automated reasoning policy rules. + """ + +@dataclass(kw_only=True) +class GuardrailChecksConfig(_SerdeShape): + """ + The configuration for inline guardrail checks. Specify one or more check + types to run against the messages. + """ + + content_filter: GuardrailChecksContentFilterConfig | None = ... + """The content filter check configuration.""" + prompt_attack: GuardrailChecksPromptAttackConfig | None = ... + """The prompt attack check configuration.""" + sensitive_information: GuardrailChecksSensitiveInformationConfig | None = ... + """The sensitive information check configuration.""" + +@dataclass +class GuardrailChecksContentBlockText(_SerdeShape): + """The text content to evaluate.""" + + value: str + +@dataclass +class GuardrailChecksContentBlockUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +GuardrailChecksContentBlock = Union[ + GuardrailChecksContentBlockText | GuardrailChecksContentBlockUnknown +] +"""A content block within a message to evaluate.""" + +class _GuardrailChecksContentBlockDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> GuardrailChecksContentBlock: ... + +class GuardrailChecksContentFilterCategory(UnknownEnumMixin, StrEnum): + """The category for content filter evaluation.""" + + VIOLENCE = "VIOLENCE" + HATE = "HATE" + SEXUAL = "SEXUAL" + MISCONDUCT = "MISCONDUCT" + INSULTS = "INSULTS" + +@dataclass(kw_only=True) +class GuardrailChecksContentFilterCategoryConfig(_SerdeShape): + """The configuration for a single content filter category to evaluate.""" + + category: str + """The content filter category to evaluate.""" + +@dataclass(kw_only=True) +class GuardrailChecksContentFilterConfig(_SerdeShape): + """ + The configuration for the content filter check, specifying which + categories to evaluate. + """ + + categories: list[GuardrailChecksContentFilterCategoryConfig] + """The content filter categories to evaluate.""" + +@dataclass(kw_only=True) +class GuardrailChecksContentFilterResult(_SerdeShape): + """The content filter check results.""" + + results: list[GuardrailChecksContentFilterResultEntry] + """The per-category content filter results.""" + +@dataclass(kw_only=True) +class GuardrailChecksContentFilterResultEntry(_SerdeShape): + """The evaluation result for a single content filter category.""" + + category: str + """The content filter category that was evaluated.""" + severity_score: float + """ + The severity score for the category, ranging from 0.0 to 1.0. Higher + values indicate greater severity. + """ + +@dataclass(kw_only=True) +class GuardrailChecksContentFilterUsage(_SerdeShape): + """The text unit usage for the content filter check.""" + + text_units: int + """The number of text units consumed by the content filter check.""" + +@dataclass(kw_only=True) +class GuardrailChecksMessage(_SerdeShape): + """ + A message to evaluate against guardrail checks, containing a role and + content blocks. + """ + + role: str + """The role of the message sender.""" + content: list[GuardrailChecksContentBlock] + """The content blocks for the message.""" + +class GuardrailChecksPromptAttackCategory(UnknownEnumMixin, StrEnum): + """The category for prompt attack evaluation.""" + + JAILBREAK = "JAILBREAK" + PROMPT_INJECTION = "PROMPT_INJECTION" + PROMPT_LEAKAGE = "PROMPT_LEAKAGE" + +@dataclass(kw_only=True) +class GuardrailChecksPromptAttackCategoryConfig(_SerdeShape): + """The configuration for a single prompt attack category to evaluate.""" + + category: str + """The prompt attack category to evaluate.""" + +@dataclass(kw_only=True) +class GuardrailChecksPromptAttackConfig(_SerdeShape): + """ + The configuration for the prompt attack check, specifying which + categories to evaluate. + """ + + categories: list[GuardrailChecksPromptAttackCategoryConfig] + """The prompt attack categories to evaluate.""" + +@dataclass(kw_only=True) +class GuardrailChecksPromptAttackResult(_SerdeShape): + """The prompt attack check results.""" + + results: list[GuardrailChecksPromptAttackResultEntry] + """The per-category prompt attack results.""" + +@dataclass(kw_only=True) +class GuardrailChecksPromptAttackResultEntry(_SerdeShape): + """The evaluation result for a single prompt attack category.""" + + category: str + """The prompt attack category that was evaluated.""" + severity_score: float + """ + The severity score for the category, ranging from 0.0 to 1.0. Higher + values indicate greater severity. + """ + +@dataclass(kw_only=True) +class GuardrailChecksPromptAttackUsage(_SerdeShape): + """The text unit usage for the prompt attack check.""" + + text_units: int + """The number of text units consumed by the prompt attack check.""" + +@dataclass(kw_only=True) +class GuardrailChecksResults(_SerdeShape): + """ + The results from the guardrail checks evaluation, organized by check + type. + """ + + content_filter: GuardrailChecksContentFilterResult | None = ... + """The content filter check results.""" + prompt_attack: GuardrailChecksPromptAttackResult | None = ... + """The prompt attack check results.""" + sensitive_information: GuardrailChecksSensitiveInformationResult | None = ... + """The sensitive information check results.""" + +class GuardrailChecksRole(UnknownEnumMixin, StrEnum): + """The role of the message sender in the conversation.""" + + USER = "user" + ASSISTANT = "assistant" + SYSTEM = "system" + +@dataclass(kw_only=True) +class GuardrailChecksSensitiveInformationConfig(_SerdeShape): + """ + The configuration for the sensitive information check, specifying which + entity types to detect. + """ + + entities: list[GuardrailChecksSensitiveInformationEntityConfig] + """The sensitive information entity types to detect.""" + +@dataclass(kw_only=True) +class GuardrailChecksSensitiveInformationEntityConfig(_SerdeShape): + """ + The configuration for a single sensitive information entity type to + detect. + """ + + type: str + """The PII entity type to detect.""" + +class GuardrailChecksSensitiveInformationEntityType(UnknownEnumMixin, StrEnum): + """The type of personally identifiable information (PII) entity to detect.""" + + ADDRESS = "ADDRESS" + AGE = "AGE" + AWS_ACCESS_KEY = "AWS_ACCESS_KEY" + AWS_SECRET_KEY = "AWS_SECRET_KEY" + CA_HEALTH_NUMBER = "CA_HEALTH_NUMBER" + CA_SOCIAL_INSURANCE_NUMBER = "CA_SOCIAL_INSURANCE_NUMBER" + CREDIT_DEBIT_CARD_CVV = "CREDIT_DEBIT_CARD_CVV" + CREDIT_DEBIT_CARD_EXPIRY = "CREDIT_DEBIT_CARD_EXPIRY" + CREDIT_DEBIT_CARD_NUMBER = "CREDIT_DEBIT_CARD_NUMBER" + DRIVER_ID = "DRIVER_ID" + EMAIL = "EMAIL" + INTERNATIONAL_BANK_ACCOUNT_NUMBER = "INTERNATIONAL_BANK_ACCOUNT_NUMBER" + IP_ADDRESS = "IP_ADDRESS" + LICENSE_PLATE = "LICENSE_PLATE" + MAC_ADDRESS = "MAC_ADDRESS" + NAME = "NAME" + PASSWORD = "PASSWORD" + PHONE = "PHONE" + PIN = "PIN" + SWIFT_CODE = "SWIFT_CODE" + UK_NATIONAL_HEALTH_SERVICE_NUMBER = "UK_NATIONAL_HEALTH_SERVICE_NUMBER" + UK_NATIONAL_INSURANCE_NUMBER = "UK_NATIONAL_INSURANCE_NUMBER" + UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER = "UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER" + URL = "URL" + USERNAME = "USERNAME" + US_BANK_ACCOUNT_NUMBER = "US_BANK_ACCOUNT_NUMBER" + US_BANK_ROUTING_NUMBER = "US_BANK_ROUTING_NUMBER" + US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER = "US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER" + US_PASSPORT_NUMBER = "US_PASSPORT_NUMBER" + US_SOCIAL_SECURITY_NUMBER = "US_SOCIAL_SECURITY_NUMBER" + VEHICLE_IDENTIFICATION_NUMBER = "VEHICLE_IDENTIFICATION_NUMBER" + +@dataclass(kw_only=True) +class GuardrailChecksSensitiveInformationResult(_SerdeShape): + """The sensitive information check results.""" + + results: list[GuardrailChecksSensitiveInformationResultEntry] + """The detected sensitive information entities.""" + truncated: bool | None = ... + """ + Specifies whether the results were truncated because the number of + detected entities exceeded the maximum limit. + """ + +@dataclass(kw_only=True) +class GuardrailChecksSensitiveInformationResultEntry(_SerdeShape): + """ + The detection result for a single sensitive information entity found in + the evaluated messages. + """ + + type: str + """The PII entity type that was detected.""" + confidence_score: float + """ + The confidence score for the detection, ranging from 0.0 to 1.0. Higher + values indicate greater confidence. + """ + begin_offset: int + """ + The start character offset of the detected entity within the content + block. + """ + end_offset: int + """ + The end character offset of the detected entity within the content + block. + """ + message_index: int + """ + The zero-based index of the message in the input messages array where + the entity was detected. + """ + content_index: int + """ + The zero-based index of the content block within the message where the + entity was detected. + """ + +@dataclass(kw_only=True) +class GuardrailChecksSensitiveInformationUsage(_SerdeShape): + """The text unit usage for the sensitive information check.""" + + text_units: int + """The number of text units consumed by the sensitive information check.""" + +@dataclass(kw_only=True) +class GuardrailChecksUsageResults(_SerdeShape): + """ + The text unit usage for the guardrail checks evaluation, organized by + check type. + """ + + content_filter: GuardrailChecksContentFilterUsage | None = ... + """The text unit usage for the content filter check.""" + prompt_attack: GuardrailChecksPromptAttackUsage | None = ... + """The text unit usage for the prompt attack check.""" + sensitive_information: GuardrailChecksSensitiveInformationUsage | None = ... + """The text unit usage for the sensitive information check.""" + +@dataclass(kw_only=True) +class GuardrailConfiguration(_SerdeShape): + """ + Configuration information for a guardrail that you use with the + [Converse](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html) + operation. + """ + + guardrail_identifier: str = ... + """The identifier for the guardrail.""" + guardrail_version: str = ... + """The version of the guardrail.""" + trace: str = ... + """The trace behavior for the guardrail.""" + +@dataclass +class GuardrailContentBlockText(_SerdeShape): + """Text within content block to be evaluated by the guardrail.""" + + value: GuardrailTextBlock + +@dataclass +class GuardrailContentBlockImage(_SerdeShape): + """Image within guardrail content block to be evaluated by the guardrail.""" + + value: GuardrailImageBlock + +@dataclass +class GuardrailContentBlockUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +GuardrailContentBlock = Union[ + GuardrailContentBlockText + | GuardrailContentBlockImage + | GuardrailContentBlockUnknown +] +"""The content block to be evaluated by the guardrail.""" + +class _GuardrailContentBlockDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> GuardrailContentBlock: ... + +@dataclass(kw_only=True) +class GuardrailContentFilter(_SerdeShape): + """The content filter for a guardrail.""" + + type: str + """The guardrail type.""" + confidence: str + """The guardrail confidence.""" + filter_strength: str | None = ... + """The filter strength setting for the guardrail content filter.""" + action: str + """The guardrail action.""" + detected: bool | None = ... + """ + Indicates whether content that breaches the guardrail configuration is + detected. + """ + +class GuardrailContentFilterConfidence(UnknownEnumMixin, StrEnum): + NONE = "NONE" + LOW = "LOW" + MEDIUM = "MEDIUM" + HIGH = "HIGH" + +class GuardrailContentFilterStrength(UnknownEnumMixin, StrEnum): + NONE = "NONE" + LOW = "LOW" + MEDIUM = "MEDIUM" + HIGH = "HIGH" + +class GuardrailContentFilterType(UnknownEnumMixin, StrEnum): + INSULTS = "INSULTS" + HATE = "HATE" + SEXUAL = "SEXUAL" + VIOLENCE = "VIOLENCE" + MISCONDUCT = "MISCONDUCT" + PROMPT_ATTACK = "PROMPT_ATTACK" + +class GuardrailContentPolicyAction(UnknownEnumMixin, StrEnum): + BLOCKED = "BLOCKED" + NONE = "NONE" + +@dataclass(kw_only=True) +class GuardrailContentPolicyAssessment(_SerdeShape): + """An assessment of a content policy for a guardrail.""" + + filters: list[GuardrailContentFilter] + """The content policy filters.""" + +class GuardrailContentQualifier(UnknownEnumMixin, StrEnum): + GROUNDING_SOURCE = "grounding_source" + QUERY = "query" + GUARD_CONTENT = "guard_content" + +class GuardrailContentSource(UnknownEnumMixin, StrEnum): + INPUT = "INPUT" + OUTPUT = "OUTPUT" + +@dataclass(kw_only=True) +class GuardrailContextualGroundingFilter(_SerdeShape): + """The details for the guardrails contextual grounding filter.""" + + type: str + """The contextual grounding filter type.""" + threshold: float + """ + The threshold used by contextual grounding filter to determine whether + the content is grounded or not. + """ + score: float + """The score generated by contextual grounding filter.""" + action: str + """The action performed by the guardrails contextual grounding filter.""" + detected: bool | None = ... + """ + Indicates whether content that fails the contextual grounding evaluation + (grounding or relevance score less than the corresponding threshold) was + detected. + """ + +class GuardrailContextualGroundingFilterType(UnknownEnumMixin, StrEnum): + GROUNDING = "GROUNDING" + RELEVANCE = "RELEVANCE" + +class GuardrailContextualGroundingPolicyAction(UnknownEnumMixin, StrEnum): + BLOCKED = "BLOCKED" + NONE = "NONE" + +@dataclass(kw_only=True) +class GuardrailContextualGroundingPolicyAssessment(_SerdeShape): + """ + The policy assessment details for the guardrails contextual grounding + filter. + """ + + filters: list[GuardrailContextualGroundingFilter] | None = ... + """The filter details for the guardrails contextual grounding filter.""" + +@dataclass +class GuardrailConverseContentBlockText(_SerdeShape): + """The text to guard.""" + + value: GuardrailConverseTextBlock + +@dataclass +class GuardrailConverseContentBlockImage(_SerdeShape): + """Image within converse content block to be evaluated by the guardrail.""" + + value: GuardrailConverseImageBlock + +@dataclass +class GuardrailConverseContentBlockUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +GuardrailConverseContentBlock = Union[ + GuardrailConverseContentBlockText + | GuardrailConverseContentBlockImage + | GuardrailConverseContentBlockUnknown +] +""" +A content block for selective guarding with the +[Converse](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html) +or +[ConverseStream](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html) +API operations. +""" + +class _GuardrailConverseContentBlockDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> GuardrailConverseContentBlock: ... + +class GuardrailConverseContentQualifier(UnknownEnumMixin, StrEnum): + GROUNDING_SOURCE = "grounding_source" + QUERY = "query" + GUARD_CONTENT = "guard_content" + +@dataclass(kw_only=True) +class GuardrailConverseImageBlock(_SerdeShape): + """ + An image block that contains images that you want to assess with a + guardrail. + """ + + format: str + """ + The format details for the image type of the guardrail converse image + block. + """ + source: GuardrailConverseImageSource + """The image source (image bytes) of the guardrail converse image block.""" + +class GuardrailConverseImageFormat(UnknownEnumMixin, StrEnum): + PNG = "png" + JPEG = "jpeg" + +@dataclass +class GuardrailConverseImageSourceBytes(_SerdeShape): + """The raw image bytes for the image.""" + + value: bytes + +@dataclass +class GuardrailConverseImageSourceUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +GuardrailConverseImageSource = Union[ + GuardrailConverseImageSourceBytes | GuardrailConverseImageSourceUnknown +] +"""The image source (image bytes) of the guardrail converse image source.""" + +class _GuardrailConverseImageSourceDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> GuardrailConverseImageSource: ... + +@dataclass(kw_only=True) +class GuardrailConverseTextBlock(_SerdeShape): + """ + A text block that contains text that you want to assess with a + guardrail. For more information, see + [GuardrailConverseContentBlock](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_GuardrailConverseContentBlock.html). + """ + + text: str + """The text that you want to guard.""" + qualifiers: list[str] | None = ... + """The qualifier details for the guardrails contextual grounding filter.""" + +@dataclass(kw_only=True) +class GuardrailCoverage(_SerdeShape): + """The action of the guardrail coverage details.""" + + text_characters: GuardrailTextCharactersCoverage | None = ... + """The text characters of the guardrail coverage details.""" + images: GuardrailImageCoverage | None = ... + """ + The guardrail coverage for images (the number of images that guardrails + guarded). + """ + +@dataclass(kw_only=True) +class GuardrailCustomWord(_SerdeShape): + """A custom word configured in a guardrail.""" + + match: str + """The match for the custom word.""" + action: str + """The action for the custom word.""" + detected: bool | None = ... + """ + Indicates whether custom word content that breaches the guardrail + configuration is detected. + """ + +@dataclass(kw_only=True) +class GuardrailImageBlock(_SerdeShape): + """ + Contain an image which user wants guarded. This block is accepted by the + guardrails independent API. + """ + + format: str + """ + The format details for the file type of the image blocked by the + guardrail. + """ + source: GuardrailImageSource + """ + The image source (image bytes) details of the image blocked by the + guardrail. + """ + +@dataclass(kw_only=True) +class GuardrailImageCoverage(_SerdeShape): + """The details of the guardrail image coverage.""" + + guarded: int | None = ... + """The count (integer) of images guardrails guarded.""" + total: int | None = ... + """ + Represents the total number of images (integer) that were in the request + (guarded and unguarded). + """ + +class GuardrailImageFormat(UnknownEnumMixin, StrEnum): + PNG = "png" + JPEG = "jpeg" + +@dataclass +class GuardrailImageSourceBytes(_SerdeShape): + """ + The bytes details of the guardrail image source. Object used in + independent api. + """ + + value: bytes + +@dataclass +class GuardrailImageSourceUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +GuardrailImageSource = Union[GuardrailImageSourceBytes | GuardrailImageSourceUnknown] +""" +The image source (image bytes) of the guardrail image source. Object +used in independent api. +""" + +class _GuardrailImageSourceDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> GuardrailImageSource: ... + +@dataclass(kw_only=True) +class GuardrailInvocationMetrics(_SerdeShape): + """The invocation metrics for the guardrail.""" + + guardrail_processing_latency: int | None = ... + """The processing latency details for the guardrail invocation metrics.""" + usage: GuardrailUsage | None = ... + """The usage details for the guardrail invocation metrics.""" + guardrail_coverage: GuardrailCoverage | None = ... + """The coverage details for the guardrail invocation metrics.""" + +@dataclass(kw_only=True) +class GuardrailManagedWord(_SerdeShape): + """A managed word configured in a guardrail.""" + + match: str + """The match for the managed word.""" + type: str + """The type for the managed word.""" + action: str + """The action for the managed word.""" + detected: bool | None = ... + """ + Indicates whether managed word content that breaches the guardrail + configuration is detected. + """ + +class GuardrailManagedWordType(UnknownEnumMixin, StrEnum): + PROFANITY = "PROFANITY" + +class GuardrailOrigin(UnknownEnumMixin, StrEnum): + REQUEST = "REQUEST" + ACCOUNT_ENFORCED = "ACCOUNT_ENFORCED" + ORGANIZATION_ENFORCED = "ORGANIZATION_ENFORCED" + +@dataclass(kw_only=True) +class GuardrailOutputContent(_SerdeShape): + """The output content produced by the guardrail.""" + + text: str | None = ... + """The specific text for the output content produced by the guardrail.""" + +class GuardrailOutputScope(UnknownEnumMixin, StrEnum): + INTERVENTIONS = "INTERVENTIONS" + FULL = "FULL" + +class GuardrailOwnership(UnknownEnumMixin, StrEnum): + SELF = "SELF" + CROSS_ACCOUNT = "CROSS_ACCOUNT" + +@dataclass(kw_only=True) +class GuardrailPiiEntityFilter(_SerdeShape): + """ + A Personally Identifiable Information (PII) entity configured in a + guardrail. + """ + + match: str + """The PII entity filter match.""" + type: str + """The PII entity filter type.""" + action: str + """The PII entity filter action.""" + detected: bool | None = ... + """ + Indicates whether personally identifiable information (PII) that + breaches the guardrail configuration is detected. + """ + +class GuardrailPiiEntityType(UnknownEnumMixin, StrEnum): + ADDRESS = "ADDRESS" + AGE = "AGE" + AWS_ACCESS_KEY = "AWS_ACCESS_KEY" + AWS_SECRET_KEY = "AWS_SECRET_KEY" + CA_HEALTH_NUMBER = "CA_HEALTH_NUMBER" + CA_SOCIAL_INSURANCE_NUMBER = "CA_SOCIAL_INSURANCE_NUMBER" + CREDIT_DEBIT_CARD_CVV = "CREDIT_DEBIT_CARD_CVV" + CREDIT_DEBIT_CARD_EXPIRY = "CREDIT_DEBIT_CARD_EXPIRY" + CREDIT_DEBIT_CARD_NUMBER = "CREDIT_DEBIT_CARD_NUMBER" + DRIVER_ID = "DRIVER_ID" + EMAIL = "EMAIL" + INTERNATIONAL_BANK_ACCOUNT_NUMBER = "INTERNATIONAL_BANK_ACCOUNT_NUMBER" + IP_ADDRESS = "IP_ADDRESS" + LICENSE_PLATE = "LICENSE_PLATE" + MAC_ADDRESS = "MAC_ADDRESS" + NAME = "NAME" + PASSWORD = "PASSWORD" + PHONE = "PHONE" + PIN = "PIN" + SWIFT_CODE = "SWIFT_CODE" + UK_NATIONAL_HEALTH_SERVICE_NUMBER = "UK_NATIONAL_HEALTH_SERVICE_NUMBER" + UK_NATIONAL_INSURANCE_NUMBER = "UK_NATIONAL_INSURANCE_NUMBER" + UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER = "UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER" + URL = "URL" + USERNAME = "USERNAME" + US_BANK_ACCOUNT_NUMBER = "US_BANK_ACCOUNT_NUMBER" + US_BANK_ROUTING_NUMBER = "US_BANK_ROUTING_NUMBER" + US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER = "US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER" + US_PASSPORT_NUMBER = "US_PASSPORT_NUMBER" + US_SOCIAL_SECURITY_NUMBER = "US_SOCIAL_SECURITY_NUMBER" + VEHICLE_IDENTIFICATION_NUMBER = "VEHICLE_IDENTIFICATION_NUMBER" + +@dataclass(kw_only=True) +class GuardrailRegexFilter(_SerdeShape): + """A Regex filter configured in a guardrail.""" + + name: str | None = ... + """The regex filter name.""" + match: str | None = ... + """The regesx filter match.""" + regex: str | None = ... + """The regex query.""" + action: str + """The region filter action.""" + detected: bool | None = ... + """ + Indicates whether custom regex entities that breach the guardrail + configuration are detected. + """ + +class GuardrailSensitiveInformationPolicyAction(UnknownEnumMixin, StrEnum): + ANONYMIZED = "ANONYMIZED" + BLOCKED = "BLOCKED" + NONE = "NONE" + +@dataclass(kw_only=True) +class GuardrailSensitiveInformationPolicyAssessment(_SerdeShape): + """The assessment for a Personally Identifiable Information (PII) policy.""" + + pii_entities: list[GuardrailPiiEntityFilter] + """The PII entities in the assessment.""" + regexes: list[GuardrailRegexFilter] + """The regex queries in the assessment.""" + +@dataclass(kw_only=True) +class GuardrailStreamConfiguration(_SerdeShape): + """ + Configuration information for a guardrail that you use with the + [ConverseStream](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html) + action. + """ + + guardrail_identifier: str = ... + """The identifier for the guardrail.""" + guardrail_version: str = ... + """The version of the guardrail.""" + trace: str = ... + """The trace behavior for the guardrail.""" + stream_processing_mode: str = ... + """ + The processing mode. + + The processing mode. For more information, see *Configure streaming + response behavior* in the *Amazon Bedrock User Guide*. + """ + +class GuardrailStreamProcessingMode(UnknownEnumMixin, StrEnum): + SYNC = "sync" + ASYNC_ = "async" + +@dataclass(kw_only=True) +class GuardrailTextBlock(_SerdeShape): + """The text block to be evaluated by the guardrail.""" + + text: str + """The input text details to be evaluated by the guardrail.""" + qualifiers: list[str] | None = ... + """The qualifiers describing the text block.""" + +@dataclass(kw_only=True) +class GuardrailTextCharactersCoverage(_SerdeShape): + """The guardrail coverage for the text characters.""" + + guarded: int | None = ... + """The text characters that were guarded by the guardrail coverage.""" + total: int | None = ... + """The total text characters by the guardrail coverage.""" + +@dataclass(kw_only=True) +class GuardrailTopic(_SerdeShape): + """Information about a topic guardrail.""" + + name: str + """The name for the guardrail.""" + type: str + """ + The type behavior that the guardrail should perform when the model + detects the topic. + """ + action: str + """The action the guardrail should take when it intervenes on a topic.""" + detected: bool | None = ... + """ + Indicates whether topic content that breaches the guardrail + configuration is detected. + """ + +class GuardrailTopicPolicyAction(UnknownEnumMixin, StrEnum): + BLOCKED = "BLOCKED" + NONE = "NONE" + +@dataclass(kw_only=True) +class GuardrailTopicPolicyAssessment(_SerdeShape): + """A behavior assessment of a topic policy.""" + + topics: list[GuardrailTopic] + """The topics in the assessment.""" + +class GuardrailTopicType(UnknownEnumMixin, StrEnum): + DENY = "DENY" + +class GuardrailTrace(UnknownEnumMixin, StrEnum): + ENABLED = "enabled" + DISABLED = "disabled" + ENABLED_FULL = "enabled_full" + +@dataclass(kw_only=True) +class GuardrailTraceAssessment(_SerdeShape): + """ + A Top level guardrail trace object. For more information, see + [ConverseTrace](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseTrace.html). + """ + + model_output: list[str] | None = ... + """The output from the model.""" + input_assessment: dict[str, GuardrailAssessment] | None = ... + """The input assessment.""" + output_assessments: dict[str, list[GuardrailAssessment]] | None = ... + """the output assessments.""" + action_reason: str | None = ... + """ + Provides the reason for the action taken when harmful content is + detected. + """ + +@dataclass(kw_only=True) +class GuardrailUsage(_SerdeShape): + """The details on the use of the guardrail.""" + + topic_policy_units: int + """The topic policy units processed by the guardrail.""" + content_policy_units: int + """The content policy units processed by the guardrail.""" + word_policy_units: int + """The word policy units processed by the guardrail.""" + sensitive_information_policy_units: int + """The sensitive information policy units processed by the guardrail.""" + sensitive_information_policy_free_units: int + """The sensitive information policy free units processed by the guardrail.""" + contextual_grounding_policy_units: int + """The contextual grounding policy units processed by the guardrail.""" + content_policy_image_units: int | None = ... + """The content policy image units processed by the guardrail.""" + automated_reasoning_policy_units: int | None = ... + """The number of text units processed by the automated reasoning policy.""" + automated_reasoning_policies: int | None = ... + """ + The number of automated reasoning policies that were processed during + the guardrail evaluation. + """ + +class GuardrailWordPolicyAction(UnknownEnumMixin, StrEnum): + BLOCKED = "BLOCKED" + NONE = "NONE" + +@dataclass(kw_only=True) +class GuardrailWordPolicyAssessment(_SerdeShape): + """The word policy assessment.""" + + custom_words: list[GuardrailCustomWord] + """Custom words in the assessment.""" + managed_word_lists: list[GuardrailManagedWord] + """Managed word lists in the assessment.""" + +@dataclass(kw_only=True) +class ImageBlock(_SerdeShape): + """Image content for a message.""" + + format: str + """The format of the image.""" + source: ImageSource + """The source for the image.""" + error: ErrorBlock | None = ... + """ + Error information if the image block could not be processed or contains + invalid data. + """ + +@dataclass(kw_only=True) +class ImageBlockDelta(_SerdeShape): + """ + A streaming delta event that contains incremental image data during + streaming responses. + """ + + source: ImageSource | None = ... + """The incremental image source data for this delta event.""" + error: ErrorBlock | None = ... + """Error information if this image delta could not be processed.""" + +@dataclass(kw_only=True) +class ImageBlockStart(_SerdeShape): + """ + The initial event in a streaming image block that indicates the start of + image content. + """ + + format: str + """ + The format of the image data that will be streamed in subsequent delta + events. + """ + +class ImageFormat(UnknownEnumMixin, StrEnum): + PNG = "png" + JPEG = "jpeg" + GIF = "gif" + WEBP = "webp" + +@dataclass +class ImageSourceBytes(_SerdeShape): + """ + The raw image bytes for the image. If you use an AWS SDK, you don't + need to encode the image bytes in base64. + """ + + value: bytes + +@dataclass +class ImageSourceS3Location(_SerdeShape): + """ + The location of an image object in an Amazon S3 bucket. To see which + models support S3 uploads, see [Supported models and features for + Converse](https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference-supported-models-features.html). + """ + + value: S3Location + +@dataclass +class ImageSourceUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ImageSource = Union[ImageSourceBytes | ImageSourceS3Location | ImageSourceUnknown] +"""The source for an image.""" + +class _ImageSourceDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> ImageSource: ... + +@dataclass(kw_only=True) +class InferenceConfiguration(_SerdeShape): + """ + Base inference parameters to pass to a model in a call to + [Converse](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html) + or + [ConverseStream](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html). + For more information, see [Inference parameters for foundation + models](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). + + If you need to pass additional parameters that the model supports, use + the `additionalModelRequestFields` request field in the call to + `Converse` or `ConverseStream`. For more information, see [Model + parameters](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). + """ + + max_tokens: int | None = ... + """ + The maximum number of tokens to allow in the generated response. The + default value is the maximum allowed value for the model that you are + using. For more information, see [Inference parameters for foundation + models](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). + """ + temperature: float | None = ... + """ + The likelihood of the model selecting higher-probability options while + generating a response. A lower value makes the model more likely to + choose higher-probability options, while a higher value makes the model + more likely to choose lower-probability options. + + The default value is the default value for the model that you are using. + For more information, see [Inference parameters for foundation + models](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). + """ + top_p: float | None = ... + """ + The percentage of most-likely candidates that the model considers for + the next token. For example, if you choose a value of 0.8 for `topP`, + the model selects from the top 80% of the probability distribution of + tokens that could be next in the sequence. + + The default value is the default value for the model that you are using. + For more information, see [Inference parameters for foundation + models](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). + """ + stop_sequences: list[str] | None = ... + """ + A list of stop sequences. A stop sequence is a sequence of characters + that causes the model to stop generating the response. + """ + +@dataclass(kw_only=True) +class InternalServerException(ServiceError, _SerdeShape): + """ + An internal server error occurred. For troubleshooting this error, see + [InternalFailure](https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-internal-failure) + in the Amazon Bedrock User Guide + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvokeGuardrailChecksInput(_SerdeShape): + """Dataclass for InvokeGuardrailChecksInput structure.""" + + messages: list[GuardrailChecksMessage] | None = ... + """ + The messages to evaluate against the specified guardrail checks. Each + message includes a role and one or more content blocks. + """ + checks: GuardrailChecksConfig | None = ... + """ + The inline check configurations that specify which guardrail checks to + run against the messages. + """ + +@dataclass(kw_only=True) +class InvokeGuardrailChecksOutput(_SerdeShape): + """Dataclass for InvokeGuardrailChecksOutput structure.""" + + results: GuardrailChecksResults + """The per-check results containing findings from the guardrail evaluation.""" + usage: GuardrailChecksUsageResults + """The per-check text unit consumption for the guardrail evaluation.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvokeModelInput(_SerdeShape): + """Dataclass for InvokeModelInput structure.""" + + body: bytes | None = ... + """ + The prompt and inference parameters in the format specified in the + `contentType` in the header. You must provide the body in JSON format. + To see the format and content of the request and response bodies for + different models, refer to [Inference + parameters](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). + For more information, see [Run + inference](https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html) + in the Bedrock User Guide. + """ + content_type: str | None = ... + """ + The MIME type of the input data in the request. You must specify + `application/json`. + """ + accept: str | None = ... + """ + The desired MIME type of the inference body in the response. The default + value is `application/json`. + """ + model_id: str | None = ... + """ + The unique identifier of the model to invoke to run inference. + + The `modelId` to provide depends on the type of model or throughput that + you use: + + - If you use a base model, specify the model ID or its ARN. For a list + of model IDs for base models, see [Amazon Bedrock base model IDs + (on-demand + throughput)](https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns) + in the Amazon Bedrock User Guide. + + - If you use an inference profile, specify the inference profile ID or + its ARN. For a list of inference profile IDs, see [Supported Regions + and models for cross-region + inference](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference-support.html) + in the Amazon Bedrock User Guide. + + - If you use a provisioned model, specify the ARN of the Provisioned + Throughput. For more information, see [Run inference using a + Provisioned + Throughput](https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html) + in the Amazon Bedrock User Guide. + + - If you use a custom model, specify the ARN of the custom model + deployment (for on-demand inference) or the ARN of your provisioned + model (for Provisioned Throughput). For more information, see [Use a + custom model in Amazon + Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html) + in the Amazon Bedrock User Guide. + + - If you use an [imported + model](https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-import-model.html), + specify the ARN of the imported model. You can get the model ARN from + a successful call to + [CreateModelImportJob](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_CreateModelImportJob.html) + or from the Imported models page in the Amazon Bedrock console. + """ + trace: str | None = ... + """ + Specifies whether to enable or disable the Bedrock trace. If enabled, + you can see the full Bedrock trace. + """ + guardrail_identifier: str | None = ... + """ + The unique identifier of the guardrail that you want to use. If you + don't provide a value, no guardrail is applied to the invocation. + + An error will be thrown in the following situations. + + - You don't provide a guardrail identifier but you specify the + `amazon-bedrock-guardrailConfig` field in the request body. + + - You enable the guardrail but the `contentType` isn't + `application/json`. + + - You provide a guardrail identifier, but `guardrailVersion` isn't + specified. + """ + guardrail_version: str | None = ... + """The version number for the guardrail. The value can also be `DRAFT`.""" + performance_config_latency: str = ... + """Model performance settings for the request.""" + service_tier: str | None = ... + """Specifies the processing tier type used for serving the request.""" + request_metadata: str | None = ... + """Key-value pairs that you can use to filter invocation logs.""" + +@dataclass(kw_only=True) +class InvokeModelOutput(_SerdeShape): + """Dataclass for InvokeModelOutput structure.""" + + body: bytes + """ + Inference response from the model in the format specified in the + `contentType` header. To see the format and content of the request and + response bodies for different models, refer to [Inference + parameters](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). + """ + content_type: str + """The MIME type of the inference result.""" + performance_config_latency: str | None = ... + """Model performance settings for the request.""" + service_tier: str | None = ... + """Specifies the processing tier type used for serving the request.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvokeModelTokensRequest(_SerdeShape): + """ + The body of an `InvokeModel` API request for token counting. This + structure mirrors the input format for the `InvokeModel` operation, + allowing you to count tokens for raw text inference requests. + """ + + body: bytes + """ + The request body to count tokens for, formatted according to the + model's expected input format. To learn about the input format for + different models, see [Model inference parameters and + responses](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). + """ + +@dataclass +class InvokeModelWithBidirectionalStreamInputChunk(_SerdeShape): + """The audio chunk that is used as input for the invocation step.""" + + value: BidirectionalInputPayloadPart + +@dataclass +class InvokeModelWithBidirectionalStreamInputUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +InvokeModelWithBidirectionalStreamInput = Union[ + InvokeModelWithBidirectionalStreamInputChunk + | InvokeModelWithBidirectionalStreamInputUnknown +] +""" +Payload content, the speech chunk, for the bidirectional input of the +invocation step. +""" + +class _InvokeModelWithBidirectionalStreamInputDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> InvokeModelWithBidirectionalStreamInput: ... + +@dataclass(kw_only=True) +class InvokeModelWithBidirectionalStreamOperationInput(_SerdeShape): + """ + Dataclass for InvokeModelWithBidirectionalStreamOperationInput + structure. + """ + + model_id: str | None = ... + """ + The model ID or ARN of the model ID to use. Currently, only + `amazon.nova-sonic-v1:0` is supported. + """ + +@dataclass(kw_only=True) +class InvokeModelWithBidirectionalStreamOperationOutput(_SerdeShape): + """ + Dataclass for InvokeModelWithBidirectionalStreamOperationOutput + structure. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass +class InvokeModelWithBidirectionalStreamOutputChunk(_SerdeShape): + """The speech chunk that was provided as output from the invocation step.""" + + value: BidirectionalOutputPayloadPart + +@dataclass +class InvokeModelWithBidirectionalStreamOutputInternalServerException(_SerdeShape): + """The request encountered an unknown internal error.""" + + value: InternalServerException + +@dataclass +class InvokeModelWithBidirectionalStreamOutputModelStreamErrorException(_SerdeShape): + """The request encountered an error with the model stream.""" + + value: ModelStreamErrorException + +@dataclass +class InvokeModelWithBidirectionalStreamOutputValidationException(_SerdeShape): + """ + The input fails to satisfy the constraints specified by an Amazon Web + Services service. + """ + + value: ValidationException + +@dataclass +class InvokeModelWithBidirectionalStreamOutputThrottlingException(_SerdeShape): + """The request was denied due to request throttling.""" + + value: ThrottlingException + +@dataclass +class InvokeModelWithBidirectionalStreamOutputModelTimeoutException(_SerdeShape): + """ + The connection was closed because a request was not received within the + timeout period. + """ + + value: ModelTimeoutException + +@dataclass +class InvokeModelWithBidirectionalStreamOutputServiceUnavailableException(_SerdeShape): + """The request has failed due to a temporary failure of the server.""" + + value: ServiceUnavailableException + +@dataclass +class InvokeModelWithBidirectionalStreamOutputUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +InvokeModelWithBidirectionalStreamOutput = Union[ + InvokeModelWithBidirectionalStreamOutputChunk + | InvokeModelWithBidirectionalStreamOutputInternalServerException + | InvokeModelWithBidirectionalStreamOutputModelStreamErrorException + | InvokeModelWithBidirectionalStreamOutputValidationException + | InvokeModelWithBidirectionalStreamOutputThrottlingException + | InvokeModelWithBidirectionalStreamOutputModelTimeoutException + | InvokeModelWithBidirectionalStreamOutputServiceUnavailableException + | InvokeModelWithBidirectionalStreamOutputUnknown +] +"""Output from the bidirectional stream that was used for model invocation.""" + +class _InvokeModelWithBidirectionalStreamOutputDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> InvokeModelWithBidirectionalStreamOutput: ... + +@dataclass(kw_only=True) +class InvokeModelWithResponseStreamInput(_SerdeShape): + """Dataclass for InvokeModelWithResponseStreamInput structure.""" + + body: bytes | None = ... + """ + The prompt and inference parameters in the format specified in the + `contentType` in the header. You must provide the body in JSON format. + To see the format and content of the request and response bodies for + different models, refer to [Inference + parameters](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). + For more information, see [Run + inference](https://docs.aws.amazon.com/bedrock/latest/userguide/api-methods-run.html) + in the Bedrock User Guide. + """ + content_type: str | None = ... + """ + The MIME type of the input data in the request. You must specify + `application/json`. + """ + accept: str | None = ... + """ + The desired MIME type of the inference body in the response. The default + value is `application/json`. + """ + model_id: str | None = ... + """ + The unique identifier of the model to invoke to run inference. + + The `modelId` to provide depends on the type of model or throughput that + you use: + + - If you use a base model, specify the model ID or its ARN. For a list + of model IDs for base models, see [Amazon Bedrock base model IDs + (on-demand + throughput)](https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns) + in the Amazon Bedrock User Guide. + + - If you use an inference profile, specify the inference profile ID or + its ARN. For a list of inference profile IDs, see [Supported Regions + and models for cross-region + inference](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference-support.html) + in the Amazon Bedrock User Guide. + + - If you use a provisioned model, specify the ARN of the Provisioned + Throughput. For more information, see [Run inference using a + Provisioned + Throughput](https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html) + in the Amazon Bedrock User Guide. + + - If you use a custom model, specify the ARN of the custom model + deployment (for on-demand inference) or the ARN of your provisioned + model (for Provisioned Throughput). For more information, see [Use a + custom model in Amazon + Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html) + in the Amazon Bedrock User Guide. + + - If you use an [imported + model](https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-import-model.html), + specify the ARN of the imported model. You can get the model ARN from + a successful call to + [CreateModelImportJob](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_CreateModelImportJob.html) + or from the Imported models page in the Amazon Bedrock console. + """ + trace: str | None = ... + """ + Specifies whether to enable or disable the Bedrock trace. If enabled, + you can see the full Bedrock trace. + """ + guardrail_identifier: str | None = ... + """ + The unique identifier of the guardrail that you want to use. If you + don't provide a value, no guardrail is applied to the invocation. + + An error is thrown in the following situations. + + - You don't provide a guardrail identifier but you specify the + `amazon-bedrock-guardrailConfig` field in the request body. + + - You enable the guardrail but the `contentType` isn't + `application/json`. + + - You provide a guardrail identifier, but `guardrailVersion` isn't + specified. + """ + guardrail_version: str | None = ... + """The version number for the guardrail. The value can also be `DRAFT`.""" + performance_config_latency: str = ... + """Model performance settings for the request.""" + service_tier: str | None = ... + """Specifies the processing tier type used for serving the request.""" + request_metadata: str | None = ... + """Key-value pairs that you can use to filter invocation logs.""" + +@dataclass(kw_only=True) +class InvokeModelWithResponseStreamOutput(_SerdeShape): + """Dataclass for InvokeModelWithResponseStreamOutput structure.""" + + content_type: str + """The MIME type of the inference result.""" + performance_config_latency: str | None = ... + """Model performance settings for the request.""" + service_tier: str | None = ... + """Specifies the processing tier type used for serving the request.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class JsonSchemaDefinition(_SerdeShape): + """JSON schema structured output format options.""" + + schema: str + """ + The JSON schema to constrain the model's output. For more information, + see [JSON Schema + Reference](https://json-schema.org/understanding-json-schema/reference). + """ + name: str | None = ... + """The name of the JSON schema.""" + description: str | None = ... + """A description of the JSON schema.""" + +@dataclass(kw_only=True) +class ListAsyncInvokesInput(_SerdeShape): + """Dataclass for ListAsyncInvokesInput structure.""" + + submit_time_after: datetime | None = ... + """Include invocations submitted after this time.""" + submit_time_before: datetime | None = ... + """Include invocations submitted before this time.""" + status_equals: str | None = ... + """Filter invocations by status.""" + max_results: int | None = ... + """The maximum number of invocations to return in one page of results.""" + next_token: str | None = ... + """ + Specify the pagination token from a previous request to retrieve the + next page of results. + """ + sort_by: str = ... + """How to sort the response.""" + sort_order: str = ... + """The sorting order for the response.""" + +@dataclass(kw_only=True) +class ListAsyncInvokesOutput(_SerdeShape): + """Dataclass for ListAsyncInvokesOutput structure.""" + + next_token: str | None = ... + """ + Specify the pagination token from a previous request to retrieve the + next page of results. + """ + async_invoke_summaries: list[AsyncInvokeSummary] | None = ... + """A list of invocation summaries.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class Message(_SerdeShape): + """ + A message input, or returned from, a call to + [Converse](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html) + or + [ConverseStream](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html). + """ + + role: str + """The role that the message plays in the message.""" + content: list[ContentBlock] + """ + The message content. Note the following restrictions: + + - You can include up to 20 images. Each image's size, height, and width + must be no more than 3.75 MB, 8000 px, and 8000 px, respectively. + + - You can include up to five documents. Each document's size must be no + more than 4.5 MB. + + - If you include a `ContentBlock` with a `document` field in the array, + you must also include a `ContentBlock` with a `text` field. + + - You can only include images and documents if the `role` is `user`. + """ + +@dataclass(kw_only=True) +class MessageStartEvent(_SerdeShape): + """The start of a message.""" + + role: str + """The role for the message.""" + +@dataclass(kw_only=True) +class MessageStopEvent(_SerdeShape): + """The stop event for a message.""" + + stop_reason: str + """The reason why the model stopped generating output.""" + additional_model_response_fields: Document | None = ... + """The additional model response fields.""" + +@dataclass(kw_only=True) +class ModelErrorException(ServiceError, _SerdeShape): + """The request failed due to an error while processing the model.""" + + original_status_code: int | None = ... + """The original status code.""" + resource_name: str | None = ... + """The resource name.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ModelNotReadyException(ServiceError, _SerdeShape): + """ + The model specified in the request is not ready to serve inference + requests. The AWS SDK will automatically retry the operation up to 5 + times. For information about configuring automatic retries, see [Retry + behavior](https://docs.aws.amazon.com/sdkref/latest/guide/feature-retry-behavior.html) + in the *AWS SDKs and Tools* reference guide. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ModelStreamErrorException(ServiceError, _SerdeShape): + """An error occurred while streaming the response. Retry your request.""" + + original_status_code: int | None = ... + """The original status code.""" + original_message: str | None = ... + """The original message.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ModelTimeoutException(ServiceError, _SerdeShape): + """ + The request took too long to process. Processing time exceeded the model + timeout length. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class OutputConfig(_SerdeShape): + """ + Output configuration for a model response in a call to + [Converse](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html) + or + [ConverseStream](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html). + """ + + text_format: OutputFormat | None = ... + """Structured output parameters to control the model's text response.""" + effort: str | None = ... + """ + The effort level for the model to use when generating a response. Higher + effort levels allow the model to spend more time reasoning before + responding. Supported values are `low`, `medium`, `high`, `xhigh`, and + `max`. + + Note: + When extended thinking is disabled, the effort level is capped at + `high`. Use effort `high` or below, or enable thinking to use higher + effort levels. + """ + +@dataclass(kw_only=True) +class OutputFormat(_SerdeShape): + """Structured output parameters to control the model's response.""" + + type: str + """The type of structured output format.""" + structure: OutputFormatStructure + """The structure that the model's output must adhere to.""" + +@dataclass +class OutputFormatStructureJsonSchema(_SerdeShape): + """A JSON schema structure that the model's output must adhere to.""" + + value: JsonSchemaDefinition + +@dataclass +class OutputFormatStructureUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +OutputFormatStructure = Union[ + OutputFormatStructureJsonSchema | OutputFormatStructureUnknown +] +"""The structure that the model's output must adhere to.""" + +class _OutputFormatStructureDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> OutputFormatStructure: ... + +class OutputFormatType(UnknownEnumMixin, StrEnum): + """ + The type of structured output format. Available options are: + json_schema. + """ + + JSON_SCHEMA = "json_schema" + +@dataclass(kw_only=True) +class PayloadPart(_SerdeShape): + """Payload content included in the response.""" + + bytes_: bytes | None = ... + """Base64-encoded bytes of payload data.""" + +class PerformanceConfigLatency(UnknownEnumMixin, StrEnum): + STANDARD = "standard" + OPTIMIZED = "optimized" + +@dataclass(kw_only=True) +class PerformanceConfiguration(_SerdeShape): + """Performance settings for a model.""" + + latency: str = ... + """To use a latency-optimized version of the model, set to `optimized`.""" + +@dataclass(kw_only=True) +class PromptRouterTrace(_SerdeShape): + """A prompt router trace.""" + + invoked_model_id: str | None = ... + """The ID of the invoked model.""" + +@dataclass +class PromptVariableValuesText(_SerdeShape): + """The text value that the variable maps to.""" + + value: str + +@dataclass +class PromptVariableValuesUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +PromptVariableValues = Union[PromptVariableValuesText | PromptVariableValuesUnknown] +""" +Contains a map of variables in a prompt from Prompt management to an +object containing the values to fill in for them when running model +invocation. For more information, see [How Prompt management +works](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-how.html). +""" + +class _PromptVariableValuesDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> PromptVariableValues: ... + +@dataclass +class ReasoningContentBlockReasoningText(_SerdeShape): + """The reasoning that the model used to return the output.""" + + value: ReasoningTextBlock + +@dataclass +class ReasoningContentBlockRedactedContent(_SerdeShape): + """ + The content in the reasoning that was encrypted by the model provider + for safety reasons. The encryption doesn't affect the quality of + responses. + """ + + value: bytes + +@dataclass +class ReasoningContentBlockUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ReasoningContentBlock = Union[ + ReasoningContentBlockReasoningText + | ReasoningContentBlockRedactedContent + | ReasoningContentBlockUnknown +] +""" +Contains content regarding the reasoning that is carried out by the +model with respect to the content in the content block. Reasoning refers +to a Chain of Thought (CoT) that the model generates to enhance the +accuracy of its final response. +""" + +class _ReasoningContentBlockDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> ReasoningContentBlock: ... + +@dataclass +class ReasoningContentBlockDeltaText(_SerdeShape): + """The reasoning that the model used to return the output.""" + + value: str + +@dataclass +class ReasoningContentBlockDeltaRedactedContent(_SerdeShape): + """ + The content in the reasoning that was encrypted by the model provider + for safety reasons. The encryption doesn't affect the quality of + responses. + """ + + value: bytes + +@dataclass +class ReasoningContentBlockDeltaSignature(_SerdeShape): + """ + A token that verifies that the reasoning text was generated by the + model. If you pass a reasoning block back to the API in a multi-turn + conversation, include the text and its signature unmodified. + """ + + value: str + +@dataclass +class ReasoningContentBlockDeltaUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ReasoningContentBlockDelta = Union[ + ReasoningContentBlockDeltaText + | ReasoningContentBlockDeltaRedactedContent + | ReasoningContentBlockDeltaSignature + | ReasoningContentBlockDeltaUnknown +] +""" +Contains content regarding the reasoning that is carried out by the +model with respect to the content in the content block. Reasoning refers +to a Chain of Thought (CoT) that the model generates to enhance the +accuracy of its final response. +""" + +class _ReasoningContentBlockDeltaDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> ReasoningContentBlockDelta: ... + +@dataclass(kw_only=True) +class ReasoningTextBlock(_SerdeShape): + """Contains the reasoning that the model used to return the output.""" + + text: str + """The reasoning that the model used to return the output.""" + signature: str | None = ... + """ + A token that verifies that the reasoning text was generated by the + model. If you pass a reasoning block back to the API in a multi-turn + conversation, include the text and its signature unmodified. + """ + +@dataclass(kw_only=True) +class ResourceNotFoundException(ServiceError, _SerdeShape): + """ + The specified resource ARN was not found. For troubleshooting this + error, see + [ResourceNotFound](https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-resource-not-found) + in the Amazon Bedrock User Guide + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass +class ResponseStreamChunk(_SerdeShape): + """Content included in the response.""" + + value: PayloadPart + +@dataclass +class ResponseStreamInternalServerException(_SerdeShape): + """An internal server error occurred. Retry your request.""" + + value: InternalServerException + +@dataclass +class ResponseStreamModelStreamErrorException(_SerdeShape): + """An error occurred while streaming the response. Retry your request.""" + + value: ModelStreamErrorException + +@dataclass +class ResponseStreamValidationException(_SerdeShape): + """ + Input validation failed. Check your request parameters and retry the + request. + """ + + value: ValidationException + +@dataclass +class ResponseStreamThrottlingException(_SerdeShape): + """ + Your request was throttled because of service-wide limitations. Resubmit + your request later or in a different region. You can also purchase + [Provisioned + Throughput](https://docs.aws.amazon.com/bedrock/latest/userguide/prov-throughput.html) + to increase the rate or number of tokens you can process. + """ + + value: ThrottlingException + +@dataclass +class ResponseStreamModelTimeoutException(_SerdeShape): + """ + The request took too long to process. Processing time exceeded the model + timeout length. + """ + + value: ModelTimeoutException + +@dataclass +class ResponseStreamServiceUnavailableException(_SerdeShape): + """The service isn't available. Try again later.""" + + value: ServiceUnavailableException + +@dataclass +class ResponseStreamUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ResponseStream = Union[ + ResponseStreamChunk + | ResponseStreamInternalServerException + | ResponseStreamModelStreamErrorException + | ResponseStreamValidationException + | ResponseStreamThrottlingException + | ResponseStreamModelTimeoutException + | ResponseStreamServiceUnavailableException + | ResponseStreamUnknown +] +"""Definition of content in the response stream.""" + +class _ResponseStreamDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> ResponseStream: ... + +@dataclass(kw_only=True) +class S3Location(_SerdeShape): + """A storage location in an Amazon S3 bucket.""" + + uri: str + """An object URI starting with `s3://`.""" + bucket_owner: str | None = ... + """ + If the bucket belongs to another AWS account, specify that account's + ID. + """ + +@dataclass(kw_only=True) +class SearchResultBlock(_SerdeShape): + """ + A search result block that enables natural citations with proper source + attribution for retrieved content. + + Note: + This field is only supported by Anthropic Claude Opus 4.1, Opus 4, + Sonnet 4.5, Sonnet 4, Sonnet 3.7, and 3.5 Haiku models. + """ + + source: str + """The source URL or identifier for the content.""" + title: str + """A descriptive title for the search result.""" + content: list[SearchResultContentBlock] + """An array of search result content block.""" + citations: CitationsConfig | None = ... + """Configuration setting for citations""" + +@dataclass(kw_only=True) +class SearchResultContentBlock(_SerdeShape): + """A block within a search result that contains the content.""" + + text: str + """The actual text content""" + +@dataclass(kw_only=True) +class SearchResultLocation(_SerdeShape): + """ + Specifies a search result location within the content array, providing + positioning information for cited content using search result index and + block positions. + """ + + search_result_index: int | None = ... + """ + The index of the search result content block where the cited content is + found. + """ + start: int | None = ... + """ + The starting position in the content array where the cited content + begins. + """ + end: int | None = ... + """The ending position in the content array where the cited content ends.""" + +@dataclass(kw_only=True) +class ServiceQuotaExceededException(ServiceError, _SerdeShape): + """ + Your request exceeds the service quota for your account. You can view + your quotas at [Viewing service + quotas](https://docs.aws.amazon.com/servicequotas/latest/userguide/gs-request-quota.html). + You can resubmit your request later. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ServiceTier(_SerdeShape): + """ + Specifies the processing tier configuration used for serving the + request. + """ + + type: str + """Specifies the processing tier type used for serving the request.""" + +class ServiceTierType(UnknownEnumMixin, StrEnum): + PRIORITY = "priority" + DEFAULT = "default" + FLEX = "flex" + RESERVED = "reserved" + +@dataclass(kw_only=True) +class ServiceUnavailableException(ServiceError, _SerdeShape): + """ + The service isn't currently available. For troubleshooting this error, + see + [ServiceUnavailable](https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-service-unavailable) + in the Amazon Bedrock User Guide + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class SortAsyncInvocationBy(UnknownEnumMixin, StrEnum): + SUBMISSION_TIME = "SubmissionTime" + +class SortOrder(UnknownEnumMixin, StrEnum): + ASCENDING = "Ascending" + DESCENDING = "Descending" + +@dataclass(kw_only=True) +class SpecificToolChoice(_SerdeShape): + """ + The model must request a specific tool. For example, + `{"tool" : {"name" : "Your tool name"}}`. For more information, see + [Call a tool with the Converse + API](https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html) + in the Amazon Bedrock User Guide + + Note: + This field is only supported by Anthropic Claude 3 models. + """ + + name: str + """The name of the tool that the model must request.""" + +@dataclass(kw_only=True) +class StartAsyncInvokeInput(_SerdeShape): + """Dataclass for StartAsyncInvokeInput structure.""" + + client_request_token: str | None = ... + """Specify idempotency token to ensure that requests are not duplicated.""" + model_id: str | None = ... + """The model to invoke.""" + model_input: Document | None = ... + """Input to send to the model.""" + output_data_config: AsyncInvokeOutputDataConfig | None = ... + """Where to store the output.""" + tags: list[Tag] | None = ... + """Tags to apply to the invocation.""" + +@dataclass(kw_only=True) +class StartAsyncInvokeOutput(_SerdeShape): + """Dataclass for StartAsyncInvokeOutput structure.""" + + invocation_arn: str + """The ARN of the invocation.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class StopReason(UnknownEnumMixin, StrEnum): + END_TURN = "end_turn" + TOOL_USE = "tool_use" + MAX_TOKENS = "max_tokens" + STOP_SEQUENCE = "stop_sequence" + GUARDRAIL_INTERVENED = "guardrail_intervened" + CONTENT_FILTERED = "content_filtered" + MALFORMED_MODEL_OUTPUT = "malformed_model_output" + MALFORMED_TOOL_USE = "malformed_tool_use" + MODEL_CONTEXT_WINDOW_EXCEEDED = "model_context_window_exceeded" + +@dataclass +class SystemContentBlockText(_SerdeShape): + """A system prompt for the model.""" + + value: str + +@dataclass +class SystemContentBlockGuardContent(_SerdeShape): + """ + A content block to assess with the guardrail. Use with the + [Converse](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html) + or + [ConverseStream](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html) + API operations. + + For more information, see *Use a guardrail with the Converse API* in the + *Amazon Bedrock User Guide*. + """ + + value: GuardrailConverseContentBlock + +@dataclass +class SystemContentBlockCachePoint(_SerdeShape): + """CachePoint to include in the system prompt.""" + + value: CachePointBlock + +@dataclass +class SystemContentBlockUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +SystemContentBlock = Union[ + SystemContentBlockText + | SystemContentBlockGuardContent + | SystemContentBlockCachePoint + | SystemContentBlockUnknown +] +""" +Contains configurations for instructions to provide the model for how to +handle input. To learn more, see [Using the Converse +API](https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference-call.html). +""" + +class _SystemContentBlockDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> SystemContentBlock: ... + +@dataclass(kw_only=True) +class SystemTool(_SerdeShape): + """ + Specifies a system-defined tool for the model to use. *System-defined + tools* are tools that are created and provided by the model provider. + """ + + name: str + """The name of the system-defined tool that you want to call.""" + +@dataclass(kw_only=True) +class Tag(_SerdeShape): + """A tag.""" + + key: str + """The tag's key.""" + value: str + """The tag's value.""" + +@dataclass(kw_only=True) +class ThrottlingException(ServiceError, _SerdeShape): + """ + Your request was denied due to exceeding the account quotas for *Amazon + Bedrock*. For troubleshooting this error, see + [ThrottlingException](https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-throttling-exception) + in the Amazon Bedrock User Guide + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class TokenUsage(_SerdeShape): + """The tokens used in a message API inference call.""" + + input_tokens: int + """The number of tokens sent in the request to the model.""" + output_tokens: int + """The number of tokens that the model generated for the request.""" + total_tokens: int + """The total of input tokens and tokens generated by the model.""" + cache_read_input_tokens: int | None = ... + """The number of input tokens read from the cache for the request.""" + cache_write_input_tokens: int | None = ... + """The number of input tokens written to the cache for the request.""" + cache_details: list[CacheDetail] | None = ... + """ + Detailed breakdown of cache writes by TTL. Empty if no cache creation + occurred. Sorted by TTL duration (1h before 5m). + """ + +@dataclass +class ToolToolSpec(_SerdeShape): + """The specfication for the tool.""" + + value: ToolSpecification + +@dataclass +class ToolSystemTool(_SerdeShape): + """Specifies the system-defined tool that you want use.""" + + value: SystemTool + +@dataclass +class ToolCachePoint(_SerdeShape): + """CachePoint to include in the tool configuration.""" + + value: CachePointBlock + +@dataclass +class ToolUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +Tool = Union[ToolToolSpec | ToolSystemTool | ToolCachePoint | ToolUnknown] +""" +Information about a tool that you can use with the Converse API. For +more information, see [Call a tool with the Converse +API](https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html) +in the Amazon Bedrock User Guide. +""" + +class _ToolDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> Tool: ... + +@dataclass(kw_only=True) +class ToolAdditionBlock(_SerdeShape): + """ + A content block for adding a tool to the available tool set + mid-conversation. Each block references a single tool via its `tool` + field. Use within a `system` role message to make a tool available + without re-sending the full tool configuration. + """ + + tool: ToolReference + """A reference to the tool to add to the available tool set.""" + +@dataclass +class ToolChoiceAuto(_SerdeShape): + """ + (Default). The Model automatically decides if a tool should be called or + whether to generate text instead. + """ + + value: AutoToolChoice + +@dataclass +class ToolChoiceAny(_SerdeShape): + """The model must request at least one tool (no text is generated).""" + + value: AnyToolChoice + +@dataclass +class ToolChoiceTool(_SerdeShape): + """ + The Model must request the specified tool. Only supported by Anthropic + Claude 3 and Amazon Nova models. + """ + + value: SpecificToolChoice + +@dataclass +class ToolChoiceUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ToolChoice = Union[ToolChoiceAuto | ToolChoiceAny | ToolChoiceTool | ToolChoiceUnknown] +""" +Determines which tools the model should request in a call to `Converse` +or `ConverseStream`. For more information, see [Call a tool with the +Converse +API](https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html) +in the Amazon Bedrock User Guide. +""" + +class _ToolChoiceDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> ToolChoice: ... + +@dataclass(kw_only=True) +class ToolConfiguration(_SerdeShape): + """ + Configuration information for the tools that you pass to a model. For + more information, see [Tool use (function + calling)](https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html) + in the Amazon Bedrock User Guide. + """ + + tools: list[Tool] + """An array of tools that you want to pass to a model.""" + tool_choice: ToolChoice | None = ... + """If supported by model, forces the model to request a tool.""" + +@dataclass +class ToolInputSchemaJson(_SerdeShape): + """ + The JSON schema for the tool. For more information, see [JSON Schema + Reference](https://json-schema.org/understanding-json-schema/reference). + """ + + value: Document + +@dataclass +class ToolInputSchemaUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ToolInputSchema = Union[ToolInputSchemaJson | ToolInputSchemaUnknown] +""" +The schema for the tool. The top level schema type must be `object`. For +more information, see [Call a tool with the Converse +API](https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html) +in the Amazon Bedrock User Guide. +""" + +class _ToolInputSchemaDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> ToolInputSchema: ... + +@dataclass(kw_only=True) +class ToolReference(_SerdeShape): + """ + A reference to a tool in the tool configuration. Used with + `ToolAdditionBlock` and `ToolRemovalBlock` to identify which tool to add + or remove mid-conversation. + """ + + type: str | None = ... + """The type of tool reference.""" + name: str | None = ... + """ + The name of the tool. Must match the name of a tool declared in the + top-level tool configuration. + """ + server_name: str | None = ... + """ + The name of the MCP server that provides the tool. Required when + referencing an MCP tool. + """ + +@dataclass(kw_only=True) +class ToolRemovalBlock(_SerdeShape): + """ + A content block for removing a tool from the available tool set + mid-conversation. Each block references a single tool via its `tool` + field. Use within a `system` role message to remove a tool without + re-sending the full tool configuration. + """ + + tool: ToolReference + """A reference to the tool to remove from the available tool set.""" + +@dataclass(kw_only=True) +class ToolResultBlock(_SerdeShape): + """ + A tool result block that contains the results for a tool request that + the model previously made. For more information, see [Call a tool with + the Converse + API](https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html) + in the Amazon Bedrock User Guide. + """ + + tool_use_id: str + """The ID of the tool request that this is the result for.""" + content: list[ToolResultContentBlock] + """The content for tool result content block.""" + status: str | None = ... + """ + The status for the tool result content block. + + Note: + This field is only supported by Amazon Nova and Anthropic Claude 3 and 4 + models. + """ + type: str | None = ... + """The type for the tool result content block.""" + +@dataclass +class ToolResultBlockDeltaText(_SerdeShape): + """The reasoning the model used to return the output.""" + + value: str + +@dataclass +class ToolResultBlockDeltaJson(_SerdeShape): + """ + The JSON schema for the tool result content block. see [JSON Schema + Reference](https://json-schema.org/understanding-json-schema/reference). + """ + + value: Document + +@dataclass +class ToolResultBlockDeltaUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ToolResultBlockDelta = Union[ + ToolResultBlockDeltaText | ToolResultBlockDeltaJson | ToolResultBlockDeltaUnknown +] +""" +Contains incremental updates to tool results information during +streaming responses. This allows clients to build up tool results data +progressively as the response is generated. +""" + +class _ToolResultBlockDeltaDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> ToolResultBlockDelta: ... + +@dataclass(kw_only=True) +class ToolResultBlockStart(_SerdeShape): + """ + The start of a tool result block. For more information, see [Call a tool + with the Converse + API](https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html) + in the Amazon Bedrock User Guide. + """ + + tool_use_id: str + """The ID of the tool that was used to generate this tool result block.""" + type: str | None = ... + """The type for the tool that was used to generate this tool result block.""" + status: str | None = ... + """The status of the tool result block.""" + +@dataclass +class ToolResultContentBlockJson(_SerdeShape): + """A tool result that is JSON format data.""" + + value: Document + +@dataclass +class ToolResultContentBlockText(_SerdeShape): + """A tool result that is text.""" + + value: str + +@dataclass +class ToolResultContentBlockImage(_SerdeShape): + """ + A tool result that is an image. + + Note: + This field is only supported by Amazon Nova and Anthropic Claude 3 and 4 + models. + """ + + value: ImageBlock + +@dataclass +class ToolResultContentBlockDocument(_SerdeShape): + """A tool result that is a document.""" + + value: DocumentBlock + +@dataclass +class ToolResultContentBlockVideo(_SerdeShape): + """A tool result that is video.""" + + value: VideoBlock + +@dataclass +class ToolResultContentBlockSearchResult(_SerdeShape): + """A tool result that is a search result.""" + + value: SearchResultBlock + +@dataclass +class ToolResultContentBlockUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ToolResultContentBlock = Union[ + ToolResultContentBlockJson + | ToolResultContentBlockText + | ToolResultContentBlockImage + | ToolResultContentBlockDocument + | ToolResultContentBlockVideo + | ToolResultContentBlockSearchResult + | ToolResultContentBlockUnknown +] +""" +The tool result content block. For more information, see [Call a tool +with the Converse +API](https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html) +in the Amazon Bedrock User Guide. +""" + +class _ToolResultContentBlockDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> ToolResultContentBlock: ... + +class ToolResultStatus(UnknownEnumMixin, StrEnum): + SUCCESS = "success" + ERROR = "error" + +@dataclass(kw_only=True) +class ToolSpecification(_SerdeShape): + """ + The specification for the tool. For more information, see [Call a tool + with the Converse + API](https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html) + in the Amazon Bedrock User Guide. + """ + + name: str + """The name for the tool.""" + description: str | None = ... + """The description for the tool.""" + input_schema: ToolInputSchema + """The input schema for the tool in JSON format.""" + strict: bool | None = ... + """Flag to enable structured output enforcement on a tool usage response.""" + +@dataclass(kw_only=True) +class ToolUseBlock(_SerdeShape): + """ + A tool use content block. Contains information about a tool that the + model is requesting be run., The model uses the result from the tool to + generate a response. For more information, see [Call a tool with the + Converse + API](https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html) + in the Amazon Bedrock User Guide. + """ + + tool_use_id: str + """The ID for the tool request.""" + name: str + """The name of the tool that the model wants to use.""" + input: Document + """The input to pass to the tool.""" + type: str | None = ... + """The type for the tool request.""" + +@dataclass(kw_only=True) +class ToolUseBlockDelta(_SerdeShape): + """The delta for a tool use block.""" + + input: str + """The input for a requested tool.""" + +@dataclass(kw_only=True) +class ToolUseBlockStart(_SerdeShape): + """ + The start of a tool use block. For more information, see [Call a tool + with the Converse + API](https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html) + in the Amazon Bedrock User Guide. + """ + + tool_use_id: str + """The ID for the tool request.""" + name: str + """The name of the tool that the model is requesting to use.""" + type: str | None = ... + """The type for the tool request.""" + +class ToolUseType(UnknownEnumMixin, StrEnum): + SERVER_TOOL_USE = "server_tool_use" + +class Trace(UnknownEnumMixin, StrEnum): + ENABLED = "ENABLED" + DISABLED = "DISABLED" + ENABLED_FULL = "ENABLED_FULL" + +@dataclass(kw_only=True) +class ValidationException(ServiceError, _SerdeShape): + """ + The input fails to satisfy the constraints specified by *Amazon + Bedrock*. For troubleshooting this error, see + [ValidationError](https://docs.aws.amazon.com/bedrock/latest/userguide/troubleshooting-api-error-codes.html#ts-validation-error) + in the Amazon Bedrock User Guide + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class VideoBlock(_SerdeShape): + """A video block.""" + + format: str + """The block's format.""" + source: VideoSource + """The block's source.""" + +class VideoFormat(UnknownEnumMixin, StrEnum): + MKV = "mkv" + MOV = "mov" + MP4 = "mp4" + WEBM = "webm" + FLV = "flv" + MPEG = "mpeg" + MPG = "mpg" + WMV = "wmv" + THREE_GP = "three_gp" + +@dataclass +class VideoSourceBytes(_SerdeShape): + """Video content encoded in base64.""" + + value: bytes + +@dataclass +class VideoSourceS3Location(_SerdeShape): + """ + The location of a video object in an Amazon S3 bucket. To see which + models support S3 uploads, see [Supported models and features for + Converse](https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference-supported-models-features.html). + """ + + value: S3Location + +@dataclass +class VideoSourceUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +VideoSource = Union[VideoSourceBytes | VideoSourceS3Location | VideoSourceUnknown] +""" +A video source. You can upload a smaller video as a base64-encoded +string as long as the encoded file is less than 25MB. You can also +transfer videos up to 1GB in size from an S3 bucket. +""" + +class _VideoSourceDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> VideoSource: ... + +@dataclass(kw_only=True) +class WebLocation(_SerdeShape): + """ + Provides the URL and domain information for the website that was cited + when performing a web search. + """ + + url: str | None = ... + """The URL that was cited when performing a web search.""" + domain: str | None = ... + """The domain that was cited when performing a web search.""" + +APPLY_GUARDRAIL: APIOperation[ApplyGuardrailInput, ApplyGuardrailOutput] +CONVERSE: APIOperation[ConverseInput, ConverseOperationOutput] +CONVERSE_STREAM: APIOperation[ConverseStreamInput, ConverseStreamOperationOutput] +COUNT_TOKENS: APIOperation[CountTokensOperationInput, CountTokensOutput] +GET_ASYNC_INVOKE: APIOperation[GetAsyncInvokeInput, GetAsyncInvokeOutput] +INVOKE_GUARDRAIL_CHECKS: APIOperation[ + InvokeGuardrailChecksInput, InvokeGuardrailChecksOutput +] +INVOKE_MODEL: APIOperation[InvokeModelInput, InvokeModelOutput] +INVOKE_MODEL_WITH_BIDIRECTIONAL_STREAM: APIOperation[ + InvokeModelWithBidirectionalStreamOperationInput, + InvokeModelWithBidirectionalStreamOperationOutput, +] +INVOKE_MODEL_WITH_RESPONSE_STREAM: APIOperation[ + InvokeModelWithResponseStreamInput, InvokeModelWithResponseStreamOutput +] +LIST_ASYNC_INVOKES: APIOperation[ListAsyncInvokesInput, ListAsyncInvokesOutput] +START_ASYNC_INVOKE: APIOperation[StartAsyncInvokeInput, StartAsyncInvokeOutput] diff --git a/clients/aws-sdk-bedrock-runtime/tests/integration/__init__.py b/clients/aws-sdk-bedrock-runtime/tests/integration/__init__.py index b4b2a9ab..0c4c6967 100644 --- a/clients/aws-sdk-bedrock-runtime/tests/integration/__init__.py +++ b/clients/aws-sdk-bedrock-runtime/tests/integration/__init__.py @@ -4,9 +4,9 @@ from pathlib import Path -from smithy_aws_core.config import AwsConfigOverrides -from smithy_aws_core.identity import EnvironmentCredentialsResolver -from smithy_http.aio.interfaces import HTTPClient +from smithy_aws_core.aio.config import AwsConfigOverrides +from smithy_aws_core.aio.identity import AsyncEnvironmentCredentialsResolver +from smithy_http.aio.interfaces import AsyncHTTPClient from aws_sdk_bedrock_runtime.client import AsyncBedrockRuntimeClient from aws_sdk_bedrock_runtime.config import AsyncBedrockRuntimeConfig @@ -18,13 +18,13 @@ async def create_bedrock_client( - region: str, *, transport: HTTPClient | None = None + region: str, *, transport: AsyncHTTPClient | None = None ) -> AsyncBedrockRuntimeClient: """Helper to create an AsyncBedrockRuntimeClient for a given region.""" overrides: AwsConfigOverrides = { "endpoint_uri": f"https://bedrock-runtime.{region}.amazonaws.com", "region": region, - "aws_credentials_identity_resolver": EnvironmentCredentialsResolver(), + "aws_credentials_identity_resolver": AsyncEnvironmentCredentialsResolver(), } if transport is not None: overrides["transport"] = transport diff --git a/clients/aws-sdk-bedrock-runtime/tests/integration/test_bidirectional_streaming.py b/clients/aws-sdk-bedrock-runtime/tests/integration/test_bidirectional_streaming.py index 58888808..251ad8d6 100644 --- a/clients/aws-sdk-bedrock-runtime/tests/integration/test_bidirectional_streaming.py +++ b/clients/aws-sdk-bedrock-runtime/tests/integration/test_bidirectional_streaming.py @@ -8,7 +8,7 @@ import json import uuid -from smithy_core.aio.eventstream import DuplexEventStream +from smithy_core.aio.eventstream import AsyncDuplexEventStream from smithy_http.aio.crt import AWSCRTHTTPClient from aws_sdk_bedrock_runtime.models import ( @@ -144,7 +144,7 @@ async def _send_event( - stream: DuplexEventStream[ + stream: AsyncDuplexEventStream[ InvokeModelWithBidirectionalStreamInput, InvokeModelWithBidirectionalStreamOutput, InvokeModelWithBidirectionalStreamOperationOutput, @@ -159,7 +159,7 @@ async def _send_event( async def _send_audio_chunks( - stream: DuplexEventStream[ + stream: AsyncDuplexEventStream[ InvokeModelWithBidirectionalStreamInput, InvokeModelWithBidirectionalStreamOutput, InvokeModelWithBidirectionalStreamOperationOutput, @@ -198,7 +198,7 @@ async def _send_audio_chunks( async def _receive_stream_output( - stream: DuplexEventStream[ + stream: AsyncDuplexEventStream[ InvokeModelWithBidirectionalStreamInput, InvokeModelWithBidirectionalStreamOutput, InvokeModelWithBidirectionalStreamOperationOutput, diff --git a/clients/aws-sdk-bedrock/scripts/docs/generate_doc_stubs.py b/clients/aws-sdk-bedrock/scripts/docs/generate_doc_stubs.py index 52d470bc..795f2e4b 100644 --- a/clients/aws-sdk-bedrock/scripts/docs/generate_doc_stubs.py +++ b/clients/aws-sdk-bedrock/scripts/docs/generate_doc_stubs.py @@ -126,7 +126,9 @@ class ClientInfo: class DocStubGenerator: """Generate markdown API Reference stubs for AWS SDK for Python v4 clients.""" - def __init__(self, client_dir: Path, output_dir: Path, service_name: str | None = None) -> None: + def __init__( + self, client_dir: Path, output_dir: Path, service_name: str | None = None + ) -> None: """ Initialize the documentation generator. @@ -190,7 +192,9 @@ def _analyze_client_package(self, package_name: str) -> ClientInfo: required = ("client", "config", "models") missing = [name for name in required if not package.modules.get(name)] if missing: - raise ValueError(f"Missing required modules in {package_name}: {', '.join(missing)}") + raise ValueError( + f"Missing required modules in {package_name}: {', '.join(missing)}" + ) # Parse submodules client_module = package.modules["client"] @@ -199,11 +203,15 @@ def _analyze_client_package(self, package_name: str) -> ClientInfo: client_class = self._find_class_with_suffix(client_module, "Client") if not client_class: - raise ValueError(f"No class ending with 'Client' found in {package_name}.client") + raise ValueError( + f"No class ending with 'Client' found in {package_name}.client" + ) config_class = self._find_class_with_suffix(config_module, "Config") if not config_class: - raise ValueError(f"No class ending with 'Config' found in {package_name}.config") + raise ValueError( + f"No class ending with 'Config' found in {package_name}.config" + ) plugin_alias = config_module.members.get("Plugin") if not plugin_alias: @@ -288,7 +296,9 @@ def _analyze_operation(self, operation: Function) -> OperationInfo: if output_type in stream_type_map: stream_type = stream_type_map[output_type] - stream_args = self._get_subscript_elements(returns, f"'{operation.name}' stream type") + stream_args = self._get_subscript_elements( + returns, f"'{operation.name}' stream type" + ) if stream_type in (StreamType.INPUT, StreamType.DUPLEX): event_input_type = stream_args[0].canonical_name @@ -316,7 +326,9 @@ def _analyze_operation(self, operation: Function) -> OperationInfo: def _get_expr(self, annotation: str | Expr | None, context: str) -> Expr: """Extract and validate an Expr from an annotation.""" if not isinstance(annotation, Expr): - raise TypeError(f"{context}: expected Expr, got {type(annotation).__name__}") + raise TypeError( + f"{context}: expected Expr, got {type(annotation).__name__}" + ) return annotation def _get_subscript_elements(self, expr: Expr, context: str) -> list[Expr]: @@ -330,7 +342,9 @@ def _get_subscript_elements(self, expr: Expr, context: str) -> list[Expr]: return [el for el in slice_expr.elements if isinstance(el, Expr)] return [slice_expr] - def _extract_models(self, models_module: Module, operations: list[OperationInfo]) -> ModelsInfo: + def _extract_models( + self, models_module: Module, operations: list[OperationInfo] + ) -> ModelsInfo: """Extract structures, unions, enums, and errors from models module.""" structures, unions, enums, errors = [], [], [], [] @@ -356,14 +370,16 @@ def _extract_models(self, models_module: Module, operations: list[OperationInfo] duplicates = [] for structure in structures: - if self._is_operation_io_type(structure.name, operations) or self._is_union_member( - structure.name, unions - ): + if self._is_operation_io_type( + structure.name, operations + ) or self._is_union_member(structure.name, unions): duplicates.append(structure) structures = [struct for struct in structures if struct not in duplicates] - return ModelsInfo(structures=structures, unions=unions, enums=enums, errors=errors) + return ModelsInfo( + structures=structures, unions=unions, enums=enums, errors=errors + ) def _is_union(self, member: Object | Alias) -> TypeGuard[Attribute]: """Check if a module member is a union type.""" @@ -399,7 +415,9 @@ def _extract_union_members( for name in member_names: if not (member_object := models_module.members.get(name)): raise ValueError(f"Union member '{name}' not found in models module") - members.append(TypeInfo(name=member_object.name, module_path=member_object.path)) + members.append( + TypeInfo(name=member_object.name, module_path=member_object.path) + ) return members @@ -408,7 +426,8 @@ def _is_enum(self, member: Object | Alias) -> TypeGuard[Class]: if not isinstance(member, Class): return False return any( - isinstance(base, ExprName) and base.name in ENUM_BASE_CLASSES for base in member.bases + isinstance(base, ExprName) and base.name in ENUM_BASE_CLASSES + for base in member.bases ) def _is_error(self, member: Object | Alias) -> TypeGuard[Class]: @@ -416,10 +435,13 @@ def _is_error(self, member: Object | Alias) -> TypeGuard[Class]: if not isinstance(member, Class): return False return any( - isinstance(base, ExprName) and base.name in ERROR_BASE_CLASSES for base in member.bases + isinstance(base, ExprName) and base.name in ERROR_BASE_CLASSES + for base in member.bases ) - def _is_operation_io_type(self, type_name: str, operations: list[OperationInfo]) -> bool: + def _is_operation_io_type( + self, type_name: str, operations: list[OperationInfo] + ) -> bool: """Check if a type is used as operation input/output.""" return any(type_name in (op.input.name, op.output.name) for op in operations) @@ -437,8 +459,12 @@ def _generate_client_docs(self, client_info: ClientInfo) -> bool: self._generate_type_stubs( client_info.models.structures, "structures", "Structure Class" ) - self._generate_type_stubs(client_info.models.errors, "errors", "Error Class") - self._generate_type_stubs(client_info.models.enums, "enums", "Enum Class", members=True) + self._generate_type_stubs( + client_info.models.errors, "errors", "Error Class" + ) + self._generate_type_stubs( + client_info.models.enums, "enums", "Enum Class", members=True + ) self._generate_union_stubs(client_info.models.unions) except OSError as e: logger.error(f"Failed to write documentation files: {e}") @@ -470,7 +496,9 @@ def _generate_index(self, client_info: ClientInfo) -> None: ] for method in sorted(client_info.client_methods, key=lambda x: x.name): - lines.extend([*self._mkdocs_directive(method.module_path, heading_level=4), ""]) + lines.extend( + [*self._mkdocs_directive(method.module_path, heading_level=4), ""] + ) # Operations section if client_info.operations: @@ -578,7 +606,9 @@ def _generate_operation_stubs(self, operations: list[OperationInfo]) -> None: output_path = self.output_dir / "operations" / f"{op.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb("Operations", op.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb("Operations", op.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(operations)} operation file(s)") @@ -600,7 +630,9 @@ def _generate_type_stubs( output_path = self.output_dir / category / f"{item.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb(category.title(), item.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb(category.title(), item.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(items)} {category} file(s)") @@ -624,7 +656,9 @@ def _generate_union_stubs(self, unions: list[UnionInfo]) -> None: output_path = self.output_dir / "unions" / f"{union.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb("Unions", union.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb("Unions", union.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(unions)} union file(s)") diff --git a/clients/aws-sdk-bedrock/src/aws_sdk_bedrock/_private/schemas.py b/clients/aws-sdk-bedrock/src/aws_sdk_bedrock/_private/schemas.py index 9bc57d5d..a9c5f7cf 100644 --- a/clients/aws-sdk-bedrock/src/aws_sdk_bedrock/_private/schemas.py +++ b/clients/aws-sdk-bedrock/src/aws_sdk_bedrock/_private/schemas.py @@ -2,13120 +2,12462 @@ from types import MappingProxyType -from smithy_core.prelude import BOOLEAN, DOUBLE, FLOAT, INTEGER, STRING, UNIT -from smithy_core.schemas import Schema -from smithy_core.shapes import ShapeID, ShapeType -from smithy_core.traits import Trait - - -ACCEPT_EULA = Schema( - id=ShapeID("com.amazonaws.bedrock#AcceptEula"), - shape_type=ShapeType.BOOLEAN, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=False)], -) - -NON_BLANK_STRING = Schema( - id=ShapeID("com.amazonaws.bedrock#NonBlankString"), shape_type=ShapeType.STRING +from smithy_core._schema_compact import StaticOperationSchema, StaticSchema + + +n0 = "com.amazonaws.bedrock" +_AE = "AcceptEula" +_s = "smithy.api#default" +_NBS = "NonBlankString" +_ADE = "AccessDeniedException" +_sm = "smithy.api#error" +_c = "client" +_sE = "smithy.api#httpError" +_m = "message" +_AEGCI = "AccountEnforcedGuardrailConfigurationId" +_GI = "GuardrailIdentifier" +_GNV = "GuardrailNumericalVersion" +_EMI = "ExcludedModelId" +_EML = "ExcludedModelsList" +_me = "member" +_IMI = "IncludedModelId" +_IML = "IncludedModelsList" +_ME = "ModelEnforcement" +_iM = "includedModels" +_smi = "smithy.api#required" +_eM = "excludedModels" +_SGM = "SelectiveGuardingMode" +_SELECTIVE = "SELECTIVE" +_sV = "smithy.api#enumValue" +_COMPREHENSIVE = "COMPREHENSIVE" +_SCG = "SelectiveContentGuarding" +_sy = "system" +_mes = "messages" +_AEGIIC = "AccountEnforcedGuardrailInferenceInputConfiguration" +_gI = "guardrailIdentifier" +_gV = "guardrailVersion" +_sCG = "selectiveContentGuarding" +_mE = "modelEnforcement" +_T = "Timestamp" +_sF = "smithy.api#timestampFormat" +_dt = "date-time" +_GA = "GuardrailArn" +_GIu = "GuardrailId" +_IT = "InputTags" +_HONOR = "HONOR" +_IGNORE = "IGNORE" +_CO = "ConfigurationOwner" +_AEGOC = "AccountEnforcedGuardrailOutputConfiguration" +_cI = "configId" +_gA = "guardrailArn" +_gIu = "guardrailId" +_iT = "inputTags" +_cA = "createdAt" +_cB = "createdBy" +_uA = "updatedAt" +_uB = "updatedBy" +_o = "owner" +_AEGOCc = "AccountEnforcedGuardrailsOutputConfiguration" +_AI = "AccountId" +_AFDB = "AcknowledgementFormDataBody" +_AMRFK = "AdditionalModelRequestFieldsKey" +_AMRFV = "AdditionalModelRequestFieldsValue" +_AMRF = "AdditionalModelRequestFields" +_k = "key" +_v = "value" +_SU = "S3Uri" +_APOIC = "AdvancedPromptOptimizationInputConfig" +_sU = "s3Uri" +_APOJA = "AdvancedPromptOptimizationJobArn" +_APOJD = "AdvancedPromptOptimizationJobDescription" +_APOJI = "AdvancedPromptOptimizationJobIdentifier" +_APOJId = "AdvancedPromptOptimizationJobIdentifiers" +_APOJN = "AdvancedPromptOptimizationJobName" +_BDAPOJI = "BatchDeleteAdvancedPromptOptimizationJobInput" +_sSI = "smithy.synthetic#originalShapeId" +_cBDAPOJR = "com.amazonaws.bedrock#BatchDeleteAdvancedPromptOptimizationJobRequest" +_smit = "smithy.api#input" +_jI = "jobIdentifiers" +_APOJS = "AdvancedPromptOptimizationJobStatus" +_IP = "IN_PROGRESS" +_IPn = "InProgress" +_COMPLETED = "COMPLETED" +_C = "Completed" +_FAILED = "FAILED" +_F = "Failed" +_PC = "PARTIALLY_COMPLETED" +_PCa = "PartiallyCompleted" +_STOPPING = "STOPPING" +_S = "Stopping" +_STOPPED = "STOPPED" +_St = "Stopped" +_DELETING = "DELETING" +_D = "Deleting" +_BDAPOJIa = "BatchDeleteAdvancedPromptOptimizationJobItem" +_jIo = "jobIdentifier" +_jS = "jobStatus" +_BDAPOJIat = "BatchDeleteAdvancedPromptOptimizationJobItems" +_BDAPOJE = "BatchDeleteAdvancedPromptOptimizationJobError" +_co = "code" +_BDAPOJEa = "BatchDeleteAdvancedPromptOptimizationJobErrors" +_BDAPOJO = "BatchDeleteAdvancedPromptOptimizationJobOutput" +_cBDAPOJRo = "com.amazonaws.bedrock#BatchDeleteAdvancedPromptOptimizationJobResponse" +_smith = "smithy.api#output" +_e = "errors" +_aPOJ = "advancedPromptOptimizationJobs" +_ISE = "InternalServerException" +_se = "server" +_TE = "ThrottlingException" +_VE = "ValidationException" +_BDAPOJ = "BatchDeleteAdvancedPromptOptimizationJob" +_smithy = "smithy.api#http" +_CE = "ConflictException" +_ITd = "IdempotencyToken" +_KKA = "KmsKeyArn" +_NESL = "NonEmptyStringList" +_IC = "InferenceConfiguration" +_mT = "maxTokens" +_t = "temperature" +_tP = "topP" +_sS = "stopSequences" +_APOMI = "AdvancedPromptOptimizationModelIdentifier" +_MC = "ModelConfiguration" +_mI = "modelId" +_iC = "inferenceConfig" +_aMRF = "additionalModelRequestFields" +_MCo = "ModelConfigurations" +_SUF = "S3UriFolder" +_APOOC = "AdvancedPromptOptimizationOutputConfig" +_TK = "TagKey" +_TV = "TagValue" +_Ta = "Tag" +_TL = "TagList" +_CAPOJI = "CreateAdvancedPromptOptimizationJobInput" +_cCAPOJR = "com.amazonaws.bedrock#CreateAdvancedPromptOptimizationJobRequest" +_jN = "jobName" +_jD = "jobDescription" +_cT = "clientToken" +_sT = "smithy.api#idempotencyToken" +_iCn = "inputConfig" +_oC = "outputConfig" +_eKA = "encryptionKeyArn" +_ta = "tags" +_mC = "modelConfigurations" +_CAPOJO = "CreateAdvancedPromptOptimizationJobOutput" +_cCAPOJRo = "com.amazonaws.bedrock#CreateAdvancedPromptOptimizationJobResponse" +_jA = "jobArn" +_RNFE = "ResourceNotFoundException" +_SQEE = "ServiceQuotaExceededException" +_TRA = "TaggableResourcesArn" +_TMTE = "TooManyTagsException" +_rN = "resourceName" +_CAPOJ = "CreateAdvancedPromptOptimizationJob" +_GAPOJI = "GetAdvancedPromptOptimizationJobInput" +_cGAPOJR = "com.amazonaws.bedrock#GetAdvancedPromptOptimizationJobRequest" +_sL = "smithy.api#httpLabel" +_EM = "ErrorMessage" +_GAPOJO = "GetAdvancedPromptOptimizationJobOutput" +_cGAPOJRo = "com.amazonaws.bedrock#GetAdvancedPromptOptimizationJobResponse" +_cTr = "creationTime" +_lMT = "lastModifiedTime" +_fM = "failureMessage" +_GAPOJ = "GetAdvancedPromptOptimizationJob" +_MR = "MaxResults" +_PT = "PaginationToken" +_SJB = "SortJobsBy" +_CT = "CREATION_TIME" +_CTr = "CreationTime" +_SO = "SortOrder" +_ASCENDING = "ASCENDING" +_A = "Ascending" +_DESCENDING = "DESCENDING" +_De = "Descending" +_LAPOJI = "ListAdvancedPromptOptimizationJobsInput" +_cLAPOJR = "com.amazonaws.bedrock#ListAdvancedPromptOptimizationJobsRequest" +_mR = "maxResults" +_sQ = "smithy.api#httpQuery" +_nT = "nextToken" +_sB = "sortBy" +_sO = "sortOrder" +_APOJSd = "AdvancedPromptOptimizationJobSummary" +_APOJSdv = "AdvancedPromptOptimizationJobSummaries" +_LAPOJO = "ListAdvancedPromptOptimizationJobsOutput" +_cLAPOJRo = "com.amazonaws.bedrock#ListAdvancedPromptOptimizationJobsResponse" +_jSo = "jobSummaries" +_LAPOJ = "ListAdvancedPromptOptimizationJobs" +_SAPOJI = "StopAdvancedPromptOptimizationJobInput" +_cSAPOJR = "com.amazonaws.bedrock#StopAdvancedPromptOptimizationJobRequest" +_SAPOJO = "StopAdvancedPromptOptimizationJobOutput" +_cSAPOJRo = "com.amazonaws.bedrock#StopAdvancedPromptOptimizationJobResponse" +_SAPOJ = "StopAdvancedPromptOptimizationJob" +_AS = "AgreementStatus" +_AVAILABLE = "AVAILABLE" +_PENDING = "PENDING" +_NA = "NOT_AVAILABLE" +_ERROR = "ERROR" +_AA = "AgreementAvailability" +_st = "status" +_eMr = "errorMessage" +_GUCFMAI = "GetUseCaseForModelAccessInput" +_cGUCFMAR = "com.amazonaws.bedrock#GetUseCaseForModelAccessRequest" +_GUCFMAO = "GetUseCaseForModelAccessOutput" +_cGUCFMARo = "com.amazonaws.bedrock#GetUseCaseForModelAccessResponse" +_fD = "formData" +_GUCFMA = "GetUseCaseForModelAccess" +_PUCFMAI = "PutUseCaseForModelAccessInput" +_cPUCFMAR = "com.amazonaws.bedrock#PutUseCaseForModelAccessRequest" +_PUCFMAO = "PutUseCaseForModelAccessOutput" +_cPUCFMARo = "com.amazonaws.bedrock#PutUseCaseForModelAccessResponse" +_PUCFMA = "PutUseCaseForModelAccess" +_ARPA = "AutomatedReasoningPolicyArn" +_ARPBWI = "AutomatedReasoningPolicyBuildWorkflowId" +_CARPBWI = "CancelAutomatedReasoningPolicyBuildWorkflowInput" +_cCARPBWR = "com.amazonaws.bedrock#CancelAutomatedReasoningPolicyBuildWorkflowRequest" +_pA = "policyArn" +_bWI = "buildWorkflowId" +_CARPBWO = "CancelAutomatedReasoningPolicyBuildWorkflowOutput" +_cCARPBWRo = "com.amazonaws.bedrock#CancelAutomatedReasoningPolicyBuildWorkflowResponse" +_CARPBW = "CancelAutomatedReasoningPolicyBuildWorkflow" +_ARPD = "AutomatedReasoningPolicyDescription" +_smithya = "smithy.api#sensitive" +_KKI = "KmsKeyId" +_ARPN = "AutomatedReasoningPolicyName" +_ARPDRAE = "AutomatedReasoningPolicyDefinitionRuleAlternateExpression" +_ARPDRE = "AutomatedReasoningPolicyDefinitionRuleExpression" +_ARPDRI = "AutomatedReasoningPolicyDefinitionRuleId" +_ARPDR = "AutomatedReasoningPolicyDefinitionRule" +_i = "id" +_ex = "expression" +_aE = "alternateExpression" +_ARPDRL = "AutomatedReasoningPolicyDefinitionRuleList" +_ARPDTD = "AutomatedReasoningPolicyDefinitionTypeDescription" +_ARPDTN = "AutomatedReasoningPolicyDefinitionTypeName" +_ARPDTVD = "AutomatedReasoningPolicyDefinitionTypeValueDescription" +_ARPDTVN = "AutomatedReasoningPolicyDefinitionTypeValueName" +_ARPDTV = "AutomatedReasoningPolicyDefinitionTypeValue" +_d = "description" +_ARPDTVL = "AutomatedReasoningPolicyDefinitionTypeValueList" +_ARPDT = "AutomatedReasoningPolicyDefinitionType" +_n = "name" +_va = "values" +_ARPDTL = "AutomatedReasoningPolicyDefinitionTypeList" +_ARPDVD = "AutomatedReasoningPolicyDefinitionVariableDescription" +_ARPDVN = "AutomatedReasoningPolicyDefinitionVariableName" +_ARPDV = "AutomatedReasoningPolicyDefinitionVariable" +_ty = "type" +_ARPDVL = "AutomatedReasoningPolicyDefinitionVariableList" +_ARPFV = "AutomatedReasoningPolicyFormatVersion" +_ARPDu = "AutomatedReasoningPolicyDefinition" +_ve = "version" +_v_ = "1" +_typ = "types" +_r = "rules" +_var = "variables" +_CARPI = "CreateAutomatedReasoningPolicyInput" +_cCARPR = "com.amazonaws.bedrock#CreateAutomatedReasoningPolicyRequest" +_cRT = "clientRequestToken" +_pD = "policyDefinition" +_kKI = "kmsKeyId" +_ARPH = "AutomatedReasoningPolicyHash" +_ARPV = "AutomatedReasoningPolicyVersion" +_CARPO = "CreateAutomatedReasoningPolicyOutput" +_cCARPRo = "com.amazonaws.bedrock#CreateAutomatedReasoningPolicyResponse" +_dH = "definitionHash" +_CARP = "CreateAutomatedReasoningPolicy" +_ARCTC = "AutomatedReasoningCheckTranslationConfidence" +_ARCR = "AutomatedReasoningCheckResult" +_VALID = "VALID" +_INVALID = "INVALID" +_SATISFIABLE = "SATISFIABLE" +_IMPOSSIBLE = "IMPOSSIBLE" +_TA = "TRANSLATION_AMBIGUOUS" +_TC = "TOO_COMPLEX" +_NT = "NO_TRANSLATION" +_ARPTGC = "AutomatedReasoningPolicyTestGuardContent" +_ARPTQC = "AutomatedReasoningPolicyTestQueryContent" +_CARPTCI = "CreateAutomatedReasoningPolicyTestCaseInput" +_cCARPTCR = "com.amazonaws.bedrock#CreateAutomatedReasoningPolicyTestCaseRequest" +_gC = "guardContent" +_qC = "queryContent" +_eAFR = "expectedAggregatedFindingsResult" +_cTo = "confidenceThreshold" +_ARPTCI = "AutomatedReasoningPolicyTestCaseId" +_CARPTCO = "CreateAutomatedReasoningPolicyTestCaseOutput" +_cCARPTCRo = "com.amazonaws.bedrock#CreateAutomatedReasoningPolicyTestCaseResponse" +_tCI = "testCaseId" +_CARPTC = "CreateAutomatedReasoningPolicyTestCase" +_CARPVI = "CreateAutomatedReasoningPolicyVersionInput" +_cCARPVR = "com.amazonaws.bedrock#CreateAutomatedReasoningPolicyVersionRequest" +_lUDH = "lastUpdatedDefinitionHash" +_CARPVO = "CreateAutomatedReasoningPolicyVersionOutput" +_cCARPVRo = "com.amazonaws.bedrock#CreateAutomatedReasoningPolicyVersionResponse" +_CARPV = "CreateAutomatedReasoningPolicyVersion" +_DARPI = "DeleteAutomatedReasoningPolicyInput" +_cDARPR = "com.amazonaws.bedrock#DeleteAutomatedReasoningPolicyRequest" +_f = "force" +_DARPO = "DeleteAutomatedReasoningPolicyOutput" +_cDARPRo = "com.amazonaws.bedrock#DeleteAutomatedReasoningPolicyResponse" +_RIUE = "ResourceInUseException" +_DARP = "DeleteAutomatedReasoningPolicy" +_DARPBWI = "DeleteAutomatedReasoningPolicyBuildWorkflowInput" +_cDARPBWR = "com.amazonaws.bedrock#DeleteAutomatedReasoningPolicyBuildWorkflowRequest" +_lUA = "lastUpdatedAt" +_DARPBWO = "DeleteAutomatedReasoningPolicyBuildWorkflowOutput" +_cDARPBWRo = "com.amazonaws.bedrock#DeleteAutomatedReasoningPolicyBuildWorkflowResponse" +_DARPBW = "DeleteAutomatedReasoningPolicyBuildWorkflow" +_DARPTCI = "DeleteAutomatedReasoningPolicyTestCaseInput" +_cDARPTCR = "com.amazonaws.bedrock#DeleteAutomatedReasoningPolicyTestCaseRequest" +_DARPTCO = "DeleteAutomatedReasoningPolicyTestCaseOutput" +_cDARPTCRo = "com.amazonaws.bedrock#DeleteAutomatedReasoningPolicyTestCaseResponse" +_DARPTC = "DeleteAutomatedReasoningPolicyTestCase" +_EARPVI = "ExportAutomatedReasoningPolicyVersionInput" +_cEARPVR = "com.amazonaws.bedrock#ExportAutomatedReasoningPolicyVersionRequest" +_EARPVO = "ExportAutomatedReasoningPolicyVersionOutput" +_cEARPVRo = "com.amazonaws.bedrock#ExportAutomatedReasoningPolicyVersionResponse" +_sP = "smithy.api#httpPayload" +_EARPV = "ExportAutomatedReasoningPolicyVersion" +_GARPI = "GetAutomatedReasoningPolicyInput" +_cGARPR = "com.amazonaws.bedrock#GetAutomatedReasoningPolicyRequest" +_ARPI = "AutomatedReasoningPolicyId" +_GARPO = "GetAutomatedReasoningPolicyOutput" +_cGARPRo = "com.amazonaws.bedrock#GetAutomatedReasoningPolicyResponse" +_pI = "policyId" +_kKA = "kmsKeyArn" +_GARP = "GetAutomatedReasoningPolicy" +_GARPAI = "GetAutomatedReasoningPolicyAnnotationsInput" +_cGARPAR = "com.amazonaws.bedrock#GetAutomatedReasoningPolicyAnnotationsRequest" +_ARPARA = "AutomatedReasoningPolicyAddRuleAnnotation" +_ARPARNL = "AutomatedReasoningPolicyAnnotationRuleNaturalLanguage" +_ARPARFNLA = "AutomatedReasoningPolicyAddRuleFromNaturalLanguageAnnotation" +_nL = "naturalLanguage" +_ARPATA = "AutomatedReasoningPolicyAddTypeAnnotation" +_ARPAVA = "AutomatedReasoningPolicyAddVariableAnnotation" +_ARPDRA = "AutomatedReasoningPolicyDeleteRuleAnnotation" +_rI = "ruleId" +_ARPDTA = "AutomatedReasoningPolicyDeleteTypeAnnotation" +_ARPDVA = "AutomatedReasoningPolicyDeleteVariableAnnotation" +_ARPAIC = "AutomatedReasoningPolicyAnnotationIngestContent" +_ARPICA = "AutomatedReasoningPolicyIngestContentAnnotation" +_con = "content" +_ARPAFNL = "AutomatedReasoningPolicyAnnotationFeedbackNaturalLanguage" +_ARPDRIL = "AutomatedReasoningPolicyDefinitionRuleIdList" +_ARPUFRFA = "AutomatedReasoningPolicyUpdateFromRuleFeedbackAnnotation" +_rIu = "ruleIds" +_fe = "feedback" +_ARPSE = "AutomatedReasoningPolicyScenarioExpression" +_ARPUFSFA = "AutomatedReasoningPolicyUpdateFromScenarioFeedbackAnnotation" +_sEc = "scenarioExpression" +_ARPURA = "AutomatedReasoningPolicyUpdateRuleAnnotation" +_ARPATV = "AutomatedReasoningPolicyAddTypeValue" +_ARPDTVu = "AutomatedReasoningPolicyDeleteTypeValue" +_ARPUTV = "AutomatedReasoningPolicyUpdateTypeValue" +_nV = "newValue" +_ARPTVA = "AutomatedReasoningPolicyTypeValueAnnotation" +_aTV = "addTypeValue" +_uTV = "updateTypeValue" +_dTV = "deleteTypeValue" +_ARPTVAL = "AutomatedReasoningPolicyTypeValueAnnotationList" +_ARPUTA = "AutomatedReasoningPolicyUpdateTypeAnnotation" +_nN = "newName" +_ARPUVA = "AutomatedReasoningPolicyUpdateVariableAnnotation" +_ARPAu = "AutomatedReasoningPolicyAnnotation" +_aT = "addType" +_uT = "updateType" +_dT = "deleteType" +_aV = "addVariable" +_uV = "updateVariable" +_dV = "deleteVariable" +_aR = "addRule" +_uR = "updateRule" +_dR = "deleteRule" +_aRFNL = "addRuleFromNaturalLanguage" +_uFRF = "updateFromRulesFeedback" +_uFSF = "updateFromScenarioFeedback" +_iCng = "ingestContent" +_ARPAL = "AutomatedReasoningPolicyAnnotationList" +_GARPAO = "GetAutomatedReasoningPolicyAnnotationsOutput" +_cGARPARo = "com.amazonaws.bedrock#GetAutomatedReasoningPolicyAnnotationsResponse" +_a = "annotations" +_aSH = "annotationSetHash" +_GARPA = "GetAutomatedReasoningPolicyAnnotations" +_GARPBWI = "GetAutomatedReasoningPolicyBuildWorkflowInput" +_cGARPBWR = "com.amazonaws.bedrock#GetAutomatedReasoningPolicyBuildWorkflowRequest" +_ARPBWT = "AutomatedReasoningPolicyBuildWorkflowType" +_IC_ = "INGEST_CONTENT" +_RP = "REFINE_POLICY" +_IP_ = "IMPORT_POLICY" +_GFR = "GENERATE_FIDELITY_REPORT" +_GPS = "GENERATE_POLICY_SCENARIOS" +_RPA = "RESOLVE_POLICY_AMBIGUITIES" +_IRP = "ITERATIVELY_REFINE_POLICY" +_ARPBDCT = "AutomatedReasoningPolicyBuildDocumentContentType" +_PDF = "PDF" +_p = "pdf" +_TEXT = "TEXT" +_tx = "txt" +_ARPBDD = "AutomatedReasoningPolicyBuildDocumentDescription" +_ARPBDN = "AutomatedReasoningPolicyBuildDocumentName" +_ARPBWS = "AutomatedReasoningPolicyBuildWorkflowStatus" +_SCHEDULED = "SCHEDULED" +_CR = "CANCEL_REQUESTED" +_PREPROCESSING = "PREPROCESSING" +_BUILDING = "BUILDING" +_TESTING = "TESTING" +_CANCELLED = "CANCELLED" +_GARPBWO = "GetAutomatedReasoningPolicyBuildWorkflowOutput" +_cGARPBWRo = "com.amazonaws.bedrock#GetAutomatedReasoningPolicyBuildWorkflowResponse" +_bWT = "buildWorkflowType" +_dN = "documentName" +_dCT = "documentContentType" +_dD = "documentDescription" +_GARPBW = "GetAutomatedReasoningPolicyBuildWorkflow" +_ARPBRAI = "AutomatedReasoningPolicyBuildResultAssetId" +_ARPBRAT = "AutomatedReasoningPolicyBuildResultAssetType" +_BL = "BUILD_LOG" +_QR = "QUALITY_REPORT" +_PD = "POLICY_DEFINITION" +_GTC = "GENERATED_TEST_CASES" +_PS = "POLICY_SCENARIOS" +_FR = "FIDELITY_REPORT" +_AM = "ASSET_MANIFEST" +_SD = "SOURCE_DOCUMENT" +_GARPBWRAI = "GetAutomatedReasoningPolicyBuildWorkflowResultAssetsInput" +_cGARPBWRAR = ( + "com.amazonaws.bedrock#GetAutomatedReasoningPolicyBuildWorkflowResultAssetsRequest" +) +_aTs = "assetType" +_aI = "assetId" +_ARPBRAN = "AutomatedReasoningPolicyBuildResultAssetName" +_ARPBRAME = "AutomatedReasoningPolicyBuildResultAssetManifestEntry" +_aN = "assetName" +_ARPBRAML = "AutomatedReasoningPolicyBuildResultAssetManifestList" +_ARPBRAM = "AutomatedReasoningPolicyBuildResultAssetManifest" +_en = "entries" +_ARPARM = "AutomatedReasoningPolicyAddRuleMutation" +_ru = "rule" +_ARPATM = "AutomatedReasoningPolicyAddTypeMutation" +_ARPAVM = "AutomatedReasoningPolicyAddVariableMutation" +_vari = "variable" +_ARPDRM = "AutomatedReasoningPolicyDeleteRuleMutation" +_ARPDTM = "AutomatedReasoningPolicyDeleteTypeMutation" +_ARPDVM = "AutomatedReasoningPolicyDeleteVariableMutation" +_ARPURM = "AutomatedReasoningPolicyUpdateRuleMutation" +_ARPUTM = "AutomatedReasoningPolicyUpdateTypeMutation" +_ARPUVM = "AutomatedReasoningPolicyUpdateVariableMutation" +_ARPM = "AutomatedReasoningPolicyMutation" +_ARPP = "AutomatedReasoningPolicyPlanning" +_ARPBSC = "AutomatedReasoningPolicyBuildStepContext" +_pl = "planning" +_mu = "mutation" +_ARPBMT = "AutomatedReasoningPolicyBuildMessageType" +_INFO = "INFO" +_WARNING = "WARNING" +_ARPBSM = "AutomatedReasoningPolicyBuildStepMessage" +_mTe = "messageType" +_ARPBSML = "AutomatedReasoningPolicyBuildStepMessageList" +_ARPDE = "AutomatedReasoningPolicyDefinitionElement" +_pDV = "policyDefinitionVariable" +_pDT = "policyDefinitionType" +_pDR = "policyDefinitionRule" +_ARPBS = "AutomatedReasoningPolicyBuildStep" +_cont = "context" +_pE = "priorElement" +_ARPBSL = "AutomatedReasoningPolicyBuildStepList" +_ARPAS = "AutomatedReasoningPolicyAnnotationStatus" +_APPLIED = "APPLIED" +_ARPBLE = "AutomatedReasoningPolicyBuildLogEntry" +_an = "annotation" +_bS = "buildSteps" +_ARPBLEL = "AutomatedReasoningPolicyBuildLogEntryList" +_ARPBL = "AutomatedReasoningPolicyBuildLog" +_ARPBDB = "AutomatedReasoningPolicyBuildDocumentBlob" +_ARPDS = "AutomatedReasoningPolicyDocumentSha256" +_ARPSD = "AutomatedReasoningPolicySourceDocument" +_do = "document" +_dHo = "documentHash" +_ARPASu = "AutomatedReasoningPolicyAccuracyScore" +_ARPCS = "AutomatedReasoningPolicyCoverageScore" +_ARPSI = "AutomatedReasoningPolicyStatementId" +_ARPLNL = "AutomatedReasoningPolicyLineNumberList" +_ARPSL = "AutomatedReasoningPolicyStatementLocation" +_l = "lines" +_ARPST = "AutomatedReasoningPolicyStatementText" +_ARPASut = "AutomatedReasoningPolicyAtomicStatement" +_te = "text" +_lo = "location" +_ARPASL = "AutomatedReasoningPolicyAtomicStatementList" +_ARPLT = "AutomatedReasoningPolicyLineText" +_ARPALu = "AutomatedReasoningPolicyAnnotatedLine" +_lN = "lineNumber" +_lT = "lineText" +_ARPAC = "AutomatedReasoningPolicyAnnotatedContent" +_li = "line" +_ARPACL = "AutomatedReasoningPolicyAnnotatedContentList" +_ARPACu = "AutomatedReasoningPolicyAnnotatedChunk" +_pN = "pageNumber" +_ARPACLu = "AutomatedReasoningPolicyAnnotatedChunkList" +_ARPDI = "AutomatedReasoningPolicyDocumentId" +_ARPRSD = "AutomatedReasoningPolicyReportSourceDocument" +_dI = "documentId" +_aS = "atomicStatements" +_dC = "documentContent" +_ARPRSDL = "AutomatedReasoningPolicyReportSourceDocumentList" +_ARPJT = "AutomatedReasoningPolicyJustificationText" +_ARPJL = "AutomatedReasoningPolicyJustificationList" +_ARPSR = "AutomatedReasoningPolicyStatementReference" +_sI = "statementId" +_ARPSRL = "AutomatedReasoningPolicyStatementReferenceList" +_ARPRR = "AutomatedReasoningPolicyRuleReport" +_gS = "groundingStatements" +_gJ = "groundingJustifications" +_aSc = "accuracyScore" +_aJ = "accuracyJustification" +_ARPRRM = "AutomatedReasoningPolicyRuleReportMap" +_ARPVR = "AutomatedReasoningPolicyVariableReport" +_pV = "policyVariable" +_ARPVRM = "AutomatedReasoningPolicyVariableReportMap" +_ARPFR = "AutomatedReasoningPolicyFidelityReport" +_cS = "coverageScore" +_rR = "ruleReports" +_vR = "variableReports" +_dS = "documentSources" +_ARPGTC = "AutomatedReasoningPolicyGeneratedTestCase" +_ARPGTCL = "AutomatedReasoningPolicyGeneratedTestCaseList" +_ARPGTCu = "AutomatedReasoningPolicyGeneratedTestCases" +_gTC = "generatedTestCases" +_ARPSAE = "AutomatedReasoningPolicyScenarioAlternateExpression" +_ARPS = "AutomatedReasoningPolicyScenario" +_eR = "expectedResult" +_ARPSLu = "AutomatedReasoningPolicyScenarioList" +_ARPSu = "AutomatedReasoningPolicyScenarios" +_pS = "policyScenarios" +_ARPCRIL = "AutomatedReasoningPolicyConflictedRuleIdList" +_ARPDRILu = "AutomatedReasoningPolicyDisjointedRuleIdList" +_ARPDVNL = "AutomatedReasoningPolicyDefinitionVariableNameList" +_ARPDRS = "AutomatedReasoningPolicyDisjointRuleSet" +_ARPDRSL = "AutomatedReasoningPolicyDisjointRuleSetList" +_ARPDTNL = "AutomatedReasoningPolicyDefinitionTypeNameList" +_ARPDTVP = "AutomatedReasoningPolicyDefinitionTypeValuePair" +_tN = "typeName" +_vN = "valueName" +_ARPDTVPL = "AutomatedReasoningPolicyDefinitionTypeValuePairList" +_ARPDQR = "AutomatedReasoningPolicyDefinitionQualityReport" +_tC = "typeCount" +_vC = "variableCount" +_rC = "ruleCount" +_uTn = "unusedTypes" +_uTVn = "unusedTypeValues" +_uVn = "unusedVariables" +_cR = "conflictingRules" +_dRS = "disjointRuleSets" +_ARPBRA = "AutomatedReasoningPolicyBuildResultAssets" +_qR = "qualityReport" +_bL = "buildLog" +_aM = "assetManifest" +_fR = "fidelityReport" +_GARPBWRAO = "GetAutomatedReasoningPolicyBuildWorkflowResultAssetsOutput" +_cGARPBWRARo = ( + "com.amazonaws.bedrock#GetAutomatedReasoningPolicyBuildWorkflowResultAssetsResponse" +) +_bWA = "buildWorkflowAssets" +_GARPBWRA = "GetAutomatedReasoningPolicyBuildWorkflowResultAssets" +_GARPNSI = "GetAutomatedReasoningPolicyNextScenarioInput" +_cGARPNSR = "com.amazonaws.bedrock#GetAutomatedReasoningPolicyNextScenarioRequest" +_GARPNSO = "GetAutomatedReasoningPolicyNextScenarioOutput" +_cGARPNSRo = "com.amazonaws.bedrock#GetAutomatedReasoningPolicyNextScenarioResponse" +_sc = "scenario" +_GARPNS = "GetAutomatedReasoningPolicyNextScenario" +_GARPTCI = "GetAutomatedReasoningPolicyTestCaseInput" +_cGARPTCR = "com.amazonaws.bedrock#GetAutomatedReasoningPolicyTestCaseRequest" +_ARPTC = "AutomatedReasoningPolicyTestCase" +_GARPTCO = "GetAutomatedReasoningPolicyTestCaseOutput" +_cGARPTCRo = "com.amazonaws.bedrock#GetAutomatedReasoningPolicyTestCaseResponse" +_tCe = "testCase" +_GARPTC = "GetAutomatedReasoningPolicyTestCase" +_GARPTRI = "GetAutomatedReasoningPolicyTestResultInput" +_cGARPTRR = "com.amazonaws.bedrock#GetAutomatedReasoningPolicyTestResultRequest" +_ARCRu = "AutomatedReasoningCheckRule" +_pVA = "policyVersionArn" +_ARCRL = "AutomatedReasoningCheckRuleList" +_ARLSC = "AutomatedReasoningLogicStatementContent" +_ARNLSC = "AutomatedReasoningNaturalLanguageStatementContent" +_ARLS = "AutomatedReasoningLogicStatement" +_log = "logic" +_ARLSL = "AutomatedReasoningLogicStatementList" +_ARCLWT = "AutomatedReasoningCheckLogicWarningType" +_AT = "ALWAYS_TRUE" +_AF = "ALWAYS_FALSE" +_ARCLW = "AutomatedReasoningCheckLogicWarning" +_pr = "premises" +_cl = "claims" +_ARCITR = "AutomatedReasoningCheckInputTextReference" +_ARCITRL = "AutomatedReasoningCheckInputTextReferenceList" +_ARCT = "AutomatedReasoningCheckTranslation" +_uP = "untranslatedPremises" +_uC = "untranslatedClaims" +_conf = "confidence" +_ARCIF = "AutomatedReasoningCheckImpossibleFinding" +_tr = "translation" +_cRo = "contradictingRules" +_lW = "logicWarning" +_ARCIFu = "AutomatedReasoningCheckInvalidFinding" +_ARCNTF = "AutomatedReasoningCheckNoTranslationsFinding" +_ARCS = "AutomatedReasoningCheckScenario" +_sta = "statements" +_ARCSF = "AutomatedReasoningCheckSatisfiableFinding" +_cTS = "claimsTrueScenario" +_cFS = "claimsFalseScenario" +_ARCTCF = "AutomatedReasoningCheckTooComplexFinding" +_ARCDSL = "AutomatedReasoningCheckDifferenceScenarioList" +_ARCTL = "AutomatedReasoningCheckTranslationList" +_ARCTO = "AutomatedReasoningCheckTranslationOption" +_tra = "translations" +_ARCTOL = "AutomatedReasoningCheckTranslationOptionList" +_ARCTAF = "AutomatedReasoningCheckTranslationAmbiguousFinding" +_op = "options" +_dSi = "differenceScenarios" +_ARCVF = "AutomatedReasoningCheckValidFinding" +_sR = "supportingRules" +_ARCF = "AutomatedReasoningCheckFinding" +_val = "valid" +_in = "invalid" +_sa = "satisfiable" +_im = "impossible" +_tA = "translationAmbiguous" +_tCo = "tooComplex" +_nTo = "noTranslations" +_ARCFL = "AutomatedReasoningCheckFindingList" +_ARPTRR = "AutomatedReasoningPolicyTestRunResult" +_PASSED = "PASSED" +_ARPTRS = "AutomatedReasoningPolicyTestRunStatus" +_NS = "NOT_STARTED" +_ARPTR = "AutomatedReasoningPolicyTestResult" +_tRS = "testRunStatus" +_tF = "testFindings" +_tRR = "testRunResult" +_aTFR = "aggregatedTestFindingsResult" +_GARPTRO = "GetAutomatedReasoningPolicyTestResultOutput" +_cGARPTRRo = "com.amazonaws.bedrock#GetAutomatedReasoningPolicyTestResultResponse" +_tR = "testResult" +_GARPTR = "GetAutomatedReasoningPolicyTestResult" +_LARPI = "ListAutomatedReasoningPoliciesInput" +_cLARPR = "com.amazonaws.bedrock#ListAutomatedReasoningPoliciesRequest" +_ARPSut = "AutomatedReasoningPolicySummary" +_ARPSuto = "AutomatedReasoningPolicySummaries" +_LARPO = "ListAutomatedReasoningPoliciesOutput" +_cLARPRo = "com.amazonaws.bedrock#ListAutomatedReasoningPoliciesResponse" +_aRPS = "automatedReasoningPolicySummaries" +_LARP = "ListAutomatedReasoningPolicies" +_LARPBWI = "ListAutomatedReasoningPolicyBuildWorkflowsInput" +_cLARPBWR = "com.amazonaws.bedrock#ListAutomatedReasoningPolicyBuildWorkflowsRequest" +_ARPBWSu = "AutomatedReasoningPolicyBuildWorkflowSummary" +_ARPBWSut = "AutomatedReasoningPolicyBuildWorkflowSummaries" +_LARPBWO = "ListAutomatedReasoningPolicyBuildWorkflowsOutput" +_cLARPBWRo = "com.amazonaws.bedrock#ListAutomatedReasoningPolicyBuildWorkflowsResponse" +_aRPBWS = "automatedReasoningPolicyBuildWorkflowSummaries" +_LARPBW = "ListAutomatedReasoningPolicyBuildWorkflows" +_LARPTCI = "ListAutomatedReasoningPolicyTestCasesInput" +_cLARPTCR = "com.amazonaws.bedrock#ListAutomatedReasoningPolicyTestCasesRequest" +_ARPTCL = "AutomatedReasoningPolicyTestCaseList" +_LARPTCO = "ListAutomatedReasoningPolicyTestCasesOutput" +_cLARPTCRo = "com.amazonaws.bedrock#ListAutomatedReasoningPolicyTestCasesResponse" +_tCes = "testCases" +_LARPTC = "ListAutomatedReasoningPolicyTestCases" +_LARPTRI = "ListAutomatedReasoningPolicyTestResultsInput" +_cLARPTRR = "com.amazonaws.bedrock#ListAutomatedReasoningPolicyTestResultsRequest" +_ARPTL = "AutomatedReasoningPolicyTestList" +_LARPTRO = "ListAutomatedReasoningPolicyTestResultsOutput" +_cLARPTRRo = "com.amazonaws.bedrock#ListAutomatedReasoningPolicyTestResultsResponse" +_tRe = "testResults" +_LARPTR = "ListAutomatedReasoningPolicyTestResults" +_ARPBWD = "AutomatedReasoningPolicyBuildWorkflowDocument" +_ARPBWDL = "AutomatedReasoningPolicyBuildWorkflowDocumentList" +_ARPGFRDL = "AutomatedReasoningPolicyGenerateFidelityReportDocumentList" +_ARPGFRC = "AutomatedReasoningPolicyGenerateFidelityReportContent" +_doc = "documents" +_ARPIRDL = "AutomatedReasoningPolicyIterativeRefinementDocumentList" +_ARPBF = "AutomatedReasoningPolicyBuildFeedback" +_ARPIRC = "AutomatedReasoningPolicyIterativeRefinementContent" +_ARPBWRC = "AutomatedReasoningPolicyBuildWorkflowRepairContent" +_ARPWTC = "AutomatedReasoningPolicyWorkflowTypeContent" +_pRA = "policyRepairAssets" +_gFRC = "generateFidelityReportContent" +_iRC = "iterativeRefinementContent" +_ARPBWSuto = "AutomatedReasoningPolicyBuildWorkflowSource" +_wC = "workflowContent" +_SARPBWI = "StartAutomatedReasoningPolicyBuildWorkflowInput" +_cSARPBWR = "com.amazonaws.bedrock#StartAutomatedReasoningPolicyBuildWorkflowRequest" +_sH = "smithy.api#httpHeader" +_xact = "x-amz-client-token" +_sC = "sourceContent" +_SARPBWO = "StartAutomatedReasoningPolicyBuildWorkflowOutput" +_cSARPBWRo = "com.amazonaws.bedrock#StartAutomatedReasoningPolicyBuildWorkflowResponse" +_SARPBW = "StartAutomatedReasoningPolicyBuildWorkflow" +_ARPTCIL = "AutomatedReasoningPolicyTestCaseIdList" +_SARPTWI = "StartAutomatedReasoningPolicyTestWorkflowInput" +_cSARPTWR = "com.amazonaws.bedrock#StartAutomatedReasoningPolicyTestWorkflowRequest" +_tCIe = "testCaseIds" +_SARPTWO = "StartAutomatedReasoningPolicyTestWorkflowOutput" +_cSARPTWRo = "com.amazonaws.bedrock#StartAutomatedReasoningPolicyTestWorkflowResponse" +_SARPTW = "StartAutomatedReasoningPolicyTestWorkflow" +_UARPI = "UpdateAutomatedReasoningPolicyInput" +_cUARPR = "com.amazonaws.bedrock#UpdateAutomatedReasoningPolicyRequest" +_UARPO = "UpdateAutomatedReasoningPolicyOutput" +_cUARPRo = "com.amazonaws.bedrock#UpdateAutomatedReasoningPolicyResponse" +_UARP = "UpdateAutomatedReasoningPolicy" +_UARPAI = "UpdateAutomatedReasoningPolicyAnnotationsInput" +_cUARPAR = "com.amazonaws.bedrock#UpdateAutomatedReasoningPolicyAnnotationsRequest" +_lUASH = "lastUpdatedAnnotationSetHash" +_UARPAO = "UpdateAutomatedReasoningPolicyAnnotationsOutput" +_cUARPARo = "com.amazonaws.bedrock#UpdateAutomatedReasoningPolicyAnnotationsResponse" +_UARPA = "UpdateAutomatedReasoningPolicyAnnotations" +_UARPTCI = "UpdateAutomatedReasoningPolicyTestCaseInput" +_cUARPTCR = "com.amazonaws.bedrock#UpdateAutomatedReasoningPolicyTestCaseRequest" +_UARPTCO = "UpdateAutomatedReasoningPolicyTestCaseOutput" +_cUARPTCRo = "com.amazonaws.bedrock#UpdateAutomatedReasoningPolicyTestCaseResponse" +_UARPTC = "UpdateAutomatedReasoningPolicyTestCase" +_RA = "RoleArn" +_ICn = "InstanceCount" +_ITn = "InstanceType" +_SGI = "SecurityGroupId" +_SGIe = "SecurityGroupIds" +_SI = "SubnetId" +_SIu = "SubnetIds" +_VC = "VpcConfig" +_sIu = "subnetIds" +_sGI = "securityGroupIds" +_SME = "SageMakerEndpoint" +_iIC = "initialInstanceCount" +_iTn = "instanceType" +_eRx = "executionRole" +_kEK = "kmsEncryptionKey" +_vp = "vpc" +_EC = "EndpointConfig" +_sM = "sageMaker" +_EN = "EndpointName" +_MSI = "ModelSourceIdentifier" +_CMMEI = "CreateMarketplaceModelEndpointInput" +_cCMMER = "com.amazonaws.bedrock#CreateMarketplaceModelEndpointRequest" +_mSI = "modelSourceIdentifier" +_eC = "endpointConfig" +_aEc = "acceptEula" +_eN = "endpointName" +_Ar = "Arn" +_Sta = "Status" +_REGISTERED = "REGISTERED" +_IE = "INCOMPATIBLE_ENDPOINT" +_MME = "MarketplaceModelEndpoint" +_eA = "endpointArn" +_sMt = "statusMessage" +_eS = "endpointStatus" +_eSM = "endpointStatusMessage" +_CMMEO = "CreateMarketplaceModelEndpointOutput" +_cCMMERo = "com.amazonaws.bedrock#CreateMarketplaceModelEndpointResponse" +_mME = "marketplaceModelEndpoint" +_CMME = "CreateMarketplaceModelEndpoint" +_DMMEI = "DeleteMarketplaceModelEndpointInput" +_cDMMER = "com.amazonaws.bedrock#DeleteMarketplaceModelEndpointRequest" +_DMMEO = "DeleteMarketplaceModelEndpointOutput" +_cDMMERo = "com.amazonaws.bedrock#DeleteMarketplaceModelEndpointResponse" +_DMME = "DeleteMarketplaceModelEndpoint" +_DMMEIe = "DeregisterMarketplaceModelEndpointInput" +_cDMMERom = "com.amazonaws.bedrock#DeregisterMarketplaceModelEndpointRequest" +_DMMEOe = "DeregisterMarketplaceModelEndpointOutput" +_cDMMERoma = "com.amazonaws.bedrock#DeregisterMarketplaceModelEndpointResponse" +_SUE = "ServiceUnavailableException" +_DMMEe = "DeregisterMarketplaceModelEndpoint" +_GMMEI = "GetMarketplaceModelEndpointInput" +_cGMMER = "com.amazonaws.bedrock#GetMarketplaceModelEndpointRequest" +_GMMEO = "GetMarketplaceModelEndpointOutput" +_cGMMERo = "com.amazonaws.bedrock#GetMarketplaceModelEndpointResponse" +_GMME = "GetMarketplaceModelEndpoint" +_LMMEI = "ListMarketplaceModelEndpointsInput" +_cLMMER = "com.amazonaws.bedrock#ListMarketplaceModelEndpointsRequest" +_mSE = "modelSourceEquals" +_MMES = "MarketplaceModelEndpointSummary" +_MMESa = "MarketplaceModelEndpointSummaries" +_LMMEO = "ListMarketplaceModelEndpointsOutput" +_cLMMERo = "com.amazonaws.bedrock#ListMarketplaceModelEndpointsResponse" +_mMEa = "marketplaceModelEndpoints" +_LMME = "ListMarketplaceModelEndpoints" +_RMMEI = "RegisterMarketplaceModelEndpointInput" +_cRMMER = "com.amazonaws.bedrock#RegisterMarketplaceModelEndpointRequest" +_eI = "endpointIdentifier" +_RMMEO = "RegisterMarketplaceModelEndpointOutput" +_cRMMERo = "com.amazonaws.bedrock#RegisterMarketplaceModelEndpointResponse" +_RMME = "RegisterMarketplaceModelEndpoint" +_UMMEI = "UpdateMarketplaceModelEndpointInput" +_cUMMER = "com.amazonaws.bedrock#UpdateMarketplaceModelEndpointRequest" +_UMMEO = "UpdateMarketplaceModelEndpointOutput" +_cUMMERo = "com.amazonaws.bedrock#UpdateMarketplaceModelEndpointResponse" +_UMME = "UpdateMarketplaceModelEndpoint" +_CMDD = "CustomModelDeploymentDescription" +_CMA = "CustomModelArn" +_MDN = "ModelDeploymentName" +_CCMDI = "CreateCustomModelDeploymentInput" +_cCCMDR = "com.amazonaws.bedrock#CreateCustomModelDeploymentRequest" +_mDN = "modelDeploymentName" +_mA = "modelArn" +_CMDA = "CustomModelDeploymentArn" +_CCMDO = "CreateCustomModelDeploymentOutput" +_cCCMDRo = "com.amazonaws.bedrock#CreateCustomModelDeploymentResponse" +_cMDA = "customModelDeploymentArn" +_CCMD = "CreateCustomModelDeployment" +_CMDI = "CustomModelDeploymentIdentifier" +_DCMDI = "DeleteCustomModelDeploymentInput" +_cDCMDR = "com.amazonaws.bedrock#DeleteCustomModelDeploymentRequest" +_cMDI = "customModelDeploymentIdentifier" +_DCMDO = "DeleteCustomModelDeploymentOutput" +_cDCMDRo = "com.amazonaws.bedrock#DeleteCustomModelDeploymentResponse" +_DCMD = "DeleteCustomModelDeployment" +_GCMDI = "GetCustomModelDeploymentInput" +_cGCMDR = "com.amazonaws.bedrock#GetCustomModelDeploymentRequest" +_CMDS = "CustomModelDeploymentStatus" +_CREATING = "CREATING" +_Cr = "Creating" +_ACTIVE = "ACTIVE" +_Ac = "Active" +_MA = "ModelArn" +_CMDUS = "CustomModelDeploymentUpdateStatus" +_UPDATING = "UPDATING" +_U = "Updating" +_UC = "UPDATE_COMPLETED" +_UCp = "UpdateCompleted" +_UF = "UPDATE_FAILED" +_UFp = "UpdateFailed" +_CMDUD = "CustomModelDeploymentUpdateDetails" +_uS = "updateStatus" +_GCMDO = "GetCustomModelDeploymentOutput" +_cGCMDRo = "com.amazonaws.bedrock#GetCustomModelDeploymentResponse" +_uD = "updateDetails" +_GCMD = "GetCustomModelDeployment" +_SMB = "SortModelsBy" +_LCMDI = "ListCustomModelDeploymentsInput" +_cLCMDR = "com.amazonaws.bedrock#ListCustomModelDeploymentsRequest" +_cBr = "createdBefore" +_cAr = "createdAfter" +_nC = "nameContains" +_sEt = "statusEquals" +_mAE = "modelArnEquals" +_CMDSu = "CustomModelDeploymentSummary" +_cMDN = "customModelDeploymentName" +_CMDSL = "CustomModelDeploymentSummaryList" +_LCMDO = "ListCustomModelDeploymentsOutput" +_cLCMDRo = "com.amazonaws.bedrock#ListCustomModelDeploymentsResponse" +_mDS = "modelDeploymentSummaries" +_LCMD = "ListCustomModelDeployments" +_UCMDI = "UpdateCustomModelDeploymentInput" +_cUCMDR = "com.amazonaws.bedrock#UpdateCustomModelDeploymentRequest" +_UCMDO = "UpdateCustomModelDeploymentOutput" +_cUCMDRo = "com.amazonaws.bedrock#UpdateCustomModelDeploymentResponse" +_UCMD = "UpdateCustomModelDeployment" +_MPA = "ModelPackageArn" +_MPADS = "ModelPackageArnDataSource" +_mPA = "modelPackageArn" +_CMDSus = "CustomModelDataSource" +_mPADS = "modelPackageArnDataSource" +_CMN = "CustomModelName" +_SDS = "S3DataSource" +_MDS = "ModelDataSource" +_sDS = "s3DataSource" +_CCMI = "CreateCustomModelInput" +_cCCMR = "com.amazonaws.bedrock#CreateCustomModelRequest" +_mN = "modelName" +_mSC = "modelSourceConfig" +_cMDS = "customModelDataSource" +_mKKA = "modelKmsKeyArn" +_rA = "roleArn" +_mTo = "modelTags" +_CCMO = "CreateCustomModelOutput" +_cCCMRo = "com.amazonaws.bedrock#CreateCustomModelResponse" +_CCM = "CreateCustomModel" +_MI = "ModelIdentifier" +_DCMI = "DeleteCustomModelInput" +_cDCMR = "com.amazonaws.bedrock#DeleteCustomModelRequest" +_mIo = "modelIdentifier" +_DCMO = "DeleteCustomModelOutput" +_cDCMRo = "com.amazonaws.bedrock#DeleteCustomModelResponse" +_DCM = "DeleteCustomModel" +_GCMI = "GetCustomModelInput" +_cGCMR = "com.amazonaws.bedrock#GetCustomModelRequest" +_TMI = "TeacherModelIdentifier" +_TMC = "TeacherModelConfig" +_tMI = "teacherModelIdentifier" +_mRLFI = "maxResponseLengthForInference" +_DC = "DistillationConfig" +_tMC = "teacherModelConfig" +_LA = "LambdaArn" +_LGC = "LambdaGraderConfig" +_lA = "lambdaArn" +_GC = "GraderConfig" +_lG = "lambdaGrader" +_RFTBS = "RFTBatchSize" +_ECp = "EpochCount" +_RFTEI = "RFTEvalInterval" +_RFTIMT = "RFTInferenceMaxTokens" +_RFTLR = "RFTLearningRate" +_RFTMPL = "RFTMaxPromptLength" +_RE = "ReasoningEffort" +_LOW = "LOW" +_low = "low" +_MEDIUM = "MEDIUM" +_med = "medium" +_HIGH = "HIGH" +_h = "high" +_RFTTSPP = "RFTTrainingSamplePerPrompt" +_RFTHP = "RFTHyperParameters" +_eCp = "epochCount" +_bSa = "batchSize" +_lR = "learningRate" +_mPL = "maxPromptLength" +_tSPP = "trainingSamplePerPrompt" +_iMT = "inferenceMaxTokens" +_rE = "reasoningEffort" +_eIv = "evalInterval" +_RFTC = "RFTConfig" +_gCr = "graderConfig" +_hP = "hyperParameters" +_CC = "CustomizationConfig" +_dCi = "distillationConfig" +_rCf = "rftConfig" +_CTu = "CustomizationType" +_FT = "FINE_TUNING" +_CPT = "CONTINUED_PRE_TRAINING" +_DISTILLATION = "DISTILLATION" +_RFT = "REINFORCEMENT_FINE_TUNING" +_IMPORTED = "IMPORTED" +_MCHP = "ModelCustomizationHyperParameters" +_MCJA = "ModelCustomizationJobArn" +_JN = "JobName" +_MS = "ModelStatus" +_ODC = "OutputDataConfig" +_ILS = "InvocationLogSource" +_RMM = "RequestMetadataMap" +_RMBF = "RequestMetadataBaseFilters" +_eq = "equals" +_nE = "notEquals" +_RMFL = "RequestMetadataFiltersList" +_RMF = "RequestMetadataFilters" +_aA = "andAll" +_oA = "orAll" +_UPR = "UsePromptResponse" +_ILC = "InvocationLogsConfig" +_uPR = "usePromptResponse" +_iLS = "invocationLogSource" +_rMF = "requestMetadataFilters" +_TDC = "TrainingDataConfig" +_iLC = "invocationLogsConfig" +_MF = "MetricFloat" +_TM = "TrainingMetrics" +_tL = "trainingLoss" +_V = "Validator" +_Va = "Validators" +_VDC = "ValidationDataConfig" +_vali = "validators" +_VM = "ValidatorMetric" +_vL = "validationLoss" +_VMa = "ValidationMetrics" +_GCMO = "GetCustomModelOutput" +_cGCMRo = "com.amazonaws.bedrock#GetCustomModelResponse" +_bMA = "baseModelArn" +_cTu = "customizationType" +_tDC = "trainingDataConfig" +_vDC = "validationDataConfig" +_oDC = "outputDataConfig" +_tM = "trainingMetrics" +_vM = "validationMetrics" +_cC = "customizationConfig" +_mS = "modelStatus" +_GCM = "GetCustomModel" +_FMA = "FoundationModelArn" +_LCMI = "ListCustomModelsInput" +_cLCMR = "com.amazonaws.bedrock#ListCustomModelsRequest" +_cTB = "creationTimeBefore" +_cTA = "creationTimeAfter" +_bMAE = "baseModelArnEquals" +_fMAE = "foundationModelArnEquals" +_iO = "isOwned" +_MN = "ModelName" +_CMS = "CustomModelSummary" +_bMN = "baseModelName" +_oAI = "ownerAccountId" +_CMSL = "CustomModelSummaryList" +_LCMO = "ListCustomModelsOutput" +_cLCMRo = "com.amazonaws.bedrock#ListCustomModelsResponse" +_mSo = "modelSummaries" +_LCM = "ListCustomModels" +_GADRI = "GetAccountDataRetentionInput" +_cGADRR = "com.amazonaws.bedrock#GetAccountDataRetentionRequest" +_DRM = "DataRetentionMode" +_DEFAULT = "DEFAULT" +_de = "default" +_NONE = "NONE" +_no = "none" +_AR = "AWS_REVIEW" +_ar = "aws_review" +_PDS = "PROVIDER_DATA_SHARE" +_pds = "provider_data_share" +_INHERIT = "INHERIT" +_inh = "inherit" +_GADRO = "GetAccountDataRetentionOutput" +_cGADRRo = "com.amazonaws.bedrock#GetAccountDataRetentionResponse" +_mo = "mode" +_GADR = "GetAccountDataRetention" +_PADRI = "PutAccountDataRetentionInput" +_cPADRR = "com.amazonaws.bedrock#PutAccountDataRetentionRequest" +_PADRO = "PutAccountDataRetentionOutput" +_cPADRRo = "com.amazonaws.bedrock#PutAccountDataRetentionResponse" +_PADR = "PutAccountDataRetention" +_DEGCI = "DeleteEnforcedGuardrailConfigurationInput" +_cDEGCR = "com.amazonaws.bedrock#DeleteEnforcedGuardrailConfigurationRequest" +_DEGCO = "DeleteEnforcedGuardrailConfigurationOutput" +_cDEGCRo = "com.amazonaws.bedrock#DeleteEnforcedGuardrailConfigurationResponse" +_DEGC = "DeleteEnforcedGuardrailConfiguration" +_LEGCI = "ListEnforcedGuardrailsConfigurationInput" +_cLEGCR = "com.amazonaws.bedrock#ListEnforcedGuardrailsConfigurationRequest" +_LEGCO = "ListEnforcedGuardrailsConfigurationOutput" +_cLEGCRo = "com.amazonaws.bedrock#ListEnforcedGuardrailsConfigurationResponse" +_gCu = "guardrailsConfig" +_LEGC = "ListEnforcedGuardrailsConfiguration" +_PEGCI = "PutEnforcedGuardrailConfigurationInput" +_cPEGCR = "com.amazonaws.bedrock#PutEnforcedGuardrailConfigurationRequest" +_gIC = "guardrailInferenceConfig" +_PEGCO = "PutEnforcedGuardrailConfigurationOutput" +_cPEGCRo = "com.amazonaws.bedrock#PutEnforcedGuardrailConfigurationResponse" +_PEGC = "PutEnforcedGuardrailConfiguration" +_EJI = "EvaluationJobIdentifier" +_EJIv = "EvaluationJobIdentifiers" +_BDEJI = "BatchDeleteEvaluationJobInput" +_cBDEJR = "com.amazonaws.bedrock#BatchDeleteEvaluationJobRequest" +_BDEJE = "BatchDeleteEvaluationJobError" +_BDEJEa = "BatchDeleteEvaluationJobErrors" +_EJS = "EvaluationJobStatus" +_BDEJIa = "BatchDeleteEvaluationJobItem" +_BDEJIat = "BatchDeleteEvaluationJobItems" +_BDEJO = "BatchDeleteEvaluationJobOutput" +_cBDEJRo = "com.amazonaws.bedrock#BatchDeleteEvaluationJobResponse" +_eJ = "evaluationJobs" +_BDEJ = "BatchDeleteEvaluationJob" +_ATp = "ApplicationType" +_ME_ = "MODEL_EVALUATION" +_MEo = "ModelEvaluation" +_RE_ = "RAG_EVALUATION" +_REa = "RagEvaluation" +_CMI = "CustomMetricInstructions" +_MNe = "MetricName" +_RSID = "RatingScaleItemDefinition" +_RSIV = "RatingScaleItemValue" +_sVt = "stringValue" +_fV = "floatValue" +_RSI = "RatingScaleItem" +_def = "definition" +_RS = "RatingScale" +_CMD = "CustomMetricDefinition" +_ins = "instructions" +_rS = "ratingScale" +_AECMS = "AutomatedEvaluationCustomMetricSource" +_cMD = "customMetricDefinition" +_AECM = "AutomatedEvaluationCustomMetrics" +_EMIv = "EvaluatorModelIdentifier" +_CMBEM = "CustomMetricBedrockEvaluatorModel" +_CMBEMu = "CustomMetricBedrockEvaluatorModels" +_CMEMC = "CustomMetricEvaluatorModelConfig" +_bEM = "bedrockEvaluatorModels" +_AECMC = "AutomatedEvaluationCustomMetricConfig" +_cM = "customMetrics" +_eMC = "evaluatorModelConfig" +_EDL = "EvaluationDatasetLocation" +_EDN = "EvaluationDatasetName" +_ED = "EvaluationDataset" +_dL = "datasetLocation" +_EMN = "EvaluationMetricName" +_EMNv = "EvaluationMetricNames" +_ETT = "EvaluationTaskType" +_SUMMARIZATION = "SUMMARIZATION" +_Su = "Summarization" +_CLASSIFICATION = "CLASSIFICATION" +_Cl = "Classification" +_QAA = "QUESTION_AND_ANSWER" +_QAAu = "QuestionAndAnswer" +_GENERATION = "GENERATION" +_G = "Generation" +_CUSTOM = "CUSTOM" +_Cu = "Custom" +_EDMC = "EvaluationDatasetMetricConfig" +_tT = "taskType" +_da = "dataset" +_mNe = "metricNames" +_EDMCv = "EvaluationDatasetMetricConfigs" +_BEM = "BedrockEvaluatorModel" +_BEMe = "BedrockEvaluatorModels" +_EMC = "EvaluatorModelConfig" +_AEC = "AutomatedEvaluationConfig" +_dMC = "datasetMetricConfigs" +_cMC = "customMetricConfig" +_EMD = "EvaluationMetricDescription" +_ERM = "EvaluationRatingMethod" +_HECM = "HumanEvaluationCustomMetric" +_rM = "ratingMethod" +_HECMu = "HumanEvaluationCustomMetrics" +_SMFDA = "SageMakerFlowDefinitionArn" +_HTI = "HumanTaskInstructions" +_HWC = "HumanWorkflowConfig" +_fDA = "flowDefinitionArn" +_HEC = "HumanEvaluationConfig" +_hWC = "humanWorkflowConfig" +_ECv = "EvaluationConfig" +_au = "automated" +_hu = "human" +_EMIP = "EvaluationModelInferenceParams" +_EBMI = "EvaluationBedrockModelIdentifier" +_PCL = "PerformanceConfigLatency" +_STANDARD = "STANDARD" +_stan = "standard" +_OPTIMIZED = "OPTIMIZED" +_opt = "optimized" +_PCe = "PerformanceConfiguration" +_la = "latency" +_EBM = "EvaluationBedrockModel" +_iP = "inferenceParams" +_v__ = "{}" +_pC = "performanceConfig" +_EPISI = "EvaluationPrecomputedInferenceSourceIdentifier" +_EPIS = "EvaluationPrecomputedInferenceSource" +_iSI = "inferenceSourceIdentifier" +_EMCv = "EvaluationModelConfig" +_bM = "bedrockModel" +_pIS = "precomputedInferenceSource" +_EMCva = "EvaluationModelConfigs" +_GCu = "GuardrailConfiguration" +_MT = "MaxTokens" +_RAGSS = "RAGStopSequences" +_Te = "Temperature" +_TP = "TopP" +_TIC = "TextInferenceConfig" +_KIC = "KbInferenceConfig" +_tIC = "textInferenceConfig" +_TPT = "TextPromptTemplate" +_PTr = "PromptTemplate" +_tPT = "textPromptTemplate" +_ESGC = "ExternalSourcesGenerationConfiguration" +_pT = "promptTemplate" +_gCua = "guardrailConfiguration" +_kIC = "kbInferenceConfig" +_BMA = "BedrockModelArn" +_CTo = "ContentType" +_BCB = "ByteContentBlob" +_I = "Identifier" +_BCD = "ByteContentDoc" +_id = "identifier" +_cTon = "contentType" +_dat = "data" +_kBSU = "kBS3Uri" +_SOD = "S3ObjectDoc" +_u = "uri" +_EST = "ExternalSourceType" +_S_ = "S3" +_BC = "BYTE_CONTENT" +_ES = "ExternalSource" +_sTo = "sourceType" +_sLo = "s3Location" +_bC = "byteContent" +_ESx = "ExternalSources" +_ESRAGC = "ExternalSourcesRetrieveAndGenerateConfiguration" +_so = "sources" +_gCe = "generationConfiguration" +_GCe = "GenerationConfiguration" +_KBI = "KnowledgeBaseId" +_QTT = "QueryTransformationType" +_QD = "QUERY_DECOMPOSITION" +_QTC = "QueryTransformationConfiguration" +_OC = "OrchestrationConfiguration" +_qTC = "queryTransformationConfiguration" +_FK = "FilterKey" +_FV = "FilterValue" +_FA = "FilterAttribute" +_ATt = "AttributeType" +_STRING = "STRING" +_NUMBER = "NUMBER" +_BOOLEAN = "BOOLEAN" +_SL = "STRING_LIST" +_MAS = "MetadataAttributeSchema" +_MASL = "MetadataAttributeSchemaList" +_IFC = "ImplicitFilterConfiguration" +_mAe = "metadataAttributes" +_ST = "SearchType" +_HYBRID = "HYBRID" +_SEMANTIC = "SEMANTIC" +_RMSM = "RerankingMetadataSelectionMode" +_ALL = "ALL" +_FFR = "FieldForReranking" +_fN = "fieldName" +_FFRi = "FieldsForReranking" +_RMSMC = "RerankingMetadataSelectiveModeConfiguration" +_fTI = "fieldsToInclude" +_fTE = "fieldsToExclude" +_MCFR = "MetadataConfigurationForReranking" +_sMe = "selectionMode" +_sMC = "selectiveModeConfiguration" +_BRMA = "BedrockRerankingModelArn" +_VSBRMC = "VectorSearchBedrockRerankingModelConfiguration" +_VSBRC = "VectorSearchBedrockRerankingConfiguration" +_mCo = "modelConfiguration" +_nORR = "numberOfRerankedResults" +_mCe = "metadataConfiguration" +_VSRCT = "VectorSearchRerankingConfigurationType" +_BRM = "BEDROCK_RERANKING_MODEL" +_VSRC = "VectorSearchRerankingConfiguration" +_bRC = "bedrockRerankingConfiguration" +_RAGT = "RetrieveAndGenerateType" +_KB = "KNOWLEDGE_BASE" +_ES_ = "EXTERNAL_SOURCES" +_EPRSI = "EvaluationPrecomputedRagSourceIdentifier" +_EPRAGSC = "EvaluationPrecomputedRetrieveAndGenerateSourceConfig" +_rSI = "ragSourceIdentifier" +_EPRSC = "EvaluationPrecomputedRetrieveSourceConfig" +_EPRSCv = "EvaluationPrecomputedRagSourceConfig" +_rSC = "retrieveSourceConfig" +_rAGSC = "retrieveAndGenerateSourceConfig" +_EJD = "EvaluationJobDescription" +_EJN = "EvaluationJobName" +_EODC = "EvaluationOutputDataConfig" +_EJA = "EvaluationJobArn" +_CEJO = "CreateEvaluationJobOutput" +_cCEJR = "com.amazonaws.bedrock#CreateEvaluationJobResponse" +_GEJI = "GetEvaluationJobInput" +_cGEJR = "com.amazonaws.bedrock#GetEvaluationJobRequest" +_EMr = "ErrorMessages" +_EJT = "EvaluationJobType" +_HUMAN = "HUMAN" +_H = "Human" +_AUTOMATED = "AUTOMATED" +_Au = "Automated" +_LEJI = "ListEvaluationJobsInput" +_cLEJR = "com.amazonaws.bedrock#ListEvaluationJobsRequest" +_aTE = "applicationTypeEquals" +_EMIva = "EvaluatorModelIdentifiers" +_ETTv = "EvaluationTaskTypes" +_EBMIv = "EvaluationBedrockModelIdentifiers" +_EPISIv = "EvaluationPrecomputedInferenceSourceIdentifiers" +_EMCS = "EvaluationModelConfigSummary" +_bMI = "bedrockModelIdentifiers" +_pISI = "precomputedInferenceSourceIdentifiers" +_EBKBI = "EvaluationBedrockKnowledgeBaseIdentifiers" +_EPRSIv = "EvaluationPrecomputedRagSourceIdentifiers" +_ERCS = "EvaluationRagConfigSummary" +_bKBI = "bedrockKnowledgeBaseIdentifiers" +_pRSI = "precomputedRagSourceIdentifiers" +_EICS = "EvaluationInferenceConfigSummary" +_mCS = "modelConfigSummary" +_rCS = "ragConfigSummary" +_ESv = "EvaluationSummary" +_jT = "jobType" +_eTT = "evaluationTaskTypes" +_mIod = "modelIdentifiers" +_rIa = "ragIdentifiers" +_eMI = "evaluatorModelIdentifiers" +_cMEMI = "customMetricsEvaluatorModelIdentifiers" +_iCS = "inferenceConfigSummary" +_aTp = "applicationType" +_ESva = "EvaluationSummaries" +_LEJO = "ListEvaluationJobsOutput" +_cLEJRo = "com.amazonaws.bedrock#ListEvaluationJobsResponse" +_LEJ = "ListEvaluationJobs" +_SEJI = "StopEvaluationJobInput" +_cSEJR = "com.amazonaws.bedrock#StopEvaluationJobRequest" +_SEJO = "StopEvaluationJobOutput" +_cSEJRo = "com.amazonaws.bedrock#StopEvaluationJobResponse" +_SEJ = "StopEvaluationJob" +_ARCFT = "AutomatedReasoningConfidenceFilterThreshold" +_ARPALut = "AutomatedReasoningPolicyArnList" +_GARPC = "GuardrailAutomatedReasoningPolicyConfig" +_po = "policies" +_GBM = "GuardrailBlockedMessaging" +_GCFA = "GuardrailContentFilterAction" +_BLOCK = "BLOCK" +_GM = "GuardrailModality" +_IMAGE = "IMAGE" +_GMu = "GuardrailModalities" +_GFS = "GuardrailFilterStrength" +_GCFT = "GuardrailContentFilterType" +_SEXUAL = "SEXUAL" +_VIOLENCE = "VIOLENCE" +_HATE = "HATE" +_INSULTS = "INSULTS" +_MISCONDUCT = "MISCONDUCT" +_PA = "PROMPT_ATTACK" +_GCFC = "GuardrailContentFilterConfig" +_iS = "inputStrength" +_oS = "outputStrength" +_iMn = "inputModalities" +_oM = "outputModalities" +_iA = "inputAction" +_oAu = "outputAction" +_iE = "inputEnabled" +_oE = "outputEnabled" +_GCFCu = "GuardrailContentFiltersConfig" +_GCFTN = "GuardrailContentFiltersTierName" +_CLASSIC = "CLASSIC" +_GCFTC = "GuardrailContentFiltersTierConfig" +_tNi = "tierName" +_GCPC = "GuardrailContentPolicyConfig" +_fC = "filtersConfig" +_tCi = "tierConfig" +_GCGA = "GuardrailContextualGroundingAction" +_GCGFT = "GuardrailContextualGroundingFilterType" +_GROUNDING = "GROUNDING" +_RELEVANCE = "RELEVANCE" +_GCGFC = "GuardrailContextualGroundingFilterConfig" +_th = "threshold" +_ac = "action" +_ena = "enabled" +_GCGFCu = "GuardrailContextualGroundingFiltersConfig" +_GCGPC = "GuardrailContextualGroundingPolicyConfig" +_GCRGPI = "GuardrailCrossRegionGuardrailProfileIdentifier" +_GCRC = "GuardrailCrossRegionConfig" +_gPI = "guardrailProfileIdentifier" +_GD = "GuardrailDescription" +_GN = "GuardrailName" +_GSIA = "GuardrailSensitiveInformationAction" +_ANONYMIZE = "ANONYMIZE" +_GPET = "GuardrailPiiEntityType" +_ADDRESS = "ADDRESS" +_AGE = "AGE" +_AAK = "AWS_ACCESS_KEY" +_ASK = "AWS_SECRET_KEY" +_CHN = "CA_HEALTH_NUMBER" +_CSIN = "CA_SOCIAL_INSURANCE_NUMBER" +_CDCC = "CREDIT_DEBIT_CARD_CVV" +_CDCE = "CREDIT_DEBIT_CARD_EXPIRY" +_CDCN = "CREDIT_DEBIT_CARD_NUMBER" +_DI = "DRIVER_ID" +_EMAIL = "EMAIL" +_IBAN = "INTERNATIONAL_BANK_ACCOUNT_NUMBER" +_IA = "IP_ADDRESS" +_LP = "LICENSE_PLATE" +_MA_ = "MAC_ADDRESS" +_NAME = "NAME" +_PASSWORD = "PASSWORD" +_PHONE = "PHONE" +_PIN = "PIN" +_SC = "SWIFT_CODE" +_UNHSN = "UK_NATIONAL_HEALTH_SERVICE_NUMBER" +_UNIN = "UK_NATIONAL_INSURANCE_NUMBER" +_UUTRN = "UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER" +_URL = "URL" +_USERNAME = "USERNAME" +_UBAN = "US_BANK_ACCOUNT_NUMBER" +_UBRN = "US_BANK_ROUTING_NUMBER" +_UITIN = "US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER" +_UPN = "US_PASSPORT_NUMBER" +_USSN = "US_SOCIAL_SECURITY_NUMBER" +_VIN = "VEHICLE_IDENTIFICATION_NUMBER" +_GPEC = "GuardrailPiiEntityConfig" +_GPECu = "GuardrailPiiEntitiesConfig" +_GRC = "GuardrailRegexConfig" +_pa = "pattern" +_GRCu = "GuardrailRegexesConfig" +_GSIPC = "GuardrailSensitiveInformationPolicyConfig" +_pEC = "piiEntitiesConfig" +_rCe = "regexesConfig" +_GTTN = "GuardrailTopicsTierName" +_GTTC = "GuardrailTopicsTierConfig" +_GTD = "GuardrailTopicDefinition" +_GTE = "GuardrailTopicExample" +_GTEu = "GuardrailTopicExamples" +_GTA = "GuardrailTopicAction" +_GTN = "GuardrailTopicName" +_GTT = "GuardrailTopicType" +_DENY = "DENY" +_GTCu = "GuardrailTopicConfig" +_exa = "examples" +_GTCua = "GuardrailTopicsConfig" +_GTPC = "GuardrailTopicPolicyConfig" +_tCop = "topicsConfig" +_GWA = "GuardrailWordAction" +_GMWT = "GuardrailManagedWordsType" +_PROFANITY = "PROFANITY" +_GMWC = "GuardrailManagedWordsConfig" +_GMWLC = "GuardrailManagedWordListsConfig" +_GWC = "GuardrailWordConfig" +_GWCu = "GuardrailWordsConfig" +_GWPC = "GuardrailWordPolicyConfig" +_wCo = "wordsConfig" +_mWLC = "managedWordListsConfig" +_CGI = "CreateGuardrailInput" +_cCGR = "com.amazonaws.bedrock#CreateGuardrailRequest" +_tPC = "topicPolicyConfig" +_cPC = "contentPolicyConfig" +_wPC = "wordPolicyConfig" +_sIPC = "sensitiveInformationPolicyConfig" +_cGPC = "contextualGroundingPolicyConfig" +_aRPC = "automatedReasoningPolicyConfig" +_cRC = "crossRegionConfig" +_bIM = "blockedInputMessaging" +_bOM = "blockedOutputsMessaging" +_GDV = "GuardrailDraftVersion" +_CGO = "CreateGuardrailOutput" +_cCGRo = "com.amazonaws.bedrock#CreateGuardrailResponse" +_CG = "CreateGuardrail" +_CGVI = "CreateGuardrailVersionInput" +_cCGVR = "com.amazonaws.bedrock#CreateGuardrailVersionRequest" +_CGVO = "CreateGuardrailVersionOutput" +_cCGVRo = "com.amazonaws.bedrock#CreateGuardrailVersionResponse" +_CGV = "CreateGuardrailVersion" +_DGI = "DeleteGuardrailInput" +_cDGR = "com.amazonaws.bedrock#DeleteGuardrailRequest" +_DGO = "DeleteGuardrailOutput" +_cDGRo = "com.amazonaws.bedrock#DeleteGuardrailResponse" +_DG = "DeleteGuardrail" +_GV = "GuardrailVersion" +_GGI = "GetGuardrailInput" +_cGGR = "com.amazonaws.bedrock#GetGuardrailRequest" +_GARPu = "GuardrailAutomatedReasoningPolicy" +_GCF = "GuardrailContentFilter" +_GCFu = "GuardrailContentFilters" +_GCFTu = "GuardrailContentFiltersTier" +_GCP = "GuardrailContentPolicy" +_fi = "filters" +_ti = "tier" +_GCGF = "GuardrailContextualGroundingFilter" +_GCGFu = "GuardrailContextualGroundingFilters" +_GCGP = "GuardrailContextualGroundingPolicy" +_GCRGPA = "GuardrailCrossRegionGuardrailProfileArn" +_GCRGPIu = "GuardrailCrossRegionGuardrailProfileId" +_GCRD = "GuardrailCrossRegionDetails" +_gPIu = "guardrailProfileId" +_gPA = "guardrailProfileArn" +_GFRu = "GuardrailFailureRecommendation" +_GFRua = "GuardrailFailureRecommendations" +_GPE = "GuardrailPiiEntity" +_GPEu = "GuardrailPiiEntities" +_GR = "GuardrailRegex" +_GRu = "GuardrailRegexes" +_GSIP = "GuardrailSensitiveInformationPolicy" +_pEi = "piiEntities" +_re = "regexes" +_GS = "GuardrailStatus" +_VERSIONING = "VERSIONING" +_READY = "READY" +_GSR = "GuardrailStatusReason" +_GSRu = "GuardrailStatusReasons" +_GTTu = "GuardrailTopicsTier" +_GT = "GuardrailTopic" +_GTu = "GuardrailTopics" +_GTP = "GuardrailTopicPolicy" +_to = "topics" +_GMW = "GuardrailManagedWords" +_GMWL = "GuardrailManagedWordLists" +_GW = "GuardrailWord" +_GWu = "GuardrailWords" +_GWP = "GuardrailWordPolicy" +_w = "words" +_mWL = "managedWordLists" +_GGO = "GetGuardrailOutput" +_cGGRo = "com.amazonaws.bedrock#GetGuardrailResponse" +_tPo = "topicPolicy" +_cP = "contentPolicy" +_wP = "wordPolicy" +_sIP = "sensitiveInformationPolicy" +_cGP = "contextualGroundingPolicy" +_aRP = "automatedReasoningPolicy" +_cRD = "crossRegionDetails" +_sRt = "statusReasons" +_fRa = "failureRecommendations" +_GG = "GetGuardrail" +_LGI = "ListGuardrailsInput" +_cLGR = "com.amazonaws.bedrock#ListGuardrailsRequest" +_GSu = "GuardrailSummary" +_arn = "arn" +_GSua = "GuardrailSummaries" +_LGO = "ListGuardrailsOutput" +_cLGRo = "com.amazonaws.bedrock#ListGuardrailsResponse" +_g = "guardrails" +_LG = "ListGuardrails" +_UGI = "UpdateGuardrailInput" +_cUGR = "com.amazonaws.bedrock#UpdateGuardrailRequest" +_UGO = "UpdateGuardrailOutput" +_cUGRo = "com.amazonaws.bedrock#UpdateGuardrailResponse" +_UG = "UpdateGuardrail" +_IPD = "InferenceProfileDescription" +_IPN = "InferenceProfileName" +_IPMSA = "InferenceProfileModelSourceArn" +_IPMS = "InferenceProfileModelSource" +_cF = "copyFrom" +_CIPI = "CreateInferenceProfileInput" +_cCIPR = "com.amazonaws.bedrock#CreateInferenceProfileRequest" +_iPN = "inferenceProfileName" +_mSod = "modelSource" +_IPA = "InferenceProfileArn" +_IPS = "InferenceProfileStatus" +_CIPO = "CreateInferenceProfileOutput" +_cCIPRo = "com.amazonaws.bedrock#CreateInferenceProfileResponse" +_iPA = "inferenceProfileArn" +_CIP = "CreateInferenceProfile" +_IPI = "InferenceProfileIdentifier" +_DIPI = "DeleteInferenceProfileInput" +_cDIPR = "com.amazonaws.bedrock#DeleteInferenceProfileRequest" +_iPI = "inferenceProfileIdentifier" +_DIPO = "DeleteInferenceProfileOutput" +_cDIPRo = "com.amazonaws.bedrock#DeleteInferenceProfileResponse" +_DIP = "DeleteInferenceProfile" +_GIPI = "GetInferenceProfileInput" +_cGIPR = "com.amazonaws.bedrock#GetInferenceProfileRequest" +_IPIn = "InferenceProfileId" +_IPM = "InferenceProfileModel" +_IPMn = "InferenceProfileModels" +_IPT = "InferenceProfileType" +_SD_ = "SYSTEM_DEFINED" +_APPLICATION = "APPLICATION" +_GIPO = "GetInferenceProfileOutput" +_cGIPRo = "com.amazonaws.bedrock#GetInferenceProfileResponse" +_mod = "models" +_iPIn = "inferenceProfileId" +_GIP = "GetInferenceProfile" +_LIPI = "ListInferenceProfilesInput" +_cLIPR = "com.amazonaws.bedrock#ListInferenceProfilesRequest" +_tE = "typeEquals" +_IPSn = "InferenceProfileSummary" +_IPSnf = "InferenceProfileSummaries" +_LIPO = "ListInferenceProfilesOutput" +_cLIPRo = "com.amazonaws.bedrock#ListInferenceProfilesResponse" +_iPS = "inferenceProfileSummaries" +_LIP = "ListInferenceProfiles" +_DMILCI = "DeleteModelInvocationLoggingConfigurationInput" +_cDMILCR = "com.amazonaws.bedrock#DeleteModelInvocationLoggingConfigurationRequest" +_DMILCO = "DeleteModelInvocationLoggingConfigurationOutput" +_cDMILCRo = "com.amazonaws.bedrock#DeleteModelInvocationLoggingConfigurationResponse" +_DMILC = "DeleteModelInvocationLoggingConfiguration" +_GMILCI = "GetModelInvocationLoggingConfigurationInput" +_cGMILCR = "com.amazonaws.bedrock#GetModelInvocationLoggingConfigurationRequest" +_BN = "BucketName" +_KP = "KeyPrefix" +_SCo = "S3Config" +_bN = "bucketName" +_kP = "keyPrefix" +_LGN = "LogGroupName" +_CWC = "CloudWatchConfig" +_lGN = "logGroupName" +_lDDSC = "largeDataDeliveryS3Config" +_LC = "LoggingConfig" +_cWC = "cloudWatchConfig" +_sCo = "s3Config" +_tDDE = "textDataDeliveryEnabled" +_iDDE = "imageDataDeliveryEnabled" +_eDDE = "embeddingDataDeliveryEnabled" +_vDDE = "videoDataDeliveryEnabled" +_aDDE = "audioDataDeliveryEnabled" +_GMILCO = "GetModelInvocationLoggingConfigurationOutput" +_cGMILCRo = "com.amazonaws.bedrock#GetModelInvocationLoggingConfigurationResponse" +_lC = "loggingConfig" +_GMILC = "GetModelInvocationLoggingConfiguration" +_PMILCI = "PutModelInvocationLoggingConfigurationInput" +_cPMILCR = "com.amazonaws.bedrock#PutModelInvocationLoggingConfigurationRequest" +_PMILCO = "PutModelInvocationLoggingConfigurationOutput" +_cPMILCRo = "com.amazonaws.bedrock#PutModelInvocationLoggingConfigurationResponse" +_PMILC = "PutModelInvocationLoggingConfiguration" +_CMCJI = "CreateModelCopyJobInput" +_cCMCJR = "com.amazonaws.bedrock#CreateModelCopyJobRequest" +_sMA = "sourceModelArn" +_tMN = "targetModelName" +_mKKI = "modelKmsKeyId" +_tMT = "targetModelTags" +_MCJAo = "ModelCopyJobArn" +_CMCJO = "CreateModelCopyJobOutput" +_cCMCJRo = "com.amazonaws.bedrock#CreateModelCopyJobResponse" +_CMCJ = "CreateModelCopyJob" +_GMCJI = "GetModelCopyJobInput" +_cGMCJR = "com.amazonaws.bedrock#GetModelCopyJobRequest" +_MCJS = "ModelCopyJobStatus" +_GMCJO = "GetModelCopyJobOutput" +_cGMCJRo = "com.amazonaws.bedrock#GetModelCopyJobResponse" +_tMA = "targetModelArn" +_sAI = "sourceAccountId" +_tMKKA = "targetModelKmsKeyArn" +_sMN = "sourceModelName" +_GMCJ = "GetModelCopyJob" +_LMCJI = "ListModelCopyJobsInput" +_cLMCJR = "com.amazonaws.bedrock#ListModelCopyJobsRequest" +_sAE = "sourceAccountEquals" +_sMAE = "sourceModelArnEquals" +_tMNC = "targetModelNameContains" +_oMNC = "outputModelNameContains" +_MCJSo = "ModelCopyJobSummary" +_MCJSod = "ModelCopyJobSummaries" +_LMCJO = "ListModelCopyJobsOutput" +_cLMCJRo = "com.amazonaws.bedrock#ListModelCopyJobsResponse" +_mCJS = "modelCopyJobSummaries" +_LMCJ = "ListModelCopyJobs" +_IMN = "ImportedModelName" +_CMIJI = "CreateModelImportJobInput" +_cCMIJR = "com.amazonaws.bedrock#CreateModelImportJobRequest" +_iMN = "importedModelName" +_mDSo = "modelDataSource" +_jTo = "jobTags" +_iMTm = "importedModelTags" +_vCp = "vpcConfig" +_iMKKI = "importedModelKmsKeyId" +_MIJA = "ModelImportJobArn" +_CMIJO = "CreateModelImportJobOutput" +_cCMIJRo = "com.amazonaws.bedrock#CreateModelImportJobResponse" +_CMIJ = "CreateModelImportJob" +_IMIm = "ImportedModelIdentifier" +_DIMI = "DeleteImportedModelInput" +_cDIMR = "com.amazonaws.bedrock#DeleteImportedModelRequest" +_DIMO = "DeleteImportedModelOutput" +_cDIMRo = "com.amazonaws.bedrock#DeleteImportedModelResponse" +_DIM = "DeleteImportedModel" +_GIMI = "GetImportedModelInput" +_cGIMR = "com.amazonaws.bedrock#GetImportedModelRequest" +_CMUV = "CustomModelUnitsVersion" +_CMU = "CustomModelUnits" +_cMUPMC = "customModelUnitsPerModelCopy" +_cMUV = "customModelUnitsVersion" +_IS = "InstructSupported" +_IMA = "ImportedModelArn" +_GIMO = "GetImportedModelOutput" +_cGIMRo = "com.amazonaws.bedrock#GetImportedModelResponse" +_mAo = "modelArchitecture" +_iSn = "instructSupported" +_cMU = "customModelUnits" +_GIM = "GetImportedModel" +_MIJI = "ModelImportJobIdentifier" +_GMIJI = "GetModelImportJobInput" +_cGMIJR = "com.amazonaws.bedrock#GetModelImportJobRequest" +_MIJS = "ModelImportJobStatus" +_GMIJO = "GetModelImportJobOutput" +_cGMIJRo = "com.amazonaws.bedrock#GetModelImportJobResponse" +_iMA = "importedModelArn" +_eT = "endTime" +_iMKKA = "importedModelKmsKeyArn" +_GMIJ = "GetModelImportJob" +_LIMI = "ListImportedModelsInput" +_cLIMR = "com.amazonaws.bedrock#ListImportedModelsRequest" +_MAo = "ModelArchitecture" +_IMS = "ImportedModelSummary" +_IMSL = "ImportedModelSummaryList" +_LIMO = "ListImportedModelsOutput" +_cLIMRo = "com.amazonaws.bedrock#ListImportedModelsResponse" +_LIM = "ListImportedModels" +_LMIJI = "ListModelImportJobsInput" +_cLMIJR = "com.amazonaws.bedrock#ListModelImportJobsRequest" +_MIJSo = "ModelImportJobSummary" +_MIJSod = "ModelImportJobSummaries" +_LMIJO = "ListModelImportJobsOutput" +_cLMIJRo = "com.amazonaws.bedrock#ListModelImportJobsResponse" +_mIJS = "modelImportJobSummaries" +_LMIJ = "ListModelImportJobs" +_MIIT = "ModelInvocationIdempotencyToken" +_SIF = "S3InputFormat" +_JSONL = "JSONL" +_MIJSIDC = "ModelInvocationJobS3InputDataConfig" +_sIF = "s3InputFormat" +_sBO = "s3BucketOwner" +_MIJIDC = "ModelInvocationJobInputDataConfig" +_sIDC = "s3InputDataConfig" +_MIJN = "ModelInvocationJobName" +_MIo = "ModelId" +_MIT = "ModelInvocationType" +_IM = "InvokeModel" +_Co = "Converse" +_MIJSODC = "ModelInvocationJobS3OutputDataConfig" +_sEKI = "s3EncryptionKeyId" +_MIJODC = "ModelInvocationJobOutputDataConfig" +_sODC = "s3OutputDataConfig" +_MIJTDIH = "ModelInvocationJobTimeoutDurationInHours" +_CMIJIr = "CreateModelInvocationJobInput" +_cCMIJRom = "com.amazonaws.bedrock#CreateModelInvocationJobRequest" +_iDC = "inputDataConfig" +_tDIH = "timeoutDurationInHours" +_mIT = "modelInvocationType" +_MIJAo = "ModelInvocationJobArn" +_CMIJOr = "CreateModelInvocationJobOutput" +_cCMIJRoma = "com.amazonaws.bedrock#CreateModelInvocationJobResponse" +_CMIJr = "CreateModelInvocationJob" +_MIJIo = "ModelInvocationJobIdentifier" +_GMIJIe = "GetModelInvocationJobInput" +_cGMIJRom = "com.amazonaws.bedrock#GetModelInvocationJobRequest" +_NNL = "NonNegativeLong" +_M = "Message" +_MIJSode = "ModelInvocationJobStatus" +_SUBMITTED = "SUBMITTED" +_Sub = "Submitted" +_EXPIRED = "EXPIRED" +_E = "Expired" +_VALIDATING = "VALIDATING" +_Val = "Validating" +_Sc = "Scheduled" +_GMIJOe = "GetModelInvocationJobOutput" +_cGMIJRoma = "com.amazonaws.bedrock#GetModelInvocationJobResponse" +_sTu = "submitTime" +_jET = "jobExpirationTime" +_tRC = "totalRecordCount" +_pRC = "processedRecordCount" +_sRC = "successRecordCount" +_eRC = "errorRecordCount" +_GMIJe = "GetModelInvocationJob" +_LMIJIi = "ListModelInvocationJobsInput" +_cLMIJRom = "com.amazonaws.bedrock#ListModelInvocationJobsRequest" +_sTA = "submitTimeAfter" +_sTB = "submitTimeBefore" +_MIJSodel = "ModelInvocationJobSummary" +_MIJSodeln = "ModelInvocationJobSummaries" +_LMIJOi = "ListModelInvocationJobsOutput" +_cLMIJRoma = "com.amazonaws.bedrock#ListModelInvocationJobsResponse" +_iJS = "invocationJobSummaries" +_LMIJi = "ListModelInvocationJobs" +_SMIJI = "StopModelInvocationJobInput" +_cSMIJR = "com.amazonaws.bedrock#StopModelInvocationJobRequest" +_SMIJO = "StopModelInvocationJobOutput" +_cSMIJRo = "com.amazonaws.bedrock#StopModelInvocationJobResponse" +_SMIJ = "StopModelInvocationJob" +_GFMI = "GetFoundationModelIdentifier" +_GFMIe = "GetFoundationModelInput" +_cGFMR = "com.amazonaws.bedrock#GetFoundationModelRequest" +_MCod = "ModelCustomization" +_MCL = "ModelCustomizationList" +_ITnf = "InferenceType" +_OD = "ON_DEMAND" +_PROVISIONED = "PROVISIONED" +_ITL = "InferenceTypeList" +_MM = "ModelModality" +_EMBEDDING = "EMBEDDING" +_MML = "ModelModalityList" +_BMI = "BedrockModelId" +_FMLS = "FoundationModelLifecycleStatus" +_LEGACY = "LEGACY" +_FML = "FoundationModelLifecycle" +_sOLT = "startOfLifeTime" +_eOLT = "endOfLifeTime" +_lTe = "legacyTime" +_pEAT = "publicExtendedAccessTime" +_BNr = "BrandedName" +_FMD = "FoundationModelDetails" +_pNr = "providerName" +_rSS = "responseStreamingSupported" +_cSu = "customizationsSupported" +_iTS = "inferenceTypesSupported" +_mL = "modelLifecycle" +_GFMO = "GetFoundationModelOutput" +_cGFMRo = "com.amazonaws.bedrock#GetFoundationModelResponse" +_mD = "modelDetails" +_GFM = "GetFoundationModel" +_P = "Provider" +_LFMI = "ListFoundationModelsInput" +_cLFMR = "com.amazonaws.bedrock#ListFoundationModelsRequest" +_bP = "byProvider" +_bCT = "byCustomizationType" +_bOMy = "byOutputModality" +_bIT = "byInferenceType" +_FMS = "FoundationModelSummary" +_FMSL = "FoundationModelSummaryList" +_LFMO = "ListFoundationModelsOutput" +_cLFMRo = "com.amazonaws.bedrock#ListFoundationModelsResponse" +_LFM = "ListFoundationModels" +_PRD = "PromptRouterDescription" +_PRTMA = "PromptRouterTargetModelArn" +_PRTM = "PromptRouterTargetModel" +_PRTMr = "PromptRouterTargetModels" +_PRN = "PromptRouterName" +_RC = "RoutingCriteria" +_rQD = "responseQualityDifference" +_CPRI = "CreatePromptRouterInput" +_cCPRR = "com.amazonaws.bedrock#CreatePromptRouterRequest" +_pRN = "promptRouterName" +_rCo = "routingCriteria" +_fMa = "fallbackModel" +_PRA = "PromptRouterArn" +_CPRO = "CreatePromptRouterOutput" +_cCPRRo = "com.amazonaws.bedrock#CreatePromptRouterResponse" +_pRAr = "promptRouterArn" +_CPR = "CreatePromptRouter" +_DPRI = "DeletePromptRouterInput" +_cDPRR = "com.amazonaws.bedrock#DeletePromptRouterRequest" +_DPRO = "DeletePromptRouterOutput" +_cDPRRo = "com.amazonaws.bedrock#DeletePromptRouterResponse" +_DPR = "DeletePromptRouter" +_GPRI = "GetPromptRouterInput" +_cGPRR = "com.amazonaws.bedrock#GetPromptRouterRequest" +_PRS = "PromptRouterStatus" +_PRT = "PromptRouterType" +_cu = "custom" +_GPRO = "GetPromptRouterOutput" +_cGPRRo = "com.amazonaws.bedrock#GetPromptRouterResponse" +_GPR = "GetPromptRouter" +_LPRI = "ListPromptRoutersInput" +_cLPRR = "com.amazonaws.bedrock#ListPromptRoutersRequest" +_PRSr = "PromptRouterSummary" +_PRSro = "PromptRouterSummaries" +_LPRO = "ListPromptRoutersOutput" +_cLPRRo = "com.amazonaws.bedrock#ListPromptRoutersResponse" +_pRS = "promptRouterSummaries" +_LPR = "ListPromptRouters" +_CD = "CommitmentDuration" +_OM = "ONE_MONTH" +_OMn = "OneMonth" +_SM = "SIX_MONTHS" +_SMi = "SixMonths" +_PI = "PositiveInteger" +_PMN = "ProvisionedModelName" +_CPMTI = "CreateProvisionedModelThroughputInput" +_cCPMTR = "com.amazonaws.bedrock#CreateProvisionedModelThroughputRequest" +_mU = "modelUnits" +_pMN = "provisionedModelName" +_cD = "commitmentDuration" +_PMA = "ProvisionedModelArn" +_CPMTO = "CreateProvisionedModelThroughputOutput" +_cCPMTRo = "com.amazonaws.bedrock#CreateProvisionedModelThroughputResponse" +_pMA = "provisionedModelArn" +_CPMT = "CreateProvisionedModelThroughput" +_PMI = "ProvisionedModelId" +_DPMTI = "DeleteProvisionedModelThroughputInput" +_cDPMTR = "com.amazonaws.bedrock#DeleteProvisionedModelThroughputRequest" +_pMI = "provisionedModelId" +_DPMTO = "DeleteProvisionedModelThroughputOutput" +_cDPMTRo = "com.amazonaws.bedrock#DeleteProvisionedModelThroughputResponse" +_DPMT = "DeleteProvisionedModelThroughput" +_GPMTI = "GetProvisionedModelThroughputInput" +_cGPMTR = "com.amazonaws.bedrock#GetProvisionedModelThroughputRequest" +_PMS = "ProvisionedModelStatus" +_IS_ = "IN_SERVICE" +_ISn = "InService" +_GPMTO = "GetProvisionedModelThroughputOutput" +_cGPMTRo = "com.amazonaws.bedrock#GetProvisionedModelThroughputResponse" +_dMU = "desiredModelUnits" +_dMA = "desiredModelArn" +_fMA = "foundationModelArn" +_cET = "commitmentExpirationTime" +_GPMT = "GetProvisionedModelThroughput" +_SBPM = "SortByProvisionedModels" +_LPMTI = "ListProvisionedModelThroughputsInput" +_cLPMTR = "com.amazonaws.bedrock#ListProvisionedModelThroughputsRequest" +_PMSr = "ProvisionedModelSummary" +_PMSro = "ProvisionedModelSummaries" +_LPMTO = "ListProvisionedModelThroughputsOutput" +_cLPMTRo = "com.amazonaws.bedrock#ListProvisionedModelThroughputsResponse" +_pMS = "provisionedModelSummaries" +_LPMT = "ListProvisionedModelThroughputs" +_UPMTI = "UpdateProvisionedModelThroughputInput" +_cUPMTR = "com.amazonaws.bedrock#UpdateProvisionedModelThroughputRequest" +_dPMN = "desiredProvisionedModelName" +_dMI = "desiredModelId" +_UPMTO = "UpdateProvisionedModelThroughputOutput" +_cUPMTRo = "com.amazonaws.bedrock#UpdateProvisionedModelThroughputResponse" +_UPMT = "UpdateProvisionedModelThroughput" +_RPRA = "ResourcePolicyResourceArn" +_DRPI = "DeleteResourcePolicyInput" +_cDRPR = "com.amazonaws.bedrock#DeleteResourcePolicyRequest" +_rAe = "resourceArn" +_DRPO = "DeleteResourcePolicyOutput" +_cDRPRo = "com.amazonaws.bedrock#DeleteResourcePolicyResponse" +_DRP = "DeleteResourcePolicy" +_GRPI = "GetResourcePolicyInput" +_cGRPR = "com.amazonaws.bedrock#GetResourcePolicyRequest" +_RPD = "ResourcePolicyDocument" +_GRPO = "GetResourcePolicyOutput" +_cGRPRo = "com.amazonaws.bedrock#GetResourcePolicyResponse" +_rP = "resourcePolicy" +_GRP = "GetResourcePolicy" +_PRPI = "PutResourcePolicyInput" +_cPRPR = "com.amazonaws.bedrock#PutResourcePolicyRequest" +_PRPO = "PutResourcePolicyOutput" +_cPRPRo = "com.amazonaws.bedrock#PutResourcePolicyResponse" +_PRP = "PutResourcePolicy" +_OT = "OfferToken" +_CFMAI = "CreateFoundationModelAgreementInput" +_cCFMAR = "com.amazonaws.bedrock#CreateFoundationModelAgreementRequest" +_oT = "offerToken" +_CFMAO = "CreateFoundationModelAgreementOutput" +_cCFMARo = "com.amazonaws.bedrock#CreateFoundationModelAgreementResponse" +_CFMA = "CreateFoundationModelAgreement" +_DFMAI = "DeleteFoundationModelAgreementInput" +_cDFMAR = "com.amazonaws.bedrock#DeleteFoundationModelAgreementRequest" +_DFMAO = "DeleteFoundationModelAgreementOutput" +_cDFMARo = "com.amazonaws.bedrock#DeleteFoundationModelAgreementResponse" +_DFMA = "DeleteFoundationModelAgreement" +_GFMAI = "GetFoundationModelAvailabilityInput" +_cGFMAR = "com.amazonaws.bedrock#GetFoundationModelAvailabilityRequest" +_ASu = "AuthorizationStatus" +_AUTHORIZED = "AUTHORIZED" +_NA_ = "NOT_AUTHORIZED" +_EA = "EntitlementAvailability" +_RAe = "RegionAvailability" +_GFMAO = "GetFoundationModelAvailabilityOutput" +_cGFMARo = "com.amazonaws.bedrock#GetFoundationModelAvailabilityResponse" +_aAg = "agreementAvailability" +_aSu = "authorizationStatus" +_eAn = "entitlementAvailability" +_rAeg = "regionAvailability" +_GFMA = "GetFoundationModelAvailability" +_OTf = "OfferType" +_PUBLIC = "PUBLIC" +_LFMAOI = "ListFoundationModelAgreementOffersInput" +_cLFMAOR = "com.amazonaws.bedrock#ListFoundationModelAgreementOffersRequest" +_oTf = "offerType" +_OI = "OfferId" +_LT = "LegalTerm" +_ur = "url" +_STu = "SupportTerm" +_rPD = "refundPolicyDescription" +_DPRi = "DimensionalPriceRate" +_di = "dimension" +_pri = "price" +_un = "unit" +_RCa = "RateCard" +_PTri = "PricingTerm" +_rCa = "rateCard" +_VT = "ValidityTerm" +_aD = "agreementDuration" +_TD = "TermDetails" +_uBPT = "usageBasedPricingTerm" +_lTeg = "legalTerm" +_sTup = "supportTerm" +_vT = "validityTerm" +_O = "Offer" +_oI = "offerId" +_tD = "termDetails" +_Of = "Offers" +_LFMAOO = "ListFoundationModelAgreementOffersOutput" +_cLFMAORo = "com.amazonaws.bedrock#ListFoundationModelAgreementOffersResponse" +_of = "offers" +_LFMAO = "ListFoundationModelAgreementOffers" +_LTFRI = "ListTagsForResourceInput" +_cLTFRR = "com.amazonaws.bedrock#ListTagsForResourceRequest" +_rARN = "resourceARN" +_LTFRO = "ListTagsForResourceOutput" +_cLTFRRo = "com.amazonaws.bedrock#ListTagsForResourceResponse" +_LTFR = "ListTagsForResource" +_TRI = "TagResourceInput" +_cTRR = "com.amazonaws.bedrock#TagResourceRequest" +_TRO = "TagResourceOutput" +_cTRRo = "com.amazonaws.bedrock#TagResourceResponse" +_TR = "TagResource" +_TKL = "TagKeyList" +_URI = "UntagResourceInput" +_cURR = "com.amazonaws.bedrock#UntagResourceRequest" +_tK = "tagKeys" +_URO = "UntagResourceOutput" +_cURRo = "com.amazonaws.bedrock#UntagResourceResponse" +_UR = "UntagResource" +_BMIa = "BaseModelIdentifier" +_CMCJIr = "CreateModelCustomizationJobInput" +_cCMCJRom = "com.amazonaws.bedrock#CreateModelCustomizationJobRequest" +_cMN = "customModelName" +_bMIa = "baseModelIdentifier" +_cMKKI = "customModelKmsKeyId" +_cMT = "customModelTags" +_CMCJOr = "CreateModelCustomizationJobOutput" +_cCMCJRoma = "com.amazonaws.bedrock#CreateModelCustomizationJobResponse" +_CMCJr = "CreateModelCustomizationJob" +_MCJI = "ModelCustomizationJobIdentifier" +_GMCJIe = "GetModelCustomizationJobInput" +_cGMCJRom = "com.amazonaws.bedrock#GetModelCustomizationJobRequest" +_MCJSode = "ModelCustomizationJobStatus" +_JSD = "JobStatusDetails" +_NSo = "NotStarted" +_DPD = "DataProcessingDetails" +_TDr = "TrainingDetails" +_VD = "ValidationDetails" +_SDt = "StatusDetails" +_vD = "validationDetails" +_dPD = "dataProcessingDetails" +_tDr = "trainingDetails" +_GMCJOe = "GetModelCustomizationJobOutput" +_cGMCJRoma = "com.amazonaws.bedrock#GetModelCustomizationJobResponse" +_oMN = "outputModelName" +_oMA = "outputModelArn" +_sD = "statusDetails" +_oMKKA = "outputModelKmsKeyArn" +_GMCJe = "GetModelCustomizationJob" +_FTJS = "FineTuningJobStatus" +_LMCJIi = "ListModelCustomizationJobsInput" +_cLMCJRom = "com.amazonaws.bedrock#ListModelCustomizationJobsRequest" +_MCJSodel = "ModelCustomizationJobSummary" +_cMA = "customModelArn" +_MCJSodelu = "ModelCustomizationJobSummaries" +_LMCJOi = "ListModelCustomizationJobsOutput" +_cLMCJRoma = "com.amazonaws.bedrock#ListModelCustomizationJobsResponse" +_mCJSo = "modelCustomizationJobSummaries" +_LMCJi = "ListModelCustomizationJobs" +_SMCJI = "StopModelCustomizationJobInput" +_cSMCJR = "com.amazonaws.bedrock#StopModelCustomizationJobRequest" +_SMCJO = "StopModelCustomizationJobOutput" +_cSMCJRo = "com.amazonaws.bedrock#StopModelCustomizationJobResponse" +_SMCJ = "StopModelCustomizationJob" +_RF = "RetrievalFilter" +_gT = "greaterThan" +_gTOE = "greaterThanOrEquals" +_lTes = "lessThan" +_lTOE = "lessThanOrEquals" +_in_ = "in" +_nI = "notIn" +_sW = "startsWith" +_lCi = "listContains" +_sCt = "stringContains" +_RFL = "RetrievalFilterList" +_KBVSC = "KnowledgeBaseVectorSearchConfiguration" +_nOR = "numberOfResults" +_oST = "overrideSearchType" +_fil = "filter" +_iFC = "implicitFilterConfiguration" +_rCer = "rerankingConfiguration" +_KBRC = "KnowledgeBaseRetrievalConfiguration" +_vSC = "vectorSearchConfiguration" +_KBRAGC = "KnowledgeBaseRetrieveAndGenerateConfiguration" +_kBI = "knowledgeBaseId" +_rCet = "retrievalConfiguration" +_oCr = "orchestrationConfiguration" +_RCe = "RetrieveConfig" +_kBRC = "knowledgeBaseRetrievalConfiguration" +_RAGC = "RetrieveAndGenerateConfiguration" +_kBC = "knowledgeBaseConfiguration" +_eSC = "externalSourcesConfiguration" +_KBC = "KnowledgeBaseConfig" +_rCetr = "retrieveConfig" +_rAGC = "retrieveAndGenerateConfig" +_RAGCo = "RAGConfig" +_kBCn = "knowledgeBaseConfig" +_pRSC = "precomputedRagSourceConfig" +_RCag = "RagConfigs" +_EIC = "EvaluationInferenceConfig" +_rCag = "ragConfigs" +_CEJI = "CreateEvaluationJobInput" +_cCEJRo = "com.amazonaws.bedrock#CreateEvaluationJobRequest" +_cEKI = "customerEncryptionKeyId" +_eCv = "evaluationConfig" +_GEJO = "GetEvaluationJobOutput" +_cGEJRo = "com.amazonaws.bedrock#GetEvaluationJobResponse" +_fMai = "failureMessages" +_CEJ = "CreateEvaluationJob" +_GEJ = "GetEvaluationJob" +_ABCPS = "AmazonBedrockControlPlaneService" +_aw = "aws.auth#sigv4" +_sBm = "smithy.rules#endpointBdd" +_aws = "aws.api#service" +_aJw = "aws.protocols#restJson1" +_sBA = "smithy.api#httpBearerAuth" + +ACCEPT_EULA: StaticSchema = (2, n0, _AE, {_s: False}) + +NON_BLANK_STRING: StaticSchema = (3, n0, _NBS, 0) + +ACCESS_DENIED_EXCEPTION: StaticSchema = ( + 18, + n0, + _ADE, + {_sm: _c, _sE: 403}, + (_m,), + ((NON_BLANK_STRING, 0),), +) + +ACCOUNT_ENFORCED_GUARDRAIL_CONFIGURATION_ID: StaticSchema = (3, n0, _AEGCI, 0) + +GUARDRAIL_IDENTIFIER: StaticSchema = (3, n0, _GI, 0) + +GUARDRAIL_NUMERICAL_VERSION: StaticSchema = (3, n0, _GNV, 0) + +EXCLUDED_MODEL_ID: StaticSchema = (3, n0, _EMI, 0) + +EXCLUDED_MODELS_LIST: StaticSchema = ( + 16, + n0, + _EML, + 0, + (_me,), + ((EXCLUDED_MODEL_ID, 0),), +) + +INCLUDED_MODEL_ID: StaticSchema = (3, n0, _IMI, 0) + +INCLUDED_MODELS_LIST: StaticSchema = ( + 16, + n0, + _IML, + 0, + (_me,), + ((INCLUDED_MODEL_ID, 0),), +) + +MODEL_ENFORCEMENT: StaticSchema = ( + 18, + n0, + _ME, + 0, + (_iM, _eM), + ((INCLUDED_MODELS_LIST, 1), (EXCLUDED_MODELS_LIST, 1)), +) + +SELECTIVE_GUARDING_MODE: StaticSchema = ( + 14, + n0, + _SGM, + 0, + (_SELECTIVE, _COMPREHENSIVE), + ((-1, {_sV: _SELECTIVE}), (-1, {_sV: _COMPREHENSIVE})), +) + +SELECTIVE_CONTENT_GUARDING: StaticSchema = ( + 18, + n0, + _SCG, + 0, + (_sy, _mes), + ((SELECTIVE_GUARDING_MODE, 0), (SELECTIVE_GUARDING_MODE, 0)), +) + +ACCOUNT_ENFORCED_GUARDRAIL_INFERENCE_INPUT_CONFIGURATION: StaticSchema = ( + 18, + n0, + _AEGIIC, + 0, + (_gI, _gV, _sCG, _mE), + ( + (GUARDRAIL_IDENTIFIER, 1), + (GUARDRAIL_NUMERICAL_VERSION, 1), + (SELECTIVE_CONTENT_GUARDING, 0), + (MODEL_ENFORCEMENT, 0), + ), ) -ACCESS_DENIED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AccessDeniedException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=403), - ], - members={"message": {"target": NON_BLANK_STRING}}, +TIMESTAMP: StaticSchema = (4, n0, _T, {_sF: _dt}) + +GUARDRAIL_ARN: StaticSchema = (3, n0, _GA, 0) + +GUARDRAIL_ID: StaticSchema = (3, n0, _GIu, 0) + +INPUT_TAGS: StaticSchema = ( + 14, + n0, + _IT, + 0, + (_HONOR, _IGNORE), + ((-1, {_sV: _HONOR}), (-1, {_sV: _IGNORE})), +) + +CONFIGURATION_OWNER: StaticSchema = (3, n0, _CO, 0) + +ACCOUNT_ENFORCED_GUARDRAIL_OUTPUT_CONFIGURATION: StaticSchema = ( + 18, + n0, + _AEGOC, + 0, + (_cI, _gA, _gIu, _iT, _sCG, _gV, _cA, _cB, _uA, _uB, _o, _mE), + ( + (ACCOUNT_ENFORCED_GUARDRAIL_CONFIGURATION_ID, 0), + (GUARDRAIL_ARN, 0), + (GUARDRAIL_ID, 0), + (INPUT_TAGS, 0), + (SELECTIVE_CONTENT_GUARDING, 0), + (GUARDRAIL_NUMERICAL_VERSION, 0), + (TIMESTAMP, 0), + (3, 0), + (TIMESTAMP, 0), + (3, 0), + (CONFIGURATION_OWNER, 0), + (MODEL_ENFORCEMENT, 0), + ), ) -ACCOUNT_ENFORCED_GUARDRAIL_CONFIGURATION_ID = Schema( - id=ShapeID("com.amazonaws.bedrock#AccountEnforcedGuardrailConfigurationId"), - shape_type=ShapeType.STRING, +ACCOUNT_ENFORCED_GUARDRAILS_OUTPUT_CONFIGURATION: StaticSchema = ( + 16, + n0, + _AEGOCc, + 0, + (_me,), + ((ACCOUNT_ENFORCED_GUARDRAIL_OUTPUT_CONFIGURATION, 0),), ) -GUARDRAIL_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrock#GuardrailIdentifier"), shape_type=ShapeType.STRING -) +ACCOUNT_ID: StaticSchema = (3, n0, _AI, 0) -GUARDRAIL_NUMERICAL_VERSION = Schema( - id=ShapeID("com.amazonaws.bedrock#GuardrailNumericalVersion"), - shape_type=ShapeType.STRING, -) +ACKNOWLEDGEMENT_FORM_DATA_BODY: StaticSchema = (1, n0, _AFDB, 0) -EXCLUDED_MODEL_ID = Schema( - id=ShapeID("com.amazonaws.bedrock#ExcludedModelId"), shape_type=ShapeType.STRING -) +ADDITIONAL_MODEL_REQUEST_FIELDS_KEY: StaticSchema = (3, n0, _AMRFK, 0) -EXCLUDED_MODELS_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ExcludedModelsList"), - shape_type=ShapeType.LIST, - members={"member": {"target": EXCLUDED_MODEL_ID}}, -) +ADDITIONAL_MODEL_REQUEST_FIELDS_VALUE: StaticSchema = (13, n0, _AMRFV, 0) -INCLUDED_MODEL_ID = Schema( - id=ShapeID("com.amazonaws.bedrock#IncludedModelId"), shape_type=ShapeType.STRING +ADDITIONAL_MODEL_REQUEST_FIELDS: StaticSchema = ( + 17, + n0, + _AMRF, + 0, + (_k, _v), + ( + (ADDITIONAL_MODEL_REQUEST_FIELDS_KEY, 0), + (ADDITIONAL_MODEL_REQUEST_FIELDS_VALUE, 0), + ), ) -INCLUDED_MODELS_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#IncludedModelsList"), - shape_type=ShapeType.LIST, - members={"member": {"target": INCLUDED_MODEL_ID}}, -) +S3_URI: StaticSchema = (3, n0, _SU, 0) -MODEL_ENFORCEMENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ModelEnforcement"), - members={ - "includedModels": { - "target": INCLUDED_MODELS_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "excludedModels": { - "target": EXCLUDED_MODELS_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +ADVANCED_PROMPT_OPTIMIZATION_INPUT_CONFIG: StaticSchema = ( + 18, + n0, + _APOIC, + 0, + (_sU,), + ((S3_URI, 1),), ) -SELECTIVE_GUARDING_MODE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#SelectiveGuardingMode"), - shape_type=ShapeType.ENUM, - members={"SELECTIVE": {"target": UNIT}, "COMPREHENSIVE": {"target": UNIT}}, -) +ADVANCED_PROMPT_OPTIMIZATION_JOB_ARN: StaticSchema = (3, n0, _APOJA, 0) -SELECTIVE_CONTENT_GUARDING = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#SelectiveContentGuarding"), - members={ - "system": {"target": SELECTIVE_GUARDING_MODE}, - "messages": {"target": SELECTIVE_GUARDING_MODE}, - }, -) +ADVANCED_PROMPT_OPTIMIZATION_JOB_DESCRIPTION: StaticSchema = (3, n0, _APOJD, 0) -ACCOUNT_ENFORCED_GUARDRAIL_INFERENCE_INPUT_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrock#AccountEnforcedGuardrailInferenceInputConfiguration" - ), - members={ - "guardrailIdentifier": { - "target": GUARDRAIL_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "guardrailVersion": { - "target": GUARDRAIL_NUMERICAL_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "selectiveContentGuarding": {"target": SELECTIVE_CONTENT_GUARDING}, - "modelEnforcement": {"target": MODEL_ENFORCEMENT}, - }, -) +ADVANCED_PROMPT_OPTIMIZATION_JOB_IDENTIFIER: StaticSchema = (3, n0, _APOJI, 0) -TIMESTAMP = Schema( - id=ShapeID("com.amazonaws.bedrock#Timestamp"), - shape_type=ShapeType.TIMESTAMP, - traits=[Trait.new(id=ShapeID("smithy.api#timestampFormat"), value="date-time")], +ADVANCED_PROMPT_OPTIMIZATION_JOB_IDENTIFIERS: StaticSchema = ( + 16, + n0, + _APOJId, + 0, + (_me,), + ((ADVANCED_PROMPT_OPTIMIZATION_JOB_IDENTIFIER, 0),), ) -GUARDRAIL_ARN = Schema( - id=ShapeID("com.amazonaws.bedrock#GuardrailArn"), shape_type=ShapeType.STRING -) +ADVANCED_PROMPT_OPTIMIZATION_JOB_NAME: StaticSchema = (3, n0, _APOJN, 0) -GUARDRAIL_ID = Schema( - id=ShapeID("com.amazonaws.bedrock#GuardrailId"), shape_type=ShapeType.STRING +BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT: StaticSchema = ( + 18, + n0, + _BDAPOJI, + {_sSI: _cBDAPOJR, _smit: None}, + (_jI,), + ((ADVANCED_PROMPT_OPTIMIZATION_JOB_IDENTIFIERS, 1),), ) -INPUT_TAGS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#InputTags"), - shape_type=ShapeType.ENUM, - members={"HONOR": {"target": UNIT}, "IGNORE": {"target": UNIT}}, +ADVANCED_PROMPT_OPTIMIZATION_JOB_STATUS: StaticSchema = ( + 14, + n0, + _APOJS, + 0, + (_IP, _COMPLETED, _FAILED, _PC, _STOPPING, _STOPPED, _DELETING), + ( + (-1, {_sV: _IPn}), + (-1, {_sV: _C}), + (-1, {_sV: _F}), + (-1, {_sV: _PCa}), + (-1, {_sV: _S}), + (-1, {_sV: _St}), + (-1, {_sV: _D}), + ), ) -CONFIGURATION_OWNER = Schema( - id=ShapeID("com.amazonaws.bedrock#ConfigurationOwner"), shape_type=ShapeType.STRING +BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_ITEM: StaticSchema = ( + 18, + n0, + _BDAPOJIa, + 0, + (_jIo, _jS), + ( + (ADVANCED_PROMPT_OPTIMIZATION_JOB_IDENTIFIER, 1), + (ADVANCED_PROMPT_OPTIMIZATION_JOB_STATUS, 1), + ), ) -ACCOUNT_ENFORCED_GUARDRAIL_OUTPUT_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AccountEnforcedGuardrailOutputConfiguration"), - members={ - "configId": {"target": ACCOUNT_ENFORCED_GUARDRAIL_CONFIGURATION_ID}, - "guardrailArn": {"target": GUARDRAIL_ARN}, - "guardrailId": {"target": GUARDRAIL_ID}, - "inputTags": {"target": INPUT_TAGS}, - "selectiveContentGuarding": {"target": SELECTIVE_CONTENT_GUARDING}, - "guardrailVersion": {"target": GUARDRAIL_NUMERICAL_VERSION}, - "createdAt": {"target": TIMESTAMP}, - "createdBy": {"target": STRING}, - "updatedAt": {"target": TIMESTAMP}, - "updatedBy": {"target": STRING}, - "owner": {"target": CONFIGURATION_OWNER}, - "modelEnforcement": {"target": MODEL_ENFORCEMENT}, - }, +BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_ITEMS: StaticSchema = ( + 16, + n0, + _BDAPOJIat, + 0, + (_me,), + ((BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_ITEM, 0),), +) + +BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_ERROR: StaticSchema = ( + 18, + n0, + _BDAPOJE, + 0, + (_jIo, _co, _m), + ((ADVANCED_PROMPT_OPTIMIZATION_JOB_IDENTIFIER, 1), (3, 1), (3, 0)), +) + +BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_ERRORS: StaticSchema = ( + 16, + n0, + _BDAPOJEa, + 0, + (_me,), + ((BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_ERROR, 0),), +) + +BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT: StaticSchema = ( + 18, + n0, + _BDAPOJO, + {_sSI: _cBDAPOJRo, _smith: None}, + (_e, _aPOJ), + ( + (BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_ERRORS, 1), + (BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_ITEMS, 1), + ), ) -ACCOUNT_ENFORCED_GUARDRAILS_OUTPUT_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AccountEnforcedGuardrailsOutputConfiguration"), - shape_type=ShapeType.LIST, - members={"member": {"target": ACCOUNT_ENFORCED_GUARDRAIL_OUTPUT_CONFIGURATION}}, +INTERNAL_SERVER_EXCEPTION: StaticSchema = ( + 18, + n0, + _ISE, + {_sm: _se, _sE: 500}, + (_m,), + ((NON_BLANK_STRING, 0),), +) + +THROTTLING_EXCEPTION: StaticSchema = ( + 18, + n0, + _TE, + {_sm: _c, _sE: 429}, + (_m,), + ((NON_BLANK_STRING, 0),), +) + +VALIDATION_EXCEPTION: StaticSchema = ( + 18, + n0, + _VE, + {_sm: _c, _sE: 400}, + (_m,), + ((NON_BLANK_STRING, 0),), +) + +BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB: StaticOperationSchema = ( + 23, + n0, + _BDAPOJ, + { + _smithy: MappingProxyType( + { + "code": 202, + "method": "POST", + "uri": "/advanced-prompt-optimization-job/batch-delete", + } + ) + }, + BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT, + BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -ACCOUNT_ID = Schema( - id=ShapeID("com.amazonaws.bedrock#AccountId"), shape_type=ShapeType.STRING +CONFLICT_EXCEPTION: StaticSchema = ( + 18, + n0, + _CE, + {_sm: _c, _sE: 400}, + (_m,), + ((NON_BLANK_STRING, 0),), ) -ACKNOWLEDGEMENT_FORM_DATA_BODY = Schema( - id=ShapeID("com.amazonaws.bedrock#AcknowledgementFormDataBody"), - shape_type=ShapeType.BLOB, -) +IDEMPOTENCY_TOKEN: StaticSchema = (3, n0, _ITd, 0) -ADDITIONAL_MODEL_REQUEST_FIELDS_KEY = Schema( - id=ShapeID("com.amazonaws.bedrock#AdditionalModelRequestFieldsKey"), - shape_type=ShapeType.STRING, -) +KMS_KEY_ARN: StaticSchema = (3, n0, _KKA, 0) -ADDITIONAL_MODEL_REQUEST_FIELDS_VALUE = Schema( - id=ShapeID("com.amazonaws.bedrock#AdditionalModelRequestFieldsValue"), - shape_type=ShapeType.DOCUMENT, -) +NON_EMPTY_STRING_LIST: StaticSchema = (16, n0, _NESL, 0, (_me,), ((3, 0),)) -ADDITIONAL_MODEL_REQUEST_FIELDS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AdditionalModelRequestFields"), - shape_type=ShapeType.MAP, - members={ - "key": {"target": ADDITIONAL_MODEL_REQUEST_FIELDS_KEY}, - "value": {"target": ADDITIONAL_MODEL_REQUEST_FIELDS_VALUE}, - }, +INFERENCE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _IC, + 0, + (_mT, _t, _tP, _sS), + ((7, 0), (9, 0), (9, 0), (NON_EMPTY_STRING_LIST, 0)), ) -S3_URI = Schema(id=ShapeID("com.amazonaws.bedrock#S3Uri"), shape_type=ShapeType.STRING) +ADVANCED_PROMPT_OPTIMIZATION_MODEL_IDENTIFIER: StaticSchema = (3, n0, _APOMI, 0) -ADVANCED_PROMPT_OPTIMIZATION_INPUT_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AdvancedPromptOptimizationInputConfig"), - members={ - "s3Uri": { - "target": S3_URI, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -ADVANCED_PROMPT_OPTIMIZATION_JOB_ARN = Schema( - id=ShapeID("com.amazonaws.bedrock#AdvancedPromptOptimizationJobArn"), - shape_type=ShapeType.STRING, +MODEL_CONFIGURATION: StaticSchema = ( + 18, + n0, + _MC, + 0, + (_mI, _iC, _aMRF), + ( + (ADVANCED_PROMPT_OPTIMIZATION_MODEL_IDENTIFIER, 1), + (INFERENCE_CONFIGURATION, 0), + (ADDITIONAL_MODEL_REQUEST_FIELDS, 0), + ), ) -ADVANCED_PROMPT_OPTIMIZATION_JOB_DESCRIPTION = Schema( - id=ShapeID("com.amazonaws.bedrock#AdvancedPromptOptimizationJobDescription"), - shape_type=ShapeType.STRING, +MODEL_CONFIGURATIONS: StaticSchema = ( + 16, + n0, + _MCo, + 0, + (_me,), + ((MODEL_CONFIGURATION, 0),), ) -ADVANCED_PROMPT_OPTIMIZATION_JOB_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrock#AdvancedPromptOptimizationJobIdentifier"), - shape_type=ShapeType.STRING, -) +S3_URI_FOLDER: StaticSchema = (3, n0, _SUF, 0) -ADVANCED_PROMPT_OPTIMIZATION_JOB_IDENTIFIERS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AdvancedPromptOptimizationJobIdentifiers"), - shape_type=ShapeType.LIST, - members={"member": {"target": ADVANCED_PROMPT_OPTIMIZATION_JOB_IDENTIFIER}}, +ADVANCED_PROMPT_OPTIMIZATION_OUTPUT_CONFIG: StaticSchema = ( + 18, + n0, + _APOOC, + 0, + (_sU,), + ((S3_URI_FOLDER, 1),), ) -ADVANCED_PROMPT_OPTIMIZATION_JOB_NAME = Schema( - id=ShapeID("com.amazonaws.bedrock#AdvancedPromptOptimizationJobName"), - shape_type=ShapeType.STRING, -) +TAG_KEY: StaticSchema = (3, n0, _TK, 0) -BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#BatchDeleteAdvancedPromptOptimizationJobInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#BatchDeleteAdvancedPromptOptimizationJobRequest", - ) - ], - members={ - "jobIdentifiers": { - "target": ADVANCED_PROMPT_OPTIMIZATION_JOB_IDENTIFIERS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +TAG_VALUE: StaticSchema = (3, n0, _TV, 0) -ADVANCED_PROMPT_OPTIMIZATION_JOB_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AdvancedPromptOptimizationJobStatus"), - shape_type=ShapeType.ENUM, - members={ - "IN_PROGRESS": {"target": UNIT}, - "COMPLETED": {"target": UNIT}, - "FAILED": {"target": UNIT}, - "PARTIALLY_COMPLETED": {"target": UNIT}, - "STOPPING": {"target": UNIT}, - "STOPPED": {"target": UNIT}, - "DELETING": {"target": UNIT}, - }, -) +TAG: StaticSchema = (18, n0, _Ta, 0, (_k, _v), ((TAG_KEY, 1), (TAG_VALUE, 1))) -BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_ITEM = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#BatchDeleteAdvancedPromptOptimizationJobItem"), - members={ - "jobIdentifier": { - "target": ADVANCED_PROMPT_OPTIMIZATION_JOB_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "jobStatus": { - "target": ADVANCED_PROMPT_OPTIMIZATION_JOB_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +TAG_LIST: StaticSchema = (16, n0, _TL, 0, (_me,), ((TAG, 0),)) -BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_ITEMS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#BatchDeleteAdvancedPromptOptimizationJobItems"), - shape_type=ShapeType.LIST, - members={"member": {"target": BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_ITEM}}, -) - -BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_ERROR = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#BatchDeleteAdvancedPromptOptimizationJobError"), - members={ - "jobIdentifier": { - "target": ADVANCED_PROMPT_OPTIMIZATION_JOB_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "code": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "message": {"target": STRING}, - }, +CREATE_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT: StaticSchema = ( + 18, + n0, + _CAPOJI, + {_sSI: _cCAPOJR, _smit: None}, + (_jN, _jD, _cT, _iCn, _oC, _eKA, _ta, _mC), + ( + (ADVANCED_PROMPT_OPTIMIZATION_JOB_NAME, 1), + (ADVANCED_PROMPT_OPTIMIZATION_JOB_DESCRIPTION, 0), + (IDEMPOTENCY_TOKEN, 2), + (ADVANCED_PROMPT_OPTIMIZATION_INPUT_CONFIG, 1), + (ADVANCED_PROMPT_OPTIMIZATION_OUTPUT_CONFIG, 1), + (KMS_KEY_ARN, 0), + (TAG_LIST, 0), + (MODEL_CONFIGURATIONS, 1), + ), ) -BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_ERRORS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#BatchDeleteAdvancedPromptOptimizationJobErrors"), - shape_type=ShapeType.LIST, - members={"member": {"target": BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_ERROR}}, +CREATE_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT: StaticSchema = ( + 18, + n0, + _CAPOJO, + {_sSI: _cCAPOJRo, _smith: None}, + (_jA,), + ((ADVANCED_PROMPT_OPTIMIZATION_JOB_ARN, 1),), +) + +RESOURCE_NOT_FOUND_EXCEPTION: StaticSchema = ( + 18, + n0, + _RNFE, + {_sm: _c, _sE: 404}, + (_m,), + ((NON_BLANK_STRING, 0),), +) + +SERVICE_QUOTA_EXCEEDED_EXCEPTION: StaticSchema = ( + 18, + n0, + _SQEE, + {_sm: _c, _sE: 400}, + (_m,), + ((NON_BLANK_STRING, 0),), +) + +TAGGABLE_RESOURCES_ARN: StaticSchema = (3, n0, _TRA, 0) + +TOO_MANY_TAGS_EXCEPTION: StaticSchema = ( + 18, + n0, + _TMTE, + {_sm: _c, _sE: 400}, + (_m, _rN), + ((NON_BLANK_STRING, 0), (TAGGABLE_RESOURCES_ARN, 0)), +) + +CREATE_ADVANCED_PROMPT_OPTIMIZATION_JOB: StaticOperationSchema = ( + 23, + n0, + _CAPOJ, + { + _smithy: MappingProxyType( + {"code": 200, "method": "POST", "uri": "/advanced-prompt-optimization-jobs"} + ) + }, + CREATE_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT, + CREATE_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + TOO_MANY_TAGS_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#BatchDeleteAdvancedPromptOptimizationJobOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#BatchDeleteAdvancedPromptOptimizationJobResponse", - ) - ], - members={ - "errors": { - "target": BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_ERRORS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "advancedPromptOptimizationJobs": { - "target": BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_ITEMS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +GET_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT: StaticSchema = ( + 18, + n0, + _GAPOJI, + {_sSI: _cGAPOJR, _smit: None}, + (_jIo,), + ((ADVANCED_PROMPT_OPTIMIZATION_JOB_IDENTIFIER, 9),), +) + +ERROR_MESSAGE: StaticSchema = (3, n0, _EM, 0) + +GET_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT: StaticSchema = ( + 18, + n0, + _GAPOJO, + {_sSI: _cGAPOJRo, _smith: None}, + (_jA, _jN, _jD, _jS, _iCn, _oC, _eKA, _cTr, _lMT, _fM, _mC), + ( + (ADVANCED_PROMPT_OPTIMIZATION_JOB_ARN, 1), + (ADVANCED_PROMPT_OPTIMIZATION_JOB_NAME, 1), + (ADVANCED_PROMPT_OPTIMIZATION_JOB_DESCRIPTION, 0), + (ADVANCED_PROMPT_OPTIMIZATION_JOB_STATUS, 1), + (ADVANCED_PROMPT_OPTIMIZATION_INPUT_CONFIG, 1), + (ADVANCED_PROMPT_OPTIMIZATION_OUTPUT_CONFIG, 1), + (KMS_KEY_ARN, 0), + (TIMESTAMP, 1), + (TIMESTAMP, 0), + (ERROR_MESSAGE, 0), + (MODEL_CONFIGURATIONS, 1), + ), ) -INTERNAL_SERVER_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#InternalServerException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="server"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=500), - ], - members={"message": {"target": NON_BLANK_STRING}}, -) - -THROTTLING_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ThrottlingException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=429), - ], - members={"message": {"target": NON_BLANK_STRING}}, -) - -VALIDATION_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ValidationException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"message": {"target": NON_BLANK_STRING}}, -) - -BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB = Schema( - id=ShapeID("com.amazonaws.bedrock#BatchDeleteAdvancedPromptOptimizationJob"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 202, - "method": "POST", - "uri": "/advanced-prompt-optimization-job/batch-delete", - } - ), - ) - ], +GET_ADVANCED_PROMPT_OPTIMIZATION_JOB: StaticOperationSchema = ( + 23, + n0, + _GAPOJ, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "GET", + "uri": "/advanced-prompt-optimization-jobs/{jobIdentifier}", + } + ) + }, + GET_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT, + GET_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CONFLICT_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ConflictException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"message": {"target": NON_BLANK_STRING}}, -) +MAX_RESULTS: StaticSchema = (7, n0, _MR, 0) -IDEMPOTENCY_TOKEN = Schema( - id=ShapeID("com.amazonaws.bedrock#IdempotencyToken"), shape_type=ShapeType.STRING -) +PAGINATION_TOKEN: StaticSchema = (3, n0, _PT, 0) -KMS_KEY_ARN = Schema( - id=ShapeID("com.amazonaws.bedrock#KmsKeyArn"), shape_type=ShapeType.STRING -) +SORT_JOBS_BY: StaticSchema = (14, n0, _SJB, 0, (_CT,), ((-1, {_sV: _CTr}),)) -NON_EMPTY_STRING_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#NonEmptyStringList"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, +SORT_ORDER: StaticSchema = ( + 14, + n0, + _SO, + 0, + (_ASCENDING, _DESCENDING), + ((-1, {_sV: _A}), (-1, {_sV: _De})), ) -INFERENCE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#InferenceConfiguration"), - members={ - "maxTokens": {"target": INTEGER}, - "temperature": {"target": FLOAT}, - "topP": {"target": FLOAT}, - "stopSequences": {"target": NON_EMPTY_STRING_LIST}, - }, +LIST_ADVANCED_PROMPT_OPTIMIZATION_JOBS_INPUT: StaticSchema = ( + 18, + n0, + _LAPOJI, + {_sSI: _cLAPOJR, _smit: None}, + (_mR, _nT, _sB, _sO), + ( + (MAX_RESULTS, {_sQ: _mR}), + (PAGINATION_TOKEN, {_sQ: _nT}), + (SORT_JOBS_BY, {_sQ: _sB}), + (SORT_ORDER, {_sQ: _sO}), + ), ) -ADVANCED_PROMPT_OPTIMIZATION_MODEL_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrock#AdvancedPromptOptimizationModelIdentifier"), - shape_type=ShapeType.STRING, +ADVANCED_PROMPT_OPTIMIZATION_JOB_SUMMARY: StaticSchema = ( + 18, + n0, + _APOJSd, + 0, + (_jA, _jN, _jS, _cTr, _lMT), + ( + (ADVANCED_PROMPT_OPTIMIZATION_JOB_ARN, 1), + (ADVANCED_PROMPT_OPTIMIZATION_JOB_NAME, 1), + (ADVANCED_PROMPT_OPTIMIZATION_JOB_STATUS, 1), + (TIMESTAMP, 1), + (TIMESTAMP, 0), + ), ) -MODEL_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ModelConfiguration"), - members={ - "modelId": { - "target": ADVANCED_PROMPT_OPTIMIZATION_MODEL_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "inferenceConfig": {"target": INFERENCE_CONFIGURATION}, - "additionalModelRequestFields": {"target": ADDITIONAL_MODEL_REQUEST_FIELDS}, - }, +ADVANCED_PROMPT_OPTIMIZATION_JOB_SUMMARIES: StaticSchema = ( + 16, + n0, + _APOJSdv, + 0, + (_me,), + ((ADVANCED_PROMPT_OPTIMIZATION_JOB_SUMMARY, 0),), +) + +LIST_ADVANCED_PROMPT_OPTIMIZATION_JOBS_OUTPUT: StaticSchema = ( + 18, + n0, + _LAPOJO, + {_sSI: _cLAPOJRo, _smith: None}, + (_jSo, _nT), + ((ADVANCED_PROMPT_OPTIMIZATION_JOB_SUMMARIES, 0), (PAGINATION_TOKEN, 0)), +) + +LIST_ADVANCED_PROMPT_OPTIMIZATION_JOBS: StaticOperationSchema = ( + 23, + n0, + _LAPOJ, + { + _smithy: MappingProxyType( + {"code": 200, "method": "GET", "uri": "/advanced-prompt-optimization-jobs"} + ) + }, + LIST_ADVANCED_PROMPT_OPTIMIZATION_JOBS_INPUT, + LIST_ADVANCED_PROMPT_OPTIMIZATION_JOBS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -MODEL_CONFIGURATIONS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ModelConfigurations"), - shape_type=ShapeType.LIST, - members={"member": {"target": MODEL_CONFIGURATION}}, +STOP_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT: StaticSchema = ( + 18, + n0, + _SAPOJI, + {_sSI: _cSAPOJR, _smit: None}, + (_jIo,), + ((ADVANCED_PROMPT_OPTIMIZATION_JOB_IDENTIFIER, 9),), +) + +STOP_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT: StaticSchema = ( + 18, + n0, + _SAPOJO, + {_sSI: _cSAPOJRo, _smith: None}, +) + +STOP_ADVANCED_PROMPT_OPTIMIZATION_JOB: StaticOperationSchema = ( + 23, + n0, + _SAPOJ, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "POST", + "uri": "/advanced-prompt-optimization-jobs/{jobIdentifier}/stop", + } + ) + }, + STOP_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT, + STOP_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -S3_URI_FOLDER = Schema( - id=ShapeID("com.amazonaws.bedrock#S3UriFolder"), shape_type=ShapeType.STRING +AGREEMENT_STATUS: StaticSchema = ( + 14, + n0, + _AS, + 0, + (_AVAILABLE, _PENDING, _NA, _ERROR), + ( + (-1, {_sV: _AVAILABLE}), + (-1, {_sV: _PENDING}), + (-1, {_sV: _NA}), + (-1, {_sV: _ERROR}), + ), ) -ADVANCED_PROMPT_OPTIMIZATION_OUTPUT_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AdvancedPromptOptimizationOutputConfig"), - members={ - "s3Uri": { - "target": S3_URI_FOLDER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +AGREEMENT_AVAILABILITY: StaticSchema = ( + 18, + n0, + _AA, + 0, + (_st, _eMr), + ((AGREEMENT_STATUS, 1), (3, 0)), ) -TAG_KEY = Schema( - id=ShapeID("com.amazonaws.bedrock#TagKey"), shape_type=ShapeType.STRING +GET_USE_CASE_FOR_MODEL_ACCESS_INPUT: StaticSchema = ( + 18, + n0, + _GUCFMAI, + {_sSI: _cGUCFMAR, _smit: None}, ) -TAG_VALUE = Schema( - id=ShapeID("com.amazonaws.bedrock#TagValue"), shape_type=ShapeType.STRING +GET_USE_CASE_FOR_MODEL_ACCESS_OUTPUT: StaticSchema = ( + 18, + n0, + _GUCFMAO, + {_sSI: _cGUCFMARo, _smith: None}, + (_fD,), + ((ACKNOWLEDGEMENT_FORM_DATA_BODY, 1),), ) -TAG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#Tag"), - members={ - "key": { - "target": TAG_KEY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "value": { - "target": TAG_VALUE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, +GET_USE_CASE_FOR_MODEL_ACCESS: StaticOperationSchema = ( + 23, + n0, + _GUCFMA, + { + _smithy: MappingProxyType( + {"code": 200, "method": "GET", "uri": "/use-case-for-model-access"} + ) }, + GET_USE_CASE_FOR_MODEL_ACCESS_INPUT, + GET_USE_CASE_FOR_MODEL_ACCESS_OUTPUT, + ( + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -TAG_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#TagList"), - shape_type=ShapeType.LIST, - members={"member": {"target": TAG}}, +PUT_USE_CASE_FOR_MODEL_ACCESS_INPUT: StaticSchema = ( + 18, + n0, + _PUCFMAI, + {_sSI: _cPUCFMAR, _smit: None}, + (_fD,), + ((ACKNOWLEDGEMENT_FORM_DATA_BODY, 1),), ) -CREATE_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CreateAdvancedPromptOptimizationJobInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#CreateAdvancedPromptOptimizationJobRequest", - ) - ], - members={ - "jobName": { - "target": ADVANCED_PROMPT_OPTIMIZATION_JOB_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "jobDescription": {"target": ADVANCED_PROMPT_OPTIMIZATION_JOB_DESCRIPTION}, - "clientToken": { - "target": IDEMPOTENCY_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "inputConfig": { - "target": ADVANCED_PROMPT_OPTIMIZATION_INPUT_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "outputConfig": { - "target": ADVANCED_PROMPT_OPTIMIZATION_OUTPUT_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "encryptionKeyArn": {"target": KMS_KEY_ARN}, - "tags": {"target": TAG_LIST}, - "modelConfigurations": { - "target": MODEL_CONFIGURATIONS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +PUT_USE_CASE_FOR_MODEL_ACCESS_OUTPUT: StaticSchema = ( + 18, + n0, + _PUCFMAO, + {_sSI: _cPUCFMARo, _smith: None}, ) -CREATE_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CreateAdvancedPromptOptimizationJobOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#CreateAdvancedPromptOptimizationJobResponse", +PUT_USE_CASE_FOR_MODEL_ACCESS: StaticOperationSchema = ( + 23, + n0, + _PUCFMA, + { + _smithy: MappingProxyType( + {"code": 201, "method": "POST", "uri": "/use-case-for-model-access"} ) - ], - members={ - "jobArn": { - "target": ADVANCED_PROMPT_OPTIMIZATION_JOB_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } }, + PUT_USE_CASE_FOR_MODEL_ACCESS_INPUT, + PUT_USE_CASE_FOR_MODEL_ACCESS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -RESOURCE_NOT_FOUND_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=404), - ], - members={"message": {"target": NON_BLANK_STRING}}, -) +AUTOMATED_REASONING_POLICY_ARN: StaticSchema = (3, n0, _ARPA, 0) -SERVICE_QUOTA_EXCEEDED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ServiceQuotaExceededException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"message": {"target": NON_BLANK_STRING}}, -) +AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_ID: StaticSchema = (3, n0, _ARPBWI, 0) -TAGGABLE_RESOURCES_ARN = Schema( - id=ShapeID("com.amazonaws.bedrock#TaggableResourcesArn"), - shape_type=ShapeType.STRING, +CANCEL_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT: StaticSchema = ( + 18, + n0, + _CARPBWI, + {_sSI: _cCARPBWR, _smit: None}, + (_pA, _bWI), + ( + (AUTOMATED_REASONING_POLICY_ARN, 9), + (AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_ID, 9), + ), ) -TOO_MANY_TAGS_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#TooManyTagsException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={ - "message": {"target": NON_BLANK_STRING}, - "resourceName": {"target": TAGGABLE_RESOURCES_ARN}, - }, +CANCEL_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT: StaticSchema = ( + 18, + n0, + _CARPBWO, + {_sSI: _cCARPBWRo, _smith: None}, +) + +CANCEL_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW: StaticOperationSchema = ( + 23, + n0, + _CARPBW, + { + _smithy: MappingProxyType( + { + "code": 202, + "method": "POST", + "uri": "/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowId}/cancel", + } + ) + }, + CANCEL_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT, + CANCEL_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CREATE_ADVANCED_PROMPT_OPTIMIZATION_JOB = Schema( - id=ShapeID("com.amazonaws.bedrock#CreateAdvancedPromptOptimizationJob"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "POST", - "uri": "/advanced-prompt-optimization-jobs", - } - ), - ) - ], -) +AUTOMATED_REASONING_POLICY_DESCRIPTION: StaticSchema = (3, n0, _ARPD, 4) -GET_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetAdvancedPromptOptimizationJobInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetAdvancedPromptOptimizationJobRequest", - ) - ], - members={ - "jobIdentifier": { - "target": ADVANCED_PROMPT_OPTIMIZATION_JOB_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) +KMS_KEY_ID: StaticSchema = (3, n0, _KKI, 0) -ERROR_MESSAGE = Schema( - id=ShapeID("com.amazonaws.bedrock#ErrorMessage"), shape_type=ShapeType.STRING -) +AUTOMATED_REASONING_POLICY_NAME: StaticSchema = (3, n0, _ARPN, 4) -GET_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetAdvancedPromptOptimizationJobOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetAdvancedPromptOptimizationJobResponse", - ) - ], - members={ - "jobArn": { - "target": ADVANCED_PROMPT_OPTIMIZATION_JOB_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "jobName": { - "target": ADVANCED_PROMPT_OPTIMIZATION_JOB_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "jobDescription": {"target": ADVANCED_PROMPT_OPTIMIZATION_JOB_DESCRIPTION}, - "jobStatus": { - "target": ADVANCED_PROMPT_OPTIMIZATION_JOB_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "inputConfig": { - "target": ADVANCED_PROMPT_OPTIMIZATION_INPUT_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "outputConfig": { - "target": ADVANCED_PROMPT_OPTIMIZATION_OUTPUT_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "encryptionKeyArn": {"target": KMS_KEY_ARN}, - "creationTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastModifiedTime": {"target": TIMESTAMP}, - "failureMessage": {"target": ERROR_MESSAGE}, - "modelConfigurations": { - "target": MODEL_CONFIGURATIONS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +AUTOMATED_REASONING_POLICY_DEFINITION_RULE_ALTERNATE_EXPRESSION: StaticSchema = ( + 3, + n0, + _ARPDRAE, + 4, ) -GET_ADVANCED_PROMPT_OPTIMIZATION_JOB = Schema( - id=ShapeID("com.amazonaws.bedrock#GetAdvancedPromptOptimizationJob"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/advanced-prompt-optimization-jobs/{jobIdentifier}", - } - ), - ) - ], +AUTOMATED_REASONING_POLICY_DEFINITION_RULE_EXPRESSION: StaticSchema = ( + 3, + n0, + _ARPDRE, + 4, ) -MAX_RESULTS = Schema( - id=ShapeID("com.amazonaws.bedrock#MaxResults"), shape_type=ShapeType.INTEGER -) +AUTOMATED_REASONING_POLICY_DEFINITION_RULE_ID: StaticSchema = (3, n0, _ARPDRI, 0) -PAGINATION_TOKEN = Schema( - id=ShapeID("com.amazonaws.bedrock#PaginationToken"), shape_type=ShapeType.STRING +AUTOMATED_REASONING_POLICY_DEFINITION_RULE: StaticSchema = ( + 18, + n0, + _ARPDR, + 0, + (_i, _ex, _aE), + ( + (AUTOMATED_REASONING_POLICY_DEFINITION_RULE_ID, 1), + (AUTOMATED_REASONING_POLICY_DEFINITION_RULE_EXPRESSION, 1), + (AUTOMATED_REASONING_POLICY_DEFINITION_RULE_ALTERNATE_EXPRESSION, 0), + ), ) -SORT_JOBS_BY = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#SortJobsBy"), - shape_type=ShapeType.ENUM, - members={"CREATION_TIME": {"target": UNIT}}, +AUTOMATED_REASONING_POLICY_DEFINITION_RULE_LIST: StaticSchema = ( + 16, + n0, + _ARPDRL, + 0, + (_me,), + ((AUTOMATED_REASONING_POLICY_DEFINITION_RULE, 0),), ) -SORT_ORDER = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#SortOrder"), - shape_type=ShapeType.ENUM, - members={"ASCENDING": {"target": UNIT}, "DESCENDING": {"target": UNIT}}, +AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_DESCRIPTION: StaticSchema = ( + 3, + n0, + _ARPDTD, + 4, ) -LIST_ADVANCED_PROMPT_OPTIMIZATION_JOBS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ListAdvancedPromptOptimizationJobsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#ListAdvancedPromptOptimizationJobsRequest", - ) - ], - members={ - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "nextToken": { - "target": PAGINATION_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "sortBy": { - "target": SORT_JOBS_BY, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="sortBy")], - }, - "sortOrder": { - "target": SORT_ORDER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="sortOrder") - ], - }, - }, -) +AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_NAME: StaticSchema = (3, n0, _ARPDTN, 4) -ADVANCED_PROMPT_OPTIMIZATION_JOB_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AdvancedPromptOptimizationJobSummary"), - members={ - "jobArn": { - "target": ADVANCED_PROMPT_OPTIMIZATION_JOB_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "jobName": { - "target": ADVANCED_PROMPT_OPTIMIZATION_JOB_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "jobStatus": { - "target": ADVANCED_PROMPT_OPTIMIZATION_JOB_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "creationTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastModifiedTime": {"target": TIMESTAMP}, - }, +AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE_DESCRIPTION: StaticSchema = ( + 3, + n0, + _ARPDTVD, + 4, ) -ADVANCED_PROMPT_OPTIMIZATION_JOB_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AdvancedPromptOptimizationJobSummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": ADVANCED_PROMPT_OPTIMIZATION_JOB_SUMMARY}}, +AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE_NAME: StaticSchema = ( + 3, + n0, + _ARPDTVN, + 0, ) -LIST_ADVANCED_PROMPT_OPTIMIZATION_JOBS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ListAdvancedPromptOptimizationJobsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#ListAdvancedPromptOptimizationJobsResponse", - ) - ], - members={ - "jobSummaries": {"target": ADVANCED_PROMPT_OPTIMIZATION_JOB_SUMMARIES}, - "nextToken": {"target": PAGINATION_TOKEN}, - }, +AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE: StaticSchema = ( + 18, + n0, + _ARPDTV, + 0, + (_v, _d), + ( + (AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE_NAME, 1), + (AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE_DESCRIPTION, 0), + ), ) -LIST_ADVANCED_PROMPT_OPTIMIZATION_JOBS = Schema( - id=ShapeID("com.amazonaws.bedrock#ListAdvancedPromptOptimizationJobs"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/advanced-prompt-optimization-jobs", - } - ), - ) - ], +AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE_LIST: StaticSchema = ( + 16, + n0, + _ARPDTVL, + 0, + (_me,), + ((AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE, 0),), +) + +AUTOMATED_REASONING_POLICY_DEFINITION_TYPE: StaticSchema = ( + 18, + n0, + _ARPDT, + 0, + (_n, _d, _va), + ( + (AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_NAME, 1), + (AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_DESCRIPTION, 0), + (AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE_LIST, 1), + ), ) -STOP_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#StopAdvancedPromptOptimizationJobInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#StopAdvancedPromptOptimizationJobRequest", - ) - ], - members={ - "jobIdentifier": { - "target": ADVANCED_PROMPT_OPTIMIZATION_JOB_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, +AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_LIST: StaticSchema = ( + 16, + n0, + _ARPDTL, + 0, + (_me,), + ((AUTOMATED_REASONING_POLICY_DEFINITION_TYPE, 0),), ) -STOP_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#StopAdvancedPromptOptimizationJobOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#StopAdvancedPromptOptimizationJobResponse", - ) - ], -) - -STOP_ADVANCED_PROMPT_OPTIMIZATION_JOB = Schema( - id=ShapeID("com.amazonaws.bedrock#StopAdvancedPromptOptimizationJob"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "POST", - "uri": "/advanced-prompt-optimization-jobs/{jobIdentifier}/stop", - } - ), - ) - ], +AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE_DESCRIPTION: StaticSchema = ( + 3, + n0, + _ARPDVD, + 4, ) -AGREEMENT_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AgreementStatus"), - shape_type=ShapeType.ENUM, - members={ - "AVAILABLE": {"target": UNIT}, - "PENDING": {"target": UNIT}, - "NOT_AVAILABLE": {"target": UNIT}, - "ERROR": {"target": UNIT}, - }, -) +AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE_NAME: StaticSchema = (3, n0, _ARPDVN, 4) -AGREEMENT_AVAILABILITY = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AgreementAvailability"), - members={ - "status": { - "target": AGREEMENT_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "errorMessage": {"target": STRING}, - }, +AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE: StaticSchema = ( + 18, + n0, + _ARPDV, + 0, + (_n, _ty, _d), + ( + (AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE_NAME, 1), + (AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_NAME, 1), + (AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE_DESCRIPTION, 1), + ), ) -GET_USE_CASE_FOR_MODEL_ACCESS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetUseCaseForModelAccessInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetUseCaseForModelAccessRequest", - ) - ], +AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE_LIST: StaticSchema = ( + 16, + n0, + _ARPDVL, + 0, + (_me,), + ((AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE, 0),), +) + +AUTOMATED_REASONING_POLICY_FORMAT_VERSION: StaticSchema = (3, n0, _ARPFV, 0) + +AUTOMATED_REASONING_POLICY_DEFINITION: StaticSchema = ( + 18, + n0, + _ARPDu, + 0, + (_ve, _typ, _r, _var), + ( + (AUTOMATED_REASONING_POLICY_FORMAT_VERSION, {_s: _v_}), + (AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_LIST, 0), + (AUTOMATED_REASONING_POLICY_DEFINITION_RULE_LIST, 0), + (AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE_LIST, 0), + ), ) -GET_USE_CASE_FOR_MODEL_ACCESS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetUseCaseForModelAccessOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetUseCaseForModelAccessResponse", - ) - ], - members={ - "formData": { - "target": ACKNOWLEDGEMENT_FORM_DATA_BODY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +CREATE_AUTOMATED_REASONING_POLICY_INPUT: StaticSchema = ( + 18, + n0, + _CARPI, + {_sSI: _cCARPR, _smit: None}, + (_n, _d, _cRT, _pD, _kKI, _ta), + ( + (AUTOMATED_REASONING_POLICY_NAME, 1), + (AUTOMATED_REASONING_POLICY_DESCRIPTION, 0), + (IDEMPOTENCY_TOKEN, 2), + (AUTOMATED_REASONING_POLICY_DEFINITION, 0), + (KMS_KEY_ID, 0), + (TAG_LIST, 0), + ), ) -GET_USE_CASE_FOR_MODEL_ACCESS = Schema( - id=ShapeID("com.amazonaws.bedrock#GetUseCaseForModelAccess"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "GET", "uri": "/use-case-for-model-access"} - ), - ) - ], +AUTOMATED_REASONING_POLICY_HASH: StaticSchema = (3, n0, _ARPH, 0) + +AUTOMATED_REASONING_POLICY_VERSION: StaticSchema = (3, n0, _ARPV, 0) + +CREATE_AUTOMATED_REASONING_POLICY_OUTPUT: StaticSchema = ( + 18, + n0, + _CARPO, + {_sSI: _cCARPRo, _smith: None}, + (_pA, _ve, _n, _d, _dH, _cA, _uA), + ( + (AUTOMATED_REASONING_POLICY_ARN, 1), + (AUTOMATED_REASONING_POLICY_VERSION, 1), + (AUTOMATED_REASONING_POLICY_NAME, 1), + (AUTOMATED_REASONING_POLICY_DESCRIPTION, 0), + (AUTOMATED_REASONING_POLICY_HASH, 0), + (TIMESTAMP, 1), + (TIMESTAMP, 1), + ), ) -PUT_USE_CASE_FOR_MODEL_ACCESS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#PutUseCaseForModelAccessInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#PutUseCaseForModelAccessRequest", - ) - ], - members={ - "formData": { - "target": ACKNOWLEDGEMENT_FORM_DATA_BODY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +CREATE_AUTOMATED_REASONING_POLICY: StaticOperationSchema = ( + 23, + n0, + _CARP, + { + _smithy: MappingProxyType( + {"code": 200, "method": "POST", "uri": "/automated-reasoning-policies"} + ) + }, + CREATE_AUTOMATED_REASONING_POLICY_INPUT, + CREATE_AUTOMATED_REASONING_POLICY_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + TOO_MANY_TAGS_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -PUT_USE_CASE_FOR_MODEL_ACCESS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#PutUseCaseForModelAccessOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#PutUseCaseForModelAccessResponse", - ) - ], -) - -PUT_USE_CASE_FOR_MODEL_ACCESS = Schema( - id=ShapeID("com.amazonaws.bedrock#PutUseCaseForModelAccess"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 201, "method": "POST", "uri": "/use-case-for-model-access"} - ), - ) - ], +AUTOMATED_REASONING_CHECK_TRANSLATION_CONFIDENCE: StaticSchema = (10, n0, _ARCTC, 0) + +AUTOMATED_REASONING_CHECK_RESULT: StaticSchema = ( + 14, + n0, + _ARCR, + 0, + (_VALID, _INVALID, _SATISFIABLE, _IMPOSSIBLE, _TA, _TC, _NT), + ( + (-1, {_sV: _VALID}), + (-1, {_sV: _INVALID}), + (-1, {_sV: _SATISFIABLE}), + (-1, {_sV: _IMPOSSIBLE}), + (-1, {_sV: _TA}), + (-1, {_sV: _TC}), + (-1, {_sV: _NT}), + ), ) -AUTOMATED_REASONING_POLICY_ARN = Schema( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyArn"), - shape_type=ShapeType.STRING, -) +AUTOMATED_REASONING_POLICY_TEST_GUARD_CONTENT: StaticSchema = (3, n0, _ARPTGC, 4) -AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_ID = Schema( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyBuildWorkflowId"), - shape_type=ShapeType.STRING, -) +AUTOMATED_REASONING_POLICY_TEST_QUERY_CONTENT: StaticSchema = (3, n0, _ARPTQC, 4) -CANCEL_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrock#CancelAutomatedReasoningPolicyBuildWorkflowInput" +CREATE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT: StaticSchema = ( + 18, + n0, + _CARPTCI, + {_sSI: _cCARPTCR, _smit: None}, + (_pA, _gC, _qC, _eAFR, _cRT, _cTo), + ( + (AUTOMATED_REASONING_POLICY_ARN, 9), + (AUTOMATED_REASONING_POLICY_TEST_GUARD_CONTENT, 1), + (AUTOMATED_REASONING_POLICY_TEST_QUERY_CONTENT, 0), + (AUTOMATED_REASONING_CHECK_RESULT, 1), + (IDEMPOTENCY_TOKEN, 2), + (AUTOMATED_REASONING_CHECK_TRANSLATION_CONFIDENCE, 0), ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#CancelAutomatedReasoningPolicyBuildWorkflowRequest", - ) - ], - members={ - "policyArn": { - "target": AUTOMATED_REASONING_POLICY_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "buildWorkflowId": { - "target": AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, ) -CANCEL_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrock#CancelAutomatedReasoningPolicyBuildWorkflowOutput" +AUTOMATED_REASONING_POLICY_TEST_CASE_ID: StaticSchema = (3, n0, _ARPTCI, 0) + +CREATE_AUTOMATED_REASONING_POLICY_TEST_CASE_OUTPUT: StaticSchema = ( + 18, + n0, + _CARPTCO, + {_sSI: _cCARPTCRo, _smith: None}, + (_pA, _tCI), + ((AUTOMATED_REASONING_POLICY_ARN, 1), (AUTOMATED_REASONING_POLICY_TEST_CASE_ID, 1)), +) + +CREATE_AUTOMATED_REASONING_POLICY_TEST_CASE: StaticOperationSchema = ( + 23, + n0, + _CARPTC, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "POST", + "uri": "/automated-reasoning-policies/{policyArn}/test-cases", + } + ) + }, + CREATE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT, + CREATE_AUTOMATED_REASONING_POLICY_TEST_CASE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#CancelAutomatedReasoningPolicyBuildWorkflowResponse", - ) - ], -) - -CANCEL_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW = Schema( - id=ShapeID("com.amazonaws.bedrock#CancelAutomatedReasoningPolicyBuildWorkflow"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 202, - "method": "POST", - "uri": "/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowId}/cancel", - } - ), - ) - ], ) -AUTOMATED_REASONING_POLICY_DESCRIPTION = Schema( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyDescription"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +CREATE_AUTOMATED_REASONING_POLICY_VERSION_INPUT: StaticSchema = ( + 18, + n0, + _CARPVI, + {_sSI: _cCARPVR, _smit: None}, + (_pA, _cRT, _lUDH, _ta), + ( + (AUTOMATED_REASONING_POLICY_ARN, 9), + (IDEMPOTENCY_TOKEN, 2), + (AUTOMATED_REASONING_POLICY_HASH, 1), + (TAG_LIST, 0), + ), ) -KMS_KEY_ID = Schema( - id=ShapeID("com.amazonaws.bedrock#KmsKeyId"), shape_type=ShapeType.STRING +CREATE_AUTOMATED_REASONING_POLICY_VERSION_OUTPUT: StaticSchema = ( + 18, + n0, + _CARPVO, + {_sSI: _cCARPVRo, _smith: None}, + (_pA, _ve, _n, _d, _dH, _cA), + ( + (AUTOMATED_REASONING_POLICY_ARN, 1), + (AUTOMATED_REASONING_POLICY_VERSION, 1), + (AUTOMATED_REASONING_POLICY_NAME, 1), + (AUTOMATED_REASONING_POLICY_DESCRIPTION, 0), + (AUTOMATED_REASONING_POLICY_HASH, 1), + (TIMESTAMP, 1), + ), ) -AUTOMATED_REASONING_POLICY_NAME = Schema( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyName"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +CREATE_AUTOMATED_REASONING_POLICY_VERSION: StaticOperationSchema = ( + 23, + n0, + _CARPV, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "POST", + "uri": "/automated-reasoning-policies/{policyArn}/versions", + } + ) + }, + CREATE_AUTOMATED_REASONING_POLICY_VERSION_INPUT, + CREATE_AUTOMATED_REASONING_POLICY_VERSION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + TOO_MANY_TAGS_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AUTOMATED_REASONING_POLICY_DEFINITION_RULE_ALTERNATE_EXPRESSION = Schema( - id=ShapeID( - "com.amazonaws.bedrock#AutomatedReasoningPolicyDefinitionRuleAlternateExpression" +DELETE_AUTOMATED_REASONING_POLICY_INPUT: StaticSchema = ( + 18, + n0, + _DARPI, + {_sSI: _cDARPR, _smit: None}, + (_pA, _f), + ((AUTOMATED_REASONING_POLICY_ARN, 9), (2, {_s: False, _sQ: _f})), +) + +DELETE_AUTOMATED_REASONING_POLICY_OUTPUT: StaticSchema = ( + 18, + n0, + _DARPO, + {_sSI: _cDARPRo, _smith: None}, +) + +RESOURCE_IN_USE_EXCEPTION: StaticSchema = ( + 18, + n0, + _RIUE, + {_sm: _c, _sE: 400}, + (_m,), + ((NON_BLANK_STRING, 0),), +) + +DELETE_AUTOMATED_REASONING_POLICY: StaticOperationSchema = ( + 23, + n0, + _DARP, + { + _smithy: MappingProxyType( + { + "code": 202, + "method": "DELETE", + "uri": "/automated-reasoning-policies/{policyArn}", + } + ) + }, + DELETE_AUTOMATED_REASONING_POLICY_INPUT, + DELETE_AUTOMATED_REASONING_POLICY_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_IN_USE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, ), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], ) -AUTOMATED_REASONING_POLICY_DEFINITION_RULE_EXPRESSION = Schema( - id=ShapeID( - "com.amazonaws.bedrock#AutomatedReasoningPolicyDefinitionRuleExpression" +DELETE_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT: StaticSchema = ( + 18, + n0, + _DARPBWI, + {_sSI: _cDARPBWR, _smit: None}, + (_pA, _bWI, _lUA), + ( + (AUTOMATED_REASONING_POLICY_ARN, 9), + (AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_ID, 9), + (TIMESTAMP, {_sQ: _uA, _smi: None}), ), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], ) -AUTOMATED_REASONING_POLICY_DEFINITION_RULE_ID = Schema( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyDefinitionRuleId"), - shape_type=ShapeType.STRING, +DELETE_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT: StaticSchema = ( + 18, + n0, + _DARPBWO, + {_sSI: _cDARPBWRo, _smith: None}, +) + +DELETE_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW: StaticOperationSchema = ( + 23, + n0, + _DARPBW, + { + _smithy: MappingProxyType( + { + "code": 202, + "method": "DELETE", + "uri": "/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowId}", + } + ) + }, + DELETE_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT, + DELETE_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_IN_USE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AUTOMATED_REASONING_POLICY_DEFINITION_RULE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyDefinitionRule"), - members={ - "id": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_RULE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "expression": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_RULE_EXPRESSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "alternateExpression": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_RULE_ALTERNATE_EXPRESSION - }, - }, +DELETE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT: StaticSchema = ( + 18, + n0, + _DARPTCI, + {_sSI: _cDARPTCR, _smit: None}, + (_pA, _tCI, _lUA), + ( + (AUTOMATED_REASONING_POLICY_ARN, 9), + (AUTOMATED_REASONING_POLICY_TEST_CASE_ID, 9), + (TIMESTAMP, {_sQ: _uA, _smi: None}), + ), ) -AUTOMATED_REASONING_POLICY_DEFINITION_RULE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyDefinitionRuleList"), - shape_type=ShapeType.LIST, - members={"member": {"target": AUTOMATED_REASONING_POLICY_DEFINITION_RULE}}, +DELETE_AUTOMATED_REASONING_POLICY_TEST_CASE_OUTPUT: StaticSchema = ( + 18, + n0, + _DARPTCO, + {_sSI: _cDARPTCRo, _smith: None}, +) + +DELETE_AUTOMATED_REASONING_POLICY_TEST_CASE: StaticOperationSchema = ( + 23, + n0, + _DARPTC, + { + _smithy: MappingProxyType( + { + "code": 202, + "method": "DELETE", + "uri": "/automated-reasoning-policies/{policyArn}/test-cases/{testCaseId}", + } + ) + }, + DELETE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT, + DELETE_AUTOMATED_REASONING_POLICY_TEST_CASE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_IN_USE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_DESCRIPTION = Schema( - id=ShapeID( - "com.amazonaws.bedrock#AutomatedReasoningPolicyDefinitionTypeDescription" +EXPORT_AUTOMATED_REASONING_POLICY_VERSION_INPUT: StaticSchema = ( + 18, + n0, + _EARPVI, + {_sSI: _cEARPVR, _smit: None}, + (_pA,), + ((AUTOMATED_REASONING_POLICY_ARN, 9),), +) + +EXPORT_AUTOMATED_REASONING_POLICY_VERSION_OUTPUT: StaticSchema = ( + 18, + n0, + _EARPVO, + {_sSI: _cEARPVRo, _smith: None}, + (_pD,), + ((AUTOMATED_REASONING_POLICY_DEFINITION, 17),), +) + +EXPORT_AUTOMATED_REASONING_POLICY_VERSION: StaticOperationSchema = ( + 23, + n0, + _EARPV, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "GET", + "uri": "/automated-reasoning-policies/{policyArn}/export", + } + ) + }, + EXPORT_AUTOMATED_REASONING_POLICY_VERSION_INPUT, + EXPORT_AUTOMATED_REASONING_POLICY_VERSION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, ), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], ) -AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_NAME = Schema( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyDefinitionTypeName"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +GET_AUTOMATED_REASONING_POLICY_INPUT: StaticSchema = ( + 18, + n0, + _GARPI, + {_sSI: _cGARPR, _smit: None}, + (_pA,), + ((AUTOMATED_REASONING_POLICY_ARN, 9),), +) + +AUTOMATED_REASONING_POLICY_ID: StaticSchema = (3, n0, _ARPI, 0) + +GET_AUTOMATED_REASONING_POLICY_OUTPUT: StaticSchema = ( + 18, + n0, + _GARPO, + {_sSI: _cGARPRo, _smith: None}, + (_pA, _n, _ve, _pI, _d, _dH, _kKA, _cA, _uA), + ( + (AUTOMATED_REASONING_POLICY_ARN, 1), + (AUTOMATED_REASONING_POLICY_NAME, 1), + (AUTOMATED_REASONING_POLICY_VERSION, 1), + (AUTOMATED_REASONING_POLICY_ID, 1), + (AUTOMATED_REASONING_POLICY_DESCRIPTION, 0), + (AUTOMATED_REASONING_POLICY_HASH, 1), + (KMS_KEY_ARN, 0), + (TIMESTAMP, 0), + (TIMESTAMP, 1), + ), ) -AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE_DESCRIPTION = Schema( - id=ShapeID( - "com.amazonaws.bedrock#AutomatedReasoningPolicyDefinitionTypeValueDescription" +GET_AUTOMATED_REASONING_POLICY: StaticOperationSchema = ( + 23, + n0, + _GARP, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "GET", + "uri": "/automated-reasoning-policies/{policyArn}", + } + ) + }, + GET_AUTOMATED_REASONING_POLICY_INPUT, + GET_AUTOMATED_REASONING_POLICY_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, ), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], ) -AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE_NAME = Schema( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyDefinitionTypeValueName"), - shape_type=ShapeType.STRING, +GET_AUTOMATED_REASONING_POLICY_ANNOTATIONS_INPUT: StaticSchema = ( + 18, + n0, + _GARPAI, + {_sSI: _cGARPAR, _smit: None}, + (_pA, _bWI), + ( + (AUTOMATED_REASONING_POLICY_ARN, 9), + (AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_ID, 9), + ), ) -AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyDefinitionTypeValue"), - members={ - "value": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE_DESCRIPTION - }, - }, +AUTOMATED_REASONING_POLICY_ADD_RULE_ANNOTATION: StaticSchema = ( + 18, + n0, + _ARPARA, + 0, + (_ex,), + ((AUTOMATED_REASONING_POLICY_DEFINITION_RULE_EXPRESSION, 1),), +) + +AUTOMATED_REASONING_POLICY_ANNOTATION_RULE_NATURAL_LANGUAGE: StaticSchema = ( + 3, + n0, + _ARPARNL, + 4, +) + +AUTOMATED_REASONING_POLICY_ADD_RULE_FROM_NATURAL_LANGUAGE_ANNOTATION: StaticSchema = ( + 18, + n0, + _ARPARFNLA, + 0, + (_nL,), + ((AUTOMATED_REASONING_POLICY_ANNOTATION_RULE_NATURAL_LANGUAGE, 1),), +) + +AUTOMATED_REASONING_POLICY_ADD_TYPE_ANNOTATION: StaticSchema = ( + 18, + n0, + _ARPATA, + 0, + (_n, _d, _va), + ( + (AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_NAME, 1), + (AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_DESCRIPTION, 1), + (AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE_LIST, 1), + ), ) -AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyDefinitionTypeValueList"), - shape_type=ShapeType.LIST, - members={"member": {"target": AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE}}, -) - -AUTOMATED_REASONING_POLICY_DEFINITION_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyDefinitionType"), - members={ - "name": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_DESCRIPTION - }, - "values": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +AUTOMATED_REASONING_POLICY_ADD_VARIABLE_ANNOTATION: StaticSchema = ( + 18, + n0, + _ARPAVA, + 0, + (_n, _ty, _d), + ( + (AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE_NAME, 1), + (AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_NAME, 1), + (AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE_DESCRIPTION, 1), + ), ) -AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyDefinitionTypeList"), - shape_type=ShapeType.LIST, - members={"member": {"target": AUTOMATED_REASONING_POLICY_DEFINITION_TYPE}}, +AUTOMATED_REASONING_POLICY_DELETE_RULE_ANNOTATION: StaticSchema = ( + 18, + n0, + _ARPDRA, + 0, + (_rI,), + ((AUTOMATED_REASONING_POLICY_DEFINITION_RULE_ID, 1),), +) + +AUTOMATED_REASONING_POLICY_DELETE_TYPE_ANNOTATION: StaticSchema = ( + 18, + n0, + _ARPDTA, + 0, + (_n,), + ((AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_NAME, 1),), +) + +AUTOMATED_REASONING_POLICY_DELETE_VARIABLE_ANNOTATION: StaticSchema = ( + 18, + n0, + _ARPDVA, + 0, + (_n,), + ((AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE_NAME, 1),), +) + +AUTOMATED_REASONING_POLICY_ANNOTATION_INGEST_CONTENT: StaticSchema = (3, n0, _ARPAIC, 4) + +AUTOMATED_REASONING_POLICY_INGEST_CONTENT_ANNOTATION: StaticSchema = ( + 18, + n0, + _ARPICA, + 0, + (_con,), + ((AUTOMATED_REASONING_POLICY_ANNOTATION_INGEST_CONTENT, 1),), +) + +AUTOMATED_REASONING_POLICY_ANNOTATION_FEEDBACK_NATURAL_LANGUAGE: StaticSchema = ( + 3, + n0, + _ARPAFNL, + 4, +) + +AUTOMATED_REASONING_POLICY_DEFINITION_RULE_ID_LIST: StaticSchema = ( + 16, + n0, + _ARPDRIL, + 0, + (_me,), + ((AUTOMATED_REASONING_POLICY_DEFINITION_RULE_ID, 0),), +) + +AUTOMATED_REASONING_POLICY_UPDATE_FROM_RULE_FEEDBACK_ANNOTATION: StaticSchema = ( + 18, + n0, + _ARPUFRFA, + 0, + (_rIu, _fe), + ( + (AUTOMATED_REASONING_POLICY_DEFINITION_RULE_ID_LIST, 0), + (AUTOMATED_REASONING_POLICY_ANNOTATION_FEEDBACK_NATURAL_LANGUAGE, 1), + ), ) -AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE_DESCRIPTION = Schema( - id=ShapeID( - "com.amazonaws.bedrock#AutomatedReasoningPolicyDefinitionVariableDescription" +AUTOMATED_REASONING_POLICY_SCENARIO_EXPRESSION: StaticSchema = (3, n0, _ARPSE, 4) + +AUTOMATED_REASONING_POLICY_UPDATE_FROM_SCENARIO_FEEDBACK_ANNOTATION: StaticSchema = ( + 18, + n0, + _ARPUFSFA, + 0, + (_rIu, _sEc, _fe), + ( + (AUTOMATED_REASONING_POLICY_DEFINITION_RULE_ID_LIST, 0), + (AUTOMATED_REASONING_POLICY_SCENARIO_EXPRESSION, 1), + (AUTOMATED_REASONING_POLICY_ANNOTATION_FEEDBACK_NATURAL_LANGUAGE, 0), ), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], ) -AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE_NAME = Schema( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyDefinitionVariableName"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +AUTOMATED_REASONING_POLICY_UPDATE_RULE_ANNOTATION: StaticSchema = ( + 18, + n0, + _ARPURA, + 0, + (_rI, _ex), + ( + (AUTOMATED_REASONING_POLICY_DEFINITION_RULE_ID, 1), + (AUTOMATED_REASONING_POLICY_DEFINITION_RULE_EXPRESSION, 1), + ), ) -AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyDefinitionVariable"), - members={ - "name": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "type": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE_DESCRIPTION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +AUTOMATED_REASONING_POLICY_ADD_TYPE_VALUE: StaticSchema = ( + 18, + n0, + _ARPATV, + 0, + (_v, _d), + ( + (AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE_NAME, 1), + (AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE_DESCRIPTION, 0), + ), ) -AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyDefinitionVariableList"), - shape_type=ShapeType.LIST, - members={"member": {"target": AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE}}, +AUTOMATED_REASONING_POLICY_DELETE_TYPE_VALUE: StaticSchema = ( + 18, + n0, + _ARPDTVu, + 0, + (_v,), + ((AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE_NAME, 1),), +) + +AUTOMATED_REASONING_POLICY_UPDATE_TYPE_VALUE: StaticSchema = ( + 18, + n0, + _ARPUTV, + 0, + (_v, _nV, _d), + ( + (AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE_NAME, 1), + (AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE_NAME, 0), + (AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE_DESCRIPTION, 0), + ), ) -AUTOMATED_REASONING_POLICY_FORMAT_VERSION = Schema( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyFormatVersion"), - shape_type=ShapeType.STRING, +AUTOMATED_REASONING_POLICY_TYPE_VALUE_ANNOTATION: StaticSchema = ( + 19, + n0, + _ARPTVA, + 0, + (_aTV, _uTV, _dTV), + ( + (AUTOMATED_REASONING_POLICY_ADD_TYPE_VALUE, 0), + (AUTOMATED_REASONING_POLICY_UPDATE_TYPE_VALUE, 0), + (AUTOMATED_REASONING_POLICY_DELETE_TYPE_VALUE, 0), + ), ) -AUTOMATED_REASONING_POLICY_DEFINITION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyDefinition"), - members={ - "version": { - "target": AUTOMATED_REASONING_POLICY_FORMAT_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="1")], - }, - "types": {"target": AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_LIST}, - "rules": {"target": AUTOMATED_REASONING_POLICY_DEFINITION_RULE_LIST}, - "variables": {"target": AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE_LIST}, - }, +AUTOMATED_REASONING_POLICY_TYPE_VALUE_ANNOTATION_LIST: StaticSchema = ( + 16, + n0, + _ARPTVAL, + 0, + (_me,), + ((AUTOMATED_REASONING_POLICY_TYPE_VALUE_ANNOTATION, 0),), +) + +AUTOMATED_REASONING_POLICY_UPDATE_TYPE_ANNOTATION: StaticSchema = ( + 18, + n0, + _ARPUTA, + 0, + (_n, _nN, _d, _va), + ( + (AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_NAME, 1), + (AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_NAME, 0), + (AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_DESCRIPTION, 0), + (AUTOMATED_REASONING_POLICY_TYPE_VALUE_ANNOTATION_LIST, 1), + ), ) -CREATE_AUTOMATED_REASONING_POLICY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CreateAutomatedReasoningPolicyInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#CreateAutomatedReasoningPolicyRequest", - ) - ], - members={ - "name": { - "target": AUTOMATED_REASONING_POLICY_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": AUTOMATED_REASONING_POLICY_DESCRIPTION}, - "clientRequestToken": { - "target": IDEMPOTENCY_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "policyDefinition": {"target": AUTOMATED_REASONING_POLICY_DEFINITION}, - "kmsKeyId": {"target": KMS_KEY_ID}, - "tags": {"target": TAG_LIST}, - }, +AUTOMATED_REASONING_POLICY_UPDATE_VARIABLE_ANNOTATION: StaticSchema = ( + 18, + n0, + _ARPUVA, + 0, + (_n, _nN, _d), + ( + (AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE_NAME, 1), + (AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE_NAME, 0), + (AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE_DESCRIPTION, 0), + ), ) -AUTOMATED_REASONING_POLICY_HASH = Schema( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyHash"), - shape_type=ShapeType.STRING, +AUTOMATED_REASONING_POLICY_ANNOTATION: StaticSchema = ( + 19, + n0, + _ARPAu, + 0, + (_aT, _uT, _dT, _aV, _uV, _dV, _aR, _uR, _dR, _aRFNL, _uFRF, _uFSF, _iCng), + ( + (AUTOMATED_REASONING_POLICY_ADD_TYPE_ANNOTATION, 0), + (AUTOMATED_REASONING_POLICY_UPDATE_TYPE_ANNOTATION, 0), + (AUTOMATED_REASONING_POLICY_DELETE_TYPE_ANNOTATION, 0), + (AUTOMATED_REASONING_POLICY_ADD_VARIABLE_ANNOTATION, 0), + (AUTOMATED_REASONING_POLICY_UPDATE_VARIABLE_ANNOTATION, 0), + (AUTOMATED_REASONING_POLICY_DELETE_VARIABLE_ANNOTATION, 0), + (AUTOMATED_REASONING_POLICY_ADD_RULE_ANNOTATION, 0), + (AUTOMATED_REASONING_POLICY_UPDATE_RULE_ANNOTATION, 0), + (AUTOMATED_REASONING_POLICY_DELETE_RULE_ANNOTATION, 0), + (AUTOMATED_REASONING_POLICY_ADD_RULE_FROM_NATURAL_LANGUAGE_ANNOTATION, 0), + (AUTOMATED_REASONING_POLICY_UPDATE_FROM_RULE_FEEDBACK_ANNOTATION, 0), + (AUTOMATED_REASONING_POLICY_UPDATE_FROM_SCENARIO_FEEDBACK_ANNOTATION, 0), + (AUTOMATED_REASONING_POLICY_INGEST_CONTENT_ANNOTATION, 0), + ), ) -AUTOMATED_REASONING_POLICY_VERSION = Schema( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyVersion"), - shape_type=ShapeType.STRING, +AUTOMATED_REASONING_POLICY_ANNOTATION_LIST: StaticSchema = ( + 16, + n0, + _ARPAL, + 0, + (_me,), + ((AUTOMATED_REASONING_POLICY_ANNOTATION, 0),), +) + +GET_AUTOMATED_REASONING_POLICY_ANNOTATIONS_OUTPUT: StaticSchema = ( + 18, + n0, + _GARPAO, + {_sSI: _cGARPARo, _smith: None}, + (_pA, _n, _bWI, _a, _aSH, _uA), + ( + (AUTOMATED_REASONING_POLICY_ARN, 1), + (AUTOMATED_REASONING_POLICY_NAME, 1), + (AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_ID, 1), + (AUTOMATED_REASONING_POLICY_ANNOTATION_LIST, 1), + (AUTOMATED_REASONING_POLICY_HASH, 1), + (TIMESTAMP, 1), + ), ) -CREATE_AUTOMATED_REASONING_POLICY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CreateAutomatedReasoningPolicyOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#CreateAutomatedReasoningPolicyResponse", - ) - ], - members={ - "policyArn": { - "target": AUTOMATED_REASONING_POLICY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "version": { - "target": AUTOMATED_REASONING_POLICY_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": AUTOMATED_REASONING_POLICY_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": AUTOMATED_REASONING_POLICY_DESCRIPTION}, - "definitionHash": {"target": AUTOMATED_REASONING_POLICY_HASH}, - "createdAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +GET_AUTOMATED_REASONING_POLICY_ANNOTATIONS: StaticOperationSchema = ( + 23, + n0, + _GARPA, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "GET", + "uri": "/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowId}/annotations", + } + ) + }, + GET_AUTOMATED_REASONING_POLICY_ANNOTATIONS_INPUT, + GET_AUTOMATED_REASONING_POLICY_ANNOTATIONS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CREATE_AUTOMATED_REASONING_POLICY = Schema( - id=ShapeID("com.amazonaws.bedrock#CreateAutomatedReasoningPolicy"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "POST", "uri": "/automated-reasoning-policies"} - ), - ) - ], +GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT: StaticSchema = ( + 18, + n0, + _GARPBWI, + {_sSI: _cGARPBWR, _smit: None}, + (_pA, _bWI), + ( + (AUTOMATED_REASONING_POLICY_ARN, 9), + (AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_ID, 9), + ), ) -AUTOMATED_REASONING_CHECK_TRANSLATION_CONFIDENCE = Schema( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningCheckTranslationConfidence"), - shape_type=ShapeType.DOUBLE, +AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_TYPE: StaticSchema = ( + 14, + n0, + _ARPBWT, + 0, + (_IC_, _RP, _IP_, _GFR, _GPS, _RPA, _IRP), + ( + (-1, {_sV: _IC_}), + (-1, {_sV: _RP}), + (-1, {_sV: _IP_}), + (-1, {_sV: _GFR}), + (-1, {_sV: _GPS}), + (-1, {_sV: _RPA}), + (-1, {_sV: _IRP}), + ), ) -AUTOMATED_REASONING_CHECK_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningCheckResult"), - shape_type=ShapeType.ENUM, - members={ - "VALID": {"target": UNIT}, - "INVALID": {"target": UNIT}, - "SATISFIABLE": {"target": UNIT}, - "IMPOSSIBLE": {"target": UNIT}, - "TRANSLATION_AMBIGUOUS": {"target": UNIT}, - "TOO_COMPLEX": {"target": UNIT}, - "NO_TRANSLATION": {"target": UNIT}, - }, +AUTOMATED_REASONING_POLICY_BUILD_DOCUMENT_CONTENT_TYPE: StaticSchema = ( + 14, + n0, + _ARPBDCT, + 0, + (_PDF, _TEXT), + ((-1, {_sV: _p}), (-1, {_sV: _tx})), +) + +AUTOMATED_REASONING_POLICY_BUILD_DOCUMENT_DESCRIPTION: StaticSchema = ( + 3, + n0, + _ARPBDD, + 4, +) + +AUTOMATED_REASONING_POLICY_BUILD_DOCUMENT_NAME: StaticSchema = (3, n0, _ARPBDN, 4) + +AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_STATUS: StaticSchema = ( + 14, + n0, + _ARPBWS, + 0, + ( + _SCHEDULED, + _CR, + _PREPROCESSING, + _BUILDING, + _TESTING, + _COMPLETED, + _FAILED, + _CANCELLED, + ), + ( + (-1, {_sV: _SCHEDULED}), + (-1, {_sV: _CR}), + (-1, {_sV: _PREPROCESSING}), + (-1, {_sV: _BUILDING}), + (-1, {_sV: _TESTING}), + (-1, {_sV: _COMPLETED}), + (-1, {_sV: _FAILED}), + (-1, {_sV: _CANCELLED}), + ), ) -AUTOMATED_REASONING_POLICY_TEST_GUARD_CONTENT = Schema( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyTestGuardContent"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT: StaticSchema = ( + 18, + n0, + _GARPBWO, + {_sSI: _cGARPBWRo, _smith: None}, + (_pA, _bWI, _st, _bWT, _dN, _dCT, _dD, _cA, _uA), + ( + (AUTOMATED_REASONING_POLICY_ARN, 1), + (AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_ID, 1), + (AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_STATUS, 1), + (AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_TYPE, 1), + (AUTOMATED_REASONING_POLICY_BUILD_DOCUMENT_NAME, 0), + (AUTOMATED_REASONING_POLICY_BUILD_DOCUMENT_CONTENT_TYPE, 0), + (AUTOMATED_REASONING_POLICY_BUILD_DOCUMENT_DESCRIPTION, 0), + (TIMESTAMP, 1), + (TIMESTAMP, 1), + ), ) -AUTOMATED_REASONING_POLICY_TEST_QUERY_CONTENT = Schema( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyTestQueryContent"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW: StaticOperationSchema = ( + 23, + n0, + _GARPBW, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "GET", + "uri": "/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowId}", + } + ) + }, + GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT, + GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CREATE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CreateAutomatedReasoningPolicyTestCaseInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#CreateAutomatedReasoningPolicyTestCaseRequest", - ) - ], - members={ - "policyArn": { - "target": AUTOMATED_REASONING_POLICY_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "guardContent": { - "target": AUTOMATED_REASONING_POLICY_TEST_GUARD_CONTENT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "queryContent": {"target": AUTOMATED_REASONING_POLICY_TEST_QUERY_CONTENT}, - "expectedAggregatedFindingsResult": { - "target": AUTOMATED_REASONING_CHECK_RESULT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientRequestToken": { - "target": IDEMPOTENCY_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "confidenceThreshold": { - "target": AUTOMATED_REASONING_CHECK_TRANSLATION_CONFIDENCE - }, - }, +AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSET_ID: StaticSchema = (3, n0, _ARPBRAI, 0) + +AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSET_TYPE: StaticSchema = ( + 14, + n0, + _ARPBRAT, + 0, + (_BL, _QR, _PD, _GTC, _PS, _FR, _AM, _SD), + ( + (-1, {_sV: _BL}), + (-1, {_sV: _QR}), + (-1, {_sV: _PD}), + (-1, {_sV: _GTC}), + (-1, {_sV: _PS}), + (-1, {_sV: _FR}), + (-1, {_sV: _AM}), + (-1, {_sV: _SD}), + ), ) -AUTOMATED_REASONING_POLICY_TEST_CASE_ID = Schema( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyTestCaseId"), - shape_type=ShapeType.STRING, +GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_RESULT_ASSETS_INPUT: StaticSchema = ( + 18, + n0, + _GARPBWRAI, + {_sSI: _cGARPBWRAR, _smit: None}, + (_pA, _bWI, _aTs, _aI), + ( + (AUTOMATED_REASONING_POLICY_ARN, 9), + (AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_ID, 9), + (AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSET_TYPE, {_sQ: _aTs, _smi: None}), + (AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSET_ID, {_sQ: _aI}), + ), ) -CREATE_AUTOMATED_REASONING_POLICY_TEST_CASE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CreateAutomatedReasoningPolicyTestCaseOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#CreateAutomatedReasoningPolicyTestCaseResponse", - ) - ], - members={ - "policyArn": { - "target": AUTOMATED_REASONING_POLICY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "testCaseId": { - "target": AUTOMATED_REASONING_POLICY_TEST_CASE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSET_NAME: StaticSchema = (3, n0, _ARPBRAN, 4) -CREATE_AUTOMATED_REASONING_POLICY_TEST_CASE = Schema( - id=ShapeID("com.amazonaws.bedrock#CreateAutomatedReasoningPolicyTestCase"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "POST", - "uri": "/automated-reasoning-policies/{policyArn}/test-cases", - } - ), - ) - ], +AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSET_MANIFEST_ENTRY: StaticSchema = ( + 18, + n0, + _ARPBRAME, + 0, + (_aTs, _aN, _aI), + ( + (AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSET_TYPE, 1), + (AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSET_NAME, 0), + (AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSET_ID, 0), + ), ) -CREATE_AUTOMATED_REASONING_POLICY_VERSION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CreateAutomatedReasoningPolicyVersionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#CreateAutomatedReasoningPolicyVersionRequest", - ) - ], - members={ - "policyArn": { - "target": AUTOMATED_REASONING_POLICY_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "clientRequestToken": { - "target": IDEMPOTENCY_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "lastUpdatedDefinitionHash": { - "target": AUTOMATED_REASONING_POLICY_HASH, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "tags": {"target": TAG_LIST}, - }, +AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSET_MANIFEST_LIST: StaticSchema = ( + 16, + n0, + _ARPBRAML, + 0, + (_me,), + ((AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSET_MANIFEST_ENTRY, 0),), +) + +AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSET_MANIFEST: StaticSchema = ( + 18, + n0, + _ARPBRAM, + 0, + (_en,), + ((AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSET_MANIFEST_LIST, 1),), +) + +AUTOMATED_REASONING_POLICY_ADD_RULE_MUTATION: StaticSchema = ( + 18, + n0, + _ARPARM, + 0, + (_ru,), + ((AUTOMATED_REASONING_POLICY_DEFINITION_RULE, 1),), +) + +AUTOMATED_REASONING_POLICY_ADD_TYPE_MUTATION: StaticSchema = ( + 18, + n0, + _ARPATM, + 0, + (_ty,), + ((AUTOMATED_REASONING_POLICY_DEFINITION_TYPE, 1),), +) + +AUTOMATED_REASONING_POLICY_ADD_VARIABLE_MUTATION: StaticSchema = ( + 18, + n0, + _ARPAVM, + 0, + (_vari,), + ((AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE, 1),), +) + +AUTOMATED_REASONING_POLICY_DELETE_RULE_MUTATION: StaticSchema = ( + 18, + n0, + _ARPDRM, + 0, + (_i,), + ((AUTOMATED_REASONING_POLICY_DEFINITION_RULE_ID, 1),), +) + +AUTOMATED_REASONING_POLICY_DELETE_TYPE_MUTATION: StaticSchema = ( + 18, + n0, + _ARPDTM, + 0, + (_n,), + ((AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_NAME, 1),), +) + +AUTOMATED_REASONING_POLICY_DELETE_VARIABLE_MUTATION: StaticSchema = ( + 18, + n0, + _ARPDVM, + 0, + (_n,), + ((AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE_NAME, 1),), +) + +AUTOMATED_REASONING_POLICY_UPDATE_RULE_MUTATION: StaticSchema = ( + 18, + n0, + _ARPURM, + 0, + (_ru,), + ((AUTOMATED_REASONING_POLICY_DEFINITION_RULE, 1),), +) + +AUTOMATED_REASONING_POLICY_UPDATE_TYPE_MUTATION: StaticSchema = ( + 18, + n0, + _ARPUTM, + 0, + (_ty,), + ((AUTOMATED_REASONING_POLICY_DEFINITION_TYPE, 1),), +) + +AUTOMATED_REASONING_POLICY_UPDATE_VARIABLE_MUTATION: StaticSchema = ( + 18, + n0, + _ARPUVM, + 0, + (_vari,), + ((AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE, 1),), +) + +AUTOMATED_REASONING_POLICY_MUTATION: StaticSchema = ( + 19, + n0, + _ARPM, + 0, + (_aT, _uT, _dT, _aV, _uV, _dV, _aR, _uR, _dR), + ( + (AUTOMATED_REASONING_POLICY_ADD_TYPE_MUTATION, 0), + (AUTOMATED_REASONING_POLICY_UPDATE_TYPE_MUTATION, 0), + (AUTOMATED_REASONING_POLICY_DELETE_TYPE_MUTATION, 0), + (AUTOMATED_REASONING_POLICY_ADD_VARIABLE_MUTATION, 0), + (AUTOMATED_REASONING_POLICY_UPDATE_VARIABLE_MUTATION, 0), + (AUTOMATED_REASONING_POLICY_DELETE_VARIABLE_MUTATION, 0), + (AUTOMATED_REASONING_POLICY_ADD_RULE_MUTATION, 0), + (AUTOMATED_REASONING_POLICY_UPDATE_RULE_MUTATION, 0), + (AUTOMATED_REASONING_POLICY_DELETE_RULE_MUTATION, 0), + ), ) -CREATE_AUTOMATED_REASONING_POLICY_VERSION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CreateAutomatedReasoningPolicyVersionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#CreateAutomatedReasoningPolicyVersionResponse", - ) - ], - members={ - "policyArn": { - "target": AUTOMATED_REASONING_POLICY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "version": { - "target": AUTOMATED_REASONING_POLICY_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": AUTOMATED_REASONING_POLICY_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": AUTOMATED_REASONING_POLICY_DESCRIPTION}, - "definitionHash": { - "target": AUTOMATED_REASONING_POLICY_HASH, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +AUTOMATED_REASONING_POLICY_PLANNING: StaticSchema = (18, n0, _ARPP, 0) -CREATE_AUTOMATED_REASONING_POLICY_VERSION = Schema( - id=ShapeID("com.amazonaws.bedrock#CreateAutomatedReasoningPolicyVersion"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "POST", - "uri": "/automated-reasoning-policies/{policyArn}/versions", - } - ), - ) - ], +AUTOMATED_REASONING_POLICY_BUILD_STEP_CONTEXT: StaticSchema = ( + 19, + n0, + _ARPBSC, + 0, + (_pl, _mu), + ( + (AUTOMATED_REASONING_POLICY_PLANNING, 0), + (AUTOMATED_REASONING_POLICY_MUTATION, 0), + ), ) -DELETE_AUTOMATED_REASONING_POLICY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#DeleteAutomatedReasoningPolicyInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#DeleteAutomatedReasoningPolicyRequest", - ) - ], - members={ - "policyArn": { - "target": AUTOMATED_REASONING_POLICY_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "force": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=False), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="force"), - ], - }, - }, +AUTOMATED_REASONING_POLICY_BUILD_MESSAGE_TYPE: StaticSchema = ( + 14, + n0, + _ARPBMT, + 0, + (_INFO, _WARNING, _ERROR), + ((-1, {_sV: _INFO}), (-1, {_sV: _WARNING}), (-1, {_sV: _ERROR})), +) + +AUTOMATED_REASONING_POLICY_BUILD_STEP_MESSAGE: StaticSchema = ( + 18, + n0, + _ARPBSM, + 0, + (_m, _mTe), + ((3, 1), (AUTOMATED_REASONING_POLICY_BUILD_MESSAGE_TYPE, 1)), +) + +AUTOMATED_REASONING_POLICY_BUILD_STEP_MESSAGE_LIST: StaticSchema = ( + 16, + n0, + _ARPBSML, + 0, + (_me,), + ((AUTOMATED_REASONING_POLICY_BUILD_STEP_MESSAGE, 0),), +) + +AUTOMATED_REASONING_POLICY_DEFINITION_ELEMENT: StaticSchema = ( + 19, + n0, + _ARPDE, + 0, + (_pDV, _pDT, _pDR), + ( + (AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE, 0), + (AUTOMATED_REASONING_POLICY_DEFINITION_TYPE, 0), + (AUTOMATED_REASONING_POLICY_DEFINITION_RULE, 0), + ), ) -DELETE_AUTOMATED_REASONING_POLICY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#DeleteAutomatedReasoningPolicyOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#DeleteAutomatedReasoningPolicyResponse", - ) - ], -) - -RESOURCE_IN_USE_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ResourceInUseException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"message": {"target": NON_BLANK_STRING}}, -) - -DELETE_AUTOMATED_REASONING_POLICY = Schema( - id=ShapeID("com.amazonaws.bedrock#DeleteAutomatedReasoningPolicy"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 202, - "method": "DELETE", - "uri": "/automated-reasoning-policies/{policyArn}", - } - ), - ) - ], +AUTOMATED_REASONING_POLICY_BUILD_STEP: StaticSchema = ( + 18, + n0, + _ARPBS, + 0, + (_cont, _pE, _mes), + ( + (AUTOMATED_REASONING_POLICY_BUILD_STEP_CONTEXT, 1), + (AUTOMATED_REASONING_POLICY_DEFINITION_ELEMENT, 0), + (AUTOMATED_REASONING_POLICY_BUILD_STEP_MESSAGE_LIST, 1), + ), ) -DELETE_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrock#DeleteAutomatedReasoningPolicyBuildWorkflowInput" +AUTOMATED_REASONING_POLICY_BUILD_STEP_LIST: StaticSchema = ( + 16, + n0, + _ARPBSL, + 0, + (_me,), + ((AUTOMATED_REASONING_POLICY_BUILD_STEP, 0),), +) + +AUTOMATED_REASONING_POLICY_ANNOTATION_STATUS: StaticSchema = ( + 14, + n0, + _ARPAS, + 0, + (_APPLIED, _FAILED), + ((-1, {_sV: _APPLIED}), (-1, {_sV: _FAILED})), +) + +AUTOMATED_REASONING_POLICY_BUILD_LOG_ENTRY: StaticSchema = ( + 18, + n0, + _ARPBLE, + 0, + (_an, _st, _bS), + ( + (AUTOMATED_REASONING_POLICY_ANNOTATION, 1), + (AUTOMATED_REASONING_POLICY_ANNOTATION_STATUS, 1), + (AUTOMATED_REASONING_POLICY_BUILD_STEP_LIST, 1), ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#DeleteAutomatedReasoningPolicyBuildWorkflowRequest", - ) - ], - members={ - "policyArn": { - "target": AUTOMATED_REASONING_POLICY_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "buildWorkflowId": { - "target": AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "lastUpdatedAt": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="updatedAt"), - ], - }, - }, ) -DELETE_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrock#DeleteAutomatedReasoningPolicyBuildWorkflowOutput" +AUTOMATED_REASONING_POLICY_BUILD_LOG_ENTRY_LIST: StaticSchema = ( + 16, + n0, + _ARPBLEL, + 0, + (_me,), + ((AUTOMATED_REASONING_POLICY_BUILD_LOG_ENTRY, 0),), +) + +AUTOMATED_REASONING_POLICY_BUILD_LOG: StaticSchema = ( + 18, + n0, + _ARPBL, + 0, + (_en,), + ((AUTOMATED_REASONING_POLICY_BUILD_LOG_ENTRY_LIST, 1),), +) + +AUTOMATED_REASONING_POLICY_BUILD_DOCUMENT_BLOB: StaticSchema = (1, n0, _ARPBDB, 4) + +AUTOMATED_REASONING_POLICY_DOCUMENT_SHA256: StaticSchema = (3, n0, _ARPDS, 0) + +AUTOMATED_REASONING_POLICY_SOURCE_DOCUMENT: StaticSchema = ( + 18, + n0, + _ARPSD, + 0, + (_do, _dCT, _dN, _dD, _dHo), + ( + (AUTOMATED_REASONING_POLICY_BUILD_DOCUMENT_BLOB, 1), + (AUTOMATED_REASONING_POLICY_BUILD_DOCUMENT_CONTENT_TYPE, 1), + (AUTOMATED_REASONING_POLICY_BUILD_DOCUMENT_NAME, 1), + (AUTOMATED_REASONING_POLICY_BUILD_DOCUMENT_DESCRIPTION, 0), + (AUTOMATED_REASONING_POLICY_DOCUMENT_SHA256, 1), ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#DeleteAutomatedReasoningPolicyBuildWorkflowResponse", - ) - ], -) - -DELETE_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW = Schema( - id=ShapeID("com.amazonaws.bedrock#DeleteAutomatedReasoningPolicyBuildWorkflow"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 202, - "method": "DELETE", - "uri": "/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowId}", - } - ), - ) - ], ) -DELETE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#DeleteAutomatedReasoningPolicyTestCaseInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#DeleteAutomatedReasoningPolicyTestCaseRequest", - ) - ], - members={ - "policyArn": { - "target": AUTOMATED_REASONING_POLICY_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "testCaseId": { - "target": AUTOMATED_REASONING_POLICY_TEST_CASE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "lastUpdatedAt": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="updatedAt"), - ], - }, - }, +AUTOMATED_REASONING_POLICY_ACCURACY_SCORE: StaticSchema = (10, n0, _ARPASu, 0) + +AUTOMATED_REASONING_POLICY_COVERAGE_SCORE: StaticSchema = (10, n0, _ARPCS, 0) + +AUTOMATED_REASONING_POLICY_STATEMENT_ID: StaticSchema = (3, n0, _ARPSI, 0) + +AUTOMATED_REASONING_POLICY_LINE_NUMBER_LIST: StaticSchema = ( + 16, + n0, + _ARPLNL, + 0, + (_me,), + ((7, 0),), ) -DELETE_AUTOMATED_REASONING_POLICY_TEST_CASE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#DeleteAutomatedReasoningPolicyTestCaseOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#DeleteAutomatedReasoningPolicyTestCaseResponse", - ) - ], -) - -DELETE_AUTOMATED_REASONING_POLICY_TEST_CASE = Schema( - id=ShapeID("com.amazonaws.bedrock#DeleteAutomatedReasoningPolicyTestCase"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 202, - "method": "DELETE", - "uri": "/automated-reasoning-policies/{policyArn}/test-cases/{testCaseId}", - } - ), - ) - ], +AUTOMATED_REASONING_POLICY_STATEMENT_LOCATION: StaticSchema = ( + 18, + n0, + _ARPSL, + 0, + (_l,), + ((AUTOMATED_REASONING_POLICY_LINE_NUMBER_LIST, 1),), ) -EXPORT_AUTOMATED_REASONING_POLICY_VERSION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ExportAutomatedReasoningPolicyVersionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#ExportAutomatedReasoningPolicyVersionRequest", - ) - ], - members={ - "policyArn": { - "target": AUTOMATED_REASONING_POLICY_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, +AUTOMATED_REASONING_POLICY_STATEMENT_TEXT: StaticSchema = (3, n0, _ARPST, 4) + +AUTOMATED_REASONING_POLICY_ATOMIC_STATEMENT: StaticSchema = ( + 18, + n0, + _ARPASut, + 0, + (_i, _te, _lo), + ( + (AUTOMATED_REASONING_POLICY_STATEMENT_ID, 1), + (AUTOMATED_REASONING_POLICY_STATEMENT_TEXT, 1), + (AUTOMATED_REASONING_POLICY_STATEMENT_LOCATION, 1), + ), ) -EXPORT_AUTOMATED_REASONING_POLICY_VERSION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ExportAutomatedReasoningPolicyVersionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#ExportAutomatedReasoningPolicyVersionResponse", - ) - ], - members={ - "policyDefinition": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpPayload")), - ], - } - }, +AUTOMATED_REASONING_POLICY_ATOMIC_STATEMENT_LIST: StaticSchema = ( + 16, + n0, + _ARPASL, + 0, + (_me,), + ((AUTOMATED_REASONING_POLICY_ATOMIC_STATEMENT, 0),), +) + +AUTOMATED_REASONING_POLICY_LINE_TEXT: StaticSchema = (3, n0, _ARPLT, 4) + +AUTOMATED_REASONING_POLICY_ANNOTATED_LINE: StaticSchema = ( + 18, + n0, + _ARPALu, + 0, + (_lN, _lT), + ((7, 0), (AUTOMATED_REASONING_POLICY_LINE_TEXT, 0)), +) + +AUTOMATED_REASONING_POLICY_ANNOTATED_CONTENT: StaticSchema = ( + 19, + n0, + _ARPAC, + 0, + (_li,), + ((AUTOMATED_REASONING_POLICY_ANNOTATED_LINE, 0),), +) + +AUTOMATED_REASONING_POLICY_ANNOTATED_CONTENT_LIST: StaticSchema = ( + 16, + n0, + _ARPACL, + 0, + (_me,), + ((AUTOMATED_REASONING_POLICY_ANNOTATED_CONTENT, 0),), +) + +AUTOMATED_REASONING_POLICY_ANNOTATED_CHUNK: StaticSchema = ( + 18, + n0, + _ARPACu, + 0, + (_pN, _con), + ((7, 0), (AUTOMATED_REASONING_POLICY_ANNOTATED_CONTENT_LIST, 1)), +) + +AUTOMATED_REASONING_POLICY_ANNOTATED_CHUNK_LIST: StaticSchema = ( + 16, + n0, + _ARPACLu, + 0, + (_me,), + ((AUTOMATED_REASONING_POLICY_ANNOTATED_CHUNK, 0),), +) + +AUTOMATED_REASONING_POLICY_DOCUMENT_ID: StaticSchema = (3, n0, _ARPDI, 0) + +AUTOMATED_REASONING_POLICY_REPORT_SOURCE_DOCUMENT: StaticSchema = ( + 18, + n0, + _ARPRSD, + 0, + (_dN, _dHo, _dI, _aS, _dC), + ( + (AUTOMATED_REASONING_POLICY_BUILD_DOCUMENT_NAME, 1), + (AUTOMATED_REASONING_POLICY_DOCUMENT_SHA256, 1), + (AUTOMATED_REASONING_POLICY_DOCUMENT_ID, 1), + (AUTOMATED_REASONING_POLICY_ATOMIC_STATEMENT_LIST, 1), + (AUTOMATED_REASONING_POLICY_ANNOTATED_CHUNK_LIST, 1), + ), ) -EXPORT_AUTOMATED_REASONING_POLICY_VERSION = Schema( - id=ShapeID("com.amazonaws.bedrock#ExportAutomatedReasoningPolicyVersion"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/automated-reasoning-policies/{policyArn}/export", - } - ), - ) - ], +AUTOMATED_REASONING_POLICY_REPORT_SOURCE_DOCUMENT_LIST: StaticSchema = ( + 16, + n0, + _ARPRSDL, + 0, + (_me,), + ((AUTOMATED_REASONING_POLICY_REPORT_SOURCE_DOCUMENT, 0),), ) -GET_AUTOMATED_REASONING_POLICY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetAutomatedReasoningPolicyInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetAutomatedReasoningPolicyRequest", - ) - ], - members={ - "policyArn": { - "target": AUTOMATED_REASONING_POLICY_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, +AUTOMATED_REASONING_POLICY_JUSTIFICATION_TEXT: StaticSchema = (3, n0, _ARPJT, 4) + +AUTOMATED_REASONING_POLICY_JUSTIFICATION_LIST: StaticSchema = ( + 16, + n0, + _ARPJL, + 0, + (_me,), + ((AUTOMATED_REASONING_POLICY_JUSTIFICATION_TEXT, 0),), ) -AUTOMATED_REASONING_POLICY_ID = Schema( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyId"), - shape_type=ShapeType.STRING, +AUTOMATED_REASONING_POLICY_STATEMENT_REFERENCE: StaticSchema = ( + 18, + n0, + _ARPSR, + 0, + (_dI, _sI), + ( + (AUTOMATED_REASONING_POLICY_DOCUMENT_ID, 1), + (AUTOMATED_REASONING_POLICY_STATEMENT_ID, 1), + ), ) -GET_AUTOMATED_REASONING_POLICY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetAutomatedReasoningPolicyOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetAutomatedReasoningPolicyResponse", - ) - ], - members={ - "policyArn": { - "target": AUTOMATED_REASONING_POLICY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": AUTOMATED_REASONING_POLICY_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "version": { - "target": AUTOMATED_REASONING_POLICY_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "policyId": { - "target": AUTOMATED_REASONING_POLICY_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": AUTOMATED_REASONING_POLICY_DESCRIPTION}, - "definitionHash": { - "target": AUTOMATED_REASONING_POLICY_HASH, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "kmsKeyArn": {"target": KMS_KEY_ARN}, - "createdAt": {"target": TIMESTAMP}, - "updatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +AUTOMATED_REASONING_POLICY_STATEMENT_REFERENCE_LIST: StaticSchema = ( + 16, + n0, + _ARPSRL, + 0, + (_me,), + ((AUTOMATED_REASONING_POLICY_STATEMENT_REFERENCE, 0),), +) + +AUTOMATED_REASONING_POLICY_RULE_REPORT: StaticSchema = ( + 18, + n0, + _ARPRR, + 0, + (_ru, _gS, _gJ, _aSc, _aJ), + ( + (AUTOMATED_REASONING_POLICY_DEFINITION_RULE_ID, 1), + (AUTOMATED_REASONING_POLICY_STATEMENT_REFERENCE_LIST, 0), + (AUTOMATED_REASONING_POLICY_JUSTIFICATION_LIST, 0), + (AUTOMATED_REASONING_POLICY_ACCURACY_SCORE, 0), + (AUTOMATED_REASONING_POLICY_JUSTIFICATION_TEXT, 0), + ), ) -GET_AUTOMATED_REASONING_POLICY = Schema( - id=ShapeID("com.amazonaws.bedrock#GetAutomatedReasoningPolicy"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/automated-reasoning-policies/{policyArn}", - } - ), - ) - ], +AUTOMATED_REASONING_POLICY_RULE_REPORT_MAP: StaticSchema = ( + 17, + n0, + _ARPRRM, + 0, + (_k, _v), + ( + (AUTOMATED_REASONING_POLICY_DEFINITION_RULE_ID, 0), + (AUTOMATED_REASONING_POLICY_RULE_REPORT, 0), + ), ) -GET_AUTOMATED_REASONING_POLICY_ANNOTATIONS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetAutomatedReasoningPolicyAnnotationsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetAutomatedReasoningPolicyAnnotationsRequest", - ) - ], - members={ - "policyArn": { - "target": AUTOMATED_REASONING_POLICY_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "buildWorkflowId": { - "target": AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, +AUTOMATED_REASONING_POLICY_VARIABLE_REPORT: StaticSchema = ( + 18, + n0, + _ARPVR, + 0, + (_pV, _gS, _gJ, _aSc, _aJ), + ( + (AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE_NAME, 1), + (AUTOMATED_REASONING_POLICY_STATEMENT_REFERENCE_LIST, 0), + (AUTOMATED_REASONING_POLICY_JUSTIFICATION_LIST, 0), + (AUTOMATED_REASONING_POLICY_ACCURACY_SCORE, 0), + (AUTOMATED_REASONING_POLICY_JUSTIFICATION_TEXT, 0), + ), ) -AUTOMATED_REASONING_POLICY_ADD_RULE_ANNOTATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyAddRuleAnnotation"), - members={ - "expression": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_RULE_EXPRESSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +AUTOMATED_REASONING_POLICY_VARIABLE_REPORT_MAP: StaticSchema = ( + 17, + n0, + _ARPVRM, + 0, + (_k, _v), + ( + (AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE_NAME, 0), + (AUTOMATED_REASONING_POLICY_VARIABLE_REPORT, 0), + ), ) -AUTOMATED_REASONING_POLICY_ANNOTATION_RULE_NATURAL_LANGUAGE = Schema( - id=ShapeID( - "com.amazonaws.bedrock#AutomatedReasoningPolicyAnnotationRuleNaturalLanguage" +AUTOMATED_REASONING_POLICY_FIDELITY_REPORT: StaticSchema = ( + 18, + n0, + _ARPFR, + 0, + (_cS, _aSc, _rR, _vR, _dS), + ( + (AUTOMATED_REASONING_POLICY_COVERAGE_SCORE, 1), + (AUTOMATED_REASONING_POLICY_ACCURACY_SCORE, 1), + (AUTOMATED_REASONING_POLICY_RULE_REPORT_MAP, 1), + (AUTOMATED_REASONING_POLICY_VARIABLE_REPORT_MAP, 1), + (AUTOMATED_REASONING_POLICY_REPORT_SOURCE_DOCUMENT_LIST, 1), ), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], ) -AUTOMATED_REASONING_POLICY_ADD_RULE_FROM_NATURAL_LANGUAGE_ANNOTATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrock#AutomatedReasoningPolicyAddRuleFromNaturalLanguageAnnotation" +AUTOMATED_REASONING_POLICY_GENERATED_TEST_CASE: StaticSchema = ( + 18, + n0, + _ARPGTC, + 0, + (_qC, _gC, _eAFR), + ( + (AUTOMATED_REASONING_POLICY_TEST_QUERY_CONTENT, 1), + (AUTOMATED_REASONING_POLICY_TEST_GUARD_CONTENT, 1), + (AUTOMATED_REASONING_CHECK_RESULT, 1), ), - members={ - "naturalLanguage": { - "target": AUTOMATED_REASONING_POLICY_ANNOTATION_RULE_NATURAL_LANGUAGE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, ) -AUTOMATED_REASONING_POLICY_ADD_TYPE_ANNOTATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyAddTypeAnnotation"), - members={ - "name": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_DESCRIPTION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "values": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +AUTOMATED_REASONING_POLICY_GENERATED_TEST_CASE_LIST: StaticSchema = ( + 16, + n0, + _ARPGTCL, + 0, + (_me,), + ((AUTOMATED_REASONING_POLICY_GENERATED_TEST_CASE, 0),), +) + +AUTOMATED_REASONING_POLICY_GENERATED_TEST_CASES: StaticSchema = ( + 18, + n0, + _ARPGTCu, + 0, + (_gTC,), + ((AUTOMATED_REASONING_POLICY_GENERATED_TEST_CASE_LIST, 1),), +) + +AUTOMATED_REASONING_POLICY_SCENARIO_ALTERNATE_EXPRESSION: StaticSchema = ( + 3, + n0, + _ARPSAE, + 4, +) + +AUTOMATED_REASONING_POLICY_SCENARIO: StaticSchema = ( + 18, + n0, + _ARPS, + 0, + (_ex, _aE, _eR, _rIu), + ( + (AUTOMATED_REASONING_POLICY_SCENARIO_EXPRESSION, 1), + (AUTOMATED_REASONING_POLICY_SCENARIO_ALTERNATE_EXPRESSION, 1), + (AUTOMATED_REASONING_CHECK_RESULT, 1), + (AUTOMATED_REASONING_POLICY_DEFINITION_RULE_ID_LIST, 1), + ), ) -AUTOMATED_REASONING_POLICY_ADD_VARIABLE_ANNOTATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyAddVariableAnnotation"), - members={ - "name": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "type": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE_DESCRIPTION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +AUTOMATED_REASONING_POLICY_SCENARIO_LIST: StaticSchema = ( + 16, + n0, + _ARPSLu, + 0, + (_me,), + ((AUTOMATED_REASONING_POLICY_SCENARIO, 0),), +) + +AUTOMATED_REASONING_POLICY_SCENARIOS: StaticSchema = ( + 18, + n0, + _ARPSu, + 0, + (_pS,), + ((AUTOMATED_REASONING_POLICY_SCENARIO_LIST, 1),), +) + +AUTOMATED_REASONING_POLICY_CONFLICTED_RULE_ID_LIST: StaticSchema = ( + 16, + n0, + _ARPCRIL, + 0, + (_me,), + ((AUTOMATED_REASONING_POLICY_DEFINITION_RULE_ID, 0),), +) + +AUTOMATED_REASONING_POLICY_DISJOINTED_RULE_ID_LIST: StaticSchema = ( + 16, + n0, + _ARPDRILu, + 0, + (_me,), + ((AUTOMATED_REASONING_POLICY_DEFINITION_RULE_ID, 0),), +) + +AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE_NAME_LIST: StaticSchema = ( + 16, + n0, + _ARPDVNL, + 0, + (_me,), + ((AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE_NAME, 0),), +) + +AUTOMATED_REASONING_POLICY_DISJOINT_RULE_SET: StaticSchema = ( + 18, + n0, + _ARPDRS, + 0, + (_var, _r), + ( + (AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE_NAME_LIST, 1), + (AUTOMATED_REASONING_POLICY_DISJOINTED_RULE_ID_LIST, 1), + ), ) -AUTOMATED_REASONING_POLICY_DELETE_RULE_ANNOTATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyDeleteRuleAnnotation"), - members={ - "ruleId": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_RULE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +AUTOMATED_REASONING_POLICY_DISJOINT_RULE_SET_LIST: StaticSchema = ( + 16, + n0, + _ARPDRSL, + 0, + (_me,), + ((AUTOMATED_REASONING_POLICY_DISJOINT_RULE_SET, 0),), +) + +AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_NAME_LIST: StaticSchema = ( + 16, + n0, + _ARPDTNL, + 0, + (_me,), + ((AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_NAME, 0),), +) + +AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE_PAIR: StaticSchema = ( + 18, + n0, + _ARPDTVP, + 0, + (_tN, _vN), + ( + (AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_NAME, 1), + (AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE_NAME, 1), + ), ) -AUTOMATED_REASONING_POLICY_DELETE_TYPE_ANNOTATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyDeleteTypeAnnotation"), - members={ - "name": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE_PAIR_LIST: StaticSchema = ( + 16, + n0, + _ARPDTVPL, + 0, + (_me,), + ((AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE_PAIR, 0),), +) + +AUTOMATED_REASONING_POLICY_DEFINITION_QUALITY_REPORT: StaticSchema = ( + 18, + n0, + _ARPDQR, + 0, + (_tC, _vC, _rC, _uTn, _uTVn, _uVn, _cR, _dRS), + ( + (7, 1), + (7, 1), + (7, 1), + (AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_NAME_LIST, 1), + (AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE_PAIR_LIST, 1), + (AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE_NAME_LIST, 1), + (AUTOMATED_REASONING_POLICY_CONFLICTED_RULE_ID_LIST, 1), + (AUTOMATED_REASONING_POLICY_DISJOINT_RULE_SET_LIST, 1), + ), ) -AUTOMATED_REASONING_POLICY_DELETE_VARIABLE_ANNOTATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrock#AutomatedReasoningPolicyDeleteVariableAnnotation" +AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSETS: StaticSchema = ( + 19, + n0, + _ARPBRA, + 0, + (_pD, _qR, _bL, _gTC, _pS, _aM, _do, _fR), + ( + (AUTOMATED_REASONING_POLICY_DEFINITION, 0), + (AUTOMATED_REASONING_POLICY_DEFINITION_QUALITY_REPORT, 0), + (AUTOMATED_REASONING_POLICY_BUILD_LOG, 0), + (AUTOMATED_REASONING_POLICY_GENERATED_TEST_CASES, 0), + (AUTOMATED_REASONING_POLICY_SCENARIOS, 0), + (AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSET_MANIFEST, 0), + (AUTOMATED_REASONING_POLICY_SOURCE_DOCUMENT, 0), + (AUTOMATED_REASONING_POLICY_FIDELITY_REPORT, 0), ), - members={ - "name": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, ) -AUTOMATED_REASONING_POLICY_ANNOTATION_INGEST_CONTENT = Schema( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyAnnotationIngestContent"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_RESULT_ASSETS_OUTPUT: StaticSchema = ( + 18, + n0, + _GARPBWRAO, + {_sSI: _cGARPBWRARo, _smith: None}, + (_pA, _bWI, _bWA), + ( + (AUTOMATED_REASONING_POLICY_ARN, 1), + (AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_ID, 1), + (AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSETS, 0), + ), ) -AUTOMATED_REASONING_POLICY_INGEST_CONTENT_ANNOTATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyIngestContentAnnotation"), - members={ - "content": { - "target": AUTOMATED_REASONING_POLICY_ANNOTATION_INGEST_CONTENT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_RESULT_ASSETS: StaticOperationSchema = ( + 23, + n0, + _GARPBWRA, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "GET", + "uri": "/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowId}/result-assets", + } + ) + }, + GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_RESULT_ASSETS_INPUT, + GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_RESULT_ASSETS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AUTOMATED_REASONING_POLICY_ANNOTATION_FEEDBACK_NATURAL_LANGUAGE = Schema( - id=ShapeID( - "com.amazonaws.bedrock#AutomatedReasoningPolicyAnnotationFeedbackNaturalLanguage" +GET_AUTOMATED_REASONING_POLICY_NEXT_SCENARIO_INPUT: StaticSchema = ( + 18, + n0, + _GARPNSI, + {_sSI: _cGARPNSR, _smit: None}, + (_pA, _bWI), + ( + (AUTOMATED_REASONING_POLICY_ARN, 9), + (AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_ID, 9), ), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], ) -AUTOMATED_REASONING_POLICY_DEFINITION_RULE_ID_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyDefinitionRuleIdList"), - shape_type=ShapeType.LIST, - members={"member": {"target": AUTOMATED_REASONING_POLICY_DEFINITION_RULE_ID}}, +GET_AUTOMATED_REASONING_POLICY_NEXT_SCENARIO_OUTPUT: StaticSchema = ( + 18, + n0, + _GARPNSO, + {_sSI: _cGARPNSRo, _smith: None}, + (_pA, _sc), + ((AUTOMATED_REASONING_POLICY_ARN, 1), (AUTOMATED_REASONING_POLICY_SCENARIO, 0)), +) + +GET_AUTOMATED_REASONING_POLICY_NEXT_SCENARIO: StaticOperationSchema = ( + 23, + n0, + _GARPNS, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "GET", + "uri": "/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowId}/scenarios", + } + ) + }, + GET_AUTOMATED_REASONING_POLICY_NEXT_SCENARIO_INPUT, + GET_AUTOMATED_REASONING_POLICY_NEXT_SCENARIO_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AUTOMATED_REASONING_POLICY_UPDATE_FROM_RULE_FEEDBACK_ANNOTATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrock#AutomatedReasoningPolicyUpdateFromRuleFeedbackAnnotation" +GET_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT: StaticSchema = ( + 18, + n0, + _GARPTCI, + {_sSI: _cGARPTCR, _smit: None}, + (_pA, _tCI), + ((AUTOMATED_REASONING_POLICY_ARN, 9), (AUTOMATED_REASONING_POLICY_TEST_CASE_ID, 9)), +) + +AUTOMATED_REASONING_POLICY_TEST_CASE: StaticSchema = ( + 18, + n0, + _ARPTC, + 0, + (_tCI, _gC, _qC, _eAFR, _cA, _uA, _cTo), + ( + (AUTOMATED_REASONING_POLICY_TEST_CASE_ID, 1), + (AUTOMATED_REASONING_POLICY_TEST_GUARD_CONTENT, 1), + (AUTOMATED_REASONING_POLICY_TEST_QUERY_CONTENT, 0), + (AUTOMATED_REASONING_CHECK_RESULT, 0), + (TIMESTAMP, 1), + (TIMESTAMP, 1), + (AUTOMATED_REASONING_CHECK_TRANSLATION_CONFIDENCE, 0), ), - members={ - "ruleIds": {"target": AUTOMATED_REASONING_POLICY_DEFINITION_RULE_ID_LIST}, - "feedback": { - "target": AUTOMATED_REASONING_POLICY_ANNOTATION_FEEDBACK_NATURAL_LANGUAGE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, ) -AUTOMATED_REASONING_POLICY_SCENARIO_EXPRESSION = Schema( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyScenarioExpression"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +GET_AUTOMATED_REASONING_POLICY_TEST_CASE_OUTPUT: StaticSchema = ( + 18, + n0, + _GARPTCO, + {_sSI: _cGARPTCRo, _smith: None}, + (_pA, _tCe), + ((AUTOMATED_REASONING_POLICY_ARN, 1), (AUTOMATED_REASONING_POLICY_TEST_CASE, 1)), +) + +GET_AUTOMATED_REASONING_POLICY_TEST_CASE: StaticOperationSchema = ( + 23, + n0, + _GARPTC, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "GET", + "uri": "/automated-reasoning-policies/{policyArn}/test-cases/{testCaseId}", + } + ) + }, + GET_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT, + GET_AUTOMATED_REASONING_POLICY_TEST_CASE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AUTOMATED_REASONING_POLICY_UPDATE_FROM_SCENARIO_FEEDBACK_ANNOTATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrock#AutomatedReasoningPolicyUpdateFromScenarioFeedbackAnnotation" +GET_AUTOMATED_REASONING_POLICY_TEST_RESULT_INPUT: StaticSchema = ( + 18, + n0, + _GARPTRI, + {_sSI: _cGARPTRR, _smit: None}, + (_pA, _bWI, _tCI), + ( + (AUTOMATED_REASONING_POLICY_ARN, 9), + (AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_ID, 9), + (AUTOMATED_REASONING_POLICY_TEST_CASE_ID, 9), ), - members={ - "ruleIds": {"target": AUTOMATED_REASONING_POLICY_DEFINITION_RULE_ID_LIST}, - "scenarioExpression": { - "target": AUTOMATED_REASONING_POLICY_SCENARIO_EXPRESSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "feedback": { - "target": AUTOMATED_REASONING_POLICY_ANNOTATION_FEEDBACK_NATURAL_LANGUAGE - }, - }, ) -AUTOMATED_REASONING_POLICY_UPDATE_RULE_ANNOTATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyUpdateRuleAnnotation"), - members={ - "ruleId": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_RULE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "expression": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_RULE_EXPRESSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +AUTOMATED_REASONING_CHECK_RULE: StaticSchema = ( + 18, + n0, + _ARCRu, + 0, + (_i, _pVA), + ( + (AUTOMATED_REASONING_POLICY_DEFINITION_RULE_ID, 0), + (AUTOMATED_REASONING_POLICY_ARN, 0), + ), ) -AUTOMATED_REASONING_POLICY_ADD_TYPE_VALUE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyAddTypeValue"), - members={ - "value": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE_DESCRIPTION - }, - }, +AUTOMATED_REASONING_CHECK_RULE_LIST: StaticSchema = ( + 16, + n0, + _ARCRL, + 0, + (_me,), + ((AUTOMATED_REASONING_CHECK_RULE, 0),), ) -AUTOMATED_REASONING_POLICY_DELETE_TYPE_VALUE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyDeleteTypeValue"), - members={ - "value": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +AUTOMATED_REASONING_LOGIC_STATEMENT_CONTENT: StaticSchema = (3, n0, _ARLSC, 4) + +AUTOMATED_REASONING_NATURAL_LANGUAGE_STATEMENT_CONTENT: StaticSchema = ( + 3, + n0, + _ARNLSC, + 4, ) -AUTOMATED_REASONING_POLICY_UPDATE_TYPE_VALUE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyUpdateTypeValue"), - members={ - "value": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "newValue": {"target": AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE_NAME}, - "description": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE_DESCRIPTION - }, - }, +AUTOMATED_REASONING_LOGIC_STATEMENT: StaticSchema = ( + 18, + n0, + _ARLS, + 0, + (_log, _nL), + ( + (AUTOMATED_REASONING_LOGIC_STATEMENT_CONTENT, 1), + (AUTOMATED_REASONING_NATURAL_LANGUAGE_STATEMENT_CONTENT, 0), + ), ) -AUTOMATED_REASONING_POLICY_TYPE_VALUE_ANNOTATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyTypeValueAnnotation"), - shape_type=ShapeType.UNION, - members={ - "addTypeValue": {"target": AUTOMATED_REASONING_POLICY_ADD_TYPE_VALUE}, - "updateTypeValue": {"target": AUTOMATED_REASONING_POLICY_UPDATE_TYPE_VALUE}, - "deleteTypeValue": {"target": AUTOMATED_REASONING_POLICY_DELETE_TYPE_VALUE}, - }, +AUTOMATED_REASONING_LOGIC_STATEMENT_LIST: StaticSchema = ( + 16, + n0, + _ARLSL, + 0, + (_me,), + ((AUTOMATED_REASONING_LOGIC_STATEMENT, 0),), +) + +AUTOMATED_REASONING_CHECK_LOGIC_WARNING_TYPE: StaticSchema = ( + 14, + n0, + _ARCLWT, + 0, + (_AT, _AF), + ((-1, {_sV: _AT}), (-1, {_sV: _AF})), +) + +AUTOMATED_REASONING_CHECK_LOGIC_WARNING: StaticSchema = ( + 18, + n0, + _ARCLW, + 0, + (_ty, _pr, _cl), + ( + (AUTOMATED_REASONING_CHECK_LOGIC_WARNING_TYPE, 0), + (AUTOMATED_REASONING_LOGIC_STATEMENT_LIST, 0), + (AUTOMATED_REASONING_LOGIC_STATEMENT_LIST, 0), + ), ) -AUTOMATED_REASONING_POLICY_TYPE_VALUE_ANNOTATION_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyTypeValueAnnotationList"), - shape_type=ShapeType.LIST, - members={"member": {"target": AUTOMATED_REASONING_POLICY_TYPE_VALUE_ANNOTATION}}, -) - -AUTOMATED_REASONING_POLICY_UPDATE_TYPE_ANNOTATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyUpdateTypeAnnotation"), - members={ - "name": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "newName": {"target": AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_NAME}, - "description": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_DESCRIPTION - }, - "values": { - "target": AUTOMATED_REASONING_POLICY_TYPE_VALUE_ANNOTATION_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +AUTOMATED_REASONING_CHECK_INPUT_TEXT_REFERENCE: StaticSchema = ( + 18, + n0, + _ARCITR, + 0, + (_te,), + ((AUTOMATED_REASONING_NATURAL_LANGUAGE_STATEMENT_CONTENT, 0),), +) + +AUTOMATED_REASONING_CHECK_INPUT_TEXT_REFERENCE_LIST: StaticSchema = ( + 16, + n0, + _ARCITRL, + 0, + (_me,), + ((AUTOMATED_REASONING_CHECK_INPUT_TEXT_REFERENCE, 0),), +) + +AUTOMATED_REASONING_CHECK_TRANSLATION: StaticSchema = ( + 18, + n0, + _ARCT, + 0, + (_pr, _cl, _uP, _uC, _conf), + ( + (AUTOMATED_REASONING_LOGIC_STATEMENT_LIST, 0), + (AUTOMATED_REASONING_LOGIC_STATEMENT_LIST, 1), + (AUTOMATED_REASONING_CHECK_INPUT_TEXT_REFERENCE_LIST, 0), + (AUTOMATED_REASONING_CHECK_INPUT_TEXT_REFERENCE_LIST, 0), + (AUTOMATED_REASONING_CHECK_TRANSLATION_CONFIDENCE, 1), + ), ) -AUTOMATED_REASONING_POLICY_UPDATE_VARIABLE_ANNOTATION = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrock#AutomatedReasoningPolicyUpdateVariableAnnotation" +AUTOMATED_REASONING_CHECK_IMPOSSIBLE_FINDING: StaticSchema = ( + 18, + n0, + _ARCIF, + 0, + (_tr, _cRo, _lW), + ( + (AUTOMATED_REASONING_CHECK_TRANSLATION, 0), + (AUTOMATED_REASONING_CHECK_RULE_LIST, 0), + (AUTOMATED_REASONING_CHECK_LOGIC_WARNING, 0), ), - members={ - "name": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "newName": {"target": AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE_NAME}, - "description": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE_DESCRIPTION - }, - }, ) -AUTOMATED_REASONING_POLICY_ANNOTATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyAnnotation"), - shape_type=ShapeType.UNION, - members={ - "addType": {"target": AUTOMATED_REASONING_POLICY_ADD_TYPE_ANNOTATION}, - "updateType": {"target": AUTOMATED_REASONING_POLICY_UPDATE_TYPE_ANNOTATION}, - "deleteType": {"target": AUTOMATED_REASONING_POLICY_DELETE_TYPE_ANNOTATION}, - "addVariable": {"target": AUTOMATED_REASONING_POLICY_ADD_VARIABLE_ANNOTATION}, - "updateVariable": { - "target": AUTOMATED_REASONING_POLICY_UPDATE_VARIABLE_ANNOTATION - }, - "deleteVariable": { - "target": AUTOMATED_REASONING_POLICY_DELETE_VARIABLE_ANNOTATION - }, - "addRule": {"target": AUTOMATED_REASONING_POLICY_ADD_RULE_ANNOTATION}, - "updateRule": {"target": AUTOMATED_REASONING_POLICY_UPDATE_RULE_ANNOTATION}, - "deleteRule": {"target": AUTOMATED_REASONING_POLICY_DELETE_RULE_ANNOTATION}, - "addRuleFromNaturalLanguage": { - "target": AUTOMATED_REASONING_POLICY_ADD_RULE_FROM_NATURAL_LANGUAGE_ANNOTATION - }, - "updateFromRulesFeedback": { - "target": AUTOMATED_REASONING_POLICY_UPDATE_FROM_RULE_FEEDBACK_ANNOTATION - }, - "updateFromScenarioFeedback": { - "target": AUTOMATED_REASONING_POLICY_UPDATE_FROM_SCENARIO_FEEDBACK_ANNOTATION - }, - "ingestContent": { - "target": AUTOMATED_REASONING_POLICY_INGEST_CONTENT_ANNOTATION - }, - }, +AUTOMATED_REASONING_CHECK_INVALID_FINDING: StaticSchema = ( + 18, + n0, + _ARCIFu, + 0, + (_tr, _cRo, _lW), + ( + (AUTOMATED_REASONING_CHECK_TRANSLATION, 0), + (AUTOMATED_REASONING_CHECK_RULE_LIST, 0), + (AUTOMATED_REASONING_CHECK_LOGIC_WARNING, 0), + ), ) -AUTOMATED_REASONING_POLICY_ANNOTATION_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyAnnotationList"), - shape_type=ShapeType.LIST, - members={"member": {"target": AUTOMATED_REASONING_POLICY_ANNOTATION}}, +AUTOMATED_REASONING_CHECK_NO_TRANSLATIONS_FINDING: StaticSchema = (18, n0, _ARCNTF, 0) + +AUTOMATED_REASONING_CHECK_SCENARIO: StaticSchema = ( + 18, + n0, + _ARCS, + 0, + (_sta,), + ((AUTOMATED_REASONING_LOGIC_STATEMENT_LIST, 0),), +) + +AUTOMATED_REASONING_CHECK_SATISFIABLE_FINDING: StaticSchema = ( + 18, + n0, + _ARCSF, + 0, + (_tr, _cTS, _cFS, _lW), + ( + (AUTOMATED_REASONING_CHECK_TRANSLATION, 0), + (AUTOMATED_REASONING_CHECK_SCENARIO, 0), + (AUTOMATED_REASONING_CHECK_SCENARIO, 0), + (AUTOMATED_REASONING_CHECK_LOGIC_WARNING, 0), + ), ) -GET_AUTOMATED_REASONING_POLICY_ANNOTATIONS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetAutomatedReasoningPolicyAnnotationsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetAutomatedReasoningPolicyAnnotationsResponse", - ) - ], - members={ - "policyArn": { - "target": AUTOMATED_REASONING_POLICY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": AUTOMATED_REASONING_POLICY_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "buildWorkflowId": { - "target": AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "annotations": { - "target": AUTOMATED_REASONING_POLICY_ANNOTATION_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "annotationSetHash": { - "target": AUTOMATED_REASONING_POLICY_HASH, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +AUTOMATED_REASONING_CHECK_TOO_COMPLEX_FINDING: StaticSchema = (18, n0, _ARCTCF, 0) + +AUTOMATED_REASONING_CHECK_DIFFERENCE_SCENARIO_LIST: StaticSchema = ( + 16, + n0, + _ARCDSL, + 0, + (_me,), + ((AUTOMATED_REASONING_CHECK_SCENARIO, 0),), +) + +AUTOMATED_REASONING_CHECK_TRANSLATION_LIST: StaticSchema = ( + 16, + n0, + _ARCTL, + 0, + (_me,), + ((AUTOMATED_REASONING_CHECK_TRANSLATION, 0),), +) + +AUTOMATED_REASONING_CHECK_TRANSLATION_OPTION: StaticSchema = ( + 18, + n0, + _ARCTO, + 0, + (_tra,), + ((AUTOMATED_REASONING_CHECK_TRANSLATION_LIST, 0),), +) + +AUTOMATED_REASONING_CHECK_TRANSLATION_OPTION_LIST: StaticSchema = ( + 16, + n0, + _ARCTOL, + 0, + (_me,), + ((AUTOMATED_REASONING_CHECK_TRANSLATION_OPTION, 0),), +) + +AUTOMATED_REASONING_CHECK_TRANSLATION_AMBIGUOUS_FINDING: StaticSchema = ( + 18, + n0, + _ARCTAF, + 0, + (_op, _dSi), + ( + (AUTOMATED_REASONING_CHECK_TRANSLATION_OPTION_LIST, 0), + (AUTOMATED_REASONING_CHECK_DIFFERENCE_SCENARIO_LIST, 0), + ), ) -GET_AUTOMATED_REASONING_POLICY_ANNOTATIONS = Schema( - id=ShapeID("com.amazonaws.bedrock#GetAutomatedReasoningPolicyAnnotations"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowId}/annotations", - } - ), - ) - ], +AUTOMATED_REASONING_CHECK_VALID_FINDING: StaticSchema = ( + 18, + n0, + _ARCVF, + 0, + (_tr, _cTS, _sR, _lW), + ( + (AUTOMATED_REASONING_CHECK_TRANSLATION, 0), + (AUTOMATED_REASONING_CHECK_SCENARIO, 0), + (AUTOMATED_REASONING_CHECK_RULE_LIST, 0), + (AUTOMATED_REASONING_CHECK_LOGIC_WARNING, 0), + ), ) -GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetAutomatedReasoningPolicyBuildWorkflowInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetAutomatedReasoningPolicyBuildWorkflowRequest", - ) - ], - members={ - "policyArn": { - "target": AUTOMATED_REASONING_POLICY_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "buildWorkflowId": { - "target": AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, +AUTOMATED_REASONING_CHECK_FINDING: StaticSchema = ( + 19, + n0, + _ARCF, + 0, + (_val, _in, _sa, _im, _tA, _tCo, _nTo), + ( + (AUTOMATED_REASONING_CHECK_VALID_FINDING, 0), + (AUTOMATED_REASONING_CHECK_INVALID_FINDING, 0), + (AUTOMATED_REASONING_CHECK_SATISFIABLE_FINDING, 0), + (AUTOMATED_REASONING_CHECK_IMPOSSIBLE_FINDING, 0), + (AUTOMATED_REASONING_CHECK_TRANSLATION_AMBIGUOUS_FINDING, 0), + (AUTOMATED_REASONING_CHECK_TOO_COMPLEX_FINDING, 0), + (AUTOMATED_REASONING_CHECK_NO_TRANSLATIONS_FINDING, 0), + ), ) -AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyBuildWorkflowType"), - shape_type=ShapeType.ENUM, - members={ - "INGEST_CONTENT": {"target": UNIT}, - "REFINE_POLICY": {"target": UNIT}, - "IMPORT_POLICY": {"target": UNIT}, - "GENERATE_FIDELITY_REPORT": {"target": UNIT}, - "GENERATE_POLICY_SCENARIOS": {"target": UNIT}, - "RESOLVE_POLICY_AMBIGUITIES": {"target": UNIT}, - "ITERATIVELY_REFINE_POLICY": {"target": UNIT}, - }, +AUTOMATED_REASONING_CHECK_FINDING_LIST: StaticSchema = ( + 16, + n0, + _ARCFL, + 0, + (_me,), + ((AUTOMATED_REASONING_CHECK_FINDING, 0),), +) + +AUTOMATED_REASONING_POLICY_TEST_RUN_RESULT: StaticSchema = ( + 14, + n0, + _ARPTRR, + 0, + (_PASSED, _FAILED), + ((-1, {_sV: _PASSED}), (-1, {_sV: _FAILED})), +) + +AUTOMATED_REASONING_POLICY_TEST_RUN_STATUS: StaticSchema = ( + 14, + n0, + _ARPTRS, + 0, + (_NS, _SCHEDULED, _IP, _COMPLETED, _FAILED), + ( + (-1, {_sV: _NS}), + (-1, {_sV: _SCHEDULED}), + (-1, {_sV: _IP}), + (-1, {_sV: _COMPLETED}), + (-1, {_sV: _FAILED}), + ), ) -AUTOMATED_REASONING_POLICY_BUILD_DOCUMENT_CONTENT_TYPE = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrock#AutomatedReasoningPolicyBuildDocumentContentType" +AUTOMATED_REASONING_POLICY_TEST_RESULT: StaticSchema = ( + 18, + n0, + _ARPTR, + 0, + (_tCe, _pA, _tRS, _tF, _tRR, _aTFR, _uA), + ( + (AUTOMATED_REASONING_POLICY_TEST_CASE, 1), + (AUTOMATED_REASONING_POLICY_ARN, 1), + (AUTOMATED_REASONING_POLICY_TEST_RUN_STATUS, 1), + (AUTOMATED_REASONING_CHECK_FINDING_LIST, 0), + (AUTOMATED_REASONING_POLICY_TEST_RUN_RESULT, 0), + (AUTOMATED_REASONING_CHECK_RESULT, 0), + (TIMESTAMP, 1), ), - shape_type=ShapeType.ENUM, - members={"PDF": {"target": UNIT}, "TEXT": {"target": UNIT}}, ) -AUTOMATED_REASONING_POLICY_BUILD_DOCUMENT_DESCRIPTION = Schema( - id=ShapeID( - "com.amazonaws.bedrock#AutomatedReasoningPolicyBuildDocumentDescription" +GET_AUTOMATED_REASONING_POLICY_TEST_RESULT_OUTPUT: StaticSchema = ( + 18, + n0, + _GARPTRO, + {_sSI: _cGARPTRRo, _smith: None}, + (_tR,), + ((AUTOMATED_REASONING_POLICY_TEST_RESULT, 1),), +) + +GET_AUTOMATED_REASONING_POLICY_TEST_RESULT: StaticOperationSchema = ( + 23, + n0, + _GARPTR, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "GET", + "uri": "/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowId}/test-cases/{testCaseId}/test-results", + } + ) + }, + GET_AUTOMATED_REASONING_POLICY_TEST_RESULT_INPUT, + GET_AUTOMATED_REASONING_POLICY_TEST_RESULT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, ), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], ) -AUTOMATED_REASONING_POLICY_BUILD_DOCUMENT_NAME = Schema( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyBuildDocumentName"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +LIST_AUTOMATED_REASONING_POLICIES_INPUT: StaticSchema = ( + 18, + n0, + _LARPI, + {_sSI: _cLARPR, _smit: None}, + (_pA, _nT, _mR), + ( + (AUTOMATED_REASONING_POLICY_ARN, {_sQ: _pA}), + (PAGINATION_TOKEN, {_sQ: _nT}), + (MAX_RESULTS, {_s: 25, _sQ: _mR}), + ), ) -AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyBuildWorkflowStatus"), - shape_type=ShapeType.ENUM, - members={ - "SCHEDULED": {"target": UNIT}, - "CANCEL_REQUESTED": {"target": UNIT}, - "PREPROCESSING": {"target": UNIT}, - "BUILDING": {"target": UNIT}, - "TESTING": {"target": UNIT}, - "COMPLETED": {"target": UNIT}, - "FAILED": {"target": UNIT}, - "CANCELLED": {"target": UNIT}, - }, +AUTOMATED_REASONING_POLICY_SUMMARY: StaticSchema = ( + 18, + n0, + _ARPSut, + 0, + (_pA, _n, _d, _ve, _pI, _cA, _uA), + ( + (AUTOMATED_REASONING_POLICY_ARN, 1), + (AUTOMATED_REASONING_POLICY_NAME, 1), + (AUTOMATED_REASONING_POLICY_DESCRIPTION, 0), + (AUTOMATED_REASONING_POLICY_VERSION, 1), + (AUTOMATED_REASONING_POLICY_ID, 1), + (TIMESTAMP, 1), + (TIMESTAMP, 1), + ), ) -GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetAutomatedReasoningPolicyBuildWorkflowOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetAutomatedReasoningPolicyBuildWorkflowResponse", - ) - ], - members={ - "policyArn": { - "target": AUTOMATED_REASONING_POLICY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "buildWorkflowId": { - "target": AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "buildWorkflowType": { - "target": AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "documentName": {"target": AUTOMATED_REASONING_POLICY_BUILD_DOCUMENT_NAME}, - "documentContentType": { - "target": AUTOMATED_REASONING_POLICY_BUILD_DOCUMENT_CONTENT_TYPE - }, - "documentDescription": { - "target": AUTOMATED_REASONING_POLICY_BUILD_DOCUMENT_DESCRIPTION - }, - "createdAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +AUTOMATED_REASONING_POLICY_SUMMARIES: StaticSchema = ( + 16, + n0, + _ARPSuto, + 0, + (_me,), + ((AUTOMATED_REASONING_POLICY_SUMMARY, 0),), +) + +LIST_AUTOMATED_REASONING_POLICIES_OUTPUT: StaticSchema = ( + 18, + n0, + _LARPO, + {_sSI: _cLARPRo, _smith: None}, + (_aRPS, _nT), + ((AUTOMATED_REASONING_POLICY_SUMMARIES, 1), (PAGINATION_TOKEN, 0)), +) + +LIST_AUTOMATED_REASONING_POLICIES: StaticOperationSchema = ( + 23, + n0, + _LARP, + { + _smithy: MappingProxyType( + {"code": 200, "method": "GET", "uri": "/automated-reasoning-policies"} + ) + }, + LIST_AUTOMATED_REASONING_POLICIES_INPUT, + LIST_AUTOMATED_REASONING_POLICIES_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW = Schema( - id=ShapeID("com.amazonaws.bedrock#GetAutomatedReasoningPolicyBuildWorkflow"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowId}", - } - ), - ) - ], -) - -AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSET_ID = Schema( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyBuildResultAssetId"), - shape_type=ShapeType.STRING, -) - -AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSET_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyBuildResultAssetType"), - shape_type=ShapeType.ENUM, - members={ - "BUILD_LOG": {"target": UNIT}, - "QUALITY_REPORT": {"target": UNIT}, - "POLICY_DEFINITION": {"target": UNIT}, - "GENERATED_TEST_CASES": {"target": UNIT}, - "POLICY_SCENARIOS": {"target": UNIT}, - "FIDELITY_REPORT": {"target": UNIT}, - "ASSET_MANIFEST": {"target": UNIT}, - "SOURCE_DOCUMENT": {"target": UNIT}, - }, +LIST_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOWS_INPUT: StaticSchema = ( + 18, + n0, + _LARPBWI, + {_sSI: _cLARPBWR, _smit: None}, + (_pA, _nT, _mR), + ( + (AUTOMATED_REASONING_POLICY_ARN, 9), + (PAGINATION_TOKEN, {_sQ: _nT}), + (MAX_RESULTS, {_s: 25, _sQ: _mR}), + ), ) -GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_RESULT_ASSETS_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrock#GetAutomatedReasoningPolicyBuildWorkflowResultAssetsInput" +AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_SUMMARY: StaticSchema = ( + 18, + n0, + _ARPBWSu, + 0, + (_pA, _bWI, _st, _bWT, _cA, _uA), + ( + (AUTOMATED_REASONING_POLICY_ARN, 1), + (AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_ID, 1), + (AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_STATUS, 1), + (AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_TYPE, 1), + (TIMESTAMP, 1), + (TIMESTAMP, 1), ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetAutomatedReasoningPolicyBuildWorkflowResultAssetsRequest", - ) - ], - members={ - "policyArn": { - "target": AUTOMATED_REASONING_POLICY_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "buildWorkflowId": { - "target": AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "assetType": { - "target": AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSET_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="assetType"), - ], - }, - "assetId": { - "target": AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSET_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="assetId")], - }, - }, ) -AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSET_NAME = Schema( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyBuildResultAssetName"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_SUMMARIES: StaticSchema = ( + 16, + n0, + _ARPBWSut, + 0, + (_me,), + ((AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_SUMMARY, 0),), +) + +LIST_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOWS_OUTPUT: StaticSchema = ( + 18, + n0, + _LARPBWO, + {_sSI: _cLARPBWRo, _smith: None}, + (_aRPBWS, _nT), + ((AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_SUMMARIES, 1), (PAGINATION_TOKEN, 0)), +) + +LIST_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOWS: StaticOperationSchema = ( + 23, + n0, + _LARPBW, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "GET", + "uri": "/automated-reasoning-policies/{policyArn}/build-workflows", + } + ) + }, + LIST_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOWS_INPUT, + LIST_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOWS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSET_MANIFEST_ENTRY = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrock#AutomatedReasoningPolicyBuildResultAssetManifestEntry" +LIST_AUTOMATED_REASONING_POLICY_TEST_CASES_INPUT: StaticSchema = ( + 18, + n0, + _LARPTCI, + {_sSI: _cLARPTCR, _smit: None}, + (_pA, _nT, _mR), + ( + (AUTOMATED_REASONING_POLICY_ARN, 9), + (PAGINATION_TOKEN, {_s: None, _sQ: _nT}), + (MAX_RESULTS, {_s: 25, _sQ: _mR}), ), - members={ - "assetType": { - "target": AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSET_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "assetName": {"target": AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSET_NAME}, - "assetId": {"target": AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSET_ID}, - }, ) -AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSET_MANIFEST_LIST = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrock#AutomatedReasoningPolicyBuildResultAssetManifestList" +AUTOMATED_REASONING_POLICY_TEST_CASE_LIST: StaticSchema = ( + 16, + n0, + _ARPTCL, + 0, + (_me,), + ((AUTOMATED_REASONING_POLICY_TEST_CASE, 0),), +) + +LIST_AUTOMATED_REASONING_POLICY_TEST_CASES_OUTPUT: StaticSchema = ( + 18, + n0, + _LARPTCO, + {_sSI: _cLARPTCRo, _smith: None}, + (_tCes, _nT), + ((AUTOMATED_REASONING_POLICY_TEST_CASE_LIST, 1), (PAGINATION_TOKEN, 0)), +) + +LIST_AUTOMATED_REASONING_POLICY_TEST_CASES: StaticOperationSchema = ( + 23, + n0, + _LARPTC, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "GET", + "uri": "/automated-reasoning-policies/{policyArn}/test-cases", + } + ) + }, + LIST_AUTOMATED_REASONING_POLICY_TEST_CASES_INPUT, + LIST_AUTOMATED_REASONING_POLICY_TEST_CASES_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, ), - shape_type=ShapeType.LIST, - members={ - "member": { - "target": AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSET_MANIFEST_ENTRY - } - }, ) -AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSET_MANIFEST = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrock#AutomatedReasoningPolicyBuildResultAssetManifest" +LIST_AUTOMATED_REASONING_POLICY_TEST_RESULTS_INPUT: StaticSchema = ( + 18, + n0, + _LARPTRI, + {_sSI: _cLARPTRR, _smit: None}, + (_pA, _bWI, _nT, _mR), + ( + (AUTOMATED_REASONING_POLICY_ARN, 9), + (AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_ID, 9), + (PAGINATION_TOKEN, {_s: None, _sQ: _nT}), + (MAX_RESULTS, {_s: 25, _sQ: _mR}), ), - members={ - "entries": { - "target": AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSET_MANIFEST_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, ) -AUTOMATED_REASONING_POLICY_ADD_RULE_MUTATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyAddRuleMutation"), - members={ - "rule": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_RULE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +AUTOMATED_REASONING_POLICY_TEST_LIST: StaticSchema = ( + 16, + n0, + _ARPTL, + 0, + (_me,), + ((AUTOMATED_REASONING_POLICY_TEST_RESULT, 0),), +) + +LIST_AUTOMATED_REASONING_POLICY_TEST_RESULTS_OUTPUT: StaticSchema = ( + 18, + n0, + _LARPTRO, + {_sSI: _cLARPTRRo, _smith: None}, + (_tRe, _nT), + ((AUTOMATED_REASONING_POLICY_TEST_LIST, 1), (PAGINATION_TOKEN, 0)), +) + +LIST_AUTOMATED_REASONING_POLICY_TEST_RESULTS: StaticOperationSchema = ( + 23, + n0, + _LARPTR, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "GET", + "uri": "/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowId}/test-results", + } + ) + }, + LIST_AUTOMATED_REASONING_POLICY_TEST_RESULTS_INPUT, + LIST_AUTOMATED_REASONING_POLICY_TEST_RESULTS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AUTOMATED_REASONING_POLICY_ADD_TYPE_MUTATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyAddTypeMutation"), - members={ - "type": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_DOCUMENT: StaticSchema = ( + 18, + n0, + _ARPBWD, + 0, + (_do, _dCT, _dN, _dD), + ( + (AUTOMATED_REASONING_POLICY_BUILD_DOCUMENT_BLOB, 1), + (AUTOMATED_REASONING_POLICY_BUILD_DOCUMENT_CONTENT_TYPE, 1), + (AUTOMATED_REASONING_POLICY_BUILD_DOCUMENT_NAME, 1), + (AUTOMATED_REASONING_POLICY_BUILD_DOCUMENT_DESCRIPTION, 0), + ), ) -AUTOMATED_REASONING_POLICY_ADD_VARIABLE_MUTATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyAddVariableMutation"), - members={ - "variable": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_DOCUMENT_LIST: StaticSchema = ( + 16, + n0, + _ARPBWDL, + 0, + (_me,), + ((AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_DOCUMENT, 0),), +) + +AUTOMATED_REASONING_POLICY_GENERATE_FIDELITY_REPORT_DOCUMENT_LIST: StaticSchema = ( + 16, + n0, + _ARPGFRDL, + 0, + (_me,), + ((AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_DOCUMENT, 0),), +) + +AUTOMATED_REASONING_POLICY_GENERATE_FIDELITY_REPORT_CONTENT: StaticSchema = ( + 19, + n0, + _ARPGFRC, + 0, + (_doc,), + ((AUTOMATED_REASONING_POLICY_GENERATE_FIDELITY_REPORT_DOCUMENT_LIST, 0),), +) + +AUTOMATED_REASONING_POLICY_ITERATIVE_REFINEMENT_DOCUMENT_LIST: StaticSchema = ( + 16, + n0, + _ARPIRDL, + 0, + (_me,), + ((AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_DOCUMENT, 0),), +) + +AUTOMATED_REASONING_POLICY_BUILD_FEEDBACK: StaticSchema = (3, n0, _ARPBF, 4) + +AUTOMATED_REASONING_POLICY_ITERATIVE_REFINEMENT_CONTENT: StaticSchema = ( + 18, + n0, + _ARPIRC, + 0, + (_doc, _fe), + ( + (AUTOMATED_REASONING_POLICY_ITERATIVE_REFINEMENT_DOCUMENT_LIST, 1), + (AUTOMATED_REASONING_POLICY_BUILD_FEEDBACK, 0), + ), ) -AUTOMATED_REASONING_POLICY_DELETE_RULE_MUTATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyDeleteRuleMutation"), - members={ - "id": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_RULE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_REPAIR_CONTENT: StaticSchema = ( + 18, + n0, + _ARPBWRC, + 0, + (_a,), + ((AUTOMATED_REASONING_POLICY_ANNOTATION_LIST, 1),), +) + +AUTOMATED_REASONING_POLICY_WORKFLOW_TYPE_CONTENT: StaticSchema = ( + 19, + n0, + _ARPWTC, + 0, + (_doc, _pRA, _gFRC, _iRC), + ( + (AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_DOCUMENT_LIST, 0), + (AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_REPAIR_CONTENT, 0), + (AUTOMATED_REASONING_POLICY_GENERATE_FIDELITY_REPORT_CONTENT, 0), + (AUTOMATED_REASONING_POLICY_ITERATIVE_REFINEMENT_CONTENT, 0), + ), ) -AUTOMATED_REASONING_POLICY_DELETE_TYPE_MUTATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyDeleteTypeMutation"), - members={ - "name": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_SOURCE: StaticSchema = ( + 18, + n0, + _ARPBWSuto, + 0, + (_pD, _wC), + ( + (AUTOMATED_REASONING_POLICY_DEFINITION, 0), + (AUTOMATED_REASONING_POLICY_WORKFLOW_TYPE_CONTENT, 0), + ), ) -AUTOMATED_REASONING_POLICY_DELETE_VARIABLE_MUTATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyDeleteVariableMutation"), - members={ - "name": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +START_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT: StaticSchema = ( + 18, + n0, + _SARPBWI, + {_sSI: _cSARPBWR, _smit: None}, + (_pA, _bWT, _cRT, _sC), + ( + (AUTOMATED_REASONING_POLICY_ARN, 9), + (AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_TYPE, 9), + (IDEMPOTENCY_TOKEN, {_sH: _xact, _sT: None}), + (AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_SOURCE, 17), + ), ) -AUTOMATED_REASONING_POLICY_UPDATE_RULE_MUTATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyUpdateRuleMutation"), - members={ - "rule": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_RULE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +START_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT: StaticSchema = ( + 18, + n0, + _SARPBWO, + {_sSI: _cSARPBWRo, _smith: None}, + (_pA, _bWI), + ( + (AUTOMATED_REASONING_POLICY_ARN, 1), + (AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_ID, 1), + ), ) -AUTOMATED_REASONING_POLICY_UPDATE_TYPE_MUTATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyUpdateTypeMutation"), - members={ - "type": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +START_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW: StaticOperationSchema = ( + 23, + n0, + _SARPBW, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "POST", + "uri": "/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowType}/start", + } + ) + }, + START_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT, + START_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_IN_USE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AUTOMATED_REASONING_POLICY_UPDATE_VARIABLE_MUTATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyUpdateVariableMutation"), - members={ - "variable": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +AUTOMATED_REASONING_POLICY_TEST_CASE_ID_LIST: StaticSchema = ( + 16, + n0, + _ARPTCIL, + 0, + (_me,), + ((AUTOMATED_REASONING_POLICY_TEST_CASE_ID, 0),), +) + +START_AUTOMATED_REASONING_POLICY_TEST_WORKFLOW_INPUT: StaticSchema = ( + 18, + n0, + _SARPTWI, + {_sSI: _cSARPTWR, _smit: None}, + (_pA, _bWI, _tCIe, _cRT), + ( + (AUTOMATED_REASONING_POLICY_ARN, 9), + (AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_ID, 9), + (AUTOMATED_REASONING_POLICY_TEST_CASE_ID_LIST, 0), + (IDEMPOTENCY_TOKEN, 2), + ), ) -AUTOMATED_REASONING_POLICY_MUTATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyMutation"), - shape_type=ShapeType.UNION, - members={ - "addType": {"target": AUTOMATED_REASONING_POLICY_ADD_TYPE_MUTATION}, - "updateType": {"target": AUTOMATED_REASONING_POLICY_UPDATE_TYPE_MUTATION}, - "deleteType": {"target": AUTOMATED_REASONING_POLICY_DELETE_TYPE_MUTATION}, - "addVariable": {"target": AUTOMATED_REASONING_POLICY_ADD_VARIABLE_MUTATION}, - "updateVariable": { - "target": AUTOMATED_REASONING_POLICY_UPDATE_VARIABLE_MUTATION - }, - "deleteVariable": { - "target": AUTOMATED_REASONING_POLICY_DELETE_VARIABLE_MUTATION - }, - "addRule": {"target": AUTOMATED_REASONING_POLICY_ADD_RULE_MUTATION}, - "updateRule": {"target": AUTOMATED_REASONING_POLICY_UPDATE_RULE_MUTATION}, - "deleteRule": {"target": AUTOMATED_REASONING_POLICY_DELETE_RULE_MUTATION}, - }, +START_AUTOMATED_REASONING_POLICY_TEST_WORKFLOW_OUTPUT: StaticSchema = ( + 18, + n0, + _SARPTWO, + {_sSI: _cSARPTWRo, _smith: None}, + (_pA,), + ((AUTOMATED_REASONING_POLICY_ARN, 1),), +) + +START_AUTOMATED_REASONING_POLICY_TEST_WORKFLOW: StaticOperationSchema = ( + 23, + n0, + _SARPTW, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "POST", + "uri": "/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowId}/test-workflows", + } + ) + }, + START_AUTOMATED_REASONING_POLICY_TEST_WORKFLOW_INPUT, + START_AUTOMATED_REASONING_POLICY_TEST_WORKFLOW_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_IN_USE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AUTOMATED_REASONING_POLICY_PLANNING = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyPlanning") +UPDATE_AUTOMATED_REASONING_POLICY_INPUT: StaticSchema = ( + 18, + n0, + _UARPI, + {_sSI: _cUARPR, _smit: None}, + (_pA, _pD, _n, _d), + ( + (AUTOMATED_REASONING_POLICY_ARN, 9), + (AUTOMATED_REASONING_POLICY_DEFINITION, 1), + (AUTOMATED_REASONING_POLICY_NAME, 0), + (AUTOMATED_REASONING_POLICY_DESCRIPTION, 0), + ), ) -AUTOMATED_REASONING_POLICY_BUILD_STEP_CONTEXT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyBuildStepContext"), - shape_type=ShapeType.UNION, - members={ - "planning": {"target": AUTOMATED_REASONING_POLICY_PLANNING}, - "mutation": {"target": AUTOMATED_REASONING_POLICY_MUTATION}, - }, +UPDATE_AUTOMATED_REASONING_POLICY_OUTPUT: StaticSchema = ( + 18, + n0, + _UARPO, + {_sSI: _cUARPRo, _smith: None}, + (_pA, _n, _dH, _uA), + ( + (AUTOMATED_REASONING_POLICY_ARN, 1), + (AUTOMATED_REASONING_POLICY_NAME, 1), + (AUTOMATED_REASONING_POLICY_HASH, 1), + (TIMESTAMP, 1), + ), ) -AUTOMATED_REASONING_POLICY_BUILD_MESSAGE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyBuildMessageType"), - shape_type=ShapeType.ENUM, - members={ - "INFO": {"target": UNIT}, - "WARNING": {"target": UNIT}, - "ERROR": {"target": UNIT}, - }, +UPDATE_AUTOMATED_REASONING_POLICY: StaticOperationSchema = ( + 23, + n0, + _UARP, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "PATCH", + "uri": "/automated-reasoning-policies/{policyArn}", + } + ) + }, + UPDATE_AUTOMATED_REASONING_POLICY_INPUT, + UPDATE_AUTOMATED_REASONING_POLICY_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + TOO_MANY_TAGS_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AUTOMATED_REASONING_POLICY_BUILD_STEP_MESSAGE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyBuildStepMessage"), - members={ - "message": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "messageType": { - "target": AUTOMATED_REASONING_POLICY_BUILD_MESSAGE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +UPDATE_AUTOMATED_REASONING_POLICY_ANNOTATIONS_INPUT: StaticSchema = ( + 18, + n0, + _UARPAI, + {_sSI: _cUARPAR, _smit: None}, + (_pA, _bWI, _a, _lUASH), + ( + (AUTOMATED_REASONING_POLICY_ARN, 9), + (AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_ID, 9), + (AUTOMATED_REASONING_POLICY_ANNOTATION_LIST, 1), + (AUTOMATED_REASONING_POLICY_HASH, 1), + ), ) -AUTOMATED_REASONING_POLICY_BUILD_STEP_MESSAGE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyBuildStepMessageList"), - shape_type=ShapeType.LIST, - members={"member": {"target": AUTOMATED_REASONING_POLICY_BUILD_STEP_MESSAGE}}, +UPDATE_AUTOMATED_REASONING_POLICY_ANNOTATIONS_OUTPUT: StaticSchema = ( + 18, + n0, + _UARPAO, + {_sSI: _cUARPARo, _smith: None}, + (_pA, _bWI, _aSH, _uA), + ( + (AUTOMATED_REASONING_POLICY_ARN, 1), + (AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_ID, 1), + (AUTOMATED_REASONING_POLICY_HASH, 1), + (TIMESTAMP, 1), + ), ) -AUTOMATED_REASONING_POLICY_DEFINITION_ELEMENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyDefinitionElement"), - shape_type=ShapeType.UNION, - members={ - "policyDefinitionVariable": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE - }, - "policyDefinitionType": {"target": AUTOMATED_REASONING_POLICY_DEFINITION_TYPE}, - "policyDefinitionRule": {"target": AUTOMATED_REASONING_POLICY_DEFINITION_RULE}, - }, +UPDATE_AUTOMATED_REASONING_POLICY_ANNOTATIONS: StaticOperationSchema = ( + 23, + n0, + _UARPA, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "PATCH", + "uri": "/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowId}/annotations", + } + ) + }, + UPDATE_AUTOMATED_REASONING_POLICY_ANNOTATIONS_INPUT, + UPDATE_AUTOMATED_REASONING_POLICY_ANNOTATIONS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AUTOMATED_REASONING_POLICY_BUILD_STEP = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyBuildStep"), - members={ - "context": { - "target": AUTOMATED_REASONING_POLICY_BUILD_STEP_CONTEXT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "priorElement": {"target": AUTOMATED_REASONING_POLICY_DEFINITION_ELEMENT}, - "messages": { - "target": AUTOMATED_REASONING_POLICY_BUILD_STEP_MESSAGE_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +UPDATE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT: StaticSchema = ( + 18, + n0, + _UARPTCI, + {_sSI: _cUARPTCR, _smit: None}, + (_pA, _tCI, _gC, _qC, _lUA, _eAFR, _cTo, _cRT), + ( + (AUTOMATED_REASONING_POLICY_ARN, 9), + (AUTOMATED_REASONING_POLICY_TEST_CASE_ID, 9), + (AUTOMATED_REASONING_POLICY_TEST_GUARD_CONTENT, 1), + (AUTOMATED_REASONING_POLICY_TEST_QUERY_CONTENT, 0), + (TIMESTAMP, 1), + (AUTOMATED_REASONING_CHECK_RESULT, 1), + (AUTOMATED_REASONING_CHECK_TRANSLATION_CONFIDENCE, 0), + (IDEMPOTENCY_TOKEN, 2), + ), ) -AUTOMATED_REASONING_POLICY_BUILD_STEP_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyBuildStepList"), - shape_type=ShapeType.LIST, - members={"member": {"target": AUTOMATED_REASONING_POLICY_BUILD_STEP}}, -) - -AUTOMATED_REASONING_POLICY_ANNOTATION_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyAnnotationStatus"), - shape_type=ShapeType.ENUM, - members={"APPLIED": {"target": UNIT}, "FAILED": {"target": UNIT}}, -) - -AUTOMATED_REASONING_POLICY_BUILD_LOG_ENTRY = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyBuildLogEntry"), - members={ - "annotation": { - "target": AUTOMATED_REASONING_POLICY_ANNOTATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": AUTOMATED_REASONING_POLICY_ANNOTATION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "buildSteps": { - "target": AUTOMATED_REASONING_POLICY_BUILD_STEP_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +UPDATE_AUTOMATED_REASONING_POLICY_TEST_CASE_OUTPUT: StaticSchema = ( + 18, + n0, + _UARPTCO, + {_sSI: _cUARPTCRo, _smith: None}, + (_pA, _tCI), + ((AUTOMATED_REASONING_POLICY_ARN, 1), (AUTOMATED_REASONING_POLICY_TEST_CASE_ID, 1)), +) + +UPDATE_AUTOMATED_REASONING_POLICY_TEST_CASE: StaticOperationSchema = ( + 23, + n0, + _UARPTC, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "PATCH", + "uri": "/automated-reasoning-policies/{policyArn}/test-cases/{testCaseId}", + } + ) + }, + UPDATE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT, + UPDATE_AUTOMATED_REASONING_POLICY_TEST_CASE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_IN_USE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AUTOMATED_REASONING_POLICY_BUILD_LOG_ENTRY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyBuildLogEntryList"), - shape_type=ShapeType.LIST, - members={"member": {"target": AUTOMATED_REASONING_POLICY_BUILD_LOG_ENTRY}}, +ROLE_ARN: StaticSchema = (3, n0, _RA, 0) + +INSTANCE_COUNT: StaticSchema = (7, n0, _ICn, 0) + +INSTANCE_TYPE: StaticSchema = (3, n0, _ITn, 0) + +SECURITY_GROUP_ID: StaticSchema = (3, n0, _SGI, 0) + +SECURITY_GROUP_IDS: StaticSchema = (16, n0, _SGIe, 0, (_me,), ((SECURITY_GROUP_ID, 0),)) + +SUBNET_ID: StaticSchema = (3, n0, _SI, 0) + +SUBNET_IDS: StaticSchema = (16, n0, _SIu, 0, (_me,), ((SUBNET_ID, 0),)) + +VPC_CONFIG: StaticSchema = ( + 18, + n0, + _VC, + 0, + (_sIu, _sGI), + ((SUBNET_IDS, 1), (SECURITY_GROUP_IDS, 1)), ) -AUTOMATED_REASONING_POLICY_BUILD_LOG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyBuildLog"), - members={ - "entries": { - "target": AUTOMATED_REASONING_POLICY_BUILD_LOG_ENTRY_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +SAGE_MAKER_ENDPOINT: StaticSchema = ( + 18, + n0, + _SME, + 0, + (_iIC, _iTn, _eRx, _kEK, _vp), + ( + (INSTANCE_COUNT, 1), + (INSTANCE_TYPE, 1), + (ROLE_ARN, 1), + (KMS_KEY_ID, 0), + (VPC_CONFIG, 0), + ), ) -AUTOMATED_REASONING_POLICY_BUILD_DOCUMENT_BLOB = Schema( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyBuildDocumentBlob"), - shape_type=ShapeType.BLOB, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -AUTOMATED_REASONING_POLICY_DOCUMENT_SHA256 = Schema( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyDocumentSha256"), - shape_type=ShapeType.STRING, -) - -AUTOMATED_REASONING_POLICY_SOURCE_DOCUMENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicySourceDocument"), - members={ - "document": { - "target": AUTOMATED_REASONING_POLICY_BUILD_DOCUMENT_BLOB, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "documentContentType": { - "target": AUTOMATED_REASONING_POLICY_BUILD_DOCUMENT_CONTENT_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "documentName": { - "target": AUTOMATED_REASONING_POLICY_BUILD_DOCUMENT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "documentDescription": { - "target": AUTOMATED_REASONING_POLICY_BUILD_DOCUMENT_DESCRIPTION - }, - "documentHash": { - "target": AUTOMATED_REASONING_POLICY_DOCUMENT_SHA256, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +ENDPOINT_CONFIG: StaticSchema = (19, n0, _EC, 0, (_sM,), ((SAGE_MAKER_ENDPOINT, 0),)) + +ENDPOINT_NAME: StaticSchema = (3, n0, _EN, 0) + +MODEL_SOURCE_IDENTIFIER: StaticSchema = (3, n0, _MSI, 0) + +CREATE_MARKETPLACE_MODEL_ENDPOINT_INPUT: StaticSchema = ( + 18, + n0, + _CMMEI, + {_sSI: _cCMMER, _smit: None}, + (_mSI, _eC, _aEc, _eN, _cRT, _ta), + ( + (MODEL_SOURCE_IDENTIFIER, 1), + (ENDPOINT_CONFIG, 1), + (ACCEPT_EULA, {_s: False}), + (ENDPOINT_NAME, 1), + (IDEMPOTENCY_TOKEN, 2), + (TAG_LIST, 0), + ), ) -AUTOMATED_REASONING_POLICY_ACCURACY_SCORE = Schema( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyAccuracyScore"), - shape_type=ShapeType.DOUBLE, +ARN: StaticSchema = (3, n0, _Ar, 0) + +STATUS: StaticSchema = ( + 14, + n0, + _Sta, + 0, + (_REGISTERED, _IE), + ((-1, {_sV: _REGISTERED}), (-1, {_sV: _IE})), +) + +MARKETPLACE_MODEL_ENDPOINT: StaticSchema = ( + 18, + n0, + _MME, + 0, + (_eA, _mSI, _st, _sMt, _cA, _uA, _eC, _eS, _eSM), + ( + (ARN, 1), + (MODEL_SOURCE_IDENTIFIER, 1), + (STATUS, 0), + (3, 0), + (TIMESTAMP, 1), + (TIMESTAMP, 1), + (ENDPOINT_CONFIG, 1), + (3, 1), + (3, 0), + ), ) -AUTOMATED_REASONING_POLICY_COVERAGE_SCORE = Schema( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyCoverageScore"), - shape_type=ShapeType.DOUBLE, +CREATE_MARKETPLACE_MODEL_ENDPOINT_OUTPUT: StaticSchema = ( + 18, + n0, + _CMMEO, + {_sSI: _cCMMERo, _smith: None}, + (_mME,), + ((MARKETPLACE_MODEL_ENDPOINT, 1),), +) + +CREATE_MARKETPLACE_MODEL_ENDPOINT: StaticOperationSchema = ( + 23, + n0, + _CMME, + { + _smithy: MappingProxyType( + {"code": 200, "method": "POST", "uri": "/marketplace-model/endpoints"} + ) + }, + CREATE_MARKETPLACE_MODEL_ENDPOINT_INPUT, + CREATE_MARKETPLACE_MODEL_ENDPOINT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AUTOMATED_REASONING_POLICY_STATEMENT_ID = Schema( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyStatementId"), - shape_type=ShapeType.STRING, +DELETE_MARKETPLACE_MODEL_ENDPOINT_INPUT: StaticSchema = ( + 18, + n0, + _DMMEI, + {_sSI: _cDMMER, _smit: None}, + (_eA,), + ((ARN, 9),), +) + +DELETE_MARKETPLACE_MODEL_ENDPOINT_OUTPUT: StaticSchema = ( + 18, + n0, + _DMMEO, + {_sSI: _cDMMERo, _smith: None}, +) + +DELETE_MARKETPLACE_MODEL_ENDPOINT: StaticOperationSchema = ( + 23, + n0, + _DMME, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "DELETE", + "uri": "/marketplace-model/endpoints/{endpointArn}", + } + ) + }, + DELETE_MARKETPLACE_MODEL_ENDPOINT_INPUT, + DELETE_MARKETPLACE_MODEL_ENDPOINT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AUTOMATED_REASONING_POLICY_LINE_NUMBER_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyLineNumberList"), - shape_type=ShapeType.LIST, - members={"member": {"target": INTEGER}}, +DEREGISTER_MARKETPLACE_MODEL_ENDPOINT_INPUT: StaticSchema = ( + 18, + n0, + _DMMEIe, + {_sSI: _cDMMERom, _smit: None}, + (_eA,), + ((ARN, 9),), +) + +DEREGISTER_MARKETPLACE_MODEL_ENDPOINT_OUTPUT: StaticSchema = ( + 18, + n0, + _DMMEOe, + {_sSI: _cDMMERoma, _smith: None}, +) + +SERVICE_UNAVAILABLE_EXCEPTION: StaticSchema = ( + 18, + n0, + _SUE, + {_sm: _se, _sE: 503}, + (_m,), + ((NON_BLANK_STRING, 0),), +) + +DEREGISTER_MARKETPLACE_MODEL_ENDPOINT: StaticOperationSchema = ( + 23, + n0, + _DMMEe, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "DELETE", + "uri": "/marketplace-model/endpoints/{endpointArn}/registration", + } + ) + }, + DEREGISTER_MARKETPLACE_MODEL_ENDPOINT_INPUT, + DEREGISTER_MARKETPLACE_MODEL_ENDPOINT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_UNAVAILABLE_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AUTOMATED_REASONING_POLICY_STATEMENT_LOCATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyStatementLocation"), - members={ - "lines": { - "target": AUTOMATED_REASONING_POLICY_LINE_NUMBER_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +GET_MARKETPLACE_MODEL_ENDPOINT_INPUT: StaticSchema = ( + 18, + n0, + _GMMEI, + {_sSI: _cGMMER, _smit: None}, + (_eA,), + ((ARN, 9),), +) + +GET_MARKETPLACE_MODEL_ENDPOINT_OUTPUT: StaticSchema = ( + 18, + n0, + _GMMEO, + {_sSI: _cGMMERo, _smith: None}, + (_mME,), + ((MARKETPLACE_MODEL_ENDPOINT, 0),), +) + +GET_MARKETPLACE_MODEL_ENDPOINT: StaticOperationSchema = ( + 23, + n0, + _GMME, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "GET", + "uri": "/marketplace-model/endpoints/{endpointArn}", + } + ) + }, + GET_MARKETPLACE_MODEL_ENDPOINT_INPUT, + GET_MARKETPLACE_MODEL_ENDPOINT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AUTOMATED_REASONING_POLICY_STATEMENT_TEXT = Schema( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyStatementText"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -AUTOMATED_REASONING_POLICY_ATOMIC_STATEMENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyAtomicStatement"), - members={ - "id": { - "target": AUTOMATED_REASONING_POLICY_STATEMENT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "text": { - "target": AUTOMATED_REASONING_POLICY_STATEMENT_TEXT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "location": { - "target": AUTOMATED_REASONING_POLICY_STATEMENT_LOCATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +LIST_MARKETPLACE_MODEL_ENDPOINTS_INPUT: StaticSchema = ( + 18, + n0, + _LMMEI, + {_sSI: _cLMMER, _smit: None}, + (_mR, _nT, _mSE), + ( + (MAX_RESULTS, {_sQ: _mR}), + (PAGINATION_TOKEN, {_sQ: _nT}), + (MODEL_SOURCE_IDENTIFIER, {_sQ: _mSI}), + ), ) -AUTOMATED_REASONING_POLICY_ATOMIC_STATEMENT_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyAtomicStatementList"), - shape_type=ShapeType.LIST, - members={"member": {"target": AUTOMATED_REASONING_POLICY_ATOMIC_STATEMENT}}, +MARKETPLACE_MODEL_ENDPOINT_SUMMARY: StaticSchema = ( + 18, + n0, + _MMES, + 0, + (_eA, _mSI, _st, _sMt, _cA, _uA), + ( + (ARN, 1), + (MODEL_SOURCE_IDENTIFIER, 1), + (STATUS, 0), + (3, 0), + (TIMESTAMP, 1), + (TIMESTAMP, 1), + ), ) -AUTOMATED_REASONING_POLICY_LINE_TEXT = Schema( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyLineText"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +MARKETPLACE_MODEL_ENDPOINT_SUMMARIES: StaticSchema = ( + 16, + n0, + _MMESa, + 0, + (_me,), + ((MARKETPLACE_MODEL_ENDPOINT_SUMMARY, 0),), +) + +LIST_MARKETPLACE_MODEL_ENDPOINTS_OUTPUT: StaticSchema = ( + 18, + n0, + _LMMEO, + {_sSI: _cLMMERo, _smith: None}, + (_mMEa, _nT), + ((MARKETPLACE_MODEL_ENDPOINT_SUMMARIES, 0), (PAGINATION_TOKEN, 0)), +) + +LIST_MARKETPLACE_MODEL_ENDPOINTS: StaticOperationSchema = ( + 23, + n0, + _LMME, + { + _smithy: MappingProxyType( + {"code": 200, "method": "GET", "uri": "/marketplace-model/endpoints"} + ) + }, + LIST_MARKETPLACE_MODEL_ENDPOINTS_INPUT, + LIST_MARKETPLACE_MODEL_ENDPOINTS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AUTOMATED_REASONING_POLICY_ANNOTATED_LINE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyAnnotatedLine"), - members={ - "lineNumber": {"target": INTEGER}, - "lineText": {"target": AUTOMATED_REASONING_POLICY_LINE_TEXT}, - }, +REGISTER_MARKETPLACE_MODEL_ENDPOINT_INPUT: StaticSchema = ( + 18, + n0, + _RMMEI, + {_sSI: _cRMMER, _smit: None}, + (_eI, _mSI), + ((ARN, 9), (MODEL_SOURCE_IDENTIFIER, 1)), +) + +REGISTER_MARKETPLACE_MODEL_ENDPOINT_OUTPUT: StaticSchema = ( + 18, + n0, + _RMMEO, + {_sSI: _cRMMERo, _smith: None}, + (_mME,), + ((MARKETPLACE_MODEL_ENDPOINT, 1),), +) + +REGISTER_MARKETPLACE_MODEL_ENDPOINT: StaticOperationSchema = ( + 23, + n0, + _RMME, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "POST", + "uri": "/marketplace-model/endpoints/{endpointIdentifier}/registration", + } + ) + }, + REGISTER_MARKETPLACE_MODEL_ENDPOINT_INPUT, + REGISTER_MARKETPLACE_MODEL_ENDPOINT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_UNAVAILABLE_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AUTOMATED_REASONING_POLICY_ANNOTATED_CONTENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyAnnotatedContent"), - shape_type=ShapeType.UNION, - members={"line": {"target": AUTOMATED_REASONING_POLICY_ANNOTATED_LINE}}, +UPDATE_MARKETPLACE_MODEL_ENDPOINT_INPUT: StaticSchema = ( + 18, + n0, + _UMMEI, + {_sSI: _cUMMER, _smit: None}, + (_eA, _eC, _cRT), + ((ARN, 9), (ENDPOINT_CONFIG, 1), (IDEMPOTENCY_TOKEN, 2)), +) + +UPDATE_MARKETPLACE_MODEL_ENDPOINT_OUTPUT: StaticSchema = ( + 18, + n0, + _UMMEO, + {_sSI: _cUMMERo, _smith: None}, + (_mME,), + ((MARKETPLACE_MODEL_ENDPOINT, 1),), +) + +UPDATE_MARKETPLACE_MODEL_ENDPOINT: StaticOperationSchema = ( + 23, + n0, + _UMME, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "PATCH", + "uri": "/marketplace-model/endpoints/{endpointArn}", + } + ) + }, + UPDATE_MARKETPLACE_MODEL_ENDPOINT_INPUT, + UPDATE_MARKETPLACE_MODEL_ENDPOINT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AUTOMATED_REASONING_POLICY_ANNOTATED_CONTENT_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyAnnotatedContentList"), - shape_type=ShapeType.LIST, - members={"member": {"target": AUTOMATED_REASONING_POLICY_ANNOTATED_CONTENT}}, +CUSTOM_MODEL_DEPLOYMENT_DESCRIPTION: StaticSchema = (3, n0, _CMDD, 0) + +CUSTOM_MODEL_ARN: StaticSchema = (3, n0, _CMA, 0) + +MODEL_DEPLOYMENT_NAME: StaticSchema = (3, n0, _MDN, 0) + +CREATE_CUSTOM_MODEL_DEPLOYMENT_INPUT: StaticSchema = ( + 18, + n0, + _CCMDI, + {_sSI: _cCCMDR, _smit: None}, + (_mDN, _mA, _d, _ta, _cRT), + ( + (MODEL_DEPLOYMENT_NAME, 1), + (CUSTOM_MODEL_ARN, 1), + (CUSTOM_MODEL_DEPLOYMENT_DESCRIPTION, 0), + (TAG_LIST, 0), + (IDEMPOTENCY_TOKEN, 2), + ), ) -AUTOMATED_REASONING_POLICY_ANNOTATED_CHUNK = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyAnnotatedChunk"), - members={ - "pageNumber": {"target": INTEGER}, - "content": { - "target": AUTOMATED_REASONING_POLICY_ANNOTATED_CONTENT_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +CUSTOM_MODEL_DEPLOYMENT_ARN: StaticSchema = (3, n0, _CMDA, 0) + +CREATE_CUSTOM_MODEL_DEPLOYMENT_OUTPUT: StaticSchema = ( + 18, + n0, + _CCMDO, + {_sSI: _cCCMDRo, _smith: None}, + (_cMDA,), + ((CUSTOM_MODEL_DEPLOYMENT_ARN, 1),), +) + +CREATE_CUSTOM_MODEL_DEPLOYMENT: StaticOperationSchema = ( + 23, + n0, + _CCMD, + { + _smithy: MappingProxyType( + { + "code": 202, + "method": "POST", + "uri": "/model-customization/custom-model-deployments", + } + ) + }, + CREATE_CUSTOM_MODEL_DEPLOYMENT_INPUT, + CREATE_CUSTOM_MODEL_DEPLOYMENT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + TOO_MANY_TAGS_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AUTOMATED_REASONING_POLICY_ANNOTATED_CHUNK_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyAnnotatedChunkList"), - shape_type=ShapeType.LIST, - members={"member": {"target": AUTOMATED_REASONING_POLICY_ANNOTATED_CHUNK}}, -) - -AUTOMATED_REASONING_POLICY_DOCUMENT_ID = Schema( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyDocumentId"), - shape_type=ShapeType.STRING, -) - -AUTOMATED_REASONING_POLICY_REPORT_SOURCE_DOCUMENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyReportSourceDocument"), - members={ - "documentName": { - "target": AUTOMATED_REASONING_POLICY_BUILD_DOCUMENT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "documentHash": { - "target": AUTOMATED_REASONING_POLICY_DOCUMENT_SHA256, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "documentId": { - "target": AUTOMATED_REASONING_POLICY_DOCUMENT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "atomicStatements": { - "target": AUTOMATED_REASONING_POLICY_ATOMIC_STATEMENT_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "documentContent": { - "target": AUTOMATED_REASONING_POLICY_ANNOTATED_CHUNK_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +CUSTOM_MODEL_DEPLOYMENT_IDENTIFIER: StaticSchema = (3, n0, _CMDI, 0) + +DELETE_CUSTOM_MODEL_DEPLOYMENT_INPUT: StaticSchema = ( + 18, + n0, + _DCMDI, + {_sSI: _cDCMDR, _smit: None}, + (_cMDI,), + ((CUSTOM_MODEL_DEPLOYMENT_IDENTIFIER, 9),), +) + +DELETE_CUSTOM_MODEL_DEPLOYMENT_OUTPUT: StaticSchema = ( + 18, + n0, + _DCMDO, + {_sSI: _cDCMDRo, _smith: None}, +) + +DELETE_CUSTOM_MODEL_DEPLOYMENT: StaticOperationSchema = ( + 23, + n0, + _DCMD, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "DELETE", + "uri": "/model-customization/custom-model-deployments/{customModelDeploymentIdentifier}", + } + ) + }, + DELETE_CUSTOM_MODEL_DEPLOYMENT_INPUT, + DELETE_CUSTOM_MODEL_DEPLOYMENT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AUTOMATED_REASONING_POLICY_REPORT_SOURCE_DOCUMENT_LIST = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrock#AutomatedReasoningPolicyReportSourceDocumentList" +GET_CUSTOM_MODEL_DEPLOYMENT_INPUT: StaticSchema = ( + 18, + n0, + _GCMDI, + {_sSI: _cGCMDR, _smit: None}, + (_cMDI,), + ((CUSTOM_MODEL_DEPLOYMENT_IDENTIFIER, 9),), +) + +CUSTOM_MODEL_DEPLOYMENT_STATUS: StaticSchema = ( + 14, + n0, + _CMDS, + 0, + (_CREATING, _ACTIVE, _FAILED), + ((-1, {_sV: _Cr}), (-1, {_sV: _Ac}), (-1, {_sV: _F})), +) + +MODEL_ARN: StaticSchema = (3, n0, _MA, 0) + +CUSTOM_MODEL_DEPLOYMENT_UPDATE_STATUS: StaticSchema = ( + 14, + n0, + _CMDUS, + 0, + (_UPDATING, _UC, _UF), + ((-1, {_sV: _U}), (-1, {_sV: _UCp}), (-1, {_sV: _UFp})), +) + +CUSTOM_MODEL_DEPLOYMENT_UPDATE_DETAILS: StaticSchema = ( + 18, + n0, + _CMDUD, + 0, + (_mA, _uS), + ((MODEL_ARN, 1), (CUSTOM_MODEL_DEPLOYMENT_UPDATE_STATUS, 1)), +) + +GET_CUSTOM_MODEL_DEPLOYMENT_OUTPUT: StaticSchema = ( + 18, + n0, + _GCMDO, + {_sSI: _cGCMDRo, _smith: None}, + (_cMDA, _mDN, _mA, _cA, _st, _d, _uD, _fM, _lUA), + ( + (CUSTOM_MODEL_DEPLOYMENT_ARN, 1), + (MODEL_DEPLOYMENT_NAME, 1), + (CUSTOM_MODEL_ARN, 1), + (TIMESTAMP, 1), + (CUSTOM_MODEL_DEPLOYMENT_STATUS, 1), + (CUSTOM_MODEL_DEPLOYMENT_DESCRIPTION, 0), + (CUSTOM_MODEL_DEPLOYMENT_UPDATE_DETAILS, 0), + (ERROR_MESSAGE, 0), + (TIMESTAMP, 0), ), - shape_type=ShapeType.LIST, - members={"member": {"target": AUTOMATED_REASONING_POLICY_REPORT_SOURCE_DOCUMENT}}, ) -AUTOMATED_REASONING_POLICY_JUSTIFICATION_TEXT = Schema( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyJustificationText"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +GET_CUSTOM_MODEL_DEPLOYMENT: StaticOperationSchema = ( + 23, + n0, + _GCMD, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "GET", + "uri": "/model-customization/custom-model-deployments/{customModelDeploymentIdentifier}", + } + ) + }, + GET_CUSTOM_MODEL_DEPLOYMENT_INPUT, + GET_CUSTOM_MODEL_DEPLOYMENT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AUTOMATED_REASONING_POLICY_JUSTIFICATION_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyJustificationList"), - shape_type=ShapeType.LIST, - members={"member": {"target": AUTOMATED_REASONING_POLICY_JUSTIFICATION_TEXT}}, +SORT_MODELS_BY: StaticSchema = (14, n0, _SMB, 0, (_CT,), ((-1, {_sV: _CTr}),)) + +LIST_CUSTOM_MODEL_DEPLOYMENTS_INPUT: StaticSchema = ( + 18, + n0, + _LCMDI, + {_sSI: _cLCMDR, _smit: None}, + (_cBr, _cAr, _nC, _mR, _nT, _sB, _sO, _sEt, _mAE), + ( + (TIMESTAMP, {_sQ: _cBr}), + (TIMESTAMP, {_sQ: _cAr}), + (MODEL_DEPLOYMENT_NAME, {_sQ: _nC}), + (MAX_RESULTS, {_sQ: _mR}), + (PAGINATION_TOKEN, {_sQ: _nT}), + (SORT_MODELS_BY, {_sQ: _sB}), + (SORT_ORDER, {_sQ: _sO}), + (CUSTOM_MODEL_DEPLOYMENT_STATUS, {_sQ: _sEt}), + (CUSTOM_MODEL_ARN, {_sQ: _mAE}), + ), ) -AUTOMATED_REASONING_POLICY_STATEMENT_REFERENCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyStatementReference"), - members={ - "documentId": { - "target": AUTOMATED_REASONING_POLICY_DOCUMENT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "statementId": { - "target": AUTOMATED_REASONING_POLICY_STATEMENT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +CUSTOM_MODEL_DEPLOYMENT_SUMMARY: StaticSchema = ( + 18, + n0, + _CMDSu, + 0, + (_cMDA, _cMDN, _mA, _cA, _st, _lUA, _fM), + ( + (CUSTOM_MODEL_DEPLOYMENT_ARN, 1), + (MODEL_DEPLOYMENT_NAME, 1), + (MODEL_ARN, 1), + (TIMESTAMP, 1), + (CUSTOM_MODEL_DEPLOYMENT_STATUS, 1), + (TIMESTAMP, 0), + (ERROR_MESSAGE, 0), + ), ) -AUTOMATED_REASONING_POLICY_STATEMENT_REFERENCE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyStatementReferenceList"), - shape_type=ShapeType.LIST, - members={"member": {"target": AUTOMATED_REASONING_POLICY_STATEMENT_REFERENCE}}, -) - -AUTOMATED_REASONING_POLICY_RULE_REPORT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyRuleReport"), - members={ - "rule": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_RULE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "groundingStatements": { - "target": AUTOMATED_REASONING_POLICY_STATEMENT_REFERENCE_LIST - }, - "groundingJustifications": { - "target": AUTOMATED_REASONING_POLICY_JUSTIFICATION_LIST - }, - "accuracyScore": {"target": AUTOMATED_REASONING_POLICY_ACCURACY_SCORE}, - "accuracyJustification": { - "target": AUTOMATED_REASONING_POLICY_JUSTIFICATION_TEXT - }, - }, +CUSTOM_MODEL_DEPLOYMENT_SUMMARY_LIST: StaticSchema = ( + 16, + n0, + _CMDSL, + 0, + (_me,), + ((CUSTOM_MODEL_DEPLOYMENT_SUMMARY, 0),), +) + +LIST_CUSTOM_MODEL_DEPLOYMENTS_OUTPUT: StaticSchema = ( + 18, + n0, + _LCMDO, + {_sSI: _cLCMDRo, _smith: None}, + (_nT, _mDS), + ((PAGINATION_TOKEN, 0), (CUSTOM_MODEL_DEPLOYMENT_SUMMARY_LIST, 0)), +) + +LIST_CUSTOM_MODEL_DEPLOYMENTS: StaticOperationSchema = ( + 23, + n0, + _LCMD, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "GET", + "uri": "/model-customization/custom-model-deployments", + } + ) + }, + LIST_CUSTOM_MODEL_DEPLOYMENTS_INPUT, + LIST_CUSTOM_MODEL_DEPLOYMENTS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AUTOMATED_REASONING_POLICY_RULE_REPORT_MAP = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyRuleReportMap"), - shape_type=ShapeType.MAP, - members={ - "key": {"target": AUTOMATED_REASONING_POLICY_DEFINITION_RULE_ID}, - "value": {"target": AUTOMATED_REASONING_POLICY_RULE_REPORT}, - }, +UPDATE_CUSTOM_MODEL_DEPLOYMENT_INPUT: StaticSchema = ( + 18, + n0, + _UCMDI, + {_sSI: _cUCMDR, _smit: None}, + (_mA, _cMDI), + ((CUSTOM_MODEL_ARN, 1), (CUSTOM_MODEL_DEPLOYMENT_IDENTIFIER, 9)), +) + +UPDATE_CUSTOM_MODEL_DEPLOYMENT_OUTPUT: StaticSchema = ( + 18, + n0, + _UCMDO, + {_sSI: _cUCMDRo, _smith: None}, + (_cMDA,), + ((CUSTOM_MODEL_DEPLOYMENT_ARN, 1),), +) + +UPDATE_CUSTOM_MODEL_DEPLOYMENT: StaticOperationSchema = ( + 23, + n0, + _UCMD, + { + _smithy: MappingProxyType( + { + "code": 202, + "method": "PATCH", + "uri": "/model-customization/custom-model-deployments/{customModelDeploymentIdentifier}", + } + ) + }, + UPDATE_CUSTOM_MODEL_DEPLOYMENT_INPUT, + UPDATE_CUSTOM_MODEL_DEPLOYMENT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AUTOMATED_REASONING_POLICY_VARIABLE_REPORT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyVariableReport"), - members={ - "policyVariable": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "groundingStatements": { - "target": AUTOMATED_REASONING_POLICY_STATEMENT_REFERENCE_LIST - }, - "groundingJustifications": { - "target": AUTOMATED_REASONING_POLICY_JUSTIFICATION_LIST - }, - "accuracyScore": {"target": AUTOMATED_REASONING_POLICY_ACCURACY_SCORE}, - "accuracyJustification": { - "target": AUTOMATED_REASONING_POLICY_JUSTIFICATION_TEXT - }, - }, +MODEL_PACKAGE_ARN: StaticSchema = (3, n0, _MPA, 0) + +MODEL_PACKAGE_ARN_DATA_SOURCE: StaticSchema = ( + 18, + n0, + _MPADS, + 0, + (_mPA,), + ((MODEL_PACKAGE_ARN, 1),), ) -AUTOMATED_REASONING_POLICY_VARIABLE_REPORT_MAP = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyVariableReportMap"), - shape_type=ShapeType.MAP, - members={ - "key": {"target": AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE_NAME}, - "value": {"target": AUTOMATED_REASONING_POLICY_VARIABLE_REPORT}, - }, +CUSTOM_MODEL_DATA_SOURCE: StaticSchema = ( + 19, + n0, + _CMDSus, + 0, + (_mPADS,), + ((MODEL_PACKAGE_ARN_DATA_SOURCE, 0),), ) -AUTOMATED_REASONING_POLICY_FIDELITY_REPORT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyFidelityReport"), - members={ - "coverageScore": { - "target": AUTOMATED_REASONING_POLICY_COVERAGE_SCORE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "accuracyScore": { - "target": AUTOMATED_REASONING_POLICY_ACCURACY_SCORE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ruleReports": { - "target": AUTOMATED_REASONING_POLICY_RULE_REPORT_MAP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "variableReports": { - "target": AUTOMATED_REASONING_POLICY_VARIABLE_REPORT_MAP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "documentSources": { - "target": AUTOMATED_REASONING_POLICY_REPORT_SOURCE_DOCUMENT_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +CUSTOM_MODEL_NAME: StaticSchema = (3, n0, _CMN, 0) + +S3_DATA_SOURCE: StaticSchema = (18, n0, _SDS, 0, (_sU,), ((S3_URI, 1),)) + +MODEL_DATA_SOURCE: StaticSchema = (19, n0, _MDS, 0, (_sDS,), ((S3_DATA_SOURCE, 0),)) + +CREATE_CUSTOM_MODEL_INPUT: StaticSchema = ( + 18, + n0, + _CCMI, + {_sSI: _cCCMR, _smit: None}, + (_mN, _mSC, _cMDS, _mKKA, _rA, _mTo, _cRT), + ( + (CUSTOM_MODEL_NAME, 1), + (MODEL_DATA_SOURCE, 0), + (CUSTOM_MODEL_DATA_SOURCE, 0), + (KMS_KEY_ARN, 0), + (ROLE_ARN, 0), + (TAG_LIST, 0), + (IDEMPOTENCY_TOKEN, 2), + ), ) -AUTOMATED_REASONING_POLICY_GENERATED_TEST_CASE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyGeneratedTestCase"), - members={ - "queryContent": { - "target": AUTOMATED_REASONING_POLICY_TEST_QUERY_CONTENT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "guardContent": { - "target": AUTOMATED_REASONING_POLICY_TEST_GUARD_CONTENT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "expectedAggregatedFindingsResult": { - "target": AUTOMATED_REASONING_CHECK_RESULT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +CREATE_CUSTOM_MODEL_OUTPUT: StaticSchema = ( + 18, + n0, + _CCMO, + {_sSI: _cCCMRo, _smith: None}, + (_mA,), + ((MODEL_ARN, 1),), +) + +CREATE_CUSTOM_MODEL: StaticOperationSchema = ( + 23, + n0, + _CCM, + { + _smithy: MappingProxyType( + {"code": 202, "method": "POST", "uri": "/custom-models/create-custom-model"} + ) + }, + CREATE_CUSTOM_MODEL_INPUT, + CREATE_CUSTOM_MODEL_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + TOO_MANY_TAGS_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AUTOMATED_REASONING_POLICY_GENERATED_TEST_CASE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyGeneratedTestCaseList"), - shape_type=ShapeType.LIST, - members={"member": {"target": AUTOMATED_REASONING_POLICY_GENERATED_TEST_CASE}}, +MODEL_IDENTIFIER: StaticSchema = (3, n0, _MI, 0) + +DELETE_CUSTOM_MODEL_INPUT: StaticSchema = ( + 18, + n0, + _DCMI, + {_sSI: _cDCMR, _smit: None}, + (_mIo,), + ((MODEL_IDENTIFIER, 9),), ) -AUTOMATED_REASONING_POLICY_GENERATED_TEST_CASES = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyGeneratedTestCases"), - members={ - "generatedTestCases": { - "target": AUTOMATED_REASONING_POLICY_GENERATED_TEST_CASE_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +DELETE_CUSTOM_MODEL_OUTPUT: StaticSchema = ( + 18, + n0, + _DCMO, + {_sSI: _cDCMRo, _smith: None}, ) -AUTOMATED_REASONING_POLICY_SCENARIO_ALTERNATE_EXPRESSION = Schema( - id=ShapeID( - "com.amazonaws.bedrock#AutomatedReasoningPolicyScenarioAlternateExpression" - ), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -AUTOMATED_REASONING_POLICY_SCENARIO = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyScenario"), - members={ - "expression": { - "target": AUTOMATED_REASONING_POLICY_SCENARIO_EXPRESSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "alternateExpression": { - "target": AUTOMATED_REASONING_POLICY_SCENARIO_ALTERNATE_EXPRESSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "expectedResult": { - "target": AUTOMATED_REASONING_CHECK_RESULT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ruleIds": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_RULE_ID_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, +DELETE_CUSTOM_MODEL: StaticOperationSchema = ( + 23, + n0, + _DCM, + { + _smithy: MappingProxyType( + {"code": 200, "method": "DELETE", "uri": "/custom-models/{modelIdentifier}"} + ) }, + DELETE_CUSTOM_MODEL_INPUT, + DELETE_CUSTOM_MODEL_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AUTOMATED_REASONING_POLICY_SCENARIO_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyScenarioList"), - shape_type=ShapeType.LIST, - members={"member": {"target": AUTOMATED_REASONING_POLICY_SCENARIO}}, +GET_CUSTOM_MODEL_INPUT: StaticSchema = ( + 18, + n0, + _GCMI, + {_sSI: _cGCMR, _smit: None}, + (_mIo,), + ((MODEL_IDENTIFIER, 9),), ) -AUTOMATED_REASONING_POLICY_SCENARIOS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyScenarios"), - members={ - "policyScenarios": { - "target": AUTOMATED_REASONING_POLICY_SCENARIO_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +TEACHER_MODEL_IDENTIFIER: StaticSchema = (3, n0, _TMI, 0) + +TEACHER_MODEL_CONFIG: StaticSchema = ( + 18, + n0, + _TMC, + 0, + (_tMI, _mRLFI), + ((TEACHER_MODEL_IDENTIFIER, 1), (7, 0)), ) -AUTOMATED_REASONING_POLICY_CONFLICTED_RULE_ID_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyConflictedRuleIdList"), - shape_type=ShapeType.LIST, - members={"member": {"target": AUTOMATED_REASONING_POLICY_DEFINITION_RULE_ID}}, +DISTILLATION_CONFIG: StaticSchema = ( + 18, + n0, + _DC, + 0, + (_tMC,), + ((TEACHER_MODEL_CONFIG, 1),), ) -AUTOMATED_REASONING_POLICY_DISJOINTED_RULE_ID_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyDisjointedRuleIdList"), - shape_type=ShapeType.LIST, - members={"member": {"target": AUTOMATED_REASONING_POLICY_DEFINITION_RULE_ID}}, +LAMBDA_ARN: StaticSchema = (3, n0, _LA, 0) + +LAMBDA_GRADER_CONFIG: StaticSchema = (18, n0, _LGC, 0, (_lA,), ((LAMBDA_ARN, 1),)) + +GRADER_CONFIG: StaticSchema = (19, n0, _GC, 0, (_lG,), ((LAMBDA_GRADER_CONFIG, 0),)) + +RFT_BATCH_SIZE: StaticSchema = (7, n0, _RFTBS, 0) + +EPOCH_COUNT: StaticSchema = (7, n0, _ECp, 0) + +RFT_EVAL_INTERVAL: StaticSchema = (7, n0, _RFTEI, 0) + +RFT_INFERENCE_MAX_TOKENS: StaticSchema = (7, n0, _RFTIMT, 0) + +RFT_LEARNING_RATE: StaticSchema = (9, n0, _RFTLR, 0) + +RFT_MAX_PROMPT_LENGTH: StaticSchema = (7, n0, _RFTMPL, 0) + +REASONING_EFFORT: StaticSchema = ( + 14, + n0, + _RE, + 0, + (_LOW, _MEDIUM, _HIGH), + ((-1, {_sV: _low}), (-1, {_sV: _med}), (-1, {_sV: _h})), ) -AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE_NAME_LIST = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrock#AutomatedReasoningPolicyDefinitionVariableNameList" +RFT_TRAINING_SAMPLE_PER_PROMPT: StaticSchema = (7, n0, _RFTTSPP, 0) + +RFT_HYPER_PARAMETERS: StaticSchema = ( + 18, + n0, + _RFTHP, + 0, + (_eCp, _bSa, _lR, _mPL, _tSPP, _iMT, _rE, _eIv), + ( + (EPOCH_COUNT, 0), + (RFT_BATCH_SIZE, 0), + (RFT_LEARNING_RATE, 0), + (RFT_MAX_PROMPT_LENGTH, 0), + (RFT_TRAINING_SAMPLE_PER_PROMPT, 0), + (RFT_INFERENCE_MAX_TOKENS, 0), + (REASONING_EFFORT, 0), + (RFT_EVAL_INTERVAL, 0), ), - shape_type=ShapeType.LIST, - members={"member": {"target": AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE_NAME}}, ) -AUTOMATED_REASONING_POLICY_DISJOINT_RULE_SET = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyDisjointRuleSet"), - members={ - "variables": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE_NAME_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "rules": { - "target": AUTOMATED_REASONING_POLICY_DISJOINTED_RULE_ID_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +RFT_CONFIG: StaticSchema = ( + 18, + n0, + _RFTC, + 0, + (_gCr, _hP), + ((GRADER_CONFIG, 0), (RFT_HYPER_PARAMETERS, 0)), +) + +CUSTOMIZATION_CONFIG: StaticSchema = ( + 19, + n0, + _CC, + 0, + (_dCi, _rCf), + ((DISTILLATION_CONFIG, 0), (RFT_CONFIG, 0)), +) + +CUSTOMIZATION_TYPE: StaticSchema = ( + 14, + n0, + _CTu, + 0, + (_FT, _CPT, _DISTILLATION, _RFT, _IMPORTED), + ( + (-1, {_sV: _FT}), + (-1, {_sV: _CPT}), + (-1, {_sV: _DISTILLATION}), + (-1, {_sV: _RFT}), + (-1, {_sV: _IMPORTED}), + ), ) -AUTOMATED_REASONING_POLICY_DISJOINT_RULE_SET_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyDisjointRuleSetList"), - shape_type=ShapeType.LIST, - members={"member": {"target": AUTOMATED_REASONING_POLICY_DISJOINT_RULE_SET}}, +MODEL_CUSTOMIZATION_HYPER_PARAMETERS: StaticSchema = ( + 17, + n0, + _MCHP, + 0, + (_k, _v), + ((3, 0), (3, 0)), ) -AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_NAME_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyDefinitionTypeNameList"), - shape_type=ShapeType.LIST, - members={"member": {"target": AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_NAME}}, -) +MODEL_CUSTOMIZATION_JOB_ARN: StaticSchema = (3, n0, _MCJA, 0) -AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE_PAIR = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyDefinitionTypeValuePair"), - members={ - "typeName": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "valueName": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +JOB_NAME: StaticSchema = (3, n0, _JN, 0) -AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE_PAIR_LIST = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrock#AutomatedReasoningPolicyDefinitionTypeValuePairList" - ), - shape_type=ShapeType.LIST, - members={ - "member": {"target": AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE_PAIR} - }, +MODEL_STATUS: StaticSchema = ( + 14, + n0, + _MS, + 0, + (_ACTIVE, _CREATING, _FAILED), + ((-1, {_sV: _Ac}), (-1, {_sV: _Cr}), (-1, {_sV: _F})), ) -AUTOMATED_REASONING_POLICY_DEFINITION_QUALITY_REPORT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyDefinitionQualityReport"), - members={ - "typeCount": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "variableCount": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ruleCount": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "unusedTypes": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_NAME_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "unusedTypeValues": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE_PAIR_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "unusedVariables": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE_NAME_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "conflictingRules": { - "target": AUTOMATED_REASONING_POLICY_CONFLICTED_RULE_ID_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "disjointRuleSets": { - "target": AUTOMATED_REASONING_POLICY_DISJOINT_RULE_SET_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +OUTPUT_DATA_CONFIG: StaticSchema = (18, n0, _ODC, 0, (_sU,), ((S3_URI, 1),)) + +INVOCATION_LOG_SOURCE: StaticSchema = (19, n0, _ILS, 0, (_sU,), ((S3_URI, 0),)) + +REQUEST_METADATA_MAP: StaticSchema = (17, n0, _RMM, 4, (_k, _v), ((3, 0), (3, 0))) + +REQUEST_METADATA_BASE_FILTERS: StaticSchema = ( + 18, + n0, + _RMBF, + 0, + (_eq, _nE), + ((REQUEST_METADATA_MAP, 0), (REQUEST_METADATA_MAP, 0)), ) -AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSETS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyBuildResultAssets"), - shape_type=ShapeType.UNION, - members={ - "policyDefinition": {"target": AUTOMATED_REASONING_POLICY_DEFINITION}, - "qualityReport": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION_QUALITY_REPORT - }, - "buildLog": {"target": AUTOMATED_REASONING_POLICY_BUILD_LOG}, - "generatedTestCases": { - "target": AUTOMATED_REASONING_POLICY_GENERATED_TEST_CASES - }, - "policyScenarios": {"target": AUTOMATED_REASONING_POLICY_SCENARIOS}, - "assetManifest": { - "target": AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSET_MANIFEST - }, - "document": {"target": AUTOMATED_REASONING_POLICY_SOURCE_DOCUMENT}, - "fidelityReport": {"target": AUTOMATED_REASONING_POLICY_FIDELITY_REPORT}, - }, +REQUEST_METADATA_FILTERS_LIST: StaticSchema = ( + 16, + n0, + _RMFL, + 0, + (_me,), + ((REQUEST_METADATA_BASE_FILTERS, 0),), ) -GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_RESULT_ASSETS_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrock#GetAutomatedReasoningPolicyBuildWorkflowResultAssetsOutput" +REQUEST_METADATA_FILTERS: StaticSchema = ( + 19, + n0, + _RMF, + 0, + (_eq, _nE, _aA, _oA), + ( + (REQUEST_METADATA_MAP, 0), + (REQUEST_METADATA_MAP, 0), + (REQUEST_METADATA_FILTERS_LIST, 0), + (REQUEST_METADATA_FILTERS_LIST, 0), ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetAutomatedReasoningPolicyBuildWorkflowResultAssetsResponse", - ) - ], - members={ - "policyArn": { - "target": AUTOMATED_REASONING_POLICY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "buildWorkflowId": { - "target": AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "buildWorkflowAssets": { - "target": AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSETS - }, - }, ) -GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_RESULT_ASSETS = Schema( - id=ShapeID( - "com.amazonaws.bedrock#GetAutomatedReasoningPolicyBuildWorkflowResultAssets" - ), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowId}/result-assets", - } - ), - ) - ], +USE_PROMPT_RESPONSE: StaticSchema = (2, n0, _UPR, {_s: False}) + +INVOCATION_LOGS_CONFIG: StaticSchema = ( + 18, + n0, + _ILC, + 0, + (_uPR, _iLS, _rMF), + ( + (USE_PROMPT_RESPONSE, {_s: False}), + (INVOCATION_LOG_SOURCE, 1), + (REQUEST_METADATA_FILTERS, 0), + ), ) -GET_AUTOMATED_REASONING_POLICY_NEXT_SCENARIO_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetAutomatedReasoningPolicyNextScenarioInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetAutomatedReasoningPolicyNextScenarioRequest", - ) - ], - members={ - "policyArn": { - "target": AUTOMATED_REASONING_POLICY_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "buildWorkflowId": { - "target": AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, +TRAINING_DATA_CONFIG: StaticSchema = ( + 18, + n0, + _TDC, + 0, + (_sU, _iLC), + ((S3_URI, 0), (INVOCATION_LOGS_CONFIG, 0)), +) + +METRIC_FLOAT: StaticSchema = (9, n0, _MF, 0) + +TRAINING_METRICS: StaticSchema = (18, n0, _TM, 0, (_tL,), ((METRIC_FLOAT, 0),)) + +VALIDATOR: StaticSchema = (18, n0, _V, 0, (_sU,), ((S3_URI, 1),)) + +VALIDATORS: StaticSchema = (16, n0, _Va, 0, (_me,), ((VALIDATOR, 0),)) + +VALIDATION_DATA_CONFIG: StaticSchema = (18, n0, _VDC, 0, (_vali,), ((VALIDATORS, 1),)) + +VALIDATOR_METRIC: StaticSchema = (18, n0, _VM, 0, (_vL,), ((METRIC_FLOAT, 0),)) + +VALIDATION_METRICS: StaticSchema = (16, n0, _VMa, 0, (_me,), ((VALIDATOR_METRIC, 0),)) + +GET_CUSTOM_MODEL_OUTPUT: StaticSchema = ( + 18, + n0, + _GCMO, + {_sSI: _cGCMRo, _smith: None}, + ( + _mA, + _mN, + _jN, + _jA, + _bMA, + _cTu, + _mKKA, + _hP, + _tDC, + _vDC, + _oDC, + _tM, + _vM, + _cTr, + _cC, + _mS, + _fM, + ), + ( + (MODEL_ARN, 1), + (CUSTOM_MODEL_NAME, 1), + (JOB_NAME, 0), + (MODEL_CUSTOMIZATION_JOB_ARN, 0), + (MODEL_ARN, 0), + (CUSTOMIZATION_TYPE, 0), + (KMS_KEY_ARN, 0), + (MODEL_CUSTOMIZATION_HYPER_PARAMETERS, 0), + (TRAINING_DATA_CONFIG, 0), + (VALIDATION_DATA_CONFIG, 0), + (OUTPUT_DATA_CONFIG, 0), + (TRAINING_METRICS, 0), + (VALIDATION_METRICS, 0), + (TIMESTAMP, 1), + (CUSTOMIZATION_CONFIG, 0), + (MODEL_STATUS, 0), + (ERROR_MESSAGE, 0), + ), ) -GET_AUTOMATED_REASONING_POLICY_NEXT_SCENARIO_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetAutomatedReasoningPolicyNextScenarioOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetAutomatedReasoningPolicyNextScenarioResponse", +GET_CUSTOM_MODEL: StaticOperationSchema = ( + 23, + n0, + _GCM, + { + _smithy: MappingProxyType( + {"code": 200, "method": "GET", "uri": "/custom-models/{modelIdentifier}"} ) - ], - members={ - "policyArn": { - "target": AUTOMATED_REASONING_POLICY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "scenario": {"target": AUTOMATED_REASONING_POLICY_SCENARIO}, }, + GET_CUSTOM_MODEL_INPUT, + GET_CUSTOM_MODEL_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -GET_AUTOMATED_REASONING_POLICY_NEXT_SCENARIO = Schema( - id=ShapeID("com.amazonaws.bedrock#GetAutomatedReasoningPolicyNextScenario"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowId}/scenarios", - } - ), - ) - ], +FOUNDATION_MODEL_ARN: StaticSchema = (3, n0, _FMA, 0) + +LIST_CUSTOM_MODELS_INPUT: StaticSchema = ( + 18, + n0, + _LCMI, + {_sSI: _cLCMR, _smit: None}, + (_cTB, _cTA, _nC, _bMAE, _fMAE, _mR, _nT, _sB, _sO, _iO, _mS), + ( + (TIMESTAMP, {_sQ: _cTB}), + (TIMESTAMP, {_sQ: _cTA}), + (CUSTOM_MODEL_NAME, {_sQ: _nC}), + (MODEL_ARN, {_sQ: _bMAE}), + (FOUNDATION_MODEL_ARN, {_sQ: _fMAE}), + (MAX_RESULTS, {_sQ: _mR}), + (PAGINATION_TOKEN, {_sQ: _nT}), + (SORT_MODELS_BY, {_sQ: _sB}), + (SORT_ORDER, {_sQ: _sO}), + (2, {_sQ: _iO}), + (MODEL_STATUS, {_sQ: _mS}), + ), ) -GET_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetAutomatedReasoningPolicyTestCaseInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetAutomatedReasoningPolicyTestCaseRequest", - ) - ], - members={ - "policyArn": { - "target": AUTOMATED_REASONING_POLICY_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "testCaseId": { - "target": AUTOMATED_REASONING_POLICY_TEST_CASE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, +MODEL_NAME: StaticSchema = (3, n0, _MN, 0) + +CUSTOM_MODEL_SUMMARY: StaticSchema = ( + 18, + n0, + _CMS, + 0, + (_mA, _mN, _cTr, _bMA, _bMN, _cTu, _oAI, _mS), + ( + (CUSTOM_MODEL_ARN, 1), + (CUSTOM_MODEL_NAME, 1), + (TIMESTAMP, 1), + (MODEL_ARN, 1), + (MODEL_NAME, 1), + (CUSTOMIZATION_TYPE, 0), + (ACCOUNT_ID, 0), + (MODEL_STATUS, 0), + ), ) -AUTOMATED_REASONING_POLICY_TEST_CASE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyTestCase"), - members={ - "testCaseId": { - "target": AUTOMATED_REASONING_POLICY_TEST_CASE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "guardContent": { - "target": AUTOMATED_REASONING_POLICY_TEST_GUARD_CONTENT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "queryContent": {"target": AUTOMATED_REASONING_POLICY_TEST_QUERY_CONTENT}, - "expectedAggregatedFindingsResult": { - "target": AUTOMATED_REASONING_CHECK_RESULT - }, - "createdAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "confidenceThreshold": { - "target": AUTOMATED_REASONING_CHECK_TRANSLATION_CONFIDENCE - }, - }, +CUSTOM_MODEL_SUMMARY_LIST: StaticSchema = ( + 16, + n0, + _CMSL, + 0, + (_me,), + ((CUSTOM_MODEL_SUMMARY, 0),), +) + +LIST_CUSTOM_MODELS_OUTPUT: StaticSchema = ( + 18, + n0, + _LCMO, + {_sSI: _cLCMRo, _smith: None}, + (_nT, _mSo), + ((PAGINATION_TOKEN, 0), (CUSTOM_MODEL_SUMMARY_LIST, 0)), +) + +LIST_CUSTOM_MODELS: StaticOperationSchema = ( + 23, + n0, + _LCM, + { + _smithy: MappingProxyType( + {"code": 200, "method": "GET", "uri": "/custom-models"} + ) + }, + LIST_CUSTOM_MODELS_INPUT, + LIST_CUSTOM_MODELS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -GET_AUTOMATED_REASONING_POLICY_TEST_CASE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetAutomatedReasoningPolicyTestCaseOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetAutomatedReasoningPolicyTestCaseResponse", - ) - ], - members={ - "policyArn": { - "target": AUTOMATED_REASONING_POLICY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "testCase": { - "target": AUTOMATED_REASONING_POLICY_TEST_CASE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +GET_ACCOUNT_DATA_RETENTION_INPUT: StaticSchema = ( + 18, + n0, + _GADRI, + {_sSI: _cGADRR, _smit: None}, +) + +DATA_RETENTION_MODE: StaticSchema = ( + 14, + n0, + _DRM, + 0, + (_DEFAULT, _NONE, _AR, _PDS, _INHERIT), + ( + (-1, {_sV: _de}), + (-1, {_sV: _no}), + (-1, {_sV: _ar}), + (-1, {_sV: _pds}), + (-1, {_sV: _inh}), + ), ) -GET_AUTOMATED_REASONING_POLICY_TEST_CASE = Schema( - id=ShapeID("com.amazonaws.bedrock#GetAutomatedReasoningPolicyTestCase"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/automated-reasoning-policies/{policyArn}/test-cases/{testCaseId}", - } - ), - ) - ], +GET_ACCOUNT_DATA_RETENTION_OUTPUT: StaticSchema = ( + 18, + n0, + _GADRO, + {_sSI: _cGADRRo, _smith: None}, + (_mo, _uA), + ((DATA_RETENTION_MODE, 1), (TIMESTAMP, 0)), ) -GET_AUTOMATED_REASONING_POLICY_TEST_RESULT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetAutomatedReasoningPolicyTestResultInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetAutomatedReasoningPolicyTestResultRequest", +GET_ACCOUNT_DATA_RETENTION: StaticOperationSchema = ( + 23, + n0, + _GADR, + { + _smithy: MappingProxyType( + {"code": 200, "method": "GET", "uri": "/data-retention"} ) - ], - members={ - "policyArn": { - "target": AUTOMATED_REASONING_POLICY_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "buildWorkflowId": { - "target": AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "testCaseId": { - "target": AUTOMATED_REASONING_POLICY_TEST_CASE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, }, + GET_ACCOUNT_DATA_RETENTION_INPUT, + GET_ACCOUNT_DATA_RETENTION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AUTOMATED_REASONING_CHECK_RULE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningCheckRule"), - members={ - "id": {"target": AUTOMATED_REASONING_POLICY_DEFINITION_RULE_ID}, - "policyVersionArn": {"target": AUTOMATED_REASONING_POLICY_ARN}, - }, +PUT_ACCOUNT_DATA_RETENTION_INPUT: StaticSchema = ( + 18, + n0, + _PADRI, + {_sSI: _cPADRR, _smit: None}, + (_mo,), + ((DATA_RETENTION_MODE, 1),), +) + +PUT_ACCOUNT_DATA_RETENTION_OUTPUT: StaticSchema = ( + 18, + n0, + _PADRO, + {_sSI: _cPADRRo, _smith: None}, + (_mo, _uA), + ((DATA_RETENTION_MODE, 1), (TIMESTAMP, 0)), +) + +PUT_ACCOUNT_DATA_RETENTION: StaticOperationSchema = ( + 23, + n0, + _PADR, + { + _smithy: MappingProxyType( + {"code": 200, "method": "PUT", "uri": "/data-retention"} + ) + }, + PUT_ACCOUNT_DATA_RETENTION_INPUT, + PUT_ACCOUNT_DATA_RETENTION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AUTOMATED_REASONING_CHECK_RULE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningCheckRuleList"), - shape_type=ShapeType.LIST, - members={"member": {"target": AUTOMATED_REASONING_CHECK_RULE}}, +DELETE_ENFORCED_GUARDRAIL_CONFIGURATION_INPUT: StaticSchema = ( + 18, + n0, + _DEGCI, + {_sSI: _cDEGCR, _smit: None}, + (_cI,), + ((ACCOUNT_ENFORCED_GUARDRAIL_CONFIGURATION_ID, 9),), +) + +DELETE_ENFORCED_GUARDRAIL_CONFIGURATION_OUTPUT: StaticSchema = ( + 18, + n0, + _DEGCO, + {_sSI: _cDEGCRo, _smith: None}, +) + +DELETE_ENFORCED_GUARDRAIL_CONFIGURATION: StaticOperationSchema = ( + 23, + n0, + _DEGC, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "DELETE", + "uri": "/enforcedGuardrailsConfiguration/{configId}", + } + ) + }, + DELETE_ENFORCED_GUARDRAIL_CONFIGURATION_INPUT, + DELETE_ENFORCED_GUARDRAIL_CONFIGURATION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AUTOMATED_REASONING_LOGIC_STATEMENT_CONTENT = Schema( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningLogicStatementContent"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +LIST_ENFORCED_GUARDRAILS_CONFIGURATION_INPUT: StaticSchema = ( + 18, + n0, + _LEGCI, + {_sSI: _cLEGCR, _smit: None}, + (_nT,), + ((PAGINATION_TOKEN, {_sQ: _nT}),), +) + +LIST_ENFORCED_GUARDRAILS_CONFIGURATION_OUTPUT: StaticSchema = ( + 18, + n0, + _LEGCO, + {_sSI: _cLEGCRo, _smith: None}, + (_gCu, _nT), + ((ACCOUNT_ENFORCED_GUARDRAILS_OUTPUT_CONFIGURATION, 1), (PAGINATION_TOKEN, 0)), +) + +LIST_ENFORCED_GUARDRAILS_CONFIGURATION: StaticOperationSchema = ( + 23, + n0, + _LEGC, + { + _smithy: MappingProxyType( + {"code": 200, "method": "GET", "uri": "/enforcedGuardrailsConfiguration"} + ) + }, + LIST_ENFORCED_GUARDRAILS_CONFIGURATION_INPUT, + LIST_ENFORCED_GUARDRAILS_CONFIGURATION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AUTOMATED_REASONING_NATURAL_LANGUAGE_STATEMENT_CONTENT = Schema( - id=ShapeID( - "com.amazonaws.bedrock#AutomatedReasoningNaturalLanguageStatementContent" +PUT_ENFORCED_GUARDRAIL_CONFIGURATION_INPUT: StaticSchema = ( + 18, + n0, + _PEGCI, + {_sSI: _cPEGCR, _smit: None}, + (_cI, _gIC), + ( + (ACCOUNT_ENFORCED_GUARDRAIL_CONFIGURATION_ID, 0), + (ACCOUNT_ENFORCED_GUARDRAIL_INFERENCE_INPUT_CONFIGURATION, 1), ), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], ) -AUTOMATED_REASONING_LOGIC_STATEMENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningLogicStatement"), - members={ - "logic": { - "target": AUTOMATED_REASONING_LOGIC_STATEMENT_CONTENT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "naturalLanguage": { - "target": AUTOMATED_REASONING_NATURAL_LANGUAGE_STATEMENT_CONTENT - }, - }, +PUT_ENFORCED_GUARDRAIL_CONFIGURATION_OUTPUT: StaticSchema = ( + 18, + n0, + _PEGCO, + {_sSI: _cPEGCRo, _smith: None}, + (_cI, _uA, _uB), + ((ACCOUNT_ENFORCED_GUARDRAIL_CONFIGURATION_ID, 0), (TIMESTAMP, 0), (3, 0)), +) + +PUT_ENFORCED_GUARDRAIL_CONFIGURATION: StaticOperationSchema = ( + 23, + n0, + _PEGC, + { + _smithy: MappingProxyType( + {"code": 200, "method": "PUT", "uri": "/enforcedGuardrailsConfiguration"} + ) + }, + PUT_ENFORCED_GUARDRAIL_CONFIGURATION_INPUT, + PUT_ENFORCED_GUARDRAIL_CONFIGURATION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AUTOMATED_REASONING_LOGIC_STATEMENT_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningLogicStatementList"), - shape_type=ShapeType.LIST, - members={"member": {"target": AUTOMATED_REASONING_LOGIC_STATEMENT}}, +EVALUATION_JOB_IDENTIFIER: StaticSchema = (3, n0, _EJI, 4) + +EVALUATION_JOB_IDENTIFIERS: StaticSchema = ( + 16, + n0, + _EJIv, + 0, + (_me,), + ((EVALUATION_JOB_IDENTIFIER, 0),), +) + +BATCH_DELETE_EVALUATION_JOB_INPUT: StaticSchema = ( + 18, + n0, + _BDEJI, + {_sSI: _cBDEJR, _smit: None}, + (_jI,), + ((EVALUATION_JOB_IDENTIFIERS, 1),), +) + +BATCH_DELETE_EVALUATION_JOB_ERROR: StaticSchema = ( + 18, + n0, + _BDEJE, + 0, + (_jIo, _co, _m), + ((EVALUATION_JOB_IDENTIFIER, 1), (3, 1), (3, 0)), +) + +BATCH_DELETE_EVALUATION_JOB_ERRORS: StaticSchema = ( + 16, + n0, + _BDEJEa, + 0, + (_me,), + ((BATCH_DELETE_EVALUATION_JOB_ERROR, 0),), +) + +EVALUATION_JOB_STATUS: StaticSchema = ( + 14, + n0, + _EJS, + 0, + (_IP, _COMPLETED, _FAILED, _STOPPING, _STOPPED, _DELETING), + ( + (-1, {_sV: _IPn}), + (-1, {_sV: _C}), + (-1, {_sV: _F}), + (-1, {_sV: _S}), + (-1, {_sV: _St}), + (-1, {_sV: _D}), + ), ) -AUTOMATED_REASONING_CHECK_LOGIC_WARNING_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningCheckLogicWarningType"), - shape_type=ShapeType.ENUM, - members={"ALWAYS_TRUE": {"target": UNIT}, "ALWAYS_FALSE": {"target": UNIT}}, +BATCH_DELETE_EVALUATION_JOB_ITEM: StaticSchema = ( + 18, + n0, + _BDEJIa, + 0, + (_jIo, _jS), + ((EVALUATION_JOB_IDENTIFIER, 1), (EVALUATION_JOB_STATUS, 1)), +) + +BATCH_DELETE_EVALUATION_JOB_ITEMS: StaticSchema = ( + 16, + n0, + _BDEJIat, + 0, + (_me,), + ((BATCH_DELETE_EVALUATION_JOB_ITEM, 0),), +) + +BATCH_DELETE_EVALUATION_JOB_OUTPUT: StaticSchema = ( + 18, + n0, + _BDEJO, + {_sSI: _cBDEJRo, _smith: None}, + (_e, _eJ), + ((BATCH_DELETE_EVALUATION_JOB_ERRORS, 1), (BATCH_DELETE_EVALUATION_JOB_ITEMS, 1)), +) + +BATCH_DELETE_EVALUATION_JOB: StaticOperationSchema = ( + 23, + n0, + _BDEJ, + { + _smithy: MappingProxyType( + {"code": 202, "method": "POST", "uri": "/evaluation-jobs/batch-delete"} + ) + }, + BATCH_DELETE_EVALUATION_JOB_INPUT, + BATCH_DELETE_EVALUATION_JOB_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AUTOMATED_REASONING_CHECK_LOGIC_WARNING = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningCheckLogicWarning"), - members={ - "type": {"target": AUTOMATED_REASONING_CHECK_LOGIC_WARNING_TYPE}, - "premises": {"target": AUTOMATED_REASONING_LOGIC_STATEMENT_LIST}, - "claims": {"target": AUTOMATED_REASONING_LOGIC_STATEMENT_LIST}, - }, +APPLICATION_TYPE: StaticSchema = ( + 14, + n0, + _ATp, + 0, + (_ME_, _RE_), + ((-1, {_sV: _MEo}), (-1, {_sV: _REa})), ) -AUTOMATED_REASONING_CHECK_INPUT_TEXT_REFERENCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningCheckInputTextReference"), - members={ - "text": {"target": AUTOMATED_REASONING_NATURAL_LANGUAGE_STATEMENT_CONTENT} - }, -) +CUSTOM_METRIC_INSTRUCTIONS: StaticSchema = (3, n0, _CMI, 0) -AUTOMATED_REASONING_CHECK_INPUT_TEXT_REFERENCE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningCheckInputTextReferenceList"), - shape_type=ShapeType.LIST, - members={"member": {"target": AUTOMATED_REASONING_CHECK_INPUT_TEXT_REFERENCE}}, -) - -AUTOMATED_REASONING_CHECK_TRANSLATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningCheckTranslation"), - members={ - "premises": {"target": AUTOMATED_REASONING_LOGIC_STATEMENT_LIST}, - "claims": { - "target": AUTOMATED_REASONING_LOGIC_STATEMENT_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "untranslatedPremises": { - "target": AUTOMATED_REASONING_CHECK_INPUT_TEXT_REFERENCE_LIST - }, - "untranslatedClaims": { - "target": AUTOMATED_REASONING_CHECK_INPUT_TEXT_REFERENCE_LIST - }, - "confidence": { - "target": AUTOMATED_REASONING_CHECK_TRANSLATION_CONFIDENCE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +METRIC_NAME: StaticSchema = (3, n0, _MNe, 4) + +RATING_SCALE_ITEM_DEFINITION: StaticSchema = (3, n0, _RSID, 0) + +RATING_SCALE_ITEM_VALUE: StaticSchema = ( + 19, + n0, + _RSIV, + 0, + (_sVt, _fV), + ((3, 0), (9, 0)), ) -AUTOMATED_REASONING_CHECK_IMPOSSIBLE_FINDING = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningCheckImpossibleFinding"), - members={ - "translation": {"target": AUTOMATED_REASONING_CHECK_TRANSLATION}, - "contradictingRules": {"target": AUTOMATED_REASONING_CHECK_RULE_LIST}, - "logicWarning": {"target": AUTOMATED_REASONING_CHECK_LOGIC_WARNING}, - }, +RATING_SCALE_ITEM: StaticSchema = ( + 18, + n0, + _RSI, + 0, + (_def, _v), + ((RATING_SCALE_ITEM_DEFINITION, 1), (RATING_SCALE_ITEM_VALUE, 1)), ) -AUTOMATED_REASONING_CHECK_INVALID_FINDING = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningCheckInvalidFinding"), - members={ - "translation": {"target": AUTOMATED_REASONING_CHECK_TRANSLATION}, - "contradictingRules": {"target": AUTOMATED_REASONING_CHECK_RULE_LIST}, - "logicWarning": {"target": AUTOMATED_REASONING_CHECK_LOGIC_WARNING}, - }, +RATING_SCALE: StaticSchema = (16, n0, _RS, 0, (_me,), ((RATING_SCALE_ITEM, 0),)) + +CUSTOM_METRIC_DEFINITION: StaticSchema = ( + 18, + n0, + _CMD, + 4, + (_n, _ins, _rS), + ((METRIC_NAME, 1), (CUSTOM_METRIC_INSTRUCTIONS, 1), (RATING_SCALE, 0)), ) -AUTOMATED_REASONING_CHECK_NO_TRANSLATIONS_FINDING = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningCheckNoTranslationsFinding") +AUTOMATED_EVALUATION_CUSTOM_METRIC_SOURCE: StaticSchema = ( + 19, + n0, + _AECMS, + 0, + (_cMD,), + ((CUSTOM_METRIC_DEFINITION, 0),), ) -AUTOMATED_REASONING_CHECK_SCENARIO = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningCheckScenario"), - members={"statements": {"target": AUTOMATED_REASONING_LOGIC_STATEMENT_LIST}}, +AUTOMATED_EVALUATION_CUSTOM_METRICS: StaticSchema = ( + 16, + n0, + _AECM, + 0, + (_me,), + ((AUTOMATED_EVALUATION_CUSTOM_METRIC_SOURCE, 0),), ) -AUTOMATED_REASONING_CHECK_SATISFIABLE_FINDING = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningCheckSatisfiableFinding"), - members={ - "translation": {"target": AUTOMATED_REASONING_CHECK_TRANSLATION}, - "claimsTrueScenario": {"target": AUTOMATED_REASONING_CHECK_SCENARIO}, - "claimsFalseScenario": {"target": AUTOMATED_REASONING_CHECK_SCENARIO}, - "logicWarning": {"target": AUTOMATED_REASONING_CHECK_LOGIC_WARNING}, - }, +EVALUATOR_MODEL_IDENTIFIER: StaticSchema = (3, n0, _EMIv, 0) + +CUSTOM_METRIC_BEDROCK_EVALUATOR_MODEL: StaticSchema = ( + 18, + n0, + _CMBEM, + 0, + (_mIo,), + ((EVALUATOR_MODEL_IDENTIFIER, 1),), ) -AUTOMATED_REASONING_CHECK_TOO_COMPLEX_FINDING = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningCheckTooComplexFinding") +CUSTOM_METRIC_BEDROCK_EVALUATOR_MODELS: StaticSchema = ( + 16, + n0, + _CMBEMu, + 0, + (_me,), + ((CUSTOM_METRIC_BEDROCK_EVALUATOR_MODEL, 0),), ) -AUTOMATED_REASONING_CHECK_DIFFERENCE_SCENARIO_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningCheckDifferenceScenarioList"), - shape_type=ShapeType.LIST, - members={"member": {"target": AUTOMATED_REASONING_CHECK_SCENARIO}}, +CUSTOM_METRIC_EVALUATOR_MODEL_CONFIG: StaticSchema = ( + 18, + n0, + _CMEMC, + 0, + (_bEM,), + ((CUSTOM_METRIC_BEDROCK_EVALUATOR_MODELS, 1),), ) -AUTOMATED_REASONING_CHECK_TRANSLATION_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningCheckTranslationList"), - shape_type=ShapeType.LIST, - members={"member": {"target": AUTOMATED_REASONING_CHECK_TRANSLATION}}, +AUTOMATED_EVALUATION_CUSTOM_METRIC_CONFIG: StaticSchema = ( + 18, + n0, + _AECMC, + 0, + (_cM, _eMC), + ( + (AUTOMATED_EVALUATION_CUSTOM_METRICS, 1), + (CUSTOM_METRIC_EVALUATOR_MODEL_CONFIG, 1), + ), ) -AUTOMATED_REASONING_CHECK_TRANSLATION_OPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningCheckTranslationOption"), - members={"translations": {"target": AUTOMATED_REASONING_CHECK_TRANSLATION_LIST}}, +EVALUATION_DATASET_LOCATION: StaticSchema = (19, n0, _EDL, 0, (_sU,), ((S3_URI, 0),)) + +EVALUATION_DATASET_NAME: StaticSchema = (3, n0, _EDN, 4) + +EVALUATION_DATASET: StaticSchema = ( + 18, + n0, + _ED, + 0, + (_n, _dL), + ((EVALUATION_DATASET_NAME, 1), (EVALUATION_DATASET_LOCATION, 0)), ) -AUTOMATED_REASONING_CHECK_TRANSLATION_OPTION_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningCheckTranslationOptionList"), - shape_type=ShapeType.LIST, - members={"member": {"target": AUTOMATED_REASONING_CHECK_TRANSLATION_OPTION}}, +EVALUATION_METRIC_NAME: StaticSchema = (3, n0, _EMN, 4) + +EVALUATION_METRIC_NAMES: StaticSchema = ( + 16, + n0, + _EMNv, + 0, + (_me,), + ((EVALUATION_METRIC_NAME, 0),), ) -AUTOMATED_REASONING_CHECK_TRANSLATION_AMBIGUOUS_FINDING = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrock#AutomatedReasoningCheckTranslationAmbiguousFinding" +EVALUATION_TASK_TYPE: StaticSchema = ( + 14, + n0, + _ETT, + 0, + (_SUMMARIZATION, _CLASSIFICATION, _QAA, _GENERATION, _CUSTOM), + ( + (-1, {_sV: _Su}), + (-1, {_sV: _Cl}), + (-1, {_sV: _QAAu}), + (-1, {_sV: _G}), + (-1, {_sV: _Cu}), ), - members={ - "options": {"target": AUTOMATED_REASONING_CHECK_TRANSLATION_OPTION_LIST}, - "differenceScenarios": { - "target": AUTOMATED_REASONING_CHECK_DIFFERENCE_SCENARIO_LIST - }, - }, ) -AUTOMATED_REASONING_CHECK_VALID_FINDING = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningCheckValidFinding"), - members={ - "translation": {"target": AUTOMATED_REASONING_CHECK_TRANSLATION}, - "claimsTrueScenario": {"target": AUTOMATED_REASONING_CHECK_SCENARIO}, - "supportingRules": {"target": AUTOMATED_REASONING_CHECK_RULE_LIST}, - "logicWarning": {"target": AUTOMATED_REASONING_CHECK_LOGIC_WARNING}, - }, +EVALUATION_DATASET_METRIC_CONFIG: StaticSchema = ( + 18, + n0, + _EDMC, + 0, + (_tT, _da, _mNe), + ((EVALUATION_TASK_TYPE, 1), (EVALUATION_DATASET, 1), (EVALUATION_METRIC_NAMES, 1)), +) + +EVALUATION_DATASET_METRIC_CONFIGS: StaticSchema = ( + 16, + n0, + _EDMCv, + 0, + (_me,), + ((EVALUATION_DATASET_METRIC_CONFIG, 0),), +) + +BEDROCK_EVALUATOR_MODEL: StaticSchema = ( + 18, + n0, + _BEM, + 0, + (_mIo,), + ((EVALUATOR_MODEL_IDENTIFIER, 1),), +) + +BEDROCK_EVALUATOR_MODELS: StaticSchema = ( + 16, + n0, + _BEMe, + 0, + (_me,), + ((BEDROCK_EVALUATOR_MODEL, 0),), +) + +EVALUATOR_MODEL_CONFIG: StaticSchema = ( + 19, + n0, + _EMC, + 0, + (_bEM,), + ((BEDROCK_EVALUATOR_MODELS, 0),), +) + +AUTOMATED_EVALUATION_CONFIG: StaticSchema = ( + 18, + n0, + _AEC, + 0, + (_dMC, _eMC, _cMC), + ( + (EVALUATION_DATASET_METRIC_CONFIGS, 1), + (EVALUATOR_MODEL_CONFIG, 0), + (AUTOMATED_EVALUATION_CUSTOM_METRIC_CONFIG, 0), + ), ) -AUTOMATED_REASONING_CHECK_FINDING = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningCheckFinding"), - shape_type=ShapeType.UNION, - members={ - "valid": {"target": AUTOMATED_REASONING_CHECK_VALID_FINDING}, - "invalid": {"target": AUTOMATED_REASONING_CHECK_INVALID_FINDING}, - "satisfiable": {"target": AUTOMATED_REASONING_CHECK_SATISFIABLE_FINDING}, - "impossible": {"target": AUTOMATED_REASONING_CHECK_IMPOSSIBLE_FINDING}, - "translationAmbiguous": { - "target": AUTOMATED_REASONING_CHECK_TRANSLATION_AMBIGUOUS_FINDING - }, - "tooComplex": {"target": AUTOMATED_REASONING_CHECK_TOO_COMPLEX_FINDING}, - "noTranslations": {"target": AUTOMATED_REASONING_CHECK_NO_TRANSLATIONS_FINDING}, - }, -) +EVALUATION_METRIC_DESCRIPTION: StaticSchema = (3, n0, _EMD, 4) -AUTOMATED_REASONING_CHECK_FINDING_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningCheckFindingList"), - shape_type=ShapeType.LIST, - members={"member": {"target": AUTOMATED_REASONING_CHECK_FINDING}}, -) +EVALUATION_RATING_METHOD: StaticSchema = (3, n0, _ERM, 0) -AUTOMATED_REASONING_POLICY_TEST_RUN_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyTestRunResult"), - shape_type=ShapeType.ENUM, - members={"PASSED": {"target": UNIT}, "FAILED": {"target": UNIT}}, +HUMAN_EVALUATION_CUSTOM_METRIC: StaticSchema = ( + 18, + n0, + _HECM, + 0, + (_n, _d, _rM), + ( + (EVALUATION_METRIC_NAME, 1), + (EVALUATION_METRIC_DESCRIPTION, 0), + (EVALUATION_RATING_METHOD, 1), + ), ) -AUTOMATED_REASONING_POLICY_TEST_RUN_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyTestRunStatus"), - shape_type=ShapeType.ENUM, - members={ - "NOT_STARTED": {"target": UNIT}, - "SCHEDULED": {"target": UNIT}, - "IN_PROGRESS": {"target": UNIT}, - "COMPLETED": {"target": UNIT}, - "FAILED": {"target": UNIT}, - }, +HUMAN_EVALUATION_CUSTOM_METRICS: StaticSchema = ( + 16, + n0, + _HECMu, + 0, + (_me,), + ((HUMAN_EVALUATION_CUSTOM_METRIC, 0),), ) -AUTOMATED_REASONING_POLICY_TEST_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyTestResult"), - members={ - "testCase": { - "target": AUTOMATED_REASONING_POLICY_TEST_CASE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "policyArn": { - "target": AUTOMATED_REASONING_POLICY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "testRunStatus": { - "target": AUTOMATED_REASONING_POLICY_TEST_RUN_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "testFindings": {"target": AUTOMATED_REASONING_CHECK_FINDING_LIST}, - "testRunResult": {"target": AUTOMATED_REASONING_POLICY_TEST_RUN_RESULT}, - "aggregatedTestFindingsResult": {"target": AUTOMATED_REASONING_CHECK_RESULT}, - "updatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +SAGE_MAKER_FLOW_DEFINITION_ARN: StaticSchema = (3, n0, _SMFDA, 0) + +HUMAN_TASK_INSTRUCTIONS: StaticSchema = (3, n0, _HTI, 4) + +HUMAN_WORKFLOW_CONFIG: StaticSchema = ( + 18, + n0, + _HWC, + 0, + (_fDA, _ins), + ((SAGE_MAKER_FLOW_DEFINITION_ARN, 1), (HUMAN_TASK_INSTRUCTIONS, 0)), ) -GET_AUTOMATED_REASONING_POLICY_TEST_RESULT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetAutomatedReasoningPolicyTestResultOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetAutomatedReasoningPolicyTestResultResponse", - ) - ], - members={ - "testResult": { - "target": AUTOMATED_REASONING_POLICY_TEST_RESULT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +HUMAN_EVALUATION_CONFIG: StaticSchema = ( + 18, + n0, + _HEC, + 0, + (_hWC, _cM, _dMC), + ( + (HUMAN_WORKFLOW_CONFIG, 0), + (HUMAN_EVALUATION_CUSTOM_METRICS, 0), + (EVALUATION_DATASET_METRIC_CONFIGS, 1), + ), ) -GET_AUTOMATED_REASONING_POLICY_TEST_RESULT = Schema( - id=ShapeID("com.amazonaws.bedrock#GetAutomatedReasoningPolicyTestResult"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowId}/test-cases/{testCaseId}/test-results", - } - ), - ) - ], +EVALUATION_CONFIG: StaticSchema = ( + 19, + n0, + _ECv, + 0, + (_au, _hu), + ((AUTOMATED_EVALUATION_CONFIG, 0), (HUMAN_EVALUATION_CONFIG, 0)), ) -LIST_AUTOMATED_REASONING_POLICIES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ListAutomatedReasoningPoliciesInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#ListAutomatedReasoningPoliciesRequest", - ) - ], - members={ - "policyArn": { - "target": AUTOMATED_REASONING_POLICY_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="policyArn") - ], - }, - "nextToken": { - "target": PAGINATION_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=25), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults"), - ], - }, - }, +EVALUATION_MODEL_INFERENCE_PARAMS: StaticSchema = (3, n0, _EMIP, 4) + +EVALUATION_BEDROCK_MODEL_IDENTIFIER: StaticSchema = (3, n0, _EBMI, 0) + +PERFORMANCE_CONFIG_LATENCY: StaticSchema = ( + 14, + n0, + _PCL, + 0, + (_STANDARD, _OPTIMIZED), + ((-1, {_sV: _stan}), (-1, {_sV: _opt})), ) -AUTOMATED_REASONING_POLICY_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicySummary"), - members={ - "policyArn": { - "target": AUTOMATED_REASONING_POLICY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": AUTOMATED_REASONING_POLICY_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": AUTOMATED_REASONING_POLICY_DESCRIPTION}, - "version": { - "target": AUTOMATED_REASONING_POLICY_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "policyId": { - "target": AUTOMATED_REASONING_POLICY_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +PERFORMANCE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _PCe, + 0, + (_la,), + ((PERFORMANCE_CONFIG_LATENCY, 0),), ) -AUTOMATED_REASONING_POLICY_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicySummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": AUTOMATED_REASONING_POLICY_SUMMARY}}, +EVALUATION_BEDROCK_MODEL: StaticSchema = ( + 18, + n0, + _EBM, + 0, + (_mIo, _iP, _pC), + ( + (EVALUATION_BEDROCK_MODEL_IDENTIFIER, 1), + (EVALUATION_MODEL_INFERENCE_PARAMS, {_s: _v__}), + (PERFORMANCE_CONFIGURATION, 0), + ), ) -LIST_AUTOMATED_REASONING_POLICIES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ListAutomatedReasoningPoliciesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#ListAutomatedReasoningPoliciesResponse", - ) - ], - members={ - "automatedReasoningPolicySummaries": { - "target": AUTOMATED_REASONING_POLICY_SUMMARIES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": PAGINATION_TOKEN}, - }, +EVALUATION_PRECOMPUTED_INFERENCE_SOURCE_IDENTIFIER: StaticSchema = (3, n0, _EPISI, 0) + +EVALUATION_PRECOMPUTED_INFERENCE_SOURCE: StaticSchema = ( + 18, + n0, + _EPIS, + 0, + (_iSI,), + ((EVALUATION_PRECOMPUTED_INFERENCE_SOURCE_IDENTIFIER, 1),), ) -LIST_AUTOMATED_REASONING_POLICIES = Schema( - id=ShapeID("com.amazonaws.bedrock#ListAutomatedReasoningPolicies"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "GET", "uri": "/automated-reasoning-policies"} - ), - ) - ], +EVALUATION_MODEL_CONFIG: StaticSchema = ( + 19, + n0, + _EMCv, + 0, + (_bM, _pIS), + ((EVALUATION_BEDROCK_MODEL, 0), (EVALUATION_PRECOMPUTED_INFERENCE_SOURCE, 0)), ) -LIST_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOWS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ListAutomatedReasoningPolicyBuildWorkflowsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#ListAutomatedReasoningPolicyBuildWorkflowsRequest", - ) - ], - members={ - "policyArn": { - "target": AUTOMATED_REASONING_POLICY_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "nextToken": { - "target": PAGINATION_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=25), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults"), - ], - }, - }, +EVALUATION_MODEL_CONFIGS: StaticSchema = ( + 16, + n0, + _EMCva, + 0, + (_me,), + ((EVALUATION_MODEL_CONFIG, 0),), ) -AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyBuildWorkflowSummary"), - members={ - "policyArn": { - "target": AUTOMATED_REASONING_POLICY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "buildWorkflowId": { - "target": AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "buildWorkflowType": { - "target": AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +GUARDRAIL_CONFIGURATION: StaticSchema = (18, n0, _GCu, 0, (_gIu, _gV), ((3, 1), (3, 1))) + +MAX_TOKENS: StaticSchema = (7, n0, _MT, 0) + +RAG_STOP_SEQUENCES: StaticSchema = (16, n0, _RAGSS, 0, (_me,), ((3, 0),)) + +TEMPERATURE: StaticSchema = (9, n0, _Te, 0) + +TOP_P: StaticSchema = (9, n0, _TP, 0) + +TEXT_INFERENCE_CONFIG: StaticSchema = ( + 18, + n0, + _TIC, + 0, + (_t, _tP, _mT, _sS), + ((TEMPERATURE, 0), (TOP_P, 0), (MAX_TOKENS, 0), (RAG_STOP_SEQUENCES, 0)), ) -AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyBuildWorkflowSummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_SUMMARY}}, +KB_INFERENCE_CONFIG: StaticSchema = ( + 18, + n0, + _KIC, + 0, + (_tIC,), + ((TEXT_INFERENCE_CONFIG, 0),), ) -LIST_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOWS_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrock#ListAutomatedReasoningPolicyBuildWorkflowsOutput" +TEXT_PROMPT_TEMPLATE: StaticSchema = (3, n0, _TPT, 4) + +PROMPT_TEMPLATE: StaticSchema = (18, n0, _PTr, 0, (_tPT,), ((TEXT_PROMPT_TEMPLATE, 0),)) + +EXTERNAL_SOURCES_GENERATION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _ESGC, + 0, + (_pT, _gCua, _kIC, _aMRF), + ( + (PROMPT_TEMPLATE, 0), + (GUARDRAIL_CONFIGURATION, 0), + (KB_INFERENCE_CONFIG, 0), + (ADDITIONAL_MODEL_REQUEST_FIELDS, 0), ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#ListAutomatedReasoningPolicyBuildWorkflowsResponse", - ) - ], - members={ - "automatedReasoningPolicyBuildWorkflowSummaries": { - "target": AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_SUMMARIES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": PAGINATION_TOKEN}, - }, ) -LIST_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOWS = Schema( - id=ShapeID("com.amazonaws.bedrock#ListAutomatedReasoningPolicyBuildWorkflows"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/automated-reasoning-policies/{policyArn}/build-workflows", - } - ), - ) - ], -) +BEDROCK_MODEL_ARN: StaticSchema = (3, n0, _BMA, 0) -LIST_AUTOMATED_REASONING_POLICY_TEST_CASES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ListAutomatedReasoningPolicyTestCasesInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#ListAutomatedReasoningPolicyTestCasesRequest", - ) - ], - members={ - "policyArn": { - "target": AUTOMATED_REASONING_POLICY_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "nextToken": { - "target": PAGINATION_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=None), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken"), - ], - }, - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=25), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults"), - ], - }, - }, -) +CONTENT_TYPE: StaticSchema = (3, n0, _CTo, 0) + +BYTE_CONTENT_BLOB: StaticSchema = (1, n0, _BCB, 4) + +IDENTIFIER: StaticSchema = (3, n0, _I, 4) -AUTOMATED_REASONING_POLICY_TEST_CASE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyTestCaseList"), - shape_type=ShapeType.LIST, - members={"member": {"target": AUTOMATED_REASONING_POLICY_TEST_CASE}}, +BYTE_CONTENT_DOC: StaticSchema = ( + 18, + n0, + _BCD, + 0, + (_id, _cTon, _dat), + ((IDENTIFIER, 1), (CONTENT_TYPE, 1), (BYTE_CONTENT_BLOB, 1)), ) -LIST_AUTOMATED_REASONING_POLICY_TEST_CASES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ListAutomatedReasoningPolicyTestCasesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#ListAutomatedReasoningPolicyTestCasesResponse", - ) - ], - members={ - "testCases": { - "target": AUTOMATED_REASONING_POLICY_TEST_CASE_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": PAGINATION_TOKEN}, - }, +K_BS3_URI: StaticSchema = (3, n0, _kBSU, 0) + +S3_OBJECT_DOC: StaticSchema = (18, n0, _SOD, 0, (_u,), ((K_BS3_URI, 1),)) + +EXTERNAL_SOURCE_TYPE: StaticSchema = ( + 14, + n0, + _EST, + 0, + (_S_, _BC), + ((-1, {_sV: _S_}), (-1, {_sV: _BC})), ) -LIST_AUTOMATED_REASONING_POLICY_TEST_CASES = Schema( - id=ShapeID("com.amazonaws.bedrock#ListAutomatedReasoningPolicyTestCases"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/automated-reasoning-policies/{policyArn}/test-cases", - } - ), - ) - ], +EXTERNAL_SOURCE: StaticSchema = ( + 18, + n0, + _ES, + 0, + (_sTo, _sLo, _bC), + ((EXTERNAL_SOURCE_TYPE, 1), (S3_OBJECT_DOC, 0), (BYTE_CONTENT_DOC, 0)), ) -LIST_AUTOMATED_REASONING_POLICY_TEST_RESULTS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ListAutomatedReasoningPolicyTestResultsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#ListAutomatedReasoningPolicyTestResultsRequest", - ) - ], - members={ - "policyArn": { - "target": AUTOMATED_REASONING_POLICY_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "buildWorkflowId": { - "target": AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "nextToken": { - "target": PAGINATION_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=None), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken"), - ], - }, - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=25), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults"), - ], - }, - }, +EXTERNAL_SOURCES: StaticSchema = (16, n0, _ESx, 0, (_me,), ((EXTERNAL_SOURCE, 0),)) + +EXTERNAL_SOURCES_RETRIEVE_AND_GENERATE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _ESRAGC, + 0, + (_mA, _so, _gCe), + ( + (BEDROCK_MODEL_ARN, 1), + (EXTERNAL_SOURCES, 1), + (EXTERNAL_SOURCES_GENERATION_CONFIGURATION, 0), + ), ) -AUTOMATED_REASONING_POLICY_TEST_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyTestList"), - shape_type=ShapeType.LIST, - members={"member": {"target": AUTOMATED_REASONING_POLICY_TEST_RESULT}}, +GENERATION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _GCe, + 0, + (_pT, _gCua, _kIC, _aMRF), + ( + (PROMPT_TEMPLATE, 0), + (GUARDRAIL_CONFIGURATION, 0), + (KB_INFERENCE_CONFIG, 0), + (ADDITIONAL_MODEL_REQUEST_FIELDS, 0), + ), ) -LIST_AUTOMATED_REASONING_POLICY_TEST_RESULTS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ListAutomatedReasoningPolicyTestResultsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#ListAutomatedReasoningPolicyTestResultsResponse", - ) - ], - members={ - "testResults": { - "target": AUTOMATED_REASONING_POLICY_TEST_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": PAGINATION_TOKEN}, - }, +KNOWLEDGE_BASE_ID: StaticSchema = (3, n0, _KBI, 0) + +QUERY_TRANSFORMATION_TYPE: StaticSchema = (14, n0, _QTT, 0, (_QD,), ((-1, {_sV: _QD}),)) + +QUERY_TRANSFORMATION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _QTC, + 0, + (_ty,), + ((QUERY_TRANSFORMATION_TYPE, 1),), ) -LIST_AUTOMATED_REASONING_POLICY_TEST_RESULTS = Schema( - id=ShapeID("com.amazonaws.bedrock#ListAutomatedReasoningPolicyTestResults"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowId}/test-results", - } - ), - ) - ], -) - -AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_DOCUMENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyBuildWorkflowDocument"), - members={ - "document": { - "target": AUTOMATED_REASONING_POLICY_BUILD_DOCUMENT_BLOB, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "documentContentType": { - "target": AUTOMATED_REASONING_POLICY_BUILD_DOCUMENT_CONTENT_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "documentName": { - "target": AUTOMATED_REASONING_POLICY_BUILD_DOCUMENT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "documentDescription": { - "target": AUTOMATED_REASONING_POLICY_BUILD_DOCUMENT_DESCRIPTION - }, - }, +ORCHESTRATION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _OC, + 0, + (_qTC,), + ((QUERY_TRANSFORMATION_CONFIGURATION, 1),), ) -AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_DOCUMENT_LIST = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrock#AutomatedReasoningPolicyBuildWorkflowDocumentList" - ), - shape_type=ShapeType.LIST, - members={"member": {"target": AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_DOCUMENT}}, +FILTER_KEY: StaticSchema = (3, n0, _FK, 0) + +FILTER_VALUE: StaticSchema = (13, n0, _FV, 0) + +FILTER_ATTRIBUTE: StaticSchema = ( + 18, + n0, + _FA, + 0, + (_k, _v), + ((FILTER_KEY, 1), (FILTER_VALUE, 1)), ) -AUTOMATED_REASONING_POLICY_GENERATE_FIDELITY_REPORT_DOCUMENT_LIST = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrock#AutomatedReasoningPolicyGenerateFidelityReportDocumentList" +ATTRIBUTE_TYPE: StaticSchema = ( + 14, + n0, + _ATt, + 0, + (_STRING, _NUMBER, _BOOLEAN, _SL), + ( + (-1, {_sV: _STRING}), + (-1, {_sV: _NUMBER}), + (-1, {_sV: _BOOLEAN}), + (-1, {_sV: _SL}), ), - shape_type=ShapeType.LIST, - members={"member": {"target": AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_DOCUMENT}}, ) -AUTOMATED_REASONING_POLICY_GENERATE_FIDELITY_REPORT_CONTENT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrock#AutomatedReasoningPolicyGenerateFidelityReportContent" +METADATA_ATTRIBUTE_SCHEMA: StaticSchema = ( + 18, + n0, + _MAS, + 4, + (_k, _ty, _d), + ((3, 1), (ATTRIBUTE_TYPE, 1), (3, 1)), +) + +METADATA_ATTRIBUTE_SCHEMA_LIST: StaticSchema = ( + 16, + n0, + _MASL, + 0, + (_me,), + ((METADATA_ATTRIBUTE_SCHEMA, 0),), +) + +IMPLICIT_FILTER_CONFIGURATION: StaticSchema = ( + 18, + n0, + _IFC, + 0, + (_mAe, _mA), + ((METADATA_ATTRIBUTE_SCHEMA_LIST, 1), (BEDROCK_MODEL_ARN, 1)), +) + +SEARCH_TYPE: StaticSchema = ( + 14, + n0, + _ST, + 0, + (_HYBRID, _SEMANTIC), + ((-1, {_sV: _HYBRID}), (-1, {_sV: _SEMANTIC})), +) + +RERANKING_METADATA_SELECTION_MODE: StaticSchema = ( + 14, + n0, + _RMSM, + 0, + (_SELECTIVE, _ALL), + ((-1, {_sV: _SELECTIVE}), (-1, {_sV: _ALL})), +) + +FIELD_FOR_RERANKING: StaticSchema = (18, n0, _FFR, 0, (_fN,), ((3, 1),)) + +FIELDS_FOR_RERANKING: StaticSchema = ( + 16, + n0, + _FFRi, + 4, + (_me,), + ((FIELD_FOR_RERANKING, 0),), +) + +RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION: StaticSchema = ( + 19, + n0, + _RMSMC, + 0, + (_fTI, _fTE), + ((FIELDS_FOR_RERANKING, 0), (FIELDS_FOR_RERANKING, 0)), +) + +METADATA_CONFIGURATION_FOR_RERANKING: StaticSchema = ( + 18, + n0, + _MCFR, + 0, + (_sMe, _sMC), + ( + (RERANKING_METADATA_SELECTION_MODE, 1), + (RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION, 0), ), - shape_type=ShapeType.UNION, - members={ - "documents": { - "target": AUTOMATED_REASONING_POLICY_GENERATE_FIDELITY_REPORT_DOCUMENT_LIST - } - }, ) -AUTOMATED_REASONING_POLICY_ITERATIVE_REFINEMENT_DOCUMENT_LIST = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrock#AutomatedReasoningPolicyIterativeRefinementDocumentList" - ), - shape_type=ShapeType.LIST, - members={"member": {"target": AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_DOCUMENT}}, +BEDROCK_RERANKING_MODEL_ARN: StaticSchema = (3, n0, _BRMA, 0) + +VECTOR_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION: StaticSchema = ( + 18, + n0, + _VSBRMC, + 0, + (_mA, _aMRF), + ((BEDROCK_RERANKING_MODEL_ARN, 1), (ADDITIONAL_MODEL_REQUEST_FIELDS, 0)), ) -AUTOMATED_REASONING_POLICY_BUILD_FEEDBACK = Schema( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyBuildFeedback"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +VECTOR_SEARCH_BEDROCK_RERANKING_CONFIGURATION: StaticSchema = ( + 18, + n0, + _VSBRC, + 0, + (_mCo, _nORR, _mCe), + ( + (VECTOR_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION, 1), + (7, 0), + (METADATA_CONFIGURATION_FOR_RERANKING, 0), + ), ) -AUTOMATED_REASONING_POLICY_ITERATIVE_REFINEMENT_CONTENT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrock#AutomatedReasoningPolicyIterativeRefinementContent" +VECTOR_SEARCH_RERANKING_CONFIGURATION_TYPE: StaticSchema = ( + 14, + n0, + _VSRCT, + 0, + (_BRM,), + ((-1, {_sV: _BRM}),), +) + +VECTOR_SEARCH_RERANKING_CONFIGURATION: StaticSchema = ( + 18, + n0, + _VSRC, + 0, + (_ty, _bRC), + ( + (VECTOR_SEARCH_RERANKING_CONFIGURATION_TYPE, 1), + (VECTOR_SEARCH_BEDROCK_RERANKING_CONFIGURATION, 0), ), - members={ - "documents": { - "target": AUTOMATED_REASONING_POLICY_ITERATIVE_REFINEMENT_DOCUMENT_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "feedback": {"target": AUTOMATED_REASONING_POLICY_BUILD_FEEDBACK}, - }, ) -AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_REPAIR_CONTENT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrock#AutomatedReasoningPolicyBuildWorkflowRepairContent" +RETRIEVE_AND_GENERATE_TYPE: StaticSchema = ( + 14, + n0, + _RAGT, + 0, + (_KB, _ES_), + ((-1, {_sV: _KB}), (-1, {_sV: _ES_})), +) + +EVALUATION_PRECOMPUTED_RAG_SOURCE_IDENTIFIER: StaticSchema = (3, n0, _EPRSI, 0) + +EVALUATION_PRECOMPUTED_RETRIEVE_AND_GENERATE_SOURCE_CONFIG: StaticSchema = ( + 18, + n0, + _EPRAGSC, + 0, + (_rSI,), + ((EVALUATION_PRECOMPUTED_RAG_SOURCE_IDENTIFIER, 1),), +) + +EVALUATION_PRECOMPUTED_RETRIEVE_SOURCE_CONFIG: StaticSchema = ( + 18, + n0, + _EPRSC, + 0, + (_rSI,), + ((EVALUATION_PRECOMPUTED_RAG_SOURCE_IDENTIFIER, 1),), +) + +EVALUATION_PRECOMPUTED_RAG_SOURCE_CONFIG: StaticSchema = ( + 19, + n0, + _EPRSCv, + 0, + (_rSC, _rAGSC), + ( + (EVALUATION_PRECOMPUTED_RETRIEVE_SOURCE_CONFIG, 0), + (EVALUATION_PRECOMPUTED_RETRIEVE_AND_GENERATE_SOURCE_CONFIG, 0), ), - members={ - "annotations": { - "target": AUTOMATED_REASONING_POLICY_ANNOTATION_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, ) -AUTOMATED_REASONING_POLICY_WORKFLOW_TYPE_CONTENT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyWorkflowTypeContent"), - shape_type=ShapeType.UNION, - members={ - "documents": { - "target": AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_DOCUMENT_LIST - }, - "policyRepairAssets": { - "target": AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_REPAIR_CONTENT - }, - "generateFidelityReportContent": { - "target": AUTOMATED_REASONING_POLICY_GENERATE_FIDELITY_REPORT_CONTENT - }, - "iterativeRefinementContent": { - "target": AUTOMATED_REASONING_POLICY_ITERATIVE_REFINEMENT_CONTENT - }, - }, +EVALUATION_JOB_DESCRIPTION: StaticSchema = (3, n0, _EJD, 4) + +EVALUATION_JOB_NAME: StaticSchema = (3, n0, _EJN, 0) + +EVALUATION_OUTPUT_DATA_CONFIG: StaticSchema = (18, n0, _EODC, 0, (_sU,), ((S3_URI, 1),)) + +EVALUATION_JOB_ARN: StaticSchema = (3, n0, _EJA, 0) + +CREATE_EVALUATION_JOB_OUTPUT: StaticSchema = ( + 18, + n0, + _CEJO, + {_sSI: _cCEJR, _smith: None}, + (_jA,), + ((EVALUATION_JOB_ARN, 1),), ) -AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyBuildWorkflowSource"), - members={ - "policyDefinition": {"target": AUTOMATED_REASONING_POLICY_DEFINITION}, - "workflowContent": {"target": AUTOMATED_REASONING_POLICY_WORKFLOW_TYPE_CONTENT}, - }, +GET_EVALUATION_JOB_INPUT: StaticSchema = ( + 18, + n0, + _GEJI, + {_sSI: _cGEJR, _smit: None}, + (_jIo,), + ((EVALUATION_JOB_IDENTIFIER, 9),), ) -START_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#StartAutomatedReasoningPolicyBuildWorkflowInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#StartAutomatedReasoningPolicyBuildWorkflowRequest", - ) - ], - members={ - "policyArn": { - "target": AUTOMATED_REASONING_POLICY_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "buildWorkflowType": { - "target": AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "clientRequestToken": { - "target": IDEMPOTENCY_TOKEN, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), value="x-amz-client-token" - ), - Trait.new(id=ShapeID("smithy.api#idempotencyToken")), - ], - }, - "sourceContent": { - "target": AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_SOURCE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpPayload")), - ], - }, - }, +ERROR_MESSAGES: StaticSchema = (16, n0, _EMr, 0, (_me,), ((ERROR_MESSAGE, 0),)) + +EVALUATION_JOB_TYPE: StaticSchema = ( + 14, + n0, + _EJT, + 0, + (_HUMAN, _AUTOMATED), + ((-1, {_sV: _H}), (-1, {_sV: _Au})), ) -START_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrock#StartAutomatedReasoningPolicyBuildWorkflowOutput" +LIST_EVALUATION_JOBS_INPUT: StaticSchema = ( + 18, + n0, + _LEJI, + {_sSI: _cLEJR, _smit: None}, + (_cTA, _cTB, _sEt, _aTE, _nC, _mR, _nT, _sB, _sO), + ( + (TIMESTAMP, {_sQ: _cTA}), + (TIMESTAMP, {_sQ: _cTB}), + (EVALUATION_JOB_STATUS, {_sQ: _sEt}), + (APPLICATION_TYPE, {_sQ: _aTE}), + (EVALUATION_JOB_NAME, {_sQ: _nC}), + (MAX_RESULTS, {_sQ: _mR}), + (PAGINATION_TOKEN, {_sQ: _nT}), + (SORT_JOBS_BY, {_sQ: _sB}), + (SORT_ORDER, {_sQ: _sO}), ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#StartAutomatedReasoningPolicyBuildWorkflowResponse", - ) - ], - members={ - "policyArn": { - "target": AUTOMATED_REASONING_POLICY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "buildWorkflowId": { - "target": AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, ) -START_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW = Schema( - id=ShapeID("com.amazonaws.bedrock#StartAutomatedReasoningPolicyBuildWorkflow"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "POST", - "uri": "/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowType}/start", - } - ), - ) - ], +EVALUATOR_MODEL_IDENTIFIERS: StaticSchema = ( + 16, + n0, + _EMIva, + 0, + (_me,), + ((EVALUATOR_MODEL_IDENTIFIER, 0),), +) + +EVALUATION_TASK_TYPES: StaticSchema = ( + 16, + n0, + _ETTv, + 0, + (_me,), + ((EVALUATION_TASK_TYPE, 0),), +) + +EVALUATION_BEDROCK_MODEL_IDENTIFIERS: StaticSchema = ( + 16, + n0, + _EBMIv, + 0, + (_me,), + ((EVALUATION_BEDROCK_MODEL_IDENTIFIER, 0),), +) + +EVALUATION_PRECOMPUTED_INFERENCE_SOURCE_IDENTIFIERS: StaticSchema = ( + 16, + n0, + _EPISIv, + 0, + (_me,), + ((EVALUATION_PRECOMPUTED_INFERENCE_SOURCE_IDENTIFIER, 0),), +) + +EVALUATION_MODEL_CONFIG_SUMMARY: StaticSchema = ( + 18, + n0, + _EMCS, + 0, + (_bMI, _pISI), + ( + (EVALUATION_BEDROCK_MODEL_IDENTIFIERS, 0), + (EVALUATION_PRECOMPUTED_INFERENCE_SOURCE_IDENTIFIERS, 0), + ), ) -AUTOMATED_REASONING_POLICY_TEST_CASE_ID_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyTestCaseIdList"), - shape_type=ShapeType.LIST, - members={"member": {"target": AUTOMATED_REASONING_POLICY_TEST_CASE_ID}}, +EVALUATION_BEDROCK_KNOWLEDGE_BASE_IDENTIFIERS: StaticSchema = ( + 16, + n0, + _EBKBI, + 0, + (_me,), + ((KNOWLEDGE_BASE_ID, 0),), +) + +EVALUATION_PRECOMPUTED_RAG_SOURCE_IDENTIFIERS: StaticSchema = ( + 16, + n0, + _EPRSIv, + 0, + (_me,), + ((EVALUATION_PRECOMPUTED_RAG_SOURCE_IDENTIFIER, 0),), +) + +EVALUATION_RAG_CONFIG_SUMMARY: StaticSchema = ( + 18, + n0, + _ERCS, + 0, + (_bKBI, _pRSI), + ( + (EVALUATION_BEDROCK_KNOWLEDGE_BASE_IDENTIFIERS, 0), + (EVALUATION_PRECOMPUTED_RAG_SOURCE_IDENTIFIERS, 0), + ), ) -START_AUTOMATED_REASONING_POLICY_TEST_WORKFLOW_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#StartAutomatedReasoningPolicyTestWorkflowInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#StartAutomatedReasoningPolicyTestWorkflowRequest", - ) - ], - members={ - "policyArn": { - "target": AUTOMATED_REASONING_POLICY_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "buildWorkflowId": { - "target": AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "testCaseIds": {"target": AUTOMATED_REASONING_POLICY_TEST_CASE_ID_LIST}, - "clientRequestToken": { - "target": IDEMPOTENCY_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - }, +EVALUATION_INFERENCE_CONFIG_SUMMARY: StaticSchema = ( + 18, + n0, + _EICS, + 0, + (_mCS, _rCS), + ((EVALUATION_MODEL_CONFIG_SUMMARY, 0), (EVALUATION_RAG_CONFIG_SUMMARY, 0)), +) + +EVALUATION_SUMMARY: StaticSchema = ( + 18, + n0, + _ESv, + 0, + (_jA, _jN, _st, _cTr, _jT, _eTT, _mIod, _rIa, _eMI, _cMEMI, _iCS, _aTp), + ( + (EVALUATION_JOB_ARN, 1), + (EVALUATION_JOB_NAME, 1), + (EVALUATION_JOB_STATUS, 1), + (TIMESTAMP, 1), + (EVALUATION_JOB_TYPE, 1), + (EVALUATION_TASK_TYPES, 1), + (EVALUATION_BEDROCK_MODEL_IDENTIFIERS, {_s: ()}), + (EVALUATION_BEDROCK_KNOWLEDGE_BASE_IDENTIFIERS, 0), + (EVALUATOR_MODEL_IDENTIFIERS, 0), + (EVALUATOR_MODEL_IDENTIFIERS, 0), + (EVALUATION_INFERENCE_CONFIG_SUMMARY, 0), + (APPLICATION_TYPE, 0), + ), ) -START_AUTOMATED_REASONING_POLICY_TEST_WORKFLOW_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#StartAutomatedReasoningPolicyTestWorkflowOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#StartAutomatedReasoningPolicyTestWorkflowResponse", - ) - ], - members={ - "policyArn": { - "target": AUTOMATED_REASONING_POLICY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +EVALUATION_SUMMARIES: StaticSchema = ( + 16, + n0, + _ESva, + 0, + (_me,), + ((EVALUATION_SUMMARY, 0),), +) + +LIST_EVALUATION_JOBS_OUTPUT: StaticSchema = ( + 18, + n0, + _LEJO, + {_sSI: _cLEJRo, _smith: None}, + (_nT, _jSo), + ((PAGINATION_TOKEN, 0), (EVALUATION_SUMMARIES, 0)), +) + +LIST_EVALUATION_JOBS: StaticOperationSchema = ( + 23, + n0, + _LEJ, + { + _smithy: MappingProxyType( + {"code": 200, "method": "GET", "uri": "/evaluation-jobs"} + ) + }, + LIST_EVALUATION_JOBS_INPUT, + LIST_EVALUATION_JOBS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -START_AUTOMATED_REASONING_POLICY_TEST_WORKFLOW = Schema( - id=ShapeID("com.amazonaws.bedrock#StartAutomatedReasoningPolicyTestWorkflow"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "POST", - "uri": "/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowId}/test-workflows", - } - ), - ) - ], +STOP_EVALUATION_JOB_INPUT: StaticSchema = ( + 18, + n0, + _SEJI, + {_sSI: _cSEJR, _smit: None}, + (_jIo,), + ((EVALUATION_JOB_IDENTIFIER, 9),), +) + +STOP_EVALUATION_JOB_OUTPUT: StaticSchema = ( + 18, + n0, + _SEJO, + {_sSI: _cSEJRo, _smith: None}, +) + +STOP_EVALUATION_JOB: StaticOperationSchema = ( + 23, + n0, + _SEJ, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "POST", + "uri": "/evaluation-job/{jobIdentifier}/stop", + } + ) + }, + STOP_EVALUATION_JOB_INPUT, + STOP_EVALUATION_JOB_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -UPDATE_AUTOMATED_REASONING_POLICY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#UpdateAutomatedReasoningPolicyInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#UpdateAutomatedReasoningPolicyRequest", - ) - ], - members={ - "policyArn": { - "target": AUTOMATED_REASONING_POLICY_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "policyDefinition": { - "target": AUTOMATED_REASONING_POLICY_DEFINITION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": {"target": AUTOMATED_REASONING_POLICY_NAME}, - "description": {"target": AUTOMATED_REASONING_POLICY_DESCRIPTION}, - }, -) +AUTOMATED_REASONING_CONFIDENCE_FILTER_THRESHOLD: StaticSchema = (10, n0, _ARCFT, 0) -UPDATE_AUTOMATED_REASONING_POLICY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#UpdateAutomatedReasoningPolicyOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#UpdateAutomatedReasoningPolicyResponse", - ) - ], - members={ - "policyArn": { - "target": AUTOMATED_REASONING_POLICY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": AUTOMATED_REASONING_POLICY_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "definitionHash": { - "target": AUTOMATED_REASONING_POLICY_HASH, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +AUTOMATED_REASONING_POLICY_ARN_LIST: StaticSchema = ( + 16, + n0, + _ARPALut, + 0, + (_me,), + ((AUTOMATED_REASONING_POLICY_ARN, 0),), ) -UPDATE_AUTOMATED_REASONING_POLICY = Schema( - id=ShapeID("com.amazonaws.bedrock#UpdateAutomatedReasoningPolicy"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "PATCH", - "uri": "/automated-reasoning-policies/{policyArn}", - } - ), - ) - ], +GUARDRAIL_AUTOMATED_REASONING_POLICY_CONFIG: StaticSchema = ( + 18, + n0, + _GARPC, + 0, + (_po, _cTo), + ( + (AUTOMATED_REASONING_POLICY_ARN_LIST, 1), + (AUTOMATED_REASONING_CONFIDENCE_FILTER_THRESHOLD, 0), + ), ) -UPDATE_AUTOMATED_REASONING_POLICY_ANNOTATIONS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#UpdateAutomatedReasoningPolicyAnnotationsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#UpdateAutomatedReasoningPolicyAnnotationsRequest", - ) - ], - members={ - "policyArn": { - "target": AUTOMATED_REASONING_POLICY_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "buildWorkflowId": { - "target": AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "annotations": { - "target": AUTOMATED_REASONING_POLICY_ANNOTATION_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastUpdatedAnnotationSetHash": { - "target": AUTOMATED_REASONING_POLICY_HASH, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +GUARDRAIL_BLOCKED_MESSAGING: StaticSchema = (3, n0, _GBM, 4) + +GUARDRAIL_CONTENT_FILTER_ACTION: StaticSchema = ( + 14, + n0, + _GCFA, + 4, + (_BLOCK, _NONE), + ((-1, {_sV: _BLOCK}), (-1, {_sV: _NONE})), +) + +GUARDRAIL_MODALITY: StaticSchema = ( + 14, + n0, + _GM, + 4, + (_TEXT, _IMAGE), + ((-1, {_sV: _TEXT}), (-1, {_sV: _IMAGE})), +) + +GUARDRAIL_MODALITIES: StaticSchema = ( + 16, + n0, + _GMu, + 0, + (_me,), + ((GUARDRAIL_MODALITY, 0),), +) + +GUARDRAIL_FILTER_STRENGTH: StaticSchema = ( + 14, + n0, + _GFS, + 0, + (_NONE, _LOW, _MEDIUM, _HIGH), + ((-1, {_sV: _NONE}), (-1, {_sV: _LOW}), (-1, {_sV: _MEDIUM}), (-1, {_sV: _HIGH})), +) + +GUARDRAIL_CONTENT_FILTER_TYPE: StaticSchema = ( + 14, + n0, + _GCFT, + 0, + (_SEXUAL, _VIOLENCE, _HATE, _INSULTS, _MISCONDUCT, _PA), + ( + (-1, {_sV: _SEXUAL}), + (-1, {_sV: _VIOLENCE}), + (-1, {_sV: _HATE}), + (-1, {_sV: _INSULTS}), + (-1, {_sV: _MISCONDUCT}), + (-1, {_sV: _PA}), + ), ) -UPDATE_AUTOMATED_REASONING_POLICY_ANNOTATIONS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#UpdateAutomatedReasoningPolicyAnnotationsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#UpdateAutomatedReasoningPolicyAnnotationsResponse", - ) - ], - members={ - "policyArn": { - "target": AUTOMATED_REASONING_POLICY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "buildWorkflowId": { - "target": AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "annotationSetHash": { - "target": AUTOMATED_REASONING_POLICY_HASH, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +GUARDRAIL_CONTENT_FILTER_CONFIG: StaticSchema = ( + 18, + n0, + _GCFC, + 0, + (_ty, _iS, _oS, _iMn, _oM, _iA, _oAu, _iE, _oE), + ( + (GUARDRAIL_CONTENT_FILTER_TYPE, 1), + (GUARDRAIL_FILTER_STRENGTH, 1), + (GUARDRAIL_FILTER_STRENGTH, 1), + (GUARDRAIL_MODALITIES, 0), + (GUARDRAIL_MODALITIES, 0), + (GUARDRAIL_CONTENT_FILTER_ACTION, 0), + (GUARDRAIL_CONTENT_FILTER_ACTION, 0), + (2, 0), + (2, 0), + ), ) -UPDATE_AUTOMATED_REASONING_POLICY_ANNOTATIONS = Schema( - id=ShapeID("com.amazonaws.bedrock#UpdateAutomatedReasoningPolicyAnnotations"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "PATCH", - "uri": "/automated-reasoning-policies/{policyArn}/build-workflows/{buildWorkflowId}/annotations", - } - ), - ) - ], +GUARDRAIL_CONTENT_FILTERS_CONFIG: StaticSchema = ( + 16, + n0, + _GCFCu, + 0, + (_me,), + ((GUARDRAIL_CONTENT_FILTER_CONFIG, 0),), +) + +GUARDRAIL_CONTENT_FILTERS_TIER_NAME: StaticSchema = ( + 14, + n0, + _GCFTN, + 4, + (_CLASSIC, _STANDARD), + ((-1, {_sV: _CLASSIC}), (-1, {_sV: _STANDARD})), +) + +GUARDRAIL_CONTENT_FILTERS_TIER_CONFIG: StaticSchema = ( + 18, + n0, + _GCFTC, + 0, + (_tNi,), + ((GUARDRAIL_CONTENT_FILTERS_TIER_NAME, 1),), +) + +GUARDRAIL_CONTENT_POLICY_CONFIG: StaticSchema = ( + 18, + n0, + _GCPC, + 0, + (_fC, _tCi), + ((GUARDRAIL_CONTENT_FILTERS_CONFIG, 1), (GUARDRAIL_CONTENT_FILTERS_TIER_CONFIG, 0)), +) + +GUARDRAIL_CONTEXTUAL_GROUNDING_ACTION: StaticSchema = ( + 14, + n0, + _GCGA, + 4, + (_BLOCK, _NONE), + ((-1, {_sV: _BLOCK}), (-1, {_sV: _NONE})), +) + +GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER_TYPE: StaticSchema = ( + 14, + n0, + _GCGFT, + 0, + (_GROUNDING, _RELEVANCE), + ((-1, {_sV: _GROUNDING}), (-1, {_sV: _RELEVANCE})), +) + +GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER_CONFIG: StaticSchema = ( + 18, + n0, + _GCGFC, + 0, + (_ty, _th, _ac, _ena), + ( + (GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER_TYPE, 1), + (10, 1), + (GUARDRAIL_CONTEXTUAL_GROUNDING_ACTION, 0), + (2, 0), + ), ) -UPDATE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#UpdateAutomatedReasoningPolicyTestCaseInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#UpdateAutomatedReasoningPolicyTestCaseRequest", - ) - ], - members={ - "policyArn": { - "target": AUTOMATED_REASONING_POLICY_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "testCaseId": { - "target": AUTOMATED_REASONING_POLICY_TEST_CASE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "guardContent": { - "target": AUTOMATED_REASONING_POLICY_TEST_GUARD_CONTENT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "queryContent": {"target": AUTOMATED_REASONING_POLICY_TEST_QUERY_CONTENT}, - "lastUpdatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "expectedAggregatedFindingsResult": { - "target": AUTOMATED_REASONING_CHECK_RESULT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "confidenceThreshold": { - "target": AUTOMATED_REASONING_CHECK_TRANSLATION_CONFIDENCE - }, - "clientRequestToken": { - "target": IDEMPOTENCY_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - }, +GUARDRAIL_CONTEXTUAL_GROUNDING_FILTERS_CONFIG: StaticSchema = ( + 16, + n0, + _GCGFCu, + 0, + (_me,), + ((GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER_CONFIG, 0),), +) + +GUARDRAIL_CONTEXTUAL_GROUNDING_POLICY_CONFIG: StaticSchema = ( + 18, + n0, + _GCGPC, + 0, + (_fC,), + ((GUARDRAIL_CONTEXTUAL_GROUNDING_FILTERS_CONFIG, 1),), +) + +GUARDRAIL_CROSS_REGION_GUARDRAIL_PROFILE_IDENTIFIER: StaticSchema = (3, n0, _GCRGPI, 0) + +GUARDRAIL_CROSS_REGION_CONFIG: StaticSchema = ( + 18, + n0, + _GCRC, + 0, + (_gPI,), + ((GUARDRAIL_CROSS_REGION_GUARDRAIL_PROFILE_IDENTIFIER, 1),), +) + +GUARDRAIL_DESCRIPTION: StaticSchema = (3, n0, _GD, 4) + +GUARDRAIL_NAME: StaticSchema = (3, n0, _GN, 4) + +GUARDRAIL_SENSITIVE_INFORMATION_ACTION: StaticSchema = ( + 14, + n0, + _GSIA, + 0, + (_BLOCK, _ANONYMIZE, _NONE), + ((-1, {_sV: _BLOCK}), (-1, {_sV: _ANONYMIZE}), (-1, {_sV: _NONE})), +) + +GUARDRAIL_PII_ENTITY_TYPE: StaticSchema = ( + 14, + n0, + _GPET, + 0, + ( + _ADDRESS, + _AGE, + _AAK, + _ASK, + _CHN, + _CSIN, + _CDCC, + _CDCE, + _CDCN, + _DI, + _EMAIL, + _IBAN, + _IA, + _LP, + _MA_, + _NAME, + _PASSWORD, + _PHONE, + _PIN, + _SC, + _UNHSN, + _UNIN, + _UUTRN, + _URL, + _USERNAME, + _UBAN, + _UBRN, + _UITIN, + _UPN, + _USSN, + _VIN, + ), + ( + (-1, {_sV: _ADDRESS}), + (-1, {_sV: _AGE}), + (-1, {_sV: _AAK}), + (-1, {_sV: _ASK}), + (-1, {_sV: _CHN}), + (-1, {_sV: _CSIN}), + (-1, {_sV: _CDCC}), + (-1, {_sV: _CDCE}), + (-1, {_sV: _CDCN}), + (-1, {_sV: _DI}), + (-1, {_sV: _EMAIL}), + (-1, {_sV: _IBAN}), + (-1, {_sV: _IA}), + (-1, {_sV: _LP}), + (-1, {_sV: _MA_}), + (-1, {_sV: _NAME}), + (-1, {_sV: _PASSWORD}), + (-1, {_sV: _PHONE}), + (-1, {_sV: _PIN}), + (-1, {_sV: _SC}), + (-1, {_sV: _UNHSN}), + (-1, {_sV: _UNIN}), + (-1, {_sV: _UUTRN}), + (-1, {_sV: _URL}), + (-1, {_sV: _USERNAME}), + (-1, {_sV: _UBAN}), + (-1, {_sV: _UBRN}), + (-1, {_sV: _UITIN}), + (-1, {_sV: _UPN}), + (-1, {_sV: _USSN}), + (-1, {_sV: _VIN}), + ), ) -UPDATE_AUTOMATED_REASONING_POLICY_TEST_CASE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#UpdateAutomatedReasoningPolicyTestCaseOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#UpdateAutomatedReasoningPolicyTestCaseResponse", - ) - ], - members={ - "policyArn": { - "target": AUTOMATED_REASONING_POLICY_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "testCaseId": { - "target": AUTOMATED_REASONING_POLICY_TEST_CASE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +GUARDRAIL_PII_ENTITY_CONFIG: StaticSchema = ( + 18, + n0, + _GPEC, + 0, + (_ty, _ac, _iA, _oAu, _iE, _oE), + ( + (GUARDRAIL_PII_ENTITY_TYPE, 1), + (GUARDRAIL_SENSITIVE_INFORMATION_ACTION, 1), + (GUARDRAIL_SENSITIVE_INFORMATION_ACTION, 0), + (GUARDRAIL_SENSITIVE_INFORMATION_ACTION, 0), + (2, 0), + (2, 0), + ), ) -UPDATE_AUTOMATED_REASONING_POLICY_TEST_CASE = Schema( - id=ShapeID("com.amazonaws.bedrock#UpdateAutomatedReasoningPolicyTestCase"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "PATCH", - "uri": "/automated-reasoning-policies/{policyArn}/test-cases/{testCaseId}", - } - ), - ) - ], +GUARDRAIL_PII_ENTITIES_CONFIG: StaticSchema = ( + 16, + n0, + _GPECu, + 0, + (_me,), + ((GUARDRAIL_PII_ENTITY_CONFIG, 0),), +) + +GUARDRAIL_REGEX_CONFIG: StaticSchema = ( + 18, + n0, + _GRC, + 0, + (_n, _d, _pa, _ac, _iA, _oAu, _iE, _oE), + ( + (3, 1), + (3, 0), + (3, 1), + (GUARDRAIL_SENSITIVE_INFORMATION_ACTION, 1), + (GUARDRAIL_SENSITIVE_INFORMATION_ACTION, 0), + (GUARDRAIL_SENSITIVE_INFORMATION_ACTION, 0), + (2, 0), + (2, 0), + ), ) -ROLE_ARN = Schema( - id=ShapeID("com.amazonaws.bedrock#RoleArn"), shape_type=ShapeType.STRING +GUARDRAIL_REGEXES_CONFIG: StaticSchema = ( + 16, + n0, + _GRCu, + 0, + (_me,), + ((GUARDRAIL_REGEX_CONFIG, 0),), +) + +GUARDRAIL_SENSITIVE_INFORMATION_POLICY_CONFIG: StaticSchema = ( + 18, + n0, + _GSIPC, + 0, + (_pEC, _rCe), + ((GUARDRAIL_PII_ENTITIES_CONFIG, 0), (GUARDRAIL_REGEXES_CONFIG, 0)), +) + +GUARDRAIL_TOPICS_TIER_NAME: StaticSchema = ( + 14, + n0, + _GTTN, + 4, + (_CLASSIC, _STANDARD), + ((-1, {_sV: _CLASSIC}), (-1, {_sV: _STANDARD})), +) + +GUARDRAIL_TOPICS_TIER_CONFIG: StaticSchema = ( + 18, + n0, + _GTTC, + 0, + (_tNi,), + ((GUARDRAIL_TOPICS_TIER_NAME, 1),), +) + +GUARDRAIL_TOPIC_DEFINITION: StaticSchema = (3, n0, _GTD, 4) + +GUARDRAIL_TOPIC_EXAMPLE: StaticSchema = (3, n0, _GTE, 4) + +GUARDRAIL_TOPIC_EXAMPLES: StaticSchema = ( + 16, + n0, + _GTEu, + 0, + (_me,), + ((GUARDRAIL_TOPIC_EXAMPLE, 0),), +) + +GUARDRAIL_TOPIC_ACTION: StaticSchema = ( + 14, + n0, + _GTA, + 4, + (_BLOCK, _NONE), + ((-1, {_sV: _BLOCK}), (-1, {_sV: _NONE})), +) + +GUARDRAIL_TOPIC_NAME: StaticSchema = (3, n0, _GTN, 4) + +GUARDRAIL_TOPIC_TYPE: StaticSchema = (14, n0, _GTT, 0, (_DENY,), ((-1, {_sV: _DENY}),)) + +GUARDRAIL_TOPIC_CONFIG: StaticSchema = ( + 18, + n0, + _GTCu, + 0, + (_n, _def, _exa, _ty, _iA, _oAu, _iE, _oE), + ( + (GUARDRAIL_TOPIC_NAME, 1), + (GUARDRAIL_TOPIC_DEFINITION, 1), + (GUARDRAIL_TOPIC_EXAMPLES, 0), + (GUARDRAIL_TOPIC_TYPE, 1), + (GUARDRAIL_TOPIC_ACTION, 0), + (GUARDRAIL_TOPIC_ACTION, 0), + (2, 0), + (2, 0), + ), ) -INSTANCE_COUNT = Schema( - id=ShapeID("com.amazonaws.bedrock#InstanceCount"), shape_type=ShapeType.INTEGER +GUARDRAIL_TOPICS_CONFIG: StaticSchema = ( + 16, + n0, + _GTCua, + 0, + (_me,), + ((GUARDRAIL_TOPIC_CONFIG, 0),), +) + +GUARDRAIL_TOPIC_POLICY_CONFIG: StaticSchema = ( + 18, + n0, + _GTPC, + 0, + (_tCop, _tCi), + ((GUARDRAIL_TOPICS_CONFIG, 1), (GUARDRAIL_TOPICS_TIER_CONFIG, 0)), +) + +GUARDRAIL_WORD_ACTION: StaticSchema = ( + 14, + n0, + _GWA, + 4, + (_BLOCK, _NONE), + ((-1, {_sV: _BLOCK}), (-1, {_sV: _NONE})), +) + +GUARDRAIL_MANAGED_WORDS_TYPE: StaticSchema = ( + 14, + n0, + _GMWT, + 0, + (_PROFANITY,), + ((-1, {_sV: _PROFANITY}),), +) + +GUARDRAIL_MANAGED_WORDS_CONFIG: StaticSchema = ( + 18, + n0, + _GMWC, + 0, + (_ty, _iA, _oAu, _iE, _oE), + ( + (GUARDRAIL_MANAGED_WORDS_TYPE, 1), + (GUARDRAIL_WORD_ACTION, 0), + (GUARDRAIL_WORD_ACTION, 0), + (2, 0), + (2, 0), + ), ) -INSTANCE_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrock#InstanceType"), shape_type=ShapeType.STRING +GUARDRAIL_MANAGED_WORD_LISTS_CONFIG: StaticSchema = ( + 16, + n0, + _GMWLC, + 0, + (_me,), + ((GUARDRAIL_MANAGED_WORDS_CONFIG, 0),), +) + +GUARDRAIL_WORD_CONFIG: StaticSchema = ( + 18, + n0, + _GWC, + 0, + (_te, _iA, _oAu, _iE, _oE), + ((3, 1), (GUARDRAIL_WORD_ACTION, 0), (GUARDRAIL_WORD_ACTION, 0), (2, 0), (2, 0)), +) + +GUARDRAIL_WORDS_CONFIG: StaticSchema = ( + 16, + n0, + _GWCu, + 0, + (_me,), + ((GUARDRAIL_WORD_CONFIG, 0),), +) + +GUARDRAIL_WORD_POLICY_CONFIG: StaticSchema = ( + 18, + n0, + _GWPC, + 0, + (_wCo, _mWLC), + ((GUARDRAIL_WORDS_CONFIG, 0), (GUARDRAIL_MANAGED_WORD_LISTS_CONFIG, 0)), +) + +CREATE_GUARDRAIL_INPUT: StaticSchema = ( + 18, + n0, + _CGI, + {_sSI: _cCGR, _smit: None}, + (_n, _d, _tPC, _cPC, _wPC, _sIPC, _cGPC, _aRPC, _cRC, _bIM, _bOM, _kKI, _ta, _cRT), + ( + (GUARDRAIL_NAME, 1), + (GUARDRAIL_DESCRIPTION, 0), + (GUARDRAIL_TOPIC_POLICY_CONFIG, 0), + (GUARDRAIL_CONTENT_POLICY_CONFIG, 0), + (GUARDRAIL_WORD_POLICY_CONFIG, 0), + (GUARDRAIL_SENSITIVE_INFORMATION_POLICY_CONFIG, 0), + (GUARDRAIL_CONTEXTUAL_GROUNDING_POLICY_CONFIG, 0), + (GUARDRAIL_AUTOMATED_REASONING_POLICY_CONFIG, 0), + (GUARDRAIL_CROSS_REGION_CONFIG, 0), + (GUARDRAIL_BLOCKED_MESSAGING, 1), + (GUARDRAIL_BLOCKED_MESSAGING, 1), + (KMS_KEY_ID, 0), + (TAG_LIST, 0), + (IDEMPOTENCY_TOKEN, 2), + ), ) -SECURITY_GROUP_ID = Schema( - id=ShapeID("com.amazonaws.bedrock#SecurityGroupId"), shape_type=ShapeType.STRING -) +GUARDRAIL_DRAFT_VERSION: StaticSchema = (3, n0, _GDV, 0) -SECURITY_GROUP_IDS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#SecurityGroupIds"), - shape_type=ShapeType.LIST, - members={"member": {"target": SECURITY_GROUP_ID}}, +CREATE_GUARDRAIL_OUTPUT: StaticSchema = ( + 18, + n0, + _CGO, + {_sSI: _cCGRo, _smith: None}, + (_gIu, _gA, _ve, _cA), + ( + (GUARDRAIL_ID, 1), + (GUARDRAIL_ARN, 1), + (GUARDRAIL_DRAFT_VERSION, 1), + (TIMESTAMP, 1), + ), ) -SUBNET_ID = Schema( - id=ShapeID("com.amazonaws.bedrock#SubnetId"), shape_type=ShapeType.STRING +CREATE_GUARDRAIL: StaticOperationSchema = ( + 23, + n0, + _CG, + {_smithy: MappingProxyType({"code": 202, "method": "POST", "uri": "/guardrails"})}, + CREATE_GUARDRAIL_INPUT, + CREATE_GUARDRAIL_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + TOO_MANY_TAGS_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -SUBNET_IDS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#SubnetIds"), - shape_type=ShapeType.LIST, - members={"member": {"target": SUBNET_ID}}, +CREATE_GUARDRAIL_VERSION_INPUT: StaticSchema = ( + 18, + n0, + _CGVI, + {_sSI: _cCGVR, _smit: None}, + (_gI, _d, _cRT), + ((GUARDRAIL_IDENTIFIER, 9), (GUARDRAIL_DESCRIPTION, 0), (IDEMPOTENCY_TOKEN, 2)), +) + +CREATE_GUARDRAIL_VERSION_OUTPUT: StaticSchema = ( + 18, + n0, + _CGVO, + {_sSI: _cCGVRo, _smith: None}, + (_gIu, _ve), + ((GUARDRAIL_ID, 1), (GUARDRAIL_NUMERICAL_VERSION, 1)), +) + +CREATE_GUARDRAIL_VERSION: StaticOperationSchema = ( + 23, + n0, + _CGV, + { + _smithy: MappingProxyType( + {"code": 202, "method": "POST", "uri": "/guardrails/{guardrailIdentifier}"} + ) + }, + CREATE_GUARDRAIL_VERSION_INPUT, + CREATE_GUARDRAIL_VERSION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -VPC_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#VpcConfig"), - members={ - "subnetIds": { - "target": SUBNET_IDS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "securityGroupIds": { - "target": SECURITY_GROUP_IDS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +DELETE_GUARDRAIL_INPUT: StaticSchema = ( + 18, + n0, + _DGI, + {_sSI: _cDGR, _smit: None}, + (_gI, _gV), + ((GUARDRAIL_IDENTIFIER, 9), (GUARDRAIL_NUMERICAL_VERSION, {_sQ: _gV})), +) + +DELETE_GUARDRAIL_OUTPUT: StaticSchema = (18, n0, _DGO, {_sSI: _cDGRo, _smith: None}) + +DELETE_GUARDRAIL: StaticOperationSchema = ( + 23, + n0, + _DG, + { + _smithy: MappingProxyType( + { + "code": 202, + "method": "DELETE", + "uri": "/guardrails/{guardrailIdentifier}", + } + ) + }, + DELETE_GUARDRAIL_INPUT, + DELETE_GUARDRAIL_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_IN_USE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -SAGE_MAKER_ENDPOINT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#SageMakerEndpoint"), - members={ - "initialInstanceCount": { - "target": INSTANCE_COUNT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "instanceType": { - "target": INSTANCE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "executionRole": { - "target": ROLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "kmsEncryptionKey": {"target": KMS_KEY_ID}, - "vpc": {"target": VPC_CONFIG}, - }, -) +GUARDRAIL_VERSION: StaticSchema = (3, n0, _GV, 0) -ENDPOINT_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#EndpointConfig"), - shape_type=ShapeType.UNION, - members={"sageMaker": {"target": SAGE_MAKER_ENDPOINT}}, +GET_GUARDRAIL_INPUT: StaticSchema = ( + 18, + n0, + _GGI, + {_sSI: _cGGR, _smit: None}, + (_gI, _gV), + ((GUARDRAIL_IDENTIFIER, 9), (GUARDRAIL_VERSION, {_sQ: _gV})), ) -ENDPOINT_NAME = Schema( - id=ShapeID("com.amazonaws.bedrock#EndpointName"), shape_type=ShapeType.STRING +GUARDRAIL_AUTOMATED_REASONING_POLICY: StaticSchema = ( + 18, + n0, + _GARPu, + 0, + (_po, _cTo), + ( + (AUTOMATED_REASONING_POLICY_ARN_LIST, 1), + (AUTOMATED_REASONING_CONFIDENCE_FILTER_THRESHOLD, 0), + ), ) -MODEL_SOURCE_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrock#ModelSourceIdentifier"), - shape_type=ShapeType.STRING, +GUARDRAIL_CONTENT_FILTER: StaticSchema = ( + 18, + n0, + _GCF, + 0, + (_ty, _iS, _oS, _iMn, _oM, _iA, _oAu, _iE, _oE), + ( + (GUARDRAIL_CONTENT_FILTER_TYPE, 1), + (GUARDRAIL_FILTER_STRENGTH, 1), + (GUARDRAIL_FILTER_STRENGTH, 1), + (GUARDRAIL_MODALITIES, 0), + (GUARDRAIL_MODALITIES, 0), + (GUARDRAIL_CONTENT_FILTER_ACTION, 0), + (GUARDRAIL_CONTENT_FILTER_ACTION, 0), + (2, 0), + (2, 0), + ), ) -CREATE_MARKETPLACE_MODEL_ENDPOINT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CreateMarketplaceModelEndpointInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#CreateMarketplaceModelEndpointRequest", - ) - ], - members={ - "modelSourceIdentifier": { - "target": MODEL_SOURCE_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "endpointConfig": { - "target": ENDPOINT_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "acceptEula": { - "target": ACCEPT_EULA, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "endpointName": { - "target": ENDPOINT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientRequestToken": { - "target": IDEMPOTENCY_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "tags": {"target": TAG_LIST}, - }, +GUARDRAIL_CONTENT_FILTERS: StaticSchema = ( + 16, + n0, + _GCFu, + 0, + (_me,), + ((GUARDRAIL_CONTENT_FILTER, 0),), +) + +GUARDRAIL_CONTENT_FILTERS_TIER: StaticSchema = ( + 18, + n0, + _GCFTu, + 0, + (_tNi,), + ((GUARDRAIL_CONTENT_FILTERS_TIER_NAME, 1),), +) + +GUARDRAIL_CONTENT_POLICY: StaticSchema = ( + 18, + n0, + _GCP, + 0, + (_fi, _ti), + ((GUARDRAIL_CONTENT_FILTERS, 0), (GUARDRAIL_CONTENT_FILTERS_TIER, 0)), +) + +GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER: StaticSchema = ( + 18, + n0, + _GCGF, + 0, + (_ty, _th, _ac, _ena), + ( + (GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER_TYPE, 1), + (10, 1), + (GUARDRAIL_CONTEXTUAL_GROUNDING_ACTION, 0), + (2, 0), + ), ) -ARN = Schema(id=ShapeID("com.amazonaws.bedrock#Arn"), shape_type=ShapeType.STRING) - -STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#Status"), - shape_type=ShapeType.ENUM, - members={"REGISTERED": {"target": UNIT}, "INCOMPATIBLE_ENDPOINT": {"target": UNIT}}, -) - -MARKETPLACE_MODEL_ENDPOINT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#MarketplaceModelEndpoint"), - members={ - "endpointArn": { - "target": ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelSourceIdentifier": { - "target": MODEL_SOURCE_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": {"target": STATUS}, - "statusMessage": {"target": STRING}, - "createdAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "endpointConfig": { - "target": ENDPOINT_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "endpointStatus": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "endpointStatusMessage": {"target": STRING}, - }, +GUARDRAIL_CONTEXTUAL_GROUNDING_FILTERS: StaticSchema = ( + 16, + n0, + _GCGFu, + 0, + (_me,), + ((GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER, 0),), ) -CREATE_MARKETPLACE_MODEL_ENDPOINT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CreateMarketplaceModelEndpointOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#CreateMarketplaceModelEndpointResponse", - ) - ], - members={ - "marketplaceModelEndpoint": { - "target": MARKETPLACE_MODEL_ENDPOINT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +GUARDRAIL_CONTEXTUAL_GROUNDING_POLICY: StaticSchema = ( + 18, + n0, + _GCGP, + 0, + (_fi,), + ((GUARDRAIL_CONTEXTUAL_GROUNDING_FILTERS, 1),), ) -CREATE_MARKETPLACE_MODEL_ENDPOINT = Schema( - id=ShapeID("com.amazonaws.bedrock#CreateMarketplaceModelEndpoint"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "POST", "uri": "/marketplace-model/endpoints"} - ), - ) - ], +GUARDRAIL_CROSS_REGION_GUARDRAIL_PROFILE_ARN: StaticSchema = (3, n0, _GCRGPA, 0) + +GUARDRAIL_CROSS_REGION_GUARDRAIL_PROFILE_ID: StaticSchema = (3, n0, _GCRGPIu, 0) + +GUARDRAIL_CROSS_REGION_DETAILS: StaticSchema = ( + 18, + n0, + _GCRD, + 0, + (_gPIu, _gPA), + ( + (GUARDRAIL_CROSS_REGION_GUARDRAIL_PROFILE_ID, 0), + (GUARDRAIL_CROSS_REGION_GUARDRAIL_PROFILE_ARN, 0), + ), ) -DELETE_MARKETPLACE_MODEL_ENDPOINT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#DeleteMarketplaceModelEndpointInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#DeleteMarketplaceModelEndpointRequest", - ) - ], - members={ - "endpointArn": { - "target": ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, +GUARDRAIL_FAILURE_RECOMMENDATION: StaticSchema = (3, n0, _GFRu, 4) + +GUARDRAIL_FAILURE_RECOMMENDATIONS: StaticSchema = ( + 16, + n0, + _GFRua, + 0, + (_me,), + ((GUARDRAIL_FAILURE_RECOMMENDATION, 0),), +) + +GUARDRAIL_PII_ENTITY: StaticSchema = ( + 18, + n0, + _GPE, + 0, + (_ty, _ac, _iA, _oAu, _iE, _oE), + ( + (GUARDRAIL_PII_ENTITY_TYPE, 1), + (GUARDRAIL_SENSITIVE_INFORMATION_ACTION, 1), + (GUARDRAIL_SENSITIVE_INFORMATION_ACTION, 0), + (GUARDRAIL_SENSITIVE_INFORMATION_ACTION, 0), + (2, 0), + (2, 0), + ), ) -DELETE_MARKETPLACE_MODEL_ENDPOINT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#DeleteMarketplaceModelEndpointOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#DeleteMarketplaceModelEndpointResponse", - ) - ], -) - -DELETE_MARKETPLACE_MODEL_ENDPOINT = Schema( - id=ShapeID("com.amazonaws.bedrock#DeleteMarketplaceModelEndpoint"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "DELETE", - "uri": "/marketplace-model/endpoints/{endpointArn}", - } - ), - ) - ], +GUARDRAIL_PII_ENTITIES: StaticSchema = ( + 16, + n0, + _GPEu, + 0, + (_me,), + ((GUARDRAIL_PII_ENTITY, 0),), +) + +GUARDRAIL_REGEX: StaticSchema = ( + 18, + n0, + _GR, + 0, + (_n, _d, _pa, _ac, _iA, _oAu, _iE, _oE), + ( + (3, 1), + (3, 0), + (3, 1), + (GUARDRAIL_SENSITIVE_INFORMATION_ACTION, 1), + (GUARDRAIL_SENSITIVE_INFORMATION_ACTION, 0), + (GUARDRAIL_SENSITIVE_INFORMATION_ACTION, 0), + (2, 0), + (2, 0), + ), ) -DEREGISTER_MARKETPLACE_MODEL_ENDPOINT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#DeregisterMarketplaceModelEndpointInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#DeregisterMarketplaceModelEndpointRequest", - ) - ], - members={ - "endpointArn": { - "target": ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, +GUARDRAIL_REGEXES: StaticSchema = (16, n0, _GRu, 0, (_me,), ((GUARDRAIL_REGEX, 0),)) + +GUARDRAIL_SENSITIVE_INFORMATION_POLICY: StaticSchema = ( + 18, + n0, + _GSIP, + 0, + (_pEi, _re), + ((GUARDRAIL_PII_ENTITIES, 0), (GUARDRAIL_REGEXES, 0)), +) + +GUARDRAIL_STATUS: StaticSchema = ( + 14, + n0, + _GS, + 0, + (_CREATING, _UPDATING, _VERSIONING, _READY, _FAILED, _DELETING), + ( + (-1, {_sV: _CREATING}), + (-1, {_sV: _UPDATING}), + (-1, {_sV: _VERSIONING}), + (-1, {_sV: _READY}), + (-1, {_sV: _FAILED}), + (-1, {_sV: _DELETING}), + ), ) -DEREGISTER_MARKETPLACE_MODEL_ENDPOINT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#DeregisterMarketplaceModelEndpointOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#DeregisterMarketplaceModelEndpointResponse", - ) - ], -) - -SERVICE_UNAVAILABLE_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ServiceUnavailableException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="server"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=503), - ], - members={"message": {"target": NON_BLANK_STRING}}, -) - -DEREGISTER_MARKETPLACE_MODEL_ENDPOINT = Schema( - id=ShapeID("com.amazonaws.bedrock#DeregisterMarketplaceModelEndpoint"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "DELETE", - "uri": "/marketplace-model/endpoints/{endpointArn}/registration", - } - ), - ) - ], +GUARDRAIL_STATUS_REASON: StaticSchema = (3, n0, _GSR, 4) + +GUARDRAIL_STATUS_REASONS: StaticSchema = ( + 16, + n0, + _GSRu, + 0, + (_me,), + ((GUARDRAIL_STATUS_REASON, 0),), +) + +GUARDRAIL_TOPICS_TIER: StaticSchema = ( + 18, + n0, + _GTTu, + 0, + (_tNi,), + ((GUARDRAIL_TOPICS_TIER_NAME, 1),), +) + +GUARDRAIL_TOPIC: StaticSchema = ( + 18, + n0, + _GT, + 0, + (_n, _def, _exa, _ty, _iA, _oAu, _iE, _oE), + ( + (GUARDRAIL_TOPIC_NAME, 1), + (GUARDRAIL_TOPIC_DEFINITION, 1), + (GUARDRAIL_TOPIC_EXAMPLES, 0), + (GUARDRAIL_TOPIC_TYPE, 0), + (GUARDRAIL_TOPIC_ACTION, 0), + (GUARDRAIL_TOPIC_ACTION, 0), + (2, 0), + (2, 0), + ), ) -GET_MARKETPLACE_MODEL_ENDPOINT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetMarketplaceModelEndpointInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetMarketplaceModelEndpointRequest", - ) - ], - members={ - "endpointArn": { - "target": ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, +GUARDRAIL_TOPICS: StaticSchema = (16, n0, _GTu, 0, (_me,), ((GUARDRAIL_TOPIC, 0),)) + +GUARDRAIL_TOPIC_POLICY: StaticSchema = ( + 18, + n0, + _GTP, + 0, + (_to, _ti), + ((GUARDRAIL_TOPICS, 1), (GUARDRAIL_TOPICS_TIER, 0)), +) + +GUARDRAIL_MANAGED_WORDS: StaticSchema = ( + 18, + n0, + _GMW, + 0, + (_ty, _iA, _oAu, _iE, _oE), + ( + (GUARDRAIL_MANAGED_WORDS_TYPE, 1), + (GUARDRAIL_WORD_ACTION, 0), + (GUARDRAIL_WORD_ACTION, 0), + (2, 0), + (2, 0), + ), ) -GET_MARKETPLACE_MODEL_ENDPOINT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetMarketplaceModelEndpointOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetMarketplaceModelEndpointResponse", - ) - ], - members={"marketplaceModelEndpoint": {"target": MARKETPLACE_MODEL_ENDPOINT}}, -) - -GET_MARKETPLACE_MODEL_ENDPOINT = Schema( - id=ShapeID("com.amazonaws.bedrock#GetMarketplaceModelEndpoint"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/marketplace-model/endpoints/{endpointArn}", - } - ), - ) - ], +GUARDRAIL_MANAGED_WORD_LISTS: StaticSchema = ( + 16, + n0, + _GMWL, + 0, + (_me,), + ((GUARDRAIL_MANAGED_WORDS, 0),), +) + +GUARDRAIL_WORD: StaticSchema = ( + 18, + n0, + _GW, + 0, + (_te, _iA, _oAu, _iE, _oE), + ((3, 1), (GUARDRAIL_WORD_ACTION, 0), (GUARDRAIL_WORD_ACTION, 0), (2, 0), (2, 0)), +) + +GUARDRAIL_WORDS: StaticSchema = (16, n0, _GWu, 0, (_me,), ((GUARDRAIL_WORD, 0),)) + +GUARDRAIL_WORD_POLICY: StaticSchema = ( + 18, + n0, + _GWP, + 0, + (_w, _mWL), + ((GUARDRAIL_WORDS, 0), (GUARDRAIL_MANAGED_WORD_LISTS, 0)), +) + +GET_GUARDRAIL_OUTPUT: StaticSchema = ( + 18, + n0, + _GGO, + {_sSI: _cGGRo, _smith: None}, + ( + _n, + _d, + _gIu, + _gA, + _ve, + _st, + _tPo, + _cP, + _wP, + _sIP, + _cGP, + _aRP, + _cRD, + _cA, + _uA, + _sRt, + _fRa, + _bIM, + _bOM, + _kKA, + ), + ( + (GUARDRAIL_NAME, 1), + (GUARDRAIL_DESCRIPTION, 0), + (GUARDRAIL_ID, 1), + (GUARDRAIL_ARN, 1), + (GUARDRAIL_VERSION, 1), + (GUARDRAIL_STATUS, 1), + (GUARDRAIL_TOPIC_POLICY, 0), + (GUARDRAIL_CONTENT_POLICY, 0), + (GUARDRAIL_WORD_POLICY, 0), + (GUARDRAIL_SENSITIVE_INFORMATION_POLICY, 0), + (GUARDRAIL_CONTEXTUAL_GROUNDING_POLICY, 0), + (GUARDRAIL_AUTOMATED_REASONING_POLICY, 0), + (GUARDRAIL_CROSS_REGION_DETAILS, 0), + (TIMESTAMP, 1), + (TIMESTAMP, 1), + (GUARDRAIL_STATUS_REASONS, 0), + (GUARDRAIL_FAILURE_RECOMMENDATIONS, 0), + (GUARDRAIL_BLOCKED_MESSAGING, 1), + (GUARDRAIL_BLOCKED_MESSAGING, 1), + (KMS_KEY_ARN, 0), + ), ) -LIST_MARKETPLACE_MODEL_ENDPOINTS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ListMarketplaceModelEndpointsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#ListMarketplaceModelEndpointsRequest", +GET_GUARDRAIL: StaticOperationSchema = ( + 23, + n0, + _GG, + { + _smithy: MappingProxyType( + {"code": 200, "method": "GET", "uri": "/guardrails/{guardrailIdentifier}"} ) - ], - members={ - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "nextToken": { - "target": PAGINATION_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "modelSourceEquals": { - "target": MODEL_SOURCE_IDENTIFIER, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpQuery"), value="modelSourceIdentifier" - ) - ], - }, }, + GET_GUARDRAIL_INPUT, + GET_GUARDRAIL_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -MARKETPLACE_MODEL_ENDPOINT_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#MarketplaceModelEndpointSummary"), - members={ - "endpointArn": { - "target": ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelSourceIdentifier": { - "target": MODEL_SOURCE_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": {"target": STATUS}, - "statusMessage": {"target": STRING}, - "createdAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +LIST_GUARDRAILS_INPUT: StaticSchema = ( + 18, + n0, + _LGI, + {_sSI: _cLGR, _smit: None}, + (_gI, _mR, _nT), + ( + (GUARDRAIL_IDENTIFIER, {_sQ: _gI}), + (MAX_RESULTS, {_sQ: _mR}), + (PAGINATION_TOKEN, {_sQ: _nT}), + ), ) -MARKETPLACE_MODEL_ENDPOINT_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#MarketplaceModelEndpointSummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": MARKETPLACE_MODEL_ENDPOINT_SUMMARY}}, +GUARDRAIL_SUMMARY: StaticSchema = ( + 18, + n0, + _GSu, + 0, + (_i, _arn, _st, _n, _d, _ve, _cA, _uA, _cRD), + ( + (GUARDRAIL_ID, 1), + (GUARDRAIL_ARN, 1), + (GUARDRAIL_STATUS, 1), + (GUARDRAIL_NAME, 1), + (GUARDRAIL_DESCRIPTION, 0), + (GUARDRAIL_VERSION, 1), + (TIMESTAMP, 1), + (TIMESTAMP, 1), + (GUARDRAIL_CROSS_REGION_DETAILS, 0), + ), ) -LIST_MARKETPLACE_MODEL_ENDPOINTS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ListMarketplaceModelEndpointsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#ListMarketplaceModelEndpointsResponse", - ) - ], - members={ - "marketplaceModelEndpoints": {"target": MARKETPLACE_MODEL_ENDPOINT_SUMMARIES}, - "nextToken": {"target": PAGINATION_TOKEN}, - }, +GUARDRAIL_SUMMARIES: StaticSchema = ( + 16, + n0, + _GSua, + 0, + (_me,), + ((GUARDRAIL_SUMMARY, 0),), +) + +LIST_GUARDRAILS_OUTPUT: StaticSchema = ( + 18, + n0, + _LGO, + {_sSI: _cLGRo, _smith: None}, + (_g, _nT), + ((GUARDRAIL_SUMMARIES, 1), (PAGINATION_TOKEN, 0)), +) + +LIST_GUARDRAILS: StaticOperationSchema = ( + 23, + n0, + _LG, + {_smithy: MappingProxyType({"code": 200, "method": "GET", "uri": "/guardrails"})}, + LIST_GUARDRAILS_INPUT, + LIST_GUARDRAILS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -LIST_MARKETPLACE_MODEL_ENDPOINTS = Schema( - id=ShapeID("com.amazonaws.bedrock#ListMarketplaceModelEndpoints"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "GET", "uri": "/marketplace-model/endpoints"} - ), - ) - ], +UPDATE_GUARDRAIL_INPUT: StaticSchema = ( + 18, + n0, + _UGI, + {_sSI: _cUGR, _smit: None}, + (_gI, _n, _d, _tPC, _cPC, _wPC, _sIPC, _cGPC, _aRPC, _cRC, _bIM, _bOM, _kKI), + ( + (GUARDRAIL_IDENTIFIER, 9), + (GUARDRAIL_NAME, 1), + (GUARDRAIL_DESCRIPTION, 0), + (GUARDRAIL_TOPIC_POLICY_CONFIG, 0), + (GUARDRAIL_CONTENT_POLICY_CONFIG, 0), + (GUARDRAIL_WORD_POLICY_CONFIG, 0), + (GUARDRAIL_SENSITIVE_INFORMATION_POLICY_CONFIG, 0), + (GUARDRAIL_CONTEXTUAL_GROUNDING_POLICY_CONFIG, 0), + (GUARDRAIL_AUTOMATED_REASONING_POLICY_CONFIG, 0), + (GUARDRAIL_CROSS_REGION_CONFIG, 0), + (GUARDRAIL_BLOCKED_MESSAGING, 1), + (GUARDRAIL_BLOCKED_MESSAGING, 1), + (KMS_KEY_ID, 0), + ), ) -REGISTER_MARKETPLACE_MODEL_ENDPOINT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#RegisterMarketplaceModelEndpointInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#RegisterMarketplaceModelEndpointRequest", - ) - ], - members={ - "endpointIdentifier": { - "target": ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "modelSourceIdentifier": { - "target": MODEL_SOURCE_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +UPDATE_GUARDRAIL_OUTPUT: StaticSchema = ( + 18, + n0, + _UGO, + {_sSI: _cUGRo, _smith: None}, + (_gIu, _gA, _ve, _uA), + ( + (GUARDRAIL_ID, 1), + (GUARDRAIL_ARN, 1), + (GUARDRAIL_DRAFT_VERSION, 1), + (TIMESTAMP, 1), + ), ) -REGISTER_MARKETPLACE_MODEL_ENDPOINT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#RegisterMarketplaceModelEndpointOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#RegisterMarketplaceModelEndpointResponse", - ) - ], - members={ - "marketplaceModelEndpoint": { - "target": MARKETPLACE_MODEL_ENDPOINT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +UPDATE_GUARDRAIL: StaticOperationSchema = ( + 23, + n0, + _UG, + { + _smithy: MappingProxyType( + {"code": 202, "method": "PUT", "uri": "/guardrails/{guardrailIdentifier}"} + ) + }, + UPDATE_GUARDRAIL_INPUT, + UPDATE_GUARDRAIL_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -REGISTER_MARKETPLACE_MODEL_ENDPOINT = Schema( - id=ShapeID("com.amazonaws.bedrock#RegisterMarketplaceModelEndpoint"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "POST", - "uri": "/marketplace-model/endpoints/{endpointIdentifier}/registration", - } - ), - ) - ], -) +INFERENCE_PROFILE_DESCRIPTION: StaticSchema = (3, n0, _IPD, 4) -UPDATE_MARKETPLACE_MODEL_ENDPOINT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#UpdateMarketplaceModelEndpointInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#UpdateMarketplaceModelEndpointRequest", - ) - ], - members={ - "endpointArn": { - "target": ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "endpointConfig": { - "target": ENDPOINT_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientRequestToken": { - "target": IDEMPOTENCY_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - }, +INFERENCE_PROFILE_NAME: StaticSchema = (3, n0, _IPN, 0) + +INFERENCE_PROFILE_MODEL_SOURCE_ARN: StaticSchema = (3, n0, _IPMSA, 0) + +INFERENCE_PROFILE_MODEL_SOURCE: StaticSchema = ( + 19, + n0, + _IPMS, + 0, + (_cF,), + ((INFERENCE_PROFILE_MODEL_SOURCE_ARN, 0),), ) -UPDATE_MARKETPLACE_MODEL_ENDPOINT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#UpdateMarketplaceModelEndpointOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#UpdateMarketplaceModelEndpointResponse", - ) - ], - members={ - "marketplaceModelEndpoint": { - "target": MARKETPLACE_MODEL_ENDPOINT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +CREATE_INFERENCE_PROFILE_INPUT: StaticSchema = ( + 18, + n0, + _CIPI, + {_sSI: _cCIPR, _smit: None}, + (_iPN, _d, _cRT, _mSod, _ta), + ( + (INFERENCE_PROFILE_NAME, 1), + (INFERENCE_PROFILE_DESCRIPTION, 0), + (IDEMPOTENCY_TOKEN, 2), + (INFERENCE_PROFILE_MODEL_SOURCE, 1), + (TAG_LIST, 0), + ), ) -UPDATE_MARKETPLACE_MODEL_ENDPOINT = Schema( - id=ShapeID("com.amazonaws.bedrock#UpdateMarketplaceModelEndpoint"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "PATCH", - "uri": "/marketplace-model/endpoints/{endpointArn}", - } - ), - ) - ], +INFERENCE_PROFILE_ARN: StaticSchema = (3, n0, _IPA, 0) + +INFERENCE_PROFILE_STATUS: StaticSchema = ( + 14, + n0, + _IPS, + 0, + (_ACTIVE,), + ((-1, {_sV: _ACTIVE}),), +) + +CREATE_INFERENCE_PROFILE_OUTPUT: StaticSchema = ( + 18, + n0, + _CIPO, + {_sSI: _cCIPRo, _smith: None}, + (_iPA, _st), + ((INFERENCE_PROFILE_ARN, 1), (INFERENCE_PROFILE_STATUS, 0)), +) + +CREATE_INFERENCE_PROFILE: StaticOperationSchema = ( + 23, + n0, + _CIP, + { + _smithy: MappingProxyType( + {"code": 201, "method": "POST", "uri": "/inference-profiles"} + ) + }, + CREATE_INFERENCE_PROFILE_INPUT, + CREATE_INFERENCE_PROFILE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + TOO_MANY_TAGS_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CUSTOM_MODEL_DEPLOYMENT_DESCRIPTION = Schema( - id=ShapeID("com.amazonaws.bedrock#CustomModelDeploymentDescription"), - shape_type=ShapeType.STRING, +INFERENCE_PROFILE_IDENTIFIER: StaticSchema = (3, n0, _IPI, 0) + +DELETE_INFERENCE_PROFILE_INPUT: StaticSchema = ( + 18, + n0, + _DIPI, + {_sSI: _cDIPR, _smit: None}, + (_iPI,), + ((INFERENCE_PROFILE_IDENTIFIER, 9),), +) + +DELETE_INFERENCE_PROFILE_OUTPUT: StaticSchema = ( + 18, + n0, + _DIPO, + {_sSI: _cDIPRo, _smith: None}, +) + +DELETE_INFERENCE_PROFILE: StaticOperationSchema = ( + 23, + n0, + _DIP, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "DELETE", + "uri": "/inference-profiles/{inferenceProfileIdentifier}", + } + ) + }, + DELETE_INFERENCE_PROFILE_INPUT, + DELETE_INFERENCE_PROFILE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CUSTOM_MODEL_ARN = Schema( - id=ShapeID("com.amazonaws.bedrock#CustomModelArn"), shape_type=ShapeType.STRING +GET_INFERENCE_PROFILE_INPUT: StaticSchema = ( + 18, + n0, + _GIPI, + {_sSI: _cGIPR, _smit: None}, + (_iPI,), + ((INFERENCE_PROFILE_IDENTIFIER, 9),), +) + +INFERENCE_PROFILE_ID: StaticSchema = (3, n0, _IPIn, 0) + +INFERENCE_PROFILE_MODEL: StaticSchema = ( + 18, + n0, + _IPM, + 0, + (_mA,), + ((FOUNDATION_MODEL_ARN, 0),), +) + +INFERENCE_PROFILE_MODELS: StaticSchema = ( + 16, + n0, + _IPMn, + 0, + (_me,), + ((INFERENCE_PROFILE_MODEL, 0),), +) + +INFERENCE_PROFILE_TYPE: StaticSchema = ( + 14, + n0, + _IPT, + 0, + (_SD_, _APPLICATION), + ((-1, {_sV: _SD_}), (-1, {_sV: _APPLICATION})), +) + +GET_INFERENCE_PROFILE_OUTPUT: StaticSchema = ( + 18, + n0, + _GIPO, + {_sSI: _cGIPRo, _smith: None}, + (_iPN, _d, _cA, _uA, _iPA, _mod, _iPIn, _st, _ty), + ( + (INFERENCE_PROFILE_NAME, 1), + (INFERENCE_PROFILE_DESCRIPTION, 0), + (TIMESTAMP, 0), + (TIMESTAMP, 0), + (INFERENCE_PROFILE_ARN, 1), + (INFERENCE_PROFILE_MODELS, 1), + (INFERENCE_PROFILE_ID, 1), + (INFERENCE_PROFILE_STATUS, 1), + (INFERENCE_PROFILE_TYPE, 1), + ), ) -MODEL_DEPLOYMENT_NAME = Schema( - id=ShapeID("com.amazonaws.bedrock#ModelDeploymentName"), shape_type=ShapeType.STRING +GET_INFERENCE_PROFILE: StaticOperationSchema = ( + 23, + n0, + _GIP, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "GET", + "uri": "/inference-profiles/{inferenceProfileIdentifier}", + } + ) + }, + GET_INFERENCE_PROFILE_INPUT, + GET_INFERENCE_PROFILE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CREATE_CUSTOM_MODEL_DEPLOYMENT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CreateCustomModelDeploymentInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#CreateCustomModelDeploymentRequest", - ) - ], - members={ - "modelDeploymentName": { - "target": MODEL_DEPLOYMENT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelArn": { - "target": CUSTOM_MODEL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": CUSTOM_MODEL_DEPLOYMENT_DESCRIPTION}, - "tags": {"target": TAG_LIST}, - "clientRequestToken": { - "target": IDEMPOTENCY_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - }, +LIST_INFERENCE_PROFILES_INPUT: StaticSchema = ( + 18, + n0, + _LIPI, + {_sSI: _cLIPR, _smit: None}, + (_mR, _nT, _tE), + ( + (MAX_RESULTS, {_sQ: _mR}), + (PAGINATION_TOKEN, {_sQ: _nT}), + (INFERENCE_PROFILE_TYPE, {_sQ: _ty}), + ), ) -CUSTOM_MODEL_DEPLOYMENT_ARN = Schema( - id=ShapeID("com.amazonaws.bedrock#CustomModelDeploymentArn"), - shape_type=ShapeType.STRING, +INFERENCE_PROFILE_SUMMARY: StaticSchema = ( + 18, + n0, + _IPSn, + 0, + (_iPN, _d, _cA, _uA, _iPA, _mod, _iPIn, _st, _ty), + ( + (INFERENCE_PROFILE_NAME, 1), + (INFERENCE_PROFILE_DESCRIPTION, 0), + (TIMESTAMP, 0), + (TIMESTAMP, 0), + (INFERENCE_PROFILE_ARN, 1), + (INFERENCE_PROFILE_MODELS, 1), + (INFERENCE_PROFILE_ID, 1), + (INFERENCE_PROFILE_STATUS, 1), + (INFERENCE_PROFILE_TYPE, 1), + ), ) -CREATE_CUSTOM_MODEL_DEPLOYMENT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CreateCustomModelDeploymentOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#CreateCustomModelDeploymentResponse", - ) - ], - members={ - "customModelDeploymentArn": { - "target": CUSTOM_MODEL_DEPLOYMENT_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +INFERENCE_PROFILE_SUMMARIES: StaticSchema = ( + 16, + n0, + _IPSnf, + 0, + (_me,), + ((INFERENCE_PROFILE_SUMMARY, 0),), +) + +LIST_INFERENCE_PROFILES_OUTPUT: StaticSchema = ( + 18, + n0, + _LIPO, + {_sSI: _cLIPRo, _smith: None}, + (_iPS, _nT), + ((INFERENCE_PROFILE_SUMMARIES, 0), (PAGINATION_TOKEN, 0)), +) + +LIST_INFERENCE_PROFILES: StaticOperationSchema = ( + 23, + n0, + _LIP, + { + _smithy: MappingProxyType( + {"code": 200, "method": "GET", "uri": "/inference-profiles"} + ) + }, + LIST_INFERENCE_PROFILES_INPUT, + LIST_INFERENCE_PROFILES_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CREATE_CUSTOM_MODEL_DEPLOYMENT = Schema( - id=ShapeID("com.amazonaws.bedrock#CreateCustomModelDeployment"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 202, - "method": "POST", - "uri": "/model-customization/custom-model-deployments", - } - ), - ) - ], +DELETE_MODEL_INVOCATION_LOGGING_CONFIGURATION_INPUT: StaticSchema = ( + 18, + n0, + _DMILCI, + {_sSI: _cDMILCR, _smit: None}, ) -CUSTOM_MODEL_DEPLOYMENT_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrock#CustomModelDeploymentIdentifier"), - shape_type=ShapeType.STRING, +DELETE_MODEL_INVOCATION_LOGGING_CONFIGURATION_OUTPUT: StaticSchema = ( + 18, + n0, + _DMILCO, + {_sSI: _cDMILCRo, _smith: None}, ) -DELETE_CUSTOM_MODEL_DEPLOYMENT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#DeleteCustomModelDeploymentInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#DeleteCustomModelDeploymentRequest", +DELETE_MODEL_INVOCATION_LOGGING_CONFIGURATION: StaticOperationSchema = ( + 23, + n0, + _DMILC, + { + _smithy: MappingProxyType( + {"code": 200, "method": "DELETE", "uri": "/logging/modelinvocations"} ) - ], - members={ - "customModelDeploymentIdentifier": { - "target": CUSTOM_MODEL_DEPLOYMENT_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } }, + DELETE_MODEL_INVOCATION_LOGGING_CONFIGURATION_INPUT, + DELETE_MODEL_INVOCATION_LOGGING_CONFIGURATION_OUTPUT, + (ACCESS_DENIED_EXCEPTION, INTERNAL_SERVER_EXCEPTION, THROTTLING_EXCEPTION), ) -DELETE_CUSTOM_MODEL_DEPLOYMENT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#DeleteCustomModelDeploymentOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#DeleteCustomModelDeploymentResponse", - ) - ], -) - -DELETE_CUSTOM_MODEL_DEPLOYMENT = Schema( - id=ShapeID("com.amazonaws.bedrock#DeleteCustomModelDeployment"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "DELETE", - "uri": "/model-customization/custom-model-deployments/{customModelDeploymentIdentifier}", - } - ), - ) - ], +GET_MODEL_INVOCATION_LOGGING_CONFIGURATION_INPUT: StaticSchema = ( + 18, + n0, + _GMILCI, + {_sSI: _cGMILCR, _smit: None}, ) -GET_CUSTOM_MODEL_DEPLOYMENT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetCustomModelDeploymentInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetCustomModelDeploymentRequest", - ) - ], - members={ - "customModelDeploymentIdentifier": { - "target": CUSTOM_MODEL_DEPLOYMENT_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) +BUCKET_NAME: StaticSchema = (3, n0, _BN, 0) -CUSTOM_MODEL_DEPLOYMENT_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CustomModelDeploymentStatus"), - shape_type=ShapeType.ENUM, - members={ - "CREATING": {"target": UNIT}, - "ACTIVE": {"target": UNIT}, - "FAILED": {"target": UNIT}, - }, +KEY_PREFIX: StaticSchema = (3, n0, _KP, 0) + +S3_CONFIG: StaticSchema = ( + 18, + n0, + _SCo, + 0, + (_bN, _kP), + ((BUCKET_NAME, 1), (KEY_PREFIX, 0)), ) -MODEL_ARN = Schema( - id=ShapeID("com.amazonaws.bedrock#ModelArn"), shape_type=ShapeType.STRING +LOG_GROUP_NAME: StaticSchema = (3, n0, _LGN, 0) + +CLOUD_WATCH_CONFIG: StaticSchema = ( + 18, + n0, + _CWC, + 0, + (_lGN, _rA, _lDDSC), + ((LOG_GROUP_NAME, 1), (ROLE_ARN, 1), (S3_CONFIG, 0)), ) -CUSTOM_MODEL_DEPLOYMENT_UPDATE_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CustomModelDeploymentUpdateStatus"), - shape_type=ShapeType.ENUM, - members={ - "UPDATING": {"target": UNIT}, - "UPDATE_COMPLETED": {"target": UNIT}, - "UPDATE_FAILED": {"target": UNIT}, - }, +LOGGING_CONFIG: StaticSchema = ( + 18, + n0, + _LC, + 0, + (_cWC, _sCo, _tDDE, _iDDE, _eDDE, _vDDE, _aDDE), + ((CLOUD_WATCH_CONFIG, 0), (S3_CONFIG, 0), (2, 0), (2, 0), (2, 0), (2, 0), (2, 0)), ) -CUSTOM_MODEL_DEPLOYMENT_UPDATE_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CustomModelDeploymentUpdateDetails"), - members={ - "modelArn": { - "target": MODEL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updateStatus": { - "target": CUSTOM_MODEL_DEPLOYMENT_UPDATE_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +GET_MODEL_INVOCATION_LOGGING_CONFIGURATION_OUTPUT: StaticSchema = ( + 18, + n0, + _GMILCO, + {_sSI: _cGMILCRo, _smith: None}, + (_lC,), + ((LOGGING_CONFIG, 0),), ) -GET_CUSTOM_MODEL_DEPLOYMENT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetCustomModelDeploymentOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetCustomModelDeploymentResponse", +GET_MODEL_INVOCATION_LOGGING_CONFIGURATION: StaticOperationSchema = ( + 23, + n0, + _GMILC, + { + _smithy: MappingProxyType( + {"code": 200, "method": "GET", "uri": "/logging/modelinvocations"} ) - ], - members={ - "customModelDeploymentArn": { - "target": CUSTOM_MODEL_DEPLOYMENT_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelDeploymentName": { - "target": MODEL_DEPLOYMENT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelArn": { - "target": CUSTOM_MODEL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": CUSTOM_MODEL_DEPLOYMENT_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": CUSTOM_MODEL_DEPLOYMENT_DESCRIPTION}, - "updateDetails": {"target": CUSTOM_MODEL_DEPLOYMENT_UPDATE_DETAILS}, - "failureMessage": {"target": ERROR_MESSAGE}, - "lastUpdatedAt": {"target": TIMESTAMP}, }, + GET_MODEL_INVOCATION_LOGGING_CONFIGURATION_INPUT, + GET_MODEL_INVOCATION_LOGGING_CONFIGURATION_OUTPUT, + (ACCESS_DENIED_EXCEPTION, INTERNAL_SERVER_EXCEPTION, THROTTLING_EXCEPTION), ) -GET_CUSTOM_MODEL_DEPLOYMENT = Schema( - id=ShapeID("com.amazonaws.bedrock#GetCustomModelDeployment"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/model-customization/custom-model-deployments/{customModelDeploymentIdentifier}", - } - ), - ) - ], +PUT_MODEL_INVOCATION_LOGGING_CONFIGURATION_INPUT: StaticSchema = ( + 18, + n0, + _PMILCI, + {_sSI: _cPMILCR, _smit: None}, + (_lC,), + ((LOGGING_CONFIG, 1),), ) -SORT_MODELS_BY = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#SortModelsBy"), - shape_type=ShapeType.ENUM, - members={"CREATION_TIME": {"target": UNIT}}, +PUT_MODEL_INVOCATION_LOGGING_CONFIGURATION_OUTPUT: StaticSchema = ( + 18, + n0, + _PMILCO, + {_sSI: _cPMILCRo, _smith: None}, ) -LIST_CUSTOM_MODEL_DEPLOYMENTS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ListCustomModelDeploymentsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#ListCustomModelDeploymentsRequest", +PUT_MODEL_INVOCATION_LOGGING_CONFIGURATION: StaticOperationSchema = ( + 23, + n0, + _PMILC, + { + _smithy: MappingProxyType( + {"code": 200, "method": "PUT", "uri": "/logging/modelinvocations"} ) - ], - members={ - "createdBefore": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="createdBefore") - ], - }, - "createdAfter": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="createdAfter") - ], - }, - "nameContains": { - "target": MODEL_DEPLOYMENT_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nameContains") - ], - }, - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "nextToken": { - "target": PAGINATION_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "sortBy": { - "target": SORT_MODELS_BY, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="sortBy")], - }, - "sortOrder": { - "target": SORT_ORDER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="sortOrder") - ], - }, - "statusEquals": { - "target": CUSTOM_MODEL_DEPLOYMENT_STATUS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="statusEquals") - ], - }, - "modelArnEquals": { - "target": CUSTOM_MODEL_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="modelArnEquals") - ], - }, }, + PUT_MODEL_INVOCATION_LOGGING_CONFIGURATION_INPUT, + PUT_MODEL_INVOCATION_LOGGING_CONFIGURATION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CUSTOM_MODEL_DEPLOYMENT_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CustomModelDeploymentSummary"), - members={ - "customModelDeploymentArn": { - "target": CUSTOM_MODEL_DEPLOYMENT_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "customModelDeploymentName": { - "target": MODEL_DEPLOYMENT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelArn": { - "target": MODEL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": CUSTOM_MODEL_DEPLOYMENT_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastUpdatedAt": {"target": TIMESTAMP}, - "failureMessage": {"target": ERROR_MESSAGE}, - }, +CREATE_MODEL_COPY_JOB_INPUT: StaticSchema = ( + 18, + n0, + _CMCJI, + {_sSI: _cCMCJR, _smit: None}, + (_sMA, _tMN, _mKKI, _tMT, _cRT), + ( + (MODEL_ARN, 1), + (CUSTOM_MODEL_NAME, 1), + (KMS_KEY_ID, 0), + (TAG_LIST, 0), + (IDEMPOTENCY_TOKEN, 2), + ), ) -CUSTOM_MODEL_DEPLOYMENT_SUMMARY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CustomModelDeploymentSummaryList"), - shape_type=ShapeType.LIST, - members={"member": {"target": CUSTOM_MODEL_DEPLOYMENT_SUMMARY}}, -) +MODEL_COPY_JOB_ARN: StaticSchema = (3, n0, _MCJAo, 0) -LIST_CUSTOM_MODEL_DEPLOYMENTS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ListCustomModelDeploymentsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#ListCustomModelDeploymentsResponse", - ) - ], - members={ - "nextToken": {"target": PAGINATION_TOKEN}, - "modelDeploymentSummaries": {"target": CUSTOM_MODEL_DEPLOYMENT_SUMMARY_LIST}, - }, +CREATE_MODEL_COPY_JOB_OUTPUT: StaticSchema = ( + 18, + n0, + _CMCJO, + {_sSI: _cCMCJRo, _smith: None}, + (_jA,), + ((MODEL_COPY_JOB_ARN, 1),), ) -LIST_CUSTOM_MODEL_DEPLOYMENTS = Schema( - id=ShapeID("com.amazonaws.bedrock#ListCustomModelDeployments"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/model-customization/custom-model-deployments", - } - ), +CREATE_MODEL_COPY_JOB: StaticOperationSchema = ( + 23, + n0, + _CMCJ, + { + _smithy: MappingProxyType( + {"code": 201, "method": "POST", "uri": "/model-copy-jobs"} ) - ], + }, + CREATE_MODEL_COPY_JOB_INPUT, + CREATE_MODEL_COPY_JOB_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + TOO_MANY_TAGS_EXCEPTION, + ), ) -UPDATE_CUSTOM_MODEL_DEPLOYMENT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#UpdateCustomModelDeploymentInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#UpdateCustomModelDeploymentRequest", - ) - ], - members={ - "modelArn": { - "target": CUSTOM_MODEL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "customModelDeploymentIdentifier": { - "target": CUSTOM_MODEL_DEPLOYMENT_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, +GET_MODEL_COPY_JOB_INPUT: StaticSchema = ( + 18, + n0, + _GMCJI, + {_sSI: _cGMCJR, _smit: None}, + (_jA,), + ((MODEL_COPY_JOB_ARN, 9),), +) + +MODEL_COPY_JOB_STATUS: StaticSchema = ( + 14, + n0, + _MCJS, + 0, + (_IP, _COMPLETED, _FAILED), + ((-1, {_sV: _IPn}), (-1, {_sV: _C}), (-1, {_sV: _F})), +) + +GET_MODEL_COPY_JOB_OUTPUT: StaticSchema = ( + 18, + n0, + _GMCJO, + {_sSI: _cGMCJRo, _smith: None}, + (_jA, _st, _cTr, _tMA, _tMN, _sAI, _sMA, _tMKKA, _tMT, _fM, _sMN), + ( + (MODEL_COPY_JOB_ARN, 1), + (MODEL_COPY_JOB_STATUS, 1), + (TIMESTAMP, 1), + (CUSTOM_MODEL_ARN, 1), + (CUSTOM_MODEL_NAME, 0), + (ACCOUNT_ID, 1), + (MODEL_ARN, 1), + (KMS_KEY_ARN, 0), + (TAG_LIST, 0), + (ERROR_MESSAGE, 0), + (CUSTOM_MODEL_NAME, 0), + ), ) -UPDATE_CUSTOM_MODEL_DEPLOYMENT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#UpdateCustomModelDeploymentOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#UpdateCustomModelDeploymentResponse", +GET_MODEL_COPY_JOB: StaticOperationSchema = ( + 23, + n0, + _GMCJ, + { + _smithy: MappingProxyType( + {"code": 200, "method": "GET", "uri": "/model-copy-jobs/{jobArn}"} ) - ], - members={ - "customModelDeploymentArn": { - "target": CUSTOM_MODEL_DEPLOYMENT_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } }, + GET_MODEL_COPY_JOB_INPUT, + GET_MODEL_COPY_JOB_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -UPDATE_CUSTOM_MODEL_DEPLOYMENT = Schema( - id=ShapeID("com.amazonaws.bedrock#UpdateCustomModelDeployment"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 202, - "method": "PATCH", - "uri": "/model-customization/custom-model-deployments/{customModelDeploymentIdentifier}", - } - ), - ) - ], +LIST_MODEL_COPY_JOBS_INPUT: StaticSchema = ( + 18, + n0, + _LMCJI, + {_sSI: _cLMCJR, _smit: None}, + (_cTA, _cTB, _sEt, _sAE, _sMAE, _tMNC, _mR, _nT, _sB, _sO), + ( + (TIMESTAMP, {_sQ: _cTA}), + (TIMESTAMP, {_sQ: _cTB}), + (MODEL_COPY_JOB_STATUS, {_sQ: _sEt}), + (ACCOUNT_ID, {_sQ: _sAE}), + (MODEL_ARN, {_sQ: _sMAE}), + (CUSTOM_MODEL_NAME, {_sQ: _oMNC}), + (MAX_RESULTS, {_sQ: _mR}), + (PAGINATION_TOKEN, {_sQ: _nT}), + (SORT_JOBS_BY, {_sQ: _sB}), + (SORT_ORDER, {_sQ: _sO}), + ), ) -MODEL_PACKAGE_ARN = Schema( - id=ShapeID("com.amazonaws.bedrock#ModelPackageArn"), shape_type=ShapeType.STRING +MODEL_COPY_JOB_SUMMARY: StaticSchema = ( + 18, + n0, + _MCJSo, + 0, + (_jA, _st, _cTr, _tMA, _tMN, _sAI, _sMA, _tMKKA, _tMT, _fM, _sMN), + ( + (MODEL_COPY_JOB_ARN, 1), + (MODEL_COPY_JOB_STATUS, 1), + (TIMESTAMP, 1), + (CUSTOM_MODEL_ARN, 1), + (CUSTOM_MODEL_NAME, 0), + (ACCOUNT_ID, 1), + (MODEL_ARN, 1), + (KMS_KEY_ARN, 0), + (TAG_LIST, 0), + (ERROR_MESSAGE, 0), + (CUSTOM_MODEL_NAME, 0), + ), ) -MODEL_PACKAGE_ARN_DATA_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ModelPackageArnDataSource"), - members={ - "modelPackageArn": { - "target": MODEL_PACKAGE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +MODEL_COPY_JOB_SUMMARIES: StaticSchema = ( + 16, + n0, + _MCJSod, + 0, + (_me,), + ((MODEL_COPY_JOB_SUMMARY, 0),), +) + +LIST_MODEL_COPY_JOBS_OUTPUT: StaticSchema = ( + 18, + n0, + _LMCJO, + {_sSI: _cLMCJRo, _smith: None}, + (_nT, _mCJS), + ((PAGINATION_TOKEN, 0), (MODEL_COPY_JOB_SUMMARIES, 0)), +) + +LIST_MODEL_COPY_JOBS: StaticOperationSchema = ( + 23, + n0, + _LMCJ, + { + _smithy: MappingProxyType( + {"code": 200, "method": "GET", "uri": "/model-copy-jobs"} + ) + }, + LIST_MODEL_COPY_JOBS_INPUT, + LIST_MODEL_COPY_JOBS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CUSTOM_MODEL_DATA_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CustomModelDataSource"), - shape_type=ShapeType.UNION, - members={"modelPackageArnDataSource": {"target": MODEL_PACKAGE_ARN_DATA_SOURCE}}, +IMPORTED_MODEL_NAME: StaticSchema = (3, n0, _IMN, 0) + +CREATE_MODEL_IMPORT_JOB_INPUT: StaticSchema = ( + 18, + n0, + _CMIJI, + {_sSI: _cCMIJR, _smit: None}, + (_jN, _iMN, _rA, _mDSo, _jTo, _iMTm, _cRT, _vCp, _iMKKI), + ( + (JOB_NAME, 1), + (IMPORTED_MODEL_NAME, 1), + (ROLE_ARN, 1), + (MODEL_DATA_SOURCE, 1), + (TAG_LIST, 0), + (TAG_LIST, 0), + (IDEMPOTENCY_TOKEN, 0), + (VPC_CONFIG, 0), + (KMS_KEY_ID, 0), + ), ) -CUSTOM_MODEL_NAME = Schema( - id=ShapeID("com.amazonaws.bedrock#CustomModelName"), shape_type=ShapeType.STRING +MODEL_IMPORT_JOB_ARN: StaticSchema = (3, n0, _MIJA, 0) + +CREATE_MODEL_IMPORT_JOB_OUTPUT: StaticSchema = ( + 18, + n0, + _CMIJO, + {_sSI: _cCMIJRo, _smith: None}, + (_jA,), + ((MODEL_IMPORT_JOB_ARN, 1),), +) + +CREATE_MODEL_IMPORT_JOB: StaticOperationSchema = ( + 23, + n0, + _CMIJ, + { + _smithy: MappingProxyType( + {"code": 201, "method": "POST", "uri": "/model-import-jobs"} + ) + }, + CREATE_MODEL_IMPORT_JOB_INPUT, + CREATE_MODEL_IMPORT_JOB_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + TOO_MANY_TAGS_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -S3_DATA_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#S3DataSource"), - members={ - "s3Uri": { - "target": S3_URI, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +IMPORTED_MODEL_IDENTIFIER: StaticSchema = (3, n0, _IMIm, 0) + +DELETE_IMPORTED_MODEL_INPUT: StaticSchema = ( + 18, + n0, + _DIMI, + {_sSI: _cDIMR, _smit: None}, + (_mIo,), + ((IMPORTED_MODEL_IDENTIFIER, 9),), +) + +DELETE_IMPORTED_MODEL_OUTPUT: StaticSchema = ( + 18, + n0, + _DIMO, + {_sSI: _cDIMRo, _smith: None}, +) + +DELETE_IMPORTED_MODEL: StaticOperationSchema = ( + 23, + n0, + _DIM, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "DELETE", + "uri": "/imported-models/{modelIdentifier}", + } + ) + }, + DELETE_IMPORTED_MODEL_INPUT, + DELETE_IMPORTED_MODEL_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -MODEL_DATA_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ModelDataSource"), - shape_type=ShapeType.UNION, - members={"s3DataSource": {"target": S3_DATA_SOURCE}}, +GET_IMPORTED_MODEL_INPUT: StaticSchema = ( + 18, + n0, + _GIMI, + {_sSI: _cGIMR, _smit: None}, + (_mIo,), + ((IMPORTED_MODEL_IDENTIFIER, 9),), +) + +CUSTOM_MODEL_UNITS_VERSION: StaticSchema = (3, n0, _CMUV, 0) + +CUSTOM_MODEL_UNITS: StaticSchema = ( + 18, + n0, + _CMU, + 0, + (_cMUPMC, _cMUV), + ((7, 0), (CUSTOM_MODEL_UNITS_VERSION, 0)), +) + +INSTRUCT_SUPPORTED: StaticSchema = (2, n0, _IS, 0) + +IMPORTED_MODEL_ARN: StaticSchema = (3, n0, _IMA, 0) + +GET_IMPORTED_MODEL_OUTPUT: StaticSchema = ( + 18, + n0, + _GIMO, + {_sSI: _cGIMRo, _smith: None}, + (_mA, _mN, _jN, _jA, _mDSo, _cTr, _mAo, _mKKA, _iSn, _cMU), + ( + (IMPORTED_MODEL_ARN, 0), + (IMPORTED_MODEL_NAME, 0), + (JOB_NAME, 0), + (MODEL_IMPORT_JOB_ARN, 0), + (MODEL_DATA_SOURCE, 0), + (TIMESTAMP, 0), + (3, 0), + (KMS_KEY_ARN, 0), + (INSTRUCT_SUPPORTED, 0), + (CUSTOM_MODEL_UNITS, 0), + ), ) -CREATE_CUSTOM_MODEL_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CreateCustomModelInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#CreateCustomModelRequest", +GET_IMPORTED_MODEL: StaticOperationSchema = ( + 23, + n0, + _GIM, + { + _smithy: MappingProxyType( + {"code": 200, "method": "GET", "uri": "/imported-models/{modelIdentifier}"} ) - ], - members={ - "modelName": { - "target": CUSTOM_MODEL_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelSourceConfig": {"target": MODEL_DATA_SOURCE}, - "customModelDataSource": {"target": CUSTOM_MODEL_DATA_SOURCE}, - "modelKmsKeyArn": {"target": KMS_KEY_ARN}, - "roleArn": {"target": ROLE_ARN}, - "modelTags": {"target": TAG_LIST}, - "clientRequestToken": { - "target": IDEMPOTENCY_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, }, + GET_IMPORTED_MODEL_INPUT, + GET_IMPORTED_MODEL_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), +) + +MODEL_IMPORT_JOB_IDENTIFIER: StaticSchema = (3, n0, _MIJI, 0) + +GET_MODEL_IMPORT_JOB_INPUT: StaticSchema = ( + 18, + n0, + _GMIJI, + {_sSI: _cGMIJR, _smit: None}, + (_jIo,), + ((MODEL_IMPORT_JOB_IDENTIFIER, 9),), +) + +MODEL_IMPORT_JOB_STATUS: StaticSchema = ( + 14, + n0, + _MIJS, + 0, + (_IP, _COMPLETED, _FAILED), + ((-1, {_sV: _IPn}), (-1, {_sV: _C}), (-1, {_sV: _F})), +) + +GET_MODEL_IMPORT_JOB_OUTPUT: StaticSchema = ( + 18, + n0, + _GMIJO, + {_sSI: _cGMIJRo, _smith: None}, + (_jA, _jN, _iMN, _iMA, _rA, _mDSo, _st, _fM, _cTr, _lMT, _eT, _vCp, _iMKKA), + ( + (MODEL_IMPORT_JOB_ARN, 0), + (JOB_NAME, 0), + (IMPORTED_MODEL_NAME, 0), + (IMPORTED_MODEL_ARN, 0), + (ROLE_ARN, 0), + (MODEL_DATA_SOURCE, 0), + (MODEL_IMPORT_JOB_STATUS, 0), + (ERROR_MESSAGE, 0), + (TIMESTAMP, 0), + (TIMESTAMP, 0), + (TIMESTAMP, 0), + (VPC_CONFIG, 0), + (KMS_KEY_ARN, 0), + ), ) -CREATE_CUSTOM_MODEL_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CreateCustomModelOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#CreateCustomModelResponse", +GET_MODEL_IMPORT_JOB: StaticOperationSchema = ( + 23, + n0, + _GMIJ, + { + _smithy: MappingProxyType( + {"code": 200, "method": "GET", "uri": "/model-import-jobs/{jobIdentifier}"} ) - ], - members={ - "modelArn": { - "target": MODEL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } }, + GET_MODEL_IMPORT_JOB_INPUT, + GET_MODEL_IMPORT_JOB_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CREATE_CUSTOM_MODEL = Schema( - id=ShapeID("com.amazonaws.bedrock#CreateCustomModel"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 202, - "method": "POST", - "uri": "/custom-models/create-custom-model", - } - ), - ) - ], +LIST_IMPORTED_MODELS_INPUT: StaticSchema = ( + 18, + n0, + _LIMI, + {_sSI: _cLIMR, _smit: None}, + (_cTB, _cTA, _nC, _mR, _nT, _sB, _sO), + ( + (TIMESTAMP, {_sQ: _cTB}), + (TIMESTAMP, {_sQ: _cTA}), + (IMPORTED_MODEL_NAME, {_sQ: _nC}), + (MAX_RESULTS, {_sQ: _mR}), + (PAGINATION_TOKEN, {_sQ: _nT}), + (SORT_MODELS_BY, {_sQ: _sB}), + (SORT_ORDER, {_sQ: _sO}), + ), ) -MODEL_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrock#ModelIdentifier"), shape_type=ShapeType.STRING +MODEL_ARCHITECTURE: StaticSchema = (3, n0, _MAo, 0) + +IMPORTED_MODEL_SUMMARY: StaticSchema = ( + 18, + n0, + _IMS, + 0, + (_mA, _mN, _cTr, _iSn, _mAo), + ( + (IMPORTED_MODEL_ARN, 1), + (IMPORTED_MODEL_NAME, 1), + (TIMESTAMP, 1), + (INSTRUCT_SUPPORTED, 0), + (MODEL_ARCHITECTURE, 0), + ), ) -DELETE_CUSTOM_MODEL_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#DeleteCustomModelInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#DeleteCustomModelRequest", - ) - ], - members={ - "modelIdentifier": { - "target": MODEL_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, +IMPORTED_MODEL_SUMMARY_LIST: StaticSchema = ( + 16, + n0, + _IMSL, + 0, + (_me,), + ((IMPORTED_MODEL_SUMMARY, 0),), +) + +LIST_IMPORTED_MODELS_OUTPUT: StaticSchema = ( + 18, + n0, + _LIMO, + {_sSI: _cLIMRo, _smith: None}, + (_nT, _mSo), + ((PAGINATION_TOKEN, 0), (IMPORTED_MODEL_SUMMARY_LIST, 0)), +) + +LIST_IMPORTED_MODELS: StaticOperationSchema = ( + 23, + n0, + _LIM, + { + _smithy: MappingProxyType( + {"code": 200, "method": "GET", "uri": "/imported-models"} + ) + }, + LIST_IMPORTED_MODELS_INPUT, + LIST_IMPORTED_MODELS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -DELETE_CUSTOM_MODEL_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#DeleteCustomModelOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#DeleteCustomModelResponse", - ) - ], -) - -DELETE_CUSTOM_MODEL = Schema( - id=ShapeID("com.amazonaws.bedrock#DeleteCustomModel"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "DELETE", - "uri": "/custom-models/{modelIdentifier}", - } - ), - ) - ], +LIST_MODEL_IMPORT_JOBS_INPUT: StaticSchema = ( + 18, + n0, + _LMIJI, + {_sSI: _cLMIJR, _smit: None}, + (_cTA, _cTB, _sEt, _nC, _mR, _nT, _sB, _sO), + ( + (TIMESTAMP, {_sQ: _cTA}), + (TIMESTAMP, {_sQ: _cTB}), + (MODEL_IMPORT_JOB_STATUS, {_sQ: _sEt}), + (JOB_NAME, {_sQ: _nC}), + (MAX_RESULTS, {_sQ: _mR}), + (PAGINATION_TOKEN, {_sQ: _nT}), + (SORT_JOBS_BY, {_sQ: _sB}), + (SORT_ORDER, {_sQ: _sO}), + ), ) -GET_CUSTOM_MODEL_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetCustomModelInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetCustomModelRequest", - ) - ], - members={ - "modelIdentifier": { - "target": MODEL_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, +MODEL_IMPORT_JOB_SUMMARY: StaticSchema = ( + 18, + n0, + _MIJSo, + 0, + (_jA, _jN, _st, _lMT, _cTr, _eT, _iMA, _iMN), + ( + (MODEL_IMPORT_JOB_ARN, 1), + (JOB_NAME, 1), + (MODEL_IMPORT_JOB_STATUS, 1), + (TIMESTAMP, 0), + (TIMESTAMP, 1), + (TIMESTAMP, 0), + (IMPORTED_MODEL_ARN, 0), + (IMPORTED_MODEL_NAME, 0), + ), ) -TEACHER_MODEL_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrock#TeacherModelIdentifier"), - shape_type=ShapeType.STRING, +MODEL_IMPORT_JOB_SUMMARIES: StaticSchema = ( + 16, + n0, + _MIJSod, + 0, + (_me,), + ((MODEL_IMPORT_JOB_SUMMARY, 0),), +) + +LIST_MODEL_IMPORT_JOBS_OUTPUT: StaticSchema = ( + 18, + n0, + _LMIJO, + {_sSI: _cLMIJRo, _smith: None}, + (_nT, _mIJS), + ((PAGINATION_TOKEN, 0), (MODEL_IMPORT_JOB_SUMMARIES, 0)), +) + +LIST_MODEL_IMPORT_JOBS: StaticOperationSchema = ( + 23, + n0, + _LMIJ, + { + _smithy: MappingProxyType( + {"code": 200, "method": "GET", "uri": "/model-import-jobs"} + ) + }, + LIST_MODEL_IMPORT_JOBS_INPUT, + LIST_MODEL_IMPORT_JOBS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -TEACHER_MODEL_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#TeacherModelConfig"), - members={ - "teacherModelIdentifier": { - "target": TEACHER_MODEL_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "maxResponseLengthForInference": {"target": INTEGER}, - }, +MODEL_INVOCATION_IDEMPOTENCY_TOKEN: StaticSchema = (3, n0, _MIIT, 0) + +S3_INPUT_FORMAT: StaticSchema = (14, n0, _SIF, 0, (_JSONL,), ((-1, {_sV: _JSONL}),)) + +MODEL_INVOCATION_JOB_S3_INPUT_DATA_CONFIG: StaticSchema = ( + 18, + n0, + _MIJSIDC, + 0, + (_sIF, _sU, _sBO), + ((S3_INPUT_FORMAT, 0), (S3_URI, 1), (ACCOUNT_ID, 0)), +) + +MODEL_INVOCATION_JOB_INPUT_DATA_CONFIG: StaticSchema = ( + 19, + n0, + _MIJIDC, + 0, + (_sIDC,), + ((MODEL_INVOCATION_JOB_S3_INPUT_DATA_CONFIG, 0),), +) + +MODEL_INVOCATION_JOB_NAME: StaticSchema = (3, n0, _MIJN, 0) + +MODEL_ID: StaticSchema = (3, n0, _MIo, 0) + +MODEL_INVOCATION_TYPE: StaticSchema = ( + 14, + n0, + _MIT, + 0, + (_IM, _Co), + ((-1, {_sV: _IM}), (-1, {_sV: _Co})), +) + +MODEL_INVOCATION_JOB_S3_OUTPUT_DATA_CONFIG: StaticSchema = ( + 18, + n0, + _MIJSODC, + 0, + (_sU, _sEKI, _sBO), + ((S3_URI, 1), (KMS_KEY_ID, 0), (ACCOUNT_ID, 0)), +) + +MODEL_INVOCATION_JOB_OUTPUT_DATA_CONFIG: StaticSchema = ( + 19, + n0, + _MIJODC, + 0, + (_sODC,), + ((MODEL_INVOCATION_JOB_S3_OUTPUT_DATA_CONFIG, 0),), +) + +MODEL_INVOCATION_JOB_TIMEOUT_DURATION_IN_HOURS: StaticSchema = (7, n0, _MIJTDIH, 0) + +CREATE_MODEL_INVOCATION_JOB_INPUT: StaticSchema = ( + 18, + n0, + _CMIJIr, + {_sSI: _cCMIJRom, _smit: None}, + (_jN, _rA, _cRT, _mI, _iDC, _oDC, _vCp, _tDIH, _ta, _mIT), + ( + (MODEL_INVOCATION_JOB_NAME, 1), + (ROLE_ARN, 1), + (MODEL_INVOCATION_IDEMPOTENCY_TOKEN, 2), + (MODEL_ID, 1), + (MODEL_INVOCATION_JOB_INPUT_DATA_CONFIG, 1), + (MODEL_INVOCATION_JOB_OUTPUT_DATA_CONFIG, 1), + (VPC_CONFIG, 0), + (MODEL_INVOCATION_JOB_TIMEOUT_DURATION_IN_HOURS, 0), + (TAG_LIST, 0), + (MODEL_INVOCATION_TYPE, {_s: _IM}), + ), ) -DISTILLATION_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#DistillationConfig"), - members={ - "teacherModelConfig": { - "target": TEACHER_MODEL_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +MODEL_INVOCATION_JOB_ARN: StaticSchema = (3, n0, _MIJAo, 0) + +CREATE_MODEL_INVOCATION_JOB_OUTPUT: StaticSchema = ( + 18, + n0, + _CMIJOr, + {_sSI: _cCMIJRoma, _smith: None}, + (_jA,), + ((MODEL_INVOCATION_JOB_ARN, 1),), +) + +CREATE_MODEL_INVOCATION_JOB: StaticOperationSchema = ( + 23, + n0, + _CMIJr, + { + _smithy: MappingProxyType( + {"code": 200, "method": "POST", "uri": "/model-invocation-job"} + ) + }, + CREATE_MODEL_INVOCATION_JOB_INPUT, + CREATE_MODEL_INVOCATION_JOB_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -LAMBDA_ARN = Schema( - id=ShapeID("com.amazonaws.bedrock#LambdaArn"), shape_type=ShapeType.STRING +MODEL_INVOCATION_JOB_IDENTIFIER: StaticSchema = (3, n0, _MIJIo, 0) + +GET_MODEL_INVOCATION_JOB_INPUT: StaticSchema = ( + 18, + n0, + _GMIJIe, + {_sSI: _cGMIJRom, _smit: None}, + (_jIo,), + ((MODEL_INVOCATION_JOB_IDENTIFIER, 9),), +) + +NON_NEGATIVE_LONG: StaticSchema = (8, n0, _NNL, 0) + +MESSAGE: StaticSchema = (3, n0, _M, 4) + +MODEL_INVOCATION_JOB_STATUS: StaticSchema = ( + 14, + n0, + _MIJSode, + 0, + ( + _SUBMITTED, + _IP, + _COMPLETED, + _FAILED, + _STOPPING, + _STOPPED, + _PC, + _EXPIRED, + _VALIDATING, + _SCHEDULED, + ), + ( + (-1, {_sV: _Sub}), + (-1, {_sV: _IPn}), + (-1, {_sV: _C}), + (-1, {_sV: _F}), + (-1, {_sV: _S}), + (-1, {_sV: _St}), + (-1, {_sV: _PCa}), + (-1, {_sV: _E}), + (-1, {_sV: _Val}), + (-1, {_sV: _Sc}), + ), ) -LAMBDA_GRADER_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#LambdaGraderConfig"), - members={ - "lambdaArn": { - "target": LAMBDA_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +GET_MODEL_INVOCATION_JOB_OUTPUT: StaticSchema = ( + 18, + n0, + _GMIJOe, + {_sSI: _cGMIJRoma, _smith: None}, + ( + _jA, + _jN, + _mI, + _cRT, + _rA, + _st, + _m, + _sTu, + _lMT, + _eT, + _iDC, + _oDC, + _vCp, + _tDIH, + _jET, + _mIT, + _tRC, + _pRC, + _sRC, + _eRC, + ), + ( + (MODEL_INVOCATION_JOB_ARN, 1), + (MODEL_INVOCATION_JOB_NAME, 0), + (MODEL_ID, 1), + (MODEL_INVOCATION_IDEMPOTENCY_TOKEN, 0), + (ROLE_ARN, 1), + (MODEL_INVOCATION_JOB_STATUS, 0), + (MESSAGE, 0), + (TIMESTAMP, 1), + (TIMESTAMP, 0), + (TIMESTAMP, 0), + (MODEL_INVOCATION_JOB_INPUT_DATA_CONFIG, 1), + (MODEL_INVOCATION_JOB_OUTPUT_DATA_CONFIG, 1), + (VPC_CONFIG, 0), + (MODEL_INVOCATION_JOB_TIMEOUT_DURATION_IN_HOURS, 0), + (TIMESTAMP, 0), + (MODEL_INVOCATION_TYPE, 0), + (NON_NEGATIVE_LONG, 0), + (NON_NEGATIVE_LONG, 0), + (NON_NEGATIVE_LONG, 0), + (NON_NEGATIVE_LONG, 0), + ), ) -GRADER_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GraderConfig"), - shape_type=ShapeType.UNION, - members={"lambdaGrader": {"target": LAMBDA_GRADER_CONFIG}}, +GET_MODEL_INVOCATION_JOB: StaticOperationSchema = ( + 23, + n0, + _GMIJe, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "GET", + "uri": "/model-invocation-job/{jobIdentifier}", + } + ) + }, + GET_MODEL_INVOCATION_JOB_INPUT, + GET_MODEL_INVOCATION_JOB_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -RFT_BATCH_SIZE = Schema( - id=ShapeID("com.amazonaws.bedrock#RFTBatchSize"), shape_type=ShapeType.INTEGER +LIST_MODEL_INVOCATION_JOBS_INPUT: StaticSchema = ( + 18, + n0, + _LMIJIi, + {_sSI: _cLMIJRom, _smit: None}, + (_sTA, _sTB, _sEt, _nC, _mR, _nT, _sB, _sO), + ( + (TIMESTAMP, {_sQ: _sTA}), + (TIMESTAMP, {_sQ: _sTB}), + (MODEL_INVOCATION_JOB_STATUS, {_sQ: _sEt}), + (MODEL_INVOCATION_JOB_NAME, {_sQ: _nC}), + (MAX_RESULTS, {_sQ: _mR}), + (PAGINATION_TOKEN, {_sQ: _nT}), + (SORT_JOBS_BY, {_sQ: _sB}), + (SORT_ORDER, {_sQ: _sO}), + ), ) -EPOCH_COUNT = Schema( - id=ShapeID("com.amazonaws.bedrock#EpochCount"), shape_type=ShapeType.INTEGER +MODEL_INVOCATION_JOB_SUMMARY: StaticSchema = ( + 18, + n0, + _MIJSodel, + 0, + ( + _jA, + _jN, + _mI, + _cRT, + _rA, + _st, + _m, + _sTu, + _lMT, + _eT, + _iDC, + _oDC, + _vCp, + _tDIH, + _jET, + _mIT, + _tRC, + _pRC, + _sRC, + _eRC, + ), + ( + (MODEL_INVOCATION_JOB_ARN, 1), + (MODEL_INVOCATION_JOB_NAME, 1), + (MODEL_ID, 1), + (MODEL_INVOCATION_IDEMPOTENCY_TOKEN, 0), + (ROLE_ARN, 1), + (MODEL_INVOCATION_JOB_STATUS, 0), + (MESSAGE, 0), + (TIMESTAMP, 1), + (TIMESTAMP, 0), + (TIMESTAMP, 0), + (MODEL_INVOCATION_JOB_INPUT_DATA_CONFIG, 1), + (MODEL_INVOCATION_JOB_OUTPUT_DATA_CONFIG, 1), + (VPC_CONFIG, 0), + (MODEL_INVOCATION_JOB_TIMEOUT_DURATION_IN_HOURS, 0), + (TIMESTAMP, 0), + (MODEL_INVOCATION_TYPE, 0), + (NON_NEGATIVE_LONG, 0), + (NON_NEGATIVE_LONG, 0), + (NON_NEGATIVE_LONG, 0), + (NON_NEGATIVE_LONG, 0), + ), ) -RFT_EVAL_INTERVAL = Schema( - id=ShapeID("com.amazonaws.bedrock#RFTEvalInterval"), shape_type=ShapeType.INTEGER +MODEL_INVOCATION_JOB_SUMMARIES: StaticSchema = ( + 16, + n0, + _MIJSodeln, + 0, + (_me,), + ((MODEL_INVOCATION_JOB_SUMMARY, 0),), +) + +LIST_MODEL_INVOCATION_JOBS_OUTPUT: StaticSchema = ( + 18, + n0, + _LMIJOi, + {_sSI: _cLMIJRoma, _smith: None}, + (_nT, _iJS), + ((PAGINATION_TOKEN, 0), (MODEL_INVOCATION_JOB_SUMMARIES, 0)), +) + +LIST_MODEL_INVOCATION_JOBS: StaticOperationSchema = ( + 23, + n0, + _LMIJi, + { + _smithy: MappingProxyType( + {"code": 200, "method": "GET", "uri": "/model-invocation-jobs"} + ) + }, + LIST_MODEL_INVOCATION_JOBS_INPUT, + LIST_MODEL_INVOCATION_JOBS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -RFT_INFERENCE_MAX_TOKENS = Schema( - id=ShapeID("com.amazonaws.bedrock#RFTInferenceMaxTokens"), - shape_type=ShapeType.INTEGER, +STOP_MODEL_INVOCATION_JOB_INPUT: StaticSchema = ( + 18, + n0, + _SMIJI, + {_sSI: _cSMIJR, _smit: None}, + (_jIo,), + ((MODEL_INVOCATION_JOB_IDENTIFIER, 9),), +) + +STOP_MODEL_INVOCATION_JOB_OUTPUT: StaticSchema = ( + 18, + n0, + _SMIJO, + {_sSI: _cSMIJRo, _smith: None}, +) + +STOP_MODEL_INVOCATION_JOB: StaticOperationSchema = ( + 23, + n0, + _SMIJ, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "POST", + "uri": "/model-invocation-job/{jobIdentifier}/stop", + } + ) + }, + STOP_MODEL_INVOCATION_JOB_INPUT, + STOP_MODEL_INVOCATION_JOB_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -RFT_LEARNING_RATE = Schema( - id=ShapeID("com.amazonaws.bedrock#RFTLearningRate"), shape_type=ShapeType.FLOAT +GET_FOUNDATION_MODEL_IDENTIFIER: StaticSchema = (3, n0, _GFMI, 0) + +GET_FOUNDATION_MODEL_INPUT: StaticSchema = ( + 18, + n0, + _GFMIe, + {_sSI: _cGFMR, _smit: None}, + (_mIo,), + ((GET_FOUNDATION_MODEL_IDENTIFIER, 9),), +) + +MODEL_CUSTOMIZATION: StaticSchema = ( + 14, + n0, + _MCod, + 0, + (_FT, _CPT, _DISTILLATION), + ((-1, {_sV: _FT}), (-1, {_sV: _CPT}), (-1, {_sV: _DISTILLATION})), +) + +MODEL_CUSTOMIZATION_LIST: StaticSchema = ( + 16, + n0, + _MCL, + 0, + (_me,), + ((MODEL_CUSTOMIZATION, 0),), +) + +INFERENCE_TYPE: StaticSchema = ( + 14, + n0, + _ITnf, + 0, + (_OD, _PROVISIONED), + ((-1, {_sV: _OD}), (-1, {_sV: _PROVISIONED})), +) + +INFERENCE_TYPE_LIST: StaticSchema = (16, n0, _ITL, 0, (_me,), ((INFERENCE_TYPE, 0),)) + +MODEL_MODALITY: StaticSchema = ( + 14, + n0, + _MM, + 0, + (_TEXT, _IMAGE, _EMBEDDING), + ((-1, {_sV: _TEXT}), (-1, {_sV: _IMAGE}), (-1, {_sV: _EMBEDDING})), +) + +MODEL_MODALITY_LIST: StaticSchema = (16, n0, _MML, 0, (_me,), ((MODEL_MODALITY, 0),)) + +BEDROCK_MODEL_ID: StaticSchema = (3, n0, _BMI, 0) + +FOUNDATION_MODEL_LIFECYCLE_STATUS: StaticSchema = ( + 14, + n0, + _FMLS, + 0, + (_ACTIVE, _LEGACY), + ((-1, {_sV: _ACTIVE}), (-1, {_sV: _LEGACY})), +) + +FOUNDATION_MODEL_LIFECYCLE: StaticSchema = ( + 18, + n0, + _FML, + 0, + (_st, _sOLT, _eOLT, _lTe, _pEAT), + ( + (FOUNDATION_MODEL_LIFECYCLE_STATUS, 1), + (TIMESTAMP, 0), + (TIMESTAMP, 0), + (TIMESTAMP, 0), + (TIMESTAMP, 0), + ), ) -RFT_MAX_PROMPT_LENGTH = Schema( - id=ShapeID("com.amazonaws.bedrock#RFTMaxPromptLength"), shape_type=ShapeType.INTEGER +BRANDED_NAME: StaticSchema = (3, n0, _BNr, 0) + +FOUNDATION_MODEL_DETAILS: StaticSchema = ( + 18, + n0, + _FMD, + 0, + (_mA, _mI, _mN, _pNr, _iMn, _oM, _rSS, _cSu, _iTS, _mL), + ( + (FOUNDATION_MODEL_ARN, 1), + (BEDROCK_MODEL_ID, 1), + (BRANDED_NAME, 0), + (BRANDED_NAME, 0), + (MODEL_MODALITY_LIST, 0), + (MODEL_MODALITY_LIST, 0), + (2, 0), + (MODEL_CUSTOMIZATION_LIST, 0), + (INFERENCE_TYPE_LIST, 0), + (FOUNDATION_MODEL_LIFECYCLE, 0), + ), ) -REASONING_EFFORT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ReasoningEffort"), - shape_type=ShapeType.ENUM, - members={ - "LOW": {"target": UNIT}, - "MEDIUM": {"target": UNIT}, - "HIGH": {"target": UNIT}, - }, +GET_FOUNDATION_MODEL_OUTPUT: StaticSchema = ( + 18, + n0, + _GFMO, + {_sSI: _cGFMRo, _smith: None}, + (_mD,), + ((FOUNDATION_MODEL_DETAILS, 0),), +) + +GET_FOUNDATION_MODEL: StaticOperationSchema = ( + 23, + n0, + _GFM, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "GET", + "uri": "/foundation-models/{modelIdentifier}", + } + ) + }, + GET_FOUNDATION_MODEL_INPUT, + GET_FOUNDATION_MODEL_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -RFT_TRAINING_SAMPLE_PER_PROMPT = Schema( - id=ShapeID("com.amazonaws.bedrock#RFTTrainingSamplePerPrompt"), - shape_type=ShapeType.INTEGER, +PROVIDER: StaticSchema = (3, n0, _P, 0) + +LIST_FOUNDATION_MODELS_INPUT: StaticSchema = ( + 18, + n0, + _LFMI, + {_sSI: _cLFMR, _smit: None}, + (_bP, _bCT, _bOMy, _bIT), + ( + (PROVIDER, {_sQ: _bP}), + (MODEL_CUSTOMIZATION, {_sQ: _bCT}), + (MODEL_MODALITY, {_sQ: _bOMy}), + (INFERENCE_TYPE, {_sQ: _bIT}), + ), ) -RFT_HYPER_PARAMETERS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#RFTHyperParameters"), - members={ - "epochCount": {"target": EPOCH_COUNT}, - "batchSize": {"target": RFT_BATCH_SIZE}, - "learningRate": {"target": RFT_LEARNING_RATE}, - "maxPromptLength": {"target": RFT_MAX_PROMPT_LENGTH}, - "trainingSamplePerPrompt": {"target": RFT_TRAINING_SAMPLE_PER_PROMPT}, - "inferenceMaxTokens": {"target": RFT_INFERENCE_MAX_TOKENS}, - "reasoningEffort": {"target": REASONING_EFFORT}, - "evalInterval": {"target": RFT_EVAL_INTERVAL}, - }, +FOUNDATION_MODEL_SUMMARY: StaticSchema = ( + 18, + n0, + _FMS, + 0, + (_mA, _mI, _mN, _pNr, _iMn, _oM, _rSS, _cSu, _iTS, _mL), + ( + (FOUNDATION_MODEL_ARN, 1), + (BEDROCK_MODEL_ID, 1), + (BRANDED_NAME, 0), + (BRANDED_NAME, 0), + (MODEL_MODALITY_LIST, 0), + (MODEL_MODALITY_LIST, 0), + (2, 0), + (MODEL_CUSTOMIZATION_LIST, 0), + (INFERENCE_TYPE_LIST, 0), + (FOUNDATION_MODEL_LIFECYCLE, 0), + ), ) -RFT_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#RFTConfig"), - members={ - "graderConfig": {"target": GRADER_CONFIG}, - "hyperParameters": {"target": RFT_HYPER_PARAMETERS}, - }, +FOUNDATION_MODEL_SUMMARY_LIST: StaticSchema = ( + 16, + n0, + _FMSL, + 0, + (_me,), + ((FOUNDATION_MODEL_SUMMARY, 0),), +) + +LIST_FOUNDATION_MODELS_OUTPUT: StaticSchema = ( + 18, + n0, + _LFMO, + {_sSI: _cLFMRo, _smith: None}, + (_mSo,), + ((FOUNDATION_MODEL_SUMMARY_LIST, 0),), +) + +LIST_FOUNDATION_MODELS: StaticOperationSchema = ( + 23, + n0, + _LFM, + { + _smithy: MappingProxyType( + {"code": 200, "method": "GET", "uri": "/foundation-models"} + ) + }, + LIST_FOUNDATION_MODELS_INPUT, + LIST_FOUNDATION_MODELS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CUSTOMIZATION_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CustomizationConfig"), - shape_type=ShapeType.UNION, - members={ - "distillationConfig": {"target": DISTILLATION_CONFIG}, - "rftConfig": {"target": RFT_CONFIG}, - }, +PROMPT_ROUTER_DESCRIPTION: StaticSchema = (3, n0, _PRD, 4) + +PROMPT_ROUTER_TARGET_MODEL_ARN: StaticSchema = (3, n0, _PRTMA, 0) + +PROMPT_ROUTER_TARGET_MODEL: StaticSchema = ( + 18, + n0, + _PRTM, + 0, + (_mA,), + ((PROMPT_ROUTER_TARGET_MODEL_ARN, 1),), ) -CUSTOMIZATION_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CustomizationType"), - shape_type=ShapeType.ENUM, - members={ - "FINE_TUNING": {"target": UNIT}, - "CONTINUED_PRE_TRAINING": {"target": UNIT}, - "DISTILLATION": {"target": UNIT}, - "REINFORCEMENT_FINE_TUNING": {"target": UNIT}, - "IMPORTED": {"target": UNIT}, - }, +PROMPT_ROUTER_TARGET_MODELS: StaticSchema = ( + 16, + n0, + _PRTMr, + 0, + (_me,), + ((PROMPT_ROUTER_TARGET_MODEL, 0),), ) -MODEL_CUSTOMIZATION_HYPER_PARAMETERS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ModelCustomizationHyperParameters"), - shape_type=ShapeType.MAP, - members={"key": {"target": STRING}, "value": {"target": STRING}}, +PROMPT_ROUTER_NAME: StaticSchema = (3, n0, _PRN, 0) + +ROUTING_CRITERIA: StaticSchema = (18, n0, _RC, 0, (_rQD,), ((10, 1),)) + +CREATE_PROMPT_ROUTER_INPUT: StaticSchema = ( + 18, + n0, + _CPRI, + {_sSI: _cCPRR, _smit: None}, + (_cRT, _pRN, _mod, _d, _rCo, _fMa, _ta), + ( + (IDEMPOTENCY_TOKEN, 2), + (PROMPT_ROUTER_NAME, 1), + (PROMPT_ROUTER_TARGET_MODELS, 1), + (PROMPT_ROUTER_DESCRIPTION, 0), + (ROUTING_CRITERIA, 1), + (PROMPT_ROUTER_TARGET_MODEL, 1), + (TAG_LIST, 0), + ), ) -MODEL_CUSTOMIZATION_JOB_ARN = Schema( - id=ShapeID("com.amazonaws.bedrock#ModelCustomizationJobArn"), - shape_type=ShapeType.STRING, +PROMPT_ROUTER_ARN: StaticSchema = (3, n0, _PRA, 0) + +CREATE_PROMPT_ROUTER_OUTPUT: StaticSchema = ( + 18, + n0, + _CPRO, + {_sSI: _cCPRRo, _smith: None}, + (_pRAr,), + ((PROMPT_ROUTER_ARN, 0),), +) + +CREATE_PROMPT_ROUTER: StaticOperationSchema = ( + 23, + n0, + _CPR, + { + _smithy: MappingProxyType( + {"code": 200, "method": "POST", "uri": "/prompt-routers"} + ) + }, + CREATE_PROMPT_ROUTER_INPUT, + CREATE_PROMPT_ROUTER_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + TOO_MANY_TAGS_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -JOB_NAME = Schema( - id=ShapeID("com.amazonaws.bedrock#JobName"), shape_type=ShapeType.STRING +DELETE_PROMPT_ROUTER_INPUT: StaticSchema = ( + 18, + n0, + _DPRI, + {_sSI: _cDPRR, _smit: None}, + (_pRAr,), + ((PROMPT_ROUTER_ARN, 9),), +) + +DELETE_PROMPT_ROUTER_OUTPUT: StaticSchema = ( + 18, + n0, + _DPRO, + {_sSI: _cDPRRo, _smith: None}, +) + +DELETE_PROMPT_ROUTER: StaticOperationSchema = ( + 23, + n0, + _DPR, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "DELETE", + "uri": "/prompt-routers/{promptRouterArn}", + } + ) + }, + DELETE_PROMPT_ROUTER_INPUT, + DELETE_PROMPT_ROUTER_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -MODEL_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ModelStatus"), - shape_type=ShapeType.ENUM, - members={ - "ACTIVE": {"target": UNIT}, - "CREATING": {"target": UNIT}, - "FAILED": {"target": UNIT}, - }, +GET_PROMPT_ROUTER_INPUT: StaticSchema = ( + 18, + n0, + _GPRI, + {_sSI: _cGPRR, _smit: None}, + (_pRAr,), + ((PROMPT_ROUTER_ARN, 9),), +) + +PROMPT_ROUTER_STATUS: StaticSchema = ( + 14, + n0, + _PRS, + 0, + (_AVAILABLE,), + ((-1, {_sV: _AVAILABLE}),), +) + +PROMPT_ROUTER_TYPE: StaticSchema = ( + 14, + n0, + _PRT, + 0, + (_CUSTOM, _DEFAULT), + ((-1, {_sV: _cu}), (-1, {_sV: _de})), +) + +GET_PROMPT_ROUTER_OUTPUT: StaticSchema = ( + 18, + n0, + _GPRO, + {_sSI: _cGPRRo, _smith: None}, + (_pRN, _rCo, _d, _cA, _uA, _pRAr, _mod, _fMa, _st, _ty), + ( + (PROMPT_ROUTER_NAME, 1), + (ROUTING_CRITERIA, 1), + (PROMPT_ROUTER_DESCRIPTION, 0), + (TIMESTAMP, 0), + (TIMESTAMP, 0), + (PROMPT_ROUTER_ARN, 1), + (PROMPT_ROUTER_TARGET_MODELS, 1), + (PROMPT_ROUTER_TARGET_MODEL, 1), + (PROMPT_ROUTER_STATUS, 1), + (PROMPT_ROUTER_TYPE, 1), + ), ) -OUTPUT_DATA_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#OutputDataConfig"), - members={ - "s3Uri": { - "target": S3_URI, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } +GET_PROMPT_ROUTER: StaticOperationSchema = ( + 23, + n0, + _GPR, + { + _smithy: MappingProxyType( + {"code": 200, "method": "GET", "uri": "/prompt-routers/{promptRouterArn}"} + ) }, + GET_PROMPT_ROUTER_INPUT, + GET_PROMPT_ROUTER_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -INVOCATION_LOG_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#InvocationLogSource"), - shape_type=ShapeType.UNION, - members={"s3Uri": {"target": S3_URI}}, +LIST_PROMPT_ROUTERS_INPUT: StaticSchema = ( + 18, + n0, + _LPRI, + {_sSI: _cLPRR, _smit: None}, + (_mR, _nT, _ty), + ( + (MAX_RESULTS, {_sQ: _mR}), + (PAGINATION_TOKEN, {_sQ: _nT}), + (PROMPT_ROUTER_TYPE, {_s: _de, _sQ: _ty}), + ), ) -REQUEST_METADATA_MAP = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#RequestMetadataMap"), - shape_type=ShapeType.MAP, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"key": {"target": STRING}, "value": {"target": STRING}}, +PROMPT_ROUTER_SUMMARY: StaticSchema = ( + 18, + n0, + _PRSr, + 0, + (_pRN, _rCo, _d, _cA, _uA, _pRAr, _mod, _fMa, _st, _ty), + ( + (PROMPT_ROUTER_NAME, 1), + (ROUTING_CRITERIA, 1), + (PROMPT_ROUTER_DESCRIPTION, 0), + (TIMESTAMP, 0), + (TIMESTAMP, 0), + (PROMPT_ROUTER_ARN, 1), + (PROMPT_ROUTER_TARGET_MODELS, 1), + (PROMPT_ROUTER_TARGET_MODEL, 1), + (PROMPT_ROUTER_STATUS, 1), + (PROMPT_ROUTER_TYPE, 1), + ), ) -REQUEST_METADATA_BASE_FILTERS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#RequestMetadataBaseFilters"), - members={ - "equals": {"target": REQUEST_METADATA_MAP}, - "notEquals": {"target": REQUEST_METADATA_MAP}, - }, +PROMPT_ROUTER_SUMMARIES: StaticSchema = ( + 16, + n0, + _PRSro, + 0, + (_me,), + ((PROMPT_ROUTER_SUMMARY, 0),), +) + +LIST_PROMPT_ROUTERS_OUTPUT: StaticSchema = ( + 18, + n0, + _LPRO, + {_sSI: _cLPRRo, _smith: None}, + (_pRS, _nT), + ((PROMPT_ROUTER_SUMMARIES, 0), (PAGINATION_TOKEN, 0)), +) + +LIST_PROMPT_ROUTERS: StaticOperationSchema = ( + 23, + n0, + _LPR, + { + _smithy: MappingProxyType( + {"code": 200, "method": "GET", "uri": "/prompt-routers"} + ) + }, + LIST_PROMPT_ROUTERS_INPUT, + LIST_PROMPT_ROUTERS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -REQUEST_METADATA_FILTERS_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#RequestMetadataFiltersList"), - shape_type=ShapeType.LIST, - members={"member": {"target": REQUEST_METADATA_BASE_FILTERS}}, +COMMITMENT_DURATION: StaticSchema = ( + 14, + n0, + _CD, + 0, + (_OM, _SM), + ((-1, {_sV: _OMn}), (-1, {_sV: _SMi})), +) + +POSITIVE_INTEGER: StaticSchema = (7, n0, _PI, 0) + +PROVISIONED_MODEL_NAME: StaticSchema = (3, n0, _PMN, 0) + +CREATE_PROVISIONED_MODEL_THROUGHPUT_INPUT: StaticSchema = ( + 18, + n0, + _CPMTI, + {_sSI: _cCPMTR, _smit: None}, + (_cRT, _mU, _pMN, _mI, _cD, _ta), + ( + (IDEMPOTENCY_TOKEN, 2), + (POSITIVE_INTEGER, 1), + (PROVISIONED_MODEL_NAME, 1), + (MODEL_IDENTIFIER, 1), + (COMMITMENT_DURATION, 0), + (TAG_LIST, 0), + ), ) -REQUEST_METADATA_FILTERS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#RequestMetadataFilters"), - shape_type=ShapeType.UNION, - members={ - "equals": {"target": REQUEST_METADATA_MAP}, - "notEquals": {"target": REQUEST_METADATA_MAP}, - "andAll": {"target": REQUEST_METADATA_FILTERS_LIST}, - "orAll": {"target": REQUEST_METADATA_FILTERS_LIST}, - }, +PROVISIONED_MODEL_ARN: StaticSchema = (3, n0, _PMA, 0) + +CREATE_PROVISIONED_MODEL_THROUGHPUT_OUTPUT: StaticSchema = ( + 18, + n0, + _CPMTO, + {_sSI: _cCPMTRo, _smith: None}, + (_pMA,), + ((PROVISIONED_MODEL_ARN, 1),), +) + +CREATE_PROVISIONED_MODEL_THROUGHPUT: StaticOperationSchema = ( + 23, + n0, + _CPMT, + { + _smithy: MappingProxyType( + {"code": 201, "method": "POST", "uri": "/provisioned-model-throughput"} + ) + }, + CREATE_PROVISIONED_MODEL_THROUGHPUT_INPUT, + CREATE_PROVISIONED_MODEL_THROUGHPUT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + TOO_MANY_TAGS_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -USE_PROMPT_RESPONSE = Schema( - id=ShapeID("com.amazonaws.bedrock#UsePromptResponse"), - shape_type=ShapeType.BOOLEAN, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=False)], -) - -INVOCATION_LOGS_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#InvocationLogsConfig"), - members={ - "usePromptResponse": { - "target": USE_PROMPT_RESPONSE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "invocationLogSource": { - "target": INVOCATION_LOG_SOURCE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "requestMetadataFilters": {"target": REQUEST_METADATA_FILTERS}, - }, +PROVISIONED_MODEL_ID: StaticSchema = (3, n0, _PMI, 0) + +DELETE_PROVISIONED_MODEL_THROUGHPUT_INPUT: StaticSchema = ( + 18, + n0, + _DPMTI, + {_sSI: _cDPMTR, _smit: None}, + (_pMI,), + ((PROVISIONED_MODEL_ID, 9),), +) + +DELETE_PROVISIONED_MODEL_THROUGHPUT_OUTPUT: StaticSchema = ( + 18, + n0, + _DPMTO, + {_sSI: _cDPMTRo, _smith: None}, +) + +DELETE_PROVISIONED_MODEL_THROUGHPUT: StaticOperationSchema = ( + 23, + n0, + _DPMT, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "DELETE", + "uri": "/provisioned-model-throughput/{provisionedModelId}", + } + ) + }, + DELETE_PROVISIONED_MODEL_THROUGHPUT_INPUT, + DELETE_PROVISIONED_MODEL_THROUGHPUT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -TRAINING_DATA_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#TrainingDataConfig"), - members={ - "s3Uri": {"target": S3_URI}, - "invocationLogsConfig": {"target": INVOCATION_LOGS_CONFIG}, - }, +GET_PROVISIONED_MODEL_THROUGHPUT_INPUT: StaticSchema = ( + 18, + n0, + _GPMTI, + {_sSI: _cGPMTR, _smit: None}, + (_pMI,), + ((PROVISIONED_MODEL_ID, 9),), +) + +PROVISIONED_MODEL_STATUS: StaticSchema = ( + 14, + n0, + _PMS, + 0, + (_CREATING, _IS_, _UPDATING, _FAILED), + ((-1, {_sV: _Cr}), (-1, {_sV: _ISn}), (-1, {_sV: _U}), (-1, {_sV: _F})), +) + +GET_PROVISIONED_MODEL_THROUGHPUT_OUTPUT: StaticSchema = ( + 18, + n0, + _GPMTO, + {_sSI: _cGPMTRo, _smith: None}, + (_mU, _dMU, _pMN, _pMA, _mA, _dMA, _fMA, _st, _cTr, _lMT, _fM, _cD, _cET), + ( + (POSITIVE_INTEGER, 1), + (POSITIVE_INTEGER, 1), + (PROVISIONED_MODEL_NAME, 1), + (PROVISIONED_MODEL_ARN, 1), + (MODEL_ARN, 1), + (MODEL_ARN, 1), + (FOUNDATION_MODEL_ARN, 1), + (PROVISIONED_MODEL_STATUS, 1), + (TIMESTAMP, 1), + (TIMESTAMP, 1), + (ERROR_MESSAGE, 0), + (COMMITMENT_DURATION, 0), + (TIMESTAMP, 0), + ), ) -METRIC_FLOAT = Schema( - id=ShapeID("com.amazonaws.bedrock#MetricFloat"), shape_type=ShapeType.FLOAT +GET_PROVISIONED_MODEL_THROUGHPUT: StaticOperationSchema = ( + 23, + n0, + _GPMT, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "GET", + "uri": "/provisioned-model-throughput/{provisionedModelId}", + } + ) + }, + GET_PROVISIONED_MODEL_THROUGHPUT_INPUT, + GET_PROVISIONED_MODEL_THROUGHPUT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -TRAINING_METRICS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#TrainingMetrics"), - members={"trainingLoss": {"target": METRIC_FLOAT}}, +SORT_BY_PROVISIONED_MODELS: StaticSchema = ( + 14, + n0, + _SBPM, + 0, + (_CT,), + ((-1, {_sV: _CTr}),), +) + +LIST_PROVISIONED_MODEL_THROUGHPUTS_INPUT: StaticSchema = ( + 18, + n0, + _LPMTI, + {_sSI: _cLPMTR, _smit: None}, + (_cTA, _cTB, _sEt, _mAE, _nC, _mR, _nT, _sB, _sO), + ( + (TIMESTAMP, {_sQ: _cTA}), + (TIMESTAMP, {_sQ: _cTB}), + (PROVISIONED_MODEL_STATUS, {_sQ: _sEt}), + (MODEL_ARN, {_sQ: _mAE}), + (PROVISIONED_MODEL_NAME, {_sQ: _nC}), + (MAX_RESULTS, {_sQ: _mR}), + (PAGINATION_TOKEN, {_sQ: _nT}), + (SORT_BY_PROVISIONED_MODELS, {_sQ: _sB}), + (SORT_ORDER, {_sQ: _sO}), + ), ) -VALIDATOR = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#Validator"), - members={ - "s3Uri": { - "target": S3_URI, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +PROVISIONED_MODEL_SUMMARY: StaticSchema = ( + 18, + n0, + _PMSr, + 0, + (_pMN, _pMA, _mA, _dMA, _fMA, _mU, _dMU, _st, _cD, _cET, _cTr, _lMT), + ( + (PROVISIONED_MODEL_NAME, 1), + (PROVISIONED_MODEL_ARN, 1), + (MODEL_ARN, 1), + (MODEL_ARN, 1), + (FOUNDATION_MODEL_ARN, 1), + (POSITIVE_INTEGER, 1), + (POSITIVE_INTEGER, 1), + (PROVISIONED_MODEL_STATUS, 1), + (COMMITMENT_DURATION, 0), + (TIMESTAMP, 0), + (TIMESTAMP, 1), + (TIMESTAMP, 1), + ), ) -VALIDATORS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#Validators"), - shape_type=ShapeType.LIST, - members={"member": {"target": VALIDATOR}}, +PROVISIONED_MODEL_SUMMARIES: StaticSchema = ( + 16, + n0, + _PMSro, + 0, + (_me,), + ((PROVISIONED_MODEL_SUMMARY, 0),), +) + +LIST_PROVISIONED_MODEL_THROUGHPUTS_OUTPUT: StaticSchema = ( + 18, + n0, + _LPMTO, + {_sSI: _cLPMTRo, _smith: None}, + (_nT, _pMS), + ((PAGINATION_TOKEN, 0), (PROVISIONED_MODEL_SUMMARIES, 0)), +) + +LIST_PROVISIONED_MODEL_THROUGHPUTS: StaticOperationSchema = ( + 23, + n0, + _LPMT, + { + _smithy: MappingProxyType( + {"code": 200, "method": "GET", "uri": "/provisioned-model-throughputs"} + ) + }, + LIST_PROVISIONED_MODEL_THROUGHPUTS_INPUT, + LIST_PROVISIONED_MODEL_THROUGHPUTS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -VALIDATION_DATA_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ValidationDataConfig"), - members={ - "validators": { - "target": VALIDATORS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +UPDATE_PROVISIONED_MODEL_THROUGHPUT_INPUT: StaticSchema = ( + 18, + n0, + _UPMTI, + {_sSI: _cUPMTR, _smit: None}, + (_pMI, _dPMN, _dMI), + ((PROVISIONED_MODEL_ID, 9), (PROVISIONED_MODEL_NAME, 0), (MODEL_IDENTIFIER, 0)), +) + +UPDATE_PROVISIONED_MODEL_THROUGHPUT_OUTPUT: StaticSchema = ( + 18, + n0, + _UPMTO, + {_sSI: _cUPMTRo, _smith: None}, +) + +UPDATE_PROVISIONED_MODEL_THROUGHPUT: StaticOperationSchema = ( + 23, + n0, + _UPMT, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "PATCH", + "uri": "/provisioned-model-throughput/{provisionedModelId}", + } + ) + }, + UPDATE_PROVISIONED_MODEL_THROUGHPUT_INPUT, + UPDATE_PROVISIONED_MODEL_THROUGHPUT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -VALIDATOR_METRIC = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ValidatorMetric"), - members={"validationLoss": {"target": METRIC_FLOAT}}, +RESOURCE_POLICY_RESOURCE_ARN: StaticSchema = (3, n0, _RPRA, 0) + +DELETE_RESOURCE_POLICY_INPUT: StaticSchema = ( + 18, + n0, + _DRPI, + {_sSI: _cDRPR, _smit: None}, + (_rAe,), + ((RESOURCE_POLICY_RESOURCE_ARN, 9),), ) -VALIDATION_METRICS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ValidationMetrics"), - shape_type=ShapeType.LIST, - members={"member": {"target": VALIDATOR_METRIC}}, +DELETE_RESOURCE_POLICY_OUTPUT: StaticSchema = ( + 18, + n0, + _DRPO, + {_sSI: _cDRPRo, _smith: None}, ) -GET_CUSTOM_MODEL_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetCustomModelOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetCustomModelResponse", +DELETE_RESOURCE_POLICY: StaticOperationSchema = ( + 23, + n0, + _DRP, + { + _smithy: MappingProxyType( + {"code": 200, "method": "DELETE", "uri": "/resource-policy/{resourceArn}"} ) - ], - members={ - "modelArn": { - "target": MODEL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelName": { - "target": CUSTOM_MODEL_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "jobName": {"target": JOB_NAME}, - "jobArn": {"target": MODEL_CUSTOMIZATION_JOB_ARN}, - "baseModelArn": {"target": MODEL_ARN}, - "customizationType": {"target": CUSTOMIZATION_TYPE}, - "modelKmsKeyArn": {"target": KMS_KEY_ARN}, - "hyperParameters": {"target": MODEL_CUSTOMIZATION_HYPER_PARAMETERS}, - "trainingDataConfig": {"target": TRAINING_DATA_CONFIG}, - "validationDataConfig": {"target": VALIDATION_DATA_CONFIG}, - "outputDataConfig": {"target": OUTPUT_DATA_CONFIG}, - "trainingMetrics": {"target": TRAINING_METRICS}, - "validationMetrics": {"target": VALIDATION_METRICS}, - "creationTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "customizationConfig": {"target": CUSTOMIZATION_CONFIG}, - "modelStatus": {"target": MODEL_STATUS}, - "failureMessage": {"target": ERROR_MESSAGE}, }, + DELETE_RESOURCE_POLICY_INPUT, + DELETE_RESOURCE_POLICY_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -GET_CUSTOM_MODEL = Schema( - id=ShapeID("com.amazonaws.bedrock#GetCustomModel"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/custom-models/{modelIdentifier}", - } - ), - ) - ], +GET_RESOURCE_POLICY_INPUT: StaticSchema = ( + 18, + n0, + _GRPI, + {_sSI: _cGRPR, _smit: None}, + (_rAe,), + ((RESOURCE_POLICY_RESOURCE_ARN, 9),), ) -FOUNDATION_MODEL_ARN = Schema( - id=ShapeID("com.amazonaws.bedrock#FoundationModelArn"), shape_type=ShapeType.STRING +RESOURCE_POLICY_DOCUMENT: StaticSchema = (3, n0, _RPD, 0) + +GET_RESOURCE_POLICY_OUTPUT: StaticSchema = ( + 18, + n0, + _GRPO, + {_sSI: _cGRPRo, _smith: None}, + (_rP,), + ((RESOURCE_POLICY_DOCUMENT, 0),), ) -LIST_CUSTOM_MODELS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ListCustomModelsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#ListCustomModelsRequest", +GET_RESOURCE_POLICY: StaticOperationSchema = ( + 23, + n0, + _GRP, + { + _smithy: MappingProxyType( + {"code": 200, "method": "GET", "uri": "/resource-policy/{resourceArn}"} ) - ], - members={ - "creationTimeBefore": { - "target": TIMESTAMP, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpQuery"), value="creationTimeBefore" - ) - ], - }, - "creationTimeAfter": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="creationTimeAfter") - ], - }, - "nameContains": { - "target": CUSTOM_MODEL_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nameContains") - ], - }, - "baseModelArnEquals": { - "target": MODEL_ARN, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpQuery"), value="baseModelArnEquals" - ) - ], - }, - "foundationModelArnEquals": { - "target": FOUNDATION_MODEL_ARN, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpQuery"), value="foundationModelArnEquals" - ) - ], - }, - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "nextToken": { - "target": PAGINATION_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "sortBy": { - "target": SORT_MODELS_BY, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="sortBy")], - }, - "sortOrder": { - "target": SORT_ORDER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="sortOrder") - ], - }, - "isOwned": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="isOwned")], - }, - "modelStatus": { - "target": MODEL_STATUS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="modelStatus") - ], - }, }, + GET_RESOURCE_POLICY_INPUT, + GET_RESOURCE_POLICY_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -MODEL_NAME = Schema( - id=ShapeID("com.amazonaws.bedrock#ModelName"), shape_type=ShapeType.STRING -) - -CUSTOM_MODEL_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CustomModelSummary"), - members={ - "modelArn": { - "target": CUSTOM_MODEL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelName": { - "target": CUSTOM_MODEL_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "creationTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "baseModelArn": { - "target": MODEL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "baseModelName": { - "target": MODEL_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "customizationType": {"target": CUSTOMIZATION_TYPE}, - "ownerAccountId": {"target": ACCOUNT_ID}, - "modelStatus": {"target": MODEL_STATUS}, - }, +PUT_RESOURCE_POLICY_INPUT: StaticSchema = ( + 18, + n0, + _PRPI, + {_sSI: _cPRPR, _smit: None}, + (_rAe, _rP), + ((RESOURCE_POLICY_RESOURCE_ARN, 1), (RESOURCE_POLICY_DOCUMENT, 1)), +) + +PUT_RESOURCE_POLICY_OUTPUT: StaticSchema = ( + 18, + n0, + _PRPO, + {_sSI: _cPRPRo, _smith: None}, + (_rAe,), + ((RESOURCE_POLICY_RESOURCE_ARN, 0),), +) + +PUT_RESOURCE_POLICY: StaticOperationSchema = ( + 23, + n0, + _PRP, + { + _smithy: MappingProxyType( + {"code": 201, "method": "POST", "uri": "/resource-policy"} + ) + }, + PUT_RESOURCE_POLICY_INPUT, + PUT_RESOURCE_POLICY_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CUSTOM_MODEL_SUMMARY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CustomModelSummaryList"), - shape_type=ShapeType.LIST, - members={"member": {"target": CUSTOM_MODEL_SUMMARY}}, +OFFER_TOKEN: StaticSchema = (3, n0, _OT, 0) + +CREATE_FOUNDATION_MODEL_AGREEMENT_INPUT: StaticSchema = ( + 18, + n0, + _CFMAI, + {_sSI: _cCFMAR, _smit: None}, + (_oT, _mI), + ((OFFER_TOKEN, 1), (BEDROCK_MODEL_ID, 1)), +) + +CREATE_FOUNDATION_MODEL_AGREEMENT_OUTPUT: StaticSchema = ( + 18, + n0, + _CFMAO, + {_sSI: _cCFMARo, _smith: None}, + (_mI,), + ((BEDROCK_MODEL_ID, 1),), +) + +CREATE_FOUNDATION_MODEL_AGREEMENT: StaticOperationSchema = ( + 23, + n0, + _CFMA, + { + _smithy: MappingProxyType( + {"code": 202, "method": "POST", "uri": "/create-foundation-model-agreement"} + ) + }, + CREATE_FOUNDATION_MODEL_AGREEMENT_INPUT, + CREATE_FOUNDATION_MODEL_AGREEMENT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -LIST_CUSTOM_MODELS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ListCustomModelsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#ListCustomModelsResponse", - ) - ], - members={ - "nextToken": {"target": PAGINATION_TOKEN}, - "modelSummaries": {"target": CUSTOM_MODEL_SUMMARY_LIST}, - }, +DELETE_FOUNDATION_MODEL_AGREEMENT_INPUT: StaticSchema = ( + 18, + n0, + _DFMAI, + {_sSI: _cDFMAR, _smit: None}, + (_mI,), + ((BEDROCK_MODEL_ID, 1),), +) + +DELETE_FOUNDATION_MODEL_AGREEMENT_OUTPUT: StaticSchema = ( + 18, + n0, + _DFMAO, + {_sSI: _cDFMARo, _smith: None}, +) + +DELETE_FOUNDATION_MODEL_AGREEMENT: StaticOperationSchema = ( + 23, + n0, + _DFMA, + { + _smithy: MappingProxyType( + {"code": 202, "method": "POST", "uri": "/delete-foundation-model-agreement"} + ) + }, + DELETE_FOUNDATION_MODEL_AGREEMENT_INPUT, + DELETE_FOUNDATION_MODEL_AGREEMENT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -LIST_CUSTOM_MODELS = Schema( - id=ShapeID("com.amazonaws.bedrock#ListCustomModels"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "GET", "uri": "/custom-models"} - ), - ) - ], +GET_FOUNDATION_MODEL_AVAILABILITY_INPUT: StaticSchema = ( + 18, + n0, + _GFMAI, + {_sSI: _cGFMAR, _smit: None}, + (_mI,), + ((BEDROCK_MODEL_ID, 9),), +) + +AUTHORIZATION_STATUS: StaticSchema = ( + 14, + n0, + _ASu, + 0, + (_AUTHORIZED, _NA_), + ((-1, {_sV: _AUTHORIZED}), (-1, {_sV: _NA_})), +) + +ENTITLEMENT_AVAILABILITY: StaticSchema = ( + 14, + n0, + _EA, + 0, + (_AVAILABLE, _NA), + ((-1, {_sV: _AVAILABLE}), (-1, {_sV: _NA})), +) + +REGION_AVAILABILITY: StaticSchema = ( + 14, + n0, + _RAe, + 0, + (_AVAILABLE, _NA), + ((-1, {_sV: _AVAILABLE}), (-1, {_sV: _NA})), +) + +GET_FOUNDATION_MODEL_AVAILABILITY_OUTPUT: StaticSchema = ( + 18, + n0, + _GFMAO, + {_sSI: _cGFMARo, _smith: None}, + (_mI, _aAg, _aSu, _eAn, _rAeg), + ( + (BEDROCK_MODEL_ID, 1), + (AGREEMENT_AVAILABILITY, 1), + (AUTHORIZATION_STATUS, 1), + (ENTITLEMENT_AVAILABILITY, 1), + (REGION_AVAILABILITY, 1), + ), ) -GET_ACCOUNT_DATA_RETENTION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetAccountDataRetentionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetAccountDataRetentionRequest", - ) - ], -) - -DATA_RETENTION_MODE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#DataRetentionMode"), - shape_type=ShapeType.ENUM, - members={ - "DEFAULT": {"target": UNIT}, - "NONE": {"target": UNIT}, - "AWS_REVIEW": {"target": UNIT}, - "PROVIDER_DATA_SHARE": {"target": UNIT}, - "INHERIT": {"target": UNIT}, - }, +GET_FOUNDATION_MODEL_AVAILABILITY: StaticOperationSchema = ( + 23, + n0, + _GFMA, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "GET", + "uri": "/foundation-model-availability/{modelId}", + } + ) + }, + GET_FOUNDATION_MODEL_AVAILABILITY_INPUT, + GET_FOUNDATION_MODEL_AVAILABILITY_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -GET_ACCOUNT_DATA_RETENTION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetAccountDataRetentionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetAccountDataRetentionResponse", - ) - ], - members={ - "mode": { - "target": DATA_RETENTION_MODE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": {"target": TIMESTAMP}, - }, +OFFER_TYPE: StaticSchema = ( + 14, + n0, + _OTf, + 0, + (_ALL, _PUBLIC), + ((-1, {_sV: _ALL}), (-1, {_sV: _PUBLIC})), ) -GET_ACCOUNT_DATA_RETENTION = Schema( - id=ShapeID("com.amazonaws.bedrock#GetAccountDataRetention"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "GET", "uri": "/data-retention"} - ), - ) - ], +LIST_FOUNDATION_MODEL_AGREEMENT_OFFERS_INPUT: StaticSchema = ( + 18, + n0, + _LFMAOI, + {_sSI: _cLFMAOR, _smit: None}, + (_mI, _oTf), + ((BEDROCK_MODEL_ID, 9), (OFFER_TYPE, {_sQ: _oTf})), ) -PUT_ACCOUNT_DATA_RETENTION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#PutAccountDataRetentionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#PutAccountDataRetentionRequest", - ) - ], - members={ - "mode": { - "target": DATA_RETENTION_MODE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +OFFER_ID: StaticSchema = (3, n0, _OI, 0) -PUT_ACCOUNT_DATA_RETENTION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#PutAccountDataRetentionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#PutAccountDataRetentionResponse", - ) - ], - members={ - "mode": { - "target": DATA_RETENTION_MODE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": {"target": TIMESTAMP}, - }, -) +LEGAL_TERM: StaticSchema = (18, n0, _LT, 0, (_ur,), ((3, 0),)) -PUT_ACCOUNT_DATA_RETENTION = Schema( - id=ShapeID("com.amazonaws.bedrock#PutAccountDataRetention"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "PUT", "uri": "/data-retention"} - ), - ) - ], +SUPPORT_TERM: StaticSchema = (18, n0, _STu, 0, (_rPD,), ((3, 0),)) + +DIMENSIONAL_PRICE_RATE: StaticSchema = ( + 18, + n0, + _DPRi, + 0, + (_di, _pri, _d, _un), + ((3, 0), (3, 0), (3, 0), (3, 0)), ) -DELETE_ENFORCED_GUARDRAIL_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#DeleteEnforcedGuardrailConfigurationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#DeleteEnforcedGuardrailConfigurationRequest", - ) - ], - members={ - "configId": { - "target": ACCOUNT_ENFORCED_GUARDRAIL_CONFIGURATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, +RATE_CARD: StaticSchema = (16, n0, _RCa, 0, (_me,), ((DIMENSIONAL_PRICE_RATE, 0),)) + +PRICING_TERM: StaticSchema = (18, n0, _PTri, 0, (_rCa,), ((RATE_CARD, 1),)) + +VALIDITY_TERM: StaticSchema = (18, n0, _VT, 0, (_aD,), ((3, 0),)) + +TERM_DETAILS: StaticSchema = ( + 18, + n0, + _TD, + 0, + (_uBPT, _lTeg, _sTup, _vT), + ((PRICING_TERM, 1), (LEGAL_TERM, 1), (SUPPORT_TERM, 1), (VALIDITY_TERM, 0)), ) -DELETE_ENFORCED_GUARDRAIL_CONFIGURATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#DeleteEnforcedGuardrailConfigurationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#DeleteEnforcedGuardrailConfigurationResponse", - ) - ], -) - -DELETE_ENFORCED_GUARDRAIL_CONFIGURATION = Schema( - id=ShapeID("com.amazonaws.bedrock#DeleteEnforcedGuardrailConfiguration"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "DELETE", - "uri": "/enforcedGuardrailsConfiguration/{configId}", - } - ), - ) - ], +OFFER: StaticSchema = ( + 18, + n0, + _O, + 0, + (_oI, _oT, _tD), + ((OFFER_ID, 0), (OFFER_TOKEN, 1), (TERM_DETAILS, 1)), ) -LIST_ENFORCED_GUARDRAILS_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ListEnforcedGuardrailsConfigurationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#ListEnforcedGuardrailsConfigurationRequest", - ) - ], - members={ - "nextToken": { - "target": PAGINATION_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - } - }, +OFFERS: StaticSchema = (16, n0, _Of, 0, (_me,), ((OFFER, 0),)) + +LIST_FOUNDATION_MODEL_AGREEMENT_OFFERS_OUTPUT: StaticSchema = ( + 18, + n0, + _LFMAOO, + {_sSI: _cLFMAORo, _smith: None}, + (_mI, _of), + ((BEDROCK_MODEL_ID, 1), (OFFERS, 1)), ) -LIST_ENFORCED_GUARDRAILS_CONFIGURATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ListEnforcedGuardrailsConfigurationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#ListEnforcedGuardrailsConfigurationResponse", +LIST_FOUNDATION_MODEL_AGREEMENT_OFFERS: StaticOperationSchema = ( + 23, + n0, + _LFMAO, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "GET", + "uri": "/list-foundation-model-agreement-offers/{modelId}", + } ) - ], - members={ - "guardrailsConfig": { - "target": ACCOUNT_ENFORCED_GUARDRAILS_OUTPUT_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": PAGINATION_TOKEN}, }, + LIST_FOUNDATION_MODEL_AGREEMENT_OFFERS_INPUT, + LIST_FOUNDATION_MODEL_AGREEMENT_OFFERS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -LIST_ENFORCED_GUARDRAILS_CONFIGURATION = Schema( - id=ShapeID("com.amazonaws.bedrock#ListEnforcedGuardrailsConfiguration"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/enforcedGuardrailsConfiguration", - } - ), - ) - ], -) - -PUT_ENFORCED_GUARDRAIL_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#PutEnforcedGuardrailConfigurationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#PutEnforcedGuardrailConfigurationRequest", - ) - ], - members={ - "configId": {"target": ACCOUNT_ENFORCED_GUARDRAIL_CONFIGURATION_ID}, - "guardrailInferenceConfig": { - "target": ACCOUNT_ENFORCED_GUARDRAIL_INFERENCE_INPUT_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -PUT_ENFORCED_GUARDRAIL_CONFIGURATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#PutEnforcedGuardrailConfigurationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#PutEnforcedGuardrailConfigurationResponse", - ) - ], - members={ - "configId": {"target": ACCOUNT_ENFORCED_GUARDRAIL_CONFIGURATION_ID}, - "updatedAt": {"target": TIMESTAMP}, - "updatedBy": {"target": STRING}, - }, -) - -PUT_ENFORCED_GUARDRAIL_CONFIGURATION = Schema( - id=ShapeID("com.amazonaws.bedrock#PutEnforcedGuardrailConfiguration"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "PUT", - "uri": "/enforcedGuardrailsConfiguration", - } - ), - ) - ], -) - -EVALUATION_JOB_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrock#EvaluationJobIdentifier"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -EVALUATION_JOB_IDENTIFIERS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#EvaluationJobIdentifiers"), - shape_type=ShapeType.LIST, - members={"member": {"target": EVALUATION_JOB_IDENTIFIER}}, -) - -BATCH_DELETE_EVALUATION_JOB_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#BatchDeleteEvaluationJobInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#BatchDeleteEvaluationJobRequest", - ) - ], - members={ - "jobIdentifiers": { - "target": EVALUATION_JOB_IDENTIFIERS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -BATCH_DELETE_EVALUATION_JOB_ERROR = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#BatchDeleteEvaluationJobError"), - members={ - "jobIdentifier": { - "target": EVALUATION_JOB_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "code": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "message": {"target": STRING}, - }, -) - -BATCH_DELETE_EVALUATION_JOB_ERRORS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#BatchDeleteEvaluationJobErrors"), - shape_type=ShapeType.LIST, - members={"member": {"target": BATCH_DELETE_EVALUATION_JOB_ERROR}}, -) - -EVALUATION_JOB_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#EvaluationJobStatus"), - shape_type=ShapeType.ENUM, - members={ - "IN_PROGRESS": {"target": UNIT}, - "COMPLETED": {"target": UNIT}, - "FAILED": {"target": UNIT}, - "STOPPING": {"target": UNIT}, - "STOPPED": {"target": UNIT}, - "DELETING": {"target": UNIT}, - }, -) - -BATCH_DELETE_EVALUATION_JOB_ITEM = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#BatchDeleteEvaluationJobItem"), - members={ - "jobIdentifier": { - "target": EVALUATION_JOB_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "jobStatus": { - "target": EVALUATION_JOB_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -BATCH_DELETE_EVALUATION_JOB_ITEMS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#BatchDeleteEvaluationJobItems"), - shape_type=ShapeType.LIST, - members={"member": {"target": BATCH_DELETE_EVALUATION_JOB_ITEM}}, -) - -BATCH_DELETE_EVALUATION_JOB_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#BatchDeleteEvaluationJobOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#BatchDeleteEvaluationJobResponse", - ) - ], - members={ - "errors": { - "target": BATCH_DELETE_EVALUATION_JOB_ERRORS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "evaluationJobs": { - "target": BATCH_DELETE_EVALUATION_JOB_ITEMS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -BATCH_DELETE_EVALUATION_JOB = Schema( - id=ShapeID("com.amazonaws.bedrock#BatchDeleteEvaluationJob"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 202, "method": "POST", "uri": "/evaluation-jobs/batch-delete"} - ), - ) - ], -) - -APPLICATION_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ApplicationType"), - shape_type=ShapeType.ENUM, - members={"MODEL_EVALUATION": {"target": UNIT}, "RAG_EVALUATION": {"target": UNIT}}, -) - -CUSTOM_METRIC_INSTRUCTIONS = Schema( - id=ShapeID("com.amazonaws.bedrock#CustomMetricInstructions"), - shape_type=ShapeType.STRING, -) - -METRIC_NAME = Schema( - id=ShapeID("com.amazonaws.bedrock#MetricName"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -RATING_SCALE_ITEM_DEFINITION = Schema( - id=ShapeID("com.amazonaws.bedrock#RatingScaleItemDefinition"), - shape_type=ShapeType.STRING, -) - -RATING_SCALE_ITEM_VALUE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#RatingScaleItemValue"), - shape_type=ShapeType.UNION, - members={"stringValue": {"target": STRING}, "floatValue": {"target": FLOAT}}, -) - -RATING_SCALE_ITEM = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#RatingScaleItem"), - members={ - "definition": { - "target": RATING_SCALE_ITEM_DEFINITION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "value": { - "target": RATING_SCALE_ITEM_VALUE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -RATING_SCALE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#RatingScale"), - shape_type=ShapeType.LIST, - members={"member": {"target": RATING_SCALE_ITEM}}, -) - -CUSTOM_METRIC_DEFINITION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CustomMetricDefinition"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "name": { - "target": METRIC_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "instructions": { - "target": CUSTOM_METRIC_INSTRUCTIONS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ratingScale": {"target": RATING_SCALE}, - }, -) - -AUTOMATED_EVALUATION_CUSTOM_METRIC_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedEvaluationCustomMetricSource"), - shape_type=ShapeType.UNION, - members={"customMetricDefinition": {"target": CUSTOM_METRIC_DEFINITION}}, -) - -AUTOMATED_EVALUATION_CUSTOM_METRICS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedEvaluationCustomMetrics"), - shape_type=ShapeType.LIST, - members={"member": {"target": AUTOMATED_EVALUATION_CUSTOM_METRIC_SOURCE}}, -) - -EVALUATOR_MODEL_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrock#EvaluatorModelIdentifier"), - shape_type=ShapeType.STRING, -) - -CUSTOM_METRIC_BEDROCK_EVALUATOR_MODEL = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CustomMetricBedrockEvaluatorModel"), - members={ - "modelIdentifier": { - "target": EVALUATOR_MODEL_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -CUSTOM_METRIC_BEDROCK_EVALUATOR_MODELS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CustomMetricBedrockEvaluatorModels"), - shape_type=ShapeType.LIST, - members={"member": {"target": CUSTOM_METRIC_BEDROCK_EVALUATOR_MODEL}}, -) - -CUSTOM_METRIC_EVALUATOR_MODEL_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CustomMetricEvaluatorModelConfig"), - members={ - "bedrockEvaluatorModels": { - "target": CUSTOM_METRIC_BEDROCK_EVALUATOR_MODELS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -AUTOMATED_EVALUATION_CUSTOM_METRIC_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedEvaluationCustomMetricConfig"), - members={ - "customMetrics": { - "target": AUTOMATED_EVALUATION_CUSTOM_METRICS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "evaluatorModelConfig": { - "target": CUSTOM_METRIC_EVALUATOR_MODEL_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -EVALUATION_DATASET_LOCATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#EvaluationDatasetLocation"), - shape_type=ShapeType.UNION, - members={"s3Uri": {"target": S3_URI}}, -) - -EVALUATION_DATASET_NAME = Schema( - id=ShapeID("com.amazonaws.bedrock#EvaluationDatasetName"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -EVALUATION_DATASET = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#EvaluationDataset"), - members={ - "name": { - "target": EVALUATION_DATASET_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "datasetLocation": {"target": EVALUATION_DATASET_LOCATION}, - }, -) - -EVALUATION_METRIC_NAME = Schema( - id=ShapeID("com.amazonaws.bedrock#EvaluationMetricName"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -EVALUATION_METRIC_NAMES = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#EvaluationMetricNames"), - shape_type=ShapeType.LIST, - members={"member": {"target": EVALUATION_METRIC_NAME}}, -) - -EVALUATION_TASK_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#EvaluationTaskType"), - shape_type=ShapeType.ENUM, - members={ - "SUMMARIZATION": {"target": UNIT}, - "CLASSIFICATION": {"target": UNIT}, - "QUESTION_AND_ANSWER": {"target": UNIT}, - "GENERATION": {"target": UNIT}, - "CUSTOM": {"target": UNIT}, - }, -) - -EVALUATION_DATASET_METRIC_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#EvaluationDatasetMetricConfig"), - members={ - "taskType": { - "target": EVALUATION_TASK_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "dataset": { - "target": EVALUATION_DATASET, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "metricNames": { - "target": EVALUATION_METRIC_NAMES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -EVALUATION_DATASET_METRIC_CONFIGS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#EvaluationDatasetMetricConfigs"), - shape_type=ShapeType.LIST, - members={"member": {"target": EVALUATION_DATASET_METRIC_CONFIG}}, -) - -BEDROCK_EVALUATOR_MODEL = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#BedrockEvaluatorModel"), - members={ - "modelIdentifier": { - "target": EVALUATOR_MODEL_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -BEDROCK_EVALUATOR_MODELS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#BedrockEvaluatorModels"), - shape_type=ShapeType.LIST, - members={"member": {"target": BEDROCK_EVALUATOR_MODEL}}, -) - -EVALUATOR_MODEL_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#EvaluatorModelConfig"), - shape_type=ShapeType.UNION, - members={"bedrockEvaluatorModels": {"target": BEDROCK_EVALUATOR_MODELS}}, -) - -AUTOMATED_EVALUATION_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedEvaluationConfig"), - members={ - "datasetMetricConfigs": { - "target": EVALUATION_DATASET_METRIC_CONFIGS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "evaluatorModelConfig": {"target": EVALUATOR_MODEL_CONFIG}, - "customMetricConfig": {"target": AUTOMATED_EVALUATION_CUSTOM_METRIC_CONFIG}, - }, -) - -EVALUATION_METRIC_DESCRIPTION = Schema( - id=ShapeID("com.amazonaws.bedrock#EvaluationMetricDescription"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -EVALUATION_RATING_METHOD = Schema( - id=ShapeID("com.amazonaws.bedrock#EvaluationRatingMethod"), - shape_type=ShapeType.STRING, -) - -HUMAN_EVALUATION_CUSTOM_METRIC = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#HumanEvaluationCustomMetric"), - members={ - "name": { - "target": EVALUATION_METRIC_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": EVALUATION_METRIC_DESCRIPTION}, - "ratingMethod": { - "target": EVALUATION_RATING_METHOD, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -HUMAN_EVALUATION_CUSTOM_METRICS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#HumanEvaluationCustomMetrics"), - shape_type=ShapeType.LIST, - members={"member": {"target": HUMAN_EVALUATION_CUSTOM_METRIC}}, -) - -SAGE_MAKER_FLOW_DEFINITION_ARN = Schema( - id=ShapeID("com.amazonaws.bedrock#SageMakerFlowDefinitionArn"), - shape_type=ShapeType.STRING, -) - -HUMAN_TASK_INSTRUCTIONS = Schema( - id=ShapeID("com.amazonaws.bedrock#HumanTaskInstructions"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -HUMAN_WORKFLOW_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#HumanWorkflowConfig"), - members={ - "flowDefinitionArn": { - "target": SAGE_MAKER_FLOW_DEFINITION_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "instructions": {"target": HUMAN_TASK_INSTRUCTIONS}, - }, -) - -HUMAN_EVALUATION_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#HumanEvaluationConfig"), - members={ - "humanWorkflowConfig": {"target": HUMAN_WORKFLOW_CONFIG}, - "customMetrics": {"target": HUMAN_EVALUATION_CUSTOM_METRICS}, - "datasetMetricConfigs": { - "target": EVALUATION_DATASET_METRIC_CONFIGS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -EVALUATION_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#EvaluationConfig"), - shape_type=ShapeType.UNION, - members={ - "automated": {"target": AUTOMATED_EVALUATION_CONFIG}, - "human": {"target": HUMAN_EVALUATION_CONFIG}, - }, -) - -EVALUATION_MODEL_INFERENCE_PARAMS = Schema( - id=ShapeID("com.amazonaws.bedrock#EvaluationModelInferenceParams"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -EVALUATION_BEDROCK_MODEL_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrock#EvaluationBedrockModelIdentifier"), - shape_type=ShapeType.STRING, -) - -PERFORMANCE_CONFIG_LATENCY = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#PerformanceConfigLatency"), - shape_type=ShapeType.ENUM, - members={"STANDARD": {"target": UNIT}, "OPTIMIZED": {"target": UNIT}}, -) - -PERFORMANCE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#PerformanceConfiguration"), - members={"latency": {"target": PERFORMANCE_CONFIG_LATENCY}}, -) - -EVALUATION_BEDROCK_MODEL = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#EvaluationBedrockModel"), - members={ - "modelIdentifier": { - "target": EVALUATION_BEDROCK_MODEL_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "inferenceParams": { - "target": EVALUATION_MODEL_INFERENCE_PARAMS, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value="{}")], - }, - "performanceConfig": {"target": PERFORMANCE_CONFIGURATION}, - }, -) - -EVALUATION_PRECOMPUTED_INFERENCE_SOURCE_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrock#EvaluationPrecomputedInferenceSourceIdentifier"), - shape_type=ShapeType.STRING, -) - -EVALUATION_PRECOMPUTED_INFERENCE_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#EvaluationPrecomputedInferenceSource"), - members={ - "inferenceSourceIdentifier": { - "target": EVALUATION_PRECOMPUTED_INFERENCE_SOURCE_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -EVALUATION_MODEL_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#EvaluationModelConfig"), - shape_type=ShapeType.UNION, - members={ - "bedrockModel": {"target": EVALUATION_BEDROCK_MODEL}, - "precomputedInferenceSource": { - "target": EVALUATION_PRECOMPUTED_INFERENCE_SOURCE - }, - }, -) - -EVALUATION_MODEL_CONFIGS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#EvaluationModelConfigs"), - shape_type=ShapeType.LIST, - members={"member": {"target": EVALUATION_MODEL_CONFIG}}, -) - -GUARDRAIL_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailConfiguration"), - members={ - "guardrailId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "guardrailVersion": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -MAX_TOKENS = Schema( - id=ShapeID("com.amazonaws.bedrock#MaxTokens"), shape_type=ShapeType.INTEGER -) - -RAG_STOP_SEQUENCES = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#RAGStopSequences"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, -) - -TEMPERATURE = Schema( - id=ShapeID("com.amazonaws.bedrock#Temperature"), shape_type=ShapeType.FLOAT -) - -TOP_P = Schema(id=ShapeID("com.amazonaws.bedrock#TopP"), shape_type=ShapeType.FLOAT) - -TEXT_INFERENCE_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#TextInferenceConfig"), - members={ - "temperature": {"target": TEMPERATURE}, - "topP": {"target": TOP_P}, - "maxTokens": {"target": MAX_TOKENS}, - "stopSequences": {"target": RAG_STOP_SEQUENCES}, - }, -) - -KB_INFERENCE_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#KbInferenceConfig"), - members={"textInferenceConfig": {"target": TEXT_INFERENCE_CONFIG}}, -) - -TEXT_PROMPT_TEMPLATE = Schema( - id=ShapeID("com.amazonaws.bedrock#TextPromptTemplate"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -PROMPT_TEMPLATE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#PromptTemplate"), - members={"textPromptTemplate": {"target": TEXT_PROMPT_TEMPLATE}}, -) - -EXTERNAL_SOURCES_GENERATION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ExternalSourcesGenerationConfiguration"), - members={ - "promptTemplate": {"target": PROMPT_TEMPLATE}, - "guardrailConfiguration": {"target": GUARDRAIL_CONFIGURATION}, - "kbInferenceConfig": {"target": KB_INFERENCE_CONFIG}, - "additionalModelRequestFields": {"target": ADDITIONAL_MODEL_REQUEST_FIELDS}, - }, -) - -BEDROCK_MODEL_ARN = Schema( - id=ShapeID("com.amazonaws.bedrock#BedrockModelArn"), shape_type=ShapeType.STRING -) - -CONTENT_TYPE = Schema( - id=ShapeID("com.amazonaws.bedrock#ContentType"), shape_type=ShapeType.STRING -) - -BYTE_CONTENT_BLOB = Schema( - id=ShapeID("com.amazonaws.bedrock#ByteContentBlob"), - shape_type=ShapeType.BLOB, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrock#Identifier"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -BYTE_CONTENT_DOC = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ByteContentDoc"), - members={ - "identifier": { - "target": IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "contentType": { - "target": CONTENT_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "data": { - "target": BYTE_CONTENT_BLOB, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -K_BS3_URI = Schema( - id=ShapeID("com.amazonaws.bedrock#kBS3Uri"), shape_type=ShapeType.STRING -) - -S3_OBJECT_DOC = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#S3ObjectDoc"), - members={ - "uri": { - "target": K_BS3_URI, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -EXTERNAL_SOURCE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ExternalSourceType"), - shape_type=ShapeType.ENUM, - members={"S3": {"target": UNIT}, "BYTE_CONTENT": {"target": UNIT}}, -) - -EXTERNAL_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ExternalSource"), - members={ - "sourceType": { - "target": EXTERNAL_SOURCE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "s3Location": {"target": S3_OBJECT_DOC}, - "byteContent": {"target": BYTE_CONTENT_DOC}, - }, -) - -EXTERNAL_SOURCES = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ExternalSources"), - shape_type=ShapeType.LIST, - members={"member": {"target": EXTERNAL_SOURCE}}, -) - -EXTERNAL_SOURCES_RETRIEVE_AND_GENERATE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ExternalSourcesRetrieveAndGenerateConfiguration"), - members={ - "modelArn": { - "target": BEDROCK_MODEL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "sources": { - "target": EXTERNAL_SOURCES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "generationConfiguration": { - "target": EXTERNAL_SOURCES_GENERATION_CONFIGURATION - }, - }, -) - -GENERATION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GenerationConfiguration"), - members={ - "promptTemplate": {"target": PROMPT_TEMPLATE}, - "guardrailConfiguration": {"target": GUARDRAIL_CONFIGURATION}, - "kbInferenceConfig": {"target": KB_INFERENCE_CONFIG}, - "additionalModelRequestFields": {"target": ADDITIONAL_MODEL_REQUEST_FIELDS}, - }, -) - -KNOWLEDGE_BASE_ID = Schema( - id=ShapeID("com.amazonaws.bedrock#KnowledgeBaseId"), shape_type=ShapeType.STRING -) - -QUERY_TRANSFORMATION_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#QueryTransformationType"), - shape_type=ShapeType.ENUM, - members={"QUERY_DECOMPOSITION": {"target": UNIT}}, -) - -QUERY_TRANSFORMATION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#QueryTransformationConfiguration"), - members={ - "type": { - "target": QUERY_TRANSFORMATION_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -ORCHESTRATION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#OrchestrationConfiguration"), - members={ - "queryTransformationConfiguration": { - "target": QUERY_TRANSFORMATION_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -FILTER_KEY = Schema( - id=ShapeID("com.amazonaws.bedrock#FilterKey"), shape_type=ShapeType.STRING -) - -FILTER_VALUE = Schema( - id=ShapeID("com.amazonaws.bedrock#FilterValue"), shape_type=ShapeType.DOCUMENT -) - -FILTER_ATTRIBUTE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#FilterAttribute"), - members={ - "key": { - "target": FILTER_KEY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "value": { - "target": FILTER_VALUE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -ATTRIBUTE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AttributeType"), - shape_type=ShapeType.ENUM, - members={ - "STRING": {"target": UNIT}, - "NUMBER": {"target": UNIT}, - "BOOLEAN": {"target": UNIT}, - "STRING_LIST": {"target": UNIT}, - }, -) - -METADATA_ATTRIBUTE_SCHEMA = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#MetadataAttributeSchema"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "key": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "type": { - "target": ATTRIBUTE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -METADATA_ATTRIBUTE_SCHEMA_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#MetadataAttributeSchemaList"), - shape_type=ShapeType.LIST, - members={"member": {"target": METADATA_ATTRIBUTE_SCHEMA}}, -) - -IMPLICIT_FILTER_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ImplicitFilterConfiguration"), - members={ - "metadataAttributes": { - "target": METADATA_ATTRIBUTE_SCHEMA_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelArn": { - "target": BEDROCK_MODEL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -SEARCH_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#SearchType"), - shape_type=ShapeType.ENUM, - members={"HYBRID": {"target": UNIT}, "SEMANTIC": {"target": UNIT}}, -) - -RERANKING_METADATA_SELECTION_MODE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#RerankingMetadataSelectionMode"), - shape_type=ShapeType.ENUM, - members={"SELECTIVE": {"target": UNIT}, "ALL": {"target": UNIT}}, -) - -FIELD_FOR_RERANKING = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#FieldForReranking"), - members={ - "fieldName": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -FIELDS_FOR_RERANKING = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#FieldsForReranking"), - shape_type=ShapeType.LIST, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"member": {"target": FIELD_FOR_RERANKING}}, -) - -RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#RerankingMetadataSelectiveModeConfiguration"), - shape_type=ShapeType.UNION, - members={ - "fieldsToInclude": {"target": FIELDS_FOR_RERANKING}, - "fieldsToExclude": {"target": FIELDS_FOR_RERANKING}, - }, -) - -METADATA_CONFIGURATION_FOR_RERANKING = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#MetadataConfigurationForReranking"), - members={ - "selectionMode": { - "target": RERANKING_METADATA_SELECTION_MODE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "selectiveModeConfiguration": { - "target": RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION - }, - }, -) - -BEDROCK_RERANKING_MODEL_ARN = Schema( - id=ShapeID("com.amazonaws.bedrock#BedrockRerankingModelArn"), - shape_type=ShapeType.STRING, -) - -VECTOR_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#VectorSearchBedrockRerankingModelConfiguration"), - members={ - "modelArn": { - "target": BEDROCK_RERANKING_MODEL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "additionalModelRequestFields": {"target": ADDITIONAL_MODEL_REQUEST_FIELDS}, - }, -) - -VECTOR_SEARCH_BEDROCK_RERANKING_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#VectorSearchBedrockRerankingConfiguration"), - members={ - "modelConfiguration": { - "target": VECTOR_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "numberOfRerankedResults": {"target": INTEGER}, - "metadataConfiguration": {"target": METADATA_CONFIGURATION_FOR_RERANKING}, - }, -) - -VECTOR_SEARCH_RERANKING_CONFIGURATION_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#VectorSearchRerankingConfigurationType"), - shape_type=ShapeType.ENUM, - members={"BEDROCK_RERANKING_MODEL": {"target": UNIT}}, -) - -VECTOR_SEARCH_RERANKING_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#VectorSearchRerankingConfiguration"), - members={ - "type": { - "target": VECTOR_SEARCH_RERANKING_CONFIGURATION_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "bedrockRerankingConfiguration": { - "target": VECTOR_SEARCH_BEDROCK_RERANKING_CONFIGURATION - }, - }, -) - -RETRIEVE_AND_GENERATE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#RetrieveAndGenerateType"), - shape_type=ShapeType.ENUM, - members={"KNOWLEDGE_BASE": {"target": UNIT}, "EXTERNAL_SOURCES": {"target": UNIT}}, -) - -EVALUATION_PRECOMPUTED_RAG_SOURCE_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrock#EvaluationPrecomputedRagSourceIdentifier"), - shape_type=ShapeType.STRING, -) - -EVALUATION_PRECOMPUTED_RETRIEVE_AND_GENERATE_SOURCE_CONFIG = Schema.collection( - id=ShapeID( - "com.amazonaws.bedrock#EvaluationPrecomputedRetrieveAndGenerateSourceConfig" - ), - members={ - "ragSourceIdentifier": { - "target": EVALUATION_PRECOMPUTED_RAG_SOURCE_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -EVALUATION_PRECOMPUTED_RETRIEVE_SOURCE_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#EvaluationPrecomputedRetrieveSourceConfig"), - members={ - "ragSourceIdentifier": { - "target": EVALUATION_PRECOMPUTED_RAG_SOURCE_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -EVALUATION_PRECOMPUTED_RAG_SOURCE_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#EvaluationPrecomputedRagSourceConfig"), - shape_type=ShapeType.UNION, - members={ - "retrieveSourceConfig": { - "target": EVALUATION_PRECOMPUTED_RETRIEVE_SOURCE_CONFIG - }, - "retrieveAndGenerateSourceConfig": { - "target": EVALUATION_PRECOMPUTED_RETRIEVE_AND_GENERATE_SOURCE_CONFIG - }, - }, -) - -EVALUATION_JOB_DESCRIPTION = Schema( - id=ShapeID("com.amazonaws.bedrock#EvaluationJobDescription"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -EVALUATION_JOB_NAME = Schema( - id=ShapeID("com.amazonaws.bedrock#EvaluationJobName"), shape_type=ShapeType.STRING -) - -EVALUATION_OUTPUT_DATA_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#EvaluationOutputDataConfig"), - members={ - "s3Uri": { - "target": S3_URI, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -EVALUATION_JOB_ARN = Schema( - id=ShapeID("com.amazonaws.bedrock#EvaluationJobArn"), shape_type=ShapeType.STRING -) - -CREATE_EVALUATION_JOB_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CreateEvaluationJobOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#CreateEvaluationJobResponse", - ) - ], - members={ - "jobArn": { - "target": EVALUATION_JOB_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -GET_EVALUATION_JOB_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetEvaluationJobInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetEvaluationJobRequest", - ) - ], - members={ - "jobIdentifier": { - "target": EVALUATION_JOB_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -ERROR_MESSAGES = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ErrorMessages"), - shape_type=ShapeType.LIST, - members={"member": {"target": ERROR_MESSAGE}}, -) - -EVALUATION_JOB_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#EvaluationJobType"), - shape_type=ShapeType.ENUM, - members={"HUMAN": {"target": UNIT}, "AUTOMATED": {"target": UNIT}}, -) - -LIST_EVALUATION_JOBS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ListEvaluationJobsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#ListEvaluationJobsRequest", - ) - ], - members={ - "creationTimeAfter": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="creationTimeAfter") - ], - }, - "creationTimeBefore": { - "target": TIMESTAMP, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpQuery"), value="creationTimeBefore" - ) - ], - }, - "statusEquals": { - "target": EVALUATION_JOB_STATUS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="statusEquals") - ], - }, - "applicationTypeEquals": { - "target": APPLICATION_TYPE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpQuery"), value="applicationTypeEquals" - ) - ], - }, - "nameContains": { - "target": EVALUATION_JOB_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nameContains") - ], - }, - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "nextToken": { - "target": PAGINATION_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "sortBy": { - "target": SORT_JOBS_BY, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="sortBy")], - }, - "sortOrder": { - "target": SORT_ORDER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="sortOrder") - ], - }, - }, -) - -EVALUATOR_MODEL_IDENTIFIERS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#EvaluatorModelIdentifiers"), - shape_type=ShapeType.LIST, - members={"member": {"target": EVALUATOR_MODEL_IDENTIFIER}}, -) - -EVALUATION_TASK_TYPES = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#EvaluationTaskTypes"), - shape_type=ShapeType.LIST, - members={"member": {"target": EVALUATION_TASK_TYPE}}, -) - -EVALUATION_BEDROCK_MODEL_IDENTIFIERS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#EvaluationBedrockModelIdentifiers"), - shape_type=ShapeType.LIST, - members={"member": {"target": EVALUATION_BEDROCK_MODEL_IDENTIFIER}}, -) - -EVALUATION_PRECOMPUTED_INFERENCE_SOURCE_IDENTIFIERS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#EvaluationPrecomputedInferenceSourceIdentifiers"), - shape_type=ShapeType.LIST, - members={"member": {"target": EVALUATION_PRECOMPUTED_INFERENCE_SOURCE_IDENTIFIER}}, -) - -EVALUATION_MODEL_CONFIG_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#EvaluationModelConfigSummary"), - members={ - "bedrockModelIdentifiers": {"target": EVALUATION_BEDROCK_MODEL_IDENTIFIERS}, - "precomputedInferenceSourceIdentifiers": { - "target": EVALUATION_PRECOMPUTED_INFERENCE_SOURCE_IDENTIFIERS - }, - }, -) - -EVALUATION_BEDROCK_KNOWLEDGE_BASE_IDENTIFIERS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#EvaluationBedrockKnowledgeBaseIdentifiers"), - shape_type=ShapeType.LIST, - members={"member": {"target": KNOWLEDGE_BASE_ID}}, -) - -EVALUATION_PRECOMPUTED_RAG_SOURCE_IDENTIFIERS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#EvaluationPrecomputedRagSourceIdentifiers"), - shape_type=ShapeType.LIST, - members={"member": {"target": EVALUATION_PRECOMPUTED_RAG_SOURCE_IDENTIFIER}}, -) - -EVALUATION_RAG_CONFIG_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#EvaluationRagConfigSummary"), - members={ - "bedrockKnowledgeBaseIdentifiers": { - "target": EVALUATION_BEDROCK_KNOWLEDGE_BASE_IDENTIFIERS - }, - "precomputedRagSourceIdentifiers": { - "target": EVALUATION_PRECOMPUTED_RAG_SOURCE_IDENTIFIERS - }, - }, -) - -EVALUATION_INFERENCE_CONFIG_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#EvaluationInferenceConfigSummary"), - members={ - "modelConfigSummary": {"target": EVALUATION_MODEL_CONFIG_SUMMARY}, - "ragConfigSummary": {"target": EVALUATION_RAG_CONFIG_SUMMARY}, - }, -) - -EVALUATION_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#EvaluationSummary"), - members={ - "jobArn": { - "target": EVALUATION_JOB_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "jobName": { - "target": EVALUATION_JOB_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": EVALUATION_JOB_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "creationTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "jobType": { - "target": EVALUATION_JOB_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "evaluationTaskTypes": { - "target": EVALUATION_TASK_TYPES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelIdentifiers": { - "target": EVALUATION_BEDROCK_MODEL_IDENTIFIERS, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=())], - }, - "ragIdentifiers": {"target": EVALUATION_BEDROCK_KNOWLEDGE_BASE_IDENTIFIERS}, - "evaluatorModelIdentifiers": {"target": EVALUATOR_MODEL_IDENTIFIERS}, - "customMetricsEvaluatorModelIdentifiers": { - "target": EVALUATOR_MODEL_IDENTIFIERS - }, - "inferenceConfigSummary": {"target": EVALUATION_INFERENCE_CONFIG_SUMMARY}, - "applicationType": {"target": APPLICATION_TYPE}, - }, -) - -EVALUATION_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#EvaluationSummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": EVALUATION_SUMMARY}}, -) - -LIST_EVALUATION_JOBS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ListEvaluationJobsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#ListEvaluationJobsResponse", - ) - ], - members={ - "nextToken": {"target": PAGINATION_TOKEN}, - "jobSummaries": {"target": EVALUATION_SUMMARIES}, - }, -) - -LIST_EVALUATION_JOBS = Schema( - id=ShapeID("com.amazonaws.bedrock#ListEvaluationJobs"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "GET", "uri": "/evaluation-jobs"} - ), - ) - ], -) - -STOP_EVALUATION_JOB_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#StopEvaluationJobInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#StopEvaluationJobRequest", - ) - ], - members={ - "jobIdentifier": { - "target": EVALUATION_JOB_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -STOP_EVALUATION_JOB_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#StopEvaluationJobOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#StopEvaluationJobResponse", - ) - ], -) - -STOP_EVALUATION_JOB = Schema( - id=ShapeID("com.amazonaws.bedrock#StopEvaluationJob"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "POST", - "uri": "/evaluation-job/{jobIdentifier}/stop", - } - ), - ) - ], -) - -AUTOMATED_REASONING_CONFIDENCE_FILTER_THRESHOLD = Schema( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningConfidenceFilterThreshold"), - shape_type=ShapeType.DOUBLE, -) - -AUTOMATED_REASONING_POLICY_ARN_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AutomatedReasoningPolicyArnList"), - shape_type=ShapeType.LIST, - members={"member": {"target": AUTOMATED_REASONING_POLICY_ARN}}, -) - -GUARDRAIL_AUTOMATED_REASONING_POLICY_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailAutomatedReasoningPolicyConfig"), - members={ - "policies": { - "target": AUTOMATED_REASONING_POLICY_ARN_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "confidenceThreshold": { - "target": AUTOMATED_REASONING_CONFIDENCE_FILTER_THRESHOLD - }, - }, -) - -GUARDRAIL_BLOCKED_MESSAGING = Schema( - id=ShapeID("com.amazonaws.bedrock#GuardrailBlockedMessaging"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -GUARDRAIL_CONTENT_FILTER_ACTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailContentFilterAction"), - shape_type=ShapeType.ENUM, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"BLOCK": {"target": UNIT}, "NONE": {"target": UNIT}}, -) - -GUARDRAIL_MODALITY = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailModality"), - shape_type=ShapeType.ENUM, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"TEXT": {"target": UNIT}, "IMAGE": {"target": UNIT}}, -) - -GUARDRAIL_MODALITIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailModalities"), - shape_type=ShapeType.LIST, - members={"member": {"target": GUARDRAIL_MODALITY}}, -) - -GUARDRAIL_FILTER_STRENGTH = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailFilterStrength"), - shape_type=ShapeType.ENUM, - members={ - "NONE": {"target": UNIT}, - "LOW": {"target": UNIT}, - "MEDIUM": {"target": UNIT}, - "HIGH": {"target": UNIT}, - }, -) - -GUARDRAIL_CONTENT_FILTER_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailContentFilterType"), - shape_type=ShapeType.ENUM, - members={ - "SEXUAL": {"target": UNIT}, - "VIOLENCE": {"target": UNIT}, - "HATE": {"target": UNIT}, - "INSULTS": {"target": UNIT}, - "MISCONDUCT": {"target": UNIT}, - "PROMPT_ATTACK": {"target": UNIT}, - }, -) - -GUARDRAIL_CONTENT_FILTER_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailContentFilterConfig"), - members={ - "type": { - "target": GUARDRAIL_CONTENT_FILTER_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "inputStrength": { - "target": GUARDRAIL_FILTER_STRENGTH, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "outputStrength": { - "target": GUARDRAIL_FILTER_STRENGTH, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "inputModalities": {"target": GUARDRAIL_MODALITIES}, - "outputModalities": {"target": GUARDRAIL_MODALITIES}, - "inputAction": {"target": GUARDRAIL_CONTENT_FILTER_ACTION}, - "outputAction": {"target": GUARDRAIL_CONTENT_FILTER_ACTION}, - "inputEnabled": {"target": BOOLEAN}, - "outputEnabled": {"target": BOOLEAN}, - }, -) - -GUARDRAIL_CONTENT_FILTERS_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailContentFiltersConfig"), - shape_type=ShapeType.LIST, - members={"member": {"target": GUARDRAIL_CONTENT_FILTER_CONFIG}}, -) - -GUARDRAIL_CONTENT_FILTERS_TIER_NAME = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailContentFiltersTierName"), - shape_type=ShapeType.ENUM, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"CLASSIC": {"target": UNIT}, "STANDARD": {"target": UNIT}}, -) - -GUARDRAIL_CONTENT_FILTERS_TIER_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailContentFiltersTierConfig"), - members={ - "tierName": { - "target": GUARDRAIL_CONTENT_FILTERS_TIER_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -GUARDRAIL_CONTENT_POLICY_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailContentPolicyConfig"), - members={ - "filtersConfig": { - "target": GUARDRAIL_CONTENT_FILTERS_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "tierConfig": {"target": GUARDRAIL_CONTENT_FILTERS_TIER_CONFIG}, - }, -) - -GUARDRAIL_CONTEXTUAL_GROUNDING_ACTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailContextualGroundingAction"), - shape_type=ShapeType.ENUM, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"BLOCK": {"target": UNIT}, "NONE": {"target": UNIT}}, -) - -GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailContextualGroundingFilterType"), - shape_type=ShapeType.ENUM, - members={"GROUNDING": {"target": UNIT}, "RELEVANCE": {"target": UNIT}}, -) - -GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailContextualGroundingFilterConfig"), - members={ - "type": { - "target": GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "threshold": { - "target": DOUBLE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "action": {"target": GUARDRAIL_CONTEXTUAL_GROUNDING_ACTION}, - "enabled": {"target": BOOLEAN}, - }, -) - -GUARDRAIL_CONTEXTUAL_GROUNDING_FILTERS_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailContextualGroundingFiltersConfig"), - shape_type=ShapeType.LIST, - members={"member": {"target": GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER_CONFIG}}, -) - -GUARDRAIL_CONTEXTUAL_GROUNDING_POLICY_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailContextualGroundingPolicyConfig"), - members={ - "filtersConfig": { - "target": GUARDRAIL_CONTEXTUAL_GROUNDING_FILTERS_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -GUARDRAIL_CROSS_REGION_GUARDRAIL_PROFILE_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrock#GuardrailCrossRegionGuardrailProfileIdentifier"), - shape_type=ShapeType.STRING, -) - -GUARDRAIL_CROSS_REGION_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailCrossRegionConfig"), - members={ - "guardrailProfileIdentifier": { - "target": GUARDRAIL_CROSS_REGION_GUARDRAIL_PROFILE_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -GUARDRAIL_DESCRIPTION = Schema( - id=ShapeID("com.amazonaws.bedrock#GuardrailDescription"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -GUARDRAIL_NAME = Schema( - id=ShapeID("com.amazonaws.bedrock#GuardrailName"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -GUARDRAIL_SENSITIVE_INFORMATION_ACTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailSensitiveInformationAction"), - shape_type=ShapeType.ENUM, - members={ - "BLOCK": {"target": UNIT}, - "ANONYMIZE": {"target": UNIT}, - "NONE": {"target": UNIT}, - }, -) - -GUARDRAIL_PII_ENTITY_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailPiiEntityType"), - shape_type=ShapeType.ENUM, - members={ - "ADDRESS": {"target": UNIT}, - "AGE": {"target": UNIT}, - "AWS_ACCESS_KEY": {"target": UNIT}, - "AWS_SECRET_KEY": {"target": UNIT}, - "CA_HEALTH_NUMBER": {"target": UNIT}, - "CA_SOCIAL_INSURANCE_NUMBER": {"target": UNIT}, - "CREDIT_DEBIT_CARD_CVV": {"target": UNIT}, - "CREDIT_DEBIT_CARD_EXPIRY": {"target": UNIT}, - "CREDIT_DEBIT_CARD_NUMBER": {"target": UNIT}, - "DRIVER_ID": {"target": UNIT}, - "EMAIL": {"target": UNIT}, - "INTERNATIONAL_BANK_ACCOUNT_NUMBER": {"target": UNIT}, - "IP_ADDRESS": {"target": UNIT}, - "LICENSE_PLATE": {"target": UNIT}, - "MAC_ADDRESS": {"target": UNIT}, - "NAME": {"target": UNIT}, - "PASSWORD": {"target": UNIT}, - "PHONE": {"target": UNIT}, - "PIN": {"target": UNIT}, - "SWIFT_CODE": {"target": UNIT}, - "UK_NATIONAL_HEALTH_SERVICE_NUMBER": {"target": UNIT}, - "UK_NATIONAL_INSURANCE_NUMBER": {"target": UNIT}, - "UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER": {"target": UNIT}, - "URL": {"target": UNIT}, - "USERNAME": {"target": UNIT}, - "US_BANK_ACCOUNT_NUMBER": {"target": UNIT}, - "US_BANK_ROUTING_NUMBER": {"target": UNIT}, - "US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER": {"target": UNIT}, - "US_PASSPORT_NUMBER": {"target": UNIT}, - "US_SOCIAL_SECURITY_NUMBER": {"target": UNIT}, - "VEHICLE_IDENTIFICATION_NUMBER": {"target": UNIT}, - }, -) - -GUARDRAIL_PII_ENTITY_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailPiiEntityConfig"), - members={ - "type": { - "target": GUARDRAIL_PII_ENTITY_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "action": { - "target": GUARDRAIL_SENSITIVE_INFORMATION_ACTION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "inputAction": {"target": GUARDRAIL_SENSITIVE_INFORMATION_ACTION}, - "outputAction": {"target": GUARDRAIL_SENSITIVE_INFORMATION_ACTION}, - "inputEnabled": {"target": BOOLEAN}, - "outputEnabled": {"target": BOOLEAN}, - }, -) - -GUARDRAIL_PII_ENTITIES_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailPiiEntitiesConfig"), - shape_type=ShapeType.LIST, - members={"member": {"target": GUARDRAIL_PII_ENTITY_CONFIG}}, -) - -GUARDRAIL_REGEX_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailRegexConfig"), - members={ - "name": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": STRING}, - "pattern": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "action": { - "target": GUARDRAIL_SENSITIVE_INFORMATION_ACTION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "inputAction": {"target": GUARDRAIL_SENSITIVE_INFORMATION_ACTION}, - "outputAction": {"target": GUARDRAIL_SENSITIVE_INFORMATION_ACTION}, - "inputEnabled": {"target": BOOLEAN}, - "outputEnabled": {"target": BOOLEAN}, - }, -) - -GUARDRAIL_REGEXES_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailRegexesConfig"), - shape_type=ShapeType.LIST, - members={"member": {"target": GUARDRAIL_REGEX_CONFIG}}, -) - -GUARDRAIL_SENSITIVE_INFORMATION_POLICY_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailSensitiveInformationPolicyConfig"), - members={ - "piiEntitiesConfig": {"target": GUARDRAIL_PII_ENTITIES_CONFIG}, - "regexesConfig": {"target": GUARDRAIL_REGEXES_CONFIG}, - }, -) - -GUARDRAIL_TOPICS_TIER_NAME = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailTopicsTierName"), - shape_type=ShapeType.ENUM, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"CLASSIC": {"target": UNIT}, "STANDARD": {"target": UNIT}}, -) - -GUARDRAIL_TOPICS_TIER_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailTopicsTierConfig"), - members={ - "tierName": { - "target": GUARDRAIL_TOPICS_TIER_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -GUARDRAIL_TOPIC_DEFINITION = Schema( - id=ShapeID("com.amazonaws.bedrock#GuardrailTopicDefinition"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -GUARDRAIL_TOPIC_EXAMPLE = Schema( - id=ShapeID("com.amazonaws.bedrock#GuardrailTopicExample"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -GUARDRAIL_TOPIC_EXAMPLES = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailTopicExamples"), - shape_type=ShapeType.LIST, - members={"member": {"target": GUARDRAIL_TOPIC_EXAMPLE}}, -) - -GUARDRAIL_TOPIC_ACTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailTopicAction"), - shape_type=ShapeType.ENUM, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"BLOCK": {"target": UNIT}, "NONE": {"target": UNIT}}, -) - -GUARDRAIL_TOPIC_NAME = Schema( - id=ShapeID("com.amazonaws.bedrock#GuardrailTopicName"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -GUARDRAIL_TOPIC_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailTopicType"), - shape_type=ShapeType.ENUM, - members={"DENY": {"target": UNIT}}, -) - -GUARDRAIL_TOPIC_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailTopicConfig"), - members={ - "name": { - "target": GUARDRAIL_TOPIC_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "definition": { - "target": GUARDRAIL_TOPIC_DEFINITION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "examples": {"target": GUARDRAIL_TOPIC_EXAMPLES}, - "type": { - "target": GUARDRAIL_TOPIC_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "inputAction": {"target": GUARDRAIL_TOPIC_ACTION}, - "outputAction": {"target": GUARDRAIL_TOPIC_ACTION}, - "inputEnabled": {"target": BOOLEAN}, - "outputEnabled": {"target": BOOLEAN}, - }, -) - -GUARDRAIL_TOPICS_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailTopicsConfig"), - shape_type=ShapeType.LIST, - members={"member": {"target": GUARDRAIL_TOPIC_CONFIG}}, -) - -GUARDRAIL_TOPIC_POLICY_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailTopicPolicyConfig"), - members={ - "topicsConfig": { - "target": GUARDRAIL_TOPICS_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "tierConfig": {"target": GUARDRAIL_TOPICS_TIER_CONFIG}, - }, -) - -GUARDRAIL_WORD_ACTION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailWordAction"), - shape_type=ShapeType.ENUM, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={"BLOCK": {"target": UNIT}, "NONE": {"target": UNIT}}, -) - -GUARDRAIL_MANAGED_WORDS_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailManagedWordsType"), - shape_type=ShapeType.ENUM, - members={"PROFANITY": {"target": UNIT}}, -) - -GUARDRAIL_MANAGED_WORDS_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailManagedWordsConfig"), - members={ - "type": { - "target": GUARDRAIL_MANAGED_WORDS_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "inputAction": {"target": GUARDRAIL_WORD_ACTION}, - "outputAction": {"target": GUARDRAIL_WORD_ACTION}, - "inputEnabled": {"target": BOOLEAN}, - "outputEnabled": {"target": BOOLEAN}, - }, -) - -GUARDRAIL_MANAGED_WORD_LISTS_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailManagedWordListsConfig"), - shape_type=ShapeType.LIST, - members={"member": {"target": GUARDRAIL_MANAGED_WORDS_CONFIG}}, -) - -GUARDRAIL_WORD_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailWordConfig"), - members={ - "text": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "inputAction": {"target": GUARDRAIL_WORD_ACTION}, - "outputAction": {"target": GUARDRAIL_WORD_ACTION}, - "inputEnabled": {"target": BOOLEAN}, - "outputEnabled": {"target": BOOLEAN}, - }, -) - -GUARDRAIL_WORDS_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailWordsConfig"), - shape_type=ShapeType.LIST, - members={"member": {"target": GUARDRAIL_WORD_CONFIG}}, -) - -GUARDRAIL_WORD_POLICY_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailWordPolicyConfig"), - members={ - "wordsConfig": {"target": GUARDRAIL_WORDS_CONFIG}, - "managedWordListsConfig": {"target": GUARDRAIL_MANAGED_WORD_LISTS_CONFIG}, - }, -) - -CREATE_GUARDRAIL_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CreateGuardrailInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#CreateGuardrailRequest", - ) - ], - members={ - "name": { - "target": GUARDRAIL_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": GUARDRAIL_DESCRIPTION}, - "topicPolicyConfig": {"target": GUARDRAIL_TOPIC_POLICY_CONFIG}, - "contentPolicyConfig": {"target": GUARDRAIL_CONTENT_POLICY_CONFIG}, - "wordPolicyConfig": {"target": GUARDRAIL_WORD_POLICY_CONFIG}, - "sensitiveInformationPolicyConfig": { - "target": GUARDRAIL_SENSITIVE_INFORMATION_POLICY_CONFIG - }, - "contextualGroundingPolicyConfig": { - "target": GUARDRAIL_CONTEXTUAL_GROUNDING_POLICY_CONFIG - }, - "automatedReasoningPolicyConfig": { - "target": GUARDRAIL_AUTOMATED_REASONING_POLICY_CONFIG - }, - "crossRegionConfig": {"target": GUARDRAIL_CROSS_REGION_CONFIG}, - "blockedInputMessaging": { - "target": GUARDRAIL_BLOCKED_MESSAGING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "blockedOutputsMessaging": { - "target": GUARDRAIL_BLOCKED_MESSAGING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "kmsKeyId": {"target": KMS_KEY_ID}, - "tags": {"target": TAG_LIST}, - "clientRequestToken": { - "target": IDEMPOTENCY_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - }, -) - -GUARDRAIL_DRAFT_VERSION = Schema( - id=ShapeID("com.amazonaws.bedrock#GuardrailDraftVersion"), - shape_type=ShapeType.STRING, -) - -CREATE_GUARDRAIL_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CreateGuardrailOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#CreateGuardrailResponse", - ) - ], - members={ - "guardrailId": { - "target": GUARDRAIL_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "guardrailArn": { - "target": GUARDRAIL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "version": { - "target": GUARDRAIL_DRAFT_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -CREATE_GUARDRAIL = Schema( - id=ShapeID("com.amazonaws.bedrock#CreateGuardrail"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 202, "method": "POST", "uri": "/guardrails"} - ), - ) - ], -) - -CREATE_GUARDRAIL_VERSION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CreateGuardrailVersionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#CreateGuardrailVersionRequest", - ) - ], - members={ - "guardrailIdentifier": { - "target": GUARDRAIL_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "description": {"target": GUARDRAIL_DESCRIPTION}, - "clientRequestToken": { - "target": IDEMPOTENCY_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - }, -) - -CREATE_GUARDRAIL_VERSION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CreateGuardrailVersionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#CreateGuardrailVersionResponse", - ) - ], - members={ - "guardrailId": { - "target": GUARDRAIL_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "version": { - "target": GUARDRAIL_NUMERICAL_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -CREATE_GUARDRAIL_VERSION = Schema( - id=ShapeID("com.amazonaws.bedrock#CreateGuardrailVersion"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 202, - "method": "POST", - "uri": "/guardrails/{guardrailIdentifier}", - } - ), - ) - ], -) - -DELETE_GUARDRAIL_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#DeleteGuardrailInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#DeleteGuardrailRequest", - ) - ], - members={ - "guardrailIdentifier": { - "target": GUARDRAIL_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "guardrailVersion": { - "target": GUARDRAIL_NUMERICAL_VERSION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="guardrailVersion") - ], - }, - }, -) - -DELETE_GUARDRAIL_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#DeleteGuardrailOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#DeleteGuardrailResponse", - ) - ], -) - -DELETE_GUARDRAIL = Schema( - id=ShapeID("com.amazonaws.bedrock#DeleteGuardrail"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 202, - "method": "DELETE", - "uri": "/guardrails/{guardrailIdentifier}", - } - ), - ) - ], -) - -GUARDRAIL_VERSION = Schema( - id=ShapeID("com.amazonaws.bedrock#GuardrailVersion"), shape_type=ShapeType.STRING -) - -GET_GUARDRAIL_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetGuardrailInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetGuardrailRequest", - ) - ], - members={ - "guardrailIdentifier": { - "target": GUARDRAIL_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "guardrailVersion": { - "target": GUARDRAIL_VERSION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="guardrailVersion") - ], - }, - }, -) - -GUARDRAIL_AUTOMATED_REASONING_POLICY = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailAutomatedReasoningPolicy"), - members={ - "policies": { - "target": AUTOMATED_REASONING_POLICY_ARN_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "confidenceThreshold": { - "target": AUTOMATED_REASONING_CONFIDENCE_FILTER_THRESHOLD - }, - }, -) - -GUARDRAIL_CONTENT_FILTER = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailContentFilter"), - members={ - "type": { - "target": GUARDRAIL_CONTENT_FILTER_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "inputStrength": { - "target": GUARDRAIL_FILTER_STRENGTH, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "outputStrength": { - "target": GUARDRAIL_FILTER_STRENGTH, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "inputModalities": {"target": GUARDRAIL_MODALITIES}, - "outputModalities": {"target": GUARDRAIL_MODALITIES}, - "inputAction": {"target": GUARDRAIL_CONTENT_FILTER_ACTION}, - "outputAction": {"target": GUARDRAIL_CONTENT_FILTER_ACTION}, - "inputEnabled": {"target": BOOLEAN}, - "outputEnabled": {"target": BOOLEAN}, - }, -) - -GUARDRAIL_CONTENT_FILTERS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailContentFilters"), - shape_type=ShapeType.LIST, - members={"member": {"target": GUARDRAIL_CONTENT_FILTER}}, -) - -GUARDRAIL_CONTENT_FILTERS_TIER = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailContentFiltersTier"), - members={ - "tierName": { - "target": GUARDRAIL_CONTENT_FILTERS_TIER_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -GUARDRAIL_CONTENT_POLICY = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailContentPolicy"), - members={ - "filters": {"target": GUARDRAIL_CONTENT_FILTERS}, - "tier": {"target": GUARDRAIL_CONTENT_FILTERS_TIER}, - }, -) - -GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailContextualGroundingFilter"), - members={ - "type": { - "target": GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "threshold": { - "target": DOUBLE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "action": {"target": GUARDRAIL_CONTEXTUAL_GROUNDING_ACTION}, - "enabled": {"target": BOOLEAN}, - }, -) - -GUARDRAIL_CONTEXTUAL_GROUNDING_FILTERS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailContextualGroundingFilters"), - shape_type=ShapeType.LIST, - members={"member": {"target": GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER}}, -) - -GUARDRAIL_CONTEXTUAL_GROUNDING_POLICY = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailContextualGroundingPolicy"), - members={ - "filters": { - "target": GUARDRAIL_CONTEXTUAL_GROUNDING_FILTERS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -GUARDRAIL_CROSS_REGION_GUARDRAIL_PROFILE_ARN = Schema( - id=ShapeID("com.amazonaws.bedrock#GuardrailCrossRegionGuardrailProfileArn"), - shape_type=ShapeType.STRING, -) - -GUARDRAIL_CROSS_REGION_GUARDRAIL_PROFILE_ID = Schema( - id=ShapeID("com.amazonaws.bedrock#GuardrailCrossRegionGuardrailProfileId"), - shape_type=ShapeType.STRING, -) - -GUARDRAIL_CROSS_REGION_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailCrossRegionDetails"), - members={ - "guardrailProfileId": {"target": GUARDRAIL_CROSS_REGION_GUARDRAIL_PROFILE_ID}, - "guardrailProfileArn": {"target": GUARDRAIL_CROSS_REGION_GUARDRAIL_PROFILE_ARN}, - }, -) - -GUARDRAIL_FAILURE_RECOMMENDATION = Schema( - id=ShapeID("com.amazonaws.bedrock#GuardrailFailureRecommendation"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -GUARDRAIL_FAILURE_RECOMMENDATIONS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailFailureRecommendations"), - shape_type=ShapeType.LIST, - members={"member": {"target": GUARDRAIL_FAILURE_RECOMMENDATION}}, -) - -GUARDRAIL_PII_ENTITY = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailPiiEntity"), - members={ - "type": { - "target": GUARDRAIL_PII_ENTITY_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "action": { - "target": GUARDRAIL_SENSITIVE_INFORMATION_ACTION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "inputAction": {"target": GUARDRAIL_SENSITIVE_INFORMATION_ACTION}, - "outputAction": {"target": GUARDRAIL_SENSITIVE_INFORMATION_ACTION}, - "inputEnabled": {"target": BOOLEAN}, - "outputEnabled": {"target": BOOLEAN}, - }, -) - -GUARDRAIL_PII_ENTITIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailPiiEntities"), - shape_type=ShapeType.LIST, - members={"member": {"target": GUARDRAIL_PII_ENTITY}}, -) - -GUARDRAIL_REGEX = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailRegex"), - members={ - "name": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": STRING}, - "pattern": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "action": { - "target": GUARDRAIL_SENSITIVE_INFORMATION_ACTION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "inputAction": {"target": GUARDRAIL_SENSITIVE_INFORMATION_ACTION}, - "outputAction": {"target": GUARDRAIL_SENSITIVE_INFORMATION_ACTION}, - "inputEnabled": {"target": BOOLEAN}, - "outputEnabled": {"target": BOOLEAN}, - }, -) - -GUARDRAIL_REGEXES = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailRegexes"), - shape_type=ShapeType.LIST, - members={"member": {"target": GUARDRAIL_REGEX}}, -) - -GUARDRAIL_SENSITIVE_INFORMATION_POLICY = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailSensitiveInformationPolicy"), - members={ - "piiEntities": {"target": GUARDRAIL_PII_ENTITIES}, - "regexes": {"target": GUARDRAIL_REGEXES}, - }, -) - -GUARDRAIL_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailStatus"), - shape_type=ShapeType.ENUM, - members={ - "CREATING": {"target": UNIT}, - "UPDATING": {"target": UNIT}, - "VERSIONING": {"target": UNIT}, - "READY": {"target": UNIT}, - "FAILED": {"target": UNIT}, - "DELETING": {"target": UNIT}, - }, -) - -GUARDRAIL_STATUS_REASON = Schema( - id=ShapeID("com.amazonaws.bedrock#GuardrailStatusReason"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -GUARDRAIL_STATUS_REASONS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailStatusReasons"), - shape_type=ShapeType.LIST, - members={"member": {"target": GUARDRAIL_STATUS_REASON}}, -) - -GUARDRAIL_TOPICS_TIER = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailTopicsTier"), - members={ - "tierName": { - "target": GUARDRAIL_TOPICS_TIER_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -GUARDRAIL_TOPIC = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailTopic"), - members={ - "name": { - "target": GUARDRAIL_TOPIC_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "definition": { - "target": GUARDRAIL_TOPIC_DEFINITION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "examples": {"target": GUARDRAIL_TOPIC_EXAMPLES}, - "type": {"target": GUARDRAIL_TOPIC_TYPE}, - "inputAction": {"target": GUARDRAIL_TOPIC_ACTION}, - "outputAction": {"target": GUARDRAIL_TOPIC_ACTION}, - "inputEnabled": {"target": BOOLEAN}, - "outputEnabled": {"target": BOOLEAN}, - }, -) - -GUARDRAIL_TOPICS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailTopics"), - shape_type=ShapeType.LIST, - members={"member": {"target": GUARDRAIL_TOPIC}}, -) - -GUARDRAIL_TOPIC_POLICY = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailTopicPolicy"), - members={ - "topics": { - "target": GUARDRAIL_TOPICS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "tier": {"target": GUARDRAIL_TOPICS_TIER}, - }, -) - -GUARDRAIL_MANAGED_WORDS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailManagedWords"), - members={ - "type": { - "target": GUARDRAIL_MANAGED_WORDS_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "inputAction": {"target": GUARDRAIL_WORD_ACTION}, - "outputAction": {"target": GUARDRAIL_WORD_ACTION}, - "inputEnabled": {"target": BOOLEAN}, - "outputEnabled": {"target": BOOLEAN}, - }, -) - -GUARDRAIL_MANAGED_WORD_LISTS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailManagedWordLists"), - shape_type=ShapeType.LIST, - members={"member": {"target": GUARDRAIL_MANAGED_WORDS}}, -) - -GUARDRAIL_WORD = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailWord"), - members={ - "text": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "inputAction": {"target": GUARDRAIL_WORD_ACTION}, - "outputAction": {"target": GUARDRAIL_WORD_ACTION}, - "inputEnabled": {"target": BOOLEAN}, - "outputEnabled": {"target": BOOLEAN}, - }, -) - -GUARDRAIL_WORDS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailWords"), - shape_type=ShapeType.LIST, - members={"member": {"target": GUARDRAIL_WORD}}, -) - -GUARDRAIL_WORD_POLICY = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailWordPolicy"), - members={ - "words": {"target": GUARDRAIL_WORDS}, - "managedWordLists": {"target": GUARDRAIL_MANAGED_WORD_LISTS}, - }, -) - -GET_GUARDRAIL_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetGuardrailOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetGuardrailResponse", - ) - ], - members={ - "name": { - "target": GUARDRAIL_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": GUARDRAIL_DESCRIPTION}, - "guardrailId": { - "target": GUARDRAIL_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "guardrailArn": { - "target": GUARDRAIL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "version": { - "target": GUARDRAIL_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": GUARDRAIL_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "topicPolicy": {"target": GUARDRAIL_TOPIC_POLICY}, - "contentPolicy": {"target": GUARDRAIL_CONTENT_POLICY}, - "wordPolicy": {"target": GUARDRAIL_WORD_POLICY}, - "sensitiveInformationPolicy": { - "target": GUARDRAIL_SENSITIVE_INFORMATION_POLICY - }, - "contextualGroundingPolicy": {"target": GUARDRAIL_CONTEXTUAL_GROUNDING_POLICY}, - "automatedReasoningPolicy": {"target": GUARDRAIL_AUTOMATED_REASONING_POLICY}, - "crossRegionDetails": {"target": GUARDRAIL_CROSS_REGION_DETAILS}, - "createdAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "statusReasons": {"target": GUARDRAIL_STATUS_REASONS}, - "failureRecommendations": {"target": GUARDRAIL_FAILURE_RECOMMENDATIONS}, - "blockedInputMessaging": { - "target": GUARDRAIL_BLOCKED_MESSAGING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "blockedOutputsMessaging": { - "target": GUARDRAIL_BLOCKED_MESSAGING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "kmsKeyArn": {"target": KMS_KEY_ARN}, - }, -) - -GET_GUARDRAIL = Schema( - id=ShapeID("com.amazonaws.bedrock#GetGuardrail"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/guardrails/{guardrailIdentifier}", - } - ), - ) - ], -) - -LIST_GUARDRAILS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ListGuardrailsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#ListGuardrailsRequest", - ) - ], - members={ - "guardrailIdentifier": { - "target": GUARDRAIL_IDENTIFIER, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpQuery"), value="guardrailIdentifier" - ) - ], - }, - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "nextToken": { - "target": PAGINATION_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - }, -) - -GUARDRAIL_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailSummary"), - members={ - "id": { - "target": GUARDRAIL_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "arn": { - "target": GUARDRAIL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": GUARDRAIL_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": GUARDRAIL_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": GUARDRAIL_DESCRIPTION}, - "version": { - "target": GUARDRAIL_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "crossRegionDetails": {"target": GUARDRAIL_CROSS_REGION_DETAILS}, - }, -) - -GUARDRAIL_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GuardrailSummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": GUARDRAIL_SUMMARY}}, -) - -LIST_GUARDRAILS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ListGuardrailsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#ListGuardrailsResponse", - ) - ], - members={ - "guardrails": { - "target": GUARDRAIL_SUMMARIES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": PAGINATION_TOKEN}, - }, -) - -LIST_GUARDRAILS = Schema( - id=ShapeID("com.amazonaws.bedrock#ListGuardrails"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "GET", "uri": "/guardrails"} - ), - ) - ], -) - -UPDATE_GUARDRAIL_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#UpdateGuardrailInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#UpdateGuardrailRequest", - ) - ], - members={ - "guardrailIdentifier": { - "target": GUARDRAIL_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "name": { - "target": GUARDRAIL_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": GUARDRAIL_DESCRIPTION}, - "topicPolicyConfig": {"target": GUARDRAIL_TOPIC_POLICY_CONFIG}, - "contentPolicyConfig": {"target": GUARDRAIL_CONTENT_POLICY_CONFIG}, - "wordPolicyConfig": {"target": GUARDRAIL_WORD_POLICY_CONFIG}, - "sensitiveInformationPolicyConfig": { - "target": GUARDRAIL_SENSITIVE_INFORMATION_POLICY_CONFIG - }, - "contextualGroundingPolicyConfig": { - "target": GUARDRAIL_CONTEXTUAL_GROUNDING_POLICY_CONFIG - }, - "automatedReasoningPolicyConfig": { - "target": GUARDRAIL_AUTOMATED_REASONING_POLICY_CONFIG - }, - "crossRegionConfig": {"target": GUARDRAIL_CROSS_REGION_CONFIG}, - "blockedInputMessaging": { - "target": GUARDRAIL_BLOCKED_MESSAGING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "blockedOutputsMessaging": { - "target": GUARDRAIL_BLOCKED_MESSAGING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "kmsKeyId": {"target": KMS_KEY_ID}, - }, -) - -UPDATE_GUARDRAIL_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#UpdateGuardrailOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#UpdateGuardrailResponse", - ) - ], - members={ - "guardrailId": { - "target": GUARDRAIL_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "guardrailArn": { - "target": GUARDRAIL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "version": { - "target": GUARDRAIL_DRAFT_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "updatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -UPDATE_GUARDRAIL = Schema( - id=ShapeID("com.amazonaws.bedrock#UpdateGuardrail"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 202, - "method": "PUT", - "uri": "/guardrails/{guardrailIdentifier}", - } - ), - ) - ], -) - -INFERENCE_PROFILE_DESCRIPTION = Schema( - id=ShapeID("com.amazonaws.bedrock#InferenceProfileDescription"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -INFERENCE_PROFILE_NAME = Schema( - id=ShapeID("com.amazonaws.bedrock#InferenceProfileName"), - shape_type=ShapeType.STRING, -) - -INFERENCE_PROFILE_MODEL_SOURCE_ARN = Schema( - id=ShapeID("com.amazonaws.bedrock#InferenceProfileModelSourceArn"), - shape_type=ShapeType.STRING, -) - -INFERENCE_PROFILE_MODEL_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#InferenceProfileModelSource"), - shape_type=ShapeType.UNION, - members={"copyFrom": {"target": INFERENCE_PROFILE_MODEL_SOURCE_ARN}}, -) - -CREATE_INFERENCE_PROFILE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CreateInferenceProfileInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#CreateInferenceProfileRequest", - ) - ], - members={ - "inferenceProfileName": { - "target": INFERENCE_PROFILE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": INFERENCE_PROFILE_DESCRIPTION}, - "clientRequestToken": { - "target": IDEMPOTENCY_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "modelSource": { - "target": INFERENCE_PROFILE_MODEL_SOURCE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "tags": {"target": TAG_LIST}, - }, -) - -INFERENCE_PROFILE_ARN = Schema( - id=ShapeID("com.amazonaws.bedrock#InferenceProfileArn"), shape_type=ShapeType.STRING -) - -INFERENCE_PROFILE_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#InferenceProfileStatus"), - shape_type=ShapeType.ENUM, - members={"ACTIVE": {"target": UNIT}}, -) - -CREATE_INFERENCE_PROFILE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CreateInferenceProfileOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#CreateInferenceProfileResponse", - ) - ], - members={ - "inferenceProfileArn": { - "target": INFERENCE_PROFILE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": {"target": INFERENCE_PROFILE_STATUS}, - }, -) - -CREATE_INFERENCE_PROFILE = Schema( - id=ShapeID("com.amazonaws.bedrock#CreateInferenceProfile"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 201, "method": "POST", "uri": "/inference-profiles"} - ), - ) - ], -) - -INFERENCE_PROFILE_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrock#InferenceProfileIdentifier"), - shape_type=ShapeType.STRING, -) - -DELETE_INFERENCE_PROFILE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#DeleteInferenceProfileInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#DeleteInferenceProfileRequest", - ) - ], - members={ - "inferenceProfileIdentifier": { - "target": INFERENCE_PROFILE_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -DELETE_INFERENCE_PROFILE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#DeleteInferenceProfileOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#DeleteInferenceProfileResponse", - ) - ], -) - -DELETE_INFERENCE_PROFILE = Schema( - id=ShapeID("com.amazonaws.bedrock#DeleteInferenceProfile"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "DELETE", - "uri": "/inference-profiles/{inferenceProfileIdentifier}", - } - ), - ) - ], -) - -GET_INFERENCE_PROFILE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetInferenceProfileInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetInferenceProfileRequest", - ) - ], - members={ - "inferenceProfileIdentifier": { - "target": INFERENCE_PROFILE_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -INFERENCE_PROFILE_ID = Schema( - id=ShapeID("com.amazonaws.bedrock#InferenceProfileId"), shape_type=ShapeType.STRING -) - -INFERENCE_PROFILE_MODEL = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#InferenceProfileModel"), - members={"modelArn": {"target": FOUNDATION_MODEL_ARN}}, -) - -INFERENCE_PROFILE_MODELS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#InferenceProfileModels"), - shape_type=ShapeType.LIST, - members={"member": {"target": INFERENCE_PROFILE_MODEL}}, -) - -INFERENCE_PROFILE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#InferenceProfileType"), - shape_type=ShapeType.ENUM, - members={"SYSTEM_DEFINED": {"target": UNIT}, "APPLICATION": {"target": UNIT}}, -) - -GET_INFERENCE_PROFILE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetInferenceProfileOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetInferenceProfileResponse", - ) - ], - members={ - "inferenceProfileName": { - "target": INFERENCE_PROFILE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": INFERENCE_PROFILE_DESCRIPTION}, - "createdAt": {"target": TIMESTAMP}, - "updatedAt": {"target": TIMESTAMP}, - "inferenceProfileArn": { - "target": INFERENCE_PROFILE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "models": { - "target": INFERENCE_PROFILE_MODELS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "inferenceProfileId": { - "target": INFERENCE_PROFILE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": INFERENCE_PROFILE_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "type": { - "target": INFERENCE_PROFILE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -GET_INFERENCE_PROFILE = Schema( - id=ShapeID("com.amazonaws.bedrock#GetInferenceProfile"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/inference-profiles/{inferenceProfileIdentifier}", - } - ), - ) - ], -) - -LIST_INFERENCE_PROFILES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ListInferenceProfilesInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#ListInferenceProfilesRequest", - ) - ], - members={ - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "nextToken": { - "target": PAGINATION_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "typeEquals": { - "target": INFERENCE_PROFILE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="type")], - }, - }, -) - -INFERENCE_PROFILE_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#InferenceProfileSummary"), - members={ - "inferenceProfileName": { - "target": INFERENCE_PROFILE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": INFERENCE_PROFILE_DESCRIPTION}, - "createdAt": {"target": TIMESTAMP}, - "updatedAt": {"target": TIMESTAMP}, - "inferenceProfileArn": { - "target": INFERENCE_PROFILE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "models": { - "target": INFERENCE_PROFILE_MODELS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "inferenceProfileId": { - "target": INFERENCE_PROFILE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": INFERENCE_PROFILE_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "type": { - "target": INFERENCE_PROFILE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -INFERENCE_PROFILE_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#InferenceProfileSummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": INFERENCE_PROFILE_SUMMARY}}, -) - -LIST_INFERENCE_PROFILES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ListInferenceProfilesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#ListInferenceProfilesResponse", - ) - ], - members={ - "inferenceProfileSummaries": {"target": INFERENCE_PROFILE_SUMMARIES}, - "nextToken": {"target": PAGINATION_TOKEN}, - }, -) - -LIST_INFERENCE_PROFILES = Schema( - id=ShapeID("com.amazonaws.bedrock#ListInferenceProfiles"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "GET", "uri": "/inference-profiles"} - ), - ) - ], -) - -DELETE_MODEL_INVOCATION_LOGGING_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#DeleteModelInvocationLoggingConfigurationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#DeleteModelInvocationLoggingConfigurationRequest", - ) - ], -) - -DELETE_MODEL_INVOCATION_LOGGING_CONFIGURATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#DeleteModelInvocationLoggingConfigurationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#DeleteModelInvocationLoggingConfigurationResponse", - ) - ], -) - -DELETE_MODEL_INVOCATION_LOGGING_CONFIGURATION = Schema( - id=ShapeID("com.amazonaws.bedrock#DeleteModelInvocationLoggingConfiguration"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "DELETE", "uri": "/logging/modelinvocations"} - ), - ) - ], -) - -GET_MODEL_INVOCATION_LOGGING_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetModelInvocationLoggingConfigurationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetModelInvocationLoggingConfigurationRequest", - ) - ], -) - -BUCKET_NAME = Schema( - id=ShapeID("com.amazonaws.bedrock#BucketName"), shape_type=ShapeType.STRING -) - -KEY_PREFIX = Schema( - id=ShapeID("com.amazonaws.bedrock#KeyPrefix"), shape_type=ShapeType.STRING -) - -S3_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#S3Config"), - members={ - "bucketName": { - "target": BUCKET_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "keyPrefix": {"target": KEY_PREFIX}, - }, -) - -LOG_GROUP_NAME = Schema( - id=ShapeID("com.amazonaws.bedrock#LogGroupName"), shape_type=ShapeType.STRING -) - -CLOUD_WATCH_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CloudWatchConfig"), - members={ - "logGroupName": { - "target": LOG_GROUP_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "roleArn": { - "target": ROLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "largeDataDeliveryS3Config": {"target": S3_CONFIG}, - }, -) - -LOGGING_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#LoggingConfig"), - members={ - "cloudWatchConfig": {"target": CLOUD_WATCH_CONFIG}, - "s3Config": {"target": S3_CONFIG}, - "textDataDeliveryEnabled": {"target": BOOLEAN}, - "imageDataDeliveryEnabled": {"target": BOOLEAN}, - "embeddingDataDeliveryEnabled": {"target": BOOLEAN}, - "videoDataDeliveryEnabled": {"target": BOOLEAN}, - "audioDataDeliveryEnabled": {"target": BOOLEAN}, - }, -) - -GET_MODEL_INVOCATION_LOGGING_CONFIGURATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetModelInvocationLoggingConfigurationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetModelInvocationLoggingConfigurationResponse", - ) - ], - members={"loggingConfig": {"target": LOGGING_CONFIG}}, -) - -GET_MODEL_INVOCATION_LOGGING_CONFIGURATION = Schema( - id=ShapeID("com.amazonaws.bedrock#GetModelInvocationLoggingConfiguration"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "GET", "uri": "/logging/modelinvocations"} - ), - ) - ], -) - -PUT_MODEL_INVOCATION_LOGGING_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#PutModelInvocationLoggingConfigurationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#PutModelInvocationLoggingConfigurationRequest", - ) - ], - members={ - "loggingConfig": { - "target": LOGGING_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -PUT_MODEL_INVOCATION_LOGGING_CONFIGURATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#PutModelInvocationLoggingConfigurationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#PutModelInvocationLoggingConfigurationResponse", - ) - ], -) - -PUT_MODEL_INVOCATION_LOGGING_CONFIGURATION = Schema( - id=ShapeID("com.amazonaws.bedrock#PutModelInvocationLoggingConfiguration"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "PUT", "uri": "/logging/modelinvocations"} - ), - ) - ], -) - -CREATE_MODEL_COPY_JOB_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CreateModelCopyJobInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#CreateModelCopyJobRequest", - ) - ], - members={ - "sourceModelArn": { - "target": MODEL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "targetModelName": { - "target": CUSTOM_MODEL_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelKmsKeyId": {"target": KMS_KEY_ID}, - "targetModelTags": {"target": TAG_LIST}, - "clientRequestToken": { - "target": IDEMPOTENCY_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - }, -) - -MODEL_COPY_JOB_ARN = Schema( - id=ShapeID("com.amazonaws.bedrock#ModelCopyJobArn"), shape_type=ShapeType.STRING -) - -CREATE_MODEL_COPY_JOB_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CreateModelCopyJobOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#CreateModelCopyJobResponse", - ) - ], - members={ - "jobArn": { - "target": MODEL_COPY_JOB_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -CREATE_MODEL_COPY_JOB = Schema( - id=ShapeID("com.amazonaws.bedrock#CreateModelCopyJob"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 201, "method": "POST", "uri": "/model-copy-jobs"} - ), - ) - ], -) - -GET_MODEL_COPY_JOB_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetModelCopyJobInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetModelCopyJobRequest", - ) - ], - members={ - "jobArn": { - "target": MODEL_COPY_JOB_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -MODEL_COPY_JOB_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ModelCopyJobStatus"), - shape_type=ShapeType.ENUM, - members={ - "IN_PROGRESS": {"target": UNIT}, - "COMPLETED": {"target": UNIT}, - "FAILED": {"target": UNIT}, - }, -) - -GET_MODEL_COPY_JOB_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetModelCopyJobOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetModelCopyJobResponse", - ) - ], - members={ - "jobArn": { - "target": MODEL_COPY_JOB_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": MODEL_COPY_JOB_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "creationTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "targetModelArn": { - "target": CUSTOM_MODEL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "targetModelName": {"target": CUSTOM_MODEL_NAME}, - "sourceAccountId": { - "target": ACCOUNT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "sourceModelArn": { - "target": MODEL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "targetModelKmsKeyArn": {"target": KMS_KEY_ARN}, - "targetModelTags": {"target": TAG_LIST}, - "failureMessage": {"target": ERROR_MESSAGE}, - "sourceModelName": {"target": CUSTOM_MODEL_NAME}, - }, -) - -GET_MODEL_COPY_JOB = Schema( - id=ShapeID("com.amazonaws.bedrock#GetModelCopyJob"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "GET", "uri": "/model-copy-jobs/{jobArn}"} - ), - ) - ], -) - -LIST_MODEL_COPY_JOBS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ListModelCopyJobsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#ListModelCopyJobsRequest", - ) - ], - members={ - "creationTimeAfter": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="creationTimeAfter") - ], - }, - "creationTimeBefore": { - "target": TIMESTAMP, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpQuery"), value="creationTimeBefore" - ) - ], - }, - "statusEquals": { - "target": MODEL_COPY_JOB_STATUS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="statusEquals") - ], - }, - "sourceAccountEquals": { - "target": ACCOUNT_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpQuery"), value="sourceAccountEquals" - ) - ], - }, - "sourceModelArnEquals": { - "target": MODEL_ARN, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpQuery"), value="sourceModelArnEquals" - ) - ], - }, - "targetModelNameContains": { - "target": CUSTOM_MODEL_NAME, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpQuery"), value="outputModelNameContains" - ) - ], - }, - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "nextToken": { - "target": PAGINATION_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "sortBy": { - "target": SORT_JOBS_BY, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="sortBy")], - }, - "sortOrder": { - "target": SORT_ORDER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="sortOrder") - ], - }, - }, -) - -MODEL_COPY_JOB_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ModelCopyJobSummary"), - members={ - "jobArn": { - "target": MODEL_COPY_JOB_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": MODEL_COPY_JOB_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "creationTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "targetModelArn": { - "target": CUSTOM_MODEL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "targetModelName": {"target": CUSTOM_MODEL_NAME}, - "sourceAccountId": { - "target": ACCOUNT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "sourceModelArn": { - "target": MODEL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "targetModelKmsKeyArn": {"target": KMS_KEY_ARN}, - "targetModelTags": {"target": TAG_LIST}, - "failureMessage": {"target": ERROR_MESSAGE}, - "sourceModelName": {"target": CUSTOM_MODEL_NAME}, - }, -) - -MODEL_COPY_JOB_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ModelCopyJobSummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": MODEL_COPY_JOB_SUMMARY}}, -) - -LIST_MODEL_COPY_JOBS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ListModelCopyJobsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#ListModelCopyJobsResponse", - ) - ], - members={ - "nextToken": {"target": PAGINATION_TOKEN}, - "modelCopyJobSummaries": {"target": MODEL_COPY_JOB_SUMMARIES}, - }, -) - -LIST_MODEL_COPY_JOBS = Schema( - id=ShapeID("com.amazonaws.bedrock#ListModelCopyJobs"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "GET", "uri": "/model-copy-jobs"} - ), - ) - ], -) - -IMPORTED_MODEL_NAME = Schema( - id=ShapeID("com.amazonaws.bedrock#ImportedModelName"), shape_type=ShapeType.STRING -) - -CREATE_MODEL_IMPORT_JOB_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CreateModelImportJobInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#CreateModelImportJobRequest", - ) - ], - members={ - "jobName": { - "target": JOB_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "importedModelName": { - "target": IMPORTED_MODEL_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "roleArn": { - "target": ROLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelDataSource": { - "target": MODEL_DATA_SOURCE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "jobTags": {"target": TAG_LIST}, - "importedModelTags": {"target": TAG_LIST}, - "clientRequestToken": {"target": IDEMPOTENCY_TOKEN}, - "vpcConfig": {"target": VPC_CONFIG}, - "importedModelKmsKeyId": {"target": KMS_KEY_ID}, - }, -) - -MODEL_IMPORT_JOB_ARN = Schema( - id=ShapeID("com.amazonaws.bedrock#ModelImportJobArn"), shape_type=ShapeType.STRING -) - -CREATE_MODEL_IMPORT_JOB_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CreateModelImportJobOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#CreateModelImportJobResponse", - ) - ], - members={ - "jobArn": { - "target": MODEL_IMPORT_JOB_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -CREATE_MODEL_IMPORT_JOB = Schema( - id=ShapeID("com.amazonaws.bedrock#CreateModelImportJob"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 201, "method": "POST", "uri": "/model-import-jobs"} - ), - ) - ], -) - -IMPORTED_MODEL_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrock#ImportedModelIdentifier"), - shape_type=ShapeType.STRING, -) - -DELETE_IMPORTED_MODEL_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#DeleteImportedModelInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#DeleteImportedModelRequest", - ) - ], - members={ - "modelIdentifier": { - "target": IMPORTED_MODEL_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -DELETE_IMPORTED_MODEL_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#DeleteImportedModelOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#DeleteImportedModelResponse", - ) - ], -) - -DELETE_IMPORTED_MODEL = Schema( - id=ShapeID("com.amazonaws.bedrock#DeleteImportedModel"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "DELETE", - "uri": "/imported-models/{modelIdentifier}", - } - ), - ) - ], -) - -GET_IMPORTED_MODEL_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetImportedModelInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetImportedModelRequest", - ) - ], - members={ - "modelIdentifier": { - "target": IMPORTED_MODEL_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -CUSTOM_MODEL_UNITS_VERSION = Schema( - id=ShapeID("com.amazonaws.bedrock#CustomModelUnitsVersion"), - shape_type=ShapeType.STRING, -) - -CUSTOM_MODEL_UNITS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CustomModelUnits"), - members={ - "customModelUnitsPerModelCopy": {"target": INTEGER}, - "customModelUnitsVersion": {"target": CUSTOM_MODEL_UNITS_VERSION}, - }, -) - -INSTRUCT_SUPPORTED = Schema( - id=ShapeID("com.amazonaws.bedrock#InstructSupported"), shape_type=ShapeType.BOOLEAN -) - -IMPORTED_MODEL_ARN = Schema( - id=ShapeID("com.amazonaws.bedrock#ImportedModelArn"), shape_type=ShapeType.STRING -) - -GET_IMPORTED_MODEL_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetImportedModelOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetImportedModelResponse", - ) - ], - members={ - "modelArn": {"target": IMPORTED_MODEL_ARN}, - "modelName": {"target": IMPORTED_MODEL_NAME}, - "jobName": {"target": JOB_NAME}, - "jobArn": {"target": MODEL_IMPORT_JOB_ARN}, - "modelDataSource": {"target": MODEL_DATA_SOURCE}, - "creationTime": {"target": TIMESTAMP}, - "modelArchitecture": {"target": STRING}, - "modelKmsKeyArn": {"target": KMS_KEY_ARN}, - "instructSupported": {"target": INSTRUCT_SUPPORTED}, - "customModelUnits": {"target": CUSTOM_MODEL_UNITS}, - }, -) - -GET_IMPORTED_MODEL = Schema( - id=ShapeID("com.amazonaws.bedrock#GetImportedModel"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/imported-models/{modelIdentifier}", - } - ), - ) - ], -) - -MODEL_IMPORT_JOB_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrock#ModelImportJobIdentifier"), - shape_type=ShapeType.STRING, -) - -GET_MODEL_IMPORT_JOB_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetModelImportJobInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetModelImportJobRequest", - ) - ], - members={ - "jobIdentifier": { - "target": MODEL_IMPORT_JOB_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -MODEL_IMPORT_JOB_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ModelImportJobStatus"), - shape_type=ShapeType.ENUM, - members={ - "IN_PROGRESS": {"target": UNIT}, - "COMPLETED": {"target": UNIT}, - "FAILED": {"target": UNIT}, - }, -) - -GET_MODEL_IMPORT_JOB_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetModelImportJobOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetModelImportJobResponse", - ) - ], - members={ - "jobArn": {"target": MODEL_IMPORT_JOB_ARN}, - "jobName": {"target": JOB_NAME}, - "importedModelName": {"target": IMPORTED_MODEL_NAME}, - "importedModelArn": {"target": IMPORTED_MODEL_ARN}, - "roleArn": {"target": ROLE_ARN}, - "modelDataSource": {"target": MODEL_DATA_SOURCE}, - "status": {"target": MODEL_IMPORT_JOB_STATUS}, - "failureMessage": {"target": ERROR_MESSAGE}, - "creationTime": {"target": TIMESTAMP}, - "lastModifiedTime": {"target": TIMESTAMP}, - "endTime": {"target": TIMESTAMP}, - "vpcConfig": {"target": VPC_CONFIG}, - "importedModelKmsKeyArn": {"target": KMS_KEY_ARN}, - }, -) - -GET_MODEL_IMPORT_JOB = Schema( - id=ShapeID("com.amazonaws.bedrock#GetModelImportJob"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/model-import-jobs/{jobIdentifier}", - } - ), - ) - ], -) - -LIST_IMPORTED_MODELS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ListImportedModelsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#ListImportedModelsRequest", - ) - ], - members={ - "creationTimeBefore": { - "target": TIMESTAMP, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpQuery"), value="creationTimeBefore" - ) - ], - }, - "creationTimeAfter": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="creationTimeAfter") - ], - }, - "nameContains": { - "target": IMPORTED_MODEL_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nameContains") - ], - }, - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "nextToken": { - "target": PAGINATION_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "sortBy": { - "target": SORT_MODELS_BY, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="sortBy")], - }, - "sortOrder": { - "target": SORT_ORDER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="sortOrder") - ], - }, - }, -) - -MODEL_ARCHITECTURE = Schema( - id=ShapeID("com.amazonaws.bedrock#ModelArchitecture"), shape_type=ShapeType.STRING -) - -IMPORTED_MODEL_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ImportedModelSummary"), - members={ - "modelArn": { - "target": IMPORTED_MODEL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelName": { - "target": IMPORTED_MODEL_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "creationTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "instructSupported": {"target": INSTRUCT_SUPPORTED}, - "modelArchitecture": {"target": MODEL_ARCHITECTURE}, - }, -) - -IMPORTED_MODEL_SUMMARY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ImportedModelSummaryList"), - shape_type=ShapeType.LIST, - members={"member": {"target": IMPORTED_MODEL_SUMMARY}}, -) - -LIST_IMPORTED_MODELS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ListImportedModelsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#ListImportedModelsResponse", - ) - ], - members={ - "nextToken": {"target": PAGINATION_TOKEN}, - "modelSummaries": {"target": IMPORTED_MODEL_SUMMARY_LIST}, - }, -) - -LIST_IMPORTED_MODELS = Schema( - id=ShapeID("com.amazonaws.bedrock#ListImportedModels"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "GET", "uri": "/imported-models"} - ), - ) - ], -) - -LIST_MODEL_IMPORT_JOBS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ListModelImportJobsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#ListModelImportJobsRequest", - ) - ], - members={ - "creationTimeAfter": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="creationTimeAfter") - ], - }, - "creationTimeBefore": { - "target": TIMESTAMP, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpQuery"), value="creationTimeBefore" - ) - ], - }, - "statusEquals": { - "target": MODEL_IMPORT_JOB_STATUS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="statusEquals") - ], - }, - "nameContains": { - "target": JOB_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nameContains") - ], - }, - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "nextToken": { - "target": PAGINATION_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "sortBy": { - "target": SORT_JOBS_BY, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="sortBy")], - }, - "sortOrder": { - "target": SORT_ORDER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="sortOrder") - ], - }, - }, -) - -MODEL_IMPORT_JOB_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ModelImportJobSummary"), - members={ - "jobArn": { - "target": MODEL_IMPORT_JOB_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "jobName": { - "target": JOB_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": MODEL_IMPORT_JOB_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastModifiedTime": {"target": TIMESTAMP}, - "creationTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "endTime": {"target": TIMESTAMP}, - "importedModelArn": {"target": IMPORTED_MODEL_ARN}, - "importedModelName": {"target": IMPORTED_MODEL_NAME}, - }, -) - -MODEL_IMPORT_JOB_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ModelImportJobSummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": MODEL_IMPORT_JOB_SUMMARY}}, -) - -LIST_MODEL_IMPORT_JOBS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ListModelImportJobsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#ListModelImportJobsResponse", - ) - ], - members={ - "nextToken": {"target": PAGINATION_TOKEN}, - "modelImportJobSummaries": {"target": MODEL_IMPORT_JOB_SUMMARIES}, - }, -) - -LIST_MODEL_IMPORT_JOBS = Schema( - id=ShapeID("com.amazonaws.bedrock#ListModelImportJobs"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "GET", "uri": "/model-import-jobs"} - ), - ) - ], -) - -MODEL_INVOCATION_IDEMPOTENCY_TOKEN = Schema( - id=ShapeID("com.amazonaws.bedrock#ModelInvocationIdempotencyToken"), - shape_type=ShapeType.STRING, -) - -S3_INPUT_FORMAT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#S3InputFormat"), - shape_type=ShapeType.ENUM, - members={"JSONL": {"target": UNIT}}, -) - -MODEL_INVOCATION_JOB_S3_INPUT_DATA_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ModelInvocationJobS3InputDataConfig"), - members={ - "s3InputFormat": {"target": S3_INPUT_FORMAT}, - "s3Uri": { - "target": S3_URI, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "s3BucketOwner": {"target": ACCOUNT_ID}, - }, -) - -MODEL_INVOCATION_JOB_INPUT_DATA_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ModelInvocationJobInputDataConfig"), - shape_type=ShapeType.UNION, - members={ - "s3InputDataConfig": {"target": MODEL_INVOCATION_JOB_S3_INPUT_DATA_CONFIG} - }, -) - -MODEL_INVOCATION_JOB_NAME = Schema( - id=ShapeID("com.amazonaws.bedrock#ModelInvocationJobName"), - shape_type=ShapeType.STRING, -) - -MODEL_ID = Schema( - id=ShapeID("com.amazonaws.bedrock#ModelId"), shape_type=ShapeType.STRING -) - -MODEL_INVOCATION_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ModelInvocationType"), - shape_type=ShapeType.ENUM, - members={"InvokeModel": {"target": UNIT}, "Converse": {"target": UNIT}}, -) - -MODEL_INVOCATION_JOB_S3_OUTPUT_DATA_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ModelInvocationJobS3OutputDataConfig"), - members={ - "s3Uri": { - "target": S3_URI, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "s3EncryptionKeyId": {"target": KMS_KEY_ID}, - "s3BucketOwner": {"target": ACCOUNT_ID}, - }, -) - -MODEL_INVOCATION_JOB_OUTPUT_DATA_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ModelInvocationJobOutputDataConfig"), - shape_type=ShapeType.UNION, - members={ - "s3OutputDataConfig": {"target": MODEL_INVOCATION_JOB_S3_OUTPUT_DATA_CONFIG} - }, -) - -MODEL_INVOCATION_JOB_TIMEOUT_DURATION_IN_HOURS = Schema( - id=ShapeID("com.amazonaws.bedrock#ModelInvocationJobTimeoutDurationInHours"), - shape_type=ShapeType.INTEGER, -) - -CREATE_MODEL_INVOCATION_JOB_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CreateModelInvocationJobInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#CreateModelInvocationJobRequest", - ) - ], - members={ - "jobName": { - "target": MODEL_INVOCATION_JOB_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "roleArn": { - "target": ROLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientRequestToken": { - "target": MODEL_INVOCATION_IDEMPOTENCY_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "modelId": { - "target": MODEL_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "inputDataConfig": { - "target": MODEL_INVOCATION_JOB_INPUT_DATA_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "outputDataConfig": { - "target": MODEL_INVOCATION_JOB_OUTPUT_DATA_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "vpcConfig": {"target": VPC_CONFIG}, - "timeoutDurationInHours": { - "target": MODEL_INVOCATION_JOB_TIMEOUT_DURATION_IN_HOURS - }, - "tags": {"target": TAG_LIST}, - "modelInvocationType": { - "target": MODEL_INVOCATION_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value="InvokeModel") - ], - }, - }, -) - -MODEL_INVOCATION_JOB_ARN = Schema( - id=ShapeID("com.amazonaws.bedrock#ModelInvocationJobArn"), - shape_type=ShapeType.STRING, -) - -CREATE_MODEL_INVOCATION_JOB_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CreateModelInvocationJobOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#CreateModelInvocationJobResponse", - ) - ], - members={ - "jobArn": { - "target": MODEL_INVOCATION_JOB_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -CREATE_MODEL_INVOCATION_JOB = Schema( - id=ShapeID("com.amazonaws.bedrock#CreateModelInvocationJob"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "POST", "uri": "/model-invocation-job"} - ), - ) - ], -) - -MODEL_INVOCATION_JOB_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrock#ModelInvocationJobIdentifier"), - shape_type=ShapeType.STRING, -) - -GET_MODEL_INVOCATION_JOB_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetModelInvocationJobInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetModelInvocationJobRequest", - ) - ], - members={ - "jobIdentifier": { - "target": MODEL_INVOCATION_JOB_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -NON_NEGATIVE_LONG = Schema( - id=ShapeID("com.amazonaws.bedrock#NonNegativeLong"), shape_type=ShapeType.LONG -) - -MESSAGE = Schema( - id=ShapeID("com.amazonaws.bedrock#Message"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -MODEL_INVOCATION_JOB_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ModelInvocationJobStatus"), - shape_type=ShapeType.ENUM, - members={ - "SUBMITTED": {"target": UNIT}, - "IN_PROGRESS": {"target": UNIT}, - "COMPLETED": {"target": UNIT}, - "FAILED": {"target": UNIT}, - "STOPPING": {"target": UNIT}, - "STOPPED": {"target": UNIT}, - "PARTIALLY_COMPLETED": {"target": UNIT}, - "EXPIRED": {"target": UNIT}, - "VALIDATING": {"target": UNIT}, - "SCHEDULED": {"target": UNIT}, - }, -) - -GET_MODEL_INVOCATION_JOB_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetModelInvocationJobOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetModelInvocationJobResponse", - ) - ], - members={ - "jobArn": { - "target": MODEL_INVOCATION_JOB_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "jobName": {"target": MODEL_INVOCATION_JOB_NAME}, - "modelId": { - "target": MODEL_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientRequestToken": {"target": MODEL_INVOCATION_IDEMPOTENCY_TOKEN}, - "roleArn": { - "target": ROLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": {"target": MODEL_INVOCATION_JOB_STATUS}, - "message": {"target": MESSAGE}, - "submitTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastModifiedTime": {"target": TIMESTAMP}, - "endTime": {"target": TIMESTAMP}, - "inputDataConfig": { - "target": MODEL_INVOCATION_JOB_INPUT_DATA_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "outputDataConfig": { - "target": MODEL_INVOCATION_JOB_OUTPUT_DATA_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "vpcConfig": {"target": VPC_CONFIG}, - "timeoutDurationInHours": { - "target": MODEL_INVOCATION_JOB_TIMEOUT_DURATION_IN_HOURS - }, - "jobExpirationTime": {"target": TIMESTAMP}, - "modelInvocationType": {"target": MODEL_INVOCATION_TYPE}, - "totalRecordCount": {"target": NON_NEGATIVE_LONG}, - "processedRecordCount": {"target": NON_NEGATIVE_LONG}, - "successRecordCount": {"target": NON_NEGATIVE_LONG}, - "errorRecordCount": {"target": NON_NEGATIVE_LONG}, - }, -) - -GET_MODEL_INVOCATION_JOB = Schema( - id=ShapeID("com.amazonaws.bedrock#GetModelInvocationJob"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/model-invocation-job/{jobIdentifier}", - } - ), - ) - ], -) - -LIST_MODEL_INVOCATION_JOBS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ListModelInvocationJobsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#ListModelInvocationJobsRequest", - ) - ], - members={ - "submitTimeAfter": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="submitTimeAfter") - ], - }, - "submitTimeBefore": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="submitTimeBefore") - ], - }, - "statusEquals": { - "target": MODEL_INVOCATION_JOB_STATUS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="statusEquals") - ], - }, - "nameContains": { - "target": MODEL_INVOCATION_JOB_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nameContains") - ], - }, - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "nextToken": { - "target": PAGINATION_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "sortBy": { - "target": SORT_JOBS_BY, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="sortBy")], - }, - "sortOrder": { - "target": SORT_ORDER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="sortOrder") - ], - }, - }, -) - -MODEL_INVOCATION_JOB_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ModelInvocationJobSummary"), - members={ - "jobArn": { - "target": MODEL_INVOCATION_JOB_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "jobName": { - "target": MODEL_INVOCATION_JOB_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelId": { - "target": MODEL_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientRequestToken": {"target": MODEL_INVOCATION_IDEMPOTENCY_TOKEN}, - "roleArn": { - "target": ROLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": {"target": MODEL_INVOCATION_JOB_STATUS}, - "message": {"target": MESSAGE}, - "submitTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastModifiedTime": {"target": TIMESTAMP}, - "endTime": {"target": TIMESTAMP}, - "inputDataConfig": { - "target": MODEL_INVOCATION_JOB_INPUT_DATA_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "outputDataConfig": { - "target": MODEL_INVOCATION_JOB_OUTPUT_DATA_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "vpcConfig": {"target": VPC_CONFIG}, - "timeoutDurationInHours": { - "target": MODEL_INVOCATION_JOB_TIMEOUT_DURATION_IN_HOURS - }, - "jobExpirationTime": {"target": TIMESTAMP}, - "modelInvocationType": {"target": MODEL_INVOCATION_TYPE}, - "totalRecordCount": {"target": NON_NEGATIVE_LONG}, - "processedRecordCount": {"target": NON_NEGATIVE_LONG}, - "successRecordCount": {"target": NON_NEGATIVE_LONG}, - "errorRecordCount": {"target": NON_NEGATIVE_LONG}, - }, -) - -MODEL_INVOCATION_JOB_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ModelInvocationJobSummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": MODEL_INVOCATION_JOB_SUMMARY}}, -) - -LIST_MODEL_INVOCATION_JOBS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ListModelInvocationJobsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#ListModelInvocationJobsResponse", - ) - ], - members={ - "nextToken": {"target": PAGINATION_TOKEN}, - "invocationJobSummaries": {"target": MODEL_INVOCATION_JOB_SUMMARIES}, - }, -) - -LIST_MODEL_INVOCATION_JOBS = Schema( - id=ShapeID("com.amazonaws.bedrock#ListModelInvocationJobs"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "GET", "uri": "/model-invocation-jobs"} - ), - ) - ], -) - -STOP_MODEL_INVOCATION_JOB_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#StopModelInvocationJobInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#StopModelInvocationJobRequest", - ) - ], - members={ - "jobIdentifier": { - "target": MODEL_INVOCATION_JOB_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -STOP_MODEL_INVOCATION_JOB_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#StopModelInvocationJobOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#StopModelInvocationJobResponse", - ) - ], -) - -STOP_MODEL_INVOCATION_JOB = Schema( - id=ShapeID("com.amazonaws.bedrock#StopModelInvocationJob"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "POST", - "uri": "/model-invocation-job/{jobIdentifier}/stop", - } - ), - ) - ], -) - -GET_FOUNDATION_MODEL_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrock#GetFoundationModelIdentifier"), - shape_type=ShapeType.STRING, -) - -GET_FOUNDATION_MODEL_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetFoundationModelInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetFoundationModelRequest", - ) - ], - members={ - "modelIdentifier": { - "target": GET_FOUNDATION_MODEL_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -MODEL_CUSTOMIZATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ModelCustomization"), - shape_type=ShapeType.ENUM, - members={ - "FINE_TUNING": {"target": UNIT}, - "CONTINUED_PRE_TRAINING": {"target": UNIT}, - "DISTILLATION": {"target": UNIT}, - }, -) - -MODEL_CUSTOMIZATION_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ModelCustomizationList"), - shape_type=ShapeType.LIST, - members={"member": {"target": MODEL_CUSTOMIZATION}}, -) - -INFERENCE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#InferenceType"), - shape_type=ShapeType.ENUM, - members={"ON_DEMAND": {"target": UNIT}, "PROVISIONED": {"target": UNIT}}, -) - -INFERENCE_TYPE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#InferenceTypeList"), - shape_type=ShapeType.LIST, - members={"member": {"target": INFERENCE_TYPE}}, -) - -MODEL_MODALITY = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ModelModality"), - shape_type=ShapeType.ENUM, - members={ - "TEXT": {"target": UNIT}, - "IMAGE": {"target": UNIT}, - "EMBEDDING": {"target": UNIT}, - }, -) - -MODEL_MODALITY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ModelModalityList"), - shape_type=ShapeType.LIST, - members={"member": {"target": MODEL_MODALITY}}, -) - -BEDROCK_MODEL_ID = Schema( - id=ShapeID("com.amazonaws.bedrock#BedrockModelId"), shape_type=ShapeType.STRING -) - -FOUNDATION_MODEL_LIFECYCLE_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#FoundationModelLifecycleStatus"), - shape_type=ShapeType.ENUM, - members={"ACTIVE": {"target": UNIT}, "LEGACY": {"target": UNIT}}, -) - -FOUNDATION_MODEL_LIFECYCLE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#FoundationModelLifecycle"), - members={ - "status": { - "target": FOUNDATION_MODEL_LIFECYCLE_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "startOfLifeTime": {"target": TIMESTAMP}, - "endOfLifeTime": {"target": TIMESTAMP}, - "legacyTime": {"target": TIMESTAMP}, - "publicExtendedAccessTime": {"target": TIMESTAMP}, - }, -) - -BRANDED_NAME = Schema( - id=ShapeID("com.amazonaws.bedrock#BrandedName"), shape_type=ShapeType.STRING -) - -FOUNDATION_MODEL_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#FoundationModelDetails"), - members={ - "modelArn": { - "target": FOUNDATION_MODEL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelId": { - "target": BEDROCK_MODEL_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelName": {"target": BRANDED_NAME}, - "providerName": {"target": BRANDED_NAME}, - "inputModalities": {"target": MODEL_MODALITY_LIST}, - "outputModalities": {"target": MODEL_MODALITY_LIST}, - "responseStreamingSupported": {"target": BOOLEAN}, - "customizationsSupported": {"target": MODEL_CUSTOMIZATION_LIST}, - "inferenceTypesSupported": {"target": INFERENCE_TYPE_LIST}, - "modelLifecycle": {"target": FOUNDATION_MODEL_LIFECYCLE}, - }, -) - -GET_FOUNDATION_MODEL_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetFoundationModelOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetFoundationModelResponse", - ) - ], - members={"modelDetails": {"target": FOUNDATION_MODEL_DETAILS}}, -) - -GET_FOUNDATION_MODEL = Schema( - id=ShapeID("com.amazonaws.bedrock#GetFoundationModel"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/foundation-models/{modelIdentifier}", - } - ), - ) - ], -) - -PROVIDER = Schema( - id=ShapeID("com.amazonaws.bedrock#Provider"), shape_type=ShapeType.STRING -) - -LIST_FOUNDATION_MODELS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ListFoundationModelsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#ListFoundationModelsRequest", - ) - ], - members={ - "byProvider": { - "target": PROVIDER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="byProvider") - ], - }, - "byCustomizationType": { - "target": MODEL_CUSTOMIZATION, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpQuery"), value="byCustomizationType" - ) - ], - }, - "byOutputModality": { - "target": MODEL_MODALITY, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="byOutputModality") - ], - }, - "byInferenceType": { - "target": INFERENCE_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="byInferenceType") - ], - }, - }, -) - -FOUNDATION_MODEL_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#FoundationModelSummary"), - members={ - "modelArn": { - "target": FOUNDATION_MODEL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelId": { - "target": BEDROCK_MODEL_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelName": {"target": BRANDED_NAME}, - "providerName": {"target": BRANDED_NAME}, - "inputModalities": {"target": MODEL_MODALITY_LIST}, - "outputModalities": {"target": MODEL_MODALITY_LIST}, - "responseStreamingSupported": {"target": BOOLEAN}, - "customizationsSupported": {"target": MODEL_CUSTOMIZATION_LIST}, - "inferenceTypesSupported": {"target": INFERENCE_TYPE_LIST}, - "modelLifecycle": {"target": FOUNDATION_MODEL_LIFECYCLE}, - }, -) - -FOUNDATION_MODEL_SUMMARY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#FoundationModelSummaryList"), - shape_type=ShapeType.LIST, - members={"member": {"target": FOUNDATION_MODEL_SUMMARY}}, -) - -LIST_FOUNDATION_MODELS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ListFoundationModelsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#ListFoundationModelsResponse", - ) - ], - members={"modelSummaries": {"target": FOUNDATION_MODEL_SUMMARY_LIST}}, -) - -LIST_FOUNDATION_MODELS = Schema( - id=ShapeID("com.amazonaws.bedrock#ListFoundationModels"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "GET", "uri": "/foundation-models"} - ), - ) - ], -) - -PROMPT_ROUTER_DESCRIPTION = Schema( - id=ShapeID("com.amazonaws.bedrock#PromptRouterDescription"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -PROMPT_ROUTER_TARGET_MODEL_ARN = Schema( - id=ShapeID("com.amazonaws.bedrock#PromptRouterTargetModelArn"), - shape_type=ShapeType.STRING, -) - -PROMPT_ROUTER_TARGET_MODEL = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#PromptRouterTargetModel"), - members={ - "modelArn": { - "target": PROMPT_ROUTER_TARGET_MODEL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -PROMPT_ROUTER_TARGET_MODELS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#PromptRouterTargetModels"), - shape_type=ShapeType.LIST, - members={"member": {"target": PROMPT_ROUTER_TARGET_MODEL}}, -) - -PROMPT_ROUTER_NAME = Schema( - id=ShapeID("com.amazonaws.bedrock#PromptRouterName"), shape_type=ShapeType.STRING -) - -ROUTING_CRITERIA = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#RoutingCriteria"), - members={ - "responseQualityDifference": { - "target": DOUBLE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -CREATE_PROMPT_ROUTER_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CreatePromptRouterInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#CreatePromptRouterRequest", - ) - ], - members={ - "clientRequestToken": { - "target": IDEMPOTENCY_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "promptRouterName": { - "target": PROMPT_ROUTER_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "models": { - "target": PROMPT_ROUTER_TARGET_MODELS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": PROMPT_ROUTER_DESCRIPTION}, - "routingCriteria": { - "target": ROUTING_CRITERIA, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "fallbackModel": { - "target": PROMPT_ROUTER_TARGET_MODEL, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "tags": {"target": TAG_LIST}, - }, -) - -PROMPT_ROUTER_ARN = Schema( - id=ShapeID("com.amazonaws.bedrock#PromptRouterArn"), shape_type=ShapeType.STRING -) - -CREATE_PROMPT_ROUTER_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CreatePromptRouterOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#CreatePromptRouterResponse", - ) - ], - members={"promptRouterArn": {"target": PROMPT_ROUTER_ARN}}, -) - -CREATE_PROMPT_ROUTER = Schema( - id=ShapeID("com.amazonaws.bedrock#CreatePromptRouter"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "POST", "uri": "/prompt-routers"} - ), - ) - ], -) - -DELETE_PROMPT_ROUTER_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#DeletePromptRouterInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#DeletePromptRouterRequest", - ) - ], - members={ - "promptRouterArn": { - "target": PROMPT_ROUTER_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -DELETE_PROMPT_ROUTER_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#DeletePromptRouterOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#DeletePromptRouterResponse", - ) - ], -) - -DELETE_PROMPT_ROUTER = Schema( - id=ShapeID("com.amazonaws.bedrock#DeletePromptRouter"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "DELETE", - "uri": "/prompt-routers/{promptRouterArn}", - } - ), - ) - ], -) - -GET_PROMPT_ROUTER_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetPromptRouterInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetPromptRouterRequest", - ) - ], - members={ - "promptRouterArn": { - "target": PROMPT_ROUTER_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -PROMPT_ROUTER_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#PromptRouterStatus"), - shape_type=ShapeType.ENUM, - members={"AVAILABLE": {"target": UNIT}}, -) - -PROMPT_ROUTER_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#PromptRouterType"), - shape_type=ShapeType.ENUM, - members={"CUSTOM": {"target": UNIT}, "DEFAULT": {"target": UNIT}}, -) - -GET_PROMPT_ROUTER_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetPromptRouterOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetPromptRouterResponse", - ) - ], - members={ - "promptRouterName": { - "target": PROMPT_ROUTER_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "routingCriteria": { - "target": ROUTING_CRITERIA, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": PROMPT_ROUTER_DESCRIPTION}, - "createdAt": {"target": TIMESTAMP}, - "updatedAt": {"target": TIMESTAMP}, - "promptRouterArn": { - "target": PROMPT_ROUTER_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "models": { - "target": PROMPT_ROUTER_TARGET_MODELS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "fallbackModel": { - "target": PROMPT_ROUTER_TARGET_MODEL, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": PROMPT_ROUTER_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "type": { - "target": PROMPT_ROUTER_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -GET_PROMPT_ROUTER = Schema( - id=ShapeID("com.amazonaws.bedrock#GetPromptRouter"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/prompt-routers/{promptRouterArn}", - } - ), - ) - ], -) - -LIST_PROMPT_ROUTERS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ListPromptRoutersInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#ListPromptRoutersRequest", - ) - ], - members={ - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "nextToken": { - "target": PAGINATION_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "type": { - "target": PROMPT_ROUTER_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value="default"), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="type"), - ], - }, - }, -) - -PROMPT_ROUTER_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#PromptRouterSummary"), - members={ - "promptRouterName": { - "target": PROMPT_ROUTER_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "routingCriteria": { - "target": ROUTING_CRITERIA, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": PROMPT_ROUTER_DESCRIPTION}, - "createdAt": {"target": TIMESTAMP}, - "updatedAt": {"target": TIMESTAMP}, - "promptRouterArn": { - "target": PROMPT_ROUTER_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "models": { - "target": PROMPT_ROUTER_TARGET_MODELS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "fallbackModel": { - "target": PROMPT_ROUTER_TARGET_MODEL, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": PROMPT_ROUTER_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "type": { - "target": PROMPT_ROUTER_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -PROMPT_ROUTER_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#PromptRouterSummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": PROMPT_ROUTER_SUMMARY}}, -) - -LIST_PROMPT_ROUTERS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ListPromptRoutersOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#ListPromptRoutersResponse", - ) - ], - members={ - "promptRouterSummaries": {"target": PROMPT_ROUTER_SUMMARIES}, - "nextToken": {"target": PAGINATION_TOKEN}, - }, -) - -LIST_PROMPT_ROUTERS = Schema( - id=ShapeID("com.amazonaws.bedrock#ListPromptRouters"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "GET", "uri": "/prompt-routers"} - ), - ) - ], -) - -COMMITMENT_DURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CommitmentDuration"), - shape_type=ShapeType.ENUM, - members={"ONE_MONTH": {"target": UNIT}, "SIX_MONTHS": {"target": UNIT}}, -) - -POSITIVE_INTEGER = Schema( - id=ShapeID("com.amazonaws.bedrock#PositiveInteger"), shape_type=ShapeType.INTEGER -) - -PROVISIONED_MODEL_NAME = Schema( - id=ShapeID("com.amazonaws.bedrock#ProvisionedModelName"), - shape_type=ShapeType.STRING, -) - -CREATE_PROVISIONED_MODEL_THROUGHPUT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CreateProvisionedModelThroughputInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#CreateProvisionedModelThroughputRequest", - ) - ], - members={ - "clientRequestToken": { - "target": IDEMPOTENCY_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "modelUnits": { - "target": POSITIVE_INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "provisionedModelName": { - "target": PROVISIONED_MODEL_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelId": { - "target": MODEL_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "commitmentDuration": {"target": COMMITMENT_DURATION}, - "tags": {"target": TAG_LIST}, - }, -) - -PROVISIONED_MODEL_ARN = Schema( - id=ShapeID("com.amazonaws.bedrock#ProvisionedModelArn"), shape_type=ShapeType.STRING -) - -CREATE_PROVISIONED_MODEL_THROUGHPUT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CreateProvisionedModelThroughputOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#CreateProvisionedModelThroughputResponse", - ) - ], - members={ - "provisionedModelArn": { - "target": PROVISIONED_MODEL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -CREATE_PROVISIONED_MODEL_THROUGHPUT = Schema( - id=ShapeID("com.amazonaws.bedrock#CreateProvisionedModelThroughput"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 201, "method": "POST", "uri": "/provisioned-model-throughput"} - ), - ) - ], -) - -PROVISIONED_MODEL_ID = Schema( - id=ShapeID("com.amazonaws.bedrock#ProvisionedModelId"), shape_type=ShapeType.STRING -) - -DELETE_PROVISIONED_MODEL_THROUGHPUT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#DeleteProvisionedModelThroughputInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#DeleteProvisionedModelThroughputRequest", - ) - ], - members={ - "provisionedModelId": { - "target": PROVISIONED_MODEL_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -DELETE_PROVISIONED_MODEL_THROUGHPUT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#DeleteProvisionedModelThroughputOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#DeleteProvisionedModelThroughputResponse", - ) - ], -) - -DELETE_PROVISIONED_MODEL_THROUGHPUT = Schema( - id=ShapeID("com.amazonaws.bedrock#DeleteProvisionedModelThroughput"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "DELETE", - "uri": "/provisioned-model-throughput/{provisionedModelId}", - } - ), - ) - ], -) - -GET_PROVISIONED_MODEL_THROUGHPUT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetProvisionedModelThroughputInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetProvisionedModelThroughputRequest", - ) - ], - members={ - "provisionedModelId": { - "target": PROVISIONED_MODEL_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -PROVISIONED_MODEL_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ProvisionedModelStatus"), - shape_type=ShapeType.ENUM, - members={ - "CREATING": {"target": UNIT}, - "IN_SERVICE": {"target": UNIT}, - "UPDATING": {"target": UNIT}, - "FAILED": {"target": UNIT}, - }, -) - -GET_PROVISIONED_MODEL_THROUGHPUT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetProvisionedModelThroughputOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetProvisionedModelThroughputResponse", - ) - ], - members={ - "modelUnits": { - "target": POSITIVE_INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "desiredModelUnits": { - "target": POSITIVE_INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "provisionedModelName": { - "target": PROVISIONED_MODEL_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "provisionedModelArn": { - "target": PROVISIONED_MODEL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelArn": { - "target": MODEL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "desiredModelArn": { - "target": MODEL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "foundationModelArn": { - "target": FOUNDATION_MODEL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": PROVISIONED_MODEL_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "creationTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastModifiedTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "failureMessage": {"target": ERROR_MESSAGE}, - "commitmentDuration": {"target": COMMITMENT_DURATION}, - "commitmentExpirationTime": {"target": TIMESTAMP}, - }, -) - -GET_PROVISIONED_MODEL_THROUGHPUT = Schema( - id=ShapeID("com.amazonaws.bedrock#GetProvisionedModelThroughput"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/provisioned-model-throughput/{provisionedModelId}", - } - ), - ) - ], -) - -SORT_BY_PROVISIONED_MODELS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#SortByProvisionedModels"), - shape_type=ShapeType.ENUM, - members={"CREATION_TIME": {"target": UNIT}}, -) - -LIST_PROVISIONED_MODEL_THROUGHPUTS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ListProvisionedModelThroughputsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#ListProvisionedModelThroughputsRequest", - ) - ], - members={ - "creationTimeAfter": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="creationTimeAfter") - ], - }, - "creationTimeBefore": { - "target": TIMESTAMP, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpQuery"), value="creationTimeBefore" - ) - ], - }, - "statusEquals": { - "target": PROVISIONED_MODEL_STATUS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="statusEquals") - ], - }, - "modelArnEquals": { - "target": MODEL_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="modelArnEquals") - ], - }, - "nameContains": { - "target": PROVISIONED_MODEL_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nameContains") - ], - }, - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "nextToken": { - "target": PAGINATION_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "sortBy": { - "target": SORT_BY_PROVISIONED_MODELS, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="sortBy")], - }, - "sortOrder": { - "target": SORT_ORDER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="sortOrder") - ], - }, - }, -) - -PROVISIONED_MODEL_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ProvisionedModelSummary"), - members={ - "provisionedModelName": { - "target": PROVISIONED_MODEL_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "provisionedModelArn": { - "target": PROVISIONED_MODEL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelArn": { - "target": MODEL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "desiredModelArn": { - "target": MODEL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "foundationModelArn": { - "target": FOUNDATION_MODEL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelUnits": { - "target": POSITIVE_INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "desiredModelUnits": { - "target": POSITIVE_INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": PROVISIONED_MODEL_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "commitmentDuration": {"target": COMMITMENT_DURATION}, - "commitmentExpirationTime": {"target": TIMESTAMP}, - "creationTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastModifiedTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -PROVISIONED_MODEL_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ProvisionedModelSummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": PROVISIONED_MODEL_SUMMARY}}, -) - -LIST_PROVISIONED_MODEL_THROUGHPUTS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ListProvisionedModelThroughputsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#ListProvisionedModelThroughputsResponse", - ) - ], - members={ - "nextToken": {"target": PAGINATION_TOKEN}, - "provisionedModelSummaries": {"target": PROVISIONED_MODEL_SUMMARIES}, - }, -) - -LIST_PROVISIONED_MODEL_THROUGHPUTS = Schema( - id=ShapeID("com.amazonaws.bedrock#ListProvisionedModelThroughputs"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "GET", "uri": "/provisioned-model-throughputs"} - ), - ) - ], -) - -UPDATE_PROVISIONED_MODEL_THROUGHPUT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#UpdateProvisionedModelThroughputInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#UpdateProvisionedModelThroughputRequest", - ) - ], - members={ - "provisionedModelId": { - "target": PROVISIONED_MODEL_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "desiredProvisionedModelName": {"target": PROVISIONED_MODEL_NAME}, - "desiredModelId": {"target": MODEL_IDENTIFIER}, - }, -) - -UPDATE_PROVISIONED_MODEL_THROUGHPUT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#UpdateProvisionedModelThroughputOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#UpdateProvisionedModelThroughputResponse", - ) - ], -) - -UPDATE_PROVISIONED_MODEL_THROUGHPUT = Schema( - id=ShapeID("com.amazonaws.bedrock#UpdateProvisionedModelThroughput"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "PATCH", - "uri": "/provisioned-model-throughput/{provisionedModelId}", - } - ), - ) - ], -) - -RESOURCE_POLICY_RESOURCE_ARN = Schema( - id=ShapeID("com.amazonaws.bedrock#ResourcePolicyResourceArn"), - shape_type=ShapeType.STRING, -) - -DELETE_RESOURCE_POLICY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#DeleteResourcePolicyInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#DeleteResourcePolicyRequest", - ) - ], - members={ - "resourceArn": { - "target": RESOURCE_POLICY_RESOURCE_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -DELETE_RESOURCE_POLICY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#DeleteResourcePolicyOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#DeleteResourcePolicyResponse", - ) - ], -) - -DELETE_RESOURCE_POLICY = Schema( - id=ShapeID("com.amazonaws.bedrock#DeleteResourcePolicy"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "DELETE", - "uri": "/resource-policy/{resourceArn}", - } - ), - ) - ], -) - -GET_RESOURCE_POLICY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetResourcePolicyInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetResourcePolicyRequest", - ) - ], - members={ - "resourceArn": { - "target": RESOURCE_POLICY_RESOURCE_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -RESOURCE_POLICY_DOCUMENT = Schema( - id=ShapeID("com.amazonaws.bedrock#ResourcePolicyDocument"), - shape_type=ShapeType.STRING, -) - -GET_RESOURCE_POLICY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetResourcePolicyOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetResourcePolicyResponse", - ) - ], - members={"resourcePolicy": {"target": RESOURCE_POLICY_DOCUMENT}}, -) - -GET_RESOURCE_POLICY = Schema( - id=ShapeID("com.amazonaws.bedrock#GetResourcePolicy"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "GET", "uri": "/resource-policy/{resourceArn}"} - ), - ) - ], -) - -PUT_RESOURCE_POLICY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#PutResourcePolicyInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#PutResourcePolicyRequest", - ) - ], - members={ - "resourceArn": { - "target": RESOURCE_POLICY_RESOURCE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "resourcePolicy": { - "target": RESOURCE_POLICY_DOCUMENT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -PUT_RESOURCE_POLICY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#PutResourcePolicyOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#PutResourcePolicyResponse", - ) - ], - members={"resourceArn": {"target": RESOURCE_POLICY_RESOURCE_ARN}}, -) - -PUT_RESOURCE_POLICY = Schema( - id=ShapeID("com.amazonaws.bedrock#PutResourcePolicy"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 201, "method": "POST", "uri": "/resource-policy"} - ), - ) - ], -) - -OFFER_TOKEN = Schema( - id=ShapeID("com.amazonaws.bedrock#OfferToken"), shape_type=ShapeType.STRING -) - -CREATE_FOUNDATION_MODEL_AGREEMENT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CreateFoundationModelAgreementInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#CreateFoundationModelAgreementRequest", - ) - ], - members={ - "offerToken": { - "target": OFFER_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelId": { - "target": BEDROCK_MODEL_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -CREATE_FOUNDATION_MODEL_AGREEMENT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CreateFoundationModelAgreementOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#CreateFoundationModelAgreementResponse", - ) - ], - members={ - "modelId": { - "target": BEDROCK_MODEL_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -CREATE_FOUNDATION_MODEL_AGREEMENT = Schema( - id=ShapeID("com.amazonaws.bedrock#CreateFoundationModelAgreement"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 202, - "method": "POST", - "uri": "/create-foundation-model-agreement", - } - ), - ) - ], -) - -DELETE_FOUNDATION_MODEL_AGREEMENT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#DeleteFoundationModelAgreementInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#DeleteFoundationModelAgreementRequest", - ) - ], - members={ - "modelId": { - "target": BEDROCK_MODEL_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -DELETE_FOUNDATION_MODEL_AGREEMENT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#DeleteFoundationModelAgreementOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#DeleteFoundationModelAgreementResponse", - ) - ], -) - -DELETE_FOUNDATION_MODEL_AGREEMENT = Schema( - id=ShapeID("com.amazonaws.bedrock#DeleteFoundationModelAgreement"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 202, - "method": "POST", - "uri": "/delete-foundation-model-agreement", - } - ), - ) - ], -) - -GET_FOUNDATION_MODEL_AVAILABILITY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetFoundationModelAvailabilityInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetFoundationModelAvailabilityRequest", - ) - ], - members={ - "modelId": { - "target": BEDROCK_MODEL_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -AUTHORIZATION_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#AuthorizationStatus"), - shape_type=ShapeType.ENUM, - members={"AUTHORIZED": {"target": UNIT}, "NOT_AUTHORIZED": {"target": UNIT}}, -) - -ENTITLEMENT_AVAILABILITY = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#EntitlementAvailability"), - shape_type=ShapeType.ENUM, - members={"AVAILABLE": {"target": UNIT}, "NOT_AVAILABLE": {"target": UNIT}}, -) - -REGION_AVAILABILITY = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#RegionAvailability"), - shape_type=ShapeType.ENUM, - members={"AVAILABLE": {"target": UNIT}, "NOT_AVAILABLE": {"target": UNIT}}, -) - -GET_FOUNDATION_MODEL_AVAILABILITY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetFoundationModelAvailabilityOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetFoundationModelAvailabilityResponse", - ) - ], - members={ - "modelId": { - "target": BEDROCK_MODEL_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "agreementAvailability": { - "target": AGREEMENT_AVAILABILITY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "authorizationStatus": { - "target": AUTHORIZATION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "entitlementAvailability": { - "target": ENTITLEMENT_AVAILABILITY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "regionAvailability": { - "target": REGION_AVAILABILITY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -GET_FOUNDATION_MODEL_AVAILABILITY = Schema( - id=ShapeID("com.amazonaws.bedrock#GetFoundationModelAvailability"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/foundation-model-availability/{modelId}", - } - ), - ) - ], -) - -OFFER_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#OfferType"), - shape_type=ShapeType.ENUM, - members={"ALL": {"target": UNIT}, "PUBLIC": {"target": UNIT}}, -) - -LIST_FOUNDATION_MODEL_AGREEMENT_OFFERS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ListFoundationModelAgreementOffersInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#ListFoundationModelAgreementOffersRequest", - ) - ], - members={ - "modelId": { - "target": BEDROCK_MODEL_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "offerType": { - "target": OFFER_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="offerType") - ], - }, - }, -) - -OFFER_ID = Schema( - id=ShapeID("com.amazonaws.bedrock#OfferId"), shape_type=ShapeType.STRING -) - -LEGAL_TERM = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#LegalTerm"), members={"url": {"target": STRING}} -) - -SUPPORT_TERM = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#SupportTerm"), - members={"refundPolicyDescription": {"target": STRING}}, -) - -DIMENSIONAL_PRICE_RATE = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#DimensionalPriceRate"), - members={ - "dimension": {"target": STRING}, - "price": {"target": STRING}, - "description": {"target": STRING}, - "unit": {"target": STRING}, - }, -) - -RATE_CARD = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#RateCard"), - shape_type=ShapeType.LIST, - members={"member": {"target": DIMENSIONAL_PRICE_RATE}}, -) - -PRICING_TERM = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#PricingTerm"), - members={ - "rateCard": { - "target": RATE_CARD, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -VALIDITY_TERM = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ValidityTerm"), - members={"agreementDuration": {"target": STRING}}, -) - -TERM_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#TermDetails"), - members={ - "usageBasedPricingTerm": { - "target": PRICING_TERM, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "legalTerm": { - "target": LEGAL_TERM, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "supportTerm": { - "target": SUPPORT_TERM, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "validityTerm": {"target": VALIDITY_TERM}, - }, -) - -OFFER = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#Offer"), - members={ - "offerId": {"target": OFFER_ID}, - "offerToken": { - "target": OFFER_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "termDetails": { - "target": TERM_DETAILS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -OFFERS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#Offers"), - shape_type=ShapeType.LIST, - members={"member": {"target": OFFER}}, -) - -LIST_FOUNDATION_MODEL_AGREEMENT_OFFERS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ListFoundationModelAgreementOffersOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#ListFoundationModelAgreementOffersResponse", - ) - ], - members={ - "modelId": { - "target": BEDROCK_MODEL_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "offers": { - "target": OFFERS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -LIST_FOUNDATION_MODEL_AGREEMENT_OFFERS = Schema( - id=ShapeID("com.amazonaws.bedrock#ListFoundationModelAgreementOffers"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/list-foundation-model-agreement-offers/{modelId}", - } - ), - ) - ], -) - -LIST_TAGS_FOR_RESOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ListTagsForResourceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#ListTagsForResourceRequest", - ) - ], - members={ - "resourceARN": { - "target": TAGGABLE_RESOURCES_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -LIST_TAGS_FOR_RESOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ListTagsForResourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#ListTagsForResourceResponse", - ) - ], - members={"tags": {"target": TAG_LIST}}, -) - -LIST_TAGS_FOR_RESOURCE = Schema( - id=ShapeID("com.amazonaws.bedrock#ListTagsForResource"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "POST", "uri": "/listTagsForResource"} - ), - ) - ], -) - -TAG_RESOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#TagResourceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#TagResourceRequest", - ) - ], - members={ - "resourceARN": { - "target": TAGGABLE_RESOURCES_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "tags": { - "target": TAG_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -TAG_RESOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#TagResourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#TagResourceResponse", - ) - ], -) - -TAG_RESOURCE = Schema( - id=ShapeID("com.amazonaws.bedrock#TagResource"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "POST", "uri": "/tagResource"} - ), - ) - ], -) - -TAG_KEY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#TagKeyList"), - shape_type=ShapeType.LIST, - members={"member": {"target": TAG_KEY}}, -) - -UNTAG_RESOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#UntagResourceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#UntagResourceRequest", - ) - ], - members={ - "resourceARN": { - "target": TAGGABLE_RESOURCES_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "tagKeys": { - "target": TAG_KEY_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -UNTAG_RESOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#UntagResourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#UntagResourceResponse", - ) - ], -) - -UNTAG_RESOURCE = Schema( - id=ShapeID("com.amazonaws.bedrock#UntagResource"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "POST", "uri": "/untagResource"} - ), - ) - ], -) - -BASE_MODEL_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrock#BaseModelIdentifier"), shape_type=ShapeType.STRING -) - -CREATE_MODEL_CUSTOMIZATION_JOB_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CreateModelCustomizationJobInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#CreateModelCustomizationJobRequest", - ) - ], - members={ - "jobName": { - "target": JOB_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "customModelName": { - "target": CUSTOM_MODEL_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "roleArn": { - "target": ROLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientRequestToken": { - "target": IDEMPOTENCY_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "baseModelIdentifier": { - "target": BASE_MODEL_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "customizationType": {"target": CUSTOMIZATION_TYPE}, - "customModelKmsKeyId": {"target": KMS_KEY_ID}, - "jobTags": {"target": TAG_LIST}, - "customModelTags": {"target": TAG_LIST}, - "trainingDataConfig": { - "target": TRAINING_DATA_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "validationDataConfig": {"target": VALIDATION_DATA_CONFIG}, - "outputDataConfig": { - "target": OUTPUT_DATA_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "hyperParameters": {"target": MODEL_CUSTOMIZATION_HYPER_PARAMETERS}, - "vpcConfig": {"target": VPC_CONFIG}, - "customizationConfig": {"target": CUSTOMIZATION_CONFIG}, - }, -) - -CREATE_MODEL_CUSTOMIZATION_JOB_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CreateModelCustomizationJobOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#CreateModelCustomizationJobResponse", - ) - ], - members={ - "jobArn": { - "target": MODEL_CUSTOMIZATION_JOB_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -CREATE_MODEL_CUSTOMIZATION_JOB = Schema( - id=ShapeID("com.amazonaws.bedrock#CreateModelCustomizationJob"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 201, "method": "POST", "uri": "/model-customization-jobs"} - ), - ) - ], -) - -MODEL_CUSTOMIZATION_JOB_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.bedrock#ModelCustomizationJobIdentifier"), - shape_type=ShapeType.STRING, -) - -GET_MODEL_CUSTOMIZATION_JOB_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetModelCustomizationJobInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetModelCustomizationJobRequest", - ) - ], - members={ - "jobIdentifier": { - "target": MODEL_CUSTOMIZATION_JOB_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -MODEL_CUSTOMIZATION_JOB_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ModelCustomizationJobStatus"), - shape_type=ShapeType.ENUM, - members={ - "IN_PROGRESS": {"target": UNIT}, - "COMPLETED": {"target": UNIT}, - "FAILED": {"target": UNIT}, - "STOPPING": {"target": UNIT}, - "STOPPED": {"target": UNIT}, - }, -) - -JOB_STATUS_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#JobStatusDetails"), - shape_type=ShapeType.ENUM, - members={ - "IN_PROGRESS": {"target": UNIT}, - "COMPLETED": {"target": UNIT}, - "STOPPING": {"target": UNIT}, - "STOPPED": {"target": UNIT}, - "FAILED": {"target": UNIT}, - "NOT_STARTED": {"target": UNIT}, - }, -) - -DATA_PROCESSING_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#DataProcessingDetails"), - members={ - "status": {"target": JOB_STATUS_DETAILS}, - "creationTime": {"target": TIMESTAMP}, - "lastModifiedTime": {"target": TIMESTAMP}, - }, +LIST_TAGS_FOR_RESOURCE_INPUT: StaticSchema = ( + 18, + n0, + _LTFRI, + {_sSI: _cLTFRR, _smit: None}, + (_rARN,), + ((TAGGABLE_RESOURCES_ARN, 1),), +) + +LIST_TAGS_FOR_RESOURCE_OUTPUT: StaticSchema = ( + 18, + n0, + _LTFRO, + {_sSI: _cLTFRRo, _smith: None}, + (_ta,), + ((TAG_LIST, 0),), +) + +LIST_TAGS_FOR_RESOURCE: StaticOperationSchema = ( + 23, + n0, + _LTFR, + { + _smithy: MappingProxyType( + {"code": 200, "method": "POST", "uri": "/listTagsForResource"} + ) + }, + LIST_TAGS_FOR_RESOURCE_INPUT, + LIST_TAGS_FOR_RESOURCE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -TRAINING_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#TrainingDetails"), - members={ - "status": {"target": JOB_STATUS_DETAILS}, - "creationTime": {"target": TIMESTAMP}, - "lastModifiedTime": {"target": TIMESTAMP}, - }, +TAG_RESOURCE_INPUT: StaticSchema = ( + 18, + n0, + _TRI, + {_sSI: _cTRR, _smit: None}, + (_rARN, _ta), + ((TAGGABLE_RESOURCES_ARN, 1), (TAG_LIST, 1)), +) + +TAG_RESOURCE_OUTPUT: StaticSchema = (18, n0, _TRO, {_sSI: _cTRRo, _smith: None}) + +TAG_RESOURCE: StaticOperationSchema = ( + 23, + n0, + _TR, + {_smithy: MappingProxyType({"code": 200, "method": "POST", "uri": "/tagResource"})}, + TAG_RESOURCE_INPUT, + TAG_RESOURCE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + TOO_MANY_TAGS_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -VALIDATION_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ValidationDetails"), - members={ - "status": {"target": JOB_STATUS_DETAILS}, - "creationTime": {"target": TIMESTAMP}, - "lastModifiedTime": {"target": TIMESTAMP}, - }, -) +TAG_KEY_LIST: StaticSchema = (16, n0, _TKL, 0, (_me,), ((TAG_KEY, 0),)) -STATUS_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#StatusDetails"), - members={ - "validationDetails": {"target": VALIDATION_DETAILS}, - "dataProcessingDetails": {"target": DATA_PROCESSING_DETAILS}, - "trainingDetails": {"target": TRAINING_DETAILS}, - }, +UNTAG_RESOURCE_INPUT: StaticSchema = ( + 18, + n0, + _URI, + {_sSI: _cURR, _smit: None}, + (_rARN, _tK), + ((TAGGABLE_RESOURCES_ARN, 1), (TAG_KEY_LIST, 1)), ) -GET_MODEL_CUSTOMIZATION_JOB_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetModelCustomizationJobOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetModelCustomizationJobResponse", - ) - ], - members={ - "jobArn": { - "target": MODEL_CUSTOMIZATION_JOB_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "jobName": { - "target": JOB_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "outputModelName": { - "target": CUSTOM_MODEL_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "outputModelArn": {"target": CUSTOM_MODEL_ARN}, - "clientRequestToken": {"target": IDEMPOTENCY_TOKEN}, - "roleArn": { - "target": ROLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": {"target": MODEL_CUSTOMIZATION_JOB_STATUS}, - "statusDetails": {"target": STATUS_DETAILS}, - "failureMessage": {"target": ERROR_MESSAGE}, - "creationTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastModifiedTime": {"target": TIMESTAMP}, - "endTime": {"target": TIMESTAMP}, - "baseModelArn": { - "target": FOUNDATION_MODEL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "hyperParameters": {"target": MODEL_CUSTOMIZATION_HYPER_PARAMETERS}, - "trainingDataConfig": { - "target": TRAINING_DATA_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "validationDataConfig": { - "target": VALIDATION_DATA_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "outputDataConfig": { - "target": OUTPUT_DATA_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "customizationType": {"target": CUSTOMIZATION_TYPE}, - "outputModelKmsKeyArn": {"target": KMS_KEY_ARN}, - "trainingMetrics": {"target": TRAINING_METRICS}, - "validationMetrics": {"target": VALIDATION_METRICS}, - "vpcConfig": {"target": VPC_CONFIG}, - "customizationConfig": {"target": CUSTOMIZATION_CONFIG}, - }, -) +UNTAG_RESOURCE_OUTPUT: StaticSchema = (18, n0, _URO, {_sSI: _cURRo, _smith: None}) -GET_MODEL_CUSTOMIZATION_JOB = Schema( - id=ShapeID("com.amazonaws.bedrock#GetModelCustomizationJob"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/model-customization-jobs/{jobIdentifier}", - } - ), +UNTAG_RESOURCE: StaticOperationSchema = ( + 23, + n0, + _UR, + { + _smithy: MappingProxyType( + {"code": 200, "method": "POST", "uri": "/untagResource"} ) - ], -) - -FINE_TUNING_JOB_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#FineTuningJobStatus"), - shape_type=ShapeType.ENUM, - members={ - "IN_PROGRESS": {"target": UNIT}, - "COMPLETED": {"target": UNIT}, - "FAILED": {"target": UNIT}, - "STOPPING": {"target": UNIT}, - "STOPPED": {"target": UNIT}, }, + UNTAG_RESOURCE_INPUT, + UNTAG_RESOURCE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -LIST_MODEL_CUSTOMIZATION_JOBS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ListModelCustomizationJobsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#ListModelCustomizationJobsRequest", - ) - ], - members={ - "creationTimeAfter": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="creationTimeAfter") - ], - }, - "creationTimeBefore": { - "target": TIMESTAMP, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpQuery"), value="creationTimeBefore" - ) - ], - }, - "statusEquals": { - "target": FINE_TUNING_JOB_STATUS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="statusEquals") - ], - }, - "nameContains": { - "target": JOB_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nameContains") - ], - }, - "maxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "nextToken": { - "target": PAGINATION_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "sortBy": { - "target": SORT_JOBS_BY, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="sortBy")], - }, - "sortOrder": { - "target": SORT_ORDER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="sortOrder") - ], - }, - }, +BASE_MODEL_IDENTIFIER: StaticSchema = (3, n0, _BMIa, 0) + +CREATE_MODEL_CUSTOMIZATION_JOB_INPUT: StaticSchema = ( + 18, + n0, + _CMCJIr, + {_sSI: _cCMCJRom, _smit: None}, + ( + _jN, + _cMN, + _rA, + _cRT, + _bMIa, + _cTu, + _cMKKI, + _jTo, + _cMT, + _tDC, + _vDC, + _oDC, + _hP, + _vCp, + _cC, + ), + ( + (JOB_NAME, 1), + (CUSTOM_MODEL_NAME, 1), + (ROLE_ARN, 1), + (IDEMPOTENCY_TOKEN, 2), + (BASE_MODEL_IDENTIFIER, 1), + (CUSTOMIZATION_TYPE, 0), + (KMS_KEY_ID, 0), + (TAG_LIST, 0), + (TAG_LIST, 0), + (TRAINING_DATA_CONFIG, 1), + (VALIDATION_DATA_CONFIG, 0), + (OUTPUT_DATA_CONFIG, 1), + (MODEL_CUSTOMIZATION_HYPER_PARAMETERS, 0), + (VPC_CONFIG, 0), + (CUSTOMIZATION_CONFIG, 0), + ), ) -MODEL_CUSTOMIZATION_JOB_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ModelCustomizationJobSummary"), - members={ - "jobArn": { - "target": MODEL_CUSTOMIZATION_JOB_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "baseModelArn": { - "target": MODEL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "jobName": { - "target": JOB_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": MODEL_CUSTOMIZATION_JOB_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "statusDetails": {"target": STATUS_DETAILS}, - "lastModifiedTime": {"target": TIMESTAMP}, - "creationTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "endTime": {"target": TIMESTAMP}, - "customModelArn": {"target": CUSTOM_MODEL_ARN}, - "customModelName": {"target": CUSTOM_MODEL_NAME}, - "customizationType": {"target": CUSTOMIZATION_TYPE}, - }, +CREATE_MODEL_CUSTOMIZATION_JOB_OUTPUT: StaticSchema = ( + 18, + n0, + _CMCJOr, + {_sSI: _cCMCJRoma, _smith: None}, + (_jA,), + ((MODEL_CUSTOMIZATION_JOB_ARN, 1),), +) + +CREATE_MODEL_CUSTOMIZATION_JOB: StaticOperationSchema = ( + 23, + n0, + _CMCJr, + { + _smithy: MappingProxyType( + {"code": 201, "method": "POST", "uri": "/model-customization-jobs"} + ) + }, + CREATE_MODEL_CUSTOMIZATION_JOB_INPUT, + CREATE_MODEL_CUSTOMIZATION_JOB_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + TOO_MANY_TAGS_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -MODEL_CUSTOMIZATION_JOB_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ModelCustomizationJobSummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": MODEL_CUSTOMIZATION_JOB_SUMMARY}}, +MODEL_CUSTOMIZATION_JOB_IDENTIFIER: StaticSchema = (3, n0, _MCJI, 0) + +GET_MODEL_CUSTOMIZATION_JOB_INPUT: StaticSchema = ( + 18, + n0, + _GMCJIe, + {_sSI: _cGMCJRom, _smit: None}, + (_jIo,), + ((MODEL_CUSTOMIZATION_JOB_IDENTIFIER, 9),), +) + +MODEL_CUSTOMIZATION_JOB_STATUS: StaticSchema = ( + 14, + n0, + _MCJSode, + 0, + (_IP, _COMPLETED, _FAILED, _STOPPING, _STOPPED), + ( + (-1, {_sV: _IPn}), + (-1, {_sV: _C}), + (-1, {_sV: _F}), + (-1, {_sV: _S}), + (-1, {_sV: _St}), + ), ) -LIST_MODEL_CUSTOMIZATION_JOBS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#ListModelCustomizationJobsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#ListModelCustomizationJobsResponse", - ) - ], - members={ - "nextToken": {"target": PAGINATION_TOKEN}, - "modelCustomizationJobSummaries": {"target": MODEL_CUSTOMIZATION_JOB_SUMMARIES}, - }, +JOB_STATUS_DETAILS: StaticSchema = ( + 14, + n0, + _JSD, + 0, + (_IP, _COMPLETED, _STOPPING, _STOPPED, _FAILED, _NS), + ( + (-1, {_sV: _IPn}), + (-1, {_sV: _C}), + (-1, {_sV: _S}), + (-1, {_sV: _St}), + (-1, {_sV: _F}), + (-1, {_sV: _NSo}), + ), ) -LIST_MODEL_CUSTOMIZATION_JOBS = Schema( - id=ShapeID("com.amazonaws.bedrock#ListModelCustomizationJobs"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 200, "method": "GET", "uri": "/model-customization-jobs"} - ), - ) - ], +DATA_PROCESSING_DETAILS: StaticSchema = ( + 18, + n0, + _DPD, + 0, + (_st, _cTr, _lMT), + ((JOB_STATUS_DETAILS, 0), (TIMESTAMP, 0), (TIMESTAMP, 0)), +) + +TRAINING_DETAILS: StaticSchema = ( + 18, + n0, + _TDr, + 0, + (_st, _cTr, _lMT), + ((JOB_STATUS_DETAILS, 0), (TIMESTAMP, 0), (TIMESTAMP, 0)), +) + +VALIDATION_DETAILS: StaticSchema = ( + 18, + n0, + _VD, + 0, + (_st, _cTr, _lMT), + ((JOB_STATUS_DETAILS, 0), (TIMESTAMP, 0), (TIMESTAMP, 0)), +) + +STATUS_DETAILS: StaticSchema = ( + 18, + n0, + _SDt, + 0, + (_vD, _dPD, _tDr), + ((VALIDATION_DETAILS, 0), (DATA_PROCESSING_DETAILS, 0), (TRAINING_DETAILS, 0)), +) + +GET_MODEL_CUSTOMIZATION_JOB_OUTPUT: StaticSchema = ( + 18, + n0, + _GMCJOe, + {_sSI: _cGMCJRoma, _smith: None}, + ( + _jA, + _jN, + _oMN, + _oMA, + _cRT, + _rA, + _st, + _sD, + _fM, + _cTr, + _lMT, + _eT, + _bMA, + _hP, + _tDC, + _vDC, + _oDC, + _cTu, + _oMKKA, + _tM, + _vM, + _vCp, + _cC, + ), + ( + (MODEL_CUSTOMIZATION_JOB_ARN, 1), + (JOB_NAME, 1), + (CUSTOM_MODEL_NAME, 1), + (CUSTOM_MODEL_ARN, 0), + (IDEMPOTENCY_TOKEN, 0), + (ROLE_ARN, 1), + (MODEL_CUSTOMIZATION_JOB_STATUS, 0), + (STATUS_DETAILS, 0), + (ERROR_MESSAGE, 0), + (TIMESTAMP, 1), + (TIMESTAMP, 0), + (TIMESTAMP, 0), + (FOUNDATION_MODEL_ARN, 1), + (MODEL_CUSTOMIZATION_HYPER_PARAMETERS, 0), + (TRAINING_DATA_CONFIG, 1), + (VALIDATION_DATA_CONFIG, 1), + (OUTPUT_DATA_CONFIG, 1), + (CUSTOMIZATION_TYPE, 0), + (KMS_KEY_ARN, 0), + (TRAINING_METRICS, 0), + (VALIDATION_METRICS, 0), + (VPC_CONFIG, 0), + (CUSTOMIZATION_CONFIG, 0), + ), ) -STOP_MODEL_CUSTOMIZATION_JOB_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#StopModelCustomizationJobInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#StopModelCustomizationJobRequest", - ) - ], - members={ - "jobIdentifier": { - "target": MODEL_CUSTOMIZATION_JOB_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, +GET_MODEL_CUSTOMIZATION_JOB: StaticOperationSchema = ( + 23, + n0, + _GMCJe, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "GET", + "uri": "/model-customization-jobs/{jobIdentifier}", + } + ) + }, + GET_MODEL_CUSTOMIZATION_JOB_INPUT, + GET_MODEL_CUSTOMIZATION_JOB_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -STOP_MODEL_CUSTOMIZATION_JOB_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#StopModelCustomizationJobOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#StopModelCustomizationJobResponse", - ) - ], -) - -STOP_MODEL_CUSTOMIZATION_JOB = Schema( - id=ShapeID("com.amazonaws.bedrock#StopModelCustomizationJob"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "POST", - "uri": "/model-customization-jobs/{jobIdentifier}/stop", - } - ), - ) - ], -) - -RETRIEVAL_FILTER = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#RetrievalFilter"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "equals": {"target": FILTER_ATTRIBUTE}, - "notEquals": {"target": FILTER_ATTRIBUTE}, - "greaterThan": {"target": FILTER_ATTRIBUTE}, - "greaterThanOrEquals": {"target": FILTER_ATTRIBUTE}, - "lessThan": {"target": FILTER_ATTRIBUTE}, - "lessThanOrEquals": {"target": FILTER_ATTRIBUTE}, - "in": {"target": FILTER_ATTRIBUTE}, - "notIn": {"target": FILTER_ATTRIBUTE}, - "startsWith": {"target": FILTER_ATTRIBUTE}, - "listContains": {"target": FILTER_ATTRIBUTE}, - "stringContains": {"target": FILTER_ATTRIBUTE}, - # This needs to reference a schema that isn't defined yet. - # It will be populated with a non-null value at the end of the file. - "andAll": None, - # This needs to reference a schema that isn't defined yet. - # It will be populated with a non-null value at the end of the file. - "orAll": None, - }, +FINE_TUNING_JOB_STATUS: StaticSchema = ( + 14, + n0, + _FTJS, + 0, + (_IP, _COMPLETED, _FAILED, _STOPPING, _STOPPED), + ( + (-1, {_sV: _IPn}), + (-1, {_sV: _C}), + (-1, {_sV: _F}), + (-1, {_sV: _S}), + (-1, {_sV: _St}), + ), ) -RETRIEVAL_FILTER_LIST = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#RetrievalFilterList"), - shape_type=ShapeType.LIST, - members={"member": {"target": RETRIEVAL_FILTER}}, +LIST_MODEL_CUSTOMIZATION_JOBS_INPUT: StaticSchema = ( + 18, + n0, + _LMCJIi, + {_sSI: _cLMCJRom, _smit: None}, + (_cTA, _cTB, _sEt, _nC, _mR, _nT, _sB, _sO), + ( + (TIMESTAMP, {_sQ: _cTA}), + (TIMESTAMP, {_sQ: _cTB}), + (FINE_TUNING_JOB_STATUS, {_sQ: _sEt}), + (JOB_NAME, {_sQ: _nC}), + (MAX_RESULTS, {_sQ: _mR}), + (PAGINATION_TOKEN, {_sQ: _nT}), + (SORT_JOBS_BY, {_sQ: _sB}), + (SORT_ORDER, {_sQ: _sO}), + ), ) -KNOWLEDGE_BASE_VECTOR_SEARCH_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#KnowledgeBaseVectorSearchConfiguration"), - members={ - "numberOfResults": {"target": INTEGER}, - "overrideSearchType": {"target": SEARCH_TYPE}, - "filter": {"target": RETRIEVAL_FILTER}, - "implicitFilterConfiguration": {"target": IMPLICIT_FILTER_CONFIGURATION}, - "rerankingConfiguration": {"target": VECTOR_SEARCH_RERANKING_CONFIGURATION}, - }, +MODEL_CUSTOMIZATION_JOB_SUMMARY: StaticSchema = ( + 18, + n0, + _MCJSodel, + 0, + (_jA, _bMA, _jN, _st, _sD, _lMT, _cTr, _eT, _cMA, _cMN, _cTu), + ( + (MODEL_CUSTOMIZATION_JOB_ARN, 1), + (MODEL_ARN, 1), + (JOB_NAME, 1), + (MODEL_CUSTOMIZATION_JOB_STATUS, 1), + (STATUS_DETAILS, 0), + (TIMESTAMP, 0), + (TIMESTAMP, 1), + (TIMESTAMP, 0), + (CUSTOM_MODEL_ARN, 0), + (CUSTOM_MODEL_NAME, 0), + (CUSTOMIZATION_TYPE, 0), + ), ) -KNOWLEDGE_BASE_RETRIEVAL_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#KnowledgeBaseRetrievalConfiguration"), - members={ - "vectorSearchConfiguration": { - "target": KNOWLEDGE_BASE_VECTOR_SEARCH_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +MODEL_CUSTOMIZATION_JOB_SUMMARIES: StaticSchema = ( + 16, + n0, + _MCJSodelu, + 0, + (_me,), + ((MODEL_CUSTOMIZATION_JOB_SUMMARY, 0),), +) + +LIST_MODEL_CUSTOMIZATION_JOBS_OUTPUT: StaticSchema = ( + 18, + n0, + _LMCJOi, + {_sSI: _cLMCJRoma, _smith: None}, + (_nT, _mCJSo), + ((PAGINATION_TOKEN, 0), (MODEL_CUSTOMIZATION_JOB_SUMMARIES, 0)), +) + +LIST_MODEL_CUSTOMIZATION_JOBS: StaticOperationSchema = ( + 23, + n0, + _LMCJi, + { + _smithy: MappingProxyType( + {"code": 200, "method": "GET", "uri": "/model-customization-jobs"} + ) + }, + LIST_MODEL_CUSTOMIZATION_JOBS_INPUT, + LIST_MODEL_CUSTOMIZATION_JOBS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -KNOWLEDGE_BASE_RETRIEVE_AND_GENERATE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#KnowledgeBaseRetrieveAndGenerateConfiguration"), - members={ - "knowledgeBaseId": { - "target": KNOWLEDGE_BASE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "modelArn": { - "target": BEDROCK_MODEL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "retrievalConfiguration": {"target": KNOWLEDGE_BASE_RETRIEVAL_CONFIGURATION}, - "generationConfiguration": {"target": GENERATION_CONFIGURATION}, - "orchestrationConfiguration": {"target": ORCHESTRATION_CONFIGURATION}, - }, +STOP_MODEL_CUSTOMIZATION_JOB_INPUT: StaticSchema = ( + 18, + n0, + _SMCJI, + {_sSI: _cSMCJR, _smit: None}, + (_jIo,), + ((MODEL_CUSTOMIZATION_JOB_IDENTIFIER, 9),), +) + +STOP_MODEL_CUSTOMIZATION_JOB_OUTPUT: StaticSchema = ( + 18, + n0, + _SMCJO, + {_sSI: _cSMCJRo, _smith: None}, +) + +STOP_MODEL_CUSTOMIZATION_JOB: StaticOperationSchema = ( + 23, + n0, + _SMCJ, + { + _smithy: MappingProxyType( + { + "code": 200, + "method": "POST", + "uri": "/model-customization-jobs/{jobIdentifier}/stop", + } + ) + }, + STOP_MODEL_CUSTOMIZATION_JOB_INPUT, + STOP_MODEL_CUSTOMIZATION_JOB_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -RETRIEVE_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#RetrieveConfig"), - members={ - "knowledgeBaseId": { - "target": KNOWLEDGE_BASE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "knowledgeBaseRetrievalConfiguration": { - "target": KNOWLEDGE_BASE_RETRIEVAL_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +RETRIEVAL_FILTER: StaticSchema = ( + 19, + n0, + _RF, + 4, + (_eq, _nE, _gT, _gTOE, _lTes, _lTOE, _in_, _nI, _sW, _lCi, _sCt, _aA, _oA), + ( + (FILTER_ATTRIBUTE, 0), + (FILTER_ATTRIBUTE, 0), + (FILTER_ATTRIBUTE, 0), + (FILTER_ATTRIBUTE, 0), + (FILTER_ATTRIBUTE, 0), + (FILTER_ATTRIBUTE, 0), + (FILTER_ATTRIBUTE, 0), + (FILTER_ATTRIBUTE, 0), + (FILTER_ATTRIBUTE, 0), + (FILTER_ATTRIBUTE, 0), + (FILTER_ATTRIBUTE, 0), + (lambda: RETRIEVAL_FILTER_LIST, 0), + (lambda: RETRIEVAL_FILTER_LIST, 0), + ), ) -RETRIEVE_AND_GENERATE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#RetrieveAndGenerateConfiguration"), - members={ - "type": { - "target": RETRIEVE_AND_GENERATE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "knowledgeBaseConfiguration": { - "target": KNOWLEDGE_BASE_RETRIEVE_AND_GENERATE_CONFIGURATION - }, - "externalSourcesConfiguration": { - "target": EXTERNAL_SOURCES_RETRIEVE_AND_GENERATE_CONFIGURATION - }, - }, +RETRIEVAL_FILTER_LIST: StaticSchema = ( + 16, + n0, + _RFL, + 0, + (_me,), + ((RETRIEVAL_FILTER, 0),), +) + +KNOWLEDGE_BASE_VECTOR_SEARCH_CONFIGURATION: StaticSchema = ( + 18, + n0, + _KBVSC, + 0, + (_nOR, _oST, _fil, _iFC, _rCer), + ( + (7, 0), + (SEARCH_TYPE, 0), + (RETRIEVAL_FILTER, 0), + (IMPLICIT_FILTER_CONFIGURATION, 0), + (VECTOR_SEARCH_RERANKING_CONFIGURATION, 0), + ), ) -KNOWLEDGE_BASE_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#KnowledgeBaseConfig"), - shape_type=ShapeType.UNION, - members={ - "retrieveConfig": {"target": RETRIEVE_CONFIG}, - "retrieveAndGenerateConfig": {"target": RETRIEVE_AND_GENERATE_CONFIGURATION}, - }, +KNOWLEDGE_BASE_RETRIEVAL_CONFIGURATION: StaticSchema = ( + 18, + n0, + _KBRC, + 0, + (_vSC,), + ((KNOWLEDGE_BASE_VECTOR_SEARCH_CONFIGURATION, 1),), +) + +KNOWLEDGE_BASE_RETRIEVE_AND_GENERATE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _KBRAGC, + 0, + (_kBI, _mA, _rCet, _gCe, _oCr), + ( + (KNOWLEDGE_BASE_ID, 1), + (BEDROCK_MODEL_ARN, 1), + (KNOWLEDGE_BASE_RETRIEVAL_CONFIGURATION, 0), + (GENERATION_CONFIGURATION, 0), + (ORCHESTRATION_CONFIGURATION, 0), + ), ) -RAG_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#RAGConfig"), - shape_type=ShapeType.UNION, - members={ - "knowledgeBaseConfig": {"target": KNOWLEDGE_BASE_CONFIG}, - "precomputedRagSourceConfig": { - "target": EVALUATION_PRECOMPUTED_RAG_SOURCE_CONFIG - }, - }, +RETRIEVE_CONFIG: StaticSchema = ( + 18, + n0, + _RCe, + 0, + (_kBI, _kBRC), + ((KNOWLEDGE_BASE_ID, 1), (KNOWLEDGE_BASE_RETRIEVAL_CONFIGURATION, 1)), +) + +RETRIEVE_AND_GENERATE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _RAGC, + 0, + (_ty, _kBC, _eSC), + ( + (RETRIEVE_AND_GENERATE_TYPE, 1), + (KNOWLEDGE_BASE_RETRIEVE_AND_GENERATE_CONFIGURATION, 0), + (EXTERNAL_SOURCES_RETRIEVE_AND_GENERATE_CONFIGURATION, 0), + ), ) -RAG_CONFIGS = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#RagConfigs"), - shape_type=ShapeType.LIST, - members={"member": {"target": RAG_CONFIG}}, +KNOWLEDGE_BASE_CONFIG: StaticSchema = ( + 19, + n0, + _KBC, + 0, + (_rCetr, _rAGC), + ((RETRIEVE_CONFIG, 0), (RETRIEVE_AND_GENERATE_CONFIGURATION, 0)), +) + +RAG_CONFIG: StaticSchema = ( + 19, + n0, + _RAGCo, + 0, + (_kBCn, _pRSC), + ((KNOWLEDGE_BASE_CONFIG, 0), (EVALUATION_PRECOMPUTED_RAG_SOURCE_CONFIG, 0)), +) + +RAG_CONFIGS: StaticSchema = (16, n0, _RCag, 0, (_me,), ((RAG_CONFIG, 0),)) + +EVALUATION_INFERENCE_CONFIG: StaticSchema = ( + 19, + n0, + _EIC, + 0, + (_mod, _rCag), + ((EVALUATION_MODEL_CONFIGS, 0), (RAG_CONFIGS, 0)), +) + +CREATE_EVALUATION_JOB_INPUT: StaticSchema = ( + 18, + n0, + _CEJI, + {_sSI: _cCEJRo, _smit: None}, + (_jN, _jD, _cRT, _rA, _cEKI, _jTo, _aTp, _eCv, _iC, _oDC), + ( + (EVALUATION_JOB_NAME, 1), + (EVALUATION_JOB_DESCRIPTION, 0), + (IDEMPOTENCY_TOKEN, 2), + (ROLE_ARN, 1), + (KMS_KEY_ID, 0), + (TAG_LIST, 0), + (APPLICATION_TYPE, 0), + (EVALUATION_CONFIG, 1), + (EVALUATION_INFERENCE_CONFIG, 1), + (EVALUATION_OUTPUT_DATA_CONFIG, 1), + ), ) -EVALUATION_INFERENCE_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#EvaluationInferenceConfig"), - shape_type=ShapeType.UNION, - members={ - "models": {"target": EVALUATION_MODEL_CONFIGS}, - "ragConfigs": {"target": RAG_CONFIGS}, - }, +GET_EVALUATION_JOB_OUTPUT: StaticSchema = ( + 18, + n0, + _GEJO, + {_sSI: _cGEJRo, _smith: None}, + (_jN, _st, _jA, _jD, _rA, _cEKI, _jT, _aTp, _eCv, _iC, _oDC, _cTr, _lMT, _fMai), + ( + (EVALUATION_JOB_NAME, 1), + (EVALUATION_JOB_STATUS, 1), + (EVALUATION_JOB_ARN, 1), + (EVALUATION_JOB_DESCRIPTION, 0), + (ROLE_ARN, 1), + (KMS_KEY_ID, 0), + (EVALUATION_JOB_TYPE, 1), + (APPLICATION_TYPE, 0), + (EVALUATION_CONFIG, 1), + (EVALUATION_INFERENCE_CONFIG, 1), + (EVALUATION_OUTPUT_DATA_CONFIG, 1), + (TIMESTAMP, 1), + (TIMESTAMP, 0), + (ERROR_MESSAGES, 0), + ), ) -CREATE_EVALUATION_JOB_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#CreateEvaluationJobInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#CreateEvaluationJobRequest", - ) - ], - members={ - "jobName": { - "target": EVALUATION_JOB_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "jobDescription": {"target": EVALUATION_JOB_DESCRIPTION}, - "clientRequestToken": { - "target": IDEMPOTENCY_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "roleArn": { - "target": ROLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "customerEncryptionKeyId": {"target": KMS_KEY_ID}, - "jobTags": {"target": TAG_LIST}, - "applicationType": {"target": APPLICATION_TYPE}, - "evaluationConfig": { - "target": EVALUATION_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "inferenceConfig": { - "target": EVALUATION_INFERENCE_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "outputDataConfig": { - "target": EVALUATION_OUTPUT_DATA_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +CREATE_EVALUATION_JOB: StaticOperationSchema = ( + 23, + n0, + _CEJ, + { + _smithy: MappingProxyType( + {"code": 202, "method": "POST", "uri": "/evaluation-jobs"} + ) + }, + CREATE_EVALUATION_JOB_INPUT, + CREATE_EVALUATION_JOB_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -GET_EVALUATION_JOB_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.bedrock#GetEvaluationJobOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.bedrock#GetEvaluationJobResponse", +GET_EVALUATION_JOB: StaticOperationSchema = ( + 23, + n0, + _GEJ, + { + _smithy: MappingProxyType( + {"code": 200, "method": "GET", "uri": "/evaluation-jobs/{jobIdentifier}"} ) - ], - members={ - "jobName": { - "target": EVALUATION_JOB_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": EVALUATION_JOB_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "jobArn": { - "target": EVALUATION_JOB_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "jobDescription": {"target": EVALUATION_JOB_DESCRIPTION}, - "roleArn": { - "target": ROLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "customerEncryptionKeyId": {"target": KMS_KEY_ID}, - "jobType": { - "target": EVALUATION_JOB_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "applicationType": {"target": APPLICATION_TYPE}, - "evaluationConfig": { - "target": EVALUATION_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "inferenceConfig": { - "target": EVALUATION_INFERENCE_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "outputDataConfig": { - "target": EVALUATION_OUTPUT_DATA_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "creationTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastModifiedTime": {"target": TIMESTAMP}, - "failureMessages": {"target": ERROR_MESSAGES}, }, + GET_EVALUATION_JOB_INPUT, + GET_EVALUATION_JOB_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CREATE_EVALUATION_JOB = Schema( - id=ShapeID("com.amazonaws.bedrock#CreateEvaluationJob"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"code": 202, "method": "POST", "uri": "/evaluation-jobs"} - ), - ) - ], -) - -GET_EVALUATION_JOB = Schema( - id=ShapeID("com.amazonaws.bedrock#GetEvaluationJob"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/evaluation-jobs/{jobIdentifier}", - } - ), - ) - ], -) - -AMAZON_BEDROCK_CONTROL_PLANE_SERVICE = Schema( - id=ShapeID("com.amazonaws.bedrock#AmazonBedrockControlPlaneService"), - shape_type=ShapeType.SERVICE, - traits=[ - Trait.new( - id=ShapeID("aws.auth#sigv4"), value=MappingProxyType({"name": "bedrock"}) - ), - Trait.new( - id=ShapeID("smithy.rules#endpointBdd"), - value=MappingProxyType( - { - "version": "1.1", - "parameters": MappingProxyType( - { - "Region": MappingProxyType( - { - "builtIn": "AWS::Region", - "required": False, - "documentation": "The AWS region used to dispatch the request.", - "type": "string", - } - ), - "UseDualStack": MappingProxyType( - { - "builtIn": "AWS::UseDualStack", - "required": True, - "default": False, - "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", - "type": "boolean", - } - ), - "UseFIPS": MappingProxyType( - { - "builtIn": "AWS::UseFIPS", - "required": True, - "default": False, - "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", - "type": "boolean", - } - ), - "Endpoint": MappingProxyType( - { - "builtIn": "SDK::Endpoint", - "required": False, - "documentation": "Override the endpoint used to send this request", - "type": "string", - } - ), - } - ), - "conditions": ( - MappingProxyType( - { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "Endpoint"}),), - } - ), - MappingProxyType( - { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "Region"}),), - } - ), - MappingProxyType( +AMAZON_BEDROCK_CONTROL_PLANE_SERVICE: StaticSchema = ( + 21, + n0, + _ABCPS, + { + _aw: MappingProxyType({"name": "bedrock"}), + _sBm: MappingProxyType( + { + "version": "1.1", + "parameters": MappingProxyType( + { + "Region": MappingProxyType( { - "fn": "aws.partition", - "argv": (MappingProxyType({"ref": "Region"}),), - "assign": "PartitionResult", + "builtIn": "AWS::Region", + "required": False, + "documentation": "The AWS region used to dispatch the request.", + "type": "string", } ), - MappingProxyType( + "UseDualStack": MappingProxyType( { - "fn": "booleanEquals", - "argv": (MappingProxyType({"ref": "UseFIPS"}), True), + "builtIn": "AWS::UseDualStack", + "required": True, + "default": False, + "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", + "type": "boolean", } ), - MappingProxyType( + "UseFIPS": MappingProxyType( { - "fn": "booleanEquals", - "argv": ( - MappingProxyType({"ref": "UseDualStack"}), - True, - ), - } - ), - MappingProxyType( - { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "supportsDualStack", - ), - } - ), - True, - ), + "builtIn": "AWS::UseFIPS", + "required": True, + "default": False, + "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", + "type": "boolean", } ), - MappingProxyType( + "Endpoint": MappingProxyType( { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "supportsFIPS", - ), - } - ), - True, - ), + "builtIn": "SDK::Endpoint", + "required": False, + "documentation": "Override the endpoint used to send this request", + "type": "string", } ), + } + ), + "conditions": ( + MappingProxyType( + { + "fn": "isSet", + "argv": (MappingProxyType({"ref": "Endpoint"}),), + } ), - "results": ( - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: FIPS and custom endpoint are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": MappingProxyType({"ref": "Endpoint"}), - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://bedrock-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "FIPS and DualStack are enabled, but this partition does not support one or both", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://bedrock-fips.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "FIPS is enabled but this partition does not support FIPS", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + MappingProxyType( + {"fn": "isSet", "argv": (MappingProxyType({"ref": "Region"}),)} + ), + MappingProxyType( + { + "fn": "aws.partition", + "argv": (MappingProxyType({"ref": "Region"}),), + "assign": "PartitionResult", + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": (MappingProxyType({"ref": "UseFIPS"}), True), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": (MappingProxyType({"ref": "UseDualStack"}), True), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( { - "url": "https://bedrock.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "supportsDualStack", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "DualStack is enabled but this partition does not support DualStack", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + True, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( { - "url": "https://bedrock.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "supportsFIPS", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: Missing Region", - "type": "error", - } - ), + True, + ), + } ), - "root": 2, - "nodeCount": 13, - "nodes": "/////wAAAAH/////AAAAAAAAAAwAAAADAAAAAQAAAAQF9eELAAAAAgAAAAUF9eELAAAAAwAAAAgAAAAGAAAABAAAAAcF9eEKAAAABQX14QgF9eEJAAAABAAAAAoAAAAJAAAABgX14QYF9eEHAAAABQAAAAsF9eEFAAAABgX14QQF9eEFAAAAAwX14QEAAAANAAAABAX14QIF9eED", - } - ), - ), - Trait.new( - id=ShapeID("aws.api#service"), - value=MappingProxyType({"sdkId": "Bedrock", "endpointPrefix": "bedrock"}), + ), + "results": ( + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: FIPS and custom endpoint are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": MappingProxyType({"ref": "Endpoint"}), + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://bedrock-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS and DualStack are enabled, but this partition does not support one or both", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://bedrock-fips.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS is enabled but this partition does not support FIPS", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://bedrock.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "DualStack is enabled but this partition does not support DualStack", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://bedrock.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Missing Region", + "type": "error", + } + ), + ), + "root": 2, + "nodeCount": 13, + "nodes": "/////wAAAAH/////AAAAAAAAAAwAAAADAAAAAQAAAAQF9eELAAAAAgAAAAUF9eELAAAAAwAAAAgAAAAGAAAABAAAAAcF9eEKAAAABQX14QgF9eEJAAAABAAAAAoAAAAJAAAABgX14QYF9eEHAAAABQAAAAsF9eEFAAAABgX14QQF9eEFAAAAAwX14QEAAAANAAAABAX14QIF9eED", + } ), - Trait.new(id=ShapeID("aws.protocols#restJson1")), - Trait.new(id=ShapeID("smithy.api#httpBearerAuth")), - ], -) - -RETRIEVAL_FILTER.members["andAll"] = Schema.member( - id=RETRIEVAL_FILTER.id.with_member("andAll"), target=RETRIEVAL_FILTER_LIST, index=11 -) - -RETRIEVAL_FILTER.members["orAll"] = Schema.member( - id=RETRIEVAL_FILTER.id.with_member("orAll"), target=RETRIEVAL_FILTER_LIST, index=12 + _aws: MappingProxyType({"sdkId": "Bedrock", "endpointPrefix": "bedrock"}), + _aJw: None, + _sBA: None, + }, ) diff --git a/clients/aws-sdk-bedrock/src/aws_sdk_bedrock/client.py b/clients/aws-sdk-bedrock/src/aws_sdk_bedrock/client.py index 9c548106..4145b0da 100644 --- a/clients/aws-sdk-bedrock/src/aws_sdk_bedrock/client.py +++ b/clients/aws-sdk-bedrock/src/aws_sdk_bedrock/client.py @@ -1,28 +1,26 @@ # Code generated by smithy-python-codegen DO NOT EDIT. +from __future__ import annotations + from copy import deepcopy import logging from typing import Any, cast +from smithy_aws_core.aio.identity.chain import AsyncIdentityChain from smithy_aws_core.config import ConfigSource from smithy_aws_core.identity import AWSCredentialsIdentity -from smithy_aws_core.identity.chain import IdentityChain -from smithy_core.aio.client import AsyncClient, ClientCall, RequestPipeline +from smithy_core.aio.client import AsyncClient, AsyncClientCall, AsyncRequestPipeline from smithy_core.deserializers import DeserializeableShape from smithy_core.exceptions import ExpectationNotMetError from smithy_core.schemas import APIOperation from smithy_core.serializers import SerializeableShape -from smithy_http.aio.interfaces import HTTPClient +from smithy_http.aio.interfaces import AsyncHTTPClient from smithy_http.plugins import user_agent_plugin from .config import AsyncBedrockConfig, Plugin from .models import ( BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB, BATCH_DELETE_EVALUATION_JOB, - BatchDeleteAdvancedPromptOptimizationJobInput, - BatchDeleteAdvancedPromptOptimizationJobOutput, - BatchDeleteEvaluationJobInput, - BatchDeleteEvaluationJobOutput, CANCEL_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW, CREATE_ADVANCED_PROMPT_OPTIMIZATION_JOB, CREATE_AUTOMATED_REASONING_POLICY, @@ -42,44 +40,6 @@ CREATE_MODEL_INVOCATION_JOB, CREATE_PROMPT_ROUTER, CREATE_PROVISIONED_MODEL_THROUGHPUT, - CancelAutomatedReasoningPolicyBuildWorkflowInput, - CancelAutomatedReasoningPolicyBuildWorkflowOutput, - CreateAdvancedPromptOptimizationJobInput, - CreateAdvancedPromptOptimizationJobOutput, - CreateAutomatedReasoningPolicyInput, - CreateAutomatedReasoningPolicyOutput, - CreateAutomatedReasoningPolicyTestCaseInput, - CreateAutomatedReasoningPolicyTestCaseOutput, - CreateAutomatedReasoningPolicyVersionInput, - CreateAutomatedReasoningPolicyVersionOutput, - CreateCustomModelDeploymentInput, - CreateCustomModelDeploymentOutput, - CreateCustomModelInput, - CreateCustomModelOutput, - CreateEvaluationJobInput, - CreateEvaluationJobOutput, - CreateFoundationModelAgreementInput, - CreateFoundationModelAgreementOutput, - CreateGuardrailInput, - CreateGuardrailOutput, - CreateGuardrailVersionInput, - CreateGuardrailVersionOutput, - CreateInferenceProfileInput, - CreateInferenceProfileOutput, - CreateMarketplaceModelEndpointInput, - CreateMarketplaceModelEndpointOutput, - CreateModelCopyJobInput, - CreateModelCopyJobOutput, - CreateModelCustomizationJobInput, - CreateModelCustomizationJobOutput, - CreateModelImportJobInput, - CreateModelImportJobOutput, - CreateModelInvocationJobInput, - CreateModelInvocationJobOutput, - CreatePromptRouterInput, - CreatePromptRouterOutput, - CreateProvisionedModelThroughputInput, - CreateProvisionedModelThroughputOutput, DELETE_AUTOMATED_REASONING_POLICY, DELETE_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW, DELETE_AUTOMATED_REASONING_POLICY_TEST_CASE, @@ -96,41 +56,7 @@ DELETE_PROVISIONED_MODEL_THROUGHPUT, DELETE_RESOURCE_POLICY, DEREGISTER_MARKETPLACE_MODEL_ENDPOINT, - DeleteAutomatedReasoningPolicyBuildWorkflowInput, - DeleteAutomatedReasoningPolicyBuildWorkflowOutput, - DeleteAutomatedReasoningPolicyInput, - DeleteAutomatedReasoningPolicyOutput, - DeleteAutomatedReasoningPolicyTestCaseInput, - DeleteAutomatedReasoningPolicyTestCaseOutput, - DeleteCustomModelDeploymentInput, - DeleteCustomModelDeploymentOutput, - DeleteCustomModelInput, - DeleteCustomModelOutput, - DeleteEnforcedGuardrailConfigurationInput, - DeleteEnforcedGuardrailConfigurationOutput, - DeleteFoundationModelAgreementInput, - DeleteFoundationModelAgreementOutput, - DeleteGuardrailInput, - DeleteGuardrailOutput, - DeleteImportedModelInput, - DeleteImportedModelOutput, - DeleteInferenceProfileInput, - DeleteInferenceProfileOutput, - DeleteMarketplaceModelEndpointInput, - DeleteMarketplaceModelEndpointOutput, - DeleteModelInvocationLoggingConfigurationInput, - DeleteModelInvocationLoggingConfigurationOutput, - DeletePromptRouterInput, - DeletePromptRouterOutput, - DeleteProvisionedModelThroughputInput, - DeleteProvisionedModelThroughputOutput, - DeleteResourcePolicyInput, - DeleteResourcePolicyOutput, - DeregisterMarketplaceModelEndpointInput, - DeregisterMarketplaceModelEndpointOutput, EXPORT_AUTOMATED_REASONING_POLICY_VERSION, - ExportAutomatedReasoningPolicyVersionInput, - ExportAutomatedReasoningPolicyVersionOutput, GET_ACCOUNT_DATA_RETENTION, GET_ADVANCED_PROMPT_OPTIMIZATION_JOB, GET_AUTOMATED_REASONING_POLICY, @@ -158,60 +84,6 @@ GET_PROVISIONED_MODEL_THROUGHPUT, GET_RESOURCE_POLICY, GET_USE_CASE_FOR_MODEL_ACCESS, - GetAccountDataRetentionInput, - GetAccountDataRetentionOutput, - GetAdvancedPromptOptimizationJobInput, - GetAdvancedPromptOptimizationJobOutput, - GetAutomatedReasoningPolicyAnnotationsInput, - GetAutomatedReasoningPolicyAnnotationsOutput, - GetAutomatedReasoningPolicyBuildWorkflowInput, - GetAutomatedReasoningPolicyBuildWorkflowOutput, - GetAutomatedReasoningPolicyBuildWorkflowResultAssetsInput, - GetAutomatedReasoningPolicyBuildWorkflowResultAssetsOutput, - GetAutomatedReasoningPolicyInput, - GetAutomatedReasoningPolicyNextScenarioInput, - GetAutomatedReasoningPolicyNextScenarioOutput, - GetAutomatedReasoningPolicyOutput, - GetAutomatedReasoningPolicyTestCaseInput, - GetAutomatedReasoningPolicyTestCaseOutput, - GetAutomatedReasoningPolicyTestResultInput, - GetAutomatedReasoningPolicyTestResultOutput, - GetCustomModelDeploymentInput, - GetCustomModelDeploymentOutput, - GetCustomModelInput, - GetCustomModelOutput, - GetEvaluationJobInput, - GetEvaluationJobOutput, - GetFoundationModelAvailabilityInput, - GetFoundationModelAvailabilityOutput, - GetFoundationModelInput, - GetFoundationModelOutput, - GetGuardrailInput, - GetGuardrailOutput, - GetImportedModelInput, - GetImportedModelOutput, - GetInferenceProfileInput, - GetInferenceProfileOutput, - GetMarketplaceModelEndpointInput, - GetMarketplaceModelEndpointOutput, - GetModelCopyJobInput, - GetModelCopyJobOutput, - GetModelCustomizationJobInput, - GetModelCustomizationJobOutput, - GetModelImportJobInput, - GetModelImportJobOutput, - GetModelInvocationJobInput, - GetModelInvocationJobOutput, - GetModelInvocationLoggingConfigurationInput, - GetModelInvocationLoggingConfigurationOutput, - GetPromptRouterInput, - GetPromptRouterOutput, - GetProvisionedModelThroughputInput, - GetProvisionedModelThroughputOutput, - GetResourcePolicyInput, - GetResourcePolicyOutput, - GetUseCaseForModelAccessInput, - GetUseCaseForModelAccessOutput, LIST_ADVANCED_PROMPT_OPTIMIZATION_JOBS, LIST_AUTOMATED_REASONING_POLICIES, LIST_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOWS, @@ -234,89 +106,19 @@ LIST_PROMPT_ROUTERS, LIST_PROVISIONED_MODEL_THROUGHPUTS, LIST_TAGS_FOR_RESOURCE, - ListAdvancedPromptOptimizationJobsInput, - ListAdvancedPromptOptimizationJobsOutput, - ListAutomatedReasoningPoliciesInput, - ListAutomatedReasoningPoliciesOutput, - ListAutomatedReasoningPolicyBuildWorkflowsInput, - ListAutomatedReasoningPolicyBuildWorkflowsOutput, - ListAutomatedReasoningPolicyTestCasesInput, - ListAutomatedReasoningPolicyTestCasesOutput, - ListAutomatedReasoningPolicyTestResultsInput, - ListAutomatedReasoningPolicyTestResultsOutput, - ListCustomModelDeploymentsInput, - ListCustomModelDeploymentsOutput, - ListCustomModelsInput, - ListCustomModelsOutput, - ListEnforcedGuardrailsConfigurationInput, - ListEnforcedGuardrailsConfigurationOutput, - ListEvaluationJobsInput, - ListEvaluationJobsOutput, - ListFoundationModelAgreementOffersInput, - ListFoundationModelAgreementOffersOutput, - ListFoundationModelsInput, - ListFoundationModelsOutput, - ListGuardrailsInput, - ListGuardrailsOutput, - ListImportedModelsInput, - ListImportedModelsOutput, - ListInferenceProfilesInput, - ListInferenceProfilesOutput, - ListMarketplaceModelEndpointsInput, - ListMarketplaceModelEndpointsOutput, - ListModelCopyJobsInput, - ListModelCopyJobsOutput, - ListModelCustomizationJobsInput, - ListModelCustomizationJobsOutput, - ListModelImportJobsInput, - ListModelImportJobsOutput, - ListModelInvocationJobsInput, - ListModelInvocationJobsOutput, - ListPromptRoutersInput, - ListPromptRoutersOutput, - ListProvisionedModelThroughputsInput, - ListProvisionedModelThroughputsOutput, - ListTagsForResourceInput, - ListTagsForResourceOutput, PUT_ACCOUNT_DATA_RETENTION, PUT_ENFORCED_GUARDRAIL_CONFIGURATION, PUT_MODEL_INVOCATION_LOGGING_CONFIGURATION, PUT_RESOURCE_POLICY, PUT_USE_CASE_FOR_MODEL_ACCESS, - PutAccountDataRetentionInput, - PutAccountDataRetentionOutput, - PutEnforcedGuardrailConfigurationInput, - PutEnforcedGuardrailConfigurationOutput, - PutModelInvocationLoggingConfigurationInput, - PutModelInvocationLoggingConfigurationOutput, - PutResourcePolicyInput, - PutResourcePolicyOutput, - PutUseCaseForModelAccessInput, - PutUseCaseForModelAccessOutput, REGISTER_MARKETPLACE_MODEL_ENDPOINT, - RegisterMarketplaceModelEndpointInput, - RegisterMarketplaceModelEndpointOutput, START_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW, START_AUTOMATED_REASONING_POLICY_TEST_WORKFLOW, STOP_ADVANCED_PROMPT_OPTIMIZATION_JOB, STOP_EVALUATION_JOB, STOP_MODEL_CUSTOMIZATION_JOB, STOP_MODEL_INVOCATION_JOB, - StartAutomatedReasoningPolicyBuildWorkflowInput, - StartAutomatedReasoningPolicyBuildWorkflowOutput, - StartAutomatedReasoningPolicyTestWorkflowInput, - StartAutomatedReasoningPolicyTestWorkflowOutput, - StopAdvancedPromptOptimizationJobInput, - StopAdvancedPromptOptimizationJobOutput, - StopEvaluationJobInput, - StopEvaluationJobOutput, - StopModelCustomizationJobInput, - StopModelCustomizationJobOutput, - StopModelInvocationJobInput, - StopModelInvocationJobOutput, TAG_RESOURCE, - TagResourceInput, - TagResourceOutput, UNTAG_RESOURCE, UPDATE_AUTOMATED_REASONING_POLICY, UPDATE_AUTOMATED_REASONING_POLICY_ANNOTATIONS, @@ -325,25 +127,231 @@ UPDATE_GUARDRAIL, UPDATE_MARKETPLACE_MODEL_ENDPOINT, UPDATE_PROVISIONED_MODEL_THROUGHPUT, - UntagResourceInput, - UntagResourceOutput, - UpdateAutomatedReasoningPolicyAnnotationsInput, - UpdateAutomatedReasoningPolicyAnnotationsOutput, - UpdateAutomatedReasoningPolicyInput, - UpdateAutomatedReasoningPolicyOutput, - UpdateAutomatedReasoningPolicyTestCaseInput, - UpdateAutomatedReasoningPolicyTestCaseOutput, - UpdateCustomModelDeploymentInput, - UpdateCustomModelDeploymentOutput, - UpdateGuardrailInput, - UpdateGuardrailOutput, - UpdateMarketplaceModelEndpointInput, - UpdateMarketplaceModelEndpointOutput, - UpdateProvisionedModelThroughputInput, - UpdateProvisionedModelThroughputOutput, ) from .user_agent import aws_user_agent_plugin +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .models import ( + BatchDeleteAdvancedPromptOptimizationJobInput, + BatchDeleteAdvancedPromptOptimizationJobOutput, + BatchDeleteEvaluationJobInput, + BatchDeleteEvaluationJobOutput, + CancelAutomatedReasoningPolicyBuildWorkflowInput, + CancelAutomatedReasoningPolicyBuildWorkflowOutput, + CreateAdvancedPromptOptimizationJobInput, + CreateAdvancedPromptOptimizationJobOutput, + CreateAutomatedReasoningPolicyInput, + CreateAutomatedReasoningPolicyOutput, + CreateAutomatedReasoningPolicyTestCaseInput, + CreateAutomatedReasoningPolicyTestCaseOutput, + CreateAutomatedReasoningPolicyVersionInput, + CreateAutomatedReasoningPolicyVersionOutput, + CreateCustomModelDeploymentInput, + CreateCustomModelDeploymentOutput, + CreateCustomModelInput, + CreateCustomModelOutput, + CreateEvaluationJobInput, + CreateEvaluationJobOutput, + CreateFoundationModelAgreementInput, + CreateFoundationModelAgreementOutput, + CreateGuardrailInput, + CreateGuardrailOutput, + CreateGuardrailVersionInput, + CreateGuardrailVersionOutput, + CreateInferenceProfileInput, + CreateInferenceProfileOutput, + CreateMarketplaceModelEndpointInput, + CreateMarketplaceModelEndpointOutput, + CreateModelCopyJobInput, + CreateModelCopyJobOutput, + CreateModelCustomizationJobInput, + CreateModelCustomizationJobOutput, + CreateModelImportJobInput, + CreateModelImportJobOutput, + CreateModelInvocationJobInput, + CreateModelInvocationJobOutput, + CreatePromptRouterInput, + CreatePromptRouterOutput, + CreateProvisionedModelThroughputInput, + CreateProvisionedModelThroughputOutput, + DeleteAutomatedReasoningPolicyBuildWorkflowInput, + DeleteAutomatedReasoningPolicyBuildWorkflowOutput, + DeleteAutomatedReasoningPolicyInput, + DeleteAutomatedReasoningPolicyOutput, + DeleteAutomatedReasoningPolicyTestCaseInput, + DeleteAutomatedReasoningPolicyTestCaseOutput, + DeleteCustomModelDeploymentInput, + DeleteCustomModelDeploymentOutput, + DeleteCustomModelInput, + DeleteCustomModelOutput, + DeleteEnforcedGuardrailConfigurationInput, + DeleteEnforcedGuardrailConfigurationOutput, + DeleteFoundationModelAgreementInput, + DeleteFoundationModelAgreementOutput, + DeleteGuardrailInput, + DeleteGuardrailOutput, + DeleteImportedModelInput, + DeleteImportedModelOutput, + DeleteInferenceProfileInput, + DeleteInferenceProfileOutput, + DeleteMarketplaceModelEndpointInput, + DeleteMarketplaceModelEndpointOutput, + DeleteModelInvocationLoggingConfigurationInput, + DeleteModelInvocationLoggingConfigurationOutput, + DeletePromptRouterInput, + DeletePromptRouterOutput, + DeleteProvisionedModelThroughputInput, + DeleteProvisionedModelThroughputOutput, + DeleteResourcePolicyInput, + DeleteResourcePolicyOutput, + DeregisterMarketplaceModelEndpointInput, + DeregisterMarketplaceModelEndpointOutput, + ExportAutomatedReasoningPolicyVersionInput, + ExportAutomatedReasoningPolicyVersionOutput, + GetAccountDataRetentionInput, + GetAccountDataRetentionOutput, + GetAdvancedPromptOptimizationJobInput, + GetAdvancedPromptOptimizationJobOutput, + GetAutomatedReasoningPolicyAnnotationsInput, + GetAutomatedReasoningPolicyAnnotationsOutput, + GetAutomatedReasoningPolicyBuildWorkflowInput, + GetAutomatedReasoningPolicyBuildWorkflowOutput, + GetAutomatedReasoningPolicyBuildWorkflowResultAssetsInput, + GetAutomatedReasoningPolicyBuildWorkflowResultAssetsOutput, + GetAutomatedReasoningPolicyInput, + GetAutomatedReasoningPolicyNextScenarioInput, + GetAutomatedReasoningPolicyNextScenarioOutput, + GetAutomatedReasoningPolicyOutput, + GetAutomatedReasoningPolicyTestCaseInput, + GetAutomatedReasoningPolicyTestCaseOutput, + GetAutomatedReasoningPolicyTestResultInput, + GetAutomatedReasoningPolicyTestResultOutput, + GetCustomModelDeploymentInput, + GetCustomModelDeploymentOutput, + GetCustomModelInput, + GetCustomModelOutput, + GetEvaluationJobInput, + GetEvaluationJobOutput, + GetFoundationModelAvailabilityInput, + GetFoundationModelAvailabilityOutput, + GetFoundationModelInput, + GetFoundationModelOutput, + GetGuardrailInput, + GetGuardrailOutput, + GetImportedModelInput, + GetImportedModelOutput, + GetInferenceProfileInput, + GetInferenceProfileOutput, + GetMarketplaceModelEndpointInput, + GetMarketplaceModelEndpointOutput, + GetModelCopyJobInput, + GetModelCopyJobOutput, + GetModelCustomizationJobInput, + GetModelCustomizationJobOutput, + GetModelImportJobInput, + GetModelImportJobOutput, + GetModelInvocationJobInput, + GetModelInvocationJobOutput, + GetModelInvocationLoggingConfigurationInput, + GetModelInvocationLoggingConfigurationOutput, + GetPromptRouterInput, + GetPromptRouterOutput, + GetProvisionedModelThroughputInput, + GetProvisionedModelThroughputOutput, + GetResourcePolicyInput, + GetResourcePolicyOutput, + GetUseCaseForModelAccessInput, + GetUseCaseForModelAccessOutput, + ListAdvancedPromptOptimizationJobsInput, + ListAdvancedPromptOptimizationJobsOutput, + ListAutomatedReasoningPoliciesInput, + ListAutomatedReasoningPoliciesOutput, + ListAutomatedReasoningPolicyBuildWorkflowsInput, + ListAutomatedReasoningPolicyBuildWorkflowsOutput, + ListAutomatedReasoningPolicyTestCasesInput, + ListAutomatedReasoningPolicyTestCasesOutput, + ListAutomatedReasoningPolicyTestResultsInput, + ListAutomatedReasoningPolicyTestResultsOutput, + ListCustomModelDeploymentsInput, + ListCustomModelDeploymentsOutput, + ListCustomModelsInput, + ListCustomModelsOutput, + ListEnforcedGuardrailsConfigurationInput, + ListEnforcedGuardrailsConfigurationOutput, + ListEvaluationJobsInput, + ListEvaluationJobsOutput, + ListFoundationModelAgreementOffersInput, + ListFoundationModelAgreementOffersOutput, + ListFoundationModelsInput, + ListFoundationModelsOutput, + ListGuardrailsInput, + ListGuardrailsOutput, + ListImportedModelsInput, + ListImportedModelsOutput, + ListInferenceProfilesInput, + ListInferenceProfilesOutput, + ListMarketplaceModelEndpointsInput, + ListMarketplaceModelEndpointsOutput, + ListModelCopyJobsInput, + ListModelCopyJobsOutput, + ListModelCustomizationJobsInput, + ListModelCustomizationJobsOutput, + ListModelImportJobsInput, + ListModelImportJobsOutput, + ListModelInvocationJobsInput, + ListModelInvocationJobsOutput, + ListPromptRoutersInput, + ListPromptRoutersOutput, + ListProvisionedModelThroughputsInput, + ListProvisionedModelThroughputsOutput, + ListTagsForResourceInput, + ListTagsForResourceOutput, + PutAccountDataRetentionInput, + PutAccountDataRetentionOutput, + PutEnforcedGuardrailConfigurationInput, + PutEnforcedGuardrailConfigurationOutput, + PutModelInvocationLoggingConfigurationInput, + PutModelInvocationLoggingConfigurationOutput, + PutResourcePolicyInput, + PutResourcePolicyOutput, + PutUseCaseForModelAccessInput, + PutUseCaseForModelAccessOutput, + RegisterMarketplaceModelEndpointInput, + RegisterMarketplaceModelEndpointOutput, + StartAutomatedReasoningPolicyBuildWorkflowInput, + StartAutomatedReasoningPolicyBuildWorkflowOutput, + StartAutomatedReasoningPolicyTestWorkflowInput, + StartAutomatedReasoningPolicyTestWorkflowOutput, + StopAdvancedPromptOptimizationJobInput, + StopAdvancedPromptOptimizationJobOutput, + StopEvaluationJobInput, + StopEvaluationJobOutput, + StopModelCustomizationJobInput, + StopModelCustomizationJobOutput, + StopModelInvocationJobInput, + StopModelInvocationJobOutput, + TagResourceInput, + TagResourceOutput, + UntagResourceInput, + UntagResourceOutput, + UpdateAutomatedReasoningPolicyAnnotationsInput, + UpdateAutomatedReasoningPolicyAnnotationsOutput, + UpdateAutomatedReasoningPolicyInput, + UpdateAutomatedReasoningPolicyOutput, + UpdateAutomatedReasoningPolicyTestCaseInput, + UpdateAutomatedReasoningPolicyTestCaseOutput, + UpdateCustomModelDeploymentInput, + UpdateCustomModelDeploymentOutput, + UpdateGuardrailInput, + UpdateGuardrailOutput, + UpdateMarketplaceModelEndpointInput, + UpdateMarketplaceModelEndpointOutput, + UpdateProvisionedModelThroughputInput, + UpdateProvisionedModelThroughputOutput, + ) + logger = logging.getLogger(__name__) @@ -412,12 +420,12 @@ async def _post_setup(self, config: AsyncBedrockConfig) -> None: config_file = await config_context.parsed_profiles() if config_context.profile_source is ConfigSource.OVERRIDE: profile_name = config_context.profile_name - config.aws_credentials_identity_resolver = await IdentityChain.create( + config.aws_credentials_identity_resolver = await AsyncIdentityChain.create( AWSCredentialsIdentity, config_file=config_file, profile_name=profile_name, region_override=config.region, - http_client=cast(HTTPClient | None, config.transport), + http_client=cast(AsyncHTTPClient | None, config.transport), ) async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( @@ -426,7 +434,7 @@ async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( operation: APIOperation[I, O], default_plugins: list[Plugin], plugins: list[Plugin] | None, - ) -> tuple[RequestPipeline[Any, Any], ClientCall[I, O]]: + ) -> tuple[AsyncRequestPipeline[Any, Any], AsyncClientCall[I, O]]: if self._closed: raise RuntimeError( "Cannot invoke an operation on a client that has been closed." diff --git a/clients/aws-sdk-bedrock/src/aws_sdk_bedrock/config.py b/clients/aws-sdk-bedrock/src/aws_sdk_bedrock/config.py index 1a8a482a..de5f327a 100644 --- a/clients/aws-sdk-bedrock/src/aws_sdk_bedrock/config.py +++ b/clients/aws-sdk-bedrock/src/aws_sdk_bedrock/config.py @@ -1,648 +1,695 @@ # Code generated by smithy-python-codegen DO NOT EDIT. from dataclasses import dataclass, field -from typing import Any, Callable, ClassVar, Self, TypeAlias, Union, Unpack +from typing import ( + Any, + Callable, + ClassVar, + Self, + TYPE_CHECKING, + TypeAlias, + Union, + Unpack, +) -from smithy_aws_core.aio.protocols import RestJsonClientProtocol -from smithy_aws_core.auth import SigV4AuthScheme -from smithy_aws_core.config import AwsConfigOverrides, FileSystem -from smithy_aws_core.config.aws_config import AsyncAwsConfig -from smithy_aws_core.config.resolvers import EndpointUriResolver -from smithy_aws_core.config.types import FieldSpec -from smithy_aws_core.endpoints.standard_regional import ( - StandardRegionalEndpointsResolver, +from smithy_aws_core.aio.auth.sigv4 import AsyncSigV4AuthScheme +from smithy_aws_core.aio.config import AsyncFileSystem +from smithy_aws_core.aio.config.aws_config import AsyncAwsConfig, AwsConfigOverrides +from smithy_aws_core.aio.config.resolvers import EndpointUriResolver +from smithy_aws_core.aio.endpoints.standard_regional import ( + AsyncStandardRegionalEndpointsResolver, ) +from smithy_aws_core.aio.protocols import AsyncRestJsonClientProtocol +from smithy_aws_core.config.types import FieldSpec from smithy_aws_core.identity import AWSCredentialsIdentity, AWSIdentityProperties -from smithy_core.aio.interfaces import ( - ClientProtocol, - EndpointResolver, - ProtocolConstructor, - ProtocolSettings, -) -from smithy_core.aio.interfaces.auth import AuthScheme -from smithy_core.aio.interfaces.identity import IdentityResolver -from smithy_core.interceptors import Interceptor +from smithy_core.aio.interfaces import AsyncClientProtocol, AsyncEndpointResolver +from smithy_core.aio.interfaces.auth import AsyncAuthScheme +from smithy_core.aio.interfaces.identity import AsyncIdentityResolver +from smithy_core.interfaces import ProtocolConstructor, ProtocolSettings from smithy_core.interfaces.auth import AuthSchemeResolver from smithy_core.shapes import ShapeID from smithy_http.aio.aiohttp import AIOHTTPClient +from ._private.schemas import AMAZON_BEDROCK_CONTROL_PLANE_SERVICE from .auth import HTTPAuthSchemeResolver -from .models import ( - BatchDeleteAdvancedPromptOptimizationJobInput, - BatchDeleteAdvancedPromptOptimizationJobOutput, - BatchDeleteEvaluationJobInput, - BatchDeleteEvaluationJobOutput, - CancelAutomatedReasoningPolicyBuildWorkflowInput, - CancelAutomatedReasoningPolicyBuildWorkflowOutput, - CreateAdvancedPromptOptimizationJobInput, - CreateAdvancedPromptOptimizationJobOutput, - CreateAutomatedReasoningPolicyInput, - CreateAutomatedReasoningPolicyOutput, - CreateAutomatedReasoningPolicyTestCaseInput, - CreateAutomatedReasoningPolicyTestCaseOutput, - CreateAutomatedReasoningPolicyVersionInput, - CreateAutomatedReasoningPolicyVersionOutput, - CreateCustomModelDeploymentInput, - CreateCustomModelDeploymentOutput, - CreateCustomModelInput, - CreateCustomModelOutput, - CreateEvaluationJobInput, - CreateEvaluationJobOutput, - CreateFoundationModelAgreementInput, - CreateFoundationModelAgreementOutput, - CreateGuardrailInput, - CreateGuardrailOutput, - CreateGuardrailVersionInput, - CreateGuardrailVersionOutput, - CreateInferenceProfileInput, - CreateInferenceProfileOutput, - CreateMarketplaceModelEndpointInput, - CreateMarketplaceModelEndpointOutput, - CreateModelCopyJobInput, - CreateModelCopyJobOutput, - CreateModelCustomizationJobInput, - CreateModelCustomizationJobOutput, - CreateModelImportJobInput, - CreateModelImportJobOutput, - CreateModelInvocationJobInput, - CreateModelInvocationJobOutput, - CreatePromptRouterInput, - CreatePromptRouterOutput, - CreateProvisionedModelThroughputInput, - CreateProvisionedModelThroughputOutput, - DeleteAutomatedReasoningPolicyBuildWorkflowInput, - DeleteAutomatedReasoningPolicyBuildWorkflowOutput, - DeleteAutomatedReasoningPolicyInput, - DeleteAutomatedReasoningPolicyOutput, - DeleteAutomatedReasoningPolicyTestCaseInput, - DeleteAutomatedReasoningPolicyTestCaseOutput, - DeleteCustomModelDeploymentInput, - DeleteCustomModelDeploymentOutput, - DeleteCustomModelInput, - DeleteCustomModelOutput, - DeleteEnforcedGuardrailConfigurationInput, - DeleteEnforcedGuardrailConfigurationOutput, - DeleteFoundationModelAgreementInput, - DeleteFoundationModelAgreementOutput, - DeleteGuardrailInput, - DeleteGuardrailOutput, - DeleteImportedModelInput, - DeleteImportedModelOutput, - DeleteInferenceProfileInput, - DeleteInferenceProfileOutput, - DeleteMarketplaceModelEndpointInput, - DeleteMarketplaceModelEndpointOutput, - DeleteModelInvocationLoggingConfigurationInput, - DeleteModelInvocationLoggingConfigurationOutput, - DeletePromptRouterInput, - DeletePromptRouterOutput, - DeleteProvisionedModelThroughputInput, - DeleteProvisionedModelThroughputOutput, - DeleteResourcePolicyInput, - DeleteResourcePolicyOutput, - DeregisterMarketplaceModelEndpointInput, - DeregisterMarketplaceModelEndpointOutput, - ExportAutomatedReasoningPolicyVersionInput, - ExportAutomatedReasoningPolicyVersionOutput, - GetAccountDataRetentionInput, - GetAccountDataRetentionOutput, - GetAdvancedPromptOptimizationJobInput, - GetAdvancedPromptOptimizationJobOutput, - GetAutomatedReasoningPolicyAnnotationsInput, - GetAutomatedReasoningPolicyAnnotationsOutput, - GetAutomatedReasoningPolicyBuildWorkflowInput, - GetAutomatedReasoningPolicyBuildWorkflowOutput, - GetAutomatedReasoningPolicyBuildWorkflowResultAssetsInput, - GetAutomatedReasoningPolicyBuildWorkflowResultAssetsOutput, - GetAutomatedReasoningPolicyInput, - GetAutomatedReasoningPolicyNextScenarioInput, - GetAutomatedReasoningPolicyNextScenarioOutput, - GetAutomatedReasoningPolicyOutput, - GetAutomatedReasoningPolicyTestCaseInput, - GetAutomatedReasoningPolicyTestCaseOutput, - GetAutomatedReasoningPolicyTestResultInput, - GetAutomatedReasoningPolicyTestResultOutput, - GetCustomModelDeploymentInput, - GetCustomModelDeploymentOutput, - GetCustomModelInput, - GetCustomModelOutput, - GetEvaluationJobInput, - GetEvaluationJobOutput, - GetFoundationModelAvailabilityInput, - GetFoundationModelAvailabilityOutput, - GetFoundationModelInput, - GetFoundationModelOutput, - GetGuardrailInput, - GetGuardrailOutput, - GetImportedModelInput, - GetImportedModelOutput, - GetInferenceProfileInput, - GetInferenceProfileOutput, - GetMarketplaceModelEndpointInput, - GetMarketplaceModelEndpointOutput, - GetModelCopyJobInput, - GetModelCopyJobOutput, - GetModelCustomizationJobInput, - GetModelCustomizationJobOutput, - GetModelImportJobInput, - GetModelImportJobOutput, - GetModelInvocationJobInput, - GetModelInvocationJobOutput, - GetModelInvocationLoggingConfigurationInput, - GetModelInvocationLoggingConfigurationOutput, - GetPromptRouterInput, - GetPromptRouterOutput, - GetProvisionedModelThroughputInput, - GetProvisionedModelThroughputOutput, - GetResourcePolicyInput, - GetResourcePolicyOutput, - GetUseCaseForModelAccessInput, - GetUseCaseForModelAccessOutput, - ListAdvancedPromptOptimizationJobsInput, - ListAdvancedPromptOptimizationJobsOutput, - ListAutomatedReasoningPoliciesInput, - ListAutomatedReasoningPoliciesOutput, - ListAutomatedReasoningPolicyBuildWorkflowsInput, - ListAutomatedReasoningPolicyBuildWorkflowsOutput, - ListAutomatedReasoningPolicyTestCasesInput, - ListAutomatedReasoningPolicyTestCasesOutput, - ListAutomatedReasoningPolicyTestResultsInput, - ListAutomatedReasoningPolicyTestResultsOutput, - ListCustomModelDeploymentsInput, - ListCustomModelDeploymentsOutput, - ListCustomModelsInput, - ListCustomModelsOutput, - ListEnforcedGuardrailsConfigurationInput, - ListEnforcedGuardrailsConfigurationOutput, - ListEvaluationJobsInput, - ListEvaluationJobsOutput, - ListFoundationModelAgreementOffersInput, - ListFoundationModelAgreementOffersOutput, - ListFoundationModelsInput, - ListFoundationModelsOutput, - ListGuardrailsInput, - ListGuardrailsOutput, - ListImportedModelsInput, - ListImportedModelsOutput, - ListInferenceProfilesInput, - ListInferenceProfilesOutput, - ListMarketplaceModelEndpointsInput, - ListMarketplaceModelEndpointsOutput, - ListModelCopyJobsInput, - ListModelCopyJobsOutput, - ListModelCustomizationJobsInput, - ListModelCustomizationJobsOutput, - ListModelImportJobsInput, - ListModelImportJobsOutput, - ListModelInvocationJobsInput, - ListModelInvocationJobsOutput, - ListPromptRoutersInput, - ListPromptRoutersOutput, - ListProvisionedModelThroughputsInput, - ListProvisionedModelThroughputsOutput, - ListTagsForResourceInput, - ListTagsForResourceOutput, - PutAccountDataRetentionInput, - PutAccountDataRetentionOutput, - PutEnforcedGuardrailConfigurationInput, - PutEnforcedGuardrailConfigurationOutput, - PutModelInvocationLoggingConfigurationInput, - PutModelInvocationLoggingConfigurationOutput, - PutResourcePolicyInput, - PutResourcePolicyOutput, - PutUseCaseForModelAccessInput, - PutUseCaseForModelAccessOutput, - RegisterMarketplaceModelEndpointInput, - RegisterMarketplaceModelEndpointOutput, - StartAutomatedReasoningPolicyBuildWorkflowInput, - StartAutomatedReasoningPolicyBuildWorkflowOutput, - StartAutomatedReasoningPolicyTestWorkflowInput, - StartAutomatedReasoningPolicyTestWorkflowOutput, - StopAdvancedPromptOptimizationJobInput, - StopAdvancedPromptOptimizationJobOutput, - StopEvaluationJobInput, - StopEvaluationJobOutput, - StopModelCustomizationJobInput, - StopModelCustomizationJobOutput, - StopModelInvocationJobInput, - StopModelInvocationJobOutput, - TagResourceInput, - TagResourceOutput, - UntagResourceInput, - UntagResourceOutput, - UpdateAutomatedReasoningPolicyAnnotationsInput, - UpdateAutomatedReasoningPolicyAnnotationsOutput, - UpdateAutomatedReasoningPolicyInput, - UpdateAutomatedReasoningPolicyOutput, - UpdateAutomatedReasoningPolicyTestCaseInput, - UpdateAutomatedReasoningPolicyTestCaseOutput, - UpdateCustomModelDeploymentInput, - UpdateCustomModelDeploymentOutput, - UpdateGuardrailInput, - UpdateGuardrailOutput, - UpdateMarketplaceModelEndpointInput, - UpdateMarketplaceModelEndpointOutput, - UpdateProvisionedModelThroughputInput, - UpdateProvisionedModelThroughputOutput, -) -_ServiceInterceptor = Union[ - Interceptor[ +if TYPE_CHECKING: + from smithy_core.interceptors import Interceptor + from .models import ( BatchDeleteAdvancedPromptOptimizationJobInput, BatchDeleteAdvancedPromptOptimizationJobOutput, - Any, - Any, - ], - Interceptor[ - BatchDeleteEvaluationJobInput, BatchDeleteEvaluationJobOutput, Any, Any - ], - Interceptor[ + BatchDeleteEvaluationJobInput, + BatchDeleteEvaluationJobOutput, CancelAutomatedReasoningPolicyBuildWorkflowInput, CancelAutomatedReasoningPolicyBuildWorkflowOutput, - Any, - Any, - ], - Interceptor[ CreateAdvancedPromptOptimizationJobInput, CreateAdvancedPromptOptimizationJobOutput, - Any, - Any, - ], - Interceptor[ CreateAutomatedReasoningPolicyInput, CreateAutomatedReasoningPolicyOutput, - Any, - Any, - ], - Interceptor[ CreateAutomatedReasoningPolicyTestCaseInput, CreateAutomatedReasoningPolicyTestCaseOutput, - Any, - Any, - ], - Interceptor[ CreateAutomatedReasoningPolicyVersionInput, CreateAutomatedReasoningPolicyVersionOutput, - Any, - Any, - ], - Interceptor[CreateCustomModelInput, CreateCustomModelOutput, Any, Any], - Interceptor[ - CreateCustomModelDeploymentInput, CreateCustomModelDeploymentOutput, Any, Any - ], - Interceptor[CreateEvaluationJobInput, CreateEvaluationJobOutput, Any, Any], - Interceptor[ + CreateCustomModelDeploymentInput, + CreateCustomModelDeploymentOutput, + CreateCustomModelInput, + CreateCustomModelOutput, + CreateEvaluationJobInput, + CreateEvaluationJobOutput, CreateFoundationModelAgreementInput, CreateFoundationModelAgreementOutput, - Any, - Any, - ], - Interceptor[CreateGuardrailInput, CreateGuardrailOutput, Any, Any], - Interceptor[CreateGuardrailVersionInput, CreateGuardrailVersionOutput, Any, Any], - Interceptor[CreateInferenceProfileInput, CreateInferenceProfileOutput, Any, Any], - Interceptor[ + CreateGuardrailInput, + CreateGuardrailOutput, + CreateGuardrailVersionInput, + CreateGuardrailVersionOutput, + CreateInferenceProfileInput, + CreateInferenceProfileOutput, CreateMarketplaceModelEndpointInput, CreateMarketplaceModelEndpointOutput, - Any, - Any, - ], - Interceptor[CreateModelCopyJobInput, CreateModelCopyJobOutput, Any, Any], - Interceptor[ - CreateModelCustomizationJobInput, CreateModelCustomizationJobOutput, Any, Any - ], - Interceptor[CreateModelImportJobInput, CreateModelImportJobOutput, Any, Any], - Interceptor[ - CreateModelInvocationJobInput, CreateModelInvocationJobOutput, Any, Any - ], - Interceptor[CreatePromptRouterInput, CreatePromptRouterOutput, Any, Any], - Interceptor[ + CreateModelCopyJobInput, + CreateModelCopyJobOutput, + CreateModelCustomizationJobInput, + CreateModelCustomizationJobOutput, + CreateModelImportJobInput, + CreateModelImportJobOutput, + CreateModelInvocationJobInput, + CreateModelInvocationJobOutput, + CreatePromptRouterInput, + CreatePromptRouterOutput, CreateProvisionedModelThroughputInput, CreateProvisionedModelThroughputOutput, - Any, - Any, - ], - Interceptor[ - DeleteAutomatedReasoningPolicyInput, - DeleteAutomatedReasoningPolicyOutput, - Any, - Any, - ], - Interceptor[ DeleteAutomatedReasoningPolicyBuildWorkflowInput, DeleteAutomatedReasoningPolicyBuildWorkflowOutput, - Any, - Any, - ], - Interceptor[ + DeleteAutomatedReasoningPolicyInput, + DeleteAutomatedReasoningPolicyOutput, DeleteAutomatedReasoningPolicyTestCaseInput, DeleteAutomatedReasoningPolicyTestCaseOutput, - Any, - Any, - ], - Interceptor[DeleteCustomModelInput, DeleteCustomModelOutput, Any, Any], - Interceptor[ - DeleteCustomModelDeploymentInput, DeleteCustomModelDeploymentOutput, Any, Any - ], - Interceptor[ + DeleteCustomModelDeploymentInput, + DeleteCustomModelDeploymentOutput, + DeleteCustomModelInput, + DeleteCustomModelOutput, DeleteEnforcedGuardrailConfigurationInput, DeleteEnforcedGuardrailConfigurationOutput, - Any, - Any, - ], - Interceptor[ DeleteFoundationModelAgreementInput, DeleteFoundationModelAgreementOutput, - Any, - Any, - ], - Interceptor[DeleteGuardrailInput, DeleteGuardrailOutput, Any, Any], - Interceptor[DeleteImportedModelInput, DeleteImportedModelOutput, Any, Any], - Interceptor[DeleteInferenceProfileInput, DeleteInferenceProfileOutput, Any, Any], - Interceptor[ + DeleteGuardrailInput, + DeleteGuardrailOutput, + DeleteImportedModelInput, + DeleteImportedModelOutput, + DeleteInferenceProfileInput, + DeleteInferenceProfileOutput, DeleteMarketplaceModelEndpointInput, DeleteMarketplaceModelEndpointOutput, - Any, - Any, - ], - Interceptor[ DeleteModelInvocationLoggingConfigurationInput, DeleteModelInvocationLoggingConfigurationOutput, - Any, - Any, - ], - Interceptor[DeletePromptRouterInput, DeletePromptRouterOutput, Any, Any], - Interceptor[ + DeletePromptRouterInput, + DeletePromptRouterOutput, DeleteProvisionedModelThroughputInput, DeleteProvisionedModelThroughputOutput, - Any, - Any, - ], - Interceptor[DeleteResourcePolicyInput, DeleteResourcePolicyOutput, Any, Any], - Interceptor[ + DeleteResourcePolicyInput, + DeleteResourcePolicyOutput, DeregisterMarketplaceModelEndpointInput, DeregisterMarketplaceModelEndpointOutput, - Any, - Any, - ], - Interceptor[ ExportAutomatedReasoningPolicyVersionInput, ExportAutomatedReasoningPolicyVersionOutput, - Any, - Any, - ], - Interceptor[GetAccountDataRetentionInput, GetAccountDataRetentionOutput, Any, Any], - Interceptor[ + GetAccountDataRetentionInput, + GetAccountDataRetentionOutput, GetAdvancedPromptOptimizationJobInput, GetAdvancedPromptOptimizationJobOutput, - Any, - Any, - ], - Interceptor[ - GetAutomatedReasoningPolicyInput, GetAutomatedReasoningPolicyOutput, Any, Any - ], - Interceptor[ GetAutomatedReasoningPolicyAnnotationsInput, GetAutomatedReasoningPolicyAnnotationsOutput, - Any, - Any, - ], - Interceptor[ GetAutomatedReasoningPolicyBuildWorkflowInput, GetAutomatedReasoningPolicyBuildWorkflowOutput, - Any, - Any, - ], - Interceptor[ GetAutomatedReasoningPolicyBuildWorkflowResultAssetsInput, GetAutomatedReasoningPolicyBuildWorkflowResultAssetsOutput, - Any, - Any, - ], - Interceptor[ + GetAutomatedReasoningPolicyInput, GetAutomatedReasoningPolicyNextScenarioInput, GetAutomatedReasoningPolicyNextScenarioOutput, - Any, - Any, - ], - Interceptor[ + GetAutomatedReasoningPolicyOutput, GetAutomatedReasoningPolicyTestCaseInput, GetAutomatedReasoningPolicyTestCaseOutput, - Any, - Any, - ], - Interceptor[ GetAutomatedReasoningPolicyTestResultInput, GetAutomatedReasoningPolicyTestResultOutput, - Any, - Any, - ], - Interceptor[GetCustomModelInput, GetCustomModelOutput, Any, Any], - Interceptor[ - GetCustomModelDeploymentInput, GetCustomModelDeploymentOutput, Any, Any - ], - Interceptor[GetEvaluationJobInput, GetEvaluationJobOutput, Any, Any], - Interceptor[GetFoundationModelInput, GetFoundationModelOutput, Any, Any], - Interceptor[ + GetCustomModelDeploymentInput, + GetCustomModelDeploymentOutput, + GetCustomModelInput, + GetCustomModelOutput, + GetEvaluationJobInput, + GetEvaluationJobOutput, GetFoundationModelAvailabilityInput, GetFoundationModelAvailabilityOutput, - Any, - Any, - ], - Interceptor[GetGuardrailInput, GetGuardrailOutput, Any, Any], - Interceptor[GetImportedModelInput, GetImportedModelOutput, Any, Any], - Interceptor[GetInferenceProfileInput, GetInferenceProfileOutput, Any, Any], - Interceptor[ - GetMarketplaceModelEndpointInput, GetMarketplaceModelEndpointOutput, Any, Any - ], - Interceptor[GetModelCopyJobInput, GetModelCopyJobOutput, Any, Any], - Interceptor[ - GetModelCustomizationJobInput, GetModelCustomizationJobOutput, Any, Any - ], - Interceptor[GetModelImportJobInput, GetModelImportJobOutput, Any, Any], - Interceptor[GetModelInvocationJobInput, GetModelInvocationJobOutput, Any, Any], - Interceptor[ + GetFoundationModelInput, + GetFoundationModelOutput, + GetGuardrailInput, + GetGuardrailOutput, + GetImportedModelInput, + GetImportedModelOutput, + GetInferenceProfileInput, + GetInferenceProfileOutput, + GetMarketplaceModelEndpointInput, + GetMarketplaceModelEndpointOutput, + GetModelCopyJobInput, + GetModelCopyJobOutput, + GetModelCustomizationJobInput, + GetModelCustomizationJobOutput, + GetModelImportJobInput, + GetModelImportJobOutput, + GetModelInvocationJobInput, + GetModelInvocationJobOutput, GetModelInvocationLoggingConfigurationInput, GetModelInvocationLoggingConfigurationOutput, - Any, - Any, - ], - Interceptor[GetPromptRouterInput, GetPromptRouterOutput, Any, Any], - Interceptor[ + GetPromptRouterInput, + GetPromptRouterOutput, GetProvisionedModelThroughputInput, GetProvisionedModelThroughputOutput, - Any, - Any, - ], - Interceptor[GetResourcePolicyInput, GetResourcePolicyOutput, Any, Any], - Interceptor[ - GetUseCaseForModelAccessInput, GetUseCaseForModelAccessOutput, Any, Any - ], - Interceptor[ + GetResourcePolicyInput, + GetResourcePolicyOutput, + GetUseCaseForModelAccessInput, + GetUseCaseForModelAccessOutput, ListAdvancedPromptOptimizationJobsInput, ListAdvancedPromptOptimizationJobsOutput, - Any, - Any, - ], - Interceptor[ ListAutomatedReasoningPoliciesInput, ListAutomatedReasoningPoliciesOutput, - Any, - Any, - ], - Interceptor[ ListAutomatedReasoningPolicyBuildWorkflowsInput, ListAutomatedReasoningPolicyBuildWorkflowsOutput, - Any, - Any, - ], - Interceptor[ ListAutomatedReasoningPolicyTestCasesInput, ListAutomatedReasoningPolicyTestCasesOutput, - Any, - Any, - ], - Interceptor[ ListAutomatedReasoningPolicyTestResultsInput, ListAutomatedReasoningPolicyTestResultsOutput, - Any, - Any, - ], - Interceptor[ - ListCustomModelDeploymentsInput, ListCustomModelDeploymentsOutput, Any, Any - ], - Interceptor[ListCustomModelsInput, ListCustomModelsOutput, Any, Any], - Interceptor[ + ListCustomModelDeploymentsInput, + ListCustomModelDeploymentsOutput, + ListCustomModelsInput, + ListCustomModelsOutput, ListEnforcedGuardrailsConfigurationInput, ListEnforcedGuardrailsConfigurationOutput, - Any, - Any, - ], - Interceptor[ListEvaluationJobsInput, ListEvaluationJobsOutput, Any, Any], - Interceptor[ + ListEvaluationJobsInput, + ListEvaluationJobsOutput, ListFoundationModelAgreementOffersInput, ListFoundationModelAgreementOffersOutput, - Any, - Any, - ], - Interceptor[ListFoundationModelsInput, ListFoundationModelsOutput, Any, Any], - Interceptor[ListGuardrailsInput, ListGuardrailsOutput, Any, Any], - Interceptor[ListImportedModelsInput, ListImportedModelsOutput, Any, Any], - Interceptor[ListInferenceProfilesInput, ListInferenceProfilesOutput, Any, Any], - Interceptor[ + ListFoundationModelsInput, + ListFoundationModelsOutput, + ListGuardrailsInput, + ListGuardrailsOutput, + ListImportedModelsInput, + ListImportedModelsOutput, + ListInferenceProfilesInput, + ListInferenceProfilesOutput, ListMarketplaceModelEndpointsInput, ListMarketplaceModelEndpointsOutput, - Any, - Any, - ], - Interceptor[ListModelCopyJobsInput, ListModelCopyJobsOutput, Any, Any], - Interceptor[ - ListModelCustomizationJobsInput, ListModelCustomizationJobsOutput, Any, Any - ], - Interceptor[ListModelImportJobsInput, ListModelImportJobsOutput, Any, Any], - Interceptor[ListModelInvocationJobsInput, ListModelInvocationJobsOutput, Any, Any], - Interceptor[ListPromptRoutersInput, ListPromptRoutersOutput, Any, Any], - Interceptor[ + ListModelCopyJobsInput, + ListModelCopyJobsOutput, + ListModelCustomizationJobsInput, + ListModelCustomizationJobsOutput, + ListModelImportJobsInput, + ListModelImportJobsOutput, + ListModelInvocationJobsInput, + ListModelInvocationJobsOutput, + ListPromptRoutersInput, + ListPromptRoutersOutput, ListProvisionedModelThroughputsInput, ListProvisionedModelThroughputsOutput, - Any, - Any, - ], - Interceptor[ListTagsForResourceInput, ListTagsForResourceOutput, Any, Any], - Interceptor[PutAccountDataRetentionInput, PutAccountDataRetentionOutput, Any, Any], - Interceptor[ + ListTagsForResourceInput, + ListTagsForResourceOutput, + PutAccountDataRetentionInput, + PutAccountDataRetentionOutput, PutEnforcedGuardrailConfigurationInput, PutEnforcedGuardrailConfigurationOutput, - Any, - Any, - ], - Interceptor[ PutModelInvocationLoggingConfigurationInput, PutModelInvocationLoggingConfigurationOutput, - Any, - Any, - ], - Interceptor[PutResourcePolicyInput, PutResourcePolicyOutput, Any, Any], - Interceptor[ - PutUseCaseForModelAccessInput, PutUseCaseForModelAccessOutput, Any, Any - ], - Interceptor[ + PutResourcePolicyInput, + PutResourcePolicyOutput, + PutUseCaseForModelAccessInput, + PutUseCaseForModelAccessOutput, RegisterMarketplaceModelEndpointInput, RegisterMarketplaceModelEndpointOutput, - Any, - Any, - ], - Interceptor[ StartAutomatedReasoningPolicyBuildWorkflowInput, StartAutomatedReasoningPolicyBuildWorkflowOutput, - Any, - Any, - ], - Interceptor[ StartAutomatedReasoningPolicyTestWorkflowInput, StartAutomatedReasoningPolicyTestWorkflowOutput, - Any, - Any, - ], - Interceptor[ StopAdvancedPromptOptimizationJobInput, StopAdvancedPromptOptimizationJobOutput, - Any, - Any, - ], - Interceptor[StopEvaluationJobInput, StopEvaluationJobOutput, Any, Any], - Interceptor[ - StopModelCustomizationJobInput, StopModelCustomizationJobOutput, Any, Any - ], - Interceptor[StopModelInvocationJobInput, StopModelInvocationJobOutput, Any, Any], - Interceptor[TagResourceInput, TagResourceOutput, Any, Any], - Interceptor[UntagResourceInput, UntagResourceOutput, Any, Any], - Interceptor[ - UpdateAutomatedReasoningPolicyInput, - UpdateAutomatedReasoningPolicyOutput, - Any, - Any, - ], - Interceptor[ + StopEvaluationJobInput, + StopEvaluationJobOutput, + StopModelCustomizationJobInput, + StopModelCustomizationJobOutput, + StopModelInvocationJobInput, + StopModelInvocationJobOutput, + TagResourceInput, + TagResourceOutput, + UntagResourceInput, + UntagResourceOutput, UpdateAutomatedReasoningPolicyAnnotationsInput, UpdateAutomatedReasoningPolicyAnnotationsOutput, - Any, - Any, - ], - Interceptor[ + UpdateAutomatedReasoningPolicyInput, + UpdateAutomatedReasoningPolicyOutput, UpdateAutomatedReasoningPolicyTestCaseInput, UpdateAutomatedReasoningPolicyTestCaseOutput, - Any, - Any, - ], - Interceptor[ - UpdateCustomModelDeploymentInput, UpdateCustomModelDeploymentOutput, Any, Any - ], - Interceptor[UpdateGuardrailInput, UpdateGuardrailOutput, Any, Any], - Interceptor[ + UpdateCustomModelDeploymentInput, + UpdateCustomModelDeploymentOutput, + UpdateGuardrailInput, + UpdateGuardrailOutput, UpdateMarketplaceModelEndpointInput, UpdateMarketplaceModelEndpointOutput, - Any, - Any, - ], - Interceptor[ UpdateProvisionedModelThroughputInput, UpdateProvisionedModelThroughputOutput, - Any, - Any, - ], -] + ) + + _ServiceInterceptor = Union[ + Interceptor[ + BatchDeleteAdvancedPromptOptimizationJobInput, + BatchDeleteAdvancedPromptOptimizationJobOutput, + Any, + Any, + ], + Interceptor[ + BatchDeleteEvaluationJobInput, BatchDeleteEvaluationJobOutput, Any, Any + ], + Interceptor[ + CancelAutomatedReasoningPolicyBuildWorkflowInput, + CancelAutomatedReasoningPolicyBuildWorkflowOutput, + Any, + Any, + ], + Interceptor[ + CreateAdvancedPromptOptimizationJobInput, + CreateAdvancedPromptOptimizationJobOutput, + Any, + Any, + ], + Interceptor[ + CreateAutomatedReasoningPolicyInput, + CreateAutomatedReasoningPolicyOutput, + Any, + Any, + ], + Interceptor[ + CreateAutomatedReasoningPolicyTestCaseInput, + CreateAutomatedReasoningPolicyTestCaseOutput, + Any, + Any, + ], + Interceptor[ + CreateAutomatedReasoningPolicyVersionInput, + CreateAutomatedReasoningPolicyVersionOutput, + Any, + Any, + ], + Interceptor[CreateCustomModelInput, CreateCustomModelOutput, Any, Any], + Interceptor[ + CreateCustomModelDeploymentInput, + CreateCustomModelDeploymentOutput, + Any, + Any, + ], + Interceptor[CreateEvaluationJobInput, CreateEvaluationJobOutput, Any, Any], + Interceptor[ + CreateFoundationModelAgreementInput, + CreateFoundationModelAgreementOutput, + Any, + Any, + ], + Interceptor[CreateGuardrailInput, CreateGuardrailOutput, Any, Any], + Interceptor[ + CreateGuardrailVersionInput, CreateGuardrailVersionOutput, Any, Any + ], + Interceptor[ + CreateInferenceProfileInput, CreateInferenceProfileOutput, Any, Any + ], + Interceptor[ + CreateMarketplaceModelEndpointInput, + CreateMarketplaceModelEndpointOutput, + Any, + Any, + ], + Interceptor[CreateModelCopyJobInput, CreateModelCopyJobOutput, Any, Any], + Interceptor[ + CreateModelCustomizationJobInput, + CreateModelCustomizationJobOutput, + Any, + Any, + ], + Interceptor[CreateModelImportJobInput, CreateModelImportJobOutput, Any, Any], + Interceptor[ + CreateModelInvocationJobInput, CreateModelInvocationJobOutput, Any, Any + ], + Interceptor[CreatePromptRouterInput, CreatePromptRouterOutput, Any, Any], + Interceptor[ + CreateProvisionedModelThroughputInput, + CreateProvisionedModelThroughputOutput, + Any, + Any, + ], + Interceptor[ + DeleteAutomatedReasoningPolicyInput, + DeleteAutomatedReasoningPolicyOutput, + Any, + Any, + ], + Interceptor[ + DeleteAutomatedReasoningPolicyBuildWorkflowInput, + DeleteAutomatedReasoningPolicyBuildWorkflowOutput, + Any, + Any, + ], + Interceptor[ + DeleteAutomatedReasoningPolicyTestCaseInput, + DeleteAutomatedReasoningPolicyTestCaseOutput, + Any, + Any, + ], + Interceptor[DeleteCustomModelInput, DeleteCustomModelOutput, Any, Any], + Interceptor[ + DeleteCustomModelDeploymentInput, + DeleteCustomModelDeploymentOutput, + Any, + Any, + ], + Interceptor[ + DeleteEnforcedGuardrailConfigurationInput, + DeleteEnforcedGuardrailConfigurationOutput, + Any, + Any, + ], + Interceptor[ + DeleteFoundationModelAgreementInput, + DeleteFoundationModelAgreementOutput, + Any, + Any, + ], + Interceptor[DeleteGuardrailInput, DeleteGuardrailOutput, Any, Any], + Interceptor[DeleteImportedModelInput, DeleteImportedModelOutput, Any, Any], + Interceptor[ + DeleteInferenceProfileInput, DeleteInferenceProfileOutput, Any, Any + ], + Interceptor[ + DeleteMarketplaceModelEndpointInput, + DeleteMarketplaceModelEndpointOutput, + Any, + Any, + ], + Interceptor[ + DeleteModelInvocationLoggingConfigurationInput, + DeleteModelInvocationLoggingConfigurationOutput, + Any, + Any, + ], + Interceptor[DeletePromptRouterInput, DeletePromptRouterOutput, Any, Any], + Interceptor[ + DeleteProvisionedModelThroughputInput, + DeleteProvisionedModelThroughputOutput, + Any, + Any, + ], + Interceptor[DeleteResourcePolicyInput, DeleteResourcePolicyOutput, Any, Any], + Interceptor[ + DeregisterMarketplaceModelEndpointInput, + DeregisterMarketplaceModelEndpointOutput, + Any, + Any, + ], + Interceptor[ + ExportAutomatedReasoningPolicyVersionInput, + ExportAutomatedReasoningPolicyVersionOutput, + Any, + Any, + ], + Interceptor[ + GetAccountDataRetentionInput, GetAccountDataRetentionOutput, Any, Any + ], + Interceptor[ + GetAdvancedPromptOptimizationJobInput, + GetAdvancedPromptOptimizationJobOutput, + Any, + Any, + ], + Interceptor[ + GetAutomatedReasoningPolicyInput, + GetAutomatedReasoningPolicyOutput, + Any, + Any, + ], + Interceptor[ + GetAutomatedReasoningPolicyAnnotationsInput, + GetAutomatedReasoningPolicyAnnotationsOutput, + Any, + Any, + ], + Interceptor[ + GetAutomatedReasoningPolicyBuildWorkflowInput, + GetAutomatedReasoningPolicyBuildWorkflowOutput, + Any, + Any, + ], + Interceptor[ + GetAutomatedReasoningPolicyBuildWorkflowResultAssetsInput, + GetAutomatedReasoningPolicyBuildWorkflowResultAssetsOutput, + Any, + Any, + ], + Interceptor[ + GetAutomatedReasoningPolicyNextScenarioInput, + GetAutomatedReasoningPolicyNextScenarioOutput, + Any, + Any, + ], + Interceptor[ + GetAutomatedReasoningPolicyTestCaseInput, + GetAutomatedReasoningPolicyTestCaseOutput, + Any, + Any, + ], + Interceptor[ + GetAutomatedReasoningPolicyTestResultInput, + GetAutomatedReasoningPolicyTestResultOutput, + Any, + Any, + ], + Interceptor[GetCustomModelInput, GetCustomModelOutput, Any, Any], + Interceptor[ + GetCustomModelDeploymentInput, GetCustomModelDeploymentOutput, Any, Any + ], + Interceptor[GetEvaluationJobInput, GetEvaluationJobOutput, Any, Any], + Interceptor[GetFoundationModelInput, GetFoundationModelOutput, Any, Any], + Interceptor[ + GetFoundationModelAvailabilityInput, + GetFoundationModelAvailabilityOutput, + Any, + Any, + ], + Interceptor[GetGuardrailInput, GetGuardrailOutput, Any, Any], + Interceptor[GetImportedModelInput, GetImportedModelOutput, Any, Any], + Interceptor[GetInferenceProfileInput, GetInferenceProfileOutput, Any, Any], + Interceptor[ + GetMarketplaceModelEndpointInput, + GetMarketplaceModelEndpointOutput, + Any, + Any, + ], + Interceptor[GetModelCopyJobInput, GetModelCopyJobOutput, Any, Any], + Interceptor[ + GetModelCustomizationJobInput, GetModelCustomizationJobOutput, Any, Any + ], + Interceptor[GetModelImportJobInput, GetModelImportJobOutput, Any, Any], + Interceptor[GetModelInvocationJobInput, GetModelInvocationJobOutput, Any, Any], + Interceptor[ + GetModelInvocationLoggingConfigurationInput, + GetModelInvocationLoggingConfigurationOutput, + Any, + Any, + ], + Interceptor[GetPromptRouterInput, GetPromptRouterOutput, Any, Any], + Interceptor[ + GetProvisionedModelThroughputInput, + GetProvisionedModelThroughputOutput, + Any, + Any, + ], + Interceptor[GetResourcePolicyInput, GetResourcePolicyOutput, Any, Any], + Interceptor[ + GetUseCaseForModelAccessInput, GetUseCaseForModelAccessOutput, Any, Any + ], + Interceptor[ + ListAdvancedPromptOptimizationJobsInput, + ListAdvancedPromptOptimizationJobsOutput, + Any, + Any, + ], + Interceptor[ + ListAutomatedReasoningPoliciesInput, + ListAutomatedReasoningPoliciesOutput, + Any, + Any, + ], + Interceptor[ + ListAutomatedReasoningPolicyBuildWorkflowsInput, + ListAutomatedReasoningPolicyBuildWorkflowsOutput, + Any, + Any, + ], + Interceptor[ + ListAutomatedReasoningPolicyTestCasesInput, + ListAutomatedReasoningPolicyTestCasesOutput, + Any, + Any, + ], + Interceptor[ + ListAutomatedReasoningPolicyTestResultsInput, + ListAutomatedReasoningPolicyTestResultsOutput, + Any, + Any, + ], + Interceptor[ + ListCustomModelDeploymentsInput, ListCustomModelDeploymentsOutput, Any, Any + ], + Interceptor[ListCustomModelsInput, ListCustomModelsOutput, Any, Any], + Interceptor[ + ListEnforcedGuardrailsConfigurationInput, + ListEnforcedGuardrailsConfigurationOutput, + Any, + Any, + ], + Interceptor[ListEvaluationJobsInput, ListEvaluationJobsOutput, Any, Any], + Interceptor[ + ListFoundationModelAgreementOffersInput, + ListFoundationModelAgreementOffersOutput, + Any, + Any, + ], + Interceptor[ListFoundationModelsInput, ListFoundationModelsOutput, Any, Any], + Interceptor[ListGuardrailsInput, ListGuardrailsOutput, Any, Any], + Interceptor[ListImportedModelsInput, ListImportedModelsOutput, Any, Any], + Interceptor[ListInferenceProfilesInput, ListInferenceProfilesOutput, Any, Any], + Interceptor[ + ListMarketplaceModelEndpointsInput, + ListMarketplaceModelEndpointsOutput, + Any, + Any, + ], + Interceptor[ListModelCopyJobsInput, ListModelCopyJobsOutput, Any, Any], + Interceptor[ + ListModelCustomizationJobsInput, ListModelCustomizationJobsOutput, Any, Any + ], + Interceptor[ListModelImportJobsInput, ListModelImportJobsOutput, Any, Any], + Interceptor[ + ListModelInvocationJobsInput, ListModelInvocationJobsOutput, Any, Any + ], + Interceptor[ListPromptRoutersInput, ListPromptRoutersOutput, Any, Any], + Interceptor[ + ListProvisionedModelThroughputsInput, + ListProvisionedModelThroughputsOutput, + Any, + Any, + ], + Interceptor[ListTagsForResourceInput, ListTagsForResourceOutput, Any, Any], + Interceptor[ + PutAccountDataRetentionInput, PutAccountDataRetentionOutput, Any, Any + ], + Interceptor[ + PutEnforcedGuardrailConfigurationInput, + PutEnforcedGuardrailConfigurationOutput, + Any, + Any, + ], + Interceptor[ + PutModelInvocationLoggingConfigurationInput, + PutModelInvocationLoggingConfigurationOutput, + Any, + Any, + ], + Interceptor[PutResourcePolicyInput, PutResourcePolicyOutput, Any, Any], + Interceptor[ + PutUseCaseForModelAccessInput, PutUseCaseForModelAccessOutput, Any, Any + ], + Interceptor[ + RegisterMarketplaceModelEndpointInput, + RegisterMarketplaceModelEndpointOutput, + Any, + Any, + ], + Interceptor[ + StartAutomatedReasoningPolicyBuildWorkflowInput, + StartAutomatedReasoningPolicyBuildWorkflowOutput, + Any, + Any, + ], + Interceptor[ + StartAutomatedReasoningPolicyTestWorkflowInput, + StartAutomatedReasoningPolicyTestWorkflowOutput, + Any, + Any, + ], + Interceptor[ + StopAdvancedPromptOptimizationJobInput, + StopAdvancedPromptOptimizationJobOutput, + Any, + Any, + ], + Interceptor[StopEvaluationJobInput, StopEvaluationJobOutput, Any, Any], + Interceptor[ + StopModelCustomizationJobInput, StopModelCustomizationJobOutput, Any, Any + ], + Interceptor[ + StopModelInvocationJobInput, StopModelInvocationJobOutput, Any, Any + ], + Interceptor[TagResourceInput, TagResourceOutput, Any, Any], + Interceptor[UntagResourceInput, UntagResourceOutput, Any, Any], + Interceptor[ + UpdateAutomatedReasoningPolicyInput, + UpdateAutomatedReasoningPolicyOutput, + Any, + Any, + ], + Interceptor[ + UpdateAutomatedReasoningPolicyAnnotationsInput, + UpdateAutomatedReasoningPolicyAnnotationsOutput, + Any, + Any, + ], + Interceptor[ + UpdateAutomatedReasoningPolicyTestCaseInput, + UpdateAutomatedReasoningPolicyTestCaseOutput, + Any, + Any, + ], + Interceptor[ + UpdateCustomModelDeploymentInput, + UpdateCustomModelDeploymentOutput, + Any, + Any, + ], + Interceptor[UpdateGuardrailInput, UpdateGuardrailOutput, Any, Any], + Interceptor[ + UpdateMarketplaceModelEndpointInput, + UpdateMarketplaceModelEndpointOutput, + Any, + Any, + ], + Interceptor[ + UpdateProvisionedModelThroughputInput, + UpdateProvisionedModelThroughputOutput, + Any, + Any, + ], + ] +else: + _ServiceInterceptor = Any + _PROTOCOL_SETTINGS = ProtocolSettings( - namespace="com.amazonaws.bedrock", service_target="AmazonBedrockControlPlaneService" + namespace="com.amazonaws.bedrock", + service_target="AmazonBedrockControlPlaneService", + service_schema=AMAZON_BEDROCK_CONTROL_PLANE_SERVICE, ) class _AsyncBedrockConfigOverrides(AwsConfigOverrides, total=False): - endpoint_resolver: EndpointResolver | None + endpoint_resolver: AsyncEndpointResolver | None protocol: ( - ClientProtocol[Any, Any] | ProtocolConstructor[ClientProtocol[Any, Any]] | None + AsyncClientProtocol[Any, Any] + | ProtocolConstructor[AsyncClientProtocol[Any, Any]] + | None ) - auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None + auth_schemes: dict[ShapeID, AsyncAuthScheme[Any, Any, Any, Any]] | None auth_scheme_resolver: AuthSchemeResolver | None @@ -650,17 +697,17 @@ class _AsyncBedrockConfigOverrides(AwsConfigOverrides, total=False): class AsyncBedrockConfig(AsyncAwsConfig): """Bedrock configuration (async-resolved).""" - endpoint_resolver: EndpointResolver | None = None + endpoint_resolver: AsyncEndpointResolver | None = None """ The endpoint resolver used to resolve the final endpoint per-operation based on the configuration. """ - protocol: ClientProtocol[Any, Any] | None = None + protocol: AsyncClientProtocol[Any, Any] | None = None """ Pass a protocol class reference from smithy_aws_core.aio.protocols to - select the protocol, e.g. protocol=AwsJson10ClientProtocol. For custom - protocols a protocol instance may also be passed. + select the protocol, e.g. protocol=AsyncAwsJson10ClientProtocol. For + custom protocols a protocol instance may also be passed. """ interceptors: list[_ServiceInterceptor] = field(default_factory=lambda: []) @@ -669,7 +716,7 @@ class AsyncBedrockConfig(AsyncAwsConfig): execution of a request. """ - auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None = None + auth_schemes: dict[ShapeID, AsyncAuthScheme[Any, Any, Any, Any]] | None = None """A map of auth scheme ids to auth schemes.""" auth_scheme_resolver: AuthSchemeResolver | None = None @@ -679,7 +726,7 @@ class AsyncBedrockConfig(AsyncAwsConfig): """ aws_credentials_identity_resolver: ( - IdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None + AsyncIdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None ) = None """Resolves AWS Credentials. Required for operations that use Sigv4 Auth.""" @@ -720,24 +767,24 @@ class AsyncBedrockConfig(AsyncAwsConfig): default=None, resolver=EndpointUriResolver("bedrock") ), "endpoint_resolver": FieldSpec( - default_factory=lambda: StandardRegionalEndpointsResolver( + default_factory=lambda: AsyncStandardRegionalEndpointsResolver( endpoint_prefix="bedrock" ) ), "protocol": FieldSpec( - default_factory=lambda: RestJsonClientProtocol(_PROTOCOL_SETTINGS), + default_factory=lambda: AsyncRestJsonClientProtocol(_PROTOCOL_SETTINGS), converter=lambda p: p(_PROTOCOL_SETTINGS) if isinstance(p, type) else p, ), "auth_schemes": FieldSpec( default_factory=lambda: { - ShapeID("aws.auth#sigv4"): SigV4AuthScheme(service="bedrock") + ShapeID("aws.auth#sigv4"): AsyncSigV4AuthScheme(service="bedrock") } ), "auth_scheme_resolver": FieldSpec(default_factory=HTTPAuthSchemeResolver), "transport": FieldSpec(default_factory=lambda: AIOHTTPClient()), } - def set_auth_scheme(self, scheme: AuthScheme[Any, Any, Any, Any]) -> None: + def set_auth_scheme(self, scheme: AsyncAuthScheme[Any, Any, Any, Any]) -> None: """ Set an auth scheme implementation using its scheme ID. :param scheme: The auth scheme to add or replace. @@ -751,7 +798,7 @@ async def resolve( # pyright: ignore[reportIncompatibleMethodOverride] cls, *, profile: str | None = None, - fs: FileSystem | None = None, + fs: AsyncFileSystem | None = None, config_file_path: str | None = None, credentials_file_path: str | None = None, **overrides: Unpack[_AsyncBedrockConfigOverrides], diff --git a/clients/aws-sdk-bedrock/src/aws_sdk_bedrock/models.py b/clients/aws-sdk-bedrock/src/aws_sdk_bedrock/models.py index 84682f18..88d447fd 100644 --- a/clients/aws-sdk-bedrock/src/aws_sdk_bedrock/models.py +++ b/clients/aws-sdk-bedrock/src/aws_sdk_bedrock/models.py @@ -1,615 +1,345 @@ # Code generated by smithy-python-codegen DO NOT EDIT. -from dataclasses import dataclass, field -from datetime import datetime, timezone -from enum import StrEnum -import logging -from typing import Any, Literal, Self, Union +from __future__ import annotations -from smithy_core.deserializers import ShapeDeserializer -from smithy_core.documents import Document, TypeRegistry -from smithy_core.exceptions import ModeledError, SerializationError -from smithy_core.response import EMPTY_RESPONSE_METADATA, ResponseMetadata -from smithy_core.schemas import APIOperation, Schema -from smithy_core.serializers import ShapeSerializer +from ._private import schemas as _schemas +from smithy_core._dynamic_models import ModelRegistry +from smithy_core.exceptions import ModeledError +from smithy_core.schemas import APIOperation from smithy_core.shapes import ShapeID -from smithy_core.types import UnknownEnumMixin from ._private.schemas import ( - ACCESS_DENIED_EXCEPTION as _SCHEMA_ACCESS_DENIED_EXCEPTION, - ACCOUNT_ENFORCED_GUARDRAIL_INFERENCE_INPUT_CONFIGURATION as _SCHEMA_ACCOUNT_ENFORCED_GUARDRAIL_INFERENCE_INPUT_CONFIGURATION, - ACCOUNT_ENFORCED_GUARDRAIL_OUTPUT_CONFIGURATION as _SCHEMA_ACCOUNT_ENFORCED_GUARDRAIL_OUTPUT_CONFIGURATION, - ADVANCED_PROMPT_OPTIMIZATION_INPUT_CONFIG as _SCHEMA_ADVANCED_PROMPT_OPTIMIZATION_INPUT_CONFIG, - ADVANCED_PROMPT_OPTIMIZATION_JOB_SUMMARY as _SCHEMA_ADVANCED_PROMPT_OPTIMIZATION_JOB_SUMMARY, - ADVANCED_PROMPT_OPTIMIZATION_OUTPUT_CONFIG as _SCHEMA_ADVANCED_PROMPT_OPTIMIZATION_OUTPUT_CONFIG, - AGREEMENT_AVAILABILITY as _SCHEMA_AGREEMENT_AVAILABILITY, - AUTOMATED_EVALUATION_CONFIG as _SCHEMA_AUTOMATED_EVALUATION_CONFIG, - AUTOMATED_EVALUATION_CUSTOM_METRIC_CONFIG as _SCHEMA_AUTOMATED_EVALUATION_CUSTOM_METRIC_CONFIG, - AUTOMATED_EVALUATION_CUSTOM_METRIC_SOURCE as _SCHEMA_AUTOMATED_EVALUATION_CUSTOM_METRIC_SOURCE, - AUTOMATED_REASONING_CHECK_FINDING as _SCHEMA_AUTOMATED_REASONING_CHECK_FINDING, - AUTOMATED_REASONING_CHECK_IMPOSSIBLE_FINDING as _SCHEMA_AUTOMATED_REASONING_CHECK_IMPOSSIBLE_FINDING, - AUTOMATED_REASONING_CHECK_INPUT_TEXT_REFERENCE as _SCHEMA_AUTOMATED_REASONING_CHECK_INPUT_TEXT_REFERENCE, - AUTOMATED_REASONING_CHECK_INVALID_FINDING as _SCHEMA_AUTOMATED_REASONING_CHECK_INVALID_FINDING, - AUTOMATED_REASONING_CHECK_LOGIC_WARNING as _SCHEMA_AUTOMATED_REASONING_CHECK_LOGIC_WARNING, - AUTOMATED_REASONING_CHECK_NO_TRANSLATIONS_FINDING as _SCHEMA_AUTOMATED_REASONING_CHECK_NO_TRANSLATIONS_FINDING, - AUTOMATED_REASONING_CHECK_RULE as _SCHEMA_AUTOMATED_REASONING_CHECK_RULE, - AUTOMATED_REASONING_CHECK_SATISFIABLE_FINDING as _SCHEMA_AUTOMATED_REASONING_CHECK_SATISFIABLE_FINDING, - AUTOMATED_REASONING_CHECK_SCENARIO as _SCHEMA_AUTOMATED_REASONING_CHECK_SCENARIO, - AUTOMATED_REASONING_CHECK_TOO_COMPLEX_FINDING as _SCHEMA_AUTOMATED_REASONING_CHECK_TOO_COMPLEX_FINDING, - AUTOMATED_REASONING_CHECK_TRANSLATION as _SCHEMA_AUTOMATED_REASONING_CHECK_TRANSLATION, - AUTOMATED_REASONING_CHECK_TRANSLATION_AMBIGUOUS_FINDING as _SCHEMA_AUTOMATED_REASONING_CHECK_TRANSLATION_AMBIGUOUS_FINDING, - AUTOMATED_REASONING_CHECK_TRANSLATION_OPTION as _SCHEMA_AUTOMATED_REASONING_CHECK_TRANSLATION_OPTION, - AUTOMATED_REASONING_CHECK_VALID_FINDING as _SCHEMA_AUTOMATED_REASONING_CHECK_VALID_FINDING, - AUTOMATED_REASONING_LOGIC_STATEMENT as _SCHEMA_AUTOMATED_REASONING_LOGIC_STATEMENT, - AUTOMATED_REASONING_POLICY_ADD_RULE_ANNOTATION as _SCHEMA_AUTOMATED_REASONING_POLICY_ADD_RULE_ANNOTATION, - AUTOMATED_REASONING_POLICY_ADD_RULE_FROM_NATURAL_LANGUAGE_ANNOTATION as _SCHEMA_AUTOMATED_REASONING_POLICY_ADD_RULE_FROM_NATURAL_LANGUAGE_ANNOTATION, - AUTOMATED_REASONING_POLICY_ADD_RULE_MUTATION as _SCHEMA_AUTOMATED_REASONING_POLICY_ADD_RULE_MUTATION, - AUTOMATED_REASONING_POLICY_ADD_TYPE_ANNOTATION as _SCHEMA_AUTOMATED_REASONING_POLICY_ADD_TYPE_ANNOTATION, - AUTOMATED_REASONING_POLICY_ADD_TYPE_MUTATION as _SCHEMA_AUTOMATED_REASONING_POLICY_ADD_TYPE_MUTATION, - AUTOMATED_REASONING_POLICY_ADD_TYPE_VALUE as _SCHEMA_AUTOMATED_REASONING_POLICY_ADD_TYPE_VALUE, - AUTOMATED_REASONING_POLICY_ADD_VARIABLE_ANNOTATION as _SCHEMA_AUTOMATED_REASONING_POLICY_ADD_VARIABLE_ANNOTATION, - AUTOMATED_REASONING_POLICY_ADD_VARIABLE_MUTATION as _SCHEMA_AUTOMATED_REASONING_POLICY_ADD_VARIABLE_MUTATION, - AUTOMATED_REASONING_POLICY_ANNOTATED_CHUNK as _SCHEMA_AUTOMATED_REASONING_POLICY_ANNOTATED_CHUNK, - AUTOMATED_REASONING_POLICY_ANNOTATED_CONTENT as _SCHEMA_AUTOMATED_REASONING_POLICY_ANNOTATED_CONTENT, - AUTOMATED_REASONING_POLICY_ANNOTATED_LINE as _SCHEMA_AUTOMATED_REASONING_POLICY_ANNOTATED_LINE, - AUTOMATED_REASONING_POLICY_ANNOTATION as _SCHEMA_AUTOMATED_REASONING_POLICY_ANNOTATION, - AUTOMATED_REASONING_POLICY_ATOMIC_STATEMENT as _SCHEMA_AUTOMATED_REASONING_POLICY_ATOMIC_STATEMENT, - AUTOMATED_REASONING_POLICY_BUILD_LOG as _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_LOG, - AUTOMATED_REASONING_POLICY_BUILD_LOG_ENTRY as _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_LOG_ENTRY, - AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSETS as _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSETS, - AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSET_MANIFEST as _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSET_MANIFEST, - AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSET_MANIFEST_ENTRY as _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSET_MANIFEST_ENTRY, - AUTOMATED_REASONING_POLICY_BUILD_STEP as _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_STEP, - AUTOMATED_REASONING_POLICY_BUILD_STEP_CONTEXT as _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_STEP_CONTEXT, - AUTOMATED_REASONING_POLICY_BUILD_STEP_MESSAGE as _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_STEP_MESSAGE, - AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_DOCUMENT as _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_DOCUMENT, - AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_REPAIR_CONTENT as _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_REPAIR_CONTENT, - AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_SOURCE as _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_SOURCE, - AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_SUMMARY as _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_SUMMARY, - AUTOMATED_REASONING_POLICY_DEFINITION as _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION, - AUTOMATED_REASONING_POLICY_DEFINITION_ELEMENT as _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_ELEMENT, - AUTOMATED_REASONING_POLICY_DEFINITION_QUALITY_REPORT as _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_QUALITY_REPORT, - AUTOMATED_REASONING_POLICY_DEFINITION_RULE as _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_RULE, - AUTOMATED_REASONING_POLICY_DEFINITION_TYPE as _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_TYPE, - AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE as _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE, - AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE_PAIR as _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE_PAIR, - AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE as _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE, - AUTOMATED_REASONING_POLICY_DELETE_RULE_ANNOTATION as _SCHEMA_AUTOMATED_REASONING_POLICY_DELETE_RULE_ANNOTATION, - AUTOMATED_REASONING_POLICY_DELETE_RULE_MUTATION as _SCHEMA_AUTOMATED_REASONING_POLICY_DELETE_RULE_MUTATION, - AUTOMATED_REASONING_POLICY_DELETE_TYPE_ANNOTATION as _SCHEMA_AUTOMATED_REASONING_POLICY_DELETE_TYPE_ANNOTATION, - AUTOMATED_REASONING_POLICY_DELETE_TYPE_MUTATION as _SCHEMA_AUTOMATED_REASONING_POLICY_DELETE_TYPE_MUTATION, - AUTOMATED_REASONING_POLICY_DELETE_TYPE_VALUE as _SCHEMA_AUTOMATED_REASONING_POLICY_DELETE_TYPE_VALUE, - AUTOMATED_REASONING_POLICY_DELETE_VARIABLE_ANNOTATION as _SCHEMA_AUTOMATED_REASONING_POLICY_DELETE_VARIABLE_ANNOTATION, - AUTOMATED_REASONING_POLICY_DELETE_VARIABLE_MUTATION as _SCHEMA_AUTOMATED_REASONING_POLICY_DELETE_VARIABLE_MUTATION, - AUTOMATED_REASONING_POLICY_DISJOINT_RULE_SET as _SCHEMA_AUTOMATED_REASONING_POLICY_DISJOINT_RULE_SET, - AUTOMATED_REASONING_POLICY_FIDELITY_REPORT as _SCHEMA_AUTOMATED_REASONING_POLICY_FIDELITY_REPORT, - AUTOMATED_REASONING_POLICY_GENERATED_TEST_CASE as _SCHEMA_AUTOMATED_REASONING_POLICY_GENERATED_TEST_CASE, - AUTOMATED_REASONING_POLICY_GENERATED_TEST_CASES as _SCHEMA_AUTOMATED_REASONING_POLICY_GENERATED_TEST_CASES, - AUTOMATED_REASONING_POLICY_GENERATE_FIDELITY_REPORT_CONTENT as _SCHEMA_AUTOMATED_REASONING_POLICY_GENERATE_FIDELITY_REPORT_CONTENT, - AUTOMATED_REASONING_POLICY_INGEST_CONTENT_ANNOTATION as _SCHEMA_AUTOMATED_REASONING_POLICY_INGEST_CONTENT_ANNOTATION, - AUTOMATED_REASONING_POLICY_ITERATIVE_REFINEMENT_CONTENT as _SCHEMA_AUTOMATED_REASONING_POLICY_ITERATIVE_REFINEMENT_CONTENT, - AUTOMATED_REASONING_POLICY_MUTATION as _SCHEMA_AUTOMATED_REASONING_POLICY_MUTATION, - AUTOMATED_REASONING_POLICY_PLANNING as _SCHEMA_AUTOMATED_REASONING_POLICY_PLANNING, - AUTOMATED_REASONING_POLICY_REPORT_SOURCE_DOCUMENT as _SCHEMA_AUTOMATED_REASONING_POLICY_REPORT_SOURCE_DOCUMENT, - AUTOMATED_REASONING_POLICY_RULE_REPORT as _SCHEMA_AUTOMATED_REASONING_POLICY_RULE_REPORT, - AUTOMATED_REASONING_POLICY_SCENARIO as _SCHEMA_AUTOMATED_REASONING_POLICY_SCENARIO, - AUTOMATED_REASONING_POLICY_SCENARIOS as _SCHEMA_AUTOMATED_REASONING_POLICY_SCENARIOS, - AUTOMATED_REASONING_POLICY_SOURCE_DOCUMENT as _SCHEMA_AUTOMATED_REASONING_POLICY_SOURCE_DOCUMENT, - AUTOMATED_REASONING_POLICY_STATEMENT_LOCATION as _SCHEMA_AUTOMATED_REASONING_POLICY_STATEMENT_LOCATION, - AUTOMATED_REASONING_POLICY_STATEMENT_REFERENCE as _SCHEMA_AUTOMATED_REASONING_POLICY_STATEMENT_REFERENCE, - AUTOMATED_REASONING_POLICY_SUMMARY as _SCHEMA_AUTOMATED_REASONING_POLICY_SUMMARY, - AUTOMATED_REASONING_POLICY_TEST_CASE as _SCHEMA_AUTOMATED_REASONING_POLICY_TEST_CASE, - AUTOMATED_REASONING_POLICY_TEST_RESULT as _SCHEMA_AUTOMATED_REASONING_POLICY_TEST_RESULT, - AUTOMATED_REASONING_POLICY_TYPE_VALUE_ANNOTATION as _SCHEMA_AUTOMATED_REASONING_POLICY_TYPE_VALUE_ANNOTATION, - AUTOMATED_REASONING_POLICY_UPDATE_FROM_RULE_FEEDBACK_ANNOTATION as _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_FROM_RULE_FEEDBACK_ANNOTATION, - AUTOMATED_REASONING_POLICY_UPDATE_FROM_SCENARIO_FEEDBACK_ANNOTATION as _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_FROM_SCENARIO_FEEDBACK_ANNOTATION, - AUTOMATED_REASONING_POLICY_UPDATE_RULE_ANNOTATION as _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_RULE_ANNOTATION, - AUTOMATED_REASONING_POLICY_UPDATE_RULE_MUTATION as _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_RULE_MUTATION, - AUTOMATED_REASONING_POLICY_UPDATE_TYPE_ANNOTATION as _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_TYPE_ANNOTATION, - AUTOMATED_REASONING_POLICY_UPDATE_TYPE_MUTATION as _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_TYPE_MUTATION, - AUTOMATED_REASONING_POLICY_UPDATE_TYPE_VALUE as _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_TYPE_VALUE, - AUTOMATED_REASONING_POLICY_UPDATE_VARIABLE_ANNOTATION as _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_VARIABLE_ANNOTATION, - AUTOMATED_REASONING_POLICY_UPDATE_VARIABLE_MUTATION as _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_VARIABLE_MUTATION, - AUTOMATED_REASONING_POLICY_VARIABLE_REPORT as _SCHEMA_AUTOMATED_REASONING_POLICY_VARIABLE_REPORT, - AUTOMATED_REASONING_POLICY_WORKFLOW_TYPE_CONTENT as _SCHEMA_AUTOMATED_REASONING_POLICY_WORKFLOW_TYPE_CONTENT, BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB as _SCHEMA_BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB, - BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_ERROR as _SCHEMA_BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_ERROR, - BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT as _SCHEMA_BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT, - BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_ITEM as _SCHEMA_BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_ITEM, - BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT as _SCHEMA_BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT, BATCH_DELETE_EVALUATION_JOB as _SCHEMA_BATCH_DELETE_EVALUATION_JOB, - BATCH_DELETE_EVALUATION_JOB_ERROR as _SCHEMA_BATCH_DELETE_EVALUATION_JOB_ERROR, - BATCH_DELETE_EVALUATION_JOB_INPUT as _SCHEMA_BATCH_DELETE_EVALUATION_JOB_INPUT, - BATCH_DELETE_EVALUATION_JOB_ITEM as _SCHEMA_BATCH_DELETE_EVALUATION_JOB_ITEM, - BATCH_DELETE_EVALUATION_JOB_OUTPUT as _SCHEMA_BATCH_DELETE_EVALUATION_JOB_OUTPUT, - BEDROCK_EVALUATOR_MODEL as _SCHEMA_BEDROCK_EVALUATOR_MODEL, - BYTE_CONTENT_DOC as _SCHEMA_BYTE_CONTENT_DOC, CANCEL_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW as _SCHEMA_CANCEL_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW, - CANCEL_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT as _SCHEMA_CANCEL_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT, - CANCEL_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT as _SCHEMA_CANCEL_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT, - CLOUD_WATCH_CONFIG as _SCHEMA_CLOUD_WATCH_CONFIG, - CONFLICT_EXCEPTION as _SCHEMA_CONFLICT_EXCEPTION, CREATE_ADVANCED_PROMPT_OPTIMIZATION_JOB as _SCHEMA_CREATE_ADVANCED_PROMPT_OPTIMIZATION_JOB, - CREATE_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT as _SCHEMA_CREATE_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT, - CREATE_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT as _SCHEMA_CREATE_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT, CREATE_AUTOMATED_REASONING_POLICY as _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY, - CREATE_AUTOMATED_REASONING_POLICY_INPUT as _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_INPUT, - CREATE_AUTOMATED_REASONING_POLICY_OUTPUT as _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_OUTPUT, CREATE_AUTOMATED_REASONING_POLICY_TEST_CASE as _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_TEST_CASE, - CREATE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT as _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT, - CREATE_AUTOMATED_REASONING_POLICY_TEST_CASE_OUTPUT as _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_TEST_CASE_OUTPUT, CREATE_AUTOMATED_REASONING_POLICY_VERSION as _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_VERSION, - CREATE_AUTOMATED_REASONING_POLICY_VERSION_INPUT as _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_VERSION_INPUT, - CREATE_AUTOMATED_REASONING_POLICY_VERSION_OUTPUT as _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_VERSION_OUTPUT, CREATE_CUSTOM_MODEL as _SCHEMA_CREATE_CUSTOM_MODEL, CREATE_CUSTOM_MODEL_DEPLOYMENT as _SCHEMA_CREATE_CUSTOM_MODEL_DEPLOYMENT, - CREATE_CUSTOM_MODEL_DEPLOYMENT_INPUT as _SCHEMA_CREATE_CUSTOM_MODEL_DEPLOYMENT_INPUT, - CREATE_CUSTOM_MODEL_DEPLOYMENT_OUTPUT as _SCHEMA_CREATE_CUSTOM_MODEL_DEPLOYMENT_OUTPUT, - CREATE_CUSTOM_MODEL_INPUT as _SCHEMA_CREATE_CUSTOM_MODEL_INPUT, - CREATE_CUSTOM_MODEL_OUTPUT as _SCHEMA_CREATE_CUSTOM_MODEL_OUTPUT, CREATE_EVALUATION_JOB as _SCHEMA_CREATE_EVALUATION_JOB, - CREATE_EVALUATION_JOB_INPUT as _SCHEMA_CREATE_EVALUATION_JOB_INPUT, - CREATE_EVALUATION_JOB_OUTPUT as _SCHEMA_CREATE_EVALUATION_JOB_OUTPUT, CREATE_FOUNDATION_MODEL_AGREEMENT as _SCHEMA_CREATE_FOUNDATION_MODEL_AGREEMENT, - CREATE_FOUNDATION_MODEL_AGREEMENT_INPUT as _SCHEMA_CREATE_FOUNDATION_MODEL_AGREEMENT_INPUT, - CREATE_FOUNDATION_MODEL_AGREEMENT_OUTPUT as _SCHEMA_CREATE_FOUNDATION_MODEL_AGREEMENT_OUTPUT, CREATE_GUARDRAIL as _SCHEMA_CREATE_GUARDRAIL, - CREATE_GUARDRAIL_INPUT as _SCHEMA_CREATE_GUARDRAIL_INPUT, - CREATE_GUARDRAIL_OUTPUT as _SCHEMA_CREATE_GUARDRAIL_OUTPUT, CREATE_GUARDRAIL_VERSION as _SCHEMA_CREATE_GUARDRAIL_VERSION, - CREATE_GUARDRAIL_VERSION_INPUT as _SCHEMA_CREATE_GUARDRAIL_VERSION_INPUT, - CREATE_GUARDRAIL_VERSION_OUTPUT as _SCHEMA_CREATE_GUARDRAIL_VERSION_OUTPUT, CREATE_INFERENCE_PROFILE as _SCHEMA_CREATE_INFERENCE_PROFILE, - CREATE_INFERENCE_PROFILE_INPUT as _SCHEMA_CREATE_INFERENCE_PROFILE_INPUT, - CREATE_INFERENCE_PROFILE_OUTPUT as _SCHEMA_CREATE_INFERENCE_PROFILE_OUTPUT, CREATE_MARKETPLACE_MODEL_ENDPOINT as _SCHEMA_CREATE_MARKETPLACE_MODEL_ENDPOINT, - CREATE_MARKETPLACE_MODEL_ENDPOINT_INPUT as _SCHEMA_CREATE_MARKETPLACE_MODEL_ENDPOINT_INPUT, - CREATE_MARKETPLACE_MODEL_ENDPOINT_OUTPUT as _SCHEMA_CREATE_MARKETPLACE_MODEL_ENDPOINT_OUTPUT, CREATE_MODEL_COPY_JOB as _SCHEMA_CREATE_MODEL_COPY_JOB, - CREATE_MODEL_COPY_JOB_INPUT as _SCHEMA_CREATE_MODEL_COPY_JOB_INPUT, - CREATE_MODEL_COPY_JOB_OUTPUT as _SCHEMA_CREATE_MODEL_COPY_JOB_OUTPUT, CREATE_MODEL_CUSTOMIZATION_JOB as _SCHEMA_CREATE_MODEL_CUSTOMIZATION_JOB, - CREATE_MODEL_CUSTOMIZATION_JOB_INPUT as _SCHEMA_CREATE_MODEL_CUSTOMIZATION_JOB_INPUT, - CREATE_MODEL_CUSTOMIZATION_JOB_OUTPUT as _SCHEMA_CREATE_MODEL_CUSTOMIZATION_JOB_OUTPUT, CREATE_MODEL_IMPORT_JOB as _SCHEMA_CREATE_MODEL_IMPORT_JOB, - CREATE_MODEL_IMPORT_JOB_INPUT as _SCHEMA_CREATE_MODEL_IMPORT_JOB_INPUT, - CREATE_MODEL_IMPORT_JOB_OUTPUT as _SCHEMA_CREATE_MODEL_IMPORT_JOB_OUTPUT, CREATE_MODEL_INVOCATION_JOB as _SCHEMA_CREATE_MODEL_INVOCATION_JOB, - CREATE_MODEL_INVOCATION_JOB_INPUT as _SCHEMA_CREATE_MODEL_INVOCATION_JOB_INPUT, - CREATE_MODEL_INVOCATION_JOB_OUTPUT as _SCHEMA_CREATE_MODEL_INVOCATION_JOB_OUTPUT, CREATE_PROMPT_ROUTER as _SCHEMA_CREATE_PROMPT_ROUTER, - CREATE_PROMPT_ROUTER_INPUT as _SCHEMA_CREATE_PROMPT_ROUTER_INPUT, - CREATE_PROMPT_ROUTER_OUTPUT as _SCHEMA_CREATE_PROMPT_ROUTER_OUTPUT, CREATE_PROVISIONED_MODEL_THROUGHPUT as _SCHEMA_CREATE_PROVISIONED_MODEL_THROUGHPUT, - CREATE_PROVISIONED_MODEL_THROUGHPUT_INPUT as _SCHEMA_CREATE_PROVISIONED_MODEL_THROUGHPUT_INPUT, - CREATE_PROVISIONED_MODEL_THROUGHPUT_OUTPUT as _SCHEMA_CREATE_PROVISIONED_MODEL_THROUGHPUT_OUTPUT, - CUSTOMIZATION_CONFIG as _SCHEMA_CUSTOMIZATION_CONFIG, - CUSTOM_METRIC_BEDROCK_EVALUATOR_MODEL as _SCHEMA_CUSTOM_METRIC_BEDROCK_EVALUATOR_MODEL, - CUSTOM_METRIC_DEFINITION as _SCHEMA_CUSTOM_METRIC_DEFINITION, - CUSTOM_METRIC_EVALUATOR_MODEL_CONFIG as _SCHEMA_CUSTOM_METRIC_EVALUATOR_MODEL_CONFIG, - CUSTOM_MODEL_DATA_SOURCE as _SCHEMA_CUSTOM_MODEL_DATA_SOURCE, - CUSTOM_MODEL_DEPLOYMENT_SUMMARY as _SCHEMA_CUSTOM_MODEL_DEPLOYMENT_SUMMARY, - CUSTOM_MODEL_DEPLOYMENT_UPDATE_DETAILS as _SCHEMA_CUSTOM_MODEL_DEPLOYMENT_UPDATE_DETAILS, - CUSTOM_MODEL_SUMMARY as _SCHEMA_CUSTOM_MODEL_SUMMARY, - CUSTOM_MODEL_UNITS as _SCHEMA_CUSTOM_MODEL_UNITS, - DATA_PROCESSING_DETAILS as _SCHEMA_DATA_PROCESSING_DETAILS, DELETE_AUTOMATED_REASONING_POLICY as _SCHEMA_DELETE_AUTOMATED_REASONING_POLICY, DELETE_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW as _SCHEMA_DELETE_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW, - DELETE_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT as _SCHEMA_DELETE_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT, - DELETE_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT as _SCHEMA_DELETE_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT, - DELETE_AUTOMATED_REASONING_POLICY_INPUT as _SCHEMA_DELETE_AUTOMATED_REASONING_POLICY_INPUT, - DELETE_AUTOMATED_REASONING_POLICY_OUTPUT as _SCHEMA_DELETE_AUTOMATED_REASONING_POLICY_OUTPUT, DELETE_AUTOMATED_REASONING_POLICY_TEST_CASE as _SCHEMA_DELETE_AUTOMATED_REASONING_POLICY_TEST_CASE, - DELETE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT as _SCHEMA_DELETE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT, - DELETE_AUTOMATED_REASONING_POLICY_TEST_CASE_OUTPUT as _SCHEMA_DELETE_AUTOMATED_REASONING_POLICY_TEST_CASE_OUTPUT, DELETE_CUSTOM_MODEL as _SCHEMA_DELETE_CUSTOM_MODEL, DELETE_CUSTOM_MODEL_DEPLOYMENT as _SCHEMA_DELETE_CUSTOM_MODEL_DEPLOYMENT, - DELETE_CUSTOM_MODEL_DEPLOYMENT_INPUT as _SCHEMA_DELETE_CUSTOM_MODEL_DEPLOYMENT_INPUT, - DELETE_CUSTOM_MODEL_DEPLOYMENT_OUTPUT as _SCHEMA_DELETE_CUSTOM_MODEL_DEPLOYMENT_OUTPUT, - DELETE_CUSTOM_MODEL_INPUT as _SCHEMA_DELETE_CUSTOM_MODEL_INPUT, - DELETE_CUSTOM_MODEL_OUTPUT as _SCHEMA_DELETE_CUSTOM_MODEL_OUTPUT, DELETE_ENFORCED_GUARDRAIL_CONFIGURATION as _SCHEMA_DELETE_ENFORCED_GUARDRAIL_CONFIGURATION, - DELETE_ENFORCED_GUARDRAIL_CONFIGURATION_INPUT as _SCHEMA_DELETE_ENFORCED_GUARDRAIL_CONFIGURATION_INPUT, - DELETE_ENFORCED_GUARDRAIL_CONFIGURATION_OUTPUT as _SCHEMA_DELETE_ENFORCED_GUARDRAIL_CONFIGURATION_OUTPUT, DELETE_FOUNDATION_MODEL_AGREEMENT as _SCHEMA_DELETE_FOUNDATION_MODEL_AGREEMENT, - DELETE_FOUNDATION_MODEL_AGREEMENT_INPUT as _SCHEMA_DELETE_FOUNDATION_MODEL_AGREEMENT_INPUT, - DELETE_FOUNDATION_MODEL_AGREEMENT_OUTPUT as _SCHEMA_DELETE_FOUNDATION_MODEL_AGREEMENT_OUTPUT, DELETE_GUARDRAIL as _SCHEMA_DELETE_GUARDRAIL, - DELETE_GUARDRAIL_INPUT as _SCHEMA_DELETE_GUARDRAIL_INPUT, - DELETE_GUARDRAIL_OUTPUT as _SCHEMA_DELETE_GUARDRAIL_OUTPUT, DELETE_IMPORTED_MODEL as _SCHEMA_DELETE_IMPORTED_MODEL, - DELETE_IMPORTED_MODEL_INPUT as _SCHEMA_DELETE_IMPORTED_MODEL_INPUT, - DELETE_IMPORTED_MODEL_OUTPUT as _SCHEMA_DELETE_IMPORTED_MODEL_OUTPUT, DELETE_INFERENCE_PROFILE as _SCHEMA_DELETE_INFERENCE_PROFILE, - DELETE_INFERENCE_PROFILE_INPUT as _SCHEMA_DELETE_INFERENCE_PROFILE_INPUT, - DELETE_INFERENCE_PROFILE_OUTPUT as _SCHEMA_DELETE_INFERENCE_PROFILE_OUTPUT, DELETE_MARKETPLACE_MODEL_ENDPOINT as _SCHEMA_DELETE_MARKETPLACE_MODEL_ENDPOINT, - DELETE_MARKETPLACE_MODEL_ENDPOINT_INPUT as _SCHEMA_DELETE_MARKETPLACE_MODEL_ENDPOINT_INPUT, - DELETE_MARKETPLACE_MODEL_ENDPOINT_OUTPUT as _SCHEMA_DELETE_MARKETPLACE_MODEL_ENDPOINT_OUTPUT, DELETE_MODEL_INVOCATION_LOGGING_CONFIGURATION as _SCHEMA_DELETE_MODEL_INVOCATION_LOGGING_CONFIGURATION, - DELETE_MODEL_INVOCATION_LOGGING_CONFIGURATION_INPUT as _SCHEMA_DELETE_MODEL_INVOCATION_LOGGING_CONFIGURATION_INPUT, - DELETE_MODEL_INVOCATION_LOGGING_CONFIGURATION_OUTPUT as _SCHEMA_DELETE_MODEL_INVOCATION_LOGGING_CONFIGURATION_OUTPUT, DELETE_PROMPT_ROUTER as _SCHEMA_DELETE_PROMPT_ROUTER, - DELETE_PROMPT_ROUTER_INPUT as _SCHEMA_DELETE_PROMPT_ROUTER_INPUT, - DELETE_PROMPT_ROUTER_OUTPUT as _SCHEMA_DELETE_PROMPT_ROUTER_OUTPUT, DELETE_PROVISIONED_MODEL_THROUGHPUT as _SCHEMA_DELETE_PROVISIONED_MODEL_THROUGHPUT, - DELETE_PROVISIONED_MODEL_THROUGHPUT_INPUT as _SCHEMA_DELETE_PROVISIONED_MODEL_THROUGHPUT_INPUT, - DELETE_PROVISIONED_MODEL_THROUGHPUT_OUTPUT as _SCHEMA_DELETE_PROVISIONED_MODEL_THROUGHPUT_OUTPUT, DELETE_RESOURCE_POLICY as _SCHEMA_DELETE_RESOURCE_POLICY, - DELETE_RESOURCE_POLICY_INPUT as _SCHEMA_DELETE_RESOURCE_POLICY_INPUT, - DELETE_RESOURCE_POLICY_OUTPUT as _SCHEMA_DELETE_RESOURCE_POLICY_OUTPUT, DEREGISTER_MARKETPLACE_MODEL_ENDPOINT as _SCHEMA_DEREGISTER_MARKETPLACE_MODEL_ENDPOINT, - DEREGISTER_MARKETPLACE_MODEL_ENDPOINT_INPUT as _SCHEMA_DEREGISTER_MARKETPLACE_MODEL_ENDPOINT_INPUT, - DEREGISTER_MARKETPLACE_MODEL_ENDPOINT_OUTPUT as _SCHEMA_DEREGISTER_MARKETPLACE_MODEL_ENDPOINT_OUTPUT, - DIMENSIONAL_PRICE_RATE as _SCHEMA_DIMENSIONAL_PRICE_RATE, - DISTILLATION_CONFIG as _SCHEMA_DISTILLATION_CONFIG, - ENDPOINT_CONFIG as _SCHEMA_ENDPOINT_CONFIG, - EVALUATION_BEDROCK_MODEL as _SCHEMA_EVALUATION_BEDROCK_MODEL, - EVALUATION_CONFIG as _SCHEMA_EVALUATION_CONFIG, - EVALUATION_DATASET as _SCHEMA_EVALUATION_DATASET, - EVALUATION_DATASET_LOCATION as _SCHEMA_EVALUATION_DATASET_LOCATION, - EVALUATION_DATASET_METRIC_CONFIG as _SCHEMA_EVALUATION_DATASET_METRIC_CONFIG, - EVALUATION_INFERENCE_CONFIG as _SCHEMA_EVALUATION_INFERENCE_CONFIG, - EVALUATION_INFERENCE_CONFIG_SUMMARY as _SCHEMA_EVALUATION_INFERENCE_CONFIG_SUMMARY, - EVALUATION_MODEL_CONFIG as _SCHEMA_EVALUATION_MODEL_CONFIG, - EVALUATION_MODEL_CONFIG_SUMMARY as _SCHEMA_EVALUATION_MODEL_CONFIG_SUMMARY, - EVALUATION_OUTPUT_DATA_CONFIG as _SCHEMA_EVALUATION_OUTPUT_DATA_CONFIG, - EVALUATION_PRECOMPUTED_INFERENCE_SOURCE as _SCHEMA_EVALUATION_PRECOMPUTED_INFERENCE_SOURCE, - EVALUATION_PRECOMPUTED_RAG_SOURCE_CONFIG as _SCHEMA_EVALUATION_PRECOMPUTED_RAG_SOURCE_CONFIG, - EVALUATION_PRECOMPUTED_RETRIEVE_AND_GENERATE_SOURCE_CONFIG as _SCHEMA_EVALUATION_PRECOMPUTED_RETRIEVE_AND_GENERATE_SOURCE_CONFIG, - EVALUATION_PRECOMPUTED_RETRIEVE_SOURCE_CONFIG as _SCHEMA_EVALUATION_PRECOMPUTED_RETRIEVE_SOURCE_CONFIG, - EVALUATION_RAG_CONFIG_SUMMARY as _SCHEMA_EVALUATION_RAG_CONFIG_SUMMARY, - EVALUATION_SUMMARY as _SCHEMA_EVALUATION_SUMMARY, - EVALUATOR_MODEL_CONFIG as _SCHEMA_EVALUATOR_MODEL_CONFIG, EXPORT_AUTOMATED_REASONING_POLICY_VERSION as _SCHEMA_EXPORT_AUTOMATED_REASONING_POLICY_VERSION, - EXPORT_AUTOMATED_REASONING_POLICY_VERSION_INPUT as _SCHEMA_EXPORT_AUTOMATED_REASONING_POLICY_VERSION_INPUT, - EXPORT_AUTOMATED_REASONING_POLICY_VERSION_OUTPUT as _SCHEMA_EXPORT_AUTOMATED_REASONING_POLICY_VERSION_OUTPUT, - EXTERNAL_SOURCE as _SCHEMA_EXTERNAL_SOURCE, - EXTERNAL_SOURCES_GENERATION_CONFIGURATION as _SCHEMA_EXTERNAL_SOURCES_GENERATION_CONFIGURATION, - EXTERNAL_SOURCES_RETRIEVE_AND_GENERATE_CONFIGURATION as _SCHEMA_EXTERNAL_SOURCES_RETRIEVE_AND_GENERATE_CONFIGURATION, - FIELD_FOR_RERANKING as _SCHEMA_FIELD_FOR_RERANKING, - FILTER_ATTRIBUTE as _SCHEMA_FILTER_ATTRIBUTE, - FOUNDATION_MODEL_DETAILS as _SCHEMA_FOUNDATION_MODEL_DETAILS, - FOUNDATION_MODEL_LIFECYCLE as _SCHEMA_FOUNDATION_MODEL_LIFECYCLE, - FOUNDATION_MODEL_SUMMARY as _SCHEMA_FOUNDATION_MODEL_SUMMARY, - GENERATION_CONFIGURATION as _SCHEMA_GENERATION_CONFIGURATION, GET_ACCOUNT_DATA_RETENTION as _SCHEMA_GET_ACCOUNT_DATA_RETENTION, - GET_ACCOUNT_DATA_RETENTION_INPUT as _SCHEMA_GET_ACCOUNT_DATA_RETENTION_INPUT, - GET_ACCOUNT_DATA_RETENTION_OUTPUT as _SCHEMA_GET_ACCOUNT_DATA_RETENTION_OUTPUT, GET_ADVANCED_PROMPT_OPTIMIZATION_JOB as _SCHEMA_GET_ADVANCED_PROMPT_OPTIMIZATION_JOB, - GET_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT as _SCHEMA_GET_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT, - GET_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT as _SCHEMA_GET_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT, GET_AUTOMATED_REASONING_POLICY as _SCHEMA_GET_AUTOMATED_REASONING_POLICY, GET_AUTOMATED_REASONING_POLICY_ANNOTATIONS as _SCHEMA_GET_AUTOMATED_REASONING_POLICY_ANNOTATIONS, - GET_AUTOMATED_REASONING_POLICY_ANNOTATIONS_INPUT as _SCHEMA_GET_AUTOMATED_REASONING_POLICY_ANNOTATIONS_INPUT, - GET_AUTOMATED_REASONING_POLICY_ANNOTATIONS_OUTPUT as _SCHEMA_GET_AUTOMATED_REASONING_POLICY_ANNOTATIONS_OUTPUT, GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW as _SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW, - GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT as _SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT, - GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT as _SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT, GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_RESULT_ASSETS as _SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_RESULT_ASSETS, - GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_RESULT_ASSETS_INPUT as _SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_RESULT_ASSETS_INPUT, - GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_RESULT_ASSETS_OUTPUT as _SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_RESULT_ASSETS_OUTPUT, - GET_AUTOMATED_REASONING_POLICY_INPUT as _SCHEMA_GET_AUTOMATED_REASONING_POLICY_INPUT, GET_AUTOMATED_REASONING_POLICY_NEXT_SCENARIO as _SCHEMA_GET_AUTOMATED_REASONING_POLICY_NEXT_SCENARIO, - GET_AUTOMATED_REASONING_POLICY_NEXT_SCENARIO_INPUT as _SCHEMA_GET_AUTOMATED_REASONING_POLICY_NEXT_SCENARIO_INPUT, - GET_AUTOMATED_REASONING_POLICY_NEXT_SCENARIO_OUTPUT as _SCHEMA_GET_AUTOMATED_REASONING_POLICY_NEXT_SCENARIO_OUTPUT, - GET_AUTOMATED_REASONING_POLICY_OUTPUT as _SCHEMA_GET_AUTOMATED_REASONING_POLICY_OUTPUT, GET_AUTOMATED_REASONING_POLICY_TEST_CASE as _SCHEMA_GET_AUTOMATED_REASONING_POLICY_TEST_CASE, - GET_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT as _SCHEMA_GET_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT, - GET_AUTOMATED_REASONING_POLICY_TEST_CASE_OUTPUT as _SCHEMA_GET_AUTOMATED_REASONING_POLICY_TEST_CASE_OUTPUT, GET_AUTOMATED_REASONING_POLICY_TEST_RESULT as _SCHEMA_GET_AUTOMATED_REASONING_POLICY_TEST_RESULT, - GET_AUTOMATED_REASONING_POLICY_TEST_RESULT_INPUT as _SCHEMA_GET_AUTOMATED_REASONING_POLICY_TEST_RESULT_INPUT, - GET_AUTOMATED_REASONING_POLICY_TEST_RESULT_OUTPUT as _SCHEMA_GET_AUTOMATED_REASONING_POLICY_TEST_RESULT_OUTPUT, GET_CUSTOM_MODEL as _SCHEMA_GET_CUSTOM_MODEL, GET_CUSTOM_MODEL_DEPLOYMENT as _SCHEMA_GET_CUSTOM_MODEL_DEPLOYMENT, - GET_CUSTOM_MODEL_DEPLOYMENT_INPUT as _SCHEMA_GET_CUSTOM_MODEL_DEPLOYMENT_INPUT, - GET_CUSTOM_MODEL_DEPLOYMENT_OUTPUT as _SCHEMA_GET_CUSTOM_MODEL_DEPLOYMENT_OUTPUT, - GET_CUSTOM_MODEL_INPUT as _SCHEMA_GET_CUSTOM_MODEL_INPUT, - GET_CUSTOM_MODEL_OUTPUT as _SCHEMA_GET_CUSTOM_MODEL_OUTPUT, GET_EVALUATION_JOB as _SCHEMA_GET_EVALUATION_JOB, - GET_EVALUATION_JOB_INPUT as _SCHEMA_GET_EVALUATION_JOB_INPUT, - GET_EVALUATION_JOB_OUTPUT as _SCHEMA_GET_EVALUATION_JOB_OUTPUT, GET_FOUNDATION_MODEL as _SCHEMA_GET_FOUNDATION_MODEL, GET_FOUNDATION_MODEL_AVAILABILITY as _SCHEMA_GET_FOUNDATION_MODEL_AVAILABILITY, - GET_FOUNDATION_MODEL_AVAILABILITY_INPUT as _SCHEMA_GET_FOUNDATION_MODEL_AVAILABILITY_INPUT, - GET_FOUNDATION_MODEL_AVAILABILITY_OUTPUT as _SCHEMA_GET_FOUNDATION_MODEL_AVAILABILITY_OUTPUT, - GET_FOUNDATION_MODEL_INPUT as _SCHEMA_GET_FOUNDATION_MODEL_INPUT, - GET_FOUNDATION_MODEL_OUTPUT as _SCHEMA_GET_FOUNDATION_MODEL_OUTPUT, GET_GUARDRAIL as _SCHEMA_GET_GUARDRAIL, - GET_GUARDRAIL_INPUT as _SCHEMA_GET_GUARDRAIL_INPUT, - GET_GUARDRAIL_OUTPUT as _SCHEMA_GET_GUARDRAIL_OUTPUT, GET_IMPORTED_MODEL as _SCHEMA_GET_IMPORTED_MODEL, - GET_IMPORTED_MODEL_INPUT as _SCHEMA_GET_IMPORTED_MODEL_INPUT, - GET_IMPORTED_MODEL_OUTPUT as _SCHEMA_GET_IMPORTED_MODEL_OUTPUT, GET_INFERENCE_PROFILE as _SCHEMA_GET_INFERENCE_PROFILE, - GET_INFERENCE_PROFILE_INPUT as _SCHEMA_GET_INFERENCE_PROFILE_INPUT, - GET_INFERENCE_PROFILE_OUTPUT as _SCHEMA_GET_INFERENCE_PROFILE_OUTPUT, GET_MARKETPLACE_MODEL_ENDPOINT as _SCHEMA_GET_MARKETPLACE_MODEL_ENDPOINT, - GET_MARKETPLACE_MODEL_ENDPOINT_INPUT as _SCHEMA_GET_MARKETPLACE_MODEL_ENDPOINT_INPUT, - GET_MARKETPLACE_MODEL_ENDPOINT_OUTPUT as _SCHEMA_GET_MARKETPLACE_MODEL_ENDPOINT_OUTPUT, GET_MODEL_COPY_JOB as _SCHEMA_GET_MODEL_COPY_JOB, - GET_MODEL_COPY_JOB_INPUT as _SCHEMA_GET_MODEL_COPY_JOB_INPUT, - GET_MODEL_COPY_JOB_OUTPUT as _SCHEMA_GET_MODEL_COPY_JOB_OUTPUT, GET_MODEL_CUSTOMIZATION_JOB as _SCHEMA_GET_MODEL_CUSTOMIZATION_JOB, - GET_MODEL_CUSTOMIZATION_JOB_INPUT as _SCHEMA_GET_MODEL_CUSTOMIZATION_JOB_INPUT, - GET_MODEL_CUSTOMIZATION_JOB_OUTPUT as _SCHEMA_GET_MODEL_CUSTOMIZATION_JOB_OUTPUT, GET_MODEL_IMPORT_JOB as _SCHEMA_GET_MODEL_IMPORT_JOB, - GET_MODEL_IMPORT_JOB_INPUT as _SCHEMA_GET_MODEL_IMPORT_JOB_INPUT, - GET_MODEL_IMPORT_JOB_OUTPUT as _SCHEMA_GET_MODEL_IMPORT_JOB_OUTPUT, GET_MODEL_INVOCATION_JOB as _SCHEMA_GET_MODEL_INVOCATION_JOB, - GET_MODEL_INVOCATION_JOB_INPUT as _SCHEMA_GET_MODEL_INVOCATION_JOB_INPUT, - GET_MODEL_INVOCATION_JOB_OUTPUT as _SCHEMA_GET_MODEL_INVOCATION_JOB_OUTPUT, GET_MODEL_INVOCATION_LOGGING_CONFIGURATION as _SCHEMA_GET_MODEL_INVOCATION_LOGGING_CONFIGURATION, - GET_MODEL_INVOCATION_LOGGING_CONFIGURATION_INPUT as _SCHEMA_GET_MODEL_INVOCATION_LOGGING_CONFIGURATION_INPUT, - GET_MODEL_INVOCATION_LOGGING_CONFIGURATION_OUTPUT as _SCHEMA_GET_MODEL_INVOCATION_LOGGING_CONFIGURATION_OUTPUT, GET_PROMPT_ROUTER as _SCHEMA_GET_PROMPT_ROUTER, - GET_PROMPT_ROUTER_INPUT as _SCHEMA_GET_PROMPT_ROUTER_INPUT, - GET_PROMPT_ROUTER_OUTPUT as _SCHEMA_GET_PROMPT_ROUTER_OUTPUT, GET_PROVISIONED_MODEL_THROUGHPUT as _SCHEMA_GET_PROVISIONED_MODEL_THROUGHPUT, - GET_PROVISIONED_MODEL_THROUGHPUT_INPUT as _SCHEMA_GET_PROVISIONED_MODEL_THROUGHPUT_INPUT, - GET_PROVISIONED_MODEL_THROUGHPUT_OUTPUT as _SCHEMA_GET_PROVISIONED_MODEL_THROUGHPUT_OUTPUT, GET_RESOURCE_POLICY as _SCHEMA_GET_RESOURCE_POLICY, - GET_RESOURCE_POLICY_INPUT as _SCHEMA_GET_RESOURCE_POLICY_INPUT, - GET_RESOURCE_POLICY_OUTPUT as _SCHEMA_GET_RESOURCE_POLICY_OUTPUT, GET_USE_CASE_FOR_MODEL_ACCESS as _SCHEMA_GET_USE_CASE_FOR_MODEL_ACCESS, - GET_USE_CASE_FOR_MODEL_ACCESS_INPUT as _SCHEMA_GET_USE_CASE_FOR_MODEL_ACCESS_INPUT, - GET_USE_CASE_FOR_MODEL_ACCESS_OUTPUT as _SCHEMA_GET_USE_CASE_FOR_MODEL_ACCESS_OUTPUT, - GRADER_CONFIG as _SCHEMA_GRADER_CONFIG, - GUARDRAIL_AUTOMATED_REASONING_POLICY as _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_POLICY, - GUARDRAIL_AUTOMATED_REASONING_POLICY_CONFIG as _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_POLICY_CONFIG, - GUARDRAIL_CONFIGURATION as _SCHEMA_GUARDRAIL_CONFIGURATION, - GUARDRAIL_CONTENT_FILTER as _SCHEMA_GUARDRAIL_CONTENT_FILTER, - GUARDRAIL_CONTENT_FILTERS_TIER as _SCHEMA_GUARDRAIL_CONTENT_FILTERS_TIER, - GUARDRAIL_CONTENT_FILTERS_TIER_CONFIG as _SCHEMA_GUARDRAIL_CONTENT_FILTERS_TIER_CONFIG, - GUARDRAIL_CONTENT_FILTER_CONFIG as _SCHEMA_GUARDRAIL_CONTENT_FILTER_CONFIG, - GUARDRAIL_CONTENT_POLICY as _SCHEMA_GUARDRAIL_CONTENT_POLICY, - GUARDRAIL_CONTENT_POLICY_CONFIG as _SCHEMA_GUARDRAIL_CONTENT_POLICY_CONFIG, - GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER as _SCHEMA_GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER, - GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER_CONFIG as _SCHEMA_GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER_CONFIG, - GUARDRAIL_CONTEXTUAL_GROUNDING_POLICY as _SCHEMA_GUARDRAIL_CONTEXTUAL_GROUNDING_POLICY, - GUARDRAIL_CONTEXTUAL_GROUNDING_POLICY_CONFIG as _SCHEMA_GUARDRAIL_CONTEXTUAL_GROUNDING_POLICY_CONFIG, - GUARDRAIL_CROSS_REGION_CONFIG as _SCHEMA_GUARDRAIL_CROSS_REGION_CONFIG, - GUARDRAIL_CROSS_REGION_DETAILS as _SCHEMA_GUARDRAIL_CROSS_REGION_DETAILS, - GUARDRAIL_MANAGED_WORDS as _SCHEMA_GUARDRAIL_MANAGED_WORDS, - GUARDRAIL_MANAGED_WORDS_CONFIG as _SCHEMA_GUARDRAIL_MANAGED_WORDS_CONFIG, - GUARDRAIL_PII_ENTITY as _SCHEMA_GUARDRAIL_PII_ENTITY, - GUARDRAIL_PII_ENTITY_CONFIG as _SCHEMA_GUARDRAIL_PII_ENTITY_CONFIG, - GUARDRAIL_REGEX as _SCHEMA_GUARDRAIL_REGEX, - GUARDRAIL_REGEX_CONFIG as _SCHEMA_GUARDRAIL_REGEX_CONFIG, - GUARDRAIL_SENSITIVE_INFORMATION_POLICY as _SCHEMA_GUARDRAIL_SENSITIVE_INFORMATION_POLICY, - GUARDRAIL_SENSITIVE_INFORMATION_POLICY_CONFIG as _SCHEMA_GUARDRAIL_SENSITIVE_INFORMATION_POLICY_CONFIG, - GUARDRAIL_SUMMARY as _SCHEMA_GUARDRAIL_SUMMARY, - GUARDRAIL_TOPIC as _SCHEMA_GUARDRAIL_TOPIC, - GUARDRAIL_TOPICS_TIER as _SCHEMA_GUARDRAIL_TOPICS_TIER, - GUARDRAIL_TOPICS_TIER_CONFIG as _SCHEMA_GUARDRAIL_TOPICS_TIER_CONFIG, - GUARDRAIL_TOPIC_CONFIG as _SCHEMA_GUARDRAIL_TOPIC_CONFIG, - GUARDRAIL_TOPIC_POLICY as _SCHEMA_GUARDRAIL_TOPIC_POLICY, - GUARDRAIL_TOPIC_POLICY_CONFIG as _SCHEMA_GUARDRAIL_TOPIC_POLICY_CONFIG, - GUARDRAIL_WORD as _SCHEMA_GUARDRAIL_WORD, - GUARDRAIL_WORD_CONFIG as _SCHEMA_GUARDRAIL_WORD_CONFIG, - GUARDRAIL_WORD_POLICY as _SCHEMA_GUARDRAIL_WORD_POLICY, - GUARDRAIL_WORD_POLICY_CONFIG as _SCHEMA_GUARDRAIL_WORD_POLICY_CONFIG, - HUMAN_EVALUATION_CONFIG as _SCHEMA_HUMAN_EVALUATION_CONFIG, - HUMAN_EVALUATION_CUSTOM_METRIC as _SCHEMA_HUMAN_EVALUATION_CUSTOM_METRIC, - HUMAN_WORKFLOW_CONFIG as _SCHEMA_HUMAN_WORKFLOW_CONFIG, - IMPLICIT_FILTER_CONFIGURATION as _SCHEMA_IMPLICIT_FILTER_CONFIGURATION, - IMPORTED_MODEL_SUMMARY as _SCHEMA_IMPORTED_MODEL_SUMMARY, - INFERENCE_CONFIGURATION as _SCHEMA_INFERENCE_CONFIGURATION, - INFERENCE_PROFILE_MODEL as _SCHEMA_INFERENCE_PROFILE_MODEL, - INFERENCE_PROFILE_MODEL_SOURCE as _SCHEMA_INFERENCE_PROFILE_MODEL_SOURCE, - INFERENCE_PROFILE_SUMMARY as _SCHEMA_INFERENCE_PROFILE_SUMMARY, - INTERNAL_SERVER_EXCEPTION as _SCHEMA_INTERNAL_SERVER_EXCEPTION, - INVOCATION_LOGS_CONFIG as _SCHEMA_INVOCATION_LOGS_CONFIG, - INVOCATION_LOG_SOURCE as _SCHEMA_INVOCATION_LOG_SOURCE, - KB_INFERENCE_CONFIG as _SCHEMA_KB_INFERENCE_CONFIG, - KNOWLEDGE_BASE_CONFIG as _SCHEMA_KNOWLEDGE_BASE_CONFIG, - KNOWLEDGE_BASE_RETRIEVAL_CONFIGURATION as _SCHEMA_KNOWLEDGE_BASE_RETRIEVAL_CONFIGURATION, - KNOWLEDGE_BASE_RETRIEVE_AND_GENERATE_CONFIGURATION as _SCHEMA_KNOWLEDGE_BASE_RETRIEVE_AND_GENERATE_CONFIGURATION, - KNOWLEDGE_BASE_VECTOR_SEARCH_CONFIGURATION as _SCHEMA_KNOWLEDGE_BASE_VECTOR_SEARCH_CONFIGURATION, - LAMBDA_GRADER_CONFIG as _SCHEMA_LAMBDA_GRADER_CONFIG, - LEGAL_TERM as _SCHEMA_LEGAL_TERM, LIST_ADVANCED_PROMPT_OPTIMIZATION_JOBS as _SCHEMA_LIST_ADVANCED_PROMPT_OPTIMIZATION_JOBS, - LIST_ADVANCED_PROMPT_OPTIMIZATION_JOBS_INPUT as _SCHEMA_LIST_ADVANCED_PROMPT_OPTIMIZATION_JOBS_INPUT, - LIST_ADVANCED_PROMPT_OPTIMIZATION_JOBS_OUTPUT as _SCHEMA_LIST_ADVANCED_PROMPT_OPTIMIZATION_JOBS_OUTPUT, LIST_AUTOMATED_REASONING_POLICIES as _SCHEMA_LIST_AUTOMATED_REASONING_POLICIES, - LIST_AUTOMATED_REASONING_POLICIES_INPUT as _SCHEMA_LIST_AUTOMATED_REASONING_POLICIES_INPUT, - LIST_AUTOMATED_REASONING_POLICIES_OUTPUT as _SCHEMA_LIST_AUTOMATED_REASONING_POLICIES_OUTPUT, LIST_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOWS as _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOWS, - LIST_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOWS_INPUT as _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOWS_INPUT, - LIST_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOWS_OUTPUT as _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOWS_OUTPUT, LIST_AUTOMATED_REASONING_POLICY_TEST_CASES as _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_TEST_CASES, - LIST_AUTOMATED_REASONING_POLICY_TEST_CASES_INPUT as _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_TEST_CASES_INPUT, - LIST_AUTOMATED_REASONING_POLICY_TEST_CASES_OUTPUT as _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_TEST_CASES_OUTPUT, LIST_AUTOMATED_REASONING_POLICY_TEST_RESULTS as _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_TEST_RESULTS, - LIST_AUTOMATED_REASONING_POLICY_TEST_RESULTS_INPUT as _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_TEST_RESULTS_INPUT, - LIST_AUTOMATED_REASONING_POLICY_TEST_RESULTS_OUTPUT as _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_TEST_RESULTS_OUTPUT, LIST_CUSTOM_MODELS as _SCHEMA_LIST_CUSTOM_MODELS, - LIST_CUSTOM_MODELS_INPUT as _SCHEMA_LIST_CUSTOM_MODELS_INPUT, - LIST_CUSTOM_MODELS_OUTPUT as _SCHEMA_LIST_CUSTOM_MODELS_OUTPUT, LIST_CUSTOM_MODEL_DEPLOYMENTS as _SCHEMA_LIST_CUSTOM_MODEL_DEPLOYMENTS, - LIST_CUSTOM_MODEL_DEPLOYMENTS_INPUT as _SCHEMA_LIST_CUSTOM_MODEL_DEPLOYMENTS_INPUT, - LIST_CUSTOM_MODEL_DEPLOYMENTS_OUTPUT as _SCHEMA_LIST_CUSTOM_MODEL_DEPLOYMENTS_OUTPUT, LIST_ENFORCED_GUARDRAILS_CONFIGURATION as _SCHEMA_LIST_ENFORCED_GUARDRAILS_CONFIGURATION, - LIST_ENFORCED_GUARDRAILS_CONFIGURATION_INPUT as _SCHEMA_LIST_ENFORCED_GUARDRAILS_CONFIGURATION_INPUT, - LIST_ENFORCED_GUARDRAILS_CONFIGURATION_OUTPUT as _SCHEMA_LIST_ENFORCED_GUARDRAILS_CONFIGURATION_OUTPUT, LIST_EVALUATION_JOBS as _SCHEMA_LIST_EVALUATION_JOBS, - LIST_EVALUATION_JOBS_INPUT as _SCHEMA_LIST_EVALUATION_JOBS_INPUT, - LIST_EVALUATION_JOBS_OUTPUT as _SCHEMA_LIST_EVALUATION_JOBS_OUTPUT, LIST_FOUNDATION_MODELS as _SCHEMA_LIST_FOUNDATION_MODELS, - LIST_FOUNDATION_MODELS_INPUT as _SCHEMA_LIST_FOUNDATION_MODELS_INPUT, - LIST_FOUNDATION_MODELS_OUTPUT as _SCHEMA_LIST_FOUNDATION_MODELS_OUTPUT, LIST_FOUNDATION_MODEL_AGREEMENT_OFFERS as _SCHEMA_LIST_FOUNDATION_MODEL_AGREEMENT_OFFERS, - LIST_FOUNDATION_MODEL_AGREEMENT_OFFERS_INPUT as _SCHEMA_LIST_FOUNDATION_MODEL_AGREEMENT_OFFERS_INPUT, - LIST_FOUNDATION_MODEL_AGREEMENT_OFFERS_OUTPUT as _SCHEMA_LIST_FOUNDATION_MODEL_AGREEMENT_OFFERS_OUTPUT, LIST_GUARDRAILS as _SCHEMA_LIST_GUARDRAILS, - LIST_GUARDRAILS_INPUT as _SCHEMA_LIST_GUARDRAILS_INPUT, - LIST_GUARDRAILS_OUTPUT as _SCHEMA_LIST_GUARDRAILS_OUTPUT, LIST_IMPORTED_MODELS as _SCHEMA_LIST_IMPORTED_MODELS, - LIST_IMPORTED_MODELS_INPUT as _SCHEMA_LIST_IMPORTED_MODELS_INPUT, - LIST_IMPORTED_MODELS_OUTPUT as _SCHEMA_LIST_IMPORTED_MODELS_OUTPUT, LIST_INFERENCE_PROFILES as _SCHEMA_LIST_INFERENCE_PROFILES, - LIST_INFERENCE_PROFILES_INPUT as _SCHEMA_LIST_INFERENCE_PROFILES_INPUT, - LIST_INFERENCE_PROFILES_OUTPUT as _SCHEMA_LIST_INFERENCE_PROFILES_OUTPUT, LIST_MARKETPLACE_MODEL_ENDPOINTS as _SCHEMA_LIST_MARKETPLACE_MODEL_ENDPOINTS, - LIST_MARKETPLACE_MODEL_ENDPOINTS_INPUT as _SCHEMA_LIST_MARKETPLACE_MODEL_ENDPOINTS_INPUT, - LIST_MARKETPLACE_MODEL_ENDPOINTS_OUTPUT as _SCHEMA_LIST_MARKETPLACE_MODEL_ENDPOINTS_OUTPUT, LIST_MODEL_COPY_JOBS as _SCHEMA_LIST_MODEL_COPY_JOBS, - LIST_MODEL_COPY_JOBS_INPUT as _SCHEMA_LIST_MODEL_COPY_JOBS_INPUT, - LIST_MODEL_COPY_JOBS_OUTPUT as _SCHEMA_LIST_MODEL_COPY_JOBS_OUTPUT, LIST_MODEL_CUSTOMIZATION_JOBS as _SCHEMA_LIST_MODEL_CUSTOMIZATION_JOBS, - LIST_MODEL_CUSTOMIZATION_JOBS_INPUT as _SCHEMA_LIST_MODEL_CUSTOMIZATION_JOBS_INPUT, - LIST_MODEL_CUSTOMIZATION_JOBS_OUTPUT as _SCHEMA_LIST_MODEL_CUSTOMIZATION_JOBS_OUTPUT, LIST_MODEL_IMPORT_JOBS as _SCHEMA_LIST_MODEL_IMPORT_JOBS, - LIST_MODEL_IMPORT_JOBS_INPUT as _SCHEMA_LIST_MODEL_IMPORT_JOBS_INPUT, - LIST_MODEL_IMPORT_JOBS_OUTPUT as _SCHEMA_LIST_MODEL_IMPORT_JOBS_OUTPUT, LIST_MODEL_INVOCATION_JOBS as _SCHEMA_LIST_MODEL_INVOCATION_JOBS, - LIST_MODEL_INVOCATION_JOBS_INPUT as _SCHEMA_LIST_MODEL_INVOCATION_JOBS_INPUT, - LIST_MODEL_INVOCATION_JOBS_OUTPUT as _SCHEMA_LIST_MODEL_INVOCATION_JOBS_OUTPUT, LIST_PROMPT_ROUTERS as _SCHEMA_LIST_PROMPT_ROUTERS, - LIST_PROMPT_ROUTERS_INPUT as _SCHEMA_LIST_PROMPT_ROUTERS_INPUT, - LIST_PROMPT_ROUTERS_OUTPUT as _SCHEMA_LIST_PROMPT_ROUTERS_OUTPUT, LIST_PROVISIONED_MODEL_THROUGHPUTS as _SCHEMA_LIST_PROVISIONED_MODEL_THROUGHPUTS, - LIST_PROVISIONED_MODEL_THROUGHPUTS_INPUT as _SCHEMA_LIST_PROVISIONED_MODEL_THROUGHPUTS_INPUT, - LIST_PROVISIONED_MODEL_THROUGHPUTS_OUTPUT as _SCHEMA_LIST_PROVISIONED_MODEL_THROUGHPUTS_OUTPUT, LIST_TAGS_FOR_RESOURCE as _SCHEMA_LIST_TAGS_FOR_RESOURCE, - LIST_TAGS_FOR_RESOURCE_INPUT as _SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT, - LIST_TAGS_FOR_RESOURCE_OUTPUT as _SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT, - LOGGING_CONFIG as _SCHEMA_LOGGING_CONFIG, - MARKETPLACE_MODEL_ENDPOINT as _SCHEMA_MARKETPLACE_MODEL_ENDPOINT, - MARKETPLACE_MODEL_ENDPOINT_SUMMARY as _SCHEMA_MARKETPLACE_MODEL_ENDPOINT_SUMMARY, - METADATA_ATTRIBUTE_SCHEMA as _SCHEMA_METADATA_ATTRIBUTE_SCHEMA, - METADATA_CONFIGURATION_FOR_RERANKING as _SCHEMA_METADATA_CONFIGURATION_FOR_RERANKING, - MODEL_CONFIGURATION as _SCHEMA_MODEL_CONFIGURATION, - MODEL_COPY_JOB_SUMMARY as _SCHEMA_MODEL_COPY_JOB_SUMMARY, - MODEL_CUSTOMIZATION_JOB_SUMMARY as _SCHEMA_MODEL_CUSTOMIZATION_JOB_SUMMARY, - MODEL_DATA_SOURCE as _SCHEMA_MODEL_DATA_SOURCE, - MODEL_ENFORCEMENT as _SCHEMA_MODEL_ENFORCEMENT, - MODEL_IMPORT_JOB_SUMMARY as _SCHEMA_MODEL_IMPORT_JOB_SUMMARY, - MODEL_INVOCATION_JOB_INPUT_DATA_CONFIG as _SCHEMA_MODEL_INVOCATION_JOB_INPUT_DATA_CONFIG, - MODEL_INVOCATION_JOB_OUTPUT_DATA_CONFIG as _SCHEMA_MODEL_INVOCATION_JOB_OUTPUT_DATA_CONFIG, - MODEL_INVOCATION_JOB_S3_INPUT_DATA_CONFIG as _SCHEMA_MODEL_INVOCATION_JOB_S3_INPUT_DATA_CONFIG, - MODEL_INVOCATION_JOB_S3_OUTPUT_DATA_CONFIG as _SCHEMA_MODEL_INVOCATION_JOB_S3_OUTPUT_DATA_CONFIG, - MODEL_INVOCATION_JOB_SUMMARY as _SCHEMA_MODEL_INVOCATION_JOB_SUMMARY, - MODEL_PACKAGE_ARN_DATA_SOURCE as _SCHEMA_MODEL_PACKAGE_ARN_DATA_SOURCE, - OFFER as _SCHEMA_OFFER, - ORCHESTRATION_CONFIGURATION as _SCHEMA_ORCHESTRATION_CONFIGURATION, - OUTPUT_DATA_CONFIG as _SCHEMA_OUTPUT_DATA_CONFIG, - PERFORMANCE_CONFIGURATION as _SCHEMA_PERFORMANCE_CONFIGURATION, - PRICING_TERM as _SCHEMA_PRICING_TERM, - PROMPT_ROUTER_SUMMARY as _SCHEMA_PROMPT_ROUTER_SUMMARY, - PROMPT_ROUTER_TARGET_MODEL as _SCHEMA_PROMPT_ROUTER_TARGET_MODEL, - PROMPT_TEMPLATE as _SCHEMA_PROMPT_TEMPLATE, - PROVISIONED_MODEL_SUMMARY as _SCHEMA_PROVISIONED_MODEL_SUMMARY, PUT_ACCOUNT_DATA_RETENTION as _SCHEMA_PUT_ACCOUNT_DATA_RETENTION, - PUT_ACCOUNT_DATA_RETENTION_INPUT as _SCHEMA_PUT_ACCOUNT_DATA_RETENTION_INPUT, - PUT_ACCOUNT_DATA_RETENTION_OUTPUT as _SCHEMA_PUT_ACCOUNT_DATA_RETENTION_OUTPUT, PUT_ENFORCED_GUARDRAIL_CONFIGURATION as _SCHEMA_PUT_ENFORCED_GUARDRAIL_CONFIGURATION, - PUT_ENFORCED_GUARDRAIL_CONFIGURATION_INPUT as _SCHEMA_PUT_ENFORCED_GUARDRAIL_CONFIGURATION_INPUT, - PUT_ENFORCED_GUARDRAIL_CONFIGURATION_OUTPUT as _SCHEMA_PUT_ENFORCED_GUARDRAIL_CONFIGURATION_OUTPUT, PUT_MODEL_INVOCATION_LOGGING_CONFIGURATION as _SCHEMA_PUT_MODEL_INVOCATION_LOGGING_CONFIGURATION, - PUT_MODEL_INVOCATION_LOGGING_CONFIGURATION_INPUT as _SCHEMA_PUT_MODEL_INVOCATION_LOGGING_CONFIGURATION_INPUT, - PUT_MODEL_INVOCATION_LOGGING_CONFIGURATION_OUTPUT as _SCHEMA_PUT_MODEL_INVOCATION_LOGGING_CONFIGURATION_OUTPUT, PUT_RESOURCE_POLICY as _SCHEMA_PUT_RESOURCE_POLICY, - PUT_RESOURCE_POLICY_INPUT as _SCHEMA_PUT_RESOURCE_POLICY_INPUT, - PUT_RESOURCE_POLICY_OUTPUT as _SCHEMA_PUT_RESOURCE_POLICY_OUTPUT, PUT_USE_CASE_FOR_MODEL_ACCESS as _SCHEMA_PUT_USE_CASE_FOR_MODEL_ACCESS, - PUT_USE_CASE_FOR_MODEL_ACCESS_INPUT as _SCHEMA_PUT_USE_CASE_FOR_MODEL_ACCESS_INPUT, - PUT_USE_CASE_FOR_MODEL_ACCESS_OUTPUT as _SCHEMA_PUT_USE_CASE_FOR_MODEL_ACCESS_OUTPUT, - QUERY_TRANSFORMATION_CONFIGURATION as _SCHEMA_QUERY_TRANSFORMATION_CONFIGURATION, - RAG_CONFIG as _SCHEMA_RAG_CONFIG, - RATING_SCALE_ITEM as _SCHEMA_RATING_SCALE_ITEM, - RATING_SCALE_ITEM_VALUE as _SCHEMA_RATING_SCALE_ITEM_VALUE, REGISTER_MARKETPLACE_MODEL_ENDPOINT as _SCHEMA_REGISTER_MARKETPLACE_MODEL_ENDPOINT, - REGISTER_MARKETPLACE_MODEL_ENDPOINT_INPUT as _SCHEMA_REGISTER_MARKETPLACE_MODEL_ENDPOINT_INPUT, - REGISTER_MARKETPLACE_MODEL_ENDPOINT_OUTPUT as _SCHEMA_REGISTER_MARKETPLACE_MODEL_ENDPOINT_OUTPUT, - REQUEST_METADATA_BASE_FILTERS as _SCHEMA_REQUEST_METADATA_BASE_FILTERS, - REQUEST_METADATA_FILTERS as _SCHEMA_REQUEST_METADATA_FILTERS, - RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION as _SCHEMA_RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION, - RESOURCE_IN_USE_EXCEPTION as _SCHEMA_RESOURCE_IN_USE_EXCEPTION, - RESOURCE_NOT_FOUND_EXCEPTION as _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - RETRIEVAL_FILTER as _SCHEMA_RETRIEVAL_FILTER, - RETRIEVE_AND_GENERATE_CONFIGURATION as _SCHEMA_RETRIEVE_AND_GENERATE_CONFIGURATION, - RETRIEVE_CONFIG as _SCHEMA_RETRIEVE_CONFIG, - RFT_CONFIG as _SCHEMA_RFT_CONFIG, - RFT_HYPER_PARAMETERS as _SCHEMA_RFT_HYPER_PARAMETERS, - ROUTING_CRITERIA as _SCHEMA_ROUTING_CRITERIA, - S3_CONFIG as _SCHEMA_S3_CONFIG, - S3_DATA_SOURCE as _SCHEMA_S3_DATA_SOURCE, - S3_OBJECT_DOC as _SCHEMA_S3_OBJECT_DOC, - SAGE_MAKER_ENDPOINT as _SCHEMA_SAGE_MAKER_ENDPOINT, - SELECTIVE_CONTENT_GUARDING as _SCHEMA_SELECTIVE_CONTENT_GUARDING, - SERVICE_QUOTA_EXCEEDED_EXCEPTION as _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - SERVICE_UNAVAILABLE_EXCEPTION as _SCHEMA_SERVICE_UNAVAILABLE_EXCEPTION, START_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW as _SCHEMA_START_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW, - START_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT as _SCHEMA_START_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT, - START_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT as _SCHEMA_START_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT, START_AUTOMATED_REASONING_POLICY_TEST_WORKFLOW as _SCHEMA_START_AUTOMATED_REASONING_POLICY_TEST_WORKFLOW, - START_AUTOMATED_REASONING_POLICY_TEST_WORKFLOW_INPUT as _SCHEMA_START_AUTOMATED_REASONING_POLICY_TEST_WORKFLOW_INPUT, - START_AUTOMATED_REASONING_POLICY_TEST_WORKFLOW_OUTPUT as _SCHEMA_START_AUTOMATED_REASONING_POLICY_TEST_WORKFLOW_OUTPUT, - STATUS_DETAILS as _SCHEMA_STATUS_DETAILS, STOP_ADVANCED_PROMPT_OPTIMIZATION_JOB as _SCHEMA_STOP_ADVANCED_PROMPT_OPTIMIZATION_JOB, - STOP_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT as _SCHEMA_STOP_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT, - STOP_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT as _SCHEMA_STOP_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT, STOP_EVALUATION_JOB as _SCHEMA_STOP_EVALUATION_JOB, - STOP_EVALUATION_JOB_INPUT as _SCHEMA_STOP_EVALUATION_JOB_INPUT, - STOP_EVALUATION_JOB_OUTPUT as _SCHEMA_STOP_EVALUATION_JOB_OUTPUT, STOP_MODEL_CUSTOMIZATION_JOB as _SCHEMA_STOP_MODEL_CUSTOMIZATION_JOB, - STOP_MODEL_CUSTOMIZATION_JOB_INPUT as _SCHEMA_STOP_MODEL_CUSTOMIZATION_JOB_INPUT, - STOP_MODEL_CUSTOMIZATION_JOB_OUTPUT as _SCHEMA_STOP_MODEL_CUSTOMIZATION_JOB_OUTPUT, STOP_MODEL_INVOCATION_JOB as _SCHEMA_STOP_MODEL_INVOCATION_JOB, - STOP_MODEL_INVOCATION_JOB_INPUT as _SCHEMA_STOP_MODEL_INVOCATION_JOB_INPUT, - STOP_MODEL_INVOCATION_JOB_OUTPUT as _SCHEMA_STOP_MODEL_INVOCATION_JOB_OUTPUT, - SUPPORT_TERM as _SCHEMA_SUPPORT_TERM, - TAG as _SCHEMA_TAG, TAG_RESOURCE as _SCHEMA_TAG_RESOURCE, - TAG_RESOURCE_INPUT as _SCHEMA_TAG_RESOURCE_INPUT, - TAG_RESOURCE_OUTPUT as _SCHEMA_TAG_RESOURCE_OUTPUT, - TEACHER_MODEL_CONFIG as _SCHEMA_TEACHER_MODEL_CONFIG, - TERM_DETAILS as _SCHEMA_TERM_DETAILS, - TEXT_INFERENCE_CONFIG as _SCHEMA_TEXT_INFERENCE_CONFIG, - THROTTLING_EXCEPTION as _SCHEMA_THROTTLING_EXCEPTION, - TOO_MANY_TAGS_EXCEPTION as _SCHEMA_TOO_MANY_TAGS_EXCEPTION, - TRAINING_DATA_CONFIG as _SCHEMA_TRAINING_DATA_CONFIG, - TRAINING_DETAILS as _SCHEMA_TRAINING_DETAILS, - TRAINING_METRICS as _SCHEMA_TRAINING_METRICS, UNTAG_RESOURCE as _SCHEMA_UNTAG_RESOURCE, - UNTAG_RESOURCE_INPUT as _SCHEMA_UNTAG_RESOURCE_INPUT, - UNTAG_RESOURCE_OUTPUT as _SCHEMA_UNTAG_RESOURCE_OUTPUT, UPDATE_AUTOMATED_REASONING_POLICY as _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY, UPDATE_AUTOMATED_REASONING_POLICY_ANNOTATIONS as _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_ANNOTATIONS, - UPDATE_AUTOMATED_REASONING_POLICY_ANNOTATIONS_INPUT as _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_ANNOTATIONS_INPUT, - UPDATE_AUTOMATED_REASONING_POLICY_ANNOTATIONS_OUTPUT as _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_ANNOTATIONS_OUTPUT, - UPDATE_AUTOMATED_REASONING_POLICY_INPUT as _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_INPUT, - UPDATE_AUTOMATED_REASONING_POLICY_OUTPUT as _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_OUTPUT, UPDATE_AUTOMATED_REASONING_POLICY_TEST_CASE as _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_TEST_CASE, - UPDATE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT as _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT, - UPDATE_AUTOMATED_REASONING_POLICY_TEST_CASE_OUTPUT as _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_TEST_CASE_OUTPUT, UPDATE_CUSTOM_MODEL_DEPLOYMENT as _SCHEMA_UPDATE_CUSTOM_MODEL_DEPLOYMENT, - UPDATE_CUSTOM_MODEL_DEPLOYMENT_INPUT as _SCHEMA_UPDATE_CUSTOM_MODEL_DEPLOYMENT_INPUT, - UPDATE_CUSTOM_MODEL_DEPLOYMENT_OUTPUT as _SCHEMA_UPDATE_CUSTOM_MODEL_DEPLOYMENT_OUTPUT, UPDATE_GUARDRAIL as _SCHEMA_UPDATE_GUARDRAIL, - UPDATE_GUARDRAIL_INPUT as _SCHEMA_UPDATE_GUARDRAIL_INPUT, - UPDATE_GUARDRAIL_OUTPUT as _SCHEMA_UPDATE_GUARDRAIL_OUTPUT, UPDATE_MARKETPLACE_MODEL_ENDPOINT as _SCHEMA_UPDATE_MARKETPLACE_MODEL_ENDPOINT, - UPDATE_MARKETPLACE_MODEL_ENDPOINT_INPUT as _SCHEMA_UPDATE_MARKETPLACE_MODEL_ENDPOINT_INPUT, - UPDATE_MARKETPLACE_MODEL_ENDPOINT_OUTPUT as _SCHEMA_UPDATE_MARKETPLACE_MODEL_ENDPOINT_OUTPUT, UPDATE_PROVISIONED_MODEL_THROUGHPUT as _SCHEMA_UPDATE_PROVISIONED_MODEL_THROUGHPUT, - UPDATE_PROVISIONED_MODEL_THROUGHPUT_INPUT as _SCHEMA_UPDATE_PROVISIONED_MODEL_THROUGHPUT_INPUT, - UPDATE_PROVISIONED_MODEL_THROUGHPUT_OUTPUT as _SCHEMA_UPDATE_PROVISIONED_MODEL_THROUGHPUT_OUTPUT, - VALIDATION_DATA_CONFIG as _SCHEMA_VALIDATION_DATA_CONFIG, - VALIDATION_DETAILS as _SCHEMA_VALIDATION_DETAILS, - VALIDATION_EXCEPTION as _SCHEMA_VALIDATION_EXCEPTION, - VALIDATOR as _SCHEMA_VALIDATOR, - VALIDATOR_METRIC as _SCHEMA_VALIDATOR_METRIC, - VALIDITY_TERM as _SCHEMA_VALIDITY_TERM, - VECTOR_SEARCH_BEDROCK_RERANKING_CONFIGURATION as _SCHEMA_VECTOR_SEARCH_BEDROCK_RERANKING_CONFIGURATION, - VECTOR_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION as _SCHEMA_VECTOR_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION, - VECTOR_SEARCH_RERANKING_CONFIGURATION as _SCHEMA_VECTOR_SEARCH_RERANKING_CONFIGURATION, - VPC_CONFIG as _SCHEMA_VPC_CONFIG, ) - -logger = logging.getLogger(__name__) +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .models import ( + BatchDeleteAdvancedPromptOptimizationJobInput, + BatchDeleteAdvancedPromptOptimizationJobOutput, + BatchDeleteEvaluationJobInput, + BatchDeleteEvaluationJobOutput, + CancelAutomatedReasoningPolicyBuildWorkflowInput, + CancelAutomatedReasoningPolicyBuildWorkflowOutput, + CreateAdvancedPromptOptimizationJobInput, + CreateAdvancedPromptOptimizationJobOutput, + CreateAutomatedReasoningPolicyInput, + CreateAutomatedReasoningPolicyOutput, + CreateAutomatedReasoningPolicyTestCaseInput, + CreateAutomatedReasoningPolicyTestCaseOutput, + CreateAutomatedReasoningPolicyVersionInput, + CreateAutomatedReasoningPolicyVersionOutput, + CreateCustomModelDeploymentInput, + CreateCustomModelDeploymentOutput, + CreateCustomModelInput, + CreateCustomModelOutput, + CreateEvaluationJobInput, + CreateEvaluationJobOutput, + CreateFoundationModelAgreementInput, + CreateFoundationModelAgreementOutput, + CreateGuardrailInput, + CreateGuardrailOutput, + CreateGuardrailVersionInput, + CreateGuardrailVersionOutput, + CreateInferenceProfileInput, + CreateInferenceProfileOutput, + CreateMarketplaceModelEndpointInput, + CreateMarketplaceModelEndpointOutput, + CreateModelCopyJobInput, + CreateModelCopyJobOutput, + CreateModelCustomizationJobInput, + CreateModelCustomizationJobOutput, + CreateModelImportJobInput, + CreateModelImportJobOutput, + CreateModelInvocationJobInput, + CreateModelInvocationJobOutput, + CreatePromptRouterInput, + CreatePromptRouterOutput, + CreateProvisionedModelThroughputInput, + CreateProvisionedModelThroughputOutput, + DeleteAutomatedReasoningPolicyBuildWorkflowInput, + DeleteAutomatedReasoningPolicyBuildWorkflowOutput, + DeleteAutomatedReasoningPolicyInput, + DeleteAutomatedReasoningPolicyOutput, + DeleteAutomatedReasoningPolicyTestCaseInput, + DeleteAutomatedReasoningPolicyTestCaseOutput, + DeleteCustomModelDeploymentInput, + DeleteCustomModelDeploymentOutput, + DeleteCustomModelInput, + DeleteCustomModelOutput, + DeleteEnforcedGuardrailConfigurationInput, + DeleteEnforcedGuardrailConfigurationOutput, + DeleteFoundationModelAgreementInput, + DeleteFoundationModelAgreementOutput, + DeleteGuardrailInput, + DeleteGuardrailOutput, + DeleteImportedModelInput, + DeleteImportedModelOutput, + DeleteInferenceProfileInput, + DeleteInferenceProfileOutput, + DeleteMarketplaceModelEndpointInput, + DeleteMarketplaceModelEndpointOutput, + DeleteModelInvocationLoggingConfigurationInput, + DeleteModelInvocationLoggingConfigurationOutput, + DeletePromptRouterInput, + DeletePromptRouterOutput, + DeleteProvisionedModelThroughputInput, + DeleteProvisionedModelThroughputOutput, + DeleteResourcePolicyInput, + DeleteResourcePolicyOutput, + DeregisterMarketplaceModelEndpointInput, + DeregisterMarketplaceModelEndpointOutput, + ExportAutomatedReasoningPolicyVersionInput, + ExportAutomatedReasoningPolicyVersionOutput, + GetAccountDataRetentionInput, + GetAccountDataRetentionOutput, + GetAdvancedPromptOptimizationJobInput, + GetAdvancedPromptOptimizationJobOutput, + GetAutomatedReasoningPolicyAnnotationsInput, + GetAutomatedReasoningPolicyAnnotationsOutput, + GetAutomatedReasoningPolicyBuildWorkflowInput, + GetAutomatedReasoningPolicyBuildWorkflowOutput, + GetAutomatedReasoningPolicyBuildWorkflowResultAssetsInput, + GetAutomatedReasoningPolicyBuildWorkflowResultAssetsOutput, + GetAutomatedReasoningPolicyInput, + GetAutomatedReasoningPolicyNextScenarioInput, + GetAutomatedReasoningPolicyNextScenarioOutput, + GetAutomatedReasoningPolicyOutput, + GetAutomatedReasoningPolicyTestCaseInput, + GetAutomatedReasoningPolicyTestCaseOutput, + GetAutomatedReasoningPolicyTestResultInput, + GetAutomatedReasoningPolicyTestResultOutput, + GetCustomModelDeploymentInput, + GetCustomModelDeploymentOutput, + GetCustomModelInput, + GetCustomModelOutput, + GetEvaluationJobInput, + GetEvaluationJobOutput, + GetFoundationModelAvailabilityInput, + GetFoundationModelAvailabilityOutput, + GetFoundationModelInput, + GetFoundationModelOutput, + GetGuardrailInput, + GetGuardrailOutput, + GetImportedModelInput, + GetImportedModelOutput, + GetInferenceProfileInput, + GetInferenceProfileOutput, + GetMarketplaceModelEndpointInput, + GetMarketplaceModelEndpointOutput, + GetModelCopyJobInput, + GetModelCopyJobOutput, + GetModelCustomizationJobInput, + GetModelCustomizationJobOutput, + GetModelImportJobInput, + GetModelImportJobOutput, + GetModelInvocationJobInput, + GetModelInvocationJobOutput, + GetModelInvocationLoggingConfigurationInput, + GetModelInvocationLoggingConfigurationOutput, + GetPromptRouterInput, + GetPromptRouterOutput, + GetProvisionedModelThroughputInput, + GetProvisionedModelThroughputOutput, + GetResourcePolicyInput, + GetResourcePolicyOutput, + GetUseCaseForModelAccessInput, + GetUseCaseForModelAccessOutput, + ListAdvancedPromptOptimizationJobsInput, + ListAdvancedPromptOptimizationJobsOutput, + ListAutomatedReasoningPoliciesInput, + ListAutomatedReasoningPoliciesOutput, + ListAutomatedReasoningPolicyBuildWorkflowsInput, + ListAutomatedReasoningPolicyBuildWorkflowsOutput, + ListAutomatedReasoningPolicyTestCasesInput, + ListAutomatedReasoningPolicyTestCasesOutput, + ListAutomatedReasoningPolicyTestResultsInput, + ListAutomatedReasoningPolicyTestResultsOutput, + ListCustomModelDeploymentsInput, + ListCustomModelDeploymentsOutput, + ListCustomModelsInput, + ListCustomModelsOutput, + ListEnforcedGuardrailsConfigurationInput, + ListEnforcedGuardrailsConfigurationOutput, + ListEvaluationJobsInput, + ListEvaluationJobsOutput, + ListFoundationModelAgreementOffersInput, + ListFoundationModelAgreementOffersOutput, + ListFoundationModelsInput, + ListFoundationModelsOutput, + ListGuardrailsInput, + ListGuardrailsOutput, + ListImportedModelsInput, + ListImportedModelsOutput, + ListInferenceProfilesInput, + ListInferenceProfilesOutput, + ListMarketplaceModelEndpointsInput, + ListMarketplaceModelEndpointsOutput, + ListModelCopyJobsInput, + ListModelCopyJobsOutput, + ListModelCustomizationJobsInput, + ListModelCustomizationJobsOutput, + ListModelImportJobsInput, + ListModelImportJobsOutput, + ListModelInvocationJobsInput, + ListModelInvocationJobsOutput, + ListPromptRoutersInput, + ListPromptRoutersOutput, + ListProvisionedModelThroughputsInput, + ListProvisionedModelThroughputsOutput, + ListTagsForResourceInput, + ListTagsForResourceOutput, + PutAccountDataRetentionInput, + PutAccountDataRetentionOutput, + PutEnforcedGuardrailConfigurationInput, + PutEnforcedGuardrailConfigurationOutput, + PutModelInvocationLoggingConfigurationInput, + PutModelInvocationLoggingConfigurationOutput, + PutResourcePolicyInput, + PutResourcePolicyOutput, + PutUseCaseForModelAccessInput, + PutUseCaseForModelAccessOutput, + RegisterMarketplaceModelEndpointInput, + RegisterMarketplaceModelEndpointOutput, + StartAutomatedReasoningPolicyBuildWorkflowInput, + StartAutomatedReasoningPolicyBuildWorkflowOutput, + StartAutomatedReasoningPolicyTestWorkflowInput, + StartAutomatedReasoningPolicyTestWorkflowOutput, + StopAdvancedPromptOptimizationJobInput, + StopAdvancedPromptOptimizationJobOutput, + StopEvaluationJobInput, + StopEvaluationJobOutput, + StopModelCustomizationJobInput, + StopModelCustomizationJobOutput, + StopModelInvocationJobInput, + StopModelInvocationJobOutput, + TagResourceInput, + TagResourceOutput, + UntagResourceInput, + UntagResourceOutput, + UpdateAutomatedReasoningPolicyAnnotationsInput, + UpdateAutomatedReasoningPolicyAnnotationsOutput, + UpdateAutomatedReasoningPolicyInput, + UpdateAutomatedReasoningPolicyOutput, + UpdateAutomatedReasoningPolicyTestCaseInput, + UpdateAutomatedReasoningPolicyTestCaseOutput, + UpdateCustomModelDeploymentInput, + UpdateCustomModelDeploymentOutput, + UpdateGuardrailInput, + UpdateGuardrailOutput, + UpdateMarketplaceModelEndpointInput, + UpdateMarketplaceModelEndpointOutput, + UpdateProvisionedModelThroughputInput, + UpdateProvisionedModelThroughputOutput, + ) class ServiceError(ModeledError): @@ -621,52473 +351,3275 @@ class ServiceError(ModeledError): """ -@dataclass(kw_only=True) -class AccessDeniedException(ServiceError): - """The request is denied because of missing access permissions.""" +_registry = ModelRegistry( + _schemas, + renames={}, + index={ + "AccessDeniedException": "ACCESS_DENIED_EXCEPTION", + "AccountEnforcedGuardrailInferenceInputConfiguration": "ACCOUNT_ENFORCED_GUARDRAIL_INFERENCE_INPUT_CONFIGURATION", + "AccountEnforcedGuardrailOutputConfiguration": "ACCOUNT_ENFORCED_GUARDRAIL_OUTPUT_CONFIGURATION", + "AdvancedPromptOptimizationInputConfig": "ADVANCED_PROMPT_OPTIMIZATION_INPUT_CONFIG", + "AdvancedPromptOptimizationJobStatus": "ADVANCED_PROMPT_OPTIMIZATION_JOB_STATUS", + "AdvancedPromptOptimizationJobSummary": "ADVANCED_PROMPT_OPTIMIZATION_JOB_SUMMARY", + "AdvancedPromptOptimizationOutputConfig": "ADVANCED_PROMPT_OPTIMIZATION_OUTPUT_CONFIG", + "AgreementAvailability": "AGREEMENT_AVAILABILITY", + "AgreementStatus": "AGREEMENT_STATUS", + "ApplicationType": "APPLICATION_TYPE", + "AttributeType": "ATTRIBUTE_TYPE", + "AuthorizationStatus": "AUTHORIZATION_STATUS", + "AutomatedEvaluationConfig": "AUTOMATED_EVALUATION_CONFIG", + "AutomatedEvaluationCustomMetricConfig": "AUTOMATED_EVALUATION_CUSTOM_METRIC_CONFIG", + "AutomatedEvaluationCustomMetricSource": "AUTOMATED_EVALUATION_CUSTOM_METRIC_SOURCE", + "AutomatedEvaluationCustomMetricSourceCustomMetricDefinition": "AUTOMATED_EVALUATION_CUSTOM_METRIC_SOURCE", + "AutomatedEvaluationCustomMetricSourceUnknown": "AUTOMATED_EVALUATION_CUSTOM_METRIC_SOURCE", + "AutomatedReasoningCheckFinding": "AUTOMATED_REASONING_CHECK_FINDING", + "AutomatedReasoningCheckFindingValid": "AUTOMATED_REASONING_CHECK_FINDING", + "AutomatedReasoningCheckFindingInvalid": "AUTOMATED_REASONING_CHECK_FINDING", + "AutomatedReasoningCheckFindingSatisfiable": "AUTOMATED_REASONING_CHECK_FINDING", + "AutomatedReasoningCheckFindingImpossible": "AUTOMATED_REASONING_CHECK_FINDING", + "AutomatedReasoningCheckFindingTranslationAmbiguous": "AUTOMATED_REASONING_CHECK_FINDING", + "AutomatedReasoningCheckFindingTooComplex": "AUTOMATED_REASONING_CHECK_FINDING", + "AutomatedReasoningCheckFindingNoTranslations": "AUTOMATED_REASONING_CHECK_FINDING", + "AutomatedReasoningCheckFindingUnknown": "AUTOMATED_REASONING_CHECK_FINDING", + "AutomatedReasoningCheckImpossibleFinding": "AUTOMATED_REASONING_CHECK_IMPOSSIBLE_FINDING", + "AutomatedReasoningCheckInputTextReference": "AUTOMATED_REASONING_CHECK_INPUT_TEXT_REFERENCE", + "AutomatedReasoningCheckInvalidFinding": "AUTOMATED_REASONING_CHECK_INVALID_FINDING", + "AutomatedReasoningCheckLogicWarning": "AUTOMATED_REASONING_CHECK_LOGIC_WARNING", + "AutomatedReasoningCheckLogicWarningType": "AUTOMATED_REASONING_CHECK_LOGIC_WARNING_TYPE", + "AutomatedReasoningCheckNoTranslationsFinding": "AUTOMATED_REASONING_CHECK_NO_TRANSLATIONS_FINDING", + "AutomatedReasoningCheckResult": "AUTOMATED_REASONING_CHECK_RESULT", + "AutomatedReasoningCheckRule": "AUTOMATED_REASONING_CHECK_RULE", + "AutomatedReasoningCheckSatisfiableFinding": "AUTOMATED_REASONING_CHECK_SATISFIABLE_FINDING", + "AutomatedReasoningCheckScenario": "AUTOMATED_REASONING_CHECK_SCENARIO", + "AutomatedReasoningCheckTooComplexFinding": "AUTOMATED_REASONING_CHECK_TOO_COMPLEX_FINDING", + "AutomatedReasoningCheckTranslation": "AUTOMATED_REASONING_CHECK_TRANSLATION", + "AutomatedReasoningCheckTranslationAmbiguousFinding": "AUTOMATED_REASONING_CHECK_TRANSLATION_AMBIGUOUS_FINDING", + "AutomatedReasoningCheckTranslationOption": "AUTOMATED_REASONING_CHECK_TRANSLATION_OPTION", + "AutomatedReasoningCheckValidFinding": "AUTOMATED_REASONING_CHECK_VALID_FINDING", + "AutomatedReasoningLogicStatement": "AUTOMATED_REASONING_LOGIC_STATEMENT", + "AutomatedReasoningPolicyAddRuleAnnotation": "AUTOMATED_REASONING_POLICY_ADD_RULE_ANNOTATION", + "AutomatedReasoningPolicyAddRuleFromNaturalLanguageAnnotation": "AUTOMATED_REASONING_POLICY_ADD_RULE_FROM_NATURAL_LANGUAGE_ANNOTATION", + "AutomatedReasoningPolicyAddRuleMutation": "AUTOMATED_REASONING_POLICY_ADD_RULE_MUTATION", + "AutomatedReasoningPolicyAddTypeAnnotation": "AUTOMATED_REASONING_POLICY_ADD_TYPE_ANNOTATION", + "AutomatedReasoningPolicyAddTypeMutation": "AUTOMATED_REASONING_POLICY_ADD_TYPE_MUTATION", + "AutomatedReasoningPolicyAddTypeValue": "AUTOMATED_REASONING_POLICY_ADD_TYPE_VALUE", + "AutomatedReasoningPolicyAddVariableAnnotation": "AUTOMATED_REASONING_POLICY_ADD_VARIABLE_ANNOTATION", + "AutomatedReasoningPolicyAddVariableMutation": "AUTOMATED_REASONING_POLICY_ADD_VARIABLE_MUTATION", + "AutomatedReasoningPolicyAnnotatedChunk": "AUTOMATED_REASONING_POLICY_ANNOTATED_CHUNK", + "AutomatedReasoningPolicyAnnotatedContent": "AUTOMATED_REASONING_POLICY_ANNOTATED_CONTENT", + "AutomatedReasoningPolicyAnnotatedContentLine": "AUTOMATED_REASONING_POLICY_ANNOTATED_CONTENT", + "AutomatedReasoningPolicyAnnotatedContentUnknown": "AUTOMATED_REASONING_POLICY_ANNOTATED_CONTENT", + "AutomatedReasoningPolicyAnnotatedLine": "AUTOMATED_REASONING_POLICY_ANNOTATED_LINE", + "AutomatedReasoningPolicyAnnotation": "AUTOMATED_REASONING_POLICY_ANNOTATION", + "AutomatedReasoningPolicyAnnotationAddType": "AUTOMATED_REASONING_POLICY_ANNOTATION", + "AutomatedReasoningPolicyAnnotationUpdateType": "AUTOMATED_REASONING_POLICY_ANNOTATION", + "AutomatedReasoningPolicyAnnotationDeleteType": "AUTOMATED_REASONING_POLICY_ANNOTATION", + "AutomatedReasoningPolicyAnnotationAddVariable": "AUTOMATED_REASONING_POLICY_ANNOTATION", + "AutomatedReasoningPolicyAnnotationUpdateVariable": "AUTOMATED_REASONING_POLICY_ANNOTATION", + "AutomatedReasoningPolicyAnnotationDeleteVariable": "AUTOMATED_REASONING_POLICY_ANNOTATION", + "AutomatedReasoningPolicyAnnotationAddRule": "AUTOMATED_REASONING_POLICY_ANNOTATION", + "AutomatedReasoningPolicyAnnotationUpdateRule": "AUTOMATED_REASONING_POLICY_ANNOTATION", + "AutomatedReasoningPolicyAnnotationDeleteRule": "AUTOMATED_REASONING_POLICY_ANNOTATION", + "AutomatedReasoningPolicyAnnotationAddRuleFromNaturalLanguage": "AUTOMATED_REASONING_POLICY_ANNOTATION", + "AutomatedReasoningPolicyAnnotationUpdateFromRulesFeedback": "AUTOMATED_REASONING_POLICY_ANNOTATION", + "AutomatedReasoningPolicyAnnotationUpdateFromScenarioFeedback": "AUTOMATED_REASONING_POLICY_ANNOTATION", + "AutomatedReasoningPolicyAnnotationIngestContent": "AUTOMATED_REASONING_POLICY_ANNOTATION", + "AutomatedReasoningPolicyAnnotationUnknown": "AUTOMATED_REASONING_POLICY_ANNOTATION", + "AutomatedReasoningPolicyAnnotationStatus": "AUTOMATED_REASONING_POLICY_ANNOTATION_STATUS", + "AutomatedReasoningPolicyAtomicStatement": "AUTOMATED_REASONING_POLICY_ATOMIC_STATEMENT", + "AutomatedReasoningPolicyBuildDocumentContentType": "AUTOMATED_REASONING_POLICY_BUILD_DOCUMENT_CONTENT_TYPE", + "AutomatedReasoningPolicyBuildLog": "AUTOMATED_REASONING_POLICY_BUILD_LOG", + "AutomatedReasoningPolicyBuildLogEntry": "AUTOMATED_REASONING_POLICY_BUILD_LOG_ENTRY", + "AutomatedReasoningPolicyBuildMessageType": "AUTOMATED_REASONING_POLICY_BUILD_MESSAGE_TYPE", + "AutomatedReasoningPolicyBuildResultAssetManifest": "AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSET_MANIFEST", + "AutomatedReasoningPolicyBuildResultAssetManifestEntry": "AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSET_MANIFEST_ENTRY", + "AutomatedReasoningPolicyBuildResultAssets": "AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSETS", + "AutomatedReasoningPolicyBuildResultAssetsPolicyDefinition": "AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSETS", + "AutomatedReasoningPolicyBuildResultAssetsQualityReport": "AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSETS", + "AutomatedReasoningPolicyBuildResultAssetsBuildLog": "AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSETS", + "AutomatedReasoningPolicyBuildResultAssetsGeneratedTestCases": "AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSETS", + "AutomatedReasoningPolicyBuildResultAssetsPolicyScenarios": "AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSETS", + "AutomatedReasoningPolicyBuildResultAssetsAssetManifest": "AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSETS", + "AutomatedReasoningPolicyBuildResultAssetsDocument": "AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSETS", + "AutomatedReasoningPolicyBuildResultAssetsFidelityReport": "AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSETS", + "AutomatedReasoningPolicyBuildResultAssetsUnknown": "AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSETS", + "AutomatedReasoningPolicyBuildResultAssetType": "AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSET_TYPE", + "AutomatedReasoningPolicyBuildStep": "AUTOMATED_REASONING_POLICY_BUILD_STEP", + "AutomatedReasoningPolicyBuildStepContext": "AUTOMATED_REASONING_POLICY_BUILD_STEP_CONTEXT", + "AutomatedReasoningPolicyBuildStepContextPlanning": "AUTOMATED_REASONING_POLICY_BUILD_STEP_CONTEXT", + "AutomatedReasoningPolicyBuildStepContextMutation": "AUTOMATED_REASONING_POLICY_BUILD_STEP_CONTEXT", + "AutomatedReasoningPolicyBuildStepContextUnknown": "AUTOMATED_REASONING_POLICY_BUILD_STEP_CONTEXT", + "AutomatedReasoningPolicyBuildStepMessage": "AUTOMATED_REASONING_POLICY_BUILD_STEP_MESSAGE", + "AutomatedReasoningPolicyBuildWorkflowDocument": "AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_DOCUMENT", + "AutomatedReasoningPolicyBuildWorkflowRepairContent": "AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_REPAIR_CONTENT", + "AutomatedReasoningPolicyBuildWorkflowSource": "AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_SOURCE", + "AutomatedReasoningPolicyBuildWorkflowStatus": "AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_STATUS", + "AutomatedReasoningPolicyBuildWorkflowSummary": "AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_SUMMARY", + "AutomatedReasoningPolicyBuildWorkflowType": "AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_TYPE", + "AutomatedReasoningPolicyDefinition": "AUTOMATED_REASONING_POLICY_DEFINITION", + "AutomatedReasoningPolicyDefinitionElement": "AUTOMATED_REASONING_POLICY_DEFINITION_ELEMENT", + "AutomatedReasoningPolicyDefinitionElementPolicyDefinitionVariable": "AUTOMATED_REASONING_POLICY_DEFINITION_ELEMENT", + "AutomatedReasoningPolicyDefinitionElementPolicyDefinitionType": "AUTOMATED_REASONING_POLICY_DEFINITION_ELEMENT", + "AutomatedReasoningPolicyDefinitionElementPolicyDefinitionRule": "AUTOMATED_REASONING_POLICY_DEFINITION_ELEMENT", + "AutomatedReasoningPolicyDefinitionElementUnknown": "AUTOMATED_REASONING_POLICY_DEFINITION_ELEMENT", + "AutomatedReasoningPolicyDefinitionQualityReport": "AUTOMATED_REASONING_POLICY_DEFINITION_QUALITY_REPORT", + "AutomatedReasoningPolicyDefinitionRule": "AUTOMATED_REASONING_POLICY_DEFINITION_RULE", + "AutomatedReasoningPolicyDefinitionType": "AUTOMATED_REASONING_POLICY_DEFINITION_TYPE", + "AutomatedReasoningPolicyDefinitionTypeValue": "AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE", + "AutomatedReasoningPolicyDefinitionTypeValuePair": "AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE_PAIR", + "AutomatedReasoningPolicyDefinitionVariable": "AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE", + "AutomatedReasoningPolicyDeleteRuleAnnotation": "AUTOMATED_REASONING_POLICY_DELETE_RULE_ANNOTATION", + "AutomatedReasoningPolicyDeleteRuleMutation": "AUTOMATED_REASONING_POLICY_DELETE_RULE_MUTATION", + "AutomatedReasoningPolicyDeleteTypeAnnotation": "AUTOMATED_REASONING_POLICY_DELETE_TYPE_ANNOTATION", + "AutomatedReasoningPolicyDeleteTypeMutation": "AUTOMATED_REASONING_POLICY_DELETE_TYPE_MUTATION", + "AutomatedReasoningPolicyDeleteTypeValue": "AUTOMATED_REASONING_POLICY_DELETE_TYPE_VALUE", + "AutomatedReasoningPolicyDeleteVariableAnnotation": "AUTOMATED_REASONING_POLICY_DELETE_VARIABLE_ANNOTATION", + "AutomatedReasoningPolicyDeleteVariableMutation": "AUTOMATED_REASONING_POLICY_DELETE_VARIABLE_MUTATION", + "AutomatedReasoningPolicyDisjointRuleSet": "AUTOMATED_REASONING_POLICY_DISJOINT_RULE_SET", + "AutomatedReasoningPolicyFidelityReport": "AUTOMATED_REASONING_POLICY_FIDELITY_REPORT", + "AutomatedReasoningPolicyGeneratedTestCase": "AUTOMATED_REASONING_POLICY_GENERATED_TEST_CASE", + "AutomatedReasoningPolicyGeneratedTestCases": "AUTOMATED_REASONING_POLICY_GENERATED_TEST_CASES", + "AutomatedReasoningPolicyGenerateFidelityReportContent": "AUTOMATED_REASONING_POLICY_GENERATE_FIDELITY_REPORT_CONTENT", + "AutomatedReasoningPolicyGenerateFidelityReportContentDocuments": "AUTOMATED_REASONING_POLICY_GENERATE_FIDELITY_REPORT_CONTENT", + "AutomatedReasoningPolicyGenerateFidelityReportContentUnknown": "AUTOMATED_REASONING_POLICY_GENERATE_FIDELITY_REPORT_CONTENT", + "AutomatedReasoningPolicyIngestContentAnnotation": "AUTOMATED_REASONING_POLICY_INGEST_CONTENT_ANNOTATION", + "AutomatedReasoningPolicyIterativeRefinementContent": "AUTOMATED_REASONING_POLICY_ITERATIVE_REFINEMENT_CONTENT", + "AutomatedReasoningPolicyMutation": "AUTOMATED_REASONING_POLICY_MUTATION", + "AutomatedReasoningPolicyMutationAddType": "AUTOMATED_REASONING_POLICY_MUTATION", + "AutomatedReasoningPolicyMutationUpdateType": "AUTOMATED_REASONING_POLICY_MUTATION", + "AutomatedReasoningPolicyMutationDeleteType": "AUTOMATED_REASONING_POLICY_MUTATION", + "AutomatedReasoningPolicyMutationAddVariable": "AUTOMATED_REASONING_POLICY_MUTATION", + "AutomatedReasoningPolicyMutationUpdateVariable": "AUTOMATED_REASONING_POLICY_MUTATION", + "AutomatedReasoningPolicyMutationDeleteVariable": "AUTOMATED_REASONING_POLICY_MUTATION", + "AutomatedReasoningPolicyMutationAddRule": "AUTOMATED_REASONING_POLICY_MUTATION", + "AutomatedReasoningPolicyMutationUpdateRule": "AUTOMATED_REASONING_POLICY_MUTATION", + "AutomatedReasoningPolicyMutationDeleteRule": "AUTOMATED_REASONING_POLICY_MUTATION", + "AutomatedReasoningPolicyMutationUnknown": "AUTOMATED_REASONING_POLICY_MUTATION", + "AutomatedReasoningPolicyPlanning": "AUTOMATED_REASONING_POLICY_PLANNING", + "AutomatedReasoningPolicyReportSourceDocument": "AUTOMATED_REASONING_POLICY_REPORT_SOURCE_DOCUMENT", + "AutomatedReasoningPolicyRuleReport": "AUTOMATED_REASONING_POLICY_RULE_REPORT", + "AutomatedReasoningPolicyScenario": "AUTOMATED_REASONING_POLICY_SCENARIO", + "AutomatedReasoningPolicyScenarios": "AUTOMATED_REASONING_POLICY_SCENARIOS", + "AutomatedReasoningPolicySourceDocument": "AUTOMATED_REASONING_POLICY_SOURCE_DOCUMENT", + "AutomatedReasoningPolicyStatementLocation": "AUTOMATED_REASONING_POLICY_STATEMENT_LOCATION", + "AutomatedReasoningPolicyStatementReference": "AUTOMATED_REASONING_POLICY_STATEMENT_REFERENCE", + "AutomatedReasoningPolicySummary": "AUTOMATED_REASONING_POLICY_SUMMARY", + "AutomatedReasoningPolicyTestCase": "AUTOMATED_REASONING_POLICY_TEST_CASE", + "AutomatedReasoningPolicyTestResult": "AUTOMATED_REASONING_POLICY_TEST_RESULT", + "AutomatedReasoningPolicyTestRunResult": "AUTOMATED_REASONING_POLICY_TEST_RUN_RESULT", + "AutomatedReasoningPolicyTestRunStatus": "AUTOMATED_REASONING_POLICY_TEST_RUN_STATUS", + "AutomatedReasoningPolicyTypeValueAnnotation": "AUTOMATED_REASONING_POLICY_TYPE_VALUE_ANNOTATION", + "AutomatedReasoningPolicyTypeValueAnnotationAddTypeValue": "AUTOMATED_REASONING_POLICY_TYPE_VALUE_ANNOTATION", + "AutomatedReasoningPolicyTypeValueAnnotationUpdateTypeValue": "AUTOMATED_REASONING_POLICY_TYPE_VALUE_ANNOTATION", + "AutomatedReasoningPolicyTypeValueAnnotationDeleteTypeValue": "AUTOMATED_REASONING_POLICY_TYPE_VALUE_ANNOTATION", + "AutomatedReasoningPolicyTypeValueAnnotationUnknown": "AUTOMATED_REASONING_POLICY_TYPE_VALUE_ANNOTATION", + "AutomatedReasoningPolicyUpdateFromRuleFeedbackAnnotation": "AUTOMATED_REASONING_POLICY_UPDATE_FROM_RULE_FEEDBACK_ANNOTATION", + "AutomatedReasoningPolicyUpdateFromScenarioFeedbackAnnotation": "AUTOMATED_REASONING_POLICY_UPDATE_FROM_SCENARIO_FEEDBACK_ANNOTATION", + "AutomatedReasoningPolicyUpdateRuleAnnotation": "AUTOMATED_REASONING_POLICY_UPDATE_RULE_ANNOTATION", + "AutomatedReasoningPolicyUpdateRuleMutation": "AUTOMATED_REASONING_POLICY_UPDATE_RULE_MUTATION", + "AutomatedReasoningPolicyUpdateTypeAnnotation": "AUTOMATED_REASONING_POLICY_UPDATE_TYPE_ANNOTATION", + "AutomatedReasoningPolicyUpdateTypeMutation": "AUTOMATED_REASONING_POLICY_UPDATE_TYPE_MUTATION", + "AutomatedReasoningPolicyUpdateTypeValue": "AUTOMATED_REASONING_POLICY_UPDATE_TYPE_VALUE", + "AutomatedReasoningPolicyUpdateVariableAnnotation": "AUTOMATED_REASONING_POLICY_UPDATE_VARIABLE_ANNOTATION", + "AutomatedReasoningPolicyUpdateVariableMutation": "AUTOMATED_REASONING_POLICY_UPDATE_VARIABLE_MUTATION", + "AutomatedReasoningPolicyVariableReport": "AUTOMATED_REASONING_POLICY_VARIABLE_REPORT", + "AutomatedReasoningPolicyWorkflowTypeContent": "AUTOMATED_REASONING_POLICY_WORKFLOW_TYPE_CONTENT", + "AutomatedReasoningPolicyWorkflowTypeContentDocuments": "AUTOMATED_REASONING_POLICY_WORKFLOW_TYPE_CONTENT", + "AutomatedReasoningPolicyWorkflowTypeContentPolicyRepairAssets": "AUTOMATED_REASONING_POLICY_WORKFLOW_TYPE_CONTENT", + "AutomatedReasoningPolicyWorkflowTypeContentGenerateFidelityReportContent": "AUTOMATED_REASONING_POLICY_WORKFLOW_TYPE_CONTENT", + "AutomatedReasoningPolicyWorkflowTypeContentIterativeRefinementContent": "AUTOMATED_REASONING_POLICY_WORKFLOW_TYPE_CONTENT", + "AutomatedReasoningPolicyWorkflowTypeContentUnknown": "AUTOMATED_REASONING_POLICY_WORKFLOW_TYPE_CONTENT", + "BatchDeleteAdvancedPromptOptimizationJobError": "BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_ERROR", + "BatchDeleteAdvancedPromptOptimizationJobInput": "BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT", + "BatchDeleteAdvancedPromptOptimizationJobItem": "BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_ITEM", + "BatchDeleteAdvancedPromptOptimizationJobOutput": "BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT", + "BatchDeleteEvaluationJobError": "BATCH_DELETE_EVALUATION_JOB_ERROR", + "BatchDeleteEvaluationJobInput": "BATCH_DELETE_EVALUATION_JOB_INPUT", + "BatchDeleteEvaluationJobItem": "BATCH_DELETE_EVALUATION_JOB_ITEM", + "BatchDeleteEvaluationJobOutput": "BATCH_DELETE_EVALUATION_JOB_OUTPUT", + "BedrockEvaluatorModel": "BEDROCK_EVALUATOR_MODEL", + "ByteContentDoc": "BYTE_CONTENT_DOC", + "CancelAutomatedReasoningPolicyBuildWorkflowInput": "CANCEL_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT", + "CancelAutomatedReasoningPolicyBuildWorkflowOutput": "CANCEL_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT", + "CloudWatchConfig": "CLOUD_WATCH_CONFIG", + "CommitmentDuration": "COMMITMENT_DURATION", + "ConflictException": "CONFLICT_EXCEPTION", + "CreateAdvancedPromptOptimizationJobInput": "CREATE_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT", + "CreateAdvancedPromptOptimizationJobOutput": "CREATE_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT", + "CreateAutomatedReasoningPolicyInput": "CREATE_AUTOMATED_REASONING_POLICY_INPUT", + "CreateAutomatedReasoningPolicyOutput": "CREATE_AUTOMATED_REASONING_POLICY_OUTPUT", + "CreateAutomatedReasoningPolicyTestCaseInput": "CREATE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT", + "CreateAutomatedReasoningPolicyTestCaseOutput": "CREATE_AUTOMATED_REASONING_POLICY_TEST_CASE_OUTPUT", + "CreateAutomatedReasoningPolicyVersionInput": "CREATE_AUTOMATED_REASONING_POLICY_VERSION_INPUT", + "CreateAutomatedReasoningPolicyVersionOutput": "CREATE_AUTOMATED_REASONING_POLICY_VERSION_OUTPUT", + "CreateCustomModelDeploymentInput": "CREATE_CUSTOM_MODEL_DEPLOYMENT_INPUT", + "CreateCustomModelDeploymentOutput": "CREATE_CUSTOM_MODEL_DEPLOYMENT_OUTPUT", + "CreateCustomModelInput": "CREATE_CUSTOM_MODEL_INPUT", + "CreateCustomModelOutput": "CREATE_CUSTOM_MODEL_OUTPUT", + "CreateEvaluationJobInput": "CREATE_EVALUATION_JOB_INPUT", + "CreateEvaluationJobOutput": "CREATE_EVALUATION_JOB_OUTPUT", + "CreateFoundationModelAgreementInput": "CREATE_FOUNDATION_MODEL_AGREEMENT_INPUT", + "CreateFoundationModelAgreementOutput": "CREATE_FOUNDATION_MODEL_AGREEMENT_OUTPUT", + "CreateGuardrailInput": "CREATE_GUARDRAIL_INPUT", + "CreateGuardrailOutput": "CREATE_GUARDRAIL_OUTPUT", + "CreateGuardrailVersionInput": "CREATE_GUARDRAIL_VERSION_INPUT", + "CreateGuardrailVersionOutput": "CREATE_GUARDRAIL_VERSION_OUTPUT", + "CreateInferenceProfileInput": "CREATE_INFERENCE_PROFILE_INPUT", + "CreateInferenceProfileOutput": "CREATE_INFERENCE_PROFILE_OUTPUT", + "CreateMarketplaceModelEndpointInput": "CREATE_MARKETPLACE_MODEL_ENDPOINT_INPUT", + "CreateMarketplaceModelEndpointOutput": "CREATE_MARKETPLACE_MODEL_ENDPOINT_OUTPUT", + "CreateModelCopyJobInput": "CREATE_MODEL_COPY_JOB_INPUT", + "CreateModelCopyJobOutput": "CREATE_MODEL_COPY_JOB_OUTPUT", + "CreateModelCustomizationJobInput": "CREATE_MODEL_CUSTOMIZATION_JOB_INPUT", + "CreateModelCustomizationJobOutput": "CREATE_MODEL_CUSTOMIZATION_JOB_OUTPUT", + "CreateModelImportJobInput": "CREATE_MODEL_IMPORT_JOB_INPUT", + "CreateModelImportJobOutput": "CREATE_MODEL_IMPORT_JOB_OUTPUT", + "CreateModelInvocationJobInput": "CREATE_MODEL_INVOCATION_JOB_INPUT", + "CreateModelInvocationJobOutput": "CREATE_MODEL_INVOCATION_JOB_OUTPUT", + "CreatePromptRouterInput": "CREATE_PROMPT_ROUTER_INPUT", + "CreatePromptRouterOutput": "CREATE_PROMPT_ROUTER_OUTPUT", + "CreateProvisionedModelThroughputInput": "CREATE_PROVISIONED_MODEL_THROUGHPUT_INPUT", + "CreateProvisionedModelThroughputOutput": "CREATE_PROVISIONED_MODEL_THROUGHPUT_OUTPUT", + "CustomizationConfig": "CUSTOMIZATION_CONFIG", + "CustomizationConfigDistillationConfig": "CUSTOMIZATION_CONFIG", + "CustomizationConfigRftConfig": "CUSTOMIZATION_CONFIG", + "CustomizationConfigUnknown": "CUSTOMIZATION_CONFIG", + "CustomizationType": "CUSTOMIZATION_TYPE", + "CustomMetricBedrockEvaluatorModel": "CUSTOM_METRIC_BEDROCK_EVALUATOR_MODEL", + "CustomMetricDefinition": "CUSTOM_METRIC_DEFINITION", + "CustomMetricEvaluatorModelConfig": "CUSTOM_METRIC_EVALUATOR_MODEL_CONFIG", + "CustomModelDataSource": "CUSTOM_MODEL_DATA_SOURCE", + "CustomModelDataSourceModelPackageArnDataSource": "CUSTOM_MODEL_DATA_SOURCE", + "CustomModelDataSourceUnknown": "CUSTOM_MODEL_DATA_SOURCE", + "CustomModelDeploymentStatus": "CUSTOM_MODEL_DEPLOYMENT_STATUS", + "CustomModelDeploymentSummary": "CUSTOM_MODEL_DEPLOYMENT_SUMMARY", + "CustomModelDeploymentUpdateDetails": "CUSTOM_MODEL_DEPLOYMENT_UPDATE_DETAILS", + "CustomModelDeploymentUpdateStatus": "CUSTOM_MODEL_DEPLOYMENT_UPDATE_STATUS", + "CustomModelSummary": "CUSTOM_MODEL_SUMMARY", + "CustomModelUnits": "CUSTOM_MODEL_UNITS", + "DataProcessingDetails": "DATA_PROCESSING_DETAILS", + "DataRetentionMode": "DATA_RETENTION_MODE", + "DeleteAutomatedReasoningPolicyBuildWorkflowInput": "DELETE_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT", + "DeleteAutomatedReasoningPolicyBuildWorkflowOutput": "DELETE_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT", + "DeleteAutomatedReasoningPolicyInput": "DELETE_AUTOMATED_REASONING_POLICY_INPUT", + "DeleteAutomatedReasoningPolicyOutput": "DELETE_AUTOMATED_REASONING_POLICY_OUTPUT", + "DeleteAutomatedReasoningPolicyTestCaseInput": "DELETE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT", + "DeleteAutomatedReasoningPolicyTestCaseOutput": "DELETE_AUTOMATED_REASONING_POLICY_TEST_CASE_OUTPUT", + "DeleteCustomModelDeploymentInput": "DELETE_CUSTOM_MODEL_DEPLOYMENT_INPUT", + "DeleteCustomModelDeploymentOutput": "DELETE_CUSTOM_MODEL_DEPLOYMENT_OUTPUT", + "DeleteCustomModelInput": "DELETE_CUSTOM_MODEL_INPUT", + "DeleteCustomModelOutput": "DELETE_CUSTOM_MODEL_OUTPUT", + "DeleteEnforcedGuardrailConfigurationInput": "DELETE_ENFORCED_GUARDRAIL_CONFIGURATION_INPUT", + "DeleteEnforcedGuardrailConfigurationOutput": "DELETE_ENFORCED_GUARDRAIL_CONFIGURATION_OUTPUT", + "DeleteFoundationModelAgreementInput": "DELETE_FOUNDATION_MODEL_AGREEMENT_INPUT", + "DeleteFoundationModelAgreementOutput": "DELETE_FOUNDATION_MODEL_AGREEMENT_OUTPUT", + "DeleteGuardrailInput": "DELETE_GUARDRAIL_INPUT", + "DeleteGuardrailOutput": "DELETE_GUARDRAIL_OUTPUT", + "DeleteImportedModelInput": "DELETE_IMPORTED_MODEL_INPUT", + "DeleteImportedModelOutput": "DELETE_IMPORTED_MODEL_OUTPUT", + "DeleteInferenceProfileInput": "DELETE_INFERENCE_PROFILE_INPUT", + "DeleteInferenceProfileOutput": "DELETE_INFERENCE_PROFILE_OUTPUT", + "DeleteMarketplaceModelEndpointInput": "DELETE_MARKETPLACE_MODEL_ENDPOINT_INPUT", + "DeleteMarketplaceModelEndpointOutput": "DELETE_MARKETPLACE_MODEL_ENDPOINT_OUTPUT", + "DeleteModelInvocationLoggingConfigurationInput": "DELETE_MODEL_INVOCATION_LOGGING_CONFIGURATION_INPUT", + "DeleteModelInvocationLoggingConfigurationOutput": "DELETE_MODEL_INVOCATION_LOGGING_CONFIGURATION_OUTPUT", + "DeletePromptRouterInput": "DELETE_PROMPT_ROUTER_INPUT", + "DeletePromptRouterOutput": "DELETE_PROMPT_ROUTER_OUTPUT", + "DeleteProvisionedModelThroughputInput": "DELETE_PROVISIONED_MODEL_THROUGHPUT_INPUT", + "DeleteProvisionedModelThroughputOutput": "DELETE_PROVISIONED_MODEL_THROUGHPUT_OUTPUT", + "DeleteResourcePolicyInput": "DELETE_RESOURCE_POLICY_INPUT", + "DeleteResourcePolicyOutput": "DELETE_RESOURCE_POLICY_OUTPUT", + "DeregisterMarketplaceModelEndpointInput": "DEREGISTER_MARKETPLACE_MODEL_ENDPOINT_INPUT", + "DeregisterMarketplaceModelEndpointOutput": "DEREGISTER_MARKETPLACE_MODEL_ENDPOINT_OUTPUT", + "DimensionalPriceRate": "DIMENSIONAL_PRICE_RATE", + "DistillationConfig": "DISTILLATION_CONFIG", + "EndpointConfig": "ENDPOINT_CONFIG", + "EndpointConfigSageMaker": "ENDPOINT_CONFIG", + "EndpointConfigUnknown": "ENDPOINT_CONFIG", + "EntitlementAvailability": "ENTITLEMENT_AVAILABILITY", + "EvaluationBedrockModel": "EVALUATION_BEDROCK_MODEL", + "EvaluationConfig": "EVALUATION_CONFIG", + "EvaluationConfigAutomated": "EVALUATION_CONFIG", + "EvaluationConfigHuman": "EVALUATION_CONFIG", + "EvaluationConfigUnknown": "EVALUATION_CONFIG", + "EvaluationDataset": "EVALUATION_DATASET", + "EvaluationDatasetLocation": "EVALUATION_DATASET_LOCATION", + "EvaluationDatasetLocationS3Uri": "EVALUATION_DATASET_LOCATION", + "EvaluationDatasetLocationUnknown": "EVALUATION_DATASET_LOCATION", + "EvaluationDatasetMetricConfig": "EVALUATION_DATASET_METRIC_CONFIG", + "EvaluationInferenceConfig": "EVALUATION_INFERENCE_CONFIG", + "EvaluationInferenceConfigModels": "EVALUATION_INFERENCE_CONFIG", + "EvaluationInferenceConfigRagConfigs": "EVALUATION_INFERENCE_CONFIG", + "EvaluationInferenceConfigUnknown": "EVALUATION_INFERENCE_CONFIG", + "EvaluationInferenceConfigSummary": "EVALUATION_INFERENCE_CONFIG_SUMMARY", + "EvaluationJobStatus": "EVALUATION_JOB_STATUS", + "EvaluationJobType": "EVALUATION_JOB_TYPE", + "EvaluationModelConfig": "EVALUATION_MODEL_CONFIG", + "EvaluationModelConfigBedrockModel": "EVALUATION_MODEL_CONFIG", + "EvaluationModelConfigPrecomputedInferenceSource": "EVALUATION_MODEL_CONFIG", + "EvaluationModelConfigUnknown": "EVALUATION_MODEL_CONFIG", + "EvaluationModelConfigSummary": "EVALUATION_MODEL_CONFIG_SUMMARY", + "EvaluationOutputDataConfig": "EVALUATION_OUTPUT_DATA_CONFIG", + "EvaluationPrecomputedInferenceSource": "EVALUATION_PRECOMPUTED_INFERENCE_SOURCE", + "EvaluationPrecomputedRagSourceConfig": "EVALUATION_PRECOMPUTED_RAG_SOURCE_CONFIG", + "EvaluationPrecomputedRagSourceConfigRetrieveSourceConfig": "EVALUATION_PRECOMPUTED_RAG_SOURCE_CONFIG", + "EvaluationPrecomputedRagSourceConfigRetrieveAndGenerateSourceConfig": "EVALUATION_PRECOMPUTED_RAG_SOURCE_CONFIG", + "EvaluationPrecomputedRagSourceConfigUnknown": "EVALUATION_PRECOMPUTED_RAG_SOURCE_CONFIG", + "EvaluationPrecomputedRetrieveAndGenerateSourceConfig": "EVALUATION_PRECOMPUTED_RETRIEVE_AND_GENERATE_SOURCE_CONFIG", + "EvaluationPrecomputedRetrieveSourceConfig": "EVALUATION_PRECOMPUTED_RETRIEVE_SOURCE_CONFIG", + "EvaluationRagConfigSummary": "EVALUATION_RAG_CONFIG_SUMMARY", + "EvaluationSummary": "EVALUATION_SUMMARY", + "EvaluationTaskType": "EVALUATION_TASK_TYPE", + "EvaluatorModelConfig": "EVALUATOR_MODEL_CONFIG", + "EvaluatorModelConfigBedrockEvaluatorModels": "EVALUATOR_MODEL_CONFIG", + "EvaluatorModelConfigUnknown": "EVALUATOR_MODEL_CONFIG", + "ExportAutomatedReasoningPolicyVersionInput": "EXPORT_AUTOMATED_REASONING_POLICY_VERSION_INPUT", + "ExportAutomatedReasoningPolicyVersionOutput": "EXPORT_AUTOMATED_REASONING_POLICY_VERSION_OUTPUT", + "ExternalSource": "EXTERNAL_SOURCE", + "ExternalSourcesGenerationConfiguration": "EXTERNAL_SOURCES_GENERATION_CONFIGURATION", + "ExternalSourcesRetrieveAndGenerateConfiguration": "EXTERNAL_SOURCES_RETRIEVE_AND_GENERATE_CONFIGURATION", + "ExternalSourceType": "EXTERNAL_SOURCE_TYPE", + "FieldForReranking": "FIELD_FOR_RERANKING", + "FilterAttribute": "FILTER_ATTRIBUTE", + "FineTuningJobStatus": "FINE_TUNING_JOB_STATUS", + "FoundationModelDetails": "FOUNDATION_MODEL_DETAILS", + "FoundationModelLifecycle": "FOUNDATION_MODEL_LIFECYCLE", + "FoundationModelLifecycleStatus": "FOUNDATION_MODEL_LIFECYCLE_STATUS", + "FoundationModelSummary": "FOUNDATION_MODEL_SUMMARY", + "GenerationConfiguration": "GENERATION_CONFIGURATION", + "GetAccountDataRetentionInput": "GET_ACCOUNT_DATA_RETENTION_INPUT", + "GetAccountDataRetentionOutput": "GET_ACCOUNT_DATA_RETENTION_OUTPUT", + "GetAdvancedPromptOptimizationJobInput": "GET_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT", + "GetAdvancedPromptOptimizationJobOutput": "GET_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT", + "GetAutomatedReasoningPolicyAnnotationsInput": "GET_AUTOMATED_REASONING_POLICY_ANNOTATIONS_INPUT", + "GetAutomatedReasoningPolicyAnnotationsOutput": "GET_AUTOMATED_REASONING_POLICY_ANNOTATIONS_OUTPUT", + "GetAutomatedReasoningPolicyBuildWorkflowInput": "GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT", + "GetAutomatedReasoningPolicyBuildWorkflowOutput": "GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT", + "GetAutomatedReasoningPolicyBuildWorkflowResultAssetsInput": "GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_RESULT_ASSETS_INPUT", + "GetAutomatedReasoningPolicyBuildWorkflowResultAssetsOutput": "GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_RESULT_ASSETS_OUTPUT", + "GetAutomatedReasoningPolicyInput": "GET_AUTOMATED_REASONING_POLICY_INPUT", + "GetAutomatedReasoningPolicyNextScenarioInput": "GET_AUTOMATED_REASONING_POLICY_NEXT_SCENARIO_INPUT", + "GetAutomatedReasoningPolicyNextScenarioOutput": "GET_AUTOMATED_REASONING_POLICY_NEXT_SCENARIO_OUTPUT", + "GetAutomatedReasoningPolicyOutput": "GET_AUTOMATED_REASONING_POLICY_OUTPUT", + "GetAutomatedReasoningPolicyTestCaseInput": "GET_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT", + "GetAutomatedReasoningPolicyTestCaseOutput": "GET_AUTOMATED_REASONING_POLICY_TEST_CASE_OUTPUT", + "GetAutomatedReasoningPolicyTestResultInput": "GET_AUTOMATED_REASONING_POLICY_TEST_RESULT_INPUT", + "GetAutomatedReasoningPolicyTestResultOutput": "GET_AUTOMATED_REASONING_POLICY_TEST_RESULT_OUTPUT", + "GetCustomModelDeploymentInput": "GET_CUSTOM_MODEL_DEPLOYMENT_INPUT", + "GetCustomModelDeploymentOutput": "GET_CUSTOM_MODEL_DEPLOYMENT_OUTPUT", + "GetCustomModelInput": "GET_CUSTOM_MODEL_INPUT", + "GetCustomModelOutput": "GET_CUSTOM_MODEL_OUTPUT", + "GetEvaluationJobInput": "GET_EVALUATION_JOB_INPUT", + "GetEvaluationJobOutput": "GET_EVALUATION_JOB_OUTPUT", + "GetFoundationModelAvailabilityInput": "GET_FOUNDATION_MODEL_AVAILABILITY_INPUT", + "GetFoundationModelAvailabilityOutput": "GET_FOUNDATION_MODEL_AVAILABILITY_OUTPUT", + "GetFoundationModelInput": "GET_FOUNDATION_MODEL_INPUT", + "GetFoundationModelOutput": "GET_FOUNDATION_MODEL_OUTPUT", + "GetGuardrailInput": "GET_GUARDRAIL_INPUT", + "GetGuardrailOutput": "GET_GUARDRAIL_OUTPUT", + "GetImportedModelInput": "GET_IMPORTED_MODEL_INPUT", + "GetImportedModelOutput": "GET_IMPORTED_MODEL_OUTPUT", + "GetInferenceProfileInput": "GET_INFERENCE_PROFILE_INPUT", + "GetInferenceProfileOutput": "GET_INFERENCE_PROFILE_OUTPUT", + "GetMarketplaceModelEndpointInput": "GET_MARKETPLACE_MODEL_ENDPOINT_INPUT", + "GetMarketplaceModelEndpointOutput": "GET_MARKETPLACE_MODEL_ENDPOINT_OUTPUT", + "GetModelCopyJobInput": "GET_MODEL_COPY_JOB_INPUT", + "GetModelCopyJobOutput": "GET_MODEL_COPY_JOB_OUTPUT", + "GetModelCustomizationJobInput": "GET_MODEL_CUSTOMIZATION_JOB_INPUT", + "GetModelCustomizationJobOutput": "GET_MODEL_CUSTOMIZATION_JOB_OUTPUT", + "GetModelImportJobInput": "GET_MODEL_IMPORT_JOB_INPUT", + "GetModelImportJobOutput": "GET_MODEL_IMPORT_JOB_OUTPUT", + "GetModelInvocationJobInput": "GET_MODEL_INVOCATION_JOB_INPUT", + "GetModelInvocationJobOutput": "GET_MODEL_INVOCATION_JOB_OUTPUT", + "GetModelInvocationLoggingConfigurationInput": "GET_MODEL_INVOCATION_LOGGING_CONFIGURATION_INPUT", + "GetModelInvocationLoggingConfigurationOutput": "GET_MODEL_INVOCATION_LOGGING_CONFIGURATION_OUTPUT", + "GetPromptRouterInput": "GET_PROMPT_ROUTER_INPUT", + "GetPromptRouterOutput": "GET_PROMPT_ROUTER_OUTPUT", + "GetProvisionedModelThroughputInput": "GET_PROVISIONED_MODEL_THROUGHPUT_INPUT", + "GetProvisionedModelThroughputOutput": "GET_PROVISIONED_MODEL_THROUGHPUT_OUTPUT", + "GetResourcePolicyInput": "GET_RESOURCE_POLICY_INPUT", + "GetResourcePolicyOutput": "GET_RESOURCE_POLICY_OUTPUT", + "GetUseCaseForModelAccessInput": "GET_USE_CASE_FOR_MODEL_ACCESS_INPUT", + "GetUseCaseForModelAccessOutput": "GET_USE_CASE_FOR_MODEL_ACCESS_OUTPUT", + "GraderConfig": "GRADER_CONFIG", + "GraderConfigLambdaGrader": "GRADER_CONFIG", + "GraderConfigUnknown": "GRADER_CONFIG", + "GuardrailAutomatedReasoningPolicy": "GUARDRAIL_AUTOMATED_REASONING_POLICY", + "GuardrailAutomatedReasoningPolicyConfig": "GUARDRAIL_AUTOMATED_REASONING_POLICY_CONFIG", + "GuardrailConfiguration": "GUARDRAIL_CONFIGURATION", + "GuardrailContentFilter": "GUARDRAIL_CONTENT_FILTER", + "GuardrailContentFilterAction": "GUARDRAIL_CONTENT_FILTER_ACTION", + "GuardrailContentFilterConfig": "GUARDRAIL_CONTENT_FILTER_CONFIG", + "GuardrailContentFiltersTier": "GUARDRAIL_CONTENT_FILTERS_TIER", + "GuardrailContentFiltersTierConfig": "GUARDRAIL_CONTENT_FILTERS_TIER_CONFIG", + "GuardrailContentFiltersTierName": "GUARDRAIL_CONTENT_FILTERS_TIER_NAME", + "GuardrailContentFilterType": "GUARDRAIL_CONTENT_FILTER_TYPE", + "GuardrailContentPolicy": "GUARDRAIL_CONTENT_POLICY", + "GuardrailContentPolicyConfig": "GUARDRAIL_CONTENT_POLICY_CONFIG", + "GuardrailContextualGroundingAction": "GUARDRAIL_CONTEXTUAL_GROUNDING_ACTION", + "GuardrailContextualGroundingFilter": "GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER", + "GuardrailContextualGroundingFilterConfig": "GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER_CONFIG", + "GuardrailContextualGroundingFilterType": "GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER_TYPE", + "GuardrailContextualGroundingPolicy": "GUARDRAIL_CONTEXTUAL_GROUNDING_POLICY", + "GuardrailContextualGroundingPolicyConfig": "GUARDRAIL_CONTEXTUAL_GROUNDING_POLICY_CONFIG", + "GuardrailCrossRegionConfig": "GUARDRAIL_CROSS_REGION_CONFIG", + "GuardrailCrossRegionDetails": "GUARDRAIL_CROSS_REGION_DETAILS", + "GuardrailFilterStrength": "GUARDRAIL_FILTER_STRENGTH", + "GuardrailManagedWords": "GUARDRAIL_MANAGED_WORDS", + "GuardrailManagedWordsConfig": "GUARDRAIL_MANAGED_WORDS_CONFIG", + "GuardrailManagedWordsType": "GUARDRAIL_MANAGED_WORDS_TYPE", + "GuardrailModality": "GUARDRAIL_MODALITY", + "GuardrailPiiEntity": "GUARDRAIL_PII_ENTITY", + "GuardrailPiiEntityConfig": "GUARDRAIL_PII_ENTITY_CONFIG", + "GuardrailPiiEntityType": "GUARDRAIL_PII_ENTITY_TYPE", + "GuardrailRegex": "GUARDRAIL_REGEX", + "GuardrailRegexConfig": "GUARDRAIL_REGEX_CONFIG", + "GuardrailSensitiveInformationAction": "GUARDRAIL_SENSITIVE_INFORMATION_ACTION", + "GuardrailSensitiveInformationPolicy": "GUARDRAIL_SENSITIVE_INFORMATION_POLICY", + "GuardrailSensitiveInformationPolicyConfig": "GUARDRAIL_SENSITIVE_INFORMATION_POLICY_CONFIG", + "GuardrailStatus": "GUARDRAIL_STATUS", + "GuardrailSummary": "GUARDRAIL_SUMMARY", + "GuardrailTopic": "GUARDRAIL_TOPIC", + "GuardrailTopicAction": "GUARDRAIL_TOPIC_ACTION", + "GuardrailTopicConfig": "GUARDRAIL_TOPIC_CONFIG", + "GuardrailTopicPolicy": "GUARDRAIL_TOPIC_POLICY", + "GuardrailTopicPolicyConfig": "GUARDRAIL_TOPIC_POLICY_CONFIG", + "GuardrailTopicsTier": "GUARDRAIL_TOPICS_TIER", + "GuardrailTopicsTierConfig": "GUARDRAIL_TOPICS_TIER_CONFIG", + "GuardrailTopicsTierName": "GUARDRAIL_TOPICS_TIER_NAME", + "GuardrailTopicType": "GUARDRAIL_TOPIC_TYPE", + "GuardrailWord": "GUARDRAIL_WORD", + "GuardrailWordAction": "GUARDRAIL_WORD_ACTION", + "GuardrailWordConfig": "GUARDRAIL_WORD_CONFIG", + "GuardrailWordPolicy": "GUARDRAIL_WORD_POLICY", + "GuardrailWordPolicyConfig": "GUARDRAIL_WORD_POLICY_CONFIG", + "HumanEvaluationConfig": "HUMAN_EVALUATION_CONFIG", + "HumanEvaluationCustomMetric": "HUMAN_EVALUATION_CUSTOM_METRIC", + "HumanWorkflowConfig": "HUMAN_WORKFLOW_CONFIG", + "ImplicitFilterConfiguration": "IMPLICIT_FILTER_CONFIGURATION", + "ImportedModelSummary": "IMPORTED_MODEL_SUMMARY", + "InferenceConfiguration": "INFERENCE_CONFIGURATION", + "InferenceProfileModel": "INFERENCE_PROFILE_MODEL", + "InferenceProfileModelSource": "INFERENCE_PROFILE_MODEL_SOURCE", + "InferenceProfileModelSourceCopyFrom": "INFERENCE_PROFILE_MODEL_SOURCE", + "InferenceProfileModelSourceUnknown": "INFERENCE_PROFILE_MODEL_SOURCE", + "InferenceProfileStatus": "INFERENCE_PROFILE_STATUS", + "InferenceProfileSummary": "INFERENCE_PROFILE_SUMMARY", + "InferenceProfileType": "INFERENCE_PROFILE_TYPE", + "InferenceType": "INFERENCE_TYPE", + "InputTags": "INPUT_TAGS", + "InternalServerException": "INTERNAL_SERVER_EXCEPTION", + "InvocationLogsConfig": "INVOCATION_LOGS_CONFIG", + "InvocationLogSource": "INVOCATION_LOG_SOURCE", + "InvocationLogSourceS3Uri": "INVOCATION_LOG_SOURCE", + "InvocationLogSourceUnknown": "INVOCATION_LOG_SOURCE", + "JobStatusDetails": "JOB_STATUS_DETAILS", + "KbInferenceConfig": "KB_INFERENCE_CONFIG", + "KnowledgeBaseConfig": "KNOWLEDGE_BASE_CONFIG", + "KnowledgeBaseConfigRetrieveConfig": "KNOWLEDGE_BASE_CONFIG", + "KnowledgeBaseConfigRetrieveAndGenerateConfig": "KNOWLEDGE_BASE_CONFIG", + "KnowledgeBaseConfigUnknown": "KNOWLEDGE_BASE_CONFIG", + "KnowledgeBaseRetrievalConfiguration": "KNOWLEDGE_BASE_RETRIEVAL_CONFIGURATION", + "KnowledgeBaseRetrieveAndGenerateConfiguration": "KNOWLEDGE_BASE_RETRIEVE_AND_GENERATE_CONFIGURATION", + "KnowledgeBaseVectorSearchConfiguration": "KNOWLEDGE_BASE_VECTOR_SEARCH_CONFIGURATION", + "LambdaGraderConfig": "LAMBDA_GRADER_CONFIG", + "LegalTerm": "LEGAL_TERM", + "ListAdvancedPromptOptimizationJobsInput": "LIST_ADVANCED_PROMPT_OPTIMIZATION_JOBS_INPUT", + "ListAdvancedPromptOptimizationJobsOutput": "LIST_ADVANCED_PROMPT_OPTIMIZATION_JOBS_OUTPUT", + "ListAutomatedReasoningPoliciesInput": "LIST_AUTOMATED_REASONING_POLICIES_INPUT", + "ListAutomatedReasoningPoliciesOutput": "LIST_AUTOMATED_REASONING_POLICIES_OUTPUT", + "ListAutomatedReasoningPolicyBuildWorkflowsInput": "LIST_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOWS_INPUT", + "ListAutomatedReasoningPolicyBuildWorkflowsOutput": "LIST_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOWS_OUTPUT", + "ListAutomatedReasoningPolicyTestCasesInput": "LIST_AUTOMATED_REASONING_POLICY_TEST_CASES_INPUT", + "ListAutomatedReasoningPolicyTestCasesOutput": "LIST_AUTOMATED_REASONING_POLICY_TEST_CASES_OUTPUT", + "ListAutomatedReasoningPolicyTestResultsInput": "LIST_AUTOMATED_REASONING_POLICY_TEST_RESULTS_INPUT", + "ListAutomatedReasoningPolicyTestResultsOutput": "LIST_AUTOMATED_REASONING_POLICY_TEST_RESULTS_OUTPUT", + "ListCustomModelDeploymentsInput": "LIST_CUSTOM_MODEL_DEPLOYMENTS_INPUT", + "ListCustomModelDeploymentsOutput": "LIST_CUSTOM_MODEL_DEPLOYMENTS_OUTPUT", + "ListCustomModelsInput": "LIST_CUSTOM_MODELS_INPUT", + "ListCustomModelsOutput": "LIST_CUSTOM_MODELS_OUTPUT", + "ListEnforcedGuardrailsConfigurationInput": "LIST_ENFORCED_GUARDRAILS_CONFIGURATION_INPUT", + "ListEnforcedGuardrailsConfigurationOutput": "LIST_ENFORCED_GUARDRAILS_CONFIGURATION_OUTPUT", + "ListEvaluationJobsInput": "LIST_EVALUATION_JOBS_INPUT", + "ListEvaluationJobsOutput": "LIST_EVALUATION_JOBS_OUTPUT", + "ListFoundationModelAgreementOffersInput": "LIST_FOUNDATION_MODEL_AGREEMENT_OFFERS_INPUT", + "ListFoundationModelAgreementOffersOutput": "LIST_FOUNDATION_MODEL_AGREEMENT_OFFERS_OUTPUT", + "ListFoundationModelsInput": "LIST_FOUNDATION_MODELS_INPUT", + "ListFoundationModelsOutput": "LIST_FOUNDATION_MODELS_OUTPUT", + "ListGuardrailsInput": "LIST_GUARDRAILS_INPUT", + "ListGuardrailsOutput": "LIST_GUARDRAILS_OUTPUT", + "ListImportedModelsInput": "LIST_IMPORTED_MODELS_INPUT", + "ListImportedModelsOutput": "LIST_IMPORTED_MODELS_OUTPUT", + "ListInferenceProfilesInput": "LIST_INFERENCE_PROFILES_INPUT", + "ListInferenceProfilesOutput": "LIST_INFERENCE_PROFILES_OUTPUT", + "ListMarketplaceModelEndpointsInput": "LIST_MARKETPLACE_MODEL_ENDPOINTS_INPUT", + "ListMarketplaceModelEndpointsOutput": "LIST_MARKETPLACE_MODEL_ENDPOINTS_OUTPUT", + "ListModelCopyJobsInput": "LIST_MODEL_COPY_JOBS_INPUT", + "ListModelCopyJobsOutput": "LIST_MODEL_COPY_JOBS_OUTPUT", + "ListModelCustomizationJobsInput": "LIST_MODEL_CUSTOMIZATION_JOBS_INPUT", + "ListModelCustomizationJobsOutput": "LIST_MODEL_CUSTOMIZATION_JOBS_OUTPUT", + "ListModelImportJobsInput": "LIST_MODEL_IMPORT_JOBS_INPUT", + "ListModelImportJobsOutput": "LIST_MODEL_IMPORT_JOBS_OUTPUT", + "ListModelInvocationJobsInput": "LIST_MODEL_INVOCATION_JOBS_INPUT", + "ListModelInvocationJobsOutput": "LIST_MODEL_INVOCATION_JOBS_OUTPUT", + "ListPromptRoutersInput": "LIST_PROMPT_ROUTERS_INPUT", + "ListPromptRoutersOutput": "LIST_PROMPT_ROUTERS_OUTPUT", + "ListProvisionedModelThroughputsInput": "LIST_PROVISIONED_MODEL_THROUGHPUTS_INPUT", + "ListProvisionedModelThroughputsOutput": "LIST_PROVISIONED_MODEL_THROUGHPUTS_OUTPUT", + "ListTagsForResourceInput": "LIST_TAGS_FOR_RESOURCE_INPUT", + "ListTagsForResourceOutput": "LIST_TAGS_FOR_RESOURCE_OUTPUT", + "LoggingConfig": "LOGGING_CONFIG", + "MarketplaceModelEndpoint": "MARKETPLACE_MODEL_ENDPOINT", + "MarketplaceModelEndpointSummary": "MARKETPLACE_MODEL_ENDPOINT_SUMMARY", + "MetadataAttributeSchema": "METADATA_ATTRIBUTE_SCHEMA", + "MetadataConfigurationForReranking": "METADATA_CONFIGURATION_FOR_RERANKING", + "ModelConfiguration": "MODEL_CONFIGURATION", + "ModelCopyJobStatus": "MODEL_COPY_JOB_STATUS", + "ModelCopyJobSummary": "MODEL_COPY_JOB_SUMMARY", + "ModelCustomization": "MODEL_CUSTOMIZATION", + "ModelCustomizationJobStatus": "MODEL_CUSTOMIZATION_JOB_STATUS", + "ModelCustomizationJobSummary": "MODEL_CUSTOMIZATION_JOB_SUMMARY", + "ModelDataSource": "MODEL_DATA_SOURCE", + "ModelDataSourceS3DataSource": "MODEL_DATA_SOURCE", + "ModelDataSourceUnknown": "MODEL_DATA_SOURCE", + "ModelEnforcement": "MODEL_ENFORCEMENT", + "ModelImportJobStatus": "MODEL_IMPORT_JOB_STATUS", + "ModelImportJobSummary": "MODEL_IMPORT_JOB_SUMMARY", + "ModelInvocationJobInputDataConfig": "MODEL_INVOCATION_JOB_INPUT_DATA_CONFIG", + "ModelInvocationJobInputDataConfigS3InputDataConfig": "MODEL_INVOCATION_JOB_INPUT_DATA_CONFIG", + "ModelInvocationJobInputDataConfigUnknown": "MODEL_INVOCATION_JOB_INPUT_DATA_CONFIG", + "ModelInvocationJobOutputDataConfig": "MODEL_INVOCATION_JOB_OUTPUT_DATA_CONFIG", + "ModelInvocationJobOutputDataConfigS3OutputDataConfig": "MODEL_INVOCATION_JOB_OUTPUT_DATA_CONFIG", + "ModelInvocationJobOutputDataConfigUnknown": "MODEL_INVOCATION_JOB_OUTPUT_DATA_CONFIG", + "ModelInvocationJobS3InputDataConfig": "MODEL_INVOCATION_JOB_S3_INPUT_DATA_CONFIG", + "ModelInvocationJobS3OutputDataConfig": "MODEL_INVOCATION_JOB_S3_OUTPUT_DATA_CONFIG", + "ModelInvocationJobStatus": "MODEL_INVOCATION_JOB_STATUS", + "ModelInvocationJobSummary": "MODEL_INVOCATION_JOB_SUMMARY", + "ModelInvocationType": "MODEL_INVOCATION_TYPE", + "ModelModality": "MODEL_MODALITY", + "ModelPackageArnDataSource": "MODEL_PACKAGE_ARN_DATA_SOURCE", + "ModelStatus": "MODEL_STATUS", + "Offer": "OFFER", + "OfferType": "OFFER_TYPE", + "OrchestrationConfiguration": "ORCHESTRATION_CONFIGURATION", + "OutputDataConfig": "OUTPUT_DATA_CONFIG", + "PerformanceConfigLatency": "PERFORMANCE_CONFIG_LATENCY", + "PerformanceConfiguration": "PERFORMANCE_CONFIGURATION", + "PricingTerm": "PRICING_TERM", + "PromptRouterStatus": "PROMPT_ROUTER_STATUS", + "PromptRouterSummary": "PROMPT_ROUTER_SUMMARY", + "PromptRouterTargetModel": "PROMPT_ROUTER_TARGET_MODEL", + "PromptRouterType": "PROMPT_ROUTER_TYPE", + "PromptTemplate": "PROMPT_TEMPLATE", + "ProvisionedModelStatus": "PROVISIONED_MODEL_STATUS", + "ProvisionedModelSummary": "PROVISIONED_MODEL_SUMMARY", + "PutAccountDataRetentionInput": "PUT_ACCOUNT_DATA_RETENTION_INPUT", + "PutAccountDataRetentionOutput": "PUT_ACCOUNT_DATA_RETENTION_OUTPUT", + "PutEnforcedGuardrailConfigurationInput": "PUT_ENFORCED_GUARDRAIL_CONFIGURATION_INPUT", + "PutEnforcedGuardrailConfigurationOutput": "PUT_ENFORCED_GUARDRAIL_CONFIGURATION_OUTPUT", + "PutModelInvocationLoggingConfigurationInput": "PUT_MODEL_INVOCATION_LOGGING_CONFIGURATION_INPUT", + "PutModelInvocationLoggingConfigurationOutput": "PUT_MODEL_INVOCATION_LOGGING_CONFIGURATION_OUTPUT", + "PutResourcePolicyInput": "PUT_RESOURCE_POLICY_INPUT", + "PutResourcePolicyOutput": "PUT_RESOURCE_POLICY_OUTPUT", + "PutUseCaseForModelAccessInput": "PUT_USE_CASE_FOR_MODEL_ACCESS_INPUT", + "PutUseCaseForModelAccessOutput": "PUT_USE_CASE_FOR_MODEL_ACCESS_OUTPUT", + "QueryTransformationConfiguration": "QUERY_TRANSFORMATION_CONFIGURATION", + "QueryTransformationType": "QUERY_TRANSFORMATION_TYPE", + "RAGConfig": "RAG_CONFIG", + "RAGConfigKnowledgeBaseConfig": "RAG_CONFIG", + "RAGConfigPrecomputedRagSourceConfig": "RAG_CONFIG", + "RAGConfigUnknown": "RAG_CONFIG", + "RatingScaleItem": "RATING_SCALE_ITEM", + "RatingScaleItemValue": "RATING_SCALE_ITEM_VALUE", + "RatingScaleItemValueStringValue": "RATING_SCALE_ITEM_VALUE", + "RatingScaleItemValueFloatValue": "RATING_SCALE_ITEM_VALUE", + "RatingScaleItemValueUnknown": "RATING_SCALE_ITEM_VALUE", + "ReasoningEffort": "REASONING_EFFORT", + "RegionAvailability": "REGION_AVAILABILITY", + "RegisterMarketplaceModelEndpointInput": "REGISTER_MARKETPLACE_MODEL_ENDPOINT_INPUT", + "RegisterMarketplaceModelEndpointOutput": "REGISTER_MARKETPLACE_MODEL_ENDPOINT_OUTPUT", + "RequestMetadataBaseFilters": "REQUEST_METADATA_BASE_FILTERS", + "RequestMetadataFilters": "REQUEST_METADATA_FILTERS", + "RequestMetadataFiltersEquals": "REQUEST_METADATA_FILTERS", + "RequestMetadataFiltersNotEquals": "REQUEST_METADATA_FILTERS", + "RequestMetadataFiltersAndAll": "REQUEST_METADATA_FILTERS", + "RequestMetadataFiltersOrAll": "REQUEST_METADATA_FILTERS", + "RequestMetadataFiltersUnknown": "REQUEST_METADATA_FILTERS", + "RerankingMetadataSelectionMode": "RERANKING_METADATA_SELECTION_MODE", + "RerankingMetadataSelectiveModeConfiguration": "RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION", + "RerankingMetadataSelectiveModeConfigurationFieldsToInclude": "RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION", + "RerankingMetadataSelectiveModeConfigurationFieldsToExclude": "RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION", + "RerankingMetadataSelectiveModeConfigurationUnknown": "RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION", + "ResourceInUseException": "RESOURCE_IN_USE_EXCEPTION", + "ResourceNotFoundException": "RESOURCE_NOT_FOUND_EXCEPTION", + "RetrievalFilter": "RETRIEVAL_FILTER", + "RetrievalFilterEquals": "RETRIEVAL_FILTER", + "RetrievalFilterNotEquals": "RETRIEVAL_FILTER", + "RetrievalFilterGreaterThan": "RETRIEVAL_FILTER", + "RetrievalFilterGreaterThanOrEquals": "RETRIEVAL_FILTER", + "RetrievalFilterLessThan": "RETRIEVAL_FILTER", + "RetrievalFilterLessThanOrEquals": "RETRIEVAL_FILTER", + "RetrievalFilterIn": "RETRIEVAL_FILTER", + "RetrievalFilterNotIn": "RETRIEVAL_FILTER", + "RetrievalFilterStartsWith": "RETRIEVAL_FILTER", + "RetrievalFilterListContains": "RETRIEVAL_FILTER", + "RetrievalFilterStringContains": "RETRIEVAL_FILTER", + "RetrievalFilterAndAll": "RETRIEVAL_FILTER", + "RetrievalFilterOrAll": "RETRIEVAL_FILTER", + "RetrievalFilterUnknown": "RETRIEVAL_FILTER", + "RetrieveAndGenerateConfiguration": "RETRIEVE_AND_GENERATE_CONFIGURATION", + "RetrieveAndGenerateType": "RETRIEVE_AND_GENERATE_TYPE", + "RetrieveConfig": "RETRIEVE_CONFIG", + "RFTConfig": "RFT_CONFIG", + "RFTHyperParameters": "RFT_HYPER_PARAMETERS", + "RoutingCriteria": "ROUTING_CRITERIA", + "S3Config": "S3_CONFIG", + "S3DataSource": "S3_DATA_SOURCE", + "S3InputFormat": "S3_INPUT_FORMAT", + "S3ObjectDoc": "S3_OBJECT_DOC", + "SageMakerEndpoint": "SAGE_MAKER_ENDPOINT", + "SearchType": "SEARCH_TYPE", + "SelectiveContentGuarding": "SELECTIVE_CONTENT_GUARDING", + "SelectiveGuardingMode": "SELECTIVE_GUARDING_MODE", + "ServiceQuotaExceededException": "SERVICE_QUOTA_EXCEEDED_EXCEPTION", + "ServiceUnavailableException": "SERVICE_UNAVAILABLE_EXCEPTION", + "SortByProvisionedModels": "SORT_BY_PROVISIONED_MODELS", + "SortJobsBy": "SORT_JOBS_BY", + "SortModelsBy": "SORT_MODELS_BY", + "SortOrder": "SORT_ORDER", + "StartAutomatedReasoningPolicyBuildWorkflowInput": "START_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT", + "StartAutomatedReasoningPolicyBuildWorkflowOutput": "START_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT", + "StartAutomatedReasoningPolicyTestWorkflowInput": "START_AUTOMATED_REASONING_POLICY_TEST_WORKFLOW_INPUT", + "StartAutomatedReasoningPolicyTestWorkflowOutput": "START_AUTOMATED_REASONING_POLICY_TEST_WORKFLOW_OUTPUT", + "Status": "STATUS", + "StatusDetails": "STATUS_DETAILS", + "StopAdvancedPromptOptimizationJobInput": "STOP_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT", + "StopAdvancedPromptOptimizationJobOutput": "STOP_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT", + "StopEvaluationJobInput": "STOP_EVALUATION_JOB_INPUT", + "StopEvaluationJobOutput": "STOP_EVALUATION_JOB_OUTPUT", + "StopModelCustomizationJobInput": "STOP_MODEL_CUSTOMIZATION_JOB_INPUT", + "StopModelCustomizationJobOutput": "STOP_MODEL_CUSTOMIZATION_JOB_OUTPUT", + "StopModelInvocationJobInput": "STOP_MODEL_INVOCATION_JOB_INPUT", + "StopModelInvocationJobOutput": "STOP_MODEL_INVOCATION_JOB_OUTPUT", + "SupportTerm": "SUPPORT_TERM", + "Tag": "TAG", + "TagResourceInput": "TAG_RESOURCE_INPUT", + "TagResourceOutput": "TAG_RESOURCE_OUTPUT", + "TeacherModelConfig": "TEACHER_MODEL_CONFIG", + "TermDetails": "TERM_DETAILS", + "TextInferenceConfig": "TEXT_INFERENCE_CONFIG", + "ThrottlingException": "THROTTLING_EXCEPTION", + "TooManyTagsException": "TOO_MANY_TAGS_EXCEPTION", + "TrainingDataConfig": "TRAINING_DATA_CONFIG", + "TrainingDetails": "TRAINING_DETAILS", + "TrainingMetrics": "TRAINING_METRICS", + "UntagResourceInput": "UNTAG_RESOURCE_INPUT", + "UntagResourceOutput": "UNTAG_RESOURCE_OUTPUT", + "UpdateAutomatedReasoningPolicyAnnotationsInput": "UPDATE_AUTOMATED_REASONING_POLICY_ANNOTATIONS_INPUT", + "UpdateAutomatedReasoningPolicyAnnotationsOutput": "UPDATE_AUTOMATED_REASONING_POLICY_ANNOTATIONS_OUTPUT", + "UpdateAutomatedReasoningPolicyInput": "UPDATE_AUTOMATED_REASONING_POLICY_INPUT", + "UpdateAutomatedReasoningPolicyOutput": "UPDATE_AUTOMATED_REASONING_POLICY_OUTPUT", + "UpdateAutomatedReasoningPolicyTestCaseInput": "UPDATE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT", + "UpdateAutomatedReasoningPolicyTestCaseOutput": "UPDATE_AUTOMATED_REASONING_POLICY_TEST_CASE_OUTPUT", + "UpdateCustomModelDeploymentInput": "UPDATE_CUSTOM_MODEL_DEPLOYMENT_INPUT", + "UpdateCustomModelDeploymentOutput": "UPDATE_CUSTOM_MODEL_DEPLOYMENT_OUTPUT", + "UpdateGuardrailInput": "UPDATE_GUARDRAIL_INPUT", + "UpdateGuardrailOutput": "UPDATE_GUARDRAIL_OUTPUT", + "UpdateMarketplaceModelEndpointInput": "UPDATE_MARKETPLACE_MODEL_ENDPOINT_INPUT", + "UpdateMarketplaceModelEndpointOutput": "UPDATE_MARKETPLACE_MODEL_ENDPOINT_OUTPUT", + "UpdateProvisionedModelThroughputInput": "UPDATE_PROVISIONED_MODEL_THROUGHPUT_INPUT", + "UpdateProvisionedModelThroughputOutput": "UPDATE_PROVISIONED_MODEL_THROUGHPUT_OUTPUT", + "ValidationDataConfig": "VALIDATION_DATA_CONFIG", + "ValidationDetails": "VALIDATION_DETAILS", + "ValidationException": "VALIDATION_EXCEPTION", + "Validator": "VALIDATOR", + "ValidatorMetric": "VALIDATOR_METRIC", + "ValidityTerm": "VALIDITY_TERM", + "VectorSearchBedrockRerankingConfiguration": "VECTOR_SEARCH_BEDROCK_RERANKING_CONFIGURATION", + "VectorSearchBedrockRerankingModelConfiguration": "VECTOR_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION", + "VectorSearchRerankingConfiguration": "VECTOR_SEARCH_RERANKING_CONFIGURATION", + "VectorSearchRerankingConfigurationType": "VECTOR_SEARCH_RERANKING_CONFIGURATION_TYPE", + "VpcConfig": "VPC_CONFIG", + }, + shape_names=frozenset( + { + "AccessDeniedException", + "AccountEnforcedGuardrailInferenceInputConfiguration", + "AccountEnforcedGuardrailOutputConfiguration", + "AdvancedPromptOptimizationInputConfig", + "AdvancedPromptOptimizationJobStatus", + "AdvancedPromptOptimizationJobSummary", + "AdvancedPromptOptimizationOutputConfig", + "AgreementAvailability", + "AgreementStatus", + "ApplicationType", + "AttributeType", + "AuthorizationStatus", + "AutomatedEvaluationConfig", + "AutomatedEvaluationCustomMetricConfig", + "AutomatedEvaluationCustomMetricSource", + "AutomatedReasoningCheckFinding", + "AutomatedReasoningCheckImpossibleFinding", + "AutomatedReasoningCheckInputTextReference", + "AutomatedReasoningCheckInvalidFinding", + "AutomatedReasoningCheckLogicWarning", + "AutomatedReasoningCheckLogicWarningType", + "AutomatedReasoningCheckNoTranslationsFinding", + "AutomatedReasoningCheckResult", + "AutomatedReasoningCheckRule", + "AutomatedReasoningCheckSatisfiableFinding", + "AutomatedReasoningCheckScenario", + "AutomatedReasoningCheckTooComplexFinding", + "AutomatedReasoningCheckTranslation", + "AutomatedReasoningCheckTranslationAmbiguousFinding", + "AutomatedReasoningCheckTranslationOption", + "AutomatedReasoningCheckValidFinding", + "AutomatedReasoningLogicStatement", + "AutomatedReasoningPolicyAddRuleAnnotation", + "AutomatedReasoningPolicyAddRuleFromNaturalLanguageAnnotation", + "AutomatedReasoningPolicyAddRuleMutation", + "AutomatedReasoningPolicyAddTypeAnnotation", + "AutomatedReasoningPolicyAddTypeMutation", + "AutomatedReasoningPolicyAddTypeValue", + "AutomatedReasoningPolicyAddVariableAnnotation", + "AutomatedReasoningPolicyAddVariableMutation", + "AutomatedReasoningPolicyAnnotatedChunk", + "AutomatedReasoningPolicyAnnotatedContent", + "AutomatedReasoningPolicyAnnotatedLine", + "AutomatedReasoningPolicyAnnotation", + "AutomatedReasoningPolicyAnnotationStatus", + "AutomatedReasoningPolicyAtomicStatement", + "AutomatedReasoningPolicyBuildDocumentContentType", + "AutomatedReasoningPolicyBuildLog", + "AutomatedReasoningPolicyBuildLogEntry", + "AutomatedReasoningPolicyBuildMessageType", + "AutomatedReasoningPolicyBuildResultAssetManifest", + "AutomatedReasoningPolicyBuildResultAssetManifestEntry", + "AutomatedReasoningPolicyBuildResultAssetType", + "AutomatedReasoningPolicyBuildResultAssets", + "AutomatedReasoningPolicyBuildStep", + "AutomatedReasoningPolicyBuildStepContext", + "AutomatedReasoningPolicyBuildStepMessage", + "AutomatedReasoningPolicyBuildWorkflowDocument", + "AutomatedReasoningPolicyBuildWorkflowRepairContent", + "AutomatedReasoningPolicyBuildWorkflowSource", + "AutomatedReasoningPolicyBuildWorkflowStatus", + "AutomatedReasoningPolicyBuildWorkflowSummary", + "AutomatedReasoningPolicyBuildWorkflowType", + "AutomatedReasoningPolicyDefinition", + "AutomatedReasoningPolicyDefinitionElement", + "AutomatedReasoningPolicyDefinitionQualityReport", + "AutomatedReasoningPolicyDefinitionRule", + "AutomatedReasoningPolicyDefinitionType", + "AutomatedReasoningPolicyDefinitionTypeValue", + "AutomatedReasoningPolicyDefinitionTypeValuePair", + "AutomatedReasoningPolicyDefinitionVariable", + "AutomatedReasoningPolicyDeleteRuleAnnotation", + "AutomatedReasoningPolicyDeleteRuleMutation", + "AutomatedReasoningPolicyDeleteTypeAnnotation", + "AutomatedReasoningPolicyDeleteTypeMutation", + "AutomatedReasoningPolicyDeleteTypeValue", + "AutomatedReasoningPolicyDeleteVariableAnnotation", + "AutomatedReasoningPolicyDeleteVariableMutation", + "AutomatedReasoningPolicyDisjointRuleSet", + "AutomatedReasoningPolicyFidelityReport", + "AutomatedReasoningPolicyGenerateFidelityReportContent", + "AutomatedReasoningPolicyGeneratedTestCase", + "AutomatedReasoningPolicyGeneratedTestCases", + "AutomatedReasoningPolicyIngestContentAnnotation", + "AutomatedReasoningPolicyIterativeRefinementContent", + "AutomatedReasoningPolicyMutation", + "AutomatedReasoningPolicyPlanning", + "AutomatedReasoningPolicyReportSourceDocument", + "AutomatedReasoningPolicyRuleReport", + "AutomatedReasoningPolicyScenario", + "AutomatedReasoningPolicyScenarios", + "AutomatedReasoningPolicySourceDocument", + "AutomatedReasoningPolicyStatementLocation", + "AutomatedReasoningPolicyStatementReference", + "AutomatedReasoningPolicySummary", + "AutomatedReasoningPolicyTestCase", + "AutomatedReasoningPolicyTestResult", + "AutomatedReasoningPolicyTestRunResult", + "AutomatedReasoningPolicyTestRunStatus", + "AutomatedReasoningPolicyTypeValueAnnotation", + "AutomatedReasoningPolicyUpdateFromRuleFeedbackAnnotation", + "AutomatedReasoningPolicyUpdateFromScenarioFeedbackAnnotation", + "AutomatedReasoningPolicyUpdateRuleAnnotation", + "AutomatedReasoningPolicyUpdateRuleMutation", + "AutomatedReasoningPolicyUpdateTypeAnnotation", + "AutomatedReasoningPolicyUpdateTypeMutation", + "AutomatedReasoningPolicyUpdateTypeValue", + "AutomatedReasoningPolicyUpdateVariableAnnotation", + "AutomatedReasoningPolicyUpdateVariableMutation", + "AutomatedReasoningPolicyVariableReport", + "AutomatedReasoningPolicyWorkflowTypeContent", + "BatchDeleteAdvancedPromptOptimizationJobError", + "BatchDeleteAdvancedPromptOptimizationJobInput", + "BatchDeleteAdvancedPromptOptimizationJobItem", + "BatchDeleteAdvancedPromptOptimizationJobOutput", + "BatchDeleteEvaluationJobError", + "BatchDeleteEvaluationJobInput", + "BatchDeleteEvaluationJobItem", + "BatchDeleteEvaluationJobOutput", + "BedrockEvaluatorModel", + "ByteContentDoc", + "CancelAutomatedReasoningPolicyBuildWorkflowInput", + "CancelAutomatedReasoningPolicyBuildWorkflowOutput", + "CloudWatchConfig", + "CommitmentDuration", + "ConflictException", + "CreateAdvancedPromptOptimizationJobInput", + "CreateAdvancedPromptOptimizationJobOutput", + "CreateAutomatedReasoningPolicyInput", + "CreateAutomatedReasoningPolicyOutput", + "CreateAutomatedReasoningPolicyTestCaseInput", + "CreateAutomatedReasoningPolicyTestCaseOutput", + "CreateAutomatedReasoningPolicyVersionInput", + "CreateAutomatedReasoningPolicyVersionOutput", + "CreateCustomModelDeploymentInput", + "CreateCustomModelDeploymentOutput", + "CreateCustomModelInput", + "CreateCustomModelOutput", + "CreateEvaluationJobInput", + "CreateEvaluationJobOutput", + "CreateFoundationModelAgreementInput", + "CreateFoundationModelAgreementOutput", + "CreateGuardrailInput", + "CreateGuardrailOutput", + "CreateGuardrailVersionInput", + "CreateGuardrailVersionOutput", + "CreateInferenceProfileInput", + "CreateInferenceProfileOutput", + "CreateMarketplaceModelEndpointInput", + "CreateMarketplaceModelEndpointOutput", + "CreateModelCopyJobInput", + "CreateModelCopyJobOutput", + "CreateModelCustomizationJobInput", + "CreateModelCustomizationJobOutput", + "CreateModelImportJobInput", + "CreateModelImportJobOutput", + "CreateModelInvocationJobInput", + "CreateModelInvocationJobOutput", + "CreatePromptRouterInput", + "CreatePromptRouterOutput", + "CreateProvisionedModelThroughputInput", + "CreateProvisionedModelThroughputOutput", + "CustomMetricBedrockEvaluatorModel", + "CustomMetricDefinition", + "CustomMetricEvaluatorModelConfig", + "CustomModelDataSource", + "CustomModelDeploymentStatus", + "CustomModelDeploymentSummary", + "CustomModelDeploymentUpdateDetails", + "CustomModelDeploymentUpdateStatus", + "CustomModelSummary", + "CustomModelUnits", + "CustomizationConfig", + "CustomizationType", + "DataProcessingDetails", + "DataRetentionMode", + "DeleteAutomatedReasoningPolicyBuildWorkflowInput", + "DeleteAutomatedReasoningPolicyBuildWorkflowOutput", + "DeleteAutomatedReasoningPolicyInput", + "DeleteAutomatedReasoningPolicyOutput", + "DeleteAutomatedReasoningPolicyTestCaseInput", + "DeleteAutomatedReasoningPolicyTestCaseOutput", + "DeleteCustomModelDeploymentInput", + "DeleteCustomModelDeploymentOutput", + "DeleteCustomModelInput", + "DeleteCustomModelOutput", + "DeleteEnforcedGuardrailConfigurationInput", + "DeleteEnforcedGuardrailConfigurationOutput", + "DeleteFoundationModelAgreementInput", + "DeleteFoundationModelAgreementOutput", + "DeleteGuardrailInput", + "DeleteGuardrailOutput", + "DeleteImportedModelInput", + "DeleteImportedModelOutput", + "DeleteInferenceProfileInput", + "DeleteInferenceProfileOutput", + "DeleteMarketplaceModelEndpointInput", + "DeleteMarketplaceModelEndpointOutput", + "DeleteModelInvocationLoggingConfigurationInput", + "DeleteModelInvocationLoggingConfigurationOutput", + "DeletePromptRouterInput", + "DeletePromptRouterOutput", + "DeleteProvisionedModelThroughputInput", + "DeleteProvisionedModelThroughputOutput", + "DeleteResourcePolicyInput", + "DeleteResourcePolicyOutput", + "DeregisterMarketplaceModelEndpointInput", + "DeregisterMarketplaceModelEndpointOutput", + "DimensionalPriceRate", + "DistillationConfig", + "EndpointConfig", + "EntitlementAvailability", + "EvaluationBedrockModel", + "EvaluationConfig", + "EvaluationDataset", + "EvaluationDatasetLocation", + "EvaluationDatasetMetricConfig", + "EvaluationInferenceConfig", + "EvaluationInferenceConfigSummary", + "EvaluationJobStatus", + "EvaluationJobType", + "EvaluationModelConfig", + "EvaluationModelConfigSummary", + "EvaluationOutputDataConfig", + "EvaluationPrecomputedInferenceSource", + "EvaluationPrecomputedRagSourceConfig", + "EvaluationPrecomputedRetrieveAndGenerateSourceConfig", + "EvaluationPrecomputedRetrieveSourceConfig", + "EvaluationRagConfigSummary", + "EvaluationSummary", + "EvaluationTaskType", + "EvaluatorModelConfig", + "ExportAutomatedReasoningPolicyVersionInput", + "ExportAutomatedReasoningPolicyVersionOutput", + "ExternalSource", + "ExternalSourceType", + "ExternalSourcesGenerationConfiguration", + "ExternalSourcesRetrieveAndGenerateConfiguration", + "FieldForReranking", + "FilterAttribute", + "FineTuningJobStatus", + "FoundationModelDetails", + "FoundationModelLifecycle", + "FoundationModelLifecycleStatus", + "FoundationModelSummary", + "GenerationConfiguration", + "GetAccountDataRetentionInput", + "GetAccountDataRetentionOutput", + "GetAdvancedPromptOptimizationJobInput", + "GetAdvancedPromptOptimizationJobOutput", + "GetAutomatedReasoningPolicyAnnotationsInput", + "GetAutomatedReasoningPolicyAnnotationsOutput", + "GetAutomatedReasoningPolicyBuildWorkflowInput", + "GetAutomatedReasoningPolicyBuildWorkflowOutput", + "GetAutomatedReasoningPolicyBuildWorkflowResultAssetsInput", + "GetAutomatedReasoningPolicyBuildWorkflowResultAssetsOutput", + "GetAutomatedReasoningPolicyInput", + "GetAutomatedReasoningPolicyNextScenarioInput", + "GetAutomatedReasoningPolicyNextScenarioOutput", + "GetAutomatedReasoningPolicyOutput", + "GetAutomatedReasoningPolicyTestCaseInput", + "GetAutomatedReasoningPolicyTestCaseOutput", + "GetAutomatedReasoningPolicyTestResultInput", + "GetAutomatedReasoningPolicyTestResultOutput", + "GetCustomModelDeploymentInput", + "GetCustomModelDeploymentOutput", + "GetCustomModelInput", + "GetCustomModelOutput", + "GetEvaluationJobInput", + "GetEvaluationJobOutput", + "GetFoundationModelAvailabilityInput", + "GetFoundationModelAvailabilityOutput", + "GetFoundationModelInput", + "GetFoundationModelOutput", + "GetGuardrailInput", + "GetGuardrailOutput", + "GetImportedModelInput", + "GetImportedModelOutput", + "GetInferenceProfileInput", + "GetInferenceProfileOutput", + "GetMarketplaceModelEndpointInput", + "GetMarketplaceModelEndpointOutput", + "GetModelCopyJobInput", + "GetModelCopyJobOutput", + "GetModelCustomizationJobInput", + "GetModelCustomizationJobOutput", + "GetModelImportJobInput", + "GetModelImportJobOutput", + "GetModelInvocationJobInput", + "GetModelInvocationJobOutput", + "GetModelInvocationLoggingConfigurationInput", + "GetModelInvocationLoggingConfigurationOutput", + "GetPromptRouterInput", + "GetPromptRouterOutput", + "GetProvisionedModelThroughputInput", + "GetProvisionedModelThroughputOutput", + "GetResourcePolicyInput", + "GetResourcePolicyOutput", + "GetUseCaseForModelAccessInput", + "GetUseCaseForModelAccessOutput", + "GraderConfig", + "GuardrailAutomatedReasoningPolicy", + "GuardrailAutomatedReasoningPolicyConfig", + "GuardrailConfiguration", + "GuardrailContentFilter", + "GuardrailContentFilterAction", + "GuardrailContentFilterConfig", + "GuardrailContentFilterType", + "GuardrailContentFiltersTier", + "GuardrailContentFiltersTierConfig", + "GuardrailContentFiltersTierName", + "GuardrailContentPolicy", + "GuardrailContentPolicyConfig", + "GuardrailContextualGroundingAction", + "GuardrailContextualGroundingFilter", + "GuardrailContextualGroundingFilterConfig", + "GuardrailContextualGroundingFilterType", + "GuardrailContextualGroundingPolicy", + "GuardrailContextualGroundingPolicyConfig", + "GuardrailCrossRegionConfig", + "GuardrailCrossRegionDetails", + "GuardrailFilterStrength", + "GuardrailManagedWords", + "GuardrailManagedWordsConfig", + "GuardrailManagedWordsType", + "GuardrailModality", + "GuardrailPiiEntity", + "GuardrailPiiEntityConfig", + "GuardrailPiiEntityType", + "GuardrailRegex", + "GuardrailRegexConfig", + "GuardrailSensitiveInformationAction", + "GuardrailSensitiveInformationPolicy", + "GuardrailSensitiveInformationPolicyConfig", + "GuardrailStatus", + "GuardrailSummary", + "GuardrailTopic", + "GuardrailTopicAction", + "GuardrailTopicConfig", + "GuardrailTopicPolicy", + "GuardrailTopicPolicyConfig", + "GuardrailTopicType", + "GuardrailTopicsTier", + "GuardrailTopicsTierConfig", + "GuardrailTopicsTierName", + "GuardrailWord", + "GuardrailWordAction", + "GuardrailWordConfig", + "GuardrailWordPolicy", + "GuardrailWordPolicyConfig", + "HumanEvaluationConfig", + "HumanEvaluationCustomMetric", + "HumanWorkflowConfig", + "ImplicitFilterConfiguration", + "ImportedModelSummary", + "InferenceConfiguration", + "InferenceProfileModel", + "InferenceProfileModelSource", + "InferenceProfileStatus", + "InferenceProfileSummary", + "InferenceProfileType", + "InferenceType", + "InputTags", + "InternalServerException", + "InvocationLogSource", + "InvocationLogsConfig", + "JobStatusDetails", + "KbInferenceConfig", + "KnowledgeBaseConfig", + "KnowledgeBaseRetrievalConfiguration", + "KnowledgeBaseRetrieveAndGenerateConfiguration", + "KnowledgeBaseVectorSearchConfiguration", + "LambdaGraderConfig", + "LegalTerm", + "ListAdvancedPromptOptimizationJobsInput", + "ListAdvancedPromptOptimizationJobsOutput", + "ListAutomatedReasoningPoliciesInput", + "ListAutomatedReasoningPoliciesOutput", + "ListAutomatedReasoningPolicyBuildWorkflowsInput", + "ListAutomatedReasoningPolicyBuildWorkflowsOutput", + "ListAutomatedReasoningPolicyTestCasesInput", + "ListAutomatedReasoningPolicyTestCasesOutput", + "ListAutomatedReasoningPolicyTestResultsInput", + "ListAutomatedReasoningPolicyTestResultsOutput", + "ListCustomModelDeploymentsInput", + "ListCustomModelDeploymentsOutput", + "ListCustomModelsInput", + "ListCustomModelsOutput", + "ListEnforcedGuardrailsConfigurationInput", + "ListEnforcedGuardrailsConfigurationOutput", + "ListEvaluationJobsInput", + "ListEvaluationJobsOutput", + "ListFoundationModelAgreementOffersInput", + "ListFoundationModelAgreementOffersOutput", + "ListFoundationModelsInput", + "ListFoundationModelsOutput", + "ListGuardrailsInput", + "ListGuardrailsOutput", + "ListImportedModelsInput", + "ListImportedModelsOutput", + "ListInferenceProfilesInput", + "ListInferenceProfilesOutput", + "ListMarketplaceModelEndpointsInput", + "ListMarketplaceModelEndpointsOutput", + "ListModelCopyJobsInput", + "ListModelCopyJobsOutput", + "ListModelCustomizationJobsInput", + "ListModelCustomizationJobsOutput", + "ListModelImportJobsInput", + "ListModelImportJobsOutput", + "ListModelInvocationJobsInput", + "ListModelInvocationJobsOutput", + "ListPromptRoutersInput", + "ListPromptRoutersOutput", + "ListProvisionedModelThroughputsInput", + "ListProvisionedModelThroughputsOutput", + "ListTagsForResourceInput", + "ListTagsForResourceOutput", + "LoggingConfig", + "MarketplaceModelEndpoint", + "MarketplaceModelEndpointSummary", + "MetadataAttributeSchema", + "MetadataConfigurationForReranking", + "ModelConfiguration", + "ModelCopyJobStatus", + "ModelCopyJobSummary", + "ModelCustomization", + "ModelCustomizationJobStatus", + "ModelCustomizationJobSummary", + "ModelDataSource", + "ModelEnforcement", + "ModelImportJobStatus", + "ModelImportJobSummary", + "ModelInvocationJobInputDataConfig", + "ModelInvocationJobOutputDataConfig", + "ModelInvocationJobS3InputDataConfig", + "ModelInvocationJobS3OutputDataConfig", + "ModelInvocationJobStatus", + "ModelInvocationJobSummary", + "ModelInvocationType", + "ModelModality", + "ModelPackageArnDataSource", + "ModelStatus", + "Offer", + "OfferType", + "OrchestrationConfiguration", + "OutputDataConfig", + "PerformanceConfigLatency", + "PerformanceConfiguration", + "PricingTerm", + "PromptRouterStatus", + "PromptRouterSummary", + "PromptRouterTargetModel", + "PromptRouterType", + "PromptTemplate", + "ProvisionedModelStatus", + "ProvisionedModelSummary", + "PutAccountDataRetentionInput", + "PutAccountDataRetentionOutput", + "PutEnforcedGuardrailConfigurationInput", + "PutEnforcedGuardrailConfigurationOutput", + "PutModelInvocationLoggingConfigurationInput", + "PutModelInvocationLoggingConfigurationOutput", + "PutResourcePolicyInput", + "PutResourcePolicyOutput", + "PutUseCaseForModelAccessInput", + "PutUseCaseForModelAccessOutput", + "QueryTransformationConfiguration", + "QueryTransformationType", + "RAGConfig", + "RFTConfig", + "RFTHyperParameters", + "RatingScaleItem", + "RatingScaleItemValue", + "ReasoningEffort", + "RegionAvailability", + "RegisterMarketplaceModelEndpointInput", + "RegisterMarketplaceModelEndpointOutput", + "RequestMetadataBaseFilters", + "RequestMetadataFilters", + "RerankingMetadataSelectionMode", + "RerankingMetadataSelectiveModeConfiguration", + "ResourceInUseException", + "ResourceNotFoundException", + "RetrievalFilter", + "RetrieveAndGenerateConfiguration", + "RetrieveAndGenerateType", + "RetrieveConfig", + "RoutingCriteria", + "S3Config", + "S3DataSource", + "S3InputFormat", + "S3ObjectDoc", + "SageMakerEndpoint", + "SearchType", + "SelectiveContentGuarding", + "SelectiveGuardingMode", + "ServiceQuotaExceededException", + "ServiceUnavailableException", + "SortByProvisionedModels", + "SortJobsBy", + "SortModelsBy", + "SortOrder", + "StartAutomatedReasoningPolicyBuildWorkflowInput", + "StartAutomatedReasoningPolicyBuildWorkflowOutput", + "StartAutomatedReasoningPolicyTestWorkflowInput", + "StartAutomatedReasoningPolicyTestWorkflowOutput", + "Status", + "StatusDetails", + "StopAdvancedPromptOptimizationJobInput", + "StopAdvancedPromptOptimizationJobOutput", + "StopEvaluationJobInput", + "StopEvaluationJobOutput", + "StopModelCustomizationJobInput", + "StopModelCustomizationJobOutput", + "StopModelInvocationJobInput", + "StopModelInvocationJobOutput", + "SupportTerm", + "Tag", + "TagResourceInput", + "TagResourceOutput", + "TeacherModelConfig", + "TermDetails", + "TextInferenceConfig", + "ThrottlingException", + "TooManyTagsException", + "TrainingDataConfig", + "TrainingDetails", + "TrainingMetrics", + "UntagResourceInput", + "UntagResourceOutput", + "UpdateAutomatedReasoningPolicyAnnotationsInput", + "UpdateAutomatedReasoningPolicyAnnotationsOutput", + "UpdateAutomatedReasoningPolicyInput", + "UpdateAutomatedReasoningPolicyOutput", + "UpdateAutomatedReasoningPolicyTestCaseInput", + "UpdateAutomatedReasoningPolicyTestCaseOutput", + "UpdateCustomModelDeploymentInput", + "UpdateCustomModelDeploymentOutput", + "UpdateGuardrailInput", + "UpdateGuardrailOutput", + "UpdateMarketplaceModelEndpointInput", + "UpdateMarketplaceModelEndpointOutput", + "UpdateProvisionedModelThroughputInput", + "UpdateProvisionedModelThroughputOutput", + "ValidationDataConfig", + "ValidationDetails", + "ValidationException", + "Validator", + "ValidatorMetric", + "ValidityTerm", + "VectorSearchBedrockRerankingConfiguration", + "VectorSearchBedrockRerankingModelConfiguration", + "VectorSearchRerankingConfiguration", + "VectorSearchRerankingConfigurationType", + "VpcConfig", + } + ), + service_error="ServiceError", +) + + +def __getattr__(name: str): + return _registry.build(name) + + +BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB: APIOperation[ + BatchDeleteAdvancedPromptOptimizationJobInput, + BatchDeleteAdvancedPromptOptimizationJobOutput, +] = APIOperation( + static_schema=_SCHEMA_BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) + +CREATE_ADVANCED_PROMPT_OPTIMIZATION_JOB: APIOperation[ + CreateAdvancedPromptOptimizationJobInput, CreateAdvancedPromptOptimizationJobOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_ADVANCED_PROMPT_OPTIMIZATION_JOB, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#ConflictException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#TooManyTagsException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - fault: Literal["client", "server"] | None = "client" +GET_ADVANCED_PROMPT_OPTIMIZATION_JOB: APIOperation[ + GetAdvancedPromptOptimizationJobInput, GetAdvancedPromptOptimizationJobOutput +] = APIOperation( + static_schema=_SCHEMA_GET_ADVANCED_PROMPT_OPTIMIZATION_JOB, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACCESS_DENIED_EXCEPTION, self) +LIST_ADVANCED_PROMPT_OPTIMIZATION_JOBS: APIOperation[ + ListAdvancedPromptOptimizationJobsInput, ListAdvancedPromptOptimizationJobsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_ADVANCED_PROMPT_OPTIMIZATION_JOBS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_ACCESS_DENIED_EXCEPTION.members["message"], self.message - ) +STOP_ADVANCED_PROMPT_OPTIMIZATION_JOB: APIOperation[ + StopAdvancedPromptOptimizationJobInput, StopAdvancedPromptOptimizationJobOutput +] = APIOperation( + static_schema=_SCHEMA_STOP_ADVANCED_PROMPT_OPTIMIZATION_JOB, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#ConflictException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) +GET_USE_CASE_FOR_MODEL_ACCESS: APIOperation[ + GetUseCaseForModelAccessInput, GetUseCaseForModelAccessOutput +] = APIOperation( + static_schema=_SCHEMA_GET_USE_CASE_FOR_MODEL_ACCESS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +PUT_USE_CASE_FOR_MODEL_ACCESS: APIOperation[ + PutUseCaseForModelAccessInput, PutUseCaseForModelAccessOutput +] = APIOperation( + static_schema=_SCHEMA_PUT_USE_CASE_FOR_MODEL_ACCESS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_ACCESS_DENIED_EXCEPTION.members["message"] - ) +CANCEL_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW: APIOperation[ + CancelAutomatedReasoningPolicyBuildWorkflowInput, + CancelAutomatedReasoningPolicyBuildWorkflowOutput, +] = APIOperation( + static_schema=_SCHEMA_CANCEL_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - case _: - logger.debug("Unexpected member schema: %s", schema) +CREATE_AUTOMATED_REASONING_POLICY: APIOperation[ + CreateAutomatedReasoningPolicyInput, CreateAutomatedReasoningPolicyOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_AUTOMATED_REASONING_POLICY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#ConflictException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#TooManyTagsException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - deserializer.read_struct(_SCHEMA_ACCESS_DENIED_EXCEPTION, consumer=_consumer) - return kwargs +CREATE_AUTOMATED_REASONING_POLICY_TEST_CASE: APIOperation[ + CreateAutomatedReasoningPolicyTestCaseInput, + CreateAutomatedReasoningPolicyTestCaseOutput, +] = APIOperation( + static_schema=_SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_TEST_CASE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#ConflictException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) +CREATE_AUTOMATED_REASONING_POLICY_VERSION: APIOperation[ + CreateAutomatedReasoningPolicyVersionInput, + CreateAutomatedReasoningPolicyVersionOutput, +] = APIOperation( + static_schema=_SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_VERSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#ConflictException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#TooManyTagsException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) -def _serialize_excluded_models_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) +DELETE_AUTOMATED_REASONING_POLICY: APIOperation[ + DeleteAutomatedReasoningPolicyInput, DeleteAutomatedReasoningPolicyOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_AUTOMATED_REASONING_POLICY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#ConflictException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceInUseException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) +DELETE_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW: APIOperation[ + DeleteAutomatedReasoningPolicyBuildWorkflowInput, + DeleteAutomatedReasoningPolicyBuildWorkflowOutput, +] = APIOperation( + static_schema=_SCHEMA_DELETE_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#ConflictException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceInUseException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) -def _deserialize_excluded_models_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] +DELETE_AUTOMATED_REASONING_POLICY_TEST_CASE: APIOperation[ + DeleteAutomatedReasoningPolicyTestCaseInput, + DeleteAutomatedReasoningPolicyTestCaseOutput, +] = APIOperation( + static_schema=_SCHEMA_DELETE_AUTOMATED_REASONING_POLICY_TEST_CASE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#ConflictException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceInUseException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() +EXPORT_AUTOMATED_REASONING_POLICY_VERSION: APIOperation[ + ExportAutomatedReasoningPolicyVersionInput, + ExportAutomatedReasoningPolicyVersionOutput, +] = APIOperation( + static_schema=_SCHEMA_EXPORT_AUTOMATED_REASONING_POLICY_VERSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - else: - result.append(d.read_string(member_schema)) +GET_AUTOMATED_REASONING_POLICY: APIOperation[ + GetAutomatedReasoningPolicyInput, GetAutomatedReasoningPolicyOutput +] = APIOperation( + static_schema=_SCHEMA_GET_AUTOMATED_REASONING_POLICY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - deserializer.read_list(schema, _read_value) - return result +GET_AUTOMATED_REASONING_POLICY_ANNOTATIONS: APIOperation[ + GetAutomatedReasoningPolicyAnnotationsInput, + GetAutomatedReasoningPolicyAnnotationsOutput, +] = APIOperation( + static_schema=_SCHEMA_GET_AUTOMATED_REASONING_POLICY_ANNOTATIONS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) +GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW: APIOperation[ + GetAutomatedReasoningPolicyBuildWorkflowInput, + GetAutomatedReasoningPolicyBuildWorkflowOutput, +] = APIOperation( + static_schema=_SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) -def _serialize_included_models_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) +GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_RESULT_ASSETS: APIOperation[ + GetAutomatedReasoningPolicyBuildWorkflowResultAssetsInput, + GetAutomatedReasoningPolicyBuildWorkflowResultAssetsOutput, +] = APIOperation( + static_schema=_SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_RESULT_ASSETS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) +GET_AUTOMATED_REASONING_POLICY_NEXT_SCENARIO: APIOperation[ + GetAutomatedReasoningPolicyNextScenarioInput, + GetAutomatedReasoningPolicyNextScenarioOutput, +] = APIOperation( + static_schema=_SCHEMA_GET_AUTOMATED_REASONING_POLICY_NEXT_SCENARIO, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) -def _deserialize_included_models_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] +GET_AUTOMATED_REASONING_POLICY_TEST_CASE: APIOperation[ + GetAutomatedReasoningPolicyTestCaseInput, GetAutomatedReasoningPolicyTestCaseOutput +] = APIOperation( + static_schema=_SCHEMA_GET_AUTOMATED_REASONING_POLICY_TEST_CASE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() +GET_AUTOMATED_REASONING_POLICY_TEST_RESULT: APIOperation[ + GetAutomatedReasoningPolicyTestResultInput, + GetAutomatedReasoningPolicyTestResultOutput, +] = APIOperation( + static_schema=_SCHEMA_GET_AUTOMATED_REASONING_POLICY_TEST_RESULT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - else: - result.append(d.read_string(member_schema)) +LIST_AUTOMATED_REASONING_POLICIES: APIOperation[ + ListAutomatedReasoningPoliciesInput, ListAutomatedReasoningPoliciesOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_AUTOMATED_REASONING_POLICIES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - deserializer.read_list(schema, _read_value) - return result +LIST_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOWS: APIOperation[ + ListAutomatedReasoningPolicyBuildWorkflowsInput, + ListAutomatedReasoningPolicyBuildWorkflowsOutput, +] = APIOperation( + static_schema=_SCHEMA_LIST_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOWS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) +LIST_AUTOMATED_REASONING_POLICY_TEST_CASES: APIOperation[ + ListAutomatedReasoningPolicyTestCasesInput, + ListAutomatedReasoningPolicyTestCasesOutput, +] = APIOperation( + static_schema=_SCHEMA_LIST_AUTOMATED_REASONING_POLICY_TEST_CASES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) -@dataclass(kw_only=True) -class ModelEnforcement: - """Model-specific information for the enforced guardrail configuration.""" +LIST_AUTOMATED_REASONING_POLICY_TEST_RESULTS: APIOperation[ + ListAutomatedReasoningPolicyTestResultsInput, + ListAutomatedReasoningPolicyTestResultsOutput, +] = APIOperation( + static_schema=_SCHEMA_LIST_AUTOMATED_REASONING_POLICY_TEST_RESULTS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - included_models: list[str] - """Models to enforce the guardrail on.""" +START_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW: APIOperation[ + StartAutomatedReasoningPolicyBuildWorkflowInput, + StartAutomatedReasoningPolicyBuildWorkflowOutput, +] = APIOperation( + static_schema=_SCHEMA_START_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#ConflictException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceInUseException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - excluded_models: list[str] - """Models to exclude from enforcement of the guardrail.""" +START_AUTOMATED_REASONING_POLICY_TEST_WORKFLOW: APIOperation[ + StartAutomatedReasoningPolicyTestWorkflowInput, + StartAutomatedReasoningPolicyTestWorkflowOutput, +] = APIOperation( + static_schema=_SCHEMA_START_AUTOMATED_REASONING_POLICY_TEST_WORKFLOW, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceInUseException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MODEL_ENFORCEMENT, self) +UPDATE_AUTOMATED_REASONING_POLICY: APIOperation[ + UpdateAutomatedReasoningPolicyInput, UpdateAutomatedReasoningPolicyOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#ConflictException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#TooManyTagsException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - def serialize_members(self, serializer: ShapeSerializer): - _serialize_included_models_list( - serializer, - _SCHEMA_MODEL_ENFORCEMENT.members["includedModels"], - self.included_models, - ) - _serialize_excluded_models_list( - serializer, - _SCHEMA_MODEL_ENFORCEMENT.members["excludedModels"], - self.excluded_models, - ) +UPDATE_AUTOMATED_REASONING_POLICY_ANNOTATIONS: APIOperation[ + UpdateAutomatedReasoningPolicyAnnotationsInput, + UpdateAutomatedReasoningPolicyAnnotationsOutput, +] = APIOperation( + static_schema=_SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_ANNOTATIONS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#ConflictException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) +UPDATE_AUTOMATED_REASONING_POLICY_TEST_CASE: APIOperation[ + UpdateAutomatedReasoningPolicyTestCaseInput, + UpdateAutomatedReasoningPolicyTestCaseOutput, +] = APIOperation( + static_schema=_SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_TEST_CASE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#ConflictException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceInUseException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +CREATE_MARKETPLACE_MODEL_ENDPOINT: APIOperation[ + CreateMarketplaceModelEndpointInput, CreateMarketplaceModelEndpointOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_MARKETPLACE_MODEL_ENDPOINT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#ConflictException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["included_models"] = _deserialize_included_models_list( - de, _SCHEMA_MODEL_ENFORCEMENT.members["includedModels"] - ) +DELETE_MARKETPLACE_MODEL_ENDPOINT: APIOperation[ + DeleteMarketplaceModelEndpointInput, DeleteMarketplaceModelEndpointOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_MARKETPLACE_MODEL_ENDPOINT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - case 1: - kwargs["excluded_models"] = _deserialize_excluded_models_list( - de, _SCHEMA_MODEL_ENFORCEMENT.members["excludedModels"] - ) +DEREGISTER_MARKETPLACE_MODEL_ENDPOINT: APIOperation[ + DeregisterMarketplaceModelEndpointInput, DeregisterMarketplaceModelEndpointOutput +] = APIOperation( + static_schema=_SCHEMA_DEREGISTER_MARKETPLACE_MODEL_ENDPOINT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ServiceUnavailableException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - case _: - logger.debug("Unexpected member schema: %s", schema) +GET_MARKETPLACE_MODEL_ENDPOINT: APIOperation[ + GetMarketplaceModelEndpointInput, GetMarketplaceModelEndpointOutput +] = APIOperation( + static_schema=_SCHEMA_GET_MARKETPLACE_MODEL_ENDPOINT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - deserializer.read_struct(_SCHEMA_MODEL_ENFORCEMENT, consumer=_consumer) - if "included_models" not in kwargs: - kwargs["included_models"] = [] - if "excluded_models" not in kwargs: - kwargs["excluded_models"] = [] - return kwargs +LIST_MARKETPLACE_MODEL_ENDPOINTS: APIOperation[ + ListMarketplaceModelEndpointsInput, ListMarketplaceModelEndpointsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_MARKETPLACE_MODEL_ENDPOINTS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) +REGISTER_MARKETPLACE_MODEL_ENDPOINT: APIOperation[ + RegisterMarketplaceModelEndpointInput, RegisterMarketplaceModelEndpointOutput +] = APIOperation( + static_schema=_SCHEMA_REGISTER_MARKETPLACE_MODEL_ENDPOINT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ServiceUnavailableException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) -class SelectiveGuardingMode(UnknownEnumMixin, StrEnum): - SELECTIVE = "SELECTIVE" - COMPREHENSIVE = "COMPREHENSIVE" +UPDATE_MARKETPLACE_MODEL_ENDPOINT: APIOperation[ + UpdateMarketplaceModelEndpointInput, UpdateMarketplaceModelEndpointOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_MARKETPLACE_MODEL_ENDPOINT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#ConflictException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) +CREATE_CUSTOM_MODEL_DEPLOYMENT: APIOperation[ + CreateCustomModelDeploymentInput, CreateCustomModelDeploymentOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_CUSTOM_MODEL_DEPLOYMENT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#TooManyTagsException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) -@dataclass(kw_only=True) -class SelectiveContentGuarding: - """Selective content guarding controls for enforced guardrails.""" +DELETE_CUSTOM_MODEL_DEPLOYMENT: APIOperation[ + DeleteCustomModelDeploymentInput, DeleteCustomModelDeploymentOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_CUSTOM_MODEL_DEPLOYMENT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#ConflictException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - system: str | None = None - """Selective guarding mode for system prompts.\"""" +GET_CUSTOM_MODEL_DEPLOYMENT: APIOperation[ + GetCustomModelDeploymentInput, GetCustomModelDeploymentOutput +] = APIOperation( + static_schema=_SCHEMA_GET_CUSTOM_MODEL_DEPLOYMENT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - messages: str | None = None - """Selective guarding mode for user messages.""" +LIST_CUSTOM_MODEL_DEPLOYMENTS: APIOperation[ + ListCustomModelDeploymentsInput, ListCustomModelDeploymentsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_CUSTOM_MODEL_DEPLOYMENTS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SELECTIVE_CONTENT_GUARDING, self) +UPDATE_CUSTOM_MODEL_DEPLOYMENT: APIOperation[ + UpdateCustomModelDeploymentInput, UpdateCustomModelDeploymentOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_CUSTOM_MODEL_DEPLOYMENT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - def serialize_members(self, serializer: ShapeSerializer): - if self.system is not None: - serializer.write_string( - _SCHEMA_SELECTIVE_CONTENT_GUARDING.members["system"], self.system - ) +CREATE_CUSTOM_MODEL: APIOperation[CreateCustomModelInput, CreateCustomModelOutput] = ( + APIOperation( + static_schema=_SCHEMA_CREATE_CUSTOM_MODEL, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#ConflictException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#TooManyTagsException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], + ) +) - if self.messages is not None: - serializer.write_string( - _SCHEMA_SELECTIVE_CONTENT_GUARDING.members["messages"], self.messages - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["system"] = SelectiveGuardingMode( - de.read_string( - _SCHEMA_SELECTIVE_CONTENT_GUARDING.members["system"] - ) - ) - - case 1: - kwargs["messages"] = SelectiveGuardingMode( - de.read_string( - _SCHEMA_SELECTIVE_CONTENT_GUARDING.members["messages"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SELECTIVE_CONTENT_GUARDING, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class AccountEnforcedGuardrailInferenceInputConfiguration: - """Account-level enforced guardrail input configuration.""" - - guardrail_identifier: str - """Identifier for the guardrail, could be the ID or the ARN.""" - - guardrail_version: str - """Numerical guardrail version.""" - - selective_content_guarding: SelectiveContentGuarding | None = None - """Selective content guarding controls for enforced guardrails.""" - - model_enforcement: ModelEnforcement | None = None - """ - Model-specific information for the enforced guardrail configuration. If - not present, the configuration is enforced on all models - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_ACCOUNT_ENFORCED_GUARDRAIL_INFERENCE_INPUT_CONFIGURATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_ACCOUNT_ENFORCED_GUARDRAIL_INFERENCE_INPUT_CONFIGURATION.members[ - "guardrailIdentifier" - ], - self.guardrail_identifier, - ) - serializer.write_string( - _SCHEMA_ACCOUNT_ENFORCED_GUARDRAIL_INFERENCE_INPUT_CONFIGURATION.members[ - "guardrailVersion" - ], - self.guardrail_version, - ) - if self.selective_content_guarding is not None: - serializer.write_struct( - _SCHEMA_ACCOUNT_ENFORCED_GUARDRAIL_INFERENCE_INPUT_CONFIGURATION.members[ - "selectiveContentGuarding" - ], - self.selective_content_guarding, - ) - - if self.model_enforcement is not None: - serializer.write_struct( - _SCHEMA_ACCOUNT_ENFORCED_GUARDRAIL_INFERENCE_INPUT_CONFIGURATION.members[ - "modelEnforcement" - ], - self.model_enforcement, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["guardrail_identifier"] = de.read_string( - _SCHEMA_ACCOUNT_ENFORCED_GUARDRAIL_INFERENCE_INPUT_CONFIGURATION.members[ - "guardrailIdentifier" - ] - ) - - case 1: - kwargs["guardrail_version"] = de.read_string( - _SCHEMA_ACCOUNT_ENFORCED_GUARDRAIL_INFERENCE_INPUT_CONFIGURATION.members[ - "guardrailVersion" - ] - ) - - case 2: - kwargs["selective_content_guarding"] = ( - SelectiveContentGuarding.deserialize(de) - ) - - case 3: - kwargs["model_enforcement"] = ModelEnforcement.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ACCOUNT_ENFORCED_GUARDRAIL_INFERENCE_INPUT_CONFIGURATION, - consumer=_consumer, - ) - if "guardrail_identifier" not in kwargs: - kwargs["guardrail_identifier"] = "" - if "guardrail_version" not in kwargs: - kwargs["guardrail_version"] = "" - return kwargs - - -class InputTags(UnknownEnumMixin, StrEnum): - HONOR = "HONOR" - IGNORE = "IGNORE" - - -@dataclass(kw_only=True) -class AccountEnforcedGuardrailOutputConfiguration: - """Account enforced guardrail output configuration.""" - - config_id: str | None = None - """Unique ID for the account enforced configuration.""" - - guardrail_arn: str | None = None - """ARN representation for the guardrail.""" - - guardrail_id: str | None = None - """Unique ID for the guardrail.""" - - input_tags: str | None = None - """Whether to honor or ignore input tags at runtime.""" - - selective_content_guarding: SelectiveContentGuarding | None = None - """Selective content guarding controls for enforced guardrails.""" - - guardrail_version: str | None = None - """Numerical guardrail version.""" - - created_at: datetime | None = None - """Timestamp.""" - - created_by: str | None = None - """The ARN of the role used to update the configuration.""" - - updated_at: datetime | None = None - """Timestamp.""" - - updated_by: str | None = None - """The ARN of the role used to update the configuration.""" - - owner: str | None = None - """Configuration owner type.""" - - model_enforcement: ModelEnforcement | None = None - """Model-specific information for the enforced guardrail configuration.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_ACCOUNT_ENFORCED_GUARDRAIL_OUTPUT_CONFIGURATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.config_id is not None: - serializer.write_string( - _SCHEMA_ACCOUNT_ENFORCED_GUARDRAIL_OUTPUT_CONFIGURATION.members[ - "configId" - ], - self.config_id, - ) - - if self.guardrail_arn is not None: - serializer.write_string( - _SCHEMA_ACCOUNT_ENFORCED_GUARDRAIL_OUTPUT_CONFIGURATION.members[ - "guardrailArn" - ], - self.guardrail_arn, - ) - - if self.guardrail_id is not None: - serializer.write_string( - _SCHEMA_ACCOUNT_ENFORCED_GUARDRAIL_OUTPUT_CONFIGURATION.members[ - "guardrailId" - ], - self.guardrail_id, - ) - - if self.input_tags is not None: - serializer.write_string( - _SCHEMA_ACCOUNT_ENFORCED_GUARDRAIL_OUTPUT_CONFIGURATION.members[ - "inputTags" - ], - self.input_tags, - ) - - if self.selective_content_guarding is not None: - serializer.write_struct( - _SCHEMA_ACCOUNT_ENFORCED_GUARDRAIL_OUTPUT_CONFIGURATION.members[ - "selectiveContentGuarding" - ], - self.selective_content_guarding, - ) - - if self.guardrail_version is not None: - serializer.write_string( - _SCHEMA_ACCOUNT_ENFORCED_GUARDRAIL_OUTPUT_CONFIGURATION.members[ - "guardrailVersion" - ], - self.guardrail_version, - ) - - if self.created_at is not None: - serializer.write_timestamp( - _SCHEMA_ACCOUNT_ENFORCED_GUARDRAIL_OUTPUT_CONFIGURATION.members[ - "createdAt" - ], - self.created_at, - ) - - if self.created_by is not None: - serializer.write_string( - _SCHEMA_ACCOUNT_ENFORCED_GUARDRAIL_OUTPUT_CONFIGURATION.members[ - "createdBy" - ], - self.created_by, - ) - - if self.updated_at is not None: - serializer.write_timestamp( - _SCHEMA_ACCOUNT_ENFORCED_GUARDRAIL_OUTPUT_CONFIGURATION.members[ - "updatedAt" - ], - self.updated_at, - ) - - if self.updated_by is not None: - serializer.write_string( - _SCHEMA_ACCOUNT_ENFORCED_GUARDRAIL_OUTPUT_CONFIGURATION.members[ - "updatedBy" - ], - self.updated_by, - ) - - if self.owner is not None: - serializer.write_string( - _SCHEMA_ACCOUNT_ENFORCED_GUARDRAIL_OUTPUT_CONFIGURATION.members[ - "owner" - ], - self.owner, - ) - - if self.model_enforcement is not None: - serializer.write_struct( - _SCHEMA_ACCOUNT_ENFORCED_GUARDRAIL_OUTPUT_CONFIGURATION.members[ - "modelEnforcement" - ], - self.model_enforcement, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["config_id"] = de.read_string( - _SCHEMA_ACCOUNT_ENFORCED_GUARDRAIL_OUTPUT_CONFIGURATION.members[ - "configId" - ] - ) - - case 1: - kwargs["guardrail_arn"] = de.read_string( - _SCHEMA_ACCOUNT_ENFORCED_GUARDRAIL_OUTPUT_CONFIGURATION.members[ - "guardrailArn" - ] - ) - - case 2: - kwargs["guardrail_id"] = de.read_string( - _SCHEMA_ACCOUNT_ENFORCED_GUARDRAIL_OUTPUT_CONFIGURATION.members[ - "guardrailId" - ] - ) - - case 3: - kwargs["input_tags"] = InputTags( - de.read_string( - _SCHEMA_ACCOUNT_ENFORCED_GUARDRAIL_OUTPUT_CONFIGURATION.members[ - "inputTags" - ] - ) - ) - - case 4: - kwargs["selective_content_guarding"] = ( - SelectiveContentGuarding.deserialize(de) - ) - - case 5: - kwargs["guardrail_version"] = de.read_string( - _SCHEMA_ACCOUNT_ENFORCED_GUARDRAIL_OUTPUT_CONFIGURATION.members[ - "guardrailVersion" - ] - ) - - case 6: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_ACCOUNT_ENFORCED_GUARDRAIL_OUTPUT_CONFIGURATION.members[ - "createdAt" - ] - ) - - case 7: - kwargs["created_by"] = de.read_string( - _SCHEMA_ACCOUNT_ENFORCED_GUARDRAIL_OUTPUT_CONFIGURATION.members[ - "createdBy" - ] - ) - - case 8: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_ACCOUNT_ENFORCED_GUARDRAIL_OUTPUT_CONFIGURATION.members[ - "updatedAt" - ] - ) - - case 9: - kwargs["updated_by"] = de.read_string( - _SCHEMA_ACCOUNT_ENFORCED_GUARDRAIL_OUTPUT_CONFIGURATION.members[ - "updatedBy" - ] - ) - - case 10: - kwargs["owner"] = de.read_string( - _SCHEMA_ACCOUNT_ENFORCED_GUARDRAIL_OUTPUT_CONFIGURATION.members[ - "owner" - ] - ) - - case 11: - kwargs["model_enforcement"] = ModelEnforcement.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ACCOUNT_ENFORCED_GUARDRAIL_OUTPUT_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -def _serialize_account_enforced_guardrails_output_configuration( - serializer: ShapeSerializer, - schema: Schema, - value: list[AccountEnforcedGuardrailOutputConfiguration], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_account_enforced_guardrails_output_configuration( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AccountEnforcedGuardrailOutputConfiguration]: - result: list[AccountEnforcedGuardrailOutputConfiguration] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AccountEnforcedGuardrailOutputConfiguration.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_additional_model_request_fields( - serializer: ShapeSerializer, schema: Schema, value: dict[str, Document] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_document(value_schema, v)) - - -def _deserialize_additional_model_request_fields( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, Document]: - result: dict[str, Document] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_document(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AdvancedPromptOptimizationInputConfig: - """ - Contains the input data configuration for an advanced prompt - optimization job. - """ - - s3_uri: str - """ - The S3 URI of the JSONL input file containing prompt templates and - evaluation samples. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ADVANCED_PROMPT_OPTIMIZATION_INPUT_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_ADVANCED_PROMPT_OPTIMIZATION_INPUT_CONFIG.members["s3Uri"], - self.s3_uri, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["s3_uri"] = de.read_string( - _SCHEMA_ADVANCED_PROMPT_OPTIMIZATION_INPUT_CONFIG.members[ - "s3Uri" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ADVANCED_PROMPT_OPTIMIZATION_INPUT_CONFIG, consumer=_consumer - ) - if "s3_uri" not in kwargs: - kwargs["s3_uri"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(s3_uri="") - - -def _serialize_advanced_prompt_optimization_job_identifiers( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_advanced_prompt_optimization_job_identifiers( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class BatchDeleteAdvancedPromptOptimizationJobInput: - """Batch Delete Advanced Prompt Optimization Jobs Request""" - - job_identifiers: list[str] | None = None - """ - A list of advanced prompt optimization job identifiers (ARNs or IDs) to - delete. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.job_identifiers is not None: - _serialize_advanced_prompt_optimization_job_identifiers( - serializer, - _SCHEMA_BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT.members[ - "jobIdentifiers" - ], - self.job_identifiers, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["job_identifiers"] = ( - _deserialize_advanced_prompt_optimization_job_identifiers( - de, - _SCHEMA_BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT.members[ - "jobIdentifiers" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT, - consumer=_consumer, - ) - return kwargs - - -class AdvancedPromptOptimizationJobStatus(UnknownEnumMixin, StrEnum): - """The status of an advanced prompt optimization job.""" - - IN_PROGRESS = "InProgress" - COMPLETED = "Completed" - FAILED = "Failed" - PARTIALLY_COMPLETED = "PartiallyCompleted" - STOPPING = "Stopping" - STOPPED = "Stopped" - DELETING = "Deleting" - - -@dataclass(kw_only=True) -class BatchDeleteAdvancedPromptOptimizationJobItem: - """ - Contains information about a successfully deleted advanced prompt - optimization job. - """ - - job_identifier: str - """The identifier of the deleted job.""" - - job_status: str - """The status of the deleted job.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_ITEM, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_ITEM.members[ - "jobIdentifier" - ], - self.job_identifier, - ) - serializer.write_string( - _SCHEMA_BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_ITEM.members[ - "jobStatus" - ], - self.job_status, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["job_identifier"] = de.read_string( - _SCHEMA_BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_ITEM.members[ - "jobIdentifier" - ] - ) - - case 1: - kwargs["job_status"] = AdvancedPromptOptimizationJobStatus( - de.read_string( - _SCHEMA_BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_ITEM.members[ - "jobStatus" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_ITEM, - consumer=_consumer, - ) - if "job_identifier" not in kwargs: - kwargs["job_identifier"] = "" - if "job_status" not in kwargs: - kwargs["job_status"] = AdvancedPromptOptimizationJobStatus._corrected("") - return kwargs - - -def _serialize_batch_delete_advanced_prompt_optimization_job_items( - serializer: ShapeSerializer, - schema: Schema, - value: list[BatchDeleteAdvancedPromptOptimizationJobItem], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_batch_delete_advanced_prompt_optimization_job_items( - deserializer: ShapeDeserializer, schema: Schema -) -> list[BatchDeleteAdvancedPromptOptimizationJobItem]: - result: list[BatchDeleteAdvancedPromptOptimizationJobItem] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(BatchDeleteAdvancedPromptOptimizationJobItem.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class BatchDeleteAdvancedPromptOptimizationJobError: - """ - Contains information about an error that occurred when deleting an - advanced prompt optimization job. - """ - - job_identifier: str - """The identifier of the job that could not be deleted.""" - - code: str - """The error code for the deletion failure.""" - - message: str | None = None - """A message describing the error.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_ERROR, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_ERROR.members[ - "jobIdentifier" - ], - self.job_identifier, - ) - serializer.write_string( - _SCHEMA_BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_ERROR.members["code"], - self.code, - ) - if self.message is not None: - serializer.write_string( - _SCHEMA_BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_ERROR.members[ - "message" - ], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["job_identifier"] = de.read_string( - _SCHEMA_BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_ERROR.members[ - "jobIdentifier" - ] - ) - - case 1: - kwargs["code"] = de.read_string( - _SCHEMA_BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_ERROR.members[ - "code" - ] - ) - - case 2: - kwargs["message"] = de.read_string( - _SCHEMA_BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_ERROR.members[ - "message" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_ERROR, - consumer=_consumer, - ) - if "job_identifier" not in kwargs: - kwargs["job_identifier"] = "" - if "code" not in kwargs: - kwargs["code"] = "" - return kwargs - - -def _serialize_batch_delete_advanced_prompt_optimization_job_errors( - serializer: ShapeSerializer, - schema: Schema, - value: list[BatchDeleteAdvancedPromptOptimizationJobError], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_batch_delete_advanced_prompt_optimization_job_errors( - deserializer: ShapeDeserializer, schema: Schema -) -> list[BatchDeleteAdvancedPromptOptimizationJobError]: - result: list[BatchDeleteAdvancedPromptOptimizationJobError] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(BatchDeleteAdvancedPromptOptimizationJobError.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class BatchDeleteAdvancedPromptOptimizationJobOutput: - """Batch Delete Advanced Prompt Optimization Jobs Response""" - - errors: list[BatchDeleteAdvancedPromptOptimizationJobError] - """A list of errors encountered during batch deletion.""" - - advanced_prompt_optimization_jobs: list[ - BatchDeleteAdvancedPromptOptimizationJobItem - ] - """A list of successfully deleted advanced prompt optimization jobs.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False +DELETE_CUSTOM_MODEL: APIOperation[DeleteCustomModelInput, DeleteCustomModelOutput] = ( + APIOperation( + static_schema=_SCHEMA_DELETE_CUSTOM_MODEL, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#ConflictException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_batch_delete_advanced_prompt_optimization_job_errors( - serializer, - _SCHEMA_BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT.members[ - "errors" - ], - self.errors, - ) - _serialize_batch_delete_advanced_prompt_optimization_job_items( - serializer, - _SCHEMA_BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT.members[ - "advancedPromptOptimizationJobs" - ], - self.advanced_prompt_optimization_jobs, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["errors"] = ( - _deserialize_batch_delete_advanced_prompt_optimization_job_errors( - de, - _SCHEMA_BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT.members[ - "errors" - ], - ) - ) - - case 1: - kwargs["advanced_prompt_optimization_jobs"] = ( - _deserialize_batch_delete_advanced_prompt_optimization_job_items( - de, - _SCHEMA_BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT.members[ - "advancedPromptOptimizationJobs" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT, - consumer=_consumer, - ) - if "errors" not in kwargs: - kwargs["errors"] = [] - if "advanced_prompt_optimization_jobs" not in kwargs: - kwargs["advanced_prompt_optimization_jobs"] = [] - return kwargs - - -@dataclass(kw_only=True) -class InternalServerException(ServiceError): - """An internal server error occurred. Retry your request.""" - - fault: Literal["client", "server"] | None = "server" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INTERNAL_SERVER_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INTERNAL_SERVER_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INTERNAL_SERVER_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INTERNAL_SERVER_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ThrottlingException(ServiceError): - """The number of requests exceeds the limit. Resubmit your request later.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_THROTTLING_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_THROTTLING_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_THROTTLING_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_THROTTLING_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ValidationException(ServiceError): - """ - Input validation failed. Check your request parameters and retry the - request. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VALIDATION_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_VALIDATION_EXCEPTION.members["message"], self.message - ) +) - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) +GET_CUSTOM_MODEL: APIOperation[GetCustomModelInput, GetCustomModelOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_CUSTOM_MODEL, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], + ) +) - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +LIST_CUSTOM_MODELS: APIOperation[ListCustomModelsInput, ListCustomModelsOutput] = ( + APIOperation( + static_schema=_SCHEMA_LIST_CUSTOM_MODELS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], + ) +) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_VALIDATION_EXCEPTION.members["message"] - ) +GET_ACCOUNT_DATA_RETENTION: APIOperation[ + GetAccountDataRetentionInput, GetAccountDataRetentionOutput +] = APIOperation( + static_schema=_SCHEMA_GET_ACCOUNT_DATA_RETENTION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - case _: - logger.debug("Unexpected member schema: %s", schema) +PUT_ACCOUNT_DATA_RETENTION: APIOperation[ + PutAccountDataRetentionInput, PutAccountDataRetentionOutput +] = APIOperation( + static_schema=_SCHEMA_PUT_ACCOUNT_DATA_RETENTION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - deserializer.read_struct(_SCHEMA_VALIDATION_EXCEPTION, consumer=_consumer) - return kwargs +DELETE_ENFORCED_GUARDRAIL_CONFIGURATION: APIOperation[ + DeleteEnforcedGuardrailConfigurationInput, + DeleteEnforcedGuardrailConfigurationOutput, +] = APIOperation( + static_schema=_SCHEMA_DELETE_ENFORCED_GUARDRAIL_CONFIGURATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) +LIST_ENFORCED_GUARDRAILS_CONFIGURATION: APIOperation[ + ListEnforcedGuardrailsConfigurationInput, ListEnforcedGuardrailsConfigurationOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_ENFORCED_GUARDRAILS_CONFIGURATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) -BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB = APIOperation( - input=BatchDeleteAdvancedPromptOptimizationJobInput, - output=BatchDeleteAdvancedPromptOptimizationJobOutput, - schema=_SCHEMA_BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB, - input_schema=_SCHEMA_BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT, - output_schema=_SCHEMA_BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), +PUT_ENFORCED_GUARDRAIL_CONFIGURATION: APIOperation[ + PutEnforcedGuardrailConfigurationInput, PutEnforcedGuardrailConfigurationOutput +] = APIOperation( + static_schema=_SCHEMA_PUT_ENFORCED_GUARDRAIL_CONFIGURATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#ConflictException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], effective_auth_schemes=[ ShapeID("aws.auth#sigv4"), ShapeID("smithy.api#httpBearerAuth"), ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, +) + +BATCH_DELETE_EVALUATION_JOB: APIOperation[ + BatchDeleteEvaluationJobInput, BatchDeleteEvaluationJobOutput +] = APIOperation( + static_schema=_SCHEMA_BATCH_DELETE_EVALUATION_JOB, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#ConflictException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), ], ) +LIST_EVALUATION_JOBS: APIOperation[ + ListEvaluationJobsInput, ListEvaluationJobsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_EVALUATION_JOBS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) -@dataclass(kw_only=True) -class ConflictException(ServiceError): - """Error occurred because of a conflict while performing an operation.""" +STOP_EVALUATION_JOB: APIOperation[StopEvaluationJobInput, StopEvaluationJobOutput] = ( + APIOperation( + static_schema=_SCHEMA_STOP_EVALUATION_JOB, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#ConflictException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], + ) +) - fault: Literal["client", "server"] | None = "client" +CREATE_GUARDRAIL: APIOperation[CreateGuardrailInput, CreateGuardrailOutput] = ( + APIOperation( + static_schema=_SCHEMA_CREATE_GUARDRAIL, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#ConflictException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#TooManyTagsException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], + ) +) - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONFLICT_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_CONFLICT_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_CONFLICT_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONFLICT_EXCEPTION, consumer=_consumer) - return kwargs - - -def _serialize_non_empty_string_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_non_empty_string_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class InferenceConfiguration: - """ - Base inference parameters to pass to a model. For more information, see - [Inference parameters for foundation - models](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). - """ - - max_tokens: int | None = None - """ - The maximum number of tokens to allow in the generated response. The - default value is the maximum allowed value for the model that you are - using. - """ - - temperature: float | None = None - """ - The likelihood of the model selecting higher-probability options while - generating a response. A lower value makes the model more likely to - choose higher-probability options, while a higher value makes the model - more likely to choose lower-probability options. - """ - - top_p: float | None = None - """ - The percentage of most-likely candidates that the model considers for - the next token. For example, if you choose a value of 0.8 for `topP`, - the model selects from the top 80% of the probability distribution of - tokens that could be next in the sequence. - """ - - stop_sequences: list[str] | None = None - """ - A list of stop sequences. A stop sequence is a sequence of characters - that causes the model to stop generating the response. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INFERENCE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.max_tokens is not None: - serializer.write_integer( - _SCHEMA_INFERENCE_CONFIGURATION.members["maxTokens"], self.max_tokens - ) - - if self.temperature is not None: - serializer.write_float( - _SCHEMA_INFERENCE_CONFIGURATION.members["temperature"], self.temperature - ) - - if self.top_p is not None: - serializer.write_float( - _SCHEMA_INFERENCE_CONFIGURATION.members["topP"], self.top_p - ) - - if self.stop_sequences is not None: - _serialize_non_empty_string_list( - serializer, - _SCHEMA_INFERENCE_CONFIGURATION.members["stopSequences"], - self.stop_sequences, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["max_tokens"] = de.read_integer( - _SCHEMA_INFERENCE_CONFIGURATION.members["maxTokens"] - ) - - case 1: - kwargs["temperature"] = de.read_float( - _SCHEMA_INFERENCE_CONFIGURATION.members["temperature"] - ) - - case 2: - kwargs["top_p"] = de.read_float( - _SCHEMA_INFERENCE_CONFIGURATION.members["topP"] - ) - - case 3: - kwargs["stop_sequences"] = _deserialize_non_empty_string_list( - de, _SCHEMA_INFERENCE_CONFIGURATION.members["stopSequences"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INFERENCE_CONFIGURATION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ModelConfiguration: - """ - Contains the configuration for a model used in an advanced prompt - optimization job, including the model ID and inference parameters. - """ - - model_id: str - """ - The model to use for optimization. The value depends on the resource - that you use: - - - If you use a base model, specify the model ID or its ARN. For a list - of model IDs, see [Models at a - glance](https://docs.aws.amazon.com/bedrock/latest/userguide/model-cards.html) - in the Amazon Bedrock User Guide. - - - If you use a cross-Region (system-defined) inference profile, specify - the inference profile ID or its ARN. For a list of inference profile - IDs, see [Supported Regions and models for inference - profiles](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference-support.html) - in the Amazon Bedrock User Guide. - - - If you use an application inference profile, specify its full ARN, - including the account ID and Region. - """ - - inference_config: InferenceConfiguration | None = None - """ - The inference configuration for the model, including parameters such as - maximum tokens, temperature, and top-p. - """ - - additional_model_request_fields: dict[str, Document] | None = None - """ - Additional model request fields. Use this to pass model-specific - parameters that are not included in the standard inference - configuration. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MODEL_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MODEL_CONFIGURATION.members["modelId"], self.model_id - ) - if self.inference_config is not None: - serializer.write_struct( - _SCHEMA_MODEL_CONFIGURATION.members["inferenceConfig"], - self.inference_config, - ) - - if self.additional_model_request_fields is not None: - _serialize_additional_model_request_fields( - serializer, - _SCHEMA_MODEL_CONFIGURATION.members["additionalModelRequestFields"], - self.additional_model_request_fields, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_id"] = de.read_string( - _SCHEMA_MODEL_CONFIGURATION.members["modelId"] - ) - - case 1: - kwargs["inference_config"] = InferenceConfiguration.deserialize(de) - - case 2: - kwargs["additional_model_request_fields"] = ( - _deserialize_additional_model_request_fields( - de, - _SCHEMA_MODEL_CONFIGURATION.members[ - "additionalModelRequestFields" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MODEL_CONFIGURATION, consumer=_consumer) - if "model_id" not in kwargs: - kwargs["model_id"] = "" - return kwargs - - -def _serialize_model_configurations( - serializer: ShapeSerializer, schema: Schema, value: list[ModelConfiguration] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_model_configurations( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ModelConfiguration]: - result: list[ModelConfiguration] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ModelConfiguration.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AdvancedPromptOptimizationOutputConfig: - """ - Contains the output data configuration for an advanced prompt - optimization job. - """ - - s3_uri: str - """The S3 URI prefix where the optimization results will be written.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_ADVANCED_PROMPT_OPTIMIZATION_OUTPUT_CONFIG, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_ADVANCED_PROMPT_OPTIMIZATION_OUTPUT_CONFIG.members["s3Uri"], - self.s3_uri, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["s3_uri"] = de.read_string( - _SCHEMA_ADVANCED_PROMPT_OPTIMIZATION_OUTPUT_CONFIG.members[ - "s3Uri" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ADVANCED_PROMPT_OPTIMIZATION_OUTPUT_CONFIG, consumer=_consumer - ) - if "s3_uri" not in kwargs: - kwargs["s3_uri"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(s3_uri="") - - -@dataclass(kw_only=True) -class Tag: - """Definition of the key/value pair for a tag.""" - - key: str - """Key for the tag.""" - - value: str - """Value for the tag.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TAG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_TAG.members["key"], self.key) - serializer.write_string(_SCHEMA_TAG.members["value"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["key"] = de.read_string(_SCHEMA_TAG.members["key"]) - - case 1: - kwargs["value"] = de.read_string(_SCHEMA_TAG.members["value"]) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TAG, consumer=_consumer) - if "key" not in kwargs: - kwargs["key"] = "" - if "value" not in kwargs: - kwargs["value"] = "" - return kwargs - - -def _serialize_tag_list( - serializer: ShapeSerializer, schema: Schema, value: list[Tag] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_tag_list(deserializer: ShapeDeserializer, schema: Schema) -> list[Tag]: - result: list[Tag] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Tag.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CreateAdvancedPromptOptimizationJobInput: - """Create Advanced Prompt Optimization Job Request""" - - job_name: str | None = None - """A name for the advanced prompt optimization job.""" - - job_description: str | None = None - """A description of the advanced prompt optimization job.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If this token matches a previous - request, Amazon Bedrock ignores the request but does not return an - error. - """ - - input_config: AdvancedPromptOptimizationInputConfig | None = None - """ - Specifies the S3 location of your JSONL input file containing prompt - templates and evaluation samples. - """ - - output_config: AdvancedPromptOptimizationOutputConfig | None = None - """Specifies the S3 location where optimization results will be stored.""" - - encryption_key_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the KMS key used for encrypting the - output data. If not specified, the output is encrypted with an - Amazon-owned KMS key. - """ - - tags: list[Tag] | None = None - """Tags to associate with the advanced prompt optimization job.""" - - model_configurations: list[ModelConfiguration] | None = None - """ - A list of model configurations specifying the target models for prompt - optimization. You can specify up to 5 models. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CREATE_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.job_name is not None: - serializer.write_string( - _SCHEMA_CREATE_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT.members[ - "jobName" - ], - self.job_name, - ) - - if self.job_description is not None: - serializer.write_string( - _SCHEMA_CREATE_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT.members[ - "jobDescription" - ], - self.job_description, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT.members[ - "clientToken" - ], - self.client_token, - ) - - if self.input_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT.members[ - "inputConfig" - ], - self.input_config, - ) - - if self.output_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT.members[ - "outputConfig" - ], - self.output_config, - ) - - if self.encryption_key_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT.members[ - "encryptionKeyArn" - ], - self.encryption_key_arn, - ) - - if self.tags is not None: - _serialize_tag_list( - serializer, - _SCHEMA_CREATE_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT.members["tags"], - self.tags, - ) - - if self.model_configurations is not None: - _serialize_model_configurations( - serializer, - _SCHEMA_CREATE_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT.members[ - "modelConfigurations" - ], - self.model_configurations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["job_name"] = de.read_string( - _SCHEMA_CREATE_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT.members[ - "jobName" - ] - ) - - case 1: - kwargs["job_description"] = de.read_string( - _SCHEMA_CREATE_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT.members[ - "jobDescription" - ] - ) - - case 2: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT.members[ - "clientToken" - ] - ) - - case 3: - kwargs["input_config"] = ( - AdvancedPromptOptimizationInputConfig.deserialize(de) - ) - - case 4: - kwargs["output_config"] = ( - AdvancedPromptOptimizationOutputConfig.deserialize(de) - ) - - case 5: - kwargs["encryption_key_arn"] = de.read_string( - _SCHEMA_CREATE_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT.members[ - "encryptionKeyArn" - ] - ) - - case 6: - kwargs["tags"] = _deserialize_tag_list( - de, - _SCHEMA_CREATE_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT.members[ - "tags" - ], - ) - - case 7: - kwargs["model_configurations"] = _deserialize_model_configurations( - de, - _SCHEMA_CREATE_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT.members[ - "modelConfigurations" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CreateAdvancedPromptOptimizationJobOutput: - """Create Advanced Prompt Optimization Job Response""" - - job_arn: str - """ - The Amazon Resource Name (ARN) of the created advanced prompt - optimization job. - """ +CREATE_GUARDRAIL_VERSION: APIOperation[ + CreateGuardrailVersionInput, CreateGuardrailVersionOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_GUARDRAIL_VERSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#ConflictException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False +DELETE_GUARDRAIL: APIOperation[DeleteGuardrailInput, DeleteGuardrailOutput] = ( + APIOperation( + static_schema=_SCHEMA_DELETE_GUARDRAIL, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#ConflictException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceInUseException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CREATE_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT.members["jobArn"], - self.job_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["job_arn"] = de.read_string( - _SCHEMA_CREATE_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT.members[ - "jobArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT, consumer=_consumer - ) - if "job_arn" not in kwargs: - kwargs["job_arn"] = "" - return kwargs - - -@dataclass(kw_only=True) -class ResourceNotFoundException(ServiceError): - """ - The specified resource Amazon Resource Name (ARN) was not found. Check - the Amazon Resource Name (ARN) and try your request again. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ServiceQuotaExceededException(ServiceError): - """ - The number of requests exceeds the service quota. Resubmit your request - later. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class TooManyTagsException(ServiceError): - """ - The request contains more tags than can be associated with a resource - (50 tags per resource). The maximum number of tags includes both - existing tags and those included in your current request. - """ - - fault: Literal["client", "server"] | None = "client" - - resource_name: str | None = None - """The name of the resource with too many tags.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOO_MANY_TAGS_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_TOO_MANY_TAGS_EXCEPTION.members["message"], self.message - ) - - if self.resource_name is not None: - serializer.write_string( - _SCHEMA_TOO_MANY_TAGS_EXCEPTION.members["resourceName"], - self.resource_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_TOO_MANY_TAGS_EXCEPTION.members["message"] - ) - - case 1: - kwargs["resource_name"] = de.read_string( - _SCHEMA_TOO_MANY_TAGS_EXCEPTION.members["resourceName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TOO_MANY_TAGS_EXCEPTION, consumer=_consumer) - return kwargs - +) -CREATE_ADVANCED_PROMPT_OPTIMIZATION_JOB = APIOperation( - input=CreateAdvancedPromptOptimizationJobInput, - output=CreateAdvancedPromptOptimizationJobOutput, - schema=_SCHEMA_CREATE_ADVANCED_PROMPT_OPTIMIZATION_JOB, - input_schema=_SCHEMA_CREATE_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT, - output_schema=_SCHEMA_CREATE_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrock#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrock#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#TooManyTagsException"): TooManyTagsException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), +GET_GUARDRAIL: APIOperation[GetGuardrailInput, GetGuardrailOutput] = APIOperation( + static_schema=_SCHEMA_GET_GUARDRAIL, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], effective_auth_schemes=[ ShapeID("aws.auth#sigv4"), ShapeID("smithy.api#httpBearerAuth"), ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_TOO_MANY_TAGS_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], ) +LIST_GUARDRAILS: APIOperation[ListGuardrailsInput, ListGuardrailsOutput] = APIOperation( + static_schema=_SCHEMA_LIST_GUARDRAILS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) -@dataclass(kw_only=True) -class GetAdvancedPromptOptimizationJobInput: - """Get Advanced Prompt Optimization Job Request""" - - job_identifier: str | None = None - """The ARN or ID of the advanced prompt optimization job.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.job_identifier is not None: - serializer.write_string( - _SCHEMA_GET_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT.members[ - "jobIdentifier" - ], - self.job_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["job_identifier"] = de.read_string( - _SCHEMA_GET_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT.members[ - "jobIdentifier" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetAdvancedPromptOptimizationJobOutput: - """Get Advanced Prompt Optimization Job Response""" - - job_arn: str - """The Amazon Resource Name (ARN) of the advanced prompt optimization job.""" - - job_name: str - """The name of the advanced prompt optimization job.""" - - job_status: str - """The status of the advanced prompt optimization job.""" - - input_config: AdvancedPromptOptimizationInputConfig - """The input data configuration for the optimization job.""" - - output_config: AdvancedPromptOptimizationOutputConfig - """The output data configuration for the optimization job.""" - - creation_time: datetime - """The time at which the advanced prompt optimization job was created.""" - - model_configurations: list[ModelConfiguration] - """The model configurations used in the optimization job.""" - - job_description: str | None = None - """The description of the advanced prompt optimization job.""" - - encryption_key_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the KMS key used to encrypt the output - data. - """ - - last_modified_time: datetime | None = None - """ - The time at which the advanced prompt optimization job was last - modified. - """ - - failure_message: str | None = None - """If the job failed, a message describing the reason for the failure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False +UPDATE_GUARDRAIL: APIOperation[UpdateGuardrailInput, UpdateGuardrailOutput] = ( + APIOperation( + static_schema=_SCHEMA_UPDATE_GUARDRAIL, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#ConflictException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT.members["jobArn"], - self.job_arn, - ) - serializer.write_string( - _SCHEMA_GET_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT.members["jobName"], - self.job_name, - ) - if self.job_description is not None: - serializer.write_string( - _SCHEMA_GET_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT.members[ - "jobDescription" - ], - self.job_description, - ) - - serializer.write_string( - _SCHEMA_GET_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT.members["jobStatus"], - self.job_status, - ) - serializer.write_struct( - _SCHEMA_GET_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT.members["inputConfig"], - self.input_config, - ) - serializer.write_struct( - _SCHEMA_GET_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT.members["outputConfig"], - self.output_config, - ) - if self.encryption_key_arn is not None: - serializer.write_string( - _SCHEMA_GET_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT.members[ - "encryptionKeyArn" - ], - self.encryption_key_arn, - ) - - serializer.write_timestamp( - _SCHEMA_GET_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT.members["creationTime"], - self.creation_time, - ) - if self.last_modified_time is not None: - serializer.write_timestamp( - _SCHEMA_GET_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT.members[ - "lastModifiedTime" - ], - self.last_modified_time, - ) - - if self.failure_message is not None: - serializer.write_string( - _SCHEMA_GET_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT.members[ - "failureMessage" - ], - self.failure_message, - ) - - _serialize_model_configurations( - serializer, - _SCHEMA_GET_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT.members[ - "modelConfigurations" - ], - self.model_configurations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["job_arn"] = de.read_string( - _SCHEMA_GET_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT.members[ - "jobArn" - ] - ) +) - case 1: - kwargs["job_name"] = de.read_string( - _SCHEMA_GET_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT.members[ - "jobName" - ] - ) - - case 2: - kwargs["job_description"] = de.read_string( - _SCHEMA_GET_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT.members[ - "jobDescription" - ] - ) - - case 3: - kwargs["job_status"] = AdvancedPromptOptimizationJobStatus( - de.read_string( - _SCHEMA_GET_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT.members[ - "jobStatus" - ] - ) - ) - - case 4: - kwargs["input_config"] = ( - AdvancedPromptOptimizationInputConfig.deserialize(de) - ) - - case 5: - kwargs["output_config"] = ( - AdvancedPromptOptimizationOutputConfig.deserialize(de) - ) - - case 6: - kwargs["encryption_key_arn"] = de.read_string( - _SCHEMA_GET_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT.members[ - "encryptionKeyArn" - ] - ) - - case 7: - kwargs["creation_time"] = de.read_timestamp( - _SCHEMA_GET_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT.members[ - "creationTime" - ] - ) - - case 8: - kwargs["last_modified_time"] = de.read_timestamp( - _SCHEMA_GET_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT.members[ - "lastModifiedTime" - ] - ) - - case 9: - kwargs["failure_message"] = de.read_string( - _SCHEMA_GET_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT.members[ - "failureMessage" - ] - ) - - case 10: - kwargs["model_configurations"] = _deserialize_model_configurations( - de, - _SCHEMA_GET_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT.members[ - "modelConfigurations" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT, consumer=_consumer - ) - if "job_arn" not in kwargs: - kwargs["job_arn"] = "" - if "job_name" not in kwargs: - kwargs["job_name"] = "" - if "job_status" not in kwargs: - kwargs["job_status"] = AdvancedPromptOptimizationJobStatus._corrected("") - if "input_config" not in kwargs: - kwargs["input_config"] = ( - AdvancedPromptOptimizationInputConfig._smithy_default() - ) - if "output_config" not in kwargs: - kwargs["output_config"] = ( - AdvancedPromptOptimizationOutputConfig._smithy_default() - ) - if "creation_time" not in kwargs: - kwargs["creation_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "model_configurations" not in kwargs: - kwargs["model_configurations"] = [] - return kwargs - - -GET_ADVANCED_PROMPT_OPTIMIZATION_JOB = APIOperation( - input=GetAdvancedPromptOptimizationJobInput, - output=GetAdvancedPromptOptimizationJobOutput, - schema=_SCHEMA_GET_ADVANCED_PROMPT_OPTIMIZATION_JOB, - input_schema=_SCHEMA_GET_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT, - output_schema=_SCHEMA_GET_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class SortJobsBy(UnknownEnumMixin, StrEnum): - CREATION_TIME = "CreationTime" - - -class SortOrder(UnknownEnumMixin, StrEnum): - ASCENDING = "Ascending" - DESCENDING = "Descending" - - -@dataclass(kw_only=True) -class ListAdvancedPromptOptimizationJobsInput: - """List Advanced Prompt Optimization Jobs Request""" - - max_results: int | None = None - """The maximum number of results to return in the response.""" - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, use this token in a subsequent request to get - the next set of results. - """ - - sort_by: str | None = None - """The field to sort the results by.""" - - sort_order: str | None = None - """The sort order for the results.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_LIST_ADVANCED_PROMPT_OPTIMIZATION_JOBS_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_ADVANCED_PROMPT_OPTIMIZATION_JOBS_INPUT.members[ - "maxResults" - ], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_ADVANCED_PROMPT_OPTIMIZATION_JOBS_INPUT.members[ - "nextToken" - ], - self.next_token, - ) - - if self.sort_by is not None: - serializer.write_string( - _SCHEMA_LIST_ADVANCED_PROMPT_OPTIMIZATION_JOBS_INPUT.members["sortBy"], - self.sort_by, - ) - - if self.sort_order is not None: - serializer.write_string( - _SCHEMA_LIST_ADVANCED_PROMPT_OPTIMIZATION_JOBS_INPUT.members[ - "sortOrder" - ], - self.sort_order, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_ADVANCED_PROMPT_OPTIMIZATION_JOBS_INPUT.members[ - "maxResults" - ] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_ADVANCED_PROMPT_OPTIMIZATION_JOBS_INPUT.members[ - "nextToken" - ] - ) - - case 2: - kwargs["sort_by"] = SortJobsBy( - de.read_string( - _SCHEMA_LIST_ADVANCED_PROMPT_OPTIMIZATION_JOBS_INPUT.members[ - "sortBy" - ] - ) - ) - - case 3: - kwargs["sort_order"] = SortOrder( - de.read_string( - _SCHEMA_LIST_ADVANCED_PROMPT_OPTIMIZATION_JOBS_INPUT.members[ - "sortOrder" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_ADVANCED_PROMPT_OPTIMIZATION_JOBS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class AdvancedPromptOptimizationJobSummary: - """Contains a summary of an advanced prompt optimization job.""" - - job_arn: str - """The Amazon Resource Name (ARN) of the job.""" - - job_name: str - """The name of the job.""" - - job_status: str - """The status of the job.""" - - creation_time: datetime - """The time at which the job was created.""" - - last_modified_time: datetime | None = None - """The time at which the job was last modified.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ADVANCED_PROMPT_OPTIMIZATION_JOB_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_ADVANCED_PROMPT_OPTIMIZATION_JOB_SUMMARY.members["jobArn"], - self.job_arn, - ) - serializer.write_string( - _SCHEMA_ADVANCED_PROMPT_OPTIMIZATION_JOB_SUMMARY.members["jobName"], - self.job_name, - ) - serializer.write_string( - _SCHEMA_ADVANCED_PROMPT_OPTIMIZATION_JOB_SUMMARY.members["jobStatus"], - self.job_status, - ) - serializer.write_timestamp( - _SCHEMA_ADVANCED_PROMPT_OPTIMIZATION_JOB_SUMMARY.members["creationTime"], - self.creation_time, - ) - if self.last_modified_time is not None: - serializer.write_timestamp( - _SCHEMA_ADVANCED_PROMPT_OPTIMIZATION_JOB_SUMMARY.members[ - "lastModifiedTime" - ], - self.last_modified_time, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["job_arn"] = de.read_string( - _SCHEMA_ADVANCED_PROMPT_OPTIMIZATION_JOB_SUMMARY.members[ - "jobArn" - ] - ) - - case 1: - kwargs["job_name"] = de.read_string( - _SCHEMA_ADVANCED_PROMPT_OPTIMIZATION_JOB_SUMMARY.members[ - "jobName" - ] - ) - - case 2: - kwargs["job_status"] = AdvancedPromptOptimizationJobStatus( - de.read_string( - _SCHEMA_ADVANCED_PROMPT_OPTIMIZATION_JOB_SUMMARY.members[ - "jobStatus" - ] - ) - ) - - case 3: - kwargs["creation_time"] = de.read_timestamp( - _SCHEMA_ADVANCED_PROMPT_OPTIMIZATION_JOB_SUMMARY.members[ - "creationTime" - ] - ) - - case 4: - kwargs["last_modified_time"] = de.read_timestamp( - _SCHEMA_ADVANCED_PROMPT_OPTIMIZATION_JOB_SUMMARY.members[ - "lastModifiedTime" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ADVANCED_PROMPT_OPTIMIZATION_JOB_SUMMARY, consumer=_consumer - ) - if "job_arn" not in kwargs: - kwargs["job_arn"] = "" - if "job_name" not in kwargs: - kwargs["job_name"] = "" - if "job_status" not in kwargs: - kwargs["job_status"] = AdvancedPromptOptimizationJobStatus._corrected("") - if "creation_time" not in kwargs: - kwargs["creation_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_advanced_prompt_optimization_job_summaries( - serializer: ShapeSerializer, - schema: Schema, - value: list[AdvancedPromptOptimizationJobSummary], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_advanced_prompt_optimization_job_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AdvancedPromptOptimizationJobSummary]: - result: list[AdvancedPromptOptimizationJobSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AdvancedPromptOptimizationJobSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListAdvancedPromptOptimizationJobsOutput: - """List Advanced Prompt Optimization Jobs Response""" - - job_summaries: list[AdvancedPromptOptimizationJobSummary] | None = None - """A list of advanced prompt optimization job summaries.""" - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, use this token in a subsequent request to get - the next set of results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_LIST_ADVANCED_PROMPT_OPTIMIZATION_JOBS_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.job_summaries is not None: - _serialize_advanced_prompt_optimization_job_summaries( - serializer, - _SCHEMA_LIST_ADVANCED_PROMPT_OPTIMIZATION_JOBS_OUTPUT.members[ - "jobSummaries" - ], - self.job_summaries, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_ADVANCED_PROMPT_OPTIMIZATION_JOBS_OUTPUT.members[ - "nextToken" - ], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["job_summaries"] = ( - _deserialize_advanced_prompt_optimization_job_summaries( - de, - _SCHEMA_LIST_ADVANCED_PROMPT_OPTIMIZATION_JOBS_OUTPUT.members[ - "jobSummaries" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_ADVANCED_PROMPT_OPTIMIZATION_JOBS_OUTPUT.members[ - "nextToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_ADVANCED_PROMPT_OPTIMIZATION_JOBS_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_ADVANCED_PROMPT_OPTIMIZATION_JOBS = APIOperation( - input=ListAdvancedPromptOptimizationJobsInput, - output=ListAdvancedPromptOptimizationJobsOutput, - schema=_SCHEMA_LIST_ADVANCED_PROMPT_OPTIMIZATION_JOBS, - input_schema=_SCHEMA_LIST_ADVANCED_PROMPT_OPTIMIZATION_JOBS_INPUT, - output_schema=_SCHEMA_LIST_ADVANCED_PROMPT_OPTIMIZATION_JOBS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class StopAdvancedPromptOptimizationJobInput: - """Stop Advanced Prompt Optimization Job Request""" - - job_identifier: str | None = None - """The ARN or ID of the advanced prompt optimization job to stop.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_STOP_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.job_identifier is not None: - serializer.write_string( - _SCHEMA_STOP_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT.members[ - "jobIdentifier" - ], - self.job_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["job_identifier"] = de.read_string( - _SCHEMA_STOP_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT.members[ - "jobIdentifier" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_STOP_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class StopAdvancedPromptOptimizationJobOutput: - """Stop Advanced Prompt Optimization Job Response""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_STOP_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_STOP_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT, consumer=_consumer - ) - return kwargs - - -STOP_ADVANCED_PROMPT_OPTIMIZATION_JOB = APIOperation( - input=StopAdvancedPromptOptimizationJobInput, - output=StopAdvancedPromptOptimizationJobOutput, - schema=_SCHEMA_STOP_ADVANCED_PROMPT_OPTIMIZATION_JOB, - input_schema=_SCHEMA_STOP_ADVANCED_PROMPT_OPTIMIZATION_JOB_INPUT, - output_schema=_SCHEMA_STOP_ADVANCED_PROMPT_OPTIMIZATION_JOB_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrock#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class AgreementStatus(UnknownEnumMixin, StrEnum): - AVAILABLE = "AVAILABLE" - PENDING = "PENDING" - NOT_AVAILABLE = "NOT_AVAILABLE" - ERROR = "ERROR" - - -@dataclass(kw_only=True) -class AgreementAvailability: - """Information about the agreement availability""" - - status: str - """Status of the agreement.""" - - error_message: str | None = None - """Error message.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGREEMENT_AVAILABILITY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AGREEMENT_AVAILABILITY.members["status"], self.status - ) - if self.error_message is not None: - serializer.write_string( - _SCHEMA_AGREEMENT_AVAILABILITY.members["errorMessage"], - self.error_message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["status"] = AgreementStatus( - de.read_string(_SCHEMA_AGREEMENT_AVAILABILITY.members["status"]) - ) - - case 1: - kwargs["error_message"] = de.read_string( - _SCHEMA_AGREEMENT_AVAILABILITY.members["errorMessage"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AGREEMENT_AVAILABILITY, consumer=_consumer) - if "status" not in kwargs: - kwargs["status"] = AgreementStatus._corrected("") - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(status=AgreementStatus._corrected("")) - - -@dataclass(kw_only=True) -class GetUseCaseForModelAccessInput: - """Dataclass for GetUseCaseForModelAccessInput structure.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_USE_CASE_FOR_MODEL_ACCESS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_USE_CASE_FOR_MODEL_ACCESS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetUseCaseForModelAccessOutput: - """Dataclass for GetUseCaseForModelAccessOutput structure.""" - - form_data: bytes - """Get customer profile Response.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_USE_CASE_FOR_MODEL_ACCESS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_blob( - _SCHEMA_GET_USE_CASE_FOR_MODEL_ACCESS_OUTPUT.members["formData"], - self.form_data, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["form_data"] = de.read_blob( - _SCHEMA_GET_USE_CASE_FOR_MODEL_ACCESS_OUTPUT.members["formData"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_USE_CASE_FOR_MODEL_ACCESS_OUTPUT, consumer=_consumer - ) - if "form_data" not in kwargs: - kwargs["form_data"] = b"" - return kwargs - - -GET_USE_CASE_FOR_MODEL_ACCESS = APIOperation( - input=GetUseCaseForModelAccessInput, - output=GetUseCaseForModelAccessOutput, - schema=_SCHEMA_GET_USE_CASE_FOR_MODEL_ACCESS, - input_schema=_SCHEMA_GET_USE_CASE_FOR_MODEL_ACCESS_INPUT, - output_schema=_SCHEMA_GET_USE_CASE_FOR_MODEL_ACCESS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class PutUseCaseForModelAccessInput: - """Dataclass for PutUseCaseForModelAccessInput structure.""" - - form_data: bytes | None = None - """Put customer profile Request.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_USE_CASE_FOR_MODEL_ACCESS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.form_data is not None: - serializer.write_blob( - _SCHEMA_PUT_USE_CASE_FOR_MODEL_ACCESS_INPUT.members["formData"], - self.form_data, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["form_data"] = de.read_blob( - _SCHEMA_PUT_USE_CASE_FOR_MODEL_ACCESS_INPUT.members["formData"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PUT_USE_CASE_FOR_MODEL_ACCESS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class PutUseCaseForModelAccessOutput: - """Dataclass for PutUseCaseForModelAccessOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_USE_CASE_FOR_MODEL_ACCESS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PUT_USE_CASE_FOR_MODEL_ACCESS_OUTPUT, consumer=_consumer - ) - return kwargs - - -PUT_USE_CASE_FOR_MODEL_ACCESS = APIOperation( - input=PutUseCaseForModelAccessInput, - output=PutUseCaseForModelAccessOutput, - schema=_SCHEMA_PUT_USE_CASE_FOR_MODEL_ACCESS, - input_schema=_SCHEMA_PUT_USE_CASE_FOR_MODEL_ACCESS_INPUT, - output_schema=_SCHEMA_PUT_USE_CASE_FOR_MODEL_ACCESS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, +CREATE_INFERENCE_PROFILE: APIOperation[ + CreateInferenceProfileInput, CreateInferenceProfileOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_INFERENCE_PROFILE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#ConflictException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#TooManyTagsException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), ], -) - - -@dataclass(kw_only=True) -class CancelAutomatedReasoningPolicyBuildWorkflowInput: - """ - Dataclass for CancelAutomatedReasoningPolicyBuildWorkflowInput - structure. - """ - - policy_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the Automated Reasoning policy whose - build workflow you want to cancel. - """ - - build_workflow_id: str | None = None - """ - The unique identifier of the build workflow to cancel. You can get this - ID from the StartAutomatedReasoningPolicyBuildWorkflow response or by - listing build workflows. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CANCEL_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.policy_arn is not None: - serializer.write_string( - _SCHEMA_CANCEL_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT.members[ - "policyArn" - ], - self.policy_arn, - ) - - if self.build_workflow_id is not None: - serializer.write_string( - _SCHEMA_CANCEL_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT.members[ - "buildWorkflowId" - ], - self.build_workflow_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_arn"] = de.read_string( - _SCHEMA_CANCEL_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT.members[ - "policyArn" - ] - ) - - case 1: - kwargs["build_workflow_id"] = de.read_string( - _SCHEMA_CANCEL_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT.members[ - "buildWorkflowId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CANCEL_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT, - consumer=_consumer, - ) - return kwargs - - -@dataclass(kw_only=True) -class CancelAutomatedReasoningPolicyBuildWorkflowOutput: - """ - Dataclass for CancelAutomatedReasoningPolicyBuildWorkflowOutput - structure. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CANCEL_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CANCEL_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT, - consumer=_consumer, - ) - return kwargs - - -CANCEL_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW = APIOperation( - input=CancelAutomatedReasoningPolicyBuildWorkflowInput, - output=CancelAutomatedReasoningPolicyBuildWorkflowOutput, - schema=_SCHEMA_CANCEL_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW, - input_schema=_SCHEMA_CANCEL_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT, - output_schema=_SCHEMA_CANCEL_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyDefinitionRule: - """ - Represents a formal logic rule in an Automated Reasoning policy. For - example, rules can be expressed as if-then statements that define - logical constraints. - """ - - id: str - """The unique identifier of the rule within the policy.""" - - expression: str = field(repr=False) - """The formal logic expression of the rule.""" - - alternate_expression: str | None = field(repr=False, default=None) - """ - The human-readable form of the rule expression, often in natural - language or simplified notation. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_RULE, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_RULE.members["id"], self.id - ) - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_RULE.members["expression"], - self.expression, - ) - if self.alternate_expression is not None: - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_RULE.members[ - "alternateExpression" - ], - self.alternate_expression, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_RULE.members["id"] - ) - - case 1: - kwargs["expression"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_RULE.members[ - "expression" - ] - ) - - case 2: - kwargs["alternate_expression"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_RULE.members[ - "alternateExpression" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_RULE, consumer=_consumer - ) - if "id" not in kwargs: - kwargs["id"] = "" - if "expression" not in kwargs: - kwargs["expression"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(id="", expression="") - - -def _serialize_automated_reasoning_policy_definition_rule_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[AutomatedReasoningPolicyDefinitionRule], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_automated_reasoning_policy_definition_rule_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AutomatedReasoningPolicyDefinitionRule]: - result: list[AutomatedReasoningPolicyDefinitionRule] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AutomatedReasoningPolicyDefinitionRule.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyDefinitionTypeValue: - """ - Represents a single value within a custom type definition, including its - identifier and description. - """ - - value: str - """The actual value or identifier for this type value.""" - - description: str | None = field(repr=False, default=None) - """ - A human-readable description explaining what this type value represents - and when it should be used. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE.members["value"], - self.value, - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE.members[ - "description" - ], - self.description, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["value"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE.members[ - "value" - ] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE.members[ - "description" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE, consumer=_consumer - ) - if "value" not in kwargs: - kwargs["value"] = "" - return kwargs - - -def _serialize_automated_reasoning_policy_definition_type_value_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[AutomatedReasoningPolicyDefinitionTypeValue], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_automated_reasoning_policy_definition_type_value_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AutomatedReasoningPolicyDefinitionTypeValue]: - result: list[AutomatedReasoningPolicyDefinitionTypeValue] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AutomatedReasoningPolicyDefinitionTypeValue.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyDefinitionType: - """ - Represents a custom user-defined viarble type in an Automated Reasoning - policy. Types are enum-based and provide additional context beyond - predefined variable types. - """ - - name: str = field(repr=False) - """The name of the custom type.""" - - values: list[AutomatedReasoningPolicyDefinitionTypeValue] - """ - The possible values for this enum-based type, each with its own - description. - """ - - description: str | None = field(repr=False, default=None) - """The description of what the custom type represents.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_TYPE, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_TYPE.members["name"], - self.name, - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_TYPE.members[ - "description" - ], - self.description, - ) - - _serialize_automated_reasoning_policy_definition_type_value_list( - serializer, - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_TYPE.members["values"], - self.values, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_TYPE.members[ - "name" - ] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_TYPE.members[ - "description" - ] - ) - - case 2: - kwargs["values"] = ( - _deserialize_automated_reasoning_policy_definition_type_value_list( - de, - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_TYPE.members[ - "values" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_TYPE, consumer=_consumer - ) - if "name" not in kwargs: - kwargs["name"] = "" - if "values" not in kwargs: - kwargs["values"] = [] - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(name="", values=[]) - - -def _serialize_automated_reasoning_policy_definition_type_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[AutomatedReasoningPolicyDefinitionType], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_automated_reasoning_policy_definition_type_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AutomatedReasoningPolicyDefinitionType]: - result: list[AutomatedReasoningPolicyDefinitionType] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AutomatedReasoningPolicyDefinitionType.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyDefinitionVariable: - """ - Represents a variable in an Automated Reasoning policy. Variables - represent concepts that can have values assigned during natural language - translation. - """ - - name: str = field(repr=False) - """ - The name of the variable. Use descriptive names that clearly indicate - the concept being represented. - """ - - type: str = field(repr=False) - """ - The data type of the variable. Valid types include bool, int, real, - enum, and custom types that you can provide. - """ - - description: str = field(repr=False) - """ - The description of the variable that explains what it represents and how - users might refer to it. Clear and comprehensive descriptions are - essential for accurate natural language translation. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE.members["name"], - self.name, - ) - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE.members["type"], - self.type, - ) - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE.members[ - "description" - ], - self.description, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE.members[ - "name" - ] - ) - - case 1: - kwargs["type"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE.members[ - "type" - ] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE.members[ - "description" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_VARIABLE, consumer=_consumer - ) - if "name" not in kwargs: - kwargs["name"] = "" - if "type" not in kwargs: - kwargs["type"] = "" - if "description" not in kwargs: - kwargs["description"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(name="", type="", description="") - - -def _serialize_automated_reasoning_policy_definition_variable_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[AutomatedReasoningPolicyDefinitionVariable], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_automated_reasoning_policy_definition_variable_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AutomatedReasoningPolicyDefinitionVariable]: - result: list[AutomatedReasoningPolicyDefinitionVariable] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AutomatedReasoningPolicyDefinitionVariable.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyDefinition: - """ - Contains the formal logic rules, variables, and custom variable types - that define an Automated Reasoning policy. The policy definition - specifies the constraints used to validate foundation model responses - for accuracy and logical consistency. - """ - - version: str = "1" - """The version of the policy definition format.""" - - types: list[AutomatedReasoningPolicyDefinitionType] | None = None - """ - The custom user-defined vairable types used in the policy. Types are - enum-based variable types that provide additional context beyond the - predefined variable types. - """ - - rules: list[AutomatedReasoningPolicyDefinitionRule] | None = None - """ - The formal logic rules extracted from the source document. Rules define - the logical constraints that determine whether model responses are - valid, invalid, or satisfiable. - """ - - variables: list[AutomatedReasoningPolicyDefinitionVariable] | None = None - """ - The variables that represent concepts in the policy. Variables can have - values assigned when translating natural language into formal logic. - Their descriptions are crucial for accurate translation. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION.members["version"], - self.version, - ) - if self.types is not None: - _serialize_automated_reasoning_policy_definition_type_list( - serializer, - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION.members["types"], - self.types, - ) - - if self.rules is not None: - _serialize_automated_reasoning_policy_definition_rule_list( - serializer, - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION.members["rules"], - self.rules, - ) - - if self.variables is not None: - _serialize_automated_reasoning_policy_definition_variable_list( - serializer, - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION.members["variables"], - self.variables, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["version"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION.members["version"] - ) - - case 1: - kwargs["types"] = ( - _deserialize_automated_reasoning_policy_definition_type_list( - de, - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION.members[ - "types" - ], - ) - ) - - case 2: - kwargs["rules"] = ( - _deserialize_automated_reasoning_policy_definition_rule_list( - de, - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION.members[ - "rules" - ], - ) - ) - - case 3: - kwargs["variables"] = ( - _deserialize_automated_reasoning_policy_definition_variable_list( - de, - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION.members[ - "variables" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION, consumer=_consumer - ) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls() - - -@dataclass(kw_only=True) -class CreateAutomatedReasoningPolicyInput: - """Dataclass for CreateAutomatedReasoningPolicyInput structure.""" - - name: str | None = field(repr=False, default=None) - """ - A unique name for the Automated Reasoning policy. The name must be - between 1 and 63 characters and can contain letters, numbers, hyphens, - and underscores. - """ - - description: str | None = field(repr=False, default=None) - """ - A description of the Automated Reasoning policy. Use this to provide - context about the policy's purpose and the types of validations it - performs. - """ - - client_request_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the operation - completes no more than once. If this token matches a previous request, - Amazon Bedrock ignores the request but doesn't return an error. - """ - - policy_definition: AutomatedReasoningPolicyDefinition | None = None - """ - The policy definition that contains the formal logic rules, variables, - and custom variable types used to validate foundation model responses in - your application. - """ - - kms_key_id: str | None = None - """ - The identifier of the KMS key to use for encrypting the automated - reasoning policy and its associated artifacts. If you don't specify a - KMS key, Amazon Bedrock uses an KMS managed key for encryption. For - enhanced security and control, you can specify a customer managed KMS - key. - """ - - tags: list[Tag] | None = None - """ - A list of tags to associate with the Automated Reasoning policy. Tags - help you organize and manage your policies. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_INPUT.members["name"], - self.name, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_INPUT.members["description"], - self.description, - ) - - if self.client_request_token is not None: - serializer.write_string( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_INPUT.members[ - "clientRequestToken" - ], - self.client_request_token, - ) - - if self.policy_definition is not None: - serializer.write_struct( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_INPUT.members[ - "policyDefinition" - ], - self.policy_definition, - ) - - if self.kms_key_id is not None: - serializer.write_string( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_INPUT.members["kmsKeyId"], - self.kms_key_id, - ) - - if self.tags is not None: - _serialize_tag_list( - serializer, - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_INPUT.members["tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_INPUT.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_INPUT.members[ - "description" - ] - ) - - case 2: - kwargs["client_request_token"] = de.read_string( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_INPUT.members[ - "clientRequestToken" - ] - ) - - case 3: - kwargs["policy_definition"] = ( - AutomatedReasoningPolicyDefinition.deserialize(de) - ) - - case 4: - kwargs["kms_key_id"] = de.read_string( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_INPUT.members[ - "kmsKeyId" - ] - ) - - case 5: - kwargs["tags"] = _deserialize_tag_list( - de, - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_INPUT.members["tags"], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CreateAutomatedReasoningPolicyOutput: - """Dataclass for CreateAutomatedReasoningPolicyOutput structure.""" - - policy_arn: str - """ - The Amazon Resource Name (ARN) of the Automated Reasoning policy that - you created. - """ - - version: str - """ - The version number of the newly created Automated Reasoning policy. The - initial version is always DRAFT. - """ - - name: str = field(repr=False) - """The name of the Automated Reasoning policy.""" - - created_at: datetime - """The timestamp when the policy was created.""" - - updated_at: datetime - """The timestamp when the policy was last updated.""" - - description: str | None = field(repr=False, default=None) - """The description of the Automated Reasoning policy.""" - - definition_hash: str | None = None - """ - The hash of the policy definition. This is used as a concurrency token - for creating policy versions that you can use in your application. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_OUTPUT.members["policyArn"], - self.policy_arn, - ) - serializer.write_string( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_OUTPUT.members["version"], - self.version, - ) - serializer.write_string( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_OUTPUT.members["name"], self.name - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_OUTPUT.members["description"], - self.description, - ) - - if self.definition_hash is not None: - serializer.write_string( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_OUTPUT.members[ - "definitionHash" - ], - self.definition_hash, - ) - - serializer.write_timestamp( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_OUTPUT.members["createdAt"], - self.created_at, - ) - serializer.write_timestamp( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_OUTPUT.members["updatedAt"], - self.updated_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_arn"] = de.read_string( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_OUTPUT.members[ - "policyArn" - ] - ) - - case 1: - kwargs["version"] = de.read_string( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_OUTPUT.members[ - "version" - ] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_OUTPUT.members["name"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_OUTPUT.members[ - "description" - ] - ) - - case 4: - kwargs["definition_hash"] = de.read_string( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_OUTPUT.members[ - "definitionHash" - ] - ) - - case 5: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_OUTPUT.members[ - "createdAt" - ] - ) - - case 6: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_OUTPUT.members[ - "updatedAt" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_OUTPUT, consumer=_consumer - ) - if "policy_arn" not in kwargs: - kwargs["policy_arn"] = "" - if "version" not in kwargs: - kwargs["version"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -CREATE_AUTOMATED_REASONING_POLICY = APIOperation( - input=CreateAutomatedReasoningPolicyInput, - output=CreateAutomatedReasoningPolicyOutput, - schema=_SCHEMA_CREATE_AUTOMATED_REASONING_POLICY, - input_schema=_SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_INPUT, - output_schema=_SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrock#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrock#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#TooManyTagsException"): TooManyTagsException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_TOO_MANY_TAGS_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class AutomatedReasoningCheckResult(UnknownEnumMixin, StrEnum): - VALID = "VALID" - INVALID = "INVALID" - SATISFIABLE = "SATISFIABLE" - IMPOSSIBLE = "IMPOSSIBLE" - TRANSLATION_AMBIGUOUS = "TRANSLATION_AMBIGUOUS" - TOO_COMPLEX = "TOO_COMPLEX" - NO_TRANSLATION = "NO_TRANSLATION" - - -@dataclass(kw_only=True) -class CreateAutomatedReasoningPolicyTestCaseInput: - """Dataclass for CreateAutomatedReasoningPolicyTestCaseInput structure.""" - - policy_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the Automated Reasoning policy for - which to create the test. - """ - - guard_content: str | None = field(repr=False, default=None) - """ - The output content that's validated by the Automated Reasoning policy. - This represents the foundation model response that will be checked for - accuracy. - """ - - query_content: str | None = field(repr=False, default=None) - """ - The input query or prompt that generated the content. This provides - context for the validation. - """ - - expected_aggregated_findings_result: str | None = None - """ - The expected result of the Automated Reasoning check. Valid values - include: , TOO_COMPLEX, and NO_TRANSLATIONS. - - - `VALID` - The claims are true. The claims are implied by the premises - and the Automated Reasoning policy. Given the Automated Reasoning - policy and premises, it is not possible for these claims to be false. - In other words, there are no alternative answers that are true that - contradict the claims. - - - `INVALID` - The claims are false. The claims are not implied by the - premises and Automated Reasoning policy. Furthermore, there exists - different claims that are consistent with the premises and Automated - Reasoning policy. - - - `SATISFIABLE` - The claims can be true or false. It depends on what - assumptions are made for the claim to be implied from the premises and - Automated Reasoning policy rules. In this situation, different - assumptions can make input claims false and alternative claims true. - - - `IMPOSSIBLE` - Automated Reasoning can't make a statement about the - claims. This can happen if the premises are logically incorrect, or if - there is a conflict within the Automated Reasoning policy itself. - - - `TRANSLATION_AMBIGUOUS` - Detected an ambiguity in the translation - meant it would be unsound to continue with validity checking. - Additional context or follow-up questions might be needed to get - translation to succeed. - - - `TOO_COMPLEX` - The input contains too much information for Automated - Reasoning to process within its latency limits. - - - `NO_TRANSLATIONS` - Identifies that some or all of the input prompt - wasn't translated into logic. This can happen if the input isn't - relevant to the Automated Reasoning policy, or if the policy doesn't - have variables to model relevant input. If Automated Reasoning can't - translate anything, you get a single `NO_TRANSLATIONS` finding. You - might also see a `NO_TRANSLATIONS` (along with other findings) if some - part of the validation isn't translated. - """ - - client_request_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the operation - completes no more than one time. If this token matches a previous - request, Amazon Bedrock ignores the request, but does not return an - error. - """ - - confidence_threshold: float | None = None - """ - The minimum confidence level for logic validation. Content that meets - the threshold is considered a high-confidence finding that can be - validated. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.policy_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT.members[ - "policyArn" - ], - self.policy_arn, - ) - - if self.guard_content is not None: - serializer.write_string( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT.members[ - "guardContent" - ], - self.guard_content, - ) - - if self.query_content is not None: - serializer.write_string( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT.members[ - "queryContent" - ], - self.query_content, - ) - - if self.expected_aggregated_findings_result is not None: - serializer.write_string( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT.members[ - "expectedAggregatedFindingsResult" - ], - self.expected_aggregated_findings_result, - ) - - if self.client_request_token is not None: - serializer.write_string( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT.members[ - "clientRequestToken" - ], - self.client_request_token, - ) - - if self.confidence_threshold is not None: - serializer.write_double( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT.members[ - "confidenceThreshold" - ], - self.confidence_threshold, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_arn"] = de.read_string( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT.members[ - "policyArn" - ] - ) - - case 1: - kwargs["guard_content"] = de.read_string( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT.members[ - "guardContent" - ] - ) - - case 2: - kwargs["query_content"] = de.read_string( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT.members[ - "queryContent" - ] - ) - - case 3: - kwargs["expected_aggregated_findings_result"] = ( - AutomatedReasoningCheckResult( - de.read_string( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT.members[ - "expectedAggregatedFindingsResult" - ] - ) - ) - ) - - case 4: - kwargs["client_request_token"] = de.read_string( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT.members[ - "clientRequestToken" - ] - ) - - case 5: - kwargs["confidence_threshold"] = de.read_double( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT.members[ - "confidenceThreshold" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT, - consumer=_consumer, - ) - return kwargs - - -@dataclass(kw_only=True) -class CreateAutomatedReasoningPolicyTestCaseOutput: - """Dataclass for CreateAutomatedReasoningPolicyTestCaseOutput structure.""" - - policy_arn: str - """ - The Amazon Resource Name (ARN) of the policy for which the test was - created. - """ - - test_case_id: str - """The unique identifier of the created test.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_TEST_CASE_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_TEST_CASE_OUTPUT.members[ - "policyArn" - ], - self.policy_arn, - ) - serializer.write_string( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_TEST_CASE_OUTPUT.members[ - "testCaseId" - ], - self.test_case_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_arn"] = de.read_string( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_TEST_CASE_OUTPUT.members[ - "policyArn" - ] - ) - - case 1: - kwargs["test_case_id"] = de.read_string( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_TEST_CASE_OUTPUT.members[ - "testCaseId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_TEST_CASE_OUTPUT, - consumer=_consumer, - ) - if "policy_arn" not in kwargs: - kwargs["policy_arn"] = "" - if "test_case_id" not in kwargs: - kwargs["test_case_id"] = "" - return kwargs - - -CREATE_AUTOMATED_REASONING_POLICY_TEST_CASE = APIOperation( - input=CreateAutomatedReasoningPolicyTestCaseInput, - output=CreateAutomatedReasoningPolicyTestCaseOutput, - schema=_SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_TEST_CASE, - input_schema=_SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT, - output_schema=_SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_TEST_CASE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrock#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrock#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class CreateAutomatedReasoningPolicyVersionInput: - """Dataclass for CreateAutomatedReasoningPolicyVersionInput structure.""" - - policy_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the Automated Reasoning policy for - which to create a version. - """ - - client_request_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the operation - completes no more than one time. If this token matches a previous - request, Amazon Bedrock ignores the request, but does not return an - error. - """ - - last_updated_definition_hash: str | None = None - """ - The hash of the current policy definition used as a concurrency token to - ensure the policy hasn't been modified since you last retrieved it. - """ - - tags: list[Tag] | None = None - """A list of tags to associate with the policy version.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_VERSION_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.policy_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_VERSION_INPUT.members[ - "policyArn" - ], - self.policy_arn, - ) - - if self.client_request_token is not None: - serializer.write_string( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_VERSION_INPUT.members[ - "clientRequestToken" - ], - self.client_request_token, - ) - - if self.last_updated_definition_hash is not None: - serializer.write_string( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_VERSION_INPUT.members[ - "lastUpdatedDefinitionHash" - ], - self.last_updated_definition_hash, - ) - - if self.tags is not None: - _serialize_tag_list( - serializer, - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_VERSION_INPUT.members["tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_arn"] = de.read_string( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_VERSION_INPUT.members[ - "policyArn" - ] - ) - - case 1: - kwargs["client_request_token"] = de.read_string( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_VERSION_INPUT.members[ - "clientRequestToken" - ] - ) - - case 2: - kwargs["last_updated_definition_hash"] = de.read_string( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_VERSION_INPUT.members[ - "lastUpdatedDefinitionHash" - ] - ) - - case 3: - kwargs["tags"] = _deserialize_tag_list( - de, - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_VERSION_INPUT.members[ - "tags" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_VERSION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CreateAutomatedReasoningPolicyVersionOutput: - """Dataclass for CreateAutomatedReasoningPolicyVersionOutput structure.""" - - policy_arn: str - """The versioned Amazon Resource Name (ARN) of the policy version.""" - - version: str - """The version number of the policy version.""" - - name: str = field(repr=False) - """The name of the policy version.""" - - definition_hash: str - """The hash of the policy definition for this version.""" - - created_at: datetime - """The timestamp when the policy version was created.""" - - description: str | None = field(repr=False, default=None) - """The description of the policy version.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_VERSION_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_VERSION_OUTPUT.members[ - "policyArn" - ], - self.policy_arn, - ) - serializer.write_string( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_VERSION_OUTPUT.members["version"], - self.version, - ) - serializer.write_string( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_VERSION_OUTPUT.members["name"], - self.name, - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_VERSION_OUTPUT.members[ - "description" - ], - self.description, - ) - - serializer.write_string( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_VERSION_OUTPUT.members[ - "definitionHash" - ], - self.definition_hash, - ) - serializer.write_timestamp( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_VERSION_OUTPUT.members[ - "createdAt" - ], - self.created_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_arn"] = de.read_string( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_VERSION_OUTPUT.members[ - "policyArn" - ] - ) - - case 1: - kwargs["version"] = de.read_string( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_VERSION_OUTPUT.members[ - "version" - ] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_VERSION_OUTPUT.members[ - "name" - ] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_VERSION_OUTPUT.members[ - "description" - ] - ) - - case 4: - kwargs["definition_hash"] = de.read_string( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_VERSION_OUTPUT.members[ - "definitionHash" - ] - ) - - case 5: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_VERSION_OUTPUT.members[ - "createdAt" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_VERSION_OUTPUT, consumer=_consumer - ) - if "policy_arn" not in kwargs: - kwargs["policy_arn"] = "" - if "version" not in kwargs: - kwargs["version"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "definition_hash" not in kwargs: - kwargs["definition_hash"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -CREATE_AUTOMATED_REASONING_POLICY_VERSION = APIOperation( - input=CreateAutomatedReasoningPolicyVersionInput, - output=CreateAutomatedReasoningPolicyVersionOutput, - schema=_SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_VERSION, - input_schema=_SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_VERSION_INPUT, - output_schema=_SCHEMA_CREATE_AUTOMATED_REASONING_POLICY_VERSION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrock#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrock#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#TooManyTagsException"): TooManyTagsException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_TOO_MANY_TAGS_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteAutomatedReasoningPolicyInput: - """Dataclass for DeleteAutomatedReasoningPolicyInput structure.""" - - policy_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the Automated Reasoning policy to - delete. - """ - - force: bool = False - """ - Specifies whether to force delete the automated reasoning policy even if - it has active resources. When `false`, Amazon Bedrock validates if all - artifacts have been deleted (e.g. policy version, test case, test - result) for a policy before deletion. When `true`, Amazon Bedrock will - delete the policy and all its artifacts without validation. Default is - `false`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_AUTOMATED_REASONING_POLICY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.policy_arn is not None: - serializer.write_string( - _SCHEMA_DELETE_AUTOMATED_REASONING_POLICY_INPUT.members["policyArn"], - self.policy_arn, - ) - - if self.force is not None: - serializer.write_boolean( - _SCHEMA_DELETE_AUTOMATED_REASONING_POLICY_INPUT.members["force"], - self.force, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_arn"] = de.read_string( - _SCHEMA_DELETE_AUTOMATED_REASONING_POLICY_INPUT.members[ - "policyArn" - ] - ) - - case 1: - kwargs["force"] = de.read_boolean( - _SCHEMA_DELETE_AUTOMATED_REASONING_POLICY_INPUT.members["force"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_AUTOMATED_REASONING_POLICY_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteAutomatedReasoningPolicyOutput: - """Dataclass for DeleteAutomatedReasoningPolicyOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_AUTOMATED_REASONING_POLICY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_AUTOMATED_REASONING_POLICY_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ResourceInUseException(ServiceError): - """ - Thrown when attempting to delete or modify a resource that is currently - being used by other resources or operations. For example, trying to - delete an Automated Reasoning policy that is referenced by an active - guardrail. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESOURCE_IN_USE_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_RESOURCE_IN_USE_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_RESOURCE_IN_USE_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RESOURCE_IN_USE_EXCEPTION, consumer=_consumer) - return kwargs - - -DELETE_AUTOMATED_REASONING_POLICY = APIOperation( - input=DeleteAutomatedReasoningPolicyInput, - output=DeleteAutomatedReasoningPolicyOutput, - schema=_SCHEMA_DELETE_AUTOMATED_REASONING_POLICY, - input_schema=_SCHEMA_DELETE_AUTOMATED_REASONING_POLICY_INPUT, - output_schema=_SCHEMA_DELETE_AUTOMATED_REASONING_POLICY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrock#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceInUseException" - ): ResourceInUseException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_IN_USE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteAutomatedReasoningPolicyBuildWorkflowInput: - """ - Dataclass for DeleteAutomatedReasoningPolicyBuildWorkflowInput - structure. - """ - - policy_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the Automated Reasoning policy whose - build workflow you want to delete. - """ - - build_workflow_id: str | None = None - """The unique identifier of the build workflow to delete.""" - - last_updated_at: datetime | None = None - """ - The timestamp when the build workflow was last updated. This is used for - optimistic concurrency control to prevent accidental deletion of - workflows that have been modified. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DELETE_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.policy_arn is not None: - serializer.write_string( - _SCHEMA_DELETE_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT.members[ - "policyArn" - ], - self.policy_arn, - ) - - if self.build_workflow_id is not None: - serializer.write_string( - _SCHEMA_DELETE_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT.members[ - "buildWorkflowId" - ], - self.build_workflow_id, - ) - - if self.last_updated_at is not None: - serializer.write_timestamp( - _SCHEMA_DELETE_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT.members[ - "lastUpdatedAt" - ], - self.last_updated_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_arn"] = de.read_string( - _SCHEMA_DELETE_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT.members[ - "policyArn" - ] - ) - - case 1: - kwargs["build_workflow_id"] = de.read_string( - _SCHEMA_DELETE_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT.members[ - "buildWorkflowId" - ] - ) - - case 2: - kwargs["last_updated_at"] = de.read_timestamp( - _SCHEMA_DELETE_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT.members[ - "lastUpdatedAt" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT, - consumer=_consumer, - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteAutomatedReasoningPolicyBuildWorkflowOutput: - """ - Dataclass for DeleteAutomatedReasoningPolicyBuildWorkflowOutput - structure. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DELETE_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT, - consumer=_consumer, - ) - return kwargs - - -DELETE_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW = APIOperation( - input=DeleteAutomatedReasoningPolicyBuildWorkflowInput, - output=DeleteAutomatedReasoningPolicyBuildWorkflowOutput, - schema=_SCHEMA_DELETE_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW, - input_schema=_SCHEMA_DELETE_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT, - output_schema=_SCHEMA_DELETE_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrock#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceInUseException" - ): ResourceInUseException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_IN_USE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteAutomatedReasoningPolicyTestCaseInput: - """Dataclass for DeleteAutomatedReasoningPolicyTestCaseInput structure.""" - - policy_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the Automated Reasoning policy that - contains the test. - """ - - test_case_id: str | None = None - """The unique identifier of the test to delete.""" - - last_updated_at: datetime | None = None - """ - The timestamp when the test was last updated. This is used as a - concurrency token to prevent conflicting modifications. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DELETE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.policy_arn is not None: - serializer.write_string( - _SCHEMA_DELETE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT.members[ - "policyArn" - ], - self.policy_arn, - ) - - if self.test_case_id is not None: - serializer.write_string( - _SCHEMA_DELETE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT.members[ - "testCaseId" - ], - self.test_case_id, - ) - - if self.last_updated_at is not None: - serializer.write_timestamp( - _SCHEMA_DELETE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT.members[ - "lastUpdatedAt" - ], - self.last_updated_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_arn"] = de.read_string( - _SCHEMA_DELETE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT.members[ - "policyArn" - ] - ) - - case 1: - kwargs["test_case_id"] = de.read_string( - _SCHEMA_DELETE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT.members[ - "testCaseId" - ] - ) - - case 2: - kwargs["last_updated_at"] = de.read_timestamp( - _SCHEMA_DELETE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT.members[ - "lastUpdatedAt" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT, - consumer=_consumer, - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteAutomatedReasoningPolicyTestCaseOutput: - """Dataclass for DeleteAutomatedReasoningPolicyTestCaseOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DELETE_AUTOMATED_REASONING_POLICY_TEST_CASE_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_AUTOMATED_REASONING_POLICY_TEST_CASE_OUTPUT, - consumer=_consumer, - ) - return kwargs - - -DELETE_AUTOMATED_REASONING_POLICY_TEST_CASE = APIOperation( - input=DeleteAutomatedReasoningPolicyTestCaseInput, - output=DeleteAutomatedReasoningPolicyTestCaseOutput, - schema=_SCHEMA_DELETE_AUTOMATED_REASONING_POLICY_TEST_CASE, - input_schema=_SCHEMA_DELETE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT, - output_schema=_SCHEMA_DELETE_AUTOMATED_REASONING_POLICY_TEST_CASE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrock#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceInUseException" - ): ResourceInUseException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_IN_USE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ExportAutomatedReasoningPolicyVersionInput: - """Dataclass for ExportAutomatedReasoningPolicyVersionInput structure.""" - - policy_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the Automated Reasoning policy to - export. Can be either the unversioned ARN for the draft policy or a - versioned ARN for a specific policy version. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_EXPORT_AUTOMATED_REASONING_POLICY_VERSION_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.policy_arn is not None: - serializer.write_string( - _SCHEMA_EXPORT_AUTOMATED_REASONING_POLICY_VERSION_INPUT.members[ - "policyArn" - ], - self.policy_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_arn"] = de.read_string( - _SCHEMA_EXPORT_AUTOMATED_REASONING_POLICY_VERSION_INPUT.members[ - "policyArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EXPORT_AUTOMATED_REASONING_POLICY_VERSION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ExportAutomatedReasoningPolicyVersionOutput: - """Dataclass for ExportAutomatedReasoningPolicyVersionOutput structure.""" - - policy_definition: AutomatedReasoningPolicyDefinition - """ - The exported policy definition containing the formal logic rules, - variables, and custom variable types. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_EXPORT_AUTOMATED_REASONING_POLICY_VERSION_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_EXPORT_AUTOMATED_REASONING_POLICY_VERSION_OUTPUT.members[ - "policyDefinition" - ], - self.policy_definition, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_definition"] = ( - AutomatedReasoningPolicyDefinition.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EXPORT_AUTOMATED_REASONING_POLICY_VERSION_OUTPUT, consumer=_consumer - ) - if "policy_definition" not in kwargs: - kwargs["policy_definition"] = ( - AutomatedReasoningPolicyDefinition._smithy_default() - ) - return kwargs - - -EXPORT_AUTOMATED_REASONING_POLICY_VERSION = APIOperation( - input=ExportAutomatedReasoningPolicyVersionInput, - output=ExportAutomatedReasoningPolicyVersionOutput, - schema=_SCHEMA_EXPORT_AUTOMATED_REASONING_POLICY_VERSION, - input_schema=_SCHEMA_EXPORT_AUTOMATED_REASONING_POLICY_VERSION_INPUT, - output_schema=_SCHEMA_EXPORT_AUTOMATED_REASONING_POLICY_VERSION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetAutomatedReasoningPolicyInput: - """Dataclass for GetAutomatedReasoningPolicyInput structure.""" - - policy_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the Automated Reasoning policy to - retrieve. Can be either the unversioned ARN for the draft policy or an - ARN for a specific policy version. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_AUTOMATED_REASONING_POLICY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.policy_arn is not None: - serializer.write_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_INPUT.members["policyArn"], - self.policy_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_arn"] = de.read_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_INPUT.members[ - "policyArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetAutomatedReasoningPolicyOutput: - """Dataclass for GetAutomatedReasoningPolicyOutput structure.""" - - policy_arn: str - """The Amazon Resource Name (ARN) of the policy.""" - - name: str = field(repr=False) - """The name of the policy.""" - - version: str - """The version of the policy.""" - - policy_id: str - """The unique identifier of the policy.""" - - definition_hash: str - """The hash of the policy definition used as a concurrency token.""" - - updated_at: datetime - """The timestamp when the policy was last updated.""" - - description: str | None = field(repr=False, default=None) - """The description of the policy.""" - - kms_key_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the KMS key used to encrypt the - automated reasoning policy and its associated artifacts. If a KMS key is - not provided during the initial CreateAutomatedReasoningPolicyRequest, - the kmsKeyArn won't be included in the - GetAutomatedReasoningPolicyResponse. - """ - - created_at: datetime | None = None - """The timestamp when the policy was created.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_AUTOMATED_REASONING_POLICY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_OUTPUT.members["policyArn"], - self.policy_arn, - ) - serializer.write_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_OUTPUT.members["name"], self.name - ) - serializer.write_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_OUTPUT.members["version"], - self.version, - ) - serializer.write_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_OUTPUT.members["policyId"], - self.policy_id, - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_OUTPUT.members["description"], - self.description, - ) - - serializer.write_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_OUTPUT.members["definitionHash"], - self.definition_hash, - ) - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_OUTPUT.members["kmsKeyArn"], - self.kms_key_arn, - ) - - if self.created_at is not None: - serializer.write_timestamp( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_OUTPUT.members["createdAt"], - self.created_at, - ) - - serializer.write_timestamp( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_OUTPUT.members["updatedAt"], - self.updated_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_arn"] = de.read_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_OUTPUT.members[ - "policyArn" - ] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_OUTPUT.members["name"] - ) - - case 2: - kwargs["version"] = de.read_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_OUTPUT.members["version"] - ) - - case 3: - kwargs["policy_id"] = de.read_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_OUTPUT.members[ - "policyId" - ] - ) - - case 4: - kwargs["description"] = de.read_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_OUTPUT.members[ - "description" - ] - ) - - case 5: - kwargs["definition_hash"] = de.read_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_OUTPUT.members[ - "definitionHash" - ] - ) - - case 6: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_OUTPUT.members[ - "kmsKeyArn" - ] - ) - - case 7: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_OUTPUT.members[ - "createdAt" - ] - ) - - case 8: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_OUTPUT.members[ - "updatedAt" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_OUTPUT, consumer=_consumer - ) - if "policy_arn" not in kwargs: - kwargs["policy_arn"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "version" not in kwargs: - kwargs["version"] = "" - if "policy_id" not in kwargs: - kwargs["policy_id"] = "" - if "definition_hash" not in kwargs: - kwargs["definition_hash"] = "" - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -GET_AUTOMATED_REASONING_POLICY = APIOperation( - input=GetAutomatedReasoningPolicyInput, - output=GetAutomatedReasoningPolicyOutput, - schema=_SCHEMA_GET_AUTOMATED_REASONING_POLICY, - input_schema=_SCHEMA_GET_AUTOMATED_REASONING_POLICY_INPUT, - output_schema=_SCHEMA_GET_AUTOMATED_REASONING_POLICY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetAutomatedReasoningPolicyAnnotationsInput: - """Dataclass for GetAutomatedReasoningPolicyAnnotationsInput structure.""" - - policy_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the Automated Reasoning policy whose - annotations you want to retrieve. - """ - - build_workflow_id: str | None = None - """ - The unique identifier of the build workflow whose annotations you want - to retrieve. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_ANNOTATIONS_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.policy_arn is not None: - serializer.write_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_ANNOTATIONS_INPUT.members[ - "policyArn" - ], - self.policy_arn, - ) - - if self.build_workflow_id is not None: - serializer.write_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_ANNOTATIONS_INPUT.members[ - "buildWorkflowId" - ], - self.build_workflow_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_arn"] = de.read_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_ANNOTATIONS_INPUT.members[ - "policyArn" - ] - ) - - case 1: - kwargs["build_workflow_id"] = de.read_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_ANNOTATIONS_INPUT.members[ - "buildWorkflowId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_ANNOTATIONS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyAddRuleAnnotation: - """ - An annotation for adding a new rule to an Automated Reasoning policy - using a formal logical expression. - """ - - expression: str = field(repr=False) - """ - The formal logical expression that defines the rule, using mathematical - notation and referencing policy variables and types. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_ADD_RULE_ANNOTATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_ADD_RULE_ANNOTATION.members[ - "expression" - ], - self.expression, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["expression"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_ADD_RULE_ANNOTATION.members[ - "expression" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_ADD_RULE_ANNOTATION, consumer=_consumer - ) - if "expression" not in kwargs: - kwargs["expression"] = "" - return kwargs - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyAddRuleFromNaturalLanguageAnnotation: - """ - An annotation for adding a new rule to the policy by converting a - natural language description into a formal logical expression. - """ - - natural_language: str = field(repr=False) - """ - The natural language description of the rule that should be converted - into a formal logical expression. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_ADD_RULE_FROM_NATURAL_LANGUAGE_ANNOTATION, - self, - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_ADD_RULE_FROM_NATURAL_LANGUAGE_ANNOTATION.members[ - "naturalLanguage" - ], - self.natural_language, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["natural_language"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_ADD_RULE_FROM_NATURAL_LANGUAGE_ANNOTATION.members[ - "naturalLanguage" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_ADD_RULE_FROM_NATURAL_LANGUAGE_ANNOTATION, - consumer=_consumer, - ) - if "natural_language" not in kwargs: - kwargs["natural_language"] = "" - return kwargs - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyAddTypeAnnotation: - """ - An annotation for adding a new custom type to an Automated Reasoning - policy, defining a set of possible values for variables. - """ - - name: str = field(repr=False) - """ - The name of the new custom type. This name will be used to reference the - type in variable definitions and rules. - """ - - description: str = field(repr=False) - """ - A description of what the custom type represents and how it should be - used in the policy. - """ - - values: list[AutomatedReasoningPolicyDefinitionTypeValue] - """ - The list of possible values that variables of this type can take, each - with its own description and identifier. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_ADD_TYPE_ANNOTATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_ADD_TYPE_ANNOTATION.members["name"], - self.name, - ) - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_ADD_TYPE_ANNOTATION.members[ - "description" - ], - self.description, - ) - _serialize_automated_reasoning_policy_definition_type_value_list( - serializer, - _SCHEMA_AUTOMATED_REASONING_POLICY_ADD_TYPE_ANNOTATION.members["values"], - self.values, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_ADD_TYPE_ANNOTATION.members[ - "name" - ] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_ADD_TYPE_ANNOTATION.members[ - "description" - ] - ) - - case 2: - kwargs["values"] = ( - _deserialize_automated_reasoning_policy_definition_type_value_list( - de, - _SCHEMA_AUTOMATED_REASONING_POLICY_ADD_TYPE_ANNOTATION.members[ - "values" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_ADD_TYPE_ANNOTATION, consumer=_consumer - ) - if "name" not in kwargs: - kwargs["name"] = "" - if "description" not in kwargs: - kwargs["description"] = "" - if "values" not in kwargs: - kwargs["values"] = [] - return kwargs - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyAddVariableAnnotation: - """ - An annotation for adding a new variable to an Automated Reasoning - policy, which can be used in rule expressions. - """ - - name: str = field(repr=False) - """ - The name of the new variable. This name will be used to reference the - variable in rule expressions. - """ - - type: str = field(repr=False) - """ - The type of the variable, which can be a built-in type (like string or - number) or a custom type defined in the policy. - """ - - description: str = field(repr=False) - """ - A description of what the variable represents and how it should be used - in rules. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_ADD_VARIABLE_ANNOTATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_ADD_VARIABLE_ANNOTATION.members["name"], - self.name, - ) - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_ADD_VARIABLE_ANNOTATION.members["type"], - self.type, - ) - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_ADD_VARIABLE_ANNOTATION.members[ - "description" - ], - self.description, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_ADD_VARIABLE_ANNOTATION.members[ - "name" - ] - ) - - case 1: - kwargs["type"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_ADD_VARIABLE_ANNOTATION.members[ - "type" - ] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_ADD_VARIABLE_ANNOTATION.members[ - "description" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_ADD_VARIABLE_ANNOTATION, - consumer=_consumer, - ) - if "name" not in kwargs: - kwargs["name"] = "" - if "type" not in kwargs: - kwargs["type"] = "" - if "description" not in kwargs: - kwargs["description"] = "" - return kwargs - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyDeleteRuleAnnotation: - """An annotation for removing a rule from an Automated Reasoning policy.""" - - rule_id: str - """The unique identifier of the rule to delete from the policy.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_DELETE_RULE_ANNOTATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_DELETE_RULE_ANNOTATION.members["ruleId"], - self.rule_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rule_id"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_DELETE_RULE_ANNOTATION.members[ - "ruleId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_DELETE_RULE_ANNOTATION, - consumer=_consumer, - ) - if "rule_id" not in kwargs: - kwargs["rule_id"] = "" - return kwargs - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyDeleteTypeAnnotation: - """ - An annotation for removing a custom type from an Automated Reasoning - policy. - """ - - name: str = field(repr=False) - """ - The name of the custom type to delete from the policy. The type must not - be referenced by any variables or rules. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_DELETE_TYPE_ANNOTATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_DELETE_TYPE_ANNOTATION.members["name"], - self.name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_DELETE_TYPE_ANNOTATION.members[ - "name" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_DELETE_TYPE_ANNOTATION, - consumer=_consumer, - ) - if "name" not in kwargs: - kwargs["name"] = "" - return kwargs - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyDeleteVariableAnnotation: - """ - An annotation for removing a variable from an Automated Reasoning - policy. - """ - - name: str = field(repr=False) - """ - The name of the variable to delete from the policy. The variable must - not be referenced by any rules. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_DELETE_VARIABLE_ANNOTATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_DELETE_VARIABLE_ANNOTATION.members[ - "name" - ], - self.name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_DELETE_VARIABLE_ANNOTATION.members[ - "name" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_DELETE_VARIABLE_ANNOTATION, - consumer=_consumer, - ) - if "name" not in kwargs: - kwargs["name"] = "" - return kwargs - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyIngestContentAnnotation: - """ - An annotation for processing and incorporating new content into an - Automated Reasoning policy. - """ - - content: str = field(repr=False) - """ - The new content to be analyzed and incorporated into the policy, such as - additional documents or rule descriptions. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_INGEST_CONTENT_ANNOTATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_INGEST_CONTENT_ANNOTATION.members[ - "content" - ], - self.content, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["content"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_INGEST_CONTENT_ANNOTATION.members[ - "content" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_INGEST_CONTENT_ANNOTATION, - consumer=_consumer, - ) - if "content" not in kwargs: - kwargs["content"] = "" - return kwargs - - -def _serialize_automated_reasoning_policy_definition_rule_id_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_automated_reasoning_policy_definition_rule_id_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyUpdateFromRuleFeedbackAnnotation: - """ - An annotation for updating the policy based on feedback about how - specific rules performed during testing or real-world usage. - """ - - feedback: str = field(repr=False) - """ - The feedback information about rule performance, including suggestions - for improvements or corrections. - """ - - rule_ids: list[str] | None = None - """The list of rule identifiers that the feedback applies to.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_FROM_RULE_FEEDBACK_ANNOTATION, - self, - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rule_ids is not None: - _serialize_automated_reasoning_policy_definition_rule_id_list( - serializer, - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_FROM_RULE_FEEDBACK_ANNOTATION.members[ - "ruleIds" - ], - self.rule_ids, - ) - - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_FROM_RULE_FEEDBACK_ANNOTATION.members[ - "feedback" - ], - self.feedback, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rule_ids"] = ( - _deserialize_automated_reasoning_policy_definition_rule_id_list( - de, - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_FROM_RULE_FEEDBACK_ANNOTATION.members[ - "ruleIds" - ], - ) - ) - - case 1: - kwargs["feedback"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_FROM_RULE_FEEDBACK_ANNOTATION.members[ - "feedback" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_FROM_RULE_FEEDBACK_ANNOTATION, - consumer=_consumer, - ) - if "feedback" not in kwargs: - kwargs["feedback"] = "" - return kwargs - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyUpdateFromScenarioFeedbackAnnotation: - """ - An annotation for updating the policy based on feedback about how it - performed on specific test scenarios. - """ - - scenario_expression: str = field(repr=False) - """ - The logical expression that defines the test scenario that generated - this feedback. - """ - - rule_ids: list[str] | None = None - """ - The list of rule identifiers that were involved in the scenario being - evaluated. - """ - - feedback: str | None = field(repr=False, default=None) - """ - The feedback information about scenario performance, including any - issues or improvements identified. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_FROM_SCENARIO_FEEDBACK_ANNOTATION, - self, - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rule_ids is not None: - _serialize_automated_reasoning_policy_definition_rule_id_list( - serializer, - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_FROM_SCENARIO_FEEDBACK_ANNOTATION.members[ - "ruleIds" - ], - self.rule_ids, - ) - - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_FROM_SCENARIO_FEEDBACK_ANNOTATION.members[ - "scenarioExpression" - ], - self.scenario_expression, - ) - if self.feedback is not None: - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_FROM_SCENARIO_FEEDBACK_ANNOTATION.members[ - "feedback" - ], - self.feedback, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rule_ids"] = ( - _deserialize_automated_reasoning_policy_definition_rule_id_list( - de, - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_FROM_SCENARIO_FEEDBACK_ANNOTATION.members[ - "ruleIds" - ], - ) - ) - - case 1: - kwargs["scenario_expression"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_FROM_SCENARIO_FEEDBACK_ANNOTATION.members[ - "scenarioExpression" - ] - ) - - case 2: - kwargs["feedback"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_FROM_SCENARIO_FEEDBACK_ANNOTATION.members[ - "feedback" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_FROM_SCENARIO_FEEDBACK_ANNOTATION, - consumer=_consumer, - ) - if "scenario_expression" not in kwargs: - kwargs["scenario_expression"] = "" - return kwargs - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyUpdateRuleAnnotation: - """ - An annotation for modifying an existing rule in an Automated Reasoning - policy. - """ - - rule_id: str - """The unique identifier of the rule to update.""" - - expression: str = field(repr=False) - """ - The new formal logical expression for the rule, replacing the previous - expression. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_RULE_ANNOTATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_RULE_ANNOTATION.members["ruleId"], - self.rule_id, - ) - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_RULE_ANNOTATION.members[ - "expression" - ], - self.expression, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rule_id"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_RULE_ANNOTATION.members[ - "ruleId" - ] - ) - - case 1: - kwargs["expression"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_RULE_ANNOTATION.members[ - "expression" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_RULE_ANNOTATION, - consumer=_consumer, - ) - if "rule_id" not in kwargs: - kwargs["rule_id"] = "" - if "expression" not in kwargs: - kwargs["expression"] = "" - return kwargs - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyAddTypeValue: - """ - Represents a single value that can be added to an existing custom type - in the policy. - """ - - value: str - """The identifier or name of the new value to add to the type.""" - - description: str | None = field(repr=False, default=None) - """ - A description of what this new type value represents and when it should - be used. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_REASONING_POLICY_ADD_TYPE_VALUE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_ADD_TYPE_VALUE.members["value"], - self.value, - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_ADD_TYPE_VALUE.members[ - "description" - ], - self.description, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["value"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_ADD_TYPE_VALUE.members[ - "value" - ] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_ADD_TYPE_VALUE.members[ - "description" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_ADD_TYPE_VALUE, consumer=_consumer - ) - if "value" not in kwargs: - kwargs["value"] = "" - return kwargs - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyDeleteTypeValue: - """ - Represents a value to be removed from an existing custom type in the - policy. - """ - - value: str - """The identifier or name of the value to remove from the type.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_DELETE_TYPE_VALUE, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_DELETE_TYPE_VALUE.members["value"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["value"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_DELETE_TYPE_VALUE.members[ - "value" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_DELETE_TYPE_VALUE, consumer=_consumer - ) - if "value" not in kwargs: - kwargs["value"] = "" - return kwargs - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyUpdateTypeValue: - """Represents a modification to a value within an existing custom type.""" - - value: str - """The current identifier or name of the type value to update.""" - - new_value: str | None = None - """The new identifier or name for the type value, if you want to rename it.""" - - description: str | None = field(repr=False, default=None) - """ - The new description for the type value, replacing the previous - description. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_TYPE_VALUE, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_TYPE_VALUE.members["value"], - self.value, - ) - if self.new_value is not None: - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_TYPE_VALUE.members[ - "newValue" - ], - self.new_value, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_TYPE_VALUE.members[ - "description" - ], - self.description, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["value"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_TYPE_VALUE.members[ - "value" - ] - ) - - case 1: - kwargs["new_value"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_TYPE_VALUE.members[ - "newValue" - ] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_TYPE_VALUE.members[ - "description" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_TYPE_VALUE, consumer=_consumer - ) - if "value" not in kwargs: - kwargs["value"] = "" - return kwargs - - -@dataclass -class AutomatedReasoningPolicyTypeValueAnnotationAddTypeValue: - """An operation to add a new value to an existing custom type.""" - - value: AutomatedReasoningPolicyAddTypeValue - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_TYPE_VALUE_ANNOTATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_TYPE_VALUE_ANNOTATION.members[ - "addTypeValue" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=AutomatedReasoningPolicyAddTypeValue.deserialize(deserializer)) - - -@dataclass -class AutomatedReasoningPolicyTypeValueAnnotationUpdateTypeValue: - """An operation to modify an existing value within a custom type.""" - - value: AutomatedReasoningPolicyUpdateTypeValue - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_TYPE_VALUE_ANNOTATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_TYPE_VALUE_ANNOTATION.members[ - "updateTypeValue" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=AutomatedReasoningPolicyUpdateTypeValue.deserialize(deserializer) - ) - - -@dataclass -class AutomatedReasoningPolicyTypeValueAnnotationDeleteTypeValue: - """An operation to remove a value from an existing custom type.""" - - value: AutomatedReasoningPolicyDeleteTypeValue - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_TYPE_VALUE_ANNOTATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_TYPE_VALUE_ANNOTATION.members[ - "deleteTypeValue" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=AutomatedReasoningPolicyDeleteTypeValue.deserialize(deserializer) - ) - - -@dataclass -class AutomatedReasoningPolicyTypeValueAnnotationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -AutomatedReasoningPolicyTypeValueAnnotation = Union[ - AutomatedReasoningPolicyTypeValueAnnotationAddTypeValue - | AutomatedReasoningPolicyTypeValueAnnotationUpdateTypeValue - | AutomatedReasoningPolicyTypeValueAnnotationDeleteTypeValue - | AutomatedReasoningPolicyTypeValueAnnotationUnknown -] -""" -An annotation for managing values within custom types, including adding, -updating, or removing specific type values. -""" - - -class _AutomatedReasoningPolicyTypeValueAnnotationDeserializer: - _result: AutomatedReasoningPolicyTypeValueAnnotation | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> AutomatedReasoningPolicyTypeValueAnnotation: - self._result = None - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_TYPE_VALUE_ANNOTATION, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - AutomatedReasoningPolicyTypeValueAnnotationAddTypeValue.deserialize( - de - ) - ) - - case 1: - self._set_result( - AutomatedReasoningPolicyTypeValueAnnotationUpdateTypeValue.deserialize( - de - ) - ) - - case 2: - self._set_result( - AutomatedReasoningPolicyTypeValueAnnotationDeleteTypeValue.deserialize( - de - ) - ) - - case _: - self._set_result( - AutomatedReasoningPolicyTypeValueAnnotationUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: AutomatedReasoningPolicyTypeValueAnnotation) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_automated_reasoning_policy_type_value_annotation_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[AutomatedReasoningPolicyTypeValueAnnotation], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_automated_reasoning_policy_type_value_annotation_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AutomatedReasoningPolicyTypeValueAnnotation]: - result: list[AutomatedReasoningPolicyTypeValueAnnotation] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append( - _AutomatedReasoningPolicyTypeValueAnnotationDeserializer().deserialize( - d - ) - ) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyUpdateTypeAnnotation: - """ - An annotation for modifying an existing custom type in an Automated - Reasoning policy. - """ - - name: str = field(repr=False) - """The current name of the custom type to update.""" - - values: list[AutomatedReasoningPolicyTypeValueAnnotation] - """ - The updated list of values for the custom type, which can include - additions, modifications, or removals. - """ - - new_name: str | None = field(repr=False, default=None) - """ - The new name for the custom type, if you want to rename it. If not - provided, the name remains unchanged. - """ - - description: str | None = field(repr=False, default=None) - """ - The new description for the custom type, replacing the previous - description. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_TYPE_ANNOTATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_TYPE_ANNOTATION.members["name"], - self.name, - ) - if self.new_name is not None: - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_TYPE_ANNOTATION.members[ - "newName" - ], - self.new_name, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_TYPE_ANNOTATION.members[ - "description" - ], - self.description, - ) - - _serialize_automated_reasoning_policy_type_value_annotation_list( - serializer, - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_TYPE_ANNOTATION.members["values"], - self.values, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_TYPE_ANNOTATION.members[ - "name" - ] - ) - - case 1: - kwargs["new_name"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_TYPE_ANNOTATION.members[ - "newName" - ] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_TYPE_ANNOTATION.members[ - "description" - ] - ) - - case 3: - kwargs["values"] = ( - _deserialize_automated_reasoning_policy_type_value_annotation_list( - de, - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_TYPE_ANNOTATION.members[ - "values" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_TYPE_ANNOTATION, - consumer=_consumer, - ) - if "name" not in kwargs: - kwargs["name"] = "" - if "values" not in kwargs: - kwargs["values"] = [] - return kwargs - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyUpdateVariableAnnotation: - """ - An annotation for modifying an existing variable in an Automated - Reasoning policy. - """ - - name: str = field(repr=False) - """The current name of the variable to update.""" - - new_name: str | None = field(repr=False, default=None) - """ - The new name for the variable, if you want to rename it. If not - provided, the name remains unchanged. - """ - - description: str | None = field(repr=False, default=None) - """ - The new description for the variable, replacing the previous - description. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_VARIABLE_ANNOTATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_VARIABLE_ANNOTATION.members[ - "name" - ], - self.name, - ) - if self.new_name is not None: - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_VARIABLE_ANNOTATION.members[ - "newName" - ], - self.new_name, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_VARIABLE_ANNOTATION.members[ - "description" - ], - self.description, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_VARIABLE_ANNOTATION.members[ - "name" - ] - ) - - case 1: - kwargs["new_name"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_VARIABLE_ANNOTATION.members[ - "newName" - ] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_VARIABLE_ANNOTATION.members[ - "description" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_VARIABLE_ANNOTATION, - consumer=_consumer, - ) - if "name" not in kwargs: - kwargs["name"] = "" - return kwargs - - -@dataclass -class AutomatedReasoningPolicyAnnotationAddType: - """ - An operation to add a new custom type to the policy, defining a set of - possible values for policy variables. - """ - - value: AutomatedReasoningPolicyAddTypeAnnotation - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_REASONING_POLICY_ANNOTATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_ANNOTATION.members["addType"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=AutomatedReasoningPolicyAddTypeAnnotation.deserialize(deserializer) - ) - - -@dataclass -class AutomatedReasoningPolicyAnnotationUpdateType: - """ - An operation to modify an existing custom type in the policy, such as - changing its name, description, or allowed values. - """ - - value: AutomatedReasoningPolicyUpdateTypeAnnotation - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_REASONING_POLICY_ANNOTATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_ANNOTATION.members["updateType"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=AutomatedReasoningPolicyUpdateTypeAnnotation.deserialize(deserializer) - ) - - -@dataclass -class AutomatedReasoningPolicyAnnotationDeleteType: - """ - An operation to remove a custom type from the policy. The type must not - be referenced by any variables or rules. - """ - - value: AutomatedReasoningPolicyDeleteTypeAnnotation - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_REASONING_POLICY_ANNOTATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_ANNOTATION.members["deleteType"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=AutomatedReasoningPolicyDeleteTypeAnnotation.deserialize(deserializer) - ) - - -@dataclass -class AutomatedReasoningPolicyAnnotationAddVariable: - """ - An operation to add a new variable to the policy, which can be used in - rule expressions to represent dynamic values. - """ - - value: AutomatedReasoningPolicyAddVariableAnnotation - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_REASONING_POLICY_ANNOTATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_ANNOTATION.members["addVariable"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=AutomatedReasoningPolicyAddVariableAnnotation.deserialize( - deserializer - ) - ) - - -@dataclass -class AutomatedReasoningPolicyAnnotationUpdateVariable: - """ - An operation to modify an existing variable in the policy, such as - changing its name, type, or description. - """ - - value: AutomatedReasoningPolicyUpdateVariableAnnotation - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_REASONING_POLICY_ANNOTATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_ANNOTATION.members["updateVariable"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=AutomatedReasoningPolicyUpdateVariableAnnotation.deserialize( - deserializer - ) - ) - - -@dataclass -class AutomatedReasoningPolicyAnnotationDeleteVariable: - """ - An operation to remove a variable from the policy. The variable must not - be referenced by any rules. - """ - - value: AutomatedReasoningPolicyDeleteVariableAnnotation - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_REASONING_POLICY_ANNOTATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_ANNOTATION.members["deleteVariable"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=AutomatedReasoningPolicyDeleteVariableAnnotation.deserialize( - deserializer - ) - ) - - -@dataclass -class AutomatedReasoningPolicyAnnotationAddRule: - """ - An operation to add a new logical rule to the policy using formal - mathematical expressions. - """ - - value: AutomatedReasoningPolicyAddRuleAnnotation - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_REASONING_POLICY_ANNOTATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_ANNOTATION.members["addRule"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=AutomatedReasoningPolicyAddRuleAnnotation.deserialize(deserializer) - ) - - -@dataclass -class AutomatedReasoningPolicyAnnotationUpdateRule: - """ - An operation to modify an existing rule in the policy, such as changing - its logical expression or conditions. - """ - - value: AutomatedReasoningPolicyUpdateRuleAnnotation - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_REASONING_POLICY_ANNOTATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_ANNOTATION.members["updateRule"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=AutomatedReasoningPolicyUpdateRuleAnnotation.deserialize(deserializer) - ) - - -@dataclass -class AutomatedReasoningPolicyAnnotationDeleteRule: - """An operation to remove a rule from the policy.""" - - value: AutomatedReasoningPolicyDeleteRuleAnnotation - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_REASONING_POLICY_ANNOTATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_ANNOTATION.members["deleteRule"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=AutomatedReasoningPolicyDeleteRuleAnnotation.deserialize(deserializer) - ) - - -@dataclass -class AutomatedReasoningPolicyAnnotationAddRuleFromNaturalLanguage: - """ - An operation to add a new rule by converting natural language - descriptions into formal logical expressions. - """ - - value: AutomatedReasoningPolicyAddRuleFromNaturalLanguageAnnotation - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_REASONING_POLICY_ANNOTATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_ANNOTATION.members[ - "addRuleFromNaturalLanguage" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=AutomatedReasoningPolicyAddRuleFromNaturalLanguageAnnotation.deserialize( - deserializer - ) - ) - - -@dataclass -class AutomatedReasoningPolicyAnnotationUpdateFromRulesFeedback: - """ - An operation to update the policy based on feedback about how specific - rules performed during testing or validation. - """ - - value: AutomatedReasoningPolicyUpdateFromRuleFeedbackAnnotation - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_REASONING_POLICY_ANNOTATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_ANNOTATION.members[ - "updateFromRulesFeedback" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=AutomatedReasoningPolicyUpdateFromRuleFeedbackAnnotation.deserialize( - deserializer - ) - ) - - -@dataclass -class AutomatedReasoningPolicyAnnotationUpdateFromScenarioFeedback: - """ - An operation to update the policy based on feedback about how it - performed on specific test scenarios. - """ - - value: AutomatedReasoningPolicyUpdateFromScenarioFeedbackAnnotation - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_REASONING_POLICY_ANNOTATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_ANNOTATION.members[ - "updateFromScenarioFeedback" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=AutomatedReasoningPolicyUpdateFromScenarioFeedbackAnnotation.deserialize( - deserializer - ) - ) - - -@dataclass -class AutomatedReasoningPolicyAnnotationIngestContent: - """ - An operation to process and incorporate new content into the policy, - extracting additional rules and concepts. - """ - - value: AutomatedReasoningPolicyIngestContentAnnotation - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_REASONING_POLICY_ANNOTATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_ANNOTATION.members["ingestContent"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=AutomatedReasoningPolicyIngestContentAnnotation.deserialize( - deserializer - ) - ) - - -@dataclass -class AutomatedReasoningPolicyAnnotationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -AutomatedReasoningPolicyAnnotation = Union[ - AutomatedReasoningPolicyAnnotationAddType - | AutomatedReasoningPolicyAnnotationUpdateType - | AutomatedReasoningPolicyAnnotationDeleteType - | AutomatedReasoningPolicyAnnotationAddVariable - | AutomatedReasoningPolicyAnnotationUpdateVariable - | AutomatedReasoningPolicyAnnotationDeleteVariable - | AutomatedReasoningPolicyAnnotationAddRule - | AutomatedReasoningPolicyAnnotationUpdateRule - | AutomatedReasoningPolicyAnnotationDeleteRule - | AutomatedReasoningPolicyAnnotationAddRuleFromNaturalLanguage - | AutomatedReasoningPolicyAnnotationUpdateFromRulesFeedback - | AutomatedReasoningPolicyAnnotationUpdateFromScenarioFeedback - | AutomatedReasoningPolicyAnnotationIngestContent - | AutomatedReasoningPolicyAnnotationUnknown -] -""" -Contains the various operations that can be performed on an Automated -Reasoning policy, including adding, updating, and deleting rules, -variables, and types. -""" - - -class _AutomatedReasoningPolicyAnnotationDeserializer: - _result: AutomatedReasoningPolicyAnnotation | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> AutomatedReasoningPolicyAnnotation: - self._result = None - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_ANNOTATION, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - AutomatedReasoningPolicyAnnotationAddType.deserialize(de) - ) - - case 1: - self._set_result( - AutomatedReasoningPolicyAnnotationUpdateType.deserialize(de) - ) - - case 2: - self._set_result( - AutomatedReasoningPolicyAnnotationDeleteType.deserialize(de) - ) - - case 3: - self._set_result( - AutomatedReasoningPolicyAnnotationAddVariable.deserialize(de) - ) - - case 4: - self._set_result( - AutomatedReasoningPolicyAnnotationUpdateVariable.deserialize(de) - ) - - case 5: - self._set_result( - AutomatedReasoningPolicyAnnotationDeleteVariable.deserialize(de) - ) - - case 6: - self._set_result( - AutomatedReasoningPolicyAnnotationAddRule.deserialize(de) - ) - - case 7: - self._set_result( - AutomatedReasoningPolicyAnnotationUpdateRule.deserialize(de) - ) - - case 8: - self._set_result( - AutomatedReasoningPolicyAnnotationDeleteRule.deserialize(de) - ) - - case 9: - self._set_result( - AutomatedReasoningPolicyAnnotationAddRuleFromNaturalLanguage.deserialize( - de - ) - ) - - case 10: - self._set_result( - AutomatedReasoningPolicyAnnotationUpdateFromRulesFeedback.deserialize( - de - ) - ) - - case 11: - self._set_result( - AutomatedReasoningPolicyAnnotationUpdateFromScenarioFeedback.deserialize( - de - ) - ) - - case 12: - self._set_result( - AutomatedReasoningPolicyAnnotationIngestContent.deserialize(de) - ) - - case _: - self._set_result( - AutomatedReasoningPolicyAnnotationUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: AutomatedReasoningPolicyAnnotation) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_automated_reasoning_policy_annotation_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[AutomatedReasoningPolicyAnnotation], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_automated_reasoning_policy_annotation_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AutomatedReasoningPolicyAnnotation]: - result: list[AutomatedReasoningPolicyAnnotation] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append( - _AutomatedReasoningPolicyAnnotationDeserializer().deserialize(d) - ) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GetAutomatedReasoningPolicyAnnotationsOutput: - """Dataclass for GetAutomatedReasoningPolicyAnnotationsOutput structure.""" - - policy_arn: str - """The Amazon Resource Name (ARN) of the Automated Reasoning policy.""" - - name: str = field(repr=False) - """The name of the Automated Reasoning policy.""" - - build_workflow_id: str - """The unique identifier of the build workflow.""" - - annotations: list[AutomatedReasoningPolicyAnnotation] - """ - The current set of annotations containing rules, variables, and types - extracted from the source documents. These can be modified before - finalizing the policy. - """ - - annotation_set_hash: str - """ - A hash value representing the current state of the annotations. This is - used for optimistic concurrency control when updating annotations. - """ - - updated_at: datetime - """The timestamp when the annotations were last updated.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_ANNOTATIONS_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_ANNOTATIONS_OUTPUT.members[ - "policyArn" - ], - self.policy_arn, - ) - serializer.write_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_ANNOTATIONS_OUTPUT.members["name"], - self.name, - ) - serializer.write_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_ANNOTATIONS_OUTPUT.members[ - "buildWorkflowId" - ], - self.build_workflow_id, - ) - _serialize_automated_reasoning_policy_annotation_list( - serializer, - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_ANNOTATIONS_OUTPUT.members[ - "annotations" - ], - self.annotations, - ) - serializer.write_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_ANNOTATIONS_OUTPUT.members[ - "annotationSetHash" - ], - self.annotation_set_hash, - ) - serializer.write_timestamp( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_ANNOTATIONS_OUTPUT.members[ - "updatedAt" - ], - self.updated_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_arn"] = de.read_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_ANNOTATIONS_OUTPUT.members[ - "policyArn" - ] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_ANNOTATIONS_OUTPUT.members[ - "name" - ] - ) - - case 2: - kwargs["build_workflow_id"] = de.read_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_ANNOTATIONS_OUTPUT.members[ - "buildWorkflowId" - ] - ) - - case 3: - kwargs["annotations"] = ( - _deserialize_automated_reasoning_policy_annotation_list( - de, - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_ANNOTATIONS_OUTPUT.members[ - "annotations" - ], - ) - ) - - case 4: - kwargs["annotation_set_hash"] = de.read_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_ANNOTATIONS_OUTPUT.members[ - "annotationSetHash" - ] - ) - - case 5: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_ANNOTATIONS_OUTPUT.members[ - "updatedAt" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_ANNOTATIONS_OUTPUT, - consumer=_consumer, - ) - if "policy_arn" not in kwargs: - kwargs["policy_arn"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "build_workflow_id" not in kwargs: - kwargs["build_workflow_id"] = "" - if "annotations" not in kwargs: - kwargs["annotations"] = [] - if "annotation_set_hash" not in kwargs: - kwargs["annotation_set_hash"] = "" - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -GET_AUTOMATED_REASONING_POLICY_ANNOTATIONS = APIOperation( - input=GetAutomatedReasoningPolicyAnnotationsInput, - output=GetAutomatedReasoningPolicyAnnotationsOutput, - schema=_SCHEMA_GET_AUTOMATED_REASONING_POLICY_ANNOTATIONS, - input_schema=_SCHEMA_GET_AUTOMATED_REASONING_POLICY_ANNOTATIONS_INPUT, - output_schema=_SCHEMA_GET_AUTOMATED_REASONING_POLICY_ANNOTATIONS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetAutomatedReasoningPolicyBuildWorkflowInput: - """Dataclass for GetAutomatedReasoningPolicyBuildWorkflowInput structure.""" - - policy_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the Automated Reasoning policy whose - build workflow you want to retrieve. - """ - - build_workflow_id: str | None = None - """The unique identifier of the build workflow to retrieve.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.policy_arn is not None: - serializer.write_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT.members[ - "policyArn" - ], - self.policy_arn, - ) - - if self.build_workflow_id is not None: - serializer.write_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT.members[ - "buildWorkflowId" - ], - self.build_workflow_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_arn"] = de.read_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT.members[ - "policyArn" - ] - ) - - case 1: - kwargs["build_workflow_id"] = de.read_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT.members[ - "buildWorkflowId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT, - consumer=_consumer, - ) - return kwargs - - -class AutomatedReasoningPolicyBuildWorkflowType(UnknownEnumMixin, StrEnum): - INGEST_CONTENT = "INGEST_CONTENT" - REFINE_POLICY = "REFINE_POLICY" - IMPORT_POLICY = "IMPORT_POLICY" - GENERATE_FIDELITY_REPORT = "GENERATE_FIDELITY_REPORT" - GENERATE_POLICY_SCENARIOS = "GENERATE_POLICY_SCENARIOS" - RESOLVE_POLICY_AMBIGUITIES = "RESOLVE_POLICY_AMBIGUITIES" - ITERATIVELY_REFINE_POLICY = "ITERATIVELY_REFINE_POLICY" - - -class AutomatedReasoningPolicyBuildDocumentContentType(UnknownEnumMixin, StrEnum): - PDF = "pdf" - TEXT = "txt" - - -class AutomatedReasoningPolicyBuildWorkflowStatus(UnknownEnumMixin, StrEnum): - SCHEDULED = "SCHEDULED" - CANCEL_REQUESTED = "CANCEL_REQUESTED" - PREPROCESSING = "PREPROCESSING" - BUILDING = "BUILDING" - TESTING = "TESTING" - COMPLETED = "COMPLETED" - FAILED = "FAILED" - CANCELLED = "CANCELLED" - - -@dataclass(kw_only=True) -class GetAutomatedReasoningPolicyBuildWorkflowOutput: - """Dataclass for GetAutomatedReasoningPolicyBuildWorkflowOutput structure.""" - - policy_arn: str - """The Amazon Resource Name (ARN) of the Automated Reasoning policy.""" - - build_workflow_id: str - """The unique identifier of the build workflow.""" - - status: str - """ - The current status of the build workflow (e.g., RUNNING, COMPLETED, - FAILED, CANCELLED). - """ - - build_workflow_type: str - """ - The type of build workflow being executed (e.g., DOCUMENT_INGESTION, - POLICY_REPAIR). - """ - - created_at: datetime - """The timestamp when the build workflow was created.""" - - updated_at: datetime - """The timestamp when the build workflow was last updated.""" - - document_name: str | None = field(repr=False, default=None) - """The name of the source document used in the build workflow.""" - - document_content_type: str | None = None - """ - The content type of the source document (e.g., text/plain, - application/pdf). - """ - - document_description: str | None = field(repr=False, default=None) - """ - A detailed description of the document's content and how it should be - used in the policy generation process. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT.members[ - "policyArn" - ], - self.policy_arn, - ) - serializer.write_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT.members[ - "buildWorkflowId" - ], - self.build_workflow_id, - ) - serializer.write_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT.members[ - "status" - ], - self.status, - ) - serializer.write_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT.members[ - "buildWorkflowType" - ], - self.build_workflow_type, - ) - if self.document_name is not None: - serializer.write_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT.members[ - "documentName" - ], - self.document_name, - ) - - if self.document_content_type is not None: - serializer.write_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT.members[ - "documentContentType" - ], - self.document_content_type, - ) - - if self.document_description is not None: - serializer.write_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT.members[ - "documentDescription" - ], - self.document_description, - ) - - serializer.write_timestamp( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT.members[ - "createdAt" - ], - self.created_at, - ) - serializer.write_timestamp( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT.members[ - "updatedAt" - ], - self.updated_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_arn"] = de.read_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT.members[ - "policyArn" - ] - ) - - case 1: - kwargs["build_workflow_id"] = de.read_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT.members[ - "buildWorkflowId" - ] - ) - - case 2: - kwargs["status"] = AutomatedReasoningPolicyBuildWorkflowStatus( - de.read_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT.members[ - "status" - ] - ) - ) - - case 3: - kwargs["build_workflow_type"] = ( - AutomatedReasoningPolicyBuildWorkflowType( - de.read_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT.members[ - "buildWorkflowType" - ] - ) - ) - ) - - case 4: - kwargs["document_name"] = de.read_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT.members[ - "documentName" - ] - ) - - case 5: - kwargs["document_content_type"] = ( - AutomatedReasoningPolicyBuildDocumentContentType( - de.read_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT.members[ - "documentContentType" - ] - ) - ) - ) - - case 6: - kwargs["document_description"] = de.read_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT.members[ - "documentDescription" - ] - ) - - case 7: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT.members[ - "createdAt" - ] - ) - - case 8: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT.members[ - "updatedAt" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT, - consumer=_consumer, - ) - if "policy_arn" not in kwargs: - kwargs["policy_arn"] = "" - if "build_workflow_id" not in kwargs: - kwargs["build_workflow_id"] = "" - if "status" not in kwargs: - kwargs["status"] = AutomatedReasoningPolicyBuildWorkflowStatus._corrected( - "" - ) - if "build_workflow_type" not in kwargs: - kwargs["build_workflow_type"] = ( - AutomatedReasoningPolicyBuildWorkflowType._corrected("") - ) - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW = APIOperation( - input=GetAutomatedReasoningPolicyBuildWorkflowInput, - output=GetAutomatedReasoningPolicyBuildWorkflowOutput, - schema=_SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW, - input_schema=_SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT, - output_schema=_SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class AutomatedReasoningPolicyBuildResultAssetType(UnknownEnumMixin, StrEnum): - BUILD_LOG = "BUILD_LOG" - QUALITY_REPORT = "QUALITY_REPORT" - POLICY_DEFINITION = "POLICY_DEFINITION" - GENERATED_TEST_CASES = "GENERATED_TEST_CASES" - POLICY_SCENARIOS = "POLICY_SCENARIOS" - FIDELITY_REPORT = "FIDELITY_REPORT" - ASSET_MANIFEST = "ASSET_MANIFEST" - SOURCE_DOCUMENT = "SOURCE_DOCUMENT" - - -@dataclass(kw_only=True) -class GetAutomatedReasoningPolicyBuildWorkflowResultAssetsInput: - """ - Dataclass for GetAutomatedReasoningPolicyBuildWorkflowResultAssetsInput - structure. - """ - - policy_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the Automated Reasoning policy whose - build workflow assets you want to retrieve. - """ - - build_workflow_id: str | None = None - """ - The unique identifier of the build workflow whose result assets you want - to retrieve. - """ - - asset_type: str | None = None - """ - The type of asset to retrieve (e.g., BUILD_LOG, QUALITY_REPORT, - POLICY_DEFINITION, GENERATED_TEST_CASES, POLICY_SCENARIOS, - FIDELITY_REPORT, ASSET_MANIFEST, SOURCE_DOCUMENT). - """ - - asset_id: str | None = None - """ - The unique identifier of the specific asset to retrieve when multiple - assets of the same type exist. This is required when retrieving - SOURCE_DOCUMENT assets, as multiple source documents may have been used - in the workflow. The asset ID can be obtained from the asset manifest. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_RESULT_ASSETS_INPUT, - self, - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.policy_arn is not None: - serializer.write_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_RESULT_ASSETS_INPUT.members[ - "policyArn" - ], - self.policy_arn, - ) - - if self.build_workflow_id is not None: - serializer.write_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_RESULT_ASSETS_INPUT.members[ - "buildWorkflowId" - ], - self.build_workflow_id, - ) - - if self.asset_type is not None: - serializer.write_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_RESULT_ASSETS_INPUT.members[ - "assetType" - ], - self.asset_type, - ) - - if self.asset_id is not None: - serializer.write_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_RESULT_ASSETS_INPUT.members[ - "assetId" - ], - self.asset_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_arn"] = de.read_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_RESULT_ASSETS_INPUT.members[ - "policyArn" - ] - ) - - case 1: - kwargs["build_workflow_id"] = de.read_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_RESULT_ASSETS_INPUT.members[ - "buildWorkflowId" - ] - ) - - case 2: - kwargs["asset_type"] = AutomatedReasoningPolicyBuildResultAssetType( - de.read_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_RESULT_ASSETS_INPUT.members[ - "assetType" - ] - ) - ) - - case 3: - kwargs["asset_id"] = de.read_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_RESULT_ASSETS_INPUT.members[ - "assetId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_RESULT_ASSETS_INPUT, - consumer=_consumer, - ) - return kwargs - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyBuildResultAssetManifestEntry: - """ - Represents a single entry in the asset manifest, describing one artifact - produced by the build workflow. - """ - - asset_type: str - """ - The type of asset (e.g., BUILD_LOG, QUALITY_REPORT, POLICY_DEFINITION, - GENERATED_TEST_CASES, POLICY_SCENARIOS, FIDELITY_REPORT, ASSET_MANIFEST, - SOURCE_DOCUMENT). - """ - - asset_name: str | None = field(repr=False, default=None) - """ - A human-readable name for the asset, if applicable. This helps identify - specific documents or reports within the workflow results. - """ - - asset_id: str | None = None - """ - A unique identifier for the asset, if applicable. Use this ID when - requesting specific assets through the API. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSET_MANIFEST_ENTRY, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSET_MANIFEST_ENTRY.members[ - "assetType" - ], - self.asset_type, - ) - if self.asset_name is not None: - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSET_MANIFEST_ENTRY.members[ - "assetName" - ], - self.asset_name, - ) - - if self.asset_id is not None: - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSET_MANIFEST_ENTRY.members[ - "assetId" - ], - self.asset_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["asset_type"] = AutomatedReasoningPolicyBuildResultAssetType( - de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSET_MANIFEST_ENTRY.members[ - "assetType" - ] - ) - ) - - case 1: - kwargs["asset_name"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSET_MANIFEST_ENTRY.members[ - "assetName" - ] - ) - - case 2: - kwargs["asset_id"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSET_MANIFEST_ENTRY.members[ - "assetId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSET_MANIFEST_ENTRY, - consumer=_consumer, - ) - if "asset_type" not in kwargs: - kwargs["asset_type"] = ( - AutomatedReasoningPolicyBuildResultAssetType._corrected("") - ) - return kwargs - - -def _serialize_automated_reasoning_policy_build_result_asset_manifest_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[AutomatedReasoningPolicyBuildResultAssetManifestEntry], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_automated_reasoning_policy_build_result_asset_manifest_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AutomatedReasoningPolicyBuildResultAssetManifestEntry]: - result: list[AutomatedReasoningPolicyBuildResultAssetManifestEntry] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append( - AutomatedReasoningPolicyBuildResultAssetManifestEntry.deserialize(d) - ) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyBuildResultAssetManifest: - """ - A catalog of all artifacts produced by a build workflow, providing a - comprehensive list of available assets including their types and - identifiers. - """ - - entries: list[AutomatedReasoningPolicyBuildResultAssetManifestEntry] - """ - The list of asset entries in the manifest, each describing an available - artifact that can be retrieved. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSET_MANIFEST, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_automated_reasoning_policy_build_result_asset_manifest_list( - serializer, - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSET_MANIFEST.members[ - "entries" - ], - self.entries, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["entries"] = ( - _deserialize_automated_reasoning_policy_build_result_asset_manifest_list( - de, - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSET_MANIFEST.members[ - "entries" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSET_MANIFEST, - consumer=_consumer, - ) - if "entries" not in kwargs: - kwargs["entries"] = [] - return kwargs - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyAddRuleMutation: - """ - A mutation operation that adds a new rule to the policy definition - during the build process. - """ - - rule: AutomatedReasoningPolicyDefinitionRule - """ - The rule definition that specifies the formal logical expression and - metadata for the new rule being added to the policy. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_ADD_RULE_MUTATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_ADD_RULE_MUTATION.members["rule"], - self.rule, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rule"] = AutomatedReasoningPolicyDefinitionRule.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_ADD_RULE_MUTATION, consumer=_consumer - ) - if "rule" not in kwargs: - kwargs["rule"] = AutomatedReasoningPolicyDefinitionRule._smithy_default() - return kwargs - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyAddTypeMutation: - """ - A mutation operation that adds a new custom type to the policy - definition during the build process. - """ - - type: AutomatedReasoningPolicyDefinitionType - """ - The type definition that specifies the name, description, and possible - values for the new custom type being added to the policy. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_ADD_TYPE_MUTATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_ADD_TYPE_MUTATION.members["type"], - self.type, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = AutomatedReasoningPolicyDefinitionType.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_ADD_TYPE_MUTATION, consumer=_consumer - ) - if "type" not in kwargs: - kwargs["type"] = AutomatedReasoningPolicyDefinitionType._smithy_default() - return kwargs - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyAddVariableMutation: - """ - A mutation operation that adds a new variable to the policy definition - during the build process. - """ - - variable: AutomatedReasoningPolicyDefinitionVariable - """ - The variable definition that specifies the name, type, and description - for the new variable being added to the policy. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_ADD_VARIABLE_MUTATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_ADD_VARIABLE_MUTATION.members[ - "variable" - ], - self.variable, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["variable"] = ( - AutomatedReasoningPolicyDefinitionVariable.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_ADD_VARIABLE_MUTATION, consumer=_consumer - ) - if "variable" not in kwargs: - kwargs["variable"] = ( - AutomatedReasoningPolicyDefinitionVariable._smithy_default() - ) - return kwargs - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyDeleteRuleMutation: - """ - A mutation operation that removes a rule from the policy definition - during the build process. - """ - - id: str - """The unique identifier of the rule to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_DELETE_RULE_MUTATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_DELETE_RULE_MUTATION.members["id"], - self.id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_DELETE_RULE_MUTATION.members[ - "id" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_DELETE_RULE_MUTATION, consumer=_consumer - ) - if "id" not in kwargs: - kwargs["id"] = "" - return kwargs - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyDeleteTypeMutation: - """ - A mutation operation that removes a custom type from the policy - definition during the build process. - """ - - name: str = field(repr=False) - """The name of the custom type to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_DELETE_TYPE_MUTATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_DELETE_TYPE_MUTATION.members["name"], - self.name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_DELETE_TYPE_MUTATION.members[ - "name" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_DELETE_TYPE_MUTATION, consumer=_consumer - ) - if "name" not in kwargs: - kwargs["name"] = "" - return kwargs - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyDeleteVariableMutation: - """ - A mutation operation that removes a variable from the policy definition - during the build process. - """ - - name: str = field(repr=False) - """The name of the variable to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_DELETE_VARIABLE_MUTATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_DELETE_VARIABLE_MUTATION.members["name"], - self.name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_DELETE_VARIABLE_MUTATION.members[ - "name" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_DELETE_VARIABLE_MUTATION, - consumer=_consumer, - ) - if "name" not in kwargs: - kwargs["name"] = "" - return kwargs - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyUpdateRuleMutation: - """ - A mutation operation that modifies an existing rule in the policy - definition during the build process. - """ - - rule: AutomatedReasoningPolicyDefinitionRule - """ - The updated rule definition containing the modified formal logical - expression and any changed metadata for the existing rule. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_RULE_MUTATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_RULE_MUTATION.members["rule"], - self.rule, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rule"] = AutomatedReasoningPolicyDefinitionRule.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_RULE_MUTATION, consumer=_consumer - ) - if "rule" not in kwargs: - kwargs["rule"] = AutomatedReasoningPolicyDefinitionRule._smithy_default() - return kwargs - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyUpdateTypeMutation: - """ - A mutation operation that modifies an existing custom type in the policy - definition during the build process. - """ - - type: AutomatedReasoningPolicyDefinitionType - """ - The updated type definition containing the modified name, description, - or values for the existing custom type. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_TYPE_MUTATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_TYPE_MUTATION.members["type"], - self.type, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = AutomatedReasoningPolicyDefinitionType.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_TYPE_MUTATION, consumer=_consumer - ) - if "type" not in kwargs: - kwargs["type"] = AutomatedReasoningPolicyDefinitionType._smithy_default() - return kwargs - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyUpdateVariableMutation: - """ - A mutation operation that modifies an existing variable in the policy - definition during the build process. - """ - - variable: AutomatedReasoningPolicyDefinitionVariable - """ - The updated variable definition containing the modified name, type, or - description for the existing variable. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_VARIABLE_MUTATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_VARIABLE_MUTATION.members[ - "variable" - ], - self.variable, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["variable"] = ( - AutomatedReasoningPolicyDefinitionVariable.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_UPDATE_VARIABLE_MUTATION, - consumer=_consumer, - ) - if "variable" not in kwargs: - kwargs["variable"] = ( - AutomatedReasoningPolicyDefinitionVariable._smithy_default() - ) - return kwargs - - -@dataclass -class AutomatedReasoningPolicyMutationAddType: - """A mutation to add a new custom type to the policy.""" - - value: AutomatedReasoningPolicyAddTypeMutation - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_REASONING_POLICY_MUTATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_MUTATION.members["addType"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=AutomatedReasoningPolicyAddTypeMutation.deserialize(deserializer) - ) - - -@dataclass -class AutomatedReasoningPolicyMutationUpdateType: - """A mutation to modify an existing custom type in the policy.""" - - value: AutomatedReasoningPolicyUpdateTypeMutation - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_REASONING_POLICY_MUTATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_MUTATION.members["updateType"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=AutomatedReasoningPolicyUpdateTypeMutation.deserialize(deserializer) - ) - - -@dataclass -class AutomatedReasoningPolicyMutationDeleteType: - """A mutation to remove a custom type from the policy.""" - - value: AutomatedReasoningPolicyDeleteTypeMutation - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_REASONING_POLICY_MUTATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_MUTATION.members["deleteType"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=AutomatedReasoningPolicyDeleteTypeMutation.deserialize(deserializer) - ) - - -@dataclass -class AutomatedReasoningPolicyMutationAddVariable: - """A mutation to add a new variable to the policy.""" - - value: AutomatedReasoningPolicyAddVariableMutation - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_REASONING_POLICY_MUTATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_MUTATION.members["addVariable"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=AutomatedReasoningPolicyAddVariableMutation.deserialize(deserializer) - ) - - -@dataclass -class AutomatedReasoningPolicyMutationUpdateVariable: - """A mutation to modify an existing variable in the policy.""" - - value: AutomatedReasoningPolicyUpdateVariableMutation - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_REASONING_POLICY_MUTATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_MUTATION.members["updateVariable"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=AutomatedReasoningPolicyUpdateVariableMutation.deserialize( - deserializer - ) - ) - - -@dataclass -class AutomatedReasoningPolicyMutationDeleteVariable: - """A mutation to remove a variable from the policy.""" - - value: AutomatedReasoningPolicyDeleteVariableMutation - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_REASONING_POLICY_MUTATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_MUTATION.members["deleteVariable"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=AutomatedReasoningPolicyDeleteVariableMutation.deserialize( - deserializer - ) - ) - - -@dataclass -class AutomatedReasoningPolicyMutationAddRule: - """A mutation to add a new rule to the policy.""" - - value: AutomatedReasoningPolicyAddRuleMutation - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_REASONING_POLICY_MUTATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_MUTATION.members["addRule"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=AutomatedReasoningPolicyAddRuleMutation.deserialize(deserializer) - ) - - -@dataclass -class AutomatedReasoningPolicyMutationUpdateRule: - """A mutation to modify an existing rule in the policy.""" - - value: AutomatedReasoningPolicyUpdateRuleMutation - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_REASONING_POLICY_MUTATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_MUTATION.members["updateRule"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=AutomatedReasoningPolicyUpdateRuleMutation.deserialize(deserializer) - ) - - -@dataclass -class AutomatedReasoningPolicyMutationDeleteRule: - """A mutation to remove a rule from the policy.""" - - value: AutomatedReasoningPolicyDeleteRuleMutation - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_REASONING_POLICY_MUTATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_MUTATION.members["deleteRule"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=AutomatedReasoningPolicyDeleteRuleMutation.deserialize(deserializer) - ) - - -@dataclass -class AutomatedReasoningPolicyMutationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -AutomatedReasoningPolicyMutation = Union[ - AutomatedReasoningPolicyMutationAddType - | AutomatedReasoningPolicyMutationUpdateType - | AutomatedReasoningPolicyMutationDeleteType - | AutomatedReasoningPolicyMutationAddVariable - | AutomatedReasoningPolicyMutationUpdateVariable - | AutomatedReasoningPolicyMutationDeleteVariable - | AutomatedReasoningPolicyMutationAddRule - | AutomatedReasoningPolicyMutationUpdateRule - | AutomatedReasoningPolicyMutationDeleteRule - | AutomatedReasoningPolicyMutationUnknown -] -""" -A container for various mutation operations that can be applied to an -Automated Reasoning policy, including adding, updating, and deleting -policy elements. -""" - - -class _AutomatedReasoningPolicyMutationDeserializer: - _result: AutomatedReasoningPolicyMutation | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> AutomatedReasoningPolicyMutation: - self._result = None - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_MUTATION, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - AutomatedReasoningPolicyMutationAddType.deserialize(de) - ) - - case 1: - self._set_result( - AutomatedReasoningPolicyMutationUpdateType.deserialize(de) - ) - - case 2: - self._set_result( - AutomatedReasoningPolicyMutationDeleteType.deserialize(de) - ) - - case 3: - self._set_result( - AutomatedReasoningPolicyMutationAddVariable.deserialize(de) - ) - - case 4: - self._set_result( - AutomatedReasoningPolicyMutationUpdateVariable.deserialize(de) - ) - - case 5: - self._set_result( - AutomatedReasoningPolicyMutationDeleteVariable.deserialize(de) - ) - - case 6: - self._set_result( - AutomatedReasoningPolicyMutationAddRule.deserialize(de) - ) - - case 7: - self._set_result( - AutomatedReasoningPolicyMutationUpdateRule.deserialize(de) - ) - - case 8: - self._set_result( - AutomatedReasoningPolicyMutationDeleteRule.deserialize(de) - ) - - case _: - self._set_result( - AutomatedReasoningPolicyMutationUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: AutomatedReasoningPolicyMutation) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyPlanning: - """ - Represents the planning phase of policy build workflow, where the system - analyzes source content and determines what operations to perform. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_REASONING_POLICY_PLANNING, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_PLANNING, consumer=_consumer - ) - return kwargs - - -@dataclass -class AutomatedReasoningPolicyBuildStepContextPlanning: - """ - Indicates that this build step was part of the planning phase, where the - system determines what operations to perform. - """ - - value: AutomatedReasoningPolicyPlanning - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_STEP_CONTEXT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_STEP_CONTEXT.members["planning"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=AutomatedReasoningPolicyPlanning.deserialize(deserializer)) - - -@dataclass -class AutomatedReasoningPolicyBuildStepContextMutation: - """ - Indicates that this build step involved modifying the policy structure, - such as adding or updating rules, variables, or types. - """ - - value: AutomatedReasoningPolicyMutation - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_STEP_CONTEXT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_STEP_CONTEXT.members["mutation"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_AutomatedReasoningPolicyMutationDeserializer().deserialize( - deserializer - ) - ) - - -@dataclass -class AutomatedReasoningPolicyBuildStepContextUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -AutomatedReasoningPolicyBuildStepContext = Union[ - AutomatedReasoningPolicyBuildStepContextPlanning - | AutomatedReasoningPolicyBuildStepContextMutation - | AutomatedReasoningPolicyBuildStepContextUnknown -] -""" -Provides context about what type of operation was being performed during -a build step. -""" - - -class _AutomatedReasoningPolicyBuildStepContextDeserializer: - _result: AutomatedReasoningPolicyBuildStepContext | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> AutomatedReasoningPolicyBuildStepContext: - self._result = None - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_STEP_CONTEXT, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - AutomatedReasoningPolicyBuildStepContextPlanning.deserialize(de) - ) - - case 1: - self._set_result( - AutomatedReasoningPolicyBuildStepContextMutation.deserialize(de) - ) - - case _: - self._set_result( - AutomatedReasoningPolicyBuildStepContextUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: AutomatedReasoningPolicyBuildStepContext) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class AutomatedReasoningPolicyBuildMessageType(UnknownEnumMixin, StrEnum): - INFO = "INFO" - WARNING = "WARNING" - ERROR = "ERROR" - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyBuildStepMessage: - """ - Represents a message generated during a build step, providing - information about what happened or any issues encountered. - """ - - message: str - """ - The content of the message, describing what occurred during the build - step. - """ - - message_type: str - """ - The type of message (e.g., INFO, WARNING, ERROR) indicating its severity - and purpose. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_STEP_MESSAGE, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_STEP_MESSAGE.members["message"], - self.message, - ) - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_STEP_MESSAGE.members[ - "messageType" - ], - self.message_type, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_STEP_MESSAGE.members[ - "message" - ] - ) - - case 1: - kwargs["message_type"] = AutomatedReasoningPolicyBuildMessageType( - de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_STEP_MESSAGE.members[ - "messageType" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_STEP_MESSAGE, consumer=_consumer - ) - if "message" not in kwargs: - kwargs["message"] = "" - if "message_type" not in kwargs: - kwargs["message_type"] = ( - AutomatedReasoningPolicyBuildMessageType._corrected("") - ) - return kwargs - - -def _serialize_automated_reasoning_policy_build_step_message_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[AutomatedReasoningPolicyBuildStepMessage], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_automated_reasoning_policy_build_step_message_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AutomatedReasoningPolicyBuildStepMessage]: - result: list[AutomatedReasoningPolicyBuildStepMessage] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AutomatedReasoningPolicyBuildStepMessage.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass -class AutomatedReasoningPolicyDefinitionElementPolicyDefinitionVariable: - """ - A variable element within the policy definition that represents a - concept used in logical expressions and rules. - """ - - value: AutomatedReasoningPolicyDefinitionVariable - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_ELEMENT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_ELEMENT.members[ - "policyDefinitionVariable" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=AutomatedReasoningPolicyDefinitionVariable.deserialize(deserializer) - ) - - -@dataclass -class AutomatedReasoningPolicyDefinitionElementPolicyDefinitionType: - """ - A custom type element within the policy definition that defines a set of - possible values for variables. - """ - - value: AutomatedReasoningPolicyDefinitionType - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_ELEMENT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_ELEMENT.members[ - "policyDefinitionType" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=AutomatedReasoningPolicyDefinitionType.deserialize(deserializer) - ) - - -@dataclass -class AutomatedReasoningPolicyDefinitionElementPolicyDefinitionRule: - """ - A rule element within the policy definition that contains a formal - logical expression used for validation. - """ - - value: AutomatedReasoningPolicyDefinitionRule - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_ELEMENT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_ELEMENT.members[ - "policyDefinitionRule" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=AutomatedReasoningPolicyDefinitionRule.deserialize(deserializer) - ) - - -@dataclass -class AutomatedReasoningPolicyDefinitionElementUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -AutomatedReasoningPolicyDefinitionElement = Union[ - AutomatedReasoningPolicyDefinitionElementPolicyDefinitionVariable - | AutomatedReasoningPolicyDefinitionElementPolicyDefinitionType - | AutomatedReasoningPolicyDefinitionElementPolicyDefinitionRule - | AutomatedReasoningPolicyDefinitionElementUnknown -] -""" -Represents a single element in an Automated Reasoning policy definition, -such as a rule, variable, or type definition. -""" - - -class _AutomatedReasoningPolicyDefinitionElementDeserializer: - _result: AutomatedReasoningPolicyDefinitionElement | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> AutomatedReasoningPolicyDefinitionElement: - self._result = None - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_ELEMENT, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - AutomatedReasoningPolicyDefinitionElementPolicyDefinitionVariable.deserialize( - de - ) - ) - - case 1: - self._set_result( - AutomatedReasoningPolicyDefinitionElementPolicyDefinitionType.deserialize( - de - ) - ) - - case 2: - self._set_result( - AutomatedReasoningPolicyDefinitionElementPolicyDefinitionRule.deserialize( - de - ) - ) - - case _: - self._set_result( - AutomatedReasoningPolicyDefinitionElementUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: AutomatedReasoningPolicyDefinitionElement) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyBuildStep: - """ - Represents a single step in the policy build process, containing context - about what was being processed and any messages or results. - """ - - context: AutomatedReasoningPolicyBuildStepContext - """ - Contextual information about what was being processed during this build - step, such as the type of operation or the source material being - analyzed. - """ - - messages: list[AutomatedReasoningPolicyBuildStepMessage] - """ - A list of messages generated during this build step, including - informational messages, warnings, and error details. - """ - - prior_element: AutomatedReasoningPolicyDefinitionElement | None = None - """ - Reference to the previous element or step in the build process, helping - to trace the sequence of operations. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_STEP, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_STEP.members["context"], - self.context, - ) - if self.prior_element is not None: - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_STEP.members["priorElement"], - self.prior_element, - ) - - _serialize_automated_reasoning_policy_build_step_message_list( - serializer, - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_STEP.members["messages"], - self.messages, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["context"] = ( - _AutomatedReasoningPolicyBuildStepContextDeserializer().deserialize( - de - ) - ) - - case 1: - kwargs["prior_element"] = ( - _AutomatedReasoningPolicyDefinitionElementDeserializer().deserialize( - de - ) - ) - - case 2: - kwargs["messages"] = ( - _deserialize_automated_reasoning_policy_build_step_message_list( - de, - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_STEP.members[ - "messages" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_STEP, consumer=_consumer - ) - if "context" not in kwargs: - kwargs["context"] = AutomatedReasoningPolicyBuildStepContextUnknown(tag="") - if "messages" not in kwargs: - kwargs["messages"] = [] - return kwargs - - -def _serialize_automated_reasoning_policy_build_step_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[AutomatedReasoningPolicyBuildStep], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_automated_reasoning_policy_build_step_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AutomatedReasoningPolicyBuildStep]: - result: list[AutomatedReasoningPolicyBuildStep] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AutomatedReasoningPolicyBuildStep.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class AutomatedReasoningPolicyAnnotationStatus(UnknownEnumMixin, StrEnum): - APPLIED = "APPLIED" - FAILED = "FAILED" - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyBuildLogEntry: - """ - Represents a single entry in the policy build log, containing - information about a specific step or event in the build process. - """ - - annotation: AutomatedReasoningPolicyAnnotation - """ - The annotation or operation that was being processed when this log entry - was created. - """ - - status: str - """The status of the build step (e.g., SUCCESS, FAILED, IN_PROGRESS).""" - - build_steps: list[AutomatedReasoningPolicyBuildStep] - """ - Detailed information about the specific build steps that were executed, - including any sub-operations or transformations. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_LOG_ENTRY, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_LOG_ENTRY.members["annotation"], - self.annotation, - ) - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_LOG_ENTRY.members["status"], - self.status, - ) - _serialize_automated_reasoning_policy_build_step_list( - serializer, - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_LOG_ENTRY.members["buildSteps"], - self.build_steps, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["annotation"] = ( - _AutomatedReasoningPolicyAnnotationDeserializer().deserialize( - de - ) - ) - - case 1: - kwargs["status"] = AutomatedReasoningPolicyAnnotationStatus( - de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_LOG_ENTRY.members[ - "status" - ] - ) - ) - - case 2: - kwargs["build_steps"] = ( - _deserialize_automated_reasoning_policy_build_step_list( - de, - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_LOG_ENTRY.members[ - "buildSteps" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_LOG_ENTRY, consumer=_consumer - ) - if "annotation" not in kwargs: - kwargs["annotation"] = AutomatedReasoningPolicyAnnotationUnknown(tag="") - if "status" not in kwargs: - kwargs["status"] = AutomatedReasoningPolicyAnnotationStatus._corrected("") - if "build_steps" not in kwargs: - kwargs["build_steps"] = [] - return kwargs - - -def _serialize_automated_reasoning_policy_build_log_entry_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[AutomatedReasoningPolicyBuildLogEntry], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_automated_reasoning_policy_build_log_entry_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AutomatedReasoningPolicyBuildLogEntry]: - result: list[AutomatedReasoningPolicyBuildLogEntry] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AutomatedReasoningPolicyBuildLogEntry.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyBuildLog: - """ - Contains detailed logging information about the policy build process, - including steps taken, decisions made, and any issues encountered. - """ - - entries: list[AutomatedReasoningPolicyBuildLogEntry] - """ - A list of log entries documenting each step in the policy build process, - including timestamps, status, and detailed messages. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_LOG, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_automated_reasoning_policy_build_log_entry_list( - serializer, - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_LOG.members["entries"], - self.entries, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["entries"] = ( - _deserialize_automated_reasoning_policy_build_log_entry_list( - de, - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_LOG.members[ - "entries" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_LOG, consumer=_consumer - ) - if "entries" not in kwargs: - kwargs["entries"] = [] - return kwargs - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicySourceDocument: - """ - Represents a source document that was processed during a build workflow. - Contains the document content, metadata, and a hash for verification. - """ - - document: bytes = field(repr=False) - """The raw content of the source document as a binary blob.""" - - document_content_type: str - """The MIME type of the document (e.g., application/pdf, text/plain).""" - - document_name: str = field(repr=False) - """The name of the source document for identification purposes.""" - - document_hash: str - """ - A SHA-256 hash of the document content, used for verification and - integrity checking. - """ - - document_description: str | None = field(repr=False, default=None) - """ - An optional description providing context about the document's content - and purpose. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_SOURCE_DOCUMENT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_blob( - _SCHEMA_AUTOMATED_REASONING_POLICY_SOURCE_DOCUMENT.members["document"], - self.document, - ) - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_SOURCE_DOCUMENT.members[ - "documentContentType" - ], - self.document_content_type, - ) - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_SOURCE_DOCUMENT.members["documentName"], - self.document_name, - ) - if self.document_description is not None: - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_SOURCE_DOCUMENT.members[ - "documentDescription" - ], - self.document_description, - ) - - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_SOURCE_DOCUMENT.members["documentHash"], - self.document_hash, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["document"] = de.read_blob( - _SCHEMA_AUTOMATED_REASONING_POLICY_SOURCE_DOCUMENT.members[ - "document" - ] - ) - - case 1: - kwargs["document_content_type"] = ( - AutomatedReasoningPolicyBuildDocumentContentType( - de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_SOURCE_DOCUMENT.members[ - "documentContentType" - ] - ) - ) - ) - - case 2: - kwargs["document_name"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_SOURCE_DOCUMENT.members[ - "documentName" - ] - ) - - case 3: - kwargs["document_description"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_SOURCE_DOCUMENT.members[ - "documentDescription" - ] - ) - - case 4: - kwargs["document_hash"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_SOURCE_DOCUMENT.members[ - "documentHash" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_SOURCE_DOCUMENT, consumer=_consumer - ) - if "document" not in kwargs: - kwargs["document"] = b"" - if "document_content_type" not in kwargs: - kwargs["document_content_type"] = ( - AutomatedReasoningPolicyBuildDocumentContentType._corrected("") - ) - if "document_name" not in kwargs: - kwargs["document_name"] = "" - if "document_hash" not in kwargs: - kwargs["document_hash"] = "" - return kwargs - - -def _serialize_automated_reasoning_policy_line_number_list( - serializer: ShapeSerializer, schema: Schema, value: list[int] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_integer(member_schema, e) - - -def _deserialize_automated_reasoning_policy_line_number_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[int]: - result: list[int] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_integer(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyStatementLocation: - """ - Describes the location of a statement within a source document using - line numbers. - """ - - lines: list[int] - """The line numbers in the source document where this statement appears.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_STATEMENT_LOCATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_automated_reasoning_policy_line_number_list( - serializer, - _SCHEMA_AUTOMATED_REASONING_POLICY_STATEMENT_LOCATION.members["lines"], - self.lines, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["lines"] = ( - _deserialize_automated_reasoning_policy_line_number_list( - de, - _SCHEMA_AUTOMATED_REASONING_POLICY_STATEMENT_LOCATION.members[ - "lines" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_STATEMENT_LOCATION, consumer=_consumer - ) - if "lines" not in kwargs: - kwargs["lines"] = [] - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(lines=[]) - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyAtomicStatement: - """ - Represents a single, indivisible statement extracted from a source - document. Atomic statements are the fundamental units used to ground - policy rules and variables to their source material. - """ - - id: str - """ - A unique identifier for this atomic statement within the fidelity - report. - """ - - text: str = field(repr=False) - """ - The actual text content of the atomic statement as extracted from the - source document. - """ - - location: AutomatedReasoningPolicyStatementLocation - """ - Information about where this statement appears in the source document, - including line numbers. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_ATOMIC_STATEMENT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_ATOMIC_STATEMENT.members["id"], self.id - ) - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_ATOMIC_STATEMENT.members["text"], - self.text, - ) - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_ATOMIC_STATEMENT.members["location"], - self.location, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_ATOMIC_STATEMENT.members[ - "id" - ] - ) - - case 1: - kwargs["text"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_ATOMIC_STATEMENT.members[ - "text" - ] - ) - - case 2: - kwargs["location"] = ( - AutomatedReasoningPolicyStatementLocation.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_ATOMIC_STATEMENT, consumer=_consumer - ) - if "id" not in kwargs: - kwargs["id"] = "" - if "text" not in kwargs: - kwargs["text"] = "" - if "location" not in kwargs: - kwargs["location"] = ( - AutomatedReasoningPolicyStatementLocation._smithy_default() - ) - return kwargs - - -def _serialize_automated_reasoning_policy_atomic_statement_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[AutomatedReasoningPolicyAtomicStatement], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_automated_reasoning_policy_atomic_statement_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AutomatedReasoningPolicyAtomicStatement]: - result: list[AutomatedReasoningPolicyAtomicStatement] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AutomatedReasoningPolicyAtomicStatement.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyAnnotatedLine: - """ - Represents a single line of text from a source document, annotated with - its line number for precise referencing. - """ - - line_number: int | None = None - """The line number of this text within the source document.""" - - line_text: str | None = field(repr=False, default=None) - """The actual text content of this line from the source document.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_REASONING_POLICY_ANNOTATED_LINE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.line_number is not None: - serializer.write_integer( - _SCHEMA_AUTOMATED_REASONING_POLICY_ANNOTATED_LINE.members["lineNumber"], - self.line_number, - ) - - if self.line_text is not None: - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_ANNOTATED_LINE.members["lineText"], - self.line_text, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["line_number"] = de.read_integer( - _SCHEMA_AUTOMATED_REASONING_POLICY_ANNOTATED_LINE.members[ - "lineNumber" - ] - ) - - case 1: - kwargs["line_text"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_ANNOTATED_LINE.members[ - "lineText" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_ANNOTATED_LINE, consumer=_consumer - ) - return kwargs - - -@dataclass -class AutomatedReasoningPolicyAnnotatedContentLine: - """ - An annotated line of text from the source document, including both the - line number and the text content. - """ - - value: AutomatedReasoningPolicyAnnotatedLine - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_ANNOTATED_CONTENT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_ANNOTATED_CONTENT.members["line"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=AutomatedReasoningPolicyAnnotatedLine.deserialize(deserializer) - ) - - -@dataclass -class AutomatedReasoningPolicyAnnotatedContentUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -AutomatedReasoningPolicyAnnotatedContent = Union[ - AutomatedReasoningPolicyAnnotatedContentLine - | AutomatedReasoningPolicyAnnotatedContentUnknown -] -""" -Represents a content element within an annotated chunk. This union type -allows for different types of content elements to be included in -document chunks, such as individual lines of text with their line -numbers. -""" - - -class _AutomatedReasoningPolicyAnnotatedContentDeserializer: - _result: AutomatedReasoningPolicyAnnotatedContent | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> AutomatedReasoningPolicyAnnotatedContent: - self._result = None - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_ANNOTATED_CONTENT, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - AutomatedReasoningPolicyAnnotatedContentLine.deserialize(de) - ) - - case _: - self._set_result( - AutomatedReasoningPolicyAnnotatedContentUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: AutomatedReasoningPolicyAnnotatedContent) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_automated_reasoning_policy_annotated_content_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[AutomatedReasoningPolicyAnnotatedContent], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_automated_reasoning_policy_annotated_content_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AutomatedReasoningPolicyAnnotatedContent]: - result: list[AutomatedReasoningPolicyAnnotatedContent] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append( - _AutomatedReasoningPolicyAnnotatedContentDeserializer().deserialize(d) - ) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyAnnotatedChunk: - """ - Represents a portion of a source document with line number annotations. - Chunks help organize document content for easier navigation and - reference. - """ - - content: list[AutomatedReasoningPolicyAnnotatedContent] - """ - The lines of text contained within this chunk, each annotated with its - line number. - """ - - page_number: int | None = None - """ - The page number where this chunk begins, if the document is divided into - pages. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_ANNOTATED_CHUNK, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.page_number is not None: - serializer.write_integer( - _SCHEMA_AUTOMATED_REASONING_POLICY_ANNOTATED_CHUNK.members[ - "pageNumber" - ], - self.page_number, - ) - - _serialize_automated_reasoning_policy_annotated_content_list( - serializer, - _SCHEMA_AUTOMATED_REASONING_POLICY_ANNOTATED_CHUNK.members["content"], - self.content, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["page_number"] = de.read_integer( - _SCHEMA_AUTOMATED_REASONING_POLICY_ANNOTATED_CHUNK.members[ - "pageNumber" - ] - ) - - case 1: - kwargs["content"] = ( - _deserialize_automated_reasoning_policy_annotated_content_list( - de, - _SCHEMA_AUTOMATED_REASONING_POLICY_ANNOTATED_CHUNK.members[ - "content" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_ANNOTATED_CHUNK, consumer=_consumer - ) - if "content" not in kwargs: - kwargs["content"] = [] - return kwargs - - -def _serialize_automated_reasoning_policy_annotated_chunk_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[AutomatedReasoningPolicyAnnotatedChunk], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_automated_reasoning_policy_annotated_chunk_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AutomatedReasoningPolicyAnnotatedChunk]: - result: list[AutomatedReasoningPolicyAnnotatedChunk] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AutomatedReasoningPolicyAnnotatedChunk.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyReportSourceDocument: - """ - Represents a source document that was analyzed during fidelity report - generation, including the document's metadata and its content broken - down into atomic statements. - """ - - document_name: str = field(repr=False) - """The name of the source document that was analyzed.""" - - document_hash: str - """ - A SHA-256 hash of the document content, used for verification and - ensuring the document hasn't changed since analysis. - """ - - document_id: str - """A unique identifier for this document within the fidelity report.""" - - atomic_statements: list[AutomatedReasoningPolicyAtomicStatement] - """ - The list of atomic statements extracted from this document, representing - the fundamental units of meaning used for grounding. - """ - - document_content: list[AutomatedReasoningPolicyAnnotatedChunk] - """ - The document's content organized into annotated chunks with line number - information for precise referencing. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_REPORT_SOURCE_DOCUMENT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_REPORT_SOURCE_DOCUMENT.members[ - "documentName" - ], - self.document_name, - ) - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_REPORT_SOURCE_DOCUMENT.members[ - "documentHash" - ], - self.document_hash, - ) - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_REPORT_SOURCE_DOCUMENT.members[ - "documentId" - ], - self.document_id, - ) - _serialize_automated_reasoning_policy_atomic_statement_list( - serializer, - _SCHEMA_AUTOMATED_REASONING_POLICY_REPORT_SOURCE_DOCUMENT.members[ - "atomicStatements" - ], - self.atomic_statements, - ) - _serialize_automated_reasoning_policy_annotated_chunk_list( - serializer, - _SCHEMA_AUTOMATED_REASONING_POLICY_REPORT_SOURCE_DOCUMENT.members[ - "documentContent" - ], - self.document_content, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["document_name"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_REPORT_SOURCE_DOCUMENT.members[ - "documentName" - ] - ) - - case 1: - kwargs["document_hash"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_REPORT_SOURCE_DOCUMENT.members[ - "documentHash" - ] - ) - - case 2: - kwargs["document_id"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_REPORT_SOURCE_DOCUMENT.members[ - "documentId" - ] - ) - - case 3: - kwargs["atomic_statements"] = ( - _deserialize_automated_reasoning_policy_atomic_statement_list( - de, - _SCHEMA_AUTOMATED_REASONING_POLICY_REPORT_SOURCE_DOCUMENT.members[ - "atomicStatements" - ], - ) - ) - - case 4: - kwargs["document_content"] = ( - _deserialize_automated_reasoning_policy_annotated_chunk_list( - de, - _SCHEMA_AUTOMATED_REASONING_POLICY_REPORT_SOURCE_DOCUMENT.members[ - "documentContent" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_REPORT_SOURCE_DOCUMENT, - consumer=_consumer, - ) - if "document_name" not in kwargs: - kwargs["document_name"] = "" - if "document_hash" not in kwargs: - kwargs["document_hash"] = "" - if "document_id" not in kwargs: - kwargs["document_id"] = "" - if "atomic_statements" not in kwargs: - kwargs["atomic_statements"] = [] - if "document_content" not in kwargs: - kwargs["document_content"] = [] - return kwargs - - -def _serialize_automated_reasoning_policy_report_source_document_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[AutomatedReasoningPolicyReportSourceDocument], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_automated_reasoning_policy_report_source_document_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AutomatedReasoningPolicyReportSourceDocument]: - result: list[AutomatedReasoningPolicyReportSourceDocument] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AutomatedReasoningPolicyReportSourceDocument.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_automated_reasoning_policy_justification_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_automated_reasoning_policy_justification_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyStatementReference: - """ - References a specific atomic statement within a source document, used to - link policy elements back to their source material. - """ - - document_id: str - """ - The unique identifier of the document containing the referenced - statement. - """ - - statement_id: str - """The unique identifier of the specific atomic statement being referenced.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_STATEMENT_REFERENCE, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_STATEMENT_REFERENCE.members[ - "documentId" - ], - self.document_id, - ) - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_STATEMENT_REFERENCE.members[ - "statementId" - ], - self.statement_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["document_id"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_STATEMENT_REFERENCE.members[ - "documentId" - ] - ) - - case 1: - kwargs["statement_id"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_STATEMENT_REFERENCE.members[ - "statementId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_STATEMENT_REFERENCE, consumer=_consumer - ) - if "document_id" not in kwargs: - kwargs["document_id"] = "" - if "statement_id" not in kwargs: - kwargs["statement_id"] = "" - return kwargs - - -def _serialize_automated_reasoning_policy_statement_reference_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[AutomatedReasoningPolicyStatementReference], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_automated_reasoning_policy_statement_reference_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AutomatedReasoningPolicyStatementReference]: - result: list[AutomatedReasoningPolicyStatementReference] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AutomatedReasoningPolicyStatementReference.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyRuleReport: - """ - Provides detailed fidelity analysis for a specific policy rule, - including which source document statements support it and how accurate - the rule is. - """ - - rule: str - """The identifier of the policy rule being analyzed in this report.""" - - grounding_statements: list[AutomatedReasoningPolicyStatementReference] | None = None - """ - References to statements from the source documents that provide the - basis or justification for this rule. - """ - - grounding_justifications: list[str] | None = None - """ - Explanations describing how the source statements support and justify - this specific rule. - """ - - accuracy_score: float | None = None - """ - A score from 0.0 to 1.0 indicating how accurately this rule represents - the source material. - """ - - accuracy_justification: str | None = field(repr=False, default=None) - """ - A textual explanation of the accuracy score, describing why the rule - received this particular accuracy rating. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_REASONING_POLICY_RULE_REPORT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_RULE_REPORT.members["rule"], self.rule - ) - if self.grounding_statements is not None: - _serialize_automated_reasoning_policy_statement_reference_list( - serializer, - _SCHEMA_AUTOMATED_REASONING_POLICY_RULE_REPORT.members[ - "groundingStatements" - ], - self.grounding_statements, - ) - - if self.grounding_justifications is not None: - _serialize_automated_reasoning_policy_justification_list( - serializer, - _SCHEMA_AUTOMATED_REASONING_POLICY_RULE_REPORT.members[ - "groundingJustifications" - ], - self.grounding_justifications, - ) - - if self.accuracy_score is not None: - serializer.write_double( - _SCHEMA_AUTOMATED_REASONING_POLICY_RULE_REPORT.members["accuracyScore"], - self.accuracy_score, - ) - - if self.accuracy_justification is not None: - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_RULE_REPORT.members[ - "accuracyJustification" - ], - self.accuracy_justification, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rule"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_RULE_REPORT.members["rule"] - ) - - case 1: - kwargs["grounding_statements"] = ( - _deserialize_automated_reasoning_policy_statement_reference_list( - de, - _SCHEMA_AUTOMATED_REASONING_POLICY_RULE_REPORT.members[ - "groundingStatements" - ], - ) - ) - - case 2: - kwargs["grounding_justifications"] = ( - _deserialize_automated_reasoning_policy_justification_list( - de, - _SCHEMA_AUTOMATED_REASONING_POLICY_RULE_REPORT.members[ - "groundingJustifications" - ], - ) - ) - - case 3: - kwargs["accuracy_score"] = de.read_double( - _SCHEMA_AUTOMATED_REASONING_POLICY_RULE_REPORT.members[ - "accuracyScore" - ] - ) - - case 4: - kwargs["accuracy_justification"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_RULE_REPORT.members[ - "accuracyJustification" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_RULE_REPORT, consumer=_consumer - ) - if "rule" not in kwargs: - kwargs["rule"] = "" - return kwargs - - -def _serialize_automated_reasoning_policy_rule_report_map( - serializer: ShapeSerializer, - schema: Schema, - value: dict[str, AutomatedReasoningPolicyRuleReport], -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_struct(value_schema, v)) - - -def _deserialize_automated_reasoning_policy_rule_report_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, AutomatedReasoningPolicyRuleReport]: - result: dict[str, AutomatedReasoningPolicyRuleReport] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = AutomatedReasoningPolicyRuleReport.deserialize(d) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyVariableReport: - """ - Provides detailed fidelity analysis for a specific policy variable, - including which source document statements support it and how accurate - the variable definition is. - """ - - policy_variable: str = field(repr=False) - """The name of the policy variable being analyzed in this report.""" - - grounding_statements: list[AutomatedReasoningPolicyStatementReference] | None = None - """ - References to statements from the source documents that provide the - basis or justification for this variable. - """ - - grounding_justifications: list[str] | None = None - """ - Explanations describing how the source statements support and justify - this specific variable definition. - """ - - accuracy_score: float | None = None - """ - A score from 0.0 to 1.0 indicating how accurately this variable - represents concepts from the source material. - """ - - accuracy_justification: str | None = field(repr=False, default=None) - """ - A textual explanation of the accuracy score, describing why the variable - received this particular accuracy rating. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_VARIABLE_REPORT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_VARIABLE_REPORT.members[ - "policyVariable" - ], - self.policy_variable, - ) - if self.grounding_statements is not None: - _serialize_automated_reasoning_policy_statement_reference_list( - serializer, - _SCHEMA_AUTOMATED_REASONING_POLICY_VARIABLE_REPORT.members[ - "groundingStatements" - ], - self.grounding_statements, - ) - - if self.grounding_justifications is not None: - _serialize_automated_reasoning_policy_justification_list( - serializer, - _SCHEMA_AUTOMATED_REASONING_POLICY_VARIABLE_REPORT.members[ - "groundingJustifications" - ], - self.grounding_justifications, - ) - - if self.accuracy_score is not None: - serializer.write_double( - _SCHEMA_AUTOMATED_REASONING_POLICY_VARIABLE_REPORT.members[ - "accuracyScore" - ], - self.accuracy_score, - ) - - if self.accuracy_justification is not None: - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_VARIABLE_REPORT.members[ - "accuracyJustification" - ], - self.accuracy_justification, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_variable"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_VARIABLE_REPORT.members[ - "policyVariable" - ] - ) - - case 1: - kwargs["grounding_statements"] = ( - _deserialize_automated_reasoning_policy_statement_reference_list( - de, - _SCHEMA_AUTOMATED_REASONING_POLICY_VARIABLE_REPORT.members[ - "groundingStatements" - ], - ) - ) - - case 2: - kwargs["grounding_justifications"] = ( - _deserialize_automated_reasoning_policy_justification_list( - de, - _SCHEMA_AUTOMATED_REASONING_POLICY_VARIABLE_REPORT.members[ - "groundingJustifications" - ], - ) - ) - - case 3: - kwargs["accuracy_score"] = de.read_double( - _SCHEMA_AUTOMATED_REASONING_POLICY_VARIABLE_REPORT.members[ - "accuracyScore" - ] - ) - - case 4: - kwargs["accuracy_justification"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_VARIABLE_REPORT.members[ - "accuracyJustification" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_VARIABLE_REPORT, consumer=_consumer - ) - if "policy_variable" not in kwargs: - kwargs["policy_variable"] = "" - return kwargs - - -def _serialize_automated_reasoning_policy_variable_report_map( - serializer: ShapeSerializer, - schema: Schema, - value: dict[str, AutomatedReasoningPolicyVariableReport], -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_struct(value_schema, v)) - - -def _deserialize_automated_reasoning_policy_variable_report_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, AutomatedReasoningPolicyVariableReport]: - result: dict[str, AutomatedReasoningPolicyVariableReport] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = AutomatedReasoningPolicyVariableReport.deserialize(d) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyFidelityReport: - """ - A comprehensive analysis report that measures how accurately a generated - policy represents the source documents. The report includes coverage and - accuracy scores, detailed grounding information linking policy elements - to source statements, and annotated document content. - """ - - coverage_score: float - """ - A score from 0.0 to 1.0 indicating how well the policy covers the - statements in the source documents. A higher score means more of the - source content is represented in the policy. - """ - - accuracy_score: float - """ - A score from 0.0 to 1.0 indicating how accurate the policy rules are - relative to the source documents. A higher score means the policy rules - more faithfully represent the source material. - """ - - rule_reports: dict[str, AutomatedReasoningPolicyRuleReport] - """ - A mapping from rule identifiers to detailed fidelity reports for each - rule, showing which source statements ground each rule and how accurate - it is. - """ - - variable_reports: dict[str, AutomatedReasoningPolicyVariableReport] - """ - A mapping from variable names to detailed fidelity reports for each - variable, showing which source statements ground each variable and how - accurate it is. - """ - - document_sources: list[AutomatedReasoningPolicyReportSourceDocument] - """ - A list of source documents with their content broken down into atomic - statements and annotated with line numbers for precise referencing. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_FIDELITY_REPORT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_double( - _SCHEMA_AUTOMATED_REASONING_POLICY_FIDELITY_REPORT.members["coverageScore"], - self.coverage_score, - ) - serializer.write_double( - _SCHEMA_AUTOMATED_REASONING_POLICY_FIDELITY_REPORT.members["accuracyScore"], - self.accuracy_score, - ) - _serialize_automated_reasoning_policy_rule_report_map( - serializer, - _SCHEMA_AUTOMATED_REASONING_POLICY_FIDELITY_REPORT.members["ruleReports"], - self.rule_reports, - ) - _serialize_automated_reasoning_policy_variable_report_map( - serializer, - _SCHEMA_AUTOMATED_REASONING_POLICY_FIDELITY_REPORT.members[ - "variableReports" - ], - self.variable_reports, - ) - _serialize_automated_reasoning_policy_report_source_document_list( - serializer, - _SCHEMA_AUTOMATED_REASONING_POLICY_FIDELITY_REPORT.members[ - "documentSources" - ], - self.document_sources, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["coverage_score"] = de.read_double( - _SCHEMA_AUTOMATED_REASONING_POLICY_FIDELITY_REPORT.members[ - "coverageScore" - ] - ) - - case 1: - kwargs["accuracy_score"] = de.read_double( - _SCHEMA_AUTOMATED_REASONING_POLICY_FIDELITY_REPORT.members[ - "accuracyScore" - ] - ) - - case 2: - kwargs["rule_reports"] = ( - _deserialize_automated_reasoning_policy_rule_report_map( - de, - _SCHEMA_AUTOMATED_REASONING_POLICY_FIDELITY_REPORT.members[ - "ruleReports" - ], - ) - ) - - case 3: - kwargs["variable_reports"] = ( - _deserialize_automated_reasoning_policy_variable_report_map( - de, - _SCHEMA_AUTOMATED_REASONING_POLICY_FIDELITY_REPORT.members[ - "variableReports" - ], - ) - ) - - case 4: - kwargs["document_sources"] = ( - _deserialize_automated_reasoning_policy_report_source_document_list( - de, - _SCHEMA_AUTOMATED_REASONING_POLICY_FIDELITY_REPORT.members[ - "documentSources" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_FIDELITY_REPORT, consumer=_consumer - ) - if "coverage_score" not in kwargs: - kwargs["coverage_score"] = 0.0 - if "accuracy_score" not in kwargs: - kwargs["accuracy_score"] = 0.0 - if "rule_reports" not in kwargs: - kwargs["rule_reports"] = {} - if "variable_reports" not in kwargs: - kwargs["variable_reports"] = {} - if "document_sources" not in kwargs: - kwargs["document_sources"] = [] - return kwargs - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyGeneratedTestCase: - """ - Represents a generated test case, consisting of query content, guard - content, and expected results. - """ - - query_content: str = field(repr=False) - """ - The input query or prompt that generated the content. This provides - context for the validation. - """ - - guard_content: str = field(repr=False) - """ - The output content that's validated by the Automated Reasoning policy. - This represents the foundation model response that will be checked for - accuracy. - """ - - expected_aggregated_findings_result: str - """ - The expected results of the generated test case. Possible values - include: - - - `VALID` - The claims are true. The claims are implied by the premises - and the Automated Reasoning policy. Given the Automated Reasoning - policy and premises, it is not possible for these claims to be false. - In other words, there are no alternative answers that are true that - contradict the claims. - - - `INVALID` - The claims are false. The claims are not implied by the - premises and Automated Reasoning policy. Furthermore, there exists - different claims that are consistent with the premises and Automated - Reasoning policy. - - - `SATISFIABLE` - The claims can be true or false. It depends on what - assumptions are made for the claim to be implied from the premises and - Automated Reasoning policy rules. In this situation, different - assumptions can make input claims false and alternative claims true. - - - `IMPOSSIBLE` - Automated Reasoning can't make a statement about the - claims. This can happen if the premises are logically incorrect, or if - there is a conflict within the Automated Reasoning policy itself. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_GENERATED_TEST_CASE, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_GENERATED_TEST_CASE.members[ - "queryContent" - ], - self.query_content, - ) - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_GENERATED_TEST_CASE.members[ - "guardContent" - ], - self.guard_content, - ) - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_GENERATED_TEST_CASE.members[ - "expectedAggregatedFindingsResult" - ], - self.expected_aggregated_findings_result, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["query_content"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_GENERATED_TEST_CASE.members[ - "queryContent" - ] - ) - - case 1: - kwargs["guard_content"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_GENERATED_TEST_CASE.members[ - "guardContent" - ] - ) - - case 2: - kwargs["expected_aggregated_findings_result"] = ( - AutomatedReasoningCheckResult( - de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_GENERATED_TEST_CASE.members[ - "expectedAggregatedFindingsResult" - ] - ) - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_GENERATED_TEST_CASE, consumer=_consumer - ) - if "query_content" not in kwargs: - kwargs["query_content"] = "" - if "guard_content" not in kwargs: - kwargs["guard_content"] = "" - if "expected_aggregated_findings_result" not in kwargs: - kwargs["expected_aggregated_findings_result"] = ( - AutomatedReasoningCheckResult._corrected("") - ) - return kwargs - - -def _serialize_automated_reasoning_policy_generated_test_case_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[AutomatedReasoningPolicyGeneratedTestCase], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_automated_reasoning_policy_generated_test_case_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AutomatedReasoningPolicyGeneratedTestCase]: - result: list[AutomatedReasoningPolicyGeneratedTestCase] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AutomatedReasoningPolicyGeneratedTestCase.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyGeneratedTestCases: - """ - Contains a comprehensive test suite generated by the build workflow, - providing validation capabilities for automated reasoning policies. - """ - - generated_test_cases: list[AutomatedReasoningPolicyGeneratedTestCase] - """Represents a collection of generated test cases.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_GENERATED_TEST_CASES, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_automated_reasoning_policy_generated_test_case_list( - serializer, - _SCHEMA_AUTOMATED_REASONING_POLICY_GENERATED_TEST_CASES.members[ - "generatedTestCases" - ], - self.generated_test_cases, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["generated_test_cases"] = ( - _deserialize_automated_reasoning_policy_generated_test_case_list( - de, - _SCHEMA_AUTOMATED_REASONING_POLICY_GENERATED_TEST_CASES.members[ - "generatedTestCases" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_GENERATED_TEST_CASES, consumer=_consumer - ) - if "generated_test_cases" not in kwargs: - kwargs["generated_test_cases"] = [] - return kwargs - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyScenario: - """ - Represents a test scenario used to validate an Automated Reasoning - policy, including the test conditions and expected outcomes. - """ - - expression: str = field(repr=False) - """The logical expression or condition that defines this test scenario.""" - - alternate_expression: str = field(repr=False) - """ - An alternative way to express the same test scenario, used for - validation and comparison purposes. - """ - - expected_result: str - """ - The expected outcome when this scenario is evaluated against the policy - (e.g., PASS, FAIL, VIOLATION). - """ - - rule_ids: list[str] - """ - The list of rule identifiers that are expected to be triggered or - evaluated by this test scenario. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_REASONING_POLICY_SCENARIO, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_SCENARIO.members["expression"], - self.expression, - ) - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_SCENARIO.members["alternateExpression"], - self.alternate_expression, - ) - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_SCENARIO.members["expectedResult"], - self.expected_result, - ) - _serialize_automated_reasoning_policy_definition_rule_id_list( - serializer, - _SCHEMA_AUTOMATED_REASONING_POLICY_SCENARIO.members["ruleIds"], - self.rule_ids, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["expression"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_SCENARIO.members[ - "expression" - ] - ) - - case 1: - kwargs["alternate_expression"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_SCENARIO.members[ - "alternateExpression" - ] - ) - - case 2: - kwargs["expected_result"] = AutomatedReasoningCheckResult( - de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_SCENARIO.members[ - "expectedResult" - ] - ) - ) - - case 3: - kwargs["rule_ids"] = ( - _deserialize_automated_reasoning_policy_definition_rule_id_list( - de, - _SCHEMA_AUTOMATED_REASONING_POLICY_SCENARIO.members[ - "ruleIds" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_SCENARIO, consumer=_consumer - ) - if "expression" not in kwargs: - kwargs["expression"] = "" - if "alternate_expression" not in kwargs: - kwargs["alternate_expression"] = "" - if "expected_result" not in kwargs: - kwargs["expected_result"] = AutomatedReasoningCheckResult._corrected("") - if "rule_ids" not in kwargs: - kwargs["rule_ids"] = [] - return kwargs - - -def _serialize_automated_reasoning_policy_scenario_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[AutomatedReasoningPolicyScenario], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_automated_reasoning_policy_scenario_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AutomatedReasoningPolicyScenario]: - result: list[AutomatedReasoningPolicyScenario] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AutomatedReasoningPolicyScenario.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyScenarios: - """ - Contains a comprehensive entity encompassing all the scenarios generated - by the build workflow, which can be used to validate an Automated - Reasoning policy. - """ - - policy_scenarios: list[AutomatedReasoningPolicyScenario] - """Represents a collection of generated policy scenarios.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_REASONING_POLICY_SCENARIOS, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_automated_reasoning_policy_scenario_list( - serializer, - _SCHEMA_AUTOMATED_REASONING_POLICY_SCENARIOS.members["policyScenarios"], - self.policy_scenarios, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_scenarios"] = ( - _deserialize_automated_reasoning_policy_scenario_list( - de, - _SCHEMA_AUTOMATED_REASONING_POLICY_SCENARIOS.members[ - "policyScenarios" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_SCENARIOS, consumer=_consumer - ) - if "policy_scenarios" not in kwargs: - kwargs["policy_scenarios"] = [] - return kwargs - - -def _serialize_automated_reasoning_policy_conflicted_rule_id_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_automated_reasoning_policy_conflicted_rule_id_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_automated_reasoning_policy_disjointed_rule_id_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_automated_reasoning_policy_disjointed_rule_id_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_automated_reasoning_policy_definition_variable_name_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_automated_reasoning_policy_definition_variable_name_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyDisjointRuleSet: - """ - Represents a set of rules that operate on completely separate variables, - indicating they address different concerns or domains within the policy. - """ - - variables: list[str] - """The set of variables that are used by the rules in this disjoint set.""" - - rules: list[str] - """ - The list of rules that form this disjoint set, all operating on the same - set of variables. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_DISJOINT_RULE_SET, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_automated_reasoning_policy_definition_variable_name_list( - serializer, - _SCHEMA_AUTOMATED_REASONING_POLICY_DISJOINT_RULE_SET.members["variables"], - self.variables, - ) - _serialize_automated_reasoning_policy_disjointed_rule_id_list( - serializer, - _SCHEMA_AUTOMATED_REASONING_POLICY_DISJOINT_RULE_SET.members["rules"], - self.rules, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["variables"] = ( - _deserialize_automated_reasoning_policy_definition_variable_name_list( - de, - _SCHEMA_AUTOMATED_REASONING_POLICY_DISJOINT_RULE_SET.members[ - "variables" - ], - ) - ) - - case 1: - kwargs["rules"] = ( - _deserialize_automated_reasoning_policy_disjointed_rule_id_list( - de, - _SCHEMA_AUTOMATED_REASONING_POLICY_DISJOINT_RULE_SET.members[ - "rules" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_DISJOINT_RULE_SET, consumer=_consumer - ) - if "variables" not in kwargs: - kwargs["variables"] = [] - if "rules" not in kwargs: - kwargs["rules"] = [] - return kwargs - - -def _serialize_automated_reasoning_policy_disjoint_rule_set_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[AutomatedReasoningPolicyDisjointRuleSet], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_automated_reasoning_policy_disjoint_rule_set_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AutomatedReasoningPolicyDisjointRuleSet]: - result: list[AutomatedReasoningPolicyDisjointRuleSet] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AutomatedReasoningPolicyDisjointRuleSet.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_automated_reasoning_policy_definition_type_name_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_automated_reasoning_policy_definition_type_name_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyDefinitionTypeValuePair: - """ - Associates a type name with a specific value name, used for referencing - type values in rules and other policy elements. - """ - - type_name: str = field(repr=False) - """The name of the custom type that contains the referenced value.""" - - value_name: str - """The name of the specific value within the type.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE_PAIR, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE_PAIR.members[ - "typeName" - ], - self.type_name, - ) - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE_PAIR.members[ - "valueName" - ], - self.value_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type_name"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE_PAIR.members[ - "typeName" - ] - ) - - case 1: - kwargs["value_name"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE_PAIR.members[ - "valueName" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_TYPE_VALUE_PAIR, - consumer=_consumer, - ) - if "type_name" not in kwargs: - kwargs["type_name"] = "" - if "value_name" not in kwargs: - kwargs["value_name"] = "" - return kwargs - - -def _serialize_automated_reasoning_policy_definition_type_value_pair_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[AutomatedReasoningPolicyDefinitionTypeValuePair], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_automated_reasoning_policy_definition_type_value_pair_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AutomatedReasoningPolicyDefinitionTypeValuePair]: - result: list[AutomatedReasoningPolicyDefinitionTypeValuePair] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append( - AutomatedReasoningPolicyDefinitionTypeValuePair.deserialize(d) - ) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyDefinitionQualityReport: - """ - Provides a comprehensive analysis of the quality and completeness of an - Automated Reasoning policy definition, highlighting potential issues and - optimization opportunities. - """ - - type_count: int - """The total number of custom types defined in the policy.""" - - variable_count: int - """The total number of variables defined in the policy.""" - - rule_count: int - """The total number of rules defined in the policy.""" - - unused_types: list[str] - """ - A list of custom types that are defined but not referenced by any - variables or rules, suggesting they may be unnecessary. - """ - - unused_type_values: list[AutomatedReasoningPolicyDefinitionTypeValuePair] - """ - A list of type values that are defined but never used in any rules, - indicating potential cleanup opportunities. - """ - - unused_variables: list[str] - """ - A list of variables that are defined but not referenced by any rules, - suggesting they may be unnecessary. - """ - - conflicting_rules: list[str] - """ - A list of rules that may conflict with each other, potentially leading - to inconsistent policy behavior. - """ - - disjoint_rule_sets: list[AutomatedReasoningPolicyDisjointRuleSet] - """ - Groups of rules that operate on completely separate sets of variables, - indicating the policy may be addressing multiple unrelated concerns. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_QUALITY_REPORT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_QUALITY_REPORT.members[ - "typeCount" - ], - self.type_count, - ) - serializer.write_integer( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_QUALITY_REPORT.members[ - "variableCount" - ], - self.variable_count, - ) - serializer.write_integer( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_QUALITY_REPORT.members[ - "ruleCount" - ], - self.rule_count, - ) - _serialize_automated_reasoning_policy_definition_type_name_list( - serializer, - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_QUALITY_REPORT.members[ - "unusedTypes" - ], - self.unused_types, - ) - _serialize_automated_reasoning_policy_definition_type_value_pair_list( - serializer, - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_QUALITY_REPORT.members[ - "unusedTypeValues" - ], - self.unused_type_values, - ) - _serialize_automated_reasoning_policy_definition_variable_name_list( - serializer, - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_QUALITY_REPORT.members[ - "unusedVariables" - ], - self.unused_variables, - ) - _serialize_automated_reasoning_policy_conflicted_rule_id_list( - serializer, - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_QUALITY_REPORT.members[ - "conflictingRules" - ], - self.conflicting_rules, - ) - _serialize_automated_reasoning_policy_disjoint_rule_set_list( - serializer, - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_QUALITY_REPORT.members[ - "disjointRuleSets" - ], - self.disjoint_rule_sets, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type_count"] = de.read_integer( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_QUALITY_REPORT.members[ - "typeCount" - ] - ) - - case 1: - kwargs["variable_count"] = de.read_integer( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_QUALITY_REPORT.members[ - "variableCount" - ] - ) - - case 2: - kwargs["rule_count"] = de.read_integer( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_QUALITY_REPORT.members[ - "ruleCount" - ] - ) - - case 3: - kwargs["unused_types"] = ( - _deserialize_automated_reasoning_policy_definition_type_name_list( - de, - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_QUALITY_REPORT.members[ - "unusedTypes" - ], - ) - ) - - case 4: - kwargs["unused_type_values"] = ( - _deserialize_automated_reasoning_policy_definition_type_value_pair_list( - de, - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_QUALITY_REPORT.members[ - "unusedTypeValues" - ], - ) - ) - - case 5: - kwargs["unused_variables"] = ( - _deserialize_automated_reasoning_policy_definition_variable_name_list( - de, - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_QUALITY_REPORT.members[ - "unusedVariables" - ], - ) - ) - - case 6: - kwargs["conflicting_rules"] = ( - _deserialize_automated_reasoning_policy_conflicted_rule_id_list( - de, - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_QUALITY_REPORT.members[ - "conflictingRules" - ], - ) - ) - - case 7: - kwargs["disjoint_rule_sets"] = ( - _deserialize_automated_reasoning_policy_disjoint_rule_set_list( - de, - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_QUALITY_REPORT.members[ - "disjointRuleSets" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_DEFINITION_QUALITY_REPORT, - consumer=_consumer, - ) - if "type_count" not in kwargs: - kwargs["type_count"] = 0 - if "variable_count" not in kwargs: - kwargs["variable_count"] = 0 - if "rule_count" not in kwargs: - kwargs["rule_count"] = 0 - if "unused_types" not in kwargs: - kwargs["unused_types"] = [] - if "unused_type_values" not in kwargs: - kwargs["unused_type_values"] = [] - if "unused_variables" not in kwargs: - kwargs["unused_variables"] = [] - if "conflicting_rules" not in kwargs: - kwargs["conflicting_rules"] = [] - if "disjoint_rule_sets" not in kwargs: - kwargs["disjoint_rule_sets"] = [] - return kwargs - - -@dataclass -class AutomatedReasoningPolicyBuildResultAssetsPolicyDefinition: - """ - The complete policy definition generated by the build workflow, - containing all rules, variables, and custom types extracted from the - source documents. - """ - - value: AutomatedReasoningPolicyDefinition - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSETS, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSETS.members[ - "policyDefinition" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=AutomatedReasoningPolicyDefinition.deserialize(deserializer)) - - -@dataclass -class AutomatedReasoningPolicyBuildResultAssetsQualityReport: - """ - A comprehensive report analyzing the quality of the generated policy, - including metrics about rule coverage, potential conflicts, and unused - elements. - """ - - value: AutomatedReasoningPolicyDefinitionQualityReport - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSETS, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSETS.members[ - "qualityReport" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=AutomatedReasoningPolicyDefinitionQualityReport.deserialize( - deserializer - ) - ) - - -@dataclass -class AutomatedReasoningPolicyBuildResultAssetsBuildLog: - """ - The complete build log containing detailed information about each step - in the policy generation process. - """ - - value: AutomatedReasoningPolicyBuildLog - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSETS, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSETS.members["buildLog"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=AutomatedReasoningPolicyBuildLog.deserialize(deserializer)) - - -@dataclass -class AutomatedReasoningPolicyBuildResultAssetsGeneratedTestCases: - """ - A comprehensive test suite generated by the build workflow, providing - validation capabilities for automated reasoning policies. - """ - - value: AutomatedReasoningPolicyGeneratedTestCases - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSETS, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSETS.members[ - "generatedTestCases" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=AutomatedReasoningPolicyGeneratedTestCases.deserialize(deserializer) - ) - - -@dataclass -class AutomatedReasoningPolicyBuildResultAssetsPolicyScenarios: - """ - An entity encompassing all the policy scenarios generated by the build - workflow, which can be used to validate an Automated Reasoning policy. - """ - - value: AutomatedReasoningPolicyScenarios - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSETS, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSETS.members[ - "policyScenarios" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=AutomatedReasoningPolicyScenarios.deserialize(deserializer)) - - -@dataclass -class AutomatedReasoningPolicyBuildResultAssetsAssetManifest: - """ - A manifest listing all available artifacts produced by the build - workflow. This provides a catalog of all assets that can be retrieved, - including their types, names, and identifiers. - """ - - value: AutomatedReasoningPolicyBuildResultAssetManifest - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSETS, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSETS.members[ - "assetManifest" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=AutomatedReasoningPolicyBuildResultAssetManifest.deserialize( - deserializer - ) - ) - - -@dataclass -class AutomatedReasoningPolicyBuildResultAssetsDocument: - """ - A source document that was used as input during the build workflow. This - allows you to retrieve the original documents that were processed to - generate the policy. - """ - - value: AutomatedReasoningPolicySourceDocument - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSETS, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSETS.members["document"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=AutomatedReasoningPolicySourceDocument.deserialize(deserializer) - ) - - -@dataclass -class AutomatedReasoningPolicyBuildResultAssetsFidelityReport: - """ - A comprehensive fidelity report that measures how accurately the - generated policy represents the source documents. The report includes - coverage and accuracy scores, along with detailed grounding information - for rules and variables. - """ - - value: AutomatedReasoningPolicyFidelityReport - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSETS, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSETS.members[ - "fidelityReport" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=AutomatedReasoningPolicyFidelityReport.deserialize(deserializer) - ) - - -@dataclass -class AutomatedReasoningPolicyBuildResultAssetsUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -AutomatedReasoningPolicyBuildResultAssets = Union[ - AutomatedReasoningPolicyBuildResultAssetsPolicyDefinition - | AutomatedReasoningPolicyBuildResultAssetsQualityReport - | AutomatedReasoningPolicyBuildResultAssetsBuildLog - | AutomatedReasoningPolicyBuildResultAssetsGeneratedTestCases - | AutomatedReasoningPolicyBuildResultAssetsPolicyScenarios - | AutomatedReasoningPolicyBuildResultAssetsAssetManifest - | AutomatedReasoningPolicyBuildResultAssetsDocument - | AutomatedReasoningPolicyBuildResultAssetsFidelityReport - | AutomatedReasoningPolicyBuildResultAssetsUnknown -] -""" -Contains the various assets generated during a policy build workflow, -including logs, quality reports, test cases, and the final policy -definition. -""" - - -class _AutomatedReasoningPolicyBuildResultAssetsDeserializer: - _result: AutomatedReasoningPolicyBuildResultAssets | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> AutomatedReasoningPolicyBuildResultAssets: - self._result = None - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_RESULT_ASSETS, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - AutomatedReasoningPolicyBuildResultAssetsPolicyDefinition.deserialize( - de - ) - ) - - case 1: - self._set_result( - AutomatedReasoningPolicyBuildResultAssetsQualityReport.deserialize( - de - ) - ) - - case 2: - self._set_result( - AutomatedReasoningPolicyBuildResultAssetsBuildLog.deserialize(de) - ) - - case 3: - self._set_result( - AutomatedReasoningPolicyBuildResultAssetsGeneratedTestCases.deserialize( - de - ) - ) - - case 4: - self._set_result( - AutomatedReasoningPolicyBuildResultAssetsPolicyScenarios.deserialize( - de - ) - ) - - case 5: - self._set_result( - AutomatedReasoningPolicyBuildResultAssetsAssetManifest.deserialize( - de - ) - ) - - case 6: - self._set_result( - AutomatedReasoningPolicyBuildResultAssetsDocument.deserialize(de) - ) - - case 7: - self._set_result( - AutomatedReasoningPolicyBuildResultAssetsFidelityReport.deserialize( - de - ) - ) - - case _: - self._set_result( - AutomatedReasoningPolicyBuildResultAssetsUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: AutomatedReasoningPolicyBuildResultAssets) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class GetAutomatedReasoningPolicyBuildWorkflowResultAssetsOutput: - """ - Dataclass for GetAutomatedReasoningPolicyBuildWorkflowResultAssetsOutput - structure. - """ - - policy_arn: str - """The Amazon Resource Name (ARN) of the Automated Reasoning policy.""" - - build_workflow_id: str - """The unique identifier of the build workflow.""" - - build_workflow_assets: AutomatedReasoningPolicyBuildResultAssets | None = None - """ - The requested build workflow asset. This is a union type that returns - only one of the available asset types (logs, reports, or generated - artifacts) based on the specific asset type requested in the API call. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_RESULT_ASSETS_OUTPUT, - self, - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_RESULT_ASSETS_OUTPUT.members[ - "policyArn" - ], - self.policy_arn, - ) - serializer.write_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_RESULT_ASSETS_OUTPUT.members[ - "buildWorkflowId" - ], - self.build_workflow_id, - ) - if self.build_workflow_assets is not None: - serializer.write_struct( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_RESULT_ASSETS_OUTPUT.members[ - "buildWorkflowAssets" - ], - self.build_workflow_assets, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_arn"] = de.read_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_RESULT_ASSETS_OUTPUT.members[ - "policyArn" - ] - ) - - case 1: - kwargs["build_workflow_id"] = de.read_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_RESULT_ASSETS_OUTPUT.members[ - "buildWorkflowId" - ] - ) - - case 2: - kwargs["build_workflow_assets"] = ( - _AutomatedReasoningPolicyBuildResultAssetsDeserializer().deserialize( - de - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_RESULT_ASSETS_OUTPUT, - consumer=_consumer, - ) - if "policy_arn" not in kwargs: - kwargs["policy_arn"] = "" - if "build_workflow_id" not in kwargs: - kwargs["build_workflow_id"] = "" - return kwargs - - -GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_RESULT_ASSETS = APIOperation( - input=GetAutomatedReasoningPolicyBuildWorkflowResultAssetsInput, - output=GetAutomatedReasoningPolicyBuildWorkflowResultAssetsOutput, - schema=_SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_RESULT_ASSETS, - input_schema=_SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_RESULT_ASSETS_INPUT, - output_schema=_SCHEMA_GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_RESULT_ASSETS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetAutomatedReasoningPolicyNextScenarioInput: - """Dataclass for GetAutomatedReasoningPolicyNextScenarioInput structure.""" - - policy_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the Automated Reasoning policy for - which you want to get the next test scenario. - """ - - build_workflow_id: str | None = None - """ - The unique identifier of the build workflow associated with the test - scenarios. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_NEXT_SCENARIO_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.policy_arn is not None: - serializer.write_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_NEXT_SCENARIO_INPUT.members[ - "policyArn" - ], - self.policy_arn, - ) - - if self.build_workflow_id is not None: - serializer.write_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_NEXT_SCENARIO_INPUT.members[ - "buildWorkflowId" - ], - self.build_workflow_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_arn"] = de.read_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_NEXT_SCENARIO_INPUT.members[ - "policyArn" - ] - ) - - case 1: - kwargs["build_workflow_id"] = de.read_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_NEXT_SCENARIO_INPUT.members[ - "buildWorkflowId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_NEXT_SCENARIO_INPUT, - consumer=_consumer, - ) - return kwargs - - -@dataclass(kw_only=True) -class GetAutomatedReasoningPolicyNextScenarioOutput: - """Dataclass for GetAutomatedReasoningPolicyNextScenarioOutput structure.""" - - policy_arn: str - """The Amazon Resource Name (ARN) of the Automated Reasoning policy.""" - - scenario: AutomatedReasoningPolicyScenario | None = None - """ - The next test scenario to validate, including the test expression and - expected results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_NEXT_SCENARIO_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_NEXT_SCENARIO_OUTPUT.members[ - "policyArn" - ], - self.policy_arn, - ) - if self.scenario is not None: - serializer.write_struct( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_NEXT_SCENARIO_OUTPUT.members[ - "scenario" - ], - self.scenario, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_arn"] = de.read_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_NEXT_SCENARIO_OUTPUT.members[ - "policyArn" - ] - ) - - case 1: - kwargs["scenario"] = AutomatedReasoningPolicyScenario.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_NEXT_SCENARIO_OUTPUT, - consumer=_consumer, - ) - if "policy_arn" not in kwargs: - kwargs["policy_arn"] = "" - return kwargs - - -GET_AUTOMATED_REASONING_POLICY_NEXT_SCENARIO = APIOperation( - input=GetAutomatedReasoningPolicyNextScenarioInput, - output=GetAutomatedReasoningPolicyNextScenarioOutput, - schema=_SCHEMA_GET_AUTOMATED_REASONING_POLICY_NEXT_SCENARIO, - input_schema=_SCHEMA_GET_AUTOMATED_REASONING_POLICY_NEXT_SCENARIO_INPUT, - output_schema=_SCHEMA_GET_AUTOMATED_REASONING_POLICY_NEXT_SCENARIO_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetAutomatedReasoningPolicyTestCaseInput: - """Dataclass for GetAutomatedReasoningPolicyTestCaseInput structure.""" - - policy_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the Automated Reasoning policy that - contains the test. - """ - - test_case_id: str | None = None - """The unique identifier of the test to retrieve.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.policy_arn is not None: - serializer.write_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT.members[ - "policyArn" - ], - self.policy_arn, - ) - - if self.test_case_id is not None: - serializer.write_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT.members[ - "testCaseId" - ], - self.test_case_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_arn"] = de.read_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT.members[ - "policyArn" - ] - ) - - case 1: - kwargs["test_case_id"] = de.read_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT.members[ - "testCaseId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyTestCase: - """ - Represents a test for validating an Automated Reasoning policy. tests - contain sample inputs and expected outcomes to verify policy behavior. - """ - - test_case_id: str - """The unique identifier of the test.""" - - guard_content: str = field(repr=False) - """ - The output content to be validated by the policy, typically representing - a foundation model response. - """ - - created_at: datetime - """The timestamp when the test was created.""" - - updated_at: datetime - """The timestamp when the test was last updated.""" - - query_content: str | None = field(repr=False, default=None) - """ - The input query or prompt that generated the content. This provides - context for the validation. - """ - - expected_aggregated_findings_result: str | None = None - """The expected result of the Automated Reasoning check for this test.""" - - confidence_threshold: float | None = None - """ - The minimum confidence level for logic validation. Content meeting this - threshold is considered high-confidence and can be validated. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_REASONING_POLICY_TEST_CASE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_TEST_CASE.members["testCaseId"], - self.test_case_id, - ) - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_TEST_CASE.members["guardContent"], - self.guard_content, - ) - if self.query_content is not None: - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_TEST_CASE.members["queryContent"], - self.query_content, - ) - - if self.expected_aggregated_findings_result is not None: - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_TEST_CASE.members[ - "expectedAggregatedFindingsResult" - ], - self.expected_aggregated_findings_result, - ) - - serializer.write_timestamp( - _SCHEMA_AUTOMATED_REASONING_POLICY_TEST_CASE.members["createdAt"], - self.created_at, - ) - serializer.write_timestamp( - _SCHEMA_AUTOMATED_REASONING_POLICY_TEST_CASE.members["updatedAt"], - self.updated_at, - ) - if self.confidence_threshold is not None: - serializer.write_double( - _SCHEMA_AUTOMATED_REASONING_POLICY_TEST_CASE.members[ - "confidenceThreshold" - ], - self.confidence_threshold, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["test_case_id"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_TEST_CASE.members[ - "testCaseId" - ] - ) - - case 1: - kwargs["guard_content"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_TEST_CASE.members[ - "guardContent" - ] - ) - - case 2: - kwargs["query_content"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_TEST_CASE.members[ - "queryContent" - ] - ) - - case 3: - kwargs["expected_aggregated_findings_result"] = ( - AutomatedReasoningCheckResult( - de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_TEST_CASE.members[ - "expectedAggregatedFindingsResult" - ] - ) - ) - ) - - case 4: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_AUTOMATED_REASONING_POLICY_TEST_CASE.members[ - "createdAt" - ] - ) - - case 5: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_AUTOMATED_REASONING_POLICY_TEST_CASE.members[ - "updatedAt" - ] - ) - - case 6: - kwargs["confidence_threshold"] = de.read_double( - _SCHEMA_AUTOMATED_REASONING_POLICY_TEST_CASE.members[ - "confidenceThreshold" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_TEST_CASE, consumer=_consumer - ) - if "test_case_id" not in kwargs: - kwargs["test_case_id"] = "" - if "guard_content" not in kwargs: - kwargs["guard_content"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls( - test_case_id="", - guard_content="", - created_at=datetime.fromtimestamp(0, tz=timezone.utc), - updated_at=datetime.fromtimestamp(0, tz=timezone.utc), - ) - - -@dataclass(kw_only=True) -class GetAutomatedReasoningPolicyTestCaseOutput: - """Dataclass for GetAutomatedReasoningPolicyTestCaseOutput structure.""" - - policy_arn: str - """The Amazon Resource Name (ARN) of the policy that contains the test.""" - - test_case: AutomatedReasoningPolicyTestCase - """ - The test details including the content, query, expected result, and - metadata. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_TEST_CASE_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_TEST_CASE_OUTPUT.members[ - "policyArn" - ], - self.policy_arn, - ) - serializer.write_struct( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_TEST_CASE_OUTPUT.members["testCase"], - self.test_case, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_arn"] = de.read_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_TEST_CASE_OUTPUT.members[ - "policyArn" - ] - ) - - case 1: - kwargs["test_case"] = AutomatedReasoningPolicyTestCase.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_TEST_CASE_OUTPUT, consumer=_consumer - ) - if "policy_arn" not in kwargs: - kwargs["policy_arn"] = "" - if "test_case" not in kwargs: - kwargs["test_case"] = AutomatedReasoningPolicyTestCase._smithy_default() - return kwargs - - -GET_AUTOMATED_REASONING_POLICY_TEST_CASE = APIOperation( - input=GetAutomatedReasoningPolicyTestCaseInput, - output=GetAutomatedReasoningPolicyTestCaseOutput, - schema=_SCHEMA_GET_AUTOMATED_REASONING_POLICY_TEST_CASE, - input_schema=_SCHEMA_GET_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT, - output_schema=_SCHEMA_GET_AUTOMATED_REASONING_POLICY_TEST_CASE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetAutomatedReasoningPolicyTestResultInput: - """Dataclass for GetAutomatedReasoningPolicyTestResultInput structure.""" - - policy_arn: str | None = None - """The Amazon Resource Name (ARN) of the Automated Reasoning policy.""" - - build_workflow_id: str | None = None - """ - The build workflow identifier. The build workflow must display a - `COMPLETED` status to get results. - """ - - test_case_id: str | None = None - """The unique identifier of the test for which to retrieve results.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_TEST_RESULT_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.policy_arn is not None: - serializer.write_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_TEST_RESULT_INPUT.members[ - "policyArn" - ], - self.policy_arn, - ) - - if self.build_workflow_id is not None: - serializer.write_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_TEST_RESULT_INPUT.members[ - "buildWorkflowId" - ], - self.build_workflow_id, - ) - - if self.test_case_id is not None: - serializer.write_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_TEST_RESULT_INPUT.members[ - "testCaseId" - ], - self.test_case_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_arn"] = de.read_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_TEST_RESULT_INPUT.members[ - "policyArn" - ] - ) - - case 1: - kwargs["build_workflow_id"] = de.read_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_TEST_RESULT_INPUT.members[ - "buildWorkflowId" - ] - ) - - case 2: - kwargs["test_case_id"] = de.read_string( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_TEST_RESULT_INPUT.members[ - "testCaseId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_TEST_RESULT_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class AutomatedReasoningCheckRule: - """ - References a specific automated reasoning policy rule that was applied - during evaluation. - """ - - id: str | None = None - """The unique identifier of the automated reasoning rule.""" - - policy_version_arn: str | None = None - """ - The ARN of the automated reasoning policy version that contains this - rule. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_REASONING_CHECK_RULE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_CHECK_RULE.members["id"], self.id - ) - - if self.policy_version_arn is not None: - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_CHECK_RULE.members["policyVersionArn"], - self.policy_version_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_CHECK_RULE.members["id"] - ) - - case 1: - kwargs["policy_version_arn"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_CHECK_RULE.members[ - "policyVersionArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_CHECK_RULE, consumer=_consumer - ) - return kwargs - - -def _serialize_automated_reasoning_check_rule_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[AutomatedReasoningCheckRule], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_automated_reasoning_check_rule_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AutomatedReasoningCheckRule]: - result: list[AutomatedReasoningCheckRule] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AutomatedReasoningCheckRule.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AutomatedReasoningLogicStatement: - """ - Represents a logical statement that can be expressed both in formal - logic notation and natural language, providing dual representations for - better understanding and validation. - """ - - logic: str = field(repr=False) - """ - The formal logic representation of the statement using mathematical - notation and logical operators. - """ - - natural_language: str | None = field(repr=False, default=None) - """ - The natural language representation of the logical statement, providing - a human-readable interpretation of the formal logic. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_REASONING_LOGIC_STATEMENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_LOGIC_STATEMENT.members["logic"], self.logic - ) - if self.natural_language is not None: - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_LOGIC_STATEMENT.members["naturalLanguage"], - self.natural_language, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["logic"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_LOGIC_STATEMENT.members["logic"] - ) - - case 1: - kwargs["natural_language"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_LOGIC_STATEMENT.members[ - "naturalLanguage" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_LOGIC_STATEMENT, consumer=_consumer - ) - if "logic" not in kwargs: - kwargs["logic"] = "" - return kwargs - - -def _serialize_automated_reasoning_logic_statement_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[AutomatedReasoningLogicStatement], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_automated_reasoning_logic_statement_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AutomatedReasoningLogicStatement]: - result: list[AutomatedReasoningLogicStatement] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AutomatedReasoningLogicStatement.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class AutomatedReasoningCheckLogicWarningType(UnknownEnumMixin, StrEnum): - ALWAYS_TRUE = "ALWAYS_TRUE" - ALWAYS_FALSE = "ALWAYS_FALSE" - - -@dataclass(kw_only=True) -class AutomatedReasoningCheckLogicWarning: - """ - Identifies logical issues in the translated statements that exist - independent of any policy rules, such as statements that are always true - or always false. - """ - - type: str | None = None - """ - The category of the detected logical issue, such as statements that are - always true or always false. - """ - - premises: list[AutomatedReasoningLogicStatement] | None = None - """ - The logical statements that serve as premises under which the claims are - validated. - """ - - claims: list[AutomatedReasoningLogicStatement] | None = None - """ - The logical statements that are validated while assuming the policy and - premises. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_REASONING_CHECK_LOGIC_WARNING, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_CHECK_LOGIC_WARNING.members["type"], - self.type, - ) - - if self.premises is not None: - _serialize_automated_reasoning_logic_statement_list( - serializer, - _SCHEMA_AUTOMATED_REASONING_CHECK_LOGIC_WARNING.members["premises"], - self.premises, - ) - - if self.claims is not None: - _serialize_automated_reasoning_logic_statement_list( - serializer, - _SCHEMA_AUTOMATED_REASONING_CHECK_LOGIC_WARNING.members["claims"], - self.claims, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = AutomatedReasoningCheckLogicWarningType( - de.read_string( - _SCHEMA_AUTOMATED_REASONING_CHECK_LOGIC_WARNING.members[ - "type" - ] - ) - ) - - case 1: - kwargs["premises"] = ( - _deserialize_automated_reasoning_logic_statement_list( - de, - _SCHEMA_AUTOMATED_REASONING_CHECK_LOGIC_WARNING.members[ - "premises" - ], - ) - ) - - case 2: - kwargs["claims"] = ( - _deserialize_automated_reasoning_logic_statement_list( - de, - _SCHEMA_AUTOMATED_REASONING_CHECK_LOGIC_WARNING.members[ - "claims" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_CHECK_LOGIC_WARNING, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class AutomatedReasoningCheckInputTextReference: - """ - References a portion of the original input text that corresponds to - logical elements. - """ - - text: str | None = field(repr=False, default=None) - """The specific text from the original input that this reference points to.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_CHECK_INPUT_TEXT_REFERENCE, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.text is not None: - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_CHECK_INPUT_TEXT_REFERENCE.members["text"], - self.text, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["text"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_CHECK_INPUT_TEXT_REFERENCE.members[ - "text" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_CHECK_INPUT_TEXT_REFERENCE, consumer=_consumer - ) - return kwargs - - -def _serialize_automated_reasoning_check_input_text_reference_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[AutomatedReasoningCheckInputTextReference], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_automated_reasoning_check_input_text_reference_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AutomatedReasoningCheckInputTextReference]: - result: list[AutomatedReasoningCheckInputTextReference] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AutomatedReasoningCheckInputTextReference.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AutomatedReasoningCheckTranslation: - """ - Contains the logical translation of natural language input into formal - logical statements, including premises, claims, and confidence scores. - """ - - claims: list[AutomatedReasoningLogicStatement] - """ - The logical statements that are being validated against the premises and - policy rules. - """ - - confidence: float - """ - A confidence score between 0 and 1 indicating how certain the system is - about the logical translation. - """ - - premises: list[AutomatedReasoningLogicStatement] | None = None - """ - The logical statements that serve as the foundation or assumptions for - the claims. - """ - - untranslated_premises: list[AutomatedReasoningCheckInputTextReference] | None = None - """ - References to portions of the original input text that correspond to the - premises but could not be fully translated. - """ - - untranslated_claims: list[AutomatedReasoningCheckInputTextReference] | None = None - """ - References to portions of the original input text that correspond to the - claims but could not be fully translated. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_REASONING_CHECK_TRANSLATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.premises is not None: - _serialize_automated_reasoning_logic_statement_list( - serializer, - _SCHEMA_AUTOMATED_REASONING_CHECK_TRANSLATION.members["premises"], - self.premises, - ) - - _serialize_automated_reasoning_logic_statement_list( - serializer, - _SCHEMA_AUTOMATED_REASONING_CHECK_TRANSLATION.members["claims"], - self.claims, - ) - if self.untranslated_premises is not None: - _serialize_automated_reasoning_check_input_text_reference_list( - serializer, - _SCHEMA_AUTOMATED_REASONING_CHECK_TRANSLATION.members[ - "untranslatedPremises" - ], - self.untranslated_premises, - ) - - if self.untranslated_claims is not None: - _serialize_automated_reasoning_check_input_text_reference_list( - serializer, - _SCHEMA_AUTOMATED_REASONING_CHECK_TRANSLATION.members[ - "untranslatedClaims" - ], - self.untranslated_claims, - ) - - serializer.write_double( - _SCHEMA_AUTOMATED_REASONING_CHECK_TRANSLATION.members["confidence"], - self.confidence, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["premises"] = ( - _deserialize_automated_reasoning_logic_statement_list( - de, - _SCHEMA_AUTOMATED_REASONING_CHECK_TRANSLATION.members[ - "premises" - ], - ) - ) - - case 1: - kwargs["claims"] = ( - _deserialize_automated_reasoning_logic_statement_list( - de, - _SCHEMA_AUTOMATED_REASONING_CHECK_TRANSLATION.members[ - "claims" - ], - ) - ) - - case 2: - kwargs["untranslated_premises"] = ( - _deserialize_automated_reasoning_check_input_text_reference_list( - de, - _SCHEMA_AUTOMATED_REASONING_CHECK_TRANSLATION.members[ - "untranslatedPremises" - ], - ) - ) - - case 3: - kwargs["untranslated_claims"] = ( - _deserialize_automated_reasoning_check_input_text_reference_list( - de, - _SCHEMA_AUTOMATED_REASONING_CHECK_TRANSLATION.members[ - "untranslatedClaims" - ], - ) - ) - - case 4: - kwargs["confidence"] = de.read_double( - _SCHEMA_AUTOMATED_REASONING_CHECK_TRANSLATION.members[ - "confidence" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_CHECK_TRANSLATION, consumer=_consumer - ) - if "claims" not in kwargs: - kwargs["claims"] = [] - if "confidence" not in kwargs: - kwargs["confidence"] = 0.0 - return kwargs - - -@dataclass(kw_only=True) -class AutomatedReasoningCheckImpossibleFinding: - """ - Indicates that no valid claims can be made due to logical contradictions - in the premises or rules. - """ - - translation: AutomatedReasoningCheckTranslation | None = None - """The logical translation of the input that this finding evaluates.""" - - contradicting_rules: list[AutomatedReasoningCheckRule] | None = None - """ - The automated reasoning policy rules that contradict the claims and/or - premises in the input. - """ - - logic_warning: AutomatedReasoningCheckLogicWarning | None = None - """ - Indication of a logic issue with the translation without needing to - consider the automated reasoning policy rules. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_CHECK_IMPOSSIBLE_FINDING, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.translation is not None: - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_CHECK_IMPOSSIBLE_FINDING.members[ - "translation" - ], - self.translation, - ) - - if self.contradicting_rules is not None: - _serialize_automated_reasoning_check_rule_list( - serializer, - _SCHEMA_AUTOMATED_REASONING_CHECK_IMPOSSIBLE_FINDING.members[ - "contradictingRules" - ], - self.contradicting_rules, - ) - - if self.logic_warning is not None: - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_CHECK_IMPOSSIBLE_FINDING.members[ - "logicWarning" - ], - self.logic_warning, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["translation"] = ( - AutomatedReasoningCheckTranslation.deserialize(de) - ) - - case 1: - kwargs["contradicting_rules"] = ( - _deserialize_automated_reasoning_check_rule_list( - de, - _SCHEMA_AUTOMATED_REASONING_CHECK_IMPOSSIBLE_FINDING.members[ - "contradictingRules" - ], - ) - ) - - case 2: - kwargs["logic_warning"] = ( - AutomatedReasoningCheckLogicWarning.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_CHECK_IMPOSSIBLE_FINDING, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class AutomatedReasoningCheckInvalidFinding: - """ - Indicates that the claims are logically false and contradictory to the - established rules or premises. - """ - - translation: AutomatedReasoningCheckTranslation | None = None - """The logical translation of the input that this finding invalidates.""" - - contradicting_rules: list[AutomatedReasoningCheckRule] | None = None - """ - The automated reasoning policy rules that contradict the claims in the - input. - """ - - logic_warning: AutomatedReasoningCheckLogicWarning | None = None - """ - Indication of a logic issue with the translation without needing to - consider the automated reasoning policy rules. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_REASONING_CHECK_INVALID_FINDING, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.translation is not None: - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_CHECK_INVALID_FINDING.members[ - "translation" - ], - self.translation, - ) - - if self.contradicting_rules is not None: - _serialize_automated_reasoning_check_rule_list( - serializer, - _SCHEMA_AUTOMATED_REASONING_CHECK_INVALID_FINDING.members[ - "contradictingRules" - ], - self.contradicting_rules, - ) - - if self.logic_warning is not None: - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_CHECK_INVALID_FINDING.members[ - "logicWarning" - ], - self.logic_warning, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["translation"] = ( - AutomatedReasoningCheckTranslation.deserialize(de) - ) - - case 1: - kwargs["contradicting_rules"] = ( - _deserialize_automated_reasoning_check_rule_list( - de, - _SCHEMA_AUTOMATED_REASONING_CHECK_INVALID_FINDING.members[ - "contradictingRules" - ], - ) - ) - - case 2: - kwargs["logic_warning"] = ( - AutomatedReasoningCheckLogicWarning.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_CHECK_INVALID_FINDING, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class AutomatedReasoningCheckNoTranslationsFinding: - """ - Indicates that no relevant logical information could be extracted from - the input for validation. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_CHECK_NO_TRANSLATIONS_FINDING, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_CHECK_NO_TRANSLATIONS_FINDING, - consumer=_consumer, - ) - return kwargs - - -@dataclass(kw_only=True) -class AutomatedReasoningCheckScenario: - """ - Represents a logical scenario where claims can be evaluated as true or - false, containing specific logical assignments. - """ - - statements: list[AutomatedReasoningLogicStatement] | None = None - """List of logical assignments and statements that define this scenario.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_REASONING_CHECK_SCENARIO, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.statements is not None: - _serialize_automated_reasoning_logic_statement_list( - serializer, - _SCHEMA_AUTOMATED_REASONING_CHECK_SCENARIO.members["statements"], - self.statements, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["statements"] = ( - _deserialize_automated_reasoning_logic_statement_list( - de, - _SCHEMA_AUTOMATED_REASONING_CHECK_SCENARIO.members[ - "statements" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_CHECK_SCENARIO, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class AutomatedReasoningCheckSatisfiableFinding: - """ - Indicates that the claims could be either true or false depending on - additional assumptions not provided in the input. - """ - - translation: AutomatedReasoningCheckTranslation | None = None - """The logical translation of the input that this finding evaluates.""" - - claims_true_scenario: AutomatedReasoningCheckScenario | None = None - """ - An example scenario demonstrating how the claims could be logically - true. - """ - - claims_false_scenario: AutomatedReasoningCheckScenario | None = None - """ - An example scenario demonstrating how the claims could be logically - false. - """ - - logic_warning: AutomatedReasoningCheckLogicWarning | None = None - """ - Indication of a logic issue with the translation without needing to - consider the automated reasoning policy rules. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_CHECK_SATISFIABLE_FINDING, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.translation is not None: - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_CHECK_SATISFIABLE_FINDING.members[ - "translation" - ], - self.translation, - ) - - if self.claims_true_scenario is not None: - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_CHECK_SATISFIABLE_FINDING.members[ - "claimsTrueScenario" - ], - self.claims_true_scenario, - ) - - if self.claims_false_scenario is not None: - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_CHECK_SATISFIABLE_FINDING.members[ - "claimsFalseScenario" - ], - self.claims_false_scenario, - ) - - if self.logic_warning is not None: - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_CHECK_SATISFIABLE_FINDING.members[ - "logicWarning" - ], - self.logic_warning, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["translation"] = ( - AutomatedReasoningCheckTranslation.deserialize(de) - ) - - case 1: - kwargs["claims_true_scenario"] = ( - AutomatedReasoningCheckScenario.deserialize(de) - ) - - case 2: - kwargs["claims_false_scenario"] = ( - AutomatedReasoningCheckScenario.deserialize(de) - ) - - case 3: - kwargs["logic_warning"] = ( - AutomatedReasoningCheckLogicWarning.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_CHECK_SATISFIABLE_FINDING, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class AutomatedReasoningCheckTooComplexFinding: - """ - Indicates that the input exceeds the processing capacity due to the - volume or complexity of the logical information. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_CHECK_TOO_COMPLEX_FINDING, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_CHECK_TOO_COMPLEX_FINDING, consumer=_consumer - ) - return kwargs - - -def _serialize_automated_reasoning_check_difference_scenario_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[AutomatedReasoningCheckScenario], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_automated_reasoning_check_difference_scenario_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AutomatedReasoningCheckScenario]: - result: list[AutomatedReasoningCheckScenario] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AutomatedReasoningCheckScenario.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_automated_reasoning_check_translation_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[AutomatedReasoningCheckTranslation], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_automated_reasoning_check_translation_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AutomatedReasoningCheckTranslation]: - result: list[AutomatedReasoningCheckTranslation] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AutomatedReasoningCheckTranslation.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AutomatedReasoningCheckTranslationOption: - """ - Represents one possible logical interpretation of ambiguous input - content. - """ - - translations: list[AutomatedReasoningCheckTranslation] | None = None - """ - Different logical interpretations that were detected during translation - of the input. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_CHECK_TRANSLATION_OPTION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.translations is not None: - _serialize_automated_reasoning_check_translation_list( - serializer, - _SCHEMA_AUTOMATED_REASONING_CHECK_TRANSLATION_OPTION.members[ - "translations" - ], - self.translations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["translations"] = ( - _deserialize_automated_reasoning_check_translation_list( - de, - _SCHEMA_AUTOMATED_REASONING_CHECK_TRANSLATION_OPTION.members[ - "translations" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_CHECK_TRANSLATION_OPTION, consumer=_consumer - ) - return kwargs - - -def _serialize_automated_reasoning_check_translation_option_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[AutomatedReasoningCheckTranslationOption], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_automated_reasoning_check_translation_option_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AutomatedReasoningCheckTranslationOption]: - result: list[AutomatedReasoningCheckTranslationOption] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AutomatedReasoningCheckTranslationOption.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AutomatedReasoningCheckTranslationAmbiguousFinding: - """ - Indicates that the input has multiple valid logical interpretations, - requiring additional context or clarification. - """ - - options: list[AutomatedReasoningCheckTranslationOption] | None = None - """ - Different logical interpretations that were detected during translation - of the input. - """ - - difference_scenarios: list[AutomatedReasoningCheckScenario] | None = None - """ - Scenarios showing how the different translation options differ in - meaning. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_CHECK_TRANSLATION_AMBIGUOUS_FINDING, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.options is not None: - _serialize_automated_reasoning_check_translation_option_list( - serializer, - _SCHEMA_AUTOMATED_REASONING_CHECK_TRANSLATION_AMBIGUOUS_FINDING.members[ - "options" - ], - self.options, - ) - - if self.difference_scenarios is not None: - _serialize_automated_reasoning_check_difference_scenario_list( - serializer, - _SCHEMA_AUTOMATED_REASONING_CHECK_TRANSLATION_AMBIGUOUS_FINDING.members[ - "differenceScenarios" - ], - self.difference_scenarios, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["options"] = ( - _deserialize_automated_reasoning_check_translation_option_list( - de, - _SCHEMA_AUTOMATED_REASONING_CHECK_TRANSLATION_AMBIGUOUS_FINDING.members[ - "options" - ], - ) - ) - - case 1: - kwargs["difference_scenarios"] = ( - _deserialize_automated_reasoning_check_difference_scenario_list( - de, - _SCHEMA_AUTOMATED_REASONING_CHECK_TRANSLATION_AMBIGUOUS_FINDING.members[ - "differenceScenarios" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_CHECK_TRANSLATION_AMBIGUOUS_FINDING, - consumer=_consumer, - ) - return kwargs - - -@dataclass(kw_only=True) -class AutomatedReasoningCheckValidFinding: - """ - Indicates that the claims are definitively true and logically implied by - the premises, with no possible alternative interpretations. - """ - - translation: AutomatedReasoningCheckTranslation | None = None - """The logical translation of the input that this finding validates.""" - - claims_true_scenario: AutomatedReasoningCheckScenario | None = None - """An example scenario demonstrating how the claims are logically true.""" - - supporting_rules: list[AutomatedReasoningCheckRule] | None = None - """ - The automated reasoning policy rules that support why this result is - considered valid. - """ - - logic_warning: AutomatedReasoningCheckLogicWarning | None = None - """ - Indication of a logic issue with the translation without needing to - consider the automated reasoning policy rules. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_REASONING_CHECK_VALID_FINDING, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.translation is not None: - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_CHECK_VALID_FINDING.members["translation"], - self.translation, - ) - - if self.claims_true_scenario is not None: - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_CHECK_VALID_FINDING.members[ - "claimsTrueScenario" - ], - self.claims_true_scenario, - ) - - if self.supporting_rules is not None: - _serialize_automated_reasoning_check_rule_list( - serializer, - _SCHEMA_AUTOMATED_REASONING_CHECK_VALID_FINDING.members[ - "supportingRules" - ], - self.supporting_rules, - ) - - if self.logic_warning is not None: - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_CHECK_VALID_FINDING.members["logicWarning"], - self.logic_warning, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["translation"] = ( - AutomatedReasoningCheckTranslation.deserialize(de) - ) - - case 1: - kwargs["claims_true_scenario"] = ( - AutomatedReasoningCheckScenario.deserialize(de) - ) - - case 2: - kwargs["supporting_rules"] = ( - _deserialize_automated_reasoning_check_rule_list( - de, - _SCHEMA_AUTOMATED_REASONING_CHECK_VALID_FINDING.members[ - "supportingRules" - ], - ) - ) - - case 3: - kwargs["logic_warning"] = ( - AutomatedReasoningCheckLogicWarning.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_CHECK_VALID_FINDING, consumer=_consumer - ) - return kwargs - - -@dataclass -class AutomatedReasoningCheckFindingValid: - """ - Indicates that the claims are true. The claims are implied by the - premises and the Automated Reasoning policy. Given the Automated - Reasoning policy and premises, it is not possible for these claims to be - false. - """ - - value: AutomatedReasoningCheckValidFinding - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_REASONING_CHECK_FINDING, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_CHECK_FINDING.members["valid"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=AutomatedReasoningCheckValidFinding.deserialize(deserializer)) - - -@dataclass -class AutomatedReasoningCheckFindingInvalid: - """ - Indicates that the claims are false. The claims are not implied by the - premises and Automated Reasoning policy. Furthermore, there exist - different claims that are consistent with the premises and Automated - Reasoning policy. - """ - - value: AutomatedReasoningCheckInvalidFinding - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_REASONING_CHECK_FINDING, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_CHECK_FINDING.members["invalid"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=AutomatedReasoningCheckInvalidFinding.deserialize(deserializer) - ) - - -@dataclass -class AutomatedReasoningCheckFindingSatisfiable: - """ - Indicates that the claims can be true or false. It depends on what - assumptions are made for the claim to be implied from the premises and - Automated Reasoning policy rules. In this situation, different - assumptions can make input claims false and alternative claims true. - """ - - value: AutomatedReasoningCheckSatisfiableFinding - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_REASONING_CHECK_FINDING, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_CHECK_FINDING.members["satisfiable"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=AutomatedReasoningCheckSatisfiableFinding.deserialize(deserializer) - ) - - -@dataclass -class AutomatedReasoningCheckFindingImpossible: - """ - Indicates that Automated Reasoning cannot make a statement about the - claims. This can happen if the premises are logically incorrect, or if - there is a conflict within the Automated Reasoning policy itself. - """ - - value: AutomatedReasoningCheckImpossibleFinding - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_REASONING_CHECK_FINDING, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_CHECK_FINDING.members["impossible"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=AutomatedReasoningCheckImpossibleFinding.deserialize(deserializer) - ) - - -@dataclass -class AutomatedReasoningCheckFindingTranslationAmbiguous: - """ - Indicates that an ambiguity was detected in the translation, making it - unsound to continue with validity checking. Additional context or - follow-up questions might be needed to get translation to succeed. - """ - - value: AutomatedReasoningCheckTranslationAmbiguousFinding - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_REASONING_CHECK_FINDING, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_CHECK_FINDING.members["translationAmbiguous"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=AutomatedReasoningCheckTranslationAmbiguousFinding.deserialize( - deserializer - ) - ) - - -@dataclass -class AutomatedReasoningCheckFindingTooComplex: - """ - Indicates that the input contains too much information for Automated - Reasoning to process within its latency limits. - """ - - value: AutomatedReasoningCheckTooComplexFinding - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_REASONING_CHECK_FINDING, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_CHECK_FINDING.members["tooComplex"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=AutomatedReasoningCheckTooComplexFinding.deserialize(deserializer) - ) - - -@dataclass -class AutomatedReasoningCheckFindingNoTranslations: - """ - Identifies that some or all of the input prompt wasn't translated into - logic. This can happen if the input isn't relevant to the Automated - Reasoning policy, or if the policy doesn't have variables to model - relevant input. - """ - - value: AutomatedReasoningCheckNoTranslationsFinding - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_REASONING_CHECK_FINDING, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_CHECK_FINDING.members["noTranslations"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=AutomatedReasoningCheckNoTranslationsFinding.deserialize(deserializer) - ) - - -@dataclass -class AutomatedReasoningCheckFindingUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -AutomatedReasoningCheckFinding = Union[ - AutomatedReasoningCheckFindingValid - | AutomatedReasoningCheckFindingInvalid - | AutomatedReasoningCheckFindingSatisfiable - | AutomatedReasoningCheckFindingImpossible - | AutomatedReasoningCheckFindingTranslationAmbiguous - | AutomatedReasoningCheckFindingTooComplex - | AutomatedReasoningCheckFindingNoTranslations - | AutomatedReasoningCheckFindingUnknown -] -""" -Represents the result of an Automated Reasoning validation check, -indicating whether the content is logically valid, invalid, or falls -into other categories based on the policy rules. -""" - - -class _AutomatedReasoningCheckFindingDeserializer: - _result: AutomatedReasoningCheckFinding | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> AutomatedReasoningCheckFinding: - self._result = None - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_CHECK_FINDING, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(AutomatedReasoningCheckFindingValid.deserialize(de)) - - case 1: - self._set_result(AutomatedReasoningCheckFindingInvalid.deserialize(de)) - - case 2: - self._set_result( - AutomatedReasoningCheckFindingSatisfiable.deserialize(de) - ) - - case 3: - self._set_result( - AutomatedReasoningCheckFindingImpossible.deserialize(de) - ) - - case 4: - self._set_result( - AutomatedReasoningCheckFindingTranslationAmbiguous.deserialize(de) - ) - - case 5: - self._set_result( - AutomatedReasoningCheckFindingTooComplex.deserialize(de) - ) - - case 6: - self._set_result( - AutomatedReasoningCheckFindingNoTranslations.deserialize(de) - ) - - case _: - self._set_result( - AutomatedReasoningCheckFindingUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: AutomatedReasoningCheckFinding) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_automated_reasoning_check_finding_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[AutomatedReasoningCheckFinding], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_automated_reasoning_check_finding_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AutomatedReasoningCheckFinding]: - result: list[AutomatedReasoningCheckFinding] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_AutomatedReasoningCheckFindingDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class AutomatedReasoningPolicyTestRunResult(UnknownEnumMixin, StrEnum): - PASSED = "PASSED" - FAILED = "FAILED" - - -class AutomatedReasoningPolicyTestRunStatus(UnknownEnumMixin, StrEnum): - NOT_STARTED = "NOT_STARTED" - SCHEDULED = "SCHEDULED" - IN_PROGRESS = "IN_PROGRESS" - COMPLETED = "COMPLETED" - FAILED = "FAILED" - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyTestResult: - """ - Contains the results of testing an Automated Reasoning policy against - various scenarios and validation checks. - """ - - test_case: AutomatedReasoningPolicyTestCase - """ - The test case that was executed, including the input content, expected - results, and configuration parameters used during validation. - """ - - policy_arn: str - """ - The Amazon Resource Name (ARN) of the Automated Reasoning policy that - was tested. - """ - - test_run_status: str - """ - The overall status of the test run (e.g., COMPLETED, FAILED, - IN_PROGRESS). - """ - - updated_at: datetime - """The timestamp when the test results were last updated.""" - - test_findings: list[AutomatedReasoningCheckFinding] | None = None - """ - Detailed findings from the test run, including any issues, violations, - or unexpected behaviors discovered. - """ - - test_run_result: str | None = None - """ - The overall result of the test run, indicating whether the policy passed - or failed validation. - """ - - aggregated_test_findings_result: str | None = None - """ - A summary of all test findings, aggregated to provide an overall - assessment of policy quality and correctness. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_REASONING_POLICY_TEST_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_TEST_RESULT.members["testCase"], - self.test_case, - ) - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_TEST_RESULT.members["policyArn"], - self.policy_arn, - ) - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_TEST_RESULT.members["testRunStatus"], - self.test_run_status, - ) - if self.test_findings is not None: - _serialize_automated_reasoning_check_finding_list( - serializer, - _SCHEMA_AUTOMATED_REASONING_POLICY_TEST_RESULT.members["testFindings"], - self.test_findings, - ) - - if self.test_run_result is not None: - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_TEST_RESULT.members["testRunResult"], - self.test_run_result, - ) - - if self.aggregated_test_findings_result is not None: - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_TEST_RESULT.members[ - "aggregatedTestFindingsResult" - ], - self.aggregated_test_findings_result, - ) - - serializer.write_timestamp( - _SCHEMA_AUTOMATED_REASONING_POLICY_TEST_RESULT.members["updatedAt"], - self.updated_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["test_case"] = AutomatedReasoningPolicyTestCase.deserialize( - de - ) - - case 1: - kwargs["policy_arn"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_TEST_RESULT.members[ - "policyArn" - ] - ) - - case 2: - kwargs["test_run_status"] = AutomatedReasoningPolicyTestRunStatus( - de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_TEST_RESULT.members[ - "testRunStatus" - ] - ) - ) - - case 3: - kwargs["test_findings"] = ( - _deserialize_automated_reasoning_check_finding_list( - de, - _SCHEMA_AUTOMATED_REASONING_POLICY_TEST_RESULT.members[ - "testFindings" - ], - ) - ) - - case 4: - kwargs["test_run_result"] = AutomatedReasoningPolicyTestRunResult( - de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_TEST_RESULT.members[ - "testRunResult" - ] - ) - ) - - case 5: - kwargs["aggregated_test_findings_result"] = ( - AutomatedReasoningCheckResult( - de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_TEST_RESULT.members[ - "aggregatedTestFindingsResult" - ] - ) - ) - ) - - case 6: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_AUTOMATED_REASONING_POLICY_TEST_RESULT.members[ - "updatedAt" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_TEST_RESULT, consumer=_consumer - ) - if "test_case" not in kwargs: - kwargs["test_case"] = AutomatedReasoningPolicyTestCase._smithy_default() - if "policy_arn" not in kwargs: - kwargs["policy_arn"] = "" - if "test_run_status" not in kwargs: - kwargs["test_run_status"] = ( - AutomatedReasoningPolicyTestRunStatus._corrected("") - ) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls( - test_case=AutomatedReasoningPolicyTestCase._smithy_default(), - policy_arn="", - test_run_status=AutomatedReasoningPolicyTestRunStatus._corrected(""), - updated_at=datetime.fromtimestamp(0, tz=timezone.utc), - ) - - -@dataclass(kw_only=True) -class GetAutomatedReasoningPolicyTestResultOutput: - """Dataclass for GetAutomatedReasoningPolicyTestResultOutput structure.""" - - test_result: AutomatedReasoningPolicyTestResult - """ - The test result containing validation findings, execution status, and - detailed analysis. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_TEST_RESULT_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_TEST_RESULT_OUTPUT.members[ - "testResult" - ], - self.test_result, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["test_result"] = ( - AutomatedReasoningPolicyTestResult.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_AUTOMATED_REASONING_POLICY_TEST_RESULT_OUTPUT, - consumer=_consumer, - ) - if "test_result" not in kwargs: - kwargs["test_result"] = AutomatedReasoningPolicyTestResult._smithy_default() - return kwargs - - -GET_AUTOMATED_REASONING_POLICY_TEST_RESULT = APIOperation( - input=GetAutomatedReasoningPolicyTestResultInput, - output=GetAutomatedReasoningPolicyTestResultOutput, - schema=_SCHEMA_GET_AUTOMATED_REASONING_POLICY_TEST_RESULT, - input_schema=_SCHEMA_GET_AUTOMATED_REASONING_POLICY_TEST_RESULT_INPUT, - output_schema=_SCHEMA_GET_AUTOMATED_REASONING_POLICY_TEST_RESULT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListAutomatedReasoningPoliciesInput: - """Dataclass for ListAutomatedReasoningPoliciesInput structure.""" - - policy_arn: str | None = None - """ - Optional filter to list only the policy versions with the specified - Amazon Resource Name (ARN). If not provided, the DRAFT versions for all - policies are listed. - """ - - next_token: str | None = None - """ - The pagination token from a previous request to retrieve the next page - of results. - """ - - max_results: int = 25 - """The maximum number of policies to return in a single call.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_AUTOMATED_REASONING_POLICIES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.policy_arn is not None: - serializer.write_string( - _SCHEMA_LIST_AUTOMATED_REASONING_POLICIES_INPUT.members["policyArn"], - self.policy_arn, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_AUTOMATED_REASONING_POLICIES_INPUT.members["nextToken"], - self.next_token, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_AUTOMATED_REASONING_POLICIES_INPUT.members["maxResults"], - self.max_results, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_arn"] = de.read_string( - _SCHEMA_LIST_AUTOMATED_REASONING_POLICIES_INPUT.members[ - "policyArn" - ] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_AUTOMATED_REASONING_POLICIES_INPUT.members[ - "nextToken" - ] - ) - - case 2: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_AUTOMATED_REASONING_POLICIES_INPUT.members[ - "maxResults" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_AUTOMATED_REASONING_POLICIES_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicySummary: - """ - Contains summary information about an Automated Reasoning policy, - including metadata and timestamps. - """ - - policy_arn: str - """The Amazon Resource Name (ARN) of the policy.""" - - name: str = field(repr=False) - """The name of the policy.""" - - version: str - """The version of the policy.""" - - policy_id: str - """The unique identifier of the policy.""" - - created_at: datetime - """The timestamp when the policy was created.""" - - updated_at: datetime - """The timestamp when the policy was last updated.""" - - description: str | None = field(repr=False, default=None) - """The description of the policy.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_REASONING_POLICY_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_SUMMARY.members["policyArn"], - self.policy_arn, - ) - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_SUMMARY.members["name"], self.name - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_SUMMARY.members["description"], - self.description, - ) - - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_SUMMARY.members["version"], self.version - ) - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_SUMMARY.members["policyId"], - self.policy_id, - ) - serializer.write_timestamp( - _SCHEMA_AUTOMATED_REASONING_POLICY_SUMMARY.members["createdAt"], - self.created_at, - ) - serializer.write_timestamp( - _SCHEMA_AUTOMATED_REASONING_POLICY_SUMMARY.members["updatedAt"], - self.updated_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_arn"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_SUMMARY.members["policyArn"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_SUMMARY.members["name"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_SUMMARY.members[ - "description" - ] - ) - - case 3: - kwargs["version"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_SUMMARY.members["version"] - ) - - case 4: - kwargs["policy_id"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_SUMMARY.members["policyId"] - ) - - case 5: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_AUTOMATED_REASONING_POLICY_SUMMARY.members["createdAt"] - ) - - case 6: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_AUTOMATED_REASONING_POLICY_SUMMARY.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_SUMMARY, consumer=_consumer - ) - if "policy_arn" not in kwargs: - kwargs["policy_arn"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "version" not in kwargs: - kwargs["version"] = "" - if "policy_id" not in kwargs: - kwargs["policy_id"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_automated_reasoning_policy_summaries( - serializer: ShapeSerializer, - schema: Schema, - value: list[AutomatedReasoningPolicySummary], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_automated_reasoning_policy_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AutomatedReasoningPolicySummary]: - result: list[AutomatedReasoningPolicySummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AutomatedReasoningPolicySummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListAutomatedReasoningPoliciesOutput: - """Dataclass for ListAutomatedReasoningPoliciesOutput structure.""" - - automated_reasoning_policy_summaries: list[AutomatedReasoningPolicySummary] - """A list of Automated Reasoning policy summaries.""" - - next_token: str | None = None - """ - The pagination token to use in a subsequent request to retrieve the next - page of results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_AUTOMATED_REASONING_POLICIES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_automated_reasoning_policy_summaries( - serializer, - _SCHEMA_LIST_AUTOMATED_REASONING_POLICIES_OUTPUT.members[ - "automatedReasoningPolicySummaries" - ], - self.automated_reasoning_policy_summaries, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_AUTOMATED_REASONING_POLICIES_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["automated_reasoning_policy_summaries"] = ( - _deserialize_automated_reasoning_policy_summaries( - de, - _SCHEMA_LIST_AUTOMATED_REASONING_POLICIES_OUTPUT.members[ - "automatedReasoningPolicySummaries" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_AUTOMATED_REASONING_POLICIES_OUTPUT.members[ - "nextToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_AUTOMATED_REASONING_POLICIES_OUTPUT, consumer=_consumer - ) - if "automated_reasoning_policy_summaries" not in kwargs: - kwargs["automated_reasoning_policy_summaries"] = [] - return kwargs - - -LIST_AUTOMATED_REASONING_POLICIES = APIOperation( - input=ListAutomatedReasoningPoliciesInput, - output=ListAutomatedReasoningPoliciesOutput, - schema=_SCHEMA_LIST_AUTOMATED_REASONING_POLICIES, - input_schema=_SCHEMA_LIST_AUTOMATED_REASONING_POLICIES_INPUT, - output_schema=_SCHEMA_LIST_AUTOMATED_REASONING_POLICIES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListAutomatedReasoningPolicyBuildWorkflowsInput: - """Dataclass for ListAutomatedReasoningPolicyBuildWorkflowsInput structure.""" - - policy_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the Automated Reasoning policy whose - build workflows you want to list. - """ - - next_token: str | None = None - """ - A pagination token from a previous request to continue listing build - workflows from where the previous request left off. - """ - - max_results: int = 25 - """ - The maximum number of build workflows to return in a single response. - Valid range is 1-100. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOWS_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.policy_arn is not None: - serializer.write_string( - _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOWS_INPUT.members[ - "policyArn" - ], - self.policy_arn, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOWS_INPUT.members[ - "nextToken" - ], - self.next_token, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOWS_INPUT.members[ - "maxResults" - ], - self.max_results, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_arn"] = de.read_string( - _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOWS_INPUT.members[ - "policyArn" - ] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOWS_INPUT.members[ - "nextToken" - ] - ) - - case 2: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOWS_INPUT.members[ - "maxResults" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOWS_INPUT, - consumer=_consumer, - ) - return kwargs - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyBuildWorkflowSummary: - """ - Provides a summary of a policy build workflow, including its current - status, timing information, and key identifiers. - """ - - policy_arn: str - """ - The Amazon Resource Name (ARN) of the Automated Reasoning policy - associated with this build workflow. - """ - - build_workflow_id: str - """The unique identifier of the build workflow.""" - - status: str - """ - The current status of the build workflow (e.g., RUNNING, COMPLETED, - FAILED, CANCELLED). - """ - - build_workflow_type: str - """The type of build workflow (e.g., DOCUMENT_INGESTION, POLICY_REPAIR).""" - - created_at: datetime - """The timestamp when the build workflow was created.""" - - updated_at: datetime - """The timestamp when the build workflow was last updated.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_SUMMARY, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_SUMMARY.members[ - "policyArn" - ], - self.policy_arn, - ) - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_SUMMARY.members[ - "buildWorkflowId" - ], - self.build_workflow_id, - ) - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_SUMMARY.members["status"], - self.status, - ) - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_SUMMARY.members[ - "buildWorkflowType" - ], - self.build_workflow_type, - ) - serializer.write_timestamp( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_SUMMARY.members[ - "createdAt" - ], - self.created_at, - ) - serializer.write_timestamp( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_SUMMARY.members[ - "updatedAt" - ], - self.updated_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_arn"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_SUMMARY.members[ - "policyArn" - ] - ) - - case 1: - kwargs["build_workflow_id"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_SUMMARY.members[ - "buildWorkflowId" - ] - ) - - case 2: - kwargs["status"] = AutomatedReasoningPolicyBuildWorkflowStatus( - de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_SUMMARY.members[ - "status" - ] - ) - ) - - case 3: - kwargs["build_workflow_type"] = ( - AutomatedReasoningPolicyBuildWorkflowType( - de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_SUMMARY.members[ - "buildWorkflowType" - ] - ) - ) - ) - - case 4: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_SUMMARY.members[ - "createdAt" - ] - ) - - case 5: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_SUMMARY.members[ - "updatedAt" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_SUMMARY, - consumer=_consumer, - ) - if "policy_arn" not in kwargs: - kwargs["policy_arn"] = "" - if "build_workflow_id" not in kwargs: - kwargs["build_workflow_id"] = "" - if "status" not in kwargs: - kwargs["status"] = AutomatedReasoningPolicyBuildWorkflowStatus._corrected( - "" - ) - if "build_workflow_type" not in kwargs: - kwargs["build_workflow_type"] = ( - AutomatedReasoningPolicyBuildWorkflowType._corrected("") - ) - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_automated_reasoning_policy_build_workflow_summaries( - serializer: ShapeSerializer, - schema: Schema, - value: list[AutomatedReasoningPolicyBuildWorkflowSummary], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_automated_reasoning_policy_build_workflow_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AutomatedReasoningPolicyBuildWorkflowSummary]: - result: list[AutomatedReasoningPolicyBuildWorkflowSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AutomatedReasoningPolicyBuildWorkflowSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListAutomatedReasoningPolicyBuildWorkflowsOutput: - """ - Dataclass for ListAutomatedReasoningPolicyBuildWorkflowsOutput - structure. - """ - - automated_reasoning_policy_build_workflow_summaries: list[ - AutomatedReasoningPolicyBuildWorkflowSummary - ] - """ - A list of build workflow summaries, each containing key information - about a build workflow including its status and timestamps. - """ - - next_token: str | None = None - """ - A pagination token to use in subsequent requests to retrieve additional - build workflows. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOWS_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_automated_reasoning_policy_build_workflow_summaries( - serializer, - _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOWS_OUTPUT.members[ - "automatedReasoningPolicyBuildWorkflowSummaries" - ], - self.automated_reasoning_policy_build_workflow_summaries, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOWS_OUTPUT.members[ - "nextToken" - ], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["automated_reasoning_policy_build_workflow_summaries"] = ( - _deserialize_automated_reasoning_policy_build_workflow_summaries( - de, - _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOWS_OUTPUT.members[ - "automatedReasoningPolicyBuildWorkflowSummaries" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOWS_OUTPUT.members[ - "nextToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOWS_OUTPUT, - consumer=_consumer, - ) - if "automated_reasoning_policy_build_workflow_summaries" not in kwargs: - kwargs["automated_reasoning_policy_build_workflow_summaries"] = [] - return kwargs - - -LIST_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOWS = APIOperation( - input=ListAutomatedReasoningPolicyBuildWorkflowsInput, - output=ListAutomatedReasoningPolicyBuildWorkflowsOutput, - schema=_SCHEMA_LIST_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOWS, - input_schema=_SCHEMA_LIST_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOWS_INPUT, - output_schema=_SCHEMA_LIST_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOWS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListAutomatedReasoningPolicyTestCasesInput: - """Dataclass for ListAutomatedReasoningPolicyTestCasesInput structure.""" - - policy_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the Automated Reasoning policy for - which to list tests. - """ - - next_token: str | None = None - """ - The pagination token from a previous request to retrieve the next page - of results. - """ - - max_results: int = 25 - """The maximum number of tests to return in a single call.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_TEST_CASES_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.policy_arn is not None: - serializer.write_string( - _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_TEST_CASES_INPUT.members[ - "policyArn" - ], - self.policy_arn, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_TEST_CASES_INPUT.members[ - "nextToken" - ], - self.next_token, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_TEST_CASES_INPUT.members[ - "maxResults" - ], - self.max_results, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_arn"] = de.read_string( - _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_TEST_CASES_INPUT.members[ - "policyArn" - ] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_TEST_CASES_INPUT.members[ - "nextToken" - ] - ) - - case 2: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_TEST_CASES_INPUT.members[ - "maxResults" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_TEST_CASES_INPUT, consumer=_consumer - ) - return kwargs - - -def _serialize_automated_reasoning_policy_test_case_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[AutomatedReasoningPolicyTestCase], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_automated_reasoning_policy_test_case_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AutomatedReasoningPolicyTestCase]: - result: list[AutomatedReasoningPolicyTestCase] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AutomatedReasoningPolicyTestCase.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListAutomatedReasoningPolicyTestCasesOutput: - """Dataclass for ListAutomatedReasoningPolicyTestCasesOutput structure.""" - - test_cases: list[AutomatedReasoningPolicyTestCase] - """A list of tests for the specified policy.""" - - next_token: str | None = None - """ - The pagination token to use in a subsequent request to retrieve the next - page of results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_TEST_CASES_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_automated_reasoning_policy_test_case_list( - serializer, - _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_TEST_CASES_OUTPUT.members[ - "testCases" - ], - self.test_cases, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_TEST_CASES_OUTPUT.members[ - "nextToken" - ], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["test_cases"] = ( - _deserialize_automated_reasoning_policy_test_case_list( - de, - _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_TEST_CASES_OUTPUT.members[ - "testCases" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_TEST_CASES_OUTPUT.members[ - "nextToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_TEST_CASES_OUTPUT, - consumer=_consumer, - ) - if "test_cases" not in kwargs: - kwargs["test_cases"] = [] - return kwargs - - -LIST_AUTOMATED_REASONING_POLICY_TEST_CASES = APIOperation( - input=ListAutomatedReasoningPolicyTestCasesInput, - output=ListAutomatedReasoningPolicyTestCasesOutput, - schema=_SCHEMA_LIST_AUTOMATED_REASONING_POLICY_TEST_CASES, - input_schema=_SCHEMA_LIST_AUTOMATED_REASONING_POLICY_TEST_CASES_INPUT, - output_schema=_SCHEMA_LIST_AUTOMATED_REASONING_POLICY_TEST_CASES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListAutomatedReasoningPolicyTestResultsInput: - """Dataclass for ListAutomatedReasoningPolicyTestResultsInput structure.""" - - policy_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the Automated Reasoning policy whose - test results you want to list. - """ - - build_workflow_id: str | None = None - """ - The unique identifier of the build workflow whose test results you want - to list. - """ - - next_token: str | None = None - """ - A pagination token from a previous request to continue listing test - results from where the previous request left off. - """ - - max_results: int = 25 - """ - The maximum number of test results to return in a single response. Valid - range is 1-100. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_TEST_RESULTS_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.policy_arn is not None: - serializer.write_string( - _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_TEST_RESULTS_INPUT.members[ - "policyArn" - ], - self.policy_arn, - ) - - if self.build_workflow_id is not None: - serializer.write_string( - _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_TEST_RESULTS_INPUT.members[ - "buildWorkflowId" - ], - self.build_workflow_id, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_TEST_RESULTS_INPUT.members[ - "nextToken" - ], - self.next_token, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_TEST_RESULTS_INPUT.members[ - "maxResults" - ], - self.max_results, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_arn"] = de.read_string( - _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_TEST_RESULTS_INPUT.members[ - "policyArn" - ] - ) - - case 1: - kwargs["build_workflow_id"] = de.read_string( - _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_TEST_RESULTS_INPUT.members[ - "buildWorkflowId" - ] - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_TEST_RESULTS_INPUT.members[ - "nextToken" - ] - ) - - case 3: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_TEST_RESULTS_INPUT.members[ - "maxResults" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_TEST_RESULTS_INPUT, - consumer=_consumer, - ) - return kwargs - - -def _serialize_automated_reasoning_policy_test_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[AutomatedReasoningPolicyTestResult], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_automated_reasoning_policy_test_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AutomatedReasoningPolicyTestResult]: - result: list[AutomatedReasoningPolicyTestResult] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AutomatedReasoningPolicyTestResult.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListAutomatedReasoningPolicyTestResultsOutput: - """Dataclass for ListAutomatedReasoningPolicyTestResultsOutput structure.""" - - test_results: list[AutomatedReasoningPolicyTestResult] - """ - A list of test results, each containing information about how the policy - performed on specific test scenarios. - """ - - next_token: str | None = None - """ - A pagination token to use in subsequent requests to retrieve additional - test results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_TEST_RESULTS_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_automated_reasoning_policy_test_list( - serializer, - _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_TEST_RESULTS_OUTPUT.members[ - "testResults" - ], - self.test_results, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_TEST_RESULTS_OUTPUT.members[ - "nextToken" - ], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["test_results"] = ( - _deserialize_automated_reasoning_policy_test_list( - de, - _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_TEST_RESULTS_OUTPUT.members[ - "testResults" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_TEST_RESULTS_OUTPUT.members[ - "nextToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_AUTOMATED_REASONING_POLICY_TEST_RESULTS_OUTPUT, - consumer=_consumer, - ) - if "test_results" not in kwargs: - kwargs["test_results"] = [] - return kwargs - - -LIST_AUTOMATED_REASONING_POLICY_TEST_RESULTS = APIOperation( - input=ListAutomatedReasoningPolicyTestResultsInput, - output=ListAutomatedReasoningPolicyTestResultsOutput, - schema=_SCHEMA_LIST_AUTOMATED_REASONING_POLICY_TEST_RESULTS, - input_schema=_SCHEMA_LIST_AUTOMATED_REASONING_POLICY_TEST_RESULTS_INPUT, - output_schema=_SCHEMA_LIST_AUTOMATED_REASONING_POLICY_TEST_RESULTS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrock#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyBuildWorkflowDocument: - """ - Represents a source document used in the policy build workflow, - containing the content and metadata needed for policy generation. - """ - - document: bytes = field(repr=False) - """ - The actual content of the source document that will be analyzed to - extract policy rules and concepts. - """ - - document_content_type: str - """ - The MIME type of the document content (e.g., text/plain, - application/pdf, text/markdown). - """ - - document_name: str = field(repr=False) - """ - A descriptive name for the document that helps identify its purpose and - content. - """ - - document_description: str | None = field(repr=False, default=None) - """ - A detailed description of the document's content and how it should be - used in the policy generation process. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_DOCUMENT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_blob( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_DOCUMENT.members[ - "document" - ], - self.document, - ) - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_DOCUMENT.members[ - "documentContentType" - ], - self.document_content_type, - ) - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_DOCUMENT.members[ - "documentName" - ], - self.document_name, - ) - if self.document_description is not None: - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_DOCUMENT.members[ - "documentDescription" - ], - self.document_description, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["document"] = de.read_blob( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_DOCUMENT.members[ - "document" - ] - ) - - case 1: - kwargs["document_content_type"] = ( - AutomatedReasoningPolicyBuildDocumentContentType( - de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_DOCUMENT.members[ - "documentContentType" - ] - ) - ) - ) - - case 2: - kwargs["document_name"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_DOCUMENT.members[ - "documentName" - ] - ) - - case 3: - kwargs["document_description"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_DOCUMENT.members[ - "documentDescription" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_DOCUMENT, - consumer=_consumer, - ) - if "document" not in kwargs: - kwargs["document"] = b"" - if "document_content_type" not in kwargs: - kwargs["document_content_type"] = ( - AutomatedReasoningPolicyBuildDocumentContentType._corrected("") - ) - if "document_name" not in kwargs: - kwargs["document_name"] = "" - return kwargs - - -def _serialize_automated_reasoning_policy_build_workflow_document_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[AutomatedReasoningPolicyBuildWorkflowDocument], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_automated_reasoning_policy_build_workflow_document_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AutomatedReasoningPolicyBuildWorkflowDocument]: - result: list[AutomatedReasoningPolicyBuildWorkflowDocument] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AutomatedReasoningPolicyBuildWorkflowDocument.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_automated_reasoning_policy_generate_fidelity_report_document_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[AutomatedReasoningPolicyBuildWorkflowDocument], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_automated_reasoning_policy_generate_fidelity_report_document_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AutomatedReasoningPolicyBuildWorkflowDocument]: - result: list[AutomatedReasoningPolicyBuildWorkflowDocument] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AutomatedReasoningPolicyBuildWorkflowDocument.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass -class AutomatedReasoningPolicyGenerateFidelityReportContentDocuments: - """ - Source documents to analyze for generating a new fidelity report. The - documents will be processed to create atomic statements and grounding - information. - """ - - value: list[AutomatedReasoningPolicyBuildWorkflowDocument] - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_GENERATE_FIDELITY_REPORT_CONTENT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_automated_reasoning_policy_generate_fidelity_report_document_list( - serializer, - _SCHEMA_AUTOMATED_REASONING_POLICY_GENERATE_FIDELITY_REPORT_CONTENT.members[ - "documents" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_deserialize_automated_reasoning_policy_generate_fidelity_report_document_list( - deserializer, - _SCHEMA_AUTOMATED_REASONING_POLICY_GENERATE_FIDELITY_REPORT_CONTENT.members[ - "documents" - ], - ) - ) - - -@dataclass -class AutomatedReasoningPolicyGenerateFidelityReportContentUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -AutomatedReasoningPolicyGenerateFidelityReportContent = Union[ - AutomatedReasoningPolicyGenerateFidelityReportContentDocuments - | AutomatedReasoningPolicyGenerateFidelityReportContentUnknown -] -""" -Configuration for generating a fidelity report, which can either analyze -new documents or update an existing fidelity report with a new policy -definition. -""" - - -class _AutomatedReasoningPolicyGenerateFidelityReportContentDeserializer: - _result: AutomatedReasoningPolicyGenerateFidelityReportContent | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> AutomatedReasoningPolicyGenerateFidelityReportContent: - self._result = None - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_GENERATE_FIDELITY_REPORT_CONTENT, - self._consumer, - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - AutomatedReasoningPolicyGenerateFidelityReportContentDocuments.deserialize( - de - ) - ) - - case _: - self._set_result( - AutomatedReasoningPolicyGenerateFidelityReportContentUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result( - self, value: AutomatedReasoningPolicyGenerateFidelityReportContent - ) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_automated_reasoning_policy_iterative_refinement_document_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[AutomatedReasoningPolicyBuildWorkflowDocument], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_automated_reasoning_policy_iterative_refinement_document_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AutomatedReasoningPolicyBuildWorkflowDocument]: - result: list[AutomatedReasoningPolicyBuildWorkflowDocument] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AutomatedReasoningPolicyBuildWorkflowDocument.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyIterativeRefinementContent: - """ - Configuration for an iterative policy refinement workflow, including - source documents to process and optional feedback to guide the - refinement. - """ - - documents: list[AutomatedReasoningPolicyBuildWorkflowDocument] - """ - Source documents used for iterative policy refinement. These documents - provide context for refining the policy definition. - """ - - feedback: str | None = field(repr=False, default=None) - """ - Optional feedback to guide the iterative refinement workflow. Provide - specific instructions or constraints for policy refinement. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_ITERATIVE_REFINEMENT_CONTENT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_automated_reasoning_policy_iterative_refinement_document_list( - serializer, - _SCHEMA_AUTOMATED_REASONING_POLICY_ITERATIVE_REFINEMENT_CONTENT.members[ - "documents" - ], - self.documents, - ) - if self.feedback is not None: - serializer.write_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_ITERATIVE_REFINEMENT_CONTENT.members[ - "feedback" - ], - self.feedback, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["documents"] = ( - _deserialize_automated_reasoning_policy_iterative_refinement_document_list( - de, - _SCHEMA_AUTOMATED_REASONING_POLICY_ITERATIVE_REFINEMENT_CONTENT.members[ - "documents" - ], - ) - ) - - case 1: - kwargs["feedback"] = de.read_string( - _SCHEMA_AUTOMATED_REASONING_POLICY_ITERATIVE_REFINEMENT_CONTENT.members[ - "feedback" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_ITERATIVE_REFINEMENT_CONTENT, - consumer=_consumer, - ) - if "documents" not in kwargs: - kwargs["documents"] = [] - return kwargs - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyBuildWorkflowRepairContent: - """ - Contains content and instructions for repairing or improving an existing - Automated Reasoning policy. - """ - - annotations: list[AutomatedReasoningPolicyAnnotation] - """ - Specific annotations or modifications to apply during the policy repair - process, such as rule corrections or variable updates. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_REPAIR_CONTENT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_automated_reasoning_policy_annotation_list( - serializer, - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_REPAIR_CONTENT.members[ - "annotations" - ], - self.annotations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["annotations"] = ( - _deserialize_automated_reasoning_policy_annotation_list( - de, - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_REPAIR_CONTENT.members[ - "annotations" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_REPAIR_CONTENT, - consumer=_consumer, - ) - if "annotations" not in kwargs: - kwargs["annotations"] = [] - return kwargs - - -@dataclass -class AutomatedReasoningPolicyWorkflowTypeContentDocuments: - """The list of documents to be processed in a document ingestion workflow.""" - - value: list[AutomatedReasoningPolicyBuildWorkflowDocument] - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_WORKFLOW_TYPE_CONTENT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_automated_reasoning_policy_build_workflow_document_list( - serializer, - _SCHEMA_AUTOMATED_REASONING_POLICY_WORKFLOW_TYPE_CONTENT.members[ - "documents" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_deserialize_automated_reasoning_policy_build_workflow_document_list( - deserializer, - _SCHEMA_AUTOMATED_REASONING_POLICY_WORKFLOW_TYPE_CONTENT.members[ - "documents" - ], - ) - ) - - -@dataclass -class AutomatedReasoningPolicyWorkflowTypeContentPolicyRepairAssets: - """ - The assets and instructions needed for a policy repair workflow, - including repair annotations and guidance. - """ - - value: AutomatedReasoningPolicyBuildWorkflowRepairContent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_WORKFLOW_TYPE_CONTENT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_WORKFLOW_TYPE_CONTENT.members[ - "policyRepairAssets" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=AutomatedReasoningPolicyBuildWorkflowRepairContent.deserialize( - deserializer - ) - ) - - -@dataclass -class AutomatedReasoningPolicyWorkflowTypeContentGenerateFidelityReportContent: - """ - The content configuration for generating a fidelity report workflow. - This can include source documents to analyze or an existing fidelity - report to update with a new policy definition. - """ - - value: AutomatedReasoningPolicyGenerateFidelityReportContent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_WORKFLOW_TYPE_CONTENT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_WORKFLOW_TYPE_CONTENT.members[ - "generateFidelityReportContent" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_AutomatedReasoningPolicyGenerateFidelityReportContentDeserializer().deserialize( - deserializer - ) - ) - - -@dataclass -class AutomatedReasoningPolicyWorkflowTypeContentIterativeRefinementContent: - """ - Content configuration to start an iterative policy refinement workflow - that uses generative AI to automatically make changes to the policy - based on test results and the optional feedback provided. - """ - - value: AutomatedReasoningPolicyIterativeRefinementContent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_WORKFLOW_TYPE_CONTENT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_WORKFLOW_TYPE_CONTENT.members[ - "iterativeRefinementContent" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=AutomatedReasoningPolicyIterativeRefinementContent.deserialize( - deserializer - ) - ) - - -@dataclass -class AutomatedReasoningPolicyWorkflowTypeContentUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -AutomatedReasoningPolicyWorkflowTypeContent = Union[ - AutomatedReasoningPolicyWorkflowTypeContentDocuments - | AutomatedReasoningPolicyWorkflowTypeContentPolicyRepairAssets - | AutomatedReasoningPolicyWorkflowTypeContentGenerateFidelityReportContent - | AutomatedReasoningPolicyWorkflowTypeContentIterativeRefinementContent - | AutomatedReasoningPolicyWorkflowTypeContentUnknown -] -""" -Defines the content and configuration for different types of policy -build workflows. -""" - - -class _AutomatedReasoningPolicyWorkflowTypeContentDeserializer: - _result: AutomatedReasoningPolicyWorkflowTypeContent | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> AutomatedReasoningPolicyWorkflowTypeContent: - self._result = None - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_WORKFLOW_TYPE_CONTENT, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - AutomatedReasoningPolicyWorkflowTypeContentDocuments.deserialize(de) - ) - - case 1: - self._set_result( - AutomatedReasoningPolicyWorkflowTypeContentPolicyRepairAssets.deserialize( - de - ) - ) - - case 2: - self._set_result( - AutomatedReasoningPolicyWorkflowTypeContentGenerateFidelityReportContent.deserialize( - de - ) - ) - - case 3: - self._set_result( - AutomatedReasoningPolicyWorkflowTypeContentIterativeRefinementContent.deserialize( - de - ) - ) - - case _: - self._set_result( - AutomatedReasoningPolicyWorkflowTypeContentUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: AutomatedReasoningPolicyWorkflowTypeContent) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class AutomatedReasoningPolicyBuildWorkflowSource: - """ - Defines the source content for a policy build workflow, which can - include documents, repair instructions, or other input materials. - """ - - policy_definition: AutomatedReasoningPolicyDefinition | None = None - """ - An existing policy definition that serves as the starting point for the - build workflow, typically used in policy repair or update scenarios. - """ - - workflow_content: AutomatedReasoningPolicyWorkflowTypeContent | None = None - """ - The actual content to be processed in the build workflow, such as - documents to analyze or repair instructions to apply. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_SOURCE, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.policy_definition is not None: - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_SOURCE.members[ - "policyDefinition" - ], - self.policy_definition, - ) - - if self.workflow_content is not None: - serializer.write_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_SOURCE.members[ - "workflowContent" - ], - self.workflow_content, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_definition"] = ( - AutomatedReasoningPolicyDefinition.deserialize(de) - ) - - case 1: - kwargs["workflow_content"] = ( - _AutomatedReasoningPolicyWorkflowTypeContentDeserializer().deserialize( - de - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_SOURCE, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class StartAutomatedReasoningPolicyBuildWorkflowInput: - """Dataclass for StartAutomatedReasoningPolicyBuildWorkflowInput structure.""" - - policy_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the Automated Reasoning policy for - which to start the build workflow. - """ - - build_workflow_type: str | None = None - """ - The type of build workflow to start (e.g., DOCUMENT_INGESTION for - processing new documents, POLICY_REPAIR for fixing existing policies). - """ - - client_request_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the operation - completes no more than once. If this token matches a previous request, - Amazon Bedrock ignores the request but doesn't return an error. - """ - - source_content: AutomatedReasoningPolicyBuildWorkflowSource | None = None - """ - The source content for the build workflow, such as documents to analyze - or repair instructions for existing policies. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_START_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.policy_arn is not None: - serializer.write_string( - _SCHEMA_START_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT.members[ - "policyArn" - ], - self.policy_arn, - ) - - if self.build_workflow_type is not None: - serializer.write_string( - _SCHEMA_START_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT.members[ - "buildWorkflowType" - ], - self.build_workflow_type, - ) - - if self.client_request_token is not None: - serializer.write_string( - _SCHEMA_START_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT.members[ - "clientRequestToken" - ], - self.client_request_token, - ) - - if self.source_content is not None: - serializer.write_struct( - _SCHEMA_START_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT.members[ - "sourceContent" - ], - self.source_content, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_arn"] = de.read_string( - _SCHEMA_START_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT.members[ - "policyArn" - ] - ) - - case 1: - kwargs["build_workflow_type"] = ( - AutomatedReasoningPolicyBuildWorkflowType( - de.read_string( - _SCHEMA_START_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT.members[ - "buildWorkflowType" - ] - ) - ) - ) - - case 2: - kwargs["client_request_token"] = de.read_string( - _SCHEMA_START_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT.members[ - "clientRequestToken" - ] - ) - - case 3: - kwargs["source_content"] = ( - AutomatedReasoningPolicyBuildWorkflowSource.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_START_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT, - consumer=_consumer, - ) - return kwargs - - -@dataclass(kw_only=True) -class StartAutomatedReasoningPolicyBuildWorkflowOutput: - """ - Dataclass for StartAutomatedReasoningPolicyBuildWorkflowOutput - structure. - """ - - policy_arn: str - """The Amazon Resource Name (ARN) of the Automated Reasoning policy.""" - - build_workflow_id: str - """ - The unique identifier of the newly started build workflow. Use this ID - to track the workflow's progress and retrieve its results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_START_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_START_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT.members[ - "policyArn" - ], - self.policy_arn, - ) - serializer.write_string( - _SCHEMA_START_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT.members[ - "buildWorkflowId" - ], - self.build_workflow_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_arn"] = de.read_string( - _SCHEMA_START_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT.members[ - "policyArn" - ] - ) - - case 1: - kwargs["build_workflow_id"] = de.read_string( - _SCHEMA_START_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT.members[ - "buildWorkflowId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_START_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT, - consumer=_consumer, - ) - if "policy_arn" not in kwargs: - kwargs["policy_arn"] = "" - if "build_workflow_id" not in kwargs: - kwargs["build_workflow_id"] = "" - return kwargs - - -START_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW = APIOperation( - input=StartAutomatedReasoningPolicyBuildWorkflowInput, - output=StartAutomatedReasoningPolicyBuildWorkflowOutput, - schema=_SCHEMA_START_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW, - input_schema=_SCHEMA_START_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_INPUT, - output_schema=_SCHEMA_START_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrock#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceInUseException" - ): ResourceInUseException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrock#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_IN_USE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -def _serialize_automated_reasoning_policy_test_case_id_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_automated_reasoning_policy_test_case_id_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class StartAutomatedReasoningPolicyTestWorkflowInput: - """Dataclass for StartAutomatedReasoningPolicyTestWorkflowInput structure.""" - - policy_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the Automated Reasoning policy to - test. - """ - - build_workflow_id: str | None = None - """ - The build workflow identifier. The build workflow must show a - `COMPLETED` status before running tests. - """ - - test_case_ids: list[str] | None = None - """ - The list of test identifiers to run. If not provided, all tests for the - policy are run. - """ - - client_request_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the operation - completes no more than one time. If this token matches a previous - request, Amazon Bedrock ignores the request but doesn't return an - error. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_START_AUTOMATED_REASONING_POLICY_TEST_WORKFLOW_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.policy_arn is not None: - serializer.write_string( - _SCHEMA_START_AUTOMATED_REASONING_POLICY_TEST_WORKFLOW_INPUT.members[ - "policyArn" - ], - self.policy_arn, - ) - - if self.build_workflow_id is not None: - serializer.write_string( - _SCHEMA_START_AUTOMATED_REASONING_POLICY_TEST_WORKFLOW_INPUT.members[ - "buildWorkflowId" - ], - self.build_workflow_id, - ) - - if self.test_case_ids is not None: - _serialize_automated_reasoning_policy_test_case_id_list( - serializer, - _SCHEMA_START_AUTOMATED_REASONING_POLICY_TEST_WORKFLOW_INPUT.members[ - "testCaseIds" - ], - self.test_case_ids, - ) - - if self.client_request_token is not None: - serializer.write_string( - _SCHEMA_START_AUTOMATED_REASONING_POLICY_TEST_WORKFLOW_INPUT.members[ - "clientRequestToken" - ], - self.client_request_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_arn"] = de.read_string( - _SCHEMA_START_AUTOMATED_REASONING_POLICY_TEST_WORKFLOW_INPUT.members[ - "policyArn" - ] - ) - - case 1: - kwargs["build_workflow_id"] = de.read_string( - _SCHEMA_START_AUTOMATED_REASONING_POLICY_TEST_WORKFLOW_INPUT.members[ - "buildWorkflowId" - ] - ) - - case 2: - kwargs["test_case_ids"] = ( - _deserialize_automated_reasoning_policy_test_case_id_list( - de, - _SCHEMA_START_AUTOMATED_REASONING_POLICY_TEST_WORKFLOW_INPUT.members[ - "testCaseIds" - ], - ) - ) - - case 3: - kwargs["client_request_token"] = de.read_string( - _SCHEMA_START_AUTOMATED_REASONING_POLICY_TEST_WORKFLOW_INPUT.members[ - "clientRequestToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_START_AUTOMATED_REASONING_POLICY_TEST_WORKFLOW_INPUT, - consumer=_consumer, - ) - return kwargs - - -@dataclass(kw_only=True) -class StartAutomatedReasoningPolicyTestWorkflowOutput: - """Dataclass for StartAutomatedReasoningPolicyTestWorkflowOutput structure.""" - - policy_arn: str - """ - The Amazon Resource Name (ARN) of the policy for which the test workflow - was started. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_START_AUTOMATED_REASONING_POLICY_TEST_WORKFLOW_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_START_AUTOMATED_REASONING_POLICY_TEST_WORKFLOW_OUTPUT.members[ - "policyArn" - ], - self.policy_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_arn"] = de.read_string( - _SCHEMA_START_AUTOMATED_REASONING_POLICY_TEST_WORKFLOW_OUTPUT.members[ - "policyArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_START_AUTOMATED_REASONING_POLICY_TEST_WORKFLOW_OUTPUT, - consumer=_consumer, - ) - if "policy_arn" not in kwargs: - kwargs["policy_arn"] = "" - return kwargs - - -START_AUTOMATED_REASONING_POLICY_TEST_WORKFLOW = APIOperation( - input=StartAutomatedReasoningPolicyTestWorkflowInput, - output=StartAutomatedReasoningPolicyTestWorkflowOutput, - schema=_SCHEMA_START_AUTOMATED_REASONING_POLICY_TEST_WORKFLOW, - input_schema=_SCHEMA_START_AUTOMATED_REASONING_POLICY_TEST_WORKFLOW_INPUT, - output_schema=_SCHEMA_START_AUTOMATED_REASONING_POLICY_TEST_WORKFLOW_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceInUseException" - ): ResourceInUseException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_IN_USE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateAutomatedReasoningPolicyInput: - """Dataclass for UpdateAutomatedReasoningPolicyInput structure.""" - - policy_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the Automated Reasoning policy to - update. This must be the ARN of a draft policy. - """ - - policy_definition: AutomatedReasoningPolicyDefinition | None = None - """ - The updated policy definition containing the formal logic rules, - variables, and types. - """ - - name: str | None = field(repr=False, default=None) - """The updated name for the Automated Reasoning policy.""" - - description: str | None = field(repr=False, default=None) - """The updated description for the Automated Reasoning policy.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.policy_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_INPUT.members["policyArn"], - self.policy_arn, - ) - - if self.policy_definition is not None: - serializer.write_struct( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_INPUT.members[ - "policyDefinition" - ], - self.policy_definition, - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_INPUT.members["name"], - self.name, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_INPUT.members["description"], - self.description, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_arn"] = de.read_string( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_INPUT.members[ - "policyArn" - ] - ) - - case 1: - kwargs["policy_definition"] = ( - AutomatedReasoningPolicyDefinition.deserialize(de) - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_INPUT.members["name"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_INPUT.members[ - "description" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateAutomatedReasoningPolicyOutput: - """Dataclass for UpdateAutomatedReasoningPolicyOutput structure.""" - - policy_arn: str - """The Amazon Resource Name (ARN) of the updated policy.""" - - name: str = field(repr=False) - """The updated name of the policy.""" - - definition_hash: str - """The hash of the updated policy definition.""" - - updated_at: datetime - """The timestamp when the policy was last updated.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_OUTPUT.members["policyArn"], - self.policy_arn, - ) - serializer.write_string( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_OUTPUT.members["name"], self.name - ) - serializer.write_string( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_OUTPUT.members["definitionHash"], - self.definition_hash, - ) - serializer.write_timestamp( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_OUTPUT.members["updatedAt"], - self.updated_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_arn"] = de.read_string( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_OUTPUT.members[ - "policyArn" - ] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_OUTPUT.members["name"] - ) - - case 2: - kwargs["definition_hash"] = de.read_string( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_OUTPUT.members[ - "definitionHash" - ] - ) - - case 3: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_OUTPUT.members[ - "updatedAt" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_OUTPUT, consumer=_consumer - ) - if "policy_arn" not in kwargs: - kwargs["policy_arn"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "definition_hash" not in kwargs: - kwargs["definition_hash"] = "" - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -UPDATE_AUTOMATED_REASONING_POLICY = APIOperation( - input=UpdateAutomatedReasoningPolicyInput, - output=UpdateAutomatedReasoningPolicyOutput, - schema=_SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY, - input_schema=_SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_INPUT, - output_schema=_SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrock#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#TooManyTagsException"): TooManyTagsException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_TOO_MANY_TAGS_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateAutomatedReasoningPolicyAnnotationsInput: - """Dataclass for UpdateAutomatedReasoningPolicyAnnotationsInput structure.""" - - policy_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the Automated Reasoning policy whose - annotations you want to update. - """ - - build_workflow_id: str | None = None - """ - The unique identifier of the build workflow whose annotations you want - to update. - """ - - annotations: list[AutomatedReasoningPolicyAnnotation] | None = None - """ - The updated annotations containing modified rules, variables, and types - for the policy. - """ - - last_updated_annotation_set_hash: str | None = None - """ - The hash value of the annotation set that you're updating. This is used - for optimistic concurrency control to prevent conflicting updates. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_ANNOTATIONS_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.policy_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_ANNOTATIONS_INPUT.members[ - "policyArn" - ], - self.policy_arn, - ) - - if self.build_workflow_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_ANNOTATIONS_INPUT.members[ - "buildWorkflowId" - ], - self.build_workflow_id, - ) - - if self.annotations is not None: - _serialize_automated_reasoning_policy_annotation_list( - serializer, - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_ANNOTATIONS_INPUT.members[ - "annotations" - ], - self.annotations, - ) - - if self.last_updated_annotation_set_hash is not None: - serializer.write_string( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_ANNOTATIONS_INPUT.members[ - "lastUpdatedAnnotationSetHash" - ], - self.last_updated_annotation_set_hash, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_arn"] = de.read_string( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_ANNOTATIONS_INPUT.members[ - "policyArn" - ] - ) - - case 1: - kwargs["build_workflow_id"] = de.read_string( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_ANNOTATIONS_INPUT.members[ - "buildWorkflowId" - ] - ) - - case 2: - kwargs["annotations"] = ( - _deserialize_automated_reasoning_policy_annotation_list( - de, - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_ANNOTATIONS_INPUT.members[ - "annotations" - ], - ) - ) - - case 3: - kwargs["last_updated_annotation_set_hash"] = de.read_string( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_ANNOTATIONS_INPUT.members[ - "lastUpdatedAnnotationSetHash" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_ANNOTATIONS_INPUT, - consumer=_consumer, - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateAutomatedReasoningPolicyAnnotationsOutput: - """Dataclass for UpdateAutomatedReasoningPolicyAnnotationsOutput structure.""" - - policy_arn: str - """The Amazon Resource Name (ARN) of the Automated Reasoning policy.""" - - build_workflow_id: str - """The unique identifier of the build workflow.""" - - annotation_set_hash: str - """The new hash value representing the updated state of the annotations.""" - - updated_at: datetime - """The timestamp when the annotations were updated.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_ANNOTATIONS_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_ANNOTATIONS_OUTPUT.members[ - "policyArn" - ], - self.policy_arn, - ) - serializer.write_string( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_ANNOTATIONS_OUTPUT.members[ - "buildWorkflowId" - ], - self.build_workflow_id, - ) - serializer.write_string( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_ANNOTATIONS_OUTPUT.members[ - "annotationSetHash" - ], - self.annotation_set_hash, - ) - serializer.write_timestamp( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_ANNOTATIONS_OUTPUT.members[ - "updatedAt" - ], - self.updated_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_arn"] = de.read_string( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_ANNOTATIONS_OUTPUT.members[ - "policyArn" - ] - ) - - case 1: - kwargs["build_workflow_id"] = de.read_string( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_ANNOTATIONS_OUTPUT.members[ - "buildWorkflowId" - ] - ) - - case 2: - kwargs["annotation_set_hash"] = de.read_string( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_ANNOTATIONS_OUTPUT.members[ - "annotationSetHash" - ] - ) - - case 3: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_ANNOTATIONS_OUTPUT.members[ - "updatedAt" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_ANNOTATIONS_OUTPUT, - consumer=_consumer, - ) - if "policy_arn" not in kwargs: - kwargs["policy_arn"] = "" - if "build_workflow_id" not in kwargs: - kwargs["build_workflow_id"] = "" - if "annotation_set_hash" not in kwargs: - kwargs["annotation_set_hash"] = "" - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -UPDATE_AUTOMATED_REASONING_POLICY_ANNOTATIONS = APIOperation( - input=UpdateAutomatedReasoningPolicyAnnotationsInput, - output=UpdateAutomatedReasoningPolicyAnnotationsOutput, - schema=_SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_ANNOTATIONS, - input_schema=_SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_ANNOTATIONS_INPUT, - output_schema=_SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_ANNOTATIONS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrock#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateAutomatedReasoningPolicyTestCaseInput: - """Dataclass for UpdateAutomatedReasoningPolicyTestCaseInput structure.""" - - policy_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the Automated Reasoning policy that - contains the test. - """ - - test_case_id: str | None = None - """The unique identifier of the test to update.""" - - guard_content: str | None = field(repr=False, default=None) - """The updated content to be validated by the Automated Reasoning policy.""" - - query_content: str | None = field(repr=False, default=None) - """The updated input query or prompt that generated the content.""" - - last_updated_at: datetime | None = None - """ - The timestamp when the test was last updated. This is used as a - concurrency token to prevent conflicting modifications. - """ - - expected_aggregated_findings_result: str | None = None - """The updated expected result of the Automated Reasoning check.""" - - confidence_threshold: float | None = None - """ - The updated minimum confidence level for logic validation. If null is - provided, the threshold will be removed. - """ - - client_request_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the operation - completes no more than one time. If this token matches a previous - request, Amazon Bedrock ignores the request, but does not return an - error. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.policy_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT.members[ - "policyArn" - ], - self.policy_arn, - ) - - if self.test_case_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT.members[ - "testCaseId" - ], - self.test_case_id, - ) - - if self.guard_content is not None: - serializer.write_string( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT.members[ - "guardContent" - ], - self.guard_content, - ) - - if self.query_content is not None: - serializer.write_string( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT.members[ - "queryContent" - ], - self.query_content, - ) - - if self.last_updated_at is not None: - serializer.write_timestamp( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT.members[ - "lastUpdatedAt" - ], - self.last_updated_at, - ) - - if self.expected_aggregated_findings_result is not None: - serializer.write_string( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT.members[ - "expectedAggregatedFindingsResult" - ], - self.expected_aggregated_findings_result, - ) - - if self.confidence_threshold is not None: - serializer.write_double( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT.members[ - "confidenceThreshold" - ], - self.confidence_threshold, - ) - - if self.client_request_token is not None: - serializer.write_string( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT.members[ - "clientRequestToken" - ], - self.client_request_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_arn"] = de.read_string( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT.members[ - "policyArn" - ] - ) - - case 1: - kwargs["test_case_id"] = de.read_string( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT.members[ - "testCaseId" - ] - ) - - case 2: - kwargs["guard_content"] = de.read_string( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT.members[ - "guardContent" - ] - ) - - case 3: - kwargs["query_content"] = de.read_string( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT.members[ - "queryContent" - ] - ) - - case 4: - kwargs["last_updated_at"] = de.read_timestamp( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT.members[ - "lastUpdatedAt" - ] - ) - - case 5: - kwargs["expected_aggregated_findings_result"] = ( - AutomatedReasoningCheckResult( - de.read_string( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT.members[ - "expectedAggregatedFindingsResult" - ] - ) - ) - ) - - case 6: - kwargs["confidence_threshold"] = de.read_double( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT.members[ - "confidenceThreshold" - ] - ) - - case 7: - kwargs["client_request_token"] = de.read_string( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT.members[ - "clientRequestToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT, - consumer=_consumer, - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateAutomatedReasoningPolicyTestCaseOutput: - """Dataclass for UpdateAutomatedReasoningPolicyTestCaseOutput structure.""" - - policy_arn: str - """ - The Amazon Resource Name (ARN) of the policy that contains the updated - test. - """ - - test_case_id: str - """The unique identifier of the updated test.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_TEST_CASE_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_TEST_CASE_OUTPUT.members[ - "policyArn" - ], - self.policy_arn, - ) - serializer.write_string( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_TEST_CASE_OUTPUT.members[ - "testCaseId" - ], - self.test_case_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_arn"] = de.read_string( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_TEST_CASE_OUTPUT.members[ - "policyArn" - ] - ) - - case 1: - kwargs["test_case_id"] = de.read_string( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_TEST_CASE_OUTPUT.members[ - "testCaseId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_TEST_CASE_OUTPUT, - consumer=_consumer, - ) - if "policy_arn" not in kwargs: - kwargs["policy_arn"] = "" - if "test_case_id" not in kwargs: - kwargs["test_case_id"] = "" - return kwargs - - -UPDATE_AUTOMATED_REASONING_POLICY_TEST_CASE = APIOperation( - input=UpdateAutomatedReasoningPolicyTestCaseInput, - output=UpdateAutomatedReasoningPolicyTestCaseOutput, - schema=_SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_TEST_CASE, - input_schema=_SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_TEST_CASE_INPUT, - output_schema=_SCHEMA_UPDATE_AUTOMATED_REASONING_POLICY_TEST_CASE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrock#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceInUseException" - ): ResourceInUseException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_IN_USE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -def _serialize_security_group_ids( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_security_group_ids( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_subnet_ids( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_subnet_ids( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class VpcConfig: - """ - The configuration of a virtual private cloud (VPC). For more - information, see [Protect your data using Amazon Virtual Private Cloud - and Amazon Web Services - PrivateLink](https://docs.aws.amazon.com/bedrock/latest/userguide/usingVPC.html). - """ - - subnet_ids: list[str] - """An array of IDs for each subnet in the VPC to use.""" - - security_group_ids: list[str] - """An array of IDs for each security group in the VPC to use.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VPC_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_subnet_ids( - serializer, _SCHEMA_VPC_CONFIG.members["subnetIds"], self.subnet_ids - ) - _serialize_security_group_ids( - serializer, - _SCHEMA_VPC_CONFIG.members["securityGroupIds"], - self.security_group_ids, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["subnet_ids"] = _deserialize_subnet_ids( - de, _SCHEMA_VPC_CONFIG.members["subnetIds"] - ) - - case 1: - kwargs["security_group_ids"] = _deserialize_security_group_ids( - de, _SCHEMA_VPC_CONFIG.members["securityGroupIds"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VPC_CONFIG, consumer=_consumer) - if "subnet_ids" not in kwargs: - kwargs["subnet_ids"] = [] - if "security_group_ids" not in kwargs: - kwargs["security_group_ids"] = [] - return kwargs - - -@dataclass(kw_only=True) -class SageMakerEndpoint: - """Specifies the configuration for a Amazon SageMaker endpoint.""" - - initial_instance_count: int - """ - The number of Amazon EC2 compute instances to deploy for initial - endpoint creation. - """ - - instance_type: str - """The Amazon EC2 compute instance type to deploy for hosting the model.""" - - execution_role: str - """ - The ARN of the IAM role that Amazon SageMaker can assume to access model - artifacts and docker image for deployment on Amazon EC2 compute - instances or for batch transform jobs. - """ - - kms_encryption_key: str | None = None - """ - The Amazon Web Services KMS key that Amazon SageMaker uses to encrypt - data on the storage volume attached to the Amazon EC2 compute instance - that hosts the endpoint. - """ - - vpc: VpcConfig | None = None - """The VPC configuration for the endpoint.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SAGE_MAKER_ENDPOINT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer( - _SCHEMA_SAGE_MAKER_ENDPOINT.members["initialInstanceCount"], - self.initial_instance_count, - ) - serializer.write_string( - _SCHEMA_SAGE_MAKER_ENDPOINT.members["instanceType"], self.instance_type - ) - serializer.write_string( - _SCHEMA_SAGE_MAKER_ENDPOINT.members["executionRole"], self.execution_role - ) - if self.kms_encryption_key is not None: - serializer.write_string( - _SCHEMA_SAGE_MAKER_ENDPOINT.members["kmsEncryptionKey"], - self.kms_encryption_key, - ) - - if self.vpc is not None: - serializer.write_struct( - _SCHEMA_SAGE_MAKER_ENDPOINT.members["vpc"], self.vpc - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["initial_instance_count"] = de.read_integer( - _SCHEMA_SAGE_MAKER_ENDPOINT.members["initialInstanceCount"] - ) - - case 1: - kwargs["instance_type"] = de.read_string( - _SCHEMA_SAGE_MAKER_ENDPOINT.members["instanceType"] - ) - - case 2: - kwargs["execution_role"] = de.read_string( - _SCHEMA_SAGE_MAKER_ENDPOINT.members["executionRole"] - ) - - case 3: - kwargs["kms_encryption_key"] = de.read_string( - _SCHEMA_SAGE_MAKER_ENDPOINT.members["kmsEncryptionKey"] - ) - - case 4: - kwargs["vpc"] = VpcConfig.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SAGE_MAKER_ENDPOINT, consumer=_consumer) - if "initial_instance_count" not in kwargs: - kwargs["initial_instance_count"] = 0 - if "instance_type" not in kwargs: - kwargs["instance_type"] = "" - if "execution_role" not in kwargs: - kwargs["execution_role"] = "" - return kwargs - - -@dataclass -class EndpointConfigSageMaker: - """The configuration specific to Amazon SageMaker for the endpoint.""" - - value: SageMakerEndpoint - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ENDPOINT_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_ENDPOINT_CONFIG.members["sageMaker"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=SageMakerEndpoint.deserialize(deserializer)) - - -@dataclass -class EndpointConfigUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -EndpointConfig = Union[EndpointConfigSageMaker | EndpointConfigUnknown] -"""Specifies the configuration for the endpoint.""" - - -class _EndpointConfigDeserializer: - _result: EndpointConfig | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> EndpointConfig: - self._result = None - deserializer.read_struct(_SCHEMA_ENDPOINT_CONFIG, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(EndpointConfigSageMaker.deserialize(de)) - - case _: - self._set_result(EndpointConfigUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: EndpointConfig) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class CreateMarketplaceModelEndpointInput: - """Dataclass for CreateMarketplaceModelEndpointInput structure.""" - - model_source_identifier: str | None = None - """ - The ARN of the model from Amazon Bedrock Marketplace that you want to - deploy to the endpoint. - """ - - endpoint_config: EndpointConfig | None = None - """ - The configuration for the endpoint, including the number and type of - instances to use. - """ - - accept_eula: bool = False - """ - Indicates whether you accept the end-user license agreement (EULA) for - the model. Set to `true` to accept the EULA. - """ - - endpoint_name: str | None = None - """ - The name of the endpoint. This name must be unique within your Amazon - Web Services account and region. - """ - - client_request_token: str | None = None - """ - A unique, case-sensitive identifier that you provide to ensure the - idempotency of the request. This token is listed as not required because - Amazon Web Services SDKs automatically generate it for you and set this - parameter. If you're not using the Amazon Web Services SDK or the CLI, - you must provide this token or the action will fail. - """ - - tags: list[Tag] | None = None - """ - An array of key-value pairs to apply to the underlying Amazon SageMaker - endpoint. You can use these tags to organize and identify your Amazon - Web Services resources. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_MARKETPLACE_MODEL_ENDPOINT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.model_source_identifier is not None: - serializer.write_string( - _SCHEMA_CREATE_MARKETPLACE_MODEL_ENDPOINT_INPUT.members[ - "modelSourceIdentifier" - ], - self.model_source_identifier, - ) - - if self.endpoint_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_MARKETPLACE_MODEL_ENDPOINT_INPUT.members[ - "endpointConfig" - ], - self.endpoint_config, - ) - - if self.accept_eula is not None: - serializer.write_boolean( - _SCHEMA_CREATE_MARKETPLACE_MODEL_ENDPOINT_INPUT.members["acceptEula"], - self.accept_eula, - ) - - if self.endpoint_name is not None: - serializer.write_string( - _SCHEMA_CREATE_MARKETPLACE_MODEL_ENDPOINT_INPUT.members["endpointName"], - self.endpoint_name, - ) - - if self.client_request_token is not None: - serializer.write_string( - _SCHEMA_CREATE_MARKETPLACE_MODEL_ENDPOINT_INPUT.members[ - "clientRequestToken" - ], - self.client_request_token, - ) - - if self.tags is not None: - _serialize_tag_list( - serializer, - _SCHEMA_CREATE_MARKETPLACE_MODEL_ENDPOINT_INPUT.members["tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_source_identifier"] = de.read_string( - _SCHEMA_CREATE_MARKETPLACE_MODEL_ENDPOINT_INPUT.members[ - "modelSourceIdentifier" - ] - ) - - case 1: - kwargs["endpoint_config"] = ( - _EndpointConfigDeserializer().deserialize(de) - ) - - case 2: - kwargs["accept_eula"] = de.read_boolean( - _SCHEMA_CREATE_MARKETPLACE_MODEL_ENDPOINT_INPUT.members[ - "acceptEula" - ] - ) - - case 3: - kwargs["endpoint_name"] = de.read_string( - _SCHEMA_CREATE_MARKETPLACE_MODEL_ENDPOINT_INPUT.members[ - "endpointName" - ] - ) - - case 4: - kwargs["client_request_token"] = de.read_string( - _SCHEMA_CREATE_MARKETPLACE_MODEL_ENDPOINT_INPUT.members[ - "clientRequestToken" - ] - ) - - case 5: - kwargs["tags"] = _deserialize_tag_list( - de, - _SCHEMA_CREATE_MARKETPLACE_MODEL_ENDPOINT_INPUT.members["tags"], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_MARKETPLACE_MODEL_ENDPOINT_INPUT, consumer=_consumer - ) - return kwargs - - -class Status(UnknownEnumMixin, StrEnum): - REGISTERED = "REGISTERED" - INCOMPATIBLE_ENDPOINT = "INCOMPATIBLE_ENDPOINT" - - -@dataclass(kw_only=True) -class MarketplaceModelEndpoint: - """ - Contains details about an endpoint for a model from Amazon Bedrock - Marketplace. - """ - - endpoint_arn: str - """The Amazon Resource Name (ARN) of the endpoint.""" - - model_source_identifier: str - """ - The ARN of the model from Amazon Bedrock Marketplace that is deployed on - this endpoint. - """ - - created_at: datetime - """The timestamp when the endpoint was registered.""" - - updated_at: datetime - """The timestamp when the endpoint was last updated.""" - - endpoint_config: EndpointConfig - """ - The configuration of the endpoint, including the number and type of - instances used. - """ - - endpoint_status: str - """ - The current status of the endpoint (e.g., Creating, InService, Updating, - Failed). - """ - - status: str | None = None - """ - The overall status of the endpoint in Amazon Bedrock Marketplace (e.g., - ACTIVE, INACTIVE). - """ - - status_message: str | None = None - """Additional information about the overall status, if available.""" - - endpoint_status_message: str | None = None - """Additional information about the endpoint status, if available.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MARKETPLACE_MODEL_ENDPOINT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MARKETPLACE_MODEL_ENDPOINT.members["endpointArn"], self.endpoint_arn - ) - serializer.write_string( - _SCHEMA_MARKETPLACE_MODEL_ENDPOINT.members["modelSourceIdentifier"], - self.model_source_identifier, - ) - if self.status is not None: - serializer.write_string( - _SCHEMA_MARKETPLACE_MODEL_ENDPOINT.members["status"], self.status - ) - - if self.status_message is not None: - serializer.write_string( - _SCHEMA_MARKETPLACE_MODEL_ENDPOINT.members["statusMessage"], - self.status_message, - ) - - serializer.write_timestamp( - _SCHEMA_MARKETPLACE_MODEL_ENDPOINT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_MARKETPLACE_MODEL_ENDPOINT.members["updatedAt"], self.updated_at - ) - serializer.write_struct( - _SCHEMA_MARKETPLACE_MODEL_ENDPOINT.members["endpointConfig"], - self.endpoint_config, - ) - serializer.write_string( - _SCHEMA_MARKETPLACE_MODEL_ENDPOINT.members["endpointStatus"], - self.endpoint_status, - ) - if self.endpoint_status_message is not None: - serializer.write_string( - _SCHEMA_MARKETPLACE_MODEL_ENDPOINT.members["endpointStatusMessage"], - self.endpoint_status_message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["endpoint_arn"] = de.read_string( - _SCHEMA_MARKETPLACE_MODEL_ENDPOINT.members["endpointArn"] - ) - - case 1: - kwargs["model_source_identifier"] = de.read_string( - _SCHEMA_MARKETPLACE_MODEL_ENDPOINT.members[ - "modelSourceIdentifier" - ] - ) - - case 2: - kwargs["status"] = Status( - de.read_string( - _SCHEMA_MARKETPLACE_MODEL_ENDPOINT.members["status"] - ) - ) - - case 3: - kwargs["status_message"] = de.read_string( - _SCHEMA_MARKETPLACE_MODEL_ENDPOINT.members["statusMessage"] - ) - - case 4: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_MARKETPLACE_MODEL_ENDPOINT.members["createdAt"] - ) - - case 5: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_MARKETPLACE_MODEL_ENDPOINT.members["updatedAt"] - ) - - case 6: - kwargs["endpoint_config"] = ( - _EndpointConfigDeserializer().deserialize(de) - ) - - case 7: - kwargs["endpoint_status"] = de.read_string( - _SCHEMA_MARKETPLACE_MODEL_ENDPOINT.members["endpointStatus"] - ) - - case 8: - kwargs["endpoint_status_message"] = de.read_string( - _SCHEMA_MARKETPLACE_MODEL_ENDPOINT.members[ - "endpointStatusMessage" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MARKETPLACE_MODEL_ENDPOINT, consumer=_consumer) - if "endpoint_arn" not in kwargs: - kwargs["endpoint_arn"] = "" - if "model_source_identifier" not in kwargs: - kwargs["model_source_identifier"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "endpoint_config" not in kwargs: - kwargs["endpoint_config"] = EndpointConfigUnknown(tag="") - if "endpoint_status" not in kwargs: - kwargs["endpoint_status"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls( - endpoint_arn="", - model_source_identifier="", - created_at=datetime.fromtimestamp(0, tz=timezone.utc), - updated_at=datetime.fromtimestamp(0, tz=timezone.utc), - endpoint_config=EndpointConfigUnknown(tag=""), - endpoint_status="", - ) - - -@dataclass(kw_only=True) -class CreateMarketplaceModelEndpointOutput: - """Dataclass for CreateMarketplaceModelEndpointOutput structure.""" - - marketplace_model_endpoint: MarketplaceModelEndpoint - """Details about the created endpoint.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_MARKETPLACE_MODEL_ENDPOINT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CREATE_MARKETPLACE_MODEL_ENDPOINT_OUTPUT.members[ - "marketplaceModelEndpoint" - ], - self.marketplace_model_endpoint, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["marketplace_model_endpoint"] = ( - MarketplaceModelEndpoint.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_MARKETPLACE_MODEL_ENDPOINT_OUTPUT, consumer=_consumer - ) - if "marketplace_model_endpoint" not in kwargs: - kwargs["marketplace_model_endpoint"] = ( - MarketplaceModelEndpoint._smithy_default() - ) - return kwargs - - -CREATE_MARKETPLACE_MODEL_ENDPOINT = APIOperation( - input=CreateMarketplaceModelEndpointInput, - output=CreateMarketplaceModelEndpointOutput, - schema=_SCHEMA_CREATE_MARKETPLACE_MODEL_ENDPOINT, - input_schema=_SCHEMA_CREATE_MARKETPLACE_MODEL_ENDPOINT_INPUT, - output_schema=_SCHEMA_CREATE_MARKETPLACE_MODEL_ENDPOINT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrock#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrock#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteMarketplaceModelEndpointInput: - """Dataclass for DeleteMarketplaceModelEndpointInput structure.""" - - endpoint_arn: str | None = None - """The Amazon Resource Name (ARN) of the endpoint you want to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_MARKETPLACE_MODEL_ENDPOINT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.endpoint_arn is not None: - serializer.write_string( - _SCHEMA_DELETE_MARKETPLACE_MODEL_ENDPOINT_INPUT.members["endpointArn"], - self.endpoint_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["endpoint_arn"] = de.read_string( - _SCHEMA_DELETE_MARKETPLACE_MODEL_ENDPOINT_INPUT.members[ - "endpointArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_MARKETPLACE_MODEL_ENDPOINT_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteMarketplaceModelEndpointOutput: - """Dataclass for DeleteMarketplaceModelEndpointOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_MARKETPLACE_MODEL_ENDPOINT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_MARKETPLACE_MODEL_ENDPOINT_OUTPUT, consumer=_consumer - ) - return kwargs - - -DELETE_MARKETPLACE_MODEL_ENDPOINT = APIOperation( - input=DeleteMarketplaceModelEndpointInput, - output=DeleteMarketplaceModelEndpointOutput, - schema=_SCHEMA_DELETE_MARKETPLACE_MODEL_ENDPOINT, - input_schema=_SCHEMA_DELETE_MARKETPLACE_MODEL_ENDPOINT_INPUT, - output_schema=_SCHEMA_DELETE_MARKETPLACE_MODEL_ENDPOINT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeregisterMarketplaceModelEndpointInput: - """Dataclass for DeregisterMarketplaceModelEndpointInput structure.""" - - endpoint_arn: str | None = None - """The Amazon Resource Name (ARN) of the endpoint you want to deregister.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DEREGISTER_MARKETPLACE_MODEL_ENDPOINT_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.endpoint_arn is not None: - serializer.write_string( - _SCHEMA_DEREGISTER_MARKETPLACE_MODEL_ENDPOINT_INPUT.members[ - "endpointArn" - ], - self.endpoint_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["endpoint_arn"] = de.read_string( - _SCHEMA_DEREGISTER_MARKETPLACE_MODEL_ENDPOINT_INPUT.members[ - "endpointArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DEREGISTER_MARKETPLACE_MODEL_ENDPOINT_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeregisterMarketplaceModelEndpointOutput: - """Dataclass for DeregisterMarketplaceModelEndpointOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DEREGISTER_MARKETPLACE_MODEL_ENDPOINT_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DEREGISTER_MARKETPLACE_MODEL_ENDPOINT_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ServiceUnavailableException(ServiceError): - """Returned if the service cannot complete the request.""" - - fault: Literal["client", "server"] | None = "server" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SERVICE_UNAVAILABLE_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_SERVICE_UNAVAILABLE_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_SERVICE_UNAVAILABLE_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SERVICE_UNAVAILABLE_EXCEPTION, consumer=_consumer - ) - return kwargs - - -DEREGISTER_MARKETPLACE_MODEL_ENDPOINT = APIOperation( - input=DeregisterMarketplaceModelEndpointInput, - output=DeregisterMarketplaceModelEndpointOutput, - schema=_SCHEMA_DEREGISTER_MARKETPLACE_MODEL_ENDPOINT, - input_schema=_SCHEMA_DEREGISTER_MARKETPLACE_MODEL_ENDPOINT_INPUT, - output_schema=_SCHEMA_DEREGISTER_MARKETPLACE_MODEL_ENDPOINT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrock#ServiceUnavailableException" - ): ServiceUnavailableException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_UNAVAILABLE_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetMarketplaceModelEndpointInput: - """Dataclass for GetMarketplaceModelEndpointInput structure.""" - - endpoint_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the endpoint you want to get - information about. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_MARKETPLACE_MODEL_ENDPOINT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.endpoint_arn is not None: - serializer.write_string( - _SCHEMA_GET_MARKETPLACE_MODEL_ENDPOINT_INPUT.members["endpointArn"], - self.endpoint_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["endpoint_arn"] = de.read_string( - _SCHEMA_GET_MARKETPLACE_MODEL_ENDPOINT_INPUT.members[ - "endpointArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_MARKETPLACE_MODEL_ENDPOINT_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetMarketplaceModelEndpointOutput: - """Dataclass for GetMarketplaceModelEndpointOutput structure.""" - - marketplace_model_endpoint: MarketplaceModelEndpoint | None = None - """Details about the requested endpoint.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_MARKETPLACE_MODEL_ENDPOINT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.marketplace_model_endpoint is not None: - serializer.write_struct( - _SCHEMA_GET_MARKETPLACE_MODEL_ENDPOINT_OUTPUT.members[ - "marketplaceModelEndpoint" - ], - self.marketplace_model_endpoint, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["marketplace_model_endpoint"] = ( - MarketplaceModelEndpoint.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_MARKETPLACE_MODEL_ENDPOINT_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_MARKETPLACE_MODEL_ENDPOINT = APIOperation( - input=GetMarketplaceModelEndpointInput, - output=GetMarketplaceModelEndpointOutput, - schema=_SCHEMA_GET_MARKETPLACE_MODEL_ENDPOINT, - input_schema=_SCHEMA_GET_MARKETPLACE_MODEL_ENDPOINT_INPUT, - output_schema=_SCHEMA_GET_MARKETPLACE_MODEL_ENDPOINT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListMarketplaceModelEndpointsInput: - """Dataclass for ListMarketplaceModelEndpointsInput structure.""" - - max_results: int | None = None - """ - The maximum number of results to return in a single call. If more - results are available, the operation returns a `NextToken` value. - """ - - next_token: str | None = None - """ - The token for the next set of results. You receive this token from a - previous `ListMarketplaceModelEndpoints` call. - """ - - model_source_equals: str | None = None - """ - If specified, only endpoints for the given model source identifier are - returned. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_MARKETPLACE_MODEL_ENDPOINTS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_MARKETPLACE_MODEL_ENDPOINTS_INPUT.members["maxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_MARKETPLACE_MODEL_ENDPOINTS_INPUT.members["nextToken"], - self.next_token, - ) - - if self.model_source_equals is not None: - serializer.write_string( - _SCHEMA_LIST_MARKETPLACE_MODEL_ENDPOINTS_INPUT.members[ - "modelSourceEquals" - ], - self.model_source_equals, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_MARKETPLACE_MODEL_ENDPOINTS_INPUT.members[ - "maxResults" - ] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_MARKETPLACE_MODEL_ENDPOINTS_INPUT.members[ - "nextToken" - ] - ) - - case 2: - kwargs["model_source_equals"] = de.read_string( - _SCHEMA_LIST_MARKETPLACE_MODEL_ENDPOINTS_INPUT.members[ - "modelSourceEquals" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_MARKETPLACE_MODEL_ENDPOINTS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class MarketplaceModelEndpointSummary: - """ - Provides a summary of an endpoint for a model from Amazon Bedrock - Marketplace. - """ - - endpoint_arn: str - """The Amazon Resource Name (ARN) of the endpoint.""" - - model_source_identifier: str - """ - The ARN of the model from Amazon Bedrock Marketplace that is deployed on - this endpoint. - """ - - created_at: datetime - """The timestamp when the endpoint was created.""" - - updated_at: datetime - """The timestamp when the endpoint was last updated.""" - - status: str | None = None - """The overall status of the endpoint in Amazon Bedrock Marketplace.""" - - status_message: str | None = None - """Additional information about the overall status, if available.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MARKETPLACE_MODEL_ENDPOINT_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MARKETPLACE_MODEL_ENDPOINT_SUMMARY.members["endpointArn"], - self.endpoint_arn, - ) - serializer.write_string( - _SCHEMA_MARKETPLACE_MODEL_ENDPOINT_SUMMARY.members["modelSourceIdentifier"], - self.model_source_identifier, - ) - if self.status is not None: - serializer.write_string( - _SCHEMA_MARKETPLACE_MODEL_ENDPOINT_SUMMARY.members["status"], - self.status, - ) - - if self.status_message is not None: - serializer.write_string( - _SCHEMA_MARKETPLACE_MODEL_ENDPOINT_SUMMARY.members["statusMessage"], - self.status_message, - ) - - serializer.write_timestamp( - _SCHEMA_MARKETPLACE_MODEL_ENDPOINT_SUMMARY.members["createdAt"], - self.created_at, - ) - serializer.write_timestamp( - _SCHEMA_MARKETPLACE_MODEL_ENDPOINT_SUMMARY.members["updatedAt"], - self.updated_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["endpoint_arn"] = de.read_string( - _SCHEMA_MARKETPLACE_MODEL_ENDPOINT_SUMMARY.members[ - "endpointArn" - ] - ) - - case 1: - kwargs["model_source_identifier"] = de.read_string( - _SCHEMA_MARKETPLACE_MODEL_ENDPOINT_SUMMARY.members[ - "modelSourceIdentifier" - ] - ) - - case 2: - kwargs["status"] = Status( - de.read_string( - _SCHEMA_MARKETPLACE_MODEL_ENDPOINT_SUMMARY.members["status"] - ) - ) - - case 3: - kwargs["status_message"] = de.read_string( - _SCHEMA_MARKETPLACE_MODEL_ENDPOINT_SUMMARY.members[ - "statusMessage" - ] - ) - - case 4: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_MARKETPLACE_MODEL_ENDPOINT_SUMMARY.members["createdAt"] - ) - - case 5: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_MARKETPLACE_MODEL_ENDPOINT_SUMMARY.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MARKETPLACE_MODEL_ENDPOINT_SUMMARY, consumer=_consumer - ) - if "endpoint_arn" not in kwargs: - kwargs["endpoint_arn"] = "" - if "model_source_identifier" not in kwargs: - kwargs["model_source_identifier"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_marketplace_model_endpoint_summaries( - serializer: ShapeSerializer, - schema: Schema, - value: list[MarketplaceModelEndpointSummary], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_marketplace_model_endpoint_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[MarketplaceModelEndpointSummary]: - result: list[MarketplaceModelEndpointSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(MarketplaceModelEndpointSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListMarketplaceModelEndpointsOutput: - """Dataclass for ListMarketplaceModelEndpointsOutput structure.""" - - marketplace_model_endpoints: list[MarketplaceModelEndpointSummary] | None = None - """An array of endpoint summaries.""" - - next_token: str | None = None - """ - The token for the next set of results. Use this token to get the next - set of results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_MARKETPLACE_MODEL_ENDPOINTS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.marketplace_model_endpoints is not None: - _serialize_marketplace_model_endpoint_summaries( - serializer, - _SCHEMA_LIST_MARKETPLACE_MODEL_ENDPOINTS_OUTPUT.members[ - "marketplaceModelEndpoints" - ], - self.marketplace_model_endpoints, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_MARKETPLACE_MODEL_ENDPOINTS_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["marketplace_model_endpoints"] = ( - _deserialize_marketplace_model_endpoint_summaries( - de, - _SCHEMA_LIST_MARKETPLACE_MODEL_ENDPOINTS_OUTPUT.members[ - "marketplaceModelEndpoints" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_MARKETPLACE_MODEL_ENDPOINTS_OUTPUT.members[ - "nextToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_MARKETPLACE_MODEL_ENDPOINTS_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_MARKETPLACE_MODEL_ENDPOINTS = APIOperation( - input=ListMarketplaceModelEndpointsInput, - output=ListMarketplaceModelEndpointsOutput, - schema=_SCHEMA_LIST_MARKETPLACE_MODEL_ENDPOINTS, - input_schema=_SCHEMA_LIST_MARKETPLACE_MODEL_ENDPOINTS_INPUT, - output_schema=_SCHEMA_LIST_MARKETPLACE_MODEL_ENDPOINTS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class RegisterMarketplaceModelEndpointInput: - """Dataclass for RegisterMarketplaceModelEndpointInput structure.""" - - endpoint_identifier: str | None = None - """ - The ARN of the Amazon SageMaker endpoint you want to register with - Amazon Bedrock Marketplace. - """ - - model_source_identifier: str | None = None - """ - The ARN of the model from Amazon Bedrock Marketplace that is deployed on - the endpoint. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REGISTER_MARKETPLACE_MODEL_ENDPOINT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.endpoint_identifier is not None: - serializer.write_string( - _SCHEMA_REGISTER_MARKETPLACE_MODEL_ENDPOINT_INPUT.members[ - "endpointIdentifier" - ], - self.endpoint_identifier, - ) - - if self.model_source_identifier is not None: - serializer.write_string( - _SCHEMA_REGISTER_MARKETPLACE_MODEL_ENDPOINT_INPUT.members[ - "modelSourceIdentifier" - ], - self.model_source_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["endpoint_identifier"] = de.read_string( - _SCHEMA_REGISTER_MARKETPLACE_MODEL_ENDPOINT_INPUT.members[ - "endpointIdentifier" - ] - ) - - case 1: - kwargs["model_source_identifier"] = de.read_string( - _SCHEMA_REGISTER_MARKETPLACE_MODEL_ENDPOINT_INPUT.members[ - "modelSourceIdentifier" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_REGISTER_MARKETPLACE_MODEL_ENDPOINT_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class RegisterMarketplaceModelEndpointOutput: - """Dataclass for RegisterMarketplaceModelEndpointOutput structure.""" - - marketplace_model_endpoint: MarketplaceModelEndpoint - """Details about the registered endpoint.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_REGISTER_MARKETPLACE_MODEL_ENDPOINT_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_REGISTER_MARKETPLACE_MODEL_ENDPOINT_OUTPUT.members[ - "marketplaceModelEndpoint" - ], - self.marketplace_model_endpoint, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["marketplace_model_endpoint"] = ( - MarketplaceModelEndpoint.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_REGISTER_MARKETPLACE_MODEL_ENDPOINT_OUTPUT, consumer=_consumer - ) - if "marketplace_model_endpoint" not in kwargs: - kwargs["marketplace_model_endpoint"] = ( - MarketplaceModelEndpoint._smithy_default() - ) - return kwargs - - -REGISTER_MARKETPLACE_MODEL_ENDPOINT = APIOperation( - input=RegisterMarketplaceModelEndpointInput, - output=RegisterMarketplaceModelEndpointOutput, - schema=_SCHEMA_REGISTER_MARKETPLACE_MODEL_ENDPOINT, - input_schema=_SCHEMA_REGISTER_MARKETPLACE_MODEL_ENDPOINT_INPUT, - output_schema=_SCHEMA_REGISTER_MARKETPLACE_MODEL_ENDPOINT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrock#ServiceUnavailableException" - ): ServiceUnavailableException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_UNAVAILABLE_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateMarketplaceModelEndpointInput: - """Dataclass for UpdateMarketplaceModelEndpointInput structure.""" - - endpoint_arn: str | None = None - """The Amazon Resource Name (ARN) of the endpoint you want to update.""" - - endpoint_config: EndpointConfig | None = None - """ - The new configuration for the endpoint, including the number and type of - instances to use. - """ - - client_request_token: str | None = None - """ - A unique, case-sensitive identifier that you provide to ensure the - idempotency of the request. This token is listed as not required because - Amazon Web Services SDKs automatically generate it for you and set this - parameter. If you're not using the Amazon Web Services SDK or the CLI, - you must provide this token or the action will fail. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_MARKETPLACE_MODEL_ENDPOINT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.endpoint_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_MARKETPLACE_MODEL_ENDPOINT_INPUT.members["endpointArn"], - self.endpoint_arn, - ) - - if self.endpoint_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_MARKETPLACE_MODEL_ENDPOINT_INPUT.members[ - "endpointConfig" - ], - self.endpoint_config, - ) - - if self.client_request_token is not None: - serializer.write_string( - _SCHEMA_UPDATE_MARKETPLACE_MODEL_ENDPOINT_INPUT.members[ - "clientRequestToken" - ], - self.client_request_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["endpoint_arn"] = de.read_string( - _SCHEMA_UPDATE_MARKETPLACE_MODEL_ENDPOINT_INPUT.members[ - "endpointArn" - ] - ) - - case 1: - kwargs["endpoint_config"] = ( - _EndpointConfigDeserializer().deserialize(de) - ) - - case 2: - kwargs["client_request_token"] = de.read_string( - _SCHEMA_UPDATE_MARKETPLACE_MODEL_ENDPOINT_INPUT.members[ - "clientRequestToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_MARKETPLACE_MODEL_ENDPOINT_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateMarketplaceModelEndpointOutput: - """Dataclass for UpdateMarketplaceModelEndpointOutput structure.""" - - marketplace_model_endpoint: MarketplaceModelEndpoint - """Details about the updated endpoint.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_MARKETPLACE_MODEL_ENDPOINT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_UPDATE_MARKETPLACE_MODEL_ENDPOINT_OUTPUT.members[ - "marketplaceModelEndpoint" - ], - self.marketplace_model_endpoint, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["marketplace_model_endpoint"] = ( - MarketplaceModelEndpoint.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_MARKETPLACE_MODEL_ENDPOINT_OUTPUT, consumer=_consumer - ) - if "marketplace_model_endpoint" not in kwargs: - kwargs["marketplace_model_endpoint"] = ( - MarketplaceModelEndpoint._smithy_default() - ) - return kwargs - - -UPDATE_MARKETPLACE_MODEL_ENDPOINT = APIOperation( - input=UpdateMarketplaceModelEndpointInput, - output=UpdateMarketplaceModelEndpointOutput, - schema=_SCHEMA_UPDATE_MARKETPLACE_MODEL_ENDPOINT, - input_schema=_SCHEMA_UPDATE_MARKETPLACE_MODEL_ENDPOINT_INPUT, - output_schema=_SCHEMA_UPDATE_MARKETPLACE_MODEL_ENDPOINT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrock#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrock#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class CreateCustomModelDeploymentInput: - """Dataclass for CreateCustomModelDeploymentInput structure.""" - - model_deployment_name: str | None = None - """ - The name for the custom model deployment. The name must be unique within - your Amazon Web Services account and Region. - """ - - model_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the custom model to deploy for - on-demand inference. The custom model must be in the `Active` state. - """ - - description: str | None = None - """ - A description for the custom model deployment to help you identify its - purpose. - """ - - tags: list[Tag] | None = None - """ - Tags to assign to the custom model deployment. You can use tags to - organize and track your Amazon Web Services resources for cost - allocation and management purposes. - """ - - client_request_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the operation - completes no more than one time. If this token matches a previous - request, Amazon Bedrock ignores the request, but does not return an - error. For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-idempotency.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_CUSTOM_MODEL_DEPLOYMENT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.model_deployment_name is not None: - serializer.write_string( - _SCHEMA_CREATE_CUSTOM_MODEL_DEPLOYMENT_INPUT.members[ - "modelDeploymentName" - ], - self.model_deployment_name, - ) - - if self.model_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_CUSTOM_MODEL_DEPLOYMENT_INPUT.members["modelArn"], - self.model_arn, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_CUSTOM_MODEL_DEPLOYMENT_INPUT.members["description"], - self.description, - ) - - if self.tags is not None: - _serialize_tag_list( - serializer, - _SCHEMA_CREATE_CUSTOM_MODEL_DEPLOYMENT_INPUT.members["tags"], - self.tags, - ) - - if self.client_request_token is not None: - serializer.write_string( - _SCHEMA_CREATE_CUSTOM_MODEL_DEPLOYMENT_INPUT.members[ - "clientRequestToken" - ], - self.client_request_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_deployment_name"] = de.read_string( - _SCHEMA_CREATE_CUSTOM_MODEL_DEPLOYMENT_INPUT.members[ - "modelDeploymentName" - ] - ) - - case 1: - kwargs["model_arn"] = de.read_string( - _SCHEMA_CREATE_CUSTOM_MODEL_DEPLOYMENT_INPUT.members["modelArn"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_CUSTOM_MODEL_DEPLOYMENT_INPUT.members[ - "description" - ] - ) - - case 3: - kwargs["tags"] = _deserialize_tag_list( - de, _SCHEMA_CREATE_CUSTOM_MODEL_DEPLOYMENT_INPUT.members["tags"] - ) - - case 4: - kwargs["client_request_token"] = de.read_string( - _SCHEMA_CREATE_CUSTOM_MODEL_DEPLOYMENT_INPUT.members[ - "clientRequestToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_CUSTOM_MODEL_DEPLOYMENT_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CreateCustomModelDeploymentOutput: - """Dataclass for CreateCustomModelDeploymentOutput structure.""" - - custom_model_deployment_arn: str - """ - The Amazon Resource Name (ARN) of the custom model deployment. Use this - ARN as the `modelId` parameter when invoking the model with the - `InvokeModel` or `Converse` operations. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_CUSTOM_MODEL_DEPLOYMENT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_CUSTOM_MODEL_DEPLOYMENT_OUTPUT.members[ - "customModelDeploymentArn" - ], - self.custom_model_deployment_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["custom_model_deployment_arn"] = de.read_string( - _SCHEMA_CREATE_CUSTOM_MODEL_DEPLOYMENT_OUTPUT.members[ - "customModelDeploymentArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_CUSTOM_MODEL_DEPLOYMENT_OUTPUT, consumer=_consumer - ) - if "custom_model_deployment_arn" not in kwargs: - kwargs["custom_model_deployment_arn"] = "" - return kwargs - - -CREATE_CUSTOM_MODEL_DEPLOYMENT = APIOperation( - input=CreateCustomModelDeploymentInput, - output=CreateCustomModelDeploymentOutput, - schema=_SCHEMA_CREATE_CUSTOM_MODEL_DEPLOYMENT, - input_schema=_SCHEMA_CREATE_CUSTOM_MODEL_DEPLOYMENT_INPUT, - output_schema=_SCHEMA_CREATE_CUSTOM_MODEL_DEPLOYMENT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrock#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#TooManyTagsException"): TooManyTagsException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_TOO_MANY_TAGS_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteCustomModelDeploymentInput: - """Dataclass for DeleteCustomModelDeploymentInput structure.""" - - custom_model_deployment_identifier: str | None = None - """ - The Amazon Resource Name (ARN) or name of the custom model deployment to - delete. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_CUSTOM_MODEL_DEPLOYMENT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.custom_model_deployment_identifier is not None: - serializer.write_string( - _SCHEMA_DELETE_CUSTOM_MODEL_DEPLOYMENT_INPUT.members[ - "customModelDeploymentIdentifier" - ], - self.custom_model_deployment_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["custom_model_deployment_identifier"] = de.read_string( - _SCHEMA_DELETE_CUSTOM_MODEL_DEPLOYMENT_INPUT.members[ - "customModelDeploymentIdentifier" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_CUSTOM_MODEL_DEPLOYMENT_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteCustomModelDeploymentOutput: - """Dataclass for DeleteCustomModelDeploymentOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_CUSTOM_MODEL_DEPLOYMENT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_CUSTOM_MODEL_DEPLOYMENT_OUTPUT, consumer=_consumer - ) - return kwargs - - -DELETE_CUSTOM_MODEL_DEPLOYMENT = APIOperation( - input=DeleteCustomModelDeploymentInput, - output=DeleteCustomModelDeploymentOutput, - schema=_SCHEMA_DELETE_CUSTOM_MODEL_DEPLOYMENT, - input_schema=_SCHEMA_DELETE_CUSTOM_MODEL_DEPLOYMENT_INPUT, - output_schema=_SCHEMA_DELETE_CUSTOM_MODEL_DEPLOYMENT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrock#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetCustomModelDeploymentInput: - """Dataclass for GetCustomModelDeploymentInput structure.""" - - custom_model_deployment_identifier: str | None = None - """ - The Amazon Resource Name (ARN) or name of the custom model deployment to - retrieve information about. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_CUSTOM_MODEL_DEPLOYMENT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.custom_model_deployment_identifier is not None: - serializer.write_string( - _SCHEMA_GET_CUSTOM_MODEL_DEPLOYMENT_INPUT.members[ - "customModelDeploymentIdentifier" - ], - self.custom_model_deployment_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["custom_model_deployment_identifier"] = de.read_string( - _SCHEMA_GET_CUSTOM_MODEL_DEPLOYMENT_INPUT.members[ - "customModelDeploymentIdentifier" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_CUSTOM_MODEL_DEPLOYMENT_INPUT, consumer=_consumer - ) - return kwargs - - -class CustomModelDeploymentStatus(UnknownEnumMixin, StrEnum): - CREATING = "Creating" - ACTIVE = "Active" - FAILED = "Failed" - - -class CustomModelDeploymentUpdateStatus(UnknownEnumMixin, StrEnum): - UPDATING = "Updating" - UPDATE_COMPLETED = "UpdateCompleted" - UPDATE_FAILED = "UpdateFailed" - - -@dataclass(kw_only=True) -class CustomModelDeploymentUpdateDetails: - """ - Details about an update to a custom model deployment, including the new - custom model resource ARN and current update status. - """ - - model_arn: str - """ARN of the new custom model being deployed as part of the update.""" - - update_status: str - """Current status of the deployment update.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOM_MODEL_DEPLOYMENT_UPDATE_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CUSTOM_MODEL_DEPLOYMENT_UPDATE_DETAILS.members["modelArn"], - self.model_arn, - ) - serializer.write_string( - _SCHEMA_CUSTOM_MODEL_DEPLOYMENT_UPDATE_DETAILS.members["updateStatus"], - self.update_status, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_arn"] = de.read_string( - _SCHEMA_CUSTOM_MODEL_DEPLOYMENT_UPDATE_DETAILS.members[ - "modelArn" - ] - ) - - case 1: - kwargs["update_status"] = CustomModelDeploymentUpdateStatus( - de.read_string( - _SCHEMA_CUSTOM_MODEL_DEPLOYMENT_UPDATE_DETAILS.members[ - "updateStatus" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CUSTOM_MODEL_DEPLOYMENT_UPDATE_DETAILS, consumer=_consumer - ) - if "model_arn" not in kwargs: - kwargs["model_arn"] = "" - if "update_status" not in kwargs: - kwargs["update_status"] = CustomModelDeploymentUpdateStatus._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class GetCustomModelDeploymentOutput: - """Dataclass for GetCustomModelDeploymentOutput structure.""" - - custom_model_deployment_arn: str - """The Amazon Resource Name (ARN) of the custom model deployment.""" - - model_deployment_name: str - """The name of the custom model deployment.""" - - model_arn: str - """ - The Amazon Resource Name (ARN) of the custom model associated with this - deployment. - """ - - created_at: datetime - """The date and time when the custom model deployment was created.""" - - status: str - """ - The status of the custom model deployment. Possible values are: - - - `CREATING` - The deployment is being set up and prepared for - inference. - - - `ACTIVE` - The deployment is ready and available for inference - requests. - - - `FAILED` - The deployment failed to be created or became unavailable. - """ - - description: str | None = None - """The description of the custom model deployment.""" - - update_details: CustomModelDeploymentUpdateDetails | None = None - """ - Details about any pending or completed updates to the custom model - deployment, including the new model ARN and update status. - """ - - failure_message: str | None = None - """ - If the deployment status is `FAILED`, this field contains a message - describing the failure reason. - """ - - last_updated_at: datetime | None = None - """The date and time when the custom model deployment was last updated.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_CUSTOM_MODEL_DEPLOYMENT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_CUSTOM_MODEL_DEPLOYMENT_OUTPUT.members[ - "customModelDeploymentArn" - ], - self.custom_model_deployment_arn, - ) - serializer.write_string( - _SCHEMA_GET_CUSTOM_MODEL_DEPLOYMENT_OUTPUT.members["modelDeploymentName"], - self.model_deployment_name, - ) - serializer.write_string( - _SCHEMA_GET_CUSTOM_MODEL_DEPLOYMENT_OUTPUT.members["modelArn"], - self.model_arn, - ) - serializer.write_timestamp( - _SCHEMA_GET_CUSTOM_MODEL_DEPLOYMENT_OUTPUT.members["createdAt"], - self.created_at, - ) - serializer.write_string( - _SCHEMA_GET_CUSTOM_MODEL_DEPLOYMENT_OUTPUT.members["status"], self.status - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_CUSTOM_MODEL_DEPLOYMENT_OUTPUT.members["description"], - self.description, - ) - - if self.update_details is not None: - serializer.write_struct( - _SCHEMA_GET_CUSTOM_MODEL_DEPLOYMENT_OUTPUT.members["updateDetails"], - self.update_details, - ) - - if self.failure_message is not None: - serializer.write_string( - _SCHEMA_GET_CUSTOM_MODEL_DEPLOYMENT_OUTPUT.members["failureMessage"], - self.failure_message, - ) - - if self.last_updated_at is not None: - serializer.write_timestamp( - _SCHEMA_GET_CUSTOM_MODEL_DEPLOYMENT_OUTPUT.members["lastUpdatedAt"], - self.last_updated_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["custom_model_deployment_arn"] = de.read_string( - _SCHEMA_GET_CUSTOM_MODEL_DEPLOYMENT_OUTPUT.members[ - "customModelDeploymentArn" - ] - ) - - case 1: - kwargs["model_deployment_name"] = de.read_string( - _SCHEMA_GET_CUSTOM_MODEL_DEPLOYMENT_OUTPUT.members[ - "modelDeploymentName" - ] - ) - - case 2: - kwargs["model_arn"] = de.read_string( - _SCHEMA_GET_CUSTOM_MODEL_DEPLOYMENT_OUTPUT.members["modelArn"] - ) - - case 3: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_CUSTOM_MODEL_DEPLOYMENT_OUTPUT.members["createdAt"] - ) - - case 4: - kwargs["status"] = CustomModelDeploymentStatus( - de.read_string( - _SCHEMA_GET_CUSTOM_MODEL_DEPLOYMENT_OUTPUT.members["status"] - ) - ) - - case 5: - kwargs["description"] = de.read_string( - _SCHEMA_GET_CUSTOM_MODEL_DEPLOYMENT_OUTPUT.members[ - "description" - ] - ) - - case 6: - kwargs["update_details"] = ( - CustomModelDeploymentUpdateDetails.deserialize(de) - ) - - case 7: - kwargs["failure_message"] = de.read_string( - _SCHEMA_GET_CUSTOM_MODEL_DEPLOYMENT_OUTPUT.members[ - "failureMessage" - ] - ) - - case 8: - kwargs["last_updated_at"] = de.read_timestamp( - _SCHEMA_GET_CUSTOM_MODEL_DEPLOYMENT_OUTPUT.members[ - "lastUpdatedAt" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_CUSTOM_MODEL_DEPLOYMENT_OUTPUT, consumer=_consumer - ) - if "custom_model_deployment_arn" not in kwargs: - kwargs["custom_model_deployment_arn"] = "" - if "model_deployment_name" not in kwargs: - kwargs["model_deployment_name"] = "" - if "model_arn" not in kwargs: - kwargs["model_arn"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "status" not in kwargs: - kwargs["status"] = CustomModelDeploymentStatus._corrected("") - return kwargs - - -GET_CUSTOM_MODEL_DEPLOYMENT = APIOperation( - input=GetCustomModelDeploymentInput, - output=GetCustomModelDeploymentOutput, - schema=_SCHEMA_GET_CUSTOM_MODEL_DEPLOYMENT, - input_schema=_SCHEMA_GET_CUSTOM_MODEL_DEPLOYMENT_INPUT, - output_schema=_SCHEMA_GET_CUSTOM_MODEL_DEPLOYMENT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class SortModelsBy(UnknownEnumMixin, StrEnum): - CREATION_TIME = "CreationTime" - - -@dataclass(kw_only=True) -class ListCustomModelDeploymentsInput: - """Dataclass for ListCustomModelDeploymentsInput structure.""" - - created_before: datetime | None = None - """Filters deployments created before the specified date and time.""" - - created_after: datetime | None = None - """Filters deployments created after the specified date and time.""" - - name_contains: str | None = None - """Filters deployments whose names contain the specified string.""" - - max_results: int | None = None - """The maximum number of results to return in a single call.""" - - next_token: str | None = None - """ - The token for the next set of results. Use this token to retrieve - additional results when the response is truncated. - """ - - sort_by: str | None = None - """ - The field to sort the results by. The only supported value is - `CreationTime`. - """ - - sort_order: str | None = None - """ - The sort order for the results. Valid values are `Ascending` and - `Descending`. Default is `Descending`. - """ - - status_equals: str | None = None - """ - Filters deployments by status. Valid values are `CREATING`, `ACTIVE`, - and `FAILED`. - """ - - model_arn_equals: str | None = None - """ - Filters deployments by the Amazon Resource Name (ARN) of the associated - custom model. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_CUSTOM_MODEL_DEPLOYMENTS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.created_before is not None: - serializer.write_timestamp( - _SCHEMA_LIST_CUSTOM_MODEL_DEPLOYMENTS_INPUT.members["createdBefore"], - self.created_before, - ) - - if self.created_after is not None: - serializer.write_timestamp( - _SCHEMA_LIST_CUSTOM_MODEL_DEPLOYMENTS_INPUT.members["createdAfter"], - self.created_after, - ) - - if self.name_contains is not None: - serializer.write_string( - _SCHEMA_LIST_CUSTOM_MODEL_DEPLOYMENTS_INPUT.members["nameContains"], - self.name_contains, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_CUSTOM_MODEL_DEPLOYMENTS_INPUT.members["maxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_CUSTOM_MODEL_DEPLOYMENTS_INPUT.members["nextToken"], - self.next_token, - ) - - if self.sort_by is not None: - serializer.write_string( - _SCHEMA_LIST_CUSTOM_MODEL_DEPLOYMENTS_INPUT.members["sortBy"], - self.sort_by, - ) - - if self.sort_order is not None: - serializer.write_string( - _SCHEMA_LIST_CUSTOM_MODEL_DEPLOYMENTS_INPUT.members["sortOrder"], - self.sort_order, - ) - - if self.status_equals is not None: - serializer.write_string( - _SCHEMA_LIST_CUSTOM_MODEL_DEPLOYMENTS_INPUT.members["statusEquals"], - self.status_equals, - ) - - if self.model_arn_equals is not None: - serializer.write_string( - _SCHEMA_LIST_CUSTOM_MODEL_DEPLOYMENTS_INPUT.members["modelArnEquals"], - self.model_arn_equals, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["created_before"] = de.read_timestamp( - _SCHEMA_LIST_CUSTOM_MODEL_DEPLOYMENTS_INPUT.members[ - "createdBefore" - ] - ) - - case 1: - kwargs["created_after"] = de.read_timestamp( - _SCHEMA_LIST_CUSTOM_MODEL_DEPLOYMENTS_INPUT.members[ - "createdAfter" - ] - ) - - case 2: - kwargs["name_contains"] = de.read_string( - _SCHEMA_LIST_CUSTOM_MODEL_DEPLOYMENTS_INPUT.members[ - "nameContains" - ] - ) - - case 3: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_CUSTOM_MODEL_DEPLOYMENTS_INPUT.members[ - "maxResults" - ] - ) - - case 4: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_CUSTOM_MODEL_DEPLOYMENTS_INPUT.members["nextToken"] - ) - - case 5: - kwargs["sort_by"] = SortModelsBy( - de.read_string( - _SCHEMA_LIST_CUSTOM_MODEL_DEPLOYMENTS_INPUT.members[ - "sortBy" - ] - ) - ) - - case 6: - kwargs["sort_order"] = SortOrder( - de.read_string( - _SCHEMA_LIST_CUSTOM_MODEL_DEPLOYMENTS_INPUT.members[ - "sortOrder" - ] - ) - ) - - case 7: - kwargs["status_equals"] = CustomModelDeploymentStatus( - de.read_string( - _SCHEMA_LIST_CUSTOM_MODEL_DEPLOYMENTS_INPUT.members[ - "statusEquals" - ] - ) - ) - - case 8: - kwargs["model_arn_equals"] = de.read_string( - _SCHEMA_LIST_CUSTOM_MODEL_DEPLOYMENTS_INPUT.members[ - "modelArnEquals" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_CUSTOM_MODEL_DEPLOYMENTS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CustomModelDeploymentSummary: - """ - Contains summary information about a custom model deployment, including - its ARN, name, status, and associated custom model. - """ - - custom_model_deployment_arn: str - """The Amazon Resource Name (ARN) of the custom model deployment.""" - - custom_model_deployment_name: str - """The name of the custom model deployment.""" - - model_arn: str - """ - The Amazon Resource Name (ARN) of the custom model associated with this - deployment. - """ - - created_at: datetime - """The date and time when the custom model deployment was created.""" - - status: str - """ - The status of the custom model deployment. Possible values are - `CREATING`, `ACTIVE`, and `FAILED`. - """ - - last_updated_at: datetime | None = None - """The date and time when the custom model deployment was last modified.""" - - failure_message: str | None = None - """ - If the deployment status is `FAILED`, this field contains a message - describing the failure reason. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOM_MODEL_DEPLOYMENT_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CUSTOM_MODEL_DEPLOYMENT_SUMMARY.members["customModelDeploymentArn"], - self.custom_model_deployment_arn, - ) - serializer.write_string( - _SCHEMA_CUSTOM_MODEL_DEPLOYMENT_SUMMARY.members[ - "customModelDeploymentName" - ], - self.custom_model_deployment_name, - ) - serializer.write_string( - _SCHEMA_CUSTOM_MODEL_DEPLOYMENT_SUMMARY.members["modelArn"], self.model_arn - ) - serializer.write_timestamp( - _SCHEMA_CUSTOM_MODEL_DEPLOYMENT_SUMMARY.members["createdAt"], - self.created_at, - ) - serializer.write_string( - _SCHEMA_CUSTOM_MODEL_DEPLOYMENT_SUMMARY.members["status"], self.status - ) - if self.last_updated_at is not None: - serializer.write_timestamp( - _SCHEMA_CUSTOM_MODEL_DEPLOYMENT_SUMMARY.members["lastUpdatedAt"], - self.last_updated_at, - ) - - if self.failure_message is not None: - serializer.write_string( - _SCHEMA_CUSTOM_MODEL_DEPLOYMENT_SUMMARY.members["failureMessage"], - self.failure_message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["custom_model_deployment_arn"] = de.read_string( - _SCHEMA_CUSTOM_MODEL_DEPLOYMENT_SUMMARY.members[ - "customModelDeploymentArn" - ] - ) - - case 1: - kwargs["custom_model_deployment_name"] = de.read_string( - _SCHEMA_CUSTOM_MODEL_DEPLOYMENT_SUMMARY.members[ - "customModelDeploymentName" - ] - ) - - case 2: - kwargs["model_arn"] = de.read_string( - _SCHEMA_CUSTOM_MODEL_DEPLOYMENT_SUMMARY.members["modelArn"] - ) - - case 3: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_CUSTOM_MODEL_DEPLOYMENT_SUMMARY.members["createdAt"] - ) - - case 4: - kwargs["status"] = CustomModelDeploymentStatus( - de.read_string( - _SCHEMA_CUSTOM_MODEL_DEPLOYMENT_SUMMARY.members["status"] - ) - ) - - case 5: - kwargs["last_updated_at"] = de.read_timestamp( - _SCHEMA_CUSTOM_MODEL_DEPLOYMENT_SUMMARY.members["lastUpdatedAt"] - ) - - case 6: - kwargs["failure_message"] = de.read_string( - _SCHEMA_CUSTOM_MODEL_DEPLOYMENT_SUMMARY.members[ - "failureMessage" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CUSTOM_MODEL_DEPLOYMENT_SUMMARY, consumer=_consumer - ) - if "custom_model_deployment_arn" not in kwargs: - kwargs["custom_model_deployment_arn"] = "" - if "custom_model_deployment_name" not in kwargs: - kwargs["custom_model_deployment_name"] = "" - if "model_arn" not in kwargs: - kwargs["model_arn"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "status" not in kwargs: - kwargs["status"] = CustomModelDeploymentStatus._corrected("") - return kwargs - - -def _serialize_custom_model_deployment_summary_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[CustomModelDeploymentSummary], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_custom_model_deployment_summary_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[CustomModelDeploymentSummary]: - result: list[CustomModelDeploymentSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(CustomModelDeploymentSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListCustomModelDeploymentsOutput: - """Dataclass for ListCustomModelDeploymentsOutput structure.""" - - next_token: str | None = None - """ - The token for the next set of results. This value is null when there are - no more results to return. - """ - - model_deployment_summaries: list[CustomModelDeploymentSummary] | None = None - """A list of custom model deployment summaries.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_CUSTOM_MODEL_DEPLOYMENTS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_CUSTOM_MODEL_DEPLOYMENTS_OUTPUT.members["nextToken"], - self.next_token, - ) - - if self.model_deployment_summaries is not None: - _serialize_custom_model_deployment_summary_list( - serializer, - _SCHEMA_LIST_CUSTOM_MODEL_DEPLOYMENTS_OUTPUT.members[ - "modelDeploymentSummaries" - ], - self.model_deployment_summaries, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_CUSTOM_MODEL_DEPLOYMENTS_OUTPUT.members[ - "nextToken" - ] - ) - - case 1: - kwargs["model_deployment_summaries"] = ( - _deserialize_custom_model_deployment_summary_list( - de, - _SCHEMA_LIST_CUSTOM_MODEL_DEPLOYMENTS_OUTPUT.members[ - "modelDeploymentSummaries" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_CUSTOM_MODEL_DEPLOYMENTS_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_CUSTOM_MODEL_DEPLOYMENTS = APIOperation( - input=ListCustomModelDeploymentsInput, - output=ListCustomModelDeploymentsOutput, - schema=_SCHEMA_LIST_CUSTOM_MODEL_DEPLOYMENTS, - input_schema=_SCHEMA_LIST_CUSTOM_MODEL_DEPLOYMENTS_INPUT, - output_schema=_SCHEMA_LIST_CUSTOM_MODEL_DEPLOYMENTS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateCustomModelDeploymentInput: - """Dataclass for UpdateCustomModelDeploymentInput structure.""" - - model_arn: str | None = None - """ - ARN of the new custom model to deploy. This replaces the currently - deployed model. - """ - - custom_model_deployment_identifier: str | None = None - """ - Identifier of the custom model deployment to update with the new custom - model. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_CUSTOM_MODEL_DEPLOYMENT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.model_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_CUSTOM_MODEL_DEPLOYMENT_INPUT.members["modelArn"], - self.model_arn, - ) - - if self.custom_model_deployment_identifier is not None: - serializer.write_string( - _SCHEMA_UPDATE_CUSTOM_MODEL_DEPLOYMENT_INPUT.members[ - "customModelDeploymentIdentifier" - ], - self.custom_model_deployment_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_arn"] = de.read_string( - _SCHEMA_UPDATE_CUSTOM_MODEL_DEPLOYMENT_INPUT.members["modelArn"] - ) - - case 1: - kwargs["custom_model_deployment_identifier"] = de.read_string( - _SCHEMA_UPDATE_CUSTOM_MODEL_DEPLOYMENT_INPUT.members[ - "customModelDeploymentIdentifier" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_CUSTOM_MODEL_DEPLOYMENT_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateCustomModelDeploymentOutput: - """Dataclass for UpdateCustomModelDeploymentOutput structure.""" - - custom_model_deployment_arn: str - """ARN of the custom model deployment being updated.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_CUSTOM_MODEL_DEPLOYMENT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_UPDATE_CUSTOM_MODEL_DEPLOYMENT_OUTPUT.members[ - "customModelDeploymentArn" - ], - self.custom_model_deployment_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["custom_model_deployment_arn"] = de.read_string( - _SCHEMA_UPDATE_CUSTOM_MODEL_DEPLOYMENT_OUTPUT.members[ - "customModelDeploymentArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_CUSTOM_MODEL_DEPLOYMENT_OUTPUT, consumer=_consumer - ) - if "custom_model_deployment_arn" not in kwargs: - kwargs["custom_model_deployment_arn"] = "" - return kwargs - - -UPDATE_CUSTOM_MODEL_DEPLOYMENT = APIOperation( - input=UpdateCustomModelDeploymentInput, - output=UpdateCustomModelDeploymentOutput, - schema=_SCHEMA_UPDATE_CUSTOM_MODEL_DEPLOYMENT, - input_schema=_SCHEMA_UPDATE_CUSTOM_MODEL_DEPLOYMENT_INPUT, - output_schema=_SCHEMA_UPDATE_CUSTOM_MODEL_DEPLOYMENT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ModelPackageArnDataSource: - """ - Contains the Amazon Resource Name (ARN) of a SageMaker AI model package - to use as the data source for a custom model. - """ - - model_package_arn: str - """ - The Amazon Resource Name (ARN) of the SageMaker AI model package. The - ARN must be for a model package of `restricted` type. - - To use a model package ARN, you must have the - `sagemaker:DescribeModelPackage` and `sagemaker:AccessModelPackageData` - permissions on the model package resource. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MODEL_PACKAGE_ARN_DATA_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MODEL_PACKAGE_ARN_DATA_SOURCE.members["modelPackageArn"], - self.model_package_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_package_arn"] = de.read_string( - _SCHEMA_MODEL_PACKAGE_ARN_DATA_SOURCE.members["modelPackageArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MODEL_PACKAGE_ARN_DATA_SOURCE, consumer=_consumer - ) - if "model_package_arn" not in kwargs: - kwargs["model_package_arn"] = "" - return kwargs - - -@dataclass -class CustomModelDataSourceModelPackageArnDataSource: - """ - A SageMaker AI model package ARN as the data source for the custom - model. When you specify a model package ARN, Amazon Bedrock resolves the - model package to retrieve the model artifacts. - """ - - value: ModelPackageArnDataSource - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOM_MODEL_DATA_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CUSTOM_MODEL_DATA_SOURCE.members["modelPackageArnDataSource"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ModelPackageArnDataSource.deserialize(deserializer)) - - -@dataclass -class CustomModelDataSourceUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -CustomModelDataSource = Union[ - CustomModelDataSourceModelPackageArnDataSource | CustomModelDataSourceUnknown -] -""" -The data source for a custom model. This is a union type that supports -the following member: - -- `modelPackageArnDataSource` --- Specifies a SageMaker AI model package - as the data source. -""" - - -class _CustomModelDataSourceDeserializer: - _result: CustomModelDataSource | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> CustomModelDataSource: - self._result = None - deserializer.read_struct(_SCHEMA_CUSTOM_MODEL_DATA_SOURCE, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - CustomModelDataSourceModelPackageArnDataSource.deserialize(de) - ) - - case _: - self._set_result( - CustomModelDataSourceUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: CustomModelDataSource) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class S3DataSource: - """The Amazon S3 data source of the model to import.""" - - s3_uri: str - """The URI of the Amazon S3 data source.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_S3_DATA_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_S3_DATA_SOURCE.members["s3Uri"], self.s3_uri) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["s3_uri"] = de.read_string( - _SCHEMA_S3_DATA_SOURCE.members["s3Uri"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_S3_DATA_SOURCE, consumer=_consumer) - if "s3_uri" not in kwargs: - kwargs["s3_uri"] = "" - return kwargs - - -@dataclass -class ModelDataSourceS3DataSource: - """The Amazon S3 data source of the model to import.""" - - value: S3DataSource - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MODEL_DATA_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MODEL_DATA_SOURCE.members["s3DataSource"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=S3DataSource.deserialize(deserializer)) - - -@dataclass -class ModelDataSourceUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ModelDataSource = Union[ModelDataSourceS3DataSource | ModelDataSourceUnknown] -"""The data source of the model to import.""" - - -class _ModelDataSourceDeserializer: - _result: ModelDataSource | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> ModelDataSource: - self._result = None - deserializer.read_struct(_SCHEMA_MODEL_DATA_SOURCE, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(ModelDataSourceS3DataSource.deserialize(de)) - - case _: - self._set_result( - ModelDataSourceUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: ModelDataSource) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class CreateCustomModelInput: - """Dataclass for CreateCustomModelInput structure.""" - - model_name: str | None = None - """A unique name for the custom model.""" - - model_source_config: ModelDataSource | None = None - """ - The data source for the model. The Amazon S3 URI in the model source - must be for the Amazon-managed Amazon S3 bucket containing your model - artifacts. - """ - - custom_model_data_source: CustomModelDataSource | None = None - """ - The data source for the custom model. Use this field to specify a - SageMaker AI model package ARN as the source for your custom model. - Amazon Bedrock resolves the model package to retrieve the model - artifacts. - - You can specify either `customModelDataSource` or `modelSourceConfig`, - but not both. - """ - - model_kms_key_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the customer managed KMS key to - encrypt the custom model. If you don't provide a KMS key, Amazon - Bedrock uses an Amazon Web Services-managed KMS key to encrypt the - model. - - If you provide a customer managed KMS key, your Amazon Bedrock service - role must have permissions to use it. For more information see - [Encryption of imported - models](https://docs.aws.amazon.com/bedrock/latest/userguide/encryption-import-model.html). - """ - - role_arn: str | None = None - """ - The Amazon Resource Name (ARN) of an IAM service role that Amazon - Bedrock assumes to perform tasks on your behalf. This role must have - permissions to access the Amazon S3 bucket containing your model - artifacts and the KMS key (if specified). For more information, see - [Setting up an IAM service role for importing - models](https://docs.aws.amazon.com/bedrock/latest/userguide/model-import-iam-role.html) - in the Amazon Bedrock User Guide. - - This field is required when you use `modelSourceConfig` with an Amazon - S3 data source. It is not required when you use `customModelDataSource` - with a model package ARN, because Amazon Bedrock uses its own - credentials to access the model artifacts. - """ - - model_tags: list[Tag] | None = None - """ - A list of key-value pairs to associate with the custom model resource. - You can use these tags to organize and identify your resources. - - For more information, see [Tagging - resources](https://docs.aws.amazon.com/bedrock/latest/userguide/tagging.html) - in the [Amazon Bedrock User - Guide](https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html). - """ - - client_request_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If this token matches a previous - request, Amazon Bedrock ignores the request, but does not return an - error. For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_CUSTOM_MODEL_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.model_name is not None: - serializer.write_string( - _SCHEMA_CREATE_CUSTOM_MODEL_INPUT.members["modelName"], self.model_name - ) - - if self.model_source_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_CUSTOM_MODEL_INPUT.members["modelSourceConfig"], - self.model_source_config, - ) - - if self.custom_model_data_source is not None: - serializer.write_struct( - _SCHEMA_CREATE_CUSTOM_MODEL_INPUT.members["customModelDataSource"], - self.custom_model_data_source, - ) - - if self.model_kms_key_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_CUSTOM_MODEL_INPUT.members["modelKmsKeyArn"], - self.model_kms_key_arn, - ) - - if self.role_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_CUSTOM_MODEL_INPUT.members["roleArn"], self.role_arn - ) - - if self.model_tags is not None: - _serialize_tag_list( - serializer, - _SCHEMA_CREATE_CUSTOM_MODEL_INPUT.members["modelTags"], - self.model_tags, - ) - - if self.client_request_token is not None: - serializer.write_string( - _SCHEMA_CREATE_CUSTOM_MODEL_INPUT.members["clientRequestToken"], - self.client_request_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_name"] = de.read_string( - _SCHEMA_CREATE_CUSTOM_MODEL_INPUT.members["modelName"] - ) - - case 1: - kwargs["model_source_config"] = ( - _ModelDataSourceDeserializer().deserialize(de) - ) - - case 2: - kwargs["custom_model_data_source"] = ( - _CustomModelDataSourceDeserializer().deserialize(de) - ) - - case 3: - kwargs["model_kms_key_arn"] = de.read_string( - _SCHEMA_CREATE_CUSTOM_MODEL_INPUT.members["modelKmsKeyArn"] - ) - - case 4: - kwargs["role_arn"] = de.read_string( - _SCHEMA_CREATE_CUSTOM_MODEL_INPUT.members["roleArn"] - ) - - case 5: - kwargs["model_tags"] = _deserialize_tag_list( - de, _SCHEMA_CREATE_CUSTOM_MODEL_INPUT.members["modelTags"] - ) - - case 6: - kwargs["client_request_token"] = de.read_string( - _SCHEMA_CREATE_CUSTOM_MODEL_INPUT.members["clientRequestToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_CUSTOM_MODEL_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CreateCustomModelOutput: - """Dataclass for CreateCustomModelOutput structure.""" - - model_arn: str - """The Amazon Resource Name (ARN) of the new custom model.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_CUSTOM_MODEL_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_CUSTOM_MODEL_OUTPUT.members["modelArn"], self.model_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_arn"] = de.read_string( - _SCHEMA_CREATE_CUSTOM_MODEL_OUTPUT.members["modelArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_CUSTOM_MODEL_OUTPUT, consumer=_consumer) - if "model_arn" not in kwargs: - kwargs["model_arn"] = "" - return kwargs - - -CREATE_CUSTOM_MODEL = APIOperation( - input=CreateCustomModelInput, - output=CreateCustomModelOutput, - schema=_SCHEMA_CREATE_CUSTOM_MODEL, - input_schema=_SCHEMA_CREATE_CUSTOM_MODEL_INPUT, - output_schema=_SCHEMA_CREATE_CUSTOM_MODEL_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrock#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrock#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#TooManyTagsException"): TooManyTagsException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_TOO_MANY_TAGS_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteCustomModelInput: - """Dataclass for DeleteCustomModelInput structure.""" - - model_identifier: str | None = None - """Name of the model to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_CUSTOM_MODEL_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.model_identifier is not None: - serializer.write_string( - _SCHEMA_DELETE_CUSTOM_MODEL_INPUT.members["modelIdentifier"], - self.model_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_identifier"] = de.read_string( - _SCHEMA_DELETE_CUSTOM_MODEL_INPUT.members["modelIdentifier"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_CUSTOM_MODEL_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteCustomModelOutput: - """Dataclass for DeleteCustomModelOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_CUSTOM_MODEL_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_CUSTOM_MODEL_OUTPUT, consumer=_consumer) - return kwargs - - -DELETE_CUSTOM_MODEL = APIOperation( - input=DeleteCustomModelInput, - output=DeleteCustomModelOutput, - schema=_SCHEMA_DELETE_CUSTOM_MODEL, - input_schema=_SCHEMA_DELETE_CUSTOM_MODEL_INPUT, - output_schema=_SCHEMA_DELETE_CUSTOM_MODEL_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrock#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetCustomModelInput: - """Dataclass for GetCustomModelInput structure.""" - - model_identifier: str | None = None - """Name or Amazon Resource Name (ARN) of the custom model.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_CUSTOM_MODEL_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.model_identifier is not None: - serializer.write_string( - _SCHEMA_GET_CUSTOM_MODEL_INPUT.members["modelIdentifier"], - self.model_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_identifier"] = de.read_string( - _SCHEMA_GET_CUSTOM_MODEL_INPUT.members["modelIdentifier"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_CUSTOM_MODEL_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class TeacherModelConfig: - """Details about a teacher model used for model customization.""" - - teacher_model_identifier: str - """The identifier of the teacher model.""" - - max_response_length_for_inference: int | None = None - """ - The maximum number of tokens requested when the customization job - invokes the teacher model. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TEACHER_MODEL_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_TEACHER_MODEL_CONFIG.members["teacherModelIdentifier"], - self.teacher_model_identifier, - ) - if self.max_response_length_for_inference is not None: - serializer.write_integer( - _SCHEMA_TEACHER_MODEL_CONFIG.members["maxResponseLengthForInference"], - self.max_response_length_for_inference, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["teacher_model_identifier"] = de.read_string( - _SCHEMA_TEACHER_MODEL_CONFIG.members["teacherModelIdentifier"] - ) - - case 1: - kwargs["max_response_length_for_inference"] = de.read_integer( - _SCHEMA_TEACHER_MODEL_CONFIG.members[ - "maxResponseLengthForInference" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TEACHER_MODEL_CONFIG, consumer=_consumer) - if "teacher_model_identifier" not in kwargs: - kwargs["teacher_model_identifier"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(teacher_model_identifier="") - - -@dataclass(kw_only=True) -class DistillationConfig: - """ - Settings for distilling a foundation model into a smaller and more - efficient model. - """ - - teacher_model_config: TeacherModelConfig - """The teacher model configuration.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DISTILLATION_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DISTILLATION_CONFIG.members["teacherModelConfig"], - self.teacher_model_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["teacher_model_config"] = TeacherModelConfig.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DISTILLATION_CONFIG, consumer=_consumer) - if "teacher_model_config" not in kwargs: - kwargs["teacher_model_config"] = TeacherModelConfig._smithy_default() - return kwargs - - -@dataclass(kw_only=True) -class LambdaGraderConfig: - """ - Configuration for using an AWS Lambda function to grade model responses - during reinforcement fine-tuning training. - """ - - lambda_arn: str - """ - ARN of the AWS Lambda function that will evaluate model responses and - return reward scores for RFT training. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LAMBDA_GRADER_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_LAMBDA_GRADER_CONFIG.members["lambdaArn"], self.lambda_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["lambda_arn"] = de.read_string( - _SCHEMA_LAMBDA_GRADER_CONFIG.members["lambdaArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LAMBDA_GRADER_CONFIG, consumer=_consumer) - if "lambda_arn" not in kwargs: - kwargs["lambda_arn"] = "" - return kwargs - - -@dataclass -class GraderConfigLambdaGrader: - """ - Configuration for using an AWS Lambda function as the grader for - evaluating model responses and provide reward signals in reinforcement - fine-tuning. - """ - - value: LambdaGraderConfig - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GRADER_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GRADER_CONFIG.members["lambdaGrader"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=LambdaGraderConfig.deserialize(deserializer)) - - -@dataclass -class GraderConfigUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -GraderConfig = Union[GraderConfigLambdaGrader | GraderConfigUnknown] -""" -Configuration for the grader used in reinforcement fine-tuning to -evaluate model responses and provide reward signals. -""" - - -class _GraderConfigDeserializer: - _result: GraderConfig | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> GraderConfig: - self._result = None - deserializer.read_struct(_SCHEMA_GRADER_CONFIG, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(GraderConfigLambdaGrader.deserialize(de)) - - case _: - self._set_result(GraderConfigUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: GraderConfig) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class ReasoningEffort(UnknownEnumMixin, StrEnum): - LOW = "low" - MEDIUM = "medium" - HIGH = "high" - - -@dataclass(kw_only=True) -class RFTHyperParameters: - """ - Hyperparameters for controlling the reinforcement fine-tuning training - process, including learning settings and evaluation intervals. - """ - - epoch_count: int | None = None - """ - Number of training epochs to run during reinforcement fine-tuning. - Higher values may improve performance but increase training time. - """ - - batch_size: int | None = None - """ - Number of training samples processed in each batch during reinforcement - fine-tuning (RFT) training. Larger batches may improve training - stability. - """ - - learning_rate: float | None = None - """ - Learning rate for the reinforcement fine-tuning. Controls how quickly - the model adapts to reward signals. - """ - - max_prompt_length: int | None = None - """ - Maximum length of input prompts during RFT training, measured in tokens. - Longer prompts allow more context but increase memory usage and - training-time. - """ - - training_sample_per_prompt: int | None = None - """ - Number of response samples generated per prompt during RFT training. - More samples provide better reward signal estimation. - """ - - inference_max_tokens: int | None = None - """ - Maximum number of tokens the model can generate in response to each - prompt during RFT training. - """ - - reasoning_effort: str | None = None - """ - Level of reasoning effort applied during RFT training. Higher values may - improve response quality but increase training time. - """ - - eval_interval: int | None = None - """ - Interval between evaluation runs during RFT training, measured in - training steps. More frequent evaluation provides better monitoring. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RFT_HYPER_PARAMETERS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.epoch_count is not None: - serializer.write_integer( - _SCHEMA_RFT_HYPER_PARAMETERS.members["epochCount"], self.epoch_count - ) - - if self.batch_size is not None: - serializer.write_integer( - _SCHEMA_RFT_HYPER_PARAMETERS.members["batchSize"], self.batch_size - ) - - if self.learning_rate is not None: - serializer.write_float( - _SCHEMA_RFT_HYPER_PARAMETERS.members["learningRate"], self.learning_rate - ) - - if self.max_prompt_length is not None: - serializer.write_integer( - _SCHEMA_RFT_HYPER_PARAMETERS.members["maxPromptLength"], - self.max_prompt_length, - ) - - if self.training_sample_per_prompt is not None: - serializer.write_integer( - _SCHEMA_RFT_HYPER_PARAMETERS.members["trainingSamplePerPrompt"], - self.training_sample_per_prompt, - ) - - if self.inference_max_tokens is not None: - serializer.write_integer( - _SCHEMA_RFT_HYPER_PARAMETERS.members["inferenceMaxTokens"], - self.inference_max_tokens, - ) - - if self.reasoning_effort is not None: - serializer.write_string( - _SCHEMA_RFT_HYPER_PARAMETERS.members["reasoningEffort"], - self.reasoning_effort, - ) - - if self.eval_interval is not None: - serializer.write_integer( - _SCHEMA_RFT_HYPER_PARAMETERS.members["evalInterval"], self.eval_interval - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["epoch_count"] = de.read_integer( - _SCHEMA_RFT_HYPER_PARAMETERS.members["epochCount"] - ) - - case 1: - kwargs["batch_size"] = de.read_integer( - _SCHEMA_RFT_HYPER_PARAMETERS.members["batchSize"] - ) - - case 2: - kwargs["learning_rate"] = de.read_float( - _SCHEMA_RFT_HYPER_PARAMETERS.members["learningRate"] - ) - - case 3: - kwargs["max_prompt_length"] = de.read_integer( - _SCHEMA_RFT_HYPER_PARAMETERS.members["maxPromptLength"] - ) - - case 4: - kwargs["training_sample_per_prompt"] = de.read_integer( - _SCHEMA_RFT_HYPER_PARAMETERS.members["trainingSamplePerPrompt"] - ) - - case 5: - kwargs["inference_max_tokens"] = de.read_integer( - _SCHEMA_RFT_HYPER_PARAMETERS.members["inferenceMaxTokens"] - ) - - case 6: - kwargs["reasoning_effort"] = ReasoningEffort( - de.read_string( - _SCHEMA_RFT_HYPER_PARAMETERS.members["reasoningEffort"] - ) - ) - - case 7: - kwargs["eval_interval"] = de.read_integer( - _SCHEMA_RFT_HYPER_PARAMETERS.members["evalInterval"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RFT_HYPER_PARAMETERS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class RFTConfig: - """ - Configuration settings for reinforcement fine-tuning (RFT), including - grader configuration and training hyperparameters. - """ - - grader_config: GraderConfig | None = None - """ - Configuration for the grader that evaluates model responses and provides - reward signals during RFT training. - """ - - hyper_parameters: RFTHyperParameters | None = None - """ - Hyperparameters that control the reinforcement fine-tuning training - process, including learning rate, batch size, and epoch count. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RFT_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.grader_config is not None: - serializer.write_struct( - _SCHEMA_RFT_CONFIG.members["graderConfig"], self.grader_config - ) - - if self.hyper_parameters is not None: - serializer.write_struct( - _SCHEMA_RFT_CONFIG.members["hyperParameters"], self.hyper_parameters - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["grader_config"] = _GraderConfigDeserializer().deserialize( - de - ) - - case 1: - kwargs["hyper_parameters"] = RFTHyperParameters.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RFT_CONFIG, consumer=_consumer) - return kwargs - - -@dataclass -class CustomizationConfigDistillationConfig: - """The Distillation configuration for the custom model.""" - - value: DistillationConfig - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOMIZATION_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CUSTOMIZATION_CONFIG.members["distillationConfig"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=DistillationConfig.deserialize(deserializer)) - - -@dataclass -class CustomizationConfigRftConfig: - """ - Configuration settings for reinforcement fine-tuning (RFT) model - customization, including grader configuration and hyperparameters. - """ - - value: RFTConfig - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOMIZATION_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CUSTOMIZATION_CONFIG.members["rftConfig"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=RFTConfig.deserialize(deserializer)) - - -@dataclass -class CustomizationConfigUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -CustomizationConfig = Union[ - CustomizationConfigDistillationConfig - | CustomizationConfigRftConfig - | CustomizationConfigUnknown -] -"""A model customization configuration""" - - -class _CustomizationConfigDeserializer: - _result: CustomizationConfig | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> CustomizationConfig: - self._result = None - deserializer.read_struct(_SCHEMA_CUSTOMIZATION_CONFIG, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(CustomizationConfigDistillationConfig.deserialize(de)) - - case 1: - self._set_result(CustomizationConfigRftConfig.deserialize(de)) - - case _: - self._set_result( - CustomizationConfigUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: CustomizationConfig) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class CustomizationType(UnknownEnumMixin, StrEnum): - FINE_TUNING = "FINE_TUNING" - CONTINUED_PRE_TRAINING = "CONTINUED_PRE_TRAINING" - DISTILLATION = "DISTILLATION" - REINFORCEMENT_FINE_TUNING = "REINFORCEMENT_FINE_TUNING" - IMPORTED = "IMPORTED" - - -def _serialize_model_customization_hyper_parameters( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_model_customization_hyper_parameters( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -class ModelStatus(UnknownEnumMixin, StrEnum): - ACTIVE = "Active" - CREATING = "Creating" - FAILED = "Failed" - - -@dataclass(kw_only=True) -class OutputDataConfig: - """S3 Location of the output data.""" - - s3_uri: str - """The S3 URI where the output data is stored.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OUTPUT_DATA_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_OUTPUT_DATA_CONFIG.members["s3Uri"], self.s3_uri - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["s3_uri"] = de.read_string( - _SCHEMA_OUTPUT_DATA_CONFIG.members["s3Uri"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_OUTPUT_DATA_CONFIG, consumer=_consumer) - if "s3_uri" not in kwargs: - kwargs["s3_uri"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(s3_uri="") - - -@dataclass -class InvocationLogSourceS3Uri: - """The URI of an invocation log in a bucket.""" - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOCATION_LOG_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_INVOCATION_LOG_SOURCE.members["s3Uri"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string( - _SCHEMA_INVOCATION_LOG_SOURCE.members["s3Uri"] - ) - ) - - -@dataclass -class InvocationLogSourceUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -InvocationLogSource = Union[InvocationLogSourceS3Uri | InvocationLogSourceUnknown] -"""A storage location for invocation logs.""" - - -class _InvocationLogSourceDeserializer: - _result: InvocationLogSource | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> InvocationLogSource: - self._result = None - deserializer.read_struct(_SCHEMA_INVOCATION_LOG_SOURCE, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(InvocationLogSourceS3Uri.deserialize(de)) - - case _: - self._set_result( - InvocationLogSourceUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: InvocationLogSource) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_request_metadata_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_request_metadata_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class RequestMetadataBaseFilters: - """ - A mapping of a metadata key to a value that it should or should not - equal. - """ - - equals: dict[str, str] | None = field(repr=False, default=None) - """Include results where the key equals the value.""" - - not_equals: dict[str, str] | None = field(repr=False, default=None) - """Include results where the key does not equal the value.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REQUEST_METADATA_BASE_FILTERS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.equals is not None: - _serialize_request_metadata_map( - serializer, - _SCHEMA_REQUEST_METADATA_BASE_FILTERS.members["equals"], - self.equals, - ) - - if self.not_equals is not None: - _serialize_request_metadata_map( - serializer, - _SCHEMA_REQUEST_METADATA_BASE_FILTERS.members["notEquals"], - self.not_equals, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["equals"] = _deserialize_request_metadata_map( - de, _SCHEMA_REQUEST_METADATA_BASE_FILTERS.members["equals"] - ) - - case 1: - kwargs["not_equals"] = _deserialize_request_metadata_map( - de, _SCHEMA_REQUEST_METADATA_BASE_FILTERS.members["notEquals"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_REQUEST_METADATA_BASE_FILTERS, consumer=_consumer - ) - return kwargs - - -def _serialize_request_metadata_filters_list( - serializer: ShapeSerializer, schema: Schema, value: list[RequestMetadataBaseFilters] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_request_metadata_filters_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[RequestMetadataBaseFilters]: - result: list[RequestMetadataBaseFilters] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(RequestMetadataBaseFilters.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass -class RequestMetadataFiltersEquals: - """Include results where the key equals the value.""" - - value: dict[str, str] - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REQUEST_METADATA_FILTERS, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_request_metadata_map( - serializer, _SCHEMA_REQUEST_METADATA_FILTERS.members["equals"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_deserialize_request_metadata_map( - deserializer, _SCHEMA_REQUEST_METADATA_FILTERS.members["equals"] - ) - ) - - -@dataclass -class RequestMetadataFiltersNotEquals: - """Include results where the key does not equal the value.""" - - value: dict[str, str] - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REQUEST_METADATA_FILTERS, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_request_metadata_map( - serializer, - _SCHEMA_REQUEST_METADATA_FILTERS.members["notEquals"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_deserialize_request_metadata_map( - deserializer, _SCHEMA_REQUEST_METADATA_FILTERS.members["notEquals"] - ) - ) - - -@dataclass -class RequestMetadataFiltersAndAll: - """Include results where all of the based filters match.""" - - value: list[RequestMetadataBaseFilters] - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REQUEST_METADATA_FILTERS, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_request_metadata_filters_list( - serializer, _SCHEMA_REQUEST_METADATA_FILTERS.members["andAll"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_deserialize_request_metadata_filters_list( - deserializer, _SCHEMA_REQUEST_METADATA_FILTERS.members["andAll"] - ) - ) - - -@dataclass -class RequestMetadataFiltersOrAll: - """Include results where any of the base filters match.""" - - value: list[RequestMetadataBaseFilters] - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REQUEST_METADATA_FILTERS, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_request_metadata_filters_list( - serializer, _SCHEMA_REQUEST_METADATA_FILTERS.members["orAll"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_deserialize_request_metadata_filters_list( - deserializer, _SCHEMA_REQUEST_METADATA_FILTERS.members["orAll"] - ) - ) - - -@dataclass -class RequestMetadataFiltersUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -RequestMetadataFilters = Union[ - RequestMetadataFiltersEquals - | RequestMetadataFiltersNotEquals - | RequestMetadataFiltersAndAll - | RequestMetadataFiltersOrAll - | RequestMetadataFiltersUnknown -] -""" -Rules for filtering invocation logs. A filter can be a mapping of a -metadata key to a value that it should or should not equal (a base -filter), or a list of base filters that are all applied with `AND` or -`OR` logical operators -""" - - -class _RequestMetadataFiltersDeserializer: - _result: RequestMetadataFilters | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> RequestMetadataFilters: - self._result = None - deserializer.read_struct(_SCHEMA_REQUEST_METADATA_FILTERS, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(RequestMetadataFiltersEquals.deserialize(de)) - - case 1: - self._set_result(RequestMetadataFiltersNotEquals.deserialize(de)) - - case 2: - self._set_result(RequestMetadataFiltersAndAll.deserialize(de)) - - case 3: - self._set_result(RequestMetadataFiltersOrAll.deserialize(de)) - - case _: - self._set_result( - RequestMetadataFiltersUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: RequestMetadataFilters) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class InvocationLogsConfig: - """Settings for using invocation logs to customize a model.""" - - invocation_log_source: InvocationLogSource - """The source of the invocation logs.""" - - use_prompt_response: bool = False - """ - Whether to use the model's response for training, or just the prompt. - The default value is `False`. - """ - - request_metadata_filters: RequestMetadataFilters | None = None - """Rules for filtering invocation logs based on request metadata.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOCATION_LOGS_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_boolean( - _SCHEMA_INVOCATION_LOGS_CONFIG.members["usePromptResponse"], - self.use_prompt_response, - ) - serializer.write_struct( - _SCHEMA_INVOCATION_LOGS_CONFIG.members["invocationLogSource"], - self.invocation_log_source, - ) - if self.request_metadata_filters is not None: - serializer.write_struct( - _SCHEMA_INVOCATION_LOGS_CONFIG.members["requestMetadataFilters"], - self.request_metadata_filters, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["use_prompt_response"] = de.read_boolean( - _SCHEMA_INVOCATION_LOGS_CONFIG.members["usePromptResponse"] - ) - - case 1: - kwargs["invocation_log_source"] = ( - _InvocationLogSourceDeserializer().deserialize(de) - ) - - case 2: - kwargs["request_metadata_filters"] = ( - _RequestMetadataFiltersDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INVOCATION_LOGS_CONFIG, consumer=_consumer) - if "invocation_log_source" not in kwargs: - kwargs["invocation_log_source"] = InvocationLogSourceUnknown(tag="") - return kwargs - - -@dataclass(kw_only=True) -class TrainingDataConfig: - """S3 Location of the training data.""" - - s3_uri: str | None = None - """The S3 URI where the training data is stored.""" - - invocation_logs_config: InvocationLogsConfig | None = None - """Settings for using invocation logs to customize a model.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRAINING_DATA_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.s3_uri is not None: - serializer.write_string( - _SCHEMA_TRAINING_DATA_CONFIG.members["s3Uri"], self.s3_uri - ) - - if self.invocation_logs_config is not None: - serializer.write_struct( - _SCHEMA_TRAINING_DATA_CONFIG.members["invocationLogsConfig"], - self.invocation_logs_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["s3_uri"] = de.read_string( - _SCHEMA_TRAINING_DATA_CONFIG.members["s3Uri"] - ) - - case 1: - kwargs["invocation_logs_config"] = InvocationLogsConfig.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TRAINING_DATA_CONFIG, consumer=_consumer) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls() - - -@dataclass(kw_only=True) -class TrainingMetrics: - """Metrics associated with the custom job.""" - - training_loss: float | None = None - """Loss metric associated with the custom job.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRAINING_METRICS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.training_loss is not None: - serializer.write_float( - _SCHEMA_TRAINING_METRICS.members["trainingLoss"], self.training_loss - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["training_loss"] = de.read_float( - _SCHEMA_TRAINING_METRICS.members["trainingLoss"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TRAINING_METRICS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Validator: - """Information about a validator.""" - - s3_uri: str - """The S3 URI where the validation data is stored.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VALIDATOR, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_VALIDATOR.members["s3Uri"], self.s3_uri) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["s3_uri"] = de.read_string( - _SCHEMA_VALIDATOR.members["s3Uri"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VALIDATOR, consumer=_consumer) - if "s3_uri" not in kwargs: - kwargs["s3_uri"] = "" - return kwargs - - -def _serialize_validators( - serializer: ShapeSerializer, schema: Schema, value: list[Validator] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_validators( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Validator]: - result: list[Validator] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Validator.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ValidationDataConfig: - """Array of up to 10 validators.""" - - validators: list[Validator] - """Information about the validators.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VALIDATION_DATA_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_validators( - serializer, - _SCHEMA_VALIDATION_DATA_CONFIG.members["validators"], - self.validators, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["validators"] = _deserialize_validators( - de, _SCHEMA_VALIDATION_DATA_CONFIG.members["validators"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VALIDATION_DATA_CONFIG, consumer=_consumer) - if "validators" not in kwargs: - kwargs["validators"] = [] - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(validators=[]) - - -@dataclass(kw_only=True) -class ValidatorMetric: - """The metric for the validator.""" - - validation_loss: float | None = None - """The validation loss associated with this validator.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VALIDATOR_METRIC, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.validation_loss is not None: - serializer.write_float( - _SCHEMA_VALIDATOR_METRIC.members["validationLoss"], self.validation_loss - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["validation_loss"] = de.read_float( - _SCHEMA_VALIDATOR_METRIC.members["validationLoss"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VALIDATOR_METRIC, consumer=_consumer) - return kwargs - - -def _serialize_validation_metrics( - serializer: ShapeSerializer, schema: Schema, value: list[ValidatorMetric] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_validation_metrics( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ValidatorMetric]: - result: list[ValidatorMetric] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ValidatorMetric.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GetCustomModelOutput: - """Dataclass for GetCustomModelOutput structure.""" - - model_arn: str - """Amazon Resource Name (ARN) associated with this model.""" - - model_name: str - """Model name associated with this model.""" - - creation_time: datetime - """Creation time of the model.""" - - job_name: str | None = None - """Job name associated with this model.""" - - job_arn: str | None = None - """ - Job Amazon Resource Name (ARN) associated with this model. For models - that you create with the - [CreateCustomModel](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_CreateCustomModel.html) - API operation, this is `NULL`. - """ - - base_model_arn: str | None = None - """Amazon Resource Name (ARN) of the base model.""" - - customization_type: str | None = None - """The type of model customization.""" - - model_kms_key_arn: str | None = None - """The custom model is encrypted at rest using this key.""" - - hyper_parameters: dict[str, str] | None = None - """ - Hyperparameter values associated with this model. For details on the - format for different models, see [Custom model - hyperparameters](https://docs.aws.amazon.com/bedrock/latest/userguide/custom-models-hp.html). - """ - - training_data_config: TrainingDataConfig | None = None - """Contains information about the training dataset.""" - - validation_data_config: ValidationDataConfig | None = None - """Contains information about the validation dataset.""" - - output_data_config: OutputDataConfig | None = None - """Output data configuration associated with this custom model.""" - - training_metrics: TrainingMetrics | None = None - """Contains training metrics from the job creation.""" - - validation_metrics: list[ValidatorMetric] | None = None - """The validation metrics from the job creation.""" - - customization_config: CustomizationConfig | None = None - """The customization configuration for the custom model.""" - - model_status: str | None = None - """ - The current status of the custom model. Possible values include: - - - `Creating` - The model is being created and validated. - - - `Active` - The model has been successfully created and is ready for - use. - - - `Failed` - The model creation process failed. Check the - `failureMessage` field for details. - """ - - failure_message: str | None = None - """ - A failure message for any issues that occurred when creating the custom - model. This is included for only a failed CreateCustomModel operation. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_CUSTOM_MODEL_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_CUSTOM_MODEL_OUTPUT.members["modelArn"], self.model_arn - ) - serializer.write_string( - _SCHEMA_GET_CUSTOM_MODEL_OUTPUT.members["modelName"], self.model_name - ) - if self.job_name is not None: - serializer.write_string( - _SCHEMA_GET_CUSTOM_MODEL_OUTPUT.members["jobName"], self.job_name - ) - - if self.job_arn is not None: - serializer.write_string( - _SCHEMA_GET_CUSTOM_MODEL_OUTPUT.members["jobArn"], self.job_arn - ) - - if self.base_model_arn is not None: - serializer.write_string( - _SCHEMA_GET_CUSTOM_MODEL_OUTPUT.members["baseModelArn"], - self.base_model_arn, - ) - - if self.customization_type is not None: - serializer.write_string( - _SCHEMA_GET_CUSTOM_MODEL_OUTPUT.members["customizationType"], - self.customization_type, - ) - - if self.model_kms_key_arn is not None: - serializer.write_string( - _SCHEMA_GET_CUSTOM_MODEL_OUTPUT.members["modelKmsKeyArn"], - self.model_kms_key_arn, - ) - - if self.hyper_parameters is not None: - _serialize_model_customization_hyper_parameters( - serializer, - _SCHEMA_GET_CUSTOM_MODEL_OUTPUT.members["hyperParameters"], - self.hyper_parameters, - ) - - if self.training_data_config is not None: - serializer.write_struct( - _SCHEMA_GET_CUSTOM_MODEL_OUTPUT.members["trainingDataConfig"], - self.training_data_config, - ) - - if self.validation_data_config is not None: - serializer.write_struct( - _SCHEMA_GET_CUSTOM_MODEL_OUTPUT.members["validationDataConfig"], - self.validation_data_config, - ) - - if self.output_data_config is not None: - serializer.write_struct( - _SCHEMA_GET_CUSTOM_MODEL_OUTPUT.members["outputDataConfig"], - self.output_data_config, - ) - - if self.training_metrics is not None: - serializer.write_struct( - _SCHEMA_GET_CUSTOM_MODEL_OUTPUT.members["trainingMetrics"], - self.training_metrics, - ) - - if self.validation_metrics is not None: - _serialize_validation_metrics( - serializer, - _SCHEMA_GET_CUSTOM_MODEL_OUTPUT.members["validationMetrics"], - self.validation_metrics, - ) - - serializer.write_timestamp( - _SCHEMA_GET_CUSTOM_MODEL_OUTPUT.members["creationTime"], self.creation_time - ) - if self.customization_config is not None: - serializer.write_struct( - _SCHEMA_GET_CUSTOM_MODEL_OUTPUT.members["customizationConfig"], - self.customization_config, - ) - - if self.model_status is not None: - serializer.write_string( - _SCHEMA_GET_CUSTOM_MODEL_OUTPUT.members["modelStatus"], - self.model_status, - ) - - if self.failure_message is not None: - serializer.write_string( - _SCHEMA_GET_CUSTOM_MODEL_OUTPUT.members["failureMessage"], - self.failure_message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_arn"] = de.read_string( - _SCHEMA_GET_CUSTOM_MODEL_OUTPUT.members["modelArn"] - ) - - case 1: - kwargs["model_name"] = de.read_string( - _SCHEMA_GET_CUSTOM_MODEL_OUTPUT.members["modelName"] - ) - - case 2: - kwargs["job_name"] = de.read_string( - _SCHEMA_GET_CUSTOM_MODEL_OUTPUT.members["jobName"] - ) - - case 3: - kwargs["job_arn"] = de.read_string( - _SCHEMA_GET_CUSTOM_MODEL_OUTPUT.members["jobArn"] - ) - - case 4: - kwargs["base_model_arn"] = de.read_string( - _SCHEMA_GET_CUSTOM_MODEL_OUTPUT.members["baseModelArn"] - ) - - case 5: - kwargs["customization_type"] = CustomizationType( - de.read_string( - _SCHEMA_GET_CUSTOM_MODEL_OUTPUT.members["customizationType"] - ) - ) - - case 6: - kwargs["model_kms_key_arn"] = de.read_string( - _SCHEMA_GET_CUSTOM_MODEL_OUTPUT.members["modelKmsKeyArn"] - ) - - case 7: - kwargs["hyper_parameters"] = ( - _deserialize_model_customization_hyper_parameters( - de, - _SCHEMA_GET_CUSTOM_MODEL_OUTPUT.members["hyperParameters"], - ) - ) - - case 8: - kwargs["training_data_config"] = TrainingDataConfig.deserialize(de) - - case 9: - kwargs["validation_data_config"] = ValidationDataConfig.deserialize( - de - ) - - case 10: - kwargs["output_data_config"] = OutputDataConfig.deserialize(de) - - case 11: - kwargs["training_metrics"] = TrainingMetrics.deserialize(de) - - case 12: - kwargs["validation_metrics"] = _deserialize_validation_metrics( - de, _SCHEMA_GET_CUSTOM_MODEL_OUTPUT.members["validationMetrics"] - ) - - case 13: - kwargs["creation_time"] = de.read_timestamp( - _SCHEMA_GET_CUSTOM_MODEL_OUTPUT.members["creationTime"] - ) - - case 14: - kwargs["customization_config"] = ( - _CustomizationConfigDeserializer().deserialize(de) - ) - - case 15: - kwargs["model_status"] = ModelStatus( - de.read_string( - _SCHEMA_GET_CUSTOM_MODEL_OUTPUT.members["modelStatus"] - ) - ) - - case 16: - kwargs["failure_message"] = de.read_string( - _SCHEMA_GET_CUSTOM_MODEL_OUTPUT.members["failureMessage"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_CUSTOM_MODEL_OUTPUT, consumer=_consumer) - if "model_arn" not in kwargs: - kwargs["model_arn"] = "" - if "model_name" not in kwargs: - kwargs["model_name"] = "" - if "creation_time" not in kwargs: - kwargs["creation_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -GET_CUSTOM_MODEL = APIOperation( - input=GetCustomModelInput, - output=GetCustomModelOutput, - schema=_SCHEMA_GET_CUSTOM_MODEL, - input_schema=_SCHEMA_GET_CUSTOM_MODEL_INPUT, - output_schema=_SCHEMA_GET_CUSTOM_MODEL_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListCustomModelsInput: - """Dataclass for ListCustomModelsInput structure.""" - - creation_time_before: datetime | None = None - """Return custom models created before the specified time.""" - - creation_time_after: datetime | None = None - """Return custom models created after the specified time.""" - - name_contains: str | None = None - """Return custom models only if the job name contains these characters.""" - - base_model_arn_equals: str | None = None - """ - Return custom models only if the base model Amazon Resource Name (ARN) - matches this parameter. - """ - - foundation_model_arn_equals: str | None = None - """ - Return custom models only if the foundation model Amazon Resource Name - (ARN) matches this parameter. - """ - - max_results: int | None = None - """ - The maximum number of results to return in the response. If the total - number of results is greater than this value, use the token returned in - the response in the `nextToken` field when making another request to - return the next batch of results. - """ - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, enter the token returned in the `nextToken` - field in the response in this field to return the next batch of results. - """ - - sort_by: str | None = None - """The field to sort by in the returned list of models.""" - - sort_order: str | None = None - """The sort order of the results.""" - - is_owned: bool | None = None - """ - Return custom models depending on if the current account owns them - (`true`) or if they were shared with the current account (`false`). - """ - - model_status: str | None = None - """ - The status of them model to filter results by. Possible values include: - - - `Creating` - Include only models that are currently being created and - validated. - - - `Active` - Include only models that have been successfully created and - are ready for use. - - - `Failed` - Include only models where the creation process failed. - - If you don't specify a status, the API returns models in all states. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_CUSTOM_MODELS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.creation_time_before is not None: - serializer.write_timestamp( - _SCHEMA_LIST_CUSTOM_MODELS_INPUT.members["creationTimeBefore"], - self.creation_time_before, - ) - - if self.creation_time_after is not None: - serializer.write_timestamp( - _SCHEMA_LIST_CUSTOM_MODELS_INPUT.members["creationTimeAfter"], - self.creation_time_after, - ) - - if self.name_contains is not None: - serializer.write_string( - _SCHEMA_LIST_CUSTOM_MODELS_INPUT.members["nameContains"], - self.name_contains, - ) - - if self.base_model_arn_equals is not None: - serializer.write_string( - _SCHEMA_LIST_CUSTOM_MODELS_INPUT.members["baseModelArnEquals"], - self.base_model_arn_equals, - ) - - if self.foundation_model_arn_equals is not None: - serializer.write_string( - _SCHEMA_LIST_CUSTOM_MODELS_INPUT.members["foundationModelArnEquals"], - self.foundation_model_arn_equals, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_CUSTOM_MODELS_INPUT.members["maxResults"], self.max_results - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_CUSTOM_MODELS_INPUT.members["nextToken"], self.next_token - ) - - if self.sort_by is not None: - serializer.write_string( - _SCHEMA_LIST_CUSTOM_MODELS_INPUT.members["sortBy"], self.sort_by - ) - - if self.sort_order is not None: - serializer.write_string( - _SCHEMA_LIST_CUSTOM_MODELS_INPUT.members["sortOrder"], self.sort_order - ) - - if self.is_owned is not None: - serializer.write_boolean( - _SCHEMA_LIST_CUSTOM_MODELS_INPUT.members["isOwned"], self.is_owned - ) - - if self.model_status is not None: - serializer.write_string( - _SCHEMA_LIST_CUSTOM_MODELS_INPUT.members["modelStatus"], - self.model_status, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["creation_time_before"] = de.read_timestamp( - _SCHEMA_LIST_CUSTOM_MODELS_INPUT.members["creationTimeBefore"] - ) - - case 1: - kwargs["creation_time_after"] = de.read_timestamp( - _SCHEMA_LIST_CUSTOM_MODELS_INPUT.members["creationTimeAfter"] - ) - - case 2: - kwargs["name_contains"] = de.read_string( - _SCHEMA_LIST_CUSTOM_MODELS_INPUT.members["nameContains"] - ) - - case 3: - kwargs["base_model_arn_equals"] = de.read_string( - _SCHEMA_LIST_CUSTOM_MODELS_INPUT.members["baseModelArnEquals"] - ) - - case 4: - kwargs["foundation_model_arn_equals"] = de.read_string( - _SCHEMA_LIST_CUSTOM_MODELS_INPUT.members[ - "foundationModelArnEquals" - ] - ) - - case 5: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_CUSTOM_MODELS_INPUT.members["maxResults"] - ) - - case 6: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_CUSTOM_MODELS_INPUT.members["nextToken"] - ) - - case 7: - kwargs["sort_by"] = SortModelsBy( - de.read_string( - _SCHEMA_LIST_CUSTOM_MODELS_INPUT.members["sortBy"] - ) - ) - - case 8: - kwargs["sort_order"] = SortOrder( - de.read_string( - _SCHEMA_LIST_CUSTOM_MODELS_INPUT.members["sortOrder"] - ) - ) - - case 9: - kwargs["is_owned"] = de.read_boolean( - _SCHEMA_LIST_CUSTOM_MODELS_INPUT.members["isOwned"] - ) - - case 10: - kwargs["model_status"] = ModelStatus( - de.read_string( - _SCHEMA_LIST_CUSTOM_MODELS_INPUT.members["modelStatus"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_CUSTOM_MODELS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CustomModelSummary: - """Summary information for a custom model.""" - - model_arn: str - """The Amazon Resource Name (ARN) of the custom model.""" - - model_name: str - """The name of the custom model.""" - - creation_time: datetime - """Creation time of the model.""" - - base_model_arn: str - """The base model Amazon Resource Name (ARN).""" - - base_model_name: str - """The base model name.""" - - customization_type: str | None = None - """ - Specifies whether to carry out continued pre-training of a model or - whether to fine-tune it. For more information, see [Custom - models](https://docs.aws.amazon.com/bedrock/latest/userguide/custom-models.html). - """ - - owner_account_id: str | None = None - """The unique identifier of the account that owns the model.""" - - model_status: str | None = None - """ - The current status of the custom model. Possible values include: - - - `Creating` - The model is being created and validated. - - - `Active` - The model has been successfully created and is ready for - use. - - - `Failed` - The model creation process failed. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOM_MODEL_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CUSTOM_MODEL_SUMMARY.members["modelArn"], self.model_arn - ) - serializer.write_string( - _SCHEMA_CUSTOM_MODEL_SUMMARY.members["modelName"], self.model_name - ) - serializer.write_timestamp( - _SCHEMA_CUSTOM_MODEL_SUMMARY.members["creationTime"], self.creation_time - ) - serializer.write_string( - _SCHEMA_CUSTOM_MODEL_SUMMARY.members["baseModelArn"], self.base_model_arn - ) - serializer.write_string( - _SCHEMA_CUSTOM_MODEL_SUMMARY.members["baseModelName"], self.base_model_name - ) - if self.customization_type is not None: - serializer.write_string( - _SCHEMA_CUSTOM_MODEL_SUMMARY.members["customizationType"], - self.customization_type, - ) - - if self.owner_account_id is not None: - serializer.write_string( - _SCHEMA_CUSTOM_MODEL_SUMMARY.members["ownerAccountId"], - self.owner_account_id, - ) - - if self.model_status is not None: - serializer.write_string( - _SCHEMA_CUSTOM_MODEL_SUMMARY.members["modelStatus"], self.model_status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_arn"] = de.read_string( - _SCHEMA_CUSTOM_MODEL_SUMMARY.members["modelArn"] - ) - - case 1: - kwargs["model_name"] = de.read_string( - _SCHEMA_CUSTOM_MODEL_SUMMARY.members["modelName"] - ) - - case 2: - kwargs["creation_time"] = de.read_timestamp( - _SCHEMA_CUSTOM_MODEL_SUMMARY.members["creationTime"] - ) - - case 3: - kwargs["base_model_arn"] = de.read_string( - _SCHEMA_CUSTOM_MODEL_SUMMARY.members["baseModelArn"] - ) - - case 4: - kwargs["base_model_name"] = de.read_string( - _SCHEMA_CUSTOM_MODEL_SUMMARY.members["baseModelName"] - ) - - case 5: - kwargs["customization_type"] = CustomizationType( - de.read_string( - _SCHEMA_CUSTOM_MODEL_SUMMARY.members["customizationType"] - ) - ) - - case 6: - kwargs["owner_account_id"] = de.read_string( - _SCHEMA_CUSTOM_MODEL_SUMMARY.members["ownerAccountId"] - ) - - case 7: - kwargs["model_status"] = ModelStatus( - de.read_string( - _SCHEMA_CUSTOM_MODEL_SUMMARY.members["modelStatus"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CUSTOM_MODEL_SUMMARY, consumer=_consumer) - if "model_arn" not in kwargs: - kwargs["model_arn"] = "" - if "model_name" not in kwargs: - kwargs["model_name"] = "" - if "creation_time" not in kwargs: - kwargs["creation_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "base_model_arn" not in kwargs: - kwargs["base_model_arn"] = "" - if "base_model_name" not in kwargs: - kwargs["base_model_name"] = "" - return kwargs - - -def _serialize_custom_model_summary_list( - serializer: ShapeSerializer, schema: Schema, value: list[CustomModelSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_custom_model_summary_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[CustomModelSummary]: - result: list[CustomModelSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(CustomModelSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListCustomModelsOutput: - """Dataclass for ListCustomModelsOutput structure.""" - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, use this token when making another request in - the `nextToken` field to return the next batch of results. - """ - - model_summaries: list[CustomModelSummary] | None = None - """Model summaries.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_CUSTOM_MODELS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_CUSTOM_MODELS_OUTPUT.members["nextToken"], self.next_token - ) - - if self.model_summaries is not None: - _serialize_custom_model_summary_list( - serializer, - _SCHEMA_LIST_CUSTOM_MODELS_OUTPUT.members["modelSummaries"], - self.model_summaries, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_CUSTOM_MODELS_OUTPUT.members["nextToken"] - ) - - case 1: - kwargs["model_summaries"] = _deserialize_custom_model_summary_list( - de, _SCHEMA_LIST_CUSTOM_MODELS_OUTPUT.members["modelSummaries"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_CUSTOM_MODELS_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_CUSTOM_MODELS = APIOperation( - input=ListCustomModelsInput, - output=ListCustomModelsOutput, - schema=_SCHEMA_LIST_CUSTOM_MODELS, - input_schema=_SCHEMA_LIST_CUSTOM_MODELS_INPUT, - output_schema=_SCHEMA_LIST_CUSTOM_MODELS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetAccountDataRetentionInput: - """Dataclass for GetAccountDataRetentionInput structure.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_ACCOUNT_DATA_RETENTION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_ACCOUNT_DATA_RETENTION_INPUT, consumer=_consumer - ) - return kwargs - - -class DataRetentionMode(UnknownEnumMixin, StrEnum): - """ - The data retention mode for the account. Valid values are: - - - `default` -- The standard data handling for the model applies. - - - `none` -- Zero data retention. - - - `aws_review` -- Amazon Web Services may review the request data. The - data is not shared with the model provider. A model must support this - mode to be invoked under it. - - - `provider_data_share` -- Data may be shared with the model provider. - - - `inherit` -- No data retention mode is set at this scope. - """ - - DEFAULT = "default" - NONE = "none" - AWS_REVIEW = "aws_review" - PROVIDER_DATA_SHARE = "provider_data_share" - INHERIT = "inherit" - - -@dataclass(kw_only=True) -class GetAccountDataRetentionOutput: - """Dataclass for GetAccountDataRetentionOutput structure.""" - - mode: str - """The data retention mode configured for the account.""" - - updated_at: datetime | None = None - """The time at which the data retention mode was last updated.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_ACCOUNT_DATA_RETENTION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_ACCOUNT_DATA_RETENTION_OUTPUT.members["mode"], self.mode - ) - if self.updated_at is not None: - serializer.write_timestamp( - _SCHEMA_GET_ACCOUNT_DATA_RETENTION_OUTPUT.members["updatedAt"], - self.updated_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["mode"] = DataRetentionMode( - de.read_string( - _SCHEMA_GET_ACCOUNT_DATA_RETENTION_OUTPUT.members["mode"] - ) - ) - - case 1: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_GET_ACCOUNT_DATA_RETENTION_OUTPUT.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_ACCOUNT_DATA_RETENTION_OUTPUT, consumer=_consumer - ) - if "mode" not in kwargs: - kwargs["mode"] = DataRetentionMode._corrected("") - return kwargs - - -GET_ACCOUNT_DATA_RETENTION = APIOperation( - input=GetAccountDataRetentionInput, - output=GetAccountDataRetentionOutput, - schema=_SCHEMA_GET_ACCOUNT_DATA_RETENTION, - input_schema=_SCHEMA_GET_ACCOUNT_DATA_RETENTION_INPUT, - output_schema=_SCHEMA_GET_ACCOUNT_DATA_RETENTION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class PutAccountDataRetentionInput: - """Dataclass for PutAccountDataRetentionInput structure.""" - - mode: str | None = None - """The data retention mode to set for the account.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_ACCOUNT_DATA_RETENTION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.mode is not None: - serializer.write_string( - _SCHEMA_PUT_ACCOUNT_DATA_RETENTION_INPUT.members["mode"], self.mode - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["mode"] = DataRetentionMode( - de.read_string( - _SCHEMA_PUT_ACCOUNT_DATA_RETENTION_INPUT.members["mode"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PUT_ACCOUNT_DATA_RETENTION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class PutAccountDataRetentionOutput: - """Dataclass for PutAccountDataRetentionOutput structure.""" - - mode: str - """The data retention mode set for the account.""" - - updated_at: datetime | None = None - """The time at which the data retention mode was last updated.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_ACCOUNT_DATA_RETENTION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_PUT_ACCOUNT_DATA_RETENTION_OUTPUT.members["mode"], self.mode - ) - if self.updated_at is not None: - serializer.write_timestamp( - _SCHEMA_PUT_ACCOUNT_DATA_RETENTION_OUTPUT.members["updatedAt"], - self.updated_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["mode"] = DataRetentionMode( - de.read_string( - _SCHEMA_PUT_ACCOUNT_DATA_RETENTION_OUTPUT.members["mode"] - ) - ) - - case 1: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_PUT_ACCOUNT_DATA_RETENTION_OUTPUT.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PUT_ACCOUNT_DATA_RETENTION_OUTPUT, consumer=_consumer - ) - if "mode" not in kwargs: - kwargs["mode"] = DataRetentionMode._corrected("") - return kwargs - - -PUT_ACCOUNT_DATA_RETENTION = APIOperation( - input=PutAccountDataRetentionInput, - output=PutAccountDataRetentionOutput, - schema=_SCHEMA_PUT_ACCOUNT_DATA_RETENTION, - input_schema=_SCHEMA_PUT_ACCOUNT_DATA_RETENTION_INPUT, - output_schema=_SCHEMA_PUT_ACCOUNT_DATA_RETENTION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteEnforcedGuardrailConfigurationInput: - """Dataclass for DeleteEnforcedGuardrailConfigurationInput structure.""" - - config_id: str | None = None - """Unique ID for the account enforced configuration.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DELETE_ENFORCED_GUARDRAIL_CONFIGURATION_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.config_id is not None: - serializer.write_string( - _SCHEMA_DELETE_ENFORCED_GUARDRAIL_CONFIGURATION_INPUT.members[ - "configId" - ], - self.config_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["config_id"] = de.read_string( - _SCHEMA_DELETE_ENFORCED_GUARDRAIL_CONFIGURATION_INPUT.members[ - "configId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_ENFORCED_GUARDRAIL_CONFIGURATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteEnforcedGuardrailConfigurationOutput: - """Dataclass for DeleteEnforcedGuardrailConfigurationOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DELETE_ENFORCED_GUARDRAIL_CONFIGURATION_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_ENFORCED_GUARDRAIL_CONFIGURATION_OUTPUT, consumer=_consumer - ) - return kwargs - - -DELETE_ENFORCED_GUARDRAIL_CONFIGURATION = APIOperation( - input=DeleteEnforcedGuardrailConfigurationInput, - output=DeleteEnforcedGuardrailConfigurationOutput, - schema=_SCHEMA_DELETE_ENFORCED_GUARDRAIL_CONFIGURATION, - input_schema=_SCHEMA_DELETE_ENFORCED_GUARDRAIL_CONFIGURATION_INPUT, - output_schema=_SCHEMA_DELETE_ENFORCED_GUARDRAIL_CONFIGURATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListEnforcedGuardrailsConfigurationInput: - """Dataclass for ListEnforcedGuardrailsConfigurationInput structure.""" - - next_token: str | None = None - """Opaque continuation token of previous paginated response.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_LIST_ENFORCED_GUARDRAILS_CONFIGURATION_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_ENFORCED_GUARDRAILS_CONFIGURATION_INPUT.members[ - "nextToken" - ], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_ENFORCED_GUARDRAILS_CONFIGURATION_INPUT.members[ - "nextToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_ENFORCED_GUARDRAILS_CONFIGURATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ListEnforcedGuardrailsConfigurationOutput: - """Dataclass for ListEnforcedGuardrailsConfigurationOutput structure.""" - - guardrails_config: list[AccountEnforcedGuardrailOutputConfiguration] - """Array of AccountEnforcedGuardrailOutputConfiguration objects.""" - - next_token: str | None = None - """Opaque continuation token of previous paginated response.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_LIST_ENFORCED_GUARDRAILS_CONFIGURATION_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_account_enforced_guardrails_output_configuration( - serializer, - _SCHEMA_LIST_ENFORCED_GUARDRAILS_CONFIGURATION_OUTPUT.members[ - "guardrailsConfig" - ], - self.guardrails_config, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_ENFORCED_GUARDRAILS_CONFIGURATION_OUTPUT.members[ - "nextToken" - ], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["guardrails_config"] = ( - _deserialize_account_enforced_guardrails_output_configuration( - de, - _SCHEMA_LIST_ENFORCED_GUARDRAILS_CONFIGURATION_OUTPUT.members[ - "guardrailsConfig" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_ENFORCED_GUARDRAILS_CONFIGURATION_OUTPUT.members[ - "nextToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_ENFORCED_GUARDRAILS_CONFIGURATION_OUTPUT, consumer=_consumer - ) - if "guardrails_config" not in kwargs: - kwargs["guardrails_config"] = [] - return kwargs - - -LIST_ENFORCED_GUARDRAILS_CONFIGURATION = APIOperation( - input=ListEnforcedGuardrailsConfigurationInput, - output=ListEnforcedGuardrailsConfigurationOutput, - schema=_SCHEMA_LIST_ENFORCED_GUARDRAILS_CONFIGURATION, - input_schema=_SCHEMA_LIST_ENFORCED_GUARDRAILS_CONFIGURATION_INPUT, - output_schema=_SCHEMA_LIST_ENFORCED_GUARDRAILS_CONFIGURATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class PutEnforcedGuardrailConfigurationInput: - """Dataclass for PutEnforcedGuardrailConfigurationInput structure.""" - - config_id: str | None = None - """Unique ID for the account enforced configuration.""" - - guardrail_inference_config: ( - AccountEnforcedGuardrailInferenceInputConfiguration | None - ) = None - """Account-level enforced guardrail input configuration.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_PUT_ENFORCED_GUARDRAIL_CONFIGURATION_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.config_id is not None: - serializer.write_string( - _SCHEMA_PUT_ENFORCED_GUARDRAIL_CONFIGURATION_INPUT.members["configId"], - self.config_id, - ) - - if self.guardrail_inference_config is not None: - serializer.write_struct( - _SCHEMA_PUT_ENFORCED_GUARDRAIL_CONFIGURATION_INPUT.members[ - "guardrailInferenceConfig" - ], - self.guardrail_inference_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["config_id"] = de.read_string( - _SCHEMA_PUT_ENFORCED_GUARDRAIL_CONFIGURATION_INPUT.members[ - "configId" - ] - ) - - case 1: - kwargs["guardrail_inference_config"] = ( - AccountEnforcedGuardrailInferenceInputConfiguration.deserialize( - de - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PUT_ENFORCED_GUARDRAIL_CONFIGURATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class PutEnforcedGuardrailConfigurationOutput: - """Dataclass for PutEnforcedGuardrailConfigurationOutput structure.""" - - config_id: str | None = None - """Unique ID for the account enforced configuration.""" - - updated_at: datetime | None = None - """Timestamp.""" - - updated_by: str | None = None - """The ARN of the role used to update the configuration.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_PUT_ENFORCED_GUARDRAIL_CONFIGURATION_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.config_id is not None: - serializer.write_string( - _SCHEMA_PUT_ENFORCED_GUARDRAIL_CONFIGURATION_OUTPUT.members["configId"], - self.config_id, - ) - - if self.updated_at is not None: - serializer.write_timestamp( - _SCHEMA_PUT_ENFORCED_GUARDRAIL_CONFIGURATION_OUTPUT.members[ - "updatedAt" - ], - self.updated_at, - ) - - if self.updated_by is not None: - serializer.write_string( - _SCHEMA_PUT_ENFORCED_GUARDRAIL_CONFIGURATION_OUTPUT.members[ - "updatedBy" - ], - self.updated_by, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["config_id"] = de.read_string( - _SCHEMA_PUT_ENFORCED_GUARDRAIL_CONFIGURATION_OUTPUT.members[ - "configId" - ] - ) - - case 1: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_PUT_ENFORCED_GUARDRAIL_CONFIGURATION_OUTPUT.members[ - "updatedAt" - ] - ) - - case 2: - kwargs["updated_by"] = de.read_string( - _SCHEMA_PUT_ENFORCED_GUARDRAIL_CONFIGURATION_OUTPUT.members[ - "updatedBy" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PUT_ENFORCED_GUARDRAIL_CONFIGURATION_OUTPUT, consumer=_consumer - ) - return kwargs - - -PUT_ENFORCED_GUARDRAIL_CONFIGURATION = APIOperation( - input=PutEnforcedGuardrailConfigurationInput, - output=PutEnforcedGuardrailConfigurationOutput, - schema=_SCHEMA_PUT_ENFORCED_GUARDRAIL_CONFIGURATION, - input_schema=_SCHEMA_PUT_ENFORCED_GUARDRAIL_CONFIGURATION_INPUT, - output_schema=_SCHEMA_PUT_ENFORCED_GUARDRAIL_CONFIGURATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrock#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -def _serialize_evaluation_job_identifiers( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_evaluation_job_identifiers( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class BatchDeleteEvaluationJobInput: - """Dataclass for BatchDeleteEvaluationJobInput structure.""" - - job_identifiers: list[str] | None = None - """ - A list of one or more evaluation job Amazon Resource Names (ARNs) you - want to delete. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BATCH_DELETE_EVALUATION_JOB_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.job_identifiers is not None: - _serialize_evaluation_job_identifiers( - serializer, - _SCHEMA_BATCH_DELETE_EVALUATION_JOB_INPUT.members["jobIdentifiers"], - self.job_identifiers, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["job_identifiers"] = _deserialize_evaluation_job_identifiers( - de, - _SCHEMA_BATCH_DELETE_EVALUATION_JOB_INPUT.members[ - "jobIdentifiers" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_BATCH_DELETE_EVALUATION_JOB_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class BatchDeleteEvaluationJobError: - """ - A JSON array that provides the status of the evaluation jobs being - deleted. - """ - - job_identifier: str = field(repr=False) - """The ARN of the evaluation job being deleted.""" - - code: str - """A HTTP status code of the evaluation job being deleted.""" - - message: str | None = None - """A status message about the evaluation job deletion.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BATCH_DELETE_EVALUATION_JOB_ERROR, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_BATCH_DELETE_EVALUATION_JOB_ERROR.members["jobIdentifier"], - self.job_identifier, - ) - serializer.write_string( - _SCHEMA_BATCH_DELETE_EVALUATION_JOB_ERROR.members["code"], self.code - ) - if self.message is not None: - serializer.write_string( - _SCHEMA_BATCH_DELETE_EVALUATION_JOB_ERROR.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["job_identifier"] = de.read_string( - _SCHEMA_BATCH_DELETE_EVALUATION_JOB_ERROR.members[ - "jobIdentifier" - ] - ) - - case 1: - kwargs["code"] = de.read_string( - _SCHEMA_BATCH_DELETE_EVALUATION_JOB_ERROR.members["code"] - ) - - case 2: - kwargs["message"] = de.read_string( - _SCHEMA_BATCH_DELETE_EVALUATION_JOB_ERROR.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_BATCH_DELETE_EVALUATION_JOB_ERROR, consumer=_consumer - ) - if "job_identifier" not in kwargs: - kwargs["job_identifier"] = "" - if "code" not in kwargs: - kwargs["code"] = "" - return kwargs - - -def _serialize_batch_delete_evaluation_job_errors( - serializer: ShapeSerializer, - schema: Schema, - value: list[BatchDeleteEvaluationJobError], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_batch_delete_evaluation_job_errors( - deserializer: ShapeDeserializer, schema: Schema -) -> list[BatchDeleteEvaluationJobError]: - result: list[BatchDeleteEvaluationJobError] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(BatchDeleteEvaluationJobError.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class EvaluationJobStatus(UnknownEnumMixin, StrEnum): - IN_PROGRESS = "InProgress" - COMPLETED = "Completed" - FAILED = "Failed" - STOPPING = "Stopping" - STOPPED = "Stopped" - DELETING = "Deleting" - - -@dataclass(kw_only=True) -class BatchDeleteEvaluationJobItem: - """An evaluation job for deletion, and it's current status.""" - - job_identifier: str = field(repr=False) - """The Amazon Resource Name (ARN) of the evaluation job for deletion.""" - - job_status: str - """The status of the evaluation job for deletion.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BATCH_DELETE_EVALUATION_JOB_ITEM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_BATCH_DELETE_EVALUATION_JOB_ITEM.members["jobIdentifier"], - self.job_identifier, - ) - serializer.write_string( - _SCHEMA_BATCH_DELETE_EVALUATION_JOB_ITEM.members["jobStatus"], - self.job_status, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["job_identifier"] = de.read_string( - _SCHEMA_BATCH_DELETE_EVALUATION_JOB_ITEM.members[ - "jobIdentifier" - ] - ) - - case 1: - kwargs["job_status"] = EvaluationJobStatus( - de.read_string( - _SCHEMA_BATCH_DELETE_EVALUATION_JOB_ITEM.members[ - "jobStatus" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_BATCH_DELETE_EVALUATION_JOB_ITEM, consumer=_consumer - ) - if "job_identifier" not in kwargs: - kwargs["job_identifier"] = "" - if "job_status" not in kwargs: - kwargs["job_status"] = EvaluationJobStatus._corrected("") - return kwargs - - -def _serialize_batch_delete_evaluation_job_items( - serializer: ShapeSerializer, - schema: Schema, - value: list[BatchDeleteEvaluationJobItem], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_batch_delete_evaluation_job_items( - deserializer: ShapeDeserializer, schema: Schema -) -> list[BatchDeleteEvaluationJobItem]: - result: list[BatchDeleteEvaluationJobItem] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(BatchDeleteEvaluationJobItem.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class BatchDeleteEvaluationJobOutput: - """Dataclass for BatchDeleteEvaluationJobOutput structure.""" - - errors: list[BatchDeleteEvaluationJobError] - """ - A JSON object containing the HTTP status codes and the ARNs of - evaluation jobs that failed to be deleted. - """ - - evaluation_jobs: list[BatchDeleteEvaluationJobItem] - """The list of evaluation jobs for deletion.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BATCH_DELETE_EVALUATION_JOB_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_batch_delete_evaluation_job_errors( - serializer, - _SCHEMA_BATCH_DELETE_EVALUATION_JOB_OUTPUT.members["errors"], - self.errors, - ) - _serialize_batch_delete_evaluation_job_items( - serializer, - _SCHEMA_BATCH_DELETE_EVALUATION_JOB_OUTPUT.members["evaluationJobs"], - self.evaluation_jobs, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["errors"] = _deserialize_batch_delete_evaluation_job_errors( - de, _SCHEMA_BATCH_DELETE_EVALUATION_JOB_OUTPUT.members["errors"] - ) - - case 1: - kwargs["evaluation_jobs"] = ( - _deserialize_batch_delete_evaluation_job_items( - de, - _SCHEMA_BATCH_DELETE_EVALUATION_JOB_OUTPUT.members[ - "evaluationJobs" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_BATCH_DELETE_EVALUATION_JOB_OUTPUT, consumer=_consumer - ) - if "errors" not in kwargs: - kwargs["errors"] = [] - if "evaluation_jobs" not in kwargs: - kwargs["evaluation_jobs"] = [] - return kwargs - - -BATCH_DELETE_EVALUATION_JOB = APIOperation( - input=BatchDeleteEvaluationJobInput, - output=BatchDeleteEvaluationJobOutput, - schema=_SCHEMA_BATCH_DELETE_EVALUATION_JOB, - input_schema=_SCHEMA_BATCH_DELETE_EVALUATION_JOB_INPUT, - output_schema=_SCHEMA_BATCH_DELETE_EVALUATION_JOB_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrock#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class ApplicationType(UnknownEnumMixin, StrEnum): - MODEL_EVALUATION = "ModelEvaluation" - RAG_EVALUATION = "RagEvaluation" - - -@dataclass -class RatingScaleItemValueStringValue: - """ - A string representing the value for a rating in a custom metric rating - scale. - """ - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RATING_SCALE_ITEM_VALUE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_RATING_SCALE_ITEM_VALUE.members["stringValue"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string( - _SCHEMA_RATING_SCALE_ITEM_VALUE.members["stringValue"] - ) - ) - - -@dataclass -class RatingScaleItemValueFloatValue: - """ - A floating point number representing the value for a rating in a custom - metric rating scale. - """ - - value: float - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RATING_SCALE_ITEM_VALUE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_float( - _SCHEMA_RATING_SCALE_ITEM_VALUE.members["floatValue"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_float( - _SCHEMA_RATING_SCALE_ITEM_VALUE.members["floatValue"] - ) - ) - - -@dataclass -class RatingScaleItemValueUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -RatingScaleItemValue = Union[ - RatingScaleItemValueStringValue - | RatingScaleItemValueFloatValue - | RatingScaleItemValueUnknown -] -"""Defines the value for one rating in a custom metric rating scale.""" - - -class _RatingScaleItemValueDeserializer: - _result: RatingScaleItemValue | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> RatingScaleItemValue: - self._result = None - deserializer.read_struct(_SCHEMA_RATING_SCALE_ITEM_VALUE, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(RatingScaleItemValueStringValue.deserialize(de)) - - case 1: - self._set_result(RatingScaleItemValueFloatValue.deserialize(de)) - - case _: - self._set_result( - RatingScaleItemValueUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: RatingScaleItemValue) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class RatingScaleItem: - """ - Defines the value and corresponding definition for one rating in a - custom metric rating scale. - """ - - definition: str - """Defines the definition for one rating in a custom metric rating scale.""" - - value: RatingScaleItemValue - """Defines the value for one rating in a custom metric rating scale.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RATING_SCALE_ITEM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_RATING_SCALE_ITEM.members["definition"], self.definition - ) - serializer.write_struct(_SCHEMA_RATING_SCALE_ITEM.members["value"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["definition"] = de.read_string( - _SCHEMA_RATING_SCALE_ITEM.members["definition"] - ) - - case 1: - kwargs["value"] = _RatingScaleItemValueDeserializer().deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RATING_SCALE_ITEM, consumer=_consumer) - if "definition" not in kwargs: - kwargs["definition"] = "" - if "value" not in kwargs: - kwargs["value"] = RatingScaleItemValueUnknown(tag="") - return kwargs - - -def _serialize_rating_scale( - serializer: ShapeSerializer, schema: Schema, value: list[RatingScaleItem] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_rating_scale( - deserializer: ShapeDeserializer, schema: Schema -) -> list[RatingScaleItem]: - result: list[RatingScaleItem] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(RatingScaleItem.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CustomMetricDefinition: - """ - The definition of a custom metric for use in an Amazon Bedrock - evaluation job. A custom metric definition includes a metric name, - prompt (instructions) and optionally, a rating scale. Your prompt must - include a task description and input variables. The required input - variables are different for model-as-a-judge and RAG evaluations. - - For more information about how to define a custom metric in Amazon - Bedrock, see [Create a prompt for a custom metrics (LLM-as-a-judge model - evaluations)](https://docs.aws.amazon.com/bedrock/latest/userguide/model-evaluation-custom-metrics-prompt-formats.html) - and [Create a prompt for a custom metrics (RAG - evaluations)](https://docs.aws.amazon.com/bedrock/latest/userguide/kb-evaluation-custom-metrics-prompt-formats.html). - """ - - name: str = field(repr=False) - """ - The name for a custom metric. Names must be unique in your Amazon Web - Services region. - """ - - instructions: str - """ - The prompt for a custom metric that instructs the evaluator model how to - rate the model or RAG source under evaluation. - """ - - rating_scale: list[RatingScaleItem] | None = None - """ - Defines the rating scale to be used for a custom metric. We recommend - that you always define a ratings scale when creating a custom metric. If - you don't define a scale, Amazon Bedrock won't be able to visually - display the results of the evaluation in the console or calculate - average values of numerical scores. For more information on specifying a - rating scale, see [Specifying an output schema (rating - scale)](https://docs.aws.amazon.com/bedrock/latest/userguide/model-evaluation-custom-metrics-prompt-formats.html#model-evaluation-custom-metrics-prompt-formats-schema). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOM_METRIC_DEFINITION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CUSTOM_METRIC_DEFINITION.members["name"], self.name - ) - serializer.write_string( - _SCHEMA_CUSTOM_METRIC_DEFINITION.members["instructions"], self.instructions - ) - if self.rating_scale is not None: - _serialize_rating_scale( - serializer, - _SCHEMA_CUSTOM_METRIC_DEFINITION.members["ratingScale"], - self.rating_scale, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_CUSTOM_METRIC_DEFINITION.members["name"] - ) - - case 1: - kwargs["instructions"] = de.read_string( - _SCHEMA_CUSTOM_METRIC_DEFINITION.members["instructions"] - ) - - case 2: - kwargs["rating_scale"] = _deserialize_rating_scale( - de, _SCHEMA_CUSTOM_METRIC_DEFINITION.members["ratingScale"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CUSTOM_METRIC_DEFINITION, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "instructions" not in kwargs: - kwargs["instructions"] = "" - return kwargs - - -@dataclass -class AutomatedEvaluationCustomMetricSourceCustomMetricDefinition: - """ - The definition of a custom metric for use in an Amazon Bedrock - evaluation job. - """ - - value: CustomMetricDefinition - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_EVALUATION_CUSTOM_METRIC_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTOMATED_EVALUATION_CUSTOM_METRIC_SOURCE.members[ - "customMetricDefinition" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=CustomMetricDefinition.deserialize(deserializer)) - - -@dataclass -class AutomatedEvaluationCustomMetricSourceUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -AutomatedEvaluationCustomMetricSource = Union[ - AutomatedEvaluationCustomMetricSourceCustomMetricDefinition - | AutomatedEvaluationCustomMetricSourceUnknown -] -""" -An array item definining a single custom metric for use in an Amazon -Bedrock evaluation job. -""" - - -class _AutomatedEvaluationCustomMetricSourceDeserializer: - _result: AutomatedEvaluationCustomMetricSource | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> AutomatedEvaluationCustomMetricSource: - self._result = None - deserializer.read_struct( - _SCHEMA_AUTOMATED_EVALUATION_CUSTOM_METRIC_SOURCE, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - AutomatedEvaluationCustomMetricSourceCustomMetricDefinition.deserialize( - de - ) - ) - - case _: - self._set_result( - AutomatedEvaluationCustomMetricSourceUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: AutomatedEvaluationCustomMetricSource) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_automated_evaluation_custom_metrics( - serializer: ShapeSerializer, - schema: Schema, - value: list[AutomatedEvaluationCustomMetricSource], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_automated_evaluation_custom_metrics( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AutomatedEvaluationCustomMetricSource]: - result: list[AutomatedEvaluationCustomMetricSource] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append( - _AutomatedEvaluationCustomMetricSourceDeserializer().deserialize(d) - ) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CustomMetricBedrockEvaluatorModel: - """ - Defines the model you want to evaluate custom metrics in an Amazon - Bedrock evaluation job. - """ - - model_identifier: str - """ - The Amazon Resource Name (ARN) of the evaluator model for custom - metrics. For a list of supported evaluator models, see [Evaluate model - performance using another LLM as a - judge](https://docs.aws.amazon.com/bedrock/latest/userguide/evaluation-judge.html) - and [Evaluate the performance of RAG sources using Amazon Bedrock - evaluations](https://docs.aws.amazon.com/bedrock/latest/userguide/evaluation-kb.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOM_METRIC_BEDROCK_EVALUATOR_MODEL, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CUSTOM_METRIC_BEDROCK_EVALUATOR_MODEL.members["modelIdentifier"], - self.model_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_identifier"] = de.read_string( - _SCHEMA_CUSTOM_METRIC_BEDROCK_EVALUATOR_MODEL.members[ - "modelIdentifier" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CUSTOM_METRIC_BEDROCK_EVALUATOR_MODEL, consumer=_consumer - ) - if "model_identifier" not in kwargs: - kwargs["model_identifier"] = "" - return kwargs - - -def _serialize_custom_metric_bedrock_evaluator_models( - serializer: ShapeSerializer, - schema: Schema, - value: list[CustomMetricBedrockEvaluatorModel], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_custom_metric_bedrock_evaluator_models( - deserializer: ShapeDeserializer, schema: Schema -) -> list[CustomMetricBedrockEvaluatorModel]: - result: list[CustomMetricBedrockEvaluatorModel] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(CustomMetricBedrockEvaluatorModel.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CustomMetricEvaluatorModelConfig: - """ - Configuration of the evaluator model you want to use to evaluate custom - metrics in an Amazon Bedrock evaluation job. - """ - - bedrock_evaluator_models: list[CustomMetricBedrockEvaluatorModel] - """ - Defines the model you want to evaluate custom metrics in an Amazon - Bedrock evaluation job. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOM_METRIC_EVALUATOR_MODEL_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_custom_metric_bedrock_evaluator_models( - serializer, - _SCHEMA_CUSTOM_METRIC_EVALUATOR_MODEL_CONFIG.members[ - "bedrockEvaluatorModels" - ], - self.bedrock_evaluator_models, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bedrock_evaluator_models"] = ( - _deserialize_custom_metric_bedrock_evaluator_models( - de, - _SCHEMA_CUSTOM_METRIC_EVALUATOR_MODEL_CONFIG.members[ - "bedrockEvaluatorModels" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CUSTOM_METRIC_EVALUATOR_MODEL_CONFIG, consumer=_consumer - ) - if "bedrock_evaluator_models" not in kwargs: - kwargs["bedrock_evaluator_models"] = [] - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(bedrock_evaluator_models=[]) - - -@dataclass(kw_only=True) -class AutomatedEvaluationCustomMetricConfig: - """ - Defines the configuration of custom metrics to be used in an evaluation - job. To learn more about using custom metrics in Amazon Bedrock - evaluation jobs, see [Create a prompt for a custom metrics - (LLM-as-a-judge model - evaluations)](https://docs.aws.amazon.com/bedrock/latest/userguide/model-evaluation-custom-metrics-prompt-formats.html) - and [Create a prompt for a custom metrics (RAG - evaluations)](https://docs.aws.amazon.com/bedrock/latest/userguide/kb-evaluation-custom-metrics-prompt-formats.html). - """ - - custom_metrics: list[AutomatedEvaluationCustomMetricSource] - """ - Defines a list of custom metrics to be used in an Amazon Bedrock - evaluation job. - """ - - evaluator_model_config: CustomMetricEvaluatorModelConfig - """ - Configuration of the evaluator model you want to use to evaluate custom - metrics in an Amazon Bedrock evaluation job. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_EVALUATION_CUSTOM_METRIC_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_automated_evaluation_custom_metrics( - serializer, - _SCHEMA_AUTOMATED_EVALUATION_CUSTOM_METRIC_CONFIG.members["customMetrics"], - self.custom_metrics, - ) - serializer.write_struct( - _SCHEMA_AUTOMATED_EVALUATION_CUSTOM_METRIC_CONFIG.members[ - "evaluatorModelConfig" - ], - self.evaluator_model_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["custom_metrics"] = ( - _deserialize_automated_evaluation_custom_metrics( - de, - _SCHEMA_AUTOMATED_EVALUATION_CUSTOM_METRIC_CONFIG.members[ - "customMetrics" - ], - ) - ) - - case 1: - kwargs["evaluator_model_config"] = ( - CustomMetricEvaluatorModelConfig.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_EVALUATION_CUSTOM_METRIC_CONFIG, consumer=_consumer - ) - if "custom_metrics" not in kwargs: - kwargs["custom_metrics"] = [] - if "evaluator_model_config" not in kwargs: - kwargs["evaluator_model_config"] = ( - CustomMetricEvaluatorModelConfig._smithy_default() - ) - return kwargs - - -@dataclass -class EvaluationDatasetLocationS3Uri: - """The S3 URI of the S3 bucket specified in the job.""" - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVALUATION_DATASET_LOCATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_EVALUATION_DATASET_LOCATION.members["s3Uri"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string( - _SCHEMA_EVALUATION_DATASET_LOCATION.members["s3Uri"] - ) - ) - - -@dataclass -class EvaluationDatasetLocationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -EvaluationDatasetLocation = Union[ - EvaluationDatasetLocationS3Uri | EvaluationDatasetLocationUnknown -] -"""The location in Amazon S3 where your prompt dataset is stored.""" - - -class _EvaluationDatasetLocationDeserializer: - _result: EvaluationDatasetLocation | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> EvaluationDatasetLocation: - self._result = None - deserializer.read_struct(_SCHEMA_EVALUATION_DATASET_LOCATION, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(EvaluationDatasetLocationS3Uri.deserialize(de)) - - case _: - self._set_result( - EvaluationDatasetLocationUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: EvaluationDatasetLocation) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class EvaluationDataset: - """ - Used to specify the name of a built-in prompt dataset and optionally, - the Amazon S3 bucket where a custom prompt dataset is saved. - """ - - name: str = field(repr=False) - """ - Used to specify supported built-in prompt datasets. Valid values are - `Builtin.Bold`, `Builtin.BoolQ`, `Builtin.NaturalQuestions`, - `Builtin.Gigaword`, `Builtin.RealToxicityPrompts`, `Builtin.TriviaQA`, - `Builtin.T-Rex`, `Builtin.WomensEcommerceClothingReviews` and - `Builtin.Wikitext2`. - """ - - dataset_location: EvaluationDatasetLocation | None = None - """ - For custom prompt datasets, you must specify the location in Amazon S3 - where the prompt dataset is saved. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVALUATION_DATASET, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_EVALUATION_DATASET.members["name"], self.name) - if self.dataset_location is not None: - serializer.write_struct( - _SCHEMA_EVALUATION_DATASET.members["datasetLocation"], - self.dataset_location, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_EVALUATION_DATASET.members["name"] - ) - - case 1: - kwargs["dataset_location"] = ( - _EvaluationDatasetLocationDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EVALUATION_DATASET, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(name="") - - -def _serialize_evaluation_metric_names( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_evaluation_metric_names( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -class EvaluationTaskType(UnknownEnumMixin, StrEnum): - SUMMARIZATION = "Summarization" - CLASSIFICATION = "Classification" - QUESTION_AND_ANSWER = "QuestionAndAnswer" - GENERATION = "Generation" - CUSTOM = "Custom" - - -@dataclass(kw_only=True) -class EvaluationDatasetMetricConfig: - """ - Defines the prompt datasets, built-in metric names and custom metric - names, and the task type. - """ - - task_type: str - """ - The the type of task you want to evaluate for your evaluation job. This - applies only to model evaluation jobs and is ignored for knowledge base - evaluation jobs. - """ - - dataset: EvaluationDataset - """Specifies the prompt dataset.""" - - metric_names: list[str] - """ - The names of the metrics you want to use for your evaluation job. - - For knowledge base evaluation jobs that evaluate retrieval only, valid - values are \"`Builtin.ContextRelevance`\", - \"`Builtin.ContextCoverage`\". - - For knowledge base evaluation jobs that evaluate retrieval with response - generation, valid values are \"`Builtin.Correctness`\", - \"`Builtin.Completeness`\", \"`Builtin.Helpfulness`\", - \"`Builtin.LogicalCoherence`\", \"`Builtin.Faithfulness`\", - \"`Builtin.Harmfulness`\", \"`Builtin.Stereotyping`\", - \"`Builtin.Refusal`\". - - For automated model evaluation jobs, valid values are - \"`Builtin.Accuracy`\", \"`Builtin.Robustness`\", and - \"`Builtin.Toxicity`\". In model evaluation jobs that use a LLM as judge - you can specify \"`Builtin.Correctness`\", \"`Builtin.Completeness"`, - \"`Builtin.Faithfulness"`, \"`Builtin.Helpfulness`\", - \"`Builtin.Coherence`\", \"`Builtin.Relevance`\", - \"`Builtin.FollowingInstructions`\", - \"`Builtin.ProfessionalStyleAndTone`\", You can also specify the - following responsible AI related metrics only for model evaluation job - that use a LLM as judge \"`Builtin.Harmfulness`\", - \"`Builtin.Stereotyping`\", and \"`Builtin.Refusal`\". - - For human-based model evaluation jobs, the list of strings must match - the `name` parameter specified in `HumanEvaluationCustomMetric`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVALUATION_DATASET_METRIC_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_EVALUATION_DATASET_METRIC_CONFIG.members["taskType"], self.task_type - ) - serializer.write_struct( - _SCHEMA_EVALUATION_DATASET_METRIC_CONFIG.members["dataset"], self.dataset - ) - _serialize_evaluation_metric_names( - serializer, - _SCHEMA_EVALUATION_DATASET_METRIC_CONFIG.members["metricNames"], - self.metric_names, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["task_type"] = EvaluationTaskType( - de.read_string( - _SCHEMA_EVALUATION_DATASET_METRIC_CONFIG.members["taskType"] - ) - ) - - case 1: - kwargs["dataset"] = EvaluationDataset.deserialize(de) - - case 2: - kwargs["metric_names"] = _deserialize_evaluation_metric_names( - de, - _SCHEMA_EVALUATION_DATASET_METRIC_CONFIG.members["metricNames"], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EVALUATION_DATASET_METRIC_CONFIG, consumer=_consumer - ) - if "task_type" not in kwargs: - kwargs["task_type"] = EvaluationTaskType._corrected("") - if "dataset" not in kwargs: - kwargs["dataset"] = EvaluationDataset._smithy_default() - if "metric_names" not in kwargs: - kwargs["metric_names"] = [] - return kwargs - - -def _serialize_evaluation_dataset_metric_configs( - serializer: ShapeSerializer, - schema: Schema, - value: list[EvaluationDatasetMetricConfig], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_evaluation_dataset_metric_configs( - deserializer: ShapeDeserializer, schema: Schema -) -> list[EvaluationDatasetMetricConfig]: - result: list[EvaluationDatasetMetricConfig] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(EvaluationDatasetMetricConfig.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class BedrockEvaluatorModel: - """ - The evaluator model used in knowledge base evaluation job or in model - evaluation job that use a model as judge. This model computes all - evaluation related metrics. - """ - - model_identifier: str - """ - The Amazon Resource Name (ARN) of the evaluator model used used in - knowledge base evaluation job or in model evaluation job that use a - model as judge. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BEDROCK_EVALUATOR_MODEL, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_BEDROCK_EVALUATOR_MODEL.members["modelIdentifier"], - self.model_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_identifier"] = de.read_string( - _SCHEMA_BEDROCK_EVALUATOR_MODEL.members["modelIdentifier"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BEDROCK_EVALUATOR_MODEL, consumer=_consumer) - if "model_identifier" not in kwargs: - kwargs["model_identifier"] = "" - return kwargs - - -def _serialize_bedrock_evaluator_models( - serializer: ShapeSerializer, schema: Schema, value: list[BedrockEvaluatorModel] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_bedrock_evaluator_models( - deserializer: ShapeDeserializer, schema: Schema -) -> list[BedrockEvaluatorModel]: - result: list[BedrockEvaluatorModel] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(BedrockEvaluatorModel.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass -class EvaluatorModelConfigBedrockEvaluatorModels: - """ - The evaluator model used in knowledge base evaluation job or in model - evaluation job that use a model as judge. This model computes all - evaluation related metrics. - """ - - value: list[BedrockEvaluatorModel] - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVALUATOR_MODEL_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_bedrock_evaluator_models( - serializer, - _SCHEMA_EVALUATOR_MODEL_CONFIG.members["bedrockEvaluatorModels"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_deserialize_bedrock_evaluator_models( - deserializer, - _SCHEMA_EVALUATOR_MODEL_CONFIG.members["bedrockEvaluatorModels"], - ) - ) - - -@dataclass -class EvaluatorModelConfigUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -EvaluatorModelConfig = Union[ - EvaluatorModelConfigBedrockEvaluatorModels | EvaluatorModelConfigUnknown -] -""" -Specifies the model configuration for the evaluator model. -`EvaluatorModelConfig` is required for evaluation jobs that use a -knowledge base or in model evaluation job that use a model as judge. -This model computes all evaluation related metrics. -""" - - -class _EvaluatorModelConfigDeserializer: - _result: EvaluatorModelConfig | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> EvaluatorModelConfig: - self._result = None - deserializer.read_struct(_SCHEMA_EVALUATOR_MODEL_CONFIG, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - EvaluatorModelConfigBedrockEvaluatorModels.deserialize(de) - ) - - case _: - self._set_result( - EvaluatorModelConfigUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: EvaluatorModelConfig) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class AutomatedEvaluationConfig: - """ - The configuration details of an automated evaluation job. The - `EvaluationDatasetMetricConfig` object is used to specify the prompt - datasets, task type, and metric names. - """ - - dataset_metric_configs: list[EvaluationDatasetMetricConfig] - """ - Configuration details of the prompt datasets and metrics you want to use - for your evaluation job. - """ - - evaluator_model_config: EvaluatorModelConfig | None = None - """ - Contains the evaluator model configuration details. - `EvaluatorModelConfig` is required for evaluation jobs that use a - knowledge base or in model evaluation job that use a model as judge. - This model computes all evaluation related metrics. - """ - - custom_metric_config: AutomatedEvaluationCustomMetricConfig | None = None - """ - Defines the configuration of custom metrics to be used in an evaluation - job. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOMATED_EVALUATION_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_evaluation_dataset_metric_configs( - serializer, - _SCHEMA_AUTOMATED_EVALUATION_CONFIG.members["datasetMetricConfigs"], - self.dataset_metric_configs, - ) - if self.evaluator_model_config is not None: - serializer.write_struct( - _SCHEMA_AUTOMATED_EVALUATION_CONFIG.members["evaluatorModelConfig"], - self.evaluator_model_config, - ) - - if self.custom_metric_config is not None: - serializer.write_struct( - _SCHEMA_AUTOMATED_EVALUATION_CONFIG.members["customMetricConfig"], - self.custom_metric_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["dataset_metric_configs"] = ( - _deserialize_evaluation_dataset_metric_configs( - de, - _SCHEMA_AUTOMATED_EVALUATION_CONFIG.members[ - "datasetMetricConfigs" - ], - ) - ) - - case 1: - kwargs["evaluator_model_config"] = ( - _EvaluatorModelConfigDeserializer().deserialize(de) - ) - - case 2: - kwargs["custom_metric_config"] = ( - AutomatedEvaluationCustomMetricConfig.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOMATED_EVALUATION_CONFIG, consumer=_consumer - ) - if "dataset_metric_configs" not in kwargs: - kwargs["dataset_metric_configs"] = [] - return kwargs - - -@dataclass(kw_only=True) -class HumanEvaluationCustomMetric: - """ - In a model evaluation job that uses human workers you must define the - name of the metric, and how you want that metric rated `ratingMethod`, - and an optional description of the metric. - """ - - name: str = field(repr=False) - """ - The name of the metric. Your human evaluators will see this name in the - evaluation UI. - """ - - rating_method: str - """ - Choose how you want your human workers to evaluation your model. Valid - values for rating methods are `ThumbsUpDown`, - `IndividualLikertScale`,`ComparisonLikertScale`, `ComparisonChoice`, and - `ComparisonRank` - """ - - description: str | None = field(repr=False, default=None) - """ - An optional description of the metric. Use this parameter to provide - more details about the metric. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HUMAN_EVALUATION_CUSTOM_METRIC, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HUMAN_EVALUATION_CUSTOM_METRIC.members["name"], self.name - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_HUMAN_EVALUATION_CUSTOM_METRIC.members["description"], - self.description, - ) - - serializer.write_string( - _SCHEMA_HUMAN_EVALUATION_CUSTOM_METRIC.members["ratingMethod"], - self.rating_method, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_HUMAN_EVALUATION_CUSTOM_METRIC.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_HUMAN_EVALUATION_CUSTOM_METRIC.members["description"] - ) - - case 2: - kwargs["rating_method"] = de.read_string( - _SCHEMA_HUMAN_EVALUATION_CUSTOM_METRIC.members["ratingMethod"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_HUMAN_EVALUATION_CUSTOM_METRIC, consumer=_consumer - ) - if "name" not in kwargs: - kwargs["name"] = "" - if "rating_method" not in kwargs: - kwargs["rating_method"] = "" - return kwargs - - -def _serialize_human_evaluation_custom_metrics( - serializer: ShapeSerializer, - schema: Schema, - value: list[HumanEvaluationCustomMetric], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_human_evaluation_custom_metrics( - deserializer: ShapeDeserializer, schema: Schema -) -> list[HumanEvaluationCustomMetric]: - result: list[HumanEvaluationCustomMetric] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(HumanEvaluationCustomMetric.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class HumanWorkflowConfig: - """ - Contains `SageMakerFlowDefinition` object. The object is used to specify - the prompt dataset, task type, rating method and metric names. - """ - - flow_definition_arn: str - """The Amazon Resource Number (ARN) for the flow definition""" - - instructions: str | None = field(repr=False, default=None) - """Instructions for the flow definition""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HUMAN_WORKFLOW_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_HUMAN_WORKFLOW_CONFIG.members["flowDefinitionArn"], - self.flow_definition_arn, - ) - if self.instructions is not None: - serializer.write_string( - _SCHEMA_HUMAN_WORKFLOW_CONFIG.members["instructions"], self.instructions - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["flow_definition_arn"] = de.read_string( - _SCHEMA_HUMAN_WORKFLOW_CONFIG.members["flowDefinitionArn"] - ) - - case 1: - kwargs["instructions"] = de.read_string( - _SCHEMA_HUMAN_WORKFLOW_CONFIG.members["instructions"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_HUMAN_WORKFLOW_CONFIG, consumer=_consumer) - if "flow_definition_arn" not in kwargs: - kwargs["flow_definition_arn"] = "" - return kwargs - - -@dataclass(kw_only=True) -class HumanEvaluationConfig: - """ - Specifies the custom metrics, how tasks will be rated, the flow - definition ARN, and your custom prompt datasets. Model evaluation jobs - use human workers *only* support the use of custom prompt datasets. To - learn more about custom prompt datasets and the required format, see - [Custom prompt - datasets](https://docs.aws.amazon.com/bedrock/latest/userguide/model-evaluation-prompt-datasets-custom.html). - - When you create custom metrics in `HumanEvaluationCustomMetric` you must - specify the metric's `name`. The list of `names` specified in the - `HumanEvaluationCustomMetric` array, must match the `metricNames` array - of strings specified in `EvaluationDatasetMetricConfig`. For example, if - in the `HumanEvaluationCustomMetric` array your specified the names - `"accuracy", "toxicity", "readability"` as custom metrics *then* the - `metricNames` array would need to look like the following - `["accuracy", "toxicity", "readability"]` in - `EvaluationDatasetMetricConfig`. - """ - - dataset_metric_configs: list[EvaluationDatasetMetricConfig] - """ - Use to specify the metrics, task, and prompt dataset to be used in your - model evaluation job. - """ - - human_workflow_config: HumanWorkflowConfig | None = None - """The parameters of the human workflow.""" - - custom_metrics: list[HumanEvaluationCustomMetric] | None = None - """ - A `HumanEvaluationCustomMetric` object. It contains the names the - metrics, how the metrics are to be evaluated, an optional description. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HUMAN_EVALUATION_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.human_workflow_config is not None: - serializer.write_struct( - _SCHEMA_HUMAN_EVALUATION_CONFIG.members["humanWorkflowConfig"], - self.human_workflow_config, - ) - - if self.custom_metrics is not None: - _serialize_human_evaluation_custom_metrics( - serializer, - _SCHEMA_HUMAN_EVALUATION_CONFIG.members["customMetrics"], - self.custom_metrics, - ) - - _serialize_evaluation_dataset_metric_configs( - serializer, - _SCHEMA_HUMAN_EVALUATION_CONFIG.members["datasetMetricConfigs"], - self.dataset_metric_configs, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["human_workflow_config"] = HumanWorkflowConfig.deserialize( - de - ) - - case 1: - kwargs["custom_metrics"] = ( - _deserialize_human_evaluation_custom_metrics( - de, _SCHEMA_HUMAN_EVALUATION_CONFIG.members["customMetrics"] - ) - ) - - case 2: - kwargs["dataset_metric_configs"] = ( - _deserialize_evaluation_dataset_metric_configs( - de, - _SCHEMA_HUMAN_EVALUATION_CONFIG.members[ - "datasetMetricConfigs" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_HUMAN_EVALUATION_CONFIG, consumer=_consumer) - if "dataset_metric_configs" not in kwargs: - kwargs["dataset_metric_configs"] = [] - return kwargs - - -@dataclass -class EvaluationConfigAutomated: - """ - Contains the configuration details of an automated evaluation job that - computes metrics. - """ - - value: AutomatedEvaluationConfig - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVALUATION_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_EVALUATION_CONFIG.members["automated"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=AutomatedEvaluationConfig.deserialize(deserializer)) - - -@dataclass -class EvaluationConfigHuman: - """ - Contains the configuration details of an evaluation job that uses human - workers. - """ - - value: HumanEvaluationConfig - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVALUATION_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVALUATION_CONFIG.members["human"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HumanEvaluationConfig.deserialize(deserializer)) - - -@dataclass -class EvaluationConfigUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -EvaluationConfig = Union[ - EvaluationConfigAutomated | EvaluationConfigHuman | EvaluationConfigUnknown -] -""" -The configuration details of either an automated or human-based -evaluation job. -""" - - -class _EvaluationConfigDeserializer: - _result: EvaluationConfig | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> EvaluationConfig: - self._result = None - deserializer.read_struct(_SCHEMA_EVALUATION_CONFIG, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(EvaluationConfigAutomated.deserialize(de)) - - case 1: - self._set_result(EvaluationConfigHuman.deserialize(de)) - - case _: - self._set_result( - EvaluationConfigUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: EvaluationConfig) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class PerformanceConfigLatency(UnknownEnumMixin, StrEnum): - STANDARD = "standard" - OPTIMIZED = "optimized" - - -@dataclass(kw_only=True) -class PerformanceConfiguration: - """Contains performance settings for a model.""" - - latency: str | None = None - """ - Specifies whether to use the latency-optimized or standard version of a - model or inference profile. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PERFORMANCE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.latency is not None: - serializer.write_string( - _SCHEMA_PERFORMANCE_CONFIGURATION.members["latency"], self.latency - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["latency"] = PerformanceConfigLatency( - de.read_string( - _SCHEMA_PERFORMANCE_CONFIGURATION.members["latency"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PERFORMANCE_CONFIGURATION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class EvaluationBedrockModel: - """ - Contains the ARN of the Amazon Bedrock model or [inference - profile](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html) - specified in your evaluation job. Each Amazon Bedrock model supports - different `inferenceParams`. To learn more about supported inference - parameters for Amazon Bedrock models, see [Inference parameters for - foundation - models](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). - - The `inferenceParams` are specified using JSON. To successfully insert - JSON as string make sure that all quotations are properly escaped. For - example, `"temperature":"0.25"` key value pair would need to be - formatted as `\"temperature\":\"0.25\"` to successfully accepted in the - request. - """ - - model_identifier: str - """The ARN of the Amazon Bedrock model or inference profile specified.""" - - inference_params: str = field(repr=False, default="{}") - """ - Each Amazon Bedrock support different inference parameters that change - how the model behaves during inference. - """ - - performance_config: PerformanceConfiguration | None = None - """Specifies performance settings for the model or inference profile.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVALUATION_BEDROCK_MODEL, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_EVALUATION_BEDROCK_MODEL.members["modelIdentifier"], - self.model_identifier, - ) - serializer.write_string( - _SCHEMA_EVALUATION_BEDROCK_MODEL.members["inferenceParams"], - self.inference_params, - ) - if self.performance_config is not None: - serializer.write_struct( - _SCHEMA_EVALUATION_BEDROCK_MODEL.members["performanceConfig"], - self.performance_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_identifier"] = de.read_string( - _SCHEMA_EVALUATION_BEDROCK_MODEL.members["modelIdentifier"] - ) - - case 1: - kwargs["inference_params"] = de.read_string( - _SCHEMA_EVALUATION_BEDROCK_MODEL.members["inferenceParams"] - ) - - case 2: - kwargs["performance_config"] = PerformanceConfiguration.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EVALUATION_BEDROCK_MODEL, consumer=_consumer) - if "model_identifier" not in kwargs: - kwargs["model_identifier"] = "" - return kwargs - - -@dataclass(kw_only=True) -class EvaluationPrecomputedInferenceSource: - """ - A summary of a model used for a model evaluation job where you provide - your own inference response data. - """ - - inference_source_identifier: str - """ - A label that identifies a model used in a model evaluation job where you - provide your own inference response data. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVALUATION_PRECOMPUTED_INFERENCE_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_EVALUATION_PRECOMPUTED_INFERENCE_SOURCE.members[ - "inferenceSourceIdentifier" - ], - self.inference_source_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["inference_source_identifier"] = de.read_string( - _SCHEMA_EVALUATION_PRECOMPUTED_INFERENCE_SOURCE.members[ - "inferenceSourceIdentifier" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EVALUATION_PRECOMPUTED_INFERENCE_SOURCE, consumer=_consumer - ) - if "inference_source_identifier" not in kwargs: - kwargs["inference_source_identifier"] = "" - return kwargs - - -@dataclass -class EvaluationModelConfigBedrockModel: - """ - Defines the Amazon Bedrock model or inference profile and inference - parameters you want used. - """ - - value: EvaluationBedrockModel - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVALUATION_MODEL_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_EVALUATION_MODEL_CONFIG.members["bedrockModel"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=EvaluationBedrockModel.deserialize(deserializer)) - - -@dataclass -class EvaluationModelConfigPrecomputedInferenceSource: - """ - Defines the model used to generate inference response data for a model - evaluation job where you provide your own inference response data. - """ - - value: EvaluationPrecomputedInferenceSource - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVALUATION_MODEL_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_EVALUATION_MODEL_CONFIG.members["precomputedInferenceSource"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=EvaluationPrecomputedInferenceSource.deserialize(deserializer)) - - -@dataclass -class EvaluationModelConfigUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -EvaluationModelConfig = Union[ - EvaluationModelConfigBedrockModel - | EvaluationModelConfigPrecomputedInferenceSource - | EvaluationModelConfigUnknown -] -"""Defines the models used in the model evaluation job.""" - - -class _EvaluationModelConfigDeserializer: - _result: EvaluationModelConfig | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> EvaluationModelConfig: - self._result = None - deserializer.read_struct(_SCHEMA_EVALUATION_MODEL_CONFIG, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(EvaluationModelConfigBedrockModel.deserialize(de)) - - case 1: - self._set_result( - EvaluationModelConfigPrecomputedInferenceSource.deserialize(de) - ) - - case _: - self._set_result( - EvaluationModelConfigUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: EvaluationModelConfig) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_evaluation_model_configs( - serializer: ShapeSerializer, schema: Schema, value: list[EvaluationModelConfig] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_evaluation_model_configs( - deserializer: ShapeDeserializer, schema: Schema -) -> list[EvaluationModelConfig]: - result: list[EvaluationModelConfig] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_EvaluationModelConfigDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GuardrailConfiguration: - """The configuration details for the guardrail.""" - - guardrail_id: str - """The unique identifier for the guardrail.""" - - guardrail_version: str - """The version of the guardrail.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GUARDRAIL_CONFIGURATION.members["guardrailId"], self.guardrail_id - ) - serializer.write_string( - _SCHEMA_GUARDRAIL_CONFIGURATION.members["guardrailVersion"], - self.guardrail_version, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["guardrail_id"] = de.read_string( - _SCHEMA_GUARDRAIL_CONFIGURATION.members["guardrailId"] - ) - - case 1: - kwargs["guardrail_version"] = de.read_string( - _SCHEMA_GUARDRAIL_CONFIGURATION.members["guardrailVersion"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GUARDRAIL_CONFIGURATION, consumer=_consumer) - if "guardrail_id" not in kwargs: - kwargs["guardrail_id"] = "" - if "guardrail_version" not in kwargs: - kwargs["guardrail_version"] = "" - return kwargs - - -def _serialize_rag_stop_sequences( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_rag_stop_sequences( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class TextInferenceConfig: - """ - The configuration details for text generation using a language model via - the `RetrieveAndGenerate` function. - """ - - temperature: float | None = None - """ - Controls the random-ness of text generated by the language model, - influencing how much the model sticks to the most predictable next words - versus exploring more surprising options. A lower temperature value - (e.g. 0.2 or 0.3) makes model outputs more deterministic or predictable, - while a higher temperature (e.g. 0.8 or 0.9) makes the outputs more - creative or unpredictable. - """ - - top_p: float | None = None - """ - A probability distribution threshold which controls what the model - considers for the set of possible next tokens. The model will only - consider the top p% of the probability distribution when generating the - next token. - """ - - max_tokens: int | None = None - """ - The maximum number of tokens to generate in the output text. Do not use - the minimum of 0 or the maximum of 65536. The limit values described - here are arbitrary values, for actual values consult the limits defined - by your specific model. - """ - - stop_sequences: list[str] | None = None - """ - A list of sequences of characters that, if generated, will cause the - model to stop generating further tokens. Do not use a minimum length of - 1 or a maximum length of 1000. The limit values described here are - arbitrary values, for actual values consult the limits defined by your - specific model. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TEXT_INFERENCE_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.temperature is not None: - serializer.write_float( - _SCHEMA_TEXT_INFERENCE_CONFIG.members["temperature"], self.temperature - ) - - if self.top_p is not None: - serializer.write_float( - _SCHEMA_TEXT_INFERENCE_CONFIG.members["topP"], self.top_p - ) - - if self.max_tokens is not None: - serializer.write_integer( - _SCHEMA_TEXT_INFERENCE_CONFIG.members["maxTokens"], self.max_tokens - ) - - if self.stop_sequences is not None: - _serialize_rag_stop_sequences( - serializer, - _SCHEMA_TEXT_INFERENCE_CONFIG.members["stopSequences"], - self.stop_sequences, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["temperature"] = de.read_float( - _SCHEMA_TEXT_INFERENCE_CONFIG.members["temperature"] - ) - - case 1: - kwargs["top_p"] = de.read_float( - _SCHEMA_TEXT_INFERENCE_CONFIG.members["topP"] - ) - - case 2: - kwargs["max_tokens"] = de.read_integer( - _SCHEMA_TEXT_INFERENCE_CONFIG.members["maxTokens"] - ) - - case 3: - kwargs["stop_sequences"] = _deserialize_rag_stop_sequences( - de, _SCHEMA_TEXT_INFERENCE_CONFIG.members["stopSequences"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TEXT_INFERENCE_CONFIG, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class KbInferenceConfig: - """ - Contains configuration details of the inference for knowledge base - retrieval and response generation. - """ - - text_inference_config: TextInferenceConfig | None = None - """ - Contains configuration details for text generation using a language - model via the `RetrieveAndGenerate` function. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KB_INFERENCE_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.text_inference_config is not None: - serializer.write_struct( - _SCHEMA_KB_INFERENCE_CONFIG.members["textInferenceConfig"], - self.text_inference_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["text_inference_config"] = TextInferenceConfig.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_KB_INFERENCE_CONFIG, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class PromptTemplate: - """ - The template for the prompt that's sent to the model for response - generation. - """ - - text_prompt_template: str | None = field(repr=False, default=None) - """ - The template for the prompt that's sent to the model for response - generation. You can include prompt placeholders, which become replaced - before the prompt is sent to the model to provide instructions and - context to the model. In addition, you can include XML tags to delineate - meaningful sections of the prompt template. - - For more information, see [Knowledge base prompt - template](https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html) - and [Use XML tags with Anthropic Claude - models](https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/use-xml-tags). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PROMPT_TEMPLATE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.text_prompt_template is not None: - serializer.write_string( - _SCHEMA_PROMPT_TEMPLATE.members["textPromptTemplate"], - self.text_prompt_template, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["text_prompt_template"] = de.read_string( - _SCHEMA_PROMPT_TEMPLATE.members["textPromptTemplate"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PROMPT_TEMPLATE, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ExternalSourcesGenerationConfiguration: - """ - The response generation configuration of the external source wrapper - object. - """ - - prompt_template: PromptTemplate | None = None - """ - Contains the template for the prompt for the external source wrapper - object. - """ - - guardrail_configuration: GuardrailConfiguration | None = None - """Configuration details for the guardrail.""" - - kb_inference_config: KbInferenceConfig | None = None - """ - Configuration details for inference when using `RetrieveAndGenerate` to - generate responses while using an external source. - """ - - additional_model_request_fields: dict[str, Document] | None = None - """ - Additional model parameters and their corresponding values not included - in the text inference configuration for an external source. Takes in - custom model parameters specific to the language model being used. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EXTERNAL_SOURCES_GENERATION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.prompt_template is not None: - serializer.write_struct( - _SCHEMA_EXTERNAL_SOURCES_GENERATION_CONFIGURATION.members[ - "promptTemplate" - ], - self.prompt_template, - ) - - if self.guardrail_configuration is not None: - serializer.write_struct( - _SCHEMA_EXTERNAL_SOURCES_GENERATION_CONFIGURATION.members[ - "guardrailConfiguration" - ], - self.guardrail_configuration, - ) - - if self.kb_inference_config is not None: - serializer.write_struct( - _SCHEMA_EXTERNAL_SOURCES_GENERATION_CONFIGURATION.members[ - "kbInferenceConfig" - ], - self.kb_inference_config, - ) - - if self.additional_model_request_fields is not None: - _serialize_additional_model_request_fields( - serializer, - _SCHEMA_EXTERNAL_SOURCES_GENERATION_CONFIGURATION.members[ - "additionalModelRequestFields" - ], - self.additional_model_request_fields, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["prompt_template"] = PromptTemplate.deserialize(de) - - case 1: - kwargs["guardrail_configuration"] = ( - GuardrailConfiguration.deserialize(de) - ) - - case 2: - kwargs["kb_inference_config"] = KbInferenceConfig.deserialize(de) - - case 3: - kwargs["additional_model_request_fields"] = ( - _deserialize_additional_model_request_fields( - de, - _SCHEMA_EXTERNAL_SOURCES_GENERATION_CONFIGURATION.members[ - "additionalModelRequestFields" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EXTERNAL_SOURCES_GENERATION_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ByteContentDoc: - """ - Contains the document contained in the wrapper object, along with its - attributes/fields. - """ - - identifier: str = field(repr=False) - """The file name of the document contained in the wrapper object.""" - - content_type: str - """The MIME type of the document contained in the wrapper object.""" - - data: bytes = field(repr=False) - """The byte value of the file to upload, encoded as a Base-64 string.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BYTE_CONTENT_DOC, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_BYTE_CONTENT_DOC.members["identifier"], self.identifier - ) - serializer.write_string( - _SCHEMA_BYTE_CONTENT_DOC.members["contentType"], self.content_type - ) - serializer.write_blob(_SCHEMA_BYTE_CONTENT_DOC.members["data"], self.data) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["identifier"] = de.read_string( - _SCHEMA_BYTE_CONTENT_DOC.members["identifier"] - ) - - case 1: - kwargs["content_type"] = de.read_string( - _SCHEMA_BYTE_CONTENT_DOC.members["contentType"] - ) - - case 2: - kwargs["data"] = de.read_blob( - _SCHEMA_BYTE_CONTENT_DOC.members["data"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BYTE_CONTENT_DOC, consumer=_consumer) - if "identifier" not in kwargs: - kwargs["identifier"] = "" - if "content_type" not in kwargs: - kwargs["content_type"] = "" - if "data" not in kwargs: - kwargs["data"] = b"" - return kwargs - - -@dataclass(kw_only=True) -class S3ObjectDoc: - """The unique wrapper object of the document from the S3 location.""" - - uri: str - """The S3 URI location for the wrapper object of the document.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_S3_OBJECT_DOC, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_S3_OBJECT_DOC.members["uri"], self.uri) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["uri"] = de.read_string(_SCHEMA_S3_OBJECT_DOC.members["uri"]) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_S3_OBJECT_DOC, consumer=_consumer) - if "uri" not in kwargs: - kwargs["uri"] = "" - return kwargs - - -class ExternalSourceType(UnknownEnumMixin, StrEnum): - S3 = "S3" - BYTE_CONTENT = "BYTE_CONTENT" - - -@dataclass(kw_only=True) -class ExternalSource: - """ - The unique external source of the content contained in the wrapper - object. - """ - - source_type: str - """The source type of the external source wrapper object.""" - - s3_location: S3ObjectDoc | None = None - """The S3 location of the external source wrapper object.""" - - byte_content: ByteContentDoc | None = None - """ - The identifier, content type, and data of the external source wrapper - object. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EXTERNAL_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_EXTERNAL_SOURCE.members["sourceType"], self.source_type - ) - if self.s3_location is not None: - serializer.write_struct( - _SCHEMA_EXTERNAL_SOURCE.members["s3Location"], self.s3_location - ) - - if self.byte_content is not None: - serializer.write_struct( - _SCHEMA_EXTERNAL_SOURCE.members["byteContent"], self.byte_content - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["source_type"] = ExternalSourceType( - de.read_string(_SCHEMA_EXTERNAL_SOURCE.members["sourceType"]) - ) - - case 1: - kwargs["s3_location"] = S3ObjectDoc.deserialize(de) - - case 2: - kwargs["byte_content"] = ByteContentDoc.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EXTERNAL_SOURCE, consumer=_consumer) - if "source_type" not in kwargs: - kwargs["source_type"] = ExternalSourceType._corrected("") - return kwargs - - -def _serialize_external_sources( - serializer: ShapeSerializer, schema: Schema, value: list[ExternalSource] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_external_sources( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ExternalSource]: - result: list[ExternalSource] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ExternalSource.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ExternalSourcesRetrieveAndGenerateConfiguration: - """ - The configuration of the external source wrapper object in the - `retrieveAndGenerate` function. - """ - - model_arn: str - """ - The Amazon Resource Name (ARN) of the foundation model or [inference - profile](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html) - used to generate responses. - """ - - sources: list[ExternalSource] - """ - The document for the external source wrapper object in the - `retrieveAndGenerate` function. - """ - - generation_configuration: ExternalSourcesGenerationConfiguration | None = None - """ - Contains configurations details for response generation based on - retrieved text chunks. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_EXTERNAL_SOURCES_RETRIEVE_AND_GENERATE_CONFIGURATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_EXTERNAL_SOURCES_RETRIEVE_AND_GENERATE_CONFIGURATION.members[ - "modelArn" - ], - self.model_arn, - ) - _serialize_external_sources( - serializer, - _SCHEMA_EXTERNAL_SOURCES_RETRIEVE_AND_GENERATE_CONFIGURATION.members[ - "sources" - ], - self.sources, - ) - if self.generation_configuration is not None: - serializer.write_struct( - _SCHEMA_EXTERNAL_SOURCES_RETRIEVE_AND_GENERATE_CONFIGURATION.members[ - "generationConfiguration" - ], - self.generation_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_arn"] = de.read_string( - _SCHEMA_EXTERNAL_SOURCES_RETRIEVE_AND_GENERATE_CONFIGURATION.members[ - "modelArn" - ] - ) - - case 1: - kwargs["sources"] = _deserialize_external_sources( - de, - _SCHEMA_EXTERNAL_SOURCES_RETRIEVE_AND_GENERATE_CONFIGURATION.members[ - "sources" - ], - ) - - case 2: - kwargs["generation_configuration"] = ( - ExternalSourcesGenerationConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EXTERNAL_SOURCES_RETRIEVE_AND_GENERATE_CONFIGURATION, - consumer=_consumer, - ) - if "model_arn" not in kwargs: - kwargs["model_arn"] = "" - if "sources" not in kwargs: - kwargs["sources"] = [] - return kwargs - - -@dataclass(kw_only=True) -class GenerationConfiguration: - """ - The configuration details for response generation based on retrieved - text chunks. - """ - - prompt_template: PromptTemplate | None = None - """ - Contains the template for the prompt that's sent to the model for - response generation. - """ - - guardrail_configuration: GuardrailConfiguration | None = None - """Contains configuration details for the guardrail.""" - - kb_inference_config: KbInferenceConfig | None = None - """ - Contains configuration details for inference for knowledge base - retrieval and response generation. - """ - - additional_model_request_fields: dict[str, Document] | None = None - """ - Additional model parameters and corresponding values not included in the - `textInferenceConfig` structure for a knowledge base. This allows you to - provide custom model parameters specific to the language model being - used. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GENERATION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.prompt_template is not None: - serializer.write_struct( - _SCHEMA_GENERATION_CONFIGURATION.members["promptTemplate"], - self.prompt_template, - ) - - if self.guardrail_configuration is not None: - serializer.write_struct( - _SCHEMA_GENERATION_CONFIGURATION.members["guardrailConfiguration"], - self.guardrail_configuration, - ) - - if self.kb_inference_config is not None: - serializer.write_struct( - _SCHEMA_GENERATION_CONFIGURATION.members["kbInferenceConfig"], - self.kb_inference_config, - ) - - if self.additional_model_request_fields is not None: - _serialize_additional_model_request_fields( - serializer, - _SCHEMA_GENERATION_CONFIGURATION.members[ - "additionalModelRequestFields" - ], - self.additional_model_request_fields, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["prompt_template"] = PromptTemplate.deserialize(de) - - case 1: - kwargs["guardrail_configuration"] = ( - GuardrailConfiguration.deserialize(de) - ) - - case 2: - kwargs["kb_inference_config"] = KbInferenceConfig.deserialize(de) - - case 3: - kwargs["additional_model_request_fields"] = ( - _deserialize_additional_model_request_fields( - de, - _SCHEMA_GENERATION_CONFIGURATION.members[ - "additionalModelRequestFields" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GENERATION_CONFIGURATION, consumer=_consumer) - return kwargs - - -class QueryTransformationType(UnknownEnumMixin, StrEnum): - QUERY_DECOMPOSITION = "QUERY_DECOMPOSITION" - - -@dataclass(kw_only=True) -class QueryTransformationConfiguration: - """The configuration details for transforming the prompt.""" - - type: str - """The type of transformation to apply to the prompt.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_QUERY_TRANSFORMATION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_QUERY_TRANSFORMATION_CONFIGURATION.members["type"], self.type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = QueryTransformationType( - de.read_string( - _SCHEMA_QUERY_TRANSFORMATION_CONFIGURATION.members["type"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_QUERY_TRANSFORMATION_CONFIGURATION, consumer=_consumer - ) - if "type" not in kwargs: - kwargs["type"] = QueryTransformationType._corrected("") - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(type=QueryTransformationType._corrected("")) - - -@dataclass(kw_only=True) -class OrchestrationConfiguration: - """ - The configuration details for the model to process the prompt prior to - retrieval and response generation. - """ - - query_transformation_configuration: QueryTransformationConfiguration - """Contains configuration details for transforming the prompt.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ORCHESTRATION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_ORCHESTRATION_CONFIGURATION.members[ - "queryTransformationConfiguration" - ], - self.query_transformation_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["query_transformation_configuration"] = ( - QueryTransformationConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ORCHESTRATION_CONFIGURATION, consumer=_consumer - ) - if "query_transformation_configuration" not in kwargs: - kwargs["query_transformation_configuration"] = ( - QueryTransformationConfiguration._smithy_default() - ) - return kwargs - - -@dataclass(kw_only=True) -class FilterAttribute: - """ - Specifies the name of the metadata attribute/field to apply filters. You - must match the name of the attribute/field in your data source/document - metadata. - """ - - key: str - """ - The name of metadata attribute/field, which must match the name in your - data source/document metadata. - """ - - value: Document - """The value of the metadata attribute/field.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FILTER_ATTRIBUTE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_FILTER_ATTRIBUTE.members["key"], self.key) - serializer.write_document(_SCHEMA_FILTER_ATTRIBUTE.members["value"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["key"] = de.read_string( - _SCHEMA_FILTER_ATTRIBUTE.members["key"] - ) - - case 1: - kwargs["value"] = de.read_document( - _SCHEMA_FILTER_ATTRIBUTE.members["value"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FILTER_ATTRIBUTE, consumer=_consumer) - if "key" not in kwargs: - kwargs["key"] = "" - if "value" not in kwargs: - kwargs["value"] = Document(None) - return kwargs - - -class AttributeType(UnknownEnumMixin, StrEnum): - STRING = "STRING" - NUMBER = "NUMBER" - BOOLEAN = "BOOLEAN" - STRING_LIST = "STRING_LIST" - - -@dataclass(kw_only=True) -class MetadataAttributeSchema: - """ - Defines the schema for a metadata attribute used in Knowledge Base - vector searches. Metadata attributes provide additional context for - documents and can be used for filtering and reranking search results. - """ - - key: str - """ - The unique identifier for the metadata attribute. This key is used to - reference the attribute in filter expressions and reranking - configurations. - """ - - type: str - """ - The data type of the metadata attribute. The type determines how the - attribute can be used in filter expressions and reranking. - """ - - description: str - """ - An optional description of the metadata attribute that provides - additional context about its purpose and usage. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_METADATA_ATTRIBUTE_SCHEMA, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_METADATA_ATTRIBUTE_SCHEMA.members["key"], self.key - ) - serializer.write_string( - _SCHEMA_METADATA_ATTRIBUTE_SCHEMA.members["type"], self.type - ) - serializer.write_string( - _SCHEMA_METADATA_ATTRIBUTE_SCHEMA.members["description"], self.description - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["key"] = de.read_string( - _SCHEMA_METADATA_ATTRIBUTE_SCHEMA.members["key"] - ) - - case 1: - kwargs["type"] = AttributeType( - de.read_string( - _SCHEMA_METADATA_ATTRIBUTE_SCHEMA.members["type"] - ) - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_METADATA_ATTRIBUTE_SCHEMA.members["description"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_METADATA_ATTRIBUTE_SCHEMA, consumer=_consumer) - if "key" not in kwargs: - kwargs["key"] = "" - if "type" not in kwargs: - kwargs["type"] = AttributeType._corrected("") - if "description" not in kwargs: - kwargs["description"] = "" - return kwargs - - -def _serialize_metadata_attribute_schema_list( - serializer: ShapeSerializer, schema: Schema, value: list[MetadataAttributeSchema] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_metadata_attribute_schema_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[MetadataAttributeSchema]: - result: list[MetadataAttributeSchema] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(MetadataAttributeSchema.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ImplicitFilterConfiguration: - """ - Configuration for implicit filtering in Knowledge Base vector searches. - Implicit filtering allows you to automatically filter search results - based on metadata attributes without requiring explicit filter - expressions in each query. - """ - - metadata_attributes: list[MetadataAttributeSchema] - """ - A list of metadata attribute schemas that define the structure and - properties of metadata fields used for implicit filtering. Each - attribute defines a key, type, and optional description. - """ - - model_arn: str - """ - The Amazon Resource Name (ARN) of the foundation model used for implicit - filtering. This model processes the query to extract relevant filtering - criteria. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IMPLICIT_FILTER_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_metadata_attribute_schema_list( - serializer, - _SCHEMA_IMPLICIT_FILTER_CONFIGURATION.members["metadataAttributes"], - self.metadata_attributes, - ) - serializer.write_string( - _SCHEMA_IMPLICIT_FILTER_CONFIGURATION.members["modelArn"], self.model_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["metadata_attributes"] = ( - _deserialize_metadata_attribute_schema_list( - de, - _SCHEMA_IMPLICIT_FILTER_CONFIGURATION.members[ - "metadataAttributes" - ], - ) - ) - - case 1: - kwargs["model_arn"] = de.read_string( - _SCHEMA_IMPLICIT_FILTER_CONFIGURATION.members["modelArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_IMPLICIT_FILTER_CONFIGURATION, consumer=_consumer - ) - if "metadata_attributes" not in kwargs: - kwargs["metadata_attributes"] = [] - if "model_arn" not in kwargs: - kwargs["model_arn"] = "" - return kwargs - - -class SearchType(UnknownEnumMixin, StrEnum): - HYBRID = "HYBRID" - SEMANTIC = "SEMANTIC" - - -class RerankingMetadataSelectionMode(UnknownEnumMixin, StrEnum): - SELECTIVE = "SELECTIVE" - ALL = "ALL" - - -@dataclass(kw_only=True) -class FieldForReranking: - """ - Specifies a field to be used during the reranking process in a Knowledge - Base vector search. This structure identifies metadata fields that - should be considered when reordering search results to improve - relevance. - """ - - field_name: str - """The name of the metadata field to be used during the reranking process.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FIELD_FOR_RERANKING, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_FIELD_FOR_RERANKING.members["fieldName"], self.field_name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["field_name"] = de.read_string( - _SCHEMA_FIELD_FOR_RERANKING.members["fieldName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FIELD_FOR_RERANKING, consumer=_consumer) - if "field_name" not in kwargs: - kwargs["field_name"] = "" - return kwargs - - -def _serialize_fields_for_reranking( - serializer: ShapeSerializer, schema: Schema, value: list[FieldForReranking] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_fields_for_reranking( - deserializer: ShapeDeserializer, schema: Schema -) -> list[FieldForReranking]: - result: list[FieldForReranking] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(FieldForReranking.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass -class RerankingMetadataSelectiveModeConfigurationFieldsToInclude: - """ - A list of metadata field names to explicitly include in the reranking - process. Only these fields will be considered when reordering search - results. This parameter cannot be used together with fieldsToExclude. - """ - - value: list[FieldForReranking] - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_fields_for_reranking( - serializer, - _SCHEMA_RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION.members[ - "fieldsToInclude" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_deserialize_fields_for_reranking( - deserializer, - _SCHEMA_RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION.members[ - "fieldsToInclude" - ], - ) - ) - - -@dataclass -class RerankingMetadataSelectiveModeConfigurationFieldsToExclude: - """ - A list of metadata field names to explicitly exclude from the reranking - process. All metadata fields except these will be considered when - reordering search results. This parameter cannot be used together with - fieldsToInclude. - """ - - value: list[FieldForReranking] - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_fields_for_reranking( - serializer, - _SCHEMA_RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION.members[ - "fieldsToExclude" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_deserialize_fields_for_reranking( - deserializer, - _SCHEMA_RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION.members[ - "fieldsToExclude" - ], - ) - ) - - -@dataclass -class RerankingMetadataSelectiveModeConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -RerankingMetadataSelectiveModeConfiguration = Union[ - RerankingMetadataSelectiveModeConfigurationFieldsToInclude - | RerankingMetadataSelectiveModeConfigurationFieldsToExclude - | RerankingMetadataSelectiveModeConfigurationUnknown -] -""" -Configuration for selectively including or excluding metadata fields -during the reranking process. This allows you to control which metadata -attributes are considered when reordering search results. -""" - - -class _RerankingMetadataSelectiveModeConfigurationDeserializer: - _result: RerankingMetadataSelectiveModeConfiguration | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> RerankingMetadataSelectiveModeConfiguration: - self._result = None - deserializer.read_struct( - _SCHEMA_RERANKING_METADATA_SELECTIVE_MODE_CONFIGURATION, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - RerankingMetadataSelectiveModeConfigurationFieldsToInclude.deserialize( - de - ) - ) - - case 1: - self._set_result( - RerankingMetadataSelectiveModeConfigurationFieldsToExclude.deserialize( - de - ) - ) - - case _: - self._set_result( - RerankingMetadataSelectiveModeConfigurationUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: RerankingMetadataSelectiveModeConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class MetadataConfigurationForReranking: - """ - Configuration for how metadata should be used during the reranking - process in Knowledge Base vector searches. This determines which - metadata fields are included or excluded when reordering search results. - """ - - selection_mode: str - """ - The mode for selecting which metadata fields to include in the reranking - process. Valid values are ALL (use all available metadata fields) or - SELECTIVE (use only specified fields). - """ - - selective_mode_configuration: RerankingMetadataSelectiveModeConfiguration | None = ( - None - ) - """ - Configuration for selective mode, which allows you to explicitly include - or exclude specific metadata fields during reranking. This is only used - when selectionMode is set to SELECTIVE. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_METADATA_CONFIGURATION_FOR_RERANKING, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_METADATA_CONFIGURATION_FOR_RERANKING.members["selectionMode"], - self.selection_mode, - ) - if self.selective_mode_configuration is not None: - serializer.write_struct( - _SCHEMA_METADATA_CONFIGURATION_FOR_RERANKING.members[ - "selectiveModeConfiguration" - ], - self.selective_mode_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["selection_mode"] = RerankingMetadataSelectionMode( - de.read_string( - _SCHEMA_METADATA_CONFIGURATION_FOR_RERANKING.members[ - "selectionMode" - ] - ) - ) - - case 1: - kwargs["selective_mode_configuration"] = ( - _RerankingMetadataSelectiveModeConfigurationDeserializer().deserialize( - de - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_METADATA_CONFIGURATION_FOR_RERANKING, consumer=_consumer - ) - if "selection_mode" not in kwargs: - kwargs["selection_mode"] = RerankingMetadataSelectionMode._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class VectorSearchBedrockRerankingModelConfiguration: - """ - Configuration for the Amazon Bedrock foundation model used for reranking - vector search results. This specifies which model to use and any - additional parameters required by the model. - """ - - model_arn: str - """ - The Amazon Resource Name (ARN) of the foundation model to use for - reranking. This model processes the query and search results to - determine a more relevant ordering. - """ - - additional_model_request_fields: dict[str, Document] | None = None - """ - A list of additional fields to include in the model request during - reranking. These fields provide extra context or configuration options - specific to the selected foundation model. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_VECTOR_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_VECTOR_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION.members[ - "modelArn" - ], - self.model_arn, - ) - if self.additional_model_request_fields is not None: - _serialize_additional_model_request_fields( - serializer, - _SCHEMA_VECTOR_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION.members[ - "additionalModelRequestFields" - ], - self.additional_model_request_fields, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_arn"] = de.read_string( - _SCHEMA_VECTOR_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION.members[ - "modelArn" - ] - ) - - case 1: - kwargs["additional_model_request_fields"] = ( - _deserialize_additional_model_request_fields( - de, - _SCHEMA_VECTOR_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION.members[ - "additionalModelRequestFields" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_VECTOR_SEARCH_BEDROCK_RERANKING_MODEL_CONFIGURATION, - consumer=_consumer, - ) - if "model_arn" not in kwargs: - kwargs["model_arn"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(model_arn="") - - -@dataclass(kw_only=True) -class VectorSearchBedrockRerankingConfiguration: - """ - Configuration for using Amazon Bedrock foundation models to rerank - Knowledge Base vector search results. This enables more sophisticated - relevance ranking using large language models. - """ - - model_configuration: VectorSearchBedrockRerankingModelConfiguration - """ - Configuration for the Amazon Bedrock foundation model used for - reranking. This includes the model ARN and any additional request fields - required by the model. - """ - - number_of_reranked_results: int | None = None - """ - The maximum number of results to rerank. This limits how many of the - initial vector search results will be processed by the reranking model. - A smaller number improves performance but may exclude potentially - relevant results. - """ - - metadata_configuration: MetadataConfigurationForReranking | None = None - """ - Configuration for how document metadata should be used during the - reranking process. This determines which metadata fields are included - when reordering search results. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_VECTOR_SEARCH_BEDROCK_RERANKING_CONFIGURATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_VECTOR_SEARCH_BEDROCK_RERANKING_CONFIGURATION.members[ - "modelConfiguration" - ], - self.model_configuration, - ) - if self.number_of_reranked_results is not None: - serializer.write_integer( - _SCHEMA_VECTOR_SEARCH_BEDROCK_RERANKING_CONFIGURATION.members[ - "numberOfRerankedResults" - ], - self.number_of_reranked_results, - ) - - if self.metadata_configuration is not None: - serializer.write_struct( - _SCHEMA_VECTOR_SEARCH_BEDROCK_RERANKING_CONFIGURATION.members[ - "metadataConfiguration" - ], - self.metadata_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_configuration"] = ( - VectorSearchBedrockRerankingModelConfiguration.deserialize(de) - ) - - case 1: - kwargs["number_of_reranked_results"] = de.read_integer( - _SCHEMA_VECTOR_SEARCH_BEDROCK_RERANKING_CONFIGURATION.members[ - "numberOfRerankedResults" - ] - ) - - case 2: - kwargs["metadata_configuration"] = ( - MetadataConfigurationForReranking.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_VECTOR_SEARCH_BEDROCK_RERANKING_CONFIGURATION, consumer=_consumer - ) - if "model_configuration" not in kwargs: - kwargs["model_configuration"] = ( - VectorSearchBedrockRerankingModelConfiguration._smithy_default() - ) - return kwargs - - -class VectorSearchRerankingConfigurationType(UnknownEnumMixin, StrEnum): - BEDROCK_RERANKING_MODEL = "BEDROCK_RERANKING_MODEL" - - -@dataclass(kw_only=True) -class VectorSearchRerankingConfiguration: - """ - Configuration for reranking vector search results to improve relevance. - Reranking applies additional relevance models to reorder the initial - vector search results based on more sophisticated criteria. - """ - - type: str - """ - The type of reranking to apply to vector search results. Currently, the - only supported value is BEDROCK, which uses Amazon Bedrock foundation - models for reranking. - """ - - bedrock_reranking_configuration: ( - VectorSearchBedrockRerankingConfiguration | None - ) = None - """ - Configuration for using Amazon Bedrock foundation models to rerank - search results. This is required when the reranking type is set to - BEDROCK. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VECTOR_SEARCH_RERANKING_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_VECTOR_SEARCH_RERANKING_CONFIGURATION.members["type"], self.type - ) - if self.bedrock_reranking_configuration is not None: - serializer.write_struct( - _SCHEMA_VECTOR_SEARCH_RERANKING_CONFIGURATION.members[ - "bedrockRerankingConfiguration" - ], - self.bedrock_reranking_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = VectorSearchRerankingConfigurationType( - de.read_string( - _SCHEMA_VECTOR_SEARCH_RERANKING_CONFIGURATION.members[ - "type" - ] - ) - ) - - case 1: - kwargs["bedrock_reranking_configuration"] = ( - VectorSearchBedrockRerankingConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_VECTOR_SEARCH_RERANKING_CONFIGURATION, consumer=_consumer - ) - if "type" not in kwargs: - kwargs["type"] = VectorSearchRerankingConfigurationType._corrected("") - return kwargs - - -class RetrieveAndGenerateType(UnknownEnumMixin, StrEnum): - KNOWLEDGE_BASE = "KNOWLEDGE_BASE" - EXTERNAL_SOURCES = "EXTERNAL_SOURCES" - - -@dataclass(kw_only=True) -class EvaluationPrecomputedRetrieveAndGenerateSourceConfig: - """ - A summary of a RAG source used for a retrieve-and-generate Knowledge - Base evaluation job where you provide your own inference response data. - """ - - rag_source_identifier: str - """ - A label that identifies the RAG source used for a retrieve-and-generate - Knowledge Base evaluation job where you provide your own inference - response data. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_EVALUATION_PRECOMPUTED_RETRIEVE_AND_GENERATE_SOURCE_CONFIG, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_EVALUATION_PRECOMPUTED_RETRIEVE_AND_GENERATE_SOURCE_CONFIG.members[ - "ragSourceIdentifier" - ], - self.rag_source_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rag_source_identifier"] = de.read_string( - _SCHEMA_EVALUATION_PRECOMPUTED_RETRIEVE_AND_GENERATE_SOURCE_CONFIG.members[ - "ragSourceIdentifier" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EVALUATION_PRECOMPUTED_RETRIEVE_AND_GENERATE_SOURCE_CONFIG, - consumer=_consumer, - ) - if "rag_source_identifier" not in kwargs: - kwargs["rag_source_identifier"] = "" - return kwargs - - -@dataclass(kw_only=True) -class EvaluationPrecomputedRetrieveSourceConfig: - """ - A summary of a RAG source used for a retrieve-only Knowledge Base - evaluation job where you provide your own inference response data. - """ - - rag_source_identifier: str - """ - A label that identifies the RAG source used for a retrieve-only - Knowledge Base evaluation job where you provide your own inference - response data. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_EVALUATION_PRECOMPUTED_RETRIEVE_SOURCE_CONFIG, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_EVALUATION_PRECOMPUTED_RETRIEVE_SOURCE_CONFIG.members[ - "ragSourceIdentifier" - ], - self.rag_source_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rag_source_identifier"] = de.read_string( - _SCHEMA_EVALUATION_PRECOMPUTED_RETRIEVE_SOURCE_CONFIG.members[ - "ragSourceIdentifier" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EVALUATION_PRECOMPUTED_RETRIEVE_SOURCE_CONFIG, consumer=_consumer - ) - if "rag_source_identifier" not in kwargs: - kwargs["rag_source_identifier"] = "" - return kwargs - - -@dataclass -class EvaluationPrecomputedRagSourceConfigRetrieveSourceConfig: - """ - A summary of a RAG source used for a retrieve-only Knowledge Base - evaluation job where you provide your own inference response data. - """ - - value: EvaluationPrecomputedRetrieveSourceConfig - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVALUATION_PRECOMPUTED_RAG_SOURCE_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_EVALUATION_PRECOMPUTED_RAG_SOURCE_CONFIG.members[ - "retrieveSourceConfig" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=EvaluationPrecomputedRetrieveSourceConfig.deserialize(deserializer) - ) - - -@dataclass -class EvaluationPrecomputedRagSourceConfigRetrieveAndGenerateSourceConfig: - """ - A summary of a RAG source used for a retrieve-and-generate Knowledge - Base evaluation job where you provide your own inference response data. - """ - - value: EvaluationPrecomputedRetrieveAndGenerateSourceConfig - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVALUATION_PRECOMPUTED_RAG_SOURCE_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_EVALUATION_PRECOMPUTED_RAG_SOURCE_CONFIG.members[ - "retrieveAndGenerateSourceConfig" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=EvaluationPrecomputedRetrieveAndGenerateSourceConfig.deserialize( - deserializer - ) - ) - - -@dataclass -class EvaluationPrecomputedRagSourceConfigUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -EvaluationPrecomputedRagSourceConfig = Union[ - EvaluationPrecomputedRagSourceConfigRetrieveSourceConfig - | EvaluationPrecomputedRagSourceConfigRetrieveAndGenerateSourceConfig - | EvaluationPrecomputedRagSourceConfigUnknown -] -""" -A summary of a RAG source used for a Knowledge Base evaluation job where -you provide your own inference response data. -""" - - -class _EvaluationPrecomputedRagSourceConfigDeserializer: - _result: EvaluationPrecomputedRagSourceConfig | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> EvaluationPrecomputedRagSourceConfig: - self._result = None - deserializer.read_struct( - _SCHEMA_EVALUATION_PRECOMPUTED_RAG_SOURCE_CONFIG, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - EvaluationPrecomputedRagSourceConfigRetrieveSourceConfig.deserialize( - de - ) - ) - - case 1: - self._set_result( - EvaluationPrecomputedRagSourceConfigRetrieveAndGenerateSourceConfig.deserialize( - de - ) - ) - - case _: - self._set_result( - EvaluationPrecomputedRagSourceConfigUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: EvaluationPrecomputedRagSourceConfig) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class EvaluationOutputDataConfig: - """ - The Amazon S3 location where the results of your evaluation job are - saved. - """ - - s3_uri: str - """The Amazon S3 URI where the results of the evaluation job are saved.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVALUATION_OUTPUT_DATA_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_EVALUATION_OUTPUT_DATA_CONFIG.members["s3Uri"], self.s3_uri - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["s3_uri"] = de.read_string( - _SCHEMA_EVALUATION_OUTPUT_DATA_CONFIG.members["s3Uri"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EVALUATION_OUTPUT_DATA_CONFIG, consumer=_consumer - ) - if "s3_uri" not in kwargs: - kwargs["s3_uri"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(s3_uri="") - - -@dataclass(kw_only=True) -class CreateEvaluationJobOutput: - """Dataclass for CreateEvaluationJobOutput structure.""" - - job_arn: str - """The Amazon Resource Name (ARN) of the evaluation job.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_EVALUATION_JOB_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_EVALUATION_JOB_OUTPUT.members["jobArn"], self.job_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["job_arn"] = de.read_string( - _SCHEMA_CREATE_EVALUATION_JOB_OUTPUT.members["jobArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_EVALUATION_JOB_OUTPUT, consumer=_consumer - ) - if "job_arn" not in kwargs: - kwargs["job_arn"] = "" - return kwargs - - -@dataclass(kw_only=True) -class GetEvaluationJobInput: - """Dataclass for GetEvaluationJobInput structure.""" - - job_identifier: str | None = field(repr=False, default=None) - """ - The Amazon Resource Name (ARN) of the evaluation job you want get - information on. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_EVALUATION_JOB_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.job_identifier is not None: - serializer.write_string( - _SCHEMA_GET_EVALUATION_JOB_INPUT.members["jobIdentifier"], - self.job_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["job_identifier"] = de.read_string( - _SCHEMA_GET_EVALUATION_JOB_INPUT.members["jobIdentifier"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_EVALUATION_JOB_INPUT, consumer=_consumer) - return kwargs - - -def _serialize_error_messages( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_error_messages( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -class EvaluationJobType(UnknownEnumMixin, StrEnum): - HUMAN = "Human" - AUTOMATED = "Automated" - - -@dataclass(kw_only=True) -class ListEvaluationJobsInput: - """Dataclass for ListEvaluationJobsInput structure.""" - - creation_time_after: datetime | None = None - """A filter to only list evaluation jobs created after a specified time.""" - - creation_time_before: datetime | None = None - """A filter to only list evaluation jobs created before a specified time.""" - - status_equals: str | None = None - """A filter to only list evaluation jobs that are of a certain status.""" - - application_type_equals: str | None = None - """ - A filter to only list evaluation jobs that are either model evaluations - or knowledge base evaluations. - """ - - name_contains: str | None = None - """ - A filter to only list evaluation jobs that contain a specified string in - the job name. - """ - - max_results: int | None = None - """The maximum number of results to return.""" - - next_token: str | None = None - """ - Continuation token from the previous response, for Amazon Bedrock to - list the next set of results. - """ - - sort_by: str | None = None - """ - Specifies a creation time to sort the list of evaluation jobs by when - they were created. - """ - - sort_order: str | None = None - """ - Specifies whether to sort the list of evaluation jobs by either - ascending or descending order. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_EVALUATION_JOBS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.creation_time_after is not None: - serializer.write_timestamp( - _SCHEMA_LIST_EVALUATION_JOBS_INPUT.members["creationTimeAfter"], - self.creation_time_after, - ) - - if self.creation_time_before is not None: - serializer.write_timestamp( - _SCHEMA_LIST_EVALUATION_JOBS_INPUT.members["creationTimeBefore"], - self.creation_time_before, - ) - - if self.status_equals is not None: - serializer.write_string( - _SCHEMA_LIST_EVALUATION_JOBS_INPUT.members["statusEquals"], - self.status_equals, - ) - - if self.application_type_equals is not None: - serializer.write_string( - _SCHEMA_LIST_EVALUATION_JOBS_INPUT.members["applicationTypeEquals"], - self.application_type_equals, - ) - - if self.name_contains is not None: - serializer.write_string( - _SCHEMA_LIST_EVALUATION_JOBS_INPUT.members["nameContains"], - self.name_contains, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_EVALUATION_JOBS_INPUT.members["maxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_EVALUATION_JOBS_INPUT.members["nextToken"], self.next_token - ) - - if self.sort_by is not None: - serializer.write_string( - _SCHEMA_LIST_EVALUATION_JOBS_INPUT.members["sortBy"], self.sort_by - ) - - if self.sort_order is not None: - serializer.write_string( - _SCHEMA_LIST_EVALUATION_JOBS_INPUT.members["sortOrder"], self.sort_order - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["creation_time_after"] = de.read_timestamp( - _SCHEMA_LIST_EVALUATION_JOBS_INPUT.members["creationTimeAfter"] - ) - - case 1: - kwargs["creation_time_before"] = de.read_timestamp( - _SCHEMA_LIST_EVALUATION_JOBS_INPUT.members["creationTimeBefore"] - ) - - case 2: - kwargs["status_equals"] = EvaluationJobStatus( - de.read_string( - _SCHEMA_LIST_EVALUATION_JOBS_INPUT.members["statusEquals"] - ) - ) - - case 3: - kwargs["application_type_equals"] = ApplicationType( - de.read_string( - _SCHEMA_LIST_EVALUATION_JOBS_INPUT.members[ - "applicationTypeEquals" - ] - ) - ) - - case 4: - kwargs["name_contains"] = de.read_string( - _SCHEMA_LIST_EVALUATION_JOBS_INPUT.members["nameContains"] - ) - - case 5: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_EVALUATION_JOBS_INPUT.members["maxResults"] - ) - - case 6: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_EVALUATION_JOBS_INPUT.members["nextToken"] - ) - - case 7: - kwargs["sort_by"] = SortJobsBy( - de.read_string( - _SCHEMA_LIST_EVALUATION_JOBS_INPUT.members["sortBy"] - ) - ) - - case 8: - kwargs["sort_order"] = SortOrder( - de.read_string( - _SCHEMA_LIST_EVALUATION_JOBS_INPUT.members["sortOrder"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_EVALUATION_JOBS_INPUT, consumer=_consumer) - return kwargs - - -def _serialize_evaluator_model_identifiers( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_evaluator_model_identifiers( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_evaluation_task_types( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_evaluation_task_types( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(EvaluationTaskType(d.read_string(member_schema))) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_evaluation_bedrock_model_identifiers( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_evaluation_bedrock_model_identifiers( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_evaluation_precomputed_inference_source_identifiers( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_evaluation_precomputed_inference_source_identifiers( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class EvaluationModelConfigSummary: - """ - A summary of the models used in an Amazon Bedrock model evaluation job. - These resources can be models in Amazon Bedrock or models outside of - Amazon Bedrock that you use to generate your own inference response - data. - """ - - bedrock_model_identifiers: list[str] | None = None - """ - The Amazon Resource Names (ARNs) of the models used for the evaluation - job. - """ - - precomputed_inference_source_identifiers: list[str] | None = None - """ - A label that identifies the models used for a model evaluation job where - you provide your own inference response data. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVALUATION_MODEL_CONFIG_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.bedrock_model_identifiers is not None: - _serialize_evaluation_bedrock_model_identifiers( - serializer, - _SCHEMA_EVALUATION_MODEL_CONFIG_SUMMARY.members[ - "bedrockModelIdentifiers" - ], - self.bedrock_model_identifiers, - ) - - if self.precomputed_inference_source_identifiers is not None: - _serialize_evaluation_precomputed_inference_source_identifiers( - serializer, - _SCHEMA_EVALUATION_MODEL_CONFIG_SUMMARY.members[ - "precomputedInferenceSourceIdentifiers" - ], - self.precomputed_inference_source_identifiers, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bedrock_model_identifiers"] = ( - _deserialize_evaluation_bedrock_model_identifiers( - de, - _SCHEMA_EVALUATION_MODEL_CONFIG_SUMMARY.members[ - "bedrockModelIdentifiers" - ], - ) - ) - - case 1: - kwargs["precomputed_inference_source_identifiers"] = ( - _deserialize_evaluation_precomputed_inference_source_identifiers( - de, - _SCHEMA_EVALUATION_MODEL_CONFIG_SUMMARY.members[ - "precomputedInferenceSourceIdentifiers" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EVALUATION_MODEL_CONFIG_SUMMARY, consumer=_consumer - ) - return kwargs - - -def _serialize_evaluation_bedrock_knowledge_base_identifiers( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_evaluation_bedrock_knowledge_base_identifiers( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_evaluation_precomputed_rag_source_identifiers( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_evaluation_precomputed_rag_source_identifiers( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class EvaluationRagConfigSummary: - """ - A summary of the RAG resources used in an Amazon Bedrock Knowledge Base - evaluation job. These resources can be Knowledge Bases in Amazon Bedrock - or RAG sources outside of Amazon Bedrock that you use to generate your - own inference response data. - """ - - bedrock_knowledge_base_identifiers: list[str] | None = None - """ - The Amazon Resource Names (ARNs) of the Knowledge Base resources used - for a Knowledge Base evaluation job where Amazon Bedrock invokes the - Knowledge Base for you. - """ - - precomputed_rag_source_identifiers: list[str] | None = None - """ - A label that identifies the RAG sources used for a Knowledge Base - evaluation job where you provide your own inference response data. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVALUATION_RAG_CONFIG_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.bedrock_knowledge_base_identifiers is not None: - _serialize_evaluation_bedrock_knowledge_base_identifiers( - serializer, - _SCHEMA_EVALUATION_RAG_CONFIG_SUMMARY.members[ - "bedrockKnowledgeBaseIdentifiers" - ], - self.bedrock_knowledge_base_identifiers, - ) - - if self.precomputed_rag_source_identifiers is not None: - _serialize_evaluation_precomputed_rag_source_identifiers( - serializer, - _SCHEMA_EVALUATION_RAG_CONFIG_SUMMARY.members[ - "precomputedRagSourceIdentifiers" - ], - self.precomputed_rag_source_identifiers, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bedrock_knowledge_base_identifiers"] = ( - _deserialize_evaluation_bedrock_knowledge_base_identifiers( - de, - _SCHEMA_EVALUATION_RAG_CONFIG_SUMMARY.members[ - "bedrockKnowledgeBaseIdentifiers" - ], - ) - ) - - case 1: - kwargs["precomputed_rag_source_identifiers"] = ( - _deserialize_evaluation_precomputed_rag_source_identifiers( - de, - _SCHEMA_EVALUATION_RAG_CONFIG_SUMMARY.members[ - "precomputedRagSourceIdentifiers" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EVALUATION_RAG_CONFIG_SUMMARY, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class EvaluationInferenceConfigSummary: - """ - Identifies the models, Knowledge Bases, or other RAG sources evaluated - in a model or Knowledge Base evaluation job. - """ - - model_config_summary: EvaluationModelConfigSummary | None = None - """ - A summary of the models used in an Amazon Bedrock model evaluation job. - These resources can be models in Amazon Bedrock or models outside of - Amazon Bedrock that you use to generate your own inference response - data. - """ - - rag_config_summary: EvaluationRagConfigSummary | None = None - """ - A summary of the RAG resources used in an Amazon Bedrock Knowledge Base - evaluation job. These resources can be Knowledge Bases in Amazon Bedrock - or RAG sources outside of Amazon Bedrock that you use to generate your - own inference response data. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVALUATION_INFERENCE_CONFIG_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.model_config_summary is not None: - serializer.write_struct( - _SCHEMA_EVALUATION_INFERENCE_CONFIG_SUMMARY.members[ - "modelConfigSummary" - ], - self.model_config_summary, - ) - - if self.rag_config_summary is not None: - serializer.write_struct( - _SCHEMA_EVALUATION_INFERENCE_CONFIG_SUMMARY.members["ragConfigSummary"], - self.rag_config_summary, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_config_summary"] = ( - EvaluationModelConfigSummary.deserialize(de) - ) - - case 1: - kwargs["rag_config_summary"] = ( - EvaluationRagConfigSummary.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EVALUATION_INFERENCE_CONFIG_SUMMARY, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class EvaluationSummary: - """Summary information of an evaluation job.""" - - job_arn: str - """The Amazon Resource Name (ARN) of the evaluation job.""" - - job_name: str - """The name for the evaluation job.""" - - status: str - """The current status of the evaluation job.""" - - creation_time: datetime - """The time the evaluation job was created.""" - - job_type: str - """Specifies whether the evaluation job is automated or human-based.""" - - evaluation_task_types: list[str] - """The type of task for model evaluation.""" - - model_identifiers: list[str] = field(default_factory=list[str]) - """ - The Amazon Resource Names (ARNs) of the model(s) used for the evaluation - job. - """ - - rag_identifiers: list[str] | None = None - """ - The Amazon Resource Names (ARNs) of the knowledge base resources used - for a knowledge base evaluation job. - """ - - evaluator_model_identifiers: list[str] | None = None - """ - The Amazon Resource Names (ARNs) of the models used to compute the - metrics for a knowledge base evaluation job. - """ - - custom_metrics_evaluator_model_identifiers: list[str] | None = None - """ - The Amazon Resource Names (ARNs) of the models used to compute custom - metrics in an Amazon Bedrock evaluation job. - """ - - inference_config_summary: EvaluationInferenceConfigSummary | None = None - """ - Identifies the models, Knowledge Bases, or other RAG sources evaluated - in a model or Knowledge Base evaluation job. - """ - - application_type: str | None = None - """ - Specifies whether the evaluation job is for evaluating a model or - evaluating a knowledge base (retrieval and response generation). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVALUATION_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_EVALUATION_SUMMARY.members["jobArn"], self.job_arn - ) - serializer.write_string( - _SCHEMA_EVALUATION_SUMMARY.members["jobName"], self.job_name - ) - serializer.write_string( - _SCHEMA_EVALUATION_SUMMARY.members["status"], self.status - ) - serializer.write_timestamp( - _SCHEMA_EVALUATION_SUMMARY.members["creationTime"], self.creation_time - ) - serializer.write_string( - _SCHEMA_EVALUATION_SUMMARY.members["jobType"], self.job_type - ) - _serialize_evaluation_task_types( - serializer, - _SCHEMA_EVALUATION_SUMMARY.members["evaluationTaskTypes"], - self.evaluation_task_types, - ) - _serialize_evaluation_bedrock_model_identifiers( - serializer, - _SCHEMA_EVALUATION_SUMMARY.members["modelIdentifiers"], - self.model_identifiers, - ) - if self.rag_identifiers is not None: - _serialize_evaluation_bedrock_knowledge_base_identifiers( - serializer, - _SCHEMA_EVALUATION_SUMMARY.members["ragIdentifiers"], - self.rag_identifiers, - ) - - if self.evaluator_model_identifiers is not None: - _serialize_evaluator_model_identifiers( - serializer, - _SCHEMA_EVALUATION_SUMMARY.members["evaluatorModelIdentifiers"], - self.evaluator_model_identifiers, - ) - - if self.custom_metrics_evaluator_model_identifiers is not None: - _serialize_evaluator_model_identifiers( - serializer, - _SCHEMA_EVALUATION_SUMMARY.members[ - "customMetricsEvaluatorModelIdentifiers" - ], - self.custom_metrics_evaluator_model_identifiers, - ) - - if self.inference_config_summary is not None: - serializer.write_struct( - _SCHEMA_EVALUATION_SUMMARY.members["inferenceConfigSummary"], - self.inference_config_summary, - ) - - if self.application_type is not None: - serializer.write_string( - _SCHEMA_EVALUATION_SUMMARY.members["applicationType"], - self.application_type, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["job_arn"] = de.read_string( - _SCHEMA_EVALUATION_SUMMARY.members["jobArn"] - ) - - case 1: - kwargs["job_name"] = de.read_string( - _SCHEMA_EVALUATION_SUMMARY.members["jobName"] - ) - - case 2: - kwargs["status"] = EvaluationJobStatus( - de.read_string(_SCHEMA_EVALUATION_SUMMARY.members["status"]) - ) - - case 3: - kwargs["creation_time"] = de.read_timestamp( - _SCHEMA_EVALUATION_SUMMARY.members["creationTime"] - ) - - case 4: - kwargs["job_type"] = EvaluationJobType( - de.read_string(_SCHEMA_EVALUATION_SUMMARY.members["jobType"]) - ) - - case 5: - kwargs["evaluation_task_types"] = ( - _deserialize_evaluation_task_types( - de, - _SCHEMA_EVALUATION_SUMMARY.members["evaluationTaskTypes"], - ) - ) - - case 6: - kwargs["model_identifiers"] = ( - _deserialize_evaluation_bedrock_model_identifiers( - de, _SCHEMA_EVALUATION_SUMMARY.members["modelIdentifiers"] - ) - ) - - case 7: - kwargs["rag_identifiers"] = ( - _deserialize_evaluation_bedrock_knowledge_base_identifiers( - de, _SCHEMA_EVALUATION_SUMMARY.members["ragIdentifiers"] - ) - ) - - case 8: - kwargs["evaluator_model_identifiers"] = ( - _deserialize_evaluator_model_identifiers( - de, - _SCHEMA_EVALUATION_SUMMARY.members[ - "evaluatorModelIdentifiers" - ], - ) - ) - - case 9: - kwargs["custom_metrics_evaluator_model_identifiers"] = ( - _deserialize_evaluator_model_identifiers( - de, - _SCHEMA_EVALUATION_SUMMARY.members[ - "customMetricsEvaluatorModelIdentifiers" - ], - ) - ) - - case 10: - kwargs["inference_config_summary"] = ( - EvaluationInferenceConfigSummary.deserialize(de) - ) - - case 11: - kwargs["application_type"] = ApplicationType( - de.read_string( - _SCHEMA_EVALUATION_SUMMARY.members["applicationType"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EVALUATION_SUMMARY, consumer=_consumer) - if "job_arn" not in kwargs: - kwargs["job_arn"] = "" - if "job_name" not in kwargs: - kwargs["job_name"] = "" - if "status" not in kwargs: - kwargs["status"] = EvaluationJobStatus._corrected("") - if "creation_time" not in kwargs: - kwargs["creation_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "job_type" not in kwargs: - kwargs["job_type"] = EvaluationJobType._corrected("") - if "evaluation_task_types" not in kwargs: - kwargs["evaluation_task_types"] = [] - return kwargs - - -def _serialize_evaluation_summaries( - serializer: ShapeSerializer, schema: Schema, value: list[EvaluationSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_evaluation_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[EvaluationSummary]: - result: list[EvaluationSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(EvaluationSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListEvaluationJobsOutput: - """Dataclass for ListEvaluationJobsOutput structure.""" - - next_token: str | None = None - """ - Continuation token from the previous response, for Amazon Bedrock to - list the next set of results. - """ - - job_summaries: list[EvaluationSummary] | None = None - """A list of summaries of the evaluation jobs.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_EVALUATION_JOBS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_EVALUATION_JOBS_OUTPUT.members["nextToken"], - self.next_token, - ) - - if self.job_summaries is not None: - _serialize_evaluation_summaries( - serializer, - _SCHEMA_LIST_EVALUATION_JOBS_OUTPUT.members["jobSummaries"], - self.job_summaries, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_EVALUATION_JOBS_OUTPUT.members["nextToken"] - ) - - case 1: - kwargs["job_summaries"] = _deserialize_evaluation_summaries( - de, _SCHEMA_LIST_EVALUATION_JOBS_OUTPUT.members["jobSummaries"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_EVALUATION_JOBS_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_EVALUATION_JOBS = APIOperation( - input=ListEvaluationJobsInput, - output=ListEvaluationJobsOutput, - schema=_SCHEMA_LIST_EVALUATION_JOBS, - input_schema=_SCHEMA_LIST_EVALUATION_JOBS_INPUT, - output_schema=_SCHEMA_LIST_EVALUATION_JOBS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class StopEvaluationJobInput: - """Dataclass for StopEvaluationJobInput structure.""" - - job_identifier: str | None = field(repr=False, default=None) - """The Amazon Resource Name (ARN) of the evaluation job you want to stop.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STOP_EVALUATION_JOB_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.job_identifier is not None: - serializer.write_string( - _SCHEMA_STOP_EVALUATION_JOB_INPUT.members["jobIdentifier"], - self.job_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["job_identifier"] = de.read_string( - _SCHEMA_STOP_EVALUATION_JOB_INPUT.members["jobIdentifier"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_STOP_EVALUATION_JOB_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class StopEvaluationJobOutput: - """Dataclass for StopEvaluationJobOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STOP_EVALUATION_JOB_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_STOP_EVALUATION_JOB_OUTPUT, consumer=_consumer) - return kwargs - - -STOP_EVALUATION_JOB = APIOperation( - input=StopEvaluationJobInput, - output=StopEvaluationJobOutput, - schema=_SCHEMA_STOP_EVALUATION_JOB, - input_schema=_SCHEMA_STOP_EVALUATION_JOB_INPUT, - output_schema=_SCHEMA_STOP_EVALUATION_JOB_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrock#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -def _serialize_automated_reasoning_policy_arn_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_automated_reasoning_policy_arn_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GuardrailAutomatedReasoningPolicyConfig: - """ - Configuration settings for integrating Automated Reasoning policies with - Amazon Bedrock Guardrails. - """ - - policies: list[str] - """ - The list of Automated Reasoning policy ARNs to include in the guardrail - configuration. - """ - - confidence_threshold: float | None = None - """ - The confidence threshold for triggering guardrail actions based on - Automated Reasoning policy violations. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_POLICY_CONFIG, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_automated_reasoning_policy_arn_list( - serializer, - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_POLICY_CONFIG.members["policies"], - self.policies, - ) - if self.confidence_threshold is not None: - serializer.write_double( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_POLICY_CONFIG.members[ - "confidenceThreshold" - ], - self.confidence_threshold, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policies"] = ( - _deserialize_automated_reasoning_policy_arn_list( - de, - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_POLICY_CONFIG.members[ - "policies" - ], - ) - ) - - case 1: - kwargs["confidence_threshold"] = de.read_double( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_POLICY_CONFIG.members[ - "confidenceThreshold" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_POLICY_CONFIG, consumer=_consumer - ) - if "policies" not in kwargs: - kwargs["policies"] = [] - return kwargs - - -class GuardrailContentFilterAction(UnknownEnumMixin, StrEnum): - BLOCK = "BLOCK" - NONE = "NONE" - - -class GuardrailModality(UnknownEnumMixin, StrEnum): - TEXT = "TEXT" - IMAGE = "IMAGE" - - -def _serialize_guardrail_modalities( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_guardrail_modalities( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GuardrailModality(d.read_string(member_schema))) - - deserializer.read_list(schema, _read_value) - return result - - -class GuardrailFilterStrength(UnknownEnumMixin, StrEnum): - NONE = "NONE" - LOW = "LOW" - MEDIUM = "MEDIUM" - HIGH = "HIGH" - - -class GuardrailContentFilterType(UnknownEnumMixin, StrEnum): - SEXUAL = "SEXUAL" - VIOLENCE = "VIOLENCE" - HATE = "HATE" - INSULTS = "INSULTS" - MISCONDUCT = "MISCONDUCT" - PROMPT_ATTACK = "PROMPT_ATTACK" - - -@dataclass(kw_only=True) -class GuardrailContentFilterConfig: - """ - Contains filter strengths for harmful content. Guardrails support the - following content filters to detect and filter harmful user inputs and - FM-generated outputs. - - - **Hate** -- Describes language or a statement that discriminates, - criticizes, insults, denounces, or dehumanizes a person or group on - the basis of an identity (such as race, ethnicity, gender, religion, - sexual orientation, ability, and national origin). - - - **Insults** -- Describes language or a statement that includes - demeaning, humiliating, mocking, insulting, or belittling language. - This type of language is also labeled as bullying. - - - **Sexual** -- Describes language or a statement that indicates sexual - interest, activity, or arousal using direct or indirect references to - body parts, physical traits, or sex. - - - **Violence** -- Describes language or a statement that includes - glorification of or threats to inflict physical pain, hurt, or injury - toward a person, group or thing. - - Content filtering depends on the confidence classification of user - inputs and FM responses across each of the four harmful categories. All - input and output statements are classified into one of four confidence - levels (NONE, LOW, MEDIUM, HIGH) for each harmful category. For example, - if a statement is classified as *Hate* with HIGH confidence, the - likelihood of the statement representing hateful content is high. A - single statement can be classified across multiple categories with - varying confidence levels. For example, a single statement can be - classified as *Hate* with HIGH confidence, *Insults* with LOW - confidence, *Sexual* with NONE confidence, and *Violence* with MEDIUM - confidence. - - For more information, see [Guardrails content - filters](https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-filters.html). - """ - - type: str - """The harmful category that the content filter is applied to.""" - - input_strength: str - """ - The strength of the content filter to apply to prompts. As you increase - the filter strength, the likelihood of filtering harmful content - increases and the probability of seeing harmful content in your - application reduces. - """ - - output_strength: str - """ - The strength of the content filter to apply to model responses. As you - increase the filter strength, the likelihood of filtering harmful - content increases and the probability of seeing harmful content in your - application reduces. - """ - - input_modalities: list[str] | None = None - """ - The input modalities selected for the guardrail content filter - configuration. - """ - - output_modalities: list[str] | None = None - """ - The output modalities selected for the guardrail content filter - configuration. - """ - - input_action: str | None = field(repr=False, default=None) - """ - Specifies the action to take when harmful content is detected. Supported - values include: - - - `BLOCK` -- Block the content and replace it with blocked messaging. - - - `NONE` -- Take no action but return detection information in the trace - response. - """ - - output_action: str | None = field(repr=False, default=None) - """ - Specifies the action to take when harmful content is detected in the - output. Supported values include: - - - `BLOCK` -- Block the content and replace it with blocked messaging. - - - `NONE` -- Take no action but return detection information in the trace - response. - """ - - input_enabled: bool | None = None - """ - Specifies whether to enable guardrail evaluation on the input. When - disabled, you aren't charged for the evaluation. The evaluation - doesn't appear in the response. - """ - - output_enabled: bool | None = None - """ - Specifies whether to enable guardrail evaluation on the output. When - disabled, you aren't charged for the evaluation. The evaluation - doesn't appear in the response. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_CONTENT_FILTER_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GUARDRAIL_CONTENT_FILTER_CONFIG.members["type"], self.type - ) - serializer.write_string( - _SCHEMA_GUARDRAIL_CONTENT_FILTER_CONFIG.members["inputStrength"], - self.input_strength, - ) - serializer.write_string( - _SCHEMA_GUARDRAIL_CONTENT_FILTER_CONFIG.members["outputStrength"], - self.output_strength, - ) - if self.input_modalities is not None: - _serialize_guardrail_modalities( - serializer, - _SCHEMA_GUARDRAIL_CONTENT_FILTER_CONFIG.members["inputModalities"], - self.input_modalities, - ) - - if self.output_modalities is not None: - _serialize_guardrail_modalities( - serializer, - _SCHEMA_GUARDRAIL_CONTENT_FILTER_CONFIG.members["outputModalities"], - self.output_modalities, - ) - - if self.input_action is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_CONTENT_FILTER_CONFIG.members["inputAction"], - self.input_action, - ) - - if self.output_action is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_CONTENT_FILTER_CONFIG.members["outputAction"], - self.output_action, - ) - - if self.input_enabled is not None: - serializer.write_boolean( - _SCHEMA_GUARDRAIL_CONTENT_FILTER_CONFIG.members["inputEnabled"], - self.input_enabled, - ) - - if self.output_enabled is not None: - serializer.write_boolean( - _SCHEMA_GUARDRAIL_CONTENT_FILTER_CONFIG.members["outputEnabled"], - self.output_enabled, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = GuardrailContentFilterType( - de.read_string( - _SCHEMA_GUARDRAIL_CONTENT_FILTER_CONFIG.members["type"] - ) - ) - - case 1: - kwargs["input_strength"] = GuardrailFilterStrength( - de.read_string( - _SCHEMA_GUARDRAIL_CONTENT_FILTER_CONFIG.members[ - "inputStrength" - ] - ) - ) - - case 2: - kwargs["output_strength"] = GuardrailFilterStrength( - de.read_string( - _SCHEMA_GUARDRAIL_CONTENT_FILTER_CONFIG.members[ - "outputStrength" - ] - ) - ) - - case 3: - kwargs["input_modalities"] = _deserialize_guardrail_modalities( - de, - _SCHEMA_GUARDRAIL_CONTENT_FILTER_CONFIG.members[ - "inputModalities" - ], - ) - - case 4: - kwargs["output_modalities"] = _deserialize_guardrail_modalities( - de, - _SCHEMA_GUARDRAIL_CONTENT_FILTER_CONFIG.members[ - "outputModalities" - ], - ) - - case 5: - kwargs["input_action"] = GuardrailContentFilterAction( - de.read_string( - _SCHEMA_GUARDRAIL_CONTENT_FILTER_CONFIG.members[ - "inputAction" - ] - ) - ) - - case 6: - kwargs["output_action"] = GuardrailContentFilterAction( - de.read_string( - _SCHEMA_GUARDRAIL_CONTENT_FILTER_CONFIG.members[ - "outputAction" - ] - ) - ) - - case 7: - kwargs["input_enabled"] = de.read_boolean( - _SCHEMA_GUARDRAIL_CONTENT_FILTER_CONFIG.members["inputEnabled"] - ) - - case 8: - kwargs["output_enabled"] = de.read_boolean( - _SCHEMA_GUARDRAIL_CONTENT_FILTER_CONFIG.members["outputEnabled"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_CONTENT_FILTER_CONFIG, consumer=_consumer - ) - if "type" not in kwargs: - kwargs["type"] = GuardrailContentFilterType._corrected("") - if "input_strength" not in kwargs: - kwargs["input_strength"] = GuardrailFilterStrength._corrected("") - if "output_strength" not in kwargs: - kwargs["output_strength"] = GuardrailFilterStrength._corrected("") - return kwargs - - -def _serialize_guardrail_content_filters_config( - serializer: ShapeSerializer, - schema: Schema, - value: list[GuardrailContentFilterConfig], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_guardrail_content_filters_config( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GuardrailContentFilterConfig]: - result: list[GuardrailContentFilterConfig] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GuardrailContentFilterConfig.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class GuardrailContentFiltersTierName(UnknownEnumMixin, StrEnum): - CLASSIC = "CLASSIC" - STANDARD = "STANDARD" - - -@dataclass(kw_only=True) -class GuardrailContentFiltersTierConfig: - """ - The tier that your guardrail uses for content filters. Consider using a - tier that balances performance, accuracy, and compatibility with your - existing generative AI workflows. - """ - - tier_name: str = field(repr=False) - """ - The tier that your guardrail uses for content filters. Valid values - include: - - - `CLASSIC` tier -- Provides established guardrails functionality - supporting English, French, and Spanish languages. - - - `STANDARD` tier -- Provides a more robust solution than the `CLASSIC` - tier and has more comprehensive language support. This tier requires - that your guardrail use [cross-Region - inference](https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-cross-region.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_CONTENT_FILTERS_TIER_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GUARDRAIL_CONTENT_FILTERS_TIER_CONFIG.members["tierName"], - self.tier_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["tier_name"] = GuardrailContentFiltersTierName( - de.read_string( - _SCHEMA_GUARDRAIL_CONTENT_FILTERS_TIER_CONFIG.members[ - "tierName" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_CONTENT_FILTERS_TIER_CONFIG, consumer=_consumer - ) - if "tier_name" not in kwargs: - kwargs["tier_name"] = GuardrailContentFiltersTierName._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class GuardrailContentPolicyConfig: - """Contains details about how to handle harmful content.""" - - filters_config: list[GuardrailContentFilterConfig] - """ - Contains the type of the content filter and how strongly it should apply - to prompts and model responses. - """ - - tier_config: GuardrailContentFiltersTierConfig | None = None - """The tier that your guardrail uses for content filters.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_CONTENT_POLICY_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_guardrail_content_filters_config( - serializer, - _SCHEMA_GUARDRAIL_CONTENT_POLICY_CONFIG.members["filtersConfig"], - self.filters_config, - ) - if self.tier_config is not None: - serializer.write_struct( - _SCHEMA_GUARDRAIL_CONTENT_POLICY_CONFIG.members["tierConfig"], - self.tier_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["filters_config"] = ( - _deserialize_guardrail_content_filters_config( - de, - _SCHEMA_GUARDRAIL_CONTENT_POLICY_CONFIG.members[ - "filtersConfig" - ], - ) - ) - - case 1: - kwargs["tier_config"] = ( - GuardrailContentFiltersTierConfig.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_CONTENT_POLICY_CONFIG, consumer=_consumer - ) - if "filters_config" not in kwargs: - kwargs["filters_config"] = [] - return kwargs - - -class GuardrailContextualGroundingAction(UnknownEnumMixin, StrEnum): - BLOCK = "BLOCK" - NONE = "NONE" - - -class GuardrailContextualGroundingFilterType(UnknownEnumMixin, StrEnum): - GROUNDING = "GROUNDING" - RELEVANCE = "RELEVANCE" - - -@dataclass(kw_only=True) -class GuardrailContextualGroundingFilterConfig: - """ - The filter configuration details for the guardrails contextual grounding - filter. - """ - - type: str - """The filter details for the guardrails contextual grounding filter.""" - - threshold: float - """The threshold details for the guardrails contextual grounding filter.""" - - action: str | None = field(repr=False, default=None) - """ - Specifies the action to take when content fails the contextual grounding - evaluation. Supported values include: - - - `BLOCK` -- Block the content and replace it with blocked messaging. - - - `NONE` -- Take no action but return detection information in the trace - response. - """ - - enabled: bool | None = None - """ - Specifies whether to enable contextual grounding evaluation. When - disabled, you aren't charged for the evaluation. The evaluation - doesn't appear in the response. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER_CONFIG, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER_CONFIG.members["type"], - self.type, - ) - serializer.write_double( - _SCHEMA_GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER_CONFIG.members["threshold"], - self.threshold, - ) - if self.action is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER_CONFIG.members["action"], - self.action, - ) - - if self.enabled is not None: - serializer.write_boolean( - _SCHEMA_GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER_CONFIG.members["enabled"], - self.enabled, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = GuardrailContextualGroundingFilterType( - de.read_string( - _SCHEMA_GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER_CONFIG.members[ - "type" - ] - ) - ) - - case 1: - kwargs["threshold"] = de.read_double( - _SCHEMA_GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER_CONFIG.members[ - "threshold" - ] - ) - - case 2: - kwargs["action"] = GuardrailContextualGroundingAction( - de.read_string( - _SCHEMA_GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER_CONFIG.members[ - "action" - ] - ) - ) - - case 3: - kwargs["enabled"] = de.read_boolean( - _SCHEMA_GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER_CONFIG.members[ - "enabled" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER_CONFIG, consumer=_consumer - ) - if "type" not in kwargs: - kwargs["type"] = GuardrailContextualGroundingFilterType._corrected("") - if "threshold" not in kwargs: - kwargs["threshold"] = 0.0 - return kwargs - - -def _serialize_guardrail_contextual_grounding_filters_config( - serializer: ShapeSerializer, - schema: Schema, - value: list[GuardrailContextualGroundingFilterConfig], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_guardrail_contextual_grounding_filters_config( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GuardrailContextualGroundingFilterConfig]: - result: list[GuardrailContextualGroundingFilterConfig] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GuardrailContextualGroundingFilterConfig.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GuardrailContextualGroundingPolicyConfig: - """ - The policy configuration details for the guardrails contextual grounding - policy. - """ - - filters_config: list[GuardrailContextualGroundingFilterConfig] - """ - The filter configuration details for the guardrails contextual grounding - policy. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GUARDRAIL_CONTEXTUAL_GROUNDING_POLICY_CONFIG, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_guardrail_contextual_grounding_filters_config( - serializer, - _SCHEMA_GUARDRAIL_CONTEXTUAL_GROUNDING_POLICY_CONFIG.members[ - "filtersConfig" - ], - self.filters_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["filters_config"] = ( - _deserialize_guardrail_contextual_grounding_filters_config( - de, - _SCHEMA_GUARDRAIL_CONTEXTUAL_GROUNDING_POLICY_CONFIG.members[ - "filtersConfig" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_CONTEXTUAL_GROUNDING_POLICY_CONFIG, consumer=_consumer - ) - if "filters_config" not in kwargs: - kwargs["filters_config"] = [] - return kwargs - - -@dataclass(kw_only=True) -class GuardrailCrossRegionConfig: - """ - The system-defined guardrail profile that you're using with your - guardrail. Guardrail profiles define the destination Amazon Web Services - Regions where guardrail inference requests can be automatically routed. - Using guardrail profiles helps maintain guardrail performance and - reliability when demand increases. - - For more information, see the [Amazon Bedrock User - Guide](https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-cross-region.html). - """ - - guardrail_profile_identifier: str - """ - The ID or Amazon Resource Name (ARN) of the guardrail profile that your - guardrail is using. Guardrail profile availability depends on your - current Amazon Web Services Region. For more information, see the - [Amazon Bedrock User - Guide](https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-cross-region-support.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_CROSS_REGION_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GUARDRAIL_CROSS_REGION_CONFIG.members["guardrailProfileIdentifier"], - self.guardrail_profile_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["guardrail_profile_identifier"] = de.read_string( - _SCHEMA_GUARDRAIL_CROSS_REGION_CONFIG.members[ - "guardrailProfileIdentifier" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_CROSS_REGION_CONFIG, consumer=_consumer - ) - if "guardrail_profile_identifier" not in kwargs: - kwargs["guardrail_profile_identifier"] = "" - return kwargs - - -class GuardrailSensitiveInformationAction(UnknownEnumMixin, StrEnum): - BLOCK = "BLOCK" - ANONYMIZE = "ANONYMIZE" - NONE = "NONE" - - -class GuardrailPiiEntityType(UnknownEnumMixin, StrEnum): - ADDRESS = "ADDRESS" - AGE = "AGE" - AWS_ACCESS_KEY = "AWS_ACCESS_KEY" - AWS_SECRET_KEY = "AWS_SECRET_KEY" - CA_HEALTH_NUMBER = "CA_HEALTH_NUMBER" - CA_SOCIAL_INSURANCE_NUMBER = "CA_SOCIAL_INSURANCE_NUMBER" - CREDIT_DEBIT_CARD_CVV = "CREDIT_DEBIT_CARD_CVV" - CREDIT_DEBIT_CARD_EXPIRY = "CREDIT_DEBIT_CARD_EXPIRY" - CREDIT_DEBIT_CARD_NUMBER = "CREDIT_DEBIT_CARD_NUMBER" - DRIVER_ID = "DRIVER_ID" - EMAIL = "EMAIL" - INTERNATIONAL_BANK_ACCOUNT_NUMBER = "INTERNATIONAL_BANK_ACCOUNT_NUMBER" - IP_ADDRESS = "IP_ADDRESS" - LICENSE_PLATE = "LICENSE_PLATE" - MAC_ADDRESS = "MAC_ADDRESS" - NAME = "NAME" - PASSWORD = "PASSWORD" - PHONE = "PHONE" - PIN = "PIN" - SWIFT_CODE = "SWIFT_CODE" - UK_NATIONAL_HEALTH_SERVICE_NUMBER = "UK_NATIONAL_HEALTH_SERVICE_NUMBER" - UK_NATIONAL_INSURANCE_NUMBER = "UK_NATIONAL_INSURANCE_NUMBER" - UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER = "UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER" - URL = "URL" - USERNAME = "USERNAME" - US_BANK_ACCOUNT_NUMBER = "US_BANK_ACCOUNT_NUMBER" - US_BANK_ROUTING_NUMBER = "US_BANK_ROUTING_NUMBER" - US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER = "US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER" - US_PASSPORT_NUMBER = "US_PASSPORT_NUMBER" - US_SOCIAL_SECURITY_NUMBER = "US_SOCIAL_SECURITY_NUMBER" - VEHICLE_IDENTIFICATION_NUMBER = "VEHICLE_IDENTIFICATION_NUMBER" - - -@dataclass(kw_only=True) -class GuardrailPiiEntityConfig: - """The PII entity to configure for the guardrail.""" - - type: str - """ - Configure guardrail type when the PII entity is detected. - - The following PIIs are used to block or mask sensitive information: - - - **General** - - - **ADDRESS** - - A physical address, such as \"100 Main Street, Anytown, USA\" or - \"Suite #12, Building 123\". An address can include information such - as the street, building, location, city, state, country, county, zip - code, precinct, and neighborhood. - - - **AGE** - - An individual's age, including the quantity and unit of time. For - example, in the phrase \"I am 40 years old,\" Guardrails recognizes - \"40 years\" as an age. - - - **NAME** - - An individual's name. This entity type does not include titles, - such as Dr., Mr., Mrs., or Miss. guardrails doesn't apply this - entity type to names that are part of organizations or addresses. - For example, guardrails recognizes the \"John Doe Organization\" as - an organization, and it recognizes \"Jane Doe Street\" as an - address. - - - **EMAIL** - - An email address, such as *marymajor@email.com*. - - - **PHONE** - - A phone number. This entity type also includes fax and pager - numbers. - - - **USERNAME** - - A user name that identifies an account, such as a login name, screen - name, nick name, or handle. - - - **PASSWORD** - - An alphanumeric string that is used as a password, such as - \"**very20special#pass**\". - - - **DRIVER_ID** - - The number assigned to a driver's license, which is an official - document permitting an individual to operate one or more motorized - vehicles on a public road. A driver's license number consists of - alphanumeric characters. - - - **LICENSE_PLATE** - - A license plate for a vehicle is issued by the state or country - where the vehicle is registered. The format for passenger vehicles - is typically five to eight digits, consisting of upper-case letters - and numbers. The format varies depending on the location of the - issuing state or country. - - - **VEHICLE_IDENTIFICATION_NUMBER** - - A Vehicle Identification Number (VIN) uniquely identifies a vehicle. - VIN content and format are defined in the *ISO 3779* specification. - Each country has specific codes and formats for VINs. - - - **Finance** - - - **CREDIT_DEBIT_CARD_CVV** - - A three-digit card verification code (CVV) that is present on VISA, - MasterCard, and Discover credit and debit cards. For American - Express credit or debit cards, the CVV is a four-digit numeric code. - - - **CREDIT_DEBIT_CARD_EXPIRY** - - The expiration date for a credit or debit card. This number is - usually four digits long and is often formatted as *month/year* or - *MM/YY*. Guardrails recognizes expiration dates such as *01/21*, - *01/2021*, and *Jan 2021*. - - - **CREDIT_DEBIT_CARD_NUMBER** - - The number for a credit or debit card. These numbers can vary from - 13 to 16 digits in length. However, Amazon Comprehend also - recognizes credit or debit card numbers when only the last four - digits are present. - - - **PIN** - - A four-digit personal identification number (PIN) with which you can - access your bank account. - - - **INTERNATIONAL_BANK_ACCOUNT_NUMBER** - - An International Bank Account Number has specific formats in each - country. For more information, see - [www.iban.com/structure](https://www.iban.com/structure). - - - **SWIFT_CODE** - - A SWIFT code is a standard format of Bank Identifier Code (BIC) used - to specify a particular bank or branch. Banks use these codes for - money transfers such as international wire transfers. - - SWIFT codes consist of eight or 11 characters. The 11-digit codes - refer to specific branches, while eight-digit codes (or 11-digit - codes ending in 'XXX') refer to the head or primary office. - - - **IT** - - - **IP_ADDRESS** - - An IPv4 address, such as *198.51.100.0*. - - - **MAC_ADDRESS** - - A *media access control* (MAC) address is a unique identifier - assigned to a network interface controller (NIC). - - - **URL** - - A web address, such as *www.example.com*. - - - **AWS_ACCESS_KEY** - - A unique identifier that's associated with a secret access key; you - use the access key ID and secret access key to sign programmatic - Amazon Web Services requests cryptographically. - - - **AWS_SECRET_KEY** - - A unique identifier that's associated with an access key. You use - the access key ID and secret access key to sign programmatic Amazon - Web Services requests cryptographically. - - - **USA specific** - - - **US_BANK_ACCOUNT_NUMBER** - - A US bank account number, which is typically 10 to 12 digits long. - - - **US_BANK_ROUTING_NUMBER** - - A US bank account routing number. These are typically nine digits - long, - - - **US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER** - - A US Individual Taxpayer Identification Number (ITIN) is a - nine-digit number that starts with a \"9\" and contain a \"7\" or - \"8\" as the fourth digit. An ITIN can be formatted with a space or - a dash after the third and forth digits. - - - **US_PASSPORT_NUMBER** - - A US passport number. Passport numbers range from six to nine - alphanumeric characters. - - - **US_SOCIAL_SECURITY_NUMBER** - - A US Social Security Number (SSN) is a nine-digit number that is - issued to US citizens, permanent residents, and temporary working - residents. - - - **Canada specific** - - - **CA_HEALTH_NUMBER** - - A Canadian Health Service Number is a 10-digit unique identifier, - required for individuals to access healthcare benefits. - - - **CA_SOCIAL_INSURANCE_NUMBER** - - A Canadian Social Insurance Number (SIN) is a nine-digit unique - identifier, required for individuals to access government programs - and benefits. - - The SIN is formatted as three groups of three digits, such as - *123-456-789*. A SIN can be validated through a simple check-digit - process called the [Luhn - algorithm](https://www.wikipedia.org/wiki/Luhn_algorithm). - - - **UK Specific** - - - **UK_NATIONAL_HEALTH_SERVICE_NUMBER** - - A UK National Health Service Number is a 10-17 digit number, such as - *485 777 3456*. The current system formats the 10-digit number with - spaces after the third and sixth digits. The final digit is an - error-detecting checksum. - - - **UK_NATIONAL_INSURANCE_NUMBER** - - A UK National Insurance Number (NINO) provides individuals with - access to National Insurance (social security) benefits. It is also - used for some purposes in the UK tax system. - - The number is nine digits long and starts with two letters, followed - by six numbers and one letter. A NINO can be formatted with a space - or a dash after the two letters and after the second, forth, and - sixth digits. - - - **UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER** - - A UK Unique Taxpayer Reference (UTR) is a 10-digit number that - identifies a taxpayer or a business. - - - **Custom** - - - **Regex filter** - You can use a regular expressions to define - patterns for a guardrail to recognize and act upon such as serial - number, booking ID etc.. - """ - - action: str - """Configure guardrail action when the PII entity is detected.""" - - input_action: str | None = None - """ - Specifies the action to take when harmful content is detected in the - input. Supported values include: - - - `BLOCK` -- Block the content and replace it with blocked messaging. - - - `ANONYMIZE` -- Mask the content and replace it with identifier tags. - - - `NONE` -- Take no action but return detection information in the trace - response. - """ - - output_action: str | None = None - """ - Specifies the action to take when harmful content is detected in the - output. Supported values include: - - - `BLOCK` -- Block the content and replace it with blocked messaging. - - - `ANONYMIZE` -- Mask the content and replace it with identifier tags. - - - `NONE` -- Take no action but return detection information in the trace - response. - """ - - input_enabled: bool | None = None - """ - Specifies whether to enable guardrail evaluation on the input. When - disabled, you aren't charged for the evaluation. The evaluation - doesn't appear in the response. - """ - - output_enabled: bool | None = None - """ - Specifies whether to enable guardrail evaluation on the output. When - disabled, you aren't charged for the evaluation. The evaluation - doesn't appear in the response. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_PII_ENTITY_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GUARDRAIL_PII_ENTITY_CONFIG.members["type"], self.type - ) - serializer.write_string( - _SCHEMA_GUARDRAIL_PII_ENTITY_CONFIG.members["action"], self.action - ) - if self.input_action is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_PII_ENTITY_CONFIG.members["inputAction"], - self.input_action, - ) - - if self.output_action is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_PII_ENTITY_CONFIG.members["outputAction"], - self.output_action, - ) - - if self.input_enabled is not None: - serializer.write_boolean( - _SCHEMA_GUARDRAIL_PII_ENTITY_CONFIG.members["inputEnabled"], - self.input_enabled, - ) - - if self.output_enabled is not None: - serializer.write_boolean( - _SCHEMA_GUARDRAIL_PII_ENTITY_CONFIG.members["outputEnabled"], - self.output_enabled, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = GuardrailPiiEntityType( - de.read_string( - _SCHEMA_GUARDRAIL_PII_ENTITY_CONFIG.members["type"] - ) - ) - - case 1: - kwargs["action"] = GuardrailSensitiveInformationAction( - de.read_string( - _SCHEMA_GUARDRAIL_PII_ENTITY_CONFIG.members["action"] - ) - ) - - case 2: - kwargs["input_action"] = GuardrailSensitiveInformationAction( - de.read_string( - _SCHEMA_GUARDRAIL_PII_ENTITY_CONFIG.members["inputAction"] - ) - ) - - case 3: - kwargs["output_action"] = GuardrailSensitiveInformationAction( - de.read_string( - _SCHEMA_GUARDRAIL_PII_ENTITY_CONFIG.members["outputAction"] - ) - ) - - case 4: - kwargs["input_enabled"] = de.read_boolean( - _SCHEMA_GUARDRAIL_PII_ENTITY_CONFIG.members["inputEnabled"] - ) - - case 5: - kwargs["output_enabled"] = de.read_boolean( - _SCHEMA_GUARDRAIL_PII_ENTITY_CONFIG.members["outputEnabled"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_PII_ENTITY_CONFIG, consumer=_consumer - ) - if "type" not in kwargs: - kwargs["type"] = GuardrailPiiEntityType._corrected("") - if "action" not in kwargs: - kwargs["action"] = GuardrailSensitiveInformationAction._corrected("") - return kwargs - - -def _serialize_guardrail_pii_entities_config( - serializer: ShapeSerializer, schema: Schema, value: list[GuardrailPiiEntityConfig] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_guardrail_pii_entities_config( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GuardrailPiiEntityConfig]: - result: list[GuardrailPiiEntityConfig] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GuardrailPiiEntityConfig.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GuardrailRegexConfig: - """The regular expression to configure for the guardrail.""" - - name: str - """The name of the regular expression to configure for the guardrail.""" - - pattern: str - """The regular expression pattern to configure for the guardrail.""" - - action: str - """ - The guardrail action to configure when matching regular expression is - detected. - """ - - description: str | None = None - """ - The description of the regular expression to configure for the - guardrail. - """ - - input_action: str | None = None - """ - Specifies the action to take when harmful content is detected in the - input. Supported values include: - - - `BLOCK` -- Block the content and replace it with blocked messaging. - - - `NONE` -- Take no action but return detection information in the trace - response. - """ - - output_action: str | None = None - """ - Specifies the action to take when harmful content is detected in the - output. Supported values include: - - - `BLOCK` -- Block the content and replace it with blocked messaging. - - - `NONE` -- Take no action but return detection information in the trace - response. - """ - - input_enabled: bool | None = None - """ - Specifies whether to enable guardrail evaluation on the input. When - disabled, you aren't charged for the evaluation. The evaluation - doesn't appear in the response. - """ - - output_enabled: bool | None = None - """ - Specifies whether to enable guardrail evaluation on the output. When - disabled, you aren't charged for the evaluation. The evaluation - doesn't appear in the response. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_REGEX_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GUARDRAIL_REGEX_CONFIG.members["name"], self.name - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_REGEX_CONFIG.members["description"], self.description - ) - - serializer.write_string( - _SCHEMA_GUARDRAIL_REGEX_CONFIG.members["pattern"], self.pattern - ) - serializer.write_string( - _SCHEMA_GUARDRAIL_REGEX_CONFIG.members["action"], self.action - ) - if self.input_action is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_REGEX_CONFIG.members["inputAction"], self.input_action - ) - - if self.output_action is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_REGEX_CONFIG.members["outputAction"], - self.output_action, - ) - - if self.input_enabled is not None: - serializer.write_boolean( - _SCHEMA_GUARDRAIL_REGEX_CONFIG.members["inputEnabled"], - self.input_enabled, - ) - - if self.output_enabled is not None: - serializer.write_boolean( - _SCHEMA_GUARDRAIL_REGEX_CONFIG.members["outputEnabled"], - self.output_enabled, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_GUARDRAIL_REGEX_CONFIG.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_GUARDRAIL_REGEX_CONFIG.members["description"] - ) - - case 2: - kwargs["pattern"] = de.read_string( - _SCHEMA_GUARDRAIL_REGEX_CONFIG.members["pattern"] - ) - - case 3: - kwargs["action"] = GuardrailSensitiveInformationAction( - de.read_string(_SCHEMA_GUARDRAIL_REGEX_CONFIG.members["action"]) - ) - - case 4: - kwargs["input_action"] = GuardrailSensitiveInformationAction( - de.read_string( - _SCHEMA_GUARDRAIL_REGEX_CONFIG.members["inputAction"] - ) - ) - - case 5: - kwargs["output_action"] = GuardrailSensitiveInformationAction( - de.read_string( - _SCHEMA_GUARDRAIL_REGEX_CONFIG.members["outputAction"] - ) - ) - - case 6: - kwargs["input_enabled"] = de.read_boolean( - _SCHEMA_GUARDRAIL_REGEX_CONFIG.members["inputEnabled"] - ) - - case 7: - kwargs["output_enabled"] = de.read_boolean( - _SCHEMA_GUARDRAIL_REGEX_CONFIG.members["outputEnabled"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GUARDRAIL_REGEX_CONFIG, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "pattern" not in kwargs: - kwargs["pattern"] = "" - if "action" not in kwargs: - kwargs["action"] = GuardrailSensitiveInformationAction._corrected("") - return kwargs - - -def _serialize_guardrail_regexes_config( - serializer: ShapeSerializer, schema: Schema, value: list[GuardrailRegexConfig] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_guardrail_regexes_config( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GuardrailRegexConfig]: - result: list[GuardrailRegexConfig] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GuardrailRegexConfig.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GuardrailSensitiveInformationPolicyConfig: - """ - Contains details about PII entities and regular expressions to configure - for the guardrail. - """ - - pii_entities_config: list[GuardrailPiiEntityConfig] | None = None - """A list of PII entities to configure to the guardrail.""" - - regexes_config: list[GuardrailRegexConfig] | None = None - """A list of regular expressions to configure to the guardrail.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GUARDRAIL_SENSITIVE_INFORMATION_POLICY_CONFIG, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.pii_entities_config is not None: - _serialize_guardrail_pii_entities_config( - serializer, - _SCHEMA_GUARDRAIL_SENSITIVE_INFORMATION_POLICY_CONFIG.members[ - "piiEntitiesConfig" - ], - self.pii_entities_config, - ) - - if self.regexes_config is not None: - _serialize_guardrail_regexes_config( - serializer, - _SCHEMA_GUARDRAIL_SENSITIVE_INFORMATION_POLICY_CONFIG.members[ - "regexesConfig" - ], - self.regexes_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["pii_entities_config"] = ( - _deserialize_guardrail_pii_entities_config( - de, - _SCHEMA_GUARDRAIL_SENSITIVE_INFORMATION_POLICY_CONFIG.members[ - "piiEntitiesConfig" - ], - ) - ) - - case 1: - kwargs["regexes_config"] = _deserialize_guardrail_regexes_config( - de, - _SCHEMA_GUARDRAIL_SENSITIVE_INFORMATION_POLICY_CONFIG.members[ - "regexesConfig" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_SENSITIVE_INFORMATION_POLICY_CONFIG, consumer=_consumer - ) - return kwargs - - -class GuardrailTopicsTierName(UnknownEnumMixin, StrEnum): - CLASSIC = "CLASSIC" - STANDARD = "STANDARD" - - -@dataclass(kw_only=True) -class GuardrailTopicsTierConfig: - """ - The tier that your guardrail uses for denied topic filters. Consider - using a tier that balances performance, accuracy, and compatibility with - your existing generative AI workflows. - """ - - tier_name: str = field(repr=False) - """ - The tier that your guardrail uses for denied topic filters. Valid values - include: - - - `CLASSIC` tier -- Provides established guardrails functionality - supporting English, French, and Spanish languages. - - - `STANDARD` tier -- Provides a more robust solution than the `CLASSIC` - tier and has more comprehensive language support. This tier requires - that your guardrail use [cross-Region - inference](https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-cross-region.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_TOPICS_TIER_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GUARDRAIL_TOPICS_TIER_CONFIG.members["tierName"], self.tier_name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["tier_name"] = GuardrailTopicsTierName( - de.read_string( - _SCHEMA_GUARDRAIL_TOPICS_TIER_CONFIG.members["tierName"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_TOPICS_TIER_CONFIG, consumer=_consumer - ) - if "tier_name" not in kwargs: - kwargs["tier_name"] = GuardrailTopicsTierName._corrected("") - return kwargs - - -def _serialize_guardrail_topic_examples( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_guardrail_topic_examples( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -class GuardrailTopicAction(UnknownEnumMixin, StrEnum): - BLOCK = "BLOCK" - NONE = "NONE" - - -class GuardrailTopicType(UnknownEnumMixin, StrEnum): - DENY = "DENY" - - -@dataclass(kw_only=True) -class GuardrailTopicConfig: - """Details about topics for the guardrail to identify and deny.""" - - name: str = field(repr=False) - """The name of the topic to deny.""" - - definition: str = field(repr=False) - """A definition of the topic to deny.""" - - type: str - """Specifies to deny the topic.""" - - examples: list[str] | None = None - """ - A list of prompts, each of which is an example of a prompt that can be - categorized as belonging to the topic. - """ - - input_action: str | None = field(repr=False, default=None) - """ - Specifies the action to take when harmful content is detected in the - input. Supported values include: - - - `BLOCK` -- Block the content and replace it with blocked messaging. - - - `NONE` -- Take no action but return detection information in the trace - response. - """ - - output_action: str | None = field(repr=False, default=None) - """ - Specifies the action to take when harmful content is detected in the - output. Supported values include: - - - `BLOCK` -- Block the content and replace it with blocked messaging. - - - `NONE` -- Take no action but return detection information in the trace - response. - """ - - input_enabled: bool | None = None - """ - Specifies whether to enable guardrail evaluation on the input. When - disabled, you aren't charged for the evaluation. The evaluation - doesn't appear in the response. - """ - - output_enabled: bool | None = None - """ - Specifies whether to enable guardrail evaluation on the output. When - disabled, you aren't charged for the evaluation. The evaluation - doesn't appear in the response. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_TOPIC_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GUARDRAIL_TOPIC_CONFIG.members["name"], self.name - ) - serializer.write_string( - _SCHEMA_GUARDRAIL_TOPIC_CONFIG.members["definition"], self.definition - ) - if self.examples is not None: - _serialize_guardrail_topic_examples( - serializer, - _SCHEMA_GUARDRAIL_TOPIC_CONFIG.members["examples"], - self.examples, - ) - - serializer.write_string( - _SCHEMA_GUARDRAIL_TOPIC_CONFIG.members["type"], self.type - ) - if self.input_action is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_TOPIC_CONFIG.members["inputAction"], self.input_action - ) - - if self.output_action is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_TOPIC_CONFIG.members["outputAction"], - self.output_action, - ) - - if self.input_enabled is not None: - serializer.write_boolean( - _SCHEMA_GUARDRAIL_TOPIC_CONFIG.members["inputEnabled"], - self.input_enabled, - ) - - if self.output_enabled is not None: - serializer.write_boolean( - _SCHEMA_GUARDRAIL_TOPIC_CONFIG.members["outputEnabled"], - self.output_enabled, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_GUARDRAIL_TOPIC_CONFIG.members["name"] - ) - - case 1: - kwargs["definition"] = de.read_string( - _SCHEMA_GUARDRAIL_TOPIC_CONFIG.members["definition"] - ) - - case 2: - kwargs["examples"] = _deserialize_guardrail_topic_examples( - de, _SCHEMA_GUARDRAIL_TOPIC_CONFIG.members["examples"] - ) - - case 3: - kwargs["type"] = GuardrailTopicType( - de.read_string(_SCHEMA_GUARDRAIL_TOPIC_CONFIG.members["type"]) - ) - - case 4: - kwargs["input_action"] = GuardrailTopicAction( - de.read_string( - _SCHEMA_GUARDRAIL_TOPIC_CONFIG.members["inputAction"] - ) - ) - - case 5: - kwargs["output_action"] = GuardrailTopicAction( - de.read_string( - _SCHEMA_GUARDRAIL_TOPIC_CONFIG.members["outputAction"] - ) - ) - - case 6: - kwargs["input_enabled"] = de.read_boolean( - _SCHEMA_GUARDRAIL_TOPIC_CONFIG.members["inputEnabled"] - ) - - case 7: - kwargs["output_enabled"] = de.read_boolean( - _SCHEMA_GUARDRAIL_TOPIC_CONFIG.members["outputEnabled"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GUARDRAIL_TOPIC_CONFIG, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "definition" not in kwargs: - kwargs["definition"] = "" - if "type" not in kwargs: - kwargs["type"] = GuardrailTopicType._corrected("") - return kwargs - - -def _serialize_guardrail_topics_config( - serializer: ShapeSerializer, schema: Schema, value: list[GuardrailTopicConfig] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_guardrail_topics_config( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GuardrailTopicConfig]: - result: list[GuardrailTopicConfig] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GuardrailTopicConfig.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GuardrailTopicPolicyConfig: - """ - Contains details about topics that the guardrail should identify and - deny. - """ - - topics_config: list[GuardrailTopicConfig] - """A list of policies related to topics that the guardrail should deny.""" - - tier_config: GuardrailTopicsTierConfig | None = None - """The tier that your guardrail uses for denied topic filters.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_TOPIC_POLICY_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_guardrail_topics_config( - serializer, - _SCHEMA_GUARDRAIL_TOPIC_POLICY_CONFIG.members["topicsConfig"], - self.topics_config, - ) - if self.tier_config is not None: - serializer.write_struct( - _SCHEMA_GUARDRAIL_TOPIC_POLICY_CONFIG.members["tierConfig"], - self.tier_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["topics_config"] = _deserialize_guardrail_topics_config( - de, - _SCHEMA_GUARDRAIL_TOPIC_POLICY_CONFIG.members["topicsConfig"], - ) - - case 1: - kwargs["tier_config"] = GuardrailTopicsTierConfig.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_TOPIC_POLICY_CONFIG, consumer=_consumer - ) - if "topics_config" not in kwargs: - kwargs["topics_config"] = [] - return kwargs - - -class GuardrailWordAction(UnknownEnumMixin, StrEnum): - BLOCK = "BLOCK" - NONE = "NONE" - - -class GuardrailManagedWordsType(UnknownEnumMixin, StrEnum): - PROFANITY = "PROFANITY" - - -@dataclass(kw_only=True) -class GuardrailManagedWordsConfig: - """The managed word list to configure for the guardrail.""" - - type: str - """The managed word type to configure for the guardrail.""" - - input_action: str | None = field(repr=False, default=None) - """ - Specifies the action to take when harmful content is detected in the - input. Supported values include: - - - `BLOCK` -- Block the content and replace it with blocked messaging. - - - `NONE` -- Take no action but return detection information in the trace - response. - """ - - output_action: str | None = field(repr=False, default=None) - """ - Specifies the action to take when harmful content is detected in the - output. Supported values include: - - - `BLOCK` -- Block the content and replace it with blocked messaging. - - - `NONE` -- Take no action but return detection information in the trace - response. - """ - - input_enabled: bool | None = None - """ - Specifies whether to enable guardrail evaluation on the input. When - disabled, you aren't charged for the evaluation. The evaluation - doesn't appear in the response. - """ - - output_enabled: bool | None = None - """ - Specifies whether to enable guardrail evaluation on the output. When - disabled, you aren't charged for the evaluation. The evaluation - doesn't appear in the response. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_MANAGED_WORDS_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GUARDRAIL_MANAGED_WORDS_CONFIG.members["type"], self.type - ) - if self.input_action is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_MANAGED_WORDS_CONFIG.members["inputAction"], - self.input_action, - ) - - if self.output_action is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_MANAGED_WORDS_CONFIG.members["outputAction"], - self.output_action, - ) - - if self.input_enabled is not None: - serializer.write_boolean( - _SCHEMA_GUARDRAIL_MANAGED_WORDS_CONFIG.members["inputEnabled"], - self.input_enabled, - ) - - if self.output_enabled is not None: - serializer.write_boolean( - _SCHEMA_GUARDRAIL_MANAGED_WORDS_CONFIG.members["outputEnabled"], - self.output_enabled, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = GuardrailManagedWordsType( - de.read_string( - _SCHEMA_GUARDRAIL_MANAGED_WORDS_CONFIG.members["type"] - ) - ) - - case 1: - kwargs["input_action"] = GuardrailWordAction( - de.read_string( - _SCHEMA_GUARDRAIL_MANAGED_WORDS_CONFIG.members[ - "inputAction" - ] - ) - ) - - case 2: - kwargs["output_action"] = GuardrailWordAction( - de.read_string( - _SCHEMA_GUARDRAIL_MANAGED_WORDS_CONFIG.members[ - "outputAction" - ] - ) - ) - - case 3: - kwargs["input_enabled"] = de.read_boolean( - _SCHEMA_GUARDRAIL_MANAGED_WORDS_CONFIG.members["inputEnabled"] - ) - - case 4: - kwargs["output_enabled"] = de.read_boolean( - _SCHEMA_GUARDRAIL_MANAGED_WORDS_CONFIG.members["outputEnabled"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_MANAGED_WORDS_CONFIG, consumer=_consumer - ) - if "type" not in kwargs: - kwargs["type"] = GuardrailManagedWordsType._corrected("") - return kwargs - - -def _serialize_guardrail_managed_word_lists_config( - serializer: ShapeSerializer, - schema: Schema, - value: list[GuardrailManagedWordsConfig], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_guardrail_managed_word_lists_config( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GuardrailManagedWordsConfig]: - result: list[GuardrailManagedWordsConfig] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GuardrailManagedWordsConfig.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GuardrailWordConfig: - """A word to configure for the guardrail.""" - - text: str - """Text of the word configured for the guardrail to block.""" - - input_action: str | None = field(repr=False, default=None) - """ - Specifies the action to take when harmful content is detected in the - input. Supported values include: - - - `BLOCK` -- Block the content and replace it with blocked messaging. - - - `NONE` -- Take no action but return detection information in the trace - response. - """ - - output_action: str | None = field(repr=False, default=None) - """ - Specifies the action to take when harmful content is detected in the - output. Supported values include: - - - `BLOCK` -- Block the content and replace it with blocked messaging. - - - `NONE` -- Take no action but return detection information in the trace - response. - """ - - input_enabled: bool | None = None - """ - Specifies whether to enable guardrail evaluation on the intput. When - disabled, you aren't charged for the evaluation. The evaluation - doesn't appear in the response. - """ - - output_enabled: bool | None = None - """ - Specifies whether to enable guardrail evaluation on the output. When - disabled, you aren't charged for the evaluation. The evaluation - doesn't appear in the response. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_WORD_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GUARDRAIL_WORD_CONFIG.members["text"], self.text - ) - if self.input_action is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_WORD_CONFIG.members["inputAction"], self.input_action - ) - - if self.output_action is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_WORD_CONFIG.members["outputAction"], - self.output_action, - ) - - if self.input_enabled is not None: - serializer.write_boolean( - _SCHEMA_GUARDRAIL_WORD_CONFIG.members["inputEnabled"], - self.input_enabled, - ) - - if self.output_enabled is not None: - serializer.write_boolean( - _SCHEMA_GUARDRAIL_WORD_CONFIG.members["outputEnabled"], - self.output_enabled, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["text"] = de.read_string( - _SCHEMA_GUARDRAIL_WORD_CONFIG.members["text"] - ) - - case 1: - kwargs["input_action"] = GuardrailWordAction( - de.read_string( - _SCHEMA_GUARDRAIL_WORD_CONFIG.members["inputAction"] - ) - ) - - case 2: - kwargs["output_action"] = GuardrailWordAction( - de.read_string( - _SCHEMA_GUARDRAIL_WORD_CONFIG.members["outputAction"] - ) - ) - - case 3: - kwargs["input_enabled"] = de.read_boolean( - _SCHEMA_GUARDRAIL_WORD_CONFIG.members["inputEnabled"] - ) - - case 4: - kwargs["output_enabled"] = de.read_boolean( - _SCHEMA_GUARDRAIL_WORD_CONFIG.members["outputEnabled"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GUARDRAIL_WORD_CONFIG, consumer=_consumer) - if "text" not in kwargs: - kwargs["text"] = "" - return kwargs - - -def _serialize_guardrail_words_config( - serializer: ShapeSerializer, schema: Schema, value: list[GuardrailWordConfig] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_guardrail_words_config( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GuardrailWordConfig]: - result: list[GuardrailWordConfig] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GuardrailWordConfig.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GuardrailWordPolicyConfig: - """Contains details about the word policy to configured for the guardrail.""" - - words_config: list[GuardrailWordConfig] | None = None - """A list of words to configure for the guardrail.""" - - managed_word_lists_config: list[GuardrailManagedWordsConfig] | None = None - """A list of managed words to configure for the guardrail.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_WORD_POLICY_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.words_config is not None: - _serialize_guardrail_words_config( - serializer, - _SCHEMA_GUARDRAIL_WORD_POLICY_CONFIG.members["wordsConfig"], - self.words_config, - ) - - if self.managed_word_lists_config is not None: - _serialize_guardrail_managed_word_lists_config( - serializer, - _SCHEMA_GUARDRAIL_WORD_POLICY_CONFIG.members["managedWordListsConfig"], - self.managed_word_lists_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["words_config"] = _deserialize_guardrail_words_config( - de, _SCHEMA_GUARDRAIL_WORD_POLICY_CONFIG.members["wordsConfig"] - ) - - case 1: - kwargs["managed_word_lists_config"] = ( - _deserialize_guardrail_managed_word_lists_config( - de, - _SCHEMA_GUARDRAIL_WORD_POLICY_CONFIG.members[ - "managedWordListsConfig" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_WORD_POLICY_CONFIG, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CreateGuardrailInput: - """Dataclass for CreateGuardrailInput structure.""" - - name: str | None = field(repr=False, default=None) - """The name to give the guardrail.""" - - description: str | None = field(repr=False, default=None) - """A description of the guardrail.""" - - topic_policy_config: GuardrailTopicPolicyConfig | None = None - """The topic policies to configure for the guardrail.""" - - content_policy_config: GuardrailContentPolicyConfig | None = None - """The content filter policies to configure for the guardrail.""" - - word_policy_config: GuardrailWordPolicyConfig | None = None - """The word policy you configure for the guardrail.""" - - sensitive_information_policy_config: ( - GuardrailSensitiveInformationPolicyConfig | None - ) = None - """The sensitive information policy to configure for the guardrail.""" - - contextual_grounding_policy_config: ( - GuardrailContextualGroundingPolicyConfig | None - ) = None - """ - The contextual grounding policy configuration used to create a - guardrail. - """ - - automated_reasoning_policy_config: ( - GuardrailAutomatedReasoningPolicyConfig | None - ) = None - """ - Optional configuration for integrating Automated Reasoning policies with - the new guardrail. - """ - - cross_region_config: GuardrailCrossRegionConfig | None = None - """ - The system-defined guardrail profile that you're using with your - guardrail. Guardrail profiles define the destination Amazon Web Services - Regions where guardrail inference requests can be automatically routed. - - For more information, see the [Amazon Bedrock User - Guide](https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-cross-region.html). - """ - - blocked_input_messaging: str | None = field(repr=False, default=None) - """The message to return when the guardrail blocks a prompt.""" - - blocked_outputs_messaging: str | None = field(repr=False, default=None) - """The message to return when the guardrail blocks a model response.""" - - kms_key_id: str | None = None - """The ARN of the KMS key that you use to encrypt the guardrail.""" - - tags: list[Tag] | None = None - """The tags that you want to attach to the guardrail.""" - - client_request_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than once. If this token matches a previous request, - Amazon Bedrock ignores the request, but does not return an error. For - more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html) - in the *Amazon S3 User Guide*. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_GUARDRAIL_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_GUARDRAIL_INPUT.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_GUARDRAIL_INPUT.members["description"], self.description - ) - - if self.topic_policy_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_GUARDRAIL_INPUT.members["topicPolicyConfig"], - self.topic_policy_config, - ) - - if self.content_policy_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_GUARDRAIL_INPUT.members["contentPolicyConfig"], - self.content_policy_config, - ) - - if self.word_policy_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_GUARDRAIL_INPUT.members["wordPolicyConfig"], - self.word_policy_config, - ) - - if self.sensitive_information_policy_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_GUARDRAIL_INPUT.members[ - "sensitiveInformationPolicyConfig" - ], - self.sensitive_information_policy_config, - ) - - if self.contextual_grounding_policy_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_GUARDRAIL_INPUT.members[ - "contextualGroundingPolicyConfig" - ], - self.contextual_grounding_policy_config, - ) - - if self.automated_reasoning_policy_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_GUARDRAIL_INPUT.members[ - "automatedReasoningPolicyConfig" - ], - self.automated_reasoning_policy_config, - ) - - if self.cross_region_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_GUARDRAIL_INPUT.members["crossRegionConfig"], - self.cross_region_config, - ) - - if self.blocked_input_messaging is not None: - serializer.write_string( - _SCHEMA_CREATE_GUARDRAIL_INPUT.members["blockedInputMessaging"], - self.blocked_input_messaging, - ) - - if self.blocked_outputs_messaging is not None: - serializer.write_string( - _SCHEMA_CREATE_GUARDRAIL_INPUT.members["blockedOutputsMessaging"], - self.blocked_outputs_messaging, - ) - - if self.kms_key_id is not None: - serializer.write_string( - _SCHEMA_CREATE_GUARDRAIL_INPUT.members["kmsKeyId"], self.kms_key_id - ) - - if self.tags is not None: - _serialize_tag_list( - serializer, _SCHEMA_CREATE_GUARDRAIL_INPUT.members["tags"], self.tags - ) - - if self.client_request_token is not None: - serializer.write_string( - _SCHEMA_CREATE_GUARDRAIL_INPUT.members["clientRequestToken"], - self.client_request_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_GUARDRAIL_INPUT.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_GUARDRAIL_INPUT.members["description"] - ) - - case 2: - kwargs["topic_policy_config"] = ( - GuardrailTopicPolicyConfig.deserialize(de) - ) - - case 3: - kwargs["content_policy_config"] = ( - GuardrailContentPolicyConfig.deserialize(de) - ) - - case 4: - kwargs["word_policy_config"] = ( - GuardrailWordPolicyConfig.deserialize(de) - ) - - case 5: - kwargs["sensitive_information_policy_config"] = ( - GuardrailSensitiveInformationPolicyConfig.deserialize(de) - ) - - case 6: - kwargs["contextual_grounding_policy_config"] = ( - GuardrailContextualGroundingPolicyConfig.deserialize(de) - ) - - case 7: - kwargs["automated_reasoning_policy_config"] = ( - GuardrailAutomatedReasoningPolicyConfig.deserialize(de) - ) - - case 8: - kwargs["cross_region_config"] = ( - GuardrailCrossRegionConfig.deserialize(de) - ) - - case 9: - kwargs["blocked_input_messaging"] = de.read_string( - _SCHEMA_CREATE_GUARDRAIL_INPUT.members["blockedInputMessaging"] - ) - - case 10: - kwargs["blocked_outputs_messaging"] = de.read_string( - _SCHEMA_CREATE_GUARDRAIL_INPUT.members[ - "blockedOutputsMessaging" - ] - ) - - case 11: - kwargs["kms_key_id"] = de.read_string( - _SCHEMA_CREATE_GUARDRAIL_INPUT.members["kmsKeyId"] - ) - - case 12: - kwargs["tags"] = _deserialize_tag_list( - de, _SCHEMA_CREATE_GUARDRAIL_INPUT.members["tags"] - ) - - case 13: - kwargs["client_request_token"] = de.read_string( - _SCHEMA_CREATE_GUARDRAIL_INPUT.members["clientRequestToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_GUARDRAIL_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CreateGuardrailOutput: - """Dataclass for CreateGuardrailOutput structure.""" - - guardrail_id: str - """The unique identifier of the guardrail that was created.""" - - guardrail_arn: str - """The ARN of the guardrail.""" - - version: str - """ - The version of the guardrail that was created. This value will always be - `DRAFT`. - """ - - created_at: datetime - """The time at which the guardrail was created.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_GUARDRAIL_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_GUARDRAIL_OUTPUT.members["guardrailId"], self.guardrail_id - ) - serializer.write_string( - _SCHEMA_CREATE_GUARDRAIL_OUTPUT.members["guardrailArn"], self.guardrail_arn - ) - serializer.write_string( - _SCHEMA_CREATE_GUARDRAIL_OUTPUT.members["version"], self.version - ) - serializer.write_timestamp( - _SCHEMA_CREATE_GUARDRAIL_OUTPUT.members["createdAt"], self.created_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["guardrail_id"] = de.read_string( - _SCHEMA_CREATE_GUARDRAIL_OUTPUT.members["guardrailId"] - ) - - case 1: - kwargs["guardrail_arn"] = de.read_string( - _SCHEMA_CREATE_GUARDRAIL_OUTPUT.members["guardrailArn"] - ) - - case 2: - kwargs["version"] = de.read_string( - _SCHEMA_CREATE_GUARDRAIL_OUTPUT.members["version"] - ) - - case 3: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_CREATE_GUARDRAIL_OUTPUT.members["createdAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_GUARDRAIL_OUTPUT, consumer=_consumer) - if "guardrail_id" not in kwargs: - kwargs["guardrail_id"] = "" - if "guardrail_arn" not in kwargs: - kwargs["guardrail_arn"] = "" - if "version" not in kwargs: - kwargs["version"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -CREATE_GUARDRAIL = APIOperation( - input=CreateGuardrailInput, - output=CreateGuardrailOutput, - schema=_SCHEMA_CREATE_GUARDRAIL, - input_schema=_SCHEMA_CREATE_GUARDRAIL_INPUT, - output_schema=_SCHEMA_CREATE_GUARDRAIL_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrock#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrock#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#TooManyTagsException"): TooManyTagsException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_TOO_MANY_TAGS_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class CreateGuardrailVersionInput: - """Dataclass for CreateGuardrailVersionInput structure.""" - - guardrail_identifier: str | None = None - """The unique identifier of the guardrail. This can be an ID or the ARN.""" - - description: str | None = field(repr=False, default=None) - """A description of the guardrail version.""" - - client_request_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than once. If this token matches a previous request, - Amazon Bedrock ignores the request, but does not return an error. For - more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html) - in the *Amazon S3 User Guide*. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_GUARDRAIL_VERSION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.guardrail_identifier is not None: - serializer.write_string( - _SCHEMA_CREATE_GUARDRAIL_VERSION_INPUT.members["guardrailIdentifier"], - self.guardrail_identifier, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_GUARDRAIL_VERSION_INPUT.members["description"], - self.description, - ) - - if self.client_request_token is not None: - serializer.write_string( - _SCHEMA_CREATE_GUARDRAIL_VERSION_INPUT.members["clientRequestToken"], - self.client_request_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["guardrail_identifier"] = de.read_string( - _SCHEMA_CREATE_GUARDRAIL_VERSION_INPUT.members[ - "guardrailIdentifier" - ] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_GUARDRAIL_VERSION_INPUT.members["description"] - ) - - case 2: - kwargs["client_request_token"] = de.read_string( - _SCHEMA_CREATE_GUARDRAIL_VERSION_INPUT.members[ - "clientRequestToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_GUARDRAIL_VERSION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CreateGuardrailVersionOutput: - """Dataclass for CreateGuardrailVersionOutput structure.""" - - guardrail_id: str - """The unique identifier of the guardrail.""" - - version: str - """The number of the version of the guardrail.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_GUARDRAIL_VERSION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_GUARDRAIL_VERSION_OUTPUT.members["guardrailId"], - self.guardrail_id, - ) - serializer.write_string( - _SCHEMA_CREATE_GUARDRAIL_VERSION_OUTPUT.members["version"], self.version - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["guardrail_id"] = de.read_string( - _SCHEMA_CREATE_GUARDRAIL_VERSION_OUTPUT.members["guardrailId"] - ) - - case 1: - kwargs["version"] = de.read_string( - _SCHEMA_CREATE_GUARDRAIL_VERSION_OUTPUT.members["version"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_GUARDRAIL_VERSION_OUTPUT, consumer=_consumer - ) - if "guardrail_id" not in kwargs: - kwargs["guardrail_id"] = "" - if "version" not in kwargs: - kwargs["version"] = "" - return kwargs - - -CREATE_GUARDRAIL_VERSION = APIOperation( - input=CreateGuardrailVersionInput, - output=CreateGuardrailVersionOutput, - schema=_SCHEMA_CREATE_GUARDRAIL_VERSION, - input_schema=_SCHEMA_CREATE_GUARDRAIL_VERSION_INPUT, - output_schema=_SCHEMA_CREATE_GUARDRAIL_VERSION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrock#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrock#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteGuardrailInput: - """Dataclass for DeleteGuardrailInput structure.""" - - guardrail_identifier: str | None = None - """The unique identifier of the guardrail. This can be an ID or the ARN.""" - - guardrail_version: str | None = None - """The version of the guardrail.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_GUARDRAIL_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.guardrail_identifier is not None: - serializer.write_string( - _SCHEMA_DELETE_GUARDRAIL_INPUT.members["guardrailIdentifier"], - self.guardrail_identifier, - ) - - if self.guardrail_version is not None: - serializer.write_string( - _SCHEMA_DELETE_GUARDRAIL_INPUT.members["guardrailVersion"], - self.guardrail_version, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["guardrail_identifier"] = de.read_string( - _SCHEMA_DELETE_GUARDRAIL_INPUT.members["guardrailIdentifier"] - ) - - case 1: - kwargs["guardrail_version"] = de.read_string( - _SCHEMA_DELETE_GUARDRAIL_INPUT.members["guardrailVersion"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_GUARDRAIL_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteGuardrailOutput: - """Dataclass for DeleteGuardrailOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_GUARDRAIL_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_GUARDRAIL_OUTPUT, consumer=_consumer) - return kwargs - - -DELETE_GUARDRAIL = APIOperation( - input=DeleteGuardrailInput, - output=DeleteGuardrailOutput, - schema=_SCHEMA_DELETE_GUARDRAIL, - input_schema=_SCHEMA_DELETE_GUARDRAIL_INPUT, - output_schema=_SCHEMA_DELETE_GUARDRAIL_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrock#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceInUseException" - ): ResourceInUseException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_IN_USE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetGuardrailInput: - """Dataclass for GetGuardrailInput structure.""" - - guardrail_identifier: str | None = None - """ - The unique identifier of the guardrail for which to get details. This - can be an ID or the ARN. - """ - - guardrail_version: str | None = None - """ - The version of the guardrail for which to get details. If you don't - specify a version, the response returns details for the `DRAFT` version. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_GUARDRAIL_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.guardrail_identifier is not None: - serializer.write_string( - _SCHEMA_GET_GUARDRAIL_INPUT.members["guardrailIdentifier"], - self.guardrail_identifier, - ) - - if self.guardrail_version is not None: - serializer.write_string( - _SCHEMA_GET_GUARDRAIL_INPUT.members["guardrailVersion"], - self.guardrail_version, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["guardrail_identifier"] = de.read_string( - _SCHEMA_GET_GUARDRAIL_INPUT.members["guardrailIdentifier"] - ) - - case 1: - kwargs["guardrail_version"] = de.read_string( - _SCHEMA_GET_GUARDRAIL_INPUT.members["guardrailVersion"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_GUARDRAIL_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GuardrailAutomatedReasoningPolicy: - """ - Represents the configuration of Automated Reasoning policies within a - Amazon Bedrock Guardrail, including the policies to apply and confidence - thresholds. - """ - - policies: list[str] - """ - The list of Automated Reasoning policy ARNs that should be applied as - part of this guardrail configuration. - """ - - confidence_threshold: float | None = None - """ - The minimum confidence level required for Automated Reasoning policy - violations to trigger guardrail actions. Values range from 0.0 to 1.0. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_AUTOMATED_REASONING_POLICY, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_automated_reasoning_policy_arn_list( - serializer, - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_POLICY.members["policies"], - self.policies, - ) - if self.confidence_threshold is not None: - serializer.write_double( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_POLICY.members[ - "confidenceThreshold" - ], - self.confidence_threshold, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policies"] = ( - _deserialize_automated_reasoning_policy_arn_list( - de, - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_POLICY.members[ - "policies" - ], - ) - ) - - case 1: - kwargs["confidence_threshold"] = de.read_double( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_POLICY.members[ - "confidenceThreshold" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_AUTOMATED_REASONING_POLICY, consumer=_consumer - ) - if "policies" not in kwargs: - kwargs["policies"] = [] - return kwargs - - -@dataclass(kw_only=True) -class GuardrailContentFilter: - """ - Contains filter strengths for harmful content. Guardrails support the - following content filters to detect and filter harmful user inputs and - FM-generated outputs. - - - **Hate** -- Describes language or a statement that discriminates, - criticizes, insults, denounces, or dehumanizes a person or group on - the basis of an identity (such as race, ethnicity, gender, religion, - sexual orientation, ability, and national origin). - - - **Insults** -- Describes language or a statement that includes - demeaning, humiliating, mocking, insulting, or belittling language. - This type of language is also labeled as bullying. - - - **Sexual** -- Describes language or a statement that indicates sexual - interest, activity, or arousal using direct or indirect references to - body parts, physical traits, or sex. - - - **Violence** -- Describes language or a statement that includes - glorification of or threats to inflict physical pain, hurt, or injury - toward a person, group or thing. - - Content filtering depends on the confidence classification of user - inputs and FM responses across each of the four harmful categories. All - input and output statements are classified into one of four confidence - levels (NONE, LOW, MEDIUM, HIGH) for each harmful category. For example, - if a statement is classified as *Hate* with HIGH confidence, the - likelihood of the statement representing hateful content is high. A - single statement can be classified across multiple categories with - varying confidence levels. For example, a single statement can be - classified as *Hate* with HIGH confidence, *Insults* with LOW - confidence, *Sexual* with NONE confidence, and *Violence* with MEDIUM - confidence. - - For more information, see [Guardrails content - filters](https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-filters.html). - - This data type is used in the following API operations: - - - [GetGuardrail response - body](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_GetGuardrail.html#API_GetGuardrail_ResponseSyntax) - """ - - type: str - """The harmful category that the content filter is applied to.""" - - input_strength: str - """ - The strength of the content filter to apply to prompts. As you increase - the filter strength, the likelihood of filtering harmful content - increases and the probability of seeing harmful content in your - application reduces. - """ - - output_strength: str - """ - The strength of the content filter to apply to model responses. As you - increase the filter strength, the likelihood of filtering harmful - content increases and the probability of seeing harmful content in your - application reduces. - """ - - input_modalities: list[str] | None = None - """The input modalities selected for the guardrail content filter.""" - - output_modalities: list[str] | None = None - """The output modalities selected for the guardrail content filter.""" - - input_action: str | None = field(repr=False, default=None) - """ - The action to take when harmful content is detected in the input. - Supported values include: - - - `BLOCK` -- Block the content and replace it with blocked messaging. - - - `NONE` -- Take no action but return detection information in the trace - response. - """ - - output_action: str | None = field(repr=False, default=None) - """ - The action to take when harmful content is detected in the output. - Supported values include: - - - `BLOCK` -- Block the content and replace it with blocked messaging. - - - `NONE` -- Take no action but return detection information in the trace - response. - """ - - input_enabled: bool | None = None - """ - Indicates whether guardrail evaluation is enabled on the input. When - disabled, you aren't charged for the evaluation. The evaluation - doesn't appear in the response. - """ - - output_enabled: bool | None = None - """ - Indicates whether guardrail evaluation is enabled on the output. When - disabled, you aren't charged for the evaluation. The evaluation - doesn't appear in the response. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_CONTENT_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GUARDRAIL_CONTENT_FILTER.members["type"], self.type - ) - serializer.write_string( - _SCHEMA_GUARDRAIL_CONTENT_FILTER.members["inputStrength"], - self.input_strength, - ) - serializer.write_string( - _SCHEMA_GUARDRAIL_CONTENT_FILTER.members["outputStrength"], - self.output_strength, - ) - if self.input_modalities is not None: - _serialize_guardrail_modalities( - serializer, - _SCHEMA_GUARDRAIL_CONTENT_FILTER.members["inputModalities"], - self.input_modalities, - ) - - if self.output_modalities is not None: - _serialize_guardrail_modalities( - serializer, - _SCHEMA_GUARDRAIL_CONTENT_FILTER.members["outputModalities"], - self.output_modalities, - ) - - if self.input_action is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_CONTENT_FILTER.members["inputAction"], - self.input_action, - ) - - if self.output_action is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_CONTENT_FILTER.members["outputAction"], - self.output_action, - ) - - if self.input_enabled is not None: - serializer.write_boolean( - _SCHEMA_GUARDRAIL_CONTENT_FILTER.members["inputEnabled"], - self.input_enabled, - ) - - if self.output_enabled is not None: - serializer.write_boolean( - _SCHEMA_GUARDRAIL_CONTENT_FILTER.members["outputEnabled"], - self.output_enabled, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = GuardrailContentFilterType( - de.read_string(_SCHEMA_GUARDRAIL_CONTENT_FILTER.members["type"]) - ) - - case 1: - kwargs["input_strength"] = GuardrailFilterStrength( - de.read_string( - _SCHEMA_GUARDRAIL_CONTENT_FILTER.members["inputStrength"] - ) - ) - - case 2: - kwargs["output_strength"] = GuardrailFilterStrength( - de.read_string( - _SCHEMA_GUARDRAIL_CONTENT_FILTER.members["outputStrength"] - ) - ) - - case 3: - kwargs["input_modalities"] = _deserialize_guardrail_modalities( - de, _SCHEMA_GUARDRAIL_CONTENT_FILTER.members["inputModalities"] - ) - - case 4: - kwargs["output_modalities"] = _deserialize_guardrail_modalities( - de, _SCHEMA_GUARDRAIL_CONTENT_FILTER.members["outputModalities"] - ) - - case 5: - kwargs["input_action"] = GuardrailContentFilterAction( - de.read_string( - _SCHEMA_GUARDRAIL_CONTENT_FILTER.members["inputAction"] - ) - ) - - case 6: - kwargs["output_action"] = GuardrailContentFilterAction( - de.read_string( - _SCHEMA_GUARDRAIL_CONTENT_FILTER.members["outputAction"] - ) - ) - - case 7: - kwargs["input_enabled"] = de.read_boolean( - _SCHEMA_GUARDRAIL_CONTENT_FILTER.members["inputEnabled"] - ) - - case 8: - kwargs["output_enabled"] = de.read_boolean( - _SCHEMA_GUARDRAIL_CONTENT_FILTER.members["outputEnabled"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GUARDRAIL_CONTENT_FILTER, consumer=_consumer) - if "type" not in kwargs: - kwargs["type"] = GuardrailContentFilterType._corrected("") - if "input_strength" not in kwargs: - kwargs["input_strength"] = GuardrailFilterStrength._corrected("") - if "output_strength" not in kwargs: - kwargs["output_strength"] = GuardrailFilterStrength._corrected("") - return kwargs - - -def _serialize_guardrail_content_filters( - serializer: ShapeSerializer, schema: Schema, value: list[GuardrailContentFilter] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_guardrail_content_filters( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GuardrailContentFilter]: - result: list[GuardrailContentFilter] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GuardrailContentFilter.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GuardrailContentFiltersTier: - """The tier that your guardrail uses for content filters.""" - - tier_name: str = field(repr=False) - """ - The tier that your guardrail uses for content filters. Valid values - include: - - - `CLASSIC` tier -- Provides established guardrails functionality - supporting English, French, and Spanish languages. - - - `STANDARD` tier -- Provides a more robust solution than the `CLASSIC` - tier and has more comprehensive language support. This tier requires - that your guardrail use [cross-Region - inference](https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-cross-region.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_CONTENT_FILTERS_TIER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GUARDRAIL_CONTENT_FILTERS_TIER.members["tierName"], self.tier_name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["tier_name"] = GuardrailContentFiltersTierName( - de.read_string( - _SCHEMA_GUARDRAIL_CONTENT_FILTERS_TIER.members["tierName"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_CONTENT_FILTERS_TIER, consumer=_consumer - ) - if "tier_name" not in kwargs: - kwargs["tier_name"] = GuardrailContentFiltersTierName._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class GuardrailContentPolicy: - """ - Contains details about how to handle harmful content. - - This data type is used in the following API operations: - - - [GetGuardrail response - body](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_GetGuardrail.html#API_GetGuardrail_ResponseSyntax) - """ - - filters: list[GuardrailContentFilter] | None = None - """ - Contains the type of the content filter and how strongly it should apply - to prompts and model responses. - """ - - tier: GuardrailContentFiltersTier | None = None - """The tier that your guardrail uses for content filters.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_CONTENT_POLICY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.filters is not None: - _serialize_guardrail_content_filters( - serializer, - _SCHEMA_GUARDRAIL_CONTENT_POLICY.members["filters"], - self.filters, - ) - - if self.tier is not None: - serializer.write_struct( - _SCHEMA_GUARDRAIL_CONTENT_POLICY.members["tier"], self.tier - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["filters"] = _deserialize_guardrail_content_filters( - de, _SCHEMA_GUARDRAIL_CONTENT_POLICY.members["filters"] - ) - - case 1: - kwargs["tier"] = GuardrailContentFiltersTier.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GUARDRAIL_CONTENT_POLICY, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GuardrailContextualGroundingFilter: - """The details for the guardrails contextual grounding filter.""" - - type: str - """The filter type details for the guardrails contextual grounding filter.""" - - threshold: float - """The threshold details for the guardrails contextual grounding filter.""" - - action: str | None = field(repr=False, default=None) - """ - The action to take when content fails the contextual grounding - evaluation. Supported values include: - - - `BLOCK` -- Block the content and replace it with blocked messaging. - - - `NONE` -- Take no action but return detection information in the trace - response. - """ - - enabled: bool | None = None - """ - Indicates whether contextual grounding is enabled for evaluation. When - disabled, you aren't charged for the evaluation. The evaluation - doesn't appear in the response. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER.members["type"], self.type - ) - serializer.write_double( - _SCHEMA_GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER.members["threshold"], - self.threshold, - ) - if self.action is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER.members["action"], - self.action, - ) - - if self.enabled is not None: - serializer.write_boolean( - _SCHEMA_GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER.members["enabled"], - self.enabled, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = GuardrailContextualGroundingFilterType( - de.read_string( - _SCHEMA_GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER.members[ - "type" - ] - ) - ) - - case 1: - kwargs["threshold"] = de.read_double( - _SCHEMA_GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER.members[ - "threshold" - ] - ) - - case 2: - kwargs["action"] = GuardrailContextualGroundingAction( - de.read_string( - _SCHEMA_GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER.members[ - "action" - ] - ) - ) - - case 3: - kwargs["enabled"] = de.read_boolean( - _SCHEMA_GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER.members["enabled"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_CONTEXTUAL_GROUNDING_FILTER, consumer=_consumer - ) - if "type" not in kwargs: - kwargs["type"] = GuardrailContextualGroundingFilterType._corrected("") - if "threshold" not in kwargs: - kwargs["threshold"] = 0.0 - return kwargs - - -def _serialize_guardrail_contextual_grounding_filters( - serializer: ShapeSerializer, - schema: Schema, - value: list[GuardrailContextualGroundingFilter], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_guardrail_contextual_grounding_filters( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GuardrailContextualGroundingFilter]: - result: list[GuardrailContextualGroundingFilter] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GuardrailContextualGroundingFilter.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GuardrailContextualGroundingPolicy: - """The details for the guardrails contextual grounding policy.""" - - filters: list[GuardrailContextualGroundingFilter] - """The filter details for the guardrails contextual grounding policy.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_CONTEXTUAL_GROUNDING_POLICY, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_guardrail_contextual_grounding_filters( - serializer, - _SCHEMA_GUARDRAIL_CONTEXTUAL_GROUNDING_POLICY.members["filters"], - self.filters, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["filters"] = ( - _deserialize_guardrail_contextual_grounding_filters( - de, - _SCHEMA_GUARDRAIL_CONTEXTUAL_GROUNDING_POLICY.members[ - "filters" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_CONTEXTUAL_GROUNDING_POLICY, consumer=_consumer - ) - if "filters" not in kwargs: - kwargs["filters"] = [] - return kwargs - - -@dataclass(kw_only=True) -class GuardrailCrossRegionDetails: - """ - Contains details about the system-defined guardrail profile that you're - using with your guardrail for cross-Region inference. - - For more information, see the [Amazon Bedrock User - Guide](https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-cross-region.html). - """ - - guardrail_profile_id: str | None = None - """ - The ID of the guardrail profile that your guardrail is using. Profile - availability depends on your current Amazon Web Services Region. For - more information, see the [Amazon Bedrock User - Guide](https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-cross-region-support.html). - """ - - guardrail_profile_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the guardrail profile that you're - using with your guardrail. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_CROSS_REGION_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.guardrail_profile_id is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_CROSS_REGION_DETAILS.members["guardrailProfileId"], - self.guardrail_profile_id, - ) - - if self.guardrail_profile_arn is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_CROSS_REGION_DETAILS.members["guardrailProfileArn"], - self.guardrail_profile_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["guardrail_profile_id"] = de.read_string( - _SCHEMA_GUARDRAIL_CROSS_REGION_DETAILS.members[ - "guardrailProfileId" - ] - ) - - case 1: - kwargs["guardrail_profile_arn"] = de.read_string( - _SCHEMA_GUARDRAIL_CROSS_REGION_DETAILS.members[ - "guardrailProfileArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_CROSS_REGION_DETAILS, consumer=_consumer - ) - return kwargs - - -def _serialize_guardrail_failure_recommendations( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_guardrail_failure_recommendations( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GuardrailPiiEntity: - """The PII entity configured for the guardrail.""" - - type: str - """The type of PII entity. For example, Social Security Number.""" - - action: str - """The configured guardrail action when PII entity is detected.""" - - input_action: str | None = None - """ - The action to take when harmful content is detected in the input. - Supported values include: - - - `BLOCK` -- Block the content and replace it with blocked messaging. - - - `ANONYMIZE` -- Mask the content and replace it with identifier tags. - - - `NONE` -- Take no action but return detection information in the trace - response. - """ - - output_action: str | None = None - """ - The action to take when harmful content is detected in the output. - Supported values include: - - - `BLOCK` -- Block the content and replace it with blocked messaging. - - - `ANONYMIZE` -- Mask the content and replace it with identifier tags. - - - `NONE` -- Take no action but return detection information in the trace - response. - """ - - input_enabled: bool | None = None - """ - Indicates whether guardrail evaluation is enabled on the input. When - disabled, you aren't charged for the evaluation. The evaluation - doesn't appear in the response. - """ - - output_enabled: bool | None = None - """ - Indicates whether guardrail evaluation is enabled on the output. When - disabled, you aren't charged for the evaluation. The evaluation - doesn't appear in the response. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_PII_ENTITY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_GUARDRAIL_PII_ENTITY.members["type"], self.type) - serializer.write_string( - _SCHEMA_GUARDRAIL_PII_ENTITY.members["action"], self.action - ) - if self.input_action is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_PII_ENTITY.members["inputAction"], self.input_action - ) - - if self.output_action is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_PII_ENTITY.members["outputAction"], self.output_action - ) - - if self.input_enabled is not None: - serializer.write_boolean( - _SCHEMA_GUARDRAIL_PII_ENTITY.members["inputEnabled"], self.input_enabled - ) - - if self.output_enabled is not None: - serializer.write_boolean( - _SCHEMA_GUARDRAIL_PII_ENTITY.members["outputEnabled"], - self.output_enabled, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = GuardrailPiiEntityType( - de.read_string(_SCHEMA_GUARDRAIL_PII_ENTITY.members["type"]) - ) - - case 1: - kwargs["action"] = GuardrailSensitiveInformationAction( - de.read_string(_SCHEMA_GUARDRAIL_PII_ENTITY.members["action"]) - ) - - case 2: - kwargs["input_action"] = GuardrailSensitiveInformationAction( - de.read_string( - _SCHEMA_GUARDRAIL_PII_ENTITY.members["inputAction"] - ) - ) - - case 3: - kwargs["output_action"] = GuardrailSensitiveInformationAction( - de.read_string( - _SCHEMA_GUARDRAIL_PII_ENTITY.members["outputAction"] - ) - ) - - case 4: - kwargs["input_enabled"] = de.read_boolean( - _SCHEMA_GUARDRAIL_PII_ENTITY.members["inputEnabled"] - ) - - case 5: - kwargs["output_enabled"] = de.read_boolean( - _SCHEMA_GUARDRAIL_PII_ENTITY.members["outputEnabled"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GUARDRAIL_PII_ENTITY, consumer=_consumer) - if "type" not in kwargs: - kwargs["type"] = GuardrailPiiEntityType._corrected("") - if "action" not in kwargs: - kwargs["action"] = GuardrailSensitiveInformationAction._corrected("") - return kwargs - - -def _serialize_guardrail_pii_entities( - serializer: ShapeSerializer, schema: Schema, value: list[GuardrailPiiEntity] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_guardrail_pii_entities( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GuardrailPiiEntity]: - result: list[GuardrailPiiEntity] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GuardrailPiiEntity.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GuardrailRegex: - """The regular expression configured for the guardrail.""" - - name: str - """The name of the regular expression for the guardrail.""" - - pattern: str - """The pattern of the regular expression configured for the guardrail.""" - - action: str - """The action taken when a match to the regular expression is detected.""" - - description: str | None = None - """The description of the regular expression for the guardrail.""" - - input_action: str | None = None - """ - The action to take when harmful content is detected in the input. - Supported values include: - - - `BLOCK` -- Block the content and replace it with blocked messaging. - - - `NONE` -- Take no action but return detection information in the trace - response. - """ - - output_action: str | None = None - """ - The action to take when harmful content is detected in the output. - Supported values include: - - - `BLOCK` -- Block the content and replace it with blocked messaging. - - - `NONE` -- Take no action but return detection information in the trace - response. - """ - - input_enabled: bool | None = None - """ - Indicates whether guardrail evaluation is enabled on the input. When - disabled, you aren't charged for the evaluation. The evaluation - doesn't appear in the response. - """ - - output_enabled: bool | None = None - """ - Indicates whether guardrail evaluation is enabled on the output. When - disabled, you aren't charged for the evaluation. The evaluation - doesn't appear in the response. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_REGEX, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_GUARDRAIL_REGEX.members["name"], self.name) - if self.description is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_REGEX.members["description"], self.description - ) - - serializer.write_string( - _SCHEMA_GUARDRAIL_REGEX.members["pattern"], self.pattern - ) - serializer.write_string(_SCHEMA_GUARDRAIL_REGEX.members["action"], self.action) - if self.input_action is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_REGEX.members["inputAction"], self.input_action - ) - - if self.output_action is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_REGEX.members["outputAction"], self.output_action - ) - - if self.input_enabled is not None: - serializer.write_boolean( - _SCHEMA_GUARDRAIL_REGEX.members["inputEnabled"], self.input_enabled - ) - - if self.output_enabled is not None: - serializer.write_boolean( - _SCHEMA_GUARDRAIL_REGEX.members["outputEnabled"], self.output_enabled - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_GUARDRAIL_REGEX.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_GUARDRAIL_REGEX.members["description"] - ) - - case 2: - kwargs["pattern"] = de.read_string( - _SCHEMA_GUARDRAIL_REGEX.members["pattern"] - ) - - case 3: - kwargs["action"] = GuardrailSensitiveInformationAction( - de.read_string(_SCHEMA_GUARDRAIL_REGEX.members["action"]) - ) - - case 4: - kwargs["input_action"] = GuardrailSensitiveInformationAction( - de.read_string(_SCHEMA_GUARDRAIL_REGEX.members["inputAction"]) - ) - - case 5: - kwargs["output_action"] = GuardrailSensitiveInformationAction( - de.read_string(_SCHEMA_GUARDRAIL_REGEX.members["outputAction"]) - ) - - case 6: - kwargs["input_enabled"] = de.read_boolean( - _SCHEMA_GUARDRAIL_REGEX.members["inputEnabled"] - ) - - case 7: - kwargs["output_enabled"] = de.read_boolean( - _SCHEMA_GUARDRAIL_REGEX.members["outputEnabled"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GUARDRAIL_REGEX, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "pattern" not in kwargs: - kwargs["pattern"] = "" - if "action" not in kwargs: - kwargs["action"] = GuardrailSensitiveInformationAction._corrected("") - return kwargs - - -def _serialize_guardrail_regexes( - serializer: ShapeSerializer, schema: Schema, value: list[GuardrailRegex] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_guardrail_regexes( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GuardrailRegex]: - result: list[GuardrailRegex] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GuardrailRegex.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GuardrailSensitiveInformationPolicy: - """ - Contains details about PII entities and regular expressions configured - for the guardrail. - """ - - pii_entities: list[GuardrailPiiEntity] | None = None - """The list of PII entities configured for the guardrail.""" - - regexes: list[GuardrailRegex] | None = None - """The list of regular expressions configured for the guardrail.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_SENSITIVE_INFORMATION_POLICY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.pii_entities is not None: - _serialize_guardrail_pii_entities( - serializer, - _SCHEMA_GUARDRAIL_SENSITIVE_INFORMATION_POLICY.members["piiEntities"], - self.pii_entities, - ) - - if self.regexes is not None: - _serialize_guardrail_regexes( - serializer, - _SCHEMA_GUARDRAIL_SENSITIVE_INFORMATION_POLICY.members["regexes"], - self.regexes, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["pii_entities"] = _deserialize_guardrail_pii_entities( - de, - _SCHEMA_GUARDRAIL_SENSITIVE_INFORMATION_POLICY.members[ - "piiEntities" - ], - ) - - case 1: - kwargs["regexes"] = _deserialize_guardrail_regexes( - de, - _SCHEMA_GUARDRAIL_SENSITIVE_INFORMATION_POLICY.members[ - "regexes" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GUARDRAIL_SENSITIVE_INFORMATION_POLICY, consumer=_consumer - ) - return kwargs - - -class GuardrailStatus(UnknownEnumMixin, StrEnum): - CREATING = "CREATING" - UPDATING = "UPDATING" - VERSIONING = "VERSIONING" - READY = "READY" - FAILED = "FAILED" - DELETING = "DELETING" - - -def _serialize_guardrail_status_reasons( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_guardrail_status_reasons( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GuardrailTopicsTier: - """The tier that your guardrail uses for denied topic filters.""" - - tier_name: str = field(repr=False) - """ - The tier that your guardrail uses for denied topic filters. Valid values - include: - - - `CLASSIC` tier -- Provides established guardrails functionality - supporting English, French, and Spanish languages. - - - `STANDARD` tier -- Provides a more robust solution than the `CLASSIC` - tier and has more comprehensive language support. This tier requires - that your guardrail use [cross-Region - inference](https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-cross-region.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_TOPICS_TIER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GUARDRAIL_TOPICS_TIER.members["tierName"], self.tier_name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["tier_name"] = GuardrailTopicsTierName( - de.read_string( - _SCHEMA_GUARDRAIL_TOPICS_TIER.members["tierName"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GUARDRAIL_TOPICS_TIER, consumer=_consumer) - if "tier_name" not in kwargs: - kwargs["tier_name"] = GuardrailTopicsTierName._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class GuardrailTopic: - """ - Details about topics for the guardrail to identify and deny. - - This data type is used in the following API operations: - - - [GetGuardrail response - body](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_GetGuardrail.html#API_GetGuardrail_ResponseSyntax) - """ - - name: str = field(repr=False) - """The name of the topic to deny.""" - - definition: str = field(repr=False) - """A definition of the topic to deny.""" - - examples: list[str] | None = None - """ - A list of prompts, each of which is an example of a prompt that can be - categorized as belonging to the topic. - """ - - type: str | None = None - """Specifies to deny the topic.""" - - input_action: str | None = field(repr=False, default=None) - """ - The action to take when harmful content is detected in the input. - Supported values include: - - - `BLOCK` -- Block the content and replace it with blocked messaging. - - - `NONE` -- Take no action but return detection information in the trace - response. - """ - - output_action: str | None = field(repr=False, default=None) - """ - The action to take when harmful content is detected in the output. - Supported values include: - - - `BLOCK` -- Block the content and replace it with blocked messaging. - - - `NONE` -- Take no action but return detection information in the trace - response. - """ - - input_enabled: bool | None = None - """ - Indicates whether guardrail evaluation is enabled on the input. When - disabled, you aren't charged for the evaluation. The evaluation - doesn't appear in the response. - """ - - output_enabled: bool | None = None - """ - Indicates whether guardrail evaluation is enabled on the output. When - disabled, you aren't charged for the evaluation. The evaluation - doesn't appear in the response. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_TOPIC, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_GUARDRAIL_TOPIC.members["name"], self.name) - serializer.write_string( - _SCHEMA_GUARDRAIL_TOPIC.members["definition"], self.definition - ) - if self.examples is not None: - _serialize_guardrail_topic_examples( - serializer, _SCHEMA_GUARDRAIL_TOPIC.members["examples"], self.examples - ) - - if self.type is not None: - serializer.write_string(_SCHEMA_GUARDRAIL_TOPIC.members["type"], self.type) - - if self.input_action is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_TOPIC.members["inputAction"], self.input_action - ) - - if self.output_action is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_TOPIC.members["outputAction"], self.output_action - ) - - if self.input_enabled is not None: - serializer.write_boolean( - _SCHEMA_GUARDRAIL_TOPIC.members["inputEnabled"], self.input_enabled - ) - - if self.output_enabled is not None: - serializer.write_boolean( - _SCHEMA_GUARDRAIL_TOPIC.members["outputEnabled"], self.output_enabled - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_GUARDRAIL_TOPIC.members["name"] - ) - - case 1: - kwargs["definition"] = de.read_string( - _SCHEMA_GUARDRAIL_TOPIC.members["definition"] - ) - - case 2: - kwargs["examples"] = _deserialize_guardrail_topic_examples( - de, _SCHEMA_GUARDRAIL_TOPIC.members["examples"] - ) - - case 3: - kwargs["type"] = GuardrailTopicType( - de.read_string(_SCHEMA_GUARDRAIL_TOPIC.members["type"]) - ) - - case 4: - kwargs["input_action"] = GuardrailTopicAction( - de.read_string(_SCHEMA_GUARDRAIL_TOPIC.members["inputAction"]) - ) - - case 5: - kwargs["output_action"] = GuardrailTopicAction( - de.read_string(_SCHEMA_GUARDRAIL_TOPIC.members["outputAction"]) - ) - - case 6: - kwargs["input_enabled"] = de.read_boolean( - _SCHEMA_GUARDRAIL_TOPIC.members["inputEnabled"] - ) - - case 7: - kwargs["output_enabled"] = de.read_boolean( - _SCHEMA_GUARDRAIL_TOPIC.members["outputEnabled"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GUARDRAIL_TOPIC, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "definition" not in kwargs: - kwargs["definition"] = "" - return kwargs - - -def _serialize_guardrail_topics( - serializer: ShapeSerializer, schema: Schema, value: list[GuardrailTopic] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_guardrail_topics( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GuardrailTopic]: - result: list[GuardrailTopic] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GuardrailTopic.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GuardrailTopicPolicy: - """ - Contains details about topics that the guardrail should identify and - deny. - - This data type is used in the following API operations: - - - [GetGuardrail response - body](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_GetGuardrail.html#API_GetGuardrail_ResponseSyntax) - """ - - topics: list[GuardrailTopic] - """A list of policies related to topics that the guardrail should deny.""" - - tier: GuardrailTopicsTier | None = None - """The tier that your guardrail uses for denied topic filters.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_TOPIC_POLICY, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_guardrail_topics( - serializer, _SCHEMA_GUARDRAIL_TOPIC_POLICY.members["topics"], self.topics - ) - if self.tier is not None: - serializer.write_struct( - _SCHEMA_GUARDRAIL_TOPIC_POLICY.members["tier"], self.tier - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["topics"] = _deserialize_guardrail_topics( - de, _SCHEMA_GUARDRAIL_TOPIC_POLICY.members["topics"] - ) - - case 1: - kwargs["tier"] = GuardrailTopicsTier.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GUARDRAIL_TOPIC_POLICY, consumer=_consumer) - if "topics" not in kwargs: - kwargs["topics"] = [] - return kwargs - - -@dataclass(kw_only=True) -class GuardrailManagedWords: - """ - The managed word list that was configured for the guardrail. (This is a - list of words that are pre-defined and managed by guardrails only.) - """ - - type: str - """ - ManagedWords$type The managed word type that was configured for the - guardrail. (For now, we only offer profanity word list) - """ - - input_action: str | None = field(repr=False, default=None) - """ - The action to take when harmful content is detected in the input. - Supported values include: - - - `BLOCK` -- Block the content and replace it with blocked messaging. - - - `NONE` -- Take no action but return detection information in the trace - response. - """ - - output_action: str | None = field(repr=False, default=None) - """ - The action to take when harmful content is detected in the output. - Supported values include: - - - `BLOCK` -- Block the content and replace it with blocked messaging. - - - `NONE` -- Take no action but return detection information in the trace - response. - """ - - input_enabled: bool | None = None - """ - Indicates whether guardrail evaluation is enabled on the input. When - disabled, you aren't charged for the evaluation. The evaluation - doesn't appear in the response. - """ - - output_enabled: bool | None = None - """ - Indicates whether guardrail evaluation is enabled on the output. When - disabled, you aren't charged for the evaluation. The evaluation - doesn't appear in the response. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_MANAGED_WORDS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GUARDRAIL_MANAGED_WORDS.members["type"], self.type - ) - if self.input_action is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_MANAGED_WORDS.members["inputAction"], - self.input_action, - ) - - if self.output_action is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_MANAGED_WORDS.members["outputAction"], - self.output_action, - ) - - if self.input_enabled is not None: - serializer.write_boolean( - _SCHEMA_GUARDRAIL_MANAGED_WORDS.members["inputEnabled"], - self.input_enabled, - ) - - if self.output_enabled is not None: - serializer.write_boolean( - _SCHEMA_GUARDRAIL_MANAGED_WORDS.members["outputEnabled"], - self.output_enabled, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = GuardrailManagedWordsType( - de.read_string(_SCHEMA_GUARDRAIL_MANAGED_WORDS.members["type"]) - ) - - case 1: - kwargs["input_action"] = GuardrailWordAction( - de.read_string( - _SCHEMA_GUARDRAIL_MANAGED_WORDS.members["inputAction"] - ) - ) - - case 2: - kwargs["output_action"] = GuardrailWordAction( - de.read_string( - _SCHEMA_GUARDRAIL_MANAGED_WORDS.members["outputAction"] - ) - ) - - case 3: - kwargs["input_enabled"] = de.read_boolean( - _SCHEMA_GUARDRAIL_MANAGED_WORDS.members["inputEnabled"] - ) - - case 4: - kwargs["output_enabled"] = de.read_boolean( - _SCHEMA_GUARDRAIL_MANAGED_WORDS.members["outputEnabled"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GUARDRAIL_MANAGED_WORDS, consumer=_consumer) - if "type" not in kwargs: - kwargs["type"] = GuardrailManagedWordsType._corrected("") - return kwargs - - -def _serialize_guardrail_managed_word_lists( - serializer: ShapeSerializer, schema: Schema, value: list[GuardrailManagedWords] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_guardrail_managed_word_lists( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GuardrailManagedWords]: - result: list[GuardrailManagedWords] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GuardrailManagedWords.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GuardrailWord: - """A word configured for the guardrail.""" - - text: str - """Text of the word configured for the guardrail to block.""" - - input_action: str | None = field(repr=False, default=None) - """ - The action to take when harmful content is detected in the input. - Supported values include: - - - `BLOCK` -- Block the content and replace it with blocked messaging. - - - `NONE` -- Take no action but return detection information in the trace - response. - """ - - output_action: str | None = field(repr=False, default=None) - """ - The action to take when harmful content is detected in the output. - Supported values include: - - - `BLOCK` -- Block the content and replace it with blocked messaging. - - - `NONE` -- Take no action but return detection information in the trace - response. - """ - - input_enabled: bool | None = None - """ - Indicates whether guardrail evaluation is enabled on the input. When - disabled, you aren't charged for the evaluation. The evaluation - doesn't appear in the response. - """ - - output_enabled: bool | None = None - """ - Indicates whether guardrail evaluation is enabled on the output. When - disabled, you aren't charged for the evaluation. The evaluation - doesn't appear in the response. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_WORD, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_GUARDRAIL_WORD.members["text"], self.text) - if self.input_action is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_WORD.members["inputAction"], self.input_action - ) - - if self.output_action is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_WORD.members["outputAction"], self.output_action - ) - - if self.input_enabled is not None: - serializer.write_boolean( - _SCHEMA_GUARDRAIL_WORD.members["inputEnabled"], self.input_enabled - ) - - if self.output_enabled is not None: - serializer.write_boolean( - _SCHEMA_GUARDRAIL_WORD.members["outputEnabled"], self.output_enabled - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["text"] = de.read_string( - _SCHEMA_GUARDRAIL_WORD.members["text"] - ) - - case 1: - kwargs["input_action"] = GuardrailWordAction( - de.read_string(_SCHEMA_GUARDRAIL_WORD.members["inputAction"]) - ) - - case 2: - kwargs["output_action"] = GuardrailWordAction( - de.read_string(_SCHEMA_GUARDRAIL_WORD.members["outputAction"]) - ) - - case 3: - kwargs["input_enabled"] = de.read_boolean( - _SCHEMA_GUARDRAIL_WORD.members["inputEnabled"] - ) - - case 4: - kwargs["output_enabled"] = de.read_boolean( - _SCHEMA_GUARDRAIL_WORD.members["outputEnabled"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GUARDRAIL_WORD, consumer=_consumer) - if "text" not in kwargs: - kwargs["text"] = "" - return kwargs - - -def _serialize_guardrail_words( - serializer: ShapeSerializer, schema: Schema, value: list[GuardrailWord] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_guardrail_words( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GuardrailWord]: - result: list[GuardrailWord] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GuardrailWord.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GuardrailWordPolicy: - """Contains details about the word policy configured for the guardrail.""" - - words: list[GuardrailWord] | None = None - """A list of words configured for the guardrail.""" - - managed_word_lists: list[GuardrailManagedWords] | None = None - """A list of managed words configured for the guardrail.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_WORD_POLICY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.words is not None: - _serialize_guardrail_words( - serializer, _SCHEMA_GUARDRAIL_WORD_POLICY.members["words"], self.words - ) - - if self.managed_word_lists is not None: - _serialize_guardrail_managed_word_lists( - serializer, - _SCHEMA_GUARDRAIL_WORD_POLICY.members["managedWordLists"], - self.managed_word_lists, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["words"] = _deserialize_guardrail_words( - de, _SCHEMA_GUARDRAIL_WORD_POLICY.members["words"] - ) - - case 1: - kwargs["managed_word_lists"] = ( - _deserialize_guardrail_managed_word_lists( - de, - _SCHEMA_GUARDRAIL_WORD_POLICY.members["managedWordLists"], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GUARDRAIL_WORD_POLICY, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetGuardrailOutput: - """Dataclass for GetGuardrailOutput structure.""" - - name: str = field(repr=False) - """The name of the guardrail.""" - - guardrail_id: str - """The unique identifier of the guardrail.""" - - guardrail_arn: str - """The ARN of the guardrail.""" - - version: str - """The version of the guardrail.""" - - status: str - """The status of the guardrail.""" - - created_at: datetime - """The date and time at which the guardrail was created.""" - - updated_at: datetime - """The date and time at which the guardrail was updated.""" - - blocked_input_messaging: str = field(repr=False) - """The message that the guardrail returns when it blocks a prompt.""" - - blocked_outputs_messaging: str = field(repr=False) - """The message that the guardrail returns when it blocks a model response.""" - - description: str | None = field(repr=False, default=None) - """The description of the guardrail.""" - - topic_policy: GuardrailTopicPolicy | None = None - """The topic policy that was configured for the guardrail.""" - - content_policy: GuardrailContentPolicy | None = None - """The content policy that was configured for the guardrail.""" - - word_policy: GuardrailWordPolicy | None = None - """The word policy that was configured for the guardrail.""" - - sensitive_information_policy: GuardrailSensitiveInformationPolicy | None = None - """The sensitive information policy that was configured for the guardrail.""" - - contextual_grounding_policy: GuardrailContextualGroundingPolicy | None = None - """The contextual grounding policy used in the guardrail.""" - - automated_reasoning_policy: GuardrailAutomatedReasoningPolicy | None = None - """ - The current Automated Reasoning policy configuration for the guardrail, - if any is configured. - """ - - cross_region_details: GuardrailCrossRegionDetails | None = None - """ - Details about the system-defined guardrail profile that you're using - with your guardrail, including the guardrail profile ID and Amazon - Resource Name (ARN). - """ - - status_reasons: list[str] | None = None - """ - Appears if the `status` is `FAILED`. A list of reasons for why the - guardrail failed to be created, updated, versioned, or deleted. - """ - - failure_recommendations: list[str] | None = None - """ - Appears if the `status` of the guardrail is `FAILED`. A list of - recommendations to carry out before retrying the request. - """ - - kms_key_arn: str | None = None - """The ARN of the KMS key that encrypts the guardrail.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_GUARDRAIL_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_GET_GUARDRAIL_OUTPUT.members["name"], self.name) - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_GUARDRAIL_OUTPUT.members["description"], self.description - ) - - serializer.write_string( - _SCHEMA_GET_GUARDRAIL_OUTPUT.members["guardrailId"], self.guardrail_id - ) - serializer.write_string( - _SCHEMA_GET_GUARDRAIL_OUTPUT.members["guardrailArn"], self.guardrail_arn - ) - serializer.write_string( - _SCHEMA_GET_GUARDRAIL_OUTPUT.members["version"], self.version - ) - serializer.write_string( - _SCHEMA_GET_GUARDRAIL_OUTPUT.members["status"], self.status - ) - if self.topic_policy is not None: - serializer.write_struct( - _SCHEMA_GET_GUARDRAIL_OUTPUT.members["topicPolicy"], self.topic_policy - ) - - if self.content_policy is not None: - serializer.write_struct( - _SCHEMA_GET_GUARDRAIL_OUTPUT.members["contentPolicy"], - self.content_policy, - ) - - if self.word_policy is not None: - serializer.write_struct( - _SCHEMA_GET_GUARDRAIL_OUTPUT.members["wordPolicy"], self.word_policy - ) - - if self.sensitive_information_policy is not None: - serializer.write_struct( - _SCHEMA_GET_GUARDRAIL_OUTPUT.members["sensitiveInformationPolicy"], - self.sensitive_information_policy, - ) - - if self.contextual_grounding_policy is not None: - serializer.write_struct( - _SCHEMA_GET_GUARDRAIL_OUTPUT.members["contextualGroundingPolicy"], - self.contextual_grounding_policy, - ) - - if self.automated_reasoning_policy is not None: - serializer.write_struct( - _SCHEMA_GET_GUARDRAIL_OUTPUT.members["automatedReasoningPolicy"], - self.automated_reasoning_policy, - ) - - if self.cross_region_details is not None: - serializer.write_struct( - _SCHEMA_GET_GUARDRAIL_OUTPUT.members["crossRegionDetails"], - self.cross_region_details, - ) - - serializer.write_timestamp( - _SCHEMA_GET_GUARDRAIL_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_GET_GUARDRAIL_OUTPUT.members["updatedAt"], self.updated_at - ) - if self.status_reasons is not None: - _serialize_guardrail_status_reasons( - serializer, - _SCHEMA_GET_GUARDRAIL_OUTPUT.members["statusReasons"], - self.status_reasons, - ) - - if self.failure_recommendations is not None: - _serialize_guardrail_failure_recommendations( - serializer, - _SCHEMA_GET_GUARDRAIL_OUTPUT.members["failureRecommendations"], - self.failure_recommendations, - ) - - serializer.write_string( - _SCHEMA_GET_GUARDRAIL_OUTPUT.members["blockedInputMessaging"], - self.blocked_input_messaging, - ) - serializer.write_string( - _SCHEMA_GET_GUARDRAIL_OUTPUT.members["blockedOutputsMessaging"], - self.blocked_outputs_messaging, - ) - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_GET_GUARDRAIL_OUTPUT.members["kmsKeyArn"], self.kms_key_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_GET_GUARDRAIL_OUTPUT.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_GET_GUARDRAIL_OUTPUT.members["description"] - ) - - case 2: - kwargs["guardrail_id"] = de.read_string( - _SCHEMA_GET_GUARDRAIL_OUTPUT.members["guardrailId"] - ) - - case 3: - kwargs["guardrail_arn"] = de.read_string( - _SCHEMA_GET_GUARDRAIL_OUTPUT.members["guardrailArn"] - ) - - case 4: - kwargs["version"] = de.read_string( - _SCHEMA_GET_GUARDRAIL_OUTPUT.members["version"] - ) - - case 5: - kwargs["status"] = GuardrailStatus( - de.read_string(_SCHEMA_GET_GUARDRAIL_OUTPUT.members["status"]) - ) - - case 6: - kwargs["topic_policy"] = GuardrailTopicPolicy.deserialize(de) - - case 7: - kwargs["content_policy"] = GuardrailContentPolicy.deserialize(de) - - case 8: - kwargs["word_policy"] = GuardrailWordPolicy.deserialize(de) - - case 9: - kwargs["sensitive_information_policy"] = ( - GuardrailSensitiveInformationPolicy.deserialize(de) - ) - - case 10: - kwargs["contextual_grounding_policy"] = ( - GuardrailContextualGroundingPolicy.deserialize(de) - ) - - case 11: - kwargs["automated_reasoning_policy"] = ( - GuardrailAutomatedReasoningPolicy.deserialize(de) - ) - - case 12: - kwargs["cross_region_details"] = ( - GuardrailCrossRegionDetails.deserialize(de) - ) - - case 13: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_GUARDRAIL_OUTPUT.members["createdAt"] - ) - - case 14: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_GET_GUARDRAIL_OUTPUT.members["updatedAt"] - ) - - case 15: - kwargs["status_reasons"] = _deserialize_guardrail_status_reasons( - de, _SCHEMA_GET_GUARDRAIL_OUTPUT.members["statusReasons"] - ) - - case 16: - kwargs["failure_recommendations"] = ( - _deserialize_guardrail_failure_recommendations( - de, - _SCHEMA_GET_GUARDRAIL_OUTPUT.members[ - "failureRecommendations" - ], - ) - ) - - case 17: - kwargs["blocked_input_messaging"] = de.read_string( - _SCHEMA_GET_GUARDRAIL_OUTPUT.members["blockedInputMessaging"] - ) - - case 18: - kwargs["blocked_outputs_messaging"] = de.read_string( - _SCHEMA_GET_GUARDRAIL_OUTPUT.members["blockedOutputsMessaging"] - ) - - case 19: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_GET_GUARDRAIL_OUTPUT.members["kmsKeyArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_GUARDRAIL_OUTPUT, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "guardrail_id" not in kwargs: - kwargs["guardrail_id"] = "" - if "guardrail_arn" not in kwargs: - kwargs["guardrail_arn"] = "" - if "version" not in kwargs: - kwargs["version"] = "" - if "status" not in kwargs: - kwargs["status"] = GuardrailStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "blocked_input_messaging" not in kwargs: - kwargs["blocked_input_messaging"] = "" - if "blocked_outputs_messaging" not in kwargs: - kwargs["blocked_outputs_messaging"] = "" - return kwargs - - -GET_GUARDRAIL = APIOperation( - input=GetGuardrailInput, - output=GetGuardrailOutput, - schema=_SCHEMA_GET_GUARDRAIL, - input_schema=_SCHEMA_GET_GUARDRAIL_INPUT, - output_schema=_SCHEMA_GET_GUARDRAIL_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListGuardrailsInput: - """Dataclass for ListGuardrailsInput structure.""" - - guardrail_identifier: str | None = None - """The unique identifier of the guardrail. This can be an ID or the ARN.""" - - max_results: int | None = None - """The maximum number of results to return in the response.""" - - next_token: str | None = None - """ - If there are more results than were returned in the response, the - response returns a `nextToken` that you can send in another - `ListGuardrails` request to see the next batch of results. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_GUARDRAILS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.guardrail_identifier is not None: - serializer.write_string( - _SCHEMA_LIST_GUARDRAILS_INPUT.members["guardrailIdentifier"], - self.guardrail_identifier, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_GUARDRAILS_INPUT.members["maxResults"], self.max_results - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_GUARDRAILS_INPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["guardrail_identifier"] = de.read_string( - _SCHEMA_LIST_GUARDRAILS_INPUT.members["guardrailIdentifier"] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_GUARDRAILS_INPUT.members["maxResults"] - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_GUARDRAILS_INPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_GUARDRAILS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GuardrailSummary: - """ - Contains details about a guardrail. - - This data type is used in the following API operations: - - - [ListGuardrails response - body](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_ListGuardrails.html#API_ListGuardrails_ResponseSyntax) - """ - - id: str - """The unique identifier of the guardrail.""" - - arn: str - """The ARN of the guardrail.""" - - status: str - """The status of the guardrail.""" - - name: str = field(repr=False) - """The name of the guardrail.""" - - version: str - """The version of the guardrail.""" - - created_at: datetime - """The date and time at which the guardrail was created.""" - - updated_at: datetime - """The date and time at which the guardrail was last updated.""" - - description: str | None = field(repr=False, default=None) - """A description of the guardrail.""" - - cross_region_details: GuardrailCrossRegionDetails | None = None - """ - Details about the system-defined guardrail profile that you're using - with your guardrail, including the guardrail profile ID and Amazon - Resource Name (ARN). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GUARDRAIL_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_GUARDRAIL_SUMMARY.members["id"], self.id) - serializer.write_string(_SCHEMA_GUARDRAIL_SUMMARY.members["arn"], self.arn) - serializer.write_string( - _SCHEMA_GUARDRAIL_SUMMARY.members["status"], self.status - ) - serializer.write_string(_SCHEMA_GUARDRAIL_SUMMARY.members["name"], self.name) - if self.description is not None: - serializer.write_string( - _SCHEMA_GUARDRAIL_SUMMARY.members["description"], self.description - ) - - serializer.write_string( - _SCHEMA_GUARDRAIL_SUMMARY.members["version"], self.version - ) - serializer.write_timestamp( - _SCHEMA_GUARDRAIL_SUMMARY.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_GUARDRAIL_SUMMARY.members["updatedAt"], self.updated_at - ) - if self.cross_region_details is not None: - serializer.write_struct( - _SCHEMA_GUARDRAIL_SUMMARY.members["crossRegionDetails"], - self.cross_region_details, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_GUARDRAIL_SUMMARY.members["id"] - ) - - case 1: - kwargs["arn"] = de.read_string( - _SCHEMA_GUARDRAIL_SUMMARY.members["arn"] - ) - - case 2: - kwargs["status"] = GuardrailStatus( - de.read_string(_SCHEMA_GUARDRAIL_SUMMARY.members["status"]) - ) - - case 3: - kwargs["name"] = de.read_string( - _SCHEMA_GUARDRAIL_SUMMARY.members["name"] - ) - - case 4: - kwargs["description"] = de.read_string( - _SCHEMA_GUARDRAIL_SUMMARY.members["description"] - ) - - case 5: - kwargs["version"] = de.read_string( - _SCHEMA_GUARDRAIL_SUMMARY.members["version"] - ) - - case 6: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GUARDRAIL_SUMMARY.members["createdAt"] - ) - - case 7: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_GUARDRAIL_SUMMARY.members["updatedAt"] - ) - - case 8: - kwargs["cross_region_details"] = ( - GuardrailCrossRegionDetails.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GUARDRAIL_SUMMARY, consumer=_consumer) - if "id" not in kwargs: - kwargs["id"] = "" - if "arn" not in kwargs: - kwargs["arn"] = "" - if "status" not in kwargs: - kwargs["status"] = GuardrailStatus._corrected("") - if "name" not in kwargs: - kwargs["name"] = "" - if "version" not in kwargs: - kwargs["version"] = "" - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_guardrail_summaries( - serializer: ShapeSerializer, schema: Schema, value: list[GuardrailSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_guardrail_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GuardrailSummary]: - result: list[GuardrailSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GuardrailSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListGuardrailsOutput: - """Dataclass for ListGuardrailsOutput structure.""" - - guardrails: list[GuardrailSummary] - """A list of objects, each of which contains details about a guardrail.""" - - next_token: str | None = None - """ - If there are more results than were returned in the response, the - response returns a `nextToken` that you can send in another - `ListGuardrails` request to see the next batch of results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_GUARDRAILS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_guardrail_summaries( - serializer, - _SCHEMA_LIST_GUARDRAILS_OUTPUT.members["guardrails"], - self.guardrails, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_GUARDRAILS_OUTPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["guardrails"] = _deserialize_guardrail_summaries( - de, _SCHEMA_LIST_GUARDRAILS_OUTPUT.members["guardrails"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_GUARDRAILS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_GUARDRAILS_OUTPUT, consumer=_consumer) - if "guardrails" not in kwargs: - kwargs["guardrails"] = [] - return kwargs - - -LIST_GUARDRAILS = APIOperation( - input=ListGuardrailsInput, - output=ListGuardrailsOutput, - schema=_SCHEMA_LIST_GUARDRAILS, - input_schema=_SCHEMA_LIST_GUARDRAILS_INPUT, - output_schema=_SCHEMA_LIST_GUARDRAILS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateGuardrailInput: - """Dataclass for UpdateGuardrailInput structure.""" - - guardrail_identifier: str | None = None - """The unique identifier of the guardrail. This can be an ID or the ARN.""" - - name: str | None = field(repr=False, default=None) - """A name for the guardrail.""" - - description: str | None = field(repr=False, default=None) - """A description of the guardrail.""" - - topic_policy_config: GuardrailTopicPolicyConfig | None = None - """The topic policy to configure for the guardrail.""" - - content_policy_config: GuardrailContentPolicyConfig | None = None - """The content policy to configure for the guardrail.""" - - word_policy_config: GuardrailWordPolicyConfig | None = None - """The word policy to configure for the guardrail.""" - - sensitive_information_policy_config: ( - GuardrailSensitiveInformationPolicyConfig | None - ) = None - """The sensitive information policy to configure for the guardrail.""" - - contextual_grounding_policy_config: ( - GuardrailContextualGroundingPolicyConfig | None - ) = None - """ - The contextual grounding policy configuration used to update a - guardrail. - """ - - automated_reasoning_policy_config: ( - GuardrailAutomatedReasoningPolicyConfig | None - ) = None - """ - Updated configuration for Automated Reasoning policies associated with - the guardrail. - """ - - cross_region_config: GuardrailCrossRegionConfig | None = None - """ - The system-defined guardrail profile that you're using with your - guardrail. Guardrail profiles define the destination Amazon Web Services - Regions where guardrail inference requests can be automatically routed. - - For more information, see the [Amazon Bedrock User - Guide](https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-cross-region.html). - """ - - blocked_input_messaging: str | None = field(repr=False, default=None) - """The message to return when the guardrail blocks a prompt.""" - - blocked_outputs_messaging: str | None = field(repr=False, default=None) - """The message to return when the guardrail blocks a model response.""" - - kms_key_id: str | None = None - """The ARN of the KMS key with which to encrypt the guardrail.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_GUARDRAIL_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.guardrail_identifier is not None: - serializer.write_string( - _SCHEMA_UPDATE_GUARDRAIL_INPUT.members["guardrailIdentifier"], - self.guardrail_identifier, - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_UPDATE_GUARDRAIL_INPUT.members["name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_GUARDRAIL_INPUT.members["description"], self.description - ) - - if self.topic_policy_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_GUARDRAIL_INPUT.members["topicPolicyConfig"], - self.topic_policy_config, - ) - - if self.content_policy_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_GUARDRAIL_INPUT.members["contentPolicyConfig"], - self.content_policy_config, - ) - - if self.word_policy_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_GUARDRAIL_INPUT.members["wordPolicyConfig"], - self.word_policy_config, - ) - - if self.sensitive_information_policy_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_GUARDRAIL_INPUT.members[ - "sensitiveInformationPolicyConfig" - ], - self.sensitive_information_policy_config, - ) - - if self.contextual_grounding_policy_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_GUARDRAIL_INPUT.members[ - "contextualGroundingPolicyConfig" - ], - self.contextual_grounding_policy_config, - ) - - if self.automated_reasoning_policy_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_GUARDRAIL_INPUT.members[ - "automatedReasoningPolicyConfig" - ], - self.automated_reasoning_policy_config, - ) - - if self.cross_region_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_GUARDRAIL_INPUT.members["crossRegionConfig"], - self.cross_region_config, - ) - - if self.blocked_input_messaging is not None: - serializer.write_string( - _SCHEMA_UPDATE_GUARDRAIL_INPUT.members["blockedInputMessaging"], - self.blocked_input_messaging, - ) - - if self.blocked_outputs_messaging is not None: - serializer.write_string( - _SCHEMA_UPDATE_GUARDRAIL_INPUT.members["blockedOutputsMessaging"], - self.blocked_outputs_messaging, - ) - - if self.kms_key_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_GUARDRAIL_INPUT.members["kmsKeyId"], self.kms_key_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["guardrail_identifier"] = de.read_string( - _SCHEMA_UPDATE_GUARDRAIL_INPUT.members["guardrailIdentifier"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_GUARDRAIL_INPUT.members["name"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_GUARDRAIL_INPUT.members["description"] - ) - - case 3: - kwargs["topic_policy_config"] = ( - GuardrailTopicPolicyConfig.deserialize(de) - ) - - case 4: - kwargs["content_policy_config"] = ( - GuardrailContentPolicyConfig.deserialize(de) - ) - - case 5: - kwargs["word_policy_config"] = ( - GuardrailWordPolicyConfig.deserialize(de) - ) - - case 6: - kwargs["sensitive_information_policy_config"] = ( - GuardrailSensitiveInformationPolicyConfig.deserialize(de) - ) - - case 7: - kwargs["contextual_grounding_policy_config"] = ( - GuardrailContextualGroundingPolicyConfig.deserialize(de) - ) - - case 8: - kwargs["automated_reasoning_policy_config"] = ( - GuardrailAutomatedReasoningPolicyConfig.deserialize(de) - ) - - case 9: - kwargs["cross_region_config"] = ( - GuardrailCrossRegionConfig.deserialize(de) - ) - - case 10: - kwargs["blocked_input_messaging"] = de.read_string( - _SCHEMA_UPDATE_GUARDRAIL_INPUT.members["blockedInputMessaging"] - ) - - case 11: - kwargs["blocked_outputs_messaging"] = de.read_string( - _SCHEMA_UPDATE_GUARDRAIL_INPUT.members[ - "blockedOutputsMessaging" - ] - ) - - case 12: - kwargs["kms_key_id"] = de.read_string( - _SCHEMA_UPDATE_GUARDRAIL_INPUT.members["kmsKeyId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_GUARDRAIL_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateGuardrailOutput: - """Dataclass for UpdateGuardrailOutput structure.""" - - guardrail_id: str - """The unique identifier of the guardrail""" - - guardrail_arn: str - """The ARN of the guardrail.""" - - version: str - """The version of the guardrail.""" - - updated_at: datetime - """The date and time at which the guardrail was updated.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_GUARDRAIL_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_UPDATE_GUARDRAIL_OUTPUT.members["guardrailId"], self.guardrail_id - ) - serializer.write_string( - _SCHEMA_UPDATE_GUARDRAIL_OUTPUT.members["guardrailArn"], self.guardrail_arn - ) - serializer.write_string( - _SCHEMA_UPDATE_GUARDRAIL_OUTPUT.members["version"], self.version - ) - serializer.write_timestamp( - _SCHEMA_UPDATE_GUARDRAIL_OUTPUT.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["guardrail_id"] = de.read_string( - _SCHEMA_UPDATE_GUARDRAIL_OUTPUT.members["guardrailId"] - ) - - case 1: - kwargs["guardrail_arn"] = de.read_string( - _SCHEMA_UPDATE_GUARDRAIL_OUTPUT.members["guardrailArn"] - ) - - case 2: - kwargs["version"] = de.read_string( - _SCHEMA_UPDATE_GUARDRAIL_OUTPUT.members["version"] - ) - - case 3: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_UPDATE_GUARDRAIL_OUTPUT.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_GUARDRAIL_OUTPUT, consumer=_consumer) - if "guardrail_id" not in kwargs: - kwargs["guardrail_id"] = "" - if "guardrail_arn" not in kwargs: - kwargs["guardrail_arn"] = "" - if "version" not in kwargs: - kwargs["version"] = "" - if "updated_at" not in kwargs: - kwargs["updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -UPDATE_GUARDRAIL = APIOperation( - input=UpdateGuardrailInput, - output=UpdateGuardrailOutput, - schema=_SCHEMA_UPDATE_GUARDRAIL, - input_schema=_SCHEMA_UPDATE_GUARDRAIL_INPUT, - output_schema=_SCHEMA_UPDATE_GUARDRAIL_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrock#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrock#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass -class InferenceProfileModelSourceCopyFrom: - """ - The ARN of the model or system-defined inference profile that is the - source for the inference profile. - """ - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INFERENCE_PROFILE_MODEL_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_INFERENCE_PROFILE_MODEL_SOURCE.members["copyFrom"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string( - _SCHEMA_INFERENCE_PROFILE_MODEL_SOURCE.members["copyFrom"] - ) - ) - - -@dataclass -class InferenceProfileModelSourceUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -InferenceProfileModelSource = Union[ - InferenceProfileModelSourceCopyFrom | InferenceProfileModelSourceUnknown -] -""" -Contains information about the model or system-defined inference profile -that is the source for an inference profile.. -""" - - -class _InferenceProfileModelSourceDeserializer: - _result: InferenceProfileModelSource | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> InferenceProfileModelSource: - self._result = None - deserializer.read_struct(_SCHEMA_INFERENCE_PROFILE_MODEL_SOURCE, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(InferenceProfileModelSourceCopyFrom.deserialize(de)) - - case _: - self._set_result( - InferenceProfileModelSourceUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: InferenceProfileModelSource) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class CreateInferenceProfileInput: - """Dataclass for CreateInferenceProfileInput structure.""" - - inference_profile_name: str | None = None - """A name for the inference profile.""" - - description: str | None = field(repr=False, default=None) - """A description for the inference profile.""" - - client_request_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If this token matches a previous - request, Amazon Bedrock ignores the request, but does not return an - error. For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - model_source: InferenceProfileModelSource | None = None - """ - The foundation model or system-defined inference profile that the - inference profile will track metrics and costs for. - """ - - tags: list[Tag] | None = None - """ - An array of objects, each of which contains a tag and its value. For - more information, see [Tagging - resources](https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html) - in the [Amazon Bedrock User - Guide](https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_INFERENCE_PROFILE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.inference_profile_name is not None: - serializer.write_string( - _SCHEMA_CREATE_INFERENCE_PROFILE_INPUT.members["inferenceProfileName"], - self.inference_profile_name, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_INFERENCE_PROFILE_INPUT.members["description"], - self.description, - ) - - if self.client_request_token is not None: - serializer.write_string( - _SCHEMA_CREATE_INFERENCE_PROFILE_INPUT.members["clientRequestToken"], - self.client_request_token, - ) - - if self.model_source is not None: - serializer.write_struct( - _SCHEMA_CREATE_INFERENCE_PROFILE_INPUT.members["modelSource"], - self.model_source, - ) - - if self.tags is not None: - _serialize_tag_list( - serializer, - _SCHEMA_CREATE_INFERENCE_PROFILE_INPUT.members["tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["inference_profile_name"] = de.read_string( - _SCHEMA_CREATE_INFERENCE_PROFILE_INPUT.members[ - "inferenceProfileName" - ] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_INFERENCE_PROFILE_INPUT.members["description"] - ) - - case 2: - kwargs["client_request_token"] = de.read_string( - _SCHEMA_CREATE_INFERENCE_PROFILE_INPUT.members[ - "clientRequestToken" - ] - ) - - case 3: - kwargs["model_source"] = ( - _InferenceProfileModelSourceDeserializer().deserialize(de) - ) - - case 4: - kwargs["tags"] = _deserialize_tag_list( - de, _SCHEMA_CREATE_INFERENCE_PROFILE_INPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_INFERENCE_PROFILE_INPUT, consumer=_consumer - ) - return kwargs - - -class InferenceProfileStatus(UnknownEnumMixin, StrEnum): - ACTIVE = "ACTIVE" - - -@dataclass(kw_only=True) -class CreateInferenceProfileOutput: - """Dataclass for CreateInferenceProfileOutput structure.""" - - inference_profile_arn: str - """The ARN of the inference profile that you created.""" - - status: str | None = None - """ - The status of the inference profile. `ACTIVE` means that the inference - profile is ready to be used. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_INFERENCE_PROFILE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_INFERENCE_PROFILE_OUTPUT.members["inferenceProfileArn"], - self.inference_profile_arn, - ) - if self.status is not None: - serializer.write_string( - _SCHEMA_CREATE_INFERENCE_PROFILE_OUTPUT.members["status"], self.status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["inference_profile_arn"] = de.read_string( - _SCHEMA_CREATE_INFERENCE_PROFILE_OUTPUT.members[ - "inferenceProfileArn" - ] - ) - - case 1: - kwargs["status"] = InferenceProfileStatus( - de.read_string( - _SCHEMA_CREATE_INFERENCE_PROFILE_OUTPUT.members["status"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_INFERENCE_PROFILE_OUTPUT, consumer=_consumer - ) - if "inference_profile_arn" not in kwargs: - kwargs["inference_profile_arn"] = "" - return kwargs - - -CREATE_INFERENCE_PROFILE = APIOperation( - input=CreateInferenceProfileInput, - output=CreateInferenceProfileOutput, - schema=_SCHEMA_CREATE_INFERENCE_PROFILE, - input_schema=_SCHEMA_CREATE_INFERENCE_PROFILE_INPUT, - output_schema=_SCHEMA_CREATE_INFERENCE_PROFILE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrock#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrock#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#TooManyTagsException"): TooManyTagsException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_TOO_MANY_TAGS_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteInferenceProfileInput: - """Dataclass for DeleteInferenceProfileInput structure.""" - - inference_profile_identifier: str | None = None - """ - The Amazon Resource Name (ARN) or ID of the application inference - profile to delete. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_INFERENCE_PROFILE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.inference_profile_identifier is not None: - serializer.write_string( - _SCHEMA_DELETE_INFERENCE_PROFILE_INPUT.members[ - "inferenceProfileIdentifier" - ], - self.inference_profile_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["inference_profile_identifier"] = de.read_string( - _SCHEMA_DELETE_INFERENCE_PROFILE_INPUT.members[ - "inferenceProfileIdentifier" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_INFERENCE_PROFILE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteInferenceProfileOutput: - """Dataclass for DeleteInferenceProfileOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_INFERENCE_PROFILE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_INFERENCE_PROFILE_OUTPUT, consumer=_consumer - ) - return kwargs - - -DELETE_INFERENCE_PROFILE = APIOperation( - input=DeleteInferenceProfileInput, - output=DeleteInferenceProfileOutput, - schema=_SCHEMA_DELETE_INFERENCE_PROFILE, - input_schema=_SCHEMA_DELETE_INFERENCE_PROFILE_INPUT, - output_schema=_SCHEMA_DELETE_INFERENCE_PROFILE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrock#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetInferenceProfileInput: - """Dataclass for GetInferenceProfileInput structure.""" - - inference_profile_identifier: str | None = None - """The ID or Amazon Resource Name (ARN) of the inference profile.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_INFERENCE_PROFILE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.inference_profile_identifier is not None: - serializer.write_string( - _SCHEMA_GET_INFERENCE_PROFILE_INPUT.members[ - "inferenceProfileIdentifier" - ], - self.inference_profile_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["inference_profile_identifier"] = de.read_string( - _SCHEMA_GET_INFERENCE_PROFILE_INPUT.members[ - "inferenceProfileIdentifier" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_INFERENCE_PROFILE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InferenceProfileModel: - """Contains information about a model.""" - - model_arn: str | None = None - """The Amazon Resource Name (ARN) of the model.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INFERENCE_PROFILE_MODEL, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.model_arn is not None: - serializer.write_string( - _SCHEMA_INFERENCE_PROFILE_MODEL.members["modelArn"], self.model_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_arn"] = de.read_string( - _SCHEMA_INFERENCE_PROFILE_MODEL.members["modelArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INFERENCE_PROFILE_MODEL, consumer=_consumer) - return kwargs - - -def _serialize_inference_profile_models( - serializer: ShapeSerializer, schema: Schema, value: list[InferenceProfileModel] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_inference_profile_models( - deserializer: ShapeDeserializer, schema: Schema -) -> list[InferenceProfileModel]: - result: list[InferenceProfileModel] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(InferenceProfileModel.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class InferenceProfileType(UnknownEnumMixin, StrEnum): - SYSTEM_DEFINED = "SYSTEM_DEFINED" - APPLICATION = "APPLICATION" - - -@dataclass(kw_only=True) -class GetInferenceProfileOutput: - """Dataclass for GetInferenceProfileOutput structure.""" - - inference_profile_name: str - """The name of the inference profile.""" - - inference_profile_arn: str - """The Amazon Resource Name (ARN) of the inference profile.""" - - models: list[InferenceProfileModel] - """A list of information about each model in the inference profile.""" - - inference_profile_id: str - """The unique identifier of the inference profile.""" - - status: str - """ - The status of the inference profile. `ACTIVE` means that the inference - profile is ready to be used. - """ - - type: str - """ - The type of the inference profile. The following types are possible: - - - `SYSTEM_DEFINED` -- The inference profile is defined by Amazon - Bedrock. You can route inference requests across regions with these - inference profiles. - - - `APPLICATION` -- The inference profile was created by a user. This - type of inference profile can track metrics and costs when invoking - the model in it. The inference profile may route requests to one or - multiple regions. - """ - - description: str | None = field(repr=False, default=None) - """The description of the inference profile.""" - - created_at: datetime | None = None - """The time at which the inference profile was created.""" - - updated_at: datetime | None = None - """The time at which the inference profile was last updated.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_INFERENCE_PROFILE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_INFERENCE_PROFILE_OUTPUT.members["inferenceProfileName"], - self.inference_profile_name, - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_INFERENCE_PROFILE_OUTPUT.members["description"], - self.description, - ) - - if self.created_at is not None: - serializer.write_timestamp( - _SCHEMA_GET_INFERENCE_PROFILE_OUTPUT.members["createdAt"], - self.created_at, - ) - - if self.updated_at is not None: - serializer.write_timestamp( - _SCHEMA_GET_INFERENCE_PROFILE_OUTPUT.members["updatedAt"], - self.updated_at, - ) - - serializer.write_string( - _SCHEMA_GET_INFERENCE_PROFILE_OUTPUT.members["inferenceProfileArn"], - self.inference_profile_arn, - ) - _serialize_inference_profile_models( - serializer, - _SCHEMA_GET_INFERENCE_PROFILE_OUTPUT.members["models"], - self.models, - ) - serializer.write_string( - _SCHEMA_GET_INFERENCE_PROFILE_OUTPUT.members["inferenceProfileId"], - self.inference_profile_id, - ) - serializer.write_string( - _SCHEMA_GET_INFERENCE_PROFILE_OUTPUT.members["status"], self.status - ) - serializer.write_string( - _SCHEMA_GET_INFERENCE_PROFILE_OUTPUT.members["type"], self.type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["inference_profile_name"] = de.read_string( - _SCHEMA_GET_INFERENCE_PROFILE_OUTPUT.members[ - "inferenceProfileName" - ] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_GET_INFERENCE_PROFILE_OUTPUT.members["description"] - ) - - case 2: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_INFERENCE_PROFILE_OUTPUT.members["createdAt"] - ) - - case 3: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_GET_INFERENCE_PROFILE_OUTPUT.members["updatedAt"] - ) - - case 4: - kwargs["inference_profile_arn"] = de.read_string( - _SCHEMA_GET_INFERENCE_PROFILE_OUTPUT.members[ - "inferenceProfileArn" - ] - ) - - case 5: - kwargs["models"] = _deserialize_inference_profile_models( - de, _SCHEMA_GET_INFERENCE_PROFILE_OUTPUT.members["models"] - ) - - case 6: - kwargs["inference_profile_id"] = de.read_string( - _SCHEMA_GET_INFERENCE_PROFILE_OUTPUT.members[ - "inferenceProfileId" - ] - ) - - case 7: - kwargs["status"] = InferenceProfileStatus( - de.read_string( - _SCHEMA_GET_INFERENCE_PROFILE_OUTPUT.members["status"] - ) - ) - - case 8: - kwargs["type"] = InferenceProfileType( - de.read_string( - _SCHEMA_GET_INFERENCE_PROFILE_OUTPUT.members["type"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_INFERENCE_PROFILE_OUTPUT, consumer=_consumer - ) - if "inference_profile_name" not in kwargs: - kwargs["inference_profile_name"] = "" - if "inference_profile_arn" not in kwargs: - kwargs["inference_profile_arn"] = "" - if "models" not in kwargs: - kwargs["models"] = [] - if "inference_profile_id" not in kwargs: - kwargs["inference_profile_id"] = "" - if "status" not in kwargs: - kwargs["status"] = InferenceProfileStatus._corrected("") - if "type" not in kwargs: - kwargs["type"] = InferenceProfileType._corrected("") - return kwargs - - -GET_INFERENCE_PROFILE = APIOperation( - input=GetInferenceProfileInput, - output=GetInferenceProfileOutput, - schema=_SCHEMA_GET_INFERENCE_PROFILE, - input_schema=_SCHEMA_GET_INFERENCE_PROFILE_INPUT, - output_schema=_SCHEMA_GET_INFERENCE_PROFILE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListInferenceProfilesInput: - """Dataclass for ListInferenceProfilesInput structure.""" - - max_results: int | None = None - """ - The maximum number of results to return in the response. If the total - number of results is greater than this value, use the token returned in - the response in the `nextToken` field when making another request to - return the next batch of results. - """ - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, enter the token returned in the `nextToken` - field in the response in this field to return the next batch of results. - """ - - type_equals: str | None = None - """ - Filters for inference profiles that match the type you specify. - - - `SYSTEM_DEFINED` -- The inference profile is defined by Amazon - Bedrock. You can route inference requests across regions with these - inference profiles. - - - `APPLICATION` -- The inference profile was created by a user. This - type of inference profile can track metrics and costs when invoking - the model in it. The inference profile may route requests to one or - multiple regions. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_INFERENCE_PROFILES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_INFERENCE_PROFILES_INPUT.members["maxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_INFERENCE_PROFILES_INPUT.members["nextToken"], - self.next_token, - ) - - if self.type_equals is not None: - serializer.write_string( - _SCHEMA_LIST_INFERENCE_PROFILES_INPUT.members["typeEquals"], - self.type_equals, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_INFERENCE_PROFILES_INPUT.members["maxResults"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_INFERENCE_PROFILES_INPUT.members["nextToken"] - ) - - case 2: - kwargs["type_equals"] = InferenceProfileType( - de.read_string( - _SCHEMA_LIST_INFERENCE_PROFILES_INPUT.members["typeEquals"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_INFERENCE_PROFILES_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InferenceProfileSummary: - """Contains information about an inference profile.""" - - inference_profile_name: str - """The name of the inference profile.""" - - inference_profile_arn: str - """The Amazon Resource Name (ARN) of the inference profile.""" - - models: list[InferenceProfileModel] - """A list of information about each model in the inference profile.""" - - inference_profile_id: str - """The unique identifier of the inference profile.""" - - status: str - """ - The status of the inference profile. `ACTIVE` means that the inference - profile is ready to be used. - """ - - type: str - """ - The type of the inference profile. The following types are possible: - - - `SYSTEM_DEFINED` -- The inference profile is defined by Amazon - Bedrock. You can route inference requests across regions with these - inference profiles. - - - `APPLICATION` -- The inference profile was created by a user. This - type of inference profile can track metrics and costs when invoking - the model in it. The inference profile may route requests to one or - multiple regions. - """ - - description: str | None = field(repr=False, default=None) - """The description of the inference profile.""" - - created_at: datetime | None = None - """The time at which the inference profile was created.""" - - updated_at: datetime | None = None - """The time at which the inference profile was last updated.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INFERENCE_PROFILE_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_INFERENCE_PROFILE_SUMMARY.members["inferenceProfileName"], - self.inference_profile_name, - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_INFERENCE_PROFILE_SUMMARY.members["description"], - self.description, - ) - - if self.created_at is not None: - serializer.write_timestamp( - _SCHEMA_INFERENCE_PROFILE_SUMMARY.members["createdAt"], self.created_at - ) - - if self.updated_at is not None: - serializer.write_timestamp( - _SCHEMA_INFERENCE_PROFILE_SUMMARY.members["updatedAt"], self.updated_at - ) - - serializer.write_string( - _SCHEMA_INFERENCE_PROFILE_SUMMARY.members["inferenceProfileArn"], - self.inference_profile_arn, - ) - _serialize_inference_profile_models( - serializer, _SCHEMA_INFERENCE_PROFILE_SUMMARY.members["models"], self.models - ) - serializer.write_string( - _SCHEMA_INFERENCE_PROFILE_SUMMARY.members["inferenceProfileId"], - self.inference_profile_id, - ) - serializer.write_string( - _SCHEMA_INFERENCE_PROFILE_SUMMARY.members["status"], self.status - ) - serializer.write_string( - _SCHEMA_INFERENCE_PROFILE_SUMMARY.members["type"], self.type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["inference_profile_name"] = de.read_string( - _SCHEMA_INFERENCE_PROFILE_SUMMARY.members[ - "inferenceProfileName" - ] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_INFERENCE_PROFILE_SUMMARY.members["description"] - ) - - case 2: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_INFERENCE_PROFILE_SUMMARY.members["createdAt"] - ) - - case 3: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_INFERENCE_PROFILE_SUMMARY.members["updatedAt"] - ) - - case 4: - kwargs["inference_profile_arn"] = de.read_string( - _SCHEMA_INFERENCE_PROFILE_SUMMARY.members["inferenceProfileArn"] - ) - - case 5: - kwargs["models"] = _deserialize_inference_profile_models( - de, _SCHEMA_INFERENCE_PROFILE_SUMMARY.members["models"] - ) - - case 6: - kwargs["inference_profile_id"] = de.read_string( - _SCHEMA_INFERENCE_PROFILE_SUMMARY.members["inferenceProfileId"] - ) - - case 7: - kwargs["status"] = InferenceProfileStatus( - de.read_string( - _SCHEMA_INFERENCE_PROFILE_SUMMARY.members["status"] - ) - ) - - case 8: - kwargs["type"] = InferenceProfileType( - de.read_string( - _SCHEMA_INFERENCE_PROFILE_SUMMARY.members["type"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INFERENCE_PROFILE_SUMMARY, consumer=_consumer) - if "inference_profile_name" not in kwargs: - kwargs["inference_profile_name"] = "" - if "inference_profile_arn" not in kwargs: - kwargs["inference_profile_arn"] = "" - if "models" not in kwargs: - kwargs["models"] = [] - if "inference_profile_id" not in kwargs: - kwargs["inference_profile_id"] = "" - if "status" not in kwargs: - kwargs["status"] = InferenceProfileStatus._corrected("") - if "type" not in kwargs: - kwargs["type"] = InferenceProfileType._corrected("") - return kwargs - - -def _serialize_inference_profile_summaries( - serializer: ShapeSerializer, schema: Schema, value: list[InferenceProfileSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_inference_profile_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[InferenceProfileSummary]: - result: list[InferenceProfileSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(InferenceProfileSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListInferenceProfilesOutput: - """Dataclass for ListInferenceProfilesOutput structure.""" - - inference_profile_summaries: list[InferenceProfileSummary] | None = None - """A list of information about each inference profile that you can use.""" - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, use this token when making another request in - the `nextToken` field to return the next batch of results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_INFERENCE_PROFILES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.inference_profile_summaries is not None: - _serialize_inference_profile_summaries( - serializer, - _SCHEMA_LIST_INFERENCE_PROFILES_OUTPUT.members[ - "inferenceProfileSummaries" - ], - self.inference_profile_summaries, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_INFERENCE_PROFILES_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["inference_profile_summaries"] = ( - _deserialize_inference_profile_summaries( - de, - _SCHEMA_LIST_INFERENCE_PROFILES_OUTPUT.members[ - "inferenceProfileSummaries" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_INFERENCE_PROFILES_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_INFERENCE_PROFILES_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_INFERENCE_PROFILES = APIOperation( - input=ListInferenceProfilesInput, - output=ListInferenceProfilesOutput, - schema=_SCHEMA_LIST_INFERENCE_PROFILES, - input_schema=_SCHEMA_LIST_INFERENCE_PROFILES_INPUT, - output_schema=_SCHEMA_LIST_INFERENCE_PROFILES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteModelInvocationLoggingConfigurationInput: - """Dataclass for DeleteModelInvocationLoggingConfigurationInput structure.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DELETE_MODEL_INVOCATION_LOGGING_CONFIGURATION_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_MODEL_INVOCATION_LOGGING_CONFIGURATION_INPUT, - consumer=_consumer, - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteModelInvocationLoggingConfigurationOutput: - """Dataclass for DeleteModelInvocationLoggingConfigurationOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DELETE_MODEL_INVOCATION_LOGGING_CONFIGURATION_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_MODEL_INVOCATION_LOGGING_CONFIGURATION_OUTPUT, - consumer=_consumer, - ) - return kwargs - - -DELETE_MODEL_INVOCATION_LOGGING_CONFIGURATION = APIOperation( - input=DeleteModelInvocationLoggingConfigurationInput, - output=DeleteModelInvocationLoggingConfigurationOutput, - schema=_SCHEMA_DELETE_MODEL_INVOCATION_LOGGING_CONFIGURATION, - input_schema=_SCHEMA_DELETE_MODEL_INVOCATION_LOGGING_CONFIGURATION_INPUT, - output_schema=_SCHEMA_DELETE_MODEL_INVOCATION_LOGGING_CONFIGURATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetModelInvocationLoggingConfigurationInput: - """Dataclass for GetModelInvocationLoggingConfigurationInput structure.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_MODEL_INVOCATION_LOGGING_CONFIGURATION_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_MODEL_INVOCATION_LOGGING_CONFIGURATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class S3Config: - """S3 configuration for storing log data.""" - - bucket_name: str - """S3 bucket name.""" - - key_prefix: str | None = None - """S3 prefix.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_S3_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_S3_CONFIG.members["bucketName"], self.bucket_name - ) - if self.key_prefix is not None: - serializer.write_string( - _SCHEMA_S3_CONFIG.members["keyPrefix"], self.key_prefix - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bucket_name"] = de.read_string( - _SCHEMA_S3_CONFIG.members["bucketName"] - ) - - case 1: - kwargs["key_prefix"] = de.read_string( - _SCHEMA_S3_CONFIG.members["keyPrefix"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_S3_CONFIG, consumer=_consumer) - if "bucket_name" not in kwargs: - kwargs["bucket_name"] = "" - return kwargs - - -@dataclass(kw_only=True) -class CloudWatchConfig: - """CloudWatch logging configuration.""" - - log_group_name: str - """The log group name.""" - - role_arn: str - """The role Amazon Resource Name (ARN).""" - - large_data_delivery_s3_config: S3Config | None = None - """S3 configuration for delivering a large amount of data.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CLOUD_WATCH_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CLOUD_WATCH_CONFIG.members["logGroupName"], self.log_group_name - ) - serializer.write_string( - _SCHEMA_CLOUD_WATCH_CONFIG.members["roleArn"], self.role_arn - ) - if self.large_data_delivery_s3_config is not None: - serializer.write_struct( - _SCHEMA_CLOUD_WATCH_CONFIG.members["largeDataDeliveryS3Config"], - self.large_data_delivery_s3_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["log_group_name"] = de.read_string( - _SCHEMA_CLOUD_WATCH_CONFIG.members["logGroupName"] - ) - - case 1: - kwargs["role_arn"] = de.read_string( - _SCHEMA_CLOUD_WATCH_CONFIG.members["roleArn"] - ) - - case 2: - kwargs["large_data_delivery_s3_config"] = S3Config.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CLOUD_WATCH_CONFIG, consumer=_consumer) - if "log_group_name" not in kwargs: - kwargs["log_group_name"] = "" - if "role_arn" not in kwargs: - kwargs["role_arn"] = "" - return kwargs - - -@dataclass(kw_only=True) -class LoggingConfig: - """Configuration fields for invocation logging.""" - - cloud_watch_config: CloudWatchConfig | None = None - """CloudWatch logging configuration.""" - - s3_config: S3Config | None = None - """S3 configuration for storing log data.""" - - text_data_delivery_enabled: bool | None = None - """Set to include text data in the log delivery.""" - - image_data_delivery_enabled: bool | None = None - """Set to include image data in the log delivery.""" - - embedding_data_delivery_enabled: bool | None = None - """Set to include embeddings data in the log delivery.""" - - video_data_delivery_enabled: bool | None = None - """Set to include video data in the log delivery.""" - - audio_data_delivery_enabled: bool | None = None - """Set to include audio data in the log delivery.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LOGGING_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.cloud_watch_config is not None: - serializer.write_struct( - _SCHEMA_LOGGING_CONFIG.members["cloudWatchConfig"], - self.cloud_watch_config, - ) - - if self.s3_config is not None: - serializer.write_struct( - _SCHEMA_LOGGING_CONFIG.members["s3Config"], self.s3_config - ) - - if self.text_data_delivery_enabled is not None: - serializer.write_boolean( - _SCHEMA_LOGGING_CONFIG.members["textDataDeliveryEnabled"], - self.text_data_delivery_enabled, - ) - - if self.image_data_delivery_enabled is not None: - serializer.write_boolean( - _SCHEMA_LOGGING_CONFIG.members["imageDataDeliveryEnabled"], - self.image_data_delivery_enabled, - ) - - if self.embedding_data_delivery_enabled is not None: - serializer.write_boolean( - _SCHEMA_LOGGING_CONFIG.members["embeddingDataDeliveryEnabled"], - self.embedding_data_delivery_enabled, - ) - - if self.video_data_delivery_enabled is not None: - serializer.write_boolean( - _SCHEMA_LOGGING_CONFIG.members["videoDataDeliveryEnabled"], - self.video_data_delivery_enabled, - ) - - if self.audio_data_delivery_enabled is not None: - serializer.write_boolean( - _SCHEMA_LOGGING_CONFIG.members["audioDataDeliveryEnabled"], - self.audio_data_delivery_enabled, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["cloud_watch_config"] = CloudWatchConfig.deserialize(de) - - case 1: - kwargs["s3_config"] = S3Config.deserialize(de) - - case 2: - kwargs["text_data_delivery_enabled"] = de.read_boolean( - _SCHEMA_LOGGING_CONFIG.members["textDataDeliveryEnabled"] - ) - - case 3: - kwargs["image_data_delivery_enabled"] = de.read_boolean( - _SCHEMA_LOGGING_CONFIG.members["imageDataDeliveryEnabled"] - ) - - case 4: - kwargs["embedding_data_delivery_enabled"] = de.read_boolean( - _SCHEMA_LOGGING_CONFIG.members["embeddingDataDeliveryEnabled"] - ) - - case 5: - kwargs["video_data_delivery_enabled"] = de.read_boolean( - _SCHEMA_LOGGING_CONFIG.members["videoDataDeliveryEnabled"] - ) - - case 6: - kwargs["audio_data_delivery_enabled"] = de.read_boolean( - _SCHEMA_LOGGING_CONFIG.members["audioDataDeliveryEnabled"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LOGGING_CONFIG, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetModelInvocationLoggingConfigurationOutput: - """Dataclass for GetModelInvocationLoggingConfigurationOutput structure.""" - - logging_config: LoggingConfig | None = None - """The current configuration values.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_MODEL_INVOCATION_LOGGING_CONFIGURATION_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.logging_config is not None: - serializer.write_struct( - _SCHEMA_GET_MODEL_INVOCATION_LOGGING_CONFIGURATION_OUTPUT.members[ - "loggingConfig" - ], - self.logging_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["logging_config"] = LoggingConfig.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_MODEL_INVOCATION_LOGGING_CONFIGURATION_OUTPUT, - consumer=_consumer, - ) - return kwargs - - -GET_MODEL_INVOCATION_LOGGING_CONFIGURATION = APIOperation( - input=GetModelInvocationLoggingConfigurationInput, - output=GetModelInvocationLoggingConfigurationOutput, - schema=_SCHEMA_GET_MODEL_INVOCATION_LOGGING_CONFIGURATION, - input_schema=_SCHEMA_GET_MODEL_INVOCATION_LOGGING_CONFIGURATION_INPUT, - output_schema=_SCHEMA_GET_MODEL_INVOCATION_LOGGING_CONFIGURATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class PutModelInvocationLoggingConfigurationInput: - """Dataclass for PutModelInvocationLoggingConfigurationInput structure.""" - - logging_config: LoggingConfig | None = None - """The logging configuration values to set.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_PUT_MODEL_INVOCATION_LOGGING_CONFIGURATION_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.logging_config is not None: - serializer.write_struct( - _SCHEMA_PUT_MODEL_INVOCATION_LOGGING_CONFIGURATION_INPUT.members[ - "loggingConfig" - ], - self.logging_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["logging_config"] = LoggingConfig.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PUT_MODEL_INVOCATION_LOGGING_CONFIGURATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class PutModelInvocationLoggingConfigurationOutput: - """Dataclass for PutModelInvocationLoggingConfigurationOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_PUT_MODEL_INVOCATION_LOGGING_CONFIGURATION_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PUT_MODEL_INVOCATION_LOGGING_CONFIGURATION_OUTPUT, - consumer=_consumer, - ) - return kwargs - - -PUT_MODEL_INVOCATION_LOGGING_CONFIGURATION = APIOperation( - input=PutModelInvocationLoggingConfigurationInput, - output=PutModelInvocationLoggingConfigurationOutput, - schema=_SCHEMA_PUT_MODEL_INVOCATION_LOGGING_CONFIGURATION, - input_schema=_SCHEMA_PUT_MODEL_INVOCATION_LOGGING_CONFIGURATION_INPUT, - output_schema=_SCHEMA_PUT_MODEL_INVOCATION_LOGGING_CONFIGURATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class CreateModelCopyJobInput: - """Dataclass for CreateModelCopyJobInput structure.""" - - source_model_arn: str | None = None - """The Amazon Resource Name (ARN) of the model to be copied.""" - - target_model_name: str | None = None - """A name for the copied model.""" - - model_kms_key_id: str | None = None - """The ARN of the KMS key that you use to encrypt the model copy.""" - - target_model_tags: list[Tag] | None = None - """ - Tags to associate with the target model. For more information, see [Tag - resources](https://docs.aws.amazon.com/bedrock/latest/userguide/tagging.html) - in the [Amazon Bedrock User - Guide](https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html). - """ - - client_request_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If this token matches a previous - request, Amazon Bedrock ignores the request, but does not return an - error. For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_MODEL_COPY_JOB_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.source_model_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_MODEL_COPY_JOB_INPUT.members["sourceModelArn"], - self.source_model_arn, - ) - - if self.target_model_name is not None: - serializer.write_string( - _SCHEMA_CREATE_MODEL_COPY_JOB_INPUT.members["targetModelName"], - self.target_model_name, - ) - - if self.model_kms_key_id is not None: - serializer.write_string( - _SCHEMA_CREATE_MODEL_COPY_JOB_INPUT.members["modelKmsKeyId"], - self.model_kms_key_id, - ) - - if self.target_model_tags is not None: - _serialize_tag_list( - serializer, - _SCHEMA_CREATE_MODEL_COPY_JOB_INPUT.members["targetModelTags"], - self.target_model_tags, - ) - - if self.client_request_token is not None: - serializer.write_string( - _SCHEMA_CREATE_MODEL_COPY_JOB_INPUT.members["clientRequestToken"], - self.client_request_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["source_model_arn"] = de.read_string( - _SCHEMA_CREATE_MODEL_COPY_JOB_INPUT.members["sourceModelArn"] - ) - - case 1: - kwargs["target_model_name"] = de.read_string( - _SCHEMA_CREATE_MODEL_COPY_JOB_INPUT.members["targetModelName"] - ) - - case 2: - kwargs["model_kms_key_id"] = de.read_string( - _SCHEMA_CREATE_MODEL_COPY_JOB_INPUT.members["modelKmsKeyId"] - ) - - case 3: - kwargs["target_model_tags"] = _deserialize_tag_list( - de, - _SCHEMA_CREATE_MODEL_COPY_JOB_INPUT.members["targetModelTags"], - ) - - case 4: - kwargs["client_request_token"] = de.read_string( - _SCHEMA_CREATE_MODEL_COPY_JOB_INPUT.members[ - "clientRequestToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_MODEL_COPY_JOB_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CreateModelCopyJobOutput: - """Dataclass for CreateModelCopyJobOutput structure.""" - - job_arn: str - """The Amazon Resource Name (ARN) of the model copy job.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_MODEL_COPY_JOB_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_MODEL_COPY_JOB_OUTPUT.members["jobArn"], self.job_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["job_arn"] = de.read_string( - _SCHEMA_CREATE_MODEL_COPY_JOB_OUTPUT.members["jobArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_MODEL_COPY_JOB_OUTPUT, consumer=_consumer - ) - if "job_arn" not in kwargs: - kwargs["job_arn"] = "" - return kwargs - - -CREATE_MODEL_COPY_JOB = APIOperation( - input=CreateModelCopyJobInput, - output=CreateModelCopyJobOutput, - schema=_SCHEMA_CREATE_MODEL_COPY_JOB, - input_schema=_SCHEMA_CREATE_MODEL_COPY_JOB_INPUT, - output_schema=_SCHEMA_CREATE_MODEL_COPY_JOB_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#TooManyTagsException"): TooManyTagsException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_TAGS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetModelCopyJobInput: - """Dataclass for GetModelCopyJobInput structure.""" - - job_arn: str | None = None - """The Amazon Resource Name (ARN) of the model copy job.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_MODEL_COPY_JOB_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.job_arn is not None: - serializer.write_string( - _SCHEMA_GET_MODEL_COPY_JOB_INPUT.members["jobArn"], self.job_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["job_arn"] = de.read_string( - _SCHEMA_GET_MODEL_COPY_JOB_INPUT.members["jobArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_MODEL_COPY_JOB_INPUT, consumer=_consumer) - return kwargs - - -class ModelCopyJobStatus(UnknownEnumMixin, StrEnum): - IN_PROGRESS = "InProgress" - COMPLETED = "Completed" - FAILED = "Failed" - - -@dataclass(kw_only=True) -class GetModelCopyJobOutput: - """Dataclass for GetModelCopyJobOutput structure.""" - - job_arn: str - """The Amazon Resource Name (ARN) of the model copy job.""" - - status: str - """The status of the model copy job.""" - - creation_time: datetime - """The time at which the model copy job was created.""" - - target_model_arn: str - """The Amazon Resource Name (ARN) of the copied model.""" - - source_account_id: str - """ - The unique identifier of the account that the model being copied - originated from. - """ - - source_model_arn: str - """The Amazon Resource Name (ARN) of the original model being copied.""" - - target_model_name: str | None = None - """The name of the copied model.""" - - target_model_kms_key_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the KMS key encrypting the copied - model. - """ - - target_model_tags: list[Tag] | None = None - """The tags associated with the copied model.""" - - failure_message: str | None = None - """An error message for why the model copy job failed.""" - - source_model_name: str | None = None - """The name of the original model being copied.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_MODEL_COPY_JOB_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_MODEL_COPY_JOB_OUTPUT.members["jobArn"], self.job_arn - ) - serializer.write_string( - _SCHEMA_GET_MODEL_COPY_JOB_OUTPUT.members["status"], self.status - ) - serializer.write_timestamp( - _SCHEMA_GET_MODEL_COPY_JOB_OUTPUT.members["creationTime"], - self.creation_time, - ) - serializer.write_string( - _SCHEMA_GET_MODEL_COPY_JOB_OUTPUT.members["targetModelArn"], - self.target_model_arn, - ) - if self.target_model_name is not None: - serializer.write_string( - _SCHEMA_GET_MODEL_COPY_JOB_OUTPUT.members["targetModelName"], - self.target_model_name, - ) - - serializer.write_string( - _SCHEMA_GET_MODEL_COPY_JOB_OUTPUT.members["sourceAccountId"], - self.source_account_id, - ) - serializer.write_string( - _SCHEMA_GET_MODEL_COPY_JOB_OUTPUT.members["sourceModelArn"], - self.source_model_arn, - ) - if self.target_model_kms_key_arn is not None: - serializer.write_string( - _SCHEMA_GET_MODEL_COPY_JOB_OUTPUT.members["targetModelKmsKeyArn"], - self.target_model_kms_key_arn, - ) - - if self.target_model_tags is not None: - _serialize_tag_list( - serializer, - _SCHEMA_GET_MODEL_COPY_JOB_OUTPUT.members["targetModelTags"], - self.target_model_tags, - ) - - if self.failure_message is not None: - serializer.write_string( - _SCHEMA_GET_MODEL_COPY_JOB_OUTPUT.members["failureMessage"], - self.failure_message, - ) - - if self.source_model_name is not None: - serializer.write_string( - _SCHEMA_GET_MODEL_COPY_JOB_OUTPUT.members["sourceModelName"], - self.source_model_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["job_arn"] = de.read_string( - _SCHEMA_GET_MODEL_COPY_JOB_OUTPUT.members["jobArn"] - ) - - case 1: - kwargs["status"] = ModelCopyJobStatus( - de.read_string( - _SCHEMA_GET_MODEL_COPY_JOB_OUTPUT.members["status"] - ) - ) - - case 2: - kwargs["creation_time"] = de.read_timestamp( - _SCHEMA_GET_MODEL_COPY_JOB_OUTPUT.members["creationTime"] - ) - - case 3: - kwargs["target_model_arn"] = de.read_string( - _SCHEMA_GET_MODEL_COPY_JOB_OUTPUT.members["targetModelArn"] - ) - - case 4: - kwargs["target_model_name"] = de.read_string( - _SCHEMA_GET_MODEL_COPY_JOB_OUTPUT.members["targetModelName"] - ) - - case 5: - kwargs["source_account_id"] = de.read_string( - _SCHEMA_GET_MODEL_COPY_JOB_OUTPUT.members["sourceAccountId"] - ) - - case 6: - kwargs["source_model_arn"] = de.read_string( - _SCHEMA_GET_MODEL_COPY_JOB_OUTPUT.members["sourceModelArn"] - ) - - case 7: - kwargs["target_model_kms_key_arn"] = de.read_string( - _SCHEMA_GET_MODEL_COPY_JOB_OUTPUT.members[ - "targetModelKmsKeyArn" - ] - ) - - case 8: - kwargs["target_model_tags"] = _deserialize_tag_list( - de, _SCHEMA_GET_MODEL_COPY_JOB_OUTPUT.members["targetModelTags"] - ) - - case 9: - kwargs["failure_message"] = de.read_string( - _SCHEMA_GET_MODEL_COPY_JOB_OUTPUT.members["failureMessage"] - ) - - case 10: - kwargs["source_model_name"] = de.read_string( - _SCHEMA_GET_MODEL_COPY_JOB_OUTPUT.members["sourceModelName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_MODEL_COPY_JOB_OUTPUT, consumer=_consumer) - if "job_arn" not in kwargs: - kwargs["job_arn"] = "" - if "status" not in kwargs: - kwargs["status"] = ModelCopyJobStatus._corrected("") - if "creation_time" not in kwargs: - kwargs["creation_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "target_model_arn" not in kwargs: - kwargs["target_model_arn"] = "" - if "source_account_id" not in kwargs: - kwargs["source_account_id"] = "" - if "source_model_arn" not in kwargs: - kwargs["source_model_arn"] = "" - return kwargs - - -GET_MODEL_COPY_JOB = APIOperation( - input=GetModelCopyJobInput, - output=GetModelCopyJobOutput, - schema=_SCHEMA_GET_MODEL_COPY_JOB, - input_schema=_SCHEMA_GET_MODEL_COPY_JOB_INPUT, - output_schema=_SCHEMA_GET_MODEL_COPY_JOB_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListModelCopyJobsInput: - """Dataclass for ListModelCopyJobsInput structure.""" - - creation_time_after: datetime | None = None - """Filters for model copy jobs created after the specified time.""" - - creation_time_before: datetime | None = None - """Filters for model copy jobs created before the specified time.""" - - status_equals: str | None = None - """ - Filters for model copy jobs whose status matches the value that you - specify. - """ - - source_account_equals: str | None = None - """ - Filters for model copy jobs in which the account that the source model - belongs to is equal to the value that you specify. - """ - - source_model_arn_equals: str | None = None - """ - Filters for model copy jobs in which the Amazon Resource Name (ARN) of - the source model to is equal to the value that you specify. - """ - - target_model_name_contains: str | None = None - """ - Filters for model copy jobs in which the name of the copied model - contains the string that you specify. - """ - - max_results: int | None = None - """ - The maximum number of results to return in the response. If the total - number of results is greater than this value, use the token returned in - the response in the `nextToken` field when making another request to - return the next batch of results. - """ - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, enter the token returned in the `nextToken` - field in the response in this field to return the next batch of results. - """ - - sort_by: str | None = None - """The field to sort by in the returned list of model copy jobs.""" - - sort_order: str | None = None - """Specifies whether to sort the results in ascending or descending order.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_MODEL_COPY_JOBS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.creation_time_after is not None: - serializer.write_timestamp( - _SCHEMA_LIST_MODEL_COPY_JOBS_INPUT.members["creationTimeAfter"], - self.creation_time_after, - ) - - if self.creation_time_before is not None: - serializer.write_timestamp( - _SCHEMA_LIST_MODEL_COPY_JOBS_INPUT.members["creationTimeBefore"], - self.creation_time_before, - ) - - if self.status_equals is not None: - serializer.write_string( - _SCHEMA_LIST_MODEL_COPY_JOBS_INPUT.members["statusEquals"], - self.status_equals, - ) - - if self.source_account_equals is not None: - serializer.write_string( - _SCHEMA_LIST_MODEL_COPY_JOBS_INPUT.members["sourceAccountEquals"], - self.source_account_equals, - ) - - if self.source_model_arn_equals is not None: - serializer.write_string( - _SCHEMA_LIST_MODEL_COPY_JOBS_INPUT.members["sourceModelArnEquals"], - self.source_model_arn_equals, - ) - - if self.target_model_name_contains is not None: - serializer.write_string( - _SCHEMA_LIST_MODEL_COPY_JOBS_INPUT.members["targetModelNameContains"], - self.target_model_name_contains, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_MODEL_COPY_JOBS_INPUT.members["maxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_MODEL_COPY_JOBS_INPUT.members["nextToken"], self.next_token - ) - - if self.sort_by is not None: - serializer.write_string( - _SCHEMA_LIST_MODEL_COPY_JOBS_INPUT.members["sortBy"], self.sort_by - ) - - if self.sort_order is not None: - serializer.write_string( - _SCHEMA_LIST_MODEL_COPY_JOBS_INPUT.members["sortOrder"], self.sort_order - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["creation_time_after"] = de.read_timestamp( - _SCHEMA_LIST_MODEL_COPY_JOBS_INPUT.members["creationTimeAfter"] - ) - - case 1: - kwargs["creation_time_before"] = de.read_timestamp( - _SCHEMA_LIST_MODEL_COPY_JOBS_INPUT.members["creationTimeBefore"] - ) - - case 2: - kwargs["status_equals"] = ModelCopyJobStatus( - de.read_string( - _SCHEMA_LIST_MODEL_COPY_JOBS_INPUT.members["statusEquals"] - ) - ) - - case 3: - kwargs["source_account_equals"] = de.read_string( - _SCHEMA_LIST_MODEL_COPY_JOBS_INPUT.members[ - "sourceAccountEquals" - ] - ) - - case 4: - kwargs["source_model_arn_equals"] = de.read_string( - _SCHEMA_LIST_MODEL_COPY_JOBS_INPUT.members[ - "sourceModelArnEquals" - ] - ) - - case 5: - kwargs["target_model_name_contains"] = de.read_string( - _SCHEMA_LIST_MODEL_COPY_JOBS_INPUT.members[ - "targetModelNameContains" - ] - ) - - case 6: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_MODEL_COPY_JOBS_INPUT.members["maxResults"] - ) - - case 7: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_MODEL_COPY_JOBS_INPUT.members["nextToken"] - ) - - case 8: - kwargs["sort_by"] = SortJobsBy( - de.read_string( - _SCHEMA_LIST_MODEL_COPY_JOBS_INPUT.members["sortBy"] - ) - ) - - case 9: - kwargs["sort_order"] = SortOrder( - de.read_string( - _SCHEMA_LIST_MODEL_COPY_JOBS_INPUT.members["sortOrder"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_MODEL_COPY_JOBS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ModelCopyJobSummary: - """ - Contains details about each model copy job. - - This data type is used in the following API operations: - - - [ListModelCopyJobs - response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_ListModelCopyJobs.html#API_ListModelCopyJobs_ResponseSyntax) - """ - - job_arn: str - """The Amazon Resoource Name (ARN) of the model copy job.""" - - status: str - """The status of the model copy job.""" - - creation_time: datetime - """The time that the model copy job was created.""" - - target_model_arn: str - """The Amazon Resource Name (ARN) of the copied model.""" - - source_account_id: str - """ - The unique identifier of the account that the model being copied - originated from. - """ - - source_model_arn: str - """The Amazon Resource Name (ARN) of the original model being copied.""" - - target_model_name: str | None = None - """The name of the copied model.""" - - target_model_kms_key_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the KMS key used to encrypt the copied - model. - """ - - target_model_tags: list[Tag] | None = None - """Tags associated with the copied model.""" - - failure_message: str | None = None - """ - If a model fails to be copied, a message describing why the job failed - is included here. - """ - - source_model_name: str | None = None - """The name of the original model being copied.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MODEL_COPY_JOB_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MODEL_COPY_JOB_SUMMARY.members["jobArn"], self.job_arn - ) - serializer.write_string( - _SCHEMA_MODEL_COPY_JOB_SUMMARY.members["status"], self.status - ) - serializer.write_timestamp( - _SCHEMA_MODEL_COPY_JOB_SUMMARY.members["creationTime"], self.creation_time - ) - serializer.write_string( - _SCHEMA_MODEL_COPY_JOB_SUMMARY.members["targetModelArn"], - self.target_model_arn, - ) - if self.target_model_name is not None: - serializer.write_string( - _SCHEMA_MODEL_COPY_JOB_SUMMARY.members["targetModelName"], - self.target_model_name, - ) - - serializer.write_string( - _SCHEMA_MODEL_COPY_JOB_SUMMARY.members["sourceAccountId"], - self.source_account_id, - ) - serializer.write_string( - _SCHEMA_MODEL_COPY_JOB_SUMMARY.members["sourceModelArn"], - self.source_model_arn, - ) - if self.target_model_kms_key_arn is not None: - serializer.write_string( - _SCHEMA_MODEL_COPY_JOB_SUMMARY.members["targetModelKmsKeyArn"], - self.target_model_kms_key_arn, - ) - - if self.target_model_tags is not None: - _serialize_tag_list( - serializer, - _SCHEMA_MODEL_COPY_JOB_SUMMARY.members["targetModelTags"], - self.target_model_tags, - ) - - if self.failure_message is not None: - serializer.write_string( - _SCHEMA_MODEL_COPY_JOB_SUMMARY.members["failureMessage"], - self.failure_message, - ) - - if self.source_model_name is not None: - serializer.write_string( - _SCHEMA_MODEL_COPY_JOB_SUMMARY.members["sourceModelName"], - self.source_model_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["job_arn"] = de.read_string( - _SCHEMA_MODEL_COPY_JOB_SUMMARY.members["jobArn"] - ) - - case 1: - kwargs["status"] = ModelCopyJobStatus( - de.read_string(_SCHEMA_MODEL_COPY_JOB_SUMMARY.members["status"]) - ) - - case 2: - kwargs["creation_time"] = de.read_timestamp( - _SCHEMA_MODEL_COPY_JOB_SUMMARY.members["creationTime"] - ) - - case 3: - kwargs["target_model_arn"] = de.read_string( - _SCHEMA_MODEL_COPY_JOB_SUMMARY.members["targetModelArn"] - ) - - case 4: - kwargs["target_model_name"] = de.read_string( - _SCHEMA_MODEL_COPY_JOB_SUMMARY.members["targetModelName"] - ) - - case 5: - kwargs["source_account_id"] = de.read_string( - _SCHEMA_MODEL_COPY_JOB_SUMMARY.members["sourceAccountId"] - ) - - case 6: - kwargs["source_model_arn"] = de.read_string( - _SCHEMA_MODEL_COPY_JOB_SUMMARY.members["sourceModelArn"] - ) - - case 7: - kwargs["target_model_kms_key_arn"] = de.read_string( - _SCHEMA_MODEL_COPY_JOB_SUMMARY.members["targetModelKmsKeyArn"] - ) - - case 8: - kwargs["target_model_tags"] = _deserialize_tag_list( - de, _SCHEMA_MODEL_COPY_JOB_SUMMARY.members["targetModelTags"] - ) - - case 9: - kwargs["failure_message"] = de.read_string( - _SCHEMA_MODEL_COPY_JOB_SUMMARY.members["failureMessage"] - ) - - case 10: - kwargs["source_model_name"] = de.read_string( - _SCHEMA_MODEL_COPY_JOB_SUMMARY.members["sourceModelName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MODEL_COPY_JOB_SUMMARY, consumer=_consumer) - if "job_arn" not in kwargs: - kwargs["job_arn"] = "" - if "status" not in kwargs: - kwargs["status"] = ModelCopyJobStatus._corrected("") - if "creation_time" not in kwargs: - kwargs["creation_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "target_model_arn" not in kwargs: - kwargs["target_model_arn"] = "" - if "source_account_id" not in kwargs: - kwargs["source_account_id"] = "" - if "source_model_arn" not in kwargs: - kwargs["source_model_arn"] = "" - return kwargs - - -def _serialize_model_copy_job_summaries( - serializer: ShapeSerializer, schema: Schema, value: list[ModelCopyJobSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_model_copy_job_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ModelCopyJobSummary]: - result: list[ModelCopyJobSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ModelCopyJobSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListModelCopyJobsOutput: - """Dataclass for ListModelCopyJobsOutput structure.""" - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, use this token when making another request in - the `nextToken` field to return the next batch of results. - """ - - model_copy_job_summaries: list[ModelCopyJobSummary] | None = None - """A list of information about each model copy job.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_MODEL_COPY_JOBS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_MODEL_COPY_JOBS_OUTPUT.members["nextToken"], - self.next_token, - ) - - if self.model_copy_job_summaries is not None: - _serialize_model_copy_job_summaries( - serializer, - _SCHEMA_LIST_MODEL_COPY_JOBS_OUTPUT.members["modelCopyJobSummaries"], - self.model_copy_job_summaries, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_MODEL_COPY_JOBS_OUTPUT.members["nextToken"] - ) - - case 1: - kwargs["model_copy_job_summaries"] = ( - _deserialize_model_copy_job_summaries( - de, - _SCHEMA_LIST_MODEL_COPY_JOBS_OUTPUT.members[ - "modelCopyJobSummaries" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_MODEL_COPY_JOBS_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_MODEL_COPY_JOBS = APIOperation( - input=ListModelCopyJobsInput, - output=ListModelCopyJobsOutput, - schema=_SCHEMA_LIST_MODEL_COPY_JOBS, - input_schema=_SCHEMA_LIST_MODEL_COPY_JOBS_INPUT, - output_schema=_SCHEMA_LIST_MODEL_COPY_JOBS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class CreateModelImportJobInput: - """Dataclass for CreateModelImportJobInput structure.""" - - job_name: str | None = None - """The name of the import job.""" - - imported_model_name: str | None = None - """The name of the imported model.""" - - role_arn: str | None = None - """The Amazon Resource Name (ARN) of the model import job.""" - - model_data_source: ModelDataSource | None = None - """The data source for the imported model.""" - - job_tags: list[Tag] | None = None - """Tags to attach to this import job.""" - - imported_model_tags: list[Tag] | None = None - """Tags to attach to the imported model.""" - - client_request_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If this token matches a previous - request, Amazon Bedrock ignores the request, but does not return an - error. For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - vpc_config: VpcConfig | None = None - """ - VPC configuration parameters for the private Virtual Private Cloud (VPC) - that contains the resources you are using for the import job. - """ - - imported_model_kms_key_id: str | None = None - """The imported model is encrypted at rest using this key.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_MODEL_IMPORT_JOB_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.job_name is not None: - serializer.write_string( - _SCHEMA_CREATE_MODEL_IMPORT_JOB_INPUT.members["jobName"], self.job_name - ) - - if self.imported_model_name is not None: - serializer.write_string( - _SCHEMA_CREATE_MODEL_IMPORT_JOB_INPUT.members["importedModelName"], - self.imported_model_name, - ) - - if self.role_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_MODEL_IMPORT_JOB_INPUT.members["roleArn"], self.role_arn - ) - - if self.model_data_source is not None: - serializer.write_struct( - _SCHEMA_CREATE_MODEL_IMPORT_JOB_INPUT.members["modelDataSource"], - self.model_data_source, - ) - - if self.job_tags is not None: - _serialize_tag_list( - serializer, - _SCHEMA_CREATE_MODEL_IMPORT_JOB_INPUT.members["jobTags"], - self.job_tags, - ) - - if self.imported_model_tags is not None: - _serialize_tag_list( - serializer, - _SCHEMA_CREATE_MODEL_IMPORT_JOB_INPUT.members["importedModelTags"], - self.imported_model_tags, - ) - - if self.client_request_token is not None: - serializer.write_string( - _SCHEMA_CREATE_MODEL_IMPORT_JOB_INPUT.members["clientRequestToken"], - self.client_request_token, - ) - - if self.vpc_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_MODEL_IMPORT_JOB_INPUT.members["vpcConfig"], - self.vpc_config, - ) - - if self.imported_model_kms_key_id is not None: - serializer.write_string( - _SCHEMA_CREATE_MODEL_IMPORT_JOB_INPUT.members["importedModelKmsKeyId"], - self.imported_model_kms_key_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["job_name"] = de.read_string( - _SCHEMA_CREATE_MODEL_IMPORT_JOB_INPUT.members["jobName"] - ) - - case 1: - kwargs["imported_model_name"] = de.read_string( - _SCHEMA_CREATE_MODEL_IMPORT_JOB_INPUT.members[ - "importedModelName" - ] - ) - - case 2: - kwargs["role_arn"] = de.read_string( - _SCHEMA_CREATE_MODEL_IMPORT_JOB_INPUT.members["roleArn"] - ) - - case 3: - kwargs["model_data_source"] = ( - _ModelDataSourceDeserializer().deserialize(de) - ) - - case 4: - kwargs["job_tags"] = _deserialize_tag_list( - de, _SCHEMA_CREATE_MODEL_IMPORT_JOB_INPUT.members["jobTags"] - ) - - case 5: - kwargs["imported_model_tags"] = _deserialize_tag_list( - de, - _SCHEMA_CREATE_MODEL_IMPORT_JOB_INPUT.members[ - "importedModelTags" - ], - ) - - case 6: - kwargs["client_request_token"] = de.read_string( - _SCHEMA_CREATE_MODEL_IMPORT_JOB_INPUT.members[ - "clientRequestToken" - ] - ) - - case 7: - kwargs["vpc_config"] = VpcConfig.deserialize(de) - - case 8: - kwargs["imported_model_kms_key_id"] = de.read_string( - _SCHEMA_CREATE_MODEL_IMPORT_JOB_INPUT.members[ - "importedModelKmsKeyId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_MODEL_IMPORT_JOB_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CreateModelImportJobOutput: - """Dataclass for CreateModelImportJobOutput structure.""" - - job_arn: str - """The Amazon Resource Name (ARN) of the model import job.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_MODEL_IMPORT_JOB_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_MODEL_IMPORT_JOB_OUTPUT.members["jobArn"], self.job_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["job_arn"] = de.read_string( - _SCHEMA_CREATE_MODEL_IMPORT_JOB_OUTPUT.members["jobArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_MODEL_IMPORT_JOB_OUTPUT, consumer=_consumer - ) - if "job_arn" not in kwargs: - kwargs["job_arn"] = "" - return kwargs - - -CREATE_MODEL_IMPORT_JOB = APIOperation( - input=CreateModelImportJobInput, - output=CreateModelImportJobOutput, - schema=_SCHEMA_CREATE_MODEL_IMPORT_JOB, - input_schema=_SCHEMA_CREATE_MODEL_IMPORT_JOB_INPUT, - output_schema=_SCHEMA_CREATE_MODEL_IMPORT_JOB_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrock#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrock#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#TooManyTagsException"): TooManyTagsException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_TOO_MANY_TAGS_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteImportedModelInput: - """Dataclass for DeleteImportedModelInput structure.""" - - model_identifier: str | None = None - """Name of the imported model to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_IMPORTED_MODEL_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.model_identifier is not None: - serializer.write_string( - _SCHEMA_DELETE_IMPORTED_MODEL_INPUT.members["modelIdentifier"], - self.model_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_identifier"] = de.read_string( - _SCHEMA_DELETE_IMPORTED_MODEL_INPUT.members["modelIdentifier"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_IMPORTED_MODEL_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteImportedModelOutput: - """Dataclass for DeleteImportedModelOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_IMPORTED_MODEL_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_IMPORTED_MODEL_OUTPUT, consumer=_consumer - ) - return kwargs - - -DELETE_IMPORTED_MODEL = APIOperation( - input=DeleteImportedModelInput, - output=DeleteImportedModelOutput, - schema=_SCHEMA_DELETE_IMPORTED_MODEL, - input_schema=_SCHEMA_DELETE_IMPORTED_MODEL_INPUT, - output_schema=_SCHEMA_DELETE_IMPORTED_MODEL_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrock#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetImportedModelInput: - """Dataclass for GetImportedModelInput structure.""" - - model_identifier: str | None = None - """Name or Amazon Resource Name (ARN) of the imported model.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_IMPORTED_MODEL_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.model_identifier is not None: - serializer.write_string( - _SCHEMA_GET_IMPORTED_MODEL_INPUT.members["modelIdentifier"], - self.model_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_identifier"] = de.read_string( - _SCHEMA_GET_IMPORTED_MODEL_INPUT.members["modelIdentifier"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_IMPORTED_MODEL_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CustomModelUnits: - """ - A `CustomModelUnit` (CMU) is an abstract view of the hardware - utilization that Amazon Bedrock needs to host a single copy of your - custom model. A model copy represents a single instance of your imported - model that is ready to serve inference requests. Amazon Bedrock - determines the number of custom model units that a model copy needs when - you import the custom model. - - You can use `CustomModelUnits` to estimate the cost of running your - custom model. For more information, see Calculate the cost of running a - custom model in the Amazon Bedrock user guide. - """ - - custom_model_units_per_model_copy: int | None = None - """The number of custom model units used to host a model copy.""" - - custom_model_units_version: str | None = None - """ - The version of the custom model unit. Use to determine the billing rate - for the custom model unit. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOM_MODEL_UNITS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.custom_model_units_per_model_copy is not None: - serializer.write_integer( - _SCHEMA_CUSTOM_MODEL_UNITS.members["customModelUnitsPerModelCopy"], - self.custom_model_units_per_model_copy, - ) - - if self.custom_model_units_version is not None: - serializer.write_string( - _SCHEMA_CUSTOM_MODEL_UNITS.members["customModelUnitsVersion"], - self.custom_model_units_version, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["custom_model_units_per_model_copy"] = de.read_integer( - _SCHEMA_CUSTOM_MODEL_UNITS.members[ - "customModelUnitsPerModelCopy" - ] - ) - - case 1: - kwargs["custom_model_units_version"] = de.read_string( - _SCHEMA_CUSTOM_MODEL_UNITS.members["customModelUnitsVersion"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CUSTOM_MODEL_UNITS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetImportedModelOutput: - """Dataclass for GetImportedModelOutput structure.""" - - model_arn: str | None = None - """The Amazon Resource Name (ARN) associated with this imported model.""" - - model_name: str | None = None - """The name of the imported model.""" - - job_name: str | None = None - """Job name associated with the imported model.""" - - job_arn: str | None = None - """Job Amazon Resource Name (ARN) associated with the imported model.""" - - model_data_source: ModelDataSource | None = None - """The data source for this imported model.""" - - creation_time: datetime | None = None - """Creation time of the imported model.""" - - model_architecture: str | None = None - """The architecture of the imported model.""" - - model_kms_key_arn: str | None = None - """The imported model is encrypted at rest using this key.""" - - instruct_supported: bool | None = None - """Specifies if the imported model supports converse.""" - - custom_model_units: CustomModelUnits | None = None - """ - Information about the hardware utilization for a single copy of the - model. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_IMPORTED_MODEL_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.model_arn is not None: - serializer.write_string( - _SCHEMA_GET_IMPORTED_MODEL_OUTPUT.members["modelArn"], self.model_arn - ) - - if self.model_name is not None: - serializer.write_string( - _SCHEMA_GET_IMPORTED_MODEL_OUTPUT.members["modelName"], self.model_name - ) - - if self.job_name is not None: - serializer.write_string( - _SCHEMA_GET_IMPORTED_MODEL_OUTPUT.members["jobName"], self.job_name - ) - - if self.job_arn is not None: - serializer.write_string( - _SCHEMA_GET_IMPORTED_MODEL_OUTPUT.members["jobArn"], self.job_arn - ) - - if self.model_data_source is not None: - serializer.write_struct( - _SCHEMA_GET_IMPORTED_MODEL_OUTPUT.members["modelDataSource"], - self.model_data_source, - ) - - if self.creation_time is not None: - serializer.write_timestamp( - _SCHEMA_GET_IMPORTED_MODEL_OUTPUT.members["creationTime"], - self.creation_time, - ) - - if self.model_architecture is not None: - serializer.write_string( - _SCHEMA_GET_IMPORTED_MODEL_OUTPUT.members["modelArchitecture"], - self.model_architecture, - ) - - if self.model_kms_key_arn is not None: - serializer.write_string( - _SCHEMA_GET_IMPORTED_MODEL_OUTPUT.members["modelKmsKeyArn"], - self.model_kms_key_arn, - ) - - if self.instruct_supported is not None: - serializer.write_boolean( - _SCHEMA_GET_IMPORTED_MODEL_OUTPUT.members["instructSupported"], - self.instruct_supported, - ) - - if self.custom_model_units is not None: - serializer.write_struct( - _SCHEMA_GET_IMPORTED_MODEL_OUTPUT.members["customModelUnits"], - self.custom_model_units, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_arn"] = de.read_string( - _SCHEMA_GET_IMPORTED_MODEL_OUTPUT.members["modelArn"] - ) - - case 1: - kwargs["model_name"] = de.read_string( - _SCHEMA_GET_IMPORTED_MODEL_OUTPUT.members["modelName"] - ) - - case 2: - kwargs["job_name"] = de.read_string( - _SCHEMA_GET_IMPORTED_MODEL_OUTPUT.members["jobName"] - ) - - case 3: - kwargs["job_arn"] = de.read_string( - _SCHEMA_GET_IMPORTED_MODEL_OUTPUT.members["jobArn"] - ) - - case 4: - kwargs["model_data_source"] = ( - _ModelDataSourceDeserializer().deserialize(de) - ) - - case 5: - kwargs["creation_time"] = de.read_timestamp( - _SCHEMA_GET_IMPORTED_MODEL_OUTPUT.members["creationTime"] - ) - - case 6: - kwargs["model_architecture"] = de.read_string( - _SCHEMA_GET_IMPORTED_MODEL_OUTPUT.members["modelArchitecture"] - ) - - case 7: - kwargs["model_kms_key_arn"] = de.read_string( - _SCHEMA_GET_IMPORTED_MODEL_OUTPUT.members["modelKmsKeyArn"] - ) - - case 8: - kwargs["instruct_supported"] = de.read_boolean( - _SCHEMA_GET_IMPORTED_MODEL_OUTPUT.members["instructSupported"] - ) - - case 9: - kwargs["custom_model_units"] = CustomModelUnits.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_IMPORTED_MODEL_OUTPUT, consumer=_consumer) - return kwargs - - -GET_IMPORTED_MODEL = APIOperation( - input=GetImportedModelInput, - output=GetImportedModelOutput, - schema=_SCHEMA_GET_IMPORTED_MODEL, - input_schema=_SCHEMA_GET_IMPORTED_MODEL_INPUT, - output_schema=_SCHEMA_GET_IMPORTED_MODEL_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetModelImportJobInput: - """Dataclass for GetModelImportJobInput structure.""" - - job_identifier: str | None = None - """The identifier of the import job.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_MODEL_IMPORT_JOB_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.job_identifier is not None: - serializer.write_string( - _SCHEMA_GET_MODEL_IMPORT_JOB_INPUT.members["jobIdentifier"], - self.job_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["job_identifier"] = de.read_string( - _SCHEMA_GET_MODEL_IMPORT_JOB_INPUT.members["jobIdentifier"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_MODEL_IMPORT_JOB_INPUT, consumer=_consumer) - return kwargs - - -class ModelImportJobStatus(UnknownEnumMixin, StrEnum): - IN_PROGRESS = "InProgress" - COMPLETED = "Completed" - FAILED = "Failed" - - -@dataclass(kw_only=True) -class GetModelImportJobOutput: - """Dataclass for GetModelImportJobOutput structure.""" - - job_arn: str | None = None - """The Amazon Resource Name (ARN) of the import job.""" - - job_name: str | None = None - """The name of the import job.""" - - imported_model_name: str | None = None - """The name of the imported model.""" - - imported_model_arn: str | None = None - """The Amazon Resource Name (ARN) of the imported model.""" - - role_arn: str | None = None - """The Amazon Resource Name (ARN) of the IAM role associated with this job.""" - - model_data_source: ModelDataSource | None = None - """The data source for the imported model.""" - - status: str | None = None - """ - The status of the job. A successful job transitions from in-progress to - completed when the imported model is ready to use. If the job failed, - the failure message contains information about why the job failed. - """ - - failure_message: str | None = None - """Information about why the import job failed.""" - - creation_time: datetime | None = None - """The time the resource was created.""" - - last_modified_time: datetime | None = None - """Time the resource was last modified.""" - - end_time: datetime | None = None - """Time that the resource transitioned to terminal state.""" - - vpc_config: VpcConfig | None = None - """The Virtual Private Cloud (VPC) configuration of the import model job.""" - - imported_model_kms_key_arn: str | None = None - """The imported model is encrypted at rest using this key.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_MODEL_IMPORT_JOB_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.job_arn is not None: - serializer.write_string( - _SCHEMA_GET_MODEL_IMPORT_JOB_OUTPUT.members["jobArn"], self.job_arn - ) - - if self.job_name is not None: - serializer.write_string( - _SCHEMA_GET_MODEL_IMPORT_JOB_OUTPUT.members["jobName"], self.job_name - ) - - if self.imported_model_name is not None: - serializer.write_string( - _SCHEMA_GET_MODEL_IMPORT_JOB_OUTPUT.members["importedModelName"], - self.imported_model_name, - ) - - if self.imported_model_arn is not None: - serializer.write_string( - _SCHEMA_GET_MODEL_IMPORT_JOB_OUTPUT.members["importedModelArn"], - self.imported_model_arn, - ) - - if self.role_arn is not None: - serializer.write_string( - _SCHEMA_GET_MODEL_IMPORT_JOB_OUTPUT.members["roleArn"], self.role_arn - ) - - if self.model_data_source is not None: - serializer.write_struct( - _SCHEMA_GET_MODEL_IMPORT_JOB_OUTPUT.members["modelDataSource"], - self.model_data_source, - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_GET_MODEL_IMPORT_JOB_OUTPUT.members["status"], self.status - ) - - if self.failure_message is not None: - serializer.write_string( - _SCHEMA_GET_MODEL_IMPORT_JOB_OUTPUT.members["failureMessage"], - self.failure_message, - ) - - if self.creation_time is not None: - serializer.write_timestamp( - _SCHEMA_GET_MODEL_IMPORT_JOB_OUTPUT.members["creationTime"], - self.creation_time, - ) - - if self.last_modified_time is not None: - serializer.write_timestamp( - _SCHEMA_GET_MODEL_IMPORT_JOB_OUTPUT.members["lastModifiedTime"], - self.last_modified_time, - ) - - if self.end_time is not None: - serializer.write_timestamp( - _SCHEMA_GET_MODEL_IMPORT_JOB_OUTPUT.members["endTime"], self.end_time - ) - - if self.vpc_config is not None: - serializer.write_struct( - _SCHEMA_GET_MODEL_IMPORT_JOB_OUTPUT.members["vpcConfig"], - self.vpc_config, - ) - - if self.imported_model_kms_key_arn is not None: - serializer.write_string( - _SCHEMA_GET_MODEL_IMPORT_JOB_OUTPUT.members["importedModelKmsKeyArn"], - self.imported_model_kms_key_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["job_arn"] = de.read_string( - _SCHEMA_GET_MODEL_IMPORT_JOB_OUTPUT.members["jobArn"] - ) - - case 1: - kwargs["job_name"] = de.read_string( - _SCHEMA_GET_MODEL_IMPORT_JOB_OUTPUT.members["jobName"] - ) - - case 2: - kwargs["imported_model_name"] = de.read_string( - _SCHEMA_GET_MODEL_IMPORT_JOB_OUTPUT.members["importedModelName"] - ) - - case 3: - kwargs["imported_model_arn"] = de.read_string( - _SCHEMA_GET_MODEL_IMPORT_JOB_OUTPUT.members["importedModelArn"] - ) - - case 4: - kwargs["role_arn"] = de.read_string( - _SCHEMA_GET_MODEL_IMPORT_JOB_OUTPUT.members["roleArn"] - ) - - case 5: - kwargs["model_data_source"] = ( - _ModelDataSourceDeserializer().deserialize(de) - ) - - case 6: - kwargs["status"] = ModelImportJobStatus( - de.read_string( - _SCHEMA_GET_MODEL_IMPORT_JOB_OUTPUT.members["status"] - ) - ) - - case 7: - kwargs["failure_message"] = de.read_string( - _SCHEMA_GET_MODEL_IMPORT_JOB_OUTPUT.members["failureMessage"] - ) - - case 8: - kwargs["creation_time"] = de.read_timestamp( - _SCHEMA_GET_MODEL_IMPORT_JOB_OUTPUT.members["creationTime"] - ) - - case 9: - kwargs["last_modified_time"] = de.read_timestamp( - _SCHEMA_GET_MODEL_IMPORT_JOB_OUTPUT.members["lastModifiedTime"] - ) - - case 10: - kwargs["end_time"] = de.read_timestamp( - _SCHEMA_GET_MODEL_IMPORT_JOB_OUTPUT.members["endTime"] - ) - - case 11: - kwargs["vpc_config"] = VpcConfig.deserialize(de) - - case 12: - kwargs["imported_model_kms_key_arn"] = de.read_string( - _SCHEMA_GET_MODEL_IMPORT_JOB_OUTPUT.members[ - "importedModelKmsKeyArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_MODEL_IMPORT_JOB_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_MODEL_IMPORT_JOB = APIOperation( - input=GetModelImportJobInput, - output=GetModelImportJobOutput, - schema=_SCHEMA_GET_MODEL_IMPORT_JOB, - input_schema=_SCHEMA_GET_MODEL_IMPORT_JOB_INPUT, - output_schema=_SCHEMA_GET_MODEL_IMPORT_JOB_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListImportedModelsInput: - """Dataclass for ListImportedModelsInput structure.""" - - creation_time_before: datetime | None = None - """Return imported models that created before the specified time.""" - - creation_time_after: datetime | None = None - """Return imported models that were created after the specified time.""" - - name_contains: str | None = None - """Return imported models only if the model name contains these characters.""" - - max_results: int | None = None - """ - The maximum number of results to return in the response. If the total - number of results is greater than this value, use the token returned in - the response in the `nextToken` field when making another request to - return the next batch of results. - """ - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, enter the token returned in the `nextToken` - field in the response in this field to return the next batch of results. - """ - - sort_by: str | None = None - """The field to sort by in the returned list of imported models.""" - - sort_order: str | None = None - """Specifies whetehr to sort the results in ascending or descending order.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_IMPORTED_MODELS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.creation_time_before is not None: - serializer.write_timestamp( - _SCHEMA_LIST_IMPORTED_MODELS_INPUT.members["creationTimeBefore"], - self.creation_time_before, - ) - - if self.creation_time_after is not None: - serializer.write_timestamp( - _SCHEMA_LIST_IMPORTED_MODELS_INPUT.members["creationTimeAfter"], - self.creation_time_after, - ) - - if self.name_contains is not None: - serializer.write_string( - _SCHEMA_LIST_IMPORTED_MODELS_INPUT.members["nameContains"], - self.name_contains, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_IMPORTED_MODELS_INPUT.members["maxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_IMPORTED_MODELS_INPUT.members["nextToken"], self.next_token - ) - - if self.sort_by is not None: - serializer.write_string( - _SCHEMA_LIST_IMPORTED_MODELS_INPUT.members["sortBy"], self.sort_by - ) - - if self.sort_order is not None: - serializer.write_string( - _SCHEMA_LIST_IMPORTED_MODELS_INPUT.members["sortOrder"], self.sort_order - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["creation_time_before"] = de.read_timestamp( - _SCHEMA_LIST_IMPORTED_MODELS_INPUT.members["creationTimeBefore"] - ) - - case 1: - kwargs["creation_time_after"] = de.read_timestamp( - _SCHEMA_LIST_IMPORTED_MODELS_INPUT.members["creationTimeAfter"] - ) - - case 2: - kwargs["name_contains"] = de.read_string( - _SCHEMA_LIST_IMPORTED_MODELS_INPUT.members["nameContains"] - ) - - case 3: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_IMPORTED_MODELS_INPUT.members["maxResults"] - ) - - case 4: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_IMPORTED_MODELS_INPUT.members["nextToken"] - ) - - case 5: - kwargs["sort_by"] = SortModelsBy( - de.read_string( - _SCHEMA_LIST_IMPORTED_MODELS_INPUT.members["sortBy"] - ) - ) - - case 6: - kwargs["sort_order"] = SortOrder( - de.read_string( - _SCHEMA_LIST_IMPORTED_MODELS_INPUT.members["sortOrder"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_IMPORTED_MODELS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ImportedModelSummary: - """Information about the imported model.""" - - model_arn: str - """The Amazon Resource Name (ARN) of the imported model.""" - - model_name: str - """Name of the imported model.""" - - creation_time: datetime - """Creation time of the imported model.""" - - instruct_supported: bool | None = None - """Specifies if the imported model supports converse.""" - - model_architecture: str | None = None - """The architecture of the imported model.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IMPORTED_MODEL_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_IMPORTED_MODEL_SUMMARY.members["modelArn"], self.model_arn - ) - serializer.write_string( - _SCHEMA_IMPORTED_MODEL_SUMMARY.members["modelName"], self.model_name - ) - serializer.write_timestamp( - _SCHEMA_IMPORTED_MODEL_SUMMARY.members["creationTime"], self.creation_time - ) - if self.instruct_supported is not None: - serializer.write_boolean( - _SCHEMA_IMPORTED_MODEL_SUMMARY.members["instructSupported"], - self.instruct_supported, - ) - - if self.model_architecture is not None: - serializer.write_string( - _SCHEMA_IMPORTED_MODEL_SUMMARY.members["modelArchitecture"], - self.model_architecture, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_arn"] = de.read_string( - _SCHEMA_IMPORTED_MODEL_SUMMARY.members["modelArn"] - ) - - case 1: - kwargs["model_name"] = de.read_string( - _SCHEMA_IMPORTED_MODEL_SUMMARY.members["modelName"] - ) - - case 2: - kwargs["creation_time"] = de.read_timestamp( - _SCHEMA_IMPORTED_MODEL_SUMMARY.members["creationTime"] - ) - - case 3: - kwargs["instruct_supported"] = de.read_boolean( - _SCHEMA_IMPORTED_MODEL_SUMMARY.members["instructSupported"] - ) - - case 4: - kwargs["model_architecture"] = de.read_string( - _SCHEMA_IMPORTED_MODEL_SUMMARY.members["modelArchitecture"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_IMPORTED_MODEL_SUMMARY, consumer=_consumer) - if "model_arn" not in kwargs: - kwargs["model_arn"] = "" - if "model_name" not in kwargs: - kwargs["model_name"] = "" - if "creation_time" not in kwargs: - kwargs["creation_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_imported_model_summary_list( - serializer: ShapeSerializer, schema: Schema, value: list[ImportedModelSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_imported_model_summary_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ImportedModelSummary]: - result: list[ImportedModelSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ImportedModelSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListImportedModelsOutput: - """Dataclass for ListImportedModelsOutput structure.""" - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, use this token when making another request in - the `nextToken` field to return the next batch of results. - """ - - model_summaries: list[ImportedModelSummary] | None = None - """Model summaries.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_IMPORTED_MODELS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_IMPORTED_MODELS_OUTPUT.members["nextToken"], - self.next_token, - ) - - if self.model_summaries is not None: - _serialize_imported_model_summary_list( - serializer, - _SCHEMA_LIST_IMPORTED_MODELS_OUTPUT.members["modelSummaries"], - self.model_summaries, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_IMPORTED_MODELS_OUTPUT.members["nextToken"] - ) - - case 1: - kwargs["model_summaries"] = ( - _deserialize_imported_model_summary_list( - de, - _SCHEMA_LIST_IMPORTED_MODELS_OUTPUT.members[ - "modelSummaries" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_IMPORTED_MODELS_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_IMPORTED_MODELS = APIOperation( - input=ListImportedModelsInput, - output=ListImportedModelsOutput, - schema=_SCHEMA_LIST_IMPORTED_MODELS, - input_schema=_SCHEMA_LIST_IMPORTED_MODELS_INPUT, - output_schema=_SCHEMA_LIST_IMPORTED_MODELS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListModelImportJobsInput: - """Dataclass for ListModelImportJobsInput structure.""" - - creation_time_after: datetime | None = None - """Return import jobs that were created after the specified time.""" - - creation_time_before: datetime | None = None - """Return import jobs that were created before the specified time.""" - - status_equals: str | None = None - """Return imported jobs with the specified status.""" - - name_contains: str | None = None - """Return imported jobs only if the job name contains these characters.""" - - max_results: int | None = None - """ - The maximum number of results to return in the response. If the total - number of results is greater than this value, use the token returned in - the response in the `nextToken` field when making another request to - return the next batch of results. - """ - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, enter the token returned in the `nextToken` - field in the response in this field to return the next batch of results. - """ - - sort_by: str | None = None - """The field to sort by in the returned list of imported jobs.""" - - sort_order: str | None = None - """Specifies whether to sort the results in ascending or descending order.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_MODEL_IMPORT_JOBS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.creation_time_after is not None: - serializer.write_timestamp( - _SCHEMA_LIST_MODEL_IMPORT_JOBS_INPUT.members["creationTimeAfter"], - self.creation_time_after, - ) - - if self.creation_time_before is not None: - serializer.write_timestamp( - _SCHEMA_LIST_MODEL_IMPORT_JOBS_INPUT.members["creationTimeBefore"], - self.creation_time_before, - ) - - if self.status_equals is not None: - serializer.write_string( - _SCHEMA_LIST_MODEL_IMPORT_JOBS_INPUT.members["statusEquals"], - self.status_equals, - ) - - if self.name_contains is not None: - serializer.write_string( - _SCHEMA_LIST_MODEL_IMPORT_JOBS_INPUT.members["nameContains"], - self.name_contains, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_MODEL_IMPORT_JOBS_INPUT.members["maxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_MODEL_IMPORT_JOBS_INPUT.members["nextToken"], - self.next_token, - ) - - if self.sort_by is not None: - serializer.write_string( - _SCHEMA_LIST_MODEL_IMPORT_JOBS_INPUT.members["sortBy"], self.sort_by - ) - - if self.sort_order is not None: - serializer.write_string( - _SCHEMA_LIST_MODEL_IMPORT_JOBS_INPUT.members["sortOrder"], - self.sort_order, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["creation_time_after"] = de.read_timestamp( - _SCHEMA_LIST_MODEL_IMPORT_JOBS_INPUT.members[ - "creationTimeAfter" - ] - ) - - case 1: - kwargs["creation_time_before"] = de.read_timestamp( - _SCHEMA_LIST_MODEL_IMPORT_JOBS_INPUT.members[ - "creationTimeBefore" - ] - ) - - case 2: - kwargs["status_equals"] = ModelImportJobStatus( - de.read_string( - _SCHEMA_LIST_MODEL_IMPORT_JOBS_INPUT.members["statusEquals"] - ) - ) - - case 3: - kwargs["name_contains"] = de.read_string( - _SCHEMA_LIST_MODEL_IMPORT_JOBS_INPUT.members["nameContains"] - ) - - case 4: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_MODEL_IMPORT_JOBS_INPUT.members["maxResults"] - ) - - case 5: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_MODEL_IMPORT_JOBS_INPUT.members["nextToken"] - ) - - case 6: - kwargs["sort_by"] = SortJobsBy( - de.read_string( - _SCHEMA_LIST_MODEL_IMPORT_JOBS_INPUT.members["sortBy"] - ) - ) - - case 7: - kwargs["sort_order"] = SortOrder( - de.read_string( - _SCHEMA_LIST_MODEL_IMPORT_JOBS_INPUT.members["sortOrder"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_MODEL_IMPORT_JOBS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ModelImportJobSummary: - """Information about the import job.""" - - job_arn: str - """The Amazon Resource Name (ARN) of the import job.""" - - job_name: str - """The name of the import job.""" - - status: str - """The status of the imported job.""" - - creation_time: datetime - """The time import job was created.""" - - last_modified_time: datetime | None = None - """The time when the import job was last modified.""" - - end_time: datetime | None = None - """The time when import job ended.""" - - imported_model_arn: str | None = None - """The Amazon resource Name (ARN) of the imported model.""" - - imported_model_name: str | None = None - """The name of the imported model.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MODEL_IMPORT_JOB_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MODEL_IMPORT_JOB_SUMMARY.members["jobArn"], self.job_arn - ) - serializer.write_string( - _SCHEMA_MODEL_IMPORT_JOB_SUMMARY.members["jobName"], self.job_name - ) - serializer.write_string( - _SCHEMA_MODEL_IMPORT_JOB_SUMMARY.members["status"], self.status - ) - if self.last_modified_time is not None: - serializer.write_timestamp( - _SCHEMA_MODEL_IMPORT_JOB_SUMMARY.members["lastModifiedTime"], - self.last_modified_time, - ) - - serializer.write_timestamp( - _SCHEMA_MODEL_IMPORT_JOB_SUMMARY.members["creationTime"], self.creation_time - ) - if self.end_time is not None: - serializer.write_timestamp( - _SCHEMA_MODEL_IMPORT_JOB_SUMMARY.members["endTime"], self.end_time - ) - - if self.imported_model_arn is not None: - serializer.write_string( - _SCHEMA_MODEL_IMPORT_JOB_SUMMARY.members["importedModelArn"], - self.imported_model_arn, - ) - - if self.imported_model_name is not None: - serializer.write_string( - _SCHEMA_MODEL_IMPORT_JOB_SUMMARY.members["importedModelName"], - self.imported_model_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["job_arn"] = de.read_string( - _SCHEMA_MODEL_IMPORT_JOB_SUMMARY.members["jobArn"] - ) - - case 1: - kwargs["job_name"] = de.read_string( - _SCHEMA_MODEL_IMPORT_JOB_SUMMARY.members["jobName"] - ) - - case 2: - kwargs["status"] = ModelImportJobStatus( - de.read_string( - _SCHEMA_MODEL_IMPORT_JOB_SUMMARY.members["status"] - ) - ) - - case 3: - kwargs["last_modified_time"] = de.read_timestamp( - _SCHEMA_MODEL_IMPORT_JOB_SUMMARY.members["lastModifiedTime"] - ) - - case 4: - kwargs["creation_time"] = de.read_timestamp( - _SCHEMA_MODEL_IMPORT_JOB_SUMMARY.members["creationTime"] - ) - - case 5: - kwargs["end_time"] = de.read_timestamp( - _SCHEMA_MODEL_IMPORT_JOB_SUMMARY.members["endTime"] - ) - - case 6: - kwargs["imported_model_arn"] = de.read_string( - _SCHEMA_MODEL_IMPORT_JOB_SUMMARY.members["importedModelArn"] - ) - - case 7: - kwargs["imported_model_name"] = de.read_string( - _SCHEMA_MODEL_IMPORT_JOB_SUMMARY.members["importedModelName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MODEL_IMPORT_JOB_SUMMARY, consumer=_consumer) - if "job_arn" not in kwargs: - kwargs["job_arn"] = "" - if "job_name" not in kwargs: - kwargs["job_name"] = "" - if "status" not in kwargs: - kwargs["status"] = ModelImportJobStatus._corrected("") - if "creation_time" not in kwargs: - kwargs["creation_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_model_import_job_summaries( - serializer: ShapeSerializer, schema: Schema, value: list[ModelImportJobSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_model_import_job_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ModelImportJobSummary]: - result: list[ModelImportJobSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ModelImportJobSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListModelImportJobsOutput: - """Dataclass for ListModelImportJobsOutput structure.""" - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, enter the token returned in the `nextToken` - field in the response in this field to return the next batch of results. - """ - - model_import_job_summaries: list[ModelImportJobSummary] | None = None - """Import job summaries.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_MODEL_IMPORT_JOBS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_MODEL_IMPORT_JOBS_OUTPUT.members["nextToken"], - self.next_token, - ) - - if self.model_import_job_summaries is not None: - _serialize_model_import_job_summaries( - serializer, - _SCHEMA_LIST_MODEL_IMPORT_JOBS_OUTPUT.members[ - "modelImportJobSummaries" - ], - self.model_import_job_summaries, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_MODEL_IMPORT_JOBS_OUTPUT.members["nextToken"] - ) - - case 1: - kwargs["model_import_job_summaries"] = ( - _deserialize_model_import_job_summaries( - de, - _SCHEMA_LIST_MODEL_IMPORT_JOBS_OUTPUT.members[ - "modelImportJobSummaries" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_MODEL_IMPORT_JOBS_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_MODEL_IMPORT_JOBS = APIOperation( - input=ListModelImportJobsInput, - output=ListModelImportJobsOutput, - schema=_SCHEMA_LIST_MODEL_IMPORT_JOBS, - input_schema=_SCHEMA_LIST_MODEL_IMPORT_JOBS_INPUT, - output_schema=_SCHEMA_LIST_MODEL_IMPORT_JOBS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class S3InputFormat(UnknownEnumMixin, StrEnum): - JSONL = "JSONL" - - -@dataclass(kw_only=True) -class ModelInvocationJobS3InputDataConfig: - """Contains the configuration of the S3 location of the input data.""" - - s3_uri: str - """The S3 location of the input data.""" - - s3_input_format: str | None = None - """The format of the input data.""" - - s3_bucket_owner: str | None = None - """ - The ID of the Amazon Web Services account that owns the S3 bucket - containing the input data. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MODEL_INVOCATION_JOB_S3_INPUT_DATA_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.s3_input_format is not None: - serializer.write_string( - _SCHEMA_MODEL_INVOCATION_JOB_S3_INPUT_DATA_CONFIG.members[ - "s3InputFormat" - ], - self.s3_input_format, - ) - - serializer.write_string( - _SCHEMA_MODEL_INVOCATION_JOB_S3_INPUT_DATA_CONFIG.members["s3Uri"], - self.s3_uri, - ) - if self.s3_bucket_owner is not None: - serializer.write_string( - _SCHEMA_MODEL_INVOCATION_JOB_S3_INPUT_DATA_CONFIG.members[ - "s3BucketOwner" - ], - self.s3_bucket_owner, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["s3_input_format"] = S3InputFormat( - de.read_string( - _SCHEMA_MODEL_INVOCATION_JOB_S3_INPUT_DATA_CONFIG.members[ - "s3InputFormat" - ] - ) - ) - - case 1: - kwargs["s3_uri"] = de.read_string( - _SCHEMA_MODEL_INVOCATION_JOB_S3_INPUT_DATA_CONFIG.members[ - "s3Uri" - ] - ) - - case 2: - kwargs["s3_bucket_owner"] = de.read_string( - _SCHEMA_MODEL_INVOCATION_JOB_S3_INPUT_DATA_CONFIG.members[ - "s3BucketOwner" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MODEL_INVOCATION_JOB_S3_INPUT_DATA_CONFIG, consumer=_consumer - ) - if "s3_uri" not in kwargs: - kwargs["s3_uri"] = "" - return kwargs - - -@dataclass -class ModelInvocationJobInputDataConfigS3InputDataConfig: - """Contains the configuration of the S3 location of the input data.""" - - value: ModelInvocationJobS3InputDataConfig - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MODEL_INVOCATION_JOB_INPUT_DATA_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MODEL_INVOCATION_JOB_INPUT_DATA_CONFIG.members["s3InputDataConfig"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ModelInvocationJobS3InputDataConfig.deserialize(deserializer)) - - -@dataclass -class ModelInvocationJobInputDataConfigUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ModelInvocationJobInputDataConfig = Union[ - ModelInvocationJobInputDataConfigS3InputDataConfig - | ModelInvocationJobInputDataConfigUnknown -] -"""Details about the location of the input to the batch inference job.""" - - -class _ModelInvocationJobInputDataConfigDeserializer: - _result: ModelInvocationJobInputDataConfig | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> ModelInvocationJobInputDataConfig: - self._result = None - deserializer.read_struct( - _SCHEMA_MODEL_INVOCATION_JOB_INPUT_DATA_CONFIG, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - ModelInvocationJobInputDataConfigS3InputDataConfig.deserialize(de) - ) - - case _: - self._set_result( - ModelInvocationJobInputDataConfigUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: ModelInvocationJobInputDataConfig) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class ModelInvocationType(UnknownEnumMixin, StrEnum): - INVOKE_MODEL = "InvokeModel" - CONVERSE = "Converse" - - -@dataclass(kw_only=True) -class ModelInvocationJobS3OutputDataConfig: - """Contains the configuration of the S3 location of the output data.""" - - s3_uri: str - """The S3 location of the output data.""" - - s3_encryption_key_id: str | None = None - """ - The unique identifier of the key that encrypts the S3 location of the - output data. - """ - - s3_bucket_owner: str | None = None - """ - The ID of the Amazon Web Services account that owns the S3 bucket - containing the output data. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MODEL_INVOCATION_JOB_S3_OUTPUT_DATA_CONFIG, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MODEL_INVOCATION_JOB_S3_OUTPUT_DATA_CONFIG.members["s3Uri"], - self.s3_uri, - ) - if self.s3_encryption_key_id is not None: - serializer.write_string( - _SCHEMA_MODEL_INVOCATION_JOB_S3_OUTPUT_DATA_CONFIG.members[ - "s3EncryptionKeyId" - ], - self.s3_encryption_key_id, - ) - - if self.s3_bucket_owner is not None: - serializer.write_string( - _SCHEMA_MODEL_INVOCATION_JOB_S3_OUTPUT_DATA_CONFIG.members[ - "s3BucketOwner" - ], - self.s3_bucket_owner, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["s3_uri"] = de.read_string( - _SCHEMA_MODEL_INVOCATION_JOB_S3_OUTPUT_DATA_CONFIG.members[ - "s3Uri" - ] - ) - - case 1: - kwargs["s3_encryption_key_id"] = de.read_string( - _SCHEMA_MODEL_INVOCATION_JOB_S3_OUTPUT_DATA_CONFIG.members[ - "s3EncryptionKeyId" - ] - ) - - case 2: - kwargs["s3_bucket_owner"] = de.read_string( - _SCHEMA_MODEL_INVOCATION_JOB_S3_OUTPUT_DATA_CONFIG.members[ - "s3BucketOwner" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MODEL_INVOCATION_JOB_S3_OUTPUT_DATA_CONFIG, consumer=_consumer - ) - if "s3_uri" not in kwargs: - kwargs["s3_uri"] = "" - return kwargs - - -@dataclass -class ModelInvocationJobOutputDataConfigS3OutputDataConfig: - """Contains the configuration of the S3 location of the output data.""" - - value: ModelInvocationJobS3OutputDataConfig - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MODEL_INVOCATION_JOB_OUTPUT_DATA_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MODEL_INVOCATION_JOB_OUTPUT_DATA_CONFIG.members[ - "s3OutputDataConfig" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ModelInvocationJobS3OutputDataConfig.deserialize(deserializer)) - - -@dataclass -class ModelInvocationJobOutputDataConfigUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ModelInvocationJobOutputDataConfig = Union[ - ModelInvocationJobOutputDataConfigS3OutputDataConfig - | ModelInvocationJobOutputDataConfigUnknown -] -"""Contains the configuration of the S3 location of the output data.""" - - -class _ModelInvocationJobOutputDataConfigDeserializer: - _result: ModelInvocationJobOutputDataConfig | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> ModelInvocationJobOutputDataConfig: - self._result = None - deserializer.read_struct( - _SCHEMA_MODEL_INVOCATION_JOB_OUTPUT_DATA_CONFIG, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - ModelInvocationJobOutputDataConfigS3OutputDataConfig.deserialize(de) - ) - - case _: - self._set_result( - ModelInvocationJobOutputDataConfigUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: ModelInvocationJobOutputDataConfig) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class CreateModelInvocationJobInput: - """Dataclass for CreateModelInvocationJobInput structure.""" - - job_name: str | None = None - """A name to give the batch inference job.""" - - role_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the service role with permissions to - carry out and manage batch inference. You can use the console to create - a default service role or follow the steps at [Create a service role for - batch - inference](https://docs.aws.amazon.com/bedrock/latest/userguide/batch-iam-sr.html). - """ - - client_request_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If this token matches a previous - request, Amazon Bedrock ignores the request, but does not return an - error. For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - model_id: str | None = None - """ - The unique identifier of the foundation model to use for the batch - inference job. - """ - - input_data_config: ModelInvocationJobInputDataConfig | None = None - """Details about the location of the input to the batch inference job.""" - - output_data_config: ModelInvocationJobOutputDataConfig | None = None - """Details about the location of the output of the batch inference job.""" - - vpc_config: VpcConfig | None = None - """ - The configuration of the Virtual Private Cloud (VPC) for the data in the - batch inference job. For more information, see [Protect batch inference - jobs using a - VPC](https://docs.aws.amazon.com/bedrock/latest/userguide/batch-vpc). - """ - - timeout_duration_in_hours: int | None = None - """ - The number of hours after which to force the batch inference job to time - out. - """ - - tags: list[Tag] | None = None - """ - Any tags to associate with the batch inference job. For more - information, see [Tagging Amazon Bedrock - resources](https://docs.aws.amazon.com/bedrock/latest/userguide/tagging.html). - """ - - model_invocation_type: str = ModelInvocationType("InvokeModel") - """The invocation endpoint for ModelInvocationJob""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_MODEL_INVOCATION_JOB_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.job_name is not None: - serializer.write_string( - _SCHEMA_CREATE_MODEL_INVOCATION_JOB_INPUT.members["jobName"], - self.job_name, - ) - - if self.role_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_MODEL_INVOCATION_JOB_INPUT.members["roleArn"], - self.role_arn, - ) - - if self.client_request_token is not None: - serializer.write_string( - _SCHEMA_CREATE_MODEL_INVOCATION_JOB_INPUT.members["clientRequestToken"], - self.client_request_token, - ) - - if self.model_id is not None: - serializer.write_string( - _SCHEMA_CREATE_MODEL_INVOCATION_JOB_INPUT.members["modelId"], - self.model_id, - ) - - if self.input_data_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_MODEL_INVOCATION_JOB_INPUT.members["inputDataConfig"], - self.input_data_config, - ) - - if self.output_data_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_MODEL_INVOCATION_JOB_INPUT.members["outputDataConfig"], - self.output_data_config, - ) - - if self.vpc_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_MODEL_INVOCATION_JOB_INPUT.members["vpcConfig"], - self.vpc_config, - ) - - if self.timeout_duration_in_hours is not None: - serializer.write_integer( - _SCHEMA_CREATE_MODEL_INVOCATION_JOB_INPUT.members[ - "timeoutDurationInHours" - ], - self.timeout_duration_in_hours, - ) - - if self.tags is not None: - _serialize_tag_list( - serializer, - _SCHEMA_CREATE_MODEL_INVOCATION_JOB_INPUT.members["tags"], - self.tags, - ) - - if self.model_invocation_type is not None: - serializer.write_string( - _SCHEMA_CREATE_MODEL_INVOCATION_JOB_INPUT.members[ - "modelInvocationType" - ], - self.model_invocation_type, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["job_name"] = de.read_string( - _SCHEMA_CREATE_MODEL_INVOCATION_JOB_INPUT.members["jobName"] - ) - - case 1: - kwargs["role_arn"] = de.read_string( - _SCHEMA_CREATE_MODEL_INVOCATION_JOB_INPUT.members["roleArn"] - ) - - case 2: - kwargs["client_request_token"] = de.read_string( - _SCHEMA_CREATE_MODEL_INVOCATION_JOB_INPUT.members[ - "clientRequestToken" - ] - ) - - case 3: - kwargs["model_id"] = de.read_string( - _SCHEMA_CREATE_MODEL_INVOCATION_JOB_INPUT.members["modelId"] - ) - - case 4: - kwargs["input_data_config"] = ( - _ModelInvocationJobInputDataConfigDeserializer().deserialize(de) - ) - - case 5: - kwargs["output_data_config"] = ( - _ModelInvocationJobOutputDataConfigDeserializer().deserialize( - de - ) - ) - - case 6: - kwargs["vpc_config"] = VpcConfig.deserialize(de) - - case 7: - kwargs["timeout_duration_in_hours"] = de.read_integer( - _SCHEMA_CREATE_MODEL_INVOCATION_JOB_INPUT.members[ - "timeoutDurationInHours" - ] - ) - - case 8: - kwargs["tags"] = _deserialize_tag_list( - de, _SCHEMA_CREATE_MODEL_INVOCATION_JOB_INPUT.members["tags"] - ) - - case 9: - kwargs["model_invocation_type"] = ModelInvocationType( - de.read_string( - _SCHEMA_CREATE_MODEL_INVOCATION_JOB_INPUT.members[ - "modelInvocationType" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_MODEL_INVOCATION_JOB_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CreateModelInvocationJobOutput: - """Dataclass for CreateModelInvocationJobOutput structure.""" - - job_arn: str - """The Amazon Resource Name (ARN) of the batch inference job.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_MODEL_INVOCATION_JOB_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_MODEL_INVOCATION_JOB_OUTPUT.members["jobArn"], self.job_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["job_arn"] = de.read_string( - _SCHEMA_CREATE_MODEL_INVOCATION_JOB_OUTPUT.members["jobArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_MODEL_INVOCATION_JOB_OUTPUT, consumer=_consumer - ) - if "job_arn" not in kwargs: - kwargs["job_arn"] = "" - return kwargs - - -CREATE_MODEL_INVOCATION_JOB = APIOperation( - input=CreateModelInvocationJobInput, - output=CreateModelInvocationJobOutput, - schema=_SCHEMA_CREATE_MODEL_INVOCATION_JOB, - input_schema=_SCHEMA_CREATE_MODEL_INVOCATION_JOB_INPUT, - output_schema=_SCHEMA_CREATE_MODEL_INVOCATION_JOB_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrock#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrock#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetModelInvocationJobInput: - """Dataclass for GetModelInvocationJobInput structure.""" - - job_identifier: str | None = None - """The Amazon Resource Name (ARN) of the batch inference job.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_MODEL_INVOCATION_JOB_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.job_identifier is not None: - serializer.write_string( - _SCHEMA_GET_MODEL_INVOCATION_JOB_INPUT.members["jobIdentifier"], - self.job_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["job_identifier"] = de.read_string( - _SCHEMA_GET_MODEL_INVOCATION_JOB_INPUT.members["jobIdentifier"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_MODEL_INVOCATION_JOB_INPUT, consumer=_consumer - ) - return kwargs - - -class ModelInvocationJobStatus(UnknownEnumMixin, StrEnum): - SUBMITTED = "Submitted" - IN_PROGRESS = "InProgress" - COMPLETED = "Completed" - FAILED = "Failed" - STOPPING = "Stopping" - STOPPED = "Stopped" - PARTIALLY_COMPLETED = "PartiallyCompleted" - EXPIRED = "Expired" - VALIDATING = "Validating" - SCHEDULED = "Scheduled" - - -@dataclass(kw_only=True) -class GetModelInvocationJobOutput: - """Dataclass for GetModelInvocationJobOutput structure.""" - - job_arn: str - """The Amazon Resource Name (ARN) of the batch inference job.""" - - model_id: str - """The unique identifier of the foundation model used for model inference.""" - - role_arn: str - """ - The Amazon Resource Name (ARN) of the service role with permissions to - carry out and manage batch inference. You can use the console to create - a default service role or follow the steps at [Create a service role for - batch - inference](https://docs.aws.amazon.com/bedrock/latest/userguide/batch-iam-sr.html). - """ - - submit_time: datetime - """The time at which the batch inference job was submitted.""" - - input_data_config: ModelInvocationJobInputDataConfig - """Details about the location of the input to the batch inference job.""" - - output_data_config: ModelInvocationJobOutputDataConfig - """Details about the location of the output of the batch inference job.""" - - job_name: str | None = None - """The name of the batch inference job.""" - - client_request_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If this token matches a previous - request, Amazon Bedrock ignores the request, but does not return an - error. For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - status: str | None = None - """ - The status of the batch inference job. - - The following statuses are possible: - - - Submitted -- This job has been submitted to a queue for validation. - - - Validating -- This job is being validated for the requirements - described in [Format and upload your batch inference - data](https://docs.aws.amazon.com/bedrock/latest/userguide/batch-inference-data.html). - The criteria include the following: - - - Your IAM service role has access to the Amazon S3 buckets containing - your files. - - - Your files are .jsonl files and each individual record is a JSON - object in the correct format. Note that validation doesn't check if - the `modelInput` value matches the request body for the model. - - - Your files fulfill the requirements for file size and number of - records. For more information, see [Quotas for Amazon - Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/quotas.html). - - - Scheduled -- This job has been validated and is now in a queue. The - job will automatically start when it reaches its turn. - - - Expired -- This job timed out because it was scheduled but didn't - begin before the set timeout duration. Submit a new job request. - - - InProgress -- This job has begun. You can start viewing the results in - the output S3 location. - - - Completed -- This job has successfully completed. View the output - files in the output S3 location. - - - PartiallyCompleted -- This job has partially completed. Not all of - your records could be processed in time. View the output files in the - output S3 location. - - - Failed -- This job has failed. Check the failure message for any - further details. For further assistance, reach out to the [Amazon Web - Services Support - Center](https://console.aws.amazon.com/support/home/). - - - Stopped -- This job was stopped by a user. - - - Stopping -- This job is being stopped by a user. - """ - - message: str | None = field(repr=False, default=None) - """ - If the batch inference job failed, this field contains a message - describing why the job failed. - """ - - last_modified_time: datetime | None = None - """The time at which the batch inference job was last modified.""" - - end_time: datetime | None = None - """The time at which the batch inference job ended.""" - - vpc_config: VpcConfig | None = None - """ - The configuration of the Virtual Private Cloud (VPC) for the data in the - batch inference job. For more information, see [Protect batch inference - jobs using a - VPC](https://docs.aws.amazon.com/bedrock/latest/userguide/batch-vpc). - """ - - timeout_duration_in_hours: int | None = None - """The number of hours after which batch inference job was set to time out.""" - - job_expiration_time: datetime | None = None - """The time at which the batch inference job times or timed out.""" - - model_invocation_type: str | None = None - """The invocation endpoint for ModelInvocationJob""" - - total_record_count: int | None = None - """The total number of records in the batch inference job.""" - - processed_record_count: int | None = None - """ - The number of records that have been processed in the batch inference - job. - """ - - success_record_count: int | None = None - """ - The number of records that were successfully processed in the batch - inference job. - """ - - error_record_count: int | None = None - """The number of records that failed to process in the batch inference job.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_MODEL_INVOCATION_JOB_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_MODEL_INVOCATION_JOB_OUTPUT.members["jobArn"], self.job_arn - ) - if self.job_name is not None: - serializer.write_string( - _SCHEMA_GET_MODEL_INVOCATION_JOB_OUTPUT.members["jobName"], - self.job_name, - ) - - serializer.write_string( - _SCHEMA_GET_MODEL_INVOCATION_JOB_OUTPUT.members["modelId"], self.model_id - ) - if self.client_request_token is not None: - serializer.write_string( - _SCHEMA_GET_MODEL_INVOCATION_JOB_OUTPUT.members["clientRequestToken"], - self.client_request_token, - ) - - serializer.write_string( - _SCHEMA_GET_MODEL_INVOCATION_JOB_OUTPUT.members["roleArn"], self.role_arn - ) - if self.status is not None: - serializer.write_string( - _SCHEMA_GET_MODEL_INVOCATION_JOB_OUTPUT.members["status"], self.status - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_GET_MODEL_INVOCATION_JOB_OUTPUT.members["message"], self.message - ) - - serializer.write_timestamp( - _SCHEMA_GET_MODEL_INVOCATION_JOB_OUTPUT.members["submitTime"], - self.submit_time, - ) - if self.last_modified_time is not None: - serializer.write_timestamp( - _SCHEMA_GET_MODEL_INVOCATION_JOB_OUTPUT.members["lastModifiedTime"], - self.last_modified_time, - ) - - if self.end_time is not None: - serializer.write_timestamp( - _SCHEMA_GET_MODEL_INVOCATION_JOB_OUTPUT.members["endTime"], - self.end_time, - ) - - serializer.write_struct( - _SCHEMA_GET_MODEL_INVOCATION_JOB_OUTPUT.members["inputDataConfig"], - self.input_data_config, - ) - serializer.write_struct( - _SCHEMA_GET_MODEL_INVOCATION_JOB_OUTPUT.members["outputDataConfig"], - self.output_data_config, - ) - if self.vpc_config is not None: - serializer.write_struct( - _SCHEMA_GET_MODEL_INVOCATION_JOB_OUTPUT.members["vpcConfig"], - self.vpc_config, - ) - - if self.timeout_duration_in_hours is not None: - serializer.write_integer( - _SCHEMA_GET_MODEL_INVOCATION_JOB_OUTPUT.members[ - "timeoutDurationInHours" - ], - self.timeout_duration_in_hours, - ) - - if self.job_expiration_time is not None: - serializer.write_timestamp( - _SCHEMA_GET_MODEL_INVOCATION_JOB_OUTPUT.members["jobExpirationTime"], - self.job_expiration_time, - ) - - if self.model_invocation_type is not None: - serializer.write_string( - _SCHEMA_GET_MODEL_INVOCATION_JOB_OUTPUT.members["modelInvocationType"], - self.model_invocation_type, - ) - - if self.total_record_count is not None: - serializer.write_long( - _SCHEMA_GET_MODEL_INVOCATION_JOB_OUTPUT.members["totalRecordCount"], - self.total_record_count, - ) - - if self.processed_record_count is not None: - serializer.write_long( - _SCHEMA_GET_MODEL_INVOCATION_JOB_OUTPUT.members["processedRecordCount"], - self.processed_record_count, - ) - - if self.success_record_count is not None: - serializer.write_long( - _SCHEMA_GET_MODEL_INVOCATION_JOB_OUTPUT.members["successRecordCount"], - self.success_record_count, - ) - - if self.error_record_count is not None: - serializer.write_long( - _SCHEMA_GET_MODEL_INVOCATION_JOB_OUTPUT.members["errorRecordCount"], - self.error_record_count, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["job_arn"] = de.read_string( - _SCHEMA_GET_MODEL_INVOCATION_JOB_OUTPUT.members["jobArn"] - ) - - case 1: - kwargs["job_name"] = de.read_string( - _SCHEMA_GET_MODEL_INVOCATION_JOB_OUTPUT.members["jobName"] - ) - - case 2: - kwargs["model_id"] = de.read_string( - _SCHEMA_GET_MODEL_INVOCATION_JOB_OUTPUT.members["modelId"] - ) - - case 3: - kwargs["client_request_token"] = de.read_string( - _SCHEMA_GET_MODEL_INVOCATION_JOB_OUTPUT.members[ - "clientRequestToken" - ] - ) - - case 4: - kwargs["role_arn"] = de.read_string( - _SCHEMA_GET_MODEL_INVOCATION_JOB_OUTPUT.members["roleArn"] - ) - - case 5: - kwargs["status"] = ModelInvocationJobStatus( - de.read_string( - _SCHEMA_GET_MODEL_INVOCATION_JOB_OUTPUT.members["status"] - ) - ) - - case 6: - kwargs["message"] = de.read_string( - _SCHEMA_GET_MODEL_INVOCATION_JOB_OUTPUT.members["message"] - ) - - case 7: - kwargs["submit_time"] = de.read_timestamp( - _SCHEMA_GET_MODEL_INVOCATION_JOB_OUTPUT.members["submitTime"] - ) - - case 8: - kwargs["last_modified_time"] = de.read_timestamp( - _SCHEMA_GET_MODEL_INVOCATION_JOB_OUTPUT.members[ - "lastModifiedTime" - ] - ) - - case 9: - kwargs["end_time"] = de.read_timestamp( - _SCHEMA_GET_MODEL_INVOCATION_JOB_OUTPUT.members["endTime"] - ) - - case 10: - kwargs["input_data_config"] = ( - _ModelInvocationJobInputDataConfigDeserializer().deserialize(de) - ) - - case 11: - kwargs["output_data_config"] = ( - _ModelInvocationJobOutputDataConfigDeserializer().deserialize( - de - ) - ) - - case 12: - kwargs["vpc_config"] = VpcConfig.deserialize(de) - - case 13: - kwargs["timeout_duration_in_hours"] = de.read_integer( - _SCHEMA_GET_MODEL_INVOCATION_JOB_OUTPUT.members[ - "timeoutDurationInHours" - ] - ) - - case 14: - kwargs["job_expiration_time"] = de.read_timestamp( - _SCHEMA_GET_MODEL_INVOCATION_JOB_OUTPUT.members[ - "jobExpirationTime" - ] - ) - - case 15: - kwargs["model_invocation_type"] = ModelInvocationType( - de.read_string( - _SCHEMA_GET_MODEL_INVOCATION_JOB_OUTPUT.members[ - "modelInvocationType" - ] - ) - ) - - case 16: - kwargs["total_record_count"] = de.read_long( - _SCHEMA_GET_MODEL_INVOCATION_JOB_OUTPUT.members[ - "totalRecordCount" - ] - ) - - case 17: - kwargs["processed_record_count"] = de.read_long( - _SCHEMA_GET_MODEL_INVOCATION_JOB_OUTPUT.members[ - "processedRecordCount" - ] - ) - - case 18: - kwargs["success_record_count"] = de.read_long( - _SCHEMA_GET_MODEL_INVOCATION_JOB_OUTPUT.members[ - "successRecordCount" - ] - ) - - case 19: - kwargs["error_record_count"] = de.read_long( - _SCHEMA_GET_MODEL_INVOCATION_JOB_OUTPUT.members[ - "errorRecordCount" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_MODEL_INVOCATION_JOB_OUTPUT, consumer=_consumer - ) - if "job_arn" not in kwargs: - kwargs["job_arn"] = "" - if "model_id" not in kwargs: - kwargs["model_id"] = "" - if "role_arn" not in kwargs: - kwargs["role_arn"] = "" - if "submit_time" not in kwargs: - kwargs["submit_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "input_data_config" not in kwargs: - kwargs["input_data_config"] = ModelInvocationJobInputDataConfigUnknown( - tag="" - ) - if "output_data_config" not in kwargs: - kwargs["output_data_config"] = ModelInvocationJobOutputDataConfigUnknown( - tag="" - ) - return kwargs - - -GET_MODEL_INVOCATION_JOB = APIOperation( - input=GetModelInvocationJobInput, - output=GetModelInvocationJobOutput, - schema=_SCHEMA_GET_MODEL_INVOCATION_JOB, - input_schema=_SCHEMA_GET_MODEL_INVOCATION_JOB_INPUT, - output_schema=_SCHEMA_GET_MODEL_INVOCATION_JOB_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListModelInvocationJobsInput: - """Dataclass for ListModelInvocationJobsInput structure.""" - - submit_time_after: datetime | None = None - """ - Specify a time to filter for batch inference jobs that were submitted - after the time you specify. - """ - - submit_time_before: datetime | None = None - """ - Specify a time to filter for batch inference jobs that were submitted - before the time you specify. - """ - - status_equals: str | None = None - """ - Specify a status to filter for batch inference jobs whose statuses match - the string you specify. - - The following statuses are possible: - - - Submitted -- This job has been submitted to a queue for validation. - - - Validating -- This job is being validated for the requirements - described in [Format and upload your batch inference - data](https://docs.aws.amazon.com/bedrock/latest/userguide/batch-inference-data.html). - The criteria include the following: - - - Your IAM service role has access to the Amazon S3 buckets containing - your files. - - - Your files are .jsonl files and each individual record is a JSON - object in the correct format. Note that validation doesn't check if - the `modelInput` value matches the request body for the model. - - - Your files fulfill the requirements for file size and number of - records. For more information, see [Quotas for Amazon - Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/quotas.html). - - - Scheduled -- This job has been validated and is now in a queue. The - job will automatically start when it reaches its turn. - - - Expired -- This job timed out because it was scheduled but didn't - begin before the set timeout duration. Submit a new job request. - - - InProgress -- This job has begun. You can start viewing the results in - the output S3 location. - - - Completed -- This job has successfully completed. View the output - files in the output S3 location. - - - PartiallyCompleted -- This job has partially completed. Not all of - your records could be processed in time. View the output files in the - output S3 location. - - - Failed -- This job has failed. Check the failure message for any - further details. For further assistance, reach out to the [Amazon Web - Services Support - Center](https://console.aws.amazon.com/support/home/). - - - Stopped -- This job was stopped by a user. - - - Stopping -- This job is being stopped by a user. - """ - - name_contains: str | None = None - """ - Specify a string to filter for batch inference jobs whose names contain - the string. - """ - - max_results: int | None = None - """ - The maximum number of results to return. If there are more results than - the number that you specify, a `nextToken` value is returned. Use the - `nextToken` in a request to return the next batch of results. - """ - - next_token: str | None = None - """ - If there were more results than the value you specified in the - `maxResults` field in a previous `ListModelInvocationJobs` request, the - response would have returned a `nextToken` value. To see the next batch - of results, send the `nextToken` value in another request. - """ - - sort_by: str | None = None - """An attribute by which to sort the results.""" - - sort_order: str | None = None - """Specifies whether to sort the results by ascending or descending order.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_MODEL_INVOCATION_JOBS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.submit_time_after is not None: - serializer.write_timestamp( - _SCHEMA_LIST_MODEL_INVOCATION_JOBS_INPUT.members["submitTimeAfter"], - self.submit_time_after, - ) - - if self.submit_time_before is not None: - serializer.write_timestamp( - _SCHEMA_LIST_MODEL_INVOCATION_JOBS_INPUT.members["submitTimeBefore"], - self.submit_time_before, - ) - - if self.status_equals is not None: - serializer.write_string( - _SCHEMA_LIST_MODEL_INVOCATION_JOBS_INPUT.members["statusEquals"], - self.status_equals, - ) - - if self.name_contains is not None: - serializer.write_string( - _SCHEMA_LIST_MODEL_INVOCATION_JOBS_INPUT.members["nameContains"], - self.name_contains, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_MODEL_INVOCATION_JOBS_INPUT.members["maxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_MODEL_INVOCATION_JOBS_INPUT.members["nextToken"], - self.next_token, - ) - - if self.sort_by is not None: - serializer.write_string( - _SCHEMA_LIST_MODEL_INVOCATION_JOBS_INPUT.members["sortBy"], self.sort_by - ) - - if self.sort_order is not None: - serializer.write_string( - _SCHEMA_LIST_MODEL_INVOCATION_JOBS_INPUT.members["sortOrder"], - self.sort_order, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["submit_time_after"] = de.read_timestamp( - _SCHEMA_LIST_MODEL_INVOCATION_JOBS_INPUT.members[ - "submitTimeAfter" - ] - ) - - case 1: - kwargs["submit_time_before"] = de.read_timestamp( - _SCHEMA_LIST_MODEL_INVOCATION_JOBS_INPUT.members[ - "submitTimeBefore" - ] - ) - - case 2: - kwargs["status_equals"] = ModelInvocationJobStatus( - de.read_string( - _SCHEMA_LIST_MODEL_INVOCATION_JOBS_INPUT.members[ - "statusEquals" - ] - ) - ) - - case 3: - kwargs["name_contains"] = de.read_string( - _SCHEMA_LIST_MODEL_INVOCATION_JOBS_INPUT.members["nameContains"] - ) - - case 4: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_MODEL_INVOCATION_JOBS_INPUT.members["maxResults"] - ) - - case 5: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_MODEL_INVOCATION_JOBS_INPUT.members["nextToken"] - ) - - case 6: - kwargs["sort_by"] = SortJobsBy( - de.read_string( - _SCHEMA_LIST_MODEL_INVOCATION_JOBS_INPUT.members["sortBy"] - ) - ) - - case 7: - kwargs["sort_order"] = SortOrder( - de.read_string( - _SCHEMA_LIST_MODEL_INVOCATION_JOBS_INPUT.members[ - "sortOrder" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_MODEL_INVOCATION_JOBS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ModelInvocationJobSummary: - """A summary of a batch inference job.""" - - job_arn: str - """The Amazon Resource Name (ARN) of the batch inference job.""" - - job_name: str - """The name of the batch inference job.""" - - model_id: str - """The unique identifier of the foundation model used for model inference.""" - - role_arn: str - """ - The Amazon Resource Name (ARN) of the service role with permissions to - carry out and manage batch inference. You can use the console to create - a default service role or follow the steps at [Create a service role for - batch - inference](https://docs.aws.amazon.com/bedrock/latest/userguide/batch-iam-sr.html). - """ - - submit_time: datetime - """The time at which the batch inference job was submitted.""" - - input_data_config: ModelInvocationJobInputDataConfig - """Details about the location of the input to the batch inference job.""" - - output_data_config: ModelInvocationJobOutputDataConfig - """Details about the location of the output of the batch inference job.""" - - client_request_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If this token matches a previous - request, Amazon Bedrock ignores the request, but does not return an - error. For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - status: str | None = None - """ - The status of the batch inference job. - - The following statuses are possible: - - - Submitted -- This job has been submitted to a queue for validation. - - - Validating -- This job is being validated for the requirements - described in [Format and upload your batch inference - data](https://docs.aws.amazon.com/bedrock/latest/userguide/batch-inference-data.html). - The criteria include the following: - - - Your IAM service role has access to the Amazon S3 buckets containing - your files. - - - Your files are .jsonl files and each individual record is a JSON - object in the correct format. Note that validation doesn't check if - the `modelInput` value matches the request body for the model. - - - Your files fulfill the requirements for file size and number of - records. For more information, see [Quotas for Amazon - Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/quotas.html). - - - Scheduled -- This job has been validated and is now in a queue. The - job will automatically start when it reaches its turn. - - - Expired -- This job timed out because it was scheduled but didn't - begin before the set timeout duration. Submit a new job request. - - - InProgress -- This job has begun. You can start viewing the results in - the output S3 location. - - - Completed -- This job has successfully completed. View the output - files in the output S3 location. - - - PartiallyCompleted -- This job has partially completed. Not all of - your records could be processed in time. View the output files in the - output S3 location. - - - Failed -- This job has failed. Check the failure message for any - further details. For further assistance, reach out to the [Amazon Web - Services Support - Center](https://console.aws.amazon.com/support/home/). - - - Stopped -- This job was stopped by a user. - - - Stopping -- This job is being stopped by a user. - """ - - message: str | None = field(repr=False, default=None) - """ - If the batch inference job failed, this field contains a message - describing why the job failed. - """ - - last_modified_time: datetime | None = None - """The time at which the batch inference job was last modified.""" - - end_time: datetime | None = None - """The time at which the batch inference job ended.""" - - vpc_config: VpcConfig | None = None - """ - The configuration of the Virtual Private Cloud (VPC) for the data in the - batch inference job. For more information, see [Protect batch inference - jobs using a - VPC](https://docs.aws.amazon.com/bedrock/latest/userguide/batch-vpc). - """ - - timeout_duration_in_hours: int | None = None - """ - The number of hours after which the batch inference job was set to time - out. - """ - - job_expiration_time: datetime | None = None - """The time at which the batch inference job times or timed out.""" - - model_invocation_type: str | None = None - """The invocation endpoint for ModelInvocationJob""" - - total_record_count: int | None = None - """The total number of records in the batch inference job.""" - - processed_record_count: int | None = None - """ - The number of records that have been processed in the batch inference - job. - """ - - success_record_count: int | None = None - """ - The number of records that were successfully processed in the batch - inference job. - """ - - error_record_count: int | None = None - """The number of records that failed to process in the batch inference job.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MODEL_INVOCATION_JOB_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MODEL_INVOCATION_JOB_SUMMARY.members["jobArn"], self.job_arn - ) - serializer.write_string( - _SCHEMA_MODEL_INVOCATION_JOB_SUMMARY.members["jobName"], self.job_name - ) - serializer.write_string( - _SCHEMA_MODEL_INVOCATION_JOB_SUMMARY.members["modelId"], self.model_id - ) - if self.client_request_token is not None: - serializer.write_string( - _SCHEMA_MODEL_INVOCATION_JOB_SUMMARY.members["clientRequestToken"], - self.client_request_token, - ) - - serializer.write_string( - _SCHEMA_MODEL_INVOCATION_JOB_SUMMARY.members["roleArn"], self.role_arn - ) - if self.status is not None: - serializer.write_string( - _SCHEMA_MODEL_INVOCATION_JOB_SUMMARY.members["status"], self.status - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_MODEL_INVOCATION_JOB_SUMMARY.members["message"], self.message - ) - - serializer.write_timestamp( - _SCHEMA_MODEL_INVOCATION_JOB_SUMMARY.members["submitTime"], self.submit_time - ) - if self.last_modified_time is not None: - serializer.write_timestamp( - _SCHEMA_MODEL_INVOCATION_JOB_SUMMARY.members["lastModifiedTime"], - self.last_modified_time, - ) - - if self.end_time is not None: - serializer.write_timestamp( - _SCHEMA_MODEL_INVOCATION_JOB_SUMMARY.members["endTime"], self.end_time - ) - - serializer.write_struct( - _SCHEMA_MODEL_INVOCATION_JOB_SUMMARY.members["inputDataConfig"], - self.input_data_config, - ) - serializer.write_struct( - _SCHEMA_MODEL_INVOCATION_JOB_SUMMARY.members["outputDataConfig"], - self.output_data_config, - ) - if self.vpc_config is not None: - serializer.write_struct( - _SCHEMA_MODEL_INVOCATION_JOB_SUMMARY.members["vpcConfig"], - self.vpc_config, - ) - - if self.timeout_duration_in_hours is not None: - serializer.write_integer( - _SCHEMA_MODEL_INVOCATION_JOB_SUMMARY.members["timeoutDurationInHours"], - self.timeout_duration_in_hours, - ) - - if self.job_expiration_time is not None: - serializer.write_timestamp( - _SCHEMA_MODEL_INVOCATION_JOB_SUMMARY.members["jobExpirationTime"], - self.job_expiration_time, - ) - - if self.model_invocation_type is not None: - serializer.write_string( - _SCHEMA_MODEL_INVOCATION_JOB_SUMMARY.members["modelInvocationType"], - self.model_invocation_type, - ) - - if self.total_record_count is not None: - serializer.write_long( - _SCHEMA_MODEL_INVOCATION_JOB_SUMMARY.members["totalRecordCount"], - self.total_record_count, - ) - - if self.processed_record_count is not None: - serializer.write_long( - _SCHEMA_MODEL_INVOCATION_JOB_SUMMARY.members["processedRecordCount"], - self.processed_record_count, - ) - - if self.success_record_count is not None: - serializer.write_long( - _SCHEMA_MODEL_INVOCATION_JOB_SUMMARY.members["successRecordCount"], - self.success_record_count, - ) - - if self.error_record_count is not None: - serializer.write_long( - _SCHEMA_MODEL_INVOCATION_JOB_SUMMARY.members["errorRecordCount"], - self.error_record_count, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["job_arn"] = de.read_string( - _SCHEMA_MODEL_INVOCATION_JOB_SUMMARY.members["jobArn"] - ) - - case 1: - kwargs["job_name"] = de.read_string( - _SCHEMA_MODEL_INVOCATION_JOB_SUMMARY.members["jobName"] - ) - - case 2: - kwargs["model_id"] = de.read_string( - _SCHEMA_MODEL_INVOCATION_JOB_SUMMARY.members["modelId"] - ) - - case 3: - kwargs["client_request_token"] = de.read_string( - _SCHEMA_MODEL_INVOCATION_JOB_SUMMARY.members[ - "clientRequestToken" - ] - ) - - case 4: - kwargs["role_arn"] = de.read_string( - _SCHEMA_MODEL_INVOCATION_JOB_SUMMARY.members["roleArn"] - ) - - case 5: - kwargs["status"] = ModelInvocationJobStatus( - de.read_string( - _SCHEMA_MODEL_INVOCATION_JOB_SUMMARY.members["status"] - ) - ) - - case 6: - kwargs["message"] = de.read_string( - _SCHEMA_MODEL_INVOCATION_JOB_SUMMARY.members["message"] - ) - - case 7: - kwargs["submit_time"] = de.read_timestamp( - _SCHEMA_MODEL_INVOCATION_JOB_SUMMARY.members["submitTime"] - ) - - case 8: - kwargs["last_modified_time"] = de.read_timestamp( - _SCHEMA_MODEL_INVOCATION_JOB_SUMMARY.members["lastModifiedTime"] - ) - - case 9: - kwargs["end_time"] = de.read_timestamp( - _SCHEMA_MODEL_INVOCATION_JOB_SUMMARY.members["endTime"] - ) - - case 10: - kwargs["input_data_config"] = ( - _ModelInvocationJobInputDataConfigDeserializer().deserialize(de) - ) - - case 11: - kwargs["output_data_config"] = ( - _ModelInvocationJobOutputDataConfigDeserializer().deserialize( - de - ) - ) - - case 12: - kwargs["vpc_config"] = VpcConfig.deserialize(de) - - case 13: - kwargs["timeout_duration_in_hours"] = de.read_integer( - _SCHEMA_MODEL_INVOCATION_JOB_SUMMARY.members[ - "timeoutDurationInHours" - ] - ) - - case 14: - kwargs["job_expiration_time"] = de.read_timestamp( - _SCHEMA_MODEL_INVOCATION_JOB_SUMMARY.members[ - "jobExpirationTime" - ] - ) - - case 15: - kwargs["model_invocation_type"] = ModelInvocationType( - de.read_string( - _SCHEMA_MODEL_INVOCATION_JOB_SUMMARY.members[ - "modelInvocationType" - ] - ) - ) - - case 16: - kwargs["total_record_count"] = de.read_long( - _SCHEMA_MODEL_INVOCATION_JOB_SUMMARY.members["totalRecordCount"] - ) - - case 17: - kwargs["processed_record_count"] = de.read_long( - _SCHEMA_MODEL_INVOCATION_JOB_SUMMARY.members[ - "processedRecordCount" - ] - ) - - case 18: - kwargs["success_record_count"] = de.read_long( - _SCHEMA_MODEL_INVOCATION_JOB_SUMMARY.members[ - "successRecordCount" - ] - ) - - case 19: - kwargs["error_record_count"] = de.read_long( - _SCHEMA_MODEL_INVOCATION_JOB_SUMMARY.members["errorRecordCount"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MODEL_INVOCATION_JOB_SUMMARY, consumer=_consumer - ) - if "job_arn" not in kwargs: - kwargs["job_arn"] = "" - if "job_name" not in kwargs: - kwargs["job_name"] = "" - if "model_id" not in kwargs: - kwargs["model_id"] = "" - if "role_arn" not in kwargs: - kwargs["role_arn"] = "" - if "submit_time" not in kwargs: - kwargs["submit_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "input_data_config" not in kwargs: - kwargs["input_data_config"] = ModelInvocationJobInputDataConfigUnknown( - tag="" - ) - if "output_data_config" not in kwargs: - kwargs["output_data_config"] = ModelInvocationJobOutputDataConfigUnknown( - tag="" - ) - return kwargs - - -def _serialize_model_invocation_job_summaries( - serializer: ShapeSerializer, schema: Schema, value: list[ModelInvocationJobSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_model_invocation_job_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ModelInvocationJobSummary]: - result: list[ModelInvocationJobSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ModelInvocationJobSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListModelInvocationJobsOutput: - """Dataclass for ListModelInvocationJobsOutput structure.""" - - next_token: str | None = None - """ - If there are more results than can fit in the response, a `nextToken` is - returned. Use the `nextToken` in a request to return the next batch of - results. - """ - - invocation_job_summaries: list[ModelInvocationJobSummary] | None = None - """ - A list of items, each of which contains a summary about a batch - inference job. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_MODEL_INVOCATION_JOBS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_MODEL_INVOCATION_JOBS_OUTPUT.members["nextToken"], - self.next_token, - ) - - if self.invocation_job_summaries is not None: - _serialize_model_invocation_job_summaries( - serializer, - _SCHEMA_LIST_MODEL_INVOCATION_JOBS_OUTPUT.members[ - "invocationJobSummaries" - ], - self.invocation_job_summaries, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_MODEL_INVOCATION_JOBS_OUTPUT.members["nextToken"] - ) - - case 1: - kwargs["invocation_job_summaries"] = ( - _deserialize_model_invocation_job_summaries( - de, - _SCHEMA_LIST_MODEL_INVOCATION_JOBS_OUTPUT.members[ - "invocationJobSummaries" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_MODEL_INVOCATION_JOBS_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_MODEL_INVOCATION_JOBS = APIOperation( - input=ListModelInvocationJobsInput, - output=ListModelInvocationJobsOutput, - schema=_SCHEMA_LIST_MODEL_INVOCATION_JOBS, - input_schema=_SCHEMA_LIST_MODEL_INVOCATION_JOBS_INPUT, - output_schema=_SCHEMA_LIST_MODEL_INVOCATION_JOBS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class StopModelInvocationJobInput: - """Dataclass for StopModelInvocationJobInput structure.""" - - job_identifier: str | None = None - """The Amazon Resource Name (ARN) of the batch inference job to stop.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STOP_MODEL_INVOCATION_JOB_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.job_identifier is not None: - serializer.write_string( - _SCHEMA_STOP_MODEL_INVOCATION_JOB_INPUT.members["jobIdentifier"], - self.job_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["job_identifier"] = de.read_string( - _SCHEMA_STOP_MODEL_INVOCATION_JOB_INPUT.members["jobIdentifier"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_STOP_MODEL_INVOCATION_JOB_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class StopModelInvocationJobOutput: - """Dataclass for StopModelInvocationJobOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STOP_MODEL_INVOCATION_JOB_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_STOP_MODEL_INVOCATION_JOB_OUTPUT, consumer=_consumer - ) - return kwargs - - -STOP_MODEL_INVOCATION_JOB = APIOperation( - input=StopModelInvocationJobInput, - output=StopModelInvocationJobOutput, - schema=_SCHEMA_STOP_MODEL_INVOCATION_JOB, - input_schema=_SCHEMA_STOP_MODEL_INVOCATION_JOB_INPUT, - output_schema=_SCHEMA_STOP_MODEL_INVOCATION_JOB_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrock#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetFoundationModelInput: - """Dataclass for GetFoundationModelInput structure.""" - - model_identifier: str | None = None - """The model identifier.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_FOUNDATION_MODEL_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.model_identifier is not None: - serializer.write_string( - _SCHEMA_GET_FOUNDATION_MODEL_INPUT.members["modelIdentifier"], - self.model_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_identifier"] = de.read_string( - _SCHEMA_GET_FOUNDATION_MODEL_INPUT.members["modelIdentifier"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_FOUNDATION_MODEL_INPUT, consumer=_consumer) - return kwargs - - -class ModelCustomization(UnknownEnumMixin, StrEnum): - FINE_TUNING = "FINE_TUNING" - CONTINUED_PRE_TRAINING = "CONTINUED_PRE_TRAINING" - DISTILLATION = "DISTILLATION" - - -def _serialize_model_customization_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_model_customization_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ModelCustomization(d.read_string(member_schema))) - - deserializer.read_list(schema, _read_value) - return result - - -class InferenceType(UnknownEnumMixin, StrEnum): - ON_DEMAND = "ON_DEMAND" - PROVISIONED = "PROVISIONED" - - -def _serialize_inference_type_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_inference_type_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(InferenceType(d.read_string(member_schema))) - - deserializer.read_list(schema, _read_value) - return result - - -class ModelModality(UnknownEnumMixin, StrEnum): - TEXT = "TEXT" - IMAGE = "IMAGE" - EMBEDDING = "EMBEDDING" - - -def _serialize_model_modality_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_model_modality_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ModelModality(d.read_string(member_schema))) - - deserializer.read_list(schema, _read_value) - return result - - -class FoundationModelLifecycleStatus(UnknownEnumMixin, StrEnum): - ACTIVE = "ACTIVE" - LEGACY = "LEGACY" - - -@dataclass(kw_only=True) -class FoundationModelLifecycle: - """Details about whether a model version is available or deprecated.""" - - status: str - """ - Specifies whether a model version is available (`ACTIVE`) or deprecated - (`LEGACY`. - """ - - start_of_life_time: datetime | None = None - """Launch time when the model first becomes available""" - - end_of_life_time: datetime | None = None - """Time when the model is no longer available for use""" - - legacy_time: datetime | None = None - """ - Time when the model enters legacy state. Models in legacy state can - still be used, but users should plan to transition to an Active model - before the end of life time - """ - - public_extended_access_time: datetime | None = None - """ - Public extended access portion of the legacy period, when users should - expect higher pricing - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FOUNDATION_MODEL_LIFECYCLE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_FOUNDATION_MODEL_LIFECYCLE.members["status"], self.status - ) - if self.start_of_life_time is not None: - serializer.write_timestamp( - _SCHEMA_FOUNDATION_MODEL_LIFECYCLE.members["startOfLifeTime"], - self.start_of_life_time, - ) - - if self.end_of_life_time is not None: - serializer.write_timestamp( - _SCHEMA_FOUNDATION_MODEL_LIFECYCLE.members["endOfLifeTime"], - self.end_of_life_time, - ) - - if self.legacy_time is not None: - serializer.write_timestamp( - _SCHEMA_FOUNDATION_MODEL_LIFECYCLE.members["legacyTime"], - self.legacy_time, - ) - - if self.public_extended_access_time is not None: - serializer.write_timestamp( - _SCHEMA_FOUNDATION_MODEL_LIFECYCLE.members["publicExtendedAccessTime"], - self.public_extended_access_time, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["status"] = FoundationModelLifecycleStatus( - de.read_string( - _SCHEMA_FOUNDATION_MODEL_LIFECYCLE.members["status"] - ) - ) - - case 1: - kwargs["start_of_life_time"] = de.read_timestamp( - _SCHEMA_FOUNDATION_MODEL_LIFECYCLE.members["startOfLifeTime"] - ) - - case 2: - kwargs["end_of_life_time"] = de.read_timestamp( - _SCHEMA_FOUNDATION_MODEL_LIFECYCLE.members["endOfLifeTime"] - ) - - case 3: - kwargs["legacy_time"] = de.read_timestamp( - _SCHEMA_FOUNDATION_MODEL_LIFECYCLE.members["legacyTime"] - ) - - case 4: - kwargs["public_extended_access_time"] = de.read_timestamp( - _SCHEMA_FOUNDATION_MODEL_LIFECYCLE.members[ - "publicExtendedAccessTime" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FOUNDATION_MODEL_LIFECYCLE, consumer=_consumer) - if "status" not in kwargs: - kwargs["status"] = FoundationModelLifecycleStatus._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class FoundationModelDetails: - """Information about a foundation model.""" - - model_arn: str - """The model Amazon Resource Name (ARN).""" - - model_id: str - """The model identifier.""" - - model_name: str | None = None - """The model name.""" - - provider_name: str | None = None - """The model's provider name.""" - - input_modalities: list[str] | None = None - """The input modalities that the model supports.""" - - output_modalities: list[str] | None = None - """The output modalities that the model supports.""" - - response_streaming_supported: bool | None = None - """Indicates whether the model supports streaming.""" - - customizations_supported: list[str] | None = None - """The customization that the model supports.""" - - inference_types_supported: list[str] | None = None - """The inference types that the model supports.""" - - model_lifecycle: FoundationModelLifecycle | None = None - """ - Contains details about whether a model version is available or - deprecated - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FOUNDATION_MODEL_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_FOUNDATION_MODEL_DETAILS.members["modelArn"], self.model_arn - ) - serializer.write_string( - _SCHEMA_FOUNDATION_MODEL_DETAILS.members["modelId"], self.model_id - ) - if self.model_name is not None: - serializer.write_string( - _SCHEMA_FOUNDATION_MODEL_DETAILS.members["modelName"], self.model_name - ) - - if self.provider_name is not None: - serializer.write_string( - _SCHEMA_FOUNDATION_MODEL_DETAILS.members["providerName"], - self.provider_name, - ) - - if self.input_modalities is not None: - _serialize_model_modality_list( - serializer, - _SCHEMA_FOUNDATION_MODEL_DETAILS.members["inputModalities"], - self.input_modalities, - ) - - if self.output_modalities is not None: - _serialize_model_modality_list( - serializer, - _SCHEMA_FOUNDATION_MODEL_DETAILS.members["outputModalities"], - self.output_modalities, - ) - - if self.response_streaming_supported is not None: - serializer.write_boolean( - _SCHEMA_FOUNDATION_MODEL_DETAILS.members["responseStreamingSupported"], - self.response_streaming_supported, - ) - - if self.customizations_supported is not None: - _serialize_model_customization_list( - serializer, - _SCHEMA_FOUNDATION_MODEL_DETAILS.members["customizationsSupported"], - self.customizations_supported, - ) - - if self.inference_types_supported is not None: - _serialize_inference_type_list( - serializer, - _SCHEMA_FOUNDATION_MODEL_DETAILS.members["inferenceTypesSupported"], - self.inference_types_supported, - ) - - if self.model_lifecycle is not None: - serializer.write_struct( - _SCHEMA_FOUNDATION_MODEL_DETAILS.members["modelLifecycle"], - self.model_lifecycle, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_arn"] = de.read_string( - _SCHEMA_FOUNDATION_MODEL_DETAILS.members["modelArn"] - ) - - case 1: - kwargs["model_id"] = de.read_string( - _SCHEMA_FOUNDATION_MODEL_DETAILS.members["modelId"] - ) - - case 2: - kwargs["model_name"] = de.read_string( - _SCHEMA_FOUNDATION_MODEL_DETAILS.members["modelName"] - ) - - case 3: - kwargs["provider_name"] = de.read_string( - _SCHEMA_FOUNDATION_MODEL_DETAILS.members["providerName"] - ) - - case 4: - kwargs["input_modalities"] = _deserialize_model_modality_list( - de, _SCHEMA_FOUNDATION_MODEL_DETAILS.members["inputModalities"] - ) - - case 5: - kwargs["output_modalities"] = _deserialize_model_modality_list( - de, _SCHEMA_FOUNDATION_MODEL_DETAILS.members["outputModalities"] - ) - - case 6: - kwargs["response_streaming_supported"] = de.read_boolean( - _SCHEMA_FOUNDATION_MODEL_DETAILS.members[ - "responseStreamingSupported" - ] - ) - - case 7: - kwargs["customizations_supported"] = ( - _deserialize_model_customization_list( - de, - _SCHEMA_FOUNDATION_MODEL_DETAILS.members[ - "customizationsSupported" - ], - ) - ) - - case 8: - kwargs["inference_types_supported"] = ( - _deserialize_inference_type_list( - de, - _SCHEMA_FOUNDATION_MODEL_DETAILS.members[ - "inferenceTypesSupported" - ], - ) - ) - - case 9: - kwargs["model_lifecycle"] = FoundationModelLifecycle.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FOUNDATION_MODEL_DETAILS, consumer=_consumer) - if "model_arn" not in kwargs: - kwargs["model_arn"] = "" - if "model_id" not in kwargs: - kwargs["model_id"] = "" - return kwargs - - -@dataclass(kw_only=True) -class GetFoundationModelOutput: - """Dataclass for GetFoundationModelOutput structure.""" - - model_details: FoundationModelDetails | None = None - """Information about the foundation model.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_FOUNDATION_MODEL_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.model_details is not None: - serializer.write_struct( - _SCHEMA_GET_FOUNDATION_MODEL_OUTPUT.members["modelDetails"], - self.model_details, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_details"] = FoundationModelDetails.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_FOUNDATION_MODEL_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_FOUNDATION_MODEL = APIOperation( - input=GetFoundationModelInput, - output=GetFoundationModelOutput, - schema=_SCHEMA_GET_FOUNDATION_MODEL, - input_schema=_SCHEMA_GET_FOUNDATION_MODEL_INPUT, - output_schema=_SCHEMA_GET_FOUNDATION_MODEL_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListFoundationModelsInput: - """Dataclass for ListFoundationModelsInput structure.""" - - by_provider: str | None = None - """Return models belonging to the model provider that you specify.""" - - by_customization_type: str | None = None - """ - Return models that support the customization type that you specify. For - more information, see [Custom - models](https://docs.aws.amazon.com/bedrock/latest/userguide/custom-models.html) - in the [Amazon Bedrock User - Guide](https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html). - """ - - by_output_modality: str | None = None - """Return models that support the output modality that you specify.""" - - by_inference_type: str | None = None - """ - Return models that support the inference type that you specify. For more - information, see [Provisioned - Throughput](https://docs.aws.amazon.com/bedrock/latest/userguide/prov-throughput.html) - in the [Amazon Bedrock User - Guide](https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_FOUNDATION_MODELS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.by_provider is not None: - serializer.write_string( - _SCHEMA_LIST_FOUNDATION_MODELS_INPUT.members["byProvider"], - self.by_provider, - ) - - if self.by_customization_type is not None: - serializer.write_string( - _SCHEMA_LIST_FOUNDATION_MODELS_INPUT.members["byCustomizationType"], - self.by_customization_type, - ) - - if self.by_output_modality is not None: - serializer.write_string( - _SCHEMA_LIST_FOUNDATION_MODELS_INPUT.members["byOutputModality"], - self.by_output_modality, - ) - - if self.by_inference_type is not None: - serializer.write_string( - _SCHEMA_LIST_FOUNDATION_MODELS_INPUT.members["byInferenceType"], - self.by_inference_type, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["by_provider"] = de.read_string( - _SCHEMA_LIST_FOUNDATION_MODELS_INPUT.members["byProvider"] - ) - - case 1: - kwargs["by_customization_type"] = ModelCustomization( - de.read_string( - _SCHEMA_LIST_FOUNDATION_MODELS_INPUT.members[ - "byCustomizationType" - ] - ) - ) - - case 2: - kwargs["by_output_modality"] = ModelModality( - de.read_string( - _SCHEMA_LIST_FOUNDATION_MODELS_INPUT.members[ - "byOutputModality" - ] - ) - ) - - case 3: - kwargs["by_inference_type"] = InferenceType( - de.read_string( - _SCHEMA_LIST_FOUNDATION_MODELS_INPUT.members[ - "byInferenceType" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_FOUNDATION_MODELS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class FoundationModelSummary: - """Summary information for a foundation model.""" - - model_arn: str - """The Amazon Resource Name (ARN) of the foundation model.""" - - model_id: str - """The model ID of the foundation model.""" - - model_name: str | None = None - """The name of the model.""" - - provider_name: str | None = None - """The model's provider name.""" - - input_modalities: list[str] | None = None - """The input modalities that the model supports.""" - - output_modalities: list[str] | None = None - """The output modalities that the model supports.""" - - response_streaming_supported: bool | None = None - """Indicates whether the model supports streaming.""" - - customizations_supported: list[str] | None = None - """Whether the model supports fine-tuning or continual pre-training.""" - - inference_types_supported: list[str] | None = None - """The inference types that the model supports.""" - - model_lifecycle: FoundationModelLifecycle | None = None - """ - Contains details about whether a model version is available or - deprecated. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FOUNDATION_MODEL_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_FOUNDATION_MODEL_SUMMARY.members["modelArn"], self.model_arn - ) - serializer.write_string( - _SCHEMA_FOUNDATION_MODEL_SUMMARY.members["modelId"], self.model_id - ) - if self.model_name is not None: - serializer.write_string( - _SCHEMA_FOUNDATION_MODEL_SUMMARY.members["modelName"], self.model_name - ) - - if self.provider_name is not None: - serializer.write_string( - _SCHEMA_FOUNDATION_MODEL_SUMMARY.members["providerName"], - self.provider_name, - ) - - if self.input_modalities is not None: - _serialize_model_modality_list( - serializer, - _SCHEMA_FOUNDATION_MODEL_SUMMARY.members["inputModalities"], - self.input_modalities, - ) - - if self.output_modalities is not None: - _serialize_model_modality_list( - serializer, - _SCHEMA_FOUNDATION_MODEL_SUMMARY.members["outputModalities"], - self.output_modalities, - ) - - if self.response_streaming_supported is not None: - serializer.write_boolean( - _SCHEMA_FOUNDATION_MODEL_SUMMARY.members["responseStreamingSupported"], - self.response_streaming_supported, - ) - - if self.customizations_supported is not None: - _serialize_model_customization_list( - serializer, - _SCHEMA_FOUNDATION_MODEL_SUMMARY.members["customizationsSupported"], - self.customizations_supported, - ) - - if self.inference_types_supported is not None: - _serialize_inference_type_list( - serializer, - _SCHEMA_FOUNDATION_MODEL_SUMMARY.members["inferenceTypesSupported"], - self.inference_types_supported, - ) - - if self.model_lifecycle is not None: - serializer.write_struct( - _SCHEMA_FOUNDATION_MODEL_SUMMARY.members["modelLifecycle"], - self.model_lifecycle, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_arn"] = de.read_string( - _SCHEMA_FOUNDATION_MODEL_SUMMARY.members["modelArn"] - ) - - case 1: - kwargs["model_id"] = de.read_string( - _SCHEMA_FOUNDATION_MODEL_SUMMARY.members["modelId"] - ) - - case 2: - kwargs["model_name"] = de.read_string( - _SCHEMA_FOUNDATION_MODEL_SUMMARY.members["modelName"] - ) - - case 3: - kwargs["provider_name"] = de.read_string( - _SCHEMA_FOUNDATION_MODEL_SUMMARY.members["providerName"] - ) - - case 4: - kwargs["input_modalities"] = _deserialize_model_modality_list( - de, _SCHEMA_FOUNDATION_MODEL_SUMMARY.members["inputModalities"] - ) - - case 5: - kwargs["output_modalities"] = _deserialize_model_modality_list( - de, _SCHEMA_FOUNDATION_MODEL_SUMMARY.members["outputModalities"] - ) - - case 6: - kwargs["response_streaming_supported"] = de.read_boolean( - _SCHEMA_FOUNDATION_MODEL_SUMMARY.members[ - "responseStreamingSupported" - ] - ) - - case 7: - kwargs["customizations_supported"] = ( - _deserialize_model_customization_list( - de, - _SCHEMA_FOUNDATION_MODEL_SUMMARY.members[ - "customizationsSupported" - ], - ) - ) - - case 8: - kwargs["inference_types_supported"] = ( - _deserialize_inference_type_list( - de, - _SCHEMA_FOUNDATION_MODEL_SUMMARY.members[ - "inferenceTypesSupported" - ], - ) - ) - - case 9: - kwargs["model_lifecycle"] = FoundationModelLifecycle.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FOUNDATION_MODEL_SUMMARY, consumer=_consumer) - if "model_arn" not in kwargs: - kwargs["model_arn"] = "" - if "model_id" not in kwargs: - kwargs["model_id"] = "" - return kwargs - - -def _serialize_foundation_model_summary_list( - serializer: ShapeSerializer, schema: Schema, value: list[FoundationModelSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_foundation_model_summary_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[FoundationModelSummary]: - result: list[FoundationModelSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(FoundationModelSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListFoundationModelsOutput: - """Dataclass for ListFoundationModelsOutput structure.""" - - model_summaries: list[FoundationModelSummary] | None = None - """A list of Amazon Bedrock foundation models.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_FOUNDATION_MODELS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.model_summaries is not None: - _serialize_foundation_model_summary_list( - serializer, - _SCHEMA_LIST_FOUNDATION_MODELS_OUTPUT.members["modelSummaries"], - self.model_summaries, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_summaries"] = ( - _deserialize_foundation_model_summary_list( - de, - _SCHEMA_LIST_FOUNDATION_MODELS_OUTPUT.members[ - "modelSummaries" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_FOUNDATION_MODELS_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_FOUNDATION_MODELS = APIOperation( - input=ListFoundationModelsInput, - output=ListFoundationModelsOutput, - schema=_SCHEMA_LIST_FOUNDATION_MODELS, - input_schema=_SCHEMA_LIST_FOUNDATION_MODELS_INPUT, - output_schema=_SCHEMA_LIST_FOUNDATION_MODELS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class PromptRouterTargetModel: - """The target model for a prompt router.""" - - model_arn: str | None = None - """The target model's ARN.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PROMPT_ROUTER_TARGET_MODEL, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.model_arn is not None: - serializer.write_string( - _SCHEMA_PROMPT_ROUTER_TARGET_MODEL.members["modelArn"], self.model_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_arn"] = de.read_string( - _SCHEMA_PROMPT_ROUTER_TARGET_MODEL.members["modelArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PROMPT_ROUTER_TARGET_MODEL, consumer=_consumer) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls() - - -def _serialize_prompt_router_target_models( - serializer: ShapeSerializer, schema: Schema, value: list[PromptRouterTargetModel] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_prompt_router_target_models( - deserializer: ShapeDeserializer, schema: Schema -) -> list[PromptRouterTargetModel]: - result: list[PromptRouterTargetModel] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(PromptRouterTargetModel.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class RoutingCriteria: - """Routing criteria for a prompt router.""" - - response_quality_difference: float - """The criteria's response quality difference.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ROUTING_CRITERIA, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_double( - _SCHEMA_ROUTING_CRITERIA.members["responseQualityDifference"], - self.response_quality_difference, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["response_quality_difference"] = de.read_double( - _SCHEMA_ROUTING_CRITERIA.members["responseQualityDifference"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ROUTING_CRITERIA, consumer=_consumer) - if "response_quality_difference" not in kwargs: - kwargs["response_quality_difference"] = 0.0 - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(response_quality_difference=0.0) - - -@dataclass(kw_only=True) -class CreatePromptRouterInput: - """Dataclass for CreatePromptRouterInput structure.""" - - client_request_token: str | None = None - """ - A unique, case-sensitive identifier that you provide to ensure - idempotency of your requests. If not specified, the Amazon Web Services - SDK automatically generates one for you. - """ - - prompt_router_name: str | None = None - """ - The name of the prompt router. The name must be unique within your - Amazon Web Services account in the current region. - """ - - models: list[PromptRouterTargetModel] | None = None - """ - A list of foundation models that the prompt router can route requests - to. At least one model must be specified. - """ - - description: str | None = field(repr=False, default=None) - """ - An optional description of the prompt router to help identify its - purpose. - """ - - routing_criteria: RoutingCriteria | None = None - """ - The criteria, which is the response quality difference, used to - determine how incoming requests are routed to different models. - """ - - fallback_model: PromptRouterTargetModel | None = None - """The default model to use when the routing criteria is not met.""" - - tags: list[Tag] | None = None - """ - An array of key-value pairs to apply to this resource as tags. You can - use tags to categorize and manage your Amazon Web Services resources. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_PROMPT_ROUTER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.client_request_token is not None: - serializer.write_string( - _SCHEMA_CREATE_PROMPT_ROUTER_INPUT.members["clientRequestToken"], - self.client_request_token, - ) - - if self.prompt_router_name is not None: - serializer.write_string( - _SCHEMA_CREATE_PROMPT_ROUTER_INPUT.members["promptRouterName"], - self.prompt_router_name, - ) - - if self.models is not None: - _serialize_prompt_router_target_models( - serializer, - _SCHEMA_CREATE_PROMPT_ROUTER_INPUT.members["models"], - self.models, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_PROMPT_ROUTER_INPUT.members["description"], - self.description, - ) - - if self.routing_criteria is not None: - serializer.write_struct( - _SCHEMA_CREATE_PROMPT_ROUTER_INPUT.members["routingCriteria"], - self.routing_criteria, - ) - - if self.fallback_model is not None: - serializer.write_struct( - _SCHEMA_CREATE_PROMPT_ROUTER_INPUT.members["fallbackModel"], - self.fallback_model, - ) - - if self.tags is not None: - _serialize_tag_list( - serializer, - _SCHEMA_CREATE_PROMPT_ROUTER_INPUT.members["tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["client_request_token"] = de.read_string( - _SCHEMA_CREATE_PROMPT_ROUTER_INPUT.members["clientRequestToken"] - ) - - case 1: - kwargs["prompt_router_name"] = de.read_string( - _SCHEMA_CREATE_PROMPT_ROUTER_INPUT.members["promptRouterName"] - ) - - case 2: - kwargs["models"] = _deserialize_prompt_router_target_models( - de, _SCHEMA_CREATE_PROMPT_ROUTER_INPUT.members["models"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_PROMPT_ROUTER_INPUT.members["description"] - ) - - case 4: - kwargs["routing_criteria"] = RoutingCriteria.deserialize(de) - - case 5: - kwargs["fallback_model"] = PromptRouterTargetModel.deserialize(de) - - case 6: - kwargs["tags"] = _deserialize_tag_list( - de, _SCHEMA_CREATE_PROMPT_ROUTER_INPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_PROMPT_ROUTER_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CreatePromptRouterOutput: - """Dataclass for CreatePromptRouterOutput structure.""" - - prompt_router_arn: str | None = None - """ - The Amazon Resource Name (ARN) that uniquely identifies the prompt - router. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_PROMPT_ROUTER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.prompt_router_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_PROMPT_ROUTER_OUTPUT.members["promptRouterArn"], - self.prompt_router_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["prompt_router_arn"] = de.read_string( - _SCHEMA_CREATE_PROMPT_ROUTER_OUTPUT.members["promptRouterArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_PROMPT_ROUTER_OUTPUT, consumer=_consumer - ) - return kwargs - - -CREATE_PROMPT_ROUTER = APIOperation( - input=CreatePromptRouterInput, - output=CreatePromptRouterOutput, - schema=_SCHEMA_CREATE_PROMPT_ROUTER, - input_schema=_SCHEMA_CREATE_PROMPT_ROUTER_INPUT, - output_schema=_SCHEMA_CREATE_PROMPT_ROUTER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrock#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrock#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#TooManyTagsException"): TooManyTagsException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_TOO_MANY_TAGS_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeletePromptRouterInput: - """Dataclass for DeletePromptRouterInput structure.""" - - prompt_router_arn: str | None = None - """The Amazon Resource Name (ARN) of the prompt router to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_PROMPT_ROUTER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.prompt_router_arn is not None: - serializer.write_string( - _SCHEMA_DELETE_PROMPT_ROUTER_INPUT.members["promptRouterArn"], - self.prompt_router_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["prompt_router_arn"] = de.read_string( - _SCHEMA_DELETE_PROMPT_ROUTER_INPUT.members["promptRouterArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_PROMPT_ROUTER_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeletePromptRouterOutput: - """Dataclass for DeletePromptRouterOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_PROMPT_ROUTER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_PROMPT_ROUTER_OUTPUT, consumer=_consumer - ) - return kwargs - - -DELETE_PROMPT_ROUTER = APIOperation( - input=DeletePromptRouterInput, - output=DeletePromptRouterOutput, - schema=_SCHEMA_DELETE_PROMPT_ROUTER, - input_schema=_SCHEMA_DELETE_PROMPT_ROUTER_INPUT, - output_schema=_SCHEMA_DELETE_PROMPT_ROUTER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetPromptRouterInput: - """Dataclass for GetPromptRouterInput structure.""" - - prompt_router_arn: str | None = None - """The prompt router's ARN""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_PROMPT_ROUTER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.prompt_router_arn is not None: - serializer.write_string( - _SCHEMA_GET_PROMPT_ROUTER_INPUT.members["promptRouterArn"], - self.prompt_router_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["prompt_router_arn"] = de.read_string( - _SCHEMA_GET_PROMPT_ROUTER_INPUT.members["promptRouterArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_PROMPT_ROUTER_INPUT, consumer=_consumer) - return kwargs - - -class PromptRouterStatus(UnknownEnumMixin, StrEnum): - AVAILABLE = "AVAILABLE" - - -class PromptRouterType(UnknownEnumMixin, StrEnum): - CUSTOM = "custom" - DEFAULT = "default" - - -@dataclass(kw_only=True) -class GetPromptRouterOutput: - """Dataclass for GetPromptRouterOutput structure.""" - - prompt_router_name: str - """The router's name.""" - - routing_criteria: RoutingCriteria - """The router's routing criteria.""" - - prompt_router_arn: str - """The prompt router's ARN""" - - models: list[PromptRouterTargetModel] - """The router's models.""" - - fallback_model: PromptRouterTargetModel - """The router's fallback model.""" - - status: str - """The router's status.""" - - type: str - """The router's type.""" - - description: str | None = field(repr=False, default=None) - """The router's description.""" - - created_at: datetime | None = None - """When the router was created.""" - - updated_at: datetime | None = None - """When the router was updated.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_PROMPT_ROUTER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_PROMPT_ROUTER_OUTPUT.members["promptRouterName"], - self.prompt_router_name, - ) - serializer.write_struct( - _SCHEMA_GET_PROMPT_ROUTER_OUTPUT.members["routingCriteria"], - self.routing_criteria, - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_PROMPT_ROUTER_OUTPUT.members["description"], - self.description, - ) - - if self.created_at is not None: - serializer.write_timestamp( - _SCHEMA_GET_PROMPT_ROUTER_OUTPUT.members["createdAt"], self.created_at - ) - - if self.updated_at is not None: - serializer.write_timestamp( - _SCHEMA_GET_PROMPT_ROUTER_OUTPUT.members["updatedAt"], self.updated_at - ) - - serializer.write_string( - _SCHEMA_GET_PROMPT_ROUTER_OUTPUT.members["promptRouterArn"], - self.prompt_router_arn, - ) - _serialize_prompt_router_target_models( - serializer, _SCHEMA_GET_PROMPT_ROUTER_OUTPUT.members["models"], self.models - ) - serializer.write_struct( - _SCHEMA_GET_PROMPT_ROUTER_OUTPUT.members["fallbackModel"], - self.fallback_model, - ) - serializer.write_string( - _SCHEMA_GET_PROMPT_ROUTER_OUTPUT.members["status"], self.status - ) - serializer.write_string( - _SCHEMA_GET_PROMPT_ROUTER_OUTPUT.members["type"], self.type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["prompt_router_name"] = de.read_string( - _SCHEMA_GET_PROMPT_ROUTER_OUTPUT.members["promptRouterName"] - ) - - case 1: - kwargs["routing_criteria"] = RoutingCriteria.deserialize(de) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_GET_PROMPT_ROUTER_OUTPUT.members["description"] - ) - - case 3: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_PROMPT_ROUTER_OUTPUT.members["createdAt"] - ) - - case 4: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_GET_PROMPT_ROUTER_OUTPUT.members["updatedAt"] - ) - - case 5: - kwargs["prompt_router_arn"] = de.read_string( - _SCHEMA_GET_PROMPT_ROUTER_OUTPUT.members["promptRouterArn"] - ) - - case 6: - kwargs["models"] = _deserialize_prompt_router_target_models( - de, _SCHEMA_GET_PROMPT_ROUTER_OUTPUT.members["models"] - ) - - case 7: - kwargs["fallback_model"] = PromptRouterTargetModel.deserialize(de) - - case 8: - kwargs["status"] = PromptRouterStatus( - de.read_string( - _SCHEMA_GET_PROMPT_ROUTER_OUTPUT.members["status"] - ) - ) - - case 9: - kwargs["type"] = PromptRouterType( - de.read_string(_SCHEMA_GET_PROMPT_ROUTER_OUTPUT.members["type"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_PROMPT_ROUTER_OUTPUT, consumer=_consumer) - if "prompt_router_name" not in kwargs: - kwargs["prompt_router_name"] = "" - if "routing_criteria" not in kwargs: - kwargs["routing_criteria"] = RoutingCriteria._smithy_default() - if "prompt_router_arn" not in kwargs: - kwargs["prompt_router_arn"] = "" - if "models" not in kwargs: - kwargs["models"] = [] - if "fallback_model" not in kwargs: - kwargs["fallback_model"] = PromptRouterTargetModel._smithy_default() - if "status" not in kwargs: - kwargs["status"] = PromptRouterStatus._corrected("") - if "type" not in kwargs: - kwargs["type"] = PromptRouterType._corrected("") - return kwargs - - -GET_PROMPT_ROUTER = APIOperation( - input=GetPromptRouterInput, - output=GetPromptRouterOutput, - schema=_SCHEMA_GET_PROMPT_ROUTER, - input_schema=_SCHEMA_GET_PROMPT_ROUTER_INPUT, - output_schema=_SCHEMA_GET_PROMPT_ROUTER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListPromptRoutersInput: - """Dataclass for ListPromptRoutersInput structure.""" - - max_results: int | None = None - """The maximum number of prompt routers to return in one page of results.""" - - next_token: str | None = None - """ - Specify the pagination token from a previous request to retrieve the - next page of results. - """ - - type: str = PromptRouterType("default") - """The type of the prompt routers, such as whether it's default or custom.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_PROMPT_ROUTERS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_PROMPT_ROUTERS_INPUT.members["maxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_PROMPT_ROUTERS_INPUT.members["nextToken"], self.next_token - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_LIST_PROMPT_ROUTERS_INPUT.members["type"], self.type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_PROMPT_ROUTERS_INPUT.members["maxResults"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_PROMPT_ROUTERS_INPUT.members["nextToken"] - ) - - case 2: - kwargs["type"] = PromptRouterType( - de.read_string( - _SCHEMA_LIST_PROMPT_ROUTERS_INPUT.members["type"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_PROMPT_ROUTERS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class PromptRouterSummary: - """Details about a prompt router.""" - - prompt_router_name: str - """The router's name.""" - - routing_criteria: RoutingCriteria - """The router's routing criteria.""" - - prompt_router_arn: str - """The router's ARN.""" - - models: list[PromptRouterTargetModel] - """The router's models.""" - - fallback_model: PromptRouterTargetModel - """The router's fallback model.""" - - status: str - """The router's status.""" - - type: str - """The summary's type.""" - - description: str | None = field(repr=False, default=None) - """The router's description.""" - - created_at: datetime | None = None - """When the router was created.""" - - updated_at: datetime | None = None - """When the router was updated.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PROMPT_ROUTER_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_PROMPT_ROUTER_SUMMARY.members["promptRouterName"], - self.prompt_router_name, - ) - serializer.write_struct( - _SCHEMA_PROMPT_ROUTER_SUMMARY.members["routingCriteria"], - self.routing_criteria, - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_PROMPT_ROUTER_SUMMARY.members["description"], self.description - ) - - if self.created_at is not None: - serializer.write_timestamp( - _SCHEMA_PROMPT_ROUTER_SUMMARY.members["createdAt"], self.created_at - ) - - if self.updated_at is not None: - serializer.write_timestamp( - _SCHEMA_PROMPT_ROUTER_SUMMARY.members["updatedAt"], self.updated_at - ) - - serializer.write_string( - _SCHEMA_PROMPT_ROUTER_SUMMARY.members["promptRouterArn"], - self.prompt_router_arn, - ) - _serialize_prompt_router_target_models( - serializer, _SCHEMA_PROMPT_ROUTER_SUMMARY.members["models"], self.models - ) - serializer.write_struct( - _SCHEMA_PROMPT_ROUTER_SUMMARY.members["fallbackModel"], self.fallback_model - ) - serializer.write_string( - _SCHEMA_PROMPT_ROUTER_SUMMARY.members["status"], self.status - ) - serializer.write_string( - _SCHEMA_PROMPT_ROUTER_SUMMARY.members["type"], self.type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["prompt_router_name"] = de.read_string( - _SCHEMA_PROMPT_ROUTER_SUMMARY.members["promptRouterName"] - ) - - case 1: - kwargs["routing_criteria"] = RoutingCriteria.deserialize(de) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_PROMPT_ROUTER_SUMMARY.members["description"] - ) - - case 3: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_PROMPT_ROUTER_SUMMARY.members["createdAt"] - ) - - case 4: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_PROMPT_ROUTER_SUMMARY.members["updatedAt"] - ) - - case 5: - kwargs["prompt_router_arn"] = de.read_string( - _SCHEMA_PROMPT_ROUTER_SUMMARY.members["promptRouterArn"] - ) - - case 6: - kwargs["models"] = _deserialize_prompt_router_target_models( - de, _SCHEMA_PROMPT_ROUTER_SUMMARY.members["models"] - ) - - case 7: - kwargs["fallback_model"] = PromptRouterTargetModel.deserialize(de) - - case 8: - kwargs["status"] = PromptRouterStatus( - de.read_string(_SCHEMA_PROMPT_ROUTER_SUMMARY.members["status"]) - ) - - case 9: - kwargs["type"] = PromptRouterType( - de.read_string(_SCHEMA_PROMPT_ROUTER_SUMMARY.members["type"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PROMPT_ROUTER_SUMMARY, consumer=_consumer) - if "prompt_router_name" not in kwargs: - kwargs["prompt_router_name"] = "" - if "routing_criteria" not in kwargs: - kwargs["routing_criteria"] = RoutingCriteria._smithy_default() - if "prompt_router_arn" not in kwargs: - kwargs["prompt_router_arn"] = "" - if "models" not in kwargs: - kwargs["models"] = [] - if "fallback_model" not in kwargs: - kwargs["fallback_model"] = PromptRouterTargetModel._smithy_default() - if "status" not in kwargs: - kwargs["status"] = PromptRouterStatus._corrected("") - if "type" not in kwargs: - kwargs["type"] = PromptRouterType._corrected("") - return kwargs - - -def _serialize_prompt_router_summaries( - serializer: ShapeSerializer, schema: Schema, value: list[PromptRouterSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_prompt_router_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[PromptRouterSummary]: - result: list[PromptRouterSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(PromptRouterSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListPromptRoutersOutput: - """Dataclass for ListPromptRoutersOutput structure.""" - - prompt_router_summaries: list[PromptRouterSummary] | None = None - """A list of prompt router summaries.""" - - next_token: str | None = None - """ - Specify the pagination token from a previous request to retrieve the - next page of results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_PROMPT_ROUTERS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.prompt_router_summaries is not None: - _serialize_prompt_router_summaries( - serializer, - _SCHEMA_LIST_PROMPT_ROUTERS_OUTPUT.members["promptRouterSummaries"], - self.prompt_router_summaries, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_PROMPT_ROUTERS_OUTPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["prompt_router_summaries"] = ( - _deserialize_prompt_router_summaries( - de, - _SCHEMA_LIST_PROMPT_ROUTERS_OUTPUT.members[ - "promptRouterSummaries" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_PROMPT_ROUTERS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_PROMPT_ROUTERS_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_PROMPT_ROUTERS = APIOperation( - input=ListPromptRoutersInput, - output=ListPromptRoutersOutput, - schema=_SCHEMA_LIST_PROMPT_ROUTERS, - input_schema=_SCHEMA_LIST_PROMPT_ROUTERS_INPUT, - output_schema=_SCHEMA_LIST_PROMPT_ROUTERS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class CommitmentDuration(UnknownEnumMixin, StrEnum): - ONE_MONTH = "OneMonth" - SIX_MONTHS = "SixMonths" - - -@dataclass(kw_only=True) -class CreateProvisionedModelThroughputInput: - """Dataclass for CreateProvisionedModelThroughputInput structure.""" - - client_request_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If this token matches a previous - request, Amazon Bedrock ignores the request, but does not return an - error. For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html) - in the Amazon S3 User Guide. - """ - - model_units: int | None = None - """ - Number of model units to allocate. A model unit delivers a specific - throughput level for the specified model. The throughput level of a - model unit specifies the total number of input and output tokens that it - can process and generate within a span of one minute. By default, your - account has no model units for purchasing Provisioned Throughputs with - commitment. You must first visit the [Amazon Web Services support - center](https://console.aws.amazon.com/support/home#/case/create?issueType=service-limit-increase) - to request MUs. - - For model unit quotas, see [Provisioned Throughput - quotas](https://docs.aws.amazon.com/bedrock/latest/userguide/quotas.html#prov-thru-quotas) - in the [Amazon Bedrock User - Guide](https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html). - - For more information about what an MU specifies, contact your Amazon Web - Services account manager. - """ - - provisioned_model_name: str | None = None - """The name for this Provisioned Throughput.""" - - model_id: str | None = None - """ - The Amazon Resource Name (ARN) or name of the model to associate with - this Provisioned Throughput. For a list of models for which you can - purchase Provisioned Throughput, see [Amazon Bedrock model IDs for - purchasing Provisioned - Throughput](https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#prov-throughput-models) - in the [Amazon Bedrock User - Guide](https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html). - """ - - commitment_duration: str | None = None - """ - The commitment duration requested for the Provisioned Throughput. - Billing occurs hourly and is discounted for longer commitment terms. To - request a no-commit Provisioned Throughput, omit this field. - - Custom models support all levels of commitment. To see which base models - support no commitment, see [Supported regions and models for Provisioned - Throughput](https://docs.aws.amazon.com/bedrock/latest/userguide/pt-supported.html) - in the [Amazon Bedrock User - Guide](https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html) - """ - - tags: list[Tag] | None = None - """Tags to associate with this Provisioned Throughput.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_PROVISIONED_MODEL_THROUGHPUT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.client_request_token is not None: - serializer.write_string( - _SCHEMA_CREATE_PROVISIONED_MODEL_THROUGHPUT_INPUT.members[ - "clientRequestToken" - ], - self.client_request_token, - ) - - if self.model_units is not None: - serializer.write_integer( - _SCHEMA_CREATE_PROVISIONED_MODEL_THROUGHPUT_INPUT.members["modelUnits"], - self.model_units, - ) - - if self.provisioned_model_name is not None: - serializer.write_string( - _SCHEMA_CREATE_PROVISIONED_MODEL_THROUGHPUT_INPUT.members[ - "provisionedModelName" - ], - self.provisioned_model_name, - ) - - if self.model_id is not None: - serializer.write_string( - _SCHEMA_CREATE_PROVISIONED_MODEL_THROUGHPUT_INPUT.members["modelId"], - self.model_id, - ) - - if self.commitment_duration is not None: - serializer.write_string( - _SCHEMA_CREATE_PROVISIONED_MODEL_THROUGHPUT_INPUT.members[ - "commitmentDuration" - ], - self.commitment_duration, - ) - - if self.tags is not None: - _serialize_tag_list( - serializer, - _SCHEMA_CREATE_PROVISIONED_MODEL_THROUGHPUT_INPUT.members["tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["client_request_token"] = de.read_string( - _SCHEMA_CREATE_PROVISIONED_MODEL_THROUGHPUT_INPUT.members[ - "clientRequestToken" - ] - ) - - case 1: - kwargs["model_units"] = de.read_integer( - _SCHEMA_CREATE_PROVISIONED_MODEL_THROUGHPUT_INPUT.members[ - "modelUnits" - ] - ) - - case 2: - kwargs["provisioned_model_name"] = de.read_string( - _SCHEMA_CREATE_PROVISIONED_MODEL_THROUGHPUT_INPUT.members[ - "provisionedModelName" - ] - ) - - case 3: - kwargs["model_id"] = de.read_string( - _SCHEMA_CREATE_PROVISIONED_MODEL_THROUGHPUT_INPUT.members[ - "modelId" - ] - ) - - case 4: - kwargs["commitment_duration"] = CommitmentDuration( - de.read_string( - _SCHEMA_CREATE_PROVISIONED_MODEL_THROUGHPUT_INPUT.members[ - "commitmentDuration" - ] - ) - ) - - case 5: - kwargs["tags"] = _deserialize_tag_list( - de, - _SCHEMA_CREATE_PROVISIONED_MODEL_THROUGHPUT_INPUT.members[ - "tags" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_PROVISIONED_MODEL_THROUGHPUT_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CreateProvisionedModelThroughputOutput: - """Dataclass for CreateProvisionedModelThroughputOutput structure.""" - - provisioned_model_arn: str - """The Amazon Resource Name (ARN) for this Provisioned Throughput.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CREATE_PROVISIONED_MODEL_THROUGHPUT_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_PROVISIONED_MODEL_THROUGHPUT_OUTPUT.members[ - "provisionedModelArn" - ], - self.provisioned_model_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["provisioned_model_arn"] = de.read_string( - _SCHEMA_CREATE_PROVISIONED_MODEL_THROUGHPUT_OUTPUT.members[ - "provisionedModelArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_PROVISIONED_MODEL_THROUGHPUT_OUTPUT, consumer=_consumer - ) - if "provisioned_model_arn" not in kwargs: - kwargs["provisioned_model_arn"] = "" - return kwargs - - -CREATE_PROVISIONED_MODEL_THROUGHPUT = APIOperation( - input=CreateProvisionedModelThroughputInput, - output=CreateProvisionedModelThroughputOutput, - schema=_SCHEMA_CREATE_PROVISIONED_MODEL_THROUGHPUT, - input_schema=_SCHEMA_CREATE_PROVISIONED_MODEL_THROUGHPUT_INPUT, - output_schema=_SCHEMA_CREATE_PROVISIONED_MODEL_THROUGHPUT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrock#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#TooManyTagsException"): TooManyTagsException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_TOO_MANY_TAGS_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteProvisionedModelThroughputInput: - """Dataclass for DeleteProvisionedModelThroughputInput structure.""" - - provisioned_model_id: str | None = None - """The Amazon Resource Name (ARN) or name of the Provisioned Throughput.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_PROVISIONED_MODEL_THROUGHPUT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.provisioned_model_id is not None: - serializer.write_string( - _SCHEMA_DELETE_PROVISIONED_MODEL_THROUGHPUT_INPUT.members[ - "provisionedModelId" - ], - self.provisioned_model_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["provisioned_model_id"] = de.read_string( - _SCHEMA_DELETE_PROVISIONED_MODEL_THROUGHPUT_INPUT.members[ - "provisionedModelId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_PROVISIONED_MODEL_THROUGHPUT_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteProvisionedModelThroughputOutput: - """Dataclass for DeleteProvisionedModelThroughputOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DELETE_PROVISIONED_MODEL_THROUGHPUT_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_PROVISIONED_MODEL_THROUGHPUT_OUTPUT, consumer=_consumer - ) - return kwargs - - -DELETE_PROVISIONED_MODEL_THROUGHPUT = APIOperation( - input=DeleteProvisionedModelThroughputInput, - output=DeleteProvisionedModelThroughputOutput, - schema=_SCHEMA_DELETE_PROVISIONED_MODEL_THROUGHPUT, - input_schema=_SCHEMA_DELETE_PROVISIONED_MODEL_THROUGHPUT_INPUT, - output_schema=_SCHEMA_DELETE_PROVISIONED_MODEL_THROUGHPUT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrock#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetProvisionedModelThroughputInput: - """Dataclass for GetProvisionedModelThroughputInput structure.""" - - provisioned_model_id: str | None = None - """The Amazon Resource Name (ARN) or name of the Provisioned Throughput.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_PROVISIONED_MODEL_THROUGHPUT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.provisioned_model_id is not None: - serializer.write_string( - _SCHEMA_GET_PROVISIONED_MODEL_THROUGHPUT_INPUT.members[ - "provisionedModelId" - ], - self.provisioned_model_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["provisioned_model_id"] = de.read_string( - _SCHEMA_GET_PROVISIONED_MODEL_THROUGHPUT_INPUT.members[ - "provisionedModelId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_PROVISIONED_MODEL_THROUGHPUT_INPUT, consumer=_consumer - ) - return kwargs - - -class ProvisionedModelStatus(UnknownEnumMixin, StrEnum): - CREATING = "Creating" - IN_SERVICE = "InService" - UPDATING = "Updating" - FAILED = "Failed" - - -@dataclass(kw_only=True) -class GetProvisionedModelThroughputOutput: - """Dataclass for GetProvisionedModelThroughputOutput structure.""" - - model_units: int - """The number of model units allocated to this Provisioned Throughput.""" - - desired_model_units: int - """ - The number of model units that was requested for this Provisioned - Throughput. - """ - - provisioned_model_name: str - """The name of the Provisioned Throughput.""" - - provisioned_model_arn: str - """The Amazon Resource Name (ARN) of the Provisioned Throughput.""" - - model_arn: str - """ - The Amazon Resource Name (ARN) of the model associated with this - Provisioned Throughput. - """ - - desired_model_arn: str - """ - The Amazon Resource Name (ARN) of the model requested to be associated - to this Provisioned Throughput. This value differs from the `modelArn` - if updating hasn't completed. - """ - - foundation_model_arn: str - """ - The Amazon Resource Name (ARN) of the base model for which the - Provisioned Throughput was created, or of the base model that the custom - model for which the Provisioned Throughput was created was customized. - """ - - status: str - """The status of the Provisioned Throughput.""" - - creation_time: datetime - """The timestamp of the creation time for this Provisioned Throughput.""" - - last_modified_time: datetime - """ - The timestamp of the last time that this Provisioned Throughput was - modified. - """ - - failure_message: str | None = None - """ - A failure message for any issues that occurred during creation, - updating, or deletion of the Provisioned Throughput. - """ - - commitment_duration: str | None = None - """Commitment duration of the Provisioned Throughput.""" - - commitment_expiration_time: datetime | None = None - """ - The timestamp for when the commitment term for the Provisioned - Throughput expires. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_PROVISIONED_MODEL_THROUGHPUT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer( - _SCHEMA_GET_PROVISIONED_MODEL_THROUGHPUT_OUTPUT.members["modelUnits"], - self.model_units, - ) - serializer.write_integer( - _SCHEMA_GET_PROVISIONED_MODEL_THROUGHPUT_OUTPUT.members[ - "desiredModelUnits" - ], - self.desired_model_units, - ) - serializer.write_string( - _SCHEMA_GET_PROVISIONED_MODEL_THROUGHPUT_OUTPUT.members[ - "provisionedModelName" - ], - self.provisioned_model_name, - ) - serializer.write_string( - _SCHEMA_GET_PROVISIONED_MODEL_THROUGHPUT_OUTPUT.members[ - "provisionedModelArn" - ], - self.provisioned_model_arn, - ) - serializer.write_string( - _SCHEMA_GET_PROVISIONED_MODEL_THROUGHPUT_OUTPUT.members["modelArn"], - self.model_arn, - ) - serializer.write_string( - _SCHEMA_GET_PROVISIONED_MODEL_THROUGHPUT_OUTPUT.members["desiredModelArn"], - self.desired_model_arn, - ) - serializer.write_string( - _SCHEMA_GET_PROVISIONED_MODEL_THROUGHPUT_OUTPUT.members[ - "foundationModelArn" - ], - self.foundation_model_arn, - ) - serializer.write_string( - _SCHEMA_GET_PROVISIONED_MODEL_THROUGHPUT_OUTPUT.members["status"], - self.status, - ) - serializer.write_timestamp( - _SCHEMA_GET_PROVISIONED_MODEL_THROUGHPUT_OUTPUT.members["creationTime"], - self.creation_time, - ) - serializer.write_timestamp( - _SCHEMA_GET_PROVISIONED_MODEL_THROUGHPUT_OUTPUT.members["lastModifiedTime"], - self.last_modified_time, - ) - if self.failure_message is not None: - serializer.write_string( - _SCHEMA_GET_PROVISIONED_MODEL_THROUGHPUT_OUTPUT.members[ - "failureMessage" - ], - self.failure_message, - ) - - if self.commitment_duration is not None: - serializer.write_string( - _SCHEMA_GET_PROVISIONED_MODEL_THROUGHPUT_OUTPUT.members[ - "commitmentDuration" - ], - self.commitment_duration, - ) - - if self.commitment_expiration_time is not None: - serializer.write_timestamp( - _SCHEMA_GET_PROVISIONED_MODEL_THROUGHPUT_OUTPUT.members[ - "commitmentExpirationTime" - ], - self.commitment_expiration_time, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_units"] = de.read_integer( - _SCHEMA_GET_PROVISIONED_MODEL_THROUGHPUT_OUTPUT.members[ - "modelUnits" - ] - ) - - case 1: - kwargs["desired_model_units"] = de.read_integer( - _SCHEMA_GET_PROVISIONED_MODEL_THROUGHPUT_OUTPUT.members[ - "desiredModelUnits" - ] - ) - - case 2: - kwargs["provisioned_model_name"] = de.read_string( - _SCHEMA_GET_PROVISIONED_MODEL_THROUGHPUT_OUTPUT.members[ - "provisionedModelName" - ] - ) - - case 3: - kwargs["provisioned_model_arn"] = de.read_string( - _SCHEMA_GET_PROVISIONED_MODEL_THROUGHPUT_OUTPUT.members[ - "provisionedModelArn" - ] - ) - - case 4: - kwargs["model_arn"] = de.read_string( - _SCHEMA_GET_PROVISIONED_MODEL_THROUGHPUT_OUTPUT.members[ - "modelArn" - ] - ) - - case 5: - kwargs["desired_model_arn"] = de.read_string( - _SCHEMA_GET_PROVISIONED_MODEL_THROUGHPUT_OUTPUT.members[ - "desiredModelArn" - ] - ) - - case 6: - kwargs["foundation_model_arn"] = de.read_string( - _SCHEMA_GET_PROVISIONED_MODEL_THROUGHPUT_OUTPUT.members[ - "foundationModelArn" - ] - ) - - case 7: - kwargs["status"] = ProvisionedModelStatus( - de.read_string( - _SCHEMA_GET_PROVISIONED_MODEL_THROUGHPUT_OUTPUT.members[ - "status" - ] - ) - ) - - case 8: - kwargs["creation_time"] = de.read_timestamp( - _SCHEMA_GET_PROVISIONED_MODEL_THROUGHPUT_OUTPUT.members[ - "creationTime" - ] - ) - - case 9: - kwargs["last_modified_time"] = de.read_timestamp( - _SCHEMA_GET_PROVISIONED_MODEL_THROUGHPUT_OUTPUT.members[ - "lastModifiedTime" - ] - ) - - case 10: - kwargs["failure_message"] = de.read_string( - _SCHEMA_GET_PROVISIONED_MODEL_THROUGHPUT_OUTPUT.members[ - "failureMessage" - ] - ) - - case 11: - kwargs["commitment_duration"] = CommitmentDuration( - de.read_string( - _SCHEMA_GET_PROVISIONED_MODEL_THROUGHPUT_OUTPUT.members[ - "commitmentDuration" - ] - ) - ) - - case 12: - kwargs["commitment_expiration_time"] = de.read_timestamp( - _SCHEMA_GET_PROVISIONED_MODEL_THROUGHPUT_OUTPUT.members[ - "commitmentExpirationTime" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_PROVISIONED_MODEL_THROUGHPUT_OUTPUT, consumer=_consumer - ) - if "model_units" not in kwargs: - kwargs["model_units"] = 0 - if "desired_model_units" not in kwargs: - kwargs["desired_model_units"] = 0 - if "provisioned_model_name" not in kwargs: - kwargs["provisioned_model_name"] = "" - if "provisioned_model_arn" not in kwargs: - kwargs["provisioned_model_arn"] = "" - if "model_arn" not in kwargs: - kwargs["model_arn"] = "" - if "desired_model_arn" not in kwargs: - kwargs["desired_model_arn"] = "" - if "foundation_model_arn" not in kwargs: - kwargs["foundation_model_arn"] = "" - if "status" not in kwargs: - kwargs["status"] = ProvisionedModelStatus._corrected("") - if "creation_time" not in kwargs: - kwargs["creation_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "last_modified_time" not in kwargs: - kwargs["last_modified_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -GET_PROVISIONED_MODEL_THROUGHPUT = APIOperation( - input=GetProvisionedModelThroughputInput, - output=GetProvisionedModelThroughputOutput, - schema=_SCHEMA_GET_PROVISIONED_MODEL_THROUGHPUT, - input_schema=_SCHEMA_GET_PROVISIONED_MODEL_THROUGHPUT_INPUT, - output_schema=_SCHEMA_GET_PROVISIONED_MODEL_THROUGHPUT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class SortByProvisionedModels(UnknownEnumMixin, StrEnum): - CREATION_TIME = "CreationTime" - - -@dataclass(kw_only=True) -class ListProvisionedModelThroughputsInput: - """Dataclass for ListProvisionedModelThroughputsInput structure.""" - - creation_time_after: datetime | None = None - """ - A filter that returns Provisioned Throughputs created after the - specified time. - """ - - creation_time_before: datetime | None = None - """ - A filter that returns Provisioned Throughputs created before the - specified time. - """ - - status_equals: str | None = None - """ - A filter that returns Provisioned Throughputs if their statuses matches - the value that you specify. - """ - - model_arn_equals: str | None = None - """ - A filter that returns Provisioned Throughputs whose model Amazon - Resource Name (ARN) is equal to the value that you specify. - """ - - name_contains: str | None = None - """ - A filter that returns Provisioned Throughputs if their name contains the - expression that you specify. - """ - - max_results: int | None = None - """ - THe maximum number of results to return in the response. If there are - more results than the number you specified, the response returns a - `nextToken` value. To see the next batch of results, send the - `nextToken` value in another list request. - """ - - next_token: str | None = None - """ - If there are more results than the number you specified in the - `maxResults` field, the response returns a `nextToken` value. To see the - next batch of results, specify the `nextToken` value in this field. - """ - - sort_by: str | None = None - """The field by which to sort the returned list of Provisioned Throughputs.""" - - sort_order: str | None = None - """The sort order of the results.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_PROVISIONED_MODEL_THROUGHPUTS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.creation_time_after is not None: - serializer.write_timestamp( - _SCHEMA_LIST_PROVISIONED_MODEL_THROUGHPUTS_INPUT.members[ - "creationTimeAfter" - ], - self.creation_time_after, - ) - - if self.creation_time_before is not None: - serializer.write_timestamp( - _SCHEMA_LIST_PROVISIONED_MODEL_THROUGHPUTS_INPUT.members[ - "creationTimeBefore" - ], - self.creation_time_before, - ) - - if self.status_equals is not None: - serializer.write_string( - _SCHEMA_LIST_PROVISIONED_MODEL_THROUGHPUTS_INPUT.members[ - "statusEquals" - ], - self.status_equals, - ) - - if self.model_arn_equals is not None: - serializer.write_string( - _SCHEMA_LIST_PROVISIONED_MODEL_THROUGHPUTS_INPUT.members[ - "modelArnEquals" - ], - self.model_arn_equals, - ) - - if self.name_contains is not None: - serializer.write_string( - _SCHEMA_LIST_PROVISIONED_MODEL_THROUGHPUTS_INPUT.members[ - "nameContains" - ], - self.name_contains, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_PROVISIONED_MODEL_THROUGHPUTS_INPUT.members["maxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_PROVISIONED_MODEL_THROUGHPUTS_INPUT.members["nextToken"], - self.next_token, - ) - - if self.sort_by is not None: - serializer.write_string( - _SCHEMA_LIST_PROVISIONED_MODEL_THROUGHPUTS_INPUT.members["sortBy"], - self.sort_by, - ) - - if self.sort_order is not None: - serializer.write_string( - _SCHEMA_LIST_PROVISIONED_MODEL_THROUGHPUTS_INPUT.members["sortOrder"], - self.sort_order, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["creation_time_after"] = de.read_timestamp( - _SCHEMA_LIST_PROVISIONED_MODEL_THROUGHPUTS_INPUT.members[ - "creationTimeAfter" - ] - ) - - case 1: - kwargs["creation_time_before"] = de.read_timestamp( - _SCHEMA_LIST_PROVISIONED_MODEL_THROUGHPUTS_INPUT.members[ - "creationTimeBefore" - ] - ) - - case 2: - kwargs["status_equals"] = ProvisionedModelStatus( - de.read_string( - _SCHEMA_LIST_PROVISIONED_MODEL_THROUGHPUTS_INPUT.members[ - "statusEquals" - ] - ) - ) - - case 3: - kwargs["model_arn_equals"] = de.read_string( - _SCHEMA_LIST_PROVISIONED_MODEL_THROUGHPUTS_INPUT.members[ - "modelArnEquals" - ] - ) - - case 4: - kwargs["name_contains"] = de.read_string( - _SCHEMA_LIST_PROVISIONED_MODEL_THROUGHPUTS_INPUT.members[ - "nameContains" - ] - ) - - case 5: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_PROVISIONED_MODEL_THROUGHPUTS_INPUT.members[ - "maxResults" - ] - ) - - case 6: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_PROVISIONED_MODEL_THROUGHPUTS_INPUT.members[ - "nextToken" - ] - ) - - case 7: - kwargs["sort_by"] = SortByProvisionedModels( - de.read_string( - _SCHEMA_LIST_PROVISIONED_MODEL_THROUGHPUTS_INPUT.members[ - "sortBy" - ] - ) - ) - - case 8: - kwargs["sort_order"] = SortOrder( - de.read_string( - _SCHEMA_LIST_PROVISIONED_MODEL_THROUGHPUTS_INPUT.members[ - "sortOrder" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_PROVISIONED_MODEL_THROUGHPUTS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ProvisionedModelSummary: - """ - A summary of information about a Provisioned Throughput. - - This data type is used in the following API operations: - - - [ListProvisionedThroughputs - response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_ListProvisionedModelThroughputs.html#API_ListProvisionedModelThroughputs_ResponseSyntax) - """ - - provisioned_model_name: str - """The name of the Provisioned Throughput.""" - - provisioned_model_arn: str - """The Amazon Resource Name (ARN) of the Provisioned Throughput.""" - - model_arn: str - """ - The Amazon Resource Name (ARN) of the model associated with the - Provisioned Throughput. - """ - - desired_model_arn: str - """ - The Amazon Resource Name (ARN) of the model requested to be associated - to this Provisioned Throughput. This value differs from the `modelArn` - if updating hasn't completed. - """ - - foundation_model_arn: str - """ - The Amazon Resource Name (ARN) of the base model for which the - Provisioned Throughput was created, or of the base model that the custom - model for which the Provisioned Throughput was created was customized. - """ - - model_units: int - """The number of model units allocated to the Provisioned Throughput.""" - - desired_model_units: int - """ - The number of model units that was requested to be allocated to the - Provisioned Throughput. - """ - - status: str - """The status of the Provisioned Throughput.""" - - creation_time: datetime - """The time that the Provisioned Throughput was created.""" - - last_modified_time: datetime - """The time that the Provisioned Throughput was last modified.""" - - commitment_duration: str | None = None - """The duration for which the Provisioned Throughput was committed.""" - - commitment_expiration_time: datetime | None = None - """ - The timestamp for when the commitment term of the Provisioned Throughput - expires. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PROVISIONED_MODEL_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_PROVISIONED_MODEL_SUMMARY.members["provisionedModelName"], - self.provisioned_model_name, - ) - serializer.write_string( - _SCHEMA_PROVISIONED_MODEL_SUMMARY.members["provisionedModelArn"], - self.provisioned_model_arn, - ) - serializer.write_string( - _SCHEMA_PROVISIONED_MODEL_SUMMARY.members["modelArn"], self.model_arn - ) - serializer.write_string( - _SCHEMA_PROVISIONED_MODEL_SUMMARY.members["desiredModelArn"], - self.desired_model_arn, - ) - serializer.write_string( - _SCHEMA_PROVISIONED_MODEL_SUMMARY.members["foundationModelArn"], - self.foundation_model_arn, - ) - serializer.write_integer( - _SCHEMA_PROVISIONED_MODEL_SUMMARY.members["modelUnits"], self.model_units - ) - serializer.write_integer( - _SCHEMA_PROVISIONED_MODEL_SUMMARY.members["desiredModelUnits"], - self.desired_model_units, - ) - serializer.write_string( - _SCHEMA_PROVISIONED_MODEL_SUMMARY.members["status"], self.status - ) - if self.commitment_duration is not None: - serializer.write_string( - _SCHEMA_PROVISIONED_MODEL_SUMMARY.members["commitmentDuration"], - self.commitment_duration, - ) - - if self.commitment_expiration_time is not None: - serializer.write_timestamp( - _SCHEMA_PROVISIONED_MODEL_SUMMARY.members["commitmentExpirationTime"], - self.commitment_expiration_time, - ) - - serializer.write_timestamp( - _SCHEMA_PROVISIONED_MODEL_SUMMARY.members["creationTime"], - self.creation_time, - ) - serializer.write_timestamp( - _SCHEMA_PROVISIONED_MODEL_SUMMARY.members["lastModifiedTime"], - self.last_modified_time, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["provisioned_model_name"] = de.read_string( - _SCHEMA_PROVISIONED_MODEL_SUMMARY.members[ - "provisionedModelName" - ] - ) - - case 1: - kwargs["provisioned_model_arn"] = de.read_string( - _SCHEMA_PROVISIONED_MODEL_SUMMARY.members["provisionedModelArn"] - ) - - case 2: - kwargs["model_arn"] = de.read_string( - _SCHEMA_PROVISIONED_MODEL_SUMMARY.members["modelArn"] - ) - - case 3: - kwargs["desired_model_arn"] = de.read_string( - _SCHEMA_PROVISIONED_MODEL_SUMMARY.members["desiredModelArn"] - ) - - case 4: - kwargs["foundation_model_arn"] = de.read_string( - _SCHEMA_PROVISIONED_MODEL_SUMMARY.members["foundationModelArn"] - ) - - case 5: - kwargs["model_units"] = de.read_integer( - _SCHEMA_PROVISIONED_MODEL_SUMMARY.members["modelUnits"] - ) - - case 6: - kwargs["desired_model_units"] = de.read_integer( - _SCHEMA_PROVISIONED_MODEL_SUMMARY.members["desiredModelUnits"] - ) - - case 7: - kwargs["status"] = ProvisionedModelStatus( - de.read_string( - _SCHEMA_PROVISIONED_MODEL_SUMMARY.members["status"] - ) - ) - - case 8: - kwargs["commitment_duration"] = CommitmentDuration( - de.read_string( - _SCHEMA_PROVISIONED_MODEL_SUMMARY.members[ - "commitmentDuration" - ] - ) - ) - - case 9: - kwargs["commitment_expiration_time"] = de.read_timestamp( - _SCHEMA_PROVISIONED_MODEL_SUMMARY.members[ - "commitmentExpirationTime" - ] - ) - - case 10: - kwargs["creation_time"] = de.read_timestamp( - _SCHEMA_PROVISIONED_MODEL_SUMMARY.members["creationTime"] - ) - - case 11: - kwargs["last_modified_time"] = de.read_timestamp( - _SCHEMA_PROVISIONED_MODEL_SUMMARY.members["lastModifiedTime"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PROVISIONED_MODEL_SUMMARY, consumer=_consumer) - if "provisioned_model_name" not in kwargs: - kwargs["provisioned_model_name"] = "" - if "provisioned_model_arn" not in kwargs: - kwargs["provisioned_model_arn"] = "" - if "model_arn" not in kwargs: - kwargs["model_arn"] = "" - if "desired_model_arn" not in kwargs: - kwargs["desired_model_arn"] = "" - if "foundation_model_arn" not in kwargs: - kwargs["foundation_model_arn"] = "" - if "model_units" not in kwargs: - kwargs["model_units"] = 0 - if "desired_model_units" not in kwargs: - kwargs["desired_model_units"] = 0 - if "status" not in kwargs: - kwargs["status"] = ProvisionedModelStatus._corrected("") - if "creation_time" not in kwargs: - kwargs["creation_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "last_modified_time" not in kwargs: - kwargs["last_modified_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_provisioned_model_summaries( - serializer: ShapeSerializer, schema: Schema, value: list[ProvisionedModelSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_provisioned_model_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ProvisionedModelSummary]: - result: list[ProvisionedModelSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ProvisionedModelSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListProvisionedModelThroughputsOutput: - """Dataclass for ListProvisionedModelThroughputsOutput structure.""" - - next_token: str | None = None - """ - If there are more results than the number you specified in the - `maxResults` field, this value is returned. To see the next batch of - results, include this value in the `nextToken` field in another list - request. - """ - - provisioned_model_summaries: list[ProvisionedModelSummary] | None = None - """ - A list of summaries, one for each Provisioned Throughput in the - response. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_PROVISIONED_MODEL_THROUGHPUTS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_PROVISIONED_MODEL_THROUGHPUTS_OUTPUT.members["nextToken"], - self.next_token, - ) - - if self.provisioned_model_summaries is not None: - _serialize_provisioned_model_summaries( - serializer, - _SCHEMA_LIST_PROVISIONED_MODEL_THROUGHPUTS_OUTPUT.members[ - "provisionedModelSummaries" - ], - self.provisioned_model_summaries, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_PROVISIONED_MODEL_THROUGHPUTS_OUTPUT.members[ - "nextToken" - ] - ) - - case 1: - kwargs["provisioned_model_summaries"] = ( - _deserialize_provisioned_model_summaries( - de, - _SCHEMA_LIST_PROVISIONED_MODEL_THROUGHPUTS_OUTPUT.members[ - "provisionedModelSummaries" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_PROVISIONED_MODEL_THROUGHPUTS_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_PROVISIONED_MODEL_THROUGHPUTS = APIOperation( - input=ListProvisionedModelThroughputsInput, - output=ListProvisionedModelThroughputsOutput, - schema=_SCHEMA_LIST_PROVISIONED_MODEL_THROUGHPUTS, - input_schema=_SCHEMA_LIST_PROVISIONED_MODEL_THROUGHPUTS_INPUT, - output_schema=_SCHEMA_LIST_PROVISIONED_MODEL_THROUGHPUTS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateProvisionedModelThroughputInput: - """Dataclass for UpdateProvisionedModelThroughputInput structure.""" - - provisioned_model_id: str | None = None - """ - The Amazon Resource Name (ARN) or name of the Provisioned Throughput to - update. - """ - - desired_provisioned_model_name: str | None = None - """The new name for this Provisioned Throughput.""" - - desired_model_id: str | None = None - """ - The Amazon Resource Name (ARN) of the new model to associate with this - Provisioned Throughput. You can't specify this field if this - Provisioned Throughput is associated with a base model. - - If this Provisioned Throughput is associated with a custom model, you - can specify one of the following options: - - - The base model from which the custom model was customized. - - - Another custom model that was customized from the same base model as - the custom model. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_PROVISIONED_MODEL_THROUGHPUT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.provisioned_model_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_PROVISIONED_MODEL_THROUGHPUT_INPUT.members[ - "provisionedModelId" - ], - self.provisioned_model_id, - ) - - if self.desired_provisioned_model_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_PROVISIONED_MODEL_THROUGHPUT_INPUT.members[ - "desiredProvisionedModelName" - ], - self.desired_provisioned_model_name, - ) - - if self.desired_model_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_PROVISIONED_MODEL_THROUGHPUT_INPUT.members[ - "desiredModelId" - ], - self.desired_model_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["provisioned_model_id"] = de.read_string( - _SCHEMA_UPDATE_PROVISIONED_MODEL_THROUGHPUT_INPUT.members[ - "provisionedModelId" - ] - ) - - case 1: - kwargs["desired_provisioned_model_name"] = de.read_string( - _SCHEMA_UPDATE_PROVISIONED_MODEL_THROUGHPUT_INPUT.members[ - "desiredProvisionedModelName" - ] - ) - - case 2: - kwargs["desired_model_id"] = de.read_string( - _SCHEMA_UPDATE_PROVISIONED_MODEL_THROUGHPUT_INPUT.members[ - "desiredModelId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_PROVISIONED_MODEL_THROUGHPUT_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateProvisionedModelThroughputOutput: - """Dataclass for UpdateProvisionedModelThroughputOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_UPDATE_PROVISIONED_MODEL_THROUGHPUT_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_PROVISIONED_MODEL_THROUGHPUT_OUTPUT, consumer=_consumer - ) - return kwargs - - -UPDATE_PROVISIONED_MODEL_THROUGHPUT = APIOperation( - input=UpdateProvisionedModelThroughputInput, - output=UpdateProvisionedModelThroughputOutput, - schema=_SCHEMA_UPDATE_PROVISIONED_MODEL_THROUGHPUT, - input_schema=_SCHEMA_UPDATE_PROVISIONED_MODEL_THROUGHPUT_INPUT, - output_schema=_SCHEMA_UPDATE_PROVISIONED_MODEL_THROUGHPUT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteResourcePolicyInput: - """Dataclass for DeleteResourcePolicyInput structure.""" - - resource_arn: str | None = None - """The ARN of the Bedrock resource to which this resource policy applies.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_RESOURCE_POLICY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_DELETE_RESOURCE_POLICY_INPUT.members["resourceArn"], - self.resource_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_DELETE_RESOURCE_POLICY_INPUT.members["resourceArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_RESOURCE_POLICY_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteResourcePolicyOutput: - """Dataclass for DeleteResourcePolicyOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_RESOURCE_POLICY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_RESOURCE_POLICY_OUTPUT, consumer=_consumer - ) - return kwargs - - -DELETE_RESOURCE_POLICY = APIOperation( - input=DeleteResourcePolicyInput, - output=DeleteResourcePolicyOutput, - schema=_SCHEMA_DELETE_RESOURCE_POLICY, - input_schema=_SCHEMA_DELETE_RESOURCE_POLICY_INPUT, - output_schema=_SCHEMA_DELETE_RESOURCE_POLICY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetResourcePolicyInput: - """Dataclass for GetResourcePolicyInput structure.""" - - resource_arn: str | None = None - """The ARN of the Bedrock resource to which this resource policy applies.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_RESOURCE_POLICY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_GET_RESOURCE_POLICY_INPUT.members["resourceArn"], - self.resource_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_GET_RESOURCE_POLICY_INPUT.members["resourceArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_RESOURCE_POLICY_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetResourcePolicyOutput: - """Dataclass for GetResourcePolicyOutput structure.""" - - resource_policy: str | None = None - """The JSON string representing the Bedrock resource policy.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_RESOURCE_POLICY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_policy is not None: - serializer.write_string( - _SCHEMA_GET_RESOURCE_POLICY_OUTPUT.members["resourcePolicy"], - self.resource_policy, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_policy"] = de.read_string( - _SCHEMA_GET_RESOURCE_POLICY_OUTPUT.members["resourcePolicy"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_RESOURCE_POLICY_OUTPUT, consumer=_consumer) - return kwargs - - -GET_RESOURCE_POLICY = APIOperation( - input=GetResourcePolicyInput, - output=GetResourcePolicyOutput, - schema=_SCHEMA_GET_RESOURCE_POLICY, - input_schema=_SCHEMA_GET_RESOURCE_POLICY_INPUT, - output_schema=_SCHEMA_GET_RESOURCE_POLICY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class PutResourcePolicyInput: - """Dataclass for PutResourcePolicyInput structure.""" - - resource_arn: str | None = None - """The ARN of the Bedrock resource to which this resource policy applies.""" - - resource_policy: str | None = None - """The JSON string representing the Bedrock resource policy.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_RESOURCE_POLICY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_PUT_RESOURCE_POLICY_INPUT.members["resourceArn"], - self.resource_arn, - ) - - if self.resource_policy is not None: - serializer.write_string( - _SCHEMA_PUT_RESOURCE_POLICY_INPUT.members["resourcePolicy"], - self.resource_policy, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_PUT_RESOURCE_POLICY_INPUT.members["resourceArn"] - ) - - case 1: - kwargs["resource_policy"] = de.read_string( - _SCHEMA_PUT_RESOURCE_POLICY_INPUT.members["resourcePolicy"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUT_RESOURCE_POLICY_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class PutResourcePolicyOutput: - """Dataclass for PutResourcePolicyOutput structure.""" - - resource_arn: str | None = None - """The ARN of the Bedrock resource to which this resource policy applies.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_RESOURCE_POLICY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_PUT_RESOURCE_POLICY_OUTPUT.members["resourceArn"], - self.resource_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_PUT_RESOURCE_POLICY_OUTPUT.members["resourceArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUT_RESOURCE_POLICY_OUTPUT, consumer=_consumer) - return kwargs - - -PUT_RESOURCE_POLICY = APIOperation( - input=PutResourcePolicyInput, - output=PutResourcePolicyOutput, - schema=_SCHEMA_PUT_RESOURCE_POLICY, - input_schema=_SCHEMA_PUT_RESOURCE_POLICY_INPUT, - output_schema=_SCHEMA_PUT_RESOURCE_POLICY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrock#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class CreateFoundationModelAgreementInput: - """Dataclass for CreateFoundationModelAgreementInput structure.""" - - offer_token: str | None = None - """An offer token encapsulates the information for an offer.""" - - model_id: str | None = None - """Model Id of the model for the access request.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_FOUNDATION_MODEL_AGREEMENT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.offer_token is not None: - serializer.write_string( - _SCHEMA_CREATE_FOUNDATION_MODEL_AGREEMENT_INPUT.members["offerToken"], - self.offer_token, - ) - - if self.model_id is not None: - serializer.write_string( - _SCHEMA_CREATE_FOUNDATION_MODEL_AGREEMENT_INPUT.members["modelId"], - self.model_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["offer_token"] = de.read_string( - _SCHEMA_CREATE_FOUNDATION_MODEL_AGREEMENT_INPUT.members[ - "offerToken" - ] - ) - - case 1: - kwargs["model_id"] = de.read_string( - _SCHEMA_CREATE_FOUNDATION_MODEL_AGREEMENT_INPUT.members[ - "modelId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_FOUNDATION_MODEL_AGREEMENT_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CreateFoundationModelAgreementOutput: - """Dataclass for CreateFoundationModelAgreementOutput structure.""" - - model_id: str - """Model Id of the model for the access request.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_FOUNDATION_MODEL_AGREEMENT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_FOUNDATION_MODEL_AGREEMENT_OUTPUT.members["modelId"], - self.model_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_id"] = de.read_string( - _SCHEMA_CREATE_FOUNDATION_MODEL_AGREEMENT_OUTPUT.members[ - "modelId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_FOUNDATION_MODEL_AGREEMENT_OUTPUT, consumer=_consumer - ) - if "model_id" not in kwargs: - kwargs["model_id"] = "" - return kwargs - - -CREATE_FOUNDATION_MODEL_AGREEMENT = APIOperation( - input=CreateFoundationModelAgreementInput, - output=CreateFoundationModelAgreementOutput, - schema=_SCHEMA_CREATE_FOUNDATION_MODEL_AGREEMENT, - input_schema=_SCHEMA_CREATE_FOUNDATION_MODEL_AGREEMENT_INPUT, - output_schema=_SCHEMA_CREATE_FOUNDATION_MODEL_AGREEMENT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrock#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteFoundationModelAgreementInput: - """Dataclass for DeleteFoundationModelAgreementInput structure.""" - - model_id: str | None = None - """Model Id of the model access to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_FOUNDATION_MODEL_AGREEMENT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.model_id is not None: - serializer.write_string( - _SCHEMA_DELETE_FOUNDATION_MODEL_AGREEMENT_INPUT.members["modelId"], - self.model_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_id"] = de.read_string( - _SCHEMA_DELETE_FOUNDATION_MODEL_AGREEMENT_INPUT.members[ - "modelId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_FOUNDATION_MODEL_AGREEMENT_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteFoundationModelAgreementOutput: - """Dataclass for DeleteFoundationModelAgreementOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_FOUNDATION_MODEL_AGREEMENT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_FOUNDATION_MODEL_AGREEMENT_OUTPUT, consumer=_consumer - ) - return kwargs - - -DELETE_FOUNDATION_MODEL_AGREEMENT = APIOperation( - input=DeleteFoundationModelAgreementInput, - output=DeleteFoundationModelAgreementOutput, - schema=_SCHEMA_DELETE_FOUNDATION_MODEL_AGREEMENT, - input_schema=_SCHEMA_DELETE_FOUNDATION_MODEL_AGREEMENT_INPUT, - output_schema=_SCHEMA_DELETE_FOUNDATION_MODEL_AGREEMENT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrock#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetFoundationModelAvailabilityInput: - """Dataclass for GetFoundationModelAvailabilityInput structure.""" - - model_id: str | None = None - """The model Id of the foundation model.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_FOUNDATION_MODEL_AVAILABILITY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.model_id is not None: - serializer.write_string( - _SCHEMA_GET_FOUNDATION_MODEL_AVAILABILITY_INPUT.members["modelId"], - self.model_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_id"] = de.read_string( - _SCHEMA_GET_FOUNDATION_MODEL_AVAILABILITY_INPUT.members[ - "modelId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_FOUNDATION_MODEL_AVAILABILITY_INPUT, consumer=_consumer - ) - return kwargs - - -class AuthorizationStatus(UnknownEnumMixin, StrEnum): - AUTHORIZED = "AUTHORIZED" - NOT_AUTHORIZED = "NOT_AUTHORIZED" - - -class EntitlementAvailability(UnknownEnumMixin, StrEnum): - AVAILABLE = "AVAILABLE" - NOT_AVAILABLE = "NOT_AVAILABLE" - - -class RegionAvailability(UnknownEnumMixin, StrEnum): - AVAILABLE = "AVAILABLE" - NOT_AVAILABLE = "NOT_AVAILABLE" - - -@dataclass(kw_only=True) -class GetFoundationModelAvailabilityOutput: - """Dataclass for GetFoundationModelAvailabilityOutput structure.""" - - model_id: str - """The model Id of the foundation model.""" - - agreement_availability: AgreementAvailability - """Agreement availability.""" - - authorization_status: str - """Authorization status.""" - - entitlement_availability: str - """Entitlement availability.""" - - region_availability: str - """Region availability.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_FOUNDATION_MODEL_AVAILABILITY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_FOUNDATION_MODEL_AVAILABILITY_OUTPUT.members["modelId"], - self.model_id, - ) - serializer.write_struct( - _SCHEMA_GET_FOUNDATION_MODEL_AVAILABILITY_OUTPUT.members[ - "agreementAvailability" - ], - self.agreement_availability, - ) - serializer.write_string( - _SCHEMA_GET_FOUNDATION_MODEL_AVAILABILITY_OUTPUT.members[ - "authorizationStatus" - ], - self.authorization_status, - ) - serializer.write_string( - _SCHEMA_GET_FOUNDATION_MODEL_AVAILABILITY_OUTPUT.members[ - "entitlementAvailability" - ], - self.entitlement_availability, - ) - serializer.write_string( - _SCHEMA_GET_FOUNDATION_MODEL_AVAILABILITY_OUTPUT.members[ - "regionAvailability" - ], - self.region_availability, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_id"] = de.read_string( - _SCHEMA_GET_FOUNDATION_MODEL_AVAILABILITY_OUTPUT.members[ - "modelId" - ] - ) - - case 1: - kwargs["agreement_availability"] = ( - AgreementAvailability.deserialize(de) - ) - - case 2: - kwargs["authorization_status"] = AuthorizationStatus( - de.read_string( - _SCHEMA_GET_FOUNDATION_MODEL_AVAILABILITY_OUTPUT.members[ - "authorizationStatus" - ] - ) - ) - - case 3: - kwargs["entitlement_availability"] = EntitlementAvailability( - de.read_string( - _SCHEMA_GET_FOUNDATION_MODEL_AVAILABILITY_OUTPUT.members[ - "entitlementAvailability" - ] - ) - ) - - case 4: - kwargs["region_availability"] = RegionAvailability( - de.read_string( - _SCHEMA_GET_FOUNDATION_MODEL_AVAILABILITY_OUTPUT.members[ - "regionAvailability" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_FOUNDATION_MODEL_AVAILABILITY_OUTPUT, consumer=_consumer - ) - if "model_id" not in kwargs: - kwargs["model_id"] = "" - if "agreement_availability" not in kwargs: - kwargs["agreement_availability"] = AgreementAvailability._smithy_default() - if "authorization_status" not in kwargs: - kwargs["authorization_status"] = AuthorizationStatus._corrected("") - if "entitlement_availability" not in kwargs: - kwargs["entitlement_availability"] = EntitlementAvailability._corrected("") - if "region_availability" not in kwargs: - kwargs["region_availability"] = RegionAvailability._corrected("") - return kwargs - - -GET_FOUNDATION_MODEL_AVAILABILITY = APIOperation( - input=GetFoundationModelAvailabilityInput, - output=GetFoundationModelAvailabilityOutput, - schema=_SCHEMA_GET_FOUNDATION_MODEL_AVAILABILITY, - input_schema=_SCHEMA_GET_FOUNDATION_MODEL_AVAILABILITY_INPUT, - output_schema=_SCHEMA_GET_FOUNDATION_MODEL_AVAILABILITY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class OfferType(UnknownEnumMixin, StrEnum): - ALL = "ALL" - PUBLIC = "PUBLIC" - - -@dataclass(kw_only=True) -class ListFoundationModelAgreementOffersInput: - """Dataclass for ListFoundationModelAgreementOffersInput structure.""" - - model_id: str | None = None - """Model Id of the foundation model.""" - - offer_type: str | None = None - """Type of offer associated with the model.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_LIST_FOUNDATION_MODEL_AGREEMENT_OFFERS_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.model_id is not None: - serializer.write_string( - _SCHEMA_LIST_FOUNDATION_MODEL_AGREEMENT_OFFERS_INPUT.members["modelId"], - self.model_id, - ) - - if self.offer_type is not None: - serializer.write_string( - _SCHEMA_LIST_FOUNDATION_MODEL_AGREEMENT_OFFERS_INPUT.members[ - "offerType" - ], - self.offer_type, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_id"] = de.read_string( - _SCHEMA_LIST_FOUNDATION_MODEL_AGREEMENT_OFFERS_INPUT.members[ - "modelId" - ] - ) - - case 1: - kwargs["offer_type"] = OfferType( - de.read_string( - _SCHEMA_LIST_FOUNDATION_MODEL_AGREEMENT_OFFERS_INPUT.members[ - "offerType" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_FOUNDATION_MODEL_AGREEMENT_OFFERS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class LegalTerm: - """The legal term of the agreement.""" - - url: str | None = None - """URL to the legal term document.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LEGAL_TERM, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.url is not None: - serializer.write_string(_SCHEMA_LEGAL_TERM.members["url"], self.url) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["url"] = de.read_string(_SCHEMA_LEGAL_TERM.members["url"]) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LEGAL_TERM, consumer=_consumer) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls() - - -@dataclass(kw_only=True) -class SupportTerm: - """Describes a support term.""" - - refund_policy_description: str | None = None - """Describes the refund policy.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SUPPORT_TERM, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.refund_policy_description is not None: - serializer.write_string( - _SCHEMA_SUPPORT_TERM.members["refundPolicyDescription"], - self.refund_policy_description, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["refund_policy_description"] = de.read_string( - _SCHEMA_SUPPORT_TERM.members["refundPolicyDescription"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SUPPORT_TERM, consumer=_consumer) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls() - - -@dataclass(kw_only=True) -class DimensionalPriceRate: - """Dimensional price rate.""" - - dimension: str | None = None - """Dimension for the price rate.""" - - price: str | None = None - """Single-dimensional rate information.""" - - description: str | None = None - """Description of the price rate.""" - - unit: str | None = None - """Unit associated with the price.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DIMENSIONAL_PRICE_RATE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.dimension is not None: - serializer.write_string( - _SCHEMA_DIMENSIONAL_PRICE_RATE.members["dimension"], self.dimension - ) - - if self.price is not None: - serializer.write_string( - _SCHEMA_DIMENSIONAL_PRICE_RATE.members["price"], self.price - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_DIMENSIONAL_PRICE_RATE.members["description"], self.description - ) - - if self.unit is not None: - serializer.write_string( - _SCHEMA_DIMENSIONAL_PRICE_RATE.members["unit"], self.unit - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["dimension"] = de.read_string( - _SCHEMA_DIMENSIONAL_PRICE_RATE.members["dimension"] - ) - - case 1: - kwargs["price"] = de.read_string( - _SCHEMA_DIMENSIONAL_PRICE_RATE.members["price"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_DIMENSIONAL_PRICE_RATE.members["description"] - ) - - case 3: - kwargs["unit"] = de.read_string( - _SCHEMA_DIMENSIONAL_PRICE_RATE.members["unit"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DIMENSIONAL_PRICE_RATE, consumer=_consumer) - return kwargs - - -def _serialize_rate_card( - serializer: ShapeSerializer, schema: Schema, value: list[DimensionalPriceRate] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_rate_card( - deserializer: ShapeDeserializer, schema: Schema -) -> list[DimensionalPriceRate]: - result: list[DimensionalPriceRate] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(DimensionalPriceRate.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class PricingTerm: - """Describes the usage-based pricing term.""" - - rate_card: list[DimensionalPriceRate] - """Describes a usage price for each dimension.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PRICING_TERM, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_rate_card( - serializer, _SCHEMA_PRICING_TERM.members["rateCard"], self.rate_card - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rate_card"] = _deserialize_rate_card( - de, _SCHEMA_PRICING_TERM.members["rateCard"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PRICING_TERM, consumer=_consumer) - if "rate_card" not in kwargs: - kwargs["rate_card"] = [] - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(rate_card=[]) - - -@dataclass(kw_only=True) -class ValidityTerm: - """Describes the validity terms.""" - - agreement_duration: str | None = None - """Describes the agreement duration.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VALIDITY_TERM, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.agreement_duration is not None: - serializer.write_string( - _SCHEMA_VALIDITY_TERM.members["agreementDuration"], - self.agreement_duration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["agreement_duration"] = de.read_string( - _SCHEMA_VALIDITY_TERM.members["agreementDuration"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VALIDITY_TERM, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class TermDetails: - """Describes the usage terms of an offer.""" - - usage_based_pricing_term: PricingTerm - """Describes the usage-based pricing term.""" - - legal_term: LegalTerm - """Describes the legal terms.""" - - support_term: SupportTerm - """Describes the support terms.""" - - validity_term: ValidityTerm | None = None - """Describes the validity terms.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TERM_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_TERM_DETAILS.members["usageBasedPricingTerm"], - self.usage_based_pricing_term, - ) - serializer.write_struct( - _SCHEMA_TERM_DETAILS.members["legalTerm"], self.legal_term - ) - serializer.write_struct( - _SCHEMA_TERM_DETAILS.members["supportTerm"], self.support_term - ) - if self.validity_term is not None: - serializer.write_struct( - _SCHEMA_TERM_DETAILS.members["validityTerm"], self.validity_term - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["usage_based_pricing_term"] = PricingTerm.deserialize(de) - - case 1: - kwargs["legal_term"] = LegalTerm.deserialize(de) - - case 2: - kwargs["support_term"] = SupportTerm.deserialize(de) - - case 3: - kwargs["validity_term"] = ValidityTerm.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TERM_DETAILS, consumer=_consumer) - if "usage_based_pricing_term" not in kwargs: - kwargs["usage_based_pricing_term"] = PricingTerm._smithy_default() - if "legal_term" not in kwargs: - kwargs["legal_term"] = LegalTerm._smithy_default() - if "support_term" not in kwargs: - kwargs["support_term"] = SupportTerm._smithy_default() - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls( - usage_based_pricing_term=PricingTerm._smithy_default(), - legal_term=LegalTerm._smithy_default(), - support_term=SupportTerm._smithy_default(), - ) - - -@dataclass(kw_only=True) -class Offer: - """An offer dictates usage terms for the model.""" - - offer_token: str - """Offer token.""" - - term_details: TermDetails - """Details about the terms of the offer.""" - - offer_id: str | None = None - """Offer Id for a model offer.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OFFER, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.offer_id is not None: - serializer.write_string(_SCHEMA_OFFER.members["offerId"], self.offer_id) - - serializer.write_string(_SCHEMA_OFFER.members["offerToken"], self.offer_token) - serializer.write_struct(_SCHEMA_OFFER.members["termDetails"], self.term_details) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["offer_id"] = de.read_string( - _SCHEMA_OFFER.members["offerId"] - ) - - case 1: - kwargs["offer_token"] = de.read_string( - _SCHEMA_OFFER.members["offerToken"] - ) - - case 2: - kwargs["term_details"] = TermDetails.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_OFFER, consumer=_consumer) - if "offer_token" not in kwargs: - kwargs["offer_token"] = "" - if "term_details" not in kwargs: - kwargs["term_details"] = TermDetails._smithy_default() - return kwargs - - -def _serialize_offers( - serializer: ShapeSerializer, schema: Schema, value: list[Offer] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_offers(deserializer: ShapeDeserializer, schema: Schema) -> list[Offer]: - result: list[Offer] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Offer.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListFoundationModelAgreementOffersOutput: - """Dataclass for ListFoundationModelAgreementOffersOutput structure.""" - - model_id: str - """Model Id of the foundation model.""" - - offers: list[Offer] - """List of the offers associated with the specified model.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_LIST_FOUNDATION_MODEL_AGREEMENT_OFFERS_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_LIST_FOUNDATION_MODEL_AGREEMENT_OFFERS_OUTPUT.members["modelId"], - self.model_id, - ) - _serialize_offers( - serializer, - _SCHEMA_LIST_FOUNDATION_MODEL_AGREEMENT_OFFERS_OUTPUT.members["offers"], - self.offers, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_id"] = de.read_string( - _SCHEMA_LIST_FOUNDATION_MODEL_AGREEMENT_OFFERS_OUTPUT.members[ - "modelId" - ] - ) - - case 1: - kwargs["offers"] = _deserialize_offers( - de, - _SCHEMA_LIST_FOUNDATION_MODEL_AGREEMENT_OFFERS_OUTPUT.members[ - "offers" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_FOUNDATION_MODEL_AGREEMENT_OFFERS_OUTPUT, consumer=_consumer - ) - if "model_id" not in kwargs: - kwargs["model_id"] = "" - if "offers" not in kwargs: - kwargs["offers"] = [] - return kwargs - - -LIST_FOUNDATION_MODEL_AGREEMENT_OFFERS = APIOperation( - input=ListFoundationModelAgreementOffersInput, - output=ListFoundationModelAgreementOffersOutput, - schema=_SCHEMA_LIST_FOUNDATION_MODEL_AGREEMENT_OFFERS, - input_schema=_SCHEMA_LIST_FOUNDATION_MODEL_AGREEMENT_OFFERS_INPUT, - output_schema=_SCHEMA_LIST_FOUNDATION_MODEL_AGREEMENT_OFFERS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListTagsForResourceInput: - """Dataclass for ListTagsForResourceInput structure.""" - - resource_arn: str | None = None - """The Amazon Resource Name (ARN) of the resource.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT.members["resourceARN"], - self.resource_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT.members["resourceARN"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ListTagsForResourceOutput: - """Dataclass for ListTagsForResourceOutput structure.""" - - tags: list[Tag] | None = None - """An array of the tags associated with this resource.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.tags is not None: - _serialize_tag_list( - serializer, - _SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT.members["tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["tags"] = _deserialize_tag_list( - de, _SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_TAGS_FOR_RESOURCE = APIOperation( - input=ListTagsForResourceInput, - output=ListTagsForResourceOutput, - schema=_SCHEMA_LIST_TAGS_FOR_RESOURCE, - input_schema=_SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT, - output_schema=_SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class TagResourceInput: - """Dataclass for TagResourceInput structure.""" - - resource_arn: str | None = None - """The Amazon Resource Name (ARN) of the resource to tag.""" - - tags: list[Tag] | None = None - """Tags to associate with the resource.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TAG_RESOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_TAG_RESOURCE_INPUT.members["resourceARN"], self.resource_arn - ) - - if self.tags is not None: - _serialize_tag_list( - serializer, _SCHEMA_TAG_RESOURCE_INPUT.members["tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_TAG_RESOURCE_INPUT.members["resourceARN"] - ) - - case 1: - kwargs["tags"] = _deserialize_tag_list( - de, _SCHEMA_TAG_RESOURCE_INPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TAG_RESOURCE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class TagResourceOutput: - """Dataclass for TagResourceOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TAG_RESOURCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TAG_RESOURCE_OUTPUT, consumer=_consumer) - return kwargs - - -TAG_RESOURCE = APIOperation( - input=TagResourceInput, - output=TagResourceOutput, - schema=_SCHEMA_TAG_RESOURCE, - input_schema=_SCHEMA_TAG_RESOURCE_INPUT, - output_schema=_SCHEMA_TAG_RESOURCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#TooManyTagsException"): TooManyTagsException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_TOO_MANY_TAGS_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -def _serialize_tag_key_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_tag_key_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class UntagResourceInput: - """Dataclass for UntagResourceInput structure.""" - - resource_arn: str | None = None - """The Amazon Resource Name (ARN) of the resource to untag.""" - - tag_keys: list[str] | None = None - """Tag keys of the tags to remove from the resource.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNTAG_RESOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_UNTAG_RESOURCE_INPUT.members["resourceARN"], self.resource_arn - ) - - if self.tag_keys is not None: - _serialize_tag_key_list( - serializer, - _SCHEMA_UNTAG_RESOURCE_INPUT.members["tagKeys"], - self.tag_keys, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_UNTAG_RESOURCE_INPUT.members["resourceARN"] - ) - - case 1: - kwargs["tag_keys"] = _deserialize_tag_key_list( - de, _SCHEMA_UNTAG_RESOURCE_INPUT.members["tagKeys"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UNTAG_RESOURCE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UntagResourceOutput: - """Dataclass for UntagResourceOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNTAG_RESOURCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UNTAG_RESOURCE_OUTPUT, consumer=_consumer) - return kwargs - - -UNTAG_RESOURCE = APIOperation( - input=UntagResourceInput, - output=UntagResourceOutput, - schema=_SCHEMA_UNTAG_RESOURCE, - input_schema=_SCHEMA_UNTAG_RESOURCE_INPUT, - output_schema=_SCHEMA_UNTAG_RESOURCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class CreateModelCustomizationJobInput: - """Dataclass for CreateModelCustomizationJobInput structure.""" - - job_name: str | None = None - """A name for the fine-tuning job.""" - - custom_model_name: str | None = None - """A name for the resulting custom model.""" - - role_arn: str | None = None - """ - The Amazon Resource Name (ARN) of an IAM service role that Amazon - Bedrock can assume to perform tasks on your behalf. For example, during - model training, Amazon Bedrock needs your permission to read input data - from an S3 bucket, write model artifacts to an S3 bucket. To pass this - role to Amazon Bedrock, the caller of this API must have the - `iam:PassRole` permission. - """ - - client_request_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If this token matches a previous - request, Amazon Bedrock ignores the request, but does not return an - error. For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - base_model_identifier: str | None = None - """Name of the base model.""" - - customization_type: str | None = None - """The customization type.""" - - custom_model_kms_key_id: str | None = None - """The custom model is encrypted at rest using this key.""" - - job_tags: list[Tag] | None = None - """Tags to attach to the job.""" - - custom_model_tags: list[Tag] | None = None - """Tags to attach to the resulting custom model.""" - - training_data_config: TrainingDataConfig | None = None - """Information about the training dataset.""" - - validation_data_config: ValidationDataConfig | None = None - """Information about the validation dataset.""" - - output_data_config: OutputDataConfig | None = None - """S3 location for the output data.""" - - hyper_parameters: dict[str, str] | None = None - """ - Parameters related to tuning the model. For details on the format for - different models, see [Custom model - hyperparameters](https://docs.aws.amazon.com/bedrock/latest/userguide/custom-models-hp.html). - """ - - vpc_config: VpcConfig | None = None - """ - The configuration of the Virtual Private Cloud (VPC) that contains the - resources that you're using for this job. For more information, see - [Protect your model customization jobs using a - VPC](https://docs.aws.amazon.com/bedrock/latest/userguide/vpc-model-customization.html). - """ - - customization_config: CustomizationConfig | None = None - """The customization configuration for the model customization job.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_MODEL_CUSTOMIZATION_JOB_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.job_name is not None: - serializer.write_string( - _SCHEMA_CREATE_MODEL_CUSTOMIZATION_JOB_INPUT.members["jobName"], - self.job_name, - ) - - if self.custom_model_name is not None: - serializer.write_string( - _SCHEMA_CREATE_MODEL_CUSTOMIZATION_JOB_INPUT.members["customModelName"], - self.custom_model_name, - ) - - if self.role_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_MODEL_CUSTOMIZATION_JOB_INPUT.members["roleArn"], - self.role_arn, - ) - - if self.client_request_token is not None: - serializer.write_string( - _SCHEMA_CREATE_MODEL_CUSTOMIZATION_JOB_INPUT.members[ - "clientRequestToken" - ], - self.client_request_token, - ) - - if self.base_model_identifier is not None: - serializer.write_string( - _SCHEMA_CREATE_MODEL_CUSTOMIZATION_JOB_INPUT.members[ - "baseModelIdentifier" - ], - self.base_model_identifier, - ) - - if self.customization_type is not None: - serializer.write_string( - _SCHEMA_CREATE_MODEL_CUSTOMIZATION_JOB_INPUT.members[ - "customizationType" - ], - self.customization_type, - ) - - if self.custom_model_kms_key_id is not None: - serializer.write_string( - _SCHEMA_CREATE_MODEL_CUSTOMIZATION_JOB_INPUT.members[ - "customModelKmsKeyId" - ], - self.custom_model_kms_key_id, - ) - - if self.job_tags is not None: - _serialize_tag_list( - serializer, - _SCHEMA_CREATE_MODEL_CUSTOMIZATION_JOB_INPUT.members["jobTags"], - self.job_tags, - ) - - if self.custom_model_tags is not None: - _serialize_tag_list( - serializer, - _SCHEMA_CREATE_MODEL_CUSTOMIZATION_JOB_INPUT.members["customModelTags"], - self.custom_model_tags, - ) - - if self.training_data_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_MODEL_CUSTOMIZATION_JOB_INPUT.members[ - "trainingDataConfig" - ], - self.training_data_config, - ) - - if self.validation_data_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_MODEL_CUSTOMIZATION_JOB_INPUT.members[ - "validationDataConfig" - ], - self.validation_data_config, - ) - - if self.output_data_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_MODEL_CUSTOMIZATION_JOB_INPUT.members[ - "outputDataConfig" - ], - self.output_data_config, - ) - - if self.hyper_parameters is not None: - _serialize_model_customization_hyper_parameters( - serializer, - _SCHEMA_CREATE_MODEL_CUSTOMIZATION_JOB_INPUT.members["hyperParameters"], - self.hyper_parameters, - ) - - if self.vpc_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_MODEL_CUSTOMIZATION_JOB_INPUT.members["vpcConfig"], - self.vpc_config, - ) - - if self.customization_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_MODEL_CUSTOMIZATION_JOB_INPUT.members[ - "customizationConfig" - ], - self.customization_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["job_name"] = de.read_string( - _SCHEMA_CREATE_MODEL_CUSTOMIZATION_JOB_INPUT.members["jobName"] - ) - - case 1: - kwargs["custom_model_name"] = de.read_string( - _SCHEMA_CREATE_MODEL_CUSTOMIZATION_JOB_INPUT.members[ - "customModelName" - ] - ) - - case 2: - kwargs["role_arn"] = de.read_string( - _SCHEMA_CREATE_MODEL_CUSTOMIZATION_JOB_INPUT.members["roleArn"] - ) - - case 3: - kwargs["client_request_token"] = de.read_string( - _SCHEMA_CREATE_MODEL_CUSTOMIZATION_JOB_INPUT.members[ - "clientRequestToken" - ] - ) - - case 4: - kwargs["base_model_identifier"] = de.read_string( - _SCHEMA_CREATE_MODEL_CUSTOMIZATION_JOB_INPUT.members[ - "baseModelIdentifier" - ] - ) - - case 5: - kwargs["customization_type"] = CustomizationType( - de.read_string( - _SCHEMA_CREATE_MODEL_CUSTOMIZATION_JOB_INPUT.members[ - "customizationType" - ] - ) - ) - - case 6: - kwargs["custom_model_kms_key_id"] = de.read_string( - _SCHEMA_CREATE_MODEL_CUSTOMIZATION_JOB_INPUT.members[ - "customModelKmsKeyId" - ] - ) - - case 7: - kwargs["job_tags"] = _deserialize_tag_list( - de, - _SCHEMA_CREATE_MODEL_CUSTOMIZATION_JOB_INPUT.members["jobTags"], - ) - - case 8: - kwargs["custom_model_tags"] = _deserialize_tag_list( - de, - _SCHEMA_CREATE_MODEL_CUSTOMIZATION_JOB_INPUT.members[ - "customModelTags" - ], - ) - - case 9: - kwargs["training_data_config"] = TrainingDataConfig.deserialize(de) - - case 10: - kwargs["validation_data_config"] = ValidationDataConfig.deserialize( - de - ) - - case 11: - kwargs["output_data_config"] = OutputDataConfig.deserialize(de) - - case 12: - kwargs["hyper_parameters"] = ( - _deserialize_model_customization_hyper_parameters( - de, - _SCHEMA_CREATE_MODEL_CUSTOMIZATION_JOB_INPUT.members[ - "hyperParameters" - ], - ) - ) - - case 13: - kwargs["vpc_config"] = VpcConfig.deserialize(de) - - case 14: - kwargs["customization_config"] = ( - _CustomizationConfigDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_MODEL_CUSTOMIZATION_JOB_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CreateModelCustomizationJobOutput: - """Dataclass for CreateModelCustomizationJobOutput structure.""" - - job_arn: str - """Amazon Resource Name (ARN) of the fine tuning job""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_MODEL_CUSTOMIZATION_JOB_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_MODEL_CUSTOMIZATION_JOB_OUTPUT.members["jobArn"], - self.job_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["job_arn"] = de.read_string( - _SCHEMA_CREATE_MODEL_CUSTOMIZATION_JOB_OUTPUT.members["jobArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_MODEL_CUSTOMIZATION_JOB_OUTPUT, consumer=_consumer - ) - if "job_arn" not in kwargs: - kwargs["job_arn"] = "" - return kwargs - - -CREATE_MODEL_CUSTOMIZATION_JOB = APIOperation( - input=CreateModelCustomizationJobInput, - output=CreateModelCustomizationJobOutput, - schema=_SCHEMA_CREATE_MODEL_CUSTOMIZATION_JOB, - input_schema=_SCHEMA_CREATE_MODEL_CUSTOMIZATION_JOB_INPUT, - output_schema=_SCHEMA_CREATE_MODEL_CUSTOMIZATION_JOB_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrock#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrock#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#TooManyTagsException"): TooManyTagsException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_TOO_MANY_TAGS_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetModelCustomizationJobInput: - """Dataclass for GetModelCustomizationJobInput structure.""" - - job_identifier: str | None = None - """Identifier for the customization job.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_MODEL_CUSTOMIZATION_JOB_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.job_identifier is not None: - serializer.write_string( - _SCHEMA_GET_MODEL_CUSTOMIZATION_JOB_INPUT.members["jobIdentifier"], - self.job_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["job_identifier"] = de.read_string( - _SCHEMA_GET_MODEL_CUSTOMIZATION_JOB_INPUT.members[ - "jobIdentifier" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_MODEL_CUSTOMIZATION_JOB_INPUT, consumer=_consumer - ) - return kwargs - - -class ModelCustomizationJobStatus(UnknownEnumMixin, StrEnum): - IN_PROGRESS = "InProgress" - COMPLETED = "Completed" - FAILED = "Failed" - STOPPING = "Stopping" - STOPPED = "Stopped" - - -class JobStatusDetails(UnknownEnumMixin, StrEnum): - IN_PROGRESS = "InProgress" - COMPLETED = "Completed" - STOPPING = "Stopping" - STOPPED = "Stopped" - FAILED = "Failed" - NOT_STARTED = "NotStarted" - - -@dataclass(kw_only=True) -class DataProcessingDetails: - """ - For a Distillation job, the status details for the data processing - sub-task of the job. - """ - - status: str | None = None - """The status of the data processing sub-task of the job.""" - - creation_time: datetime | None = None - """The start time of the data processing sub-task of the job.""" - - last_modified_time: datetime | None = None - """The latest update to the data processing sub-task of the job.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DATA_PROCESSING_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.status is not None: - serializer.write_string( - _SCHEMA_DATA_PROCESSING_DETAILS.members["status"], self.status - ) - - if self.creation_time is not None: - serializer.write_timestamp( - _SCHEMA_DATA_PROCESSING_DETAILS.members["creationTime"], - self.creation_time, - ) - - if self.last_modified_time is not None: - serializer.write_timestamp( - _SCHEMA_DATA_PROCESSING_DETAILS.members["lastModifiedTime"], - self.last_modified_time, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["status"] = JobStatusDetails( - de.read_string( - _SCHEMA_DATA_PROCESSING_DETAILS.members["status"] - ) - ) - - case 1: - kwargs["creation_time"] = de.read_timestamp( - _SCHEMA_DATA_PROCESSING_DETAILS.members["creationTime"] - ) - - case 2: - kwargs["last_modified_time"] = de.read_timestamp( - _SCHEMA_DATA_PROCESSING_DETAILS.members["lastModifiedTime"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DATA_PROCESSING_DETAILS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class TrainingDetails: - """ - For a Distillation job, the status details for the training sub-task of - the job. - """ - - status: str | None = None - """The status of the training sub-task of the job.""" - - creation_time: datetime | None = None - """The start time of the training sub-task of the job.""" - - last_modified_time: datetime | None = None - """The latest update to the training sub-task of the job.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRAINING_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.status is not None: - serializer.write_string( - _SCHEMA_TRAINING_DETAILS.members["status"], self.status - ) - - if self.creation_time is not None: - serializer.write_timestamp( - _SCHEMA_TRAINING_DETAILS.members["creationTime"], self.creation_time - ) - - if self.last_modified_time is not None: - serializer.write_timestamp( - _SCHEMA_TRAINING_DETAILS.members["lastModifiedTime"], - self.last_modified_time, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["status"] = JobStatusDetails( - de.read_string(_SCHEMA_TRAINING_DETAILS.members["status"]) - ) - - case 1: - kwargs["creation_time"] = de.read_timestamp( - _SCHEMA_TRAINING_DETAILS.members["creationTime"] - ) - - case 2: - kwargs["last_modified_time"] = de.read_timestamp( - _SCHEMA_TRAINING_DETAILS.members["lastModifiedTime"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TRAINING_DETAILS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ValidationDetails: - """ - For a Distillation job, the status details for the validation sub-task - of the job. - """ - - status: str | None = None - """The status of the validation sub-task of the job.""" - - creation_time: datetime | None = None - """The start time of the validation sub-task of the job.""" - - last_modified_time: datetime | None = None - """The latest update to the validation sub-task of the job.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VALIDATION_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.status is not None: - serializer.write_string( - _SCHEMA_VALIDATION_DETAILS.members["status"], self.status - ) - - if self.creation_time is not None: - serializer.write_timestamp( - _SCHEMA_VALIDATION_DETAILS.members["creationTime"], self.creation_time - ) - - if self.last_modified_time is not None: - serializer.write_timestamp( - _SCHEMA_VALIDATION_DETAILS.members["lastModifiedTime"], - self.last_modified_time, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["status"] = JobStatusDetails( - de.read_string(_SCHEMA_VALIDATION_DETAILS.members["status"]) - ) - - case 1: - kwargs["creation_time"] = de.read_timestamp( - _SCHEMA_VALIDATION_DETAILS.members["creationTime"] - ) - - case 2: - kwargs["last_modified_time"] = de.read_timestamp( - _SCHEMA_VALIDATION_DETAILS.members["lastModifiedTime"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VALIDATION_DETAILS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class StatusDetails: - """ - For a Distillation job, the status details for sub-tasks of the job. - Possible statuses for each sub-task include the following: - - - NotStarted - - - InProgress - - - Completed - - - Stopping - - - Stopped - - - Failed - """ - - validation_details: ValidationDetails | None = None - """The status details for the validation sub-task of the job.""" - - data_processing_details: DataProcessingDetails | None = None - """The status details for the data processing sub-task of the job.""" - - training_details: TrainingDetails | None = None - """The status details for the training sub-task of the job.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STATUS_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.validation_details is not None: - serializer.write_struct( - _SCHEMA_STATUS_DETAILS.members["validationDetails"], - self.validation_details, - ) - - if self.data_processing_details is not None: - serializer.write_struct( - _SCHEMA_STATUS_DETAILS.members["dataProcessingDetails"], - self.data_processing_details, - ) - - if self.training_details is not None: - serializer.write_struct( - _SCHEMA_STATUS_DETAILS.members["trainingDetails"], self.training_details - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["validation_details"] = ValidationDetails.deserialize(de) - - case 1: - kwargs["data_processing_details"] = ( - DataProcessingDetails.deserialize(de) - ) - - case 2: - kwargs["training_details"] = TrainingDetails.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_STATUS_DETAILS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetModelCustomizationJobOutput: - """Dataclass for GetModelCustomizationJobOutput structure.""" - - job_arn: str - """The Amazon Resource Name (ARN) of the customization job.""" - - job_name: str - """The name of the customization job.""" - - output_model_name: str - """The name of the output model.""" - - role_arn: str - """The Amazon Resource Name (ARN) of the IAM role.""" - - creation_time: datetime - """Time that the resource was created.""" - - base_model_arn: str - """Amazon Resource Name (ARN) of the base model.""" - - training_data_config: TrainingDataConfig - """Contains information about the training dataset.""" - - validation_data_config: ValidationDataConfig - """Contains information about the validation dataset.""" - - output_data_config: OutputDataConfig - """Output data configuration""" - - output_model_arn: str | None = None - """The Amazon Resource Name (ARN) of the output model.""" - - client_request_token: str | None = None - """The token that you specified in the `CreateCustomizationJob` request.""" - - status: str | None = None - """ - The status of the job. A successful job transitions from in-progress to - completed when the output model is ready to use. If the job failed, the - failure message contains information about why the job failed. - """ - - status_details: StatusDetails | None = None - """ - For a Distillation job, the details about the statuses of the sub-tasks - of the customization job. - """ - - failure_message: str | None = None - """Information about why the job failed.""" - - last_modified_time: datetime | None = None - """Time that the resource was last modified.""" - - end_time: datetime | None = None - """Time that the resource transitioned to terminal state.""" - - hyper_parameters: dict[str, str] | None = None - """ - The hyperparameter values for the job. For details on the format for - different models, see [Custom model - hyperparameters](https://docs.aws.amazon.com/bedrock/latest/userguide/custom-models-hp.html). - """ - - customization_type: str | None = None - """The type of model customization.""" - - output_model_kms_key_arn: str | None = None - """The custom model is encrypted at rest using this key.""" - - training_metrics: TrainingMetrics | None = None - """Contains training metrics from the job creation.""" - - validation_metrics: list[ValidatorMetric] | None = None - """ - The loss metric for each validator that you provided in the createjob - request. - """ - - vpc_config: VpcConfig | None = None - """VPC configuration for the custom model job.""" - - customization_config: CustomizationConfig | None = None - """The customization configuration for the model customization job.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_MODEL_CUSTOMIZATION_JOB_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_MODEL_CUSTOMIZATION_JOB_OUTPUT.members["jobArn"], self.job_arn - ) - serializer.write_string( - _SCHEMA_GET_MODEL_CUSTOMIZATION_JOB_OUTPUT.members["jobName"], self.job_name - ) - serializer.write_string( - _SCHEMA_GET_MODEL_CUSTOMIZATION_JOB_OUTPUT.members["outputModelName"], - self.output_model_name, - ) - if self.output_model_arn is not None: - serializer.write_string( - _SCHEMA_GET_MODEL_CUSTOMIZATION_JOB_OUTPUT.members["outputModelArn"], - self.output_model_arn, - ) - - if self.client_request_token is not None: - serializer.write_string( - _SCHEMA_GET_MODEL_CUSTOMIZATION_JOB_OUTPUT.members[ - "clientRequestToken" - ], - self.client_request_token, - ) - - serializer.write_string( - _SCHEMA_GET_MODEL_CUSTOMIZATION_JOB_OUTPUT.members["roleArn"], self.role_arn - ) - if self.status is not None: - serializer.write_string( - _SCHEMA_GET_MODEL_CUSTOMIZATION_JOB_OUTPUT.members["status"], - self.status, - ) - - if self.status_details is not None: - serializer.write_struct( - _SCHEMA_GET_MODEL_CUSTOMIZATION_JOB_OUTPUT.members["statusDetails"], - self.status_details, - ) - - if self.failure_message is not None: - serializer.write_string( - _SCHEMA_GET_MODEL_CUSTOMIZATION_JOB_OUTPUT.members["failureMessage"], - self.failure_message, - ) - - serializer.write_timestamp( - _SCHEMA_GET_MODEL_CUSTOMIZATION_JOB_OUTPUT.members["creationTime"], - self.creation_time, - ) - if self.last_modified_time is not None: - serializer.write_timestamp( - _SCHEMA_GET_MODEL_CUSTOMIZATION_JOB_OUTPUT.members["lastModifiedTime"], - self.last_modified_time, - ) - - if self.end_time is not None: - serializer.write_timestamp( - _SCHEMA_GET_MODEL_CUSTOMIZATION_JOB_OUTPUT.members["endTime"], - self.end_time, - ) - - serializer.write_string( - _SCHEMA_GET_MODEL_CUSTOMIZATION_JOB_OUTPUT.members["baseModelArn"], - self.base_model_arn, - ) - if self.hyper_parameters is not None: - _serialize_model_customization_hyper_parameters( - serializer, - _SCHEMA_GET_MODEL_CUSTOMIZATION_JOB_OUTPUT.members["hyperParameters"], - self.hyper_parameters, - ) - - serializer.write_struct( - _SCHEMA_GET_MODEL_CUSTOMIZATION_JOB_OUTPUT.members["trainingDataConfig"], - self.training_data_config, - ) - serializer.write_struct( - _SCHEMA_GET_MODEL_CUSTOMIZATION_JOB_OUTPUT.members["validationDataConfig"], - self.validation_data_config, - ) - serializer.write_struct( - _SCHEMA_GET_MODEL_CUSTOMIZATION_JOB_OUTPUT.members["outputDataConfig"], - self.output_data_config, - ) - if self.customization_type is not None: - serializer.write_string( - _SCHEMA_GET_MODEL_CUSTOMIZATION_JOB_OUTPUT.members["customizationType"], - self.customization_type, - ) - - if self.output_model_kms_key_arn is not None: - serializer.write_string( - _SCHEMA_GET_MODEL_CUSTOMIZATION_JOB_OUTPUT.members[ - "outputModelKmsKeyArn" - ], - self.output_model_kms_key_arn, - ) - - if self.training_metrics is not None: - serializer.write_struct( - _SCHEMA_GET_MODEL_CUSTOMIZATION_JOB_OUTPUT.members["trainingMetrics"], - self.training_metrics, - ) - - if self.validation_metrics is not None: - _serialize_validation_metrics( - serializer, - _SCHEMA_GET_MODEL_CUSTOMIZATION_JOB_OUTPUT.members["validationMetrics"], - self.validation_metrics, - ) - - if self.vpc_config is not None: - serializer.write_struct( - _SCHEMA_GET_MODEL_CUSTOMIZATION_JOB_OUTPUT.members["vpcConfig"], - self.vpc_config, - ) - - if self.customization_config is not None: - serializer.write_struct( - _SCHEMA_GET_MODEL_CUSTOMIZATION_JOB_OUTPUT.members[ - "customizationConfig" - ], - self.customization_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["job_arn"] = de.read_string( - _SCHEMA_GET_MODEL_CUSTOMIZATION_JOB_OUTPUT.members["jobArn"] - ) - - case 1: - kwargs["job_name"] = de.read_string( - _SCHEMA_GET_MODEL_CUSTOMIZATION_JOB_OUTPUT.members["jobName"] - ) - - case 2: - kwargs["output_model_name"] = de.read_string( - _SCHEMA_GET_MODEL_CUSTOMIZATION_JOB_OUTPUT.members[ - "outputModelName" - ] - ) - - case 3: - kwargs["output_model_arn"] = de.read_string( - _SCHEMA_GET_MODEL_CUSTOMIZATION_JOB_OUTPUT.members[ - "outputModelArn" - ] - ) - - case 4: - kwargs["client_request_token"] = de.read_string( - _SCHEMA_GET_MODEL_CUSTOMIZATION_JOB_OUTPUT.members[ - "clientRequestToken" - ] - ) - - case 5: - kwargs["role_arn"] = de.read_string( - _SCHEMA_GET_MODEL_CUSTOMIZATION_JOB_OUTPUT.members["roleArn"] - ) - - case 6: - kwargs["status"] = ModelCustomizationJobStatus( - de.read_string( - _SCHEMA_GET_MODEL_CUSTOMIZATION_JOB_OUTPUT.members["status"] - ) - ) - - case 7: - kwargs["status_details"] = StatusDetails.deserialize(de) - - case 8: - kwargs["failure_message"] = de.read_string( - _SCHEMA_GET_MODEL_CUSTOMIZATION_JOB_OUTPUT.members[ - "failureMessage" - ] - ) - - case 9: - kwargs["creation_time"] = de.read_timestamp( - _SCHEMA_GET_MODEL_CUSTOMIZATION_JOB_OUTPUT.members[ - "creationTime" - ] - ) - - case 10: - kwargs["last_modified_time"] = de.read_timestamp( - _SCHEMA_GET_MODEL_CUSTOMIZATION_JOB_OUTPUT.members[ - "lastModifiedTime" - ] - ) - - case 11: - kwargs["end_time"] = de.read_timestamp( - _SCHEMA_GET_MODEL_CUSTOMIZATION_JOB_OUTPUT.members["endTime"] - ) - - case 12: - kwargs["base_model_arn"] = de.read_string( - _SCHEMA_GET_MODEL_CUSTOMIZATION_JOB_OUTPUT.members[ - "baseModelArn" - ] - ) - - case 13: - kwargs["hyper_parameters"] = ( - _deserialize_model_customization_hyper_parameters( - de, - _SCHEMA_GET_MODEL_CUSTOMIZATION_JOB_OUTPUT.members[ - "hyperParameters" - ], - ) - ) - - case 14: - kwargs["training_data_config"] = TrainingDataConfig.deserialize(de) - - case 15: - kwargs["validation_data_config"] = ValidationDataConfig.deserialize( - de - ) - - case 16: - kwargs["output_data_config"] = OutputDataConfig.deserialize(de) - - case 17: - kwargs["customization_type"] = CustomizationType( - de.read_string( - _SCHEMA_GET_MODEL_CUSTOMIZATION_JOB_OUTPUT.members[ - "customizationType" - ] - ) - ) - - case 18: - kwargs["output_model_kms_key_arn"] = de.read_string( - _SCHEMA_GET_MODEL_CUSTOMIZATION_JOB_OUTPUT.members[ - "outputModelKmsKeyArn" - ] - ) - - case 19: - kwargs["training_metrics"] = TrainingMetrics.deserialize(de) - - case 20: - kwargs["validation_metrics"] = _deserialize_validation_metrics( - de, - _SCHEMA_GET_MODEL_CUSTOMIZATION_JOB_OUTPUT.members[ - "validationMetrics" - ], - ) - - case 21: - kwargs["vpc_config"] = VpcConfig.deserialize(de) - - case 22: - kwargs["customization_config"] = ( - _CustomizationConfigDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_MODEL_CUSTOMIZATION_JOB_OUTPUT, consumer=_consumer - ) - if "job_arn" not in kwargs: - kwargs["job_arn"] = "" - if "job_name" not in kwargs: - kwargs["job_name"] = "" - if "output_model_name" not in kwargs: - kwargs["output_model_name"] = "" - if "role_arn" not in kwargs: - kwargs["role_arn"] = "" - if "creation_time" not in kwargs: - kwargs["creation_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "base_model_arn" not in kwargs: - kwargs["base_model_arn"] = "" - if "training_data_config" not in kwargs: - kwargs["training_data_config"] = TrainingDataConfig._smithy_default() - if "validation_data_config" not in kwargs: - kwargs["validation_data_config"] = ValidationDataConfig._smithy_default() - if "output_data_config" not in kwargs: - kwargs["output_data_config"] = OutputDataConfig._smithy_default() - return kwargs - - -GET_MODEL_CUSTOMIZATION_JOB = APIOperation( - input=GetModelCustomizationJobInput, - output=GetModelCustomizationJobOutput, - schema=_SCHEMA_GET_MODEL_CUSTOMIZATION_JOB, - input_schema=_SCHEMA_GET_MODEL_CUSTOMIZATION_JOB_INPUT, - output_schema=_SCHEMA_GET_MODEL_CUSTOMIZATION_JOB_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class FineTuningJobStatus(UnknownEnumMixin, StrEnum): - IN_PROGRESS = "InProgress" - COMPLETED = "Completed" - FAILED = "Failed" - STOPPING = "Stopping" - STOPPED = "Stopped" - - -@dataclass(kw_only=True) -class ListModelCustomizationJobsInput: - """Dataclass for ListModelCustomizationJobsInput structure.""" - - creation_time_after: datetime | None = None - """Return customization jobs created after the specified time.""" - - creation_time_before: datetime | None = None - """Return customization jobs created before the specified time.""" - - status_equals: str | None = None - """Return customization jobs with the specified status.""" - - name_contains: str | None = None - """ - Return customization jobs only if the job name contains these - characters. - """ - - max_results: int | None = None - """ - The maximum number of results to return in the response. If the total - number of results is greater than this value, use the token returned in - the response in the `nextToken` field when making another request to - return the next batch of results. - """ - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, enter the token returned in the `nextToken` - field in the response in this field to return the next batch of results. - """ - - sort_by: str | None = None - """The field to sort by in the returned list of jobs.""" - - sort_order: str | None = None - """The sort order of the results.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_MODEL_CUSTOMIZATION_JOBS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.creation_time_after is not None: - serializer.write_timestamp( - _SCHEMA_LIST_MODEL_CUSTOMIZATION_JOBS_INPUT.members[ - "creationTimeAfter" - ], - self.creation_time_after, - ) - - if self.creation_time_before is not None: - serializer.write_timestamp( - _SCHEMA_LIST_MODEL_CUSTOMIZATION_JOBS_INPUT.members[ - "creationTimeBefore" - ], - self.creation_time_before, - ) - - if self.status_equals is not None: - serializer.write_string( - _SCHEMA_LIST_MODEL_CUSTOMIZATION_JOBS_INPUT.members["statusEquals"], - self.status_equals, - ) - - if self.name_contains is not None: - serializer.write_string( - _SCHEMA_LIST_MODEL_CUSTOMIZATION_JOBS_INPUT.members["nameContains"], - self.name_contains, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_MODEL_CUSTOMIZATION_JOBS_INPUT.members["maxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_MODEL_CUSTOMIZATION_JOBS_INPUT.members["nextToken"], - self.next_token, - ) - - if self.sort_by is not None: - serializer.write_string( - _SCHEMA_LIST_MODEL_CUSTOMIZATION_JOBS_INPUT.members["sortBy"], - self.sort_by, - ) - - if self.sort_order is not None: - serializer.write_string( - _SCHEMA_LIST_MODEL_CUSTOMIZATION_JOBS_INPUT.members["sortOrder"], - self.sort_order, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["creation_time_after"] = de.read_timestamp( - _SCHEMA_LIST_MODEL_CUSTOMIZATION_JOBS_INPUT.members[ - "creationTimeAfter" - ] - ) - - case 1: - kwargs["creation_time_before"] = de.read_timestamp( - _SCHEMA_LIST_MODEL_CUSTOMIZATION_JOBS_INPUT.members[ - "creationTimeBefore" - ] - ) - - case 2: - kwargs["status_equals"] = FineTuningJobStatus( - de.read_string( - _SCHEMA_LIST_MODEL_CUSTOMIZATION_JOBS_INPUT.members[ - "statusEquals" - ] - ) - ) - - case 3: - kwargs["name_contains"] = de.read_string( - _SCHEMA_LIST_MODEL_CUSTOMIZATION_JOBS_INPUT.members[ - "nameContains" - ] - ) - - case 4: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_MODEL_CUSTOMIZATION_JOBS_INPUT.members[ - "maxResults" - ] - ) - - case 5: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_MODEL_CUSTOMIZATION_JOBS_INPUT.members["nextToken"] - ) - - case 6: - kwargs["sort_by"] = SortJobsBy( - de.read_string( - _SCHEMA_LIST_MODEL_CUSTOMIZATION_JOBS_INPUT.members[ - "sortBy" - ] - ) - ) - - case 7: - kwargs["sort_order"] = SortOrder( - de.read_string( - _SCHEMA_LIST_MODEL_CUSTOMIZATION_JOBS_INPUT.members[ - "sortOrder" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_MODEL_CUSTOMIZATION_JOBS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ModelCustomizationJobSummary: - """Information about one customization job""" - - job_arn: str - """Amazon Resource Name (ARN) of the customization job.""" - - base_model_arn: str - """Amazon Resource Name (ARN) of the base model.""" - - job_name: str - """Name of the customization job.""" - - status: str - """Status of the customization job.""" - - creation_time: datetime - """Creation time of the custom model.""" - - status_details: StatusDetails | None = None - """Details about the status of the data processing sub-task of the job.""" - - last_modified_time: datetime | None = None - """Time that the customization job was last modified.""" - - end_time: datetime | None = None - """Time that the customization job ended.""" - - custom_model_arn: str | None = None - """Amazon Resource Name (ARN) of the custom model.""" - - custom_model_name: str | None = None - """Name of the custom model.""" - - customization_type: str | None = None - """ - Specifies whether to carry out continued pre-training of a model or - whether to fine-tune it. For more information, see [Custom - models](https://docs.aws.amazon.com/bedrock/latest/userguide/custom-models.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MODEL_CUSTOMIZATION_JOB_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MODEL_CUSTOMIZATION_JOB_SUMMARY.members["jobArn"], self.job_arn - ) - serializer.write_string( - _SCHEMA_MODEL_CUSTOMIZATION_JOB_SUMMARY.members["baseModelArn"], - self.base_model_arn, - ) - serializer.write_string( - _SCHEMA_MODEL_CUSTOMIZATION_JOB_SUMMARY.members["jobName"], self.job_name - ) - serializer.write_string( - _SCHEMA_MODEL_CUSTOMIZATION_JOB_SUMMARY.members["status"], self.status - ) - if self.status_details is not None: - serializer.write_struct( - _SCHEMA_MODEL_CUSTOMIZATION_JOB_SUMMARY.members["statusDetails"], - self.status_details, - ) - - if self.last_modified_time is not None: - serializer.write_timestamp( - _SCHEMA_MODEL_CUSTOMIZATION_JOB_SUMMARY.members["lastModifiedTime"], - self.last_modified_time, - ) - - serializer.write_timestamp( - _SCHEMA_MODEL_CUSTOMIZATION_JOB_SUMMARY.members["creationTime"], - self.creation_time, - ) - if self.end_time is not None: - serializer.write_timestamp( - _SCHEMA_MODEL_CUSTOMIZATION_JOB_SUMMARY.members["endTime"], - self.end_time, - ) - - if self.custom_model_arn is not None: - serializer.write_string( - _SCHEMA_MODEL_CUSTOMIZATION_JOB_SUMMARY.members["customModelArn"], - self.custom_model_arn, - ) - - if self.custom_model_name is not None: - serializer.write_string( - _SCHEMA_MODEL_CUSTOMIZATION_JOB_SUMMARY.members["customModelName"], - self.custom_model_name, - ) - - if self.customization_type is not None: - serializer.write_string( - _SCHEMA_MODEL_CUSTOMIZATION_JOB_SUMMARY.members["customizationType"], - self.customization_type, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["job_arn"] = de.read_string( - _SCHEMA_MODEL_CUSTOMIZATION_JOB_SUMMARY.members["jobArn"] - ) - - case 1: - kwargs["base_model_arn"] = de.read_string( - _SCHEMA_MODEL_CUSTOMIZATION_JOB_SUMMARY.members["baseModelArn"] - ) - - case 2: - kwargs["job_name"] = de.read_string( - _SCHEMA_MODEL_CUSTOMIZATION_JOB_SUMMARY.members["jobName"] - ) - - case 3: - kwargs["status"] = ModelCustomizationJobStatus( - de.read_string( - _SCHEMA_MODEL_CUSTOMIZATION_JOB_SUMMARY.members["status"] - ) - ) - - case 4: - kwargs["status_details"] = StatusDetails.deserialize(de) - - case 5: - kwargs["last_modified_time"] = de.read_timestamp( - _SCHEMA_MODEL_CUSTOMIZATION_JOB_SUMMARY.members[ - "lastModifiedTime" - ] - ) - - case 6: - kwargs["creation_time"] = de.read_timestamp( - _SCHEMA_MODEL_CUSTOMIZATION_JOB_SUMMARY.members["creationTime"] - ) - - case 7: - kwargs["end_time"] = de.read_timestamp( - _SCHEMA_MODEL_CUSTOMIZATION_JOB_SUMMARY.members["endTime"] - ) - - case 8: - kwargs["custom_model_arn"] = de.read_string( - _SCHEMA_MODEL_CUSTOMIZATION_JOB_SUMMARY.members[ - "customModelArn" - ] - ) - - case 9: - kwargs["custom_model_name"] = de.read_string( - _SCHEMA_MODEL_CUSTOMIZATION_JOB_SUMMARY.members[ - "customModelName" - ] - ) - - case 10: - kwargs["customization_type"] = CustomizationType( - de.read_string( - _SCHEMA_MODEL_CUSTOMIZATION_JOB_SUMMARY.members[ - "customizationType" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MODEL_CUSTOMIZATION_JOB_SUMMARY, consumer=_consumer - ) - if "job_arn" not in kwargs: - kwargs["job_arn"] = "" - if "base_model_arn" not in kwargs: - kwargs["base_model_arn"] = "" - if "job_name" not in kwargs: - kwargs["job_name"] = "" - if "status" not in kwargs: - kwargs["status"] = ModelCustomizationJobStatus._corrected("") - if "creation_time" not in kwargs: - kwargs["creation_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_model_customization_job_summaries( - serializer: ShapeSerializer, - schema: Schema, - value: list[ModelCustomizationJobSummary], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_model_customization_job_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ModelCustomizationJobSummary]: - result: list[ModelCustomizationJobSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ModelCustomizationJobSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListModelCustomizationJobsOutput: - """Dataclass for ListModelCustomizationJobsOutput structure.""" - - next_token: str | None = None - """ - If the total number of results is greater than the `maxResults` value - provided in the request, use this token when making another request in - the `nextToken` field to return the next batch of results. - """ - - model_customization_job_summaries: list[ModelCustomizationJobSummary] | None = None - """Job summaries.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_MODEL_CUSTOMIZATION_JOBS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_MODEL_CUSTOMIZATION_JOBS_OUTPUT.members["nextToken"], - self.next_token, - ) - - if self.model_customization_job_summaries is not None: - _serialize_model_customization_job_summaries( - serializer, - _SCHEMA_LIST_MODEL_CUSTOMIZATION_JOBS_OUTPUT.members[ - "modelCustomizationJobSummaries" - ], - self.model_customization_job_summaries, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_MODEL_CUSTOMIZATION_JOBS_OUTPUT.members[ - "nextToken" - ] - ) - - case 1: - kwargs["model_customization_job_summaries"] = ( - _deserialize_model_customization_job_summaries( - de, - _SCHEMA_LIST_MODEL_CUSTOMIZATION_JOBS_OUTPUT.members[ - "modelCustomizationJobSummaries" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_MODEL_CUSTOMIZATION_JOBS_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_MODEL_CUSTOMIZATION_JOBS = APIOperation( - input=ListModelCustomizationJobsInput, - output=ListModelCustomizationJobsOutput, - schema=_SCHEMA_LIST_MODEL_CUSTOMIZATION_JOBS, - input_schema=_SCHEMA_LIST_MODEL_CUSTOMIZATION_JOBS_INPUT, - output_schema=_SCHEMA_LIST_MODEL_CUSTOMIZATION_JOBS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class StopModelCustomizationJobInput: - """Dataclass for StopModelCustomizationJobInput structure.""" - - job_identifier: str | None = None - """Job identifier of the job to stop.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STOP_MODEL_CUSTOMIZATION_JOB_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.job_identifier is not None: - serializer.write_string( - _SCHEMA_STOP_MODEL_CUSTOMIZATION_JOB_INPUT.members["jobIdentifier"], - self.job_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["job_identifier"] = de.read_string( - _SCHEMA_STOP_MODEL_CUSTOMIZATION_JOB_INPUT.members[ - "jobIdentifier" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_STOP_MODEL_CUSTOMIZATION_JOB_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class StopModelCustomizationJobOutput: - """Dataclass for StopModelCustomizationJobOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STOP_MODEL_CUSTOMIZATION_JOB_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_STOP_MODEL_CUSTOMIZATION_JOB_OUTPUT, consumer=_consumer - ) - return kwargs - - -STOP_MODEL_CUSTOMIZATION_JOB = APIOperation( - input=StopModelCustomizationJobInput, - output=StopModelCustomizationJobOutput, - schema=_SCHEMA_STOP_MODEL_CUSTOMIZATION_JOB, - input_schema=_SCHEMA_STOP_MODEL_CUSTOMIZATION_JOB_INPUT, - output_schema=_SCHEMA_STOP_MODEL_CUSTOMIZATION_JOB_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrock#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ - ShapeID("aws.auth#sigv4"), - ShapeID("smithy.api#httpBearerAuth"), - ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass -class RetrievalFilterEquals: - """ - Knowledge base data sources are returned if they contain a metadata - attribute whose name matches the key and whose value matches the value - in this object. - - The following example would return data sources with an animal attribute - whose value is 'cat': `"equals": { "key": "animal", "value": "cat" }` - """ - - value: FilterAttribute - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVAL_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVAL_FILTER.members["equals"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=FilterAttribute.deserialize(deserializer)) - - -@dataclass -class RetrievalFilterNotEquals: - """ - Knowledge base data sources that contain a metadata attribute whose name - matches the key and whose value doesn't match the value in this object - are returned. - - The following example would return data sources that don't contain an - animal attribute whose value is 'cat': - `"notEquals": { "key": "animal", "value": "cat" }` - """ - - value: FilterAttribute - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVAL_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RETRIEVAL_FILTER.members["notEquals"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=FilterAttribute.deserialize(deserializer)) - - -@dataclass -class RetrievalFilterGreaterThan: - """ - Knowledge base data sources are returned if they contain a metadata - attribute whose name matches the key and whose value is greater than the - value in this object. - - The following example would return data sources with an year attribute - whose value is greater than '1989': - `"greaterThan": { "key": "year", "value": 1989 }` - """ - - value: FilterAttribute - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVAL_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RETRIEVAL_FILTER.members["greaterThan"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=FilterAttribute.deserialize(deserializer)) - - -@dataclass -class RetrievalFilterGreaterThanOrEquals: - """ - Knowledge base data sources are returned if they contain a metadata - attribute whose name matches the key and whose value is greater than or - equal to the value in this object. - - The following example would return data sources with an year attribute - whose value is greater than or equal to '1989': - `"greaterThanOrEquals": { "key": "year", "value": 1989 }` - """ - - value: FilterAttribute - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVAL_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RETRIEVAL_FILTER.members["greaterThanOrEquals"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=FilterAttribute.deserialize(deserializer)) - - -@dataclass -class RetrievalFilterLessThan: - """ - Knowledge base data sources are returned if they contain a metadata - attribute whose name matches the key and whose value is less than the - value in this object. - - The following example would return data sources with an year attribute - whose value is less than to '1989': - `"lessThan": { "key": "year", "value": 1989 }` - """ - - value: FilterAttribute - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVAL_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RETRIEVAL_FILTER.members["lessThan"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=FilterAttribute.deserialize(deserializer)) - - -@dataclass -class RetrievalFilterLessThanOrEquals: - """ - Knowledge base data sources are returned if they contain a metadata - attribute whose name matches the key and whose value is less than or - equal to the value in this object. - - The following example would return data sources with an year attribute - whose value is less than or equal to '1989': - `"lessThanOrEquals": { "key": "year", "value": 1989 }` - """ - - value: FilterAttribute - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVAL_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RETRIEVAL_FILTER.members["lessThanOrEquals"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=FilterAttribute.deserialize(deserializer)) - - -@dataclass -class RetrievalFilterIn: - """ - Knowledge base data sources are returned if they contain a metadata - attribute whose name matches the key and whose value is in the list - specified in the value in this object. - - The following example would return data sources with an animal attribute - that is either 'cat' or 'dog': - `"in": { "key": "animal", "value": ["cat", "dog"] }` - """ - - value: FilterAttribute - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVAL_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVAL_FILTER.members["in"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=FilterAttribute.deserialize(deserializer)) - - -@dataclass -class RetrievalFilterNotIn: - """ - Knowledge base data sources are returned if they contain a metadata - attribute whose name matches the key and whose value isn't in the list - specified in the value in this object. - - The following example would return data sources whose animal attribute - is neither 'cat' nor 'dog': - `"notIn": { "key": "animal", "value": ["cat", "dog"] }` - """ - - value: FilterAttribute - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVAL_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVAL_FILTER.members["notIn"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=FilterAttribute.deserialize(deserializer)) - - -@dataclass -class RetrievalFilterStartsWith: - """ - Knowledge base data sources are returned if they contain a metadata - attribute whose name matches the key and whose value starts with the - value in this object. This filter is currently only supported for Amazon - OpenSearch Serverless vector stores. - - The following example would return data sources with an animal attribute - starts with 'ca' (for example, 'cat' or 'camel'). - `"startsWith": { "key": "animal", "value": "ca" }` - """ - - value: FilterAttribute - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVAL_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RETRIEVAL_FILTER.members["startsWith"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=FilterAttribute.deserialize(deserializer)) - - -@dataclass -class RetrievalFilterListContains: - """ - Knowledge base data sources are returned if they contain a metadata - attribute whose name matches the key and whose value is a list that - contains the value as one of its members. - - The following example would return data sources with an animals - attribute that is a list containing a cat member (for example, - `["dog", "cat"]`): - `"listContains": { "key": "animals", "value": "cat" }` - """ - - value: FilterAttribute - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVAL_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RETRIEVAL_FILTER.members["listContains"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=FilterAttribute.deserialize(deserializer)) - - -@dataclass -class RetrievalFilterStringContains: - """ - Knowledge base data sources are returned if they contain a metadata - attribute whose name matches the key and whose value is one of the - following: - - A string that contains the value as a substring. The following example - would return data sources with an animal attribute that contains the - substring at (for example, 'cat'): - `"stringContains": { "key": "animal", "value": "at" }` - - A list with a member that contains the value as a substring. The - following example would return data sources with an animals attribute - that is a list containing a member that contains the substring at (for - example, `["dog", "cat"]`): - `"stringContains": { "key": "animals", "value": "at" }` - """ - - value: FilterAttribute - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVAL_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RETRIEVAL_FILTER.members["stringContains"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=FilterAttribute.deserialize(deserializer)) - - -@dataclass -class RetrievalFilterAndAll: - """ - Knowledge base data sources are returned if their metadata attributes - fulfill all the filter conditions inside this list. - """ - - value: "list[RetrievalFilter]" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVAL_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_retrieval_filter_list( - serializer, _SCHEMA_RETRIEVAL_FILTER.members["andAll"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_deserialize_retrieval_filter_list( - deserializer, _SCHEMA_RETRIEVAL_FILTER.members["andAll"] - ) - ) - - -@dataclass -class RetrievalFilterOrAll: - """ - Knowledge base data sources are returned if their metadata attributes - fulfill at least one of the filter conditions inside this list. - """ - - value: "list[RetrievalFilter]" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVAL_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_retrieval_filter_list( - serializer, _SCHEMA_RETRIEVAL_FILTER.members["orAll"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_deserialize_retrieval_filter_list( - deserializer, _SCHEMA_RETRIEVAL_FILTER.members["orAll"] - ) - ) - - -@dataclass -class RetrievalFilterUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -RetrievalFilter = Union[ - RetrievalFilterEquals - | RetrievalFilterNotEquals - | RetrievalFilterGreaterThan - | RetrievalFilterGreaterThanOrEquals - | RetrievalFilterLessThan - | RetrievalFilterLessThanOrEquals - | RetrievalFilterIn - | RetrievalFilterNotIn - | RetrievalFilterStartsWith - | RetrievalFilterListContains - | RetrievalFilterStringContains - | RetrievalFilterAndAll - | RetrievalFilterOrAll - | RetrievalFilterUnknown -] -""" -Specifies the filters to use on the metadata attributes/fields in the -knowledge base data sources before returning results. -""" - - -class _RetrievalFilterDeserializer: - _result: RetrievalFilter | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> RetrievalFilter: - self._result = None - deserializer.read_struct(_SCHEMA_RETRIEVAL_FILTER, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(RetrievalFilterEquals.deserialize(de)) - - case 1: - self._set_result(RetrievalFilterNotEquals.deserialize(de)) - - case 2: - self._set_result(RetrievalFilterGreaterThan.deserialize(de)) - - case 3: - self._set_result(RetrievalFilterGreaterThanOrEquals.deserialize(de)) - - case 4: - self._set_result(RetrievalFilterLessThan.deserialize(de)) - - case 5: - self._set_result(RetrievalFilterLessThanOrEquals.deserialize(de)) - - case 6: - self._set_result(RetrievalFilterIn.deserialize(de)) - - case 7: - self._set_result(RetrievalFilterNotIn.deserialize(de)) - - case 8: - self._set_result(RetrievalFilterStartsWith.deserialize(de)) - - case 9: - self._set_result(RetrievalFilterListContains.deserialize(de)) - - case 10: - self._set_result(RetrievalFilterStringContains.deserialize(de)) - - case 11: - self._set_result(RetrievalFilterAndAll.deserialize(de)) - - case 12: - self._set_result(RetrievalFilterOrAll.deserialize(de)) - - case _: - self._set_result( - RetrievalFilterUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: RetrievalFilter) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_retrieval_filter_list( - serializer: ShapeSerializer, schema: Schema, value: list[RetrievalFilter] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_retrieval_filter_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[RetrievalFilter]: - result: list[RetrievalFilter] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_RetrievalFilterDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class KnowledgeBaseVectorSearchConfiguration: - """ - The configuration details for returning the results from the knowledge - base vector search. - """ - - number_of_results: int | None = None - """The number of text chunks to retrieve; the number of results to return.""" - - override_search_type: str | None = None - """ - By default, Amazon Bedrock decides a search strategy for you. If you're - using an Amazon OpenSearch Serverless vector store that contains a - filterable text field, you can specify whether to query the knowledge - base with a `HYBRID` search using both vector embeddings and raw text, - or `SEMANTIC` search using only vector embeddings. For other vector - store configurations, only `SEMANTIC` search is available. - """ - - filter: "RetrievalFilter | None" = field(repr=False, default=None) - """ - Specifies the filters to use on the metadata fields in the knowledge - base data sources before returning results. - """ - - implicit_filter_configuration: ImplicitFilterConfiguration | None = None - """ - Configuration for implicit filtering in Knowledge Base vector searches. - This allows the system to automatically apply filters based on the query - context without requiring explicit filter expressions. - """ - - reranking_configuration: VectorSearchRerankingConfiguration | None = None - """ - Configuration for reranking search results in Knowledge Base vector - searches. Reranking improves search relevance by reordering initial - vector search results using more sophisticated relevance models. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_KNOWLEDGE_BASE_VECTOR_SEARCH_CONFIGURATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.number_of_results is not None: - serializer.write_integer( - _SCHEMA_KNOWLEDGE_BASE_VECTOR_SEARCH_CONFIGURATION.members[ - "numberOfResults" - ], - self.number_of_results, - ) - - if self.override_search_type is not None: - serializer.write_string( - _SCHEMA_KNOWLEDGE_BASE_VECTOR_SEARCH_CONFIGURATION.members[ - "overrideSearchType" - ], - self.override_search_type, - ) - - if self.filter is not None: - serializer.write_struct( - _SCHEMA_KNOWLEDGE_BASE_VECTOR_SEARCH_CONFIGURATION.members["filter"], - self.filter, - ) - - if self.implicit_filter_configuration is not None: - serializer.write_struct( - _SCHEMA_KNOWLEDGE_BASE_VECTOR_SEARCH_CONFIGURATION.members[ - "implicitFilterConfiguration" - ], - self.implicit_filter_configuration, - ) - - if self.reranking_configuration is not None: - serializer.write_struct( - _SCHEMA_KNOWLEDGE_BASE_VECTOR_SEARCH_CONFIGURATION.members[ - "rerankingConfiguration" - ], - self.reranking_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["number_of_results"] = de.read_integer( - _SCHEMA_KNOWLEDGE_BASE_VECTOR_SEARCH_CONFIGURATION.members[ - "numberOfResults" - ] - ) - - case 1: - kwargs["override_search_type"] = SearchType( - de.read_string( - _SCHEMA_KNOWLEDGE_BASE_VECTOR_SEARCH_CONFIGURATION.members[ - "overrideSearchType" - ] - ) - ) - - case 2: - kwargs["filter"] = _RetrievalFilterDeserializer().deserialize(de) - - case 3: - kwargs["implicit_filter_configuration"] = ( - ImplicitFilterConfiguration.deserialize(de) - ) - - case 4: - kwargs["reranking_configuration"] = ( - VectorSearchRerankingConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_KNOWLEDGE_BASE_VECTOR_SEARCH_CONFIGURATION, consumer=_consumer - ) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls() - - -@dataclass(kw_only=True) -class KnowledgeBaseRetrievalConfiguration: - """ - Contains configuration details for retrieving information from a - knowledge base. - """ - - vector_search_configuration: "KnowledgeBaseVectorSearchConfiguration" - """ - Contains configuration details for returning the results from the vector - search. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KNOWLEDGE_BASE_RETRIEVAL_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_KNOWLEDGE_BASE_RETRIEVAL_CONFIGURATION.members[ - "vectorSearchConfiguration" - ], - self.vector_search_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["vector_search_configuration"] = ( - KnowledgeBaseVectorSearchConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_KNOWLEDGE_BASE_RETRIEVAL_CONFIGURATION, consumer=_consumer - ) - if "vector_search_configuration" not in kwargs: - kwargs["vector_search_configuration"] = ( - KnowledgeBaseVectorSearchConfiguration._smithy_default() - ) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls( - vector_search_configuration=KnowledgeBaseVectorSearchConfiguration._smithy_default() - ) - - -@dataclass(kw_only=True) -class KnowledgeBaseRetrieveAndGenerateConfiguration: - """ - Contains configuration details for retrieving information from a - knowledge base and generating responses. - """ - - knowledge_base_id: str - """The unique identifier of the knowledge base.""" - - model_arn: str - """ - The Amazon Resource Name (ARN) of the foundation model or [inference - profile](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html) - used to generate responses. - """ - - retrieval_configuration: "KnowledgeBaseRetrievalConfiguration | None" = None - """Contains configuration details for retrieving text chunks.""" - - generation_configuration: GenerationConfiguration | None = None - """ - Contains configurations details for response generation based on - retrieved text chunks. - """ - - orchestration_configuration: OrchestrationConfiguration | None = None - """ - Contains configuration details for the model to process the prompt prior - to retrieval and response generation. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_KNOWLEDGE_BASE_RETRIEVE_AND_GENERATE_CONFIGURATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_KNOWLEDGE_BASE_RETRIEVE_AND_GENERATE_CONFIGURATION.members[ - "knowledgeBaseId" - ], - self.knowledge_base_id, - ) - serializer.write_string( - _SCHEMA_KNOWLEDGE_BASE_RETRIEVE_AND_GENERATE_CONFIGURATION.members[ - "modelArn" - ], - self.model_arn, - ) - if self.retrieval_configuration is not None: - serializer.write_struct( - _SCHEMA_KNOWLEDGE_BASE_RETRIEVE_AND_GENERATE_CONFIGURATION.members[ - "retrievalConfiguration" - ], - self.retrieval_configuration, - ) - - if self.generation_configuration is not None: - serializer.write_struct( - _SCHEMA_KNOWLEDGE_BASE_RETRIEVE_AND_GENERATE_CONFIGURATION.members[ - "generationConfiguration" - ], - self.generation_configuration, - ) - - if self.orchestration_configuration is not None: - serializer.write_struct( - _SCHEMA_KNOWLEDGE_BASE_RETRIEVE_AND_GENERATE_CONFIGURATION.members[ - "orchestrationConfiguration" - ], - self.orchestration_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["knowledge_base_id"] = de.read_string( - _SCHEMA_KNOWLEDGE_BASE_RETRIEVE_AND_GENERATE_CONFIGURATION.members[ - "knowledgeBaseId" - ] - ) - - case 1: - kwargs["model_arn"] = de.read_string( - _SCHEMA_KNOWLEDGE_BASE_RETRIEVE_AND_GENERATE_CONFIGURATION.members[ - "modelArn" - ] - ) - - case 2: - kwargs["retrieval_configuration"] = ( - KnowledgeBaseRetrievalConfiguration.deserialize(de) - ) - - case 3: - kwargs["generation_configuration"] = ( - GenerationConfiguration.deserialize(de) - ) - - case 4: - kwargs["orchestration_configuration"] = ( - OrchestrationConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_KNOWLEDGE_BASE_RETRIEVE_AND_GENERATE_CONFIGURATION, - consumer=_consumer, - ) - if "knowledge_base_id" not in kwargs: - kwargs["knowledge_base_id"] = "" - if "model_arn" not in kwargs: - kwargs["model_arn"] = "" - return kwargs - - -@dataclass(kw_only=True) -class RetrieveConfig: - """ - The configuration details for retrieving information from a knowledge - base. - """ - - knowledge_base_id: str - """The unique identifier of the knowledge base.""" - - knowledge_base_retrieval_configuration: "KnowledgeBaseRetrievalConfiguration" - """Contains configuration details for knowledge base retrieval.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVE_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_RETRIEVE_CONFIG.members["knowledgeBaseId"], self.knowledge_base_id - ) - serializer.write_struct( - _SCHEMA_RETRIEVE_CONFIG.members["knowledgeBaseRetrievalConfiguration"], - self.knowledge_base_retrieval_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["knowledge_base_id"] = de.read_string( - _SCHEMA_RETRIEVE_CONFIG.members["knowledgeBaseId"] - ) - - case 1: - kwargs["knowledge_base_retrieval_configuration"] = ( - KnowledgeBaseRetrievalConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RETRIEVE_CONFIG, consumer=_consumer) - if "knowledge_base_id" not in kwargs: - kwargs["knowledge_base_id"] = "" - if "knowledge_base_retrieval_configuration" not in kwargs: - kwargs["knowledge_base_retrieval_configuration"] = ( - KnowledgeBaseRetrievalConfiguration._smithy_default() - ) - return kwargs - - -@dataclass(kw_only=True) -class RetrieveAndGenerateConfiguration: - """ - Contains configuration details for a knowledge base retrieval and - response generation. - """ - - type: str - """ - The type of resource that contains your data for retrieving information - and generating responses. - - If you choose to use `EXTERNAL_SOURCES`, then currently only Claude 3 - Sonnet models for knowledge bases are supported. - """ - - knowledge_base_configuration: "KnowledgeBaseRetrieveAndGenerateConfiguration | None" = None - """ - Contains configuration details for the knowledge base retrieval and - response generation. - """ - - external_sources_configuration: ( - ExternalSourcesRetrieveAndGenerateConfiguration | None - ) = None - """ - The configuration for the external source wrapper object in the - `retrieveAndGenerate` function. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVE_AND_GENERATE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_RETRIEVE_AND_GENERATE_CONFIGURATION.members["type"], self.type - ) - if self.knowledge_base_configuration is not None: - serializer.write_struct( - _SCHEMA_RETRIEVE_AND_GENERATE_CONFIGURATION.members[ - "knowledgeBaseConfiguration" - ], - self.knowledge_base_configuration, - ) - - if self.external_sources_configuration is not None: - serializer.write_struct( - _SCHEMA_RETRIEVE_AND_GENERATE_CONFIGURATION.members[ - "externalSourcesConfiguration" - ], - self.external_sources_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = RetrieveAndGenerateType( - de.read_string( - _SCHEMA_RETRIEVE_AND_GENERATE_CONFIGURATION.members["type"] - ) - ) - - case 1: - kwargs["knowledge_base_configuration"] = ( - KnowledgeBaseRetrieveAndGenerateConfiguration.deserialize(de) - ) - - case 2: - kwargs["external_sources_configuration"] = ( - ExternalSourcesRetrieveAndGenerateConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RETRIEVE_AND_GENERATE_CONFIGURATION, consumer=_consumer - ) - if "type" not in kwargs: - kwargs["type"] = RetrieveAndGenerateType._corrected("") - return kwargs - - -@dataclass -class KnowledgeBaseConfigRetrieveConfig: - """ - Contains configuration details for retrieving information from a - knowledge base. - """ - - value: "RetrieveConfig" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KNOWLEDGE_BASE_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_KNOWLEDGE_BASE_CONFIG.members["retrieveConfig"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=RetrieveConfig.deserialize(deserializer)) - - -@dataclass -class KnowledgeBaseConfigRetrieveAndGenerateConfig: - """ - Contains configuration details for retrieving information from a - knowledge base and generating responses. - """ - - value: "RetrieveAndGenerateConfiguration" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KNOWLEDGE_BASE_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_KNOWLEDGE_BASE_CONFIG.members["retrieveAndGenerateConfig"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=RetrieveAndGenerateConfiguration.deserialize(deserializer)) - - -@dataclass -class KnowledgeBaseConfigUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -KnowledgeBaseConfig = Union[ - KnowledgeBaseConfigRetrieveConfig - | KnowledgeBaseConfigRetrieveAndGenerateConfig - | KnowledgeBaseConfigUnknown -] -""" -The configuration details for retrieving information from a knowledge -base and generating responses. -""" - - -class _KnowledgeBaseConfigDeserializer: - _result: KnowledgeBaseConfig | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> KnowledgeBaseConfig: - self._result = None - deserializer.read_struct(_SCHEMA_KNOWLEDGE_BASE_CONFIG, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(KnowledgeBaseConfigRetrieveConfig.deserialize(de)) - - case 1: - self._set_result( - KnowledgeBaseConfigRetrieveAndGenerateConfig.deserialize(de) - ) - - case _: - self._set_result( - KnowledgeBaseConfigUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: KnowledgeBaseConfig) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass -class RAGConfigKnowledgeBaseConfig: - """ - Contains configuration details for knowledge base retrieval and response - generation. - """ - - value: "KnowledgeBaseConfig" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RAG_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RAG_CONFIG.members["knowledgeBaseConfig"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=_KnowledgeBaseConfigDeserializer().deserialize(deserializer)) - - -@dataclass -class RAGConfigPrecomputedRagSourceConfig: - """ - Contains configuration details about the RAG source used to generate - inference response data for a Knowledge Base evaluation job. - """ - - value: EvaluationPrecomputedRagSourceConfig - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RAG_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RAG_CONFIG.members["precomputedRagSourceConfig"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_EvaluationPrecomputedRagSourceConfigDeserializer().deserialize( - deserializer - ) - ) - - -@dataclass -class RAGConfigUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -RAGConfig = Union[ - RAGConfigKnowledgeBaseConfig - | RAGConfigPrecomputedRagSourceConfig - | RAGConfigUnknown -] -""" -Contains configuration details for retrieval of information and response -generation. -""" - - -class _RAGConfigDeserializer: - _result: RAGConfig | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> RAGConfig: - self._result = None - deserializer.read_struct(_SCHEMA_RAG_CONFIG, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(RAGConfigKnowledgeBaseConfig.deserialize(de)) - - case 1: - self._set_result(RAGConfigPrecomputedRagSourceConfig.deserialize(de)) - - case _: - self._set_result(RAGConfigUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: RAGConfig) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_rag_configs( - serializer: ShapeSerializer, schema: Schema, value: list[RAGConfig] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_rag_configs( - deserializer: ShapeDeserializer, schema: Schema -) -> list[RAGConfig]: - result: list[RAGConfig] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_RAGConfigDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass -class EvaluationInferenceConfigModels: - """Specifies the inference models.""" - - value: list[EvaluationModelConfig] - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVALUATION_INFERENCE_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_evaluation_model_configs( - serializer, - _SCHEMA_EVALUATION_INFERENCE_CONFIG.members["models"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_deserialize_evaluation_model_configs( - deserializer, _SCHEMA_EVALUATION_INFERENCE_CONFIG.members["models"] - ) - ) - - -@dataclass -class EvaluationInferenceConfigRagConfigs: - """ - Contains the configuration details of the inference for a knowledge base - evaluation job, including either the retrieval only configuration or the - retrieval with response generation configuration. - """ - - value: "list[RAGConfig]" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVALUATION_INFERENCE_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_rag_configs( - serializer, - _SCHEMA_EVALUATION_INFERENCE_CONFIG.members["ragConfigs"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_deserialize_rag_configs( - deserializer, _SCHEMA_EVALUATION_INFERENCE_CONFIG.members["ragConfigs"] - ) - ) - - -@dataclass -class EvaluationInferenceConfigUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -EvaluationInferenceConfig = Union[ - EvaluationInferenceConfigModels - | EvaluationInferenceConfigRagConfigs - | EvaluationInferenceConfigUnknown -] -""" -The configuration details of the inference model for an evaluation job. - -For automated model evaluation jobs, only a single model is supported. - -For human-based model evaluation jobs, your annotator can compare the -responses for up to two different models. -""" - - -class _EvaluationInferenceConfigDeserializer: - _result: EvaluationInferenceConfig | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> EvaluationInferenceConfig: - self._result = None - deserializer.read_struct(_SCHEMA_EVALUATION_INFERENCE_CONFIG, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(EvaluationInferenceConfigModels.deserialize(de)) - - case 1: - self._set_result(EvaluationInferenceConfigRagConfigs.deserialize(de)) - - case _: - self._set_result( - EvaluationInferenceConfigUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: EvaluationInferenceConfig) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class CreateEvaluationJobInput: - """Dataclass for CreateEvaluationJobInput structure.""" - - job_name: str | None = None - """ - A name for the evaluation job. Names must unique with your Amazon Web - Services account, and your account's Amazon Web Services region. - """ - - job_description: str | None = field(repr=False, default=None) - """A description of the evaluation job.""" - - client_request_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the API request - completes no more than one time. If this token matches a previous - request, Amazon Bedrock ignores the request, but does not return an - error. For more information, see [Ensuring - idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - """ - - role_arn: str | None = None - """ - The Amazon Resource Name (ARN) of an IAM service role that Amazon - Bedrock can assume to perform tasks on your behalf. To learn more about - the required permissions, see [Required permissions for model - evaluations](https://docs.aws.amazon.com/bedrock/latest/userguide/model-evaluation-security.html). - """ - - customer_encryption_key_id: str | None = None - """ - Specify your customer managed encryption key Amazon Resource Name (ARN) - that will be used to encrypt your evaluation job. - """ - - job_tags: list[Tag] | None = None - """Tags to attach to the model evaluation job.""" - - application_type: str | None = None - """ - Specifies whether the evaluation job is for evaluating a model or - evaluating a knowledge base (retrieval and response generation). - """ - - evaluation_config: EvaluationConfig | None = None - """ - Contains the configuration details of either an automated or human-based - evaluation job. - """ - - inference_config: "EvaluationInferenceConfig | None" = None - """ - Contains the configuration details of the inference model for the - evaluation job. - - For model evaluation jobs, automated jobs support a single model or - [inference - profile](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html), - and jobs that use human workers support two models or inference - profiles. - """ - - output_data_config: EvaluationOutputDataConfig | None = None - """ - Contains the configuration details of the Amazon S3 bucket for storing - the results of the evaluation job. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_EVALUATION_JOB_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.job_name is not None: - serializer.write_string( - _SCHEMA_CREATE_EVALUATION_JOB_INPUT.members["jobName"], self.job_name - ) - - if self.job_description is not None: - serializer.write_string( - _SCHEMA_CREATE_EVALUATION_JOB_INPUT.members["jobDescription"], - self.job_description, - ) - - if self.client_request_token is not None: - serializer.write_string( - _SCHEMA_CREATE_EVALUATION_JOB_INPUT.members["clientRequestToken"], - self.client_request_token, - ) - - if self.role_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_EVALUATION_JOB_INPUT.members["roleArn"], self.role_arn - ) - - if self.customer_encryption_key_id is not None: - serializer.write_string( - _SCHEMA_CREATE_EVALUATION_JOB_INPUT.members["customerEncryptionKeyId"], - self.customer_encryption_key_id, - ) - - if self.job_tags is not None: - _serialize_tag_list( - serializer, - _SCHEMA_CREATE_EVALUATION_JOB_INPUT.members["jobTags"], - self.job_tags, - ) - - if self.application_type is not None: - serializer.write_string( - _SCHEMA_CREATE_EVALUATION_JOB_INPUT.members["applicationType"], - self.application_type, - ) - - if self.evaluation_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_EVALUATION_JOB_INPUT.members["evaluationConfig"], - self.evaluation_config, - ) - - if self.inference_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_EVALUATION_JOB_INPUT.members["inferenceConfig"], - self.inference_config, - ) - - if self.output_data_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_EVALUATION_JOB_INPUT.members["outputDataConfig"], - self.output_data_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["job_name"] = de.read_string( - _SCHEMA_CREATE_EVALUATION_JOB_INPUT.members["jobName"] - ) - - case 1: - kwargs["job_description"] = de.read_string( - _SCHEMA_CREATE_EVALUATION_JOB_INPUT.members["jobDescription"] - ) - - case 2: - kwargs["client_request_token"] = de.read_string( - _SCHEMA_CREATE_EVALUATION_JOB_INPUT.members[ - "clientRequestToken" - ] - ) - - case 3: - kwargs["role_arn"] = de.read_string( - _SCHEMA_CREATE_EVALUATION_JOB_INPUT.members["roleArn"] - ) - - case 4: - kwargs["customer_encryption_key_id"] = de.read_string( - _SCHEMA_CREATE_EVALUATION_JOB_INPUT.members[ - "customerEncryptionKeyId" - ] - ) - - case 5: - kwargs["job_tags"] = _deserialize_tag_list( - de, _SCHEMA_CREATE_EVALUATION_JOB_INPUT.members["jobTags"] - ) - - case 6: - kwargs["application_type"] = ApplicationType( - de.read_string( - _SCHEMA_CREATE_EVALUATION_JOB_INPUT.members[ - "applicationType" - ] - ) - ) - - case 7: - kwargs["evaluation_config"] = ( - _EvaluationConfigDeserializer().deserialize(de) - ) - - case 8: - kwargs["inference_config"] = ( - _EvaluationInferenceConfigDeserializer().deserialize(de) - ) - - case 9: - kwargs["output_data_config"] = ( - EvaluationOutputDataConfig.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_EVALUATION_JOB_INPUT, consumer=_consumer - ) - return kwargs - + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) -@dataclass(kw_only=True) -class GetEvaluationJobOutput: - """Dataclass for GetEvaluationJobOutput structure.""" +DELETE_INFERENCE_PROFILE: APIOperation[ + DeleteInferenceProfileInput, DeleteInferenceProfileOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_INFERENCE_PROFILE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#ConflictException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - job_name: str - """The name for the evaluation job.""" +GET_INFERENCE_PROFILE: APIOperation[ + GetInferenceProfileInput, GetInferenceProfileOutput +] = APIOperation( + static_schema=_SCHEMA_GET_INFERENCE_PROFILE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - status: str - """The current status of the evaluation job.""" +LIST_INFERENCE_PROFILES: APIOperation[ + ListInferenceProfilesInput, ListInferenceProfilesOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_INFERENCE_PROFILES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - job_arn: str - """The Amazon Resource Name (ARN) of the evaluation job.""" +DELETE_MODEL_INVOCATION_LOGGING_CONFIGURATION: APIOperation[ + DeleteModelInvocationLoggingConfigurationInput, + DeleteModelInvocationLoggingConfigurationOutput, +] = APIOperation( + static_schema=_SCHEMA_DELETE_MODEL_INVOCATION_LOGGING_CONFIGURATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - role_arn: str - """ - The Amazon Resource Name (ARN) of the IAM service role used in the - evaluation job. - """ +GET_MODEL_INVOCATION_LOGGING_CONFIGURATION: APIOperation[ + GetModelInvocationLoggingConfigurationInput, + GetModelInvocationLoggingConfigurationOutput, +] = APIOperation( + static_schema=_SCHEMA_GET_MODEL_INVOCATION_LOGGING_CONFIGURATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - job_type: str - """Specifies whether the evaluation job is automated or human-based.""" +PUT_MODEL_INVOCATION_LOGGING_CONFIGURATION: APIOperation[ + PutModelInvocationLoggingConfigurationInput, + PutModelInvocationLoggingConfigurationOutput, +] = APIOperation( + static_schema=_SCHEMA_PUT_MODEL_INVOCATION_LOGGING_CONFIGURATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - evaluation_config: EvaluationConfig - """ - Contains the configuration details of either an automated or human-based - evaluation job. - """ +CREATE_MODEL_COPY_JOB: APIOperation[ + CreateModelCopyJobInput, CreateModelCopyJobOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_MODEL_COPY_JOB, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#TooManyTagsException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - inference_config: "EvaluationInferenceConfig" - """ - Contains the configuration details of the inference model used for the - evaluation job. - """ +GET_MODEL_COPY_JOB: APIOperation[GetModelCopyJobInput, GetModelCopyJobOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_MODEL_COPY_JOB, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], + ) +) - output_data_config: EvaluationOutputDataConfig - """ - Contains the configuration details of the Amazon S3 bucket for storing - the results of the evaluation job. - """ +LIST_MODEL_COPY_JOBS: APIOperation[ListModelCopyJobsInput, ListModelCopyJobsOutput] = ( + APIOperation( + static_schema=_SCHEMA_LIST_MODEL_COPY_JOBS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], + ) +) - creation_time: datetime - """The time the evaluation job was created.""" +CREATE_MODEL_IMPORT_JOB: APIOperation[ + CreateModelImportJobInput, CreateModelImportJobOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_MODEL_IMPORT_JOB, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#ConflictException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#TooManyTagsException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - job_description: str | None = field(repr=False, default=None) - """The description of the evaluation job.""" +DELETE_IMPORTED_MODEL: APIOperation[ + DeleteImportedModelInput, DeleteImportedModelOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_IMPORTED_MODEL, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#ConflictException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - customer_encryption_key_id: str | None = None - """ - The Amazon Resource Name (ARN) of the customer managed encryption key - specified when the evaluation job was created. - """ +GET_IMPORTED_MODEL: APIOperation[GetImportedModelInput, GetImportedModelOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_IMPORTED_MODEL, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], + ) +) - application_type: str | None = None - """ - Specifies whether the evaluation job is for evaluating a model or - evaluating a knowledge base (retrieval and response generation). - """ +GET_MODEL_IMPORT_JOB: APIOperation[GetModelImportJobInput, GetModelImportJobOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_MODEL_IMPORT_JOB, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], + ) +) - last_modified_time: datetime | None = None - """The time the evaluation job was last modified.""" +LIST_IMPORTED_MODELS: APIOperation[ + ListImportedModelsInput, ListImportedModelsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_IMPORTED_MODELS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - failure_messages: list[str] | None = None - """A list of strings that specify why the evaluation job failed to create.""" +LIST_MODEL_IMPORT_JOBS: APIOperation[ + ListModelImportJobsInput, ListModelImportJobsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_MODEL_IMPORT_JOBS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ +CREATE_MODEL_INVOCATION_JOB: APIOperation[ + CreateModelInvocationJobInput, CreateModelInvocationJobOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_MODEL_INVOCATION_JOB, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#ConflictException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_EVALUATION_JOB_OUTPUT, self) +GET_MODEL_INVOCATION_JOB: APIOperation[ + GetModelInvocationJobInput, GetModelInvocationJobOutput +] = APIOperation( + static_schema=_SCHEMA_GET_MODEL_INVOCATION_JOB, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_EVALUATION_JOB_OUTPUT.members["jobName"], self.job_name - ) - serializer.write_string( - _SCHEMA_GET_EVALUATION_JOB_OUTPUT.members["status"], self.status - ) - serializer.write_string( - _SCHEMA_GET_EVALUATION_JOB_OUTPUT.members["jobArn"], self.job_arn - ) - if self.job_description is not None: - serializer.write_string( - _SCHEMA_GET_EVALUATION_JOB_OUTPUT.members["jobDescription"], - self.job_description, - ) +LIST_MODEL_INVOCATION_JOBS: APIOperation[ + ListModelInvocationJobsInput, ListModelInvocationJobsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_MODEL_INVOCATION_JOBS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - serializer.write_string( - _SCHEMA_GET_EVALUATION_JOB_OUTPUT.members["roleArn"], self.role_arn - ) - if self.customer_encryption_key_id is not None: - serializer.write_string( - _SCHEMA_GET_EVALUATION_JOB_OUTPUT.members["customerEncryptionKeyId"], - self.customer_encryption_key_id, - ) +STOP_MODEL_INVOCATION_JOB: APIOperation[ + StopModelInvocationJobInput, StopModelInvocationJobOutput +] = APIOperation( + static_schema=_SCHEMA_STOP_MODEL_INVOCATION_JOB, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#ConflictException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - serializer.write_string( - _SCHEMA_GET_EVALUATION_JOB_OUTPUT.members["jobType"], self.job_type - ) - if self.application_type is not None: - serializer.write_string( - _SCHEMA_GET_EVALUATION_JOB_OUTPUT.members["applicationType"], - self.application_type, - ) +GET_FOUNDATION_MODEL: APIOperation[ + GetFoundationModelInput, GetFoundationModelOutput +] = APIOperation( + static_schema=_SCHEMA_GET_FOUNDATION_MODEL, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - serializer.write_struct( - _SCHEMA_GET_EVALUATION_JOB_OUTPUT.members["evaluationConfig"], - self.evaluation_config, - ) - serializer.write_struct( - _SCHEMA_GET_EVALUATION_JOB_OUTPUT.members["inferenceConfig"], - self.inference_config, - ) - serializer.write_struct( - _SCHEMA_GET_EVALUATION_JOB_OUTPUT.members["outputDataConfig"], - self.output_data_config, - ) - serializer.write_timestamp( - _SCHEMA_GET_EVALUATION_JOB_OUTPUT.members["creationTime"], - self.creation_time, - ) - if self.last_modified_time is not None: - serializer.write_timestamp( - _SCHEMA_GET_EVALUATION_JOB_OUTPUT.members["lastModifiedTime"], - self.last_modified_time, - ) +LIST_FOUNDATION_MODELS: APIOperation[ + ListFoundationModelsInput, ListFoundationModelsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_FOUNDATION_MODELS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - if self.failure_messages is not None: - _serialize_error_messages( - serializer, - _SCHEMA_GET_EVALUATION_JOB_OUTPUT.members["failureMessages"], - self.failure_messages, - ) +CREATE_PROMPT_ROUTER: APIOperation[ + CreatePromptRouterInput, CreatePromptRouterOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_PROMPT_ROUTER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#ConflictException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#TooManyTagsException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) +DELETE_PROMPT_ROUTER: APIOperation[ + DeletePromptRouterInput, DeletePromptRouterOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_PROMPT_ROUTER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +GET_PROMPT_ROUTER: APIOperation[GetPromptRouterInput, GetPromptRouterOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_PROMPT_ROUTER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], + ) +) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["job_name"] = de.read_string( - _SCHEMA_GET_EVALUATION_JOB_OUTPUT.members["jobName"] - ) +LIST_PROMPT_ROUTERS: APIOperation[ListPromptRoutersInput, ListPromptRoutersOutput] = ( + APIOperation( + static_schema=_SCHEMA_LIST_PROMPT_ROUTERS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], + ) +) - case 1: - kwargs["status"] = EvaluationJobStatus( - de.read_string( - _SCHEMA_GET_EVALUATION_JOB_OUTPUT.members["status"] - ) - ) +CREATE_PROVISIONED_MODEL_THROUGHPUT: APIOperation[ + CreateProvisionedModelThroughputInput, CreateProvisionedModelThroughputOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_PROVISIONED_MODEL_THROUGHPUT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#TooManyTagsException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - case 2: - kwargs["job_arn"] = de.read_string( - _SCHEMA_GET_EVALUATION_JOB_OUTPUT.members["jobArn"] - ) +DELETE_PROVISIONED_MODEL_THROUGHPUT: APIOperation[ + DeleteProvisionedModelThroughputInput, DeleteProvisionedModelThroughputOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_PROVISIONED_MODEL_THROUGHPUT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#ConflictException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - case 3: - kwargs["job_description"] = de.read_string( - _SCHEMA_GET_EVALUATION_JOB_OUTPUT.members["jobDescription"] - ) +GET_PROVISIONED_MODEL_THROUGHPUT: APIOperation[ + GetProvisionedModelThroughputInput, GetProvisionedModelThroughputOutput +] = APIOperation( + static_schema=_SCHEMA_GET_PROVISIONED_MODEL_THROUGHPUT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - case 4: - kwargs["role_arn"] = de.read_string( - _SCHEMA_GET_EVALUATION_JOB_OUTPUT.members["roleArn"] - ) +LIST_PROVISIONED_MODEL_THROUGHPUTS: APIOperation[ + ListProvisionedModelThroughputsInput, ListProvisionedModelThroughputsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_PROVISIONED_MODEL_THROUGHPUTS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - case 5: - kwargs["customer_encryption_key_id"] = de.read_string( - _SCHEMA_GET_EVALUATION_JOB_OUTPUT.members[ - "customerEncryptionKeyId" - ] - ) +UPDATE_PROVISIONED_MODEL_THROUGHPUT: APIOperation[ + UpdateProvisionedModelThroughputInput, UpdateProvisionedModelThroughputOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_PROVISIONED_MODEL_THROUGHPUT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - case 6: - kwargs["job_type"] = EvaluationJobType( - de.read_string( - _SCHEMA_GET_EVALUATION_JOB_OUTPUT.members["jobType"] - ) - ) +DELETE_RESOURCE_POLICY: APIOperation[ + DeleteResourcePolicyInput, DeleteResourcePolicyOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_RESOURCE_POLICY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - case 7: - kwargs["application_type"] = ApplicationType( - de.read_string( - _SCHEMA_GET_EVALUATION_JOB_OUTPUT.members["applicationType"] - ) - ) +GET_RESOURCE_POLICY: APIOperation[GetResourcePolicyInput, GetResourcePolicyOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_RESOURCE_POLICY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], + ) +) - case 8: - kwargs["evaluation_config"] = ( - _EvaluationConfigDeserializer().deserialize(de) - ) +PUT_RESOURCE_POLICY: APIOperation[PutResourcePolicyInput, PutResourcePolicyOutput] = ( + APIOperation( + static_schema=_SCHEMA_PUT_RESOURCE_POLICY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#ConflictException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], + ) +) - case 9: - kwargs["inference_config"] = ( - _EvaluationInferenceConfigDeserializer().deserialize(de) - ) +CREATE_FOUNDATION_MODEL_AGREEMENT: APIOperation[ + CreateFoundationModelAgreementInput, CreateFoundationModelAgreementOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_FOUNDATION_MODEL_AGREEMENT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#ConflictException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - case 10: - kwargs["output_data_config"] = ( - EvaluationOutputDataConfig.deserialize(de) - ) +DELETE_FOUNDATION_MODEL_AGREEMENT: APIOperation[ + DeleteFoundationModelAgreementInput, DeleteFoundationModelAgreementOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_FOUNDATION_MODEL_AGREEMENT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#ConflictException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - case 11: - kwargs["creation_time"] = de.read_timestamp( - _SCHEMA_GET_EVALUATION_JOB_OUTPUT.members["creationTime"] - ) +GET_FOUNDATION_MODEL_AVAILABILITY: APIOperation[ + GetFoundationModelAvailabilityInput, GetFoundationModelAvailabilityOutput +] = APIOperation( + static_schema=_SCHEMA_GET_FOUNDATION_MODEL_AVAILABILITY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - case 12: - kwargs["last_modified_time"] = de.read_timestamp( - _SCHEMA_GET_EVALUATION_JOB_OUTPUT.members["lastModifiedTime"] - ) +LIST_FOUNDATION_MODEL_AGREEMENT_OFFERS: APIOperation[ + ListFoundationModelAgreementOffersInput, ListFoundationModelAgreementOffersOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_FOUNDATION_MODEL_AGREEMENT_OFFERS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - case 13: - kwargs["failure_messages"] = _deserialize_error_messages( - de, _SCHEMA_GET_EVALUATION_JOB_OUTPUT.members["failureMessages"] - ) +LIST_TAGS_FOR_RESOURCE: APIOperation[ + ListTagsForResourceInput, ListTagsForResourceOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_TAGS_FOR_RESOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - case _: - logger.debug("Unexpected member schema: %s", schema) +TAG_RESOURCE: APIOperation[TagResourceInput, TagResourceOutput] = APIOperation( + static_schema=_SCHEMA_TAG_RESOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#TooManyTagsException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) - deserializer.read_struct(_SCHEMA_GET_EVALUATION_JOB_OUTPUT, consumer=_consumer) - if "job_name" not in kwargs: - kwargs["job_name"] = "" - if "status" not in kwargs: - kwargs["status"] = EvaluationJobStatus._corrected("") - if "job_arn" not in kwargs: - kwargs["job_arn"] = "" - if "role_arn" not in kwargs: - kwargs["role_arn"] = "" - if "job_type" not in kwargs: - kwargs["job_type"] = EvaluationJobType._corrected("") - if "evaluation_config" not in kwargs: - kwargs["evaluation_config"] = EvaluationConfigUnknown(tag="") - if "inference_config" not in kwargs: - kwargs["inference_config"] = EvaluationInferenceConfigUnknown(tag="") - if "output_data_config" not in kwargs: - kwargs["output_data_config"] = EvaluationOutputDataConfig._smithy_default() - if "creation_time" not in kwargs: - kwargs["creation_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs +UNTAG_RESOURCE: APIOperation[UntagResourceInput, UntagResourceOutput] = APIOperation( + static_schema=_SCHEMA_UNTAG_RESOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) +CREATE_MODEL_CUSTOMIZATION_JOB: APIOperation[ + CreateModelCustomizationJobInput, CreateModelCustomizationJobOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_MODEL_CUSTOMIZATION_JOB, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#ConflictException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#TooManyTagsException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], +) -CREATE_EVALUATION_JOB = APIOperation( - input=CreateEvaluationJobInput, - output=CreateEvaluationJobOutput, - schema=_SCHEMA_CREATE_EVALUATION_JOB, - input_schema=_SCHEMA_CREATE_EVALUATION_JOB_INPUT, - output_schema=_SCHEMA_CREATE_EVALUATION_JOB_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.bedrock#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.bedrock#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), +GET_MODEL_CUSTOMIZATION_JOB: APIOperation[ + GetModelCustomizationJobInput, GetModelCustomizationJobOutput +] = APIOperation( + static_schema=_SCHEMA_GET_MODEL_CUSTOMIZATION_JOB, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], effective_auth_schemes=[ ShapeID("aws.auth#sigv4"), ShapeID("smithy.api#httpBearerAuth"), ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, +) + +LIST_MODEL_CUSTOMIZATION_JOBS: APIOperation[ + ListModelCustomizationJobsInput, ListModelCustomizationJobsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_MODEL_CUSTOMIZATION_JOBS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), ], ) -GET_EVALUATION_JOB = APIOperation( - input=GetEvaluationJobInput, - output=GetEvaluationJobOutput, - schema=_SCHEMA_GET_EVALUATION_JOB, - input_schema=_SCHEMA_GET_EVALUATION_JOB_INPUT, - output_schema=_SCHEMA_GET_EVALUATION_JOB_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.bedrock#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.bedrock#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.bedrock#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.bedrock#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.bedrock#ValidationException"): ValidationException, - } - ), +STOP_MODEL_CUSTOMIZATION_JOB: APIOperation[ + StopModelCustomizationJobInput, StopModelCustomizationJobOutput +] = APIOperation( + static_schema=_SCHEMA_STOP_MODEL_CUSTOMIZATION_JOB, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#ConflictException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], effective_auth_schemes=[ ShapeID("aws.auth#sigv4"), ShapeID("smithy.api#httpBearerAuth"), ], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, +) + +CREATE_EVALUATION_JOB: APIOperation[ + CreateEvaluationJobInput, CreateEvaluationJobOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_EVALUATION_JOB, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#ConflictException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), ], ) + +GET_EVALUATION_JOB: APIOperation[GetEvaluationJobInput, GetEvaluationJobOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_EVALUATION_JOB, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.bedrock#AccessDeniedException"), + ShapeID("com.amazonaws.bedrock#InternalServerException"), + ShapeID("com.amazonaws.bedrock#ResourceNotFoundException"), + ShapeID("com.amazonaws.bedrock#ThrottlingException"), + ShapeID("com.amazonaws.bedrock#ValidationException"), + ], + effective_auth_schemes=[ + ShapeID("aws.auth#sigv4"), + ShapeID("smithy.api#httpBearerAuth"), + ], + ) +) diff --git a/clients/aws-sdk-bedrock/src/aws_sdk_bedrock/models.pyi b/clients/aws-sdk-bedrock/src/aws_sdk_bedrock/models.pyi new file mode 100644 index 00000000..040d9605 --- /dev/null +++ b/clients/aws-sdk-bedrock/src/aws_sdk_bedrock/models.pyi @@ -0,0 +1,12017 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. + +from dataclasses import dataclass +from datetime import datetime +from enum import StrEnum +from typing import Self, Union + +from smithy_core.deserializers import ShapeDeserializer +from smithy_core.documents import Document +from smithy_core.exceptions import ModeledError +from smithy_core.response import ResponseMetadata +from smithy_core.schemas import APIOperation +from smithy_core.serializers import ShapeSerializer +from smithy_core.types import UnknownEnumMixin + +class _SerdeShape: + def serialize(self, serializer: ShapeSerializer) -> None: ... + def serialize_members(self, serializer: ShapeSerializer) -> None: ... + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: ... + +class ServiceError(ModeledError): + """ + Base error for all errors in the service. + + Some exceptions do not extend from this class, including + synthetic, implicit, and shared exception types. + """ + +@dataclass(kw_only=True) +class AccessDeniedException(ServiceError, _SerdeShape): + """The request is denied because of missing access permissions.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class AccountEnforcedGuardrailInferenceInputConfiguration(_SerdeShape): + """Account-level enforced guardrail input configuration.""" + + guardrail_identifier: str + """Identifier for the guardrail, could be the ID or the ARN.""" + guardrail_version: str + """Numerical guardrail version.""" + selective_content_guarding: SelectiveContentGuarding | None = ... + """Selective content guarding controls for enforced guardrails.""" + model_enforcement: ModelEnforcement | None = ... + """ + Model-specific information for the enforced guardrail configuration. If + not present, the configuration is enforced on all models + """ + +@dataclass(kw_only=True) +class AccountEnforcedGuardrailOutputConfiguration(_SerdeShape): + """Account enforced guardrail output configuration.""" + + config_id: str | None = ... + """Unique ID for the account enforced configuration.""" + guardrail_arn: str | None = ... + """ARN representation for the guardrail.""" + guardrail_id: str | None = ... + """Unique ID for the guardrail.""" + input_tags: str | None = ... + """Whether to honor or ignore input tags at runtime.""" + selective_content_guarding: SelectiveContentGuarding | None = ... + """Selective content guarding controls for enforced guardrails.""" + guardrail_version: str | None = ... + """Numerical guardrail version.""" + created_at: datetime | None = ... + """Timestamp.""" + created_by: str | None = ... + """The ARN of the role used to update the configuration.""" + updated_at: datetime | None = ... + """Timestamp.""" + updated_by: str | None = ... + """The ARN of the role used to update the configuration.""" + owner: str | None = ... + """Configuration owner type.""" + model_enforcement: ModelEnforcement | None = ... + """Model-specific information for the enforced guardrail configuration.""" + +@dataclass(kw_only=True) +class AdvancedPromptOptimizationInputConfig(_SerdeShape): + """ + Contains the input data configuration for an advanced prompt + optimization job. + """ + + s3_uri: str + """ + The S3 URI of the JSONL input file containing prompt templates and + evaluation samples. + """ + +class AdvancedPromptOptimizationJobStatus(UnknownEnumMixin, StrEnum): + """The status of an advanced prompt optimization job.""" + + IN_PROGRESS = "InProgress" + COMPLETED = "Completed" + FAILED = "Failed" + PARTIALLY_COMPLETED = "PartiallyCompleted" + STOPPING = "Stopping" + STOPPED = "Stopped" + DELETING = "Deleting" + +@dataclass(kw_only=True) +class AdvancedPromptOptimizationJobSummary(_SerdeShape): + """Contains a summary of an advanced prompt optimization job.""" + + job_arn: str + """The Amazon Resource Name (ARN) of the job.""" + job_name: str + """The name of the job.""" + job_status: str + """The status of the job.""" + creation_time: datetime + """The time at which the job was created.""" + last_modified_time: datetime | None = ... + """The time at which the job was last modified.""" + +@dataclass(kw_only=True) +class AdvancedPromptOptimizationOutputConfig(_SerdeShape): + """ + Contains the output data configuration for an advanced prompt + optimization job. + """ + + s3_uri: str + """The S3 URI prefix where the optimization results will be written.""" + +@dataclass(kw_only=True) +class AgreementAvailability(_SerdeShape): + """Information about the agreement availability""" + + status: str + """Status of the agreement.""" + error_message: str | None = ... + """Error message.""" + +class AgreementStatus(UnknownEnumMixin, StrEnum): + AVAILABLE = "AVAILABLE" + PENDING = "PENDING" + NOT_AVAILABLE = "NOT_AVAILABLE" + ERROR = "ERROR" + +class ApplicationType(UnknownEnumMixin, StrEnum): + MODEL_EVALUATION = "ModelEvaluation" + RAG_EVALUATION = "RagEvaluation" + +class AttributeType(UnknownEnumMixin, StrEnum): + STRING = "STRING" + NUMBER = "NUMBER" + BOOLEAN = "BOOLEAN" + STRING_LIST = "STRING_LIST" + +class AuthorizationStatus(UnknownEnumMixin, StrEnum): + AUTHORIZED = "AUTHORIZED" + NOT_AUTHORIZED = "NOT_AUTHORIZED" + +@dataclass(kw_only=True) +class AutomatedEvaluationConfig(_SerdeShape): + """ + The configuration details of an automated evaluation job. The + `EvaluationDatasetMetricConfig` object is used to specify the prompt + datasets, task type, and metric names. + """ + + dataset_metric_configs: list[EvaluationDatasetMetricConfig] + """ + Configuration details of the prompt datasets and metrics you want to use + for your evaluation job. + """ + evaluator_model_config: EvaluatorModelConfig | None = ... + """ + Contains the evaluator model configuration details. + `EvaluatorModelConfig` is required for evaluation jobs that use a + knowledge base or in model evaluation job that use a model as judge. + This model computes all evaluation related metrics. + """ + custom_metric_config: AutomatedEvaluationCustomMetricConfig | None = ... + """ + Defines the configuration of custom metrics to be used in an evaluation + job. + """ + +@dataclass(kw_only=True) +class AutomatedEvaluationCustomMetricConfig(_SerdeShape): + """ + Defines the configuration of custom metrics to be used in an evaluation + job. To learn more about using custom metrics in Amazon Bedrock + evaluation jobs, see [Create a prompt for a custom metrics + (LLM-as-a-judge model + evaluations)](https://docs.aws.amazon.com/bedrock/latest/userguide/model-evaluation-custom-metrics-prompt-formats.html) + and [Create a prompt for a custom metrics (RAG + evaluations)](https://docs.aws.amazon.com/bedrock/latest/userguide/kb-evaluation-custom-metrics-prompt-formats.html). + """ + + custom_metrics: list[AutomatedEvaluationCustomMetricSource] + """ + Defines a list of custom metrics to be used in an Amazon Bedrock + evaluation job. + """ + evaluator_model_config: CustomMetricEvaluatorModelConfig + """ + Configuration of the evaluator model you want to use to evaluate custom + metrics in an Amazon Bedrock evaluation job. + """ + +@dataclass +class AutomatedEvaluationCustomMetricSourceCustomMetricDefinition(_SerdeShape): + """ + The definition of a custom metric for use in an Amazon Bedrock + evaluation job. + """ + + value: CustomMetricDefinition + +@dataclass +class AutomatedEvaluationCustomMetricSourceUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +AutomatedEvaluationCustomMetricSource = Union[ + AutomatedEvaluationCustomMetricSourceCustomMetricDefinition + | AutomatedEvaluationCustomMetricSourceUnknown +] +""" +An array item definining a single custom metric for use in an Amazon +Bedrock evaluation job. +""" + +class _AutomatedEvaluationCustomMetricSourceDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> AutomatedEvaluationCustomMetricSource: ... + +@dataclass +class AutomatedReasoningCheckFindingValid(_SerdeShape): + """ + Indicates that the claims are true. The claims are implied by the + premises and the Automated Reasoning policy. Given the Automated + Reasoning policy and premises, it is not possible for these claims to be + false. + """ + + value: AutomatedReasoningCheckValidFinding + +@dataclass +class AutomatedReasoningCheckFindingInvalid(_SerdeShape): + """ + Indicates that the claims are false. The claims are not implied by the + premises and Automated Reasoning policy. Furthermore, there exist + different claims that are consistent with the premises and Automated + Reasoning policy. + """ + + value: AutomatedReasoningCheckInvalidFinding + +@dataclass +class AutomatedReasoningCheckFindingSatisfiable(_SerdeShape): + """ + Indicates that the claims can be true or false. It depends on what + assumptions are made for the claim to be implied from the premises and + Automated Reasoning policy rules. In this situation, different + assumptions can make input claims false and alternative claims true. + """ + + value: AutomatedReasoningCheckSatisfiableFinding + +@dataclass +class AutomatedReasoningCheckFindingImpossible(_SerdeShape): + """ + Indicates that Automated Reasoning cannot make a statement about the + claims. This can happen if the premises are logically incorrect, or if + there is a conflict within the Automated Reasoning policy itself. + """ + + value: AutomatedReasoningCheckImpossibleFinding + +@dataclass +class AutomatedReasoningCheckFindingTranslationAmbiguous(_SerdeShape): + """ + Indicates that an ambiguity was detected in the translation, making it + unsound to continue with validity checking. Additional context or + follow-up questions might be needed to get translation to succeed. + """ + + value: AutomatedReasoningCheckTranslationAmbiguousFinding + +@dataclass +class AutomatedReasoningCheckFindingTooComplex(_SerdeShape): + """ + Indicates that the input contains too much information for Automated + Reasoning to process within its latency limits. + """ + + value: AutomatedReasoningCheckTooComplexFinding + +@dataclass +class AutomatedReasoningCheckFindingNoTranslations(_SerdeShape): + """ + Identifies that some or all of the input prompt wasn't translated into + logic. This can happen if the input isn't relevant to the Automated + Reasoning policy, or if the policy doesn't have variables to model + relevant input. + """ + + value: AutomatedReasoningCheckNoTranslationsFinding + +@dataclass +class AutomatedReasoningCheckFindingUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +AutomatedReasoningCheckFinding = Union[ + AutomatedReasoningCheckFindingValid + | AutomatedReasoningCheckFindingInvalid + | AutomatedReasoningCheckFindingSatisfiable + | AutomatedReasoningCheckFindingImpossible + | AutomatedReasoningCheckFindingTranslationAmbiguous + | AutomatedReasoningCheckFindingTooComplex + | AutomatedReasoningCheckFindingNoTranslations + | AutomatedReasoningCheckFindingUnknown +] +""" +Represents the result of an Automated Reasoning validation check, +indicating whether the content is logically valid, invalid, or falls +into other categories based on the policy rules. +""" + +class _AutomatedReasoningCheckFindingDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> AutomatedReasoningCheckFinding: ... + +@dataclass(kw_only=True) +class AutomatedReasoningCheckImpossibleFinding(_SerdeShape): + """ + Indicates that no valid claims can be made due to logical contradictions + in the premises or rules. + """ + + translation: AutomatedReasoningCheckTranslation | None = ... + """The logical translation of the input that this finding evaluates.""" + contradicting_rules: list[AutomatedReasoningCheckRule] | None = ... + """ + The automated reasoning policy rules that contradict the claims and/or + premises in the input. + """ + logic_warning: AutomatedReasoningCheckLogicWarning | None = ... + """ + Indication of a logic issue with the translation without needing to + consider the automated reasoning policy rules. + """ + +@dataclass(kw_only=True) +class AutomatedReasoningCheckInputTextReference(_SerdeShape): + """ + References a portion of the original input text that corresponds to + logical elements. + """ + + text: str | None = ... + """The specific text from the original input that this reference points to.""" + +@dataclass(kw_only=True) +class AutomatedReasoningCheckInvalidFinding(_SerdeShape): + """ + Indicates that the claims are logically false and contradictory to the + established rules or premises. + """ + + translation: AutomatedReasoningCheckTranslation | None = ... + """The logical translation of the input that this finding invalidates.""" + contradicting_rules: list[AutomatedReasoningCheckRule] | None = ... + """ + The automated reasoning policy rules that contradict the claims in the + input. + """ + logic_warning: AutomatedReasoningCheckLogicWarning | None = ... + """ + Indication of a logic issue with the translation without needing to + consider the automated reasoning policy rules. + """ + +@dataclass(kw_only=True) +class AutomatedReasoningCheckLogicWarning(_SerdeShape): + """ + Identifies logical issues in the translated statements that exist + independent of any policy rules, such as statements that are always true + or always false. + """ + + type: str | None = ... + """ + The category of the detected logical issue, such as statements that are + always true or always false. + """ + premises: list[AutomatedReasoningLogicStatement] | None = ... + """ + The logical statements that serve as premises under which the claims are + validated. + """ + claims: list[AutomatedReasoningLogicStatement] | None = ... + """ + The logical statements that are validated while assuming the policy and + premises. + """ + +class AutomatedReasoningCheckLogicWarningType(UnknownEnumMixin, StrEnum): + ALWAYS_TRUE = "ALWAYS_TRUE" + ALWAYS_FALSE = "ALWAYS_FALSE" + +@dataclass(kw_only=True) +class AutomatedReasoningCheckNoTranslationsFinding(_SerdeShape): + """ + Indicates that no relevant logical information could be extracted from + the input for validation. + """ + +class AutomatedReasoningCheckResult(UnknownEnumMixin, StrEnum): + VALID = "VALID" + INVALID = "INVALID" + SATISFIABLE = "SATISFIABLE" + IMPOSSIBLE = "IMPOSSIBLE" + TRANSLATION_AMBIGUOUS = "TRANSLATION_AMBIGUOUS" + TOO_COMPLEX = "TOO_COMPLEX" + NO_TRANSLATION = "NO_TRANSLATION" + +@dataclass(kw_only=True) +class AutomatedReasoningCheckRule(_SerdeShape): + """ + References a specific automated reasoning policy rule that was applied + during evaluation. + """ + + id: str | None = ... + """The unique identifier of the automated reasoning rule.""" + policy_version_arn: str | None = ... + """ + The ARN of the automated reasoning policy version that contains this + rule. + """ + +@dataclass(kw_only=True) +class AutomatedReasoningCheckSatisfiableFinding(_SerdeShape): + """ + Indicates that the claims could be either true or false depending on + additional assumptions not provided in the input. + """ + + translation: AutomatedReasoningCheckTranslation | None = ... + """The logical translation of the input that this finding evaluates.""" + claims_true_scenario: AutomatedReasoningCheckScenario | None = ... + """ + An example scenario demonstrating how the claims could be logically + true. + """ + claims_false_scenario: AutomatedReasoningCheckScenario | None = ... + """ + An example scenario demonstrating how the claims could be logically + false. + """ + logic_warning: AutomatedReasoningCheckLogicWarning | None = ... + """ + Indication of a logic issue with the translation without needing to + consider the automated reasoning policy rules. + """ + +@dataclass(kw_only=True) +class AutomatedReasoningCheckScenario(_SerdeShape): + """ + Represents a logical scenario where claims can be evaluated as true or + false, containing specific logical assignments. + """ + + statements: list[AutomatedReasoningLogicStatement] | None = ... + """List of logical assignments and statements that define this scenario.""" + +@dataclass(kw_only=True) +class AutomatedReasoningCheckTooComplexFinding(_SerdeShape): + """ + Indicates that the input exceeds the processing capacity due to the + volume or complexity of the logical information. + """ + +@dataclass(kw_only=True) +class AutomatedReasoningCheckTranslation(_SerdeShape): + """ + Contains the logical translation of natural language input into formal + logical statements, including premises, claims, and confidence scores. + """ + + premises: list[AutomatedReasoningLogicStatement] | None = ... + """ + The logical statements that serve as the foundation or assumptions for + the claims. + """ + claims: list[AutomatedReasoningLogicStatement] + """ + The logical statements that are being validated against the premises and + policy rules. + """ + untranslated_premises: list[AutomatedReasoningCheckInputTextReference] | None = ... + """ + References to portions of the original input text that correspond to the + premises but could not be fully translated. + """ + untranslated_claims: list[AutomatedReasoningCheckInputTextReference] | None = ... + """ + References to portions of the original input text that correspond to the + claims but could not be fully translated. + """ + confidence: float + """ + A confidence score between 0 and 1 indicating how certain the system is + about the logical translation. + """ + +@dataclass(kw_only=True) +class AutomatedReasoningCheckTranslationAmbiguousFinding(_SerdeShape): + """ + Indicates that the input has multiple valid logical interpretations, + requiring additional context or clarification. + """ + + options: list[AutomatedReasoningCheckTranslationOption] | None = ... + """ + Different logical interpretations that were detected during translation + of the input. + """ + difference_scenarios: list[AutomatedReasoningCheckScenario] | None = ... + """ + Scenarios showing how the different translation options differ in + meaning. + """ + +@dataclass(kw_only=True) +class AutomatedReasoningCheckTranslationOption(_SerdeShape): + """ + Represents one possible logical interpretation of ambiguous input + content. + """ + + translations: list[AutomatedReasoningCheckTranslation] | None = ... + """ + Different logical interpretations that were detected during translation + of the input. + """ + +@dataclass(kw_only=True) +class AutomatedReasoningCheckValidFinding(_SerdeShape): + """ + Indicates that the claims are definitively true and logically implied by + the premises, with no possible alternative interpretations. + """ + + translation: AutomatedReasoningCheckTranslation | None = ... + """The logical translation of the input that this finding validates.""" + claims_true_scenario: AutomatedReasoningCheckScenario | None = ... + """An example scenario demonstrating how the claims are logically true.""" + supporting_rules: list[AutomatedReasoningCheckRule] | None = ... + """ + The automated reasoning policy rules that support why this result is + considered valid. + """ + logic_warning: AutomatedReasoningCheckLogicWarning | None = ... + """ + Indication of a logic issue with the translation without needing to + consider the automated reasoning policy rules. + """ + +@dataclass(kw_only=True) +class AutomatedReasoningLogicStatement(_SerdeShape): + """ + Represents a logical statement that can be expressed both in formal + logic notation and natural language, providing dual representations for + better understanding and validation. + """ + + logic: str + """ + The formal logic representation of the statement using mathematical + notation and logical operators. + """ + natural_language: str | None = ... + """ + The natural language representation of the logical statement, providing + a human-readable interpretation of the formal logic. + """ + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyAddRuleAnnotation(_SerdeShape): + """ + An annotation for adding a new rule to an Automated Reasoning policy + using a formal logical expression. + """ + + expression: str + """ + The formal logical expression that defines the rule, using mathematical + notation and referencing policy variables and types. + """ + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyAddRuleFromNaturalLanguageAnnotation(_SerdeShape): + """ + An annotation for adding a new rule to the policy by converting a + natural language description into a formal logical expression. + """ + + natural_language: str + """ + The natural language description of the rule that should be converted + into a formal logical expression. + """ + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyAddRuleMutation(_SerdeShape): + """ + A mutation operation that adds a new rule to the policy definition + during the build process. + """ + + rule: AutomatedReasoningPolicyDefinitionRule + """ + The rule definition that specifies the formal logical expression and + metadata for the new rule being added to the policy. + """ + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyAddTypeAnnotation(_SerdeShape): + """ + An annotation for adding a new custom type to an Automated Reasoning + policy, defining a set of possible values for variables. + """ + + name: str + """ + The name of the new custom type. This name will be used to reference the + type in variable definitions and rules. + """ + description: str + """ + A description of what the custom type represents and how it should be + used in the policy. + """ + values: list[AutomatedReasoningPolicyDefinitionTypeValue] + """ + The list of possible values that variables of this type can take, each + with its own description and identifier. + """ + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyAddTypeMutation(_SerdeShape): + """ + A mutation operation that adds a new custom type to the policy + definition during the build process. + """ + + type: AutomatedReasoningPolicyDefinitionType + """ + The type definition that specifies the name, description, and possible + values for the new custom type being added to the policy. + """ + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyAddTypeValue(_SerdeShape): + """ + Represents a single value that can be added to an existing custom type + in the policy. + """ + + value: str + """The identifier or name of the new value to add to the type.""" + description: str | None = ... + """ + A description of what this new type value represents and when it should + be used. + """ + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyAddVariableAnnotation(_SerdeShape): + """ + An annotation for adding a new variable to an Automated Reasoning + policy, which can be used in rule expressions. + """ + + name: str + """ + The name of the new variable. This name will be used to reference the + variable in rule expressions. + """ + type: str + """ + The type of the variable, which can be a built-in type (like string or + number) or a custom type defined in the policy. + """ + description: str + """ + A description of what the variable represents and how it should be used + in rules. + """ + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyAddVariableMutation(_SerdeShape): + """ + A mutation operation that adds a new variable to the policy definition + during the build process. + """ + + variable: AutomatedReasoningPolicyDefinitionVariable + """ + The variable definition that specifies the name, type, and description + for the new variable being added to the policy. + """ + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyAnnotatedChunk(_SerdeShape): + """ + Represents a portion of a source document with line number annotations. + Chunks help organize document content for easier navigation and + reference. + """ + + page_number: int | None = ... + """ + The page number where this chunk begins, if the document is divided into + pages. + """ + content: list[AutomatedReasoningPolicyAnnotatedContent] + """ + The lines of text contained within this chunk, each annotated with its + line number. + """ + +@dataclass +class AutomatedReasoningPolicyAnnotatedContentLine(_SerdeShape): + """ + An annotated line of text from the source document, including both the + line number and the text content. + """ + + value: AutomatedReasoningPolicyAnnotatedLine + +@dataclass +class AutomatedReasoningPolicyAnnotatedContentUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +AutomatedReasoningPolicyAnnotatedContent = Union[ + AutomatedReasoningPolicyAnnotatedContentLine + | AutomatedReasoningPolicyAnnotatedContentUnknown +] +""" +Represents a content element within an annotated chunk. This union type +allows for different types of content elements to be included in +document chunks, such as individual lines of text with their line +numbers. +""" + +class _AutomatedReasoningPolicyAnnotatedContentDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> AutomatedReasoningPolicyAnnotatedContent: ... + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyAnnotatedLine(_SerdeShape): + """ + Represents a single line of text from a source document, annotated with + its line number for precise referencing. + """ + + line_number: int | None = ... + """The line number of this text within the source document.""" + line_text: str | None = ... + """The actual text content of this line from the source document.""" + +@dataclass +class AutomatedReasoningPolicyAnnotationAddType(_SerdeShape): + """ + An operation to add a new custom type to the policy, defining a set of + possible values for policy variables. + """ + + value: AutomatedReasoningPolicyAddTypeAnnotation + +@dataclass +class AutomatedReasoningPolicyAnnotationUpdateType(_SerdeShape): + """ + An operation to modify an existing custom type in the policy, such as + changing its name, description, or allowed values. + """ + + value: AutomatedReasoningPolicyUpdateTypeAnnotation + +@dataclass +class AutomatedReasoningPolicyAnnotationDeleteType(_SerdeShape): + """ + An operation to remove a custom type from the policy. The type must not + be referenced by any variables or rules. + """ + + value: AutomatedReasoningPolicyDeleteTypeAnnotation + +@dataclass +class AutomatedReasoningPolicyAnnotationAddVariable(_SerdeShape): + """ + An operation to add a new variable to the policy, which can be used in + rule expressions to represent dynamic values. + """ + + value: AutomatedReasoningPolicyAddVariableAnnotation + +@dataclass +class AutomatedReasoningPolicyAnnotationUpdateVariable(_SerdeShape): + """ + An operation to modify an existing variable in the policy, such as + changing its name, type, or description. + """ + + value: AutomatedReasoningPolicyUpdateVariableAnnotation + +@dataclass +class AutomatedReasoningPolicyAnnotationDeleteVariable(_SerdeShape): + """ + An operation to remove a variable from the policy. The variable must not + be referenced by any rules. + """ + + value: AutomatedReasoningPolicyDeleteVariableAnnotation + +@dataclass +class AutomatedReasoningPolicyAnnotationAddRule(_SerdeShape): + """ + An operation to add a new logical rule to the policy using formal + mathematical expressions. + """ + + value: AutomatedReasoningPolicyAddRuleAnnotation + +@dataclass +class AutomatedReasoningPolicyAnnotationUpdateRule(_SerdeShape): + """ + An operation to modify an existing rule in the policy, such as changing + its logical expression or conditions. + """ + + value: AutomatedReasoningPolicyUpdateRuleAnnotation + +@dataclass +class AutomatedReasoningPolicyAnnotationDeleteRule(_SerdeShape): + """An operation to remove a rule from the policy.""" + + value: AutomatedReasoningPolicyDeleteRuleAnnotation + +@dataclass +class AutomatedReasoningPolicyAnnotationAddRuleFromNaturalLanguage(_SerdeShape): + """ + An operation to add a new rule by converting natural language + descriptions into formal logical expressions. + """ + + value: AutomatedReasoningPolicyAddRuleFromNaturalLanguageAnnotation + +@dataclass +class AutomatedReasoningPolicyAnnotationUpdateFromRulesFeedback(_SerdeShape): + """ + An operation to update the policy based on feedback about how specific + rules performed during testing or validation. + """ + + value: AutomatedReasoningPolicyUpdateFromRuleFeedbackAnnotation + +@dataclass +class AutomatedReasoningPolicyAnnotationUpdateFromScenarioFeedback(_SerdeShape): + """ + An operation to update the policy based on feedback about how it + performed on specific test scenarios. + """ + + value: AutomatedReasoningPolicyUpdateFromScenarioFeedbackAnnotation + +@dataclass +class AutomatedReasoningPolicyAnnotationIngestContent(_SerdeShape): + """ + An operation to process and incorporate new content into the policy, + extracting additional rules and concepts. + """ + + value: AutomatedReasoningPolicyIngestContentAnnotation + +@dataclass +class AutomatedReasoningPolicyAnnotationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +AutomatedReasoningPolicyAnnotation = Union[ + AutomatedReasoningPolicyAnnotationAddType + | AutomatedReasoningPolicyAnnotationUpdateType + | AutomatedReasoningPolicyAnnotationDeleteType + | AutomatedReasoningPolicyAnnotationAddVariable + | AutomatedReasoningPolicyAnnotationUpdateVariable + | AutomatedReasoningPolicyAnnotationDeleteVariable + | AutomatedReasoningPolicyAnnotationAddRule + | AutomatedReasoningPolicyAnnotationUpdateRule + | AutomatedReasoningPolicyAnnotationDeleteRule + | AutomatedReasoningPolicyAnnotationAddRuleFromNaturalLanguage + | AutomatedReasoningPolicyAnnotationUpdateFromRulesFeedback + | AutomatedReasoningPolicyAnnotationUpdateFromScenarioFeedback + | AutomatedReasoningPolicyAnnotationIngestContent + | AutomatedReasoningPolicyAnnotationUnknown +] +""" +Contains the various operations that can be performed on an Automated +Reasoning policy, including adding, updating, and deleting rules, +variables, and types. +""" + +class _AutomatedReasoningPolicyAnnotationDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> AutomatedReasoningPolicyAnnotation: ... + +class AutomatedReasoningPolicyAnnotationStatus(UnknownEnumMixin, StrEnum): + APPLIED = "APPLIED" + FAILED = "FAILED" + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyAtomicStatement(_SerdeShape): + """ + Represents a single, indivisible statement extracted from a source + document. Atomic statements are the fundamental units used to ground + policy rules and variables to their source material. + """ + + id: str + """ + A unique identifier for this atomic statement within the fidelity + report. + """ + text: str + """ + The actual text content of the atomic statement as extracted from the + source document. + """ + location: AutomatedReasoningPolicyStatementLocation + """ + Information about where this statement appears in the source document, + including line numbers. + """ + +class AutomatedReasoningPolicyBuildDocumentContentType(UnknownEnumMixin, StrEnum): + PDF = "pdf" + TEXT = "txt" + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyBuildLog(_SerdeShape): + """ + Contains detailed logging information about the policy build process, + including steps taken, decisions made, and any issues encountered. + """ + + entries: list[AutomatedReasoningPolicyBuildLogEntry] + """ + A list of log entries documenting each step in the policy build process, + including timestamps, status, and detailed messages. + """ + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyBuildLogEntry(_SerdeShape): + """ + Represents a single entry in the policy build log, containing + information about a specific step or event in the build process. + """ + + annotation: AutomatedReasoningPolicyAnnotation + """ + The annotation or operation that was being processed when this log entry + was created. + """ + status: str + """The status of the build step (e.g., SUCCESS, FAILED, IN_PROGRESS).""" + build_steps: list[AutomatedReasoningPolicyBuildStep] + """ + Detailed information about the specific build steps that were executed, + including any sub-operations or transformations. + """ + +class AutomatedReasoningPolicyBuildMessageType(UnknownEnumMixin, StrEnum): + INFO = "INFO" + WARNING = "WARNING" + ERROR = "ERROR" + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyBuildResultAssetManifest(_SerdeShape): + """ + A catalog of all artifacts produced by a build workflow, providing a + comprehensive list of available assets including their types and + identifiers. + """ + + entries: list[AutomatedReasoningPolicyBuildResultAssetManifestEntry] + """ + The list of asset entries in the manifest, each describing an available + artifact that can be retrieved. + """ + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyBuildResultAssetManifestEntry(_SerdeShape): + """ + Represents a single entry in the asset manifest, describing one artifact + produced by the build workflow. + """ + + asset_type: str + """ + The type of asset (e.g., BUILD_LOG, QUALITY_REPORT, POLICY_DEFINITION, + GENERATED_TEST_CASES, POLICY_SCENARIOS, FIDELITY_REPORT, ASSET_MANIFEST, + SOURCE_DOCUMENT). + """ + asset_name: str | None = ... + """ + A human-readable name for the asset, if applicable. This helps identify + specific documents or reports within the workflow results. + """ + asset_id: str | None = ... + """ + A unique identifier for the asset, if applicable. Use this ID when + requesting specific assets through the API. + """ + +@dataclass +class AutomatedReasoningPolicyBuildResultAssetsPolicyDefinition(_SerdeShape): + """ + The complete policy definition generated by the build workflow, + containing all rules, variables, and custom types extracted from the + source documents. + """ + + value: AutomatedReasoningPolicyDefinition + +@dataclass +class AutomatedReasoningPolicyBuildResultAssetsQualityReport(_SerdeShape): + """ + A comprehensive report analyzing the quality of the generated policy, + including metrics about rule coverage, potential conflicts, and unused + elements. + """ + + value: AutomatedReasoningPolicyDefinitionQualityReport + +@dataclass +class AutomatedReasoningPolicyBuildResultAssetsBuildLog(_SerdeShape): + """ + The complete build log containing detailed information about each step + in the policy generation process. + """ + + value: AutomatedReasoningPolicyBuildLog + +@dataclass +class AutomatedReasoningPolicyBuildResultAssetsGeneratedTestCases(_SerdeShape): + """ + A comprehensive test suite generated by the build workflow, providing + validation capabilities for automated reasoning policies. + """ + + value: AutomatedReasoningPolicyGeneratedTestCases + +@dataclass +class AutomatedReasoningPolicyBuildResultAssetsPolicyScenarios(_SerdeShape): + """ + An entity encompassing all the policy scenarios generated by the build + workflow, which can be used to validate an Automated Reasoning policy. + """ + + value: AutomatedReasoningPolicyScenarios + +@dataclass +class AutomatedReasoningPolicyBuildResultAssetsAssetManifest(_SerdeShape): + """ + A manifest listing all available artifacts produced by the build + workflow. This provides a catalog of all assets that can be retrieved, + including their types, names, and identifiers. + """ + + value: AutomatedReasoningPolicyBuildResultAssetManifest + +@dataclass +class AutomatedReasoningPolicyBuildResultAssetsDocument(_SerdeShape): + """ + A source document that was used as input during the build workflow. This + allows you to retrieve the original documents that were processed to + generate the policy. + """ + + value: AutomatedReasoningPolicySourceDocument + +@dataclass +class AutomatedReasoningPolicyBuildResultAssetsFidelityReport(_SerdeShape): + """ + A comprehensive fidelity report that measures how accurately the + generated policy represents the source documents. The report includes + coverage and accuracy scores, along with detailed grounding information + for rules and variables. + """ + + value: AutomatedReasoningPolicyFidelityReport + +@dataclass +class AutomatedReasoningPolicyBuildResultAssetsUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +AutomatedReasoningPolicyBuildResultAssets = Union[ + AutomatedReasoningPolicyBuildResultAssetsPolicyDefinition + | AutomatedReasoningPolicyBuildResultAssetsQualityReport + | AutomatedReasoningPolicyBuildResultAssetsBuildLog + | AutomatedReasoningPolicyBuildResultAssetsGeneratedTestCases + | AutomatedReasoningPolicyBuildResultAssetsPolicyScenarios + | AutomatedReasoningPolicyBuildResultAssetsAssetManifest + | AutomatedReasoningPolicyBuildResultAssetsDocument + | AutomatedReasoningPolicyBuildResultAssetsFidelityReport + | AutomatedReasoningPolicyBuildResultAssetsUnknown +] +""" +Contains the various assets generated during a policy build workflow, +including logs, quality reports, test cases, and the final policy +definition. +""" + +class _AutomatedReasoningPolicyBuildResultAssetsDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> AutomatedReasoningPolicyBuildResultAssets: ... + +class AutomatedReasoningPolicyBuildResultAssetType(UnknownEnumMixin, StrEnum): + BUILD_LOG = "BUILD_LOG" + QUALITY_REPORT = "QUALITY_REPORT" + POLICY_DEFINITION = "POLICY_DEFINITION" + GENERATED_TEST_CASES = "GENERATED_TEST_CASES" + POLICY_SCENARIOS = "POLICY_SCENARIOS" + FIDELITY_REPORT = "FIDELITY_REPORT" + ASSET_MANIFEST = "ASSET_MANIFEST" + SOURCE_DOCUMENT = "SOURCE_DOCUMENT" + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyBuildStep(_SerdeShape): + """ + Represents a single step in the policy build process, containing context + about what was being processed and any messages or results. + """ + + context: AutomatedReasoningPolicyBuildStepContext + """ + Contextual information about what was being processed during this build + step, such as the type of operation or the source material being + analyzed. + """ + prior_element: AutomatedReasoningPolicyDefinitionElement | None = ... + """ + Reference to the previous element or step in the build process, helping + to trace the sequence of operations. + """ + messages: list[AutomatedReasoningPolicyBuildStepMessage] + """ + A list of messages generated during this build step, including + informational messages, warnings, and error details. + """ + +@dataclass +class AutomatedReasoningPolicyBuildStepContextPlanning(_SerdeShape): + """ + Indicates that this build step was part of the planning phase, where the + system determines what operations to perform. + """ + + value: AutomatedReasoningPolicyPlanning + +@dataclass +class AutomatedReasoningPolicyBuildStepContextMutation(_SerdeShape): + """ + Indicates that this build step involved modifying the policy structure, + such as adding or updating rules, variables, or types. + """ + + value: AutomatedReasoningPolicyMutation + +@dataclass +class AutomatedReasoningPolicyBuildStepContextUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +AutomatedReasoningPolicyBuildStepContext = Union[ + AutomatedReasoningPolicyBuildStepContextPlanning + | AutomatedReasoningPolicyBuildStepContextMutation + | AutomatedReasoningPolicyBuildStepContextUnknown +] +""" +Provides context about what type of operation was being performed during +a build step. +""" + +class _AutomatedReasoningPolicyBuildStepContextDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> AutomatedReasoningPolicyBuildStepContext: ... + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyBuildStepMessage(_SerdeShape): + """ + Represents a message generated during a build step, providing + information about what happened or any issues encountered. + """ + + message: str + """ + The content of the message, describing what occurred during the build + step. + """ + message_type: str + """ + The type of message (e.g., INFO, WARNING, ERROR) indicating its severity + and purpose. + """ + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyBuildWorkflowDocument(_SerdeShape): + """ + Represents a source document used in the policy build workflow, + containing the content and metadata needed for policy generation. + """ + + document: bytes + """ + The actual content of the source document that will be analyzed to + extract policy rules and concepts. + """ + document_content_type: str + """ + The MIME type of the document content (e.g., text/plain, + application/pdf, text/markdown). + """ + document_name: str + """ + A descriptive name for the document that helps identify its purpose and + content. + """ + document_description: str | None = ... + """ + A detailed description of the document's content and how it should be + used in the policy generation process. + """ + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyBuildWorkflowRepairContent(_SerdeShape): + """ + Contains content and instructions for repairing or improving an existing + Automated Reasoning policy. + """ + + annotations: list[AutomatedReasoningPolicyAnnotation] + """ + Specific annotations or modifications to apply during the policy repair + process, such as rule corrections or variable updates. + """ + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyBuildWorkflowSource(_SerdeShape): + """ + Defines the source content for a policy build workflow, which can + include documents, repair instructions, or other input materials. + """ + + policy_definition: AutomatedReasoningPolicyDefinition | None = ... + """ + An existing policy definition that serves as the starting point for the + build workflow, typically used in policy repair or update scenarios. + """ + workflow_content: AutomatedReasoningPolicyWorkflowTypeContent | None = ... + """ + The actual content to be processed in the build workflow, such as + documents to analyze or repair instructions to apply. + """ + +class AutomatedReasoningPolicyBuildWorkflowStatus(UnknownEnumMixin, StrEnum): + SCHEDULED = "SCHEDULED" + CANCEL_REQUESTED = "CANCEL_REQUESTED" + PREPROCESSING = "PREPROCESSING" + BUILDING = "BUILDING" + TESTING = "TESTING" + COMPLETED = "COMPLETED" + FAILED = "FAILED" + CANCELLED = "CANCELLED" + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyBuildWorkflowSummary(_SerdeShape): + """ + Provides a summary of a policy build workflow, including its current + status, timing information, and key identifiers. + """ + + policy_arn: str + """ + The Amazon Resource Name (ARN) of the Automated Reasoning policy + associated with this build workflow. + """ + build_workflow_id: str + """The unique identifier of the build workflow.""" + status: str + """ + The current status of the build workflow (e.g., RUNNING, COMPLETED, + FAILED, CANCELLED). + """ + build_workflow_type: str + """The type of build workflow (e.g., DOCUMENT_INGESTION, POLICY_REPAIR).""" + created_at: datetime + """The timestamp when the build workflow was created.""" + updated_at: datetime + """The timestamp when the build workflow was last updated.""" + +class AutomatedReasoningPolicyBuildWorkflowType(UnknownEnumMixin, StrEnum): + INGEST_CONTENT = "INGEST_CONTENT" + REFINE_POLICY = "REFINE_POLICY" + IMPORT_POLICY = "IMPORT_POLICY" + GENERATE_FIDELITY_REPORT = "GENERATE_FIDELITY_REPORT" + GENERATE_POLICY_SCENARIOS = "GENERATE_POLICY_SCENARIOS" + RESOLVE_POLICY_AMBIGUITIES = "RESOLVE_POLICY_AMBIGUITIES" + ITERATIVELY_REFINE_POLICY = "ITERATIVELY_REFINE_POLICY" + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyDefinition(_SerdeShape): + """ + Contains the formal logic rules, variables, and custom variable types + that define an Automated Reasoning policy. The policy definition + specifies the constraints used to validate foundation model responses + for accuracy and logical consistency. + """ + + version: str = ... + """The version of the policy definition format.""" + types: list[AutomatedReasoningPolicyDefinitionType] | None = ... + """ + The custom user-defined vairable types used in the policy. Types are + enum-based variable types that provide additional context beyond the + predefined variable types. + """ + rules: list[AutomatedReasoningPolicyDefinitionRule] | None = ... + """ + The formal logic rules extracted from the source document. Rules define + the logical constraints that determine whether model responses are + valid, invalid, or satisfiable. + """ + variables: list[AutomatedReasoningPolicyDefinitionVariable] | None = ... + """ + The variables that represent concepts in the policy. Variables can have + values assigned when translating natural language into formal logic. + Their descriptions are crucial for accurate translation. + """ + +@dataclass +class AutomatedReasoningPolicyDefinitionElementPolicyDefinitionVariable(_SerdeShape): + """ + A variable element within the policy definition that represents a + concept used in logical expressions and rules. + """ + + value: AutomatedReasoningPolicyDefinitionVariable + +@dataclass +class AutomatedReasoningPolicyDefinitionElementPolicyDefinitionType(_SerdeShape): + """ + A custom type element within the policy definition that defines a set of + possible values for variables. + """ + + value: AutomatedReasoningPolicyDefinitionType + +@dataclass +class AutomatedReasoningPolicyDefinitionElementPolicyDefinitionRule(_SerdeShape): + """ + A rule element within the policy definition that contains a formal + logical expression used for validation. + """ + + value: AutomatedReasoningPolicyDefinitionRule + +@dataclass +class AutomatedReasoningPolicyDefinitionElementUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +AutomatedReasoningPolicyDefinitionElement = Union[ + AutomatedReasoningPolicyDefinitionElementPolicyDefinitionVariable + | AutomatedReasoningPolicyDefinitionElementPolicyDefinitionType + | AutomatedReasoningPolicyDefinitionElementPolicyDefinitionRule + | AutomatedReasoningPolicyDefinitionElementUnknown +] +""" +Represents a single element in an Automated Reasoning policy definition, +such as a rule, variable, or type definition. +""" + +class _AutomatedReasoningPolicyDefinitionElementDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> AutomatedReasoningPolicyDefinitionElement: ... + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyDefinitionQualityReport(_SerdeShape): + """ + Provides a comprehensive analysis of the quality and completeness of an + Automated Reasoning policy definition, highlighting potential issues and + optimization opportunities. + """ + + type_count: int + """The total number of custom types defined in the policy.""" + variable_count: int + """The total number of variables defined in the policy.""" + rule_count: int + """The total number of rules defined in the policy.""" + unused_types: list[str] + """ + A list of custom types that are defined but not referenced by any + variables or rules, suggesting they may be unnecessary. + """ + unused_type_values: list[AutomatedReasoningPolicyDefinitionTypeValuePair] + """ + A list of type values that are defined but never used in any rules, + indicating potential cleanup opportunities. + """ + unused_variables: list[str] + """ + A list of variables that are defined but not referenced by any rules, + suggesting they may be unnecessary. + """ + conflicting_rules: list[str] + """ + A list of rules that may conflict with each other, potentially leading + to inconsistent policy behavior. + """ + disjoint_rule_sets: list[AutomatedReasoningPolicyDisjointRuleSet] + """ + Groups of rules that operate on completely separate sets of variables, + indicating the policy may be addressing multiple unrelated concerns. + """ + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyDefinitionRule(_SerdeShape): + """ + Represents a formal logic rule in an Automated Reasoning policy. For + example, rules can be expressed as if-then statements that define + logical constraints. + """ + + id: str + """The unique identifier of the rule within the policy.""" + expression: str + """The formal logic expression of the rule.""" + alternate_expression: str | None = ... + """ + The human-readable form of the rule expression, often in natural + language or simplified notation. + """ + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyDefinitionType(_SerdeShape): + """ + Represents a custom user-defined viarble type in an Automated Reasoning + policy. Types are enum-based and provide additional context beyond + predefined variable types. + """ + + name: str + """The name of the custom type.""" + description: str | None = ... + """The description of what the custom type represents.""" + values: list[AutomatedReasoningPolicyDefinitionTypeValue] + """ + The possible values for this enum-based type, each with its own + description. + """ + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyDefinitionTypeValue(_SerdeShape): + """ + Represents a single value within a custom type definition, including its + identifier and description. + """ + + value: str + """The actual value or identifier for this type value.""" + description: str | None = ... + """ + A human-readable description explaining what this type value represents + and when it should be used. + """ + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyDefinitionTypeValuePair(_SerdeShape): + """ + Associates a type name with a specific value name, used for referencing + type values in rules and other policy elements. + """ + + type_name: str + """The name of the custom type that contains the referenced value.""" + value_name: str + """The name of the specific value within the type.""" + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyDefinitionVariable(_SerdeShape): + """ + Represents a variable in an Automated Reasoning policy. Variables + represent concepts that can have values assigned during natural language + translation. + """ + + name: str + """ + The name of the variable. Use descriptive names that clearly indicate + the concept being represented. + """ + type: str + """ + The data type of the variable. Valid types include bool, int, real, + enum, and custom types that you can provide. + """ + description: str + """ + The description of the variable that explains what it represents and how + users might refer to it. Clear and comprehensive descriptions are + essential for accurate natural language translation. + """ + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyDeleteRuleAnnotation(_SerdeShape): + """An annotation for removing a rule from an Automated Reasoning policy.""" + + rule_id: str + """The unique identifier of the rule to delete from the policy.""" + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyDeleteRuleMutation(_SerdeShape): + """ + A mutation operation that removes a rule from the policy definition + during the build process. + """ + + id: str + """The unique identifier of the rule to delete.""" + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyDeleteTypeAnnotation(_SerdeShape): + """ + An annotation for removing a custom type from an Automated Reasoning + policy. + """ + + name: str + """ + The name of the custom type to delete from the policy. The type must not + be referenced by any variables or rules. + """ + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyDeleteTypeMutation(_SerdeShape): + """ + A mutation operation that removes a custom type from the policy + definition during the build process. + """ + + name: str + """The name of the custom type to delete.""" + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyDeleteTypeValue(_SerdeShape): + """ + Represents a value to be removed from an existing custom type in the + policy. + """ + + value: str + """The identifier or name of the value to remove from the type.""" + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyDeleteVariableAnnotation(_SerdeShape): + """ + An annotation for removing a variable from an Automated Reasoning + policy. + """ + + name: str + """ + The name of the variable to delete from the policy. The variable must + not be referenced by any rules. + """ + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyDeleteVariableMutation(_SerdeShape): + """ + A mutation operation that removes a variable from the policy definition + during the build process. + """ + + name: str + """The name of the variable to delete.""" + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyDisjointRuleSet(_SerdeShape): + """ + Represents a set of rules that operate on completely separate variables, + indicating they address different concerns or domains within the policy. + """ + + variables: list[str] + """The set of variables that are used by the rules in this disjoint set.""" + rules: list[str] + """ + The list of rules that form this disjoint set, all operating on the same + set of variables. + """ + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyFidelityReport(_SerdeShape): + """ + A comprehensive analysis report that measures how accurately a generated + policy represents the source documents. The report includes coverage and + accuracy scores, detailed grounding information linking policy elements + to source statements, and annotated document content. + """ + + coverage_score: float + """ + A score from 0.0 to 1.0 indicating how well the policy covers the + statements in the source documents. A higher score means more of the + source content is represented in the policy. + """ + accuracy_score: float + """ + A score from 0.0 to 1.0 indicating how accurate the policy rules are + relative to the source documents. A higher score means the policy rules + more faithfully represent the source material. + """ + rule_reports: dict[str, AutomatedReasoningPolicyRuleReport] + """ + A mapping from rule identifiers to detailed fidelity reports for each + rule, showing which source statements ground each rule and how accurate + it is. + """ + variable_reports: dict[str, AutomatedReasoningPolicyVariableReport] + """ + A mapping from variable names to detailed fidelity reports for each + variable, showing which source statements ground each variable and how + accurate it is. + """ + document_sources: list[AutomatedReasoningPolicyReportSourceDocument] + """ + A list of source documents with their content broken down into atomic + statements and annotated with line numbers for precise referencing. + """ + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyGeneratedTestCase(_SerdeShape): + """ + Represents a generated test case, consisting of query content, guard + content, and expected results. + """ + + query_content: str + """ + The input query or prompt that generated the content. This provides + context for the validation. + """ + guard_content: str + """ + The output content that's validated by the Automated Reasoning policy. + This represents the foundation model response that will be checked for + accuracy. + """ + expected_aggregated_findings_result: str + """ + The expected results of the generated test case. Possible values + include: + + - `VALID` - The claims are true. The claims are implied by the premises + and the Automated Reasoning policy. Given the Automated Reasoning + policy and premises, it is not possible for these claims to be false. + In other words, there are no alternative answers that are true that + contradict the claims. + + - `INVALID` - The claims are false. The claims are not implied by the + premises and Automated Reasoning policy. Furthermore, there exists + different claims that are consistent with the premises and Automated + Reasoning policy. + + - `SATISFIABLE` - The claims can be true or false. It depends on what + assumptions are made for the claim to be implied from the premises and + Automated Reasoning policy rules. In this situation, different + assumptions can make input claims false and alternative claims true. + + - `IMPOSSIBLE` - Automated Reasoning can't make a statement about the + claims. This can happen if the premises are logically incorrect, or if + there is a conflict within the Automated Reasoning policy itself. + """ + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyGeneratedTestCases(_SerdeShape): + """ + Contains a comprehensive test suite generated by the build workflow, + providing validation capabilities for automated reasoning policies. + """ + + generated_test_cases: list[AutomatedReasoningPolicyGeneratedTestCase] + """Represents a collection of generated test cases.""" + +@dataclass +class AutomatedReasoningPolicyGenerateFidelityReportContentDocuments(_SerdeShape): + """ + Source documents to analyze for generating a new fidelity report. The + documents will be processed to create atomic statements and grounding + information. + """ + + value: list[AutomatedReasoningPolicyBuildWorkflowDocument] + +@dataclass +class AutomatedReasoningPolicyGenerateFidelityReportContentUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +AutomatedReasoningPolicyGenerateFidelityReportContent = Union[ + AutomatedReasoningPolicyGenerateFidelityReportContentDocuments + | AutomatedReasoningPolicyGenerateFidelityReportContentUnknown +] +""" +Configuration for generating a fidelity report, which can either analyze +new documents or update an existing fidelity report with a new policy +definition. +""" + +class _AutomatedReasoningPolicyGenerateFidelityReportContentDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> AutomatedReasoningPolicyGenerateFidelityReportContent: ... + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyIngestContentAnnotation(_SerdeShape): + """ + An annotation for processing and incorporating new content into an + Automated Reasoning policy. + """ + + content: str + """ + The new content to be analyzed and incorporated into the policy, such as + additional documents or rule descriptions. + """ + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyIterativeRefinementContent(_SerdeShape): + """ + Configuration for an iterative policy refinement workflow, including + source documents to process and optional feedback to guide the + refinement. + """ + + documents: list[AutomatedReasoningPolicyBuildWorkflowDocument] + """ + Source documents used for iterative policy refinement. These documents + provide context for refining the policy definition. + """ + feedback: str | None = ... + """ + Optional feedback to guide the iterative refinement workflow. Provide + specific instructions or constraints for policy refinement. + """ + +@dataclass +class AutomatedReasoningPolicyMutationAddType(_SerdeShape): + """A mutation to add a new custom type to the policy.""" + + value: AutomatedReasoningPolicyAddTypeMutation + +@dataclass +class AutomatedReasoningPolicyMutationUpdateType(_SerdeShape): + """A mutation to modify an existing custom type in the policy.""" + + value: AutomatedReasoningPolicyUpdateTypeMutation + +@dataclass +class AutomatedReasoningPolicyMutationDeleteType(_SerdeShape): + """A mutation to remove a custom type from the policy.""" + + value: AutomatedReasoningPolicyDeleteTypeMutation + +@dataclass +class AutomatedReasoningPolicyMutationAddVariable(_SerdeShape): + """A mutation to add a new variable to the policy.""" + + value: AutomatedReasoningPolicyAddVariableMutation + +@dataclass +class AutomatedReasoningPolicyMutationUpdateVariable(_SerdeShape): + """A mutation to modify an existing variable in the policy.""" + + value: AutomatedReasoningPolicyUpdateVariableMutation + +@dataclass +class AutomatedReasoningPolicyMutationDeleteVariable(_SerdeShape): + """A mutation to remove a variable from the policy.""" + + value: AutomatedReasoningPolicyDeleteVariableMutation + +@dataclass +class AutomatedReasoningPolicyMutationAddRule(_SerdeShape): + """A mutation to add a new rule to the policy.""" + + value: AutomatedReasoningPolicyAddRuleMutation + +@dataclass +class AutomatedReasoningPolicyMutationUpdateRule(_SerdeShape): + """A mutation to modify an existing rule in the policy.""" + + value: AutomatedReasoningPolicyUpdateRuleMutation + +@dataclass +class AutomatedReasoningPolicyMutationDeleteRule(_SerdeShape): + """A mutation to remove a rule from the policy.""" + + value: AutomatedReasoningPolicyDeleteRuleMutation + +@dataclass +class AutomatedReasoningPolicyMutationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +AutomatedReasoningPolicyMutation = Union[ + AutomatedReasoningPolicyMutationAddType + | AutomatedReasoningPolicyMutationUpdateType + | AutomatedReasoningPolicyMutationDeleteType + | AutomatedReasoningPolicyMutationAddVariable + | AutomatedReasoningPolicyMutationUpdateVariable + | AutomatedReasoningPolicyMutationDeleteVariable + | AutomatedReasoningPolicyMutationAddRule + | AutomatedReasoningPolicyMutationUpdateRule + | AutomatedReasoningPolicyMutationDeleteRule + | AutomatedReasoningPolicyMutationUnknown +] +""" +A container for various mutation operations that can be applied to an +Automated Reasoning policy, including adding, updating, and deleting +policy elements. +""" + +class _AutomatedReasoningPolicyMutationDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> AutomatedReasoningPolicyMutation: ... + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyPlanning(_SerdeShape): + """ + Represents the planning phase of policy build workflow, where the system + analyzes source content and determines what operations to perform. + """ + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyReportSourceDocument(_SerdeShape): + """ + Represents a source document that was analyzed during fidelity report + generation, including the document's metadata and its content broken + down into atomic statements. + """ + + document_name: str + """The name of the source document that was analyzed.""" + document_hash: str + """ + A SHA-256 hash of the document content, used for verification and + ensuring the document hasn't changed since analysis. + """ + document_id: str + """A unique identifier for this document within the fidelity report.""" + atomic_statements: list[AutomatedReasoningPolicyAtomicStatement] + """ + The list of atomic statements extracted from this document, representing + the fundamental units of meaning used for grounding. + """ + document_content: list[AutomatedReasoningPolicyAnnotatedChunk] + """ + The document's content organized into annotated chunks with line number + information for precise referencing. + """ + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyRuleReport(_SerdeShape): + """ + Provides detailed fidelity analysis for a specific policy rule, + including which source document statements support it and how accurate + the rule is. + """ + + rule: str + """The identifier of the policy rule being analyzed in this report.""" + grounding_statements: list[AutomatedReasoningPolicyStatementReference] | None = ... + """ + References to statements from the source documents that provide the + basis or justification for this rule. + """ + grounding_justifications: list[str] | None = ... + """ + Explanations describing how the source statements support and justify + this specific rule. + """ + accuracy_score: float | None = ... + """ + A score from 0.0 to 1.0 indicating how accurately this rule represents + the source material. + """ + accuracy_justification: str | None = ... + """ + A textual explanation of the accuracy score, describing why the rule + received this particular accuracy rating. + """ + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyScenario(_SerdeShape): + """ + Represents a test scenario used to validate an Automated Reasoning + policy, including the test conditions and expected outcomes. + """ + + expression: str + """The logical expression or condition that defines this test scenario.""" + alternate_expression: str + """ + An alternative way to express the same test scenario, used for + validation and comparison purposes. + """ + expected_result: str + """ + The expected outcome when this scenario is evaluated against the policy + (e.g., PASS, FAIL, VIOLATION). + """ + rule_ids: list[str] + """ + The list of rule identifiers that are expected to be triggered or + evaluated by this test scenario. + """ + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyScenarios(_SerdeShape): + """ + Contains a comprehensive entity encompassing all the scenarios generated + by the build workflow, which can be used to validate an Automated + Reasoning policy. + """ + + policy_scenarios: list[AutomatedReasoningPolicyScenario] + """Represents a collection of generated policy scenarios.""" + +@dataclass(kw_only=True) +class AutomatedReasoningPolicySourceDocument(_SerdeShape): + """ + Represents a source document that was processed during a build workflow. + Contains the document content, metadata, and a hash for verification. + """ + + document: bytes + """The raw content of the source document as a binary blob.""" + document_content_type: str + """The MIME type of the document (e.g., application/pdf, text/plain).""" + document_name: str + """The name of the source document for identification purposes.""" + document_description: str | None = ... + """ + An optional description providing context about the document's content + and purpose. + """ + document_hash: str + """ + A SHA-256 hash of the document content, used for verification and + integrity checking. + """ + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyStatementLocation(_SerdeShape): + """ + Describes the location of a statement within a source document using + line numbers. + """ + + lines: list[int] + """The line numbers in the source document where this statement appears.""" + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyStatementReference(_SerdeShape): + """ + References a specific atomic statement within a source document, used to + link policy elements back to their source material. + """ + + document_id: str + """ + The unique identifier of the document containing the referenced + statement. + """ + statement_id: str + """The unique identifier of the specific atomic statement being referenced.""" + +@dataclass(kw_only=True) +class AutomatedReasoningPolicySummary(_SerdeShape): + """ + Contains summary information about an Automated Reasoning policy, + including metadata and timestamps. + """ + + policy_arn: str + """The Amazon Resource Name (ARN) of the policy.""" + name: str + """The name of the policy.""" + description: str | None = ... + """The description of the policy.""" + version: str + """The version of the policy.""" + policy_id: str + """The unique identifier of the policy.""" + created_at: datetime + """The timestamp when the policy was created.""" + updated_at: datetime + """The timestamp when the policy was last updated.""" + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyTestCase(_SerdeShape): + """ + Represents a test for validating an Automated Reasoning policy. tests + contain sample inputs and expected outcomes to verify policy behavior. + """ + + test_case_id: str + """The unique identifier of the test.""" + guard_content: str + """ + The output content to be validated by the policy, typically representing + a foundation model response. + """ + query_content: str | None = ... + """ + The input query or prompt that generated the content. This provides + context for the validation. + """ + expected_aggregated_findings_result: str | None = ... + """The expected result of the Automated Reasoning check for this test.""" + created_at: datetime + """The timestamp when the test was created.""" + updated_at: datetime + """The timestamp when the test was last updated.""" + confidence_threshold: float | None = ... + """ + The minimum confidence level for logic validation. Content meeting this + threshold is considered high-confidence and can be validated. + """ + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyTestResult(_SerdeShape): + """ + Contains the results of testing an Automated Reasoning policy against + various scenarios and validation checks. + """ + + test_case: AutomatedReasoningPolicyTestCase + """ + The test case that was executed, including the input content, expected + results, and configuration parameters used during validation. + """ + policy_arn: str + """ + The Amazon Resource Name (ARN) of the Automated Reasoning policy that + was tested. + """ + test_run_status: str + """ + The overall status of the test run (e.g., COMPLETED, FAILED, + IN_PROGRESS). + """ + test_findings: list[AutomatedReasoningCheckFinding] | None = ... + """ + Detailed findings from the test run, including any issues, violations, + or unexpected behaviors discovered. + """ + test_run_result: str | None = ... + """ + The overall result of the test run, indicating whether the policy passed + or failed validation. + """ + aggregated_test_findings_result: str | None = ... + """ + A summary of all test findings, aggregated to provide an overall + assessment of policy quality and correctness. + """ + updated_at: datetime + """The timestamp when the test results were last updated.""" + +class AutomatedReasoningPolicyTestRunResult(UnknownEnumMixin, StrEnum): + PASSED = "PASSED" + FAILED = "FAILED" + +class AutomatedReasoningPolicyTestRunStatus(UnknownEnumMixin, StrEnum): + NOT_STARTED = "NOT_STARTED" + SCHEDULED = "SCHEDULED" + IN_PROGRESS = "IN_PROGRESS" + COMPLETED = "COMPLETED" + FAILED = "FAILED" + +@dataclass +class AutomatedReasoningPolicyTypeValueAnnotationAddTypeValue(_SerdeShape): + """An operation to add a new value to an existing custom type.""" + + value: AutomatedReasoningPolicyAddTypeValue + +@dataclass +class AutomatedReasoningPolicyTypeValueAnnotationUpdateTypeValue(_SerdeShape): + """An operation to modify an existing value within a custom type.""" + + value: AutomatedReasoningPolicyUpdateTypeValue + +@dataclass +class AutomatedReasoningPolicyTypeValueAnnotationDeleteTypeValue(_SerdeShape): + """An operation to remove a value from an existing custom type.""" + + value: AutomatedReasoningPolicyDeleteTypeValue + +@dataclass +class AutomatedReasoningPolicyTypeValueAnnotationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +AutomatedReasoningPolicyTypeValueAnnotation = Union[ + AutomatedReasoningPolicyTypeValueAnnotationAddTypeValue + | AutomatedReasoningPolicyTypeValueAnnotationUpdateTypeValue + | AutomatedReasoningPolicyTypeValueAnnotationDeleteTypeValue + | AutomatedReasoningPolicyTypeValueAnnotationUnknown +] +""" +An annotation for managing values within custom types, including adding, +updating, or removing specific type values. +""" + +class _AutomatedReasoningPolicyTypeValueAnnotationDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> AutomatedReasoningPolicyTypeValueAnnotation: ... + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyUpdateFromRuleFeedbackAnnotation(_SerdeShape): + """ + An annotation for updating the policy based on feedback about how + specific rules performed during testing or real-world usage. + """ + + rule_ids: list[str] | None = ... + """The list of rule identifiers that the feedback applies to.""" + feedback: str + """ + The feedback information about rule performance, including suggestions + for improvements or corrections. + """ + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyUpdateFromScenarioFeedbackAnnotation(_SerdeShape): + """ + An annotation for updating the policy based on feedback about how it + performed on specific test scenarios. + """ + + rule_ids: list[str] | None = ... + """ + The list of rule identifiers that were involved in the scenario being + evaluated. + """ + scenario_expression: str + """ + The logical expression that defines the test scenario that generated + this feedback. + """ + feedback: str | None = ... + """ + The feedback information about scenario performance, including any + issues or improvements identified. + """ + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyUpdateRuleAnnotation(_SerdeShape): + """ + An annotation for modifying an existing rule in an Automated Reasoning + policy. + """ + + rule_id: str + """The unique identifier of the rule to update.""" + expression: str + """ + The new formal logical expression for the rule, replacing the previous + expression. + """ + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyUpdateRuleMutation(_SerdeShape): + """ + A mutation operation that modifies an existing rule in the policy + definition during the build process. + """ + + rule: AutomatedReasoningPolicyDefinitionRule + """ + The updated rule definition containing the modified formal logical + expression and any changed metadata for the existing rule. + """ + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyUpdateTypeAnnotation(_SerdeShape): + """ + An annotation for modifying an existing custom type in an Automated + Reasoning policy. + """ + + name: str + """The current name of the custom type to update.""" + new_name: str | None = ... + """ + The new name for the custom type, if you want to rename it. If not + provided, the name remains unchanged. + """ + description: str | None = ... + """ + The new description for the custom type, replacing the previous + description. + """ + values: list[AutomatedReasoningPolicyTypeValueAnnotation] + """ + The updated list of values for the custom type, which can include + additions, modifications, or removals. + """ + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyUpdateTypeMutation(_SerdeShape): + """ + A mutation operation that modifies an existing custom type in the policy + definition during the build process. + """ + + type: AutomatedReasoningPolicyDefinitionType + """ + The updated type definition containing the modified name, description, + or values for the existing custom type. + """ + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyUpdateTypeValue(_SerdeShape): + """Represents a modification to a value within an existing custom type.""" + + value: str + """The current identifier or name of the type value to update.""" + new_value: str | None = ... + """The new identifier or name for the type value, if you want to rename it.""" + description: str | None = ... + """ + The new description for the type value, replacing the previous + description. + """ + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyUpdateVariableAnnotation(_SerdeShape): + """ + An annotation for modifying an existing variable in an Automated + Reasoning policy. + """ + + name: str + """The current name of the variable to update.""" + new_name: str | None = ... + """ + The new name for the variable, if you want to rename it. If not + provided, the name remains unchanged. + """ + description: str | None = ... + """ + The new description for the variable, replacing the previous + description. + """ + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyUpdateVariableMutation(_SerdeShape): + """ + A mutation operation that modifies an existing variable in the policy + definition during the build process. + """ + + variable: AutomatedReasoningPolicyDefinitionVariable + """ + The updated variable definition containing the modified name, type, or + description for the existing variable. + """ + +@dataclass(kw_only=True) +class AutomatedReasoningPolicyVariableReport(_SerdeShape): + """ + Provides detailed fidelity analysis for a specific policy variable, + including which source document statements support it and how accurate + the variable definition is. + """ + + policy_variable: str + """The name of the policy variable being analyzed in this report.""" + grounding_statements: list[AutomatedReasoningPolicyStatementReference] | None = ... + """ + References to statements from the source documents that provide the + basis or justification for this variable. + """ + grounding_justifications: list[str] | None = ... + """ + Explanations describing how the source statements support and justify + this specific variable definition. + """ + accuracy_score: float | None = ... + """ + A score from 0.0 to 1.0 indicating how accurately this variable + represents concepts from the source material. + """ + accuracy_justification: str | None = ... + """ + A textual explanation of the accuracy score, describing why the variable + received this particular accuracy rating. + """ + +@dataclass +class AutomatedReasoningPolicyWorkflowTypeContentDocuments(_SerdeShape): + """The list of documents to be processed in a document ingestion workflow.""" + + value: list[AutomatedReasoningPolicyBuildWorkflowDocument] + +@dataclass +class AutomatedReasoningPolicyWorkflowTypeContentPolicyRepairAssets(_SerdeShape): + """ + The assets and instructions needed for a policy repair workflow, + including repair annotations and guidance. + """ + + value: AutomatedReasoningPolicyBuildWorkflowRepairContent + +@dataclass +class AutomatedReasoningPolicyWorkflowTypeContentGenerateFidelityReportContent( + _SerdeShape +): + """ + The content configuration for generating a fidelity report workflow. + This can include source documents to analyze or an existing fidelity + report to update with a new policy definition. + """ + + value: AutomatedReasoningPolicyGenerateFidelityReportContent + +@dataclass +class AutomatedReasoningPolicyWorkflowTypeContentIterativeRefinementContent( + _SerdeShape +): + """ + Content configuration to start an iterative policy refinement workflow + that uses generative AI to automatically make changes to the policy + based on test results and the optional feedback provided. + """ + + value: AutomatedReasoningPolicyIterativeRefinementContent + +@dataclass +class AutomatedReasoningPolicyWorkflowTypeContentUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +AutomatedReasoningPolicyWorkflowTypeContent = Union[ + AutomatedReasoningPolicyWorkflowTypeContentDocuments + | AutomatedReasoningPolicyWorkflowTypeContentPolicyRepairAssets + | AutomatedReasoningPolicyWorkflowTypeContentGenerateFidelityReportContent + | AutomatedReasoningPolicyWorkflowTypeContentIterativeRefinementContent + | AutomatedReasoningPolicyWorkflowTypeContentUnknown +] +""" +Defines the content and configuration for different types of policy +build workflows. +""" + +class _AutomatedReasoningPolicyWorkflowTypeContentDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> AutomatedReasoningPolicyWorkflowTypeContent: ... + +@dataclass(kw_only=True) +class BatchDeleteAdvancedPromptOptimizationJobError(_SerdeShape): + """ + Contains information about an error that occurred when deleting an + advanced prompt optimization job. + """ + + job_identifier: str + """The identifier of the job that could not be deleted.""" + code: str + """The error code for the deletion failure.""" + message: str | None = ... + """A message describing the error.""" + +@dataclass(kw_only=True) +class BatchDeleteAdvancedPromptOptimizationJobInput(_SerdeShape): + """Batch Delete Advanced Prompt Optimization Jobs Request""" + + job_identifiers: list[str] | None = ... + """ + A list of advanced prompt optimization job identifiers (ARNs or IDs) to + delete. + """ + +@dataclass(kw_only=True) +class BatchDeleteAdvancedPromptOptimizationJobItem(_SerdeShape): + """ + Contains information about a successfully deleted advanced prompt + optimization job. + """ + + job_identifier: str + """The identifier of the deleted job.""" + job_status: str + """The status of the deleted job.""" + +@dataclass(kw_only=True) +class BatchDeleteAdvancedPromptOptimizationJobOutput(_SerdeShape): + """Batch Delete Advanced Prompt Optimization Jobs Response""" + + errors: list[BatchDeleteAdvancedPromptOptimizationJobError] + """A list of errors encountered during batch deletion.""" + advanced_prompt_optimization_jobs: list[ + BatchDeleteAdvancedPromptOptimizationJobItem + ] + """A list of successfully deleted advanced prompt optimization jobs.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class BatchDeleteEvaluationJobError(_SerdeShape): + """ + A JSON array that provides the status of the evaluation jobs being + deleted. + """ + + job_identifier: str + """The ARN of the evaluation job being deleted.""" + code: str + """A HTTP status code of the evaluation job being deleted.""" + message: str | None = ... + """A status message about the evaluation job deletion.""" + +@dataclass(kw_only=True) +class BatchDeleteEvaluationJobInput(_SerdeShape): + """Dataclass for BatchDeleteEvaluationJobInput structure.""" + + job_identifiers: list[str] | None = ... + """ + A list of one or more evaluation job Amazon Resource Names (ARNs) you + want to delete. + """ + +@dataclass(kw_only=True) +class BatchDeleteEvaluationJobItem(_SerdeShape): + """An evaluation job for deletion, and it's current status.""" + + job_identifier: str + """The Amazon Resource Name (ARN) of the evaluation job for deletion.""" + job_status: str + """The status of the evaluation job for deletion.""" + +@dataclass(kw_only=True) +class BatchDeleteEvaluationJobOutput(_SerdeShape): + """Dataclass for BatchDeleteEvaluationJobOutput structure.""" + + errors: list[BatchDeleteEvaluationJobError] + """ + A JSON object containing the HTTP status codes and the ARNs of + evaluation jobs that failed to be deleted. + """ + evaluation_jobs: list[BatchDeleteEvaluationJobItem] + """The list of evaluation jobs for deletion.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class BedrockEvaluatorModel(_SerdeShape): + """ + The evaluator model used in knowledge base evaluation job or in model + evaluation job that use a model as judge. This model computes all + evaluation related metrics. + """ + + model_identifier: str + """ + The Amazon Resource Name (ARN) of the evaluator model used used in + knowledge base evaluation job or in model evaluation job that use a + model as judge. + """ + +@dataclass(kw_only=True) +class ByteContentDoc(_SerdeShape): + """ + Contains the document contained in the wrapper object, along with its + attributes/fields. + """ + + identifier: str + """The file name of the document contained in the wrapper object.""" + content_type: str + """The MIME type of the document contained in the wrapper object.""" + data: bytes + """The byte value of the file to upload, encoded as a Base-64 string.""" + +@dataclass(kw_only=True) +class CancelAutomatedReasoningPolicyBuildWorkflowInput(_SerdeShape): + """ + Dataclass for CancelAutomatedReasoningPolicyBuildWorkflowInput + structure. + """ + + policy_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the Automated Reasoning policy whose + build workflow you want to cancel. + """ + build_workflow_id: str | None = ... + """ + The unique identifier of the build workflow to cancel. You can get this + ID from the StartAutomatedReasoningPolicyBuildWorkflow response or by + listing build workflows. + """ + +@dataclass(kw_only=True) +class CancelAutomatedReasoningPolicyBuildWorkflowOutput(_SerdeShape): + """ + Dataclass for CancelAutomatedReasoningPolicyBuildWorkflowOutput + structure. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CloudWatchConfig(_SerdeShape): + """CloudWatch logging configuration.""" + + log_group_name: str + """The log group name.""" + role_arn: str + """The role Amazon Resource Name (ARN).""" + large_data_delivery_s3_config: S3Config | None = ... + """S3 configuration for delivering a large amount of data.""" + +class CommitmentDuration(UnknownEnumMixin, StrEnum): + ONE_MONTH = "OneMonth" + SIX_MONTHS = "SixMonths" + +@dataclass(kw_only=True) +class ConflictException(ServiceError, _SerdeShape): + """Error occurred because of a conflict while performing an operation.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateAdvancedPromptOptimizationJobInput(_SerdeShape): + """Create Advanced Prompt Optimization Job Request""" + + job_name: str | None = ... + """A name for the advanced prompt optimization job.""" + job_description: str | None = ... + """A description of the advanced prompt optimization job.""" + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If this token matches a previous + request, Amazon Bedrock ignores the request but does not return an + error. + """ + input_config: AdvancedPromptOptimizationInputConfig | None = ... + """ + Specifies the S3 location of your JSONL input file containing prompt + templates and evaluation samples. + """ + output_config: AdvancedPromptOptimizationOutputConfig | None = ... + """Specifies the S3 location where optimization results will be stored.""" + encryption_key_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the KMS key used for encrypting the + output data. If not specified, the output is encrypted with an + Amazon-owned KMS key. + """ + tags: list[Tag] | None = ... + """Tags to associate with the advanced prompt optimization job.""" + model_configurations: list[ModelConfiguration] | None = ... + """ + A list of model configurations specifying the target models for prompt + optimization. You can specify up to 5 models. + """ + +@dataclass(kw_only=True) +class CreateAdvancedPromptOptimizationJobOutput(_SerdeShape): + """Create Advanced Prompt Optimization Job Response""" + + job_arn: str + """ + The Amazon Resource Name (ARN) of the created advanced prompt + optimization job. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateAutomatedReasoningPolicyInput(_SerdeShape): + """Dataclass for CreateAutomatedReasoningPolicyInput structure.""" + + name: str | None = ... + """ + A unique name for the Automated Reasoning policy. The name must be + between 1 and 63 characters and can contain letters, numbers, hyphens, + and underscores. + """ + description: str | None = ... + """ + A description of the Automated Reasoning policy. Use this to provide + context about the policy's purpose and the types of validations it + performs. + """ + client_request_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the operation + completes no more than once. If this token matches a previous request, + Amazon Bedrock ignores the request but doesn't return an error. + """ + policy_definition: AutomatedReasoningPolicyDefinition | None = ... + """ + The policy definition that contains the formal logic rules, variables, + and custom variable types used to validate foundation model responses in + your application. + """ + kms_key_id: str | None = ... + """ + The identifier of the KMS key to use for encrypting the automated + reasoning policy and its associated artifacts. If you don't specify a + KMS key, Amazon Bedrock uses an KMS managed key for encryption. For + enhanced security and control, you can specify a customer managed KMS + key. + """ + tags: list[Tag] | None = ... + """ + A list of tags to associate with the Automated Reasoning policy. Tags + help you organize and manage your policies. + """ + +@dataclass(kw_only=True) +class CreateAutomatedReasoningPolicyOutput(_SerdeShape): + """Dataclass for CreateAutomatedReasoningPolicyOutput structure.""" + + policy_arn: str + """ + The Amazon Resource Name (ARN) of the Automated Reasoning policy that + you created. + """ + version: str + """ + The version number of the newly created Automated Reasoning policy. The + initial version is always DRAFT. + """ + name: str + """The name of the Automated Reasoning policy.""" + description: str | None = ... + """The description of the Automated Reasoning policy.""" + definition_hash: str | None = ... + """ + The hash of the policy definition. This is used as a concurrency token + for creating policy versions that you can use in your application. + """ + created_at: datetime + """The timestamp when the policy was created.""" + updated_at: datetime + """The timestamp when the policy was last updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateAutomatedReasoningPolicyTestCaseInput(_SerdeShape): + """Dataclass for CreateAutomatedReasoningPolicyTestCaseInput structure.""" + + policy_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the Automated Reasoning policy for + which to create the test. + """ + guard_content: str | None = ... + """ + The output content that's validated by the Automated Reasoning policy. + This represents the foundation model response that will be checked for + accuracy. + """ + query_content: str | None = ... + """ + The input query or prompt that generated the content. This provides + context for the validation. + """ + expected_aggregated_findings_result: str | None = ... + """ + The expected result of the Automated Reasoning check. Valid values + include: , TOO_COMPLEX, and NO_TRANSLATIONS. + + - `VALID` - The claims are true. The claims are implied by the premises + and the Automated Reasoning policy. Given the Automated Reasoning + policy and premises, it is not possible for these claims to be false. + In other words, there are no alternative answers that are true that + contradict the claims. + + - `INVALID` - The claims are false. The claims are not implied by the + premises and Automated Reasoning policy. Furthermore, there exists + different claims that are consistent with the premises and Automated + Reasoning policy. + + - `SATISFIABLE` - The claims can be true or false. It depends on what + assumptions are made for the claim to be implied from the premises and + Automated Reasoning policy rules. In this situation, different + assumptions can make input claims false and alternative claims true. + + - `IMPOSSIBLE` - Automated Reasoning can't make a statement about the + claims. This can happen if the premises are logically incorrect, or if + there is a conflict within the Automated Reasoning policy itself. + + - `TRANSLATION_AMBIGUOUS` - Detected an ambiguity in the translation + meant it would be unsound to continue with validity checking. + Additional context or follow-up questions might be needed to get + translation to succeed. + + - `TOO_COMPLEX` - The input contains too much information for Automated + Reasoning to process within its latency limits. + + - `NO_TRANSLATIONS` - Identifies that some or all of the input prompt + wasn't translated into logic. This can happen if the input isn't + relevant to the Automated Reasoning policy, or if the policy doesn't + have variables to model relevant input. If Automated Reasoning can't + translate anything, you get a single `NO_TRANSLATIONS` finding. You + might also see a `NO_TRANSLATIONS` (along with other findings) if some + part of the validation isn't translated. + """ + client_request_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the operation + completes no more than one time. If this token matches a previous + request, Amazon Bedrock ignores the request, but does not return an + error. + """ + confidence_threshold: float | None = ... + """ + The minimum confidence level for logic validation. Content that meets + the threshold is considered a high-confidence finding that can be + validated. + """ + +@dataclass(kw_only=True) +class CreateAutomatedReasoningPolicyTestCaseOutput(_SerdeShape): + """Dataclass for CreateAutomatedReasoningPolicyTestCaseOutput structure.""" + + policy_arn: str + """ + The Amazon Resource Name (ARN) of the policy for which the test was + created. + """ + test_case_id: str + """The unique identifier of the created test.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateAutomatedReasoningPolicyVersionInput(_SerdeShape): + """Dataclass for CreateAutomatedReasoningPolicyVersionInput structure.""" + + policy_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the Automated Reasoning policy for + which to create a version. + """ + client_request_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the operation + completes no more than one time. If this token matches a previous + request, Amazon Bedrock ignores the request, but does not return an + error. + """ + last_updated_definition_hash: str | None = ... + """ + The hash of the current policy definition used as a concurrency token to + ensure the policy hasn't been modified since you last retrieved it. + """ + tags: list[Tag] | None = ... + """A list of tags to associate with the policy version.""" + +@dataclass(kw_only=True) +class CreateAutomatedReasoningPolicyVersionOutput(_SerdeShape): + """Dataclass for CreateAutomatedReasoningPolicyVersionOutput structure.""" + + policy_arn: str + """The versioned Amazon Resource Name (ARN) of the policy version.""" + version: str + """The version number of the policy version.""" + name: str + """The name of the policy version.""" + description: str | None = ... + """The description of the policy version.""" + definition_hash: str + """The hash of the policy definition for this version.""" + created_at: datetime + """The timestamp when the policy version was created.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateCustomModelDeploymentInput(_SerdeShape): + """Dataclass for CreateCustomModelDeploymentInput structure.""" + + model_deployment_name: str | None = ... + """ + The name for the custom model deployment. The name must be unique within + your Amazon Web Services account and Region. + """ + model_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the custom model to deploy for + on-demand inference. The custom model must be in the `Active` state. + """ + description: str | None = ... + """ + A description for the custom model deployment to help you identify its + purpose. + """ + tags: list[Tag] | None = ... + """ + Tags to assign to the custom model deployment. You can use tags to + organize and track your Amazon Web Services resources for cost + allocation and management purposes. + """ + client_request_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the operation + completes no more than one time. If this token matches a previous + request, Amazon Bedrock ignores the request, but does not return an + error. For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-idempotency.html). + """ + +@dataclass(kw_only=True) +class CreateCustomModelDeploymentOutput(_SerdeShape): + """Dataclass for CreateCustomModelDeploymentOutput structure.""" + + custom_model_deployment_arn: str + """ + The Amazon Resource Name (ARN) of the custom model deployment. Use this + ARN as the `modelId` parameter when invoking the model with the + `InvokeModel` or `Converse` operations. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateCustomModelInput(_SerdeShape): + """Dataclass for CreateCustomModelInput structure.""" + + model_name: str | None = ... + """A unique name for the custom model.""" + model_source_config: ModelDataSource | None = ... + """ + The data source for the model. The Amazon S3 URI in the model source + must be for the Amazon-managed Amazon S3 bucket containing your model + artifacts. + """ + custom_model_data_source: CustomModelDataSource | None = ... + """ + The data source for the custom model. Use this field to specify a + SageMaker AI model package ARN as the source for your custom model. + Amazon Bedrock resolves the model package to retrieve the model + artifacts. + + You can specify either `customModelDataSource` or `modelSourceConfig`, + but not both. + """ + model_kms_key_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the customer managed KMS key to + encrypt the custom model. If you don't provide a KMS key, Amazon + Bedrock uses an Amazon Web Services-managed KMS key to encrypt the + model. + + If you provide a customer managed KMS key, your Amazon Bedrock service + role must have permissions to use it. For more information see + [Encryption of imported + models](https://docs.aws.amazon.com/bedrock/latest/userguide/encryption-import-model.html). + """ + role_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of an IAM service role that Amazon + Bedrock assumes to perform tasks on your behalf. This role must have + permissions to access the Amazon S3 bucket containing your model + artifacts and the KMS key (if specified). For more information, see + [Setting up an IAM service role for importing + models](https://docs.aws.amazon.com/bedrock/latest/userguide/model-import-iam-role.html) + in the Amazon Bedrock User Guide. + + This field is required when you use `modelSourceConfig` with an Amazon + S3 data source. It is not required when you use `customModelDataSource` + with a model package ARN, because Amazon Bedrock uses its own + credentials to access the model artifacts. + """ + model_tags: list[Tag] | None = ... + """ + A list of key-value pairs to associate with the custom model resource. + You can use these tags to organize and identify your resources. + + For more information, see [Tagging + resources](https://docs.aws.amazon.com/bedrock/latest/userguide/tagging.html) + in the [Amazon Bedrock User + Guide](https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html). + """ + client_request_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If this token matches a previous + request, Amazon Bedrock ignores the request, but does not return an + error. For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + +@dataclass(kw_only=True) +class CreateCustomModelOutput(_SerdeShape): + """Dataclass for CreateCustomModelOutput structure.""" + + model_arn: str + """The Amazon Resource Name (ARN) of the new custom model.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateEvaluationJobInput(_SerdeShape): + """Dataclass for CreateEvaluationJobInput structure.""" + + job_name: str | None = ... + """ + A name for the evaluation job. Names must unique with your Amazon Web + Services account, and your account's Amazon Web Services region. + """ + job_description: str | None = ... + """A description of the evaluation job.""" + client_request_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If this token matches a previous + request, Amazon Bedrock ignores the request, but does not return an + error. For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + role_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of an IAM service role that Amazon + Bedrock can assume to perform tasks on your behalf. To learn more about + the required permissions, see [Required permissions for model + evaluations](https://docs.aws.amazon.com/bedrock/latest/userguide/model-evaluation-security.html). + """ + customer_encryption_key_id: str | None = ... + """ + Specify your customer managed encryption key Amazon Resource Name (ARN) + that will be used to encrypt your evaluation job. + """ + job_tags: list[Tag] | None = ... + """Tags to attach to the model evaluation job.""" + application_type: str | None = ... + """ + Specifies whether the evaluation job is for evaluating a model or + evaluating a knowledge base (retrieval and response generation). + """ + evaluation_config: EvaluationConfig | None = ... + """ + Contains the configuration details of either an automated or human-based + evaluation job. + """ + inference_config: EvaluationInferenceConfig | None = ... + """ + Contains the configuration details of the inference model for the + evaluation job. + + For model evaluation jobs, automated jobs support a single model or + [inference + profile](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html), + and jobs that use human workers support two models or inference + profiles. + """ + output_data_config: EvaluationOutputDataConfig | None = ... + """ + Contains the configuration details of the Amazon S3 bucket for storing + the results of the evaluation job. + """ + +@dataclass(kw_only=True) +class CreateEvaluationJobOutput(_SerdeShape): + """Dataclass for CreateEvaluationJobOutput structure.""" + + job_arn: str + """The Amazon Resource Name (ARN) of the evaluation job.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateFoundationModelAgreementInput(_SerdeShape): + """Dataclass for CreateFoundationModelAgreementInput structure.""" + + offer_token: str | None = ... + """An offer token encapsulates the information for an offer.""" + model_id: str | None = ... + """Model Id of the model for the access request.""" + +@dataclass(kw_only=True) +class CreateFoundationModelAgreementOutput(_SerdeShape): + """Dataclass for CreateFoundationModelAgreementOutput structure.""" + + model_id: str + """Model Id of the model for the access request.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateGuardrailInput(_SerdeShape): + """Dataclass for CreateGuardrailInput structure.""" + + name: str | None = ... + """The name to give the guardrail.""" + description: str | None = ... + """A description of the guardrail.""" + topic_policy_config: GuardrailTopicPolicyConfig | None = ... + """The topic policies to configure for the guardrail.""" + content_policy_config: GuardrailContentPolicyConfig | None = ... + """The content filter policies to configure for the guardrail.""" + word_policy_config: GuardrailWordPolicyConfig | None = ... + """The word policy you configure for the guardrail.""" + sensitive_information_policy_config: ( + GuardrailSensitiveInformationPolicyConfig | None + ) = ... + """The sensitive information policy to configure for the guardrail.""" + contextual_grounding_policy_config: ( + GuardrailContextualGroundingPolicyConfig | None + ) = ... + """ + The contextual grounding policy configuration used to create a + guardrail. + """ + automated_reasoning_policy_config: ( + GuardrailAutomatedReasoningPolicyConfig | None + ) = ... + """ + Optional configuration for integrating Automated Reasoning policies with + the new guardrail. + """ + cross_region_config: GuardrailCrossRegionConfig | None = ... + """ + The system-defined guardrail profile that you're using with your + guardrail. Guardrail profiles define the destination Amazon Web Services + Regions where guardrail inference requests can be automatically routed. + + For more information, see the [Amazon Bedrock User + Guide](https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-cross-region.html). + """ + blocked_input_messaging: str | None = ... + """The message to return when the guardrail blocks a prompt.""" + blocked_outputs_messaging: str | None = ... + """The message to return when the guardrail blocks a model response.""" + kms_key_id: str | None = ... + """The ARN of the KMS key that you use to encrypt the guardrail.""" + tags: list[Tag] | None = ... + """The tags that you want to attach to the guardrail.""" + client_request_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than once. If this token matches a previous request, + Amazon Bedrock ignores the request, but does not return an error. For + more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html) + in the *Amazon S3 User Guide*. + """ + +@dataclass(kw_only=True) +class CreateGuardrailOutput(_SerdeShape): + """Dataclass for CreateGuardrailOutput structure.""" + + guardrail_id: str + """The unique identifier of the guardrail that was created.""" + guardrail_arn: str + """The ARN of the guardrail.""" + version: str + """ + The version of the guardrail that was created. This value will always be + `DRAFT`. + """ + created_at: datetime + """The time at which the guardrail was created.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateGuardrailVersionInput(_SerdeShape): + """Dataclass for CreateGuardrailVersionInput structure.""" + + guardrail_identifier: str | None = ... + """The unique identifier of the guardrail. This can be an ID or the ARN.""" + description: str | None = ... + """A description of the guardrail version.""" + client_request_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than once. If this token matches a previous request, + Amazon Bedrock ignores the request, but does not return an error. For + more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html) + in the *Amazon S3 User Guide*. + """ + +@dataclass(kw_only=True) +class CreateGuardrailVersionOutput(_SerdeShape): + """Dataclass for CreateGuardrailVersionOutput structure.""" + + guardrail_id: str + """The unique identifier of the guardrail.""" + version: str + """The number of the version of the guardrail.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateInferenceProfileInput(_SerdeShape): + """Dataclass for CreateInferenceProfileInput structure.""" + + inference_profile_name: str | None = ... + """A name for the inference profile.""" + description: str | None = ... + """A description for the inference profile.""" + client_request_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If this token matches a previous + request, Amazon Bedrock ignores the request, but does not return an + error. For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + model_source: InferenceProfileModelSource | None = ... + """ + The foundation model or system-defined inference profile that the + inference profile will track metrics and costs for. + """ + tags: list[Tag] | None = ... + """ + An array of objects, each of which contains a tag and its value. For + more information, see [Tagging + resources](https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html) + in the [Amazon Bedrock User + Guide](https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html). + """ + +@dataclass(kw_only=True) +class CreateInferenceProfileOutput(_SerdeShape): + """Dataclass for CreateInferenceProfileOutput structure.""" + + inference_profile_arn: str + """The ARN of the inference profile that you created.""" + status: str | None = ... + """ + The status of the inference profile. `ACTIVE` means that the inference + profile is ready to be used. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateMarketplaceModelEndpointInput(_SerdeShape): + """Dataclass for CreateMarketplaceModelEndpointInput structure.""" + + model_source_identifier: str | None = ... + """ + The ARN of the model from Amazon Bedrock Marketplace that you want to + deploy to the endpoint. + """ + endpoint_config: EndpointConfig | None = ... + """ + The configuration for the endpoint, including the number and type of + instances to use. + """ + accept_eula: bool = ... + """ + Indicates whether you accept the end-user license agreement (EULA) for + the model. Set to `true` to accept the EULA. + """ + endpoint_name: str | None = ... + """ + The name of the endpoint. This name must be unique within your Amazon + Web Services account and region. + """ + client_request_token: str | None = ... + """ + A unique, case-sensitive identifier that you provide to ensure the + idempotency of the request. This token is listed as not required because + Amazon Web Services SDKs automatically generate it for you and set this + parameter. If you're not using the Amazon Web Services SDK or the CLI, + you must provide this token or the action will fail. + """ + tags: list[Tag] | None = ... + """ + An array of key-value pairs to apply to the underlying Amazon SageMaker + endpoint. You can use these tags to organize and identify your Amazon + Web Services resources. + """ + +@dataclass(kw_only=True) +class CreateMarketplaceModelEndpointOutput(_SerdeShape): + """Dataclass for CreateMarketplaceModelEndpointOutput structure.""" + + marketplace_model_endpoint: MarketplaceModelEndpoint + """Details about the created endpoint.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateModelCopyJobInput(_SerdeShape): + """Dataclass for CreateModelCopyJobInput structure.""" + + source_model_arn: str | None = ... + """The Amazon Resource Name (ARN) of the model to be copied.""" + target_model_name: str | None = ... + """A name for the copied model.""" + model_kms_key_id: str | None = ... + """The ARN of the KMS key that you use to encrypt the model copy.""" + target_model_tags: list[Tag] | None = ... + """ + Tags to associate with the target model. For more information, see [Tag + resources](https://docs.aws.amazon.com/bedrock/latest/userguide/tagging.html) + in the [Amazon Bedrock User + Guide](https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html). + """ + client_request_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If this token matches a previous + request, Amazon Bedrock ignores the request, but does not return an + error. For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + +@dataclass(kw_only=True) +class CreateModelCopyJobOutput(_SerdeShape): + """Dataclass for CreateModelCopyJobOutput structure.""" + + job_arn: str + """The Amazon Resource Name (ARN) of the model copy job.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateModelCustomizationJobInput(_SerdeShape): + """Dataclass for CreateModelCustomizationJobInput structure.""" + + job_name: str | None = ... + """A name for the fine-tuning job.""" + custom_model_name: str | None = ... + """A name for the resulting custom model.""" + role_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of an IAM service role that Amazon + Bedrock can assume to perform tasks on your behalf. For example, during + model training, Amazon Bedrock needs your permission to read input data + from an S3 bucket, write model artifacts to an S3 bucket. To pass this + role to Amazon Bedrock, the caller of this API must have the + `iam:PassRole` permission. + """ + client_request_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If this token matches a previous + request, Amazon Bedrock ignores the request, but does not return an + error. For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + base_model_identifier: str | None = ... + """Name of the base model.""" + customization_type: str | None = ... + """The customization type.""" + custom_model_kms_key_id: str | None = ... + """The custom model is encrypted at rest using this key.""" + job_tags: list[Tag] | None = ... + """Tags to attach to the job.""" + custom_model_tags: list[Tag] | None = ... + """Tags to attach to the resulting custom model.""" + training_data_config: TrainingDataConfig | None = ... + """Information about the training dataset.""" + validation_data_config: ValidationDataConfig | None = ... + """Information about the validation dataset.""" + output_data_config: OutputDataConfig | None = ... + """S3 location for the output data.""" + hyper_parameters: dict[str, str] | None = ... + """ + Parameters related to tuning the model. For details on the format for + different models, see [Custom model + hyperparameters](https://docs.aws.amazon.com/bedrock/latest/userguide/custom-models-hp.html). + """ + vpc_config: VpcConfig | None = ... + """ + The configuration of the Virtual Private Cloud (VPC) that contains the + resources that you're using for this job. For more information, see + [Protect your model customization jobs using a + VPC](https://docs.aws.amazon.com/bedrock/latest/userguide/vpc-model-customization.html). + """ + customization_config: CustomizationConfig | None = ... + """The customization configuration for the model customization job.""" + +@dataclass(kw_only=True) +class CreateModelCustomizationJobOutput(_SerdeShape): + """Dataclass for CreateModelCustomizationJobOutput structure.""" + + job_arn: str + """Amazon Resource Name (ARN) of the fine tuning job""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateModelImportJobInput(_SerdeShape): + """Dataclass for CreateModelImportJobInput structure.""" + + job_name: str | None = ... + """The name of the import job.""" + imported_model_name: str | None = ... + """The name of the imported model.""" + role_arn: str | None = ... + """The Amazon Resource Name (ARN) of the model import job.""" + model_data_source: ModelDataSource | None = ... + """The data source for the imported model.""" + job_tags: list[Tag] | None = ... + """Tags to attach to this import job.""" + imported_model_tags: list[Tag] | None = ... + """Tags to attach to the imported model.""" + client_request_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If this token matches a previous + request, Amazon Bedrock ignores the request, but does not return an + error. For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + vpc_config: VpcConfig | None = ... + """ + VPC configuration parameters for the private Virtual Private Cloud (VPC) + that contains the resources you are using for the import job. + """ + imported_model_kms_key_id: str | None = ... + """The imported model is encrypted at rest using this key.""" + +@dataclass(kw_only=True) +class CreateModelImportJobOutput(_SerdeShape): + """Dataclass for CreateModelImportJobOutput structure.""" + + job_arn: str + """The Amazon Resource Name (ARN) of the model import job.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateModelInvocationJobInput(_SerdeShape): + """Dataclass for CreateModelInvocationJobInput structure.""" + + job_name: str | None = ... + """A name to give the batch inference job.""" + role_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the service role with permissions to + carry out and manage batch inference. You can use the console to create + a default service role or follow the steps at [Create a service role for + batch + inference](https://docs.aws.amazon.com/bedrock/latest/userguide/batch-iam-sr.html). + """ + client_request_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If this token matches a previous + request, Amazon Bedrock ignores the request, but does not return an + error. For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + model_id: str | None = ... + """ + The unique identifier of the foundation model to use for the batch + inference job. + """ + input_data_config: ModelInvocationJobInputDataConfig | None = ... + """Details about the location of the input to the batch inference job.""" + output_data_config: ModelInvocationJobOutputDataConfig | None = ... + """Details about the location of the output of the batch inference job.""" + vpc_config: VpcConfig | None = ... + """ + The configuration of the Virtual Private Cloud (VPC) for the data in the + batch inference job. For more information, see [Protect batch inference + jobs using a + VPC](https://docs.aws.amazon.com/bedrock/latest/userguide/batch-vpc). + """ + timeout_duration_in_hours: int | None = ... + """ + The number of hours after which to force the batch inference job to time + out. + """ + tags: list[Tag] | None = ... + """ + Any tags to associate with the batch inference job. For more + information, see [Tagging Amazon Bedrock + resources](https://docs.aws.amazon.com/bedrock/latest/userguide/tagging.html). + """ + model_invocation_type: str = ... + """The invocation endpoint for ModelInvocationJob""" + +@dataclass(kw_only=True) +class CreateModelInvocationJobOutput(_SerdeShape): + """Dataclass for CreateModelInvocationJobOutput structure.""" + + job_arn: str + """The Amazon Resource Name (ARN) of the batch inference job.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreatePromptRouterInput(_SerdeShape): + """Dataclass for CreatePromptRouterInput structure.""" + + client_request_token: str | None = ... + """ + A unique, case-sensitive identifier that you provide to ensure + idempotency of your requests. If not specified, the Amazon Web Services + SDK automatically generates one for you. + """ + prompt_router_name: str | None = ... + """ + The name of the prompt router. The name must be unique within your + Amazon Web Services account in the current region. + """ + models: list[PromptRouterTargetModel] | None = ... + """ + A list of foundation models that the prompt router can route requests + to. At least one model must be specified. + """ + description: str | None = ... + """ + An optional description of the prompt router to help identify its + purpose. + """ + routing_criteria: RoutingCriteria | None = ... + """ + The criteria, which is the response quality difference, used to + determine how incoming requests are routed to different models. + """ + fallback_model: PromptRouterTargetModel | None = ... + """The default model to use when the routing criteria is not met.""" + tags: list[Tag] | None = ... + """ + An array of key-value pairs to apply to this resource as tags. You can + use tags to categorize and manage your Amazon Web Services resources. + """ + +@dataclass(kw_only=True) +class CreatePromptRouterOutput(_SerdeShape): + """Dataclass for CreatePromptRouterOutput structure.""" + + prompt_router_arn: str | None = ... + """ + The Amazon Resource Name (ARN) that uniquely identifies the prompt + router. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateProvisionedModelThroughputInput(_SerdeShape): + """Dataclass for CreateProvisionedModelThroughputInput structure.""" + + client_request_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If this token matches a previous + request, Amazon Bedrock ignores the request, but does not return an + error. For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html) + in the Amazon S3 User Guide. + """ + model_units: int | None = ... + """ + Number of model units to allocate. A model unit delivers a specific + throughput level for the specified model. The throughput level of a + model unit specifies the total number of input and output tokens that it + can process and generate within a span of one minute. By default, your + account has no model units for purchasing Provisioned Throughputs with + commitment. You must first visit the [Amazon Web Services support + center](https://console.aws.amazon.com/support/home#/case/create?issueType=service-limit-increase) + to request MUs. + + For model unit quotas, see [Provisioned Throughput + quotas](https://docs.aws.amazon.com/bedrock/latest/userguide/quotas.html#prov-thru-quotas) + in the [Amazon Bedrock User + Guide](https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html). + + For more information about what an MU specifies, contact your Amazon Web + Services account manager. + """ + provisioned_model_name: str | None = ... + """The name for this Provisioned Throughput.""" + model_id: str | None = ... + """ + The Amazon Resource Name (ARN) or name of the model to associate with + this Provisioned Throughput. For a list of models for which you can + purchase Provisioned Throughput, see [Amazon Bedrock model IDs for + purchasing Provisioned + Throughput](https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#prov-throughput-models) + in the [Amazon Bedrock User + Guide](https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html). + """ + commitment_duration: str | None = ... + """ + The commitment duration requested for the Provisioned Throughput. + Billing occurs hourly and is discounted for longer commitment terms. To + request a no-commit Provisioned Throughput, omit this field. + + Custom models support all levels of commitment. To see which base models + support no commitment, see [Supported regions and models for Provisioned + Throughput](https://docs.aws.amazon.com/bedrock/latest/userguide/pt-supported.html) + in the [Amazon Bedrock User + Guide](https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html) + """ + tags: list[Tag] | None = ... + """Tags to associate with this Provisioned Throughput.""" + +@dataclass(kw_only=True) +class CreateProvisionedModelThroughputOutput(_SerdeShape): + """Dataclass for CreateProvisionedModelThroughputOutput structure.""" + + provisioned_model_arn: str + """The Amazon Resource Name (ARN) for this Provisioned Throughput.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass +class CustomizationConfigDistillationConfig(_SerdeShape): + """The Distillation configuration for the custom model.""" + + value: DistillationConfig + +@dataclass +class CustomizationConfigRftConfig(_SerdeShape): + """ + Configuration settings for reinforcement fine-tuning (RFT) model + customization, including grader configuration and hyperparameters. + """ + + value: RFTConfig + +@dataclass +class CustomizationConfigUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +CustomizationConfig = Union[ + CustomizationConfigDistillationConfig + | CustomizationConfigRftConfig + | CustomizationConfigUnknown +] +"""A model customization configuration""" + +class _CustomizationConfigDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> CustomizationConfig: ... + +class CustomizationType(UnknownEnumMixin, StrEnum): + FINE_TUNING = "FINE_TUNING" + CONTINUED_PRE_TRAINING = "CONTINUED_PRE_TRAINING" + DISTILLATION = "DISTILLATION" + REINFORCEMENT_FINE_TUNING = "REINFORCEMENT_FINE_TUNING" + IMPORTED = "IMPORTED" + +@dataclass(kw_only=True) +class CustomMetricBedrockEvaluatorModel(_SerdeShape): + """ + Defines the model you want to evaluate custom metrics in an Amazon + Bedrock evaluation job. + """ + + model_identifier: str + """ + The Amazon Resource Name (ARN) of the evaluator model for custom + metrics. For a list of supported evaluator models, see [Evaluate model + performance using another LLM as a + judge](https://docs.aws.amazon.com/bedrock/latest/userguide/evaluation-judge.html) + and [Evaluate the performance of RAG sources using Amazon Bedrock + evaluations](https://docs.aws.amazon.com/bedrock/latest/userguide/evaluation-kb.html). + """ + +@dataclass(kw_only=True) +class CustomMetricDefinition(_SerdeShape): + """ + The definition of a custom metric for use in an Amazon Bedrock + evaluation job. A custom metric definition includes a metric name, + prompt (instructions) and optionally, a rating scale. Your prompt must + include a task description and input variables. The required input + variables are different for model-as-a-judge and RAG evaluations. + + For more information about how to define a custom metric in Amazon + Bedrock, see [Create a prompt for a custom metrics (LLM-as-a-judge model + evaluations)](https://docs.aws.amazon.com/bedrock/latest/userguide/model-evaluation-custom-metrics-prompt-formats.html) + and [Create a prompt for a custom metrics (RAG + evaluations)](https://docs.aws.amazon.com/bedrock/latest/userguide/kb-evaluation-custom-metrics-prompt-formats.html). + """ + + name: str + """ + The name for a custom metric. Names must be unique in your Amazon Web + Services region. + """ + instructions: str + """ + The prompt for a custom metric that instructs the evaluator model how to + rate the model or RAG source under evaluation. + """ + rating_scale: list[RatingScaleItem] | None = ... + """ + Defines the rating scale to be used for a custom metric. We recommend + that you always define a ratings scale when creating a custom metric. If + you don't define a scale, Amazon Bedrock won't be able to visually + display the results of the evaluation in the console or calculate + average values of numerical scores. For more information on specifying a + rating scale, see [Specifying an output schema (rating + scale)](https://docs.aws.amazon.com/bedrock/latest/userguide/model-evaluation-custom-metrics-prompt-formats.html#model-evaluation-custom-metrics-prompt-formats-schema). + """ + +@dataclass(kw_only=True) +class CustomMetricEvaluatorModelConfig(_SerdeShape): + """ + Configuration of the evaluator model you want to use to evaluate custom + metrics in an Amazon Bedrock evaluation job. + """ + + bedrock_evaluator_models: list[CustomMetricBedrockEvaluatorModel] + """ + Defines the model you want to evaluate custom metrics in an Amazon + Bedrock evaluation job. + """ + +@dataclass +class CustomModelDataSourceModelPackageArnDataSource(_SerdeShape): + """ + A SageMaker AI model package ARN as the data source for the custom + model. When you specify a model package ARN, Amazon Bedrock resolves the + model package to retrieve the model artifacts. + """ + + value: ModelPackageArnDataSource + +@dataclass +class CustomModelDataSourceUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +CustomModelDataSource = Union[ + CustomModelDataSourceModelPackageArnDataSource | CustomModelDataSourceUnknown +] +""" +The data source for a custom model. This is a union type that supports +the following member: + +- `modelPackageArnDataSource` --- Specifies a SageMaker AI model package + as the data source. +""" + +class _CustomModelDataSourceDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> CustomModelDataSource: ... + +class CustomModelDeploymentStatus(UnknownEnumMixin, StrEnum): + CREATING = "Creating" + ACTIVE = "Active" + FAILED = "Failed" + +@dataclass(kw_only=True) +class CustomModelDeploymentSummary(_SerdeShape): + """ + Contains summary information about a custom model deployment, including + its ARN, name, status, and associated custom model. + """ + + custom_model_deployment_arn: str + """The Amazon Resource Name (ARN) of the custom model deployment.""" + custom_model_deployment_name: str + """The name of the custom model deployment.""" + model_arn: str + """ + The Amazon Resource Name (ARN) of the custom model associated with this + deployment. + """ + created_at: datetime + """The date and time when the custom model deployment was created.""" + status: str + """ + The status of the custom model deployment. Possible values are + `CREATING`, `ACTIVE`, and `FAILED`. + """ + last_updated_at: datetime | None = ... + """The date and time when the custom model deployment was last modified.""" + failure_message: str | None = ... + """ + If the deployment status is `FAILED`, this field contains a message + describing the failure reason. + """ + +@dataclass(kw_only=True) +class CustomModelDeploymentUpdateDetails(_SerdeShape): + """ + Details about an update to a custom model deployment, including the new + custom model resource ARN and current update status. + """ + + model_arn: str + """ARN of the new custom model being deployed as part of the update.""" + update_status: str + """Current status of the deployment update.""" + +class CustomModelDeploymentUpdateStatus(UnknownEnumMixin, StrEnum): + UPDATING = "Updating" + UPDATE_COMPLETED = "UpdateCompleted" + UPDATE_FAILED = "UpdateFailed" + +@dataclass(kw_only=True) +class CustomModelSummary(_SerdeShape): + """Summary information for a custom model.""" + + model_arn: str + """The Amazon Resource Name (ARN) of the custom model.""" + model_name: str + """The name of the custom model.""" + creation_time: datetime + """Creation time of the model.""" + base_model_arn: str + """The base model Amazon Resource Name (ARN).""" + base_model_name: str + """The base model name.""" + customization_type: str | None = ... + """ + Specifies whether to carry out continued pre-training of a model or + whether to fine-tune it. For more information, see [Custom + models](https://docs.aws.amazon.com/bedrock/latest/userguide/custom-models.html). + """ + owner_account_id: str | None = ... + """The unique identifier of the account that owns the model.""" + model_status: str | None = ... + """ + The current status of the custom model. Possible values include: + + - `Creating` - The model is being created and validated. + + - `Active` - The model has been successfully created and is ready for + use. + + - `Failed` - The model creation process failed. + """ + +@dataclass(kw_only=True) +class CustomModelUnits(_SerdeShape): + """ + A `CustomModelUnit` (CMU) is an abstract view of the hardware + utilization that Amazon Bedrock needs to host a single copy of your + custom model. A model copy represents a single instance of your imported + model that is ready to serve inference requests. Amazon Bedrock + determines the number of custom model units that a model copy needs when + you import the custom model. + + You can use `CustomModelUnits` to estimate the cost of running your + custom model. For more information, see Calculate the cost of running a + custom model in the Amazon Bedrock user guide. + """ + + custom_model_units_per_model_copy: int | None = ... + """The number of custom model units used to host a model copy.""" + custom_model_units_version: str | None = ... + """ + The version of the custom model unit. Use to determine the billing rate + for the custom model unit. + """ + +@dataclass(kw_only=True) +class DataProcessingDetails(_SerdeShape): + """ + For a Distillation job, the status details for the data processing + sub-task of the job. + """ + + status: str | None = ... + """The status of the data processing sub-task of the job.""" + creation_time: datetime | None = ... + """The start time of the data processing sub-task of the job.""" + last_modified_time: datetime | None = ... + """The latest update to the data processing sub-task of the job.""" + +class DataRetentionMode(UnknownEnumMixin, StrEnum): + """ + The data retention mode for the account. Valid values are: + + - `default` -- The standard data handling for the model applies. + + - `none` -- Zero data retention. + + - `aws_review` -- Amazon Web Services may review the request data. The + data is not shared with the model provider. A model must support this + mode to be invoked under it. + + - `provider_data_share` -- Data may be shared with the model provider. + + - `inherit` -- No data retention mode is set at this scope. + """ + + DEFAULT = "default" + NONE = "none" + AWS_REVIEW = "aws_review" + PROVIDER_DATA_SHARE = "provider_data_share" + INHERIT = "inherit" + +@dataclass(kw_only=True) +class DeleteAutomatedReasoningPolicyBuildWorkflowInput(_SerdeShape): + """ + Dataclass for DeleteAutomatedReasoningPolicyBuildWorkflowInput + structure. + """ + + policy_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the Automated Reasoning policy whose + build workflow you want to delete. + """ + build_workflow_id: str | None = ... + """The unique identifier of the build workflow to delete.""" + last_updated_at: datetime | None = ... + """ + The timestamp when the build workflow was last updated. This is used for + optimistic concurrency control to prevent accidental deletion of + workflows that have been modified. + """ + +@dataclass(kw_only=True) +class DeleteAutomatedReasoningPolicyBuildWorkflowOutput(_SerdeShape): + """ + Dataclass for DeleteAutomatedReasoningPolicyBuildWorkflowOutput + structure. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteAutomatedReasoningPolicyInput(_SerdeShape): + """Dataclass for DeleteAutomatedReasoningPolicyInput structure.""" + + policy_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the Automated Reasoning policy to + delete. + """ + force: bool = ... + """ + Specifies whether to force delete the automated reasoning policy even if + it has active resources. When `false`, Amazon Bedrock validates if all + artifacts have been deleted (e.g. policy version, test case, test + result) for a policy before deletion. When `true`, Amazon Bedrock will + delete the policy and all its artifacts without validation. Default is + `false`. + """ + +@dataclass(kw_only=True) +class DeleteAutomatedReasoningPolicyOutput(_SerdeShape): + """Dataclass for DeleteAutomatedReasoningPolicyOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteAutomatedReasoningPolicyTestCaseInput(_SerdeShape): + """Dataclass for DeleteAutomatedReasoningPolicyTestCaseInput structure.""" + + policy_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the Automated Reasoning policy that + contains the test. + """ + test_case_id: str | None = ... + """The unique identifier of the test to delete.""" + last_updated_at: datetime | None = ... + """ + The timestamp when the test was last updated. This is used as a + concurrency token to prevent conflicting modifications. + """ + +@dataclass(kw_only=True) +class DeleteAutomatedReasoningPolicyTestCaseOutput(_SerdeShape): + """Dataclass for DeleteAutomatedReasoningPolicyTestCaseOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteCustomModelDeploymentInput(_SerdeShape): + """Dataclass for DeleteCustomModelDeploymentInput structure.""" + + custom_model_deployment_identifier: str | None = ... + """ + The Amazon Resource Name (ARN) or name of the custom model deployment to + delete. + """ + +@dataclass(kw_only=True) +class DeleteCustomModelDeploymentOutput(_SerdeShape): + """Dataclass for DeleteCustomModelDeploymentOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteCustomModelInput(_SerdeShape): + """Dataclass for DeleteCustomModelInput structure.""" + + model_identifier: str | None = ... + """Name of the model to delete.""" + +@dataclass(kw_only=True) +class DeleteCustomModelOutput(_SerdeShape): + """Dataclass for DeleteCustomModelOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteEnforcedGuardrailConfigurationInput(_SerdeShape): + """Dataclass for DeleteEnforcedGuardrailConfigurationInput structure.""" + + config_id: str | None = ... + """Unique ID for the account enforced configuration.""" + +@dataclass(kw_only=True) +class DeleteEnforcedGuardrailConfigurationOutput(_SerdeShape): + """Dataclass for DeleteEnforcedGuardrailConfigurationOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteFoundationModelAgreementInput(_SerdeShape): + """Dataclass for DeleteFoundationModelAgreementInput structure.""" + + model_id: str | None = ... + """Model Id of the model access to delete.""" + +@dataclass(kw_only=True) +class DeleteFoundationModelAgreementOutput(_SerdeShape): + """Dataclass for DeleteFoundationModelAgreementOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteGuardrailInput(_SerdeShape): + """Dataclass for DeleteGuardrailInput structure.""" + + guardrail_identifier: str | None = ... + """The unique identifier of the guardrail. This can be an ID or the ARN.""" + guardrail_version: str | None = ... + """The version of the guardrail.""" + +@dataclass(kw_only=True) +class DeleteGuardrailOutput(_SerdeShape): + """Dataclass for DeleteGuardrailOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteImportedModelInput(_SerdeShape): + """Dataclass for DeleteImportedModelInput structure.""" + + model_identifier: str | None = ... + """Name of the imported model to delete.""" + +@dataclass(kw_only=True) +class DeleteImportedModelOutput(_SerdeShape): + """Dataclass for DeleteImportedModelOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteInferenceProfileInput(_SerdeShape): + """Dataclass for DeleteInferenceProfileInput structure.""" + + inference_profile_identifier: str | None = ... + """ + The Amazon Resource Name (ARN) or ID of the application inference + profile to delete. + """ + +@dataclass(kw_only=True) +class DeleteInferenceProfileOutput(_SerdeShape): + """Dataclass for DeleteInferenceProfileOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteMarketplaceModelEndpointInput(_SerdeShape): + """Dataclass for DeleteMarketplaceModelEndpointInput structure.""" + + endpoint_arn: str | None = ... + """The Amazon Resource Name (ARN) of the endpoint you want to delete.""" + +@dataclass(kw_only=True) +class DeleteMarketplaceModelEndpointOutput(_SerdeShape): + """Dataclass for DeleteMarketplaceModelEndpointOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteModelInvocationLoggingConfigurationInput(_SerdeShape): + """Dataclass for DeleteModelInvocationLoggingConfigurationInput structure.""" + +@dataclass(kw_only=True) +class DeleteModelInvocationLoggingConfigurationOutput(_SerdeShape): + """Dataclass for DeleteModelInvocationLoggingConfigurationOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeletePromptRouterInput(_SerdeShape): + """Dataclass for DeletePromptRouterInput structure.""" + + prompt_router_arn: str | None = ... + """The Amazon Resource Name (ARN) of the prompt router to delete.""" + +@dataclass(kw_only=True) +class DeletePromptRouterOutput(_SerdeShape): + """Dataclass for DeletePromptRouterOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteProvisionedModelThroughputInput(_SerdeShape): + """Dataclass for DeleteProvisionedModelThroughputInput structure.""" + + provisioned_model_id: str | None = ... + """The Amazon Resource Name (ARN) or name of the Provisioned Throughput.""" + +@dataclass(kw_only=True) +class DeleteProvisionedModelThroughputOutput(_SerdeShape): + """Dataclass for DeleteProvisionedModelThroughputOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteResourcePolicyInput(_SerdeShape): + """Dataclass for DeleteResourcePolicyInput structure.""" + + resource_arn: str | None = ... + """The ARN of the Bedrock resource to which this resource policy applies.""" + +@dataclass(kw_only=True) +class DeleteResourcePolicyOutput(_SerdeShape): + """Dataclass for DeleteResourcePolicyOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeregisterMarketplaceModelEndpointInput(_SerdeShape): + """Dataclass for DeregisterMarketplaceModelEndpointInput structure.""" + + endpoint_arn: str | None = ... + """The Amazon Resource Name (ARN) of the endpoint you want to deregister.""" + +@dataclass(kw_only=True) +class DeregisterMarketplaceModelEndpointOutput(_SerdeShape): + """Dataclass for DeregisterMarketplaceModelEndpointOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DimensionalPriceRate(_SerdeShape): + """Dimensional price rate.""" + + dimension: str | None = ... + """Dimension for the price rate.""" + price: str | None = ... + """Single-dimensional rate information.""" + description: str | None = ... + """Description of the price rate.""" + unit: str | None = ... + """Unit associated with the price.""" + +@dataclass(kw_only=True) +class DistillationConfig(_SerdeShape): + """ + Settings for distilling a foundation model into a smaller and more + efficient model. + """ + + teacher_model_config: TeacherModelConfig + """The teacher model configuration.""" + +@dataclass +class EndpointConfigSageMaker(_SerdeShape): + """The configuration specific to Amazon SageMaker for the endpoint.""" + + value: SageMakerEndpoint + +@dataclass +class EndpointConfigUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +EndpointConfig = Union[EndpointConfigSageMaker | EndpointConfigUnknown] +"""Specifies the configuration for the endpoint.""" + +class _EndpointConfigDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> EndpointConfig: ... + +class EntitlementAvailability(UnknownEnumMixin, StrEnum): + AVAILABLE = "AVAILABLE" + NOT_AVAILABLE = "NOT_AVAILABLE" + +@dataclass(kw_only=True) +class EvaluationBedrockModel(_SerdeShape): + """ + Contains the ARN of the Amazon Bedrock model or [inference + profile](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html) + specified in your evaluation job. Each Amazon Bedrock model supports + different `inferenceParams`. To learn more about supported inference + parameters for Amazon Bedrock models, see [Inference parameters for + foundation + models](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). + + The `inferenceParams` are specified using JSON. To successfully insert + JSON as string make sure that all quotations are properly escaped. For + example, `"temperature":"0.25"` key value pair would need to be + formatted as `\"temperature\":\"0.25\"` to successfully accepted in the + request. + """ + + model_identifier: str + """The ARN of the Amazon Bedrock model or inference profile specified.""" + inference_params: str = ... + """ + Each Amazon Bedrock support different inference parameters that change + how the model behaves during inference. + """ + performance_config: PerformanceConfiguration | None = ... + """Specifies performance settings for the model or inference profile.""" + +@dataclass +class EvaluationConfigAutomated(_SerdeShape): + """ + Contains the configuration details of an automated evaluation job that + computes metrics. + """ + + value: AutomatedEvaluationConfig + +@dataclass +class EvaluationConfigHuman(_SerdeShape): + """ + Contains the configuration details of an evaluation job that uses human + workers. + """ + + value: HumanEvaluationConfig + +@dataclass +class EvaluationConfigUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +EvaluationConfig = Union[ + EvaluationConfigAutomated | EvaluationConfigHuman | EvaluationConfigUnknown +] +""" +The configuration details of either an automated or human-based +evaluation job. +""" + +class _EvaluationConfigDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> EvaluationConfig: ... + +@dataclass(kw_only=True) +class EvaluationDataset(_SerdeShape): + """ + Used to specify the name of a built-in prompt dataset and optionally, + the Amazon S3 bucket where a custom prompt dataset is saved. + """ + + name: str + """ + Used to specify supported built-in prompt datasets. Valid values are + `Builtin.Bold`, `Builtin.BoolQ`, `Builtin.NaturalQuestions`, + `Builtin.Gigaword`, `Builtin.RealToxicityPrompts`, `Builtin.TriviaQA`, + `Builtin.T-Rex`, `Builtin.WomensEcommerceClothingReviews` and + `Builtin.Wikitext2`. + """ + dataset_location: EvaluationDatasetLocation | None = ... + """ + For custom prompt datasets, you must specify the location in Amazon S3 + where the prompt dataset is saved. + """ + +@dataclass +class EvaluationDatasetLocationS3Uri(_SerdeShape): + """The S3 URI of the S3 bucket specified in the job.""" + + value: str + +@dataclass +class EvaluationDatasetLocationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +EvaluationDatasetLocation = Union[ + EvaluationDatasetLocationS3Uri | EvaluationDatasetLocationUnknown +] +"""The location in Amazon S3 where your prompt dataset is stored.""" + +class _EvaluationDatasetLocationDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> EvaluationDatasetLocation: ... + +@dataclass(kw_only=True) +class EvaluationDatasetMetricConfig(_SerdeShape): + """ + Defines the prompt datasets, built-in metric names and custom metric + names, and the task type. + """ + + task_type: str + """ + The the type of task you want to evaluate for your evaluation job. This + applies only to model evaluation jobs and is ignored for knowledge base + evaluation jobs. + """ + dataset: EvaluationDataset + """Specifies the prompt dataset.""" + metric_names: list[str] + """ + The names of the metrics you want to use for your evaluation job. + + For knowledge base evaluation jobs that evaluate retrieval only, valid + values are \"`Builtin.ContextRelevance`\", + \"`Builtin.ContextCoverage`\". + + For knowledge base evaluation jobs that evaluate retrieval with response + generation, valid values are \"`Builtin.Correctness`\", + \"`Builtin.Completeness`\", \"`Builtin.Helpfulness`\", + \"`Builtin.LogicalCoherence`\", \"`Builtin.Faithfulness`\", + \"`Builtin.Harmfulness`\", \"`Builtin.Stereotyping`\", + \"`Builtin.Refusal`\". + + For automated model evaluation jobs, valid values are + \"`Builtin.Accuracy`\", \"`Builtin.Robustness`\", and + \"`Builtin.Toxicity`\". In model evaluation jobs that use a LLM as judge + you can specify \"`Builtin.Correctness`\", \"`Builtin.Completeness"`, + \"`Builtin.Faithfulness"`, \"`Builtin.Helpfulness`\", + \"`Builtin.Coherence`\", \"`Builtin.Relevance`\", + \"`Builtin.FollowingInstructions`\", + \"`Builtin.ProfessionalStyleAndTone`\", You can also specify the + following responsible AI related metrics only for model evaluation job + that use a LLM as judge \"`Builtin.Harmfulness`\", + \"`Builtin.Stereotyping`\", and \"`Builtin.Refusal`\". + + For human-based model evaluation jobs, the list of strings must match + the `name` parameter specified in `HumanEvaluationCustomMetric`. + """ + +@dataclass +class EvaluationInferenceConfigModels(_SerdeShape): + """Specifies the inference models.""" + + value: list[EvaluationModelConfig] + +@dataclass +class EvaluationInferenceConfigRagConfigs(_SerdeShape): + """ + Contains the configuration details of the inference for a knowledge base + evaluation job, including either the retrieval only configuration or the + retrieval with response generation configuration. + """ + + value: list[RAGConfig] + +@dataclass +class EvaluationInferenceConfigUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +EvaluationInferenceConfig = Union[ + EvaluationInferenceConfigModels + | EvaluationInferenceConfigRagConfigs + | EvaluationInferenceConfigUnknown +] +""" +The configuration details of the inference model for an evaluation job. + +For automated model evaluation jobs, only a single model is supported. + +For human-based model evaluation jobs, your annotator can compare the +responses for up to two different models. +""" + +class _EvaluationInferenceConfigDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> EvaluationInferenceConfig: ... + +@dataclass(kw_only=True) +class EvaluationInferenceConfigSummary(_SerdeShape): + """ + Identifies the models, Knowledge Bases, or other RAG sources evaluated + in a model or Knowledge Base evaluation job. + """ + + model_config_summary: EvaluationModelConfigSummary | None = ... + """ + A summary of the models used in an Amazon Bedrock model evaluation job. + These resources can be models in Amazon Bedrock or models outside of + Amazon Bedrock that you use to generate your own inference response + data. + """ + rag_config_summary: EvaluationRagConfigSummary | None = ... + """ + A summary of the RAG resources used in an Amazon Bedrock Knowledge Base + evaluation job. These resources can be Knowledge Bases in Amazon Bedrock + or RAG sources outside of Amazon Bedrock that you use to generate your + own inference response data. + """ + +class EvaluationJobStatus(UnknownEnumMixin, StrEnum): + IN_PROGRESS = "InProgress" + COMPLETED = "Completed" + FAILED = "Failed" + STOPPING = "Stopping" + STOPPED = "Stopped" + DELETING = "Deleting" + +class EvaluationJobType(UnknownEnumMixin, StrEnum): + HUMAN = "Human" + AUTOMATED = "Automated" + +@dataclass +class EvaluationModelConfigBedrockModel(_SerdeShape): + """ + Defines the Amazon Bedrock model or inference profile and inference + parameters you want used. + """ + + value: EvaluationBedrockModel + +@dataclass +class EvaluationModelConfigPrecomputedInferenceSource(_SerdeShape): + """ + Defines the model used to generate inference response data for a model + evaluation job where you provide your own inference response data. + """ + + value: EvaluationPrecomputedInferenceSource + +@dataclass +class EvaluationModelConfigUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +EvaluationModelConfig = Union[ + EvaluationModelConfigBedrockModel + | EvaluationModelConfigPrecomputedInferenceSource + | EvaluationModelConfigUnknown +] +"""Defines the models used in the model evaluation job.""" + +class _EvaluationModelConfigDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> EvaluationModelConfig: ... + +@dataclass(kw_only=True) +class EvaluationModelConfigSummary(_SerdeShape): + """ + A summary of the models used in an Amazon Bedrock model evaluation job. + These resources can be models in Amazon Bedrock or models outside of + Amazon Bedrock that you use to generate your own inference response + data. + """ + + bedrock_model_identifiers: list[str] | None = ... + """ + The Amazon Resource Names (ARNs) of the models used for the evaluation + job. + """ + precomputed_inference_source_identifiers: list[str] | None = ... + """ + A label that identifies the models used for a model evaluation job where + you provide your own inference response data. + """ + +@dataclass(kw_only=True) +class EvaluationOutputDataConfig(_SerdeShape): + """ + The Amazon S3 location where the results of your evaluation job are + saved. + """ + + s3_uri: str + """The Amazon S3 URI where the results of the evaluation job are saved.""" + +@dataclass(kw_only=True) +class EvaluationPrecomputedInferenceSource(_SerdeShape): + """ + A summary of a model used for a model evaluation job where you provide + your own inference response data. + """ + + inference_source_identifier: str + """ + A label that identifies a model used in a model evaluation job where you + provide your own inference response data. + """ + +@dataclass +class EvaluationPrecomputedRagSourceConfigRetrieveSourceConfig(_SerdeShape): + """ + A summary of a RAG source used for a retrieve-only Knowledge Base + evaluation job where you provide your own inference response data. + """ + + value: EvaluationPrecomputedRetrieveSourceConfig + +@dataclass +class EvaluationPrecomputedRagSourceConfigRetrieveAndGenerateSourceConfig(_SerdeShape): + """ + A summary of a RAG source used for a retrieve-and-generate Knowledge + Base evaluation job where you provide your own inference response data. + """ + + value: EvaluationPrecomputedRetrieveAndGenerateSourceConfig + +@dataclass +class EvaluationPrecomputedRagSourceConfigUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +EvaluationPrecomputedRagSourceConfig = Union[ + EvaluationPrecomputedRagSourceConfigRetrieveSourceConfig + | EvaluationPrecomputedRagSourceConfigRetrieveAndGenerateSourceConfig + | EvaluationPrecomputedRagSourceConfigUnknown +] +""" +A summary of a RAG source used for a Knowledge Base evaluation job where +you provide your own inference response data. +""" + +class _EvaluationPrecomputedRagSourceConfigDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> EvaluationPrecomputedRagSourceConfig: ... + +@dataclass(kw_only=True) +class EvaluationPrecomputedRetrieveAndGenerateSourceConfig(_SerdeShape): + """ + A summary of a RAG source used for a retrieve-and-generate Knowledge + Base evaluation job where you provide your own inference response data. + """ + + rag_source_identifier: str + """ + A label that identifies the RAG source used for a retrieve-and-generate + Knowledge Base evaluation job where you provide your own inference + response data. + """ + +@dataclass(kw_only=True) +class EvaluationPrecomputedRetrieveSourceConfig(_SerdeShape): + """ + A summary of a RAG source used for a retrieve-only Knowledge Base + evaluation job where you provide your own inference response data. + """ + + rag_source_identifier: str + """ + A label that identifies the RAG source used for a retrieve-only + Knowledge Base evaluation job where you provide your own inference + response data. + """ + +@dataclass(kw_only=True) +class EvaluationRagConfigSummary(_SerdeShape): + """ + A summary of the RAG resources used in an Amazon Bedrock Knowledge Base + evaluation job. These resources can be Knowledge Bases in Amazon Bedrock + or RAG sources outside of Amazon Bedrock that you use to generate your + own inference response data. + """ + + bedrock_knowledge_base_identifiers: list[str] | None = ... + """ + The Amazon Resource Names (ARNs) of the Knowledge Base resources used + for a Knowledge Base evaluation job where Amazon Bedrock invokes the + Knowledge Base for you. + """ + precomputed_rag_source_identifiers: list[str] | None = ... + """ + A label that identifies the RAG sources used for a Knowledge Base + evaluation job where you provide your own inference response data. + """ + +@dataclass(kw_only=True) +class EvaluationSummary(_SerdeShape): + """Summary information of an evaluation job.""" + + job_arn: str + """The Amazon Resource Name (ARN) of the evaluation job.""" + job_name: str + """The name for the evaluation job.""" + status: str + """The current status of the evaluation job.""" + creation_time: datetime + """The time the evaluation job was created.""" + job_type: str + """Specifies whether the evaluation job is automated or human-based.""" + evaluation_task_types: list[str] + """The type of task for model evaluation.""" + model_identifiers: list[str] = ... + """ + The Amazon Resource Names (ARNs) of the model(s) used for the evaluation + job. + """ + rag_identifiers: list[str] | None = ... + """ + The Amazon Resource Names (ARNs) of the knowledge base resources used + for a knowledge base evaluation job. + """ + evaluator_model_identifiers: list[str] | None = ... + """ + The Amazon Resource Names (ARNs) of the models used to compute the + metrics for a knowledge base evaluation job. + """ + custom_metrics_evaluator_model_identifiers: list[str] | None = ... + """ + The Amazon Resource Names (ARNs) of the models used to compute custom + metrics in an Amazon Bedrock evaluation job. + """ + inference_config_summary: EvaluationInferenceConfigSummary | None = ... + """ + Identifies the models, Knowledge Bases, or other RAG sources evaluated + in a model or Knowledge Base evaluation job. + """ + application_type: str | None = ... + """ + Specifies whether the evaluation job is for evaluating a model or + evaluating a knowledge base (retrieval and response generation). + """ + +class EvaluationTaskType(UnknownEnumMixin, StrEnum): + SUMMARIZATION = "Summarization" + CLASSIFICATION = "Classification" + QUESTION_AND_ANSWER = "QuestionAndAnswer" + GENERATION = "Generation" + CUSTOM = "Custom" + +@dataclass +class EvaluatorModelConfigBedrockEvaluatorModels(_SerdeShape): + """ + The evaluator model used in knowledge base evaluation job or in model + evaluation job that use a model as judge. This model computes all + evaluation related metrics. + """ + + value: list[BedrockEvaluatorModel] + +@dataclass +class EvaluatorModelConfigUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +EvaluatorModelConfig = Union[ + EvaluatorModelConfigBedrockEvaluatorModels | EvaluatorModelConfigUnknown +] +""" +Specifies the model configuration for the evaluator model. +`EvaluatorModelConfig` is required for evaluation jobs that use a +knowledge base or in model evaluation job that use a model as judge. +This model computes all evaluation related metrics. +""" + +class _EvaluatorModelConfigDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> EvaluatorModelConfig: ... + +@dataclass(kw_only=True) +class ExportAutomatedReasoningPolicyVersionInput(_SerdeShape): + """Dataclass for ExportAutomatedReasoningPolicyVersionInput structure.""" + + policy_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the Automated Reasoning policy to + export. Can be either the unversioned ARN for the draft policy or a + versioned ARN for a specific policy version. + """ + +@dataclass(kw_only=True) +class ExportAutomatedReasoningPolicyVersionOutput(_SerdeShape): + """Dataclass for ExportAutomatedReasoningPolicyVersionOutput structure.""" + + policy_definition: AutomatedReasoningPolicyDefinition + """ + The exported policy definition containing the formal logic rules, + variables, and custom variable types. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ExternalSource(_SerdeShape): + """ + The unique external source of the content contained in the wrapper + object. + """ + + source_type: str + """The source type of the external source wrapper object.""" + s3_location: S3ObjectDoc | None = ... + """The S3 location of the external source wrapper object.""" + byte_content: ByteContentDoc | None = ... + """ + The identifier, content type, and data of the external source wrapper + object. + """ + +@dataclass(kw_only=True) +class ExternalSourcesGenerationConfiguration(_SerdeShape): + """ + The response generation configuration of the external source wrapper + object. + """ + + prompt_template: PromptTemplate | None = ... + """ + Contains the template for the prompt for the external source wrapper + object. + """ + guardrail_configuration: GuardrailConfiguration | None = ... + """Configuration details for the guardrail.""" + kb_inference_config: KbInferenceConfig | None = ... + """ + Configuration details for inference when using `RetrieveAndGenerate` to + generate responses while using an external source. + """ + additional_model_request_fields: dict[str, Document] | None = ... + """ + Additional model parameters and their corresponding values not included + in the text inference configuration for an external source. Takes in + custom model parameters specific to the language model being used. + """ + +@dataclass(kw_only=True) +class ExternalSourcesRetrieveAndGenerateConfiguration(_SerdeShape): + """ + The configuration of the external source wrapper object in the + `retrieveAndGenerate` function. + """ + + model_arn: str + """ + The Amazon Resource Name (ARN) of the foundation model or [inference + profile](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html) + used to generate responses. + """ + sources: list[ExternalSource] + """ + The document for the external source wrapper object in the + `retrieveAndGenerate` function. + """ + generation_configuration: ExternalSourcesGenerationConfiguration | None = ... + """ + Contains configurations details for response generation based on + retrieved text chunks. + """ + +class ExternalSourceType(UnknownEnumMixin, StrEnum): + S3 = "S3" + BYTE_CONTENT = "BYTE_CONTENT" + +@dataclass(kw_only=True) +class FieldForReranking(_SerdeShape): + """ + Specifies a field to be used during the reranking process in a Knowledge + Base vector search. This structure identifies metadata fields that + should be considered when reordering search results to improve + relevance. + """ + + field_name: str + """The name of the metadata field to be used during the reranking process.""" + +@dataclass(kw_only=True) +class FilterAttribute(_SerdeShape): + """ + Specifies the name of the metadata attribute/field to apply filters. You + must match the name of the attribute/field in your data source/document + metadata. + """ + + key: str + """ + The name of metadata attribute/field, which must match the name in your + data source/document metadata. + """ + value: Document + """The value of the metadata attribute/field.""" + +class FineTuningJobStatus(UnknownEnumMixin, StrEnum): + IN_PROGRESS = "InProgress" + COMPLETED = "Completed" + FAILED = "Failed" + STOPPING = "Stopping" + STOPPED = "Stopped" + +@dataclass(kw_only=True) +class FoundationModelDetails(_SerdeShape): + """Information about a foundation model.""" + + model_arn: str + """The model Amazon Resource Name (ARN).""" + model_id: str + """The model identifier.""" + model_name: str | None = ... + """The model name.""" + provider_name: str | None = ... + """The model's provider name.""" + input_modalities: list[str] | None = ... + """The input modalities that the model supports.""" + output_modalities: list[str] | None = ... + """The output modalities that the model supports.""" + response_streaming_supported: bool | None = ... + """Indicates whether the model supports streaming.""" + customizations_supported: list[str] | None = ... + """The customization that the model supports.""" + inference_types_supported: list[str] | None = ... + """The inference types that the model supports.""" + model_lifecycle: FoundationModelLifecycle | None = ... + """ + Contains details about whether a model version is available or + deprecated + """ + +@dataclass(kw_only=True) +class FoundationModelLifecycle(_SerdeShape): + """Details about whether a model version is available or deprecated.""" + + status: str + """ + Specifies whether a model version is available (`ACTIVE`) or deprecated + (`LEGACY`. + """ + start_of_life_time: datetime | None = ... + """Launch time when the model first becomes available""" + end_of_life_time: datetime | None = ... + """Time when the model is no longer available for use""" + legacy_time: datetime | None = ... + """ + Time when the model enters legacy state. Models in legacy state can + still be used, but users should plan to transition to an Active model + before the end of life time + """ + public_extended_access_time: datetime | None = ... + """ + Public extended access portion of the legacy period, when users should + expect higher pricing + """ + +class FoundationModelLifecycleStatus(UnknownEnumMixin, StrEnum): + ACTIVE = "ACTIVE" + LEGACY = "LEGACY" + +@dataclass(kw_only=True) +class FoundationModelSummary(_SerdeShape): + """Summary information for a foundation model.""" + + model_arn: str + """The Amazon Resource Name (ARN) of the foundation model.""" + model_id: str + """The model ID of the foundation model.""" + model_name: str | None = ... + """The name of the model.""" + provider_name: str | None = ... + """The model's provider name.""" + input_modalities: list[str] | None = ... + """The input modalities that the model supports.""" + output_modalities: list[str] | None = ... + """The output modalities that the model supports.""" + response_streaming_supported: bool | None = ... + """Indicates whether the model supports streaming.""" + customizations_supported: list[str] | None = ... + """Whether the model supports fine-tuning or continual pre-training.""" + inference_types_supported: list[str] | None = ... + """The inference types that the model supports.""" + model_lifecycle: FoundationModelLifecycle | None = ... + """ + Contains details about whether a model version is available or + deprecated. + """ + +@dataclass(kw_only=True) +class GenerationConfiguration(_SerdeShape): + """ + The configuration details for response generation based on retrieved + text chunks. + """ + + prompt_template: PromptTemplate | None = ... + """ + Contains the template for the prompt that's sent to the model for + response generation. + """ + guardrail_configuration: GuardrailConfiguration | None = ... + """Contains configuration details for the guardrail.""" + kb_inference_config: KbInferenceConfig | None = ... + """ + Contains configuration details for inference for knowledge base + retrieval and response generation. + """ + additional_model_request_fields: dict[str, Document] | None = ... + """ + Additional model parameters and corresponding values not included in the + `textInferenceConfig` structure for a knowledge base. This allows you to + provide custom model parameters specific to the language model being + used. + """ + +@dataclass(kw_only=True) +class GetAccountDataRetentionInput(_SerdeShape): + """Dataclass for GetAccountDataRetentionInput structure.""" + +@dataclass(kw_only=True) +class GetAccountDataRetentionOutput(_SerdeShape): + """Dataclass for GetAccountDataRetentionOutput structure.""" + + mode: str + """The data retention mode configured for the account.""" + updated_at: datetime | None = ... + """The time at which the data retention mode was last updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetAdvancedPromptOptimizationJobInput(_SerdeShape): + """Get Advanced Prompt Optimization Job Request""" + + job_identifier: str | None = ... + """The ARN or ID of the advanced prompt optimization job.""" + +@dataclass(kw_only=True) +class GetAdvancedPromptOptimizationJobOutput(_SerdeShape): + """Get Advanced Prompt Optimization Job Response""" + + job_arn: str + """The Amazon Resource Name (ARN) of the advanced prompt optimization job.""" + job_name: str + """The name of the advanced prompt optimization job.""" + job_description: str | None = ... + """The description of the advanced prompt optimization job.""" + job_status: str + """The status of the advanced prompt optimization job.""" + input_config: AdvancedPromptOptimizationInputConfig + """The input data configuration for the optimization job.""" + output_config: AdvancedPromptOptimizationOutputConfig + """The output data configuration for the optimization job.""" + encryption_key_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the KMS key used to encrypt the output + data. + """ + creation_time: datetime + """The time at which the advanced prompt optimization job was created.""" + last_modified_time: datetime | None = ... + """ + The time at which the advanced prompt optimization job was last + modified. + """ + failure_message: str | None = ... + """If the job failed, a message describing the reason for the failure.""" + model_configurations: list[ModelConfiguration] + """The model configurations used in the optimization job.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetAutomatedReasoningPolicyAnnotationsInput(_SerdeShape): + """Dataclass for GetAutomatedReasoningPolicyAnnotationsInput structure.""" + + policy_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the Automated Reasoning policy whose + annotations you want to retrieve. + """ + build_workflow_id: str | None = ... + """ + The unique identifier of the build workflow whose annotations you want + to retrieve. + """ + +@dataclass(kw_only=True) +class GetAutomatedReasoningPolicyAnnotationsOutput(_SerdeShape): + """Dataclass for GetAutomatedReasoningPolicyAnnotationsOutput structure.""" + + policy_arn: str + """The Amazon Resource Name (ARN) of the Automated Reasoning policy.""" + name: str + """The name of the Automated Reasoning policy.""" + build_workflow_id: str + """The unique identifier of the build workflow.""" + annotations: list[AutomatedReasoningPolicyAnnotation] + """ + The current set of annotations containing rules, variables, and types + extracted from the source documents. These can be modified before + finalizing the policy. + """ + annotation_set_hash: str + """ + A hash value representing the current state of the annotations. This is + used for optimistic concurrency control when updating annotations. + """ + updated_at: datetime + """The timestamp when the annotations were last updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetAutomatedReasoningPolicyBuildWorkflowInput(_SerdeShape): + """Dataclass for GetAutomatedReasoningPolicyBuildWorkflowInput structure.""" + + policy_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the Automated Reasoning policy whose + build workflow you want to retrieve. + """ + build_workflow_id: str | None = ... + """The unique identifier of the build workflow to retrieve.""" + +@dataclass(kw_only=True) +class GetAutomatedReasoningPolicyBuildWorkflowOutput(_SerdeShape): + """Dataclass for GetAutomatedReasoningPolicyBuildWorkflowOutput structure.""" + + policy_arn: str + """The Amazon Resource Name (ARN) of the Automated Reasoning policy.""" + build_workflow_id: str + """The unique identifier of the build workflow.""" + status: str + """ + The current status of the build workflow (e.g., RUNNING, COMPLETED, + FAILED, CANCELLED). + """ + build_workflow_type: str + """ + The type of build workflow being executed (e.g., DOCUMENT_INGESTION, + POLICY_REPAIR). + """ + document_name: str | None = ... + """The name of the source document used in the build workflow.""" + document_content_type: str | None = ... + """ + The content type of the source document (e.g., text/plain, + application/pdf). + """ + document_description: str | None = ... + """ + A detailed description of the document's content and how it should be + used in the policy generation process. + """ + created_at: datetime + """The timestamp when the build workflow was created.""" + updated_at: datetime + """The timestamp when the build workflow was last updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetAutomatedReasoningPolicyBuildWorkflowResultAssetsInput(_SerdeShape): + """ + Dataclass for GetAutomatedReasoningPolicyBuildWorkflowResultAssetsInput + structure. + """ + + policy_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the Automated Reasoning policy whose + build workflow assets you want to retrieve. + """ + build_workflow_id: str | None = ... + """ + The unique identifier of the build workflow whose result assets you want + to retrieve. + """ + asset_type: str | None = ... + """ + The type of asset to retrieve (e.g., BUILD_LOG, QUALITY_REPORT, + POLICY_DEFINITION, GENERATED_TEST_CASES, POLICY_SCENARIOS, + FIDELITY_REPORT, ASSET_MANIFEST, SOURCE_DOCUMENT). + """ + asset_id: str | None = ... + """ + The unique identifier of the specific asset to retrieve when multiple + assets of the same type exist. This is required when retrieving + SOURCE_DOCUMENT assets, as multiple source documents may have been used + in the workflow. The asset ID can be obtained from the asset manifest. + """ + +@dataclass(kw_only=True) +class GetAutomatedReasoningPolicyBuildWorkflowResultAssetsOutput(_SerdeShape): + """ + Dataclass for GetAutomatedReasoningPolicyBuildWorkflowResultAssetsOutput + structure. + """ + + policy_arn: str + """The Amazon Resource Name (ARN) of the Automated Reasoning policy.""" + build_workflow_id: str + """The unique identifier of the build workflow.""" + build_workflow_assets: AutomatedReasoningPolicyBuildResultAssets | None = ... + """ + The requested build workflow asset. This is a union type that returns + only one of the available asset types (logs, reports, or generated + artifacts) based on the specific asset type requested in the API call. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetAutomatedReasoningPolicyInput(_SerdeShape): + """Dataclass for GetAutomatedReasoningPolicyInput structure.""" + + policy_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the Automated Reasoning policy to + retrieve. Can be either the unversioned ARN for the draft policy or an + ARN for a specific policy version. + """ + +@dataclass(kw_only=True) +class GetAutomatedReasoningPolicyNextScenarioInput(_SerdeShape): + """Dataclass for GetAutomatedReasoningPolicyNextScenarioInput structure.""" + + policy_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the Automated Reasoning policy for + which you want to get the next test scenario. + """ + build_workflow_id: str | None = ... + """ + The unique identifier of the build workflow associated with the test + scenarios. + """ + +@dataclass(kw_only=True) +class GetAutomatedReasoningPolicyNextScenarioOutput(_SerdeShape): + """Dataclass for GetAutomatedReasoningPolicyNextScenarioOutput structure.""" + + policy_arn: str + """The Amazon Resource Name (ARN) of the Automated Reasoning policy.""" + scenario: AutomatedReasoningPolicyScenario | None = ... + """ + The next test scenario to validate, including the test expression and + expected results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetAutomatedReasoningPolicyOutput(_SerdeShape): + """Dataclass for GetAutomatedReasoningPolicyOutput structure.""" + + policy_arn: str + """The Amazon Resource Name (ARN) of the policy.""" + name: str + """The name of the policy.""" + version: str + """The version of the policy.""" + policy_id: str + """The unique identifier of the policy.""" + description: str | None = ... + """The description of the policy.""" + definition_hash: str + """The hash of the policy definition used as a concurrency token.""" + kms_key_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the KMS key used to encrypt the + automated reasoning policy and its associated artifacts. If a KMS key is + not provided during the initial CreateAutomatedReasoningPolicyRequest, + the kmsKeyArn won't be included in the + GetAutomatedReasoningPolicyResponse. + """ + created_at: datetime | None = ... + """The timestamp when the policy was created.""" + updated_at: datetime + """The timestamp when the policy was last updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetAutomatedReasoningPolicyTestCaseInput(_SerdeShape): + """Dataclass for GetAutomatedReasoningPolicyTestCaseInput structure.""" + + policy_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the Automated Reasoning policy that + contains the test. + """ + test_case_id: str | None = ... + """The unique identifier of the test to retrieve.""" + +@dataclass(kw_only=True) +class GetAutomatedReasoningPolicyTestCaseOutput(_SerdeShape): + """Dataclass for GetAutomatedReasoningPolicyTestCaseOutput structure.""" + + policy_arn: str + """The Amazon Resource Name (ARN) of the policy that contains the test.""" + test_case: AutomatedReasoningPolicyTestCase + """ + The test details including the content, query, expected result, and + metadata. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetAutomatedReasoningPolicyTestResultInput(_SerdeShape): + """Dataclass for GetAutomatedReasoningPolicyTestResultInput structure.""" + + policy_arn: str | None = ... + """The Amazon Resource Name (ARN) of the Automated Reasoning policy.""" + build_workflow_id: str | None = ... + """ + The build workflow identifier. The build workflow must display a + `COMPLETED` status to get results. + """ + test_case_id: str | None = ... + """The unique identifier of the test for which to retrieve results.""" + +@dataclass(kw_only=True) +class GetAutomatedReasoningPolicyTestResultOutput(_SerdeShape): + """Dataclass for GetAutomatedReasoningPolicyTestResultOutput structure.""" + + test_result: AutomatedReasoningPolicyTestResult + """ + The test result containing validation findings, execution status, and + detailed analysis. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetCustomModelDeploymentInput(_SerdeShape): + """Dataclass for GetCustomModelDeploymentInput structure.""" + + custom_model_deployment_identifier: str | None = ... + """ + The Amazon Resource Name (ARN) or name of the custom model deployment to + retrieve information about. + """ + +@dataclass(kw_only=True) +class GetCustomModelDeploymentOutput(_SerdeShape): + """Dataclass for GetCustomModelDeploymentOutput structure.""" + + custom_model_deployment_arn: str + """The Amazon Resource Name (ARN) of the custom model deployment.""" + model_deployment_name: str + """The name of the custom model deployment.""" + model_arn: str + """ + The Amazon Resource Name (ARN) of the custom model associated with this + deployment. + """ + created_at: datetime + """The date and time when the custom model deployment was created.""" + status: str + """ + The status of the custom model deployment. Possible values are: + + - `CREATING` - The deployment is being set up and prepared for + inference. + + - `ACTIVE` - The deployment is ready and available for inference + requests. + + - `FAILED` - The deployment failed to be created or became unavailable. + """ + description: str | None = ... + """The description of the custom model deployment.""" + update_details: CustomModelDeploymentUpdateDetails | None = ... + """ + Details about any pending or completed updates to the custom model + deployment, including the new model ARN and update status. + """ + failure_message: str | None = ... + """ + If the deployment status is `FAILED`, this field contains a message + describing the failure reason. + """ + last_updated_at: datetime | None = ... + """The date and time when the custom model deployment was last updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetCustomModelInput(_SerdeShape): + """Dataclass for GetCustomModelInput structure.""" + + model_identifier: str | None = ... + """Name or Amazon Resource Name (ARN) of the custom model.""" + +@dataclass(kw_only=True) +class GetCustomModelOutput(_SerdeShape): + """Dataclass for GetCustomModelOutput structure.""" + + model_arn: str + """Amazon Resource Name (ARN) associated with this model.""" + model_name: str + """Model name associated with this model.""" + job_name: str | None = ... + """Job name associated with this model.""" + job_arn: str | None = ... + """ + Job Amazon Resource Name (ARN) associated with this model. For models + that you create with the + [CreateCustomModel](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_CreateCustomModel.html) + API operation, this is `NULL`. + """ + base_model_arn: str | None = ... + """Amazon Resource Name (ARN) of the base model.""" + customization_type: str | None = ... + """The type of model customization.""" + model_kms_key_arn: str | None = ... + """The custom model is encrypted at rest using this key.""" + hyper_parameters: dict[str, str] | None = ... + """ + Hyperparameter values associated with this model. For details on the + format for different models, see [Custom model + hyperparameters](https://docs.aws.amazon.com/bedrock/latest/userguide/custom-models-hp.html). + """ + training_data_config: TrainingDataConfig | None = ... + """Contains information about the training dataset.""" + validation_data_config: ValidationDataConfig | None = ... + """Contains information about the validation dataset.""" + output_data_config: OutputDataConfig | None = ... + """Output data configuration associated with this custom model.""" + training_metrics: TrainingMetrics | None = ... + """Contains training metrics from the job creation.""" + validation_metrics: list[ValidatorMetric] | None = ... + """The validation metrics from the job creation.""" + creation_time: datetime + """Creation time of the model.""" + customization_config: CustomizationConfig | None = ... + """The customization configuration for the custom model.""" + model_status: str | None = ... + """ + The current status of the custom model. Possible values include: + + - `Creating` - The model is being created and validated. + + - `Active` - The model has been successfully created and is ready for + use. + + - `Failed` - The model creation process failed. Check the + `failureMessage` field for details. + """ + failure_message: str | None = ... + """ + A failure message for any issues that occurred when creating the custom + model. This is included for only a failed CreateCustomModel operation. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetEvaluationJobInput(_SerdeShape): + """Dataclass for GetEvaluationJobInput structure.""" + + job_identifier: str | None = ... + """ + The Amazon Resource Name (ARN) of the evaluation job you want get + information on. + """ + +@dataclass(kw_only=True) +class GetEvaluationJobOutput(_SerdeShape): + """Dataclass for GetEvaluationJobOutput structure.""" + + job_name: str + """The name for the evaluation job.""" + status: str + """The current status of the evaluation job.""" + job_arn: str + """The Amazon Resource Name (ARN) of the evaluation job.""" + job_description: str | None = ... + """The description of the evaluation job.""" + role_arn: str + """ + The Amazon Resource Name (ARN) of the IAM service role used in the + evaluation job. + """ + customer_encryption_key_id: str | None = ... + """ + The Amazon Resource Name (ARN) of the customer managed encryption key + specified when the evaluation job was created. + """ + job_type: str + """Specifies whether the evaluation job is automated or human-based.""" + application_type: str | None = ... + """ + Specifies whether the evaluation job is for evaluating a model or + evaluating a knowledge base (retrieval and response generation). + """ + evaluation_config: EvaluationConfig + """ + Contains the configuration details of either an automated or human-based + evaluation job. + """ + inference_config: EvaluationInferenceConfig + """ + Contains the configuration details of the inference model used for the + evaluation job. + """ + output_data_config: EvaluationOutputDataConfig + """ + Contains the configuration details of the Amazon S3 bucket for storing + the results of the evaluation job. + """ + creation_time: datetime + """The time the evaluation job was created.""" + last_modified_time: datetime | None = ... + """The time the evaluation job was last modified.""" + failure_messages: list[str] | None = ... + """A list of strings that specify why the evaluation job failed to create.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetFoundationModelAvailabilityInput(_SerdeShape): + """Dataclass for GetFoundationModelAvailabilityInput structure.""" + + model_id: str | None = ... + """The model Id of the foundation model.""" + +@dataclass(kw_only=True) +class GetFoundationModelAvailabilityOutput(_SerdeShape): + """Dataclass for GetFoundationModelAvailabilityOutput structure.""" + + model_id: str + """The model Id of the foundation model.""" + agreement_availability: AgreementAvailability + """Agreement availability.""" + authorization_status: str + """Authorization status.""" + entitlement_availability: str + """Entitlement availability.""" + region_availability: str + """Region availability.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetFoundationModelInput(_SerdeShape): + """Dataclass for GetFoundationModelInput structure.""" + + model_identifier: str | None = ... + """The model identifier.""" + +@dataclass(kw_only=True) +class GetFoundationModelOutput(_SerdeShape): + """Dataclass for GetFoundationModelOutput structure.""" + + model_details: FoundationModelDetails | None = ... + """Information about the foundation model.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetGuardrailInput(_SerdeShape): + """Dataclass for GetGuardrailInput structure.""" + + guardrail_identifier: str | None = ... + """ + The unique identifier of the guardrail for which to get details. This + can be an ID or the ARN. + """ + guardrail_version: str | None = ... + """ + The version of the guardrail for which to get details. If you don't + specify a version, the response returns details for the `DRAFT` version. + """ + +@dataclass(kw_only=True) +class GetGuardrailOutput(_SerdeShape): + """Dataclass for GetGuardrailOutput structure.""" + + name: str + """The name of the guardrail.""" + description: str | None = ... + """The description of the guardrail.""" + guardrail_id: str + """The unique identifier of the guardrail.""" + guardrail_arn: str + """The ARN of the guardrail.""" + version: str + """The version of the guardrail.""" + status: str + """The status of the guardrail.""" + topic_policy: GuardrailTopicPolicy | None = ... + """The topic policy that was configured for the guardrail.""" + content_policy: GuardrailContentPolicy | None = ... + """The content policy that was configured for the guardrail.""" + word_policy: GuardrailWordPolicy | None = ... + """The word policy that was configured for the guardrail.""" + sensitive_information_policy: GuardrailSensitiveInformationPolicy | None = ... + """The sensitive information policy that was configured for the guardrail.""" + contextual_grounding_policy: GuardrailContextualGroundingPolicy | None = ... + """The contextual grounding policy used in the guardrail.""" + automated_reasoning_policy: GuardrailAutomatedReasoningPolicy | None = ... + """ + The current Automated Reasoning policy configuration for the guardrail, + if any is configured. + """ + cross_region_details: GuardrailCrossRegionDetails | None = ... + """ + Details about the system-defined guardrail profile that you're using + with your guardrail, including the guardrail profile ID and Amazon + Resource Name (ARN). + """ + created_at: datetime + """The date and time at which the guardrail was created.""" + updated_at: datetime + """The date and time at which the guardrail was updated.""" + status_reasons: list[str] | None = ... + """ + Appears if the `status` is `FAILED`. A list of reasons for why the + guardrail failed to be created, updated, versioned, or deleted. + """ + failure_recommendations: list[str] | None = ... + """ + Appears if the `status` of the guardrail is `FAILED`. A list of + recommendations to carry out before retrying the request. + """ + blocked_input_messaging: str + """The message that the guardrail returns when it blocks a prompt.""" + blocked_outputs_messaging: str + """The message that the guardrail returns when it blocks a model response.""" + kms_key_arn: str | None = ... + """The ARN of the KMS key that encrypts the guardrail.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetImportedModelInput(_SerdeShape): + """Dataclass for GetImportedModelInput structure.""" + + model_identifier: str | None = ... + """Name or Amazon Resource Name (ARN) of the imported model.""" + +@dataclass(kw_only=True) +class GetImportedModelOutput(_SerdeShape): + """Dataclass for GetImportedModelOutput structure.""" + + model_arn: str | None = ... + """The Amazon Resource Name (ARN) associated with this imported model.""" + model_name: str | None = ... + """The name of the imported model.""" + job_name: str | None = ... + """Job name associated with the imported model.""" + job_arn: str | None = ... + """Job Amazon Resource Name (ARN) associated with the imported model.""" + model_data_source: ModelDataSource | None = ... + """The data source for this imported model.""" + creation_time: datetime | None = ... + """Creation time of the imported model.""" + model_architecture: str | None = ... + """The architecture of the imported model.""" + model_kms_key_arn: str | None = ... + """The imported model is encrypted at rest using this key.""" + instruct_supported: bool | None = ... + """Specifies if the imported model supports converse.""" + custom_model_units: CustomModelUnits | None = ... + """ + Information about the hardware utilization for a single copy of the + model. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetInferenceProfileInput(_SerdeShape): + """Dataclass for GetInferenceProfileInput structure.""" + + inference_profile_identifier: str | None = ... + """The ID or Amazon Resource Name (ARN) of the inference profile.""" + +@dataclass(kw_only=True) +class GetInferenceProfileOutput(_SerdeShape): + """Dataclass for GetInferenceProfileOutput structure.""" + + inference_profile_name: str + """The name of the inference profile.""" + description: str | None = ... + """The description of the inference profile.""" + created_at: datetime | None = ... + """The time at which the inference profile was created.""" + updated_at: datetime | None = ... + """The time at which the inference profile was last updated.""" + inference_profile_arn: str + """The Amazon Resource Name (ARN) of the inference profile.""" + models: list[InferenceProfileModel] + """A list of information about each model in the inference profile.""" + inference_profile_id: str + """The unique identifier of the inference profile.""" + status: str + """ + The status of the inference profile. `ACTIVE` means that the inference + profile is ready to be used. + """ + type: str + """ + The type of the inference profile. The following types are possible: + + - `SYSTEM_DEFINED` -- The inference profile is defined by Amazon + Bedrock. You can route inference requests across regions with these + inference profiles. + + - `APPLICATION` -- The inference profile was created by a user. This + type of inference profile can track metrics and costs when invoking + the model in it. The inference profile may route requests to one or + multiple regions. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetMarketplaceModelEndpointInput(_SerdeShape): + """Dataclass for GetMarketplaceModelEndpointInput structure.""" + + endpoint_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the endpoint you want to get + information about. + """ + +@dataclass(kw_only=True) +class GetMarketplaceModelEndpointOutput(_SerdeShape): + """Dataclass for GetMarketplaceModelEndpointOutput structure.""" + + marketplace_model_endpoint: MarketplaceModelEndpoint | None = ... + """Details about the requested endpoint.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetModelCopyJobInput(_SerdeShape): + """Dataclass for GetModelCopyJobInput structure.""" + + job_arn: str | None = ... + """The Amazon Resource Name (ARN) of the model copy job.""" + +@dataclass(kw_only=True) +class GetModelCopyJobOutput(_SerdeShape): + """Dataclass for GetModelCopyJobOutput structure.""" + + job_arn: str + """The Amazon Resource Name (ARN) of the model copy job.""" + status: str + """The status of the model copy job.""" + creation_time: datetime + """The time at which the model copy job was created.""" + target_model_arn: str + """The Amazon Resource Name (ARN) of the copied model.""" + target_model_name: str | None = ... + """The name of the copied model.""" + source_account_id: str + """ + The unique identifier of the account that the model being copied + originated from. + """ + source_model_arn: str + """The Amazon Resource Name (ARN) of the original model being copied.""" + target_model_kms_key_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the KMS key encrypting the copied + model. + """ + target_model_tags: list[Tag] | None = ... + """The tags associated with the copied model.""" + failure_message: str | None = ... + """An error message for why the model copy job failed.""" + source_model_name: str | None = ... + """The name of the original model being copied.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetModelCustomizationJobInput(_SerdeShape): + """Dataclass for GetModelCustomizationJobInput structure.""" + + job_identifier: str | None = ... + """Identifier for the customization job.""" + +@dataclass(kw_only=True) +class GetModelCustomizationJobOutput(_SerdeShape): + """Dataclass for GetModelCustomizationJobOutput structure.""" + + job_arn: str + """The Amazon Resource Name (ARN) of the customization job.""" + job_name: str + """The name of the customization job.""" + output_model_name: str + """The name of the output model.""" + output_model_arn: str | None = ... + """The Amazon Resource Name (ARN) of the output model.""" + client_request_token: str | None = ... + """The token that you specified in the `CreateCustomizationJob` request.""" + role_arn: str + """The Amazon Resource Name (ARN) of the IAM role.""" + status: str | None = ... + """ + The status of the job. A successful job transitions from in-progress to + completed when the output model is ready to use. If the job failed, the + failure message contains information about why the job failed. + """ + status_details: StatusDetails | None = ... + """ + For a Distillation job, the details about the statuses of the sub-tasks + of the customization job. + """ + failure_message: str | None = ... + """Information about why the job failed.""" + creation_time: datetime + """Time that the resource was created.""" + last_modified_time: datetime | None = ... + """Time that the resource was last modified.""" + end_time: datetime | None = ... + """Time that the resource transitioned to terminal state.""" + base_model_arn: str + """Amazon Resource Name (ARN) of the base model.""" + hyper_parameters: dict[str, str] | None = ... + """ + The hyperparameter values for the job. For details on the format for + different models, see [Custom model + hyperparameters](https://docs.aws.amazon.com/bedrock/latest/userguide/custom-models-hp.html). + """ + training_data_config: TrainingDataConfig + """Contains information about the training dataset.""" + validation_data_config: ValidationDataConfig + """Contains information about the validation dataset.""" + output_data_config: OutputDataConfig + """Output data configuration""" + customization_type: str | None = ... + """The type of model customization.""" + output_model_kms_key_arn: str | None = ... + """The custom model is encrypted at rest using this key.""" + training_metrics: TrainingMetrics | None = ... + """Contains training metrics from the job creation.""" + validation_metrics: list[ValidatorMetric] | None = ... + """ + The loss metric for each validator that you provided in the createjob + request. + """ + vpc_config: VpcConfig | None = ... + """VPC configuration for the custom model job.""" + customization_config: CustomizationConfig | None = ... + """The customization configuration for the model customization job.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetModelImportJobInput(_SerdeShape): + """Dataclass for GetModelImportJobInput structure.""" + + job_identifier: str | None = ... + """The identifier of the import job.""" + +@dataclass(kw_only=True) +class GetModelImportJobOutput(_SerdeShape): + """Dataclass for GetModelImportJobOutput structure.""" + + job_arn: str | None = ... + """The Amazon Resource Name (ARN) of the import job.""" + job_name: str | None = ... + """The name of the import job.""" + imported_model_name: str | None = ... + """The name of the imported model.""" + imported_model_arn: str | None = ... + """The Amazon Resource Name (ARN) of the imported model.""" + role_arn: str | None = ... + """The Amazon Resource Name (ARN) of the IAM role associated with this job.""" + model_data_source: ModelDataSource | None = ... + """The data source for the imported model.""" + status: str | None = ... + """ + The status of the job. A successful job transitions from in-progress to + completed when the imported model is ready to use. If the job failed, + the failure message contains information about why the job failed. + """ + failure_message: str | None = ... + """Information about why the import job failed.""" + creation_time: datetime | None = ... + """The time the resource was created.""" + last_modified_time: datetime | None = ... + """Time the resource was last modified.""" + end_time: datetime | None = ... + """Time that the resource transitioned to terminal state.""" + vpc_config: VpcConfig | None = ... + """The Virtual Private Cloud (VPC) configuration of the import model job.""" + imported_model_kms_key_arn: str | None = ... + """The imported model is encrypted at rest using this key.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetModelInvocationJobInput(_SerdeShape): + """Dataclass for GetModelInvocationJobInput structure.""" + + job_identifier: str | None = ... + """The Amazon Resource Name (ARN) of the batch inference job.""" + +@dataclass(kw_only=True) +class GetModelInvocationJobOutput(_SerdeShape): + """Dataclass for GetModelInvocationJobOutput structure.""" + + job_arn: str + """The Amazon Resource Name (ARN) of the batch inference job.""" + job_name: str | None = ... + """The name of the batch inference job.""" + model_id: str + """The unique identifier of the foundation model used for model inference.""" + client_request_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If this token matches a previous + request, Amazon Bedrock ignores the request, but does not return an + error. For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + role_arn: str + """ + The Amazon Resource Name (ARN) of the service role with permissions to + carry out and manage batch inference. You can use the console to create + a default service role or follow the steps at [Create a service role for + batch + inference](https://docs.aws.amazon.com/bedrock/latest/userguide/batch-iam-sr.html). + """ + status: str | None = ... + """ + The status of the batch inference job. + + The following statuses are possible: + + - Submitted -- This job has been submitted to a queue for validation. + + - Validating -- This job is being validated for the requirements + described in [Format and upload your batch inference + data](https://docs.aws.amazon.com/bedrock/latest/userguide/batch-inference-data.html). + The criteria include the following: + + - Your IAM service role has access to the Amazon S3 buckets containing + your files. + + - Your files are .jsonl files and each individual record is a JSON + object in the correct format. Note that validation doesn't check if + the `modelInput` value matches the request body for the model. + + - Your files fulfill the requirements for file size and number of + records. For more information, see [Quotas for Amazon + Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/quotas.html). + + - Scheduled -- This job has been validated and is now in a queue. The + job will automatically start when it reaches its turn. + + - Expired -- This job timed out because it was scheduled but didn't + begin before the set timeout duration. Submit a new job request. + + - InProgress -- This job has begun. You can start viewing the results in + the output S3 location. + + - Completed -- This job has successfully completed. View the output + files in the output S3 location. + + - PartiallyCompleted -- This job has partially completed. Not all of + your records could be processed in time. View the output files in the + output S3 location. + + - Failed -- This job has failed. Check the failure message for any + further details. For further assistance, reach out to the [Amazon Web + Services Support + Center](https://console.aws.amazon.com/support/home/). + + - Stopped -- This job was stopped by a user. + + - Stopping -- This job is being stopped by a user. + """ + message: str | None = ... + """ + If the batch inference job failed, this field contains a message + describing why the job failed. + """ + submit_time: datetime + """The time at which the batch inference job was submitted.""" + last_modified_time: datetime | None = ... + """The time at which the batch inference job was last modified.""" + end_time: datetime | None = ... + """The time at which the batch inference job ended.""" + input_data_config: ModelInvocationJobInputDataConfig + """Details about the location of the input to the batch inference job.""" + output_data_config: ModelInvocationJobOutputDataConfig + """Details about the location of the output of the batch inference job.""" + vpc_config: VpcConfig | None = ... + """ + The configuration of the Virtual Private Cloud (VPC) for the data in the + batch inference job. For more information, see [Protect batch inference + jobs using a + VPC](https://docs.aws.amazon.com/bedrock/latest/userguide/batch-vpc). + """ + timeout_duration_in_hours: int | None = ... + """The number of hours after which batch inference job was set to time out.""" + job_expiration_time: datetime | None = ... + """The time at which the batch inference job times or timed out.""" + model_invocation_type: str | None = ... + """The invocation endpoint for ModelInvocationJob""" + total_record_count: int | None = ... + """The total number of records in the batch inference job.""" + processed_record_count: int | None = ... + """ + The number of records that have been processed in the batch inference + job. + """ + success_record_count: int | None = ... + """ + The number of records that were successfully processed in the batch + inference job. + """ + error_record_count: int | None = ... + """The number of records that failed to process in the batch inference job.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetModelInvocationLoggingConfigurationInput(_SerdeShape): + """Dataclass for GetModelInvocationLoggingConfigurationInput structure.""" + +@dataclass(kw_only=True) +class GetModelInvocationLoggingConfigurationOutput(_SerdeShape): + """Dataclass for GetModelInvocationLoggingConfigurationOutput structure.""" + + logging_config: LoggingConfig | None = ... + """The current configuration values.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetPromptRouterInput(_SerdeShape): + """Dataclass for GetPromptRouterInput structure.""" + + prompt_router_arn: str | None = ... + """The prompt router's ARN""" + +@dataclass(kw_only=True) +class GetPromptRouterOutput(_SerdeShape): + """Dataclass for GetPromptRouterOutput structure.""" + + prompt_router_name: str + """The router's name.""" + routing_criteria: RoutingCriteria + """The router's routing criteria.""" + description: str | None = ... + """The router's description.""" + created_at: datetime | None = ... + """When the router was created.""" + updated_at: datetime | None = ... + """When the router was updated.""" + prompt_router_arn: str + """The prompt router's ARN""" + models: list[PromptRouterTargetModel] + """The router's models.""" + fallback_model: PromptRouterTargetModel + """The router's fallback model.""" + status: str + """The router's status.""" + type: str + """The router's type.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetProvisionedModelThroughputInput(_SerdeShape): + """Dataclass for GetProvisionedModelThroughputInput structure.""" + + provisioned_model_id: str | None = ... + """The Amazon Resource Name (ARN) or name of the Provisioned Throughput.""" + +@dataclass(kw_only=True) +class GetProvisionedModelThroughputOutput(_SerdeShape): + """Dataclass for GetProvisionedModelThroughputOutput structure.""" + + model_units: int + """The number of model units allocated to this Provisioned Throughput.""" + desired_model_units: int + """ + The number of model units that was requested for this Provisioned + Throughput. + """ + provisioned_model_name: str + """The name of the Provisioned Throughput.""" + provisioned_model_arn: str + """The Amazon Resource Name (ARN) of the Provisioned Throughput.""" + model_arn: str + """ + The Amazon Resource Name (ARN) of the model associated with this + Provisioned Throughput. + """ + desired_model_arn: str + """ + The Amazon Resource Name (ARN) of the model requested to be associated + to this Provisioned Throughput. This value differs from the `modelArn` + if updating hasn't completed. + """ + foundation_model_arn: str + """ + The Amazon Resource Name (ARN) of the base model for which the + Provisioned Throughput was created, or of the base model that the custom + model for which the Provisioned Throughput was created was customized. + """ + status: str + """The status of the Provisioned Throughput.""" + creation_time: datetime + """The timestamp of the creation time for this Provisioned Throughput.""" + last_modified_time: datetime + """ + The timestamp of the last time that this Provisioned Throughput was + modified. + """ + failure_message: str | None = ... + """ + A failure message for any issues that occurred during creation, + updating, or deletion of the Provisioned Throughput. + """ + commitment_duration: str | None = ... + """Commitment duration of the Provisioned Throughput.""" + commitment_expiration_time: datetime | None = ... + """ + The timestamp for when the commitment term for the Provisioned + Throughput expires. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetResourcePolicyInput(_SerdeShape): + """Dataclass for GetResourcePolicyInput structure.""" + + resource_arn: str | None = ... + """The ARN of the Bedrock resource to which this resource policy applies.""" + +@dataclass(kw_only=True) +class GetResourcePolicyOutput(_SerdeShape): + """Dataclass for GetResourcePolicyOutput structure.""" + + resource_policy: str | None = ... + """The JSON string representing the Bedrock resource policy.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetUseCaseForModelAccessInput(_SerdeShape): + """Dataclass for GetUseCaseForModelAccessInput structure.""" + +@dataclass(kw_only=True) +class GetUseCaseForModelAccessOutput(_SerdeShape): + """Dataclass for GetUseCaseForModelAccessOutput structure.""" + + form_data: bytes + """Get customer profile Response.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass +class GraderConfigLambdaGrader(_SerdeShape): + """ + Configuration for using an AWS Lambda function as the grader for + evaluating model responses and provide reward signals in reinforcement + fine-tuning. + """ + + value: LambdaGraderConfig + +@dataclass +class GraderConfigUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +GraderConfig = Union[GraderConfigLambdaGrader | GraderConfigUnknown] +""" +Configuration for the grader used in reinforcement fine-tuning to +evaluate model responses and provide reward signals. +""" + +class _GraderConfigDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> GraderConfig: ... + +@dataclass(kw_only=True) +class GuardrailAutomatedReasoningPolicy(_SerdeShape): + """ + Represents the configuration of Automated Reasoning policies within a + Amazon Bedrock Guardrail, including the policies to apply and confidence + thresholds. + """ + + policies: list[str] + """ + The list of Automated Reasoning policy ARNs that should be applied as + part of this guardrail configuration. + """ + confidence_threshold: float | None = ... + """ + The minimum confidence level required for Automated Reasoning policy + violations to trigger guardrail actions. Values range from 0.0 to 1.0. + """ + +@dataclass(kw_only=True) +class GuardrailAutomatedReasoningPolicyConfig(_SerdeShape): + """ + Configuration settings for integrating Automated Reasoning policies with + Amazon Bedrock Guardrails. + """ + + policies: list[str] + """ + The list of Automated Reasoning policy ARNs to include in the guardrail + configuration. + """ + confidence_threshold: float | None = ... + """ + The confidence threshold for triggering guardrail actions based on + Automated Reasoning policy violations. + """ + +@dataclass(kw_only=True) +class GuardrailConfiguration(_SerdeShape): + """The configuration details for the guardrail.""" + + guardrail_id: str + """The unique identifier for the guardrail.""" + guardrail_version: str + """The version of the guardrail.""" + +@dataclass(kw_only=True) +class GuardrailContentFilter(_SerdeShape): + """ + Contains filter strengths for harmful content. Guardrails support the + following content filters to detect and filter harmful user inputs and + FM-generated outputs. + + - **Hate** -- Describes language or a statement that discriminates, + criticizes, insults, denounces, or dehumanizes a person or group on + the basis of an identity (such as race, ethnicity, gender, religion, + sexual orientation, ability, and national origin). + + - **Insults** -- Describes language or a statement that includes + demeaning, humiliating, mocking, insulting, or belittling language. + This type of language is also labeled as bullying. + + - **Sexual** -- Describes language or a statement that indicates sexual + interest, activity, or arousal using direct or indirect references to + body parts, physical traits, or sex. + + - **Violence** -- Describes language or a statement that includes + glorification of or threats to inflict physical pain, hurt, or injury + toward a person, group or thing. + + Content filtering depends on the confidence classification of user + inputs and FM responses across each of the four harmful categories. All + input and output statements are classified into one of four confidence + levels (NONE, LOW, MEDIUM, HIGH) for each harmful category. For example, + if a statement is classified as *Hate* with HIGH confidence, the + likelihood of the statement representing hateful content is high. A + single statement can be classified across multiple categories with + varying confidence levels. For example, a single statement can be + classified as *Hate* with HIGH confidence, *Insults* with LOW + confidence, *Sexual* with NONE confidence, and *Violence* with MEDIUM + confidence. + + For more information, see [Guardrails content + filters](https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-filters.html). + + This data type is used in the following API operations: + + - [GetGuardrail response + body](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_GetGuardrail.html#API_GetGuardrail_ResponseSyntax) + """ + + type: str + """The harmful category that the content filter is applied to.""" + input_strength: str + """ + The strength of the content filter to apply to prompts. As you increase + the filter strength, the likelihood of filtering harmful content + increases and the probability of seeing harmful content in your + application reduces. + """ + output_strength: str + """ + The strength of the content filter to apply to model responses. As you + increase the filter strength, the likelihood of filtering harmful + content increases and the probability of seeing harmful content in your + application reduces. + """ + input_modalities: list[str] | None = ... + """The input modalities selected for the guardrail content filter.""" + output_modalities: list[str] | None = ... + """The output modalities selected for the guardrail content filter.""" + input_action: str | None = ... + """ + The action to take when harmful content is detected in the input. + Supported values include: + + - `BLOCK` -- Block the content and replace it with blocked messaging. + + - `NONE` -- Take no action but return detection information in the trace + response. + """ + output_action: str | None = ... + """ + The action to take when harmful content is detected in the output. + Supported values include: + + - `BLOCK` -- Block the content and replace it with blocked messaging. + + - `NONE` -- Take no action but return detection information in the trace + response. + """ + input_enabled: bool | None = ... + """ + Indicates whether guardrail evaluation is enabled on the input. When + disabled, you aren't charged for the evaluation. The evaluation + doesn't appear in the response. + """ + output_enabled: bool | None = ... + """ + Indicates whether guardrail evaluation is enabled on the output. When + disabled, you aren't charged for the evaluation. The evaluation + doesn't appear in the response. + """ + +class GuardrailContentFilterAction(UnknownEnumMixin, StrEnum): + BLOCK = "BLOCK" + NONE = "NONE" + +@dataclass(kw_only=True) +class GuardrailContentFilterConfig(_SerdeShape): + """ + Contains filter strengths for harmful content. Guardrails support the + following content filters to detect and filter harmful user inputs and + FM-generated outputs. + + - **Hate** -- Describes language or a statement that discriminates, + criticizes, insults, denounces, or dehumanizes a person or group on + the basis of an identity (such as race, ethnicity, gender, religion, + sexual orientation, ability, and national origin). + + - **Insults** -- Describes language or a statement that includes + demeaning, humiliating, mocking, insulting, or belittling language. + This type of language is also labeled as bullying. + + - **Sexual** -- Describes language or a statement that indicates sexual + interest, activity, or arousal using direct or indirect references to + body parts, physical traits, or sex. + + - **Violence** -- Describes language or a statement that includes + glorification of or threats to inflict physical pain, hurt, or injury + toward a person, group or thing. + + Content filtering depends on the confidence classification of user + inputs and FM responses across each of the four harmful categories. All + input and output statements are classified into one of four confidence + levels (NONE, LOW, MEDIUM, HIGH) for each harmful category. For example, + if a statement is classified as *Hate* with HIGH confidence, the + likelihood of the statement representing hateful content is high. A + single statement can be classified across multiple categories with + varying confidence levels. For example, a single statement can be + classified as *Hate* with HIGH confidence, *Insults* with LOW + confidence, *Sexual* with NONE confidence, and *Violence* with MEDIUM + confidence. + + For more information, see [Guardrails content + filters](https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-filters.html). + """ + + type: str + """The harmful category that the content filter is applied to.""" + input_strength: str + """ + The strength of the content filter to apply to prompts. As you increase + the filter strength, the likelihood of filtering harmful content + increases and the probability of seeing harmful content in your + application reduces. + """ + output_strength: str + """ + The strength of the content filter to apply to model responses. As you + increase the filter strength, the likelihood of filtering harmful + content increases and the probability of seeing harmful content in your + application reduces. + """ + input_modalities: list[str] | None = ... + """ + The input modalities selected for the guardrail content filter + configuration. + """ + output_modalities: list[str] | None = ... + """ + The output modalities selected for the guardrail content filter + configuration. + """ + input_action: str | None = ... + """ + Specifies the action to take when harmful content is detected. Supported + values include: + + - `BLOCK` -- Block the content and replace it with blocked messaging. + + - `NONE` -- Take no action but return detection information in the trace + response. + """ + output_action: str | None = ... + """ + Specifies the action to take when harmful content is detected in the + output. Supported values include: + + - `BLOCK` -- Block the content and replace it with blocked messaging. + + - `NONE` -- Take no action but return detection information in the trace + response. + """ + input_enabled: bool | None = ... + """ + Specifies whether to enable guardrail evaluation on the input. When + disabled, you aren't charged for the evaluation. The evaluation + doesn't appear in the response. + """ + output_enabled: bool | None = ... + """ + Specifies whether to enable guardrail evaluation on the output. When + disabled, you aren't charged for the evaluation. The evaluation + doesn't appear in the response. + """ + +@dataclass(kw_only=True) +class GuardrailContentFiltersTier(_SerdeShape): + """The tier that your guardrail uses for content filters.""" + + tier_name: str + """ + The tier that your guardrail uses for content filters. Valid values + include: + + - `CLASSIC` tier -- Provides established guardrails functionality + supporting English, French, and Spanish languages. + + - `STANDARD` tier -- Provides a more robust solution than the `CLASSIC` + tier and has more comprehensive language support. This tier requires + that your guardrail use [cross-Region + inference](https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-cross-region.html). + """ + +@dataclass(kw_only=True) +class GuardrailContentFiltersTierConfig(_SerdeShape): + """ + The tier that your guardrail uses for content filters. Consider using a + tier that balances performance, accuracy, and compatibility with your + existing generative AI workflows. + """ + + tier_name: str + """ + The tier that your guardrail uses for content filters. Valid values + include: + + - `CLASSIC` tier -- Provides established guardrails functionality + supporting English, French, and Spanish languages. + + - `STANDARD` tier -- Provides a more robust solution than the `CLASSIC` + tier and has more comprehensive language support. This tier requires + that your guardrail use [cross-Region + inference](https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-cross-region.html). + """ + +class GuardrailContentFiltersTierName(UnknownEnumMixin, StrEnum): + CLASSIC = "CLASSIC" + STANDARD = "STANDARD" + +class GuardrailContentFilterType(UnknownEnumMixin, StrEnum): + SEXUAL = "SEXUAL" + VIOLENCE = "VIOLENCE" + HATE = "HATE" + INSULTS = "INSULTS" + MISCONDUCT = "MISCONDUCT" + PROMPT_ATTACK = "PROMPT_ATTACK" + +@dataclass(kw_only=True) +class GuardrailContentPolicy(_SerdeShape): + """ + Contains details about how to handle harmful content. + + This data type is used in the following API operations: + + - [GetGuardrail response + body](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_GetGuardrail.html#API_GetGuardrail_ResponseSyntax) + """ + + filters: list[GuardrailContentFilter] | None = ... + """ + Contains the type of the content filter and how strongly it should apply + to prompts and model responses. + """ + tier: GuardrailContentFiltersTier | None = ... + """The tier that your guardrail uses for content filters.""" + +@dataclass(kw_only=True) +class GuardrailContentPolicyConfig(_SerdeShape): + """Contains details about how to handle harmful content.""" + + filters_config: list[GuardrailContentFilterConfig] + """ + Contains the type of the content filter and how strongly it should apply + to prompts and model responses. + """ + tier_config: GuardrailContentFiltersTierConfig | None = ... + """The tier that your guardrail uses for content filters.""" + +class GuardrailContextualGroundingAction(UnknownEnumMixin, StrEnum): + BLOCK = "BLOCK" + NONE = "NONE" + +@dataclass(kw_only=True) +class GuardrailContextualGroundingFilter(_SerdeShape): + """The details for the guardrails contextual grounding filter.""" + + type: str + """The filter type details for the guardrails contextual grounding filter.""" + threshold: float + """The threshold details for the guardrails contextual grounding filter.""" + action: str | None = ... + """ + The action to take when content fails the contextual grounding + evaluation. Supported values include: + + - `BLOCK` -- Block the content and replace it with blocked messaging. + + - `NONE` -- Take no action but return detection information in the trace + response. + """ + enabled: bool | None = ... + """ + Indicates whether contextual grounding is enabled for evaluation. When + disabled, you aren't charged for the evaluation. The evaluation + doesn't appear in the response. + """ + +@dataclass(kw_only=True) +class GuardrailContextualGroundingFilterConfig(_SerdeShape): + """ + The filter configuration details for the guardrails contextual grounding + filter. + """ + + type: str + """The filter details for the guardrails contextual grounding filter.""" + threshold: float + """The threshold details for the guardrails contextual grounding filter.""" + action: str | None = ... + """ + Specifies the action to take when content fails the contextual grounding + evaluation. Supported values include: + + - `BLOCK` -- Block the content and replace it with blocked messaging. + + - `NONE` -- Take no action but return detection information in the trace + response. + """ + enabled: bool | None = ... + """ + Specifies whether to enable contextual grounding evaluation. When + disabled, you aren't charged for the evaluation. The evaluation + doesn't appear in the response. + """ + +class GuardrailContextualGroundingFilterType(UnknownEnumMixin, StrEnum): + GROUNDING = "GROUNDING" + RELEVANCE = "RELEVANCE" + +@dataclass(kw_only=True) +class GuardrailContextualGroundingPolicy(_SerdeShape): + """The details for the guardrails contextual grounding policy.""" + + filters: list[GuardrailContextualGroundingFilter] + """The filter details for the guardrails contextual grounding policy.""" + +@dataclass(kw_only=True) +class GuardrailContextualGroundingPolicyConfig(_SerdeShape): + """ + The policy configuration details for the guardrails contextual grounding + policy. + """ + + filters_config: list[GuardrailContextualGroundingFilterConfig] + """ + The filter configuration details for the guardrails contextual grounding + policy. + """ + +@dataclass(kw_only=True) +class GuardrailCrossRegionConfig(_SerdeShape): + """ + The system-defined guardrail profile that you're using with your + guardrail. Guardrail profiles define the destination Amazon Web Services + Regions where guardrail inference requests can be automatically routed. + Using guardrail profiles helps maintain guardrail performance and + reliability when demand increases. + + For more information, see the [Amazon Bedrock User + Guide](https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-cross-region.html). + """ + + guardrail_profile_identifier: str + """ + The ID or Amazon Resource Name (ARN) of the guardrail profile that your + guardrail is using. Guardrail profile availability depends on your + current Amazon Web Services Region. For more information, see the + [Amazon Bedrock User + Guide](https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-cross-region-support.html). + """ + +@dataclass(kw_only=True) +class GuardrailCrossRegionDetails(_SerdeShape): + """ + Contains details about the system-defined guardrail profile that you're + using with your guardrail for cross-Region inference. + + For more information, see the [Amazon Bedrock User + Guide](https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-cross-region.html). + """ + + guardrail_profile_id: str | None = ... + """ + The ID of the guardrail profile that your guardrail is using. Profile + availability depends on your current Amazon Web Services Region. For + more information, see the [Amazon Bedrock User + Guide](https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-cross-region-support.html). + """ + guardrail_profile_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the guardrail profile that you're + using with your guardrail. + """ + +class GuardrailFilterStrength(UnknownEnumMixin, StrEnum): + NONE = "NONE" + LOW = "LOW" + MEDIUM = "MEDIUM" + HIGH = "HIGH" + +@dataclass(kw_only=True) +class GuardrailManagedWords(_SerdeShape): + """ + The managed word list that was configured for the guardrail. (This is a + list of words that are pre-defined and managed by guardrails only.) + """ + + type: str + """ + ManagedWords$type The managed word type that was configured for the + guardrail. (For now, we only offer profanity word list) + """ + input_action: str | None = ... + """ + The action to take when harmful content is detected in the input. + Supported values include: + + - `BLOCK` -- Block the content and replace it with blocked messaging. + + - `NONE` -- Take no action but return detection information in the trace + response. + """ + output_action: str | None = ... + """ + The action to take when harmful content is detected in the output. + Supported values include: + + - `BLOCK` -- Block the content and replace it with blocked messaging. + + - `NONE` -- Take no action but return detection information in the trace + response. + """ + input_enabled: bool | None = ... + """ + Indicates whether guardrail evaluation is enabled on the input. When + disabled, you aren't charged for the evaluation. The evaluation + doesn't appear in the response. + """ + output_enabled: bool | None = ... + """ + Indicates whether guardrail evaluation is enabled on the output. When + disabled, you aren't charged for the evaluation. The evaluation + doesn't appear in the response. + """ + +@dataclass(kw_only=True) +class GuardrailManagedWordsConfig(_SerdeShape): + """The managed word list to configure for the guardrail.""" + + type: str + """The managed word type to configure for the guardrail.""" + input_action: str | None = ... + """ + Specifies the action to take when harmful content is detected in the + input. Supported values include: + + - `BLOCK` -- Block the content and replace it with blocked messaging. + + - `NONE` -- Take no action but return detection information in the trace + response. + """ + output_action: str | None = ... + """ + Specifies the action to take when harmful content is detected in the + output. Supported values include: + + - `BLOCK` -- Block the content and replace it with blocked messaging. + + - `NONE` -- Take no action but return detection information in the trace + response. + """ + input_enabled: bool | None = ... + """ + Specifies whether to enable guardrail evaluation on the input. When + disabled, you aren't charged for the evaluation. The evaluation + doesn't appear in the response. + """ + output_enabled: bool | None = ... + """ + Specifies whether to enable guardrail evaluation on the output. When + disabled, you aren't charged for the evaluation. The evaluation + doesn't appear in the response. + """ + +class GuardrailManagedWordsType(UnknownEnumMixin, StrEnum): + PROFANITY = "PROFANITY" + +class GuardrailModality(UnknownEnumMixin, StrEnum): + TEXT = "TEXT" + IMAGE = "IMAGE" + +@dataclass(kw_only=True) +class GuardrailPiiEntity(_SerdeShape): + """The PII entity configured for the guardrail.""" + + type: str + """The type of PII entity. For example, Social Security Number.""" + action: str + """The configured guardrail action when PII entity is detected.""" + input_action: str | None = ... + """ + The action to take when harmful content is detected in the input. + Supported values include: + + - `BLOCK` -- Block the content and replace it with blocked messaging. + + - `ANONYMIZE` -- Mask the content and replace it with identifier tags. + + - `NONE` -- Take no action but return detection information in the trace + response. + """ + output_action: str | None = ... + """ + The action to take when harmful content is detected in the output. + Supported values include: + + - `BLOCK` -- Block the content and replace it with blocked messaging. + + - `ANONYMIZE` -- Mask the content and replace it with identifier tags. + + - `NONE` -- Take no action but return detection information in the trace + response. + """ + input_enabled: bool | None = ... + """ + Indicates whether guardrail evaluation is enabled on the input. When + disabled, you aren't charged for the evaluation. The evaluation + doesn't appear in the response. + """ + output_enabled: bool | None = ... + """ + Indicates whether guardrail evaluation is enabled on the output. When + disabled, you aren't charged for the evaluation. The evaluation + doesn't appear in the response. + """ + +@dataclass(kw_only=True) +class GuardrailPiiEntityConfig(_SerdeShape): + """The PII entity to configure for the guardrail.""" + + type: str + """ + Configure guardrail type when the PII entity is detected. + + The following PIIs are used to block or mask sensitive information: + + - **General** + + - **ADDRESS** + + A physical address, such as \"100 Main Street, Anytown, USA\" or + \"Suite #12, Building 123\". An address can include information such + as the street, building, location, city, state, country, county, zip + code, precinct, and neighborhood. + + - **AGE** + + An individual's age, including the quantity and unit of time. For + example, in the phrase \"I am 40 years old,\" Guardrails recognizes + \"40 years\" as an age. + + - **NAME** + + An individual's name. This entity type does not include titles, + such as Dr., Mr., Mrs., or Miss. guardrails doesn't apply this + entity type to names that are part of organizations or addresses. + For example, guardrails recognizes the \"John Doe Organization\" as + an organization, and it recognizes \"Jane Doe Street\" as an + address. + + - **EMAIL** + + An email address, such as *marymajor@email.com*. + + - **PHONE** + + A phone number. This entity type also includes fax and pager + numbers. + + - **USERNAME** + + A user name that identifies an account, such as a login name, screen + name, nick name, or handle. + + - **PASSWORD** + + An alphanumeric string that is used as a password, such as + \"**very20special#pass**\". + + - **DRIVER_ID** + + The number assigned to a driver's license, which is an official + document permitting an individual to operate one or more motorized + vehicles on a public road. A driver's license number consists of + alphanumeric characters. + + - **LICENSE_PLATE** + + A license plate for a vehicle is issued by the state or country + where the vehicle is registered. The format for passenger vehicles + is typically five to eight digits, consisting of upper-case letters + and numbers. The format varies depending on the location of the + issuing state or country. + + - **VEHICLE_IDENTIFICATION_NUMBER** + + A Vehicle Identification Number (VIN) uniquely identifies a vehicle. + VIN content and format are defined in the *ISO 3779* specification. + Each country has specific codes and formats for VINs. + + - **Finance** + + - **CREDIT_DEBIT_CARD_CVV** + + A three-digit card verification code (CVV) that is present on VISA, + MasterCard, and Discover credit and debit cards. For American + Express credit or debit cards, the CVV is a four-digit numeric code. + + - **CREDIT_DEBIT_CARD_EXPIRY** + + The expiration date for a credit or debit card. This number is + usually four digits long and is often formatted as *month/year* or + *MM/YY*. Guardrails recognizes expiration dates such as *01/21*, + *01/2021*, and *Jan 2021*. + + - **CREDIT_DEBIT_CARD_NUMBER** + + The number for a credit or debit card. These numbers can vary from + 13 to 16 digits in length. However, Amazon Comprehend also + recognizes credit or debit card numbers when only the last four + digits are present. + + - **PIN** + + A four-digit personal identification number (PIN) with which you can + access your bank account. + + - **INTERNATIONAL_BANK_ACCOUNT_NUMBER** + + An International Bank Account Number has specific formats in each + country. For more information, see + [www.iban.com/structure](https://www.iban.com/structure). + + - **SWIFT_CODE** + + A SWIFT code is a standard format of Bank Identifier Code (BIC) used + to specify a particular bank or branch. Banks use these codes for + money transfers such as international wire transfers. + + SWIFT codes consist of eight or 11 characters. The 11-digit codes + refer to specific branches, while eight-digit codes (or 11-digit + codes ending in 'XXX') refer to the head or primary office. + + - **IT** + + - **IP_ADDRESS** + + An IPv4 address, such as *198.51.100.0*. + + - **MAC_ADDRESS** + + A *media access control* (MAC) address is a unique identifier + assigned to a network interface controller (NIC). + + - **URL** + + A web address, such as *www.example.com*. + + - **AWS_ACCESS_KEY** + + A unique identifier that's associated with a secret access key; you + use the access key ID and secret access key to sign programmatic + Amazon Web Services requests cryptographically. + + - **AWS_SECRET_KEY** + + A unique identifier that's associated with an access key. You use + the access key ID and secret access key to sign programmatic Amazon + Web Services requests cryptographically. + + - **USA specific** + + - **US_BANK_ACCOUNT_NUMBER** + + A US bank account number, which is typically 10 to 12 digits long. + + - **US_BANK_ROUTING_NUMBER** + + A US bank account routing number. These are typically nine digits + long, + + - **US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER** + + A US Individual Taxpayer Identification Number (ITIN) is a + nine-digit number that starts with a \"9\" and contain a \"7\" or + \"8\" as the fourth digit. An ITIN can be formatted with a space or + a dash after the third and forth digits. + + - **US_PASSPORT_NUMBER** + + A US passport number. Passport numbers range from six to nine + alphanumeric characters. + + - **US_SOCIAL_SECURITY_NUMBER** + + A US Social Security Number (SSN) is a nine-digit number that is + issued to US citizens, permanent residents, and temporary working + residents. + + - **Canada specific** + + - **CA_HEALTH_NUMBER** + + A Canadian Health Service Number is a 10-digit unique identifier, + required for individuals to access healthcare benefits. + + - **CA_SOCIAL_INSURANCE_NUMBER** + + A Canadian Social Insurance Number (SIN) is a nine-digit unique + identifier, required for individuals to access government programs + and benefits. + + The SIN is formatted as three groups of three digits, such as + *123-456-789*. A SIN can be validated through a simple check-digit + process called the [Luhn + algorithm](https://www.wikipedia.org/wiki/Luhn_algorithm). + + - **UK Specific** + + - **UK_NATIONAL_HEALTH_SERVICE_NUMBER** + + A UK National Health Service Number is a 10-17 digit number, such as + *485 777 3456*. The current system formats the 10-digit number with + spaces after the third and sixth digits. The final digit is an + error-detecting checksum. + + - **UK_NATIONAL_INSURANCE_NUMBER** + + A UK National Insurance Number (NINO) provides individuals with + access to National Insurance (social security) benefits. It is also + used for some purposes in the UK tax system. + + The number is nine digits long and starts with two letters, followed + by six numbers and one letter. A NINO can be formatted with a space + or a dash after the two letters and after the second, forth, and + sixth digits. + + - **UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER** + + A UK Unique Taxpayer Reference (UTR) is a 10-digit number that + identifies a taxpayer or a business. + + - **Custom** + + - **Regex filter** - You can use a regular expressions to define + patterns for a guardrail to recognize and act upon such as serial + number, booking ID etc.. + """ + action: str + """Configure guardrail action when the PII entity is detected.""" + input_action: str | None = ... + """ + Specifies the action to take when harmful content is detected in the + input. Supported values include: + + - `BLOCK` -- Block the content and replace it with blocked messaging. + + - `ANONYMIZE` -- Mask the content and replace it with identifier tags. + + - `NONE` -- Take no action but return detection information in the trace + response. + """ + output_action: str | None = ... + """ + Specifies the action to take when harmful content is detected in the + output. Supported values include: + + - `BLOCK` -- Block the content and replace it with blocked messaging. + + - `ANONYMIZE` -- Mask the content and replace it with identifier tags. + + - `NONE` -- Take no action but return detection information in the trace + response. + """ + input_enabled: bool | None = ... + """ + Specifies whether to enable guardrail evaluation on the input. When + disabled, you aren't charged for the evaluation. The evaluation + doesn't appear in the response. + """ + output_enabled: bool | None = ... + """ + Specifies whether to enable guardrail evaluation on the output. When + disabled, you aren't charged for the evaluation. The evaluation + doesn't appear in the response. + """ + +class GuardrailPiiEntityType(UnknownEnumMixin, StrEnum): + ADDRESS = "ADDRESS" + AGE = "AGE" + AWS_ACCESS_KEY = "AWS_ACCESS_KEY" + AWS_SECRET_KEY = "AWS_SECRET_KEY" + CA_HEALTH_NUMBER = "CA_HEALTH_NUMBER" + CA_SOCIAL_INSURANCE_NUMBER = "CA_SOCIAL_INSURANCE_NUMBER" + CREDIT_DEBIT_CARD_CVV = "CREDIT_DEBIT_CARD_CVV" + CREDIT_DEBIT_CARD_EXPIRY = "CREDIT_DEBIT_CARD_EXPIRY" + CREDIT_DEBIT_CARD_NUMBER = "CREDIT_DEBIT_CARD_NUMBER" + DRIVER_ID = "DRIVER_ID" + EMAIL = "EMAIL" + INTERNATIONAL_BANK_ACCOUNT_NUMBER = "INTERNATIONAL_BANK_ACCOUNT_NUMBER" + IP_ADDRESS = "IP_ADDRESS" + LICENSE_PLATE = "LICENSE_PLATE" + MAC_ADDRESS = "MAC_ADDRESS" + NAME = "NAME" + PASSWORD = "PASSWORD" + PHONE = "PHONE" + PIN = "PIN" + SWIFT_CODE = "SWIFT_CODE" + UK_NATIONAL_HEALTH_SERVICE_NUMBER = "UK_NATIONAL_HEALTH_SERVICE_NUMBER" + UK_NATIONAL_INSURANCE_NUMBER = "UK_NATIONAL_INSURANCE_NUMBER" + UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER = "UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER" + URL = "URL" + USERNAME = "USERNAME" + US_BANK_ACCOUNT_NUMBER = "US_BANK_ACCOUNT_NUMBER" + US_BANK_ROUTING_NUMBER = "US_BANK_ROUTING_NUMBER" + US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER = "US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER" + US_PASSPORT_NUMBER = "US_PASSPORT_NUMBER" + US_SOCIAL_SECURITY_NUMBER = "US_SOCIAL_SECURITY_NUMBER" + VEHICLE_IDENTIFICATION_NUMBER = "VEHICLE_IDENTIFICATION_NUMBER" + +@dataclass(kw_only=True) +class GuardrailRegex(_SerdeShape): + """The regular expression configured for the guardrail.""" + + name: str + """The name of the regular expression for the guardrail.""" + description: str | None = ... + """The description of the regular expression for the guardrail.""" + pattern: str + """The pattern of the regular expression configured for the guardrail.""" + action: str + """The action taken when a match to the regular expression is detected.""" + input_action: str | None = ... + """ + The action to take when harmful content is detected in the input. + Supported values include: + + - `BLOCK` -- Block the content and replace it with blocked messaging. + + - `NONE` -- Take no action but return detection information in the trace + response. + """ + output_action: str | None = ... + """ + The action to take when harmful content is detected in the output. + Supported values include: + + - `BLOCK` -- Block the content and replace it with blocked messaging. + + - `NONE` -- Take no action but return detection information in the trace + response. + """ + input_enabled: bool | None = ... + """ + Indicates whether guardrail evaluation is enabled on the input. When + disabled, you aren't charged for the evaluation. The evaluation + doesn't appear in the response. + """ + output_enabled: bool | None = ... + """ + Indicates whether guardrail evaluation is enabled on the output. When + disabled, you aren't charged for the evaluation. The evaluation + doesn't appear in the response. + """ + +@dataclass(kw_only=True) +class GuardrailRegexConfig(_SerdeShape): + """The regular expression to configure for the guardrail.""" + + name: str + """The name of the regular expression to configure for the guardrail.""" + description: str | None = ... + """ + The description of the regular expression to configure for the + guardrail. + """ + pattern: str + """The regular expression pattern to configure for the guardrail.""" + action: str + """ + The guardrail action to configure when matching regular expression is + detected. + """ + input_action: str | None = ... + """ + Specifies the action to take when harmful content is detected in the + input. Supported values include: + + - `BLOCK` -- Block the content and replace it with blocked messaging. + + - `NONE` -- Take no action but return detection information in the trace + response. + """ + output_action: str | None = ... + """ + Specifies the action to take when harmful content is detected in the + output. Supported values include: + + - `BLOCK` -- Block the content and replace it with blocked messaging. + + - `NONE` -- Take no action but return detection information in the trace + response. + """ + input_enabled: bool | None = ... + """ + Specifies whether to enable guardrail evaluation on the input. When + disabled, you aren't charged for the evaluation. The evaluation + doesn't appear in the response. + """ + output_enabled: bool | None = ... + """ + Specifies whether to enable guardrail evaluation on the output. When + disabled, you aren't charged for the evaluation. The evaluation + doesn't appear in the response. + """ + +class GuardrailSensitiveInformationAction(UnknownEnumMixin, StrEnum): + BLOCK = "BLOCK" + ANONYMIZE = "ANONYMIZE" + NONE = "NONE" + +@dataclass(kw_only=True) +class GuardrailSensitiveInformationPolicy(_SerdeShape): + """ + Contains details about PII entities and regular expressions configured + for the guardrail. + """ + + pii_entities: list[GuardrailPiiEntity] | None = ... + """The list of PII entities configured for the guardrail.""" + regexes: list[GuardrailRegex] | None = ... + """The list of regular expressions configured for the guardrail.""" + +@dataclass(kw_only=True) +class GuardrailSensitiveInformationPolicyConfig(_SerdeShape): + """ + Contains details about PII entities and regular expressions to configure + for the guardrail. + """ + + pii_entities_config: list[GuardrailPiiEntityConfig] | None = ... + """A list of PII entities to configure to the guardrail.""" + regexes_config: list[GuardrailRegexConfig] | None = ... + """A list of regular expressions to configure to the guardrail.""" + +class GuardrailStatus(UnknownEnumMixin, StrEnum): + CREATING = "CREATING" + UPDATING = "UPDATING" + VERSIONING = "VERSIONING" + READY = "READY" + FAILED = "FAILED" + DELETING = "DELETING" + +@dataclass(kw_only=True) +class GuardrailSummary(_SerdeShape): + """ + Contains details about a guardrail. + + This data type is used in the following API operations: + + - [ListGuardrails response + body](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_ListGuardrails.html#API_ListGuardrails_ResponseSyntax) + """ + + id: str + """The unique identifier of the guardrail.""" + arn: str + """The ARN of the guardrail.""" + status: str + """The status of the guardrail.""" + name: str + """The name of the guardrail.""" + description: str | None = ... + """A description of the guardrail.""" + version: str + """The version of the guardrail.""" + created_at: datetime + """The date and time at which the guardrail was created.""" + updated_at: datetime + """The date and time at which the guardrail was last updated.""" + cross_region_details: GuardrailCrossRegionDetails | None = ... + """ + Details about the system-defined guardrail profile that you're using + with your guardrail, including the guardrail profile ID and Amazon + Resource Name (ARN). + """ + +@dataclass(kw_only=True) +class GuardrailTopic(_SerdeShape): + """ + Details about topics for the guardrail to identify and deny. + + This data type is used in the following API operations: + + - [GetGuardrail response + body](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_GetGuardrail.html#API_GetGuardrail_ResponseSyntax) + """ + + name: str + """The name of the topic to deny.""" + definition: str + """A definition of the topic to deny.""" + examples: list[str] | None = ... + """ + A list of prompts, each of which is an example of a prompt that can be + categorized as belonging to the topic. + """ + type: str | None = ... + """Specifies to deny the topic.""" + input_action: str | None = ... + """ + The action to take when harmful content is detected in the input. + Supported values include: + + - `BLOCK` -- Block the content and replace it with blocked messaging. + + - `NONE` -- Take no action but return detection information in the trace + response. + """ + output_action: str | None = ... + """ + The action to take when harmful content is detected in the output. + Supported values include: + + - `BLOCK` -- Block the content and replace it with blocked messaging. + + - `NONE` -- Take no action but return detection information in the trace + response. + """ + input_enabled: bool | None = ... + """ + Indicates whether guardrail evaluation is enabled on the input. When + disabled, you aren't charged for the evaluation. The evaluation + doesn't appear in the response. + """ + output_enabled: bool | None = ... + """ + Indicates whether guardrail evaluation is enabled on the output. When + disabled, you aren't charged for the evaluation. The evaluation + doesn't appear in the response. + """ + +class GuardrailTopicAction(UnknownEnumMixin, StrEnum): + BLOCK = "BLOCK" + NONE = "NONE" + +@dataclass(kw_only=True) +class GuardrailTopicConfig(_SerdeShape): + """Details about topics for the guardrail to identify and deny.""" + + name: str + """The name of the topic to deny.""" + definition: str + """A definition of the topic to deny.""" + examples: list[str] | None = ... + """ + A list of prompts, each of which is an example of a prompt that can be + categorized as belonging to the topic. + """ + type: str + """Specifies to deny the topic.""" + input_action: str | None = ... + """ + Specifies the action to take when harmful content is detected in the + input. Supported values include: + + - `BLOCK` -- Block the content and replace it with blocked messaging. + + - `NONE` -- Take no action but return detection information in the trace + response. + """ + output_action: str | None = ... + """ + Specifies the action to take when harmful content is detected in the + output. Supported values include: + + - `BLOCK` -- Block the content and replace it with blocked messaging. + + - `NONE` -- Take no action but return detection information in the trace + response. + """ + input_enabled: bool | None = ... + """ + Specifies whether to enable guardrail evaluation on the input. When + disabled, you aren't charged for the evaluation. The evaluation + doesn't appear in the response. + """ + output_enabled: bool | None = ... + """ + Specifies whether to enable guardrail evaluation on the output. When + disabled, you aren't charged for the evaluation. The evaluation + doesn't appear in the response. + """ + +@dataclass(kw_only=True) +class GuardrailTopicPolicy(_SerdeShape): + """ + Contains details about topics that the guardrail should identify and + deny. + + This data type is used in the following API operations: + + - [GetGuardrail response + body](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_GetGuardrail.html#API_GetGuardrail_ResponseSyntax) + """ + + topics: list[GuardrailTopic] + """A list of policies related to topics that the guardrail should deny.""" + tier: GuardrailTopicsTier | None = ... + """The tier that your guardrail uses for denied topic filters.""" + +@dataclass(kw_only=True) +class GuardrailTopicPolicyConfig(_SerdeShape): + """ + Contains details about topics that the guardrail should identify and + deny. + """ + + topics_config: list[GuardrailTopicConfig] + """A list of policies related to topics that the guardrail should deny.""" + tier_config: GuardrailTopicsTierConfig | None = ... + """The tier that your guardrail uses for denied topic filters.""" + +@dataclass(kw_only=True) +class GuardrailTopicsTier(_SerdeShape): + """The tier that your guardrail uses for denied topic filters.""" + + tier_name: str + """ + The tier that your guardrail uses for denied topic filters. Valid values + include: + + - `CLASSIC` tier -- Provides established guardrails functionality + supporting English, French, and Spanish languages. + + - `STANDARD` tier -- Provides a more robust solution than the `CLASSIC` + tier and has more comprehensive language support. This tier requires + that your guardrail use [cross-Region + inference](https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-cross-region.html). + """ + +@dataclass(kw_only=True) +class GuardrailTopicsTierConfig(_SerdeShape): + """ + The tier that your guardrail uses for denied topic filters. Consider + using a tier that balances performance, accuracy, and compatibility with + your existing generative AI workflows. + """ + + tier_name: str + """ + The tier that your guardrail uses for denied topic filters. Valid values + include: + + - `CLASSIC` tier -- Provides established guardrails functionality + supporting English, French, and Spanish languages. + + - `STANDARD` tier -- Provides a more robust solution than the `CLASSIC` + tier and has more comprehensive language support. This tier requires + that your guardrail use [cross-Region + inference](https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-cross-region.html). + """ + +class GuardrailTopicsTierName(UnknownEnumMixin, StrEnum): + CLASSIC = "CLASSIC" + STANDARD = "STANDARD" + +class GuardrailTopicType(UnknownEnumMixin, StrEnum): + DENY = "DENY" + +@dataclass(kw_only=True) +class GuardrailWord(_SerdeShape): + """A word configured for the guardrail.""" + + text: str + """Text of the word configured for the guardrail to block.""" + input_action: str | None = ... + """ + The action to take when harmful content is detected in the input. + Supported values include: + + - `BLOCK` -- Block the content and replace it with blocked messaging. + + - `NONE` -- Take no action but return detection information in the trace + response. + """ + output_action: str | None = ... + """ + The action to take when harmful content is detected in the output. + Supported values include: + + - `BLOCK` -- Block the content and replace it with blocked messaging. + + - `NONE` -- Take no action but return detection information in the trace + response. + """ + input_enabled: bool | None = ... + """ + Indicates whether guardrail evaluation is enabled on the input. When + disabled, you aren't charged for the evaluation. The evaluation + doesn't appear in the response. + """ + output_enabled: bool | None = ... + """ + Indicates whether guardrail evaluation is enabled on the output. When + disabled, you aren't charged for the evaluation. The evaluation + doesn't appear in the response. + """ + +class GuardrailWordAction(UnknownEnumMixin, StrEnum): + BLOCK = "BLOCK" + NONE = "NONE" + +@dataclass(kw_only=True) +class GuardrailWordConfig(_SerdeShape): + """A word to configure for the guardrail.""" + + text: str + """Text of the word configured for the guardrail to block.""" + input_action: str | None = ... + """ + Specifies the action to take when harmful content is detected in the + input. Supported values include: + + - `BLOCK` -- Block the content and replace it with blocked messaging. + + - `NONE` -- Take no action but return detection information in the trace + response. + """ + output_action: str | None = ... + """ + Specifies the action to take when harmful content is detected in the + output. Supported values include: + + - `BLOCK` -- Block the content and replace it with blocked messaging. + + - `NONE` -- Take no action but return detection information in the trace + response. + """ + input_enabled: bool | None = ... + """ + Specifies whether to enable guardrail evaluation on the intput. When + disabled, you aren't charged for the evaluation. The evaluation + doesn't appear in the response. + """ + output_enabled: bool | None = ... + """ + Specifies whether to enable guardrail evaluation on the output. When + disabled, you aren't charged for the evaluation. The evaluation + doesn't appear in the response. + """ + +@dataclass(kw_only=True) +class GuardrailWordPolicy(_SerdeShape): + """Contains details about the word policy configured for the guardrail.""" + + words: list[GuardrailWord] | None = ... + """A list of words configured for the guardrail.""" + managed_word_lists: list[GuardrailManagedWords] | None = ... + """A list of managed words configured for the guardrail.""" + +@dataclass(kw_only=True) +class GuardrailWordPolicyConfig(_SerdeShape): + """Contains details about the word policy to configured for the guardrail.""" + + words_config: list[GuardrailWordConfig] | None = ... + """A list of words to configure for the guardrail.""" + managed_word_lists_config: list[GuardrailManagedWordsConfig] | None = ... + """A list of managed words to configure for the guardrail.""" + +@dataclass(kw_only=True) +class HumanEvaluationConfig(_SerdeShape): + """ + Specifies the custom metrics, how tasks will be rated, the flow + definition ARN, and your custom prompt datasets. Model evaluation jobs + use human workers *only* support the use of custom prompt datasets. To + learn more about custom prompt datasets and the required format, see + [Custom prompt + datasets](https://docs.aws.amazon.com/bedrock/latest/userguide/model-evaluation-prompt-datasets-custom.html). + + When you create custom metrics in `HumanEvaluationCustomMetric` you must + specify the metric's `name`. The list of `names` specified in the + `HumanEvaluationCustomMetric` array, must match the `metricNames` array + of strings specified in `EvaluationDatasetMetricConfig`. For example, if + in the `HumanEvaluationCustomMetric` array your specified the names + `"accuracy", "toxicity", "readability"` as custom metrics *then* the + `metricNames` array would need to look like the following + `["accuracy", "toxicity", "readability"]` in + `EvaluationDatasetMetricConfig`. + """ + + human_workflow_config: HumanWorkflowConfig | None = ... + """The parameters of the human workflow.""" + custom_metrics: list[HumanEvaluationCustomMetric] | None = ... + """ + A `HumanEvaluationCustomMetric` object. It contains the names the + metrics, how the metrics are to be evaluated, an optional description. + """ + dataset_metric_configs: list[EvaluationDatasetMetricConfig] + """ + Use to specify the metrics, task, and prompt dataset to be used in your + model evaluation job. + """ + +@dataclass(kw_only=True) +class HumanEvaluationCustomMetric(_SerdeShape): + """ + In a model evaluation job that uses human workers you must define the + name of the metric, and how you want that metric rated `ratingMethod`, + and an optional description of the metric. + """ + + name: str + """ + The name of the metric. Your human evaluators will see this name in the + evaluation UI. + """ + description: str | None = ... + """ + An optional description of the metric. Use this parameter to provide + more details about the metric. + """ + rating_method: str + """ + Choose how you want your human workers to evaluation your model. Valid + values for rating methods are `ThumbsUpDown`, + `IndividualLikertScale`,`ComparisonLikertScale`, `ComparisonChoice`, and + `ComparisonRank` + """ + +@dataclass(kw_only=True) +class HumanWorkflowConfig(_SerdeShape): + """ + Contains `SageMakerFlowDefinition` object. The object is used to specify + the prompt dataset, task type, rating method and metric names. + """ + + flow_definition_arn: str + """The Amazon Resource Number (ARN) for the flow definition""" + instructions: str | None = ... + """Instructions for the flow definition""" + +@dataclass(kw_only=True) +class ImplicitFilterConfiguration(_SerdeShape): + """ + Configuration for implicit filtering in Knowledge Base vector searches. + Implicit filtering allows you to automatically filter search results + based on metadata attributes without requiring explicit filter + expressions in each query. + """ + + metadata_attributes: list[MetadataAttributeSchema] + """ + A list of metadata attribute schemas that define the structure and + properties of metadata fields used for implicit filtering. Each + attribute defines a key, type, and optional description. + """ + model_arn: str + """ + The Amazon Resource Name (ARN) of the foundation model used for implicit + filtering. This model processes the query to extract relevant filtering + criteria. + """ + +@dataclass(kw_only=True) +class ImportedModelSummary(_SerdeShape): + """Information about the imported model.""" + + model_arn: str + """The Amazon Resource Name (ARN) of the imported model.""" + model_name: str + """Name of the imported model.""" + creation_time: datetime + """Creation time of the imported model.""" + instruct_supported: bool | None = ... + """Specifies if the imported model supports converse.""" + model_architecture: str | None = ... + """The architecture of the imported model.""" + +@dataclass(kw_only=True) +class InferenceConfiguration(_SerdeShape): + """ + Base inference parameters to pass to a model. For more information, see + [Inference parameters for foundation + models](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html). + """ + + max_tokens: int | None = ... + """ + The maximum number of tokens to allow in the generated response. The + default value is the maximum allowed value for the model that you are + using. + """ + temperature: float | None = ... + """ + The likelihood of the model selecting higher-probability options while + generating a response. A lower value makes the model more likely to + choose higher-probability options, while a higher value makes the model + more likely to choose lower-probability options. + """ + top_p: float | None = ... + """ + The percentage of most-likely candidates that the model considers for + the next token. For example, if you choose a value of 0.8 for `topP`, + the model selects from the top 80% of the probability distribution of + tokens that could be next in the sequence. + """ + stop_sequences: list[str] | None = ... + """ + A list of stop sequences. A stop sequence is a sequence of characters + that causes the model to stop generating the response. + """ + +@dataclass(kw_only=True) +class InferenceProfileModel(_SerdeShape): + """Contains information about a model.""" + + model_arn: str | None = ... + """The Amazon Resource Name (ARN) of the model.""" + +@dataclass +class InferenceProfileModelSourceCopyFrom(_SerdeShape): + """ + The ARN of the model or system-defined inference profile that is the + source for the inference profile. + """ + + value: str + +@dataclass +class InferenceProfileModelSourceUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +InferenceProfileModelSource = Union[ + InferenceProfileModelSourceCopyFrom | InferenceProfileModelSourceUnknown +] +""" +Contains information about the model or system-defined inference profile +that is the source for an inference profile.. +""" + +class _InferenceProfileModelSourceDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> InferenceProfileModelSource: ... + +class InferenceProfileStatus(UnknownEnumMixin, StrEnum): + ACTIVE = "ACTIVE" + +@dataclass(kw_only=True) +class InferenceProfileSummary(_SerdeShape): + """Contains information about an inference profile.""" + + inference_profile_name: str + """The name of the inference profile.""" + description: str | None = ... + """The description of the inference profile.""" + created_at: datetime | None = ... + """The time at which the inference profile was created.""" + updated_at: datetime | None = ... + """The time at which the inference profile was last updated.""" + inference_profile_arn: str + """The Amazon Resource Name (ARN) of the inference profile.""" + models: list[InferenceProfileModel] + """A list of information about each model in the inference profile.""" + inference_profile_id: str + """The unique identifier of the inference profile.""" + status: str + """ + The status of the inference profile. `ACTIVE` means that the inference + profile is ready to be used. + """ + type: str + """ + The type of the inference profile. The following types are possible: + + - `SYSTEM_DEFINED` -- The inference profile is defined by Amazon + Bedrock. You can route inference requests across regions with these + inference profiles. + + - `APPLICATION` -- The inference profile was created by a user. This + type of inference profile can track metrics and costs when invoking + the model in it. The inference profile may route requests to one or + multiple regions. + """ + +class InferenceProfileType(UnknownEnumMixin, StrEnum): + SYSTEM_DEFINED = "SYSTEM_DEFINED" + APPLICATION = "APPLICATION" + +class InferenceType(UnknownEnumMixin, StrEnum): + ON_DEMAND = "ON_DEMAND" + PROVISIONED = "PROVISIONED" + +class InputTags(UnknownEnumMixin, StrEnum): + HONOR = "HONOR" + IGNORE = "IGNORE" + +@dataclass(kw_only=True) +class InternalServerException(ServiceError, _SerdeShape): + """An internal server error occurred. Retry your request.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvocationLogsConfig(_SerdeShape): + """Settings for using invocation logs to customize a model.""" + + use_prompt_response: bool = ... + """ + Whether to use the model's response for training, or just the prompt. + The default value is `False`. + """ + invocation_log_source: InvocationLogSource + """The source of the invocation logs.""" + request_metadata_filters: RequestMetadataFilters | None = ... + """Rules for filtering invocation logs based on request metadata.""" + +@dataclass +class InvocationLogSourceS3Uri(_SerdeShape): + """The URI of an invocation log in a bucket.""" + + value: str + +@dataclass +class InvocationLogSourceUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +InvocationLogSource = Union[InvocationLogSourceS3Uri | InvocationLogSourceUnknown] +"""A storage location for invocation logs.""" + +class _InvocationLogSourceDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> InvocationLogSource: ... + +class JobStatusDetails(UnknownEnumMixin, StrEnum): + IN_PROGRESS = "InProgress" + COMPLETED = "Completed" + STOPPING = "Stopping" + STOPPED = "Stopped" + FAILED = "Failed" + NOT_STARTED = "NotStarted" + +@dataclass(kw_only=True) +class KbInferenceConfig(_SerdeShape): + """ + Contains configuration details of the inference for knowledge base + retrieval and response generation. + """ + + text_inference_config: TextInferenceConfig | None = ... + """ + Contains configuration details for text generation using a language + model via the `RetrieveAndGenerate` function. + """ + +@dataclass +class KnowledgeBaseConfigRetrieveConfig(_SerdeShape): + """ + Contains configuration details for retrieving information from a + knowledge base. + """ + + value: RetrieveConfig + +@dataclass +class KnowledgeBaseConfigRetrieveAndGenerateConfig(_SerdeShape): + """ + Contains configuration details for retrieving information from a + knowledge base and generating responses. + """ + + value: RetrieveAndGenerateConfiguration + +@dataclass +class KnowledgeBaseConfigUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +KnowledgeBaseConfig = Union[ + KnowledgeBaseConfigRetrieveConfig + | KnowledgeBaseConfigRetrieveAndGenerateConfig + | KnowledgeBaseConfigUnknown +] +""" +The configuration details for retrieving information from a knowledge +base and generating responses. +""" + +class _KnowledgeBaseConfigDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> KnowledgeBaseConfig: ... + +@dataclass(kw_only=True) +class KnowledgeBaseRetrievalConfiguration(_SerdeShape): + """ + Contains configuration details for retrieving information from a + knowledge base. + """ + + vector_search_configuration: KnowledgeBaseVectorSearchConfiguration + """ + Contains configuration details for returning the results from the vector + search. + """ + +@dataclass(kw_only=True) +class KnowledgeBaseRetrieveAndGenerateConfiguration(_SerdeShape): + """ + Contains configuration details for retrieving information from a + knowledge base and generating responses. + """ + + knowledge_base_id: str + """The unique identifier of the knowledge base.""" + model_arn: str + """ + The Amazon Resource Name (ARN) of the foundation model or [inference + profile](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html) + used to generate responses. + """ + retrieval_configuration: KnowledgeBaseRetrievalConfiguration | None = ... + """Contains configuration details for retrieving text chunks.""" + generation_configuration: GenerationConfiguration | None = ... + """ + Contains configurations details for response generation based on + retrieved text chunks. + """ + orchestration_configuration: OrchestrationConfiguration | None = ... + """ + Contains configuration details for the model to process the prompt prior + to retrieval and response generation. + """ + +@dataclass(kw_only=True) +class KnowledgeBaseVectorSearchConfiguration(_SerdeShape): + """ + The configuration details for returning the results from the knowledge + base vector search. + """ + + number_of_results: int | None = ... + """The number of text chunks to retrieve; the number of results to return.""" + override_search_type: str | None = ... + """ + By default, Amazon Bedrock decides a search strategy for you. If you're + using an Amazon OpenSearch Serverless vector store that contains a + filterable text field, you can specify whether to query the knowledge + base with a `HYBRID` search using both vector embeddings and raw text, + or `SEMANTIC` search using only vector embeddings. For other vector + store configurations, only `SEMANTIC` search is available. + """ + filter: RetrievalFilter | None = ... + """ + Specifies the filters to use on the metadata fields in the knowledge + base data sources before returning results. + """ + implicit_filter_configuration: ImplicitFilterConfiguration | None = ... + """ + Configuration for implicit filtering in Knowledge Base vector searches. + This allows the system to automatically apply filters based on the query + context without requiring explicit filter expressions. + """ + reranking_configuration: VectorSearchRerankingConfiguration | None = ... + """ + Configuration for reranking search results in Knowledge Base vector + searches. Reranking improves search relevance by reordering initial + vector search results using more sophisticated relevance models. + """ + +@dataclass(kw_only=True) +class LambdaGraderConfig(_SerdeShape): + """ + Configuration for using an AWS Lambda function to grade model responses + during reinforcement fine-tuning training. + """ + + lambda_arn: str + """ + ARN of the AWS Lambda function that will evaluate model responses and + return reward scores for RFT training. + """ + +@dataclass(kw_only=True) +class LegalTerm(_SerdeShape): + """The legal term of the agreement.""" + + url: str | None = ... + """URL to the legal term document.""" + +@dataclass(kw_only=True) +class ListAdvancedPromptOptimizationJobsInput(_SerdeShape): + """List Advanced Prompt Optimization Jobs Request""" + + max_results: int | None = ... + """The maximum number of results to return in the response.""" + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, use this token in a subsequent request to get + the next set of results. + """ + sort_by: str | None = ... + """The field to sort the results by.""" + sort_order: str | None = ... + """The sort order for the results.""" + +@dataclass(kw_only=True) +class ListAdvancedPromptOptimizationJobsOutput(_SerdeShape): + """List Advanced Prompt Optimization Jobs Response""" + + job_summaries: list[AdvancedPromptOptimizationJobSummary] | None = ... + """A list of advanced prompt optimization job summaries.""" + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, use this token in a subsequent request to get + the next set of results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListAutomatedReasoningPoliciesInput(_SerdeShape): + """Dataclass for ListAutomatedReasoningPoliciesInput structure.""" + + policy_arn: str | None = ... + """ + Optional filter to list only the policy versions with the specified + Amazon Resource Name (ARN). If not provided, the DRAFT versions for all + policies are listed. + """ + next_token: str | None = ... + """ + The pagination token from a previous request to retrieve the next page + of results. + """ + max_results: int = ... + """The maximum number of policies to return in a single call.""" + +@dataclass(kw_only=True) +class ListAutomatedReasoningPoliciesOutput(_SerdeShape): + """Dataclass for ListAutomatedReasoningPoliciesOutput structure.""" + + automated_reasoning_policy_summaries: list[AutomatedReasoningPolicySummary] + """A list of Automated Reasoning policy summaries.""" + next_token: str | None = ... + """ + The pagination token to use in a subsequent request to retrieve the next + page of results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListAutomatedReasoningPolicyBuildWorkflowsInput(_SerdeShape): + """Dataclass for ListAutomatedReasoningPolicyBuildWorkflowsInput structure.""" + + policy_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the Automated Reasoning policy whose + build workflows you want to list. + """ + next_token: str | None = ... + """ + A pagination token from a previous request to continue listing build + workflows from where the previous request left off. + """ + max_results: int = ... + """ + The maximum number of build workflows to return in a single response. + Valid range is 1-100. + """ + +@dataclass(kw_only=True) +class ListAutomatedReasoningPolicyBuildWorkflowsOutput(_SerdeShape): + """ + Dataclass for ListAutomatedReasoningPolicyBuildWorkflowsOutput + structure. + """ + + automated_reasoning_policy_build_workflow_summaries: list[ + AutomatedReasoningPolicyBuildWorkflowSummary + ] + """ + A list of build workflow summaries, each containing key information + about a build workflow including its status and timestamps. + """ + next_token: str | None = ... + """ + A pagination token to use in subsequent requests to retrieve additional + build workflows. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListAutomatedReasoningPolicyTestCasesInput(_SerdeShape): + """Dataclass for ListAutomatedReasoningPolicyTestCasesInput structure.""" + + policy_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the Automated Reasoning policy for + which to list tests. + """ + next_token: str | None = ... + """ + The pagination token from a previous request to retrieve the next page + of results. + """ + max_results: int = ... + """The maximum number of tests to return in a single call.""" + +@dataclass(kw_only=True) +class ListAutomatedReasoningPolicyTestCasesOutput(_SerdeShape): + """Dataclass for ListAutomatedReasoningPolicyTestCasesOutput structure.""" + + test_cases: list[AutomatedReasoningPolicyTestCase] + """A list of tests for the specified policy.""" + next_token: str | None = ... + """ + The pagination token to use in a subsequent request to retrieve the next + page of results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListAutomatedReasoningPolicyTestResultsInput(_SerdeShape): + """Dataclass for ListAutomatedReasoningPolicyTestResultsInput structure.""" + + policy_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the Automated Reasoning policy whose + test results you want to list. + """ + build_workflow_id: str | None = ... + """ + The unique identifier of the build workflow whose test results you want + to list. + """ + next_token: str | None = ... + """ + A pagination token from a previous request to continue listing test + results from where the previous request left off. + """ + max_results: int = ... + """ + The maximum number of test results to return in a single response. Valid + range is 1-100. + """ + +@dataclass(kw_only=True) +class ListAutomatedReasoningPolicyTestResultsOutput(_SerdeShape): + """Dataclass for ListAutomatedReasoningPolicyTestResultsOutput structure.""" + + test_results: list[AutomatedReasoningPolicyTestResult] + """ + A list of test results, each containing information about how the policy + performed on specific test scenarios. + """ + next_token: str | None = ... + """ + A pagination token to use in subsequent requests to retrieve additional + test results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListCustomModelDeploymentsInput(_SerdeShape): + """Dataclass for ListCustomModelDeploymentsInput structure.""" + + created_before: datetime | None = ... + """Filters deployments created before the specified date and time.""" + created_after: datetime | None = ... + """Filters deployments created after the specified date and time.""" + name_contains: str | None = ... + """Filters deployments whose names contain the specified string.""" + max_results: int | None = ... + """The maximum number of results to return in a single call.""" + next_token: str | None = ... + """ + The token for the next set of results. Use this token to retrieve + additional results when the response is truncated. + """ + sort_by: str | None = ... + """ + The field to sort the results by. The only supported value is + `CreationTime`. + """ + sort_order: str | None = ... + """ + The sort order for the results. Valid values are `Ascending` and + `Descending`. Default is `Descending`. + """ + status_equals: str | None = ... + """ + Filters deployments by status. Valid values are `CREATING`, `ACTIVE`, + and `FAILED`. + """ + model_arn_equals: str | None = ... + """ + Filters deployments by the Amazon Resource Name (ARN) of the associated + custom model. + """ + +@dataclass(kw_only=True) +class ListCustomModelDeploymentsOutput(_SerdeShape): + """Dataclass for ListCustomModelDeploymentsOutput structure.""" + + next_token: str | None = ... + """ + The token for the next set of results. This value is null when there are + no more results to return. + """ + model_deployment_summaries: list[CustomModelDeploymentSummary] | None = ... + """A list of custom model deployment summaries.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListCustomModelsInput(_SerdeShape): + """Dataclass for ListCustomModelsInput structure.""" + + creation_time_before: datetime | None = ... + """Return custom models created before the specified time.""" + creation_time_after: datetime | None = ... + """Return custom models created after the specified time.""" + name_contains: str | None = ... + """Return custom models only if the job name contains these characters.""" + base_model_arn_equals: str | None = ... + """ + Return custom models only if the base model Amazon Resource Name (ARN) + matches this parameter. + """ + foundation_model_arn_equals: str | None = ... + """ + Return custom models only if the foundation model Amazon Resource Name + (ARN) matches this parameter. + """ + max_results: int | None = ... + """ + The maximum number of results to return in the response. If the total + number of results is greater than this value, use the token returned in + the response in the `nextToken` field when making another request to + return the next batch of results. + """ + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, enter the token returned in the `nextToken` + field in the response in this field to return the next batch of results. + """ + sort_by: str | None = ... + """The field to sort by in the returned list of models.""" + sort_order: str | None = ... + """The sort order of the results.""" + is_owned: bool | None = ... + """ + Return custom models depending on if the current account owns them + (`true`) or if they were shared with the current account (`false`). + """ + model_status: str | None = ... + """ + The status of them model to filter results by. Possible values include: + + - `Creating` - Include only models that are currently being created and + validated. + + - `Active` - Include only models that have been successfully created and + are ready for use. + + - `Failed` - Include only models where the creation process failed. + + If you don't specify a status, the API returns models in all states. + """ + +@dataclass(kw_only=True) +class ListCustomModelsOutput(_SerdeShape): + """Dataclass for ListCustomModelsOutput structure.""" + + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, use this token when making another request in + the `nextToken` field to return the next batch of results. + """ + model_summaries: list[CustomModelSummary] | None = ... + """Model summaries.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListEnforcedGuardrailsConfigurationInput(_SerdeShape): + """Dataclass for ListEnforcedGuardrailsConfigurationInput structure.""" + + next_token: str | None = ... + """Opaque continuation token of previous paginated response.""" + +@dataclass(kw_only=True) +class ListEnforcedGuardrailsConfigurationOutput(_SerdeShape): + """Dataclass for ListEnforcedGuardrailsConfigurationOutput structure.""" + + guardrails_config: list[AccountEnforcedGuardrailOutputConfiguration] + """Array of AccountEnforcedGuardrailOutputConfiguration objects.""" + next_token: str | None = ... + """Opaque continuation token of previous paginated response.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListEvaluationJobsInput(_SerdeShape): + """Dataclass for ListEvaluationJobsInput structure.""" + + creation_time_after: datetime | None = ... + """A filter to only list evaluation jobs created after a specified time.""" + creation_time_before: datetime | None = ... + """A filter to only list evaluation jobs created before a specified time.""" + status_equals: str | None = ... + """A filter to only list evaluation jobs that are of a certain status.""" + application_type_equals: str | None = ... + """ + A filter to only list evaluation jobs that are either model evaluations + or knowledge base evaluations. + """ + name_contains: str | None = ... + """ + A filter to only list evaluation jobs that contain a specified string in + the job name. + """ + max_results: int | None = ... + """The maximum number of results to return.""" + next_token: str | None = ... + """ + Continuation token from the previous response, for Amazon Bedrock to + list the next set of results. + """ + sort_by: str | None = ... + """ + Specifies a creation time to sort the list of evaluation jobs by when + they were created. + """ + sort_order: str | None = ... + """ + Specifies whether to sort the list of evaluation jobs by either + ascending or descending order. + """ + +@dataclass(kw_only=True) +class ListEvaluationJobsOutput(_SerdeShape): + """Dataclass for ListEvaluationJobsOutput structure.""" + + next_token: str | None = ... + """ + Continuation token from the previous response, for Amazon Bedrock to + list the next set of results. + """ + job_summaries: list[EvaluationSummary] | None = ... + """A list of summaries of the evaluation jobs.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListFoundationModelAgreementOffersInput(_SerdeShape): + """Dataclass for ListFoundationModelAgreementOffersInput structure.""" + + model_id: str | None = ... + """Model Id of the foundation model.""" + offer_type: str | None = ... + """Type of offer associated with the model.""" + +@dataclass(kw_only=True) +class ListFoundationModelAgreementOffersOutput(_SerdeShape): + """Dataclass for ListFoundationModelAgreementOffersOutput structure.""" + + model_id: str + """Model Id of the foundation model.""" + offers: list[Offer] + """List of the offers associated with the specified model.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListFoundationModelsInput(_SerdeShape): + """Dataclass for ListFoundationModelsInput structure.""" + + by_provider: str | None = ... + """Return models belonging to the model provider that you specify.""" + by_customization_type: str | None = ... + """ + Return models that support the customization type that you specify. For + more information, see [Custom + models](https://docs.aws.amazon.com/bedrock/latest/userguide/custom-models.html) + in the [Amazon Bedrock User + Guide](https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html). + """ + by_output_modality: str | None = ... + """Return models that support the output modality that you specify.""" + by_inference_type: str | None = ... + """ + Return models that support the inference type that you specify. For more + information, see [Provisioned + Throughput](https://docs.aws.amazon.com/bedrock/latest/userguide/prov-throughput.html) + in the [Amazon Bedrock User + Guide](https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html). + """ + +@dataclass(kw_only=True) +class ListFoundationModelsOutput(_SerdeShape): + """Dataclass for ListFoundationModelsOutput structure.""" + + model_summaries: list[FoundationModelSummary] | None = ... + """A list of Amazon Bedrock foundation models.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListGuardrailsInput(_SerdeShape): + """Dataclass for ListGuardrailsInput structure.""" + + guardrail_identifier: str | None = ... + """The unique identifier of the guardrail. This can be an ID or the ARN.""" + max_results: int | None = ... + """The maximum number of results to return in the response.""" + next_token: str | None = ... + """ + If there are more results than were returned in the response, the + response returns a `nextToken` that you can send in another + `ListGuardrails` request to see the next batch of results. + """ + +@dataclass(kw_only=True) +class ListGuardrailsOutput(_SerdeShape): + """Dataclass for ListGuardrailsOutput structure.""" + + guardrails: list[GuardrailSummary] + """A list of objects, each of which contains details about a guardrail.""" + next_token: str | None = ... + """ + If there are more results than were returned in the response, the + response returns a `nextToken` that you can send in another + `ListGuardrails` request to see the next batch of results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListImportedModelsInput(_SerdeShape): + """Dataclass for ListImportedModelsInput structure.""" + + creation_time_before: datetime | None = ... + """Return imported models that created before the specified time.""" + creation_time_after: datetime | None = ... + """Return imported models that were created after the specified time.""" + name_contains: str | None = ... + """Return imported models only if the model name contains these characters.""" + max_results: int | None = ... + """ + The maximum number of results to return in the response. If the total + number of results is greater than this value, use the token returned in + the response in the `nextToken` field when making another request to + return the next batch of results. + """ + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, enter the token returned in the `nextToken` + field in the response in this field to return the next batch of results. + """ + sort_by: str | None = ... + """The field to sort by in the returned list of imported models.""" + sort_order: str | None = ... + """Specifies whetehr to sort the results in ascending or descending order.""" + +@dataclass(kw_only=True) +class ListImportedModelsOutput(_SerdeShape): + """Dataclass for ListImportedModelsOutput structure.""" + + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, use this token when making another request in + the `nextToken` field to return the next batch of results. + """ + model_summaries: list[ImportedModelSummary] | None = ... + """Model summaries.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListInferenceProfilesInput(_SerdeShape): + """Dataclass for ListInferenceProfilesInput structure.""" + + max_results: int | None = ... + """ + The maximum number of results to return in the response. If the total + number of results is greater than this value, use the token returned in + the response in the `nextToken` field when making another request to + return the next batch of results. + """ + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, enter the token returned in the `nextToken` + field in the response in this field to return the next batch of results. + """ + type_equals: str | None = ... + """ + Filters for inference profiles that match the type you specify. + + - `SYSTEM_DEFINED` -- The inference profile is defined by Amazon + Bedrock. You can route inference requests across regions with these + inference profiles. + + - `APPLICATION` -- The inference profile was created by a user. This + type of inference profile can track metrics and costs when invoking + the model in it. The inference profile may route requests to one or + multiple regions. + """ + +@dataclass(kw_only=True) +class ListInferenceProfilesOutput(_SerdeShape): + """Dataclass for ListInferenceProfilesOutput structure.""" + + inference_profile_summaries: list[InferenceProfileSummary] | None = ... + """A list of information about each inference profile that you can use.""" + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, use this token when making another request in + the `nextToken` field to return the next batch of results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListMarketplaceModelEndpointsInput(_SerdeShape): + """Dataclass for ListMarketplaceModelEndpointsInput structure.""" + + max_results: int | None = ... + """ + The maximum number of results to return in a single call. If more + results are available, the operation returns a `NextToken` value. + """ + next_token: str | None = ... + """ + The token for the next set of results. You receive this token from a + previous `ListMarketplaceModelEndpoints` call. + """ + model_source_equals: str | None = ... + """ + If specified, only endpoints for the given model source identifier are + returned. + """ + +@dataclass(kw_only=True) +class ListMarketplaceModelEndpointsOutput(_SerdeShape): + """Dataclass for ListMarketplaceModelEndpointsOutput structure.""" + + marketplace_model_endpoints: list[MarketplaceModelEndpointSummary] | None = ... + """An array of endpoint summaries.""" + next_token: str | None = ... + """ + The token for the next set of results. Use this token to get the next + set of results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListModelCopyJobsInput(_SerdeShape): + """Dataclass for ListModelCopyJobsInput structure.""" + + creation_time_after: datetime | None = ... + """Filters for model copy jobs created after the specified time.""" + creation_time_before: datetime | None = ... + """Filters for model copy jobs created before the specified time.""" + status_equals: str | None = ... + """ + Filters for model copy jobs whose status matches the value that you + specify. + """ + source_account_equals: str | None = ... + """ + Filters for model copy jobs in which the account that the source model + belongs to is equal to the value that you specify. + """ + source_model_arn_equals: str | None = ... + """ + Filters for model copy jobs in which the Amazon Resource Name (ARN) of + the source model to is equal to the value that you specify. + """ + target_model_name_contains: str | None = ... + """ + Filters for model copy jobs in which the name of the copied model + contains the string that you specify. + """ + max_results: int | None = ... + """ + The maximum number of results to return in the response. If the total + number of results is greater than this value, use the token returned in + the response in the `nextToken` field when making another request to + return the next batch of results. + """ + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, enter the token returned in the `nextToken` + field in the response in this field to return the next batch of results. + """ + sort_by: str | None = ... + """The field to sort by in the returned list of model copy jobs.""" + sort_order: str | None = ... + """Specifies whether to sort the results in ascending or descending order.""" + +@dataclass(kw_only=True) +class ListModelCopyJobsOutput(_SerdeShape): + """Dataclass for ListModelCopyJobsOutput structure.""" + + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, use this token when making another request in + the `nextToken` field to return the next batch of results. + """ + model_copy_job_summaries: list[ModelCopyJobSummary] | None = ... + """A list of information about each model copy job.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListModelCustomizationJobsInput(_SerdeShape): + """Dataclass for ListModelCustomizationJobsInput structure.""" + + creation_time_after: datetime | None = ... + """Return customization jobs created after the specified time.""" + creation_time_before: datetime | None = ... + """Return customization jobs created before the specified time.""" + status_equals: str | None = ... + """Return customization jobs with the specified status.""" + name_contains: str | None = ... + """ + Return customization jobs only if the job name contains these + characters. + """ + max_results: int | None = ... + """ + The maximum number of results to return in the response. If the total + number of results is greater than this value, use the token returned in + the response in the `nextToken` field when making another request to + return the next batch of results. + """ + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, enter the token returned in the `nextToken` + field in the response in this field to return the next batch of results. + """ + sort_by: str | None = ... + """The field to sort by in the returned list of jobs.""" + sort_order: str | None = ... + """The sort order of the results.""" + +@dataclass(kw_only=True) +class ListModelCustomizationJobsOutput(_SerdeShape): + """Dataclass for ListModelCustomizationJobsOutput structure.""" + + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, use this token when making another request in + the `nextToken` field to return the next batch of results. + """ + model_customization_job_summaries: list[ModelCustomizationJobSummary] | None = ... + """Job summaries.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListModelImportJobsInput(_SerdeShape): + """Dataclass for ListModelImportJobsInput structure.""" + + creation_time_after: datetime | None = ... + """Return import jobs that were created after the specified time.""" + creation_time_before: datetime | None = ... + """Return import jobs that were created before the specified time.""" + status_equals: str | None = ... + """Return imported jobs with the specified status.""" + name_contains: str | None = ... + """Return imported jobs only if the job name contains these characters.""" + max_results: int | None = ... + """ + The maximum number of results to return in the response. If the total + number of results is greater than this value, use the token returned in + the response in the `nextToken` field when making another request to + return the next batch of results. + """ + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, enter the token returned in the `nextToken` + field in the response in this field to return the next batch of results. + """ + sort_by: str | None = ... + """The field to sort by in the returned list of imported jobs.""" + sort_order: str | None = ... + """Specifies whether to sort the results in ascending or descending order.""" + +@dataclass(kw_only=True) +class ListModelImportJobsOutput(_SerdeShape): + """Dataclass for ListModelImportJobsOutput structure.""" + + next_token: str | None = ... + """ + If the total number of results is greater than the `maxResults` value + provided in the request, enter the token returned in the `nextToken` + field in the response in this field to return the next batch of results. + """ + model_import_job_summaries: list[ModelImportJobSummary] | None = ... + """Import job summaries.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListModelInvocationJobsInput(_SerdeShape): + """Dataclass for ListModelInvocationJobsInput structure.""" + + submit_time_after: datetime | None = ... + """ + Specify a time to filter for batch inference jobs that were submitted + after the time you specify. + """ + submit_time_before: datetime | None = ... + """ + Specify a time to filter for batch inference jobs that were submitted + before the time you specify. + """ + status_equals: str | None = ... + """ + Specify a status to filter for batch inference jobs whose statuses match + the string you specify. + + The following statuses are possible: + + - Submitted -- This job has been submitted to a queue for validation. + + - Validating -- This job is being validated for the requirements + described in [Format and upload your batch inference + data](https://docs.aws.amazon.com/bedrock/latest/userguide/batch-inference-data.html). + The criteria include the following: + + - Your IAM service role has access to the Amazon S3 buckets containing + your files. + + - Your files are .jsonl files and each individual record is a JSON + object in the correct format. Note that validation doesn't check if + the `modelInput` value matches the request body for the model. + + - Your files fulfill the requirements for file size and number of + records. For more information, see [Quotas for Amazon + Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/quotas.html). + + - Scheduled -- This job has been validated and is now in a queue. The + job will automatically start when it reaches its turn. + + - Expired -- This job timed out because it was scheduled but didn't + begin before the set timeout duration. Submit a new job request. + + - InProgress -- This job has begun. You can start viewing the results in + the output S3 location. + + - Completed -- This job has successfully completed. View the output + files in the output S3 location. + + - PartiallyCompleted -- This job has partially completed. Not all of + your records could be processed in time. View the output files in the + output S3 location. + + - Failed -- This job has failed. Check the failure message for any + further details. For further assistance, reach out to the [Amazon Web + Services Support + Center](https://console.aws.amazon.com/support/home/). + + - Stopped -- This job was stopped by a user. + + - Stopping -- This job is being stopped by a user. + """ + name_contains: str | None = ... + """ + Specify a string to filter for batch inference jobs whose names contain + the string. + """ + max_results: int | None = ... + """ + The maximum number of results to return. If there are more results than + the number that you specify, a `nextToken` value is returned. Use the + `nextToken` in a request to return the next batch of results. + """ + next_token: str | None = ... + """ + If there were more results than the value you specified in the + `maxResults` field in a previous `ListModelInvocationJobs` request, the + response would have returned a `nextToken` value. To see the next batch + of results, send the `nextToken` value in another request. + """ + sort_by: str | None = ... + """An attribute by which to sort the results.""" + sort_order: str | None = ... + """Specifies whether to sort the results by ascending or descending order.""" + +@dataclass(kw_only=True) +class ListModelInvocationJobsOutput(_SerdeShape): + """Dataclass for ListModelInvocationJobsOutput structure.""" + + next_token: str | None = ... + """ + If there are more results than can fit in the response, a `nextToken` is + returned. Use the `nextToken` in a request to return the next batch of + results. + """ + invocation_job_summaries: list[ModelInvocationJobSummary] | None = ... + """ + A list of items, each of which contains a summary about a batch + inference job. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListPromptRoutersInput(_SerdeShape): + """Dataclass for ListPromptRoutersInput structure.""" + + max_results: int | None = ... + """The maximum number of prompt routers to return in one page of results.""" + next_token: str | None = ... + """ + Specify the pagination token from a previous request to retrieve the + next page of results. + """ + type: str = ... + """The type of the prompt routers, such as whether it's default or custom.""" + +@dataclass(kw_only=True) +class ListPromptRoutersOutput(_SerdeShape): + """Dataclass for ListPromptRoutersOutput structure.""" + + prompt_router_summaries: list[PromptRouterSummary] | None = ... + """A list of prompt router summaries.""" + next_token: str | None = ... + """ + Specify the pagination token from a previous request to retrieve the + next page of results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListProvisionedModelThroughputsInput(_SerdeShape): + """Dataclass for ListProvisionedModelThroughputsInput structure.""" + + creation_time_after: datetime | None = ... + """ + A filter that returns Provisioned Throughputs created after the + specified time. + """ + creation_time_before: datetime | None = ... + """ + A filter that returns Provisioned Throughputs created before the + specified time. + """ + status_equals: str | None = ... + """ + A filter that returns Provisioned Throughputs if their statuses matches + the value that you specify. + """ + model_arn_equals: str | None = ... + """ + A filter that returns Provisioned Throughputs whose model Amazon + Resource Name (ARN) is equal to the value that you specify. + """ + name_contains: str | None = ... + """ + A filter that returns Provisioned Throughputs if their name contains the + expression that you specify. + """ + max_results: int | None = ... + """ + THe maximum number of results to return in the response. If there are + more results than the number you specified, the response returns a + `nextToken` value. To see the next batch of results, send the + `nextToken` value in another list request. + """ + next_token: str | None = ... + """ + If there are more results than the number you specified in the + `maxResults` field, the response returns a `nextToken` value. To see the + next batch of results, specify the `nextToken` value in this field. + """ + sort_by: str | None = ... + """The field by which to sort the returned list of Provisioned Throughputs.""" + sort_order: str | None = ... + """The sort order of the results.""" + +@dataclass(kw_only=True) +class ListProvisionedModelThroughputsOutput(_SerdeShape): + """Dataclass for ListProvisionedModelThroughputsOutput structure.""" + + next_token: str | None = ... + """ + If there are more results than the number you specified in the + `maxResults` field, this value is returned. To see the next batch of + results, include this value in the `nextToken` field in another list + request. + """ + provisioned_model_summaries: list[ProvisionedModelSummary] | None = ... + """ + A list of summaries, one for each Provisioned Throughput in the + response. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListTagsForResourceInput(_SerdeShape): + """Dataclass for ListTagsForResourceInput structure.""" + + resource_arn: str | None = ... + """The Amazon Resource Name (ARN) of the resource.""" + +@dataclass(kw_only=True) +class ListTagsForResourceOutput(_SerdeShape): + """Dataclass for ListTagsForResourceOutput structure.""" + + tags: list[Tag] | None = ... + """An array of the tags associated with this resource.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class LoggingConfig(_SerdeShape): + """Configuration fields for invocation logging.""" + + cloud_watch_config: CloudWatchConfig | None = ... + """CloudWatch logging configuration.""" + s3_config: S3Config | None = ... + """S3 configuration for storing log data.""" + text_data_delivery_enabled: bool | None = ... + """Set to include text data in the log delivery.""" + image_data_delivery_enabled: bool | None = ... + """Set to include image data in the log delivery.""" + embedding_data_delivery_enabled: bool | None = ... + """Set to include embeddings data in the log delivery.""" + video_data_delivery_enabled: bool | None = ... + """Set to include video data in the log delivery.""" + audio_data_delivery_enabled: bool | None = ... + """Set to include audio data in the log delivery.""" + +@dataclass(kw_only=True) +class MarketplaceModelEndpoint(_SerdeShape): + """ + Contains details about an endpoint for a model from Amazon Bedrock + Marketplace. + """ + + endpoint_arn: str + """The Amazon Resource Name (ARN) of the endpoint.""" + model_source_identifier: str + """ + The ARN of the model from Amazon Bedrock Marketplace that is deployed on + this endpoint. + """ + status: str | None = ... + """ + The overall status of the endpoint in Amazon Bedrock Marketplace (e.g., + ACTIVE, INACTIVE). + """ + status_message: str | None = ... + """Additional information about the overall status, if available.""" + created_at: datetime + """The timestamp when the endpoint was registered.""" + updated_at: datetime + """The timestamp when the endpoint was last updated.""" + endpoint_config: EndpointConfig + """ + The configuration of the endpoint, including the number and type of + instances used. + """ + endpoint_status: str + """ + The current status of the endpoint (e.g., Creating, InService, Updating, + Failed). + """ + endpoint_status_message: str | None = ... + """Additional information about the endpoint status, if available.""" + +@dataclass(kw_only=True) +class MarketplaceModelEndpointSummary(_SerdeShape): + """ + Provides a summary of an endpoint for a model from Amazon Bedrock + Marketplace. + """ + + endpoint_arn: str + """The Amazon Resource Name (ARN) of the endpoint.""" + model_source_identifier: str + """ + The ARN of the model from Amazon Bedrock Marketplace that is deployed on + this endpoint. + """ + status: str | None = ... + """The overall status of the endpoint in Amazon Bedrock Marketplace.""" + status_message: str | None = ... + """Additional information about the overall status, if available.""" + created_at: datetime + """The timestamp when the endpoint was created.""" + updated_at: datetime + """The timestamp when the endpoint was last updated.""" + +@dataclass(kw_only=True) +class MetadataAttributeSchema(_SerdeShape): + """ + Defines the schema for a metadata attribute used in Knowledge Base + vector searches. Metadata attributes provide additional context for + documents and can be used for filtering and reranking search results. + """ + + key: str + """ + The unique identifier for the metadata attribute. This key is used to + reference the attribute in filter expressions and reranking + configurations. + """ + type: str + """ + The data type of the metadata attribute. The type determines how the + attribute can be used in filter expressions and reranking. + """ + description: str + """ + An optional description of the metadata attribute that provides + additional context about its purpose and usage. + """ + +@dataclass(kw_only=True) +class MetadataConfigurationForReranking(_SerdeShape): + """ + Configuration for how metadata should be used during the reranking + process in Knowledge Base vector searches. This determines which + metadata fields are included or excluded when reordering search results. + """ + + selection_mode: str + """ + The mode for selecting which metadata fields to include in the reranking + process. Valid values are ALL (use all available metadata fields) or + SELECTIVE (use only specified fields). + """ + selective_mode_configuration: ( + RerankingMetadataSelectiveModeConfiguration | None + ) = ... + """ + Configuration for selective mode, which allows you to explicitly include + or exclude specific metadata fields during reranking. This is only used + when selectionMode is set to SELECTIVE. + """ + +@dataclass(kw_only=True) +class ModelConfiguration(_SerdeShape): + """ + Contains the configuration for a model used in an advanced prompt + optimization job, including the model ID and inference parameters. + """ + + model_id: str + """ + The model to use for optimization. The value depends on the resource + that you use: + + - If you use a base model, specify the model ID or its ARN. For a list + of model IDs, see [Models at a + glance](https://docs.aws.amazon.com/bedrock/latest/userguide/model-cards.html) + in the Amazon Bedrock User Guide. + + - If you use a cross-Region (system-defined) inference profile, specify + the inference profile ID or its ARN. For a list of inference profile + IDs, see [Supported Regions and models for inference + profiles](https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference-support.html) + in the Amazon Bedrock User Guide. + + - If you use an application inference profile, specify its full ARN, + including the account ID and Region. + """ + inference_config: InferenceConfiguration | None = ... + """ + The inference configuration for the model, including parameters such as + maximum tokens, temperature, and top-p. + """ + additional_model_request_fields: dict[str, Document] | None = ... + """ + Additional model request fields. Use this to pass model-specific + parameters that are not included in the standard inference + configuration. + """ + +class ModelCopyJobStatus(UnknownEnumMixin, StrEnum): + IN_PROGRESS = "InProgress" + COMPLETED = "Completed" + FAILED = "Failed" + +@dataclass(kw_only=True) +class ModelCopyJobSummary(_SerdeShape): + """ + Contains details about each model copy job. + + This data type is used in the following API operations: + + - [ListModelCopyJobs + response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_ListModelCopyJobs.html#API_ListModelCopyJobs_ResponseSyntax) + """ + + job_arn: str + """The Amazon Resoource Name (ARN) of the model copy job.""" + status: str + """The status of the model copy job.""" + creation_time: datetime + """The time that the model copy job was created.""" + target_model_arn: str + """The Amazon Resource Name (ARN) of the copied model.""" + target_model_name: str | None = ... + """The name of the copied model.""" + source_account_id: str + """ + The unique identifier of the account that the model being copied + originated from. + """ + source_model_arn: str + """The Amazon Resource Name (ARN) of the original model being copied.""" + target_model_kms_key_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the KMS key used to encrypt the copied + model. + """ + target_model_tags: list[Tag] | None = ... + """Tags associated with the copied model.""" + failure_message: str | None = ... + """ + If a model fails to be copied, a message describing why the job failed + is included here. + """ + source_model_name: str | None = ... + """The name of the original model being copied.""" + +class ModelCustomization(UnknownEnumMixin, StrEnum): + FINE_TUNING = "FINE_TUNING" + CONTINUED_PRE_TRAINING = "CONTINUED_PRE_TRAINING" + DISTILLATION = "DISTILLATION" + +class ModelCustomizationJobStatus(UnknownEnumMixin, StrEnum): + IN_PROGRESS = "InProgress" + COMPLETED = "Completed" + FAILED = "Failed" + STOPPING = "Stopping" + STOPPED = "Stopped" + +@dataclass(kw_only=True) +class ModelCustomizationJobSummary(_SerdeShape): + """Information about one customization job""" + + job_arn: str + """Amazon Resource Name (ARN) of the customization job.""" + base_model_arn: str + """Amazon Resource Name (ARN) of the base model.""" + job_name: str + """Name of the customization job.""" + status: str + """Status of the customization job.""" + status_details: StatusDetails | None = ... + """Details about the status of the data processing sub-task of the job.""" + last_modified_time: datetime | None = ... + """Time that the customization job was last modified.""" + creation_time: datetime + """Creation time of the custom model.""" + end_time: datetime | None = ... + """Time that the customization job ended.""" + custom_model_arn: str | None = ... + """Amazon Resource Name (ARN) of the custom model.""" + custom_model_name: str | None = ... + """Name of the custom model.""" + customization_type: str | None = ... + """ + Specifies whether to carry out continued pre-training of a model or + whether to fine-tune it. For more information, see [Custom + models](https://docs.aws.amazon.com/bedrock/latest/userguide/custom-models.html). + """ + +@dataclass +class ModelDataSourceS3DataSource(_SerdeShape): + """The Amazon S3 data source of the model to import.""" + + value: S3DataSource + +@dataclass +class ModelDataSourceUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ModelDataSource = Union[ModelDataSourceS3DataSource | ModelDataSourceUnknown] +"""The data source of the model to import.""" + +class _ModelDataSourceDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> ModelDataSource: ... + +@dataclass(kw_only=True) +class ModelEnforcement(_SerdeShape): + """Model-specific information for the enforced guardrail configuration.""" + + included_models: list[str] + """Models to enforce the guardrail on.""" + excluded_models: list[str] + """Models to exclude from enforcement of the guardrail.""" + +class ModelImportJobStatus(UnknownEnumMixin, StrEnum): + IN_PROGRESS = "InProgress" + COMPLETED = "Completed" + FAILED = "Failed" + +@dataclass(kw_only=True) +class ModelImportJobSummary(_SerdeShape): + """Information about the import job.""" + + job_arn: str + """The Amazon Resource Name (ARN) of the import job.""" + job_name: str + """The name of the import job.""" + status: str + """The status of the imported job.""" + last_modified_time: datetime | None = ... + """The time when the import job was last modified.""" + creation_time: datetime + """The time import job was created.""" + end_time: datetime | None = ... + """The time when import job ended.""" + imported_model_arn: str | None = ... + """The Amazon resource Name (ARN) of the imported model.""" + imported_model_name: str | None = ... + """The name of the imported model.""" + +@dataclass +class ModelInvocationJobInputDataConfigS3InputDataConfig(_SerdeShape): + """Contains the configuration of the S3 location of the input data.""" + + value: ModelInvocationJobS3InputDataConfig + +@dataclass +class ModelInvocationJobInputDataConfigUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ModelInvocationJobInputDataConfig = Union[ + ModelInvocationJobInputDataConfigS3InputDataConfig + | ModelInvocationJobInputDataConfigUnknown +] +"""Details about the location of the input to the batch inference job.""" + +class _ModelInvocationJobInputDataConfigDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> ModelInvocationJobInputDataConfig: ... + +@dataclass +class ModelInvocationJobOutputDataConfigS3OutputDataConfig(_SerdeShape): + """Contains the configuration of the S3 location of the output data.""" + + value: ModelInvocationJobS3OutputDataConfig + +@dataclass +class ModelInvocationJobOutputDataConfigUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ModelInvocationJobOutputDataConfig = Union[ + ModelInvocationJobOutputDataConfigS3OutputDataConfig + | ModelInvocationJobOutputDataConfigUnknown +] +"""Contains the configuration of the S3 location of the output data.""" + +class _ModelInvocationJobOutputDataConfigDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> ModelInvocationJobOutputDataConfig: ... + +@dataclass(kw_only=True) +class ModelInvocationJobS3InputDataConfig(_SerdeShape): + """Contains the configuration of the S3 location of the input data.""" + + s3_input_format: str | None = ... + """The format of the input data.""" + s3_uri: str + """The S3 location of the input data.""" + s3_bucket_owner: str | None = ... + """ + The ID of the Amazon Web Services account that owns the S3 bucket + containing the input data. + """ + +@dataclass(kw_only=True) +class ModelInvocationJobS3OutputDataConfig(_SerdeShape): + """Contains the configuration of the S3 location of the output data.""" + + s3_uri: str + """The S3 location of the output data.""" + s3_encryption_key_id: str | None = ... + """ + The unique identifier of the key that encrypts the S3 location of the + output data. + """ + s3_bucket_owner: str | None = ... + """ + The ID of the Amazon Web Services account that owns the S3 bucket + containing the output data. + """ + +class ModelInvocationJobStatus(UnknownEnumMixin, StrEnum): + SUBMITTED = "Submitted" + IN_PROGRESS = "InProgress" + COMPLETED = "Completed" + FAILED = "Failed" + STOPPING = "Stopping" + STOPPED = "Stopped" + PARTIALLY_COMPLETED = "PartiallyCompleted" + EXPIRED = "Expired" + VALIDATING = "Validating" + SCHEDULED = "Scheduled" + +@dataclass(kw_only=True) +class ModelInvocationJobSummary(_SerdeShape): + """A summary of a batch inference job.""" + + job_arn: str + """The Amazon Resource Name (ARN) of the batch inference job.""" + job_name: str + """The name of the batch inference job.""" + model_id: str + """The unique identifier of the foundation model used for model inference.""" + client_request_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the API request + completes no more than one time. If this token matches a previous + request, Amazon Bedrock ignores the request, but does not return an + error. For more information, see [Ensuring + idempotency](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + """ + role_arn: str + """ + The Amazon Resource Name (ARN) of the service role with permissions to + carry out and manage batch inference. You can use the console to create + a default service role or follow the steps at [Create a service role for + batch + inference](https://docs.aws.amazon.com/bedrock/latest/userguide/batch-iam-sr.html). + """ + status: str | None = ... + """ + The status of the batch inference job. + + The following statuses are possible: + + - Submitted -- This job has been submitted to a queue for validation. + + - Validating -- This job is being validated for the requirements + described in [Format and upload your batch inference + data](https://docs.aws.amazon.com/bedrock/latest/userguide/batch-inference-data.html). + The criteria include the following: + + - Your IAM service role has access to the Amazon S3 buckets containing + your files. + + - Your files are .jsonl files and each individual record is a JSON + object in the correct format. Note that validation doesn't check if + the `modelInput` value matches the request body for the model. + + - Your files fulfill the requirements for file size and number of + records. For more information, see [Quotas for Amazon + Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/quotas.html). + + - Scheduled -- This job has been validated and is now in a queue. The + job will automatically start when it reaches its turn. + + - Expired -- This job timed out because it was scheduled but didn't + begin before the set timeout duration. Submit a new job request. + + - InProgress -- This job has begun. You can start viewing the results in + the output S3 location. + + - Completed -- This job has successfully completed. View the output + files in the output S3 location. + + - PartiallyCompleted -- This job has partially completed. Not all of + your records could be processed in time. View the output files in the + output S3 location. + + - Failed -- This job has failed. Check the failure message for any + further details. For further assistance, reach out to the [Amazon Web + Services Support + Center](https://console.aws.amazon.com/support/home/). + + - Stopped -- This job was stopped by a user. + + - Stopping -- This job is being stopped by a user. + """ + message: str | None = ... + """ + If the batch inference job failed, this field contains a message + describing why the job failed. + """ + submit_time: datetime + """The time at which the batch inference job was submitted.""" + last_modified_time: datetime | None = ... + """The time at which the batch inference job was last modified.""" + end_time: datetime | None = ... + """The time at which the batch inference job ended.""" + input_data_config: ModelInvocationJobInputDataConfig + """Details about the location of the input to the batch inference job.""" + output_data_config: ModelInvocationJobOutputDataConfig + """Details about the location of the output of the batch inference job.""" + vpc_config: VpcConfig | None = ... + """ + The configuration of the Virtual Private Cloud (VPC) for the data in the + batch inference job. For more information, see [Protect batch inference + jobs using a + VPC](https://docs.aws.amazon.com/bedrock/latest/userguide/batch-vpc). + """ + timeout_duration_in_hours: int | None = ... + """ + The number of hours after which the batch inference job was set to time + out. + """ + job_expiration_time: datetime | None = ... + """The time at which the batch inference job times or timed out.""" + model_invocation_type: str | None = ... + """The invocation endpoint for ModelInvocationJob""" + total_record_count: int | None = ... + """The total number of records in the batch inference job.""" + processed_record_count: int | None = ... + """ + The number of records that have been processed in the batch inference + job. + """ + success_record_count: int | None = ... + """ + The number of records that were successfully processed in the batch + inference job. + """ + error_record_count: int | None = ... + """The number of records that failed to process in the batch inference job.""" + +class ModelInvocationType(UnknownEnumMixin, StrEnum): + INVOKE_MODEL = "InvokeModel" + CONVERSE = "Converse" + +class ModelModality(UnknownEnumMixin, StrEnum): + TEXT = "TEXT" + IMAGE = "IMAGE" + EMBEDDING = "EMBEDDING" + +@dataclass(kw_only=True) +class ModelPackageArnDataSource(_SerdeShape): + """ + Contains the Amazon Resource Name (ARN) of a SageMaker AI model package + to use as the data source for a custom model. + """ + + model_package_arn: str + """ + The Amazon Resource Name (ARN) of the SageMaker AI model package. The + ARN must be for a model package of `restricted` type. + + To use a model package ARN, you must have the + `sagemaker:DescribeModelPackage` and `sagemaker:AccessModelPackageData` + permissions on the model package resource. + """ + +class ModelStatus(UnknownEnumMixin, StrEnum): + ACTIVE = "Active" + CREATING = "Creating" + FAILED = "Failed" + +@dataclass(kw_only=True) +class Offer(_SerdeShape): + """An offer dictates usage terms for the model.""" + + offer_id: str | None = ... + """Offer Id for a model offer.""" + offer_token: str + """Offer token.""" + term_details: TermDetails + """Details about the terms of the offer.""" + +class OfferType(UnknownEnumMixin, StrEnum): + ALL = "ALL" + PUBLIC = "PUBLIC" + +@dataclass(kw_only=True) +class OrchestrationConfiguration(_SerdeShape): + """ + The configuration details for the model to process the prompt prior to + retrieval and response generation. + """ + + query_transformation_configuration: QueryTransformationConfiguration + """Contains configuration details for transforming the prompt.""" + +@dataclass(kw_only=True) +class OutputDataConfig(_SerdeShape): + """S3 Location of the output data.""" + + s3_uri: str + """The S3 URI where the output data is stored.""" + +class PerformanceConfigLatency(UnknownEnumMixin, StrEnum): + STANDARD = "standard" + OPTIMIZED = "optimized" + +@dataclass(kw_only=True) +class PerformanceConfiguration(_SerdeShape): + """Contains performance settings for a model.""" + + latency: str | None = ... + """ + Specifies whether to use the latency-optimized or standard version of a + model or inference profile. + """ + +@dataclass(kw_only=True) +class PricingTerm(_SerdeShape): + """Describes the usage-based pricing term.""" + + rate_card: list[DimensionalPriceRate] + """Describes a usage price for each dimension.""" + +class PromptRouterStatus(UnknownEnumMixin, StrEnum): + AVAILABLE = "AVAILABLE" + +@dataclass(kw_only=True) +class PromptRouterSummary(_SerdeShape): + """Details about a prompt router.""" + + prompt_router_name: str + """The router's name.""" + routing_criteria: RoutingCriteria + """The router's routing criteria.""" + description: str | None = ... + """The router's description.""" + created_at: datetime | None = ... + """When the router was created.""" + updated_at: datetime | None = ... + """When the router was updated.""" + prompt_router_arn: str + """The router's ARN.""" + models: list[PromptRouterTargetModel] + """The router's models.""" + fallback_model: PromptRouterTargetModel + """The router's fallback model.""" + status: str + """The router's status.""" + type: str + """The summary's type.""" + +@dataclass(kw_only=True) +class PromptRouterTargetModel(_SerdeShape): + """The target model for a prompt router.""" + + model_arn: str | None = ... + """The target model's ARN.""" + +class PromptRouterType(UnknownEnumMixin, StrEnum): + CUSTOM = "custom" + DEFAULT = "default" + +@dataclass(kw_only=True) +class PromptTemplate(_SerdeShape): + """ + The template for the prompt that's sent to the model for response + generation. + """ + + text_prompt_template: str | None = ... + """ + The template for the prompt that's sent to the model for response + generation. You can include prompt placeholders, which become replaced + before the prompt is sent to the model to provide instructions and + context to the model. In addition, you can include XML tags to delineate + meaningful sections of the prompt template. + + For more information, see [Knowledge base prompt + template](https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html) + and [Use XML tags with Anthropic Claude + models](https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/use-xml-tags). + """ + +class ProvisionedModelStatus(UnknownEnumMixin, StrEnum): + CREATING = "Creating" + IN_SERVICE = "InService" + UPDATING = "Updating" + FAILED = "Failed" + +@dataclass(kw_only=True) +class ProvisionedModelSummary(_SerdeShape): + """ + A summary of information about a Provisioned Throughput. + + This data type is used in the following API operations: + + - [ListProvisionedThroughputs + response](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_ListProvisionedModelThroughputs.html#API_ListProvisionedModelThroughputs_ResponseSyntax) + """ + + provisioned_model_name: str + """The name of the Provisioned Throughput.""" + provisioned_model_arn: str + """The Amazon Resource Name (ARN) of the Provisioned Throughput.""" + model_arn: str + """ + The Amazon Resource Name (ARN) of the model associated with the + Provisioned Throughput. + """ + desired_model_arn: str + """ + The Amazon Resource Name (ARN) of the model requested to be associated + to this Provisioned Throughput. This value differs from the `modelArn` + if updating hasn't completed. + """ + foundation_model_arn: str + """ + The Amazon Resource Name (ARN) of the base model for which the + Provisioned Throughput was created, or of the base model that the custom + model for which the Provisioned Throughput was created was customized. + """ + model_units: int + """The number of model units allocated to the Provisioned Throughput.""" + desired_model_units: int + """ + The number of model units that was requested to be allocated to the + Provisioned Throughput. + """ + status: str + """The status of the Provisioned Throughput.""" + commitment_duration: str | None = ... + """The duration for which the Provisioned Throughput was committed.""" + commitment_expiration_time: datetime | None = ... + """ + The timestamp for when the commitment term of the Provisioned Throughput + expires. + """ + creation_time: datetime + """The time that the Provisioned Throughput was created.""" + last_modified_time: datetime + """The time that the Provisioned Throughput was last modified.""" + +@dataclass(kw_only=True) +class PutAccountDataRetentionInput(_SerdeShape): + """Dataclass for PutAccountDataRetentionInput structure.""" + + mode: str | None = ... + """The data retention mode to set for the account.""" + +@dataclass(kw_only=True) +class PutAccountDataRetentionOutput(_SerdeShape): + """Dataclass for PutAccountDataRetentionOutput structure.""" + + mode: str + """The data retention mode set for the account.""" + updated_at: datetime | None = ... + """The time at which the data retention mode was last updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class PutEnforcedGuardrailConfigurationInput(_SerdeShape): + """Dataclass for PutEnforcedGuardrailConfigurationInput structure.""" + + config_id: str | None = ... + """Unique ID for the account enforced configuration.""" + guardrail_inference_config: ( + AccountEnforcedGuardrailInferenceInputConfiguration | None + ) = ... + """Account-level enforced guardrail input configuration.""" + +@dataclass(kw_only=True) +class PutEnforcedGuardrailConfigurationOutput(_SerdeShape): + """Dataclass for PutEnforcedGuardrailConfigurationOutput structure.""" + + config_id: str | None = ... + """Unique ID for the account enforced configuration.""" + updated_at: datetime | None = ... + """Timestamp.""" + updated_by: str | None = ... + """The ARN of the role used to update the configuration.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class PutModelInvocationLoggingConfigurationInput(_SerdeShape): + """Dataclass for PutModelInvocationLoggingConfigurationInput structure.""" + + logging_config: LoggingConfig | None = ... + """The logging configuration values to set.""" + +@dataclass(kw_only=True) +class PutModelInvocationLoggingConfigurationOutput(_SerdeShape): + """Dataclass for PutModelInvocationLoggingConfigurationOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class PutResourcePolicyInput(_SerdeShape): + """Dataclass for PutResourcePolicyInput structure.""" + + resource_arn: str | None = ... + """The ARN of the Bedrock resource to which this resource policy applies.""" + resource_policy: str | None = ... + """The JSON string representing the Bedrock resource policy.""" + +@dataclass(kw_only=True) +class PutResourcePolicyOutput(_SerdeShape): + """Dataclass for PutResourcePolicyOutput structure.""" + + resource_arn: str | None = ... + """The ARN of the Bedrock resource to which this resource policy applies.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class PutUseCaseForModelAccessInput(_SerdeShape): + """Dataclass for PutUseCaseForModelAccessInput structure.""" + + form_data: bytes | None = ... + """Put customer profile Request.""" + +@dataclass(kw_only=True) +class PutUseCaseForModelAccessOutput(_SerdeShape): + """Dataclass for PutUseCaseForModelAccessOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class QueryTransformationConfiguration(_SerdeShape): + """The configuration details for transforming the prompt.""" + + type: str + """The type of transformation to apply to the prompt.""" + +class QueryTransformationType(UnknownEnumMixin, StrEnum): + QUERY_DECOMPOSITION = "QUERY_DECOMPOSITION" + +@dataclass +class RAGConfigKnowledgeBaseConfig(_SerdeShape): + """ + Contains configuration details for knowledge base retrieval and response + generation. + """ + + value: KnowledgeBaseConfig + +@dataclass +class RAGConfigPrecomputedRagSourceConfig(_SerdeShape): + """ + Contains configuration details about the RAG source used to generate + inference response data for a Knowledge Base evaluation job. + """ + + value: EvaluationPrecomputedRagSourceConfig + +@dataclass +class RAGConfigUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +RAGConfig = Union[ + RAGConfigKnowledgeBaseConfig + | RAGConfigPrecomputedRagSourceConfig + | RAGConfigUnknown +] +""" +Contains configuration details for retrieval of information and response +generation. +""" + +class _RAGConfigDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> RAGConfig: ... + +@dataclass(kw_only=True) +class RatingScaleItem(_SerdeShape): + """ + Defines the value and corresponding definition for one rating in a + custom metric rating scale. + """ + + definition: str + """Defines the definition for one rating in a custom metric rating scale.""" + value: RatingScaleItemValue + """Defines the value for one rating in a custom metric rating scale.""" + +@dataclass +class RatingScaleItemValueStringValue(_SerdeShape): + """ + A string representing the value for a rating in a custom metric rating + scale. + """ + + value: str + +@dataclass +class RatingScaleItemValueFloatValue(_SerdeShape): + """ + A floating point number representing the value for a rating in a custom + metric rating scale. + """ + + value: float + +@dataclass +class RatingScaleItemValueUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +RatingScaleItemValue = Union[ + RatingScaleItemValueStringValue + | RatingScaleItemValueFloatValue + | RatingScaleItemValueUnknown +] +"""Defines the value for one rating in a custom metric rating scale.""" + +class _RatingScaleItemValueDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> RatingScaleItemValue: ... + +class ReasoningEffort(UnknownEnumMixin, StrEnum): + LOW = "low" + MEDIUM = "medium" + HIGH = "high" + +class RegionAvailability(UnknownEnumMixin, StrEnum): + AVAILABLE = "AVAILABLE" + NOT_AVAILABLE = "NOT_AVAILABLE" + +@dataclass(kw_only=True) +class RegisterMarketplaceModelEndpointInput(_SerdeShape): + """Dataclass for RegisterMarketplaceModelEndpointInput structure.""" + + endpoint_identifier: str | None = ... + """ + The ARN of the Amazon SageMaker endpoint you want to register with + Amazon Bedrock Marketplace. + """ + model_source_identifier: str | None = ... + """ + The ARN of the model from Amazon Bedrock Marketplace that is deployed on + the endpoint. + """ + +@dataclass(kw_only=True) +class RegisterMarketplaceModelEndpointOutput(_SerdeShape): + """Dataclass for RegisterMarketplaceModelEndpointOutput structure.""" + + marketplace_model_endpoint: MarketplaceModelEndpoint + """Details about the registered endpoint.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class RequestMetadataBaseFilters(_SerdeShape): + """ + A mapping of a metadata key to a value that it should or should not + equal. + """ + + equals: dict[str, str] | None = ... + """Include results where the key equals the value.""" + not_equals: dict[str, str] | None = ... + """Include results where the key does not equal the value.""" + +@dataclass +class RequestMetadataFiltersEquals(_SerdeShape): + """Include results where the key equals the value.""" + + value: dict[str, str] + +@dataclass +class RequestMetadataFiltersNotEquals(_SerdeShape): + """Include results where the key does not equal the value.""" + + value: dict[str, str] + +@dataclass +class RequestMetadataFiltersAndAll(_SerdeShape): + """Include results where all of the based filters match.""" + + value: list[RequestMetadataBaseFilters] + +@dataclass +class RequestMetadataFiltersOrAll(_SerdeShape): + """Include results where any of the base filters match.""" + + value: list[RequestMetadataBaseFilters] + +@dataclass +class RequestMetadataFiltersUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +RequestMetadataFilters = Union[ + RequestMetadataFiltersEquals + | RequestMetadataFiltersNotEquals + | RequestMetadataFiltersAndAll + | RequestMetadataFiltersOrAll + | RequestMetadataFiltersUnknown +] +""" +Rules for filtering invocation logs. A filter can be a mapping of a +metadata key to a value that it should or should not equal (a base +filter), or a list of base filters that are all applied with `AND` or +`OR` logical operators +""" + +class _RequestMetadataFiltersDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> RequestMetadataFilters: ... + +class RerankingMetadataSelectionMode(UnknownEnumMixin, StrEnum): + SELECTIVE = "SELECTIVE" + ALL = "ALL" + +@dataclass +class RerankingMetadataSelectiveModeConfigurationFieldsToInclude(_SerdeShape): + """ + A list of metadata field names to explicitly include in the reranking + process. Only these fields will be considered when reordering search + results. This parameter cannot be used together with fieldsToExclude. + """ + + value: list[FieldForReranking] + +@dataclass +class RerankingMetadataSelectiveModeConfigurationFieldsToExclude(_SerdeShape): + """ + A list of metadata field names to explicitly exclude from the reranking + process. All metadata fields except these will be considered when + reordering search results. This parameter cannot be used together with + fieldsToInclude. + """ + + value: list[FieldForReranking] + +@dataclass +class RerankingMetadataSelectiveModeConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +RerankingMetadataSelectiveModeConfiguration = Union[ + RerankingMetadataSelectiveModeConfigurationFieldsToInclude + | RerankingMetadataSelectiveModeConfigurationFieldsToExclude + | RerankingMetadataSelectiveModeConfigurationUnknown +] +""" +Configuration for selectively including or excluding metadata fields +during the reranking process. This allows you to control which metadata +attributes are considered when reordering search results. +""" + +class _RerankingMetadataSelectiveModeConfigurationDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> RerankingMetadataSelectiveModeConfiguration: ... + +@dataclass(kw_only=True) +class ResourceInUseException(ServiceError, _SerdeShape): + """ + Thrown when attempting to delete or modify a resource that is currently + being used by other resources or operations. For example, trying to + delete an Automated Reasoning policy that is referenced by an active + guardrail. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ResourceNotFoundException(ServiceError, _SerdeShape): + """ + The specified resource Amazon Resource Name (ARN) was not found. Check + the Amazon Resource Name (ARN) and try your request again. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass +class RetrievalFilterEquals(_SerdeShape): + """ + Knowledge base data sources are returned if they contain a metadata + attribute whose name matches the key and whose value matches the value + in this object. + + The following example would return data sources with an animal attribute + whose value is 'cat': `"equals": { "key": "animal", "value": "cat" }` + """ + + value: FilterAttribute + +@dataclass +class RetrievalFilterNotEquals(_SerdeShape): + """ + Knowledge base data sources that contain a metadata attribute whose name + matches the key and whose value doesn't match the value in this object + are returned. + + The following example would return data sources that don't contain an + animal attribute whose value is 'cat': + `"notEquals": { "key": "animal", "value": "cat" }` + """ + + value: FilterAttribute + +@dataclass +class RetrievalFilterGreaterThan(_SerdeShape): + """ + Knowledge base data sources are returned if they contain a metadata + attribute whose name matches the key and whose value is greater than the + value in this object. + + The following example would return data sources with an year attribute + whose value is greater than '1989': + `"greaterThan": { "key": "year", "value": 1989 }` + """ + + value: FilterAttribute + +@dataclass +class RetrievalFilterGreaterThanOrEquals(_SerdeShape): + """ + Knowledge base data sources are returned if they contain a metadata + attribute whose name matches the key and whose value is greater than or + equal to the value in this object. + + The following example would return data sources with an year attribute + whose value is greater than or equal to '1989': + `"greaterThanOrEquals": { "key": "year", "value": 1989 }` + """ + + value: FilterAttribute + +@dataclass +class RetrievalFilterLessThan(_SerdeShape): + """ + Knowledge base data sources are returned if they contain a metadata + attribute whose name matches the key and whose value is less than the + value in this object. + + The following example would return data sources with an year attribute + whose value is less than to '1989': + `"lessThan": { "key": "year", "value": 1989 }` + """ + + value: FilterAttribute + +@dataclass +class RetrievalFilterLessThanOrEquals(_SerdeShape): + """ + Knowledge base data sources are returned if they contain a metadata + attribute whose name matches the key and whose value is less than or + equal to the value in this object. + + The following example would return data sources with an year attribute + whose value is less than or equal to '1989': + `"lessThanOrEquals": { "key": "year", "value": 1989 }` + """ + + value: FilterAttribute + +@dataclass +class RetrievalFilterIn(_SerdeShape): + """ + Knowledge base data sources are returned if they contain a metadata + attribute whose name matches the key and whose value is in the list + specified in the value in this object. + + The following example would return data sources with an animal attribute + that is either 'cat' or 'dog': + `"in": { "key": "animal", "value": ["cat", "dog"] }` + """ + + value: FilterAttribute + +@dataclass +class RetrievalFilterNotIn(_SerdeShape): + """ + Knowledge base data sources are returned if they contain a metadata + attribute whose name matches the key and whose value isn't in the list + specified in the value in this object. + + The following example would return data sources whose animal attribute + is neither 'cat' nor 'dog': + `"notIn": { "key": "animal", "value": ["cat", "dog"] }` + """ + + value: FilterAttribute + +@dataclass +class RetrievalFilterStartsWith(_SerdeShape): + """ + Knowledge base data sources are returned if they contain a metadata + attribute whose name matches the key and whose value starts with the + value in this object. This filter is currently only supported for Amazon + OpenSearch Serverless vector stores. + + The following example would return data sources with an animal attribute + starts with 'ca' (for example, 'cat' or 'camel'). + `"startsWith": { "key": "animal", "value": "ca" }` + """ + + value: FilterAttribute + +@dataclass +class RetrievalFilterListContains(_SerdeShape): + """ + Knowledge base data sources are returned if they contain a metadata + attribute whose name matches the key and whose value is a list that + contains the value as one of its members. + + The following example would return data sources with an animals + attribute that is a list containing a cat member (for example, + `["dog", "cat"]`): + `"listContains": { "key": "animals", "value": "cat" }` + """ + + value: FilterAttribute + +@dataclass +class RetrievalFilterStringContains(_SerdeShape): + """ + Knowledge base data sources are returned if they contain a metadata + attribute whose name matches the key and whose value is one of the + following: + + A string that contains the value as a substring. The following example + would return data sources with an animal attribute that contains the + substring at (for example, 'cat'): + `"stringContains": { "key": "animal", "value": "at" }` + + A list with a member that contains the value as a substring. The + following example would return data sources with an animals attribute + that is a list containing a member that contains the substring at (for + example, `["dog", "cat"]`): + `"stringContains": { "key": "animals", "value": "at" }` + """ + + value: FilterAttribute + +@dataclass +class RetrievalFilterAndAll(_SerdeShape): + """ + Knowledge base data sources are returned if their metadata attributes + fulfill all the filter conditions inside this list. + """ + + value: list[RetrievalFilter] + +@dataclass +class RetrievalFilterOrAll(_SerdeShape): + """ + Knowledge base data sources are returned if their metadata attributes + fulfill at least one of the filter conditions inside this list. + """ + + value: list[RetrievalFilter] + +@dataclass +class RetrievalFilterUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +RetrievalFilter = Union[ + RetrievalFilterEquals + | RetrievalFilterNotEquals + | RetrievalFilterGreaterThan + | RetrievalFilterGreaterThanOrEquals + | RetrievalFilterLessThan + | RetrievalFilterLessThanOrEquals + | RetrievalFilterIn + | RetrievalFilterNotIn + | RetrievalFilterStartsWith + | RetrievalFilterListContains + | RetrievalFilterStringContains + | RetrievalFilterAndAll + | RetrievalFilterOrAll + | RetrievalFilterUnknown +] +""" +Specifies the filters to use on the metadata attributes/fields in the +knowledge base data sources before returning results. +""" + +class _RetrievalFilterDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> RetrievalFilter: ... + +@dataclass(kw_only=True) +class RetrieveAndGenerateConfiguration(_SerdeShape): + """ + Contains configuration details for a knowledge base retrieval and + response generation. + """ + + type: str + """ + The type of resource that contains your data for retrieving information + and generating responses. + + If you choose to use `EXTERNAL_SOURCES`, then currently only Claude 3 + Sonnet models for knowledge bases are supported. + """ + knowledge_base_configuration: ( + KnowledgeBaseRetrieveAndGenerateConfiguration | None + ) = ... + """ + Contains configuration details for the knowledge base retrieval and + response generation. + """ + external_sources_configuration: ( + ExternalSourcesRetrieveAndGenerateConfiguration | None + ) = ... + """ + The configuration for the external source wrapper object in the + `retrieveAndGenerate` function. + """ + +class RetrieveAndGenerateType(UnknownEnumMixin, StrEnum): + KNOWLEDGE_BASE = "KNOWLEDGE_BASE" + EXTERNAL_SOURCES = "EXTERNAL_SOURCES" + +@dataclass(kw_only=True) +class RetrieveConfig(_SerdeShape): + """ + The configuration details for retrieving information from a knowledge + base. + """ + + knowledge_base_id: str + """The unique identifier of the knowledge base.""" + knowledge_base_retrieval_configuration: KnowledgeBaseRetrievalConfiguration + """Contains configuration details for knowledge base retrieval.""" + +@dataclass(kw_only=True) +class RFTConfig(_SerdeShape): + """ + Configuration settings for reinforcement fine-tuning (RFT), including + grader configuration and training hyperparameters. + """ + + grader_config: GraderConfig | None = ... + """ + Configuration for the grader that evaluates model responses and provides + reward signals during RFT training. + """ + hyper_parameters: RFTHyperParameters | None = ... + """ + Hyperparameters that control the reinforcement fine-tuning training + process, including learning rate, batch size, and epoch count. + """ + +@dataclass(kw_only=True) +class RFTHyperParameters(_SerdeShape): + """ + Hyperparameters for controlling the reinforcement fine-tuning training + process, including learning settings and evaluation intervals. + """ + + epoch_count: int | None = ... + """ + Number of training epochs to run during reinforcement fine-tuning. + Higher values may improve performance but increase training time. + """ + batch_size: int | None = ... + """ + Number of training samples processed in each batch during reinforcement + fine-tuning (RFT) training. Larger batches may improve training + stability. + """ + learning_rate: float | None = ... + """ + Learning rate for the reinforcement fine-tuning. Controls how quickly + the model adapts to reward signals. + """ + max_prompt_length: int | None = ... + """ + Maximum length of input prompts during RFT training, measured in tokens. + Longer prompts allow more context but increase memory usage and + training-time. + """ + training_sample_per_prompt: int | None = ... + """ + Number of response samples generated per prompt during RFT training. + More samples provide better reward signal estimation. + """ + inference_max_tokens: int | None = ... + """ + Maximum number of tokens the model can generate in response to each + prompt during RFT training. + """ + reasoning_effort: str | None = ... + """ + Level of reasoning effort applied during RFT training. Higher values may + improve response quality but increase training time. + """ + eval_interval: int | None = ... + """ + Interval between evaluation runs during RFT training, measured in + training steps. More frequent evaluation provides better monitoring. + """ + +@dataclass(kw_only=True) +class RoutingCriteria(_SerdeShape): + """Routing criteria for a prompt router.""" + + response_quality_difference: float + """The criteria's response quality difference.""" + +@dataclass(kw_only=True) +class S3Config(_SerdeShape): + """S3 configuration for storing log data.""" + + bucket_name: str + """S3 bucket name.""" + key_prefix: str | None = ... + """S3 prefix.""" + +@dataclass(kw_only=True) +class S3DataSource(_SerdeShape): + """The Amazon S3 data source of the model to import.""" + + s3_uri: str + """The URI of the Amazon S3 data source.""" + +class S3InputFormat(UnknownEnumMixin, StrEnum): + JSONL = "JSONL" + +@dataclass(kw_only=True) +class S3ObjectDoc(_SerdeShape): + """The unique wrapper object of the document from the S3 location.""" + + uri: str + """The S3 URI location for the wrapper object of the document.""" + +@dataclass(kw_only=True) +class SageMakerEndpoint(_SerdeShape): + """Specifies the configuration for a Amazon SageMaker endpoint.""" + + initial_instance_count: int + """ + The number of Amazon EC2 compute instances to deploy for initial + endpoint creation. + """ + instance_type: str + """The Amazon EC2 compute instance type to deploy for hosting the model.""" + execution_role: str + """ + The ARN of the IAM role that Amazon SageMaker can assume to access model + artifacts and docker image for deployment on Amazon EC2 compute + instances or for batch transform jobs. + """ + kms_encryption_key: str | None = ... + """ + The Amazon Web Services KMS key that Amazon SageMaker uses to encrypt + data on the storage volume attached to the Amazon EC2 compute instance + that hosts the endpoint. + """ + vpc: VpcConfig | None = ... + """The VPC configuration for the endpoint.""" + +class SearchType(UnknownEnumMixin, StrEnum): + HYBRID = "HYBRID" + SEMANTIC = "SEMANTIC" + +@dataclass(kw_only=True) +class SelectiveContentGuarding(_SerdeShape): + """Selective content guarding controls for enforced guardrails.""" + + system: str | None = ... + """Selective guarding mode for system prompts.\"""" + messages: str | None = ... + """Selective guarding mode for user messages.""" + +class SelectiveGuardingMode(UnknownEnumMixin, StrEnum): + SELECTIVE = "SELECTIVE" + COMPREHENSIVE = "COMPREHENSIVE" + +@dataclass(kw_only=True) +class ServiceQuotaExceededException(ServiceError, _SerdeShape): + """ + The number of requests exceeds the service quota. Resubmit your request + later. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ServiceUnavailableException(ServiceError, _SerdeShape): + """Returned if the service cannot complete the request.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class SortByProvisionedModels(UnknownEnumMixin, StrEnum): + CREATION_TIME = "CreationTime" + +class SortJobsBy(UnknownEnumMixin, StrEnum): + CREATION_TIME = "CreationTime" + +class SortModelsBy(UnknownEnumMixin, StrEnum): + CREATION_TIME = "CreationTime" + +class SortOrder(UnknownEnumMixin, StrEnum): + ASCENDING = "Ascending" + DESCENDING = "Descending" + +@dataclass(kw_only=True) +class StartAutomatedReasoningPolicyBuildWorkflowInput(_SerdeShape): + """Dataclass for StartAutomatedReasoningPolicyBuildWorkflowInput structure.""" + + policy_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the Automated Reasoning policy for + which to start the build workflow. + """ + build_workflow_type: str | None = ... + """ + The type of build workflow to start (e.g., DOCUMENT_INGESTION for + processing new documents, POLICY_REPAIR for fixing existing policies). + """ + client_request_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the operation + completes no more than once. If this token matches a previous request, + Amazon Bedrock ignores the request but doesn't return an error. + """ + source_content: AutomatedReasoningPolicyBuildWorkflowSource | None = ... + """ + The source content for the build workflow, such as documents to analyze + or repair instructions for existing policies. + """ + +@dataclass(kw_only=True) +class StartAutomatedReasoningPolicyBuildWorkflowOutput(_SerdeShape): + """ + Dataclass for StartAutomatedReasoningPolicyBuildWorkflowOutput + structure. + """ + + policy_arn: str + """The Amazon Resource Name (ARN) of the Automated Reasoning policy.""" + build_workflow_id: str + """ + The unique identifier of the newly started build workflow. Use this ID + to track the workflow's progress and retrieve its results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class StartAutomatedReasoningPolicyTestWorkflowInput(_SerdeShape): + """Dataclass for StartAutomatedReasoningPolicyTestWorkflowInput structure.""" + + policy_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the Automated Reasoning policy to + test. + """ + build_workflow_id: str | None = ... + """ + The build workflow identifier. The build workflow must show a + `COMPLETED` status before running tests. + """ + test_case_ids: list[str] | None = ... + """ + The list of test identifiers to run. If not provided, all tests for the + policy are run. + """ + client_request_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the operation + completes no more than one time. If this token matches a previous + request, Amazon Bedrock ignores the request but doesn't return an + error. + """ + +@dataclass(kw_only=True) +class StartAutomatedReasoningPolicyTestWorkflowOutput(_SerdeShape): + """Dataclass for StartAutomatedReasoningPolicyTestWorkflowOutput structure.""" + + policy_arn: str + """ + The Amazon Resource Name (ARN) of the policy for which the test workflow + was started. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class Status(UnknownEnumMixin, StrEnum): + REGISTERED = "REGISTERED" + INCOMPATIBLE_ENDPOINT = "INCOMPATIBLE_ENDPOINT" + +@dataclass(kw_only=True) +class StatusDetails(_SerdeShape): + """ + For a Distillation job, the status details for sub-tasks of the job. + Possible statuses for each sub-task include the following: + + - NotStarted + + - InProgress + + - Completed + + - Stopping + + - Stopped + + - Failed + """ + + validation_details: ValidationDetails | None = ... + """The status details for the validation sub-task of the job.""" + data_processing_details: DataProcessingDetails | None = ... + """The status details for the data processing sub-task of the job.""" + training_details: TrainingDetails | None = ... + """The status details for the training sub-task of the job.""" + +@dataclass(kw_only=True) +class StopAdvancedPromptOptimizationJobInput(_SerdeShape): + """Stop Advanced Prompt Optimization Job Request""" + + job_identifier: str | None = ... + """The ARN or ID of the advanced prompt optimization job to stop.""" + +@dataclass(kw_only=True) +class StopAdvancedPromptOptimizationJobOutput(_SerdeShape): + """Stop Advanced Prompt Optimization Job Response""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class StopEvaluationJobInput(_SerdeShape): + """Dataclass for StopEvaluationJobInput structure.""" + + job_identifier: str | None = ... + """The Amazon Resource Name (ARN) of the evaluation job you want to stop.""" + +@dataclass(kw_only=True) +class StopEvaluationJobOutput(_SerdeShape): + """Dataclass for StopEvaluationJobOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class StopModelCustomizationJobInput(_SerdeShape): + """Dataclass for StopModelCustomizationJobInput structure.""" + + job_identifier: str | None = ... + """Job identifier of the job to stop.""" + +@dataclass(kw_only=True) +class StopModelCustomizationJobOutput(_SerdeShape): + """Dataclass for StopModelCustomizationJobOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class StopModelInvocationJobInput(_SerdeShape): + """Dataclass for StopModelInvocationJobInput structure.""" + + job_identifier: str | None = ... + """The Amazon Resource Name (ARN) of the batch inference job to stop.""" + +@dataclass(kw_only=True) +class StopModelInvocationJobOutput(_SerdeShape): + """Dataclass for StopModelInvocationJobOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class SupportTerm(_SerdeShape): + """Describes a support term.""" + + refund_policy_description: str | None = ... + """Describes the refund policy.""" + +@dataclass(kw_only=True) +class Tag(_SerdeShape): + """Definition of the key/value pair for a tag.""" + + key: str + """Key for the tag.""" + value: str + """Value for the tag.""" + +@dataclass(kw_only=True) +class TagResourceInput(_SerdeShape): + """Dataclass for TagResourceInput structure.""" + + resource_arn: str | None = ... + """The Amazon Resource Name (ARN) of the resource to tag.""" + tags: list[Tag] | None = ... + """Tags to associate with the resource.""" + +@dataclass(kw_only=True) +class TagResourceOutput(_SerdeShape): + """Dataclass for TagResourceOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class TeacherModelConfig(_SerdeShape): + """Details about a teacher model used for model customization.""" + + teacher_model_identifier: str + """The identifier of the teacher model.""" + max_response_length_for_inference: int | None = ... + """ + The maximum number of tokens requested when the customization job + invokes the teacher model. + """ + +@dataclass(kw_only=True) +class TermDetails(_SerdeShape): + """Describes the usage terms of an offer.""" + + usage_based_pricing_term: PricingTerm + """Describes the usage-based pricing term.""" + legal_term: LegalTerm + """Describes the legal terms.""" + support_term: SupportTerm + """Describes the support terms.""" + validity_term: ValidityTerm | None = ... + """Describes the validity terms.""" + +@dataclass(kw_only=True) +class TextInferenceConfig(_SerdeShape): + """ + The configuration details for text generation using a language model via + the `RetrieveAndGenerate` function. + """ + + temperature: float | None = ... + """ + Controls the random-ness of text generated by the language model, + influencing how much the model sticks to the most predictable next words + versus exploring more surprising options. A lower temperature value + (e.g. 0.2 or 0.3) makes model outputs more deterministic or predictable, + while a higher temperature (e.g. 0.8 or 0.9) makes the outputs more + creative or unpredictable. + """ + top_p: float | None = ... + """ + A probability distribution threshold which controls what the model + considers for the set of possible next tokens. The model will only + consider the top p% of the probability distribution when generating the + next token. + """ + max_tokens: int | None = ... + """ + The maximum number of tokens to generate in the output text. Do not use + the minimum of 0 or the maximum of 65536. The limit values described + here are arbitrary values, for actual values consult the limits defined + by your specific model. + """ + stop_sequences: list[str] | None = ... + """ + A list of sequences of characters that, if generated, will cause the + model to stop generating further tokens. Do not use a minimum length of + 1 or a maximum length of 1000. The limit values described here are + arbitrary values, for actual values consult the limits defined by your + specific model. + """ + +@dataclass(kw_only=True) +class ThrottlingException(ServiceError, _SerdeShape): + """The number of requests exceeds the limit. Resubmit your request later.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class TooManyTagsException(ServiceError, _SerdeShape): + """ + The request contains more tags than can be associated with a resource + (50 tags per resource). The maximum number of tags includes both + existing tags and those included in your current request. + """ + + resource_name: str | None = ... + """The name of the resource with too many tags.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class TrainingDataConfig(_SerdeShape): + """S3 Location of the training data.""" + + s3_uri: str | None = ... + """The S3 URI where the training data is stored.""" + invocation_logs_config: InvocationLogsConfig | None = ... + """Settings for using invocation logs to customize a model.""" + +@dataclass(kw_only=True) +class TrainingDetails(_SerdeShape): + """ + For a Distillation job, the status details for the training sub-task of + the job. + """ + + status: str | None = ... + """The status of the training sub-task of the job.""" + creation_time: datetime | None = ... + """The start time of the training sub-task of the job.""" + last_modified_time: datetime | None = ... + """The latest update to the training sub-task of the job.""" + +@dataclass(kw_only=True) +class TrainingMetrics(_SerdeShape): + """Metrics associated with the custom job.""" + + training_loss: float | None = ... + """Loss metric associated with the custom job.""" + +@dataclass(kw_only=True) +class UntagResourceInput(_SerdeShape): + """Dataclass for UntagResourceInput structure.""" + + resource_arn: str | None = ... + """The Amazon Resource Name (ARN) of the resource to untag.""" + tag_keys: list[str] | None = ... + """Tag keys of the tags to remove from the resource.""" + +@dataclass(kw_only=True) +class UntagResourceOutput(_SerdeShape): + """Dataclass for UntagResourceOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateAutomatedReasoningPolicyAnnotationsInput(_SerdeShape): + """Dataclass for UpdateAutomatedReasoningPolicyAnnotationsInput structure.""" + + policy_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the Automated Reasoning policy whose + annotations you want to update. + """ + build_workflow_id: str | None = ... + """ + The unique identifier of the build workflow whose annotations you want + to update. + """ + annotations: list[AutomatedReasoningPolicyAnnotation] | None = ... + """ + The updated annotations containing modified rules, variables, and types + for the policy. + """ + last_updated_annotation_set_hash: str | None = ... + """ + The hash value of the annotation set that you're updating. This is used + for optimistic concurrency control to prevent conflicting updates. + """ + +@dataclass(kw_only=True) +class UpdateAutomatedReasoningPolicyAnnotationsOutput(_SerdeShape): + """Dataclass for UpdateAutomatedReasoningPolicyAnnotationsOutput structure.""" + + policy_arn: str + """The Amazon Resource Name (ARN) of the Automated Reasoning policy.""" + build_workflow_id: str + """The unique identifier of the build workflow.""" + annotation_set_hash: str + """The new hash value representing the updated state of the annotations.""" + updated_at: datetime + """The timestamp when the annotations were updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateAutomatedReasoningPolicyInput(_SerdeShape): + """Dataclass for UpdateAutomatedReasoningPolicyInput structure.""" + + policy_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the Automated Reasoning policy to + update. This must be the ARN of a draft policy. + """ + policy_definition: AutomatedReasoningPolicyDefinition | None = ... + """ + The updated policy definition containing the formal logic rules, + variables, and types. + """ + name: str | None = ... + """The updated name for the Automated Reasoning policy.""" + description: str | None = ... + """The updated description for the Automated Reasoning policy.""" + +@dataclass(kw_only=True) +class UpdateAutomatedReasoningPolicyOutput(_SerdeShape): + """Dataclass for UpdateAutomatedReasoningPolicyOutput structure.""" + + policy_arn: str + """The Amazon Resource Name (ARN) of the updated policy.""" + name: str + """The updated name of the policy.""" + definition_hash: str + """The hash of the updated policy definition.""" + updated_at: datetime + """The timestamp when the policy was last updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateAutomatedReasoningPolicyTestCaseInput(_SerdeShape): + """Dataclass for UpdateAutomatedReasoningPolicyTestCaseInput structure.""" + + policy_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the Automated Reasoning policy that + contains the test. + """ + test_case_id: str | None = ... + """The unique identifier of the test to update.""" + guard_content: str | None = ... + """The updated content to be validated by the Automated Reasoning policy.""" + query_content: str | None = ... + """The updated input query or prompt that generated the content.""" + last_updated_at: datetime | None = ... + """ + The timestamp when the test was last updated. This is used as a + concurrency token to prevent conflicting modifications. + """ + expected_aggregated_findings_result: str | None = ... + """The updated expected result of the Automated Reasoning check.""" + confidence_threshold: float | None = ... + """ + The updated minimum confidence level for logic validation. If null is + provided, the threshold will be removed. + """ + client_request_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the operation + completes no more than one time. If this token matches a previous + request, Amazon Bedrock ignores the request, but does not return an + error. + """ + +@dataclass(kw_only=True) +class UpdateAutomatedReasoningPolicyTestCaseOutput(_SerdeShape): + """Dataclass for UpdateAutomatedReasoningPolicyTestCaseOutput structure.""" + + policy_arn: str + """ + The Amazon Resource Name (ARN) of the policy that contains the updated + test. + """ + test_case_id: str + """The unique identifier of the updated test.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateCustomModelDeploymentInput(_SerdeShape): + """Dataclass for UpdateCustomModelDeploymentInput structure.""" + + model_arn: str | None = ... + """ + ARN of the new custom model to deploy. This replaces the currently + deployed model. + """ + custom_model_deployment_identifier: str | None = ... + """ + Identifier of the custom model deployment to update with the new custom + model. + """ + +@dataclass(kw_only=True) +class UpdateCustomModelDeploymentOutput(_SerdeShape): + """Dataclass for UpdateCustomModelDeploymentOutput structure.""" + + custom_model_deployment_arn: str + """ARN of the custom model deployment being updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateGuardrailInput(_SerdeShape): + """Dataclass for UpdateGuardrailInput structure.""" + + guardrail_identifier: str | None = ... + """The unique identifier of the guardrail. This can be an ID or the ARN.""" + name: str | None = ... + """A name for the guardrail.""" + description: str | None = ... + """A description of the guardrail.""" + topic_policy_config: GuardrailTopicPolicyConfig | None = ... + """The topic policy to configure for the guardrail.""" + content_policy_config: GuardrailContentPolicyConfig | None = ... + """The content policy to configure for the guardrail.""" + word_policy_config: GuardrailWordPolicyConfig | None = ... + """The word policy to configure for the guardrail.""" + sensitive_information_policy_config: ( + GuardrailSensitiveInformationPolicyConfig | None + ) = ... + """The sensitive information policy to configure for the guardrail.""" + contextual_grounding_policy_config: ( + GuardrailContextualGroundingPolicyConfig | None + ) = ... + """ + The contextual grounding policy configuration used to update a + guardrail. + """ + automated_reasoning_policy_config: ( + GuardrailAutomatedReasoningPolicyConfig | None + ) = ... + """ + Updated configuration for Automated Reasoning policies associated with + the guardrail. + """ + cross_region_config: GuardrailCrossRegionConfig | None = ... + """ + The system-defined guardrail profile that you're using with your + guardrail. Guardrail profiles define the destination Amazon Web Services + Regions where guardrail inference requests can be automatically routed. + + For more information, see the [Amazon Bedrock User + Guide](https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-cross-region.html). + """ + blocked_input_messaging: str | None = ... + """The message to return when the guardrail blocks a prompt.""" + blocked_outputs_messaging: str | None = ... + """The message to return when the guardrail blocks a model response.""" + kms_key_id: str | None = ... + """The ARN of the KMS key with which to encrypt the guardrail.""" + +@dataclass(kw_only=True) +class UpdateGuardrailOutput(_SerdeShape): + """Dataclass for UpdateGuardrailOutput structure.""" + + guardrail_id: str + """The unique identifier of the guardrail""" + guardrail_arn: str + """The ARN of the guardrail.""" + version: str + """The version of the guardrail.""" + updated_at: datetime + """The date and time at which the guardrail was updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateMarketplaceModelEndpointInput(_SerdeShape): + """Dataclass for UpdateMarketplaceModelEndpointInput structure.""" + + endpoint_arn: str | None = ... + """The Amazon Resource Name (ARN) of the endpoint you want to update.""" + endpoint_config: EndpointConfig | None = ... + """ + The new configuration for the endpoint, including the number and type of + instances to use. + """ + client_request_token: str | None = ... + """ + A unique, case-sensitive identifier that you provide to ensure the + idempotency of the request. This token is listed as not required because + Amazon Web Services SDKs automatically generate it for you and set this + parameter. If you're not using the Amazon Web Services SDK or the CLI, + you must provide this token or the action will fail. + """ + +@dataclass(kw_only=True) +class UpdateMarketplaceModelEndpointOutput(_SerdeShape): + """Dataclass for UpdateMarketplaceModelEndpointOutput structure.""" + + marketplace_model_endpoint: MarketplaceModelEndpoint + """Details about the updated endpoint.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateProvisionedModelThroughputInput(_SerdeShape): + """Dataclass for UpdateProvisionedModelThroughputInput structure.""" + + provisioned_model_id: str | None = ... + """ + The Amazon Resource Name (ARN) or name of the Provisioned Throughput to + update. + """ + desired_provisioned_model_name: str | None = ... + """The new name for this Provisioned Throughput.""" + desired_model_id: str | None = ... + """ + The Amazon Resource Name (ARN) of the new model to associate with this + Provisioned Throughput. You can't specify this field if this + Provisioned Throughput is associated with a base model. + + If this Provisioned Throughput is associated with a custom model, you + can specify one of the following options: + + - The base model from which the custom model was customized. + + - Another custom model that was customized from the same base model as + the custom model. + """ + +@dataclass(kw_only=True) +class UpdateProvisionedModelThroughputOutput(_SerdeShape): + """Dataclass for UpdateProvisionedModelThroughputOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ValidationDataConfig(_SerdeShape): + """Array of up to 10 validators.""" + + validators: list[Validator] + """Information about the validators.""" + +@dataclass(kw_only=True) +class ValidationDetails(_SerdeShape): + """ + For a Distillation job, the status details for the validation sub-task + of the job. + """ + + status: str | None = ... + """The status of the validation sub-task of the job.""" + creation_time: datetime | None = ... + """The start time of the validation sub-task of the job.""" + last_modified_time: datetime | None = ... + """The latest update to the validation sub-task of the job.""" + +@dataclass(kw_only=True) +class ValidationException(ServiceError, _SerdeShape): + """ + Input validation failed. Check your request parameters and retry the + request. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class Validator(_SerdeShape): + """Information about a validator.""" + + s3_uri: str + """The S3 URI where the validation data is stored.""" + +@dataclass(kw_only=True) +class ValidatorMetric(_SerdeShape): + """The metric for the validator.""" + + validation_loss: float | None = ... + """The validation loss associated with this validator.""" + +@dataclass(kw_only=True) +class ValidityTerm(_SerdeShape): + """Describes the validity terms.""" + + agreement_duration: str | None = ... + """Describes the agreement duration.""" + +@dataclass(kw_only=True) +class VectorSearchBedrockRerankingConfiguration(_SerdeShape): + """ + Configuration for using Amazon Bedrock foundation models to rerank + Knowledge Base vector search results. This enables more sophisticated + relevance ranking using large language models. + """ + + model_configuration: VectorSearchBedrockRerankingModelConfiguration + """ + Configuration for the Amazon Bedrock foundation model used for + reranking. This includes the model ARN and any additional request fields + required by the model. + """ + number_of_reranked_results: int | None = ... + """ + The maximum number of results to rerank. This limits how many of the + initial vector search results will be processed by the reranking model. + A smaller number improves performance but may exclude potentially + relevant results. + """ + metadata_configuration: MetadataConfigurationForReranking | None = ... + """ + Configuration for how document metadata should be used during the + reranking process. This determines which metadata fields are included + when reordering search results. + """ + +@dataclass(kw_only=True) +class VectorSearchBedrockRerankingModelConfiguration(_SerdeShape): + """ + Configuration for the Amazon Bedrock foundation model used for reranking + vector search results. This specifies which model to use and any + additional parameters required by the model. + """ + + model_arn: str + """ + The Amazon Resource Name (ARN) of the foundation model to use for + reranking. This model processes the query and search results to + determine a more relevant ordering. + """ + additional_model_request_fields: dict[str, Document] | None = ... + """ + A list of additional fields to include in the model request during + reranking. These fields provide extra context or configuration options + specific to the selected foundation model. + """ + +@dataclass(kw_only=True) +class VectorSearchRerankingConfiguration(_SerdeShape): + """ + Configuration for reranking vector search results to improve relevance. + Reranking applies additional relevance models to reorder the initial + vector search results based on more sophisticated criteria. + """ + + type: str + """ + The type of reranking to apply to vector search results. Currently, the + only supported value is BEDROCK, which uses Amazon Bedrock foundation + models for reranking. + """ + bedrock_reranking_configuration: ( + VectorSearchBedrockRerankingConfiguration | None + ) = ... + """ + Configuration for using Amazon Bedrock foundation models to rerank + search results. This is required when the reranking type is set to + BEDROCK. + """ + +class VectorSearchRerankingConfigurationType(UnknownEnumMixin, StrEnum): + BEDROCK_RERANKING_MODEL = "BEDROCK_RERANKING_MODEL" + +@dataclass(kw_only=True) +class VpcConfig(_SerdeShape): + """ + The configuration of a virtual private cloud (VPC). For more + information, see [Protect your data using Amazon Virtual Private Cloud + and Amazon Web Services + PrivateLink](https://docs.aws.amazon.com/bedrock/latest/userguide/usingVPC.html). + """ + + subnet_ids: list[str] + """An array of IDs for each subnet in the VPC to use.""" + security_group_ids: list[str] + """An array of IDs for each security group in the VPC to use.""" + +BATCH_DELETE_ADVANCED_PROMPT_OPTIMIZATION_JOB: APIOperation[ + BatchDeleteAdvancedPromptOptimizationJobInput, + BatchDeleteAdvancedPromptOptimizationJobOutput, +] +BATCH_DELETE_EVALUATION_JOB: APIOperation[ + BatchDeleteEvaluationJobInput, BatchDeleteEvaluationJobOutput +] +CANCEL_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW: APIOperation[ + CancelAutomatedReasoningPolicyBuildWorkflowInput, + CancelAutomatedReasoningPolicyBuildWorkflowOutput, +] +CREATE_ADVANCED_PROMPT_OPTIMIZATION_JOB: APIOperation[ + CreateAdvancedPromptOptimizationJobInput, CreateAdvancedPromptOptimizationJobOutput +] +CREATE_AUTOMATED_REASONING_POLICY: APIOperation[ + CreateAutomatedReasoningPolicyInput, CreateAutomatedReasoningPolicyOutput +] +CREATE_AUTOMATED_REASONING_POLICY_TEST_CASE: APIOperation[ + CreateAutomatedReasoningPolicyTestCaseInput, + CreateAutomatedReasoningPolicyTestCaseOutput, +] +CREATE_AUTOMATED_REASONING_POLICY_VERSION: APIOperation[ + CreateAutomatedReasoningPolicyVersionInput, + CreateAutomatedReasoningPolicyVersionOutput, +] +CREATE_CUSTOM_MODEL: APIOperation[CreateCustomModelInput, CreateCustomModelOutput] +CREATE_CUSTOM_MODEL_DEPLOYMENT: APIOperation[ + CreateCustomModelDeploymentInput, CreateCustomModelDeploymentOutput +] +CREATE_EVALUATION_JOB: APIOperation[CreateEvaluationJobInput, CreateEvaluationJobOutput] +CREATE_FOUNDATION_MODEL_AGREEMENT: APIOperation[ + CreateFoundationModelAgreementInput, CreateFoundationModelAgreementOutput +] +CREATE_GUARDRAIL: APIOperation[CreateGuardrailInput, CreateGuardrailOutput] +CREATE_GUARDRAIL_VERSION: APIOperation[ + CreateGuardrailVersionInput, CreateGuardrailVersionOutput +] +CREATE_INFERENCE_PROFILE: APIOperation[ + CreateInferenceProfileInput, CreateInferenceProfileOutput +] +CREATE_MARKETPLACE_MODEL_ENDPOINT: APIOperation[ + CreateMarketplaceModelEndpointInput, CreateMarketplaceModelEndpointOutput +] +CREATE_MODEL_COPY_JOB: APIOperation[CreateModelCopyJobInput, CreateModelCopyJobOutput] +CREATE_MODEL_CUSTOMIZATION_JOB: APIOperation[ + CreateModelCustomizationJobInput, CreateModelCustomizationJobOutput +] +CREATE_MODEL_IMPORT_JOB: APIOperation[ + CreateModelImportJobInput, CreateModelImportJobOutput +] +CREATE_MODEL_INVOCATION_JOB: APIOperation[ + CreateModelInvocationJobInput, CreateModelInvocationJobOutput +] +CREATE_PROMPT_ROUTER: APIOperation[CreatePromptRouterInput, CreatePromptRouterOutput] +CREATE_PROVISIONED_MODEL_THROUGHPUT: APIOperation[ + CreateProvisionedModelThroughputInput, CreateProvisionedModelThroughputOutput +] +DELETE_AUTOMATED_REASONING_POLICY: APIOperation[ + DeleteAutomatedReasoningPolicyInput, DeleteAutomatedReasoningPolicyOutput +] +DELETE_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW: APIOperation[ + DeleteAutomatedReasoningPolicyBuildWorkflowInput, + DeleteAutomatedReasoningPolicyBuildWorkflowOutput, +] +DELETE_AUTOMATED_REASONING_POLICY_TEST_CASE: APIOperation[ + DeleteAutomatedReasoningPolicyTestCaseInput, + DeleteAutomatedReasoningPolicyTestCaseOutput, +] +DELETE_CUSTOM_MODEL: APIOperation[DeleteCustomModelInput, DeleteCustomModelOutput] +DELETE_CUSTOM_MODEL_DEPLOYMENT: APIOperation[ + DeleteCustomModelDeploymentInput, DeleteCustomModelDeploymentOutput +] +DELETE_ENFORCED_GUARDRAIL_CONFIGURATION: APIOperation[ + DeleteEnforcedGuardrailConfigurationInput, + DeleteEnforcedGuardrailConfigurationOutput, +] +DELETE_FOUNDATION_MODEL_AGREEMENT: APIOperation[ + DeleteFoundationModelAgreementInput, DeleteFoundationModelAgreementOutput +] +DELETE_GUARDRAIL: APIOperation[DeleteGuardrailInput, DeleteGuardrailOutput] +DELETE_IMPORTED_MODEL: APIOperation[DeleteImportedModelInput, DeleteImportedModelOutput] +DELETE_INFERENCE_PROFILE: APIOperation[ + DeleteInferenceProfileInput, DeleteInferenceProfileOutput +] +DELETE_MARKETPLACE_MODEL_ENDPOINT: APIOperation[ + DeleteMarketplaceModelEndpointInput, DeleteMarketplaceModelEndpointOutput +] +DELETE_MODEL_INVOCATION_LOGGING_CONFIGURATION: APIOperation[ + DeleteModelInvocationLoggingConfigurationInput, + DeleteModelInvocationLoggingConfigurationOutput, +] +DELETE_PROMPT_ROUTER: APIOperation[DeletePromptRouterInput, DeletePromptRouterOutput] +DELETE_PROVISIONED_MODEL_THROUGHPUT: APIOperation[ + DeleteProvisionedModelThroughputInput, DeleteProvisionedModelThroughputOutput +] +DELETE_RESOURCE_POLICY: APIOperation[ + DeleteResourcePolicyInput, DeleteResourcePolicyOutput +] +DEREGISTER_MARKETPLACE_MODEL_ENDPOINT: APIOperation[ + DeregisterMarketplaceModelEndpointInput, DeregisterMarketplaceModelEndpointOutput +] +EXPORT_AUTOMATED_REASONING_POLICY_VERSION: APIOperation[ + ExportAutomatedReasoningPolicyVersionInput, + ExportAutomatedReasoningPolicyVersionOutput, +] +GET_ACCOUNT_DATA_RETENTION: APIOperation[ + GetAccountDataRetentionInput, GetAccountDataRetentionOutput +] +GET_ADVANCED_PROMPT_OPTIMIZATION_JOB: APIOperation[ + GetAdvancedPromptOptimizationJobInput, GetAdvancedPromptOptimizationJobOutput +] +GET_AUTOMATED_REASONING_POLICY: APIOperation[ + GetAutomatedReasoningPolicyInput, GetAutomatedReasoningPolicyOutput +] +GET_AUTOMATED_REASONING_POLICY_ANNOTATIONS: APIOperation[ + GetAutomatedReasoningPolicyAnnotationsInput, + GetAutomatedReasoningPolicyAnnotationsOutput, +] +GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW: APIOperation[ + GetAutomatedReasoningPolicyBuildWorkflowInput, + GetAutomatedReasoningPolicyBuildWorkflowOutput, +] +GET_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW_RESULT_ASSETS: APIOperation[ + GetAutomatedReasoningPolicyBuildWorkflowResultAssetsInput, + GetAutomatedReasoningPolicyBuildWorkflowResultAssetsOutput, +] +GET_AUTOMATED_REASONING_POLICY_NEXT_SCENARIO: APIOperation[ + GetAutomatedReasoningPolicyNextScenarioInput, + GetAutomatedReasoningPolicyNextScenarioOutput, +] +GET_AUTOMATED_REASONING_POLICY_TEST_CASE: APIOperation[ + GetAutomatedReasoningPolicyTestCaseInput, GetAutomatedReasoningPolicyTestCaseOutput +] +GET_AUTOMATED_REASONING_POLICY_TEST_RESULT: APIOperation[ + GetAutomatedReasoningPolicyTestResultInput, + GetAutomatedReasoningPolicyTestResultOutput, +] +GET_CUSTOM_MODEL: APIOperation[GetCustomModelInput, GetCustomModelOutput] +GET_CUSTOM_MODEL_DEPLOYMENT: APIOperation[ + GetCustomModelDeploymentInput, GetCustomModelDeploymentOutput +] +GET_EVALUATION_JOB: APIOperation[GetEvaluationJobInput, GetEvaluationJobOutput] +GET_FOUNDATION_MODEL: APIOperation[GetFoundationModelInput, GetFoundationModelOutput] +GET_FOUNDATION_MODEL_AVAILABILITY: APIOperation[ + GetFoundationModelAvailabilityInput, GetFoundationModelAvailabilityOutput +] +GET_GUARDRAIL: APIOperation[GetGuardrailInput, GetGuardrailOutput] +GET_IMPORTED_MODEL: APIOperation[GetImportedModelInput, GetImportedModelOutput] +GET_INFERENCE_PROFILE: APIOperation[GetInferenceProfileInput, GetInferenceProfileOutput] +GET_MARKETPLACE_MODEL_ENDPOINT: APIOperation[ + GetMarketplaceModelEndpointInput, GetMarketplaceModelEndpointOutput +] +GET_MODEL_COPY_JOB: APIOperation[GetModelCopyJobInput, GetModelCopyJobOutput] +GET_MODEL_CUSTOMIZATION_JOB: APIOperation[ + GetModelCustomizationJobInput, GetModelCustomizationJobOutput +] +GET_MODEL_IMPORT_JOB: APIOperation[GetModelImportJobInput, GetModelImportJobOutput] +GET_MODEL_INVOCATION_JOB: APIOperation[ + GetModelInvocationJobInput, GetModelInvocationJobOutput +] +GET_MODEL_INVOCATION_LOGGING_CONFIGURATION: APIOperation[ + GetModelInvocationLoggingConfigurationInput, + GetModelInvocationLoggingConfigurationOutput, +] +GET_PROMPT_ROUTER: APIOperation[GetPromptRouterInput, GetPromptRouterOutput] +GET_PROVISIONED_MODEL_THROUGHPUT: APIOperation[ + GetProvisionedModelThroughputInput, GetProvisionedModelThroughputOutput +] +GET_RESOURCE_POLICY: APIOperation[GetResourcePolicyInput, GetResourcePolicyOutput] +GET_USE_CASE_FOR_MODEL_ACCESS: APIOperation[ + GetUseCaseForModelAccessInput, GetUseCaseForModelAccessOutput +] +LIST_ADVANCED_PROMPT_OPTIMIZATION_JOBS: APIOperation[ + ListAdvancedPromptOptimizationJobsInput, ListAdvancedPromptOptimizationJobsOutput +] +LIST_AUTOMATED_REASONING_POLICIES: APIOperation[ + ListAutomatedReasoningPoliciesInput, ListAutomatedReasoningPoliciesOutput +] +LIST_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOWS: APIOperation[ + ListAutomatedReasoningPolicyBuildWorkflowsInput, + ListAutomatedReasoningPolicyBuildWorkflowsOutput, +] +LIST_AUTOMATED_REASONING_POLICY_TEST_CASES: APIOperation[ + ListAutomatedReasoningPolicyTestCasesInput, + ListAutomatedReasoningPolicyTestCasesOutput, +] +LIST_AUTOMATED_REASONING_POLICY_TEST_RESULTS: APIOperation[ + ListAutomatedReasoningPolicyTestResultsInput, + ListAutomatedReasoningPolicyTestResultsOutput, +] +LIST_CUSTOM_MODEL_DEPLOYMENTS: APIOperation[ + ListCustomModelDeploymentsInput, ListCustomModelDeploymentsOutput +] +LIST_CUSTOM_MODELS: APIOperation[ListCustomModelsInput, ListCustomModelsOutput] +LIST_ENFORCED_GUARDRAILS_CONFIGURATION: APIOperation[ + ListEnforcedGuardrailsConfigurationInput, ListEnforcedGuardrailsConfigurationOutput +] +LIST_EVALUATION_JOBS: APIOperation[ListEvaluationJobsInput, ListEvaluationJobsOutput] +LIST_FOUNDATION_MODEL_AGREEMENT_OFFERS: APIOperation[ + ListFoundationModelAgreementOffersInput, ListFoundationModelAgreementOffersOutput +] +LIST_FOUNDATION_MODELS: APIOperation[ + ListFoundationModelsInput, ListFoundationModelsOutput +] +LIST_GUARDRAILS: APIOperation[ListGuardrailsInput, ListGuardrailsOutput] +LIST_IMPORTED_MODELS: APIOperation[ListImportedModelsInput, ListImportedModelsOutput] +LIST_INFERENCE_PROFILES: APIOperation[ + ListInferenceProfilesInput, ListInferenceProfilesOutput +] +LIST_MARKETPLACE_MODEL_ENDPOINTS: APIOperation[ + ListMarketplaceModelEndpointsInput, ListMarketplaceModelEndpointsOutput +] +LIST_MODEL_COPY_JOBS: APIOperation[ListModelCopyJobsInput, ListModelCopyJobsOutput] +LIST_MODEL_CUSTOMIZATION_JOBS: APIOperation[ + ListModelCustomizationJobsInput, ListModelCustomizationJobsOutput +] +LIST_MODEL_IMPORT_JOBS: APIOperation[ + ListModelImportJobsInput, ListModelImportJobsOutput +] +LIST_MODEL_INVOCATION_JOBS: APIOperation[ + ListModelInvocationJobsInput, ListModelInvocationJobsOutput +] +LIST_PROMPT_ROUTERS: APIOperation[ListPromptRoutersInput, ListPromptRoutersOutput] +LIST_PROVISIONED_MODEL_THROUGHPUTS: APIOperation[ + ListProvisionedModelThroughputsInput, ListProvisionedModelThroughputsOutput +] +LIST_TAGS_FOR_RESOURCE: APIOperation[ + ListTagsForResourceInput, ListTagsForResourceOutput +] +PUT_ACCOUNT_DATA_RETENTION: APIOperation[ + PutAccountDataRetentionInput, PutAccountDataRetentionOutput +] +PUT_ENFORCED_GUARDRAIL_CONFIGURATION: APIOperation[ + PutEnforcedGuardrailConfigurationInput, PutEnforcedGuardrailConfigurationOutput +] +PUT_MODEL_INVOCATION_LOGGING_CONFIGURATION: APIOperation[ + PutModelInvocationLoggingConfigurationInput, + PutModelInvocationLoggingConfigurationOutput, +] +PUT_RESOURCE_POLICY: APIOperation[PutResourcePolicyInput, PutResourcePolicyOutput] +PUT_USE_CASE_FOR_MODEL_ACCESS: APIOperation[ + PutUseCaseForModelAccessInput, PutUseCaseForModelAccessOutput +] +REGISTER_MARKETPLACE_MODEL_ENDPOINT: APIOperation[ + RegisterMarketplaceModelEndpointInput, RegisterMarketplaceModelEndpointOutput +] +START_AUTOMATED_REASONING_POLICY_BUILD_WORKFLOW: APIOperation[ + StartAutomatedReasoningPolicyBuildWorkflowInput, + StartAutomatedReasoningPolicyBuildWorkflowOutput, +] +START_AUTOMATED_REASONING_POLICY_TEST_WORKFLOW: APIOperation[ + StartAutomatedReasoningPolicyTestWorkflowInput, + StartAutomatedReasoningPolicyTestWorkflowOutput, +] +STOP_ADVANCED_PROMPT_OPTIMIZATION_JOB: APIOperation[ + StopAdvancedPromptOptimizationJobInput, StopAdvancedPromptOptimizationJobOutput +] +STOP_EVALUATION_JOB: APIOperation[StopEvaluationJobInput, StopEvaluationJobOutput] +STOP_MODEL_CUSTOMIZATION_JOB: APIOperation[ + StopModelCustomizationJobInput, StopModelCustomizationJobOutput +] +STOP_MODEL_INVOCATION_JOB: APIOperation[ + StopModelInvocationJobInput, StopModelInvocationJobOutput +] +TAG_RESOURCE: APIOperation[TagResourceInput, TagResourceOutput] +UNTAG_RESOURCE: APIOperation[UntagResourceInput, UntagResourceOutput] +UPDATE_AUTOMATED_REASONING_POLICY: APIOperation[ + UpdateAutomatedReasoningPolicyInput, UpdateAutomatedReasoningPolicyOutput +] +UPDATE_AUTOMATED_REASONING_POLICY_ANNOTATIONS: APIOperation[ + UpdateAutomatedReasoningPolicyAnnotationsInput, + UpdateAutomatedReasoningPolicyAnnotationsOutput, +] +UPDATE_AUTOMATED_REASONING_POLICY_TEST_CASE: APIOperation[ + UpdateAutomatedReasoningPolicyTestCaseInput, + UpdateAutomatedReasoningPolicyTestCaseOutput, +] +UPDATE_CUSTOM_MODEL_DEPLOYMENT: APIOperation[ + UpdateCustomModelDeploymentInput, UpdateCustomModelDeploymentOutput +] +UPDATE_GUARDRAIL: APIOperation[UpdateGuardrailInput, UpdateGuardrailOutput] +UPDATE_MARKETPLACE_MODEL_ENDPOINT: APIOperation[ + UpdateMarketplaceModelEndpointInput, UpdateMarketplaceModelEndpointOutput +] +UPDATE_PROVISIONED_MODEL_THROUGHPUT: APIOperation[ + UpdateProvisionedModelThroughputInput, UpdateProvisionedModelThroughputOutput +] diff --git a/clients/aws-sdk-cloudtrail/scripts/docs/generate_doc_stubs.py b/clients/aws-sdk-cloudtrail/scripts/docs/generate_doc_stubs.py index 52d470bc..795f2e4b 100644 --- a/clients/aws-sdk-cloudtrail/scripts/docs/generate_doc_stubs.py +++ b/clients/aws-sdk-cloudtrail/scripts/docs/generate_doc_stubs.py @@ -126,7 +126,9 @@ class ClientInfo: class DocStubGenerator: """Generate markdown API Reference stubs for AWS SDK for Python v4 clients.""" - def __init__(self, client_dir: Path, output_dir: Path, service_name: str | None = None) -> None: + def __init__( + self, client_dir: Path, output_dir: Path, service_name: str | None = None + ) -> None: """ Initialize the documentation generator. @@ -190,7 +192,9 @@ def _analyze_client_package(self, package_name: str) -> ClientInfo: required = ("client", "config", "models") missing = [name for name in required if not package.modules.get(name)] if missing: - raise ValueError(f"Missing required modules in {package_name}: {', '.join(missing)}") + raise ValueError( + f"Missing required modules in {package_name}: {', '.join(missing)}" + ) # Parse submodules client_module = package.modules["client"] @@ -199,11 +203,15 @@ def _analyze_client_package(self, package_name: str) -> ClientInfo: client_class = self._find_class_with_suffix(client_module, "Client") if not client_class: - raise ValueError(f"No class ending with 'Client' found in {package_name}.client") + raise ValueError( + f"No class ending with 'Client' found in {package_name}.client" + ) config_class = self._find_class_with_suffix(config_module, "Config") if not config_class: - raise ValueError(f"No class ending with 'Config' found in {package_name}.config") + raise ValueError( + f"No class ending with 'Config' found in {package_name}.config" + ) plugin_alias = config_module.members.get("Plugin") if not plugin_alias: @@ -288,7 +296,9 @@ def _analyze_operation(self, operation: Function) -> OperationInfo: if output_type in stream_type_map: stream_type = stream_type_map[output_type] - stream_args = self._get_subscript_elements(returns, f"'{operation.name}' stream type") + stream_args = self._get_subscript_elements( + returns, f"'{operation.name}' stream type" + ) if stream_type in (StreamType.INPUT, StreamType.DUPLEX): event_input_type = stream_args[0].canonical_name @@ -316,7 +326,9 @@ def _analyze_operation(self, operation: Function) -> OperationInfo: def _get_expr(self, annotation: str | Expr | None, context: str) -> Expr: """Extract and validate an Expr from an annotation.""" if not isinstance(annotation, Expr): - raise TypeError(f"{context}: expected Expr, got {type(annotation).__name__}") + raise TypeError( + f"{context}: expected Expr, got {type(annotation).__name__}" + ) return annotation def _get_subscript_elements(self, expr: Expr, context: str) -> list[Expr]: @@ -330,7 +342,9 @@ def _get_subscript_elements(self, expr: Expr, context: str) -> list[Expr]: return [el for el in slice_expr.elements if isinstance(el, Expr)] return [slice_expr] - def _extract_models(self, models_module: Module, operations: list[OperationInfo]) -> ModelsInfo: + def _extract_models( + self, models_module: Module, operations: list[OperationInfo] + ) -> ModelsInfo: """Extract structures, unions, enums, and errors from models module.""" structures, unions, enums, errors = [], [], [], [] @@ -356,14 +370,16 @@ def _extract_models(self, models_module: Module, operations: list[OperationInfo] duplicates = [] for structure in structures: - if self._is_operation_io_type(structure.name, operations) or self._is_union_member( - structure.name, unions - ): + if self._is_operation_io_type( + structure.name, operations + ) or self._is_union_member(structure.name, unions): duplicates.append(structure) structures = [struct for struct in structures if struct not in duplicates] - return ModelsInfo(structures=structures, unions=unions, enums=enums, errors=errors) + return ModelsInfo( + structures=structures, unions=unions, enums=enums, errors=errors + ) def _is_union(self, member: Object | Alias) -> TypeGuard[Attribute]: """Check if a module member is a union type.""" @@ -399,7 +415,9 @@ def _extract_union_members( for name in member_names: if not (member_object := models_module.members.get(name)): raise ValueError(f"Union member '{name}' not found in models module") - members.append(TypeInfo(name=member_object.name, module_path=member_object.path)) + members.append( + TypeInfo(name=member_object.name, module_path=member_object.path) + ) return members @@ -408,7 +426,8 @@ def _is_enum(self, member: Object | Alias) -> TypeGuard[Class]: if not isinstance(member, Class): return False return any( - isinstance(base, ExprName) and base.name in ENUM_BASE_CLASSES for base in member.bases + isinstance(base, ExprName) and base.name in ENUM_BASE_CLASSES + for base in member.bases ) def _is_error(self, member: Object | Alias) -> TypeGuard[Class]: @@ -416,10 +435,13 @@ def _is_error(self, member: Object | Alias) -> TypeGuard[Class]: if not isinstance(member, Class): return False return any( - isinstance(base, ExprName) and base.name in ERROR_BASE_CLASSES for base in member.bases + isinstance(base, ExprName) and base.name in ERROR_BASE_CLASSES + for base in member.bases ) - def _is_operation_io_type(self, type_name: str, operations: list[OperationInfo]) -> bool: + def _is_operation_io_type( + self, type_name: str, operations: list[OperationInfo] + ) -> bool: """Check if a type is used as operation input/output.""" return any(type_name in (op.input.name, op.output.name) for op in operations) @@ -437,8 +459,12 @@ def _generate_client_docs(self, client_info: ClientInfo) -> bool: self._generate_type_stubs( client_info.models.structures, "structures", "Structure Class" ) - self._generate_type_stubs(client_info.models.errors, "errors", "Error Class") - self._generate_type_stubs(client_info.models.enums, "enums", "Enum Class", members=True) + self._generate_type_stubs( + client_info.models.errors, "errors", "Error Class" + ) + self._generate_type_stubs( + client_info.models.enums, "enums", "Enum Class", members=True + ) self._generate_union_stubs(client_info.models.unions) except OSError as e: logger.error(f"Failed to write documentation files: {e}") @@ -470,7 +496,9 @@ def _generate_index(self, client_info: ClientInfo) -> None: ] for method in sorted(client_info.client_methods, key=lambda x: x.name): - lines.extend([*self._mkdocs_directive(method.module_path, heading_level=4), ""]) + lines.extend( + [*self._mkdocs_directive(method.module_path, heading_level=4), ""] + ) # Operations section if client_info.operations: @@ -578,7 +606,9 @@ def _generate_operation_stubs(self, operations: list[OperationInfo]) -> None: output_path = self.output_dir / "operations" / f"{op.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb("Operations", op.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb("Operations", op.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(operations)} operation file(s)") @@ -600,7 +630,9 @@ def _generate_type_stubs( output_path = self.output_dir / category / f"{item.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb(category.title(), item.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb(category.title(), item.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(items)} {category} file(s)") @@ -624,7 +656,9 @@ def _generate_union_stubs(self, unions: list[UnionInfo]) -> None: output_path = self.output_dir / "unions" / f"{union.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb("Unions", union.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb("Unions", union.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(unions)} union file(s)") diff --git a/clients/aws-sdk-cloudtrail/src/aws_sdk_cloudtrail/_private/schemas.py b/clients/aws-sdk-cloudtrail/src/aws_sdk_cloudtrail/_private/schemas.py index 3f58c2db..c1b31211 100644 --- a/clients/aws-sdk-cloudtrail/src/aws_sdk_cloudtrail/_private/schemas.py +++ b/clients/aws-sdk-cloudtrail/src/aws_sdk_cloudtrail/_private/schemas.py @@ -2,5083 +2,5479 @@ from types import MappingProxyType -from smithy_core.prelude import UNIT -from smithy_core.schemas import Schema -from smithy_core.shapes import ShapeID, ShapeType -from smithy_core.traits import Trait - - -ERROR_MESSAGE = Schema( - id=ShapeID("com.amazonaws.cloudtrail#ErrorMessage"), shape_type=ShapeType.STRING -) - -ACCESS_DENIED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#AccessDeniedException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=403), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "ResourceAccessDenied", "httpResponseCode": 403} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -ACCOUNT_HAS_ONGOING_IMPORT_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#AccountHasOngoingImportException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "AccountHasOngoingImport", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, +from smithy_core._schema_compact import StaticOperationSchema, StaticSchema + + +n0 = "com.amazonaws.cloudtrail" +_EM = "ErrorMessage" +_ADE = "AccessDeniedException" +_s = "smithy.api#error" +_c = "client" +_sE = "smithy.api#httpError" +_M = "Message" +_AHOIE = "AccountHasOngoingImportException" +_AI = "AccountId" +_ANFE = "AccountNotFoundException" +_ANRE = "AccountNotRegisteredException" +_ARE = "AccountRegisteredException" +_S = "String" +_TK = "TagKey" +_TV = "TagValue" +_T = "Tag" +_K = "Key" +_sm = "smithy.api#required" +_V = "Value" +_TL = "TagsList" +_m = "member" +_ATI = "AddTagsInput" +_sSI = "smithy.synthetic#originalShapeId" +_cATR = "com.amazonaws.cloudtrail#AddTagsRequest" +_smi = "smithy.api#input" +_RI = "ResourceId" +_ATO = "AddTagsOutput" +_cATRo = "com.amazonaws.cloudtrail#AddTagsResponse" +_smit = "smithy.api#output" +_CARNIE = "ChannelARNInvalidException" +_CNFE = "ChannelNotFoundException" +_CTARNIE = "CloudTrailARNInvalidException" +_CE = "ConflictException" +_EDSARNIE = "EventDataStoreARNInvalidException" +_EDSNFE = "EventDataStoreNotFoundException" +_IEDSE = "InactiveEventDataStoreException" +_ITPE = "InvalidTagParameterException" +_ITNE = "InvalidTrailNameException" +_NMASLREE = "NoManagementAccountSLRExistsException" +_NOMAE = "NotOrganizationMasterAccountException" +_ONPE = "OperationNotPermittedException" +_RNFE = "ResourceNotFoundException" +_RTNSE = "ResourceTypeNotSupportedException" +_TLEE = "TagsLimitExceededException" +_UOE = "UnsupportedOperationException" +_AT = "AddTags" +_OV = "OperatorValue" +_O = "Operator" +_SF = "SelectorField" +_AFS = "AdvancedFieldSelector" +_F = "Field" +_E = "Equals" +_SW = "StartsWith" +_EW = "EndsWith" +_NE = "NotEquals" +_NSW = "NotStartsWith" +_NEW = "NotEndsWith" +_AFSd = "AdvancedFieldSelectors" +_SN = "SelectorName" +_AES = "AdvancedEventSelector" +_N = "Name" +_FS = "FieldSelectors" +_AESd = "AdvancedEventSelectors" +_ECA = "EventCategoryAggregation" +_D = "Data" +_sV = "smithy.api#enumValue" +_Te = "Template" +_AA = "API_ACTIVITY" +_RA = "RESOURCE_ACCESS" +_UA = "USER_ACTIONS" +_Tem = "Templates" +_AC = "AggregationConfiguration" +_EC = "EventCategory" +_ACg = "AggregationConfigurations" +_BM = "BillingMode" +_ERP = "EXTENDABLE_RETENTION_PRICING" +_FRP = "FIXED_RETENTION_PRICING" +_B = "Boolean" +_BB = "ByteBuffer" +_EDSA = "EventDataStoreArn" +_UUID = "UUID" +_CQI = "CancelQueryInput" +_cCQR = "com.amazonaws.cloudtrail#CancelQueryRequest" +_EDS = "EventDataStore" +_QI = "QueryId" +_EDSOAI = "EventDataStoreOwnerAccountId" +_QS = "QueryStatus" +_QUEUED = "QUEUED" +_RUNNING = "RUNNING" +_FINISHED = "FINISHED" +_FAILED = "FAILED" +_CANCELLED = "CANCELLED" +_TO = "TIMED_OUT" +_CQO = "CancelQueryOutput" +_cCQRo = "com.amazonaws.cloudtrail#CancelQueryResponse" +_IQE = "InactiveQueryException" +_IPE = "InvalidParameterException" +_QINFE = "QueryIdNotFoundException" +_CQ = "CancelQuery" +_CDMAE = "CannotDelegateManagementAccountException" +_CA = "ChannelArn" +_CN = "ChannelName" +_C = "Channel" +_CAEE = "ChannelAlreadyExistsException" +_CEFEDSE = "ChannelExistsForEDSException" +_CMLEE = "ChannelMaxLimitExceededException" +_Ch = "Channels" +_L = "Location" +_DT = "DestinationType" +_EDS_ = "EVENT_DATA_STORE" +_AS = "AWS_SERVICE" +_De = "Destination" +_Ty = "Type" +_Des = "Destinations" +_So = "Source" +_CCI = "CreateChannelInput" +_cCCR = "com.amazonaws.cloudtrail#CreateChannelRequest" +_Ta = "Tags" +_CCO = "CreateChannelOutput" +_cCCRo = "com.amazonaws.cloudtrail#CreateChannelResponse" +_IEDSCE = "InvalidEventDataStoreCategoryException" +_ISE = "InvalidSourceException" +_CC = "CreateChannel" +_DN = "DashboardName" +_RSFU = "RefreshScheduleFrequencyUnit" +_HOURS = "HOURS" +_DAYS = "DAYS" +_RSFV = "RefreshScheduleFrequencyValue" +_RSF = "RefreshScheduleFrequency" +_U = "Unit" +_RSS = "RefreshScheduleStatus" +_ENABLED = "ENABLED" +_DISABLED = "DISABLED" +_TOD = "TimeOfDay" +_RS = "RefreshSchedule" +_Fr = "Frequency" +_St = "Status" +_TPE = "TerminationProtectionEnabled" +_QP = "QueryParameter" +_QPu = "QueryParameters" +_QSu = "QueryStatement" +_VPK = "ViewPropertiesKey" +_VPV = "ViewPropertiesValue" +_VPM = "ViewPropertiesMap" +_k = "key" +_v = "value" +_RW = "RequestWidget" +_VP = "ViewProperties" +_RWL = "RequestWidgetList" +_CDI = "CreateDashboardInput" +_cCDR = "com.amazonaws.cloudtrail#CreateDashboardRequest" +_W = "Widgets" +_DA = "DashboardArn" +_DTa = "DashboardType" +_MANAGED = "MANAGED" +_CUSTOM = "CUSTOM" +_QA = "QueryAlias" +_Wi = "Widget" +_WL = "WidgetList" +_CDO = "CreateDashboardOutput" +_cCDRo = "com.amazonaws.cloudtrail#CreateDashboardResponse" +_IEPE = "InsufficientEncryptionPolicyException" +_IQSE = "InvalidQueryStatementException" +_SQEE = "ServiceQuotaExceededException" +_CD = "CreateDashboard" +_CTANEE = "CloudTrailAccessNotEnabledException" +_EDSKKI = "EventDataStoreKmsKeyId" +_EDSN = "EventDataStoreName" +_RP = "RetentionPeriod" +_CEDSI = "CreateEventDataStoreInput" +_cCEDSR = "com.amazonaws.cloudtrail#CreateEventDataStoreRequest" +_MRE = "MultiRegionEnabled" +_OE = "OrganizationEnabled" +_KKI = "KmsKeyId" +_SI = "StartIngestion" +_Da = "Date" +_EDSS = "EventDataStoreStatus" +_CREATED = "CREATED" +_PD = "PENDING_DELETION" +_SI_ = "STARTING_INGESTION" +_SI__ = "STOPPING_INGESTION" +_SI___ = "STOPPED_INGESTION" +_CEDSO = "CreateEventDataStoreOutput" +_cCEDSRo = "com.amazonaws.cloudtrail#CreateEventDataStoreResponse" +_CT = "CreatedTimestamp" +_UT = "UpdatedTimestamp" +_EDSAEE = "EventDataStoreAlreadyExistsException" +_EDSMLEE = "EventDataStoreMaxLimitExceededException" +_IDSAPE = "InsufficientDependencyServiceAccessPermissionException" +_IESE = "InvalidEventSelectorsException" +_IKKIE = "InvalidKmsKeyIdException" +_KE = "KmsException" +_KKNFE = "KmsKeyNotFoundException" +_ONIAFME = "OrganizationNotInAllFeaturesModeException" +_ONIUE = "OrganizationsNotInUseException" +_TE = "ThrottlingException" +_CEDS = "CreateEventDataStore" +_CTICTIE = "CloudTrailInvalidClientTokenIdException" +_CWLDUE = "CloudWatchLogsDeliveryUnavailableException" +_CTI = "CreateTrailInput" +_cCTR = "com.amazonaws.cloudtrail#CreateTrailRequest" +_SBN = "S3BucketName" +_SKP = "S3KeyPrefix" +_STN = "SnsTopicName" +_IGSE = "IncludeGlobalServiceEvents" +_IMRT = "IsMultiRegionTrail" +_ELFV = "EnableLogFileValidation" +_CWLLGA = "CloudWatchLogsLogGroupArn" +_CWLRA = "CloudWatchLogsRoleArn" +_IOT = "IsOrganizationTrail" +_RL = "RecursiveLogging" +_CTO = "CreateTrailOutput" +_cCTRo = "com.amazonaws.cloudtrail#CreateTrailResponse" +_STARN = "SnsTopicARN" +_TARN = "TrailARN" +_LFVE = "LogFileValidationEnabled" +_ISBPE = "InsufficientS3BucketPolicyException" +_ISTPE = "InsufficientSnsTopicPolicyException" +_ICWLLGAE = "InvalidCloudWatchLogsLogGroupArnException" +_ICWLRAE = "InvalidCloudWatchLogsRoleArnException" +_IPCE = "InvalidParameterCombinationException" +_ISBNE = "InvalidS3BucketNameException" +_ISPE = "InvalidS3PrefixException" +_ISTNE = "InvalidSnsTopicNameException" +_KKDE = "KmsKeyDisabledException" +_MNOTEE = "MaximumNumberOfTrailsExceededException" +_SBDNEE = "S3BucketDoesNotExistException" +_TAEE = "TrailAlreadyExistsException" +_TNPE = "TrailNotProvidedException" +_CTr = "CreateTrail" +_DCI = "DeleteChannelInput" +_cDCR = "com.amazonaws.cloudtrail#DeleteChannelRequest" +_DCO = "DeleteChannelOutput" +_cDCRo = "com.amazonaws.cloudtrail#DeleteChannelResponse" +_DC = "DeleteChannel" +_DDI = "DeleteDashboardInput" +_cDDR = "com.amazonaws.cloudtrail#DeleteDashboardRequest" +_DI = "DashboardId" +_DDO = "DeleteDashboardOutput" +_cDDRo = "com.amazonaws.cloudtrail#DeleteDashboardResponse" +_DD = "DeleteDashboard" +_DEDSI = "DeleteEventDataStoreInput" +_cDEDSR = "com.amazonaws.cloudtrail#DeleteEventDataStoreRequest" +_DEDSO = "DeleteEventDataStoreOutput" +_cDEDSRo = "com.amazonaws.cloudtrail#DeleteEventDataStoreResponse" +_EDSFEE = "EventDataStoreFederationEnabledException" +_EDSHOIE = "EventDataStoreHasOngoingImportException" +_EDSTPE = "EventDataStoreTerminationProtectedException" +_DEDS = "DeleteEventDataStore" +_RAe = "ResourceArn" +_DRPI = "DeleteResourcePolicyInput" +_cDRPR = "com.amazonaws.cloudtrail#DeleteResourcePolicyRequest" +_DRPO = "DeleteResourcePolicyOutput" +_cDRPRo = "com.amazonaws.cloudtrail#DeleteResourcePolicyResponse" +_RARNNVE = "ResourceARNNotValidException" +_RPNFE = "ResourcePolicyNotFoundException" +_DRP = "DeleteResourcePolicy" +_DTI = "DeleteTrailInput" +_cDTR = "com.amazonaws.cloudtrail#DeleteTrailRequest" +_DTO = "DeleteTrailOutput" +_cDTRo = "com.amazonaws.cloudtrail#DeleteTrailResponse" +_IHRE = "InvalidHomeRegionException" +_TNFE = "TrailNotFoundException" +_DTe = "DeleteTrail" +_DODAI = "DeregisterOrganizationDelegatedAdminInput" +_cDODAR = "com.amazonaws.cloudtrail#DeregisterOrganizationDelegatedAdminRequest" +_DAAI = "DelegatedAdminAccountId" +_DODAO = "DeregisterOrganizationDelegatedAdminOutput" +_cDODARo = "com.amazonaws.cloudtrail#DeregisterOrganizationDelegatedAdminResponse" +_NOMAEo = "NotOrganizationManagementAccountException" +_DODA = "DeregisterOrganizationDelegatedAdmin" +_RIe = "RefreshId" +_DQI = "DescribeQueryInput" +_cDQR = "com.amazonaws.cloudtrail#DescribeQueryRequest" +_DSU = "DeliveryS3Uri" +_DS = "DeliveryStatus" +_SUCCESS = "SUCCESS" +_FSF = "FAILED_SIGNING_FILE" +_PENDING = "PENDING" +_RNF = "RESOURCE_NOT_FOUND" +_AD = "ACCESS_DENIED" +_ADSF = "ACCESS_DENIED_SIGNING_FILE" +_UNKNOWN = "UNKNOWN" +_P = "Prompt" +_Lo = "Long" +_I = "Integer" +_QSFDQ = "QueryStatisticsForDescribeQuery" +_EMv = "EventsMatched" +_ES = "EventsScanned" +_BS = "BytesScanned" +_ETIM = "ExecutionTimeInMillis" +_CTre = "CreationTime" +_DQO = "DescribeQueryOutput" +_cDQRo = "com.amazonaws.cloudtrail#DescribeQueryResponse" +_QSue = "QueryString" +_QSuer = "QueryStatistics" +_DQ = "DescribeQuery" +_TNL = "TrailNameList" +_DTIe = "DescribeTrailsInput" +_cDTRom = "com.amazonaws.cloudtrail#DescribeTrailsRequest" +_tNL = "trailNameList" +_iST = "includeShadowTrails" +_Tr = "Trail" +_HR = "HomeRegion" +_HCES = "HasCustomEventSelectors" +_HIS = "HasInsightSelectors" +_TLr = "TrailList" +_DTOe = "DescribeTrailsOutput" +_cDTRoma = "com.amazonaws.cloudtrail#DescribeTrailsResponse" +_tL = "trailList" +_DTes = "DescribeTrails" +_CME = "ConcurrentModificationException" +_DFI = "DisableFederationInput" +_cDFR = "com.amazonaws.cloudtrail#DisableFederationRequest" +_FSe = "FederationStatus" +_ENABLING = "ENABLING" +_DISABLING = "DISABLING" +_DFO = "DisableFederationOutput" +_cDFRo = "com.amazonaws.cloudtrail#DisableFederationResponse" +_DF = "DisableFederation" +_FRA = "FederationRoleArn" +_EFI = "EnableFederationInput" +_cEFR = "com.amazonaws.cloudtrail#EnableFederationRequest" +_EFO = "EnableFederationOutput" +_cEFRo = "com.amazonaws.cloudtrail#EnableFederationResponse" +_EF = "EnableFederation" +_EDSL = "EventDataStoreList" +_GQI = "GenerateQueryInput" +_cGQR = "com.amazonaws.cloudtrail#GenerateQueryRequest" +_EDSv = "EventDataStores" +_GQO = "GenerateQueryOutput" +_cGQRo = "com.amazonaws.cloudtrail#GenerateQueryResponse" +_GRE = "GenerateResponseException" +_GQ = "GenerateQuery" +_GCI = "GetChannelInput" +_cGCR = "com.amazonaws.cloudtrail#GetChannelRequest" +_IS = "IngestionStatus" +_LIST = "LatestIngestionSuccessTime" +_LISEID = "LatestIngestionSuccessEventID" +_LIEC = "LatestIngestionErrorCode" +_LIAT = "LatestIngestionAttemptTime" +_LIAEID = "LatestIngestionAttemptEventID" +_SC = "SourceConfig" +_ATAR = "ApplyToAllRegions" +_GCO = "GetChannelOutput" +_cGCRo = "com.amazonaws.cloudtrail#GetChannelResponse" +_GC = "GetChannel" +_GDI = "GetDashboardInput" +_cGDR = "com.amazonaws.cloudtrail#GetDashboardRequest" +_DSa = "DashboardStatus" +_CREATING = "CREATING" +_UPDATING = "UPDATING" +_UPDATED = "UPDATED" +_DELETING = "DELETING" +_GDO = "GetDashboardOutput" +_cGDRo = "com.amazonaws.cloudtrail#GetDashboardResponse" +_LRI = "LastRefreshId" +_LRFR = "LastRefreshFailureReason" +_GD = "GetDashboard" +_GECI = "GetEventConfigurationInput" +_cGECR = "com.amazonaws.cloudtrail#GetEventConfigurationRequest" +_TN = "TrailName" +_OTLM = "OperatorTargetListMember" +_OTL = "OperatorTargetList" +_TC = "TagContext" +_RC = "RequestContext" +_CKS = "ContextKeySelector" +_CKSo = "ContextKeySelectors" +_MES = "MaxEventSize" +_Sta = "Standard" +_La = "Large" +_GECO = "GetEventConfigurationOutput" +_cGECRo = "com.amazonaws.cloudtrail#GetEventConfigurationResponse" +_IEDSSE = "InvalidEventDataStoreStatusException" +_GEC = "GetEventConfiguration" +_GEDSI = "GetEventDataStoreInput" +_cGEDSR = "com.amazonaws.cloudtrail#GetEventDataStoreRequest" +_PKN = "PartitionKeyName" +_PKT = "PartitionKeyType" +_PK = "PartitionKey" +_PKL = "PartitionKeyList" +_GEDSO = "GetEventDataStoreOutput" +_cGEDSRo = "com.amazonaws.cloudtrail#GetEventDataStoreResponse" +_PKa = "PartitionKeys" +_GEDS = "GetEventDataStore" +_GESI = "GetEventSelectorsInput" +_cGESR = "com.amazonaws.cloudtrail#GetEventSelectorsRequest" +_DRV = "DataResourceValues" +_DR = "DataResource" +_Va = "Values" +_DRa = "DataResources" +_EMES = "ExcludeManagementEventSources" +_RWT = "ReadWriteType" +_RO = "ReadOnly" +_WO = "WriteOnly" +_A = "All" +_ESv = "EventSelector" +_IME = "IncludeManagementEvents" +_ESve = "EventSelectors" +_GESO = "GetEventSelectorsOutput" +_cGESRo = "com.amazonaws.cloudtrail#GetEventSelectorsResponse" +_GES = "GetEventSelectors" +_GII = "GetImportInput" +_cGIR = "com.amazonaws.cloudtrail#GetImportRequest" +_II = "ImportId" +_ID = "ImportDestinations" +_SIS = "S3ImportSource" +_SLU = "S3LocationUri" +_SBR = "S3BucketRegion" +_SBARA = "S3BucketAccessRoleArn" +_ISm = "ImportSource" +_S_ = "S3" +_ISmp = "ImportStatistics" +_PF = "PrefixesFound" +_PC = "PrefixesCompleted" +_FC = "FilesCompleted" +_ECv = "EventsCompleted" +_FE = "FailedEntries" +_ISmpo = "ImportStatus" +_INITIALIZING = "INITIALIZING" +_IP = "IN_PROGRESS" +_STOPPED = "STOPPED" +_COMPLETED = "COMPLETED" +_GIO = "GetImportOutput" +_cGIRo = "com.amazonaws.cloudtrail#GetImportResponse" +_SET = "StartEventTime" +_EET = "EndEventTime" +_INFE = "ImportNotFoundException" +_GI = "GetImport" +_GISI = "GetInsightSelectorsInput" +_cGISR = "com.amazonaws.cloudtrail#GetInsightSelectorsRequest" +_SEC = "SourceEventCategory" +_Ma = "Management" +_SECo = "SourceEventCategories" +_IT = "InsightType" +_ACRI = "ApiCallRateInsight" +_AERI = "ApiErrorRateInsight" +_ISn = "InsightSelector" +_ECve = "EventCategories" +_ISns = "InsightSelectors" +_GISO = "GetInsightSelectorsOutput" +_cGISRo = "com.amazonaws.cloudtrail#GetInsightSelectorsResponse" +_IDn = "InsightsDestination" +_INEE = "InsightNotEnabledException" +_GIS = "GetInsightSelectors" +_MQR = "MaxQueryResults" +_PT = "PaginationToken" +_GQRI = "GetQueryResultsInput" +_cGQRR = "com.amazonaws.cloudtrail#GetQueryResultsRequest" +_NT = "NextToken" +_QRK = "QueryResultKey" +_QRV = "QueryResultValue" +_QRC = "QueryResultColumn" +_QRR = "QueryResultRow" +_QRRu = "QueryResultRows" +_RCe = "ResultsCount" +_TRC = "TotalResultsCount" +_GQRO = "GetQueryResultsOutput" +_cGQRRo = "com.amazonaws.cloudtrail#GetQueryResultsResponse" +_IMRE = "InvalidMaxResultsException" +_INTE = "InvalidNextTokenException" +_GQR = "GetQueryResults" +_GRPI = "GetResourcePolicyInput" +_cGRPR = "com.amazonaws.cloudtrail#GetResourcePolicyRequest" +_RPe = "ResourcePolicy" +_GRPO = "GetResourcePolicyOutput" +_cGRPRo = "com.amazonaws.cloudtrail#GetResourcePolicyResponse" +_DARP = "DelegatedAdminResourcePolicy" +_GRP = "GetResourcePolicy" +_GTI = "GetTrailInput" +_cGTR = "com.amazonaws.cloudtrail#GetTrailRequest" +_GTO = "GetTrailOutput" +_cGTRo = "com.amazonaws.cloudtrail#GetTrailResponse" +_GT = "GetTrail" +_GTSI = "GetTrailStatusInput" +_cGTSR = "com.amazonaws.cloudtrail#GetTrailStatusRequest" +_GTSO = "GetTrailStatusOutput" +_cGTSRo = "com.amazonaws.cloudtrail#GetTrailStatusResponse" +_IL = "IsLogging" +_LDE = "LatestDeliveryError" +_LNE = "LatestNotificationError" +_LDT = "LatestDeliveryTime" +_LNT = "LatestNotificationTime" +_SLT = "StartLoggingTime" +_SLTt = "StopLoggingTime" +_LCWLDE = "LatestCloudWatchLogsDeliveryError" +_LCWLDT = "LatestCloudWatchLogsDeliveryTime" +_LDDT = "LatestDigestDeliveryTime" +_LDDE = "LatestDigestDeliveryError" +_LDAT = "LatestDeliveryAttemptTime" +_LNAT = "LatestNotificationAttemptTime" +_LNAS = "LatestNotificationAttemptSucceeded" +_LDAS = "LatestDeliveryAttemptSucceeded" +_TLS = "TimeLoggingStarted" +_TLSi = "TimeLoggingStopped" +_GTS = "GetTrailStatus" +_LCMRC = "ListChannelsMaxResultsCount" +_LCI = "ListChannelsInput" +_cLCR = "com.amazonaws.cloudtrail#ListChannelsRequest" +_MR = "MaxResults" +_LCO = "ListChannelsOutput" +_cLCRo = "com.amazonaws.cloudtrail#ListChannelsResponse" +_LC = "ListChannels" +_LDMRC = "ListDashboardsMaxResultsCount" +_LDI = "ListDashboardsInput" +_cLDR = "com.amazonaws.cloudtrail#ListDashboardsRequest" +_NP = "NamePrefix" +_DDa = "DashboardDetail" +_Das = "Dashboards" +_LDO = "ListDashboardsOutput" +_cLDRo = "com.amazonaws.cloudtrail#ListDashboardsResponse" +_LD = "ListDashboards" +_LEDSMRC = "ListEventDataStoresMaxResultsCount" +_LEDSI = "ListEventDataStoresInput" +_cLEDSR = "com.amazonaws.cloudtrail#ListEventDataStoresRequest" +_LEDSO = "ListEventDataStoresOutput" +_cLEDSRo = "com.amazonaws.cloudtrail#ListEventDataStoresResponse" +_LEDS = "ListEventDataStores" +_LIFMRC = "ListImportFailuresMaxResultsCount" +_LIFI = "ListImportFailuresInput" +_cLIFR = "com.amazonaws.cloudtrail#ListImportFailuresRequest" +_IFS = "ImportFailureStatus" +_RETRY = "RETRY" +_SUCCEEDED = "SUCCEEDED" +_IFLI = "ImportFailureListItem" +_ET = "ErrorType" +_LUT = "LastUpdatedTime" +_IFL = "ImportFailureList" +_LIFO = "ListImportFailuresOutput" +_cLIFRo = "com.amazonaws.cloudtrail#ListImportFailuresResponse" +_Fa = "Failures" +_LIF = "ListImportFailures" +_LIMRC = "ListImportsMaxResultsCount" +_LII = "ListImportsInput" +_cLIR = "com.amazonaws.cloudtrail#ListImportsRequest" +_ILI = "ImportsListItem" +_ILm = "ImportsList" +_LIO = "ListImportsOutput" +_cLIRo = "com.amazonaws.cloudtrail#ListImportsResponse" +_Im = "Imports" +_LI = "ListImports" +_LIDT = "ListInsightsDataType" +_IE = "INSIGHTS_EVENTS" +_IEn = "InsightsEvents" +_LIDDK = "ListInsightsDataDimensionKey" +_EI = "EVENT_ID" +_EIv = "EventId" +_EN = "EVENT_NAME" +_ENv = "EventName" +_ES_ = "EVENT_SOURCE" +_ESven = "EventSource" +_LIDDV = "ListInsightsDataDimensionValue" +_LIDD = "ListInsightsDataDimensions" +_LIDMRC = "ListInsightsDataMaxResultsCount" +_LIDI = "ListInsightsDataInput" +_cLIDR = "com.amazonaws.cloudtrail#ListInsightsDataRequest" +_ISnsi = "InsightSource" +_DTat = "DataType" +_Di = "Dimensions" +_ST = "StartTime" +_ETn = "EndTime" +_R = "Resource" +_RT = "ResourceType" +_RN = "ResourceName" +_RLe = "ResourceList" +_Ev = "Event" +_AKI = "AccessKeyId" +_ETv = "EventTime" +_Us = "Username" +_Re = "Resources" +_CTE = "CloudTrailEvent" +_EL = "EventsList" +_LIDO = "ListInsightsDataOutput" +_cLIDRo = "com.amazonaws.cloudtrail#ListInsightsDataResponse" +_Eve = "Events" +_LID = "ListInsightsData" +_IMDT = "InsightsMetricDataType" +_FWZ = "FILL_WITH_ZEROS" +_FWZi = "FillWithZeros" +_NZD = "NON_ZERO_DATA" +_NZDo = "NonZeroData" +_ECr = "ErrorCode" +_IMMR = "InsightsMetricMaxResults" +_IMNT = "InsightsMetricNextToken" +_IMP = "InsightsMetricPeriod" +_LIMDI = "ListInsightsMetricDataInput" +_cLIMDR = "com.amazonaws.cloudtrail#ListInsightsMetricDataRequest" +_Pe = "Period" +_Ti = "Timestamps" +_Do = "Double" +_IMV = "InsightsMetricValues" +_LIMDO = "ListInsightsMetricDataOutput" +_cLIMDRo = "com.amazonaws.cloudtrail#ListInsightsMetricDataResponse" +_LIMD = "ListInsightsMetricData" +_ITRE = "InvalidTimeRangeException" +_ITE = "InvalidTokenException" +_LPKI = "ListPublicKeysInput" +_cLPKR = "com.amazonaws.cloudtrail#ListPublicKeysRequest" +_PKu = "PublicKey" +_VST = "ValidityStartTime" +_VET = "ValidityEndTime" +_Fi = "Fingerprint" +_PKLu = "PublicKeyList" +_LPKO = "ListPublicKeysOutput" +_cLPKRo = "com.amazonaws.cloudtrail#ListPublicKeysResponse" +_LPK = "ListPublicKeys" +_IDRE = "InvalidDateRangeException" +_IQSEn = "InvalidQueryStatusException" +_LQMRC = "ListQueriesMaxResultsCount" +_LQI = "ListQueriesInput" +_cLQR = "com.amazonaws.cloudtrail#ListQueriesRequest" +_Q = "Query" +_Qu = "Queries" +_LQO = "ListQueriesOutput" +_cLQRo = "com.amazonaws.cloudtrail#ListQueriesResponse" +_LQ = "ListQueries" +_RIL = "ResourceIdList" +_LTI = "ListTagsInput" +_cLTR = "com.amazonaws.cloudtrail#ListTagsRequest" +_RTe = "ResourceTag" +_RTL = "ResourceTagList" +_LTO = "ListTagsOutput" +_cLTRo = "com.amazonaws.cloudtrail#ListTagsResponse" +_LT = "ListTags" +_LTIi = "ListTrailsInput" +_cLTRom = "com.amazonaws.cloudtrail#ListTrailsRequest" +_TI = "TrailInfo" +_Tra = "Trails" +_LTOi = "ListTrailsOutput" +_cLTRoma = "com.amazonaws.cloudtrail#ListTrailsResponse" +_LTi = "ListTrails" +_IECE = "InvalidEventCategoryException" +_ILAE = "InvalidLookupAttributesException" +_In = "Insight" +_i = "insight" +_LAK = "LookupAttributeKey" +_RO_ = "READ_ONLY" +_USERNAME = "USERNAME" +_RT_ = "RESOURCE_TYPE" +_RN_ = "RESOURCE_NAME" +_AKI_ = "ACCESS_KEY_ID" +_LAV = "LookupAttributeValue" +_LA = "LookupAttribute" +_AK = "AttributeKey" +_AV = "AttributeValue" +_LAL = "LookupAttributesList" +_LEI = "LookupEventsInput" +_cLER = "com.amazonaws.cloudtrail#LookupEventsRequest" +_LAo = "LookupAttributes" +_LEO = "LookupEventsOutput" +_cLERo = "com.amazonaws.cloudtrail#LookupEventsResponse" +_LE = "LookupEvents" +_IIAMAPE = "InsufficientIAMAccessPermissionException" +_PECI = "PutEventConfigurationInput" +_cPECR = "com.amazonaws.cloudtrail#PutEventConfigurationRequest" +_PECO = "PutEventConfigurationOutput" +_cPECRo = "com.amazonaws.cloudtrail#PutEventConfigurationResponse" +_PEC = "PutEventConfiguration" +_PESI = "PutEventSelectorsInput" +_cPESR = "com.amazonaws.cloudtrail#PutEventSelectorsRequest" +_PESO = "PutEventSelectorsOutput" +_cPESRo = "com.amazonaws.cloudtrail#PutEventSelectorsResponse" +_PES = "PutEventSelectors" +_IISE = "InvalidInsightSelectorsException" +_PISI = "PutInsightSelectorsInput" +_cPISR = "com.amazonaws.cloudtrail#PutInsightSelectorsRequest" +_PISO = "PutInsightSelectorsOutput" +_cPISRo = "com.amazonaws.cloudtrail#PutInsightSelectorsResponse" +_PIS = "PutInsightSelectors" +_PRPI = "PutResourcePolicyInput" +_cPRPR = "com.amazonaws.cloudtrail#PutResourcePolicyRequest" +_PRPO = "PutResourcePolicyOutput" +_cPRPRo = "com.amazonaws.cloudtrail#PutResourcePolicyResponse" +_RPNVE = "ResourcePolicyNotValidException" +_PRP = "PutResourcePolicy" +_DAALEE = "DelegatedAdminAccountLimitExceededException" +_RODAI = "RegisterOrganizationDelegatedAdminInput" +_cRODAR = "com.amazonaws.cloudtrail#RegisterOrganizationDelegatedAdminRequest" +_MAI = "MemberAccountId" +_RODAO = "RegisterOrganizationDelegatedAdminOutput" +_cRODARo = "com.amazonaws.cloudtrail#RegisterOrganizationDelegatedAdminResponse" +_RODA = "RegisterOrganizationDelegatedAdmin" +_RTI = "RemoveTagsInput" +_cRTR = "com.amazonaws.cloudtrail#RemoveTagsRequest" +_RTO = "RemoveTagsOutput" +_cRTRo = "com.amazonaws.cloudtrail#RemoveTagsResponse" +_RTem = "RemoveTags" +_REDSI = "RestoreEventDataStoreInput" +_cREDSR = "com.amazonaws.cloudtrail#RestoreEventDataStoreRequest" +_REDSO = "RestoreEventDataStoreOutput" +_cREDSRo = "com.amazonaws.cloudtrail#RestoreEventDataStoreResponse" +_REDS = "RestoreEventDataStore" +_SSQMR = "SearchSampleQueriesMaxResults" +_SSQSP = "SearchSampleQueriesSearchPhrase" +_SSQI = "SearchSampleQueriesInput" +_cSSQR = "com.amazonaws.cloudtrail#SearchSampleQueriesRequest" +_SP = "SearchPhrase" +_SQD = "SampleQueryDescription" +_SQN = "SampleQueryName" +_SQR = "SampleQueryRelevance" +_smith = "smithy.api#default" +_SQSQL = "SampleQuerySQL" +_SSQSR = "SearchSampleQueriesSearchResult" +_Desc = "Description" +_SQL = "SQL" +_Rel = "Relevance" +_SSQSRe = "SearchSampleQueriesSearchResults" +_SSQO = "SearchSampleQueriesOutput" +_cSSQRo = "com.amazonaws.cloudtrail#SearchSampleQueriesResponse" +_SR = "SearchResults" +_SSQ = "SearchSampleQueries" +_QPK = "QueryParameterKey" +_QPV = "QueryParameterValue" +_QPVu = "QueryParameterValues" +_SDRI = "StartDashboardRefreshInput" +_cSDRR = "com.amazonaws.cloudtrail#StartDashboardRefreshRequest" +_SDRO = "StartDashboardRefreshOutput" +_cSDRRo = "com.amazonaws.cloudtrail#StartDashboardRefreshResponse" +_SDR = "StartDashboardRefresh" +_SEDSII = "StartEventDataStoreIngestionInput" +_cSEDSIR = "com.amazonaws.cloudtrail#StartEventDataStoreIngestionRequest" +_SEDSIO = "StartEventDataStoreIngestionOutput" +_cSEDSIRo = "com.amazonaws.cloudtrail#StartEventDataStoreIngestionResponse" +_SEDSI = "StartEventDataStoreIngestion" +_IISEn = "InvalidImportSourceException" +_SII = "StartImportInput" +_cSIR = "com.amazonaws.cloudtrail#StartImportRequest" +_SIO = "StartImportOutput" +_cSIRo = "com.amazonaws.cloudtrail#StartImportResponse" +_SIt = "StartImport" +_SLI = "StartLoggingInput" +_cSLR = "com.amazonaws.cloudtrail#StartLoggingRequest" +_SLO = "StartLoggingOutput" +_cSLRo = "com.amazonaws.cloudtrail#StartLoggingResponse" +_SL = "StartLogging" +_MCQE = "MaxConcurrentQueriesException" +_SQI = "StartQueryInput" +_cSQR = "com.amazonaws.cloudtrail#StartQueryRequest" +_SQO = "StartQueryOutput" +_cSQRo = "com.amazonaws.cloudtrail#StartQueryResponse" +_SQ = "StartQuery" +_SEDSIIt = "StopEventDataStoreIngestionInput" +_cSEDSIRom = "com.amazonaws.cloudtrail#StopEventDataStoreIngestionRequest" +_SEDSIOt = "StopEventDataStoreIngestionOutput" +_cSEDSIRoma = "com.amazonaws.cloudtrail#StopEventDataStoreIngestionResponse" +_SEDSIt = "StopEventDataStoreIngestion" +_SIIt = "StopImportInput" +_cSIRom = "com.amazonaws.cloudtrail#StopImportRequest" +_SIOt = "StopImportOutput" +_cSIRoma = "com.amazonaws.cloudtrail#StopImportResponse" +_SIto = "StopImport" +_SLIt = "StopLoggingInput" +_cSLRom = "com.amazonaws.cloudtrail#StopLoggingRequest" +_SLOt = "StopLoggingOutput" +_cSLRoma = "com.amazonaws.cloudtrail#StopLoggingResponse" +_SLt = "StopLogging" +_UCI = "UpdateChannelInput" +_cUCR = "com.amazonaws.cloudtrail#UpdateChannelRequest" +_UCO = "UpdateChannelOutput" +_cUCRo = "com.amazonaws.cloudtrail#UpdateChannelResponse" +_UC = "UpdateChannel" +_UDI = "UpdateDashboardInput" +_cUDR = "com.amazonaws.cloudtrail#UpdateDashboardRequest" +_UDO = "UpdateDashboardOutput" +_cUDRo = "com.amazonaws.cloudtrail#UpdateDashboardResponse" +_UD = "UpdateDashboard" +_UEDSI = "UpdateEventDataStoreInput" +_cUEDSR = "com.amazonaws.cloudtrail#UpdateEventDataStoreRequest" +_UEDSO = "UpdateEventDataStoreOutput" +_cUEDSRo = "com.amazonaws.cloudtrail#UpdateEventDataStoreResponse" +_UEDS = "UpdateEventDataStore" +_UTI = "UpdateTrailInput" +_cUTR = "com.amazonaws.cloudtrail#UpdateTrailRequest" +_UTO = "UpdateTrailOutput" +_cUTRo = "com.amazonaws.cloudtrail#UpdateTrailResponse" +_UTp = "UpdateTrail" +_C_ = "CloudTrail_20131101" +_a = "aws.auth#sigv4" +_a_ = "aws.protocols#awsJson1_1" +_sB = "smithy.rules#endpointBdd" +_aw = "aws.api#service" +_sN = "smithy.api#xmlNamespace" + +ERROR_MESSAGE: StaticSchema = (3, n0, _EM, 0) + +ACCESS_DENIED_EXCEPTION: StaticSchema = ( + 18, + n0, + _ADE, + {_s: _c, _sE: 403}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +ACCOUNT_HAS_ONGOING_IMPORT_EXCEPTION: StaticSchema = ( + 18, + n0, + _AHOIE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +ACCOUNT_ID: StaticSchema = (3, n0, _AI, 0) + +ACCOUNT_NOT_FOUND_EXCEPTION: StaticSchema = ( + 18, + n0, + _ANFE, + {_s: _c, _sE: 404}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +ACCOUNT_NOT_REGISTERED_EXCEPTION: StaticSchema = ( + 18, + n0, + _ANRE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +ACCOUNT_REGISTERED_EXCEPTION: StaticSchema = ( + 18, + n0, + _ARE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +STRING: StaticSchema = (3, n0, _S, 0) + +TAG_KEY: StaticSchema = (3, n0, _TK, 0) + +TAG_VALUE: StaticSchema = (3, n0, _TV, 0) + +TAG: StaticSchema = (18, n0, _T, 0, (_K, _V), ((TAG_KEY, 1), (TAG_VALUE, 0))) + +TAGS_LIST: StaticSchema = (16, n0, _TL, 0, (_m,), ((TAG, 0),)) + +ADD_TAGS_INPUT: StaticSchema = ( + 18, + n0, + _ATI, + {_sSI: _cATR, _smi: None}, + (_RI, _TL), + ((STRING, 1), (TAGS_LIST, 1)), +) + +ADD_TAGS_OUTPUT: StaticSchema = (18, n0, _ATO, {_sSI: _cATRo, _smit: None}) + +CHANNEL_ARN_INVALID_EXCEPTION: StaticSchema = ( + 18, + n0, + _CARNIE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +CHANNEL_NOT_FOUND_EXCEPTION: StaticSchema = ( + 18, + n0, + _CNFE, + {_s: _c, _sE: 404}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +CLOUD_TRAIL_ARN_INVALID_EXCEPTION: StaticSchema = ( + 18, + n0, + _CTARNIE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +CONFLICT_EXCEPTION: StaticSchema = ( + 18, + n0, + _CE, + {_s: _c, _sE: 409}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +EVENT_DATA_STORE_ARN_INVALID_EXCEPTION: StaticSchema = ( + 18, + n0, + _EDSARNIE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +EVENT_DATA_STORE_NOT_FOUND_EXCEPTION: StaticSchema = ( + 18, + n0, + _EDSNFE, + {_s: _c, _sE: 404}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +INACTIVE_EVENT_DATA_STORE_EXCEPTION: StaticSchema = ( + 18, + n0, + _IEDSE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +INVALID_TAG_PARAMETER_EXCEPTION: StaticSchema = ( + 18, + n0, + _ITPE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +INVALID_TRAIL_NAME_EXCEPTION: StaticSchema = ( + 18, + n0, + _ITNE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION: StaticSchema = ( + 18, + n0, + _NMASLREE, + {_s: _c, _sE: 403}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +NOT_ORGANIZATION_MASTER_ACCOUNT_EXCEPTION: StaticSchema = ( + 18, + n0, + _NOMAE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +OPERATION_NOT_PERMITTED_EXCEPTION: StaticSchema = ( + 18, + n0, + _ONPE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +RESOURCE_NOT_FOUND_EXCEPTION: StaticSchema = ( + 18, + n0, + _RNFE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +RESOURCE_TYPE_NOT_SUPPORTED_EXCEPTION: StaticSchema = ( + 18, + n0, + _RTNSE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +TAGS_LIMIT_EXCEEDED_EXCEPTION: StaticSchema = ( + 18, + n0, + _TLEE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +UNSUPPORTED_OPERATION_EXCEPTION: StaticSchema = ( + 18, + n0, + _UOE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +ADD_TAGS: StaticOperationSchema = ( + 23, + n0, + _AT, + 0, + ADD_TAGS_INPUT, + ADD_TAGS_OUTPUT, + ( + CHANNEL_ARN_INVALID_EXCEPTION, + CHANNEL_NOT_FOUND_EXCEPTION, + CLOUD_TRAIL_ARN_INVALID_EXCEPTION, + CONFLICT_EXCEPTION, + EVENT_DATA_STORE_ARN_INVALID_EXCEPTION, + EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, + INACTIVE_EVENT_DATA_STORE_EXCEPTION, + INVALID_TAG_PARAMETER_EXCEPTION, + INVALID_TRAIL_NAME_EXCEPTION, + NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, + NOT_ORGANIZATION_MASTER_ACCOUNT_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + RESOURCE_TYPE_NOT_SUPPORTED_EXCEPTION, + TAGS_LIMIT_EXCEEDED_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -ACCOUNT_ID = Schema( - id=ShapeID("com.amazonaws.cloudtrail#AccountId"), shape_type=ShapeType.STRING -) +OPERATOR_VALUE: StaticSchema = (3, n0, _OV, 0) -ACCOUNT_NOT_FOUND_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#AccountNotFoundException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=404), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "AccountNotFound", "httpResponseCode": 404} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -ACCOUNT_NOT_REGISTERED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#AccountNotRegisteredException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "AccountNotRegistered", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -ACCOUNT_REGISTERED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#AccountRegisteredException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "AccountRegistered", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) +OPERATOR: StaticSchema = (16, n0, _O, 0, (_m,), ((OPERATOR_VALUE, 0),)) -STRING = Schema( - id=ShapeID("com.amazonaws.cloudtrail#String"), shape_type=ShapeType.STRING -) +SELECTOR_FIELD: StaticSchema = (3, n0, _SF, 0) -TAG_KEY = Schema( - id=ShapeID("com.amazonaws.cloudtrail#TagKey"), shape_type=ShapeType.STRING +ADVANCED_FIELD_SELECTOR: StaticSchema = ( + 18, + n0, + _AFS, + 0, + (_F, _E, _SW, _EW, _NE, _NSW, _NEW), + ( + (SELECTOR_FIELD, 1), + (OPERATOR, 0), + (OPERATOR, 0), + (OPERATOR, 0), + (OPERATOR, 0), + (OPERATOR, 0), + (OPERATOR, 0), + ), ) -TAG_VALUE = Schema( - id=ShapeID("com.amazonaws.cloudtrail#TagValue"), shape_type=ShapeType.STRING +ADVANCED_FIELD_SELECTORS: StaticSchema = ( + 16, + n0, + _AFSd, + 0, + (_m,), + ((ADVANCED_FIELD_SELECTOR, 0),), ) -TAG = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#Tag"), - members={ - "Key": { - "target": TAG_KEY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Value": {"target": TAG_VALUE}, - }, -) +SELECTOR_NAME: StaticSchema = (3, n0, _SN, 0) -TAGS_LIST = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#TagsList"), - shape_type=ShapeType.LIST, - members={"member": {"target": TAG}}, -) - -ADD_TAGS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#AddTagsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#AddTagsRequest", - ) - ], - members={ - "ResourceId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "TagsList": { - "target": TAGS_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +ADVANCED_EVENT_SELECTOR: StaticSchema = ( + 18, + n0, + _AES, + 0, + (_N, _FS), + ((SELECTOR_NAME, 0), (ADVANCED_FIELD_SELECTORS, 1)), ) -ADD_TAGS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#AddTagsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#AddTagsResponse", - ) - ], -) - -CHANNEL_ARN_INVALID_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ChannelARNInvalidException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "ChannelARNInvalid", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -CHANNEL_NOT_FOUND_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ChannelNotFoundException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=404), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "ChannelNotFound", "httpResponseCode": 404} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -CLOUD_TRAIL_ARN_INVALID_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#CloudTrailARNInvalidException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "CloudTrailARNInvalid", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -CONFLICT_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ConflictException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=409), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "ConflictException", "httpResponseCode": 409} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -EVENT_DATA_STORE_ARN_INVALID_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#EventDataStoreARNInvalidException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "EventDataStoreARNInvalid", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -EVENT_DATA_STORE_NOT_FOUND_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#EventDataStoreNotFoundException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=404), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "EventDataStoreNotFound", "httpResponseCode": 404} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -INACTIVE_EVENT_DATA_STORE_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#InactiveEventDataStoreException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "InactiveEventDataStore", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -INVALID_TAG_PARAMETER_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#InvalidTagParameterException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "InvalidTagParameter", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -INVALID_TRAIL_NAME_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#InvalidTrailNameException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "InvalidTrailName", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=403), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "NoManagementAccountSLRExists", "httpResponseCode": 403} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -NOT_ORGANIZATION_MASTER_ACCOUNT_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#NotOrganizationMasterAccountException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "NotOrganizationMasterAccount", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -OPERATION_NOT_PERMITTED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "OperationNotPermitted", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -RESOURCE_NOT_FOUND_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ResourceNotFoundException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "ResourceNotFound", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -RESOURCE_TYPE_NOT_SUPPORTED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ResourceTypeNotSupportedException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "ResourceTypeNotSupported", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -TAGS_LIMIT_EXCEEDED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#TagsLimitExceededException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "TagsLimitExceeded", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -UNSUPPORTED_OPERATION_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "UnsupportedOperation", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, +ADVANCED_EVENT_SELECTORS: StaticSchema = ( + 16, + n0, + _AESd, + 0, + (_m,), + ((ADVANCED_EVENT_SELECTOR, 0),), ) -ADD_TAGS = Schema( - id=ShapeID("com.amazonaws.cloudtrail#AddTags"), shape_type=ShapeType.OPERATION -) +EVENT_CATEGORY_AGGREGATION: StaticSchema = (14, n0, _ECA, 0, (_D,), ((-1, {_sV: _D}),)) -OPERATOR_VALUE = Schema( - id=ShapeID("com.amazonaws.cloudtrail#OperatorValue"), shape_type=ShapeType.STRING +TEMPLATE: StaticSchema = ( + 14, + n0, + _Te, + 0, + (_AA, _RA, _UA), + ((-1, {_sV: _AA}), (-1, {_sV: _RA}), (-1, {_sV: _UA})), ) -OPERATOR = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#Operator"), - shape_type=ShapeType.LIST, - members={"member": {"target": OPERATOR_VALUE}}, -) +TEMPLATES: StaticSchema = (16, n0, _Tem, 0, (_m,), ((TEMPLATE, 0),)) -SELECTOR_FIELD = Schema( - id=ShapeID("com.amazonaws.cloudtrail#SelectorField"), shape_type=ShapeType.STRING +AGGREGATION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _AC, + 0, + (_Tem, _EC), + ((TEMPLATES, 1), (EVENT_CATEGORY_AGGREGATION, 1)), ) -ADVANCED_FIELD_SELECTOR = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#AdvancedFieldSelector"), - members={ - "Field": { - "target": SELECTOR_FIELD, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Equals": {"target": OPERATOR}, - "StartsWith": {"target": OPERATOR}, - "EndsWith": {"target": OPERATOR}, - "NotEquals": {"target": OPERATOR}, - "NotStartsWith": {"target": OPERATOR}, - "NotEndsWith": {"target": OPERATOR}, - }, +AGGREGATION_CONFIGURATIONS: StaticSchema = ( + 16, + n0, + _ACg, + 0, + (_m,), + ((AGGREGATION_CONFIGURATION, 0),), ) -ADVANCED_FIELD_SELECTORS = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#AdvancedFieldSelectors"), - shape_type=ShapeType.LIST, - members={"member": {"target": ADVANCED_FIELD_SELECTOR}}, +BILLING_MODE: StaticSchema = ( + 14, + n0, + _BM, + 0, + (_ERP, _FRP), + ((-1, {_sV: _ERP}), (-1, {_sV: _FRP})), ) -SELECTOR_NAME = Schema( - id=ShapeID("com.amazonaws.cloudtrail#SelectorName"), shape_type=ShapeType.STRING -) +BOOLEAN: StaticSchema = (2, n0, _B, 0) -ADVANCED_EVENT_SELECTOR = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#AdvancedEventSelector"), - members={ - "Name": {"target": SELECTOR_NAME}, - "FieldSelectors": { - "target": ADVANCED_FIELD_SELECTORS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +BYTE_BUFFER: StaticSchema = (1, n0, _BB, 0) -ADVANCED_EVENT_SELECTORS = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#AdvancedEventSelectors"), - shape_type=ShapeType.LIST, - members={"member": {"target": ADVANCED_EVENT_SELECTOR}}, -) +EVENT_DATA_STORE_ARN: StaticSchema = (3, n0, _EDSA, 0) -EVENT_CATEGORY_AGGREGATION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#EventCategoryAggregation"), - shape_type=ShapeType.ENUM, - members={"Data": {"target": UNIT}}, -) +UUID: StaticSchema = (3, n0, _UUID, 0) -TEMPLATE = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#Template"), - shape_type=ShapeType.ENUM, - members={ - "API_ACTIVITY": {"target": UNIT}, - "RESOURCE_ACCESS": {"target": UNIT}, - "USER_ACTIONS": {"target": UNIT}, - }, +CANCEL_QUERY_INPUT: StaticSchema = ( + 18, + n0, + _CQI, + {_sSI: _cCQR, _smi: None}, + (_EDS, _QI, _EDSOAI), + ((EVENT_DATA_STORE_ARN, 0), (UUID, 1), (ACCOUNT_ID, 0)), ) -TEMPLATES = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#Templates"), - shape_type=ShapeType.LIST, - members={"member": {"target": TEMPLATE}}, +QUERY_STATUS: StaticSchema = ( + 14, + n0, + _QS, + 0, + (_QUEUED, _RUNNING, _FINISHED, _FAILED, _CANCELLED, _TO), + ( + (-1, {_sV: _QUEUED}), + (-1, {_sV: _RUNNING}), + (-1, {_sV: _FINISHED}), + (-1, {_sV: _FAILED}), + (-1, {_sV: _CANCELLED}), + (-1, {_sV: _TO}), + ), ) -AGGREGATION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#AggregationConfiguration"), - members={ - "Templates": { - "target": TEMPLATES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "EventCategory": { - "target": EVENT_CATEGORY_AGGREGATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +CANCEL_QUERY_OUTPUT: StaticSchema = ( + 18, + n0, + _CQO, + {_sSI: _cCQRo, _smit: None}, + (_QI, _QS, _EDSOAI), + ((UUID, 1), (QUERY_STATUS, 1), (ACCOUNT_ID, 0)), +) + +INACTIVE_QUERY_EXCEPTION: StaticSchema = ( + 18, + n0, + _IQE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +INVALID_PARAMETER_EXCEPTION: StaticSchema = ( + 18, + n0, + _IPE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +QUERY_ID_NOT_FOUND_EXCEPTION: StaticSchema = ( + 18, + n0, + _QINFE, + {_s: _c, _sE: 404}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +CANCEL_QUERY: StaticOperationSchema = ( + 23, + n0, + _CQ, + 0, + CANCEL_QUERY_INPUT, + CANCEL_QUERY_OUTPUT, + ( + CONFLICT_EXCEPTION, + EVENT_DATA_STORE_ARN_INVALID_EXCEPTION, + EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, + INACTIVE_EVENT_DATA_STORE_EXCEPTION, + INACTIVE_QUERY_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + QUERY_ID_NOT_FOUND_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -AGGREGATION_CONFIGURATIONS = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#AggregationConfigurations"), - shape_type=ShapeType.LIST, - members={"member": {"target": AGGREGATION_CONFIGURATION}}, +CANNOT_DELEGATE_MANAGEMENT_ACCOUNT_EXCEPTION: StaticSchema = ( + 18, + n0, + _CDMAE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), ) -BILLING_MODE = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#BillingMode"), - shape_type=ShapeType.ENUM, - members={ - "EXTENDABLE_RETENTION_PRICING": {"target": UNIT}, - "FIXED_RETENTION_PRICING": {"target": UNIT}, - }, +CHANNEL_ARN: StaticSchema = (3, n0, _CA, 0) + +CHANNEL_NAME: StaticSchema = (3, n0, _CN, 0) + +CHANNEL: StaticSchema = ( + 18, + n0, + _C, + 0, + (_CA, _N), + ((CHANNEL_ARN, 0), (CHANNEL_NAME, 0)), ) -BOOLEAN = Schema( - id=ShapeID("com.amazonaws.cloudtrail#Boolean"), shape_type=ShapeType.BOOLEAN +CHANNEL_ALREADY_EXISTS_EXCEPTION: StaticSchema = ( + 18, + n0, + _CAEE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), ) -BYTE_BUFFER = Schema( - id=ShapeID("com.amazonaws.cloudtrail#ByteBuffer"), shape_type=ShapeType.BLOB +CHANNEL_EXISTS_FOR_EDS_EXCEPTION: StaticSchema = ( + 18, + n0, + _CEFEDSE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), ) -EVENT_DATA_STORE_ARN = Schema( - id=ShapeID("com.amazonaws.cloudtrail#EventDataStoreArn"), - shape_type=ShapeType.STRING, +CHANNEL_MAX_LIMIT_EXCEEDED_EXCEPTION: StaticSchema = ( + 18, + n0, + _CMLEE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), ) -UUID = Schema(id=ShapeID("com.amazonaws.cloudtrail#UUID"), shape_type=ShapeType.STRING) +CHANNELS: StaticSchema = (16, n0, _Ch, 0, (_m,), ((CHANNEL, 0),)) -CANCEL_QUERY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#CancelQueryInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#CancelQueryRequest", - ) - ], - members={ - "EventDataStore": {"target": EVENT_DATA_STORE_ARN}, - "QueryId": { - "target": UUID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "EventDataStoreOwnerAccountId": {"target": ACCOUNT_ID}, - }, -) +LOCATION: StaticSchema = (3, n0, _L, 0) -QUERY_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#QueryStatus"), - shape_type=ShapeType.ENUM, - members={ - "QUEUED": {"target": UNIT}, - "RUNNING": {"target": UNIT}, - "FINISHED": {"target": UNIT}, - "FAILED": {"target": UNIT}, - "CANCELLED": {"target": UNIT}, - "TIMED_OUT": {"target": UNIT}, - }, +DESTINATION_TYPE: StaticSchema = ( + 14, + n0, + _DT, + 0, + (_EDS_, _AS), + ((-1, {_sV: _EDS_}), (-1, {_sV: _AS})), ) -CANCEL_QUERY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#CancelQueryOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#CancelQueryResponse", - ) - ], - members={ - "QueryId": { - "target": UUID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "QueryStatus": { - "target": QUERY_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "EventDataStoreOwnerAccountId": {"target": ACCOUNT_ID}, - }, +DESTINATION: StaticSchema = ( + 18, + n0, + _De, + 0, + (_Ty, _L), + ((DESTINATION_TYPE, 1), (LOCATION, 1)), ) -INACTIVE_QUERY_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#InactiveQueryException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType({"code": "InactiveQuery", "httpResponseCode": 400}), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -INVALID_PARAMETER_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#InvalidParameterException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "InvalidParameter", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -QUERY_ID_NOT_FOUND_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#QueryIdNotFoundException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=404), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "QueryIdNotFound", "httpResponseCode": 404} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) +DESTINATIONS: StaticSchema = (16, n0, _Des, 0, (_m,), ((DESTINATION, 0),)) -CANCEL_QUERY = Schema( - id=ShapeID("com.amazonaws.cloudtrail#CancelQuery"), shape_type=ShapeType.OPERATION -) +SOURCE: StaticSchema = (3, n0, _So, 0) -CANNOT_DELEGATE_MANAGEMENT_ACCOUNT_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#CannotDelegateManagementAccountException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "CannotDelegateManagementAccount", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, +CREATE_CHANNEL_INPUT: StaticSchema = ( + 18, + n0, + _CCI, + {_sSI: _cCCR, _smi: None}, + (_N, _So, _Des, _Ta), + ((CHANNEL_NAME, 1), (SOURCE, 1), (DESTINATIONS, 1), (TAGS_LIST, 0)), ) -CHANNEL_ARN = Schema( - id=ShapeID("com.amazonaws.cloudtrail#ChannelArn"), shape_type=ShapeType.STRING +CREATE_CHANNEL_OUTPUT: StaticSchema = ( + 18, + n0, + _CCO, + {_sSI: _cCCRo, _smit: None}, + (_CA, _N, _So, _Des, _Ta), + ( + (CHANNEL_ARN, 0), + (CHANNEL_NAME, 0), + (SOURCE, 0), + (DESTINATIONS, 0), + (TAGS_LIST, 0), + ), ) -CHANNEL_NAME = Schema( - id=ShapeID("com.amazonaws.cloudtrail#ChannelName"), shape_type=ShapeType.STRING +INVALID_EVENT_DATA_STORE_CATEGORY_EXCEPTION: StaticSchema = ( + 18, + n0, + _IEDSCE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +INVALID_SOURCE_EXCEPTION: StaticSchema = ( + 18, + n0, + _ISE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +CREATE_CHANNEL: StaticOperationSchema = ( + 23, + n0, + _CC, + 0, + CREATE_CHANNEL_INPUT, + CREATE_CHANNEL_OUTPUT, + ( + CHANNEL_ALREADY_EXISTS_EXCEPTION, + CHANNEL_MAX_LIMIT_EXCEEDED_EXCEPTION, + EVENT_DATA_STORE_ARN_INVALID_EXCEPTION, + EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, + INACTIVE_EVENT_DATA_STORE_EXCEPTION, + INVALID_EVENT_DATA_STORE_CATEGORY_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + INVALID_SOURCE_EXCEPTION, + INVALID_TAG_PARAMETER_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + TAGS_LIMIT_EXCEEDED_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -CHANNEL = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#Channel"), - members={"ChannelArn": {"target": CHANNEL_ARN}, "Name": {"target": CHANNEL_NAME}}, -) +DASHBOARD_NAME: StaticSchema = (3, n0, _DN, 0) -CHANNEL_ALREADY_EXISTS_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ChannelAlreadyExistsException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "ChannelAlreadyExists", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -CHANNEL_EXISTS_FOR_EDS_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ChannelExistsForEDSException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "ChannelExistsForEDS", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -CHANNEL_MAX_LIMIT_EXCEEDED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ChannelMaxLimitExceededException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "ChannelMaxLimitExceeded", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, +REFRESH_SCHEDULE_FREQUENCY_UNIT: StaticSchema = ( + 14, + n0, + _RSFU, + 0, + (_HOURS, _DAYS), + ((-1, {_sV: _HOURS}), (-1, {_sV: _DAYS})), ) -CHANNELS = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#Channels"), - shape_type=ShapeType.LIST, - members={"member": {"target": CHANNEL}}, -) +REFRESH_SCHEDULE_FREQUENCY_VALUE: StaticSchema = (7, n0, _RSFV, 0) -LOCATION = Schema( - id=ShapeID("com.amazonaws.cloudtrail#Location"), shape_type=ShapeType.STRING +REFRESH_SCHEDULE_FREQUENCY: StaticSchema = ( + 18, + n0, + _RSF, + 0, + (_U, _V), + ((REFRESH_SCHEDULE_FREQUENCY_UNIT, 0), (REFRESH_SCHEDULE_FREQUENCY_VALUE, 0)), ) -DESTINATION_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#DestinationType"), - shape_type=ShapeType.ENUM, - members={"EVENT_DATA_STORE": {"target": UNIT}, "AWS_SERVICE": {"target": UNIT}}, +REFRESH_SCHEDULE_STATUS: StaticSchema = ( + 14, + n0, + _RSS, + 0, + (_ENABLED, _DISABLED), + ((-1, {_sV: _ENABLED}), (-1, {_sV: _DISABLED})), ) -DESTINATION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#Destination"), - members={ - "Type": { - "target": DESTINATION_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Location": { - "target": LOCATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +TIME_OF_DAY: StaticSchema = (3, n0, _TOD, 0) -DESTINATIONS = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#Destinations"), - shape_type=ShapeType.LIST, - members={"member": {"target": DESTINATION}}, -) - -SOURCE = Schema( - id=ShapeID("com.amazonaws.cloudtrail#Source"), shape_type=ShapeType.STRING -) - -CREATE_CHANNEL_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#CreateChannelInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#CreateChannelRequest", - ) - ], - members={ - "Name": { - "target": CHANNEL_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Source": { - "target": SOURCE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Destinations": { - "target": DESTINATIONS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Tags": {"target": TAGS_LIST}, - }, +REFRESH_SCHEDULE: StaticSchema = ( + 18, + n0, + _RS, + 0, + (_Fr, _St, _TOD), + ((REFRESH_SCHEDULE_FREQUENCY, 0), (REFRESH_SCHEDULE_STATUS, 0), (TIME_OF_DAY, 0)), ) -CREATE_CHANNEL_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#CreateChannelOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#CreateChannelResponse", - ) - ], - members={ - "ChannelArn": {"target": CHANNEL_ARN}, - "Name": {"target": CHANNEL_NAME}, - "Source": {"target": SOURCE}, - "Destinations": {"target": DESTINATIONS}, - "Tags": {"target": TAGS_LIST}, - }, -) +TERMINATION_PROTECTION_ENABLED: StaticSchema = (2, n0, _TPE, 0) -INVALID_EVENT_DATA_STORE_CATEGORY_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#InvalidEventDataStoreCategoryException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "InvalidEventDataStoreCategory", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -INVALID_SOURCE_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#InvalidSourceException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType({"code": "InvalidSource", "httpResponseCode": 400}), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) +QUERY_PARAMETER: StaticSchema = (3, n0, _QP, 0) -CREATE_CHANNEL = Schema( - id=ShapeID("com.amazonaws.cloudtrail#CreateChannel"), shape_type=ShapeType.OPERATION -) +QUERY_PARAMETERS: StaticSchema = (16, n0, _QPu, 0, (_m,), ((QUERY_PARAMETER, 0),)) -DASHBOARD_NAME = Schema( - id=ShapeID("com.amazonaws.cloudtrail#DashboardName"), shape_type=ShapeType.STRING -) +QUERY_STATEMENT: StaticSchema = (3, n0, _QSu, 0) -REFRESH_SCHEDULE_FREQUENCY_UNIT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#RefreshScheduleFrequencyUnit"), - shape_type=ShapeType.ENUM, - members={"HOURS": {"target": UNIT}, "DAYS": {"target": UNIT}}, -) +VIEW_PROPERTIES_KEY: StaticSchema = (3, n0, _VPK, 0) -REFRESH_SCHEDULE_FREQUENCY_VALUE = Schema( - id=ShapeID("com.amazonaws.cloudtrail#RefreshScheduleFrequencyValue"), - shape_type=ShapeType.INTEGER, -) +VIEW_PROPERTIES_VALUE: StaticSchema = (3, n0, _VPV, 0) -REFRESH_SCHEDULE_FREQUENCY = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#RefreshScheduleFrequency"), - members={ - "Unit": {"target": REFRESH_SCHEDULE_FREQUENCY_UNIT}, - "Value": {"target": REFRESH_SCHEDULE_FREQUENCY_VALUE}, - }, +VIEW_PROPERTIES_MAP: StaticSchema = ( + 17, + n0, + _VPM, + 0, + (_k, _v), + ((VIEW_PROPERTIES_KEY, 0), (VIEW_PROPERTIES_VALUE, 0)), ) -REFRESH_SCHEDULE_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#RefreshScheduleStatus"), - shape_type=ShapeType.ENUM, - members={"ENABLED": {"target": UNIT}, "DISABLED": {"target": UNIT}}, +REQUEST_WIDGET: StaticSchema = ( + 18, + n0, + _RW, + 0, + (_QSu, _QPu, _VP), + ((QUERY_STATEMENT, 1), (QUERY_PARAMETERS, 0), (VIEW_PROPERTIES_MAP, 1)), ) -TIME_OF_DAY = Schema( - id=ShapeID("com.amazonaws.cloudtrail#TimeOfDay"), shape_type=ShapeType.STRING -) +REQUEST_WIDGET_LIST: StaticSchema = (16, n0, _RWL, 0, (_m,), ((REQUEST_WIDGET, 0),)) -REFRESH_SCHEDULE = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#RefreshSchedule"), - members={ - "Frequency": {"target": REFRESH_SCHEDULE_FREQUENCY}, - "Status": {"target": REFRESH_SCHEDULE_STATUS}, - "TimeOfDay": {"target": TIME_OF_DAY}, - }, +CREATE_DASHBOARD_INPUT: StaticSchema = ( + 18, + n0, + _CDI, + {_sSI: _cCDR, _smi: None}, + (_N, _RS, _TL, _TPE, _W), + ( + (DASHBOARD_NAME, 1), + (REFRESH_SCHEDULE, 0), + (TAGS_LIST, 0), + (TERMINATION_PROTECTION_ENABLED, 0), + (REQUEST_WIDGET_LIST, 0), + ), ) -TERMINATION_PROTECTION_ENABLED = Schema( - id=ShapeID("com.amazonaws.cloudtrail#TerminationProtectionEnabled"), - shape_type=ShapeType.BOOLEAN, +DASHBOARD_ARN: StaticSchema = (3, n0, _DA, 0) + +DASHBOARD_TYPE: StaticSchema = ( + 14, + n0, + _DTa, + 0, + (_MANAGED, _CUSTOM), + ((-1, {_sV: _MANAGED}), (-1, {_sV: _CUSTOM})), ) -QUERY_PARAMETER = Schema( - id=ShapeID("com.amazonaws.cloudtrail#QueryParameter"), shape_type=ShapeType.STRING +QUERY_ALIAS: StaticSchema = (3, n0, _QA, 0) + +WIDGET: StaticSchema = ( + 18, + n0, + _Wi, + 0, + (_QA, _QSu, _QPu, _VP), + ( + (QUERY_ALIAS, 0), + (QUERY_STATEMENT, 0), + (QUERY_PARAMETERS, 0), + (VIEW_PROPERTIES_MAP, 0), + ), ) -QUERY_PARAMETERS = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#QueryParameters"), - shape_type=ShapeType.LIST, - members={"member": {"target": QUERY_PARAMETER}}, +WIDGET_LIST: StaticSchema = (16, n0, _WL, 0, (_m,), ((WIDGET, 0),)) + +CREATE_DASHBOARD_OUTPUT: StaticSchema = ( + 18, + n0, + _CDO, + {_sSI: _cCDRo, _smit: None}, + (_DA, _N, _Ty, _W, _TL, _RS, _TPE), + ( + (DASHBOARD_ARN, 0), + (DASHBOARD_NAME, 0), + (DASHBOARD_TYPE, 0), + (WIDGET_LIST, 0), + (TAGS_LIST, 0), + (REFRESH_SCHEDULE, 0), + (TERMINATION_PROTECTION_ENABLED, 0), + ), ) -QUERY_STATEMENT = Schema( - id=ShapeID("com.amazonaws.cloudtrail#QueryStatement"), shape_type=ShapeType.STRING +INSUFFICIENT_ENCRYPTION_POLICY_EXCEPTION: StaticSchema = ( + 18, + n0, + _IEPE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +INVALID_QUERY_STATEMENT_EXCEPTION: StaticSchema = ( + 18, + n0, + _IQSE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +SERVICE_QUOTA_EXCEEDED_EXCEPTION: StaticSchema = ( + 18, + n0, + _SQEE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +CREATE_DASHBOARD: StaticOperationSchema = ( + 23, + n0, + _CD, + 0, + CREATE_DASHBOARD_INPUT, + CREATE_DASHBOARD_OUTPUT, + ( + CONFLICT_EXCEPTION, + EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, + INACTIVE_EVENT_DATA_STORE_EXCEPTION, + INSUFFICIENT_ENCRYPTION_POLICY_EXCEPTION, + INVALID_QUERY_STATEMENT_EXCEPTION, + INVALID_TAG_PARAMETER_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -VIEW_PROPERTIES_KEY = Schema( - id=ShapeID("com.amazonaws.cloudtrail#ViewPropertiesKey"), - shape_type=ShapeType.STRING, +CLOUD_TRAIL_ACCESS_NOT_ENABLED_EXCEPTION: StaticSchema = ( + 18, + n0, + _CTANEE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +EVENT_DATA_STORE_KMS_KEY_ID: StaticSchema = (3, n0, _EDSKKI, 0) + +EVENT_DATA_STORE_NAME: StaticSchema = (3, n0, _EDSN, 0) + +RETENTION_PERIOD: StaticSchema = (7, n0, _RP, 0) + +CREATE_EVENT_DATA_STORE_INPUT: StaticSchema = ( + 18, + n0, + _CEDSI, + {_sSI: _cCEDSR, _smi: None}, + (_N, _AESd, _MRE, _OE, _RP, _TPE, _TL, _KKI, _SI, _BM), + ( + (EVENT_DATA_STORE_NAME, 1), + (ADVANCED_EVENT_SELECTORS, 0), + (BOOLEAN, 0), + (BOOLEAN, 0), + (RETENTION_PERIOD, 0), + (TERMINATION_PROTECTION_ENABLED, 0), + (TAGS_LIST, 0), + (EVENT_DATA_STORE_KMS_KEY_ID, 0), + (BOOLEAN, 0), + (BILLING_MODE, 0), + ), ) -VIEW_PROPERTIES_VALUE = Schema( - id=ShapeID("com.amazonaws.cloudtrail#ViewPropertiesValue"), - shape_type=ShapeType.STRING, +DATE: StaticSchema = (4, n0, _Da, 0) + +EVENT_DATA_STORE_STATUS: StaticSchema = ( + 14, + n0, + _EDSS, + 0, + (_CREATED, _ENABLED, _PD, _SI_, _SI__, _SI___), + ( + (-1, {_sV: _CREATED}), + (-1, {_sV: _ENABLED}), + (-1, {_sV: _PD}), + (-1, {_sV: _SI_}), + (-1, {_sV: _SI__}), + (-1, {_sV: _SI___}), + ), ) -VIEW_PROPERTIES_MAP = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ViewPropertiesMap"), - shape_type=ShapeType.MAP, - members={ - "key": {"target": VIEW_PROPERTIES_KEY}, - "value": {"target": VIEW_PROPERTIES_VALUE}, - }, +CREATE_EVENT_DATA_STORE_OUTPUT: StaticSchema = ( + 18, + n0, + _CEDSO, + {_sSI: _cCEDSRo, _smit: None}, + (_EDSA, _N, _St, _AESd, _MRE, _OE, _RP, _TPE, _TL, _CT, _UT, _KKI, _BM), + ( + (EVENT_DATA_STORE_ARN, 0), + (EVENT_DATA_STORE_NAME, 0), + (EVENT_DATA_STORE_STATUS, 0), + (ADVANCED_EVENT_SELECTORS, 0), + (BOOLEAN, 0), + (BOOLEAN, 0), + (RETENTION_PERIOD, 0), + (TERMINATION_PROTECTION_ENABLED, 0), + (TAGS_LIST, 0), + (DATE, 0), + (DATE, 0), + (EVENT_DATA_STORE_KMS_KEY_ID, 0), + (BILLING_MODE, 0), + ), ) -REQUEST_WIDGET = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#RequestWidget"), - members={ - "QueryStatement": { - "target": QUERY_STATEMENT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "QueryParameters": {"target": QUERY_PARAMETERS}, - "ViewProperties": { - "target": VIEW_PROPERTIES_MAP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +EVENT_DATA_STORE_ALREADY_EXISTS_EXCEPTION: StaticSchema = ( + 18, + n0, + _EDSAEE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +EVENT_DATA_STORE_MAX_LIMIT_EXCEEDED_EXCEPTION: StaticSchema = ( + 18, + n0, + _EDSMLEE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +INSUFFICIENT_DEPENDENCY_SERVICE_ACCESS_PERMISSION_EXCEPTION: StaticSchema = ( + 18, + n0, + _IDSAPE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +INVALID_EVENT_SELECTORS_EXCEPTION: StaticSchema = ( + 18, + n0, + _IESE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +INVALID_KMS_KEY_ID_EXCEPTION: StaticSchema = ( + 18, + n0, + _IKKIE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +KMS_EXCEPTION: StaticSchema = ( + 18, + n0, + _KE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +KMS_KEY_NOT_FOUND_EXCEPTION: StaticSchema = ( + 18, + n0, + _KKNFE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +ORGANIZATION_NOT_IN_ALL_FEATURES_MODE_EXCEPTION: StaticSchema = ( + 18, + n0, + _ONIAFME, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +ORGANIZATIONS_NOT_IN_USE_EXCEPTION: StaticSchema = ( + 18, + n0, + _ONIUE, + {_s: _c, _sE: 404}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +THROTTLING_EXCEPTION: StaticSchema = ( + 18, + n0, + _TE, + {_s: _c, _sE: 429}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +CREATE_EVENT_DATA_STORE: StaticOperationSchema = ( + 23, + n0, + _CEDS, + 0, + CREATE_EVENT_DATA_STORE_INPUT, + CREATE_EVENT_DATA_STORE_OUTPUT, + ( + CLOUD_TRAIL_ACCESS_NOT_ENABLED_EXCEPTION, + CONFLICT_EXCEPTION, + EVENT_DATA_STORE_ALREADY_EXISTS_EXCEPTION, + EVENT_DATA_STORE_MAX_LIMIT_EXCEEDED_EXCEPTION, + INSUFFICIENT_DEPENDENCY_SERVICE_ACCESS_PERMISSION_EXCEPTION, + INSUFFICIENT_ENCRYPTION_POLICY_EXCEPTION, + INVALID_EVENT_SELECTORS_EXCEPTION, + INVALID_KMS_KEY_ID_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + INVALID_TAG_PARAMETER_EXCEPTION, + KMS_EXCEPTION, + KMS_KEY_NOT_FOUND_EXCEPTION, + NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, + NOT_ORGANIZATION_MASTER_ACCOUNT_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + ORGANIZATION_NOT_IN_ALL_FEATURES_MODE_EXCEPTION, + ORGANIZATIONS_NOT_IN_USE_EXCEPTION, + THROTTLING_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -REQUEST_WIDGET_LIST = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#RequestWidgetList"), - shape_type=ShapeType.LIST, - members={"member": {"target": REQUEST_WIDGET}}, -) - -CREATE_DASHBOARD_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#CreateDashboardInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#CreateDashboardRequest", - ) - ], - members={ - "Name": { - "target": DASHBOARD_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "RefreshSchedule": {"target": REFRESH_SCHEDULE}, - "TagsList": {"target": TAGS_LIST}, - "TerminationProtectionEnabled": {"target": TERMINATION_PROTECTION_ENABLED}, - "Widgets": {"target": REQUEST_WIDGET_LIST}, - }, +CLOUD_TRAIL_INVALID_CLIENT_TOKEN_ID_EXCEPTION: StaticSchema = ( + 18, + n0, + _CTICTIE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +CLOUD_WATCH_LOGS_DELIVERY_UNAVAILABLE_EXCEPTION: StaticSchema = ( + 18, + n0, + _CWLDUE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +CREATE_TRAIL_INPUT: StaticSchema = ( + 18, + n0, + _CTI, + {_sSI: _cCTR, _smi: None}, + (_N, _SBN, _SKP, _STN, _IGSE, _IMRT, _ELFV, _CWLLGA, _CWLRA, _KKI, _IOT, _TL, _RL), + ( + (STRING, 1), + (STRING, 1), + (STRING, 0), + (STRING, 0), + (BOOLEAN, 0), + (BOOLEAN, 0), + (BOOLEAN, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (BOOLEAN, 0), + (TAGS_LIST, 0), + (BOOLEAN, 0), + ), ) -DASHBOARD_ARN = Schema( - id=ShapeID("com.amazonaws.cloudtrail#DashboardArn"), shape_type=ShapeType.STRING +CREATE_TRAIL_OUTPUT: StaticSchema = ( + 18, + n0, + _CTO, + {_sSI: _cCTRo, _smit: None}, + ( + _N, + _SBN, + _SKP, + _STN, + _STARN, + _IGSE, + _IMRT, + _TARN, + _LFVE, + _CWLLGA, + _CWLRA, + _KKI, + _IOT, + _RL, + ), + ( + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (BOOLEAN, 0), + (BOOLEAN, 0), + (STRING, 0), + (BOOLEAN, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (BOOLEAN, 0), + (BOOLEAN, 0), + ), ) -DASHBOARD_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#DashboardType"), - shape_type=ShapeType.ENUM, - members={"MANAGED": {"target": UNIT}, "CUSTOM": {"target": UNIT}}, +INSUFFICIENT_S3_BUCKET_POLICY_EXCEPTION: StaticSchema = ( + 18, + n0, + _ISBPE, + {_s: _c, _sE: 403}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +INSUFFICIENT_SNS_TOPIC_POLICY_EXCEPTION: StaticSchema = ( + 18, + n0, + _ISTPE, + {_s: _c, _sE: 403}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +INVALID_CLOUD_WATCH_LOGS_LOG_GROUP_ARN_EXCEPTION: StaticSchema = ( + 18, + n0, + _ICWLLGAE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +INVALID_CLOUD_WATCH_LOGS_ROLE_ARN_EXCEPTION: StaticSchema = ( + 18, + n0, + _ICWLRAE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +INVALID_PARAMETER_COMBINATION_EXCEPTION: StaticSchema = ( + 18, + n0, + _IPCE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +INVALID_S3_BUCKET_NAME_EXCEPTION: StaticSchema = ( + 18, + n0, + _ISBNE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +INVALID_S3_PREFIX_EXCEPTION: StaticSchema = ( + 18, + n0, + _ISPE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +INVALID_SNS_TOPIC_NAME_EXCEPTION: StaticSchema = ( + 18, + n0, + _ISTNE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +KMS_KEY_DISABLED_EXCEPTION: StaticSchema = ( + 18, + n0, + _KKDE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +MAXIMUM_NUMBER_OF_TRAILS_EXCEEDED_EXCEPTION: StaticSchema = ( + 18, + n0, + _MNOTEE, + {_s: _c, _sE: 403}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +S3_BUCKET_DOES_NOT_EXIST_EXCEPTION: StaticSchema = ( + 18, + n0, + _SBDNEE, + {_s: _c, _sE: 404}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +TRAIL_ALREADY_EXISTS_EXCEPTION: StaticSchema = ( + 18, + n0, + _TAEE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +TRAIL_NOT_PROVIDED_EXCEPTION: StaticSchema = ( + 18, + n0, + _TNPE, + {_s: _c, _sE: 404}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +CREATE_TRAIL: StaticOperationSchema = ( + 23, + n0, + _CTr, + 0, + CREATE_TRAIL_INPUT, + CREATE_TRAIL_OUTPUT, + ( + CLOUD_TRAIL_ACCESS_NOT_ENABLED_EXCEPTION, + CLOUD_TRAIL_INVALID_CLIENT_TOKEN_ID_EXCEPTION, + CLOUD_WATCH_LOGS_DELIVERY_UNAVAILABLE_EXCEPTION, + CONFLICT_EXCEPTION, + INSUFFICIENT_DEPENDENCY_SERVICE_ACCESS_PERMISSION_EXCEPTION, + INSUFFICIENT_ENCRYPTION_POLICY_EXCEPTION, + INSUFFICIENT_S3_BUCKET_POLICY_EXCEPTION, + INSUFFICIENT_SNS_TOPIC_POLICY_EXCEPTION, + INVALID_CLOUD_WATCH_LOGS_LOG_GROUP_ARN_EXCEPTION, + INVALID_CLOUD_WATCH_LOGS_ROLE_ARN_EXCEPTION, + INVALID_KMS_KEY_ID_EXCEPTION, + INVALID_PARAMETER_COMBINATION_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + INVALID_S3_BUCKET_NAME_EXCEPTION, + INVALID_S3_PREFIX_EXCEPTION, + INVALID_SNS_TOPIC_NAME_EXCEPTION, + INVALID_TAG_PARAMETER_EXCEPTION, + INVALID_TRAIL_NAME_EXCEPTION, + KMS_EXCEPTION, + KMS_KEY_DISABLED_EXCEPTION, + KMS_KEY_NOT_FOUND_EXCEPTION, + MAXIMUM_NUMBER_OF_TRAILS_EXCEEDED_EXCEPTION, + NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, + NOT_ORGANIZATION_MASTER_ACCOUNT_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + ORGANIZATION_NOT_IN_ALL_FEATURES_MODE_EXCEPTION, + ORGANIZATIONS_NOT_IN_USE_EXCEPTION, + S3_BUCKET_DOES_NOT_EXIST_EXCEPTION, + TAGS_LIMIT_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + TRAIL_ALREADY_EXISTS_EXCEPTION, + TRAIL_NOT_PROVIDED_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -QUERY_ALIAS = Schema( - id=ShapeID("com.amazonaws.cloudtrail#QueryAlias"), shape_type=ShapeType.STRING +DELETE_CHANNEL_INPUT: StaticSchema = ( + 18, + n0, + _DCI, + {_sSI: _cDCR, _smi: None}, + (_C,), + ((CHANNEL_ARN, 1),), +) + +DELETE_CHANNEL_OUTPUT: StaticSchema = (18, n0, _DCO, {_sSI: _cDCRo, _smit: None}) + +DELETE_CHANNEL: StaticOperationSchema = ( + 23, + n0, + _DC, + 0, + DELETE_CHANNEL_INPUT, + DELETE_CHANNEL_OUTPUT, + ( + CHANNEL_ARN_INVALID_EXCEPTION, + CHANNEL_NOT_FOUND_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -WIDGET = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#Widget"), - members={ - "QueryAlias": {"target": QUERY_ALIAS}, - "QueryStatement": {"target": QUERY_STATEMENT}, - "QueryParameters": {"target": QUERY_PARAMETERS}, - "ViewProperties": {"target": VIEW_PROPERTIES_MAP}, - }, +DELETE_DASHBOARD_INPUT: StaticSchema = ( + 18, + n0, + _DDI, + {_sSI: _cDDR, _smi: None}, + (_DI,), + ((DASHBOARD_ARN, 1),), +) + +DELETE_DASHBOARD_OUTPUT: StaticSchema = (18, n0, _DDO, {_sSI: _cDDRo, _smit: None}) + +DELETE_DASHBOARD: StaticOperationSchema = ( + 23, + n0, + _DD, + 0, + DELETE_DASHBOARD_INPUT, + DELETE_DASHBOARD_OUTPUT, + (CONFLICT_EXCEPTION, RESOURCE_NOT_FOUND_EXCEPTION, UNSUPPORTED_OPERATION_EXCEPTION), +) + +DELETE_EVENT_DATA_STORE_INPUT: StaticSchema = ( + 18, + n0, + _DEDSI, + {_sSI: _cDEDSR, _smi: None}, + (_EDS,), + ((EVENT_DATA_STORE_ARN, 1),), +) + +DELETE_EVENT_DATA_STORE_OUTPUT: StaticSchema = ( + 18, + n0, + _DEDSO, + {_sSI: _cDEDSRo, _smit: None}, +) + +EVENT_DATA_STORE_FEDERATION_ENABLED_EXCEPTION: StaticSchema = ( + 18, + n0, + _EDSFEE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +EVENT_DATA_STORE_HAS_ONGOING_IMPORT_EXCEPTION: StaticSchema = ( + 18, + n0, + _EDSHOIE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +EVENT_DATA_STORE_TERMINATION_PROTECTED_EXCEPTION: StaticSchema = ( + 18, + n0, + _EDSTPE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +DELETE_EVENT_DATA_STORE: StaticOperationSchema = ( + 23, + n0, + _DEDS, + 0, + DELETE_EVENT_DATA_STORE_INPUT, + DELETE_EVENT_DATA_STORE_OUTPUT, + ( + CHANNEL_EXISTS_FOR_EDS_EXCEPTION, + CONFLICT_EXCEPTION, + EVENT_DATA_STORE_ARN_INVALID_EXCEPTION, + EVENT_DATA_STORE_FEDERATION_ENABLED_EXCEPTION, + EVENT_DATA_STORE_HAS_ONGOING_IMPORT_EXCEPTION, + EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, + EVENT_DATA_STORE_TERMINATION_PROTECTED_EXCEPTION, + INACTIVE_EVENT_DATA_STORE_EXCEPTION, + INSUFFICIENT_DEPENDENCY_SERVICE_ACCESS_PERMISSION_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, + NOT_ORGANIZATION_MASTER_ACCOUNT_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -WIDGET_LIST = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#WidgetList"), - shape_type=ShapeType.LIST, - members={"member": {"target": WIDGET}}, -) - -CREATE_DASHBOARD_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#CreateDashboardOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#CreateDashboardResponse", - ) - ], - members={ - "DashboardArn": {"target": DASHBOARD_ARN}, - "Name": {"target": DASHBOARD_NAME}, - "Type": {"target": DASHBOARD_TYPE}, - "Widgets": {"target": WIDGET_LIST}, - "TagsList": {"target": TAGS_LIST}, - "RefreshSchedule": {"target": REFRESH_SCHEDULE}, - "TerminationProtectionEnabled": {"target": TERMINATION_PROTECTION_ENABLED}, - }, +RESOURCE_ARN: StaticSchema = (3, n0, _RAe, 0) + +DELETE_RESOURCE_POLICY_INPUT: StaticSchema = ( + 18, + n0, + _DRPI, + {_sSI: _cDRPR, _smi: None}, + (_RAe,), + ((RESOURCE_ARN, 1),), +) + +DELETE_RESOURCE_POLICY_OUTPUT: StaticSchema = ( + 18, + n0, + _DRPO, + {_sSI: _cDRPRo, _smit: None}, +) + +RESOURCE_ARN_NOT_VALID_EXCEPTION: StaticSchema = ( + 18, + n0, + _RARNNVE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +RESOURCE_POLICY_NOT_FOUND_EXCEPTION: StaticSchema = ( + 18, + n0, + _RPNFE, + {_s: _c, _sE: 404}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +DELETE_RESOURCE_POLICY: StaticOperationSchema = ( + 23, + n0, + _DRP, + 0, + DELETE_RESOURCE_POLICY_INPUT, + DELETE_RESOURCE_POLICY_OUTPUT, + ( + CONFLICT_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + RESOURCE_ARN_NOT_VALID_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + RESOURCE_POLICY_NOT_FOUND_EXCEPTION, + RESOURCE_TYPE_NOT_SUPPORTED_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -INSUFFICIENT_ENCRYPTION_POLICY_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#InsufficientEncryptionPolicyException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "InsufficientEncryptionPolicy", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -INVALID_QUERY_STATEMENT_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#InvalidQueryStatementException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "InvalidQueryStatement", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -SERVICE_QUOTA_EXCEEDED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ServiceQuotaExceededException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "ServiceQuotaExceeded", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, +DELETE_TRAIL_INPUT: StaticSchema = ( + 18, + n0, + _DTI, + {_sSI: _cDTR, _smi: None}, + (_N,), + ((STRING, 1),), +) + +DELETE_TRAIL_OUTPUT: StaticSchema = (18, n0, _DTO, {_sSI: _cDTRo, _smit: None}) + +INVALID_HOME_REGION_EXCEPTION: StaticSchema = ( + 18, + n0, + _IHRE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +TRAIL_NOT_FOUND_EXCEPTION: StaticSchema = ( + 18, + n0, + _TNFE, + {_s: _c, _sE: 404}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +DELETE_TRAIL: StaticOperationSchema = ( + 23, + n0, + _DTe, + 0, + DELETE_TRAIL_INPUT, + DELETE_TRAIL_OUTPUT, + ( + CLOUD_TRAIL_ARN_INVALID_EXCEPTION, + CONFLICT_EXCEPTION, + INSUFFICIENT_DEPENDENCY_SERVICE_ACCESS_PERMISSION_EXCEPTION, + INVALID_HOME_REGION_EXCEPTION, + INVALID_TRAIL_NAME_EXCEPTION, + NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, + NOT_ORGANIZATION_MASTER_ACCOUNT_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + THROTTLING_EXCEPTION, + TRAIL_NOT_FOUND_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -CREATE_DASHBOARD = Schema( - id=ShapeID("com.amazonaws.cloudtrail#CreateDashboard"), - shape_type=ShapeType.OPERATION, +DEREGISTER_ORGANIZATION_DELEGATED_ADMIN_INPUT: StaticSchema = ( + 18, + n0, + _DODAI, + {_sSI: _cDODAR, _smi: None}, + (_DAAI,), + ((ACCOUNT_ID, 1),), +) + +DEREGISTER_ORGANIZATION_DELEGATED_ADMIN_OUTPUT: StaticSchema = ( + 18, + n0, + _DODAO, + {_sSI: _cDODARo, _smit: None}, +) + +NOT_ORGANIZATION_MANAGEMENT_ACCOUNT_EXCEPTION: StaticSchema = ( + 18, + n0, + _NOMAEo, + {_s: _c, _sE: 403}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +DEREGISTER_ORGANIZATION_DELEGATED_ADMIN: StaticOperationSchema = ( + 23, + n0, + _DODA, + 0, + DEREGISTER_ORGANIZATION_DELEGATED_ADMIN_INPUT, + DEREGISTER_ORGANIZATION_DELEGATED_ADMIN_OUTPUT, + ( + ACCOUNT_NOT_FOUND_EXCEPTION, + ACCOUNT_NOT_REGISTERED_EXCEPTION, + CLOUD_TRAIL_ACCESS_NOT_ENABLED_EXCEPTION, + CONFLICT_EXCEPTION, + INSUFFICIENT_DEPENDENCY_SERVICE_ACCESS_PERMISSION_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + NOT_ORGANIZATION_MANAGEMENT_ACCOUNT_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + ORGANIZATION_NOT_IN_ALL_FEATURES_MODE_EXCEPTION, + ORGANIZATIONS_NOT_IN_USE_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -CLOUD_TRAIL_ACCESS_NOT_ENABLED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#CloudTrailAccessNotEnabledException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "CloudTrailAccessNotEnabled", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -EVENT_DATA_STORE_KMS_KEY_ID = Schema( - id=ShapeID("com.amazonaws.cloudtrail#EventDataStoreKmsKeyId"), - shape_type=ShapeType.STRING, -) - -EVENT_DATA_STORE_NAME = Schema( - id=ShapeID("com.amazonaws.cloudtrail#EventDataStoreName"), - shape_type=ShapeType.STRING, -) - -RETENTION_PERIOD = Schema( - id=ShapeID("com.amazonaws.cloudtrail#RetentionPeriod"), shape_type=ShapeType.INTEGER -) - -CREATE_EVENT_DATA_STORE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#CreateEventDataStoreInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#CreateEventDataStoreRequest", - ) - ], - members={ - "Name": { - "target": EVENT_DATA_STORE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "AdvancedEventSelectors": {"target": ADVANCED_EVENT_SELECTORS}, - "MultiRegionEnabled": {"target": BOOLEAN}, - "OrganizationEnabled": {"target": BOOLEAN}, - "RetentionPeriod": {"target": RETENTION_PERIOD}, - "TerminationProtectionEnabled": {"target": TERMINATION_PROTECTION_ENABLED}, - "TagsList": {"target": TAGS_LIST}, - "KmsKeyId": {"target": EVENT_DATA_STORE_KMS_KEY_ID}, - "StartIngestion": {"target": BOOLEAN}, - "BillingMode": {"target": BILLING_MODE}, - }, +REFRESH_ID: StaticSchema = (3, n0, _RIe, 0) + +DESCRIBE_QUERY_INPUT: StaticSchema = ( + 18, + n0, + _DQI, + {_sSI: _cDQR, _smi: None}, + (_EDS, _QI, _QA, _RIe, _EDSOAI), + ( + (EVENT_DATA_STORE_ARN, 0), + (UUID, 0), + (QUERY_ALIAS, 0), + (REFRESH_ID, 0), + (ACCOUNT_ID, 0), + ), ) -DATE = Schema( - id=ShapeID("com.amazonaws.cloudtrail#Date"), shape_type=ShapeType.TIMESTAMP +DELIVERY_S3_URI: StaticSchema = (3, n0, _DSU, 0) + +DELIVERY_STATUS: StaticSchema = ( + 14, + n0, + _DS, + 0, + (_SUCCESS, _FAILED, _FSF, _PENDING, _RNF, _AD, _ADSF, _CANCELLED, _UNKNOWN), + ( + (-1, {_sV: _SUCCESS}), + (-1, {_sV: _FAILED}), + (-1, {_sV: _FSF}), + (-1, {_sV: _PENDING}), + (-1, {_sV: _RNF}), + (-1, {_sV: _AD}), + (-1, {_sV: _ADSF}), + (-1, {_sV: _CANCELLED}), + (-1, {_sV: _UNKNOWN}), + ), ) -EVENT_DATA_STORE_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#EventDataStoreStatus"), - shape_type=ShapeType.ENUM, - members={ - "CREATED": {"target": UNIT}, - "ENABLED": {"target": UNIT}, - "PENDING_DELETION": {"target": UNIT}, - "STARTING_INGESTION": {"target": UNIT}, - "STOPPING_INGESTION": {"target": UNIT}, - "STOPPED_INGESTION": {"target": UNIT}, - }, +PROMPT: StaticSchema = (3, n0, _P, 0) + +LONG: StaticSchema = (8, n0, _Lo, 0) + +INTEGER: StaticSchema = (7, n0, _I, 0) + +QUERY_STATISTICS_FOR_DESCRIBE_QUERY: StaticSchema = ( + 18, + n0, + _QSFDQ, + 0, + (_EMv, _ES, _BS, _ETIM, _CTre), + ((LONG, 0), (LONG, 0), (LONG, 0), (INTEGER, 0), (DATE, 0)), +) + +DESCRIBE_QUERY_OUTPUT: StaticSchema = ( + 18, + n0, + _DQO, + {_sSI: _cDQRo, _smit: None}, + (_QI, _QSue, _QS, _QSuer, _EM, _DSU, _DS, _P, _EDSOAI), + ( + (UUID, 0), + (QUERY_STATEMENT, 0), + (QUERY_STATUS, 0), + (QUERY_STATISTICS_FOR_DESCRIBE_QUERY, 0), + (ERROR_MESSAGE, 0), + (DELIVERY_S3_URI, 0), + (DELIVERY_STATUS, 0), + (PROMPT, 0), + (ACCOUNT_ID, 0), + ), ) -CREATE_EVENT_DATA_STORE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#CreateEventDataStoreOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#CreateEventDataStoreResponse", - ) - ], - members={ - "EventDataStoreArn": {"target": EVENT_DATA_STORE_ARN}, - "Name": {"target": EVENT_DATA_STORE_NAME}, - "Status": {"target": EVENT_DATA_STORE_STATUS}, - "AdvancedEventSelectors": {"target": ADVANCED_EVENT_SELECTORS}, - "MultiRegionEnabled": {"target": BOOLEAN}, - "OrganizationEnabled": {"target": BOOLEAN}, - "RetentionPeriod": {"target": RETENTION_PERIOD}, - "TerminationProtectionEnabled": {"target": TERMINATION_PROTECTION_ENABLED}, - "TagsList": {"target": TAGS_LIST}, - "CreatedTimestamp": {"target": DATE}, - "UpdatedTimestamp": {"target": DATE}, - "KmsKeyId": {"target": EVENT_DATA_STORE_KMS_KEY_ID}, - "BillingMode": {"target": BILLING_MODE}, - }, +DESCRIBE_QUERY: StaticOperationSchema = ( + 23, + n0, + _DQ, + 0, + DESCRIBE_QUERY_INPUT, + DESCRIBE_QUERY_OUTPUT, + ( + EVENT_DATA_STORE_ARN_INVALID_EXCEPTION, + EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, + INACTIVE_EVENT_DATA_STORE_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + QUERY_ID_NOT_FOUND_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -EVENT_DATA_STORE_ALREADY_EXISTS_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#EventDataStoreAlreadyExistsException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "EventDataStoreAlreadyExists", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -EVENT_DATA_STORE_MAX_LIMIT_EXCEEDED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#EventDataStoreMaxLimitExceededException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "EventDataStoreMaxLimitExceeded", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, +TRAIL_NAME_LIST: StaticSchema = (16, n0, _TNL, 0, (_m,), ((STRING, 0),)) + +DESCRIBE_TRAILS_INPUT: StaticSchema = ( + 18, + n0, + _DTIe, + {_sSI: _cDTRom, _smi: None}, + (_tNL, _iST), + ((TRAIL_NAME_LIST, 0), (BOOLEAN, 0)), +) + +TRAIL: StaticSchema = ( + 18, + n0, + _Tr, + 0, + ( + _N, + _SBN, + _SKP, + _STN, + _STARN, + _IGSE, + _IMRT, + _HR, + _TARN, + _LFVE, + _CWLLGA, + _CWLRA, + _KKI, + _HCES, + _HIS, + _IOT, + _RL, + ), + ( + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (BOOLEAN, 0), + (BOOLEAN, 0), + (STRING, 0), + (STRING, 0), + (BOOLEAN, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (BOOLEAN, 0), + (BOOLEAN, 0), + (BOOLEAN, 0), + (BOOLEAN, 0), + ), ) -INSUFFICIENT_DEPENDENCY_SERVICE_ACCESS_PERMISSION_EXCEPTION = Schema.collection( - id=ShapeID( - "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException" +TRAIL_LIST: StaticSchema = (16, n0, _TLr, 0, (_m,), ((TRAIL, 0),)) + +DESCRIBE_TRAILS_OUTPUT: StaticSchema = ( + 18, + n0, + _DTOe, + {_sSI: _cDTRoma, _smit: None}, + (_tL,), + ((TRAIL_LIST, 0),), +) + +DESCRIBE_TRAILS: StaticOperationSchema = ( + 23, + n0, + _DTes, + 0, + DESCRIBE_TRAILS_INPUT, + DESCRIBE_TRAILS_OUTPUT, + ( + CLOUD_TRAIL_ARN_INVALID_EXCEPTION, + INVALID_TRAIL_NAME_EXCEPTION, + NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, ), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - { - "code": "InsufficientDependencyServiceAccessPermission", - "httpResponseCode": 400, - } - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -INVALID_EVENT_SELECTORS_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#InvalidEventSelectorsException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "InvalidEventSelectors", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -INVALID_KMS_KEY_ID_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#InvalidKmsKeyIdException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "InvalidKmsKeyId", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -KMS_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#KmsException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType({"code": "KmsException", "httpResponseCode": 400}), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -KMS_KEY_NOT_FOUND_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#KmsKeyNotFoundException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType({"code": "KmsKeyNotFound", "httpResponseCode": 400}), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -ORGANIZATION_NOT_IN_ALL_FEATURES_MODE_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#OrganizationNotInAllFeaturesModeException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "OrganizationNotInAllFeaturesMode", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -ORGANIZATIONS_NOT_IN_USE_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#OrganizationsNotInUseException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=404), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "OrganizationsNotInUse", "httpResponseCode": 404} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -THROTTLING_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ThrottlingException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=429), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "ThrottlingException", "httpResponseCode": 429} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, ) -CREATE_EVENT_DATA_STORE = Schema( - id=ShapeID("com.amazonaws.cloudtrail#CreateEventDataStore"), - shape_type=ShapeType.OPERATION, +CONCURRENT_MODIFICATION_EXCEPTION: StaticSchema = ( + 18, + n0, + _CME, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +DISABLE_FEDERATION_INPUT: StaticSchema = ( + 18, + n0, + _DFI, + {_sSI: _cDFR, _smi: None}, + (_EDS,), + ((EVENT_DATA_STORE_ARN, 1),), +) + +FEDERATION_STATUS: StaticSchema = ( + 14, + n0, + _FSe, + 0, + (_ENABLING, _ENABLED, _DISABLING, _DISABLED), + ( + (-1, {_sV: _ENABLING}), + (-1, {_sV: _ENABLED}), + (-1, {_sV: _DISABLING}), + (-1, {_sV: _DISABLED}), + ), ) -CLOUD_TRAIL_INVALID_CLIENT_TOKEN_ID_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#CloudTrailInvalidClientTokenIdException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "CloudTrailInvalidClientTokenId", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -CLOUD_WATCH_LOGS_DELIVERY_UNAVAILABLE_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#CloudWatchLogsDeliveryUnavailableException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "CloudWatchLogsDeliveryUnavailable", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -CREATE_TRAIL_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#CreateTrailInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#CreateTrailRequest", - ) - ], - members={ - "Name": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "S3BucketName": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "S3KeyPrefix": {"target": STRING}, - "SnsTopicName": {"target": STRING}, - "IncludeGlobalServiceEvents": {"target": BOOLEAN}, - "IsMultiRegionTrail": {"target": BOOLEAN}, - "EnableLogFileValidation": {"target": BOOLEAN}, - "CloudWatchLogsLogGroupArn": {"target": STRING}, - "CloudWatchLogsRoleArn": {"target": STRING}, - "KmsKeyId": {"target": STRING}, - "IsOrganizationTrail": {"target": BOOLEAN}, - "TagsList": {"target": TAGS_LIST}, - "RecursiveLogging": {"target": BOOLEAN}, - }, +DISABLE_FEDERATION_OUTPUT: StaticSchema = ( + 18, + n0, + _DFO, + {_sSI: _cDFRo, _smit: None}, + (_EDSA, _FSe), + ((EVENT_DATA_STORE_ARN, 0), (FEDERATION_STATUS, 0)), +) + +DISABLE_FEDERATION: StaticOperationSchema = ( + 23, + n0, + _DF, + 0, + DISABLE_FEDERATION_INPUT, + DISABLE_FEDERATION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CLOUD_TRAIL_ACCESS_NOT_ENABLED_EXCEPTION, + CONCURRENT_MODIFICATION_EXCEPTION, + EVENT_DATA_STORE_ARN_INVALID_EXCEPTION, + EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, + INACTIVE_EVENT_DATA_STORE_EXCEPTION, + INSUFFICIENT_DEPENDENCY_SERVICE_ACCESS_PERMISSION_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, + NOT_ORGANIZATION_MASTER_ACCOUNT_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + ORGANIZATION_NOT_IN_ALL_FEATURES_MODE_EXCEPTION, + ORGANIZATIONS_NOT_IN_USE_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -CREATE_TRAIL_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#CreateTrailOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#CreateTrailResponse", - ) - ], - members={ - "Name": {"target": STRING}, - "S3BucketName": {"target": STRING}, - "S3KeyPrefix": {"target": STRING}, - "SnsTopicName": {"target": STRING}, - "SnsTopicARN": {"target": STRING}, - "IncludeGlobalServiceEvents": {"target": BOOLEAN}, - "IsMultiRegionTrail": {"target": BOOLEAN}, - "TrailARN": {"target": STRING}, - "LogFileValidationEnabled": {"target": BOOLEAN}, - "CloudWatchLogsLogGroupArn": {"target": STRING}, - "CloudWatchLogsRoleArn": {"target": STRING}, - "KmsKeyId": {"target": STRING}, - "IsOrganizationTrail": {"target": BOOLEAN}, - "RecursiveLogging": {"target": BOOLEAN}, - }, +FEDERATION_ROLE_ARN: StaticSchema = (3, n0, _FRA, 0) + +ENABLE_FEDERATION_INPUT: StaticSchema = ( + 18, + n0, + _EFI, + {_sSI: _cEFR, _smi: None}, + (_EDS, _FRA), + ((EVENT_DATA_STORE_ARN, 1), (FEDERATION_ROLE_ARN, 1)), +) + +ENABLE_FEDERATION_OUTPUT: StaticSchema = ( + 18, + n0, + _EFO, + {_sSI: _cEFRo, _smit: None}, + (_EDSA, _FSe, _FRA), + ((EVENT_DATA_STORE_ARN, 0), (FEDERATION_STATUS, 0), (FEDERATION_ROLE_ARN, 0)), +) + +ENABLE_FEDERATION: StaticOperationSchema = ( + 23, + n0, + _EF, + 0, + ENABLE_FEDERATION_INPUT, + ENABLE_FEDERATION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CLOUD_TRAIL_ACCESS_NOT_ENABLED_EXCEPTION, + CONCURRENT_MODIFICATION_EXCEPTION, + EVENT_DATA_STORE_ARN_INVALID_EXCEPTION, + EVENT_DATA_STORE_FEDERATION_ENABLED_EXCEPTION, + EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, + INACTIVE_EVENT_DATA_STORE_EXCEPTION, + INSUFFICIENT_DEPENDENCY_SERVICE_ACCESS_PERMISSION_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, + NOT_ORGANIZATION_MASTER_ACCOUNT_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + ORGANIZATION_NOT_IN_ALL_FEATURES_MODE_EXCEPTION, + ORGANIZATIONS_NOT_IN_USE_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -INSUFFICIENT_S3_BUCKET_POLICY_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#InsufficientS3BucketPolicyException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=403), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "InsufficientS3BucketPolicy", "httpResponseCode": 403} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -INSUFFICIENT_SNS_TOPIC_POLICY_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#InsufficientSnsTopicPolicyException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=403), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "InsufficientSnsTopicPolicy", "httpResponseCode": 403} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -INVALID_CLOUD_WATCH_LOGS_LOG_GROUP_ARN_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#InvalidCloudWatchLogsLogGroupArnException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "InvalidCloudWatchLogsLogGroupArn", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -INVALID_CLOUD_WATCH_LOGS_ROLE_ARN_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#InvalidCloudWatchLogsRoleArnException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "InvalidCloudWatchLogsRoleArn", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -INVALID_PARAMETER_COMBINATION_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#InvalidParameterCombinationException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "InvalidParameterCombinationError", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -INVALID_S3_BUCKET_NAME_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#InvalidS3BucketNameException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "InvalidS3BucketName", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -INVALID_S3_PREFIX_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#InvalidS3PrefixException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "InvalidS3Prefix", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -INVALID_SNS_TOPIC_NAME_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#InvalidSnsTopicNameException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "InvalidSnsTopicName", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -KMS_KEY_DISABLED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#KmsKeyDisabledException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType({"code": "KmsKeyDisabled", "httpResponseCode": 400}), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -MAXIMUM_NUMBER_OF_TRAILS_EXCEEDED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#MaximumNumberOfTrailsExceededException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=403), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "MaximumNumberOfTrailsExceeded", "httpResponseCode": 403} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -S3_BUCKET_DOES_NOT_EXIST_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#S3BucketDoesNotExistException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=404), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "S3BucketDoesNotExist", "httpResponseCode": 404} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -TRAIL_ALREADY_EXISTS_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#TrailAlreadyExistsException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "TrailAlreadyExists", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -TRAIL_NOT_PROVIDED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#TrailNotProvidedException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=404), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "TrailNotProvided", "httpResponseCode": 404} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -CREATE_TRAIL = Schema( - id=ShapeID("com.amazonaws.cloudtrail#CreateTrail"), shape_type=ShapeType.OPERATION -) - -DELETE_CHANNEL_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#DeleteChannelInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#DeleteChannelRequest", - ) - ], - members={ - "Channel": { - "target": CHANNEL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +EVENT_DATA_STORE_LIST: StaticSchema = ( + 16, + n0, + _EDSL, + 0, + (_m,), + ((EVENT_DATA_STORE_ARN, 0),), +) + +GENERATE_QUERY_INPUT: StaticSchema = ( + 18, + n0, + _GQI, + {_sSI: _cGQR, _smi: None}, + (_EDSv, _P), + ((EVENT_DATA_STORE_LIST, 1), (PROMPT, 1)), +) + +GENERATE_QUERY_OUTPUT: StaticSchema = ( + 18, + n0, + _GQO, + {_sSI: _cGQRo, _smit: None}, + (_QSu, _QA, _EDSOAI), + ((QUERY_STATEMENT, 0), (QUERY_ALIAS, 0), (ACCOUNT_ID, 0)), +) + +GENERATE_RESPONSE_EXCEPTION: StaticSchema = ( + 18, + n0, + _GRE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +GENERATE_QUERY: StaticOperationSchema = ( + 23, + n0, + _GQ, + 0, + GENERATE_QUERY_INPUT, + GENERATE_QUERY_OUTPUT, + ( + EVENT_DATA_STORE_ARN_INVALID_EXCEPTION, + EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, + GENERATE_RESPONSE_EXCEPTION, + INACTIVE_EVENT_DATA_STORE_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -DELETE_CHANNEL_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#DeleteChannelOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#DeleteChannelResponse", - ) - ], -) - -DELETE_CHANNEL = Schema( - id=ShapeID("com.amazonaws.cloudtrail#DeleteChannel"), shape_type=ShapeType.OPERATION -) - -DELETE_DASHBOARD_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#DeleteDashboardInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#DeleteDashboardRequest", - ) - ], - members={ - "DashboardId": { - "target": DASHBOARD_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +GET_CHANNEL_INPUT: StaticSchema = ( + 18, + n0, + _GCI, + {_sSI: _cGCR, _smi: None}, + (_C,), + ((CHANNEL_ARN, 1),), +) + +INGESTION_STATUS: StaticSchema = ( + 18, + n0, + _IS, + 0, + (_LIST, _LISEID, _LIEC, _LIAT, _LIAEID), + ((DATE, 0), (UUID, 0), (ERROR_MESSAGE, 0), (DATE, 0), (UUID, 0)), +) + +SOURCE_CONFIG: StaticSchema = ( + 18, + n0, + _SC, + 0, + (_ATAR, _AESd), + ((BOOLEAN, 0), (ADVANCED_EVENT_SELECTORS, 0)), +) + +GET_CHANNEL_OUTPUT: StaticSchema = ( + 18, + n0, + _GCO, + {_sSI: _cGCRo, _smit: None}, + (_CA, _N, _So, _SC, _Des, _IS), + ( + (CHANNEL_ARN, 0), + (CHANNEL_NAME, 0), + (SOURCE, 0), + (SOURCE_CONFIG, 0), + (DESTINATIONS, 0), + (INGESTION_STATUS, 0), + ), ) -DELETE_DASHBOARD_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#DeleteDashboardOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#DeleteDashboardResponse", - ) - ], -) - -DELETE_DASHBOARD = Schema( - id=ShapeID("com.amazonaws.cloudtrail#DeleteDashboard"), - shape_type=ShapeType.OPERATION, -) - -DELETE_EVENT_DATA_STORE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#DeleteEventDataStoreInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#DeleteEventDataStoreRequest", - ) - ], - members={ - "EventDataStore": { - "target": EVENT_DATA_STORE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +GET_CHANNEL: StaticOperationSchema = ( + 23, + n0, + _GC, + 0, + GET_CHANNEL_INPUT, + GET_CHANNEL_OUTPUT, + ( + CHANNEL_ARN_INVALID_EXCEPTION, + CHANNEL_NOT_FOUND_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -DELETE_EVENT_DATA_STORE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#DeleteEventDataStoreOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#DeleteEventDataStoreResponse", - ) - ], -) - -EVENT_DATA_STORE_FEDERATION_ENABLED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#EventDataStoreFederationEnabledException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "EventDataStoreFederationEnabled", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -EVENT_DATA_STORE_HAS_ONGOING_IMPORT_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#EventDataStoreHasOngoingImportException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "EventDataStoreHasOngoingImport", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -EVENT_DATA_STORE_TERMINATION_PROTECTED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#EventDataStoreTerminationProtectedException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - { - "code": "EventDataStoreTerminationProtectedException", - "httpResponseCode": 400, - } - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, +GET_DASHBOARD_INPUT: StaticSchema = ( + 18, + n0, + _GDI, + {_sSI: _cGDR, _smi: None}, + (_DI,), + ((DASHBOARD_ARN, 1),), +) + +DASHBOARD_STATUS: StaticSchema = ( + 14, + n0, + _DSa, + 0, + (_CREATING, _CREATED, _UPDATING, _UPDATED, _DELETING), + ( + (-1, {_sV: _CREATING}), + (-1, {_sV: _CREATED}), + (-1, {_sV: _UPDATING}), + (-1, {_sV: _UPDATED}), + (-1, {_sV: _DELETING}), + ), ) -DELETE_EVENT_DATA_STORE = Schema( - id=ShapeID("com.amazonaws.cloudtrail#DeleteEventDataStore"), - shape_type=ShapeType.OPERATION, +GET_DASHBOARD_OUTPUT: StaticSchema = ( + 18, + n0, + _GDO, + {_sSI: _cGDRo, _smit: None}, + (_DA, _Ty, _St, _W, _RS, _CT, _UT, _LRI, _LRFR, _TPE), + ( + (DASHBOARD_ARN, 0), + (DASHBOARD_TYPE, 0), + (DASHBOARD_STATUS, 0), + (WIDGET_LIST, 0), + (REFRESH_SCHEDULE, 0), + (DATE, 0), + (DATE, 0), + (REFRESH_ID, 0), + (ERROR_MESSAGE, 0), + (TERMINATION_PROTECTION_ENABLED, 0), + ), ) -RESOURCE_ARN = Schema( - id=ShapeID("com.amazonaws.cloudtrail#ResourceArn"), shape_type=ShapeType.STRING +GET_DASHBOARD: StaticOperationSchema = ( + 23, + n0, + _GD, + 0, + GET_DASHBOARD_INPUT, + GET_DASHBOARD_OUTPUT, + (RESOURCE_NOT_FOUND_EXCEPTION, UNSUPPORTED_OPERATION_EXCEPTION), +) + +GET_EVENT_CONFIGURATION_INPUT: StaticSchema = ( + 18, + n0, + _GECI, + {_sSI: _cGECR, _smi: None}, + (_TN, _EDS), + ((STRING, 0), (STRING, 0)), +) + +OPERATOR_TARGET_LIST_MEMBER: StaticSchema = (3, n0, _OTLM, 0) + +OPERATOR_TARGET_LIST: StaticSchema = ( + 16, + n0, + _OTL, + 0, + (_m,), + ((OPERATOR_TARGET_LIST_MEMBER, 0),), +) + +TYPE: StaticSchema = (14, n0, _Ty, 0, (_TC, _RC), ((-1, {_sV: _TC}), (-1, {_sV: _RC}))) + +CONTEXT_KEY_SELECTOR: StaticSchema = ( + 18, + n0, + _CKS, + 0, + (_Ty, _E), + ((TYPE, 1), (OPERATOR_TARGET_LIST, 1)), +) + +CONTEXT_KEY_SELECTORS: StaticSchema = ( + 16, + n0, + _CKSo, + 0, + (_m,), + ((CONTEXT_KEY_SELECTOR, 0),), +) + +MAX_EVENT_SIZE: StaticSchema = ( + 14, + n0, + _MES, + 0, + (_Sta, _La), + ((-1, {_sV: _Sta}), (-1, {_sV: _La})), +) + +GET_EVENT_CONFIGURATION_OUTPUT: StaticSchema = ( + 18, + n0, + _GECO, + {_sSI: _cGECRo, _smit: None}, + (_TARN, _EDSA, _MES, _CKSo, _ACg), + ( + (STRING, 0), + (EVENT_DATA_STORE_ARN, 0), + (MAX_EVENT_SIZE, 0), + (CONTEXT_KEY_SELECTORS, 0), + (AGGREGATION_CONFIGURATIONS, 0), + ), ) -DELETE_RESOURCE_POLICY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#DeleteResourcePolicyInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#DeleteResourcePolicyRequest", - ) - ], - members={ - "ResourceArn": { - "target": RESOURCE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +INVALID_EVENT_DATA_STORE_STATUS_EXCEPTION: StaticSchema = ( + 18, + n0, + _IEDSSE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +GET_EVENT_CONFIGURATION: StaticOperationSchema = ( + 23, + n0, + _GEC, + 0, + GET_EVENT_CONFIGURATION_INPUT, + GET_EVENT_CONFIGURATION_OUTPUT, + ( + CLOUD_TRAIL_ARN_INVALID_EXCEPTION, + EVENT_DATA_STORE_ARN_INVALID_EXCEPTION, + EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, + INVALID_EVENT_DATA_STORE_CATEGORY_EXCEPTION, + INVALID_EVENT_DATA_STORE_STATUS_EXCEPTION, + INVALID_PARAMETER_COMBINATION_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + INVALID_TRAIL_NAME_EXCEPTION, + NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + TRAIL_NOT_FOUND_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -DELETE_RESOURCE_POLICY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#DeleteResourcePolicyOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#DeleteResourcePolicyResponse", - ) - ], -) - -RESOURCE_ARN_NOT_VALID_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ResourceARNNotValidException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "ResourceARNNotValid", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -RESOURCE_POLICY_NOT_FOUND_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ResourcePolicyNotFoundException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=404), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "ResourcePolicyNotFound", "httpResponseCode": 404} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -DELETE_RESOURCE_POLICY = Schema( - id=ShapeID("com.amazonaws.cloudtrail#DeleteResourcePolicy"), - shape_type=ShapeType.OPERATION, -) - -DELETE_TRAIL_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#DeleteTrailInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#DeleteTrailRequest", - ) - ], - members={ - "Name": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +GET_EVENT_DATA_STORE_INPUT: StaticSchema = ( + 18, + n0, + _GEDSI, + {_sSI: _cGEDSR, _smi: None}, + (_EDS,), + ((EVENT_DATA_STORE_ARN, 1),), +) + +PARTITION_KEY_NAME: StaticSchema = (3, n0, _PKN, 0) + +PARTITION_KEY_TYPE: StaticSchema = (3, n0, _PKT, 0) + +PARTITION_KEY: StaticSchema = ( + 18, + n0, + _PK, + 0, + (_N, _Ty), + ((PARTITION_KEY_NAME, 1), (PARTITION_KEY_TYPE, 1)), +) + +PARTITION_KEY_LIST: StaticSchema = (16, n0, _PKL, 0, (_m,), ((PARTITION_KEY, 0),)) + +GET_EVENT_DATA_STORE_OUTPUT: StaticSchema = ( + 18, + n0, + _GEDSO, + {_sSI: _cGEDSRo, _smit: None}, + ( + _EDSA, + _N, + _St, + _AESd, + _MRE, + _OE, + _RP, + _TPE, + _CT, + _UT, + _KKI, + _BM, + _FSe, + _FRA, + _PKa, + ), + ( + (EVENT_DATA_STORE_ARN, 0), + (EVENT_DATA_STORE_NAME, 0), + (EVENT_DATA_STORE_STATUS, 0), + (ADVANCED_EVENT_SELECTORS, 0), + (BOOLEAN, 0), + (BOOLEAN, 0), + (RETENTION_PERIOD, 0), + (TERMINATION_PROTECTION_ENABLED, 0), + (DATE, 0), + (DATE, 0), + (EVENT_DATA_STORE_KMS_KEY_ID, 0), + (BILLING_MODE, 0), + (FEDERATION_STATUS, 0), + (FEDERATION_ROLE_ARN, 0), + (PARTITION_KEY_LIST, 0), + ), ) -DELETE_TRAIL_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#DeleteTrailOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#DeleteTrailResponse", - ) - ], -) - -INVALID_HOME_REGION_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#InvalidHomeRegionException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "InvalidHomeRegion", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -TRAIL_NOT_FOUND_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#TrailNotFoundException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=404), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType({"code": "TrailNotFound", "httpResponseCode": 404}), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -DELETE_TRAIL = Schema( - id=ShapeID("com.amazonaws.cloudtrail#DeleteTrail"), shape_type=ShapeType.OPERATION -) - -DEREGISTER_ORGANIZATION_DELEGATED_ADMIN_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#DeregisterOrganizationDelegatedAdminInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#DeregisterOrganizationDelegatedAdminRequest", - ) - ], - members={ - "DelegatedAdminAccountId": { - "target": ACCOUNT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +GET_EVENT_DATA_STORE: StaticOperationSchema = ( + 23, + n0, + _GEDS, + 0, + GET_EVENT_DATA_STORE_INPUT, + GET_EVENT_DATA_STORE_OUTPUT, + ( + EVENT_DATA_STORE_ARN_INVALID_EXCEPTION, + EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -DEREGISTER_ORGANIZATION_DELEGATED_ADMIN_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#DeregisterOrganizationDelegatedAdminOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#DeregisterOrganizationDelegatedAdminResponse", - ) - ], -) - -NOT_ORGANIZATION_MANAGEMENT_ACCOUNT_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#NotOrganizationManagementAccountException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=403), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "NotOrganizationManagementAccount", "httpResponseCode": 403} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, +GET_EVENT_SELECTORS_INPUT: StaticSchema = ( + 18, + n0, + _GESI, + {_sSI: _cGESR, _smi: None}, + (_TN,), + ((STRING, 1),), +) + +DATA_RESOURCE_VALUES: StaticSchema = (16, n0, _DRV, 0, (_m,), ((STRING, 0),)) + +DATA_RESOURCE: StaticSchema = ( + 18, + n0, + _DR, + 0, + (_Ty, _Va), + ((STRING, 0), (DATA_RESOURCE_VALUES, 0)), +) + +DATA_RESOURCES: StaticSchema = (16, n0, _DRa, 0, (_m,), ((DATA_RESOURCE, 0),)) + +EXCLUDE_MANAGEMENT_EVENT_SOURCES: StaticSchema = ( + 16, + n0, + _EMES, + 0, + (_m,), + ((STRING, 0),), +) + +READ_WRITE_TYPE: StaticSchema = ( + 14, + n0, + _RWT, + 0, + (_RO, _WO, _A), + ((-1, {_sV: _RO}), (-1, {_sV: _WO}), (-1, {_sV: _A})), +) + +EVENT_SELECTOR: StaticSchema = ( + 18, + n0, + _ESv, + 0, + (_RWT, _IME, _DRa, _EMES), + ( + (READ_WRITE_TYPE, 0), + (BOOLEAN, 0), + (DATA_RESOURCES, 0), + (EXCLUDE_MANAGEMENT_EVENT_SOURCES, 0), + ), ) -DEREGISTER_ORGANIZATION_DELEGATED_ADMIN = Schema( - id=ShapeID("com.amazonaws.cloudtrail#DeregisterOrganizationDelegatedAdmin"), - shape_type=ShapeType.OPERATION, +EVENT_SELECTORS: StaticSchema = (16, n0, _ESve, 0, (_m,), ((EVENT_SELECTOR, 0),)) + +GET_EVENT_SELECTORS_OUTPUT: StaticSchema = ( + 18, + n0, + _GESO, + {_sSI: _cGESRo, _smit: None}, + (_TARN, _ESve, _AESd), + ((STRING, 0), (EVENT_SELECTORS, 0), (ADVANCED_EVENT_SELECTORS, 0)), +) + +GET_EVENT_SELECTORS: StaticOperationSchema = ( + 23, + n0, + _GES, + 0, + GET_EVENT_SELECTORS_INPUT, + GET_EVENT_SELECTORS_OUTPUT, + ( + CLOUD_TRAIL_ARN_INVALID_EXCEPTION, + INVALID_TRAIL_NAME_EXCEPTION, + NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + TRAIL_NOT_FOUND_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -REFRESH_ID = Schema( - id=ShapeID("com.amazonaws.cloudtrail#RefreshId"), shape_type=ShapeType.STRING +GET_IMPORT_INPUT: StaticSchema = ( + 18, + n0, + _GII, + {_sSI: _cGIR, _smi: None}, + (_II,), + ((UUID, 1),), +) + +IMPORT_DESTINATIONS: StaticSchema = ( + 16, + n0, + _ID, + 0, + (_m,), + ((EVENT_DATA_STORE_ARN, 0),), +) + +S3_IMPORT_SOURCE: StaticSchema = ( + 18, + n0, + _SIS, + 0, + (_SLU, _SBR, _SBARA), + ((STRING, 1), (STRING, 1), (STRING, 1)), +) + +IMPORT_SOURCE: StaticSchema = (18, n0, _ISm, 0, (_S_,), ((S3_IMPORT_SOURCE, 1),)) + +IMPORT_STATISTICS: StaticSchema = ( + 18, + n0, + _ISmp, + 0, + (_PF, _PC, _FC, _ECv, _FE), + ((LONG, 0), (LONG, 0), (LONG, 0), (LONG, 0), (LONG, 0)), +) + +IMPORT_STATUS: StaticSchema = ( + 14, + n0, + _ISmpo, + 0, + (_INITIALIZING, _IP, _FAILED, _STOPPED, _COMPLETED), + ( + (-1, {_sV: _INITIALIZING}), + (-1, {_sV: _IP}), + (-1, {_sV: _FAILED}), + (-1, {_sV: _STOPPED}), + (-1, {_sV: _COMPLETED}), + ), ) -DESCRIBE_QUERY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#DescribeQueryInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#DescribeQueryRequest", - ) - ], - members={ - "EventDataStore": {"target": EVENT_DATA_STORE_ARN}, - "QueryId": {"target": UUID}, - "QueryAlias": {"target": QUERY_ALIAS}, - "RefreshId": {"target": REFRESH_ID}, - "EventDataStoreOwnerAccountId": {"target": ACCOUNT_ID}, - }, +GET_IMPORT_OUTPUT: StaticSchema = ( + 18, + n0, + _GIO, + {_sSI: _cGIRo, _smit: None}, + (_II, _Des, _ISm, _SET, _EET, _ISmpo, _CT, _UT, _ISmp), + ( + (UUID, 0), + (IMPORT_DESTINATIONS, 0), + (IMPORT_SOURCE, 0), + (DATE, 0), + (DATE, 0), + (IMPORT_STATUS, 0), + (DATE, 0), + (DATE, 0), + (IMPORT_STATISTICS, 0), + ), ) -DELIVERY_S3_URI = Schema( - id=ShapeID("com.amazonaws.cloudtrail#DeliveryS3Uri"), shape_type=ShapeType.STRING +IMPORT_NOT_FOUND_EXCEPTION: StaticSchema = ( + 18, + n0, + _INFE, + {_s: _c, _sE: 404}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +GET_IMPORT: StaticOperationSchema = ( + 23, + n0, + _GI, + 0, + GET_IMPORT_INPUT, + GET_IMPORT_OUTPUT, + ( + IMPORT_NOT_FOUND_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -DELIVERY_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#DeliveryStatus"), - shape_type=ShapeType.ENUM, - members={ - "SUCCESS": {"target": UNIT}, - "FAILED": {"target": UNIT}, - "FAILED_SIGNING_FILE": {"target": UNIT}, - "PENDING": {"target": UNIT}, - "RESOURCE_NOT_FOUND": {"target": UNIT}, - "ACCESS_DENIED": {"target": UNIT}, - "ACCESS_DENIED_SIGNING_FILE": {"target": UNIT}, - "CANCELLED": {"target": UNIT}, - "UNKNOWN": {"target": UNIT}, - }, +GET_INSIGHT_SELECTORS_INPUT: StaticSchema = ( + 18, + n0, + _GISI, + {_sSI: _cGISR, _smi: None}, + (_TN, _EDS), + ((STRING, 0), (EVENT_DATA_STORE_ARN, 0)), +) + +SOURCE_EVENT_CATEGORY: StaticSchema = ( + 14, + n0, + _SEC, + 0, + (_Ma, _D), + ((-1, {_sV: _Ma}), (-1, {_sV: _D})), +) + +SOURCE_EVENT_CATEGORIES: StaticSchema = ( + 16, + n0, + _SECo, + 0, + (_m,), + ((SOURCE_EVENT_CATEGORY, 0),), +) + +INSIGHT_TYPE: StaticSchema = ( + 14, + n0, + _IT, + 0, + (_ACRI, _AERI), + ((-1, {_sV: _ACRI}), (-1, {_sV: _AERI})), +) + +INSIGHT_SELECTOR: StaticSchema = ( + 18, + n0, + _ISn, + 0, + (_IT, _ECve), + ((INSIGHT_TYPE, 0), (SOURCE_EVENT_CATEGORIES, 0)), +) + +INSIGHT_SELECTORS: StaticSchema = (16, n0, _ISns, 0, (_m,), ((INSIGHT_SELECTOR, 0),)) + +GET_INSIGHT_SELECTORS_OUTPUT: StaticSchema = ( + 18, + n0, + _GISO, + {_sSI: _cGISRo, _smit: None}, + (_TARN, _ISns, _EDSA, _IDn), + ( + (STRING, 0), + (INSIGHT_SELECTORS, 0), + (EVENT_DATA_STORE_ARN, 0), + (EVENT_DATA_STORE_ARN, 0), + ), ) -PROMPT = Schema( - id=ShapeID("com.amazonaws.cloudtrail#Prompt"), shape_type=ShapeType.STRING +INSIGHT_NOT_ENABLED_EXCEPTION: StaticSchema = ( + 18, + n0, + _INEE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +GET_INSIGHT_SELECTORS: StaticOperationSchema = ( + 23, + n0, + _GIS, + 0, + GET_INSIGHT_SELECTORS_INPUT, + GET_INSIGHT_SELECTORS_OUTPUT, + ( + CLOUD_TRAIL_ARN_INVALID_EXCEPTION, + INSIGHT_NOT_ENABLED_EXCEPTION, + INVALID_PARAMETER_COMBINATION_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + INVALID_TRAIL_NAME_EXCEPTION, + NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + THROTTLING_EXCEPTION, + TRAIL_NOT_FOUND_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -LONG = Schema(id=ShapeID("com.amazonaws.cloudtrail#Long"), shape_type=ShapeType.LONG) +MAX_QUERY_RESULTS: StaticSchema = (7, n0, _MQR, 0) -INTEGER = Schema( - id=ShapeID("com.amazonaws.cloudtrail#Integer"), shape_type=ShapeType.INTEGER -) +PAGINATION_TOKEN: StaticSchema = (3, n0, _PT, 0) -QUERY_STATISTICS_FOR_DESCRIBE_QUERY = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#QueryStatisticsForDescribeQuery"), - members={ - "EventsMatched": {"target": LONG}, - "EventsScanned": {"target": LONG}, - "BytesScanned": {"target": LONG}, - "ExecutionTimeInMillis": {"target": INTEGER}, - "CreationTime": {"target": DATE}, - }, +GET_QUERY_RESULTS_INPUT: StaticSchema = ( + 18, + n0, + _GQRI, + {_sSI: _cGQRR, _smi: None}, + (_EDS, _QI, _NT, _MQR, _EDSOAI), + ( + (EVENT_DATA_STORE_ARN, 0), + (UUID, 1), + (PAGINATION_TOKEN, 0), + (MAX_QUERY_RESULTS, 0), + (ACCOUNT_ID, 0), + ), ) -DESCRIBE_QUERY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#DescribeQueryOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#DescribeQueryResponse", - ) - ], - members={ - "QueryId": {"target": UUID}, - "QueryString": {"target": QUERY_STATEMENT}, - "QueryStatus": {"target": QUERY_STATUS}, - "QueryStatistics": {"target": QUERY_STATISTICS_FOR_DESCRIBE_QUERY}, - "ErrorMessage": {"target": ERROR_MESSAGE}, - "DeliveryS3Uri": {"target": DELIVERY_S3_URI}, - "DeliveryStatus": {"target": DELIVERY_STATUS}, - "Prompt": {"target": PROMPT}, - "EventDataStoreOwnerAccountId": {"target": ACCOUNT_ID}, - }, -) +QUERY_RESULT_KEY: StaticSchema = (3, n0, _QRK, 0) -DESCRIBE_QUERY = Schema( - id=ShapeID("com.amazonaws.cloudtrail#DescribeQuery"), shape_type=ShapeType.OPERATION -) +QUERY_RESULT_VALUE: StaticSchema = (3, n0, _QRV, 0) -TRAIL_NAME_LIST = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#TrailNameList"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, +QUERY_RESULT_COLUMN: StaticSchema = ( + 17, + n0, + _QRC, + 0, + (_k, _v), + ((QUERY_RESULT_KEY, 0), (QUERY_RESULT_VALUE, 0)), ) -DESCRIBE_TRAILS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#DescribeTrailsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#DescribeTrailsRequest", - ) - ], - members={ - "trailNameList": {"target": TRAIL_NAME_LIST}, - "includeShadowTrails": {"target": BOOLEAN}, - }, -) +QUERY_RESULT_ROW: StaticSchema = (16, n0, _QRR, 0, (_m,), ((QUERY_RESULT_COLUMN, 0),)) -TRAIL = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#Trail"), - members={ - "Name": {"target": STRING}, - "S3BucketName": {"target": STRING}, - "S3KeyPrefix": {"target": STRING}, - "SnsTopicName": {"target": STRING}, - "SnsTopicARN": {"target": STRING}, - "IncludeGlobalServiceEvents": {"target": BOOLEAN}, - "IsMultiRegionTrail": {"target": BOOLEAN}, - "HomeRegion": {"target": STRING}, - "TrailARN": {"target": STRING}, - "LogFileValidationEnabled": {"target": BOOLEAN}, - "CloudWatchLogsLogGroupArn": {"target": STRING}, - "CloudWatchLogsRoleArn": {"target": STRING}, - "KmsKeyId": {"target": STRING}, - "HasCustomEventSelectors": {"target": BOOLEAN}, - "HasInsightSelectors": {"target": BOOLEAN}, - "IsOrganizationTrail": {"target": BOOLEAN}, - "RecursiveLogging": {"target": BOOLEAN}, - }, -) +QUERY_RESULT_ROWS: StaticSchema = (16, n0, _QRRu, 0, (_m,), ((QUERY_RESULT_ROW, 0),)) -TRAIL_LIST = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#TrailList"), - shape_type=ShapeType.LIST, - members={"member": {"target": TRAIL}}, +QUERY_STATISTICS: StaticSchema = ( + 18, + n0, + _QSuer, + 0, + (_RCe, _TRC, _BS), + ((INTEGER, 0), (INTEGER, 0), (LONG, 0)), ) -DESCRIBE_TRAILS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#DescribeTrailsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#DescribeTrailsResponse", - ) - ], - members={"trailList": {"target": TRAIL_LIST}}, +GET_QUERY_RESULTS_OUTPUT: StaticSchema = ( + 18, + n0, + _GQRO, + {_sSI: _cGQRRo, _smit: None}, + (_QS, _QSuer, _QRRu, _NT, _EM), + ( + (QUERY_STATUS, 0), + (QUERY_STATISTICS, 0), + (QUERY_RESULT_ROWS, 0), + (PAGINATION_TOKEN, 0), + (ERROR_MESSAGE, 0), + ), ) -DESCRIBE_TRAILS = Schema( - id=ShapeID("com.amazonaws.cloudtrail#DescribeTrails"), - shape_type=ShapeType.OPERATION, +INVALID_MAX_RESULTS_EXCEPTION: StaticSchema = ( + 18, + n0, + _IMRE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +INVALID_NEXT_TOKEN_EXCEPTION: StaticSchema = ( + 18, + n0, + _INTE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +GET_QUERY_RESULTS: StaticOperationSchema = ( + 23, + n0, + _GQR, + 0, + GET_QUERY_RESULTS_INPUT, + GET_QUERY_RESULTS_OUTPUT, + ( + EVENT_DATA_STORE_ARN_INVALID_EXCEPTION, + EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, + INACTIVE_EVENT_DATA_STORE_EXCEPTION, + INSUFFICIENT_ENCRYPTION_POLICY_EXCEPTION, + INVALID_MAX_RESULTS_EXCEPTION, + INVALID_NEXT_TOKEN_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + QUERY_ID_NOT_FOUND_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -CONCURRENT_MODIFICATION_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ConcurrentModificationException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "ConcurrentModification", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -DISABLE_FEDERATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#DisableFederationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#DisableFederationRequest", - ) - ], - members={ - "EventDataStore": { - "target": EVENT_DATA_STORE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +GET_RESOURCE_POLICY_INPUT: StaticSchema = ( + 18, + n0, + _GRPI, + {_sSI: _cGRPR, _smi: None}, + (_RAe,), + ((RESOURCE_ARN, 1),), +) + +RESOURCE_POLICY: StaticSchema = (3, n0, _RPe, 0) + +GET_RESOURCE_POLICY_OUTPUT: StaticSchema = ( + 18, + n0, + _GRPO, + {_sSI: _cGRPRo, _smit: None}, + (_RAe, _RPe, _DARP), + ((RESOURCE_ARN, 0), (RESOURCE_POLICY, 0), (RESOURCE_POLICY, 0)), +) + +GET_RESOURCE_POLICY: StaticOperationSchema = ( + 23, + n0, + _GRP, + 0, + GET_RESOURCE_POLICY_INPUT, + GET_RESOURCE_POLICY_OUTPUT, + ( + OPERATION_NOT_PERMITTED_EXCEPTION, + RESOURCE_ARN_NOT_VALID_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + RESOURCE_POLICY_NOT_FOUND_EXCEPTION, + RESOURCE_TYPE_NOT_SUPPORTED_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -FEDERATION_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#FederationStatus"), - shape_type=ShapeType.ENUM, - members={ - "ENABLING": {"target": UNIT}, - "ENABLED": {"target": UNIT}, - "DISABLING": {"target": UNIT}, - "DISABLED": {"target": UNIT}, - }, +GET_TRAIL_INPUT: StaticSchema = ( + 18, + n0, + _GTI, + {_sSI: _cGTR, _smi: None}, + (_N,), + ((STRING, 1),), +) + +GET_TRAIL_OUTPUT: StaticSchema = ( + 18, + n0, + _GTO, + {_sSI: _cGTRo, _smit: None}, + (_Tr,), + ((TRAIL, 0),), +) + +GET_TRAIL: StaticOperationSchema = ( + 23, + n0, + _GT, + 0, + GET_TRAIL_INPUT, + GET_TRAIL_OUTPUT, + ( + CLOUD_TRAIL_ARN_INVALID_EXCEPTION, + INVALID_TRAIL_NAME_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + TRAIL_NOT_FOUND_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -DISABLE_FEDERATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#DisableFederationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#DisableFederationResponse", - ) - ], - members={ - "EventDataStoreArn": {"target": EVENT_DATA_STORE_ARN}, - "FederationStatus": {"target": FEDERATION_STATUS}, - }, +GET_TRAIL_STATUS_INPUT: StaticSchema = ( + 18, + n0, + _GTSI, + {_sSI: _cGTSR, _smi: None}, + (_N,), + ((STRING, 1),), +) + +GET_TRAIL_STATUS_OUTPUT: StaticSchema = ( + 18, + n0, + _GTSO, + {_sSI: _cGTSRo, _smit: None}, + ( + _IL, + _LDE, + _LNE, + _LDT, + _LNT, + _SLT, + _SLTt, + _LCWLDE, + _LCWLDT, + _LDDT, + _LDDE, + _LDAT, + _LNAT, + _LNAS, + _LDAS, + _TLS, + _TLSi, + ), + ( + (BOOLEAN, 0), + (STRING, 0), + (STRING, 0), + (DATE, 0), + (DATE, 0), + (DATE, 0), + (DATE, 0), + (STRING, 0), + (DATE, 0), + (DATE, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + ), ) -DISABLE_FEDERATION = Schema( - id=ShapeID("com.amazonaws.cloudtrail#DisableFederation"), - shape_type=ShapeType.OPERATION, -) - -FEDERATION_ROLE_ARN = Schema( - id=ShapeID("com.amazonaws.cloudtrail#FederationRoleArn"), - shape_type=ShapeType.STRING, -) - -ENABLE_FEDERATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#EnableFederationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#EnableFederationRequest", - ) - ], - members={ - "EventDataStore": { - "target": EVENT_DATA_STORE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "FederationRoleArn": { - "target": FEDERATION_ROLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +GET_TRAIL_STATUS: StaticOperationSchema = ( + 23, + n0, + _GTS, + 0, + GET_TRAIL_STATUS_INPUT, + GET_TRAIL_STATUS_OUTPUT, + ( + CLOUD_TRAIL_ARN_INVALID_EXCEPTION, + INVALID_TRAIL_NAME_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + TRAIL_NOT_FOUND_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -ENABLE_FEDERATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#EnableFederationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#EnableFederationResponse", - ) - ], - members={ - "EventDataStoreArn": {"target": EVENT_DATA_STORE_ARN}, - "FederationStatus": {"target": FEDERATION_STATUS}, - "FederationRoleArn": {"target": FEDERATION_ROLE_ARN}, - }, +LIST_CHANNELS_MAX_RESULTS_COUNT: StaticSchema = (7, n0, _LCMRC, 0) + +LIST_CHANNELS_INPUT: StaticSchema = ( + 18, + n0, + _LCI, + {_sSI: _cLCR, _smi: None}, + (_MR, _NT), + ((LIST_CHANNELS_MAX_RESULTS_COUNT, 0), (PAGINATION_TOKEN, 0)), +) + +LIST_CHANNELS_OUTPUT: StaticSchema = ( + 18, + n0, + _LCO, + {_sSI: _cLCRo, _smit: None}, + (_Ch, _NT), + ((CHANNELS, 0), (PAGINATION_TOKEN, 0)), +) + +LIST_CHANNELS: StaticOperationSchema = ( + 23, + n0, + _LC, + 0, + LIST_CHANNELS_INPUT, + LIST_CHANNELS_OUTPUT, + ( + INVALID_NEXT_TOKEN_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -ENABLE_FEDERATION = Schema( - id=ShapeID("com.amazonaws.cloudtrail#EnableFederation"), - shape_type=ShapeType.OPERATION, -) - -EVENT_DATA_STORE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#EventDataStoreList"), - shape_type=ShapeType.LIST, - members={"member": {"target": EVENT_DATA_STORE_ARN}}, -) - -GENERATE_QUERY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#GenerateQueryInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#GenerateQueryRequest", - ) - ], - members={ - "EventDataStores": { - "target": EVENT_DATA_STORE_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Prompt": { - "target": PROMPT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +LIST_DASHBOARDS_MAX_RESULTS_COUNT: StaticSchema = (7, n0, _LDMRC, 0) -GENERATE_QUERY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#GenerateQueryOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#GenerateQueryResponse", - ) - ], - members={ - "QueryStatement": {"target": QUERY_STATEMENT}, - "QueryAlias": {"target": QUERY_ALIAS}, - "EventDataStoreOwnerAccountId": {"target": ACCOUNT_ID}, - }, +LIST_DASHBOARDS_INPUT: StaticSchema = ( + 18, + n0, + _LDI, + {_sSI: _cLDR, _smi: None}, + (_NP, _Ty, _NT, _MR), + ( + (DASHBOARD_NAME, 0), + (DASHBOARD_TYPE, 0), + (PAGINATION_TOKEN, 0), + (LIST_DASHBOARDS_MAX_RESULTS_COUNT, 0), + ), ) -GENERATE_RESPONSE_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#GenerateResponseException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "GenerateResponse", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -GENERATE_QUERY = Schema( - id=ShapeID("com.amazonaws.cloudtrail#GenerateQuery"), shape_type=ShapeType.OPERATION -) - -GET_CHANNEL_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#GetChannelInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#GetChannelRequest", - ) - ], - members={ - "Channel": { - "target": CHANNEL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +DASHBOARD_DETAIL: StaticSchema = ( + 18, + n0, + _DDa, + 0, + (_DA, _Ty), + ((DASHBOARD_ARN, 0), (DASHBOARD_TYPE, 0)), +) + +DASHBOARDS: StaticSchema = (16, n0, _Das, 0, (_m,), ((DASHBOARD_DETAIL, 0),)) + +LIST_DASHBOARDS_OUTPUT: StaticSchema = ( + 18, + n0, + _LDO, + {_sSI: _cLDRo, _smit: None}, + (_Das, _NT), + ((DASHBOARDS, 0), (PAGINATION_TOKEN, 0)), +) + +LIST_DASHBOARDS: StaticOperationSchema = ( + 23, + n0, + _LD, + 0, + LIST_DASHBOARDS_INPUT, + LIST_DASHBOARDS_OUTPUT, + (UNSUPPORTED_OPERATION_EXCEPTION,), +) + +LIST_EVENT_DATA_STORES_MAX_RESULTS_COUNT: StaticSchema = (7, n0, _LEDSMRC, 0) + +LIST_EVENT_DATA_STORES_INPUT: StaticSchema = ( + 18, + n0, + _LEDSI, + {_sSI: _cLEDSR, _smi: None}, + (_NT, _MR), + ((PAGINATION_TOKEN, 0), (LIST_EVENT_DATA_STORES_MAX_RESULTS_COUNT, 0)), +) + +EVENT_DATA_STORE: StaticSchema = ( + 18, + n0, + _EDS, + 0, + (_EDSA, _N, _TPE, _St, _AESd, _MRE, _OE, _RP, _CT, _UT), + ( + (EVENT_DATA_STORE_ARN, 0), + (EVENT_DATA_STORE_NAME, 0), + (TERMINATION_PROTECTION_ENABLED, 0), + (EVENT_DATA_STORE_STATUS, 0), + (ADVANCED_EVENT_SELECTORS, 0), + (BOOLEAN, 0), + (BOOLEAN, 0), + (RETENTION_PERIOD, 0), + (DATE, 0), + (DATE, 0), + ), ) -INGESTION_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#IngestionStatus"), - members={ - "LatestIngestionSuccessTime": {"target": DATE}, - "LatestIngestionSuccessEventID": {"target": UUID}, - "LatestIngestionErrorCode": {"target": ERROR_MESSAGE}, - "LatestIngestionAttemptTime": {"target": DATE}, - "LatestIngestionAttemptEventID": {"target": UUID}, - }, +EVENT_DATA_STORES: StaticSchema = (16, n0, _EDSv, 0, (_m,), ((EVENT_DATA_STORE, 0),)) + +LIST_EVENT_DATA_STORES_OUTPUT: StaticSchema = ( + 18, + n0, + _LEDSO, + {_sSI: _cLEDSRo, _smit: None}, + (_EDSv, _NT), + ((EVENT_DATA_STORES, 0), (PAGINATION_TOKEN, 0)), +) + +LIST_EVENT_DATA_STORES: StaticOperationSchema = ( + 23, + n0, + _LEDS, + 0, + LIST_EVENT_DATA_STORES_INPUT, + LIST_EVENT_DATA_STORES_OUTPUT, + ( + INVALID_MAX_RESULTS_EXCEPTION, + INVALID_NEXT_TOKEN_EXCEPTION, + NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -SOURCE_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#SourceConfig"), - members={ - "ApplyToAllRegions": {"target": BOOLEAN}, - "AdvancedEventSelectors": {"target": ADVANCED_EVENT_SELECTORS}, - }, +LIST_IMPORT_FAILURES_MAX_RESULTS_COUNT: StaticSchema = (7, n0, _LIFMRC, 0) + +LIST_IMPORT_FAILURES_INPUT: StaticSchema = ( + 18, + n0, + _LIFI, + {_sSI: _cLIFR, _smi: None}, + (_II, _MR, _NT), + ((UUID, 1), (LIST_IMPORT_FAILURES_MAX_RESULTS_COUNT, 0), (PAGINATION_TOKEN, 0)), +) + +IMPORT_FAILURE_STATUS: StaticSchema = ( + 14, + n0, + _IFS, + 0, + (_FAILED, _RETRY, _SUCCEEDED), + ((-1, {_sV: _FAILED}), (-1, {_sV: _RETRY}), (-1, {_sV: _SUCCEEDED})), +) + +IMPORT_FAILURE_LIST_ITEM: StaticSchema = ( + 18, + n0, + _IFLI, + 0, + (_L, _St, _ET, _EM, _LUT), + ((STRING, 0), (IMPORT_FAILURE_STATUS, 0), (STRING, 0), (STRING, 0), (DATE, 0)), +) + +IMPORT_FAILURE_LIST: StaticSchema = ( + 16, + n0, + _IFL, + 0, + (_m,), + ((IMPORT_FAILURE_LIST_ITEM, 0),), +) + +LIST_IMPORT_FAILURES_OUTPUT: StaticSchema = ( + 18, + n0, + _LIFO, + {_sSI: _cLIFRo, _smit: None}, + (_Fa, _NT), + ((IMPORT_FAILURE_LIST, 0), (PAGINATION_TOKEN, 0)), +) + +LIST_IMPORT_FAILURES: StaticOperationSchema = ( + 23, + n0, + _LIF, + 0, + LIST_IMPORT_FAILURES_INPUT, + LIST_IMPORT_FAILURES_OUTPUT, + ( + INVALID_NEXT_TOKEN_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -GET_CHANNEL_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#GetChannelOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#GetChannelResponse", - ) - ], - members={ - "ChannelArn": {"target": CHANNEL_ARN}, - "Name": {"target": CHANNEL_NAME}, - "Source": {"target": SOURCE}, - "SourceConfig": {"target": SOURCE_CONFIG}, - "Destinations": {"target": DESTINATIONS}, - "IngestionStatus": {"target": INGESTION_STATUS}, - }, -) +LIST_IMPORTS_MAX_RESULTS_COUNT: StaticSchema = (7, n0, _LIMRC, 0) -GET_CHANNEL = Schema( - id=ShapeID("com.amazonaws.cloudtrail#GetChannel"), shape_type=ShapeType.OPERATION +LIST_IMPORTS_INPUT: StaticSchema = ( + 18, + n0, + _LII, + {_sSI: _cLIR, _smi: None}, + (_MR, _De, _ISmpo, _NT), + ( + (LIST_IMPORTS_MAX_RESULTS_COUNT, 0), + (EVENT_DATA_STORE_ARN, 0), + (IMPORT_STATUS, 0), + (PAGINATION_TOKEN, 0), + ), ) -GET_DASHBOARD_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#GetDashboardInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#GetDashboardRequest", - ) - ], - members={ - "DashboardId": { - "target": DASHBOARD_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +IMPORTS_LIST_ITEM: StaticSchema = ( + 18, + n0, + _ILI, + 0, + (_II, _ISmpo, _Des, _CT, _UT), + ((UUID, 0), (IMPORT_STATUS, 0), (IMPORT_DESTINATIONS, 0), (DATE, 0), (DATE, 0)), +) + +IMPORTS_LIST: StaticSchema = (16, n0, _ILm, 0, (_m,), ((IMPORTS_LIST_ITEM, 0),)) + +LIST_IMPORTS_OUTPUT: StaticSchema = ( + 18, + n0, + _LIO, + {_sSI: _cLIRo, _smit: None}, + (_Im, _NT), + ((IMPORTS_LIST, 0), (PAGINATION_TOKEN, 0)), +) + +LIST_IMPORTS: StaticOperationSchema = ( + 23, + n0, + _LI, + 0, + LIST_IMPORTS_INPUT, + LIST_IMPORTS_OUTPUT, + ( + EVENT_DATA_STORE_ARN_INVALID_EXCEPTION, + INVALID_NEXT_TOKEN_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -DASHBOARD_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#DashboardStatus"), - shape_type=ShapeType.ENUM, - members={ - "CREATING": {"target": UNIT}, - "CREATED": {"target": UNIT}, - "UPDATING": {"target": UNIT}, - "UPDATED": {"target": UNIT}, - "DELETING": {"target": UNIT}, - }, +LIST_INSIGHTS_DATA_TYPE: StaticSchema = (14, n0, _LIDT, 0, (_IE,), ((-1, {_sV: _IEn}),)) + +LIST_INSIGHTS_DATA_DIMENSION_KEY: StaticSchema = ( + 14, + n0, + _LIDDK, + 0, + (_EI, _EN, _ES_), + ((-1, {_sV: _EIv}), (-1, {_sV: _ENv}), (-1, {_sV: _ESven})), +) + +LIST_INSIGHTS_DATA_DIMENSION_VALUE: StaticSchema = (3, n0, _LIDDV, 0) + +LIST_INSIGHTS_DATA_DIMENSIONS: StaticSchema = ( + 17, + n0, + _LIDD, + 0, + (_k, _v), + ((LIST_INSIGHTS_DATA_DIMENSION_KEY, 0), (LIST_INSIGHTS_DATA_DIMENSION_VALUE, 0)), +) + +LIST_INSIGHTS_DATA_MAX_RESULTS_COUNT: StaticSchema = (7, n0, _LIDMRC, 0) + +LIST_INSIGHTS_DATA_INPUT: StaticSchema = ( + 18, + n0, + _LIDI, + {_sSI: _cLIDR, _smi: None}, + (_ISnsi, _DTat, _Di, _ST, _ETn, _MR, _NT), + ( + (RESOURCE_ARN, 1), + (LIST_INSIGHTS_DATA_TYPE, 1), + (LIST_INSIGHTS_DATA_DIMENSIONS, 0), + (DATE, 0), + (DATE, 0), + (LIST_INSIGHTS_DATA_MAX_RESULTS_COUNT, 0), + (PAGINATION_TOKEN, 0), + ), ) -GET_DASHBOARD_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#GetDashboardOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#GetDashboardResponse", - ) - ], - members={ - "DashboardArn": {"target": DASHBOARD_ARN}, - "Type": {"target": DASHBOARD_TYPE}, - "Status": {"target": DASHBOARD_STATUS}, - "Widgets": {"target": WIDGET_LIST}, - "RefreshSchedule": {"target": REFRESH_SCHEDULE}, - "CreatedTimestamp": {"target": DATE}, - "UpdatedTimestamp": {"target": DATE}, - "LastRefreshId": {"target": REFRESH_ID}, - "LastRefreshFailureReason": {"target": ERROR_MESSAGE}, - "TerminationProtectionEnabled": {"target": TERMINATION_PROTECTION_ENABLED}, - }, +RESOURCE: StaticSchema = (18, n0, _R, 0, (_RT, _RN), ((STRING, 0), (STRING, 0))) + +RESOURCE_LIST: StaticSchema = (16, n0, _RLe, 0, (_m,), ((RESOURCE, 0),)) + +EVENT: StaticSchema = ( + 18, + n0, + _Ev, + 0, + (_EIv, _ENv, _RO, _AKI, _ETv, _ESven, _Us, _Re, _CTE), + ( + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (DATE, 0), + (STRING, 0), + (STRING, 0), + (RESOURCE_LIST, 0), + (STRING, 0), + ), ) -GET_DASHBOARD = Schema( - id=ShapeID("com.amazonaws.cloudtrail#GetDashboard"), shape_type=ShapeType.OPERATION +EVENTS_LIST: StaticSchema = (16, n0, _EL, 0, (_m,), ((EVENT, 0),)) + +LIST_INSIGHTS_DATA_OUTPUT: StaticSchema = ( + 18, + n0, + _LIDO, + {_sSI: _cLIDRo, _smit: None}, + (_Eve, _NT), + ((EVENTS_LIST, 0), (PAGINATION_TOKEN, 0)), +) + +LIST_INSIGHTS_DATA: StaticOperationSchema = ( + 23, + n0, + _LID, + 0, + LIST_INSIGHTS_DATA_INPUT, + LIST_INSIGHTS_DATA_OUTPUT, + ( + INVALID_PARAMETER_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -GET_EVENT_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#GetEventConfigurationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#GetEventConfigurationRequest", - ) - ], - members={"TrailName": {"target": STRING}, "EventDataStore": {"target": STRING}}, +INSIGHTS_METRIC_DATA_TYPE: StaticSchema = ( + 14, + n0, + _IMDT, + 0, + (_FWZ, _NZD), + ((-1, {_sV: _FWZi}), (-1, {_sV: _NZDo})), ) -OPERATOR_TARGET_LIST_MEMBER = Schema( - id=ShapeID("com.amazonaws.cloudtrail#OperatorTargetListMember"), - shape_type=ShapeType.STRING, -) +ERROR_CODE: StaticSchema = (3, n0, _ECr, 0) -OPERATOR_TARGET_LIST = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#OperatorTargetList"), - shape_type=ShapeType.LIST, - members={"member": {"target": OPERATOR_TARGET_LIST_MEMBER}}, -) +EVENT_NAME: StaticSchema = (3, n0, _ENv, 0) -TYPE = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#Type"), - shape_type=ShapeType.ENUM, - members={"TagContext": {"target": UNIT}, "RequestContext": {"target": UNIT}}, -) +EVENT_SOURCE: StaticSchema = (3, n0, _ESven, 0) -CONTEXT_KEY_SELECTOR = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ContextKeySelector"), - members={ - "Type": { - "target": TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Equals": { - "target": OPERATOR_TARGET_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +INSIGHTS_METRIC_MAX_RESULTS: StaticSchema = (7, n0, _IMMR, 0) -CONTEXT_KEY_SELECTORS = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ContextKeySelectors"), - shape_type=ShapeType.LIST, - members={"member": {"target": CONTEXT_KEY_SELECTOR}}, -) - -MAX_EVENT_SIZE = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#MaxEventSize"), - shape_type=ShapeType.ENUM, - members={"Standard": {"target": UNIT}, "Large": {"target": UNIT}}, -) - -GET_EVENT_CONFIGURATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#GetEventConfigurationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#GetEventConfigurationResponse", - ) - ], - members={ - "TrailARN": {"target": STRING}, - "EventDataStoreArn": {"target": EVENT_DATA_STORE_ARN}, - "MaxEventSize": {"target": MAX_EVENT_SIZE}, - "ContextKeySelectors": {"target": CONTEXT_KEY_SELECTORS}, - "AggregationConfigurations": {"target": AGGREGATION_CONFIGURATIONS}, - }, -) +INSIGHTS_METRIC_NEXT_TOKEN: StaticSchema = (3, n0, _IMNT, 0) -INVALID_EVENT_DATA_STORE_STATUS_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#InvalidEventDataStoreStatusException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "InvalidEventDataStoreStatus", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -GET_EVENT_CONFIGURATION = Schema( - id=ShapeID("com.amazonaws.cloudtrail#GetEventConfiguration"), - shape_type=ShapeType.OPERATION, -) - -GET_EVENT_DATA_STORE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#GetEventDataStoreInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#GetEventDataStoreRequest", - ) - ], - members={ - "EventDataStore": { - "target": EVENT_DATA_STORE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +INSIGHTS_METRIC_PERIOD: StaticSchema = (7, n0, _IMP, 0) -PARTITION_KEY_NAME = Schema( - id=ShapeID("com.amazonaws.cloudtrail#PartitionKeyName"), shape_type=ShapeType.STRING +LIST_INSIGHTS_METRIC_DATA_INPUT: StaticSchema = ( + 18, + n0, + _LIMDI, + {_sSI: _cLIMDR, _smi: None}, + (_TN, _ESven, _ENv, _IT, _ECr, _ST, _ETn, _Pe, _DTat, _MR, _NT), + ( + (STRING, 0), + (EVENT_SOURCE, 1), + (EVENT_NAME, 1), + (INSIGHT_TYPE, 1), + (ERROR_CODE, 0), + (DATE, 0), + (DATE, 0), + (INSIGHTS_METRIC_PERIOD, 0), + (INSIGHTS_METRIC_DATA_TYPE, 0), + (INSIGHTS_METRIC_MAX_RESULTS, 0), + (INSIGHTS_METRIC_NEXT_TOKEN, 0), + ), ) -PARTITION_KEY_TYPE = Schema( - id=ShapeID("com.amazonaws.cloudtrail#PartitionKeyType"), shape_type=ShapeType.STRING -) +TIMESTAMPS: StaticSchema = (16, n0, _Ti, 0, (_m,), ((DATE, 0),)) -PARTITION_KEY = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#PartitionKey"), - members={ - "Name": { - "target": PARTITION_KEY_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Type": { - "target": PARTITION_KEY_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +DOUBLE: StaticSchema = (10, n0, _Do, 0) -PARTITION_KEY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#PartitionKeyList"), - shape_type=ShapeType.LIST, - members={"member": {"target": PARTITION_KEY}}, -) - -GET_EVENT_DATA_STORE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#GetEventDataStoreOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#GetEventDataStoreResponse", - ) - ], - members={ - "EventDataStoreArn": {"target": EVENT_DATA_STORE_ARN}, - "Name": {"target": EVENT_DATA_STORE_NAME}, - "Status": {"target": EVENT_DATA_STORE_STATUS}, - "AdvancedEventSelectors": {"target": ADVANCED_EVENT_SELECTORS}, - "MultiRegionEnabled": {"target": BOOLEAN}, - "OrganizationEnabled": {"target": BOOLEAN}, - "RetentionPeriod": {"target": RETENTION_PERIOD}, - "TerminationProtectionEnabled": {"target": TERMINATION_PROTECTION_ENABLED}, - "CreatedTimestamp": {"target": DATE}, - "UpdatedTimestamp": {"target": DATE}, - "KmsKeyId": {"target": EVENT_DATA_STORE_KMS_KEY_ID}, - "BillingMode": {"target": BILLING_MODE}, - "FederationStatus": {"target": FEDERATION_STATUS}, - "FederationRoleArn": {"target": FEDERATION_ROLE_ARN}, - "PartitionKeys": {"target": PARTITION_KEY_LIST}, - }, -) +INSIGHTS_METRIC_VALUES: StaticSchema = (16, n0, _IMV, 0, (_m,), ((DOUBLE, 0),)) -GET_EVENT_DATA_STORE = Schema( - id=ShapeID("com.amazonaws.cloudtrail#GetEventDataStore"), - shape_type=ShapeType.OPERATION, -) - -GET_EVENT_SELECTORS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#GetEventSelectorsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#GetEventSelectorsRequest", - ) - ], - members={ - "TrailName": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +LIST_INSIGHTS_METRIC_DATA_OUTPUT: StaticSchema = ( + 18, + n0, + _LIMDO, + {_sSI: _cLIMDRo, _smit: None}, + (_TARN, _ESven, _ENv, _IT, _ECr, _Ti, _Va, _NT), + ( + (STRING, 0), + (EVENT_SOURCE, 0), + (EVENT_NAME, 0), + (INSIGHT_TYPE, 0), + (ERROR_CODE, 0), + (TIMESTAMPS, 0), + (INSIGHTS_METRIC_VALUES, 0), + (INSIGHTS_METRIC_NEXT_TOKEN, 0), + ), ) -DATA_RESOURCE_VALUES = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#DataResourceValues"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, +LIST_INSIGHTS_METRIC_DATA: StaticOperationSchema = ( + 23, + n0, + _LIMD, + 0, + LIST_INSIGHTS_METRIC_DATA_INPUT, + LIST_INSIGHTS_METRIC_DATA_OUTPUT, + ( + INVALID_PARAMETER_EXCEPTION, + INVALID_TRAIL_NAME_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -DATA_RESOURCE = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#DataResource"), - members={"Type": {"target": STRING}, "Values": {"target": DATA_RESOURCE_VALUES}}, +INVALID_TIME_RANGE_EXCEPTION: StaticSchema = ( + 18, + n0, + _ITRE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +INVALID_TOKEN_EXCEPTION: StaticSchema = ( + 18, + n0, + _ITE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +LIST_PUBLIC_KEYS_INPUT: StaticSchema = ( + 18, + n0, + _LPKI, + {_sSI: _cLPKR, _smi: None}, + (_ST, _ETn, _NT), + ((DATE, 0), (DATE, 0), (STRING, 0)), +) + +PUBLIC_KEY: StaticSchema = ( + 18, + n0, + _PKu, + 0, + (_V, _VST, _VET, _Fi), + ((BYTE_BUFFER, 0), (DATE, 0), (DATE, 0), (STRING, 0)), +) + +PUBLIC_KEY_LIST: StaticSchema = (16, n0, _PKLu, 0, (_m,), ((PUBLIC_KEY, 0),)) + +LIST_PUBLIC_KEYS_OUTPUT: StaticSchema = ( + 18, + n0, + _LPKO, + {_sSI: _cLPKRo, _smit: None}, + (_PKLu, _NT), + ((PUBLIC_KEY_LIST, 0), (STRING, 0)), +) + +LIST_PUBLIC_KEYS: StaticOperationSchema = ( + 23, + n0, + _LPK, + 0, + LIST_PUBLIC_KEYS_INPUT, + LIST_PUBLIC_KEYS_OUTPUT, + ( + INVALID_TIME_RANGE_EXCEPTION, + INVALID_TOKEN_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -DATA_RESOURCES = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#DataResources"), - shape_type=ShapeType.LIST, - members={"member": {"target": DATA_RESOURCE}}, +INVALID_DATE_RANGE_EXCEPTION: StaticSchema = ( + 18, + n0, + _IDRE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +INVALID_QUERY_STATUS_EXCEPTION: StaticSchema = ( + 18, + n0, + _IQSEn, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +LIST_QUERIES_MAX_RESULTS_COUNT: StaticSchema = (7, n0, _LQMRC, 0) + +LIST_QUERIES_INPUT: StaticSchema = ( + 18, + n0, + _LQI, + {_sSI: _cLQR, _smi: None}, + (_EDS, _NT, _MR, _ST, _ETn, _QS), + ( + (EVENT_DATA_STORE_ARN, 1), + (PAGINATION_TOKEN, 0), + (LIST_QUERIES_MAX_RESULTS_COUNT, 0), + (DATE, 0), + (DATE, 0), + (QUERY_STATUS, 0), + ), ) -EXCLUDE_MANAGEMENT_EVENT_SOURCES = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ExcludeManagementEventSources"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, +QUERY: StaticSchema = ( + 18, + n0, + _Q, + 0, + (_QI, _QS, _CTre), + ((UUID, 0), (QUERY_STATUS, 0), (DATE, 0)), +) + +QUERIES: StaticSchema = (16, n0, _Qu, 0, (_m,), ((QUERY, 0),)) + +LIST_QUERIES_OUTPUT: StaticSchema = ( + 18, + n0, + _LQO, + {_sSI: _cLQRo, _smit: None}, + (_Qu, _NT), + ((QUERIES, 0), (PAGINATION_TOKEN, 0)), +) + +LIST_QUERIES: StaticOperationSchema = ( + 23, + n0, + _LQ, + 0, + LIST_QUERIES_INPUT, + LIST_QUERIES_OUTPUT, + ( + EVENT_DATA_STORE_ARN_INVALID_EXCEPTION, + EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, + INACTIVE_EVENT_DATA_STORE_EXCEPTION, + INVALID_DATE_RANGE_EXCEPTION, + INVALID_MAX_RESULTS_EXCEPTION, + INVALID_NEXT_TOKEN_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + INVALID_QUERY_STATUS_EXCEPTION, + NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -READ_WRITE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ReadWriteType"), - shape_type=ShapeType.ENUM, - members={ - "ReadOnly": {"target": UNIT}, - "WriteOnly": {"target": UNIT}, - "All": {"target": UNIT}, - }, +RESOURCE_ID_LIST: StaticSchema = (16, n0, _RIL, 0, (_m,), ((STRING, 0),)) + +LIST_TAGS_INPUT: StaticSchema = ( + 18, + n0, + _LTI, + {_sSI: _cLTR, _smi: None}, + (_RIL, _NT), + ((RESOURCE_ID_LIST, 1), (STRING, 0)), +) + +RESOURCE_TAG: StaticSchema = ( + 18, + n0, + _RTe, + 0, + (_RI, _TL), + ((STRING, 0), (TAGS_LIST, 0)), +) + +RESOURCE_TAG_LIST: StaticSchema = (16, n0, _RTL, 0, (_m,), ((RESOURCE_TAG, 0),)) + +LIST_TAGS_OUTPUT: StaticSchema = ( + 18, + n0, + _LTO, + {_sSI: _cLTRo, _smit: None}, + (_RTL, _NT), + ((RESOURCE_TAG_LIST, 0), (STRING, 0)), +) + +LIST_TAGS: StaticOperationSchema = ( + 23, + n0, + _LT, + 0, + LIST_TAGS_INPUT, + LIST_TAGS_OUTPUT, + ( + CHANNEL_ARN_INVALID_EXCEPTION, + CLOUD_TRAIL_ARN_INVALID_EXCEPTION, + EVENT_DATA_STORE_ARN_INVALID_EXCEPTION, + EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, + INACTIVE_EVENT_DATA_STORE_EXCEPTION, + INVALID_TOKEN_EXCEPTION, + INVALID_TRAIL_NAME_EXCEPTION, + NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + RESOURCE_TYPE_NOT_SUPPORTED_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -EVENT_SELECTOR = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#EventSelector"), - members={ - "ReadWriteType": {"target": READ_WRITE_TYPE}, - "IncludeManagementEvents": {"target": BOOLEAN}, - "DataResources": {"target": DATA_RESOURCES}, - "ExcludeManagementEventSources": {"target": EXCLUDE_MANAGEMENT_EVENT_SOURCES}, - }, +LIST_TRAILS_INPUT: StaticSchema = ( + 18, + n0, + _LTIi, + {_sSI: _cLTRom, _smi: None}, + (_NT,), + ((STRING, 0),), +) + +TRAIL_INFO: StaticSchema = ( + 18, + n0, + _TI, + 0, + (_TARN, _N, _HR), + ((STRING, 0), (STRING, 0), (STRING, 0)), +) + +TRAILS: StaticSchema = (16, n0, _Tra, 0, (_m,), ((TRAIL_INFO, 0),)) + +LIST_TRAILS_OUTPUT: StaticSchema = ( + 18, + n0, + _LTOi, + {_sSI: _cLTRoma, _smit: None}, + (_Tra, _NT), + ((TRAILS, 0), (STRING, 0)), +) + +LIST_TRAILS: StaticOperationSchema = ( + 23, + n0, + _LTi, + 0, + LIST_TRAILS_INPUT, + LIST_TRAILS_OUTPUT, + (OPERATION_NOT_PERMITTED_EXCEPTION, UNSUPPORTED_OPERATION_EXCEPTION), +) + +INVALID_EVENT_CATEGORY_EXCEPTION: StaticSchema = ( + 18, + n0, + _IECE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +INVALID_LOOKUP_ATTRIBUTES_EXCEPTION: StaticSchema = ( + 18, + n0, + _ILAE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +EVENT_CATEGORY: StaticSchema = (14, n0, _EC, 0, (_In,), ((-1, {_sV: _i}),)) + +LOOKUP_ATTRIBUTE_KEY: StaticSchema = ( + 14, + n0, + _LAK, + 0, + (_EI, _EN, _RO_, _USERNAME, _RT_, _RN_, _ES_, _AKI_), + ( + (-1, {_sV: _EIv}), + (-1, {_sV: _ENv}), + (-1, {_sV: _RO}), + (-1, {_sV: _Us}), + (-1, {_sV: _RT}), + (-1, {_sV: _RN}), + (-1, {_sV: _ESven}), + (-1, {_sV: _AKI}), + ), ) -EVENT_SELECTORS = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#EventSelectors"), - shape_type=ShapeType.LIST, - members={"member": {"target": EVENT_SELECTOR}}, -) - -GET_EVENT_SELECTORS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#GetEventSelectorsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#GetEventSelectorsResponse", - ) - ], - members={ - "TrailARN": {"target": STRING}, - "EventSelectors": {"target": EVENT_SELECTORS}, - "AdvancedEventSelectors": {"target": ADVANCED_EVENT_SELECTORS}, - }, -) +LOOKUP_ATTRIBUTE_VALUE: StaticSchema = (3, n0, _LAV, 0) -GET_EVENT_SELECTORS = Schema( - id=ShapeID("com.amazonaws.cloudtrail#GetEventSelectors"), - shape_type=ShapeType.OPERATION, -) - -GET_IMPORT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#GetImportInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#GetImportRequest", - ) - ], - members={ - "ImportId": { - "target": UUID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +LOOKUP_ATTRIBUTE: StaticSchema = ( + 18, + n0, + _LA, + 0, + (_AK, _AV), + ((LOOKUP_ATTRIBUTE_KEY, 1), (LOOKUP_ATTRIBUTE_VALUE, 1)), ) -IMPORT_DESTINATIONS = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ImportDestinations"), - shape_type=ShapeType.LIST, - members={"member": {"target": EVENT_DATA_STORE_ARN}}, -) - -S3_IMPORT_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#S3ImportSource"), - members={ - "S3LocationUri": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "S3BucketRegion": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "S3BucketAccessRoleArn": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +LOOKUP_ATTRIBUTES_LIST: StaticSchema = ( + 16, + n0, + _LAL, + 0, + (_m,), + ((LOOKUP_ATTRIBUTE, 0),), ) -IMPORT_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ImportSource"), - members={ - "S3": { - "target": S3_IMPORT_SOURCE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +MAX_RESULTS: StaticSchema = (7, n0, _MR, 0) -IMPORT_STATISTICS = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ImportStatistics"), - members={ - "PrefixesFound": {"target": LONG}, - "PrefixesCompleted": {"target": LONG}, - "FilesCompleted": {"target": LONG}, - "EventsCompleted": {"target": LONG}, - "FailedEntries": {"target": LONG}, - }, +NEXT_TOKEN: StaticSchema = (3, n0, _NT, 0) + +LOOKUP_EVENTS_INPUT: StaticSchema = ( + 18, + n0, + _LEI, + {_sSI: _cLER, _smi: None}, + (_LAo, _ST, _ETn, _EC, _MR, _NT), + ( + (LOOKUP_ATTRIBUTES_LIST, 0), + (DATE, 0), + (DATE, 0), + (EVENT_CATEGORY, 0), + (MAX_RESULTS, 0), + (NEXT_TOKEN, 0), + ), ) -IMPORT_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ImportStatus"), - shape_type=ShapeType.ENUM, - members={ - "INITIALIZING": {"target": UNIT}, - "IN_PROGRESS": {"target": UNIT}, - "FAILED": {"target": UNIT}, - "STOPPED": {"target": UNIT}, - "COMPLETED": {"target": UNIT}, - }, -) - -GET_IMPORT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#GetImportOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#GetImportResponse", - ) - ], - members={ - "ImportId": {"target": UUID}, - "Destinations": {"target": IMPORT_DESTINATIONS}, - "ImportSource": {"target": IMPORT_SOURCE}, - "StartEventTime": {"target": DATE}, - "EndEventTime": {"target": DATE}, - "ImportStatus": {"target": IMPORT_STATUS}, - "CreatedTimestamp": {"target": DATE}, - "UpdatedTimestamp": {"target": DATE}, - "ImportStatistics": {"target": IMPORT_STATISTICS}, - }, -) - -IMPORT_NOT_FOUND_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ImportNotFoundException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=404), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType({"code": "ImportNotFound", "httpResponseCode": 404}), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -GET_IMPORT = Schema( - id=ShapeID("com.amazonaws.cloudtrail#GetImport"), shape_type=ShapeType.OPERATION -) - -GET_INSIGHT_SELECTORS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#GetInsightSelectorsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#GetInsightSelectorsRequest", - ) - ], - members={ - "TrailName": {"target": STRING}, - "EventDataStore": {"target": EVENT_DATA_STORE_ARN}, - }, -) - -SOURCE_EVENT_CATEGORY = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#SourceEventCategory"), - shape_type=ShapeType.ENUM, - members={"Management": {"target": UNIT}, "Data": {"target": UNIT}}, -) - -SOURCE_EVENT_CATEGORIES = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#SourceEventCategories"), - shape_type=ShapeType.LIST, - members={"member": {"target": SOURCE_EVENT_CATEGORY}}, -) - -INSIGHT_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#InsightType"), - shape_type=ShapeType.ENUM, - members={ - "ApiCallRateInsight": {"target": UNIT}, - "ApiErrorRateInsight": {"target": UNIT}, - }, -) - -INSIGHT_SELECTOR = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#InsightSelector"), - members={ - "InsightType": {"target": INSIGHT_TYPE}, - "EventCategories": {"target": SOURCE_EVENT_CATEGORIES}, - }, -) - -INSIGHT_SELECTORS = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#InsightSelectors"), - shape_type=ShapeType.LIST, - members={"member": {"target": INSIGHT_SELECTOR}}, -) - -GET_INSIGHT_SELECTORS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#GetInsightSelectorsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#GetInsightSelectorsResponse", - ) - ], - members={ - "TrailARN": {"target": STRING}, - "InsightSelectors": {"target": INSIGHT_SELECTORS}, - "EventDataStoreArn": {"target": EVENT_DATA_STORE_ARN}, - "InsightsDestination": {"target": EVENT_DATA_STORE_ARN}, - }, -) - -INSIGHT_NOT_ENABLED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#InsightNotEnabledException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "InsightNotEnabled", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -GET_INSIGHT_SELECTORS = Schema( - id=ShapeID("com.amazonaws.cloudtrail#GetInsightSelectors"), - shape_type=ShapeType.OPERATION, -) - -MAX_QUERY_RESULTS = Schema( - id=ShapeID("com.amazonaws.cloudtrail#MaxQueryResults"), shape_type=ShapeType.INTEGER -) - -PAGINATION_TOKEN = Schema( - id=ShapeID("com.amazonaws.cloudtrail#PaginationToken"), shape_type=ShapeType.STRING -) - -GET_QUERY_RESULTS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#GetQueryResultsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#GetQueryResultsRequest", - ) - ], - members={ - "EventDataStore": {"target": EVENT_DATA_STORE_ARN}, - "QueryId": { - "target": UUID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "NextToken": {"target": PAGINATION_TOKEN}, - "MaxQueryResults": {"target": MAX_QUERY_RESULTS}, - "EventDataStoreOwnerAccountId": {"target": ACCOUNT_ID}, - }, -) - -QUERY_RESULT_KEY = Schema( - id=ShapeID("com.amazonaws.cloudtrail#QueryResultKey"), shape_type=ShapeType.STRING -) - -QUERY_RESULT_VALUE = Schema( - id=ShapeID("com.amazonaws.cloudtrail#QueryResultValue"), shape_type=ShapeType.STRING -) - -QUERY_RESULT_COLUMN = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#QueryResultColumn"), - shape_type=ShapeType.MAP, - members={ - "key": {"target": QUERY_RESULT_KEY}, - "value": {"target": QUERY_RESULT_VALUE}, - }, -) - -QUERY_RESULT_ROW = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#QueryResultRow"), - shape_type=ShapeType.LIST, - members={"member": {"target": QUERY_RESULT_COLUMN}}, -) - -QUERY_RESULT_ROWS = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#QueryResultRows"), - shape_type=ShapeType.LIST, - members={"member": {"target": QUERY_RESULT_ROW}}, -) - -QUERY_STATISTICS = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#QueryStatistics"), - members={ - "ResultsCount": {"target": INTEGER}, - "TotalResultsCount": {"target": INTEGER}, - "BytesScanned": {"target": LONG}, - }, -) - -GET_QUERY_RESULTS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#GetQueryResultsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#GetQueryResultsResponse", - ) - ], - members={ - "QueryStatus": {"target": QUERY_STATUS}, - "QueryStatistics": {"target": QUERY_STATISTICS}, - "QueryResultRows": {"target": QUERY_RESULT_ROWS}, - "NextToken": {"target": PAGINATION_TOKEN}, - "ErrorMessage": {"target": ERROR_MESSAGE}, - }, -) - -INVALID_MAX_RESULTS_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#InvalidMaxResultsException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "InvalidMaxResults", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -INVALID_NEXT_TOKEN_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#InvalidNextTokenException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "InvalidNextToken", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -GET_QUERY_RESULTS = Schema( - id=ShapeID("com.amazonaws.cloudtrail#GetQueryResults"), - shape_type=ShapeType.OPERATION, -) - -GET_RESOURCE_POLICY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#GetResourcePolicyInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#GetResourcePolicyRequest", - ) - ], - members={ - "ResourceArn": { - "target": RESOURCE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -RESOURCE_POLICY = Schema( - id=ShapeID("com.amazonaws.cloudtrail#ResourcePolicy"), shape_type=ShapeType.STRING -) - -GET_RESOURCE_POLICY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#GetResourcePolicyOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#GetResourcePolicyResponse", - ) - ], - members={ - "ResourceArn": {"target": RESOURCE_ARN}, - "ResourcePolicy": {"target": RESOURCE_POLICY}, - "DelegatedAdminResourcePolicy": {"target": RESOURCE_POLICY}, - }, -) - -GET_RESOURCE_POLICY = Schema( - id=ShapeID("com.amazonaws.cloudtrail#GetResourcePolicy"), - shape_type=ShapeType.OPERATION, -) - -GET_TRAIL_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#GetTrailInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#GetTrailRequest", - ) - ], - members={ - "Name": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -GET_TRAIL_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#GetTrailOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#GetTrailResponse", - ) - ], - members={"Trail": {"target": TRAIL}}, -) - -GET_TRAIL = Schema( - id=ShapeID("com.amazonaws.cloudtrail#GetTrail"), shape_type=ShapeType.OPERATION -) - -GET_TRAIL_STATUS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#GetTrailStatusInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#GetTrailStatusRequest", - ) - ], - members={ - "Name": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -GET_TRAIL_STATUS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#GetTrailStatusOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#GetTrailStatusResponse", - ) - ], - members={ - "IsLogging": {"target": BOOLEAN}, - "LatestDeliveryError": {"target": STRING}, - "LatestNotificationError": {"target": STRING}, - "LatestDeliveryTime": {"target": DATE}, - "LatestNotificationTime": {"target": DATE}, - "StartLoggingTime": {"target": DATE}, - "StopLoggingTime": {"target": DATE}, - "LatestCloudWatchLogsDeliveryError": {"target": STRING}, - "LatestCloudWatchLogsDeliveryTime": {"target": DATE}, - "LatestDigestDeliveryTime": {"target": DATE}, - "LatestDigestDeliveryError": {"target": STRING}, - "LatestDeliveryAttemptTime": {"target": STRING}, - "LatestNotificationAttemptTime": {"target": STRING}, - "LatestNotificationAttemptSucceeded": {"target": STRING}, - "LatestDeliveryAttemptSucceeded": {"target": STRING}, - "TimeLoggingStarted": {"target": STRING}, - "TimeLoggingStopped": {"target": STRING}, - }, -) - -GET_TRAIL_STATUS = Schema( - id=ShapeID("com.amazonaws.cloudtrail#GetTrailStatus"), - shape_type=ShapeType.OPERATION, -) - -LIST_CHANNELS_MAX_RESULTS_COUNT = Schema( - id=ShapeID("com.amazonaws.cloudtrail#ListChannelsMaxResultsCount"), - shape_type=ShapeType.INTEGER, -) - -LIST_CHANNELS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ListChannelsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#ListChannelsRequest", - ) - ], - members={ - "MaxResults": {"target": LIST_CHANNELS_MAX_RESULTS_COUNT}, - "NextToken": {"target": PAGINATION_TOKEN}, - }, -) - -LIST_CHANNELS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ListChannelsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#ListChannelsResponse", - ) - ], - members={ - "Channels": {"target": CHANNELS}, - "NextToken": {"target": PAGINATION_TOKEN}, - }, -) - -LIST_CHANNELS = Schema( - id=ShapeID("com.amazonaws.cloudtrail#ListChannels"), shape_type=ShapeType.OPERATION -) - -LIST_DASHBOARDS_MAX_RESULTS_COUNT = Schema( - id=ShapeID("com.amazonaws.cloudtrail#ListDashboardsMaxResultsCount"), - shape_type=ShapeType.INTEGER, -) - -LIST_DASHBOARDS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ListDashboardsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#ListDashboardsRequest", - ) - ], - members={ - "NamePrefix": {"target": DASHBOARD_NAME}, - "Type": {"target": DASHBOARD_TYPE}, - "NextToken": {"target": PAGINATION_TOKEN}, - "MaxResults": {"target": LIST_DASHBOARDS_MAX_RESULTS_COUNT}, - }, -) - -DASHBOARD_DETAIL = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#DashboardDetail"), - members={ - "DashboardArn": {"target": DASHBOARD_ARN}, - "Type": {"target": DASHBOARD_TYPE}, - }, -) - -DASHBOARDS = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#Dashboards"), - shape_type=ShapeType.LIST, - members={"member": {"target": DASHBOARD_DETAIL}}, -) - -LIST_DASHBOARDS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ListDashboardsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#ListDashboardsResponse", - ) - ], - members={ - "Dashboards": {"target": DASHBOARDS}, - "NextToken": {"target": PAGINATION_TOKEN}, - }, -) - -LIST_DASHBOARDS = Schema( - id=ShapeID("com.amazonaws.cloudtrail#ListDashboards"), - shape_type=ShapeType.OPERATION, -) - -LIST_EVENT_DATA_STORES_MAX_RESULTS_COUNT = Schema( - id=ShapeID("com.amazonaws.cloudtrail#ListEventDataStoresMaxResultsCount"), - shape_type=ShapeType.INTEGER, -) - -LIST_EVENT_DATA_STORES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ListEventDataStoresInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#ListEventDataStoresRequest", - ) - ], - members={ - "NextToken": {"target": PAGINATION_TOKEN}, - "MaxResults": {"target": LIST_EVENT_DATA_STORES_MAX_RESULTS_COUNT}, - }, -) - -EVENT_DATA_STORE = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#EventDataStore"), - members={ - "EventDataStoreArn": {"target": EVENT_DATA_STORE_ARN}, - "Name": {"target": EVENT_DATA_STORE_NAME}, - "TerminationProtectionEnabled": {"target": TERMINATION_PROTECTION_ENABLED}, - "Status": {"target": EVENT_DATA_STORE_STATUS}, - "AdvancedEventSelectors": {"target": ADVANCED_EVENT_SELECTORS}, - "MultiRegionEnabled": {"target": BOOLEAN}, - "OrganizationEnabled": {"target": BOOLEAN}, - "RetentionPeriod": {"target": RETENTION_PERIOD}, - "CreatedTimestamp": {"target": DATE}, - "UpdatedTimestamp": {"target": DATE}, - }, -) - -EVENT_DATA_STORES = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#EventDataStores"), - shape_type=ShapeType.LIST, - members={"member": {"target": EVENT_DATA_STORE}}, -) - -LIST_EVENT_DATA_STORES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ListEventDataStoresOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#ListEventDataStoresResponse", - ) - ], - members={ - "EventDataStores": {"target": EVENT_DATA_STORES}, - "NextToken": {"target": PAGINATION_TOKEN}, - }, -) - -LIST_EVENT_DATA_STORES = Schema( - id=ShapeID("com.amazonaws.cloudtrail#ListEventDataStores"), - shape_type=ShapeType.OPERATION, -) - -LIST_IMPORT_FAILURES_MAX_RESULTS_COUNT = Schema( - id=ShapeID("com.amazonaws.cloudtrail#ListImportFailuresMaxResultsCount"), - shape_type=ShapeType.INTEGER, -) - -LIST_IMPORT_FAILURES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ListImportFailuresInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#ListImportFailuresRequest", - ) - ], - members={ - "ImportId": { - "target": UUID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "MaxResults": {"target": LIST_IMPORT_FAILURES_MAX_RESULTS_COUNT}, - "NextToken": {"target": PAGINATION_TOKEN}, - }, -) - -IMPORT_FAILURE_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ImportFailureStatus"), - shape_type=ShapeType.ENUM, - members={ - "FAILED": {"target": UNIT}, - "RETRY": {"target": UNIT}, - "SUCCEEDED": {"target": UNIT}, - }, -) - -IMPORT_FAILURE_LIST_ITEM = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ImportFailureListItem"), - members={ - "Location": {"target": STRING}, - "Status": {"target": IMPORT_FAILURE_STATUS}, - "ErrorType": {"target": STRING}, - "ErrorMessage": {"target": STRING}, - "LastUpdatedTime": {"target": DATE}, - }, -) - -IMPORT_FAILURE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ImportFailureList"), - shape_type=ShapeType.LIST, - members={"member": {"target": IMPORT_FAILURE_LIST_ITEM}}, -) - -LIST_IMPORT_FAILURES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ListImportFailuresOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#ListImportFailuresResponse", - ) - ], - members={ - "Failures": {"target": IMPORT_FAILURE_LIST}, - "NextToken": {"target": PAGINATION_TOKEN}, - }, -) - -LIST_IMPORT_FAILURES = Schema( - id=ShapeID("com.amazonaws.cloudtrail#ListImportFailures"), - shape_type=ShapeType.OPERATION, -) - -LIST_IMPORTS_MAX_RESULTS_COUNT = Schema( - id=ShapeID("com.amazonaws.cloudtrail#ListImportsMaxResultsCount"), - shape_type=ShapeType.INTEGER, -) - -LIST_IMPORTS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ListImportsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#ListImportsRequest", - ) - ], - members={ - "MaxResults": {"target": LIST_IMPORTS_MAX_RESULTS_COUNT}, - "Destination": {"target": EVENT_DATA_STORE_ARN}, - "ImportStatus": {"target": IMPORT_STATUS}, - "NextToken": {"target": PAGINATION_TOKEN}, - }, -) - -IMPORTS_LIST_ITEM = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ImportsListItem"), - members={ - "ImportId": {"target": UUID}, - "ImportStatus": {"target": IMPORT_STATUS}, - "Destinations": {"target": IMPORT_DESTINATIONS}, - "CreatedTimestamp": {"target": DATE}, - "UpdatedTimestamp": {"target": DATE}, - }, -) - -IMPORTS_LIST = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ImportsList"), - shape_type=ShapeType.LIST, - members={"member": {"target": IMPORTS_LIST_ITEM}}, -) - -LIST_IMPORTS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ListImportsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#ListImportsResponse", - ) - ], - members={ - "Imports": {"target": IMPORTS_LIST}, - "NextToken": {"target": PAGINATION_TOKEN}, - }, -) - -LIST_IMPORTS = Schema( - id=ShapeID("com.amazonaws.cloudtrail#ListImports"), shape_type=ShapeType.OPERATION -) - -LIST_INSIGHTS_DATA_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ListInsightsDataType"), - shape_type=ShapeType.ENUM, - members={"INSIGHTS_EVENTS": {"target": UNIT}}, -) - -LIST_INSIGHTS_DATA_DIMENSION_KEY = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ListInsightsDataDimensionKey"), - shape_type=ShapeType.ENUM, - members={ - "EVENT_ID": {"target": UNIT}, - "EVENT_NAME": {"target": UNIT}, - "EVENT_SOURCE": {"target": UNIT}, - }, -) - -LIST_INSIGHTS_DATA_DIMENSION_VALUE = Schema( - id=ShapeID("com.amazonaws.cloudtrail#ListInsightsDataDimensionValue"), - shape_type=ShapeType.STRING, -) - -LIST_INSIGHTS_DATA_DIMENSIONS = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ListInsightsDataDimensions"), - shape_type=ShapeType.MAP, - members={ - "key": {"target": LIST_INSIGHTS_DATA_DIMENSION_KEY}, - "value": {"target": LIST_INSIGHTS_DATA_DIMENSION_VALUE}, - }, -) - -LIST_INSIGHTS_DATA_MAX_RESULTS_COUNT = Schema( - id=ShapeID("com.amazonaws.cloudtrail#ListInsightsDataMaxResultsCount"), - shape_type=ShapeType.INTEGER, -) - -LIST_INSIGHTS_DATA_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ListInsightsDataInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#ListInsightsDataRequest", - ) - ], - members={ - "InsightSource": { - "target": RESOURCE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "DataType": { - "target": LIST_INSIGHTS_DATA_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Dimensions": {"target": LIST_INSIGHTS_DATA_DIMENSIONS}, - "StartTime": {"target": DATE}, - "EndTime": {"target": DATE}, - "MaxResults": {"target": LIST_INSIGHTS_DATA_MAX_RESULTS_COUNT}, - "NextToken": {"target": PAGINATION_TOKEN}, - }, -) - -RESOURCE = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#Resource"), - members={"ResourceType": {"target": STRING}, "ResourceName": {"target": STRING}}, -) - -RESOURCE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ResourceList"), - shape_type=ShapeType.LIST, - members={"member": {"target": RESOURCE}}, -) - -EVENT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#Event"), - members={ - "EventId": {"target": STRING}, - "EventName": {"target": STRING}, - "ReadOnly": {"target": STRING}, - "AccessKeyId": {"target": STRING}, - "EventTime": {"target": DATE}, - "EventSource": {"target": STRING}, - "Username": {"target": STRING}, - "Resources": {"target": RESOURCE_LIST}, - "CloudTrailEvent": {"target": STRING}, - }, -) - -EVENTS_LIST = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#EventsList"), - shape_type=ShapeType.LIST, - members={"member": {"target": EVENT}}, -) - -LIST_INSIGHTS_DATA_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ListInsightsDataOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#ListInsightsDataResponse", - ) - ], - members={ - "Events": {"target": EVENTS_LIST}, - "NextToken": {"target": PAGINATION_TOKEN}, - }, -) - -LIST_INSIGHTS_DATA = Schema( - id=ShapeID("com.amazonaws.cloudtrail#ListInsightsData"), - shape_type=ShapeType.OPERATION, -) - -INSIGHTS_METRIC_DATA_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#InsightsMetricDataType"), - shape_type=ShapeType.ENUM, - members={"FILL_WITH_ZEROS": {"target": UNIT}, "NON_ZERO_DATA": {"target": UNIT}}, -) - -ERROR_CODE = Schema( - id=ShapeID("com.amazonaws.cloudtrail#ErrorCode"), shape_type=ShapeType.STRING -) - -EVENT_NAME = Schema( - id=ShapeID("com.amazonaws.cloudtrail#EventName"), shape_type=ShapeType.STRING -) - -EVENT_SOURCE = Schema( - id=ShapeID("com.amazonaws.cloudtrail#EventSource"), shape_type=ShapeType.STRING -) - -INSIGHTS_METRIC_MAX_RESULTS = Schema( - id=ShapeID("com.amazonaws.cloudtrail#InsightsMetricMaxResults"), - shape_type=ShapeType.INTEGER, -) - -INSIGHTS_METRIC_NEXT_TOKEN = Schema( - id=ShapeID("com.amazonaws.cloudtrail#InsightsMetricNextToken"), - shape_type=ShapeType.STRING, -) - -INSIGHTS_METRIC_PERIOD = Schema( - id=ShapeID("com.amazonaws.cloudtrail#InsightsMetricPeriod"), - shape_type=ShapeType.INTEGER, -) - -LIST_INSIGHTS_METRIC_DATA_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ListInsightsMetricDataInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#ListInsightsMetricDataRequest", - ) - ], - members={ - "TrailName": {"target": STRING}, - "EventSource": { - "target": EVENT_SOURCE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "EventName": { - "target": EVENT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "InsightType": { - "target": INSIGHT_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ErrorCode": {"target": ERROR_CODE}, - "StartTime": {"target": DATE}, - "EndTime": {"target": DATE}, - "Period": {"target": INSIGHTS_METRIC_PERIOD}, - "DataType": {"target": INSIGHTS_METRIC_DATA_TYPE}, - "MaxResults": {"target": INSIGHTS_METRIC_MAX_RESULTS}, - "NextToken": {"target": INSIGHTS_METRIC_NEXT_TOKEN}, - }, -) - -TIMESTAMPS = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#Timestamps"), - shape_type=ShapeType.LIST, - members={"member": {"target": DATE}}, -) - -DOUBLE = Schema( - id=ShapeID("com.amazonaws.cloudtrail#Double"), shape_type=ShapeType.DOUBLE -) - -INSIGHTS_METRIC_VALUES = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#InsightsMetricValues"), - shape_type=ShapeType.LIST, - members={"member": {"target": DOUBLE}}, -) - -LIST_INSIGHTS_METRIC_DATA_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ListInsightsMetricDataOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#ListInsightsMetricDataResponse", - ) - ], - members={ - "TrailARN": {"target": STRING}, - "EventSource": {"target": EVENT_SOURCE}, - "EventName": {"target": EVENT_NAME}, - "InsightType": {"target": INSIGHT_TYPE}, - "ErrorCode": {"target": ERROR_CODE}, - "Timestamps": {"target": TIMESTAMPS}, - "Values": {"target": INSIGHTS_METRIC_VALUES}, - "NextToken": {"target": INSIGHTS_METRIC_NEXT_TOKEN}, - }, -) - -LIST_INSIGHTS_METRIC_DATA = Schema( - id=ShapeID("com.amazonaws.cloudtrail#ListInsightsMetricData"), - shape_type=ShapeType.OPERATION, -) - -INVALID_TIME_RANGE_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#InvalidTimeRangeException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "InvalidTimeRange", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -INVALID_TOKEN_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#InvalidTokenException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType({"code": "InvalidToken", "httpResponseCode": 400}), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -LIST_PUBLIC_KEYS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ListPublicKeysInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#ListPublicKeysRequest", - ) - ], - members={ - "StartTime": {"target": DATE}, - "EndTime": {"target": DATE}, - "NextToken": {"target": STRING}, - }, -) - -PUBLIC_KEY = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#PublicKey"), - members={ - "Value": {"target": BYTE_BUFFER}, - "ValidityStartTime": {"target": DATE}, - "ValidityEndTime": {"target": DATE}, - "Fingerprint": {"target": STRING}, - }, -) - -PUBLIC_KEY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#PublicKeyList"), - shape_type=ShapeType.LIST, - members={"member": {"target": PUBLIC_KEY}}, -) - -LIST_PUBLIC_KEYS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ListPublicKeysOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#ListPublicKeysResponse", - ) - ], - members={ - "PublicKeyList": {"target": PUBLIC_KEY_LIST}, - "NextToken": {"target": STRING}, - }, -) - -LIST_PUBLIC_KEYS = Schema( - id=ShapeID("com.amazonaws.cloudtrail#ListPublicKeys"), - shape_type=ShapeType.OPERATION, -) - -INVALID_DATE_RANGE_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#InvalidDateRangeException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "InvalidDateRange", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -INVALID_QUERY_STATUS_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#InvalidQueryStatusException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "InvalidQueryStatus", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -LIST_QUERIES_MAX_RESULTS_COUNT = Schema( - id=ShapeID("com.amazonaws.cloudtrail#ListQueriesMaxResultsCount"), - shape_type=ShapeType.INTEGER, -) - -LIST_QUERIES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ListQueriesInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#ListQueriesRequest", - ) - ], - members={ - "EventDataStore": { - "target": EVENT_DATA_STORE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "NextToken": {"target": PAGINATION_TOKEN}, - "MaxResults": {"target": LIST_QUERIES_MAX_RESULTS_COUNT}, - "StartTime": {"target": DATE}, - "EndTime": {"target": DATE}, - "QueryStatus": {"target": QUERY_STATUS}, - }, -) - -QUERY = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#Query"), - members={ - "QueryId": {"target": UUID}, - "QueryStatus": {"target": QUERY_STATUS}, - "CreationTime": {"target": DATE}, - }, -) - -QUERIES = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#Queries"), - shape_type=ShapeType.LIST, - members={"member": {"target": QUERY}}, -) - -LIST_QUERIES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ListQueriesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#ListQueriesResponse", - ) - ], - members={"Queries": {"target": QUERIES}, "NextToken": {"target": PAGINATION_TOKEN}}, -) - -LIST_QUERIES = Schema( - id=ShapeID("com.amazonaws.cloudtrail#ListQueries"), shape_type=ShapeType.OPERATION -) - -RESOURCE_ID_LIST = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ResourceIdList"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, -) - -LIST_TAGS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ListTagsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#ListTagsRequest", - ) - ], - members={ - "ResourceIdList": { - "target": RESOURCE_ID_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "NextToken": {"target": STRING}, - }, -) - -RESOURCE_TAG = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ResourceTag"), - members={"ResourceId": {"target": STRING}, "TagsList": {"target": TAGS_LIST}}, -) - -RESOURCE_TAG_LIST = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ResourceTagList"), - shape_type=ShapeType.LIST, - members={"member": {"target": RESOURCE_TAG}}, -) - -LIST_TAGS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ListTagsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#ListTagsResponse", - ) - ], - members={ - "ResourceTagList": {"target": RESOURCE_TAG_LIST}, - "NextToken": {"target": STRING}, - }, -) - -LIST_TAGS = Schema( - id=ShapeID("com.amazonaws.cloudtrail#ListTags"), shape_type=ShapeType.OPERATION -) - -LIST_TRAILS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ListTrailsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#ListTrailsRequest", - ) - ], - members={"NextToken": {"target": STRING}}, -) - -TRAIL_INFO = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#TrailInfo"), - members={ - "TrailARN": {"target": STRING}, - "Name": {"target": STRING}, - "HomeRegion": {"target": STRING}, - }, -) - -TRAILS = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#Trails"), - shape_type=ShapeType.LIST, - members={"member": {"target": TRAIL_INFO}}, -) - -LIST_TRAILS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ListTrailsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#ListTrailsResponse", - ) - ], - members={"Trails": {"target": TRAILS}, "NextToken": {"target": STRING}}, -) - -LIST_TRAILS = Schema( - id=ShapeID("com.amazonaws.cloudtrail#ListTrails"), shape_type=ShapeType.OPERATION -) - -INVALID_EVENT_CATEGORY_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#InvalidEventCategoryException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "InvalidEventCategory", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -INVALID_LOOKUP_ATTRIBUTES_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#InvalidLookupAttributesException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "InvalidLookupAttributes", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -EVENT_CATEGORY = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#EventCategory"), - shape_type=ShapeType.ENUM, - members={"Insight": {"target": UNIT}}, -) - -LOOKUP_ATTRIBUTE_KEY = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#LookupAttributeKey"), - shape_type=ShapeType.ENUM, - members={ - "EVENT_ID": {"target": UNIT}, - "EVENT_NAME": {"target": UNIT}, - "READ_ONLY": {"target": UNIT}, - "USERNAME": {"target": UNIT}, - "RESOURCE_TYPE": {"target": UNIT}, - "RESOURCE_NAME": {"target": UNIT}, - "EVENT_SOURCE": {"target": UNIT}, - "ACCESS_KEY_ID": {"target": UNIT}, - }, -) - -LOOKUP_ATTRIBUTE_VALUE = Schema( - id=ShapeID("com.amazonaws.cloudtrail#LookupAttributeValue"), - shape_type=ShapeType.STRING, -) - -LOOKUP_ATTRIBUTE = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#LookupAttribute"), - members={ - "AttributeKey": { - "target": LOOKUP_ATTRIBUTE_KEY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "AttributeValue": { - "target": LOOKUP_ATTRIBUTE_VALUE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -LOOKUP_ATTRIBUTES_LIST = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#LookupAttributesList"), - shape_type=ShapeType.LIST, - members={"member": {"target": LOOKUP_ATTRIBUTE}}, -) - -MAX_RESULTS = Schema( - id=ShapeID("com.amazonaws.cloudtrail#MaxResults"), shape_type=ShapeType.INTEGER -) - -NEXT_TOKEN = Schema( - id=ShapeID("com.amazonaws.cloudtrail#NextToken"), shape_type=ShapeType.STRING -) - -LOOKUP_EVENTS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#LookupEventsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#LookupEventsRequest", - ) - ], - members={ - "LookupAttributes": {"target": LOOKUP_ATTRIBUTES_LIST}, - "StartTime": {"target": DATE}, - "EndTime": {"target": DATE}, - "EventCategory": {"target": EVENT_CATEGORY}, - "MaxResults": {"target": MAX_RESULTS}, - "NextToken": {"target": NEXT_TOKEN}, - }, -) - -LOOKUP_EVENTS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#LookupEventsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#LookupEventsResponse", - ) - ], - members={"Events": {"target": EVENTS_LIST}, "NextToken": {"target": NEXT_TOKEN}}, -) - -LOOKUP_EVENTS = Schema( - id=ShapeID("com.amazonaws.cloudtrail#LookupEvents"), shape_type=ShapeType.OPERATION -) - -INSUFFICIENT_IAM_ACCESS_PERMISSION_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#InsufficientIAMAccessPermissionException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "InsufficientIAMAccessPermission", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -PUT_EVENT_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#PutEventConfigurationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#PutEventConfigurationRequest", - ) - ], - members={ - "TrailName": {"target": STRING}, - "EventDataStore": {"target": STRING}, - "MaxEventSize": {"target": MAX_EVENT_SIZE}, - "ContextKeySelectors": {"target": CONTEXT_KEY_SELECTORS}, - "AggregationConfigurations": {"target": AGGREGATION_CONFIGURATIONS}, - }, -) - -PUT_EVENT_CONFIGURATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#PutEventConfigurationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#PutEventConfigurationResponse", - ) - ], - members={ - "TrailARN": {"target": STRING}, - "EventDataStoreArn": {"target": EVENT_DATA_STORE_ARN}, - "MaxEventSize": {"target": MAX_EVENT_SIZE}, - "ContextKeySelectors": {"target": CONTEXT_KEY_SELECTORS}, - "AggregationConfigurations": {"target": AGGREGATION_CONFIGURATIONS}, - }, -) - -PUT_EVENT_CONFIGURATION = Schema( - id=ShapeID("com.amazonaws.cloudtrail#PutEventConfiguration"), - shape_type=ShapeType.OPERATION, -) - -PUT_EVENT_SELECTORS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#PutEventSelectorsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#PutEventSelectorsRequest", - ) - ], - members={ - "TrailName": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "EventSelectors": {"target": EVENT_SELECTORS}, - "AdvancedEventSelectors": {"target": ADVANCED_EVENT_SELECTORS}, - }, -) - -PUT_EVENT_SELECTORS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#PutEventSelectorsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#PutEventSelectorsResponse", - ) - ], - members={ - "TrailARN": {"target": STRING}, - "EventSelectors": {"target": EVENT_SELECTORS}, - "AdvancedEventSelectors": {"target": ADVANCED_EVENT_SELECTORS}, - }, -) - -PUT_EVENT_SELECTORS = Schema( - id=ShapeID("com.amazonaws.cloudtrail#PutEventSelectors"), - shape_type=ShapeType.OPERATION, -) - -INVALID_INSIGHT_SELECTORS_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#InvalidInsightSelectorsException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "InvalidInsightSelectors", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -PUT_INSIGHT_SELECTORS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#PutInsightSelectorsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#PutInsightSelectorsRequest", - ) - ], - members={ - "TrailName": {"target": STRING}, - "InsightSelectors": { - "target": INSIGHT_SELECTORS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "EventDataStore": {"target": EVENT_DATA_STORE_ARN}, - "InsightsDestination": {"target": EVENT_DATA_STORE_ARN}, - }, -) - -PUT_INSIGHT_SELECTORS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#PutInsightSelectorsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#PutInsightSelectorsResponse", - ) - ], - members={ - "TrailARN": {"target": STRING}, - "InsightSelectors": {"target": INSIGHT_SELECTORS}, - "EventDataStoreArn": {"target": EVENT_DATA_STORE_ARN}, - "InsightsDestination": {"target": EVENT_DATA_STORE_ARN}, - }, -) - -PUT_INSIGHT_SELECTORS = Schema( - id=ShapeID("com.amazonaws.cloudtrail#PutInsightSelectors"), - shape_type=ShapeType.OPERATION, -) - -PUT_RESOURCE_POLICY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#PutResourcePolicyInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#PutResourcePolicyRequest", - ) - ], - members={ - "ResourceArn": { - "target": RESOURCE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ResourcePolicy": { - "target": RESOURCE_POLICY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -PUT_RESOURCE_POLICY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#PutResourcePolicyOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#PutResourcePolicyResponse", - ) - ], - members={ - "ResourceArn": {"target": RESOURCE_ARN}, - "ResourcePolicy": {"target": RESOURCE_POLICY}, - "DelegatedAdminResourcePolicy": {"target": RESOURCE_POLICY}, - }, -) - -RESOURCE_POLICY_NOT_VALID_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#ResourcePolicyNotValidException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "ResourcePolicyNotValid", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -PUT_RESOURCE_POLICY = Schema( - id=ShapeID("com.amazonaws.cloudtrail#PutResourcePolicy"), - shape_type=ShapeType.OPERATION, -) - -DELEGATED_ADMIN_ACCOUNT_LIMIT_EXCEEDED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#DelegatedAdminAccountLimitExceededException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "DelegatedAdminAccountLimitExceeded", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -REGISTER_ORGANIZATION_DELEGATED_ADMIN_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#RegisterOrganizationDelegatedAdminInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#RegisterOrganizationDelegatedAdminRequest", - ) - ], - members={ - "MemberAccountId": { - "target": ACCOUNT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -REGISTER_ORGANIZATION_DELEGATED_ADMIN_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#RegisterOrganizationDelegatedAdminOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#RegisterOrganizationDelegatedAdminResponse", - ) - ], -) - -REGISTER_ORGANIZATION_DELEGATED_ADMIN = Schema( - id=ShapeID("com.amazonaws.cloudtrail#RegisterOrganizationDelegatedAdmin"), - shape_type=ShapeType.OPERATION, -) - -REMOVE_TAGS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#RemoveTagsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#RemoveTagsRequest", - ) - ], - members={ - "ResourceId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "TagsList": { - "target": TAGS_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -REMOVE_TAGS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#RemoveTagsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#RemoveTagsResponse", - ) - ], -) - -REMOVE_TAGS = Schema( - id=ShapeID("com.amazonaws.cloudtrail#RemoveTags"), shape_type=ShapeType.OPERATION -) - -RESTORE_EVENT_DATA_STORE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#RestoreEventDataStoreInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#RestoreEventDataStoreRequest", - ) - ], - members={ - "EventDataStore": { - "target": EVENT_DATA_STORE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -RESTORE_EVENT_DATA_STORE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#RestoreEventDataStoreOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#RestoreEventDataStoreResponse", - ) - ], - members={ - "EventDataStoreArn": {"target": EVENT_DATA_STORE_ARN}, - "Name": {"target": EVENT_DATA_STORE_NAME}, - "Status": {"target": EVENT_DATA_STORE_STATUS}, - "AdvancedEventSelectors": {"target": ADVANCED_EVENT_SELECTORS}, - "MultiRegionEnabled": {"target": BOOLEAN}, - "OrganizationEnabled": {"target": BOOLEAN}, - "RetentionPeriod": {"target": RETENTION_PERIOD}, - "TerminationProtectionEnabled": {"target": TERMINATION_PROTECTION_ENABLED}, - "CreatedTimestamp": {"target": DATE}, - "UpdatedTimestamp": {"target": DATE}, - "KmsKeyId": {"target": EVENT_DATA_STORE_KMS_KEY_ID}, - "BillingMode": {"target": BILLING_MODE}, - }, +LOOKUP_EVENTS_OUTPUT: StaticSchema = ( + 18, + n0, + _LEO, + {_sSI: _cLERo, _smit: None}, + (_Eve, _NT), + ((EVENTS_LIST, 0), (NEXT_TOKEN, 0)), +) + +LOOKUP_EVENTS: StaticOperationSchema = ( + 23, + n0, + _LE, + 0, + LOOKUP_EVENTS_INPUT, + LOOKUP_EVENTS_OUTPUT, + ( + INVALID_EVENT_CATEGORY_EXCEPTION, + INVALID_LOOKUP_ATTRIBUTES_EXCEPTION, + INVALID_MAX_RESULTS_EXCEPTION, + INVALID_NEXT_TOKEN_EXCEPTION, + INVALID_TIME_RANGE_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -RESTORE_EVENT_DATA_STORE = Schema( - id=ShapeID("com.amazonaws.cloudtrail#RestoreEventDataStore"), - shape_type=ShapeType.OPERATION, +INSUFFICIENT_IAM_ACCESS_PERMISSION_EXCEPTION: StaticSchema = ( + 18, + n0, + _IIAMAPE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +PUT_EVENT_CONFIGURATION_INPUT: StaticSchema = ( + 18, + n0, + _PECI, + {_sSI: _cPECR, _smi: None}, + (_TN, _EDS, _MES, _CKSo, _ACg), + ( + (STRING, 0), + (STRING, 0), + (MAX_EVENT_SIZE, 0), + (CONTEXT_KEY_SELECTORS, 0), + (AGGREGATION_CONFIGURATIONS, 0), + ), ) -SEARCH_SAMPLE_QUERIES_MAX_RESULTS = Schema( - id=ShapeID("com.amazonaws.cloudtrail#SearchSampleQueriesMaxResults"), - shape_type=ShapeType.INTEGER, +PUT_EVENT_CONFIGURATION_OUTPUT: StaticSchema = ( + 18, + n0, + _PECO, + {_sSI: _cPECRo, _smit: None}, + (_TARN, _EDSA, _MES, _CKSo, _ACg), + ( + (STRING, 0), + (EVENT_DATA_STORE_ARN, 0), + (MAX_EVENT_SIZE, 0), + (CONTEXT_KEY_SELECTORS, 0), + (AGGREGATION_CONFIGURATIONS, 0), + ), ) -SEARCH_SAMPLE_QUERIES_SEARCH_PHRASE = Schema( - id=ShapeID("com.amazonaws.cloudtrail#SearchSampleQueriesSearchPhrase"), - shape_type=ShapeType.STRING, +PUT_EVENT_CONFIGURATION: StaticOperationSchema = ( + 23, + n0, + _PEC, + 0, + PUT_EVENT_CONFIGURATION_INPUT, + PUT_EVENT_CONFIGURATION_OUTPUT, + ( + CLOUD_TRAIL_ARN_INVALID_EXCEPTION, + CONFLICT_EXCEPTION, + EVENT_DATA_STORE_ARN_INVALID_EXCEPTION, + EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, + INACTIVE_EVENT_DATA_STORE_EXCEPTION, + INSUFFICIENT_DEPENDENCY_SERVICE_ACCESS_PERMISSION_EXCEPTION, + INSUFFICIENT_IAM_ACCESS_PERMISSION_EXCEPTION, + INVALID_EVENT_DATA_STORE_CATEGORY_EXCEPTION, + INVALID_EVENT_DATA_STORE_STATUS_EXCEPTION, + INVALID_HOME_REGION_EXCEPTION, + INVALID_PARAMETER_COMBINATION_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + INVALID_TRAIL_NAME_EXCEPTION, + NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, + NOT_ORGANIZATION_MASTER_ACCOUNT_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + THROTTLING_EXCEPTION, + TRAIL_NOT_FOUND_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -SEARCH_SAMPLE_QUERIES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#SearchSampleQueriesInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#SearchSampleQueriesRequest", - ) - ], - members={ - "SearchPhrase": { - "target": SEARCH_SAMPLE_QUERIES_SEARCH_PHRASE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "MaxResults": {"target": SEARCH_SAMPLE_QUERIES_MAX_RESULTS}, - "NextToken": {"target": PAGINATION_TOKEN}, - }, +PUT_EVENT_SELECTORS_INPUT: StaticSchema = ( + 18, + n0, + _PESI, + {_sSI: _cPESR, _smi: None}, + (_TN, _ESve, _AESd), + ((STRING, 1), (EVENT_SELECTORS, 0), (ADVANCED_EVENT_SELECTORS, 0)), +) + +PUT_EVENT_SELECTORS_OUTPUT: StaticSchema = ( + 18, + n0, + _PESO, + {_sSI: _cPESRo, _smit: None}, + (_TARN, _ESve, _AESd), + ((STRING, 0), (EVENT_SELECTORS, 0), (ADVANCED_EVENT_SELECTORS, 0)), +) + +PUT_EVENT_SELECTORS: StaticOperationSchema = ( + 23, + n0, + _PES, + 0, + PUT_EVENT_SELECTORS_INPUT, + PUT_EVENT_SELECTORS_OUTPUT, + ( + CLOUD_TRAIL_ARN_INVALID_EXCEPTION, + CONFLICT_EXCEPTION, + INSUFFICIENT_DEPENDENCY_SERVICE_ACCESS_PERMISSION_EXCEPTION, + INVALID_EVENT_SELECTORS_EXCEPTION, + INVALID_HOME_REGION_EXCEPTION, + INVALID_TRAIL_NAME_EXCEPTION, + NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, + NOT_ORGANIZATION_MASTER_ACCOUNT_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + THROTTLING_EXCEPTION, + TRAIL_NOT_FOUND_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -SAMPLE_QUERY_DESCRIPTION = Schema( - id=ShapeID("com.amazonaws.cloudtrail#SampleQueryDescription"), - shape_type=ShapeType.STRING, +INVALID_INSIGHT_SELECTORS_EXCEPTION: StaticSchema = ( + 18, + n0, + _IISE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +PUT_INSIGHT_SELECTORS_INPUT: StaticSchema = ( + 18, + n0, + _PISI, + {_sSI: _cPISR, _smi: None}, + (_TN, _ISns, _EDS, _IDn), + ( + (STRING, 0), + (INSIGHT_SELECTORS, 1), + (EVENT_DATA_STORE_ARN, 0), + (EVENT_DATA_STORE_ARN, 0), + ), ) -SAMPLE_QUERY_NAME = Schema( - id=ShapeID("com.amazonaws.cloudtrail#SampleQueryName"), shape_type=ShapeType.STRING +PUT_INSIGHT_SELECTORS_OUTPUT: StaticSchema = ( + 18, + n0, + _PISO, + {_sSI: _cPISRo, _smit: None}, + (_TARN, _ISns, _EDSA, _IDn), + ( + (STRING, 0), + (INSIGHT_SELECTORS, 0), + (EVENT_DATA_STORE_ARN, 0), + (EVENT_DATA_STORE_ARN, 0), + ), ) -SAMPLE_QUERY_RELEVANCE = Schema( - id=ShapeID("com.amazonaws.cloudtrail#SampleQueryRelevance"), - shape_type=ShapeType.FLOAT, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=0)], +PUT_INSIGHT_SELECTORS: StaticOperationSchema = ( + 23, + n0, + _PIS, + 0, + PUT_INSIGHT_SELECTORS_INPUT, + PUT_INSIGHT_SELECTORS_OUTPUT, + ( + CLOUD_TRAIL_ARN_INVALID_EXCEPTION, + CONFLICT_EXCEPTION, + INSUFFICIENT_ENCRYPTION_POLICY_EXCEPTION, + INSUFFICIENT_S3_BUCKET_POLICY_EXCEPTION, + INVALID_HOME_REGION_EXCEPTION, + INVALID_INSIGHT_SELECTORS_EXCEPTION, + INVALID_PARAMETER_COMBINATION_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + INVALID_TRAIL_NAME_EXCEPTION, + KMS_EXCEPTION, + NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, + NOT_ORGANIZATION_MASTER_ACCOUNT_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + S3_BUCKET_DOES_NOT_EXIST_EXCEPTION, + THROTTLING_EXCEPTION, + TRAIL_NOT_FOUND_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -SAMPLE_QUERY_SQL = Schema( - id=ShapeID("com.amazonaws.cloudtrail#SampleQuerySQL"), shape_type=ShapeType.STRING +PUT_RESOURCE_POLICY_INPUT: StaticSchema = ( + 18, + n0, + _PRPI, + {_sSI: _cPRPR, _smi: None}, + (_RAe, _RPe), + ((RESOURCE_ARN, 1), (RESOURCE_POLICY, 1)), +) + +PUT_RESOURCE_POLICY_OUTPUT: StaticSchema = ( + 18, + n0, + _PRPO, + {_sSI: _cPRPRo, _smit: None}, + (_RAe, _RPe, _DARP), + ((RESOURCE_ARN, 0), (RESOURCE_POLICY, 0), (RESOURCE_POLICY, 0)), +) + +RESOURCE_POLICY_NOT_VALID_EXCEPTION: StaticSchema = ( + 18, + n0, + _RPNVE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +PUT_RESOURCE_POLICY: StaticOperationSchema = ( + 23, + n0, + _PRP, + 0, + PUT_RESOURCE_POLICY_INPUT, + PUT_RESOURCE_POLICY_OUTPUT, + ( + CONFLICT_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + RESOURCE_ARN_NOT_VALID_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + RESOURCE_POLICY_NOT_VALID_EXCEPTION, + RESOURCE_TYPE_NOT_SUPPORTED_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -SEARCH_SAMPLE_QUERIES_SEARCH_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#SearchSampleQueriesSearchResult"), - members={ - "Name": {"target": SAMPLE_QUERY_NAME}, - "Description": {"target": SAMPLE_QUERY_DESCRIPTION}, - "SQL": {"target": SAMPLE_QUERY_SQL}, - "Relevance": { - "target": SAMPLE_QUERY_RELEVANCE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - }, +DELEGATED_ADMIN_ACCOUNT_LIMIT_EXCEEDED_EXCEPTION: StaticSchema = ( + 18, + n0, + _DAALEE, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +REGISTER_ORGANIZATION_DELEGATED_ADMIN_INPUT: StaticSchema = ( + 18, + n0, + _RODAI, + {_sSI: _cRODAR, _smi: None}, + (_MAI,), + ((ACCOUNT_ID, 1),), +) + +REGISTER_ORGANIZATION_DELEGATED_ADMIN_OUTPUT: StaticSchema = ( + 18, + n0, + _RODAO, + {_sSI: _cRODARo, _smit: None}, +) + +REGISTER_ORGANIZATION_DELEGATED_ADMIN: StaticOperationSchema = ( + 23, + n0, + _RODA, + 0, + REGISTER_ORGANIZATION_DELEGATED_ADMIN_INPUT, + REGISTER_ORGANIZATION_DELEGATED_ADMIN_OUTPUT, + ( + ACCOUNT_NOT_FOUND_EXCEPTION, + ACCOUNT_REGISTERED_EXCEPTION, + CANNOT_DELEGATE_MANAGEMENT_ACCOUNT_EXCEPTION, + CLOUD_TRAIL_ACCESS_NOT_ENABLED_EXCEPTION, + CONFLICT_EXCEPTION, + DELEGATED_ADMIN_ACCOUNT_LIMIT_EXCEEDED_EXCEPTION, + INSUFFICIENT_DEPENDENCY_SERVICE_ACCESS_PERMISSION_EXCEPTION, + INSUFFICIENT_IAM_ACCESS_PERMISSION_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + NOT_ORGANIZATION_MANAGEMENT_ACCOUNT_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + ORGANIZATION_NOT_IN_ALL_FEATURES_MODE_EXCEPTION, + ORGANIZATIONS_NOT_IN_USE_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -SEARCH_SAMPLE_QUERIES_SEARCH_RESULTS = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#SearchSampleQueriesSearchResults"), - shape_type=ShapeType.LIST, - members={"member": {"target": SEARCH_SAMPLE_QUERIES_SEARCH_RESULT}}, +REMOVE_TAGS_INPUT: StaticSchema = ( + 18, + n0, + _RTI, + {_sSI: _cRTR, _smi: None}, + (_RI, _TL), + ((STRING, 1), (TAGS_LIST, 1)), +) + +REMOVE_TAGS_OUTPUT: StaticSchema = (18, n0, _RTO, {_sSI: _cRTRo, _smit: None}) + +REMOVE_TAGS: StaticOperationSchema = ( + 23, + n0, + _RTem, + 0, + REMOVE_TAGS_INPUT, + REMOVE_TAGS_OUTPUT, + ( + CHANNEL_ARN_INVALID_EXCEPTION, + CHANNEL_NOT_FOUND_EXCEPTION, + CLOUD_TRAIL_ARN_INVALID_EXCEPTION, + CONFLICT_EXCEPTION, + EVENT_DATA_STORE_ARN_INVALID_EXCEPTION, + EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, + INACTIVE_EVENT_DATA_STORE_EXCEPTION, + INVALID_TAG_PARAMETER_EXCEPTION, + INVALID_TRAIL_NAME_EXCEPTION, + NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, + NOT_ORGANIZATION_MASTER_ACCOUNT_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + RESOURCE_TYPE_NOT_SUPPORTED_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -SEARCH_SAMPLE_QUERIES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#SearchSampleQueriesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#SearchSampleQueriesResponse", - ) - ], - members={ - "SearchResults": {"target": SEARCH_SAMPLE_QUERIES_SEARCH_RESULTS}, - "NextToken": {"target": PAGINATION_TOKEN}, - }, +RESTORE_EVENT_DATA_STORE_INPUT: StaticSchema = ( + 18, + n0, + _REDSI, + {_sSI: _cREDSR, _smi: None}, + (_EDS,), + ((EVENT_DATA_STORE_ARN, 1),), +) + +RESTORE_EVENT_DATA_STORE_OUTPUT: StaticSchema = ( + 18, + n0, + _REDSO, + {_sSI: _cREDSRo, _smit: None}, + (_EDSA, _N, _St, _AESd, _MRE, _OE, _RP, _TPE, _CT, _UT, _KKI, _BM), + ( + (EVENT_DATA_STORE_ARN, 0), + (EVENT_DATA_STORE_NAME, 0), + (EVENT_DATA_STORE_STATUS, 0), + (ADVANCED_EVENT_SELECTORS, 0), + (BOOLEAN, 0), + (BOOLEAN, 0), + (RETENTION_PERIOD, 0), + (TERMINATION_PROTECTION_ENABLED, 0), + (DATE, 0), + (DATE, 0), + (EVENT_DATA_STORE_KMS_KEY_ID, 0), + (BILLING_MODE, 0), + ), ) -SEARCH_SAMPLE_QUERIES = Schema( - id=ShapeID("com.amazonaws.cloudtrail#SearchSampleQueries"), - shape_type=ShapeType.OPERATION, +RESTORE_EVENT_DATA_STORE: StaticOperationSchema = ( + 23, + n0, + _REDS, + 0, + RESTORE_EVENT_DATA_STORE_INPUT, + RESTORE_EVENT_DATA_STORE_OUTPUT, + ( + CLOUD_TRAIL_ACCESS_NOT_ENABLED_EXCEPTION, + EVENT_DATA_STORE_ARN_INVALID_EXCEPTION, + EVENT_DATA_STORE_MAX_LIMIT_EXCEEDED_EXCEPTION, + EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, + INSUFFICIENT_DEPENDENCY_SERVICE_ACCESS_PERMISSION_EXCEPTION, + INVALID_EVENT_DATA_STORE_STATUS_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, + NOT_ORGANIZATION_MASTER_ACCOUNT_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + ORGANIZATION_NOT_IN_ALL_FEATURES_MODE_EXCEPTION, + ORGANIZATIONS_NOT_IN_USE_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -QUERY_PARAMETER_KEY = Schema( - id=ShapeID("com.amazonaws.cloudtrail#QueryParameterKey"), - shape_type=ShapeType.STRING, -) +SEARCH_SAMPLE_QUERIES_MAX_RESULTS: StaticSchema = (7, n0, _SSQMR, 0) -QUERY_PARAMETER_VALUE = Schema( - id=ShapeID("com.amazonaws.cloudtrail#QueryParameterValue"), - shape_type=ShapeType.STRING, -) +SEARCH_SAMPLE_QUERIES_SEARCH_PHRASE: StaticSchema = (3, n0, _SSQSP, 0) -QUERY_PARAMETER_VALUES = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#QueryParameterValues"), - shape_type=ShapeType.MAP, - members={ - "key": {"target": QUERY_PARAMETER_KEY}, - "value": {"target": QUERY_PARAMETER_VALUE}, - }, +SEARCH_SAMPLE_QUERIES_INPUT: StaticSchema = ( + 18, + n0, + _SSQI, + {_sSI: _cSSQR, _smi: None}, + (_SP, _MR, _NT), + ( + (SEARCH_SAMPLE_QUERIES_SEARCH_PHRASE, 1), + (SEARCH_SAMPLE_QUERIES_MAX_RESULTS, 0), + (PAGINATION_TOKEN, 0), + ), ) -START_DASHBOARD_REFRESH_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#StartDashboardRefreshInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#StartDashboardRefreshRequest", - ) - ], - members={ - "DashboardId": { - "target": DASHBOARD_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "QueryParameterValues": {"target": QUERY_PARAMETER_VALUES}, - }, -) +SAMPLE_QUERY_DESCRIPTION: StaticSchema = (3, n0, _SQD, 0) -START_DASHBOARD_REFRESH_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#StartDashboardRefreshOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#StartDashboardRefreshResponse", - ) - ], - members={"RefreshId": {"target": REFRESH_ID}}, -) - -START_DASHBOARD_REFRESH = Schema( - id=ShapeID("com.amazonaws.cloudtrail#StartDashboardRefresh"), - shape_type=ShapeType.OPERATION, -) - -START_EVENT_DATA_STORE_INGESTION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#StartEventDataStoreIngestionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#StartEventDataStoreIngestionRequest", - ) - ], - members={ - "EventDataStore": { - "target": EVENT_DATA_STORE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +SAMPLE_QUERY_NAME: StaticSchema = (3, n0, _SQN, 0) -START_EVENT_DATA_STORE_INGESTION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#StartEventDataStoreIngestionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#StartEventDataStoreIngestionResponse", - ) - ], -) +SAMPLE_QUERY_RELEVANCE: StaticSchema = (9, n0, _SQR, {_smith: 0}) -START_EVENT_DATA_STORE_INGESTION = Schema( - id=ShapeID("com.amazonaws.cloudtrail#StartEventDataStoreIngestion"), - shape_type=ShapeType.OPERATION, -) +SAMPLE_QUERY_SQL: StaticSchema = (3, n0, _SQSQL, 0) -INVALID_IMPORT_SOURCE_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#InvalidImportSourceException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "InvalidImportSource", "httpResponseCode": 400} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -START_IMPORT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#StartImportInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#StartImportRequest", - ) - ], - members={ - "Destinations": {"target": IMPORT_DESTINATIONS}, - "ImportSource": {"target": IMPORT_SOURCE}, - "StartEventTime": {"target": DATE}, - "EndEventTime": {"target": DATE}, - "ImportId": {"target": UUID}, - }, +SEARCH_SAMPLE_QUERIES_SEARCH_RESULT: StaticSchema = ( + 18, + n0, + _SSQSR, + 0, + (_N, _Desc, _SQL, _Rel), + ( + (SAMPLE_QUERY_NAME, 0), + (SAMPLE_QUERY_DESCRIPTION, 0), + (SAMPLE_QUERY_SQL, 0), + (SAMPLE_QUERY_RELEVANCE, {_smith: 0}), + ), ) -START_IMPORT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#StartImportOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#StartImportResponse", - ) - ], - members={ - "ImportId": {"target": UUID}, - "Destinations": {"target": IMPORT_DESTINATIONS}, - "ImportSource": {"target": IMPORT_SOURCE}, - "StartEventTime": {"target": DATE}, - "EndEventTime": {"target": DATE}, - "ImportStatus": {"target": IMPORT_STATUS}, - "CreatedTimestamp": {"target": DATE}, - "UpdatedTimestamp": {"target": DATE}, - }, +SEARCH_SAMPLE_QUERIES_SEARCH_RESULTS: StaticSchema = ( + 16, + n0, + _SSQSRe, + 0, + (_m,), + ((SEARCH_SAMPLE_QUERIES_SEARCH_RESULT, 0),), +) + +SEARCH_SAMPLE_QUERIES_OUTPUT: StaticSchema = ( + 18, + n0, + _SSQO, + {_sSI: _cSSQRo, _smit: None}, + (_SR, _NT), + ((SEARCH_SAMPLE_QUERIES_SEARCH_RESULTS, 0), (PAGINATION_TOKEN, 0)), +) + +SEARCH_SAMPLE_QUERIES: StaticOperationSchema = ( + 23, + n0, + _SSQ, + 0, + SEARCH_SAMPLE_QUERIES_INPUT, + SEARCH_SAMPLE_QUERIES_OUTPUT, + ( + INVALID_PARAMETER_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -START_IMPORT = Schema( - id=ShapeID("com.amazonaws.cloudtrail#StartImport"), shape_type=ShapeType.OPERATION +QUERY_PARAMETER_KEY: StaticSchema = (3, n0, _QPK, 0) + +QUERY_PARAMETER_VALUE: StaticSchema = (3, n0, _QPV, 0) + +QUERY_PARAMETER_VALUES: StaticSchema = ( + 17, + n0, + _QPVu, + 0, + (_k, _v), + ((QUERY_PARAMETER_KEY, 0), (QUERY_PARAMETER_VALUE, 0)), +) + +START_DASHBOARD_REFRESH_INPUT: StaticSchema = ( + 18, + n0, + _SDRI, + {_sSI: _cSDRR, _smi: None}, + (_DI, _QPVu), + ((DASHBOARD_ARN, 1), (QUERY_PARAMETER_VALUES, 0)), +) + +START_DASHBOARD_REFRESH_OUTPUT: StaticSchema = ( + 18, + n0, + _SDRO, + {_sSI: _cSDRRo, _smit: None}, + (_RIe,), + ((REFRESH_ID, 0),), +) + +START_DASHBOARD_REFRESH: StaticOperationSchema = ( + 23, + n0, + _SDR, + 0, + START_DASHBOARD_REFRESH_INPUT, + START_DASHBOARD_REFRESH_OUTPUT, + ( + EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, + INACTIVE_EVENT_DATA_STORE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -START_LOGGING_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#StartLoggingInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#StartLoggingRequest", - ) - ], - members={ - "Name": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +START_EVENT_DATA_STORE_INGESTION_INPUT: StaticSchema = ( + 18, + n0, + _SEDSII, + {_sSI: _cSEDSIR, _smi: None}, + (_EDS,), + ((EVENT_DATA_STORE_ARN, 1),), +) + +START_EVENT_DATA_STORE_INGESTION_OUTPUT: StaticSchema = ( + 18, + n0, + _SEDSIO, + {_sSI: _cSEDSIRo, _smit: None}, +) + +START_EVENT_DATA_STORE_INGESTION: StaticOperationSchema = ( + 23, + n0, + _SEDSI, + 0, + START_EVENT_DATA_STORE_INGESTION_INPUT, + START_EVENT_DATA_STORE_INGESTION_OUTPUT, + ( + CONFLICT_EXCEPTION, + EVENT_DATA_STORE_ARN_INVALID_EXCEPTION, + EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, + INSUFFICIENT_DEPENDENCY_SERVICE_ACCESS_PERMISSION_EXCEPTION, + INVALID_EVENT_DATA_STORE_CATEGORY_EXCEPTION, + INVALID_EVENT_DATA_STORE_STATUS_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, + NOT_ORGANIZATION_MASTER_ACCOUNT_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -START_LOGGING_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#StartLoggingOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#StartLoggingResponse", - ) - ], +INVALID_IMPORT_SOURCE_EXCEPTION: StaticSchema = ( + 18, + n0, + _IISEn, + {_s: _c, _sE: 400}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +START_IMPORT_INPUT: StaticSchema = ( + 18, + n0, + _SII, + {_sSI: _cSIR, _smi: None}, + (_Des, _ISm, _SET, _EET, _II), + ((IMPORT_DESTINATIONS, 0), (IMPORT_SOURCE, 0), (DATE, 0), (DATE, 0), (UUID, 0)), +) + +START_IMPORT_OUTPUT: StaticSchema = ( + 18, + n0, + _SIO, + {_sSI: _cSIRo, _smit: None}, + (_II, _Des, _ISm, _SET, _EET, _ISmpo, _CT, _UT), + ( + (UUID, 0), + (IMPORT_DESTINATIONS, 0), + (IMPORT_SOURCE, 0), + (DATE, 0), + (DATE, 0), + (IMPORT_STATUS, 0), + (DATE, 0), + (DATE, 0), + ), ) -START_LOGGING = Schema( - id=ShapeID("com.amazonaws.cloudtrail#StartLogging"), shape_type=ShapeType.OPERATION +START_IMPORT: StaticOperationSchema = ( + 23, + n0, + _SIt, + 0, + START_IMPORT_INPUT, + START_IMPORT_OUTPUT, + ( + ACCOUNT_HAS_ONGOING_IMPORT_EXCEPTION, + EVENT_DATA_STORE_ARN_INVALID_EXCEPTION, + EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, + IMPORT_NOT_FOUND_EXCEPTION, + INACTIVE_EVENT_DATA_STORE_EXCEPTION, + INSUFFICIENT_ENCRYPTION_POLICY_EXCEPTION, + INVALID_EVENT_DATA_STORE_CATEGORY_EXCEPTION, + INVALID_EVENT_DATA_STORE_STATUS_EXCEPTION, + INVALID_IMPORT_SOURCE_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -MAX_CONCURRENT_QUERIES_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#MaxConcurrentQueriesException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=429), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "MaxConcurrentQueries", "httpResponseCode": 429} - ), - ), - ], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -START_QUERY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#StartQueryInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#StartQueryRequest", - ) - ], - members={ - "QueryStatement": {"target": QUERY_STATEMENT}, - "DeliveryS3Uri": {"target": DELIVERY_S3_URI}, - "QueryAlias": {"target": QUERY_ALIAS}, - "QueryParameters": {"target": QUERY_PARAMETERS}, - "EventDataStoreOwnerAccountId": {"target": ACCOUNT_ID}, - }, +START_LOGGING_INPUT: StaticSchema = ( + 18, + n0, + _SLI, + {_sSI: _cSLR, _smi: None}, + (_N,), + ((STRING, 1),), +) + +START_LOGGING_OUTPUT: StaticSchema = (18, n0, _SLO, {_sSI: _cSLRo, _smit: None}) + +START_LOGGING: StaticOperationSchema = ( + 23, + n0, + _SL, + 0, + START_LOGGING_INPUT, + START_LOGGING_OUTPUT, + ( + CLOUD_TRAIL_ARN_INVALID_EXCEPTION, + CONFLICT_EXCEPTION, + INSUFFICIENT_DEPENDENCY_SERVICE_ACCESS_PERMISSION_EXCEPTION, + INVALID_HOME_REGION_EXCEPTION, + INVALID_TRAIL_NAME_EXCEPTION, + NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, + NOT_ORGANIZATION_MASTER_ACCOUNT_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + THROTTLING_EXCEPTION, + TRAIL_NOT_FOUND_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -START_QUERY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#StartQueryOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#StartQueryResponse", - ) - ], - members={ - "QueryId": {"target": UUID}, - "EventDataStoreOwnerAccountId": {"target": ACCOUNT_ID}, - }, +MAX_CONCURRENT_QUERIES_EXCEPTION: StaticSchema = ( + 18, + n0, + _MCQE, + {_s: _c, _sE: 429}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +START_QUERY_INPUT: StaticSchema = ( + 18, + n0, + _SQI, + {_sSI: _cSQR, _smi: None}, + (_QSu, _DSU, _QA, _QPu, _EDSOAI), + ( + (QUERY_STATEMENT, 0), + (DELIVERY_S3_URI, 0), + (QUERY_ALIAS, 0), + (QUERY_PARAMETERS, 0), + (ACCOUNT_ID, 0), + ), ) -START_QUERY = Schema( - id=ShapeID("com.amazonaws.cloudtrail#StartQuery"), shape_type=ShapeType.OPERATION +START_QUERY_OUTPUT: StaticSchema = ( + 18, + n0, + _SQO, + {_sSI: _cSQRo, _smit: None}, + (_QI, _EDSOAI), + ((UUID, 0), (ACCOUNT_ID, 0)), +) + +START_QUERY: StaticOperationSchema = ( + 23, + n0, + _SQ, + 0, + START_QUERY_INPUT, + START_QUERY_OUTPUT, + ( + EVENT_DATA_STORE_ARN_INVALID_EXCEPTION, + EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, + INACTIVE_EVENT_DATA_STORE_EXCEPTION, + INSUFFICIENT_ENCRYPTION_POLICY_EXCEPTION, + INSUFFICIENT_S3_BUCKET_POLICY_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + INVALID_QUERY_STATEMENT_EXCEPTION, + INVALID_S3_BUCKET_NAME_EXCEPTION, + INVALID_S3_PREFIX_EXCEPTION, + MAX_CONCURRENT_QUERIES_EXCEPTION, + NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + S3_BUCKET_DOES_NOT_EXIST_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -STOP_EVENT_DATA_STORE_INGESTION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#StopEventDataStoreIngestionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#StopEventDataStoreIngestionRequest", - ) - ], - members={ - "EventDataStore": { - "target": EVENT_DATA_STORE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +STOP_EVENT_DATA_STORE_INGESTION_INPUT: StaticSchema = ( + 18, + n0, + _SEDSIIt, + {_sSI: _cSEDSIRom, _smi: None}, + (_EDS,), + ((EVENT_DATA_STORE_ARN, 1),), +) + +STOP_EVENT_DATA_STORE_INGESTION_OUTPUT: StaticSchema = ( + 18, + n0, + _SEDSIOt, + {_sSI: _cSEDSIRoma, _smit: None}, +) + +STOP_EVENT_DATA_STORE_INGESTION: StaticOperationSchema = ( + 23, + n0, + _SEDSIt, + 0, + STOP_EVENT_DATA_STORE_INGESTION_INPUT, + STOP_EVENT_DATA_STORE_INGESTION_OUTPUT, + ( + CONFLICT_EXCEPTION, + EVENT_DATA_STORE_ARN_INVALID_EXCEPTION, + EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, + INSUFFICIENT_DEPENDENCY_SERVICE_ACCESS_PERMISSION_EXCEPTION, + INVALID_EVENT_DATA_STORE_CATEGORY_EXCEPTION, + INVALID_EVENT_DATA_STORE_STATUS_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, + NOT_ORGANIZATION_MASTER_ACCOUNT_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -STOP_EVENT_DATA_STORE_INGESTION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#StopEventDataStoreIngestionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#StopEventDataStoreIngestionResponse", - ) - ], -) - -STOP_EVENT_DATA_STORE_INGESTION = Schema( - id=ShapeID("com.amazonaws.cloudtrail#StopEventDataStoreIngestion"), - shape_type=ShapeType.OPERATION, -) - -STOP_IMPORT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#StopImportInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#StopImportRequest", - ) - ], - members={ - "ImportId": { - "target": UUID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +STOP_IMPORT_INPUT: StaticSchema = ( + 18, + n0, + _SIIt, + {_sSI: _cSIRom, _smi: None}, + (_II,), + ((UUID, 1),), +) + +STOP_IMPORT_OUTPUT: StaticSchema = ( + 18, + n0, + _SIOt, + {_sSI: _cSIRoma, _smit: None}, + (_II, _ISm, _Des, _ISmpo, _CT, _UT, _SET, _EET, _ISmp), + ( + (UUID, 0), + (IMPORT_SOURCE, 0), + (IMPORT_DESTINATIONS, 0), + (IMPORT_STATUS, 0), + (DATE, 0), + (DATE, 0), + (DATE, 0), + (DATE, 0), + (IMPORT_STATISTICS, 0), + ), ) -STOP_IMPORT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#StopImportOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#StopImportResponse", - ) - ], - members={ - "ImportId": {"target": UUID}, - "ImportSource": {"target": IMPORT_SOURCE}, - "Destinations": {"target": IMPORT_DESTINATIONS}, - "ImportStatus": {"target": IMPORT_STATUS}, - "CreatedTimestamp": {"target": DATE}, - "UpdatedTimestamp": {"target": DATE}, - "StartEventTime": {"target": DATE}, - "EndEventTime": {"target": DATE}, - "ImportStatistics": {"target": IMPORT_STATISTICS}, - }, +STOP_IMPORT: StaticOperationSchema = ( + 23, + n0, + _SIto, + 0, + STOP_IMPORT_INPUT, + STOP_IMPORT_OUTPUT, + ( + IMPORT_NOT_FOUND_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -STOP_IMPORT = Schema( - id=ShapeID("com.amazonaws.cloudtrail#StopImport"), shape_type=ShapeType.OPERATION +STOP_LOGGING_INPUT: StaticSchema = ( + 18, + n0, + _SLIt, + {_sSI: _cSLRom, _smi: None}, + (_N,), + ((STRING, 1),), +) + +STOP_LOGGING_OUTPUT: StaticSchema = (18, n0, _SLOt, {_sSI: _cSLRoma, _smit: None}) + +STOP_LOGGING: StaticOperationSchema = ( + 23, + n0, + _SLt, + 0, + STOP_LOGGING_INPUT, + STOP_LOGGING_OUTPUT, + ( + CLOUD_TRAIL_ARN_INVALID_EXCEPTION, + CONFLICT_EXCEPTION, + INSUFFICIENT_DEPENDENCY_SERVICE_ACCESS_PERMISSION_EXCEPTION, + INVALID_HOME_REGION_EXCEPTION, + INVALID_TRAIL_NAME_EXCEPTION, + NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, + NOT_ORGANIZATION_MASTER_ACCOUNT_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + THROTTLING_EXCEPTION, + TRAIL_NOT_FOUND_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -STOP_LOGGING_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#StopLoggingInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#StopLoggingRequest", - ) - ], - members={ - "Name": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +UPDATE_CHANNEL_INPUT: StaticSchema = ( + 18, + n0, + _UCI, + {_sSI: _cUCR, _smi: None}, + (_C, _Des, _N), + ((CHANNEL_ARN, 1), (DESTINATIONS, 0), (CHANNEL_NAME, 0)), +) + +UPDATE_CHANNEL_OUTPUT: StaticSchema = ( + 18, + n0, + _UCO, + {_sSI: _cUCRo, _smit: None}, + (_CA, _N, _So, _Des), + ((CHANNEL_ARN, 0), (CHANNEL_NAME, 0), (SOURCE, 0), (DESTINATIONS, 0)), +) + +UPDATE_CHANNEL: StaticOperationSchema = ( + 23, + n0, + _UC, + 0, + UPDATE_CHANNEL_INPUT, + UPDATE_CHANNEL_OUTPUT, + ( + CHANNEL_ALREADY_EXISTS_EXCEPTION, + CHANNEL_ARN_INVALID_EXCEPTION, + CHANNEL_NOT_FOUND_EXCEPTION, + EVENT_DATA_STORE_ARN_INVALID_EXCEPTION, + EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, + INACTIVE_EVENT_DATA_STORE_EXCEPTION, + INVALID_EVENT_DATA_STORE_CATEGORY_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -STOP_LOGGING_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#StopLoggingOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#StopLoggingResponse", - ) - ], -) - -STOP_LOGGING = Schema( - id=ShapeID("com.amazonaws.cloudtrail#StopLogging"), shape_type=ShapeType.OPERATION -) - -UPDATE_CHANNEL_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#UpdateChannelInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#UpdateChannelRequest", - ) - ], - members={ - "Channel": { - "target": CHANNEL_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Destinations": {"target": DESTINATIONS}, - "Name": {"target": CHANNEL_NAME}, - }, +UPDATE_DASHBOARD_INPUT: StaticSchema = ( + 18, + n0, + _UDI, + {_sSI: _cUDR, _smi: None}, + (_DI, _W, _RS, _TPE), + ( + (DASHBOARD_ARN, 1), + (REQUEST_WIDGET_LIST, 0), + (REFRESH_SCHEDULE, 0), + (TERMINATION_PROTECTION_ENABLED, 0), + ), ) -UPDATE_CHANNEL_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#UpdateChannelOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#UpdateChannelResponse", - ) - ], - members={ - "ChannelArn": {"target": CHANNEL_ARN}, - "Name": {"target": CHANNEL_NAME}, - "Source": {"target": SOURCE}, - "Destinations": {"target": DESTINATIONS}, - }, +UPDATE_DASHBOARD_OUTPUT: StaticSchema = ( + 18, + n0, + _UDO, + {_sSI: _cUDRo, _smit: None}, + (_DA, _N, _Ty, _W, _RS, _TPE, _CT, _UT), + ( + (DASHBOARD_ARN, 0), + (DASHBOARD_NAME, 0), + (DASHBOARD_TYPE, 0), + (WIDGET_LIST, 0), + (REFRESH_SCHEDULE, 0), + (TERMINATION_PROTECTION_ENABLED, 0), + (DATE, 0), + (DATE, 0), + ), ) -UPDATE_CHANNEL = Schema( - id=ShapeID("com.amazonaws.cloudtrail#UpdateChannel"), shape_type=ShapeType.OPERATION -) - -UPDATE_DASHBOARD_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#UpdateDashboardInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#UpdateDashboardRequest", - ) - ], - members={ - "DashboardId": { - "target": DASHBOARD_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Widgets": {"target": REQUEST_WIDGET_LIST}, - "RefreshSchedule": {"target": REFRESH_SCHEDULE}, - "TerminationProtectionEnabled": {"target": TERMINATION_PROTECTION_ENABLED}, - }, +UPDATE_DASHBOARD: StaticOperationSchema = ( + 23, + n0, + _UD, + 0, + UPDATE_DASHBOARD_INPUT, + UPDATE_DASHBOARD_OUTPUT, + ( + CONFLICT_EXCEPTION, + EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, + INACTIVE_EVENT_DATA_STORE_EXCEPTION, + INSUFFICIENT_ENCRYPTION_POLICY_EXCEPTION, + INVALID_QUERY_STATEMENT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -UPDATE_DASHBOARD_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#UpdateDashboardOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#UpdateDashboardResponse", - ) - ], - members={ - "DashboardArn": {"target": DASHBOARD_ARN}, - "Name": {"target": DASHBOARD_NAME}, - "Type": {"target": DASHBOARD_TYPE}, - "Widgets": {"target": WIDGET_LIST}, - "RefreshSchedule": {"target": REFRESH_SCHEDULE}, - "TerminationProtectionEnabled": {"target": TERMINATION_PROTECTION_ENABLED}, - "CreatedTimestamp": {"target": DATE}, - "UpdatedTimestamp": {"target": DATE}, - }, +UPDATE_EVENT_DATA_STORE_INPUT: StaticSchema = ( + 18, + n0, + _UEDSI, + {_sSI: _cUEDSR, _smi: None}, + (_EDS, _N, _AESd, _MRE, _OE, _RP, _TPE, _KKI, _BM), + ( + (EVENT_DATA_STORE_ARN, 1), + (EVENT_DATA_STORE_NAME, 0), + (ADVANCED_EVENT_SELECTORS, 0), + (BOOLEAN, 0), + (BOOLEAN, 0), + (RETENTION_PERIOD, 0), + (TERMINATION_PROTECTION_ENABLED, 0), + (EVENT_DATA_STORE_KMS_KEY_ID, 0), + (BILLING_MODE, 0), + ), ) -UPDATE_DASHBOARD = Schema( - id=ShapeID("com.amazonaws.cloudtrail#UpdateDashboard"), - shape_type=ShapeType.OPERATION, -) - -UPDATE_EVENT_DATA_STORE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#UpdateEventDataStoreInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#UpdateEventDataStoreRequest", - ) - ], - members={ - "EventDataStore": { - "target": EVENT_DATA_STORE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Name": {"target": EVENT_DATA_STORE_NAME}, - "AdvancedEventSelectors": {"target": ADVANCED_EVENT_SELECTORS}, - "MultiRegionEnabled": {"target": BOOLEAN}, - "OrganizationEnabled": {"target": BOOLEAN}, - "RetentionPeriod": {"target": RETENTION_PERIOD}, - "TerminationProtectionEnabled": {"target": TERMINATION_PROTECTION_ENABLED}, - "KmsKeyId": {"target": EVENT_DATA_STORE_KMS_KEY_ID}, - "BillingMode": {"target": BILLING_MODE}, - }, +UPDATE_EVENT_DATA_STORE_OUTPUT: StaticSchema = ( + 18, + n0, + _UEDSO, + {_sSI: _cUEDSRo, _smit: None}, + (_EDSA, _N, _St, _AESd, _MRE, _OE, _RP, _TPE, _CT, _UT, _KKI, _BM, _FSe, _FRA), + ( + (EVENT_DATA_STORE_ARN, 0), + (EVENT_DATA_STORE_NAME, 0), + (EVENT_DATA_STORE_STATUS, 0), + (ADVANCED_EVENT_SELECTORS, 0), + (BOOLEAN, 0), + (BOOLEAN, 0), + (RETENTION_PERIOD, 0), + (TERMINATION_PROTECTION_ENABLED, 0), + (DATE, 0), + (DATE, 0), + (EVENT_DATA_STORE_KMS_KEY_ID, 0), + (BILLING_MODE, 0), + (FEDERATION_STATUS, 0), + (FEDERATION_ROLE_ARN, 0), + ), ) -UPDATE_EVENT_DATA_STORE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#UpdateEventDataStoreOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#UpdateEventDataStoreResponse", - ) - ], - members={ - "EventDataStoreArn": {"target": EVENT_DATA_STORE_ARN}, - "Name": {"target": EVENT_DATA_STORE_NAME}, - "Status": {"target": EVENT_DATA_STORE_STATUS}, - "AdvancedEventSelectors": {"target": ADVANCED_EVENT_SELECTORS}, - "MultiRegionEnabled": {"target": BOOLEAN}, - "OrganizationEnabled": {"target": BOOLEAN}, - "RetentionPeriod": {"target": RETENTION_PERIOD}, - "TerminationProtectionEnabled": {"target": TERMINATION_PROTECTION_ENABLED}, - "CreatedTimestamp": {"target": DATE}, - "UpdatedTimestamp": {"target": DATE}, - "KmsKeyId": {"target": EVENT_DATA_STORE_KMS_KEY_ID}, - "BillingMode": {"target": BILLING_MODE}, - "FederationStatus": {"target": FEDERATION_STATUS}, - "FederationRoleArn": {"target": FEDERATION_ROLE_ARN}, - }, +UPDATE_EVENT_DATA_STORE: StaticOperationSchema = ( + 23, + n0, + _UEDS, + 0, + UPDATE_EVENT_DATA_STORE_INPUT, + UPDATE_EVENT_DATA_STORE_OUTPUT, + ( + CLOUD_TRAIL_ACCESS_NOT_ENABLED_EXCEPTION, + CONFLICT_EXCEPTION, + EVENT_DATA_STORE_ALREADY_EXISTS_EXCEPTION, + EVENT_DATA_STORE_ARN_INVALID_EXCEPTION, + EVENT_DATA_STORE_HAS_ONGOING_IMPORT_EXCEPTION, + EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, + INACTIVE_EVENT_DATA_STORE_EXCEPTION, + INSUFFICIENT_DEPENDENCY_SERVICE_ACCESS_PERMISSION_EXCEPTION, + INSUFFICIENT_ENCRYPTION_POLICY_EXCEPTION, + INVALID_EVENT_SELECTORS_EXCEPTION, + INVALID_INSIGHT_SELECTORS_EXCEPTION, + INVALID_KMS_KEY_ID_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + KMS_EXCEPTION, + KMS_KEY_NOT_FOUND_EXCEPTION, + NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, + NOT_ORGANIZATION_MASTER_ACCOUNT_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + ORGANIZATION_NOT_IN_ALL_FEATURES_MODE_EXCEPTION, + ORGANIZATIONS_NOT_IN_USE_EXCEPTION, + THROTTLING_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -UPDATE_EVENT_DATA_STORE = Schema( - id=ShapeID("com.amazonaws.cloudtrail#UpdateEventDataStore"), - shape_type=ShapeType.OPERATION, -) - -UPDATE_TRAIL_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#UpdateTrailInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#UpdateTrailRequest", - ) - ], - members={ - "Name": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "S3BucketName": {"target": STRING}, - "S3KeyPrefix": {"target": STRING}, - "SnsTopicName": {"target": STRING}, - "IncludeGlobalServiceEvents": {"target": BOOLEAN}, - "IsMultiRegionTrail": {"target": BOOLEAN}, - "EnableLogFileValidation": {"target": BOOLEAN}, - "CloudWatchLogsLogGroupArn": {"target": STRING}, - "CloudWatchLogsRoleArn": {"target": STRING}, - "KmsKeyId": {"target": STRING}, - "IsOrganizationTrail": {"target": BOOLEAN}, - "RecursiveLogging": {"target": BOOLEAN}, - }, +UPDATE_TRAIL_INPUT: StaticSchema = ( + 18, + n0, + _UTI, + {_sSI: _cUTR, _smi: None}, + (_N, _SBN, _SKP, _STN, _IGSE, _IMRT, _ELFV, _CWLLGA, _CWLRA, _KKI, _IOT, _RL), + ( + (STRING, 1), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (BOOLEAN, 0), + (BOOLEAN, 0), + (BOOLEAN, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (BOOLEAN, 0), + (BOOLEAN, 0), + ), ) -UPDATE_TRAIL_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cloudtrail#UpdateTrailOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cloudtrail#UpdateTrailResponse", - ) - ], - members={ - "Name": {"target": STRING}, - "S3BucketName": {"target": STRING}, - "S3KeyPrefix": {"target": STRING}, - "SnsTopicName": {"target": STRING}, - "SnsTopicARN": {"target": STRING}, - "IncludeGlobalServiceEvents": {"target": BOOLEAN}, - "IsMultiRegionTrail": {"target": BOOLEAN}, - "TrailARN": {"target": STRING}, - "LogFileValidationEnabled": {"target": BOOLEAN}, - "CloudWatchLogsLogGroupArn": {"target": STRING}, - "CloudWatchLogsRoleArn": {"target": STRING}, - "KmsKeyId": {"target": STRING}, - "IsOrganizationTrail": {"target": BOOLEAN}, - "RecursiveLogging": {"target": BOOLEAN}, - }, +UPDATE_TRAIL_OUTPUT: StaticSchema = ( + 18, + n0, + _UTO, + {_sSI: _cUTRo, _smit: None}, + ( + _N, + _SBN, + _SKP, + _STN, + _STARN, + _IGSE, + _IMRT, + _TARN, + _LFVE, + _CWLLGA, + _CWLRA, + _KKI, + _IOT, + _RL, + ), + ( + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (BOOLEAN, 0), + (BOOLEAN, 0), + (STRING, 0), + (BOOLEAN, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (BOOLEAN, 0), + (BOOLEAN, 0), + ), ) -UPDATE_TRAIL = Schema( - id=ShapeID("com.amazonaws.cloudtrail#UpdateTrail"), shape_type=ShapeType.OPERATION +UPDATE_TRAIL: StaticOperationSchema = ( + 23, + n0, + _UTp, + 0, + UPDATE_TRAIL_INPUT, + UPDATE_TRAIL_OUTPUT, + ( + CLOUD_TRAIL_ACCESS_NOT_ENABLED_EXCEPTION, + CLOUD_TRAIL_ARN_INVALID_EXCEPTION, + CLOUD_TRAIL_INVALID_CLIENT_TOKEN_ID_EXCEPTION, + CLOUD_WATCH_LOGS_DELIVERY_UNAVAILABLE_EXCEPTION, + CONFLICT_EXCEPTION, + INSUFFICIENT_DEPENDENCY_SERVICE_ACCESS_PERMISSION_EXCEPTION, + INSUFFICIENT_ENCRYPTION_POLICY_EXCEPTION, + INSUFFICIENT_S3_BUCKET_POLICY_EXCEPTION, + INSUFFICIENT_SNS_TOPIC_POLICY_EXCEPTION, + INVALID_CLOUD_WATCH_LOGS_LOG_GROUP_ARN_EXCEPTION, + INVALID_CLOUD_WATCH_LOGS_ROLE_ARN_EXCEPTION, + INVALID_EVENT_SELECTORS_EXCEPTION, + INVALID_HOME_REGION_EXCEPTION, + INVALID_KMS_KEY_ID_EXCEPTION, + INVALID_PARAMETER_COMBINATION_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + INVALID_S3_BUCKET_NAME_EXCEPTION, + INVALID_S3_PREFIX_EXCEPTION, + INVALID_SNS_TOPIC_NAME_EXCEPTION, + INVALID_TRAIL_NAME_EXCEPTION, + KMS_EXCEPTION, + KMS_KEY_DISABLED_EXCEPTION, + KMS_KEY_NOT_FOUND_EXCEPTION, + NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, + NOT_ORGANIZATION_MASTER_ACCOUNT_EXCEPTION, + OPERATION_NOT_PERMITTED_EXCEPTION, + ORGANIZATION_NOT_IN_ALL_FEATURES_MODE_EXCEPTION, + ORGANIZATIONS_NOT_IN_USE_EXCEPTION, + S3_BUCKET_DOES_NOT_EXIST_EXCEPTION, + THROTTLING_EXCEPTION, + TRAIL_NOT_FOUND_EXCEPTION, + TRAIL_NOT_PROVIDED_EXCEPTION, + UNSUPPORTED_OPERATION_EXCEPTION, + ), ) -CLOUD_TRAIL_20131101 = Schema( - id=ShapeID("com.amazonaws.cloudtrail#CloudTrail_20131101"), - shape_type=ShapeType.SERVICE, - traits=[ - Trait.new( - id=ShapeID("aws.auth#sigv4"), value=MappingProxyType({"name": "cloudtrail"}) - ), - Trait.new(id=ShapeID("aws.protocols#awsJson1_1")), - Trait.new( - id=ShapeID("smithy.rules#endpointBdd"), - value=MappingProxyType( - { - "version": "1.1", - "parameters": MappingProxyType( - { - "Region": MappingProxyType( - { - "builtIn": "AWS::Region", - "required": False, - "documentation": "The AWS region used to dispatch the request.", - "type": "string", - } - ), - "UseDualStack": MappingProxyType( - { - "builtIn": "AWS::UseDualStack", - "required": True, - "default": False, - "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", - "type": "boolean", - } - ), - "UseFIPS": MappingProxyType( - { - "builtIn": "AWS::UseFIPS", - "required": True, - "default": False, - "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", - "type": "boolean", - } - ), - "Endpoint": MappingProxyType( - { - "builtIn": "SDK::Endpoint", - "required": False, - "documentation": "Override the endpoint used to send this request", - "type": "string", - } - ), - } - ), - "conditions": ( - MappingProxyType( - { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "Endpoint"}),), - } - ), - MappingProxyType( - { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "Region"}),), - } - ), - MappingProxyType( +CLOUD_TRAIL_20131101: StaticSchema = ( + 21, + n0, + _C_, + { + _a: MappingProxyType({"name": "cloudtrail"}), + _a_: None, + _sB: MappingProxyType( + { + "version": "1.1", + "parameters": MappingProxyType( + { + "Region": MappingProxyType( { - "fn": "aws.partition", - "argv": (MappingProxyType({"ref": "Region"}),), - "assign": "PartitionResult", + "builtIn": "AWS::Region", + "required": False, + "documentation": "The AWS region used to dispatch the request.", + "type": "string", } ), - MappingProxyType( + "UseDualStack": MappingProxyType( { - "fn": "booleanEquals", - "argv": (MappingProxyType({"ref": "UseFIPS"}), True), + "builtIn": "AWS::UseDualStack", + "required": True, + "default": False, + "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", + "type": "boolean", } ), - MappingProxyType( + "UseFIPS": MappingProxyType( { - "fn": "booleanEquals", - "argv": ( - MappingProxyType({"ref": "UseDualStack"}), - True, - ), - } - ), - MappingProxyType( - { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "supportsDualStack", - ), - } - ), - True, - ), - } - ), - MappingProxyType( - { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "supportsFIPS", - ), - } - ), - True, - ), - } - ), - MappingProxyType( - { - "fn": "stringEquals", - "argv": ( - MappingProxyType({"ref": "Region"}), - "us-gov-east-1", - ), + "builtIn": "AWS::UseFIPS", + "required": True, + "default": False, + "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", + "type": "boolean", } ), - MappingProxyType( + "Endpoint": MappingProxyType( { - "fn": "stringEquals", - "argv": ( - MappingProxyType({"ref": "Region"}), - "us-gov-west-1", - ), + "builtIn": "SDK::Endpoint", + "required": False, + "documentation": "Override the endpoint used to send this request", + "type": "string", } ), + } + ), + "conditions": ( + MappingProxyType( + { + "fn": "isSet", + "argv": (MappingProxyType({"ref": "Endpoint"}),), + } ), - "results": ( - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: FIPS and custom endpoint are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": MappingProxyType({"ref": "Endpoint"}), - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://cloudtrail-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "FIPS and DualStack are enabled, but this partition does not support one or both", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://cloudtrail.us-gov-east-1.amazonaws.com", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://cloudtrail.us-gov-west-1.amazonaws.com", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://cloudtrail-fips.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "FIPS is enabled but this partition does not support FIPS", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + MappingProxyType( + {"fn": "isSet", "argv": (MappingProxyType({"ref": "Region"}),)} + ), + MappingProxyType( + { + "fn": "aws.partition", + "argv": (MappingProxyType({"ref": "Region"}),), + "assign": "PartitionResult", + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": (MappingProxyType({"ref": "UseFIPS"}), True), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": (MappingProxyType({"ref": "UseDualStack"}), True), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( { - "url": "https://cloudtrail.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "supportsDualStack", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "DualStack is enabled but this partition does not support DualStack", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + True, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( { - "url": "https://cloudtrail.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "supportsFIPS", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: Missing Region", - "type": "error", - } - ), + True, + ), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType({"ref": "Region"}), + "us-gov-east-1", + ), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType({"ref": "Region"}), + "us-gov-west-1", + ), + } + ), + ), + "results": ( + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: FIPS and custom endpoint are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": MappingProxyType({"ref": "Endpoint"}), + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://cloudtrail-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS and DualStack are enabled, but this partition does not support one or both", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://cloudtrail.us-gov-east-1.amazonaws.com", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://cloudtrail.us-gov-west-1.amazonaws.com", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://cloudtrail-fips.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS is enabled but this partition does not support FIPS", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://cloudtrail.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "DualStack is enabled but this partition does not support DualStack", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://cloudtrail.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } ), - "root": 2, - "nodeCount": 15, - "nodes": "/////wAAAAH/////AAAAAAAAAA4AAAADAAAAAQAAAAQF9eENAAAAAgAAAAUF9eENAAAAAwAAAAgAAAAGAAAABAAAAAcF9eEMAAAABQX14QoF9eELAAAABAAAAAwAAAAJAAAABgAAAAoF9eEJAAAABwX14QYAAAALAAAACAX14QcF9eEIAAAABQAAAA0F9eEFAAAABgX14QQF9eEFAAAAAwX14QEAAAAPAAAABAX14QIF9eED", - } - ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Missing Region", + "type": "error", + } + ), + ), + "root": 2, + "nodeCount": 15, + "nodes": "/////wAAAAH/////AAAAAAAAAA4AAAADAAAAAQAAAAQF9eENAAAAAgAAAAUF9eENAAAAAwAAAAgAAAAGAAAABAAAAAcF9eEMAAAABQX14QoF9eELAAAABAAAAAwAAAAJAAAABgAAAAoF9eEJAAAABwX14QYAAAALAAAACAX14QcF9eEIAAAABQAAAA0F9eEFAAAABgX14QQF9eEFAAAAAwX14QEAAAAPAAAABAX14QIF9eED", + } ), - Trait.new( - id=ShapeID("aws.api#service"), - value=MappingProxyType( - { - "sdkId": "CloudTrail", - "arnNamespace": "cloudtrail", - "cloudFormationName": "CloudTrail", - "cloudTrailEventSource": "cloudtrail.amazonaws.com", - "endpointPrefix": "cloudtrail", - } - ), + _aw: MappingProxyType( + { + "sdkId": "CloudTrail", + "arnNamespace": "cloudtrail", + "cloudFormationName": "CloudTrail", + "cloudTrailEventSource": "cloudtrail.amazonaws.com", + "endpointPrefix": "cloudtrail", + } ), - Trait.new( - id=ShapeID("smithy.api#xmlNamespace"), - value=MappingProxyType( - {"uri": "http://cloudtrail.amazonaws.com/doc/2013-11-01/"} - ), + _sN: MappingProxyType( + {"uri": "http://cloudtrail.amazonaws.com/doc/2013-11-01/"} ), - ], + }, ) diff --git a/clients/aws-sdk-cloudtrail/src/aws_sdk_cloudtrail/client.py b/clients/aws-sdk-cloudtrail/src/aws_sdk_cloudtrail/client.py index 31512b23..b2d7d3be 100644 --- a/clients/aws-sdk-cloudtrail/src/aws_sdk_cloudtrail/client.py +++ b/clients/aws-sdk-cloudtrail/src/aws_sdk_cloudtrail/client.py @@ -1,40 +1,30 @@ # Code generated by smithy-python-codegen DO NOT EDIT. +from __future__ import annotations + from copy import deepcopy import logging from typing import Any, cast +from smithy_aws_core.aio.identity.chain import AsyncIdentityChain from smithy_aws_core.config import ConfigSource from smithy_aws_core.identity import AWSCredentialsIdentity -from smithy_aws_core.identity.chain import IdentityChain -from smithy_core.aio.client import AsyncClient, ClientCall, RequestPipeline +from smithy_core.aio.client import AsyncClient, AsyncClientCall, AsyncRequestPipeline from smithy_core.deserializers import DeserializeableShape from smithy_core.exceptions import ExpectationNotMetError from smithy_core.schemas import APIOperation from smithy_core.serializers import SerializeableShape -from smithy_http.aio.interfaces import HTTPClient +from smithy_http.aio.interfaces import AsyncHTTPClient from smithy_http.plugins import user_agent_plugin from .config import AsyncCloudTrailConfig, Plugin from .models import ( ADD_TAGS, - AddTagsInput, - AddTagsOutput, CANCEL_QUERY, CREATE_CHANNEL, CREATE_DASHBOARD, CREATE_EVENT_DATA_STORE, CREATE_TRAIL, - CancelQueryInput, - CancelQueryOutput, - CreateChannelInput, - CreateChannelOutput, - CreateDashboardInput, - CreateDashboardOutput, - CreateEventDataStoreInput, - CreateEventDataStoreOutput, - CreateTrailInput, - CreateTrailOutput, DELETE_CHANNEL, DELETE_DASHBOARD, DELETE_EVENT_DATA_STORE, @@ -44,27 +34,7 @@ DESCRIBE_QUERY, DESCRIBE_TRAILS, DISABLE_FEDERATION, - DeleteChannelInput, - DeleteChannelOutput, - DeleteDashboardInput, - DeleteDashboardOutput, - DeleteEventDataStoreInput, - DeleteEventDataStoreOutput, - DeleteResourcePolicyInput, - DeleteResourcePolicyOutput, - DeleteTrailInput, - DeleteTrailOutput, - DeregisterOrganizationDelegatedAdminInput, - DeregisterOrganizationDelegatedAdminOutput, - DescribeQueryInput, - DescribeQueryOutput, - DescribeTrailsInput, - DescribeTrailsOutput, - DisableFederationInput, - DisableFederationOutput, ENABLE_FEDERATION, - EnableFederationInput, - EnableFederationOutput, GENERATE_QUERY, GET_CHANNEL, GET_DASHBOARD, @@ -77,30 +47,6 @@ GET_RESOURCE_POLICY, GET_TRAIL, GET_TRAIL_STATUS, - GenerateQueryInput, - GenerateQueryOutput, - GetChannelInput, - GetChannelOutput, - GetDashboardInput, - GetDashboardOutput, - GetEventConfigurationInput, - GetEventConfigurationOutput, - GetEventDataStoreInput, - GetEventDataStoreOutput, - GetEventSelectorsInput, - GetEventSelectorsOutput, - GetImportInput, - GetImportOutput, - GetInsightSelectorsInput, - GetInsightSelectorsOutput, - GetQueryResultsInput, - GetQueryResultsOutput, - GetResourcePolicyInput, - GetResourcePolicyOutput, - GetTrailInput, - GetTrailOutput, - GetTrailStatusInput, - GetTrailStatusOutput, LIST_CHANNELS, LIST_DASHBOARDS, LIST_EVENT_DATA_STORES, @@ -113,51 +59,13 @@ LIST_TAGS, LIST_TRAILS, LOOKUP_EVENTS, - ListChannelsInput, - ListChannelsOutput, - ListDashboardsInput, - ListDashboardsOutput, - ListEventDataStoresInput, - ListEventDataStoresOutput, - ListImportFailuresInput, - ListImportFailuresOutput, - ListImportsInput, - ListImportsOutput, - ListInsightsDataInput, - ListInsightsDataOutput, - ListInsightsMetricDataInput, - ListInsightsMetricDataOutput, - ListPublicKeysInput, - ListPublicKeysOutput, - ListQueriesInput, - ListQueriesOutput, - ListTagsInput, - ListTagsOutput, - ListTrailsInput, - ListTrailsOutput, - LookupEventsInput, - LookupEventsOutput, PUT_EVENT_CONFIGURATION, PUT_EVENT_SELECTORS, PUT_INSIGHT_SELECTORS, PUT_RESOURCE_POLICY, - PutEventConfigurationInput, - PutEventConfigurationOutput, - PutEventSelectorsInput, - PutEventSelectorsOutput, - PutInsightSelectorsInput, - PutInsightSelectorsOutput, - PutResourcePolicyInput, - PutResourcePolicyOutput, REGISTER_ORGANIZATION_DELEGATED_ADMIN, REMOVE_TAGS, RESTORE_EVENT_DATA_STORE, - RegisterOrganizationDelegatedAdminInput, - RegisterOrganizationDelegatedAdminOutput, - RemoveTagsInput, - RemoveTagsOutput, - RestoreEventDataStoreInput, - RestoreEventDataStoreOutput, SEARCH_SAMPLE_QUERIES, START_DASHBOARD_REFRESH, START_EVENT_DATA_STORE_INGESTION, @@ -167,39 +75,139 @@ STOP_EVENT_DATA_STORE_INGESTION, STOP_IMPORT, STOP_LOGGING, - SearchSampleQueriesInput, - SearchSampleQueriesOutput, - StartDashboardRefreshInput, - StartDashboardRefreshOutput, - StartEventDataStoreIngestionInput, - StartEventDataStoreIngestionOutput, - StartImportInput, - StartImportOutput, - StartLoggingInput, - StartLoggingOutput, - StartQueryInput, - StartQueryOutput, - StopEventDataStoreIngestionInput, - StopEventDataStoreIngestionOutput, - StopImportInput, - StopImportOutput, - StopLoggingInput, - StopLoggingOutput, UPDATE_CHANNEL, UPDATE_DASHBOARD, UPDATE_EVENT_DATA_STORE, UPDATE_TRAIL, - UpdateChannelInput, - UpdateChannelOutput, - UpdateDashboardInput, - UpdateDashboardOutput, - UpdateEventDataStoreInput, - UpdateEventDataStoreOutput, - UpdateTrailInput, - UpdateTrailOutput, ) from .user_agent import aws_user_agent_plugin +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .models import ( + AddTagsInput, + AddTagsOutput, + CancelQueryInput, + CancelQueryOutput, + CreateChannelInput, + CreateChannelOutput, + CreateDashboardInput, + CreateDashboardOutput, + CreateEventDataStoreInput, + CreateEventDataStoreOutput, + CreateTrailInput, + CreateTrailOutput, + DeleteChannelInput, + DeleteChannelOutput, + DeleteDashboardInput, + DeleteDashboardOutput, + DeleteEventDataStoreInput, + DeleteEventDataStoreOutput, + DeleteResourcePolicyInput, + DeleteResourcePolicyOutput, + DeleteTrailInput, + DeleteTrailOutput, + DeregisterOrganizationDelegatedAdminInput, + DeregisterOrganizationDelegatedAdminOutput, + DescribeQueryInput, + DescribeQueryOutput, + DescribeTrailsInput, + DescribeTrailsOutput, + DisableFederationInput, + DisableFederationOutput, + EnableFederationInput, + EnableFederationOutput, + GenerateQueryInput, + GenerateQueryOutput, + GetChannelInput, + GetChannelOutput, + GetDashboardInput, + GetDashboardOutput, + GetEventConfigurationInput, + GetEventConfigurationOutput, + GetEventDataStoreInput, + GetEventDataStoreOutput, + GetEventSelectorsInput, + GetEventSelectorsOutput, + GetImportInput, + GetImportOutput, + GetInsightSelectorsInput, + GetInsightSelectorsOutput, + GetQueryResultsInput, + GetQueryResultsOutput, + GetResourcePolicyInput, + GetResourcePolicyOutput, + GetTrailInput, + GetTrailOutput, + GetTrailStatusInput, + GetTrailStatusOutput, + ListChannelsInput, + ListChannelsOutput, + ListDashboardsInput, + ListDashboardsOutput, + ListEventDataStoresInput, + ListEventDataStoresOutput, + ListImportFailuresInput, + ListImportFailuresOutput, + ListImportsInput, + ListImportsOutput, + ListInsightsDataInput, + ListInsightsDataOutput, + ListInsightsMetricDataInput, + ListInsightsMetricDataOutput, + ListPublicKeysInput, + ListPublicKeysOutput, + ListQueriesInput, + ListQueriesOutput, + ListTagsInput, + ListTagsOutput, + ListTrailsInput, + ListTrailsOutput, + LookupEventsInput, + LookupEventsOutput, + PutEventConfigurationInput, + PutEventConfigurationOutput, + PutEventSelectorsInput, + PutEventSelectorsOutput, + PutInsightSelectorsInput, + PutInsightSelectorsOutput, + PutResourcePolicyInput, + PutResourcePolicyOutput, + RegisterOrganizationDelegatedAdminInput, + RegisterOrganizationDelegatedAdminOutput, + RemoveTagsInput, + RemoveTagsOutput, + RestoreEventDataStoreInput, + RestoreEventDataStoreOutput, + SearchSampleQueriesInput, + SearchSampleQueriesOutput, + StartDashboardRefreshInput, + StartDashboardRefreshOutput, + StartEventDataStoreIngestionInput, + StartEventDataStoreIngestionOutput, + StartImportInput, + StartImportOutput, + StartLoggingInput, + StartLoggingOutput, + StartQueryInput, + StartQueryOutput, + StopEventDataStoreIngestionInput, + StopEventDataStoreIngestionOutput, + StopImportInput, + StopImportOutput, + StopLoggingInput, + StopLoggingOutput, + UpdateChannelInput, + UpdateChannelOutput, + UpdateDashboardInput, + UpdateDashboardOutput, + UpdateEventDataStoreInput, + UpdateEventDataStoreOutput, + UpdateTrailInput, + UpdateTrailOutput, + ) + logger = logging.getLogger(__name__) @@ -291,12 +299,12 @@ async def _post_setup(self, config: AsyncCloudTrailConfig) -> None: config_file = await config_context.parsed_profiles() if config_context.profile_source is ConfigSource.OVERRIDE: profile_name = config_context.profile_name - config.aws_credentials_identity_resolver = await IdentityChain.create( + config.aws_credentials_identity_resolver = await AsyncIdentityChain.create( AWSCredentialsIdentity, config_file=config_file, profile_name=profile_name, region_override=config.region, - http_client=cast(HTTPClient | None, config.transport), + http_client=cast(AsyncHTTPClient | None, config.transport), ) async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( @@ -305,7 +313,7 @@ async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( operation: APIOperation[I, O], default_plugins: list[Plugin], plugins: list[Plugin] | None, - ) -> tuple[RequestPipeline[Any, Any], ClientCall[I, O]]: + ) -> tuple[AsyncRequestPipeline[Any, Any], AsyncClientCall[I, O]]: if self._closed: raise RuntimeError( "Cannot invoke an operation on a client that has been closed." diff --git a/clients/aws-sdk-cloudtrail/src/aws_sdk_cloudtrail/config.py b/clients/aws-sdk-cloudtrail/src/aws_sdk_cloudtrail/config.py index 61501711..9f15008b 100644 --- a/clients/aws-sdk-cloudtrail/src/aws_sdk_cloudtrail/config.py +++ b/clients/aws-sdk-cloudtrail/src/aws_sdk_cloudtrail/config.py @@ -1,243 +1,266 @@ # Code generated by smithy-python-codegen DO NOT EDIT. from dataclasses import dataclass, field -from typing import Any, Callable, ClassVar, Self, TypeAlias, Union, Unpack +from typing import ( + Any, + Callable, + ClassVar, + Self, + TYPE_CHECKING, + TypeAlias, + Union, + Unpack, +) -from smithy_aws_core.aio.protocols import AwsJson11ClientProtocol -from smithy_aws_core.auth import SigV4AuthScheme -from smithy_aws_core.config import AwsConfigOverrides, FileSystem -from smithy_aws_core.config.aws_config import AsyncAwsConfig -from smithy_aws_core.config.resolvers import EndpointUriResolver -from smithy_aws_core.config.types import FieldSpec -from smithy_aws_core.endpoints.standard_regional import ( - StandardRegionalEndpointsResolver, +from smithy_aws_core.aio.auth.sigv4 import AsyncSigV4AuthScheme +from smithy_aws_core.aio.config import AsyncFileSystem +from smithy_aws_core.aio.config.aws_config import AsyncAwsConfig, AwsConfigOverrides +from smithy_aws_core.aio.config.resolvers import EndpointUriResolver +from smithy_aws_core.aio.endpoints.standard_regional import ( + AsyncStandardRegionalEndpointsResolver, ) +from smithy_aws_core.aio.protocols import AsyncAwsJson11ClientProtocol +from smithy_aws_core.config.types import FieldSpec from smithy_aws_core.identity import AWSCredentialsIdentity, AWSIdentityProperties -from smithy_core.aio.interfaces import ( - ClientProtocol, - EndpointResolver, - ProtocolConstructor, - ProtocolSettings, -) -from smithy_core.aio.interfaces.auth import AuthScheme -from smithy_core.aio.interfaces.identity import IdentityResolver -from smithy_core.interceptors import Interceptor +from smithy_core.aio.interfaces import AsyncClientProtocol, AsyncEndpointResolver +from smithy_core.aio.interfaces.auth import AsyncAuthScheme +from smithy_core.aio.interfaces.identity import AsyncIdentityResolver +from smithy_core.interfaces import ProtocolConstructor, ProtocolSettings from smithy_core.interfaces.auth import AuthSchemeResolver from smithy_core.shapes import ShapeID from smithy_http.aio.aiohttp import AIOHTTPClient +from ._private.schemas import CLOUD_TRAIL_20131101 from .auth import HTTPAuthSchemeResolver -from .models import ( - AddTagsInput, - AddTagsOutput, - CancelQueryInput, - CancelQueryOutput, - CreateChannelInput, - CreateChannelOutput, - CreateDashboardInput, - CreateDashboardOutput, - CreateEventDataStoreInput, - CreateEventDataStoreOutput, - CreateTrailInput, - CreateTrailOutput, - DeleteChannelInput, - DeleteChannelOutput, - DeleteDashboardInput, - DeleteDashboardOutput, - DeleteEventDataStoreInput, - DeleteEventDataStoreOutput, - DeleteResourcePolicyInput, - DeleteResourcePolicyOutput, - DeleteTrailInput, - DeleteTrailOutput, - DeregisterOrganizationDelegatedAdminInput, - DeregisterOrganizationDelegatedAdminOutput, - DescribeQueryInput, - DescribeQueryOutput, - DescribeTrailsInput, - DescribeTrailsOutput, - DisableFederationInput, - DisableFederationOutput, - EnableFederationInput, - EnableFederationOutput, - GenerateQueryInput, - GenerateQueryOutput, - GetChannelInput, - GetChannelOutput, - GetDashboardInput, - GetDashboardOutput, - GetEventConfigurationInput, - GetEventConfigurationOutput, - GetEventDataStoreInput, - GetEventDataStoreOutput, - GetEventSelectorsInput, - GetEventSelectorsOutput, - GetImportInput, - GetImportOutput, - GetInsightSelectorsInput, - GetInsightSelectorsOutput, - GetQueryResultsInput, - GetQueryResultsOutput, - GetResourcePolicyInput, - GetResourcePolicyOutput, - GetTrailInput, - GetTrailOutput, - GetTrailStatusInput, - GetTrailStatusOutput, - ListChannelsInput, - ListChannelsOutput, - ListDashboardsInput, - ListDashboardsOutput, - ListEventDataStoresInput, - ListEventDataStoresOutput, - ListImportFailuresInput, - ListImportFailuresOutput, - ListImportsInput, - ListImportsOutput, - ListInsightsDataInput, - ListInsightsDataOutput, - ListInsightsMetricDataInput, - ListInsightsMetricDataOutput, - ListPublicKeysInput, - ListPublicKeysOutput, - ListQueriesInput, - ListQueriesOutput, - ListTagsInput, - ListTagsOutput, - ListTrailsInput, - ListTrailsOutput, - LookupEventsInput, - LookupEventsOutput, - PutEventConfigurationInput, - PutEventConfigurationOutput, - PutEventSelectorsInput, - PutEventSelectorsOutput, - PutInsightSelectorsInput, - PutInsightSelectorsOutput, - PutResourcePolicyInput, - PutResourcePolicyOutput, - RegisterOrganizationDelegatedAdminInput, - RegisterOrganizationDelegatedAdminOutput, - RemoveTagsInput, - RemoveTagsOutput, - RestoreEventDataStoreInput, - RestoreEventDataStoreOutput, - SearchSampleQueriesInput, - SearchSampleQueriesOutput, - StartDashboardRefreshInput, - StartDashboardRefreshOutput, - StartEventDataStoreIngestionInput, - StartEventDataStoreIngestionOutput, - StartImportInput, - StartImportOutput, - StartLoggingInput, - StartLoggingOutput, - StartQueryInput, - StartQueryOutput, - StopEventDataStoreIngestionInput, - StopEventDataStoreIngestionOutput, - StopImportInput, - StopImportOutput, - StopLoggingInput, - StopLoggingOutput, - UpdateChannelInput, - UpdateChannelOutput, - UpdateDashboardInput, - UpdateDashboardOutput, - UpdateEventDataStoreInput, - UpdateEventDataStoreOutput, - UpdateTrailInput, - UpdateTrailOutput, -) -_ServiceInterceptor = Union[ - Interceptor[AddTagsInput, AddTagsOutput, Any, Any], - Interceptor[CancelQueryInput, CancelQueryOutput, Any, Any], - Interceptor[CreateChannelInput, CreateChannelOutput, Any, Any], - Interceptor[CreateDashboardInput, CreateDashboardOutput, Any, Any], - Interceptor[CreateEventDataStoreInput, CreateEventDataStoreOutput, Any, Any], - Interceptor[CreateTrailInput, CreateTrailOutput, Any, Any], - Interceptor[DeleteChannelInput, DeleteChannelOutput, Any, Any], - Interceptor[DeleteDashboardInput, DeleteDashboardOutput, Any, Any], - Interceptor[DeleteEventDataStoreInput, DeleteEventDataStoreOutput, Any, Any], - Interceptor[DeleteResourcePolicyInput, DeleteResourcePolicyOutput, Any, Any], - Interceptor[DeleteTrailInput, DeleteTrailOutput, Any, Any], - Interceptor[ +if TYPE_CHECKING: + from smithy_core.interceptors import Interceptor + from .models import ( + AddTagsInput, + AddTagsOutput, + CancelQueryInput, + CancelQueryOutput, + CreateChannelInput, + CreateChannelOutput, + CreateDashboardInput, + CreateDashboardOutput, + CreateEventDataStoreInput, + CreateEventDataStoreOutput, + CreateTrailInput, + CreateTrailOutput, + DeleteChannelInput, + DeleteChannelOutput, + DeleteDashboardInput, + DeleteDashboardOutput, + DeleteEventDataStoreInput, + DeleteEventDataStoreOutput, + DeleteResourcePolicyInput, + DeleteResourcePolicyOutput, + DeleteTrailInput, + DeleteTrailOutput, DeregisterOrganizationDelegatedAdminInput, DeregisterOrganizationDelegatedAdminOutput, - Any, - Any, - ], - Interceptor[DescribeQueryInput, DescribeQueryOutput, Any, Any], - Interceptor[DescribeTrailsInput, DescribeTrailsOutput, Any, Any], - Interceptor[DisableFederationInput, DisableFederationOutput, Any, Any], - Interceptor[EnableFederationInput, EnableFederationOutput, Any, Any], - Interceptor[GenerateQueryInput, GenerateQueryOutput, Any, Any], - Interceptor[GetChannelInput, GetChannelOutput, Any, Any], - Interceptor[GetDashboardInput, GetDashboardOutput, Any, Any], - Interceptor[GetEventConfigurationInput, GetEventConfigurationOutput, Any, Any], - Interceptor[GetEventDataStoreInput, GetEventDataStoreOutput, Any, Any], - Interceptor[GetEventSelectorsInput, GetEventSelectorsOutput, Any, Any], - Interceptor[GetImportInput, GetImportOutput, Any, Any], - Interceptor[GetInsightSelectorsInput, GetInsightSelectorsOutput, Any, Any], - Interceptor[GetQueryResultsInput, GetQueryResultsOutput, Any, Any], - Interceptor[GetResourcePolicyInput, GetResourcePolicyOutput, Any, Any], - Interceptor[GetTrailInput, GetTrailOutput, Any, Any], - Interceptor[GetTrailStatusInput, GetTrailStatusOutput, Any, Any], - Interceptor[ListChannelsInput, ListChannelsOutput, Any, Any], - Interceptor[ListDashboardsInput, ListDashboardsOutput, Any, Any], - Interceptor[ListEventDataStoresInput, ListEventDataStoresOutput, Any, Any], - Interceptor[ListImportFailuresInput, ListImportFailuresOutput, Any, Any], - Interceptor[ListImportsInput, ListImportsOutput, Any, Any], - Interceptor[ListInsightsDataInput, ListInsightsDataOutput, Any, Any], - Interceptor[ListInsightsMetricDataInput, ListInsightsMetricDataOutput, Any, Any], - Interceptor[ListPublicKeysInput, ListPublicKeysOutput, Any, Any], - Interceptor[ListQueriesInput, ListQueriesOutput, Any, Any], - Interceptor[ListTagsInput, ListTagsOutput, Any, Any], - Interceptor[ListTrailsInput, ListTrailsOutput, Any, Any], - Interceptor[LookupEventsInput, LookupEventsOutput, Any, Any], - Interceptor[PutEventConfigurationInput, PutEventConfigurationOutput, Any, Any], - Interceptor[PutEventSelectorsInput, PutEventSelectorsOutput, Any, Any], - Interceptor[PutInsightSelectorsInput, PutInsightSelectorsOutput, Any, Any], - Interceptor[PutResourcePolicyInput, PutResourcePolicyOutput, Any, Any], - Interceptor[ + DescribeQueryInput, + DescribeQueryOutput, + DescribeTrailsInput, + DescribeTrailsOutput, + DisableFederationInput, + DisableFederationOutput, + EnableFederationInput, + EnableFederationOutput, + GenerateQueryInput, + GenerateQueryOutput, + GetChannelInput, + GetChannelOutput, + GetDashboardInput, + GetDashboardOutput, + GetEventConfigurationInput, + GetEventConfigurationOutput, + GetEventDataStoreInput, + GetEventDataStoreOutput, + GetEventSelectorsInput, + GetEventSelectorsOutput, + GetImportInput, + GetImportOutput, + GetInsightSelectorsInput, + GetInsightSelectorsOutput, + GetQueryResultsInput, + GetQueryResultsOutput, + GetResourcePolicyInput, + GetResourcePolicyOutput, + GetTrailInput, + GetTrailOutput, + GetTrailStatusInput, + GetTrailStatusOutput, + ListChannelsInput, + ListChannelsOutput, + ListDashboardsInput, + ListDashboardsOutput, + ListEventDataStoresInput, + ListEventDataStoresOutput, + ListImportFailuresInput, + ListImportFailuresOutput, + ListImportsInput, + ListImportsOutput, + ListInsightsDataInput, + ListInsightsDataOutput, + ListInsightsMetricDataInput, + ListInsightsMetricDataOutput, + ListPublicKeysInput, + ListPublicKeysOutput, + ListQueriesInput, + ListQueriesOutput, + ListTagsInput, + ListTagsOutput, + ListTrailsInput, + ListTrailsOutput, + LookupEventsInput, + LookupEventsOutput, + PutEventConfigurationInput, + PutEventConfigurationOutput, + PutEventSelectorsInput, + PutEventSelectorsOutput, + PutInsightSelectorsInput, + PutInsightSelectorsOutput, + PutResourcePolicyInput, + PutResourcePolicyOutput, RegisterOrganizationDelegatedAdminInput, RegisterOrganizationDelegatedAdminOutput, - Any, - Any, - ], - Interceptor[RemoveTagsInput, RemoveTagsOutput, Any, Any], - Interceptor[RestoreEventDataStoreInput, RestoreEventDataStoreOutput, Any, Any], - Interceptor[SearchSampleQueriesInput, SearchSampleQueriesOutput, Any, Any], - Interceptor[StartDashboardRefreshInput, StartDashboardRefreshOutput, Any, Any], - Interceptor[ - StartEventDataStoreIngestionInput, StartEventDataStoreIngestionOutput, Any, Any - ], - Interceptor[StartImportInput, StartImportOutput, Any, Any], - Interceptor[StartLoggingInput, StartLoggingOutput, Any, Any], - Interceptor[StartQueryInput, StartQueryOutput, Any, Any], - Interceptor[ - StopEventDataStoreIngestionInput, StopEventDataStoreIngestionOutput, Any, Any - ], - Interceptor[StopImportInput, StopImportOutput, Any, Any], - Interceptor[StopLoggingInput, StopLoggingOutput, Any, Any], - Interceptor[UpdateChannelInput, UpdateChannelOutput, Any, Any], - Interceptor[UpdateDashboardInput, UpdateDashboardOutput, Any, Any], - Interceptor[UpdateEventDataStoreInput, UpdateEventDataStoreOutput, Any, Any], - Interceptor[UpdateTrailInput, UpdateTrailOutput, Any, Any], -] + RemoveTagsInput, + RemoveTagsOutput, + RestoreEventDataStoreInput, + RestoreEventDataStoreOutput, + SearchSampleQueriesInput, + SearchSampleQueriesOutput, + StartDashboardRefreshInput, + StartDashboardRefreshOutput, + StartEventDataStoreIngestionInput, + StartEventDataStoreIngestionOutput, + StartImportInput, + StartImportOutput, + StartLoggingInput, + StartLoggingOutput, + StartQueryInput, + StartQueryOutput, + StopEventDataStoreIngestionInput, + StopEventDataStoreIngestionOutput, + StopImportInput, + StopImportOutput, + StopLoggingInput, + StopLoggingOutput, + UpdateChannelInput, + UpdateChannelOutput, + UpdateDashboardInput, + UpdateDashboardOutput, + UpdateEventDataStoreInput, + UpdateEventDataStoreOutput, + UpdateTrailInput, + UpdateTrailOutput, + ) + + _ServiceInterceptor = Union[ + Interceptor[AddTagsInput, AddTagsOutput, Any, Any], + Interceptor[CancelQueryInput, CancelQueryOutput, Any, Any], + Interceptor[CreateChannelInput, CreateChannelOutput, Any, Any], + Interceptor[CreateDashboardInput, CreateDashboardOutput, Any, Any], + Interceptor[CreateEventDataStoreInput, CreateEventDataStoreOutput, Any, Any], + Interceptor[CreateTrailInput, CreateTrailOutput, Any, Any], + Interceptor[DeleteChannelInput, DeleteChannelOutput, Any, Any], + Interceptor[DeleteDashboardInput, DeleteDashboardOutput, Any, Any], + Interceptor[DeleteEventDataStoreInput, DeleteEventDataStoreOutput, Any, Any], + Interceptor[DeleteResourcePolicyInput, DeleteResourcePolicyOutput, Any, Any], + Interceptor[DeleteTrailInput, DeleteTrailOutput, Any, Any], + Interceptor[ + DeregisterOrganizationDelegatedAdminInput, + DeregisterOrganizationDelegatedAdminOutput, + Any, + Any, + ], + Interceptor[DescribeQueryInput, DescribeQueryOutput, Any, Any], + Interceptor[DescribeTrailsInput, DescribeTrailsOutput, Any, Any], + Interceptor[DisableFederationInput, DisableFederationOutput, Any, Any], + Interceptor[EnableFederationInput, EnableFederationOutput, Any, Any], + Interceptor[GenerateQueryInput, GenerateQueryOutput, Any, Any], + Interceptor[GetChannelInput, GetChannelOutput, Any, Any], + Interceptor[GetDashboardInput, GetDashboardOutput, Any, Any], + Interceptor[GetEventConfigurationInput, GetEventConfigurationOutput, Any, Any], + Interceptor[GetEventDataStoreInput, GetEventDataStoreOutput, Any, Any], + Interceptor[GetEventSelectorsInput, GetEventSelectorsOutput, Any, Any], + Interceptor[GetImportInput, GetImportOutput, Any, Any], + Interceptor[GetInsightSelectorsInput, GetInsightSelectorsOutput, Any, Any], + Interceptor[GetQueryResultsInput, GetQueryResultsOutput, Any, Any], + Interceptor[GetResourcePolicyInput, GetResourcePolicyOutput, Any, Any], + Interceptor[GetTrailInput, GetTrailOutput, Any, Any], + Interceptor[GetTrailStatusInput, GetTrailStatusOutput, Any, Any], + Interceptor[ListChannelsInput, ListChannelsOutput, Any, Any], + Interceptor[ListDashboardsInput, ListDashboardsOutput, Any, Any], + Interceptor[ListEventDataStoresInput, ListEventDataStoresOutput, Any, Any], + Interceptor[ListImportFailuresInput, ListImportFailuresOutput, Any, Any], + Interceptor[ListImportsInput, ListImportsOutput, Any, Any], + Interceptor[ListInsightsDataInput, ListInsightsDataOutput, Any, Any], + Interceptor[ + ListInsightsMetricDataInput, ListInsightsMetricDataOutput, Any, Any + ], + Interceptor[ListPublicKeysInput, ListPublicKeysOutput, Any, Any], + Interceptor[ListQueriesInput, ListQueriesOutput, Any, Any], + Interceptor[ListTagsInput, ListTagsOutput, Any, Any], + Interceptor[ListTrailsInput, ListTrailsOutput, Any, Any], + Interceptor[LookupEventsInput, LookupEventsOutput, Any, Any], + Interceptor[PutEventConfigurationInput, PutEventConfigurationOutput, Any, Any], + Interceptor[PutEventSelectorsInput, PutEventSelectorsOutput, Any, Any], + Interceptor[PutInsightSelectorsInput, PutInsightSelectorsOutput, Any, Any], + Interceptor[PutResourcePolicyInput, PutResourcePolicyOutput, Any, Any], + Interceptor[ + RegisterOrganizationDelegatedAdminInput, + RegisterOrganizationDelegatedAdminOutput, + Any, + Any, + ], + Interceptor[RemoveTagsInput, RemoveTagsOutput, Any, Any], + Interceptor[RestoreEventDataStoreInput, RestoreEventDataStoreOutput, Any, Any], + Interceptor[SearchSampleQueriesInput, SearchSampleQueriesOutput, Any, Any], + Interceptor[StartDashboardRefreshInput, StartDashboardRefreshOutput, Any, Any], + Interceptor[ + StartEventDataStoreIngestionInput, + StartEventDataStoreIngestionOutput, + Any, + Any, + ], + Interceptor[StartImportInput, StartImportOutput, Any, Any], + Interceptor[StartLoggingInput, StartLoggingOutput, Any, Any], + Interceptor[StartQueryInput, StartQueryOutput, Any, Any], + Interceptor[ + StopEventDataStoreIngestionInput, + StopEventDataStoreIngestionOutput, + Any, + Any, + ], + Interceptor[StopImportInput, StopImportOutput, Any, Any], + Interceptor[StopLoggingInput, StopLoggingOutput, Any, Any], + Interceptor[UpdateChannelInput, UpdateChannelOutput, Any, Any], + Interceptor[UpdateDashboardInput, UpdateDashboardOutput, Any, Any], + Interceptor[UpdateEventDataStoreInput, UpdateEventDataStoreOutput, Any, Any], + Interceptor[UpdateTrailInput, UpdateTrailOutput, Any, Any], + ] +else: + _ServiceInterceptor = Any + _PROTOCOL_SETTINGS = ProtocolSettings( - namespace="com.amazonaws.cloudtrail", service_target="CloudTrail_20131101" + namespace="com.amazonaws.cloudtrail", + service_target="CloudTrail_20131101", + service_schema=CLOUD_TRAIL_20131101, ) class _AsyncCloudTrailConfigOverrides(AwsConfigOverrides, total=False): - endpoint_resolver: EndpointResolver | None + endpoint_resolver: AsyncEndpointResolver | None protocol: ( - ClientProtocol[Any, Any] | ProtocolConstructor[ClientProtocol[Any, Any]] | None + AsyncClientProtocol[Any, Any] + | ProtocolConstructor[AsyncClientProtocol[Any, Any]] + | None ) - auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None + auth_schemes: dict[ShapeID, AsyncAuthScheme[Any, Any, Any, Any]] | None auth_scheme_resolver: AuthSchemeResolver | None @@ -245,17 +268,17 @@ class _AsyncCloudTrailConfigOverrides(AwsConfigOverrides, total=False): class AsyncCloudTrailConfig(AsyncAwsConfig): """CloudTrail configuration (async-resolved).""" - endpoint_resolver: EndpointResolver | None = None + endpoint_resolver: AsyncEndpointResolver | None = None """ The endpoint resolver used to resolve the final endpoint per-operation based on the configuration. """ - protocol: ClientProtocol[Any, Any] | None = None + protocol: AsyncClientProtocol[Any, Any] | None = None """ Pass a protocol class reference from smithy_aws_core.aio.protocols to - select the protocol, e.g. protocol=AwsJson10ClientProtocol. For custom - protocols a protocol instance may also be passed. + select the protocol, e.g. protocol=AsyncAwsJson10ClientProtocol. For + custom protocols a protocol instance may also be passed. """ interceptors: list[_ServiceInterceptor] = field(default_factory=lambda: []) @@ -264,7 +287,7 @@ class AsyncCloudTrailConfig(AsyncAwsConfig): execution of a request. """ - auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None = None + auth_schemes: dict[ShapeID, AsyncAuthScheme[Any, Any, Any, Any]] | None = None """A map of auth scheme ids to auth schemes.""" auth_scheme_resolver: AuthSchemeResolver | None = None @@ -274,7 +297,7 @@ class AsyncCloudTrailConfig(AsyncAwsConfig): """ aws_credentials_identity_resolver: ( - IdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None + AsyncIdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None ) = None """Resolves AWS Credentials. Required for operations that use Sigv4 Auth.""" @@ -315,24 +338,24 @@ class AsyncCloudTrailConfig(AsyncAwsConfig): default=None, resolver=EndpointUriResolver("cloudtrail") ), "endpoint_resolver": FieldSpec( - default_factory=lambda: StandardRegionalEndpointsResolver( + default_factory=lambda: AsyncStandardRegionalEndpointsResolver( endpoint_prefix="cloudtrail" ) ), "protocol": FieldSpec( - default_factory=lambda: AwsJson11ClientProtocol(_PROTOCOL_SETTINGS), + default_factory=lambda: AsyncAwsJson11ClientProtocol(_PROTOCOL_SETTINGS), converter=lambda p: p(_PROTOCOL_SETTINGS) if isinstance(p, type) else p, ), "auth_schemes": FieldSpec( default_factory=lambda: { - ShapeID("aws.auth#sigv4"): SigV4AuthScheme(service="cloudtrail") + ShapeID("aws.auth#sigv4"): AsyncSigV4AuthScheme(service="cloudtrail") } ), "auth_scheme_resolver": FieldSpec(default_factory=HTTPAuthSchemeResolver), "transport": FieldSpec(default_factory=lambda: AIOHTTPClient()), } - def set_auth_scheme(self, scheme: AuthScheme[Any, Any, Any, Any]) -> None: + def set_auth_scheme(self, scheme: AsyncAuthScheme[Any, Any, Any, Any]) -> None: """ Set an auth scheme implementation using its scheme ID. :param scheme: The auth scheme to add or replace. @@ -346,7 +369,7 @@ async def resolve( # pyright: ignore[reportIncompatibleMethodOverride] cls, *, profile: str | None = None, - fs: FileSystem | None = None, + fs: AsyncFileSystem | None = None, config_file_path: str | None = None, credentials_file_path: str | None = None, **overrides: Unpack[_AsyncCloudTrailConfigOverrides], diff --git a/clients/aws-sdk-cloudtrail/src/aws_sdk_cloudtrail/models.py b/clients/aws-sdk-cloudtrail/src/aws_sdk_cloudtrail/models.py index ae7aa154..cf8cbca2 100644 --- a/clients/aws-sdk-cloudtrail/src/aws_sdk_cloudtrail/models.py +++ b/clients/aws-sdk-cloudtrail/src/aws_sdk_cloudtrail/models.py @@ -1,326 +1,201 @@ # Code generated by smithy-python-codegen DO NOT EDIT. -from dataclasses import dataclass, field -from datetime import datetime -from enum import StrEnum -import logging -from typing import Any, Literal, Self +from __future__ import annotations -from smithy_core.deserializers import ShapeDeserializer -from smithy_core.documents import TypeRegistry +from ._private import schemas as _schemas +from smithy_core._dynamic_models import ModelRegistry from smithy_core.exceptions import ModeledError -from smithy_core.response import EMPTY_RESPONSE_METADATA, ResponseMetadata -from smithy_core.schemas import APIOperation, Schema -from smithy_core.serializers import ShapeSerializer +from smithy_core.schemas import APIOperation from smithy_core.shapes import ShapeID -from smithy_core.types import UnknownEnumMixin from ._private.schemas import ( - ACCESS_DENIED_EXCEPTION as _SCHEMA_ACCESS_DENIED_EXCEPTION, - ACCOUNT_HAS_ONGOING_IMPORT_EXCEPTION as _SCHEMA_ACCOUNT_HAS_ONGOING_IMPORT_EXCEPTION, - ACCOUNT_NOT_FOUND_EXCEPTION as _SCHEMA_ACCOUNT_NOT_FOUND_EXCEPTION, - ACCOUNT_NOT_REGISTERED_EXCEPTION as _SCHEMA_ACCOUNT_NOT_REGISTERED_EXCEPTION, - ACCOUNT_REGISTERED_EXCEPTION as _SCHEMA_ACCOUNT_REGISTERED_EXCEPTION, ADD_TAGS as _SCHEMA_ADD_TAGS, - ADD_TAGS_INPUT as _SCHEMA_ADD_TAGS_INPUT, - ADD_TAGS_OUTPUT as _SCHEMA_ADD_TAGS_OUTPUT, - ADVANCED_EVENT_SELECTOR as _SCHEMA_ADVANCED_EVENT_SELECTOR, - ADVANCED_FIELD_SELECTOR as _SCHEMA_ADVANCED_FIELD_SELECTOR, - AGGREGATION_CONFIGURATION as _SCHEMA_AGGREGATION_CONFIGURATION, CANCEL_QUERY as _SCHEMA_CANCEL_QUERY, - CANCEL_QUERY_INPUT as _SCHEMA_CANCEL_QUERY_INPUT, - CANCEL_QUERY_OUTPUT as _SCHEMA_CANCEL_QUERY_OUTPUT, - CANNOT_DELEGATE_MANAGEMENT_ACCOUNT_EXCEPTION as _SCHEMA_CANNOT_DELEGATE_MANAGEMENT_ACCOUNT_EXCEPTION, - CHANNEL as _SCHEMA_CHANNEL, - CHANNEL_ALREADY_EXISTS_EXCEPTION as _SCHEMA_CHANNEL_ALREADY_EXISTS_EXCEPTION, - CHANNEL_ARN_INVALID_EXCEPTION as _SCHEMA_CHANNEL_ARN_INVALID_EXCEPTION, - CHANNEL_EXISTS_FOR_EDS_EXCEPTION as _SCHEMA_CHANNEL_EXISTS_FOR_EDS_EXCEPTION, - CHANNEL_MAX_LIMIT_EXCEEDED_EXCEPTION as _SCHEMA_CHANNEL_MAX_LIMIT_EXCEEDED_EXCEPTION, - CHANNEL_NOT_FOUND_EXCEPTION as _SCHEMA_CHANNEL_NOT_FOUND_EXCEPTION, - CLOUD_TRAIL_ACCESS_NOT_ENABLED_EXCEPTION as _SCHEMA_CLOUD_TRAIL_ACCESS_NOT_ENABLED_EXCEPTION, - CLOUD_TRAIL_ARN_INVALID_EXCEPTION as _SCHEMA_CLOUD_TRAIL_ARN_INVALID_EXCEPTION, - CLOUD_TRAIL_INVALID_CLIENT_TOKEN_ID_EXCEPTION as _SCHEMA_CLOUD_TRAIL_INVALID_CLIENT_TOKEN_ID_EXCEPTION, - CLOUD_WATCH_LOGS_DELIVERY_UNAVAILABLE_EXCEPTION as _SCHEMA_CLOUD_WATCH_LOGS_DELIVERY_UNAVAILABLE_EXCEPTION, - CONCURRENT_MODIFICATION_EXCEPTION as _SCHEMA_CONCURRENT_MODIFICATION_EXCEPTION, - CONFLICT_EXCEPTION as _SCHEMA_CONFLICT_EXCEPTION, - CONTEXT_KEY_SELECTOR as _SCHEMA_CONTEXT_KEY_SELECTOR, CREATE_CHANNEL as _SCHEMA_CREATE_CHANNEL, - CREATE_CHANNEL_INPUT as _SCHEMA_CREATE_CHANNEL_INPUT, - CREATE_CHANNEL_OUTPUT as _SCHEMA_CREATE_CHANNEL_OUTPUT, CREATE_DASHBOARD as _SCHEMA_CREATE_DASHBOARD, - CREATE_DASHBOARD_INPUT as _SCHEMA_CREATE_DASHBOARD_INPUT, - CREATE_DASHBOARD_OUTPUT as _SCHEMA_CREATE_DASHBOARD_OUTPUT, CREATE_EVENT_DATA_STORE as _SCHEMA_CREATE_EVENT_DATA_STORE, - CREATE_EVENT_DATA_STORE_INPUT as _SCHEMA_CREATE_EVENT_DATA_STORE_INPUT, - CREATE_EVENT_DATA_STORE_OUTPUT as _SCHEMA_CREATE_EVENT_DATA_STORE_OUTPUT, CREATE_TRAIL as _SCHEMA_CREATE_TRAIL, - CREATE_TRAIL_INPUT as _SCHEMA_CREATE_TRAIL_INPUT, - CREATE_TRAIL_OUTPUT as _SCHEMA_CREATE_TRAIL_OUTPUT, - DASHBOARD_DETAIL as _SCHEMA_DASHBOARD_DETAIL, - DATA_RESOURCE as _SCHEMA_DATA_RESOURCE, - DELEGATED_ADMIN_ACCOUNT_LIMIT_EXCEEDED_EXCEPTION as _SCHEMA_DELEGATED_ADMIN_ACCOUNT_LIMIT_EXCEEDED_EXCEPTION, DELETE_CHANNEL as _SCHEMA_DELETE_CHANNEL, - DELETE_CHANNEL_INPUT as _SCHEMA_DELETE_CHANNEL_INPUT, - DELETE_CHANNEL_OUTPUT as _SCHEMA_DELETE_CHANNEL_OUTPUT, DELETE_DASHBOARD as _SCHEMA_DELETE_DASHBOARD, - DELETE_DASHBOARD_INPUT as _SCHEMA_DELETE_DASHBOARD_INPUT, - DELETE_DASHBOARD_OUTPUT as _SCHEMA_DELETE_DASHBOARD_OUTPUT, DELETE_EVENT_DATA_STORE as _SCHEMA_DELETE_EVENT_DATA_STORE, - DELETE_EVENT_DATA_STORE_INPUT as _SCHEMA_DELETE_EVENT_DATA_STORE_INPUT, - DELETE_EVENT_DATA_STORE_OUTPUT as _SCHEMA_DELETE_EVENT_DATA_STORE_OUTPUT, DELETE_RESOURCE_POLICY as _SCHEMA_DELETE_RESOURCE_POLICY, - DELETE_RESOURCE_POLICY_INPUT as _SCHEMA_DELETE_RESOURCE_POLICY_INPUT, - DELETE_RESOURCE_POLICY_OUTPUT as _SCHEMA_DELETE_RESOURCE_POLICY_OUTPUT, DELETE_TRAIL as _SCHEMA_DELETE_TRAIL, - DELETE_TRAIL_INPUT as _SCHEMA_DELETE_TRAIL_INPUT, - DELETE_TRAIL_OUTPUT as _SCHEMA_DELETE_TRAIL_OUTPUT, DEREGISTER_ORGANIZATION_DELEGATED_ADMIN as _SCHEMA_DEREGISTER_ORGANIZATION_DELEGATED_ADMIN, - DEREGISTER_ORGANIZATION_DELEGATED_ADMIN_INPUT as _SCHEMA_DEREGISTER_ORGANIZATION_DELEGATED_ADMIN_INPUT, - DEREGISTER_ORGANIZATION_DELEGATED_ADMIN_OUTPUT as _SCHEMA_DEREGISTER_ORGANIZATION_DELEGATED_ADMIN_OUTPUT, DESCRIBE_QUERY as _SCHEMA_DESCRIBE_QUERY, - DESCRIBE_QUERY_INPUT as _SCHEMA_DESCRIBE_QUERY_INPUT, - DESCRIBE_QUERY_OUTPUT as _SCHEMA_DESCRIBE_QUERY_OUTPUT, DESCRIBE_TRAILS as _SCHEMA_DESCRIBE_TRAILS, - DESCRIBE_TRAILS_INPUT as _SCHEMA_DESCRIBE_TRAILS_INPUT, - DESCRIBE_TRAILS_OUTPUT as _SCHEMA_DESCRIBE_TRAILS_OUTPUT, - DESTINATION as _SCHEMA_DESTINATION, DISABLE_FEDERATION as _SCHEMA_DISABLE_FEDERATION, - DISABLE_FEDERATION_INPUT as _SCHEMA_DISABLE_FEDERATION_INPUT, - DISABLE_FEDERATION_OUTPUT as _SCHEMA_DISABLE_FEDERATION_OUTPUT, ENABLE_FEDERATION as _SCHEMA_ENABLE_FEDERATION, - ENABLE_FEDERATION_INPUT as _SCHEMA_ENABLE_FEDERATION_INPUT, - ENABLE_FEDERATION_OUTPUT as _SCHEMA_ENABLE_FEDERATION_OUTPUT, - EVENT as _SCHEMA_EVENT, - EVENT_DATA_STORE as _SCHEMA_EVENT_DATA_STORE, - EVENT_DATA_STORE_ALREADY_EXISTS_EXCEPTION as _SCHEMA_EVENT_DATA_STORE_ALREADY_EXISTS_EXCEPTION, - EVENT_DATA_STORE_ARN_INVALID_EXCEPTION as _SCHEMA_EVENT_DATA_STORE_ARN_INVALID_EXCEPTION, - EVENT_DATA_STORE_FEDERATION_ENABLED_EXCEPTION as _SCHEMA_EVENT_DATA_STORE_FEDERATION_ENABLED_EXCEPTION, - EVENT_DATA_STORE_HAS_ONGOING_IMPORT_EXCEPTION as _SCHEMA_EVENT_DATA_STORE_HAS_ONGOING_IMPORT_EXCEPTION, - EVENT_DATA_STORE_MAX_LIMIT_EXCEEDED_EXCEPTION as _SCHEMA_EVENT_DATA_STORE_MAX_LIMIT_EXCEEDED_EXCEPTION, - EVENT_DATA_STORE_NOT_FOUND_EXCEPTION as _SCHEMA_EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, - EVENT_DATA_STORE_TERMINATION_PROTECTED_EXCEPTION as _SCHEMA_EVENT_DATA_STORE_TERMINATION_PROTECTED_EXCEPTION, - EVENT_SELECTOR as _SCHEMA_EVENT_SELECTOR, GENERATE_QUERY as _SCHEMA_GENERATE_QUERY, - GENERATE_QUERY_INPUT as _SCHEMA_GENERATE_QUERY_INPUT, - GENERATE_QUERY_OUTPUT as _SCHEMA_GENERATE_QUERY_OUTPUT, - GENERATE_RESPONSE_EXCEPTION as _SCHEMA_GENERATE_RESPONSE_EXCEPTION, GET_CHANNEL as _SCHEMA_GET_CHANNEL, - GET_CHANNEL_INPUT as _SCHEMA_GET_CHANNEL_INPUT, - GET_CHANNEL_OUTPUT as _SCHEMA_GET_CHANNEL_OUTPUT, GET_DASHBOARD as _SCHEMA_GET_DASHBOARD, - GET_DASHBOARD_INPUT as _SCHEMA_GET_DASHBOARD_INPUT, - GET_DASHBOARD_OUTPUT as _SCHEMA_GET_DASHBOARD_OUTPUT, GET_EVENT_CONFIGURATION as _SCHEMA_GET_EVENT_CONFIGURATION, - GET_EVENT_CONFIGURATION_INPUT as _SCHEMA_GET_EVENT_CONFIGURATION_INPUT, - GET_EVENT_CONFIGURATION_OUTPUT as _SCHEMA_GET_EVENT_CONFIGURATION_OUTPUT, GET_EVENT_DATA_STORE as _SCHEMA_GET_EVENT_DATA_STORE, - GET_EVENT_DATA_STORE_INPUT as _SCHEMA_GET_EVENT_DATA_STORE_INPUT, - GET_EVENT_DATA_STORE_OUTPUT as _SCHEMA_GET_EVENT_DATA_STORE_OUTPUT, GET_EVENT_SELECTORS as _SCHEMA_GET_EVENT_SELECTORS, - GET_EVENT_SELECTORS_INPUT as _SCHEMA_GET_EVENT_SELECTORS_INPUT, - GET_EVENT_SELECTORS_OUTPUT as _SCHEMA_GET_EVENT_SELECTORS_OUTPUT, GET_IMPORT as _SCHEMA_GET_IMPORT, - GET_IMPORT_INPUT as _SCHEMA_GET_IMPORT_INPUT, - GET_IMPORT_OUTPUT as _SCHEMA_GET_IMPORT_OUTPUT, GET_INSIGHT_SELECTORS as _SCHEMA_GET_INSIGHT_SELECTORS, - GET_INSIGHT_SELECTORS_INPUT as _SCHEMA_GET_INSIGHT_SELECTORS_INPUT, - GET_INSIGHT_SELECTORS_OUTPUT as _SCHEMA_GET_INSIGHT_SELECTORS_OUTPUT, GET_QUERY_RESULTS as _SCHEMA_GET_QUERY_RESULTS, - GET_QUERY_RESULTS_INPUT as _SCHEMA_GET_QUERY_RESULTS_INPUT, - GET_QUERY_RESULTS_OUTPUT as _SCHEMA_GET_QUERY_RESULTS_OUTPUT, GET_RESOURCE_POLICY as _SCHEMA_GET_RESOURCE_POLICY, - GET_RESOURCE_POLICY_INPUT as _SCHEMA_GET_RESOURCE_POLICY_INPUT, - GET_RESOURCE_POLICY_OUTPUT as _SCHEMA_GET_RESOURCE_POLICY_OUTPUT, GET_TRAIL as _SCHEMA_GET_TRAIL, - GET_TRAIL_INPUT as _SCHEMA_GET_TRAIL_INPUT, - GET_TRAIL_OUTPUT as _SCHEMA_GET_TRAIL_OUTPUT, GET_TRAIL_STATUS as _SCHEMA_GET_TRAIL_STATUS, - GET_TRAIL_STATUS_INPUT as _SCHEMA_GET_TRAIL_STATUS_INPUT, - GET_TRAIL_STATUS_OUTPUT as _SCHEMA_GET_TRAIL_STATUS_OUTPUT, - IMPORTS_LIST_ITEM as _SCHEMA_IMPORTS_LIST_ITEM, - IMPORT_FAILURE_LIST_ITEM as _SCHEMA_IMPORT_FAILURE_LIST_ITEM, - IMPORT_NOT_FOUND_EXCEPTION as _SCHEMA_IMPORT_NOT_FOUND_EXCEPTION, - IMPORT_SOURCE as _SCHEMA_IMPORT_SOURCE, - IMPORT_STATISTICS as _SCHEMA_IMPORT_STATISTICS, - INACTIVE_EVENT_DATA_STORE_EXCEPTION as _SCHEMA_INACTIVE_EVENT_DATA_STORE_EXCEPTION, - INACTIVE_QUERY_EXCEPTION as _SCHEMA_INACTIVE_QUERY_EXCEPTION, - INGESTION_STATUS as _SCHEMA_INGESTION_STATUS, - INSIGHT_NOT_ENABLED_EXCEPTION as _SCHEMA_INSIGHT_NOT_ENABLED_EXCEPTION, - INSIGHT_SELECTOR as _SCHEMA_INSIGHT_SELECTOR, - INSUFFICIENT_DEPENDENCY_SERVICE_ACCESS_PERMISSION_EXCEPTION as _SCHEMA_INSUFFICIENT_DEPENDENCY_SERVICE_ACCESS_PERMISSION_EXCEPTION, - INSUFFICIENT_ENCRYPTION_POLICY_EXCEPTION as _SCHEMA_INSUFFICIENT_ENCRYPTION_POLICY_EXCEPTION, - INSUFFICIENT_IAM_ACCESS_PERMISSION_EXCEPTION as _SCHEMA_INSUFFICIENT_IAM_ACCESS_PERMISSION_EXCEPTION, - INSUFFICIENT_S3_BUCKET_POLICY_EXCEPTION as _SCHEMA_INSUFFICIENT_S3_BUCKET_POLICY_EXCEPTION, - INSUFFICIENT_SNS_TOPIC_POLICY_EXCEPTION as _SCHEMA_INSUFFICIENT_SNS_TOPIC_POLICY_EXCEPTION, - INVALID_CLOUD_WATCH_LOGS_LOG_GROUP_ARN_EXCEPTION as _SCHEMA_INVALID_CLOUD_WATCH_LOGS_LOG_GROUP_ARN_EXCEPTION, - INVALID_CLOUD_WATCH_LOGS_ROLE_ARN_EXCEPTION as _SCHEMA_INVALID_CLOUD_WATCH_LOGS_ROLE_ARN_EXCEPTION, - INVALID_DATE_RANGE_EXCEPTION as _SCHEMA_INVALID_DATE_RANGE_EXCEPTION, - INVALID_EVENT_CATEGORY_EXCEPTION as _SCHEMA_INVALID_EVENT_CATEGORY_EXCEPTION, - INVALID_EVENT_DATA_STORE_CATEGORY_EXCEPTION as _SCHEMA_INVALID_EVENT_DATA_STORE_CATEGORY_EXCEPTION, - INVALID_EVENT_DATA_STORE_STATUS_EXCEPTION as _SCHEMA_INVALID_EVENT_DATA_STORE_STATUS_EXCEPTION, - INVALID_EVENT_SELECTORS_EXCEPTION as _SCHEMA_INVALID_EVENT_SELECTORS_EXCEPTION, - INVALID_HOME_REGION_EXCEPTION as _SCHEMA_INVALID_HOME_REGION_EXCEPTION, - INVALID_IMPORT_SOURCE_EXCEPTION as _SCHEMA_INVALID_IMPORT_SOURCE_EXCEPTION, - INVALID_INSIGHT_SELECTORS_EXCEPTION as _SCHEMA_INVALID_INSIGHT_SELECTORS_EXCEPTION, - INVALID_KMS_KEY_ID_EXCEPTION as _SCHEMA_INVALID_KMS_KEY_ID_EXCEPTION, - INVALID_LOOKUP_ATTRIBUTES_EXCEPTION as _SCHEMA_INVALID_LOOKUP_ATTRIBUTES_EXCEPTION, - INVALID_MAX_RESULTS_EXCEPTION as _SCHEMA_INVALID_MAX_RESULTS_EXCEPTION, - INVALID_NEXT_TOKEN_EXCEPTION as _SCHEMA_INVALID_NEXT_TOKEN_EXCEPTION, - INVALID_PARAMETER_COMBINATION_EXCEPTION as _SCHEMA_INVALID_PARAMETER_COMBINATION_EXCEPTION, - INVALID_PARAMETER_EXCEPTION as _SCHEMA_INVALID_PARAMETER_EXCEPTION, - INVALID_QUERY_STATEMENT_EXCEPTION as _SCHEMA_INVALID_QUERY_STATEMENT_EXCEPTION, - INVALID_QUERY_STATUS_EXCEPTION as _SCHEMA_INVALID_QUERY_STATUS_EXCEPTION, - INVALID_S3_BUCKET_NAME_EXCEPTION as _SCHEMA_INVALID_S3_BUCKET_NAME_EXCEPTION, - INVALID_S3_PREFIX_EXCEPTION as _SCHEMA_INVALID_S3_PREFIX_EXCEPTION, - INVALID_SNS_TOPIC_NAME_EXCEPTION as _SCHEMA_INVALID_SNS_TOPIC_NAME_EXCEPTION, - INVALID_SOURCE_EXCEPTION as _SCHEMA_INVALID_SOURCE_EXCEPTION, - INVALID_TAG_PARAMETER_EXCEPTION as _SCHEMA_INVALID_TAG_PARAMETER_EXCEPTION, - INVALID_TIME_RANGE_EXCEPTION as _SCHEMA_INVALID_TIME_RANGE_EXCEPTION, - INVALID_TOKEN_EXCEPTION as _SCHEMA_INVALID_TOKEN_EXCEPTION, - INVALID_TRAIL_NAME_EXCEPTION as _SCHEMA_INVALID_TRAIL_NAME_EXCEPTION, - KMS_EXCEPTION as _SCHEMA_KMS_EXCEPTION, - KMS_KEY_DISABLED_EXCEPTION as _SCHEMA_KMS_KEY_DISABLED_EXCEPTION, - KMS_KEY_NOT_FOUND_EXCEPTION as _SCHEMA_KMS_KEY_NOT_FOUND_EXCEPTION, LIST_CHANNELS as _SCHEMA_LIST_CHANNELS, - LIST_CHANNELS_INPUT as _SCHEMA_LIST_CHANNELS_INPUT, - LIST_CHANNELS_OUTPUT as _SCHEMA_LIST_CHANNELS_OUTPUT, LIST_DASHBOARDS as _SCHEMA_LIST_DASHBOARDS, - LIST_DASHBOARDS_INPUT as _SCHEMA_LIST_DASHBOARDS_INPUT, - LIST_DASHBOARDS_OUTPUT as _SCHEMA_LIST_DASHBOARDS_OUTPUT, LIST_EVENT_DATA_STORES as _SCHEMA_LIST_EVENT_DATA_STORES, - LIST_EVENT_DATA_STORES_INPUT as _SCHEMA_LIST_EVENT_DATA_STORES_INPUT, - LIST_EVENT_DATA_STORES_OUTPUT as _SCHEMA_LIST_EVENT_DATA_STORES_OUTPUT, LIST_IMPORTS as _SCHEMA_LIST_IMPORTS, - LIST_IMPORTS_INPUT as _SCHEMA_LIST_IMPORTS_INPUT, - LIST_IMPORTS_OUTPUT as _SCHEMA_LIST_IMPORTS_OUTPUT, LIST_IMPORT_FAILURES as _SCHEMA_LIST_IMPORT_FAILURES, - LIST_IMPORT_FAILURES_INPUT as _SCHEMA_LIST_IMPORT_FAILURES_INPUT, - LIST_IMPORT_FAILURES_OUTPUT as _SCHEMA_LIST_IMPORT_FAILURES_OUTPUT, LIST_INSIGHTS_DATA as _SCHEMA_LIST_INSIGHTS_DATA, - LIST_INSIGHTS_DATA_INPUT as _SCHEMA_LIST_INSIGHTS_DATA_INPUT, - LIST_INSIGHTS_DATA_OUTPUT as _SCHEMA_LIST_INSIGHTS_DATA_OUTPUT, LIST_INSIGHTS_METRIC_DATA as _SCHEMA_LIST_INSIGHTS_METRIC_DATA, - LIST_INSIGHTS_METRIC_DATA_INPUT as _SCHEMA_LIST_INSIGHTS_METRIC_DATA_INPUT, - LIST_INSIGHTS_METRIC_DATA_OUTPUT as _SCHEMA_LIST_INSIGHTS_METRIC_DATA_OUTPUT, LIST_PUBLIC_KEYS as _SCHEMA_LIST_PUBLIC_KEYS, - LIST_PUBLIC_KEYS_INPUT as _SCHEMA_LIST_PUBLIC_KEYS_INPUT, - LIST_PUBLIC_KEYS_OUTPUT as _SCHEMA_LIST_PUBLIC_KEYS_OUTPUT, LIST_QUERIES as _SCHEMA_LIST_QUERIES, - LIST_QUERIES_INPUT as _SCHEMA_LIST_QUERIES_INPUT, - LIST_QUERIES_OUTPUT as _SCHEMA_LIST_QUERIES_OUTPUT, LIST_TAGS as _SCHEMA_LIST_TAGS, - LIST_TAGS_INPUT as _SCHEMA_LIST_TAGS_INPUT, - LIST_TAGS_OUTPUT as _SCHEMA_LIST_TAGS_OUTPUT, LIST_TRAILS as _SCHEMA_LIST_TRAILS, - LIST_TRAILS_INPUT as _SCHEMA_LIST_TRAILS_INPUT, - LIST_TRAILS_OUTPUT as _SCHEMA_LIST_TRAILS_OUTPUT, - LOOKUP_ATTRIBUTE as _SCHEMA_LOOKUP_ATTRIBUTE, LOOKUP_EVENTS as _SCHEMA_LOOKUP_EVENTS, - LOOKUP_EVENTS_INPUT as _SCHEMA_LOOKUP_EVENTS_INPUT, - LOOKUP_EVENTS_OUTPUT as _SCHEMA_LOOKUP_EVENTS_OUTPUT, - MAXIMUM_NUMBER_OF_TRAILS_EXCEEDED_EXCEPTION as _SCHEMA_MAXIMUM_NUMBER_OF_TRAILS_EXCEEDED_EXCEPTION, - MAX_CONCURRENT_QUERIES_EXCEPTION as _SCHEMA_MAX_CONCURRENT_QUERIES_EXCEPTION, - NOT_ORGANIZATION_MANAGEMENT_ACCOUNT_EXCEPTION as _SCHEMA_NOT_ORGANIZATION_MANAGEMENT_ACCOUNT_EXCEPTION, - NOT_ORGANIZATION_MASTER_ACCOUNT_EXCEPTION as _SCHEMA_NOT_ORGANIZATION_MASTER_ACCOUNT_EXCEPTION, - NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION as _SCHEMA_NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, - OPERATION_NOT_PERMITTED_EXCEPTION as _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - ORGANIZATIONS_NOT_IN_USE_EXCEPTION as _SCHEMA_ORGANIZATIONS_NOT_IN_USE_EXCEPTION, - ORGANIZATION_NOT_IN_ALL_FEATURES_MODE_EXCEPTION as _SCHEMA_ORGANIZATION_NOT_IN_ALL_FEATURES_MODE_EXCEPTION, - PARTITION_KEY as _SCHEMA_PARTITION_KEY, - PUBLIC_KEY as _SCHEMA_PUBLIC_KEY, PUT_EVENT_CONFIGURATION as _SCHEMA_PUT_EVENT_CONFIGURATION, - PUT_EVENT_CONFIGURATION_INPUT as _SCHEMA_PUT_EVENT_CONFIGURATION_INPUT, - PUT_EVENT_CONFIGURATION_OUTPUT as _SCHEMA_PUT_EVENT_CONFIGURATION_OUTPUT, PUT_EVENT_SELECTORS as _SCHEMA_PUT_EVENT_SELECTORS, - PUT_EVENT_SELECTORS_INPUT as _SCHEMA_PUT_EVENT_SELECTORS_INPUT, - PUT_EVENT_SELECTORS_OUTPUT as _SCHEMA_PUT_EVENT_SELECTORS_OUTPUT, PUT_INSIGHT_SELECTORS as _SCHEMA_PUT_INSIGHT_SELECTORS, - PUT_INSIGHT_SELECTORS_INPUT as _SCHEMA_PUT_INSIGHT_SELECTORS_INPUT, - PUT_INSIGHT_SELECTORS_OUTPUT as _SCHEMA_PUT_INSIGHT_SELECTORS_OUTPUT, PUT_RESOURCE_POLICY as _SCHEMA_PUT_RESOURCE_POLICY, - PUT_RESOURCE_POLICY_INPUT as _SCHEMA_PUT_RESOURCE_POLICY_INPUT, - PUT_RESOURCE_POLICY_OUTPUT as _SCHEMA_PUT_RESOURCE_POLICY_OUTPUT, - QUERY as _SCHEMA_QUERY, - QUERY_ID_NOT_FOUND_EXCEPTION as _SCHEMA_QUERY_ID_NOT_FOUND_EXCEPTION, - QUERY_STATISTICS as _SCHEMA_QUERY_STATISTICS, - QUERY_STATISTICS_FOR_DESCRIBE_QUERY as _SCHEMA_QUERY_STATISTICS_FOR_DESCRIBE_QUERY, - REFRESH_SCHEDULE as _SCHEMA_REFRESH_SCHEDULE, - REFRESH_SCHEDULE_FREQUENCY as _SCHEMA_REFRESH_SCHEDULE_FREQUENCY, REGISTER_ORGANIZATION_DELEGATED_ADMIN as _SCHEMA_REGISTER_ORGANIZATION_DELEGATED_ADMIN, - REGISTER_ORGANIZATION_DELEGATED_ADMIN_INPUT as _SCHEMA_REGISTER_ORGANIZATION_DELEGATED_ADMIN_INPUT, - REGISTER_ORGANIZATION_DELEGATED_ADMIN_OUTPUT as _SCHEMA_REGISTER_ORGANIZATION_DELEGATED_ADMIN_OUTPUT, REMOVE_TAGS as _SCHEMA_REMOVE_TAGS, - REMOVE_TAGS_INPUT as _SCHEMA_REMOVE_TAGS_INPUT, - REMOVE_TAGS_OUTPUT as _SCHEMA_REMOVE_TAGS_OUTPUT, - REQUEST_WIDGET as _SCHEMA_REQUEST_WIDGET, - RESOURCE as _SCHEMA_RESOURCE, - RESOURCE_ARN_NOT_VALID_EXCEPTION as _SCHEMA_RESOURCE_ARN_NOT_VALID_EXCEPTION, - RESOURCE_NOT_FOUND_EXCEPTION as _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - RESOURCE_POLICY_NOT_FOUND_EXCEPTION as _SCHEMA_RESOURCE_POLICY_NOT_FOUND_EXCEPTION, - RESOURCE_POLICY_NOT_VALID_EXCEPTION as _SCHEMA_RESOURCE_POLICY_NOT_VALID_EXCEPTION, - RESOURCE_TAG as _SCHEMA_RESOURCE_TAG, - RESOURCE_TYPE_NOT_SUPPORTED_EXCEPTION as _SCHEMA_RESOURCE_TYPE_NOT_SUPPORTED_EXCEPTION, RESTORE_EVENT_DATA_STORE as _SCHEMA_RESTORE_EVENT_DATA_STORE, - RESTORE_EVENT_DATA_STORE_INPUT as _SCHEMA_RESTORE_EVENT_DATA_STORE_INPUT, - RESTORE_EVENT_DATA_STORE_OUTPUT as _SCHEMA_RESTORE_EVENT_DATA_STORE_OUTPUT, - S3_BUCKET_DOES_NOT_EXIST_EXCEPTION as _SCHEMA_S3_BUCKET_DOES_NOT_EXIST_EXCEPTION, - S3_IMPORT_SOURCE as _SCHEMA_S3_IMPORT_SOURCE, SEARCH_SAMPLE_QUERIES as _SCHEMA_SEARCH_SAMPLE_QUERIES, - SEARCH_SAMPLE_QUERIES_INPUT as _SCHEMA_SEARCH_SAMPLE_QUERIES_INPUT, - SEARCH_SAMPLE_QUERIES_OUTPUT as _SCHEMA_SEARCH_SAMPLE_QUERIES_OUTPUT, - SEARCH_SAMPLE_QUERIES_SEARCH_RESULT as _SCHEMA_SEARCH_SAMPLE_QUERIES_SEARCH_RESULT, - SERVICE_QUOTA_EXCEEDED_EXCEPTION as _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - SOURCE_CONFIG as _SCHEMA_SOURCE_CONFIG, START_DASHBOARD_REFRESH as _SCHEMA_START_DASHBOARD_REFRESH, - START_DASHBOARD_REFRESH_INPUT as _SCHEMA_START_DASHBOARD_REFRESH_INPUT, - START_DASHBOARD_REFRESH_OUTPUT as _SCHEMA_START_DASHBOARD_REFRESH_OUTPUT, START_EVENT_DATA_STORE_INGESTION as _SCHEMA_START_EVENT_DATA_STORE_INGESTION, - START_EVENT_DATA_STORE_INGESTION_INPUT as _SCHEMA_START_EVENT_DATA_STORE_INGESTION_INPUT, - START_EVENT_DATA_STORE_INGESTION_OUTPUT as _SCHEMA_START_EVENT_DATA_STORE_INGESTION_OUTPUT, START_IMPORT as _SCHEMA_START_IMPORT, - START_IMPORT_INPUT as _SCHEMA_START_IMPORT_INPUT, - START_IMPORT_OUTPUT as _SCHEMA_START_IMPORT_OUTPUT, START_LOGGING as _SCHEMA_START_LOGGING, - START_LOGGING_INPUT as _SCHEMA_START_LOGGING_INPUT, - START_LOGGING_OUTPUT as _SCHEMA_START_LOGGING_OUTPUT, START_QUERY as _SCHEMA_START_QUERY, - START_QUERY_INPUT as _SCHEMA_START_QUERY_INPUT, - START_QUERY_OUTPUT as _SCHEMA_START_QUERY_OUTPUT, STOP_EVENT_DATA_STORE_INGESTION as _SCHEMA_STOP_EVENT_DATA_STORE_INGESTION, - STOP_EVENT_DATA_STORE_INGESTION_INPUT as _SCHEMA_STOP_EVENT_DATA_STORE_INGESTION_INPUT, - STOP_EVENT_DATA_STORE_INGESTION_OUTPUT as _SCHEMA_STOP_EVENT_DATA_STORE_INGESTION_OUTPUT, STOP_IMPORT as _SCHEMA_STOP_IMPORT, - STOP_IMPORT_INPUT as _SCHEMA_STOP_IMPORT_INPUT, - STOP_IMPORT_OUTPUT as _SCHEMA_STOP_IMPORT_OUTPUT, STOP_LOGGING as _SCHEMA_STOP_LOGGING, - STOP_LOGGING_INPUT as _SCHEMA_STOP_LOGGING_INPUT, - STOP_LOGGING_OUTPUT as _SCHEMA_STOP_LOGGING_OUTPUT, - TAG as _SCHEMA_TAG, - TAGS_LIMIT_EXCEEDED_EXCEPTION as _SCHEMA_TAGS_LIMIT_EXCEEDED_EXCEPTION, - THROTTLING_EXCEPTION as _SCHEMA_THROTTLING_EXCEPTION, - TRAIL as _SCHEMA_TRAIL, - TRAIL_ALREADY_EXISTS_EXCEPTION as _SCHEMA_TRAIL_ALREADY_EXISTS_EXCEPTION, - TRAIL_INFO as _SCHEMA_TRAIL_INFO, - TRAIL_NOT_FOUND_EXCEPTION as _SCHEMA_TRAIL_NOT_FOUND_EXCEPTION, - TRAIL_NOT_PROVIDED_EXCEPTION as _SCHEMA_TRAIL_NOT_PROVIDED_EXCEPTION, - UNSUPPORTED_OPERATION_EXCEPTION as _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, UPDATE_CHANNEL as _SCHEMA_UPDATE_CHANNEL, - UPDATE_CHANNEL_INPUT as _SCHEMA_UPDATE_CHANNEL_INPUT, - UPDATE_CHANNEL_OUTPUT as _SCHEMA_UPDATE_CHANNEL_OUTPUT, UPDATE_DASHBOARD as _SCHEMA_UPDATE_DASHBOARD, - UPDATE_DASHBOARD_INPUT as _SCHEMA_UPDATE_DASHBOARD_INPUT, - UPDATE_DASHBOARD_OUTPUT as _SCHEMA_UPDATE_DASHBOARD_OUTPUT, UPDATE_EVENT_DATA_STORE as _SCHEMA_UPDATE_EVENT_DATA_STORE, - UPDATE_EVENT_DATA_STORE_INPUT as _SCHEMA_UPDATE_EVENT_DATA_STORE_INPUT, - UPDATE_EVENT_DATA_STORE_OUTPUT as _SCHEMA_UPDATE_EVENT_DATA_STORE_OUTPUT, UPDATE_TRAIL as _SCHEMA_UPDATE_TRAIL, - UPDATE_TRAIL_INPUT as _SCHEMA_UPDATE_TRAIL_INPUT, - UPDATE_TRAIL_OUTPUT as _SCHEMA_UPDATE_TRAIL_OUTPUT, - WIDGET as _SCHEMA_WIDGET, ) - -logger = logging.getLogger(__name__) +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .models import ( + AddTagsInput, + AddTagsOutput, + CancelQueryInput, + CancelQueryOutput, + CreateChannelInput, + CreateChannelOutput, + CreateDashboardInput, + CreateDashboardOutput, + CreateEventDataStoreInput, + CreateEventDataStoreOutput, + CreateTrailInput, + CreateTrailOutput, + DeleteChannelInput, + DeleteChannelOutput, + DeleteDashboardInput, + DeleteDashboardOutput, + DeleteEventDataStoreInput, + DeleteEventDataStoreOutput, + DeleteResourcePolicyInput, + DeleteResourcePolicyOutput, + DeleteTrailInput, + DeleteTrailOutput, + DeregisterOrganizationDelegatedAdminInput, + DeregisterOrganizationDelegatedAdminOutput, + DescribeQueryInput, + DescribeQueryOutput, + DescribeTrailsInput, + DescribeTrailsOutput, + DisableFederationInput, + DisableFederationOutput, + EnableFederationInput, + EnableFederationOutput, + GenerateQueryInput, + GenerateQueryOutput, + GetChannelInput, + GetChannelOutput, + GetDashboardInput, + GetDashboardOutput, + GetEventConfigurationInput, + GetEventConfigurationOutput, + GetEventDataStoreInput, + GetEventDataStoreOutput, + GetEventSelectorsInput, + GetEventSelectorsOutput, + GetImportInput, + GetImportOutput, + GetInsightSelectorsInput, + GetInsightSelectorsOutput, + GetQueryResultsInput, + GetQueryResultsOutput, + GetResourcePolicyInput, + GetResourcePolicyOutput, + GetTrailInput, + GetTrailOutput, + GetTrailStatusInput, + GetTrailStatusOutput, + ListChannelsInput, + ListChannelsOutput, + ListDashboardsInput, + ListDashboardsOutput, + ListEventDataStoresInput, + ListEventDataStoresOutput, + ListImportFailuresInput, + ListImportFailuresOutput, + ListImportsInput, + ListImportsOutput, + ListInsightsDataInput, + ListInsightsDataOutput, + ListInsightsMetricDataInput, + ListInsightsMetricDataOutput, + ListPublicKeysInput, + ListPublicKeysOutput, + ListQueriesInput, + ListQueriesOutput, + ListTagsInput, + ListTagsOutput, + ListTrailsInput, + ListTrailsOutput, + LookupEventsInput, + LookupEventsOutput, + PutEventConfigurationInput, + PutEventConfigurationOutput, + PutEventSelectorsInput, + PutEventSelectorsOutput, + PutInsightSelectorsInput, + PutInsightSelectorsOutput, + PutResourcePolicyInput, + PutResourcePolicyOutput, + RegisterOrganizationDelegatedAdminInput, + RegisterOrganizationDelegatedAdminOutput, + RemoveTagsInput, + RemoveTagsOutput, + RestoreEventDataStoreInput, + RestoreEventDataStoreOutput, + SearchSampleQueriesInput, + SearchSampleQueriesOutput, + StartDashboardRefreshInput, + StartDashboardRefreshOutput, + StartEventDataStoreIngestionInput, + StartEventDataStoreIngestionOutput, + StartImportInput, + StartImportOutput, + StartLoggingInput, + StartLoggingOutput, + StartQueryInput, + StartQueryOutput, + StopEventDataStoreIngestionInput, + StopEventDataStoreIngestionOutput, + StopImportInput, + StopImportOutput, + StopLoggingInput, + StopLoggingOutput, + UpdateChannelInput, + UpdateChannelOutput, + UpdateDashboardInput, + UpdateDashboardOutput, + UpdateEventDataStoreInput, + UpdateEventDataStoreOutput, + UpdateTrailInput, + UpdateTrailOutput, + ) class ServiceError(ModeledError): @@ -332,23213 +207,1714 @@ class ServiceError(ModeledError): """ -@dataclass(kw_only=True) -class AccessDeniedException(ServiceError): - """You do not have sufficient access to perform this action.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACCESS_DENIED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_ACCESS_DENIED_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_ACCESS_DENIED_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ACCESS_DENIED_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class AccountHasOngoingImportException(ServiceError): - """ - This exception is thrown when you start a new import and a previous - import is still in progress. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACCOUNT_HAS_ONGOING_IMPORT_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_ACCOUNT_HAS_ONGOING_IMPORT_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_ACCOUNT_HAS_ONGOING_IMPORT_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ACCOUNT_HAS_ONGOING_IMPORT_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class AccountNotFoundException(ServiceError): - """ - This exception is thrown when the specified account is not found or not - part of an organization. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACCOUNT_NOT_FOUND_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_ACCOUNT_NOT_FOUND_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_ACCOUNT_NOT_FOUND_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ACCOUNT_NOT_FOUND_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class AccountNotRegisteredException(ServiceError): - """ - This exception is thrown when the specified account is not registered as - the CloudTrail delegated administrator. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACCOUNT_NOT_REGISTERED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_ACCOUNT_NOT_REGISTERED_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_ACCOUNT_NOT_REGISTERED_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ACCOUNT_NOT_REGISTERED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class AccountRegisteredException(ServiceError): - """ - This exception is thrown when the account is already registered as the - CloudTrail delegated administrator. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACCOUNT_REGISTERED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_ACCOUNT_REGISTERED_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_ACCOUNT_REGISTERED_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ACCOUNT_REGISTERED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class Tag: - """ - A custom key-value pair associated with a resource such as a CloudTrail - trail, event data store, dashboard, or channel. - """ - - key: str - """ - The key in a key-value pair. The key must be must be no longer than 128 - Unicode characters. The key must be unique for the resource to which it - applies. - """ - - value: str | None = None - """ - The value in a key-value pair of a tag. The value must be no longer than - 256 Unicode characters. - """ +_registry = ModelRegistry( + _schemas, + renames={}, + index={ + "AccessDeniedException": "ACCESS_DENIED_EXCEPTION", + "AccountHasOngoingImportException": "ACCOUNT_HAS_ONGOING_IMPORT_EXCEPTION", + "AccountNotFoundException": "ACCOUNT_NOT_FOUND_EXCEPTION", + "AccountNotRegisteredException": "ACCOUNT_NOT_REGISTERED_EXCEPTION", + "AccountRegisteredException": "ACCOUNT_REGISTERED_EXCEPTION", + "AddTagsInput": "ADD_TAGS_INPUT", + "AddTagsOutput": "ADD_TAGS_OUTPUT", + "AdvancedEventSelector": "ADVANCED_EVENT_SELECTOR", + "AdvancedFieldSelector": "ADVANCED_FIELD_SELECTOR", + "AggregationConfiguration": "AGGREGATION_CONFIGURATION", + "BillingMode": "BILLING_MODE", + "CancelQueryInput": "CANCEL_QUERY_INPUT", + "CancelQueryOutput": "CANCEL_QUERY_OUTPUT", + "CannotDelegateManagementAccountException": "CANNOT_DELEGATE_MANAGEMENT_ACCOUNT_EXCEPTION", + "Channel": "CHANNEL", + "ChannelAlreadyExistsException": "CHANNEL_ALREADY_EXISTS_EXCEPTION", + "ChannelARNInvalidException": "CHANNEL_ARN_INVALID_EXCEPTION", + "ChannelExistsForEDSException": "CHANNEL_EXISTS_FOR_EDS_EXCEPTION", + "ChannelMaxLimitExceededException": "CHANNEL_MAX_LIMIT_EXCEEDED_EXCEPTION", + "ChannelNotFoundException": "CHANNEL_NOT_FOUND_EXCEPTION", + "CloudTrailAccessNotEnabledException": "CLOUD_TRAIL_ACCESS_NOT_ENABLED_EXCEPTION", + "CloudTrailARNInvalidException": "CLOUD_TRAIL_ARN_INVALID_EXCEPTION", + "CloudTrailInvalidClientTokenIdException": "CLOUD_TRAIL_INVALID_CLIENT_TOKEN_ID_EXCEPTION", + "CloudWatchLogsDeliveryUnavailableException": "CLOUD_WATCH_LOGS_DELIVERY_UNAVAILABLE_EXCEPTION", + "ConcurrentModificationException": "CONCURRENT_MODIFICATION_EXCEPTION", + "ConflictException": "CONFLICT_EXCEPTION", + "ContextKeySelector": "CONTEXT_KEY_SELECTOR", + "CreateChannelInput": "CREATE_CHANNEL_INPUT", + "CreateChannelOutput": "CREATE_CHANNEL_OUTPUT", + "CreateDashboardInput": "CREATE_DASHBOARD_INPUT", + "CreateDashboardOutput": "CREATE_DASHBOARD_OUTPUT", + "CreateEventDataStoreInput": "CREATE_EVENT_DATA_STORE_INPUT", + "CreateEventDataStoreOutput": "CREATE_EVENT_DATA_STORE_OUTPUT", + "CreateTrailInput": "CREATE_TRAIL_INPUT", + "CreateTrailOutput": "CREATE_TRAIL_OUTPUT", + "DashboardDetail": "DASHBOARD_DETAIL", + "DashboardStatus": "DASHBOARD_STATUS", + "DashboardType": "DASHBOARD_TYPE", + "DataResource": "DATA_RESOURCE", + "DelegatedAdminAccountLimitExceededException": "DELEGATED_ADMIN_ACCOUNT_LIMIT_EXCEEDED_EXCEPTION", + "DeleteChannelInput": "DELETE_CHANNEL_INPUT", + "DeleteChannelOutput": "DELETE_CHANNEL_OUTPUT", + "DeleteDashboardInput": "DELETE_DASHBOARD_INPUT", + "DeleteDashboardOutput": "DELETE_DASHBOARD_OUTPUT", + "DeleteEventDataStoreInput": "DELETE_EVENT_DATA_STORE_INPUT", + "DeleteEventDataStoreOutput": "DELETE_EVENT_DATA_STORE_OUTPUT", + "DeleteResourcePolicyInput": "DELETE_RESOURCE_POLICY_INPUT", + "DeleteResourcePolicyOutput": "DELETE_RESOURCE_POLICY_OUTPUT", + "DeleteTrailInput": "DELETE_TRAIL_INPUT", + "DeleteTrailOutput": "DELETE_TRAIL_OUTPUT", + "DeliveryStatus": "DELIVERY_STATUS", + "DeregisterOrganizationDelegatedAdminInput": "DEREGISTER_ORGANIZATION_DELEGATED_ADMIN_INPUT", + "DeregisterOrganizationDelegatedAdminOutput": "DEREGISTER_ORGANIZATION_DELEGATED_ADMIN_OUTPUT", + "DescribeQueryInput": "DESCRIBE_QUERY_INPUT", + "DescribeQueryOutput": "DESCRIBE_QUERY_OUTPUT", + "DescribeTrailsInput": "DESCRIBE_TRAILS_INPUT", + "DescribeTrailsOutput": "DESCRIBE_TRAILS_OUTPUT", + "Destination": "DESTINATION", + "DestinationType": "DESTINATION_TYPE", + "DisableFederationInput": "DISABLE_FEDERATION_INPUT", + "DisableFederationOutput": "DISABLE_FEDERATION_OUTPUT", + "EnableFederationInput": "ENABLE_FEDERATION_INPUT", + "EnableFederationOutput": "ENABLE_FEDERATION_OUTPUT", + "Event": "EVENT", + "EventCategory": "EVENT_CATEGORY", + "EventCategoryAggregation": "EVENT_CATEGORY_AGGREGATION", + "EventDataStore": "EVENT_DATA_STORE", + "EventDataStoreAlreadyExistsException": "EVENT_DATA_STORE_ALREADY_EXISTS_EXCEPTION", + "EventDataStoreARNInvalidException": "EVENT_DATA_STORE_ARN_INVALID_EXCEPTION", + "EventDataStoreFederationEnabledException": "EVENT_DATA_STORE_FEDERATION_ENABLED_EXCEPTION", + "EventDataStoreHasOngoingImportException": "EVENT_DATA_STORE_HAS_ONGOING_IMPORT_EXCEPTION", + "EventDataStoreMaxLimitExceededException": "EVENT_DATA_STORE_MAX_LIMIT_EXCEEDED_EXCEPTION", + "EventDataStoreNotFoundException": "EVENT_DATA_STORE_NOT_FOUND_EXCEPTION", + "EventDataStoreStatus": "EVENT_DATA_STORE_STATUS", + "EventDataStoreTerminationProtectedException": "EVENT_DATA_STORE_TERMINATION_PROTECTED_EXCEPTION", + "EventSelector": "EVENT_SELECTOR", + "FederationStatus": "FEDERATION_STATUS", + "GenerateQueryInput": "GENERATE_QUERY_INPUT", + "GenerateQueryOutput": "GENERATE_QUERY_OUTPUT", + "GenerateResponseException": "GENERATE_RESPONSE_EXCEPTION", + "GetChannelInput": "GET_CHANNEL_INPUT", + "GetChannelOutput": "GET_CHANNEL_OUTPUT", + "GetDashboardInput": "GET_DASHBOARD_INPUT", + "GetDashboardOutput": "GET_DASHBOARD_OUTPUT", + "GetEventConfigurationInput": "GET_EVENT_CONFIGURATION_INPUT", + "GetEventConfigurationOutput": "GET_EVENT_CONFIGURATION_OUTPUT", + "GetEventDataStoreInput": "GET_EVENT_DATA_STORE_INPUT", + "GetEventDataStoreOutput": "GET_EVENT_DATA_STORE_OUTPUT", + "GetEventSelectorsInput": "GET_EVENT_SELECTORS_INPUT", + "GetEventSelectorsOutput": "GET_EVENT_SELECTORS_OUTPUT", + "GetImportInput": "GET_IMPORT_INPUT", + "GetImportOutput": "GET_IMPORT_OUTPUT", + "GetInsightSelectorsInput": "GET_INSIGHT_SELECTORS_INPUT", + "GetInsightSelectorsOutput": "GET_INSIGHT_SELECTORS_OUTPUT", + "GetQueryResultsInput": "GET_QUERY_RESULTS_INPUT", + "GetQueryResultsOutput": "GET_QUERY_RESULTS_OUTPUT", + "GetResourcePolicyInput": "GET_RESOURCE_POLICY_INPUT", + "GetResourcePolicyOutput": "GET_RESOURCE_POLICY_OUTPUT", + "GetTrailInput": "GET_TRAIL_INPUT", + "GetTrailOutput": "GET_TRAIL_OUTPUT", + "GetTrailStatusInput": "GET_TRAIL_STATUS_INPUT", + "GetTrailStatusOutput": "GET_TRAIL_STATUS_OUTPUT", + "ImportFailureListItem": "IMPORT_FAILURE_LIST_ITEM", + "ImportFailureStatus": "IMPORT_FAILURE_STATUS", + "ImportNotFoundException": "IMPORT_NOT_FOUND_EXCEPTION", + "ImportsListItem": "IMPORTS_LIST_ITEM", + "ImportSource": "IMPORT_SOURCE", + "ImportStatistics": "IMPORT_STATISTICS", + "ImportStatus": "IMPORT_STATUS", + "InactiveEventDataStoreException": "INACTIVE_EVENT_DATA_STORE_EXCEPTION", + "InactiveQueryException": "INACTIVE_QUERY_EXCEPTION", + "IngestionStatus": "INGESTION_STATUS", + "InsightNotEnabledException": "INSIGHT_NOT_ENABLED_EXCEPTION", + "InsightSelector": "INSIGHT_SELECTOR", + "InsightsMetricDataType": "INSIGHTS_METRIC_DATA_TYPE", + "InsightType": "INSIGHT_TYPE", + "InsufficientDependencyServiceAccessPermissionException": "INSUFFICIENT_DEPENDENCY_SERVICE_ACCESS_PERMISSION_EXCEPTION", + "InsufficientEncryptionPolicyException": "INSUFFICIENT_ENCRYPTION_POLICY_EXCEPTION", + "InsufficientIAMAccessPermissionException": "INSUFFICIENT_IAM_ACCESS_PERMISSION_EXCEPTION", + "InsufficientS3BucketPolicyException": "INSUFFICIENT_S3_BUCKET_POLICY_EXCEPTION", + "InsufficientSnsTopicPolicyException": "INSUFFICIENT_SNS_TOPIC_POLICY_EXCEPTION", + "InvalidCloudWatchLogsLogGroupArnException": "INVALID_CLOUD_WATCH_LOGS_LOG_GROUP_ARN_EXCEPTION", + "InvalidCloudWatchLogsRoleArnException": "INVALID_CLOUD_WATCH_LOGS_ROLE_ARN_EXCEPTION", + "InvalidDateRangeException": "INVALID_DATE_RANGE_EXCEPTION", + "InvalidEventCategoryException": "INVALID_EVENT_CATEGORY_EXCEPTION", + "InvalidEventDataStoreCategoryException": "INVALID_EVENT_DATA_STORE_CATEGORY_EXCEPTION", + "InvalidEventDataStoreStatusException": "INVALID_EVENT_DATA_STORE_STATUS_EXCEPTION", + "InvalidEventSelectorsException": "INVALID_EVENT_SELECTORS_EXCEPTION", + "InvalidHomeRegionException": "INVALID_HOME_REGION_EXCEPTION", + "InvalidImportSourceException": "INVALID_IMPORT_SOURCE_EXCEPTION", + "InvalidInsightSelectorsException": "INVALID_INSIGHT_SELECTORS_EXCEPTION", + "InvalidKmsKeyIdException": "INVALID_KMS_KEY_ID_EXCEPTION", + "InvalidLookupAttributesException": "INVALID_LOOKUP_ATTRIBUTES_EXCEPTION", + "InvalidMaxResultsException": "INVALID_MAX_RESULTS_EXCEPTION", + "InvalidNextTokenException": "INVALID_NEXT_TOKEN_EXCEPTION", + "InvalidParameterCombinationException": "INVALID_PARAMETER_COMBINATION_EXCEPTION", + "InvalidParameterException": "INVALID_PARAMETER_EXCEPTION", + "InvalidQueryStatementException": "INVALID_QUERY_STATEMENT_EXCEPTION", + "InvalidQueryStatusException": "INVALID_QUERY_STATUS_EXCEPTION", + "InvalidS3BucketNameException": "INVALID_S3_BUCKET_NAME_EXCEPTION", + "InvalidS3PrefixException": "INVALID_S3_PREFIX_EXCEPTION", + "InvalidSnsTopicNameException": "INVALID_SNS_TOPIC_NAME_EXCEPTION", + "InvalidSourceException": "INVALID_SOURCE_EXCEPTION", + "InvalidTagParameterException": "INVALID_TAG_PARAMETER_EXCEPTION", + "InvalidTimeRangeException": "INVALID_TIME_RANGE_EXCEPTION", + "InvalidTokenException": "INVALID_TOKEN_EXCEPTION", + "InvalidTrailNameException": "INVALID_TRAIL_NAME_EXCEPTION", + "KmsException": "KMS_EXCEPTION", + "KmsKeyDisabledException": "KMS_KEY_DISABLED_EXCEPTION", + "KmsKeyNotFoundException": "KMS_KEY_NOT_FOUND_EXCEPTION", + "ListChannelsInput": "LIST_CHANNELS_INPUT", + "ListChannelsOutput": "LIST_CHANNELS_OUTPUT", + "ListDashboardsInput": "LIST_DASHBOARDS_INPUT", + "ListDashboardsOutput": "LIST_DASHBOARDS_OUTPUT", + "ListEventDataStoresInput": "LIST_EVENT_DATA_STORES_INPUT", + "ListEventDataStoresOutput": "LIST_EVENT_DATA_STORES_OUTPUT", + "ListImportFailuresInput": "LIST_IMPORT_FAILURES_INPUT", + "ListImportFailuresOutput": "LIST_IMPORT_FAILURES_OUTPUT", + "ListImportsInput": "LIST_IMPORTS_INPUT", + "ListImportsOutput": "LIST_IMPORTS_OUTPUT", + "ListInsightsDataDimensionKey": "LIST_INSIGHTS_DATA_DIMENSION_KEY", + "ListInsightsDataInput": "LIST_INSIGHTS_DATA_INPUT", + "ListInsightsDataOutput": "LIST_INSIGHTS_DATA_OUTPUT", + "ListInsightsDataType": "LIST_INSIGHTS_DATA_TYPE", + "ListInsightsMetricDataInput": "LIST_INSIGHTS_METRIC_DATA_INPUT", + "ListInsightsMetricDataOutput": "LIST_INSIGHTS_METRIC_DATA_OUTPUT", + "ListPublicKeysInput": "LIST_PUBLIC_KEYS_INPUT", + "ListPublicKeysOutput": "LIST_PUBLIC_KEYS_OUTPUT", + "ListQueriesInput": "LIST_QUERIES_INPUT", + "ListQueriesOutput": "LIST_QUERIES_OUTPUT", + "ListTagsInput": "LIST_TAGS_INPUT", + "ListTagsOutput": "LIST_TAGS_OUTPUT", + "ListTrailsInput": "LIST_TRAILS_INPUT", + "ListTrailsOutput": "LIST_TRAILS_OUTPUT", + "LookupAttribute": "LOOKUP_ATTRIBUTE", + "LookupAttributeKey": "LOOKUP_ATTRIBUTE_KEY", + "LookupEventsInput": "LOOKUP_EVENTS_INPUT", + "LookupEventsOutput": "LOOKUP_EVENTS_OUTPUT", + "MaxConcurrentQueriesException": "MAX_CONCURRENT_QUERIES_EXCEPTION", + "MaxEventSize": "MAX_EVENT_SIZE", + "MaximumNumberOfTrailsExceededException": "MAXIMUM_NUMBER_OF_TRAILS_EXCEEDED_EXCEPTION", + "NoManagementAccountSLRExistsException": "NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION", + "NotOrganizationManagementAccountException": "NOT_ORGANIZATION_MANAGEMENT_ACCOUNT_EXCEPTION", + "NotOrganizationMasterAccountException": "NOT_ORGANIZATION_MASTER_ACCOUNT_EXCEPTION", + "OperationNotPermittedException": "OPERATION_NOT_PERMITTED_EXCEPTION", + "OrganizationNotInAllFeaturesModeException": "ORGANIZATION_NOT_IN_ALL_FEATURES_MODE_EXCEPTION", + "OrganizationsNotInUseException": "ORGANIZATIONS_NOT_IN_USE_EXCEPTION", + "PartitionKey": "PARTITION_KEY", + "PublicKey": "PUBLIC_KEY", + "PutEventConfigurationInput": "PUT_EVENT_CONFIGURATION_INPUT", + "PutEventConfigurationOutput": "PUT_EVENT_CONFIGURATION_OUTPUT", + "PutEventSelectorsInput": "PUT_EVENT_SELECTORS_INPUT", + "PutEventSelectorsOutput": "PUT_EVENT_SELECTORS_OUTPUT", + "PutInsightSelectorsInput": "PUT_INSIGHT_SELECTORS_INPUT", + "PutInsightSelectorsOutput": "PUT_INSIGHT_SELECTORS_OUTPUT", + "PutResourcePolicyInput": "PUT_RESOURCE_POLICY_INPUT", + "PutResourcePolicyOutput": "PUT_RESOURCE_POLICY_OUTPUT", + "Query": "QUERY", + "QueryIdNotFoundException": "QUERY_ID_NOT_FOUND_EXCEPTION", + "QueryStatistics": "QUERY_STATISTICS", + "QueryStatisticsForDescribeQuery": "QUERY_STATISTICS_FOR_DESCRIBE_QUERY", + "QueryStatus": "QUERY_STATUS", + "ReadWriteType": "READ_WRITE_TYPE", + "RefreshSchedule": "REFRESH_SCHEDULE", + "RefreshScheduleFrequency": "REFRESH_SCHEDULE_FREQUENCY", + "RefreshScheduleFrequencyUnit": "REFRESH_SCHEDULE_FREQUENCY_UNIT", + "RefreshScheduleStatus": "REFRESH_SCHEDULE_STATUS", + "RegisterOrganizationDelegatedAdminInput": "REGISTER_ORGANIZATION_DELEGATED_ADMIN_INPUT", + "RegisterOrganizationDelegatedAdminOutput": "REGISTER_ORGANIZATION_DELEGATED_ADMIN_OUTPUT", + "RemoveTagsInput": "REMOVE_TAGS_INPUT", + "RemoveTagsOutput": "REMOVE_TAGS_OUTPUT", + "RequestWidget": "REQUEST_WIDGET", + "Resource": "RESOURCE", + "ResourceARNNotValidException": "RESOURCE_ARN_NOT_VALID_EXCEPTION", + "ResourceNotFoundException": "RESOURCE_NOT_FOUND_EXCEPTION", + "ResourcePolicyNotFoundException": "RESOURCE_POLICY_NOT_FOUND_EXCEPTION", + "ResourcePolicyNotValidException": "RESOURCE_POLICY_NOT_VALID_EXCEPTION", + "ResourceTag": "RESOURCE_TAG", + "ResourceTypeNotSupportedException": "RESOURCE_TYPE_NOT_SUPPORTED_EXCEPTION", + "RestoreEventDataStoreInput": "RESTORE_EVENT_DATA_STORE_INPUT", + "RestoreEventDataStoreOutput": "RESTORE_EVENT_DATA_STORE_OUTPUT", + "S3BucketDoesNotExistException": "S3_BUCKET_DOES_NOT_EXIST_EXCEPTION", + "S3ImportSource": "S3_IMPORT_SOURCE", + "SearchSampleQueriesInput": "SEARCH_SAMPLE_QUERIES_INPUT", + "SearchSampleQueriesOutput": "SEARCH_SAMPLE_QUERIES_OUTPUT", + "SearchSampleQueriesSearchResult": "SEARCH_SAMPLE_QUERIES_SEARCH_RESULT", + "ServiceQuotaExceededException": "SERVICE_QUOTA_EXCEEDED_EXCEPTION", + "SourceConfig": "SOURCE_CONFIG", + "SourceEventCategory": "SOURCE_EVENT_CATEGORY", + "StartDashboardRefreshInput": "START_DASHBOARD_REFRESH_INPUT", + "StartDashboardRefreshOutput": "START_DASHBOARD_REFRESH_OUTPUT", + "StartEventDataStoreIngestionInput": "START_EVENT_DATA_STORE_INGESTION_INPUT", + "StartEventDataStoreIngestionOutput": "START_EVENT_DATA_STORE_INGESTION_OUTPUT", + "StartImportInput": "START_IMPORT_INPUT", + "StartImportOutput": "START_IMPORT_OUTPUT", + "StartLoggingInput": "START_LOGGING_INPUT", + "StartLoggingOutput": "START_LOGGING_OUTPUT", + "StartQueryInput": "START_QUERY_INPUT", + "StartQueryOutput": "START_QUERY_OUTPUT", + "StopEventDataStoreIngestionInput": "STOP_EVENT_DATA_STORE_INGESTION_INPUT", + "StopEventDataStoreIngestionOutput": "STOP_EVENT_DATA_STORE_INGESTION_OUTPUT", + "StopImportInput": "STOP_IMPORT_INPUT", + "StopImportOutput": "STOP_IMPORT_OUTPUT", + "StopLoggingInput": "STOP_LOGGING_INPUT", + "StopLoggingOutput": "STOP_LOGGING_OUTPUT", + "Tag": "TAG", + "TagsLimitExceededException": "TAGS_LIMIT_EXCEEDED_EXCEPTION", + "Template": "TEMPLATE", + "ThrottlingException": "THROTTLING_EXCEPTION", + "Trail": "TRAIL", + "TrailAlreadyExistsException": "TRAIL_ALREADY_EXISTS_EXCEPTION", + "TrailInfo": "TRAIL_INFO", + "TrailNotFoundException": "TRAIL_NOT_FOUND_EXCEPTION", + "TrailNotProvidedException": "TRAIL_NOT_PROVIDED_EXCEPTION", + "Type": "TYPE", + "UnsupportedOperationException": "UNSUPPORTED_OPERATION_EXCEPTION", + "UpdateChannelInput": "UPDATE_CHANNEL_INPUT", + "UpdateChannelOutput": "UPDATE_CHANNEL_OUTPUT", + "UpdateDashboardInput": "UPDATE_DASHBOARD_INPUT", + "UpdateDashboardOutput": "UPDATE_DASHBOARD_OUTPUT", + "UpdateEventDataStoreInput": "UPDATE_EVENT_DATA_STORE_INPUT", + "UpdateEventDataStoreOutput": "UPDATE_EVENT_DATA_STORE_OUTPUT", + "UpdateTrailInput": "UPDATE_TRAIL_INPUT", + "UpdateTrailOutput": "UPDATE_TRAIL_OUTPUT", + "Widget": "WIDGET", + }, + shape_names=frozenset( + { + "AccessDeniedException", + "AccountHasOngoingImportException", + "AccountNotFoundException", + "AccountNotRegisteredException", + "AccountRegisteredException", + "AddTagsInput", + "AddTagsOutput", + "AdvancedEventSelector", + "AdvancedFieldSelector", + "AggregationConfiguration", + "BillingMode", + "CancelQueryInput", + "CancelQueryOutput", + "CannotDelegateManagementAccountException", + "Channel", + "ChannelARNInvalidException", + "ChannelAlreadyExistsException", + "ChannelExistsForEDSException", + "ChannelMaxLimitExceededException", + "ChannelNotFoundException", + "CloudTrailARNInvalidException", + "CloudTrailAccessNotEnabledException", + "CloudTrailInvalidClientTokenIdException", + "CloudWatchLogsDeliveryUnavailableException", + "ConcurrentModificationException", + "ConflictException", + "ContextKeySelector", + "CreateChannelInput", + "CreateChannelOutput", + "CreateDashboardInput", + "CreateDashboardOutput", + "CreateEventDataStoreInput", + "CreateEventDataStoreOutput", + "CreateTrailInput", + "CreateTrailOutput", + "DashboardDetail", + "DashboardStatus", + "DashboardType", + "DataResource", + "DelegatedAdminAccountLimitExceededException", + "DeleteChannelInput", + "DeleteChannelOutput", + "DeleteDashboardInput", + "DeleteDashboardOutput", + "DeleteEventDataStoreInput", + "DeleteEventDataStoreOutput", + "DeleteResourcePolicyInput", + "DeleteResourcePolicyOutput", + "DeleteTrailInput", + "DeleteTrailOutput", + "DeliveryStatus", + "DeregisterOrganizationDelegatedAdminInput", + "DeregisterOrganizationDelegatedAdminOutput", + "DescribeQueryInput", + "DescribeQueryOutput", + "DescribeTrailsInput", + "DescribeTrailsOutput", + "Destination", + "DestinationType", + "DisableFederationInput", + "DisableFederationOutput", + "EnableFederationInput", + "EnableFederationOutput", + "Event", + "EventCategory", + "EventCategoryAggregation", + "EventDataStore", + "EventDataStoreARNInvalidException", + "EventDataStoreAlreadyExistsException", + "EventDataStoreFederationEnabledException", + "EventDataStoreHasOngoingImportException", + "EventDataStoreMaxLimitExceededException", + "EventDataStoreNotFoundException", + "EventDataStoreStatus", + "EventDataStoreTerminationProtectedException", + "EventSelector", + "FederationStatus", + "GenerateQueryInput", + "GenerateQueryOutput", + "GenerateResponseException", + "GetChannelInput", + "GetChannelOutput", + "GetDashboardInput", + "GetDashboardOutput", + "GetEventConfigurationInput", + "GetEventConfigurationOutput", + "GetEventDataStoreInput", + "GetEventDataStoreOutput", + "GetEventSelectorsInput", + "GetEventSelectorsOutput", + "GetImportInput", + "GetImportOutput", + "GetInsightSelectorsInput", + "GetInsightSelectorsOutput", + "GetQueryResultsInput", + "GetQueryResultsOutput", + "GetResourcePolicyInput", + "GetResourcePolicyOutput", + "GetTrailInput", + "GetTrailOutput", + "GetTrailStatusInput", + "GetTrailStatusOutput", + "ImportFailureListItem", + "ImportFailureStatus", + "ImportNotFoundException", + "ImportSource", + "ImportStatistics", + "ImportStatus", + "ImportsListItem", + "InactiveEventDataStoreException", + "InactiveQueryException", + "IngestionStatus", + "InsightNotEnabledException", + "InsightSelector", + "InsightType", + "InsightsMetricDataType", + "InsufficientDependencyServiceAccessPermissionException", + "InsufficientEncryptionPolicyException", + "InsufficientIAMAccessPermissionException", + "InsufficientS3BucketPolicyException", + "InsufficientSnsTopicPolicyException", + "InvalidCloudWatchLogsLogGroupArnException", + "InvalidCloudWatchLogsRoleArnException", + "InvalidDateRangeException", + "InvalidEventCategoryException", + "InvalidEventDataStoreCategoryException", + "InvalidEventDataStoreStatusException", + "InvalidEventSelectorsException", + "InvalidHomeRegionException", + "InvalidImportSourceException", + "InvalidInsightSelectorsException", + "InvalidKmsKeyIdException", + "InvalidLookupAttributesException", + "InvalidMaxResultsException", + "InvalidNextTokenException", + "InvalidParameterCombinationException", + "InvalidParameterException", + "InvalidQueryStatementException", + "InvalidQueryStatusException", + "InvalidS3BucketNameException", + "InvalidS3PrefixException", + "InvalidSnsTopicNameException", + "InvalidSourceException", + "InvalidTagParameterException", + "InvalidTimeRangeException", + "InvalidTokenException", + "InvalidTrailNameException", + "KmsException", + "KmsKeyDisabledException", + "KmsKeyNotFoundException", + "ListChannelsInput", + "ListChannelsOutput", + "ListDashboardsInput", + "ListDashboardsOutput", + "ListEventDataStoresInput", + "ListEventDataStoresOutput", + "ListImportFailuresInput", + "ListImportFailuresOutput", + "ListImportsInput", + "ListImportsOutput", + "ListInsightsDataDimensionKey", + "ListInsightsDataInput", + "ListInsightsDataOutput", + "ListInsightsDataType", + "ListInsightsMetricDataInput", + "ListInsightsMetricDataOutput", + "ListPublicKeysInput", + "ListPublicKeysOutput", + "ListQueriesInput", + "ListQueriesOutput", + "ListTagsInput", + "ListTagsOutput", + "ListTrailsInput", + "ListTrailsOutput", + "LookupAttribute", + "LookupAttributeKey", + "LookupEventsInput", + "LookupEventsOutput", + "MaxConcurrentQueriesException", + "MaxEventSize", + "MaximumNumberOfTrailsExceededException", + "NoManagementAccountSLRExistsException", + "NotOrganizationManagementAccountException", + "NotOrganizationMasterAccountException", + "OperationNotPermittedException", + "OrganizationNotInAllFeaturesModeException", + "OrganizationsNotInUseException", + "PartitionKey", + "PublicKey", + "PutEventConfigurationInput", + "PutEventConfigurationOutput", + "PutEventSelectorsInput", + "PutEventSelectorsOutput", + "PutInsightSelectorsInput", + "PutInsightSelectorsOutput", + "PutResourcePolicyInput", + "PutResourcePolicyOutput", + "Query", + "QueryIdNotFoundException", + "QueryStatistics", + "QueryStatisticsForDescribeQuery", + "QueryStatus", + "ReadWriteType", + "RefreshSchedule", + "RefreshScheduleFrequency", + "RefreshScheduleFrequencyUnit", + "RefreshScheduleStatus", + "RegisterOrganizationDelegatedAdminInput", + "RegisterOrganizationDelegatedAdminOutput", + "RemoveTagsInput", + "RemoveTagsOutput", + "RequestWidget", + "Resource", + "ResourceARNNotValidException", + "ResourceNotFoundException", + "ResourcePolicyNotFoundException", + "ResourcePolicyNotValidException", + "ResourceTag", + "ResourceTypeNotSupportedException", + "RestoreEventDataStoreInput", + "RestoreEventDataStoreOutput", + "S3BucketDoesNotExistException", + "S3ImportSource", + "SearchSampleQueriesInput", + "SearchSampleQueriesOutput", + "SearchSampleQueriesSearchResult", + "ServiceQuotaExceededException", + "SourceConfig", + "SourceEventCategory", + "StartDashboardRefreshInput", + "StartDashboardRefreshOutput", + "StartEventDataStoreIngestionInput", + "StartEventDataStoreIngestionOutput", + "StartImportInput", + "StartImportOutput", + "StartLoggingInput", + "StartLoggingOutput", + "StartQueryInput", + "StartQueryOutput", + "StopEventDataStoreIngestionInput", + "StopEventDataStoreIngestionOutput", + "StopImportInput", + "StopImportOutput", + "StopLoggingInput", + "StopLoggingOutput", + "Tag", + "TagsLimitExceededException", + "Template", + "ThrottlingException", + "Trail", + "TrailAlreadyExistsException", + "TrailInfo", + "TrailNotFoundException", + "TrailNotProvidedException", + "Type", + "UnsupportedOperationException", + "UpdateChannelInput", + "UpdateChannelOutput", + "UpdateDashboardInput", + "UpdateDashboardOutput", + "UpdateEventDataStoreInput", + "UpdateEventDataStoreOutput", + "UpdateTrailInput", + "UpdateTrailOutput", + "Widget", + } + ), + service_error="ServiceError", +) - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TAG, self) - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_TAG.members["Key"], self.key) - if self.value is not None: - serializer.write_string(_SCHEMA_TAG.members["Value"], self.value) +def __getattr__(name: str): + return _registry.build(name) + + +ADD_TAGS: APIOperation[AddTagsInput, AddTagsOutput] = APIOperation( + static_schema=_SCHEMA_ADD_TAGS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#ChannelARNInvalidException"), + ShapeID("com.amazonaws.cloudtrail#ChannelNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#CloudTrailARNInvalidException"), + ShapeID("com.amazonaws.cloudtrail#ConflictException"), + ShapeID("com.amazonaws.cloudtrail#EventDataStoreARNInvalidException"), + ShapeID("com.amazonaws.cloudtrail#EventDataStoreNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#InactiveEventDataStoreException"), + ShapeID("com.amazonaws.cloudtrail#InvalidTagParameterException"), + ShapeID("com.amazonaws.cloudtrail#InvalidTrailNameException"), + ShapeID("com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException"), + ShapeID("com.amazonaws.cloudtrail#NotOrganizationMasterAccountException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#ResourceNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#ResourceTypeNotSupportedException"), + ShapeID("com.amazonaws.cloudtrail#TagsLimitExceededException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) +CANCEL_QUERY: APIOperation[CancelQueryInput, CancelQueryOutput] = APIOperation( + static_schema=_SCHEMA_CANCEL_QUERY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#ConflictException"), + ShapeID("com.amazonaws.cloudtrail#EventDataStoreARNInvalidException"), + ShapeID("com.amazonaws.cloudtrail#EventDataStoreNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#InactiveEventDataStoreException"), + ShapeID("com.amazonaws.cloudtrail#InactiveQueryException"), + ShapeID("com.amazonaws.cloudtrail#InvalidParameterException"), + ShapeID("com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#QueryIdNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +CREATE_CHANNEL: APIOperation[CreateChannelInput, CreateChannelOutput] = APIOperation( + static_schema=_SCHEMA_CREATE_CHANNEL, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#ChannelAlreadyExistsException"), + ShapeID("com.amazonaws.cloudtrail#ChannelMaxLimitExceededException"), + ShapeID("com.amazonaws.cloudtrail#EventDataStoreARNInvalidException"), + ShapeID("com.amazonaws.cloudtrail#EventDataStoreNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#InactiveEventDataStoreException"), + ShapeID("com.amazonaws.cloudtrail#InvalidEventDataStoreCategoryException"), + ShapeID("com.amazonaws.cloudtrail#InvalidParameterException"), + ShapeID("com.amazonaws.cloudtrail#InvalidSourceException"), + ShapeID("com.amazonaws.cloudtrail#InvalidTagParameterException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#TagsLimitExceededException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["key"] = de.read_string(_SCHEMA_TAG.members["Key"]) +CREATE_DASHBOARD: APIOperation[CreateDashboardInput, CreateDashboardOutput] = ( + APIOperation( + static_schema=_SCHEMA_CREATE_DASHBOARD, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#ConflictException"), + ShapeID("com.amazonaws.cloudtrail#EventDataStoreNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#InactiveEventDataStoreException"), + ShapeID("com.amazonaws.cloudtrail#InsufficientEncryptionPolicyException"), + ShapeID("com.amazonaws.cloudtrail#InvalidQueryStatementException"), + ShapeID("com.amazonaws.cloudtrail#InvalidTagParameterException"), + ShapeID("com.amazonaws.cloudtrail#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - case 1: - kwargs["value"] = de.read_string(_SCHEMA_TAG.members["Value"]) +CREATE_EVENT_DATA_STORE: APIOperation[ + CreateEventDataStoreInput, CreateEventDataStoreOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_EVENT_DATA_STORE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#CloudTrailAccessNotEnabledException"), + ShapeID("com.amazonaws.cloudtrail#ConflictException"), + ShapeID("com.amazonaws.cloudtrail#EventDataStoreAlreadyExistsException"), + ShapeID("com.amazonaws.cloudtrail#EventDataStoreMaxLimitExceededException"), + ShapeID( + "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException" + ), + ShapeID("com.amazonaws.cloudtrail#InsufficientEncryptionPolicyException"), + ShapeID("com.amazonaws.cloudtrail#InvalidEventSelectorsException"), + ShapeID("com.amazonaws.cloudtrail#InvalidKmsKeyIdException"), + ShapeID("com.amazonaws.cloudtrail#InvalidParameterException"), + ShapeID("com.amazonaws.cloudtrail#InvalidTagParameterException"), + ShapeID("com.amazonaws.cloudtrail#KmsException"), + ShapeID("com.amazonaws.cloudtrail#KmsKeyNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException"), + ShapeID("com.amazonaws.cloudtrail#NotOrganizationMasterAccountException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#OrganizationNotInAllFeaturesModeException"), + ShapeID("com.amazonaws.cloudtrail#OrganizationsNotInUseException"), + ShapeID("com.amazonaws.cloudtrail#ThrottlingException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case _: - logger.debug("Unexpected member schema: %s", schema) +CREATE_TRAIL: APIOperation[CreateTrailInput, CreateTrailOutput] = APIOperation( + static_schema=_SCHEMA_CREATE_TRAIL, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#CloudTrailAccessNotEnabledException"), + ShapeID("com.amazonaws.cloudtrail#CloudTrailInvalidClientTokenIdException"), + ShapeID("com.amazonaws.cloudtrail#CloudWatchLogsDeliveryUnavailableException"), + ShapeID("com.amazonaws.cloudtrail#ConflictException"), + ShapeID( + "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException" + ), + ShapeID("com.amazonaws.cloudtrail#InsufficientEncryptionPolicyException"), + ShapeID("com.amazonaws.cloudtrail#InsufficientS3BucketPolicyException"), + ShapeID("com.amazonaws.cloudtrail#InsufficientSnsTopicPolicyException"), + ShapeID("com.amazonaws.cloudtrail#InvalidCloudWatchLogsLogGroupArnException"), + ShapeID("com.amazonaws.cloudtrail#InvalidCloudWatchLogsRoleArnException"), + ShapeID("com.amazonaws.cloudtrail#InvalidKmsKeyIdException"), + ShapeID("com.amazonaws.cloudtrail#InvalidParameterCombinationException"), + ShapeID("com.amazonaws.cloudtrail#InvalidParameterException"), + ShapeID("com.amazonaws.cloudtrail#InvalidS3BucketNameException"), + ShapeID("com.amazonaws.cloudtrail#InvalidS3PrefixException"), + ShapeID("com.amazonaws.cloudtrail#InvalidSnsTopicNameException"), + ShapeID("com.amazonaws.cloudtrail#InvalidTagParameterException"), + ShapeID("com.amazonaws.cloudtrail#InvalidTrailNameException"), + ShapeID("com.amazonaws.cloudtrail#KmsException"), + ShapeID("com.amazonaws.cloudtrail#KmsKeyDisabledException"), + ShapeID("com.amazonaws.cloudtrail#KmsKeyNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#MaximumNumberOfTrailsExceededException"), + ShapeID("com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException"), + ShapeID("com.amazonaws.cloudtrail#NotOrganizationMasterAccountException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#OrganizationNotInAllFeaturesModeException"), + ShapeID("com.amazonaws.cloudtrail#OrganizationsNotInUseException"), + ShapeID("com.amazonaws.cloudtrail#S3BucketDoesNotExistException"), + ShapeID("com.amazonaws.cloudtrail#TagsLimitExceededException"), + ShapeID("com.amazonaws.cloudtrail#ThrottlingException"), + ShapeID("com.amazonaws.cloudtrail#TrailAlreadyExistsException"), + ShapeID("com.amazonaws.cloudtrail#TrailNotProvidedException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - deserializer.read_struct(_SCHEMA_TAG, consumer=_consumer) - if "key" not in kwargs: - kwargs["key"] = "" - return kwargs +DELETE_CHANNEL: APIOperation[DeleteChannelInput, DeleteChannelOutput] = APIOperation( + static_schema=_SCHEMA_DELETE_CHANNEL, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#ChannelARNInvalidException"), + ShapeID("com.amazonaws.cloudtrail#ChannelNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +DELETE_DASHBOARD: APIOperation[DeleteDashboardInput, DeleteDashboardOutput] = ( + APIOperation( + static_schema=_SCHEMA_DELETE_DASHBOARD, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#ConflictException"), + ShapeID("com.amazonaws.cloudtrail#ResourceNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) -def _serialize_tags_list( - serializer: ShapeSerializer, schema: Schema, value: list[Tag] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) +DELETE_EVENT_DATA_STORE: APIOperation[ + DeleteEventDataStoreInput, DeleteEventDataStoreOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_EVENT_DATA_STORE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#ChannelExistsForEDSException"), + ShapeID("com.amazonaws.cloudtrail#ConflictException"), + ShapeID("com.amazonaws.cloudtrail#EventDataStoreARNInvalidException"), + ShapeID("com.amazonaws.cloudtrail#EventDataStoreFederationEnabledException"), + ShapeID("com.amazonaws.cloudtrail#EventDataStoreHasOngoingImportException"), + ShapeID("com.amazonaws.cloudtrail#EventDataStoreNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#EventDataStoreTerminationProtectedException"), + ShapeID("com.amazonaws.cloudtrail#InactiveEventDataStoreException"), + ShapeID( + "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException" + ), + ShapeID("com.amazonaws.cloudtrail#InvalidParameterException"), + ShapeID("com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException"), + ShapeID("com.amazonaws.cloudtrail#NotOrganizationMasterAccountException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +DELETE_RESOURCE_POLICY: APIOperation[ + DeleteResourcePolicyInput, DeleteResourcePolicyOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_RESOURCE_POLICY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#ConflictException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#ResourceARNNotValidException"), + ShapeID("com.amazonaws.cloudtrail#ResourceNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#ResourcePolicyNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#ResourceTypeNotSupportedException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -def _deserialize_tags_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Tag]: - result: list[Tag] = [] +DELETE_TRAIL: APIOperation[DeleteTrailInput, DeleteTrailOutput] = APIOperation( + static_schema=_SCHEMA_DELETE_TRAIL, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#CloudTrailARNInvalidException"), + ShapeID("com.amazonaws.cloudtrail#ConflictException"), + ShapeID( + "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException" + ), + ShapeID("com.amazonaws.cloudtrail#InvalidHomeRegionException"), + ShapeID("com.amazonaws.cloudtrail#InvalidTrailNameException"), + ShapeID("com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException"), + ShapeID("com.amazonaws.cloudtrail#NotOrganizationMasterAccountException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#ThrottlingException"), + ShapeID("com.amazonaws.cloudtrail#TrailNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() +DEREGISTER_ORGANIZATION_DELEGATED_ADMIN: APIOperation[ + DeregisterOrganizationDelegatedAdminInput, + DeregisterOrganizationDelegatedAdminOutput, +] = APIOperation( + static_schema=_SCHEMA_DEREGISTER_ORGANIZATION_DELEGATED_ADMIN, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#AccountNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#AccountNotRegisteredException"), + ShapeID("com.amazonaws.cloudtrail#CloudTrailAccessNotEnabledException"), + ShapeID("com.amazonaws.cloudtrail#ConflictException"), + ShapeID( + "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException" + ), + ShapeID("com.amazonaws.cloudtrail#InvalidParameterException"), + ShapeID("com.amazonaws.cloudtrail#NotOrganizationManagementAccountException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#OrganizationNotInAllFeaturesModeException"), + ShapeID("com.amazonaws.cloudtrail#OrganizationsNotInUseException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - else: - result.append(Tag.deserialize(d)) +DESCRIBE_QUERY: APIOperation[DescribeQueryInput, DescribeQueryOutput] = APIOperation( + static_schema=_SCHEMA_DESCRIBE_QUERY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#EventDataStoreARNInvalidException"), + ShapeID("com.amazonaws.cloudtrail#EventDataStoreNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#InactiveEventDataStoreException"), + ShapeID("com.amazonaws.cloudtrail#InvalidParameterException"), + ShapeID("com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#QueryIdNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - deserializer.read_list(schema, _read_value) - return result +DESCRIBE_TRAILS: APIOperation[DescribeTrailsInput, DescribeTrailsOutput] = APIOperation( + static_schema=_SCHEMA_DESCRIBE_TRAILS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#CloudTrailARNInvalidException"), + ShapeID("com.amazonaws.cloudtrail#InvalidTrailNameException"), + ShapeID("com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +DISABLE_FEDERATION: APIOperation[DisableFederationInput, DisableFederationOutput] = ( + APIOperation( + static_schema=_SCHEMA_DISABLE_FEDERATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#AccessDeniedException"), + ShapeID("com.amazonaws.cloudtrail#CloudTrailAccessNotEnabledException"), + ShapeID("com.amazonaws.cloudtrail#ConcurrentModificationException"), + ShapeID("com.amazonaws.cloudtrail#EventDataStoreARNInvalidException"), + ShapeID("com.amazonaws.cloudtrail#EventDataStoreNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#InactiveEventDataStoreException"), + ShapeID( + "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException" + ), + ShapeID("com.amazonaws.cloudtrail#InvalidParameterException"), + ShapeID("com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException"), + ShapeID("com.amazonaws.cloudtrail#NotOrganizationMasterAccountException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID( + "com.amazonaws.cloudtrail#OrganizationNotInAllFeaturesModeException" + ), + ShapeID("com.amazonaws.cloudtrail#OrganizationsNotInUseException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) -@dataclass(kw_only=True) -class AddTagsInput: - """ - Specifies the tags to add to a trail, event data store, dashboard, or - channel. - """ +ENABLE_FEDERATION: APIOperation[EnableFederationInput, EnableFederationOutput] = ( + APIOperation( + static_schema=_SCHEMA_ENABLE_FEDERATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#AccessDeniedException"), + ShapeID("com.amazonaws.cloudtrail#CloudTrailAccessNotEnabledException"), + ShapeID("com.amazonaws.cloudtrail#ConcurrentModificationException"), + ShapeID("com.amazonaws.cloudtrail#EventDataStoreARNInvalidException"), + ShapeID( + "com.amazonaws.cloudtrail#EventDataStoreFederationEnabledException" + ), + ShapeID("com.amazonaws.cloudtrail#EventDataStoreNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#InactiveEventDataStoreException"), + ShapeID( + "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException" + ), + ShapeID("com.amazonaws.cloudtrail#InvalidParameterException"), + ShapeID("com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException"), + ShapeID("com.amazonaws.cloudtrail#NotOrganizationMasterAccountException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID( + "com.amazonaws.cloudtrail#OrganizationNotInAllFeaturesModeException" + ), + ShapeID("com.amazonaws.cloudtrail#OrganizationsNotInUseException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - resource_id: str | None = None - """ - Specifies the ARN of the trail, event data store, dashboard, or channel - to which one or more tags will be added. +GENERATE_QUERY: APIOperation[GenerateQueryInput, GenerateQueryOutput] = APIOperation( + static_schema=_SCHEMA_GENERATE_QUERY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#EventDataStoreARNInvalidException"), + ShapeID("com.amazonaws.cloudtrail#EventDataStoreNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#GenerateResponseException"), + ShapeID("com.amazonaws.cloudtrail#InactiveEventDataStoreException"), + ShapeID("com.amazonaws.cloudtrail#InvalidParameterException"), + ShapeID("com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - The format of a trail ARN is: - `arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail` +GET_CHANNEL: APIOperation[GetChannelInput, GetChannelOutput] = APIOperation( + static_schema=_SCHEMA_GET_CHANNEL, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#ChannelARNInvalidException"), + ShapeID("com.amazonaws.cloudtrail#ChannelNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - The format of an event data store ARN is: - `arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE` +GET_DASHBOARD: APIOperation[GetDashboardInput, GetDashboardOutput] = APIOperation( + static_schema=_SCHEMA_GET_DASHBOARD, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#ResourceNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - The format of a dashboard ARN is: - `arn:aws:cloudtrail:us-east-1:123456789012:dashboard/exampleDash` +GET_EVENT_CONFIGURATION: APIOperation[ + GetEventConfigurationInput, GetEventConfigurationOutput +] = APIOperation( + static_schema=_SCHEMA_GET_EVENT_CONFIGURATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#CloudTrailARNInvalidException"), + ShapeID("com.amazonaws.cloudtrail#EventDataStoreARNInvalidException"), + ShapeID("com.amazonaws.cloudtrail#EventDataStoreNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#InvalidEventDataStoreCategoryException"), + ShapeID("com.amazonaws.cloudtrail#InvalidEventDataStoreStatusException"), + ShapeID("com.amazonaws.cloudtrail#InvalidParameterCombinationException"), + ShapeID("com.amazonaws.cloudtrail#InvalidParameterException"), + ShapeID("com.amazonaws.cloudtrail#InvalidTrailNameException"), + ShapeID("com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#TrailNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - The format of a channel ARN is: - `arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890` - """ +GET_EVENT_DATA_STORE: APIOperation[GetEventDataStoreInput, GetEventDataStoreOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_EVENT_DATA_STORE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#EventDataStoreARNInvalidException"), + ShapeID("com.amazonaws.cloudtrail#EventDataStoreNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#InvalidParameterException"), + ShapeID("com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - tags_list: list[Tag] | None = None - """Contains a list of tags, up to a limit of 50""" +GET_EVENT_SELECTORS: APIOperation[GetEventSelectorsInput, GetEventSelectorsOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_EVENT_SELECTORS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#CloudTrailARNInvalidException"), + ShapeID("com.amazonaws.cloudtrail#InvalidTrailNameException"), + ShapeID("com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#TrailNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ADD_TAGS_INPUT, self) +GET_IMPORT: APIOperation[GetImportInput, GetImportOutput] = APIOperation( + static_schema=_SCHEMA_GET_IMPORT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#ImportNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#InvalidParameterException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_id is not None: - serializer.write_string( - _SCHEMA_ADD_TAGS_INPUT.members["ResourceId"], self.resource_id - ) +GET_INSIGHT_SELECTORS: APIOperation[ + GetInsightSelectorsInput, GetInsightSelectorsOutput +] = APIOperation( + static_schema=_SCHEMA_GET_INSIGHT_SELECTORS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#CloudTrailARNInvalidException"), + ShapeID("com.amazonaws.cloudtrail#InsightNotEnabledException"), + ShapeID("com.amazonaws.cloudtrail#InvalidParameterCombinationException"), + ShapeID("com.amazonaws.cloudtrail#InvalidParameterException"), + ShapeID("com.amazonaws.cloudtrail#InvalidTrailNameException"), + ShapeID("com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#ThrottlingException"), + ShapeID("com.amazonaws.cloudtrail#TrailNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - if self.tags_list is not None: - _serialize_tags_list( - serializer, _SCHEMA_ADD_TAGS_INPUT.members["TagsList"], self.tags_list - ) +GET_QUERY_RESULTS: APIOperation[GetQueryResultsInput, GetQueryResultsOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_QUERY_RESULTS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#EventDataStoreARNInvalidException"), + ShapeID("com.amazonaws.cloudtrail#EventDataStoreNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#InactiveEventDataStoreException"), + ShapeID("com.amazonaws.cloudtrail#InsufficientEncryptionPolicyException"), + ShapeID("com.amazonaws.cloudtrail#InvalidMaxResultsException"), + ShapeID("com.amazonaws.cloudtrail#InvalidNextTokenException"), + ShapeID("com.amazonaws.cloudtrail#InvalidParameterException"), + ShapeID("com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#QueryIdNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) +GET_RESOURCE_POLICY: APIOperation[GetResourcePolicyInput, GetResourcePolicyOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_RESOURCE_POLICY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#ResourceARNNotValidException"), + ShapeID("com.amazonaws.cloudtrail#ResourceNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#ResourcePolicyNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#ResourceTypeNotSupportedException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +GET_TRAIL: APIOperation[GetTrailInput, GetTrailOutput] = APIOperation( + static_schema=_SCHEMA_GET_TRAIL, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#CloudTrailARNInvalidException"), + ShapeID("com.amazonaws.cloudtrail#InvalidTrailNameException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#TrailNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_id"] = de.read_string( - _SCHEMA_ADD_TAGS_INPUT.members["ResourceId"] - ) +GET_TRAIL_STATUS: APIOperation[GetTrailStatusInput, GetTrailStatusOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_TRAIL_STATUS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#CloudTrailARNInvalidException"), + ShapeID("com.amazonaws.cloudtrail#InvalidTrailNameException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#TrailNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - case 1: - kwargs["tags_list"] = _deserialize_tags_list( - de, _SCHEMA_ADD_TAGS_INPUT.members["TagsList"] - ) +LIST_CHANNELS: APIOperation[ListChannelsInput, ListChannelsOutput] = APIOperation( + static_schema=_SCHEMA_LIST_CHANNELS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#InvalidNextTokenException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case _: - logger.debug("Unexpected member schema: %s", schema) +LIST_DASHBOARDS: APIOperation[ListDashboardsInput, ListDashboardsOutput] = APIOperation( + static_schema=_SCHEMA_LIST_DASHBOARDS, + model_registry=_registry, + error_ids=[ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException")], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - deserializer.read_struct(_SCHEMA_ADD_TAGS_INPUT, consumer=_consumer) - return kwargs +LIST_EVENT_DATA_STORES: APIOperation[ + ListEventDataStoresInput, ListEventDataStoresOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_EVENT_DATA_STORES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#InvalidMaxResultsException"), + ShapeID("com.amazonaws.cloudtrail#InvalidNextTokenException"), + ShapeID("com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +LIST_IMPORT_FAILURES: APIOperation[ + ListImportFailuresInput, ListImportFailuresOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_IMPORT_FAILURES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#InvalidNextTokenException"), + ShapeID("com.amazonaws.cloudtrail#InvalidParameterException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -@dataclass(kw_only=True) -class AddTagsOutput: - """Returns the objects or data if successful. Otherwise, returns an error.""" +LIST_IMPORTS: APIOperation[ListImportsInput, ListImportsOutput] = APIOperation( + static_schema=_SCHEMA_LIST_IMPORTS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#EventDataStoreARNInvalidException"), + ShapeID("com.amazonaws.cloudtrail#InvalidNextTokenException"), + ShapeID("com.amazonaws.cloudtrail#InvalidParameterException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False +LIST_INSIGHTS_DATA: APIOperation[ListInsightsDataInput, ListInsightsDataOutput] = ( + APIOperation( + static_schema=_SCHEMA_LIST_INSIGHTS_DATA, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#InvalidParameterException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ADD_TAGS_OUTPUT, self) +) - def serialize_members(self, serializer: ShapeSerializer): - pass +LIST_INSIGHTS_METRIC_DATA: APIOperation[ + ListInsightsMetricDataInput, ListInsightsMetricDataOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_INSIGHTS_METRIC_DATA, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#InvalidParameterException"), + ShapeID("com.amazonaws.cloudtrail#InvalidTrailNameException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) +LIST_PUBLIC_KEYS: APIOperation[ListPublicKeysInput, ListPublicKeysOutput] = ( + APIOperation( + static_schema=_SCHEMA_LIST_PUBLIC_KEYS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#InvalidTimeRangeException"), + ShapeID("com.amazonaws.cloudtrail#InvalidTokenException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +LIST_QUERIES: APIOperation[ListQueriesInput, ListQueriesOutput] = APIOperation( + static_schema=_SCHEMA_LIST_QUERIES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#EventDataStoreARNInvalidException"), + ShapeID("com.amazonaws.cloudtrail#EventDataStoreNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#InactiveEventDataStoreException"), + ShapeID("com.amazonaws.cloudtrail#InvalidDateRangeException"), + ShapeID("com.amazonaws.cloudtrail#InvalidMaxResultsException"), + ShapeID("com.amazonaws.cloudtrail#InvalidNextTokenException"), + ShapeID("com.amazonaws.cloudtrail#InvalidParameterException"), + ShapeID("com.amazonaws.cloudtrail#InvalidQueryStatusException"), + ShapeID("com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) +LIST_TAGS: APIOperation[ListTagsInput, ListTagsOutput] = APIOperation( + static_schema=_SCHEMA_LIST_TAGS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#ChannelARNInvalidException"), + ShapeID("com.amazonaws.cloudtrail#CloudTrailARNInvalidException"), + ShapeID("com.amazonaws.cloudtrail#EventDataStoreARNInvalidException"), + ShapeID("com.amazonaws.cloudtrail#EventDataStoreNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#InactiveEventDataStoreException"), + ShapeID("com.amazonaws.cloudtrail#InvalidTokenException"), + ShapeID("com.amazonaws.cloudtrail#InvalidTrailNameException"), + ShapeID("com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#ResourceNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#ResourceTypeNotSupportedException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - deserializer.read_struct(_SCHEMA_ADD_TAGS_OUTPUT, consumer=_consumer) - return kwargs +LIST_TRAILS: APIOperation[ListTrailsInput, ListTrailsOutput] = APIOperation( + static_schema=_SCHEMA_LIST_TRAILS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +LOOKUP_EVENTS: APIOperation[LookupEventsInput, LookupEventsOutput] = APIOperation( + static_schema=_SCHEMA_LOOKUP_EVENTS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#InvalidEventCategoryException"), + ShapeID("com.amazonaws.cloudtrail#InvalidLookupAttributesException"), + ShapeID("com.amazonaws.cloudtrail#InvalidMaxResultsException"), + ShapeID("com.amazonaws.cloudtrail#InvalidNextTokenException"), + ShapeID("com.amazonaws.cloudtrail#InvalidTimeRangeException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -@dataclass(kw_only=True) -class ChannelARNInvalidException(ServiceError): - """ - This exception is thrown when the specified value of `ChannelARN` is not - valid. - """ +PUT_EVENT_CONFIGURATION: APIOperation[ + PutEventConfigurationInput, PutEventConfigurationOutput +] = APIOperation( + static_schema=_SCHEMA_PUT_EVENT_CONFIGURATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#CloudTrailARNInvalidException"), + ShapeID("com.amazonaws.cloudtrail#ConflictException"), + ShapeID("com.amazonaws.cloudtrail#EventDataStoreARNInvalidException"), + ShapeID("com.amazonaws.cloudtrail#EventDataStoreNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#InactiveEventDataStoreException"), + ShapeID( + "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException" + ), + ShapeID("com.amazonaws.cloudtrail#InsufficientIAMAccessPermissionException"), + ShapeID("com.amazonaws.cloudtrail#InvalidEventDataStoreCategoryException"), + ShapeID("com.amazonaws.cloudtrail#InvalidEventDataStoreStatusException"), + ShapeID("com.amazonaws.cloudtrail#InvalidHomeRegionException"), + ShapeID("com.amazonaws.cloudtrail#InvalidParameterCombinationException"), + ShapeID("com.amazonaws.cloudtrail#InvalidParameterException"), + ShapeID("com.amazonaws.cloudtrail#InvalidTrailNameException"), + ShapeID("com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException"), + ShapeID("com.amazonaws.cloudtrail#NotOrganizationMasterAccountException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#ThrottlingException"), + ShapeID("com.amazonaws.cloudtrail#TrailNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - fault: Literal["client", "server"] | None = "client" +PUT_EVENT_SELECTORS: APIOperation[PutEventSelectorsInput, PutEventSelectorsOutput] = ( + APIOperation( + static_schema=_SCHEMA_PUT_EVENT_SELECTORS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#CloudTrailARNInvalidException"), + ShapeID("com.amazonaws.cloudtrail#ConflictException"), + ShapeID( + "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException" + ), + ShapeID("com.amazonaws.cloudtrail#InvalidEventSelectorsException"), + ShapeID("com.amazonaws.cloudtrail#InvalidHomeRegionException"), + ShapeID("com.amazonaws.cloudtrail#InvalidTrailNameException"), + ShapeID("com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException"), + ShapeID("com.amazonaws.cloudtrail#NotOrganizationMasterAccountException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#ThrottlingException"), + ShapeID("com.amazonaws.cloudtrail#TrailNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CHANNEL_ARN_INVALID_EXCEPTION, self) +PUT_INSIGHT_SELECTORS: APIOperation[ + PutInsightSelectorsInput, PutInsightSelectorsOutput +] = APIOperation( + static_schema=_SCHEMA_PUT_INSIGHT_SELECTORS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#CloudTrailARNInvalidException"), + ShapeID("com.amazonaws.cloudtrail#ConflictException"), + ShapeID("com.amazonaws.cloudtrail#InsufficientEncryptionPolicyException"), + ShapeID("com.amazonaws.cloudtrail#InsufficientS3BucketPolicyException"), + ShapeID("com.amazonaws.cloudtrail#InvalidHomeRegionException"), + ShapeID("com.amazonaws.cloudtrail#InvalidInsightSelectorsException"), + ShapeID("com.amazonaws.cloudtrail#InvalidParameterCombinationException"), + ShapeID("com.amazonaws.cloudtrail#InvalidParameterException"), + ShapeID("com.amazonaws.cloudtrail#InvalidTrailNameException"), + ShapeID("com.amazonaws.cloudtrail#KmsException"), + ShapeID("com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException"), + ShapeID("com.amazonaws.cloudtrail#NotOrganizationMasterAccountException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#S3BucketDoesNotExistException"), + ShapeID("com.amazonaws.cloudtrail#ThrottlingException"), + ShapeID("com.amazonaws.cloudtrail#TrailNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_CHANNEL_ARN_INVALID_EXCEPTION.members["Message"], self.message - ) +PUT_RESOURCE_POLICY: APIOperation[PutResourcePolicyInput, PutResourcePolicyOutput] = ( + APIOperation( + static_schema=_SCHEMA_PUT_RESOURCE_POLICY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#ConflictException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#ResourceARNNotValidException"), + ShapeID("com.amazonaws.cloudtrail#ResourceNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#ResourcePolicyNotValidException"), + ShapeID("com.amazonaws.cloudtrail#ResourceTypeNotSupportedException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) +REGISTER_ORGANIZATION_DELEGATED_ADMIN: APIOperation[ + RegisterOrganizationDelegatedAdminInput, RegisterOrganizationDelegatedAdminOutput +] = APIOperation( + static_schema=_SCHEMA_REGISTER_ORGANIZATION_DELEGATED_ADMIN, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#AccountNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#AccountRegisteredException"), + ShapeID("com.amazonaws.cloudtrail#CannotDelegateManagementAccountException"), + ShapeID("com.amazonaws.cloudtrail#CloudTrailAccessNotEnabledException"), + ShapeID("com.amazonaws.cloudtrail#ConflictException"), + ShapeID("com.amazonaws.cloudtrail#DelegatedAdminAccountLimitExceededException"), + ShapeID( + "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException" + ), + ShapeID("com.amazonaws.cloudtrail#InsufficientIAMAccessPermissionException"), + ShapeID("com.amazonaws.cloudtrail#InvalidParameterException"), + ShapeID("com.amazonaws.cloudtrail#NotOrganizationManagementAccountException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#OrganizationNotInAllFeaturesModeException"), + ShapeID("com.amazonaws.cloudtrail#OrganizationsNotInUseException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +REMOVE_TAGS: APIOperation[RemoveTagsInput, RemoveTagsOutput] = APIOperation( + static_schema=_SCHEMA_REMOVE_TAGS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#ChannelARNInvalidException"), + ShapeID("com.amazonaws.cloudtrail#ChannelNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#CloudTrailARNInvalidException"), + ShapeID("com.amazonaws.cloudtrail#ConflictException"), + ShapeID("com.amazonaws.cloudtrail#EventDataStoreARNInvalidException"), + ShapeID("com.amazonaws.cloudtrail#EventDataStoreNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#InactiveEventDataStoreException"), + ShapeID("com.amazonaws.cloudtrail#InvalidTagParameterException"), + ShapeID("com.amazonaws.cloudtrail#InvalidTrailNameException"), + ShapeID("com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException"), + ShapeID("com.amazonaws.cloudtrail#NotOrganizationMasterAccountException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#ResourceNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#ResourceTypeNotSupportedException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_CHANNEL_ARN_INVALID_EXCEPTION.members["Message"] - ) +RESTORE_EVENT_DATA_STORE: APIOperation[ + RestoreEventDataStoreInput, RestoreEventDataStoreOutput +] = APIOperation( + static_schema=_SCHEMA_RESTORE_EVENT_DATA_STORE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#CloudTrailAccessNotEnabledException"), + ShapeID("com.amazonaws.cloudtrail#EventDataStoreARNInvalidException"), + ShapeID("com.amazonaws.cloudtrail#EventDataStoreMaxLimitExceededException"), + ShapeID("com.amazonaws.cloudtrail#EventDataStoreNotFoundException"), + ShapeID( + "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException" + ), + ShapeID("com.amazonaws.cloudtrail#InvalidEventDataStoreStatusException"), + ShapeID("com.amazonaws.cloudtrail#InvalidParameterException"), + ShapeID("com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException"), + ShapeID("com.amazonaws.cloudtrail#NotOrganizationMasterAccountException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#OrganizationNotInAllFeaturesModeException"), + ShapeID("com.amazonaws.cloudtrail#OrganizationsNotInUseException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case _: - logger.debug("Unexpected member schema: %s", schema) +SEARCH_SAMPLE_QUERIES: APIOperation[ + SearchSampleQueriesInput, SearchSampleQueriesOutput +] = APIOperation( + static_schema=_SCHEMA_SEARCH_SAMPLE_QUERIES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#InvalidParameterException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - deserializer.read_struct( - _SCHEMA_CHANNEL_ARN_INVALID_EXCEPTION, consumer=_consumer - ) - return kwargs +START_DASHBOARD_REFRESH: APIOperation[ + StartDashboardRefreshInput, StartDashboardRefreshOutput +] = APIOperation( + static_schema=_SCHEMA_START_DASHBOARD_REFRESH, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#EventDataStoreNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#InactiveEventDataStoreException"), + ShapeID("com.amazonaws.cloudtrail#ResourceNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +START_EVENT_DATA_STORE_INGESTION: APIOperation[ + StartEventDataStoreIngestionInput, StartEventDataStoreIngestionOutput +] = APIOperation( + static_schema=_SCHEMA_START_EVENT_DATA_STORE_INGESTION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#ConflictException"), + ShapeID("com.amazonaws.cloudtrail#EventDataStoreARNInvalidException"), + ShapeID("com.amazonaws.cloudtrail#EventDataStoreNotFoundException"), + ShapeID( + "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException" + ), + ShapeID("com.amazonaws.cloudtrail#InvalidEventDataStoreCategoryException"), + ShapeID("com.amazonaws.cloudtrail#InvalidEventDataStoreStatusException"), + ShapeID("com.amazonaws.cloudtrail#InvalidParameterException"), + ShapeID("com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException"), + ShapeID("com.amazonaws.cloudtrail#NotOrganizationMasterAccountException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -@dataclass(kw_only=True) -class ChannelNotFoundException(ServiceError): - """ - This exception is thrown when CloudTrail cannot find the specified - channel. - """ +START_IMPORT: APIOperation[StartImportInput, StartImportOutput] = APIOperation( + static_schema=_SCHEMA_START_IMPORT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#AccountHasOngoingImportException"), + ShapeID("com.amazonaws.cloudtrail#EventDataStoreARNInvalidException"), + ShapeID("com.amazonaws.cloudtrail#EventDataStoreNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#ImportNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#InactiveEventDataStoreException"), + ShapeID("com.amazonaws.cloudtrail#InsufficientEncryptionPolicyException"), + ShapeID("com.amazonaws.cloudtrail#InvalidEventDataStoreCategoryException"), + ShapeID("com.amazonaws.cloudtrail#InvalidEventDataStoreStatusException"), + ShapeID("com.amazonaws.cloudtrail#InvalidImportSourceException"), + ShapeID("com.amazonaws.cloudtrail#InvalidParameterException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - fault: Literal["client", "server"] | None = "client" +START_LOGGING: APIOperation[StartLoggingInput, StartLoggingOutput] = APIOperation( + static_schema=_SCHEMA_START_LOGGING, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#CloudTrailARNInvalidException"), + ShapeID("com.amazonaws.cloudtrail#ConflictException"), + ShapeID( + "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException" + ), + ShapeID("com.amazonaws.cloudtrail#InvalidHomeRegionException"), + ShapeID("com.amazonaws.cloudtrail#InvalidTrailNameException"), + ShapeID("com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException"), + ShapeID("com.amazonaws.cloudtrail#NotOrganizationMasterAccountException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#ThrottlingException"), + ShapeID("com.amazonaws.cloudtrail#TrailNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CHANNEL_NOT_FOUND_EXCEPTION, self) +START_QUERY: APIOperation[StartQueryInput, StartQueryOutput] = APIOperation( + static_schema=_SCHEMA_START_QUERY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#EventDataStoreARNInvalidException"), + ShapeID("com.amazonaws.cloudtrail#EventDataStoreNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#InactiveEventDataStoreException"), + ShapeID("com.amazonaws.cloudtrail#InsufficientEncryptionPolicyException"), + ShapeID("com.amazonaws.cloudtrail#InsufficientS3BucketPolicyException"), + ShapeID("com.amazonaws.cloudtrail#InvalidParameterException"), + ShapeID("com.amazonaws.cloudtrail#InvalidQueryStatementException"), + ShapeID("com.amazonaws.cloudtrail#InvalidS3BucketNameException"), + ShapeID("com.amazonaws.cloudtrail#InvalidS3PrefixException"), + ShapeID("com.amazonaws.cloudtrail#MaxConcurrentQueriesException"), + ShapeID("com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#S3BucketDoesNotExistException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_CHANNEL_NOT_FOUND_EXCEPTION.members["Message"], self.message - ) +STOP_EVENT_DATA_STORE_INGESTION: APIOperation[ + StopEventDataStoreIngestionInput, StopEventDataStoreIngestionOutput +] = APIOperation( + static_schema=_SCHEMA_STOP_EVENT_DATA_STORE_INGESTION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#ConflictException"), + ShapeID("com.amazonaws.cloudtrail#EventDataStoreARNInvalidException"), + ShapeID("com.amazonaws.cloudtrail#EventDataStoreNotFoundException"), + ShapeID( + "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException" + ), + ShapeID("com.amazonaws.cloudtrail#InvalidEventDataStoreCategoryException"), + ShapeID("com.amazonaws.cloudtrail#InvalidEventDataStoreStatusException"), + ShapeID("com.amazonaws.cloudtrail#InvalidParameterException"), + ShapeID("com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException"), + ShapeID("com.amazonaws.cloudtrail#NotOrganizationMasterAccountException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) +STOP_IMPORT: APIOperation[StopImportInput, StopImportOutput] = APIOperation( + static_schema=_SCHEMA_STOP_IMPORT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#ImportNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#InvalidParameterException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +STOP_LOGGING: APIOperation[StopLoggingInput, StopLoggingOutput] = APIOperation( + static_schema=_SCHEMA_STOP_LOGGING, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#CloudTrailARNInvalidException"), + ShapeID("com.amazonaws.cloudtrail#ConflictException"), + ShapeID( + "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException" + ), + ShapeID("com.amazonaws.cloudtrail#InvalidHomeRegionException"), + ShapeID("com.amazonaws.cloudtrail#InvalidTrailNameException"), + ShapeID("com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException"), + ShapeID("com.amazonaws.cloudtrail#NotOrganizationMasterAccountException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#ThrottlingException"), + ShapeID("com.amazonaws.cloudtrail#TrailNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_CHANNEL_NOT_FOUND_EXCEPTION.members["Message"] - ) +UPDATE_CHANNEL: APIOperation[UpdateChannelInput, UpdateChannelOutput] = APIOperation( + static_schema=_SCHEMA_UPDATE_CHANNEL, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#ChannelAlreadyExistsException"), + ShapeID("com.amazonaws.cloudtrail#ChannelARNInvalidException"), + ShapeID("com.amazonaws.cloudtrail#ChannelNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#EventDataStoreARNInvalidException"), + ShapeID("com.amazonaws.cloudtrail#EventDataStoreNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#InactiveEventDataStoreException"), + ShapeID("com.amazonaws.cloudtrail#InvalidEventDataStoreCategoryException"), + ShapeID("com.amazonaws.cloudtrail#InvalidParameterException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case _: - logger.debug("Unexpected member schema: %s", schema) +UPDATE_DASHBOARD: APIOperation[UpdateDashboardInput, UpdateDashboardOutput] = ( + APIOperation( + static_schema=_SCHEMA_UPDATE_DASHBOARD, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#ConflictException"), + ShapeID("com.amazonaws.cloudtrail#EventDataStoreNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#InactiveEventDataStoreException"), + ShapeID("com.amazonaws.cloudtrail#InsufficientEncryptionPolicyException"), + ShapeID("com.amazonaws.cloudtrail#InvalidQueryStatementException"), + ShapeID("com.amazonaws.cloudtrail#ResourceNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - deserializer.read_struct( - _SCHEMA_CHANNEL_NOT_FOUND_EXCEPTION, consumer=_consumer - ) - return kwargs +UPDATE_EVENT_DATA_STORE: APIOperation[ + UpdateEventDataStoreInput, UpdateEventDataStoreOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_EVENT_DATA_STORE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#CloudTrailAccessNotEnabledException"), + ShapeID("com.amazonaws.cloudtrail#ConflictException"), + ShapeID("com.amazonaws.cloudtrail#EventDataStoreAlreadyExistsException"), + ShapeID("com.amazonaws.cloudtrail#EventDataStoreARNInvalidException"), + ShapeID("com.amazonaws.cloudtrail#EventDataStoreHasOngoingImportException"), + ShapeID("com.amazonaws.cloudtrail#EventDataStoreNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#InactiveEventDataStoreException"), + ShapeID( + "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException" + ), + ShapeID("com.amazonaws.cloudtrail#InsufficientEncryptionPolicyException"), + ShapeID("com.amazonaws.cloudtrail#InvalidEventSelectorsException"), + ShapeID("com.amazonaws.cloudtrail#InvalidInsightSelectorsException"), + ShapeID("com.amazonaws.cloudtrail#InvalidKmsKeyIdException"), + ShapeID("com.amazonaws.cloudtrail#InvalidParameterException"), + ShapeID("com.amazonaws.cloudtrail#KmsException"), + ShapeID("com.amazonaws.cloudtrail#KmsKeyNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException"), + ShapeID("com.amazonaws.cloudtrail#NotOrganizationMasterAccountException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#OrganizationNotInAllFeaturesModeException"), + ShapeID("com.amazonaws.cloudtrail#OrganizationsNotInUseException"), + ShapeID("com.amazonaws.cloudtrail#ThrottlingException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - -@dataclass(kw_only=True) -class CloudTrailARNInvalidException(ServiceError): - """ - This exception is thrown when an operation is called with an ARN that is - not valid. - - The following is the format of a trail ARN: - `arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail` - - The following is the format of an event data store ARN: - `arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE` - - The following is the format of a dashboard ARN: - `arn:aws:cloudtrail:us-east-1:123456789012:dashboard/exampleDash` - - The following is the format of a channel ARN: - `arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890` - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CLOUD_TRAIL_ARN_INVALID_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_CLOUD_TRAIL_ARN_INVALID_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_CLOUD_TRAIL_ARN_INVALID_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CLOUD_TRAIL_ARN_INVALID_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ConflictException(ServiceError): - """ - This exception is thrown when the specified resource is not ready for an - operation. This can occur when you try to run an operation on a resource - before CloudTrail has time to fully load the resource, or because - another operation is modifying the resource. If this exception occurs, - wait a few minutes, and then try the operation again. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONFLICT_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_CONFLICT_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_CONFLICT_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONFLICT_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class EventDataStoreARNInvalidException(ServiceError): - """ - The specified event data store ARN is not valid or does not map to an - event data store in your account. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVENT_DATA_STORE_ARN_INVALID_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_EVENT_DATA_STORE_ARN_INVALID_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_EVENT_DATA_STORE_ARN_INVALID_EXCEPTION.members[ - "Message" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EVENT_DATA_STORE_ARN_INVALID_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class EventDataStoreNotFoundException(ServiceError): - """The specified event data store was not found.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_EVENT_DATA_STORE_NOT_FOUND_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_EVENT_DATA_STORE_NOT_FOUND_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InactiveEventDataStoreException(ServiceError): - """The event data store is inactive.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INACTIVE_EVENT_DATA_STORE_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INACTIVE_EVENT_DATA_STORE_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INACTIVE_EVENT_DATA_STORE_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INACTIVE_EVENT_DATA_STORE_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InvalidTagParameterException(ServiceError): - """ - This exception is thrown when the specified tag key or values are not - valid. It can also occur if there are duplicate tags or too many tags on - the resource. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_TAG_PARAMETER_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_TAG_PARAMETER_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_TAG_PARAMETER_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVALID_TAG_PARAMETER_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InvalidTrailNameException(ServiceError): - """ - This exception is thrown when the provided trail name is not valid. - Trail names must meet the following requirements: - - - Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), - underscores (_), or dashes (-) - - - Start with a letter or number, and end with a letter or number - - - Be between 3 and 128 characters - - - Have no adjacent periods, underscores or dashes. Names like - `my-_namespace` and `my--namespace` are not valid. - - - Not be in IP address format (for example, 192.168.5.4) - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_TRAIL_NAME_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_TRAIL_NAME_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_TRAIL_NAME_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVALID_TRAIL_NAME_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class NoManagementAccountSLRExistsException(ServiceError): - """ - This exception is thrown when the management account does not have a - service-linked role. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION.members[ - "Message" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class NotOrganizationMasterAccountException(ServiceError): - """ - This exception is thrown when the Amazon Web Services account making the - request to create or update an organization trail or event data store is - not the management account for an organization in Organizations. For - more information, see [Prepare For Creating a Trail For Your - Organization](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html) - or [Organization event data - stores](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake-organizations.html). - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_NOT_ORGANIZATION_MASTER_ACCOUNT_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_NOT_ORGANIZATION_MASTER_ACCOUNT_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_NOT_ORGANIZATION_MASTER_ACCOUNT_EXCEPTION.members[ - "Message" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_NOT_ORGANIZATION_MASTER_ACCOUNT_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class OperationNotPermittedException(ServiceError): - """This exception is thrown when the requested operation is not permitted.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ResourceNotFoundException(ServiceError): - """This exception is thrown when the specified resource is not found.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ResourceTypeNotSupportedException(ServiceError): - """ - This exception is thrown when the specified resource type is not - supported by CloudTrail. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESOURCE_TYPE_NOT_SUPPORTED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_RESOURCE_TYPE_NOT_SUPPORTED_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_RESOURCE_TYPE_NOT_SUPPORTED_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RESOURCE_TYPE_NOT_SUPPORTED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class TagsLimitExceededException(ServiceError): - """ - The number of tags per trail, event data store, dashboard, or channel - has exceeded the permitted amount. Currently, the limit is 50. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TAGS_LIMIT_EXCEEDED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_TAGS_LIMIT_EXCEEDED_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_TAGS_LIMIT_EXCEEDED_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_TAGS_LIMIT_EXCEEDED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UnsupportedOperationException(ServiceError): - """This exception is thrown when the requested operation is not supported.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, consumer=_consumer - ) - return kwargs - - -ADD_TAGS = APIOperation( - input=AddTagsInput, - output=AddTagsOutput, - schema=_SCHEMA_ADD_TAGS, - input_schema=_SCHEMA_ADD_TAGS_INPUT, - output_schema=_SCHEMA_ADD_TAGS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#ChannelARNInvalidException" - ): ChannelARNInvalidException, - ShapeID( - "com.amazonaws.cloudtrail#ChannelNotFoundException" - ): ChannelNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#CloudTrailARNInvalidException" - ): CloudTrailARNInvalidException, - ShapeID("com.amazonaws.cloudtrail#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreARNInvalidException" - ): EventDataStoreARNInvalidException, - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreNotFoundException" - ): EventDataStoreNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#InactiveEventDataStoreException" - ): InactiveEventDataStoreException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidTagParameterException" - ): InvalidTagParameterException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidTrailNameException" - ): InvalidTrailNameException, - ShapeID( - "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException" - ): NoManagementAccountSLRExistsException, - ShapeID( - "com.amazonaws.cloudtrail#NotOrganizationMasterAccountException" - ): NotOrganizationMasterAccountException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#ResourceTypeNotSupportedException" - ): ResourceTypeNotSupportedException, - ShapeID( - "com.amazonaws.cloudtrail#TagsLimitExceededException" - ): TagsLimitExceededException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CHANNEL_ARN_INVALID_EXCEPTION, - _SCHEMA_CHANNEL_NOT_FOUND_EXCEPTION, - _SCHEMA_CLOUD_TRAIL_ARN_INVALID_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_EVENT_DATA_STORE_ARN_INVALID_EXCEPTION, - _SCHEMA_EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, - _SCHEMA_INACTIVE_EVENT_DATA_STORE_EXCEPTION, - _SCHEMA_INVALID_TAG_PARAMETER_EXCEPTION, - _SCHEMA_INVALID_TRAIL_NAME_EXCEPTION, - _SCHEMA_NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, - _SCHEMA_NOT_ORGANIZATION_MASTER_ACCOUNT_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_RESOURCE_TYPE_NOT_SUPPORTED_EXCEPTION, - _SCHEMA_TAGS_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -def _serialize_operator( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_operator(deserializer: ShapeDeserializer, schema: Schema) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AdvancedFieldSelector: - """A single selector statement in an advanced event selector.""" - - field: str - """ - A field in a CloudTrail event record on which to filter events to be - logged. For event data stores for CloudTrail Insights events, Config - configuration items, Audit Manager evidence, or events outside of Amazon - Web Services, the field is used only for selecting events as filtering - is not supported. - - For more information, see - [AdvancedFieldSelector](https://docs.aws.amazon.com/awscloudtrail/latest/APIReference/API_AdvancedFieldSelector.html) - in the *CloudTrail API Reference*. - - Note: - Selectors don't support the use of wildcards like `*` . To match - multiple values with a single condition, you may use `StartsWith`, - `EndsWith`, `NotStartsWith`, or `NotEndsWith` to explicitly match the - beginning or end of the event field. - """ - - equals: list[str] | None = None - """ - An operator that includes events that match the exact value of the event - record field specified as the value of `Field`. This is the only valid - operator that you can use with the `readOnly`, `eventCategory`, and - `resources.type` fields. - """ - - starts_with: list[str] | None = None - """ - An operator that includes events that match the first few characters of - the event record field specified as the value of `Field`. - """ - - ends_with: list[str] | None = None - """ - An operator that includes events that match the last few characters of - the event record field specified as the value of `Field`. - """ - - not_equals: list[str] | None = None - """ - An operator that excludes events that match the exact value of the event - record field specified as the value of `Field`. - """ - - not_starts_with: list[str] | None = None - """ - An operator that excludes events that match the first few characters of - the event record field specified as the value of `Field`. - """ - - not_ends_with: list[str] | None = None - """ - An operator that excludes events that match the last few characters of - the event record field specified as the value of `Field`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ADVANCED_FIELD_SELECTOR, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_ADVANCED_FIELD_SELECTOR.members["Field"], self.field - ) - if self.equals is not None: - _serialize_operator( - serializer, - _SCHEMA_ADVANCED_FIELD_SELECTOR.members["Equals"], - self.equals, - ) - - if self.starts_with is not None: - _serialize_operator( - serializer, - _SCHEMA_ADVANCED_FIELD_SELECTOR.members["StartsWith"], - self.starts_with, - ) - - if self.ends_with is not None: - _serialize_operator( - serializer, - _SCHEMA_ADVANCED_FIELD_SELECTOR.members["EndsWith"], - self.ends_with, - ) - - if self.not_equals is not None: - _serialize_operator( - serializer, - _SCHEMA_ADVANCED_FIELD_SELECTOR.members["NotEquals"], - self.not_equals, - ) - - if self.not_starts_with is not None: - _serialize_operator( - serializer, - _SCHEMA_ADVANCED_FIELD_SELECTOR.members["NotStartsWith"], - self.not_starts_with, - ) - - if self.not_ends_with is not None: - _serialize_operator( - serializer, - _SCHEMA_ADVANCED_FIELD_SELECTOR.members["NotEndsWith"], - self.not_ends_with, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["field"] = de.read_string( - _SCHEMA_ADVANCED_FIELD_SELECTOR.members["Field"] - ) - - case 1: - kwargs["equals"] = _deserialize_operator( - de, _SCHEMA_ADVANCED_FIELD_SELECTOR.members["Equals"] - ) - - case 2: - kwargs["starts_with"] = _deserialize_operator( - de, _SCHEMA_ADVANCED_FIELD_SELECTOR.members["StartsWith"] - ) - - case 3: - kwargs["ends_with"] = _deserialize_operator( - de, _SCHEMA_ADVANCED_FIELD_SELECTOR.members["EndsWith"] - ) - - case 4: - kwargs["not_equals"] = _deserialize_operator( - de, _SCHEMA_ADVANCED_FIELD_SELECTOR.members["NotEquals"] - ) - - case 5: - kwargs["not_starts_with"] = _deserialize_operator( - de, _SCHEMA_ADVANCED_FIELD_SELECTOR.members["NotStartsWith"] - ) - - case 6: - kwargs["not_ends_with"] = _deserialize_operator( - de, _SCHEMA_ADVANCED_FIELD_SELECTOR.members["NotEndsWith"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ADVANCED_FIELD_SELECTOR, consumer=_consumer) - if "field" not in kwargs: - kwargs["field"] = "" - return kwargs - - -def _serialize_advanced_field_selectors( - serializer: ShapeSerializer, schema: Schema, value: list[AdvancedFieldSelector] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_advanced_field_selectors( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AdvancedFieldSelector]: - result: list[AdvancedFieldSelector] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AdvancedFieldSelector.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AdvancedEventSelector: - """ - Advanced event selectors let you create fine-grained selectors for - CloudTrail management, data, and network activity events. They help you - control costs by logging only those events that are important to you. - For more information about configuring advanced event selectors, see the - [Logging data - events](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html), - [Logging network activity - events](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-network-events-with-cloudtrail.html), - and [Logging management - events](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-management-events-with-cloudtrail.html) - topics in the *CloudTrail User Guide*. - - You cannot apply both event selectors and advanced event selectors to a - trail. - - For information about configurable advanced event selector fields, see - [AdvancedEventSelector](https://docs.aws.amazon.com/awscloudtrail/latest/APIReference/API_AdvancedEventSelector.html) - in the *CloudTrail API Reference*. - """ - - field_selectors: list[AdvancedFieldSelector] - """Contains all selector statements in an advanced event selector.""" - - name: str | None = None - """ - An optional, descriptive name for an advanced event selector, such as - \"Log data events for only two S3 buckets\". - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ADVANCED_EVENT_SELECTOR, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_ADVANCED_EVENT_SELECTOR.members["Name"], self.name - ) - - _serialize_advanced_field_selectors( - serializer, - _SCHEMA_ADVANCED_EVENT_SELECTOR.members["FieldSelectors"], - self.field_selectors, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_ADVANCED_EVENT_SELECTOR.members["Name"] - ) - - case 1: - kwargs["field_selectors"] = _deserialize_advanced_field_selectors( - de, _SCHEMA_ADVANCED_EVENT_SELECTOR.members["FieldSelectors"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ADVANCED_EVENT_SELECTOR, consumer=_consumer) - if "field_selectors" not in kwargs: - kwargs["field_selectors"] = [] - return kwargs - - -def _serialize_advanced_event_selectors( - serializer: ShapeSerializer, schema: Schema, value: list[AdvancedEventSelector] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_advanced_event_selectors( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AdvancedEventSelector]: - result: list[AdvancedEventSelector] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AdvancedEventSelector.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class EventCategoryAggregation(UnknownEnumMixin, StrEnum): - DATA = "Data" - - -class Template(UnknownEnumMixin, StrEnum): - """ - Specifies the type of the aggregation templates in the aggregation - configuration. Valid values include API_ACTIVITY, RESOURCE_ACCESS and - USER_ACTIONS. - """ - - API_ACTIVITY = "API_ACTIVITY" - RESOURCE_ACCESS = "RESOURCE_ACCESS" - USER_ACTIONS = "USER_ACTIONS" - - -def _serialize_templates( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_templates( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Template(d.read_string(member_schema))) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AggregationConfiguration: - """An object that contains configuration settings for aggregating events.""" - - templates: list[str] - """ - A list of aggregation templates that can be used to configure event - aggregation. - """ - - event_category: str - """Specifies the event category for which aggregation should be performed.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGGREGATION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_templates( - serializer, - _SCHEMA_AGGREGATION_CONFIGURATION.members["Templates"], - self.templates, - ) - serializer.write_string( - _SCHEMA_AGGREGATION_CONFIGURATION.members["EventCategory"], - self.event_category, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["templates"] = _deserialize_templates( - de, _SCHEMA_AGGREGATION_CONFIGURATION.members["Templates"] - ) - - case 1: - kwargs["event_category"] = EventCategoryAggregation( - de.read_string( - _SCHEMA_AGGREGATION_CONFIGURATION.members["EventCategory"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AGGREGATION_CONFIGURATION, consumer=_consumer) - if "templates" not in kwargs: - kwargs["templates"] = [] - if "event_category" not in kwargs: - kwargs["event_category"] = EventCategoryAggregation._corrected("") - return kwargs - - -def _serialize_aggregation_configurations( - serializer: ShapeSerializer, schema: Schema, value: list[AggregationConfiguration] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_aggregation_configurations( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AggregationConfiguration]: - result: list[AggregationConfiguration] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AggregationConfiguration.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class BillingMode(UnknownEnumMixin, StrEnum): - EXTENDABLE_RETENTION_PRICING = "EXTENDABLE_RETENTION_PRICING" - FIXED_RETENTION_PRICING = "FIXED_RETENTION_PRICING" - - -@dataclass(kw_only=True) -class CancelQueryInput: - """Dataclass for CancelQueryInput structure.""" - - event_data_store: str | None = None - """ - The ARN (or the ID suffix of the ARN) of an event data store on which - the specified query is running. - """ - - query_id: str | None = None - """ - The ID of the query that you want to cancel. The `QueryId` comes from - the response of a `StartQuery` operation. - """ - - event_data_store_owner_account_id: str | None = None - """The account ID of the event data store owner.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CANCEL_QUERY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.event_data_store is not None: - serializer.write_string( - _SCHEMA_CANCEL_QUERY_INPUT.members["EventDataStore"], - self.event_data_store, - ) - - if self.query_id is not None: - serializer.write_string( - _SCHEMA_CANCEL_QUERY_INPUT.members["QueryId"], self.query_id - ) - - if self.event_data_store_owner_account_id is not None: - serializer.write_string( - _SCHEMA_CANCEL_QUERY_INPUT.members["EventDataStoreOwnerAccountId"], - self.event_data_store_owner_account_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["event_data_store"] = de.read_string( - _SCHEMA_CANCEL_QUERY_INPUT.members["EventDataStore"] - ) - - case 1: - kwargs["query_id"] = de.read_string( - _SCHEMA_CANCEL_QUERY_INPUT.members["QueryId"] - ) - - case 2: - kwargs["event_data_store_owner_account_id"] = de.read_string( - _SCHEMA_CANCEL_QUERY_INPUT.members[ - "EventDataStoreOwnerAccountId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CANCEL_QUERY_INPUT, consumer=_consumer) - return kwargs - - -class QueryStatus(UnknownEnumMixin, StrEnum): - QUEUED = "QUEUED" - RUNNING = "RUNNING" - FINISHED = "FINISHED" - FAILED = "FAILED" - CANCELLED = "CANCELLED" - TIMED_OUT = "TIMED_OUT" - - -@dataclass(kw_only=True) -class CancelQueryOutput: - """Dataclass for CancelQueryOutput structure.""" - - query_id: str - """The ID of the canceled query.""" - - query_status: str - """ - Shows the status of a query after a `CancelQuery` request. Typically, - the values shown are either `RUNNING` or `CANCELLED`. - """ - - event_data_store_owner_account_id: str | None = None - """The account ID of the event data store owner.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CANCEL_QUERY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CANCEL_QUERY_OUTPUT.members["QueryId"], self.query_id - ) - serializer.write_string( - _SCHEMA_CANCEL_QUERY_OUTPUT.members["QueryStatus"], self.query_status - ) - if self.event_data_store_owner_account_id is not None: - serializer.write_string( - _SCHEMA_CANCEL_QUERY_OUTPUT.members["EventDataStoreOwnerAccountId"], - self.event_data_store_owner_account_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["query_id"] = de.read_string( - _SCHEMA_CANCEL_QUERY_OUTPUT.members["QueryId"] - ) - - case 1: - kwargs["query_status"] = QueryStatus( - de.read_string( - _SCHEMA_CANCEL_QUERY_OUTPUT.members["QueryStatus"] - ) - ) - - case 2: - kwargs["event_data_store_owner_account_id"] = de.read_string( - _SCHEMA_CANCEL_QUERY_OUTPUT.members[ - "EventDataStoreOwnerAccountId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CANCEL_QUERY_OUTPUT, consumer=_consumer) - if "query_id" not in kwargs: - kwargs["query_id"] = "" - if "query_status" not in kwargs: - kwargs["query_status"] = QueryStatus._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class InactiveQueryException(ServiceError): - """ - The specified query cannot be canceled because it is in the `FINISHED`, - `FAILED`, `TIMED_OUT`, or `CANCELLED` state. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INACTIVE_QUERY_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INACTIVE_QUERY_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INACTIVE_QUERY_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INACTIVE_QUERY_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class InvalidParameterException(ServiceError): - """The request includes a parameter that is not valid.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_PARAMETER_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_PARAMETER_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_PARAMETER_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVALID_PARAMETER_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class QueryIdNotFoundException(ServiceError): - """The query ID does not exist or does not map to a query.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_QUERY_ID_NOT_FOUND_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_QUERY_ID_NOT_FOUND_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_QUERY_ID_NOT_FOUND_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_QUERY_ID_NOT_FOUND_EXCEPTION, consumer=_consumer - ) - return kwargs - - -CANCEL_QUERY = APIOperation( - input=CancelQueryInput, - output=CancelQueryOutput, - schema=_SCHEMA_CANCEL_QUERY, - input_schema=_SCHEMA_CANCEL_QUERY_INPUT, - output_schema=_SCHEMA_CANCEL_QUERY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.cloudtrail#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreARNInvalidException" - ): EventDataStoreARNInvalidException, - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreNotFoundException" - ): EventDataStoreNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#InactiveEventDataStoreException" - ): InactiveEventDataStoreException, - ShapeID( - "com.amazonaws.cloudtrail#InactiveQueryException" - ): InactiveQueryException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException" - ): NoManagementAccountSLRExistsException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#QueryIdNotFoundException" - ): QueryIdNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_EVENT_DATA_STORE_ARN_INVALID_EXCEPTION, - _SCHEMA_EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, - _SCHEMA_INACTIVE_EVENT_DATA_STORE_EXCEPTION, - _SCHEMA_INACTIVE_QUERY_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_QUERY_ID_NOT_FOUND_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class CannotDelegateManagementAccountException(ServiceError): - """ - This exception is thrown when the management account of an organization - is registered as the CloudTrail delegated administrator. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CANNOT_DELEGATE_MANAGEMENT_ACCOUNT_EXCEPTION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_CANNOT_DELEGATE_MANAGEMENT_ACCOUNT_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_CANNOT_DELEGATE_MANAGEMENT_ACCOUNT_EXCEPTION.members[ - "Message" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CANNOT_DELEGATE_MANAGEMENT_ACCOUNT_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class Channel: - """Contains information about a returned CloudTrail channel.""" - - channel_arn: str | None = None - """The Amazon Resource Name (ARN) of a channel.""" - - name: str | None = None - """ - The name of the CloudTrail channel. For service-linked channels, the - name is `aws-service-channel/service-name/custom-suffix` where - `service-name` represents the name of the Amazon Web Services service - that created the channel and `custom-suffix` represents the suffix - created by the Amazon Web Services service. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CHANNEL, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.channel_arn is not None: - serializer.write_string( - _SCHEMA_CHANNEL.members["ChannelArn"], self.channel_arn - ) - - if self.name is not None: - serializer.write_string(_SCHEMA_CHANNEL.members["Name"], self.name) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["channel_arn"] = de.read_string( - _SCHEMA_CHANNEL.members["ChannelArn"] - ) - - case 1: - kwargs["name"] = de.read_string(_SCHEMA_CHANNEL.members["Name"]) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CHANNEL, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ChannelAlreadyExistsException(ServiceError): - """This exception is thrown when the provided channel already exists.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CHANNEL_ALREADY_EXISTS_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_CHANNEL_ALREADY_EXISTS_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_CHANNEL_ALREADY_EXISTS_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CHANNEL_ALREADY_EXISTS_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ChannelExistsForEDSException(ServiceError): - """ - This exception is thrown when the specified event data store cannot yet - be deleted because it is in use by a channel. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CHANNEL_EXISTS_FOR_EDS_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_CHANNEL_EXISTS_FOR_EDS_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_CHANNEL_EXISTS_FOR_EDS_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CHANNEL_EXISTS_FOR_EDS_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ChannelMaxLimitExceededException(ServiceError): - """ - This exception is thrown when the maximum number of channels limit is - exceeded. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CHANNEL_MAX_LIMIT_EXCEEDED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_CHANNEL_MAX_LIMIT_EXCEEDED_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_CHANNEL_MAX_LIMIT_EXCEEDED_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CHANNEL_MAX_LIMIT_EXCEEDED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -def _serialize_channels( - serializer: ShapeSerializer, schema: Schema, value: list[Channel] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_channels( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Channel]: - result: list[Channel] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Channel.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class DestinationType(UnknownEnumMixin, StrEnum): - EVENT_DATA_STORE = "EVENT_DATA_STORE" - AWS_SERVICE = "AWS_SERVICE" - - -@dataclass(kw_only=True) -class Destination: - """Contains information about the destination receiving events.""" - - type: str - """ - The type of destination for events arriving from a channel. For channels - used for a CloudTrail Lake integration, the value is `EVENT_DATA_STORE`. - For service-linked channels, the value is `AWS_SERVICE`. - """ - - location: str - """ - For channels used for a CloudTrail Lake integration, the location is the - ARN of an event data store that receives events from a channel. For - service-linked channels, the location is the name of the Amazon Web - Services service. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DESTINATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_DESTINATION.members["Type"], self.type) - serializer.write_string(_SCHEMA_DESTINATION.members["Location"], self.location) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = DestinationType( - de.read_string(_SCHEMA_DESTINATION.members["Type"]) - ) - - case 1: - kwargs["location"] = de.read_string( - _SCHEMA_DESTINATION.members["Location"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DESTINATION, consumer=_consumer) - if "type" not in kwargs: - kwargs["type"] = DestinationType._corrected("") - if "location" not in kwargs: - kwargs["location"] = "" - return kwargs - - -def _serialize_destinations( - serializer: ShapeSerializer, schema: Schema, value: list[Destination] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_destinations( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Destination]: - result: list[Destination] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Destination.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CreateChannelInput: - """Dataclass for CreateChannelInput structure.""" - - name: str | None = None - """The name of the channel.""" - - source: str | None = None - """ - The name of the partner or external event source. You cannot change this - name after you create the channel. A maximum of one channel is allowed - per source. - - A source can be either `Custom` for all valid non-Amazon Web Services - events, or the name of a partner event source. For information about the - source names for available partners, see [Additional information about - integration - partners](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-event-data-store-integration.html#cloudtrail-lake-partner-information) - in the CloudTrail User Guide. - """ - - destinations: list[Destination] | None = None - """ - One or more event data stores to which events arriving through a channel - will be logged. - """ - - tags: list[Tag] | None = None - """A list of tags.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_CHANNEL_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_CHANNEL_INPUT.members["Name"], self.name - ) - - if self.source is not None: - serializer.write_string( - _SCHEMA_CREATE_CHANNEL_INPUT.members["Source"], self.source - ) - - if self.destinations is not None: - _serialize_destinations( - serializer, - _SCHEMA_CREATE_CHANNEL_INPUT.members["Destinations"], - self.destinations, - ) - - if self.tags is not None: - _serialize_tags_list( - serializer, _SCHEMA_CREATE_CHANNEL_INPUT.members["Tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_CHANNEL_INPUT.members["Name"] - ) - - case 1: - kwargs["source"] = de.read_string( - _SCHEMA_CREATE_CHANNEL_INPUT.members["Source"] - ) - - case 2: - kwargs["destinations"] = _deserialize_destinations( - de, _SCHEMA_CREATE_CHANNEL_INPUT.members["Destinations"] - ) - - case 3: - kwargs["tags"] = _deserialize_tags_list( - de, _SCHEMA_CREATE_CHANNEL_INPUT.members["Tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_CHANNEL_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CreateChannelOutput: - """Dataclass for CreateChannelOutput structure.""" - - channel_arn: str | None = None - """The Amazon Resource Name (ARN) of the new channel.""" - - name: str | None = None - """The name of the new channel.""" - - source: str | None = None - """The partner or external event source name.""" - - destinations: list[Destination] | None = None - """The event data stores that log the events arriving through the channel.""" - - tags: list[Tag] | None = None - """A list of tags.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_CHANNEL_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.channel_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_CHANNEL_OUTPUT.members["ChannelArn"], self.channel_arn - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_CHANNEL_OUTPUT.members["Name"], self.name - ) - - if self.source is not None: - serializer.write_string( - _SCHEMA_CREATE_CHANNEL_OUTPUT.members["Source"], self.source - ) - - if self.destinations is not None: - _serialize_destinations( - serializer, - _SCHEMA_CREATE_CHANNEL_OUTPUT.members["Destinations"], - self.destinations, - ) - - if self.tags is not None: - _serialize_tags_list( - serializer, _SCHEMA_CREATE_CHANNEL_OUTPUT.members["Tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["channel_arn"] = de.read_string( - _SCHEMA_CREATE_CHANNEL_OUTPUT.members["ChannelArn"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_CHANNEL_OUTPUT.members["Name"] - ) - - case 2: - kwargs["source"] = de.read_string( - _SCHEMA_CREATE_CHANNEL_OUTPUT.members["Source"] - ) - - case 3: - kwargs["destinations"] = _deserialize_destinations( - de, _SCHEMA_CREATE_CHANNEL_OUTPUT.members["Destinations"] - ) - - case 4: - kwargs["tags"] = _deserialize_tags_list( - de, _SCHEMA_CREATE_CHANNEL_OUTPUT.members["Tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_CHANNEL_OUTPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class InvalidEventDataStoreCategoryException(ServiceError): - """ - This exception is thrown when event categories of specified event data - stores are not valid. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVALID_EVENT_DATA_STORE_CATEGORY_EXCEPTION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_EVENT_DATA_STORE_CATEGORY_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_EVENT_DATA_STORE_CATEGORY_EXCEPTION.members[ - "Message" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVALID_EVENT_DATA_STORE_CATEGORY_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InvalidSourceException(ServiceError): - """ - This exception is thrown when the specified value of `Source` is not - valid. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_SOURCE_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_SOURCE_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_SOURCE_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INVALID_SOURCE_EXCEPTION, consumer=_consumer) - return kwargs - - -CREATE_CHANNEL = APIOperation( - input=CreateChannelInput, - output=CreateChannelOutput, - schema=_SCHEMA_CREATE_CHANNEL, - input_schema=_SCHEMA_CREATE_CHANNEL_INPUT, - output_schema=_SCHEMA_CREATE_CHANNEL_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#ChannelAlreadyExistsException" - ): ChannelAlreadyExistsException, - ShapeID( - "com.amazonaws.cloudtrail#ChannelMaxLimitExceededException" - ): ChannelMaxLimitExceededException, - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreARNInvalidException" - ): EventDataStoreARNInvalidException, - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreNotFoundException" - ): EventDataStoreNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#InactiveEventDataStoreException" - ): InactiveEventDataStoreException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidEventDataStoreCategoryException" - ): InvalidEventDataStoreCategoryException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidSourceException" - ): InvalidSourceException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidTagParameterException" - ): InvalidTagParameterException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#TagsLimitExceededException" - ): TagsLimitExceededException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CHANNEL_ALREADY_EXISTS_EXCEPTION, - _SCHEMA_CHANNEL_MAX_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_EVENT_DATA_STORE_ARN_INVALID_EXCEPTION, - _SCHEMA_EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, - _SCHEMA_INACTIVE_EVENT_DATA_STORE_EXCEPTION, - _SCHEMA_INVALID_EVENT_DATA_STORE_CATEGORY_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_INVALID_SOURCE_EXCEPTION, - _SCHEMA_INVALID_TAG_PARAMETER_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_TAGS_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -class RefreshScheduleFrequencyUnit(UnknownEnumMixin, StrEnum): - HOURS = "HOURS" - DAYS = "DAYS" - - -@dataclass(kw_only=True) -class RefreshScheduleFrequency: - """ - Specifies the frequency for a dashboard refresh schedule. - - For a custom dashboard, you can schedule a refresh for every 1, 6, 12, - or 24 hours, or every day. - """ - - unit: str | None = None - """ - The unit to use for the refresh. - - For custom dashboards, the unit can be `HOURS` or `DAYS`. - - For the Highlights dashboard, the `Unit` must be `HOURS`. - """ - - value: int | None = None - """ - The value for the refresh schedule. - - For custom dashboards, the following values are valid when the unit is - `HOURS`: `1`, `6`, `12`, `24` - - For custom dashboards, the only valid value when the unit is `DAYS` is - `1`. - - For the Highlights dashboard, the `Value` must be `6`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REFRESH_SCHEDULE_FREQUENCY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.unit is not None: - serializer.write_string( - _SCHEMA_REFRESH_SCHEDULE_FREQUENCY.members["Unit"], self.unit - ) - - if self.value is not None: - serializer.write_integer( - _SCHEMA_REFRESH_SCHEDULE_FREQUENCY.members["Value"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["unit"] = RefreshScheduleFrequencyUnit( - de.read_string( - _SCHEMA_REFRESH_SCHEDULE_FREQUENCY.members["Unit"] - ) - ) - - case 1: - kwargs["value"] = de.read_integer( - _SCHEMA_REFRESH_SCHEDULE_FREQUENCY.members["Value"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_REFRESH_SCHEDULE_FREQUENCY, consumer=_consumer) - return kwargs - - -class RefreshScheduleStatus(UnknownEnumMixin, StrEnum): - ENABLED = "ENABLED" - DISABLED = "DISABLED" - - -@dataclass(kw_only=True) -class RefreshSchedule: - """The schedule for a dashboard refresh.""" - - frequency: RefreshScheduleFrequency | None = None - """The frequency at which you want the dashboard refreshed.""" - - status: str | None = None - """ - Specifies whether the refresh schedule is enabled. Set the value to - `ENABLED` to enable the refresh schedule, or to `DISABLED` to turn off - the refresh schedule. - """ - - time_of_day: str | None = None - """ - The time of day in UTC to run the schedule; for hourly only refer to - minutes; default is 00:00. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REFRESH_SCHEDULE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.frequency is not None: - serializer.write_struct( - _SCHEMA_REFRESH_SCHEDULE.members["Frequency"], self.frequency - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_REFRESH_SCHEDULE.members["Status"], self.status - ) - - if self.time_of_day is not None: - serializer.write_string( - _SCHEMA_REFRESH_SCHEDULE.members["TimeOfDay"], self.time_of_day - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["frequency"] = RefreshScheduleFrequency.deserialize(de) - - case 1: - kwargs["status"] = RefreshScheduleStatus( - de.read_string(_SCHEMA_REFRESH_SCHEDULE.members["Status"]) - ) - - case 2: - kwargs["time_of_day"] = de.read_string( - _SCHEMA_REFRESH_SCHEDULE.members["TimeOfDay"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_REFRESH_SCHEDULE, consumer=_consumer) - return kwargs - - -def _serialize_query_parameters( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_query_parameters( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_view_properties_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_view_properties_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class RequestWidget: - """Contains information about a widget on a CloudTrail Lake dashboard.""" - - query_statement: str - """ - The query statement for the widget. For custom dashboard widgets, you - can query across multiple event data stores as long as all event data - stores exist in your account. - - Note: - When a query uses `?` with `eventTime`, `?` must be surrounded by single - quotes as follows: `'?'`. - """ - - view_properties: dict[str, str] - """ - The view properties for the widget. For more information about view - properties, see [View properties for - widgets](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/lake-widget-properties.html) - in the *CloudTrail User Guide*. - """ - - query_parameters: list[str] | None = None - """ - The optional query parameters. The following query parameters are valid: - `$StartTime$`, `$EndTime$`, and `$Period$`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REQUEST_WIDGET, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_REQUEST_WIDGET.members["QueryStatement"], self.query_statement - ) - if self.query_parameters is not None: - _serialize_query_parameters( - serializer, - _SCHEMA_REQUEST_WIDGET.members["QueryParameters"], - self.query_parameters, - ) - - _serialize_view_properties_map( - serializer, - _SCHEMA_REQUEST_WIDGET.members["ViewProperties"], - self.view_properties, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["query_statement"] = de.read_string( - _SCHEMA_REQUEST_WIDGET.members["QueryStatement"] - ) - - case 1: - kwargs["query_parameters"] = _deserialize_query_parameters( - de, _SCHEMA_REQUEST_WIDGET.members["QueryParameters"] - ) - - case 2: - kwargs["view_properties"] = _deserialize_view_properties_map( - de, _SCHEMA_REQUEST_WIDGET.members["ViewProperties"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_REQUEST_WIDGET, consumer=_consumer) - if "query_statement" not in kwargs: - kwargs["query_statement"] = "" - if "view_properties" not in kwargs: - kwargs["view_properties"] = {} - return kwargs - - -def _serialize_request_widget_list( - serializer: ShapeSerializer, schema: Schema, value: list[RequestWidget] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_request_widget_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[RequestWidget]: - result: list[RequestWidget] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(RequestWidget.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CreateDashboardInput: - """Dataclass for CreateDashboardInput structure.""" - - name: str | None = None - """ - The name of the dashboard. The name must be unique to your account. - - To create the Highlights dashboard, the name must be - `AWSCloudTrail-Highlights`. - """ - - refresh_schedule: RefreshSchedule | None = None - """ - The refresh schedule configuration for the dashboard. - - To create the Highlights dashboard, you must set a refresh schedule and - set the `Status` to `ENABLED`. The `Unit` for the refresh schedule must - be `HOURS` and the `Value` must be `6`. - """ - - tags_list: list[Tag] | None = None - """A list of tags.""" - - termination_protection_enabled: bool | None = None - """ - Specifies whether termination protection is enabled for the dashboard. - If termination protection is enabled, you cannot delete the dashboard - until termination protection is disabled. - """ - - widgets: list[RequestWidget] | None = None - """ - An array of widgets for a custom dashboard. A custom dashboard can have - a maximum of ten widgets. - - You do not need to specify widgets for the Highlights dashboard. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_DASHBOARD_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_DASHBOARD_INPUT.members["Name"], self.name - ) - - if self.refresh_schedule is not None: - serializer.write_struct( - _SCHEMA_CREATE_DASHBOARD_INPUT.members["RefreshSchedule"], - self.refresh_schedule, - ) - - if self.tags_list is not None: - _serialize_tags_list( - serializer, - _SCHEMA_CREATE_DASHBOARD_INPUT.members["TagsList"], - self.tags_list, - ) - - if self.termination_protection_enabled is not None: - serializer.write_boolean( - _SCHEMA_CREATE_DASHBOARD_INPUT.members["TerminationProtectionEnabled"], - self.termination_protection_enabled, - ) - - if self.widgets is not None: - _serialize_request_widget_list( - serializer, - _SCHEMA_CREATE_DASHBOARD_INPUT.members["Widgets"], - self.widgets, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_DASHBOARD_INPUT.members["Name"] - ) - - case 1: - kwargs["refresh_schedule"] = RefreshSchedule.deserialize(de) - - case 2: - kwargs["tags_list"] = _deserialize_tags_list( - de, _SCHEMA_CREATE_DASHBOARD_INPUT.members["TagsList"] - ) - - case 3: - kwargs["termination_protection_enabled"] = de.read_boolean( - _SCHEMA_CREATE_DASHBOARD_INPUT.members[ - "TerminationProtectionEnabled" - ] - ) - - case 4: - kwargs["widgets"] = _deserialize_request_widget_list( - de, _SCHEMA_CREATE_DASHBOARD_INPUT.members["Widgets"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_DASHBOARD_INPUT, consumer=_consumer) - return kwargs - - -class DashboardType(UnknownEnumMixin, StrEnum): - MANAGED = "MANAGED" - CUSTOM = "CUSTOM" - - -@dataclass(kw_only=True) -class Widget: - """A widget on a CloudTrail Lake dashboard.""" - - query_alias: str | None = None - """The query alias used to identify the query for the widget.""" - - query_statement: str | None = None - """The SQL query statement for the widget.""" - - query_parameters: list[str] | None = None - """The query parameters for the widget.""" - - view_properties: dict[str, str] | None = None - """ - The view properties for the widget. For more information about view - properties, see [View properties for - widgets](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/lake-widget-properties.html) - in the *CloudTrail User Guide*.. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_WIDGET, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.query_alias is not None: - serializer.write_string( - _SCHEMA_WIDGET.members["QueryAlias"], self.query_alias - ) - - if self.query_statement is not None: - serializer.write_string( - _SCHEMA_WIDGET.members["QueryStatement"], self.query_statement - ) - - if self.query_parameters is not None: - _serialize_query_parameters( - serializer, - _SCHEMA_WIDGET.members["QueryParameters"], - self.query_parameters, - ) - - if self.view_properties is not None: - _serialize_view_properties_map( - serializer, - _SCHEMA_WIDGET.members["ViewProperties"], - self.view_properties, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["query_alias"] = de.read_string( - _SCHEMA_WIDGET.members["QueryAlias"] - ) - - case 1: - kwargs["query_statement"] = de.read_string( - _SCHEMA_WIDGET.members["QueryStatement"] - ) - - case 2: - kwargs["query_parameters"] = _deserialize_query_parameters( - de, _SCHEMA_WIDGET.members["QueryParameters"] - ) - - case 3: - kwargs["view_properties"] = _deserialize_view_properties_map( - de, _SCHEMA_WIDGET.members["ViewProperties"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_WIDGET, consumer=_consumer) - return kwargs - - -def _serialize_widget_list( - serializer: ShapeSerializer, schema: Schema, value: list[Widget] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_widget_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Widget]: - result: list[Widget] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Widget.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CreateDashboardOutput: - """Dataclass for CreateDashboardOutput structure.""" - - dashboard_arn: str | None = None - """The ARN for the dashboard.""" - - name: str | None = None - """The name of the dashboard.""" - - type: str | None = None - """The dashboard type.""" - - widgets: list[Widget] | None = None - """An array of widgets for the dashboard.""" - - tags_list: list[Tag] | None = None - """A list of tags.""" - - refresh_schedule: RefreshSchedule | None = None - """The refresh schedule for the dashboard, if configured.""" - - termination_protection_enabled: bool | None = None - """Indicates whether termination protection is enabled for the dashboard.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_DASHBOARD_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.dashboard_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_DASHBOARD_OUTPUT.members["DashboardArn"], - self.dashboard_arn, - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_DASHBOARD_OUTPUT.members["Name"], self.name - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_CREATE_DASHBOARD_OUTPUT.members["Type"], self.type - ) - - if self.widgets is not None: - _serialize_widget_list( - serializer, - _SCHEMA_CREATE_DASHBOARD_OUTPUT.members["Widgets"], - self.widgets, - ) - - if self.tags_list is not None: - _serialize_tags_list( - serializer, - _SCHEMA_CREATE_DASHBOARD_OUTPUT.members["TagsList"], - self.tags_list, - ) - - if self.refresh_schedule is not None: - serializer.write_struct( - _SCHEMA_CREATE_DASHBOARD_OUTPUT.members["RefreshSchedule"], - self.refresh_schedule, - ) - - if self.termination_protection_enabled is not None: - serializer.write_boolean( - _SCHEMA_CREATE_DASHBOARD_OUTPUT.members["TerminationProtectionEnabled"], - self.termination_protection_enabled, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["dashboard_arn"] = de.read_string( - _SCHEMA_CREATE_DASHBOARD_OUTPUT.members["DashboardArn"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_DASHBOARD_OUTPUT.members["Name"] - ) - - case 2: - kwargs["type"] = DashboardType( - de.read_string(_SCHEMA_CREATE_DASHBOARD_OUTPUT.members["Type"]) - ) - - case 3: - kwargs["widgets"] = _deserialize_widget_list( - de, _SCHEMA_CREATE_DASHBOARD_OUTPUT.members["Widgets"] - ) - - case 4: - kwargs["tags_list"] = _deserialize_tags_list( - de, _SCHEMA_CREATE_DASHBOARD_OUTPUT.members["TagsList"] - ) - - case 5: - kwargs["refresh_schedule"] = RefreshSchedule.deserialize(de) - - case 6: - kwargs["termination_protection_enabled"] = de.read_boolean( - _SCHEMA_CREATE_DASHBOARD_OUTPUT.members[ - "TerminationProtectionEnabled" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_DASHBOARD_OUTPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class InsufficientEncryptionPolicyException(ServiceError): - """ - For the `CreateTrail` `PutInsightSelectors`, `UpdateTrail`, - `StartQuery`, and `StartImport` operations, this exception is thrown - when the policy on the S3 bucket or KMS key does not have sufficient - permissions for the operation. - - For all other operations, this exception is thrown when the policy for - the KMS key does not have sufficient permissions for the operation. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INSUFFICIENT_ENCRYPTION_POLICY_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INSUFFICIENT_ENCRYPTION_POLICY_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INSUFFICIENT_ENCRYPTION_POLICY_EXCEPTION.members[ - "Message" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INSUFFICIENT_ENCRYPTION_POLICY_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InvalidQueryStatementException(ServiceError): - """ - The query that was submitted has validation errors, or uses incorrect - syntax or unsupported keywords. For more information about writing a - query, see [Create or edit a - query](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-create-edit-query.html) - in the *CloudTrail User Guide*. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_QUERY_STATEMENT_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_QUERY_STATEMENT_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_QUERY_STATEMENT_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVALID_QUERY_STATEMENT_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ServiceQuotaExceededException(ServiceError): - """ - This exception is thrown when the quota is exceeded. For information - about CloudTrail quotas, see [Service - quotas](https://docs.aws.amazon.com/general/latest/gr/ct.html#limits_cloudtrail) - in the *Amazon Web Services General Reference*. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -CREATE_DASHBOARD = APIOperation( - input=CreateDashboardInput, - output=CreateDashboardOutput, - schema=_SCHEMA_CREATE_DASHBOARD, - input_schema=_SCHEMA_CREATE_DASHBOARD_INPUT, - output_schema=_SCHEMA_CREATE_DASHBOARD_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.cloudtrail#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreNotFoundException" - ): EventDataStoreNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#InactiveEventDataStoreException" - ): InactiveEventDataStoreException, - ShapeID( - "com.amazonaws.cloudtrail#InsufficientEncryptionPolicyException" - ): InsufficientEncryptionPolicyException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidQueryStatementException" - ): InvalidQueryStatementException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidTagParameterException" - ): InvalidTagParameterException, - ShapeID( - "com.amazonaws.cloudtrail#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, - _SCHEMA_INACTIVE_EVENT_DATA_STORE_EXCEPTION, - _SCHEMA_INSUFFICIENT_ENCRYPTION_POLICY_EXCEPTION, - _SCHEMA_INVALID_QUERY_STATEMENT_EXCEPTION, - _SCHEMA_INVALID_TAG_PARAMETER_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class CloudTrailAccessNotEnabledException(ServiceError): - """ - This exception is thrown when trusted access has not been enabled - between CloudTrail and Organizations. For more information, see [How to - enable or disable trusted - access](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html#orgs_how-to-enable-disable-trusted-access) - in the *Organizations User Guide* and [Prepare For Creating a Trail For - Your - Organization](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html) - in the *CloudTrail User Guide*. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CLOUD_TRAIL_ACCESS_NOT_ENABLED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_CLOUD_TRAIL_ACCESS_NOT_ENABLED_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_CLOUD_TRAIL_ACCESS_NOT_ENABLED_EXCEPTION.members[ - "Message" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CLOUD_TRAIL_ACCESS_NOT_ENABLED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CreateEventDataStoreInput: - """Dataclass for CreateEventDataStoreInput structure.""" - - name: str | None = None - """The name of the event data store.""" - - advanced_event_selectors: list[AdvancedEventSelector] | None = None - """ - The advanced event selectors to use to select the events for the data - store. You can configure up to five advanced event selectors for each - event data store. - - For more information about how to use advanced event selectors to log - CloudTrail events, see [Log events by using advanced event - selectors](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html#creating-data-event-selectors-advanced) - in the CloudTrail User Guide. - - For more information about how to use advanced event selectors to - include Config configuration items in your event data store, see [Create - an event data store for Config configuration - items](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/lake-eds-cli.html#lake-cli-create-eds-config) - in the CloudTrail User Guide. - - For more information about how to use advanced event selectors to - include events outside of Amazon Web Services events in your event data - store, see [Create an integration to log events from outside Amazon Web - Services](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/lake-integrations-cli.html#lake-cli-create-integration) - in the CloudTrail User Guide. - """ - - multi_region_enabled: bool | None = None - """ - Specifies whether the event data store includes events from all Regions, - or only from the Region in which the event data store is created. - """ - - organization_enabled: bool | None = None - """ - Specifies whether an event data store collects events logged for an - organization in Organizations. - """ - - retention_period: int | None = None - """ - The retention period of the event data store, in days. If `BillingMode` - is set to `EXTENDABLE_RETENTION_PRICING`, you can set a retention period - of up to 3653 days, the equivalent of 10 years. If `BillingMode` is set - to `FIXED_RETENTION_PRICING`, you can set a retention period of up to - 2557 days, the equivalent of seven years. - - CloudTrail Lake determines whether to retain an event by checking if the - `eventTime` of the event is within the specified retention period. For - example, if you set a retention period of 90 days, CloudTrail will - remove events when the `eventTime` is older than 90 days. - - Note: - If you plan to copy trail events to this event data store, we recommend - that you consider both the age of the events that you want to copy as - well as how long you want to keep the copied events in your event data - store. For example, if you copy trail events that are 5 years old and - specify a retention period of 7 years, the event data store will retain - those events for two years. - """ - - termination_protection_enabled: bool | None = None - """ - Specifies whether termination protection is enabled for the event data - store. If termination protection is enabled, you cannot delete the event - data store until termination protection is disabled. - """ - - tags_list: list[Tag] | None = None - """A list of tags.""" - - kms_key_id: str | None = None - """ - Specifies the KMS key ID to use to encrypt the events delivered by - CloudTrail. The value can be an alias name prefixed by `alias/`, a fully - specified ARN to an alias, a fully specified ARN to a key, or a globally - unique identifier. - - Warning: - Disabling or deleting the KMS key, or removing CloudTrail permissions on - the key, prevents CloudTrail from logging events to the event data - store, and prevents users from querying the data in the event data store - that was encrypted with the key. After you associate an event data store - with a KMS key, the KMS key cannot be removed or changed. Before you - disable or delete a KMS key that you are using with an event data store, - delete or back up your event data store. - - CloudTrail also supports KMS multi-Region keys. For more information - about multi-Region keys, see [Using multi-Region - keys](https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html) - in the *Key Management Service Developer Guide*. - - Examples: - - - `alias/MyAliasName` - - - `arn:aws:kms:us-east-2:123456789012:alias/MyAliasName` - - - `arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012` - - - `12345678-1234-1234-1234-123456789012` - """ - - start_ingestion: bool | None = None - """ - Specifies whether the event data store should start ingesting live - events. The default is true. - """ - - billing_mode: str | None = None - """ - The billing mode for the event data store determines the cost for - ingesting events and the default and maximum retention period for the - event data store. - - The following are the possible values: - - - `EXTENDABLE_RETENTION_PRICING` - This billing mode is generally - recommended if you want a flexible retention period of up to 3653 days - (about 10 years). The default retention period for this billing mode - is 366 days. - - - `FIXED_RETENTION_PRICING` - This billing mode is recommended if you - expect to ingest more than 25 TB of event data per month and need a - retention period of up to 2557 days (about 7 years). The default - retention period for this billing mode is 2557 days. - - The default value is `EXTENDABLE_RETENTION_PRICING`. - - For more information about CloudTrail pricing, see [CloudTrail - Pricing](http://aws.amazon.com/cloudtrail/pricing/) and [Managing - CloudTrail Lake - costs](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake-manage-costs.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_EVENT_DATA_STORE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_EVENT_DATA_STORE_INPUT.members["Name"], self.name - ) - - if self.advanced_event_selectors is not None: - _serialize_advanced_event_selectors( - serializer, - _SCHEMA_CREATE_EVENT_DATA_STORE_INPUT.members["AdvancedEventSelectors"], - self.advanced_event_selectors, - ) - - if self.multi_region_enabled is not None: - serializer.write_boolean( - _SCHEMA_CREATE_EVENT_DATA_STORE_INPUT.members["MultiRegionEnabled"], - self.multi_region_enabled, - ) - - if self.organization_enabled is not None: - serializer.write_boolean( - _SCHEMA_CREATE_EVENT_DATA_STORE_INPUT.members["OrganizationEnabled"], - self.organization_enabled, - ) - - if self.retention_period is not None: - serializer.write_integer( - _SCHEMA_CREATE_EVENT_DATA_STORE_INPUT.members["RetentionPeriod"], - self.retention_period, - ) - - if self.termination_protection_enabled is not None: - serializer.write_boolean( - _SCHEMA_CREATE_EVENT_DATA_STORE_INPUT.members[ - "TerminationProtectionEnabled" - ], - self.termination_protection_enabled, - ) - - if self.tags_list is not None: - _serialize_tags_list( - serializer, - _SCHEMA_CREATE_EVENT_DATA_STORE_INPUT.members["TagsList"], - self.tags_list, - ) - - if self.kms_key_id is not None: - serializer.write_string( - _SCHEMA_CREATE_EVENT_DATA_STORE_INPUT.members["KmsKeyId"], - self.kms_key_id, - ) - - if self.start_ingestion is not None: - serializer.write_boolean( - _SCHEMA_CREATE_EVENT_DATA_STORE_INPUT.members["StartIngestion"], - self.start_ingestion, - ) - - if self.billing_mode is not None: - serializer.write_string( - _SCHEMA_CREATE_EVENT_DATA_STORE_INPUT.members["BillingMode"], - self.billing_mode, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_EVENT_DATA_STORE_INPUT.members["Name"] - ) - - case 1: - kwargs["advanced_event_selectors"] = ( - _deserialize_advanced_event_selectors( - de, - _SCHEMA_CREATE_EVENT_DATA_STORE_INPUT.members[ - "AdvancedEventSelectors" - ], - ) - ) - - case 2: - kwargs["multi_region_enabled"] = de.read_boolean( - _SCHEMA_CREATE_EVENT_DATA_STORE_INPUT.members[ - "MultiRegionEnabled" - ] - ) - - case 3: - kwargs["organization_enabled"] = de.read_boolean( - _SCHEMA_CREATE_EVENT_DATA_STORE_INPUT.members[ - "OrganizationEnabled" - ] - ) - - case 4: - kwargs["retention_period"] = de.read_integer( - _SCHEMA_CREATE_EVENT_DATA_STORE_INPUT.members["RetentionPeriod"] - ) - - case 5: - kwargs["termination_protection_enabled"] = de.read_boolean( - _SCHEMA_CREATE_EVENT_DATA_STORE_INPUT.members[ - "TerminationProtectionEnabled" - ] - ) - - case 6: - kwargs["tags_list"] = _deserialize_tags_list( - de, _SCHEMA_CREATE_EVENT_DATA_STORE_INPUT.members["TagsList"] - ) - - case 7: - kwargs["kms_key_id"] = de.read_string( - _SCHEMA_CREATE_EVENT_DATA_STORE_INPUT.members["KmsKeyId"] - ) - - case 8: - kwargs["start_ingestion"] = de.read_boolean( - _SCHEMA_CREATE_EVENT_DATA_STORE_INPUT.members["StartIngestion"] - ) - - case 9: - kwargs["billing_mode"] = BillingMode( - de.read_string( - _SCHEMA_CREATE_EVENT_DATA_STORE_INPUT.members["BillingMode"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_EVENT_DATA_STORE_INPUT, consumer=_consumer - ) - return kwargs - - -class EventDataStoreStatus(UnknownEnumMixin, StrEnum): - CREATED = "CREATED" - ENABLED = "ENABLED" - PENDING_DELETION = "PENDING_DELETION" - STARTING_INGESTION = "STARTING_INGESTION" - STOPPING_INGESTION = "STOPPING_INGESTION" - STOPPED_INGESTION = "STOPPED_INGESTION" - - -@dataclass(kw_only=True) -class CreateEventDataStoreOutput: - """Dataclass for CreateEventDataStoreOutput structure.""" - - event_data_store_arn: str | None = None - """The ARN of the event data store.""" - - name: str | None = None - """The name of the event data store.""" - - status: str | None = None - """The status of event data store creation.""" - - advanced_event_selectors: list[AdvancedEventSelector] | None = None - """ - The advanced event selectors that were used to select the events for the - data store. - """ - - multi_region_enabled: bool | None = None - """ - Indicates whether the event data store collects events from all Regions, - or only from the Region in which it was created. - """ - - organization_enabled: bool | None = None - """ - Indicates whether an event data store is collecting logged events for an - organization in Organizations. - """ - - retention_period: int | None = None - """The retention period of an event data store, in days.""" - - termination_protection_enabled: bool | None = None - """ - Indicates whether termination protection is enabled for the event data - store. - """ - - tags_list: list[Tag] | None = None - """A list of tags.""" - - created_timestamp: datetime | None = None - """The timestamp that shows when the event data store was created.""" - - updated_timestamp: datetime | None = None - """ - The timestamp that shows when an event data store was updated, if - applicable. `UpdatedTimestamp` is always either the same or newer than - the time shown in `CreatedTimestamp`. - """ - - kms_key_id: str | None = None - """ - Specifies the KMS key ID that encrypts the events delivered by - CloudTrail. The value is a fully specified ARN to a KMS key in the - following format. - - `arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012` - """ - - billing_mode: str | None = None - """The billing mode for the event data store.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_EVENT_DATA_STORE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.event_data_store_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_EVENT_DATA_STORE_OUTPUT.members["EventDataStoreArn"], - self.event_data_store_arn, - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_EVENT_DATA_STORE_OUTPUT.members["Name"], self.name - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_CREATE_EVENT_DATA_STORE_OUTPUT.members["Status"], self.status - ) - - if self.advanced_event_selectors is not None: - _serialize_advanced_event_selectors( - serializer, - _SCHEMA_CREATE_EVENT_DATA_STORE_OUTPUT.members[ - "AdvancedEventSelectors" - ], - self.advanced_event_selectors, - ) - - if self.multi_region_enabled is not None: - serializer.write_boolean( - _SCHEMA_CREATE_EVENT_DATA_STORE_OUTPUT.members["MultiRegionEnabled"], - self.multi_region_enabled, - ) - - if self.organization_enabled is not None: - serializer.write_boolean( - _SCHEMA_CREATE_EVENT_DATA_STORE_OUTPUT.members["OrganizationEnabled"], - self.organization_enabled, - ) - - if self.retention_period is not None: - serializer.write_integer( - _SCHEMA_CREATE_EVENT_DATA_STORE_OUTPUT.members["RetentionPeriod"], - self.retention_period, - ) - - if self.termination_protection_enabled is not None: - serializer.write_boolean( - _SCHEMA_CREATE_EVENT_DATA_STORE_OUTPUT.members[ - "TerminationProtectionEnabled" - ], - self.termination_protection_enabled, - ) - - if self.tags_list is not None: - _serialize_tags_list( - serializer, - _SCHEMA_CREATE_EVENT_DATA_STORE_OUTPUT.members["TagsList"], - self.tags_list, - ) - - if self.created_timestamp is not None: - serializer.write_timestamp( - _SCHEMA_CREATE_EVENT_DATA_STORE_OUTPUT.members["CreatedTimestamp"], - self.created_timestamp, - ) - - if self.updated_timestamp is not None: - serializer.write_timestamp( - _SCHEMA_CREATE_EVENT_DATA_STORE_OUTPUT.members["UpdatedTimestamp"], - self.updated_timestamp, - ) - - if self.kms_key_id is not None: - serializer.write_string( - _SCHEMA_CREATE_EVENT_DATA_STORE_OUTPUT.members["KmsKeyId"], - self.kms_key_id, - ) - - if self.billing_mode is not None: - serializer.write_string( - _SCHEMA_CREATE_EVENT_DATA_STORE_OUTPUT.members["BillingMode"], - self.billing_mode, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["event_data_store_arn"] = de.read_string( - _SCHEMA_CREATE_EVENT_DATA_STORE_OUTPUT.members[ - "EventDataStoreArn" - ] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_EVENT_DATA_STORE_OUTPUT.members["Name"] - ) - - case 2: - kwargs["status"] = EventDataStoreStatus( - de.read_string( - _SCHEMA_CREATE_EVENT_DATA_STORE_OUTPUT.members["Status"] - ) - ) - - case 3: - kwargs["advanced_event_selectors"] = ( - _deserialize_advanced_event_selectors( - de, - _SCHEMA_CREATE_EVENT_DATA_STORE_OUTPUT.members[ - "AdvancedEventSelectors" - ], - ) - ) - - case 4: - kwargs["multi_region_enabled"] = de.read_boolean( - _SCHEMA_CREATE_EVENT_DATA_STORE_OUTPUT.members[ - "MultiRegionEnabled" - ] - ) - - case 5: - kwargs["organization_enabled"] = de.read_boolean( - _SCHEMA_CREATE_EVENT_DATA_STORE_OUTPUT.members[ - "OrganizationEnabled" - ] - ) - - case 6: - kwargs["retention_period"] = de.read_integer( - _SCHEMA_CREATE_EVENT_DATA_STORE_OUTPUT.members[ - "RetentionPeriod" - ] - ) - - case 7: - kwargs["termination_protection_enabled"] = de.read_boolean( - _SCHEMA_CREATE_EVENT_DATA_STORE_OUTPUT.members[ - "TerminationProtectionEnabled" - ] - ) - - case 8: - kwargs["tags_list"] = _deserialize_tags_list( - de, _SCHEMA_CREATE_EVENT_DATA_STORE_OUTPUT.members["TagsList"] - ) - - case 9: - kwargs["created_timestamp"] = de.read_timestamp( - _SCHEMA_CREATE_EVENT_DATA_STORE_OUTPUT.members[ - "CreatedTimestamp" - ] - ) - - case 10: - kwargs["updated_timestamp"] = de.read_timestamp( - _SCHEMA_CREATE_EVENT_DATA_STORE_OUTPUT.members[ - "UpdatedTimestamp" - ] - ) - - case 11: - kwargs["kms_key_id"] = de.read_string( - _SCHEMA_CREATE_EVENT_DATA_STORE_OUTPUT.members["KmsKeyId"] - ) - - case 12: - kwargs["billing_mode"] = BillingMode( - de.read_string( - _SCHEMA_CREATE_EVENT_DATA_STORE_OUTPUT.members[ - "BillingMode" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_EVENT_DATA_STORE_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class EventDataStoreAlreadyExistsException(ServiceError): - """An event data store with that name already exists.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVENT_DATA_STORE_ALREADY_EXISTS_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_EVENT_DATA_STORE_ALREADY_EXISTS_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_EVENT_DATA_STORE_ALREADY_EXISTS_EXCEPTION.members[ - "Message" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EVENT_DATA_STORE_ALREADY_EXISTS_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class EventDataStoreMaxLimitExceededException(ServiceError): - """Your account has used the maximum number of event data stores.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_EVENT_DATA_STORE_MAX_LIMIT_EXCEEDED_EXCEPTION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_EVENT_DATA_STORE_MAX_LIMIT_EXCEEDED_EXCEPTION.members[ - "Message" - ], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_EVENT_DATA_STORE_MAX_LIMIT_EXCEEDED_EXCEPTION.members[ - "Message" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EVENT_DATA_STORE_MAX_LIMIT_EXCEEDED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InsufficientDependencyServiceAccessPermissionException(ServiceError): - """ - This exception is thrown when the IAM identity that is used to create - the organization resource lacks one or more required permissions for - creating an organization resource in a required service. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INSUFFICIENT_DEPENDENCY_SERVICE_ACCESS_PERMISSION_EXCEPTION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INSUFFICIENT_DEPENDENCY_SERVICE_ACCESS_PERMISSION_EXCEPTION.members[ - "Message" - ], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INSUFFICIENT_DEPENDENCY_SERVICE_ACCESS_PERMISSION_EXCEPTION.members[ - "Message" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INSUFFICIENT_DEPENDENCY_SERVICE_ACCESS_PERMISSION_EXCEPTION, - consumer=_consumer, - ) - return kwargs - - -@dataclass(kw_only=True) -class InvalidEventSelectorsException(ServiceError): - """ - This exception is thrown when the `PutEventSelectors` operation is - called with a number of event selectors, advanced event selectors, or - data resources that is not valid. The combination of event selectors or - advanced event selectors and data resources is not valid. A trail can - have up to 5 event selectors. If a trail uses advanced event selectors, - a maximum of 500 total values for all conditions in all advanced event - selectors is allowed. A trail is limited to 250 data resources. These - data resources can be distributed across event selectors, but the - overall total cannot exceed 250. - - You can: - - - Specify a valid number of event selectors (1 to 5) for a trail. - - - Specify a valid number of data resources (1 to 250) for an event - selector. The limit of number of resources on an individual event - selector is configurable up to 250. However, this upper limit is - allowed only if the total number of data resources does not exceed 250 - across all event selectors for a trail. - - - Specify up to 500 values for all conditions in all advanced event - selectors for a trail. - - - Specify a valid value for a parameter. For example, specifying the - `ReadWriteType` parameter with a value of `read-only` is not valid. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_EVENT_SELECTORS_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_EVENT_SELECTORS_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_EVENT_SELECTORS_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVALID_EVENT_SELECTORS_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InvalidKmsKeyIdException(ServiceError): - """This exception is thrown when the KMS key ARN is not valid.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_KMS_KEY_ID_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_KMS_KEY_ID_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_KMS_KEY_ID_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVALID_KMS_KEY_ID_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class KmsException(ServiceError): - """ - This exception is thrown when there is an issue with the specified KMS - key and the trail or event data store can't be updated. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KMS_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_KMS_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_KMS_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_KMS_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class KmsKeyNotFoundException(ServiceError): - """ - This exception is thrown when the KMS key does not exist, when the S3 - bucket and the KMS key are not in the same Region, or when the KMS key - associated with the Amazon SNS topic either does not exist or is not in - the same Region. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KMS_KEY_NOT_FOUND_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_KMS_KEY_NOT_FOUND_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_KMS_KEY_NOT_FOUND_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_KMS_KEY_NOT_FOUND_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class OrganizationNotInAllFeaturesModeException(ServiceError): - """ - This exception is thrown when Organizations is not configured to support - all features. All features must be enabled in Organizations to support - creating an organization trail or event data store. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_ORGANIZATION_NOT_IN_ALL_FEATURES_MODE_EXCEPTION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_ORGANIZATION_NOT_IN_ALL_FEATURES_MODE_EXCEPTION.members[ - "Message" - ], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_ORGANIZATION_NOT_IN_ALL_FEATURES_MODE_EXCEPTION.members[ - "Message" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ORGANIZATION_NOT_IN_ALL_FEATURES_MODE_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class OrganizationsNotInUseException(ServiceError): - """ - This exception is thrown when the request is made from an Amazon Web - Services account that is not a member of an organization. To make this - request, sign in using the credentials of an account that belongs to an - organization. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ORGANIZATIONS_NOT_IN_USE_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_ORGANIZATIONS_NOT_IN_USE_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_ORGANIZATIONS_NOT_IN_USE_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ORGANIZATIONS_NOT_IN_USE_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ThrottlingException(ServiceError): - """This exception is thrown when the request rate exceeds the limit.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_THROTTLING_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_THROTTLING_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_THROTTLING_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_THROTTLING_EXCEPTION, consumer=_consumer) - return kwargs - - -CREATE_EVENT_DATA_STORE = APIOperation( - input=CreateEventDataStoreInput, - output=CreateEventDataStoreOutput, - schema=_SCHEMA_CREATE_EVENT_DATA_STORE, - input_schema=_SCHEMA_CREATE_EVENT_DATA_STORE_INPUT, - output_schema=_SCHEMA_CREATE_EVENT_DATA_STORE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#CloudTrailAccessNotEnabledException" - ): CloudTrailAccessNotEnabledException, - ShapeID("com.amazonaws.cloudtrail#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreAlreadyExistsException" - ): EventDataStoreAlreadyExistsException, - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreMaxLimitExceededException" - ): EventDataStoreMaxLimitExceededException, - ShapeID( - "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException" - ): InsufficientDependencyServiceAccessPermissionException, - ShapeID( - "com.amazonaws.cloudtrail#InsufficientEncryptionPolicyException" - ): InsufficientEncryptionPolicyException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidEventSelectorsException" - ): InvalidEventSelectorsException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidKmsKeyIdException" - ): InvalidKmsKeyIdException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidTagParameterException" - ): InvalidTagParameterException, - ShapeID("com.amazonaws.cloudtrail#KmsException"): KmsException, - ShapeID( - "com.amazonaws.cloudtrail#KmsKeyNotFoundException" - ): KmsKeyNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException" - ): NoManagementAccountSLRExistsException, - ShapeID( - "com.amazonaws.cloudtrail#NotOrganizationMasterAccountException" - ): NotOrganizationMasterAccountException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#OrganizationNotInAllFeaturesModeException" - ): OrganizationNotInAllFeaturesModeException, - ShapeID( - "com.amazonaws.cloudtrail#OrganizationsNotInUseException" - ): OrganizationsNotInUseException, - ShapeID( - "com.amazonaws.cloudtrail#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CLOUD_TRAIL_ACCESS_NOT_ENABLED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_EVENT_DATA_STORE_ALREADY_EXISTS_EXCEPTION, - _SCHEMA_EVENT_DATA_STORE_MAX_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_INSUFFICIENT_DEPENDENCY_SERVICE_ACCESS_PERMISSION_EXCEPTION, - _SCHEMA_INSUFFICIENT_ENCRYPTION_POLICY_EXCEPTION, - _SCHEMA_INVALID_EVENT_SELECTORS_EXCEPTION, - _SCHEMA_INVALID_KMS_KEY_ID_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_INVALID_TAG_PARAMETER_EXCEPTION, - _SCHEMA_KMS_EXCEPTION, - _SCHEMA_KMS_KEY_NOT_FOUND_EXCEPTION, - _SCHEMA_NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, - _SCHEMA_NOT_ORGANIZATION_MASTER_ACCOUNT_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_ORGANIZATION_NOT_IN_ALL_FEATURES_MODE_EXCEPTION, - _SCHEMA_ORGANIZATIONS_NOT_IN_USE_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class CloudTrailInvalidClientTokenIdException(ServiceError): - """ - This exception is thrown when a call results in the - `InvalidClientTokenId` error code. This can occur when you are creating - or updating a trail to send notifications to an Amazon SNS topic that is - in a suspended Amazon Web Services account. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CLOUD_TRAIL_INVALID_CLIENT_TOKEN_ID_EXCEPTION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_CLOUD_TRAIL_INVALID_CLIENT_TOKEN_ID_EXCEPTION.members[ - "Message" - ], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_CLOUD_TRAIL_INVALID_CLIENT_TOKEN_ID_EXCEPTION.members[ - "Message" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CLOUD_TRAIL_INVALID_CLIENT_TOKEN_ID_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CloudWatchLogsDeliveryUnavailableException(ServiceError): - """Cannot set a CloudWatch Logs delivery for this Region.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CLOUD_WATCH_LOGS_DELIVERY_UNAVAILABLE_EXCEPTION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_CLOUD_WATCH_LOGS_DELIVERY_UNAVAILABLE_EXCEPTION.members[ - "Message" - ], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_CLOUD_WATCH_LOGS_DELIVERY_UNAVAILABLE_EXCEPTION.members[ - "Message" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CLOUD_WATCH_LOGS_DELIVERY_UNAVAILABLE_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CreateTrailInput: - """Specifies the settings for each trail.""" - - name: str | None = None - """ - Specifies the name of the trail. The name must meet the following - requirements: - - - Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), - underscores (_), or dashes (-) - - - Start with a letter or number, and end with a letter or number - - - Be between 3 and 128 characters - - - Have no adjacent periods, underscores or dashes. Names like - `my-_namespace` and `my--namespace` are not valid. - - - Not be in IP address format (for example, 192.168.5.4) - """ - - s3_bucket_name: str | None = None - """ - Specifies the name of the Amazon S3 bucket designated for publishing log - files. For information about bucket naming rules, see [Bucket naming - rules](https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html) - in the *Amazon Simple Storage Service User Guide*. - """ - - s3_key_prefix: str | None = None - """ - Specifies the Amazon S3 key prefix that comes after the name of the - bucket you have designated for log file delivery. For more information, - see [Finding Your CloudTrail Log - Files](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/get-and-view-cloudtrail-log-files.html#cloudtrail-find-log-files). - The maximum length is 200 characters. - """ - - sns_topic_name: str | None = None - """ - Specifies the name or ARN of the Amazon SNS topic defined for - notification of log file delivery. The maximum length is 256 characters. - """ - - include_global_service_events: bool | None = None - """ - Specifies whether the trail is publishing events from global services - such as IAM to the log files. Setting this value to `true` only delivers - global service events to the trail if the trail is multi-Region or if - the trail's home Region is the partition leader Region (for example, - us-east-1). - """ - - is_multi_region_trail: bool | None = None - """ - Specifies whether the trail is created in the current Region or in all - Regions. The default is false, which creates a trail only in the Region - where you are signed in. As a best practice, consider creating trails - that log events in all Regions. - """ - - enable_log_file_validation: bool | None = None - """ - Specifies whether log file integrity validation is enabled. The default - is false. - - Note: - When you disable log file integrity validation, the chain of digest - files is broken after one hour. CloudTrail does not create digest files - for log files that were delivered during a period in which log file - integrity validation was disabled. For example, if you enable log file - integrity validation at noon on January 1, disable it at noon on January - 2, and re-enable it at noon on January 10, digest files will not be - created for the log files delivered from noon on January 2 to noon on - January 10. The same applies whenever you stop CloudTrail logging or - delete a trail. - """ - - cloud_watch_logs_log_group_arn: str | None = None - """ - Specifies a log group name using an Amazon Resource Name (ARN), a unique - identifier that represents the log group to which CloudTrail logs will - be delivered. You must use a log group that exists in your account. - - Not required unless you specify `CloudWatchLogsRoleArn`. - """ - - cloud_watch_logs_role_arn: str | None = None - """ - Specifies the role for the CloudWatch Logs endpoint to assume to write - to a user's log group. You must use a role that exists in your account. - """ - - kms_key_id: str | None = None - """ - Specifies the KMS key ID to use to encrypt the logs and digest files - delivered by CloudTrail. The value can be an alias name prefixed by - `alias/`, a fully specified ARN to an alias, a fully specified ARN to a - key, or a globally unique identifier. - - CloudTrail also supports KMS multi-Region keys. For more information - about multi-Region keys, see [Using multi-Region - keys](https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html) - in the *Key Management Service Developer Guide*. - - Examples: - - - `alias/MyAliasName` - - - `arn:aws:kms:us-east-2:123456789012:alias/MyAliasName` - - - `arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012` - - - `12345678-1234-1234-1234-123456789012` - """ - - is_organization_trail: bool | None = None - """ - Specifies whether the trail is created for all accounts in an - organization in Organizations, or only for the current Amazon Web - Services account. The default is false, and cannot be true unless the - call is made on behalf of an Amazon Web Services account that is the - management account or delegated administrator account for an - organization in Organizations. - """ - - tags_list: list[Tag] | None = None - """A list of tags.""" - - recursive_logging: bool | None = None - """ - Specifies whether recursive logging is enabled for the trail. If you set - `RecursiveLogging` to `false`, CloudTrail suppresses events generated by - CloudTrail when it delivers log files to your trail's destinations, - including Amazon S3 and CloudWatch Logs. The default value is `true`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_TRAIL_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_TRAIL_INPUT.members["Name"], self.name - ) - - if self.s3_bucket_name is not None: - serializer.write_string( - _SCHEMA_CREATE_TRAIL_INPUT.members["S3BucketName"], self.s3_bucket_name - ) - - if self.s3_key_prefix is not None: - serializer.write_string( - _SCHEMA_CREATE_TRAIL_INPUT.members["S3KeyPrefix"], self.s3_key_prefix - ) - - if self.sns_topic_name is not None: - serializer.write_string( - _SCHEMA_CREATE_TRAIL_INPUT.members["SnsTopicName"], self.sns_topic_name - ) - - if self.include_global_service_events is not None: - serializer.write_boolean( - _SCHEMA_CREATE_TRAIL_INPUT.members["IncludeGlobalServiceEvents"], - self.include_global_service_events, - ) - - if self.is_multi_region_trail is not None: - serializer.write_boolean( - _SCHEMA_CREATE_TRAIL_INPUT.members["IsMultiRegionTrail"], - self.is_multi_region_trail, - ) - - if self.enable_log_file_validation is not None: - serializer.write_boolean( - _SCHEMA_CREATE_TRAIL_INPUT.members["EnableLogFileValidation"], - self.enable_log_file_validation, - ) - - if self.cloud_watch_logs_log_group_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_TRAIL_INPUT.members["CloudWatchLogsLogGroupArn"], - self.cloud_watch_logs_log_group_arn, - ) - - if self.cloud_watch_logs_role_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_TRAIL_INPUT.members["CloudWatchLogsRoleArn"], - self.cloud_watch_logs_role_arn, - ) - - if self.kms_key_id is not None: - serializer.write_string( - _SCHEMA_CREATE_TRAIL_INPUT.members["KmsKeyId"], self.kms_key_id - ) - - if self.is_organization_trail is not None: - serializer.write_boolean( - _SCHEMA_CREATE_TRAIL_INPUT.members["IsOrganizationTrail"], - self.is_organization_trail, - ) - - if self.tags_list is not None: - _serialize_tags_list( - serializer, - _SCHEMA_CREATE_TRAIL_INPUT.members["TagsList"], - self.tags_list, - ) - - if self.recursive_logging is not None: - serializer.write_boolean( - _SCHEMA_CREATE_TRAIL_INPUT.members["RecursiveLogging"], - self.recursive_logging, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_TRAIL_INPUT.members["Name"] - ) - - case 1: - kwargs["s3_bucket_name"] = de.read_string( - _SCHEMA_CREATE_TRAIL_INPUT.members["S3BucketName"] - ) - - case 2: - kwargs["s3_key_prefix"] = de.read_string( - _SCHEMA_CREATE_TRAIL_INPUT.members["S3KeyPrefix"] - ) - - case 3: - kwargs["sns_topic_name"] = de.read_string( - _SCHEMA_CREATE_TRAIL_INPUT.members["SnsTopicName"] - ) - - case 4: - kwargs["include_global_service_events"] = de.read_boolean( - _SCHEMA_CREATE_TRAIL_INPUT.members["IncludeGlobalServiceEvents"] - ) - - case 5: - kwargs["is_multi_region_trail"] = de.read_boolean( - _SCHEMA_CREATE_TRAIL_INPUT.members["IsMultiRegionTrail"] - ) - - case 6: - kwargs["enable_log_file_validation"] = de.read_boolean( - _SCHEMA_CREATE_TRAIL_INPUT.members["EnableLogFileValidation"] - ) - - case 7: - kwargs["cloud_watch_logs_log_group_arn"] = de.read_string( - _SCHEMA_CREATE_TRAIL_INPUT.members["CloudWatchLogsLogGroupArn"] - ) - - case 8: - kwargs["cloud_watch_logs_role_arn"] = de.read_string( - _SCHEMA_CREATE_TRAIL_INPUT.members["CloudWatchLogsRoleArn"] - ) - - case 9: - kwargs["kms_key_id"] = de.read_string( - _SCHEMA_CREATE_TRAIL_INPUT.members["KmsKeyId"] - ) - - case 10: - kwargs["is_organization_trail"] = de.read_boolean( - _SCHEMA_CREATE_TRAIL_INPUT.members["IsOrganizationTrail"] - ) - - case 11: - kwargs["tags_list"] = _deserialize_tags_list( - de, _SCHEMA_CREATE_TRAIL_INPUT.members["TagsList"] - ) - - case 12: - kwargs["recursive_logging"] = de.read_boolean( - _SCHEMA_CREATE_TRAIL_INPUT.members["RecursiveLogging"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_TRAIL_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CreateTrailOutput: - """ - Returns the objects or data listed below if successful. Otherwise, - returns an error. - """ - - name: str | None = None - """Specifies the name of the trail.""" - - s3_bucket_name: str | None = None - """ - Specifies the name of the Amazon S3 bucket designated for publishing log - files. - """ - - s3_key_prefix: str | None = None - """ - Specifies the Amazon S3 key prefix that comes after the name of the - bucket you have designated for log file delivery. For more information, - see [Finding Your CloudTrail Log - Files](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/get-and-view-cloudtrail-log-files.html#cloudtrail-find-log-files). - """ - - sns_topic_name: str | None = None - """This field is no longer in use. Use `SnsTopicARN`.""" - - sns_topic_arn: str | None = None - """ - Specifies the ARN of the Amazon SNS topic that CloudTrail uses to send - notifications when log files are delivered. The format of a topic ARN - is: - - `arn:aws:sns:us-east-2:123456789012:MyTopic` - """ - - include_global_service_events: bool | None = None - """ - Specifies whether the trail is publishing events from global services - such as IAM to the log files. Setting this value to `true` only delivers - global service events to the trail if the trail is multi-Region or if - the trail's home Region is the partition leader Region (for example, - us-east-1). - """ - - is_multi_region_trail: bool | None = None - """Specifies whether the trail exists in one Region or in all Regions.""" - - trail_arn: str | None = None - """ - Specifies the ARN of the trail that was created. The format of a trail - ARN is: - - `arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail` - """ - - log_file_validation_enabled: bool | None = None - """Specifies whether log file integrity validation is enabled.""" - - cloud_watch_logs_log_group_arn: str | None = None - """ - Specifies the Amazon Resource Name (ARN) of the log group to which - CloudTrail logs will be delivered. - """ - - cloud_watch_logs_role_arn: str | None = None - """ - Specifies the role for the CloudWatch Logs endpoint to assume to write - to a user's log group. - """ - - kms_key_id: str | None = None - """ - Specifies the KMS key ID that encrypts the events delivered by - CloudTrail. The value is a fully specified ARN to a KMS key in the - following format. - - `arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012` - """ - - is_organization_trail: bool | None = None - """Specifies whether the trail is an organization trail.""" - - recursive_logging: bool | None = None - """Specifies whether recursive logging is enabled for the trail.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_TRAIL_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_TRAIL_OUTPUT.members["Name"], self.name - ) - - if self.s3_bucket_name is not None: - serializer.write_string( - _SCHEMA_CREATE_TRAIL_OUTPUT.members["S3BucketName"], self.s3_bucket_name - ) - - if self.s3_key_prefix is not None: - serializer.write_string( - _SCHEMA_CREATE_TRAIL_OUTPUT.members["S3KeyPrefix"], self.s3_key_prefix - ) - - if self.sns_topic_name is not None: - serializer.write_string( - _SCHEMA_CREATE_TRAIL_OUTPUT.members["SnsTopicName"], self.sns_topic_name - ) - - if self.sns_topic_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_TRAIL_OUTPUT.members["SnsTopicARN"], self.sns_topic_arn - ) - - if self.include_global_service_events is not None: - serializer.write_boolean( - _SCHEMA_CREATE_TRAIL_OUTPUT.members["IncludeGlobalServiceEvents"], - self.include_global_service_events, - ) - - if self.is_multi_region_trail is not None: - serializer.write_boolean( - _SCHEMA_CREATE_TRAIL_OUTPUT.members["IsMultiRegionTrail"], - self.is_multi_region_trail, - ) - - if self.trail_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_TRAIL_OUTPUT.members["TrailARN"], self.trail_arn - ) - - if self.log_file_validation_enabled is not None: - serializer.write_boolean( - _SCHEMA_CREATE_TRAIL_OUTPUT.members["LogFileValidationEnabled"], - self.log_file_validation_enabled, - ) - - if self.cloud_watch_logs_log_group_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_TRAIL_OUTPUT.members["CloudWatchLogsLogGroupArn"], - self.cloud_watch_logs_log_group_arn, - ) - - if self.cloud_watch_logs_role_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_TRAIL_OUTPUT.members["CloudWatchLogsRoleArn"], - self.cloud_watch_logs_role_arn, - ) - - if self.kms_key_id is not None: - serializer.write_string( - _SCHEMA_CREATE_TRAIL_OUTPUT.members["KmsKeyId"], self.kms_key_id - ) - - if self.is_organization_trail is not None: - serializer.write_boolean( - _SCHEMA_CREATE_TRAIL_OUTPUT.members["IsOrganizationTrail"], - self.is_organization_trail, - ) - - if self.recursive_logging is not None: - serializer.write_boolean( - _SCHEMA_CREATE_TRAIL_OUTPUT.members["RecursiveLogging"], - self.recursive_logging, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_TRAIL_OUTPUT.members["Name"] - ) - - case 1: - kwargs["s3_bucket_name"] = de.read_string( - _SCHEMA_CREATE_TRAIL_OUTPUT.members["S3BucketName"] - ) - - case 2: - kwargs["s3_key_prefix"] = de.read_string( - _SCHEMA_CREATE_TRAIL_OUTPUT.members["S3KeyPrefix"] - ) - - case 3: - kwargs["sns_topic_name"] = de.read_string( - _SCHEMA_CREATE_TRAIL_OUTPUT.members["SnsTopicName"] - ) - - case 4: - kwargs["sns_topic_arn"] = de.read_string( - _SCHEMA_CREATE_TRAIL_OUTPUT.members["SnsTopicARN"] - ) - - case 5: - kwargs["include_global_service_events"] = de.read_boolean( - _SCHEMA_CREATE_TRAIL_OUTPUT.members[ - "IncludeGlobalServiceEvents" - ] - ) - - case 6: - kwargs["is_multi_region_trail"] = de.read_boolean( - _SCHEMA_CREATE_TRAIL_OUTPUT.members["IsMultiRegionTrail"] - ) - - case 7: - kwargs["trail_arn"] = de.read_string( - _SCHEMA_CREATE_TRAIL_OUTPUT.members["TrailARN"] - ) - - case 8: - kwargs["log_file_validation_enabled"] = de.read_boolean( - _SCHEMA_CREATE_TRAIL_OUTPUT.members["LogFileValidationEnabled"] - ) - - case 9: - kwargs["cloud_watch_logs_log_group_arn"] = de.read_string( - _SCHEMA_CREATE_TRAIL_OUTPUT.members["CloudWatchLogsLogGroupArn"] - ) - - case 10: - kwargs["cloud_watch_logs_role_arn"] = de.read_string( - _SCHEMA_CREATE_TRAIL_OUTPUT.members["CloudWatchLogsRoleArn"] - ) - - case 11: - kwargs["kms_key_id"] = de.read_string( - _SCHEMA_CREATE_TRAIL_OUTPUT.members["KmsKeyId"] - ) - - case 12: - kwargs["is_organization_trail"] = de.read_boolean( - _SCHEMA_CREATE_TRAIL_OUTPUT.members["IsOrganizationTrail"] - ) - - case 13: - kwargs["recursive_logging"] = de.read_boolean( - _SCHEMA_CREATE_TRAIL_OUTPUT.members["RecursiveLogging"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_TRAIL_OUTPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class InsufficientS3BucketPolicyException(ServiceError): - """ - This exception is thrown when the policy on the S3 bucket is not - sufficient. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INSUFFICIENT_S3_BUCKET_POLICY_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INSUFFICIENT_S3_BUCKET_POLICY_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INSUFFICIENT_S3_BUCKET_POLICY_EXCEPTION.members[ - "Message" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INSUFFICIENT_S3_BUCKET_POLICY_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InsufficientSnsTopicPolicyException(ServiceError): - """ - This exception is thrown when the policy on the Amazon SNS topic is not - sufficient. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INSUFFICIENT_SNS_TOPIC_POLICY_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INSUFFICIENT_SNS_TOPIC_POLICY_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INSUFFICIENT_SNS_TOPIC_POLICY_EXCEPTION.members[ - "Message" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INSUFFICIENT_SNS_TOPIC_POLICY_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InvalidCloudWatchLogsLogGroupArnException(ServiceError): - """ - This exception is thrown when the provided CloudWatch Logs log group is - not valid. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVALID_CLOUD_WATCH_LOGS_LOG_GROUP_ARN_EXCEPTION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_CLOUD_WATCH_LOGS_LOG_GROUP_ARN_EXCEPTION.members[ - "Message" - ], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_CLOUD_WATCH_LOGS_LOG_GROUP_ARN_EXCEPTION.members[ - "Message" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVALID_CLOUD_WATCH_LOGS_LOG_GROUP_ARN_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InvalidCloudWatchLogsRoleArnException(ServiceError): - """This exception is thrown when the provided role is not valid.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVALID_CLOUD_WATCH_LOGS_ROLE_ARN_EXCEPTION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_CLOUD_WATCH_LOGS_ROLE_ARN_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_CLOUD_WATCH_LOGS_ROLE_ARN_EXCEPTION.members[ - "Message" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVALID_CLOUD_WATCH_LOGS_ROLE_ARN_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InvalidParameterCombinationException(ServiceError): - """ - This exception is thrown when the combination of parameters provided is - not valid. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_PARAMETER_COMBINATION_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_PARAMETER_COMBINATION_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_PARAMETER_COMBINATION_EXCEPTION.members[ - "Message" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVALID_PARAMETER_COMBINATION_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InvalidS3BucketNameException(ServiceError): - """This exception is thrown when the provided S3 bucket name is not valid.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_S3_BUCKET_NAME_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_S3_BUCKET_NAME_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_S3_BUCKET_NAME_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVALID_S3_BUCKET_NAME_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InvalidS3PrefixException(ServiceError): - """This exception is thrown when the provided S3 prefix is not valid.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_S3_PREFIX_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_S3_PREFIX_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_S3_PREFIX_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVALID_S3_PREFIX_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InvalidSnsTopicNameException(ServiceError): - """This exception is thrown when the provided SNS topic name is not valid.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_SNS_TOPIC_NAME_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_SNS_TOPIC_NAME_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_SNS_TOPIC_NAME_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVALID_SNS_TOPIC_NAME_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class KmsKeyDisabledException(ServiceError): - """This exception is no longer in use.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KMS_KEY_DISABLED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_KMS_KEY_DISABLED_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_KMS_KEY_DISABLED_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_KMS_KEY_DISABLED_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class MaximumNumberOfTrailsExceededException(ServiceError): - """This exception is thrown when the maximum number of trails is reached.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MAXIMUM_NUMBER_OF_TRAILS_EXCEEDED_EXCEPTION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_MAXIMUM_NUMBER_OF_TRAILS_EXCEEDED_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_MAXIMUM_NUMBER_OF_TRAILS_EXCEEDED_EXCEPTION.members[ - "Message" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MAXIMUM_NUMBER_OF_TRAILS_EXCEEDED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class S3BucketDoesNotExistException(ServiceError): - """This exception is thrown when the specified S3 bucket does not exist.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_S3_BUCKET_DOES_NOT_EXIST_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_S3_BUCKET_DOES_NOT_EXIST_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_S3_BUCKET_DOES_NOT_EXIST_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_S3_BUCKET_DOES_NOT_EXIST_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class TrailAlreadyExistsException(ServiceError): - """This exception is thrown when the specified trail already exists.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRAIL_ALREADY_EXISTS_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_TRAIL_ALREADY_EXISTS_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_TRAIL_ALREADY_EXISTS_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_TRAIL_ALREADY_EXISTS_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class TrailNotProvidedException(ServiceError): - """This exception is no longer in use.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRAIL_NOT_PROVIDED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_TRAIL_NOT_PROVIDED_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_TRAIL_NOT_PROVIDED_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_TRAIL_NOT_PROVIDED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -CREATE_TRAIL = APIOperation( - input=CreateTrailInput, - output=CreateTrailOutput, - schema=_SCHEMA_CREATE_TRAIL, - input_schema=_SCHEMA_CREATE_TRAIL_INPUT, - output_schema=_SCHEMA_CREATE_TRAIL_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#CloudTrailAccessNotEnabledException" - ): CloudTrailAccessNotEnabledException, - ShapeID( - "com.amazonaws.cloudtrail#CloudTrailInvalidClientTokenIdException" - ): CloudTrailInvalidClientTokenIdException, - ShapeID( - "com.amazonaws.cloudtrail#CloudWatchLogsDeliveryUnavailableException" - ): CloudWatchLogsDeliveryUnavailableException, - ShapeID("com.amazonaws.cloudtrail#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException" - ): InsufficientDependencyServiceAccessPermissionException, - ShapeID( - "com.amazonaws.cloudtrail#InsufficientEncryptionPolicyException" - ): InsufficientEncryptionPolicyException, - ShapeID( - "com.amazonaws.cloudtrail#InsufficientS3BucketPolicyException" - ): InsufficientS3BucketPolicyException, - ShapeID( - "com.amazonaws.cloudtrail#InsufficientSnsTopicPolicyException" - ): InsufficientSnsTopicPolicyException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidCloudWatchLogsLogGroupArnException" - ): InvalidCloudWatchLogsLogGroupArnException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidCloudWatchLogsRoleArnException" - ): InvalidCloudWatchLogsRoleArnException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidKmsKeyIdException" - ): InvalidKmsKeyIdException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidParameterCombinationException" - ): InvalidParameterCombinationException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidS3BucketNameException" - ): InvalidS3BucketNameException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidS3PrefixException" - ): InvalidS3PrefixException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidSnsTopicNameException" - ): InvalidSnsTopicNameException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidTagParameterException" - ): InvalidTagParameterException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidTrailNameException" - ): InvalidTrailNameException, - ShapeID("com.amazonaws.cloudtrail#KmsException"): KmsException, - ShapeID( - "com.amazonaws.cloudtrail#KmsKeyDisabledException" - ): KmsKeyDisabledException, - ShapeID( - "com.amazonaws.cloudtrail#KmsKeyNotFoundException" - ): KmsKeyNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#MaximumNumberOfTrailsExceededException" - ): MaximumNumberOfTrailsExceededException, - ShapeID( - "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException" - ): NoManagementAccountSLRExistsException, - ShapeID( - "com.amazonaws.cloudtrail#NotOrganizationMasterAccountException" - ): NotOrganizationMasterAccountException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#OrganizationNotInAllFeaturesModeException" - ): OrganizationNotInAllFeaturesModeException, - ShapeID( - "com.amazonaws.cloudtrail#OrganizationsNotInUseException" - ): OrganizationsNotInUseException, - ShapeID( - "com.amazonaws.cloudtrail#S3BucketDoesNotExistException" - ): S3BucketDoesNotExistException, - ShapeID( - "com.amazonaws.cloudtrail#TagsLimitExceededException" - ): TagsLimitExceededException, - ShapeID( - "com.amazonaws.cloudtrail#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.cloudtrail#TrailAlreadyExistsException" - ): TrailAlreadyExistsException, - ShapeID( - "com.amazonaws.cloudtrail#TrailNotProvidedException" - ): TrailNotProvidedException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CLOUD_TRAIL_ACCESS_NOT_ENABLED_EXCEPTION, - _SCHEMA_CLOUD_TRAIL_INVALID_CLIENT_TOKEN_ID_EXCEPTION, - _SCHEMA_CLOUD_WATCH_LOGS_DELIVERY_UNAVAILABLE_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INSUFFICIENT_DEPENDENCY_SERVICE_ACCESS_PERMISSION_EXCEPTION, - _SCHEMA_INSUFFICIENT_ENCRYPTION_POLICY_EXCEPTION, - _SCHEMA_INSUFFICIENT_S3_BUCKET_POLICY_EXCEPTION, - _SCHEMA_INSUFFICIENT_SNS_TOPIC_POLICY_EXCEPTION, - _SCHEMA_INVALID_CLOUD_WATCH_LOGS_LOG_GROUP_ARN_EXCEPTION, - _SCHEMA_INVALID_CLOUD_WATCH_LOGS_ROLE_ARN_EXCEPTION, - _SCHEMA_INVALID_KMS_KEY_ID_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_COMBINATION_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_INVALID_S3_BUCKET_NAME_EXCEPTION, - _SCHEMA_INVALID_S3_PREFIX_EXCEPTION, - _SCHEMA_INVALID_SNS_TOPIC_NAME_EXCEPTION, - _SCHEMA_INVALID_TAG_PARAMETER_EXCEPTION, - _SCHEMA_INVALID_TRAIL_NAME_EXCEPTION, - _SCHEMA_KMS_EXCEPTION, - _SCHEMA_KMS_KEY_DISABLED_EXCEPTION, - _SCHEMA_KMS_KEY_NOT_FOUND_EXCEPTION, - _SCHEMA_MAXIMUM_NUMBER_OF_TRAILS_EXCEEDED_EXCEPTION, - _SCHEMA_NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, - _SCHEMA_NOT_ORGANIZATION_MASTER_ACCOUNT_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_ORGANIZATION_NOT_IN_ALL_FEATURES_MODE_EXCEPTION, - _SCHEMA_ORGANIZATIONS_NOT_IN_USE_EXCEPTION, - _SCHEMA_S3_BUCKET_DOES_NOT_EXIST_EXCEPTION, - _SCHEMA_TAGS_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_TRAIL_ALREADY_EXISTS_EXCEPTION, - _SCHEMA_TRAIL_NOT_PROVIDED_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteChannelInput: - """Dataclass for DeleteChannelInput structure.""" - - channel: str | None = None - """The ARN or the `UUID` value of the channel that you want to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_CHANNEL_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.channel is not None: - serializer.write_string( - _SCHEMA_DELETE_CHANNEL_INPUT.members["Channel"], self.channel - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["channel"] = de.read_string( - _SCHEMA_DELETE_CHANNEL_INPUT.members["Channel"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_CHANNEL_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteChannelOutput: - """Dataclass for DeleteChannelOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_CHANNEL_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_CHANNEL_OUTPUT, consumer=_consumer) - return kwargs - - -DELETE_CHANNEL = APIOperation( - input=DeleteChannelInput, - output=DeleteChannelOutput, - schema=_SCHEMA_DELETE_CHANNEL, - input_schema=_SCHEMA_DELETE_CHANNEL_INPUT, - output_schema=_SCHEMA_DELETE_CHANNEL_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#ChannelARNInvalidException" - ): ChannelARNInvalidException, - ShapeID( - "com.amazonaws.cloudtrail#ChannelNotFoundException" - ): ChannelNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CHANNEL_ARN_INVALID_EXCEPTION, - _SCHEMA_CHANNEL_NOT_FOUND_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteDashboardInput: - """Dataclass for DeleteDashboardInput structure.""" - - dashboard_id: str | None = None - """The name or ARN for the dashboard.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_DASHBOARD_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.dashboard_id is not None: - serializer.write_string( - _SCHEMA_DELETE_DASHBOARD_INPUT.members["DashboardId"], self.dashboard_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["dashboard_id"] = de.read_string( - _SCHEMA_DELETE_DASHBOARD_INPUT.members["DashboardId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_DASHBOARD_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteDashboardOutput: - """Dataclass for DeleteDashboardOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_DASHBOARD_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_DASHBOARD_OUTPUT, consumer=_consumer) - return kwargs - - -DELETE_DASHBOARD = APIOperation( - input=DeleteDashboardInput, - output=DeleteDashboardOutput, - schema=_SCHEMA_DELETE_DASHBOARD, - input_schema=_SCHEMA_DELETE_DASHBOARD_INPUT, - output_schema=_SCHEMA_DELETE_DASHBOARD_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.cloudtrail#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.cloudtrail#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteEventDataStoreInput: - """Dataclass for DeleteEventDataStoreInput structure.""" - - event_data_store: str | None = None - """The ARN (or the ID suffix of the ARN) of the event data store to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_EVENT_DATA_STORE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.event_data_store is not None: - serializer.write_string( - _SCHEMA_DELETE_EVENT_DATA_STORE_INPUT.members["EventDataStore"], - self.event_data_store, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["event_data_store"] = de.read_string( - _SCHEMA_DELETE_EVENT_DATA_STORE_INPUT.members["EventDataStore"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_EVENT_DATA_STORE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteEventDataStoreOutput: - """Dataclass for DeleteEventDataStoreOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_EVENT_DATA_STORE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_EVENT_DATA_STORE_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class EventDataStoreFederationEnabledException(ServiceError): - """ - You cannot delete the event data store because Lake query federation is - enabled. To delete the event data store, run the `DisableFederation` - operation to disable Lake query federation on the event data store. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_EVENT_DATA_STORE_FEDERATION_ENABLED_EXCEPTION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_EVENT_DATA_STORE_FEDERATION_ENABLED_EXCEPTION.members[ - "Message" - ], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_EVENT_DATA_STORE_FEDERATION_ENABLED_EXCEPTION.members[ - "Message" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EVENT_DATA_STORE_FEDERATION_ENABLED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class EventDataStoreHasOngoingImportException(ServiceError): - """ - This exception is thrown when you try to update or delete an event data - store that currently has an import in progress. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_EVENT_DATA_STORE_HAS_ONGOING_IMPORT_EXCEPTION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_EVENT_DATA_STORE_HAS_ONGOING_IMPORT_EXCEPTION.members[ - "Message" - ], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_EVENT_DATA_STORE_HAS_ONGOING_IMPORT_EXCEPTION.members[ - "Message" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EVENT_DATA_STORE_HAS_ONGOING_IMPORT_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class EventDataStoreTerminationProtectedException(ServiceError): - """ - The event data store cannot be deleted because termination protection is - enabled for it. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_EVENT_DATA_STORE_TERMINATION_PROTECTED_EXCEPTION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_EVENT_DATA_STORE_TERMINATION_PROTECTED_EXCEPTION.members[ - "Message" - ], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_EVENT_DATA_STORE_TERMINATION_PROTECTED_EXCEPTION.members[ - "Message" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EVENT_DATA_STORE_TERMINATION_PROTECTED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -DELETE_EVENT_DATA_STORE = APIOperation( - input=DeleteEventDataStoreInput, - output=DeleteEventDataStoreOutput, - schema=_SCHEMA_DELETE_EVENT_DATA_STORE, - input_schema=_SCHEMA_DELETE_EVENT_DATA_STORE_INPUT, - output_schema=_SCHEMA_DELETE_EVENT_DATA_STORE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#ChannelExistsForEDSException" - ): ChannelExistsForEDSException, - ShapeID("com.amazonaws.cloudtrail#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreARNInvalidException" - ): EventDataStoreARNInvalidException, - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreFederationEnabledException" - ): EventDataStoreFederationEnabledException, - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreHasOngoingImportException" - ): EventDataStoreHasOngoingImportException, - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreNotFoundException" - ): EventDataStoreNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreTerminationProtectedException" - ): EventDataStoreTerminationProtectedException, - ShapeID( - "com.amazonaws.cloudtrail#InactiveEventDataStoreException" - ): InactiveEventDataStoreException, - ShapeID( - "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException" - ): InsufficientDependencyServiceAccessPermissionException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException" - ): NoManagementAccountSLRExistsException, - ShapeID( - "com.amazonaws.cloudtrail#NotOrganizationMasterAccountException" - ): NotOrganizationMasterAccountException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CHANNEL_EXISTS_FOR_EDS_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_EVENT_DATA_STORE_ARN_INVALID_EXCEPTION, - _SCHEMA_EVENT_DATA_STORE_FEDERATION_ENABLED_EXCEPTION, - _SCHEMA_EVENT_DATA_STORE_HAS_ONGOING_IMPORT_EXCEPTION, - _SCHEMA_EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, - _SCHEMA_EVENT_DATA_STORE_TERMINATION_PROTECTED_EXCEPTION, - _SCHEMA_INACTIVE_EVENT_DATA_STORE_EXCEPTION, - _SCHEMA_INSUFFICIENT_DEPENDENCY_SERVICE_ACCESS_PERMISSION_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, - _SCHEMA_NOT_ORGANIZATION_MASTER_ACCOUNT_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteResourcePolicyInput: - """Dataclass for DeleteResourcePolicyInput structure.""" - - resource_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the CloudTrail event data store, - dashboard, or channel you're deleting the resource-based policy from. - - Example event data store ARN format: - `arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE` - - Example dashboard ARN format: - `arn:aws:cloudtrail:us-east-1:123456789012:dashboard/exampleDash` - - Example channel ARN format: - `arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890` - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_RESOURCE_POLICY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_DELETE_RESOURCE_POLICY_INPUT.members["ResourceArn"], - self.resource_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_DELETE_RESOURCE_POLICY_INPUT.members["ResourceArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_RESOURCE_POLICY_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteResourcePolicyOutput: - """Dataclass for DeleteResourcePolicyOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_RESOURCE_POLICY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_RESOURCE_POLICY_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ResourceARNNotValidException(ServiceError): - """ - This exception is thrown when the provided resource does not exist, or - the ARN format of the resource is not valid. - - The following is the format of an event data store ARN: - `arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE` - - The following is the format of a dashboard ARN: - `arn:aws:cloudtrail:us-east-1:123456789012:dashboard/exampleDash` - - The following is the format of a channel ARN: - `arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890` - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESOURCE_ARN_NOT_VALID_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_RESOURCE_ARN_NOT_VALID_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_RESOURCE_ARN_NOT_VALID_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RESOURCE_ARN_NOT_VALID_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ResourcePolicyNotFoundException(ServiceError): - """ - This exception is thrown when the specified resource policy is not - found. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESOURCE_POLICY_NOT_FOUND_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_RESOURCE_POLICY_NOT_FOUND_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_RESOURCE_POLICY_NOT_FOUND_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RESOURCE_POLICY_NOT_FOUND_EXCEPTION, consumer=_consumer - ) - return kwargs - - -DELETE_RESOURCE_POLICY = APIOperation( - input=DeleteResourcePolicyInput, - output=DeleteResourcePolicyOutput, - schema=_SCHEMA_DELETE_RESOURCE_POLICY, - input_schema=_SCHEMA_DELETE_RESOURCE_POLICY_INPUT, - output_schema=_SCHEMA_DELETE_RESOURCE_POLICY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.cloudtrail#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#ResourceARNNotValidException" - ): ResourceARNNotValidException, - ShapeID( - "com.amazonaws.cloudtrail#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#ResourcePolicyNotFoundException" - ): ResourcePolicyNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#ResourceTypeNotSupportedException" - ): ResourceTypeNotSupportedException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_RESOURCE_ARN_NOT_VALID_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_RESOURCE_POLICY_NOT_FOUND_EXCEPTION, - _SCHEMA_RESOURCE_TYPE_NOT_SUPPORTED_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteTrailInput: - """The request that specifies the name of a trail to delete.""" - - name: str | None = None - """ - Specifies the name or the CloudTrail ARN of the trail to be deleted. The - following is the format of a trail ARN. - `arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail` - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_TRAIL_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_DELETE_TRAIL_INPUT.members["Name"], self.name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_DELETE_TRAIL_INPUT.members["Name"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_TRAIL_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteTrailOutput: - """ - Returns the objects or data listed below if successful. Otherwise, - returns an error. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_TRAIL_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_TRAIL_OUTPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class InvalidHomeRegionException(ServiceError): - """ - This exception is thrown when an operation is called on a trail from a - Region other than the Region in which the trail was created. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_HOME_REGION_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_HOME_REGION_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_HOME_REGION_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVALID_HOME_REGION_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class TrailNotFoundException(ServiceError): - """ - This exception is thrown when the trail with the given name is not - found. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRAIL_NOT_FOUND_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_TRAIL_NOT_FOUND_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_TRAIL_NOT_FOUND_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TRAIL_NOT_FOUND_EXCEPTION, consumer=_consumer) - return kwargs - - -DELETE_TRAIL = APIOperation( - input=DeleteTrailInput, - output=DeleteTrailOutput, - schema=_SCHEMA_DELETE_TRAIL, - input_schema=_SCHEMA_DELETE_TRAIL_INPUT, - output_schema=_SCHEMA_DELETE_TRAIL_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#CloudTrailARNInvalidException" - ): CloudTrailARNInvalidException, - ShapeID("com.amazonaws.cloudtrail#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException" - ): InsufficientDependencyServiceAccessPermissionException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidHomeRegionException" - ): InvalidHomeRegionException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidTrailNameException" - ): InvalidTrailNameException, - ShapeID( - "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException" - ): NoManagementAccountSLRExistsException, - ShapeID( - "com.amazonaws.cloudtrail#NotOrganizationMasterAccountException" - ): NotOrganizationMasterAccountException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.cloudtrail#TrailNotFoundException" - ): TrailNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CLOUD_TRAIL_ARN_INVALID_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INSUFFICIENT_DEPENDENCY_SERVICE_ACCESS_PERMISSION_EXCEPTION, - _SCHEMA_INVALID_HOME_REGION_EXCEPTION, - _SCHEMA_INVALID_TRAIL_NAME_EXCEPTION, - _SCHEMA_NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, - _SCHEMA_NOT_ORGANIZATION_MASTER_ACCOUNT_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_TRAIL_NOT_FOUND_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeregisterOrganizationDelegatedAdminInput: - """ - Removes CloudTrail delegated administrator permissions from a specified - member account in an organization that is currently designated as a - delegated administrator. - """ - - delegated_admin_account_id: str | None = None - """ - A delegated administrator account ID. This is a member account in an - organization that is currently designated as a delegated administrator. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DEREGISTER_ORGANIZATION_DELEGATED_ADMIN_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.delegated_admin_account_id is not None: - serializer.write_string( - _SCHEMA_DEREGISTER_ORGANIZATION_DELEGATED_ADMIN_INPUT.members[ - "DelegatedAdminAccountId" - ], - self.delegated_admin_account_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["delegated_admin_account_id"] = de.read_string( - _SCHEMA_DEREGISTER_ORGANIZATION_DELEGATED_ADMIN_INPUT.members[ - "DelegatedAdminAccountId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DEREGISTER_ORGANIZATION_DELEGATED_ADMIN_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeregisterOrganizationDelegatedAdminOutput: - """ - Returns the following response if successful. Otherwise, returns an - error. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DEREGISTER_ORGANIZATION_DELEGATED_ADMIN_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DEREGISTER_ORGANIZATION_DELEGATED_ADMIN_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class NotOrganizationManagementAccountException(ServiceError): - """ - This exception is thrown when the account making the request is not the - organization's management account. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_NOT_ORGANIZATION_MANAGEMENT_ACCOUNT_EXCEPTION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_NOT_ORGANIZATION_MANAGEMENT_ACCOUNT_EXCEPTION.members[ - "Message" - ], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_NOT_ORGANIZATION_MANAGEMENT_ACCOUNT_EXCEPTION.members[ - "Message" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_NOT_ORGANIZATION_MANAGEMENT_ACCOUNT_EXCEPTION, consumer=_consumer - ) - return kwargs - - -DEREGISTER_ORGANIZATION_DELEGATED_ADMIN = APIOperation( - input=DeregisterOrganizationDelegatedAdminInput, - output=DeregisterOrganizationDelegatedAdminOutput, - schema=_SCHEMA_DEREGISTER_ORGANIZATION_DELEGATED_ADMIN, - input_schema=_SCHEMA_DEREGISTER_ORGANIZATION_DELEGATED_ADMIN_INPUT, - output_schema=_SCHEMA_DEREGISTER_ORGANIZATION_DELEGATED_ADMIN_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#AccountNotFoundException" - ): AccountNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#AccountNotRegisteredException" - ): AccountNotRegisteredException, - ShapeID( - "com.amazonaws.cloudtrail#CloudTrailAccessNotEnabledException" - ): CloudTrailAccessNotEnabledException, - ShapeID("com.amazonaws.cloudtrail#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException" - ): InsufficientDependencyServiceAccessPermissionException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cloudtrail#NotOrganizationManagementAccountException" - ): NotOrganizationManagementAccountException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#OrganizationNotInAllFeaturesModeException" - ): OrganizationNotInAllFeaturesModeException, - ShapeID( - "com.amazonaws.cloudtrail#OrganizationsNotInUseException" - ): OrganizationsNotInUseException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCOUNT_NOT_FOUND_EXCEPTION, - _SCHEMA_ACCOUNT_NOT_REGISTERED_EXCEPTION, - _SCHEMA_CLOUD_TRAIL_ACCESS_NOT_ENABLED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INSUFFICIENT_DEPENDENCY_SERVICE_ACCESS_PERMISSION_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_NOT_ORGANIZATION_MANAGEMENT_ACCOUNT_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_ORGANIZATION_NOT_IN_ALL_FEATURES_MODE_EXCEPTION, - _SCHEMA_ORGANIZATIONS_NOT_IN_USE_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DescribeQueryInput: - """Dataclass for DescribeQueryInput structure.""" - - event_data_store: str | None = None - """ - The ARN (or the ID suffix of the ARN) of an event data store on which - the specified query was run. - """ - - query_id: str | None = None - """The query ID.""" - - query_alias: str | None = None - """The alias that identifies a query template.""" - - refresh_id: str | None = None - """The ID of the dashboard refresh.""" - - event_data_store_owner_account_id: str | None = None - """The account ID of the event data store owner.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DESCRIBE_QUERY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.event_data_store is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_QUERY_INPUT.members["EventDataStore"], - self.event_data_store, - ) - - if self.query_id is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_QUERY_INPUT.members["QueryId"], self.query_id - ) - - if self.query_alias is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_QUERY_INPUT.members["QueryAlias"], self.query_alias - ) - - if self.refresh_id is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_QUERY_INPUT.members["RefreshId"], self.refresh_id - ) - - if self.event_data_store_owner_account_id is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_QUERY_INPUT.members["EventDataStoreOwnerAccountId"], - self.event_data_store_owner_account_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["event_data_store"] = de.read_string( - _SCHEMA_DESCRIBE_QUERY_INPUT.members["EventDataStore"] - ) - - case 1: - kwargs["query_id"] = de.read_string( - _SCHEMA_DESCRIBE_QUERY_INPUT.members["QueryId"] - ) - - case 2: - kwargs["query_alias"] = de.read_string( - _SCHEMA_DESCRIBE_QUERY_INPUT.members["QueryAlias"] - ) - - case 3: - kwargs["refresh_id"] = de.read_string( - _SCHEMA_DESCRIBE_QUERY_INPUT.members["RefreshId"] - ) - - case 4: - kwargs["event_data_store_owner_account_id"] = de.read_string( - _SCHEMA_DESCRIBE_QUERY_INPUT.members[ - "EventDataStoreOwnerAccountId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DESCRIBE_QUERY_INPUT, consumer=_consumer) - return kwargs - - -class DeliveryStatus(UnknownEnumMixin, StrEnum): - SUCCESS = "SUCCESS" - FAILED = "FAILED" - FAILED_SIGNING_FILE = "FAILED_SIGNING_FILE" - PENDING = "PENDING" - RESOURCE_NOT_FOUND = "RESOURCE_NOT_FOUND" - ACCESS_DENIED = "ACCESS_DENIED" - ACCESS_DENIED_SIGNING_FILE = "ACCESS_DENIED_SIGNING_FILE" - CANCELLED = "CANCELLED" - UNKNOWN = "UNKNOWN" - - -@dataclass(kw_only=True) -class QueryStatisticsForDescribeQuery: - """ - Gets metadata about a query, including the number of events that were - matched, the total number of events scanned, the query run time in - milliseconds, and the query's creation time. - """ - - events_matched: int | None = None - """The number of events that matched a query.""" - - events_scanned: int | None = None - """The number of events that the query scanned in the event data store.""" - - bytes_scanned: int | None = None - """ - The total bytes that the query scanned in the event data store. This - value matches the number of bytes for which your account is billed for - the query, unless the query is still running. - """ - - execution_time_in_millis: int | None = None - """The query's run time, in milliseconds.""" - - creation_time: datetime | None = None - """The creation time of the query.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_QUERY_STATISTICS_FOR_DESCRIBE_QUERY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.events_matched is not None: - serializer.write_long( - _SCHEMA_QUERY_STATISTICS_FOR_DESCRIBE_QUERY.members["EventsMatched"], - self.events_matched, - ) - - if self.events_scanned is not None: - serializer.write_long( - _SCHEMA_QUERY_STATISTICS_FOR_DESCRIBE_QUERY.members["EventsScanned"], - self.events_scanned, - ) - - if self.bytes_scanned is not None: - serializer.write_long( - _SCHEMA_QUERY_STATISTICS_FOR_DESCRIBE_QUERY.members["BytesScanned"], - self.bytes_scanned, - ) - - if self.execution_time_in_millis is not None: - serializer.write_integer( - _SCHEMA_QUERY_STATISTICS_FOR_DESCRIBE_QUERY.members[ - "ExecutionTimeInMillis" - ], - self.execution_time_in_millis, - ) - - if self.creation_time is not None: - serializer.write_timestamp( - _SCHEMA_QUERY_STATISTICS_FOR_DESCRIBE_QUERY.members["CreationTime"], - self.creation_time, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["events_matched"] = de.read_long( - _SCHEMA_QUERY_STATISTICS_FOR_DESCRIBE_QUERY.members[ - "EventsMatched" - ] - ) - - case 1: - kwargs["events_scanned"] = de.read_long( - _SCHEMA_QUERY_STATISTICS_FOR_DESCRIBE_QUERY.members[ - "EventsScanned" - ] - ) - - case 2: - kwargs["bytes_scanned"] = de.read_long( - _SCHEMA_QUERY_STATISTICS_FOR_DESCRIBE_QUERY.members[ - "BytesScanned" - ] - ) - - case 3: - kwargs["execution_time_in_millis"] = de.read_integer( - _SCHEMA_QUERY_STATISTICS_FOR_DESCRIBE_QUERY.members[ - "ExecutionTimeInMillis" - ] - ) - - case 4: - kwargs["creation_time"] = de.read_timestamp( - _SCHEMA_QUERY_STATISTICS_FOR_DESCRIBE_QUERY.members[ - "CreationTime" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_QUERY_STATISTICS_FOR_DESCRIBE_QUERY, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DescribeQueryOutput: - """Dataclass for DescribeQueryOutput structure.""" - - query_id: str | None = None - """The ID of the query.""" - - query_string: str | None = None - """The SQL code of a query.""" - - query_status: str | None = None - """ - The status of a query. Values for `QueryStatus` include `QUEUED`, - `RUNNING`, `FINISHED`, `FAILED`, `TIMED_OUT`, or `CANCELLED` - """ - - query_statistics: QueryStatisticsForDescribeQuery | None = None - """ - Metadata about a query, including the number of events that were - matched, the total number of events scanned, the query run time in - milliseconds, and the query's creation time. - """ - - error_message: str | None = None - """The error message returned if a query failed.""" - - delivery_s3_uri: str | None = None - """ - The URI for the S3 bucket where CloudTrail delivered query results, if - applicable. - """ - - delivery_status: str | None = None - """The delivery status.""" - - prompt: str | None = None - """ - The prompt used for a generated query. For information about generated - queries, see [Create CloudTrail Lake queries from natural language - prompts](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/lake-query-generator.html) - in the *CloudTrail* user guide. - """ - - event_data_store_owner_account_id: str | None = None - """The account ID of the event data store owner.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DESCRIBE_QUERY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.query_id is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_QUERY_OUTPUT.members["QueryId"], self.query_id - ) - - if self.query_string is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_QUERY_OUTPUT.members["QueryString"], self.query_string - ) - - if self.query_status is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_QUERY_OUTPUT.members["QueryStatus"], self.query_status - ) - - if self.query_statistics is not None: - serializer.write_struct( - _SCHEMA_DESCRIBE_QUERY_OUTPUT.members["QueryStatistics"], - self.query_statistics, - ) - - if self.error_message is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_QUERY_OUTPUT.members["ErrorMessage"], - self.error_message, - ) - - if self.delivery_s3_uri is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_QUERY_OUTPUT.members["DeliveryS3Uri"], - self.delivery_s3_uri, - ) - - if self.delivery_status is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_QUERY_OUTPUT.members["DeliveryStatus"], - self.delivery_status, - ) - - if self.prompt is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_QUERY_OUTPUT.members["Prompt"], self.prompt - ) - - if self.event_data_store_owner_account_id is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_QUERY_OUTPUT.members["EventDataStoreOwnerAccountId"], - self.event_data_store_owner_account_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["query_id"] = de.read_string( - _SCHEMA_DESCRIBE_QUERY_OUTPUT.members["QueryId"] - ) - - case 1: - kwargs["query_string"] = de.read_string( - _SCHEMA_DESCRIBE_QUERY_OUTPUT.members["QueryString"] - ) - - case 2: - kwargs["query_status"] = QueryStatus( - de.read_string( - _SCHEMA_DESCRIBE_QUERY_OUTPUT.members["QueryStatus"] - ) - ) - - case 3: - kwargs["query_statistics"] = ( - QueryStatisticsForDescribeQuery.deserialize(de) - ) - - case 4: - kwargs["error_message"] = de.read_string( - _SCHEMA_DESCRIBE_QUERY_OUTPUT.members["ErrorMessage"] - ) - - case 5: - kwargs["delivery_s3_uri"] = de.read_string( - _SCHEMA_DESCRIBE_QUERY_OUTPUT.members["DeliveryS3Uri"] - ) - - case 6: - kwargs["delivery_status"] = DeliveryStatus( - de.read_string( - _SCHEMA_DESCRIBE_QUERY_OUTPUT.members["DeliveryStatus"] - ) - ) - - case 7: - kwargs["prompt"] = de.read_string( - _SCHEMA_DESCRIBE_QUERY_OUTPUT.members["Prompt"] - ) - - case 8: - kwargs["event_data_store_owner_account_id"] = de.read_string( - _SCHEMA_DESCRIBE_QUERY_OUTPUT.members[ - "EventDataStoreOwnerAccountId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DESCRIBE_QUERY_OUTPUT, consumer=_consumer) - return kwargs - - -DESCRIBE_QUERY = APIOperation( - input=DescribeQueryInput, - output=DescribeQueryOutput, - schema=_SCHEMA_DESCRIBE_QUERY, - input_schema=_SCHEMA_DESCRIBE_QUERY_INPUT, - output_schema=_SCHEMA_DESCRIBE_QUERY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreARNInvalidException" - ): EventDataStoreARNInvalidException, - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreNotFoundException" - ): EventDataStoreNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#InactiveEventDataStoreException" - ): InactiveEventDataStoreException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException" - ): NoManagementAccountSLRExistsException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#QueryIdNotFoundException" - ): QueryIdNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_EVENT_DATA_STORE_ARN_INVALID_EXCEPTION, - _SCHEMA_EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, - _SCHEMA_INACTIVE_EVENT_DATA_STORE_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_QUERY_ID_NOT_FOUND_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -def _serialize_trail_name_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_trail_name_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class DescribeTrailsInput: - """Returns information about the trail.""" - - trail_name_list: list[str] | None = None - """ - Specifies a list of trail names, trail ARNs, or both, of the trails to - describe. The format of a trail ARN is: - - `arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail` - - If an empty list is specified, information for the trail in the current - Region is returned. - - - If an empty list is specified and `IncludeShadowTrails` is false, then - information for all trails in the current Region is returned. - - - If an empty list is specified and IncludeShadowTrails is null or true, - then information for all trails in the current Region and any - associated shadow trails in other Regions is returned. - - Note: - If one or more trail names are specified, information is returned only - if the names match the names of trails belonging only to the current - Region and current account. To return information about a trail in - another Region, you must specify its trail ARN. - """ - - include_shadow_trails: bool | None = None - """ - Specifies whether to include shadow trails in the response. A shadow - trail is the replication in a Region of a trail that was created in a - different Region, or in the case of an organization trail, the - replication of an organization trail in member accounts. If you do not - include shadow trails, organization trails in a member account and - Region replication trails will not be returned. The default is true. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DESCRIBE_TRAILS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.trail_name_list is not None: - _serialize_trail_name_list( - serializer, - _SCHEMA_DESCRIBE_TRAILS_INPUT.members["trailNameList"], - self.trail_name_list, - ) - - if self.include_shadow_trails is not None: - serializer.write_boolean( - _SCHEMA_DESCRIBE_TRAILS_INPUT.members["includeShadowTrails"], - self.include_shadow_trails, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["trail_name_list"] = _deserialize_trail_name_list( - de, _SCHEMA_DESCRIBE_TRAILS_INPUT.members["trailNameList"] - ) - - case 1: - kwargs["include_shadow_trails"] = de.read_boolean( - _SCHEMA_DESCRIBE_TRAILS_INPUT.members["includeShadowTrails"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DESCRIBE_TRAILS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Trail: - """The settings for a trail.""" - - name: str | None = None - """ - Name of the trail set by calling CreateTrail. The maximum length is 128 - characters. - """ - - s3_bucket_name: str | None = None - """ - Name of the Amazon S3 bucket into which CloudTrail delivers your trail - files. See [Amazon S3 Bucket naming - rules](https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html). - """ - - s3_key_prefix: str | None = None - """ - Specifies the Amazon S3 key prefix that comes after the name of the - bucket you have designated for log file delivery. For more information, - see [Finding Your CloudTrail Log - Files](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/get-and-view-cloudtrail-log-files.html#cloudtrail-find-log-files). - The maximum length is 200 characters. - """ - - sns_topic_name: str | None = None - """This field is no longer in use. Use `SnsTopicARN`.""" - - sns_topic_arn: str | None = None - """ - Specifies the ARN of the Amazon SNS topic that CloudTrail uses to send - notifications when log files are delivered. The following is the format - of a topic ARN. - - `arn:aws:sns:us-east-2:123456789012:MyTopic` - """ - - include_global_service_events: bool | None = None - """ - Set to **True** to include Amazon Web Services API calls from Amazon Web - Services global services such as IAM. Otherwise, **False**. Setting this - value to `true` only delivers global service events to the trail if the - trail is multi-Region or if the trail's home Region is the partition - leader Region (for example, us-east-1). - """ - - is_multi_region_trail: bool | None = None - """ - Specifies whether the trail exists only in one Region or exists in all - Regions. - """ - - home_region: str | None = None - """The Region in which the trail was created.""" - - trail_arn: str | None = None - """ - Specifies the ARN of the trail. The following is the format of a trail - ARN. - - `arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail` - """ - - log_file_validation_enabled: bool | None = None - """Specifies whether log file validation is enabled.""" - - cloud_watch_logs_log_group_arn: str | None = None - """ - Specifies an Amazon Resource Name (ARN), a unique identifier that - represents the log group to which CloudTrail logs will be delivered. - """ - - cloud_watch_logs_role_arn: str | None = None - """ - Specifies the role for the CloudWatch Logs endpoint to assume to write - to a user's log group. - """ - - kms_key_id: str | None = None - """ - Specifies the KMS key ID that encrypts the logs and digest files - delivered by CloudTrail. The value is a fully specified ARN to a KMS key - in the following format. - - `arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012` - """ - - has_custom_event_selectors: bool | None = None - """Specifies if the trail has custom event selectors.""" - - has_insight_selectors: bool | None = None - """ - Specifies whether a trail has insight types specified in an - `InsightSelector` list. - """ - - is_organization_trail: bool | None = None - """Specifies whether the trail is an organization trail.""" - - recursive_logging: bool | None = None - """ - Specifies whether recursive logging is enabled for the trail. If you set - `RecursiveLogging` to `false`, CloudTrail suppresses events generated by - CloudTrail when it delivers log files to your trail's destinations, - including Amazon S3 and CloudWatch Logs. The default value is `true`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRAIL, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string(_SCHEMA_TRAIL.members["Name"], self.name) - - if self.s3_bucket_name is not None: - serializer.write_string( - _SCHEMA_TRAIL.members["S3BucketName"], self.s3_bucket_name - ) - - if self.s3_key_prefix is not None: - serializer.write_string( - _SCHEMA_TRAIL.members["S3KeyPrefix"], self.s3_key_prefix - ) - - if self.sns_topic_name is not None: - serializer.write_string( - _SCHEMA_TRAIL.members["SnsTopicName"], self.sns_topic_name - ) - - if self.sns_topic_arn is not None: - serializer.write_string( - _SCHEMA_TRAIL.members["SnsTopicARN"], self.sns_topic_arn - ) - - if self.include_global_service_events is not None: - serializer.write_boolean( - _SCHEMA_TRAIL.members["IncludeGlobalServiceEvents"], - self.include_global_service_events, - ) - - if self.is_multi_region_trail is not None: - serializer.write_boolean( - _SCHEMA_TRAIL.members["IsMultiRegionTrail"], self.is_multi_region_trail - ) - - if self.home_region is not None: - serializer.write_string( - _SCHEMA_TRAIL.members["HomeRegion"], self.home_region - ) - - if self.trail_arn is not None: - serializer.write_string(_SCHEMA_TRAIL.members["TrailARN"], self.trail_arn) - - if self.log_file_validation_enabled is not None: - serializer.write_boolean( - _SCHEMA_TRAIL.members["LogFileValidationEnabled"], - self.log_file_validation_enabled, - ) - - if self.cloud_watch_logs_log_group_arn is not None: - serializer.write_string( - _SCHEMA_TRAIL.members["CloudWatchLogsLogGroupArn"], - self.cloud_watch_logs_log_group_arn, - ) - - if self.cloud_watch_logs_role_arn is not None: - serializer.write_string( - _SCHEMA_TRAIL.members["CloudWatchLogsRoleArn"], - self.cloud_watch_logs_role_arn, - ) - - if self.kms_key_id is not None: - serializer.write_string(_SCHEMA_TRAIL.members["KmsKeyId"], self.kms_key_id) - - if self.has_custom_event_selectors is not None: - serializer.write_boolean( - _SCHEMA_TRAIL.members["HasCustomEventSelectors"], - self.has_custom_event_selectors, - ) - - if self.has_insight_selectors is not None: - serializer.write_boolean( - _SCHEMA_TRAIL.members["HasInsightSelectors"], self.has_insight_selectors - ) - - if self.is_organization_trail is not None: - serializer.write_boolean( - _SCHEMA_TRAIL.members["IsOrganizationTrail"], self.is_organization_trail - ) - - if self.recursive_logging is not None: - serializer.write_boolean( - _SCHEMA_TRAIL.members["RecursiveLogging"], self.recursive_logging - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string(_SCHEMA_TRAIL.members["Name"]) - - case 1: - kwargs["s3_bucket_name"] = de.read_string( - _SCHEMA_TRAIL.members["S3BucketName"] - ) - - case 2: - kwargs["s3_key_prefix"] = de.read_string( - _SCHEMA_TRAIL.members["S3KeyPrefix"] - ) - - case 3: - kwargs["sns_topic_name"] = de.read_string( - _SCHEMA_TRAIL.members["SnsTopicName"] - ) - - case 4: - kwargs["sns_topic_arn"] = de.read_string( - _SCHEMA_TRAIL.members["SnsTopicARN"] - ) - - case 5: - kwargs["include_global_service_events"] = de.read_boolean( - _SCHEMA_TRAIL.members["IncludeGlobalServiceEvents"] - ) - - case 6: - kwargs["is_multi_region_trail"] = de.read_boolean( - _SCHEMA_TRAIL.members["IsMultiRegionTrail"] - ) - - case 7: - kwargs["home_region"] = de.read_string( - _SCHEMA_TRAIL.members["HomeRegion"] - ) - - case 8: - kwargs["trail_arn"] = de.read_string( - _SCHEMA_TRAIL.members["TrailARN"] - ) - - case 9: - kwargs["log_file_validation_enabled"] = de.read_boolean( - _SCHEMA_TRAIL.members["LogFileValidationEnabled"] - ) - - case 10: - kwargs["cloud_watch_logs_log_group_arn"] = de.read_string( - _SCHEMA_TRAIL.members["CloudWatchLogsLogGroupArn"] - ) - - case 11: - kwargs["cloud_watch_logs_role_arn"] = de.read_string( - _SCHEMA_TRAIL.members["CloudWatchLogsRoleArn"] - ) - - case 12: - kwargs["kms_key_id"] = de.read_string( - _SCHEMA_TRAIL.members["KmsKeyId"] - ) - - case 13: - kwargs["has_custom_event_selectors"] = de.read_boolean( - _SCHEMA_TRAIL.members["HasCustomEventSelectors"] - ) - - case 14: - kwargs["has_insight_selectors"] = de.read_boolean( - _SCHEMA_TRAIL.members["HasInsightSelectors"] - ) - - case 15: - kwargs["is_organization_trail"] = de.read_boolean( - _SCHEMA_TRAIL.members["IsOrganizationTrail"] - ) - - case 16: - kwargs["recursive_logging"] = de.read_boolean( - _SCHEMA_TRAIL.members["RecursiveLogging"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TRAIL, consumer=_consumer) - return kwargs - - -def _serialize_trail_list( - serializer: ShapeSerializer, schema: Schema, value: list[Trail] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_trail_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Trail]: - result: list[Trail] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Trail.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class DescribeTrailsOutput: - """ - Returns the objects or data listed below if successful. Otherwise, - returns an error. - """ - - trail_list: list[Trail] | None = None - """ - The list of trail objects. Trail objects with string values are only - returned if values for the objects exist in a trail's configuration. - For example, `SNSTopicName` and `SNSTopicARN` are only returned in - results if a trail is configured to send SNS notifications. Similarly, - `KMSKeyId` only appears in results if a trail's log files are encrypted - with KMS customer managed keys. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DESCRIBE_TRAILS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.trail_list is not None: - _serialize_trail_list( - serializer, - _SCHEMA_DESCRIBE_TRAILS_OUTPUT.members["trailList"], - self.trail_list, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["trail_list"] = _deserialize_trail_list( - de, _SCHEMA_DESCRIBE_TRAILS_OUTPUT.members["trailList"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DESCRIBE_TRAILS_OUTPUT, consumer=_consumer) - return kwargs - - -DESCRIBE_TRAILS = APIOperation( - input=DescribeTrailsInput, - output=DescribeTrailsOutput, - schema=_SCHEMA_DESCRIBE_TRAILS, - input_schema=_SCHEMA_DESCRIBE_TRAILS_INPUT, - output_schema=_SCHEMA_DESCRIBE_TRAILS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#CloudTrailARNInvalidException" - ): CloudTrailARNInvalidException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidTrailNameException" - ): InvalidTrailNameException, - ShapeID( - "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException" - ): NoManagementAccountSLRExistsException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CLOUD_TRAIL_ARN_INVALID_EXCEPTION, - _SCHEMA_INVALID_TRAIL_NAME_EXCEPTION, - _SCHEMA_NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ConcurrentModificationException(ServiceError): - """ - You are trying to update a resource when another request is in progress. - Allow sufficient wait time for the previous request to complete, then - retry your request. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONCURRENT_MODIFICATION_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_CONCURRENT_MODIFICATION_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_CONCURRENT_MODIFICATION_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CONCURRENT_MODIFICATION_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DisableFederationInput: - """Dataclass for DisableFederationInput structure.""" - - event_data_store: str | None = None - """ - The ARN (or ID suffix of the ARN) of the event data store for which you - want to disable Lake query federation. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DISABLE_FEDERATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.event_data_store is not None: - serializer.write_string( - _SCHEMA_DISABLE_FEDERATION_INPUT.members["EventDataStore"], - self.event_data_store, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["event_data_store"] = de.read_string( - _SCHEMA_DISABLE_FEDERATION_INPUT.members["EventDataStore"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DISABLE_FEDERATION_INPUT, consumer=_consumer) - return kwargs - - -class FederationStatus(UnknownEnumMixin, StrEnum): - ENABLING = "ENABLING" - ENABLED = "ENABLED" - DISABLING = "DISABLING" - DISABLED = "DISABLED" - - -@dataclass(kw_only=True) -class DisableFederationOutput: - """Dataclass for DisableFederationOutput structure.""" - - event_data_store_arn: str | None = None - """ - The ARN of the event data store for which you disabled Lake query - federation. - """ - - federation_status: str | None = None - """The federation status.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DISABLE_FEDERATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.event_data_store_arn is not None: - serializer.write_string( - _SCHEMA_DISABLE_FEDERATION_OUTPUT.members["EventDataStoreArn"], - self.event_data_store_arn, - ) - - if self.federation_status is not None: - serializer.write_string( - _SCHEMA_DISABLE_FEDERATION_OUTPUT.members["FederationStatus"], - self.federation_status, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["event_data_store_arn"] = de.read_string( - _SCHEMA_DISABLE_FEDERATION_OUTPUT.members["EventDataStoreArn"] - ) - - case 1: - kwargs["federation_status"] = FederationStatus( - de.read_string( - _SCHEMA_DISABLE_FEDERATION_OUTPUT.members[ - "FederationStatus" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DISABLE_FEDERATION_OUTPUT, consumer=_consumer) - return kwargs - - -DISABLE_FEDERATION = APIOperation( - input=DisableFederationInput, - output=DisableFederationOutput, - schema=_SCHEMA_DISABLE_FEDERATION, - input_schema=_SCHEMA_DISABLE_FEDERATION_INPUT, - output_schema=_SCHEMA_DISABLE_FEDERATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.cloudtrail#CloudTrailAccessNotEnabledException" - ): CloudTrailAccessNotEnabledException, - ShapeID( - "com.amazonaws.cloudtrail#ConcurrentModificationException" - ): ConcurrentModificationException, - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreARNInvalidException" - ): EventDataStoreARNInvalidException, - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreNotFoundException" - ): EventDataStoreNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#InactiveEventDataStoreException" - ): InactiveEventDataStoreException, - ShapeID( - "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException" - ): InsufficientDependencyServiceAccessPermissionException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException" - ): NoManagementAccountSLRExistsException, - ShapeID( - "com.amazonaws.cloudtrail#NotOrganizationMasterAccountException" - ): NotOrganizationMasterAccountException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#OrganizationNotInAllFeaturesModeException" - ): OrganizationNotInAllFeaturesModeException, - ShapeID( - "com.amazonaws.cloudtrail#OrganizationsNotInUseException" - ): OrganizationsNotInUseException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CLOUD_TRAIL_ACCESS_NOT_ENABLED_EXCEPTION, - _SCHEMA_CONCURRENT_MODIFICATION_EXCEPTION, - _SCHEMA_EVENT_DATA_STORE_ARN_INVALID_EXCEPTION, - _SCHEMA_EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, - _SCHEMA_INACTIVE_EVENT_DATA_STORE_EXCEPTION, - _SCHEMA_INSUFFICIENT_DEPENDENCY_SERVICE_ACCESS_PERMISSION_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, - _SCHEMA_NOT_ORGANIZATION_MASTER_ACCOUNT_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_ORGANIZATION_NOT_IN_ALL_FEATURES_MODE_EXCEPTION, - _SCHEMA_ORGANIZATIONS_NOT_IN_USE_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class EnableFederationInput: - """Dataclass for EnableFederationInput structure.""" - - event_data_store: str | None = None - """ - The ARN (or ID suffix of the ARN) of the event data store for which you - want to enable Lake query federation. - """ - - federation_role_arn: str | None = None - """ - The ARN of the federation role to use for the event data store. Amazon - Web Services services like Lake Formation use this federation role to - access data for the federated event data store. The federation role must - exist in your account and provide the [required minimum - permissions](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-federation.html#query-federation-permissions-role). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ENABLE_FEDERATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.event_data_store is not None: - serializer.write_string( - _SCHEMA_ENABLE_FEDERATION_INPUT.members["EventDataStore"], - self.event_data_store, - ) - - if self.federation_role_arn is not None: - serializer.write_string( - _SCHEMA_ENABLE_FEDERATION_INPUT.members["FederationRoleArn"], - self.federation_role_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["event_data_store"] = de.read_string( - _SCHEMA_ENABLE_FEDERATION_INPUT.members["EventDataStore"] - ) - - case 1: - kwargs["federation_role_arn"] = de.read_string( - _SCHEMA_ENABLE_FEDERATION_INPUT.members["FederationRoleArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ENABLE_FEDERATION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class EnableFederationOutput: - """Dataclass for EnableFederationOutput structure.""" - - event_data_store_arn: str | None = None - """ - The ARN of the event data store for which you enabled Lake query - federation. - """ - - federation_status: str | None = None - """The federation status.""" - - federation_role_arn: str | None = None - """The ARN of the federation role.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ENABLE_FEDERATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.event_data_store_arn is not None: - serializer.write_string( - _SCHEMA_ENABLE_FEDERATION_OUTPUT.members["EventDataStoreArn"], - self.event_data_store_arn, - ) - - if self.federation_status is not None: - serializer.write_string( - _SCHEMA_ENABLE_FEDERATION_OUTPUT.members["FederationStatus"], - self.federation_status, - ) - - if self.federation_role_arn is not None: - serializer.write_string( - _SCHEMA_ENABLE_FEDERATION_OUTPUT.members["FederationRoleArn"], - self.federation_role_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["event_data_store_arn"] = de.read_string( - _SCHEMA_ENABLE_FEDERATION_OUTPUT.members["EventDataStoreArn"] - ) - - case 1: - kwargs["federation_status"] = FederationStatus( - de.read_string( - _SCHEMA_ENABLE_FEDERATION_OUTPUT.members["FederationStatus"] - ) - ) - - case 2: - kwargs["federation_role_arn"] = de.read_string( - _SCHEMA_ENABLE_FEDERATION_OUTPUT.members["FederationRoleArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ENABLE_FEDERATION_OUTPUT, consumer=_consumer) - return kwargs - - -ENABLE_FEDERATION = APIOperation( - input=EnableFederationInput, - output=EnableFederationOutput, - schema=_SCHEMA_ENABLE_FEDERATION, - input_schema=_SCHEMA_ENABLE_FEDERATION_INPUT, - output_schema=_SCHEMA_ENABLE_FEDERATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.cloudtrail#CloudTrailAccessNotEnabledException" - ): CloudTrailAccessNotEnabledException, - ShapeID( - "com.amazonaws.cloudtrail#ConcurrentModificationException" - ): ConcurrentModificationException, - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreARNInvalidException" - ): EventDataStoreARNInvalidException, - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreFederationEnabledException" - ): EventDataStoreFederationEnabledException, - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreNotFoundException" - ): EventDataStoreNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#InactiveEventDataStoreException" - ): InactiveEventDataStoreException, - ShapeID( - "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException" - ): InsufficientDependencyServiceAccessPermissionException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException" - ): NoManagementAccountSLRExistsException, - ShapeID( - "com.amazonaws.cloudtrail#NotOrganizationMasterAccountException" - ): NotOrganizationMasterAccountException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#OrganizationNotInAllFeaturesModeException" - ): OrganizationNotInAllFeaturesModeException, - ShapeID( - "com.amazonaws.cloudtrail#OrganizationsNotInUseException" - ): OrganizationsNotInUseException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CLOUD_TRAIL_ACCESS_NOT_ENABLED_EXCEPTION, - _SCHEMA_CONCURRENT_MODIFICATION_EXCEPTION, - _SCHEMA_EVENT_DATA_STORE_ARN_INVALID_EXCEPTION, - _SCHEMA_EVENT_DATA_STORE_FEDERATION_ENABLED_EXCEPTION, - _SCHEMA_EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, - _SCHEMA_INACTIVE_EVENT_DATA_STORE_EXCEPTION, - _SCHEMA_INSUFFICIENT_DEPENDENCY_SERVICE_ACCESS_PERMISSION_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, - _SCHEMA_NOT_ORGANIZATION_MASTER_ACCOUNT_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_ORGANIZATION_NOT_IN_ALL_FEATURES_MODE_EXCEPTION, - _SCHEMA_ORGANIZATIONS_NOT_IN_USE_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -def _serialize_event_data_store_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_event_data_store_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GenerateQueryInput: - """Dataclass for GenerateQueryInput structure.""" - - event_data_stores: list[str] | None = None - """ - The ARN (or ID suffix of the ARN) of the event data store that you want - to query. You can only specify one event data store. - """ - - prompt: str | None = None - """ - The prompt that you want to use to generate the query. The prompt must - be in English. For example prompts, see [Example - prompts](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/lake-query-generator.html#lake-query-generator-examples) - in the *CloudTrail* user guide. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GENERATE_QUERY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.event_data_stores is not None: - _serialize_event_data_store_list( - serializer, - _SCHEMA_GENERATE_QUERY_INPUT.members["EventDataStores"], - self.event_data_stores, - ) - - if self.prompt is not None: - serializer.write_string( - _SCHEMA_GENERATE_QUERY_INPUT.members["Prompt"], self.prompt - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["event_data_stores"] = _deserialize_event_data_store_list( - de, _SCHEMA_GENERATE_QUERY_INPUT.members["EventDataStores"] - ) - - case 1: - kwargs["prompt"] = de.read_string( - _SCHEMA_GENERATE_QUERY_INPUT.members["Prompt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GENERATE_QUERY_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GenerateQueryOutput: - """Dataclass for GenerateQueryOutput structure.""" - - query_statement: str | None = None - """The SQL query statement generated from the prompt.""" - - query_alias: str | None = None - """ - An alias that identifies the prompt. When you run the `StartQuery` - operation, you can pass in either the `QueryAlias` or `QueryStatement` - parameter. - """ - - event_data_store_owner_account_id: str | None = None - """The account ID of the event data store owner.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GENERATE_QUERY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.query_statement is not None: - serializer.write_string( - _SCHEMA_GENERATE_QUERY_OUTPUT.members["QueryStatement"], - self.query_statement, - ) - - if self.query_alias is not None: - serializer.write_string( - _SCHEMA_GENERATE_QUERY_OUTPUT.members["QueryAlias"], self.query_alias - ) - - if self.event_data_store_owner_account_id is not None: - serializer.write_string( - _SCHEMA_GENERATE_QUERY_OUTPUT.members["EventDataStoreOwnerAccountId"], - self.event_data_store_owner_account_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["query_statement"] = de.read_string( - _SCHEMA_GENERATE_QUERY_OUTPUT.members["QueryStatement"] - ) - - case 1: - kwargs["query_alias"] = de.read_string( - _SCHEMA_GENERATE_QUERY_OUTPUT.members["QueryAlias"] - ) - - case 2: - kwargs["event_data_store_owner_account_id"] = de.read_string( - _SCHEMA_GENERATE_QUERY_OUTPUT.members[ - "EventDataStoreOwnerAccountId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GENERATE_QUERY_OUTPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GenerateResponseException(ServiceError): - """ - This exception is thrown when a valid query could not be generated for - the provided prompt. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GENERATE_RESPONSE_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_GENERATE_RESPONSE_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_GENERATE_RESPONSE_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GENERATE_RESPONSE_EXCEPTION, consumer=_consumer - ) - return kwargs - - -GENERATE_QUERY = APIOperation( - input=GenerateQueryInput, - output=GenerateQueryOutput, - schema=_SCHEMA_GENERATE_QUERY, - input_schema=_SCHEMA_GENERATE_QUERY_INPUT, - output_schema=_SCHEMA_GENERATE_QUERY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreARNInvalidException" - ): EventDataStoreARNInvalidException, - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreNotFoundException" - ): EventDataStoreNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#GenerateResponseException" - ): GenerateResponseException, - ShapeID( - "com.amazonaws.cloudtrail#InactiveEventDataStoreException" - ): InactiveEventDataStoreException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException" - ): NoManagementAccountSLRExistsException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_EVENT_DATA_STORE_ARN_INVALID_EXCEPTION, - _SCHEMA_EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, - _SCHEMA_GENERATE_RESPONSE_EXCEPTION, - _SCHEMA_INACTIVE_EVENT_DATA_STORE_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetChannelInput: - """Dataclass for GetChannelInput structure.""" - - channel: str | None = None - """The ARN or `UUID` of a channel.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_CHANNEL_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.channel is not None: - serializer.write_string( - _SCHEMA_GET_CHANNEL_INPUT.members["Channel"], self.channel - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["channel"] = de.read_string( - _SCHEMA_GET_CHANNEL_INPUT.members["Channel"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_CHANNEL_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class IngestionStatus: - """ - A table showing information about the most recent successful and failed - attempts to ingest events. - """ - - latest_ingestion_success_time: datetime | None = None - """ - The time stamp of the most recent successful ingestion of events for the - channel. - """ - - latest_ingestion_success_event_id: str | None = None - """The event ID of the most recent successful ingestion of events.""" - - latest_ingestion_error_code: str | None = None - """The error code for the most recent failure to ingest events.""" - - latest_ingestion_attempt_time: datetime | None = None - """ - The time stamp of the most recent attempt to ingest events on the - channel. - """ - - latest_ingestion_attempt_event_id: str | None = None - """The event ID of the most recent attempt to ingest events.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INGESTION_STATUS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.latest_ingestion_success_time is not None: - serializer.write_timestamp( - _SCHEMA_INGESTION_STATUS.members["LatestIngestionSuccessTime"], - self.latest_ingestion_success_time, - ) - - if self.latest_ingestion_success_event_id is not None: - serializer.write_string( - _SCHEMA_INGESTION_STATUS.members["LatestIngestionSuccessEventID"], - self.latest_ingestion_success_event_id, - ) - - if self.latest_ingestion_error_code is not None: - serializer.write_string( - _SCHEMA_INGESTION_STATUS.members["LatestIngestionErrorCode"], - self.latest_ingestion_error_code, - ) - - if self.latest_ingestion_attempt_time is not None: - serializer.write_timestamp( - _SCHEMA_INGESTION_STATUS.members["LatestIngestionAttemptTime"], - self.latest_ingestion_attempt_time, - ) - - if self.latest_ingestion_attempt_event_id is not None: - serializer.write_string( - _SCHEMA_INGESTION_STATUS.members["LatestIngestionAttemptEventID"], - self.latest_ingestion_attempt_event_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["latest_ingestion_success_time"] = de.read_timestamp( - _SCHEMA_INGESTION_STATUS.members["LatestIngestionSuccessTime"] - ) - - case 1: - kwargs["latest_ingestion_success_event_id"] = de.read_string( - _SCHEMA_INGESTION_STATUS.members[ - "LatestIngestionSuccessEventID" - ] - ) - - case 2: - kwargs["latest_ingestion_error_code"] = de.read_string( - _SCHEMA_INGESTION_STATUS.members["LatestIngestionErrorCode"] - ) - - case 3: - kwargs["latest_ingestion_attempt_time"] = de.read_timestamp( - _SCHEMA_INGESTION_STATUS.members["LatestIngestionAttemptTime"] - ) - - case 4: - kwargs["latest_ingestion_attempt_event_id"] = de.read_string( - _SCHEMA_INGESTION_STATUS.members[ - "LatestIngestionAttemptEventID" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INGESTION_STATUS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class SourceConfig: - """Contains configuration information about the channel.""" - - apply_to_all_regions: bool | None = None - """ - Specifies whether the channel applies to a single Region or to all - Regions. - """ - - advanced_event_selectors: list[AdvancedEventSelector] | None = None - """The advanced event selectors that are configured for the channel.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SOURCE_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.apply_to_all_regions is not None: - serializer.write_boolean( - _SCHEMA_SOURCE_CONFIG.members["ApplyToAllRegions"], - self.apply_to_all_regions, - ) - - if self.advanced_event_selectors is not None: - _serialize_advanced_event_selectors( - serializer, - _SCHEMA_SOURCE_CONFIG.members["AdvancedEventSelectors"], - self.advanced_event_selectors, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["apply_to_all_regions"] = de.read_boolean( - _SCHEMA_SOURCE_CONFIG.members["ApplyToAllRegions"] - ) - - case 1: - kwargs["advanced_event_selectors"] = ( - _deserialize_advanced_event_selectors( - de, _SCHEMA_SOURCE_CONFIG.members["AdvancedEventSelectors"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SOURCE_CONFIG, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetChannelOutput: - """Dataclass for GetChannelOutput structure.""" - - channel_arn: str | None = None - """The ARN of an channel returned by a `GetChannel` request.""" - - name: str | None = None - """ - The name of the CloudTrail channel. For service-linked channels, the - name is `aws-service-channel/service-name/custom-suffix` where - `service-name` represents the name of the Amazon Web Services service - that created the channel and `custom-suffix` represents the suffix - generated by the Amazon Web Services service. - """ - - source: str | None = None - """The source for the CloudTrail channel.""" - - source_config: SourceConfig | None = None - """ - Provides information about the advanced event selectors configured for - the channel, and whether the channel applies to all Regions or a single - Region. - """ - - destinations: list[Destination] | None = None - """ - The destinations for the channel. For channels created for integrations, - the destinations are the event data stores that log events arriving - through the channel. For service-linked channels, the destination is the - Amazon Web Services service that created the service-linked channel to - receive events. - """ - - ingestion_status: IngestionStatus | None = None - """ - A table showing information about the most recent successful and failed - attempts to ingest events. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_CHANNEL_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.channel_arn is not None: - serializer.write_string( - _SCHEMA_GET_CHANNEL_OUTPUT.members["ChannelArn"], self.channel_arn - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_GET_CHANNEL_OUTPUT.members["Name"], self.name - ) - - if self.source is not None: - serializer.write_string( - _SCHEMA_GET_CHANNEL_OUTPUT.members["Source"], self.source - ) - - if self.source_config is not None: - serializer.write_struct( - _SCHEMA_GET_CHANNEL_OUTPUT.members["SourceConfig"], self.source_config - ) - - if self.destinations is not None: - _serialize_destinations( - serializer, - _SCHEMA_GET_CHANNEL_OUTPUT.members["Destinations"], - self.destinations, - ) - - if self.ingestion_status is not None: - serializer.write_struct( - _SCHEMA_GET_CHANNEL_OUTPUT.members["IngestionStatus"], - self.ingestion_status, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["channel_arn"] = de.read_string( - _SCHEMA_GET_CHANNEL_OUTPUT.members["ChannelArn"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_GET_CHANNEL_OUTPUT.members["Name"] - ) - - case 2: - kwargs["source"] = de.read_string( - _SCHEMA_GET_CHANNEL_OUTPUT.members["Source"] - ) - - case 3: - kwargs["source_config"] = SourceConfig.deserialize(de) - - case 4: - kwargs["destinations"] = _deserialize_destinations( - de, _SCHEMA_GET_CHANNEL_OUTPUT.members["Destinations"] - ) - - case 5: - kwargs["ingestion_status"] = IngestionStatus.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_CHANNEL_OUTPUT, consumer=_consumer) - return kwargs - - -GET_CHANNEL = APIOperation( - input=GetChannelInput, - output=GetChannelOutput, - schema=_SCHEMA_GET_CHANNEL, - input_schema=_SCHEMA_GET_CHANNEL_INPUT, - output_schema=_SCHEMA_GET_CHANNEL_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#ChannelARNInvalidException" - ): ChannelARNInvalidException, - ShapeID( - "com.amazonaws.cloudtrail#ChannelNotFoundException" - ): ChannelNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CHANNEL_ARN_INVALID_EXCEPTION, - _SCHEMA_CHANNEL_NOT_FOUND_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetDashboardInput: - """Dataclass for GetDashboardInput structure.""" - - dashboard_id: str | None = None - """The name or ARN for the dashboard.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DASHBOARD_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.dashboard_id is not None: - serializer.write_string( - _SCHEMA_GET_DASHBOARD_INPUT.members["DashboardId"], self.dashboard_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["dashboard_id"] = de.read_string( - _SCHEMA_GET_DASHBOARD_INPUT.members["DashboardId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_DASHBOARD_INPUT, consumer=_consumer) - return kwargs - - -class DashboardStatus(UnknownEnumMixin, StrEnum): - CREATING = "CREATING" - CREATED = "CREATED" - UPDATING = "UPDATING" - UPDATED = "UPDATED" - DELETING = "DELETING" - - -@dataclass(kw_only=True) -class GetDashboardOutput: - """Dataclass for GetDashboardOutput structure.""" - - dashboard_arn: str | None = None - """The ARN for the dashboard.""" - - type: str | None = None - """The type of dashboard.""" - - status: str | None = None - """The status of the dashboard.""" - - widgets: list[Widget] | None = None - """An array of widgets for the dashboard.""" - - refresh_schedule: RefreshSchedule | None = None - """The refresh schedule for the dashboard, if configured.""" - - created_timestamp: datetime | None = None - """The timestamp that shows when the dashboard was created.""" - - updated_timestamp: datetime | None = None - """The timestamp that shows when the dashboard was last updated.""" - - last_refresh_id: str | None = None - """The ID of the last dashboard refresh.""" - - last_refresh_failure_reason: str | None = None - """Provides information about failures for the last scheduled refresh.""" - - termination_protection_enabled: bool | None = None - """Indicates whether termination protection is enabled for the dashboard.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DASHBOARD_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.dashboard_arn is not None: - serializer.write_string( - _SCHEMA_GET_DASHBOARD_OUTPUT.members["DashboardArn"], self.dashboard_arn - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_GET_DASHBOARD_OUTPUT.members["Type"], self.type - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_GET_DASHBOARD_OUTPUT.members["Status"], self.status - ) - - if self.widgets is not None: - _serialize_widget_list( - serializer, - _SCHEMA_GET_DASHBOARD_OUTPUT.members["Widgets"], - self.widgets, - ) - - if self.refresh_schedule is not None: - serializer.write_struct( - _SCHEMA_GET_DASHBOARD_OUTPUT.members["RefreshSchedule"], - self.refresh_schedule, - ) - - if self.created_timestamp is not None: - serializer.write_timestamp( - _SCHEMA_GET_DASHBOARD_OUTPUT.members["CreatedTimestamp"], - self.created_timestamp, - ) - - if self.updated_timestamp is not None: - serializer.write_timestamp( - _SCHEMA_GET_DASHBOARD_OUTPUT.members["UpdatedTimestamp"], - self.updated_timestamp, - ) - - if self.last_refresh_id is not None: - serializer.write_string( - _SCHEMA_GET_DASHBOARD_OUTPUT.members["LastRefreshId"], - self.last_refresh_id, - ) - - if self.last_refresh_failure_reason is not None: - serializer.write_string( - _SCHEMA_GET_DASHBOARD_OUTPUT.members["LastRefreshFailureReason"], - self.last_refresh_failure_reason, - ) - - if self.termination_protection_enabled is not None: - serializer.write_boolean( - _SCHEMA_GET_DASHBOARD_OUTPUT.members["TerminationProtectionEnabled"], - self.termination_protection_enabled, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["dashboard_arn"] = de.read_string( - _SCHEMA_GET_DASHBOARD_OUTPUT.members["DashboardArn"] - ) - - case 1: - kwargs["type"] = DashboardType( - de.read_string(_SCHEMA_GET_DASHBOARD_OUTPUT.members["Type"]) - ) - - case 2: - kwargs["status"] = DashboardStatus( - de.read_string(_SCHEMA_GET_DASHBOARD_OUTPUT.members["Status"]) - ) - - case 3: - kwargs["widgets"] = _deserialize_widget_list( - de, _SCHEMA_GET_DASHBOARD_OUTPUT.members["Widgets"] - ) - - case 4: - kwargs["refresh_schedule"] = RefreshSchedule.deserialize(de) - - case 5: - kwargs["created_timestamp"] = de.read_timestamp( - _SCHEMA_GET_DASHBOARD_OUTPUT.members["CreatedTimestamp"] - ) - - case 6: - kwargs["updated_timestamp"] = de.read_timestamp( - _SCHEMA_GET_DASHBOARD_OUTPUT.members["UpdatedTimestamp"] - ) - - case 7: - kwargs["last_refresh_id"] = de.read_string( - _SCHEMA_GET_DASHBOARD_OUTPUT.members["LastRefreshId"] - ) - - case 8: - kwargs["last_refresh_failure_reason"] = de.read_string( - _SCHEMA_GET_DASHBOARD_OUTPUT.members["LastRefreshFailureReason"] - ) - - case 9: - kwargs["termination_protection_enabled"] = de.read_boolean( - _SCHEMA_GET_DASHBOARD_OUTPUT.members[ - "TerminationProtectionEnabled" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_DASHBOARD_OUTPUT, consumer=_consumer) - return kwargs - - -GET_DASHBOARD = APIOperation( - input=GetDashboardInput, - output=GetDashboardOutput, - schema=_SCHEMA_GET_DASHBOARD, - input_schema=_SCHEMA_GET_DASHBOARD_INPUT, - output_schema=_SCHEMA_GET_DASHBOARD_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetEventConfigurationInput: - """Dataclass for GetEventConfigurationInput structure.""" - - trail_name: str | None = None - """ - The name of the trail for which you want to retrieve event configuration - settings. - """ - - event_data_store: str | None = None - """ - The Amazon Resource Name (ARN) or ID suffix of the ARN of the event data - store for which you want to retrieve event configuration settings. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_EVENT_CONFIGURATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.trail_name is not None: - serializer.write_string( - _SCHEMA_GET_EVENT_CONFIGURATION_INPUT.members["TrailName"], - self.trail_name, - ) - - if self.event_data_store is not None: - serializer.write_string( - _SCHEMA_GET_EVENT_CONFIGURATION_INPUT.members["EventDataStore"], - self.event_data_store, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["trail_name"] = de.read_string( - _SCHEMA_GET_EVENT_CONFIGURATION_INPUT.members["TrailName"] - ) - - case 1: - kwargs["event_data_store"] = de.read_string( - _SCHEMA_GET_EVENT_CONFIGURATION_INPUT.members["EventDataStore"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_EVENT_CONFIGURATION_INPUT, consumer=_consumer - ) - return kwargs - - -def _serialize_operator_target_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_operator_target_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -class Type(UnknownEnumMixin, StrEnum): - TAG_CONTEXT = "TagContext" - REQUEST_CONTEXT = "RequestContext" - - -@dataclass(kw_only=True) -class ContextKeySelector: - """ - An object that contains information types to be included in CloudTrail - enriched events. - """ - - type: str - """ - Specifies the type of the event record field in ContextKeySelector. - Valid values include RequestContext, TagContext. - """ - - equals: list[str] - """ - A list of keys defined by Type to be included in CloudTrail enriched - events. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTEXT_KEY_SELECTOR, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_CONTEXT_KEY_SELECTOR.members["Type"], self.type) - _serialize_operator_target_list( - serializer, _SCHEMA_CONTEXT_KEY_SELECTOR.members["Equals"], self.equals - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = Type( - de.read_string(_SCHEMA_CONTEXT_KEY_SELECTOR.members["Type"]) - ) - - case 1: - kwargs["equals"] = _deserialize_operator_target_list( - de, _SCHEMA_CONTEXT_KEY_SELECTOR.members["Equals"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONTEXT_KEY_SELECTOR, consumer=_consumer) - if "type" not in kwargs: - kwargs["type"] = Type._corrected("") - if "equals" not in kwargs: - kwargs["equals"] = [] - return kwargs - - -def _serialize_context_key_selectors( - serializer: ShapeSerializer, schema: Schema, value: list[ContextKeySelector] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_context_key_selectors( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ContextKeySelector]: - result: list[ContextKeySelector] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ContextKeySelector.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class MaxEventSize(UnknownEnumMixin, StrEnum): - STANDARD = "Standard" - LARGE = "Large" - - -@dataclass(kw_only=True) -class GetEventConfigurationOutput: - """Dataclass for GetEventConfigurationOutput structure.""" - - trail_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the trail for which the event - configuration settings are returned. - """ - - event_data_store_arn: str | None = None - """ - The Amazon Resource Name (ARN) or ID suffix of the ARN of the event data - store for which the event configuration settings are returned. - """ - - max_event_size: str | None = None - """ - The maximum allowed size for events stored in the specified event data - store. - """ - - context_key_selectors: list[ContextKeySelector] | None = None - """ - The list of context key selectors that are configured for the event data - store. - """ - - aggregation_configurations: list[AggregationConfiguration] | None = None - """ - The list of aggregation configurations that are configured for the - trail. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_EVENT_CONFIGURATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.trail_arn is not None: - serializer.write_string( - _SCHEMA_GET_EVENT_CONFIGURATION_OUTPUT.members["TrailARN"], - self.trail_arn, - ) - - if self.event_data_store_arn is not None: - serializer.write_string( - _SCHEMA_GET_EVENT_CONFIGURATION_OUTPUT.members["EventDataStoreArn"], - self.event_data_store_arn, - ) - - if self.max_event_size is not None: - serializer.write_string( - _SCHEMA_GET_EVENT_CONFIGURATION_OUTPUT.members["MaxEventSize"], - self.max_event_size, - ) - - if self.context_key_selectors is not None: - _serialize_context_key_selectors( - serializer, - _SCHEMA_GET_EVENT_CONFIGURATION_OUTPUT.members["ContextKeySelectors"], - self.context_key_selectors, - ) - - if self.aggregation_configurations is not None: - _serialize_aggregation_configurations( - serializer, - _SCHEMA_GET_EVENT_CONFIGURATION_OUTPUT.members[ - "AggregationConfigurations" - ], - self.aggregation_configurations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["trail_arn"] = de.read_string( - _SCHEMA_GET_EVENT_CONFIGURATION_OUTPUT.members["TrailARN"] - ) - - case 1: - kwargs["event_data_store_arn"] = de.read_string( - _SCHEMA_GET_EVENT_CONFIGURATION_OUTPUT.members[ - "EventDataStoreArn" - ] - ) - - case 2: - kwargs["max_event_size"] = MaxEventSize( - de.read_string( - _SCHEMA_GET_EVENT_CONFIGURATION_OUTPUT.members[ - "MaxEventSize" - ] - ) - ) - - case 3: - kwargs["context_key_selectors"] = ( - _deserialize_context_key_selectors( - de, - _SCHEMA_GET_EVENT_CONFIGURATION_OUTPUT.members[ - "ContextKeySelectors" - ], - ) - ) - - case 4: - kwargs["aggregation_configurations"] = ( - _deserialize_aggregation_configurations( - de, - _SCHEMA_GET_EVENT_CONFIGURATION_OUTPUT.members[ - "AggregationConfigurations" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_EVENT_CONFIGURATION_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InvalidEventDataStoreStatusException(ServiceError): - """The event data store is not in a status that supports the operation.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_EVENT_DATA_STORE_STATUS_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_EVENT_DATA_STORE_STATUS_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_EVENT_DATA_STORE_STATUS_EXCEPTION.members[ - "Message" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVALID_EVENT_DATA_STORE_STATUS_EXCEPTION, consumer=_consumer - ) - return kwargs - - -GET_EVENT_CONFIGURATION = APIOperation( - input=GetEventConfigurationInput, - output=GetEventConfigurationOutput, - schema=_SCHEMA_GET_EVENT_CONFIGURATION, - input_schema=_SCHEMA_GET_EVENT_CONFIGURATION_INPUT, - output_schema=_SCHEMA_GET_EVENT_CONFIGURATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#CloudTrailARNInvalidException" - ): CloudTrailARNInvalidException, - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreARNInvalidException" - ): EventDataStoreARNInvalidException, - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreNotFoundException" - ): EventDataStoreNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidEventDataStoreCategoryException" - ): InvalidEventDataStoreCategoryException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidEventDataStoreStatusException" - ): InvalidEventDataStoreStatusException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidParameterCombinationException" - ): InvalidParameterCombinationException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidTrailNameException" - ): InvalidTrailNameException, - ShapeID( - "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException" - ): NoManagementAccountSLRExistsException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#TrailNotFoundException" - ): TrailNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CLOUD_TRAIL_ARN_INVALID_EXCEPTION, - _SCHEMA_EVENT_DATA_STORE_ARN_INVALID_EXCEPTION, - _SCHEMA_EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, - _SCHEMA_INVALID_EVENT_DATA_STORE_CATEGORY_EXCEPTION, - _SCHEMA_INVALID_EVENT_DATA_STORE_STATUS_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_COMBINATION_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_INVALID_TRAIL_NAME_EXCEPTION, - _SCHEMA_NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_TRAIL_NOT_FOUND_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetEventDataStoreInput: - """Dataclass for GetEventDataStoreInput structure.""" - - event_data_store: str | None = None - """ - The ARN (or ID suffix of the ARN) of the event data store about which - you want information. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_EVENT_DATA_STORE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.event_data_store is not None: - serializer.write_string( - _SCHEMA_GET_EVENT_DATA_STORE_INPUT.members["EventDataStore"], - self.event_data_store, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["event_data_store"] = de.read_string( - _SCHEMA_GET_EVENT_DATA_STORE_INPUT.members["EventDataStore"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_EVENT_DATA_STORE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class PartitionKey: - """Contains information about a partition key for an event data store.""" - - name: str - """The name of the partition key.""" - - type: str - """The data type of the partition key. For example, `bigint` or `string`.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PARTITION_KEY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_PARTITION_KEY.members["Name"], self.name) - serializer.write_string(_SCHEMA_PARTITION_KEY.members["Type"], self.type) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_PARTITION_KEY.members["Name"] - ) - - case 1: - kwargs["type"] = de.read_string( - _SCHEMA_PARTITION_KEY.members["Type"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PARTITION_KEY, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "type" not in kwargs: - kwargs["type"] = "" - return kwargs - - -def _serialize_partition_key_list( - serializer: ShapeSerializer, schema: Schema, value: list[PartitionKey] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_partition_key_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[PartitionKey]: - result: list[PartitionKey] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(PartitionKey.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GetEventDataStoreOutput: - """Dataclass for GetEventDataStoreOutput structure.""" - - event_data_store_arn: str | None = None - """The event data store Amazon Resource Number (ARN).""" - - name: str | None = None - """The name of the event data store.""" - - status: str | None = None - """The status of an event data store.""" - - advanced_event_selectors: list[AdvancedEventSelector] | None = None - """The advanced event selectors used to select events for the data store.""" - - multi_region_enabled: bool | None = None - """ - Indicates whether the event data store includes events from all Regions, - or only from the Region in which it was created. - """ - - organization_enabled: bool | None = None - """ - Indicates whether an event data store is collecting logged events for an - organization in Organizations. - """ - - retention_period: int | None = None - """The retention period of the event data store, in days.""" - - termination_protection_enabled: bool | None = None - """Indicates that termination protection is enabled.""" - - created_timestamp: datetime | None = None - """The timestamp of the event data store's creation.""" - - updated_timestamp: datetime | None = None - """ - Shows the time that an event data store was updated, if applicable. - `UpdatedTimestamp` is always either the same or newer than the time - shown in `CreatedTimestamp`. - """ - - kms_key_id: str | None = None - """ - Specifies the KMS key ID that encrypts the events delivered by - CloudTrail. The value is a fully specified ARN to a KMS key in the - following format. - - `arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012` - """ - - billing_mode: str | None = None - """The billing mode for the event data store.""" - - federation_status: str | None = None - """ - Indicates the [Lake query - federation](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-federation.html) - status. The status is `ENABLED` if Lake query federation is enabled, or - `DISABLED` if Lake query federation is disabled. You cannot delete an - event data store if the `FederationStatus` is `ENABLED`. - """ - - federation_role_arn: str | None = None - """ - If Lake query federation is enabled, provides the ARN of the federation - role used to access the resources for the federated event data store. - """ - - partition_keys: list[PartitionKey] | None = None - """ - The partition keys for the event data store. To improve query - performance and efficiency, CloudTrail Lake organizes event data into - partitions based on values derived from partition keys. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_EVENT_DATA_STORE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.event_data_store_arn is not None: - serializer.write_string( - _SCHEMA_GET_EVENT_DATA_STORE_OUTPUT.members["EventDataStoreArn"], - self.event_data_store_arn, - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_GET_EVENT_DATA_STORE_OUTPUT.members["Name"], self.name - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_GET_EVENT_DATA_STORE_OUTPUT.members["Status"], self.status - ) - - if self.advanced_event_selectors is not None: - _serialize_advanced_event_selectors( - serializer, - _SCHEMA_GET_EVENT_DATA_STORE_OUTPUT.members["AdvancedEventSelectors"], - self.advanced_event_selectors, - ) - - if self.multi_region_enabled is not None: - serializer.write_boolean( - _SCHEMA_GET_EVENT_DATA_STORE_OUTPUT.members["MultiRegionEnabled"], - self.multi_region_enabled, - ) - - if self.organization_enabled is not None: - serializer.write_boolean( - _SCHEMA_GET_EVENT_DATA_STORE_OUTPUT.members["OrganizationEnabled"], - self.organization_enabled, - ) - - if self.retention_period is not None: - serializer.write_integer( - _SCHEMA_GET_EVENT_DATA_STORE_OUTPUT.members["RetentionPeriod"], - self.retention_period, - ) - - if self.termination_protection_enabled is not None: - serializer.write_boolean( - _SCHEMA_GET_EVENT_DATA_STORE_OUTPUT.members[ - "TerminationProtectionEnabled" - ], - self.termination_protection_enabled, - ) - - if self.created_timestamp is not None: - serializer.write_timestamp( - _SCHEMA_GET_EVENT_DATA_STORE_OUTPUT.members["CreatedTimestamp"], - self.created_timestamp, - ) - - if self.updated_timestamp is not None: - serializer.write_timestamp( - _SCHEMA_GET_EVENT_DATA_STORE_OUTPUT.members["UpdatedTimestamp"], - self.updated_timestamp, - ) - - if self.kms_key_id is not None: - serializer.write_string( - _SCHEMA_GET_EVENT_DATA_STORE_OUTPUT.members["KmsKeyId"], self.kms_key_id - ) - - if self.billing_mode is not None: - serializer.write_string( - _SCHEMA_GET_EVENT_DATA_STORE_OUTPUT.members["BillingMode"], - self.billing_mode, - ) - - if self.federation_status is not None: - serializer.write_string( - _SCHEMA_GET_EVENT_DATA_STORE_OUTPUT.members["FederationStatus"], - self.federation_status, - ) - - if self.federation_role_arn is not None: - serializer.write_string( - _SCHEMA_GET_EVENT_DATA_STORE_OUTPUT.members["FederationRoleArn"], - self.federation_role_arn, - ) - - if self.partition_keys is not None: - _serialize_partition_key_list( - serializer, - _SCHEMA_GET_EVENT_DATA_STORE_OUTPUT.members["PartitionKeys"], - self.partition_keys, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["event_data_store_arn"] = de.read_string( - _SCHEMA_GET_EVENT_DATA_STORE_OUTPUT.members["EventDataStoreArn"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_GET_EVENT_DATA_STORE_OUTPUT.members["Name"] - ) - - case 2: - kwargs["status"] = EventDataStoreStatus( - de.read_string( - _SCHEMA_GET_EVENT_DATA_STORE_OUTPUT.members["Status"] - ) - ) - - case 3: - kwargs["advanced_event_selectors"] = ( - _deserialize_advanced_event_selectors( - de, - _SCHEMA_GET_EVENT_DATA_STORE_OUTPUT.members[ - "AdvancedEventSelectors" - ], - ) - ) - - case 4: - kwargs["multi_region_enabled"] = de.read_boolean( - _SCHEMA_GET_EVENT_DATA_STORE_OUTPUT.members[ - "MultiRegionEnabled" - ] - ) - - case 5: - kwargs["organization_enabled"] = de.read_boolean( - _SCHEMA_GET_EVENT_DATA_STORE_OUTPUT.members[ - "OrganizationEnabled" - ] - ) - - case 6: - kwargs["retention_period"] = de.read_integer( - _SCHEMA_GET_EVENT_DATA_STORE_OUTPUT.members["RetentionPeriod"] - ) - - case 7: - kwargs["termination_protection_enabled"] = de.read_boolean( - _SCHEMA_GET_EVENT_DATA_STORE_OUTPUT.members[ - "TerminationProtectionEnabled" - ] - ) - - case 8: - kwargs["created_timestamp"] = de.read_timestamp( - _SCHEMA_GET_EVENT_DATA_STORE_OUTPUT.members["CreatedTimestamp"] - ) - - case 9: - kwargs["updated_timestamp"] = de.read_timestamp( - _SCHEMA_GET_EVENT_DATA_STORE_OUTPUT.members["UpdatedTimestamp"] - ) - - case 10: - kwargs["kms_key_id"] = de.read_string( - _SCHEMA_GET_EVENT_DATA_STORE_OUTPUT.members["KmsKeyId"] - ) - - case 11: - kwargs["billing_mode"] = BillingMode( - de.read_string( - _SCHEMA_GET_EVENT_DATA_STORE_OUTPUT.members["BillingMode"] - ) - ) - - case 12: - kwargs["federation_status"] = FederationStatus( - de.read_string( - _SCHEMA_GET_EVENT_DATA_STORE_OUTPUT.members[ - "FederationStatus" - ] - ) - ) - - case 13: - kwargs["federation_role_arn"] = de.read_string( - _SCHEMA_GET_EVENT_DATA_STORE_OUTPUT.members["FederationRoleArn"] - ) - - case 14: - kwargs["partition_keys"] = _deserialize_partition_key_list( - de, _SCHEMA_GET_EVENT_DATA_STORE_OUTPUT.members["PartitionKeys"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_EVENT_DATA_STORE_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_EVENT_DATA_STORE = APIOperation( - input=GetEventDataStoreInput, - output=GetEventDataStoreOutput, - schema=_SCHEMA_GET_EVENT_DATA_STORE, - input_schema=_SCHEMA_GET_EVENT_DATA_STORE_INPUT, - output_schema=_SCHEMA_GET_EVENT_DATA_STORE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreARNInvalidException" - ): EventDataStoreARNInvalidException, - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreNotFoundException" - ): EventDataStoreNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException" - ): NoManagementAccountSLRExistsException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_EVENT_DATA_STORE_ARN_INVALID_EXCEPTION, - _SCHEMA_EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetEventSelectorsInput: - """Dataclass for GetEventSelectorsInput structure.""" - - trail_name: str | None = None - """ - Specifies the name of the trail or trail ARN. If you specify a trail - name, the string must meet the following requirements: - - - Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), - underscores (_), or dashes (-) - - - Start with a letter or number, and end with a letter or number - - - Be between 3 and 128 characters - - - Have no adjacent periods, underscores or dashes. Names like - `my-_namespace` and `my--namespace` are not valid. - - - Not be in IP address format (for example, 192.168.5.4) - - If you specify a trail ARN, it must be in the format: - - `arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail` - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_EVENT_SELECTORS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.trail_name is not None: - serializer.write_string( - _SCHEMA_GET_EVENT_SELECTORS_INPUT.members["TrailName"], self.trail_name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["trail_name"] = de.read_string( - _SCHEMA_GET_EVENT_SELECTORS_INPUT.members["TrailName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_EVENT_SELECTORS_INPUT, consumer=_consumer) - return kwargs - - -def _serialize_data_resource_values( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_data_resource_values( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class DataResource: - """ - You can configure the `DataResource` in an `EventSelector` to log data - events for the following three resource types: - - - `AWS::DynamoDB::Table` - - - `AWS::Lambda::Function` - - - `AWS::S3::Object` - - To log data events for all other resource types including objects stored - in [directory - buckets](https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-overview.html), - you must use - [AdvancedEventSelectors](https://docs.aws.amazon.com/awscloudtrail/latest/APIReference/API_AdvancedEventSelector.html). - You must also use `AdvancedEventSelectors` if you want to filter on the - `eventName` field. - - Configure the `DataResource` to specify the resource type and resource - ARNs for which you want to log data events. - - Note: - The total number of allowed data resources is 250. This number can be - distributed between 1 and 5 event selectors, but the total cannot exceed - 250 across all selectors for the trail. - - The following example demonstrates how logging works when you configure - logging of all data events for a general purpose bucket named - `amzn-s3-demo-bucket1`. In this example, the CloudTrail user specified - an empty prefix, and the option to log both `Read` and `Write` data - events. - - 1. A user uploads an image file to `amzn-s3-demo-bucket1`. - - 2. The `PutObject` API operation is an Amazon S3 object-level API. It - is recorded as a data event in CloudTrail. Because the CloudTrail - user specified an S3 bucket with an empty prefix, events that occur - on any object in that bucket are logged. The trail processes and - logs the event. - - 3. A user uploads an object to an Amazon S3 bucket named - `arn:aws:s3:::amzn-s3-demo-bucket1`. - - 4. The `PutObject` API operation occurred for an object in an S3 bucket - that the CloudTrail user didn't specify for the trail. The trail - doesn't log the event. - - The following example demonstrates how logging works when you configure - logging of Lambda data events for a Lambda function named - *MyLambdaFunction*, but not for all Lambda functions. - - 1. A user runs a script that includes a call to the *MyLambdaFunction* - function and the *MyOtherLambdaFunction* function. - - 2. The `Invoke` API operation on *MyLambdaFunction* is an Lambda API. - It is recorded as a data event in CloudTrail. Because the CloudTrail - user specified logging data events for *MyLambdaFunction*, any - invocations of that function are logged. The trail processes and - logs the event. - - 3. The `Invoke` API operation on *MyOtherLambdaFunction* is an Lambda - API. Because the CloudTrail user did not specify logging data events - for all Lambda functions, the `Invoke` operation for - *MyOtherLambdaFunction* does not match the function specified for - the trail. The trail doesn't log the event. - """ - - type: str | None = None - """ - The resource type in which you want to log data events. You can specify - the following *basic* event selector resource types: - - - `AWS::DynamoDB::Table` - - - `AWS::Lambda::Function` - - - `AWS::S3::Object` - - Additional resource types are available through *advanced* event - selectors. For more information, see - [AdvancedEventSelector](https://docs.aws.amazon.com/awscloudtrail/latest/APIReference/API_AdvancedEventSelector.html). - """ - - values: list[str] | None = None - """ - An array of Amazon Resource Name (ARN) strings or partial ARN strings - for the specified resource type. - - - To log data events for all objects in all S3 buckets in your Amazon - Web Services account, specify the prefix as `arn:aws:s3`. - - Note: - This also enables logging of data event activity performed by any user - or role in your Amazon Web Services account, even if that activity is - performed on a bucket that belongs to another Amazon Web Services - account. - - - To log data events for all objects in an S3 bucket, specify the bucket - and an empty object prefix such as - `arn:aws:s3:::amzn-s3-demo-bucket1/`. The trail logs data events for - all objects in this S3 bucket. - - - To log data events for specific objects, specify the S3 bucket and - object prefix such as - `arn:aws:s3:::amzn-s3-demo-bucket1/example-images`. The trail logs - data events for objects in this S3 bucket that match the prefix. - - - To log data events for all Lambda functions in your Amazon Web - Services account, specify the prefix as `arn:aws:lambda`. - - Note: - This also enables logging of `Invoke` activity performed by any user - or role in your Amazon Web Services account, even if that activity is - performed on a function that belongs to another Amazon Web Services - account. - - - To log data events for a specific Lambda function, specify the - function ARN. - - Note: - Lambda function ARNs are exact. For example, if you specify a function - ARN *arn:aws:lambda:us-west-2:111111111111:function:helloworld*, data - events will only be logged for - *arn:aws:lambda:us-west-2:111111111111:function:helloworld*. They will - not be logged for - *arn:aws:lambda:us-west-2:111111111111:function:helloworld2*. - - - To log data events for all DynamoDB tables in your Amazon Web Services - account, specify the prefix as `arn:aws:dynamodb`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DATA_RESOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string(_SCHEMA_DATA_RESOURCE.members["Type"], self.type) - - if self.values is not None: - _serialize_data_resource_values( - serializer, _SCHEMA_DATA_RESOURCE.members["Values"], self.values - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_DATA_RESOURCE.members["Type"] - ) - - case 1: - kwargs["values"] = _deserialize_data_resource_values( - de, _SCHEMA_DATA_RESOURCE.members["Values"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DATA_RESOURCE, consumer=_consumer) - return kwargs - - -def _serialize_data_resources( - serializer: ShapeSerializer, schema: Schema, value: list[DataResource] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_data_resources( - deserializer: ShapeDeserializer, schema: Schema -) -> list[DataResource]: - result: list[DataResource] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(DataResource.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_exclude_management_event_sources( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_exclude_management_event_sources( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -class ReadWriteType(UnknownEnumMixin, StrEnum): - READ_ONLY = "ReadOnly" - WRITE_ONLY = "WriteOnly" - ALL = "All" - - -@dataclass(kw_only=True) -class EventSelector: - """ - Use event selectors to further specify the management and data event - settings for your trail. By default, trails created without specific - event selectors will be configured to log all read and write management - events, and no data events. When an event occurs in your account, - CloudTrail evaluates the event selector for all trails. For each trail, - if the event matches any event selector, the trail processes and logs - the event. If the event doesn't match any event selector, the trail - doesn't log the event. - - You can configure up to five event selectors for a trail. - - You cannot apply both event selectors and advanced event selectors to a - trail. - """ - - read_write_type: str | None = None - """ - Specify if you want your trail to log read-only events, write-only - events, or all. For example, the EC2 `GetConsoleOutput` is a read-only - API operation and `RunInstances` is a write-only API operation. - - By default, the value is `All`. - """ - - include_management_events: bool | None = None - """ - Specify if you want your event selector to include management events for - your trail. - - For more information, see [Management - Events](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-management-events-with-cloudtrail.html) - in the *CloudTrail User Guide*. - - By default, the value is `true`. - - The first copy of management events is free. You are charged for - additional copies of management events that you are logging on any - subsequent trail in the same Region. For more information about - CloudTrail pricing, see [CloudTrail - Pricing](http://aws.amazon.com/cloudtrail/pricing/). - """ - - data_resources: list[DataResource] | None = None - """ - CloudTrail supports data event logging for Amazon S3 objects in standard - S3 buckets, Lambda functions, and Amazon DynamoDB tables with basic - event selectors. You can specify up to 250 resources for an individual - event selector, but the total number of data resources cannot exceed 250 - across all event selectors in a trail. This limit does not apply if you - configure resource logging for all data events. - - For more information, see [Data - Events](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html) - and [Limits in - CloudTrail](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/WhatIsCloudTrail-Limits.html) - in the *CloudTrail User Guide*. - - Note: - To log data events for all other resource types including objects stored - in [directory - buckets](https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-overview.html), - you must use - [AdvancedEventSelectors](https://docs.aws.amazon.com/awscloudtrail/latest/APIReference/API_AdvancedEventSelector.html). - You must also use `AdvancedEventSelectors` if you want to filter on the - `eventName` field. - """ - - exclude_management_event_sources: list[str] | None = None - """ - An optional list of service event sources from which you do not want - management events to be logged on your trail. In this release, the list - can be empty (disables the filter), or it can filter out Key Management - Service or Amazon RDS Data API events by containing `kms.amazonaws.com` - or `rdsdata.amazonaws.com`. By default, `ExcludeManagementEventSources` - is empty, and KMS and Amazon RDS Data API events are logged to your - trail. You can exclude management event sources only in Regions that - support the event source. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVENT_SELECTOR, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.read_write_type is not None: - serializer.write_string( - _SCHEMA_EVENT_SELECTOR.members["ReadWriteType"], self.read_write_type - ) - - if self.include_management_events is not None: - serializer.write_boolean( - _SCHEMA_EVENT_SELECTOR.members["IncludeManagementEvents"], - self.include_management_events, - ) - - if self.data_resources is not None: - _serialize_data_resources( - serializer, - _SCHEMA_EVENT_SELECTOR.members["DataResources"], - self.data_resources, - ) - - if self.exclude_management_event_sources is not None: - _serialize_exclude_management_event_sources( - serializer, - _SCHEMA_EVENT_SELECTOR.members["ExcludeManagementEventSources"], - self.exclude_management_event_sources, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["read_write_type"] = ReadWriteType( - de.read_string(_SCHEMA_EVENT_SELECTOR.members["ReadWriteType"]) - ) - - case 1: - kwargs["include_management_events"] = de.read_boolean( - _SCHEMA_EVENT_SELECTOR.members["IncludeManagementEvents"] - ) - - case 2: - kwargs["data_resources"] = _deserialize_data_resources( - de, _SCHEMA_EVENT_SELECTOR.members["DataResources"] - ) - - case 3: - kwargs["exclude_management_event_sources"] = ( - _deserialize_exclude_management_event_sources( - de, - _SCHEMA_EVENT_SELECTOR.members[ - "ExcludeManagementEventSources" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EVENT_SELECTOR, consumer=_consumer) - return kwargs - - -def _serialize_event_selectors( - serializer: ShapeSerializer, schema: Schema, value: list[EventSelector] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_event_selectors( - deserializer: ShapeDeserializer, schema: Schema -) -> list[EventSelector]: - result: list[EventSelector] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(EventSelector.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GetEventSelectorsOutput: - """Dataclass for GetEventSelectorsOutput structure.""" - - trail_arn: str | None = None - """The specified trail ARN that has the event selectors.""" - - event_selectors: list[EventSelector] | None = None - """The event selectors that are configured for the trail.""" - - advanced_event_selectors: list[AdvancedEventSelector] | None = None - """The advanced event selectors that are configured for the trail.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_EVENT_SELECTORS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.trail_arn is not None: - serializer.write_string( - _SCHEMA_GET_EVENT_SELECTORS_OUTPUT.members["TrailARN"], self.trail_arn - ) - - if self.event_selectors is not None: - _serialize_event_selectors( - serializer, - _SCHEMA_GET_EVENT_SELECTORS_OUTPUT.members["EventSelectors"], - self.event_selectors, - ) - - if self.advanced_event_selectors is not None: - _serialize_advanced_event_selectors( - serializer, - _SCHEMA_GET_EVENT_SELECTORS_OUTPUT.members["AdvancedEventSelectors"], - self.advanced_event_selectors, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["trail_arn"] = de.read_string( - _SCHEMA_GET_EVENT_SELECTORS_OUTPUT.members["TrailARN"] - ) - - case 1: - kwargs["event_selectors"] = _deserialize_event_selectors( - de, _SCHEMA_GET_EVENT_SELECTORS_OUTPUT.members["EventSelectors"] - ) - - case 2: - kwargs["advanced_event_selectors"] = ( - _deserialize_advanced_event_selectors( - de, - _SCHEMA_GET_EVENT_SELECTORS_OUTPUT.members[ - "AdvancedEventSelectors" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_EVENT_SELECTORS_OUTPUT, consumer=_consumer) - return kwargs - - -GET_EVENT_SELECTORS = APIOperation( - input=GetEventSelectorsInput, - output=GetEventSelectorsOutput, - schema=_SCHEMA_GET_EVENT_SELECTORS, - input_schema=_SCHEMA_GET_EVENT_SELECTORS_INPUT, - output_schema=_SCHEMA_GET_EVENT_SELECTORS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#CloudTrailARNInvalidException" - ): CloudTrailARNInvalidException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidTrailNameException" - ): InvalidTrailNameException, - ShapeID( - "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException" - ): NoManagementAccountSLRExistsException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#TrailNotFoundException" - ): TrailNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CLOUD_TRAIL_ARN_INVALID_EXCEPTION, - _SCHEMA_INVALID_TRAIL_NAME_EXCEPTION, - _SCHEMA_NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_TRAIL_NOT_FOUND_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetImportInput: - """Dataclass for GetImportInput structure.""" - - import_id: str | None = None - """The ID for the import.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_IMPORT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.import_id is not None: - serializer.write_string( - _SCHEMA_GET_IMPORT_INPUT.members["ImportId"], self.import_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["import_id"] = de.read_string( - _SCHEMA_GET_IMPORT_INPUT.members["ImportId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_IMPORT_INPUT, consumer=_consumer) - return kwargs - - -def _serialize_import_destinations( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_import_destinations( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class S3ImportSource: - """The settings for the source S3 bucket.""" - - s3_location_uri: str - """The URI for the source S3 bucket.""" - - s3_bucket_region: str - """The Region associated with the source S3 bucket.""" - - s3_bucket_access_role_arn: str - """The IAM ARN role used to access the source S3 bucket.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_S3_IMPORT_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_S3_IMPORT_SOURCE.members["S3LocationUri"], self.s3_location_uri - ) - serializer.write_string( - _SCHEMA_S3_IMPORT_SOURCE.members["S3BucketRegion"], self.s3_bucket_region - ) - serializer.write_string( - _SCHEMA_S3_IMPORT_SOURCE.members["S3BucketAccessRoleArn"], - self.s3_bucket_access_role_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["s3_location_uri"] = de.read_string( - _SCHEMA_S3_IMPORT_SOURCE.members["S3LocationUri"] - ) - - case 1: - kwargs["s3_bucket_region"] = de.read_string( - _SCHEMA_S3_IMPORT_SOURCE.members["S3BucketRegion"] - ) - - case 2: - kwargs["s3_bucket_access_role_arn"] = de.read_string( - _SCHEMA_S3_IMPORT_SOURCE.members["S3BucketAccessRoleArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_S3_IMPORT_SOURCE, consumer=_consumer) - if "s3_location_uri" not in kwargs: - kwargs["s3_location_uri"] = "" - if "s3_bucket_region" not in kwargs: - kwargs["s3_bucket_region"] = "" - if "s3_bucket_access_role_arn" not in kwargs: - kwargs["s3_bucket_access_role_arn"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls( - s3_location_uri="", s3_bucket_region="", s3_bucket_access_role_arn="" - ) - - -@dataclass(kw_only=True) -class ImportSource: - """The import source.""" - - s3: S3ImportSource - """The source S3 bucket.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IMPORT_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IMPORT_SOURCE.members["S3"], self.s3) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["s3"] = S3ImportSource.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_IMPORT_SOURCE, consumer=_consumer) - if "s3" not in kwargs: - kwargs["s3"] = S3ImportSource._smithy_default() - return kwargs - - -@dataclass(kw_only=True) -class ImportStatistics: - """ - Provides statistics for the specified `ImportID`. CloudTrail does not - update import statistics in real-time. Returned values for parameters - such as `EventsCompleted` may be lower than the actual value, because - CloudTrail updates statistics incrementally over the course of the - import. - """ - - prefixes_found: int | None = None - """The number of S3 prefixes found for the import.""" - - prefixes_completed: int | None = None - """The number of S3 prefixes that completed import.""" - - files_completed: int | None = None - """The number of log files that completed import.""" - - events_completed: int | None = None - """The number of trail events imported into the event data store.""" - - failed_entries: int | None = None - """The number of failed entries.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IMPORT_STATISTICS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.prefixes_found is not None: - serializer.write_long( - _SCHEMA_IMPORT_STATISTICS.members["PrefixesFound"], self.prefixes_found - ) - - if self.prefixes_completed is not None: - serializer.write_long( - _SCHEMA_IMPORT_STATISTICS.members["PrefixesCompleted"], - self.prefixes_completed, - ) - - if self.files_completed is not None: - serializer.write_long( - _SCHEMA_IMPORT_STATISTICS.members["FilesCompleted"], - self.files_completed, - ) - - if self.events_completed is not None: - serializer.write_long( - _SCHEMA_IMPORT_STATISTICS.members["EventsCompleted"], - self.events_completed, - ) - - if self.failed_entries is not None: - serializer.write_long( - _SCHEMA_IMPORT_STATISTICS.members["FailedEntries"], self.failed_entries - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["prefixes_found"] = de.read_long( - _SCHEMA_IMPORT_STATISTICS.members["PrefixesFound"] - ) - - case 1: - kwargs["prefixes_completed"] = de.read_long( - _SCHEMA_IMPORT_STATISTICS.members["PrefixesCompleted"] - ) - - case 2: - kwargs["files_completed"] = de.read_long( - _SCHEMA_IMPORT_STATISTICS.members["FilesCompleted"] - ) - - case 3: - kwargs["events_completed"] = de.read_long( - _SCHEMA_IMPORT_STATISTICS.members["EventsCompleted"] - ) - - case 4: - kwargs["failed_entries"] = de.read_long( - _SCHEMA_IMPORT_STATISTICS.members["FailedEntries"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_IMPORT_STATISTICS, consumer=_consumer) - return kwargs - - -class ImportStatus(UnknownEnumMixin, StrEnum): - INITIALIZING = "INITIALIZING" - IN_PROGRESS = "IN_PROGRESS" - FAILED = "FAILED" - STOPPED = "STOPPED" - COMPLETED = "COMPLETED" - - -@dataclass(kw_only=True) -class GetImportOutput: - """Dataclass for GetImportOutput structure.""" - - import_id: str | None = None - """The ID of the import.""" - - destinations: list[str] | None = None - """The ARN of the destination event data store.""" - - import_source: ImportSource | None = None - """The source S3 bucket.""" - - start_event_time: datetime | None = None - """ - Used with `EndEventTime` to bound a `StartImport` request, and limit - imported trail events to only those events logged within a specified - time period. - """ - - end_event_time: datetime | None = None - """ - Used with `StartEventTime` to bound a `StartImport` request, and limit - imported trail events to only those events logged within a specified - time period. - """ - - import_status: str | None = None - """The status of the import.""" - - created_timestamp: datetime | None = None - """The timestamp of the import's creation.""" - - updated_timestamp: datetime | None = None - """The timestamp of when the import was updated.""" - - import_statistics: ImportStatistics | None = None - """ - Provides statistics for the import. CloudTrail does not update import - statistics in real-time. Returned values for parameters such as - `EventsCompleted` may be lower than the actual value, because CloudTrail - updates statistics incrementally over the course of the import. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_IMPORT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.import_id is not None: - serializer.write_string( - _SCHEMA_GET_IMPORT_OUTPUT.members["ImportId"], self.import_id - ) - - if self.destinations is not None: - _serialize_import_destinations( - serializer, - _SCHEMA_GET_IMPORT_OUTPUT.members["Destinations"], - self.destinations, - ) - - if self.import_source is not None: - serializer.write_struct( - _SCHEMA_GET_IMPORT_OUTPUT.members["ImportSource"], self.import_source - ) - - if self.start_event_time is not None: - serializer.write_timestamp( - _SCHEMA_GET_IMPORT_OUTPUT.members["StartEventTime"], - self.start_event_time, - ) - - if self.end_event_time is not None: - serializer.write_timestamp( - _SCHEMA_GET_IMPORT_OUTPUT.members["EndEventTime"], self.end_event_time - ) - - if self.import_status is not None: - serializer.write_string( - _SCHEMA_GET_IMPORT_OUTPUT.members["ImportStatus"], self.import_status - ) - - if self.created_timestamp is not None: - serializer.write_timestamp( - _SCHEMA_GET_IMPORT_OUTPUT.members["CreatedTimestamp"], - self.created_timestamp, - ) - - if self.updated_timestamp is not None: - serializer.write_timestamp( - _SCHEMA_GET_IMPORT_OUTPUT.members["UpdatedTimestamp"], - self.updated_timestamp, - ) - - if self.import_statistics is not None: - serializer.write_struct( - _SCHEMA_GET_IMPORT_OUTPUT.members["ImportStatistics"], - self.import_statistics, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["import_id"] = de.read_string( - _SCHEMA_GET_IMPORT_OUTPUT.members["ImportId"] - ) - - case 1: - kwargs["destinations"] = _deserialize_import_destinations( - de, _SCHEMA_GET_IMPORT_OUTPUT.members["Destinations"] - ) - - case 2: - kwargs["import_source"] = ImportSource.deserialize(de) - - case 3: - kwargs["start_event_time"] = de.read_timestamp( - _SCHEMA_GET_IMPORT_OUTPUT.members["StartEventTime"] - ) - - case 4: - kwargs["end_event_time"] = de.read_timestamp( - _SCHEMA_GET_IMPORT_OUTPUT.members["EndEventTime"] - ) - - case 5: - kwargs["import_status"] = ImportStatus( - de.read_string( - _SCHEMA_GET_IMPORT_OUTPUT.members["ImportStatus"] - ) - ) - - case 6: - kwargs["created_timestamp"] = de.read_timestamp( - _SCHEMA_GET_IMPORT_OUTPUT.members["CreatedTimestamp"] - ) - - case 7: - kwargs["updated_timestamp"] = de.read_timestamp( - _SCHEMA_GET_IMPORT_OUTPUT.members["UpdatedTimestamp"] - ) - - case 8: - kwargs["import_statistics"] = ImportStatistics.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_IMPORT_OUTPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ImportNotFoundException(ServiceError): - """The specified import was not found.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IMPORT_NOT_FOUND_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_IMPORT_NOT_FOUND_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_IMPORT_NOT_FOUND_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_IMPORT_NOT_FOUND_EXCEPTION, consumer=_consumer) - return kwargs - - -GET_IMPORT = APIOperation( - input=GetImportInput, - output=GetImportOutput, - schema=_SCHEMA_GET_IMPORT, - input_schema=_SCHEMA_GET_IMPORT_INPUT, - output_schema=_SCHEMA_GET_IMPORT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#ImportNotFoundException" - ): ImportNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_IMPORT_NOT_FOUND_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetInsightSelectorsInput: - """Dataclass for GetInsightSelectorsInput structure.""" - - trail_name: str | None = None - """ - Specifies the name of the trail or trail ARN. If you specify a trail - name, the string must meet the following requirements: - - - Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), - underscores (_), or dashes (-) - - - Start with a letter or number, and end with a letter or number - - - Be between 3 and 128 characters - - - Have no adjacent periods, underscores or dashes. Names like - `my-_namespace` and `my--namespace` are not valid. - - - Not be in IP address format (for example, 192.168.5.4) - - If you specify a trail ARN, it must be in the format: - - `arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail` - - You cannot use this parameter with the `EventDataStore` parameter. - """ - - event_data_store: str | None = None - """ - Specifies the ARN (or ID suffix of the ARN) of the event data store for - which you want to get Insights selectors. - - You cannot use this parameter with the `TrailName` parameter. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_INSIGHT_SELECTORS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.trail_name is not None: - serializer.write_string( - _SCHEMA_GET_INSIGHT_SELECTORS_INPUT.members["TrailName"], - self.trail_name, - ) - - if self.event_data_store is not None: - serializer.write_string( - _SCHEMA_GET_INSIGHT_SELECTORS_INPUT.members["EventDataStore"], - self.event_data_store, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["trail_name"] = de.read_string( - _SCHEMA_GET_INSIGHT_SELECTORS_INPUT.members["TrailName"] - ) - - case 1: - kwargs["event_data_store"] = de.read_string( - _SCHEMA_GET_INSIGHT_SELECTORS_INPUT.members["EventDataStore"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_INSIGHT_SELECTORS_INPUT, consumer=_consumer - ) - return kwargs - - -class SourceEventCategory(UnknownEnumMixin, StrEnum): - MANAGEMENT = "Management" - DATA = "Data" - - -def _serialize_source_event_categories( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_source_event_categories( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(SourceEventCategory(d.read_string(member_schema))) - - deserializer.read_list(schema, _read_value) - return result - - -class InsightType(UnknownEnumMixin, StrEnum): - API_CALL_RATE_INSIGHT = "ApiCallRateInsight" - API_ERROR_RATE_INSIGHT = "ApiErrorRateInsight" - - -@dataclass(kw_only=True) -class InsightSelector: - """ - A JSON string that contains a list of Insights types that are logged on - a trail or event data store. - """ - - insight_type: str | None = None - """ - The type of Insights events to log on a trail or event data store. - `ApiCallRateInsight` and `ApiErrorRateInsight` are valid Insight types. - - The `ApiCallRateInsight` Insights type analyzes write-only management - API calls or read and write data API calls that are aggregated per - minute against a baseline API call volume. - - The `ApiErrorRateInsight` Insights type analyzes management and data API - calls that result in error codes. The error is shown if the API call is - unsuccessful. - """ - - event_categories: list[str] | None = None - """ - Select the event category on which Insights should be enabled. - - - If EventCategories is not provided, the specified Insights types are - enabled on management API calls by default. - - - If EventCategories is provided, the given event categories will - overwrite the existing ones. For example, if a trail already has - Insights enabled on management events, and then a PutInsightSelectors - request is made with only data events specified in EventCategories, - Insights on management events will be disabled. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INSIGHT_SELECTOR, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.insight_type is not None: - serializer.write_string( - _SCHEMA_INSIGHT_SELECTOR.members["InsightType"], self.insight_type - ) - - if self.event_categories is not None: - _serialize_source_event_categories( - serializer, - _SCHEMA_INSIGHT_SELECTOR.members["EventCategories"], - self.event_categories, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["insight_type"] = InsightType( - de.read_string(_SCHEMA_INSIGHT_SELECTOR.members["InsightType"]) - ) - - case 1: - kwargs["event_categories"] = _deserialize_source_event_categories( - de, _SCHEMA_INSIGHT_SELECTOR.members["EventCategories"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INSIGHT_SELECTOR, consumer=_consumer) - return kwargs - - -def _serialize_insight_selectors( - serializer: ShapeSerializer, schema: Schema, value: list[InsightSelector] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_insight_selectors( - deserializer: ShapeDeserializer, schema: Schema -) -> list[InsightSelector]: - result: list[InsightSelector] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(InsightSelector.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GetInsightSelectorsOutput: - """Dataclass for GetInsightSelectorsOutput structure.""" - - trail_arn: str | None = None - """ - The Amazon Resource Name (ARN) of a trail for which you want to get - Insights selectors. - """ - - insight_selectors: list[InsightSelector] | None = None - """ - Contains the Insights types that are enabled on a trail or event data - store. It also specifies the event categories on which a particular - Insight type is enabled. `ApiCallRateInsight` and `ApiErrorRateInsight` - are valid Insight types.The EventCategory field can specify `Management` - or `Data` events or both. For event data store, you can log Insights for - management events only. - """ - - event_data_store_arn: str | None = None - """The ARN of the source event data store that enabled Insights events.""" - - insights_destination: str | None = None - """The ARN of the destination event data store that logs Insights events.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_INSIGHT_SELECTORS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.trail_arn is not None: - serializer.write_string( - _SCHEMA_GET_INSIGHT_SELECTORS_OUTPUT.members["TrailARN"], self.trail_arn - ) - - if self.insight_selectors is not None: - _serialize_insight_selectors( - serializer, - _SCHEMA_GET_INSIGHT_SELECTORS_OUTPUT.members["InsightSelectors"], - self.insight_selectors, - ) - - if self.event_data_store_arn is not None: - serializer.write_string( - _SCHEMA_GET_INSIGHT_SELECTORS_OUTPUT.members["EventDataStoreArn"], - self.event_data_store_arn, - ) - - if self.insights_destination is not None: - serializer.write_string( - _SCHEMA_GET_INSIGHT_SELECTORS_OUTPUT.members["InsightsDestination"], - self.insights_destination, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["trail_arn"] = de.read_string( - _SCHEMA_GET_INSIGHT_SELECTORS_OUTPUT.members["TrailARN"] - ) - - case 1: - kwargs["insight_selectors"] = _deserialize_insight_selectors( - de, - _SCHEMA_GET_INSIGHT_SELECTORS_OUTPUT.members[ - "InsightSelectors" - ], - ) - - case 2: - kwargs["event_data_store_arn"] = de.read_string( - _SCHEMA_GET_INSIGHT_SELECTORS_OUTPUT.members[ - "EventDataStoreArn" - ] - ) - - case 3: - kwargs["insights_destination"] = de.read_string( - _SCHEMA_GET_INSIGHT_SELECTORS_OUTPUT.members[ - "InsightsDestination" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_INSIGHT_SELECTORS_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InsightNotEnabledException(ServiceError): - """ - If you run `GetInsightSelectors` on a trail or event data store that - does not have Insights events enabled, the operation throws the - exception `InsightNotEnabledException`. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INSIGHT_NOT_ENABLED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INSIGHT_NOT_ENABLED_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INSIGHT_NOT_ENABLED_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INSIGHT_NOT_ENABLED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -GET_INSIGHT_SELECTORS = APIOperation( - input=GetInsightSelectorsInput, - output=GetInsightSelectorsOutput, - schema=_SCHEMA_GET_INSIGHT_SELECTORS, - input_schema=_SCHEMA_GET_INSIGHT_SELECTORS_INPUT, - output_schema=_SCHEMA_GET_INSIGHT_SELECTORS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#CloudTrailARNInvalidException" - ): CloudTrailARNInvalidException, - ShapeID( - "com.amazonaws.cloudtrail#InsightNotEnabledException" - ): InsightNotEnabledException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidParameterCombinationException" - ): InvalidParameterCombinationException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidTrailNameException" - ): InvalidTrailNameException, - ShapeID( - "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException" - ): NoManagementAccountSLRExistsException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.cloudtrail#TrailNotFoundException" - ): TrailNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CLOUD_TRAIL_ARN_INVALID_EXCEPTION, - _SCHEMA_INSIGHT_NOT_ENABLED_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_COMBINATION_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_INVALID_TRAIL_NAME_EXCEPTION, - _SCHEMA_NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_TRAIL_NOT_FOUND_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetQueryResultsInput: - """Dataclass for GetQueryResultsInput structure.""" - - event_data_store: str | None = None - """ - The ARN (or ID suffix of the ARN) of the event data store against which - the query was run. - """ - - query_id: str | None = None - """The ID of the query for which you want to get results.""" - - next_token: str | None = None - """A token you can use to get the next page of query results.""" - - max_query_results: int | None = None - """The maximum number of query results to display on a single page.""" - - event_data_store_owner_account_id: str | None = None - """The account ID of the event data store owner.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_QUERY_RESULTS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.event_data_store is not None: - serializer.write_string( - _SCHEMA_GET_QUERY_RESULTS_INPUT.members["EventDataStore"], - self.event_data_store, - ) - - if self.query_id is not None: - serializer.write_string( - _SCHEMA_GET_QUERY_RESULTS_INPUT.members["QueryId"], self.query_id - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_GET_QUERY_RESULTS_INPUT.members["NextToken"], self.next_token - ) - - if self.max_query_results is not None: - serializer.write_integer( - _SCHEMA_GET_QUERY_RESULTS_INPUT.members["MaxQueryResults"], - self.max_query_results, - ) - - if self.event_data_store_owner_account_id is not None: - serializer.write_string( - _SCHEMA_GET_QUERY_RESULTS_INPUT.members["EventDataStoreOwnerAccountId"], - self.event_data_store_owner_account_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["event_data_store"] = de.read_string( - _SCHEMA_GET_QUERY_RESULTS_INPUT.members["EventDataStore"] - ) - - case 1: - kwargs["query_id"] = de.read_string( - _SCHEMA_GET_QUERY_RESULTS_INPUT.members["QueryId"] - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_GET_QUERY_RESULTS_INPUT.members["NextToken"] - ) - - case 3: - kwargs["max_query_results"] = de.read_integer( - _SCHEMA_GET_QUERY_RESULTS_INPUT.members["MaxQueryResults"] - ) - - case 4: - kwargs["event_data_store_owner_account_id"] = de.read_string( - _SCHEMA_GET_QUERY_RESULTS_INPUT.members[ - "EventDataStoreOwnerAccountId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_QUERY_RESULTS_INPUT, consumer=_consumer) - return kwargs - - -def _serialize_query_result_column( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_query_result_column( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -def _serialize_query_result_row( - serializer: ShapeSerializer, schema: Schema, value: list[dict[str, str]] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - _serialize_query_result_column(ls, member_schema, e) - - -def _deserialize_query_result_row( - deserializer: ShapeDeserializer, schema: Schema -) -> list[dict[str, str]]: - result: list[dict[str, str]] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_deserialize_query_result_column(d, member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_query_result_rows( - serializer: ShapeSerializer, schema: Schema, value: list[list[dict[str, str]]] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - _serialize_query_result_row(ls, member_schema, e) - - -def _deserialize_query_result_rows( - deserializer: ShapeDeserializer, schema: Schema -) -> list[list[dict[str, str]]]: - result: list[list[dict[str, str]]] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_deserialize_query_result_row(d, member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class QueryStatistics: - """Metadata about a query, such as the number of results.""" - - results_count: int | None = None - """The number of results returned.""" - - total_results_count: int | None = None - """The total number of results returned by a query.""" - - bytes_scanned: int | None = None - """ - The total bytes that the query scanned in the event data store. This - value matches the number of bytes for which your account is billed for - the query, unless the query is still running. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_QUERY_STATISTICS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.results_count is not None: - serializer.write_integer( - _SCHEMA_QUERY_STATISTICS.members["ResultsCount"], self.results_count - ) - - if self.total_results_count is not None: - serializer.write_integer( - _SCHEMA_QUERY_STATISTICS.members["TotalResultsCount"], - self.total_results_count, - ) - - if self.bytes_scanned is not None: - serializer.write_long( - _SCHEMA_QUERY_STATISTICS.members["BytesScanned"], self.bytes_scanned - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["results_count"] = de.read_integer( - _SCHEMA_QUERY_STATISTICS.members["ResultsCount"] - ) - - case 1: - kwargs["total_results_count"] = de.read_integer( - _SCHEMA_QUERY_STATISTICS.members["TotalResultsCount"] - ) - - case 2: - kwargs["bytes_scanned"] = de.read_long( - _SCHEMA_QUERY_STATISTICS.members["BytesScanned"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_QUERY_STATISTICS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetQueryResultsOutput: - """Dataclass for GetQueryResultsOutput structure.""" - - query_status: str | None = None - """ - The status of the query. Values include `QUEUED`, `RUNNING`, `FINISHED`, - `FAILED`, `TIMED_OUT`, or `CANCELLED`. - """ - - query_statistics: QueryStatistics | None = None - """Shows the count of query results.""" - - query_result_rows: list[list[dict[str, str]]] | None = None - """Contains the individual event results of the query.""" - - next_token: str | None = None - """A token you can use to get the next page of query results.""" - - error_message: str | None = None - """The error message returned if a query failed.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_QUERY_RESULTS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.query_status is not None: - serializer.write_string( - _SCHEMA_GET_QUERY_RESULTS_OUTPUT.members["QueryStatus"], - self.query_status, - ) - - if self.query_statistics is not None: - serializer.write_struct( - _SCHEMA_GET_QUERY_RESULTS_OUTPUT.members["QueryStatistics"], - self.query_statistics, - ) - - if self.query_result_rows is not None: - _serialize_query_result_rows( - serializer, - _SCHEMA_GET_QUERY_RESULTS_OUTPUT.members["QueryResultRows"], - self.query_result_rows, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_GET_QUERY_RESULTS_OUTPUT.members["NextToken"], self.next_token - ) - - if self.error_message is not None: - serializer.write_string( - _SCHEMA_GET_QUERY_RESULTS_OUTPUT.members["ErrorMessage"], - self.error_message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["query_status"] = QueryStatus( - de.read_string( - _SCHEMA_GET_QUERY_RESULTS_OUTPUT.members["QueryStatus"] - ) - ) - - case 1: - kwargs["query_statistics"] = QueryStatistics.deserialize(de) - - case 2: - kwargs["query_result_rows"] = _deserialize_query_result_rows( - de, _SCHEMA_GET_QUERY_RESULTS_OUTPUT.members["QueryResultRows"] - ) - - case 3: - kwargs["next_token"] = de.read_string( - _SCHEMA_GET_QUERY_RESULTS_OUTPUT.members["NextToken"] - ) - - case 4: - kwargs["error_message"] = de.read_string( - _SCHEMA_GET_QUERY_RESULTS_OUTPUT.members["ErrorMessage"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_QUERY_RESULTS_OUTPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class InvalidMaxResultsException(ServiceError): - """This exception is thrown if the limit specified is not valid.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_MAX_RESULTS_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_MAX_RESULTS_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_MAX_RESULTS_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVALID_MAX_RESULTS_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InvalidNextTokenException(ServiceError): - """ - A token that is not valid, or a token that was previously used in a - request with different parameters. This exception is thrown if the token - is not valid. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_NEXT_TOKEN_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_NEXT_TOKEN_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_NEXT_TOKEN_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVALID_NEXT_TOKEN_EXCEPTION, consumer=_consumer - ) - return kwargs - - -GET_QUERY_RESULTS = APIOperation( - input=GetQueryResultsInput, - output=GetQueryResultsOutput, - schema=_SCHEMA_GET_QUERY_RESULTS, - input_schema=_SCHEMA_GET_QUERY_RESULTS_INPUT, - output_schema=_SCHEMA_GET_QUERY_RESULTS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreARNInvalidException" - ): EventDataStoreARNInvalidException, - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreNotFoundException" - ): EventDataStoreNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#InactiveEventDataStoreException" - ): InactiveEventDataStoreException, - ShapeID( - "com.amazonaws.cloudtrail#InsufficientEncryptionPolicyException" - ): InsufficientEncryptionPolicyException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidMaxResultsException" - ): InvalidMaxResultsException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidNextTokenException" - ): InvalidNextTokenException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException" - ): NoManagementAccountSLRExistsException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#QueryIdNotFoundException" - ): QueryIdNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_EVENT_DATA_STORE_ARN_INVALID_EXCEPTION, - _SCHEMA_EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, - _SCHEMA_INACTIVE_EVENT_DATA_STORE_EXCEPTION, - _SCHEMA_INSUFFICIENT_ENCRYPTION_POLICY_EXCEPTION, - _SCHEMA_INVALID_MAX_RESULTS_EXCEPTION, - _SCHEMA_INVALID_NEXT_TOKEN_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_QUERY_ID_NOT_FOUND_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetResourcePolicyInput: - """Dataclass for GetResourcePolicyInput structure.""" - - resource_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the CloudTrail event data store, - dashboard, or channel attached to the resource-based policy. - - Example event data store ARN format: - `arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE` - - Example dashboard ARN format: - `arn:aws:cloudtrail:us-east-1:123456789012:dashboard/exampleDash` - - Example channel ARN format: - `arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890` - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_RESOURCE_POLICY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_GET_RESOURCE_POLICY_INPUT.members["ResourceArn"], - self.resource_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_GET_RESOURCE_POLICY_INPUT.members["ResourceArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_RESOURCE_POLICY_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetResourcePolicyOutput: - """Dataclass for GetResourcePolicyOutput structure.""" - - resource_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the CloudTrail event data store, - dashboard, or channel attached to resource-based policy. - - Example event data store ARN format: - `arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE` - - Example dashboard ARN format: - `arn:aws:cloudtrail:us-east-1:123456789012:dashboard/exampleDash` - - Example channel ARN format: - `arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890` - """ - - resource_policy: str | None = None - """ - A JSON-formatted string that contains the resource-based policy attached - to the CloudTrail event data store, dashboard, or channel. - """ - - delegated_admin_resource_policy: str | None = None - """ - The default resource-based policy that is automatically generated for - the delegated administrator of an Organizations organization. This - policy will be evaluated in tandem with any policy you submit for the - resource. For more information about this policy, see [Default resource - policy for delegated - administrators](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake-organizations.html#cloudtrail-lake-organizations-eds-rbp). - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_RESOURCE_POLICY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_GET_RESOURCE_POLICY_OUTPUT.members["ResourceArn"], - self.resource_arn, - ) - - if self.resource_policy is not None: - serializer.write_string( - _SCHEMA_GET_RESOURCE_POLICY_OUTPUT.members["ResourcePolicy"], - self.resource_policy, - ) - - if self.delegated_admin_resource_policy is not None: - serializer.write_string( - _SCHEMA_GET_RESOURCE_POLICY_OUTPUT.members[ - "DelegatedAdminResourcePolicy" - ], - self.delegated_admin_resource_policy, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_GET_RESOURCE_POLICY_OUTPUT.members["ResourceArn"] - ) - - case 1: - kwargs["resource_policy"] = de.read_string( - _SCHEMA_GET_RESOURCE_POLICY_OUTPUT.members["ResourcePolicy"] - ) - - case 2: - kwargs["delegated_admin_resource_policy"] = de.read_string( - _SCHEMA_GET_RESOURCE_POLICY_OUTPUT.members[ - "DelegatedAdminResourcePolicy" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_RESOURCE_POLICY_OUTPUT, consumer=_consumer) - return kwargs - - -GET_RESOURCE_POLICY = APIOperation( - input=GetResourcePolicyInput, - output=GetResourcePolicyOutput, - schema=_SCHEMA_GET_RESOURCE_POLICY, - input_schema=_SCHEMA_GET_RESOURCE_POLICY_INPUT, - output_schema=_SCHEMA_GET_RESOURCE_POLICY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#ResourceARNNotValidException" - ): ResourceARNNotValidException, - ShapeID( - "com.amazonaws.cloudtrail#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#ResourcePolicyNotFoundException" - ): ResourcePolicyNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#ResourceTypeNotSupportedException" - ): ResourceTypeNotSupportedException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_RESOURCE_ARN_NOT_VALID_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_RESOURCE_POLICY_NOT_FOUND_EXCEPTION, - _SCHEMA_RESOURCE_TYPE_NOT_SUPPORTED_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetTrailInput: - """Dataclass for GetTrailInput structure.""" - - name: str | None = None - """ - The name or the Amazon Resource Name (ARN) of the trail for which you - want to retrieve settings information. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_TRAIL_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string(_SCHEMA_GET_TRAIL_INPUT.members["Name"], self.name) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_GET_TRAIL_INPUT.members["Name"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_TRAIL_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetTrailOutput: - """Dataclass for GetTrailOutput structure.""" - - trail: Trail | None = None - """The settings for a trail.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_TRAIL_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.trail is not None: - serializer.write_struct( - _SCHEMA_GET_TRAIL_OUTPUT.members["Trail"], self.trail - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["trail"] = Trail.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_TRAIL_OUTPUT, consumer=_consumer) - return kwargs - - -GET_TRAIL = APIOperation( - input=GetTrailInput, - output=GetTrailOutput, - schema=_SCHEMA_GET_TRAIL, - input_schema=_SCHEMA_GET_TRAIL_INPUT, - output_schema=_SCHEMA_GET_TRAIL_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#CloudTrailARNInvalidException" - ): CloudTrailARNInvalidException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidTrailNameException" - ): InvalidTrailNameException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#TrailNotFoundException" - ): TrailNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CLOUD_TRAIL_ARN_INVALID_EXCEPTION, - _SCHEMA_INVALID_TRAIL_NAME_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_TRAIL_NOT_FOUND_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetTrailStatusInput: - """The name of a trail about which you want the current status.""" - - name: str | None = None - """ - Specifies the name or the CloudTrail ARN of the trail for which you are - requesting status. To get the status of a shadow trail (a replication of - the trail in another Region), you must specify its ARN. - - The following is the format of a trail ARN: - `arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail` - - Note: - If the trail is an organization trail and you are a member account in - the organization in Organizations, you must provide the full ARN of that - trail, and not just the name. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_TRAIL_STATUS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_GET_TRAIL_STATUS_INPUT.members["Name"], self.name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_GET_TRAIL_STATUS_INPUT.members["Name"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_TRAIL_STATUS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetTrailStatusOutput: - """ - Returns the objects or data listed below if successful. Otherwise, - returns an error. - """ - - is_logging: bool | None = None - """ - Whether the CloudTrail trail is currently logging Amazon Web Services - API calls. - """ - - latest_delivery_error: str | None = None - """ - Displays any Amazon S3 error that CloudTrail encountered when attempting - to deliver log files to the designated bucket. For more information, see - [Error - Responses](https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html) - in the Amazon S3 API Reference. - - Note: - This error occurs only when there is a problem with the destination S3 - bucket, and does not occur for requests that time out. To resolve the - issue, fix the [bucket - policy](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/create-s3-bucket-policy-for-cloudtrail.html) - so that CloudTrail can write to the bucket; or create a new bucket and - call `UpdateTrail` to specify the new bucket. - """ - - latest_notification_error: str | None = None - """ - Displays any Amazon SNS error that CloudTrail encountered when - attempting to send a notification. For more information about Amazon SNS - errors, see the [Amazon SNS Developer - Guide](https://docs.aws.amazon.com/sns/latest/dg/welcome.html). - """ - - latest_delivery_time: datetime | None = None - """ - Specifies the date and time that CloudTrail last delivered log files to - an account's Amazon S3 bucket. - """ - - latest_notification_time: datetime | None = None - """ - Specifies the date and time of the most recent Amazon SNS notification - that CloudTrail has written a new log file to an account's Amazon S3 - bucket. - """ - - start_logging_time: datetime | None = None - """ - Specifies the most recent date and time when CloudTrail started - recording API calls for an Amazon Web Services account. - """ - - stop_logging_time: datetime | None = None - """ - Specifies the most recent date and time when CloudTrail stopped - recording API calls for an Amazon Web Services account. - """ - - latest_cloud_watch_logs_delivery_error: str | None = None - """ - Displays any CloudWatch Logs error that CloudTrail encountered when - attempting to deliver logs to CloudWatch Logs. - """ - - latest_cloud_watch_logs_delivery_time: datetime | None = None - """ - Displays the most recent date and time when CloudTrail delivered logs to - CloudWatch Logs. - """ - - latest_digest_delivery_time: datetime | None = None - """ - Specifies the date and time that CloudTrail last delivered a digest file - to an account's Amazon S3 bucket. - """ - - latest_digest_delivery_error: str | None = None - """ - Displays any Amazon S3 error that CloudTrail encountered when attempting - to deliver a digest file to the designated bucket. For more information, - see [Error - Responses](https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html) - in the Amazon S3 API Reference. - - Note: - This error occurs only when there is a problem with the destination S3 - bucket, and does not occur for requests that time out. To resolve the - issue, fix the [bucket - policy](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/create-s3-bucket-policy-for-cloudtrail.html) - so that CloudTrail can write to the bucket; or create a new bucket and - call `UpdateTrail` to specify the new bucket. - """ - - latest_delivery_attempt_time: str | None = None - """This field is no longer in use.""" - - latest_notification_attempt_time: str | None = None - """This field is no longer in use.""" - - latest_notification_attempt_succeeded: str | None = None - """This field is no longer in use.""" - - latest_delivery_attempt_succeeded: str | None = None - """This field is no longer in use.""" - - time_logging_started: str | None = None - """This field is no longer in use.""" - - time_logging_stopped: str | None = None - """This field is no longer in use.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_TRAIL_STATUS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.is_logging is not None: - serializer.write_boolean( - _SCHEMA_GET_TRAIL_STATUS_OUTPUT.members["IsLogging"], self.is_logging - ) - - if self.latest_delivery_error is not None: - serializer.write_string( - _SCHEMA_GET_TRAIL_STATUS_OUTPUT.members["LatestDeliveryError"], - self.latest_delivery_error, - ) - - if self.latest_notification_error is not None: - serializer.write_string( - _SCHEMA_GET_TRAIL_STATUS_OUTPUT.members["LatestNotificationError"], - self.latest_notification_error, - ) - - if self.latest_delivery_time is not None: - serializer.write_timestamp( - _SCHEMA_GET_TRAIL_STATUS_OUTPUT.members["LatestDeliveryTime"], - self.latest_delivery_time, - ) - - if self.latest_notification_time is not None: - serializer.write_timestamp( - _SCHEMA_GET_TRAIL_STATUS_OUTPUT.members["LatestNotificationTime"], - self.latest_notification_time, - ) - - if self.start_logging_time is not None: - serializer.write_timestamp( - _SCHEMA_GET_TRAIL_STATUS_OUTPUT.members["StartLoggingTime"], - self.start_logging_time, - ) - - if self.stop_logging_time is not None: - serializer.write_timestamp( - _SCHEMA_GET_TRAIL_STATUS_OUTPUT.members["StopLoggingTime"], - self.stop_logging_time, - ) - - if self.latest_cloud_watch_logs_delivery_error is not None: - serializer.write_string( - _SCHEMA_GET_TRAIL_STATUS_OUTPUT.members[ - "LatestCloudWatchLogsDeliveryError" - ], - self.latest_cloud_watch_logs_delivery_error, - ) - - if self.latest_cloud_watch_logs_delivery_time is not None: - serializer.write_timestamp( - _SCHEMA_GET_TRAIL_STATUS_OUTPUT.members[ - "LatestCloudWatchLogsDeliveryTime" - ], - self.latest_cloud_watch_logs_delivery_time, - ) - - if self.latest_digest_delivery_time is not None: - serializer.write_timestamp( - _SCHEMA_GET_TRAIL_STATUS_OUTPUT.members["LatestDigestDeliveryTime"], - self.latest_digest_delivery_time, - ) - - if self.latest_digest_delivery_error is not None: - serializer.write_string( - _SCHEMA_GET_TRAIL_STATUS_OUTPUT.members["LatestDigestDeliveryError"], - self.latest_digest_delivery_error, - ) - - if self.latest_delivery_attempt_time is not None: - serializer.write_string( - _SCHEMA_GET_TRAIL_STATUS_OUTPUT.members["LatestDeliveryAttemptTime"], - self.latest_delivery_attempt_time, - ) - - if self.latest_notification_attempt_time is not None: - serializer.write_string( - _SCHEMA_GET_TRAIL_STATUS_OUTPUT.members[ - "LatestNotificationAttemptTime" - ], - self.latest_notification_attempt_time, - ) - - if self.latest_notification_attempt_succeeded is not None: - serializer.write_string( - _SCHEMA_GET_TRAIL_STATUS_OUTPUT.members[ - "LatestNotificationAttemptSucceeded" - ], - self.latest_notification_attempt_succeeded, - ) - - if self.latest_delivery_attempt_succeeded is not None: - serializer.write_string( - _SCHEMA_GET_TRAIL_STATUS_OUTPUT.members[ - "LatestDeliveryAttemptSucceeded" - ], - self.latest_delivery_attempt_succeeded, - ) - - if self.time_logging_started is not None: - serializer.write_string( - _SCHEMA_GET_TRAIL_STATUS_OUTPUT.members["TimeLoggingStarted"], - self.time_logging_started, - ) - - if self.time_logging_stopped is not None: - serializer.write_string( - _SCHEMA_GET_TRAIL_STATUS_OUTPUT.members["TimeLoggingStopped"], - self.time_logging_stopped, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["is_logging"] = de.read_boolean( - _SCHEMA_GET_TRAIL_STATUS_OUTPUT.members["IsLogging"] - ) - - case 1: - kwargs["latest_delivery_error"] = de.read_string( - _SCHEMA_GET_TRAIL_STATUS_OUTPUT.members["LatestDeliveryError"] - ) - - case 2: - kwargs["latest_notification_error"] = de.read_string( - _SCHEMA_GET_TRAIL_STATUS_OUTPUT.members[ - "LatestNotificationError" - ] - ) - - case 3: - kwargs["latest_delivery_time"] = de.read_timestamp( - _SCHEMA_GET_TRAIL_STATUS_OUTPUT.members["LatestDeliveryTime"] - ) - - case 4: - kwargs["latest_notification_time"] = de.read_timestamp( - _SCHEMA_GET_TRAIL_STATUS_OUTPUT.members[ - "LatestNotificationTime" - ] - ) - - case 5: - kwargs["start_logging_time"] = de.read_timestamp( - _SCHEMA_GET_TRAIL_STATUS_OUTPUT.members["StartLoggingTime"] - ) - - case 6: - kwargs["stop_logging_time"] = de.read_timestamp( - _SCHEMA_GET_TRAIL_STATUS_OUTPUT.members["StopLoggingTime"] - ) - - case 7: - kwargs["latest_cloud_watch_logs_delivery_error"] = de.read_string( - _SCHEMA_GET_TRAIL_STATUS_OUTPUT.members[ - "LatestCloudWatchLogsDeliveryError" - ] - ) - - case 8: - kwargs["latest_cloud_watch_logs_delivery_time"] = de.read_timestamp( - _SCHEMA_GET_TRAIL_STATUS_OUTPUT.members[ - "LatestCloudWatchLogsDeliveryTime" - ] - ) - - case 9: - kwargs["latest_digest_delivery_time"] = de.read_timestamp( - _SCHEMA_GET_TRAIL_STATUS_OUTPUT.members[ - "LatestDigestDeliveryTime" - ] - ) - - case 10: - kwargs["latest_digest_delivery_error"] = de.read_string( - _SCHEMA_GET_TRAIL_STATUS_OUTPUT.members[ - "LatestDigestDeliveryError" - ] - ) - - case 11: - kwargs["latest_delivery_attempt_time"] = de.read_string( - _SCHEMA_GET_TRAIL_STATUS_OUTPUT.members[ - "LatestDeliveryAttemptTime" - ] - ) - - case 12: - kwargs["latest_notification_attempt_time"] = de.read_string( - _SCHEMA_GET_TRAIL_STATUS_OUTPUT.members[ - "LatestNotificationAttemptTime" - ] - ) - - case 13: - kwargs["latest_notification_attempt_succeeded"] = de.read_string( - _SCHEMA_GET_TRAIL_STATUS_OUTPUT.members[ - "LatestNotificationAttemptSucceeded" - ] - ) - - case 14: - kwargs["latest_delivery_attempt_succeeded"] = de.read_string( - _SCHEMA_GET_TRAIL_STATUS_OUTPUT.members[ - "LatestDeliveryAttemptSucceeded" - ] - ) - - case 15: - kwargs["time_logging_started"] = de.read_string( - _SCHEMA_GET_TRAIL_STATUS_OUTPUT.members["TimeLoggingStarted"] - ) - - case 16: - kwargs["time_logging_stopped"] = de.read_string( - _SCHEMA_GET_TRAIL_STATUS_OUTPUT.members["TimeLoggingStopped"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_TRAIL_STATUS_OUTPUT, consumer=_consumer) - return kwargs - - -GET_TRAIL_STATUS = APIOperation( - input=GetTrailStatusInput, - output=GetTrailStatusOutput, - schema=_SCHEMA_GET_TRAIL_STATUS, - input_schema=_SCHEMA_GET_TRAIL_STATUS_INPUT, - output_schema=_SCHEMA_GET_TRAIL_STATUS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#CloudTrailARNInvalidException" - ): CloudTrailARNInvalidException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidTrailNameException" - ): InvalidTrailNameException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#TrailNotFoundException" - ): TrailNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CLOUD_TRAIL_ARN_INVALID_EXCEPTION, - _SCHEMA_INVALID_TRAIL_NAME_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_TRAIL_NOT_FOUND_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListChannelsInput: - """Dataclass for ListChannelsInput structure.""" - - max_results: int | None = None - """The maximum number of CloudTrail channels to display on a single page.""" - - next_token: str | None = None - """ - The token to use to get the next page of results after a previous API - call. This token must be passed in with the same parameters that were - specified in the original call. For example, if the original call - specified an AttributeKey of 'Username' with a value of 'root', the - call with NextToken should include those same parameters. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_CHANNELS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_CHANNELS_INPUT.members["MaxResults"], self.max_results - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_CHANNELS_INPUT.members["NextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_CHANNELS_INPUT.members["MaxResults"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_CHANNELS_INPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_CHANNELS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ListChannelsOutput: - """Dataclass for ListChannelsOutput structure.""" - - channels: list[Channel] | None = None - """The list of channels in the account.""" - - next_token: str | None = None - """ - The token to use to get the next page of results after a previous API - call. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_CHANNELS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.channels is not None: - _serialize_channels( - serializer, - _SCHEMA_LIST_CHANNELS_OUTPUT.members["Channels"], - self.channels, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_CHANNELS_OUTPUT.members["NextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["channels"] = _deserialize_channels( - de, _SCHEMA_LIST_CHANNELS_OUTPUT.members["Channels"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_CHANNELS_OUTPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_CHANNELS_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_CHANNELS = APIOperation( - input=ListChannelsInput, - output=ListChannelsOutput, - schema=_SCHEMA_LIST_CHANNELS, - input_schema=_SCHEMA_LIST_CHANNELS_INPUT, - output_schema=_SCHEMA_LIST_CHANNELS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#InvalidNextTokenException" - ): InvalidNextTokenException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_NEXT_TOKEN_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListDashboardsInput: - """Dataclass for ListDashboardsInput structure.""" - - name_prefix: str | None = None - """Specify a name prefix to filter on.""" - - type: str | None = None - """Specify a dashboard type to filter on: `CUSTOM` or `MANAGED`.""" - - next_token: str | None = None - """A token you can use to get the next page of dashboard results.""" - - max_results: int | None = None - """The maximum number of dashboards to display on a single page.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_DASHBOARDS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name_prefix is not None: - serializer.write_string( - _SCHEMA_LIST_DASHBOARDS_INPUT.members["NamePrefix"], self.name_prefix - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_LIST_DASHBOARDS_INPUT.members["Type"], self.type - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_DASHBOARDS_INPUT.members["NextToken"], self.next_token - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_DASHBOARDS_INPUT.members["MaxResults"], self.max_results - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name_prefix"] = de.read_string( - _SCHEMA_LIST_DASHBOARDS_INPUT.members["NamePrefix"] - ) - - case 1: - kwargs["type"] = DashboardType( - de.read_string(_SCHEMA_LIST_DASHBOARDS_INPUT.members["Type"]) - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_DASHBOARDS_INPUT.members["NextToken"] - ) - - case 3: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_DASHBOARDS_INPUT.members["MaxResults"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_DASHBOARDS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DashboardDetail: - """Provides information about a CloudTrail Lake dashboard.""" - - dashboard_arn: str | None = None - """The ARN for the dashboard.""" - - type: str | None = None - """The type of dashboard.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DASHBOARD_DETAIL, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.dashboard_arn is not None: - serializer.write_string( - _SCHEMA_DASHBOARD_DETAIL.members["DashboardArn"], self.dashboard_arn - ) - - if self.type is not None: - serializer.write_string(_SCHEMA_DASHBOARD_DETAIL.members["Type"], self.type) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["dashboard_arn"] = de.read_string( - _SCHEMA_DASHBOARD_DETAIL.members["DashboardArn"] - ) - - case 1: - kwargs["type"] = DashboardType( - de.read_string(_SCHEMA_DASHBOARD_DETAIL.members["Type"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DASHBOARD_DETAIL, consumer=_consumer) - return kwargs - - -def _serialize_dashboards( - serializer: ShapeSerializer, schema: Schema, value: list[DashboardDetail] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_dashboards( - deserializer: ShapeDeserializer, schema: Schema -) -> list[DashboardDetail]: - result: list[DashboardDetail] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(DashboardDetail.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListDashboardsOutput: - """Dataclass for ListDashboardsOutput structure.""" - - dashboards: list[DashboardDetail] | None = None - """ - Contains information about dashboards in the account, in the current - Region that match the applied filters. - """ - - next_token: str | None = None - """A token you can use to get the next page of dashboard results.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_DASHBOARDS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.dashboards is not None: - _serialize_dashboards( - serializer, - _SCHEMA_LIST_DASHBOARDS_OUTPUT.members["Dashboards"], - self.dashboards, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_DASHBOARDS_OUTPUT.members["NextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["dashboards"] = _deserialize_dashboards( - de, _SCHEMA_LIST_DASHBOARDS_OUTPUT.members["Dashboards"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_DASHBOARDS_OUTPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_DASHBOARDS_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_DASHBOARDS = APIOperation( - input=ListDashboardsInput, - output=ListDashboardsOutput, - schema=_SCHEMA_LIST_DASHBOARDS, - input_schema=_SCHEMA_LIST_DASHBOARDS_INPUT, - output_schema=_SCHEMA_LIST_DASHBOARDS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[_SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION], -) - - -@dataclass(kw_only=True) -class ListEventDataStoresInput: - """Dataclass for ListEventDataStoresInput structure.""" - - next_token: str | None = None - """A token you can use to get the next page of event data store results.""" - - max_results: int | None = None - """The maximum number of event data stores to display on a single page.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_EVENT_DATA_STORES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_EVENT_DATA_STORES_INPUT.members["NextToken"], - self.next_token, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_EVENT_DATA_STORES_INPUT.members["MaxResults"], - self.max_results, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_EVENT_DATA_STORES_INPUT.members["NextToken"] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_EVENT_DATA_STORES_INPUT.members["MaxResults"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_EVENT_DATA_STORES_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class EventDataStore: - """ - A storage lake of event data against which you can run complex SQL-based - queries. An event data store can include events that you have logged on - your account. To select events for an event data store, use [advanced - event - selectors](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake-concepts.html#adv-event-selectors). - """ - - event_data_store_arn: str | None = None - """The ARN of the event data store.""" - - name: str | None = None - """The name of the event data store.""" - - termination_protection_enabled: bool | None = None - """Indicates whether the event data store is protected from termination.""" - - status: str | None = None - """The status of an event data store.""" - - advanced_event_selectors: list[AdvancedEventSelector] | None = None - """ - The advanced event selectors that were used to select events for the - data store. - """ - - multi_region_enabled: bool | None = None - """ - Indicates whether the event data store includes events from all Regions, - or only from the Region in which it was created. - """ - - organization_enabled: bool | None = None - """ - Indicates that an event data store is collecting logged events for an - organization. - """ - - retention_period: int | None = None - """The retention period, in days.""" - - created_timestamp: datetime | None = None - """The timestamp of the event data store's creation.""" - - updated_timestamp: datetime | None = None - """ - The timestamp showing when an event data store was updated, if - applicable. `UpdatedTimestamp` is always either the same or newer than - the time shown in `CreatedTimestamp`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVENT_DATA_STORE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.event_data_store_arn is not None: - serializer.write_string( - _SCHEMA_EVENT_DATA_STORE.members["EventDataStoreArn"], - self.event_data_store_arn, - ) - - if self.name is not None: - serializer.write_string(_SCHEMA_EVENT_DATA_STORE.members["Name"], self.name) - - if self.termination_protection_enabled is not None: - serializer.write_boolean( - _SCHEMA_EVENT_DATA_STORE.members["TerminationProtectionEnabled"], - self.termination_protection_enabled, - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_EVENT_DATA_STORE.members["Status"], self.status - ) - - if self.advanced_event_selectors is not None: - _serialize_advanced_event_selectors( - serializer, - _SCHEMA_EVENT_DATA_STORE.members["AdvancedEventSelectors"], - self.advanced_event_selectors, - ) - - if self.multi_region_enabled is not None: - serializer.write_boolean( - _SCHEMA_EVENT_DATA_STORE.members["MultiRegionEnabled"], - self.multi_region_enabled, - ) - - if self.organization_enabled is not None: - serializer.write_boolean( - _SCHEMA_EVENT_DATA_STORE.members["OrganizationEnabled"], - self.organization_enabled, - ) - - if self.retention_period is not None: - serializer.write_integer( - _SCHEMA_EVENT_DATA_STORE.members["RetentionPeriod"], - self.retention_period, - ) - - if self.created_timestamp is not None: - serializer.write_timestamp( - _SCHEMA_EVENT_DATA_STORE.members["CreatedTimestamp"], - self.created_timestamp, - ) - - if self.updated_timestamp is not None: - serializer.write_timestamp( - _SCHEMA_EVENT_DATA_STORE.members["UpdatedTimestamp"], - self.updated_timestamp, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["event_data_store_arn"] = de.read_string( - _SCHEMA_EVENT_DATA_STORE.members["EventDataStoreArn"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_EVENT_DATA_STORE.members["Name"] - ) - - case 2: - kwargs["termination_protection_enabled"] = de.read_boolean( - _SCHEMA_EVENT_DATA_STORE.members["TerminationProtectionEnabled"] - ) - - case 3: - kwargs["status"] = EventDataStoreStatus( - de.read_string(_SCHEMA_EVENT_DATA_STORE.members["Status"]) - ) - - case 4: - kwargs["advanced_event_selectors"] = ( - _deserialize_advanced_event_selectors( - de, - _SCHEMA_EVENT_DATA_STORE.members["AdvancedEventSelectors"], - ) - ) - - case 5: - kwargs["multi_region_enabled"] = de.read_boolean( - _SCHEMA_EVENT_DATA_STORE.members["MultiRegionEnabled"] - ) - - case 6: - kwargs["organization_enabled"] = de.read_boolean( - _SCHEMA_EVENT_DATA_STORE.members["OrganizationEnabled"] - ) - - case 7: - kwargs["retention_period"] = de.read_integer( - _SCHEMA_EVENT_DATA_STORE.members["RetentionPeriod"] - ) - - case 8: - kwargs["created_timestamp"] = de.read_timestamp( - _SCHEMA_EVENT_DATA_STORE.members["CreatedTimestamp"] - ) - - case 9: - kwargs["updated_timestamp"] = de.read_timestamp( - _SCHEMA_EVENT_DATA_STORE.members["UpdatedTimestamp"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EVENT_DATA_STORE, consumer=_consumer) - return kwargs - - -def _serialize_event_data_stores( - serializer: ShapeSerializer, schema: Schema, value: list[EventDataStore] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_event_data_stores( - deserializer: ShapeDeserializer, schema: Schema -) -> list[EventDataStore]: - result: list[EventDataStore] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(EventDataStore.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListEventDataStoresOutput: - """Dataclass for ListEventDataStoresOutput structure.""" - - event_data_stores: list[EventDataStore] | None = None - """ - Contains information about event data stores in the account, in the - current Region. - """ - - next_token: str | None = None - """A token you can use to get the next page of results.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_EVENT_DATA_STORES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.event_data_stores is not None: - _serialize_event_data_stores( - serializer, - _SCHEMA_LIST_EVENT_DATA_STORES_OUTPUT.members["EventDataStores"], - self.event_data_stores, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_EVENT_DATA_STORES_OUTPUT.members["NextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["event_data_stores"] = _deserialize_event_data_stores( - de, - _SCHEMA_LIST_EVENT_DATA_STORES_OUTPUT.members[ - "EventDataStores" - ], - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_EVENT_DATA_STORES_OUTPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_EVENT_DATA_STORES_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_EVENT_DATA_STORES = APIOperation( - input=ListEventDataStoresInput, - output=ListEventDataStoresOutput, - schema=_SCHEMA_LIST_EVENT_DATA_STORES, - input_schema=_SCHEMA_LIST_EVENT_DATA_STORES_INPUT, - output_schema=_SCHEMA_LIST_EVENT_DATA_STORES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#InvalidMaxResultsException" - ): InvalidMaxResultsException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidNextTokenException" - ): InvalidNextTokenException, - ShapeID( - "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException" - ): NoManagementAccountSLRExistsException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_MAX_RESULTS_EXCEPTION, - _SCHEMA_INVALID_NEXT_TOKEN_EXCEPTION, - _SCHEMA_NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListImportFailuresInput: - """Dataclass for ListImportFailuresInput structure.""" - - import_id: str | None = None - """The ID of the import.""" - - max_results: int | None = None - """The maximum number of failures to display on a single page.""" - - next_token: str | None = None - """A token you can use to get the next page of import failures.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_IMPORT_FAILURES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.import_id is not None: - serializer.write_string( - _SCHEMA_LIST_IMPORT_FAILURES_INPUT.members["ImportId"], self.import_id - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_IMPORT_FAILURES_INPUT.members["MaxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_IMPORT_FAILURES_INPUT.members["NextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["import_id"] = de.read_string( - _SCHEMA_LIST_IMPORT_FAILURES_INPUT.members["ImportId"] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_IMPORT_FAILURES_INPUT.members["MaxResults"] - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_IMPORT_FAILURES_INPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_IMPORT_FAILURES_INPUT, consumer=_consumer) - return kwargs - - -class ImportFailureStatus(UnknownEnumMixin, StrEnum): - FAILED = "FAILED" - RETRY = "RETRY" - SUCCEEDED = "SUCCEEDED" - - -@dataclass(kw_only=True) -class ImportFailureListItem: - """Provides information about an import failure.""" - - location: str | None = None - """The location of the failure in the S3 bucket.""" - - status: str | None = None - """The status of the import.""" - - error_type: str | None = None - """The type of import error.""" - - error_message: str | None = None - """Provides the reason the import failed.""" - - last_updated_time: datetime | None = None - """When the import was last updated.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IMPORT_FAILURE_LIST_ITEM, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.location is not None: - serializer.write_string( - _SCHEMA_IMPORT_FAILURE_LIST_ITEM.members["Location"], self.location - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_IMPORT_FAILURE_LIST_ITEM.members["Status"], self.status - ) - - if self.error_type is not None: - serializer.write_string( - _SCHEMA_IMPORT_FAILURE_LIST_ITEM.members["ErrorType"], self.error_type - ) - - if self.error_message is not None: - serializer.write_string( - _SCHEMA_IMPORT_FAILURE_LIST_ITEM.members["ErrorMessage"], - self.error_message, - ) - - if self.last_updated_time is not None: - serializer.write_timestamp( - _SCHEMA_IMPORT_FAILURE_LIST_ITEM.members["LastUpdatedTime"], - self.last_updated_time, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["location"] = de.read_string( - _SCHEMA_IMPORT_FAILURE_LIST_ITEM.members["Location"] - ) - - case 1: - kwargs["status"] = ImportFailureStatus( - de.read_string( - _SCHEMA_IMPORT_FAILURE_LIST_ITEM.members["Status"] - ) - ) - - case 2: - kwargs["error_type"] = de.read_string( - _SCHEMA_IMPORT_FAILURE_LIST_ITEM.members["ErrorType"] - ) - - case 3: - kwargs["error_message"] = de.read_string( - _SCHEMA_IMPORT_FAILURE_LIST_ITEM.members["ErrorMessage"] - ) - - case 4: - kwargs["last_updated_time"] = de.read_timestamp( - _SCHEMA_IMPORT_FAILURE_LIST_ITEM.members["LastUpdatedTime"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_IMPORT_FAILURE_LIST_ITEM, consumer=_consumer) - return kwargs - - -def _serialize_import_failure_list( - serializer: ShapeSerializer, schema: Schema, value: list[ImportFailureListItem] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_import_failure_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ImportFailureListItem]: - result: list[ImportFailureListItem] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ImportFailureListItem.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListImportFailuresOutput: - """Dataclass for ListImportFailuresOutput structure.""" - - failures: list[ImportFailureListItem] | None = None - """Contains information about the import failures.""" - - next_token: str | None = None - """A token you can use to get the next page of results.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_IMPORT_FAILURES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.failures is not None: - _serialize_import_failure_list( - serializer, - _SCHEMA_LIST_IMPORT_FAILURES_OUTPUT.members["Failures"], - self.failures, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_IMPORT_FAILURES_OUTPUT.members["NextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["failures"] = _deserialize_import_failure_list( - de, _SCHEMA_LIST_IMPORT_FAILURES_OUTPUT.members["Failures"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_IMPORT_FAILURES_OUTPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_IMPORT_FAILURES_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_IMPORT_FAILURES = APIOperation( - input=ListImportFailuresInput, - output=ListImportFailuresOutput, - schema=_SCHEMA_LIST_IMPORT_FAILURES, - input_schema=_SCHEMA_LIST_IMPORT_FAILURES_INPUT, - output_schema=_SCHEMA_LIST_IMPORT_FAILURES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#InvalidNextTokenException" - ): InvalidNextTokenException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_NEXT_TOKEN_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListImportsInput: - """Dataclass for ListImportsInput structure.""" - - max_results: int | None = None - """The maximum number of imports to display on a single page.""" - - destination: str | None = None - """The ARN of the destination event data store.""" - - import_status: str | None = None - """The status of the import.""" - - next_token: str | None = None - """A token you can use to get the next page of import results.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_IMPORTS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_IMPORTS_INPUT.members["MaxResults"], self.max_results - ) - - if self.destination is not None: - serializer.write_string( - _SCHEMA_LIST_IMPORTS_INPUT.members["Destination"], self.destination - ) - - if self.import_status is not None: - serializer.write_string( - _SCHEMA_LIST_IMPORTS_INPUT.members["ImportStatus"], self.import_status - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_IMPORTS_INPUT.members["NextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_IMPORTS_INPUT.members["MaxResults"] - ) - - case 1: - kwargs["destination"] = de.read_string( - _SCHEMA_LIST_IMPORTS_INPUT.members["Destination"] - ) - - case 2: - kwargs["import_status"] = ImportStatus( - de.read_string( - _SCHEMA_LIST_IMPORTS_INPUT.members["ImportStatus"] - ) - ) - - case 3: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_IMPORTS_INPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_IMPORTS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ImportsListItem: - """ - Contains information about an import that was returned by a lookup - request. - """ - - import_id: str | None = None - """The ID of the import.""" - - import_status: str | None = None - """The status of the import.""" - - destinations: list[str] | None = None - """The ARN of the destination event data store.""" - - created_timestamp: datetime | None = None - """The timestamp of the import's creation.""" - - updated_timestamp: datetime | None = None - """The timestamp of the import's last update.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IMPORTS_LIST_ITEM, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.import_id is not None: - serializer.write_string( - _SCHEMA_IMPORTS_LIST_ITEM.members["ImportId"], self.import_id - ) - - if self.import_status is not None: - serializer.write_string( - _SCHEMA_IMPORTS_LIST_ITEM.members["ImportStatus"], self.import_status - ) - - if self.destinations is not None: - _serialize_import_destinations( - serializer, - _SCHEMA_IMPORTS_LIST_ITEM.members["Destinations"], - self.destinations, - ) - - if self.created_timestamp is not None: - serializer.write_timestamp( - _SCHEMA_IMPORTS_LIST_ITEM.members["CreatedTimestamp"], - self.created_timestamp, - ) - - if self.updated_timestamp is not None: - serializer.write_timestamp( - _SCHEMA_IMPORTS_LIST_ITEM.members["UpdatedTimestamp"], - self.updated_timestamp, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["import_id"] = de.read_string( - _SCHEMA_IMPORTS_LIST_ITEM.members["ImportId"] - ) - - case 1: - kwargs["import_status"] = ImportStatus( - de.read_string( - _SCHEMA_IMPORTS_LIST_ITEM.members["ImportStatus"] - ) - ) - - case 2: - kwargs["destinations"] = _deserialize_import_destinations( - de, _SCHEMA_IMPORTS_LIST_ITEM.members["Destinations"] - ) - - case 3: - kwargs["created_timestamp"] = de.read_timestamp( - _SCHEMA_IMPORTS_LIST_ITEM.members["CreatedTimestamp"] - ) - - case 4: - kwargs["updated_timestamp"] = de.read_timestamp( - _SCHEMA_IMPORTS_LIST_ITEM.members["UpdatedTimestamp"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_IMPORTS_LIST_ITEM, consumer=_consumer) - return kwargs - - -def _serialize_imports_list( - serializer: ShapeSerializer, schema: Schema, value: list[ImportsListItem] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_imports_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ImportsListItem]: - result: list[ImportsListItem] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ImportsListItem.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListImportsOutput: - """Dataclass for ListImportsOutput structure.""" - - imports: list[ImportsListItem] | None = None - """The list of returned imports.""" - - next_token: str | None = None - """A token you can use to get the next page of import results.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_IMPORTS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.imports is not None: - _serialize_imports_list( - serializer, _SCHEMA_LIST_IMPORTS_OUTPUT.members["Imports"], self.imports - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_IMPORTS_OUTPUT.members["NextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["imports"] = _deserialize_imports_list( - de, _SCHEMA_LIST_IMPORTS_OUTPUT.members["Imports"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_IMPORTS_OUTPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_IMPORTS_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_IMPORTS = APIOperation( - input=ListImportsInput, - output=ListImportsOutput, - schema=_SCHEMA_LIST_IMPORTS, - input_schema=_SCHEMA_LIST_IMPORTS_INPUT, - output_schema=_SCHEMA_LIST_IMPORTS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreARNInvalidException" - ): EventDataStoreARNInvalidException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidNextTokenException" - ): InvalidNextTokenException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_EVENT_DATA_STORE_ARN_INVALID_EXCEPTION, - _SCHEMA_INVALID_NEXT_TOKEN_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -class ListInsightsDataType(UnknownEnumMixin, StrEnum): - INSIGHTS_EVENTS = "InsightsEvents" - - -class ListInsightsDataDimensionKey(UnknownEnumMixin, StrEnum): - EVENT_ID = "EventId" - EVENT_NAME = "EventName" - EVENT_SOURCE = "EventSource" - - -def _serialize_list_insights_data_dimensions( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_list_insights_data_dimensions( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListInsightsDataInput: - """Dataclass for ListInsightsDataInput structure.""" - - insight_source: str | None = None - """ - The Amazon Resource Name(ARN) of the trail for which you want to - retrieve Insights events. - """ - - data_type: str | None = None - """ - Specifies the category of events returned. To fetch Insights events, - specify `InsightsEvents` as the value of `DataType` - """ - - dimensions: dict[str, str] | None = None - """ - Contains a map of dimensions. Currently the map can contain only one - item. - """ - - start_time: datetime | None = None - """ - Specifies that only events that occur after or at the specified time are - returned. If the specified start time is after the specified end time, - an error is returned. - """ - - end_time: datetime | None = None - """ - Specifies that only events that occur before or at the specified time - are returned. If the specified end time is before the specified start - time, an error is returned. - """ - - max_results: int | None = None - """ - The number of events to return. Possible values are 1 through 50. The - default is 50. - """ - - next_token: str | None = None - """ - The token to use to get the next page of results after a previous API - call. This token must be passed in with the same parameters that were - specified in the original call. For example, if the original call - specified a EventName as a dimension with `PutObject` as a value, the - call with NextToken should include those same parameters. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_INSIGHTS_DATA_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.insight_source is not None: - serializer.write_string( - _SCHEMA_LIST_INSIGHTS_DATA_INPUT.members["InsightSource"], - self.insight_source, - ) - - if self.data_type is not None: - serializer.write_string( - _SCHEMA_LIST_INSIGHTS_DATA_INPUT.members["DataType"], self.data_type - ) - - if self.dimensions is not None: - _serialize_list_insights_data_dimensions( - serializer, - _SCHEMA_LIST_INSIGHTS_DATA_INPUT.members["Dimensions"], - self.dimensions, - ) - - if self.start_time is not None: - serializer.write_timestamp( - _SCHEMA_LIST_INSIGHTS_DATA_INPUT.members["StartTime"], self.start_time - ) - - if self.end_time is not None: - serializer.write_timestamp( - _SCHEMA_LIST_INSIGHTS_DATA_INPUT.members["EndTime"], self.end_time - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_INSIGHTS_DATA_INPUT.members["MaxResults"], self.max_results - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_INSIGHTS_DATA_INPUT.members["NextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["insight_source"] = de.read_string( - _SCHEMA_LIST_INSIGHTS_DATA_INPUT.members["InsightSource"] - ) - - case 1: - kwargs["data_type"] = ListInsightsDataType( - de.read_string( - _SCHEMA_LIST_INSIGHTS_DATA_INPUT.members["DataType"] - ) - ) - - case 2: - kwargs["dimensions"] = _deserialize_list_insights_data_dimensions( - de, _SCHEMA_LIST_INSIGHTS_DATA_INPUT.members["Dimensions"] - ) - - case 3: - kwargs["start_time"] = de.read_timestamp( - _SCHEMA_LIST_INSIGHTS_DATA_INPUT.members["StartTime"] - ) - - case 4: - kwargs["end_time"] = de.read_timestamp( - _SCHEMA_LIST_INSIGHTS_DATA_INPUT.members["EndTime"] - ) - - case 5: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_INSIGHTS_DATA_INPUT.members["MaxResults"] - ) - - case 6: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_INSIGHTS_DATA_INPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_INSIGHTS_DATA_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Resource: - """Specifies the type and name of a resource referenced by an event.""" - - resource_type: str | None = None - """ - The type of a resource referenced by the event returned. When the - resource type cannot be determined, null is returned. Some examples of - resource types are: **Instance** for EC2, **Trail** for CloudTrail, - **DBInstance** for Amazon RDS, and **AccessKey** for IAM. To learn more - about how to look up and filter events by the resource types supported - for a service, see [Filtering CloudTrail - Events](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/view-cloudtrail-events-console.html#filtering-cloudtrail-events). - """ - - resource_name: str | None = None - """ - The name of the resource referenced by the event returned. These are - user-created names whose values will depend on the environment. For - example, the resource name might be \"auto-scaling-test-group\" for an - Auto Scaling Group or \"i-1234567\" for an EC2 Instance. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_type is not None: - serializer.write_string( - _SCHEMA_RESOURCE.members["ResourceType"], self.resource_type - ) - - if self.resource_name is not None: - serializer.write_string( - _SCHEMA_RESOURCE.members["ResourceName"], self.resource_name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_type"] = de.read_string( - _SCHEMA_RESOURCE.members["ResourceType"] - ) - - case 1: - kwargs["resource_name"] = de.read_string( - _SCHEMA_RESOURCE.members["ResourceName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RESOURCE, consumer=_consumer) - return kwargs - - -def _serialize_resource_list( - serializer: ShapeSerializer, schema: Schema, value: list[Resource] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_resource_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Resource]: - result: list[Resource] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Resource.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class Event: - """ - Contains information about an event that was returned by a lookup - request. The result includes a representation of a CloudTrail event. - """ - - event_id: str | None = None - """The CloudTrail ID of the event returned.""" - - event_name: str | None = None - """The name of the event returned.""" - - read_only: str | None = None - """Information about whether the event is a write event or a read event.""" - - access_key_id: str | None = None - """ - The Amazon Web Services access key ID that was used to sign the request. - If the request was made with temporary security credentials, this is the - access key ID of the temporary credentials. - """ - - event_time: datetime | None = None - """The date and time of the event returned.""" - - event_source: str | None = None - """The Amazon Web Services service to which the request was made.""" - - username: str | None = None - """ - A user name or role name of the requester that called the API in the - event returned. - """ - - resources: list[Resource] | None = None - """A list of resources referenced by the event returned.""" - - cloud_trail_event: str | None = None - """A JSON string that contains a representation of the event returned.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.event_id is not None: - serializer.write_string(_SCHEMA_EVENT.members["EventId"], self.event_id) - - if self.event_name is not None: - serializer.write_string(_SCHEMA_EVENT.members["EventName"], self.event_name) - - if self.read_only is not None: - serializer.write_string(_SCHEMA_EVENT.members["ReadOnly"], self.read_only) - - if self.access_key_id is not None: - serializer.write_string( - _SCHEMA_EVENT.members["AccessKeyId"], self.access_key_id - ) - - if self.event_time is not None: - serializer.write_timestamp( - _SCHEMA_EVENT.members["EventTime"], self.event_time - ) - - if self.event_source is not None: - serializer.write_string( - _SCHEMA_EVENT.members["EventSource"], self.event_source - ) - - if self.username is not None: - serializer.write_string(_SCHEMA_EVENT.members["Username"], self.username) - - if self.resources is not None: - _serialize_resource_list( - serializer, _SCHEMA_EVENT.members["Resources"], self.resources - ) - - if self.cloud_trail_event is not None: - serializer.write_string( - _SCHEMA_EVENT.members["CloudTrailEvent"], self.cloud_trail_event - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["event_id"] = de.read_string( - _SCHEMA_EVENT.members["EventId"] - ) - - case 1: - kwargs["event_name"] = de.read_string( - _SCHEMA_EVENT.members["EventName"] - ) - - case 2: - kwargs["read_only"] = de.read_string( - _SCHEMA_EVENT.members["ReadOnly"] - ) - - case 3: - kwargs["access_key_id"] = de.read_string( - _SCHEMA_EVENT.members["AccessKeyId"] - ) - - case 4: - kwargs["event_time"] = de.read_timestamp( - _SCHEMA_EVENT.members["EventTime"] - ) - - case 5: - kwargs["event_source"] = de.read_string( - _SCHEMA_EVENT.members["EventSource"] - ) - - case 6: - kwargs["username"] = de.read_string( - _SCHEMA_EVENT.members["Username"] - ) - - case 7: - kwargs["resources"] = _deserialize_resource_list( - de, _SCHEMA_EVENT.members["Resources"] - ) - - case 8: - kwargs["cloud_trail_event"] = de.read_string( - _SCHEMA_EVENT.members["CloudTrailEvent"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EVENT, consumer=_consumer) - return kwargs - - -def _serialize_events_list( - serializer: ShapeSerializer, schema: Schema, value: list[Event] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_events_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Event]: - result: list[Event] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Event.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListInsightsDataOutput: - """Dataclass for ListInsightsDataOutput structure.""" - - events: list[Event] | None = None - """ - A list of events returned based on the InsightSource, DataType or - Dimensions specified. The events list is sorted by time. The most recent - event is listed first. - """ - - next_token: str | None = None - """ - The token to use to get the next page of results after a previous API - call. If the token does not appear, there are no more results to return. - The token must be passed in with the same parameters as the previous - call. For example, if the original call specified a EventName as a - dimension with `PutObject` as a value, the call with NextToken should - include those same parameters. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_INSIGHTS_DATA_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.events is not None: - _serialize_events_list( - serializer, - _SCHEMA_LIST_INSIGHTS_DATA_OUTPUT.members["Events"], - self.events, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_INSIGHTS_DATA_OUTPUT.members["NextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["events"] = _deserialize_events_list( - de, _SCHEMA_LIST_INSIGHTS_DATA_OUTPUT.members["Events"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_INSIGHTS_DATA_OUTPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_INSIGHTS_DATA_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_INSIGHTS_DATA = APIOperation( - input=ListInsightsDataInput, - output=ListInsightsDataOutput, - schema=_SCHEMA_LIST_INSIGHTS_DATA, - input_schema=_SCHEMA_LIST_INSIGHTS_DATA_INPUT, - output_schema=_SCHEMA_LIST_INSIGHTS_DATA_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -class InsightsMetricDataType(UnknownEnumMixin, StrEnum): - FILL_WITH_ZEROS = "FillWithZeros" - NON_ZERO_DATA = "NonZeroData" - - -@dataclass(kw_only=True) -class ListInsightsMetricDataInput: - """Dataclass for ListInsightsMetricDataInput structure.""" - - trail_name: str | None = None - """ - The Amazon Resource Name(ARN) or name of the trail for which you want to - retrieve Insights metrics data. This parameter should only be provided - to fetch Insights metrics data generated on trails logging data events. - This parameter is not required for Insights metric data generated on - trails logging management events. - """ - - event_source: str | None = None - """ - The Amazon Web Services service to which the request was made, such as - `iam.amazonaws.com` or `s3.amazonaws.com`. - """ - - event_name: str | None = None - """ - The name of the event, typically the Amazon Web Services API on which - unusual levels of activity were recorded. - """ - - insight_type: str | None = None - """ - The type of CloudTrail Insights event, which is either - `ApiCallRateInsight` or `ApiErrorRateInsight`. The `ApiCallRateInsight` - Insights type analyzes write-only management API calls that are - aggregated per minute against a baseline API call volume. The - `ApiErrorRateInsight` Insights type analyzes management API calls that - result in error codes. - """ - - error_code: str | None = None - """ - Conditionally required if the `InsightType` parameter is set to - `ApiErrorRateInsight`. - - If returning metrics for the `ApiErrorRateInsight` Insights type, this - is the error to retrieve data for. For example, `AccessDenied`. - """ - - start_time: datetime | None = None - """ - Specifies, in UTC, the start time for time-series data. The value - specified is inclusive; results include data points with the specified - time stamp. - - The default is 90 days before the time of request. - """ - - end_time: datetime | None = None - """ - Specifies, in UTC, the end time for time-series data. The value - specified is exclusive; results include data points up to the specified - time stamp. - - The default is the time of request. - """ - - period: int | None = None - """ - Granularity of data to retrieve, in seconds. Valid values are `60`, - `300`, and `3600`. If you specify any other value, you will get an - error. The default is 3600 seconds. - """ - - data_type: str | None = None - """ - Type of data points to return. Valid values are `NonZeroData` and - `FillWithZeros`. The default is `NonZeroData`. - """ - - max_results: int | None = None - """ - The maximum number of data points to return. Valid values are integers - from 1 to 21600. The default value is 21600. - """ - - next_token: str | None = None - """ - Returned if all datapoints can't be returned in a single call. For - example, due to reaching `MaxResults`. - - Add this parameter to the request to continue retrieving results - starting from the last evaluated point. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_INSIGHTS_METRIC_DATA_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.trail_name is not None: - serializer.write_string( - _SCHEMA_LIST_INSIGHTS_METRIC_DATA_INPUT.members["TrailName"], - self.trail_name, - ) - - if self.event_source is not None: - serializer.write_string( - _SCHEMA_LIST_INSIGHTS_METRIC_DATA_INPUT.members["EventSource"], - self.event_source, - ) - - if self.event_name is not None: - serializer.write_string( - _SCHEMA_LIST_INSIGHTS_METRIC_DATA_INPUT.members["EventName"], - self.event_name, - ) - - if self.insight_type is not None: - serializer.write_string( - _SCHEMA_LIST_INSIGHTS_METRIC_DATA_INPUT.members["InsightType"], - self.insight_type, - ) - - if self.error_code is not None: - serializer.write_string( - _SCHEMA_LIST_INSIGHTS_METRIC_DATA_INPUT.members["ErrorCode"], - self.error_code, - ) - - if self.start_time is not None: - serializer.write_timestamp( - _SCHEMA_LIST_INSIGHTS_METRIC_DATA_INPUT.members["StartTime"], - self.start_time, - ) - - if self.end_time is not None: - serializer.write_timestamp( - _SCHEMA_LIST_INSIGHTS_METRIC_DATA_INPUT.members["EndTime"], - self.end_time, - ) - - if self.period is not None: - serializer.write_integer( - _SCHEMA_LIST_INSIGHTS_METRIC_DATA_INPUT.members["Period"], self.period - ) - - if self.data_type is not None: - serializer.write_string( - _SCHEMA_LIST_INSIGHTS_METRIC_DATA_INPUT.members["DataType"], - self.data_type, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_INSIGHTS_METRIC_DATA_INPUT.members["MaxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_INSIGHTS_METRIC_DATA_INPUT.members["NextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["trail_name"] = de.read_string( - _SCHEMA_LIST_INSIGHTS_METRIC_DATA_INPUT.members["TrailName"] - ) - - case 1: - kwargs["event_source"] = de.read_string( - _SCHEMA_LIST_INSIGHTS_METRIC_DATA_INPUT.members["EventSource"] - ) - - case 2: - kwargs["event_name"] = de.read_string( - _SCHEMA_LIST_INSIGHTS_METRIC_DATA_INPUT.members["EventName"] - ) - - case 3: - kwargs["insight_type"] = InsightType( - de.read_string( - _SCHEMA_LIST_INSIGHTS_METRIC_DATA_INPUT.members[ - "InsightType" - ] - ) - ) - - case 4: - kwargs["error_code"] = de.read_string( - _SCHEMA_LIST_INSIGHTS_METRIC_DATA_INPUT.members["ErrorCode"] - ) - - case 5: - kwargs["start_time"] = de.read_timestamp( - _SCHEMA_LIST_INSIGHTS_METRIC_DATA_INPUT.members["StartTime"] - ) - - case 6: - kwargs["end_time"] = de.read_timestamp( - _SCHEMA_LIST_INSIGHTS_METRIC_DATA_INPUT.members["EndTime"] - ) - - case 7: - kwargs["period"] = de.read_integer( - _SCHEMA_LIST_INSIGHTS_METRIC_DATA_INPUT.members["Period"] - ) - - case 8: - kwargs["data_type"] = InsightsMetricDataType( - de.read_string( - _SCHEMA_LIST_INSIGHTS_METRIC_DATA_INPUT.members["DataType"] - ) - ) - - case 9: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_INSIGHTS_METRIC_DATA_INPUT.members["MaxResults"] - ) - - case 10: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_INSIGHTS_METRIC_DATA_INPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_INSIGHTS_METRIC_DATA_INPUT, consumer=_consumer - ) - return kwargs - - -def _serialize_timestamps( - serializer: ShapeSerializer, schema: Schema, value: list[datetime] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_timestamp(member_schema, e) - - -def _deserialize_timestamps( - deserializer: ShapeDeserializer, schema: Schema -) -> list[datetime]: - result: list[datetime] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_timestamp(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_insights_metric_values( - serializer: ShapeSerializer, schema: Schema, value: list[float] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_double(member_schema, e) - - -def _deserialize_insights_metric_values( - deserializer: ShapeDeserializer, schema: Schema -) -> list[float]: - result: list[float] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_double(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListInsightsMetricDataOutput: - """Dataclass for ListInsightsMetricDataOutput structure.""" - - trail_arn: str | None = None - """ - Specifies the ARN of the trail. This is only returned when Insights is - enabled on a trail logging data events. - """ - - event_source: str | None = None - """ - The Amazon Web Services service to which the request was made, such as - `iam.amazonaws.com` or `s3.amazonaws.com`. - """ - - event_name: str | None = None - """ - The name of the event, typically the Amazon Web Services API on which - unusual levels of activity were recorded. - """ - - insight_type: str | None = None - """ - The type of CloudTrail Insights event, which is either - `ApiCallRateInsight` or `ApiErrorRateInsight`. The `ApiCallRateInsight` - Insights type analyzes write-only management API calls that are - aggregated per minute against a baseline API call volume. The - `ApiErrorRateInsight` Insights type analyzes management API calls that - result in error codes. - """ - - error_code: str | None = None - """ - Only returned if `InsightType` parameter was set to - `ApiErrorRateInsight`. - - If returning metrics for the `ApiErrorRateInsight` Insights type, this - is the error to retrieve data for. For example, `AccessDenied`. - """ - - timestamps: list[datetime] | None = None - """ - List of timestamps at intervals corresponding to the specified time - period. - """ - - values: list[float] | None = None - """ - List of values representing the API call rate or error rate at each - timestamp. The number of values is equal to the number of timestamps. - """ - - next_token: str | None = None - """ - Only returned if the full results could not be returned in a single - query. You can set the `NextToken` parameter in the next request to this - value to continue retrieval. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_INSIGHTS_METRIC_DATA_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.trail_arn is not None: - serializer.write_string( - _SCHEMA_LIST_INSIGHTS_METRIC_DATA_OUTPUT.members["TrailARN"], - self.trail_arn, - ) - - if self.event_source is not None: - serializer.write_string( - _SCHEMA_LIST_INSIGHTS_METRIC_DATA_OUTPUT.members["EventSource"], - self.event_source, - ) - - if self.event_name is not None: - serializer.write_string( - _SCHEMA_LIST_INSIGHTS_METRIC_DATA_OUTPUT.members["EventName"], - self.event_name, - ) - - if self.insight_type is not None: - serializer.write_string( - _SCHEMA_LIST_INSIGHTS_METRIC_DATA_OUTPUT.members["InsightType"], - self.insight_type, - ) - - if self.error_code is not None: - serializer.write_string( - _SCHEMA_LIST_INSIGHTS_METRIC_DATA_OUTPUT.members["ErrorCode"], - self.error_code, - ) - - if self.timestamps is not None: - _serialize_timestamps( - serializer, - _SCHEMA_LIST_INSIGHTS_METRIC_DATA_OUTPUT.members["Timestamps"], - self.timestamps, - ) - - if self.values is not None: - _serialize_insights_metric_values( - serializer, - _SCHEMA_LIST_INSIGHTS_METRIC_DATA_OUTPUT.members["Values"], - self.values, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_INSIGHTS_METRIC_DATA_OUTPUT.members["NextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["trail_arn"] = de.read_string( - _SCHEMA_LIST_INSIGHTS_METRIC_DATA_OUTPUT.members["TrailARN"] - ) - - case 1: - kwargs["event_source"] = de.read_string( - _SCHEMA_LIST_INSIGHTS_METRIC_DATA_OUTPUT.members["EventSource"] - ) - - case 2: - kwargs["event_name"] = de.read_string( - _SCHEMA_LIST_INSIGHTS_METRIC_DATA_OUTPUT.members["EventName"] - ) - - case 3: - kwargs["insight_type"] = InsightType( - de.read_string( - _SCHEMA_LIST_INSIGHTS_METRIC_DATA_OUTPUT.members[ - "InsightType" - ] - ) - ) - - case 4: - kwargs["error_code"] = de.read_string( - _SCHEMA_LIST_INSIGHTS_METRIC_DATA_OUTPUT.members["ErrorCode"] - ) - - case 5: - kwargs["timestamps"] = _deserialize_timestamps( - de, - _SCHEMA_LIST_INSIGHTS_METRIC_DATA_OUTPUT.members["Timestamps"], - ) - - case 6: - kwargs["values"] = _deserialize_insights_metric_values( - de, _SCHEMA_LIST_INSIGHTS_METRIC_DATA_OUTPUT.members["Values"] - ) - - case 7: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_INSIGHTS_METRIC_DATA_OUTPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_INSIGHTS_METRIC_DATA_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_INSIGHTS_METRIC_DATA = APIOperation( - input=ListInsightsMetricDataInput, - output=ListInsightsMetricDataOutput, - schema=_SCHEMA_LIST_INSIGHTS_METRIC_DATA, - input_schema=_SCHEMA_LIST_INSIGHTS_METRIC_DATA_INPUT, - output_schema=_SCHEMA_LIST_INSIGHTS_METRIC_DATA_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidTrailNameException" - ): InvalidTrailNameException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_INVALID_TRAIL_NAME_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class InvalidTimeRangeException(ServiceError): - """ - Occurs if the timestamp values are not valid. Either the start time - occurs after the end time, or the time range is outside the range of - possible values. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_TIME_RANGE_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_TIME_RANGE_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_TIME_RANGE_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVALID_TIME_RANGE_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InvalidTokenException(ServiceError): - """Reserved for future use.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_TOKEN_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_TOKEN_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_TOKEN_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INVALID_TOKEN_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ListPublicKeysInput: - """Requests the public keys for a specified time range.""" - - start_time: datetime | None = None - """ - Optionally specifies, in UTC, the start of the time range to look up - public keys for CloudTrail digest files. If not specified, the current - time is used, and the current public key is returned. - """ - - end_time: datetime | None = None - """ - Optionally specifies, in UTC, the end of the time range to look up - public keys for CloudTrail digest files. If not specified, the current - time is used. - """ - - next_token: str | None = None - """Reserved for future use.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_PUBLIC_KEYS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.start_time is not None: - serializer.write_timestamp( - _SCHEMA_LIST_PUBLIC_KEYS_INPUT.members["StartTime"], self.start_time - ) - - if self.end_time is not None: - serializer.write_timestamp( - _SCHEMA_LIST_PUBLIC_KEYS_INPUT.members["EndTime"], self.end_time - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_PUBLIC_KEYS_INPUT.members["NextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["start_time"] = de.read_timestamp( - _SCHEMA_LIST_PUBLIC_KEYS_INPUT.members["StartTime"] - ) - - case 1: - kwargs["end_time"] = de.read_timestamp( - _SCHEMA_LIST_PUBLIC_KEYS_INPUT.members["EndTime"] - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_PUBLIC_KEYS_INPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_PUBLIC_KEYS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class PublicKey: - """Contains information about a returned public key.""" - - value: bytes | None = None - """The DER encoded public key value in PKCS#1 format.""" - - validity_start_time: datetime | None = None - """The starting time of validity of the public key.""" - - validity_end_time: datetime | None = None - """The ending time of validity of the public key.""" - - fingerprint: str | None = None - """The fingerprint of the public key.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUBLIC_KEY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.value is not None: - serializer.write_blob(_SCHEMA_PUBLIC_KEY.members["Value"], self.value) - - if self.validity_start_time is not None: - serializer.write_timestamp( - _SCHEMA_PUBLIC_KEY.members["ValidityStartTime"], - self.validity_start_time, - ) - - if self.validity_end_time is not None: - serializer.write_timestamp( - _SCHEMA_PUBLIC_KEY.members["ValidityEndTime"], self.validity_end_time - ) - - if self.fingerprint is not None: - serializer.write_string( - _SCHEMA_PUBLIC_KEY.members["Fingerprint"], self.fingerprint - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["value"] = de.read_blob(_SCHEMA_PUBLIC_KEY.members["Value"]) - - case 1: - kwargs["validity_start_time"] = de.read_timestamp( - _SCHEMA_PUBLIC_KEY.members["ValidityStartTime"] - ) - - case 2: - kwargs["validity_end_time"] = de.read_timestamp( - _SCHEMA_PUBLIC_KEY.members["ValidityEndTime"] - ) - - case 3: - kwargs["fingerprint"] = de.read_string( - _SCHEMA_PUBLIC_KEY.members["Fingerprint"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUBLIC_KEY, consumer=_consumer) - return kwargs - - -def _serialize_public_key_list( - serializer: ShapeSerializer, schema: Schema, value: list[PublicKey] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_public_key_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[PublicKey]: - result: list[PublicKey] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(PublicKey.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListPublicKeysOutput: - """ - Returns the objects or data listed below if successful. Otherwise, - returns an error. - """ - - public_key_list: list[PublicKey] | None = None - """ - Contains an array of PublicKey objects. - - Note: - The returned public keys may have validity time ranges that overlap. - """ - - next_token: str | None = None - """Reserved for future use.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_PUBLIC_KEYS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.public_key_list is not None: - _serialize_public_key_list( - serializer, - _SCHEMA_LIST_PUBLIC_KEYS_OUTPUT.members["PublicKeyList"], - self.public_key_list, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_PUBLIC_KEYS_OUTPUT.members["NextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["public_key_list"] = _deserialize_public_key_list( - de, _SCHEMA_LIST_PUBLIC_KEYS_OUTPUT.members["PublicKeyList"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_PUBLIC_KEYS_OUTPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_PUBLIC_KEYS_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_PUBLIC_KEYS = APIOperation( - input=ListPublicKeysInput, - output=ListPublicKeysOutput, - schema=_SCHEMA_LIST_PUBLIC_KEYS, - input_schema=_SCHEMA_LIST_PUBLIC_KEYS_INPUT, - output_schema=_SCHEMA_LIST_PUBLIC_KEYS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#InvalidTimeRangeException" - ): InvalidTimeRangeException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidTokenException" - ): InvalidTokenException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_TIME_RANGE_EXCEPTION, - _SCHEMA_INVALID_TOKEN_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class InvalidDateRangeException(ServiceError): - """ - A date range for the query was specified that is not valid. Be sure that - the start time is chronologically before the end time. For more - information about writing a query, see [Create or edit a - query](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-create-edit-query.html) - in the *CloudTrail User Guide*. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_DATE_RANGE_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_DATE_RANGE_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_DATE_RANGE_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVALID_DATE_RANGE_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InvalidQueryStatusException(ServiceError): - """The query status is not valid for the operation.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_QUERY_STATUS_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_QUERY_STATUS_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_QUERY_STATUS_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVALID_QUERY_STATUS_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ListQueriesInput: - """Dataclass for ListQueriesInput structure.""" - - event_data_store: str | None = None - """ - The ARN (or the ID suffix of the ARN) of an event data store on which - queries were run. - """ - - next_token: str | None = None - """A token you can use to get the next page of results.""" - - max_results: int | None = None - """The maximum number of queries to show on a page.""" - - start_time: datetime | None = None - """ - Use with `EndTime` to bound a `ListQueries` request, and limit its - results to only those queries run within a specified time period. - """ - - end_time: datetime | None = None - """ - Use with `StartTime` to bound a `ListQueries` request, and limit its - results to only those queries run within a specified time period. - """ - - query_status: str | None = None - """ - The status of queries that you want to return in results. Valid values - for `QueryStatus` include `QUEUED`, `RUNNING`, `FINISHED`, `FAILED`, - `TIMED_OUT`, or `CANCELLED`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_QUERIES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.event_data_store is not None: - serializer.write_string( - _SCHEMA_LIST_QUERIES_INPUT.members["EventDataStore"], - self.event_data_store, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_QUERIES_INPUT.members["NextToken"], self.next_token - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_QUERIES_INPUT.members["MaxResults"], self.max_results - ) - - if self.start_time is not None: - serializer.write_timestamp( - _SCHEMA_LIST_QUERIES_INPUT.members["StartTime"], self.start_time - ) - - if self.end_time is not None: - serializer.write_timestamp( - _SCHEMA_LIST_QUERIES_INPUT.members["EndTime"], self.end_time - ) - - if self.query_status is not None: - serializer.write_string( - _SCHEMA_LIST_QUERIES_INPUT.members["QueryStatus"], self.query_status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["event_data_store"] = de.read_string( - _SCHEMA_LIST_QUERIES_INPUT.members["EventDataStore"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_QUERIES_INPUT.members["NextToken"] - ) - - case 2: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_QUERIES_INPUT.members["MaxResults"] - ) - - case 3: - kwargs["start_time"] = de.read_timestamp( - _SCHEMA_LIST_QUERIES_INPUT.members["StartTime"] - ) - - case 4: - kwargs["end_time"] = de.read_timestamp( - _SCHEMA_LIST_QUERIES_INPUT.members["EndTime"] - ) - - case 5: - kwargs["query_status"] = QueryStatus( - de.read_string( - _SCHEMA_LIST_QUERIES_INPUT.members["QueryStatus"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_QUERIES_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Query: - """ - A SQL string of criteria about events that you want to collect in an - event data store. - """ - - query_id: str | None = None - """The ID of a query.""" - - query_status: str | None = None - """ - The status of the query. This can be `QUEUED`, `RUNNING`, `FINISHED`, - `FAILED`, `TIMED_OUT`, or `CANCELLED`. - """ - - creation_time: datetime | None = None - """The creation time of a query.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_QUERY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.query_id is not None: - serializer.write_string(_SCHEMA_QUERY.members["QueryId"], self.query_id) - - if self.query_status is not None: - serializer.write_string( - _SCHEMA_QUERY.members["QueryStatus"], self.query_status - ) - - if self.creation_time is not None: - serializer.write_timestamp( - _SCHEMA_QUERY.members["CreationTime"], self.creation_time - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["query_id"] = de.read_string( - _SCHEMA_QUERY.members["QueryId"] - ) - - case 1: - kwargs["query_status"] = QueryStatus( - de.read_string(_SCHEMA_QUERY.members["QueryStatus"]) - ) - - case 2: - kwargs["creation_time"] = de.read_timestamp( - _SCHEMA_QUERY.members["CreationTime"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_QUERY, consumer=_consumer) - return kwargs - - -def _serialize_queries( - serializer: ShapeSerializer, schema: Schema, value: list[Query] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_queries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Query]: - result: list[Query] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Query.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListQueriesOutput: - """Dataclass for ListQueriesOutput structure.""" - - queries: list[Query] | None = None - """ - Lists matching query results, and shows query ID, status, and creation - time of each query. - """ - - next_token: str | None = None - """A token you can use to get the next page of results.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_QUERIES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.queries is not None: - _serialize_queries( - serializer, _SCHEMA_LIST_QUERIES_OUTPUT.members["Queries"], self.queries - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_QUERIES_OUTPUT.members["NextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["queries"] = _deserialize_queries( - de, _SCHEMA_LIST_QUERIES_OUTPUT.members["Queries"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_QUERIES_OUTPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_QUERIES_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_QUERIES = APIOperation( - input=ListQueriesInput, - output=ListQueriesOutput, - schema=_SCHEMA_LIST_QUERIES, - input_schema=_SCHEMA_LIST_QUERIES_INPUT, - output_schema=_SCHEMA_LIST_QUERIES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreARNInvalidException" - ): EventDataStoreARNInvalidException, - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreNotFoundException" - ): EventDataStoreNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#InactiveEventDataStoreException" - ): InactiveEventDataStoreException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidDateRangeException" - ): InvalidDateRangeException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidMaxResultsException" - ): InvalidMaxResultsException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidNextTokenException" - ): InvalidNextTokenException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidQueryStatusException" - ): InvalidQueryStatusException, - ShapeID( - "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException" - ): NoManagementAccountSLRExistsException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_EVENT_DATA_STORE_ARN_INVALID_EXCEPTION, - _SCHEMA_EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, - _SCHEMA_INACTIVE_EVENT_DATA_STORE_EXCEPTION, - _SCHEMA_INVALID_DATE_RANGE_EXCEPTION, - _SCHEMA_INVALID_MAX_RESULTS_EXCEPTION, - _SCHEMA_INVALID_NEXT_TOKEN_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_INVALID_QUERY_STATUS_EXCEPTION, - _SCHEMA_NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -def _serialize_resource_id_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_resource_id_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListTagsInput: - """Specifies a list of tags to return.""" - - resource_id_list: list[str] | None = None - """ - Specifies a list of trail, event data store, dashboard, or channel ARNs - whose tags will be listed. The list has a limit of 20 ARNs. - - Example trail ARN format: - `arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail` - - Example event data store ARN format: - `arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE` - - Example dashboard ARN format: - `arn:aws:cloudtrail:us-east-1:123456789012:dashboard/exampleDash` - - Example channel ARN format: - `arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890` - """ - - next_token: str | None = None - """Reserved for future use.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_TAGS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_id_list is not None: - _serialize_resource_id_list( - serializer, - _SCHEMA_LIST_TAGS_INPUT.members["ResourceIdList"], - self.resource_id_list, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_TAGS_INPUT.members["NextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_id_list"] = _deserialize_resource_id_list( - de, _SCHEMA_LIST_TAGS_INPUT.members["ResourceIdList"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_TAGS_INPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_TAGS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ResourceTag: - """A resource tag.""" - - resource_id: str | None = None - """Specifies the ARN of the resource.""" - - tags_list: list[Tag] | None = None - """A list of tags.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESOURCE_TAG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_id is not None: - serializer.write_string( - _SCHEMA_RESOURCE_TAG.members["ResourceId"], self.resource_id - ) - - if self.tags_list is not None: - _serialize_tags_list( - serializer, _SCHEMA_RESOURCE_TAG.members["TagsList"], self.tags_list - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_id"] = de.read_string( - _SCHEMA_RESOURCE_TAG.members["ResourceId"] - ) - - case 1: - kwargs["tags_list"] = _deserialize_tags_list( - de, _SCHEMA_RESOURCE_TAG.members["TagsList"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RESOURCE_TAG, consumer=_consumer) - return kwargs - - -def _serialize_resource_tag_list( - serializer: ShapeSerializer, schema: Schema, value: list[ResourceTag] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_resource_tag_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ResourceTag]: - result: list[ResourceTag] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ResourceTag.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListTagsOutput: - """ - Returns the objects or data listed below if successful. Otherwise, - returns an error. - """ - - resource_tag_list: list[ResourceTag] | None = None - """A list of resource tags.""" - - next_token: str | None = None - """Reserved for future use.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_TAGS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_tag_list is not None: - _serialize_resource_tag_list( - serializer, - _SCHEMA_LIST_TAGS_OUTPUT.members["ResourceTagList"], - self.resource_tag_list, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_TAGS_OUTPUT.members["NextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_tag_list"] = _deserialize_resource_tag_list( - de, _SCHEMA_LIST_TAGS_OUTPUT.members["ResourceTagList"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_TAGS_OUTPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_TAGS_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_TAGS = APIOperation( - input=ListTagsInput, - output=ListTagsOutput, - schema=_SCHEMA_LIST_TAGS, - input_schema=_SCHEMA_LIST_TAGS_INPUT, - output_schema=_SCHEMA_LIST_TAGS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#ChannelARNInvalidException" - ): ChannelARNInvalidException, - ShapeID( - "com.amazonaws.cloudtrail#CloudTrailARNInvalidException" - ): CloudTrailARNInvalidException, - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreARNInvalidException" - ): EventDataStoreARNInvalidException, - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreNotFoundException" - ): EventDataStoreNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#InactiveEventDataStoreException" - ): InactiveEventDataStoreException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidTokenException" - ): InvalidTokenException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidTrailNameException" - ): InvalidTrailNameException, - ShapeID( - "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException" - ): NoManagementAccountSLRExistsException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#ResourceTypeNotSupportedException" - ): ResourceTypeNotSupportedException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CHANNEL_ARN_INVALID_EXCEPTION, - _SCHEMA_CLOUD_TRAIL_ARN_INVALID_EXCEPTION, - _SCHEMA_EVENT_DATA_STORE_ARN_INVALID_EXCEPTION, - _SCHEMA_EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, - _SCHEMA_INACTIVE_EVENT_DATA_STORE_EXCEPTION, - _SCHEMA_INVALID_TOKEN_EXCEPTION, - _SCHEMA_INVALID_TRAIL_NAME_EXCEPTION, - _SCHEMA_NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_RESOURCE_TYPE_NOT_SUPPORTED_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListTrailsInput: - """Dataclass for ListTrailsInput structure.""" - - next_token: str | None = None - """ - The token to use to get the next page of results after a previous API - call. This token must be passed in with the same parameters that were - specified in the original call. For example, if the original call - specified an AttributeKey of 'Username' with a value of 'root', the - call with NextToken should include those same parameters. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_TRAILS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_TRAILS_INPUT.members["NextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_TRAILS_INPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_TRAILS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class TrailInfo: - """ - Information about a CloudTrail trail, including the trail's name, home - Region, and Amazon Resource Name (ARN). - """ - - trail_arn: str | None = None - """The ARN of a trail.""" - - name: str | None = None - """The name of a trail.""" - - home_region: str | None = None - """The Amazon Web Services Region in which a trail was created.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRAIL_INFO, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.trail_arn is not None: - serializer.write_string( - _SCHEMA_TRAIL_INFO.members["TrailARN"], self.trail_arn - ) - - if self.name is not None: - serializer.write_string(_SCHEMA_TRAIL_INFO.members["Name"], self.name) - - if self.home_region is not None: - serializer.write_string( - _SCHEMA_TRAIL_INFO.members["HomeRegion"], self.home_region - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["trail_arn"] = de.read_string( - _SCHEMA_TRAIL_INFO.members["TrailARN"] - ) - - case 1: - kwargs["name"] = de.read_string(_SCHEMA_TRAIL_INFO.members["Name"]) - - case 2: - kwargs["home_region"] = de.read_string( - _SCHEMA_TRAIL_INFO.members["HomeRegion"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TRAIL_INFO, consumer=_consumer) - return kwargs - - -def _serialize_trails( - serializer: ShapeSerializer, schema: Schema, value: list[TrailInfo] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_trails( - deserializer: ShapeDeserializer, schema: Schema -) -> list[TrailInfo]: - result: list[TrailInfo] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(TrailInfo.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListTrailsOutput: - """Dataclass for ListTrailsOutput structure.""" - - trails: list[TrailInfo] | None = None - """Returns the name, ARN, and home Region of trails in the current account.""" - - next_token: str | None = None - """ - The token to use to get the next page of results after a previous API - call. If the token does not appear, there are no more results to return. - The token must be passed in with the same parameters as the previous - call. For example, if the original call specified an AttributeKey of - 'Username' with a value of 'root', the call with NextToken should - include those same parameters. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_TRAILS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.trails is not None: - _serialize_trails( - serializer, _SCHEMA_LIST_TRAILS_OUTPUT.members["Trails"], self.trails - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_TRAILS_OUTPUT.members["NextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["trails"] = _deserialize_trails( - de, _SCHEMA_LIST_TRAILS_OUTPUT.members["Trails"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_TRAILS_OUTPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_TRAILS_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_TRAILS = APIOperation( - input=ListTrailsInput, - output=ListTrailsOutput, - schema=_SCHEMA_LIST_TRAILS, - input_schema=_SCHEMA_LIST_TRAILS_INPUT, - output_schema=_SCHEMA_LIST_TRAILS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class InvalidEventCategoryException(ServiceError): - """ - Occurs if an event category that is not valid is specified as a value of - `EventCategory`. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_EVENT_CATEGORY_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_EVENT_CATEGORY_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_EVENT_CATEGORY_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVALID_EVENT_CATEGORY_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InvalidLookupAttributesException(ServiceError): - """Occurs when a lookup attribute is specified that is not valid.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_LOOKUP_ATTRIBUTES_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_LOOKUP_ATTRIBUTES_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_LOOKUP_ATTRIBUTES_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVALID_LOOKUP_ATTRIBUTES_EXCEPTION, consumer=_consumer - ) - return kwargs - - -class EventCategory(UnknownEnumMixin, StrEnum): - """ - Specifies the event category for which aggregation configuration is - enabled. Valid value is Data. - """ - - INSIGHT = "insight" - - -class LookupAttributeKey(UnknownEnumMixin, StrEnum): - EVENT_ID = "EventId" - EVENT_NAME = "EventName" - READ_ONLY = "ReadOnly" - USERNAME = "Username" - RESOURCE_TYPE = "ResourceType" - RESOURCE_NAME = "ResourceName" - EVENT_SOURCE = "EventSource" - ACCESS_KEY_ID = "AccessKeyId" - - -@dataclass(kw_only=True) -class LookupAttribute: - """Specifies an attribute and value that filter the events returned.""" - - attribute_key: str - """Specifies an attribute on which to filter the events returned.""" - - attribute_value: str - """ - Specifies a value for the specified `AttributeKey`. - - The maximum length for the `AttributeValue` is 2000 characters. The - following characters ('`_`', '` `', '`,`', '`\\n`') count as two - characters towards the 2000 character limit. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LOOKUP_ATTRIBUTE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_LOOKUP_ATTRIBUTE.members["AttributeKey"], self.attribute_key - ) - serializer.write_string( - _SCHEMA_LOOKUP_ATTRIBUTE.members["AttributeValue"], self.attribute_value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["attribute_key"] = LookupAttributeKey( - de.read_string(_SCHEMA_LOOKUP_ATTRIBUTE.members["AttributeKey"]) - ) - - case 1: - kwargs["attribute_value"] = de.read_string( - _SCHEMA_LOOKUP_ATTRIBUTE.members["AttributeValue"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LOOKUP_ATTRIBUTE, consumer=_consumer) - if "attribute_key" not in kwargs: - kwargs["attribute_key"] = LookupAttributeKey._corrected("") - if "attribute_value" not in kwargs: - kwargs["attribute_value"] = "" - return kwargs - - -def _serialize_lookup_attributes_list( - serializer: ShapeSerializer, schema: Schema, value: list[LookupAttribute] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_lookup_attributes_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[LookupAttribute]: - result: list[LookupAttribute] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(LookupAttribute.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class LookupEventsInput: - """Contains a request for LookupEvents.""" - - lookup_attributes: list[LookupAttribute] | None = None - """ - Contains a list of lookup attributes. Currently the list can contain - only one item. - """ - - start_time: datetime | None = None - """ - Specifies that only events that occur after or at the specified time are - returned. If the specified start time is after the specified end time, - an error is returned. - """ - - end_time: datetime | None = None - """ - Specifies that only events that occur before or at the specified time - are returned. If the specified end time is before the specified start - time, an error is returned. - """ - - event_category: str | None = None - """ - Specifies the event category. If you do not specify an event category, - events of the category are not returned in the response. For example, if - you do not specify `insight` as the value of `EventCategory`, no - Insights events are returned. - """ - - max_results: int | None = None - """ - The number of events to return. Possible values are 1 through 50. The - default is 50. - """ - - next_token: str | None = None - """ - The token to use to get the next page of results after a previous API - call. This token must be passed in with the same parameters that were - specified in the original call. For example, if the original call - specified an AttributeKey of 'Username' with a value of 'root', the - call with NextToken should include those same parameters. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LOOKUP_EVENTS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.lookup_attributes is not None: - _serialize_lookup_attributes_list( - serializer, - _SCHEMA_LOOKUP_EVENTS_INPUT.members["LookupAttributes"], - self.lookup_attributes, - ) - - if self.start_time is not None: - serializer.write_timestamp( - _SCHEMA_LOOKUP_EVENTS_INPUT.members["StartTime"], self.start_time - ) - - if self.end_time is not None: - serializer.write_timestamp( - _SCHEMA_LOOKUP_EVENTS_INPUT.members["EndTime"], self.end_time - ) - - if self.event_category is not None: - serializer.write_string( - _SCHEMA_LOOKUP_EVENTS_INPUT.members["EventCategory"], - self.event_category, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LOOKUP_EVENTS_INPUT.members["MaxResults"], self.max_results - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LOOKUP_EVENTS_INPUT.members["NextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["lookup_attributes"] = _deserialize_lookup_attributes_list( - de, _SCHEMA_LOOKUP_EVENTS_INPUT.members["LookupAttributes"] - ) - - case 1: - kwargs["start_time"] = de.read_timestamp( - _SCHEMA_LOOKUP_EVENTS_INPUT.members["StartTime"] - ) - - case 2: - kwargs["end_time"] = de.read_timestamp( - _SCHEMA_LOOKUP_EVENTS_INPUT.members["EndTime"] - ) - - case 3: - kwargs["event_category"] = EventCategory( - de.read_string( - _SCHEMA_LOOKUP_EVENTS_INPUT.members["EventCategory"] - ) - ) - - case 4: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LOOKUP_EVENTS_INPUT.members["MaxResults"] - ) - - case 5: - kwargs["next_token"] = de.read_string( - _SCHEMA_LOOKUP_EVENTS_INPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LOOKUP_EVENTS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class LookupEventsOutput: - """Contains a response to a LookupEvents action.""" - - events: list[Event] | None = None - """ - A list of events returned based on the lookup attributes specified and - the CloudTrail event. The events list is sorted by time. The most recent - event is listed first. - """ - - next_token: str | None = None - """ - The token to use to get the next page of results after a previous API - call. If the token does not appear, there are no more results to return. - The token must be passed in with the same parameters as the previous - call. For example, if the original call specified an AttributeKey of - 'Username' with a value of 'root', the call with NextToken should - include those same parameters. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LOOKUP_EVENTS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.events is not None: - _serialize_events_list( - serializer, _SCHEMA_LOOKUP_EVENTS_OUTPUT.members["Events"], self.events - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LOOKUP_EVENTS_OUTPUT.members["NextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["events"] = _deserialize_events_list( - de, _SCHEMA_LOOKUP_EVENTS_OUTPUT.members["Events"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LOOKUP_EVENTS_OUTPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LOOKUP_EVENTS_OUTPUT, consumer=_consumer) - return kwargs - - -LOOKUP_EVENTS = APIOperation( - input=LookupEventsInput, - output=LookupEventsOutput, - schema=_SCHEMA_LOOKUP_EVENTS, - input_schema=_SCHEMA_LOOKUP_EVENTS_INPUT, - output_schema=_SCHEMA_LOOKUP_EVENTS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#InvalidEventCategoryException" - ): InvalidEventCategoryException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidLookupAttributesException" - ): InvalidLookupAttributesException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidMaxResultsException" - ): InvalidMaxResultsException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidNextTokenException" - ): InvalidNextTokenException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidTimeRangeException" - ): InvalidTimeRangeException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_EVENT_CATEGORY_EXCEPTION, - _SCHEMA_INVALID_LOOKUP_ATTRIBUTES_EXCEPTION, - _SCHEMA_INVALID_MAX_RESULTS_EXCEPTION, - _SCHEMA_INVALID_NEXT_TOKEN_EXCEPTION, - _SCHEMA_INVALID_TIME_RANGE_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class InsufficientIAMAccessPermissionException(ServiceError): - """ - The task can't be completed because you are signed in with an account - that lacks permissions to view or create a service-linked role. Sign in - with an account that has the required permissions and then try again. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INSUFFICIENT_IAM_ACCESS_PERMISSION_EXCEPTION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INSUFFICIENT_IAM_ACCESS_PERMISSION_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INSUFFICIENT_IAM_ACCESS_PERMISSION_EXCEPTION.members[ - "Message" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INSUFFICIENT_IAM_ACCESS_PERMISSION_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class PutEventConfigurationInput: - """Dataclass for PutEventConfigurationInput structure.""" - - trail_name: str | None = None - """ - The name of the trail for which you want to update event configuration - settings. - """ - - event_data_store: str | None = None - """ - The Amazon Resource Name (ARN) or ID suffix of the ARN of the event data - store for which event configuration settings are updated. - """ - - max_event_size: str | None = None - """ - The maximum allowed size for events to be stored in the specified event - data store. If you are using context key selectors, MaxEventSize must be - set to Large. - """ - - context_key_selectors: list[ContextKeySelector] | None = None - """ - A list of context key selectors that will be included to provide - enriched event data. - """ - - aggregation_configurations: list[AggregationConfiguration] | None = None - """ - The list of aggregation configurations that you want to configure for - the trail. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_EVENT_CONFIGURATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.trail_name is not None: - serializer.write_string( - _SCHEMA_PUT_EVENT_CONFIGURATION_INPUT.members["TrailName"], - self.trail_name, - ) - - if self.event_data_store is not None: - serializer.write_string( - _SCHEMA_PUT_EVENT_CONFIGURATION_INPUT.members["EventDataStore"], - self.event_data_store, - ) - - if self.max_event_size is not None: - serializer.write_string( - _SCHEMA_PUT_EVENT_CONFIGURATION_INPUT.members["MaxEventSize"], - self.max_event_size, - ) - - if self.context_key_selectors is not None: - _serialize_context_key_selectors( - serializer, - _SCHEMA_PUT_EVENT_CONFIGURATION_INPUT.members["ContextKeySelectors"], - self.context_key_selectors, - ) - - if self.aggregation_configurations is not None: - _serialize_aggregation_configurations( - serializer, - _SCHEMA_PUT_EVENT_CONFIGURATION_INPUT.members[ - "AggregationConfigurations" - ], - self.aggregation_configurations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["trail_name"] = de.read_string( - _SCHEMA_PUT_EVENT_CONFIGURATION_INPUT.members["TrailName"] - ) - - case 1: - kwargs["event_data_store"] = de.read_string( - _SCHEMA_PUT_EVENT_CONFIGURATION_INPUT.members["EventDataStore"] - ) - - case 2: - kwargs["max_event_size"] = MaxEventSize( - de.read_string( - _SCHEMA_PUT_EVENT_CONFIGURATION_INPUT.members[ - "MaxEventSize" - ] - ) - ) - - case 3: - kwargs["context_key_selectors"] = ( - _deserialize_context_key_selectors( - de, - _SCHEMA_PUT_EVENT_CONFIGURATION_INPUT.members[ - "ContextKeySelectors" - ], - ) - ) - - case 4: - kwargs["aggregation_configurations"] = ( - _deserialize_aggregation_configurations( - de, - _SCHEMA_PUT_EVENT_CONFIGURATION_INPUT.members[ - "AggregationConfigurations" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PUT_EVENT_CONFIGURATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class PutEventConfigurationOutput: - """Dataclass for PutEventConfigurationOutput structure.""" - - trail_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the trail that has aggregation - enabled. - """ - - event_data_store_arn: str | None = None - """ - The Amazon Resource Name (ARN) or ID suffix of the ARN of the event data - store for which the event configuration settings were updated. - """ - - max_event_size: str | None = None - """ - The maximum allowed size for events stored in the specified event data - store. - """ - - context_key_selectors: list[ContextKeySelector] | None = None - """ - The list of context key selectors that are configured for the event data - store. - """ - - aggregation_configurations: list[AggregationConfiguration] | None = None - """A list of aggregation configurations that are configured for the trail.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_EVENT_CONFIGURATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.trail_arn is not None: - serializer.write_string( - _SCHEMA_PUT_EVENT_CONFIGURATION_OUTPUT.members["TrailARN"], - self.trail_arn, - ) - - if self.event_data_store_arn is not None: - serializer.write_string( - _SCHEMA_PUT_EVENT_CONFIGURATION_OUTPUT.members["EventDataStoreArn"], - self.event_data_store_arn, - ) - - if self.max_event_size is not None: - serializer.write_string( - _SCHEMA_PUT_EVENT_CONFIGURATION_OUTPUT.members["MaxEventSize"], - self.max_event_size, - ) - - if self.context_key_selectors is not None: - _serialize_context_key_selectors( - serializer, - _SCHEMA_PUT_EVENT_CONFIGURATION_OUTPUT.members["ContextKeySelectors"], - self.context_key_selectors, - ) - - if self.aggregation_configurations is not None: - _serialize_aggregation_configurations( - serializer, - _SCHEMA_PUT_EVENT_CONFIGURATION_OUTPUT.members[ - "AggregationConfigurations" - ], - self.aggregation_configurations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["trail_arn"] = de.read_string( - _SCHEMA_PUT_EVENT_CONFIGURATION_OUTPUT.members["TrailARN"] - ) - - case 1: - kwargs["event_data_store_arn"] = de.read_string( - _SCHEMA_PUT_EVENT_CONFIGURATION_OUTPUT.members[ - "EventDataStoreArn" - ] - ) - - case 2: - kwargs["max_event_size"] = MaxEventSize( - de.read_string( - _SCHEMA_PUT_EVENT_CONFIGURATION_OUTPUT.members[ - "MaxEventSize" - ] - ) - ) - - case 3: - kwargs["context_key_selectors"] = ( - _deserialize_context_key_selectors( - de, - _SCHEMA_PUT_EVENT_CONFIGURATION_OUTPUT.members[ - "ContextKeySelectors" - ], - ) - ) - - case 4: - kwargs["aggregation_configurations"] = ( - _deserialize_aggregation_configurations( - de, - _SCHEMA_PUT_EVENT_CONFIGURATION_OUTPUT.members[ - "AggregationConfigurations" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PUT_EVENT_CONFIGURATION_OUTPUT, consumer=_consumer - ) - return kwargs - - -PUT_EVENT_CONFIGURATION = APIOperation( - input=PutEventConfigurationInput, - output=PutEventConfigurationOutput, - schema=_SCHEMA_PUT_EVENT_CONFIGURATION, - input_schema=_SCHEMA_PUT_EVENT_CONFIGURATION_INPUT, - output_schema=_SCHEMA_PUT_EVENT_CONFIGURATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#CloudTrailARNInvalidException" - ): CloudTrailARNInvalidException, - ShapeID("com.amazonaws.cloudtrail#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreARNInvalidException" - ): EventDataStoreARNInvalidException, - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreNotFoundException" - ): EventDataStoreNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#InactiveEventDataStoreException" - ): InactiveEventDataStoreException, - ShapeID( - "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException" - ): InsufficientDependencyServiceAccessPermissionException, - ShapeID( - "com.amazonaws.cloudtrail#InsufficientIAMAccessPermissionException" - ): InsufficientIAMAccessPermissionException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidEventDataStoreCategoryException" - ): InvalidEventDataStoreCategoryException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidEventDataStoreStatusException" - ): InvalidEventDataStoreStatusException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidHomeRegionException" - ): InvalidHomeRegionException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidParameterCombinationException" - ): InvalidParameterCombinationException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidTrailNameException" - ): InvalidTrailNameException, - ShapeID( - "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException" - ): NoManagementAccountSLRExistsException, - ShapeID( - "com.amazonaws.cloudtrail#NotOrganizationMasterAccountException" - ): NotOrganizationMasterAccountException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.cloudtrail#TrailNotFoundException" - ): TrailNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CLOUD_TRAIL_ARN_INVALID_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_EVENT_DATA_STORE_ARN_INVALID_EXCEPTION, - _SCHEMA_EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, - _SCHEMA_INACTIVE_EVENT_DATA_STORE_EXCEPTION, - _SCHEMA_INSUFFICIENT_DEPENDENCY_SERVICE_ACCESS_PERMISSION_EXCEPTION, - _SCHEMA_INSUFFICIENT_IAM_ACCESS_PERMISSION_EXCEPTION, - _SCHEMA_INVALID_EVENT_DATA_STORE_CATEGORY_EXCEPTION, - _SCHEMA_INVALID_EVENT_DATA_STORE_STATUS_EXCEPTION, - _SCHEMA_INVALID_HOME_REGION_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_COMBINATION_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_INVALID_TRAIL_NAME_EXCEPTION, - _SCHEMA_NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, - _SCHEMA_NOT_ORGANIZATION_MASTER_ACCOUNT_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_TRAIL_NOT_FOUND_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class PutEventSelectorsInput: - """Dataclass for PutEventSelectorsInput structure.""" - - trail_name: str | None = None - """ - Specifies the name of the trail or trail ARN. If you specify a trail - name, the string must meet the following requirements: - - - Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), - underscores (_), or dashes (-) - - - Start with a letter or number, and end with a letter or number - - - Be between 3 and 128 characters - - - Have no adjacent periods, underscores or dashes. Names like - `my-_namespace` and `my--namespace` are not valid. - - - Not be in IP address format (for example, 192.168.5.4) - - If you specify a trail ARN, it must be in the following format. - - `arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail` - """ - - event_selectors: list[EventSelector] | None = None - """ - Specifies the settings for your event selectors. You can use event - selectors to log management events and data events for the following - resource types: - - - `AWS::DynamoDB::Table` - - - `AWS::Lambda::Function` - - - `AWS::S3::Object` - - You can't use event selectors to log network activity events. - - You can configure up to five event selectors for a trail. You can use - either `EventSelectors` or `AdvancedEventSelectors` in a - `PutEventSelectors` request, but not both. If you apply `EventSelectors` - to a trail, any existing `AdvancedEventSelectors` are overwritten. - """ - - advanced_event_selectors: list[AdvancedEventSelector] | None = None - """ - Specifies the settings for advanced event selectors. You can use - advanced event selectors to log management events, data events for all - resource types, and network activity events. - - You can add advanced event selectors, and conditions for your advanced - event selectors, up to a maximum of 500 values for all conditions and - selectors on a trail. You can use either `AdvancedEventSelectors` or - `EventSelectors`, but not both. If you apply `AdvancedEventSelectors` to - a trail, any existing `EventSelectors` are overwritten. For more - information about advanced event selectors, see [Logging data - events](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html) - and [Logging network activity - events](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-network-events-with-cloudtrail.html) - in the *CloudTrail User Guide*. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_EVENT_SELECTORS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.trail_name is not None: - serializer.write_string( - _SCHEMA_PUT_EVENT_SELECTORS_INPUT.members["TrailName"], self.trail_name - ) - - if self.event_selectors is not None: - _serialize_event_selectors( - serializer, - _SCHEMA_PUT_EVENT_SELECTORS_INPUT.members["EventSelectors"], - self.event_selectors, - ) - - if self.advanced_event_selectors is not None: - _serialize_advanced_event_selectors( - serializer, - _SCHEMA_PUT_EVENT_SELECTORS_INPUT.members["AdvancedEventSelectors"], - self.advanced_event_selectors, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["trail_name"] = de.read_string( - _SCHEMA_PUT_EVENT_SELECTORS_INPUT.members["TrailName"] - ) - - case 1: - kwargs["event_selectors"] = _deserialize_event_selectors( - de, _SCHEMA_PUT_EVENT_SELECTORS_INPUT.members["EventSelectors"] - ) - - case 2: - kwargs["advanced_event_selectors"] = ( - _deserialize_advanced_event_selectors( - de, - _SCHEMA_PUT_EVENT_SELECTORS_INPUT.members[ - "AdvancedEventSelectors" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUT_EVENT_SELECTORS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class PutEventSelectorsOutput: - """Dataclass for PutEventSelectorsOutput structure.""" - - trail_arn: str | None = None - """ - Specifies the ARN of the trail that was updated with event selectors. - The following is the format of a trail ARN. - - `arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail` - """ - - event_selectors: list[EventSelector] | None = None - """Specifies the event selectors configured for your trail.""" - - advanced_event_selectors: list[AdvancedEventSelector] | None = None - """Specifies the advanced event selectors configured for your trail.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_EVENT_SELECTORS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.trail_arn is not None: - serializer.write_string( - _SCHEMA_PUT_EVENT_SELECTORS_OUTPUT.members["TrailARN"], self.trail_arn - ) - - if self.event_selectors is not None: - _serialize_event_selectors( - serializer, - _SCHEMA_PUT_EVENT_SELECTORS_OUTPUT.members["EventSelectors"], - self.event_selectors, - ) - - if self.advanced_event_selectors is not None: - _serialize_advanced_event_selectors( - serializer, - _SCHEMA_PUT_EVENT_SELECTORS_OUTPUT.members["AdvancedEventSelectors"], - self.advanced_event_selectors, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["trail_arn"] = de.read_string( - _SCHEMA_PUT_EVENT_SELECTORS_OUTPUT.members["TrailARN"] - ) - - case 1: - kwargs["event_selectors"] = _deserialize_event_selectors( - de, _SCHEMA_PUT_EVENT_SELECTORS_OUTPUT.members["EventSelectors"] - ) - - case 2: - kwargs["advanced_event_selectors"] = ( - _deserialize_advanced_event_selectors( - de, - _SCHEMA_PUT_EVENT_SELECTORS_OUTPUT.members[ - "AdvancedEventSelectors" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUT_EVENT_SELECTORS_OUTPUT, consumer=_consumer) - return kwargs - - -PUT_EVENT_SELECTORS = APIOperation( - input=PutEventSelectorsInput, - output=PutEventSelectorsOutput, - schema=_SCHEMA_PUT_EVENT_SELECTORS, - input_schema=_SCHEMA_PUT_EVENT_SELECTORS_INPUT, - output_schema=_SCHEMA_PUT_EVENT_SELECTORS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#CloudTrailARNInvalidException" - ): CloudTrailARNInvalidException, - ShapeID("com.amazonaws.cloudtrail#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException" - ): InsufficientDependencyServiceAccessPermissionException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidEventSelectorsException" - ): InvalidEventSelectorsException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidHomeRegionException" - ): InvalidHomeRegionException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidTrailNameException" - ): InvalidTrailNameException, - ShapeID( - "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException" - ): NoManagementAccountSLRExistsException, - ShapeID( - "com.amazonaws.cloudtrail#NotOrganizationMasterAccountException" - ): NotOrganizationMasterAccountException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.cloudtrail#TrailNotFoundException" - ): TrailNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CLOUD_TRAIL_ARN_INVALID_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INSUFFICIENT_DEPENDENCY_SERVICE_ACCESS_PERMISSION_EXCEPTION, - _SCHEMA_INVALID_EVENT_SELECTORS_EXCEPTION, - _SCHEMA_INVALID_HOME_REGION_EXCEPTION, - _SCHEMA_INVALID_TRAIL_NAME_EXCEPTION, - _SCHEMA_NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, - _SCHEMA_NOT_ORGANIZATION_MASTER_ACCOUNT_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_TRAIL_NOT_FOUND_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class InvalidInsightSelectorsException(ServiceError): - """ - For `PutInsightSelectors`, this exception is thrown when the formatting - or syntax of the `InsightSelectors` JSON statement is not valid, or the - specified `InsightType` in the `InsightSelectors` statement is not - valid. Valid values for `InsightType` are `ApiCallRateInsight` and - `ApiErrorRateInsight`. To enable Insights on an event data store, the - destination event data store specified by the `InsightsDestination` - parameter must log Insights events and the source event data store - specified by the `EventDataStore` parameter must log management events. - - For `UpdateEventDataStore`, this exception is thrown if Insights are - enabled on the event data store and the updated advanced event selectors - are not compatible with the configured `InsightSelectors`. If the - `InsightSelectors` includes an `InsightType` of `ApiCallRateInsight`, - the source event data store must log `write` management events. If the - `InsightSelectors` includes an `InsightType` of `ApiErrorRateInsight`, - the source event data store must log management events. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_INSIGHT_SELECTORS_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_INSIGHT_SELECTORS_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_INSIGHT_SELECTORS_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVALID_INSIGHT_SELECTORS_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class PutInsightSelectorsInput: - """Dataclass for PutInsightSelectorsInput structure.""" - - trail_name: str | None = None - """ - The name of the CloudTrail trail for which you want to change or add - Insights selectors. - - You cannot use this parameter with the `EventDataStore` and - `InsightsDestination` parameters. - """ - - insight_selectors: list[InsightSelector] | None = None - """ - Contains the Insights types you want to log on a specific category of - events on a trail or event data store. `ApiCallRateInsight` and - `ApiErrorRateInsight` are valid Insight types.The EventCategory field - can specify `Management` or `Data` events or both. For event data store, - you can log Insights for management events only. - - The `ApiCallRateInsight` Insights type analyzes write-only management - API calls or read and write data API calls that are aggregated per - minute against a baseline API call volume. - - The `ApiErrorRateInsight` Insights type analyzes management and data API - calls that result in error codes. The error is shown if the API call is - unsuccessful. - """ - - event_data_store: str | None = None - """ - The ARN (or ID suffix of the ARN) of the source event data store for - which you want to change or add Insights selectors. To enable Insights - on an event data store, you must provide both the `EventDataStore` and - `InsightsDestination` parameters. - - You cannot use this parameter with the `TrailName` parameter. - """ - - insights_destination: str | None = None - """ - The ARN (or ID suffix of the ARN) of the destination event data store - that logs Insights events. To enable Insights on an event data store, - you must provide both the `EventDataStore` and `InsightsDestination` - parameters. - - You cannot use this parameter with the `TrailName` parameter. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_INSIGHT_SELECTORS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.trail_name is not None: - serializer.write_string( - _SCHEMA_PUT_INSIGHT_SELECTORS_INPUT.members["TrailName"], - self.trail_name, - ) - - if self.insight_selectors is not None: - _serialize_insight_selectors( - serializer, - _SCHEMA_PUT_INSIGHT_SELECTORS_INPUT.members["InsightSelectors"], - self.insight_selectors, - ) - - if self.event_data_store is not None: - serializer.write_string( - _SCHEMA_PUT_INSIGHT_SELECTORS_INPUT.members["EventDataStore"], - self.event_data_store, - ) - - if self.insights_destination is not None: - serializer.write_string( - _SCHEMA_PUT_INSIGHT_SELECTORS_INPUT.members["InsightsDestination"], - self.insights_destination, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["trail_name"] = de.read_string( - _SCHEMA_PUT_INSIGHT_SELECTORS_INPUT.members["TrailName"] - ) - - case 1: - kwargs["insight_selectors"] = _deserialize_insight_selectors( - de, - _SCHEMA_PUT_INSIGHT_SELECTORS_INPUT.members["InsightSelectors"], - ) - - case 2: - kwargs["event_data_store"] = de.read_string( - _SCHEMA_PUT_INSIGHT_SELECTORS_INPUT.members["EventDataStore"] - ) - - case 3: - kwargs["insights_destination"] = de.read_string( - _SCHEMA_PUT_INSIGHT_SELECTORS_INPUT.members[ - "InsightsDestination" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PUT_INSIGHT_SELECTORS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class PutInsightSelectorsOutput: - """Dataclass for PutInsightSelectorsOutput structure.""" - - trail_arn: str | None = None - """ - The Amazon Resource Name (ARN) of a trail for which you want to change - or add Insights selectors. - """ - - insight_selectors: list[InsightSelector] | None = None - """ - Contains the Insights types you want to log on a specific category of - events in a trail or event data store. `ApiCallRateInsight` and - `ApiErrorRateInsight` are valid Insight types.The EventCategory field - can specify `Management` or `Data` events or both. For event data store, - you can only log Insights for management events only. - """ - - event_data_store_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the source event data store for which - you want to change or add Insights selectors. - """ - - insights_destination: str | None = None - """The ARN of the destination event data store that logs Insights events.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_INSIGHT_SELECTORS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.trail_arn is not None: - serializer.write_string( - _SCHEMA_PUT_INSIGHT_SELECTORS_OUTPUT.members["TrailARN"], self.trail_arn - ) - - if self.insight_selectors is not None: - _serialize_insight_selectors( - serializer, - _SCHEMA_PUT_INSIGHT_SELECTORS_OUTPUT.members["InsightSelectors"], - self.insight_selectors, - ) - - if self.event_data_store_arn is not None: - serializer.write_string( - _SCHEMA_PUT_INSIGHT_SELECTORS_OUTPUT.members["EventDataStoreArn"], - self.event_data_store_arn, - ) - - if self.insights_destination is not None: - serializer.write_string( - _SCHEMA_PUT_INSIGHT_SELECTORS_OUTPUT.members["InsightsDestination"], - self.insights_destination, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["trail_arn"] = de.read_string( - _SCHEMA_PUT_INSIGHT_SELECTORS_OUTPUT.members["TrailARN"] - ) - - case 1: - kwargs["insight_selectors"] = _deserialize_insight_selectors( - de, - _SCHEMA_PUT_INSIGHT_SELECTORS_OUTPUT.members[ - "InsightSelectors" - ], - ) - - case 2: - kwargs["event_data_store_arn"] = de.read_string( - _SCHEMA_PUT_INSIGHT_SELECTORS_OUTPUT.members[ - "EventDataStoreArn" - ] - ) - - case 3: - kwargs["insights_destination"] = de.read_string( - _SCHEMA_PUT_INSIGHT_SELECTORS_OUTPUT.members[ - "InsightsDestination" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PUT_INSIGHT_SELECTORS_OUTPUT, consumer=_consumer - ) - return kwargs - - -PUT_INSIGHT_SELECTORS = APIOperation( - input=PutInsightSelectorsInput, - output=PutInsightSelectorsOutput, - schema=_SCHEMA_PUT_INSIGHT_SELECTORS, - input_schema=_SCHEMA_PUT_INSIGHT_SELECTORS_INPUT, - output_schema=_SCHEMA_PUT_INSIGHT_SELECTORS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#CloudTrailARNInvalidException" - ): CloudTrailARNInvalidException, - ShapeID("com.amazonaws.cloudtrail#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.cloudtrail#InsufficientEncryptionPolicyException" - ): InsufficientEncryptionPolicyException, - ShapeID( - "com.amazonaws.cloudtrail#InsufficientS3BucketPolicyException" - ): InsufficientS3BucketPolicyException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidHomeRegionException" - ): InvalidHomeRegionException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidInsightSelectorsException" - ): InvalidInsightSelectorsException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidParameterCombinationException" - ): InvalidParameterCombinationException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidTrailNameException" - ): InvalidTrailNameException, - ShapeID("com.amazonaws.cloudtrail#KmsException"): KmsException, - ShapeID( - "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException" - ): NoManagementAccountSLRExistsException, - ShapeID( - "com.amazonaws.cloudtrail#NotOrganizationMasterAccountException" - ): NotOrganizationMasterAccountException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#S3BucketDoesNotExistException" - ): S3BucketDoesNotExistException, - ShapeID( - "com.amazonaws.cloudtrail#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.cloudtrail#TrailNotFoundException" - ): TrailNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CLOUD_TRAIL_ARN_INVALID_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INSUFFICIENT_ENCRYPTION_POLICY_EXCEPTION, - _SCHEMA_INSUFFICIENT_S3_BUCKET_POLICY_EXCEPTION, - _SCHEMA_INVALID_HOME_REGION_EXCEPTION, - _SCHEMA_INVALID_INSIGHT_SELECTORS_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_COMBINATION_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_INVALID_TRAIL_NAME_EXCEPTION, - _SCHEMA_KMS_EXCEPTION, - _SCHEMA_NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, - _SCHEMA_NOT_ORGANIZATION_MASTER_ACCOUNT_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_S3_BUCKET_DOES_NOT_EXIST_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_TRAIL_NOT_FOUND_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class PutResourcePolicyInput: - """Dataclass for PutResourcePolicyInput structure.""" - - resource_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the CloudTrail event data store, - dashboard, or channel attached to the resource-based policy. - - Example event data store ARN format: - `arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE` - - Example dashboard ARN format: - `arn:aws:cloudtrail:us-east-1:123456789012:dashboard/exampleDash` - - Example channel ARN format: - `arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890` - """ - - resource_policy: str | None = None - """ - A JSON-formatted string for an Amazon Web Services resource-based - policy. - - For example resource-based policies, see [CloudTrail resource-based - policy - examples](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/security_iam_resource-based-policy-examples.html) - in the *CloudTrail User Guide*. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_RESOURCE_POLICY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_PUT_RESOURCE_POLICY_INPUT.members["ResourceArn"], - self.resource_arn, - ) - - if self.resource_policy is not None: - serializer.write_string( - _SCHEMA_PUT_RESOURCE_POLICY_INPUT.members["ResourcePolicy"], - self.resource_policy, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_PUT_RESOURCE_POLICY_INPUT.members["ResourceArn"] - ) - - case 1: - kwargs["resource_policy"] = de.read_string( - _SCHEMA_PUT_RESOURCE_POLICY_INPUT.members["ResourcePolicy"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUT_RESOURCE_POLICY_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class PutResourcePolicyOutput: - """Dataclass for PutResourcePolicyOutput structure.""" - - resource_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the CloudTrail event data store, - dashboard, or channel attached to the resource-based policy. - - Example event data store ARN format: - `arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE` - - Example dashboard ARN format: - `arn:aws:cloudtrail:us-east-1:123456789012:dashboard/exampleDash` - - Example channel ARN format: - `arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890` - """ - - resource_policy: str | None = None - """ - The JSON-formatted string of the Amazon Web Services resource-based - policy attached to the CloudTrail event data store, dashboard, or - channel. - """ - - delegated_admin_resource_policy: str | None = None - """ - The default resource-based policy that is automatically generated for - the delegated administrator of an Organizations organization. This - policy will be evaluated in tandem with any policy you submit for the - resource. For more information about this policy, see [Default resource - policy for delegated - administrators](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake-organizations.html#cloudtrail-lake-organizations-eds-rbp). - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_RESOURCE_POLICY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_PUT_RESOURCE_POLICY_OUTPUT.members["ResourceArn"], - self.resource_arn, - ) - - if self.resource_policy is not None: - serializer.write_string( - _SCHEMA_PUT_RESOURCE_POLICY_OUTPUT.members["ResourcePolicy"], - self.resource_policy, - ) - - if self.delegated_admin_resource_policy is not None: - serializer.write_string( - _SCHEMA_PUT_RESOURCE_POLICY_OUTPUT.members[ - "DelegatedAdminResourcePolicy" - ], - self.delegated_admin_resource_policy, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_PUT_RESOURCE_POLICY_OUTPUT.members["ResourceArn"] - ) - - case 1: - kwargs["resource_policy"] = de.read_string( - _SCHEMA_PUT_RESOURCE_POLICY_OUTPUT.members["ResourcePolicy"] - ) - - case 2: - kwargs["delegated_admin_resource_policy"] = de.read_string( - _SCHEMA_PUT_RESOURCE_POLICY_OUTPUT.members[ - "DelegatedAdminResourcePolicy" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUT_RESOURCE_POLICY_OUTPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ResourcePolicyNotValidException(ServiceError): - """ - This exception is thrown when the resouce-based policy has syntax - errors, or contains a principal that is not valid. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESOURCE_POLICY_NOT_VALID_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_RESOURCE_POLICY_NOT_VALID_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_RESOURCE_POLICY_NOT_VALID_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RESOURCE_POLICY_NOT_VALID_EXCEPTION, consumer=_consumer - ) - return kwargs - - -PUT_RESOURCE_POLICY = APIOperation( - input=PutResourcePolicyInput, - output=PutResourcePolicyOutput, - schema=_SCHEMA_PUT_RESOURCE_POLICY, - input_schema=_SCHEMA_PUT_RESOURCE_POLICY_INPUT, - output_schema=_SCHEMA_PUT_RESOURCE_POLICY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.cloudtrail#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#ResourceARNNotValidException" - ): ResourceARNNotValidException, - ShapeID( - "com.amazonaws.cloudtrail#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#ResourcePolicyNotValidException" - ): ResourcePolicyNotValidException, - ShapeID( - "com.amazonaws.cloudtrail#ResourceTypeNotSupportedException" - ): ResourceTypeNotSupportedException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_RESOURCE_ARN_NOT_VALID_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_RESOURCE_POLICY_NOT_VALID_EXCEPTION, - _SCHEMA_RESOURCE_TYPE_NOT_SUPPORTED_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DelegatedAdminAccountLimitExceededException(ServiceError): - """ - This exception is thrown when the maximum number of CloudTrail delegated - administrators is reached. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DELEGATED_ADMIN_ACCOUNT_LIMIT_EXCEEDED_EXCEPTION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_DELEGATED_ADMIN_ACCOUNT_LIMIT_EXCEEDED_EXCEPTION.members[ - "Message" - ], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_DELEGATED_ADMIN_ACCOUNT_LIMIT_EXCEEDED_EXCEPTION.members[ - "Message" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELEGATED_ADMIN_ACCOUNT_LIMIT_EXCEEDED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class RegisterOrganizationDelegatedAdminInput: - """ - Specifies an organization member account ID as a CloudTrail delegated - administrator. - """ - - member_account_id: str | None = None - """ - An organization member account ID that you want to designate as a - delegated administrator. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_REGISTER_ORGANIZATION_DELEGATED_ADMIN_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.member_account_id is not None: - serializer.write_string( - _SCHEMA_REGISTER_ORGANIZATION_DELEGATED_ADMIN_INPUT.members[ - "MemberAccountId" - ], - self.member_account_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["member_account_id"] = de.read_string( - _SCHEMA_REGISTER_ORGANIZATION_DELEGATED_ADMIN_INPUT.members[ - "MemberAccountId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_REGISTER_ORGANIZATION_DELEGATED_ADMIN_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class RegisterOrganizationDelegatedAdminOutput: - """ - Returns the following response if successful. Otherwise, returns an - error. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_REGISTER_ORGANIZATION_DELEGATED_ADMIN_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_REGISTER_ORGANIZATION_DELEGATED_ADMIN_OUTPUT, consumer=_consumer - ) - return kwargs - - -REGISTER_ORGANIZATION_DELEGATED_ADMIN = APIOperation( - input=RegisterOrganizationDelegatedAdminInput, - output=RegisterOrganizationDelegatedAdminOutput, - schema=_SCHEMA_REGISTER_ORGANIZATION_DELEGATED_ADMIN, - input_schema=_SCHEMA_REGISTER_ORGANIZATION_DELEGATED_ADMIN_INPUT, - output_schema=_SCHEMA_REGISTER_ORGANIZATION_DELEGATED_ADMIN_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#AccountNotFoundException" - ): AccountNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#AccountRegisteredException" - ): AccountRegisteredException, - ShapeID( - "com.amazonaws.cloudtrail#CannotDelegateManagementAccountException" - ): CannotDelegateManagementAccountException, - ShapeID( - "com.amazonaws.cloudtrail#CloudTrailAccessNotEnabledException" - ): CloudTrailAccessNotEnabledException, - ShapeID("com.amazonaws.cloudtrail#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.cloudtrail#DelegatedAdminAccountLimitExceededException" - ): DelegatedAdminAccountLimitExceededException, - ShapeID( - "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException" - ): InsufficientDependencyServiceAccessPermissionException, - ShapeID( - "com.amazonaws.cloudtrail#InsufficientIAMAccessPermissionException" - ): InsufficientIAMAccessPermissionException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cloudtrail#NotOrganizationManagementAccountException" - ): NotOrganizationManagementAccountException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#OrganizationNotInAllFeaturesModeException" - ): OrganizationNotInAllFeaturesModeException, - ShapeID( - "com.amazonaws.cloudtrail#OrganizationsNotInUseException" - ): OrganizationsNotInUseException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCOUNT_NOT_FOUND_EXCEPTION, - _SCHEMA_ACCOUNT_REGISTERED_EXCEPTION, - _SCHEMA_CANNOT_DELEGATE_MANAGEMENT_ACCOUNT_EXCEPTION, - _SCHEMA_CLOUD_TRAIL_ACCESS_NOT_ENABLED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_DELEGATED_ADMIN_ACCOUNT_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_INSUFFICIENT_DEPENDENCY_SERVICE_ACCESS_PERMISSION_EXCEPTION, - _SCHEMA_INSUFFICIENT_IAM_ACCESS_PERMISSION_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_NOT_ORGANIZATION_MANAGEMENT_ACCOUNT_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_ORGANIZATION_NOT_IN_ALL_FEATURES_MODE_EXCEPTION, - _SCHEMA_ORGANIZATIONS_NOT_IN_USE_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class RemoveTagsInput: - """ - Specifies the tags to remove from a trail, event data store, dashboard, - or channel. - """ - - resource_id: str | None = None - """ - Specifies the ARN of the trail, event data store, dashboard, or channel - from which tags should be removed. - - Example trail ARN format: - `arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail` - - Example event data store ARN format: - `arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE` - - Example dashboard ARN format: - `arn:aws:cloudtrail:us-east-1:123456789012:dashboard/exampleDash` - - Example channel ARN format: - `arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890` - """ - - tags_list: list[Tag] | None = None - """Specifies a list of tags to be removed.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REMOVE_TAGS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_id is not None: - serializer.write_string( - _SCHEMA_REMOVE_TAGS_INPUT.members["ResourceId"], self.resource_id - ) - - if self.tags_list is not None: - _serialize_tags_list( - serializer, - _SCHEMA_REMOVE_TAGS_INPUT.members["TagsList"], - self.tags_list, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_id"] = de.read_string( - _SCHEMA_REMOVE_TAGS_INPUT.members["ResourceId"] - ) - - case 1: - kwargs["tags_list"] = _deserialize_tags_list( - de, _SCHEMA_REMOVE_TAGS_INPUT.members["TagsList"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_REMOVE_TAGS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class RemoveTagsOutput: - """ - Returns the objects or data listed below if successful. Otherwise, - returns an error. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REMOVE_TAGS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_REMOVE_TAGS_OUTPUT, consumer=_consumer) - return kwargs - - -REMOVE_TAGS = APIOperation( - input=RemoveTagsInput, - output=RemoveTagsOutput, - schema=_SCHEMA_REMOVE_TAGS, - input_schema=_SCHEMA_REMOVE_TAGS_INPUT, - output_schema=_SCHEMA_REMOVE_TAGS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#ChannelARNInvalidException" - ): ChannelARNInvalidException, - ShapeID( - "com.amazonaws.cloudtrail#ChannelNotFoundException" - ): ChannelNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#CloudTrailARNInvalidException" - ): CloudTrailARNInvalidException, - ShapeID("com.amazonaws.cloudtrail#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreARNInvalidException" - ): EventDataStoreARNInvalidException, - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreNotFoundException" - ): EventDataStoreNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#InactiveEventDataStoreException" - ): InactiveEventDataStoreException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidTagParameterException" - ): InvalidTagParameterException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidTrailNameException" - ): InvalidTrailNameException, - ShapeID( - "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException" - ): NoManagementAccountSLRExistsException, - ShapeID( - "com.amazonaws.cloudtrail#NotOrganizationMasterAccountException" - ): NotOrganizationMasterAccountException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#ResourceTypeNotSupportedException" - ): ResourceTypeNotSupportedException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CHANNEL_ARN_INVALID_EXCEPTION, - _SCHEMA_CHANNEL_NOT_FOUND_EXCEPTION, - _SCHEMA_CLOUD_TRAIL_ARN_INVALID_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_EVENT_DATA_STORE_ARN_INVALID_EXCEPTION, - _SCHEMA_EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, - _SCHEMA_INACTIVE_EVENT_DATA_STORE_EXCEPTION, - _SCHEMA_INVALID_TAG_PARAMETER_EXCEPTION, - _SCHEMA_INVALID_TRAIL_NAME_EXCEPTION, - _SCHEMA_NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, - _SCHEMA_NOT_ORGANIZATION_MASTER_ACCOUNT_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_RESOURCE_TYPE_NOT_SUPPORTED_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class RestoreEventDataStoreInput: - """Dataclass for RestoreEventDataStoreInput structure.""" - - event_data_store: str | None = None - """ - The ARN (or the ID suffix of the ARN) of the event data store that you - want to restore. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESTORE_EVENT_DATA_STORE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.event_data_store is not None: - serializer.write_string( - _SCHEMA_RESTORE_EVENT_DATA_STORE_INPUT.members["EventDataStore"], - self.event_data_store, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["event_data_store"] = de.read_string( - _SCHEMA_RESTORE_EVENT_DATA_STORE_INPUT.members["EventDataStore"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RESTORE_EVENT_DATA_STORE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class RestoreEventDataStoreOutput: - """Dataclass for RestoreEventDataStoreOutput structure.""" - - event_data_store_arn: str | None = None - """The event data store ARN.""" - - name: str | None = None - """The name of the event data store.""" - - status: str | None = None - """The status of the event data store.""" - - advanced_event_selectors: list[AdvancedEventSelector] | None = None - """The advanced event selectors that were used to select events.""" - - multi_region_enabled: bool | None = None - """ - Indicates whether the event data store is collecting events from all - Regions, or only from the Region in which the event data store was - created. - """ - - organization_enabled: bool | None = None - """ - Indicates whether an event data store is collecting logged events for an - organization in Organizations. - """ - - retention_period: int | None = None - """The retention period, in days.""" - - termination_protection_enabled: bool | None = None - """ - Indicates that termination protection is enabled and the event data - store cannot be automatically deleted. - """ - - created_timestamp: datetime | None = None - """The timestamp of an event data store's creation.""" - - updated_timestamp: datetime | None = None - """ - The timestamp that shows when an event data store was updated, if - applicable. `UpdatedTimestamp` is always either the same or newer than - the time shown in `CreatedTimestamp`. - """ - - kms_key_id: str | None = None - """ - Specifies the KMS key ID that encrypts the events delivered by - CloudTrail. The value is a fully specified ARN to a KMS key in the - following format. - - `arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012` - """ - - billing_mode: str | None = None - """The billing mode for the event data store.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESTORE_EVENT_DATA_STORE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.event_data_store_arn is not None: - serializer.write_string( - _SCHEMA_RESTORE_EVENT_DATA_STORE_OUTPUT.members["EventDataStoreArn"], - self.event_data_store_arn, - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_RESTORE_EVENT_DATA_STORE_OUTPUT.members["Name"], self.name - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_RESTORE_EVENT_DATA_STORE_OUTPUT.members["Status"], self.status - ) - - if self.advanced_event_selectors is not None: - _serialize_advanced_event_selectors( - serializer, - _SCHEMA_RESTORE_EVENT_DATA_STORE_OUTPUT.members[ - "AdvancedEventSelectors" - ], - self.advanced_event_selectors, - ) - - if self.multi_region_enabled is not None: - serializer.write_boolean( - _SCHEMA_RESTORE_EVENT_DATA_STORE_OUTPUT.members["MultiRegionEnabled"], - self.multi_region_enabled, - ) - - if self.organization_enabled is not None: - serializer.write_boolean( - _SCHEMA_RESTORE_EVENT_DATA_STORE_OUTPUT.members["OrganizationEnabled"], - self.organization_enabled, - ) - - if self.retention_period is not None: - serializer.write_integer( - _SCHEMA_RESTORE_EVENT_DATA_STORE_OUTPUT.members["RetentionPeriod"], - self.retention_period, - ) - - if self.termination_protection_enabled is not None: - serializer.write_boolean( - _SCHEMA_RESTORE_EVENT_DATA_STORE_OUTPUT.members[ - "TerminationProtectionEnabled" - ], - self.termination_protection_enabled, - ) - - if self.created_timestamp is not None: - serializer.write_timestamp( - _SCHEMA_RESTORE_EVENT_DATA_STORE_OUTPUT.members["CreatedTimestamp"], - self.created_timestamp, - ) - - if self.updated_timestamp is not None: - serializer.write_timestamp( - _SCHEMA_RESTORE_EVENT_DATA_STORE_OUTPUT.members["UpdatedTimestamp"], - self.updated_timestamp, - ) - - if self.kms_key_id is not None: - serializer.write_string( - _SCHEMA_RESTORE_EVENT_DATA_STORE_OUTPUT.members["KmsKeyId"], - self.kms_key_id, - ) - - if self.billing_mode is not None: - serializer.write_string( - _SCHEMA_RESTORE_EVENT_DATA_STORE_OUTPUT.members["BillingMode"], - self.billing_mode, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["event_data_store_arn"] = de.read_string( - _SCHEMA_RESTORE_EVENT_DATA_STORE_OUTPUT.members[ - "EventDataStoreArn" - ] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_RESTORE_EVENT_DATA_STORE_OUTPUT.members["Name"] - ) - - case 2: - kwargs["status"] = EventDataStoreStatus( - de.read_string( - _SCHEMA_RESTORE_EVENT_DATA_STORE_OUTPUT.members["Status"] - ) - ) - - case 3: - kwargs["advanced_event_selectors"] = ( - _deserialize_advanced_event_selectors( - de, - _SCHEMA_RESTORE_EVENT_DATA_STORE_OUTPUT.members[ - "AdvancedEventSelectors" - ], - ) - ) - - case 4: - kwargs["multi_region_enabled"] = de.read_boolean( - _SCHEMA_RESTORE_EVENT_DATA_STORE_OUTPUT.members[ - "MultiRegionEnabled" - ] - ) - - case 5: - kwargs["organization_enabled"] = de.read_boolean( - _SCHEMA_RESTORE_EVENT_DATA_STORE_OUTPUT.members[ - "OrganizationEnabled" - ] - ) - - case 6: - kwargs["retention_period"] = de.read_integer( - _SCHEMA_RESTORE_EVENT_DATA_STORE_OUTPUT.members[ - "RetentionPeriod" - ] - ) - - case 7: - kwargs["termination_protection_enabled"] = de.read_boolean( - _SCHEMA_RESTORE_EVENT_DATA_STORE_OUTPUT.members[ - "TerminationProtectionEnabled" - ] - ) - - case 8: - kwargs["created_timestamp"] = de.read_timestamp( - _SCHEMA_RESTORE_EVENT_DATA_STORE_OUTPUT.members[ - "CreatedTimestamp" - ] - ) - - case 9: - kwargs["updated_timestamp"] = de.read_timestamp( - _SCHEMA_RESTORE_EVENT_DATA_STORE_OUTPUT.members[ - "UpdatedTimestamp" - ] - ) - - case 10: - kwargs["kms_key_id"] = de.read_string( - _SCHEMA_RESTORE_EVENT_DATA_STORE_OUTPUT.members["KmsKeyId"] - ) - - case 11: - kwargs["billing_mode"] = BillingMode( - de.read_string( - _SCHEMA_RESTORE_EVENT_DATA_STORE_OUTPUT.members[ - "BillingMode" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RESTORE_EVENT_DATA_STORE_OUTPUT, consumer=_consumer - ) - return kwargs - - -RESTORE_EVENT_DATA_STORE = APIOperation( - input=RestoreEventDataStoreInput, - output=RestoreEventDataStoreOutput, - schema=_SCHEMA_RESTORE_EVENT_DATA_STORE, - input_schema=_SCHEMA_RESTORE_EVENT_DATA_STORE_INPUT, - output_schema=_SCHEMA_RESTORE_EVENT_DATA_STORE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#CloudTrailAccessNotEnabledException" - ): CloudTrailAccessNotEnabledException, - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreARNInvalidException" - ): EventDataStoreARNInvalidException, - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreMaxLimitExceededException" - ): EventDataStoreMaxLimitExceededException, - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreNotFoundException" - ): EventDataStoreNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException" - ): InsufficientDependencyServiceAccessPermissionException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidEventDataStoreStatusException" - ): InvalidEventDataStoreStatusException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException" - ): NoManagementAccountSLRExistsException, - ShapeID( - "com.amazonaws.cloudtrail#NotOrganizationMasterAccountException" - ): NotOrganizationMasterAccountException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#OrganizationNotInAllFeaturesModeException" - ): OrganizationNotInAllFeaturesModeException, - ShapeID( - "com.amazonaws.cloudtrail#OrganizationsNotInUseException" - ): OrganizationsNotInUseException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CLOUD_TRAIL_ACCESS_NOT_ENABLED_EXCEPTION, - _SCHEMA_EVENT_DATA_STORE_ARN_INVALID_EXCEPTION, - _SCHEMA_EVENT_DATA_STORE_MAX_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, - _SCHEMA_INSUFFICIENT_DEPENDENCY_SERVICE_ACCESS_PERMISSION_EXCEPTION, - _SCHEMA_INVALID_EVENT_DATA_STORE_STATUS_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, - _SCHEMA_NOT_ORGANIZATION_MASTER_ACCOUNT_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_ORGANIZATION_NOT_IN_ALL_FEATURES_MODE_EXCEPTION, - _SCHEMA_ORGANIZATIONS_NOT_IN_USE_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class SearchSampleQueriesInput: - """Dataclass for SearchSampleQueriesInput structure.""" - - search_phrase: str | None = None - """ - The natural language phrase to use for the semantic search. The phrase - must be in English. The length constraint is in characters, not words. - """ - - max_results: int | None = None - """ - The maximum number of results to return on a single page. The default - value is 10. - """ - - next_token: str | None = None - """ - A token you can use to get the next page of results. The length - constraint is in characters, not words. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SEARCH_SAMPLE_QUERIES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.search_phrase is not None: - serializer.write_string( - _SCHEMA_SEARCH_SAMPLE_QUERIES_INPUT.members["SearchPhrase"], - self.search_phrase, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_SEARCH_SAMPLE_QUERIES_INPUT.members["MaxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_SEARCH_SAMPLE_QUERIES_INPUT.members["NextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["search_phrase"] = de.read_string( - _SCHEMA_SEARCH_SAMPLE_QUERIES_INPUT.members["SearchPhrase"] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_SEARCH_SAMPLE_QUERIES_INPUT.members["MaxResults"] - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_SEARCH_SAMPLE_QUERIES_INPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SEARCH_SAMPLE_QUERIES_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class SearchSampleQueriesSearchResult: - """A search result returned by the `SearchSampleQueries` operation.""" - - name: str | None = None - """The name of a sample query.""" - - description: str | None = None - """A longer description of a sample query.""" - - sql: str | None = None - """The SQL code of the sample query.""" - - relevance: float = 0 - """ - A value between 0 and 1 indicating the similarity between the search - phrase and result. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SEARCH_SAMPLE_QUERIES_SEARCH_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_SEARCH_SAMPLE_QUERIES_SEARCH_RESULT.members["Name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_SEARCH_SAMPLE_QUERIES_SEARCH_RESULT.members["Description"], - self.description, - ) - - if self.sql is not None: - serializer.write_string( - _SCHEMA_SEARCH_SAMPLE_QUERIES_SEARCH_RESULT.members["SQL"], self.sql - ) - - serializer.write_float( - _SCHEMA_SEARCH_SAMPLE_QUERIES_SEARCH_RESULT.members["Relevance"], - self.relevance, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_SEARCH_SAMPLE_QUERIES_SEARCH_RESULT.members["Name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_SEARCH_SAMPLE_QUERIES_SEARCH_RESULT.members[ - "Description" - ] - ) - - case 2: - kwargs["sql"] = de.read_string( - _SCHEMA_SEARCH_SAMPLE_QUERIES_SEARCH_RESULT.members["SQL"] - ) - - case 3: - kwargs["relevance"] = de.read_float( - _SCHEMA_SEARCH_SAMPLE_QUERIES_SEARCH_RESULT.members["Relevance"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SEARCH_SAMPLE_QUERIES_SEARCH_RESULT, consumer=_consumer - ) - return kwargs - - -def _serialize_search_sample_queries_search_results( - serializer: ShapeSerializer, - schema: Schema, - value: list[SearchSampleQueriesSearchResult], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_search_sample_queries_search_results( - deserializer: ShapeDeserializer, schema: Schema -) -> list[SearchSampleQueriesSearchResult]: - result: list[SearchSampleQueriesSearchResult] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(SearchSampleQueriesSearchResult.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class SearchSampleQueriesOutput: - """Dataclass for SearchSampleQueriesOutput structure.""" - - search_results: list[SearchSampleQueriesSearchResult] | None = None - """ - A list of objects containing the search results ordered from most - relevant to least relevant. - """ - - next_token: str | None = None - """A token you can use to get the next page of results.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SEARCH_SAMPLE_QUERIES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.search_results is not None: - _serialize_search_sample_queries_search_results( - serializer, - _SCHEMA_SEARCH_SAMPLE_QUERIES_OUTPUT.members["SearchResults"], - self.search_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_SEARCH_SAMPLE_QUERIES_OUTPUT.members["NextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["search_results"] = ( - _deserialize_search_sample_queries_search_results( - de, - _SCHEMA_SEARCH_SAMPLE_QUERIES_OUTPUT.members[ - "SearchResults" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_SEARCH_SAMPLE_QUERIES_OUTPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SEARCH_SAMPLE_QUERIES_OUTPUT, consumer=_consumer - ) - return kwargs - - -SEARCH_SAMPLE_QUERIES = APIOperation( - input=SearchSampleQueriesInput, - output=SearchSampleQueriesOutput, - schema=_SCHEMA_SEARCH_SAMPLE_QUERIES, - input_schema=_SCHEMA_SEARCH_SAMPLE_QUERIES_INPUT, - output_schema=_SCHEMA_SEARCH_SAMPLE_QUERIES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -def _serialize_query_parameter_values( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_query_parameter_values( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class StartDashboardRefreshInput: - """Dataclass for StartDashboardRefreshInput structure.""" - - dashboard_id: str | None = None - """The name or ARN of the dashboard.""" - - query_parameter_values: dict[str, str] | None = None - """ - The query parameter values for the dashboard - - For custom dashboards, the following query parameters are valid: - `$StartTime$`, `$EndTime$`, and `$Period$`. - - For managed dashboards, the following query parameters are valid: - `$StartTime$`, `$EndTime$`, `$Period$`, and `$EventDataStoreId$`. The - `$EventDataStoreId$` query parameter is required. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_DASHBOARD_REFRESH_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.dashboard_id is not None: - serializer.write_string( - _SCHEMA_START_DASHBOARD_REFRESH_INPUT.members["DashboardId"], - self.dashboard_id, - ) - - if self.query_parameter_values is not None: - _serialize_query_parameter_values( - serializer, - _SCHEMA_START_DASHBOARD_REFRESH_INPUT.members["QueryParameterValues"], - self.query_parameter_values, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["dashboard_id"] = de.read_string( - _SCHEMA_START_DASHBOARD_REFRESH_INPUT.members["DashboardId"] - ) - - case 1: - kwargs["query_parameter_values"] = ( - _deserialize_query_parameter_values( - de, - _SCHEMA_START_DASHBOARD_REFRESH_INPUT.members[ - "QueryParameterValues" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_START_DASHBOARD_REFRESH_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class StartDashboardRefreshOutput: - """Dataclass for StartDashboardRefreshOutput structure.""" - - refresh_id: str | None = None - """The refresh ID for the dashboard.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_DASHBOARD_REFRESH_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.refresh_id is not None: - serializer.write_string( - _SCHEMA_START_DASHBOARD_REFRESH_OUTPUT.members["RefreshId"], - self.refresh_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["refresh_id"] = de.read_string( - _SCHEMA_START_DASHBOARD_REFRESH_OUTPUT.members["RefreshId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_START_DASHBOARD_REFRESH_OUTPUT, consumer=_consumer - ) - return kwargs - - -START_DASHBOARD_REFRESH = APIOperation( - input=StartDashboardRefreshInput, - output=StartDashboardRefreshOutput, - schema=_SCHEMA_START_DASHBOARD_REFRESH, - input_schema=_SCHEMA_START_DASHBOARD_REFRESH_INPUT, - output_schema=_SCHEMA_START_DASHBOARD_REFRESH_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreNotFoundException" - ): EventDataStoreNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#InactiveEventDataStoreException" - ): InactiveEventDataStoreException, - ShapeID( - "com.amazonaws.cloudtrail#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, - _SCHEMA_INACTIVE_EVENT_DATA_STORE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class StartEventDataStoreIngestionInput: - """Dataclass for StartEventDataStoreIngestionInput structure.""" - - event_data_store: str | None = None - """ - The ARN (or ID suffix of the ARN) of the event data store for which you - want to start ingestion. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_EVENT_DATA_STORE_INGESTION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.event_data_store is not None: - serializer.write_string( - _SCHEMA_START_EVENT_DATA_STORE_INGESTION_INPUT.members[ - "EventDataStore" - ], - self.event_data_store, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["event_data_store"] = de.read_string( - _SCHEMA_START_EVENT_DATA_STORE_INGESTION_INPUT.members[ - "EventDataStore" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_START_EVENT_DATA_STORE_INGESTION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class StartEventDataStoreIngestionOutput: - """Dataclass for StartEventDataStoreIngestionOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_EVENT_DATA_STORE_INGESTION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_START_EVENT_DATA_STORE_INGESTION_OUTPUT, consumer=_consumer - ) - return kwargs - - -START_EVENT_DATA_STORE_INGESTION = APIOperation( - input=StartEventDataStoreIngestionInput, - output=StartEventDataStoreIngestionOutput, - schema=_SCHEMA_START_EVENT_DATA_STORE_INGESTION, - input_schema=_SCHEMA_START_EVENT_DATA_STORE_INGESTION_INPUT, - output_schema=_SCHEMA_START_EVENT_DATA_STORE_INGESTION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.cloudtrail#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreARNInvalidException" - ): EventDataStoreARNInvalidException, - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreNotFoundException" - ): EventDataStoreNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException" - ): InsufficientDependencyServiceAccessPermissionException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidEventDataStoreCategoryException" - ): InvalidEventDataStoreCategoryException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidEventDataStoreStatusException" - ): InvalidEventDataStoreStatusException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException" - ): NoManagementAccountSLRExistsException, - ShapeID( - "com.amazonaws.cloudtrail#NotOrganizationMasterAccountException" - ): NotOrganizationMasterAccountException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_EVENT_DATA_STORE_ARN_INVALID_EXCEPTION, - _SCHEMA_EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, - _SCHEMA_INSUFFICIENT_DEPENDENCY_SERVICE_ACCESS_PERMISSION_EXCEPTION, - _SCHEMA_INVALID_EVENT_DATA_STORE_CATEGORY_EXCEPTION, - _SCHEMA_INVALID_EVENT_DATA_STORE_STATUS_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, - _SCHEMA_NOT_ORGANIZATION_MASTER_ACCOUNT_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class InvalidImportSourceException(ServiceError): - """ - This exception is thrown when the provided source S3 bucket is not valid - for import. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_IMPORT_SOURCE_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_IMPORT_SOURCE_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_IMPORT_SOURCE_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVALID_IMPORT_SOURCE_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class StartImportInput: - """Dataclass for StartImportInput structure.""" - - destinations: list[str] | None = None - """ - The ARN of the destination event data store. Use this parameter for a - new import. - """ - - import_source: ImportSource | None = None - """ - The source S3 bucket for the import. Use this parameter for a new - import. - """ - - start_event_time: datetime | None = None - """ - Use with `EndEventTime` to bound a `StartImport` request, and limit - imported trail events to only those events logged within a specified - time period. When you specify a time range, CloudTrail checks the prefix - and log file names to verify the names contain a date between the - specified `StartEventTime` and `EndEventTime` before attempting to - import events. - """ - - end_event_time: datetime | None = None - """ - Use with `StartEventTime` to bound a `StartImport` request, and limit - imported trail events to only those events logged within a specified - time period. When you specify a time range, CloudTrail checks the prefix - and log file names to verify the names contain a date between the - specified `StartEventTime` and `EndEventTime` before attempting to - import events. - """ - - import_id: str | None = None - """ - The ID of the import. Use this parameter when you are retrying an - import. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_IMPORT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.destinations is not None: - _serialize_import_destinations( - serializer, - _SCHEMA_START_IMPORT_INPUT.members["Destinations"], - self.destinations, - ) - - if self.import_source is not None: - serializer.write_struct( - _SCHEMA_START_IMPORT_INPUT.members["ImportSource"], self.import_source - ) - - if self.start_event_time is not None: - serializer.write_timestamp( - _SCHEMA_START_IMPORT_INPUT.members["StartEventTime"], - self.start_event_time, - ) - - if self.end_event_time is not None: - serializer.write_timestamp( - _SCHEMA_START_IMPORT_INPUT.members["EndEventTime"], self.end_event_time - ) - - if self.import_id is not None: - serializer.write_string( - _SCHEMA_START_IMPORT_INPUT.members["ImportId"], self.import_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["destinations"] = _deserialize_import_destinations( - de, _SCHEMA_START_IMPORT_INPUT.members["Destinations"] - ) - - case 1: - kwargs["import_source"] = ImportSource.deserialize(de) - - case 2: - kwargs["start_event_time"] = de.read_timestamp( - _SCHEMA_START_IMPORT_INPUT.members["StartEventTime"] - ) - - case 3: - kwargs["end_event_time"] = de.read_timestamp( - _SCHEMA_START_IMPORT_INPUT.members["EndEventTime"] - ) - - case 4: - kwargs["import_id"] = de.read_string( - _SCHEMA_START_IMPORT_INPUT.members["ImportId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_START_IMPORT_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class StartImportOutput: - """Dataclass for StartImportOutput structure.""" - - import_id: str | None = None - """The ID of the import.""" - - destinations: list[str] | None = None - """The ARN of the destination event data store.""" - - import_source: ImportSource | None = None - """The source S3 bucket for the import.""" - - start_event_time: datetime | None = None - """ - Used with `EndEventTime` to bound a `StartImport` request, and limit - imported trail events to only those events logged within a specified - time period. - """ - - end_event_time: datetime | None = None - """ - Used with `StartEventTime` to bound a `StartImport` request, and limit - imported trail events to only those events logged within a specified - time period. - """ - - import_status: str | None = None - """ - Shows the status of the import after a `StartImport` request. An import - finishes with a status of `COMPLETED` if there were no failures, or - `FAILED` if there were failures. - """ - - created_timestamp: datetime | None = None - """The timestamp for the import's creation.""" - - updated_timestamp: datetime | None = None - """The timestamp of the import's last update, if applicable.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_IMPORT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.import_id is not None: - serializer.write_string( - _SCHEMA_START_IMPORT_OUTPUT.members["ImportId"], self.import_id - ) - - if self.destinations is not None: - _serialize_import_destinations( - serializer, - _SCHEMA_START_IMPORT_OUTPUT.members["Destinations"], - self.destinations, - ) - - if self.import_source is not None: - serializer.write_struct( - _SCHEMA_START_IMPORT_OUTPUT.members["ImportSource"], self.import_source - ) - - if self.start_event_time is not None: - serializer.write_timestamp( - _SCHEMA_START_IMPORT_OUTPUT.members["StartEventTime"], - self.start_event_time, - ) - - if self.end_event_time is not None: - serializer.write_timestamp( - _SCHEMA_START_IMPORT_OUTPUT.members["EndEventTime"], self.end_event_time - ) - - if self.import_status is not None: - serializer.write_string( - _SCHEMA_START_IMPORT_OUTPUT.members["ImportStatus"], self.import_status - ) - - if self.created_timestamp is not None: - serializer.write_timestamp( - _SCHEMA_START_IMPORT_OUTPUT.members["CreatedTimestamp"], - self.created_timestamp, - ) - - if self.updated_timestamp is not None: - serializer.write_timestamp( - _SCHEMA_START_IMPORT_OUTPUT.members["UpdatedTimestamp"], - self.updated_timestamp, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["import_id"] = de.read_string( - _SCHEMA_START_IMPORT_OUTPUT.members["ImportId"] - ) - - case 1: - kwargs["destinations"] = _deserialize_import_destinations( - de, _SCHEMA_START_IMPORT_OUTPUT.members["Destinations"] - ) - - case 2: - kwargs["import_source"] = ImportSource.deserialize(de) - - case 3: - kwargs["start_event_time"] = de.read_timestamp( - _SCHEMA_START_IMPORT_OUTPUT.members["StartEventTime"] - ) - - case 4: - kwargs["end_event_time"] = de.read_timestamp( - _SCHEMA_START_IMPORT_OUTPUT.members["EndEventTime"] - ) - - case 5: - kwargs["import_status"] = ImportStatus( - de.read_string( - _SCHEMA_START_IMPORT_OUTPUT.members["ImportStatus"] - ) - ) - - case 6: - kwargs["created_timestamp"] = de.read_timestamp( - _SCHEMA_START_IMPORT_OUTPUT.members["CreatedTimestamp"] - ) - - case 7: - kwargs["updated_timestamp"] = de.read_timestamp( - _SCHEMA_START_IMPORT_OUTPUT.members["UpdatedTimestamp"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_START_IMPORT_OUTPUT, consumer=_consumer) - return kwargs - - -START_IMPORT = APIOperation( - input=StartImportInput, - output=StartImportOutput, - schema=_SCHEMA_START_IMPORT, - input_schema=_SCHEMA_START_IMPORT_INPUT, - output_schema=_SCHEMA_START_IMPORT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#AccountHasOngoingImportException" - ): AccountHasOngoingImportException, - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreARNInvalidException" - ): EventDataStoreARNInvalidException, - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreNotFoundException" - ): EventDataStoreNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#ImportNotFoundException" - ): ImportNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#InactiveEventDataStoreException" - ): InactiveEventDataStoreException, - ShapeID( - "com.amazonaws.cloudtrail#InsufficientEncryptionPolicyException" - ): InsufficientEncryptionPolicyException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidEventDataStoreCategoryException" - ): InvalidEventDataStoreCategoryException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidEventDataStoreStatusException" - ): InvalidEventDataStoreStatusException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidImportSourceException" - ): InvalidImportSourceException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCOUNT_HAS_ONGOING_IMPORT_EXCEPTION, - _SCHEMA_EVENT_DATA_STORE_ARN_INVALID_EXCEPTION, - _SCHEMA_EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, - _SCHEMA_IMPORT_NOT_FOUND_EXCEPTION, - _SCHEMA_INACTIVE_EVENT_DATA_STORE_EXCEPTION, - _SCHEMA_INSUFFICIENT_ENCRYPTION_POLICY_EXCEPTION, - _SCHEMA_INVALID_EVENT_DATA_STORE_CATEGORY_EXCEPTION, - _SCHEMA_INVALID_EVENT_DATA_STORE_STATUS_EXCEPTION, - _SCHEMA_INVALID_IMPORT_SOURCE_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class StartLoggingInput: - """ - The request to CloudTrail to start logging Amazon Web Services API calls - for an account. - """ - - name: str | None = None - """ - Specifies the name or the CloudTrail ARN of the trail for which - CloudTrail logs Amazon Web Services API calls. The following is the - format of a trail ARN. - - `arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail` - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_LOGGING_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_START_LOGGING_INPUT.members["Name"], self.name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_START_LOGGING_INPUT.members["Name"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_START_LOGGING_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class StartLoggingOutput: - """ - Returns the objects or data listed below if successful. Otherwise, - returns an error. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_LOGGING_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_START_LOGGING_OUTPUT, consumer=_consumer) - return kwargs - - -START_LOGGING = APIOperation( - input=StartLoggingInput, - output=StartLoggingOutput, - schema=_SCHEMA_START_LOGGING, - input_schema=_SCHEMA_START_LOGGING_INPUT, - output_schema=_SCHEMA_START_LOGGING_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#CloudTrailARNInvalidException" - ): CloudTrailARNInvalidException, - ShapeID("com.amazonaws.cloudtrail#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException" - ): InsufficientDependencyServiceAccessPermissionException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidHomeRegionException" - ): InvalidHomeRegionException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidTrailNameException" - ): InvalidTrailNameException, - ShapeID( - "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException" - ): NoManagementAccountSLRExistsException, - ShapeID( - "com.amazonaws.cloudtrail#NotOrganizationMasterAccountException" - ): NotOrganizationMasterAccountException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.cloudtrail#TrailNotFoundException" - ): TrailNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CLOUD_TRAIL_ARN_INVALID_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INSUFFICIENT_DEPENDENCY_SERVICE_ACCESS_PERMISSION_EXCEPTION, - _SCHEMA_INVALID_HOME_REGION_EXCEPTION, - _SCHEMA_INVALID_TRAIL_NAME_EXCEPTION, - _SCHEMA_NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, - _SCHEMA_NOT_ORGANIZATION_MASTER_ACCOUNT_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_TRAIL_NOT_FOUND_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class MaxConcurrentQueriesException(ServiceError): - """ - You are already running the maximum number of concurrent queries. The - maximum number of concurrent queries is 10. Wait a minute for some - queries to finish, and then run the query again. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MAX_CONCURRENT_QUERIES_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_MAX_CONCURRENT_QUERIES_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_MAX_CONCURRENT_QUERIES_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MAX_CONCURRENT_QUERIES_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class StartQueryInput: - """Dataclass for StartQueryInput structure.""" - - query_statement: str | None = None - """The SQL code of your query.""" - - delivery_s3_uri: str | None = None - """The URI for the S3 bucket where CloudTrail delivers the query results.""" - - query_alias: str | None = None - """The alias that identifies a query template.""" - - query_parameters: list[str] | None = None - """The query parameters for the specified `QueryAlias`.""" - - event_data_store_owner_account_id: str | None = None - """The account ID of the event data store owner.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_QUERY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.query_statement is not None: - serializer.write_string( - _SCHEMA_START_QUERY_INPUT.members["QueryStatement"], - self.query_statement, - ) - - if self.delivery_s3_uri is not None: - serializer.write_string( - _SCHEMA_START_QUERY_INPUT.members["DeliveryS3Uri"], self.delivery_s3_uri - ) - - if self.query_alias is not None: - serializer.write_string( - _SCHEMA_START_QUERY_INPUT.members["QueryAlias"], self.query_alias - ) - - if self.query_parameters is not None: - _serialize_query_parameters( - serializer, - _SCHEMA_START_QUERY_INPUT.members["QueryParameters"], - self.query_parameters, - ) - - if self.event_data_store_owner_account_id is not None: - serializer.write_string( - _SCHEMA_START_QUERY_INPUT.members["EventDataStoreOwnerAccountId"], - self.event_data_store_owner_account_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["query_statement"] = de.read_string( - _SCHEMA_START_QUERY_INPUT.members["QueryStatement"] - ) - - case 1: - kwargs["delivery_s3_uri"] = de.read_string( - _SCHEMA_START_QUERY_INPUT.members["DeliveryS3Uri"] - ) - - case 2: - kwargs["query_alias"] = de.read_string( - _SCHEMA_START_QUERY_INPUT.members["QueryAlias"] - ) - - case 3: - kwargs["query_parameters"] = _deserialize_query_parameters( - de, _SCHEMA_START_QUERY_INPUT.members["QueryParameters"] - ) - - case 4: - kwargs["event_data_store_owner_account_id"] = de.read_string( - _SCHEMA_START_QUERY_INPUT.members[ - "EventDataStoreOwnerAccountId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_START_QUERY_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class StartQueryOutput: - """Dataclass for StartQueryOutput structure.""" - - query_id: str | None = None - """The ID of the started query.""" - - event_data_store_owner_account_id: str | None = None - """The account ID of the event data store owner.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_QUERY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.query_id is not None: - serializer.write_string( - _SCHEMA_START_QUERY_OUTPUT.members["QueryId"], self.query_id - ) - - if self.event_data_store_owner_account_id is not None: - serializer.write_string( - _SCHEMA_START_QUERY_OUTPUT.members["EventDataStoreOwnerAccountId"], - self.event_data_store_owner_account_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["query_id"] = de.read_string( - _SCHEMA_START_QUERY_OUTPUT.members["QueryId"] - ) - - case 1: - kwargs["event_data_store_owner_account_id"] = de.read_string( - _SCHEMA_START_QUERY_OUTPUT.members[ - "EventDataStoreOwnerAccountId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_START_QUERY_OUTPUT, consumer=_consumer) - return kwargs - - -START_QUERY = APIOperation( - input=StartQueryInput, - output=StartQueryOutput, - schema=_SCHEMA_START_QUERY, - input_schema=_SCHEMA_START_QUERY_INPUT, - output_schema=_SCHEMA_START_QUERY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreARNInvalidException" - ): EventDataStoreARNInvalidException, - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreNotFoundException" - ): EventDataStoreNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#InactiveEventDataStoreException" - ): InactiveEventDataStoreException, - ShapeID( - "com.amazonaws.cloudtrail#InsufficientEncryptionPolicyException" - ): InsufficientEncryptionPolicyException, - ShapeID( - "com.amazonaws.cloudtrail#InsufficientS3BucketPolicyException" - ): InsufficientS3BucketPolicyException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidQueryStatementException" - ): InvalidQueryStatementException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidS3BucketNameException" - ): InvalidS3BucketNameException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidS3PrefixException" - ): InvalidS3PrefixException, - ShapeID( - "com.amazonaws.cloudtrail#MaxConcurrentQueriesException" - ): MaxConcurrentQueriesException, - ShapeID( - "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException" - ): NoManagementAccountSLRExistsException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#S3BucketDoesNotExistException" - ): S3BucketDoesNotExistException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_EVENT_DATA_STORE_ARN_INVALID_EXCEPTION, - _SCHEMA_EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, - _SCHEMA_INACTIVE_EVENT_DATA_STORE_EXCEPTION, - _SCHEMA_INSUFFICIENT_ENCRYPTION_POLICY_EXCEPTION, - _SCHEMA_INSUFFICIENT_S3_BUCKET_POLICY_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_INVALID_QUERY_STATEMENT_EXCEPTION, - _SCHEMA_INVALID_S3_BUCKET_NAME_EXCEPTION, - _SCHEMA_INVALID_S3_PREFIX_EXCEPTION, - _SCHEMA_MAX_CONCURRENT_QUERIES_EXCEPTION, - _SCHEMA_NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_S3_BUCKET_DOES_NOT_EXIST_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class StopEventDataStoreIngestionInput: - """Dataclass for StopEventDataStoreIngestionInput structure.""" - - event_data_store: str | None = None - """ - The ARN (or ID suffix of the ARN) of the event data store for which you - want to stop ingestion. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STOP_EVENT_DATA_STORE_INGESTION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.event_data_store is not None: - serializer.write_string( - _SCHEMA_STOP_EVENT_DATA_STORE_INGESTION_INPUT.members["EventDataStore"], - self.event_data_store, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["event_data_store"] = de.read_string( - _SCHEMA_STOP_EVENT_DATA_STORE_INGESTION_INPUT.members[ - "EventDataStore" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_STOP_EVENT_DATA_STORE_INGESTION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class StopEventDataStoreIngestionOutput: - """Dataclass for StopEventDataStoreIngestionOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STOP_EVENT_DATA_STORE_INGESTION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_STOP_EVENT_DATA_STORE_INGESTION_OUTPUT, consumer=_consumer - ) - return kwargs - - -STOP_EVENT_DATA_STORE_INGESTION = APIOperation( - input=StopEventDataStoreIngestionInput, - output=StopEventDataStoreIngestionOutput, - schema=_SCHEMA_STOP_EVENT_DATA_STORE_INGESTION, - input_schema=_SCHEMA_STOP_EVENT_DATA_STORE_INGESTION_INPUT, - output_schema=_SCHEMA_STOP_EVENT_DATA_STORE_INGESTION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.cloudtrail#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreARNInvalidException" - ): EventDataStoreARNInvalidException, - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreNotFoundException" - ): EventDataStoreNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException" - ): InsufficientDependencyServiceAccessPermissionException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidEventDataStoreCategoryException" - ): InvalidEventDataStoreCategoryException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidEventDataStoreStatusException" - ): InvalidEventDataStoreStatusException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException" - ): NoManagementAccountSLRExistsException, - ShapeID( - "com.amazonaws.cloudtrail#NotOrganizationMasterAccountException" - ): NotOrganizationMasterAccountException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_EVENT_DATA_STORE_ARN_INVALID_EXCEPTION, - _SCHEMA_EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, - _SCHEMA_INSUFFICIENT_DEPENDENCY_SERVICE_ACCESS_PERMISSION_EXCEPTION, - _SCHEMA_INVALID_EVENT_DATA_STORE_CATEGORY_EXCEPTION, - _SCHEMA_INVALID_EVENT_DATA_STORE_STATUS_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, - _SCHEMA_NOT_ORGANIZATION_MASTER_ACCOUNT_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class StopImportInput: - """Dataclass for StopImportInput structure.""" - - import_id: str | None = None - """The ID of the import.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STOP_IMPORT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.import_id is not None: - serializer.write_string( - _SCHEMA_STOP_IMPORT_INPUT.members["ImportId"], self.import_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["import_id"] = de.read_string( - _SCHEMA_STOP_IMPORT_INPUT.members["ImportId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_STOP_IMPORT_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class StopImportOutput: - """Dataclass for StopImportOutput structure.""" - - import_id: str | None = None - """The ID for the import.""" - - import_source: ImportSource | None = None - """The source S3 bucket for the import.""" - - destinations: list[str] | None = None - """The ARN of the destination event data store.""" - - import_status: str | None = None - """The status of the import.""" - - created_timestamp: datetime | None = None - """The timestamp of the import's creation.""" - - updated_timestamp: datetime | None = None - """The timestamp of the import's last update.""" - - start_event_time: datetime | None = None - """ - Used with `EndEventTime` to bound a `StartImport` request, and limit - imported trail events to only those events logged within a specified - time period. - """ - - end_event_time: datetime | None = None - """ - Used with `StartEventTime` to bound a `StartImport` request, and limit - imported trail events to only those events logged within a specified - time period. - """ - - import_statistics: ImportStatistics | None = None - """Returns information on the stopped import.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STOP_IMPORT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.import_id is not None: - serializer.write_string( - _SCHEMA_STOP_IMPORT_OUTPUT.members["ImportId"], self.import_id - ) - - if self.import_source is not None: - serializer.write_struct( - _SCHEMA_STOP_IMPORT_OUTPUT.members["ImportSource"], self.import_source - ) - - if self.destinations is not None: - _serialize_import_destinations( - serializer, - _SCHEMA_STOP_IMPORT_OUTPUT.members["Destinations"], - self.destinations, - ) - - if self.import_status is not None: - serializer.write_string( - _SCHEMA_STOP_IMPORT_OUTPUT.members["ImportStatus"], self.import_status - ) - - if self.created_timestamp is not None: - serializer.write_timestamp( - _SCHEMA_STOP_IMPORT_OUTPUT.members["CreatedTimestamp"], - self.created_timestamp, - ) - - if self.updated_timestamp is not None: - serializer.write_timestamp( - _SCHEMA_STOP_IMPORT_OUTPUT.members["UpdatedTimestamp"], - self.updated_timestamp, - ) - - if self.start_event_time is not None: - serializer.write_timestamp( - _SCHEMA_STOP_IMPORT_OUTPUT.members["StartEventTime"], - self.start_event_time, - ) - - if self.end_event_time is not None: - serializer.write_timestamp( - _SCHEMA_STOP_IMPORT_OUTPUT.members["EndEventTime"], self.end_event_time - ) - - if self.import_statistics is not None: - serializer.write_struct( - _SCHEMA_STOP_IMPORT_OUTPUT.members["ImportStatistics"], - self.import_statistics, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["import_id"] = de.read_string( - _SCHEMA_STOP_IMPORT_OUTPUT.members["ImportId"] - ) - - case 1: - kwargs["import_source"] = ImportSource.deserialize(de) - - case 2: - kwargs["destinations"] = _deserialize_import_destinations( - de, _SCHEMA_STOP_IMPORT_OUTPUT.members["Destinations"] - ) - - case 3: - kwargs["import_status"] = ImportStatus( - de.read_string( - _SCHEMA_STOP_IMPORT_OUTPUT.members["ImportStatus"] - ) - ) - - case 4: - kwargs["created_timestamp"] = de.read_timestamp( - _SCHEMA_STOP_IMPORT_OUTPUT.members["CreatedTimestamp"] - ) - - case 5: - kwargs["updated_timestamp"] = de.read_timestamp( - _SCHEMA_STOP_IMPORT_OUTPUT.members["UpdatedTimestamp"] - ) - - case 6: - kwargs["start_event_time"] = de.read_timestamp( - _SCHEMA_STOP_IMPORT_OUTPUT.members["StartEventTime"] - ) - - case 7: - kwargs["end_event_time"] = de.read_timestamp( - _SCHEMA_STOP_IMPORT_OUTPUT.members["EndEventTime"] - ) - - case 8: - kwargs["import_statistics"] = ImportStatistics.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_STOP_IMPORT_OUTPUT, consumer=_consumer) - return kwargs - - -STOP_IMPORT = APIOperation( - input=StopImportInput, - output=StopImportOutput, - schema=_SCHEMA_STOP_IMPORT, - input_schema=_SCHEMA_STOP_IMPORT_INPUT, - output_schema=_SCHEMA_STOP_IMPORT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#ImportNotFoundException" - ): ImportNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_IMPORT_NOT_FOUND_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class StopLoggingInput: - """ - Passes the request to CloudTrail to stop logging Amazon Web Services API - calls for the specified account. - """ - - name: str | None = None - """ - Specifies the name or the CloudTrail ARN of the trail for which - CloudTrail will stop logging Amazon Web Services API calls. The - following is the format of a trail ARN. - - `arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail` - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STOP_LOGGING_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_STOP_LOGGING_INPUT.members["Name"], self.name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_STOP_LOGGING_INPUT.members["Name"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_STOP_LOGGING_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class StopLoggingOutput: - """ - Returns the objects or data listed below if successful. Otherwise, - returns an error. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STOP_LOGGING_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_STOP_LOGGING_OUTPUT, consumer=_consumer) - return kwargs - - -STOP_LOGGING = APIOperation( - input=StopLoggingInput, - output=StopLoggingOutput, - schema=_SCHEMA_STOP_LOGGING, - input_schema=_SCHEMA_STOP_LOGGING_INPUT, - output_schema=_SCHEMA_STOP_LOGGING_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#CloudTrailARNInvalidException" - ): CloudTrailARNInvalidException, - ShapeID("com.amazonaws.cloudtrail#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException" - ): InsufficientDependencyServiceAccessPermissionException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidHomeRegionException" - ): InvalidHomeRegionException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidTrailNameException" - ): InvalidTrailNameException, - ShapeID( - "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException" - ): NoManagementAccountSLRExistsException, - ShapeID( - "com.amazonaws.cloudtrail#NotOrganizationMasterAccountException" - ): NotOrganizationMasterAccountException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.cloudtrail#TrailNotFoundException" - ): TrailNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CLOUD_TRAIL_ARN_INVALID_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INSUFFICIENT_DEPENDENCY_SERVICE_ACCESS_PERMISSION_EXCEPTION, - _SCHEMA_INVALID_HOME_REGION_EXCEPTION, - _SCHEMA_INVALID_TRAIL_NAME_EXCEPTION, - _SCHEMA_NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, - _SCHEMA_NOT_ORGANIZATION_MASTER_ACCOUNT_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_TRAIL_NOT_FOUND_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateChannelInput: - """Dataclass for UpdateChannelInput structure.""" - - channel: str | None = None - """The ARN or ID (the ARN suffix) of the channel that you want to update.""" - - destinations: list[Destination] | None = None - """ - The ARNs of event data stores that you want to log events arriving - through the channel. - """ - - name: str | None = None - """Changes the name of the channel.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_CHANNEL_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.channel is not None: - serializer.write_string( - _SCHEMA_UPDATE_CHANNEL_INPUT.members["Channel"], self.channel - ) - - if self.destinations is not None: - _serialize_destinations( - serializer, - _SCHEMA_UPDATE_CHANNEL_INPUT.members["Destinations"], - self.destinations, - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_UPDATE_CHANNEL_INPUT.members["Name"], self.name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["channel"] = de.read_string( - _SCHEMA_UPDATE_CHANNEL_INPUT.members["Channel"] - ) - - case 1: - kwargs["destinations"] = _deserialize_destinations( - de, _SCHEMA_UPDATE_CHANNEL_INPUT.members["Destinations"] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_CHANNEL_INPUT.members["Name"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_CHANNEL_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateChannelOutput: - """Dataclass for UpdateChannelOutput structure.""" - - channel_arn: str | None = None - """The ARN of the channel that was updated.""" - - name: str | None = None - """The name of the channel that was updated.""" - - source: str | None = None - """The event source of the channel that was updated.""" - - destinations: list[Destination] | None = None - """The event data stores that log events arriving through the channel.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_CHANNEL_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.channel_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_CHANNEL_OUTPUT.members["ChannelArn"], self.channel_arn - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_UPDATE_CHANNEL_OUTPUT.members["Name"], self.name - ) - - if self.source is not None: - serializer.write_string( - _SCHEMA_UPDATE_CHANNEL_OUTPUT.members["Source"], self.source - ) - - if self.destinations is not None: - _serialize_destinations( - serializer, - _SCHEMA_UPDATE_CHANNEL_OUTPUT.members["Destinations"], - self.destinations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["channel_arn"] = de.read_string( - _SCHEMA_UPDATE_CHANNEL_OUTPUT.members["ChannelArn"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_CHANNEL_OUTPUT.members["Name"] - ) - - case 2: - kwargs["source"] = de.read_string( - _SCHEMA_UPDATE_CHANNEL_OUTPUT.members["Source"] - ) - - case 3: - kwargs["destinations"] = _deserialize_destinations( - de, _SCHEMA_UPDATE_CHANNEL_OUTPUT.members["Destinations"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_CHANNEL_OUTPUT, consumer=_consumer) - return kwargs - - -UPDATE_CHANNEL = APIOperation( - input=UpdateChannelInput, - output=UpdateChannelOutput, - schema=_SCHEMA_UPDATE_CHANNEL, - input_schema=_SCHEMA_UPDATE_CHANNEL_INPUT, - output_schema=_SCHEMA_UPDATE_CHANNEL_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#ChannelAlreadyExistsException" - ): ChannelAlreadyExistsException, - ShapeID( - "com.amazonaws.cloudtrail#ChannelARNInvalidException" - ): ChannelARNInvalidException, - ShapeID( - "com.amazonaws.cloudtrail#ChannelNotFoundException" - ): ChannelNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreARNInvalidException" - ): EventDataStoreARNInvalidException, - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreNotFoundException" - ): EventDataStoreNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#InactiveEventDataStoreException" - ): InactiveEventDataStoreException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidEventDataStoreCategoryException" - ): InvalidEventDataStoreCategoryException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CHANNEL_ALREADY_EXISTS_EXCEPTION, - _SCHEMA_CHANNEL_ARN_INVALID_EXCEPTION, - _SCHEMA_CHANNEL_NOT_FOUND_EXCEPTION, - _SCHEMA_EVENT_DATA_STORE_ARN_INVALID_EXCEPTION, - _SCHEMA_EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, - _SCHEMA_INACTIVE_EVENT_DATA_STORE_EXCEPTION, - _SCHEMA_INVALID_EVENT_DATA_STORE_CATEGORY_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateDashboardInput: - """Dataclass for UpdateDashboardInput structure.""" - - dashboard_id: str | None = None - """The name or ARN of the dashboard.""" - - widgets: list[RequestWidget] | None = None - """ - An array of widgets for the dashboard. A custom dashboard can have a - maximum of 10 widgets. - - To add new widgets, pass in an array that includes the existing widgets - along with any new widgets. Run the `GetDashboard` operation to get the - list of widgets for the dashboard. - - To remove widgets, pass in an array that includes the existing widgets - minus the widgets you want removed. - """ - - refresh_schedule: RefreshSchedule | None = None - """The refresh schedule configuration for the dashboard.""" - - termination_protection_enabled: bool | None = None - """ - Specifies whether termination protection is enabled for the dashboard. - If termination protection is enabled, you cannot delete the dashboard - until termination protection is disabled. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_DASHBOARD_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.dashboard_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_DASHBOARD_INPUT.members["DashboardId"], self.dashboard_id - ) - - if self.widgets is not None: - _serialize_request_widget_list( - serializer, - _SCHEMA_UPDATE_DASHBOARD_INPUT.members["Widgets"], - self.widgets, - ) - - if self.refresh_schedule is not None: - serializer.write_struct( - _SCHEMA_UPDATE_DASHBOARD_INPUT.members["RefreshSchedule"], - self.refresh_schedule, - ) - - if self.termination_protection_enabled is not None: - serializer.write_boolean( - _SCHEMA_UPDATE_DASHBOARD_INPUT.members["TerminationProtectionEnabled"], - self.termination_protection_enabled, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["dashboard_id"] = de.read_string( - _SCHEMA_UPDATE_DASHBOARD_INPUT.members["DashboardId"] - ) - - case 1: - kwargs["widgets"] = _deserialize_request_widget_list( - de, _SCHEMA_UPDATE_DASHBOARD_INPUT.members["Widgets"] - ) - - case 2: - kwargs["refresh_schedule"] = RefreshSchedule.deserialize(de) - - case 3: - kwargs["termination_protection_enabled"] = de.read_boolean( - _SCHEMA_UPDATE_DASHBOARD_INPUT.members[ - "TerminationProtectionEnabled" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_DASHBOARD_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateDashboardOutput: - """Dataclass for UpdateDashboardOutput structure.""" - - dashboard_arn: str | None = None - """The ARN for the dashboard.""" - - name: str | None = None - """The name for the dashboard.""" - - type: str | None = None - """The type of dashboard.""" - - widgets: list[Widget] | None = None - """An array of widgets for the dashboard.""" - - refresh_schedule: RefreshSchedule | None = None - """The refresh schedule for the dashboard, if configured.""" - - termination_protection_enabled: bool | None = None - """Indicates whether termination protection is enabled for the dashboard.""" - - created_timestamp: datetime | None = None - """The timestamp that shows when the dashboard was created.""" - - updated_timestamp: datetime | None = None - """The timestamp that shows when the dashboard was updated.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_DASHBOARD_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.dashboard_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_DASHBOARD_OUTPUT.members["DashboardArn"], - self.dashboard_arn, - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_UPDATE_DASHBOARD_OUTPUT.members["Name"], self.name - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_UPDATE_DASHBOARD_OUTPUT.members["Type"], self.type - ) - - if self.widgets is not None: - _serialize_widget_list( - serializer, - _SCHEMA_UPDATE_DASHBOARD_OUTPUT.members["Widgets"], - self.widgets, - ) - - if self.refresh_schedule is not None: - serializer.write_struct( - _SCHEMA_UPDATE_DASHBOARD_OUTPUT.members["RefreshSchedule"], - self.refresh_schedule, - ) - - if self.termination_protection_enabled is not None: - serializer.write_boolean( - _SCHEMA_UPDATE_DASHBOARD_OUTPUT.members["TerminationProtectionEnabled"], - self.termination_protection_enabled, - ) - - if self.created_timestamp is not None: - serializer.write_timestamp( - _SCHEMA_UPDATE_DASHBOARD_OUTPUT.members["CreatedTimestamp"], - self.created_timestamp, - ) - - if self.updated_timestamp is not None: - serializer.write_timestamp( - _SCHEMA_UPDATE_DASHBOARD_OUTPUT.members["UpdatedTimestamp"], - self.updated_timestamp, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["dashboard_arn"] = de.read_string( - _SCHEMA_UPDATE_DASHBOARD_OUTPUT.members["DashboardArn"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_DASHBOARD_OUTPUT.members["Name"] - ) - - case 2: - kwargs["type"] = DashboardType( - de.read_string(_SCHEMA_UPDATE_DASHBOARD_OUTPUT.members["Type"]) - ) - - case 3: - kwargs["widgets"] = _deserialize_widget_list( - de, _SCHEMA_UPDATE_DASHBOARD_OUTPUT.members["Widgets"] - ) - - case 4: - kwargs["refresh_schedule"] = RefreshSchedule.deserialize(de) - - case 5: - kwargs["termination_protection_enabled"] = de.read_boolean( - _SCHEMA_UPDATE_DASHBOARD_OUTPUT.members[ - "TerminationProtectionEnabled" - ] - ) - - case 6: - kwargs["created_timestamp"] = de.read_timestamp( - _SCHEMA_UPDATE_DASHBOARD_OUTPUT.members["CreatedTimestamp"] - ) - - case 7: - kwargs["updated_timestamp"] = de.read_timestamp( - _SCHEMA_UPDATE_DASHBOARD_OUTPUT.members["UpdatedTimestamp"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_DASHBOARD_OUTPUT, consumer=_consumer) - return kwargs - - -UPDATE_DASHBOARD = APIOperation( - input=UpdateDashboardInput, - output=UpdateDashboardOutput, - schema=_SCHEMA_UPDATE_DASHBOARD, - input_schema=_SCHEMA_UPDATE_DASHBOARD_INPUT, - output_schema=_SCHEMA_UPDATE_DASHBOARD_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.cloudtrail#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreNotFoundException" - ): EventDataStoreNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#InactiveEventDataStoreException" - ): InactiveEventDataStoreException, - ShapeID( - "com.amazonaws.cloudtrail#InsufficientEncryptionPolicyException" - ): InsufficientEncryptionPolicyException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidQueryStatementException" - ): InvalidQueryStatementException, - ShapeID( - "com.amazonaws.cloudtrail#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, - _SCHEMA_INACTIVE_EVENT_DATA_STORE_EXCEPTION, - _SCHEMA_INSUFFICIENT_ENCRYPTION_POLICY_EXCEPTION, - _SCHEMA_INVALID_QUERY_STATEMENT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateEventDataStoreInput: - """Dataclass for UpdateEventDataStoreInput structure.""" - - event_data_store: str | None = None - """ - The ARN (or the ID suffix of the ARN) of the event data store that you - want to update. - """ - - name: str | None = None - """The event data store name.""" - - advanced_event_selectors: list[AdvancedEventSelector] | None = None - """ - The advanced event selectors used to select events for the event data - store. You can configure up to five advanced event selectors for each - event data store. - """ - - multi_region_enabled: bool | None = None - """ - Specifies whether an event data store collects events from all Regions, - or only from the Region in which it was created. - """ - - organization_enabled: bool | None = None - """ - Specifies whether an event data store collects events logged for an - organization in Organizations. - - Note: - Only the management account for the organization can convert an - organization event data store to a non-organization event data store, or - convert a non-organization event data store to an organization event - data store. - """ - - retention_period: int | None = None - """ - The retention period of the event data store, in days. If `BillingMode` - is set to `EXTENDABLE_RETENTION_PRICING`, you can set a retention period - of up to 3653 days, the equivalent of 10 years. If `BillingMode` is set - to `FIXED_RETENTION_PRICING`, you can set a retention period of up to - 2557 days, the equivalent of seven years. - - CloudTrail Lake determines whether to retain an event by checking if the - `eventTime` of the event is within the specified retention period. For - example, if you set a retention period of 90 days, CloudTrail will - remove events when the `eventTime` is older than 90 days. - - Note: - If you decrease the retention period of an event data store, CloudTrail - will remove any events with an `eventTime` older than the new retention - period. For example, if the previous retention period was 365 days and - you decrease it to 100 days, CloudTrail will remove events with an - `eventTime` older than 100 days. - """ - - termination_protection_enabled: bool | None = None - """ - Indicates that termination protection is enabled and the event data - store cannot be automatically deleted. - """ - - kms_key_id: str | None = None - """ - Specifies the KMS key ID to use to encrypt the events delivered by - CloudTrail. The value can be an alias name prefixed by `alias/`, a fully - specified ARN to an alias, a fully specified ARN to a key, or a globally - unique identifier. - - Warning: - Disabling or deleting the KMS key, or removing CloudTrail permissions on - the key, prevents CloudTrail from logging events to the event data - store, and prevents users from querying the data in the event data store - that was encrypted with the key. After you associate an event data store - with a KMS key, the KMS key cannot be removed or changed. Before you - disable or delete a KMS key that you are using with an event data store, - delete or back up your event data store. - - CloudTrail also supports KMS multi-Region keys. For more information - about multi-Region keys, see [Using multi-Region - keys](https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html) - in the *Key Management Service Developer Guide*. - - Examples: - - - `alias/MyAliasName` - - - `arn:aws:kms:us-east-2:123456789012:alias/MyAliasName` - - - `arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012` - - - `12345678-1234-1234-1234-123456789012` - """ - - billing_mode: str | None = None - """ - Note: - You can't change the billing mode from `EXTENDABLE_RETENTION_PRICING` - to `FIXED_RETENTION_PRICING`. If `BillingMode` is set to - `EXTENDABLE_RETENTION_PRICING` and you want to use - `FIXED_RETENTION_PRICING` instead, you'll need to stop ingestion on the - event data store and create a new event data store that uses - `FIXED_RETENTION_PRICING`. - - The billing mode for the event data store determines the cost for - ingesting events and the default and maximum retention period for the - event data store. - - The following are the possible values: - - - `EXTENDABLE_RETENTION_PRICING` - This billing mode is generally - recommended if you want a flexible retention period of up to 3653 days - (about 10 years). The default retention period for this billing mode - is 366 days. - - - `FIXED_RETENTION_PRICING` - This billing mode is recommended if you - expect to ingest more than 25 TB of event data per month and need a - retention period of up to 2557 days (about 7 years). The default - retention period for this billing mode is 2557 days. - - For more information about CloudTrail pricing, see [CloudTrail - Pricing](http://aws.amazon.com/cloudtrail/pricing/) and [Managing - CloudTrail Lake - costs](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake-manage-costs.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_EVENT_DATA_STORE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.event_data_store is not None: - serializer.write_string( - _SCHEMA_UPDATE_EVENT_DATA_STORE_INPUT.members["EventDataStore"], - self.event_data_store, - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_UPDATE_EVENT_DATA_STORE_INPUT.members["Name"], self.name - ) - - if self.advanced_event_selectors is not None: - _serialize_advanced_event_selectors( - serializer, - _SCHEMA_UPDATE_EVENT_DATA_STORE_INPUT.members["AdvancedEventSelectors"], - self.advanced_event_selectors, - ) - - if self.multi_region_enabled is not None: - serializer.write_boolean( - _SCHEMA_UPDATE_EVENT_DATA_STORE_INPUT.members["MultiRegionEnabled"], - self.multi_region_enabled, - ) - - if self.organization_enabled is not None: - serializer.write_boolean( - _SCHEMA_UPDATE_EVENT_DATA_STORE_INPUT.members["OrganizationEnabled"], - self.organization_enabled, - ) - - if self.retention_period is not None: - serializer.write_integer( - _SCHEMA_UPDATE_EVENT_DATA_STORE_INPUT.members["RetentionPeriod"], - self.retention_period, - ) - - if self.termination_protection_enabled is not None: - serializer.write_boolean( - _SCHEMA_UPDATE_EVENT_DATA_STORE_INPUT.members[ - "TerminationProtectionEnabled" - ], - self.termination_protection_enabled, - ) - - if self.kms_key_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_EVENT_DATA_STORE_INPUT.members["KmsKeyId"], - self.kms_key_id, - ) - - if self.billing_mode is not None: - serializer.write_string( - _SCHEMA_UPDATE_EVENT_DATA_STORE_INPUT.members["BillingMode"], - self.billing_mode, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["event_data_store"] = de.read_string( - _SCHEMA_UPDATE_EVENT_DATA_STORE_INPUT.members["EventDataStore"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_EVENT_DATA_STORE_INPUT.members["Name"] - ) - - case 2: - kwargs["advanced_event_selectors"] = ( - _deserialize_advanced_event_selectors( - de, - _SCHEMA_UPDATE_EVENT_DATA_STORE_INPUT.members[ - "AdvancedEventSelectors" - ], - ) - ) - - case 3: - kwargs["multi_region_enabled"] = de.read_boolean( - _SCHEMA_UPDATE_EVENT_DATA_STORE_INPUT.members[ - "MultiRegionEnabled" - ] - ) - - case 4: - kwargs["organization_enabled"] = de.read_boolean( - _SCHEMA_UPDATE_EVENT_DATA_STORE_INPUT.members[ - "OrganizationEnabled" - ] - ) - - case 5: - kwargs["retention_period"] = de.read_integer( - _SCHEMA_UPDATE_EVENT_DATA_STORE_INPUT.members["RetentionPeriod"] - ) - - case 6: - kwargs["termination_protection_enabled"] = de.read_boolean( - _SCHEMA_UPDATE_EVENT_DATA_STORE_INPUT.members[ - "TerminationProtectionEnabled" - ] - ) - - case 7: - kwargs["kms_key_id"] = de.read_string( - _SCHEMA_UPDATE_EVENT_DATA_STORE_INPUT.members["KmsKeyId"] - ) - - case 8: - kwargs["billing_mode"] = BillingMode( - de.read_string( - _SCHEMA_UPDATE_EVENT_DATA_STORE_INPUT.members["BillingMode"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_EVENT_DATA_STORE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateEventDataStoreOutput: - """Dataclass for UpdateEventDataStoreOutput structure.""" - - event_data_store_arn: str | None = None - """The ARN of the event data store.""" - - name: str | None = None - """The name of the event data store.""" - - status: str | None = None - """The status of an event data store.""" - - advanced_event_selectors: list[AdvancedEventSelector] | None = None - """The advanced event selectors that are applied to the event data store.""" - - multi_region_enabled: bool | None = None - """ - Indicates whether the event data store includes events from all Regions, - or only from the Region in which it was created. - """ - - organization_enabled: bool | None = None - """ - Indicates whether an event data store is collecting logged events for an - organization in Organizations. - """ - - retention_period: int | None = None - """The retention period, in days.""" - - termination_protection_enabled: bool | None = None - """ - Indicates whether termination protection is enabled for the event data - store. - """ - - created_timestamp: datetime | None = None - """The timestamp that shows when an event data store was first created.""" - - updated_timestamp: datetime | None = None - """ - The timestamp that shows when the event data store was last updated. - `UpdatedTimestamp` is always either the same or newer than the time - shown in `CreatedTimestamp`. - """ - - kms_key_id: str | None = None - """ - Specifies the KMS key ID that encrypts the events delivered by - CloudTrail. The value is a fully specified ARN to a KMS key in the - following format. - - `arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012` - """ - - billing_mode: str | None = None - """The billing mode for the event data store.""" - - federation_status: str | None = None - """ - Indicates the [Lake query - federation](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-federation.html) - status. The status is `ENABLED` if Lake query federation is enabled, or - `DISABLED` if Lake query federation is disabled. You cannot delete an - event data store if the `FederationStatus` is `ENABLED`. - """ - - federation_role_arn: str | None = None - """ - If Lake query federation is enabled, provides the ARN of the federation - role used to access the resources for the federated event data store. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_EVENT_DATA_STORE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.event_data_store_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_EVENT_DATA_STORE_OUTPUT.members["EventDataStoreArn"], - self.event_data_store_arn, - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_UPDATE_EVENT_DATA_STORE_OUTPUT.members["Name"], self.name - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_UPDATE_EVENT_DATA_STORE_OUTPUT.members["Status"], self.status - ) - - if self.advanced_event_selectors is not None: - _serialize_advanced_event_selectors( - serializer, - _SCHEMA_UPDATE_EVENT_DATA_STORE_OUTPUT.members[ - "AdvancedEventSelectors" - ], - self.advanced_event_selectors, - ) - - if self.multi_region_enabled is not None: - serializer.write_boolean( - _SCHEMA_UPDATE_EVENT_DATA_STORE_OUTPUT.members["MultiRegionEnabled"], - self.multi_region_enabled, - ) - - if self.organization_enabled is not None: - serializer.write_boolean( - _SCHEMA_UPDATE_EVENT_DATA_STORE_OUTPUT.members["OrganizationEnabled"], - self.organization_enabled, - ) - - if self.retention_period is not None: - serializer.write_integer( - _SCHEMA_UPDATE_EVENT_DATA_STORE_OUTPUT.members["RetentionPeriod"], - self.retention_period, - ) - - if self.termination_protection_enabled is not None: - serializer.write_boolean( - _SCHEMA_UPDATE_EVENT_DATA_STORE_OUTPUT.members[ - "TerminationProtectionEnabled" - ], - self.termination_protection_enabled, - ) - - if self.created_timestamp is not None: - serializer.write_timestamp( - _SCHEMA_UPDATE_EVENT_DATA_STORE_OUTPUT.members["CreatedTimestamp"], - self.created_timestamp, - ) - - if self.updated_timestamp is not None: - serializer.write_timestamp( - _SCHEMA_UPDATE_EVENT_DATA_STORE_OUTPUT.members["UpdatedTimestamp"], - self.updated_timestamp, - ) - - if self.kms_key_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_EVENT_DATA_STORE_OUTPUT.members["KmsKeyId"], - self.kms_key_id, - ) - - if self.billing_mode is not None: - serializer.write_string( - _SCHEMA_UPDATE_EVENT_DATA_STORE_OUTPUT.members["BillingMode"], - self.billing_mode, - ) - - if self.federation_status is not None: - serializer.write_string( - _SCHEMA_UPDATE_EVENT_DATA_STORE_OUTPUT.members["FederationStatus"], - self.federation_status, - ) - - if self.federation_role_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_EVENT_DATA_STORE_OUTPUT.members["FederationRoleArn"], - self.federation_role_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["event_data_store_arn"] = de.read_string( - _SCHEMA_UPDATE_EVENT_DATA_STORE_OUTPUT.members[ - "EventDataStoreArn" - ] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_EVENT_DATA_STORE_OUTPUT.members["Name"] - ) - - case 2: - kwargs["status"] = EventDataStoreStatus( - de.read_string( - _SCHEMA_UPDATE_EVENT_DATA_STORE_OUTPUT.members["Status"] - ) - ) - - case 3: - kwargs["advanced_event_selectors"] = ( - _deserialize_advanced_event_selectors( - de, - _SCHEMA_UPDATE_EVENT_DATA_STORE_OUTPUT.members[ - "AdvancedEventSelectors" - ], - ) - ) - - case 4: - kwargs["multi_region_enabled"] = de.read_boolean( - _SCHEMA_UPDATE_EVENT_DATA_STORE_OUTPUT.members[ - "MultiRegionEnabled" - ] - ) - - case 5: - kwargs["organization_enabled"] = de.read_boolean( - _SCHEMA_UPDATE_EVENT_DATA_STORE_OUTPUT.members[ - "OrganizationEnabled" - ] - ) - - case 6: - kwargs["retention_period"] = de.read_integer( - _SCHEMA_UPDATE_EVENT_DATA_STORE_OUTPUT.members[ - "RetentionPeriod" - ] - ) - - case 7: - kwargs["termination_protection_enabled"] = de.read_boolean( - _SCHEMA_UPDATE_EVENT_DATA_STORE_OUTPUT.members[ - "TerminationProtectionEnabled" - ] - ) - - case 8: - kwargs["created_timestamp"] = de.read_timestamp( - _SCHEMA_UPDATE_EVENT_DATA_STORE_OUTPUT.members[ - "CreatedTimestamp" - ] - ) - - case 9: - kwargs["updated_timestamp"] = de.read_timestamp( - _SCHEMA_UPDATE_EVENT_DATA_STORE_OUTPUT.members[ - "UpdatedTimestamp" - ] - ) - - case 10: - kwargs["kms_key_id"] = de.read_string( - _SCHEMA_UPDATE_EVENT_DATA_STORE_OUTPUT.members["KmsKeyId"] - ) - - case 11: - kwargs["billing_mode"] = BillingMode( - de.read_string( - _SCHEMA_UPDATE_EVENT_DATA_STORE_OUTPUT.members[ - "BillingMode" - ] - ) - ) - - case 12: - kwargs["federation_status"] = FederationStatus( - de.read_string( - _SCHEMA_UPDATE_EVENT_DATA_STORE_OUTPUT.members[ - "FederationStatus" - ] - ) - ) - - case 13: - kwargs["federation_role_arn"] = de.read_string( - _SCHEMA_UPDATE_EVENT_DATA_STORE_OUTPUT.members[ - "FederationRoleArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_EVENT_DATA_STORE_OUTPUT, consumer=_consumer - ) - return kwargs - - -UPDATE_EVENT_DATA_STORE = APIOperation( - input=UpdateEventDataStoreInput, - output=UpdateEventDataStoreOutput, - schema=_SCHEMA_UPDATE_EVENT_DATA_STORE, - input_schema=_SCHEMA_UPDATE_EVENT_DATA_STORE_INPUT, - output_schema=_SCHEMA_UPDATE_EVENT_DATA_STORE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#CloudTrailAccessNotEnabledException" - ): CloudTrailAccessNotEnabledException, - ShapeID("com.amazonaws.cloudtrail#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreAlreadyExistsException" - ): EventDataStoreAlreadyExistsException, - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreARNInvalidException" - ): EventDataStoreARNInvalidException, - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreHasOngoingImportException" - ): EventDataStoreHasOngoingImportException, - ShapeID( - "com.amazonaws.cloudtrail#EventDataStoreNotFoundException" - ): EventDataStoreNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#InactiveEventDataStoreException" - ): InactiveEventDataStoreException, - ShapeID( - "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException" - ): InsufficientDependencyServiceAccessPermissionException, - ShapeID( - "com.amazonaws.cloudtrail#InsufficientEncryptionPolicyException" - ): InsufficientEncryptionPolicyException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidEventSelectorsException" - ): InvalidEventSelectorsException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidInsightSelectorsException" - ): InvalidInsightSelectorsException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidKmsKeyIdException" - ): InvalidKmsKeyIdException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidParameterException" - ): InvalidParameterException, - ShapeID("com.amazonaws.cloudtrail#KmsException"): KmsException, - ShapeID( - "com.amazonaws.cloudtrail#KmsKeyNotFoundException" - ): KmsKeyNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException" - ): NoManagementAccountSLRExistsException, - ShapeID( - "com.amazonaws.cloudtrail#NotOrganizationMasterAccountException" - ): NotOrganizationMasterAccountException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#OrganizationNotInAllFeaturesModeException" - ): OrganizationNotInAllFeaturesModeException, - ShapeID( - "com.amazonaws.cloudtrail#OrganizationsNotInUseException" - ): OrganizationsNotInUseException, - ShapeID( - "com.amazonaws.cloudtrail#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CLOUD_TRAIL_ACCESS_NOT_ENABLED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_EVENT_DATA_STORE_ALREADY_EXISTS_EXCEPTION, - _SCHEMA_EVENT_DATA_STORE_ARN_INVALID_EXCEPTION, - _SCHEMA_EVENT_DATA_STORE_HAS_ONGOING_IMPORT_EXCEPTION, - _SCHEMA_EVENT_DATA_STORE_NOT_FOUND_EXCEPTION, - _SCHEMA_INACTIVE_EVENT_DATA_STORE_EXCEPTION, - _SCHEMA_INSUFFICIENT_DEPENDENCY_SERVICE_ACCESS_PERMISSION_EXCEPTION, - _SCHEMA_INSUFFICIENT_ENCRYPTION_POLICY_EXCEPTION, - _SCHEMA_INVALID_EVENT_SELECTORS_EXCEPTION, - _SCHEMA_INVALID_INSIGHT_SELECTORS_EXCEPTION, - _SCHEMA_INVALID_KMS_KEY_ID_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_KMS_EXCEPTION, - _SCHEMA_KMS_KEY_NOT_FOUND_EXCEPTION, - _SCHEMA_NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, - _SCHEMA_NOT_ORGANIZATION_MASTER_ACCOUNT_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_ORGANIZATION_NOT_IN_ALL_FEATURES_MODE_EXCEPTION, - _SCHEMA_ORGANIZATIONS_NOT_IN_USE_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, +UPDATE_TRAIL: APIOperation[UpdateTrailInput, UpdateTrailOutput] = APIOperation( + static_schema=_SCHEMA_UPDATE_TRAIL, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cloudtrail#CloudTrailAccessNotEnabledException"), + ShapeID("com.amazonaws.cloudtrail#CloudTrailARNInvalidException"), + ShapeID("com.amazonaws.cloudtrail#CloudTrailInvalidClientTokenIdException"), + ShapeID("com.amazonaws.cloudtrail#CloudWatchLogsDeliveryUnavailableException"), + ShapeID("com.amazonaws.cloudtrail#ConflictException"), + ShapeID( + "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException" + ), + ShapeID("com.amazonaws.cloudtrail#InsufficientEncryptionPolicyException"), + ShapeID("com.amazonaws.cloudtrail#InsufficientS3BucketPolicyException"), + ShapeID("com.amazonaws.cloudtrail#InsufficientSnsTopicPolicyException"), + ShapeID("com.amazonaws.cloudtrail#InvalidCloudWatchLogsLogGroupArnException"), + ShapeID("com.amazonaws.cloudtrail#InvalidCloudWatchLogsRoleArnException"), + ShapeID("com.amazonaws.cloudtrail#InvalidEventSelectorsException"), + ShapeID("com.amazonaws.cloudtrail#InvalidHomeRegionException"), + ShapeID("com.amazonaws.cloudtrail#InvalidKmsKeyIdException"), + ShapeID("com.amazonaws.cloudtrail#InvalidParameterCombinationException"), + ShapeID("com.amazonaws.cloudtrail#InvalidParameterException"), + ShapeID("com.amazonaws.cloudtrail#InvalidS3BucketNameException"), + ShapeID("com.amazonaws.cloudtrail#InvalidS3PrefixException"), + ShapeID("com.amazonaws.cloudtrail#InvalidSnsTopicNameException"), + ShapeID("com.amazonaws.cloudtrail#InvalidTrailNameException"), + ShapeID("com.amazonaws.cloudtrail#KmsException"), + ShapeID("com.amazonaws.cloudtrail#KmsKeyDisabledException"), + ShapeID("com.amazonaws.cloudtrail#KmsKeyNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException"), + ShapeID("com.amazonaws.cloudtrail#NotOrganizationMasterAccountException"), + ShapeID("com.amazonaws.cloudtrail#OperationNotPermittedException"), + ShapeID("com.amazonaws.cloudtrail#OrganizationNotInAllFeaturesModeException"), + ShapeID("com.amazonaws.cloudtrail#OrganizationsNotInUseException"), + ShapeID("com.amazonaws.cloudtrail#S3BucketDoesNotExistException"), + ShapeID("com.amazonaws.cloudtrail#ThrottlingException"), + ShapeID("com.amazonaws.cloudtrail#TrailNotFoundException"), + ShapeID("com.amazonaws.cloudtrail#TrailNotProvidedException"), + ShapeID("com.amazonaws.cloudtrail#UnsupportedOperationException"), ], -) - - -@dataclass(kw_only=True) -class UpdateTrailInput: - """Specifies settings to update for the trail.""" - - name: str | None = None - """ - Specifies the name of the trail or trail ARN. If `Name` is a trail name, - the string must meet the following requirements: - - - Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), - underscores (_), or dashes (-) - - - Start with a letter or number, and end with a letter or number - - - Be between 3 and 128 characters - - - Have no adjacent periods, underscores or dashes. Names like - `my-_namespace` and `my--namespace` are not valid. - - - Not be in IP address format (for example, 192.168.5.4) - - If `Name` is a trail ARN, it must be in the following format. - - `arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail` - """ - - s3_bucket_name: str | None = None - """ - Specifies the name of the Amazon S3 bucket designated for publishing log - files. See [Amazon S3 Bucket naming - rules](https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html). - """ - - s3_key_prefix: str | None = None - """ - Specifies the Amazon S3 key prefix that comes after the name of the - bucket you have designated for log file delivery. For more information, - see [Finding Your CloudTrail Log - Files](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/get-and-view-cloudtrail-log-files.html#cloudtrail-find-log-files). - The maximum length is 200 characters. - """ - - sns_topic_name: str | None = None - """ - Specifies the name or ARN of the Amazon SNS topic defined for - notification of log file delivery. The maximum length is 256 characters. - """ - - include_global_service_events: bool | None = None - """ - Specifies whether the trail is publishing events from global services - such as IAM to the log files. Setting this value to `true` only delivers - global service events to the trail if the trail is multi-Region or if - the trail's home Region is the partition leader Region (for example, - us-east-1). - """ - - is_multi_region_trail: bool | None = None - """ - Specifies whether the trail applies only to the current Region or to all - Regions. The default is false. If the trail exists only in the current - Region and this value is set to true, shadow trails (replications of the - trail) will be created in the other Regions. If the trail exists in all - Regions and this value is set to false, the trail will remain in the - Region where it was created, and its shadow trails in other Regions will - be deleted. As a best practice, consider using trails that log events in - all Regions. - """ - - enable_log_file_validation: bool | None = None - """ - Specifies whether log file validation is enabled. The default is false. - - Note: - When you disable log file integrity validation, the chain of digest - files is broken after one hour. CloudTrail does not create digest files - for log files that were delivered during a period in which log file - integrity validation was disabled. For example, if you enable log file - integrity validation at noon on January 1, disable it at noon on January - 2, and re-enable it at noon on January 10, digest files will not be - created for the log files delivered from noon on January 2 to noon on - January 10. The same applies whenever you stop CloudTrail logging or - delete a trail. - """ - - cloud_watch_logs_log_group_arn: str | None = None - """ - Specifies a log group name using an Amazon Resource Name (ARN), a unique - identifier that represents the log group to which CloudTrail logs are - delivered. You must use a log group that exists in your account. - - Not required unless you specify `CloudWatchLogsRoleArn`. - """ - - cloud_watch_logs_role_arn: str | None = None - """ - Specifies the role for the CloudWatch Logs endpoint to assume to write - to a user's log group. You must use a role that exists in your account. - """ - - kms_key_id: str | None = None - """ - Specifies the KMS key ID to use to encrypt the logs and digest files - delivered by CloudTrail. The value can be an alias name prefixed by - \"alias/\", a fully specified ARN to an alias, a fully specified ARN to - a key, or a globally unique identifier. - - CloudTrail also supports KMS multi-Region keys. For more information - about multi-Region keys, see [Using multi-Region - keys](https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html) - in the *Key Management Service Developer Guide*. - - Examples: - - - alias/MyAliasName - - - arn:aws:kms:us-east-2:123456789012:alias/MyAliasName - - - arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012 - - - 12345678-1234-1234-1234-123456789012 - """ - - is_organization_trail: bool | None = None - """ - Specifies whether the trail is applied to all accounts in an - organization in Organizations, or only for the current Amazon Web - Services account. The default is false, and cannot be true unless the - call is made on behalf of an Amazon Web Services account that is the - management account for an organization in Organizations. If the trail is - not an organization trail and this is set to `true`, the trail will be - created in all Amazon Web Services accounts that belong to the - organization. If the trail is an organization trail and this is set to - `false`, the trail will remain in the current Amazon Web Services - account but be deleted from all member accounts in the organization. - - Note: - Only the management account for the organization can convert an - organization trail to a non-organization trail, or convert a - non-organization trail to an organization trail. - """ - - recursive_logging: bool | None = None - """ - Specifies whether recursive logging is enabled for the trail. If you set - `RecursiveLogging` to `false`, CloudTrail suppresses events generated by - CloudTrail when it delivers log files to your trail's destinations, - including Amazon S3 and CloudWatch Logs. The default value is `true`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_TRAIL_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_UPDATE_TRAIL_INPUT.members["Name"], self.name - ) - - if self.s3_bucket_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_TRAIL_INPUT.members["S3BucketName"], self.s3_bucket_name - ) - - if self.s3_key_prefix is not None: - serializer.write_string( - _SCHEMA_UPDATE_TRAIL_INPUT.members["S3KeyPrefix"], self.s3_key_prefix - ) - - if self.sns_topic_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_TRAIL_INPUT.members["SnsTopicName"], self.sns_topic_name - ) - - if self.include_global_service_events is not None: - serializer.write_boolean( - _SCHEMA_UPDATE_TRAIL_INPUT.members["IncludeGlobalServiceEvents"], - self.include_global_service_events, - ) - - if self.is_multi_region_trail is not None: - serializer.write_boolean( - _SCHEMA_UPDATE_TRAIL_INPUT.members["IsMultiRegionTrail"], - self.is_multi_region_trail, - ) - - if self.enable_log_file_validation is not None: - serializer.write_boolean( - _SCHEMA_UPDATE_TRAIL_INPUT.members["EnableLogFileValidation"], - self.enable_log_file_validation, - ) - - if self.cloud_watch_logs_log_group_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_TRAIL_INPUT.members["CloudWatchLogsLogGroupArn"], - self.cloud_watch_logs_log_group_arn, - ) - - if self.cloud_watch_logs_role_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_TRAIL_INPUT.members["CloudWatchLogsRoleArn"], - self.cloud_watch_logs_role_arn, - ) - - if self.kms_key_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_TRAIL_INPUT.members["KmsKeyId"], self.kms_key_id - ) - - if self.is_organization_trail is not None: - serializer.write_boolean( - _SCHEMA_UPDATE_TRAIL_INPUT.members["IsOrganizationTrail"], - self.is_organization_trail, - ) - - if self.recursive_logging is not None: - serializer.write_boolean( - _SCHEMA_UPDATE_TRAIL_INPUT.members["RecursiveLogging"], - self.recursive_logging, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_TRAIL_INPUT.members["Name"] - ) - - case 1: - kwargs["s3_bucket_name"] = de.read_string( - _SCHEMA_UPDATE_TRAIL_INPUT.members["S3BucketName"] - ) - - case 2: - kwargs["s3_key_prefix"] = de.read_string( - _SCHEMA_UPDATE_TRAIL_INPUT.members["S3KeyPrefix"] - ) - - case 3: - kwargs["sns_topic_name"] = de.read_string( - _SCHEMA_UPDATE_TRAIL_INPUT.members["SnsTopicName"] - ) - - case 4: - kwargs["include_global_service_events"] = de.read_boolean( - _SCHEMA_UPDATE_TRAIL_INPUT.members["IncludeGlobalServiceEvents"] - ) - - case 5: - kwargs["is_multi_region_trail"] = de.read_boolean( - _SCHEMA_UPDATE_TRAIL_INPUT.members["IsMultiRegionTrail"] - ) - - case 6: - kwargs["enable_log_file_validation"] = de.read_boolean( - _SCHEMA_UPDATE_TRAIL_INPUT.members["EnableLogFileValidation"] - ) - - case 7: - kwargs["cloud_watch_logs_log_group_arn"] = de.read_string( - _SCHEMA_UPDATE_TRAIL_INPUT.members["CloudWatchLogsLogGroupArn"] - ) - - case 8: - kwargs["cloud_watch_logs_role_arn"] = de.read_string( - _SCHEMA_UPDATE_TRAIL_INPUT.members["CloudWatchLogsRoleArn"] - ) - - case 9: - kwargs["kms_key_id"] = de.read_string( - _SCHEMA_UPDATE_TRAIL_INPUT.members["KmsKeyId"] - ) - - case 10: - kwargs["is_organization_trail"] = de.read_boolean( - _SCHEMA_UPDATE_TRAIL_INPUT.members["IsOrganizationTrail"] - ) - - case 11: - kwargs["recursive_logging"] = de.read_boolean( - _SCHEMA_UPDATE_TRAIL_INPUT.members["RecursiveLogging"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_TRAIL_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateTrailOutput: - """ - Returns the objects or data listed below if successful. Otherwise, - returns an error. - """ - - name: str | None = None - """Specifies the name of the trail.""" - - s3_bucket_name: str | None = None - """ - Specifies the name of the Amazon S3 bucket designated for publishing log - files. - """ - - s3_key_prefix: str | None = None - """ - Specifies the Amazon S3 key prefix that comes after the name of the - bucket you have designated for log file delivery. For more information, - see [Finding Your IAM Log - Files](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/get-and-view-cloudtrail-log-files.html#cloudtrail-find-log-files). - """ - - sns_topic_name: str | None = None - """This field is no longer in use. Use `SnsTopicARN`.""" - - sns_topic_arn: str | None = None - """ - Specifies the ARN of the Amazon SNS topic that CloudTrail uses to send - notifications when log files are delivered. The following is the format - of a topic ARN. - - `arn:aws:sns:us-east-2:123456789012:MyTopic` - """ - - include_global_service_events: bool | None = None - """ - Specifies whether the trail is publishing events from global services - such as IAM to the log files. Setting this value to `true` only delivers - global service events to the trail if the trail is multi-Region or if - the trail's home Region is the partition leader Region (for example, - us-east-1). - """ - - is_multi_region_trail: bool | None = None - """Specifies whether the trail exists in one Region or in all Regions.""" - - trail_arn: str | None = None - """ - Specifies the ARN of the trail that was updated. The following is the - format of a trail ARN. - - `arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail` - """ - - log_file_validation_enabled: bool | None = None - """Specifies whether log file integrity validation is enabled.""" - - cloud_watch_logs_log_group_arn: str | None = None - """ - Specifies the Amazon Resource Name (ARN) of the log group to which - CloudTrail logs are delivered. - """ - - cloud_watch_logs_role_arn: str | None = None - """ - Specifies the role for the CloudWatch Logs endpoint to assume to write - to a user's log group. - """ - - kms_key_id: str | None = None - """ - Specifies the KMS key ID that encrypts the logs and digest files - delivered by CloudTrail. The value is a fully specified ARN to a KMS key - in the following format. - - `arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012` - """ - - is_organization_trail: bool | None = None - """Specifies whether the trail is an organization trail.""" - - recursive_logging: bool | None = None - """Specifies whether recursive logging is enabled for the trail.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_TRAIL_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_UPDATE_TRAIL_OUTPUT.members["Name"], self.name - ) - - if self.s3_bucket_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_TRAIL_OUTPUT.members["S3BucketName"], self.s3_bucket_name - ) - - if self.s3_key_prefix is not None: - serializer.write_string( - _SCHEMA_UPDATE_TRAIL_OUTPUT.members["S3KeyPrefix"], self.s3_key_prefix - ) - - if self.sns_topic_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_TRAIL_OUTPUT.members["SnsTopicName"], self.sns_topic_name - ) - - if self.sns_topic_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_TRAIL_OUTPUT.members["SnsTopicARN"], self.sns_topic_arn - ) - - if self.include_global_service_events is not None: - serializer.write_boolean( - _SCHEMA_UPDATE_TRAIL_OUTPUT.members["IncludeGlobalServiceEvents"], - self.include_global_service_events, - ) - - if self.is_multi_region_trail is not None: - serializer.write_boolean( - _SCHEMA_UPDATE_TRAIL_OUTPUT.members["IsMultiRegionTrail"], - self.is_multi_region_trail, - ) - - if self.trail_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_TRAIL_OUTPUT.members["TrailARN"], self.trail_arn - ) - - if self.log_file_validation_enabled is not None: - serializer.write_boolean( - _SCHEMA_UPDATE_TRAIL_OUTPUT.members["LogFileValidationEnabled"], - self.log_file_validation_enabled, - ) - - if self.cloud_watch_logs_log_group_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_TRAIL_OUTPUT.members["CloudWatchLogsLogGroupArn"], - self.cloud_watch_logs_log_group_arn, - ) - - if self.cloud_watch_logs_role_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_TRAIL_OUTPUT.members["CloudWatchLogsRoleArn"], - self.cloud_watch_logs_role_arn, - ) - - if self.kms_key_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_TRAIL_OUTPUT.members["KmsKeyId"], self.kms_key_id - ) - - if self.is_organization_trail is not None: - serializer.write_boolean( - _SCHEMA_UPDATE_TRAIL_OUTPUT.members["IsOrganizationTrail"], - self.is_organization_trail, - ) - - if self.recursive_logging is not None: - serializer.write_boolean( - _SCHEMA_UPDATE_TRAIL_OUTPUT.members["RecursiveLogging"], - self.recursive_logging, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_TRAIL_OUTPUT.members["Name"] - ) - - case 1: - kwargs["s3_bucket_name"] = de.read_string( - _SCHEMA_UPDATE_TRAIL_OUTPUT.members["S3BucketName"] - ) - - case 2: - kwargs["s3_key_prefix"] = de.read_string( - _SCHEMA_UPDATE_TRAIL_OUTPUT.members["S3KeyPrefix"] - ) - - case 3: - kwargs["sns_topic_name"] = de.read_string( - _SCHEMA_UPDATE_TRAIL_OUTPUT.members["SnsTopicName"] - ) - - case 4: - kwargs["sns_topic_arn"] = de.read_string( - _SCHEMA_UPDATE_TRAIL_OUTPUT.members["SnsTopicARN"] - ) - - case 5: - kwargs["include_global_service_events"] = de.read_boolean( - _SCHEMA_UPDATE_TRAIL_OUTPUT.members[ - "IncludeGlobalServiceEvents" - ] - ) - - case 6: - kwargs["is_multi_region_trail"] = de.read_boolean( - _SCHEMA_UPDATE_TRAIL_OUTPUT.members["IsMultiRegionTrail"] - ) - - case 7: - kwargs["trail_arn"] = de.read_string( - _SCHEMA_UPDATE_TRAIL_OUTPUT.members["TrailARN"] - ) - - case 8: - kwargs["log_file_validation_enabled"] = de.read_boolean( - _SCHEMA_UPDATE_TRAIL_OUTPUT.members["LogFileValidationEnabled"] - ) - - case 9: - kwargs["cloud_watch_logs_log_group_arn"] = de.read_string( - _SCHEMA_UPDATE_TRAIL_OUTPUT.members["CloudWatchLogsLogGroupArn"] - ) - - case 10: - kwargs["cloud_watch_logs_role_arn"] = de.read_string( - _SCHEMA_UPDATE_TRAIL_OUTPUT.members["CloudWatchLogsRoleArn"] - ) - - case 11: - kwargs["kms_key_id"] = de.read_string( - _SCHEMA_UPDATE_TRAIL_OUTPUT.members["KmsKeyId"] - ) - - case 12: - kwargs["is_organization_trail"] = de.read_boolean( - _SCHEMA_UPDATE_TRAIL_OUTPUT.members["IsOrganizationTrail"] - ) - - case 13: - kwargs["recursive_logging"] = de.read_boolean( - _SCHEMA_UPDATE_TRAIL_OUTPUT.members["RecursiveLogging"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_TRAIL_OUTPUT, consumer=_consumer) - return kwargs - - -UPDATE_TRAIL = APIOperation( - input=UpdateTrailInput, - output=UpdateTrailOutput, - schema=_SCHEMA_UPDATE_TRAIL, - input_schema=_SCHEMA_UPDATE_TRAIL_INPUT, - output_schema=_SCHEMA_UPDATE_TRAIL_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cloudtrail#CloudTrailAccessNotEnabledException" - ): CloudTrailAccessNotEnabledException, - ShapeID( - "com.amazonaws.cloudtrail#CloudTrailARNInvalidException" - ): CloudTrailARNInvalidException, - ShapeID( - "com.amazonaws.cloudtrail#CloudTrailInvalidClientTokenIdException" - ): CloudTrailInvalidClientTokenIdException, - ShapeID( - "com.amazonaws.cloudtrail#CloudWatchLogsDeliveryUnavailableException" - ): CloudWatchLogsDeliveryUnavailableException, - ShapeID("com.amazonaws.cloudtrail#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.cloudtrail#InsufficientDependencyServiceAccessPermissionException" - ): InsufficientDependencyServiceAccessPermissionException, - ShapeID( - "com.amazonaws.cloudtrail#InsufficientEncryptionPolicyException" - ): InsufficientEncryptionPolicyException, - ShapeID( - "com.amazonaws.cloudtrail#InsufficientS3BucketPolicyException" - ): InsufficientS3BucketPolicyException, - ShapeID( - "com.amazonaws.cloudtrail#InsufficientSnsTopicPolicyException" - ): InsufficientSnsTopicPolicyException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidCloudWatchLogsLogGroupArnException" - ): InvalidCloudWatchLogsLogGroupArnException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidCloudWatchLogsRoleArnException" - ): InvalidCloudWatchLogsRoleArnException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidEventSelectorsException" - ): InvalidEventSelectorsException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidHomeRegionException" - ): InvalidHomeRegionException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidKmsKeyIdException" - ): InvalidKmsKeyIdException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidParameterCombinationException" - ): InvalidParameterCombinationException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidS3BucketNameException" - ): InvalidS3BucketNameException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidS3PrefixException" - ): InvalidS3PrefixException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidSnsTopicNameException" - ): InvalidSnsTopicNameException, - ShapeID( - "com.amazonaws.cloudtrail#InvalidTrailNameException" - ): InvalidTrailNameException, - ShapeID("com.amazonaws.cloudtrail#KmsException"): KmsException, - ShapeID( - "com.amazonaws.cloudtrail#KmsKeyDisabledException" - ): KmsKeyDisabledException, - ShapeID( - "com.amazonaws.cloudtrail#KmsKeyNotFoundException" - ): KmsKeyNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#NoManagementAccountSLRExistsException" - ): NoManagementAccountSLRExistsException, - ShapeID( - "com.amazonaws.cloudtrail#NotOrganizationMasterAccountException" - ): NotOrganizationMasterAccountException, - ShapeID( - "com.amazonaws.cloudtrail#OperationNotPermittedException" - ): OperationNotPermittedException, - ShapeID( - "com.amazonaws.cloudtrail#OrganizationNotInAllFeaturesModeException" - ): OrganizationNotInAllFeaturesModeException, - ShapeID( - "com.amazonaws.cloudtrail#OrganizationsNotInUseException" - ): OrganizationsNotInUseException, - ShapeID( - "com.amazonaws.cloudtrail#S3BucketDoesNotExistException" - ): S3BucketDoesNotExistException, - ShapeID( - "com.amazonaws.cloudtrail#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.cloudtrail#TrailNotFoundException" - ): TrailNotFoundException, - ShapeID( - "com.amazonaws.cloudtrail#TrailNotProvidedException" - ): TrailNotProvidedException, - ShapeID( - "com.amazonaws.cloudtrail#UnsupportedOperationException" - ): UnsupportedOperationException, - } - ), effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CLOUD_TRAIL_ACCESS_NOT_ENABLED_EXCEPTION, - _SCHEMA_CLOUD_TRAIL_ARN_INVALID_EXCEPTION, - _SCHEMA_CLOUD_TRAIL_INVALID_CLIENT_TOKEN_ID_EXCEPTION, - _SCHEMA_CLOUD_WATCH_LOGS_DELIVERY_UNAVAILABLE_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INSUFFICIENT_DEPENDENCY_SERVICE_ACCESS_PERMISSION_EXCEPTION, - _SCHEMA_INSUFFICIENT_ENCRYPTION_POLICY_EXCEPTION, - _SCHEMA_INSUFFICIENT_S3_BUCKET_POLICY_EXCEPTION, - _SCHEMA_INSUFFICIENT_SNS_TOPIC_POLICY_EXCEPTION, - _SCHEMA_INVALID_CLOUD_WATCH_LOGS_LOG_GROUP_ARN_EXCEPTION, - _SCHEMA_INVALID_CLOUD_WATCH_LOGS_ROLE_ARN_EXCEPTION, - _SCHEMA_INVALID_EVENT_SELECTORS_EXCEPTION, - _SCHEMA_INVALID_HOME_REGION_EXCEPTION, - _SCHEMA_INVALID_KMS_KEY_ID_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_COMBINATION_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_INVALID_S3_BUCKET_NAME_EXCEPTION, - _SCHEMA_INVALID_S3_PREFIX_EXCEPTION, - _SCHEMA_INVALID_SNS_TOPIC_NAME_EXCEPTION, - _SCHEMA_INVALID_TRAIL_NAME_EXCEPTION, - _SCHEMA_KMS_EXCEPTION, - _SCHEMA_KMS_KEY_DISABLED_EXCEPTION, - _SCHEMA_KMS_KEY_NOT_FOUND_EXCEPTION, - _SCHEMA_NO_MANAGEMENT_ACCOUNT_SLR_EXISTS_EXCEPTION, - _SCHEMA_NOT_ORGANIZATION_MASTER_ACCOUNT_EXCEPTION, - _SCHEMA_OPERATION_NOT_PERMITTED_EXCEPTION, - _SCHEMA_ORGANIZATION_NOT_IN_ALL_FEATURES_MODE_EXCEPTION, - _SCHEMA_ORGANIZATIONS_NOT_IN_USE_EXCEPTION, - _SCHEMA_S3_BUCKET_DOES_NOT_EXIST_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_TRAIL_NOT_FOUND_EXCEPTION, - _SCHEMA_TRAIL_NOT_PROVIDED_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION_EXCEPTION, - ], ) diff --git a/clients/aws-sdk-cloudtrail/src/aws_sdk_cloudtrail/models.pyi b/clients/aws-sdk-cloudtrail/src/aws_sdk_cloudtrail/models.pyi new file mode 100644 index 00000000..dd2688ed --- /dev/null +++ b/clients/aws-sdk-cloudtrail/src/aws_sdk_cloudtrail/models.pyi @@ -0,0 +1,5970 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. + +from dataclasses import dataclass +from datetime import datetime +from enum import StrEnum +from typing import Self + +from smithy_core.deserializers import ShapeDeserializer +from smithy_core.exceptions import ModeledError +from smithy_core.response import ResponseMetadata +from smithy_core.schemas import APIOperation +from smithy_core.serializers import ShapeSerializer +from smithy_core.types import UnknownEnumMixin + +class _SerdeShape: + def serialize(self, serializer: ShapeSerializer) -> None: ... + def serialize_members(self, serializer: ShapeSerializer) -> None: ... + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: ... + +class ServiceError(ModeledError): + """ + Base error for all errors in the service. + + Some exceptions do not extend from this class, including + synthetic, implicit, and shared exception types. + """ + +@dataclass(kw_only=True) +class AccessDeniedException(ServiceError, _SerdeShape): + """You do not have sufficient access to perform this action.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class AccountHasOngoingImportException(ServiceError, _SerdeShape): + """ + This exception is thrown when you start a new import and a previous + import is still in progress. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class AccountNotFoundException(ServiceError, _SerdeShape): + """ + This exception is thrown when the specified account is not found or not + part of an organization. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class AccountNotRegisteredException(ServiceError, _SerdeShape): + """ + This exception is thrown when the specified account is not registered as + the CloudTrail delegated administrator. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class AccountRegisteredException(ServiceError, _SerdeShape): + """ + This exception is thrown when the account is already registered as the + CloudTrail delegated administrator. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class AddTagsInput(_SerdeShape): + """ + Specifies the tags to add to a trail, event data store, dashboard, or + channel. + """ + + resource_id: str | None = ... + """ + Specifies the ARN of the trail, event data store, dashboard, or channel + to which one or more tags will be added. + + The format of a trail ARN is: + `arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail` + + The format of an event data store ARN is: + `arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE` + + The format of a dashboard ARN is: + `arn:aws:cloudtrail:us-east-1:123456789012:dashboard/exampleDash` + + The format of a channel ARN is: + `arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890` + """ + tags_list: list[Tag] | None = ... + """Contains a list of tags, up to a limit of 50""" + +@dataclass(kw_only=True) +class AddTagsOutput(_SerdeShape): + """Returns the objects or data if successful. Otherwise, returns an error.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class AdvancedEventSelector(_SerdeShape): + """ + Advanced event selectors let you create fine-grained selectors for + CloudTrail management, data, and network activity events. They help you + control costs by logging only those events that are important to you. + For more information about configuring advanced event selectors, see the + [Logging data + events](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html), + [Logging network activity + events](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-network-events-with-cloudtrail.html), + and [Logging management + events](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-management-events-with-cloudtrail.html) + topics in the *CloudTrail User Guide*. + + You cannot apply both event selectors and advanced event selectors to a + trail. + + For information about configurable advanced event selector fields, see + [AdvancedEventSelector](https://docs.aws.amazon.com/awscloudtrail/latest/APIReference/API_AdvancedEventSelector.html) + in the *CloudTrail API Reference*. + """ + + name: str | None = ... + """ + An optional, descriptive name for an advanced event selector, such as + \"Log data events for only two S3 buckets\". + """ + field_selectors: list[AdvancedFieldSelector] + """Contains all selector statements in an advanced event selector.""" + +@dataclass(kw_only=True) +class AdvancedFieldSelector(_SerdeShape): + """A single selector statement in an advanced event selector.""" + + field: str + """ + A field in a CloudTrail event record on which to filter events to be + logged. For event data stores for CloudTrail Insights events, Config + configuration items, Audit Manager evidence, or events outside of Amazon + Web Services, the field is used only for selecting events as filtering + is not supported. + + For more information, see + [AdvancedFieldSelector](https://docs.aws.amazon.com/awscloudtrail/latest/APIReference/API_AdvancedFieldSelector.html) + in the *CloudTrail API Reference*. + + Note: + Selectors don't support the use of wildcards like `*` . To match + multiple values with a single condition, you may use `StartsWith`, + `EndsWith`, `NotStartsWith`, or `NotEndsWith` to explicitly match the + beginning or end of the event field. + """ + equals: list[str] | None = ... + """ + An operator that includes events that match the exact value of the event + record field specified as the value of `Field`. This is the only valid + operator that you can use with the `readOnly`, `eventCategory`, and + `resources.type` fields. + """ + starts_with: list[str] | None = ... + """ + An operator that includes events that match the first few characters of + the event record field specified as the value of `Field`. + """ + ends_with: list[str] | None = ... + """ + An operator that includes events that match the last few characters of + the event record field specified as the value of `Field`. + """ + not_equals: list[str] | None = ... + """ + An operator that excludes events that match the exact value of the event + record field specified as the value of `Field`. + """ + not_starts_with: list[str] | None = ... + """ + An operator that excludes events that match the first few characters of + the event record field specified as the value of `Field`. + """ + not_ends_with: list[str] | None = ... + """ + An operator that excludes events that match the last few characters of + the event record field specified as the value of `Field`. + """ + +@dataclass(kw_only=True) +class AggregationConfiguration(_SerdeShape): + """An object that contains configuration settings for aggregating events.""" + + templates: list[str] + """ + A list of aggregation templates that can be used to configure event + aggregation. + """ + event_category: str + """Specifies the event category for which aggregation should be performed.""" + +class BillingMode(UnknownEnumMixin, StrEnum): + EXTENDABLE_RETENTION_PRICING = "EXTENDABLE_RETENTION_PRICING" + FIXED_RETENTION_PRICING = "FIXED_RETENTION_PRICING" + +@dataclass(kw_only=True) +class CancelQueryInput(_SerdeShape): + """Dataclass for CancelQueryInput structure.""" + + event_data_store: str | None = ... + """ + The ARN (or the ID suffix of the ARN) of an event data store on which + the specified query is running. + """ + query_id: str | None = ... + """ + The ID of the query that you want to cancel. The `QueryId` comes from + the response of a `StartQuery` operation. + """ + event_data_store_owner_account_id: str | None = ... + """The account ID of the event data store owner.""" + +@dataclass(kw_only=True) +class CancelQueryOutput(_SerdeShape): + """Dataclass for CancelQueryOutput structure.""" + + query_id: str + """The ID of the canceled query.""" + query_status: str + """ + Shows the status of a query after a `CancelQuery` request. Typically, + the values shown are either `RUNNING` or `CANCELLED`. + """ + event_data_store_owner_account_id: str | None = ... + """The account ID of the event data store owner.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CannotDelegateManagementAccountException(ServiceError, _SerdeShape): + """ + This exception is thrown when the management account of an organization + is registered as the CloudTrail delegated administrator. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class Channel(_SerdeShape): + """Contains information about a returned CloudTrail channel.""" + + channel_arn: str | None = ... + """The Amazon Resource Name (ARN) of a channel.""" + name: str | None = ... + """ + The name of the CloudTrail channel. For service-linked channels, the + name is `aws-service-channel/service-name/custom-suffix` where + `service-name` represents the name of the Amazon Web Services service + that created the channel and `custom-suffix` represents the suffix + created by the Amazon Web Services service. + """ + +@dataclass(kw_only=True) +class ChannelAlreadyExistsException(ServiceError, _SerdeShape): + """This exception is thrown when the provided channel already exists.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ChannelARNInvalidException(ServiceError, _SerdeShape): + """ + This exception is thrown when the specified value of `ChannelARN` is not + valid. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ChannelExistsForEDSException(ServiceError, _SerdeShape): + """ + This exception is thrown when the specified event data store cannot yet + be deleted because it is in use by a channel. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ChannelMaxLimitExceededException(ServiceError, _SerdeShape): + """ + This exception is thrown when the maximum number of channels limit is + exceeded. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ChannelNotFoundException(ServiceError, _SerdeShape): + """ + This exception is thrown when CloudTrail cannot find the specified + channel. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CloudTrailAccessNotEnabledException(ServiceError, _SerdeShape): + """ + This exception is thrown when trusted access has not been enabled + between CloudTrail and Organizations. For more information, see [How to + enable or disable trusted + access](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html#orgs_how-to-enable-disable-trusted-access) + in the *Organizations User Guide* and [Prepare For Creating a Trail For + Your + Organization](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html) + in the *CloudTrail User Guide*. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CloudTrailARNInvalidException(ServiceError, _SerdeShape): + """ + This exception is thrown when an operation is called with an ARN that is + not valid. + + The following is the format of a trail ARN: + `arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail` + + The following is the format of an event data store ARN: + `arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE` + + The following is the format of a dashboard ARN: + `arn:aws:cloudtrail:us-east-1:123456789012:dashboard/exampleDash` + + The following is the format of a channel ARN: + `arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890` + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CloudTrailInvalidClientTokenIdException(ServiceError, _SerdeShape): + """ + This exception is thrown when a call results in the + `InvalidClientTokenId` error code. This can occur when you are creating + or updating a trail to send notifications to an Amazon SNS topic that is + in a suspended Amazon Web Services account. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CloudWatchLogsDeliveryUnavailableException(ServiceError, _SerdeShape): + """Cannot set a CloudWatch Logs delivery for this Region.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ConcurrentModificationException(ServiceError, _SerdeShape): + """ + You are trying to update a resource when another request is in progress. + Allow sufficient wait time for the previous request to complete, then + retry your request. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ConflictException(ServiceError, _SerdeShape): + """ + This exception is thrown when the specified resource is not ready for an + operation. This can occur when you try to run an operation on a resource + before CloudTrail has time to fully load the resource, or because + another operation is modifying the resource. If this exception occurs, + wait a few minutes, and then try the operation again. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ContextKeySelector(_SerdeShape): + """ + An object that contains information types to be included in CloudTrail + enriched events. + """ + + type: str + """ + Specifies the type of the event record field in ContextKeySelector. + Valid values include RequestContext, TagContext. + """ + equals: list[str] + """ + A list of keys defined by Type to be included in CloudTrail enriched + events. + """ + +@dataclass(kw_only=True) +class CreateChannelInput(_SerdeShape): + """Dataclass for CreateChannelInput structure.""" + + name: str | None = ... + """The name of the channel.""" + source: str | None = ... + """ + The name of the partner or external event source. You cannot change this + name after you create the channel. A maximum of one channel is allowed + per source. + + A source can be either `Custom` for all valid non-Amazon Web Services + events, or the name of a partner event source. For information about the + source names for available partners, see [Additional information about + integration + partners](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-event-data-store-integration.html#cloudtrail-lake-partner-information) + in the CloudTrail User Guide. + """ + destinations: list[Destination] | None = ... + """ + One or more event data stores to which events arriving through a channel + will be logged. + """ + tags: list[Tag] | None = ... + """A list of tags.""" + +@dataclass(kw_only=True) +class CreateChannelOutput(_SerdeShape): + """Dataclass for CreateChannelOutput structure.""" + + channel_arn: str | None = ... + """The Amazon Resource Name (ARN) of the new channel.""" + name: str | None = ... + """The name of the new channel.""" + source: str | None = ... + """The partner or external event source name.""" + destinations: list[Destination] | None = ... + """The event data stores that log the events arriving through the channel.""" + tags: list[Tag] | None = ... + """A list of tags.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateDashboardInput(_SerdeShape): + """Dataclass for CreateDashboardInput structure.""" + + name: str | None = ... + """ + The name of the dashboard. The name must be unique to your account. + + To create the Highlights dashboard, the name must be + `AWSCloudTrail-Highlights`. + """ + refresh_schedule: RefreshSchedule | None = ... + """ + The refresh schedule configuration for the dashboard. + + To create the Highlights dashboard, you must set a refresh schedule and + set the `Status` to `ENABLED`. The `Unit` for the refresh schedule must + be `HOURS` and the `Value` must be `6`. + """ + tags_list: list[Tag] | None = ... + """A list of tags.""" + termination_protection_enabled: bool | None = ... + """ + Specifies whether termination protection is enabled for the dashboard. + If termination protection is enabled, you cannot delete the dashboard + until termination protection is disabled. + """ + widgets: list[RequestWidget] | None = ... + """ + An array of widgets for a custom dashboard. A custom dashboard can have + a maximum of ten widgets. + + You do not need to specify widgets for the Highlights dashboard. + """ + +@dataclass(kw_only=True) +class CreateDashboardOutput(_SerdeShape): + """Dataclass for CreateDashboardOutput structure.""" + + dashboard_arn: str | None = ... + """The ARN for the dashboard.""" + name: str | None = ... + """The name of the dashboard.""" + type: str | None = ... + """The dashboard type.""" + widgets: list[Widget] | None = ... + """An array of widgets for the dashboard.""" + tags_list: list[Tag] | None = ... + """A list of tags.""" + refresh_schedule: RefreshSchedule | None = ... + """The refresh schedule for the dashboard, if configured.""" + termination_protection_enabled: bool | None = ... + """Indicates whether termination protection is enabled for the dashboard.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateEventDataStoreInput(_SerdeShape): + """Dataclass for CreateEventDataStoreInput structure.""" + + name: str | None = ... + """The name of the event data store.""" + advanced_event_selectors: list[AdvancedEventSelector] | None = ... + """ + The advanced event selectors to use to select the events for the data + store. You can configure up to five advanced event selectors for each + event data store. + + For more information about how to use advanced event selectors to log + CloudTrail events, see [Log events by using advanced event + selectors](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html#creating-data-event-selectors-advanced) + in the CloudTrail User Guide. + + For more information about how to use advanced event selectors to + include Config configuration items in your event data store, see [Create + an event data store for Config configuration + items](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/lake-eds-cli.html#lake-cli-create-eds-config) + in the CloudTrail User Guide. + + For more information about how to use advanced event selectors to + include events outside of Amazon Web Services events in your event data + store, see [Create an integration to log events from outside Amazon Web + Services](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/lake-integrations-cli.html#lake-cli-create-integration) + in the CloudTrail User Guide. + """ + multi_region_enabled: bool | None = ... + """ + Specifies whether the event data store includes events from all Regions, + or only from the Region in which the event data store is created. + """ + organization_enabled: bool | None = ... + """ + Specifies whether an event data store collects events logged for an + organization in Organizations. + """ + retention_period: int | None = ... + """ + The retention period of the event data store, in days. If `BillingMode` + is set to `EXTENDABLE_RETENTION_PRICING`, you can set a retention period + of up to 3653 days, the equivalent of 10 years. If `BillingMode` is set + to `FIXED_RETENTION_PRICING`, you can set a retention period of up to + 2557 days, the equivalent of seven years. + + CloudTrail Lake determines whether to retain an event by checking if the + `eventTime` of the event is within the specified retention period. For + example, if you set a retention period of 90 days, CloudTrail will + remove events when the `eventTime` is older than 90 days. + + Note: + If you plan to copy trail events to this event data store, we recommend + that you consider both the age of the events that you want to copy as + well as how long you want to keep the copied events in your event data + store. For example, if you copy trail events that are 5 years old and + specify a retention period of 7 years, the event data store will retain + those events for two years. + """ + termination_protection_enabled: bool | None = ... + """ + Specifies whether termination protection is enabled for the event data + store. If termination protection is enabled, you cannot delete the event + data store until termination protection is disabled. + """ + tags_list: list[Tag] | None = ... + """A list of tags.""" + kms_key_id: str | None = ... + """ + Specifies the KMS key ID to use to encrypt the events delivered by + CloudTrail. The value can be an alias name prefixed by `alias/`, a fully + specified ARN to an alias, a fully specified ARN to a key, or a globally + unique identifier. + + Warning: + Disabling or deleting the KMS key, or removing CloudTrail permissions on + the key, prevents CloudTrail from logging events to the event data + store, and prevents users from querying the data in the event data store + that was encrypted with the key. After you associate an event data store + with a KMS key, the KMS key cannot be removed or changed. Before you + disable or delete a KMS key that you are using with an event data store, + delete or back up your event data store. + + CloudTrail also supports KMS multi-Region keys. For more information + about multi-Region keys, see [Using multi-Region + keys](https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html) + in the *Key Management Service Developer Guide*. + + Examples: + + - `alias/MyAliasName` + + - `arn:aws:kms:us-east-2:123456789012:alias/MyAliasName` + + - `arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012` + + - `12345678-1234-1234-1234-123456789012` + """ + start_ingestion: bool | None = ... + """ + Specifies whether the event data store should start ingesting live + events. The default is true. + """ + billing_mode: str | None = ... + """ + The billing mode for the event data store determines the cost for + ingesting events and the default and maximum retention period for the + event data store. + + The following are the possible values: + + - `EXTENDABLE_RETENTION_PRICING` - This billing mode is generally + recommended if you want a flexible retention period of up to 3653 days + (about 10 years). The default retention period for this billing mode + is 366 days. + + - `FIXED_RETENTION_PRICING` - This billing mode is recommended if you + expect to ingest more than 25 TB of event data per month and need a + retention period of up to 2557 days (about 7 years). The default + retention period for this billing mode is 2557 days. + + The default value is `EXTENDABLE_RETENTION_PRICING`. + + For more information about CloudTrail pricing, see [CloudTrail + Pricing](http://aws.amazon.com/cloudtrail/pricing/) and [Managing + CloudTrail Lake + costs](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake-manage-costs.html). + """ + +@dataclass(kw_only=True) +class CreateEventDataStoreOutput(_SerdeShape): + """Dataclass for CreateEventDataStoreOutput structure.""" + + event_data_store_arn: str | None = ... + """The ARN of the event data store.""" + name: str | None = ... + """The name of the event data store.""" + status: str | None = ... + """The status of event data store creation.""" + advanced_event_selectors: list[AdvancedEventSelector] | None = ... + """ + The advanced event selectors that were used to select the events for the + data store. + """ + multi_region_enabled: bool | None = ... + """ + Indicates whether the event data store collects events from all Regions, + or only from the Region in which it was created. + """ + organization_enabled: bool | None = ... + """ + Indicates whether an event data store is collecting logged events for an + organization in Organizations. + """ + retention_period: int | None = ... + """The retention period of an event data store, in days.""" + termination_protection_enabled: bool | None = ... + """ + Indicates whether termination protection is enabled for the event data + store. + """ + tags_list: list[Tag] | None = ... + """A list of tags.""" + created_timestamp: datetime | None = ... + """The timestamp that shows when the event data store was created.""" + updated_timestamp: datetime | None = ... + """ + The timestamp that shows when an event data store was updated, if + applicable. `UpdatedTimestamp` is always either the same or newer than + the time shown in `CreatedTimestamp`. + """ + kms_key_id: str | None = ... + """ + Specifies the KMS key ID that encrypts the events delivered by + CloudTrail. The value is a fully specified ARN to a KMS key in the + following format. + + `arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012` + """ + billing_mode: str | None = ... + """The billing mode for the event data store.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateTrailInput(_SerdeShape): + """Specifies the settings for each trail.""" + + name: str | None = ... + """ + Specifies the name of the trail. The name must meet the following + requirements: + + - Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), + underscores (_), or dashes (-) + + - Start with a letter or number, and end with a letter or number + + - Be between 3 and 128 characters + + - Have no adjacent periods, underscores or dashes. Names like + `my-_namespace` and `my--namespace` are not valid. + + - Not be in IP address format (for example, 192.168.5.4) + """ + s3_bucket_name: str | None = ... + """ + Specifies the name of the Amazon S3 bucket designated for publishing log + files. For information about bucket naming rules, see [Bucket naming + rules](https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html) + in the *Amazon Simple Storage Service User Guide*. + """ + s3_key_prefix: str | None = ... + """ + Specifies the Amazon S3 key prefix that comes after the name of the + bucket you have designated for log file delivery. For more information, + see [Finding Your CloudTrail Log + Files](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/get-and-view-cloudtrail-log-files.html#cloudtrail-find-log-files). + The maximum length is 200 characters. + """ + sns_topic_name: str | None = ... + """ + Specifies the name or ARN of the Amazon SNS topic defined for + notification of log file delivery. The maximum length is 256 characters. + """ + include_global_service_events: bool | None = ... + """ + Specifies whether the trail is publishing events from global services + such as IAM to the log files. Setting this value to `true` only delivers + global service events to the trail if the trail is multi-Region or if + the trail's home Region is the partition leader Region (for example, + us-east-1). + """ + is_multi_region_trail: bool | None = ... + """ + Specifies whether the trail is created in the current Region or in all + Regions. The default is false, which creates a trail only in the Region + where you are signed in. As a best practice, consider creating trails + that log events in all Regions. + """ + enable_log_file_validation: bool | None = ... + """ + Specifies whether log file integrity validation is enabled. The default + is false. + + Note: + When you disable log file integrity validation, the chain of digest + files is broken after one hour. CloudTrail does not create digest files + for log files that were delivered during a period in which log file + integrity validation was disabled. For example, if you enable log file + integrity validation at noon on January 1, disable it at noon on January + 2, and re-enable it at noon on January 10, digest files will not be + created for the log files delivered from noon on January 2 to noon on + January 10. The same applies whenever you stop CloudTrail logging or + delete a trail. + """ + cloud_watch_logs_log_group_arn: str | None = ... + """ + Specifies a log group name using an Amazon Resource Name (ARN), a unique + identifier that represents the log group to which CloudTrail logs will + be delivered. You must use a log group that exists in your account. + + Not required unless you specify `CloudWatchLogsRoleArn`. + """ + cloud_watch_logs_role_arn: str | None = ... + """ + Specifies the role for the CloudWatch Logs endpoint to assume to write + to a user's log group. You must use a role that exists in your account. + """ + kms_key_id: str | None = ... + """ + Specifies the KMS key ID to use to encrypt the logs and digest files + delivered by CloudTrail. The value can be an alias name prefixed by + `alias/`, a fully specified ARN to an alias, a fully specified ARN to a + key, or a globally unique identifier. + + CloudTrail also supports KMS multi-Region keys. For more information + about multi-Region keys, see [Using multi-Region + keys](https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html) + in the *Key Management Service Developer Guide*. + + Examples: + + - `alias/MyAliasName` + + - `arn:aws:kms:us-east-2:123456789012:alias/MyAliasName` + + - `arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012` + + - `12345678-1234-1234-1234-123456789012` + """ + is_organization_trail: bool | None = ... + """ + Specifies whether the trail is created for all accounts in an + organization in Organizations, or only for the current Amazon Web + Services account. The default is false, and cannot be true unless the + call is made on behalf of an Amazon Web Services account that is the + management account or delegated administrator account for an + organization in Organizations. + """ + tags_list: list[Tag] | None = ... + """A list of tags.""" + recursive_logging: bool | None = ... + """ + Specifies whether recursive logging is enabled for the trail. If you set + `RecursiveLogging` to `false`, CloudTrail suppresses events generated by + CloudTrail when it delivers log files to your trail's destinations, + including Amazon S3 and CloudWatch Logs. The default value is `true`. + """ + +@dataclass(kw_only=True) +class CreateTrailOutput(_SerdeShape): + """ + Returns the objects or data listed below if successful. Otherwise, + returns an error. + """ + + name: str | None = ... + """Specifies the name of the trail.""" + s3_bucket_name: str | None = ... + """ + Specifies the name of the Amazon S3 bucket designated for publishing log + files. + """ + s3_key_prefix: str | None = ... + """ + Specifies the Amazon S3 key prefix that comes after the name of the + bucket you have designated for log file delivery. For more information, + see [Finding Your CloudTrail Log + Files](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/get-and-view-cloudtrail-log-files.html#cloudtrail-find-log-files). + """ + sns_topic_name: str | None = ... + """This field is no longer in use. Use `SnsTopicARN`.""" + sns_topic_arn: str | None = ... + """ + Specifies the ARN of the Amazon SNS topic that CloudTrail uses to send + notifications when log files are delivered. The format of a topic ARN + is: + + `arn:aws:sns:us-east-2:123456789012:MyTopic` + """ + include_global_service_events: bool | None = ... + """ + Specifies whether the trail is publishing events from global services + such as IAM to the log files. Setting this value to `true` only delivers + global service events to the trail if the trail is multi-Region or if + the trail's home Region is the partition leader Region (for example, + us-east-1). + """ + is_multi_region_trail: bool | None = ... + """Specifies whether the trail exists in one Region or in all Regions.""" + trail_arn: str | None = ... + """ + Specifies the ARN of the trail that was created. The format of a trail + ARN is: + + `arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail` + """ + log_file_validation_enabled: bool | None = ... + """Specifies whether log file integrity validation is enabled.""" + cloud_watch_logs_log_group_arn: str | None = ... + """ + Specifies the Amazon Resource Name (ARN) of the log group to which + CloudTrail logs will be delivered. + """ + cloud_watch_logs_role_arn: str | None = ... + """ + Specifies the role for the CloudWatch Logs endpoint to assume to write + to a user's log group. + """ + kms_key_id: str | None = ... + """ + Specifies the KMS key ID that encrypts the events delivered by + CloudTrail. The value is a fully specified ARN to a KMS key in the + following format. + + `arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012` + """ + is_organization_trail: bool | None = ... + """Specifies whether the trail is an organization trail.""" + recursive_logging: bool | None = ... + """Specifies whether recursive logging is enabled for the trail.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DashboardDetail(_SerdeShape): + """Provides information about a CloudTrail Lake dashboard.""" + + dashboard_arn: str | None = ... + """The ARN for the dashboard.""" + type: str | None = ... + """The type of dashboard.""" + +class DashboardStatus(UnknownEnumMixin, StrEnum): + CREATING = "CREATING" + CREATED = "CREATED" + UPDATING = "UPDATING" + UPDATED = "UPDATED" + DELETING = "DELETING" + +class DashboardType(UnknownEnumMixin, StrEnum): + MANAGED = "MANAGED" + CUSTOM = "CUSTOM" + +@dataclass(kw_only=True) +class DataResource(_SerdeShape): + """ + You can configure the `DataResource` in an `EventSelector` to log data + events for the following three resource types: + + - `AWS::DynamoDB::Table` + + - `AWS::Lambda::Function` + + - `AWS::S3::Object` + + To log data events for all other resource types including objects stored + in [directory + buckets](https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-overview.html), + you must use + [AdvancedEventSelectors](https://docs.aws.amazon.com/awscloudtrail/latest/APIReference/API_AdvancedEventSelector.html). + You must also use `AdvancedEventSelectors` if you want to filter on the + `eventName` field. + + Configure the `DataResource` to specify the resource type and resource + ARNs for which you want to log data events. + + Note: + The total number of allowed data resources is 250. This number can be + distributed between 1 and 5 event selectors, but the total cannot exceed + 250 across all selectors for the trail. + + The following example demonstrates how logging works when you configure + logging of all data events for a general purpose bucket named + `amzn-s3-demo-bucket1`. In this example, the CloudTrail user specified + an empty prefix, and the option to log both `Read` and `Write` data + events. + + 1. A user uploads an image file to `amzn-s3-demo-bucket1`. + + 2. The `PutObject` API operation is an Amazon S3 object-level API. It + is recorded as a data event in CloudTrail. Because the CloudTrail + user specified an S3 bucket with an empty prefix, events that occur + on any object in that bucket are logged. The trail processes and + logs the event. + + 3. A user uploads an object to an Amazon S3 bucket named + `arn:aws:s3:::amzn-s3-demo-bucket1`. + + 4. The `PutObject` API operation occurred for an object in an S3 bucket + that the CloudTrail user didn't specify for the trail. The trail + doesn't log the event. + + The following example demonstrates how logging works when you configure + logging of Lambda data events for a Lambda function named + *MyLambdaFunction*, but not for all Lambda functions. + + 1. A user runs a script that includes a call to the *MyLambdaFunction* + function and the *MyOtherLambdaFunction* function. + + 2. The `Invoke` API operation on *MyLambdaFunction* is an Lambda API. + It is recorded as a data event in CloudTrail. Because the CloudTrail + user specified logging data events for *MyLambdaFunction*, any + invocations of that function are logged. The trail processes and + logs the event. + + 3. The `Invoke` API operation on *MyOtherLambdaFunction* is an Lambda + API. Because the CloudTrail user did not specify logging data events + for all Lambda functions, the `Invoke` operation for + *MyOtherLambdaFunction* does not match the function specified for + the trail. The trail doesn't log the event. + """ + + type: str | None = ... + """ + The resource type in which you want to log data events. You can specify + the following *basic* event selector resource types: + + - `AWS::DynamoDB::Table` + + - `AWS::Lambda::Function` + + - `AWS::S3::Object` + + Additional resource types are available through *advanced* event + selectors. For more information, see + [AdvancedEventSelector](https://docs.aws.amazon.com/awscloudtrail/latest/APIReference/API_AdvancedEventSelector.html). + """ + values: list[str] | None = ... + """ + An array of Amazon Resource Name (ARN) strings or partial ARN strings + for the specified resource type. + + - To log data events for all objects in all S3 buckets in your Amazon + Web Services account, specify the prefix as `arn:aws:s3`. + + Note: + This also enables logging of data event activity performed by any user + or role in your Amazon Web Services account, even if that activity is + performed on a bucket that belongs to another Amazon Web Services + account. + + - To log data events for all objects in an S3 bucket, specify the bucket + and an empty object prefix such as + `arn:aws:s3:::amzn-s3-demo-bucket1/`. The trail logs data events for + all objects in this S3 bucket. + + - To log data events for specific objects, specify the S3 bucket and + object prefix such as + `arn:aws:s3:::amzn-s3-demo-bucket1/example-images`. The trail logs + data events for objects in this S3 bucket that match the prefix. + + - To log data events for all Lambda functions in your Amazon Web + Services account, specify the prefix as `arn:aws:lambda`. + + Note: + This also enables logging of `Invoke` activity performed by any user + or role in your Amazon Web Services account, even if that activity is + performed on a function that belongs to another Amazon Web Services + account. + + - To log data events for a specific Lambda function, specify the + function ARN. + + Note: + Lambda function ARNs are exact. For example, if you specify a function + ARN *arn:aws:lambda:us-west-2:111111111111:function:helloworld*, data + events will only be logged for + *arn:aws:lambda:us-west-2:111111111111:function:helloworld*. They will + not be logged for + *arn:aws:lambda:us-west-2:111111111111:function:helloworld2*. + + - To log data events for all DynamoDB tables in your Amazon Web Services + account, specify the prefix as `arn:aws:dynamodb`. + """ + +@dataclass(kw_only=True) +class DelegatedAdminAccountLimitExceededException(ServiceError, _SerdeShape): + """ + This exception is thrown when the maximum number of CloudTrail delegated + administrators is reached. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteChannelInput(_SerdeShape): + """Dataclass for DeleteChannelInput structure.""" + + channel: str | None = ... + """The ARN or the `UUID` value of the channel that you want to delete.""" + +@dataclass(kw_only=True) +class DeleteChannelOutput(_SerdeShape): + """Dataclass for DeleteChannelOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteDashboardInput(_SerdeShape): + """Dataclass for DeleteDashboardInput structure.""" + + dashboard_id: str | None = ... + """The name or ARN for the dashboard.""" + +@dataclass(kw_only=True) +class DeleteDashboardOutput(_SerdeShape): + """Dataclass for DeleteDashboardOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteEventDataStoreInput(_SerdeShape): + """Dataclass for DeleteEventDataStoreInput structure.""" + + event_data_store: str | None = ... + """The ARN (or the ID suffix of the ARN) of the event data store to delete.""" + +@dataclass(kw_only=True) +class DeleteEventDataStoreOutput(_SerdeShape): + """Dataclass for DeleteEventDataStoreOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteResourcePolicyInput(_SerdeShape): + """Dataclass for DeleteResourcePolicyInput structure.""" + + resource_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the CloudTrail event data store, + dashboard, or channel you're deleting the resource-based policy from. + + Example event data store ARN format: + `arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE` + + Example dashboard ARN format: + `arn:aws:cloudtrail:us-east-1:123456789012:dashboard/exampleDash` + + Example channel ARN format: + `arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890` + """ + +@dataclass(kw_only=True) +class DeleteResourcePolicyOutput(_SerdeShape): + """Dataclass for DeleteResourcePolicyOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteTrailInput(_SerdeShape): + """The request that specifies the name of a trail to delete.""" + + name: str | None = ... + """ + Specifies the name or the CloudTrail ARN of the trail to be deleted. The + following is the format of a trail ARN. + `arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail` + """ + +@dataclass(kw_only=True) +class DeleteTrailOutput(_SerdeShape): + """ + Returns the objects or data listed below if successful. Otherwise, + returns an error. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class DeliveryStatus(UnknownEnumMixin, StrEnum): + SUCCESS = "SUCCESS" + FAILED = "FAILED" + FAILED_SIGNING_FILE = "FAILED_SIGNING_FILE" + PENDING = "PENDING" + RESOURCE_NOT_FOUND = "RESOURCE_NOT_FOUND" + ACCESS_DENIED = "ACCESS_DENIED" + ACCESS_DENIED_SIGNING_FILE = "ACCESS_DENIED_SIGNING_FILE" + CANCELLED = "CANCELLED" + UNKNOWN = "UNKNOWN" + +@dataclass(kw_only=True) +class DeregisterOrganizationDelegatedAdminInput(_SerdeShape): + """ + Removes CloudTrail delegated administrator permissions from a specified + member account in an organization that is currently designated as a + delegated administrator. + """ + + delegated_admin_account_id: str | None = ... + """ + A delegated administrator account ID. This is a member account in an + organization that is currently designated as a delegated administrator. + """ + +@dataclass(kw_only=True) +class DeregisterOrganizationDelegatedAdminOutput(_SerdeShape): + """ + Returns the following response if successful. Otherwise, returns an + error. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DescribeQueryInput(_SerdeShape): + """Dataclass for DescribeQueryInput structure.""" + + event_data_store: str | None = ... + """ + The ARN (or the ID suffix of the ARN) of an event data store on which + the specified query was run. + """ + query_id: str | None = ... + """The query ID.""" + query_alias: str | None = ... + """The alias that identifies a query template.""" + refresh_id: str | None = ... + """The ID of the dashboard refresh.""" + event_data_store_owner_account_id: str | None = ... + """The account ID of the event data store owner.""" + +@dataclass(kw_only=True) +class DescribeQueryOutput(_SerdeShape): + """Dataclass for DescribeQueryOutput structure.""" + + query_id: str | None = ... + """The ID of the query.""" + query_string: str | None = ... + """The SQL code of a query.""" + query_status: str | None = ... + """ + The status of a query. Values for `QueryStatus` include `QUEUED`, + `RUNNING`, `FINISHED`, `FAILED`, `TIMED_OUT`, or `CANCELLED` + """ + query_statistics: QueryStatisticsForDescribeQuery | None = ... + """ + Metadata about a query, including the number of events that were + matched, the total number of events scanned, the query run time in + milliseconds, and the query's creation time. + """ + error_message: str | None = ... + """The error message returned if a query failed.""" + delivery_s3_uri: str | None = ... + """ + The URI for the S3 bucket where CloudTrail delivered query results, if + applicable. + """ + delivery_status: str | None = ... + """The delivery status.""" + prompt: str | None = ... + """ + The prompt used for a generated query. For information about generated + queries, see [Create CloudTrail Lake queries from natural language + prompts](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/lake-query-generator.html) + in the *CloudTrail* user guide. + """ + event_data_store_owner_account_id: str | None = ... + """The account ID of the event data store owner.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DescribeTrailsInput(_SerdeShape): + """Returns information about the trail.""" + + trail_name_list: list[str] | None = ... + """ + Specifies a list of trail names, trail ARNs, or both, of the trails to + describe. The format of a trail ARN is: + + `arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail` + + If an empty list is specified, information for the trail in the current + Region is returned. + + - If an empty list is specified and `IncludeShadowTrails` is false, then + information for all trails in the current Region is returned. + + - If an empty list is specified and IncludeShadowTrails is null or true, + then information for all trails in the current Region and any + associated shadow trails in other Regions is returned. + + Note: + If one or more trail names are specified, information is returned only + if the names match the names of trails belonging only to the current + Region and current account. To return information about a trail in + another Region, you must specify its trail ARN. + """ + include_shadow_trails: bool | None = ... + """ + Specifies whether to include shadow trails in the response. A shadow + trail is the replication in a Region of a trail that was created in a + different Region, or in the case of an organization trail, the + replication of an organization trail in member accounts. If you do not + include shadow trails, organization trails in a member account and + Region replication trails will not be returned. The default is true. + """ + +@dataclass(kw_only=True) +class DescribeTrailsOutput(_SerdeShape): + """ + Returns the objects or data listed below if successful. Otherwise, + returns an error. + """ + + trail_list: list[Trail] | None = ... + """ + The list of trail objects. Trail objects with string values are only + returned if values for the objects exist in a trail's configuration. + For example, `SNSTopicName` and `SNSTopicARN` are only returned in + results if a trail is configured to send SNS notifications. Similarly, + `KMSKeyId` only appears in results if a trail's log files are encrypted + with KMS customer managed keys. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class Destination(_SerdeShape): + """Contains information about the destination receiving events.""" + + type: str + """ + The type of destination for events arriving from a channel. For channels + used for a CloudTrail Lake integration, the value is `EVENT_DATA_STORE`. + For service-linked channels, the value is `AWS_SERVICE`. + """ + location: str + """ + For channels used for a CloudTrail Lake integration, the location is the + ARN of an event data store that receives events from a channel. For + service-linked channels, the location is the name of the Amazon Web + Services service. + """ + +class DestinationType(UnknownEnumMixin, StrEnum): + EVENT_DATA_STORE = "EVENT_DATA_STORE" + AWS_SERVICE = "AWS_SERVICE" + +@dataclass(kw_only=True) +class DisableFederationInput(_SerdeShape): + """Dataclass for DisableFederationInput structure.""" + + event_data_store: str | None = ... + """ + The ARN (or ID suffix of the ARN) of the event data store for which you + want to disable Lake query federation. + """ + +@dataclass(kw_only=True) +class DisableFederationOutput(_SerdeShape): + """Dataclass for DisableFederationOutput structure.""" + + event_data_store_arn: str | None = ... + """ + The ARN of the event data store for which you disabled Lake query + federation. + """ + federation_status: str | None = ... + """The federation status.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class EnableFederationInput(_SerdeShape): + """Dataclass for EnableFederationInput structure.""" + + event_data_store: str | None = ... + """ + The ARN (or ID suffix of the ARN) of the event data store for which you + want to enable Lake query federation. + """ + federation_role_arn: str | None = ... + """ + The ARN of the federation role to use for the event data store. Amazon + Web Services services like Lake Formation use this federation role to + access data for the federated event data store. The federation role must + exist in your account and provide the [required minimum + permissions](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-federation.html#query-federation-permissions-role). + """ + +@dataclass(kw_only=True) +class EnableFederationOutput(_SerdeShape): + """Dataclass for EnableFederationOutput structure.""" + + event_data_store_arn: str | None = ... + """ + The ARN of the event data store for which you enabled Lake query + federation. + """ + federation_status: str | None = ... + """The federation status.""" + federation_role_arn: str | None = ... + """The ARN of the federation role.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class Event(_SerdeShape): + """ + Contains information about an event that was returned by a lookup + request. The result includes a representation of a CloudTrail event. + """ + + event_id: str | None = ... + """The CloudTrail ID of the event returned.""" + event_name: str | None = ... + """The name of the event returned.""" + read_only: str | None = ... + """Information about whether the event is a write event or a read event.""" + access_key_id: str | None = ... + """ + The Amazon Web Services access key ID that was used to sign the request. + If the request was made with temporary security credentials, this is the + access key ID of the temporary credentials. + """ + event_time: datetime | None = ... + """The date and time of the event returned.""" + event_source: str | None = ... + """The Amazon Web Services service to which the request was made.""" + username: str | None = ... + """ + A user name or role name of the requester that called the API in the + event returned. + """ + resources: list[Resource] | None = ... + """A list of resources referenced by the event returned.""" + cloud_trail_event: str | None = ... + """A JSON string that contains a representation of the event returned.""" + +class EventCategory(UnknownEnumMixin, StrEnum): + """ + Specifies the event category for which aggregation configuration is + enabled. Valid value is Data. + """ + + INSIGHT = "insight" + +class EventCategoryAggregation(UnknownEnumMixin, StrEnum): + DATA = "Data" + +@dataclass(kw_only=True) +class EventDataStore(_SerdeShape): + """ + A storage lake of event data against which you can run complex SQL-based + queries. An event data store can include events that you have logged on + your account. To select events for an event data store, use [advanced + event + selectors](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake-concepts.html#adv-event-selectors). + """ + + event_data_store_arn: str | None = ... + """The ARN of the event data store.""" + name: str | None = ... + """The name of the event data store.""" + termination_protection_enabled: bool | None = ... + """Indicates whether the event data store is protected from termination.""" + status: str | None = ... + """The status of an event data store.""" + advanced_event_selectors: list[AdvancedEventSelector] | None = ... + """ + The advanced event selectors that were used to select events for the + data store. + """ + multi_region_enabled: bool | None = ... + """ + Indicates whether the event data store includes events from all Regions, + or only from the Region in which it was created. + """ + organization_enabled: bool | None = ... + """ + Indicates that an event data store is collecting logged events for an + organization. + """ + retention_period: int | None = ... + """The retention period, in days.""" + created_timestamp: datetime | None = ... + """The timestamp of the event data store's creation.""" + updated_timestamp: datetime | None = ... + """ + The timestamp showing when an event data store was updated, if + applicable. `UpdatedTimestamp` is always either the same or newer than + the time shown in `CreatedTimestamp`. + """ + +@dataclass(kw_only=True) +class EventDataStoreAlreadyExistsException(ServiceError, _SerdeShape): + """An event data store with that name already exists.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class EventDataStoreARNInvalidException(ServiceError, _SerdeShape): + """ + The specified event data store ARN is not valid or does not map to an + event data store in your account. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class EventDataStoreFederationEnabledException(ServiceError, _SerdeShape): + """ + You cannot delete the event data store because Lake query federation is + enabled. To delete the event data store, run the `DisableFederation` + operation to disable Lake query federation on the event data store. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class EventDataStoreHasOngoingImportException(ServiceError, _SerdeShape): + """ + This exception is thrown when you try to update or delete an event data + store that currently has an import in progress. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class EventDataStoreMaxLimitExceededException(ServiceError, _SerdeShape): + """Your account has used the maximum number of event data stores.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class EventDataStoreNotFoundException(ServiceError, _SerdeShape): + """The specified event data store was not found.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class EventDataStoreStatus(UnknownEnumMixin, StrEnum): + CREATED = "CREATED" + ENABLED = "ENABLED" + PENDING_DELETION = "PENDING_DELETION" + STARTING_INGESTION = "STARTING_INGESTION" + STOPPING_INGESTION = "STOPPING_INGESTION" + STOPPED_INGESTION = "STOPPED_INGESTION" + +@dataclass(kw_only=True) +class EventDataStoreTerminationProtectedException(ServiceError, _SerdeShape): + """ + The event data store cannot be deleted because termination protection is + enabled for it. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class EventSelector(_SerdeShape): + """ + Use event selectors to further specify the management and data event + settings for your trail. By default, trails created without specific + event selectors will be configured to log all read and write management + events, and no data events. When an event occurs in your account, + CloudTrail evaluates the event selector for all trails. For each trail, + if the event matches any event selector, the trail processes and logs + the event. If the event doesn't match any event selector, the trail + doesn't log the event. + + You can configure up to five event selectors for a trail. + + You cannot apply both event selectors and advanced event selectors to a + trail. + """ + + read_write_type: str | None = ... + """ + Specify if you want your trail to log read-only events, write-only + events, or all. For example, the EC2 `GetConsoleOutput` is a read-only + API operation and `RunInstances` is a write-only API operation. + + By default, the value is `All`. + """ + include_management_events: bool | None = ... + """ + Specify if you want your event selector to include management events for + your trail. + + For more information, see [Management + Events](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-management-events-with-cloudtrail.html) + in the *CloudTrail User Guide*. + + By default, the value is `true`. + + The first copy of management events is free. You are charged for + additional copies of management events that you are logging on any + subsequent trail in the same Region. For more information about + CloudTrail pricing, see [CloudTrail + Pricing](http://aws.amazon.com/cloudtrail/pricing/). + """ + data_resources: list[DataResource] | None = ... + """ + CloudTrail supports data event logging for Amazon S3 objects in standard + S3 buckets, Lambda functions, and Amazon DynamoDB tables with basic + event selectors. You can specify up to 250 resources for an individual + event selector, but the total number of data resources cannot exceed 250 + across all event selectors in a trail. This limit does not apply if you + configure resource logging for all data events. + + For more information, see [Data + Events](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html) + and [Limits in + CloudTrail](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/WhatIsCloudTrail-Limits.html) + in the *CloudTrail User Guide*. + + Note: + To log data events for all other resource types including objects stored + in [directory + buckets](https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-overview.html), + you must use + [AdvancedEventSelectors](https://docs.aws.amazon.com/awscloudtrail/latest/APIReference/API_AdvancedEventSelector.html). + You must also use `AdvancedEventSelectors` if you want to filter on the + `eventName` field. + """ + exclude_management_event_sources: list[str] | None = ... + """ + An optional list of service event sources from which you do not want + management events to be logged on your trail. In this release, the list + can be empty (disables the filter), or it can filter out Key Management + Service or Amazon RDS Data API events by containing `kms.amazonaws.com` + or `rdsdata.amazonaws.com`. By default, `ExcludeManagementEventSources` + is empty, and KMS and Amazon RDS Data API events are logged to your + trail. You can exclude management event sources only in Regions that + support the event source. + """ + +class FederationStatus(UnknownEnumMixin, StrEnum): + ENABLING = "ENABLING" + ENABLED = "ENABLED" + DISABLING = "DISABLING" + DISABLED = "DISABLED" + +@dataclass(kw_only=True) +class GenerateQueryInput(_SerdeShape): + """Dataclass for GenerateQueryInput structure.""" + + event_data_stores: list[str] | None = ... + """ + The ARN (or ID suffix of the ARN) of the event data store that you want + to query. You can only specify one event data store. + """ + prompt: str | None = ... + """ + The prompt that you want to use to generate the query. The prompt must + be in English. For example prompts, see [Example + prompts](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/lake-query-generator.html#lake-query-generator-examples) + in the *CloudTrail* user guide. + """ + +@dataclass(kw_only=True) +class GenerateQueryOutput(_SerdeShape): + """Dataclass for GenerateQueryOutput structure.""" + + query_statement: str | None = ... + """The SQL query statement generated from the prompt.""" + query_alias: str | None = ... + """ + An alias that identifies the prompt. When you run the `StartQuery` + operation, you can pass in either the `QueryAlias` or `QueryStatement` + parameter. + """ + event_data_store_owner_account_id: str | None = ... + """The account ID of the event data store owner.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GenerateResponseException(ServiceError, _SerdeShape): + """ + This exception is thrown when a valid query could not be generated for + the provided prompt. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetChannelInput(_SerdeShape): + """Dataclass for GetChannelInput structure.""" + + channel: str | None = ... + """The ARN or `UUID` of a channel.""" + +@dataclass(kw_only=True) +class GetChannelOutput(_SerdeShape): + """Dataclass for GetChannelOutput structure.""" + + channel_arn: str | None = ... + """The ARN of an channel returned by a `GetChannel` request.""" + name: str | None = ... + """ + The name of the CloudTrail channel. For service-linked channels, the + name is `aws-service-channel/service-name/custom-suffix` where + `service-name` represents the name of the Amazon Web Services service + that created the channel and `custom-suffix` represents the suffix + generated by the Amazon Web Services service. + """ + source: str | None = ... + """The source for the CloudTrail channel.""" + source_config: SourceConfig | None = ... + """ + Provides information about the advanced event selectors configured for + the channel, and whether the channel applies to all Regions or a single + Region. + """ + destinations: list[Destination] | None = ... + """ + The destinations for the channel. For channels created for integrations, + the destinations are the event data stores that log events arriving + through the channel. For service-linked channels, the destination is the + Amazon Web Services service that created the service-linked channel to + receive events. + """ + ingestion_status: IngestionStatus | None = ... + """ + A table showing information about the most recent successful and failed + attempts to ingest events. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetDashboardInput(_SerdeShape): + """Dataclass for GetDashboardInput structure.""" + + dashboard_id: str | None = ... + """The name or ARN for the dashboard.""" + +@dataclass(kw_only=True) +class GetDashboardOutput(_SerdeShape): + """Dataclass for GetDashboardOutput structure.""" + + dashboard_arn: str | None = ... + """The ARN for the dashboard.""" + type: str | None = ... + """The type of dashboard.""" + status: str | None = ... + """The status of the dashboard.""" + widgets: list[Widget] | None = ... + """An array of widgets for the dashboard.""" + refresh_schedule: RefreshSchedule | None = ... + """The refresh schedule for the dashboard, if configured.""" + created_timestamp: datetime | None = ... + """The timestamp that shows when the dashboard was created.""" + updated_timestamp: datetime | None = ... + """The timestamp that shows when the dashboard was last updated.""" + last_refresh_id: str | None = ... + """The ID of the last dashboard refresh.""" + last_refresh_failure_reason: str | None = ... + """Provides information about failures for the last scheduled refresh.""" + termination_protection_enabled: bool | None = ... + """Indicates whether termination protection is enabled for the dashboard.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetEventConfigurationInput(_SerdeShape): + """Dataclass for GetEventConfigurationInput structure.""" + + trail_name: str | None = ... + """ + The name of the trail for which you want to retrieve event configuration + settings. + """ + event_data_store: str | None = ... + """ + The Amazon Resource Name (ARN) or ID suffix of the ARN of the event data + store for which you want to retrieve event configuration settings. + """ + +@dataclass(kw_only=True) +class GetEventConfigurationOutput(_SerdeShape): + """Dataclass for GetEventConfigurationOutput structure.""" + + trail_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the trail for which the event + configuration settings are returned. + """ + event_data_store_arn: str | None = ... + """ + The Amazon Resource Name (ARN) or ID suffix of the ARN of the event data + store for which the event configuration settings are returned. + """ + max_event_size: str | None = ... + """ + The maximum allowed size for events stored in the specified event data + store. + """ + context_key_selectors: list[ContextKeySelector] | None = ... + """ + The list of context key selectors that are configured for the event data + store. + """ + aggregation_configurations: list[AggregationConfiguration] | None = ... + """ + The list of aggregation configurations that are configured for the + trail. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetEventDataStoreInput(_SerdeShape): + """Dataclass for GetEventDataStoreInput structure.""" + + event_data_store: str | None = ... + """ + The ARN (or ID suffix of the ARN) of the event data store about which + you want information. + """ + +@dataclass(kw_only=True) +class GetEventDataStoreOutput(_SerdeShape): + """Dataclass for GetEventDataStoreOutput structure.""" + + event_data_store_arn: str | None = ... + """The event data store Amazon Resource Number (ARN).""" + name: str | None = ... + """The name of the event data store.""" + status: str | None = ... + """The status of an event data store.""" + advanced_event_selectors: list[AdvancedEventSelector] | None = ... + """The advanced event selectors used to select events for the data store.""" + multi_region_enabled: bool | None = ... + """ + Indicates whether the event data store includes events from all Regions, + or only from the Region in which it was created. + """ + organization_enabled: bool | None = ... + """ + Indicates whether an event data store is collecting logged events for an + organization in Organizations. + """ + retention_period: int | None = ... + """The retention period of the event data store, in days.""" + termination_protection_enabled: bool | None = ... + """Indicates that termination protection is enabled.""" + created_timestamp: datetime | None = ... + """The timestamp of the event data store's creation.""" + updated_timestamp: datetime | None = ... + """ + Shows the time that an event data store was updated, if applicable. + `UpdatedTimestamp` is always either the same or newer than the time + shown in `CreatedTimestamp`. + """ + kms_key_id: str | None = ... + """ + Specifies the KMS key ID that encrypts the events delivered by + CloudTrail. The value is a fully specified ARN to a KMS key in the + following format. + + `arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012` + """ + billing_mode: str | None = ... + """The billing mode for the event data store.""" + federation_status: str | None = ... + """ + Indicates the [Lake query + federation](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-federation.html) + status. The status is `ENABLED` if Lake query federation is enabled, or + `DISABLED` if Lake query federation is disabled. You cannot delete an + event data store if the `FederationStatus` is `ENABLED`. + """ + federation_role_arn: str | None = ... + """ + If Lake query federation is enabled, provides the ARN of the federation + role used to access the resources for the federated event data store. + """ + partition_keys: list[PartitionKey] | None = ... + """ + The partition keys for the event data store. To improve query + performance and efficiency, CloudTrail Lake organizes event data into + partitions based on values derived from partition keys. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetEventSelectorsInput(_SerdeShape): + """Dataclass for GetEventSelectorsInput structure.""" + + trail_name: str | None = ... + """ + Specifies the name of the trail or trail ARN. If you specify a trail + name, the string must meet the following requirements: + + - Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), + underscores (_), or dashes (-) + + - Start with a letter or number, and end with a letter or number + + - Be between 3 and 128 characters + + - Have no adjacent periods, underscores or dashes. Names like + `my-_namespace` and `my--namespace` are not valid. + + - Not be in IP address format (for example, 192.168.5.4) + + If you specify a trail ARN, it must be in the format: + + `arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail` + """ + +@dataclass(kw_only=True) +class GetEventSelectorsOutput(_SerdeShape): + """Dataclass for GetEventSelectorsOutput structure.""" + + trail_arn: str | None = ... + """The specified trail ARN that has the event selectors.""" + event_selectors: list[EventSelector] | None = ... + """The event selectors that are configured for the trail.""" + advanced_event_selectors: list[AdvancedEventSelector] | None = ... + """The advanced event selectors that are configured for the trail.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetImportInput(_SerdeShape): + """Dataclass for GetImportInput structure.""" + + import_id: str | None = ... + """The ID for the import.""" + +@dataclass(kw_only=True) +class GetImportOutput(_SerdeShape): + """Dataclass for GetImportOutput structure.""" + + import_id: str | None = ... + """The ID of the import.""" + destinations: list[str] | None = ... + """The ARN of the destination event data store.""" + import_source: ImportSource | None = ... + """The source S3 bucket.""" + start_event_time: datetime | None = ... + """ + Used with `EndEventTime` to bound a `StartImport` request, and limit + imported trail events to only those events logged within a specified + time period. + """ + end_event_time: datetime | None = ... + """ + Used with `StartEventTime` to bound a `StartImport` request, and limit + imported trail events to only those events logged within a specified + time period. + """ + import_status: str | None = ... + """The status of the import.""" + created_timestamp: datetime | None = ... + """The timestamp of the import's creation.""" + updated_timestamp: datetime | None = ... + """The timestamp of when the import was updated.""" + import_statistics: ImportStatistics | None = ... + """ + Provides statistics for the import. CloudTrail does not update import + statistics in real-time. Returned values for parameters such as + `EventsCompleted` may be lower than the actual value, because CloudTrail + updates statistics incrementally over the course of the import. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetInsightSelectorsInput(_SerdeShape): + """Dataclass for GetInsightSelectorsInput structure.""" + + trail_name: str | None = ... + """ + Specifies the name of the trail or trail ARN. If you specify a trail + name, the string must meet the following requirements: + + - Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), + underscores (_), or dashes (-) + + - Start with a letter or number, and end with a letter or number + + - Be between 3 and 128 characters + + - Have no adjacent periods, underscores or dashes. Names like + `my-_namespace` and `my--namespace` are not valid. + + - Not be in IP address format (for example, 192.168.5.4) + + If you specify a trail ARN, it must be in the format: + + `arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail` + + You cannot use this parameter with the `EventDataStore` parameter. + """ + event_data_store: str | None = ... + """ + Specifies the ARN (or ID suffix of the ARN) of the event data store for + which you want to get Insights selectors. + + You cannot use this parameter with the `TrailName` parameter. + """ + +@dataclass(kw_only=True) +class GetInsightSelectorsOutput(_SerdeShape): + """Dataclass for GetInsightSelectorsOutput structure.""" + + trail_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of a trail for which you want to get + Insights selectors. + """ + insight_selectors: list[InsightSelector] | None = ... + """ + Contains the Insights types that are enabled on a trail or event data + store. It also specifies the event categories on which a particular + Insight type is enabled. `ApiCallRateInsight` and `ApiErrorRateInsight` + are valid Insight types.The EventCategory field can specify `Management` + or `Data` events or both. For event data store, you can log Insights for + management events only. + """ + event_data_store_arn: str | None = ... + """The ARN of the source event data store that enabled Insights events.""" + insights_destination: str | None = ... + """The ARN of the destination event data store that logs Insights events.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetQueryResultsInput(_SerdeShape): + """Dataclass for GetQueryResultsInput structure.""" + + event_data_store: str | None = ... + """ + The ARN (or ID suffix of the ARN) of the event data store against which + the query was run. + """ + query_id: str | None = ... + """The ID of the query for which you want to get results.""" + next_token: str | None = ... + """A token you can use to get the next page of query results.""" + max_query_results: int | None = ... + """The maximum number of query results to display on a single page.""" + event_data_store_owner_account_id: str | None = ... + """The account ID of the event data store owner.""" + +@dataclass(kw_only=True) +class GetQueryResultsOutput(_SerdeShape): + """Dataclass for GetQueryResultsOutput structure.""" + + query_status: str | None = ... + """ + The status of the query. Values include `QUEUED`, `RUNNING`, `FINISHED`, + `FAILED`, `TIMED_OUT`, or `CANCELLED`. + """ + query_statistics: QueryStatistics | None = ... + """Shows the count of query results.""" + query_result_rows: list[list[dict[str, str]]] | None = ... + """Contains the individual event results of the query.""" + next_token: str | None = ... + """A token you can use to get the next page of query results.""" + error_message: str | None = ... + """The error message returned if a query failed.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetResourcePolicyInput(_SerdeShape): + """Dataclass for GetResourcePolicyInput structure.""" + + resource_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the CloudTrail event data store, + dashboard, or channel attached to the resource-based policy. + + Example event data store ARN format: + `arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE` + + Example dashboard ARN format: + `arn:aws:cloudtrail:us-east-1:123456789012:dashboard/exampleDash` + + Example channel ARN format: + `arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890` + """ + +@dataclass(kw_only=True) +class GetResourcePolicyOutput(_SerdeShape): + """Dataclass for GetResourcePolicyOutput structure.""" + + resource_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the CloudTrail event data store, + dashboard, or channel attached to resource-based policy. + + Example event data store ARN format: + `arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE` + + Example dashboard ARN format: + `arn:aws:cloudtrail:us-east-1:123456789012:dashboard/exampleDash` + + Example channel ARN format: + `arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890` + """ + resource_policy: str | None = ... + """ + A JSON-formatted string that contains the resource-based policy attached + to the CloudTrail event data store, dashboard, or channel. + """ + delegated_admin_resource_policy: str | None = ... + """ + The default resource-based policy that is automatically generated for + the delegated administrator of an Organizations organization. This + policy will be evaluated in tandem with any policy you submit for the + resource. For more information about this policy, see [Default resource + policy for delegated + administrators](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake-organizations.html#cloudtrail-lake-organizations-eds-rbp). + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetTrailInput(_SerdeShape): + """Dataclass for GetTrailInput structure.""" + + name: str | None = ... + """ + The name or the Amazon Resource Name (ARN) of the trail for which you + want to retrieve settings information. + """ + +@dataclass(kw_only=True) +class GetTrailOutput(_SerdeShape): + """Dataclass for GetTrailOutput structure.""" + + trail: Trail | None = ... + """The settings for a trail.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetTrailStatusInput(_SerdeShape): + """The name of a trail about which you want the current status.""" + + name: str | None = ... + """ + Specifies the name or the CloudTrail ARN of the trail for which you are + requesting status. To get the status of a shadow trail (a replication of + the trail in another Region), you must specify its ARN. + + The following is the format of a trail ARN: + `arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail` + + Note: + If the trail is an organization trail and you are a member account in + the organization in Organizations, you must provide the full ARN of that + trail, and not just the name. + """ + +@dataclass(kw_only=True) +class GetTrailStatusOutput(_SerdeShape): + """ + Returns the objects or data listed below if successful. Otherwise, + returns an error. + """ + + is_logging: bool | None = ... + """ + Whether the CloudTrail trail is currently logging Amazon Web Services + API calls. + """ + latest_delivery_error: str | None = ... + """ + Displays any Amazon S3 error that CloudTrail encountered when attempting + to deliver log files to the designated bucket. For more information, see + [Error + Responses](https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html) + in the Amazon S3 API Reference. + + Note: + This error occurs only when there is a problem with the destination S3 + bucket, and does not occur for requests that time out. To resolve the + issue, fix the [bucket + policy](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/create-s3-bucket-policy-for-cloudtrail.html) + so that CloudTrail can write to the bucket; or create a new bucket and + call `UpdateTrail` to specify the new bucket. + """ + latest_notification_error: str | None = ... + """ + Displays any Amazon SNS error that CloudTrail encountered when + attempting to send a notification. For more information about Amazon SNS + errors, see the [Amazon SNS Developer + Guide](https://docs.aws.amazon.com/sns/latest/dg/welcome.html). + """ + latest_delivery_time: datetime | None = ... + """ + Specifies the date and time that CloudTrail last delivered log files to + an account's Amazon S3 bucket. + """ + latest_notification_time: datetime | None = ... + """ + Specifies the date and time of the most recent Amazon SNS notification + that CloudTrail has written a new log file to an account's Amazon S3 + bucket. + """ + start_logging_time: datetime | None = ... + """ + Specifies the most recent date and time when CloudTrail started + recording API calls for an Amazon Web Services account. + """ + stop_logging_time: datetime | None = ... + """ + Specifies the most recent date and time when CloudTrail stopped + recording API calls for an Amazon Web Services account. + """ + latest_cloud_watch_logs_delivery_error: str | None = ... + """ + Displays any CloudWatch Logs error that CloudTrail encountered when + attempting to deliver logs to CloudWatch Logs. + """ + latest_cloud_watch_logs_delivery_time: datetime | None = ... + """ + Displays the most recent date and time when CloudTrail delivered logs to + CloudWatch Logs. + """ + latest_digest_delivery_time: datetime | None = ... + """ + Specifies the date and time that CloudTrail last delivered a digest file + to an account's Amazon S3 bucket. + """ + latest_digest_delivery_error: str | None = ... + """ + Displays any Amazon S3 error that CloudTrail encountered when attempting + to deliver a digest file to the designated bucket. For more information, + see [Error + Responses](https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html) + in the Amazon S3 API Reference. + + Note: + This error occurs only when there is a problem with the destination S3 + bucket, and does not occur for requests that time out. To resolve the + issue, fix the [bucket + policy](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/create-s3-bucket-policy-for-cloudtrail.html) + so that CloudTrail can write to the bucket; or create a new bucket and + call `UpdateTrail` to specify the new bucket. + """ + latest_delivery_attempt_time: str | None = ... + """This field is no longer in use.""" + latest_notification_attempt_time: str | None = ... + """This field is no longer in use.""" + latest_notification_attempt_succeeded: str | None = ... + """This field is no longer in use.""" + latest_delivery_attempt_succeeded: str | None = ... + """This field is no longer in use.""" + time_logging_started: str | None = ... + """This field is no longer in use.""" + time_logging_stopped: str | None = ... + """This field is no longer in use.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ImportFailureListItem(_SerdeShape): + """Provides information about an import failure.""" + + location: str | None = ... + """The location of the failure in the S3 bucket.""" + status: str | None = ... + """The status of the import.""" + error_type: str | None = ... + """The type of import error.""" + error_message: str | None = ... + """Provides the reason the import failed.""" + last_updated_time: datetime | None = ... + """When the import was last updated.""" + +class ImportFailureStatus(UnknownEnumMixin, StrEnum): + FAILED = "FAILED" + RETRY = "RETRY" + SUCCEEDED = "SUCCEEDED" + +@dataclass(kw_only=True) +class ImportNotFoundException(ServiceError, _SerdeShape): + """The specified import was not found.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ImportsListItem(_SerdeShape): + """ + Contains information about an import that was returned by a lookup + request. + """ + + import_id: str | None = ... + """The ID of the import.""" + import_status: str | None = ... + """The status of the import.""" + destinations: list[str] | None = ... + """The ARN of the destination event data store.""" + created_timestamp: datetime | None = ... + """The timestamp of the import's creation.""" + updated_timestamp: datetime | None = ... + """The timestamp of the import's last update.""" + +@dataclass(kw_only=True) +class ImportSource(_SerdeShape): + """The import source.""" + + s3: S3ImportSource + """The source S3 bucket.""" + +@dataclass(kw_only=True) +class ImportStatistics(_SerdeShape): + """ + Provides statistics for the specified `ImportID`. CloudTrail does not + update import statistics in real-time. Returned values for parameters + such as `EventsCompleted` may be lower than the actual value, because + CloudTrail updates statistics incrementally over the course of the + import. + """ + + prefixes_found: int | None = ... + """The number of S3 prefixes found for the import.""" + prefixes_completed: int | None = ... + """The number of S3 prefixes that completed import.""" + files_completed: int | None = ... + """The number of log files that completed import.""" + events_completed: int | None = ... + """The number of trail events imported into the event data store.""" + failed_entries: int | None = ... + """The number of failed entries.""" + +class ImportStatus(UnknownEnumMixin, StrEnum): + INITIALIZING = "INITIALIZING" + IN_PROGRESS = "IN_PROGRESS" + FAILED = "FAILED" + STOPPED = "STOPPED" + COMPLETED = "COMPLETED" + +@dataclass(kw_only=True) +class InactiveEventDataStoreException(ServiceError, _SerdeShape): + """The event data store is inactive.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InactiveQueryException(ServiceError, _SerdeShape): + """ + The specified query cannot be canceled because it is in the `FINISHED`, + `FAILED`, `TIMED_OUT`, or `CANCELLED` state. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class IngestionStatus(_SerdeShape): + """ + A table showing information about the most recent successful and failed + attempts to ingest events. + """ + + latest_ingestion_success_time: datetime | None = ... + """ + The time stamp of the most recent successful ingestion of events for the + channel. + """ + latest_ingestion_success_event_id: str | None = ... + """The event ID of the most recent successful ingestion of events.""" + latest_ingestion_error_code: str | None = ... + """The error code for the most recent failure to ingest events.""" + latest_ingestion_attempt_time: datetime | None = ... + """ + The time stamp of the most recent attempt to ingest events on the + channel. + """ + latest_ingestion_attempt_event_id: str | None = ... + """The event ID of the most recent attempt to ingest events.""" + +@dataclass(kw_only=True) +class InsightNotEnabledException(ServiceError, _SerdeShape): + """ + If you run `GetInsightSelectors` on a trail or event data store that + does not have Insights events enabled, the operation throws the + exception `InsightNotEnabledException`. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InsightSelector(_SerdeShape): + """ + A JSON string that contains a list of Insights types that are logged on + a trail or event data store. + """ + + insight_type: str | None = ... + """ + The type of Insights events to log on a trail or event data store. + `ApiCallRateInsight` and `ApiErrorRateInsight` are valid Insight types. + + The `ApiCallRateInsight` Insights type analyzes write-only management + API calls or read and write data API calls that are aggregated per + minute against a baseline API call volume. + + The `ApiErrorRateInsight` Insights type analyzes management and data API + calls that result in error codes. The error is shown if the API call is + unsuccessful. + """ + event_categories: list[str] | None = ... + """ + Select the event category on which Insights should be enabled. + + - If EventCategories is not provided, the specified Insights types are + enabled on management API calls by default. + + - If EventCategories is provided, the given event categories will + overwrite the existing ones. For example, if a trail already has + Insights enabled on management events, and then a PutInsightSelectors + request is made with only data events specified in EventCategories, + Insights on management events will be disabled. + """ + +class InsightsMetricDataType(UnknownEnumMixin, StrEnum): + FILL_WITH_ZEROS = "FillWithZeros" + NON_ZERO_DATA = "NonZeroData" + +class InsightType(UnknownEnumMixin, StrEnum): + API_CALL_RATE_INSIGHT = "ApiCallRateInsight" + API_ERROR_RATE_INSIGHT = "ApiErrorRateInsight" + +@dataclass(kw_only=True) +class InsufficientDependencyServiceAccessPermissionException(ServiceError, _SerdeShape): + """ + This exception is thrown when the IAM identity that is used to create + the organization resource lacks one or more required permissions for + creating an organization resource in a required service. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InsufficientEncryptionPolicyException(ServiceError, _SerdeShape): + """ + For the `CreateTrail` `PutInsightSelectors`, `UpdateTrail`, + `StartQuery`, and `StartImport` operations, this exception is thrown + when the policy on the S3 bucket or KMS key does not have sufficient + permissions for the operation. + + For all other operations, this exception is thrown when the policy for + the KMS key does not have sufficient permissions for the operation. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InsufficientIAMAccessPermissionException(ServiceError, _SerdeShape): + """ + The task can't be completed because you are signed in with an account + that lacks permissions to view or create a service-linked role. Sign in + with an account that has the required permissions and then try again. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InsufficientS3BucketPolicyException(ServiceError, _SerdeShape): + """ + This exception is thrown when the policy on the S3 bucket is not + sufficient. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InsufficientSnsTopicPolicyException(ServiceError, _SerdeShape): + """ + This exception is thrown when the policy on the Amazon SNS topic is not + sufficient. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidCloudWatchLogsLogGroupArnException(ServiceError, _SerdeShape): + """ + This exception is thrown when the provided CloudWatch Logs log group is + not valid. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidCloudWatchLogsRoleArnException(ServiceError, _SerdeShape): + """This exception is thrown when the provided role is not valid.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidDateRangeException(ServiceError, _SerdeShape): + """ + A date range for the query was specified that is not valid. Be sure that + the start time is chronologically before the end time. For more + information about writing a query, see [Create or edit a + query](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-create-edit-query.html) + in the *CloudTrail User Guide*. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidEventCategoryException(ServiceError, _SerdeShape): + """ + Occurs if an event category that is not valid is specified as a value of + `EventCategory`. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidEventDataStoreCategoryException(ServiceError, _SerdeShape): + """ + This exception is thrown when event categories of specified event data + stores are not valid. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidEventDataStoreStatusException(ServiceError, _SerdeShape): + """The event data store is not in a status that supports the operation.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidEventSelectorsException(ServiceError, _SerdeShape): + """ + This exception is thrown when the `PutEventSelectors` operation is + called with a number of event selectors, advanced event selectors, or + data resources that is not valid. The combination of event selectors or + advanced event selectors and data resources is not valid. A trail can + have up to 5 event selectors. If a trail uses advanced event selectors, + a maximum of 500 total values for all conditions in all advanced event + selectors is allowed. A trail is limited to 250 data resources. These + data resources can be distributed across event selectors, but the + overall total cannot exceed 250. + + You can: + + - Specify a valid number of event selectors (1 to 5) for a trail. + + - Specify a valid number of data resources (1 to 250) for an event + selector. The limit of number of resources on an individual event + selector is configurable up to 250. However, this upper limit is + allowed only if the total number of data resources does not exceed 250 + across all event selectors for a trail. + + - Specify up to 500 values for all conditions in all advanced event + selectors for a trail. + + - Specify a valid value for a parameter. For example, specifying the + `ReadWriteType` parameter with a value of `read-only` is not valid. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidHomeRegionException(ServiceError, _SerdeShape): + """ + This exception is thrown when an operation is called on a trail from a + Region other than the Region in which the trail was created. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidImportSourceException(ServiceError, _SerdeShape): + """ + This exception is thrown when the provided source S3 bucket is not valid + for import. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidInsightSelectorsException(ServiceError, _SerdeShape): + """ + For `PutInsightSelectors`, this exception is thrown when the formatting + or syntax of the `InsightSelectors` JSON statement is not valid, or the + specified `InsightType` in the `InsightSelectors` statement is not + valid. Valid values for `InsightType` are `ApiCallRateInsight` and + `ApiErrorRateInsight`. To enable Insights on an event data store, the + destination event data store specified by the `InsightsDestination` + parameter must log Insights events and the source event data store + specified by the `EventDataStore` parameter must log management events. + + For `UpdateEventDataStore`, this exception is thrown if Insights are + enabled on the event data store and the updated advanced event selectors + are not compatible with the configured `InsightSelectors`. If the + `InsightSelectors` includes an `InsightType` of `ApiCallRateInsight`, + the source event data store must log `write` management events. If the + `InsightSelectors` includes an `InsightType` of `ApiErrorRateInsight`, + the source event data store must log management events. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidKmsKeyIdException(ServiceError, _SerdeShape): + """This exception is thrown when the KMS key ARN is not valid.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidLookupAttributesException(ServiceError, _SerdeShape): + """Occurs when a lookup attribute is specified that is not valid.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidMaxResultsException(ServiceError, _SerdeShape): + """This exception is thrown if the limit specified is not valid.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidNextTokenException(ServiceError, _SerdeShape): + """ + A token that is not valid, or a token that was previously used in a + request with different parameters. This exception is thrown if the token + is not valid. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidParameterCombinationException(ServiceError, _SerdeShape): + """ + This exception is thrown when the combination of parameters provided is + not valid. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidParameterException(ServiceError, _SerdeShape): + """The request includes a parameter that is not valid.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidQueryStatementException(ServiceError, _SerdeShape): + """ + The query that was submitted has validation errors, or uses incorrect + syntax or unsupported keywords. For more information about writing a + query, see [Create or edit a + query](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-create-edit-query.html) + in the *CloudTrail User Guide*. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidQueryStatusException(ServiceError, _SerdeShape): + """The query status is not valid for the operation.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidS3BucketNameException(ServiceError, _SerdeShape): + """This exception is thrown when the provided S3 bucket name is not valid.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidS3PrefixException(ServiceError, _SerdeShape): + """This exception is thrown when the provided S3 prefix is not valid.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidSnsTopicNameException(ServiceError, _SerdeShape): + """This exception is thrown when the provided SNS topic name is not valid.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidSourceException(ServiceError, _SerdeShape): + """ + This exception is thrown when the specified value of `Source` is not + valid. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidTagParameterException(ServiceError, _SerdeShape): + """ + This exception is thrown when the specified tag key or values are not + valid. It can also occur if there are duplicate tags or too many tags on + the resource. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidTimeRangeException(ServiceError, _SerdeShape): + """ + Occurs if the timestamp values are not valid. Either the start time + occurs after the end time, or the time range is outside the range of + possible values. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidTokenException(ServiceError, _SerdeShape): + """Reserved for future use.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidTrailNameException(ServiceError, _SerdeShape): + """ + This exception is thrown when the provided trail name is not valid. + Trail names must meet the following requirements: + + - Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), + underscores (_), or dashes (-) + + - Start with a letter or number, and end with a letter or number + + - Be between 3 and 128 characters + + - Have no adjacent periods, underscores or dashes. Names like + `my-_namespace` and `my--namespace` are not valid. + + - Not be in IP address format (for example, 192.168.5.4) + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class KmsException(ServiceError, _SerdeShape): + """ + This exception is thrown when there is an issue with the specified KMS + key and the trail or event data store can't be updated. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class KmsKeyDisabledException(ServiceError, _SerdeShape): + """This exception is no longer in use.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class KmsKeyNotFoundException(ServiceError, _SerdeShape): + """ + This exception is thrown when the KMS key does not exist, when the S3 + bucket and the KMS key are not in the same Region, or when the KMS key + associated with the Amazon SNS topic either does not exist or is not in + the same Region. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListChannelsInput(_SerdeShape): + """Dataclass for ListChannelsInput structure.""" + + max_results: int | None = ... + """The maximum number of CloudTrail channels to display on a single page.""" + next_token: str | None = ... + """ + The token to use to get the next page of results after a previous API + call. This token must be passed in with the same parameters that were + specified in the original call. For example, if the original call + specified an AttributeKey of 'Username' with a value of 'root', the + call with NextToken should include those same parameters. + """ + +@dataclass(kw_only=True) +class ListChannelsOutput(_SerdeShape): + """Dataclass for ListChannelsOutput structure.""" + + channels: list[Channel] | None = ... + """The list of channels in the account.""" + next_token: str | None = ... + """ + The token to use to get the next page of results after a previous API + call. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListDashboardsInput(_SerdeShape): + """Dataclass for ListDashboardsInput structure.""" + + name_prefix: str | None = ... + """Specify a name prefix to filter on.""" + type: str | None = ... + """Specify a dashboard type to filter on: `CUSTOM` or `MANAGED`.""" + next_token: str | None = ... + """A token you can use to get the next page of dashboard results.""" + max_results: int | None = ... + """The maximum number of dashboards to display on a single page.""" + +@dataclass(kw_only=True) +class ListDashboardsOutput(_SerdeShape): + """Dataclass for ListDashboardsOutput structure.""" + + dashboards: list[DashboardDetail] | None = ... + """ + Contains information about dashboards in the account, in the current + Region that match the applied filters. + """ + next_token: str | None = ... + """A token you can use to get the next page of dashboard results.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListEventDataStoresInput(_SerdeShape): + """Dataclass for ListEventDataStoresInput structure.""" + + next_token: str | None = ... + """A token you can use to get the next page of event data store results.""" + max_results: int | None = ... + """The maximum number of event data stores to display on a single page.""" + +@dataclass(kw_only=True) +class ListEventDataStoresOutput(_SerdeShape): + """Dataclass for ListEventDataStoresOutput structure.""" + + event_data_stores: list[EventDataStore] | None = ... + """ + Contains information about event data stores in the account, in the + current Region. + """ + next_token: str | None = ... + """A token you can use to get the next page of results.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListImportFailuresInput(_SerdeShape): + """Dataclass for ListImportFailuresInput structure.""" + + import_id: str | None = ... + """The ID of the import.""" + max_results: int | None = ... + """The maximum number of failures to display on a single page.""" + next_token: str | None = ... + """A token you can use to get the next page of import failures.""" + +@dataclass(kw_only=True) +class ListImportFailuresOutput(_SerdeShape): + """Dataclass for ListImportFailuresOutput structure.""" + + failures: list[ImportFailureListItem] | None = ... + """Contains information about the import failures.""" + next_token: str | None = ... + """A token you can use to get the next page of results.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListImportsInput(_SerdeShape): + """Dataclass for ListImportsInput structure.""" + + max_results: int | None = ... + """The maximum number of imports to display on a single page.""" + destination: str | None = ... + """The ARN of the destination event data store.""" + import_status: str | None = ... + """The status of the import.""" + next_token: str | None = ... + """A token you can use to get the next page of import results.""" + +@dataclass(kw_only=True) +class ListImportsOutput(_SerdeShape): + """Dataclass for ListImportsOutput structure.""" + + imports: list[ImportsListItem] | None = ... + """The list of returned imports.""" + next_token: str | None = ... + """A token you can use to get the next page of import results.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class ListInsightsDataDimensionKey(UnknownEnumMixin, StrEnum): + EVENT_ID = "EventId" + EVENT_NAME = "EventName" + EVENT_SOURCE = "EventSource" + +@dataclass(kw_only=True) +class ListInsightsDataInput(_SerdeShape): + """Dataclass for ListInsightsDataInput structure.""" + + insight_source: str | None = ... + """ + The Amazon Resource Name(ARN) of the trail for which you want to + retrieve Insights events. + """ + data_type: str | None = ... + """ + Specifies the category of events returned. To fetch Insights events, + specify `InsightsEvents` as the value of `DataType` + """ + dimensions: dict[str, str] | None = ... + """ + Contains a map of dimensions. Currently the map can contain only one + item. + """ + start_time: datetime | None = ... + """ + Specifies that only events that occur after or at the specified time are + returned. If the specified start time is after the specified end time, + an error is returned. + """ + end_time: datetime | None = ... + """ + Specifies that only events that occur before or at the specified time + are returned. If the specified end time is before the specified start + time, an error is returned. + """ + max_results: int | None = ... + """ + The number of events to return. Possible values are 1 through 50. The + default is 50. + """ + next_token: str | None = ... + """ + The token to use to get the next page of results after a previous API + call. This token must be passed in with the same parameters that were + specified in the original call. For example, if the original call + specified a EventName as a dimension with `PutObject` as a value, the + call with NextToken should include those same parameters. + """ + +@dataclass(kw_only=True) +class ListInsightsDataOutput(_SerdeShape): + """Dataclass for ListInsightsDataOutput structure.""" + + events: list[Event] | None = ... + """ + A list of events returned based on the InsightSource, DataType or + Dimensions specified. The events list is sorted by time. The most recent + event is listed first. + """ + next_token: str | None = ... + """ + The token to use to get the next page of results after a previous API + call. If the token does not appear, there are no more results to return. + The token must be passed in with the same parameters as the previous + call. For example, if the original call specified a EventName as a + dimension with `PutObject` as a value, the call with NextToken should + include those same parameters. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class ListInsightsDataType(UnknownEnumMixin, StrEnum): + INSIGHTS_EVENTS = "InsightsEvents" + +@dataclass(kw_only=True) +class ListInsightsMetricDataInput(_SerdeShape): + """Dataclass for ListInsightsMetricDataInput structure.""" + + trail_name: str | None = ... + """ + The Amazon Resource Name(ARN) or name of the trail for which you want to + retrieve Insights metrics data. This parameter should only be provided + to fetch Insights metrics data generated on trails logging data events. + This parameter is not required for Insights metric data generated on + trails logging management events. + """ + event_source: str | None = ... + """ + The Amazon Web Services service to which the request was made, such as + `iam.amazonaws.com` or `s3.amazonaws.com`. + """ + event_name: str | None = ... + """ + The name of the event, typically the Amazon Web Services API on which + unusual levels of activity were recorded. + """ + insight_type: str | None = ... + """ + The type of CloudTrail Insights event, which is either + `ApiCallRateInsight` or `ApiErrorRateInsight`. The `ApiCallRateInsight` + Insights type analyzes write-only management API calls that are + aggregated per minute against a baseline API call volume. The + `ApiErrorRateInsight` Insights type analyzes management API calls that + result in error codes. + """ + error_code: str | None = ... + """ + Conditionally required if the `InsightType` parameter is set to + `ApiErrorRateInsight`. + + If returning metrics for the `ApiErrorRateInsight` Insights type, this + is the error to retrieve data for. For example, `AccessDenied`. + """ + start_time: datetime | None = ... + """ + Specifies, in UTC, the start time for time-series data. The value + specified is inclusive; results include data points with the specified + time stamp. + + The default is 90 days before the time of request. + """ + end_time: datetime | None = ... + """ + Specifies, in UTC, the end time for time-series data. The value + specified is exclusive; results include data points up to the specified + time stamp. + + The default is the time of request. + """ + period: int | None = ... + """ + Granularity of data to retrieve, in seconds. Valid values are `60`, + `300`, and `3600`. If you specify any other value, you will get an + error. The default is 3600 seconds. + """ + data_type: str | None = ... + """ + Type of data points to return. Valid values are `NonZeroData` and + `FillWithZeros`. The default is `NonZeroData`. + """ + max_results: int | None = ... + """ + The maximum number of data points to return. Valid values are integers + from 1 to 21600. The default value is 21600. + """ + next_token: str | None = ... + """ + Returned if all datapoints can't be returned in a single call. For + example, due to reaching `MaxResults`. + + Add this parameter to the request to continue retrieving results + starting from the last evaluated point. + """ + +@dataclass(kw_only=True) +class ListInsightsMetricDataOutput(_SerdeShape): + """Dataclass for ListInsightsMetricDataOutput structure.""" + + trail_arn: str | None = ... + """ + Specifies the ARN of the trail. This is only returned when Insights is + enabled on a trail logging data events. + """ + event_source: str | None = ... + """ + The Amazon Web Services service to which the request was made, such as + `iam.amazonaws.com` or `s3.amazonaws.com`. + """ + event_name: str | None = ... + """ + The name of the event, typically the Amazon Web Services API on which + unusual levels of activity were recorded. + """ + insight_type: str | None = ... + """ + The type of CloudTrail Insights event, which is either + `ApiCallRateInsight` or `ApiErrorRateInsight`. The `ApiCallRateInsight` + Insights type analyzes write-only management API calls that are + aggregated per minute against a baseline API call volume. The + `ApiErrorRateInsight` Insights type analyzes management API calls that + result in error codes. + """ + error_code: str | None = ... + """ + Only returned if `InsightType` parameter was set to + `ApiErrorRateInsight`. + + If returning metrics for the `ApiErrorRateInsight` Insights type, this + is the error to retrieve data for. For example, `AccessDenied`. + """ + timestamps: list[datetime] | None = ... + """ + List of timestamps at intervals corresponding to the specified time + period. + """ + values: list[float] | None = ... + """ + List of values representing the API call rate or error rate at each + timestamp. The number of values is equal to the number of timestamps. + """ + next_token: str | None = ... + """ + Only returned if the full results could not be returned in a single + query. You can set the `NextToken` parameter in the next request to this + value to continue retrieval. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListPublicKeysInput(_SerdeShape): + """Requests the public keys for a specified time range.""" + + start_time: datetime | None = ... + """ + Optionally specifies, in UTC, the start of the time range to look up + public keys for CloudTrail digest files. If not specified, the current + time is used, and the current public key is returned. + """ + end_time: datetime | None = ... + """ + Optionally specifies, in UTC, the end of the time range to look up + public keys for CloudTrail digest files. If not specified, the current + time is used. + """ + next_token: str | None = ... + """Reserved for future use.""" + +@dataclass(kw_only=True) +class ListPublicKeysOutput(_SerdeShape): + """ + Returns the objects or data listed below if successful. Otherwise, + returns an error. + """ + + public_key_list: list[PublicKey] | None = ... + """ + Contains an array of PublicKey objects. + + Note: + The returned public keys may have validity time ranges that overlap. + """ + next_token: str | None = ... + """Reserved for future use.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListQueriesInput(_SerdeShape): + """Dataclass for ListQueriesInput structure.""" + + event_data_store: str | None = ... + """ + The ARN (or the ID suffix of the ARN) of an event data store on which + queries were run. + """ + next_token: str | None = ... + """A token you can use to get the next page of results.""" + max_results: int | None = ... + """The maximum number of queries to show on a page.""" + start_time: datetime | None = ... + """ + Use with `EndTime` to bound a `ListQueries` request, and limit its + results to only those queries run within a specified time period. + """ + end_time: datetime | None = ... + """ + Use with `StartTime` to bound a `ListQueries` request, and limit its + results to only those queries run within a specified time period. + """ + query_status: str | None = ... + """ + The status of queries that you want to return in results. Valid values + for `QueryStatus` include `QUEUED`, `RUNNING`, `FINISHED`, `FAILED`, + `TIMED_OUT`, or `CANCELLED`. + """ + +@dataclass(kw_only=True) +class ListQueriesOutput(_SerdeShape): + """Dataclass for ListQueriesOutput structure.""" + + queries: list[Query] | None = ... + """ + Lists matching query results, and shows query ID, status, and creation + time of each query. + """ + next_token: str | None = ... + """A token you can use to get the next page of results.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListTagsInput(_SerdeShape): + """Specifies a list of tags to return.""" + + resource_id_list: list[str] | None = ... + """ + Specifies a list of trail, event data store, dashboard, or channel ARNs + whose tags will be listed. The list has a limit of 20 ARNs. + + Example trail ARN format: + `arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail` + + Example event data store ARN format: + `arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE` + + Example dashboard ARN format: + `arn:aws:cloudtrail:us-east-1:123456789012:dashboard/exampleDash` + + Example channel ARN format: + `arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890` + """ + next_token: str | None = ... + """Reserved for future use.""" + +@dataclass(kw_only=True) +class ListTagsOutput(_SerdeShape): + """ + Returns the objects or data listed below if successful. Otherwise, + returns an error. + """ + + resource_tag_list: list[ResourceTag] | None = ... + """A list of resource tags.""" + next_token: str | None = ... + """Reserved for future use.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListTrailsInput(_SerdeShape): + """Dataclass for ListTrailsInput structure.""" + + next_token: str | None = ... + """ + The token to use to get the next page of results after a previous API + call. This token must be passed in with the same parameters that were + specified in the original call. For example, if the original call + specified an AttributeKey of 'Username' with a value of 'root', the + call with NextToken should include those same parameters. + """ + +@dataclass(kw_only=True) +class ListTrailsOutput(_SerdeShape): + """Dataclass for ListTrailsOutput structure.""" + + trails: list[TrailInfo] | None = ... + """Returns the name, ARN, and home Region of trails in the current account.""" + next_token: str | None = ... + """ + The token to use to get the next page of results after a previous API + call. If the token does not appear, there are no more results to return. + The token must be passed in with the same parameters as the previous + call. For example, if the original call specified an AttributeKey of + 'Username' with a value of 'root', the call with NextToken should + include those same parameters. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class LookupAttribute(_SerdeShape): + """Specifies an attribute and value that filter the events returned.""" + + attribute_key: str + """Specifies an attribute on which to filter the events returned.""" + attribute_value: str + """ + Specifies a value for the specified `AttributeKey`. + + The maximum length for the `AttributeValue` is 2000 characters. The + following characters ('`_`', '` `', '`,`', '`\\n`') count as two + characters towards the 2000 character limit. + """ + +class LookupAttributeKey(UnknownEnumMixin, StrEnum): + EVENT_ID = "EventId" + EVENT_NAME = "EventName" + READ_ONLY = "ReadOnly" + USERNAME = "Username" + RESOURCE_TYPE = "ResourceType" + RESOURCE_NAME = "ResourceName" + EVENT_SOURCE = "EventSource" + ACCESS_KEY_ID = "AccessKeyId" + +@dataclass(kw_only=True) +class LookupEventsInput(_SerdeShape): + """Contains a request for LookupEvents.""" + + lookup_attributes: list[LookupAttribute] | None = ... + """ + Contains a list of lookup attributes. Currently the list can contain + only one item. + """ + start_time: datetime | None = ... + """ + Specifies that only events that occur after or at the specified time are + returned. If the specified start time is after the specified end time, + an error is returned. + """ + end_time: datetime | None = ... + """ + Specifies that only events that occur before or at the specified time + are returned. If the specified end time is before the specified start + time, an error is returned. + """ + event_category: str | None = ... + """ + Specifies the event category. If you do not specify an event category, + events of the category are not returned in the response. For example, if + you do not specify `insight` as the value of `EventCategory`, no + Insights events are returned. + """ + max_results: int | None = ... + """ + The number of events to return. Possible values are 1 through 50. The + default is 50. + """ + next_token: str | None = ... + """ + The token to use to get the next page of results after a previous API + call. This token must be passed in with the same parameters that were + specified in the original call. For example, if the original call + specified an AttributeKey of 'Username' with a value of 'root', the + call with NextToken should include those same parameters. + """ + +@dataclass(kw_only=True) +class LookupEventsOutput(_SerdeShape): + """Contains a response to a LookupEvents action.""" + + events: list[Event] | None = ... + """ + A list of events returned based on the lookup attributes specified and + the CloudTrail event. The events list is sorted by time. The most recent + event is listed first. + """ + next_token: str | None = ... + """ + The token to use to get the next page of results after a previous API + call. If the token does not appear, there are no more results to return. + The token must be passed in with the same parameters as the previous + call. For example, if the original call specified an AttributeKey of + 'Username' with a value of 'root', the call with NextToken should + include those same parameters. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class MaxConcurrentQueriesException(ServiceError, _SerdeShape): + """ + You are already running the maximum number of concurrent queries. The + maximum number of concurrent queries is 10. Wait a minute for some + queries to finish, and then run the query again. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class MaxEventSize(UnknownEnumMixin, StrEnum): + STANDARD = "Standard" + LARGE = "Large" + +@dataclass(kw_only=True) +class MaximumNumberOfTrailsExceededException(ServiceError, _SerdeShape): + """This exception is thrown when the maximum number of trails is reached.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class NoManagementAccountSLRExistsException(ServiceError, _SerdeShape): + """ + This exception is thrown when the management account does not have a + service-linked role. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class NotOrganizationManagementAccountException(ServiceError, _SerdeShape): + """ + This exception is thrown when the account making the request is not the + organization's management account. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class NotOrganizationMasterAccountException(ServiceError, _SerdeShape): + """ + This exception is thrown when the Amazon Web Services account making the + request to create or update an organization trail or event data store is + not the management account for an organization in Organizations. For + more information, see [Prepare For Creating a Trail For Your + Organization](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html) + or [Organization event data + stores](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake-organizations.html). + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class OperationNotPermittedException(ServiceError, _SerdeShape): + """This exception is thrown when the requested operation is not permitted.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class OrganizationNotInAllFeaturesModeException(ServiceError, _SerdeShape): + """ + This exception is thrown when Organizations is not configured to support + all features. All features must be enabled in Organizations to support + creating an organization trail or event data store. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class OrganizationsNotInUseException(ServiceError, _SerdeShape): + """ + This exception is thrown when the request is made from an Amazon Web + Services account that is not a member of an organization. To make this + request, sign in using the credentials of an account that belongs to an + organization. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class PartitionKey(_SerdeShape): + """Contains information about a partition key for an event data store.""" + + name: str + """The name of the partition key.""" + type: str + """The data type of the partition key. For example, `bigint` or `string`.""" + +@dataclass(kw_only=True) +class PublicKey(_SerdeShape): + """Contains information about a returned public key.""" + + value: bytes | None = ... + """The DER encoded public key value in PKCS#1 format.""" + validity_start_time: datetime | None = ... + """The starting time of validity of the public key.""" + validity_end_time: datetime | None = ... + """The ending time of validity of the public key.""" + fingerprint: str | None = ... + """The fingerprint of the public key.""" + +@dataclass(kw_only=True) +class PutEventConfigurationInput(_SerdeShape): + """Dataclass for PutEventConfigurationInput structure.""" + + trail_name: str | None = ... + """ + The name of the trail for which you want to update event configuration + settings. + """ + event_data_store: str | None = ... + """ + The Amazon Resource Name (ARN) or ID suffix of the ARN of the event data + store for which event configuration settings are updated. + """ + max_event_size: str | None = ... + """ + The maximum allowed size for events to be stored in the specified event + data store. If you are using context key selectors, MaxEventSize must be + set to Large. + """ + context_key_selectors: list[ContextKeySelector] | None = ... + """ + A list of context key selectors that will be included to provide + enriched event data. + """ + aggregation_configurations: list[AggregationConfiguration] | None = ... + """ + The list of aggregation configurations that you want to configure for + the trail. + """ + +@dataclass(kw_only=True) +class PutEventConfigurationOutput(_SerdeShape): + """Dataclass for PutEventConfigurationOutput structure.""" + + trail_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the trail that has aggregation + enabled. + """ + event_data_store_arn: str | None = ... + """ + The Amazon Resource Name (ARN) or ID suffix of the ARN of the event data + store for which the event configuration settings were updated. + """ + max_event_size: str | None = ... + """ + The maximum allowed size for events stored in the specified event data + store. + """ + context_key_selectors: list[ContextKeySelector] | None = ... + """ + The list of context key selectors that are configured for the event data + store. + """ + aggregation_configurations: list[AggregationConfiguration] | None = ... + """A list of aggregation configurations that are configured for the trail.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class PutEventSelectorsInput(_SerdeShape): + """Dataclass for PutEventSelectorsInput structure.""" + + trail_name: str | None = ... + """ + Specifies the name of the trail or trail ARN. If you specify a trail + name, the string must meet the following requirements: + + - Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), + underscores (_), or dashes (-) + + - Start with a letter or number, and end with a letter or number + + - Be between 3 and 128 characters + + - Have no adjacent periods, underscores or dashes. Names like + `my-_namespace` and `my--namespace` are not valid. + + - Not be in IP address format (for example, 192.168.5.4) + + If you specify a trail ARN, it must be in the following format. + + `arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail` + """ + event_selectors: list[EventSelector] | None = ... + """ + Specifies the settings for your event selectors. You can use event + selectors to log management events and data events for the following + resource types: + + - `AWS::DynamoDB::Table` + + - `AWS::Lambda::Function` + + - `AWS::S3::Object` + + You can't use event selectors to log network activity events. + + You can configure up to five event selectors for a trail. You can use + either `EventSelectors` or `AdvancedEventSelectors` in a + `PutEventSelectors` request, but not both. If you apply `EventSelectors` + to a trail, any existing `AdvancedEventSelectors` are overwritten. + """ + advanced_event_selectors: list[AdvancedEventSelector] | None = ... + """ + Specifies the settings for advanced event selectors. You can use + advanced event selectors to log management events, data events for all + resource types, and network activity events. + + You can add advanced event selectors, and conditions for your advanced + event selectors, up to a maximum of 500 values for all conditions and + selectors on a trail. You can use either `AdvancedEventSelectors` or + `EventSelectors`, but not both. If you apply `AdvancedEventSelectors` to + a trail, any existing `EventSelectors` are overwritten. For more + information about advanced event selectors, see [Logging data + events](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html) + and [Logging network activity + events](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-network-events-with-cloudtrail.html) + in the *CloudTrail User Guide*. + """ + +@dataclass(kw_only=True) +class PutEventSelectorsOutput(_SerdeShape): + """Dataclass for PutEventSelectorsOutput structure.""" + + trail_arn: str | None = ... + """ + Specifies the ARN of the trail that was updated with event selectors. + The following is the format of a trail ARN. + + `arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail` + """ + event_selectors: list[EventSelector] | None = ... + """Specifies the event selectors configured for your trail.""" + advanced_event_selectors: list[AdvancedEventSelector] | None = ... + """Specifies the advanced event selectors configured for your trail.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class PutInsightSelectorsInput(_SerdeShape): + """Dataclass for PutInsightSelectorsInput structure.""" + + trail_name: str | None = ... + """ + The name of the CloudTrail trail for which you want to change or add + Insights selectors. + + You cannot use this parameter with the `EventDataStore` and + `InsightsDestination` parameters. + """ + insight_selectors: list[InsightSelector] | None = ... + """ + Contains the Insights types you want to log on a specific category of + events on a trail or event data store. `ApiCallRateInsight` and + `ApiErrorRateInsight` are valid Insight types.The EventCategory field + can specify `Management` or `Data` events or both. For event data store, + you can log Insights for management events only. + + The `ApiCallRateInsight` Insights type analyzes write-only management + API calls or read and write data API calls that are aggregated per + minute against a baseline API call volume. + + The `ApiErrorRateInsight` Insights type analyzes management and data API + calls that result in error codes. The error is shown if the API call is + unsuccessful. + """ + event_data_store: str | None = ... + """ + The ARN (or ID suffix of the ARN) of the source event data store for + which you want to change or add Insights selectors. To enable Insights + on an event data store, you must provide both the `EventDataStore` and + `InsightsDestination` parameters. + + You cannot use this parameter with the `TrailName` parameter. + """ + insights_destination: str | None = ... + """ + The ARN (or ID suffix of the ARN) of the destination event data store + that logs Insights events. To enable Insights on an event data store, + you must provide both the `EventDataStore` and `InsightsDestination` + parameters. + + You cannot use this parameter with the `TrailName` parameter. + """ + +@dataclass(kw_only=True) +class PutInsightSelectorsOutput(_SerdeShape): + """Dataclass for PutInsightSelectorsOutput structure.""" + + trail_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of a trail for which you want to change + or add Insights selectors. + """ + insight_selectors: list[InsightSelector] | None = ... + """ + Contains the Insights types you want to log on a specific category of + events in a trail or event data store. `ApiCallRateInsight` and + `ApiErrorRateInsight` are valid Insight types.The EventCategory field + can specify `Management` or `Data` events or both. For event data store, + you can only log Insights for management events only. + """ + event_data_store_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the source event data store for which + you want to change or add Insights selectors. + """ + insights_destination: str | None = ... + """The ARN of the destination event data store that logs Insights events.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class PutResourcePolicyInput(_SerdeShape): + """Dataclass for PutResourcePolicyInput structure.""" + + resource_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the CloudTrail event data store, + dashboard, or channel attached to the resource-based policy. + + Example event data store ARN format: + `arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE` + + Example dashboard ARN format: + `arn:aws:cloudtrail:us-east-1:123456789012:dashboard/exampleDash` + + Example channel ARN format: + `arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890` + """ + resource_policy: str | None = ... + """ + A JSON-formatted string for an Amazon Web Services resource-based + policy. + + For example resource-based policies, see [CloudTrail resource-based + policy + examples](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/security_iam_resource-based-policy-examples.html) + in the *CloudTrail User Guide*. + """ + +@dataclass(kw_only=True) +class PutResourcePolicyOutput(_SerdeShape): + """Dataclass for PutResourcePolicyOutput structure.""" + + resource_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the CloudTrail event data store, + dashboard, or channel attached to the resource-based policy. + + Example event data store ARN format: + `arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE` + + Example dashboard ARN format: + `arn:aws:cloudtrail:us-east-1:123456789012:dashboard/exampleDash` + + Example channel ARN format: + `arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890` + """ + resource_policy: str | None = ... + """ + The JSON-formatted string of the Amazon Web Services resource-based + policy attached to the CloudTrail event data store, dashboard, or + channel. + """ + delegated_admin_resource_policy: str | None = ... + """ + The default resource-based policy that is automatically generated for + the delegated administrator of an Organizations organization. This + policy will be evaluated in tandem with any policy you submit for the + resource. For more information about this policy, see [Default resource + policy for delegated + administrators](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake-organizations.html#cloudtrail-lake-organizations-eds-rbp). + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class Query(_SerdeShape): + """ + A SQL string of criteria about events that you want to collect in an + event data store. + """ + + query_id: str | None = ... + """The ID of a query.""" + query_status: str | None = ... + """ + The status of the query. This can be `QUEUED`, `RUNNING`, `FINISHED`, + `FAILED`, `TIMED_OUT`, or `CANCELLED`. + """ + creation_time: datetime | None = ... + """The creation time of a query.""" + +@dataclass(kw_only=True) +class QueryIdNotFoundException(ServiceError, _SerdeShape): + """The query ID does not exist or does not map to a query.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class QueryStatistics(_SerdeShape): + """Metadata about a query, such as the number of results.""" + + results_count: int | None = ... + """The number of results returned.""" + total_results_count: int | None = ... + """The total number of results returned by a query.""" + bytes_scanned: int | None = ... + """ + The total bytes that the query scanned in the event data store. This + value matches the number of bytes for which your account is billed for + the query, unless the query is still running. + """ + +@dataclass(kw_only=True) +class QueryStatisticsForDescribeQuery(_SerdeShape): + """ + Gets metadata about a query, including the number of events that were + matched, the total number of events scanned, the query run time in + milliseconds, and the query's creation time. + """ + + events_matched: int | None = ... + """The number of events that matched a query.""" + events_scanned: int | None = ... + """The number of events that the query scanned in the event data store.""" + bytes_scanned: int | None = ... + """ + The total bytes that the query scanned in the event data store. This + value matches the number of bytes for which your account is billed for + the query, unless the query is still running. + """ + execution_time_in_millis: int | None = ... + """The query's run time, in milliseconds.""" + creation_time: datetime | None = ... + """The creation time of the query.""" + +class QueryStatus(UnknownEnumMixin, StrEnum): + QUEUED = "QUEUED" + RUNNING = "RUNNING" + FINISHED = "FINISHED" + FAILED = "FAILED" + CANCELLED = "CANCELLED" + TIMED_OUT = "TIMED_OUT" + +class ReadWriteType(UnknownEnumMixin, StrEnum): + READ_ONLY = "ReadOnly" + WRITE_ONLY = "WriteOnly" + ALL = "All" + +@dataclass(kw_only=True) +class RefreshSchedule(_SerdeShape): + """The schedule for a dashboard refresh.""" + + frequency: RefreshScheduleFrequency | None = ... + """The frequency at which you want the dashboard refreshed.""" + status: str | None = ... + """ + Specifies whether the refresh schedule is enabled. Set the value to + `ENABLED` to enable the refresh schedule, or to `DISABLED` to turn off + the refresh schedule. + """ + time_of_day: str | None = ... + """ + The time of day in UTC to run the schedule; for hourly only refer to + minutes; default is 00:00. + """ + +@dataclass(kw_only=True) +class RefreshScheduleFrequency(_SerdeShape): + """ + Specifies the frequency for a dashboard refresh schedule. + + For a custom dashboard, you can schedule a refresh for every 1, 6, 12, + or 24 hours, or every day. + """ + + unit: str | None = ... + """ + The unit to use for the refresh. + + For custom dashboards, the unit can be `HOURS` or `DAYS`. + + For the Highlights dashboard, the `Unit` must be `HOURS`. + """ + value: int | None = ... + """ + The value for the refresh schedule. + + For custom dashboards, the following values are valid when the unit is + `HOURS`: `1`, `6`, `12`, `24` + + For custom dashboards, the only valid value when the unit is `DAYS` is + `1`. + + For the Highlights dashboard, the `Value` must be `6`. + """ + +class RefreshScheduleFrequencyUnit(UnknownEnumMixin, StrEnum): + HOURS = "HOURS" + DAYS = "DAYS" + +class RefreshScheduleStatus(UnknownEnumMixin, StrEnum): + ENABLED = "ENABLED" + DISABLED = "DISABLED" + +@dataclass(kw_only=True) +class RegisterOrganizationDelegatedAdminInput(_SerdeShape): + """ + Specifies an organization member account ID as a CloudTrail delegated + administrator. + """ + + member_account_id: str | None = ... + """ + An organization member account ID that you want to designate as a + delegated administrator. + """ + +@dataclass(kw_only=True) +class RegisterOrganizationDelegatedAdminOutput(_SerdeShape): + """ + Returns the following response if successful. Otherwise, returns an + error. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class RemoveTagsInput(_SerdeShape): + """ + Specifies the tags to remove from a trail, event data store, dashboard, + or channel. + """ + + resource_id: str | None = ... + """ + Specifies the ARN of the trail, event data store, dashboard, or channel + from which tags should be removed. + + Example trail ARN format: + `arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail` + + Example event data store ARN format: + `arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE` + + Example dashboard ARN format: + `arn:aws:cloudtrail:us-east-1:123456789012:dashboard/exampleDash` + + Example channel ARN format: + `arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890` + """ + tags_list: list[Tag] | None = ... + """Specifies a list of tags to be removed.""" + +@dataclass(kw_only=True) +class RemoveTagsOutput(_SerdeShape): + """ + Returns the objects or data listed below if successful. Otherwise, + returns an error. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class RequestWidget(_SerdeShape): + """Contains information about a widget on a CloudTrail Lake dashboard.""" + + query_statement: str + """ + The query statement for the widget. For custom dashboard widgets, you + can query across multiple event data stores as long as all event data + stores exist in your account. + + Note: + When a query uses `?` with `eventTime`, `?` must be surrounded by single + quotes as follows: `'?'`. + """ + query_parameters: list[str] | None = ... + """ + The optional query parameters. The following query parameters are valid: + `$StartTime$`, `$EndTime$`, and `$Period$`. + """ + view_properties: dict[str, str] + """ + The view properties for the widget. For more information about view + properties, see [View properties for + widgets](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/lake-widget-properties.html) + in the *CloudTrail User Guide*. + """ + +@dataclass(kw_only=True) +class Resource(_SerdeShape): + """Specifies the type and name of a resource referenced by an event.""" + + resource_type: str | None = ... + """ + The type of a resource referenced by the event returned. When the + resource type cannot be determined, null is returned. Some examples of + resource types are: **Instance** for EC2, **Trail** for CloudTrail, + **DBInstance** for Amazon RDS, and **AccessKey** for IAM. To learn more + about how to look up and filter events by the resource types supported + for a service, see [Filtering CloudTrail + Events](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/view-cloudtrail-events-console.html#filtering-cloudtrail-events). + """ + resource_name: str | None = ... + """ + The name of the resource referenced by the event returned. These are + user-created names whose values will depend on the environment. For + example, the resource name might be \"auto-scaling-test-group\" for an + Auto Scaling Group or \"i-1234567\" for an EC2 Instance. + """ + +@dataclass(kw_only=True) +class ResourceARNNotValidException(ServiceError, _SerdeShape): + """ + This exception is thrown when the provided resource does not exist, or + the ARN format of the resource is not valid. + + The following is the format of an event data store ARN: + `arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE` + + The following is the format of a dashboard ARN: + `arn:aws:cloudtrail:us-east-1:123456789012:dashboard/exampleDash` + + The following is the format of a channel ARN: + `arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890` + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ResourceNotFoundException(ServiceError, _SerdeShape): + """This exception is thrown when the specified resource is not found.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ResourcePolicyNotFoundException(ServiceError, _SerdeShape): + """ + This exception is thrown when the specified resource policy is not + found. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ResourcePolicyNotValidException(ServiceError, _SerdeShape): + """ + This exception is thrown when the resouce-based policy has syntax + errors, or contains a principal that is not valid. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ResourceTag(_SerdeShape): + """A resource tag.""" + + resource_id: str | None = ... + """Specifies the ARN of the resource.""" + tags_list: list[Tag] | None = ... + """A list of tags.""" + +@dataclass(kw_only=True) +class ResourceTypeNotSupportedException(ServiceError, _SerdeShape): + """ + This exception is thrown when the specified resource type is not + supported by CloudTrail. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class RestoreEventDataStoreInput(_SerdeShape): + """Dataclass for RestoreEventDataStoreInput structure.""" + + event_data_store: str | None = ... + """ + The ARN (or the ID suffix of the ARN) of the event data store that you + want to restore. + """ + +@dataclass(kw_only=True) +class RestoreEventDataStoreOutput(_SerdeShape): + """Dataclass for RestoreEventDataStoreOutput structure.""" + + event_data_store_arn: str | None = ... + """The event data store ARN.""" + name: str | None = ... + """The name of the event data store.""" + status: str | None = ... + """The status of the event data store.""" + advanced_event_selectors: list[AdvancedEventSelector] | None = ... + """The advanced event selectors that were used to select events.""" + multi_region_enabled: bool | None = ... + """ + Indicates whether the event data store is collecting events from all + Regions, or only from the Region in which the event data store was + created. + """ + organization_enabled: bool | None = ... + """ + Indicates whether an event data store is collecting logged events for an + organization in Organizations. + """ + retention_period: int | None = ... + """The retention period, in days.""" + termination_protection_enabled: bool | None = ... + """ + Indicates that termination protection is enabled and the event data + store cannot be automatically deleted. + """ + created_timestamp: datetime | None = ... + """The timestamp of an event data store's creation.""" + updated_timestamp: datetime | None = ... + """ + The timestamp that shows when an event data store was updated, if + applicable. `UpdatedTimestamp` is always either the same or newer than + the time shown in `CreatedTimestamp`. + """ + kms_key_id: str | None = ... + """ + Specifies the KMS key ID that encrypts the events delivered by + CloudTrail. The value is a fully specified ARN to a KMS key in the + following format. + + `arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012` + """ + billing_mode: str | None = ... + """The billing mode for the event data store.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class S3BucketDoesNotExistException(ServiceError, _SerdeShape): + """This exception is thrown when the specified S3 bucket does not exist.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class S3ImportSource(_SerdeShape): + """The settings for the source S3 bucket.""" + + s3_location_uri: str + """The URI for the source S3 bucket.""" + s3_bucket_region: str + """The Region associated with the source S3 bucket.""" + s3_bucket_access_role_arn: str + """The IAM ARN role used to access the source S3 bucket.""" + +@dataclass(kw_only=True) +class SearchSampleQueriesInput(_SerdeShape): + """Dataclass for SearchSampleQueriesInput structure.""" + + search_phrase: str | None = ... + """ + The natural language phrase to use for the semantic search. The phrase + must be in English. The length constraint is in characters, not words. + """ + max_results: int | None = ... + """ + The maximum number of results to return on a single page. The default + value is 10. + """ + next_token: str | None = ... + """ + A token you can use to get the next page of results. The length + constraint is in characters, not words. + """ + +@dataclass(kw_only=True) +class SearchSampleQueriesOutput(_SerdeShape): + """Dataclass for SearchSampleQueriesOutput structure.""" + + search_results: list[SearchSampleQueriesSearchResult] | None = ... + """ + A list of objects containing the search results ordered from most + relevant to least relevant. + """ + next_token: str | None = ... + """A token you can use to get the next page of results.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class SearchSampleQueriesSearchResult(_SerdeShape): + """A search result returned by the `SearchSampleQueries` operation.""" + + name: str | None = ... + """The name of a sample query.""" + description: str | None = ... + """A longer description of a sample query.""" + sql: str | None = ... + """The SQL code of the sample query.""" + relevance: float = ... + """ + A value between 0 and 1 indicating the similarity between the search + phrase and result. + """ + +@dataclass(kw_only=True) +class ServiceQuotaExceededException(ServiceError, _SerdeShape): + """ + This exception is thrown when the quota is exceeded. For information + about CloudTrail quotas, see [Service + quotas](https://docs.aws.amazon.com/general/latest/gr/ct.html#limits_cloudtrail) + in the *Amazon Web Services General Reference*. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class SourceConfig(_SerdeShape): + """Contains configuration information about the channel.""" + + apply_to_all_regions: bool | None = ... + """ + Specifies whether the channel applies to a single Region or to all + Regions. + """ + advanced_event_selectors: list[AdvancedEventSelector] | None = ... + """The advanced event selectors that are configured for the channel.""" + +class SourceEventCategory(UnknownEnumMixin, StrEnum): + MANAGEMENT = "Management" + DATA = "Data" + +@dataclass(kw_only=True) +class StartDashboardRefreshInput(_SerdeShape): + """Dataclass for StartDashboardRefreshInput structure.""" + + dashboard_id: str | None = ... + """The name or ARN of the dashboard.""" + query_parameter_values: dict[str, str] | None = ... + """ + The query parameter values for the dashboard + + For custom dashboards, the following query parameters are valid: + `$StartTime$`, `$EndTime$`, and `$Period$`. + + For managed dashboards, the following query parameters are valid: + `$StartTime$`, `$EndTime$`, `$Period$`, and `$EventDataStoreId$`. The + `$EventDataStoreId$` query parameter is required. + """ + +@dataclass(kw_only=True) +class StartDashboardRefreshOutput(_SerdeShape): + """Dataclass for StartDashboardRefreshOutput structure.""" + + refresh_id: str | None = ... + """The refresh ID for the dashboard.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class StartEventDataStoreIngestionInput(_SerdeShape): + """Dataclass for StartEventDataStoreIngestionInput structure.""" + + event_data_store: str | None = ... + """ + The ARN (or ID suffix of the ARN) of the event data store for which you + want to start ingestion. + """ + +@dataclass(kw_only=True) +class StartEventDataStoreIngestionOutput(_SerdeShape): + """Dataclass for StartEventDataStoreIngestionOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class StartImportInput(_SerdeShape): + """Dataclass for StartImportInput structure.""" + + destinations: list[str] | None = ... + """ + The ARN of the destination event data store. Use this parameter for a + new import. + """ + import_source: ImportSource | None = ... + """ + The source S3 bucket for the import. Use this parameter for a new + import. + """ + start_event_time: datetime | None = ... + """ + Use with `EndEventTime` to bound a `StartImport` request, and limit + imported trail events to only those events logged within a specified + time period. When you specify a time range, CloudTrail checks the prefix + and log file names to verify the names contain a date between the + specified `StartEventTime` and `EndEventTime` before attempting to + import events. + """ + end_event_time: datetime | None = ... + """ + Use with `StartEventTime` to bound a `StartImport` request, and limit + imported trail events to only those events logged within a specified + time period. When you specify a time range, CloudTrail checks the prefix + and log file names to verify the names contain a date between the + specified `StartEventTime` and `EndEventTime` before attempting to + import events. + """ + import_id: str | None = ... + """ + The ID of the import. Use this parameter when you are retrying an + import. + """ + +@dataclass(kw_only=True) +class StartImportOutput(_SerdeShape): + """Dataclass for StartImportOutput structure.""" + + import_id: str | None = ... + """The ID of the import.""" + destinations: list[str] | None = ... + """The ARN of the destination event data store.""" + import_source: ImportSource | None = ... + """The source S3 bucket for the import.""" + start_event_time: datetime | None = ... + """ + Used with `EndEventTime` to bound a `StartImport` request, and limit + imported trail events to only those events logged within a specified + time period. + """ + end_event_time: datetime | None = ... + """ + Used with `StartEventTime` to bound a `StartImport` request, and limit + imported trail events to only those events logged within a specified + time period. + """ + import_status: str | None = ... + """ + Shows the status of the import after a `StartImport` request. An import + finishes with a status of `COMPLETED` if there were no failures, or + `FAILED` if there were failures. + """ + created_timestamp: datetime | None = ... + """The timestamp for the import's creation.""" + updated_timestamp: datetime | None = ... + """The timestamp of the import's last update, if applicable.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class StartLoggingInput(_SerdeShape): + """ + The request to CloudTrail to start logging Amazon Web Services API calls + for an account. + """ + + name: str | None = ... + """ + Specifies the name or the CloudTrail ARN of the trail for which + CloudTrail logs Amazon Web Services API calls. The following is the + format of a trail ARN. + + `arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail` + """ + +@dataclass(kw_only=True) +class StartLoggingOutput(_SerdeShape): + """ + Returns the objects or data listed below if successful. Otherwise, + returns an error. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class StartQueryInput(_SerdeShape): + """Dataclass for StartQueryInput structure.""" + + query_statement: str | None = ... + """The SQL code of your query.""" + delivery_s3_uri: str | None = ... + """The URI for the S3 bucket where CloudTrail delivers the query results.""" + query_alias: str | None = ... + """The alias that identifies a query template.""" + query_parameters: list[str] | None = ... + """The query parameters for the specified `QueryAlias`.""" + event_data_store_owner_account_id: str | None = ... + """The account ID of the event data store owner.""" + +@dataclass(kw_only=True) +class StartQueryOutput(_SerdeShape): + """Dataclass for StartQueryOutput structure.""" + + query_id: str | None = ... + """The ID of the started query.""" + event_data_store_owner_account_id: str | None = ... + """The account ID of the event data store owner.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class StopEventDataStoreIngestionInput(_SerdeShape): + """Dataclass for StopEventDataStoreIngestionInput structure.""" + + event_data_store: str | None = ... + """ + The ARN (or ID suffix of the ARN) of the event data store for which you + want to stop ingestion. + """ + +@dataclass(kw_only=True) +class StopEventDataStoreIngestionOutput(_SerdeShape): + """Dataclass for StopEventDataStoreIngestionOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class StopImportInput(_SerdeShape): + """Dataclass for StopImportInput structure.""" + + import_id: str | None = ... + """The ID of the import.""" + +@dataclass(kw_only=True) +class StopImportOutput(_SerdeShape): + """Dataclass for StopImportOutput structure.""" + + import_id: str | None = ... + """The ID for the import.""" + import_source: ImportSource | None = ... + """The source S3 bucket for the import.""" + destinations: list[str] | None = ... + """The ARN of the destination event data store.""" + import_status: str | None = ... + """The status of the import.""" + created_timestamp: datetime | None = ... + """The timestamp of the import's creation.""" + updated_timestamp: datetime | None = ... + """The timestamp of the import's last update.""" + start_event_time: datetime | None = ... + """ + Used with `EndEventTime` to bound a `StartImport` request, and limit + imported trail events to only those events logged within a specified + time period. + """ + end_event_time: datetime | None = ... + """ + Used with `StartEventTime` to bound a `StartImport` request, and limit + imported trail events to only those events logged within a specified + time period. + """ + import_statistics: ImportStatistics | None = ... + """Returns information on the stopped import.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class StopLoggingInput(_SerdeShape): + """ + Passes the request to CloudTrail to stop logging Amazon Web Services API + calls for the specified account. + """ + + name: str | None = ... + """ + Specifies the name or the CloudTrail ARN of the trail for which + CloudTrail will stop logging Amazon Web Services API calls. The + following is the format of a trail ARN. + + `arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail` + """ + +@dataclass(kw_only=True) +class StopLoggingOutput(_SerdeShape): + """ + Returns the objects or data listed below if successful. Otherwise, + returns an error. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class Tag(_SerdeShape): + """ + A custom key-value pair associated with a resource such as a CloudTrail + trail, event data store, dashboard, or channel. + """ + + key: str + """ + The key in a key-value pair. The key must be must be no longer than 128 + Unicode characters. The key must be unique for the resource to which it + applies. + """ + value: str | None = ... + """ + The value in a key-value pair of a tag. The value must be no longer than + 256 Unicode characters. + """ + +@dataclass(kw_only=True) +class TagsLimitExceededException(ServiceError, _SerdeShape): + """ + The number of tags per trail, event data store, dashboard, or channel + has exceeded the permitted amount. Currently, the limit is 50. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class Template(UnknownEnumMixin, StrEnum): + """ + Specifies the type of the aggregation templates in the aggregation + configuration. Valid values include API_ACTIVITY, RESOURCE_ACCESS and + USER_ACTIONS. + """ + + API_ACTIVITY = "API_ACTIVITY" + RESOURCE_ACCESS = "RESOURCE_ACCESS" + USER_ACTIONS = "USER_ACTIONS" + +@dataclass(kw_only=True) +class ThrottlingException(ServiceError, _SerdeShape): + """This exception is thrown when the request rate exceeds the limit.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class Trail(_SerdeShape): + """The settings for a trail.""" + + name: str | None = ... + """ + Name of the trail set by calling CreateTrail. The maximum length is 128 + characters. + """ + s3_bucket_name: str | None = ... + """ + Name of the Amazon S3 bucket into which CloudTrail delivers your trail + files. See [Amazon S3 Bucket naming + rules](https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html). + """ + s3_key_prefix: str | None = ... + """ + Specifies the Amazon S3 key prefix that comes after the name of the + bucket you have designated for log file delivery. For more information, + see [Finding Your CloudTrail Log + Files](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/get-and-view-cloudtrail-log-files.html#cloudtrail-find-log-files). + The maximum length is 200 characters. + """ + sns_topic_name: str | None = ... + """This field is no longer in use. Use `SnsTopicARN`.""" + sns_topic_arn: str | None = ... + """ + Specifies the ARN of the Amazon SNS topic that CloudTrail uses to send + notifications when log files are delivered. The following is the format + of a topic ARN. + + `arn:aws:sns:us-east-2:123456789012:MyTopic` + """ + include_global_service_events: bool | None = ... + """ + Set to **True** to include Amazon Web Services API calls from Amazon Web + Services global services such as IAM. Otherwise, **False**. Setting this + value to `true` only delivers global service events to the trail if the + trail is multi-Region or if the trail's home Region is the partition + leader Region (for example, us-east-1). + """ + is_multi_region_trail: bool | None = ... + """ + Specifies whether the trail exists only in one Region or exists in all + Regions. + """ + home_region: str | None = ... + """The Region in which the trail was created.""" + trail_arn: str | None = ... + """ + Specifies the ARN of the trail. The following is the format of a trail + ARN. + + `arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail` + """ + log_file_validation_enabled: bool | None = ... + """Specifies whether log file validation is enabled.""" + cloud_watch_logs_log_group_arn: str | None = ... + """ + Specifies an Amazon Resource Name (ARN), a unique identifier that + represents the log group to which CloudTrail logs will be delivered. + """ + cloud_watch_logs_role_arn: str | None = ... + """ + Specifies the role for the CloudWatch Logs endpoint to assume to write + to a user's log group. + """ + kms_key_id: str | None = ... + """ + Specifies the KMS key ID that encrypts the logs and digest files + delivered by CloudTrail. The value is a fully specified ARN to a KMS key + in the following format. + + `arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012` + """ + has_custom_event_selectors: bool | None = ... + """Specifies if the trail has custom event selectors.""" + has_insight_selectors: bool | None = ... + """ + Specifies whether a trail has insight types specified in an + `InsightSelector` list. + """ + is_organization_trail: bool | None = ... + """Specifies whether the trail is an organization trail.""" + recursive_logging: bool | None = ... + """ + Specifies whether recursive logging is enabled for the trail. If you set + `RecursiveLogging` to `false`, CloudTrail suppresses events generated by + CloudTrail when it delivers log files to your trail's destinations, + including Amazon S3 and CloudWatch Logs. The default value is `true`. + """ + +@dataclass(kw_only=True) +class TrailAlreadyExistsException(ServiceError, _SerdeShape): + """This exception is thrown when the specified trail already exists.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class TrailInfo(_SerdeShape): + """ + Information about a CloudTrail trail, including the trail's name, home + Region, and Amazon Resource Name (ARN). + """ + + trail_arn: str | None = ... + """The ARN of a trail.""" + name: str | None = ... + """The name of a trail.""" + home_region: str | None = ... + """The Amazon Web Services Region in which a trail was created.""" + +@dataclass(kw_only=True) +class TrailNotFoundException(ServiceError, _SerdeShape): + """ + This exception is thrown when the trail with the given name is not + found. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class TrailNotProvidedException(ServiceError, _SerdeShape): + """This exception is no longer in use.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class Type(UnknownEnumMixin, StrEnum): + TAG_CONTEXT = "TagContext" + REQUEST_CONTEXT = "RequestContext" + +@dataclass(kw_only=True) +class UnsupportedOperationException(ServiceError, _SerdeShape): + """This exception is thrown when the requested operation is not supported.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateChannelInput(_SerdeShape): + """Dataclass for UpdateChannelInput structure.""" + + channel: str | None = ... + """The ARN or ID (the ARN suffix) of the channel that you want to update.""" + destinations: list[Destination] | None = ... + """ + The ARNs of event data stores that you want to log events arriving + through the channel. + """ + name: str | None = ... + """Changes the name of the channel.""" + +@dataclass(kw_only=True) +class UpdateChannelOutput(_SerdeShape): + """Dataclass for UpdateChannelOutput structure.""" + + channel_arn: str | None = ... + """The ARN of the channel that was updated.""" + name: str | None = ... + """The name of the channel that was updated.""" + source: str | None = ... + """The event source of the channel that was updated.""" + destinations: list[Destination] | None = ... + """The event data stores that log events arriving through the channel.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateDashboardInput(_SerdeShape): + """Dataclass for UpdateDashboardInput structure.""" + + dashboard_id: str | None = ... + """The name or ARN of the dashboard.""" + widgets: list[RequestWidget] | None = ... + """ + An array of widgets for the dashboard. A custom dashboard can have a + maximum of 10 widgets. + + To add new widgets, pass in an array that includes the existing widgets + along with any new widgets. Run the `GetDashboard` operation to get the + list of widgets for the dashboard. + + To remove widgets, pass in an array that includes the existing widgets + minus the widgets you want removed. + """ + refresh_schedule: RefreshSchedule | None = ... + """The refresh schedule configuration for the dashboard.""" + termination_protection_enabled: bool | None = ... + """ + Specifies whether termination protection is enabled for the dashboard. + If termination protection is enabled, you cannot delete the dashboard + until termination protection is disabled. + """ + +@dataclass(kw_only=True) +class UpdateDashboardOutput(_SerdeShape): + """Dataclass for UpdateDashboardOutput structure.""" + + dashboard_arn: str | None = ... + """The ARN for the dashboard.""" + name: str | None = ... + """The name for the dashboard.""" + type: str | None = ... + """The type of dashboard.""" + widgets: list[Widget] | None = ... + """An array of widgets for the dashboard.""" + refresh_schedule: RefreshSchedule | None = ... + """The refresh schedule for the dashboard, if configured.""" + termination_protection_enabled: bool | None = ... + """Indicates whether termination protection is enabled for the dashboard.""" + created_timestamp: datetime | None = ... + """The timestamp that shows when the dashboard was created.""" + updated_timestamp: datetime | None = ... + """The timestamp that shows when the dashboard was updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateEventDataStoreInput(_SerdeShape): + """Dataclass for UpdateEventDataStoreInput structure.""" + + event_data_store: str | None = ... + """ + The ARN (or the ID suffix of the ARN) of the event data store that you + want to update. + """ + name: str | None = ... + """The event data store name.""" + advanced_event_selectors: list[AdvancedEventSelector] | None = ... + """ + The advanced event selectors used to select events for the event data + store. You can configure up to five advanced event selectors for each + event data store. + """ + multi_region_enabled: bool | None = ... + """ + Specifies whether an event data store collects events from all Regions, + or only from the Region in which it was created. + """ + organization_enabled: bool | None = ... + """ + Specifies whether an event data store collects events logged for an + organization in Organizations. + + Note: + Only the management account for the organization can convert an + organization event data store to a non-organization event data store, or + convert a non-organization event data store to an organization event + data store. + """ + retention_period: int | None = ... + """ + The retention period of the event data store, in days. If `BillingMode` + is set to `EXTENDABLE_RETENTION_PRICING`, you can set a retention period + of up to 3653 days, the equivalent of 10 years. If `BillingMode` is set + to `FIXED_RETENTION_PRICING`, you can set a retention period of up to + 2557 days, the equivalent of seven years. + + CloudTrail Lake determines whether to retain an event by checking if the + `eventTime` of the event is within the specified retention period. For + example, if you set a retention period of 90 days, CloudTrail will + remove events when the `eventTime` is older than 90 days. + + Note: + If you decrease the retention period of an event data store, CloudTrail + will remove any events with an `eventTime` older than the new retention + period. For example, if the previous retention period was 365 days and + you decrease it to 100 days, CloudTrail will remove events with an + `eventTime` older than 100 days. + """ + termination_protection_enabled: bool | None = ... + """ + Indicates that termination protection is enabled and the event data + store cannot be automatically deleted. + """ + kms_key_id: str | None = ... + """ + Specifies the KMS key ID to use to encrypt the events delivered by + CloudTrail. The value can be an alias name prefixed by `alias/`, a fully + specified ARN to an alias, a fully specified ARN to a key, or a globally + unique identifier. + + Warning: + Disabling or deleting the KMS key, or removing CloudTrail permissions on + the key, prevents CloudTrail from logging events to the event data + store, and prevents users from querying the data in the event data store + that was encrypted with the key. After you associate an event data store + with a KMS key, the KMS key cannot be removed or changed. Before you + disable or delete a KMS key that you are using with an event data store, + delete or back up your event data store. + + CloudTrail also supports KMS multi-Region keys. For more information + about multi-Region keys, see [Using multi-Region + keys](https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html) + in the *Key Management Service Developer Guide*. + + Examples: + + - `alias/MyAliasName` + + - `arn:aws:kms:us-east-2:123456789012:alias/MyAliasName` + + - `arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012` + + - `12345678-1234-1234-1234-123456789012` + """ + billing_mode: str | None = ... + """ + Note: + You can't change the billing mode from `EXTENDABLE_RETENTION_PRICING` + to `FIXED_RETENTION_PRICING`. If `BillingMode` is set to + `EXTENDABLE_RETENTION_PRICING` and you want to use + `FIXED_RETENTION_PRICING` instead, you'll need to stop ingestion on the + event data store and create a new event data store that uses + `FIXED_RETENTION_PRICING`. + + The billing mode for the event data store determines the cost for + ingesting events and the default and maximum retention period for the + event data store. + + The following are the possible values: + + - `EXTENDABLE_RETENTION_PRICING` - This billing mode is generally + recommended if you want a flexible retention period of up to 3653 days + (about 10 years). The default retention period for this billing mode + is 366 days. + + - `FIXED_RETENTION_PRICING` - This billing mode is recommended if you + expect to ingest more than 25 TB of event data per month and need a + retention period of up to 2557 days (about 7 years). The default + retention period for this billing mode is 2557 days. + + For more information about CloudTrail pricing, see [CloudTrail + Pricing](http://aws.amazon.com/cloudtrail/pricing/) and [Managing + CloudTrail Lake + costs](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake-manage-costs.html). + """ + +@dataclass(kw_only=True) +class UpdateEventDataStoreOutput(_SerdeShape): + """Dataclass for UpdateEventDataStoreOutput structure.""" + + event_data_store_arn: str | None = ... + """The ARN of the event data store.""" + name: str | None = ... + """The name of the event data store.""" + status: str | None = ... + """The status of an event data store.""" + advanced_event_selectors: list[AdvancedEventSelector] | None = ... + """The advanced event selectors that are applied to the event data store.""" + multi_region_enabled: bool | None = ... + """ + Indicates whether the event data store includes events from all Regions, + or only from the Region in which it was created. + """ + organization_enabled: bool | None = ... + """ + Indicates whether an event data store is collecting logged events for an + organization in Organizations. + """ + retention_period: int | None = ... + """The retention period, in days.""" + termination_protection_enabled: bool | None = ... + """ + Indicates whether termination protection is enabled for the event data + store. + """ + created_timestamp: datetime | None = ... + """The timestamp that shows when an event data store was first created.""" + updated_timestamp: datetime | None = ... + """ + The timestamp that shows when the event data store was last updated. + `UpdatedTimestamp` is always either the same or newer than the time + shown in `CreatedTimestamp`. + """ + kms_key_id: str | None = ... + """ + Specifies the KMS key ID that encrypts the events delivered by + CloudTrail. The value is a fully specified ARN to a KMS key in the + following format. + + `arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012` + """ + billing_mode: str | None = ... + """The billing mode for the event data store.""" + federation_status: str | None = ... + """ + Indicates the [Lake query + federation](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-federation.html) + status. The status is `ENABLED` if Lake query federation is enabled, or + `DISABLED` if Lake query federation is disabled. You cannot delete an + event data store if the `FederationStatus` is `ENABLED`. + """ + federation_role_arn: str | None = ... + """ + If Lake query federation is enabled, provides the ARN of the federation + role used to access the resources for the federated event data store. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateTrailInput(_SerdeShape): + """Specifies settings to update for the trail.""" + + name: str | None = ... + """ + Specifies the name of the trail or trail ARN. If `Name` is a trail name, + the string must meet the following requirements: + + - Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), + underscores (_), or dashes (-) + + - Start with a letter or number, and end with a letter or number + + - Be between 3 and 128 characters + + - Have no adjacent periods, underscores or dashes. Names like + `my-_namespace` and `my--namespace` are not valid. + + - Not be in IP address format (for example, 192.168.5.4) + + If `Name` is a trail ARN, it must be in the following format. + + `arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail` + """ + s3_bucket_name: str | None = ... + """ + Specifies the name of the Amazon S3 bucket designated for publishing log + files. See [Amazon S3 Bucket naming + rules](https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html). + """ + s3_key_prefix: str | None = ... + """ + Specifies the Amazon S3 key prefix that comes after the name of the + bucket you have designated for log file delivery. For more information, + see [Finding Your CloudTrail Log + Files](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/get-and-view-cloudtrail-log-files.html#cloudtrail-find-log-files). + The maximum length is 200 characters. + """ + sns_topic_name: str | None = ... + """ + Specifies the name or ARN of the Amazon SNS topic defined for + notification of log file delivery. The maximum length is 256 characters. + """ + include_global_service_events: bool | None = ... + """ + Specifies whether the trail is publishing events from global services + such as IAM to the log files. Setting this value to `true` only delivers + global service events to the trail if the trail is multi-Region or if + the trail's home Region is the partition leader Region (for example, + us-east-1). + """ + is_multi_region_trail: bool | None = ... + """ + Specifies whether the trail applies only to the current Region or to all + Regions. The default is false. If the trail exists only in the current + Region and this value is set to true, shadow trails (replications of the + trail) will be created in the other Regions. If the trail exists in all + Regions and this value is set to false, the trail will remain in the + Region where it was created, and its shadow trails in other Regions will + be deleted. As a best practice, consider using trails that log events in + all Regions. + """ + enable_log_file_validation: bool | None = ... + """ + Specifies whether log file validation is enabled. The default is false. + + Note: + When you disable log file integrity validation, the chain of digest + files is broken after one hour. CloudTrail does not create digest files + for log files that were delivered during a period in which log file + integrity validation was disabled. For example, if you enable log file + integrity validation at noon on January 1, disable it at noon on January + 2, and re-enable it at noon on January 10, digest files will not be + created for the log files delivered from noon on January 2 to noon on + January 10. The same applies whenever you stop CloudTrail logging or + delete a trail. + """ + cloud_watch_logs_log_group_arn: str | None = ... + """ + Specifies a log group name using an Amazon Resource Name (ARN), a unique + identifier that represents the log group to which CloudTrail logs are + delivered. You must use a log group that exists in your account. + + Not required unless you specify `CloudWatchLogsRoleArn`. + """ + cloud_watch_logs_role_arn: str | None = ... + """ + Specifies the role for the CloudWatch Logs endpoint to assume to write + to a user's log group. You must use a role that exists in your account. + """ + kms_key_id: str | None = ... + """ + Specifies the KMS key ID to use to encrypt the logs and digest files + delivered by CloudTrail. The value can be an alias name prefixed by + \"alias/\", a fully specified ARN to an alias, a fully specified ARN to + a key, or a globally unique identifier. + + CloudTrail also supports KMS multi-Region keys. For more information + about multi-Region keys, see [Using multi-Region + keys](https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html) + in the *Key Management Service Developer Guide*. + + Examples: + + - alias/MyAliasName + + - arn:aws:kms:us-east-2:123456789012:alias/MyAliasName + + - arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012 + + - 12345678-1234-1234-1234-123456789012 + """ + is_organization_trail: bool | None = ... + """ + Specifies whether the trail is applied to all accounts in an + organization in Organizations, or only for the current Amazon Web + Services account. The default is false, and cannot be true unless the + call is made on behalf of an Amazon Web Services account that is the + management account for an organization in Organizations. If the trail is + not an organization trail and this is set to `true`, the trail will be + created in all Amazon Web Services accounts that belong to the + organization. If the trail is an organization trail and this is set to + `false`, the trail will remain in the current Amazon Web Services + account but be deleted from all member accounts in the organization. + + Note: + Only the management account for the organization can convert an + organization trail to a non-organization trail, or convert a + non-organization trail to an organization trail. + """ + recursive_logging: bool | None = ... + """ + Specifies whether recursive logging is enabled for the trail. If you set + `RecursiveLogging` to `false`, CloudTrail suppresses events generated by + CloudTrail when it delivers log files to your trail's destinations, + including Amazon S3 and CloudWatch Logs. The default value is `true`. + """ + +@dataclass(kw_only=True) +class UpdateTrailOutput(_SerdeShape): + """ + Returns the objects or data listed below if successful. Otherwise, + returns an error. + """ + + name: str | None = ... + """Specifies the name of the trail.""" + s3_bucket_name: str | None = ... + """ + Specifies the name of the Amazon S3 bucket designated for publishing log + files. + """ + s3_key_prefix: str | None = ... + """ + Specifies the Amazon S3 key prefix that comes after the name of the + bucket you have designated for log file delivery. For more information, + see [Finding Your IAM Log + Files](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/get-and-view-cloudtrail-log-files.html#cloudtrail-find-log-files). + """ + sns_topic_name: str | None = ... + """This field is no longer in use. Use `SnsTopicARN`.""" + sns_topic_arn: str | None = ... + """ + Specifies the ARN of the Amazon SNS topic that CloudTrail uses to send + notifications when log files are delivered. The following is the format + of a topic ARN. + + `arn:aws:sns:us-east-2:123456789012:MyTopic` + """ + include_global_service_events: bool | None = ... + """ + Specifies whether the trail is publishing events from global services + such as IAM to the log files. Setting this value to `true` only delivers + global service events to the trail if the trail is multi-Region or if + the trail's home Region is the partition leader Region (for example, + us-east-1). + """ + is_multi_region_trail: bool | None = ... + """Specifies whether the trail exists in one Region or in all Regions.""" + trail_arn: str | None = ... + """ + Specifies the ARN of the trail that was updated. The following is the + format of a trail ARN. + + `arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail` + """ + log_file_validation_enabled: bool | None = ... + """Specifies whether log file integrity validation is enabled.""" + cloud_watch_logs_log_group_arn: str | None = ... + """ + Specifies the Amazon Resource Name (ARN) of the log group to which + CloudTrail logs are delivered. + """ + cloud_watch_logs_role_arn: str | None = ... + """ + Specifies the role for the CloudWatch Logs endpoint to assume to write + to a user's log group. + """ + kms_key_id: str | None = ... + """ + Specifies the KMS key ID that encrypts the logs and digest files + delivered by CloudTrail. The value is a fully specified ARN to a KMS key + in the following format. + + `arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012` + """ + is_organization_trail: bool | None = ... + """Specifies whether the trail is an organization trail.""" + recursive_logging: bool | None = ... + """Specifies whether recursive logging is enabled for the trail.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class Widget(_SerdeShape): + """A widget on a CloudTrail Lake dashboard.""" + + query_alias: str | None = ... + """The query alias used to identify the query for the widget.""" + query_statement: str | None = ... + """The SQL query statement for the widget.""" + query_parameters: list[str] | None = ... + """The query parameters for the widget.""" + view_properties: dict[str, str] | None = ... + """ + The view properties for the widget. For more information about view + properties, see [View properties for + widgets](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/lake-widget-properties.html) + in the *CloudTrail User Guide*.. + """ + +ADD_TAGS: APIOperation[AddTagsInput, AddTagsOutput] +CANCEL_QUERY: APIOperation[CancelQueryInput, CancelQueryOutput] +CREATE_CHANNEL: APIOperation[CreateChannelInput, CreateChannelOutput] +CREATE_DASHBOARD: APIOperation[CreateDashboardInput, CreateDashboardOutput] +CREATE_EVENT_DATA_STORE: APIOperation[ + CreateEventDataStoreInput, CreateEventDataStoreOutput +] +CREATE_TRAIL: APIOperation[CreateTrailInput, CreateTrailOutput] +DELETE_CHANNEL: APIOperation[DeleteChannelInput, DeleteChannelOutput] +DELETE_DASHBOARD: APIOperation[DeleteDashboardInput, DeleteDashboardOutput] +DELETE_EVENT_DATA_STORE: APIOperation[ + DeleteEventDataStoreInput, DeleteEventDataStoreOutput +] +DELETE_RESOURCE_POLICY: APIOperation[ + DeleteResourcePolicyInput, DeleteResourcePolicyOutput +] +DELETE_TRAIL: APIOperation[DeleteTrailInput, DeleteTrailOutput] +DEREGISTER_ORGANIZATION_DELEGATED_ADMIN: APIOperation[ + DeregisterOrganizationDelegatedAdminInput, + DeregisterOrganizationDelegatedAdminOutput, +] +DESCRIBE_QUERY: APIOperation[DescribeQueryInput, DescribeQueryOutput] +DESCRIBE_TRAILS: APIOperation[DescribeTrailsInput, DescribeTrailsOutput] +DISABLE_FEDERATION: APIOperation[DisableFederationInput, DisableFederationOutput] +ENABLE_FEDERATION: APIOperation[EnableFederationInput, EnableFederationOutput] +GENERATE_QUERY: APIOperation[GenerateQueryInput, GenerateQueryOutput] +GET_CHANNEL: APIOperation[GetChannelInput, GetChannelOutput] +GET_DASHBOARD: APIOperation[GetDashboardInput, GetDashboardOutput] +GET_EVENT_CONFIGURATION: APIOperation[ + GetEventConfigurationInput, GetEventConfigurationOutput +] +GET_EVENT_DATA_STORE: APIOperation[GetEventDataStoreInput, GetEventDataStoreOutput] +GET_EVENT_SELECTORS: APIOperation[GetEventSelectorsInput, GetEventSelectorsOutput] +GET_IMPORT: APIOperation[GetImportInput, GetImportOutput] +GET_INSIGHT_SELECTORS: APIOperation[GetInsightSelectorsInput, GetInsightSelectorsOutput] +GET_QUERY_RESULTS: APIOperation[GetQueryResultsInput, GetQueryResultsOutput] +GET_RESOURCE_POLICY: APIOperation[GetResourcePolicyInput, GetResourcePolicyOutput] +GET_TRAIL: APIOperation[GetTrailInput, GetTrailOutput] +GET_TRAIL_STATUS: APIOperation[GetTrailStatusInput, GetTrailStatusOutput] +LIST_CHANNELS: APIOperation[ListChannelsInput, ListChannelsOutput] +LIST_DASHBOARDS: APIOperation[ListDashboardsInput, ListDashboardsOutput] +LIST_EVENT_DATA_STORES: APIOperation[ + ListEventDataStoresInput, ListEventDataStoresOutput +] +LIST_IMPORT_FAILURES: APIOperation[ListImportFailuresInput, ListImportFailuresOutput] +LIST_IMPORTS: APIOperation[ListImportsInput, ListImportsOutput] +LIST_INSIGHTS_DATA: APIOperation[ListInsightsDataInput, ListInsightsDataOutput] +LIST_INSIGHTS_METRIC_DATA: APIOperation[ + ListInsightsMetricDataInput, ListInsightsMetricDataOutput +] +LIST_PUBLIC_KEYS: APIOperation[ListPublicKeysInput, ListPublicKeysOutput] +LIST_QUERIES: APIOperation[ListQueriesInput, ListQueriesOutput] +LIST_TAGS: APIOperation[ListTagsInput, ListTagsOutput] +LIST_TRAILS: APIOperation[ListTrailsInput, ListTrailsOutput] +LOOKUP_EVENTS: APIOperation[LookupEventsInput, LookupEventsOutput] +PUT_EVENT_CONFIGURATION: APIOperation[ + PutEventConfigurationInput, PutEventConfigurationOutput +] +PUT_EVENT_SELECTORS: APIOperation[PutEventSelectorsInput, PutEventSelectorsOutput] +PUT_INSIGHT_SELECTORS: APIOperation[PutInsightSelectorsInput, PutInsightSelectorsOutput] +PUT_RESOURCE_POLICY: APIOperation[PutResourcePolicyInput, PutResourcePolicyOutput] +REGISTER_ORGANIZATION_DELEGATED_ADMIN: APIOperation[ + RegisterOrganizationDelegatedAdminInput, RegisterOrganizationDelegatedAdminOutput +] +REMOVE_TAGS: APIOperation[RemoveTagsInput, RemoveTagsOutput] +RESTORE_EVENT_DATA_STORE: APIOperation[ + RestoreEventDataStoreInput, RestoreEventDataStoreOutput +] +SEARCH_SAMPLE_QUERIES: APIOperation[SearchSampleQueriesInput, SearchSampleQueriesOutput] +START_DASHBOARD_REFRESH: APIOperation[ + StartDashboardRefreshInput, StartDashboardRefreshOutput +] +START_EVENT_DATA_STORE_INGESTION: APIOperation[ + StartEventDataStoreIngestionInput, StartEventDataStoreIngestionOutput +] +START_IMPORT: APIOperation[StartImportInput, StartImportOutput] +START_LOGGING: APIOperation[StartLoggingInput, StartLoggingOutput] +START_QUERY: APIOperation[StartQueryInput, StartQueryOutput] +STOP_EVENT_DATA_STORE_INGESTION: APIOperation[ + StopEventDataStoreIngestionInput, StopEventDataStoreIngestionOutput +] +STOP_IMPORT: APIOperation[StopImportInput, StopImportOutput] +STOP_LOGGING: APIOperation[StopLoggingInput, StopLoggingOutput] +UPDATE_CHANNEL: APIOperation[UpdateChannelInput, UpdateChannelOutput] +UPDATE_DASHBOARD: APIOperation[UpdateDashboardInput, UpdateDashboardOutput] +UPDATE_EVENT_DATA_STORE: APIOperation[ + UpdateEventDataStoreInput, UpdateEventDataStoreOutput +] +UPDATE_TRAIL: APIOperation[UpdateTrailInput, UpdateTrailOutput] diff --git a/clients/aws-sdk-cognito-identity/scripts/docs/generate_doc_stubs.py b/clients/aws-sdk-cognito-identity/scripts/docs/generate_doc_stubs.py index 52d470bc..795f2e4b 100644 --- a/clients/aws-sdk-cognito-identity/scripts/docs/generate_doc_stubs.py +++ b/clients/aws-sdk-cognito-identity/scripts/docs/generate_doc_stubs.py @@ -126,7 +126,9 @@ class ClientInfo: class DocStubGenerator: """Generate markdown API Reference stubs for AWS SDK for Python v4 clients.""" - def __init__(self, client_dir: Path, output_dir: Path, service_name: str | None = None) -> None: + def __init__( + self, client_dir: Path, output_dir: Path, service_name: str | None = None + ) -> None: """ Initialize the documentation generator. @@ -190,7 +192,9 @@ def _analyze_client_package(self, package_name: str) -> ClientInfo: required = ("client", "config", "models") missing = [name for name in required if not package.modules.get(name)] if missing: - raise ValueError(f"Missing required modules in {package_name}: {', '.join(missing)}") + raise ValueError( + f"Missing required modules in {package_name}: {', '.join(missing)}" + ) # Parse submodules client_module = package.modules["client"] @@ -199,11 +203,15 @@ def _analyze_client_package(self, package_name: str) -> ClientInfo: client_class = self._find_class_with_suffix(client_module, "Client") if not client_class: - raise ValueError(f"No class ending with 'Client' found in {package_name}.client") + raise ValueError( + f"No class ending with 'Client' found in {package_name}.client" + ) config_class = self._find_class_with_suffix(config_module, "Config") if not config_class: - raise ValueError(f"No class ending with 'Config' found in {package_name}.config") + raise ValueError( + f"No class ending with 'Config' found in {package_name}.config" + ) plugin_alias = config_module.members.get("Plugin") if not plugin_alias: @@ -288,7 +296,9 @@ def _analyze_operation(self, operation: Function) -> OperationInfo: if output_type in stream_type_map: stream_type = stream_type_map[output_type] - stream_args = self._get_subscript_elements(returns, f"'{operation.name}' stream type") + stream_args = self._get_subscript_elements( + returns, f"'{operation.name}' stream type" + ) if stream_type in (StreamType.INPUT, StreamType.DUPLEX): event_input_type = stream_args[0].canonical_name @@ -316,7 +326,9 @@ def _analyze_operation(self, operation: Function) -> OperationInfo: def _get_expr(self, annotation: str | Expr | None, context: str) -> Expr: """Extract and validate an Expr from an annotation.""" if not isinstance(annotation, Expr): - raise TypeError(f"{context}: expected Expr, got {type(annotation).__name__}") + raise TypeError( + f"{context}: expected Expr, got {type(annotation).__name__}" + ) return annotation def _get_subscript_elements(self, expr: Expr, context: str) -> list[Expr]: @@ -330,7 +342,9 @@ def _get_subscript_elements(self, expr: Expr, context: str) -> list[Expr]: return [el for el in slice_expr.elements if isinstance(el, Expr)] return [slice_expr] - def _extract_models(self, models_module: Module, operations: list[OperationInfo]) -> ModelsInfo: + def _extract_models( + self, models_module: Module, operations: list[OperationInfo] + ) -> ModelsInfo: """Extract structures, unions, enums, and errors from models module.""" structures, unions, enums, errors = [], [], [], [] @@ -356,14 +370,16 @@ def _extract_models(self, models_module: Module, operations: list[OperationInfo] duplicates = [] for structure in structures: - if self._is_operation_io_type(structure.name, operations) or self._is_union_member( - structure.name, unions - ): + if self._is_operation_io_type( + structure.name, operations + ) or self._is_union_member(structure.name, unions): duplicates.append(structure) structures = [struct for struct in structures if struct not in duplicates] - return ModelsInfo(structures=structures, unions=unions, enums=enums, errors=errors) + return ModelsInfo( + structures=structures, unions=unions, enums=enums, errors=errors + ) def _is_union(self, member: Object | Alias) -> TypeGuard[Attribute]: """Check if a module member is a union type.""" @@ -399,7 +415,9 @@ def _extract_union_members( for name in member_names: if not (member_object := models_module.members.get(name)): raise ValueError(f"Union member '{name}' not found in models module") - members.append(TypeInfo(name=member_object.name, module_path=member_object.path)) + members.append( + TypeInfo(name=member_object.name, module_path=member_object.path) + ) return members @@ -408,7 +426,8 @@ def _is_enum(self, member: Object | Alias) -> TypeGuard[Class]: if not isinstance(member, Class): return False return any( - isinstance(base, ExprName) and base.name in ENUM_BASE_CLASSES for base in member.bases + isinstance(base, ExprName) and base.name in ENUM_BASE_CLASSES + for base in member.bases ) def _is_error(self, member: Object | Alias) -> TypeGuard[Class]: @@ -416,10 +435,13 @@ def _is_error(self, member: Object | Alias) -> TypeGuard[Class]: if not isinstance(member, Class): return False return any( - isinstance(base, ExprName) and base.name in ERROR_BASE_CLASSES for base in member.bases + isinstance(base, ExprName) and base.name in ERROR_BASE_CLASSES + for base in member.bases ) - def _is_operation_io_type(self, type_name: str, operations: list[OperationInfo]) -> bool: + def _is_operation_io_type( + self, type_name: str, operations: list[OperationInfo] + ) -> bool: """Check if a type is used as operation input/output.""" return any(type_name in (op.input.name, op.output.name) for op in operations) @@ -437,8 +459,12 @@ def _generate_client_docs(self, client_info: ClientInfo) -> bool: self._generate_type_stubs( client_info.models.structures, "structures", "Structure Class" ) - self._generate_type_stubs(client_info.models.errors, "errors", "Error Class") - self._generate_type_stubs(client_info.models.enums, "enums", "Enum Class", members=True) + self._generate_type_stubs( + client_info.models.errors, "errors", "Error Class" + ) + self._generate_type_stubs( + client_info.models.enums, "enums", "Enum Class", members=True + ) self._generate_union_stubs(client_info.models.unions) except OSError as e: logger.error(f"Failed to write documentation files: {e}") @@ -470,7 +496,9 @@ def _generate_index(self, client_info: ClientInfo) -> None: ] for method in sorted(client_info.client_methods, key=lambda x: x.name): - lines.extend([*self._mkdocs_directive(method.module_path, heading_level=4), ""]) + lines.extend( + [*self._mkdocs_directive(method.module_path, heading_level=4), ""] + ) # Operations section if client_info.operations: @@ -578,7 +606,9 @@ def _generate_operation_stubs(self, operations: list[OperationInfo]) -> None: output_path = self.output_dir / "operations" / f"{op.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb("Operations", op.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb("Operations", op.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(operations)} operation file(s)") @@ -600,7 +630,9 @@ def _generate_type_stubs( output_path = self.output_dir / category / f"{item.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb(category.title(), item.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb(category.title(), item.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(items)} {category} file(s)") @@ -624,7 +656,9 @@ def _generate_union_stubs(self, unions: list[UnionInfo]) -> None: output_path = self.output_dir / "unions" / f"{union.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb("Unions", union.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb("Unions", union.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(unions)} union file(s)") diff --git a/clients/aws-sdk-cognito-identity/src/aws_sdk_cognito_identity/_private/schemas.py b/clients/aws-sdk-cognito-identity/src/aws_sdk_cognito_identity/_private/schemas.py index 0f1f49fb..9b69d6e9 100644 --- a/clients/aws-sdk-cognito-identity/src/aws_sdk_cognito_identity/_private/schemas.py +++ b/clients/aws-sdk-cognito-identity/src/aws_sdk_cognito_identity/_private/schemas.py @@ -2,1696 +2,1856 @@ from types import MappingProxyType -from smithy_core.prelude import UNIT -from smithy_core.schemas import Schema -from smithy_core.shapes import ShapeID, ShapeType -from smithy_core.traits import Trait - - -ACCESS_KEY_STRING = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#AccessKeyString"), - shape_type=ShapeType.STRING, -) - -ACCOUNT_ID = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#AccountId"), shape_type=ShapeType.STRING -) - -AMBIGUOUS_ROLE_RESOLUTION_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#AmbiguousRoleResolutionType"), - shape_type=ShapeType.ENUM, - members={"AUTHENTICATED_ROLE": {"target": UNIT}, "DENY": {"target": UNIT}}, -) - -ARN_STRING = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#ARNString"), shape_type=ShapeType.STRING -) - -CLASSIC_FLOW = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#ClassicFlow"), - shape_type=ShapeType.BOOLEAN, -) - -IDENTITY_POOL_UNAUTHENTICATED = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#IdentityPoolUnauthenticated"), - shape_type=ShapeType.BOOLEAN, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=False)], -) - -COGNITO_IDENTITY_PROVIDER_CLIENT_ID = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#CognitoIdentityProviderClientId"), - shape_type=ShapeType.STRING, -) - -COGNITO_IDENTITY_PROVIDER_NAME = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#CognitoIdentityProviderName"), - shape_type=ShapeType.STRING, -) - -COGNITO_IDENTITY_PROVIDER_TOKEN_CHECK = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#CognitoIdentityProviderTokenCheck"), - shape_type=ShapeType.BOOLEAN, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=False)], -) - -COGNITO_IDENTITY_PROVIDER = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#CognitoIdentityProvider"), - members={ - "ProviderName": {"target": COGNITO_IDENTITY_PROVIDER_NAME}, - "ClientId": {"target": COGNITO_IDENTITY_PROVIDER_CLIENT_ID}, - "ServerSideTokenCheck": { - "target": COGNITO_IDENTITY_PROVIDER_TOKEN_CHECK, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=None)], - }, - }, -) - -COGNITO_IDENTITY_PROVIDER_LIST = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#CognitoIdentityProviderList"), - shape_type=ShapeType.LIST, - members={"member": {"target": COGNITO_IDENTITY_PROVIDER}}, -) - -DEVELOPER_PROVIDER_NAME = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#DeveloperProviderName"), - shape_type=ShapeType.STRING, -) - -IDENTITY_POOL_NAME = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#IdentityPoolName"), - shape_type=ShapeType.STRING, -) - -TAG_KEYS_TYPE = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#TagKeysType"), shape_type=ShapeType.STRING -) - -TAG_VALUE_TYPE = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#TagValueType"), - shape_type=ShapeType.STRING, -) - -IDENTITY_POOL_TAGS_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#IdentityPoolTagsType"), - shape_type=ShapeType.MAP, - members={"key": {"target": TAG_KEYS_TYPE}, "value": {"target": TAG_VALUE_TYPE}}, -) - -OIDC_PROVIDER_LIST = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#OIDCProviderList"), - shape_type=ShapeType.LIST, - members={"member": {"target": ARN_STRING}}, -) - -SAML_PROVIDER_LIST = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#SAMLProviderList"), - shape_type=ShapeType.LIST, - members={"member": {"target": ARN_STRING}}, -) - -IDENTITY_PROVIDER_NAME = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#IdentityProviderName"), - shape_type=ShapeType.STRING, -) - -IDENTITY_PROVIDER_ID = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#IdentityProviderId"), - shape_type=ShapeType.STRING, -) - -IDENTITY_PROVIDERS = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#IdentityProviders"), - shape_type=ShapeType.MAP, - members={ - "key": {"target": IDENTITY_PROVIDER_NAME}, - "value": {"target": IDENTITY_PROVIDER_ID}, - }, -) - -CREATE_IDENTITY_POOL_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#CreateIdentityPoolInput"), - members={ - "IdentityPoolName": { - "target": IDENTITY_POOL_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "AllowUnauthenticatedIdentities": { - "target": IDENTITY_POOL_UNAUTHENTICATED, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=False), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "AllowClassicFlow": {"target": CLASSIC_FLOW}, - "SupportedLoginProviders": {"target": IDENTITY_PROVIDERS}, - "DeveloperProviderName": {"target": DEVELOPER_PROVIDER_NAME}, - "OpenIdConnectProviderARNs": {"target": OIDC_PROVIDER_LIST}, - "CognitoIdentityProviders": {"target": COGNITO_IDENTITY_PROVIDER_LIST}, - "SamlProviderARNs": {"target": SAML_PROVIDER_LIST}, - "IdentityPoolTags": {"target": IDENTITY_POOL_TAGS_TYPE}, - }, -) - -IDENTITY_POOL_ID = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#IdentityPoolId"), - shape_type=ShapeType.STRING, -) - -CREATE_IDENTITY_POOL_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#CreateIdentityPoolOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cognitoidentity#IdentityPool", - ) - ], - members={ - "IdentityPoolId": { - "target": IDENTITY_POOL_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "IdentityPoolName": { - "target": IDENTITY_POOL_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "AllowUnauthenticatedIdentities": { - "target": IDENTITY_POOL_UNAUTHENTICATED, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=False), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "AllowClassicFlow": {"target": CLASSIC_FLOW}, - "SupportedLoginProviders": {"target": IDENTITY_PROVIDERS}, - "DeveloperProviderName": {"target": DEVELOPER_PROVIDER_NAME}, - "OpenIdConnectProviderARNs": {"target": OIDC_PROVIDER_LIST}, - "CognitoIdentityProviders": {"target": COGNITO_IDENTITY_PROVIDER_LIST}, - "SamlProviderARNs": {"target": SAML_PROVIDER_LIST}, - "IdentityPoolTags": {"target": IDENTITY_POOL_TAGS_TYPE}, - }, -) - -STRING = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#String"), shape_type=ShapeType.STRING -) - -INTERNAL_ERROR_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#InternalErrorException"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="server")], - members={"message": {"target": STRING}}, -) - -INVALID_PARAMETER_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#InvalidParameterException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"message": {"target": STRING}}, -) - -LIMIT_EXCEEDED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#LimitExceededException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"message": {"target": STRING}}, -) - -NOT_AUTHORIZED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#NotAuthorizedException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=403), - ], - members={"message": {"target": STRING}}, -) - -RESOURCE_CONFLICT_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#ResourceConflictException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=409), - ], - members={"message": {"target": STRING}}, -) - -TOO_MANY_REQUESTS_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#TooManyRequestsException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=429), - ], - members={"message": {"target": STRING}}, -) - -CREATE_IDENTITY_POOL = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#CreateIdentityPool"), - shape_type=ShapeType.OPERATION, -) - -IDENTITY_ID = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#IdentityId"), shape_type=ShapeType.STRING -) - -IDENTITY_ID_LIST = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#IdentityIdList"), - shape_type=ShapeType.LIST, - members={"member": {"target": IDENTITY_ID}}, -) - -DELETE_IDENTITIES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#DeleteIdentitiesInput"), - members={ - "IdentityIdsToDelete": { - "target": IDENTITY_ID_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -ERROR_CODE = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#ErrorCode"), - shape_type=ShapeType.ENUM, - members={ - "ACCESS_DENIED": {"target": UNIT}, - "INTERNAL_SERVER_ERROR": {"target": UNIT}, - }, -) - -UNPROCESSED_IDENTITY_ID = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#UnprocessedIdentityId"), - members={ - "IdentityId": {"target": IDENTITY_ID}, - "ErrorCode": {"target": ERROR_CODE}, - }, -) - -UNPROCESSED_IDENTITY_ID_LIST = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#UnprocessedIdentityIdList"), - shape_type=ShapeType.LIST, - members={"member": {"target": UNPROCESSED_IDENTITY_ID}}, -) - -DELETE_IDENTITIES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#DeleteIdentitiesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cognitoidentity#DeleteIdentitiesResponse", - ) - ], - members={"UnprocessedIdentityIds": {"target": UNPROCESSED_IDENTITY_ID_LIST}}, -) - -DELETE_IDENTITIES = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#DeleteIdentities"), - shape_type=ShapeType.OPERATION, -) - -DELETE_IDENTITY_POOL_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#DeleteIdentityPoolInput"), - members={ - "IdentityPoolId": { - "target": IDENTITY_POOL_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -DELETE_IDENTITY_POOL_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#DeleteIdentityPoolOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -RESOURCE_NOT_FOUND_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#ResourceNotFoundException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=404), - ], - members={"message": {"target": STRING}}, -) - -DELETE_IDENTITY_POOL = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#DeleteIdentityPool"), - shape_type=ShapeType.OPERATION, -) - -DESCRIBE_IDENTITY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#DescribeIdentityInput"), - members={ - "IdentityId": { - "target": IDENTITY_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -DATE_TYPE = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#DateType"), shape_type=ShapeType.TIMESTAMP -) - -LOGINS_LIST = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#LoginsList"), - shape_type=ShapeType.LIST, - members={"member": {"target": IDENTITY_PROVIDER_NAME}}, -) - -DESCRIBE_IDENTITY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#DescribeIdentityOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cognitoidentity#IdentityDescription", - ) - ], - members={ - "IdentityId": {"target": IDENTITY_ID}, - "Logins": {"target": LOGINS_LIST}, - "CreationDate": {"target": DATE_TYPE}, - "LastModifiedDate": {"target": DATE_TYPE}, - }, -) - -DESCRIBE_IDENTITY = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#DescribeIdentity"), - shape_type=ShapeType.OPERATION, +from smithy_core._schema_compact import StaticOperationSchema, StaticSchema + + +n0 = "com.amazonaws.cognitoidentity" +_AKS = "AccessKeyString" +_AI = "AccountId" +_ARRT = "AmbiguousRoleResolutionType" +_AR = "AUTHENTICATED_ROLE" +_sV = "smithy.api#enumValue" +_ARu = "AuthenticatedRole" +_DENY = "DENY" +_D = "Deny" +_ARNS = "ARNString" +_CF = "ClassicFlow" +_IPU = "IdentityPoolUnauthenticated" +_s = "smithy.api#default" +_CIPCI = "CognitoIdentityProviderClientId" +_CIPN = "CognitoIdentityProviderName" +_CIPTC = "CognitoIdentityProviderTokenCheck" +_CIP = "CognitoIdentityProvider" +_PN = "ProviderName" +_CI = "ClientId" +_SSTC = "ServerSideTokenCheck" +_CIPL = "CognitoIdentityProviderList" +_m = "member" +_DPN = "DeveloperProviderName" +_IPN = "IdentityPoolName" +_TKT = "TagKeysType" +_TVT = "TagValueType" +_IPTT = "IdentityPoolTagsType" +_k = "key" +_v = "value" +_OIDCPL = "OIDCProviderList" +_SAMLPL = "SAMLProviderList" +_IPNd = "IdentityProviderName" +_IPI = "IdentityProviderId" +_IP = "IdentityProviders" +_CIPI = "CreateIdentityPoolInput" +_sm = "smithy.api#input" +_smi = "smithy.api#required" +_AUI = "AllowUnauthenticatedIdentities" +_ACF = "AllowClassicFlow" +_SLP = "SupportedLoginProviders" +_OICPARN = "OpenIdConnectProviderARNs" +_CIPo = "CognitoIdentityProviders" +_SPARN = "SamlProviderARNs" +_IPT = "IdentityPoolTags" +_IPId = "IdentityPoolId" +_CIPO = "CreateIdentityPoolOutput" +_sSI = "smithy.synthetic#originalShapeId" +_cIP = "com.amazonaws.cognitoidentity#IdentityPool" +_smit = "smithy.api#output" +_S = "String" +_IEE = "InternalErrorException" +_smith = "smithy.api#error" +_se = "server" +_me = "message" +_IPE = "InvalidParameterException" +_c = "client" +_sE = "smithy.api#httpError" +_LEE = "LimitExceededException" +_NAE = "NotAuthorizedException" +_RCE = "ResourceConflictException" +_TMRE = "TooManyRequestsException" +_CIPr = "CreateIdentityPool" +_II = "IdentityId" +_IIL = "IdentityIdList" +_DII = "DeleteIdentitiesInput" +_IITD = "IdentityIdsToDelete" +_EC = "ErrorCode" +_AD = "ACCESS_DENIED" +_ADc = "AccessDenied" +_ISE = "INTERNAL_SERVER_ERROR" +_ISEn = "InternalServerError" +_UII = "UnprocessedIdentityId" +_UIIL = "UnprocessedIdentityIdList" +_DIO = "DeleteIdentitiesOutput" +_cDIR = "com.amazonaws.cognitoidentity#DeleteIdentitiesResponse" +_UIIn = "UnprocessedIdentityIds" +_DI = "DeleteIdentities" +_DIPI = "DeleteIdentityPoolInput" +_DIPO = "DeleteIdentityPoolOutput" +_sU = "smithy.api#Unit" +_RNFE = "ResourceNotFoundException" +_DIP = "DeleteIdentityPool" +_DIIe = "DescribeIdentityInput" +_DT = "DateType" +_LL = "LoginsList" +_DIOe = "DescribeIdentityOutput" +_cID = "com.amazonaws.cognitoidentity#IdentityDescription" +_L = "Logins" +_CD = "CreationDate" +_LMD = "LastModifiedDate" +_DIe = "DescribeIdentity" +_DIPIe = "DescribeIdentityPoolInput" +_DIPOe = "DescribeIdentityPoolOutput" +_DIPe = "DescribeIdentityPool" +_ESE = "ExternalServiceException" +_IPTd = "IdentityProviderToken" +_smithy = "smithy.api#sensitive" +_LM = "LoginsMap" +_GCFII = "GetCredentialsForIdentityInput" +_CRA = "CustomRoleArn" +_SKS = "SecretKeyString" +_STS = "SessionTokenString" +_C = "Credentials" +_AKI = "AccessKeyId" +_SK = "SecretKey" +_ST = "SessionToken" +_E = "Expiration" +_GCFIO = "GetCredentialsForIdentityOutput" +_cGCFIR = "com.amazonaws.cognitoidentity#GetCredentialsForIdentityResponse" +_IIPCE = "InvalidIdentityPoolConfigurationException" +_GCFI = "GetCredentialsForIdentity" +_GII = "GetIdInput" +_GIO = "GetIdOutput" +_cGIR = "com.amazonaws.cognitoidentity#GetIdResponse" +_GI = "GetId" +_GIPRI = "GetIdentityPoolRolesInput" +_CN = "ClaimName" +_MRMT = "MappingRuleMatchType" +_EQUALS = "EQUALS" +_Eq = "Equals" +_CONTAINS = "CONTAINS" +_Co = "Contains" +_SW = "STARTS_WITH" +_SWt = "StartsWith" +_NE = "NOT_EQUAL" +_NEo = "NotEqual" +_CV = "ClaimValue" +_MR = "MappingRule" +_Cl = "Claim" +_MT = "MatchType" +_V = "Value" +_RARN = "RoleARN" +_MRL = "MappingRulesList" +_RCT = "RulesConfigurationType" +_R = "Rules" +_RMT = "RoleMappingType" +_TOKEN = "TOKEN" +_T = "Token" +_RULES = "RULES" +_RM = "RoleMapping" +_Ty = "Type" +_ARR = "AmbiguousRoleResolution" +_RC = "RulesConfiguration" +_RMM = "RoleMappingMap" +_RT = "RoleType" +_RMo = "RolesMap" +_GIPRO = "GetIdentityPoolRolesOutput" +_cGIPRR = "com.amazonaws.cognitoidentity#GetIdentityPoolRolesResponse" +_Ro = "Roles" +_RMol = "RoleMappings" +_GIPR = "GetIdentityPoolRoles" +_GOITI = "GetOpenIdTokenInput" +_OIDCT = "OIDCToken" +_GOITO = "GetOpenIdTokenOutput" +_cGOITR = "com.amazonaws.cognitoidentity#GetOpenIdTokenResponse" +_GOIT = "GetOpenIdToken" +_DUARE = "DeveloperUserAlreadyRegisteredException" +_PTID = "PrincipalTagID" +_PTV = "PrincipalTagValue" +_PT = "PrincipalTags" +_TD = "TokenDuration" +_GOITFDII = "GetOpenIdTokenForDeveloperIdentityInput" +_GOITFDIO = "GetOpenIdTokenForDeveloperIdentityOutput" +_cGOITFDIR = "com.amazonaws.cognitoidentity#GetOpenIdTokenForDeveloperIdentityResponse" +_GOITFDI = "GetOpenIdTokenForDeveloperIdentity" +_GPTAMI = "GetPrincipalTagAttributeMapInput" +_UD = "UseDefaults" +_GPTAMO = "GetPrincipalTagAttributeMapOutput" +_cGPTAMR = "com.amazonaws.cognitoidentity#GetPrincipalTagAttributeMapResponse" +_GPTAM = "GetPrincipalTagAttributeMap" +_HD = "HideDisabled" +_QL = "QueryLimit" +_PK = "PaginationKey" +_LII = "ListIdentitiesInput" +_MRa = "MaxResults" +_NT = "NextToken" +_ID = "IdentityDescription" +_IL = "IdentitiesList" +_LIO = "ListIdentitiesOutput" +_cLIR = "com.amazonaws.cognitoidentity#ListIdentitiesResponse" +_I = "Identities" +_LI = "ListIdentities" +_LIPI = "ListIdentityPoolsInput" +_IPSD = "IdentityPoolShortDescription" +_IPL = "IdentityPoolsList" +_LIPO = "ListIdentityPoolsOutput" +_cLIPR = "com.amazonaws.cognitoidentity#ListIdentityPoolsResponse" +_IPd = "IdentityPools" +_LIP = "ListIdentityPools" +_LTFRI = "ListTagsForResourceInput" +_RA = "ResourceArn" +_LTFRO = "ListTagsForResourceOutput" +_cLTFRR = "com.amazonaws.cognitoidentity#ListTagsForResourceResponse" +_Ta = "Tags" +_LTFR = "ListTagsForResource" +_DUI = "DeveloperUserIdentifier" +_LDII = "LookupDeveloperIdentityInput" +_DUIL = "DeveloperUserIdentifierList" +_LDIO = "LookupDeveloperIdentityOutput" +_cLDIR = "com.amazonaws.cognitoidentity#LookupDeveloperIdentityResponse" +_LDI = "LookupDeveloperIdentity" +_MDII = "MergeDeveloperIdentitiesInput" +_SUI = "SourceUserIdentifier" +_DUIe = "DestinationUserIdentifier" +_MDIO = "MergeDeveloperIdentitiesOutput" +_cMDIR = "com.amazonaws.cognitoidentity#MergeDeveloperIdentitiesResponse" +_MDI = "MergeDeveloperIdentities" +_CME = "ConcurrentModificationException" +_SIPRI = "SetIdentityPoolRolesInput" +_SIPRO = "SetIdentityPoolRolesOutput" +_SIPR = "SetIdentityPoolRoles" +_SPTAMI = "SetPrincipalTagAttributeMapInput" +_SPTAMO = "SetPrincipalTagAttributeMapOutput" +_cSPTAMR = "com.amazonaws.cognitoidentity#SetPrincipalTagAttributeMapResponse" +_SPTAM = "SetPrincipalTagAttributeMap" +_TRI = "TagResourceInput" +_TRO = "TagResourceOutput" +_cTRR = "com.amazonaws.cognitoidentity#TagResourceResponse" +_TR = "TagResource" +_UDII = "UnlinkDeveloperIdentityInput" +_UDIO = "UnlinkDeveloperIdentityOutput" +_UDI = "UnlinkDeveloperIdentity" +_UIInl = "UnlinkIdentityInput" +_LTR = "LoginsToRemove" +_UIO = "UnlinkIdentityOutput" +_UI = "UnlinkIdentity" +_IPTLT = "IdentityPoolTagsListType" +_URI = "UntagResourceInput" +_TK = "TagKeys" +_URO = "UntagResourceOutput" +_cURR = "com.amazonaws.cognitoidentity#UntagResourceResponse" +_UR = "UntagResource" +_UIPI = "UpdateIdentityPoolInput" +_UIPO = "UpdateIdentityPoolOutput" +_UIP = "UpdateIdentityPool" +_AWSCIS = "AWSCognitoIdentityService" +_a = "aws.auth#sigv4" +_a_ = "aws.protocols#awsJson1_1" +_sB = "smithy.rules#endpointBdd" +_aw = "aws.api#service" +_sN = "smithy.api#xmlNamespace" + +ACCESS_KEY_STRING: StaticSchema = (3, n0, _AKS, 0) + +ACCOUNT_ID: StaticSchema = (3, n0, _AI, 0) + +AMBIGUOUS_ROLE_RESOLUTION_TYPE: StaticSchema = ( + 14, + n0, + _ARRT, + 0, + (_AR, _DENY), + ((-1, {_sV: _ARu}), (-1, {_sV: _D})), +) + +ARN_STRING: StaticSchema = (3, n0, _ARNS, 0) + +CLASSIC_FLOW: StaticSchema = (2, n0, _CF, 0) + +IDENTITY_POOL_UNAUTHENTICATED: StaticSchema = (2, n0, _IPU, {_s: False}) + +COGNITO_IDENTITY_PROVIDER_CLIENT_ID: StaticSchema = (3, n0, _CIPCI, 0) + +COGNITO_IDENTITY_PROVIDER_NAME: StaticSchema = (3, n0, _CIPN, 0) + +COGNITO_IDENTITY_PROVIDER_TOKEN_CHECK: StaticSchema = (2, n0, _CIPTC, {_s: False}) + +COGNITO_IDENTITY_PROVIDER: StaticSchema = ( + 18, + n0, + _CIP, + 0, + (_PN, _CI, _SSTC), + ( + (COGNITO_IDENTITY_PROVIDER_NAME, 0), + (COGNITO_IDENTITY_PROVIDER_CLIENT_ID, 0), + (COGNITO_IDENTITY_PROVIDER_TOKEN_CHECK, {_s: None}), + ), ) -DESCRIBE_IDENTITY_POOL_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#DescribeIdentityPoolInput"), - members={ - "IdentityPoolId": { - "target": IDENTITY_POOL_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +COGNITO_IDENTITY_PROVIDER_LIST: StaticSchema = ( + 16, + n0, + _CIPL, + 0, + (_m,), + ((COGNITO_IDENTITY_PROVIDER, 0),), ) -DESCRIBE_IDENTITY_POOL_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#DescribeIdentityPoolOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cognitoidentity#IdentityPool", - ) - ], - members={ - "IdentityPoolId": { - "target": IDENTITY_POOL_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "IdentityPoolName": { - "target": IDENTITY_POOL_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "AllowUnauthenticatedIdentities": { - "target": IDENTITY_POOL_UNAUTHENTICATED, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=False), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "AllowClassicFlow": {"target": CLASSIC_FLOW}, - "SupportedLoginProviders": {"target": IDENTITY_PROVIDERS}, - "DeveloperProviderName": {"target": DEVELOPER_PROVIDER_NAME}, - "OpenIdConnectProviderARNs": {"target": OIDC_PROVIDER_LIST}, - "CognitoIdentityProviders": {"target": COGNITO_IDENTITY_PROVIDER_LIST}, - "SamlProviderARNs": {"target": SAML_PROVIDER_LIST}, - "IdentityPoolTags": {"target": IDENTITY_POOL_TAGS_TYPE}, - }, -) +DEVELOPER_PROVIDER_NAME: StaticSchema = (3, n0, _DPN, 0) -DESCRIBE_IDENTITY_POOL = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#DescribeIdentityPool"), - shape_type=ShapeType.OPERATION, -) +IDENTITY_POOL_NAME: StaticSchema = (3, n0, _IPN, 0) -EXTERNAL_SERVICE_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#ExternalServiceException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"message": {"target": STRING}}, -) +TAG_KEYS_TYPE: StaticSchema = (3, n0, _TKT, 0) -IDENTITY_PROVIDER_TOKEN = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#IdentityProviderToken"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) +TAG_VALUE_TYPE: StaticSchema = (3, n0, _TVT, 0) -LOGINS_MAP = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#LoginsMap"), - shape_type=ShapeType.MAP, - members={ - "key": {"target": IDENTITY_PROVIDER_NAME}, - "value": {"target": IDENTITY_PROVIDER_TOKEN}, - }, +IDENTITY_POOL_TAGS_TYPE: StaticSchema = ( + 17, + n0, + _IPTT, + 0, + (_k, _v), + ((TAG_KEYS_TYPE, 0), (TAG_VALUE_TYPE, 0)), ) -GET_CREDENTIALS_FOR_IDENTITY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#GetCredentialsForIdentityInput"), - members={ - "IdentityId": { - "target": IDENTITY_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Logins": {"target": LOGINS_MAP}, - "CustomRoleArn": {"target": ARN_STRING}, - }, -) +OIDC_PROVIDER_LIST: StaticSchema = (16, n0, _OIDCPL, 0, (_m,), ((ARN_STRING, 0),)) -SECRET_KEY_STRING = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#SecretKeyString"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) +SAML_PROVIDER_LIST: StaticSchema = (16, n0, _SAMLPL, 0, (_m,), ((ARN_STRING, 0),)) -SESSION_TOKEN_STRING = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#SessionTokenString"), - shape_type=ShapeType.STRING, -) +IDENTITY_PROVIDER_NAME: StaticSchema = (3, n0, _IPNd, 0) -CREDENTIALS = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#Credentials"), - members={ - "AccessKeyId": {"target": ACCESS_KEY_STRING}, - "SecretKey": {"target": SECRET_KEY_STRING}, - "SessionToken": {"target": SESSION_TOKEN_STRING}, - "Expiration": {"target": DATE_TYPE}, - }, -) +IDENTITY_PROVIDER_ID: StaticSchema = (3, n0, _IPI, 0) -GET_CREDENTIALS_FOR_IDENTITY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#GetCredentialsForIdentityOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cognitoidentity#GetCredentialsForIdentityResponse", - ) - ], - members={ - "IdentityId": {"target": IDENTITY_ID}, - "Credentials": {"target": CREDENTIALS}, - }, +IDENTITY_PROVIDERS: StaticSchema = ( + 17, + n0, + _IP, + 0, + (_k, _v), + ((IDENTITY_PROVIDER_NAME, 0), (IDENTITY_PROVIDER_ID, 0)), ) -INVALID_IDENTITY_POOL_CONFIGURATION_EXCEPTION = Schema.collection( - id=ShapeID( - "com.amazonaws.cognitoidentity#InvalidIdentityPoolConfigurationException" +CREATE_IDENTITY_POOL_INPUT: StaticSchema = ( + 18, + n0, + _CIPI, + {_sm: None}, + (_IPN, _AUI, _ACF, _SLP, _DPN, _OICPARN, _CIPo, _SPARN, _IPT), + ( + (IDENTITY_POOL_NAME, 1), + (IDENTITY_POOL_UNAUTHENTICATED, {_s: False, _smi: None}), + (CLASSIC_FLOW, 0), + (IDENTITY_PROVIDERS, 0), + (DEVELOPER_PROVIDER_NAME, 0), + (OIDC_PROVIDER_LIST, 0), + (COGNITO_IDENTITY_PROVIDER_LIST, 0), + (SAML_PROVIDER_LIST, 0), + (IDENTITY_POOL_TAGS_TYPE, 0), ), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"message": {"target": STRING}}, -) - -GET_CREDENTIALS_FOR_IDENTITY = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#GetCredentialsForIdentity"), - shape_type=ShapeType.OPERATION, -) - -GET_ID_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#GetIdInput"), - members={ - "AccountId": {"target": ACCOUNT_ID}, - "IdentityPoolId": { - "target": IDENTITY_POOL_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Logins": {"target": LOGINS_MAP}, - }, ) -GET_ID_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#GetIdOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cognitoidentity#GetIdResponse", - ) - ], - members={"IdentityId": {"target": IDENTITY_ID}}, +IDENTITY_POOL_ID: StaticSchema = (3, n0, _IPId, 0) + +CREATE_IDENTITY_POOL_OUTPUT: StaticSchema = ( + 18, + n0, + _CIPO, + {_sSI: _cIP, _smit: None}, + (_IPId, _IPN, _AUI, _ACF, _SLP, _DPN, _OICPARN, _CIPo, _SPARN, _IPT), + ( + (IDENTITY_POOL_ID, 1), + (IDENTITY_POOL_NAME, 1), + (IDENTITY_POOL_UNAUTHENTICATED, {_s: False, _smi: None}), + (CLASSIC_FLOW, 0), + (IDENTITY_PROVIDERS, 0), + (DEVELOPER_PROVIDER_NAME, 0), + (OIDC_PROVIDER_LIST, 0), + (COGNITO_IDENTITY_PROVIDER_LIST, 0), + (SAML_PROVIDER_LIST, 0), + (IDENTITY_POOL_TAGS_TYPE, 0), + ), ) -GET_ID = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#GetId"), shape_type=ShapeType.OPERATION +STRING: StaticSchema = (3, n0, _S, 0) + +INTERNAL_ERROR_EXCEPTION: StaticSchema = ( + 18, + n0, + _IEE, + {_smith: _se}, + (_me,), + ((STRING, 0),), +) + +INVALID_PARAMETER_EXCEPTION: StaticSchema = ( + 18, + n0, + _IPE, + {_smith: _c, _sE: 400}, + (_me,), + ((STRING, 0),), +) + +LIMIT_EXCEEDED_EXCEPTION: StaticSchema = ( + 18, + n0, + _LEE, + {_smith: _c, _sE: 400}, + (_me,), + ((STRING, 0),), +) + +NOT_AUTHORIZED_EXCEPTION: StaticSchema = ( + 18, + n0, + _NAE, + {_smith: _c, _sE: 403}, + (_me,), + ((STRING, 0),), +) + +RESOURCE_CONFLICT_EXCEPTION: StaticSchema = ( + 18, + n0, + _RCE, + {_smith: _c, _sE: 409}, + (_me,), + ((STRING, 0),), +) + +TOO_MANY_REQUESTS_EXCEPTION: StaticSchema = ( + 18, + n0, + _TMRE, + {_smith: _c, _sE: 429}, + (_me,), + ((STRING, 0),), +) + +CREATE_IDENTITY_POOL: StaticOperationSchema = ( + 23, + n0, + _CIPr, + 0, + CREATE_IDENTITY_POOL_INPUT, + CREATE_IDENTITY_POOL_OUTPUT, + ( + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_AUTHORIZED_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -GET_IDENTITY_POOL_ROLES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#GetIdentityPoolRolesInput"), - members={ - "IdentityPoolId": { - "target": IDENTITY_POOL_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +IDENTITY_ID: StaticSchema = (3, n0, _II, 0) + +IDENTITY_ID_LIST: StaticSchema = (16, n0, _IIL, 0, (_m,), ((IDENTITY_ID, 0),)) + +DELETE_IDENTITIES_INPUT: StaticSchema = ( + 18, + n0, + _DII, + {_sm: None}, + (_IITD,), + ((IDENTITY_ID_LIST, 1),), +) + +ERROR_CODE: StaticSchema = ( + 14, + n0, + _EC, + 0, + (_AD, _ISE), + ((-1, {_sV: _ADc}), (-1, {_sV: _ISEn})), +) + +UNPROCESSED_IDENTITY_ID: StaticSchema = ( + 18, + n0, + _UII, + 0, + (_II, _EC), + ((IDENTITY_ID, 0), (ERROR_CODE, 0)), +) + +UNPROCESSED_IDENTITY_ID_LIST: StaticSchema = ( + 16, + n0, + _UIIL, + 0, + (_m,), + ((UNPROCESSED_IDENTITY_ID, 0),), +) + +DELETE_IDENTITIES_OUTPUT: StaticSchema = ( + 18, + n0, + _DIO, + {_sSI: _cDIR, _smit: None}, + (_UIIn,), + ((UNPROCESSED_IDENTITY_ID_LIST, 0),), +) + +DELETE_IDENTITIES: StaticOperationSchema = ( + 23, + n0, + _DI, + 0, + DELETE_IDENTITIES_INPUT, + DELETE_IDENTITIES_OUTPUT, + ( + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -CLAIM_NAME = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#ClaimName"), shape_type=ShapeType.STRING +DELETE_IDENTITY_POOL_INPUT: StaticSchema = ( + 18, + n0, + _DIPI, + {_sm: None}, + (_IPId,), + ((IDENTITY_POOL_ID, 1),), +) + +DELETE_IDENTITY_POOL_OUTPUT: StaticSchema = (18, n0, _DIPO, {_sSI: _sU, _smit: None}) + +RESOURCE_NOT_FOUND_EXCEPTION: StaticSchema = ( + 18, + n0, + _RNFE, + {_smith: _c, _sE: 404}, + (_me,), + ((STRING, 0),), +) + +DELETE_IDENTITY_POOL: StaticOperationSchema = ( + 23, + n0, + _DIP, + 0, + DELETE_IDENTITY_POOL_INPUT, + DELETE_IDENTITY_POOL_OUTPUT, + ( + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + NOT_AUTHORIZED_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -MAPPING_RULE_MATCH_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#MappingRuleMatchType"), - shape_type=ShapeType.ENUM, - members={ - "EQUALS": {"target": UNIT}, - "CONTAINS": {"target": UNIT}, - "STARTS_WITH": {"target": UNIT}, - "NOT_EQUAL": {"target": UNIT}, - }, +DESCRIBE_IDENTITY_INPUT: StaticSchema = ( + 18, + n0, + _DIIe, + {_sm: None}, + (_II,), + ((IDENTITY_ID, 1),), +) + +DATE_TYPE: StaticSchema = (4, n0, _DT, 0) + +LOGINS_LIST: StaticSchema = (16, n0, _LL, 0, (_m,), ((IDENTITY_PROVIDER_NAME, 0),)) + +DESCRIBE_IDENTITY_OUTPUT: StaticSchema = ( + 18, + n0, + _DIOe, + {_sSI: _cID, _smit: None}, + (_II, _L, _CD, _LMD), + ((IDENTITY_ID, 0), (LOGINS_LIST, 0), (DATE_TYPE, 0), (DATE_TYPE, 0)), +) + +DESCRIBE_IDENTITY: StaticOperationSchema = ( + 23, + n0, + _DIe, + 0, + DESCRIBE_IDENTITY_INPUT, + DESCRIBE_IDENTITY_OUTPUT, + ( + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + NOT_AUTHORIZED_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -CLAIM_VALUE = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#ClaimValue"), shape_type=ShapeType.STRING -) - -MAPPING_RULE = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#MappingRule"), - members={ - "Claim": { - "target": CLAIM_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "MatchType": { - "target": MAPPING_RULE_MATCH_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Value": { - "target": CLAIM_VALUE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "RoleARN": { - "target": ARN_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +DESCRIBE_IDENTITY_POOL_INPUT: StaticSchema = ( + 18, + n0, + _DIPIe, + {_sm: None}, + (_IPId,), + ((IDENTITY_POOL_ID, 1),), +) + +DESCRIBE_IDENTITY_POOL_OUTPUT: StaticSchema = ( + 18, + n0, + _DIPOe, + {_sSI: _cIP, _smit: None}, + (_IPId, _IPN, _AUI, _ACF, _SLP, _DPN, _OICPARN, _CIPo, _SPARN, _IPT), + ( + (IDENTITY_POOL_ID, 1), + (IDENTITY_POOL_NAME, 1), + (IDENTITY_POOL_UNAUTHENTICATED, {_s: False, _smi: None}), + (CLASSIC_FLOW, 0), + (IDENTITY_PROVIDERS, 0), + (DEVELOPER_PROVIDER_NAME, 0), + (OIDC_PROVIDER_LIST, 0), + (COGNITO_IDENTITY_PROVIDER_LIST, 0), + (SAML_PROVIDER_LIST, 0), + (IDENTITY_POOL_TAGS_TYPE, 0), + ), ) -MAPPING_RULES_LIST = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#MappingRulesList"), - shape_type=ShapeType.LIST, - members={"member": {"target": MAPPING_RULE}}, +DESCRIBE_IDENTITY_POOL: StaticOperationSchema = ( + 23, + n0, + _DIPe, + 0, + DESCRIBE_IDENTITY_POOL_INPUT, + DESCRIBE_IDENTITY_POOL_OUTPUT, + ( + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + NOT_AUTHORIZED_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -RULES_CONFIGURATION_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#RulesConfigurationType"), - members={ - "Rules": { - "target": MAPPING_RULES_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +EXTERNAL_SERVICE_EXCEPTION: StaticSchema = ( + 18, + n0, + _ESE, + {_smith: _c, _sE: 400}, + (_me,), + ((STRING, 0),), ) -ROLE_MAPPING_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#RoleMappingType"), - shape_type=ShapeType.ENUM, - members={"TOKEN": {"target": UNIT}, "RULES": {"target": UNIT}}, -) +IDENTITY_PROVIDER_TOKEN: StaticSchema = (3, n0, _IPTd, 4) -ROLE_MAPPING = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#RoleMapping"), - members={ - "Type": { - "target": ROLE_MAPPING_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "AmbiguousRoleResolution": {"target": AMBIGUOUS_ROLE_RESOLUTION_TYPE}, - "RulesConfiguration": {"target": RULES_CONFIGURATION_TYPE}, - }, +LOGINS_MAP: StaticSchema = ( + 17, + n0, + _LM, + 0, + (_k, _v), + ((IDENTITY_PROVIDER_NAME, 0), (IDENTITY_PROVIDER_TOKEN, 0)), ) -ROLE_MAPPING_MAP = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#RoleMappingMap"), - shape_type=ShapeType.MAP, - members={ - "key": {"target": IDENTITY_PROVIDER_NAME}, - "value": {"target": ROLE_MAPPING}, - }, +GET_CREDENTIALS_FOR_IDENTITY_INPUT: StaticSchema = ( + 18, + n0, + _GCFII, + {_sm: None}, + (_II, _L, _CRA), + ((IDENTITY_ID, 1), (LOGINS_MAP, 0), (ARN_STRING, 0)), ) -ROLE_TYPE = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#RoleType"), shape_type=ShapeType.STRING -) +SECRET_KEY_STRING: StaticSchema = (3, n0, _SKS, 4) -ROLES_MAP = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#RolesMap"), - shape_type=ShapeType.MAP, - members={"key": {"target": ROLE_TYPE}, "value": {"target": ARN_STRING}}, -) +SESSION_TOKEN_STRING: StaticSchema = (3, n0, _STS, 0) -GET_IDENTITY_POOL_ROLES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#GetIdentityPoolRolesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cognitoidentity#GetIdentityPoolRolesResponse", - ) - ], - members={ - "IdentityPoolId": {"target": IDENTITY_POOL_ID}, - "Roles": {"target": ROLES_MAP}, - "RoleMappings": {"target": ROLE_MAPPING_MAP}, - }, +CREDENTIALS: StaticSchema = ( + 18, + n0, + _C, + 0, + (_AKI, _SK, _ST, _E), + ( + (ACCESS_KEY_STRING, 0), + (SECRET_KEY_STRING, 0), + (SESSION_TOKEN_STRING, 0), + (DATE_TYPE, 0), + ), ) -GET_IDENTITY_POOL_ROLES = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#GetIdentityPoolRoles"), - shape_type=ShapeType.OPERATION, +GET_CREDENTIALS_FOR_IDENTITY_OUTPUT: StaticSchema = ( + 18, + n0, + _GCFIO, + {_sSI: _cGCFIR, _smit: None}, + (_II, _C), + ((IDENTITY_ID, 0), (CREDENTIALS, 0)), +) + +INVALID_IDENTITY_POOL_CONFIGURATION_EXCEPTION: StaticSchema = ( + 18, + n0, + _IIPCE, + {_smith: _c, _sE: 400}, + (_me,), + ((STRING, 0),), +) + +GET_CREDENTIALS_FOR_IDENTITY: StaticOperationSchema = ( + 23, + n0, + _GCFI, + 0, + GET_CREDENTIALS_FOR_IDENTITY_INPUT, + GET_CREDENTIALS_FOR_IDENTITY_OUTPUT, + ( + EXTERNAL_SERVICE_EXCEPTION, + INTERNAL_ERROR_EXCEPTION, + INVALID_IDENTITY_POOL_CONFIGURATION_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + NOT_AUTHORIZED_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -GET_OPEN_ID_TOKEN_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#GetOpenIdTokenInput"), - members={ - "IdentityId": { - "target": IDENTITY_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Logins": {"target": LOGINS_MAP}, - }, +GET_ID_INPUT: StaticSchema = ( + 18, + n0, + _GII, + {_sm: None}, + (_AI, _IPId, _L), + ((ACCOUNT_ID, 0), (IDENTITY_POOL_ID, 1), (LOGINS_MAP, 0)), +) + +GET_ID_OUTPUT: StaticSchema = ( + 18, + n0, + _GIO, + {_sSI: _cGIR, _smit: None}, + (_II,), + ((IDENTITY_ID, 0),), +) + +GET_ID: StaticOperationSchema = ( + 23, + n0, + _GI, + 0, + GET_ID_INPUT, + GET_ID_OUTPUT, + ( + EXTERNAL_SERVICE_EXCEPTION, + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_AUTHORIZED_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -OIDC_TOKEN = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#OIDCToken"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +GET_IDENTITY_POOL_ROLES_INPUT: StaticSchema = ( + 18, + n0, + _GIPRI, + {_sm: None}, + (_IPId,), + ((IDENTITY_POOL_ID, 1),), ) -GET_OPEN_ID_TOKEN_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#GetOpenIdTokenOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cognitoidentity#GetOpenIdTokenResponse", - ) - ], - members={"IdentityId": {"target": IDENTITY_ID}, "Token": {"target": OIDC_TOKEN}}, -) +CLAIM_NAME: StaticSchema = (3, n0, _CN, 0) -GET_OPEN_ID_TOKEN = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#GetOpenIdToken"), - shape_type=ShapeType.OPERATION, +MAPPING_RULE_MATCH_TYPE: StaticSchema = ( + 14, + n0, + _MRMT, + 0, + (_EQUALS, _CONTAINS, _SW, _NE), + ((-1, {_sV: _Eq}), (-1, {_sV: _Co}), (-1, {_sV: _SWt}), (-1, {_sV: _NEo})), ) -DEVELOPER_USER_ALREADY_REGISTERED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#DeveloperUserAlreadyRegisteredException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"message": {"target": STRING}}, -) +CLAIM_VALUE: StaticSchema = (3, n0, _CV, 0) -PRINCIPAL_TAG_ID = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#PrincipalTagID"), - shape_type=ShapeType.STRING, +MAPPING_RULE: StaticSchema = ( + 18, + n0, + _MR, + 0, + (_Cl, _MT, _V, _RARN), + ((CLAIM_NAME, 1), (MAPPING_RULE_MATCH_TYPE, 1), (CLAIM_VALUE, 1), (ARN_STRING, 1)), ) -PRINCIPAL_TAG_VALUE = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#PrincipalTagValue"), - shape_type=ShapeType.STRING, -) +MAPPING_RULES_LIST: StaticSchema = (16, n0, _MRL, 0, (_m,), ((MAPPING_RULE, 0),)) -PRINCIPAL_TAGS = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#PrincipalTags"), - shape_type=ShapeType.MAP, - members={ - "key": {"target": PRINCIPAL_TAG_ID}, - "value": {"target": PRINCIPAL_TAG_VALUE}, - }, +RULES_CONFIGURATION_TYPE: StaticSchema = ( + 18, + n0, + _RCT, + 0, + (_R,), + ((MAPPING_RULES_LIST, 1),), ) -TOKEN_DURATION = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#TokenDuration"), shape_type=ShapeType.LONG -) - -GET_OPEN_ID_TOKEN_FOR_DEVELOPER_IDENTITY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#GetOpenIdTokenForDeveloperIdentityInput"), - members={ - "IdentityPoolId": { - "target": IDENTITY_POOL_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "IdentityId": {"target": IDENTITY_ID}, - "Logins": { - "target": LOGINS_MAP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "PrincipalTags": {"target": PRINCIPAL_TAGS}, - "TokenDuration": {"target": TOKEN_DURATION}, - }, +ROLE_MAPPING_TYPE: StaticSchema = ( + 14, + n0, + _RMT, + 0, + (_TOKEN, _RULES), + ((-1, {_sV: _T}), (-1, {_sV: _R})), ) -GET_OPEN_ID_TOKEN_FOR_DEVELOPER_IDENTITY_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.cognitoidentity#GetOpenIdTokenForDeveloperIdentityOutput" +ROLE_MAPPING: StaticSchema = ( + 18, + n0, + _RM, + 0, + (_Ty, _ARR, _RC), + ( + (ROLE_MAPPING_TYPE, 1), + (AMBIGUOUS_ROLE_RESOLUTION_TYPE, 0), + (RULES_CONFIGURATION_TYPE, 0), ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cognitoidentity#GetOpenIdTokenForDeveloperIdentityResponse", - ) - ], - members={"IdentityId": {"target": IDENTITY_ID}, "Token": {"target": OIDC_TOKEN}}, -) - -GET_OPEN_ID_TOKEN_FOR_DEVELOPER_IDENTITY = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#GetOpenIdTokenForDeveloperIdentity"), - shape_type=ShapeType.OPERATION, -) - -GET_PRINCIPAL_TAG_ATTRIBUTE_MAP_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#GetPrincipalTagAttributeMapInput"), - members={ - "IdentityPoolId": { - "target": IDENTITY_POOL_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "IdentityProviderName": { - "target": IDENTITY_PROVIDER_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -USE_DEFAULTS = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#UseDefaults"), - shape_type=ShapeType.BOOLEAN, -) - -GET_PRINCIPAL_TAG_ATTRIBUTE_MAP_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#GetPrincipalTagAttributeMapOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cognitoidentity#GetPrincipalTagAttributeMapResponse", - ) - ], - members={ - "IdentityPoolId": {"target": IDENTITY_POOL_ID}, - "IdentityProviderName": {"target": IDENTITY_PROVIDER_NAME}, - "UseDefaults": {"target": USE_DEFAULTS}, - "PrincipalTags": {"target": PRINCIPAL_TAGS}, - }, ) -GET_PRINCIPAL_TAG_ATTRIBUTE_MAP = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#GetPrincipalTagAttributeMap"), - shape_type=ShapeType.OPERATION, +ROLE_MAPPING_MAP: StaticSchema = ( + 17, + n0, + _RMM, + 0, + (_k, _v), + ((IDENTITY_PROVIDER_NAME, 0), (ROLE_MAPPING, 0)), +) + +ROLE_TYPE: StaticSchema = (3, n0, _RT, 0) + +ROLES_MAP: StaticSchema = (17, n0, _RMo, 0, (_k, _v), ((ROLE_TYPE, 0), (ARN_STRING, 0))) + +GET_IDENTITY_POOL_ROLES_OUTPUT: StaticSchema = ( + 18, + n0, + _GIPRO, + {_sSI: _cGIPRR, _smit: None}, + (_IPId, _Ro, _RMol), + ((IDENTITY_POOL_ID, 0), (ROLES_MAP, 0), (ROLE_MAPPING_MAP, 0)), +) + +GET_IDENTITY_POOL_ROLES: StaticOperationSchema = ( + 23, + n0, + _GIPR, + 0, + GET_IDENTITY_POOL_ROLES_INPUT, + GET_IDENTITY_POOL_ROLES_OUTPUT, + ( + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + NOT_AUTHORIZED_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -HIDE_DISABLED = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#HideDisabled"), - shape_type=ShapeType.BOOLEAN, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=False)], +GET_OPEN_ID_TOKEN_INPUT: StaticSchema = ( + 18, + n0, + _GOITI, + {_sm: None}, + (_II, _L), + ((IDENTITY_ID, 1), (LOGINS_MAP, 0)), +) + +OIDC_TOKEN: StaticSchema = (3, n0, _OIDCT, 4) + +GET_OPEN_ID_TOKEN_OUTPUT: StaticSchema = ( + 18, + n0, + _GOITO, + {_sSI: _cGOITR, _smit: None}, + (_II, _T), + ((IDENTITY_ID, 0), (OIDC_TOKEN, 0)), +) + +GET_OPEN_ID_TOKEN: StaticOperationSchema = ( + 23, + n0, + _GOIT, + 0, + GET_OPEN_ID_TOKEN_INPUT, + GET_OPEN_ID_TOKEN_OUTPUT, + ( + EXTERNAL_SERVICE_EXCEPTION, + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + NOT_AUTHORIZED_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -QUERY_LIMIT = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#QueryLimit"), shape_type=ShapeType.INTEGER +DEVELOPER_USER_ALREADY_REGISTERED_EXCEPTION: StaticSchema = ( + 18, + n0, + _DUARE, + {_smith: _c, _sE: 400}, + (_me,), + ((STRING, 0),), ) -PAGINATION_KEY = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#PaginationKey"), - shape_type=ShapeType.STRING, -) +PRINCIPAL_TAG_ID: StaticSchema = (3, n0, _PTID, 0) -LIST_IDENTITIES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#ListIdentitiesInput"), - members={ - "IdentityPoolId": { - "target": IDENTITY_POOL_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "MaxResults": { - "target": QUERY_LIMIT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "NextToken": {"target": PAGINATION_KEY}, - "HideDisabled": { - "target": HIDE_DISABLED, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - }, -) +PRINCIPAL_TAG_VALUE: StaticSchema = (3, n0, _PTV, 0) -IDENTITY_DESCRIPTION = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#IdentityDescription"), - members={ - "IdentityId": {"target": IDENTITY_ID}, - "Logins": {"target": LOGINS_LIST}, - "CreationDate": {"target": DATE_TYPE}, - "LastModifiedDate": {"target": DATE_TYPE}, - }, +PRINCIPAL_TAGS: StaticSchema = ( + 17, + n0, + _PT, + 0, + (_k, _v), + ((PRINCIPAL_TAG_ID, 0), (PRINCIPAL_TAG_VALUE, 0)), ) -IDENTITIES_LIST = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#IdentitiesList"), - shape_type=ShapeType.LIST, - members={"member": {"target": IDENTITY_DESCRIPTION}}, -) - -LIST_IDENTITIES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#ListIdentitiesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cognitoidentity#ListIdentitiesResponse", - ) - ], - members={ - "IdentityPoolId": {"target": IDENTITY_POOL_ID}, - "Identities": {"target": IDENTITIES_LIST}, - "NextToken": {"target": PAGINATION_KEY}, - }, -) +TOKEN_DURATION: StaticSchema = (8, n0, _TD, 0) -LIST_IDENTITIES = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#ListIdentities"), - shape_type=ShapeType.OPERATION, +GET_OPEN_ID_TOKEN_FOR_DEVELOPER_IDENTITY_INPUT: StaticSchema = ( + 18, + n0, + _GOITFDII, + {_sm: None}, + (_IPId, _II, _L, _PT, _TD), + ( + (IDENTITY_POOL_ID, 1), + (IDENTITY_ID, 0), + (LOGINS_MAP, 1), + (PRINCIPAL_TAGS, 0), + (TOKEN_DURATION, 0), + ), ) -LIST_IDENTITY_POOLS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#ListIdentityPoolsInput"), - members={ - "MaxResults": { - "target": QUERY_LIMIT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "NextToken": {"target": PAGINATION_KEY}, - }, +GET_OPEN_ID_TOKEN_FOR_DEVELOPER_IDENTITY_OUTPUT: StaticSchema = ( + 18, + n0, + _GOITFDIO, + {_sSI: _cGOITFDIR, _smit: None}, + (_II, _T), + ((IDENTITY_ID, 0), (OIDC_TOKEN, 0)), +) + +GET_OPEN_ID_TOKEN_FOR_DEVELOPER_IDENTITY: StaticOperationSchema = ( + 23, + n0, + _GOITFDI, + 0, + GET_OPEN_ID_TOKEN_FOR_DEVELOPER_IDENTITY_INPUT, + GET_OPEN_ID_TOKEN_FOR_DEVELOPER_IDENTITY_OUTPUT, + ( + DEVELOPER_USER_ALREADY_REGISTERED_EXCEPTION, + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + NOT_AUTHORIZED_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -IDENTITY_POOL_SHORT_DESCRIPTION = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#IdentityPoolShortDescription"), - members={ - "IdentityPoolId": {"target": IDENTITY_POOL_ID}, - "IdentityPoolName": {"target": IDENTITY_POOL_NAME}, - }, +GET_PRINCIPAL_TAG_ATTRIBUTE_MAP_INPUT: StaticSchema = ( + 18, + n0, + _GPTAMI, + {_sm: None}, + (_IPId, _IPNd), + ((IDENTITY_POOL_ID, 1), (IDENTITY_PROVIDER_NAME, 1)), +) + +USE_DEFAULTS: StaticSchema = (2, n0, _UD, 0) + +GET_PRINCIPAL_TAG_ATTRIBUTE_MAP_OUTPUT: StaticSchema = ( + 18, + n0, + _GPTAMO, + {_sSI: _cGPTAMR, _smit: None}, + (_IPId, _IPNd, _UD, _PT), + ( + (IDENTITY_POOL_ID, 0), + (IDENTITY_PROVIDER_NAME, 0), + (USE_DEFAULTS, 0), + (PRINCIPAL_TAGS, 0), + ), ) -IDENTITY_POOLS_LIST = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#IdentityPoolsList"), - shape_type=ShapeType.LIST, - members={"member": {"target": IDENTITY_POOL_SHORT_DESCRIPTION}}, +GET_PRINCIPAL_TAG_ATTRIBUTE_MAP: StaticOperationSchema = ( + 23, + n0, + _GPTAM, + 0, + GET_PRINCIPAL_TAG_ATTRIBUTE_MAP_INPUT, + GET_PRINCIPAL_TAG_ATTRIBUTE_MAP_OUTPUT, + ( + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + NOT_AUTHORIZED_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -LIST_IDENTITY_POOLS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#ListIdentityPoolsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cognitoidentity#ListIdentityPoolsResponse", - ) - ], - members={ - "IdentityPools": {"target": IDENTITY_POOLS_LIST}, - "NextToken": {"target": PAGINATION_KEY}, - }, -) +HIDE_DISABLED: StaticSchema = (2, n0, _HD, {_s: False}) -LIST_IDENTITY_POOLS = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#ListIdentityPools"), - shape_type=ShapeType.OPERATION, -) +QUERY_LIMIT: StaticSchema = (7, n0, _QL, 0) -LIST_TAGS_FOR_RESOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#ListTagsForResourceInput"), - members={ - "ResourceArn": { - "target": ARN_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +PAGINATION_KEY: StaticSchema = (3, n0, _PK, 0) -LIST_TAGS_FOR_RESOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#ListTagsForResourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cognitoidentity#ListTagsForResourceResponse", - ) - ], - members={"Tags": {"target": IDENTITY_POOL_TAGS_TYPE}}, +LIST_IDENTITIES_INPUT: StaticSchema = ( + 18, + n0, + _LII, + {_sm: None}, + (_IPId, _MRa, _NT, _HD), + ( + (IDENTITY_POOL_ID, 1), + (QUERY_LIMIT, 1), + (PAGINATION_KEY, 0), + (HIDE_DISABLED, {_s: False}), + ), ) -LIST_TAGS_FOR_RESOURCE = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#ListTagsForResource"), - shape_type=ShapeType.OPERATION, +IDENTITY_DESCRIPTION: StaticSchema = ( + 18, + n0, + _ID, + 0, + (_II, _L, _CD, _LMD), + ((IDENTITY_ID, 0), (LOGINS_LIST, 0), (DATE_TYPE, 0), (DATE_TYPE, 0)), +) + +IDENTITIES_LIST: StaticSchema = (16, n0, _IL, 0, (_m,), ((IDENTITY_DESCRIPTION, 0),)) + +LIST_IDENTITIES_OUTPUT: StaticSchema = ( + 18, + n0, + _LIO, + {_sSI: _cLIR, _smit: None}, + (_IPId, _I, _NT), + ((IDENTITY_POOL_ID, 0), (IDENTITIES_LIST, 0), (PAGINATION_KEY, 0)), +) + +LIST_IDENTITIES: StaticOperationSchema = ( + 23, + n0, + _LI, + 0, + LIST_IDENTITIES_INPUT, + LIST_IDENTITIES_OUTPUT, + ( + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + NOT_AUTHORIZED_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -DEVELOPER_USER_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#DeveloperUserIdentifier"), - shape_type=ShapeType.STRING, +LIST_IDENTITY_POOLS_INPUT: StaticSchema = ( + 18, + n0, + _LIPI, + {_sm: None}, + (_MRa, _NT), + ((QUERY_LIMIT, 1), (PAGINATION_KEY, 0)), +) + +IDENTITY_POOL_SHORT_DESCRIPTION: StaticSchema = ( + 18, + n0, + _IPSD, + 0, + (_IPId, _IPN), + ((IDENTITY_POOL_ID, 0), (IDENTITY_POOL_NAME, 0)), +) + +IDENTITY_POOLS_LIST: StaticSchema = ( + 16, + n0, + _IPL, + 0, + (_m,), + ((IDENTITY_POOL_SHORT_DESCRIPTION, 0),), +) + +LIST_IDENTITY_POOLS_OUTPUT: StaticSchema = ( + 18, + n0, + _LIPO, + {_sSI: _cLIPR, _smit: None}, + (_IPd, _NT), + ((IDENTITY_POOLS_LIST, 0), (PAGINATION_KEY, 0)), +) + +LIST_IDENTITY_POOLS: StaticOperationSchema = ( + 23, + n0, + _LIP, + 0, + LIST_IDENTITY_POOLS_INPUT, + LIST_IDENTITY_POOLS_OUTPUT, + ( + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + NOT_AUTHORIZED_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -LOOKUP_DEVELOPER_IDENTITY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#LookupDeveloperIdentityInput"), - members={ - "IdentityPoolId": { - "target": IDENTITY_POOL_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "IdentityId": {"target": IDENTITY_ID}, - "DeveloperUserIdentifier": {"target": DEVELOPER_USER_IDENTIFIER}, - "MaxResults": {"target": QUERY_LIMIT}, - "NextToken": {"target": PAGINATION_KEY}, - }, +LIST_TAGS_FOR_RESOURCE_INPUT: StaticSchema = ( + 18, + n0, + _LTFRI, + {_sm: None}, + (_RA,), + ((ARN_STRING, 1),), +) + +LIST_TAGS_FOR_RESOURCE_OUTPUT: StaticSchema = ( + 18, + n0, + _LTFRO, + {_sSI: _cLTFRR, _smit: None}, + (_Ta,), + ((IDENTITY_POOL_TAGS_TYPE, 0),), +) + +LIST_TAGS_FOR_RESOURCE: StaticOperationSchema = ( + 23, + n0, + _LTFR, + 0, + LIST_TAGS_FOR_RESOURCE_INPUT, + LIST_TAGS_FOR_RESOURCE_OUTPUT, + ( + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + NOT_AUTHORIZED_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -DEVELOPER_USER_IDENTIFIER_LIST = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#DeveloperUserIdentifierList"), - shape_type=ShapeType.LIST, - members={"member": {"target": DEVELOPER_USER_IDENTIFIER}}, -) - -LOOKUP_DEVELOPER_IDENTITY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#LookupDeveloperIdentityOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cognitoidentity#LookupDeveloperIdentityResponse", - ) - ], - members={ - "IdentityId": {"target": IDENTITY_ID}, - "DeveloperUserIdentifierList": {"target": DEVELOPER_USER_IDENTIFIER_LIST}, - "NextToken": {"target": PAGINATION_KEY}, - }, +DEVELOPER_USER_IDENTIFIER: StaticSchema = (3, n0, _DUI, 0) + +LOOKUP_DEVELOPER_IDENTITY_INPUT: StaticSchema = ( + 18, + n0, + _LDII, + {_sm: None}, + (_IPId, _II, _DUI, _MRa, _NT), + ( + (IDENTITY_POOL_ID, 1), + (IDENTITY_ID, 0), + (DEVELOPER_USER_IDENTIFIER, 0), + (QUERY_LIMIT, 0), + (PAGINATION_KEY, 0), + ), ) -LOOKUP_DEVELOPER_IDENTITY = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#LookupDeveloperIdentity"), - shape_type=ShapeType.OPERATION, -) - -MERGE_DEVELOPER_IDENTITIES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#MergeDeveloperIdentitiesInput"), - members={ - "SourceUserIdentifier": { - "target": DEVELOPER_USER_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "DestinationUserIdentifier": { - "target": DEVELOPER_USER_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "DeveloperProviderName": { - "target": DEVELOPER_PROVIDER_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "IdentityPoolId": { - "target": IDENTITY_POOL_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +DEVELOPER_USER_IDENTIFIER_LIST: StaticSchema = ( + 16, + n0, + _DUIL, + 0, + (_m,), + ((DEVELOPER_USER_IDENTIFIER, 0),), +) + +LOOKUP_DEVELOPER_IDENTITY_OUTPUT: StaticSchema = ( + 18, + n0, + _LDIO, + {_sSI: _cLDIR, _smit: None}, + (_II, _DUIL, _NT), + ((IDENTITY_ID, 0), (DEVELOPER_USER_IDENTIFIER_LIST, 0), (PAGINATION_KEY, 0)), +) + +LOOKUP_DEVELOPER_IDENTITY: StaticOperationSchema = ( + 23, + n0, + _LDI, + 0, + LOOKUP_DEVELOPER_IDENTITY_INPUT, + LOOKUP_DEVELOPER_IDENTITY_OUTPUT, + ( + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + NOT_AUTHORIZED_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -MERGE_DEVELOPER_IDENTITIES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#MergeDeveloperIdentitiesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cognitoidentity#MergeDeveloperIdentitiesResponse", - ) - ], - members={"IdentityId": {"target": IDENTITY_ID}}, -) - -MERGE_DEVELOPER_IDENTITIES = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#MergeDeveloperIdentities"), - shape_type=ShapeType.OPERATION, -) - -CONCURRENT_MODIFICATION_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#ConcurrentModificationException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"message": {"target": STRING}}, -) - -SET_IDENTITY_POOL_ROLES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#SetIdentityPoolRolesInput"), - members={ - "IdentityPoolId": { - "target": IDENTITY_POOL_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Roles": { - "target": ROLES_MAP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "RoleMappings": {"target": ROLE_MAPPING_MAP}, - }, +MERGE_DEVELOPER_IDENTITIES_INPUT: StaticSchema = ( + 18, + n0, + _MDII, + {_sm: None}, + (_SUI, _DUIe, _DPN, _IPId), + ( + (DEVELOPER_USER_IDENTIFIER, 1), + (DEVELOPER_USER_IDENTIFIER, 1), + (DEVELOPER_PROVIDER_NAME, 1), + (IDENTITY_POOL_ID, 1), + ), ) -SET_IDENTITY_POOL_ROLES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#SetIdentityPoolRolesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -SET_IDENTITY_POOL_ROLES = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#SetIdentityPoolRoles"), - shape_type=ShapeType.OPERATION, -) - -SET_PRINCIPAL_TAG_ATTRIBUTE_MAP_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#SetPrincipalTagAttributeMapInput"), - members={ - "IdentityPoolId": { - "target": IDENTITY_POOL_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "IdentityProviderName": { - "target": IDENTITY_PROVIDER_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "UseDefaults": {"target": USE_DEFAULTS}, - "PrincipalTags": {"target": PRINCIPAL_TAGS}, - }, +MERGE_DEVELOPER_IDENTITIES_OUTPUT: StaticSchema = ( + 18, + n0, + _MDIO, + {_sSI: _cMDIR, _smit: None}, + (_II,), + ((IDENTITY_ID, 0),), +) + +MERGE_DEVELOPER_IDENTITIES: StaticOperationSchema = ( + 23, + n0, + _MDI, + 0, + MERGE_DEVELOPER_IDENTITIES_INPUT, + MERGE_DEVELOPER_IDENTITIES_OUTPUT, + ( + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + NOT_AUTHORIZED_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -SET_PRINCIPAL_TAG_ATTRIBUTE_MAP_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#SetPrincipalTagAttributeMapOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cognitoidentity#SetPrincipalTagAttributeMapResponse", - ) - ], - members={ - "IdentityPoolId": {"target": IDENTITY_POOL_ID}, - "IdentityProviderName": {"target": IDENTITY_PROVIDER_NAME}, - "UseDefaults": {"target": USE_DEFAULTS}, - "PrincipalTags": {"target": PRINCIPAL_TAGS}, - }, +CONCURRENT_MODIFICATION_EXCEPTION: StaticSchema = ( + 18, + n0, + _CME, + {_smith: _c, _sE: 400}, + (_me,), + ((STRING, 0),), +) + +SET_IDENTITY_POOL_ROLES_INPUT: StaticSchema = ( + 18, + n0, + _SIPRI, + {_sm: None}, + (_IPId, _Ro, _RMol), + ((IDENTITY_POOL_ID, 1), (ROLES_MAP, 1), (ROLE_MAPPING_MAP, 0)), +) + +SET_IDENTITY_POOL_ROLES_OUTPUT: StaticSchema = ( + 18, + n0, + _SIPRO, + {_sSI: _sU, _smit: None}, +) + +SET_IDENTITY_POOL_ROLES: StaticOperationSchema = ( + 23, + n0, + _SIPR, + 0, + SET_IDENTITY_POOL_ROLES_INPUT, + SET_IDENTITY_POOL_ROLES_OUTPUT, + ( + CONCURRENT_MODIFICATION_EXCEPTION, + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + NOT_AUTHORIZED_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -SET_PRINCIPAL_TAG_ATTRIBUTE_MAP = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#SetPrincipalTagAttributeMap"), - shape_type=ShapeType.OPERATION, +SET_PRINCIPAL_TAG_ATTRIBUTE_MAP_INPUT: StaticSchema = ( + 18, + n0, + _SPTAMI, + {_sm: None}, + (_IPId, _IPNd, _UD, _PT), + ( + (IDENTITY_POOL_ID, 1), + (IDENTITY_PROVIDER_NAME, 1), + (USE_DEFAULTS, 0), + (PRINCIPAL_TAGS, 0), + ), ) -TAG_RESOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#TagResourceInput"), - members={ - "ResourceArn": { - "target": ARN_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Tags": { - "target": IDENTITY_POOL_TAGS_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +SET_PRINCIPAL_TAG_ATTRIBUTE_MAP_OUTPUT: StaticSchema = ( + 18, + n0, + _SPTAMO, + {_sSI: _cSPTAMR, _smit: None}, + (_IPId, _IPNd, _UD, _PT), + ( + (IDENTITY_POOL_ID, 0), + (IDENTITY_PROVIDER_NAME, 0), + (USE_DEFAULTS, 0), + (PRINCIPAL_TAGS, 0), + ), ) -TAG_RESOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#TagResourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cognitoidentity#TagResourceResponse", - ) - ], -) - -TAG_RESOURCE = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#TagResource"), - shape_type=ShapeType.OPERATION, -) - -UNLINK_DEVELOPER_IDENTITY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#UnlinkDeveloperIdentityInput"), - members={ - "IdentityId": { - "target": IDENTITY_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "IdentityPoolId": { - "target": IDENTITY_POOL_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "DeveloperProviderName": { - "target": DEVELOPER_PROVIDER_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "DeveloperUserIdentifier": { - "target": DEVELOPER_USER_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +SET_PRINCIPAL_TAG_ATTRIBUTE_MAP: StaticOperationSchema = ( + 23, + n0, + _SPTAM, + 0, + SET_PRINCIPAL_TAG_ATTRIBUTE_MAP_INPUT, + SET_PRINCIPAL_TAG_ATTRIBUTE_MAP_OUTPUT, + ( + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + NOT_AUTHORIZED_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -UNLINK_DEVELOPER_IDENTITY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#UnlinkDeveloperIdentityOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -UNLINK_DEVELOPER_IDENTITY = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#UnlinkDeveloperIdentity"), - shape_type=ShapeType.OPERATION, -) - -UNLINK_IDENTITY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#UnlinkIdentityInput"), - members={ - "IdentityId": { - "target": IDENTITY_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Logins": { - "target": LOGINS_MAP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "LoginsToRemove": { - "target": LOGINS_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +TAG_RESOURCE_INPUT: StaticSchema = ( + 18, + n0, + _TRI, + {_sm: None}, + (_RA, _Ta), + ((ARN_STRING, 1), (IDENTITY_POOL_TAGS_TYPE, 1)), +) + +TAG_RESOURCE_OUTPUT: StaticSchema = (18, n0, _TRO, {_sSI: _cTRR, _smit: None}) + +TAG_RESOURCE: StaticOperationSchema = ( + 23, + n0, + _TR, + 0, + TAG_RESOURCE_INPUT, + TAG_RESOURCE_OUTPUT, + ( + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + NOT_AUTHORIZED_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -UNLINK_IDENTITY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#UnlinkIdentityOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], +UNLINK_DEVELOPER_IDENTITY_INPUT: StaticSchema = ( + 18, + n0, + _UDII, + {_sm: None}, + (_II, _IPId, _DPN, _DUI), + ( + (IDENTITY_ID, 1), + (IDENTITY_POOL_ID, 1), + (DEVELOPER_PROVIDER_NAME, 1), + (DEVELOPER_USER_IDENTIFIER, 1), + ), ) -UNLINK_IDENTITY = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#UnlinkIdentity"), - shape_type=ShapeType.OPERATION, +UNLINK_DEVELOPER_IDENTITY_OUTPUT: StaticSchema = ( + 18, + n0, + _UDIO, + {_sSI: _sU, _smit: None}, +) + +UNLINK_DEVELOPER_IDENTITY: StaticOperationSchema = ( + 23, + n0, + _UDI, + 0, + UNLINK_DEVELOPER_IDENTITY_INPUT, + UNLINK_DEVELOPER_IDENTITY_OUTPUT, + ( + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + NOT_AUTHORIZED_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -IDENTITY_POOL_TAGS_LIST_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#IdentityPoolTagsListType"), - shape_type=ShapeType.LIST, - members={"member": {"target": TAG_KEYS_TYPE}}, +UNLINK_IDENTITY_INPUT: StaticSchema = ( + 18, + n0, + _UIInl, + {_sm: None}, + (_II, _L, _LTR), + ((IDENTITY_ID, 1), (LOGINS_MAP, 1), (LOGINS_LIST, 1)), +) + +UNLINK_IDENTITY_OUTPUT: StaticSchema = (18, n0, _UIO, {_sSI: _sU, _smit: None}) + +UNLINK_IDENTITY: StaticOperationSchema = ( + 23, + n0, + _UI, + 0, + UNLINK_IDENTITY_INPUT, + UNLINK_IDENTITY_OUTPUT, + ( + EXTERNAL_SERVICE_EXCEPTION, + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + NOT_AUTHORIZED_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -UNTAG_RESOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#UntagResourceInput"), - members={ - "ResourceArn": { - "target": ARN_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "TagKeys": { - "target": IDENTITY_POOL_TAGS_LIST_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +IDENTITY_POOL_TAGS_LIST_TYPE: StaticSchema = ( + 16, + n0, + _IPTLT, + 0, + (_m,), + ((TAG_KEYS_TYPE, 0),), +) + +UNTAG_RESOURCE_INPUT: StaticSchema = ( + 18, + n0, + _URI, + {_sm: None}, + (_RA, _TK), + ((ARN_STRING, 1), (IDENTITY_POOL_TAGS_LIST_TYPE, 1)), +) + +UNTAG_RESOURCE_OUTPUT: StaticSchema = (18, n0, _URO, {_sSI: _cURR, _smit: None}) + +UNTAG_RESOURCE: StaticOperationSchema = ( + 23, + n0, + _UR, + 0, + UNTAG_RESOURCE_INPUT, + UNTAG_RESOURCE_OUTPUT, + ( + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + NOT_AUTHORIZED_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -UNTAG_RESOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#UntagResourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cognitoidentity#UntagResourceResponse", - ) - ], -) - -UNTAG_RESOURCE = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#UntagResource"), - shape_type=ShapeType.OPERATION, -) - -UPDATE_IDENTITY_POOL_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#UpdateIdentityPoolInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cognitoidentity#IdentityPool", - ) - ], - members={ - "IdentityPoolId": { - "target": IDENTITY_POOL_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "IdentityPoolName": { - "target": IDENTITY_POOL_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "AllowUnauthenticatedIdentities": { - "target": IDENTITY_POOL_UNAUTHENTICATED, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=False), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "AllowClassicFlow": {"target": CLASSIC_FLOW}, - "SupportedLoginProviders": {"target": IDENTITY_PROVIDERS}, - "DeveloperProviderName": {"target": DEVELOPER_PROVIDER_NAME}, - "OpenIdConnectProviderARNs": {"target": OIDC_PROVIDER_LIST}, - "CognitoIdentityProviders": {"target": COGNITO_IDENTITY_PROVIDER_LIST}, - "SamlProviderARNs": {"target": SAML_PROVIDER_LIST}, - "IdentityPoolTags": {"target": IDENTITY_POOL_TAGS_TYPE}, - }, +UPDATE_IDENTITY_POOL_INPUT: StaticSchema = ( + 18, + n0, + _UIPI, + {_sSI: _cIP, _sm: None}, + (_IPId, _IPN, _AUI, _ACF, _SLP, _DPN, _OICPARN, _CIPo, _SPARN, _IPT), + ( + (IDENTITY_POOL_ID, 1), + (IDENTITY_POOL_NAME, 1), + (IDENTITY_POOL_UNAUTHENTICATED, {_s: False, _smi: None}), + (CLASSIC_FLOW, 0), + (IDENTITY_PROVIDERS, 0), + (DEVELOPER_PROVIDER_NAME, 0), + (OIDC_PROVIDER_LIST, 0), + (COGNITO_IDENTITY_PROVIDER_LIST, 0), + (SAML_PROVIDER_LIST, 0), + (IDENTITY_POOL_TAGS_TYPE, 0), + ), ) -UPDATE_IDENTITY_POOL_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.cognitoidentity#UpdateIdentityPoolOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.cognitoidentity#IdentityPool", - ) - ], - members={ - "IdentityPoolId": { - "target": IDENTITY_POOL_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "IdentityPoolName": { - "target": IDENTITY_POOL_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "AllowUnauthenticatedIdentities": { - "target": IDENTITY_POOL_UNAUTHENTICATED, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=False), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "AllowClassicFlow": {"target": CLASSIC_FLOW}, - "SupportedLoginProviders": {"target": IDENTITY_PROVIDERS}, - "DeveloperProviderName": {"target": DEVELOPER_PROVIDER_NAME}, - "OpenIdConnectProviderARNs": {"target": OIDC_PROVIDER_LIST}, - "CognitoIdentityProviders": {"target": COGNITO_IDENTITY_PROVIDER_LIST}, - "SamlProviderARNs": {"target": SAML_PROVIDER_LIST}, - "IdentityPoolTags": {"target": IDENTITY_POOL_TAGS_TYPE}, - }, +UPDATE_IDENTITY_POOL_OUTPUT: StaticSchema = ( + 18, + n0, + _UIPO, + {_sSI: _cIP, _smit: None}, + (_IPId, _IPN, _AUI, _ACF, _SLP, _DPN, _OICPARN, _CIPo, _SPARN, _IPT), + ( + (IDENTITY_POOL_ID, 1), + (IDENTITY_POOL_NAME, 1), + (IDENTITY_POOL_UNAUTHENTICATED, {_s: False, _smi: None}), + (CLASSIC_FLOW, 0), + (IDENTITY_PROVIDERS, 0), + (DEVELOPER_PROVIDER_NAME, 0), + (OIDC_PROVIDER_LIST, 0), + (COGNITO_IDENTITY_PROVIDER_LIST, 0), + (SAML_PROVIDER_LIST, 0), + (IDENTITY_POOL_TAGS_TYPE, 0), + ), ) -UPDATE_IDENTITY_POOL = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#UpdateIdentityPool"), - shape_type=ShapeType.OPERATION, +UPDATE_IDENTITY_POOL: StaticOperationSchema = ( + 23, + n0, + _UIP, + 0, + UPDATE_IDENTITY_POOL_INPUT, + UPDATE_IDENTITY_POOL_OUTPUT, + ( + CONCURRENT_MODIFICATION_EXCEPTION, + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + NOT_AUTHORIZED_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -AWS_COGNITO_IDENTITY_SERVICE = Schema( - id=ShapeID("com.amazonaws.cognitoidentity#AWSCognitoIdentityService"), - shape_type=ShapeType.SERVICE, - traits=[ - Trait.new( - id=ShapeID("aws.auth#sigv4"), - value=MappingProxyType({"name": "cognito-identity"}), - ), - Trait.new(id=ShapeID("aws.protocols#awsJson1_1")), - Trait.new( - id=ShapeID("smithy.rules#endpointBdd"), - value=MappingProxyType( - { - "version": "1.1", - "parameters": MappingProxyType( - { - "Region": MappingProxyType( - { - "builtIn": "AWS::Region", - "required": False, - "documentation": "The AWS region used to dispatch the request.", - "type": "string", - } - ), - "UseDualStack": MappingProxyType( - { - "builtIn": "AWS::UseDualStack", - "required": True, - "default": False, - "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", - "type": "boolean", - } - ), - "UseFIPS": MappingProxyType( - { - "builtIn": "AWS::UseFIPS", - "required": True, - "default": False, - "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", - "type": "boolean", - } - ), - "Endpoint": MappingProxyType( - { - "builtIn": "SDK::Endpoint", - "required": False, - "documentation": "Override the endpoint used to send this request", - "type": "string", - } - ), - } - ), - "conditions": ( - MappingProxyType( - { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "Endpoint"}),), - } - ), - MappingProxyType( - { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "Region"}),), - } - ), - MappingProxyType( - { - "fn": "aws.partition", - "argv": (MappingProxyType({"ref": "Region"}),), - "assign": "PartitionResult", - } - ), - MappingProxyType( - { - "fn": "booleanEquals", - "argv": (MappingProxyType({"ref": "UseFIPS"}), True), - } - ), - MappingProxyType( - { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "supportsFIPS", - ), - } - ), - True, - ), - } - ), - MappingProxyType( +AWS_COGNITO_IDENTITY_SERVICE: StaticSchema = ( + 21, + n0, + _AWSCIS, + { + _a: MappingProxyType({"name": "cognito-identity"}), + _a_: None, + _sB: MappingProxyType( + { + "version": "1.1", + "parameters": MappingProxyType( + { + "Region": MappingProxyType( { - "fn": "booleanEquals", - "argv": ( - MappingProxyType({"ref": "UseDualStack"}), - True, - ), - } - ), - MappingProxyType( - { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "supportsDualStack", - ), - } - ), - True, - ), + "builtIn": "AWS::Region", + "required": False, + "documentation": "The AWS region used to dispatch the request.", + "type": "string", } ), - MappingProxyType( + "UseDualStack": MappingProxyType( { - "fn": "stringEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "name", - ), - } - ), - "aws", - ), + "builtIn": "AWS::UseDualStack", + "required": True, + "default": False, + "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", + "type": "boolean", } ), - MappingProxyType( + "UseFIPS": MappingProxyType( { - "fn": "stringEquals", - "argv": ( - MappingProxyType({"ref": "Region"}), - "us-east-1", - ), + "builtIn": "AWS::UseFIPS", + "required": True, + "default": False, + "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", + "type": "boolean", } ), - MappingProxyType( + "Endpoint": MappingProxyType( { - "fn": "stringEquals", - "argv": ( - MappingProxyType({"ref": "Region"}), - "us-east-2", - ), - } - ), - MappingProxyType( - { - "fn": "stringEquals", - "argv": ( - MappingProxyType({"ref": "Region"}), - "us-west-1", - ), - } - ), - MappingProxyType( - { - "fn": "stringEquals", - "argv": ( - MappingProxyType({"ref": "Region"}), - "us-west-2", - ), + "builtIn": "SDK::Endpoint", + "required": False, + "documentation": "Override the endpoint used to send this request", + "type": "string", } ), + } + ), + "conditions": ( + MappingProxyType( + { + "fn": "isSet", + "argv": (MappingProxyType({"ref": "Endpoint"}),), + } ), - "results": ( - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: FIPS and custom endpoint are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": MappingProxyType({"ref": "Endpoint"}), - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://cognito-identity-fips.us-east-1.amazonaws.com", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://cognito-identity-fips.us-east-2.amazonaws.com", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://cognito-identity-fips.us-west-1.amazonaws.com", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://cognito-identity-fips.us-west-2.amazonaws.com", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://cognito-identity-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "FIPS and DualStack are enabled, but this partition does not support one or both", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://cognito-identity-fips.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "FIPS is enabled but this partition does not support FIPS", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + MappingProxyType( + {"fn": "isSet", "argv": (MappingProxyType({"ref": "Region"}),)} + ), + MappingProxyType( + { + "fn": "aws.partition", + "argv": (MappingProxyType({"ref": "Region"}),), + "assign": "PartitionResult", + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": (MappingProxyType({"ref": "UseFIPS"}), True), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( { - "url": "https://cognito-identity.{Region}.amazonaws.com", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "supportsFIPS", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + True, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": (MappingProxyType({"ref": "UseDualStack"}), True), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( { - "url": "https://cognito-identity.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "supportsDualStack", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "DualStack is enabled but this partition does not support DualStack", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + True, + ), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( { - "url": "https://cognito-identity.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "name", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: Missing Region", - "type": "error", - } - ), + "aws", + ), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": (MappingProxyType({"ref": "Region"}), "us-east-1"), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": (MappingProxyType({"ref": "Region"}), "us-east-2"), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": (MappingProxyType({"ref": "Region"}), "us-west-1"), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": (MappingProxyType({"ref": "Region"}), "us-west-2"), + } + ), + ), + "results": ( + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: FIPS and custom endpoint are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": MappingProxyType({"ref": "Endpoint"}), + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://cognito-identity-fips.us-east-1.amazonaws.com", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://cognito-identity-fips.us-east-2.amazonaws.com", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } ), - "root": 2, - "nodeCount": 18, - "nodes": "/////wAAAAH/////AAAAAAAAABEAAAADAAAAAQAAAAQF9eEQAAAAAgAAAAUF9eEQAAAAAwAAAAkAAAAGAAAABQAAAAcF9eEPAAAABgAAAAgF9eEOAAAABwX14QwF9eENAAAABAAAAAsAAAAKAAAABQX14QkF9eELAAAABQAAAAwF9eEKAAAABgAAAA0F9eEJAAAACAX14QQAAAAOAAAACQX14QUAAAAPAAAACgX14QYAAAAQAAAACwX14QcF9eEIAAAAAwX14QEAAAASAAAABQX14QIF9eED", - } - ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://cognito-identity-fips.us-west-1.amazonaws.com", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://cognito-identity-fips.us-west-2.amazonaws.com", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://cognito-identity-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS and DualStack are enabled, but this partition does not support one or both", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://cognito-identity-fips.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS is enabled but this partition does not support FIPS", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://cognito-identity.{Region}.amazonaws.com", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://cognito-identity.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "DualStack is enabled but this partition does not support DualStack", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://cognito-identity.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Missing Region", + "type": "error", + } + ), + ), + "root": 2, + "nodeCount": 18, + "nodes": "/////wAAAAH/////AAAAAAAAABEAAAADAAAAAQAAAAQF9eEQAAAAAgAAAAUF9eEQAAAAAwAAAAkAAAAGAAAABQAAAAcF9eEPAAAABgAAAAgF9eEOAAAABwX14QwF9eENAAAABAAAAAsAAAAKAAAABQX14QkF9eELAAAABQAAAAwF9eEKAAAABgAAAA0F9eEJAAAACAX14QQAAAAOAAAACQX14QUAAAAPAAAACgX14QYAAAAQAAAACwX14QcF9eEIAAAAAwX14QEAAAASAAAABQX14QIF9eED", + } ), - Trait.new( - id=ShapeID("aws.api#service"), - value=MappingProxyType( - { - "sdkId": "Cognito Identity", - "arnNamespace": "cognito-identity", - "cloudFormationName": "Cognito", - "cloudTrailEventSource": "cognito-identity.amazonaws.com", - "endpointPrefix": "cognito-identity", - } - ), + _aw: MappingProxyType( + { + "sdkId": "Cognito Identity", + "arnNamespace": "cognito-identity", + "cloudFormationName": "Cognito", + "cloudTrailEventSource": "cognito-identity.amazonaws.com", + "endpointPrefix": "cognito-identity", + } ), - Trait.new( - id=ShapeID("smithy.api#xmlNamespace"), - value=MappingProxyType( - {"uri": "http://cognito-identity.amazonaws.com/doc/2014-06-30/"} - ), + _sN: MappingProxyType( + {"uri": "http://cognito-identity.amazonaws.com/doc/2014-06-30/"} ), - ], + }, ) diff --git a/clients/aws-sdk-cognito-identity/src/aws_sdk_cognito_identity/client.py b/clients/aws-sdk-cognito-identity/src/aws_sdk_cognito_identity/client.py index 91993fd2..09090804 100644 --- a/clients/aws-sdk-cognito-identity/src/aws_sdk_cognito_identity/client.py +++ b/clients/aws-sdk-cognito-identity/src/aws_sdk_cognito_identity/client.py @@ -1,94 +1,102 @@ # Code generated by smithy-python-codegen DO NOT EDIT. +from __future__ import annotations + from copy import deepcopy import logging from typing import Any, cast +from smithy_aws_core.aio.identity.chain import AsyncIdentityChain from smithy_aws_core.config import ConfigSource from smithy_aws_core.identity import AWSCredentialsIdentity -from smithy_aws_core.identity.chain import IdentityChain -from smithy_core.aio.client import AsyncClient, ClientCall, RequestPipeline +from smithy_core.aio.client import AsyncClient, AsyncClientCall, AsyncRequestPipeline from smithy_core.deserializers import DeserializeableShape from smithy_core.exceptions import ExpectationNotMetError from smithy_core.schemas import APIOperation from smithy_core.serializers import SerializeableShape -from smithy_http.aio.interfaces import HTTPClient +from smithy_http.aio.interfaces import AsyncHTTPClient from smithy_http.plugins import user_agent_plugin from .config import AsyncCognitoIdentityConfig, Plugin from .models import ( CREATE_IDENTITY_POOL, - CreateIdentityPoolInput, - CreateIdentityPoolOutput, DELETE_IDENTITIES, DELETE_IDENTITY_POOL, DESCRIBE_IDENTITY, DESCRIBE_IDENTITY_POOL, - DeleteIdentitiesInput, - DeleteIdentitiesOutput, - DeleteIdentityPoolInput, - DeleteIdentityPoolOutput, - DescribeIdentityInput, - DescribeIdentityOutput, - DescribeIdentityPoolInput, - DescribeIdentityPoolOutput, GET_CREDENTIALS_FOR_IDENTITY, GET_ID, GET_IDENTITY_POOL_ROLES, GET_OPEN_ID_TOKEN, GET_OPEN_ID_TOKEN_FOR_DEVELOPER_IDENTITY, GET_PRINCIPAL_TAG_ATTRIBUTE_MAP, - GetCredentialsForIdentityInput, - GetCredentialsForIdentityOutput, - GetIdInput, - GetIdOutput, - GetIdentityPoolRolesInput, - GetIdentityPoolRolesOutput, - GetOpenIdTokenForDeveloperIdentityInput, - GetOpenIdTokenForDeveloperIdentityOutput, - GetOpenIdTokenInput, - GetOpenIdTokenOutput, - GetPrincipalTagAttributeMapInput, - GetPrincipalTagAttributeMapOutput, LIST_IDENTITIES, LIST_IDENTITY_POOLS, LIST_TAGS_FOR_RESOURCE, LOOKUP_DEVELOPER_IDENTITY, - ListIdentitiesInput, - ListIdentitiesOutput, - ListIdentityPoolsInput, - ListIdentityPoolsOutput, - ListTagsForResourceInput, - ListTagsForResourceOutput, - LookupDeveloperIdentityInput, - LookupDeveloperIdentityOutput, MERGE_DEVELOPER_IDENTITIES, - MergeDeveloperIdentitiesInput, - MergeDeveloperIdentitiesOutput, SET_IDENTITY_POOL_ROLES, SET_PRINCIPAL_TAG_ATTRIBUTE_MAP, - SetIdentityPoolRolesInput, - SetIdentityPoolRolesOutput, - SetPrincipalTagAttributeMapInput, - SetPrincipalTagAttributeMapOutput, TAG_RESOURCE, - TagResourceInput, - TagResourceOutput, UNLINK_DEVELOPER_IDENTITY, UNLINK_IDENTITY, UNTAG_RESOURCE, UPDATE_IDENTITY_POOL, - UnlinkDeveloperIdentityInput, - UnlinkDeveloperIdentityOutput, - UnlinkIdentityInput, - UnlinkIdentityOutput, - UntagResourceInput, - UntagResourceOutput, - UpdateIdentityPoolInput, - UpdateIdentityPoolOutput, ) from .user_agent import aws_user_agent_plugin +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .models import ( + CreateIdentityPoolInput, + CreateIdentityPoolOutput, + DeleteIdentitiesInput, + DeleteIdentitiesOutput, + DeleteIdentityPoolInput, + DeleteIdentityPoolOutput, + DescribeIdentityInput, + DescribeIdentityOutput, + DescribeIdentityPoolInput, + DescribeIdentityPoolOutput, + GetCredentialsForIdentityInput, + GetCredentialsForIdentityOutput, + GetIdInput, + GetIdOutput, + GetIdentityPoolRolesInput, + GetIdentityPoolRolesOutput, + GetOpenIdTokenForDeveloperIdentityInput, + GetOpenIdTokenForDeveloperIdentityOutput, + GetOpenIdTokenInput, + GetOpenIdTokenOutput, + GetPrincipalTagAttributeMapInput, + GetPrincipalTagAttributeMapOutput, + ListIdentitiesInput, + ListIdentitiesOutput, + ListIdentityPoolsInput, + ListIdentityPoolsOutput, + ListTagsForResourceInput, + ListTagsForResourceOutput, + LookupDeveloperIdentityInput, + LookupDeveloperIdentityOutput, + MergeDeveloperIdentitiesInput, + MergeDeveloperIdentitiesOutput, + SetIdentityPoolRolesInput, + SetIdentityPoolRolesOutput, + SetPrincipalTagAttributeMapInput, + SetPrincipalTagAttributeMapOutput, + TagResourceInput, + TagResourceOutput, + UnlinkDeveloperIdentityInput, + UnlinkDeveloperIdentityOutput, + UnlinkIdentityInput, + UnlinkIdentityOutput, + UntagResourceInput, + UntagResourceOutput, + UpdateIdentityPoolInput, + UpdateIdentityPoolOutput, + ) + logger = logging.getLogger(__name__) @@ -174,12 +182,12 @@ async def _post_setup(self, config: AsyncCognitoIdentityConfig) -> None: config_file = await config_context.parsed_profiles() if config_context.profile_source is ConfigSource.OVERRIDE: profile_name = config_context.profile_name - config.aws_credentials_identity_resolver = await IdentityChain.create( + config.aws_credentials_identity_resolver = await AsyncIdentityChain.create( AWSCredentialsIdentity, config_file=config_file, profile_name=profile_name, region_override=config.region, - http_client=cast(HTTPClient | None, config.transport), + http_client=cast(AsyncHTTPClient | None, config.transport), ) async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( @@ -188,7 +196,7 @@ async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( operation: APIOperation[I, O], default_plugins: list[Plugin], plugins: list[Plugin] | None, - ) -> tuple[RequestPipeline[Any, Any], ClientCall[I, O]]: + ) -> tuple[AsyncRequestPipeline[Any, Any], AsyncClientCall[I, O]]: if self._closed: raise RuntimeError( "Cannot invoke an operation on a client that has been closed." diff --git a/clients/aws-sdk-cognito-identity/src/aws_sdk_cognito_identity/config.py b/clients/aws-sdk-cognito-identity/src/aws_sdk_cognito_identity/config.py index 17c779d2..f338eb5f 100644 --- a/clients/aws-sdk-cognito-identity/src/aws_sdk_cognito_identity/config.py +++ b/clients/aws-sdk-cognito-identity/src/aws_sdk_cognito_identity/config.py @@ -1,132 +1,156 @@ # Code generated by smithy-python-codegen DO NOT EDIT. from dataclasses import dataclass, field -from typing import Any, Callable, ClassVar, Self, TypeAlias, Union, Unpack +from typing import ( + Any, + Callable, + ClassVar, + Self, + TYPE_CHECKING, + TypeAlias, + Union, + Unpack, +) -from smithy_aws_core.aio.protocols import AwsJson11ClientProtocol -from smithy_aws_core.auth import SigV4AuthScheme -from smithy_aws_core.config import AwsConfigOverrides, FileSystem -from smithy_aws_core.config.aws_config import AsyncAwsConfig -from smithy_aws_core.config.resolvers import EndpointUriResolver -from smithy_aws_core.config.types import FieldSpec -from smithy_aws_core.endpoints.standard_regional import ( - StandardRegionalEndpointsResolver, +from smithy_aws_core.aio.auth.sigv4 import AsyncSigV4AuthScheme +from smithy_aws_core.aio.config import AsyncFileSystem +from smithy_aws_core.aio.config.aws_config import AsyncAwsConfig, AwsConfigOverrides +from smithy_aws_core.aio.config.resolvers import EndpointUriResolver +from smithy_aws_core.aio.endpoints.standard_regional import ( + AsyncStandardRegionalEndpointsResolver, ) +from smithy_aws_core.aio.protocols import AsyncAwsJson11ClientProtocol +from smithy_aws_core.config.types import FieldSpec from smithy_aws_core.identity import AWSCredentialsIdentity, AWSIdentityProperties -from smithy_core.aio.interfaces import ( - ClientProtocol, - EndpointResolver, - ProtocolConstructor, - ProtocolSettings, -) -from smithy_core.aio.interfaces.auth import AuthScheme -from smithy_core.aio.interfaces.identity import IdentityResolver -from smithy_core.interceptors import Interceptor +from smithy_core.aio.interfaces import AsyncClientProtocol, AsyncEndpointResolver +from smithy_core.aio.interfaces.auth import AsyncAuthScheme +from smithy_core.aio.interfaces.identity import AsyncIdentityResolver +from smithy_core.interfaces import ProtocolConstructor, ProtocolSettings from smithy_core.interfaces.auth import AuthSchemeResolver from smithy_core.shapes import ShapeID from smithy_http.aio.aiohttp import AIOHTTPClient +from ._private.schemas import AWS_COGNITO_IDENTITY_SERVICE from .auth import HTTPAuthSchemeResolver -from .models import ( - CreateIdentityPoolInput, - CreateIdentityPoolOutput, - DeleteIdentitiesInput, - DeleteIdentitiesOutput, - DeleteIdentityPoolInput, - DeleteIdentityPoolOutput, - DescribeIdentityInput, - DescribeIdentityOutput, - DescribeIdentityPoolInput, - DescribeIdentityPoolOutput, - GetCredentialsForIdentityInput, - GetCredentialsForIdentityOutput, - GetIdInput, - GetIdOutput, - GetIdentityPoolRolesInput, - GetIdentityPoolRolesOutput, - GetOpenIdTokenForDeveloperIdentityInput, - GetOpenIdTokenForDeveloperIdentityOutput, - GetOpenIdTokenInput, - GetOpenIdTokenOutput, - GetPrincipalTagAttributeMapInput, - GetPrincipalTagAttributeMapOutput, - ListIdentitiesInput, - ListIdentitiesOutput, - ListIdentityPoolsInput, - ListIdentityPoolsOutput, - ListTagsForResourceInput, - ListTagsForResourceOutput, - LookupDeveloperIdentityInput, - LookupDeveloperIdentityOutput, - MergeDeveloperIdentitiesInput, - MergeDeveloperIdentitiesOutput, - SetIdentityPoolRolesInput, - SetIdentityPoolRolesOutput, - SetPrincipalTagAttributeMapInput, - SetPrincipalTagAttributeMapOutput, - TagResourceInput, - TagResourceOutput, - UnlinkDeveloperIdentityInput, - UnlinkDeveloperIdentityOutput, - UnlinkIdentityInput, - UnlinkIdentityOutput, - UntagResourceInput, - UntagResourceOutput, - UpdateIdentityPoolInput, - UpdateIdentityPoolOutput, -) -_ServiceInterceptor = Union[ - Interceptor[CreateIdentityPoolInput, CreateIdentityPoolOutput, Any, Any], - Interceptor[DeleteIdentitiesInput, DeleteIdentitiesOutput, Any, Any], - Interceptor[DeleteIdentityPoolInput, DeleteIdentityPoolOutput, Any, Any], - Interceptor[DescribeIdentityInput, DescribeIdentityOutput, Any, Any], - Interceptor[DescribeIdentityPoolInput, DescribeIdentityPoolOutput, Any, Any], - Interceptor[ - GetCredentialsForIdentityInput, GetCredentialsForIdentityOutput, Any, Any - ], - Interceptor[GetIdInput, GetIdOutput, Any, Any], - Interceptor[GetIdentityPoolRolesInput, GetIdentityPoolRolesOutput, Any, Any], - Interceptor[GetOpenIdTokenInput, GetOpenIdTokenOutput, Any, Any], - Interceptor[ +if TYPE_CHECKING: + from smithy_core.interceptors import Interceptor + from .models import ( + CreateIdentityPoolInput, + CreateIdentityPoolOutput, + DeleteIdentitiesInput, + DeleteIdentitiesOutput, + DeleteIdentityPoolInput, + DeleteIdentityPoolOutput, + DescribeIdentityInput, + DescribeIdentityOutput, + DescribeIdentityPoolInput, + DescribeIdentityPoolOutput, + GetCredentialsForIdentityInput, + GetCredentialsForIdentityOutput, + GetIdInput, + GetIdOutput, + GetIdentityPoolRolesInput, + GetIdentityPoolRolesOutput, GetOpenIdTokenForDeveloperIdentityInput, GetOpenIdTokenForDeveloperIdentityOutput, - Any, - Any, - ], - Interceptor[ - GetPrincipalTagAttributeMapInput, GetPrincipalTagAttributeMapOutput, Any, Any - ], - Interceptor[ListIdentitiesInput, ListIdentitiesOutput, Any, Any], - Interceptor[ListIdentityPoolsInput, ListIdentityPoolsOutput, Any, Any], - Interceptor[ListTagsForResourceInput, ListTagsForResourceOutput, Any, Any], - Interceptor[LookupDeveloperIdentityInput, LookupDeveloperIdentityOutput, Any, Any], - Interceptor[ - MergeDeveloperIdentitiesInput, MergeDeveloperIdentitiesOutput, Any, Any - ], - Interceptor[SetIdentityPoolRolesInput, SetIdentityPoolRolesOutput, Any, Any], - Interceptor[ - SetPrincipalTagAttributeMapInput, SetPrincipalTagAttributeMapOutput, Any, Any - ], - Interceptor[TagResourceInput, TagResourceOutput, Any, Any], - Interceptor[UnlinkDeveloperIdentityInput, UnlinkDeveloperIdentityOutput, Any, Any], - Interceptor[UnlinkIdentityInput, UnlinkIdentityOutput, Any, Any], - Interceptor[UntagResourceInput, UntagResourceOutput, Any, Any], - Interceptor[UpdateIdentityPoolInput, UpdateIdentityPoolOutput, Any, Any], -] + GetOpenIdTokenInput, + GetOpenIdTokenOutput, + GetPrincipalTagAttributeMapInput, + GetPrincipalTagAttributeMapOutput, + ListIdentitiesInput, + ListIdentitiesOutput, + ListIdentityPoolsInput, + ListIdentityPoolsOutput, + ListTagsForResourceInput, + ListTagsForResourceOutput, + LookupDeveloperIdentityInput, + LookupDeveloperIdentityOutput, + MergeDeveloperIdentitiesInput, + MergeDeveloperIdentitiesOutput, + SetIdentityPoolRolesInput, + SetIdentityPoolRolesOutput, + SetPrincipalTagAttributeMapInput, + SetPrincipalTagAttributeMapOutput, + TagResourceInput, + TagResourceOutput, + UnlinkDeveloperIdentityInput, + UnlinkDeveloperIdentityOutput, + UnlinkIdentityInput, + UnlinkIdentityOutput, + UntagResourceInput, + UntagResourceOutput, + UpdateIdentityPoolInput, + UpdateIdentityPoolOutput, + ) + + _ServiceInterceptor = Union[ + Interceptor[CreateIdentityPoolInput, CreateIdentityPoolOutput, Any, Any], + Interceptor[DeleteIdentitiesInput, DeleteIdentitiesOutput, Any, Any], + Interceptor[DeleteIdentityPoolInput, DeleteIdentityPoolOutput, Any, Any], + Interceptor[DescribeIdentityInput, DescribeIdentityOutput, Any, Any], + Interceptor[DescribeIdentityPoolInput, DescribeIdentityPoolOutput, Any, Any], + Interceptor[ + GetCredentialsForIdentityInput, GetCredentialsForIdentityOutput, Any, Any + ], + Interceptor[GetIdInput, GetIdOutput, Any, Any], + Interceptor[GetIdentityPoolRolesInput, GetIdentityPoolRolesOutput, Any, Any], + Interceptor[GetOpenIdTokenInput, GetOpenIdTokenOutput, Any, Any], + Interceptor[ + GetOpenIdTokenForDeveloperIdentityInput, + GetOpenIdTokenForDeveloperIdentityOutput, + Any, + Any, + ], + Interceptor[ + GetPrincipalTagAttributeMapInput, + GetPrincipalTagAttributeMapOutput, + Any, + Any, + ], + Interceptor[ListIdentitiesInput, ListIdentitiesOutput, Any, Any], + Interceptor[ListIdentityPoolsInput, ListIdentityPoolsOutput, Any, Any], + Interceptor[ListTagsForResourceInput, ListTagsForResourceOutput, Any, Any], + Interceptor[ + LookupDeveloperIdentityInput, LookupDeveloperIdentityOutput, Any, Any + ], + Interceptor[ + MergeDeveloperIdentitiesInput, MergeDeveloperIdentitiesOutput, Any, Any + ], + Interceptor[SetIdentityPoolRolesInput, SetIdentityPoolRolesOutput, Any, Any], + Interceptor[ + SetPrincipalTagAttributeMapInput, + SetPrincipalTagAttributeMapOutput, + Any, + Any, + ], + Interceptor[TagResourceInput, TagResourceOutput, Any, Any], + Interceptor[ + UnlinkDeveloperIdentityInput, UnlinkDeveloperIdentityOutput, Any, Any + ], + Interceptor[UnlinkIdentityInput, UnlinkIdentityOutput, Any, Any], + Interceptor[UntagResourceInput, UntagResourceOutput, Any, Any], + Interceptor[UpdateIdentityPoolInput, UpdateIdentityPoolOutput, Any, Any], + ] +else: + _ServiceInterceptor = Any + _PROTOCOL_SETTINGS = ProtocolSettings( namespace="com.amazonaws.cognitoidentity", service_target="AWSCognitoIdentityService", + service_schema=AWS_COGNITO_IDENTITY_SERVICE, ) class _AsyncCognitoIdentityConfigOverrides(AwsConfigOverrides, total=False): - endpoint_resolver: EndpointResolver | None + endpoint_resolver: AsyncEndpointResolver | None protocol: ( - ClientProtocol[Any, Any] | ProtocolConstructor[ClientProtocol[Any, Any]] | None + AsyncClientProtocol[Any, Any] + | ProtocolConstructor[AsyncClientProtocol[Any, Any]] + | None ) - auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None + auth_schemes: dict[ShapeID, AsyncAuthScheme[Any, Any, Any, Any]] | None auth_scheme_resolver: AuthSchemeResolver | None @@ -134,17 +158,17 @@ class _AsyncCognitoIdentityConfigOverrides(AwsConfigOverrides, total=False): class AsyncCognitoIdentityConfig(AsyncAwsConfig): """Cognito Identity configuration (async-resolved).""" - endpoint_resolver: EndpointResolver | None = None + endpoint_resolver: AsyncEndpointResolver | None = None """ The endpoint resolver used to resolve the final endpoint per-operation based on the configuration. """ - protocol: ClientProtocol[Any, Any] | None = None + protocol: AsyncClientProtocol[Any, Any] | None = None """ Pass a protocol class reference from smithy_aws_core.aio.protocols to - select the protocol, e.g. protocol=AwsJson10ClientProtocol. For custom - protocols a protocol instance may also be passed. + select the protocol, e.g. protocol=AsyncAwsJson10ClientProtocol. For + custom protocols a protocol instance may also be passed. """ interceptors: list[_ServiceInterceptor] = field(default_factory=lambda: []) @@ -153,7 +177,7 @@ class AsyncCognitoIdentityConfig(AsyncAwsConfig): execution of a request. """ - auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None = None + auth_schemes: dict[ShapeID, AsyncAuthScheme[Any, Any, Any, Any]] | None = None """A map of auth scheme ids to auth schemes.""" auth_scheme_resolver: AuthSchemeResolver | None = None @@ -163,7 +187,7 @@ class AsyncCognitoIdentityConfig(AsyncAwsConfig): """ aws_credentials_identity_resolver: ( - IdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None + AsyncIdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None ) = None """Resolves AWS Credentials. Required for operations that use Sigv4 Auth.""" @@ -204,24 +228,26 @@ class AsyncCognitoIdentityConfig(AsyncAwsConfig): default=None, resolver=EndpointUriResolver("cognito_identity") ), "endpoint_resolver": FieldSpec( - default_factory=lambda: StandardRegionalEndpointsResolver( + default_factory=lambda: AsyncStandardRegionalEndpointsResolver( endpoint_prefix="cognito-identity" ) ), "protocol": FieldSpec( - default_factory=lambda: AwsJson11ClientProtocol(_PROTOCOL_SETTINGS), + default_factory=lambda: AsyncAwsJson11ClientProtocol(_PROTOCOL_SETTINGS), converter=lambda p: p(_PROTOCOL_SETTINGS) if isinstance(p, type) else p, ), "auth_schemes": FieldSpec( default_factory=lambda: { - ShapeID("aws.auth#sigv4"): SigV4AuthScheme(service="cognito-identity") + ShapeID("aws.auth#sigv4"): AsyncSigV4AuthScheme( + service="cognito-identity" + ) } ), "auth_scheme_resolver": FieldSpec(default_factory=HTTPAuthSchemeResolver), "transport": FieldSpec(default_factory=lambda: AIOHTTPClient()), } - def set_auth_scheme(self, scheme: AuthScheme[Any, Any, Any, Any]) -> None: + def set_auth_scheme(self, scheme: AsyncAuthScheme[Any, Any, Any, Any]) -> None: """ Set an auth scheme implementation using its scheme ID. :param scheme: The auth scheme to add or replace. @@ -235,7 +261,7 @@ async def resolve( # pyright: ignore[reportIncompatibleMethodOverride] cls, *, profile: str | None = None, - fs: FileSystem | None = None, + fs: AsyncFileSystem | None = None, config_file_path: str | None = None, credentials_file_path: str | None = None, **overrides: Unpack[_AsyncCognitoIdentityConfigOverrides], diff --git a/clients/aws-sdk-cognito-identity/src/aws_sdk_cognito_identity/models.py b/clients/aws-sdk-cognito-identity/src/aws_sdk_cognito_identity/models.py index 02e75957..002b31fa 100644 --- a/clients/aws-sdk-cognito-identity/src/aws_sdk_cognito_identity/models.py +++ b/clients/aws-sdk-cognito-identity/src/aws_sdk_cognito_identity/models.py @@ -1,6374 +1,611 @@ # Code generated by smithy-python-codegen DO NOT EDIT. -from dataclasses import dataclass, field -from datetime import datetime -from enum import StrEnum -import logging -from typing import Any, Literal, Self +from __future__ import annotations -from smithy_core.deserializers import ShapeDeserializer -from smithy_core.documents import TypeRegistry +from ._private import schemas as _schemas +from smithy_core._dynamic_models import ModelRegistry from smithy_core.exceptions import ModeledError -from smithy_core.response import EMPTY_RESPONSE_METADATA, ResponseMetadata -from smithy_core.schemas import APIOperation, Schema -from smithy_core.serializers import ShapeSerializer +from smithy_core.schemas import APIOperation from smithy_core.shapes import ShapeID -from smithy_core.types import UnknownEnumMixin from ._private.schemas import ( - COGNITO_IDENTITY_PROVIDER as _SCHEMA_COGNITO_IDENTITY_PROVIDER, - CONCURRENT_MODIFICATION_EXCEPTION as _SCHEMA_CONCURRENT_MODIFICATION_EXCEPTION, CREATE_IDENTITY_POOL as _SCHEMA_CREATE_IDENTITY_POOL, - CREATE_IDENTITY_POOL_INPUT as _SCHEMA_CREATE_IDENTITY_POOL_INPUT, - CREATE_IDENTITY_POOL_OUTPUT as _SCHEMA_CREATE_IDENTITY_POOL_OUTPUT, - CREDENTIALS as _SCHEMA_CREDENTIALS, DELETE_IDENTITIES as _SCHEMA_DELETE_IDENTITIES, - DELETE_IDENTITIES_INPUT as _SCHEMA_DELETE_IDENTITIES_INPUT, - DELETE_IDENTITIES_OUTPUT as _SCHEMA_DELETE_IDENTITIES_OUTPUT, DELETE_IDENTITY_POOL as _SCHEMA_DELETE_IDENTITY_POOL, - DELETE_IDENTITY_POOL_INPUT as _SCHEMA_DELETE_IDENTITY_POOL_INPUT, - DELETE_IDENTITY_POOL_OUTPUT as _SCHEMA_DELETE_IDENTITY_POOL_OUTPUT, DESCRIBE_IDENTITY as _SCHEMA_DESCRIBE_IDENTITY, - DESCRIBE_IDENTITY_INPUT as _SCHEMA_DESCRIBE_IDENTITY_INPUT, - DESCRIBE_IDENTITY_OUTPUT as _SCHEMA_DESCRIBE_IDENTITY_OUTPUT, DESCRIBE_IDENTITY_POOL as _SCHEMA_DESCRIBE_IDENTITY_POOL, - DESCRIBE_IDENTITY_POOL_INPUT as _SCHEMA_DESCRIBE_IDENTITY_POOL_INPUT, - DESCRIBE_IDENTITY_POOL_OUTPUT as _SCHEMA_DESCRIBE_IDENTITY_POOL_OUTPUT, - DEVELOPER_USER_ALREADY_REGISTERED_EXCEPTION as _SCHEMA_DEVELOPER_USER_ALREADY_REGISTERED_EXCEPTION, - EXTERNAL_SERVICE_EXCEPTION as _SCHEMA_EXTERNAL_SERVICE_EXCEPTION, GET_CREDENTIALS_FOR_IDENTITY as _SCHEMA_GET_CREDENTIALS_FOR_IDENTITY, - GET_CREDENTIALS_FOR_IDENTITY_INPUT as _SCHEMA_GET_CREDENTIALS_FOR_IDENTITY_INPUT, - GET_CREDENTIALS_FOR_IDENTITY_OUTPUT as _SCHEMA_GET_CREDENTIALS_FOR_IDENTITY_OUTPUT, GET_ID as _SCHEMA_GET_ID, GET_IDENTITY_POOL_ROLES as _SCHEMA_GET_IDENTITY_POOL_ROLES, - GET_IDENTITY_POOL_ROLES_INPUT as _SCHEMA_GET_IDENTITY_POOL_ROLES_INPUT, - GET_IDENTITY_POOL_ROLES_OUTPUT as _SCHEMA_GET_IDENTITY_POOL_ROLES_OUTPUT, - GET_ID_INPUT as _SCHEMA_GET_ID_INPUT, - GET_ID_OUTPUT as _SCHEMA_GET_ID_OUTPUT, GET_OPEN_ID_TOKEN as _SCHEMA_GET_OPEN_ID_TOKEN, GET_OPEN_ID_TOKEN_FOR_DEVELOPER_IDENTITY as _SCHEMA_GET_OPEN_ID_TOKEN_FOR_DEVELOPER_IDENTITY, - GET_OPEN_ID_TOKEN_FOR_DEVELOPER_IDENTITY_INPUT as _SCHEMA_GET_OPEN_ID_TOKEN_FOR_DEVELOPER_IDENTITY_INPUT, - GET_OPEN_ID_TOKEN_FOR_DEVELOPER_IDENTITY_OUTPUT as _SCHEMA_GET_OPEN_ID_TOKEN_FOR_DEVELOPER_IDENTITY_OUTPUT, - GET_OPEN_ID_TOKEN_INPUT as _SCHEMA_GET_OPEN_ID_TOKEN_INPUT, - GET_OPEN_ID_TOKEN_OUTPUT as _SCHEMA_GET_OPEN_ID_TOKEN_OUTPUT, GET_PRINCIPAL_TAG_ATTRIBUTE_MAP as _SCHEMA_GET_PRINCIPAL_TAG_ATTRIBUTE_MAP, - GET_PRINCIPAL_TAG_ATTRIBUTE_MAP_INPUT as _SCHEMA_GET_PRINCIPAL_TAG_ATTRIBUTE_MAP_INPUT, - GET_PRINCIPAL_TAG_ATTRIBUTE_MAP_OUTPUT as _SCHEMA_GET_PRINCIPAL_TAG_ATTRIBUTE_MAP_OUTPUT, - IDENTITY_DESCRIPTION as _SCHEMA_IDENTITY_DESCRIPTION, - IDENTITY_POOL_SHORT_DESCRIPTION as _SCHEMA_IDENTITY_POOL_SHORT_DESCRIPTION, - INTERNAL_ERROR_EXCEPTION as _SCHEMA_INTERNAL_ERROR_EXCEPTION, - INVALID_IDENTITY_POOL_CONFIGURATION_EXCEPTION as _SCHEMA_INVALID_IDENTITY_POOL_CONFIGURATION_EXCEPTION, - INVALID_PARAMETER_EXCEPTION as _SCHEMA_INVALID_PARAMETER_EXCEPTION, - LIMIT_EXCEEDED_EXCEPTION as _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, LIST_IDENTITIES as _SCHEMA_LIST_IDENTITIES, - LIST_IDENTITIES_INPUT as _SCHEMA_LIST_IDENTITIES_INPUT, - LIST_IDENTITIES_OUTPUT as _SCHEMA_LIST_IDENTITIES_OUTPUT, LIST_IDENTITY_POOLS as _SCHEMA_LIST_IDENTITY_POOLS, - LIST_IDENTITY_POOLS_INPUT as _SCHEMA_LIST_IDENTITY_POOLS_INPUT, - LIST_IDENTITY_POOLS_OUTPUT as _SCHEMA_LIST_IDENTITY_POOLS_OUTPUT, LIST_TAGS_FOR_RESOURCE as _SCHEMA_LIST_TAGS_FOR_RESOURCE, - LIST_TAGS_FOR_RESOURCE_INPUT as _SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT, - LIST_TAGS_FOR_RESOURCE_OUTPUT as _SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT, LOOKUP_DEVELOPER_IDENTITY as _SCHEMA_LOOKUP_DEVELOPER_IDENTITY, - LOOKUP_DEVELOPER_IDENTITY_INPUT as _SCHEMA_LOOKUP_DEVELOPER_IDENTITY_INPUT, - LOOKUP_DEVELOPER_IDENTITY_OUTPUT as _SCHEMA_LOOKUP_DEVELOPER_IDENTITY_OUTPUT, - MAPPING_RULE as _SCHEMA_MAPPING_RULE, MERGE_DEVELOPER_IDENTITIES as _SCHEMA_MERGE_DEVELOPER_IDENTITIES, - MERGE_DEVELOPER_IDENTITIES_INPUT as _SCHEMA_MERGE_DEVELOPER_IDENTITIES_INPUT, - MERGE_DEVELOPER_IDENTITIES_OUTPUT as _SCHEMA_MERGE_DEVELOPER_IDENTITIES_OUTPUT, - NOT_AUTHORIZED_EXCEPTION as _SCHEMA_NOT_AUTHORIZED_EXCEPTION, - RESOURCE_CONFLICT_EXCEPTION as _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - RESOURCE_NOT_FOUND_EXCEPTION as _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - ROLE_MAPPING as _SCHEMA_ROLE_MAPPING, - RULES_CONFIGURATION_TYPE as _SCHEMA_RULES_CONFIGURATION_TYPE, SET_IDENTITY_POOL_ROLES as _SCHEMA_SET_IDENTITY_POOL_ROLES, - SET_IDENTITY_POOL_ROLES_INPUT as _SCHEMA_SET_IDENTITY_POOL_ROLES_INPUT, - SET_IDENTITY_POOL_ROLES_OUTPUT as _SCHEMA_SET_IDENTITY_POOL_ROLES_OUTPUT, SET_PRINCIPAL_TAG_ATTRIBUTE_MAP as _SCHEMA_SET_PRINCIPAL_TAG_ATTRIBUTE_MAP, - SET_PRINCIPAL_TAG_ATTRIBUTE_MAP_INPUT as _SCHEMA_SET_PRINCIPAL_TAG_ATTRIBUTE_MAP_INPUT, - SET_PRINCIPAL_TAG_ATTRIBUTE_MAP_OUTPUT as _SCHEMA_SET_PRINCIPAL_TAG_ATTRIBUTE_MAP_OUTPUT, TAG_RESOURCE as _SCHEMA_TAG_RESOURCE, - TAG_RESOURCE_INPUT as _SCHEMA_TAG_RESOURCE_INPUT, - TAG_RESOURCE_OUTPUT as _SCHEMA_TAG_RESOURCE_OUTPUT, - TOO_MANY_REQUESTS_EXCEPTION as _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, UNLINK_DEVELOPER_IDENTITY as _SCHEMA_UNLINK_DEVELOPER_IDENTITY, - UNLINK_DEVELOPER_IDENTITY_INPUT as _SCHEMA_UNLINK_DEVELOPER_IDENTITY_INPUT, - UNLINK_DEVELOPER_IDENTITY_OUTPUT as _SCHEMA_UNLINK_DEVELOPER_IDENTITY_OUTPUT, UNLINK_IDENTITY as _SCHEMA_UNLINK_IDENTITY, - UNLINK_IDENTITY_INPUT as _SCHEMA_UNLINK_IDENTITY_INPUT, - UNLINK_IDENTITY_OUTPUT as _SCHEMA_UNLINK_IDENTITY_OUTPUT, - UNPROCESSED_IDENTITY_ID as _SCHEMA_UNPROCESSED_IDENTITY_ID, UNTAG_RESOURCE as _SCHEMA_UNTAG_RESOURCE, - UNTAG_RESOURCE_INPUT as _SCHEMA_UNTAG_RESOURCE_INPUT, - UNTAG_RESOURCE_OUTPUT as _SCHEMA_UNTAG_RESOURCE_OUTPUT, UPDATE_IDENTITY_POOL as _SCHEMA_UPDATE_IDENTITY_POOL, - UPDATE_IDENTITY_POOL_INPUT as _SCHEMA_UPDATE_IDENTITY_POOL_INPUT, - UPDATE_IDENTITY_POOL_OUTPUT as _SCHEMA_UPDATE_IDENTITY_POOL_OUTPUT, ) - -logger = logging.getLogger(__name__) - - -class ServiceError(ModeledError): - """ - Base error for all errors in the service. - - Some exceptions do not extend from this class, including - synthetic, implicit, and shared exception types. - """ - - -class AmbiguousRoleResolutionType(UnknownEnumMixin, StrEnum): - AUTHENTICATED_ROLE = "AuthenticatedRole" - DENY = "Deny" - - -@dataclass(kw_only=True) -class CognitoIdentityProvider: - """A provider representing an Amazon Cognito user pool and its client ID.""" - - provider_name: str | None = None - """ - The provider name for an Amazon Cognito user pool. For example, - `cognito-idp.us-east-1.amazonaws.com/us-east-1_123456789`. - """ - - client_id: str | None = None - """The client ID for the Amazon Cognito user pool.""" - - server_side_token_check: bool | None = None - """ - TRUE if server-side token validation is enabled for the identity - provider's token. - - Once you set `ServerSideTokenCheck` to TRUE for an identity pool, that - identity pool will check with the integrated user pools to make sure - that the user has not been globally signed out or deleted before the - identity pool provides an OIDC token or Amazon Web Services credentials - for the user. - - If the user is signed out or deleted, the identity pool will return a - 400 Not Authorized error. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_COGNITO_IDENTITY_PROVIDER, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.provider_name is not None: - serializer.write_string( - _SCHEMA_COGNITO_IDENTITY_PROVIDER.members["ProviderName"], - self.provider_name, - ) - - if self.client_id is not None: - serializer.write_string( - _SCHEMA_COGNITO_IDENTITY_PROVIDER.members["ClientId"], self.client_id - ) - - if self.server_side_token_check is not None: - serializer.write_boolean( - _SCHEMA_COGNITO_IDENTITY_PROVIDER.members["ServerSideTokenCheck"], - self.server_side_token_check, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["provider_name"] = de.read_string( - _SCHEMA_COGNITO_IDENTITY_PROVIDER.members["ProviderName"] - ) - - case 1: - kwargs["client_id"] = de.read_string( - _SCHEMA_COGNITO_IDENTITY_PROVIDER.members["ClientId"] - ) - - case 2: - kwargs["server_side_token_check"] = de.read_boolean( - _SCHEMA_COGNITO_IDENTITY_PROVIDER.members[ - "ServerSideTokenCheck" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_COGNITO_IDENTITY_PROVIDER, consumer=_consumer) - return kwargs - - -def _serialize_cognito_identity_provider_list( - serializer: ShapeSerializer, schema: Schema, value: list[CognitoIdentityProvider] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_cognito_identity_provider_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[CognitoIdentityProvider]: - result: list[CognitoIdentityProvider] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(CognitoIdentityProvider.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_identity_pool_tags_type( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_identity_pool_tags_type( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -def _serialize_oidc_provider_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_oidc_provider_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_saml_provider_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_saml_provider_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_identity_providers( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_identity_providers( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CreateIdentityPoolInput: - """Input to the CreateIdentityPool action.""" - - identity_pool_name: str | None = None - """A string that you provide.""" - - allow_unauthenticated_identities: bool = False - """TRUE if the identity pool supports unauthenticated logins.""" - - allow_classic_flow: bool | None = None - """ - Enables or disables the Basic (Classic) authentication flow. For more - information, see [Identity Pools (Federated Identities) Authentication - Flow](https://docs.aws.amazon.com/cognito/latest/developerguide/authentication-flow.html) - in the *Amazon Cognito Developer Guide*. - """ - - supported_login_providers: dict[str, str] | None = None - """Optional key:value pairs mapping provider names to provider app IDs.""" - - developer_provider_name: str | None = None - """ - The \"domain\" by which Cognito will refer to your users. This name acts - as a placeholder that allows your backend and the Cognito service to - communicate about the developer provider. For the - `DeveloperProviderName`, you can use letters as well as period (`.`), - underscore (`_`), and dash (`-`). - - Once you have set a developer provider name, you cannot change it. - Please take care in setting this parameter. - """ - - open_id_connect_provider_ar_ns: list[str] | None = None - """The Amazon Resource Names (ARN) of the OpenID Connect providers.""" - - cognito_identity_providers: list[CognitoIdentityProvider] | None = None - """An array of Amazon Cognito user pools and their client IDs.""" - - saml_provider_ar_ns: list[str] | None = None - """ - An array of Amazon Resource Names (ARNs) of the SAML provider for your - identity pool. - """ - - identity_pool_tags: dict[str, str] | None = None - """ - Tags to assign to the identity pool. A tag is a label that you can apply - to identity pools to categorize and manage them in different ways, such - as by purpose, owner, environment, or other criteria. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_IDENTITY_POOL_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.identity_pool_name is not None: - serializer.write_string( - _SCHEMA_CREATE_IDENTITY_POOL_INPUT.members["IdentityPoolName"], - self.identity_pool_name, - ) - - if self.allow_unauthenticated_identities is not None: - serializer.write_boolean( - _SCHEMA_CREATE_IDENTITY_POOL_INPUT.members[ - "AllowUnauthenticatedIdentities" - ], - self.allow_unauthenticated_identities, - ) - - if self.allow_classic_flow is not None: - serializer.write_boolean( - _SCHEMA_CREATE_IDENTITY_POOL_INPUT.members["AllowClassicFlow"], - self.allow_classic_flow, - ) - - if self.supported_login_providers is not None: - _serialize_identity_providers( - serializer, - _SCHEMA_CREATE_IDENTITY_POOL_INPUT.members["SupportedLoginProviders"], - self.supported_login_providers, - ) - - if self.developer_provider_name is not None: - serializer.write_string( - _SCHEMA_CREATE_IDENTITY_POOL_INPUT.members["DeveloperProviderName"], - self.developer_provider_name, - ) - - if self.open_id_connect_provider_ar_ns is not None: - _serialize_oidc_provider_list( - serializer, - _SCHEMA_CREATE_IDENTITY_POOL_INPUT.members["OpenIdConnectProviderARNs"], - self.open_id_connect_provider_ar_ns, - ) - - if self.cognito_identity_providers is not None: - _serialize_cognito_identity_provider_list( - serializer, - _SCHEMA_CREATE_IDENTITY_POOL_INPUT.members["CognitoIdentityProviders"], - self.cognito_identity_providers, - ) - - if self.saml_provider_ar_ns is not None: - _serialize_saml_provider_list( - serializer, - _SCHEMA_CREATE_IDENTITY_POOL_INPUT.members["SamlProviderARNs"], - self.saml_provider_ar_ns, - ) - - if self.identity_pool_tags is not None: - _serialize_identity_pool_tags_type( - serializer, - _SCHEMA_CREATE_IDENTITY_POOL_INPUT.members["IdentityPoolTags"], - self.identity_pool_tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["identity_pool_name"] = de.read_string( - _SCHEMA_CREATE_IDENTITY_POOL_INPUT.members["IdentityPoolName"] - ) - - case 1: - kwargs["allow_unauthenticated_identities"] = de.read_boolean( - _SCHEMA_CREATE_IDENTITY_POOL_INPUT.members[ - "AllowUnauthenticatedIdentities" - ] - ) - - case 2: - kwargs["allow_classic_flow"] = de.read_boolean( - _SCHEMA_CREATE_IDENTITY_POOL_INPUT.members["AllowClassicFlow"] - ) - - case 3: - kwargs["supported_login_providers"] = ( - _deserialize_identity_providers( - de, - _SCHEMA_CREATE_IDENTITY_POOL_INPUT.members[ - "SupportedLoginProviders" - ], - ) - ) - - case 4: - kwargs["developer_provider_name"] = de.read_string( - _SCHEMA_CREATE_IDENTITY_POOL_INPUT.members[ - "DeveloperProviderName" - ] - ) - - case 5: - kwargs["open_id_connect_provider_ar_ns"] = ( - _deserialize_oidc_provider_list( - de, - _SCHEMA_CREATE_IDENTITY_POOL_INPUT.members[ - "OpenIdConnectProviderARNs" - ], - ) - ) - - case 6: - kwargs["cognito_identity_providers"] = ( - _deserialize_cognito_identity_provider_list( - de, - _SCHEMA_CREATE_IDENTITY_POOL_INPUT.members[ - "CognitoIdentityProviders" - ], - ) - ) - - case 7: - kwargs["saml_provider_ar_ns"] = _deserialize_saml_provider_list( - de, - _SCHEMA_CREATE_IDENTITY_POOL_INPUT.members["SamlProviderARNs"], - ) - - case 8: - kwargs["identity_pool_tags"] = _deserialize_identity_pool_tags_type( - de, - _SCHEMA_CREATE_IDENTITY_POOL_INPUT.members["IdentityPoolTags"], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_IDENTITY_POOL_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CreateIdentityPoolOutput: - """An object representing an Amazon Cognito identity pool.""" - - identity_pool_id: str - """An identity pool ID in the format REGION:GUID.""" - - identity_pool_name: str - """A string that you provide.""" - - allow_unauthenticated_identities: bool = False - """TRUE if the identity pool supports unauthenticated logins.""" - - allow_classic_flow: bool | None = None - """ - Enables or disables the Basic (Classic) authentication flow. For more - information, see [Identity Pools (Federated Identities) Authentication - Flow](https://docs.aws.amazon.com/cognito/latest/developerguide/authentication-flow.html) - in the *Amazon Cognito Developer Guide*. - """ - - supported_login_providers: dict[str, str] | None = None - """Optional key:value pairs mapping provider names to provider app IDs.""" - - developer_provider_name: str | None = None - """The \"domain\" by which Cognito will refer to your users.""" - - open_id_connect_provider_ar_ns: list[str] | None = None - """The ARNs of the OpenID Connect providers.""" - - cognito_identity_providers: list[CognitoIdentityProvider] | None = None - """A list representing an Amazon Cognito user pool and its client ID.""" - - saml_provider_ar_ns: list[str] | None = None - """ - An array of Amazon Resource Names (ARNs) of the SAML provider for your - identity pool. - """ - - identity_pool_tags: dict[str, str] | None = None - """ - The tags that are assigned to the identity pool. A tag is a label that - you can apply to identity pools to categorize and manage them in - different ways, such as by purpose, owner, environment, or other - criteria. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_IDENTITY_POOL_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_IDENTITY_POOL_OUTPUT.members["IdentityPoolId"], - self.identity_pool_id, - ) - serializer.write_string( - _SCHEMA_CREATE_IDENTITY_POOL_OUTPUT.members["IdentityPoolName"], - self.identity_pool_name, - ) - serializer.write_boolean( - _SCHEMA_CREATE_IDENTITY_POOL_OUTPUT.members[ - "AllowUnauthenticatedIdentities" - ], - self.allow_unauthenticated_identities, - ) - if self.allow_classic_flow is not None: - serializer.write_boolean( - _SCHEMA_CREATE_IDENTITY_POOL_OUTPUT.members["AllowClassicFlow"], - self.allow_classic_flow, - ) - - if self.supported_login_providers is not None: - _serialize_identity_providers( - serializer, - _SCHEMA_CREATE_IDENTITY_POOL_OUTPUT.members["SupportedLoginProviders"], - self.supported_login_providers, - ) - - if self.developer_provider_name is not None: - serializer.write_string( - _SCHEMA_CREATE_IDENTITY_POOL_OUTPUT.members["DeveloperProviderName"], - self.developer_provider_name, - ) - - if self.open_id_connect_provider_ar_ns is not None: - _serialize_oidc_provider_list( - serializer, - _SCHEMA_CREATE_IDENTITY_POOL_OUTPUT.members[ - "OpenIdConnectProviderARNs" - ], - self.open_id_connect_provider_ar_ns, - ) - - if self.cognito_identity_providers is not None: - _serialize_cognito_identity_provider_list( - serializer, - _SCHEMA_CREATE_IDENTITY_POOL_OUTPUT.members["CognitoIdentityProviders"], - self.cognito_identity_providers, - ) - - if self.saml_provider_ar_ns is not None: - _serialize_saml_provider_list( - serializer, - _SCHEMA_CREATE_IDENTITY_POOL_OUTPUT.members["SamlProviderARNs"], - self.saml_provider_ar_ns, - ) - - if self.identity_pool_tags is not None: - _serialize_identity_pool_tags_type( - serializer, - _SCHEMA_CREATE_IDENTITY_POOL_OUTPUT.members["IdentityPoolTags"], - self.identity_pool_tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["identity_pool_id"] = de.read_string( - _SCHEMA_CREATE_IDENTITY_POOL_OUTPUT.members["IdentityPoolId"] - ) - - case 1: - kwargs["identity_pool_name"] = de.read_string( - _SCHEMA_CREATE_IDENTITY_POOL_OUTPUT.members["IdentityPoolName"] - ) - - case 2: - kwargs["allow_unauthenticated_identities"] = de.read_boolean( - _SCHEMA_CREATE_IDENTITY_POOL_OUTPUT.members[ - "AllowUnauthenticatedIdentities" - ] - ) - - case 3: - kwargs["allow_classic_flow"] = de.read_boolean( - _SCHEMA_CREATE_IDENTITY_POOL_OUTPUT.members["AllowClassicFlow"] - ) - - case 4: - kwargs["supported_login_providers"] = ( - _deserialize_identity_providers( - de, - _SCHEMA_CREATE_IDENTITY_POOL_OUTPUT.members[ - "SupportedLoginProviders" - ], - ) - ) - - case 5: - kwargs["developer_provider_name"] = de.read_string( - _SCHEMA_CREATE_IDENTITY_POOL_OUTPUT.members[ - "DeveloperProviderName" - ] - ) - - case 6: - kwargs["open_id_connect_provider_ar_ns"] = ( - _deserialize_oidc_provider_list( - de, - _SCHEMA_CREATE_IDENTITY_POOL_OUTPUT.members[ - "OpenIdConnectProviderARNs" - ], - ) - ) - - case 7: - kwargs["cognito_identity_providers"] = ( - _deserialize_cognito_identity_provider_list( - de, - _SCHEMA_CREATE_IDENTITY_POOL_OUTPUT.members[ - "CognitoIdentityProviders" - ], - ) - ) - - case 8: - kwargs["saml_provider_ar_ns"] = _deserialize_saml_provider_list( - de, - _SCHEMA_CREATE_IDENTITY_POOL_OUTPUT.members["SamlProviderARNs"], - ) - - case 9: - kwargs["identity_pool_tags"] = _deserialize_identity_pool_tags_type( - de, - _SCHEMA_CREATE_IDENTITY_POOL_OUTPUT.members["IdentityPoolTags"], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_IDENTITY_POOL_OUTPUT, consumer=_consumer - ) - if "identity_pool_id" not in kwargs: - kwargs["identity_pool_id"] = "" - if "identity_pool_name" not in kwargs: - kwargs["identity_pool_name"] = "" - return kwargs - - -@dataclass(kw_only=True) -class InternalErrorException(ServiceError): - """ - Thrown when the service encounters an error during processing the - request. - """ - - fault: Literal["client", "server"] | None = "server" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INTERNAL_ERROR_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INTERNAL_ERROR_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INTERNAL_ERROR_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INTERNAL_ERROR_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class InvalidParameterException(ServiceError): - """Thrown for missing or bad input parameter(s).""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_PARAMETER_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_PARAMETER_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_PARAMETER_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVALID_PARAMETER_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class LimitExceededException(ServiceError): - """Thrown when the total number of user pools has exceeded a preset limit.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIMIT_EXCEEDED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIMIT_EXCEEDED_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class NotAuthorizedException(ServiceError): - """Thrown when a user is not authorized to access the requested resource.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_NOT_AUTHORIZED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_NOT_AUTHORIZED_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_NOT_AUTHORIZED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_NOT_AUTHORIZED_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ResourceConflictException(ServiceError): - """ - Thrown when a user tries to use a login which is already linked to - another account. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESOURCE_CONFLICT_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class TooManyRequestsException(ServiceError): - """Thrown when a request is throttled.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, consumer=_consumer - ) - return kwargs - - -CREATE_IDENTITY_POOL = APIOperation( - input=CreateIdentityPoolInput, - output=CreateIdentityPoolOutput, - schema=_SCHEMA_CREATE_IDENTITY_POOL, - input_schema=_SCHEMA_CREATE_IDENTITY_POOL_INPUT, - output_schema=_SCHEMA_CREATE_IDENTITY_POOL_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cognitoidentity#InternalErrorException" - ): InternalErrorException, - ShapeID( - "com.amazonaws.cognitoidentity#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cognitoidentity#LimitExceededException" - ): LimitExceededException, - ShapeID( - "com.amazonaws.cognitoidentity#NotAuthorizedException" - ): NotAuthorizedException, - ShapeID( - "com.amazonaws.cognitoidentity#ResourceConflictException" - ): ResourceConflictException, - ShapeID( - "com.amazonaws.cognitoidentity#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_AUTHORIZED_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -def _serialize_identity_id_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_identity_id_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class DeleteIdentitiesInput: - """Input to the `DeleteIdentities` action.""" - - identity_ids_to_delete: list[str] | None = None - """A list of 1-60 identities that you want to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_IDENTITIES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.identity_ids_to_delete is not None: - _serialize_identity_id_list( - serializer, - _SCHEMA_DELETE_IDENTITIES_INPUT.members["IdentityIdsToDelete"], - self.identity_ids_to_delete, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["identity_ids_to_delete"] = _deserialize_identity_id_list( - de, - _SCHEMA_DELETE_IDENTITIES_INPUT.members["IdentityIdsToDelete"], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_IDENTITIES_INPUT, consumer=_consumer) - return kwargs - - -class ErrorCode(UnknownEnumMixin, StrEnum): - ACCESS_DENIED = "AccessDenied" - INTERNAL_SERVER_ERROR = "InternalServerError" - - -@dataclass(kw_only=True) -class UnprocessedIdentityId: - """ - An array of UnprocessedIdentityId objects, each of which contains an - ErrorCode and IdentityId. - """ - - identity_id: str | None = None - """A unique identifier in the format REGION:GUID.""" - - error_code: str | None = None - """The error code indicating the type of error that occurred.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNPROCESSED_IDENTITY_ID, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.identity_id is not None: - serializer.write_string( - _SCHEMA_UNPROCESSED_IDENTITY_ID.members["IdentityId"], self.identity_id - ) - - if self.error_code is not None: - serializer.write_string( - _SCHEMA_UNPROCESSED_IDENTITY_ID.members["ErrorCode"], self.error_code - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["identity_id"] = de.read_string( - _SCHEMA_UNPROCESSED_IDENTITY_ID.members["IdentityId"] - ) - - case 1: - kwargs["error_code"] = ErrorCode( - de.read_string( - _SCHEMA_UNPROCESSED_IDENTITY_ID.members["ErrorCode"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UNPROCESSED_IDENTITY_ID, consumer=_consumer) - return kwargs - - -def _serialize_unprocessed_identity_id_list( - serializer: ShapeSerializer, schema: Schema, value: list[UnprocessedIdentityId] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_unprocessed_identity_id_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[UnprocessedIdentityId]: - result: list[UnprocessedIdentityId] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(UnprocessedIdentityId.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class DeleteIdentitiesOutput: - """Returned in response to a successful `DeleteIdentities` operation.""" - - unprocessed_identity_ids: list[UnprocessedIdentityId] | None = None - """ - An array of UnprocessedIdentityId objects, each of which contains an - ErrorCode and IdentityId. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_IDENTITIES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.unprocessed_identity_ids is not None: - _serialize_unprocessed_identity_id_list( - serializer, - _SCHEMA_DELETE_IDENTITIES_OUTPUT.members["UnprocessedIdentityIds"], - self.unprocessed_identity_ids, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["unprocessed_identity_ids"] = ( - _deserialize_unprocessed_identity_id_list( - de, - _SCHEMA_DELETE_IDENTITIES_OUTPUT.members[ - "UnprocessedIdentityIds" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_IDENTITIES_OUTPUT, consumer=_consumer) - return kwargs - - -DELETE_IDENTITIES = APIOperation( - input=DeleteIdentitiesInput, - output=DeleteIdentitiesOutput, - schema=_SCHEMA_DELETE_IDENTITIES, - input_schema=_SCHEMA_DELETE_IDENTITIES_INPUT, - output_schema=_SCHEMA_DELETE_IDENTITIES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cognitoidentity#InternalErrorException" - ): InternalErrorException, - ShapeID( - "com.amazonaws.cognitoidentity#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cognitoidentity#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteIdentityPoolInput: - """Input to the DeleteIdentityPool action.""" - - identity_pool_id: str | None = None - """An identity pool ID in the format REGION:GUID.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_IDENTITY_POOL_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.identity_pool_id is not None: - serializer.write_string( - _SCHEMA_DELETE_IDENTITY_POOL_INPUT.members["IdentityPoolId"], - self.identity_pool_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["identity_pool_id"] = de.read_string( - _SCHEMA_DELETE_IDENTITY_POOL_INPUT.members["IdentityPoolId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_IDENTITY_POOL_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteIdentityPoolOutput: - """Dataclass for DeleteIdentityPoolOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_IDENTITY_POOL_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_IDENTITY_POOL_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ResourceNotFoundException(ServiceError): - """ - Thrown when the requested resource (for example, a dataset or record) - does not exist. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, consumer=_consumer - ) - return kwargs - - -DELETE_IDENTITY_POOL = APIOperation( - input=DeleteIdentityPoolInput, - output=DeleteIdentityPoolOutput, - schema=_SCHEMA_DELETE_IDENTITY_POOL, - input_schema=_SCHEMA_DELETE_IDENTITY_POOL_INPUT, - output_schema=_SCHEMA_DELETE_IDENTITY_POOL_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cognitoidentity#InternalErrorException" - ): InternalErrorException, - ShapeID( - "com.amazonaws.cognitoidentity#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cognitoidentity#NotAuthorizedException" - ): NotAuthorizedException, - ShapeID( - "com.amazonaws.cognitoidentity#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.cognitoidentity#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_NOT_AUTHORIZED_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DescribeIdentityInput: - """Input to the `DescribeIdentity` action.""" - - identity_id: str | None = None - """A unique identifier in the format REGION:GUID.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DESCRIBE_IDENTITY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.identity_id is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_IDENTITY_INPUT.members["IdentityId"], self.identity_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["identity_id"] = de.read_string( - _SCHEMA_DESCRIBE_IDENTITY_INPUT.members["IdentityId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DESCRIBE_IDENTITY_INPUT, consumer=_consumer) - return kwargs - - -def _serialize_logins_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_logins_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class DescribeIdentityOutput: - """A description of the identity.""" - - identity_id: str | None = None - """A unique identifier in the format REGION:GUID.""" - - logins: list[str] | None = None - """The provider names.""" - - creation_date: datetime | None = None - """Date on which the identity was created.""" - - last_modified_date: datetime | None = None - """Date on which the identity was last modified.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DESCRIBE_IDENTITY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.identity_id is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_IDENTITY_OUTPUT.members["IdentityId"], self.identity_id - ) - - if self.logins is not None: - _serialize_logins_list( - serializer, - _SCHEMA_DESCRIBE_IDENTITY_OUTPUT.members["Logins"], - self.logins, - ) - - if self.creation_date is not None: - serializer.write_timestamp( - _SCHEMA_DESCRIBE_IDENTITY_OUTPUT.members["CreationDate"], - self.creation_date, - ) - - if self.last_modified_date is not None: - serializer.write_timestamp( - _SCHEMA_DESCRIBE_IDENTITY_OUTPUT.members["LastModifiedDate"], - self.last_modified_date, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["identity_id"] = de.read_string( - _SCHEMA_DESCRIBE_IDENTITY_OUTPUT.members["IdentityId"] - ) - - case 1: - kwargs["logins"] = _deserialize_logins_list( - de, _SCHEMA_DESCRIBE_IDENTITY_OUTPUT.members["Logins"] - ) - - case 2: - kwargs["creation_date"] = de.read_timestamp( - _SCHEMA_DESCRIBE_IDENTITY_OUTPUT.members["CreationDate"] - ) - - case 3: - kwargs["last_modified_date"] = de.read_timestamp( - _SCHEMA_DESCRIBE_IDENTITY_OUTPUT.members["LastModifiedDate"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DESCRIBE_IDENTITY_OUTPUT, consumer=_consumer) - return kwargs - - -DESCRIBE_IDENTITY = APIOperation( - input=DescribeIdentityInput, - output=DescribeIdentityOutput, - schema=_SCHEMA_DESCRIBE_IDENTITY, - input_schema=_SCHEMA_DESCRIBE_IDENTITY_INPUT, - output_schema=_SCHEMA_DESCRIBE_IDENTITY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cognitoidentity#InternalErrorException" - ): InternalErrorException, - ShapeID( - "com.amazonaws.cognitoidentity#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cognitoidentity#NotAuthorizedException" - ): NotAuthorizedException, - ShapeID( - "com.amazonaws.cognitoidentity#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.cognitoidentity#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_NOT_AUTHORIZED_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DescribeIdentityPoolInput: - """Input to the DescribeIdentityPool action.""" - - identity_pool_id: str | None = None - """An identity pool ID in the format REGION:GUID.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DESCRIBE_IDENTITY_POOL_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.identity_pool_id is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_IDENTITY_POOL_INPUT.members["IdentityPoolId"], - self.identity_pool_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["identity_pool_id"] = de.read_string( - _SCHEMA_DESCRIBE_IDENTITY_POOL_INPUT.members["IdentityPoolId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DESCRIBE_IDENTITY_POOL_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DescribeIdentityPoolOutput: - """An object representing an Amazon Cognito identity pool.""" - - identity_pool_id: str - """An identity pool ID in the format REGION:GUID.""" - - identity_pool_name: str - """A string that you provide.""" - - allow_unauthenticated_identities: bool = False - """TRUE if the identity pool supports unauthenticated logins.""" - - allow_classic_flow: bool | None = None - """ - Enables or disables the Basic (Classic) authentication flow. For more - information, see [Identity Pools (Federated Identities) Authentication - Flow](https://docs.aws.amazon.com/cognito/latest/developerguide/authentication-flow.html) - in the *Amazon Cognito Developer Guide*. - """ - - supported_login_providers: dict[str, str] | None = None - """Optional key:value pairs mapping provider names to provider app IDs.""" - - developer_provider_name: str | None = None - """The \"domain\" by which Cognito will refer to your users.""" - - open_id_connect_provider_ar_ns: list[str] | None = None - """The ARNs of the OpenID Connect providers.""" - - cognito_identity_providers: list[CognitoIdentityProvider] | None = None - """A list representing an Amazon Cognito user pool and its client ID.""" - - saml_provider_ar_ns: list[str] | None = None - """ - An array of Amazon Resource Names (ARNs) of the SAML provider for your - identity pool. - """ - - identity_pool_tags: dict[str, str] | None = None - """ - The tags that are assigned to the identity pool. A tag is a label that - you can apply to identity pools to categorize and manage them in - different ways, such as by purpose, owner, environment, or other - criteria. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DESCRIBE_IDENTITY_POOL_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DESCRIBE_IDENTITY_POOL_OUTPUT.members["IdentityPoolId"], - self.identity_pool_id, - ) - serializer.write_string( - _SCHEMA_DESCRIBE_IDENTITY_POOL_OUTPUT.members["IdentityPoolName"], - self.identity_pool_name, - ) - serializer.write_boolean( - _SCHEMA_DESCRIBE_IDENTITY_POOL_OUTPUT.members[ - "AllowUnauthenticatedIdentities" - ], - self.allow_unauthenticated_identities, - ) - if self.allow_classic_flow is not None: - serializer.write_boolean( - _SCHEMA_DESCRIBE_IDENTITY_POOL_OUTPUT.members["AllowClassicFlow"], - self.allow_classic_flow, - ) - - if self.supported_login_providers is not None: - _serialize_identity_providers( - serializer, - _SCHEMA_DESCRIBE_IDENTITY_POOL_OUTPUT.members[ - "SupportedLoginProviders" - ], - self.supported_login_providers, - ) - - if self.developer_provider_name is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_IDENTITY_POOL_OUTPUT.members["DeveloperProviderName"], - self.developer_provider_name, - ) - - if self.open_id_connect_provider_ar_ns is not None: - _serialize_oidc_provider_list( - serializer, - _SCHEMA_DESCRIBE_IDENTITY_POOL_OUTPUT.members[ - "OpenIdConnectProviderARNs" - ], - self.open_id_connect_provider_ar_ns, - ) - - if self.cognito_identity_providers is not None: - _serialize_cognito_identity_provider_list( - serializer, - _SCHEMA_DESCRIBE_IDENTITY_POOL_OUTPUT.members[ - "CognitoIdentityProviders" - ], - self.cognito_identity_providers, - ) - - if self.saml_provider_ar_ns is not None: - _serialize_saml_provider_list( - serializer, - _SCHEMA_DESCRIBE_IDENTITY_POOL_OUTPUT.members["SamlProviderARNs"], - self.saml_provider_ar_ns, - ) - - if self.identity_pool_tags is not None: - _serialize_identity_pool_tags_type( - serializer, - _SCHEMA_DESCRIBE_IDENTITY_POOL_OUTPUT.members["IdentityPoolTags"], - self.identity_pool_tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["identity_pool_id"] = de.read_string( - _SCHEMA_DESCRIBE_IDENTITY_POOL_OUTPUT.members["IdentityPoolId"] - ) - - case 1: - kwargs["identity_pool_name"] = de.read_string( - _SCHEMA_DESCRIBE_IDENTITY_POOL_OUTPUT.members[ - "IdentityPoolName" - ] - ) - - case 2: - kwargs["allow_unauthenticated_identities"] = de.read_boolean( - _SCHEMA_DESCRIBE_IDENTITY_POOL_OUTPUT.members[ - "AllowUnauthenticatedIdentities" - ] - ) - - case 3: - kwargs["allow_classic_flow"] = de.read_boolean( - _SCHEMA_DESCRIBE_IDENTITY_POOL_OUTPUT.members[ - "AllowClassicFlow" - ] - ) - - case 4: - kwargs["supported_login_providers"] = ( - _deserialize_identity_providers( - de, - _SCHEMA_DESCRIBE_IDENTITY_POOL_OUTPUT.members[ - "SupportedLoginProviders" - ], - ) - ) - - case 5: - kwargs["developer_provider_name"] = de.read_string( - _SCHEMA_DESCRIBE_IDENTITY_POOL_OUTPUT.members[ - "DeveloperProviderName" - ] - ) - - case 6: - kwargs["open_id_connect_provider_ar_ns"] = ( - _deserialize_oidc_provider_list( - de, - _SCHEMA_DESCRIBE_IDENTITY_POOL_OUTPUT.members[ - "OpenIdConnectProviderARNs" - ], - ) - ) - - case 7: - kwargs["cognito_identity_providers"] = ( - _deserialize_cognito_identity_provider_list( - de, - _SCHEMA_DESCRIBE_IDENTITY_POOL_OUTPUT.members[ - "CognitoIdentityProviders" - ], - ) - ) - - case 8: - kwargs["saml_provider_ar_ns"] = _deserialize_saml_provider_list( - de, - _SCHEMA_DESCRIBE_IDENTITY_POOL_OUTPUT.members[ - "SamlProviderARNs" - ], - ) - - case 9: - kwargs["identity_pool_tags"] = _deserialize_identity_pool_tags_type( - de, - _SCHEMA_DESCRIBE_IDENTITY_POOL_OUTPUT.members[ - "IdentityPoolTags" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DESCRIBE_IDENTITY_POOL_OUTPUT, consumer=_consumer - ) - if "identity_pool_id" not in kwargs: - kwargs["identity_pool_id"] = "" - if "identity_pool_name" not in kwargs: - kwargs["identity_pool_name"] = "" - return kwargs - - -DESCRIBE_IDENTITY_POOL = APIOperation( - input=DescribeIdentityPoolInput, - output=DescribeIdentityPoolOutput, - schema=_SCHEMA_DESCRIBE_IDENTITY_POOL, - input_schema=_SCHEMA_DESCRIBE_IDENTITY_POOL_INPUT, - output_schema=_SCHEMA_DESCRIBE_IDENTITY_POOL_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cognitoidentity#InternalErrorException" - ): InternalErrorException, - ShapeID( - "com.amazonaws.cognitoidentity#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cognitoidentity#NotAuthorizedException" - ): NotAuthorizedException, - ShapeID( - "com.amazonaws.cognitoidentity#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.cognitoidentity#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_NOT_AUTHORIZED_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ExternalServiceException(ServiceError): - """ - An exception thrown when a dependent service such as Facebook or Twitter - is not responding - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EXTERNAL_SERVICE_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_EXTERNAL_SERVICE_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_EXTERNAL_SERVICE_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EXTERNAL_SERVICE_EXCEPTION, consumer=_consumer) - return kwargs - - -def _serialize_logins_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_logins_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GetCredentialsForIdentityInput: - """Input to the `GetCredentialsForIdentity` action.""" - - identity_id: str | None = None - """A unique identifier in the format REGION:GUID.""" - - logins: dict[str, str] | None = None - """ - A set of optional name-value pairs that map provider names to provider - tokens. The name-value pair will follow the syntax \"provider_name\": - \"provider_user_identifier\". - - Logins should not be specified when trying to get credentials for an - unauthenticated identity. - - The Logins parameter is required when using identities associated with - external identity providers such as Facebook. For examples of `Logins` - maps, see the code examples in the [External Identity - Providers](https://docs.aws.amazon.com/cognito/latest/developerguide/external-identity-providers.html) - section of the Amazon Cognito Developer Guide. - """ - - custom_role_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the role to be assumed when multiple - roles were received in the token from the identity provider. For - example, a SAML-based identity provider. This parameter is optional for - identity providers that do not support role customization. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_CREDENTIALS_FOR_IDENTITY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.identity_id is not None: - serializer.write_string( - _SCHEMA_GET_CREDENTIALS_FOR_IDENTITY_INPUT.members["IdentityId"], - self.identity_id, - ) - - if self.logins is not None: - _serialize_logins_map( - serializer, - _SCHEMA_GET_CREDENTIALS_FOR_IDENTITY_INPUT.members["Logins"], - self.logins, - ) - - if self.custom_role_arn is not None: - serializer.write_string( - _SCHEMA_GET_CREDENTIALS_FOR_IDENTITY_INPUT.members["CustomRoleArn"], - self.custom_role_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["identity_id"] = de.read_string( - _SCHEMA_GET_CREDENTIALS_FOR_IDENTITY_INPUT.members["IdentityId"] - ) - - case 1: - kwargs["logins"] = _deserialize_logins_map( - de, _SCHEMA_GET_CREDENTIALS_FOR_IDENTITY_INPUT.members["Logins"] - ) - - case 2: - kwargs["custom_role_arn"] = de.read_string( - _SCHEMA_GET_CREDENTIALS_FOR_IDENTITY_INPUT.members[ - "CustomRoleArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_CREDENTIALS_FOR_IDENTITY_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class Credentials: - """Credentials for the provided identity ID.""" - - access_key_id: str | None = None - """The Access Key portion of the credentials.""" - - secret_key: str | None = field(repr=False, default=None) - """The Secret Access Key portion of the credentials""" - - session_token: str | None = None - """The Session Token portion of the credentials""" - - expiration: datetime | None = None - """The date at which these credentials will expire.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREDENTIALS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.access_key_id is not None: - serializer.write_string( - _SCHEMA_CREDENTIALS.members["AccessKeyId"], self.access_key_id - ) - - if self.secret_key is not None: - serializer.write_string( - _SCHEMA_CREDENTIALS.members["SecretKey"], self.secret_key - ) - - if self.session_token is not None: - serializer.write_string( - _SCHEMA_CREDENTIALS.members["SessionToken"], self.session_token - ) - - if self.expiration is not None: - serializer.write_timestamp( - _SCHEMA_CREDENTIALS.members["Expiration"], self.expiration - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["access_key_id"] = de.read_string( - _SCHEMA_CREDENTIALS.members["AccessKeyId"] - ) - - case 1: - kwargs["secret_key"] = de.read_string( - _SCHEMA_CREDENTIALS.members["SecretKey"] - ) - - case 2: - kwargs["session_token"] = de.read_string( - _SCHEMA_CREDENTIALS.members["SessionToken"] - ) - - case 3: - kwargs["expiration"] = de.read_timestamp( - _SCHEMA_CREDENTIALS.members["Expiration"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREDENTIALS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetCredentialsForIdentityOutput: - """ - Returned in response to a successful `GetCredentialsForIdentity` - operation. - """ - - identity_id: str | None = None - """A unique identifier in the format REGION:GUID.""" - - credentials: Credentials | None = None - """Credentials for the provided identity ID.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_CREDENTIALS_FOR_IDENTITY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.identity_id is not None: - serializer.write_string( - _SCHEMA_GET_CREDENTIALS_FOR_IDENTITY_OUTPUT.members["IdentityId"], - self.identity_id, - ) - - if self.credentials is not None: - serializer.write_struct( - _SCHEMA_GET_CREDENTIALS_FOR_IDENTITY_OUTPUT.members["Credentials"], - self.credentials, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["identity_id"] = de.read_string( - _SCHEMA_GET_CREDENTIALS_FOR_IDENTITY_OUTPUT.members[ - "IdentityId" - ] - ) - - case 1: - kwargs["credentials"] = Credentials.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_CREDENTIALS_FOR_IDENTITY_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InvalidIdentityPoolConfigurationException(ServiceError): - """ - If you provided authentication information in the request, the identity - pool has no authenticated role configured, or STS returned an error - response to the request to assume the authenticated role from the - identity pool. If you provided no authentication information in the - request, the identity pool has no unauthenticated role configured, or - STS returned an error response to the request to assume the - unauthenticated role from the identity pool. - - Your role trust policy must grant `AssumeRoleWithWebIdentity` - permissions to `cognito-identity.amazonaws.com`. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVALID_IDENTITY_POOL_CONFIGURATION_EXCEPTION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_IDENTITY_POOL_CONFIGURATION_EXCEPTION.members[ - "message" - ], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_IDENTITY_POOL_CONFIGURATION_EXCEPTION.members[ - "message" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVALID_IDENTITY_POOL_CONFIGURATION_EXCEPTION, consumer=_consumer - ) - return kwargs - - -GET_CREDENTIALS_FOR_IDENTITY = APIOperation( - input=GetCredentialsForIdentityInput, - output=GetCredentialsForIdentityOutput, - schema=_SCHEMA_GET_CREDENTIALS_FOR_IDENTITY, - input_schema=_SCHEMA_GET_CREDENTIALS_FOR_IDENTITY_INPUT, - output_schema=_SCHEMA_GET_CREDENTIALS_FOR_IDENTITY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cognitoidentity#ExternalServiceException" - ): ExternalServiceException, - ShapeID( - "com.amazonaws.cognitoidentity#InternalErrorException" - ): InternalErrorException, - ShapeID( - "com.amazonaws.cognitoidentity#InvalidIdentityPoolConfigurationException" - ): InvalidIdentityPoolConfigurationException, - ShapeID( - "com.amazonaws.cognitoidentity#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cognitoidentity#NotAuthorizedException" - ): NotAuthorizedException, - ShapeID( - "com.amazonaws.cognitoidentity#ResourceConflictException" - ): ResourceConflictException, - ShapeID( - "com.amazonaws.cognitoidentity#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.cognitoidentity#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("smithy.api#noAuth")], - error_schemas=[ - _SCHEMA_EXTERNAL_SERVICE_EXCEPTION, - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_IDENTITY_POOL_CONFIGURATION_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_NOT_AUTHORIZED_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetIdInput: - """Input to the GetId action.""" - - account_id: str | None = None - """A standard Amazon Web Services account ID (9+ digits).""" - - identity_pool_id: str | None = None - """An identity pool ID in the format REGION:GUID.""" - - logins: dict[str, str] | None = None - """ - A set of optional name-value pairs that map provider names to provider - tokens. The available provider names for `Logins` are as follows: - - - Facebook: `graph.facebook.com` - - - Amazon Cognito user pool: - `cognito-idp.```{=html}`.amazonaws.com/```{=html}, - for example, - `cognito-idp.us-east-1.amazonaws.com/us-east-1_123456789`. - - - Google: `accounts.google.com` - - - Amazon: `www.amazon.com` - - - Twitter: `api.twitter.com` - - - Digits: `www.digits.com` - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_ID_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.account_id is not None: - serializer.write_string( - _SCHEMA_GET_ID_INPUT.members["AccountId"], self.account_id - ) - - if self.identity_pool_id is not None: - serializer.write_string( - _SCHEMA_GET_ID_INPUT.members["IdentityPoolId"], self.identity_pool_id - ) - - if self.logins is not None: - _serialize_logins_map( - serializer, _SCHEMA_GET_ID_INPUT.members["Logins"], self.logins - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["account_id"] = de.read_string( - _SCHEMA_GET_ID_INPUT.members["AccountId"] - ) - - case 1: - kwargs["identity_pool_id"] = de.read_string( - _SCHEMA_GET_ID_INPUT.members["IdentityPoolId"] - ) - - case 2: - kwargs["logins"] = _deserialize_logins_map( - de, _SCHEMA_GET_ID_INPUT.members["Logins"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_ID_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetIdOutput: - """Returned in response to a GetId request.""" - - identity_id: str | None = None - """A unique identifier in the format REGION:GUID.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_ID_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.identity_id is not None: - serializer.write_string( - _SCHEMA_GET_ID_OUTPUT.members["IdentityId"], self.identity_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["identity_id"] = de.read_string( - _SCHEMA_GET_ID_OUTPUT.members["IdentityId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_ID_OUTPUT, consumer=_consumer) - return kwargs - - -GET_ID = APIOperation( - input=GetIdInput, - output=GetIdOutput, - schema=_SCHEMA_GET_ID, - input_schema=_SCHEMA_GET_ID_INPUT, - output_schema=_SCHEMA_GET_ID_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cognitoidentity#ExternalServiceException" - ): ExternalServiceException, - ShapeID( - "com.amazonaws.cognitoidentity#InternalErrorException" - ): InternalErrorException, - ShapeID( - "com.amazonaws.cognitoidentity#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cognitoidentity#LimitExceededException" - ): LimitExceededException, - ShapeID( - "com.amazonaws.cognitoidentity#NotAuthorizedException" - ): NotAuthorizedException, - ShapeID( - "com.amazonaws.cognitoidentity#ResourceConflictException" - ): ResourceConflictException, - ShapeID( - "com.amazonaws.cognitoidentity#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.cognitoidentity#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("smithy.api#noAuth")], - error_schemas=[ - _SCHEMA_EXTERNAL_SERVICE_EXCEPTION, - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_AUTHORIZED_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetIdentityPoolRolesInput: - """Input to the `GetIdentityPoolRoles` action.""" - - identity_pool_id: str | None = None - """An identity pool ID in the format REGION:GUID.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_IDENTITY_POOL_ROLES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.identity_pool_id is not None: - serializer.write_string( - _SCHEMA_GET_IDENTITY_POOL_ROLES_INPUT.members["IdentityPoolId"], - self.identity_pool_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["identity_pool_id"] = de.read_string( - _SCHEMA_GET_IDENTITY_POOL_ROLES_INPUT.members["IdentityPoolId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_IDENTITY_POOL_ROLES_INPUT, consumer=_consumer - ) - return kwargs - - -class MappingRuleMatchType(UnknownEnumMixin, StrEnum): - EQUALS = "Equals" - CONTAINS = "Contains" - STARTS_WITH = "StartsWith" - NOT_EQUAL = "NotEqual" - - -@dataclass(kw_only=True) -class MappingRule: - """ - A rule that maps a claim name, a claim value, and a match type to a role - ARN. - """ - - claim: str - """ - The claim name that must be present in the token, for example, - \"isAdmin\" or \"paid\". - """ - - match_type: str - """ - The match condition that specifies how closely the claim value in the - IdP token must match `Value`. - """ - - value: str - """ - A brief string that the claim must match, for example, \"paid\" or - \"yes\". - """ - - role_arn: str - """The role ARN.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MAPPING_RULE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_MAPPING_RULE.members["Claim"], self.claim) - serializer.write_string( - _SCHEMA_MAPPING_RULE.members["MatchType"], self.match_type - ) - serializer.write_string(_SCHEMA_MAPPING_RULE.members["Value"], self.value) - serializer.write_string(_SCHEMA_MAPPING_RULE.members["RoleARN"], self.role_arn) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["claim"] = de.read_string( - _SCHEMA_MAPPING_RULE.members["Claim"] - ) - - case 1: - kwargs["match_type"] = MappingRuleMatchType( - de.read_string(_SCHEMA_MAPPING_RULE.members["MatchType"]) - ) - - case 2: - kwargs["value"] = de.read_string( - _SCHEMA_MAPPING_RULE.members["Value"] - ) - - case 3: - kwargs["role_arn"] = de.read_string( - _SCHEMA_MAPPING_RULE.members["RoleARN"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MAPPING_RULE, consumer=_consumer) - if "claim" not in kwargs: - kwargs["claim"] = "" - if "match_type" not in kwargs: - kwargs["match_type"] = MappingRuleMatchType._corrected("") - if "value" not in kwargs: - kwargs["value"] = "" - if "role_arn" not in kwargs: - kwargs["role_arn"] = "" - return kwargs - - -def _serialize_mapping_rules_list( - serializer: ShapeSerializer, schema: Schema, value: list[MappingRule] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_mapping_rules_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[MappingRule]: - result: list[MappingRule] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(MappingRule.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class RulesConfigurationType: - """A container for rules.""" - - rules: list[MappingRule] - """ - An array of rules. You can specify up to 25 rules per identity provider. - - Rules are evaluated in order. The first one to match specifies the role. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RULES_CONFIGURATION_TYPE, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_mapping_rules_list( - serializer, _SCHEMA_RULES_CONFIGURATION_TYPE.members["Rules"], self.rules - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rules"] = _deserialize_mapping_rules_list( - de, _SCHEMA_RULES_CONFIGURATION_TYPE.members["Rules"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RULES_CONFIGURATION_TYPE, consumer=_consumer) - if "rules" not in kwargs: - kwargs["rules"] = [] - return kwargs - - -class RoleMappingType(UnknownEnumMixin, StrEnum): - TOKEN = "Token" - RULES = "Rules" - - -@dataclass(kw_only=True) -class RoleMapping: - """A role mapping.""" - - type: str - """ - The role mapping type. Token will use `cognito:roles` and - `cognito:preferred_role` claims from the Cognito identity provider token - to map groups to roles. Rules will attempt to match claims from the - token to map to a role. - """ - - ambiguous_role_resolution: str | None = None - """ - If you specify Token or Rules as the `Type`, `AmbiguousRoleResolution` - is required. - - Specifies the action to be taken if either no rules match the claim - value for the `Rules` type, or there is no `cognito:preferred_role` - claim and there are multiple `cognito:roles` matches for the `Token` - type. - """ - - rules_configuration: RulesConfigurationType | None = None - """ - The rules to be used for mapping users to roles. - - If you specify Rules as the role mapping type, `RulesConfiguration` is - required. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ROLE_MAPPING, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_ROLE_MAPPING.members["Type"], self.type) - if self.ambiguous_role_resolution is not None: - serializer.write_string( - _SCHEMA_ROLE_MAPPING.members["AmbiguousRoleResolution"], - self.ambiguous_role_resolution, - ) - - if self.rules_configuration is not None: - serializer.write_struct( - _SCHEMA_ROLE_MAPPING.members["RulesConfiguration"], - self.rules_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = RoleMappingType( - de.read_string(_SCHEMA_ROLE_MAPPING.members["Type"]) - ) - - case 1: - kwargs["ambiguous_role_resolution"] = AmbiguousRoleResolutionType( - de.read_string( - _SCHEMA_ROLE_MAPPING.members["AmbiguousRoleResolution"] - ) - ) - - case 2: - kwargs["rules_configuration"] = RulesConfigurationType.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ROLE_MAPPING, consumer=_consumer) - if "type" not in kwargs: - kwargs["type"] = RoleMappingType._corrected("") - return kwargs - - -def _serialize_role_mapping_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, RoleMapping] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_struct(value_schema, v)) - - -def _deserialize_role_mapping_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, RoleMapping]: - result: dict[str, RoleMapping] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = RoleMapping.deserialize(d) - - deserializer.read_map(schema, _read_value) - return result - - -def _serialize_roles_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_roles_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GetIdentityPoolRolesOutput: - """Returned in response to a successful `GetIdentityPoolRoles` operation.""" - - identity_pool_id: str | None = None - """An identity pool ID in the format REGION:GUID.""" - - roles: dict[str, str] | None = None - """ - The map of roles associated with this pool. Currently only authenticated - and unauthenticated roles are supported. - """ - - role_mappings: dict[str, RoleMapping] | None = None - """ - How users for a specific identity provider are to mapped to roles. This - is a String-to-RoleMapping object map. The string identifies the - identity provider, for example, `graph.facebook.com` or - `cognito-idp.us-east-1.amazonaws.com/us-east-1_abcdefghi:app_client_id`. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_IDENTITY_POOL_ROLES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.identity_pool_id is not None: - serializer.write_string( - _SCHEMA_GET_IDENTITY_POOL_ROLES_OUTPUT.members["IdentityPoolId"], - self.identity_pool_id, - ) - - if self.roles is not None: - _serialize_roles_map( - serializer, - _SCHEMA_GET_IDENTITY_POOL_ROLES_OUTPUT.members["Roles"], - self.roles, - ) - - if self.role_mappings is not None: - _serialize_role_mapping_map( - serializer, - _SCHEMA_GET_IDENTITY_POOL_ROLES_OUTPUT.members["RoleMappings"], - self.role_mappings, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["identity_pool_id"] = de.read_string( - _SCHEMA_GET_IDENTITY_POOL_ROLES_OUTPUT.members["IdentityPoolId"] - ) - - case 1: - kwargs["roles"] = _deserialize_roles_map( - de, _SCHEMA_GET_IDENTITY_POOL_ROLES_OUTPUT.members["Roles"] - ) - - case 2: - kwargs["role_mappings"] = _deserialize_role_mapping_map( - de, - _SCHEMA_GET_IDENTITY_POOL_ROLES_OUTPUT.members["RoleMappings"], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_IDENTITY_POOL_ROLES_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_IDENTITY_POOL_ROLES = APIOperation( - input=GetIdentityPoolRolesInput, - output=GetIdentityPoolRolesOutput, - schema=_SCHEMA_GET_IDENTITY_POOL_ROLES, - input_schema=_SCHEMA_GET_IDENTITY_POOL_ROLES_INPUT, - output_schema=_SCHEMA_GET_IDENTITY_POOL_ROLES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cognitoidentity#InternalErrorException" - ): InternalErrorException, - ShapeID( - "com.amazonaws.cognitoidentity#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cognitoidentity#NotAuthorizedException" - ): NotAuthorizedException, - ShapeID( - "com.amazonaws.cognitoidentity#ResourceConflictException" - ): ResourceConflictException, - ShapeID( - "com.amazonaws.cognitoidentity#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.cognitoidentity#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_NOT_AUTHORIZED_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetOpenIdTokenInput: - """Input to the GetOpenIdToken action.""" - - identity_id: str | None = None - """A unique identifier in the format REGION:GUID.""" - - logins: dict[str, str] | None = None - """ - A set of optional name-value pairs that map provider names to provider - tokens. When using graph.facebook.com and www.amazon.com, supply the - access_token returned from the provider's authflow. For - accounts.google.com, an Amazon Cognito user pool provider, or any other - OpenID Connect provider, always include the `id_token`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_OPEN_ID_TOKEN_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.identity_id is not None: - serializer.write_string( - _SCHEMA_GET_OPEN_ID_TOKEN_INPUT.members["IdentityId"], self.identity_id - ) - - if self.logins is not None: - _serialize_logins_map( - serializer, - _SCHEMA_GET_OPEN_ID_TOKEN_INPUT.members["Logins"], - self.logins, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["identity_id"] = de.read_string( - _SCHEMA_GET_OPEN_ID_TOKEN_INPUT.members["IdentityId"] - ) - - case 1: - kwargs["logins"] = _deserialize_logins_map( - de, _SCHEMA_GET_OPEN_ID_TOKEN_INPUT.members["Logins"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_OPEN_ID_TOKEN_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetOpenIdTokenOutput: - """Returned in response to a successful GetOpenIdToken request.""" - - identity_id: str | None = None - """ - A unique identifier in the format REGION:GUID. Note that the IdentityId - returned may not match the one passed on input. - """ - - token: str | None = field(repr=False, default=None) - """An OpenID token, valid for 10 minutes.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_OPEN_ID_TOKEN_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.identity_id is not None: - serializer.write_string( - _SCHEMA_GET_OPEN_ID_TOKEN_OUTPUT.members["IdentityId"], self.identity_id - ) - - if self.token is not None: - serializer.write_string( - _SCHEMA_GET_OPEN_ID_TOKEN_OUTPUT.members["Token"], self.token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["identity_id"] = de.read_string( - _SCHEMA_GET_OPEN_ID_TOKEN_OUTPUT.members["IdentityId"] - ) - - case 1: - kwargs["token"] = de.read_string( - _SCHEMA_GET_OPEN_ID_TOKEN_OUTPUT.members["Token"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_OPEN_ID_TOKEN_OUTPUT, consumer=_consumer) - return kwargs - - -GET_OPEN_ID_TOKEN = APIOperation( - input=GetOpenIdTokenInput, - output=GetOpenIdTokenOutput, - schema=_SCHEMA_GET_OPEN_ID_TOKEN, - input_schema=_SCHEMA_GET_OPEN_ID_TOKEN_INPUT, - output_schema=_SCHEMA_GET_OPEN_ID_TOKEN_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cognitoidentity#ExternalServiceException" - ): ExternalServiceException, - ShapeID( - "com.amazonaws.cognitoidentity#InternalErrorException" - ): InternalErrorException, - ShapeID( - "com.amazonaws.cognitoidentity#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cognitoidentity#NotAuthorizedException" - ): NotAuthorizedException, - ShapeID( - "com.amazonaws.cognitoidentity#ResourceConflictException" - ): ResourceConflictException, - ShapeID( - "com.amazonaws.cognitoidentity#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.cognitoidentity#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("smithy.api#noAuth")], - error_schemas=[ - _SCHEMA_EXTERNAL_SERVICE_EXCEPTION, - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_NOT_AUTHORIZED_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeveloperUserAlreadyRegisteredException(ServiceError): - """ - The provided developer user identifier is already registered with - Cognito under a different identity ID. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DEVELOPER_USER_ALREADY_REGISTERED_EXCEPTION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_DEVELOPER_USER_ALREADY_REGISTERED_EXCEPTION.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_DEVELOPER_USER_ALREADY_REGISTERED_EXCEPTION.members[ - "message" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DEVELOPER_USER_ALREADY_REGISTERED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -def _serialize_principal_tags( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_principal_tags( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GetOpenIdTokenForDeveloperIdentityInput: - """Input to the `GetOpenIdTokenForDeveloperIdentity` action.""" - - identity_pool_id: str | None = None - """An identity pool ID in the format REGION:GUID.""" - - identity_id: str | None = None - """A unique identifier in the format REGION:GUID.""" - - logins: dict[str, str] | None = None - """ - A set of optional name-value pairs that map provider names to provider - tokens. Each name-value pair represents a user from a public provider or - developer provider. If the user is from a developer provider, the - name-value pair will follow the syntax - `"developer_provider_name": "developer_user_identifier"`. The developer - provider is the \"domain\" by which Cognito will refer to your users; - you provided this domain while creating/updating the identity pool. The - developer user identifier is an identifier from your backend that - uniquely identifies a user. When you create an identity pool, you can - specify the supported logins. - """ - - principal_tags: dict[str, str] | None = None - """Use this operation to configure attribute mappings for custom providers.""" - - token_duration: int | None = None - """ - The expiration time of the token, in seconds. You can specify a custom - expiration time for the token so that you can cache it. If you don't - provide an expiration time, the token is valid for 15 minutes. You can - exchange the token with Amazon STS for temporary Amazon Web Services - credentials, which are valid for a maximum of one hour. The maximum - token duration you can set is 24 hours. You should take care in setting - the expiration time for a token, as there are significant security - implications: an attacker could use a leaked token to access your Amazon - Web Services resources for the token's duration. - - Note: - Please provide for a small grace period, usually no more than 5 minutes, - to account for clock skew. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_OPEN_ID_TOKEN_FOR_DEVELOPER_IDENTITY_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.identity_pool_id is not None: - serializer.write_string( - _SCHEMA_GET_OPEN_ID_TOKEN_FOR_DEVELOPER_IDENTITY_INPUT.members[ - "IdentityPoolId" - ], - self.identity_pool_id, - ) - - if self.identity_id is not None: - serializer.write_string( - _SCHEMA_GET_OPEN_ID_TOKEN_FOR_DEVELOPER_IDENTITY_INPUT.members[ - "IdentityId" - ], - self.identity_id, - ) - - if self.logins is not None: - _serialize_logins_map( - serializer, - _SCHEMA_GET_OPEN_ID_TOKEN_FOR_DEVELOPER_IDENTITY_INPUT.members[ - "Logins" - ], - self.logins, - ) - - if self.principal_tags is not None: - _serialize_principal_tags( - serializer, - _SCHEMA_GET_OPEN_ID_TOKEN_FOR_DEVELOPER_IDENTITY_INPUT.members[ - "PrincipalTags" - ], - self.principal_tags, - ) - - if self.token_duration is not None: - serializer.write_long( - _SCHEMA_GET_OPEN_ID_TOKEN_FOR_DEVELOPER_IDENTITY_INPUT.members[ - "TokenDuration" - ], - self.token_duration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["identity_pool_id"] = de.read_string( - _SCHEMA_GET_OPEN_ID_TOKEN_FOR_DEVELOPER_IDENTITY_INPUT.members[ - "IdentityPoolId" - ] - ) - - case 1: - kwargs["identity_id"] = de.read_string( - _SCHEMA_GET_OPEN_ID_TOKEN_FOR_DEVELOPER_IDENTITY_INPUT.members[ - "IdentityId" - ] - ) - - case 2: - kwargs["logins"] = _deserialize_logins_map( - de, - _SCHEMA_GET_OPEN_ID_TOKEN_FOR_DEVELOPER_IDENTITY_INPUT.members[ - "Logins" - ], - ) - - case 3: - kwargs["principal_tags"] = _deserialize_principal_tags( - de, - _SCHEMA_GET_OPEN_ID_TOKEN_FOR_DEVELOPER_IDENTITY_INPUT.members[ - "PrincipalTags" - ], - ) - - case 4: - kwargs["token_duration"] = de.read_long( - _SCHEMA_GET_OPEN_ID_TOKEN_FOR_DEVELOPER_IDENTITY_INPUT.members[ - "TokenDuration" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_OPEN_ID_TOKEN_FOR_DEVELOPER_IDENTITY_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetOpenIdTokenForDeveloperIdentityOutput: - """ - Returned in response to a successful - `GetOpenIdTokenForDeveloperIdentity` request. - """ - - identity_id: str | None = None - """A unique identifier in the format REGION:GUID.""" - - token: str | None = field(repr=False, default=None) - """An OpenID token.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_OPEN_ID_TOKEN_FOR_DEVELOPER_IDENTITY_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.identity_id is not None: - serializer.write_string( - _SCHEMA_GET_OPEN_ID_TOKEN_FOR_DEVELOPER_IDENTITY_OUTPUT.members[ - "IdentityId" - ], - self.identity_id, - ) - - if self.token is not None: - serializer.write_string( - _SCHEMA_GET_OPEN_ID_TOKEN_FOR_DEVELOPER_IDENTITY_OUTPUT.members[ - "Token" - ], - self.token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["identity_id"] = de.read_string( - _SCHEMA_GET_OPEN_ID_TOKEN_FOR_DEVELOPER_IDENTITY_OUTPUT.members[ - "IdentityId" - ] - ) - - case 1: - kwargs["token"] = de.read_string( - _SCHEMA_GET_OPEN_ID_TOKEN_FOR_DEVELOPER_IDENTITY_OUTPUT.members[ - "Token" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_OPEN_ID_TOKEN_FOR_DEVELOPER_IDENTITY_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_OPEN_ID_TOKEN_FOR_DEVELOPER_IDENTITY = APIOperation( - input=GetOpenIdTokenForDeveloperIdentityInput, - output=GetOpenIdTokenForDeveloperIdentityOutput, - schema=_SCHEMA_GET_OPEN_ID_TOKEN_FOR_DEVELOPER_IDENTITY, - input_schema=_SCHEMA_GET_OPEN_ID_TOKEN_FOR_DEVELOPER_IDENTITY_INPUT, - output_schema=_SCHEMA_GET_OPEN_ID_TOKEN_FOR_DEVELOPER_IDENTITY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cognitoidentity#DeveloperUserAlreadyRegisteredException" - ): DeveloperUserAlreadyRegisteredException, - ShapeID( - "com.amazonaws.cognitoidentity#InternalErrorException" - ): InternalErrorException, - ShapeID( - "com.amazonaws.cognitoidentity#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cognitoidentity#NotAuthorizedException" - ): NotAuthorizedException, - ShapeID( - "com.amazonaws.cognitoidentity#ResourceConflictException" - ): ResourceConflictException, - ShapeID( - "com.amazonaws.cognitoidentity#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.cognitoidentity#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_DEVELOPER_USER_ALREADY_REGISTERED_EXCEPTION, - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_NOT_AUTHORIZED_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetPrincipalTagAttributeMapInput: - """Dataclass for GetPrincipalTagAttributeMapInput structure.""" - - identity_pool_id: str | None = None - """ - You can use this operation to get the ID of the Identity Pool you setup - attribute mappings for. - """ - - identity_provider_name: str | None = None - """You can use this operation to get the provider name.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_PRINCIPAL_TAG_ATTRIBUTE_MAP_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.identity_pool_id is not None: - serializer.write_string( - _SCHEMA_GET_PRINCIPAL_TAG_ATTRIBUTE_MAP_INPUT.members["IdentityPoolId"], - self.identity_pool_id, - ) - - if self.identity_provider_name is not None: - serializer.write_string( - _SCHEMA_GET_PRINCIPAL_TAG_ATTRIBUTE_MAP_INPUT.members[ - "IdentityProviderName" - ], - self.identity_provider_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["identity_pool_id"] = de.read_string( - _SCHEMA_GET_PRINCIPAL_TAG_ATTRIBUTE_MAP_INPUT.members[ - "IdentityPoolId" - ] - ) - - case 1: - kwargs["identity_provider_name"] = de.read_string( - _SCHEMA_GET_PRINCIPAL_TAG_ATTRIBUTE_MAP_INPUT.members[ - "IdentityProviderName" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_PRINCIPAL_TAG_ATTRIBUTE_MAP_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetPrincipalTagAttributeMapOutput: - """Dataclass for GetPrincipalTagAttributeMapOutput structure.""" - - identity_pool_id: str | None = None - """ - You can use this operation to get the ID of the Identity Pool you setup - attribute mappings for. - """ - - identity_provider_name: str | None = None - """You can use this operation to get the provider name.""" - - use_defaults: bool | None = None - """You can use this operation to list""" - - principal_tags: dict[str, str] | None = None - """ - You can use this operation to add principal tags. The - `PrincipalTags`operation enables you to reference user attributes in - your IAM permissions policy. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_PRINCIPAL_TAG_ATTRIBUTE_MAP_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.identity_pool_id is not None: - serializer.write_string( - _SCHEMA_GET_PRINCIPAL_TAG_ATTRIBUTE_MAP_OUTPUT.members[ - "IdentityPoolId" - ], - self.identity_pool_id, - ) - - if self.identity_provider_name is not None: - serializer.write_string( - _SCHEMA_GET_PRINCIPAL_TAG_ATTRIBUTE_MAP_OUTPUT.members[ - "IdentityProviderName" - ], - self.identity_provider_name, - ) - - if self.use_defaults is not None: - serializer.write_boolean( - _SCHEMA_GET_PRINCIPAL_TAG_ATTRIBUTE_MAP_OUTPUT.members["UseDefaults"], - self.use_defaults, - ) - - if self.principal_tags is not None: - _serialize_principal_tags( - serializer, - _SCHEMA_GET_PRINCIPAL_TAG_ATTRIBUTE_MAP_OUTPUT.members["PrincipalTags"], - self.principal_tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["identity_pool_id"] = de.read_string( - _SCHEMA_GET_PRINCIPAL_TAG_ATTRIBUTE_MAP_OUTPUT.members[ - "IdentityPoolId" - ] - ) - - case 1: - kwargs["identity_provider_name"] = de.read_string( - _SCHEMA_GET_PRINCIPAL_TAG_ATTRIBUTE_MAP_OUTPUT.members[ - "IdentityProviderName" - ] - ) - - case 2: - kwargs["use_defaults"] = de.read_boolean( - _SCHEMA_GET_PRINCIPAL_TAG_ATTRIBUTE_MAP_OUTPUT.members[ - "UseDefaults" - ] - ) - - case 3: - kwargs["principal_tags"] = _deserialize_principal_tags( - de, - _SCHEMA_GET_PRINCIPAL_TAG_ATTRIBUTE_MAP_OUTPUT.members[ - "PrincipalTags" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_PRINCIPAL_TAG_ATTRIBUTE_MAP_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_PRINCIPAL_TAG_ATTRIBUTE_MAP = APIOperation( - input=GetPrincipalTagAttributeMapInput, - output=GetPrincipalTagAttributeMapOutput, - schema=_SCHEMA_GET_PRINCIPAL_TAG_ATTRIBUTE_MAP, - input_schema=_SCHEMA_GET_PRINCIPAL_TAG_ATTRIBUTE_MAP_INPUT, - output_schema=_SCHEMA_GET_PRINCIPAL_TAG_ATTRIBUTE_MAP_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cognitoidentity#InternalErrorException" - ): InternalErrorException, - ShapeID( - "com.amazonaws.cognitoidentity#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cognitoidentity#NotAuthorizedException" - ): NotAuthorizedException, - ShapeID( - "com.amazonaws.cognitoidentity#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.cognitoidentity#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_NOT_AUTHORIZED_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListIdentitiesInput: - """Input to the ListIdentities action.""" - - identity_pool_id: str | None = None - """An identity pool ID in the format REGION:GUID.""" - - max_results: int | None = None - """The maximum number of identities to return.""" - - next_token: str | None = None - """A pagination token.""" - - hide_disabled: bool = False - """ - An optional boolean parameter that allows you to hide disabled - identities. If omitted, the ListIdentities API will include disabled - identities in the response. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_IDENTITIES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.identity_pool_id is not None: - serializer.write_string( - _SCHEMA_LIST_IDENTITIES_INPUT.members["IdentityPoolId"], - self.identity_pool_id, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_IDENTITIES_INPUT.members["MaxResults"], self.max_results - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_IDENTITIES_INPUT.members["NextToken"], self.next_token - ) - - if self.hide_disabled is not None: - serializer.write_boolean( - _SCHEMA_LIST_IDENTITIES_INPUT.members["HideDisabled"], - self.hide_disabled, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["identity_pool_id"] = de.read_string( - _SCHEMA_LIST_IDENTITIES_INPUT.members["IdentityPoolId"] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_IDENTITIES_INPUT.members["MaxResults"] - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_IDENTITIES_INPUT.members["NextToken"] - ) - - case 3: - kwargs["hide_disabled"] = de.read_boolean( - _SCHEMA_LIST_IDENTITIES_INPUT.members["HideDisabled"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_IDENTITIES_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class IdentityDescription: - """A description of the identity.""" - - identity_id: str | None = None - """A unique identifier in the format REGION:GUID.""" - - logins: list[str] | None = None - """The provider names.""" - - creation_date: datetime | None = None - """Date on which the identity was created.""" - - last_modified_date: datetime | None = None - """Date on which the identity was last modified.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IDENTITY_DESCRIPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.identity_id is not None: - serializer.write_string( - _SCHEMA_IDENTITY_DESCRIPTION.members["IdentityId"], self.identity_id - ) - - if self.logins is not None: - _serialize_logins_list( - serializer, _SCHEMA_IDENTITY_DESCRIPTION.members["Logins"], self.logins - ) - - if self.creation_date is not None: - serializer.write_timestamp( - _SCHEMA_IDENTITY_DESCRIPTION.members["CreationDate"], self.creation_date - ) - - if self.last_modified_date is not None: - serializer.write_timestamp( - _SCHEMA_IDENTITY_DESCRIPTION.members["LastModifiedDate"], - self.last_modified_date, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["identity_id"] = de.read_string( - _SCHEMA_IDENTITY_DESCRIPTION.members["IdentityId"] - ) - - case 1: - kwargs["logins"] = _deserialize_logins_list( - de, _SCHEMA_IDENTITY_DESCRIPTION.members["Logins"] - ) - - case 2: - kwargs["creation_date"] = de.read_timestamp( - _SCHEMA_IDENTITY_DESCRIPTION.members["CreationDate"] - ) - - case 3: - kwargs["last_modified_date"] = de.read_timestamp( - _SCHEMA_IDENTITY_DESCRIPTION.members["LastModifiedDate"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_IDENTITY_DESCRIPTION, consumer=_consumer) - return kwargs - - -def _serialize_identities_list( - serializer: ShapeSerializer, schema: Schema, value: list[IdentityDescription] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_identities_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[IdentityDescription]: - result: list[IdentityDescription] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(IdentityDescription.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListIdentitiesOutput: - """The response to a ListIdentities request.""" - - identity_pool_id: str | None = None - """An identity pool ID in the format REGION:GUID.""" - - identities: list[IdentityDescription] | None = None - """An object containing a set of identities and associated mappings.""" - - next_token: str | None = None - """A pagination token.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_IDENTITIES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.identity_pool_id is not None: - serializer.write_string( - _SCHEMA_LIST_IDENTITIES_OUTPUT.members["IdentityPoolId"], - self.identity_pool_id, - ) - - if self.identities is not None: - _serialize_identities_list( - serializer, - _SCHEMA_LIST_IDENTITIES_OUTPUT.members["Identities"], - self.identities, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_IDENTITIES_OUTPUT.members["NextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["identity_pool_id"] = de.read_string( - _SCHEMA_LIST_IDENTITIES_OUTPUT.members["IdentityPoolId"] - ) - - case 1: - kwargs["identities"] = _deserialize_identities_list( - de, _SCHEMA_LIST_IDENTITIES_OUTPUT.members["Identities"] - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_IDENTITIES_OUTPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_IDENTITIES_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_IDENTITIES = APIOperation( - input=ListIdentitiesInput, - output=ListIdentitiesOutput, - schema=_SCHEMA_LIST_IDENTITIES, - input_schema=_SCHEMA_LIST_IDENTITIES_INPUT, - output_schema=_SCHEMA_LIST_IDENTITIES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cognitoidentity#InternalErrorException" - ): InternalErrorException, - ShapeID( - "com.amazonaws.cognitoidentity#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cognitoidentity#NotAuthorizedException" - ): NotAuthorizedException, - ShapeID( - "com.amazonaws.cognitoidentity#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.cognitoidentity#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_NOT_AUTHORIZED_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListIdentityPoolsInput: - """Input to the ListIdentityPools action.""" - - max_results: int | None = None - """The maximum number of identities to return.""" - - next_token: str | None = None - """A pagination token.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_IDENTITY_POOLS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_IDENTITY_POOLS_INPUT.members["MaxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_IDENTITY_POOLS_INPUT.members["NextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_IDENTITY_POOLS_INPUT.members["MaxResults"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_IDENTITY_POOLS_INPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_IDENTITY_POOLS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class IdentityPoolShortDescription: - """A description of the identity pool.""" - - identity_pool_id: str | None = None - """An identity pool ID in the format REGION:GUID.""" - - identity_pool_name: str | None = None - """A string that you provide.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IDENTITY_POOL_SHORT_DESCRIPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.identity_pool_id is not None: - serializer.write_string( - _SCHEMA_IDENTITY_POOL_SHORT_DESCRIPTION.members["IdentityPoolId"], - self.identity_pool_id, - ) - - if self.identity_pool_name is not None: - serializer.write_string( - _SCHEMA_IDENTITY_POOL_SHORT_DESCRIPTION.members["IdentityPoolName"], - self.identity_pool_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["identity_pool_id"] = de.read_string( - _SCHEMA_IDENTITY_POOL_SHORT_DESCRIPTION.members[ - "IdentityPoolId" - ] - ) - - case 1: - kwargs["identity_pool_name"] = de.read_string( - _SCHEMA_IDENTITY_POOL_SHORT_DESCRIPTION.members[ - "IdentityPoolName" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_IDENTITY_POOL_SHORT_DESCRIPTION, consumer=_consumer - ) - return kwargs - - -def _serialize_identity_pools_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[IdentityPoolShortDescription], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_identity_pools_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[IdentityPoolShortDescription]: - result: list[IdentityPoolShortDescription] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(IdentityPoolShortDescription.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListIdentityPoolsOutput: - """The result of a successful ListIdentityPools action.""" - - identity_pools: list[IdentityPoolShortDescription] | None = None - """The identity pools returned by the ListIdentityPools action.""" - - next_token: str | None = None - """A pagination token.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_IDENTITY_POOLS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.identity_pools is not None: - _serialize_identity_pools_list( - serializer, - _SCHEMA_LIST_IDENTITY_POOLS_OUTPUT.members["IdentityPools"], - self.identity_pools, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_IDENTITY_POOLS_OUTPUT.members["NextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["identity_pools"] = _deserialize_identity_pools_list( - de, _SCHEMA_LIST_IDENTITY_POOLS_OUTPUT.members["IdentityPools"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_IDENTITY_POOLS_OUTPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_IDENTITY_POOLS_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_IDENTITY_POOLS = APIOperation( - input=ListIdentityPoolsInput, - output=ListIdentityPoolsOutput, - schema=_SCHEMA_LIST_IDENTITY_POOLS, - input_schema=_SCHEMA_LIST_IDENTITY_POOLS_INPUT, - output_schema=_SCHEMA_LIST_IDENTITY_POOLS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cognitoidentity#InternalErrorException" - ): InternalErrorException, - ShapeID( - "com.amazonaws.cognitoidentity#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cognitoidentity#NotAuthorizedException" - ): NotAuthorizedException, - ShapeID( - "com.amazonaws.cognitoidentity#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.cognitoidentity#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_NOT_AUTHORIZED_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListTagsForResourceInput: - """Dataclass for ListTagsForResourceInput structure.""" - - resource_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the identity pool that the tags are - assigned to. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT.members["ResourceArn"], - self.resource_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT.members["ResourceArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ListTagsForResourceOutput: - """Dataclass for ListTagsForResourceOutput structure.""" - - tags: dict[str, str] | None = None - """The tags that are assigned to the identity pool.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.tags is not None: - _serialize_identity_pool_tags_type( - serializer, - _SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT.members["Tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["tags"] = _deserialize_identity_pool_tags_type( - de, _SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT.members["Tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_TAGS_FOR_RESOURCE = APIOperation( - input=ListTagsForResourceInput, - output=ListTagsForResourceOutput, - schema=_SCHEMA_LIST_TAGS_FOR_RESOURCE, - input_schema=_SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT, - output_schema=_SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cognitoidentity#InternalErrorException" - ): InternalErrorException, - ShapeID( - "com.amazonaws.cognitoidentity#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cognitoidentity#NotAuthorizedException" - ): NotAuthorizedException, - ShapeID( - "com.amazonaws.cognitoidentity#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.cognitoidentity#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_NOT_AUTHORIZED_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class LookupDeveloperIdentityInput: - """Input to the `LookupDeveloperIdentityInput` action.""" - - identity_pool_id: str | None = None - """An identity pool ID in the format REGION:GUID.""" - - identity_id: str | None = None - """A unique identifier in the format REGION:GUID.""" - - developer_user_identifier: str | None = None - """ - A unique ID used by your backend authentication process to identify a - user. Typically, a developer identity provider would issue many - developer user identifiers, in keeping with the number of users. - """ - - max_results: int | None = None - """The maximum number of identities to return.""" - - next_token: str | None = None - """ - A pagination token. The first call you make will have `NextToken` set to - null. After that the service will return `NextToken` values as needed. - For example, let's say you make a request with `MaxResults` set to 10, - and there are 20 matches in the database. The service will return a - pagination token as a part of the response. This token can be used to - call the API again and get results starting from the 11th match. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LOOKUP_DEVELOPER_IDENTITY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.identity_pool_id is not None: - serializer.write_string( - _SCHEMA_LOOKUP_DEVELOPER_IDENTITY_INPUT.members["IdentityPoolId"], - self.identity_pool_id, - ) - - if self.identity_id is not None: - serializer.write_string( - _SCHEMA_LOOKUP_DEVELOPER_IDENTITY_INPUT.members["IdentityId"], - self.identity_id, - ) - - if self.developer_user_identifier is not None: - serializer.write_string( - _SCHEMA_LOOKUP_DEVELOPER_IDENTITY_INPUT.members[ - "DeveloperUserIdentifier" - ], - self.developer_user_identifier, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LOOKUP_DEVELOPER_IDENTITY_INPUT.members["MaxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LOOKUP_DEVELOPER_IDENTITY_INPUT.members["NextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["identity_pool_id"] = de.read_string( - _SCHEMA_LOOKUP_DEVELOPER_IDENTITY_INPUT.members[ - "IdentityPoolId" - ] - ) - - case 1: - kwargs["identity_id"] = de.read_string( - _SCHEMA_LOOKUP_DEVELOPER_IDENTITY_INPUT.members["IdentityId"] - ) - - case 2: - kwargs["developer_user_identifier"] = de.read_string( - _SCHEMA_LOOKUP_DEVELOPER_IDENTITY_INPUT.members[ - "DeveloperUserIdentifier" - ] - ) - - case 3: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LOOKUP_DEVELOPER_IDENTITY_INPUT.members["MaxResults"] - ) - - case 4: - kwargs["next_token"] = de.read_string( - _SCHEMA_LOOKUP_DEVELOPER_IDENTITY_INPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LOOKUP_DEVELOPER_IDENTITY_INPUT, consumer=_consumer - ) - return kwargs - - -def _serialize_developer_user_identifier_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_developer_user_identifier_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class LookupDeveloperIdentityOutput: - """Returned in response to a successful `LookupDeveloperIdentity` action.""" - - identity_id: str | None = None - """A unique identifier in the format REGION:GUID.""" - - developer_user_identifier_list: list[str] | None = None - """ - This is the list of developer user identifiers associated with an - identity ID. Cognito supports the association of multiple developer user - identifiers with an identity ID. - """ - - next_token: str | None = None - """ - A pagination token. The first call you make will have `NextToken` set to - null. After that the service will return `NextToken` values as needed. - For example, let's say you make a request with `MaxResults` set to 10, - and there are 20 matches in the database. The service will return a - pagination token as a part of the response. This token can be used to - call the API again and get results starting from the 11th match. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LOOKUP_DEVELOPER_IDENTITY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.identity_id is not None: - serializer.write_string( - _SCHEMA_LOOKUP_DEVELOPER_IDENTITY_OUTPUT.members["IdentityId"], - self.identity_id, - ) - - if self.developer_user_identifier_list is not None: - _serialize_developer_user_identifier_list( - serializer, - _SCHEMA_LOOKUP_DEVELOPER_IDENTITY_OUTPUT.members[ - "DeveloperUserIdentifierList" - ], - self.developer_user_identifier_list, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LOOKUP_DEVELOPER_IDENTITY_OUTPUT.members["NextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["identity_id"] = de.read_string( - _SCHEMA_LOOKUP_DEVELOPER_IDENTITY_OUTPUT.members["IdentityId"] - ) - - case 1: - kwargs["developer_user_identifier_list"] = ( - _deserialize_developer_user_identifier_list( - de, - _SCHEMA_LOOKUP_DEVELOPER_IDENTITY_OUTPUT.members[ - "DeveloperUserIdentifierList" - ], - ) - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_LOOKUP_DEVELOPER_IDENTITY_OUTPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LOOKUP_DEVELOPER_IDENTITY_OUTPUT, consumer=_consumer - ) - return kwargs - - -LOOKUP_DEVELOPER_IDENTITY = APIOperation( - input=LookupDeveloperIdentityInput, - output=LookupDeveloperIdentityOutput, - schema=_SCHEMA_LOOKUP_DEVELOPER_IDENTITY, - input_schema=_SCHEMA_LOOKUP_DEVELOPER_IDENTITY_INPUT, - output_schema=_SCHEMA_LOOKUP_DEVELOPER_IDENTITY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cognitoidentity#InternalErrorException" - ): InternalErrorException, - ShapeID( - "com.amazonaws.cognitoidentity#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cognitoidentity#NotAuthorizedException" - ): NotAuthorizedException, - ShapeID( - "com.amazonaws.cognitoidentity#ResourceConflictException" - ): ResourceConflictException, - ShapeID( - "com.amazonaws.cognitoidentity#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.cognitoidentity#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_NOT_AUTHORIZED_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class MergeDeveloperIdentitiesInput: - """Input to the `MergeDeveloperIdentities` action.""" - - source_user_identifier: str | None = None - """ - User identifier for the source user. The value should be a - `DeveloperUserIdentifier`. - """ - - destination_user_identifier: str | None = None - """ - User identifier for the destination user. The value should be a - `DeveloperUserIdentifier`. - """ - - developer_provider_name: str | None = None - """ - The \"domain\" by which Cognito will refer to your users. This is a - (pseudo) domain name that you provide while creating an identity pool. - This name acts as a placeholder that allows your backend and the Cognito - service to communicate about the developer provider. For the - `DeveloperProviderName`, you can use letters as well as period (.), - underscore (_), and dash (-). - """ - - identity_pool_id: str | None = None - """An identity pool ID in the format REGION:GUID.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MERGE_DEVELOPER_IDENTITIES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.source_user_identifier is not None: - serializer.write_string( - _SCHEMA_MERGE_DEVELOPER_IDENTITIES_INPUT.members[ - "SourceUserIdentifier" - ], - self.source_user_identifier, - ) - - if self.destination_user_identifier is not None: - serializer.write_string( - _SCHEMA_MERGE_DEVELOPER_IDENTITIES_INPUT.members[ - "DestinationUserIdentifier" - ], - self.destination_user_identifier, - ) - - if self.developer_provider_name is not None: - serializer.write_string( - _SCHEMA_MERGE_DEVELOPER_IDENTITIES_INPUT.members[ - "DeveloperProviderName" - ], - self.developer_provider_name, - ) - - if self.identity_pool_id is not None: - serializer.write_string( - _SCHEMA_MERGE_DEVELOPER_IDENTITIES_INPUT.members["IdentityPoolId"], - self.identity_pool_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["source_user_identifier"] = de.read_string( - _SCHEMA_MERGE_DEVELOPER_IDENTITIES_INPUT.members[ - "SourceUserIdentifier" - ] - ) - - case 1: - kwargs["destination_user_identifier"] = de.read_string( - _SCHEMA_MERGE_DEVELOPER_IDENTITIES_INPUT.members[ - "DestinationUserIdentifier" - ] - ) - - case 2: - kwargs["developer_provider_name"] = de.read_string( - _SCHEMA_MERGE_DEVELOPER_IDENTITIES_INPUT.members[ - "DeveloperProviderName" - ] - ) - - case 3: - kwargs["identity_pool_id"] = de.read_string( - _SCHEMA_MERGE_DEVELOPER_IDENTITIES_INPUT.members[ - "IdentityPoolId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MERGE_DEVELOPER_IDENTITIES_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class MergeDeveloperIdentitiesOutput: - """Returned in response to a successful `MergeDeveloperIdentities` action.""" - - identity_id: str | None = None - """A unique identifier in the format REGION:GUID.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MERGE_DEVELOPER_IDENTITIES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.identity_id is not None: - serializer.write_string( - _SCHEMA_MERGE_DEVELOPER_IDENTITIES_OUTPUT.members["IdentityId"], - self.identity_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["identity_id"] = de.read_string( - _SCHEMA_MERGE_DEVELOPER_IDENTITIES_OUTPUT.members["IdentityId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MERGE_DEVELOPER_IDENTITIES_OUTPUT, consumer=_consumer - ) - return kwargs - - -MERGE_DEVELOPER_IDENTITIES = APIOperation( - input=MergeDeveloperIdentitiesInput, - output=MergeDeveloperIdentitiesOutput, - schema=_SCHEMA_MERGE_DEVELOPER_IDENTITIES, - input_schema=_SCHEMA_MERGE_DEVELOPER_IDENTITIES_INPUT, - output_schema=_SCHEMA_MERGE_DEVELOPER_IDENTITIES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cognitoidentity#InternalErrorException" - ): InternalErrorException, - ShapeID( - "com.amazonaws.cognitoidentity#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cognitoidentity#NotAuthorizedException" - ): NotAuthorizedException, - ShapeID( - "com.amazonaws.cognitoidentity#ResourceConflictException" - ): ResourceConflictException, - ShapeID( - "com.amazonaws.cognitoidentity#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.cognitoidentity#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_NOT_AUTHORIZED_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ConcurrentModificationException(ServiceError): - """Thrown if there are parallel requests to modify a resource.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONCURRENT_MODIFICATION_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_CONCURRENT_MODIFICATION_EXCEPTION.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_CONCURRENT_MODIFICATION_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CONCURRENT_MODIFICATION_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class SetIdentityPoolRolesInput: - """Input to the `SetIdentityPoolRoles` action.""" - - identity_pool_id: str | None = None - """An identity pool ID in the format REGION:GUID.""" - - roles: dict[str, str] | None = None - """ - The map of roles associated with this pool. For a given role, the key - will be either \"authenticated\" or \"unauthenticated\" and the value - will be the Role ARN. - """ - - role_mappings: dict[str, RoleMapping] | None = None - """ - How users for a specific identity provider are to mapped to roles. This - is a string to RoleMapping object map. The string identifies the - identity provider, for example, `graph.facebook.com` or - `cognito-idp.us-east-1.amazonaws.com/us-east-1_abcdefghi:app_client_id`. - - Up to 25 rules can be specified per identity provider. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SET_IDENTITY_POOL_ROLES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.identity_pool_id is not None: - serializer.write_string( - _SCHEMA_SET_IDENTITY_POOL_ROLES_INPUT.members["IdentityPoolId"], - self.identity_pool_id, - ) - - if self.roles is not None: - _serialize_roles_map( - serializer, - _SCHEMA_SET_IDENTITY_POOL_ROLES_INPUT.members["Roles"], - self.roles, - ) - - if self.role_mappings is not None: - _serialize_role_mapping_map( - serializer, - _SCHEMA_SET_IDENTITY_POOL_ROLES_INPUT.members["RoleMappings"], - self.role_mappings, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["identity_pool_id"] = de.read_string( - _SCHEMA_SET_IDENTITY_POOL_ROLES_INPUT.members["IdentityPoolId"] - ) - - case 1: - kwargs["roles"] = _deserialize_roles_map( - de, _SCHEMA_SET_IDENTITY_POOL_ROLES_INPUT.members["Roles"] - ) - - case 2: - kwargs["role_mappings"] = _deserialize_role_mapping_map( - de, - _SCHEMA_SET_IDENTITY_POOL_ROLES_INPUT.members["RoleMappings"], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SET_IDENTITY_POOL_ROLES_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class SetIdentityPoolRolesOutput: - """Dataclass for SetIdentityPoolRolesOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SET_IDENTITY_POOL_ROLES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SET_IDENTITY_POOL_ROLES_OUTPUT, consumer=_consumer - ) - return kwargs - - -SET_IDENTITY_POOL_ROLES = APIOperation( - input=SetIdentityPoolRolesInput, - output=SetIdentityPoolRolesOutput, - schema=_SCHEMA_SET_IDENTITY_POOL_ROLES, - input_schema=_SCHEMA_SET_IDENTITY_POOL_ROLES_INPUT, - output_schema=_SCHEMA_SET_IDENTITY_POOL_ROLES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cognitoidentity#ConcurrentModificationException" - ): ConcurrentModificationException, - ShapeID( - "com.amazonaws.cognitoidentity#InternalErrorException" - ): InternalErrorException, - ShapeID( - "com.amazonaws.cognitoidentity#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cognitoidentity#NotAuthorizedException" - ): NotAuthorizedException, - ShapeID( - "com.amazonaws.cognitoidentity#ResourceConflictException" - ): ResourceConflictException, - ShapeID( - "com.amazonaws.cognitoidentity#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.cognitoidentity#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CONCURRENT_MODIFICATION_EXCEPTION, - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_NOT_AUTHORIZED_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class SetPrincipalTagAttributeMapInput: - """Dataclass for SetPrincipalTagAttributeMapInput structure.""" - - identity_pool_id: str | None = None - """The ID of the Identity Pool you want to set attribute mappings for.""" - - identity_provider_name: str | None = None - """The provider name you want to use for attribute mappings.""" - - use_defaults: bool | None = None - """ - You can use this operation to use default (username and clientID) - attribute mappings. - """ - - principal_tags: dict[str, str] | None = None - """You can use this operation to add principal tags.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SET_PRINCIPAL_TAG_ATTRIBUTE_MAP_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.identity_pool_id is not None: - serializer.write_string( - _SCHEMA_SET_PRINCIPAL_TAG_ATTRIBUTE_MAP_INPUT.members["IdentityPoolId"], - self.identity_pool_id, - ) - - if self.identity_provider_name is not None: - serializer.write_string( - _SCHEMA_SET_PRINCIPAL_TAG_ATTRIBUTE_MAP_INPUT.members[ - "IdentityProviderName" - ], - self.identity_provider_name, - ) - - if self.use_defaults is not None: - serializer.write_boolean( - _SCHEMA_SET_PRINCIPAL_TAG_ATTRIBUTE_MAP_INPUT.members["UseDefaults"], - self.use_defaults, - ) - - if self.principal_tags is not None: - _serialize_principal_tags( - serializer, - _SCHEMA_SET_PRINCIPAL_TAG_ATTRIBUTE_MAP_INPUT.members["PrincipalTags"], - self.principal_tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["identity_pool_id"] = de.read_string( - _SCHEMA_SET_PRINCIPAL_TAG_ATTRIBUTE_MAP_INPUT.members[ - "IdentityPoolId" - ] - ) - - case 1: - kwargs["identity_provider_name"] = de.read_string( - _SCHEMA_SET_PRINCIPAL_TAG_ATTRIBUTE_MAP_INPUT.members[ - "IdentityProviderName" - ] - ) - - case 2: - kwargs["use_defaults"] = de.read_boolean( - _SCHEMA_SET_PRINCIPAL_TAG_ATTRIBUTE_MAP_INPUT.members[ - "UseDefaults" - ] - ) - - case 3: - kwargs["principal_tags"] = _deserialize_principal_tags( - de, - _SCHEMA_SET_PRINCIPAL_TAG_ATTRIBUTE_MAP_INPUT.members[ - "PrincipalTags" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SET_PRINCIPAL_TAG_ATTRIBUTE_MAP_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class SetPrincipalTagAttributeMapOutput: - """Dataclass for SetPrincipalTagAttributeMapOutput structure.""" - - identity_pool_id: str | None = None - """The ID of the Identity Pool you want to set attribute mappings for.""" - - identity_provider_name: str | None = None - """The provider name you want to use for attribute mappings.""" - - use_defaults: bool | None = None - """ - You can use this operation to select default (username and clientID) - attribute mappings. - """ - - principal_tags: dict[str, str] | None = None - """ - You can use this operation to add principal tags. The - `PrincipalTags`operation enables you to reference user attributes in - your IAM permissions policy. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SET_PRINCIPAL_TAG_ATTRIBUTE_MAP_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.identity_pool_id is not None: - serializer.write_string( - _SCHEMA_SET_PRINCIPAL_TAG_ATTRIBUTE_MAP_OUTPUT.members[ - "IdentityPoolId" - ], - self.identity_pool_id, - ) - - if self.identity_provider_name is not None: - serializer.write_string( - _SCHEMA_SET_PRINCIPAL_TAG_ATTRIBUTE_MAP_OUTPUT.members[ - "IdentityProviderName" - ], - self.identity_provider_name, - ) - - if self.use_defaults is not None: - serializer.write_boolean( - _SCHEMA_SET_PRINCIPAL_TAG_ATTRIBUTE_MAP_OUTPUT.members["UseDefaults"], - self.use_defaults, - ) - - if self.principal_tags is not None: - _serialize_principal_tags( - serializer, - _SCHEMA_SET_PRINCIPAL_TAG_ATTRIBUTE_MAP_OUTPUT.members["PrincipalTags"], - self.principal_tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["identity_pool_id"] = de.read_string( - _SCHEMA_SET_PRINCIPAL_TAG_ATTRIBUTE_MAP_OUTPUT.members[ - "IdentityPoolId" - ] - ) - - case 1: - kwargs["identity_provider_name"] = de.read_string( - _SCHEMA_SET_PRINCIPAL_TAG_ATTRIBUTE_MAP_OUTPUT.members[ - "IdentityProviderName" - ] - ) - - case 2: - kwargs["use_defaults"] = de.read_boolean( - _SCHEMA_SET_PRINCIPAL_TAG_ATTRIBUTE_MAP_OUTPUT.members[ - "UseDefaults" - ] - ) - - case 3: - kwargs["principal_tags"] = _deserialize_principal_tags( - de, - _SCHEMA_SET_PRINCIPAL_TAG_ATTRIBUTE_MAP_OUTPUT.members[ - "PrincipalTags" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SET_PRINCIPAL_TAG_ATTRIBUTE_MAP_OUTPUT, consumer=_consumer - ) - return kwargs - - -SET_PRINCIPAL_TAG_ATTRIBUTE_MAP = APIOperation( - input=SetPrincipalTagAttributeMapInput, - output=SetPrincipalTagAttributeMapOutput, - schema=_SCHEMA_SET_PRINCIPAL_TAG_ATTRIBUTE_MAP, - input_schema=_SCHEMA_SET_PRINCIPAL_TAG_ATTRIBUTE_MAP_INPUT, - output_schema=_SCHEMA_SET_PRINCIPAL_TAG_ATTRIBUTE_MAP_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cognitoidentity#InternalErrorException" - ): InternalErrorException, - ShapeID( - "com.amazonaws.cognitoidentity#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cognitoidentity#NotAuthorizedException" - ): NotAuthorizedException, - ShapeID( - "com.amazonaws.cognitoidentity#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.cognitoidentity#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_NOT_AUTHORIZED_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class TagResourceInput: - """Dataclass for TagResourceInput structure.""" - - resource_arn: str | None = None - """The Amazon Resource Name (ARN) of the identity pool.""" - - tags: dict[str, str] | None = None - """The tags to assign to the identity pool.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TAG_RESOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_TAG_RESOURCE_INPUT.members["ResourceArn"], self.resource_arn - ) - - if self.tags is not None: - _serialize_identity_pool_tags_type( - serializer, _SCHEMA_TAG_RESOURCE_INPUT.members["Tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_TAG_RESOURCE_INPUT.members["ResourceArn"] - ) - - case 1: - kwargs["tags"] = _deserialize_identity_pool_tags_type( - de, _SCHEMA_TAG_RESOURCE_INPUT.members["Tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TAG_RESOURCE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class TagResourceOutput: - """Dataclass for TagResourceOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .models import ( + CreateIdentityPoolInput, + CreateIdentityPoolOutput, + DeleteIdentitiesInput, + DeleteIdentitiesOutput, + DeleteIdentityPoolInput, + DeleteIdentityPoolOutput, + DescribeIdentityInput, + DescribeIdentityOutput, + DescribeIdentityPoolInput, + DescribeIdentityPoolOutput, + GetCredentialsForIdentityInput, + GetCredentialsForIdentityOutput, + GetIdInput, + GetIdOutput, + GetIdentityPoolRolesInput, + GetIdentityPoolRolesOutput, + GetOpenIdTokenForDeveloperIdentityInput, + GetOpenIdTokenForDeveloperIdentityOutput, + GetOpenIdTokenInput, + GetOpenIdTokenOutput, + GetPrincipalTagAttributeMapInput, + GetPrincipalTagAttributeMapOutput, + ListIdentitiesInput, + ListIdentitiesOutput, + ListIdentityPoolsInput, + ListIdentityPoolsOutput, + ListTagsForResourceInput, + ListTagsForResourceOutput, + LookupDeveloperIdentityInput, + LookupDeveloperIdentityOutput, + MergeDeveloperIdentitiesInput, + MergeDeveloperIdentitiesOutput, + SetIdentityPoolRolesInput, + SetIdentityPoolRolesOutput, + SetPrincipalTagAttributeMapInput, + SetPrincipalTagAttributeMapOutput, + TagResourceInput, + TagResourceOutput, + UnlinkDeveloperIdentityInput, + UnlinkDeveloperIdentityOutput, + UnlinkIdentityInput, + UnlinkIdentityOutput, + UntagResourceInput, + UntagResourceOutput, + UpdateIdentityPoolInput, + UpdateIdentityPoolOutput, ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TAG_RESOURCE_OUTPUT, self) - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) +class ServiceError(ModeledError): + """ + Base error for all errors in the service. - deserializer.read_struct(_SCHEMA_TAG_RESOURCE_OUTPUT, consumer=_consumer) - return kwargs + Some exceptions do not extend from this class, including + synthetic, implicit, and shared exception types. + """ -TAG_RESOURCE = APIOperation( - input=TagResourceInput, - output=TagResourceOutput, - schema=_SCHEMA_TAG_RESOURCE, - input_schema=_SCHEMA_TAG_RESOURCE_INPUT, - output_schema=_SCHEMA_TAG_RESOURCE_OUTPUT, - error_registry=TypeRegistry( +_registry = ModelRegistry( + _schemas, + renames={}, + index={ + "AmbiguousRoleResolutionType": "AMBIGUOUS_ROLE_RESOLUTION_TYPE", + "CognitoIdentityProvider": "COGNITO_IDENTITY_PROVIDER", + "ConcurrentModificationException": "CONCURRENT_MODIFICATION_EXCEPTION", + "CreateIdentityPoolInput": "CREATE_IDENTITY_POOL_INPUT", + "CreateIdentityPoolOutput": "CREATE_IDENTITY_POOL_OUTPUT", + "Credentials": "CREDENTIALS", + "DeleteIdentitiesInput": "DELETE_IDENTITIES_INPUT", + "DeleteIdentitiesOutput": "DELETE_IDENTITIES_OUTPUT", + "DeleteIdentityPoolInput": "DELETE_IDENTITY_POOL_INPUT", + "DeleteIdentityPoolOutput": "DELETE_IDENTITY_POOL_OUTPUT", + "DescribeIdentityInput": "DESCRIBE_IDENTITY_INPUT", + "DescribeIdentityOutput": "DESCRIBE_IDENTITY_OUTPUT", + "DescribeIdentityPoolInput": "DESCRIBE_IDENTITY_POOL_INPUT", + "DescribeIdentityPoolOutput": "DESCRIBE_IDENTITY_POOL_OUTPUT", + "DeveloperUserAlreadyRegisteredException": "DEVELOPER_USER_ALREADY_REGISTERED_EXCEPTION", + "ErrorCode": "ERROR_CODE", + "ExternalServiceException": "EXTERNAL_SERVICE_EXCEPTION", + "GetCredentialsForIdentityInput": "GET_CREDENTIALS_FOR_IDENTITY_INPUT", + "GetCredentialsForIdentityOutput": "GET_CREDENTIALS_FOR_IDENTITY_OUTPUT", + "GetIdentityPoolRolesInput": "GET_IDENTITY_POOL_ROLES_INPUT", + "GetIdentityPoolRolesOutput": "GET_IDENTITY_POOL_ROLES_OUTPUT", + "GetIdInput": "GET_ID_INPUT", + "GetIdOutput": "GET_ID_OUTPUT", + "GetOpenIdTokenForDeveloperIdentityInput": "GET_OPEN_ID_TOKEN_FOR_DEVELOPER_IDENTITY_INPUT", + "GetOpenIdTokenForDeveloperIdentityOutput": "GET_OPEN_ID_TOKEN_FOR_DEVELOPER_IDENTITY_OUTPUT", + "GetOpenIdTokenInput": "GET_OPEN_ID_TOKEN_INPUT", + "GetOpenIdTokenOutput": "GET_OPEN_ID_TOKEN_OUTPUT", + "GetPrincipalTagAttributeMapInput": "GET_PRINCIPAL_TAG_ATTRIBUTE_MAP_INPUT", + "GetPrincipalTagAttributeMapOutput": "GET_PRINCIPAL_TAG_ATTRIBUTE_MAP_OUTPUT", + "IdentityDescription": "IDENTITY_DESCRIPTION", + "IdentityPoolShortDescription": "IDENTITY_POOL_SHORT_DESCRIPTION", + "InternalErrorException": "INTERNAL_ERROR_EXCEPTION", + "InvalidIdentityPoolConfigurationException": "INVALID_IDENTITY_POOL_CONFIGURATION_EXCEPTION", + "InvalidParameterException": "INVALID_PARAMETER_EXCEPTION", + "LimitExceededException": "LIMIT_EXCEEDED_EXCEPTION", + "ListIdentitiesInput": "LIST_IDENTITIES_INPUT", + "ListIdentitiesOutput": "LIST_IDENTITIES_OUTPUT", + "ListIdentityPoolsInput": "LIST_IDENTITY_POOLS_INPUT", + "ListIdentityPoolsOutput": "LIST_IDENTITY_POOLS_OUTPUT", + "ListTagsForResourceInput": "LIST_TAGS_FOR_RESOURCE_INPUT", + "ListTagsForResourceOutput": "LIST_TAGS_FOR_RESOURCE_OUTPUT", + "LookupDeveloperIdentityInput": "LOOKUP_DEVELOPER_IDENTITY_INPUT", + "LookupDeveloperIdentityOutput": "LOOKUP_DEVELOPER_IDENTITY_OUTPUT", + "MappingRule": "MAPPING_RULE", + "MappingRuleMatchType": "MAPPING_RULE_MATCH_TYPE", + "MergeDeveloperIdentitiesInput": "MERGE_DEVELOPER_IDENTITIES_INPUT", + "MergeDeveloperIdentitiesOutput": "MERGE_DEVELOPER_IDENTITIES_OUTPUT", + "NotAuthorizedException": "NOT_AUTHORIZED_EXCEPTION", + "ResourceConflictException": "RESOURCE_CONFLICT_EXCEPTION", + "ResourceNotFoundException": "RESOURCE_NOT_FOUND_EXCEPTION", + "RoleMapping": "ROLE_MAPPING", + "RoleMappingType": "ROLE_MAPPING_TYPE", + "RulesConfigurationType": "RULES_CONFIGURATION_TYPE", + "SetIdentityPoolRolesInput": "SET_IDENTITY_POOL_ROLES_INPUT", + "SetIdentityPoolRolesOutput": "SET_IDENTITY_POOL_ROLES_OUTPUT", + "SetPrincipalTagAttributeMapInput": "SET_PRINCIPAL_TAG_ATTRIBUTE_MAP_INPUT", + "SetPrincipalTagAttributeMapOutput": "SET_PRINCIPAL_TAG_ATTRIBUTE_MAP_OUTPUT", + "TagResourceInput": "TAG_RESOURCE_INPUT", + "TagResourceOutput": "TAG_RESOURCE_OUTPUT", + "TooManyRequestsException": "TOO_MANY_REQUESTS_EXCEPTION", + "UnlinkDeveloperIdentityInput": "UNLINK_DEVELOPER_IDENTITY_INPUT", + "UnlinkDeveloperIdentityOutput": "UNLINK_DEVELOPER_IDENTITY_OUTPUT", + "UnlinkIdentityInput": "UNLINK_IDENTITY_INPUT", + "UnlinkIdentityOutput": "UNLINK_IDENTITY_OUTPUT", + "UnprocessedIdentityId": "UNPROCESSED_IDENTITY_ID", + "UntagResourceInput": "UNTAG_RESOURCE_INPUT", + "UntagResourceOutput": "UNTAG_RESOURCE_OUTPUT", + "UpdateIdentityPoolInput": "UPDATE_IDENTITY_POOL_INPUT", + "UpdateIdentityPoolOutput": "UPDATE_IDENTITY_POOL_OUTPUT", + }, + shape_names=frozenset( { - ShapeID( - "com.amazonaws.cognitoidentity#InternalErrorException" - ): InternalErrorException, - ShapeID( - "com.amazonaws.cognitoidentity#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cognitoidentity#NotAuthorizedException" - ): NotAuthorizedException, - ShapeID( - "com.amazonaws.cognitoidentity#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.cognitoidentity#TooManyRequestsException" - ): TooManyRequestsException, + "AmbiguousRoleResolutionType", + "CognitoIdentityProvider", + "ConcurrentModificationException", + "CreateIdentityPoolInput", + "CreateIdentityPoolOutput", + "Credentials", + "DeleteIdentitiesInput", + "DeleteIdentitiesOutput", + "DeleteIdentityPoolInput", + "DeleteIdentityPoolOutput", + "DescribeIdentityInput", + "DescribeIdentityOutput", + "DescribeIdentityPoolInput", + "DescribeIdentityPoolOutput", + "DeveloperUserAlreadyRegisteredException", + "ErrorCode", + "ExternalServiceException", + "GetCredentialsForIdentityInput", + "GetCredentialsForIdentityOutput", + "GetIdInput", + "GetIdOutput", + "GetIdentityPoolRolesInput", + "GetIdentityPoolRolesOutput", + "GetOpenIdTokenForDeveloperIdentityInput", + "GetOpenIdTokenForDeveloperIdentityOutput", + "GetOpenIdTokenInput", + "GetOpenIdTokenOutput", + "GetPrincipalTagAttributeMapInput", + "GetPrincipalTagAttributeMapOutput", + "IdentityDescription", + "IdentityPoolShortDescription", + "InternalErrorException", + "InvalidIdentityPoolConfigurationException", + "InvalidParameterException", + "LimitExceededException", + "ListIdentitiesInput", + "ListIdentitiesOutput", + "ListIdentityPoolsInput", + "ListIdentityPoolsOutput", + "ListTagsForResourceInput", + "ListTagsForResourceOutput", + "LookupDeveloperIdentityInput", + "LookupDeveloperIdentityOutput", + "MappingRule", + "MappingRuleMatchType", + "MergeDeveloperIdentitiesInput", + "MergeDeveloperIdentitiesOutput", + "NotAuthorizedException", + "ResourceConflictException", + "ResourceNotFoundException", + "RoleMapping", + "RoleMappingType", + "RulesConfigurationType", + "SetIdentityPoolRolesInput", + "SetIdentityPoolRolesOutput", + "SetPrincipalTagAttributeMapInput", + "SetPrincipalTagAttributeMapOutput", + "TagResourceInput", + "TagResourceOutput", + "TooManyRequestsException", + "UnlinkDeveloperIdentityInput", + "UnlinkDeveloperIdentityOutput", + "UnlinkIdentityInput", + "UnlinkIdentityOutput", + "UnprocessedIdentityId", + "UntagResourceInput", + "UntagResourceOutput", + "UpdateIdentityPoolInput", + "UpdateIdentityPoolOutput", } ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_NOT_AUTHORIZED_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], + service_error="ServiceError", ) -@dataclass(kw_only=True) -class UnlinkDeveloperIdentityInput: - """Input to the `UnlinkDeveloperIdentity` action.""" - - identity_id: str | None = None - """A unique identifier in the format REGION:GUID.""" - - identity_pool_id: str | None = None - """An identity pool ID in the format REGION:GUID.""" - - developer_provider_name: str | None = None - """The \"domain\" by which Cognito will refer to your users.""" - - developer_user_identifier: str | None = None - """ - A unique ID used by your backend authentication process to identify a - user. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNLINK_DEVELOPER_IDENTITY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.identity_id is not None: - serializer.write_string( - _SCHEMA_UNLINK_DEVELOPER_IDENTITY_INPUT.members["IdentityId"], - self.identity_id, - ) - - if self.identity_pool_id is not None: - serializer.write_string( - _SCHEMA_UNLINK_DEVELOPER_IDENTITY_INPUT.members["IdentityPoolId"], - self.identity_pool_id, - ) - - if self.developer_provider_name is not None: - serializer.write_string( - _SCHEMA_UNLINK_DEVELOPER_IDENTITY_INPUT.members[ - "DeveloperProviderName" - ], - self.developer_provider_name, - ) - - if self.developer_user_identifier is not None: - serializer.write_string( - _SCHEMA_UNLINK_DEVELOPER_IDENTITY_INPUT.members[ - "DeveloperUserIdentifier" - ], - self.developer_user_identifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +def __getattr__(name: str): + return _registry.build(name) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["identity_id"] = de.read_string( - _SCHEMA_UNLINK_DEVELOPER_IDENTITY_INPUT.members["IdentityId"] - ) - case 1: - kwargs["identity_pool_id"] = de.read_string( - _SCHEMA_UNLINK_DEVELOPER_IDENTITY_INPUT.members[ - "IdentityPoolId" - ] - ) - - case 2: - kwargs["developer_provider_name"] = de.read_string( - _SCHEMA_UNLINK_DEVELOPER_IDENTITY_INPUT.members[ - "DeveloperProviderName" - ] - ) - - case 3: - kwargs["developer_user_identifier"] = de.read_string( - _SCHEMA_UNLINK_DEVELOPER_IDENTITY_INPUT.members[ - "DeveloperUserIdentifier" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UNLINK_DEVELOPER_IDENTITY_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UnlinkDeveloperIdentityOutput: - """Dataclass for UnlinkDeveloperIdentityOutput structure.""" +CREATE_IDENTITY_POOL: APIOperation[ + CreateIdentityPoolInput, CreateIdentityPoolOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_IDENTITY_POOL, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cognitoidentity#InternalErrorException"), + ShapeID("com.amazonaws.cognitoidentity#InvalidParameterException"), + ShapeID("com.amazonaws.cognitoidentity#LimitExceededException"), + ShapeID("com.amazonaws.cognitoidentity#NotAuthorizedException"), + ShapeID("com.amazonaws.cognitoidentity#ResourceConflictException"), + ShapeID("com.amazonaws.cognitoidentity#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False +DELETE_IDENTITIES: APIOperation[DeleteIdentitiesInput, DeleteIdentitiesOutput] = ( + APIOperation( + static_schema=_SCHEMA_DELETE_IDENTITIES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cognitoidentity#InternalErrorException"), + ShapeID("com.amazonaws.cognitoidentity#InvalidParameterException"), + ShapeID("com.amazonaws.cognitoidentity#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNLINK_DEVELOPER_IDENTITY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UNLINK_DEVELOPER_IDENTITY_OUTPUT, consumer=_consumer - ) - return kwargs - +) -UNLINK_DEVELOPER_IDENTITY = APIOperation( - input=UnlinkDeveloperIdentityInput, - output=UnlinkDeveloperIdentityOutput, - schema=_SCHEMA_UNLINK_DEVELOPER_IDENTITY, - input_schema=_SCHEMA_UNLINK_DEVELOPER_IDENTITY_INPUT, - output_schema=_SCHEMA_UNLINK_DEVELOPER_IDENTITY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cognitoidentity#InternalErrorException" - ): InternalErrorException, - ShapeID( - "com.amazonaws.cognitoidentity#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cognitoidentity#NotAuthorizedException" - ): NotAuthorizedException, - ShapeID( - "com.amazonaws.cognitoidentity#ResourceConflictException" - ): ResourceConflictException, - ShapeID( - "com.amazonaws.cognitoidentity#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.cognitoidentity#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_NOT_AUTHORIZED_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, +DELETE_IDENTITY_POOL: APIOperation[ + DeleteIdentityPoolInput, DeleteIdentityPoolOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_IDENTITY_POOL, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cognitoidentity#InternalErrorException"), + ShapeID("com.amazonaws.cognitoidentity#InvalidParameterException"), + ShapeID("com.amazonaws.cognitoidentity#NotAuthorizedException"), + ShapeID("com.amazonaws.cognitoidentity#ResourceNotFoundException"), + ShapeID("com.amazonaws.cognitoidentity#TooManyRequestsException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) - -@dataclass(kw_only=True) -class UnlinkIdentityInput: - """Input to the UnlinkIdentity action.""" - - identity_id: str | None = None - """A unique identifier in the format REGION:GUID.""" - - logins: dict[str, str] | None = None - """ - A set of optional name-value pairs that map provider names to provider - tokens. - """ - - logins_to_remove: list[str] | None = None - """Provider names to unlink from this identity.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNLINK_IDENTITY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.identity_id is not None: - serializer.write_string( - _SCHEMA_UNLINK_IDENTITY_INPUT.members["IdentityId"], self.identity_id - ) - - if self.logins is not None: - _serialize_logins_map( - serializer, _SCHEMA_UNLINK_IDENTITY_INPUT.members["Logins"], self.logins - ) - - if self.logins_to_remove is not None: - _serialize_logins_list( - serializer, - _SCHEMA_UNLINK_IDENTITY_INPUT.members["LoginsToRemove"], - self.logins_to_remove, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["identity_id"] = de.read_string( - _SCHEMA_UNLINK_IDENTITY_INPUT.members["IdentityId"] - ) - - case 1: - kwargs["logins"] = _deserialize_logins_map( - de, _SCHEMA_UNLINK_IDENTITY_INPUT.members["Logins"] - ) - - case 2: - kwargs["logins_to_remove"] = _deserialize_logins_list( - de, _SCHEMA_UNLINK_IDENTITY_INPUT.members["LoginsToRemove"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UNLINK_IDENTITY_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UnlinkIdentityOutput: - """Dataclass for UnlinkIdentityOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False +DESCRIBE_IDENTITY: APIOperation[DescribeIdentityInput, DescribeIdentityOutput] = ( + APIOperation( + static_schema=_SCHEMA_DESCRIBE_IDENTITY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cognitoidentity#InternalErrorException"), + ShapeID("com.amazonaws.cognitoidentity#InvalidParameterException"), + ShapeID("com.amazonaws.cognitoidentity#NotAuthorizedException"), + ShapeID("com.amazonaws.cognitoidentity#ResourceNotFoundException"), + ShapeID("com.amazonaws.cognitoidentity#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNLINK_IDENTITY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UNLINK_IDENTITY_OUTPUT, consumer=_consumer) - return kwargs - +) -UNLINK_IDENTITY = APIOperation( - input=UnlinkIdentityInput, - output=UnlinkIdentityOutput, - schema=_SCHEMA_UNLINK_IDENTITY, - input_schema=_SCHEMA_UNLINK_IDENTITY_INPUT, - output_schema=_SCHEMA_UNLINK_IDENTITY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cognitoidentity#ExternalServiceException" - ): ExternalServiceException, - ShapeID( - "com.amazonaws.cognitoidentity#InternalErrorException" - ): InternalErrorException, - ShapeID( - "com.amazonaws.cognitoidentity#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cognitoidentity#NotAuthorizedException" - ): NotAuthorizedException, - ShapeID( - "com.amazonaws.cognitoidentity#ResourceConflictException" - ): ResourceConflictException, - ShapeID( - "com.amazonaws.cognitoidentity#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.cognitoidentity#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("smithy.api#noAuth")], - error_schemas=[ - _SCHEMA_EXTERNAL_SERVICE_EXCEPTION, - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_NOT_AUTHORIZED_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, +DESCRIBE_IDENTITY_POOL: APIOperation[ + DescribeIdentityPoolInput, DescribeIdentityPoolOutput +] = APIOperation( + static_schema=_SCHEMA_DESCRIBE_IDENTITY_POOL, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cognitoidentity#InternalErrorException"), + ShapeID("com.amazonaws.cognitoidentity#InvalidParameterException"), + ShapeID("com.amazonaws.cognitoidentity#NotAuthorizedException"), + ShapeID("com.amazonaws.cognitoidentity#ResourceNotFoundException"), + ShapeID("com.amazonaws.cognitoidentity#TooManyRequestsException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) +GET_CREDENTIALS_FOR_IDENTITY: APIOperation[ + GetCredentialsForIdentityInput, GetCredentialsForIdentityOutput +] = APIOperation( + static_schema=_SCHEMA_GET_CREDENTIALS_FOR_IDENTITY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cognitoidentity#ExternalServiceException"), + ShapeID("com.amazonaws.cognitoidentity#InternalErrorException"), + ShapeID( + "com.amazonaws.cognitoidentity#InvalidIdentityPoolConfigurationException" + ), + ShapeID("com.amazonaws.cognitoidentity#InvalidParameterException"), + ShapeID("com.amazonaws.cognitoidentity#NotAuthorizedException"), + ShapeID("com.amazonaws.cognitoidentity#ResourceConflictException"), + ShapeID("com.amazonaws.cognitoidentity#ResourceNotFoundException"), + ShapeID("com.amazonaws.cognitoidentity#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("smithy.api#noAuth")], +) -def _serialize_identity_pool_tags_list_type( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_identity_pool_tags_list_type( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class UntagResourceInput: - """Dataclass for UntagResourceInput structure.""" - - resource_arn: str | None = None - """The Amazon Resource Name (ARN) of the identity pool.""" - - tag_keys: list[str] | None = None - """The keys of the tags to remove from the user pool.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNTAG_RESOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_UNTAG_RESOURCE_INPUT.members["ResourceArn"], self.resource_arn - ) - - if self.tag_keys is not None: - _serialize_identity_pool_tags_list_type( - serializer, - _SCHEMA_UNTAG_RESOURCE_INPUT.members["TagKeys"], - self.tag_keys, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_UNTAG_RESOURCE_INPUT.members["ResourceArn"] - ) - - case 1: - kwargs["tag_keys"] = _deserialize_identity_pool_tags_list_type( - de, _SCHEMA_UNTAG_RESOURCE_INPUT.members["TagKeys"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UNTAG_RESOURCE_INPUT, consumer=_consumer) - return kwargs - +GET_ID: APIOperation[GetIdInput, GetIdOutput] = APIOperation( + static_schema=_SCHEMA_GET_ID, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cognitoidentity#ExternalServiceException"), + ShapeID("com.amazonaws.cognitoidentity#InternalErrorException"), + ShapeID("com.amazonaws.cognitoidentity#InvalidParameterException"), + ShapeID("com.amazonaws.cognitoidentity#LimitExceededException"), + ShapeID("com.amazonaws.cognitoidentity#NotAuthorizedException"), + ShapeID("com.amazonaws.cognitoidentity#ResourceConflictException"), + ShapeID("com.amazonaws.cognitoidentity#ResourceNotFoundException"), + ShapeID("com.amazonaws.cognitoidentity#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("smithy.api#noAuth")], +) -@dataclass(kw_only=True) -class UntagResourceOutput: - """Dataclass for UntagResourceOutput structure.""" +GET_IDENTITY_POOL_ROLES: APIOperation[ + GetIdentityPoolRolesInput, GetIdentityPoolRolesOutput +] = APIOperation( + static_schema=_SCHEMA_GET_IDENTITY_POOL_ROLES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cognitoidentity#InternalErrorException"), + ShapeID("com.amazonaws.cognitoidentity#InvalidParameterException"), + ShapeID("com.amazonaws.cognitoidentity#NotAuthorizedException"), + ShapeID("com.amazonaws.cognitoidentity#ResourceConflictException"), + ShapeID("com.amazonaws.cognitoidentity#ResourceNotFoundException"), + ShapeID("com.amazonaws.cognitoidentity#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False +GET_OPEN_ID_TOKEN: APIOperation[GetOpenIdTokenInput, GetOpenIdTokenOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_OPEN_ID_TOKEN, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cognitoidentity#ExternalServiceException"), + ShapeID("com.amazonaws.cognitoidentity#InternalErrorException"), + ShapeID("com.amazonaws.cognitoidentity#InvalidParameterException"), + ShapeID("com.amazonaws.cognitoidentity#NotAuthorizedException"), + ShapeID("com.amazonaws.cognitoidentity#ResourceConflictException"), + ShapeID("com.amazonaws.cognitoidentity#ResourceNotFoundException"), + ShapeID("com.amazonaws.cognitoidentity#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("smithy.api#noAuth")], ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNTAG_RESOURCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UNTAG_RESOURCE_OUTPUT, consumer=_consumer) - return kwargs - +) -UNTAG_RESOURCE = APIOperation( - input=UntagResourceInput, - output=UntagResourceOutput, - schema=_SCHEMA_UNTAG_RESOURCE, - input_schema=_SCHEMA_UNTAG_RESOURCE_INPUT, - output_schema=_SCHEMA_UNTAG_RESOURCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cognitoidentity#InternalErrorException" - ): InternalErrorException, - ShapeID( - "com.amazonaws.cognitoidentity#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cognitoidentity#NotAuthorizedException" - ): NotAuthorizedException, - ShapeID( - "com.amazonaws.cognitoidentity#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.cognitoidentity#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_NOT_AUTHORIZED_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, +GET_OPEN_ID_TOKEN_FOR_DEVELOPER_IDENTITY: APIOperation[ + GetOpenIdTokenForDeveloperIdentityInput, GetOpenIdTokenForDeveloperIdentityOutput +] = APIOperation( + static_schema=_SCHEMA_GET_OPEN_ID_TOKEN_FOR_DEVELOPER_IDENTITY, + model_registry=_registry, + error_ids=[ + ShapeID( + "com.amazonaws.cognitoidentity#DeveloperUserAlreadyRegisteredException" + ), + ShapeID("com.amazonaws.cognitoidentity#InternalErrorException"), + ShapeID("com.amazonaws.cognitoidentity#InvalidParameterException"), + ShapeID("com.amazonaws.cognitoidentity#NotAuthorizedException"), + ShapeID("com.amazonaws.cognitoidentity#ResourceConflictException"), + ShapeID("com.amazonaws.cognitoidentity#ResourceNotFoundException"), + ShapeID("com.amazonaws.cognitoidentity#TooManyRequestsException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) +GET_PRINCIPAL_TAG_ATTRIBUTE_MAP: APIOperation[ + GetPrincipalTagAttributeMapInput, GetPrincipalTagAttributeMapOutput +] = APIOperation( + static_schema=_SCHEMA_GET_PRINCIPAL_TAG_ATTRIBUTE_MAP, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cognitoidentity#InternalErrorException"), + ShapeID("com.amazonaws.cognitoidentity#InvalidParameterException"), + ShapeID("com.amazonaws.cognitoidentity#NotAuthorizedException"), + ShapeID("com.amazonaws.cognitoidentity#ResourceNotFoundException"), + ShapeID("com.amazonaws.cognitoidentity#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -@dataclass(kw_only=True) -class UpdateIdentityPoolInput: - """An object representing an Amazon Cognito identity pool.""" - - identity_pool_id: str | None = None - """An identity pool ID in the format REGION:GUID.""" - - identity_pool_name: str | None = None - """A string that you provide.""" - - allow_unauthenticated_identities: bool = False - """TRUE if the identity pool supports unauthenticated logins.""" - - allow_classic_flow: bool | None = None - """ - Enables or disables the Basic (Classic) authentication flow. For more - information, see [Identity Pools (Federated Identities) Authentication - Flow](https://docs.aws.amazon.com/cognito/latest/developerguide/authentication-flow.html) - in the *Amazon Cognito Developer Guide*. - """ - - supported_login_providers: dict[str, str] | None = None - """Optional key:value pairs mapping provider names to provider app IDs.""" - - developer_provider_name: str | None = None - """The \"domain\" by which Cognito will refer to your users.""" - - open_id_connect_provider_ar_ns: list[str] | None = None - """The ARNs of the OpenID Connect providers.""" - - cognito_identity_providers: list[CognitoIdentityProvider] | None = None - """A list representing an Amazon Cognito user pool and its client ID.""" - - saml_provider_ar_ns: list[str] | None = None - """ - An array of Amazon Resource Names (ARNs) of the SAML provider for your - identity pool. - """ - - identity_pool_tags: dict[str, str] | None = None - """ - The tags that are assigned to the identity pool. A tag is a label that - you can apply to identity pools to categorize and manage them in - different ways, such as by purpose, owner, environment, or other - criteria. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_IDENTITY_POOL_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.identity_pool_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_IDENTITY_POOL_INPUT.members["IdentityPoolId"], - self.identity_pool_id, - ) - - if self.identity_pool_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_IDENTITY_POOL_INPUT.members["IdentityPoolName"], - self.identity_pool_name, - ) - - if self.allow_unauthenticated_identities is not None: - serializer.write_boolean( - _SCHEMA_UPDATE_IDENTITY_POOL_INPUT.members[ - "AllowUnauthenticatedIdentities" - ], - self.allow_unauthenticated_identities, - ) - - if self.allow_classic_flow is not None: - serializer.write_boolean( - _SCHEMA_UPDATE_IDENTITY_POOL_INPUT.members["AllowClassicFlow"], - self.allow_classic_flow, - ) - - if self.supported_login_providers is not None: - _serialize_identity_providers( - serializer, - _SCHEMA_UPDATE_IDENTITY_POOL_INPUT.members["SupportedLoginProviders"], - self.supported_login_providers, - ) - - if self.developer_provider_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_IDENTITY_POOL_INPUT.members["DeveloperProviderName"], - self.developer_provider_name, - ) - - if self.open_id_connect_provider_ar_ns is not None: - _serialize_oidc_provider_list( - serializer, - _SCHEMA_UPDATE_IDENTITY_POOL_INPUT.members["OpenIdConnectProviderARNs"], - self.open_id_connect_provider_ar_ns, - ) - - if self.cognito_identity_providers is not None: - _serialize_cognito_identity_provider_list( - serializer, - _SCHEMA_UPDATE_IDENTITY_POOL_INPUT.members["CognitoIdentityProviders"], - self.cognito_identity_providers, - ) - - if self.saml_provider_ar_ns is not None: - _serialize_saml_provider_list( - serializer, - _SCHEMA_UPDATE_IDENTITY_POOL_INPUT.members["SamlProviderARNs"], - self.saml_provider_ar_ns, - ) - - if self.identity_pool_tags is not None: - _serialize_identity_pool_tags_type( - serializer, - _SCHEMA_UPDATE_IDENTITY_POOL_INPUT.members["IdentityPoolTags"], - self.identity_pool_tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["identity_pool_id"] = de.read_string( - _SCHEMA_UPDATE_IDENTITY_POOL_INPUT.members["IdentityPoolId"] - ) - - case 1: - kwargs["identity_pool_name"] = de.read_string( - _SCHEMA_UPDATE_IDENTITY_POOL_INPUT.members["IdentityPoolName"] - ) - - case 2: - kwargs["allow_unauthenticated_identities"] = de.read_boolean( - _SCHEMA_UPDATE_IDENTITY_POOL_INPUT.members[ - "AllowUnauthenticatedIdentities" - ] - ) - - case 3: - kwargs["allow_classic_flow"] = de.read_boolean( - _SCHEMA_UPDATE_IDENTITY_POOL_INPUT.members["AllowClassicFlow"] - ) - - case 4: - kwargs["supported_login_providers"] = ( - _deserialize_identity_providers( - de, - _SCHEMA_UPDATE_IDENTITY_POOL_INPUT.members[ - "SupportedLoginProviders" - ], - ) - ) - - case 5: - kwargs["developer_provider_name"] = de.read_string( - _SCHEMA_UPDATE_IDENTITY_POOL_INPUT.members[ - "DeveloperProviderName" - ] - ) - - case 6: - kwargs["open_id_connect_provider_ar_ns"] = ( - _deserialize_oidc_provider_list( - de, - _SCHEMA_UPDATE_IDENTITY_POOL_INPUT.members[ - "OpenIdConnectProviderARNs" - ], - ) - ) - - case 7: - kwargs["cognito_identity_providers"] = ( - _deserialize_cognito_identity_provider_list( - de, - _SCHEMA_UPDATE_IDENTITY_POOL_INPUT.members[ - "CognitoIdentityProviders" - ], - ) - ) - - case 8: - kwargs["saml_provider_ar_ns"] = _deserialize_saml_provider_list( - de, - _SCHEMA_UPDATE_IDENTITY_POOL_INPUT.members["SamlProviderARNs"], - ) - - case 9: - kwargs["identity_pool_tags"] = _deserialize_identity_pool_tags_type( - de, - _SCHEMA_UPDATE_IDENTITY_POOL_INPUT.members["IdentityPoolTags"], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_IDENTITY_POOL_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateIdentityPoolOutput: - """An object representing an Amazon Cognito identity pool.""" - - identity_pool_id: str - """An identity pool ID in the format REGION:GUID.""" - - identity_pool_name: str - """A string that you provide.""" - - allow_unauthenticated_identities: bool = False - """TRUE if the identity pool supports unauthenticated logins.""" - - allow_classic_flow: bool | None = None - """ - Enables or disables the Basic (Classic) authentication flow. For more - information, see [Identity Pools (Federated Identities) Authentication - Flow](https://docs.aws.amazon.com/cognito/latest/developerguide/authentication-flow.html) - in the *Amazon Cognito Developer Guide*. - """ - - supported_login_providers: dict[str, str] | None = None - """Optional key:value pairs mapping provider names to provider app IDs.""" - - developer_provider_name: str | None = None - """The \"domain\" by which Cognito will refer to your users.""" - - open_id_connect_provider_ar_ns: list[str] | None = None - """The ARNs of the OpenID Connect providers.""" - - cognito_identity_providers: list[CognitoIdentityProvider] | None = None - """A list representing an Amazon Cognito user pool and its client ID.""" - - saml_provider_ar_ns: list[str] | None = None - """ - An array of Amazon Resource Names (ARNs) of the SAML provider for your - identity pool. - """ - - identity_pool_tags: dict[str, str] | None = None - """ - The tags that are assigned to the identity pool. A tag is a label that - you can apply to identity pools to categorize and manage them in - different ways, such as by purpose, owner, environment, or other - criteria. - """ +LIST_IDENTITIES: APIOperation[ListIdentitiesInput, ListIdentitiesOutput] = APIOperation( + static_schema=_SCHEMA_LIST_IDENTITIES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cognitoidentity#InternalErrorException"), + ShapeID("com.amazonaws.cognitoidentity#InvalidParameterException"), + ShapeID("com.amazonaws.cognitoidentity#NotAuthorizedException"), + ShapeID("com.amazonaws.cognitoidentity#ResourceNotFoundException"), + ShapeID("com.amazonaws.cognitoidentity#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False +LIST_IDENTITY_POOLS: APIOperation[ListIdentityPoolsInput, ListIdentityPoolsOutput] = ( + APIOperation( + static_schema=_SCHEMA_LIST_IDENTITY_POOLS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cognitoidentity#InternalErrorException"), + ShapeID("com.amazonaws.cognitoidentity#InvalidParameterException"), + ShapeID("com.amazonaws.cognitoidentity#NotAuthorizedException"), + ShapeID("com.amazonaws.cognitoidentity#ResourceNotFoundException"), + ShapeID("com.amazonaws.cognitoidentity#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_IDENTITY_POOL_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_UPDATE_IDENTITY_POOL_OUTPUT.members["IdentityPoolId"], - self.identity_pool_id, - ) - serializer.write_string( - _SCHEMA_UPDATE_IDENTITY_POOL_OUTPUT.members["IdentityPoolName"], - self.identity_pool_name, - ) - serializer.write_boolean( - _SCHEMA_UPDATE_IDENTITY_POOL_OUTPUT.members[ - "AllowUnauthenticatedIdentities" - ], - self.allow_unauthenticated_identities, - ) - if self.allow_classic_flow is not None: - serializer.write_boolean( - _SCHEMA_UPDATE_IDENTITY_POOL_OUTPUT.members["AllowClassicFlow"], - self.allow_classic_flow, - ) - - if self.supported_login_providers is not None: - _serialize_identity_providers( - serializer, - _SCHEMA_UPDATE_IDENTITY_POOL_OUTPUT.members["SupportedLoginProviders"], - self.supported_login_providers, - ) - - if self.developer_provider_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_IDENTITY_POOL_OUTPUT.members["DeveloperProviderName"], - self.developer_provider_name, - ) - - if self.open_id_connect_provider_ar_ns is not None: - _serialize_oidc_provider_list( - serializer, - _SCHEMA_UPDATE_IDENTITY_POOL_OUTPUT.members[ - "OpenIdConnectProviderARNs" - ], - self.open_id_connect_provider_ar_ns, - ) - - if self.cognito_identity_providers is not None: - _serialize_cognito_identity_provider_list( - serializer, - _SCHEMA_UPDATE_IDENTITY_POOL_OUTPUT.members["CognitoIdentityProviders"], - self.cognito_identity_providers, - ) - - if self.saml_provider_ar_ns is not None: - _serialize_saml_provider_list( - serializer, - _SCHEMA_UPDATE_IDENTITY_POOL_OUTPUT.members["SamlProviderARNs"], - self.saml_provider_ar_ns, - ) - - if self.identity_pool_tags is not None: - _serialize_identity_pool_tags_type( - serializer, - _SCHEMA_UPDATE_IDENTITY_POOL_OUTPUT.members["IdentityPoolTags"], - self.identity_pool_tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["identity_pool_id"] = de.read_string( - _SCHEMA_UPDATE_IDENTITY_POOL_OUTPUT.members["IdentityPoolId"] - ) - - case 1: - kwargs["identity_pool_name"] = de.read_string( - _SCHEMA_UPDATE_IDENTITY_POOL_OUTPUT.members["IdentityPoolName"] - ) - - case 2: - kwargs["allow_unauthenticated_identities"] = de.read_boolean( - _SCHEMA_UPDATE_IDENTITY_POOL_OUTPUT.members[ - "AllowUnauthenticatedIdentities" - ] - ) - - case 3: - kwargs["allow_classic_flow"] = de.read_boolean( - _SCHEMA_UPDATE_IDENTITY_POOL_OUTPUT.members["AllowClassicFlow"] - ) - - case 4: - kwargs["supported_login_providers"] = ( - _deserialize_identity_providers( - de, - _SCHEMA_UPDATE_IDENTITY_POOL_OUTPUT.members[ - "SupportedLoginProviders" - ], - ) - ) +) - case 5: - kwargs["developer_provider_name"] = de.read_string( - _SCHEMA_UPDATE_IDENTITY_POOL_OUTPUT.members[ - "DeveloperProviderName" - ] - ) +LIST_TAGS_FOR_RESOURCE: APIOperation[ + ListTagsForResourceInput, ListTagsForResourceOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_TAGS_FOR_RESOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cognitoidentity#InternalErrorException"), + ShapeID("com.amazonaws.cognitoidentity#InvalidParameterException"), + ShapeID("com.amazonaws.cognitoidentity#NotAuthorizedException"), + ShapeID("com.amazonaws.cognitoidentity#ResourceNotFoundException"), + ShapeID("com.amazonaws.cognitoidentity#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 6: - kwargs["open_id_connect_provider_ar_ns"] = ( - _deserialize_oidc_provider_list( - de, - _SCHEMA_UPDATE_IDENTITY_POOL_OUTPUT.members[ - "OpenIdConnectProviderARNs" - ], - ) - ) +LOOKUP_DEVELOPER_IDENTITY: APIOperation[ + LookupDeveloperIdentityInput, LookupDeveloperIdentityOutput +] = APIOperation( + static_schema=_SCHEMA_LOOKUP_DEVELOPER_IDENTITY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cognitoidentity#InternalErrorException"), + ShapeID("com.amazonaws.cognitoidentity#InvalidParameterException"), + ShapeID("com.amazonaws.cognitoidentity#NotAuthorizedException"), + ShapeID("com.amazonaws.cognitoidentity#ResourceConflictException"), + ShapeID("com.amazonaws.cognitoidentity#ResourceNotFoundException"), + ShapeID("com.amazonaws.cognitoidentity#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 7: - kwargs["cognito_identity_providers"] = ( - _deserialize_cognito_identity_provider_list( - de, - _SCHEMA_UPDATE_IDENTITY_POOL_OUTPUT.members[ - "CognitoIdentityProviders" - ], - ) - ) +MERGE_DEVELOPER_IDENTITIES: APIOperation[ + MergeDeveloperIdentitiesInput, MergeDeveloperIdentitiesOutput +] = APIOperation( + static_schema=_SCHEMA_MERGE_DEVELOPER_IDENTITIES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cognitoidentity#InternalErrorException"), + ShapeID("com.amazonaws.cognitoidentity#InvalidParameterException"), + ShapeID("com.amazonaws.cognitoidentity#NotAuthorizedException"), + ShapeID("com.amazonaws.cognitoidentity#ResourceConflictException"), + ShapeID("com.amazonaws.cognitoidentity#ResourceNotFoundException"), + ShapeID("com.amazonaws.cognitoidentity#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 8: - kwargs["saml_provider_ar_ns"] = _deserialize_saml_provider_list( - de, - _SCHEMA_UPDATE_IDENTITY_POOL_OUTPUT.members["SamlProviderARNs"], - ) +SET_IDENTITY_POOL_ROLES: APIOperation[ + SetIdentityPoolRolesInput, SetIdentityPoolRolesOutput +] = APIOperation( + static_schema=_SCHEMA_SET_IDENTITY_POOL_ROLES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cognitoidentity#ConcurrentModificationException"), + ShapeID("com.amazonaws.cognitoidentity#InternalErrorException"), + ShapeID("com.amazonaws.cognitoidentity#InvalidParameterException"), + ShapeID("com.amazonaws.cognitoidentity#NotAuthorizedException"), + ShapeID("com.amazonaws.cognitoidentity#ResourceConflictException"), + ShapeID("com.amazonaws.cognitoidentity#ResourceNotFoundException"), + ShapeID("com.amazonaws.cognitoidentity#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 9: - kwargs["identity_pool_tags"] = _deserialize_identity_pool_tags_type( - de, - _SCHEMA_UPDATE_IDENTITY_POOL_OUTPUT.members["IdentityPoolTags"], - ) +SET_PRINCIPAL_TAG_ATTRIBUTE_MAP: APIOperation[ + SetPrincipalTagAttributeMapInput, SetPrincipalTagAttributeMapOutput +] = APIOperation( + static_schema=_SCHEMA_SET_PRINCIPAL_TAG_ATTRIBUTE_MAP, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cognitoidentity#InternalErrorException"), + ShapeID("com.amazonaws.cognitoidentity#InvalidParameterException"), + ShapeID("com.amazonaws.cognitoidentity#NotAuthorizedException"), + ShapeID("com.amazonaws.cognitoidentity#ResourceNotFoundException"), + ShapeID("com.amazonaws.cognitoidentity#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case _: - logger.debug("Unexpected member schema: %s", schema) +TAG_RESOURCE: APIOperation[TagResourceInput, TagResourceOutput] = APIOperation( + static_schema=_SCHEMA_TAG_RESOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cognitoidentity#InternalErrorException"), + ShapeID("com.amazonaws.cognitoidentity#InvalidParameterException"), + ShapeID("com.amazonaws.cognitoidentity#NotAuthorizedException"), + ShapeID("com.amazonaws.cognitoidentity#ResourceNotFoundException"), + ShapeID("com.amazonaws.cognitoidentity#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - deserializer.read_struct( - _SCHEMA_UPDATE_IDENTITY_POOL_OUTPUT, consumer=_consumer - ) - if "identity_pool_id" not in kwargs: - kwargs["identity_pool_id"] = "" - if "identity_pool_name" not in kwargs: - kwargs["identity_pool_name"] = "" - return kwargs +UNLINK_DEVELOPER_IDENTITY: APIOperation[ + UnlinkDeveloperIdentityInput, UnlinkDeveloperIdentityOutput +] = APIOperation( + static_schema=_SCHEMA_UNLINK_DEVELOPER_IDENTITY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cognitoidentity#InternalErrorException"), + ShapeID("com.amazonaws.cognitoidentity#InvalidParameterException"), + ShapeID("com.amazonaws.cognitoidentity#NotAuthorizedException"), + ShapeID("com.amazonaws.cognitoidentity#ResourceConflictException"), + ShapeID("com.amazonaws.cognitoidentity#ResourceNotFoundException"), + ShapeID("com.amazonaws.cognitoidentity#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +UNLINK_IDENTITY: APIOperation[UnlinkIdentityInput, UnlinkIdentityOutput] = APIOperation( + static_schema=_SCHEMA_UNLINK_IDENTITY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cognitoidentity#ExternalServiceException"), + ShapeID("com.amazonaws.cognitoidentity#InternalErrorException"), + ShapeID("com.amazonaws.cognitoidentity#InvalidParameterException"), + ShapeID("com.amazonaws.cognitoidentity#NotAuthorizedException"), + ShapeID("com.amazonaws.cognitoidentity#ResourceConflictException"), + ShapeID("com.amazonaws.cognitoidentity#ResourceNotFoundException"), + ShapeID("com.amazonaws.cognitoidentity#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("smithy.api#noAuth")], +) -UPDATE_IDENTITY_POOL = APIOperation( - input=UpdateIdentityPoolInput, - output=UpdateIdentityPoolOutput, - schema=_SCHEMA_UPDATE_IDENTITY_POOL, - input_schema=_SCHEMA_UPDATE_IDENTITY_POOL_INPUT, - output_schema=_SCHEMA_UPDATE_IDENTITY_POOL_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.cognitoidentity#ConcurrentModificationException" - ): ConcurrentModificationException, - ShapeID( - "com.amazonaws.cognitoidentity#InternalErrorException" - ): InternalErrorException, - ShapeID( - "com.amazonaws.cognitoidentity#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.cognitoidentity#LimitExceededException" - ): LimitExceededException, - ShapeID( - "com.amazonaws.cognitoidentity#NotAuthorizedException" - ): NotAuthorizedException, - ShapeID( - "com.amazonaws.cognitoidentity#ResourceConflictException" - ): ResourceConflictException, - ShapeID( - "com.amazonaws.cognitoidentity#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.cognitoidentity#TooManyRequestsException" - ): TooManyRequestsException, - } - ), +UNTAG_RESOURCE: APIOperation[UntagResourceInput, UntagResourceOutput] = APIOperation( + static_schema=_SCHEMA_UNTAG_RESOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cognitoidentity#InternalErrorException"), + ShapeID("com.amazonaws.cognitoidentity#InvalidParameterException"), + ShapeID("com.amazonaws.cognitoidentity#NotAuthorizedException"), + ShapeID("com.amazonaws.cognitoidentity#ResourceNotFoundException"), + ShapeID("com.amazonaws.cognitoidentity#TooManyRequestsException"), + ], effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CONCURRENT_MODIFICATION_EXCEPTION, - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_NOT_AUTHORIZED_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, +) + +UPDATE_IDENTITY_POOL: APIOperation[ + UpdateIdentityPoolInput, UpdateIdentityPoolOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_IDENTITY_POOL, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.cognitoidentity#ConcurrentModificationException"), + ShapeID("com.amazonaws.cognitoidentity#InternalErrorException"), + ShapeID("com.amazonaws.cognitoidentity#InvalidParameterException"), + ShapeID("com.amazonaws.cognitoidentity#LimitExceededException"), + ShapeID("com.amazonaws.cognitoidentity#NotAuthorizedException"), + ShapeID("com.amazonaws.cognitoidentity#ResourceConflictException"), + ShapeID("com.amazonaws.cognitoidentity#ResourceNotFoundException"), + ShapeID("com.amazonaws.cognitoidentity#TooManyRequestsException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) diff --git a/clients/aws-sdk-cognito-identity/src/aws_sdk_cognito_identity/models.pyi b/clients/aws-sdk-cognito-identity/src/aws_sdk_cognito_identity/models.pyi new file mode 100644 index 00000000..63fa28de --- /dev/null +++ b/clients/aws-sdk-cognito-identity/src/aws_sdk_cognito_identity/models.pyi @@ -0,0 +1,1289 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. + +from dataclasses import dataclass +from datetime import datetime +from enum import StrEnum +from typing import Self + +from smithy_core.deserializers import ShapeDeserializer +from smithy_core.exceptions import ModeledError +from smithy_core.response import ResponseMetadata +from smithy_core.schemas import APIOperation +from smithy_core.serializers import ShapeSerializer +from smithy_core.types import UnknownEnumMixin + +class _SerdeShape: + def serialize(self, serializer: ShapeSerializer) -> None: ... + def serialize_members(self, serializer: ShapeSerializer) -> None: ... + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: ... + +class ServiceError(ModeledError): + """ + Base error for all errors in the service. + + Some exceptions do not extend from this class, including + synthetic, implicit, and shared exception types. + """ + +class AmbiguousRoleResolutionType(UnknownEnumMixin, StrEnum): + AUTHENTICATED_ROLE = "AuthenticatedRole" + DENY = "Deny" + +@dataclass(kw_only=True) +class CognitoIdentityProvider(_SerdeShape): + """A provider representing an Amazon Cognito user pool and its client ID.""" + + provider_name: str | None = ... + """ + The provider name for an Amazon Cognito user pool. For example, + `cognito-idp.us-east-1.amazonaws.com/us-east-1_123456789`. + """ + client_id: str | None = ... + """The client ID for the Amazon Cognito user pool.""" + server_side_token_check: bool | None = ... + """ + TRUE if server-side token validation is enabled for the identity + provider's token. + + Once you set `ServerSideTokenCheck` to TRUE for an identity pool, that + identity pool will check with the integrated user pools to make sure + that the user has not been globally signed out or deleted before the + identity pool provides an OIDC token or Amazon Web Services credentials + for the user. + + If the user is signed out or deleted, the identity pool will return a + 400 Not Authorized error. + """ + +@dataclass(kw_only=True) +class ConcurrentModificationException(ServiceError, _SerdeShape): + """Thrown if there are parallel requests to modify a resource.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateIdentityPoolInput(_SerdeShape): + """Input to the CreateIdentityPool action.""" + + identity_pool_name: str | None = ... + """A string that you provide.""" + allow_unauthenticated_identities: bool = ... + """TRUE if the identity pool supports unauthenticated logins.""" + allow_classic_flow: bool | None = ... + """ + Enables or disables the Basic (Classic) authentication flow. For more + information, see [Identity Pools (Federated Identities) Authentication + Flow](https://docs.aws.amazon.com/cognito/latest/developerguide/authentication-flow.html) + in the *Amazon Cognito Developer Guide*. + """ + supported_login_providers: dict[str, str] | None = ... + """Optional key:value pairs mapping provider names to provider app IDs.""" + developer_provider_name: str | None = ... + """ + The \"domain\" by which Cognito will refer to your users. This name acts + as a placeholder that allows your backend and the Cognito service to + communicate about the developer provider. For the + `DeveloperProviderName`, you can use letters as well as period (`.`), + underscore (`_`), and dash (`-`). + + Once you have set a developer provider name, you cannot change it. + Please take care in setting this parameter. + """ + open_id_connect_provider_ar_ns: list[str] | None = ... + """The Amazon Resource Names (ARN) of the OpenID Connect providers.""" + cognito_identity_providers: list[CognitoIdentityProvider] | None = ... + """An array of Amazon Cognito user pools and their client IDs.""" + saml_provider_ar_ns: list[str] | None = ... + """ + An array of Amazon Resource Names (ARNs) of the SAML provider for your + identity pool. + """ + identity_pool_tags: dict[str, str] | None = ... + """ + Tags to assign to the identity pool. A tag is a label that you can apply + to identity pools to categorize and manage them in different ways, such + as by purpose, owner, environment, or other criteria. + """ + +@dataclass(kw_only=True) +class CreateIdentityPoolOutput(_SerdeShape): + """An object representing an Amazon Cognito identity pool.""" + + identity_pool_id: str + """An identity pool ID in the format REGION:GUID.""" + identity_pool_name: str + """A string that you provide.""" + allow_unauthenticated_identities: bool = ... + """TRUE if the identity pool supports unauthenticated logins.""" + allow_classic_flow: bool | None = ... + """ + Enables or disables the Basic (Classic) authentication flow. For more + information, see [Identity Pools (Federated Identities) Authentication + Flow](https://docs.aws.amazon.com/cognito/latest/developerguide/authentication-flow.html) + in the *Amazon Cognito Developer Guide*. + """ + supported_login_providers: dict[str, str] | None = ... + """Optional key:value pairs mapping provider names to provider app IDs.""" + developer_provider_name: str | None = ... + """The \"domain\" by which Cognito will refer to your users.""" + open_id_connect_provider_ar_ns: list[str] | None = ... + """The ARNs of the OpenID Connect providers.""" + cognito_identity_providers: list[CognitoIdentityProvider] | None = ... + """A list representing an Amazon Cognito user pool and its client ID.""" + saml_provider_ar_ns: list[str] | None = ... + """ + An array of Amazon Resource Names (ARNs) of the SAML provider for your + identity pool. + """ + identity_pool_tags: dict[str, str] | None = ... + """ + The tags that are assigned to the identity pool. A tag is a label that + you can apply to identity pools to categorize and manage them in + different ways, such as by purpose, owner, environment, or other + criteria. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class Credentials(_SerdeShape): + """Credentials for the provided identity ID.""" + + access_key_id: str | None = ... + """The Access Key portion of the credentials.""" + secret_key: str | None = ... + """The Secret Access Key portion of the credentials""" + session_token: str | None = ... + """The Session Token portion of the credentials""" + expiration: datetime | None = ... + """The date at which these credentials will expire.""" + +@dataclass(kw_only=True) +class DeleteIdentitiesInput(_SerdeShape): + """Input to the `DeleteIdentities` action.""" + + identity_ids_to_delete: list[str] | None = ... + """A list of 1-60 identities that you want to delete.""" + +@dataclass(kw_only=True) +class DeleteIdentitiesOutput(_SerdeShape): + """Returned in response to a successful `DeleteIdentities` operation.""" + + unprocessed_identity_ids: list[UnprocessedIdentityId] | None = ... + """ + An array of UnprocessedIdentityId objects, each of which contains an + ErrorCode and IdentityId. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteIdentityPoolInput(_SerdeShape): + """Input to the DeleteIdentityPool action.""" + + identity_pool_id: str | None = ... + """An identity pool ID in the format REGION:GUID.""" + +@dataclass(kw_only=True) +class DeleteIdentityPoolOutput(_SerdeShape): + """Dataclass for DeleteIdentityPoolOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DescribeIdentityInput(_SerdeShape): + """Input to the `DescribeIdentity` action.""" + + identity_id: str | None = ... + """A unique identifier in the format REGION:GUID.""" + +@dataclass(kw_only=True) +class DescribeIdentityOutput(_SerdeShape): + """A description of the identity.""" + + identity_id: str | None = ... + """A unique identifier in the format REGION:GUID.""" + logins: list[str] | None = ... + """The provider names.""" + creation_date: datetime | None = ... + """Date on which the identity was created.""" + last_modified_date: datetime | None = ... + """Date on which the identity was last modified.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DescribeIdentityPoolInput(_SerdeShape): + """Input to the DescribeIdentityPool action.""" + + identity_pool_id: str | None = ... + """An identity pool ID in the format REGION:GUID.""" + +@dataclass(kw_only=True) +class DescribeIdentityPoolOutput(_SerdeShape): + """An object representing an Amazon Cognito identity pool.""" + + identity_pool_id: str + """An identity pool ID in the format REGION:GUID.""" + identity_pool_name: str + """A string that you provide.""" + allow_unauthenticated_identities: bool = ... + """TRUE if the identity pool supports unauthenticated logins.""" + allow_classic_flow: bool | None = ... + """ + Enables or disables the Basic (Classic) authentication flow. For more + information, see [Identity Pools (Federated Identities) Authentication + Flow](https://docs.aws.amazon.com/cognito/latest/developerguide/authentication-flow.html) + in the *Amazon Cognito Developer Guide*. + """ + supported_login_providers: dict[str, str] | None = ... + """Optional key:value pairs mapping provider names to provider app IDs.""" + developer_provider_name: str | None = ... + """The \"domain\" by which Cognito will refer to your users.""" + open_id_connect_provider_ar_ns: list[str] | None = ... + """The ARNs of the OpenID Connect providers.""" + cognito_identity_providers: list[CognitoIdentityProvider] | None = ... + """A list representing an Amazon Cognito user pool and its client ID.""" + saml_provider_ar_ns: list[str] | None = ... + """ + An array of Amazon Resource Names (ARNs) of the SAML provider for your + identity pool. + """ + identity_pool_tags: dict[str, str] | None = ... + """ + The tags that are assigned to the identity pool. A tag is a label that + you can apply to identity pools to categorize and manage them in + different ways, such as by purpose, owner, environment, or other + criteria. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeveloperUserAlreadyRegisteredException(ServiceError, _SerdeShape): + """ + The provided developer user identifier is already registered with + Cognito under a different identity ID. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class ErrorCode(UnknownEnumMixin, StrEnum): + ACCESS_DENIED = "AccessDenied" + INTERNAL_SERVER_ERROR = "InternalServerError" + +@dataclass(kw_only=True) +class ExternalServiceException(ServiceError, _SerdeShape): + """ + An exception thrown when a dependent service such as Facebook or Twitter + is not responding + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetCredentialsForIdentityInput(_SerdeShape): + """Input to the `GetCredentialsForIdentity` action.""" + + identity_id: str | None = ... + """A unique identifier in the format REGION:GUID.""" + logins: dict[str, str] | None = ... + """ + A set of optional name-value pairs that map provider names to provider + tokens. The name-value pair will follow the syntax \"provider_name\": + \"provider_user_identifier\". + + Logins should not be specified when trying to get credentials for an + unauthenticated identity. + + The Logins parameter is required when using identities associated with + external identity providers such as Facebook. For examples of `Logins` + maps, see the code examples in the [External Identity + Providers](https://docs.aws.amazon.com/cognito/latest/developerguide/external-identity-providers.html) + section of the Amazon Cognito Developer Guide. + """ + custom_role_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the role to be assumed when multiple + roles were received in the token from the identity provider. For + example, a SAML-based identity provider. This parameter is optional for + identity providers that do not support role customization. + """ + +@dataclass(kw_only=True) +class GetCredentialsForIdentityOutput(_SerdeShape): + """ + Returned in response to a successful `GetCredentialsForIdentity` + operation. + """ + + identity_id: str | None = ... + """A unique identifier in the format REGION:GUID.""" + credentials: Credentials | None = ... + """Credentials for the provided identity ID.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetIdentityPoolRolesInput(_SerdeShape): + """Input to the `GetIdentityPoolRoles` action.""" + + identity_pool_id: str | None = ... + """An identity pool ID in the format REGION:GUID.""" + +@dataclass(kw_only=True) +class GetIdentityPoolRolesOutput(_SerdeShape): + """Returned in response to a successful `GetIdentityPoolRoles` operation.""" + + identity_pool_id: str | None = ... + """An identity pool ID in the format REGION:GUID.""" + roles: dict[str, str] | None = ... + """ + The map of roles associated with this pool. Currently only authenticated + and unauthenticated roles are supported. + """ + role_mappings: dict[str, RoleMapping] | None = ... + """ + How users for a specific identity provider are to mapped to roles. This + is a String-to-RoleMapping object map. The string identifies the + identity provider, for example, `graph.facebook.com` or + `cognito-idp.us-east-1.amazonaws.com/us-east-1_abcdefghi:app_client_id`. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetIdInput(_SerdeShape): + """Input to the GetId action.""" + + account_id: str | None = ... + """A standard Amazon Web Services account ID (9+ digits).""" + identity_pool_id: str | None = ... + """An identity pool ID in the format REGION:GUID.""" + logins: dict[str, str] | None = ... + """ + A set of optional name-value pairs that map provider names to provider + tokens. The available provider names for `Logins` are as follows: + + - Facebook: `graph.facebook.com` + + - Amazon Cognito user pool: + `cognito-idp.```{=html}`.amazonaws.com/```{=html}, + for example, + `cognito-idp.us-east-1.amazonaws.com/us-east-1_123456789`. + + - Google: `accounts.google.com` + + - Amazon: `www.amazon.com` + + - Twitter: `api.twitter.com` + + - Digits: `www.digits.com` + """ + +@dataclass(kw_only=True) +class GetIdOutput(_SerdeShape): + """Returned in response to a GetId request.""" + + identity_id: str | None = ... + """A unique identifier in the format REGION:GUID.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetOpenIdTokenForDeveloperIdentityInput(_SerdeShape): + """Input to the `GetOpenIdTokenForDeveloperIdentity` action.""" + + identity_pool_id: str | None = ... + """An identity pool ID in the format REGION:GUID.""" + identity_id: str | None = ... + """A unique identifier in the format REGION:GUID.""" + logins: dict[str, str] | None = ... + """ + A set of optional name-value pairs that map provider names to provider + tokens. Each name-value pair represents a user from a public provider or + developer provider. If the user is from a developer provider, the + name-value pair will follow the syntax + `"developer_provider_name": "developer_user_identifier"`. The developer + provider is the \"domain\" by which Cognito will refer to your users; + you provided this domain while creating/updating the identity pool. The + developer user identifier is an identifier from your backend that + uniquely identifies a user. When you create an identity pool, you can + specify the supported logins. + """ + principal_tags: dict[str, str] | None = ... + """Use this operation to configure attribute mappings for custom providers.""" + token_duration: int | None = ... + """ + The expiration time of the token, in seconds. You can specify a custom + expiration time for the token so that you can cache it. If you don't + provide an expiration time, the token is valid for 15 minutes. You can + exchange the token with Amazon STS for temporary Amazon Web Services + credentials, which are valid for a maximum of one hour. The maximum + token duration you can set is 24 hours. You should take care in setting + the expiration time for a token, as there are significant security + implications: an attacker could use a leaked token to access your Amazon + Web Services resources for the token's duration. + + Note: + Please provide for a small grace period, usually no more than 5 minutes, + to account for clock skew. + """ + +@dataclass(kw_only=True) +class GetOpenIdTokenForDeveloperIdentityOutput(_SerdeShape): + """ + Returned in response to a successful + `GetOpenIdTokenForDeveloperIdentity` request. + """ + + identity_id: str | None = ... + """A unique identifier in the format REGION:GUID.""" + token: str | None = ... + """An OpenID token.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetOpenIdTokenInput(_SerdeShape): + """Input to the GetOpenIdToken action.""" + + identity_id: str | None = ... + """A unique identifier in the format REGION:GUID.""" + logins: dict[str, str] | None = ... + """ + A set of optional name-value pairs that map provider names to provider + tokens. When using graph.facebook.com and www.amazon.com, supply the + access_token returned from the provider's authflow. For + accounts.google.com, an Amazon Cognito user pool provider, or any other + OpenID Connect provider, always include the `id_token`. + """ + +@dataclass(kw_only=True) +class GetOpenIdTokenOutput(_SerdeShape): + """Returned in response to a successful GetOpenIdToken request.""" + + identity_id: str | None = ... + """ + A unique identifier in the format REGION:GUID. Note that the IdentityId + returned may not match the one passed on input. + """ + token: str | None = ... + """An OpenID token, valid for 10 minutes.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetPrincipalTagAttributeMapInput(_SerdeShape): + """Dataclass for GetPrincipalTagAttributeMapInput structure.""" + + identity_pool_id: str | None = ... + """ + You can use this operation to get the ID of the Identity Pool you setup + attribute mappings for. + """ + identity_provider_name: str | None = ... + """You can use this operation to get the provider name.""" + +@dataclass(kw_only=True) +class GetPrincipalTagAttributeMapOutput(_SerdeShape): + """Dataclass for GetPrincipalTagAttributeMapOutput structure.""" + + identity_pool_id: str | None = ... + """ + You can use this operation to get the ID of the Identity Pool you setup + attribute mappings for. + """ + identity_provider_name: str | None = ... + """You can use this operation to get the provider name.""" + use_defaults: bool | None = ... + """You can use this operation to list""" + principal_tags: dict[str, str] | None = ... + """ + You can use this operation to add principal tags. The + `PrincipalTags`operation enables you to reference user attributes in + your IAM permissions policy. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class IdentityDescription(_SerdeShape): + """A description of the identity.""" + + identity_id: str | None = ... + """A unique identifier in the format REGION:GUID.""" + logins: list[str] | None = ... + """The provider names.""" + creation_date: datetime | None = ... + """Date on which the identity was created.""" + last_modified_date: datetime | None = ... + """Date on which the identity was last modified.""" + +@dataclass(kw_only=True) +class IdentityPoolShortDescription(_SerdeShape): + """A description of the identity pool.""" + + identity_pool_id: str | None = ... + """An identity pool ID in the format REGION:GUID.""" + identity_pool_name: str | None = ... + """A string that you provide.""" + +@dataclass(kw_only=True) +class InternalErrorException(ServiceError, _SerdeShape): + """ + Thrown when the service encounters an error during processing the + request. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidIdentityPoolConfigurationException(ServiceError, _SerdeShape): + """ + If you provided authentication information in the request, the identity + pool has no authenticated role configured, or STS returned an error + response to the request to assume the authenticated role from the + identity pool. If you provided no authentication information in the + request, the identity pool has no unauthenticated role configured, or + STS returned an error response to the request to assume the + unauthenticated role from the identity pool. + + Your role trust policy must grant `AssumeRoleWithWebIdentity` + permissions to `cognito-identity.amazonaws.com`. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidParameterException(ServiceError, _SerdeShape): + """Thrown for missing or bad input parameter(s).""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class LimitExceededException(ServiceError, _SerdeShape): + """Thrown when the total number of user pools has exceeded a preset limit.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListIdentitiesInput(_SerdeShape): + """Input to the ListIdentities action.""" + + identity_pool_id: str | None = ... + """An identity pool ID in the format REGION:GUID.""" + max_results: int | None = ... + """The maximum number of identities to return.""" + next_token: str | None = ... + """A pagination token.""" + hide_disabled: bool = ... + """ + An optional boolean parameter that allows you to hide disabled + identities. If omitted, the ListIdentities API will include disabled + identities in the response. + """ + +@dataclass(kw_only=True) +class ListIdentitiesOutput(_SerdeShape): + """The response to a ListIdentities request.""" + + identity_pool_id: str | None = ... + """An identity pool ID in the format REGION:GUID.""" + identities: list[IdentityDescription] | None = ... + """An object containing a set of identities and associated mappings.""" + next_token: str | None = ... + """A pagination token.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListIdentityPoolsInput(_SerdeShape): + """Input to the ListIdentityPools action.""" + + max_results: int | None = ... + """The maximum number of identities to return.""" + next_token: str | None = ... + """A pagination token.""" + +@dataclass(kw_only=True) +class ListIdentityPoolsOutput(_SerdeShape): + """The result of a successful ListIdentityPools action.""" + + identity_pools: list[IdentityPoolShortDescription] | None = ... + """The identity pools returned by the ListIdentityPools action.""" + next_token: str | None = ... + """A pagination token.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListTagsForResourceInput(_SerdeShape): + """Dataclass for ListTagsForResourceInput structure.""" + + resource_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the identity pool that the tags are + assigned to. + """ + +@dataclass(kw_only=True) +class ListTagsForResourceOutput(_SerdeShape): + """Dataclass for ListTagsForResourceOutput structure.""" + + tags: dict[str, str] | None = ... + """The tags that are assigned to the identity pool.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class LookupDeveloperIdentityInput(_SerdeShape): + """Input to the `LookupDeveloperIdentityInput` action.""" + + identity_pool_id: str | None = ... + """An identity pool ID in the format REGION:GUID.""" + identity_id: str | None = ... + """A unique identifier in the format REGION:GUID.""" + developer_user_identifier: str | None = ... + """ + A unique ID used by your backend authentication process to identify a + user. Typically, a developer identity provider would issue many + developer user identifiers, in keeping with the number of users. + """ + max_results: int | None = ... + """The maximum number of identities to return.""" + next_token: str | None = ... + """ + A pagination token. The first call you make will have `NextToken` set to + null. After that the service will return `NextToken` values as needed. + For example, let's say you make a request with `MaxResults` set to 10, + and there are 20 matches in the database. The service will return a + pagination token as a part of the response. This token can be used to + call the API again and get results starting from the 11th match. + """ + +@dataclass(kw_only=True) +class LookupDeveloperIdentityOutput(_SerdeShape): + """Returned in response to a successful `LookupDeveloperIdentity` action.""" + + identity_id: str | None = ... + """A unique identifier in the format REGION:GUID.""" + developer_user_identifier_list: list[str] | None = ... + """ + This is the list of developer user identifiers associated with an + identity ID. Cognito supports the association of multiple developer user + identifiers with an identity ID. + """ + next_token: str | None = ... + """ + A pagination token. The first call you make will have `NextToken` set to + null. After that the service will return `NextToken` values as needed. + For example, let's say you make a request with `MaxResults` set to 10, + and there are 20 matches in the database. The service will return a + pagination token as a part of the response. This token can be used to + call the API again and get results starting from the 11th match. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class MappingRule(_SerdeShape): + """ + A rule that maps a claim name, a claim value, and a match type to a role + ARN. + """ + + claim: str + """ + The claim name that must be present in the token, for example, + \"isAdmin\" or \"paid\". + """ + match_type: str + """ + The match condition that specifies how closely the claim value in the + IdP token must match `Value`. + """ + value: str + """ + A brief string that the claim must match, for example, \"paid\" or + \"yes\". + """ + role_arn: str + """The role ARN.""" + +class MappingRuleMatchType(UnknownEnumMixin, StrEnum): + EQUALS = "Equals" + CONTAINS = "Contains" + STARTS_WITH = "StartsWith" + NOT_EQUAL = "NotEqual" + +@dataclass(kw_only=True) +class MergeDeveloperIdentitiesInput(_SerdeShape): + """Input to the `MergeDeveloperIdentities` action.""" + + source_user_identifier: str | None = ... + """ + User identifier for the source user. The value should be a + `DeveloperUserIdentifier`. + """ + destination_user_identifier: str | None = ... + """ + User identifier for the destination user. The value should be a + `DeveloperUserIdentifier`. + """ + developer_provider_name: str | None = ... + """ + The \"domain\" by which Cognito will refer to your users. This is a + (pseudo) domain name that you provide while creating an identity pool. + This name acts as a placeholder that allows your backend and the Cognito + service to communicate about the developer provider. For the + `DeveloperProviderName`, you can use letters as well as period (.), + underscore (_), and dash (-). + """ + identity_pool_id: str | None = ... + """An identity pool ID in the format REGION:GUID.""" + +@dataclass(kw_only=True) +class MergeDeveloperIdentitiesOutput(_SerdeShape): + """Returned in response to a successful `MergeDeveloperIdentities` action.""" + + identity_id: str | None = ... + """A unique identifier in the format REGION:GUID.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class NotAuthorizedException(ServiceError, _SerdeShape): + """Thrown when a user is not authorized to access the requested resource.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ResourceConflictException(ServiceError, _SerdeShape): + """ + Thrown when a user tries to use a login which is already linked to + another account. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ResourceNotFoundException(ServiceError, _SerdeShape): + """ + Thrown when the requested resource (for example, a dataset or record) + does not exist. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class RoleMapping(_SerdeShape): + """A role mapping.""" + + type: str + """ + The role mapping type. Token will use `cognito:roles` and + `cognito:preferred_role` claims from the Cognito identity provider token + to map groups to roles. Rules will attempt to match claims from the + token to map to a role. + """ + ambiguous_role_resolution: str | None = ... + """ + If you specify Token or Rules as the `Type`, `AmbiguousRoleResolution` + is required. + + Specifies the action to be taken if either no rules match the claim + value for the `Rules` type, or there is no `cognito:preferred_role` + claim and there are multiple `cognito:roles` matches for the `Token` + type. + """ + rules_configuration: RulesConfigurationType | None = ... + """ + The rules to be used for mapping users to roles. + + If you specify Rules as the role mapping type, `RulesConfiguration` is + required. + """ + +class RoleMappingType(UnknownEnumMixin, StrEnum): + TOKEN = "Token" + RULES = "Rules" + +@dataclass(kw_only=True) +class RulesConfigurationType(_SerdeShape): + """A container for rules.""" + + rules: list[MappingRule] + """ + An array of rules. You can specify up to 25 rules per identity provider. + + Rules are evaluated in order. The first one to match specifies the role. + """ + +@dataclass(kw_only=True) +class SetIdentityPoolRolesInput(_SerdeShape): + """Input to the `SetIdentityPoolRoles` action.""" + + identity_pool_id: str | None = ... + """An identity pool ID in the format REGION:GUID.""" + roles: dict[str, str] | None = ... + """ + The map of roles associated with this pool. For a given role, the key + will be either \"authenticated\" or \"unauthenticated\" and the value + will be the Role ARN. + """ + role_mappings: dict[str, RoleMapping] | None = ... + """ + How users for a specific identity provider are to mapped to roles. This + is a string to RoleMapping object map. The string identifies the + identity provider, for example, `graph.facebook.com` or + `cognito-idp.us-east-1.amazonaws.com/us-east-1_abcdefghi:app_client_id`. + + Up to 25 rules can be specified per identity provider. + """ + +@dataclass(kw_only=True) +class SetIdentityPoolRolesOutput(_SerdeShape): + """Dataclass for SetIdentityPoolRolesOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class SetPrincipalTagAttributeMapInput(_SerdeShape): + """Dataclass for SetPrincipalTagAttributeMapInput structure.""" + + identity_pool_id: str | None = ... + """The ID of the Identity Pool you want to set attribute mappings for.""" + identity_provider_name: str | None = ... + """The provider name you want to use for attribute mappings.""" + use_defaults: bool | None = ... + """ + You can use this operation to use default (username and clientID) + attribute mappings. + """ + principal_tags: dict[str, str] | None = ... + """You can use this operation to add principal tags.""" + +@dataclass(kw_only=True) +class SetPrincipalTagAttributeMapOutput(_SerdeShape): + """Dataclass for SetPrincipalTagAttributeMapOutput structure.""" + + identity_pool_id: str | None = ... + """The ID of the Identity Pool you want to set attribute mappings for.""" + identity_provider_name: str | None = ... + """The provider name you want to use for attribute mappings.""" + use_defaults: bool | None = ... + """ + You can use this operation to select default (username and clientID) + attribute mappings. + """ + principal_tags: dict[str, str] | None = ... + """ + You can use this operation to add principal tags. The + `PrincipalTags`operation enables you to reference user attributes in + your IAM permissions policy. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class TagResourceInput(_SerdeShape): + """Dataclass for TagResourceInput structure.""" + + resource_arn: str | None = ... + """The Amazon Resource Name (ARN) of the identity pool.""" + tags: dict[str, str] | None = ... + """The tags to assign to the identity pool.""" + +@dataclass(kw_only=True) +class TagResourceOutput(_SerdeShape): + """Dataclass for TagResourceOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class TooManyRequestsException(ServiceError, _SerdeShape): + """Thrown when a request is throttled.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UnlinkDeveloperIdentityInput(_SerdeShape): + """Input to the `UnlinkDeveloperIdentity` action.""" + + identity_id: str | None = ... + """A unique identifier in the format REGION:GUID.""" + identity_pool_id: str | None = ... + """An identity pool ID in the format REGION:GUID.""" + developer_provider_name: str | None = ... + """The \"domain\" by which Cognito will refer to your users.""" + developer_user_identifier: str | None = ... + """ + A unique ID used by your backend authentication process to identify a + user. + """ + +@dataclass(kw_only=True) +class UnlinkDeveloperIdentityOutput(_SerdeShape): + """Dataclass for UnlinkDeveloperIdentityOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UnlinkIdentityInput(_SerdeShape): + """Input to the UnlinkIdentity action.""" + + identity_id: str | None = ... + """A unique identifier in the format REGION:GUID.""" + logins: dict[str, str] | None = ... + """ + A set of optional name-value pairs that map provider names to provider + tokens. + """ + logins_to_remove: list[str] | None = ... + """Provider names to unlink from this identity.""" + +@dataclass(kw_only=True) +class UnlinkIdentityOutput(_SerdeShape): + """Dataclass for UnlinkIdentityOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UnprocessedIdentityId(_SerdeShape): + """ + An array of UnprocessedIdentityId objects, each of which contains an + ErrorCode and IdentityId. + """ + + identity_id: str | None = ... + """A unique identifier in the format REGION:GUID.""" + error_code: str | None = ... + """The error code indicating the type of error that occurred.""" + +@dataclass(kw_only=True) +class UntagResourceInput(_SerdeShape): + """Dataclass for UntagResourceInput structure.""" + + resource_arn: str | None = ... + """The Amazon Resource Name (ARN) of the identity pool.""" + tag_keys: list[str] | None = ... + """The keys of the tags to remove from the user pool.""" + +@dataclass(kw_only=True) +class UntagResourceOutput(_SerdeShape): + """Dataclass for UntagResourceOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateIdentityPoolInput(_SerdeShape): + """An object representing an Amazon Cognito identity pool.""" + + identity_pool_id: str | None = ... + """An identity pool ID in the format REGION:GUID.""" + identity_pool_name: str | None = ... + """A string that you provide.""" + allow_unauthenticated_identities: bool = ... + """TRUE if the identity pool supports unauthenticated logins.""" + allow_classic_flow: bool | None = ... + """ + Enables or disables the Basic (Classic) authentication flow. For more + information, see [Identity Pools (Federated Identities) Authentication + Flow](https://docs.aws.amazon.com/cognito/latest/developerguide/authentication-flow.html) + in the *Amazon Cognito Developer Guide*. + """ + supported_login_providers: dict[str, str] | None = ... + """Optional key:value pairs mapping provider names to provider app IDs.""" + developer_provider_name: str | None = ... + """The \"domain\" by which Cognito will refer to your users.""" + open_id_connect_provider_ar_ns: list[str] | None = ... + """The ARNs of the OpenID Connect providers.""" + cognito_identity_providers: list[CognitoIdentityProvider] | None = ... + """A list representing an Amazon Cognito user pool and its client ID.""" + saml_provider_ar_ns: list[str] | None = ... + """ + An array of Amazon Resource Names (ARNs) of the SAML provider for your + identity pool. + """ + identity_pool_tags: dict[str, str] | None = ... + """ + The tags that are assigned to the identity pool. A tag is a label that + you can apply to identity pools to categorize and manage them in + different ways, such as by purpose, owner, environment, or other + criteria. + """ + +@dataclass(kw_only=True) +class UpdateIdentityPoolOutput(_SerdeShape): + """An object representing an Amazon Cognito identity pool.""" + + identity_pool_id: str + """An identity pool ID in the format REGION:GUID.""" + identity_pool_name: str + """A string that you provide.""" + allow_unauthenticated_identities: bool = ... + """TRUE if the identity pool supports unauthenticated logins.""" + allow_classic_flow: bool | None = ... + """ + Enables or disables the Basic (Classic) authentication flow. For more + information, see [Identity Pools (Federated Identities) Authentication + Flow](https://docs.aws.amazon.com/cognito/latest/developerguide/authentication-flow.html) + in the *Amazon Cognito Developer Guide*. + """ + supported_login_providers: dict[str, str] | None = ... + """Optional key:value pairs mapping provider names to provider app IDs.""" + developer_provider_name: str | None = ... + """The \"domain\" by which Cognito will refer to your users.""" + open_id_connect_provider_ar_ns: list[str] | None = ... + """The ARNs of the OpenID Connect providers.""" + cognito_identity_providers: list[CognitoIdentityProvider] | None = ... + """A list representing an Amazon Cognito user pool and its client ID.""" + saml_provider_ar_ns: list[str] | None = ... + """ + An array of Amazon Resource Names (ARNs) of the SAML provider for your + identity pool. + """ + identity_pool_tags: dict[str, str] | None = ... + """ + The tags that are assigned to the identity pool. A tag is a label that + you can apply to identity pools to categorize and manage them in + different ways, such as by purpose, owner, environment, or other + criteria. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +CREATE_IDENTITY_POOL: APIOperation[CreateIdentityPoolInput, CreateIdentityPoolOutput] +DELETE_IDENTITIES: APIOperation[DeleteIdentitiesInput, DeleteIdentitiesOutput] +DELETE_IDENTITY_POOL: APIOperation[DeleteIdentityPoolInput, DeleteIdentityPoolOutput] +DESCRIBE_IDENTITY: APIOperation[DescribeIdentityInput, DescribeIdentityOutput] +DESCRIBE_IDENTITY_POOL: APIOperation[ + DescribeIdentityPoolInput, DescribeIdentityPoolOutput +] +GET_CREDENTIALS_FOR_IDENTITY: APIOperation[ + GetCredentialsForIdentityInput, GetCredentialsForIdentityOutput +] +GET_ID: APIOperation[GetIdInput, GetIdOutput] +GET_IDENTITY_POOL_ROLES: APIOperation[ + GetIdentityPoolRolesInput, GetIdentityPoolRolesOutput +] +GET_OPEN_ID_TOKEN: APIOperation[GetOpenIdTokenInput, GetOpenIdTokenOutput] +GET_OPEN_ID_TOKEN_FOR_DEVELOPER_IDENTITY: APIOperation[ + GetOpenIdTokenForDeveloperIdentityInput, GetOpenIdTokenForDeveloperIdentityOutput +] +GET_PRINCIPAL_TAG_ATTRIBUTE_MAP: APIOperation[ + GetPrincipalTagAttributeMapInput, GetPrincipalTagAttributeMapOutput +] +LIST_IDENTITIES: APIOperation[ListIdentitiesInput, ListIdentitiesOutput] +LIST_IDENTITY_POOLS: APIOperation[ListIdentityPoolsInput, ListIdentityPoolsOutput] +LIST_TAGS_FOR_RESOURCE: APIOperation[ + ListTagsForResourceInput, ListTagsForResourceOutput +] +LOOKUP_DEVELOPER_IDENTITY: APIOperation[ + LookupDeveloperIdentityInput, LookupDeveloperIdentityOutput +] +MERGE_DEVELOPER_IDENTITIES: APIOperation[ + MergeDeveloperIdentitiesInput, MergeDeveloperIdentitiesOutput +] +SET_IDENTITY_POOL_ROLES: APIOperation[ + SetIdentityPoolRolesInput, SetIdentityPoolRolesOutput +] +SET_PRINCIPAL_TAG_ATTRIBUTE_MAP: APIOperation[ + SetPrincipalTagAttributeMapInput, SetPrincipalTagAttributeMapOutput +] +TAG_RESOURCE: APIOperation[TagResourceInput, TagResourceOutput] +UNLINK_DEVELOPER_IDENTITY: APIOperation[ + UnlinkDeveloperIdentityInput, UnlinkDeveloperIdentityOutput +] +UNLINK_IDENTITY: APIOperation[UnlinkIdentityInput, UnlinkIdentityOutput] +UNTAG_RESOURCE: APIOperation[UntagResourceInput, UntagResourceOutput] +UPDATE_IDENTITY_POOL: APIOperation[UpdateIdentityPoolInput, UpdateIdentityPoolOutput] diff --git a/clients/aws-sdk-connecthealth/scripts/docs/generate_doc_stubs.py b/clients/aws-sdk-connecthealth/scripts/docs/generate_doc_stubs.py index 52d470bc..795f2e4b 100644 --- a/clients/aws-sdk-connecthealth/scripts/docs/generate_doc_stubs.py +++ b/clients/aws-sdk-connecthealth/scripts/docs/generate_doc_stubs.py @@ -126,7 +126,9 @@ class ClientInfo: class DocStubGenerator: """Generate markdown API Reference stubs for AWS SDK for Python v4 clients.""" - def __init__(self, client_dir: Path, output_dir: Path, service_name: str | None = None) -> None: + def __init__( + self, client_dir: Path, output_dir: Path, service_name: str | None = None + ) -> None: """ Initialize the documentation generator. @@ -190,7 +192,9 @@ def _analyze_client_package(self, package_name: str) -> ClientInfo: required = ("client", "config", "models") missing = [name for name in required if not package.modules.get(name)] if missing: - raise ValueError(f"Missing required modules in {package_name}: {', '.join(missing)}") + raise ValueError( + f"Missing required modules in {package_name}: {', '.join(missing)}" + ) # Parse submodules client_module = package.modules["client"] @@ -199,11 +203,15 @@ def _analyze_client_package(self, package_name: str) -> ClientInfo: client_class = self._find_class_with_suffix(client_module, "Client") if not client_class: - raise ValueError(f"No class ending with 'Client' found in {package_name}.client") + raise ValueError( + f"No class ending with 'Client' found in {package_name}.client" + ) config_class = self._find_class_with_suffix(config_module, "Config") if not config_class: - raise ValueError(f"No class ending with 'Config' found in {package_name}.config") + raise ValueError( + f"No class ending with 'Config' found in {package_name}.config" + ) plugin_alias = config_module.members.get("Plugin") if not plugin_alias: @@ -288,7 +296,9 @@ def _analyze_operation(self, operation: Function) -> OperationInfo: if output_type in stream_type_map: stream_type = stream_type_map[output_type] - stream_args = self._get_subscript_elements(returns, f"'{operation.name}' stream type") + stream_args = self._get_subscript_elements( + returns, f"'{operation.name}' stream type" + ) if stream_type in (StreamType.INPUT, StreamType.DUPLEX): event_input_type = stream_args[0].canonical_name @@ -316,7 +326,9 @@ def _analyze_operation(self, operation: Function) -> OperationInfo: def _get_expr(self, annotation: str | Expr | None, context: str) -> Expr: """Extract and validate an Expr from an annotation.""" if not isinstance(annotation, Expr): - raise TypeError(f"{context}: expected Expr, got {type(annotation).__name__}") + raise TypeError( + f"{context}: expected Expr, got {type(annotation).__name__}" + ) return annotation def _get_subscript_elements(self, expr: Expr, context: str) -> list[Expr]: @@ -330,7 +342,9 @@ def _get_subscript_elements(self, expr: Expr, context: str) -> list[Expr]: return [el for el in slice_expr.elements if isinstance(el, Expr)] return [slice_expr] - def _extract_models(self, models_module: Module, operations: list[OperationInfo]) -> ModelsInfo: + def _extract_models( + self, models_module: Module, operations: list[OperationInfo] + ) -> ModelsInfo: """Extract structures, unions, enums, and errors from models module.""" structures, unions, enums, errors = [], [], [], [] @@ -356,14 +370,16 @@ def _extract_models(self, models_module: Module, operations: list[OperationInfo] duplicates = [] for structure in structures: - if self._is_operation_io_type(structure.name, operations) or self._is_union_member( - structure.name, unions - ): + if self._is_operation_io_type( + structure.name, operations + ) or self._is_union_member(structure.name, unions): duplicates.append(structure) structures = [struct for struct in structures if struct not in duplicates] - return ModelsInfo(structures=structures, unions=unions, enums=enums, errors=errors) + return ModelsInfo( + structures=structures, unions=unions, enums=enums, errors=errors + ) def _is_union(self, member: Object | Alias) -> TypeGuard[Attribute]: """Check if a module member is a union type.""" @@ -399,7 +415,9 @@ def _extract_union_members( for name in member_names: if not (member_object := models_module.members.get(name)): raise ValueError(f"Union member '{name}' not found in models module") - members.append(TypeInfo(name=member_object.name, module_path=member_object.path)) + members.append( + TypeInfo(name=member_object.name, module_path=member_object.path) + ) return members @@ -408,7 +426,8 @@ def _is_enum(self, member: Object | Alias) -> TypeGuard[Class]: if not isinstance(member, Class): return False return any( - isinstance(base, ExprName) and base.name in ENUM_BASE_CLASSES for base in member.bases + isinstance(base, ExprName) and base.name in ENUM_BASE_CLASSES + for base in member.bases ) def _is_error(self, member: Object | Alias) -> TypeGuard[Class]: @@ -416,10 +435,13 @@ def _is_error(self, member: Object | Alias) -> TypeGuard[Class]: if not isinstance(member, Class): return False return any( - isinstance(base, ExprName) and base.name in ERROR_BASE_CLASSES for base in member.bases + isinstance(base, ExprName) and base.name in ERROR_BASE_CLASSES + for base in member.bases ) - def _is_operation_io_type(self, type_name: str, operations: list[OperationInfo]) -> bool: + def _is_operation_io_type( + self, type_name: str, operations: list[OperationInfo] + ) -> bool: """Check if a type is used as operation input/output.""" return any(type_name in (op.input.name, op.output.name) for op in operations) @@ -437,8 +459,12 @@ def _generate_client_docs(self, client_info: ClientInfo) -> bool: self._generate_type_stubs( client_info.models.structures, "structures", "Structure Class" ) - self._generate_type_stubs(client_info.models.errors, "errors", "Error Class") - self._generate_type_stubs(client_info.models.enums, "enums", "Enum Class", members=True) + self._generate_type_stubs( + client_info.models.errors, "errors", "Error Class" + ) + self._generate_type_stubs( + client_info.models.enums, "enums", "Enum Class", members=True + ) self._generate_union_stubs(client_info.models.unions) except OSError as e: logger.error(f"Failed to write documentation files: {e}") @@ -470,7 +496,9 @@ def _generate_index(self, client_info: ClientInfo) -> None: ] for method in sorted(client_info.client_methods, key=lambda x: x.name): - lines.extend([*self._mkdocs_directive(method.module_path, heading_level=4), ""]) + lines.extend( + [*self._mkdocs_directive(method.module_path, heading_level=4), ""] + ) # Operations section if client_info.operations: @@ -578,7 +606,9 @@ def _generate_operation_stubs(self, operations: list[OperationInfo]) -> None: output_path = self.output_dir / "operations" / f"{op.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb("Operations", op.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb("Operations", op.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(operations)} operation file(s)") @@ -600,7 +630,9 @@ def _generate_type_stubs( output_path = self.output_dir / category / f"{item.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb(category.title(), item.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb(category.title(), item.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(items)} {category} file(s)") @@ -624,7 +656,9 @@ def _generate_union_stubs(self, unions: list[UnionInfo]) -> None: output_path = self.output_dir / "unions" / f"{union.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb("Unions", union.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb("Unions", union.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(unions)} union file(s)") diff --git a/clients/aws-sdk-connecthealth/src/aws_sdk_connecthealth/_private/schemas.py b/clients/aws-sdk-connecthealth/src/aws_sdk_connecthealth/_private/schemas.py index c7be88cf..eb3b12c9 100644 --- a/clients/aws-sdk-connecthealth/src/aws_sdk_connecthealth/_private/schemas.py +++ b/clients/aws-sdk-connecthealth/src/aws_sdk_connecthealth/_private/schemas.py @@ -2,1965 +2,1757 @@ from types import MappingProxyType -from smithy_core.prelude import INTEGER, STRING, TIMESTAMP, UNIT -from smithy_core.schemas import Schema -from smithy_core.shapes import ShapeID, ShapeType -from smithy_core.traits import Trait - - -ACCESS_DENIED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#AccessDeniedException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=401), - ], - members={"message": {"target": STRING}}, -) - -DOMAIN_ID = Schema( - id=ShapeID("com.amazonaws.connecthealth#DomainId"), shape_type=ShapeType.STRING -) - -SUBSCRIPTION_ID = Schema( - id=ShapeID("com.amazonaws.connecthealth#SubscriptionId"), - shape_type=ShapeType.STRING, -) - -ACTIVATE_SUBSCRIPTION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#ActivateSubscriptionInput"), - members={ - "domainId": { - "target": DOMAIN_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "subscriptionId": { - "target": SUBSCRIPTION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -SUBSCRIPTION_ARN = Schema( - id=ShapeID("com.amazonaws.connecthealth#SubscriptionArn"), - shape_type=ShapeType.STRING, -) - -SUBSCRIPTION_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#SubscriptionStatus"), - shape_type=ShapeType.ENUM, - members={ - "ACTIVE": {"target": UNIT}, - "INACTIVE": {"target": UNIT}, - "DELETED": {"target": UNIT}, - }, -) - -SUBSCRIPTION_DESCRIPTION = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#SubscriptionDescription"), - members={ - "domainId": { - "target": DOMAIN_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "subscriptionId": { - "target": SUBSCRIPTION_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "arn": { - "target": SUBSCRIPTION_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": SUBSCRIPTION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastUpdatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "activatedAt": {"target": TIMESTAMP}, - "deactivatedAt": {"target": TIMESTAMP}, - }, +from smithy_core._schema_compact import StaticOperationSchema, StaticSchema + + +n0 = "com.amazonaws.connecthealth" +_ADE = "AccessDeniedException" +_s = "smithy.api#error" +_c = "client" +_sE = "smithy.api#httpError" +_m = "message" +_DI = "DomainId" +_SI = "SubscriptionId" +_ASI = "ActivateSubscriptionInput" +_sm = "smithy.api#input" +_dI = "domainId" +_smi = "smithy.api#required" +_sL = "smithy.api#httpLabel" +_sI = "subscriptionId" +_SA = "SubscriptionArn" +_SS = "SubscriptionStatus" +_ACTIVE = "ACTIVE" +_sV = "smithy.api#enumValue" +_INACTIVE = "INACTIVE" +_DELETED = "DELETED" +_SD = "SubscriptionDescription" +_a = "arn" +_st = "status" +_cA = "createdAt" +_lUA = "lastUpdatedAt" +_aA = "activatedAt" +_dA = "deactivatedAt" +_ASO = "ActivateSubscriptionOutput" +_smit = "smithy.api#output" +_su = "subscription" +_ISE = "InternalServerException" +_se = "server" +_RNFE = "ResourceNotFoundException" +_VE = "ValidationException" +_AS = "ActivateSubscription" +_smith = "smithy.api#http" +_EM = "ErrorMessage" +_U = "Uri" +_PSAGS = "PostStreamArtifactGenerationStatus" +_IP = "IN_PROGRESS" +_FAILED = "FAILED" +_COMPLETED = "COMPLETED" +_AD = "ArtifactDetails" +_oL = "outputLocation" +_fR = "failureReason" +_AC = "AudioChunk" +_AO = "AudioOffset" +_CNGR = "ClinicalNoteGenerationResult" +_nR = "noteResult" +_tR = "transcriptResult" +_aVSR = "afterVisitSummaryResult" +_SSHS = "SensitiveSectionHeaderString" +_smithy = "smithy.api#sensitive" +_SMS = "SensitiveMarkdownString" +_TSI = "TemplateSectionInstruction" +_sH = "sectionHeader" +_sIe = "sectionInstruction" +_TI = "TemplateInstructions" +_me = "member" +_CTB = "CustomTemplateBase" +_HAP = "HISTORY_AND_PHYSICAL" +_GIRPP = "GIRPP" +_DAP = "DAP" +_SIRP = "SIRP" +_BIRP = "BIRP" +_BS = "BEHAVIORAL_SOAP" +_CT = "CustomTemplate" +_tT = "templateType" +_tI = "templateInstructions" +_MNT = "ManagedNoteTemplate" +_PS = "PHYSICAL_SOAP" +_MT = "ManagedTemplate" +_NTS = "NoteTemplateSettings" +_mT = "managedTemplate" +_cT = "customTemplate" +_CNGS = "ClinicalNoteGenerationSettings" +_nTS = "noteTemplateSettings" +_CTR = "CustomTemplateResponse" +_MTR = "ManagedTemplateResponse" +_NTSR = "NoteTemplateSettingsResponse" +_CNGSR = "ClinicalNoteGenerationSettingsResponse" +_CE = "ConflictException" +_KKA = "KmsKeyArn" +_DN = "DomainName" +_TK = "TagKey" +_TV = "TagValue" +_TM = "TagMap" +_k = "key" +_v = "value" +_CWAC = "CreateWebAppConfiguration" +_eR = "ehrRole" +_iII = "idcInstanceId" +_iR = "idcRegion" +_CDI = "CreateDomainInput" +_n = "name" +_kKA = "kmsKeyArn" +_wASC = "webAppSetupConfiguration" +_t = "tags" +_DA = "DomainArn" +_ET = "EncryptionType" +_AOK = "AWS_OWNED_KEY" +_CMK = "CUSTOMER_MANAGED_KEY" +_EC = "EncryptionContext" +_eT = "encryptionType" +_DS = "DomainStatus" +_DELETING = "DELETING" +_WAC = "WebAppConfiguration" +_iAI = "idcApplicationId" +_WAU = "WebAppUrl" +_CDO = "CreateDomainOutput" +_eC = "encryptionContext" +_wAU = "webAppUrl" +_wAC = "webAppConfiguration" +_SQEE = "ServiceQuotaExceededException" +_CD = "CreateDomain" +_CSI = "CreateSubscriptionInput" +_CSO = "CreateSubscriptionOutput" +_CS = "CreateSubscription" +_DSI = "DeactivateSubscriptionInput" +_DSO = "DeactivateSubscriptionOutput" +_DSe = "DeactivateSubscription" +_DDI = "DeleteDomainInput" +_DDO = "DeleteDomainOutput" +_DD = "DeleteDomain" +_GDI = "GetDomainInput" +_GDO = "GetDomainOutput" +_GD = "GetDomain" +_SSI = "ScribeSessionId" +_GMSLSI = "GetMedicalScribeListeningSessionInput" +_sIes = "sessionId" +_MSCI = "MedicalScribeChannelId" +_MSPR = "MedicalScribeParticipantRole" +_PATIENT = "PATIENT" +_CLINICIAN = "CLINICIAN" +_MSCD = "MedicalScribeChannelDefinition" +_cI = "channelId" +_pR = "participantRole" +_MSCDe = "MedicalScribeChannelDefinitions" +_NNB = "NonNullBoolean" +_MSLC = "MedicalScribeLanguageCode" +_EU = "EN_US" +_eU = "en-US" +_MULTI = "MULTI" +_mu = "multi" +_MSME = "MedicalScribeMediaEncoding" +_PCM = "PCM" +_p = "pcm" +_FLAC = "FLAC" +_f = "flac" +_MSMSRH = "MedicalScribeMediaSampleRateHertz" +_MSPSAR = "MedicalScribePostStreamActionsResult" +_cNGR = "clinicalNoteGenerationResult" +_SU = "S3Uri" +_MSPSASR = "MedicalScribePostStreamActionSettingsResponse" +_oSU = "outputS3Uri" +_cNGS = "clinicalNoteGenerationSettings" +_MSSS = "MedicalScribeStreamStatus" +_PAUSED = "PAUSED" +_MSLSD = "MedicalScribeListeningSessionDetails" +_lC = "languageCode" +_mSRH = "mediaSampleRateHertz" +_mE = "mediaEncoding" +_cD = "channelDefinitions" +_pSAS = "postStreamActionSettings" +_pSAR = "postStreamActionResult" +_eCP = "encounterContextProvided" +_sS = "streamStatus" +_sCT = "streamCreationTime" +_sET = "streamEndTime" +_GMSLSO = "GetMedicalScribeListeningSessionOutput" +_mSLSD = "medicalScribeListeningSessionDetails" +_TE = "ThrottlingException" +_GMSLS = "GetMedicalScribeListeningSession" +_smithya = "smithy.api#endpoint" +_JI = "JobId" +_GPIJI = "GetPatientInsightsJobInput" +_sSI = "smithy.synthetic#originalShapeId" +_cGPIJR = "com.amazonaws.connecthealth#GetPatientInsightsJobRequest" +_jI = "jobId" +_SNES = "SensitiveNonEmptyString" +_PIEC = "PatientInsightsEncounterContext" +_eRn = "encounterReason" +_NES = "NonEmptyString" +_FHIRS = "FHIRServer" +_fE = "fhirEndpoint" +_oT = "oauthToken" +_SSo = "S3Source" +_u = "uri" +_SSou = "S3Sources" +_IDC = "InputDataConfig" +_fS = "fhirServer" +_sSo = "s3Sources" +_IT = "InsightsType" +_PV = "PRE_VISIT" +_IC = "InsightsContext" +_iT = "insightsType" +_IO = "InsightsOutput" +_JA = "JobArn" +_JS = "JobStatus" +_SUBMITTED = "SUBMITTED" +_SUCCEEDED = "SUCCEEDED" +_ODC = "OutputDataConfig" +_sOP = "s3OutputPath" +_SIDS = "SensitiveIsoDateString" +_P = "Pronouns" +_HH = "HE_HIM" +_SH = "SHE_HER" +_TT = "THEY_THEM" +_PIPC = "PatientInsightsPatientContext" +_pI = "patientId" +_dOB = "dateOfBirth" +_pr = "pronouns" +_PR = "ProviderRole" +_S = "Specialty" +_PC = "PRIMARY_CARE" +_UC = "UserContext" +_r = "role" +_uI = "userId" +_sp = "specialty" +_GPIJO = "GetPatientInsightsJobOutput" +_cGPIJRo = "com.amazonaws.connecthealth#GetPatientInsightsJobResponse" +_jA = "jobArn" +_jS = "jobStatus" +_cTr = "creationTime" +_sF = "smithy.api#timestampFormat" +_dt = "date-time" +_uT = "updatedTime" +_iO = "insightsOutput" +_sD = "statusDetails" +_pC = "patientContext" +_iC = "insightsContext" +_eCn = "encounterContext" +_uC = "userContext" +_iDC = "inputDataConfig" +_oDC = "outputDataConfig" +_GPIJ = "GetPatientInsightsJob" +_GSI = "GetSubscriptionInput" +_GSO = "GetSubscriptionOutput" +_GS = "GetSubscription" +_LDI = "ListDomainsInput" +_sQ = "smithy.api#httpQuery" +_mR = "maxResults" +_nT = "nextToken" +_DSo = "DomainSummary" +_DSL = "DomainSummaryList" +_LDO = "ListDomainsOutput" +_d = "domains" +_LD = "ListDomains" +_LSI = "ListSubscriptionsInput" +_SL = "SubscriptionList" +_LSO = "ListSubscriptionsOutput" +_sub = "subscriptions" +_LS = "ListSubscriptions" +_LTFRI = "ListTagsForResourceInput" +_rA = "resourceArn" +_LTFRO = "ListTagsForResourceOutput" +_LTFR = "ListTagsForResource" +_MSAE = "MedicalScribeAudioEvent" +_aC = "audioChunk" +_MSBAE = "MedicalScribeBinaryAudioEvent" +_sP = "smithy.api#eventPayload" +_ECn = "EncounterContext" +_uCn = "unstructuredContext" +_MSPSAS = "MedicalScribePostStreamActionSettings" +_MSCE = "MedicalScribeConfigurationEvent" +_MSSCET = "MedicalScribeSessionControlEventType" +_EOS = "END_OF_SESSION" +_MSSCE = "MedicalScribeSessionControlEvent" +_ty = "type" +_MSIS = "MedicalScribeInputStream" +_smithyap = "smithy.api#streaming" +_aE = "audioEvent" +_bAE = "binaryAudioEvent" +_sCE = "sessionControlEvent" +_cE = "configurationEvent" +_SMSLSI = "StartMedicalScribeListeningSessionInput" +_sHm = "smithy.api#httpHeader" +_xamsi = "x-amzn-medscribe-session-id" +_xamdi = "x-amzn-medscribe-domain-id" +_xamsi_ = "x-amzn-medscribe-subscription-id" +_xamlc = "x-amzn-medscribe-language-code" +_xamsr = "x-amzn-medscribe-sample-rate" +_xamme = "x-amzn-medscribe-media-encoding" +_iS = "inputStream" +_sPm = "smithy.api#httpPayload" +_RI = "RequestId" +_MSTS = "MedicalScribeTranscriptSegment" +_sIeg = "segmentId" +_aBO = "audioBeginOffset" +_aEO = "audioEndOffset" +_iP = "isPartial" +_co = "content" +_MSTE = "MedicalScribeTranscriptEvent" +_tS = "transcriptSegment" +_MSOS = "MedicalScribeOutputStream" +_tE = "transcriptEvent" +_iFE = "internalFailureException" +_vE = "validationException" +_SMSLSO = "StartMedicalScribeListeningSessionOutput" +_rI = "requestId" +_xari = "x-amzn-request-id" +_rS = "responseStream" +_SMSLS = "StartMedicalScribeListeningSession" +_SPIJI = "StartPatientInsightsJobInput" +_cSPIJR = "com.amazonaws.connecthealth#StartPatientInsightsJobRequest" +_cTl = "clientToken" +_sT = "smithy.api#idempotencyToken" +_SPIJO = "StartPatientInsightsJobOutput" +_cSPIJRo = "com.amazonaws.connecthealth#StartPatientInsightsJobResponse" +_SPIJ = "StartPatientInsightsJob" +_TRI = "TagResourceInput" +_TRO = "TagResourceOutput" +_sU = "smithy.api#Unit" +_TR = "TagResource" +_TKL = "TagKeyList" +_URI = "UntagResourceInput" +_tK = "tagKeys" +_URO = "UntagResourceOutput" +_UR = "UntagResource" +_CH = "ConnectHealth" +_aw = "aws.auth#sigv4" +_sB = "smithy.rules#endpointBdd" +_aws = "aws.api#service" +_aJ = "aws.protocols#restJson1" +_smithyapi = "smithy.api#cors" + +ACCESS_DENIED_EXCEPTION: StaticSchema = ( + 18, + n0, + _ADE, + {_s: _c, _sE: 401}, + (_m,), + ((3, 0),), +) + +DOMAIN_ID: StaticSchema = (3, n0, _DI, 0) + +SUBSCRIPTION_ID: StaticSchema = (3, n0, _SI, 0) + +ACTIVATE_SUBSCRIPTION_INPUT: StaticSchema = ( + 18, + n0, + _ASI, + {_sm: None}, + (_dI, _sI), + ((DOMAIN_ID, 9), (SUBSCRIPTION_ID, 9)), +) + +SUBSCRIPTION_ARN: StaticSchema = (3, n0, _SA, 0) + +SUBSCRIPTION_STATUS: StaticSchema = ( + 14, + n0, + _SS, + 0, + (_ACTIVE, _INACTIVE, _DELETED), + ((-1, {_sV: _ACTIVE}), (-1, {_sV: _INACTIVE}), (-1, {_sV: _DELETED})), +) + +SUBSCRIPTION_DESCRIPTION: StaticSchema = ( + 18, + n0, + _SD, + 0, + (_dI, _sI, _a, _st, _cA, _lUA, _aA, _dA), + ( + (DOMAIN_ID, 1), + (SUBSCRIPTION_ID, 1), + (SUBSCRIPTION_ARN, 1), + (SUBSCRIPTION_STATUS, 1), + (4, 1), + (4, 1), + (4, 0), + (4, 0), + ), ) -ACTIVATE_SUBSCRIPTION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#ActivateSubscriptionOutput"), - members={"subscription": {"target": SUBSCRIPTION_DESCRIPTION}}, -) - -INTERNAL_SERVER_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#InternalServerException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="server"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=500), - ], - members={"message": {"target": STRING}}, -) - -RESOURCE_NOT_FOUND_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#ResourceNotFoundException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=404), - ], - members={"message": {"target": STRING}}, -) - -VALIDATION_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#ValidationException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"message": {"target": STRING}}, -) - -ACTIVATE_SUBSCRIPTION = Schema( - id=ShapeID("com.amazonaws.connecthealth#ActivateSubscription"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/domains/{domainId}/subscriptions/{subscriptionId}/activate", - "code": 200, - } - ), +ACTIVATE_SUBSCRIPTION_OUTPUT: StaticSchema = ( + 18, + n0, + _ASO, + {_smit: None}, + (_su,), + ((SUBSCRIPTION_DESCRIPTION, 0),), +) + +INTERNAL_SERVER_EXCEPTION: StaticSchema = ( + 18, + n0, + _ISE, + {_s: _se, _sE: 500}, + (_m,), + ((3, 0),), +) + +RESOURCE_NOT_FOUND_EXCEPTION: StaticSchema = ( + 18, + n0, + _RNFE, + {_s: _c, _sE: 404}, + (_m,), + ((3, 0),), +) + +VALIDATION_EXCEPTION: StaticSchema = (18, n0, _VE, {_s: _c, _sE: 400}, (_m,), ((3, 0),)) + +ACTIVATE_SUBSCRIPTION: StaticOperationSchema = ( + 23, + n0, + _AS, + { + _smith: MappingProxyType( + { + "method": "POST", + "uri": "/domains/{domainId}/subscriptions/{subscriptionId}/activate", + "code": 200, + } ) - ], -) - -ERROR_MESSAGE = Schema( - id=ShapeID("com.amazonaws.connecthealth#ErrorMessage"), shape_type=ShapeType.STRING -) - -URI = Schema(id=ShapeID("com.amazonaws.connecthealth#Uri"), shape_type=ShapeType.STRING) - -POST_STREAM_ARTIFACT_GENERATION_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#PostStreamArtifactGenerationStatus"), - shape_type=ShapeType.ENUM, - members={ - "IN_PROGRESS": {"target": UNIT}, - "FAILED": {"target": UNIT}, - "COMPLETED": {"target": UNIT}, }, + ACTIVATE_SUBSCRIPTION_INPUT, + ACTIVATE_SUBSCRIPTION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -ARTIFACT_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#ArtifactDetails"), - members={ - "outputLocation": {"target": URI}, - "status": {"target": POST_STREAM_ARTIFACT_GENERATION_STATUS}, - "failureReason": {"target": ERROR_MESSAGE}, - }, -) - -AUDIO_CHUNK = Schema( - id=ShapeID("com.amazonaws.connecthealth#AudioChunk"), shape_type=ShapeType.BLOB -) - -AUDIO_OFFSET = Schema( - id=ShapeID("com.amazonaws.connecthealth#AudioOffset"), shape_type=ShapeType.DOUBLE -) +ERROR_MESSAGE: StaticSchema = (3, n0, _EM, 0) -CLINICAL_NOTE_GENERATION_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#ClinicalNoteGenerationResult"), - members={ - "noteResult": {"target": ARTIFACT_DETAILS}, - "transcriptResult": {"target": ARTIFACT_DETAILS}, - "afterVisitSummaryResult": {"target": ARTIFACT_DETAILS}, - }, -) +URI: StaticSchema = (3, n0, _U, 0) -SENSITIVE_SECTION_HEADER_STRING = Schema( - id=ShapeID("com.amazonaws.connecthealth#SensitiveSectionHeaderString"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +POST_STREAM_ARTIFACT_GENERATION_STATUS: StaticSchema = ( + 14, + n0, + _PSAGS, + 0, + (_IP, _FAILED, _COMPLETED), + ((-1, {_sV: _IP}), (-1, {_sV: _FAILED}), (-1, {_sV: _COMPLETED})), ) -SENSITIVE_MARKDOWN_STRING = Schema( - id=ShapeID("com.amazonaws.connecthealth#SensitiveMarkdownString"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +ARTIFACT_DETAILS: StaticSchema = ( + 18, + n0, + _AD, + 0, + (_oL, _st, _fR), + ((URI, 0), (POST_STREAM_ARTIFACT_GENERATION_STATUS, 0), (ERROR_MESSAGE, 0)), ) -TEMPLATE_SECTION_INSTRUCTION = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#TemplateSectionInstruction"), - members={ - "sectionHeader": { - "target": SENSITIVE_SECTION_HEADER_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "sectionInstruction": { - "target": SENSITIVE_MARKDOWN_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -TEMPLATE_INSTRUCTIONS = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#TemplateInstructions"), - shape_type=ShapeType.LIST, - members={"member": {"target": TEMPLATE_SECTION_INSTRUCTION}}, -) +AUDIO_CHUNK: StaticSchema = (1, n0, _AC, 0) -CUSTOM_TEMPLATE_BASE = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#CustomTemplateBase"), - shape_type=ShapeType.ENUM, - members={ - "HISTORY_AND_PHYSICAL": {"target": UNIT}, - "GIRPP": {"target": UNIT}, - "DAP": {"target": UNIT}, - "SIRP": {"target": UNIT}, - "BIRP": {"target": UNIT}, - "BEHAVIORAL_SOAP": {"target": UNIT}, - }, -) +AUDIO_OFFSET: StaticSchema = (10, n0, _AO, 0) -CUSTOM_TEMPLATE = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#CustomTemplate"), - members={ - "templateType": { - "target": CUSTOM_TEMPLATE_BASE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "templateInstructions": { - "target": TEMPLATE_INSTRUCTIONS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +CLINICAL_NOTE_GENERATION_RESULT: StaticSchema = ( + 18, + n0, + _CNGR, + 0, + (_nR, _tR, _aVSR), + ((ARTIFACT_DETAILS, 0), (ARTIFACT_DETAILS, 0), (ARTIFACT_DETAILS, 0)), ) -MANAGED_NOTE_TEMPLATE = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#ManagedNoteTemplate"), - shape_type=ShapeType.ENUM, - members={ - "HISTORY_AND_PHYSICAL": {"target": UNIT}, - "GIRPP": {"target": UNIT}, - "DAP": {"target": UNIT}, - "SIRP": {"target": UNIT}, - "BIRP": {"target": UNIT}, - "BEHAVIORAL_SOAP": {"target": UNIT}, - "PHYSICAL_SOAP": {"target": UNIT}, - }, -) +SENSITIVE_SECTION_HEADER_STRING: StaticSchema = (3, n0, _SSHS, 4) -MANAGED_TEMPLATE = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#ManagedTemplate"), - members={ - "templateType": { - "target": MANAGED_NOTE_TEMPLATE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +SENSITIVE_MARKDOWN_STRING: StaticSchema = (3, n0, _SMS, 4) -NOTE_TEMPLATE_SETTINGS = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#NoteTemplateSettings"), - shape_type=ShapeType.UNION, - members={ - "managedTemplate": {"target": MANAGED_TEMPLATE}, - "customTemplate": {"target": CUSTOM_TEMPLATE}, - }, +TEMPLATE_SECTION_INSTRUCTION: StaticSchema = ( + 18, + n0, + _TSI, + 0, + (_sH, _sIe), + ((SENSITIVE_SECTION_HEADER_STRING, 1), (SENSITIVE_MARKDOWN_STRING, 1)), ) -CLINICAL_NOTE_GENERATION_SETTINGS = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#ClinicalNoteGenerationSettings"), - members={ - "noteTemplateSettings": { - "target": NOTE_TEMPLATE_SETTINGS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +TEMPLATE_INSTRUCTIONS: StaticSchema = ( + 16, + n0, + _TI, + 0, + (_me,), + ((TEMPLATE_SECTION_INSTRUCTION, 0),), ) -CUSTOM_TEMPLATE_RESPONSE = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#CustomTemplateResponse"), - members={"templateType": {"target": CUSTOM_TEMPLATE_BASE}}, -) - -MANAGED_TEMPLATE_RESPONSE = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#ManagedTemplateResponse"), - members={"templateType": {"target": MANAGED_NOTE_TEMPLATE}}, -) - -NOTE_TEMPLATE_SETTINGS_RESPONSE = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#NoteTemplateSettingsResponse"), - shape_type=ShapeType.UNION, - members={ - "managedTemplate": {"target": MANAGED_TEMPLATE_RESPONSE}, - "customTemplate": {"target": CUSTOM_TEMPLATE_RESPONSE}, - }, -) - -CLINICAL_NOTE_GENERATION_SETTINGS_RESPONSE = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#ClinicalNoteGenerationSettingsResponse"), - members={"noteTemplateSettings": {"target": NOTE_TEMPLATE_SETTINGS_RESPONSE}}, -) - -CONFLICT_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#ConflictException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=409), - ], - members={"message": {"target": STRING}}, +CUSTOM_TEMPLATE_BASE: StaticSchema = ( + 14, + n0, + _CTB, + 0, + (_HAP, _GIRPP, _DAP, _SIRP, _BIRP, _BS), + ( + (-1, {_sV: _HAP}), + (-1, {_sV: _GIRPP}), + (-1, {_sV: _DAP}), + (-1, {_sV: _SIRP}), + (-1, {_sV: _BIRP}), + (-1, {_sV: _BS}), + ), ) -KMS_KEY_ARN = Schema( - id=ShapeID("com.amazonaws.connecthealth#KmsKeyArn"), shape_type=ShapeType.STRING +CUSTOM_TEMPLATE: StaticSchema = ( + 18, + n0, + _CT, + 0, + (_tT, _tI), + ((CUSTOM_TEMPLATE_BASE, 1), (TEMPLATE_INSTRUCTIONS, 1)), +) + +MANAGED_NOTE_TEMPLATE: StaticSchema = ( + 14, + n0, + _MNT, + 0, + (_HAP, _GIRPP, _DAP, _SIRP, _BIRP, _BS, _PS), + ( + (-1, {_sV: _HAP}), + (-1, {_sV: _GIRPP}), + (-1, {_sV: _DAP}), + (-1, {_sV: _SIRP}), + (-1, {_sV: _BIRP}), + (-1, {_sV: _BS}), + (-1, {_sV: _PS}), + ), ) -DOMAIN_NAME = Schema( - id=ShapeID("com.amazonaws.connecthealth#DomainName"), shape_type=ShapeType.STRING -) +MANAGED_TEMPLATE: StaticSchema = (18, n0, _MT, 0, (_tT,), ((MANAGED_NOTE_TEMPLATE, 1),)) -TAG_KEY = Schema( - id=ShapeID("com.amazonaws.connecthealth#TagKey"), shape_type=ShapeType.STRING +NOTE_TEMPLATE_SETTINGS: StaticSchema = ( + 19, + n0, + _NTS, + 0, + (_mT, _cT), + ((MANAGED_TEMPLATE, 0), (CUSTOM_TEMPLATE, 0)), ) -TAG_VALUE = Schema( - id=ShapeID("com.amazonaws.connecthealth#TagValue"), shape_type=ShapeType.STRING +CLINICAL_NOTE_GENERATION_SETTINGS: StaticSchema = ( + 18, + n0, + _CNGS, + 0, + (_nTS,), + ((NOTE_TEMPLATE_SETTINGS, 1),), ) -TAG_MAP = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#TagMap"), - shape_type=ShapeType.MAP, - members={"key": {"target": TAG_KEY}, "value": {"target": TAG_VALUE}}, +CUSTOM_TEMPLATE_RESPONSE: StaticSchema = ( + 18, + n0, + _CTR, + 0, + (_tT,), + ((CUSTOM_TEMPLATE_BASE, 0),), ) -CREATE_WEB_APP_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#CreateWebAppConfiguration"), - members={ - "ehrRole": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "idcInstanceId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "idcRegion": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +MANAGED_TEMPLATE_RESPONSE: StaticSchema = ( + 18, + n0, + _MTR, + 0, + (_tT,), + ((MANAGED_NOTE_TEMPLATE, 0),), ) -CREATE_DOMAIN_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#CreateDomainInput"), - members={ - "name": { - "target": DOMAIN_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "kmsKeyArn": {"target": KMS_KEY_ARN}, - "webAppSetupConfiguration": {"target": CREATE_WEB_APP_CONFIGURATION}, - "tags": {"target": TAG_MAP}, - }, +NOTE_TEMPLATE_SETTINGS_RESPONSE: StaticSchema = ( + 19, + n0, + _NTSR, + 0, + (_mT, _cT), + ((MANAGED_TEMPLATE_RESPONSE, 0), (CUSTOM_TEMPLATE_RESPONSE, 0)), ) -DOMAIN_ARN = Schema( - id=ShapeID("com.amazonaws.connecthealth#DomainArn"), shape_type=ShapeType.STRING +CLINICAL_NOTE_GENERATION_SETTINGS_RESPONSE: StaticSchema = ( + 18, + n0, + _CNGSR, + 0, + (_nTS,), + ((NOTE_TEMPLATE_SETTINGS_RESPONSE, 0),), ) -ENCRYPTION_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#EncryptionType"), - shape_type=ShapeType.ENUM, - members={ - "AWS_OWNED_KEY": {"target": UNIT}, - "CUSTOMER_MANAGED_KEY": {"target": UNIT}, - }, -) - -ENCRYPTION_CONTEXT = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#EncryptionContext"), - members={ - "encryptionType": { - "target": ENCRYPTION_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "kmsKeyArn": {"target": KMS_KEY_ARN}, - }, -) +CONFLICT_EXCEPTION: StaticSchema = (18, n0, _CE, {_s: _c, _sE: 409}, (_m,), ((3, 0),)) -DOMAIN_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#DomainStatus"), - shape_type=ShapeType.ENUM, - members={ - "ACTIVE": {"target": UNIT}, - "DELETING": {"target": UNIT}, - "DELETED": {"target": UNIT}, - }, -) +KMS_KEY_ARN: StaticSchema = (3, n0, _KKA, 0) -WEB_APP_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#WebAppConfiguration"), - members={ - "ehrRole": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "idcApplicationId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "idcRegion": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +DOMAIN_NAME: StaticSchema = (3, n0, _DN, 0) -WEB_APP_URL = Schema( - id=ShapeID("com.amazonaws.connecthealth#WebAppUrl"), shape_type=ShapeType.STRING -) - -CREATE_DOMAIN_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#CreateDomainOutput"), - members={ - "domainId": { - "target": DOMAIN_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "arn": { - "target": DOMAIN_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": DOMAIN_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "kmsKeyArn": {"target": KMS_KEY_ARN}, - "encryptionContext": {"target": ENCRYPTION_CONTEXT}, - "status": { - "target": DOMAIN_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "webAppUrl": {"target": WEB_APP_URL}, - "webAppConfiguration": {"target": WEB_APP_CONFIGURATION}, - "createdAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +TAG_KEY: StaticSchema = (3, n0, _TK, 0) -SERVICE_QUOTA_EXCEEDED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#ServiceQuotaExceededException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=402), - ], - members={"message": {"target": STRING}}, -) +TAG_VALUE: StaticSchema = (3, n0, _TV, 0) -CREATE_DOMAIN = Schema( - id=ShapeID("com.amazonaws.connecthealth#CreateDomain"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType({"method": "POST", "uri": "/domain", "code": 201}), - ) - ], -) - -CREATE_SUBSCRIPTION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#CreateSubscriptionInput"), - members={ - "domainId": { - "target": DOMAIN_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) +TAG_MAP: StaticSchema = (17, n0, _TM, 0, (_k, _v), ((TAG_KEY, 0), (TAG_VALUE, 0))) -CREATE_SUBSCRIPTION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#CreateSubscriptionOutput"), - members={ - "domainId": { - "target": DOMAIN_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "subscriptionId": { - "target": SUBSCRIPTION_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "arn": { - "target": SUBSCRIPTION_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": SUBSCRIPTION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "lastUpdatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "activatedAt": {"target": TIMESTAMP}, - "deactivatedAt": {"target": TIMESTAMP}, - }, +CREATE_WEB_APP_CONFIGURATION: StaticSchema = ( + 18, + n0, + _CWAC, + 0, + (_eR, _iII, _iR), + ((3, 1), (3, 1), (3, 1)), ) -CREATE_SUBSCRIPTION = Schema( - id=ShapeID("com.amazonaws.connecthealth#CreateSubscription"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/domains/{domainId}/subscriptions", - "code": 201, - } - ), - ) - ], -) - -DEACTIVATE_SUBSCRIPTION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#DeactivateSubscriptionInput"), - members={ - "domainId": { - "target": DOMAIN_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "subscriptionId": { - "target": SUBSCRIPTION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, +CREATE_DOMAIN_INPUT: StaticSchema = ( + 18, + n0, + _CDI, + {_sm: None}, + (_n, _kKA, _wASC, _t), + ( + (DOMAIN_NAME, 1), + (KMS_KEY_ARN, 0), + (CREATE_WEB_APP_CONFIGURATION, 0), + (TAG_MAP, 0), + ), ) -DEACTIVATE_SUBSCRIPTION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#DeactivateSubscriptionOutput"), - members={"subscription": {"target": SUBSCRIPTION_DESCRIPTION}}, -) - -DEACTIVATE_SUBSCRIPTION = Schema( - id=ShapeID("com.amazonaws.connecthealth#DeactivateSubscription"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/domains/{domainId}/subscriptions/{subscriptionId}/deactivate", - "code": 200, - } - ), - ) - ], -) - -DELETE_DOMAIN_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#DeleteDomainInput"), - members={ - "domainId": { - "target": DOMAIN_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, +DOMAIN_ARN: StaticSchema = (3, n0, _DA, 0) + +ENCRYPTION_TYPE: StaticSchema = ( + 14, + n0, + _ET, + 0, + (_AOK, _CMK), + ((-1, {_sV: _AOK}), (-1, {_sV: _CMK})), +) + +ENCRYPTION_CONTEXT: StaticSchema = ( + 18, + n0, + _EC, + 0, + (_eT, _kKA), + ((ENCRYPTION_TYPE, 1), (KMS_KEY_ARN, 0)), +) + +DOMAIN_STATUS: StaticSchema = ( + 14, + n0, + _DS, + 0, + (_ACTIVE, _DELETING, _DELETED), + ((-1, {_sV: _ACTIVE}), (-1, {_sV: _DELETING}), (-1, {_sV: _DELETED})), +) + +WEB_APP_CONFIGURATION: StaticSchema = ( + 18, + n0, + _WAC, + 0, + (_eR, _iAI, _iR), + ((3, 1), (3, 1), (3, 1)), +) + +WEB_APP_URL: StaticSchema = (3, n0, _WAU, 0) + +CREATE_DOMAIN_OUTPUT: StaticSchema = ( + 18, + n0, + _CDO, + {_smit: None}, + (_dI, _a, _n, _kKA, _eC, _st, _wAU, _wAC, _cA), + ( + (DOMAIN_ID, 1), + (DOMAIN_ARN, 1), + (DOMAIN_NAME, 1), + (KMS_KEY_ARN, 0), + (ENCRYPTION_CONTEXT, 0), + (DOMAIN_STATUS, 1), + (WEB_APP_URL, 0), + (WEB_APP_CONFIGURATION, 0), + (4, 1), + ), ) -DELETE_DOMAIN_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#DeleteDomainOutput"), - members={ - "domainId": { - "target": DOMAIN_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "arn": { - "target": DOMAIN_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": DOMAIN_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +SERVICE_QUOTA_EXCEEDED_EXCEPTION: StaticSchema = ( + 18, + n0, + _SQEE, + {_s: _c, _sE: 402}, + (_m,), + ((3, 0),), +) + +CREATE_DOMAIN: StaticOperationSchema = ( + 23, + n0, + _CD, + {_smith: MappingProxyType({"method": "POST", "uri": "/domain", "code": 201})}, + CREATE_DOMAIN_INPUT, + CREATE_DOMAIN_OUTPUT, + (SERVICE_QUOTA_EXCEEDED_EXCEPTION,), +) + +CREATE_SUBSCRIPTION_INPUT: StaticSchema = ( + 18, + n0, + _CSI, + {_sm: None}, + (_dI,), + ((DOMAIN_ID, 9),), +) + +CREATE_SUBSCRIPTION_OUTPUT: StaticSchema = ( + 18, + n0, + _CSO, + {_smit: None}, + (_dI, _sI, _a, _st, _cA, _lUA, _aA, _dA), + ( + (DOMAIN_ID, 1), + (SUBSCRIPTION_ID, 1), + (SUBSCRIPTION_ARN, 1), + (SUBSCRIPTION_STATUS, 1), + (4, 1), + (4, 1), + (4, 0), + (4, 0), + ), ) -DELETE_DOMAIN = Schema( - id=ShapeID("com.amazonaws.connecthealth#DeleteDomain"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType({"method": "DELETE", "uri": "/domain/{domainId}"}), +CREATE_SUBSCRIPTION: StaticOperationSchema = ( + 23, + n0, + _CS, + { + _smith: MappingProxyType( + {"method": "POST", "uri": "/domains/{domainId}/subscriptions", "code": 201} ) - ], -) - -GET_DOMAIN_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#GetDomainInput"), - members={ - "domainId": { - "target": DOMAIN_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -GET_DOMAIN_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#GetDomainOutput"), - members={ - "domainId": { - "target": DOMAIN_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "arn": { - "target": DOMAIN_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": DOMAIN_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "kmsKeyArn": {"target": KMS_KEY_ARN}, - "encryptionContext": {"target": ENCRYPTION_CONTEXT}, - "status": { - "target": DOMAIN_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "webAppUrl": {"target": WEB_APP_URL}, - "webAppConfiguration": {"target": WEB_APP_CONFIGURATION}, - "createdAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "tags": {"target": TAG_MAP}, }, + CREATE_SUBSCRIPTION_INPUT, + CREATE_SUBSCRIPTION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -GET_DOMAIN = Schema( - id=ShapeID("com.amazonaws.connecthealth#GetDomain"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType({"method": "GET", "uri": "/domain/{domainId}"}), +DEACTIVATE_SUBSCRIPTION_INPUT: StaticSchema = ( + 18, + n0, + _DSI, + {_sm: None}, + (_dI, _sI), + ((DOMAIN_ID, 9), (SUBSCRIPTION_ID, 9)), +) + +DEACTIVATE_SUBSCRIPTION_OUTPUT: StaticSchema = ( + 18, + n0, + _DSO, + {_smit: None}, + (_su,), + ((SUBSCRIPTION_DESCRIPTION, 0),), +) + +DEACTIVATE_SUBSCRIPTION: StaticOperationSchema = ( + 23, + n0, + _DSe, + { + _smith: MappingProxyType( + { + "method": "POST", + "uri": "/domains/{domainId}/subscriptions/{subscriptionId}/deactivate", + "code": 200, + } ) - ], -) - -SCRIBE_SESSION_ID = Schema( - id=ShapeID("com.amazonaws.connecthealth#ScribeSessionId"), - shape_type=ShapeType.STRING, -) - -GET_MEDICAL_SCRIBE_LISTENING_SESSION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#GetMedicalScribeListeningSessionInput"), - members={ - "sessionId": { - "target": SCRIBE_SESSION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "domainId": { - "target": DOMAIN_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "subscriptionId": { - "target": SUBSCRIPTION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, }, -) - -MEDICAL_SCRIBE_CHANNEL_ID = Schema( - id=ShapeID("com.amazonaws.connecthealth#MedicalScribeChannelId"), - shape_type=ShapeType.INTEGER, -) - -MEDICAL_SCRIBE_PARTICIPANT_ROLE = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#MedicalScribeParticipantRole"), - shape_type=ShapeType.ENUM, - members={"PATIENT": {"target": UNIT}, "CLINICIAN": {"target": UNIT}}, -) - -MEDICAL_SCRIBE_CHANNEL_DEFINITION = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#MedicalScribeChannelDefinition"), - members={ - "channelId": { - "target": MEDICAL_SCRIBE_CHANNEL_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "participantRole": { - "target": MEDICAL_SCRIBE_PARTICIPANT_ROLE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -MEDICAL_SCRIBE_CHANNEL_DEFINITIONS = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#MedicalScribeChannelDefinitions"), - shape_type=ShapeType.LIST, - members={"member": {"target": MEDICAL_SCRIBE_CHANNEL_DEFINITION}}, -) - -NON_NULL_BOOLEAN = Schema( - id=ShapeID("com.amazonaws.connecthealth#NonNullBoolean"), - shape_type=ShapeType.BOOLEAN, -) - -MEDICAL_SCRIBE_LANGUAGE_CODE = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#MedicalScribeLanguageCode"), - shape_type=ShapeType.ENUM, - members={"EN_US": {"target": UNIT}, "MULTI": {"target": UNIT}}, -) - -MEDICAL_SCRIBE_MEDIA_ENCODING = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#MedicalScribeMediaEncoding"), - shape_type=ShapeType.ENUM, - members={"PCM": {"target": UNIT}, "FLAC": {"target": UNIT}}, -) - -MEDICAL_SCRIBE_MEDIA_SAMPLE_RATE_HERTZ = Schema( - id=ShapeID("com.amazonaws.connecthealth#MedicalScribeMediaSampleRateHertz"), - shape_type=ShapeType.INTEGER, -) - -MEDICAL_SCRIBE_POST_STREAM_ACTIONS_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#MedicalScribePostStreamActionsResult"), - members={ - "clinicalNoteGenerationResult": {"target": CLINICAL_NOTE_GENERATION_RESULT} - }, -) - -S3_URI = Schema( - id=ShapeID("com.amazonaws.connecthealth#S3Uri"), shape_type=ShapeType.STRING -) - -MEDICAL_SCRIBE_POST_STREAM_ACTION_SETTINGS_RESPONSE = Schema.collection( - id=ShapeID( - "com.amazonaws.connecthealth#MedicalScribePostStreamActionSettingsResponse" + DEACTIVATE_SUBSCRIPTION_INPUT, + DEACTIVATE_SUBSCRIPTION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + VALIDATION_EXCEPTION, ), - members={ - "outputS3Uri": { - "target": S3_URI, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clinicalNoteGenerationSettings": { - "target": CLINICAL_NOTE_GENERATION_SETTINGS_RESPONSE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, ) -MEDICAL_SCRIBE_STREAM_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#MedicalScribeStreamStatus"), - shape_type=ShapeType.ENUM, - members={ - "IN_PROGRESS": {"target": UNIT}, - "PAUSED": {"target": UNIT}, - "FAILED": {"target": UNIT}, - "COMPLETED": {"target": UNIT}, - }, -) - -MEDICAL_SCRIBE_LISTENING_SESSION_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#MedicalScribeListeningSessionDetails"), - members={ - "sessionId": {"target": SCRIBE_SESSION_ID}, - "domainId": {"target": DOMAIN_ID}, - "subscriptionId": {"target": SUBSCRIPTION_ID}, - "languageCode": {"target": MEDICAL_SCRIBE_LANGUAGE_CODE}, - "mediaSampleRateHertz": {"target": MEDICAL_SCRIBE_MEDIA_SAMPLE_RATE_HERTZ}, - "mediaEncoding": {"target": MEDICAL_SCRIBE_MEDIA_ENCODING}, - "channelDefinitions": {"target": MEDICAL_SCRIBE_CHANNEL_DEFINITIONS}, - "postStreamActionSettings": { - "target": MEDICAL_SCRIBE_POST_STREAM_ACTION_SETTINGS_RESPONSE - }, - "postStreamActionResult": {"target": MEDICAL_SCRIBE_POST_STREAM_ACTIONS_RESULT}, - "encounterContextProvided": {"target": NON_NULL_BOOLEAN}, - "streamStatus": {"target": MEDICAL_SCRIBE_STREAM_STATUS}, - "streamCreationTime": {"target": TIMESTAMP}, - "streamEndTime": {"target": TIMESTAMP}, - }, +DELETE_DOMAIN_INPUT: StaticSchema = ( + 18, + n0, + _DDI, + {_sm: None}, + (_dI,), + ((DOMAIN_ID, 9),), +) + +DELETE_DOMAIN_OUTPUT: StaticSchema = ( + 18, + n0, + _DDO, + {_smit: None}, + (_dI, _a, _st), + ((DOMAIN_ID, 1), (DOMAIN_ARN, 1), (DOMAIN_STATUS, 1)), +) + +DELETE_DOMAIN: StaticOperationSchema = ( + 23, + n0, + _DD, + {_smith: MappingProxyType({"method": "DELETE", "uri": "/domain/{domainId}"})}, + DELETE_DOMAIN_INPUT, + DELETE_DOMAIN_OUTPUT, + (RESOURCE_NOT_FOUND_EXCEPTION,), +) + +GET_DOMAIN_INPUT: StaticSchema = (18, n0, _GDI, {_sm: None}, (_dI,), ((DOMAIN_ID, 9),)) + +GET_DOMAIN_OUTPUT: StaticSchema = ( + 18, + n0, + _GDO, + {_smit: None}, + (_dI, _a, _n, _kKA, _eC, _st, _wAU, _wAC, _cA, _t), + ( + (DOMAIN_ID, 1), + (DOMAIN_ARN, 1), + (DOMAIN_NAME, 1), + (KMS_KEY_ARN, 0), + (ENCRYPTION_CONTEXT, 0), + (DOMAIN_STATUS, 1), + (WEB_APP_URL, 0), + (WEB_APP_CONFIGURATION, 0), + (4, 1), + (TAG_MAP, 0), + ), ) -GET_MEDICAL_SCRIBE_LISTENING_SESSION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#GetMedicalScribeListeningSessionOutput"), - members={ - "medicalScribeListeningSessionDetails": { - "target": MEDICAL_SCRIBE_LISTENING_SESSION_DETAILS - } - }, +GET_DOMAIN: StaticOperationSchema = ( + 23, + n0, + _GD, + {_smith: MappingProxyType({"method": "GET", "uri": "/domain/{domainId}"})}, + GET_DOMAIN_INPUT, + GET_DOMAIN_OUTPUT, + (RESOURCE_NOT_FOUND_EXCEPTION,), +) + +SCRIBE_SESSION_ID: StaticSchema = (3, n0, _SSI, 0) + +GET_MEDICAL_SCRIBE_LISTENING_SESSION_INPUT: StaticSchema = ( + 18, + n0, + _GMSLSI, + {_sm: None}, + (_sIes, _dI, _sI), + ((SCRIBE_SESSION_ID, 9), (DOMAIN_ID, 9), (SUBSCRIPTION_ID, 9)), +) + +MEDICAL_SCRIBE_CHANNEL_ID: StaticSchema = (7, n0, _MSCI, 0) + +MEDICAL_SCRIBE_PARTICIPANT_ROLE: StaticSchema = ( + 14, + n0, + _MSPR, + 0, + (_PATIENT, _CLINICIAN), + ((-1, {_sV: _PATIENT}), (-1, {_sV: _CLINICIAN})), +) + +MEDICAL_SCRIBE_CHANNEL_DEFINITION: StaticSchema = ( + 18, + n0, + _MSCD, + 0, + (_cI, _pR), + ((MEDICAL_SCRIBE_CHANNEL_ID, 1), (MEDICAL_SCRIBE_PARTICIPANT_ROLE, 1)), +) + +MEDICAL_SCRIBE_CHANNEL_DEFINITIONS: StaticSchema = ( + 16, + n0, + _MSCDe, + 0, + (_me,), + ((MEDICAL_SCRIBE_CHANNEL_DEFINITION, 0),), +) + +NON_NULL_BOOLEAN: StaticSchema = (2, n0, _NNB, 0) + +MEDICAL_SCRIBE_LANGUAGE_CODE: StaticSchema = ( + 14, + n0, + _MSLC, + 0, + (_EU, _MULTI), + ((-1, {_sV: _eU}), (-1, {_sV: _mu})), +) + +MEDICAL_SCRIBE_MEDIA_ENCODING: StaticSchema = ( + 14, + n0, + _MSME, + 0, + (_PCM, _FLAC), + ((-1, {_sV: _p}), (-1, {_sV: _f})), +) + +MEDICAL_SCRIBE_MEDIA_SAMPLE_RATE_HERTZ: StaticSchema = (7, n0, _MSMSRH, 0) + +MEDICAL_SCRIBE_POST_STREAM_ACTIONS_RESULT: StaticSchema = ( + 18, + n0, + _MSPSAR, + 0, + (_cNGR,), + ((CLINICAL_NOTE_GENERATION_RESULT, 0),), +) + +S3_URI: StaticSchema = (3, n0, _SU, 0) + +MEDICAL_SCRIBE_POST_STREAM_ACTION_SETTINGS_RESPONSE: StaticSchema = ( + 18, + n0, + _MSPSASR, + 0, + (_oSU, _cNGS), + ((S3_URI, 1), (CLINICAL_NOTE_GENERATION_SETTINGS_RESPONSE, 1)), +) + +MEDICAL_SCRIBE_STREAM_STATUS: StaticSchema = ( + 14, + n0, + _MSSS, + 0, + (_IP, _PAUSED, _FAILED, _COMPLETED), + ( + (-1, {_sV: _IP}), + (-1, {_sV: _PAUSED}), + (-1, {_sV: _FAILED}), + (-1, {_sV: _COMPLETED}), + ), ) -THROTTLING_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#ThrottlingException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=429), - ], - members={"message": {"target": STRING}}, +MEDICAL_SCRIBE_LISTENING_SESSION_DETAILS: StaticSchema = ( + 18, + n0, + _MSLSD, + 0, + (_sIes, _dI, _sI, _lC, _mSRH, _mE, _cD, _pSAS, _pSAR, _eCP, _sS, _sCT, _sET), + ( + (SCRIBE_SESSION_ID, 0), + (DOMAIN_ID, 0), + (SUBSCRIPTION_ID, 0), + (MEDICAL_SCRIBE_LANGUAGE_CODE, 0), + (MEDICAL_SCRIBE_MEDIA_SAMPLE_RATE_HERTZ, 0), + (MEDICAL_SCRIBE_MEDIA_ENCODING, 0), + (MEDICAL_SCRIBE_CHANNEL_DEFINITIONS, 0), + (MEDICAL_SCRIBE_POST_STREAM_ACTION_SETTINGS_RESPONSE, 0), + (MEDICAL_SCRIBE_POST_STREAM_ACTIONS_RESULT, 0), + (NON_NULL_BOOLEAN, 0), + (MEDICAL_SCRIBE_STREAM_STATUS, 0), + (4, 0), + (4, 0), + ), ) -GET_MEDICAL_SCRIBE_LISTENING_SESSION = Schema( - id=ShapeID("com.amazonaws.connecthealth#GetMedicalScribeListeningSession"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#endpoint"), - value=MappingProxyType({"hostPrefix": "streaming."}), - ), - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "uri": "/medical-scribe-stream/domain/{domainId}/subscription/{subscriptionId}/session/{sessionId}", - "method": "GET", - } - ), +GET_MEDICAL_SCRIBE_LISTENING_SESSION_OUTPUT: StaticSchema = ( + 18, + n0, + _GMSLSO, + {_smit: None}, + (_mSLSD,), + ((MEDICAL_SCRIBE_LISTENING_SESSION_DETAILS, 0),), +) + +THROTTLING_EXCEPTION: StaticSchema = (18, n0, _TE, {_s: _c, _sE: 429}, (_m,), ((3, 0),)) + +GET_MEDICAL_SCRIBE_LISTENING_SESSION: StaticOperationSchema = ( + 23, + n0, + _GMSLS, + { + _smithya: MappingProxyType({"hostPrefix": "streaming."}), + _smith: MappingProxyType( + { + "uri": "/medical-scribe-stream/domain/{domainId}/subscription/{subscriptionId}/session/{sessionId}", + "method": "GET", + } ), - ], -) - -JOB_ID = Schema( - id=ShapeID("com.amazonaws.connecthealth#JobId"), shape_type=ShapeType.STRING -) - -GET_PATIENT_INSIGHTS_JOB_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#GetPatientInsightsJobInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.connecthealth#GetPatientInsightsJobRequest", - ) - ], - members={ - "domainId": { - "target": DOMAIN_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "jobId": { - "target": JOB_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -SENSITIVE_NON_EMPTY_STRING = Schema( - id=ShapeID("com.amazonaws.connecthealth#SensitiveNonEmptyString"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -PATIENT_INSIGHTS_ENCOUNTER_CONTEXT = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#PatientInsightsEncounterContext"), - members={ - "encounterReason": { - "target": SENSITIVE_NON_EMPTY_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -NON_EMPTY_STRING = Schema( - id=ShapeID("com.amazonaws.connecthealth#NonEmptyString"), - shape_type=ShapeType.STRING, -) - -FHIR_SERVER = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#FHIRServer"), - members={ - "fhirEndpoint": { - "target": NON_EMPTY_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "oauthToken": {"target": SENSITIVE_NON_EMPTY_STRING}, }, + GET_MEDICAL_SCRIBE_LISTENING_SESSION_INPUT, + GET_MEDICAL_SCRIBE_LISTENING_SESSION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + ), ) -S3_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#S3Source"), - members={ - "uri": { - "target": S3_URI, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +JOB_ID: StaticSchema = (3, n0, _JI, 0) -S3_SOURCES = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#S3Sources"), - shape_type=ShapeType.LIST, - members={"member": {"target": S3_SOURCE}}, +GET_PATIENT_INSIGHTS_JOB_INPUT: StaticSchema = ( + 18, + n0, + _GPIJI, + {_sSI: _cGPIJR, _sm: None}, + (_dI, _jI), + ((DOMAIN_ID, 9), (JOB_ID, 9)), ) -INPUT_DATA_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#InputDataConfig"), - members={ - "fhirServer": {"target": FHIR_SERVER}, - "s3Sources": {"target": S3_SOURCES}, - }, -) +SENSITIVE_NON_EMPTY_STRING: StaticSchema = (3, n0, _SNES, 4) -INSIGHTS_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#InsightsType"), - shape_type=ShapeType.ENUM, - members={"PRE_VISIT": {"target": UNIT}}, +PATIENT_INSIGHTS_ENCOUNTER_CONTEXT: StaticSchema = ( + 18, + n0, + _PIEC, + 0, + (_eRn,), + ((SENSITIVE_NON_EMPTY_STRING, 1),), ) -INSIGHTS_CONTEXT = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#InsightsContext"), - members={ - "insightsType": { - "target": INSIGHTS_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -INSIGHTS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#InsightsOutput"), - members={ - "uri": { - "target": S3_URI, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +NON_EMPTY_STRING: StaticSchema = (3, n0, _NES, 0) -JOB_ARN = Schema( - id=ShapeID("com.amazonaws.connecthealth#JobArn"), shape_type=ShapeType.STRING +FHIR_SERVER: StaticSchema = ( + 18, + n0, + _FHIRS, + 0, + (_fE, _oT), + ((NON_EMPTY_STRING, 1), (SENSITIVE_NON_EMPTY_STRING, 0)), ) -JOB_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#JobStatus"), - shape_type=ShapeType.ENUM, - members={ - "SUBMITTED": {"target": UNIT}, - "IN_PROGRESS": {"target": UNIT}, - "FAILED": {"target": UNIT}, - "SUCCEEDED": {"target": UNIT}, - }, -) +S3_SOURCE: StaticSchema = (18, n0, _SSo, 0, (_u,), ((S3_URI, 1),)) -OUTPUT_DATA_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#OutputDataConfig"), - members={ - "s3OutputPath": { - "target": S3_URI, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +S3_SOURCES: StaticSchema = (16, n0, _SSou, 0, (_me,), ((S3_SOURCE, 0),)) -SENSITIVE_ISO_DATE_STRING = Schema( - id=ShapeID("com.amazonaws.connecthealth#SensitiveIsoDateString"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +INPUT_DATA_CONFIG: StaticSchema = ( + 18, + n0, + _IDC, + 0, + (_fS, _sSo), + ((FHIR_SERVER, 0), (S3_SOURCES, 0)), ) -PRONOUNS = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#Pronouns"), - shape_type=ShapeType.ENUM, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "HE_HIM": {"target": UNIT}, - "SHE_HER": {"target": UNIT}, - "THEY_THEM": {"target": UNIT}, - }, -) +INSIGHTS_TYPE: StaticSchema = (14, n0, _IT, 0, (_PV,), ((-1, {_sV: _PV}),)) -PATIENT_INSIGHTS_PATIENT_CONTEXT = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#PatientInsightsPatientContext"), - members={ - "patientId": { - "target": SENSITIVE_NON_EMPTY_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "dateOfBirth": {"target": SENSITIVE_ISO_DATE_STRING}, - "pronouns": {"target": PRONOUNS}, - }, -) +INSIGHTS_CONTEXT: StaticSchema = (18, n0, _IC, 0, (_iT,), ((INSIGHTS_TYPE, 1),)) -PROVIDER_ROLE = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#ProviderRole"), - shape_type=ShapeType.ENUM, - members={"CLINICIAN": {"target": UNIT}}, -) +INSIGHTS_OUTPUT: StaticSchema = (18, n0, _IO, 0, (_u,), ((S3_URI, 1),)) -SPECIALTY = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#Specialty"), - shape_type=ShapeType.ENUM, - members={"PRIMARY_CARE": {"target": UNIT}}, -) +JOB_ARN: StaticSchema = (3, n0, _JA, 0) -USER_CONTEXT = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#UserContext"), - members={ - "role": { - "target": PROVIDER_ROLE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "userId": { - "target": SENSITIVE_NON_EMPTY_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "specialty": {"target": SPECIALTY}, - }, +JOB_STATUS: StaticSchema = ( + 14, + n0, + _JS, + 0, + (_SUBMITTED, _IP, _FAILED, _SUCCEEDED), + ( + (-1, {_sV: _SUBMITTED}), + (-1, {_sV: _IP}), + (-1, {_sV: _FAILED}), + (-1, {_sV: _SUCCEEDED}), + ), ) -GET_PATIENT_INSIGHTS_JOB_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#GetPatientInsightsJobOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.connecthealth#GetPatientInsightsJobResponse", - ) - ], - members={ - "jobId": { - "target": JOB_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "jobArn": { - "target": JOB_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "jobStatus": { - "target": JOB_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "creationTime": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#timestampFormat"), value="date-time") - ], - }, - "updatedTime": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#timestampFormat"), value="date-time") - ], - }, - "insightsOutput": {"target": INSIGHTS_OUTPUT}, - "statusDetails": {"target": NON_EMPTY_STRING}, - "patientContext": { - "target": PATIENT_INSIGHTS_PATIENT_CONTEXT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "insightsContext": { - "target": INSIGHTS_CONTEXT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "encounterContext": { - "target": PATIENT_INSIGHTS_ENCOUNTER_CONTEXT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "userContext": { - "target": USER_CONTEXT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "inputDataConfig": { - "target": INPUT_DATA_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "outputDataConfig": { - "target": OUTPUT_DATA_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +OUTPUT_DATA_CONFIG: StaticSchema = (18, n0, _ODC, 0, (_sOP,), ((S3_URI, 1),)) + +SENSITIVE_ISO_DATE_STRING: StaticSchema = (3, n0, _SIDS, 4) + +PRONOUNS: StaticSchema = ( + 14, + n0, + _P, + 4, + (_HH, _SH, _TT), + ((-1, {_sV: _HH}), (-1, {_sV: _SH}), (-1, {_sV: _TT})), +) + +PATIENT_INSIGHTS_PATIENT_CONTEXT: StaticSchema = ( + 18, + n0, + _PIPC, + 0, + (_pI, _dOB, _pr), + ((SENSITIVE_NON_EMPTY_STRING, 1), (SENSITIVE_ISO_DATE_STRING, 0), (PRONOUNS, 0)), +) + +PROVIDER_ROLE: StaticSchema = ( + 14, + n0, + _PR, + 0, + (_CLINICIAN,), + ((-1, {_sV: _CLINICIAN}),), +) + +SPECIALTY: StaticSchema = (14, n0, _S, 0, (_PC,), ((-1, {_sV: _PC}),)) + +USER_CONTEXT: StaticSchema = ( + 18, + n0, + _UC, + 0, + (_r, _uI, _sp), + ((PROVIDER_ROLE, 1), (SENSITIVE_NON_EMPTY_STRING, 1), (SPECIALTY, 0)), +) + +GET_PATIENT_INSIGHTS_JOB_OUTPUT: StaticSchema = ( + 18, + n0, + _GPIJO, + {_sSI: _cGPIJRo, _smit: None}, + (_jI, _jA, _jS, _cTr, _uT, _iO, _sD, _pC, _iC, _eCn, _uC, _iDC, _oDC), + ( + (JOB_ID, 1), + (JOB_ARN, 1), + (JOB_STATUS, 1), + (4, {_sF: _dt}), + (4, {_sF: _dt}), + (INSIGHTS_OUTPUT, 0), + (NON_EMPTY_STRING, 0), + (PATIENT_INSIGHTS_PATIENT_CONTEXT, 1), + (INSIGHTS_CONTEXT, 1), + (PATIENT_INSIGHTS_ENCOUNTER_CONTEXT, 1), + (USER_CONTEXT, 1), + (INPUT_DATA_CONFIG, 1), + (OUTPUT_DATA_CONFIG, 1), + ), ) -GET_PATIENT_INSIGHTS_JOB = Schema( - id=ShapeID("com.amazonaws.connecthealth#GetPatientInsightsJob"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#endpoint"), - value=MappingProxyType({"hostPrefix": "runtime."}), - ), - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "GET", - "uri": "/domain/{domainId}/patient-insights-job/{jobId}", - } - ), +GET_PATIENT_INSIGHTS_JOB: StaticOperationSchema = ( + 23, + n0, + _GPIJ, + { + _smithya: MappingProxyType({"hostPrefix": "runtime."}), + _smith: MappingProxyType( + { + "code": 200, + "method": "GET", + "uri": "/domain/{domainId}/patient-insights-job/{jobId}", + } ), - ], -) - -GET_SUBSCRIPTION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#GetSubscriptionInput"), - members={ - "domainId": { - "target": DOMAIN_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "subscriptionId": { - "target": SUBSCRIPTION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, }, + GET_PATIENT_INSIGHTS_JOB_INPUT, + GET_PATIENT_INSIGHTS_JOB_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -GET_SUBSCRIPTION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#GetSubscriptionOutput"), - members={"subscription": {"target": SUBSCRIPTION_DESCRIPTION}}, -) - -GET_SUBSCRIPTION = Schema( - id=ShapeID("com.amazonaws.connecthealth#GetSubscription"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/domains/{domainId}/subscriptions/{subscriptionId}", - } - ), +GET_SUBSCRIPTION_INPUT: StaticSchema = ( + 18, + n0, + _GSI, + {_sm: None}, + (_dI, _sI), + ((DOMAIN_ID, 9), (SUBSCRIPTION_ID, 9)), +) + +GET_SUBSCRIPTION_OUTPUT: StaticSchema = ( + 18, + n0, + _GSO, + {_smit: None}, + (_su,), + ((SUBSCRIPTION_DESCRIPTION, 0),), +) + +GET_SUBSCRIPTION: StaticOperationSchema = ( + 23, + n0, + _GS, + { + _smith: MappingProxyType( + { + "method": "GET", + "uri": "/domains/{domainId}/subscriptions/{subscriptionId}", + } ) - ], -) - -LIST_DOMAINS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#ListDomainsInput"), - members={ - "status": { - "target": DOMAIN_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="status")], - }, - "maxResults": { - "target": INTEGER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "nextToken": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - }, -) - -DOMAIN_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#DomainSummary"), - members={ - "domainId": { - "target": DOMAIN_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "arn": { - "target": DOMAIN_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "name": { - "target": DOMAIN_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "status": { - "target": DOMAIN_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -DOMAIN_SUMMARY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#DomainSummaryList"), - shape_type=ShapeType.LIST, - members={"member": {"target": DOMAIN_SUMMARY}}, -) - -LIST_DOMAINS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#ListDomainsOutput"), - members={ - "domains": { - "target": DOMAIN_SUMMARY_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": STRING}, }, + GET_SUBSCRIPTION_INPUT, + GET_SUBSCRIPTION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -LIST_DOMAINS = Schema( - id=ShapeID("com.amazonaws.connecthealth#ListDomains"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType({"method": "GET", "uri": "/domain"}), +LIST_DOMAINS_INPUT: StaticSchema = ( + 18, + n0, + _LDI, + {_sm: None}, + (_st, _mR, _nT), + ((DOMAIN_STATUS, {_sQ: _st}), (7, {_sQ: _mR}), (3, {_sQ: _nT})), +) + +DOMAIN_SUMMARY: StaticSchema = ( + 18, + n0, + _DSo, + 0, + (_dI, _a, _n, _st, _cA), + ((DOMAIN_ID, 1), (DOMAIN_ARN, 1), (DOMAIN_NAME, 1), (DOMAIN_STATUS, 1), (4, 1)), +) + +DOMAIN_SUMMARY_LIST: StaticSchema = (16, n0, _DSL, 0, (_me,), ((DOMAIN_SUMMARY, 0),)) + +LIST_DOMAINS_OUTPUT: StaticSchema = ( + 18, + n0, + _LDO, + {_smit: None}, + (_d, _nT), + ((DOMAIN_SUMMARY_LIST, 1), (3, 0)), +) + +LIST_DOMAINS: StaticOperationSchema = ( + 23, + n0, + _LD, + {_smith: MappingProxyType({"method": "GET", "uri": "/domain"})}, + LIST_DOMAINS_INPUT, + LIST_DOMAINS_OUTPUT, + (), +) + +LIST_SUBSCRIPTIONS_INPUT: StaticSchema = ( + 18, + n0, + _LSI, + {_sm: None}, + (_dI, _mR, _nT), + ((DOMAIN_ID, 9), (7, {_sQ: _mR}), (3, {_sQ: _nT})), +) + +SUBSCRIPTION_LIST: StaticSchema = ( + 16, + n0, + _SL, + 0, + (_me,), + ((SUBSCRIPTION_DESCRIPTION, 0),), +) + +LIST_SUBSCRIPTIONS_OUTPUT: StaticSchema = ( + 18, + n0, + _LSO, + {_smit: None}, + (_sub, _nT), + ((SUBSCRIPTION_LIST, 1), (3, 0)), +) + +LIST_SUBSCRIPTIONS: StaticOperationSchema = ( + 23, + n0, + _LS, + { + _smith: MappingProxyType( + {"method": "GET", "uri": "/domains/{domainId}/subscriptions"} ) - ], -) - -LIST_SUBSCRIPTIONS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#ListSubscriptionsInput"), - members={ - "domainId": { - "target": DOMAIN_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "maxResults": { - "target": INTEGER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "nextToken": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - }, -) - -SUBSCRIPTION_LIST = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#SubscriptionList"), - shape_type=ShapeType.LIST, - members={"member": {"target": SUBSCRIPTION_DESCRIPTION}}, -) - -LIST_SUBSCRIPTIONS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#ListSubscriptionsOutput"), - members={ - "subscriptions": { - "target": SUBSCRIPTION_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": STRING}, }, + LIST_SUBSCRIPTIONS_INPUT, + LIST_SUBSCRIPTIONS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -LIST_SUBSCRIPTIONS = Schema( - id=ShapeID("com.amazonaws.connecthealth#ListSubscriptions"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/domains/{domainId}/subscriptions"} - ), - ) - ], -) - -LIST_TAGS_FOR_RESOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#ListTagsForResourceInput"), - members={ - "resourceArn": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, +LIST_TAGS_FOR_RESOURCE_INPUT: StaticSchema = ( + 18, + n0, + _LTFRI, + {_sm: None}, + (_rA,), + ((3, 9),), ) -LIST_TAGS_FOR_RESOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#ListTagsForResourceOutput"), - members={"tags": {"target": TAG_MAP}}, +LIST_TAGS_FOR_RESOURCE_OUTPUT: StaticSchema = ( + 18, + n0, + _LTFRO, + {_smit: None}, + (_t,), + ((TAG_MAP, 0),), ) -LIST_TAGS_FOR_RESOURCE = Schema( - id=ShapeID("com.amazonaws.connecthealth#ListTagsForResource"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"uri": "/tags/{resourceArn}", "method": "GET", "code": 200} - ), +LIST_TAGS_FOR_RESOURCE: StaticOperationSchema = ( + 23, + n0, + _LTFR, + { + _smith: MappingProxyType( + {"uri": "/tags/{resourceArn}", "method": "GET", "code": 200} ) - ], -) - -MEDICAL_SCRIBE_AUDIO_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#MedicalScribeAudioEvent"), - members={ - "audioChunk": { - "target": AUDIO_CHUNK, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -MEDICAL_SCRIBE_BINARY_AUDIO_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#MedicalScribeBinaryAudioEvent"), - members={ - "audioChunk": { - "target": AUDIO_CHUNK, - "traits": [ - Trait.new(id=ShapeID("smithy.api#eventPayload")), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, -) - -ENCOUNTER_CONTEXT = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#EncounterContext"), - members={"unstructuredContext": {"target": SENSITIVE_MARKDOWN_STRING}}, -) - -MEDICAL_SCRIBE_POST_STREAM_ACTION_SETTINGS = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#MedicalScribePostStreamActionSettings"), - members={ - "outputS3Uri": { - "target": S3_URI, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clinicalNoteGenerationSettings": { - "target": CLINICAL_NOTE_GENERATION_SETTINGS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -MEDICAL_SCRIBE_CONFIGURATION_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#MedicalScribeConfigurationEvent"), - members={ - "postStreamActionSettings": { - "target": MEDICAL_SCRIBE_POST_STREAM_ACTION_SETTINGS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "channelDefinitions": {"target": MEDICAL_SCRIBE_CHANNEL_DEFINITIONS}, - "encounterContext": {"target": ENCOUNTER_CONTEXT}, }, + LIST_TAGS_FOR_RESOURCE_INPUT, + LIST_TAGS_FOR_RESOURCE_OUTPUT, + (), +) + +MEDICAL_SCRIBE_AUDIO_EVENT: StaticSchema = ( + 18, + n0, + _MSAE, + 0, + (_aC,), + ((AUDIO_CHUNK, 1),), +) + +MEDICAL_SCRIBE_BINARY_AUDIO_EVENT: StaticSchema = ( + 18, + n0, + _MSBAE, + 0, + (_aC,), + ((AUDIO_CHUNK, {_sP: None, _smi: None}),), +) + +ENCOUNTER_CONTEXT: StaticSchema = ( + 18, + n0, + _ECn, + 0, + (_uCn,), + ((SENSITIVE_MARKDOWN_STRING, 0),), +) + +MEDICAL_SCRIBE_POST_STREAM_ACTION_SETTINGS: StaticSchema = ( + 18, + n0, + _MSPSAS, + 0, + (_oSU, _cNGS), + ((S3_URI, 1), (CLINICAL_NOTE_GENERATION_SETTINGS, 1)), +) + +MEDICAL_SCRIBE_CONFIGURATION_EVENT: StaticSchema = ( + 18, + n0, + _MSCE, + 0, + (_pSAS, _cD, _eCn), + ( + (MEDICAL_SCRIBE_POST_STREAM_ACTION_SETTINGS, 1), + (MEDICAL_SCRIBE_CHANNEL_DEFINITIONS, 0), + (ENCOUNTER_CONTEXT, 0), + ), ) -MEDICAL_SCRIBE_SESSION_CONTROL_EVENT_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#MedicalScribeSessionControlEventType"), - shape_type=ShapeType.ENUM, - members={"END_OF_SESSION": {"target": UNIT}}, +MEDICAL_SCRIBE_SESSION_CONTROL_EVENT_TYPE: StaticSchema = ( + 14, + n0, + _MSSCET, + 0, + (_EOS,), + ((-1, {_sV: _EOS}),), +) + +MEDICAL_SCRIBE_SESSION_CONTROL_EVENT: StaticSchema = ( + 18, + n0, + _MSSCE, + 0, + (_ty,), + ((MEDICAL_SCRIBE_SESSION_CONTROL_EVENT_TYPE, 0),), +) + +MEDICAL_SCRIBE_INPUT_STREAM: StaticSchema = ( + 19, + n0, + _MSIS, + {_smithyap: None}, + (_aE, _bAE, _sCE, _cE), + ( + (MEDICAL_SCRIBE_AUDIO_EVENT, 0), + (MEDICAL_SCRIBE_BINARY_AUDIO_EVENT, 0), + (MEDICAL_SCRIBE_SESSION_CONTROL_EVENT, 0), + (MEDICAL_SCRIBE_CONFIGURATION_EVENT, 0), + ), ) -MEDICAL_SCRIBE_SESSION_CONTROL_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#MedicalScribeSessionControlEvent"), - members={"type": {"target": MEDICAL_SCRIBE_SESSION_CONTROL_EVENT_TYPE}}, +START_MEDICAL_SCRIBE_LISTENING_SESSION_INPUT: StaticSchema = ( + 18, + n0, + _SMSLSI, + {_sm: None}, + (_sIes, _dI, _sI, _lC, _mSRH, _mE, _iS), + ( + (SCRIBE_SESSION_ID, {_sHm: _xamsi, _smi: None}), + (DOMAIN_ID, {_sHm: _xamdi, _smi: None}), + (SUBSCRIPTION_ID, {_sHm: _xamsi_, _smi: None}), + (MEDICAL_SCRIBE_LANGUAGE_CODE, {_sHm: _xamlc, _smi: None}), + (MEDICAL_SCRIBE_MEDIA_SAMPLE_RATE_HERTZ, {_sHm: _xamsr, _smi: None}), + (MEDICAL_SCRIBE_MEDIA_ENCODING, {_sHm: _xamme, _smi: None}), + (MEDICAL_SCRIBE_INPUT_STREAM, 16), + ), ) -MEDICAL_SCRIBE_INPUT_STREAM = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#MedicalScribeInputStream"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#streaming"))], - members={ - "audioEvent": {"target": MEDICAL_SCRIBE_AUDIO_EVENT}, - "binaryAudioEvent": {"target": MEDICAL_SCRIBE_BINARY_AUDIO_EVENT}, - "sessionControlEvent": {"target": MEDICAL_SCRIBE_SESSION_CONTROL_EVENT}, - "configurationEvent": {"target": MEDICAL_SCRIBE_CONFIGURATION_EVENT}, - }, +REQUEST_ID: StaticSchema = (3, n0, _RI, 0) + +MEDICAL_SCRIBE_TRANSCRIPT_SEGMENT: StaticSchema = ( + 18, + n0, + _MSTS, + 0, + (_sIeg, _aBO, _aEO, _iP, _cI, _co), + ( + (3, 0), + (AUDIO_OFFSET, 0), + (AUDIO_OFFSET, 0), + (NON_NULL_BOOLEAN, 0), + (3, 0), + (3, 0), + ), ) -START_MEDICAL_SCRIBE_LISTENING_SESSION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#StartMedicalScribeListeningSessionInput"), - members={ - "sessionId": { - "target": SCRIBE_SESSION_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-medscribe-session-id", - ), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "domainId": { - "target": DOMAIN_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-medscribe-domain-id", - ), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "subscriptionId": { - "target": SUBSCRIPTION_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-medscribe-subscription-id", - ), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "languageCode": { - "target": MEDICAL_SCRIBE_LANGUAGE_CODE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-medscribe-language-code", - ), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "mediaSampleRateHertz": { - "target": MEDICAL_SCRIBE_MEDIA_SAMPLE_RATE_HERTZ, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-medscribe-sample-rate", - ), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "mediaEncoding": { - "target": MEDICAL_SCRIBE_MEDIA_ENCODING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-medscribe-media-encoding", - ), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "inputStream": { - "target": MEDICAL_SCRIBE_INPUT_STREAM, - "traits": [Trait.new(id=ShapeID("smithy.api#httpPayload"))], - }, - }, +MEDICAL_SCRIBE_TRANSCRIPT_EVENT: StaticSchema = ( + 18, + n0, + _MSTE, + 0, + (_tS,), + ((MEDICAL_SCRIBE_TRANSCRIPT_SEGMENT, 0),), +) + +MEDICAL_SCRIBE_OUTPUT_STREAM: StaticSchema = ( + 19, + n0, + _MSOS, + {_smithyap: None}, + (_tE, _iFE, _vE), + ( + (MEDICAL_SCRIBE_TRANSCRIPT_EVENT, 0), + (INTERNAL_SERVER_EXCEPTION, 0), + (VALIDATION_EXCEPTION, 0), + ), ) -REQUEST_ID = Schema( - id=ShapeID("com.amazonaws.connecthealth#RequestId"), shape_type=ShapeType.STRING +START_MEDICAL_SCRIBE_LISTENING_SESSION_OUTPUT: StaticSchema = ( + 18, + n0, + _SMSLSO, + {_smit: None}, + (_sIes, _dI, _sI, _rI, _lC, _mSRH, _mE, _rS), + ( + (SCRIBE_SESSION_ID, {_sHm: _xamsi}), + (DOMAIN_ID, {_sHm: _xamdi}), + (SUBSCRIPTION_ID, {_sHm: _xamsi_}), + (REQUEST_ID, {_sHm: _xari}), + (MEDICAL_SCRIBE_LANGUAGE_CODE, {_sHm: _xamlc}), + (MEDICAL_SCRIBE_MEDIA_SAMPLE_RATE_HERTZ, {_sHm: _xamsr}), + (MEDICAL_SCRIBE_MEDIA_ENCODING, {_sHm: _xamme}), + (MEDICAL_SCRIBE_OUTPUT_STREAM, 16), + ), ) -MEDICAL_SCRIBE_TRANSCRIPT_SEGMENT = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#MedicalScribeTranscriptSegment"), - members={ - "segmentId": {"target": STRING}, - "audioBeginOffset": {"target": AUDIO_OFFSET}, - "audioEndOffset": {"target": AUDIO_OFFSET}, - "isPartial": {"target": NON_NULL_BOOLEAN}, - "channelId": {"target": STRING}, - "content": {"target": STRING}, - }, +START_MEDICAL_SCRIBE_LISTENING_SESSION: StaticOperationSchema = ( + 23, + n0, + _SMSLS, + { + _smithya: MappingProxyType({"hostPrefix": "streaming."}), + _smith: MappingProxyType({"uri": "/medical-scribe-stream/", "method": "POST"}), + }, + START_MEDICAL_SCRIBE_LISTENING_SESSION_INPUT, + START_MEDICAL_SCRIBE_LISTENING_SESSION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -MEDICAL_SCRIBE_TRANSCRIPT_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#MedicalScribeTranscriptEvent"), - members={"transcriptSegment": {"target": MEDICAL_SCRIBE_TRANSCRIPT_SEGMENT}}, +START_PATIENT_INSIGHTS_JOB_INPUT: StaticSchema = ( + 18, + n0, + _SPIJI, + {_sSI: _cSPIJR, _sm: None}, + (_dI, _pC, _iC, _eCn, _uC, _iDC, _oDC, _cTl), + ( + (DOMAIN_ID, 9), + (PATIENT_INSIGHTS_PATIENT_CONTEXT, 1), + (INSIGHTS_CONTEXT, 1), + (PATIENT_INSIGHTS_ENCOUNTER_CONTEXT, 1), + (USER_CONTEXT, 1), + (INPUT_DATA_CONFIG, 1), + (OUTPUT_DATA_CONFIG, 1), + (NON_EMPTY_STRING, 2), + ), ) -MEDICAL_SCRIBE_OUTPUT_STREAM = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#MedicalScribeOutputStream"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#streaming"))], - members={ - "transcriptEvent": {"target": MEDICAL_SCRIBE_TRANSCRIPT_EVENT}, - "internalFailureException": {"target": INTERNAL_SERVER_EXCEPTION}, - "validationException": {"target": VALIDATION_EXCEPTION}, +START_PATIENT_INSIGHTS_JOB_OUTPUT: StaticSchema = ( + 18, + n0, + _SPIJO, + {_sSI: _cSPIJRo, _smit: None}, + (_jA, _jI, _cTr), + ((JOB_ARN, 1), (JOB_ID, 1), (4, {_sF: _dt})), +) + +START_PATIENT_INSIGHTS_JOB: StaticOperationSchema = ( + 23, + n0, + _SPIJ, + { + _smithya: MappingProxyType({"hostPrefix": "runtime."}), + _smith: MappingProxyType( + { + "code": 200, + "method": "POST", + "uri": "/domain/{domainId}/patient-insights-job", + } + ), }, + START_PATIENT_INSIGHTS_JOB_INPUT, + START_PATIENT_INSIGHTS_JOB_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -START_MEDICAL_SCRIBE_LISTENING_SESSION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#StartMedicalScribeListeningSessionOutput"), - members={ - "sessionId": { - "target": SCRIBE_SESSION_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-medscribe-session-id", - ) - ], - }, - "domainId": { - "target": DOMAIN_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-medscribe-domain-id", - ) - ], - }, - "subscriptionId": { - "target": SUBSCRIPTION_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-medscribe-subscription-id", - ) - ], - }, - "requestId": { - "target": REQUEST_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), value="x-amzn-request-id" - ) - ], - }, - "languageCode": { - "target": MEDICAL_SCRIBE_LANGUAGE_CODE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-medscribe-language-code", - ) - ], - }, - "mediaSampleRateHertz": { - "target": MEDICAL_SCRIBE_MEDIA_SAMPLE_RATE_HERTZ, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-medscribe-sample-rate", - ) - ], - }, - "mediaEncoding": { - "target": MEDICAL_SCRIBE_MEDIA_ENCODING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-medscribe-media-encoding", - ) - ], - }, - "responseStream": { - "target": MEDICAL_SCRIBE_OUTPUT_STREAM, - "traits": [Trait.new(id=ShapeID("smithy.api#httpPayload"))], - }, - }, +TAG_RESOURCE_INPUT: StaticSchema = ( + 18, + n0, + _TRI, + {_sm: None}, + (_rA, _t), + ((3, 9), (TAG_MAP, 1)), ) -START_MEDICAL_SCRIBE_LISTENING_SESSION = Schema( - id=ShapeID("com.amazonaws.connecthealth#StartMedicalScribeListeningSession"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#endpoint"), - value=MappingProxyType({"hostPrefix": "streaming."}), - ), - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"uri": "/medical-scribe-stream/", "method": "POST"} - ), - ), - ], -) +TAG_RESOURCE_OUTPUT: StaticSchema = (18, n0, _TRO, {_sSI: _sU, _smit: None}) -START_PATIENT_INSIGHTS_JOB_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#StartPatientInsightsJobInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.connecthealth#StartPatientInsightsJobRequest", +TAG_RESOURCE: StaticOperationSchema = ( + 23, + n0, + _TR, + { + _smith: MappingProxyType( + {"uri": "/tags/{resourceArn}", "method": "POST", "code": 204} ) - ], - members={ - "domainId": { - "target": DOMAIN_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "patientContext": { - "target": PATIENT_INSIGHTS_PATIENT_CONTEXT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "insightsContext": { - "target": INSIGHTS_CONTEXT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "encounterContext": { - "target": PATIENT_INSIGHTS_ENCOUNTER_CONTEXT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "userContext": { - "target": USER_CONTEXT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "inputDataConfig": { - "target": INPUT_DATA_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "outputDataConfig": { - "target": OUTPUT_DATA_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientToken": { - "target": NON_EMPTY_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, }, + TAG_RESOURCE_INPUT, + TAG_RESOURCE_OUTPUT, + (), ) -START_PATIENT_INSIGHTS_JOB_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#StartPatientInsightsJobOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.connecthealth#StartPatientInsightsJobResponse", - ) - ], - members={ - "jobArn": { - "target": JOB_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "jobId": { - "target": JOB_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "creationTime": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#timestampFormat"), value="date-time") - ], - }, - }, -) +TAG_KEY_LIST: StaticSchema = (16, n0, _TKL, 0, (_me,), ((TAG_KEY, 0),)) -START_PATIENT_INSIGHTS_JOB = Schema( - id=ShapeID("com.amazonaws.connecthealth#StartPatientInsightsJob"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#endpoint"), - value=MappingProxyType({"hostPrefix": "runtime."}), - ), - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "code": 200, - "method": "POST", - "uri": "/domain/{domainId}/patient-insights-job", - } - ), - ), - ], -) - -TAG_RESOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#TagResourceInput"), - members={ - "resourceArn": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "tags": { - "target": TAG_MAP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +UNTAG_RESOURCE_INPUT: StaticSchema = ( + 18, + n0, + _URI, + {_sm: None}, + (_rA, _tK), + ((3, 9), (TAG_KEY_LIST, {_sQ: _tK, _smi: None})), ) -TAG_RESOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#TagResourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -TAG_RESOURCE = Schema( - id=ShapeID("com.amazonaws.connecthealth#TagResource"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"uri": "/tags/{resourceArn}", "method": "POST", "code": 204} - ), - ) - ], -) - -TAG_KEY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#TagKeyList"), - shape_type=ShapeType.LIST, - members={"member": {"target": TAG_KEY}}, -) - -UNTAG_RESOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#UntagResourceInput"), - members={ - "resourceArn": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "tagKeys": { - "target": TAG_KEY_LIST, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="tagKeys"), - ], - }, - }, -) +UNTAG_RESOURCE_OUTPUT: StaticSchema = (18, n0, _URO, {_sSI: _sU, _smit: None}) -UNTAG_RESOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.connecthealth#UntagResourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -UNTAG_RESOURCE = Schema( - id=ShapeID("com.amazonaws.connecthealth#UntagResource"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"uri": "/tags/{resourceArn}", "method": "DELETE", "code": 204} - ), +UNTAG_RESOURCE: StaticOperationSchema = ( + 23, + n0, + _UR, + { + _smith: MappingProxyType( + {"uri": "/tags/{resourceArn}", "method": "DELETE", "code": 204} ) - ], -) - -CONNECT_HEALTH = Schema( - id=ShapeID("com.amazonaws.connecthealth#ConnectHealth"), - shape_type=ShapeType.SERVICE, - traits=[ - Trait.new( - id=ShapeID("aws.auth#sigv4"), - value=MappingProxyType({"name": "health-agent"}), - ), - Trait.new( - id=ShapeID("smithy.rules#endpointBdd"), - value=MappingProxyType( - { - "version": "1.1", - "parameters": MappingProxyType( + }, + UNTAG_RESOURCE_INPUT, + UNTAG_RESOURCE_OUTPUT, + (), +) + +CONNECT_HEALTH: StaticSchema = ( + 21, + n0, + _CH, + { + _aw: MappingProxyType({"name": "health-agent"}), + _sB: MappingProxyType( + { + "version": "1.1", + "parameters": MappingProxyType( + { + "UseFIPS": MappingProxyType( + { + "builtIn": "AWS::UseFIPS", + "required": True, + "default": False, + "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", + "type": "boolean", + } + ), + "Endpoint": MappingProxyType( + { + "builtIn": "SDK::Endpoint", + "required": False, + "documentation": "Override the endpoint used to send this request", + "type": "string", + } + ), + "Region": MappingProxyType( + { + "builtIn": "AWS::Region", + "required": False, + "documentation": "The AWS region used to dispatch the request.", + "type": "string", + } + ), + } + ), + "conditions": ( + MappingProxyType( { - "UseFIPS": MappingProxyType( + "fn": "isSet", + "argv": (MappingProxyType({"ref": "Endpoint"}),), + } + ), + MappingProxyType( + {"fn": "isSet", "argv": (MappingProxyType({"ref": "Region"}),)} + ), + MappingProxyType( + { + "fn": "aws.partition", + "argv": (MappingProxyType({"ref": "Region"}),), + "assign": "PartitionResult", + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": (MappingProxyType({"ref": "UseFIPS"}), True), + } + ), + ), + "results": ( + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: FIPS and custom endpoint are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( { - "builtIn": "AWS::UseFIPS", - "required": True, - "default": False, - "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", - "type": "boolean", + "url": MappingProxyType({"ref": "Endpoint"}), + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), } ), - "Endpoint": MappingProxyType( + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( { - "builtIn": "SDK::Endpoint", - "required": False, - "documentation": "Override the endpoint used to send this request", - "type": "string", + "url": "https://health-agent-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), } ), - "Region": MappingProxyType( + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( { - "builtIn": "AWS::Region", - "required": False, - "documentation": "The AWS region used to dispatch the request.", - "type": "string", + "url": "https://health-agent.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), } ), + "type": "endpoint", } ), - "conditions": ( - MappingProxyType( - { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "Endpoint"}),), - } - ), - MappingProxyType( - { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "Region"}),), - } - ), - MappingProxyType( - { - "fn": "aws.partition", - "argv": (MappingProxyType({"ref": "Region"}),), - "assign": "PartitionResult", - } - ), - MappingProxyType( - { - "fn": "booleanEquals", - "argv": (MappingProxyType({"ref": "UseFIPS"}), True), - } - ), - ), - "results": ( - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: FIPS and custom endpoint are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": MappingProxyType({"ref": "Endpoint"}), - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://health-agent-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://health-agent.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: Missing Region", - "type": "error", - } - ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Missing Region", + "type": "error", + } ), - "root": 2, - "nodeCount": 6, - "nodes": "/////wAAAAH/////AAAAAAAAAAYAAAADAAAAAQAAAAQF9eEFAAAAAgAAAAUF9eEFAAAAAwX14QMF9eEEAAAAAwX14QEF9eEC", - } - ), - ), - Trait.new( - id=ShapeID("aws.api#service"), - value=MappingProxyType( - { - "sdkId": "ConnectHealth", - "arnNamespace": "health-agent", - "endpointPrefix": "health-agent", - "cloudTrailEventSource": "health-agent.amazonaws.com", - } - ), + ), + "root": 2, + "nodeCount": 6, + "nodes": "/////wAAAAH/////AAAAAAAAAAYAAAADAAAAAQAAAAQF9eEFAAAAAgAAAAUF9eEFAAAAAwX14QMF9eEEAAAAAwX14QEF9eEC", + } ), - Trait.new( - id=ShapeID("aws.protocols#restJson1"), - value=MappingProxyType( - {"http": ("h2", "http/1.1"), "eventStreamHttp": ("h2",)} - ), + _aws: MappingProxyType( + { + "sdkId": "ConnectHealth", + "arnNamespace": "health-agent", + "endpointPrefix": "health-agent", + "cloudTrailEventSource": "health-agent.amazonaws.com", + } ), - Trait.new( - id=ShapeID("smithy.api#cors"), - value=MappingProxyType( - { - "origin": "*", - "additionalAllowedHeaders": ( - "*", - "content-type", - "content-length", - "authorization", - "x-amz-date", - "x-amz-security-token", - "x-amz-content-sha256", - "x-amz-user-agent", - "x-api-key", - ), - "additionalExposedHeaders": ( - "x-amzn-errortype", - "x-amzn-requestid", - "x-amzn-trace-id", - "Access-Control-Allow-Origin", - ), - "maxAge": 86400, - } - ), + _aJ: MappingProxyType({"http": ("h2", "http/1.1"), "eventStreamHttp": ("h2",)}), + _smithyapi: MappingProxyType( + { + "origin": "*", + "additionalAllowedHeaders": ( + "*", + "content-type", + "content-length", + "authorization", + "x-amz-date", + "x-amz-security-token", + "x-amz-content-sha256", + "x-amz-user-agent", + "x-api-key", + ), + "additionalExposedHeaders": ( + "x-amzn-errortype", + "x-amzn-requestid", + "x-amzn-trace-id", + "Access-Control-Allow-Origin", + ), + "maxAge": 86400, + } ), - ], + }, ) diff --git a/clients/aws-sdk-connecthealth/src/aws_sdk_connecthealth/client.py b/clients/aws-sdk-connecthealth/src/aws_sdk_connecthealth/client.py index 95fdaf88..908b29c1 100644 --- a/clients/aws-sdk-connecthealth/src/aws_sdk_connecthealth/client.py +++ b/clients/aws-sdk-connecthealth/src/aws_sdk_connecthealth/client.py @@ -1,77 +1,85 @@ # Code generated by smithy-python-codegen DO NOT EDIT. +from __future__ import annotations + from copy import deepcopy import logging from typing import Any, cast +from smithy_aws_core.aio.identity.chain import AsyncIdentityChain from smithy_aws_core.config import ConfigSource from smithy_aws_core.identity import AWSCredentialsIdentity -from smithy_aws_core.identity.chain import IdentityChain -from smithy_core.aio.client import AsyncClient, ClientCall, RequestPipeline -from smithy_core.aio.eventstream import DuplexEventStream +from smithy_core.aio.client import AsyncClient, AsyncClientCall, AsyncRequestPipeline +from smithy_core.aio.eventstream import AsyncDuplexEventStream from smithy_core.deserializers import DeserializeableShape from smithy_core.exceptions import ExpectationNotMetError from smithy_core.schemas import APIOperation from smithy_core.serializers import SerializeableShape -from smithy_http.aio.interfaces import HTTPClient +from smithy_http.aio.interfaces import AsyncHTTPClient from smithy_http.plugins import user_agent_plugin from .config import AsyncConnectHealthConfig, Plugin from .models import ( ACTIVATE_SUBSCRIPTION, - ActivateSubscriptionInput, - ActivateSubscriptionOutput, CREATE_DOMAIN, CREATE_SUBSCRIPTION, - CreateDomainInput, - CreateDomainOutput, - CreateSubscriptionInput, - CreateSubscriptionOutput, DEACTIVATE_SUBSCRIPTION, DELETE_DOMAIN, - DeactivateSubscriptionInput, - DeactivateSubscriptionOutput, - DeleteDomainInput, - DeleteDomainOutput, GET_DOMAIN, GET_MEDICAL_SCRIBE_LISTENING_SESSION, GET_PATIENT_INSIGHTS_JOB, GET_SUBSCRIPTION, - GetDomainInput, - GetDomainOutput, - GetMedicalScribeListeningSessionInput, - GetMedicalScribeListeningSessionOutput, - GetPatientInsightsJobInput, - GetPatientInsightsJobOutput, - GetSubscriptionInput, - GetSubscriptionOutput, LIST_DOMAINS, LIST_SUBSCRIPTIONS, LIST_TAGS_FOR_RESOURCE, - ListDomainsInput, - ListDomainsOutput, - ListSubscriptionsInput, - ListSubscriptionsOutput, - ListTagsForResourceInput, - ListTagsForResourceOutput, MedicalScribeInputStream, MedicalScribeOutputStream, START_MEDICAL_SCRIBE_LISTENING_SESSION, START_PATIENT_INSIGHTS_JOB, StartMedicalScribeListeningSessionInput, StartMedicalScribeListeningSessionOutput, - StartPatientInsightsJobInput, - StartPatientInsightsJobOutput, TAG_RESOURCE, - TagResourceInput, - TagResourceOutput, UNTAG_RESOURCE, - UntagResourceInput, - UntagResourceOutput, _MedicalScribeOutputStreamDeserializer, ) from .user_agent import aws_user_agent_plugin +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .models import ( + ActivateSubscriptionInput, + ActivateSubscriptionOutput, + CreateDomainInput, + CreateDomainOutput, + CreateSubscriptionInput, + CreateSubscriptionOutput, + DeactivateSubscriptionInput, + DeactivateSubscriptionOutput, + DeleteDomainInput, + DeleteDomainOutput, + GetDomainInput, + GetDomainOutput, + GetMedicalScribeListeningSessionInput, + GetMedicalScribeListeningSessionOutput, + GetPatientInsightsJobInput, + GetPatientInsightsJobOutput, + GetSubscriptionInput, + GetSubscriptionOutput, + ListDomainsInput, + ListDomainsOutput, + ListSubscriptionsInput, + ListSubscriptionsOutput, + ListTagsForResourceInput, + ListTagsForResourceOutput, + StartPatientInsightsJobInput, + StartPatientInsightsJobOutput, + TagResourceInput, + TagResourceOutput, + UntagResourceInput, + UntagResourceOutput, + ) + logger = logging.getLogger(__name__) @@ -150,12 +158,12 @@ async def _post_setup(self, config: AsyncConnectHealthConfig) -> None: config_file = await config_context.parsed_profiles() if config_context.profile_source is ConfigSource.OVERRIDE: profile_name = config_context.profile_name - config.aws_credentials_identity_resolver = await IdentityChain.create( + config.aws_credentials_identity_resolver = await AsyncIdentityChain.create( AWSCredentialsIdentity, config_file=config_file, profile_name=profile_name, region_override=config.region, - http_client=cast(HTTPClient | None, config.transport), + http_client=cast(AsyncHTTPClient | None, config.transport), ) async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( @@ -164,7 +172,7 @@ async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( operation: APIOperation[I, O], default_plugins: list[Plugin], plugins: list[Plugin] | None, - ) -> tuple[RequestPipeline[Any, Any], ClientCall[I, O]]: + ) -> tuple[AsyncRequestPipeline[Any, Any], AsyncClientCall[I, O]]: if self._closed: raise RuntimeError( "Cannot invoke an operation on a client that has been closed." @@ -471,7 +479,7 @@ async def start_medical_scribe_listening_session( self, input: StartMedicalScribeListeningSessionInput, plugins: list[Plugin] | None = None, - ) -> DuplexEventStream[ + ) -> AsyncDuplexEventStream[ MedicalScribeInputStream, MedicalScribeOutputStream, StartMedicalScribeListeningSessionOutput, @@ -490,7 +498,7 @@ async def start_medical_scribe_listening_session( invocations. Returns: - A `DuplexEventStream` for bidirectional streaming. + An `AsyncDuplexEventStream` for bidirectional streaming. """ pipeline, call = await self._prepare_call( input, START_MEDICAL_SCRIBE_LISTENING_SESSION, [], plugins diff --git a/clients/aws-sdk-connecthealth/src/aws_sdk_connecthealth/config.py b/clients/aws-sdk-connecthealth/src/aws_sdk_connecthealth/config.py index 1fd6b8c3..2cf3ca21 100644 --- a/clients/aws-sdk-connecthealth/src/aws_sdk_connecthealth/config.py +++ b/clients/aws-sdk-connecthealth/src/aws_sdk_connecthealth/config.py @@ -1,107 +1,126 @@ # Code generated by smithy-python-codegen DO NOT EDIT. from dataclasses import dataclass, field -from typing import Any, Callable, ClassVar, Self, TypeAlias, Union, Unpack +from typing import ( + Any, + Callable, + ClassVar, + Self, + TYPE_CHECKING, + TypeAlias, + Union, + Unpack, +) -from smithy_aws_core.aio.protocols import RestJsonClientProtocol -from smithy_aws_core.auth import SigV4AuthScheme -from smithy_aws_core.config import AwsConfigOverrides, FileSystem -from smithy_aws_core.config.aws_config import AsyncAwsConfig -from smithy_aws_core.config.resolvers import EndpointUriResolver -from smithy_aws_core.config.types import FieldSpec -from smithy_aws_core.endpoints.standard_regional import ( - StandardRegionalEndpointsResolver, +from smithy_aws_core.aio.auth.sigv4 import AsyncSigV4AuthScheme +from smithy_aws_core.aio.config import AsyncFileSystem +from smithy_aws_core.aio.config.aws_config import AsyncAwsConfig, AwsConfigOverrides +from smithy_aws_core.aio.config.resolvers import EndpointUriResolver +from smithy_aws_core.aio.endpoints.standard_regional import ( + AsyncStandardRegionalEndpointsResolver, ) +from smithy_aws_core.aio.protocols import AsyncRestJsonClientProtocol +from smithy_aws_core.config.types import FieldSpec from smithy_aws_core.identity import AWSCredentialsIdentity, AWSIdentityProperties -from smithy_core.aio.interfaces import ( - ClientProtocol, - EndpointResolver, - ProtocolConstructor, - ProtocolSettings, -) -from smithy_core.aio.interfaces.auth import AuthScheme -from smithy_core.aio.interfaces.identity import IdentityResolver -from smithy_core.interceptors import Interceptor +from smithy_core.aio.interfaces import AsyncClientProtocol, AsyncEndpointResolver +from smithy_core.aio.interfaces.auth import AsyncAuthScheme +from smithy_core.aio.interfaces.identity import AsyncIdentityResolver +from smithy_core.interfaces import ProtocolConstructor, ProtocolSettings from smithy_core.interfaces.auth import AuthSchemeResolver from smithy_core.shapes import ShapeID from smithy_http.aio.aiohttp import AIOHTTPClient +from ._private.schemas import CONNECT_HEALTH from .auth import HTTPAuthSchemeResolver -from .models import ( - ActivateSubscriptionInput, - ActivateSubscriptionOutput, - CreateDomainInput, - CreateDomainOutput, - CreateSubscriptionInput, - CreateSubscriptionOutput, - DeactivateSubscriptionInput, - DeactivateSubscriptionOutput, - DeleteDomainInput, - DeleteDomainOutput, - GetDomainInput, - GetDomainOutput, - GetMedicalScribeListeningSessionInput, - GetMedicalScribeListeningSessionOutput, - GetPatientInsightsJobInput, - GetPatientInsightsJobOutput, - GetSubscriptionInput, - GetSubscriptionOutput, - ListDomainsInput, - ListDomainsOutput, - ListSubscriptionsInput, - ListSubscriptionsOutput, - ListTagsForResourceInput, - ListTagsForResourceOutput, - StartMedicalScribeListeningSessionInput, - StartMedicalScribeListeningSessionOutput, - StartPatientInsightsJobInput, - StartPatientInsightsJobOutput, - TagResourceInput, - TagResourceOutput, - UntagResourceInput, - UntagResourceOutput, -) -_ServiceInterceptor = Union[ - Interceptor[ActivateSubscriptionInput, ActivateSubscriptionOutput, Any, Any], - Interceptor[CreateDomainInput, CreateDomainOutput, Any, Any], - Interceptor[CreateSubscriptionInput, CreateSubscriptionOutput, Any, Any], - Interceptor[DeactivateSubscriptionInput, DeactivateSubscriptionOutput, Any, Any], - Interceptor[DeleteDomainInput, DeleteDomainOutput, Any, Any], - Interceptor[GetDomainInput, GetDomainOutput, Any, Any], - Interceptor[ +if TYPE_CHECKING: + from smithy_core.interceptors import Interceptor + from .models import ( + ActivateSubscriptionInput, + ActivateSubscriptionOutput, + CreateDomainInput, + CreateDomainOutput, + CreateSubscriptionInput, + CreateSubscriptionOutput, + DeactivateSubscriptionInput, + DeactivateSubscriptionOutput, + DeleteDomainInput, + DeleteDomainOutput, + GetDomainInput, + GetDomainOutput, GetMedicalScribeListeningSessionInput, GetMedicalScribeListeningSessionOutput, - Any, - Any, - ], - Interceptor[GetPatientInsightsJobInput, GetPatientInsightsJobOutput, Any, Any], - Interceptor[GetSubscriptionInput, GetSubscriptionOutput, Any, Any], - Interceptor[ListDomainsInput, ListDomainsOutput, Any, Any], - Interceptor[ListSubscriptionsInput, ListSubscriptionsOutput, Any, Any], - Interceptor[ListTagsForResourceInput, ListTagsForResourceOutput, Any, Any], - Interceptor[ + GetPatientInsightsJobInput, + GetPatientInsightsJobOutput, + GetSubscriptionInput, + GetSubscriptionOutput, + ListDomainsInput, + ListDomainsOutput, + ListSubscriptionsInput, + ListSubscriptionsOutput, + ListTagsForResourceInput, + ListTagsForResourceOutput, StartMedicalScribeListeningSessionInput, StartMedicalScribeListeningSessionOutput, - Any, - Any, - ], - Interceptor[StartPatientInsightsJobInput, StartPatientInsightsJobOutput, Any, Any], - Interceptor[TagResourceInput, TagResourceOutput, Any, Any], - Interceptor[UntagResourceInput, UntagResourceOutput, Any, Any], -] + StartPatientInsightsJobInput, + StartPatientInsightsJobOutput, + TagResourceInput, + TagResourceOutput, + UntagResourceInput, + UntagResourceOutput, + ) + + _ServiceInterceptor = Union[ + Interceptor[ActivateSubscriptionInput, ActivateSubscriptionOutput, Any, Any], + Interceptor[CreateDomainInput, CreateDomainOutput, Any, Any], + Interceptor[CreateSubscriptionInput, CreateSubscriptionOutput, Any, Any], + Interceptor[ + DeactivateSubscriptionInput, DeactivateSubscriptionOutput, Any, Any + ], + Interceptor[DeleteDomainInput, DeleteDomainOutput, Any, Any], + Interceptor[GetDomainInput, GetDomainOutput, Any, Any], + Interceptor[ + GetMedicalScribeListeningSessionInput, + GetMedicalScribeListeningSessionOutput, + Any, + Any, + ], + Interceptor[GetPatientInsightsJobInput, GetPatientInsightsJobOutput, Any, Any], + Interceptor[GetSubscriptionInput, GetSubscriptionOutput, Any, Any], + Interceptor[ListDomainsInput, ListDomainsOutput, Any, Any], + Interceptor[ListSubscriptionsInput, ListSubscriptionsOutput, Any, Any], + Interceptor[ListTagsForResourceInput, ListTagsForResourceOutput, Any, Any], + Interceptor[ + StartMedicalScribeListeningSessionInput, + StartMedicalScribeListeningSessionOutput, + Any, + Any, + ], + Interceptor[ + StartPatientInsightsJobInput, StartPatientInsightsJobOutput, Any, Any + ], + Interceptor[TagResourceInput, TagResourceOutput, Any, Any], + Interceptor[UntagResourceInput, UntagResourceOutput, Any, Any], + ] +else: + _ServiceInterceptor = Any + _PROTOCOL_SETTINGS = ProtocolSettings( - namespace="com.amazonaws.connecthealth", service_target="ConnectHealth" + namespace="com.amazonaws.connecthealth", + service_target="ConnectHealth", + service_schema=CONNECT_HEALTH, ) class _AsyncConnectHealthConfigOverrides(AwsConfigOverrides, total=False): - endpoint_resolver: EndpointResolver | None + endpoint_resolver: AsyncEndpointResolver | None protocol: ( - ClientProtocol[Any, Any] | ProtocolConstructor[ClientProtocol[Any, Any]] | None + AsyncClientProtocol[Any, Any] + | ProtocolConstructor[AsyncClientProtocol[Any, Any]] + | None ) - auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None + auth_schemes: dict[ShapeID, AsyncAuthScheme[Any, Any, Any, Any]] | None auth_scheme_resolver: AuthSchemeResolver | None @@ -109,17 +128,17 @@ class _AsyncConnectHealthConfigOverrides(AwsConfigOverrides, total=False): class AsyncConnectHealthConfig(AsyncAwsConfig): """ConnectHealth configuration (async-resolved).""" - endpoint_resolver: EndpointResolver | None = None + endpoint_resolver: AsyncEndpointResolver | None = None """ The endpoint resolver used to resolve the final endpoint per-operation based on the configuration. """ - protocol: ClientProtocol[Any, Any] | None = None + protocol: AsyncClientProtocol[Any, Any] | None = None """ Pass a protocol class reference from smithy_aws_core.aio.protocols to - select the protocol, e.g. protocol=AwsJson10ClientProtocol. For custom - protocols a protocol instance may also be passed. + select the protocol, e.g. protocol=AsyncAwsJson10ClientProtocol. For + custom protocols a protocol instance may also be passed. """ interceptors: list[_ServiceInterceptor] = field(default_factory=lambda: []) @@ -128,7 +147,7 @@ class AsyncConnectHealthConfig(AsyncAwsConfig): execution of a request. """ - auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None = None + auth_schemes: dict[ShapeID, AsyncAuthScheme[Any, Any, Any, Any]] | None = None """A map of auth scheme ids to auth schemes.""" auth_scheme_resolver: AuthSchemeResolver | None = None @@ -138,7 +157,7 @@ class AsyncConnectHealthConfig(AsyncAwsConfig): """ aws_credentials_identity_resolver: ( - IdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None + AsyncIdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None ) = None """Resolves AWS Credentials. Required for operations that use Sigv4 Auth.""" @@ -179,24 +198,24 @@ class AsyncConnectHealthConfig(AsyncAwsConfig): default=None, resolver=EndpointUriResolver("connecthealth") ), "endpoint_resolver": FieldSpec( - default_factory=lambda: StandardRegionalEndpointsResolver( + default_factory=lambda: AsyncStandardRegionalEndpointsResolver( endpoint_prefix="health-agent" ) ), "protocol": FieldSpec( - default_factory=lambda: RestJsonClientProtocol(_PROTOCOL_SETTINGS), + default_factory=lambda: AsyncRestJsonClientProtocol(_PROTOCOL_SETTINGS), converter=lambda p: p(_PROTOCOL_SETTINGS) if isinstance(p, type) else p, ), "auth_schemes": FieldSpec( default_factory=lambda: { - ShapeID("aws.auth#sigv4"): SigV4AuthScheme(service="health-agent") + ShapeID("aws.auth#sigv4"): AsyncSigV4AuthScheme(service="health-agent") } ), "auth_scheme_resolver": FieldSpec(default_factory=HTTPAuthSchemeResolver), "transport": FieldSpec(default_factory=lambda: AIOHTTPClient()), } - def set_auth_scheme(self, scheme: AuthScheme[Any, Any, Any, Any]) -> None: + def set_auth_scheme(self, scheme: AsyncAuthScheme[Any, Any, Any, Any]) -> None: """ Set an auth scheme implementation using its scheme ID. :param scheme: The auth scheme to add or replace. @@ -210,7 +229,7 @@ async def resolve( # pyright: ignore[reportIncompatibleMethodOverride] cls, *, profile: str | None = None, - fs: FileSystem | None = None, + fs: AsyncFileSystem | None = None, config_file_path: str | None = None, credentials_file_path: str | None = None, **overrides: Unpack[_AsyncConnectHealthConfigOverrides], diff --git a/clients/aws-sdk-connecthealth/src/aws_sdk_connecthealth/models.py b/clients/aws-sdk-connecthealth/src/aws_sdk_connecthealth/models.py index 293e0f32..6aabf5dd 100644 --- a/clients/aws-sdk-connecthealth/src/aws_sdk_connecthealth/models.py +++ b/clients/aws-sdk-connecthealth/src/aws_sdk_connecthealth/models.py @@ -1,6329 +1,480 @@ # Code generated by smithy-python-codegen DO NOT EDIT. -from dataclasses import dataclass, field -from datetime import datetime, timezone -from enum import StrEnum -import logging -from typing import Any, Literal, Self, Union +from __future__ import annotations -from smithy_core.deserializers import ShapeDeserializer -from smithy_core.documents import TypeRegistry -from smithy_core.exceptions import ModeledError, SerializationError -from smithy_core.response import EMPTY_RESPONSE_METADATA, ResponseMetadata -from smithy_core.schemas import APIOperation, Schema -from smithy_core.serializers import ShapeSerializer +from ._private import schemas as _schemas +from smithy_core._dynamic_models import ModelRegistry +from smithy_core.exceptions import ModeledError +from smithy_core.schemas import APIOperation from smithy_core.shapes import ShapeID -from smithy_core.types import UnknownEnumMixin from ._private.schemas import ( - ACCESS_DENIED_EXCEPTION as _SCHEMA_ACCESS_DENIED_EXCEPTION, ACTIVATE_SUBSCRIPTION as _SCHEMA_ACTIVATE_SUBSCRIPTION, - ACTIVATE_SUBSCRIPTION_INPUT as _SCHEMA_ACTIVATE_SUBSCRIPTION_INPUT, - ACTIVATE_SUBSCRIPTION_OUTPUT as _SCHEMA_ACTIVATE_SUBSCRIPTION_OUTPUT, - ARTIFACT_DETAILS as _SCHEMA_ARTIFACT_DETAILS, - CLINICAL_NOTE_GENERATION_RESULT as _SCHEMA_CLINICAL_NOTE_GENERATION_RESULT, - CLINICAL_NOTE_GENERATION_SETTINGS as _SCHEMA_CLINICAL_NOTE_GENERATION_SETTINGS, - CLINICAL_NOTE_GENERATION_SETTINGS_RESPONSE as _SCHEMA_CLINICAL_NOTE_GENERATION_SETTINGS_RESPONSE, - CONFLICT_EXCEPTION as _SCHEMA_CONFLICT_EXCEPTION, CREATE_DOMAIN as _SCHEMA_CREATE_DOMAIN, - CREATE_DOMAIN_INPUT as _SCHEMA_CREATE_DOMAIN_INPUT, - CREATE_DOMAIN_OUTPUT as _SCHEMA_CREATE_DOMAIN_OUTPUT, CREATE_SUBSCRIPTION as _SCHEMA_CREATE_SUBSCRIPTION, - CREATE_SUBSCRIPTION_INPUT as _SCHEMA_CREATE_SUBSCRIPTION_INPUT, - CREATE_SUBSCRIPTION_OUTPUT as _SCHEMA_CREATE_SUBSCRIPTION_OUTPUT, - CREATE_WEB_APP_CONFIGURATION as _SCHEMA_CREATE_WEB_APP_CONFIGURATION, - CUSTOM_TEMPLATE as _SCHEMA_CUSTOM_TEMPLATE, - CUSTOM_TEMPLATE_RESPONSE as _SCHEMA_CUSTOM_TEMPLATE_RESPONSE, DEACTIVATE_SUBSCRIPTION as _SCHEMA_DEACTIVATE_SUBSCRIPTION, - DEACTIVATE_SUBSCRIPTION_INPUT as _SCHEMA_DEACTIVATE_SUBSCRIPTION_INPUT, - DEACTIVATE_SUBSCRIPTION_OUTPUT as _SCHEMA_DEACTIVATE_SUBSCRIPTION_OUTPUT, DELETE_DOMAIN as _SCHEMA_DELETE_DOMAIN, - DELETE_DOMAIN_INPUT as _SCHEMA_DELETE_DOMAIN_INPUT, - DELETE_DOMAIN_OUTPUT as _SCHEMA_DELETE_DOMAIN_OUTPUT, - DOMAIN_SUMMARY as _SCHEMA_DOMAIN_SUMMARY, - ENCOUNTER_CONTEXT as _SCHEMA_ENCOUNTER_CONTEXT, - ENCRYPTION_CONTEXT as _SCHEMA_ENCRYPTION_CONTEXT, - FHIR_SERVER as _SCHEMA_FHIR_SERVER, GET_DOMAIN as _SCHEMA_GET_DOMAIN, - GET_DOMAIN_INPUT as _SCHEMA_GET_DOMAIN_INPUT, - GET_DOMAIN_OUTPUT as _SCHEMA_GET_DOMAIN_OUTPUT, GET_MEDICAL_SCRIBE_LISTENING_SESSION as _SCHEMA_GET_MEDICAL_SCRIBE_LISTENING_SESSION, - GET_MEDICAL_SCRIBE_LISTENING_SESSION_INPUT as _SCHEMA_GET_MEDICAL_SCRIBE_LISTENING_SESSION_INPUT, - GET_MEDICAL_SCRIBE_LISTENING_SESSION_OUTPUT as _SCHEMA_GET_MEDICAL_SCRIBE_LISTENING_SESSION_OUTPUT, GET_PATIENT_INSIGHTS_JOB as _SCHEMA_GET_PATIENT_INSIGHTS_JOB, - GET_PATIENT_INSIGHTS_JOB_INPUT as _SCHEMA_GET_PATIENT_INSIGHTS_JOB_INPUT, - GET_PATIENT_INSIGHTS_JOB_OUTPUT as _SCHEMA_GET_PATIENT_INSIGHTS_JOB_OUTPUT, GET_SUBSCRIPTION as _SCHEMA_GET_SUBSCRIPTION, - GET_SUBSCRIPTION_INPUT as _SCHEMA_GET_SUBSCRIPTION_INPUT, - GET_SUBSCRIPTION_OUTPUT as _SCHEMA_GET_SUBSCRIPTION_OUTPUT, - INPUT_DATA_CONFIG as _SCHEMA_INPUT_DATA_CONFIG, - INSIGHTS_CONTEXT as _SCHEMA_INSIGHTS_CONTEXT, - INSIGHTS_OUTPUT as _SCHEMA_INSIGHTS_OUTPUT, - INTERNAL_SERVER_EXCEPTION as _SCHEMA_INTERNAL_SERVER_EXCEPTION, LIST_DOMAINS as _SCHEMA_LIST_DOMAINS, - LIST_DOMAINS_INPUT as _SCHEMA_LIST_DOMAINS_INPUT, - LIST_DOMAINS_OUTPUT as _SCHEMA_LIST_DOMAINS_OUTPUT, LIST_SUBSCRIPTIONS as _SCHEMA_LIST_SUBSCRIPTIONS, - LIST_SUBSCRIPTIONS_INPUT as _SCHEMA_LIST_SUBSCRIPTIONS_INPUT, - LIST_SUBSCRIPTIONS_OUTPUT as _SCHEMA_LIST_SUBSCRIPTIONS_OUTPUT, LIST_TAGS_FOR_RESOURCE as _SCHEMA_LIST_TAGS_FOR_RESOURCE, - LIST_TAGS_FOR_RESOURCE_INPUT as _SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT, - LIST_TAGS_FOR_RESOURCE_OUTPUT as _SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT, - MANAGED_TEMPLATE as _SCHEMA_MANAGED_TEMPLATE, - MANAGED_TEMPLATE_RESPONSE as _SCHEMA_MANAGED_TEMPLATE_RESPONSE, - MEDICAL_SCRIBE_AUDIO_EVENT as _SCHEMA_MEDICAL_SCRIBE_AUDIO_EVENT, - MEDICAL_SCRIBE_BINARY_AUDIO_EVENT as _SCHEMA_MEDICAL_SCRIBE_BINARY_AUDIO_EVENT, - MEDICAL_SCRIBE_CHANNEL_DEFINITION as _SCHEMA_MEDICAL_SCRIBE_CHANNEL_DEFINITION, - MEDICAL_SCRIBE_CONFIGURATION_EVENT as _SCHEMA_MEDICAL_SCRIBE_CONFIGURATION_EVENT, - MEDICAL_SCRIBE_INPUT_STREAM as _SCHEMA_MEDICAL_SCRIBE_INPUT_STREAM, - MEDICAL_SCRIBE_LISTENING_SESSION_DETAILS as _SCHEMA_MEDICAL_SCRIBE_LISTENING_SESSION_DETAILS, - MEDICAL_SCRIBE_OUTPUT_STREAM as _SCHEMA_MEDICAL_SCRIBE_OUTPUT_STREAM, - MEDICAL_SCRIBE_POST_STREAM_ACTIONS_RESULT as _SCHEMA_MEDICAL_SCRIBE_POST_STREAM_ACTIONS_RESULT, - MEDICAL_SCRIBE_POST_STREAM_ACTION_SETTINGS as _SCHEMA_MEDICAL_SCRIBE_POST_STREAM_ACTION_SETTINGS, - MEDICAL_SCRIBE_POST_STREAM_ACTION_SETTINGS_RESPONSE as _SCHEMA_MEDICAL_SCRIBE_POST_STREAM_ACTION_SETTINGS_RESPONSE, - MEDICAL_SCRIBE_SESSION_CONTROL_EVENT as _SCHEMA_MEDICAL_SCRIBE_SESSION_CONTROL_EVENT, - MEDICAL_SCRIBE_TRANSCRIPT_EVENT as _SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_EVENT, - MEDICAL_SCRIBE_TRANSCRIPT_SEGMENT as _SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_SEGMENT, - NOTE_TEMPLATE_SETTINGS as _SCHEMA_NOTE_TEMPLATE_SETTINGS, - NOTE_TEMPLATE_SETTINGS_RESPONSE as _SCHEMA_NOTE_TEMPLATE_SETTINGS_RESPONSE, - OUTPUT_DATA_CONFIG as _SCHEMA_OUTPUT_DATA_CONFIG, - PATIENT_INSIGHTS_ENCOUNTER_CONTEXT as _SCHEMA_PATIENT_INSIGHTS_ENCOUNTER_CONTEXT, - PATIENT_INSIGHTS_PATIENT_CONTEXT as _SCHEMA_PATIENT_INSIGHTS_PATIENT_CONTEXT, - RESOURCE_NOT_FOUND_EXCEPTION as _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - S3_SOURCE as _SCHEMA_S3_SOURCE, - SERVICE_QUOTA_EXCEEDED_EXCEPTION as _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, START_MEDICAL_SCRIBE_LISTENING_SESSION as _SCHEMA_START_MEDICAL_SCRIBE_LISTENING_SESSION, - START_MEDICAL_SCRIBE_LISTENING_SESSION_INPUT as _SCHEMA_START_MEDICAL_SCRIBE_LISTENING_SESSION_INPUT, - START_MEDICAL_SCRIBE_LISTENING_SESSION_OUTPUT as _SCHEMA_START_MEDICAL_SCRIBE_LISTENING_SESSION_OUTPUT, START_PATIENT_INSIGHTS_JOB as _SCHEMA_START_PATIENT_INSIGHTS_JOB, - START_PATIENT_INSIGHTS_JOB_INPUT as _SCHEMA_START_PATIENT_INSIGHTS_JOB_INPUT, - START_PATIENT_INSIGHTS_JOB_OUTPUT as _SCHEMA_START_PATIENT_INSIGHTS_JOB_OUTPUT, - SUBSCRIPTION_DESCRIPTION as _SCHEMA_SUBSCRIPTION_DESCRIPTION, TAG_RESOURCE as _SCHEMA_TAG_RESOURCE, - TAG_RESOURCE_INPUT as _SCHEMA_TAG_RESOURCE_INPUT, - TAG_RESOURCE_OUTPUT as _SCHEMA_TAG_RESOURCE_OUTPUT, - TEMPLATE_SECTION_INSTRUCTION as _SCHEMA_TEMPLATE_SECTION_INSTRUCTION, - THROTTLING_EXCEPTION as _SCHEMA_THROTTLING_EXCEPTION, UNTAG_RESOURCE as _SCHEMA_UNTAG_RESOURCE, - UNTAG_RESOURCE_INPUT as _SCHEMA_UNTAG_RESOURCE_INPUT, - UNTAG_RESOURCE_OUTPUT as _SCHEMA_UNTAG_RESOURCE_OUTPUT, - USER_CONTEXT as _SCHEMA_USER_CONTEXT, - VALIDATION_EXCEPTION as _SCHEMA_VALIDATION_EXCEPTION, - WEB_APP_CONFIGURATION as _SCHEMA_WEB_APP_CONFIGURATION, ) +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .models import ( + ActivateSubscriptionInput, + ActivateSubscriptionOutput, + CreateDomainInput, + CreateDomainOutput, + CreateSubscriptionInput, + CreateSubscriptionOutput, + DeactivateSubscriptionInput, + DeactivateSubscriptionOutput, + DeleteDomainInput, + DeleteDomainOutput, + GetDomainInput, + GetDomainOutput, + GetMedicalScribeListeningSessionInput, + GetMedicalScribeListeningSessionOutput, + GetPatientInsightsJobInput, + GetPatientInsightsJobOutput, + GetSubscriptionInput, + GetSubscriptionOutput, + ListDomainsInput, + ListDomainsOutput, + ListSubscriptionsInput, + ListSubscriptionsOutput, + ListTagsForResourceInput, + ListTagsForResourceOutput, + StartMedicalScribeListeningSessionInput, + StartMedicalScribeListeningSessionOutput, + StartPatientInsightsJobInput, + StartPatientInsightsJobOutput, + TagResourceInput, + TagResourceOutput, + UntagResourceInput, + UntagResourceOutput, + ) -logger = logging.getLogger(__name__) - - -class ServiceError(ModeledError): - """ - Base error for all errors in the service. - - Some exceptions do not extend from this class, including - synthetic, implicit, and shared exception types. - """ - - -@dataclass(kw_only=True) -class AccessDeniedException(ServiceError): - """ - This error is thrown when the client does not supply proper credentials - to the API. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACCESS_DENIED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_ACCESS_DENIED_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_ACCESS_DENIED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ACCESS_DENIED_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ActivateSubscriptionInput: - """Dataclass for ActivateSubscriptionInput structure.""" - - domain_id: str | None = None - """The unique identifier of the parent Domain.""" - - subscription_id: str | None = None - """The unique identifier of the Subscription.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACTIVATE_SUBSCRIPTION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.domain_id is not None: - serializer.write_string( - _SCHEMA_ACTIVATE_SUBSCRIPTION_INPUT.members["domainId"], self.domain_id - ) - - if self.subscription_id is not None: - serializer.write_string( - _SCHEMA_ACTIVATE_SUBSCRIPTION_INPUT.members["subscriptionId"], - self.subscription_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["domain_id"] = de.read_string( - _SCHEMA_ACTIVATE_SUBSCRIPTION_INPUT.members["domainId"] - ) - - case 1: - kwargs["subscription_id"] = de.read_string( - _SCHEMA_ACTIVATE_SUBSCRIPTION_INPUT.members["subscriptionId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ACTIVATE_SUBSCRIPTION_INPUT, consumer=_consumer - ) - return kwargs - - -class SubscriptionStatus(UnknownEnumMixin, StrEnum): - ACTIVE = "ACTIVE" - INACTIVE = "INACTIVE" - DELETED = "DELETED" - - -@dataclass(kw_only=True) -class SubscriptionDescription: - """Complete subscription resource data.""" - - domain_id: str - """""" - - subscription_id: str - """""" - - arn: str - """""" - - status: str - """""" - - created_at: datetime - """""" - - last_updated_at: datetime - """""" - - activated_at: datetime | None = None - """""" - - deactivated_at: datetime | None = None - """""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SUBSCRIPTION_DESCRIPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SUBSCRIPTION_DESCRIPTION.members["domainId"], self.domain_id - ) - serializer.write_string( - _SCHEMA_SUBSCRIPTION_DESCRIPTION.members["subscriptionId"], - self.subscription_id, - ) - serializer.write_string( - _SCHEMA_SUBSCRIPTION_DESCRIPTION.members["arn"], self.arn - ) - serializer.write_string( - _SCHEMA_SUBSCRIPTION_DESCRIPTION.members["status"], self.status - ) - serializer.write_timestamp( - _SCHEMA_SUBSCRIPTION_DESCRIPTION.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_SUBSCRIPTION_DESCRIPTION.members["lastUpdatedAt"], - self.last_updated_at, - ) - if self.activated_at is not None: - serializer.write_timestamp( - _SCHEMA_SUBSCRIPTION_DESCRIPTION.members["activatedAt"], - self.activated_at, - ) - - if self.deactivated_at is not None: - serializer.write_timestamp( - _SCHEMA_SUBSCRIPTION_DESCRIPTION.members["deactivatedAt"], - self.deactivated_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["domain_id"] = de.read_string( - _SCHEMA_SUBSCRIPTION_DESCRIPTION.members["domainId"] - ) - - case 1: - kwargs["subscription_id"] = de.read_string( - _SCHEMA_SUBSCRIPTION_DESCRIPTION.members["subscriptionId"] - ) - - case 2: - kwargs["arn"] = de.read_string( - _SCHEMA_SUBSCRIPTION_DESCRIPTION.members["arn"] - ) - - case 3: - kwargs["status"] = SubscriptionStatus( - de.read_string( - _SCHEMA_SUBSCRIPTION_DESCRIPTION.members["status"] - ) - ) - - case 4: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_SUBSCRIPTION_DESCRIPTION.members["createdAt"] - ) - - case 5: - kwargs["last_updated_at"] = de.read_timestamp( - _SCHEMA_SUBSCRIPTION_DESCRIPTION.members["lastUpdatedAt"] - ) - - case 6: - kwargs["activated_at"] = de.read_timestamp( - _SCHEMA_SUBSCRIPTION_DESCRIPTION.members["activatedAt"] - ) - - case 7: - kwargs["deactivated_at"] = de.read_timestamp( - _SCHEMA_SUBSCRIPTION_DESCRIPTION.members["deactivatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SUBSCRIPTION_DESCRIPTION, consumer=_consumer) - if "domain_id" not in kwargs: - kwargs["domain_id"] = "" - if "subscription_id" not in kwargs: - kwargs["subscription_id"] = "" - if "arn" not in kwargs: - kwargs["arn"] = "" - if "status" not in kwargs: - kwargs["status"] = SubscriptionStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "last_updated_at" not in kwargs: - kwargs["last_updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -@dataclass(kw_only=True) -class ActivateSubscriptionOutput: - """Dataclass for ActivateSubscriptionOutput structure.""" - - subscription: SubscriptionDescription | None = None - """""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACTIVATE_SUBSCRIPTION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.subscription is not None: - serializer.write_struct( - _SCHEMA_ACTIVATE_SUBSCRIPTION_OUTPUT.members["subscription"], - self.subscription, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["subscription"] = SubscriptionDescription.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ACTIVATE_SUBSCRIPTION_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InternalServerException(ServiceError): - """This error is thrown when a transient error causes our API to fail.""" - - fault: Literal["client", "server"] | None = "server" - is_retry_safe: bool | None = True - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INTERNAL_SERVER_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INTERNAL_SERVER_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INTERNAL_SERVER_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INTERNAL_SERVER_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ResourceNotFoundException(ServiceError): - """This error is thrown when the requested resource is not found.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ValidationException(ServiceError): - """This error is thrown when the client supplies invalid input to the API.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VALIDATION_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_VALIDATION_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_VALIDATION_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VALIDATION_EXCEPTION, consumer=_consumer) - return kwargs - - -ACTIVATE_SUBSCRIPTION = APIOperation( - input=ActivateSubscriptionInput, - output=ActivateSubscriptionOutput, - schema=_SCHEMA_ACTIVATE_SUBSCRIPTION, - input_schema=_SCHEMA_ACTIVATE_SUBSCRIPTION_INPUT, - output_schema=_SCHEMA_ACTIVATE_SUBSCRIPTION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.connecthealth#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.connecthealth#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.connecthealth#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.connecthealth#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class PostStreamArtifactGenerationStatus(UnknownEnumMixin, StrEnum): - IN_PROGRESS = "IN_PROGRESS" - FAILED = "FAILED" - COMPLETED = "COMPLETED" - - -@dataclass(kw_only=True) -class ArtifactDetails: - """Details about a generated artifact including location and status""" - - output_location: str | None = None - """""" - - status: str | None = None - """The generation status of the artifact""" - - failure_reason: str | None = None - """The reason for failure if the artifact generation failed""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ARTIFACT_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.output_location is not None: - serializer.write_string( - _SCHEMA_ARTIFACT_DETAILS.members["outputLocation"], self.output_location - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_ARTIFACT_DETAILS.members["status"], self.status - ) - - if self.failure_reason is not None: - serializer.write_string( - _SCHEMA_ARTIFACT_DETAILS.members["failureReason"], self.failure_reason - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["output_location"] = de.read_string( - _SCHEMA_ARTIFACT_DETAILS.members["outputLocation"] - ) - - case 1: - kwargs["status"] = PostStreamArtifactGenerationStatus( - de.read_string(_SCHEMA_ARTIFACT_DETAILS.members["status"]) - ) - - case 2: - kwargs["failure_reason"] = de.read_string( - _SCHEMA_ARTIFACT_DETAILS.members["failureReason"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ARTIFACT_DETAILS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ClinicalNoteGenerationResult: - """ - Results of clinical note generation including note, transcript, and - summary - """ - - note_result: ArtifactDetails | None = None - """Details about the generated clinical note""" - - transcript_result: ArtifactDetails | None = None - """Details about the generated transcript""" - - after_visit_summary_result: ArtifactDetails | None = None - """Details about the generated after visit summary""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CLINICAL_NOTE_GENERATION_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.note_result is not None: - serializer.write_struct( - _SCHEMA_CLINICAL_NOTE_GENERATION_RESULT.members["noteResult"], - self.note_result, - ) - - if self.transcript_result is not None: - serializer.write_struct( - _SCHEMA_CLINICAL_NOTE_GENERATION_RESULT.members["transcriptResult"], - self.transcript_result, - ) - - if self.after_visit_summary_result is not None: - serializer.write_struct( - _SCHEMA_CLINICAL_NOTE_GENERATION_RESULT.members[ - "afterVisitSummaryResult" - ], - self.after_visit_summary_result, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["note_result"] = ArtifactDetails.deserialize(de) - - case 1: - kwargs["transcript_result"] = ArtifactDetails.deserialize(de) - - case 2: - kwargs["after_visit_summary_result"] = ArtifactDetails.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CLINICAL_NOTE_GENERATION_RESULT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class TemplateSectionInstruction: - """Instructions for generating a specific section of a clinical note""" - - section_header: str = field(repr=False) - """The header for this section of the template""" - - section_instruction: str = field(repr=False) - """The instruction for generating this section""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TEMPLATE_SECTION_INSTRUCTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_TEMPLATE_SECTION_INSTRUCTION.members["sectionHeader"], - self.section_header, - ) - serializer.write_string( - _SCHEMA_TEMPLATE_SECTION_INSTRUCTION.members["sectionInstruction"], - self.section_instruction, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["section_header"] = de.read_string( - _SCHEMA_TEMPLATE_SECTION_INSTRUCTION.members["sectionHeader"] - ) - - case 1: - kwargs["section_instruction"] = de.read_string( - _SCHEMA_TEMPLATE_SECTION_INSTRUCTION.members[ - "sectionInstruction" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_TEMPLATE_SECTION_INSTRUCTION, consumer=_consumer - ) - if "section_header" not in kwargs: - kwargs["section_header"] = "" - if "section_instruction" not in kwargs: - kwargs["section_instruction"] = "" - return kwargs - - -def _serialize_template_instructions( - serializer: ShapeSerializer, schema: Schema, value: list[TemplateSectionInstruction] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_template_instructions( - deserializer: ShapeDeserializer, schema: Schema -) -> list[TemplateSectionInstruction]: - result: list[TemplateSectionInstruction] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(TemplateSectionInstruction.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class CustomTemplateBase(UnknownEnumMixin, StrEnum): - HISTORY_AND_PHYSICAL = "HISTORY_AND_PHYSICAL" - GIRPP = "GIRPP" - DAP = "DAP" - SIRP = "SIRP" - BIRP = "BIRP" - BEHAVIORAL_SOAP = "BEHAVIORAL_SOAP" - - -@dataclass(kw_only=True) -class CustomTemplate: - """ - Configuration for using a custom note template with specific - instructions - """ - - template_type: str - """The base template type to customize""" - - template_instructions: list[TemplateSectionInstruction] - """Custom instructions for each section of the template""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOM_TEMPLATE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CUSTOM_TEMPLATE.members["templateType"], self.template_type - ) - _serialize_template_instructions( - serializer, - _SCHEMA_CUSTOM_TEMPLATE.members["templateInstructions"], - self.template_instructions, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["template_type"] = CustomTemplateBase( - de.read_string(_SCHEMA_CUSTOM_TEMPLATE.members["templateType"]) - ) - - case 1: - kwargs["template_instructions"] = ( - _deserialize_template_instructions( - de, _SCHEMA_CUSTOM_TEMPLATE.members["templateInstructions"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CUSTOM_TEMPLATE, consumer=_consumer) - if "template_type" not in kwargs: - kwargs["template_type"] = CustomTemplateBase._corrected("") - if "template_instructions" not in kwargs: - kwargs["template_instructions"] = [] - return kwargs - - -class ManagedNoteTemplate(UnknownEnumMixin, StrEnum): - HISTORY_AND_PHYSICAL = "HISTORY_AND_PHYSICAL" - GIRPP = "GIRPP" - DAP = "DAP" - SIRP = "SIRP" - BIRP = "BIRP" - BEHAVIORAL_SOAP = "BEHAVIORAL_SOAP" - PHYSICAL_SOAP = "PHYSICAL_SOAP" - - -@dataclass(kw_only=True) -class ManagedTemplate: - """Configuration for using a managed note template""" - - template_type: str - """The type of managed template to use""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MANAGED_TEMPLATE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MANAGED_TEMPLATE.members["templateType"], self.template_type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["template_type"] = ManagedNoteTemplate( - de.read_string(_SCHEMA_MANAGED_TEMPLATE.members["templateType"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MANAGED_TEMPLATE, consumer=_consumer) - if "template_type" not in kwargs: - kwargs["template_type"] = ManagedNoteTemplate._corrected("") - return kwargs - - -@dataclass -class NoteTemplateSettingsManagedTemplate: - """""" - - value: ManagedTemplate - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_NOTE_TEMPLATE_SETTINGS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_NOTE_TEMPLATE_SETTINGS.members["managedTemplate"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ManagedTemplate.deserialize(deserializer)) - - -@dataclass -class NoteTemplateSettingsCustomTemplate: - """""" - - value: CustomTemplate - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_NOTE_TEMPLATE_SETTINGS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_NOTE_TEMPLATE_SETTINGS.members["customTemplate"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=CustomTemplate.deserialize(deserializer)) - - -@dataclass -class NoteTemplateSettingsUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -NoteTemplateSettings = Union[ - NoteTemplateSettingsManagedTemplate - | NoteTemplateSettingsCustomTemplate - | NoteTemplateSettingsUnknown -] -"""Settings for the note template to use for clinical note generation""" - - -class _NoteTemplateSettingsDeserializer: - _result: NoteTemplateSettings | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> NoteTemplateSettings: - self._result = None - deserializer.read_struct(_SCHEMA_NOTE_TEMPLATE_SETTINGS, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(NoteTemplateSettingsManagedTemplate.deserialize(de)) - - case 1: - self._set_result(NoteTemplateSettingsCustomTemplate.deserialize(de)) - - case _: - self._set_result( - NoteTemplateSettingsUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: NoteTemplateSettings) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class ClinicalNoteGenerationSettings: - """Settings for generating clinical notes from the audio stream""" - - note_template_settings: NoteTemplateSettings - """Settings for the note template to use""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CLINICAL_NOTE_GENERATION_SETTINGS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CLINICAL_NOTE_GENERATION_SETTINGS.members["noteTemplateSettings"], - self.note_template_settings, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["note_template_settings"] = ( - _NoteTemplateSettingsDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CLINICAL_NOTE_GENERATION_SETTINGS, consumer=_consumer - ) - if "note_template_settings" not in kwargs: - kwargs["note_template_settings"] = NoteTemplateSettingsUnknown(tag="") - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(note_template_settings=NoteTemplateSettingsUnknown(tag="")) - - -@dataclass(kw_only=True) -class CustomTemplateResponse: - """Response containing custom template information""" - - template_type: str | None = None - """The base template type that was customized""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOM_TEMPLATE_RESPONSE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.template_type is not None: - serializer.write_string( - _SCHEMA_CUSTOM_TEMPLATE_RESPONSE.members["templateType"], - self.template_type, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["template_type"] = CustomTemplateBase( - de.read_string( - _SCHEMA_CUSTOM_TEMPLATE_RESPONSE.members["templateType"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CUSTOM_TEMPLATE_RESPONSE, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ManagedTemplateResponse: - """Response containing managed template information""" - - template_type: str | None = None - """The type of managed template used""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MANAGED_TEMPLATE_RESPONSE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.template_type is not None: - serializer.write_string( - _SCHEMA_MANAGED_TEMPLATE_RESPONSE.members["templateType"], - self.template_type, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["template_type"] = ManagedNoteTemplate( - de.read_string( - _SCHEMA_MANAGED_TEMPLATE_RESPONSE.members["templateType"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MANAGED_TEMPLATE_RESPONSE, consumer=_consumer) - return kwargs - - -@dataclass -class NoteTemplateSettingsResponseManagedTemplate: - """""" - - value: ManagedTemplateResponse - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_NOTE_TEMPLATE_SETTINGS_RESPONSE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_NOTE_TEMPLATE_SETTINGS_RESPONSE.members["managedTemplate"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ManagedTemplateResponse.deserialize(deserializer)) - - -@dataclass -class NoteTemplateSettingsResponseCustomTemplate: - """""" - - value: CustomTemplateResponse - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_NOTE_TEMPLATE_SETTINGS_RESPONSE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_NOTE_TEMPLATE_SETTINGS_RESPONSE.members["customTemplate"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=CustomTemplateResponse.deserialize(deserializer)) - - -@dataclass -class NoteTemplateSettingsResponseUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -NoteTemplateSettingsResponse = Union[ - NoteTemplateSettingsResponseManagedTemplate - | NoteTemplateSettingsResponseCustomTemplate - | NoteTemplateSettingsResponseUnknown -] -"""Response containing note template settings""" - - -class _NoteTemplateSettingsResponseDeserializer: - _result: NoteTemplateSettingsResponse | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> NoteTemplateSettingsResponse: - self._result = None - deserializer.read_struct( - _SCHEMA_NOTE_TEMPLATE_SETTINGS_RESPONSE, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - NoteTemplateSettingsResponseManagedTemplate.deserialize(de) - ) - - case 1: - self._set_result( - NoteTemplateSettingsResponseCustomTemplate.deserialize(de) - ) - - case _: - self._set_result( - NoteTemplateSettingsResponseUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: NoteTemplateSettingsResponse) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class ClinicalNoteGenerationSettingsResponse: - """Response containing settings for clinical note generation""" - - note_template_settings: NoteTemplateSettingsResponse | None = None - """Settings for the note template used""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CLINICAL_NOTE_GENERATION_SETTINGS_RESPONSE, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.note_template_settings is not None: - serializer.write_struct( - _SCHEMA_CLINICAL_NOTE_GENERATION_SETTINGS_RESPONSE.members[ - "noteTemplateSettings" - ], - self.note_template_settings, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["note_template_settings"] = ( - _NoteTemplateSettingsResponseDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CLINICAL_NOTE_GENERATION_SETTINGS_RESPONSE, consumer=_consumer - ) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls() - - -@dataclass(kw_only=True) -class ConflictException(ServiceError): - """ - This error is thrown when a resource update is no longer valid due to - assumptions about initial state changing. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONFLICT_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_CONFLICT_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_CONFLICT_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONFLICT_EXCEPTION, consumer=_consumer) - return kwargs - - -def _serialize_tag_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_tag_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CreateWebAppConfiguration: - """ - Input configuration for creating a web application. Used only in - CreateDomain operation input. - """ - - ehr_role: str - """ARN of the IAM role used for EHR operations.""" - - idc_instance_id: str - """The Identity Center instance ID to use for creating the application.""" - - idc_region: str - """The AWS region where Identity Center is configured.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_WEB_APP_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_WEB_APP_CONFIGURATION.members["ehrRole"], self.ehr_role - ) - serializer.write_string( - _SCHEMA_CREATE_WEB_APP_CONFIGURATION.members["idcInstanceId"], - self.idc_instance_id, - ) - serializer.write_string( - _SCHEMA_CREATE_WEB_APP_CONFIGURATION.members["idcRegion"], self.idc_region - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["ehr_role"] = de.read_string( - _SCHEMA_CREATE_WEB_APP_CONFIGURATION.members["ehrRole"] - ) - - case 1: - kwargs["idc_instance_id"] = de.read_string( - _SCHEMA_CREATE_WEB_APP_CONFIGURATION.members["idcInstanceId"] - ) - - case 2: - kwargs["idc_region"] = de.read_string( - _SCHEMA_CREATE_WEB_APP_CONFIGURATION.members["idcRegion"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_WEB_APP_CONFIGURATION, consumer=_consumer - ) - if "ehr_role" not in kwargs: - kwargs["ehr_role"] = "" - if "idc_instance_id" not in kwargs: - kwargs["idc_instance_id"] = "" - if "idc_region" not in kwargs: - kwargs["idc_region"] = "" - return kwargs - - -@dataclass(kw_only=True) -class CreateDomainInput: - """Dataclass for CreateDomainInput structure.""" - - name: str | None = None - """The name for the new Domain.""" - - kms_key_arn: str | None = None - """The ARN of the KMS key to use for encrypting data in this Domain.""" - - web_app_setup_configuration: CreateWebAppConfiguration | None = None - """ - Configuration for the Domain web application. Optional, but if provided - all fields are required. - """ - - tags: dict[str, str] | None = None - """Tags to associate with the Domain.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_DOMAIN_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_DOMAIN_INPUT.members["name"], self.name - ) - - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_DOMAIN_INPUT.members["kmsKeyArn"], self.kms_key_arn - ) - - if self.web_app_setup_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_DOMAIN_INPUT.members["webAppSetupConfiguration"], - self.web_app_setup_configuration, - ) - - if self.tags is not None: - _serialize_tag_map( - serializer, _SCHEMA_CREATE_DOMAIN_INPUT.members["tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_DOMAIN_INPUT.members["name"] - ) - - case 1: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_CREATE_DOMAIN_INPUT.members["kmsKeyArn"] - ) - - case 2: - kwargs["web_app_setup_configuration"] = ( - CreateWebAppConfiguration.deserialize(de) - ) - - case 3: - kwargs["tags"] = _deserialize_tag_map( - de, _SCHEMA_CREATE_DOMAIN_INPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_DOMAIN_INPUT, consumer=_consumer) - return kwargs - - -class EncryptionType(UnknownEnumMixin, StrEnum): - AWS_OWNED_KEY = "AWS_OWNED_KEY" - CUSTOMER_MANAGED_KEY = "CUSTOMER_MANAGED_KEY" - - -@dataclass(kw_only=True) -class EncryptionContext: - """Encryption context for a Domain.""" - - encryption_type: str - """The type of encryption key used.""" - - kms_key_arn: str | None = None - """ - The ARN of the KMS key. Only present when encryptionType is - CUSTOMER_MANAGED_KEY. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ENCRYPTION_CONTEXT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_ENCRYPTION_CONTEXT.members["encryptionType"], self.encryption_type - ) - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_ENCRYPTION_CONTEXT.members["kmsKeyArn"], self.kms_key_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["encryption_type"] = EncryptionType( - de.read_string( - _SCHEMA_ENCRYPTION_CONTEXT.members["encryptionType"] - ) - ) - - case 1: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_ENCRYPTION_CONTEXT.members["kmsKeyArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ENCRYPTION_CONTEXT, consumer=_consumer) - if "encryption_type" not in kwargs: - kwargs["encryption_type"] = EncryptionType._corrected("") - return kwargs - - -class DomainStatus(UnknownEnumMixin, StrEnum): - ACTIVE = "ACTIVE" - DELETING = "DELETING" - DELETED = "DELETED" - - -@dataclass(kw_only=True) -class WebAppConfiguration: - """ - Configuration for the Domain web application, including Identity Center - settings. If provided, all fields are required. - """ - - ehr_role: str - """ARN of the IAM role used for EHR operations.""" - - idc_application_id: str - """The Identity Center application ID associated with this Domain.""" - - idc_region: str - """The AWS region where Identity Center is configured.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_WEB_APP_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_WEB_APP_CONFIGURATION.members["ehrRole"], self.ehr_role - ) - serializer.write_string( - _SCHEMA_WEB_APP_CONFIGURATION.members["idcApplicationId"], - self.idc_application_id, - ) - serializer.write_string( - _SCHEMA_WEB_APP_CONFIGURATION.members["idcRegion"], self.idc_region - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["ehr_role"] = de.read_string( - _SCHEMA_WEB_APP_CONFIGURATION.members["ehrRole"] - ) - - case 1: - kwargs["idc_application_id"] = de.read_string( - _SCHEMA_WEB_APP_CONFIGURATION.members["idcApplicationId"] - ) - - case 2: - kwargs["idc_region"] = de.read_string( - _SCHEMA_WEB_APP_CONFIGURATION.members["idcRegion"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_WEB_APP_CONFIGURATION, consumer=_consumer) - if "ehr_role" not in kwargs: - kwargs["ehr_role"] = "" - if "idc_application_id" not in kwargs: - kwargs["idc_application_id"] = "" - if "idc_region" not in kwargs: - kwargs["idc_region"] = "" - return kwargs - - -@dataclass(kw_only=True) -class CreateDomainOutput: - """Dataclass for CreateDomainOutput structure.""" - - domain_id: str - """""" - - arn: str - """""" - - name: str - """""" - - status: str - """""" - - created_at: datetime - """""" - - kms_key_arn: str | None = None - """""" - - encryption_context: EncryptionContext | None = None - """""" - - web_app_url: str | None = None - """""" - - web_app_configuration: WebAppConfiguration | None = None - """""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_DOMAIN_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_DOMAIN_OUTPUT.members["domainId"], self.domain_id - ) - serializer.write_string(_SCHEMA_CREATE_DOMAIN_OUTPUT.members["arn"], self.arn) - serializer.write_string(_SCHEMA_CREATE_DOMAIN_OUTPUT.members["name"], self.name) - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_DOMAIN_OUTPUT.members["kmsKeyArn"], self.kms_key_arn - ) - - if self.encryption_context is not None: - serializer.write_struct( - _SCHEMA_CREATE_DOMAIN_OUTPUT.members["encryptionContext"], - self.encryption_context, - ) - - serializer.write_string( - _SCHEMA_CREATE_DOMAIN_OUTPUT.members["status"], self.status - ) - if self.web_app_url is not None: - serializer.write_string( - _SCHEMA_CREATE_DOMAIN_OUTPUT.members["webAppUrl"], self.web_app_url - ) - - if self.web_app_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_DOMAIN_OUTPUT.members["webAppConfiguration"], - self.web_app_configuration, - ) - - serializer.write_timestamp( - _SCHEMA_CREATE_DOMAIN_OUTPUT.members["createdAt"], self.created_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["domain_id"] = de.read_string( - _SCHEMA_CREATE_DOMAIN_OUTPUT.members["domainId"] - ) - - case 1: - kwargs["arn"] = de.read_string( - _SCHEMA_CREATE_DOMAIN_OUTPUT.members["arn"] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_DOMAIN_OUTPUT.members["name"] - ) - - case 3: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_CREATE_DOMAIN_OUTPUT.members["kmsKeyArn"] - ) - - case 4: - kwargs["encryption_context"] = EncryptionContext.deserialize(de) - - case 5: - kwargs["status"] = DomainStatus( - de.read_string(_SCHEMA_CREATE_DOMAIN_OUTPUT.members["status"]) - ) - - case 6: - kwargs["web_app_url"] = de.read_string( - _SCHEMA_CREATE_DOMAIN_OUTPUT.members["webAppUrl"] - ) - - case 7: - kwargs["web_app_configuration"] = WebAppConfiguration.deserialize( - de - ) - - case 8: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_CREATE_DOMAIN_OUTPUT.members["createdAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_DOMAIN_OUTPUT, consumer=_consumer) - if "domain_id" not in kwargs: - kwargs["domain_id"] = "" - if "arn" not in kwargs: - kwargs["arn"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "status" not in kwargs: - kwargs["status"] = DomainStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -@dataclass(kw_only=True) -class ServiceQuotaExceededException(ServiceError): - """The request exceeds a service quota.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -CREATE_DOMAIN = APIOperation( - input=CreateDomainInput, - output=CreateDomainOutput, - schema=_SCHEMA_CREATE_DOMAIN, - input_schema=_SCHEMA_CREATE_DOMAIN_INPUT, - output_schema=_SCHEMA_CREATE_DOMAIN_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.connecthealth#ServiceQuotaExceededException" - ): ServiceQuotaExceededException - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[_SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION], -) - - -@dataclass(kw_only=True) -class CreateSubscriptionInput: - """Dataclass for CreateSubscriptionInput structure.""" - - domain_id: str | None = None - """The unique identifier of the parent Domain.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_SUBSCRIPTION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.domain_id is not None: - serializer.write_string( - _SCHEMA_CREATE_SUBSCRIPTION_INPUT.members["domainId"], self.domain_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["domain_id"] = de.read_string( - _SCHEMA_CREATE_SUBSCRIPTION_INPUT.members["domainId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_SUBSCRIPTION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CreateSubscriptionOutput: - """Dataclass for CreateSubscriptionOutput structure.""" - - domain_id: str - """""" - - subscription_id: str - """""" - - arn: str - """""" - - status: str - """""" - - created_at: datetime - """""" - - last_updated_at: datetime - """""" - - activated_at: datetime | None = None - """""" - - deactivated_at: datetime | None = None - """""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_SUBSCRIPTION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_SUBSCRIPTION_OUTPUT.members["domainId"], self.domain_id - ) - serializer.write_string( - _SCHEMA_CREATE_SUBSCRIPTION_OUTPUT.members["subscriptionId"], - self.subscription_id, - ) - serializer.write_string( - _SCHEMA_CREATE_SUBSCRIPTION_OUTPUT.members["arn"], self.arn - ) - serializer.write_string( - _SCHEMA_CREATE_SUBSCRIPTION_OUTPUT.members["status"], self.status - ) - serializer.write_timestamp( - _SCHEMA_CREATE_SUBSCRIPTION_OUTPUT.members["createdAt"], self.created_at - ) - serializer.write_timestamp( - _SCHEMA_CREATE_SUBSCRIPTION_OUTPUT.members["lastUpdatedAt"], - self.last_updated_at, - ) - if self.activated_at is not None: - serializer.write_timestamp( - _SCHEMA_CREATE_SUBSCRIPTION_OUTPUT.members["activatedAt"], - self.activated_at, - ) - - if self.deactivated_at is not None: - serializer.write_timestamp( - _SCHEMA_CREATE_SUBSCRIPTION_OUTPUT.members["deactivatedAt"], - self.deactivated_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["domain_id"] = de.read_string( - _SCHEMA_CREATE_SUBSCRIPTION_OUTPUT.members["domainId"] - ) - - case 1: - kwargs["subscription_id"] = de.read_string( - _SCHEMA_CREATE_SUBSCRIPTION_OUTPUT.members["subscriptionId"] - ) - - case 2: - kwargs["arn"] = de.read_string( - _SCHEMA_CREATE_SUBSCRIPTION_OUTPUT.members["arn"] - ) - - case 3: - kwargs["status"] = SubscriptionStatus( - de.read_string( - _SCHEMA_CREATE_SUBSCRIPTION_OUTPUT.members["status"] - ) - ) - - case 4: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_CREATE_SUBSCRIPTION_OUTPUT.members["createdAt"] - ) - - case 5: - kwargs["last_updated_at"] = de.read_timestamp( - _SCHEMA_CREATE_SUBSCRIPTION_OUTPUT.members["lastUpdatedAt"] - ) - - case 6: - kwargs["activated_at"] = de.read_timestamp( - _SCHEMA_CREATE_SUBSCRIPTION_OUTPUT.members["activatedAt"] - ) - - case 7: - kwargs["deactivated_at"] = de.read_timestamp( - _SCHEMA_CREATE_SUBSCRIPTION_OUTPUT.members["deactivatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_SUBSCRIPTION_OUTPUT, consumer=_consumer) - if "domain_id" not in kwargs: - kwargs["domain_id"] = "" - if "subscription_id" not in kwargs: - kwargs["subscription_id"] = "" - if "arn" not in kwargs: - kwargs["arn"] = "" - if "status" not in kwargs: - kwargs["status"] = SubscriptionStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "last_updated_at" not in kwargs: - kwargs["last_updated_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -CREATE_SUBSCRIPTION = APIOperation( - input=CreateSubscriptionInput, - output=CreateSubscriptionOutput, - schema=_SCHEMA_CREATE_SUBSCRIPTION, - input_schema=_SCHEMA_CREATE_SUBSCRIPTION_INPUT, - output_schema=_SCHEMA_CREATE_SUBSCRIPTION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.connecthealth#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.connecthealth#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.connecthealth#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.connecthealth#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.connecthealth#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeactivateSubscriptionInput: - """Dataclass for DeactivateSubscriptionInput structure.""" - - domain_id: str | None = None - """The unique identifier of the parent Domain.""" - - subscription_id: str | None = None - """The unique identifier of the Subscription.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DEACTIVATE_SUBSCRIPTION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.domain_id is not None: - serializer.write_string( - _SCHEMA_DEACTIVATE_SUBSCRIPTION_INPUT.members["domainId"], - self.domain_id, - ) - - if self.subscription_id is not None: - serializer.write_string( - _SCHEMA_DEACTIVATE_SUBSCRIPTION_INPUT.members["subscriptionId"], - self.subscription_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["domain_id"] = de.read_string( - _SCHEMA_DEACTIVATE_SUBSCRIPTION_INPUT.members["domainId"] - ) - - case 1: - kwargs["subscription_id"] = de.read_string( - _SCHEMA_DEACTIVATE_SUBSCRIPTION_INPUT.members["subscriptionId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DEACTIVATE_SUBSCRIPTION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeactivateSubscriptionOutput: - """Dataclass for DeactivateSubscriptionOutput structure.""" - - subscription: SubscriptionDescription | None = None - """""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DEACTIVATE_SUBSCRIPTION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.subscription is not None: - serializer.write_struct( - _SCHEMA_DEACTIVATE_SUBSCRIPTION_OUTPUT.members["subscription"], - self.subscription, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["subscription"] = SubscriptionDescription.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DEACTIVATE_SUBSCRIPTION_OUTPUT, consumer=_consumer - ) - return kwargs - - -DEACTIVATE_SUBSCRIPTION = APIOperation( - input=DeactivateSubscriptionInput, - output=DeactivateSubscriptionOutput, - schema=_SCHEMA_DEACTIVATE_SUBSCRIPTION, - input_schema=_SCHEMA_DEACTIVATE_SUBSCRIPTION_INPUT, - output_schema=_SCHEMA_DEACTIVATE_SUBSCRIPTION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.connecthealth#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.connecthealth#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.connecthealth#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.connecthealth#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteDomainInput: - """Dataclass for DeleteDomainInput structure.""" - - domain_id: str | None = None - """The id of the Domain to delete""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_DOMAIN_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.domain_id is not None: - serializer.write_string( - _SCHEMA_DELETE_DOMAIN_INPUT.members["domainId"], self.domain_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["domain_id"] = de.read_string( - _SCHEMA_DELETE_DOMAIN_INPUT.members["domainId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_DOMAIN_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteDomainOutput: - """Dataclass for DeleteDomainOutput structure.""" - - domain_id: str - """The id of the Domain requested for deletion""" - - arn: str - """The ARN of the Domain that was requested for deletion""" - - status: str - """Current status of Domain""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_DOMAIN_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DELETE_DOMAIN_OUTPUT.members["domainId"], self.domain_id - ) - serializer.write_string(_SCHEMA_DELETE_DOMAIN_OUTPUT.members["arn"], self.arn) - serializer.write_string( - _SCHEMA_DELETE_DOMAIN_OUTPUT.members["status"], self.status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["domain_id"] = de.read_string( - _SCHEMA_DELETE_DOMAIN_OUTPUT.members["domainId"] - ) - - case 1: - kwargs["arn"] = de.read_string( - _SCHEMA_DELETE_DOMAIN_OUTPUT.members["arn"] - ) - - case 2: - kwargs["status"] = DomainStatus( - de.read_string(_SCHEMA_DELETE_DOMAIN_OUTPUT.members["status"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_DOMAIN_OUTPUT, consumer=_consumer) - if "domain_id" not in kwargs: - kwargs["domain_id"] = "" - if "arn" not in kwargs: - kwargs["arn"] = "" - if "status" not in kwargs: - kwargs["status"] = DomainStatus._corrected("") - return kwargs - - -DELETE_DOMAIN = APIOperation( - input=DeleteDomainInput, - output=DeleteDomainOutput, - schema=_SCHEMA_DELETE_DOMAIN, - input_schema=_SCHEMA_DELETE_DOMAIN_INPUT, - output_schema=_SCHEMA_DELETE_DOMAIN_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.connecthealth#ResourceNotFoundException" - ): ResourceNotFoundException - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[_SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION], -) - - -@dataclass(kw_only=True) -class GetDomainInput: - """Dataclass for GetDomainInput structure.""" - - domain_id: str | None = None - """The id of the Domain to get""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DOMAIN_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.domain_id is not None: - serializer.write_string( - _SCHEMA_GET_DOMAIN_INPUT.members["domainId"], self.domain_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["domain_id"] = de.read_string( - _SCHEMA_GET_DOMAIN_INPUT.members["domainId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_DOMAIN_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetDomainOutput: - """Dataclass for GetDomainOutput structure.""" - - domain_id: str - """""" - - arn: str - """""" - - name: str - """""" - - status: str - """""" - - created_at: datetime - """""" - - kms_key_arn: str | None = None - """""" - - encryption_context: EncryptionContext | None = None - """""" - - web_app_url: str | None = None - """""" - - web_app_configuration: WebAppConfiguration | None = None - """""" - - tags: dict[str, str] | None = None - """Tags associated with the Domain""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DOMAIN_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_DOMAIN_OUTPUT.members["domainId"], self.domain_id - ) - serializer.write_string(_SCHEMA_GET_DOMAIN_OUTPUT.members["arn"], self.arn) - serializer.write_string(_SCHEMA_GET_DOMAIN_OUTPUT.members["name"], self.name) - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_GET_DOMAIN_OUTPUT.members["kmsKeyArn"], self.kms_key_arn - ) - - if self.encryption_context is not None: - serializer.write_struct( - _SCHEMA_GET_DOMAIN_OUTPUT.members["encryptionContext"], - self.encryption_context, - ) - - serializer.write_string( - _SCHEMA_GET_DOMAIN_OUTPUT.members["status"], self.status - ) - if self.web_app_url is not None: - serializer.write_string( - _SCHEMA_GET_DOMAIN_OUTPUT.members["webAppUrl"], self.web_app_url - ) - - if self.web_app_configuration is not None: - serializer.write_struct( - _SCHEMA_GET_DOMAIN_OUTPUT.members["webAppConfiguration"], - self.web_app_configuration, - ) - - serializer.write_timestamp( - _SCHEMA_GET_DOMAIN_OUTPUT.members["createdAt"], self.created_at - ) - if self.tags is not None: - _serialize_tag_map( - serializer, _SCHEMA_GET_DOMAIN_OUTPUT.members["tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["domain_id"] = de.read_string( - _SCHEMA_GET_DOMAIN_OUTPUT.members["domainId"] - ) - - case 1: - kwargs["arn"] = de.read_string( - _SCHEMA_GET_DOMAIN_OUTPUT.members["arn"] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_GET_DOMAIN_OUTPUT.members["name"] - ) - - case 3: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_GET_DOMAIN_OUTPUT.members["kmsKeyArn"] - ) - - case 4: - kwargs["encryption_context"] = EncryptionContext.deserialize(de) - - case 5: - kwargs["status"] = DomainStatus( - de.read_string(_SCHEMA_GET_DOMAIN_OUTPUT.members["status"]) - ) - - case 6: - kwargs["web_app_url"] = de.read_string( - _SCHEMA_GET_DOMAIN_OUTPUT.members["webAppUrl"] - ) - - case 7: - kwargs["web_app_configuration"] = WebAppConfiguration.deserialize( - de - ) - - case 8: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_DOMAIN_OUTPUT.members["createdAt"] - ) - - case 9: - kwargs["tags"] = _deserialize_tag_map( - de, _SCHEMA_GET_DOMAIN_OUTPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_DOMAIN_OUTPUT, consumer=_consumer) - if "domain_id" not in kwargs: - kwargs["domain_id"] = "" - if "arn" not in kwargs: - kwargs["arn"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "status" not in kwargs: - kwargs["status"] = DomainStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -GET_DOMAIN = APIOperation( - input=GetDomainInput, - output=GetDomainOutput, - schema=_SCHEMA_GET_DOMAIN, - input_schema=_SCHEMA_GET_DOMAIN_INPUT, - output_schema=_SCHEMA_GET_DOMAIN_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.connecthealth#ResourceNotFoundException" - ): ResourceNotFoundException - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[_SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION], -) - - -@dataclass(kw_only=True) -class GetMedicalScribeListeningSessionInput: - """Dataclass for GetMedicalScribeListeningSessionInput structure.""" - - session_id: str | None = None - """The Session identifier""" - - domain_id: str | None = None - """The Domain identifier""" - - subscription_id: str | None = None - """The Subscription identifier""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_MEDICAL_SCRIBE_LISTENING_SESSION_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.session_id is not None: - serializer.write_string( - _SCHEMA_GET_MEDICAL_SCRIBE_LISTENING_SESSION_INPUT.members["sessionId"], - self.session_id, - ) - - if self.domain_id is not None: - serializer.write_string( - _SCHEMA_GET_MEDICAL_SCRIBE_LISTENING_SESSION_INPUT.members["domainId"], - self.domain_id, - ) - - if self.subscription_id is not None: - serializer.write_string( - _SCHEMA_GET_MEDICAL_SCRIBE_LISTENING_SESSION_INPUT.members[ - "subscriptionId" - ], - self.subscription_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["session_id"] = de.read_string( - _SCHEMA_GET_MEDICAL_SCRIBE_LISTENING_SESSION_INPUT.members[ - "sessionId" - ] - ) - - case 1: - kwargs["domain_id"] = de.read_string( - _SCHEMA_GET_MEDICAL_SCRIBE_LISTENING_SESSION_INPUT.members[ - "domainId" - ] - ) - - case 2: - kwargs["subscription_id"] = de.read_string( - _SCHEMA_GET_MEDICAL_SCRIBE_LISTENING_SESSION_INPUT.members[ - "subscriptionId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_MEDICAL_SCRIBE_LISTENING_SESSION_INPUT, consumer=_consumer - ) - return kwargs - - -class MedicalScribeParticipantRole(UnknownEnumMixin, StrEnum): - PATIENT = "PATIENT" - CLINICIAN = "CLINICIAN" - - -@dataclass(kw_only=True) -class MedicalScribeChannelDefinition: - """Defines a channel in the audio stream""" - - channel_id: int - """The channel identifier""" - - participant_role: str - """The role of the participant on this channel""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDICAL_SCRIBE_CHANNEL_DEFINITION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer( - _SCHEMA_MEDICAL_SCRIBE_CHANNEL_DEFINITION.members["channelId"], - self.channel_id, - ) - serializer.write_string( - _SCHEMA_MEDICAL_SCRIBE_CHANNEL_DEFINITION.members["participantRole"], - self.participant_role, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["channel_id"] = de.read_integer( - _SCHEMA_MEDICAL_SCRIBE_CHANNEL_DEFINITION.members["channelId"] - ) - - case 1: - kwargs["participant_role"] = MedicalScribeParticipantRole( - de.read_string( - _SCHEMA_MEDICAL_SCRIBE_CHANNEL_DEFINITION.members[ - "participantRole" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MEDICAL_SCRIBE_CHANNEL_DEFINITION, consumer=_consumer - ) - if "channel_id" not in kwargs: - kwargs["channel_id"] = 0 - if "participant_role" not in kwargs: - kwargs["participant_role"] = MedicalScribeParticipantRole._corrected("") - return kwargs - - -def _serialize_medical_scribe_channel_definitions( - serializer: ShapeSerializer, - schema: Schema, - value: list[MedicalScribeChannelDefinition], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_medical_scribe_channel_definitions( - deserializer: ShapeDeserializer, schema: Schema -) -> list[MedicalScribeChannelDefinition]: - result: list[MedicalScribeChannelDefinition] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(MedicalScribeChannelDefinition.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class MedicalScribeLanguageCode(UnknownEnumMixin, StrEnum): - EN_US = "en-US" - MULTI = "multi" - - -class MedicalScribeMediaEncoding(UnknownEnumMixin, StrEnum): - PCM = "pcm" - FLAC = "flac" - - -@dataclass(kw_only=True) -class MedicalScribePostStreamActionsResult: - """Results of post-stream actions performed after the audio stream ended""" - - clinical_note_generation_result: ClinicalNoteGenerationResult | None = None - """Results of clinical note generation""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDICAL_SCRIBE_POST_STREAM_ACTIONS_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.clinical_note_generation_result is not None: - serializer.write_struct( - _SCHEMA_MEDICAL_SCRIBE_POST_STREAM_ACTIONS_RESULT.members[ - "clinicalNoteGenerationResult" - ], - self.clinical_note_generation_result, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["clinical_note_generation_result"] = ( - ClinicalNoteGenerationResult.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MEDICAL_SCRIBE_POST_STREAM_ACTIONS_RESULT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class MedicalScribePostStreamActionSettingsResponse: - """Response containing settings for post-stream actions""" - - output_s3_uri: str - """""" - - clinical_note_generation_settings: ClinicalNoteGenerationSettingsResponse - """Settings for clinical note generation""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MEDICAL_SCRIBE_POST_STREAM_ACTION_SETTINGS_RESPONSE, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MEDICAL_SCRIBE_POST_STREAM_ACTION_SETTINGS_RESPONSE.members[ - "outputS3Uri" - ], - self.output_s3_uri, - ) - serializer.write_struct( - _SCHEMA_MEDICAL_SCRIBE_POST_STREAM_ACTION_SETTINGS_RESPONSE.members[ - "clinicalNoteGenerationSettings" - ], - self.clinical_note_generation_settings, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["output_s3_uri"] = de.read_string( - _SCHEMA_MEDICAL_SCRIBE_POST_STREAM_ACTION_SETTINGS_RESPONSE.members[ - "outputS3Uri" - ] - ) - - case 1: - kwargs["clinical_note_generation_settings"] = ( - ClinicalNoteGenerationSettingsResponse.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MEDICAL_SCRIBE_POST_STREAM_ACTION_SETTINGS_RESPONSE, - consumer=_consumer, - ) - if "output_s3_uri" not in kwargs: - kwargs["output_s3_uri"] = "" - if "clinical_note_generation_settings" not in kwargs: - kwargs["clinical_note_generation_settings"] = ( - ClinicalNoteGenerationSettingsResponse._smithy_default() - ) - return kwargs - - -class MedicalScribeStreamStatus(UnknownEnumMixin, StrEnum): - IN_PROGRESS = "IN_PROGRESS" - PAUSED = "PAUSED" - FAILED = "FAILED" - COMPLETED = "COMPLETED" - - -@dataclass(kw_only=True) -class MedicalScribeListeningSessionDetails: - """Detailed information about a Medical Scribe listening session""" - - session_id: str | None = None - """The Session identifier""" - - domain_id: str | None = None - """The Domain identifier""" - - subscription_id: str | None = None - """The Subscription identifier""" - - language_code: str | None = None - """The Language Code for the audio in the session""" - - media_sample_rate_hertz: int | None = None - """The sample rate of the input audio""" - - media_encoding: str | None = None - """The encoding for the input audio""" - - channel_definitions: list[MedicalScribeChannelDefinition] | None = None - """Channel definitions for the audio stream""" - - post_stream_action_settings: ( - MedicalScribePostStreamActionSettingsResponse | None - ) = None - """Settings for post-stream actions""" - - post_stream_action_result: MedicalScribePostStreamActionsResult | None = None - """Results of post-stream actions""" - - encounter_context_provided: bool | None = None - """Indicates whether encounter context was provided""" - - stream_status: str | None = None - """The current status of the stream""" - - stream_creation_time: datetime | None = None - """The timestamp when the stream was created""" - - stream_end_time: datetime | None = None - """The timestamp when the stream ended""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDICAL_SCRIBE_LISTENING_SESSION_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.session_id is not None: - serializer.write_string( - _SCHEMA_MEDICAL_SCRIBE_LISTENING_SESSION_DETAILS.members["sessionId"], - self.session_id, - ) - - if self.domain_id is not None: - serializer.write_string( - _SCHEMA_MEDICAL_SCRIBE_LISTENING_SESSION_DETAILS.members["domainId"], - self.domain_id, - ) - - if self.subscription_id is not None: - serializer.write_string( - _SCHEMA_MEDICAL_SCRIBE_LISTENING_SESSION_DETAILS.members[ - "subscriptionId" - ], - self.subscription_id, - ) - - if self.language_code is not None: - serializer.write_string( - _SCHEMA_MEDICAL_SCRIBE_LISTENING_SESSION_DETAILS.members[ - "languageCode" - ], - self.language_code, - ) - - if self.media_sample_rate_hertz is not None: - serializer.write_integer( - _SCHEMA_MEDICAL_SCRIBE_LISTENING_SESSION_DETAILS.members[ - "mediaSampleRateHertz" - ], - self.media_sample_rate_hertz, - ) - - if self.media_encoding is not None: - serializer.write_string( - _SCHEMA_MEDICAL_SCRIBE_LISTENING_SESSION_DETAILS.members[ - "mediaEncoding" - ], - self.media_encoding, - ) - - if self.channel_definitions is not None: - _serialize_medical_scribe_channel_definitions( - serializer, - _SCHEMA_MEDICAL_SCRIBE_LISTENING_SESSION_DETAILS.members[ - "channelDefinitions" - ], - self.channel_definitions, - ) - - if self.post_stream_action_settings is not None: - serializer.write_struct( - _SCHEMA_MEDICAL_SCRIBE_LISTENING_SESSION_DETAILS.members[ - "postStreamActionSettings" - ], - self.post_stream_action_settings, - ) - - if self.post_stream_action_result is not None: - serializer.write_struct( - _SCHEMA_MEDICAL_SCRIBE_LISTENING_SESSION_DETAILS.members[ - "postStreamActionResult" - ], - self.post_stream_action_result, - ) - - if self.encounter_context_provided is not None: - serializer.write_boolean( - _SCHEMA_MEDICAL_SCRIBE_LISTENING_SESSION_DETAILS.members[ - "encounterContextProvided" - ], - self.encounter_context_provided, - ) - - if self.stream_status is not None: - serializer.write_string( - _SCHEMA_MEDICAL_SCRIBE_LISTENING_SESSION_DETAILS.members[ - "streamStatus" - ], - self.stream_status, - ) - - if self.stream_creation_time is not None: - serializer.write_timestamp( - _SCHEMA_MEDICAL_SCRIBE_LISTENING_SESSION_DETAILS.members[ - "streamCreationTime" - ], - self.stream_creation_time, - ) - - if self.stream_end_time is not None: - serializer.write_timestamp( - _SCHEMA_MEDICAL_SCRIBE_LISTENING_SESSION_DETAILS.members[ - "streamEndTime" - ], - self.stream_end_time, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["session_id"] = de.read_string( - _SCHEMA_MEDICAL_SCRIBE_LISTENING_SESSION_DETAILS.members[ - "sessionId" - ] - ) - - case 1: - kwargs["domain_id"] = de.read_string( - _SCHEMA_MEDICAL_SCRIBE_LISTENING_SESSION_DETAILS.members[ - "domainId" - ] - ) - - case 2: - kwargs["subscription_id"] = de.read_string( - _SCHEMA_MEDICAL_SCRIBE_LISTENING_SESSION_DETAILS.members[ - "subscriptionId" - ] - ) - - case 3: - kwargs["language_code"] = MedicalScribeLanguageCode( - de.read_string( - _SCHEMA_MEDICAL_SCRIBE_LISTENING_SESSION_DETAILS.members[ - "languageCode" - ] - ) - ) - - case 4: - kwargs["media_sample_rate_hertz"] = de.read_integer( - _SCHEMA_MEDICAL_SCRIBE_LISTENING_SESSION_DETAILS.members[ - "mediaSampleRateHertz" - ] - ) - - case 5: - kwargs["media_encoding"] = MedicalScribeMediaEncoding( - de.read_string( - _SCHEMA_MEDICAL_SCRIBE_LISTENING_SESSION_DETAILS.members[ - "mediaEncoding" - ] - ) - ) - - case 6: - kwargs["channel_definitions"] = ( - _deserialize_medical_scribe_channel_definitions( - de, - _SCHEMA_MEDICAL_SCRIBE_LISTENING_SESSION_DETAILS.members[ - "channelDefinitions" - ], - ) - ) - - case 7: - kwargs["post_stream_action_settings"] = ( - MedicalScribePostStreamActionSettingsResponse.deserialize(de) - ) - - case 8: - kwargs["post_stream_action_result"] = ( - MedicalScribePostStreamActionsResult.deserialize(de) - ) - - case 9: - kwargs["encounter_context_provided"] = de.read_boolean( - _SCHEMA_MEDICAL_SCRIBE_LISTENING_SESSION_DETAILS.members[ - "encounterContextProvided" - ] - ) - - case 10: - kwargs["stream_status"] = MedicalScribeStreamStatus( - de.read_string( - _SCHEMA_MEDICAL_SCRIBE_LISTENING_SESSION_DETAILS.members[ - "streamStatus" - ] - ) - ) - - case 11: - kwargs["stream_creation_time"] = de.read_timestamp( - _SCHEMA_MEDICAL_SCRIBE_LISTENING_SESSION_DETAILS.members[ - "streamCreationTime" - ] - ) - - case 12: - kwargs["stream_end_time"] = de.read_timestamp( - _SCHEMA_MEDICAL_SCRIBE_LISTENING_SESSION_DETAILS.members[ - "streamEndTime" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MEDICAL_SCRIBE_LISTENING_SESSION_DETAILS, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetMedicalScribeListeningSessionOutput: - """Dataclass for GetMedicalScribeListeningSessionOutput structure.""" - - medical_scribe_listening_session_details: ( - MedicalScribeListeningSessionDetails | None - ) = None - """Details about the Medical Scribe listening session""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_MEDICAL_SCRIBE_LISTENING_SESSION_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.medical_scribe_listening_session_details is not None: - serializer.write_struct( - _SCHEMA_GET_MEDICAL_SCRIBE_LISTENING_SESSION_OUTPUT.members[ - "medicalScribeListeningSessionDetails" - ], - self.medical_scribe_listening_session_details, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["medical_scribe_listening_session_details"] = ( - MedicalScribeListeningSessionDetails.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_MEDICAL_SCRIBE_LISTENING_SESSION_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ThrottlingException(ServiceError): - """This error is thrown when the client exceeds the allowed request rate.""" - - fault: Literal["client", "server"] | None = "client" - is_retry_safe: bool | None = True - is_throttling_error: bool = True - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_THROTTLING_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_THROTTLING_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_THROTTLING_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_THROTTLING_EXCEPTION, consumer=_consumer) - return kwargs - - -GET_MEDICAL_SCRIBE_LISTENING_SESSION = APIOperation( - input=GetMedicalScribeListeningSessionInput, - output=GetMedicalScribeListeningSessionOutput, - schema=_SCHEMA_GET_MEDICAL_SCRIBE_LISTENING_SESSION, - input_schema=_SCHEMA_GET_MEDICAL_SCRIBE_LISTENING_SESSION_INPUT, - output_schema=_SCHEMA_GET_MEDICAL_SCRIBE_LISTENING_SESSION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.connecthealth#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.connecthealth#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.connecthealth#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.connecthealth#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.connecthealth#ThrottlingException" - ): ThrottlingException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetPatientInsightsJobInput: - """Dataclass for GetPatientInsightsJobInput structure.""" - - domain_id: str | None = None - """""" - - job_id: str | None = None - """""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_PATIENT_INSIGHTS_JOB_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.domain_id is not None: - serializer.write_string( - _SCHEMA_GET_PATIENT_INSIGHTS_JOB_INPUT.members["domainId"], - self.domain_id, - ) - - if self.job_id is not None: - serializer.write_string( - _SCHEMA_GET_PATIENT_INSIGHTS_JOB_INPUT.members["jobId"], self.job_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["domain_id"] = de.read_string( - _SCHEMA_GET_PATIENT_INSIGHTS_JOB_INPUT.members["domainId"] - ) - - case 1: - kwargs["job_id"] = de.read_string( - _SCHEMA_GET_PATIENT_INSIGHTS_JOB_INPUT.members["jobId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_PATIENT_INSIGHTS_JOB_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class PatientInsightsEncounterContext: - """Details for an encounter""" - - encounter_reason: str = field(repr=False) - """Chief complaint for the visit""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PATIENT_INSIGHTS_ENCOUNTER_CONTEXT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_PATIENT_INSIGHTS_ENCOUNTER_CONTEXT.members["encounterReason"], - self.encounter_reason, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["encounter_reason"] = de.read_string( - _SCHEMA_PATIENT_INSIGHTS_ENCOUNTER_CONTEXT.members[ - "encounterReason" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PATIENT_INSIGHTS_ENCOUNTER_CONTEXT, consumer=_consumer - ) - if "encounter_reason" not in kwargs: - kwargs["encounter_reason"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(encounter_reason="") - - -@dataclass(kw_only=True) -class FHIRServer: - """FHIR server configuration for input data source""" - - fhir_endpoint: str - """FHIR server endpoint URL for accessing patient data.""" - - oauth_token: str | None = field(repr=False, default=None) - """OAuth token for authenticating with the FHIR server.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FHIR_SERVER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_FHIR_SERVER.members["fhirEndpoint"], self.fhir_endpoint - ) - if self.oauth_token is not None: - serializer.write_string( - _SCHEMA_FHIR_SERVER.members["oauthToken"], self.oauth_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["fhir_endpoint"] = de.read_string( - _SCHEMA_FHIR_SERVER.members["fhirEndpoint"] - ) - - case 1: - kwargs["oauth_token"] = de.read_string( - _SCHEMA_FHIR_SERVER.members["oauthToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FHIR_SERVER, consumer=_consumer) - if "fhir_endpoint" not in kwargs: - kwargs["fhir_endpoint"] = "" - return kwargs - - -@dataclass(kw_only=True) -class S3Source: - """S3 uri for input data source""" - - uri: str - """The S3 URI.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_S3_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_S3_SOURCE.members["uri"], self.uri) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["uri"] = de.read_string(_SCHEMA_S3_SOURCE.members["uri"]) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_S3_SOURCE, consumer=_consumer) - if "uri" not in kwargs: - kwargs["uri"] = "" - return kwargs - - -def _serialize_s3_sources( - serializer: ShapeSerializer, schema: Schema, value: list[S3Source] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_s3_sources( - deserializer: ShapeDeserializer, schema: Schema -) -> list[S3Source]: - result: list[S3Source] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(S3Source.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class InputDataConfig: - """Configuration details for input patient data""" - - fhir_server: FHIRServer | None = None - """FHIR server configuration to retrieve patient data.""" - - s3_sources: list[S3Source] | None = None - """List of S3 sources containing patient data.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INPUT_DATA_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.fhir_server is not None: - serializer.write_struct( - _SCHEMA_INPUT_DATA_CONFIG.members["fhirServer"], self.fhir_server - ) - - if self.s3_sources is not None: - _serialize_s3_sources( - serializer, - _SCHEMA_INPUT_DATA_CONFIG.members["s3Sources"], - self.s3_sources, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["fhir_server"] = FHIRServer.deserialize(de) - - case 1: - kwargs["s3_sources"] = _deserialize_s3_sources( - de, _SCHEMA_INPUT_DATA_CONFIG.members["s3Sources"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INPUT_DATA_CONFIG, consumer=_consumer) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls() - - -class InsightsType(UnknownEnumMixin, StrEnum): - PRE_VISIT = "PRE_VISIT" - - -@dataclass(kw_only=True) -class InsightsContext: - """Details for insights that user wants to generate""" - - insights_type: str - """""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INSIGHTS_CONTEXT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_INSIGHTS_CONTEXT.members["insightsType"], self.insights_type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["insights_type"] = InsightsType( - de.read_string(_SCHEMA_INSIGHTS_CONTEXT.members["insightsType"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INSIGHTS_CONTEXT, consumer=_consumer) - if "insights_type" not in kwargs: - kwargs["insights_type"] = InsightsType._corrected("") - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(insights_type=InsightsType._corrected("")) - - -@dataclass(kw_only=True) -class InsightsOutput: - """Output of patient insights job""" - - uri: str - """""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INSIGHTS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_INSIGHTS_OUTPUT.members["uri"], self.uri) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["uri"] = de.read_string( - _SCHEMA_INSIGHTS_OUTPUT.members["uri"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INSIGHTS_OUTPUT, consumer=_consumer) - if "uri" not in kwargs: - kwargs["uri"] = "" - return kwargs - - -class JobStatus(UnknownEnumMixin, StrEnum): - SUBMITTED = "SUBMITTED" - IN_PROGRESS = "IN_PROGRESS" - FAILED = "FAILED" - SUCCEEDED = "SUCCEEDED" - - -@dataclass(kw_only=True) -class OutputDataConfig: - """Configuration details for insights output.""" - - s3_output_path: str - """S3 URI where the insights output will be stored.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OUTPUT_DATA_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_OUTPUT_DATA_CONFIG.members["s3OutputPath"], self.s3_output_path - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["s3_output_path"] = de.read_string( - _SCHEMA_OUTPUT_DATA_CONFIG.members["s3OutputPath"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_OUTPUT_DATA_CONFIG, consumer=_consumer) - if "s3_output_path" not in kwargs: - kwargs["s3_output_path"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(s3_output_path="") - - -class Pronouns(UnknownEnumMixin, StrEnum): - HE_HIM = "HE_HIM" - SHE_HER = "SHE_HER" - THEY_THEM = "THEY_THEM" - - -@dataclass(kw_only=True) -class PatientInsightsPatientContext: - """Details for a patient""" - - patient_id: str = field(repr=False) - """Unique identifier of the patient""" - - date_of_birth: str | None = field(repr=False, default=None) - """Date of birth of the patient.""" - - pronouns: str | None = field(repr=False, default=None) - """Pronouns preferred by the patient.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PATIENT_INSIGHTS_PATIENT_CONTEXT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_PATIENT_INSIGHTS_PATIENT_CONTEXT.members["patientId"], - self.patient_id, - ) - if self.date_of_birth is not None: - serializer.write_string( - _SCHEMA_PATIENT_INSIGHTS_PATIENT_CONTEXT.members["dateOfBirth"], - self.date_of_birth, - ) - - if self.pronouns is not None: - serializer.write_string( - _SCHEMA_PATIENT_INSIGHTS_PATIENT_CONTEXT.members["pronouns"], - self.pronouns, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["patient_id"] = de.read_string( - _SCHEMA_PATIENT_INSIGHTS_PATIENT_CONTEXT.members["patientId"] - ) - - case 1: - kwargs["date_of_birth"] = de.read_string( - _SCHEMA_PATIENT_INSIGHTS_PATIENT_CONTEXT.members["dateOfBirth"] - ) - - case 2: - kwargs["pronouns"] = Pronouns( - de.read_string( - _SCHEMA_PATIENT_INSIGHTS_PATIENT_CONTEXT.members["pronouns"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PATIENT_INSIGHTS_PATIENT_CONTEXT, consumer=_consumer - ) - if "patient_id" not in kwargs: - kwargs["patient_id"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(patient_id="") - - -class ProviderRole(UnknownEnumMixin, StrEnum): - CLINICIAN = "CLINICIAN" - - -class Specialty(UnknownEnumMixin, StrEnum): - PRIMARY_CARE = "PRIMARY_CARE" - - -@dataclass(kw_only=True) -class UserContext: - """Details for user initiating insights job""" - - role: str - """""" - - user_id: str = field(repr=False) - """Unique identifier of the user""" - - specialty: str | None = None - """""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_USER_CONTEXT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_USER_CONTEXT.members["role"], self.role) - serializer.write_string(_SCHEMA_USER_CONTEXT.members["userId"], self.user_id) - if self.specialty is not None: - serializer.write_string( - _SCHEMA_USER_CONTEXT.members["specialty"], self.specialty - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["role"] = ProviderRole( - de.read_string(_SCHEMA_USER_CONTEXT.members["role"]) - ) - - case 1: - kwargs["user_id"] = de.read_string( - _SCHEMA_USER_CONTEXT.members["userId"] - ) - - case 2: - kwargs["specialty"] = Specialty( - de.read_string(_SCHEMA_USER_CONTEXT.members["specialty"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_USER_CONTEXT, consumer=_consumer) - if "role" not in kwargs: - kwargs["role"] = ProviderRole._corrected("") - if "user_id" not in kwargs: - kwargs["user_id"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(role=ProviderRole._corrected(""), user_id="") - - -@dataclass(kw_only=True) -class GetPatientInsightsJobOutput: - """Dataclass for GetPatientInsightsJobOutput structure.""" - - job_id: str - """""" - - job_arn: str - """""" - - job_status: str - """""" - - patient_context: PatientInsightsPatientContext - """""" - - insights_context: InsightsContext - """""" - - encounter_context: PatientInsightsEncounterContext - """""" - - user_context: UserContext - """""" - - input_data_config: InputDataConfig - """""" - - output_data_config: OutputDataConfig - """""" - - creation_time: datetime | None = None - """Date and time the patient insights job was submitted.""" - - updated_time: datetime | None = None - """Date and time the patient insights job was last updated.""" - - insights_output: InsightsOutput | None = None - """""" - - status_details: str | None = None - """Contains information about the status of a job.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_PATIENT_INSIGHTS_JOB_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_PATIENT_INSIGHTS_JOB_OUTPUT.members["jobId"], self.job_id - ) - serializer.write_string( - _SCHEMA_GET_PATIENT_INSIGHTS_JOB_OUTPUT.members["jobArn"], self.job_arn - ) - serializer.write_string( - _SCHEMA_GET_PATIENT_INSIGHTS_JOB_OUTPUT.members["jobStatus"], - self.job_status, - ) - if self.creation_time is not None: - serializer.write_timestamp( - _SCHEMA_GET_PATIENT_INSIGHTS_JOB_OUTPUT.members["creationTime"], - self.creation_time, - ) - - if self.updated_time is not None: - serializer.write_timestamp( - _SCHEMA_GET_PATIENT_INSIGHTS_JOB_OUTPUT.members["updatedTime"], - self.updated_time, - ) - - if self.insights_output is not None: - serializer.write_struct( - _SCHEMA_GET_PATIENT_INSIGHTS_JOB_OUTPUT.members["insightsOutput"], - self.insights_output, - ) - - if self.status_details is not None: - serializer.write_string( - _SCHEMA_GET_PATIENT_INSIGHTS_JOB_OUTPUT.members["statusDetails"], - self.status_details, - ) - - serializer.write_struct( - _SCHEMA_GET_PATIENT_INSIGHTS_JOB_OUTPUT.members["patientContext"], - self.patient_context, - ) - serializer.write_struct( - _SCHEMA_GET_PATIENT_INSIGHTS_JOB_OUTPUT.members["insightsContext"], - self.insights_context, - ) - serializer.write_struct( - _SCHEMA_GET_PATIENT_INSIGHTS_JOB_OUTPUT.members["encounterContext"], - self.encounter_context, - ) - serializer.write_struct( - _SCHEMA_GET_PATIENT_INSIGHTS_JOB_OUTPUT.members["userContext"], - self.user_context, - ) - serializer.write_struct( - _SCHEMA_GET_PATIENT_INSIGHTS_JOB_OUTPUT.members["inputDataConfig"], - self.input_data_config, - ) - serializer.write_struct( - _SCHEMA_GET_PATIENT_INSIGHTS_JOB_OUTPUT.members["outputDataConfig"], - self.output_data_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["job_id"] = de.read_string( - _SCHEMA_GET_PATIENT_INSIGHTS_JOB_OUTPUT.members["jobId"] - ) - - case 1: - kwargs["job_arn"] = de.read_string( - _SCHEMA_GET_PATIENT_INSIGHTS_JOB_OUTPUT.members["jobArn"] - ) - - case 2: - kwargs["job_status"] = JobStatus( - de.read_string( - _SCHEMA_GET_PATIENT_INSIGHTS_JOB_OUTPUT.members["jobStatus"] - ) - ) - - case 3: - kwargs["creation_time"] = de.read_timestamp( - _SCHEMA_GET_PATIENT_INSIGHTS_JOB_OUTPUT.members["creationTime"] - ) - - case 4: - kwargs["updated_time"] = de.read_timestamp( - _SCHEMA_GET_PATIENT_INSIGHTS_JOB_OUTPUT.members["updatedTime"] - ) - - case 5: - kwargs["insights_output"] = InsightsOutput.deserialize(de) - - case 6: - kwargs["status_details"] = de.read_string( - _SCHEMA_GET_PATIENT_INSIGHTS_JOB_OUTPUT.members["statusDetails"] - ) - - case 7: - kwargs["patient_context"] = ( - PatientInsightsPatientContext.deserialize(de) - ) - - case 8: - kwargs["insights_context"] = InsightsContext.deserialize(de) - - case 9: - kwargs["encounter_context"] = ( - PatientInsightsEncounterContext.deserialize(de) - ) - - case 10: - kwargs["user_context"] = UserContext.deserialize(de) - - case 11: - kwargs["input_data_config"] = InputDataConfig.deserialize(de) - - case 12: - kwargs["output_data_config"] = OutputDataConfig.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_PATIENT_INSIGHTS_JOB_OUTPUT, consumer=_consumer - ) - if "job_id" not in kwargs: - kwargs["job_id"] = "" - if "job_arn" not in kwargs: - kwargs["job_arn"] = "" - if "job_status" not in kwargs: - kwargs["job_status"] = JobStatus._corrected("") - if "patient_context" not in kwargs: - kwargs["patient_context"] = PatientInsightsPatientContext._smithy_default() - if "insights_context" not in kwargs: - kwargs["insights_context"] = InsightsContext._smithy_default() - if "encounter_context" not in kwargs: - kwargs["encounter_context"] = ( - PatientInsightsEncounterContext._smithy_default() - ) - if "user_context" not in kwargs: - kwargs["user_context"] = UserContext._smithy_default() - if "input_data_config" not in kwargs: - kwargs["input_data_config"] = InputDataConfig._smithy_default() - if "output_data_config" not in kwargs: - kwargs["output_data_config"] = OutputDataConfig._smithy_default() - return kwargs - - -GET_PATIENT_INSIGHTS_JOB = APIOperation( - input=GetPatientInsightsJobInput, - output=GetPatientInsightsJobOutput, - schema=_SCHEMA_GET_PATIENT_INSIGHTS_JOB, - input_schema=_SCHEMA_GET_PATIENT_INSIGHTS_JOB_INPUT, - output_schema=_SCHEMA_GET_PATIENT_INSIGHTS_JOB_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.connecthealth#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.connecthealth#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.connecthealth#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.connecthealth#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.connecthealth#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetSubscriptionInput: - """Dataclass for GetSubscriptionInput structure.""" - - domain_id: str | None = None - """The unique identifier of the parent Domain.""" - - subscription_id: str | None = None - """The unique identifier of the Subscription.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_SUBSCRIPTION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.domain_id is not None: - serializer.write_string( - _SCHEMA_GET_SUBSCRIPTION_INPUT.members["domainId"], self.domain_id - ) - - if self.subscription_id is not None: - serializer.write_string( - _SCHEMA_GET_SUBSCRIPTION_INPUT.members["subscriptionId"], - self.subscription_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["domain_id"] = de.read_string( - _SCHEMA_GET_SUBSCRIPTION_INPUT.members["domainId"] - ) - - case 1: - kwargs["subscription_id"] = de.read_string( - _SCHEMA_GET_SUBSCRIPTION_INPUT.members["subscriptionId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_SUBSCRIPTION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetSubscriptionOutput: - """Dataclass for GetSubscriptionOutput structure.""" - - subscription: SubscriptionDescription | None = None - """""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_SUBSCRIPTION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.subscription is not None: - serializer.write_struct( - _SCHEMA_GET_SUBSCRIPTION_OUTPUT.members["subscription"], - self.subscription, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["subscription"] = SubscriptionDescription.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_SUBSCRIPTION_OUTPUT, consumer=_consumer) - return kwargs - - -GET_SUBSCRIPTION = APIOperation( - input=GetSubscriptionInput, - output=GetSubscriptionOutput, - schema=_SCHEMA_GET_SUBSCRIPTION, - input_schema=_SCHEMA_GET_SUBSCRIPTION_INPUT, - output_schema=_SCHEMA_GET_SUBSCRIPTION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.connecthealth#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.connecthealth#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.connecthealth#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.connecthealth#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListDomainsInput: - """Dataclass for ListDomainsInput structure.""" - - status: str | None = None - """Filter by Domain status.""" - - max_results: int | None = None - """Maximum number of results to return.""" - - next_token: str | None = None - """Token for pagination.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_DOMAINS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.status is not None: - serializer.write_string( - _SCHEMA_LIST_DOMAINS_INPUT.members["status"], self.status - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_DOMAINS_INPUT.members["maxResults"], self.max_results - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_DOMAINS_INPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["status"] = DomainStatus( - de.read_string(_SCHEMA_LIST_DOMAINS_INPUT.members["status"]) - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_DOMAINS_INPUT.members["maxResults"] - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_DOMAINS_INPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_DOMAINS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DomainSummary: - """Summary information about a Domain.""" - - domain_id: str - """The unique identifier of the Domain.""" - - arn: str - """""" - - name: str - """""" - - status: str - """""" - - created_at: datetime - """The timestamp when the Domain was created.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOMAIN_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DOMAIN_SUMMARY.members["domainId"], self.domain_id - ) - serializer.write_string(_SCHEMA_DOMAIN_SUMMARY.members["arn"], self.arn) - serializer.write_string(_SCHEMA_DOMAIN_SUMMARY.members["name"], self.name) - serializer.write_string(_SCHEMA_DOMAIN_SUMMARY.members["status"], self.status) - serializer.write_timestamp( - _SCHEMA_DOMAIN_SUMMARY.members["createdAt"], self.created_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["domain_id"] = de.read_string( - _SCHEMA_DOMAIN_SUMMARY.members["domainId"] - ) - - case 1: - kwargs["arn"] = de.read_string( - _SCHEMA_DOMAIN_SUMMARY.members["arn"] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_DOMAIN_SUMMARY.members["name"] - ) - - case 3: - kwargs["status"] = DomainStatus( - de.read_string(_SCHEMA_DOMAIN_SUMMARY.members["status"]) - ) - - case 4: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_DOMAIN_SUMMARY.members["createdAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DOMAIN_SUMMARY, consumer=_consumer) - if "domain_id" not in kwargs: - kwargs["domain_id"] = "" - if "arn" not in kwargs: - kwargs["arn"] = "" - if "name" not in kwargs: - kwargs["name"] = "" - if "status" not in kwargs: - kwargs["status"] = DomainStatus._corrected("") - if "created_at" not in kwargs: - kwargs["created_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_domain_summary_list( - serializer: ShapeSerializer, schema: Schema, value: list[DomainSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_domain_summary_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[DomainSummary]: - result: list[DomainSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(DomainSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListDomainsOutput: - """Dataclass for ListDomainsOutput structure.""" - - domains: list[DomainSummary] - """List of Domains.""" - - next_token: str | None = None - """Token for the next page of results.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_DOMAINS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_domain_summary_list( - serializer, _SCHEMA_LIST_DOMAINS_OUTPUT.members["domains"], self.domains - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_DOMAINS_OUTPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["domains"] = _deserialize_domain_summary_list( - de, _SCHEMA_LIST_DOMAINS_OUTPUT.members["domains"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_DOMAINS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_DOMAINS_OUTPUT, consumer=_consumer) - if "domains" not in kwargs: - kwargs["domains"] = [] - return kwargs - - -LIST_DOMAINS = APIOperation( - input=ListDomainsInput, - output=ListDomainsOutput, - schema=_SCHEMA_LIST_DOMAINS, - input_schema=_SCHEMA_LIST_DOMAINS_INPUT, - output_schema=_SCHEMA_LIST_DOMAINS_OUTPUT, - error_registry=TypeRegistry({}), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[], -) - - -@dataclass(kw_only=True) -class ListSubscriptionsInput: - """Dataclass for ListSubscriptionsInput structure.""" - - domain_id: str | None = None - """The unique identifier of the parent Domain.""" - - max_results: int | None = None - """Maximum number of results to return.""" - - next_token: str | None = None - """Token for pagination.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_SUBSCRIPTIONS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.domain_id is not None: - serializer.write_string( - _SCHEMA_LIST_SUBSCRIPTIONS_INPUT.members["domainId"], self.domain_id - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_SUBSCRIPTIONS_INPUT.members["maxResults"], self.max_results - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_SUBSCRIPTIONS_INPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["domain_id"] = de.read_string( - _SCHEMA_LIST_SUBSCRIPTIONS_INPUT.members["domainId"] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_SUBSCRIPTIONS_INPUT.members["maxResults"] - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_SUBSCRIPTIONS_INPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_SUBSCRIPTIONS_INPUT, consumer=_consumer) - return kwargs - - -def _serialize_subscription_list( - serializer: ShapeSerializer, schema: Schema, value: list[SubscriptionDescription] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_subscription_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[SubscriptionDescription]: - result: list[SubscriptionDescription] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(SubscriptionDescription.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListSubscriptionsOutput: - """Dataclass for ListSubscriptionsOutput structure.""" - - subscriptions: list[SubscriptionDescription] - """List of Subscriptions.""" - - next_token: str | None = None - """Token for the next page of results.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_SUBSCRIPTIONS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_subscription_list( - serializer, - _SCHEMA_LIST_SUBSCRIPTIONS_OUTPUT.members["subscriptions"], - self.subscriptions, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_SUBSCRIPTIONS_OUTPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["subscriptions"] = _deserialize_subscription_list( - de, _SCHEMA_LIST_SUBSCRIPTIONS_OUTPUT.members["subscriptions"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_SUBSCRIPTIONS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_SUBSCRIPTIONS_OUTPUT, consumer=_consumer) - if "subscriptions" not in kwargs: - kwargs["subscriptions"] = [] - return kwargs - - -LIST_SUBSCRIPTIONS = APIOperation( - input=ListSubscriptionsInput, - output=ListSubscriptionsOutput, - schema=_SCHEMA_LIST_SUBSCRIPTIONS, - input_schema=_SCHEMA_LIST_SUBSCRIPTIONS_INPUT, - output_schema=_SCHEMA_LIST_SUBSCRIPTIONS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.connecthealth#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.connecthealth#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.connecthealth#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.connecthealth#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListTagsForResourceInput: - """Dataclass for ListTagsForResourceInput structure.""" - - resource_arn: str | None = None - """The ARN of the resource to list tags for""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT.members["resourceArn"], - self.resource_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT.members["resourceArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ListTagsForResourceOutput: - """Dataclass for ListTagsForResourceOutput structure.""" - - tags: dict[str, str] | None = None - """The tags associated with the resource""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.tags is not None: - _serialize_tag_map( - serializer, - _SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT.members["tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["tags"] = _deserialize_tag_map( - de, _SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_TAGS_FOR_RESOURCE = APIOperation( - input=ListTagsForResourceInput, - output=ListTagsForResourceOutput, - schema=_SCHEMA_LIST_TAGS_FOR_RESOURCE, - input_schema=_SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT, - output_schema=_SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT, - error_registry=TypeRegistry({}), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[], -) - - -@dataclass(kw_only=True) -class MedicalScribeAudioEvent: - """An event containing audio data for the Medical Scribe stream""" - - audio_chunk: bytes - """The audio data chunk""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDICAL_SCRIBE_AUDIO_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_blob( - _SCHEMA_MEDICAL_SCRIBE_AUDIO_EVENT.members["audioChunk"], self.audio_chunk - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["audio_chunk"] = de.read_blob( - _SCHEMA_MEDICAL_SCRIBE_AUDIO_EVENT.members["audioChunk"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MEDICAL_SCRIBE_AUDIO_EVENT, consumer=_consumer) - if "audio_chunk" not in kwargs: - kwargs["audio_chunk"] = b"" - return kwargs - - -@dataclass(kw_only=True) -class MedicalScribeBinaryAudioEvent: - """ - An event containing raw binary audio data for the Medical Scribe stream. - The audio is sent as a raw binary payload rather than as a - base64-encoded value. - """ - - audio_chunk: bytes - """The raw binary audio data chunk""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDICAL_SCRIBE_BINARY_AUDIO_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_blob( - _SCHEMA_MEDICAL_SCRIBE_BINARY_AUDIO_EVENT.members["audioChunk"], - self.audio_chunk, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["audio_chunk"] = de.read_blob( - _SCHEMA_MEDICAL_SCRIBE_BINARY_AUDIO_EVENT.members["audioChunk"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MEDICAL_SCRIBE_BINARY_AUDIO_EVENT, consumer=_consumer - ) - if "audio_chunk" not in kwargs: - kwargs["audio_chunk"] = b"" - return kwargs - - -@dataclass(kw_only=True) -class EncounterContext: - """Context information about the clinical encounter""" - - unstructured_context: str | None = field(repr=False, default=None) - """Unstructured context information in markdown format""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ENCOUNTER_CONTEXT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.unstructured_context is not None: - serializer.write_string( - _SCHEMA_ENCOUNTER_CONTEXT.members["unstructuredContext"], - self.unstructured_context, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["unstructured_context"] = de.read_string( - _SCHEMA_ENCOUNTER_CONTEXT.members["unstructuredContext"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ENCOUNTER_CONTEXT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class MedicalScribePostStreamActionSettings: - """Settings for actions to perform after the audio stream ends""" - - output_s3_uri: str - """""" - - clinical_note_generation_settings: ClinicalNoteGenerationSettings - """Settings for clinical note generation""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MEDICAL_SCRIBE_POST_STREAM_ACTION_SETTINGS, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MEDICAL_SCRIBE_POST_STREAM_ACTION_SETTINGS.members["outputS3Uri"], - self.output_s3_uri, - ) - serializer.write_struct( - _SCHEMA_MEDICAL_SCRIBE_POST_STREAM_ACTION_SETTINGS.members[ - "clinicalNoteGenerationSettings" - ], - self.clinical_note_generation_settings, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["output_s3_uri"] = de.read_string( - _SCHEMA_MEDICAL_SCRIBE_POST_STREAM_ACTION_SETTINGS.members[ - "outputS3Uri" - ] - ) - - case 1: - kwargs["clinical_note_generation_settings"] = ( - ClinicalNoteGenerationSettings.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MEDICAL_SCRIBE_POST_STREAM_ACTION_SETTINGS, consumer=_consumer - ) - if "output_s3_uri" not in kwargs: - kwargs["output_s3_uri"] = "" - if "clinical_note_generation_settings" not in kwargs: - kwargs["clinical_note_generation_settings"] = ( - ClinicalNoteGenerationSettings._smithy_default() - ) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls( - output_s3_uri="", - clinical_note_generation_settings=ClinicalNoteGenerationSettings._smithy_default(), - ) - - -@dataclass(kw_only=True) -class MedicalScribeConfigurationEvent: - """An event containing configuration for the Medical Scribe session""" - - post_stream_action_settings: MedicalScribePostStreamActionSettings - """Settings for actions to perform after the stream ends""" - - channel_definitions: list[MedicalScribeChannelDefinition] | None = None - """Channel definitions for the audio stream""" - - encounter_context: EncounterContext | None = None - """Context information about the clinical encounter""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDICAL_SCRIBE_CONFIGURATION_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MEDICAL_SCRIBE_CONFIGURATION_EVENT.members[ - "postStreamActionSettings" - ], - self.post_stream_action_settings, - ) - if self.channel_definitions is not None: - _serialize_medical_scribe_channel_definitions( - serializer, - _SCHEMA_MEDICAL_SCRIBE_CONFIGURATION_EVENT.members[ - "channelDefinitions" - ], - self.channel_definitions, - ) - - if self.encounter_context is not None: - serializer.write_struct( - _SCHEMA_MEDICAL_SCRIBE_CONFIGURATION_EVENT.members["encounterContext"], - self.encounter_context, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["post_stream_action_settings"] = ( - MedicalScribePostStreamActionSettings.deserialize(de) - ) - - case 1: - kwargs["channel_definitions"] = ( - _deserialize_medical_scribe_channel_definitions( - de, - _SCHEMA_MEDICAL_SCRIBE_CONFIGURATION_EVENT.members[ - "channelDefinitions" - ], - ) - ) - - case 2: - kwargs["encounter_context"] = EncounterContext.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MEDICAL_SCRIBE_CONFIGURATION_EVENT, consumer=_consumer - ) - if "post_stream_action_settings" not in kwargs: - kwargs["post_stream_action_settings"] = ( - MedicalScribePostStreamActionSettings._smithy_default() - ) - return kwargs - - -class MedicalScribeSessionControlEventType(UnknownEnumMixin, StrEnum): - END_OF_SESSION = "END_OF_SESSION" - - -@dataclass(kw_only=True) -class MedicalScribeSessionControlEvent: - """An event for controlling the Medical Scribe session""" - - type: str | None = None - """The type of session control event""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDICAL_SCRIBE_SESSION_CONTROL_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_MEDICAL_SCRIBE_SESSION_CONTROL_EVENT.members["type"], self.type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = MedicalScribeSessionControlEventType( - de.read_string( - _SCHEMA_MEDICAL_SCRIBE_SESSION_CONTROL_EVENT.members["type"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MEDICAL_SCRIBE_SESSION_CONTROL_EVENT, consumer=_consumer - ) - return kwargs - - -@dataclass -class MedicalScribeInputStreamAudioEvent: - """""" - - value: MedicalScribeAudioEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDICAL_SCRIBE_INPUT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MEDICAL_SCRIBE_INPUT_STREAM.members["audioEvent"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=MedicalScribeAudioEvent.deserialize(deserializer)) - - -@dataclass -class MedicalScribeInputStreamBinaryAudioEvent: - """ - An event containing raw binary audio data for the Medical Scribe stream. - The audio is sent as a raw binary payload rather than as a - base64-encoded value. - """ - - value: MedicalScribeBinaryAudioEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDICAL_SCRIBE_INPUT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MEDICAL_SCRIBE_INPUT_STREAM.members["binaryAudioEvent"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=MedicalScribeBinaryAudioEvent.deserialize(deserializer)) - - -@dataclass -class MedicalScribeInputStreamSessionControlEvent: - """""" - - value: MedicalScribeSessionControlEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDICAL_SCRIBE_INPUT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MEDICAL_SCRIBE_INPUT_STREAM.members["sessionControlEvent"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=MedicalScribeSessionControlEvent.deserialize(deserializer)) - - -@dataclass -class MedicalScribeInputStreamConfigurationEvent: - """""" - - value: MedicalScribeConfigurationEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDICAL_SCRIBE_INPUT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MEDICAL_SCRIBE_INPUT_STREAM.members["configurationEvent"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=MedicalScribeConfigurationEvent.deserialize(deserializer)) - - -@dataclass -class MedicalScribeInputStreamUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -MedicalScribeInputStream = Union[ - MedicalScribeInputStreamAudioEvent - | MedicalScribeInputStreamBinaryAudioEvent - | MedicalScribeInputStreamSessionControlEvent - | MedicalScribeInputStreamConfigurationEvent - | MedicalScribeInputStreamUnknown -] -""" -Input stream for Medical Scribe containing audio and configuration -events -""" - - -class _MedicalScribeInputStreamDeserializer: - _result: MedicalScribeInputStream | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> MedicalScribeInputStream: - self._result = None - deserializer.read_struct(_SCHEMA_MEDICAL_SCRIBE_INPUT_STREAM, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(MedicalScribeInputStreamAudioEvent.deserialize(de)) - - case 1: - self._set_result( - MedicalScribeInputStreamBinaryAudioEvent.deserialize(de) - ) - - case 2: - self._set_result( - MedicalScribeInputStreamSessionControlEvent.deserialize(de) - ) - - case 3: - self._set_result( - MedicalScribeInputStreamConfigurationEvent.deserialize(de) - ) - - case _: - self._set_result( - MedicalScribeInputStreamUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: MedicalScribeInputStream) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class StartMedicalScribeListeningSessionInput: - """Dataclass for StartMedicalScribeListeningSessionInput structure.""" - - session_id: str | None = None - """The Session identifier""" - - domain_id: str | None = None - """The Domain identifier""" - - subscription_id: str | None = None - """The Subscription identifier""" - - language_code: str | None = None - """The Language Code for the audio in the session""" - - media_sample_rate_hertz: int | None = None - """The sample rate of the input audio""" - - media_encoding: str | None = None - """The encoding for the input audio""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_START_MEDICAL_SCRIBE_LISTENING_SESSION_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.session_id is not None: - serializer.write_string( - _SCHEMA_START_MEDICAL_SCRIBE_LISTENING_SESSION_INPUT.members[ - "sessionId" - ], - self.session_id, - ) - - if self.domain_id is not None: - serializer.write_string( - _SCHEMA_START_MEDICAL_SCRIBE_LISTENING_SESSION_INPUT.members[ - "domainId" - ], - self.domain_id, - ) - - if self.subscription_id is not None: - serializer.write_string( - _SCHEMA_START_MEDICAL_SCRIBE_LISTENING_SESSION_INPUT.members[ - "subscriptionId" - ], - self.subscription_id, - ) - - if self.language_code is not None: - serializer.write_string( - _SCHEMA_START_MEDICAL_SCRIBE_LISTENING_SESSION_INPUT.members[ - "languageCode" - ], - self.language_code, - ) - - if self.media_sample_rate_hertz is not None: - serializer.write_integer( - _SCHEMA_START_MEDICAL_SCRIBE_LISTENING_SESSION_INPUT.members[ - "mediaSampleRateHertz" - ], - self.media_sample_rate_hertz, - ) - - if self.media_encoding is not None: - serializer.write_string( - _SCHEMA_START_MEDICAL_SCRIBE_LISTENING_SESSION_INPUT.members[ - "mediaEncoding" - ], - self.media_encoding, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["session_id"] = de.read_string( - _SCHEMA_START_MEDICAL_SCRIBE_LISTENING_SESSION_INPUT.members[ - "sessionId" - ] - ) - - case 1: - kwargs["domain_id"] = de.read_string( - _SCHEMA_START_MEDICAL_SCRIBE_LISTENING_SESSION_INPUT.members[ - "domainId" - ] - ) - - case 2: - kwargs["subscription_id"] = de.read_string( - _SCHEMA_START_MEDICAL_SCRIBE_LISTENING_SESSION_INPUT.members[ - "subscriptionId" - ] - ) - - case 3: - kwargs["language_code"] = MedicalScribeLanguageCode( - de.read_string( - _SCHEMA_START_MEDICAL_SCRIBE_LISTENING_SESSION_INPUT.members[ - "languageCode" - ] - ) - ) - - case 4: - kwargs["media_sample_rate_hertz"] = de.read_integer( - _SCHEMA_START_MEDICAL_SCRIBE_LISTENING_SESSION_INPUT.members[ - "mediaSampleRateHertz" - ] - ) - - case 5: - kwargs["media_encoding"] = MedicalScribeMediaEncoding( - de.read_string( - _SCHEMA_START_MEDICAL_SCRIBE_LISTENING_SESSION_INPUT.members[ - "mediaEncoding" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_START_MEDICAL_SCRIBE_LISTENING_SESSION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class MedicalScribeTranscriptSegment: - """A segment of transcript text with timing and channel information""" - - segment_id: str | None = None - """The unique identifier for this segment""" - - audio_begin_offset: float | None = None - """The offset from audio start when the audio for this segment begins""" - - audio_end_offset: float | None = None - """The offset from audio start when the audio for this segment ends""" - - is_partial: bool | None = None - """Indicates whether this is a partial or final transcript""" - - channel_id: str | None = None - """The channel identifier for this segment""" - - content: str | None = None - """The transcript text content""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_SEGMENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.segment_id is not None: - serializer.write_string( - _SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_SEGMENT.members["segmentId"], - self.segment_id, - ) - - if self.audio_begin_offset is not None: - serializer.write_double( - _SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_SEGMENT.members["audioBeginOffset"], - self.audio_begin_offset, - ) - - if self.audio_end_offset is not None: - serializer.write_double( - _SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_SEGMENT.members["audioEndOffset"], - self.audio_end_offset, - ) - - if self.is_partial is not None: - serializer.write_boolean( - _SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_SEGMENT.members["isPartial"], - self.is_partial, - ) - - if self.channel_id is not None: - serializer.write_string( - _SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_SEGMENT.members["channelId"], - self.channel_id, - ) - - if self.content is not None: - serializer.write_string( - _SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_SEGMENT.members["content"], - self.content, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["segment_id"] = de.read_string( - _SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_SEGMENT.members["segmentId"] - ) - - case 1: - kwargs["audio_begin_offset"] = de.read_double( - _SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_SEGMENT.members[ - "audioBeginOffset" - ] - ) - - case 2: - kwargs["audio_end_offset"] = de.read_double( - _SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_SEGMENT.members[ - "audioEndOffset" - ] - ) - - case 3: - kwargs["is_partial"] = de.read_boolean( - _SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_SEGMENT.members["isPartial"] - ) - - case 4: - kwargs["channel_id"] = de.read_string( - _SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_SEGMENT.members["channelId"] - ) - - case 5: - kwargs["content"] = de.read_string( - _SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_SEGMENT.members["content"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_SEGMENT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class MedicalScribeTranscriptEvent: - """An event containing transcript data from the Medical Scribe stream""" - - transcript_segment: MedicalScribeTranscriptSegment | None = None - """A segment of the transcript""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.transcript_segment is not None: - serializer.write_struct( - _SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_EVENT.members["transcriptSegment"], - self.transcript_segment, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["transcript_segment"] = ( - MedicalScribeTranscriptSegment.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_EVENT, consumer=_consumer - ) - return kwargs - - -@dataclass -class MedicalScribeOutputStreamTranscriptEvent: - """""" - - value: MedicalScribeTranscriptEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDICAL_SCRIBE_OUTPUT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MEDICAL_SCRIBE_OUTPUT_STREAM.members["transcriptEvent"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=MedicalScribeTranscriptEvent.deserialize(deserializer)) - - -@dataclass -class MedicalScribeOutputStreamInternalFailureException: - """""" - - value: InternalServerException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDICAL_SCRIBE_OUTPUT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MEDICAL_SCRIBE_OUTPUT_STREAM.members["internalFailureException"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=InternalServerException.deserialize(deserializer)) - - -@dataclass -class MedicalScribeOutputStreamValidationException: - """""" - - value: ValidationException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDICAL_SCRIBE_OUTPUT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MEDICAL_SCRIBE_OUTPUT_STREAM.members["validationException"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ValidationException.deserialize(deserializer)) - - -@dataclass -class MedicalScribeOutputStreamUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - This value may not be deliberately sent. +class ServiceError(ModeledError): """ + Base error for all errors in the service. - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -MedicalScribeOutputStream = Union[ - MedicalScribeOutputStreamTranscriptEvent - | MedicalScribeOutputStreamInternalFailureException - | MedicalScribeOutputStreamValidationException - | MedicalScribeOutputStreamUnknown -] -""" -Output stream from Medical Scribe containing transcript events and -errors -""" - - -class _MedicalScribeOutputStreamDeserializer: - _result: MedicalScribeOutputStream | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> MedicalScribeOutputStream: - self._result = None - deserializer.read_struct(_SCHEMA_MEDICAL_SCRIBE_OUTPUT_STREAM, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - MedicalScribeOutputStreamTranscriptEvent.deserialize(de) - ) - - case 1: - self._set_result( - MedicalScribeOutputStreamInternalFailureException.deserialize(de) - ) - - case 2: - self._set_result( - MedicalScribeOutputStreamValidationException.deserialize(de) - ) - - case _: - self._set_result( - MedicalScribeOutputStreamUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: MedicalScribeOutputStream) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class StartMedicalScribeListeningSessionOutput: - """Dataclass for StartMedicalScribeListeningSessionOutput structure.""" - - session_id: str | None = None - """The Session identifier""" - - domain_id: str | None = None - """The Domain identifier""" - - subscription_id: str | None = None - """The Subscription identifier""" - - request_id: str | None = None - """The Request identifier""" - - language_code: str | None = None - """The Language Code for the audio in the session""" - - media_sample_rate_hertz: int | None = None - """The sample rate of the input audio""" - - media_encoding: str | None = None - """The encoding for the input audio""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. + Some exceptions do not extend from this class, including + synthetic, implicit, and shared exception types. """ - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_START_MEDICAL_SCRIBE_LISTENING_SESSION_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.session_id is not None: - serializer.write_string( - _SCHEMA_START_MEDICAL_SCRIBE_LISTENING_SESSION_OUTPUT.members[ - "sessionId" - ], - self.session_id, - ) - - if self.domain_id is not None: - serializer.write_string( - _SCHEMA_START_MEDICAL_SCRIBE_LISTENING_SESSION_OUTPUT.members[ - "domainId" - ], - self.domain_id, - ) - - if self.subscription_id is not None: - serializer.write_string( - _SCHEMA_START_MEDICAL_SCRIBE_LISTENING_SESSION_OUTPUT.members[ - "subscriptionId" - ], - self.subscription_id, - ) - - if self.request_id is not None: - serializer.write_string( - _SCHEMA_START_MEDICAL_SCRIBE_LISTENING_SESSION_OUTPUT.members[ - "requestId" - ], - self.request_id, - ) - - if self.language_code is not None: - serializer.write_string( - _SCHEMA_START_MEDICAL_SCRIBE_LISTENING_SESSION_OUTPUT.members[ - "languageCode" - ], - self.language_code, - ) - - if self.media_sample_rate_hertz is not None: - serializer.write_integer( - _SCHEMA_START_MEDICAL_SCRIBE_LISTENING_SESSION_OUTPUT.members[ - "mediaSampleRateHertz" - ], - self.media_sample_rate_hertz, - ) - - if self.media_encoding is not None: - serializer.write_string( - _SCHEMA_START_MEDICAL_SCRIBE_LISTENING_SESSION_OUTPUT.members[ - "mediaEncoding" - ], - self.media_encoding, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["session_id"] = de.read_string( - _SCHEMA_START_MEDICAL_SCRIBE_LISTENING_SESSION_OUTPUT.members[ - "sessionId" - ] - ) - - case 1: - kwargs["domain_id"] = de.read_string( - _SCHEMA_START_MEDICAL_SCRIBE_LISTENING_SESSION_OUTPUT.members[ - "domainId" - ] - ) - - case 2: - kwargs["subscription_id"] = de.read_string( - _SCHEMA_START_MEDICAL_SCRIBE_LISTENING_SESSION_OUTPUT.members[ - "subscriptionId" - ] - ) - - case 3: - kwargs["request_id"] = de.read_string( - _SCHEMA_START_MEDICAL_SCRIBE_LISTENING_SESSION_OUTPUT.members[ - "requestId" - ] - ) - - case 4: - kwargs["language_code"] = MedicalScribeLanguageCode( - de.read_string( - _SCHEMA_START_MEDICAL_SCRIBE_LISTENING_SESSION_OUTPUT.members[ - "languageCode" - ] - ) - ) - - case 5: - kwargs["media_sample_rate_hertz"] = de.read_integer( - _SCHEMA_START_MEDICAL_SCRIBE_LISTENING_SESSION_OUTPUT.members[ - "mediaSampleRateHertz" - ] - ) - - case 6: - kwargs["media_encoding"] = MedicalScribeMediaEncoding( - de.read_string( - _SCHEMA_START_MEDICAL_SCRIBE_LISTENING_SESSION_OUTPUT.members[ - "mediaEncoding" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_START_MEDICAL_SCRIBE_LISTENING_SESSION_OUTPUT, consumer=_consumer - ) - return kwargs - -START_MEDICAL_SCRIBE_LISTENING_SESSION = APIOperation( - input=StartMedicalScribeListeningSessionInput, - output=StartMedicalScribeListeningSessionOutput, - schema=_SCHEMA_START_MEDICAL_SCRIBE_LISTENING_SESSION, - input_schema=_SCHEMA_START_MEDICAL_SCRIBE_LISTENING_SESSION_INPUT, - output_schema=_SCHEMA_START_MEDICAL_SCRIBE_LISTENING_SESSION_OUTPUT, - error_registry=TypeRegistry( +_registry = ModelRegistry( + _schemas, + renames={}, + index={ + "AccessDeniedException": "ACCESS_DENIED_EXCEPTION", + "ActivateSubscriptionInput": "ACTIVATE_SUBSCRIPTION_INPUT", + "ActivateSubscriptionOutput": "ACTIVATE_SUBSCRIPTION_OUTPUT", + "ArtifactDetails": "ARTIFACT_DETAILS", + "ClinicalNoteGenerationResult": "CLINICAL_NOTE_GENERATION_RESULT", + "ClinicalNoteGenerationSettings": "CLINICAL_NOTE_GENERATION_SETTINGS", + "ClinicalNoteGenerationSettingsResponse": "CLINICAL_NOTE_GENERATION_SETTINGS_RESPONSE", + "ConflictException": "CONFLICT_EXCEPTION", + "CreateDomainInput": "CREATE_DOMAIN_INPUT", + "CreateDomainOutput": "CREATE_DOMAIN_OUTPUT", + "CreateSubscriptionInput": "CREATE_SUBSCRIPTION_INPUT", + "CreateSubscriptionOutput": "CREATE_SUBSCRIPTION_OUTPUT", + "CreateWebAppConfiguration": "CREATE_WEB_APP_CONFIGURATION", + "CustomTemplate": "CUSTOM_TEMPLATE", + "CustomTemplateBase": "CUSTOM_TEMPLATE_BASE", + "CustomTemplateResponse": "CUSTOM_TEMPLATE_RESPONSE", + "DeactivateSubscriptionInput": "DEACTIVATE_SUBSCRIPTION_INPUT", + "DeactivateSubscriptionOutput": "DEACTIVATE_SUBSCRIPTION_OUTPUT", + "DeleteDomainInput": "DELETE_DOMAIN_INPUT", + "DeleteDomainOutput": "DELETE_DOMAIN_OUTPUT", + "DomainStatus": "DOMAIN_STATUS", + "DomainSummary": "DOMAIN_SUMMARY", + "EncounterContext": "ENCOUNTER_CONTEXT", + "EncryptionContext": "ENCRYPTION_CONTEXT", + "EncryptionType": "ENCRYPTION_TYPE", + "FHIRServer": "FHIR_SERVER", + "GetDomainInput": "GET_DOMAIN_INPUT", + "GetDomainOutput": "GET_DOMAIN_OUTPUT", + "GetMedicalScribeListeningSessionInput": "GET_MEDICAL_SCRIBE_LISTENING_SESSION_INPUT", + "GetMedicalScribeListeningSessionOutput": "GET_MEDICAL_SCRIBE_LISTENING_SESSION_OUTPUT", + "GetPatientInsightsJobInput": "GET_PATIENT_INSIGHTS_JOB_INPUT", + "GetPatientInsightsJobOutput": "GET_PATIENT_INSIGHTS_JOB_OUTPUT", + "GetSubscriptionInput": "GET_SUBSCRIPTION_INPUT", + "GetSubscriptionOutput": "GET_SUBSCRIPTION_OUTPUT", + "InputDataConfig": "INPUT_DATA_CONFIG", + "InsightsContext": "INSIGHTS_CONTEXT", + "InsightsOutput": "INSIGHTS_OUTPUT", + "InsightsType": "INSIGHTS_TYPE", + "InternalServerException": "INTERNAL_SERVER_EXCEPTION", + "JobStatus": "JOB_STATUS", + "ListDomainsInput": "LIST_DOMAINS_INPUT", + "ListDomainsOutput": "LIST_DOMAINS_OUTPUT", + "ListSubscriptionsInput": "LIST_SUBSCRIPTIONS_INPUT", + "ListSubscriptionsOutput": "LIST_SUBSCRIPTIONS_OUTPUT", + "ListTagsForResourceInput": "LIST_TAGS_FOR_RESOURCE_INPUT", + "ListTagsForResourceOutput": "LIST_TAGS_FOR_RESOURCE_OUTPUT", + "ManagedNoteTemplate": "MANAGED_NOTE_TEMPLATE", + "ManagedTemplate": "MANAGED_TEMPLATE", + "ManagedTemplateResponse": "MANAGED_TEMPLATE_RESPONSE", + "MedicalScribeAudioEvent": "MEDICAL_SCRIBE_AUDIO_EVENT", + "MedicalScribeBinaryAudioEvent": "MEDICAL_SCRIBE_BINARY_AUDIO_EVENT", + "MedicalScribeChannelDefinition": "MEDICAL_SCRIBE_CHANNEL_DEFINITION", + "MedicalScribeConfigurationEvent": "MEDICAL_SCRIBE_CONFIGURATION_EVENT", + "MedicalScribeInputStream": "MEDICAL_SCRIBE_INPUT_STREAM", + "MedicalScribeInputStreamAudioEvent": "MEDICAL_SCRIBE_INPUT_STREAM", + "MedicalScribeInputStreamBinaryAudioEvent": "MEDICAL_SCRIBE_INPUT_STREAM", + "MedicalScribeInputStreamSessionControlEvent": "MEDICAL_SCRIBE_INPUT_STREAM", + "MedicalScribeInputStreamConfigurationEvent": "MEDICAL_SCRIBE_INPUT_STREAM", + "MedicalScribeInputStreamUnknown": "MEDICAL_SCRIBE_INPUT_STREAM", + "MedicalScribeLanguageCode": "MEDICAL_SCRIBE_LANGUAGE_CODE", + "MedicalScribeListeningSessionDetails": "MEDICAL_SCRIBE_LISTENING_SESSION_DETAILS", + "MedicalScribeMediaEncoding": "MEDICAL_SCRIBE_MEDIA_ENCODING", + "MedicalScribeOutputStream": "MEDICAL_SCRIBE_OUTPUT_STREAM", + "MedicalScribeOutputStreamTranscriptEvent": "MEDICAL_SCRIBE_OUTPUT_STREAM", + "MedicalScribeOutputStreamInternalFailureException": "MEDICAL_SCRIBE_OUTPUT_STREAM", + "MedicalScribeOutputStreamValidationException": "MEDICAL_SCRIBE_OUTPUT_STREAM", + "MedicalScribeOutputStreamUnknown": "MEDICAL_SCRIBE_OUTPUT_STREAM", + "MedicalScribeParticipantRole": "MEDICAL_SCRIBE_PARTICIPANT_ROLE", + "MedicalScribePostStreamActionSettings": "MEDICAL_SCRIBE_POST_STREAM_ACTION_SETTINGS", + "MedicalScribePostStreamActionSettingsResponse": "MEDICAL_SCRIBE_POST_STREAM_ACTION_SETTINGS_RESPONSE", + "MedicalScribePostStreamActionsResult": "MEDICAL_SCRIBE_POST_STREAM_ACTIONS_RESULT", + "MedicalScribeSessionControlEvent": "MEDICAL_SCRIBE_SESSION_CONTROL_EVENT", + "MedicalScribeSessionControlEventType": "MEDICAL_SCRIBE_SESSION_CONTROL_EVENT_TYPE", + "MedicalScribeStreamStatus": "MEDICAL_SCRIBE_STREAM_STATUS", + "MedicalScribeTranscriptEvent": "MEDICAL_SCRIBE_TRANSCRIPT_EVENT", + "MedicalScribeTranscriptSegment": "MEDICAL_SCRIBE_TRANSCRIPT_SEGMENT", + "NoteTemplateSettings": "NOTE_TEMPLATE_SETTINGS", + "NoteTemplateSettingsManagedTemplate": "NOTE_TEMPLATE_SETTINGS", + "NoteTemplateSettingsCustomTemplate": "NOTE_TEMPLATE_SETTINGS", + "NoteTemplateSettingsUnknown": "NOTE_TEMPLATE_SETTINGS", + "NoteTemplateSettingsResponse": "NOTE_TEMPLATE_SETTINGS_RESPONSE", + "NoteTemplateSettingsResponseManagedTemplate": "NOTE_TEMPLATE_SETTINGS_RESPONSE", + "NoteTemplateSettingsResponseCustomTemplate": "NOTE_TEMPLATE_SETTINGS_RESPONSE", + "NoteTemplateSettingsResponseUnknown": "NOTE_TEMPLATE_SETTINGS_RESPONSE", + "OutputDataConfig": "OUTPUT_DATA_CONFIG", + "PatientInsightsEncounterContext": "PATIENT_INSIGHTS_ENCOUNTER_CONTEXT", + "PatientInsightsPatientContext": "PATIENT_INSIGHTS_PATIENT_CONTEXT", + "PostStreamArtifactGenerationStatus": "POST_STREAM_ARTIFACT_GENERATION_STATUS", + "Pronouns": "PRONOUNS", + "ProviderRole": "PROVIDER_ROLE", + "ResourceNotFoundException": "RESOURCE_NOT_FOUND_EXCEPTION", + "S3Source": "S3_SOURCE", + "ServiceQuotaExceededException": "SERVICE_QUOTA_EXCEEDED_EXCEPTION", + "Specialty": "SPECIALTY", + "StartMedicalScribeListeningSessionInput": "START_MEDICAL_SCRIBE_LISTENING_SESSION_INPUT", + "StartMedicalScribeListeningSessionOutput": "START_MEDICAL_SCRIBE_LISTENING_SESSION_OUTPUT", + "StartPatientInsightsJobInput": "START_PATIENT_INSIGHTS_JOB_INPUT", + "StartPatientInsightsJobOutput": "START_PATIENT_INSIGHTS_JOB_OUTPUT", + "SubscriptionDescription": "SUBSCRIPTION_DESCRIPTION", + "SubscriptionStatus": "SUBSCRIPTION_STATUS", + "TagResourceInput": "TAG_RESOURCE_INPUT", + "TagResourceOutput": "TAG_RESOURCE_OUTPUT", + "TemplateSectionInstruction": "TEMPLATE_SECTION_INSTRUCTION", + "ThrottlingException": "THROTTLING_EXCEPTION", + "UntagResourceInput": "UNTAG_RESOURCE_INPUT", + "UntagResourceOutput": "UNTAG_RESOURCE_OUTPUT", + "UserContext": "USER_CONTEXT", + "ValidationException": "VALIDATION_EXCEPTION", + "WebAppConfiguration": "WEB_APP_CONFIGURATION", + }, + shape_names=frozenset( { - ShapeID( - "com.amazonaws.connecthealth#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.connecthealth#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.connecthealth#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.connecthealth#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID( - "com.amazonaws.connecthealth#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.connecthealth#ValidationException" - ): ValidationException, + "AccessDeniedException", + "ActivateSubscriptionInput", + "ActivateSubscriptionOutput", + "ArtifactDetails", + "ClinicalNoteGenerationResult", + "ClinicalNoteGenerationSettings", + "ClinicalNoteGenerationSettingsResponse", + "ConflictException", + "CreateDomainInput", + "CreateDomainOutput", + "CreateSubscriptionInput", + "CreateSubscriptionOutput", + "CreateWebAppConfiguration", + "CustomTemplate", + "CustomTemplateBase", + "CustomTemplateResponse", + "DeactivateSubscriptionInput", + "DeactivateSubscriptionOutput", + "DeleteDomainInput", + "DeleteDomainOutput", + "DomainStatus", + "DomainSummary", + "EncounterContext", + "EncryptionContext", + "EncryptionType", + "FHIRServer", + "GetDomainInput", + "GetDomainOutput", + "GetMedicalScribeListeningSessionInput", + "GetMedicalScribeListeningSessionOutput", + "GetPatientInsightsJobInput", + "GetPatientInsightsJobOutput", + "GetSubscriptionInput", + "GetSubscriptionOutput", + "InputDataConfig", + "InsightsContext", + "InsightsOutput", + "InsightsType", + "InternalServerException", + "JobStatus", + "ListDomainsInput", + "ListDomainsOutput", + "ListSubscriptionsInput", + "ListSubscriptionsOutput", + "ListTagsForResourceInput", + "ListTagsForResourceOutput", + "ManagedNoteTemplate", + "ManagedTemplate", + "ManagedTemplateResponse", + "MedicalScribeAudioEvent", + "MedicalScribeBinaryAudioEvent", + "MedicalScribeChannelDefinition", + "MedicalScribeConfigurationEvent", + "MedicalScribeInputStream", + "MedicalScribeLanguageCode", + "MedicalScribeListeningSessionDetails", + "MedicalScribeMediaEncoding", + "MedicalScribeOutputStream", + "MedicalScribeParticipantRole", + "MedicalScribePostStreamActionSettings", + "MedicalScribePostStreamActionSettingsResponse", + "MedicalScribePostStreamActionsResult", + "MedicalScribeSessionControlEvent", + "MedicalScribeSessionControlEventType", + "MedicalScribeStreamStatus", + "MedicalScribeTranscriptEvent", + "MedicalScribeTranscriptSegment", + "NoteTemplateSettings", + "NoteTemplateSettingsResponse", + "OutputDataConfig", + "PatientInsightsEncounterContext", + "PatientInsightsPatientContext", + "PostStreamArtifactGenerationStatus", + "Pronouns", + "ProviderRole", + "ResourceNotFoundException", + "S3Source", + "ServiceQuotaExceededException", + "Specialty", + "StartMedicalScribeListeningSessionInput", + "StartMedicalScribeListeningSessionOutput", + "StartPatientInsightsJobInput", + "StartPatientInsightsJobOutput", + "SubscriptionDescription", + "SubscriptionStatus", + "TagResourceInput", + "TagResourceOutput", + "TemplateSectionInstruction", + "ThrottlingException", + "UntagResourceInput", + "UntagResourceOutput", + "UserContext", + "ValidationException", + "WebAppConfiguration", } ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], + service_error="ServiceError", ) -@dataclass(kw_only=True) -class StartPatientInsightsJobInput: - """Dataclass for StartPatientInsightsJobInput structure.""" - - domain_id: str | None = None - """""" - - patient_context: PatientInsightsPatientContext | None = None - """""" - - insights_context: InsightsContext | None = None - """""" - - encounter_context: PatientInsightsEncounterContext | None = None - """""" - - user_context: UserContext | None = None - """""" - - input_data_config: InputDataConfig | None = None - """""" - - output_data_config: OutputDataConfig | None = None - """""" - - client_token: str | None = None - """ - Unique, case-sensitive identifier that you provide to ensure the - idempotency of the request. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_PATIENT_INSIGHTS_JOB_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.domain_id is not None: - serializer.write_string( - _SCHEMA_START_PATIENT_INSIGHTS_JOB_INPUT.members["domainId"], - self.domain_id, - ) - - if self.patient_context is not None: - serializer.write_struct( - _SCHEMA_START_PATIENT_INSIGHTS_JOB_INPUT.members["patientContext"], - self.patient_context, - ) - - if self.insights_context is not None: - serializer.write_struct( - _SCHEMA_START_PATIENT_INSIGHTS_JOB_INPUT.members["insightsContext"], - self.insights_context, - ) - - if self.encounter_context is not None: - serializer.write_struct( - _SCHEMA_START_PATIENT_INSIGHTS_JOB_INPUT.members["encounterContext"], - self.encounter_context, - ) - - if self.user_context is not None: - serializer.write_struct( - _SCHEMA_START_PATIENT_INSIGHTS_JOB_INPUT.members["userContext"], - self.user_context, - ) - - if self.input_data_config is not None: - serializer.write_struct( - _SCHEMA_START_PATIENT_INSIGHTS_JOB_INPUT.members["inputDataConfig"], - self.input_data_config, - ) - - if self.output_data_config is not None: - serializer.write_struct( - _SCHEMA_START_PATIENT_INSIGHTS_JOB_INPUT.members["outputDataConfig"], - self.output_data_config, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_START_PATIENT_INSIGHTS_JOB_INPUT.members["clientToken"], - self.client_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["domain_id"] = de.read_string( - _SCHEMA_START_PATIENT_INSIGHTS_JOB_INPUT.members["domainId"] - ) - - case 1: - kwargs["patient_context"] = ( - PatientInsightsPatientContext.deserialize(de) - ) - - case 2: - kwargs["insights_context"] = InsightsContext.deserialize(de) - - case 3: - kwargs["encounter_context"] = ( - PatientInsightsEncounterContext.deserialize(de) - ) - - case 4: - kwargs["user_context"] = UserContext.deserialize(de) - - case 5: - kwargs["input_data_config"] = InputDataConfig.deserialize(de) - - case 6: - kwargs["output_data_config"] = OutputDataConfig.deserialize(de) - - case 7: - kwargs["client_token"] = de.read_string( - _SCHEMA_START_PATIENT_INSIGHTS_JOB_INPUT.members["clientToken"] - ) +def __getattr__(name: str): + return _registry.build(name) - case _: - logger.debug("Unexpected member schema: %s", schema) - deserializer.read_struct( - _SCHEMA_START_PATIENT_INSIGHTS_JOB_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class StartPatientInsightsJobOutput: - """Dataclass for StartPatientInsightsJobOutput structure.""" - - job_arn: str - """""" - - job_id: str - """""" +ACTIVATE_SUBSCRIPTION: APIOperation[ + ActivateSubscriptionInput, ActivateSubscriptionOutput +] = APIOperation( + static_schema=_SCHEMA_ACTIVATE_SUBSCRIPTION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.connecthealth#AccessDeniedException"), + ShapeID("com.amazonaws.connecthealth#InternalServerException"), + ShapeID("com.amazonaws.connecthealth#ResourceNotFoundException"), + ShapeID("com.amazonaws.connecthealth#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - creation_time: datetime | None = None - """Date and time the patient insights job was submitted.""" +CREATE_DOMAIN: APIOperation[CreateDomainInput, CreateDomainOutput] = APIOperation( + static_schema=_SCHEMA_CREATE_DOMAIN, + model_registry=_registry, + error_ids=[ShapeID("com.amazonaws.connecthealth#ServiceQuotaExceededException")], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False +CREATE_SUBSCRIPTION: APIOperation[CreateSubscriptionInput, CreateSubscriptionOutput] = ( + APIOperation( + static_schema=_SCHEMA_CREATE_SUBSCRIPTION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.connecthealth#AccessDeniedException"), + ShapeID("com.amazonaws.connecthealth#InternalServerException"), + ShapeID("com.amazonaws.connecthealth#ResourceNotFoundException"), + ShapeID("com.amazonaws.connecthealth#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.connecthealth#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_PATIENT_INSIGHTS_JOB_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_START_PATIENT_INSIGHTS_JOB_OUTPUT.members["jobArn"], self.job_arn - ) - serializer.write_string( - _SCHEMA_START_PATIENT_INSIGHTS_JOB_OUTPUT.members["jobId"], self.job_id - ) - if self.creation_time is not None: - serializer.write_timestamp( - _SCHEMA_START_PATIENT_INSIGHTS_JOB_OUTPUT.members["creationTime"], - self.creation_time, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["job_arn"] = de.read_string( - _SCHEMA_START_PATIENT_INSIGHTS_JOB_OUTPUT.members["jobArn"] - ) - - case 1: - kwargs["job_id"] = de.read_string( - _SCHEMA_START_PATIENT_INSIGHTS_JOB_OUTPUT.members["jobId"] - ) - - case 2: - kwargs["creation_time"] = de.read_timestamp( - _SCHEMA_START_PATIENT_INSIGHTS_JOB_OUTPUT.members[ - "creationTime" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_START_PATIENT_INSIGHTS_JOB_OUTPUT, consumer=_consumer - ) - if "job_arn" not in kwargs: - kwargs["job_arn"] = "" - if "job_id" not in kwargs: - kwargs["job_id"] = "" - return kwargs - +) -START_PATIENT_INSIGHTS_JOB = APIOperation( - input=StartPatientInsightsJobInput, - output=StartPatientInsightsJobOutput, - schema=_SCHEMA_START_PATIENT_INSIGHTS_JOB, - input_schema=_SCHEMA_START_PATIENT_INSIGHTS_JOB_INPUT, - output_schema=_SCHEMA_START_PATIENT_INSIGHTS_JOB_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.connecthealth#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.connecthealth#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.connecthealth#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.connecthealth#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.connecthealth#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.connecthealth#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, +DEACTIVATE_SUBSCRIPTION: APIOperation[ + DeactivateSubscriptionInput, DeactivateSubscriptionOutput +] = APIOperation( + static_schema=_SCHEMA_DEACTIVATE_SUBSCRIPTION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.connecthealth#AccessDeniedException"), + ShapeID("com.amazonaws.connecthealth#InternalServerException"), + ShapeID("com.amazonaws.connecthealth#ResourceNotFoundException"), + ShapeID("com.amazonaws.connecthealth#ValidationException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) +DELETE_DOMAIN: APIOperation[DeleteDomainInput, DeleteDomainOutput] = APIOperation( + static_schema=_SCHEMA_DELETE_DOMAIN, + model_registry=_registry, + error_ids=[ShapeID("com.amazonaws.connecthealth#ResourceNotFoundException")], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -@dataclass(kw_only=True) -class TagResourceInput: - """Dataclass for TagResourceInput structure.""" - - resource_arn: str | None = None - """The ARN of the resource to tag""" - - tags: dict[str, str] | None = None - """The tags to add to the resource""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TAG_RESOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_TAG_RESOURCE_INPUT.members["resourceArn"], self.resource_arn - ) - - if self.tags is not None: - _serialize_tag_map( - serializer, _SCHEMA_TAG_RESOURCE_INPUT.members["tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_TAG_RESOURCE_INPUT.members["resourceArn"] - ) - - case 1: - kwargs["tags"] = _deserialize_tag_map( - de, _SCHEMA_TAG_RESOURCE_INPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TAG_RESOURCE_INPUT, consumer=_consumer) - return kwargs +GET_DOMAIN: APIOperation[GetDomainInput, GetDomainOutput] = APIOperation( + static_schema=_SCHEMA_GET_DOMAIN, + model_registry=_registry, + error_ids=[ShapeID("com.amazonaws.connecthealth#ResourceNotFoundException")], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +GET_MEDICAL_SCRIBE_LISTENING_SESSION: APIOperation[ + GetMedicalScribeListeningSessionInput, GetMedicalScribeListeningSessionOutput +] = APIOperation( + static_schema=_SCHEMA_GET_MEDICAL_SCRIBE_LISTENING_SESSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.connecthealth#AccessDeniedException"), + ShapeID("com.amazonaws.connecthealth#InternalServerException"), + ShapeID("com.amazonaws.connecthealth#ResourceNotFoundException"), + ShapeID("com.amazonaws.connecthealth#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.connecthealth#ThrottlingException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -@dataclass(kw_only=True) -class TagResourceOutput: - """Dataclass for TagResourceOutput structure.""" +GET_PATIENT_INSIGHTS_JOB: APIOperation[ + GetPatientInsightsJobInput, GetPatientInsightsJobOutput +] = APIOperation( + static_schema=_SCHEMA_GET_PATIENT_INSIGHTS_JOB, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.connecthealth#AccessDeniedException"), + ShapeID("com.amazonaws.connecthealth#InternalServerException"), + ShapeID("com.amazonaws.connecthealth#ResourceNotFoundException"), + ShapeID("com.amazonaws.connecthealth#ThrottlingException"), + ShapeID("com.amazonaws.connecthealth#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False +GET_SUBSCRIPTION: APIOperation[GetSubscriptionInput, GetSubscriptionOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_SUBSCRIPTION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.connecthealth#AccessDeniedException"), + ShapeID("com.amazonaws.connecthealth#InternalServerException"), + ShapeID("com.amazonaws.connecthealth#ResourceNotFoundException"), + ShapeID("com.amazonaws.connecthealth#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TAG_RESOURCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TAG_RESOURCE_OUTPUT, consumer=_consumer) - return kwargs - +) -TAG_RESOURCE = APIOperation( - input=TagResourceInput, - output=TagResourceOutput, - schema=_SCHEMA_TAG_RESOURCE, - input_schema=_SCHEMA_TAG_RESOURCE_INPUT, - output_schema=_SCHEMA_TAG_RESOURCE_OUTPUT, - error_registry=TypeRegistry({}), +LIST_DOMAINS: APIOperation[ListDomainsInput, ListDomainsOutput] = APIOperation( + static_schema=_SCHEMA_LIST_DOMAINS, + model_registry=_registry, + error_ids=[], effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[], ) - -def _serialize_tag_key_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_tag_key_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class UntagResourceInput: - """Dataclass for UntagResourceInput structure.""" - - resource_arn: str | None = None - """The ARN of the resource to untag""" - - tag_keys: list[str] | None = None - """The tag keys to remove from the resource""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNTAG_RESOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_UNTAG_RESOURCE_INPUT.members["resourceArn"], self.resource_arn - ) - - if self.tag_keys is not None: - _serialize_tag_key_list( - serializer, - _SCHEMA_UNTAG_RESOURCE_INPUT.members["tagKeys"], - self.tag_keys, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_UNTAG_RESOURCE_INPUT.members["resourceArn"] - ) - - case 1: - kwargs["tag_keys"] = _deserialize_tag_key_list( - de, _SCHEMA_UNTAG_RESOURCE_INPUT.members["tagKeys"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UNTAG_RESOURCE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UntagResourceOutput: - """Dataclass for UntagResourceOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False +LIST_SUBSCRIPTIONS: APIOperation[ListSubscriptionsInput, ListSubscriptionsOutput] = ( + APIOperation( + static_schema=_SCHEMA_LIST_SUBSCRIPTIONS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.connecthealth#AccessDeniedException"), + ShapeID("com.amazonaws.connecthealth#InternalServerException"), + ShapeID("com.amazonaws.connecthealth#ResourceNotFoundException"), + ShapeID("com.amazonaws.connecthealth#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNTAG_RESOURCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) +) - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +LIST_TAGS_FOR_RESOURCE: APIOperation[ + ListTagsForResourceInput, ListTagsForResourceOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_TAGS_FOR_RESOURCE, + model_registry=_registry, + error_ids=[], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) +START_MEDICAL_SCRIBE_LISTENING_SESSION: APIOperation[ + StartMedicalScribeListeningSessionInput, StartMedicalScribeListeningSessionOutput +] = APIOperation( + static_schema=_SCHEMA_START_MEDICAL_SCRIBE_LISTENING_SESSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.connecthealth#AccessDeniedException"), + ShapeID("com.amazonaws.connecthealth#InternalServerException"), + ShapeID("com.amazonaws.connecthealth#ResourceNotFoundException"), + ShapeID("com.amazonaws.connecthealth#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.connecthealth#ThrottlingException"), + ShapeID("com.amazonaws.connecthealth#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - deserializer.read_struct(_SCHEMA_UNTAG_RESOURCE_OUTPUT, consumer=_consumer) - return kwargs +START_PATIENT_INSIGHTS_JOB: APIOperation[ + StartPatientInsightsJobInput, StartPatientInsightsJobOutput +] = APIOperation( + static_schema=_SCHEMA_START_PATIENT_INSIGHTS_JOB, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.connecthealth#AccessDeniedException"), + ShapeID("com.amazonaws.connecthealth#ConflictException"), + ShapeID("com.amazonaws.connecthealth#InternalServerException"), + ShapeID("com.amazonaws.connecthealth#ResourceNotFoundException"), + ShapeID("com.amazonaws.connecthealth#ThrottlingException"), + ShapeID("com.amazonaws.connecthealth#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +TAG_RESOURCE: APIOperation[TagResourceInput, TagResourceOutput] = APIOperation( + static_schema=_SCHEMA_TAG_RESOURCE, + model_registry=_registry, + error_ids=[], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -UNTAG_RESOURCE = APIOperation( - input=UntagResourceInput, - output=UntagResourceOutput, - schema=_SCHEMA_UNTAG_RESOURCE, - input_schema=_SCHEMA_UNTAG_RESOURCE_INPUT, - output_schema=_SCHEMA_UNTAG_RESOURCE_OUTPUT, - error_registry=TypeRegistry({}), +UNTAG_RESOURCE: APIOperation[UntagResourceInput, UntagResourceOutput] = APIOperation( + static_schema=_SCHEMA_UNTAG_RESOURCE, + model_registry=_registry, + error_ids=[], effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[], ) diff --git a/clients/aws-sdk-connecthealth/src/aws_sdk_connecthealth/models.pyi b/clients/aws-sdk-connecthealth/src/aws_sdk_connecthealth/models.pyi new file mode 100644 index 00000000..7d2f6867 --- /dev/null +++ b/clients/aws-sdk-connecthealth/src/aws_sdk_connecthealth/models.pyi @@ -0,0 +1,1246 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. + +from dataclasses import dataclass +from datetime import datetime +from enum import StrEnum +from typing import Self, Union + +from smithy_core.deserializers import ShapeDeserializer +from smithy_core.exceptions import ModeledError +from smithy_core.response import ResponseMetadata +from smithy_core.schemas import APIOperation +from smithy_core.serializers import ShapeSerializer +from smithy_core.types import UnknownEnumMixin + +class _SerdeShape: + def serialize(self, serializer: ShapeSerializer) -> None: ... + def serialize_members(self, serializer: ShapeSerializer) -> None: ... + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: ... + +class ServiceError(ModeledError): + """ + Base error for all errors in the service. + + Some exceptions do not extend from this class, including + synthetic, implicit, and shared exception types. + """ + +@dataclass(kw_only=True) +class AccessDeniedException(ServiceError, _SerdeShape): + """ + This error is thrown when the client does not supply proper credentials + to the API. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ActivateSubscriptionInput(_SerdeShape): + """Dataclass for ActivateSubscriptionInput structure.""" + + domain_id: str | None = ... + """The unique identifier of the parent Domain.""" + subscription_id: str | None = ... + """The unique identifier of the Subscription.""" + +@dataclass(kw_only=True) +class ActivateSubscriptionOutput(_SerdeShape): + """Dataclass for ActivateSubscriptionOutput structure.""" + + subscription: SubscriptionDescription | None = ... + """""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ArtifactDetails(_SerdeShape): + """Details about a generated artifact including location and status""" + + output_location: str | None = ... + """""" + status: str | None = ... + """The generation status of the artifact""" + failure_reason: str | None = ... + """The reason for failure if the artifact generation failed""" + +@dataclass(kw_only=True) +class ClinicalNoteGenerationResult(_SerdeShape): + """ + Results of clinical note generation including note, transcript, and + summary + """ + + note_result: ArtifactDetails | None = ... + """Details about the generated clinical note""" + transcript_result: ArtifactDetails | None = ... + """Details about the generated transcript""" + after_visit_summary_result: ArtifactDetails | None = ... + """Details about the generated after visit summary""" + +@dataclass(kw_only=True) +class ClinicalNoteGenerationSettings(_SerdeShape): + """Settings for generating clinical notes from the audio stream""" + + note_template_settings: NoteTemplateSettings + """Settings for the note template to use""" + +@dataclass(kw_only=True) +class ClinicalNoteGenerationSettingsResponse(_SerdeShape): + """Response containing settings for clinical note generation""" + + note_template_settings: NoteTemplateSettingsResponse | None = ... + """Settings for the note template used""" + +@dataclass(kw_only=True) +class ConflictException(ServiceError, _SerdeShape): + """ + This error is thrown when a resource update is no longer valid due to + assumptions about initial state changing. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateDomainInput(_SerdeShape): + """Dataclass for CreateDomainInput structure.""" + + name: str | None = ... + """The name for the new Domain.""" + kms_key_arn: str | None = ... + """The ARN of the KMS key to use for encrypting data in this Domain.""" + web_app_setup_configuration: CreateWebAppConfiguration | None = ... + """ + Configuration for the Domain web application. Optional, but if provided + all fields are required. + """ + tags: dict[str, str] | None = ... + """Tags to associate with the Domain.""" + +@dataclass(kw_only=True) +class CreateDomainOutput(_SerdeShape): + """Dataclass for CreateDomainOutput structure.""" + + domain_id: str + """""" + arn: str + """""" + name: str + """""" + kms_key_arn: str | None = ... + """""" + encryption_context: EncryptionContext | None = ... + """""" + status: str + """""" + web_app_url: str | None = ... + """""" + web_app_configuration: WebAppConfiguration | None = ... + """""" + created_at: datetime + """""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateSubscriptionInput(_SerdeShape): + """Dataclass for CreateSubscriptionInput structure.""" + + domain_id: str | None = ... + """The unique identifier of the parent Domain.""" + +@dataclass(kw_only=True) +class CreateSubscriptionOutput(_SerdeShape): + """Dataclass for CreateSubscriptionOutput structure.""" + + domain_id: str + """""" + subscription_id: str + """""" + arn: str + """""" + status: str + """""" + created_at: datetime + """""" + last_updated_at: datetime + """""" + activated_at: datetime | None = ... + """""" + deactivated_at: datetime | None = ... + """""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateWebAppConfiguration(_SerdeShape): + """ + Input configuration for creating a web application. Used only in + CreateDomain operation input. + """ + + ehr_role: str + """ARN of the IAM role used for EHR operations.""" + idc_instance_id: str + """The Identity Center instance ID to use for creating the application.""" + idc_region: str + """The AWS region where Identity Center is configured.""" + +@dataclass(kw_only=True) +class CustomTemplate(_SerdeShape): + """ + Configuration for using a custom note template with specific + instructions + """ + + template_type: str + """The base template type to customize""" + template_instructions: list[TemplateSectionInstruction] + """Custom instructions for each section of the template""" + +class CustomTemplateBase(UnknownEnumMixin, StrEnum): + HISTORY_AND_PHYSICAL = "HISTORY_AND_PHYSICAL" + GIRPP = "GIRPP" + DAP = "DAP" + SIRP = "SIRP" + BIRP = "BIRP" + BEHAVIORAL_SOAP = "BEHAVIORAL_SOAP" + +@dataclass(kw_only=True) +class CustomTemplateResponse(_SerdeShape): + """Response containing custom template information""" + + template_type: str | None = ... + """The base template type that was customized""" + +@dataclass(kw_only=True) +class DeactivateSubscriptionInput(_SerdeShape): + """Dataclass for DeactivateSubscriptionInput structure.""" + + domain_id: str | None = ... + """The unique identifier of the parent Domain.""" + subscription_id: str | None = ... + """The unique identifier of the Subscription.""" + +@dataclass(kw_only=True) +class DeactivateSubscriptionOutput(_SerdeShape): + """Dataclass for DeactivateSubscriptionOutput structure.""" + + subscription: SubscriptionDescription | None = ... + """""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteDomainInput(_SerdeShape): + """Dataclass for DeleteDomainInput structure.""" + + domain_id: str | None = ... + """The id of the Domain to delete""" + +@dataclass(kw_only=True) +class DeleteDomainOutput(_SerdeShape): + """Dataclass for DeleteDomainOutput structure.""" + + domain_id: str + """The id of the Domain requested for deletion""" + arn: str + """The ARN of the Domain that was requested for deletion""" + status: str + """Current status of Domain""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class DomainStatus(UnknownEnumMixin, StrEnum): + ACTIVE = "ACTIVE" + DELETING = "DELETING" + DELETED = "DELETED" + +@dataclass(kw_only=True) +class DomainSummary(_SerdeShape): + """Summary information about a Domain.""" + + domain_id: str + """The unique identifier of the Domain.""" + arn: str + """""" + name: str + """""" + status: str + """""" + created_at: datetime + """The timestamp when the Domain was created.""" + +@dataclass(kw_only=True) +class EncounterContext(_SerdeShape): + """Context information about the clinical encounter""" + + unstructured_context: str | None = ... + """Unstructured context information in markdown format""" + +@dataclass(kw_only=True) +class EncryptionContext(_SerdeShape): + """Encryption context for a Domain.""" + + encryption_type: str + """The type of encryption key used.""" + kms_key_arn: str | None = ... + """ + The ARN of the KMS key. Only present when encryptionType is + CUSTOMER_MANAGED_KEY. + """ + +class EncryptionType(UnknownEnumMixin, StrEnum): + AWS_OWNED_KEY = "AWS_OWNED_KEY" + CUSTOMER_MANAGED_KEY = "CUSTOMER_MANAGED_KEY" + +@dataclass(kw_only=True) +class FHIRServer(_SerdeShape): + """FHIR server configuration for input data source""" + + fhir_endpoint: str + """FHIR server endpoint URL for accessing patient data.""" + oauth_token: str | None = ... + """OAuth token for authenticating with the FHIR server.""" + +@dataclass(kw_only=True) +class GetDomainInput(_SerdeShape): + """Dataclass for GetDomainInput structure.""" + + domain_id: str | None = ... + """The id of the Domain to get""" + +@dataclass(kw_only=True) +class GetDomainOutput(_SerdeShape): + """Dataclass for GetDomainOutput structure.""" + + domain_id: str + """""" + arn: str + """""" + name: str + """""" + kms_key_arn: str | None = ... + """""" + encryption_context: EncryptionContext | None = ... + """""" + status: str + """""" + web_app_url: str | None = ... + """""" + web_app_configuration: WebAppConfiguration | None = ... + """""" + created_at: datetime + """""" + tags: dict[str, str] | None = ... + """Tags associated with the Domain""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetMedicalScribeListeningSessionInput(_SerdeShape): + """Dataclass for GetMedicalScribeListeningSessionInput structure.""" + + session_id: str | None = ... + """The Session identifier""" + domain_id: str | None = ... + """The Domain identifier""" + subscription_id: str | None = ... + """The Subscription identifier""" + +@dataclass(kw_only=True) +class GetMedicalScribeListeningSessionOutput(_SerdeShape): + """Dataclass for GetMedicalScribeListeningSessionOutput structure.""" + + medical_scribe_listening_session_details: ( + MedicalScribeListeningSessionDetails | None + ) = ... + """Details about the Medical Scribe listening session""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetPatientInsightsJobInput(_SerdeShape): + """Dataclass for GetPatientInsightsJobInput structure.""" + + domain_id: str | None = ... + """""" + job_id: str | None = ... + """""" + +@dataclass(kw_only=True) +class GetPatientInsightsJobOutput(_SerdeShape): + """Dataclass for GetPatientInsightsJobOutput structure.""" + + job_id: str + """""" + job_arn: str + """""" + job_status: str + """""" + creation_time: datetime | None = ... + """Date and time the patient insights job was submitted.""" + updated_time: datetime | None = ... + """Date and time the patient insights job was last updated.""" + insights_output: InsightsOutput | None = ... + """""" + status_details: str | None = ... + """Contains information about the status of a job.""" + patient_context: PatientInsightsPatientContext + """""" + insights_context: InsightsContext + """""" + encounter_context: PatientInsightsEncounterContext + """""" + user_context: UserContext + """""" + input_data_config: InputDataConfig + """""" + output_data_config: OutputDataConfig + """""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetSubscriptionInput(_SerdeShape): + """Dataclass for GetSubscriptionInput structure.""" + + domain_id: str | None = ... + """The unique identifier of the parent Domain.""" + subscription_id: str | None = ... + """The unique identifier of the Subscription.""" + +@dataclass(kw_only=True) +class GetSubscriptionOutput(_SerdeShape): + """Dataclass for GetSubscriptionOutput structure.""" + + subscription: SubscriptionDescription | None = ... + """""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InputDataConfig(_SerdeShape): + """Configuration details for input patient data""" + + fhir_server: FHIRServer | None = ... + """FHIR server configuration to retrieve patient data.""" + s3_sources: list[S3Source] | None = ... + """List of S3 sources containing patient data.""" + +@dataclass(kw_only=True) +class InsightsContext(_SerdeShape): + """Details for insights that user wants to generate""" + + insights_type: str + """""" + +@dataclass(kw_only=True) +class InsightsOutput(_SerdeShape): + """Output of patient insights job""" + + uri: str + """""" + +class InsightsType(UnknownEnumMixin, StrEnum): + PRE_VISIT = "PRE_VISIT" + +@dataclass(kw_only=True) +class InternalServerException(ServiceError, _SerdeShape): + """This error is thrown when a transient error causes our API to fail.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class JobStatus(UnknownEnumMixin, StrEnum): + SUBMITTED = "SUBMITTED" + IN_PROGRESS = "IN_PROGRESS" + FAILED = "FAILED" + SUCCEEDED = "SUCCEEDED" + +@dataclass(kw_only=True) +class ListDomainsInput(_SerdeShape): + """Dataclass for ListDomainsInput structure.""" + + status: str | None = ... + """Filter by Domain status.""" + max_results: int | None = ... + """Maximum number of results to return.""" + next_token: str | None = ... + """Token for pagination.""" + +@dataclass(kw_only=True) +class ListDomainsOutput(_SerdeShape): + """Dataclass for ListDomainsOutput structure.""" + + domains: list[DomainSummary] + """List of Domains.""" + next_token: str | None = ... + """Token for the next page of results.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListSubscriptionsInput(_SerdeShape): + """Dataclass for ListSubscriptionsInput structure.""" + + domain_id: str | None = ... + """The unique identifier of the parent Domain.""" + max_results: int | None = ... + """Maximum number of results to return.""" + next_token: str | None = ... + """Token for pagination.""" + +@dataclass(kw_only=True) +class ListSubscriptionsOutput(_SerdeShape): + """Dataclass for ListSubscriptionsOutput structure.""" + + subscriptions: list[SubscriptionDescription] + """List of Subscriptions.""" + next_token: str | None = ... + """Token for the next page of results.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListTagsForResourceInput(_SerdeShape): + """Dataclass for ListTagsForResourceInput structure.""" + + resource_arn: str | None = ... + """The ARN of the resource to list tags for""" + +@dataclass(kw_only=True) +class ListTagsForResourceOutput(_SerdeShape): + """Dataclass for ListTagsForResourceOutput structure.""" + + tags: dict[str, str] | None = ... + """The tags associated with the resource""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class ManagedNoteTemplate(UnknownEnumMixin, StrEnum): + HISTORY_AND_PHYSICAL = "HISTORY_AND_PHYSICAL" + GIRPP = "GIRPP" + DAP = "DAP" + SIRP = "SIRP" + BIRP = "BIRP" + BEHAVIORAL_SOAP = "BEHAVIORAL_SOAP" + PHYSICAL_SOAP = "PHYSICAL_SOAP" + +@dataclass(kw_only=True) +class ManagedTemplate(_SerdeShape): + """Configuration for using a managed note template""" + + template_type: str + """The type of managed template to use""" + +@dataclass(kw_only=True) +class ManagedTemplateResponse(_SerdeShape): + """Response containing managed template information""" + + template_type: str | None = ... + """The type of managed template used""" + +@dataclass(kw_only=True) +class MedicalScribeAudioEvent(_SerdeShape): + """An event containing audio data for the Medical Scribe stream""" + + audio_chunk: bytes + """The audio data chunk""" + +@dataclass(kw_only=True) +class MedicalScribeBinaryAudioEvent(_SerdeShape): + """ + An event containing raw binary audio data for the Medical Scribe stream. + The audio is sent as a raw binary payload rather than as a + base64-encoded value. + """ + + audio_chunk: bytes + """The raw binary audio data chunk""" + +@dataclass(kw_only=True) +class MedicalScribeChannelDefinition(_SerdeShape): + """Defines a channel in the audio stream""" + + channel_id: int + """The channel identifier""" + participant_role: str + """The role of the participant on this channel""" + +@dataclass(kw_only=True) +class MedicalScribeConfigurationEvent(_SerdeShape): + """An event containing configuration for the Medical Scribe session""" + + post_stream_action_settings: MedicalScribePostStreamActionSettings + """Settings for actions to perform after the stream ends""" + channel_definitions: list[MedicalScribeChannelDefinition] | None = ... + """Channel definitions for the audio stream""" + encounter_context: EncounterContext | None = ... + """Context information about the clinical encounter""" + +@dataclass +class MedicalScribeInputStreamAudioEvent(_SerdeShape): + """""" + + value: MedicalScribeAudioEvent + +@dataclass +class MedicalScribeInputStreamBinaryAudioEvent(_SerdeShape): + """ + An event containing raw binary audio data for the Medical Scribe stream. + The audio is sent as a raw binary payload rather than as a + base64-encoded value. + """ + + value: MedicalScribeBinaryAudioEvent + +@dataclass +class MedicalScribeInputStreamSessionControlEvent(_SerdeShape): + """""" + + value: MedicalScribeSessionControlEvent + +@dataclass +class MedicalScribeInputStreamConfigurationEvent(_SerdeShape): + """""" + + value: MedicalScribeConfigurationEvent + +@dataclass +class MedicalScribeInputStreamUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +MedicalScribeInputStream = Union[ + MedicalScribeInputStreamAudioEvent + | MedicalScribeInputStreamBinaryAudioEvent + | MedicalScribeInputStreamSessionControlEvent + | MedicalScribeInputStreamConfigurationEvent + | MedicalScribeInputStreamUnknown +] +""" +Input stream for Medical Scribe containing audio and configuration +events +""" + +class _MedicalScribeInputStreamDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> MedicalScribeInputStream: ... + +class MedicalScribeLanguageCode(UnknownEnumMixin, StrEnum): + EN_US = "en-US" + MULTI = "multi" + +@dataclass(kw_only=True) +class MedicalScribeListeningSessionDetails(_SerdeShape): + """Detailed information about a Medical Scribe listening session""" + + session_id: str | None = ... + """The Session identifier""" + domain_id: str | None = ... + """The Domain identifier""" + subscription_id: str | None = ... + """The Subscription identifier""" + language_code: str | None = ... + """The Language Code for the audio in the session""" + media_sample_rate_hertz: int | None = ... + """The sample rate of the input audio""" + media_encoding: str | None = ... + """The encoding for the input audio""" + channel_definitions: list[MedicalScribeChannelDefinition] | None = ... + """Channel definitions for the audio stream""" + post_stream_action_settings: ( + MedicalScribePostStreamActionSettingsResponse | None + ) = ... + """Settings for post-stream actions""" + post_stream_action_result: MedicalScribePostStreamActionsResult | None = ... + """Results of post-stream actions""" + encounter_context_provided: bool | None = ... + """Indicates whether encounter context was provided""" + stream_status: str | None = ... + """The current status of the stream""" + stream_creation_time: datetime | None = ... + """The timestamp when the stream was created""" + stream_end_time: datetime | None = ... + """The timestamp when the stream ended""" + +class MedicalScribeMediaEncoding(UnknownEnumMixin, StrEnum): + PCM = "pcm" + FLAC = "flac" + +@dataclass +class MedicalScribeOutputStreamTranscriptEvent(_SerdeShape): + """""" + + value: MedicalScribeTranscriptEvent + +@dataclass +class MedicalScribeOutputStreamInternalFailureException(_SerdeShape): + """""" + + value: InternalServerException + +@dataclass +class MedicalScribeOutputStreamValidationException(_SerdeShape): + """""" + + value: ValidationException + +@dataclass +class MedicalScribeOutputStreamUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +MedicalScribeOutputStream = Union[ + MedicalScribeOutputStreamTranscriptEvent + | MedicalScribeOutputStreamInternalFailureException + | MedicalScribeOutputStreamValidationException + | MedicalScribeOutputStreamUnknown +] +""" +Output stream from Medical Scribe containing transcript events and +errors +""" + +class _MedicalScribeOutputStreamDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> MedicalScribeOutputStream: ... + +class MedicalScribeParticipantRole(UnknownEnumMixin, StrEnum): + PATIENT = "PATIENT" + CLINICIAN = "CLINICIAN" + +@dataclass(kw_only=True) +class MedicalScribePostStreamActionSettings(_SerdeShape): + """Settings for actions to perform after the audio stream ends""" + + output_s3_uri: str + """""" + clinical_note_generation_settings: ClinicalNoteGenerationSettings + """Settings for clinical note generation""" + +@dataclass(kw_only=True) +class MedicalScribePostStreamActionSettingsResponse(_SerdeShape): + """Response containing settings for post-stream actions""" + + output_s3_uri: str + """""" + clinical_note_generation_settings: ClinicalNoteGenerationSettingsResponse + """Settings for clinical note generation""" + +@dataclass(kw_only=True) +class MedicalScribePostStreamActionsResult(_SerdeShape): + """Results of post-stream actions performed after the audio stream ended""" + + clinical_note_generation_result: ClinicalNoteGenerationResult | None = ... + """Results of clinical note generation""" + +@dataclass(kw_only=True) +class MedicalScribeSessionControlEvent(_SerdeShape): + """An event for controlling the Medical Scribe session""" + + type: str | None = ... + """The type of session control event""" + +class MedicalScribeSessionControlEventType(UnknownEnumMixin, StrEnum): + END_OF_SESSION = "END_OF_SESSION" + +class MedicalScribeStreamStatus(UnknownEnumMixin, StrEnum): + IN_PROGRESS = "IN_PROGRESS" + PAUSED = "PAUSED" + FAILED = "FAILED" + COMPLETED = "COMPLETED" + +@dataclass(kw_only=True) +class MedicalScribeTranscriptEvent(_SerdeShape): + """An event containing transcript data from the Medical Scribe stream""" + + transcript_segment: MedicalScribeTranscriptSegment | None = ... + """A segment of the transcript""" + +@dataclass(kw_only=True) +class MedicalScribeTranscriptSegment(_SerdeShape): + """A segment of transcript text with timing and channel information""" + + segment_id: str | None = ... + """The unique identifier for this segment""" + audio_begin_offset: float | None = ... + """The offset from audio start when the audio for this segment begins""" + audio_end_offset: float | None = ... + """The offset from audio start when the audio for this segment ends""" + is_partial: bool | None = ... + """Indicates whether this is a partial or final transcript""" + channel_id: str | None = ... + """The channel identifier for this segment""" + content: str | None = ... + """The transcript text content""" + +@dataclass +class NoteTemplateSettingsManagedTemplate(_SerdeShape): + """""" + + value: ManagedTemplate + +@dataclass +class NoteTemplateSettingsCustomTemplate(_SerdeShape): + """""" + + value: CustomTemplate + +@dataclass +class NoteTemplateSettingsUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +NoteTemplateSettings = Union[ + NoteTemplateSettingsManagedTemplate + | NoteTemplateSettingsCustomTemplate + | NoteTemplateSettingsUnknown +] +"""Settings for the note template to use for clinical note generation""" + +class _NoteTemplateSettingsDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> NoteTemplateSettings: ... + +@dataclass +class NoteTemplateSettingsResponseManagedTemplate(_SerdeShape): + """""" + + value: ManagedTemplateResponse + +@dataclass +class NoteTemplateSettingsResponseCustomTemplate(_SerdeShape): + """""" + + value: CustomTemplateResponse + +@dataclass +class NoteTemplateSettingsResponseUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +NoteTemplateSettingsResponse = Union[ + NoteTemplateSettingsResponseManagedTemplate + | NoteTemplateSettingsResponseCustomTemplate + | NoteTemplateSettingsResponseUnknown +] +"""Response containing note template settings""" + +class _NoteTemplateSettingsResponseDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> NoteTemplateSettingsResponse: ... + +@dataclass(kw_only=True) +class OutputDataConfig(_SerdeShape): + """Configuration details for insights output.""" + + s3_output_path: str + """S3 URI where the insights output will be stored.""" + +@dataclass(kw_only=True) +class PatientInsightsEncounterContext(_SerdeShape): + """Details for an encounter""" + + encounter_reason: str + """Chief complaint for the visit""" + +@dataclass(kw_only=True) +class PatientInsightsPatientContext(_SerdeShape): + """Details for a patient""" + + patient_id: str + """Unique identifier of the patient""" + date_of_birth: str | None = ... + """Date of birth of the patient.""" + pronouns: str | None = ... + """Pronouns preferred by the patient.""" + +class PostStreamArtifactGenerationStatus(UnknownEnumMixin, StrEnum): + IN_PROGRESS = "IN_PROGRESS" + FAILED = "FAILED" + COMPLETED = "COMPLETED" + +class Pronouns(UnknownEnumMixin, StrEnum): + HE_HIM = "HE_HIM" + SHE_HER = "SHE_HER" + THEY_THEM = "THEY_THEM" + +class ProviderRole(UnknownEnumMixin, StrEnum): + CLINICIAN = "CLINICIAN" + +@dataclass(kw_only=True) +class ResourceNotFoundException(ServiceError, _SerdeShape): + """This error is thrown when the requested resource is not found.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class S3Source(_SerdeShape): + """S3 uri for input data source""" + + uri: str + """The S3 URI.""" + +@dataclass(kw_only=True) +class ServiceQuotaExceededException(ServiceError, _SerdeShape): + """The request exceeds a service quota.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class Specialty(UnknownEnumMixin, StrEnum): + PRIMARY_CARE = "PRIMARY_CARE" + +@dataclass(kw_only=True) +class StartMedicalScribeListeningSessionInput(_SerdeShape): + """Dataclass for StartMedicalScribeListeningSessionInput structure.""" + + session_id: str | None = ... + """The Session identifier""" + domain_id: str | None = ... + """The Domain identifier""" + subscription_id: str | None = ... + """The Subscription identifier""" + language_code: str | None = ... + """The Language Code for the audio in the session""" + media_sample_rate_hertz: int | None = ... + """The sample rate of the input audio""" + media_encoding: str | None = ... + """The encoding for the input audio""" + +@dataclass(kw_only=True) +class StartMedicalScribeListeningSessionOutput(_SerdeShape): + """Dataclass for StartMedicalScribeListeningSessionOutput structure.""" + + session_id: str | None = ... + """The Session identifier""" + domain_id: str | None = ... + """The Domain identifier""" + subscription_id: str | None = ... + """The Subscription identifier""" + request_id: str | None = ... + """The Request identifier""" + language_code: str | None = ... + """The Language Code for the audio in the session""" + media_sample_rate_hertz: int | None = ... + """The sample rate of the input audio""" + media_encoding: str | None = ... + """The encoding for the input audio""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class StartPatientInsightsJobInput(_SerdeShape): + """Dataclass for StartPatientInsightsJobInput structure.""" + + domain_id: str | None = ... + """""" + patient_context: PatientInsightsPatientContext | None = ... + """""" + insights_context: InsightsContext | None = ... + """""" + encounter_context: PatientInsightsEncounterContext | None = ... + """""" + user_context: UserContext | None = ... + """""" + input_data_config: InputDataConfig | None = ... + """""" + output_data_config: OutputDataConfig | None = ... + """""" + client_token: str | None = ... + """ + Unique, case-sensitive identifier that you provide to ensure the + idempotency of the request. + """ + +@dataclass(kw_only=True) +class StartPatientInsightsJobOutput(_SerdeShape): + """Dataclass for StartPatientInsightsJobOutput structure.""" + + job_arn: str + """""" + job_id: str + """""" + creation_time: datetime | None = ... + """Date and time the patient insights job was submitted.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class SubscriptionDescription(_SerdeShape): + """Complete subscription resource data.""" + + domain_id: str + """""" + subscription_id: str + """""" + arn: str + """""" + status: str + """""" + created_at: datetime + """""" + last_updated_at: datetime + """""" + activated_at: datetime | None = ... + """""" + deactivated_at: datetime | None = ... + """""" + +class SubscriptionStatus(UnknownEnumMixin, StrEnum): + ACTIVE = "ACTIVE" + INACTIVE = "INACTIVE" + DELETED = "DELETED" + +@dataclass(kw_only=True) +class TagResourceInput(_SerdeShape): + """Dataclass for TagResourceInput structure.""" + + resource_arn: str | None = ... + """The ARN of the resource to tag""" + tags: dict[str, str] | None = ... + """The tags to add to the resource""" + +@dataclass(kw_only=True) +class TagResourceOutput(_SerdeShape): + """Dataclass for TagResourceOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class TemplateSectionInstruction(_SerdeShape): + """Instructions for generating a specific section of a clinical note""" + + section_header: str + """The header for this section of the template""" + section_instruction: str + """The instruction for generating this section""" + +@dataclass(kw_only=True) +class ThrottlingException(ServiceError, _SerdeShape): + """This error is thrown when the client exceeds the allowed request rate.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UntagResourceInput(_SerdeShape): + """Dataclass for UntagResourceInput structure.""" + + resource_arn: str | None = ... + """The ARN of the resource to untag""" + tag_keys: list[str] | None = ... + """The tag keys to remove from the resource""" + +@dataclass(kw_only=True) +class UntagResourceOutput(_SerdeShape): + """Dataclass for UntagResourceOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UserContext(_SerdeShape): + """Details for user initiating insights job""" + + role: str + """""" + user_id: str + """Unique identifier of the user""" + specialty: str | None = ... + """""" + +@dataclass(kw_only=True) +class ValidationException(ServiceError, _SerdeShape): + """This error is thrown when the client supplies invalid input to the API.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class WebAppConfiguration(_SerdeShape): + """ + Configuration for the Domain web application, including Identity Center + settings. If provided, all fields are required. + """ + + ehr_role: str + """ARN of the IAM role used for EHR operations.""" + idc_application_id: str + """The Identity Center application ID associated with this Domain.""" + idc_region: str + """The AWS region where Identity Center is configured.""" + +ACTIVATE_SUBSCRIPTION: APIOperation[ + ActivateSubscriptionInput, ActivateSubscriptionOutput +] +CREATE_DOMAIN: APIOperation[CreateDomainInput, CreateDomainOutput] +CREATE_SUBSCRIPTION: APIOperation[CreateSubscriptionInput, CreateSubscriptionOutput] +DEACTIVATE_SUBSCRIPTION: APIOperation[ + DeactivateSubscriptionInput, DeactivateSubscriptionOutput +] +DELETE_DOMAIN: APIOperation[DeleteDomainInput, DeleteDomainOutput] +GET_DOMAIN: APIOperation[GetDomainInput, GetDomainOutput] +GET_MEDICAL_SCRIBE_LISTENING_SESSION: APIOperation[ + GetMedicalScribeListeningSessionInput, GetMedicalScribeListeningSessionOutput +] +GET_PATIENT_INSIGHTS_JOB: APIOperation[ + GetPatientInsightsJobInput, GetPatientInsightsJobOutput +] +GET_SUBSCRIPTION: APIOperation[GetSubscriptionInput, GetSubscriptionOutput] +LIST_DOMAINS: APIOperation[ListDomainsInput, ListDomainsOutput] +LIST_SUBSCRIPTIONS: APIOperation[ListSubscriptionsInput, ListSubscriptionsOutput] +LIST_TAGS_FOR_RESOURCE: APIOperation[ + ListTagsForResourceInput, ListTagsForResourceOutput +] +START_MEDICAL_SCRIBE_LISTENING_SESSION: APIOperation[ + StartMedicalScribeListeningSessionInput, StartMedicalScribeListeningSessionOutput +] +START_PATIENT_INSIGHTS_JOB: APIOperation[ + StartPatientInsightsJobInput, StartPatientInsightsJobOutput +] +TAG_RESOURCE: APIOperation[TagResourceInput, TagResourceOutput] +UNTAG_RESOURCE: APIOperation[UntagResourceInput, UntagResourceOutput] diff --git a/clients/aws-sdk-connecthealth/tests/integration/__init__.py b/clients/aws-sdk-connecthealth/tests/integration/__init__.py index 8b4c358a..7a405ca5 100644 --- a/clients/aws-sdk-connecthealth/tests/integration/__init__.py +++ b/clients/aws-sdk-connecthealth/tests/integration/__init__.py @@ -3,9 +3,9 @@ from pathlib import Path -from smithy_aws_core.config import AwsConfigOverrides -from smithy_aws_core.identity import EnvironmentCredentialsResolver -from smithy_http.aio.interfaces import HTTPClient +from smithy_aws_core.aio.config import AwsConfigOverrides +from smithy_aws_core.aio.identity import AsyncEnvironmentCredentialsResolver +from smithy_http.aio.interfaces import AsyncHTTPClient from aws_sdk_connecthealth.client import AsyncConnectHealthClient from aws_sdk_connecthealth.config import AsyncConnectHealthConfig, Plugin @@ -15,12 +15,12 @@ async def create_connecthealth_client( - region: str, *, transport: HTTPClient | None = None + region: str, *, transport: AsyncHTTPClient | None = None ) -> AsyncConnectHealthClient: overrides: AwsConfigOverrides = { "endpoint_uri": f"https://health-agent.{region}.api.aws", "region": region, - "aws_credentials_identity_resolver": EnvironmentCredentialsResolver(), + "aws_credentials_identity_resolver": AsyncEnvironmentCredentialsResolver(), } if transport is not None: overrides["transport"] = transport diff --git a/clients/aws-sdk-connecthealth/tests/integration/conftest.py b/clients/aws-sdk-connecthealth/tests/integration/conftest.py index 2165234d..f91f29ae 100644 --- a/clients/aws-sdk-connecthealth/tests/integration/conftest.py +++ b/clients/aws-sdk-connecthealth/tests/integration/conftest.py @@ -118,7 +118,7 @@ def _create_s3_bucket(s3_client: Any, bucket_name: str) -> None: s3_client.create_bucket( Bucket=bucket_name, CreateBucketConfiguration={ - "Tags": [{"Key": k, "Value": v} for k, v in _TAGS.items()], + "Tags": [{"Key": k, "Value": v} for k, v in _TAGS.items()] }, ) @@ -152,7 +152,7 @@ async def connecthealth_resources(): domain_name = f"integ-test-connecthealth-domain-{unique_suffix}" bucket_name = f"integ-test-connecthealth-bucket-{unique_suffix}" - s3_client = boto3.client("s3", region_name=REGION) + s3_client = boto3.client("s3", region_name=REGION) # pyright: ignore[reportUnknownMemberType] async with await create_connecthealth_client(REGION) as client: domain_id: str | None = None subscription_id: str | None = None diff --git a/clients/aws-sdk-connecthealth/tests/integration/test_bidirectional_streaming.py b/clients/aws-sdk-connecthealth/tests/integration/test_bidirectional_streaming.py index 8f8ae81f..7fad098e 100644 --- a/clients/aws-sdk-connecthealth/tests/integration/test_bidirectional_streaming.py +++ b/clients/aws-sdk-connecthealth/tests/integration/test_bidirectional_streaming.py @@ -7,7 +7,7 @@ import time import uuid -from smithy_core.aio.eventstream import DuplexEventStream +from smithy_core.aio.eventstream import AsyncDuplexEventStream from smithy_http.aio.crt import AWSCRTHTTPClient from aws_sdk_connecthealth.models import ( @@ -48,7 +48,7 @@ async def _send_events( - stream: DuplexEventStream[ + stream: AsyncDuplexEventStream[ MedicalScribeInputStream, MedicalScribeOutputStream, StartMedicalScribeListeningSessionOutput, @@ -105,7 +105,7 @@ async def _send_events( async def _receive_events( - stream: DuplexEventStream[ + stream: AsyncDuplexEventStream[ MedicalScribeInputStream, MedicalScribeOutputStream, StartMedicalScribeListeningSessionOutput, @@ -155,7 +155,9 @@ async def _receive_events( return got_transcript -async def test_start_medical_scribe_listening_session(connecthealth_resources) -> None: +async def test_start_medical_scribe_listening_session( + connecthealth_resources: tuple[str, str, str], +) -> None: """Test bidirectional streaming with audio input and transcript output.""" domain_id, subscription_id, output_s3_uri = connecthealth_resources diff --git a/clients/aws-sdk-connecthealth/tests/integration/test_non_streaming.py b/clients/aws-sdk-connecthealth/tests/integration/test_non_streaming.py index c4907778..727a3b54 100644 --- a/clients/aws-sdk-connecthealth/tests/integration/test_non_streaming.py +++ b/clients/aws-sdk-connecthealth/tests/integration/test_non_streaming.py @@ -20,7 +20,7 @@ from . import REGION, create_connecthealth_client -async def test_list_domains(connecthealth_resources) -> None: +async def test_list_domains(connecthealth_resources: tuple[str, str, str]) -> None: """Test non-streaming ListDomains operation.""" _ = connecthealth_resources async with await create_connecthealth_client(REGION) as client: @@ -31,7 +31,7 @@ async def test_list_domains(connecthealth_resources) -> None: assert len(response.domains) >= 1 -async def test_get_domain(connecthealth_resources) -> None: +async def test_get_domain(connecthealth_resources: tuple[str, str, str]) -> None: """Test non-streaming GetDomain operation.""" domain_id, _, _ = connecthealth_resources async with await create_connecthealth_client(REGION) as client: @@ -51,7 +51,9 @@ async def test_get_domain(connecthealth_resources) -> None: assert response.tags == {"Purpose": "IntegTest"} -async def test_list_subscriptions(connecthealth_resources) -> None: +async def test_list_subscriptions( + connecthealth_resources: tuple[str, str, str], +) -> None: """Test non-streaming ListSubscriptions operation.""" domain_id, subscription_id, _ = connecthealth_resources async with await create_connecthealth_client(REGION) as client: @@ -68,7 +70,7 @@ async def test_list_subscriptions(connecthealth_resources) -> None: assert sub.domain_id == domain_id -async def test_get_subscription(connecthealth_resources) -> None: +async def test_get_subscription(connecthealth_resources: tuple[str, str, str]) -> None: """Test non-streaming GetSubscription operation.""" domain_id, subscription_id, _ = connecthealth_resources async with await create_connecthealth_client(REGION) as client: diff --git a/clients/aws-sdk-dynamodb/scripts/docs/generate_doc_stubs.py b/clients/aws-sdk-dynamodb/scripts/docs/generate_doc_stubs.py index 52d470bc..795f2e4b 100644 --- a/clients/aws-sdk-dynamodb/scripts/docs/generate_doc_stubs.py +++ b/clients/aws-sdk-dynamodb/scripts/docs/generate_doc_stubs.py @@ -126,7 +126,9 @@ class ClientInfo: class DocStubGenerator: """Generate markdown API Reference stubs for AWS SDK for Python v4 clients.""" - def __init__(self, client_dir: Path, output_dir: Path, service_name: str | None = None) -> None: + def __init__( + self, client_dir: Path, output_dir: Path, service_name: str | None = None + ) -> None: """ Initialize the documentation generator. @@ -190,7 +192,9 @@ def _analyze_client_package(self, package_name: str) -> ClientInfo: required = ("client", "config", "models") missing = [name for name in required if not package.modules.get(name)] if missing: - raise ValueError(f"Missing required modules in {package_name}: {', '.join(missing)}") + raise ValueError( + f"Missing required modules in {package_name}: {', '.join(missing)}" + ) # Parse submodules client_module = package.modules["client"] @@ -199,11 +203,15 @@ def _analyze_client_package(self, package_name: str) -> ClientInfo: client_class = self._find_class_with_suffix(client_module, "Client") if not client_class: - raise ValueError(f"No class ending with 'Client' found in {package_name}.client") + raise ValueError( + f"No class ending with 'Client' found in {package_name}.client" + ) config_class = self._find_class_with_suffix(config_module, "Config") if not config_class: - raise ValueError(f"No class ending with 'Config' found in {package_name}.config") + raise ValueError( + f"No class ending with 'Config' found in {package_name}.config" + ) plugin_alias = config_module.members.get("Plugin") if not plugin_alias: @@ -288,7 +296,9 @@ def _analyze_operation(self, operation: Function) -> OperationInfo: if output_type in stream_type_map: stream_type = stream_type_map[output_type] - stream_args = self._get_subscript_elements(returns, f"'{operation.name}' stream type") + stream_args = self._get_subscript_elements( + returns, f"'{operation.name}' stream type" + ) if stream_type in (StreamType.INPUT, StreamType.DUPLEX): event_input_type = stream_args[0].canonical_name @@ -316,7 +326,9 @@ def _analyze_operation(self, operation: Function) -> OperationInfo: def _get_expr(self, annotation: str | Expr | None, context: str) -> Expr: """Extract and validate an Expr from an annotation.""" if not isinstance(annotation, Expr): - raise TypeError(f"{context}: expected Expr, got {type(annotation).__name__}") + raise TypeError( + f"{context}: expected Expr, got {type(annotation).__name__}" + ) return annotation def _get_subscript_elements(self, expr: Expr, context: str) -> list[Expr]: @@ -330,7 +342,9 @@ def _get_subscript_elements(self, expr: Expr, context: str) -> list[Expr]: return [el for el in slice_expr.elements if isinstance(el, Expr)] return [slice_expr] - def _extract_models(self, models_module: Module, operations: list[OperationInfo]) -> ModelsInfo: + def _extract_models( + self, models_module: Module, operations: list[OperationInfo] + ) -> ModelsInfo: """Extract structures, unions, enums, and errors from models module.""" structures, unions, enums, errors = [], [], [], [] @@ -356,14 +370,16 @@ def _extract_models(self, models_module: Module, operations: list[OperationInfo] duplicates = [] for structure in structures: - if self._is_operation_io_type(structure.name, operations) or self._is_union_member( - structure.name, unions - ): + if self._is_operation_io_type( + structure.name, operations + ) or self._is_union_member(structure.name, unions): duplicates.append(structure) structures = [struct for struct in structures if struct not in duplicates] - return ModelsInfo(structures=structures, unions=unions, enums=enums, errors=errors) + return ModelsInfo( + structures=structures, unions=unions, enums=enums, errors=errors + ) def _is_union(self, member: Object | Alias) -> TypeGuard[Attribute]: """Check if a module member is a union type.""" @@ -399,7 +415,9 @@ def _extract_union_members( for name in member_names: if not (member_object := models_module.members.get(name)): raise ValueError(f"Union member '{name}' not found in models module") - members.append(TypeInfo(name=member_object.name, module_path=member_object.path)) + members.append( + TypeInfo(name=member_object.name, module_path=member_object.path) + ) return members @@ -408,7 +426,8 @@ def _is_enum(self, member: Object | Alias) -> TypeGuard[Class]: if not isinstance(member, Class): return False return any( - isinstance(base, ExprName) and base.name in ENUM_BASE_CLASSES for base in member.bases + isinstance(base, ExprName) and base.name in ENUM_BASE_CLASSES + for base in member.bases ) def _is_error(self, member: Object | Alias) -> TypeGuard[Class]: @@ -416,10 +435,13 @@ def _is_error(self, member: Object | Alias) -> TypeGuard[Class]: if not isinstance(member, Class): return False return any( - isinstance(base, ExprName) and base.name in ERROR_BASE_CLASSES for base in member.bases + isinstance(base, ExprName) and base.name in ERROR_BASE_CLASSES + for base in member.bases ) - def _is_operation_io_type(self, type_name: str, operations: list[OperationInfo]) -> bool: + def _is_operation_io_type( + self, type_name: str, operations: list[OperationInfo] + ) -> bool: """Check if a type is used as operation input/output.""" return any(type_name in (op.input.name, op.output.name) for op in operations) @@ -437,8 +459,12 @@ def _generate_client_docs(self, client_info: ClientInfo) -> bool: self._generate_type_stubs( client_info.models.structures, "structures", "Structure Class" ) - self._generate_type_stubs(client_info.models.errors, "errors", "Error Class") - self._generate_type_stubs(client_info.models.enums, "enums", "Enum Class", members=True) + self._generate_type_stubs( + client_info.models.errors, "errors", "Error Class" + ) + self._generate_type_stubs( + client_info.models.enums, "enums", "Enum Class", members=True + ) self._generate_union_stubs(client_info.models.unions) except OSError as e: logger.error(f"Failed to write documentation files: {e}") @@ -470,7 +496,9 @@ def _generate_index(self, client_info: ClientInfo) -> None: ] for method in sorted(client_info.client_methods, key=lambda x: x.name): - lines.extend([*self._mkdocs_directive(method.module_path, heading_level=4), ""]) + lines.extend( + [*self._mkdocs_directive(method.module_path, heading_level=4), ""] + ) # Operations section if client_info.operations: @@ -578,7 +606,9 @@ def _generate_operation_stubs(self, operations: list[OperationInfo]) -> None: output_path = self.output_dir / "operations" / f"{op.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb("Operations", op.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb("Operations", op.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(operations)} operation file(s)") @@ -600,7 +630,9 @@ def _generate_type_stubs( output_path = self.output_dir / category / f"{item.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb(category.title(), item.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb(category.title(), item.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(items)} {category} file(s)") @@ -624,7 +656,9 @@ def _generate_union_stubs(self, unions: list[UnionInfo]) -> None: output_path = self.output_dir / "unions" / f"{union.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb("Unions", union.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb("Unions", union.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(unions)} union file(s)") diff --git a/clients/aws-sdk-dynamodb/src/aws_sdk_dynamodb/_private/schemas.py b/clients/aws-sdk-dynamodb/src/aws_sdk_dynamodb/_private/schemas.py index f6a9fab9..bf982c06 100644 --- a/clients/aws-sdk-dynamodb/src/aws_sdk_dynamodb/_private/schemas.py +++ b/clients/aws-sdk-dynamodb/src/aws_sdk_dynamodb/_private/schemas.py @@ -2,5891 +2,7239 @@ from types import MappingProxyType -from smithy_core.prelude import UNIT -from smithy_core.schemas import Schema -from smithy_core.shapes import ShapeID, ShapeType -from smithy_core.traits import Trait +from smithy_core._schema_compact import StaticOperationSchema, StaticSchema + + +n0 = "com.amazonaws.dynamodb" +_ACDTP = "ApproximateCreationDateTimePrecision" +_MILLISECOND = "MILLISECOND" +_sV = "smithy.api#enumValue" +_MICROSECOND = "MICROSECOND" +_AR = "ArchivalReason" +_BA = "BackupArn" +_D = "Date" +_AS = "ArchivalSummary" +_ADT = "ArchivalDateTime" +_ABA = "ArchivalBackupArn" +_AA = "AttributeAction" +_ADD = "ADD" +_PUT = "PUT" +_DELETE = "DELETE" +_KSAN = "KeySchemaAttributeName" +_SAT = "ScalarAttributeType" +_S = "S" +_N = "N" +_B = "B" +_AD = "AttributeDefinition" +_AN = "AttributeName" +_s = "smithy.api#required" +_AT = "AttributeType" +_ADt = "AttributeDefinitions" +_m = "member" +_BAV = "BinaryAttributeValue" +_BAVo = "BooleanAttributeValue" +_BSAV = "BinarySetAttributeValue" +_NAV = "NumberAttributeValue" +_NSAV = "NumberSetAttributeValue" +_NAVu = "NullAttributeValue" +_SAV = "StringAttributeValue" +_SSAV = "StringSetAttributeValue" +_ANL = "AttributeNameList" +_ASPN = "AutoScalingPolicyName" +_BO = "BooleanObject" +_IO = "IntegerObject" +_DO = "DoubleObject" +_ASTTSPCD = "AutoScalingTargetTrackingScalingPolicyConfigurationDescription" +_DSI = "DisableScaleIn" +_SIC = "ScaleInCooldown" +_SOC = "ScaleOutCooldown" +_TV = "TargetValue" +_ASPD = "AutoScalingPolicyDescription" +_PN = "PolicyName" +_TTSPC = "TargetTrackingScalingPolicyConfiguration" +_ASPDL = "AutoScalingPolicyDescriptionList" +_ASTTSPCU = "AutoScalingTargetTrackingScalingPolicyConfigurationUpdate" +_ASPU = "AutoScalingPolicyUpdate" +_ASRA = "AutoScalingRoleArn" +_St = "String" +_PLO = "PositiveLongObject" +_ASSD = "AutoScalingSettingsDescription" +_MU = "MinimumUnits" +_MUa = "MaximumUnits" +_ASD = "AutoScalingDisabled" +_SP = "ScalingPolicies" +_ASSU = "AutoScalingSettingsUpdate" +_SPU = "ScalingPolicyUpdate" +_AEM = "AvailabilityErrorMessage" +_Ba = "Backfilling" +_BCDT = "BackupCreationDateTime" +_BN = "BackupName" +_BSB = "BackupSizeBytes" +_BS = "BackupStatus" +_CREATING = "CREATING" +_DELETED = "DELETED" +_AVAILABLE = "AVAILABLE" +_BT = "BackupType" +_USER = "USER" +_SYSTEM = "SYSTEM" +_AB = "AWS_BACKUP" +_BD = "BackupDetails" +_BEDT = "BackupExpiryDateTime" +_BM = "BillingMode" +_PROVISIONED = "PROVISIONED" +_PPR = "PAY_PER_REQUEST" +_IC = "ItemCount" +_KT = "KeyType" +_HASH = "HASH" +_RANGE = "RANGE" +_KSE = "KeySchemaElement" +_KS = "KeySchema" +_LO = "LongObject" +_ODT = "OnDemandThroughput" +_MRRU = "MaxReadRequestUnits" +_MWRU = "MaxWriteRequestUnits" +_PT = "ProvisionedThroughput" +_RCU = "ReadCapacityUnits" +_WCU = "WriteCapacityUnits" +_TA = "TableArn" +_TCDT = "TableCreationDateTime" +_TI = "TableId" +_TN = "TableName" +_STD = "SourceTableDetails" +_TSB = "TableSizeBytes" +_IN = "IndexName" +_NKAN = "NonKeyAttributeName" +_NKANL = "NonKeyAttributeNameList" +_PTr = "ProjectionType" +_ALL = "ALL" +_KO = "KEYS_ONLY" +_INCLUDE = "INCLUDE" +_P = "Projection" +_NKA = "NonKeyAttributes" +_GSII = "GlobalSecondaryIndexInfo" +_GSI = "GlobalSecondaryIndexes" +_LSII = "LocalSecondaryIndexInfo" +_LSI = "LocalSecondaryIndexes" +_KMSMKA = "KMSMasterKeyArn" +_SSET = "SSEType" +_AES = "AES256" +_KMS = "KMS" +_SSES = "SSEStatus" +_ENABLING = "ENABLING" +_ENABLED = "ENABLED" +_DISABLING = "DISABLING" +_DISABLED = "DISABLED" +_UPDATING = "UPDATING" +_SSED = "SSEDescription" +_Sta = "Status" +_IEDT = "InaccessibleEncryptionDateTime" +_SE = "StreamEnabled" +_SVT = "StreamViewType" +_NI = "NEW_IMAGE" +_OI = "OLD_IMAGE" +_NAOI = "NEW_AND_OLD_IMAGES" +_SS = "StreamSpecification" +_TTLAN = "TimeToLiveAttributeName" +_TTLS = "TimeToLiveStatus" +_TTLD = "TimeToLiveDescription" +_VDF = "VectorDistanceFunction" +_COSINE = "COSINE" +_DP = "DOT_PRODUCT" +_EUCLIDEAN = "EUCLIDEAN" +_SSETe = "SearchSchemaElementType" +_IF = "INLINE_FILTER" +_SSE = "SearchSchemaElement" +_SSe = "SearchSchema" +_VAN = "VectorAttributeName" +_VAD = "VectorAttributeDefinition" +_VII = "VectorIndexInfo" +_VA = "VectorAttribute" +_Di = "Dimensions" +_DF = "DistanceFunction" +_VI = "VectorIndexes" +_STFD = "SourceTableFeatureDetails" +_SD = "StreamDescription" +_BDa = "BackupDescription" +_EM = "ErrorMessage" +_BIUE = "BackupInUseException" +_sm = "smithy.api#error" +_c = "client" +_me = "message" +_BNFE = "BackupNotFoundException" +_BIL = "BackupsInputLimit" +_BSa = "BackupSummary" +_BSac = "BackupSummaries" +_BTF = "BackupTypeFilter" +_RCC = "ReturnConsumedCapacity" +_INDEXES = "INDEXES" +_TOTAL = "TOTAL" +_NONE = "NONE" +_CR = "ConsistentRead" +_RVOCCF = "ReturnValuesOnConditionCheckFailure" +_AO = "ALL_OLD" +_PQLS = "PartiQLStatement" +_CCU = "ConsumedCapacityUnits" +_C = "Capacity" +_CU = "CapacityUnits" +_SICM = "SecondaryIndexesCapacityMap" +_k = "key" +_v = "value" +_VC = "VectorCapacity" +_VSRB = "VectorSearchRequestBytes" +_VWRB = "VectorWriteRequestBytes" +_VICM = "VectorIndexesCapacityMap" +_CC = "ConsumedCapacity" +_T = "Table" +_CCM = "ConsumedCapacityMultiple" +_BSECE = "BatchStatementErrorCodeEnum" +_CCF = "ConditionalCheckFailed" +_ICSLE = "ItemCollectionSizeLimitExceeded" +_RLE = "RequestLimitExceeded" +_VE = "ValidationError" +_PTE = "ProvisionedThroughputExceeded" +_TC = "TransactionConflict" +_TE = "ThrottlingError" +_ISE = "InternalServerError" +_RNF = "ResourceNotFound" +_ADc = "AccessDenied" +_DI = "DuplicateItem" +_se = "server" +_R = "Reason" +_Re = "Resource" +_TR = "ThrottlingReason" +_r = "reason" +_re = "resource" +_TRL = "ThrottlingReasonList" +_TRh = "ThrottlingReasons" +_TEh = "ThrottlingException" +_sE = "smithy.api#httpError" +_tR = "throttlingReasons" +_EANV = "ExpressionAttributeNameVariable" +_EANM = "ExpressionAttributeNameMap" +_PE = "ProjectionExpression" +_IEE = "InvalidEndpointException" +_M = "Message" +_PTEE = "ProvisionedThroughputExceededException" +_RNFE = "ResourceNotFoundException" +_RICM = "ReturnItemCollectionMetrics" +_SIZE = "SIZE" +_ICSEB = "ItemCollectionSizeEstimateBound" +_ICSER = "ItemCollectionSizeEstimateRange" +_ICSLEE = "ItemCollectionSizeLimitExceededException" +_RWCE = "ReplicatedWriteConflictException" +_BSBi = "BilledSizeBytes" +_BMS = "BillingModeSummary" +_LUTPPRDT = "LastUpdateToPayPerRequestDateTime" +_Co = "Code" +_CRT = "ClientRequestToken" +_CT = "ClientToken" +_CWLGA = "CloudWatchLogGroupArn" +_CO = "ComparisonOperator" +_EQ = "EQ" +_NE = "NE" +_IN_ = "IN" +_LE = "LE" +_LT = "LT" +_GE = "GE" +_GT = "GT" +_BETWEEN = "BETWEEN" +_NN = "NOT_NULL" +_NULL = "NULL" +_CONTAINS = "CONTAINS" +_NC = "NOT_CONTAINS" +_BW = "BEGINS_WITH" +_COo = "ConditionalOperator" +_AND = "AND" +_OR = "OR" +_CE = "ConditionExpression" +_EAVV = "ExpressionAttributeValueVariable" +_CRSRA = "ConfirmRemoveSelfResourceAccess" +_smi = "smithy.api#default" +_CBS = "ContinuousBackupsStatus" +_PITRS = "PointInTimeRecoveryStatus" +_RPID = "RecoveryPeriodInDays" +_PITRD = "PointInTimeRecoveryDescription" +_ERDT = "EarliestRestorableDateTime" +_LRDT = "LatestRestorableDateTime" +_CBD = "ContinuousBackupsDescription" +_CBUE = "ContinuousBackupsUnavailableException" +_CIA = "ContributorInsightsAction" +_ENABLE = "ENABLE" +_DISABLE = "DISABLE" +_CIM = "ContributorInsightsMode" +_AATK = "ACCESSED_AND_THROTTLED_KEYS" +_TK = "THROTTLED_KEYS" +_CIR = "ContributorInsightsRule" +_CIRL = "ContributorInsightsRuleList" +_CIS = "ContributorInsightsStatus" +_FAILED = "FAILED" +_CISo = "ContributorInsightsSummary" +_CISon = "ContributorInsightsSummaries" +_CBI = "CreateBackupInput" +_smit = "smithy.api#input" +_CBO = "CreateBackupOutput" +_smith = "smithy.api#output" +_LEE = "LimitExceededException" +_TIUE = "TableInUseException" +_TNFE = "TableNotFoundException" +_CB = "CreateBackup" +_WT = "WarmThroughput" +_RUPS = "ReadUnitsPerSecond" +_WUPS = "WriteUnitsPerSecond" +_CGSIA = "CreateGlobalSecondaryIndexAction" +_RN = "RegionName" +_Rep = "Replica" +_RL = "ReplicaList" +_CGTI = "CreateGlobalTableInput" +_GTN = "GlobalTableName" +_RG = "ReplicationGroup" +_GTAS = "GlobalTableArnString" +_GTS = "GlobalTableStatus" +_ACTIVE = "ACTIVE" +_DELETING = "DELETING" +_ODTO = "OnDemandThroughputOverride" +_PTO = "ProvisionedThroughputOverride" +_IS = "IndexStatus" +_GSIWTD = "GlobalSecondaryIndexWarmThroughputDescription" +_RGSID = "ReplicaGlobalSecondaryIndexDescription" +_RGSIDL = "ReplicaGlobalSecondaryIndexDescriptionList" +_GTSRM = "GlobalTableSettingsReplicationMode" +_EWO = "ENABLED_WITH_OVERRIDES" +_KMSMKI = "KMSMasterKeyId" +_RS = "ReplicaStatus" +_CF = "CREATION_FAILED" +_RD = "REGION_DISABLED" +_IEC = "INACCESSIBLE_ENCRYPTION_CREDENTIALS" +_ARCHIVING = "ARCHIVING" +_ARCHIVED = "ARCHIVED" +_RNA = "REPLICATION_NOT_AUTHORIZED" +_RSD = "ReplicaStatusDescription" +_RSPP = "ReplicaStatusPercentProgress" +_TCa = "TableClass" +_STANDARD = "STANDARD" +_SIA = "STANDARD_INFREQUENT_ACCESS" +_TCS = "TableClassSummary" +_LUDT = "LastUpdateDateTime" +_TS = "TableStatus" +_TWTD = "TableWarmThroughputDescription" +_RDe = "ReplicaDescription" +_RA = "ReplicaArn" +_RIDT = "ReplicaInaccessibleDateTime" +_RTCS = "ReplicaTableClassSummary" +_RDL = "ReplicaDescriptionList" +_GTD = "GlobalTableDescription" +_GTA = "GlobalTableArn" +_CDT = "CreationDateTime" +_CGTO = "CreateGlobalTableOutput" +_GTAEE = "GlobalTableAlreadyExistsException" +_CGT = "CreateGlobalTable" +_CGTWGMA = "CreateGlobalTableWitnessGroupMemberAction" +_CRA = "CreateReplicaAction" +_RGSI = "ReplicaGlobalSecondaryIndex" +_RGSIL = "ReplicaGlobalSecondaryIndexList" +_CRGMA = "CreateReplicationGroupMemberAction" +_TCO = "TableClassOverride" +_DPE = "DeletionProtectionEnabled" +_GSIl = "GlobalSecondaryIndex" +_GSIL = "GlobalSecondaryIndexList" +_LSIo = "LocalSecondaryIndex" +_LSIL = "LocalSecondaryIndexList" +_RP = "ResourcePolicy" +_SSEE = "SSEEnabled" +_SSESp = "SSESpecification" +_E = "Enabled" +_TKS = "TagKeyString" +_TVS = "TagValueString" +_Ta = "Tag" +_K = "Key" +_V = "Value" +_TL = "TagList" +_VIe = "VectorIndex" +_VIL = "VectorIndexList" +_CTI = "CreateTableInput" +_Tag = "Tags" +_GTSA = "GlobalTableSourceArn" +_NNLO = "NonNegativeLongObject" +_PTD = "ProvisionedThroughputDescription" +_LIDT = "LastIncreaseDateTime" +_LDDT = "LastDecreaseDateTime" +_NODT = "NumberOfDecreasesToday" +_GSID = "GlobalSecondaryIndexDescription" +_ISB = "IndexSizeBytes" +_IA = "IndexArn" +_GSIDL = "GlobalSecondaryIndexDescriptionList" +_WS = "WitnessStatus" +_GTWD = "GlobalTableWitnessDescription" +_GTWDL = "GlobalTableWitnessDescriptionList" +_SA = "StreamArn" +_LSID = "LocalSecondaryIndexDescription" +_LSIDL = "LocalSecondaryIndexDescriptionList" +_MRC = "MultiRegionConsistency" +_EVENTUAL = "EVENTUAL" +_STRONG = "STRONG" +_RIP = "RestoreInProgress" +_RSe = "RestoreSummary" +_SBA = "SourceBackupArn" +_STA = "SourceTableArn" +_RDT = "RestoreDateTime" +_VID = "VectorIndexDescription" +_VIDL = "VectorIndexDescriptionList" +_TD = "TableDescription" +_LSL = "LatestStreamLabel" +_LSA = "LatestStreamArn" +_GTV = "GlobalTableVersion" +_Repl = "Replicas" +_GTW = "GlobalTableWitnesses" +_CTO = "CreateTableOutput" +_RIUE = "ResourceInUseException" +_CTr = "CreateTable" +_CVIA = "CreateVectorIndexAction" +_CD = "CsvDelimiter" +_CH = "CsvHeader" +_CHL = "CsvHeaderList" +_COs = "CsvOptions" +_De = "Delimiter" +_HL = "HeaderList" +_DBI = "DeleteBackupInput" +_DBO = "DeleteBackupOutput" +_DB = "DeleteBackup" +_DGSIA = "DeleteGlobalSecondaryIndexAction" +_DGTWGMA = "DeleteGlobalTableWitnessGroupMemberAction" +_RV = "ReturnValue" +_UO = "UPDATED_OLD" +_AN_ = "ALL_NEW" +_UN = "UPDATED_NEW" +_TCE = "TransactionConflictException" +_DRA = "DeleteReplicaAction" +_DRGMA = "DeleteReplicationGroupMemberAction" +_PRI = "PolicyRevisionId" +_RAS = "ResourceArnString" +_DRPI = "DeleteResourcePolicyInput" +_RAe = "ResourceArn" +_ERI = "ExpectedRevisionId" +_DRPO = "DeleteResourcePolicyOutput" +_RI = "RevisionId" +_PNFE = "PolicyNotFoundException" +_DRP = "DeleteResourcePolicy" +_DTI = "DeleteTableInput" +_DTO = "DeleteTableOutput" +_DT = "DeleteTable" +_DVIA = "DeleteVectorIndexAction" +_DBIe = "DescribeBackupInput" +_DBOe = "DescribeBackupOutput" +_DBe = "DescribeBackup" +_DCBI = "DescribeContinuousBackupsInput" +_DCBO = "DescribeContinuousBackupsOutput" +_DCB = "DescribeContinuousBackups" +_DCII = "DescribeContributorInsightsInput" +_ED = "ExceptionDescription" +_EN = "ExceptionName" +_FE = "FailureException" +_DCIO = "DescribeContributorInsightsOutput" +_DCI = "DescribeContributorInsights" +_DEI = "DescribeEndpointsInput" +_sSI = "smithy.synthetic#originalShapeId" +_cDER = "com.amazonaws.dynamodb#DescribeEndpointsRequest" +_L = "Long" +_En = "Endpoint" +_A = "Address" +_CPIM = "CachePeriodInMinutes" +_End = "Endpoints" +_DEO = "DescribeEndpointsOutput" +_cDERo = "com.amazonaws.dynamodb#DescribeEndpointsResponse" +_DE = "DescribeEndpoints" +_EA = "ExportArn" +_DEIe = "DescribeExportInput" +_EET = "ExportEndTime" +_EF = "ExportFormat" +_DJ = "DYNAMODB_JSON" +_ION = "ION" +_EMx = "ExportManifest" +_ES = "ExportStatus" +_IP = "IN_PROGRESS" +_COMPLETED = "COMPLETED" +_ET = "ExportTime" +_ETx = "ExportType" +_FE_ = "FULL_EXPORT" +_IE = "INCREMENTAL_EXPORT" +_FC = "FailureCode" +_FM = "FailureMessage" +_KE = "KeyExpression" +_EFT = "ExportFromTime" +_ETT = "ExportToTime" +_EVT = "ExportViewType" +_IES = "IncrementalExportSpecification" +_SB = "S3Bucket" +_SBO = "S3BucketOwner" +_SPr = "S3Prefix" +_SSA = "S3SseAlgorithm" +_SSKKI = "S3SseKmsKeyId" +_EST = "ExportStartTime" +_ENFE = "ExportNotFoundException" +_DGTI = "DescribeGlobalTableInput" +_DGTO = "DescribeGlobalTableOutput" +_GTNFE = "GlobalTableNotFoundException" +_DGT = "DescribeGlobalTable" +_DGTSI = "DescribeGlobalTableSettingsInput" +_RGSISD = "ReplicaGlobalSecondaryIndexSettingsDescription" +_PRCU = "ProvisionedReadCapacityUnits" +_PRCASS = "ProvisionedReadCapacityAutoScalingSettings" +_PWCU = "ProvisionedWriteCapacityUnits" +_PWCASS = "ProvisionedWriteCapacityAutoScalingSettings" +_RGSISDL = "ReplicaGlobalSecondaryIndexSettingsDescriptionList" +_RSDe = "ReplicaSettingsDescription" +_RBMS = "ReplicaBillingModeSummary" +_RPRCU = "ReplicaProvisionedReadCapacityUnits" +_RPRCASS = "ReplicaProvisionedReadCapacityAutoScalingSettings" +_RPWCU = "ReplicaProvisionedWriteCapacityUnits" +_RPWCASS = "ReplicaProvisionedWriteCapacityAutoScalingSettings" +_RGSIS = "ReplicaGlobalSecondaryIndexSettings" +_RSDL = "ReplicaSettingsDescriptionList" +_DGTSO = "DescribeGlobalTableSettingsOutput" +_RSep = "ReplicaSettings" +_DGTS = "DescribeGlobalTableSettings" +_IAm = "ImportArn" +_DII = "DescribeImportInput" +_IET = "ImportEndTime" +_EC = "ErrorCount" +_IIC = "ImportedItemCount" +_ISm = "ImportStatus" +_CANCELLING = "CANCELLING" +_CANCELLED = "CANCELLED" +_ICT = "InputCompressionType" +_GZIP = "GZIP" +_ZSTD = "ZSTD" +_IFn = "InputFormat" +_CSV = "CSV" +_IFO = "InputFormatOptions" +_Cs = "Csv" +_PIC = "ProcessedItemCount" +_SBS = "S3BucketSource" +_SKP = "S3KeyPrefix" +_IST = "ImportStartTime" +_TCP = "TableCreationParameters" +_ITD = "ImportTableDescription" +_ST = "StartTime" +_ETn = "EndTime" +_PSB = "ProcessedSizeBytes" +_DIO = "DescribeImportOutput" +_INFE = "ImportNotFoundException" +_DIe = "DescribeImport" +_DKSDI = "DescribeKinesisStreamingDestinationInput" +_DS = "DestinationStatus" +_EF_ = "ENABLE_FAILED" +_KDSD = "KinesisDataStreamDestination" +_DSD = "DestinationStatusDescription" +_KDSDi = "KinesisDataStreamDestinations" +_DKSDO = "DescribeKinesisStreamingDestinationOutput" +_DKSD = "DescribeKinesisStreamingDestination" +_DLI = "DescribeLimitsInput" +_DLO = "DescribeLimitsOutput" +_AMRCU = "AccountMaxReadCapacityUnits" +_AMWCU = "AccountMaxWriteCapacityUnits" +_TMRCU = "TableMaxReadCapacityUnits" +_TMWCU = "TableMaxWriteCapacityUnits" +_DL = "DescribeLimits" +_DTIe = "DescribeTableInput" +_DTOe = "DescribeTableOutput" +_DTe = "DescribeTable" +_DTRASI = "DescribeTableReplicaAutoScalingInput" +_RGSIASD = "ReplicaGlobalSecondaryIndexAutoScalingDescription" +_RGSIASDL = "ReplicaGlobalSecondaryIndexAutoScalingDescriptionList" +_RASD = "ReplicaAutoScalingDescription" +_RASDL = "ReplicaAutoScalingDescriptionList" +_TASD = "TableAutoScalingDescription" +_DTRASO = "DescribeTableReplicaAutoScalingOutput" +_DTRAS = "DescribeTableReplicaAutoScaling" +_DTTLI = "DescribeTimeToLiveInput" +_DTTLO = "DescribeTimeToLiveOutput" +_DTTL = "DescribeTimeToLive" +_EKSC = "EnableKinesisStreamingConfiguration" +_DKSDIi = "DisableKinesisStreamingDestinationInput" +_cKSDI = "com.amazonaws.dynamodb#KinesisStreamingDestinationInput" +_DKSDOi = "DisableKinesisStreamingDestinationOutput" +_cKSDO = "com.amazonaws.dynamodb#KinesisStreamingDestinationOutput" +_DKSDi = "DisableKinesisStreamingDestination" +_DIE = "DuplicateItemException" +_EKSDI = "EnableKinesisStreamingDestinationInput" +_EKSDO = "EnableKinesisStreamingDestinationOutput" +_EKSD = "EnableKinesisStreamingDestination" +_PIO = "PositiveIntegerObject" +_PQLNT = "PartiQLNextToken" +_IPME = "IdempotentParameterMismatchException" +_TIPE = "TransactionInProgressException" +_ECE = "ExportConflictException" +_IETE = "InvalidExportTimeException" +_PITRUE = "PointInTimeRecoveryUnavailableException" +_GRPI = "GetResourcePolicyInput" +_GRPO = "GetResourcePolicyOutput" +_Po = "Policy" +_GRP = "GetResourcePolicy" +_ICE = "ImportConflictException" +_ITI = "ImportTableInput" +_sT = "smithy.api#idempotencyToken" +_ITO = "ImportTableOutput" +_IT = "ImportTable" +_TRLB = "TimeRangeLowerBound" +_TRUB = "TimeRangeUpperBound" +_LBI = "ListBackupsInput" +_Li = "Limit" +_ESBA = "ExclusiveStartBackupArn" +_LBO = "ListBackupsOutput" +_LEBA = "LastEvaluatedBackupArn" +_LB = "ListBackups" +_LCIL = "ListContributorInsightsLimit" +_NTS = "NextTokenString" +_LCII = "ListContributorInsightsInput" +_NT = "NextToken" +_MR = "MaxResults" +_LCIO = "ListContributorInsightsOutput" +_LCI = "ListContributorInsights" +_LEML = "ListExportsMaxLimit" +_ENT = "ExportNextToken" +_LEI = "ListExportsInput" +_ESx = "ExportSummary" +_ESxp = "ExportSummaries" +_LEO = "ListExportsOutput" +_LEi = "ListExports" +_LGTI = "ListGlobalTablesInput" +_ESGTN = "ExclusiveStartGlobalTableName" +_GTl = "GlobalTable" +_GTL = "GlobalTableList" +_LGTO = "ListGlobalTablesOutput" +_GTlo = "GlobalTables" +_LEGTN = "LastEvaluatedGlobalTableName" +_LGT = "ListGlobalTables" +_INT = "ImportNextToken" +_LIML = "ListImportsMaxLimit" +_LII = "ListImportsInput" +_PS = "PageSize" +_ISmp = "ImportSummary" +_ISL = "ImportSummaryList" +_LIO = "ListImportsOutput" +_LI = "ListImports" +_LTIL = "ListTablesInputLimit" +_LTI = "ListTablesInput" +_ESTN = "ExclusiveStartTableName" +_TNL = "TableNameList" +_LTO = "ListTablesOutput" +_TNa = "TableNames" +_LETN = "LastEvaluatedTableName" +_LTi = "ListTables" +_LTORI = "ListTagsOfResourceInput" +_LTORO = "ListTagsOfResourceOutput" +_LTOR = "ListTagsOfResource" +_PRPI = "PutResourcePolicyInput" +_sH = "smithy.api#httpHeader" +_xacrsra = "x-amz-confirm-remove-self-resource-access" +_PRPO = "PutResourcePolicyOutput" +_PRP = "PutResourcePolicy" +_Se = "Select" +_AA_ = "ALL_ATTRIBUTES" +_APA = "ALL_PROJECTED_ATTRIBUTES" +_SA_ = "SPECIFIC_ATTRIBUTES" +_COUNT = "COUNT" +_I = "Integer" +_RTFBI = "RestoreTableFromBackupInput" +_TTN = "TargetTableName" +_BMO = "BillingModeOverride" +_GSIO = "GlobalSecondaryIndexOverride" +_LSIO = "LocalSecondaryIndexOverride" +_SSESO = "SSESpecificationOverride" +_VIO = "VectorIndexOverride" +_RTFBO = "RestoreTableFromBackupOutput" +_TAEE = "TableAlreadyExistsException" +_RTFB = "RestoreTableFromBackup" +_IRTE = "InvalidRestoreTimeException" +_RTTPITI = "RestoreTableToPointInTimeInput" +_STN = "SourceTableName" +_ULRT = "UseLatestRestorableTime" +_RTTPITO = "RestoreTableToPointInTimeOutput" +_RTTPIT = "RestoreTableToPointInTime" +_SSc = "ScanSegment" +_STS = "ScanTotalSegments" +_TKI = "TopKInteger" +_SN = "ScoreNumber" +_TRI = "TagResourceInput" +_TRO = "TagResourceOutput" +_sU = "smithy.api#Unit" +_TRa = "TagResource" +_UE = "UpdateExpression" +_TKL = "TagKeyList" +_URI = "UntagResourceInput" +_TKa = "TagKeys" +_URO = "UntagResourceOutput" +_UR = "UntagResource" +_PITRSo = "PointInTimeRecoverySpecification" +_PITRE = "PointInTimeRecoveryEnabled" +_UCBI = "UpdateContinuousBackupsInput" +_UCBO = "UpdateContinuousBackupsOutput" +_UCB = "UpdateContinuousBackups" +_UCII = "UpdateContributorInsightsInput" +_UCIO = "UpdateContributorInsightsOutput" +_UCI = "UpdateContributorInsights" +_RAEE = "ReplicaAlreadyExistsException" +_RNFEe = "ReplicaNotFoundException" +_RU = "ReplicaUpdate" +_Cr = "Create" +_Del = "Delete" +_RUL = "ReplicaUpdateList" +_UGTI = "UpdateGlobalTableInput" +_RUe = "ReplicaUpdates" +_UGTO = "UpdateGlobalTableOutput" +_UGT = "UpdateGlobalTable" +_INFEn = "IndexNotFoundException" +_GTGSISU = "GlobalTableGlobalSecondaryIndexSettingsUpdate" +_PWCASSU = "ProvisionedWriteCapacityAutoScalingSettingsUpdate" +_GTGSISUL = "GlobalTableGlobalSecondaryIndexSettingsUpdateList" +_RGSISU = "ReplicaGlobalSecondaryIndexSettingsUpdate" +_PRCASSU = "ProvisionedReadCapacityAutoScalingSettingsUpdate" +_RGSISUL = "ReplicaGlobalSecondaryIndexSettingsUpdateList" +_RSU = "ReplicaSettingsUpdate" +_RPRCASSU = "ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate" +_RTC = "ReplicaTableClass" +_RSUL = "ReplicaSettingsUpdateList" +_UGTSI = "UpdateGlobalTableSettingsInput" +_GTBM = "GlobalTableBillingMode" +_GTPWCU = "GlobalTableProvisionedWriteCapacityUnits" +_GTPWCASSU = "GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate" +_UGTSO = "UpdateGlobalTableSettingsOutput" +_UGTS = "UpdateGlobalTableSettings" +_UKSC = "UpdateKinesisStreamingConfiguration" +_UKSDI = "UpdateKinesisStreamingDestinationInput" +_UKSDO = "UpdateKinesisStreamingDestinationOutput" +_UKSD = "UpdateKinesisStreamingDestination" +_UGSIA = "UpdateGlobalSecondaryIndexAction" +_GSIU = "GlobalSecondaryIndexUpdate" +_U = "Update" +_GSIUL = "GlobalSecondaryIndexUpdateList" +_GTWGU = "GlobalTableWitnessGroupUpdate" +_GTWGUL = "GlobalTableWitnessGroupUpdateList" +_URGMA = "UpdateReplicationGroupMemberAction" +_RGU = "ReplicationGroupUpdate" +_RGUL = "ReplicationGroupUpdateList" +_VIU = "VectorIndexUpdate" +_VIUL = "VectorIndexUpdateList" +_UTI = "UpdateTableInput" +_GSIUl = "GlobalSecondaryIndexUpdates" +_GTWU = "GlobalTableWitnessUpdates" +_VIUe = "VectorIndexUpdates" +_UTO = "UpdateTableOutput" +_UT = "UpdateTable" +_GSIASU = "GlobalSecondaryIndexAutoScalingUpdate" +_PWCASU = "ProvisionedWriteCapacityAutoScalingUpdate" +_GSIASUL = "GlobalSecondaryIndexAutoScalingUpdateList" +_RGSIASU = "ReplicaGlobalSecondaryIndexAutoScalingUpdate" +_PRCASU = "ProvisionedReadCapacityAutoScalingUpdate" +_RGSIASUL = "ReplicaGlobalSecondaryIndexAutoScalingUpdateList" +_RASU = "ReplicaAutoScalingUpdate" +_RGSIU = "ReplicaGlobalSecondaryIndexUpdates" +_RPRCASU = "ReplicaProvisionedReadCapacityAutoScalingUpdate" +_RASUL = "ReplicaAutoScalingUpdateList" +_UTRASI = "UpdateTableReplicaAutoScalingInput" +_UTRASO = "UpdateTableReplicaAutoScalingOutput" +_UTRAS = "UpdateTableReplicaAutoScaling" +_TTLE = "TimeToLiveEnabled" +_TTLSi = "TimeToLiveSpecification" +_UTTLI = "UpdateTimeToLiveInput" +_UTTLO = "UpdateTimeToLiveOutput" +_UTTL = "UpdateTimeToLive" +_AV = "AttributeValue" +_SS_ = "SS" +_NS = "NS" +_BS_ = "BS" +_M_ = "M" +_L_ = "L" +_BOOL = "BOOL" +_LAV = "ListAttributeValue" +_MAV = "MapAttributeValue" +_AM = "AttributeMap" +_AVL = "AttributeValueList" +_AVU = "AttributeValueUpdate" +_Ac = "Action" +_EAVM = "ExpressionAttributeValueMap" +_ICKAM = "ItemCollectionKeyAttributeMap" +_PSP = "PreparedStatementParameters" +_PIIAM = "PutItemInputAttributeMap" +_SVL = "SearchVectorList" +_AU = "AttributeUpdates" +_BSE = "BatchStatementError" +_It = "Item" +_BSR = "BatchStatementRequest" +_Stat = "Statement" +_Pa = "Parameters" +_CRa = "CancellationReason" +_Con = "Condition" +_CCFE = "ConditionalCheckFailedException" +_DR = "DeleteRequest" +_ESI = "ExecuteStatementInput" +_FS = "FilterSpecification" +_FEi = "FilterExpression" +_KCE = "KeyConditionExpression" +_EAN = "ExpressionAttributeNames" +_EAV = "ExpressionAttributeValues" +_G = "Get" +_GII = "GetItemInput" +_ATG = "AttributesToGet" +_GIO = "GetItemOutput" +_ICM = "ItemCollectionMetrics" +_ICK = "ItemCollectionKey" +_SERGB = "SizeEstimateRangeGB" +_IL = "ItemList" +_IR = "ItemResponse" +_KL = "KeyList" +_PSa = "ParameterizedStatement" +_PR = "PutRequest" +_SRI = "SearchResultItem" +_Sc = "Score" +_BGRM = "BatchGetResponseMap" +_CRL = "CancellationReasonList" +_EDx = "ExportDescription" +_ETTPITI = "ExportTableToPointInTimeInput" +_FCM = "FilterConditionMap" +_ICMM = "ItemCollectionMetricsMultiple" +_IRL = "ItemResponseList" +_KC = "KeyConditions" +_KAA = "KeysAndAttributes" +_Ke = "Keys" +_PSar = "ParameterizedStatements" +_PQLBR = "PartiQLBatchRequest" +_SRL = "SearchResultList" +_TGI = "TransactGetItem" +_BESI = "BatchExecuteStatementInput" +_State = "Statements" +_BGRMa = "BatchGetRequestMap" +_DEOe = "DescribeExportOutput" +_ETI = "ExecuteTransactionInput" +_TSr = "TransactStatements" +_ETO = "ExecuteTransactionOutput" +_Res = "Responses" +_ETTPITO = "ExportTableToPointInTimeOutput" +_ICMPT = "ItemCollectionMetricsPerTable" +_SVO = "SearchVectorsOutput" +_SR = "SearchResults" +_TGIL = "TransactGetItemList" +_TGIO = "TransactGetItemsOutput" +_TCEr = "TransactionCanceledException" +_CRan = "CancellationReasons" +_DEe = "DescribeExport" +_BGII = "BatchGetItemInput" +_RIe = "RequestItems" +_EAVx = "ExpectedAttributeValue" +_Ex = "Exists" +_TGII = "TransactGetItemsInput" +_TIr = "TransactItems" +_TWIO = "TransactWriteItemsOutput" +_CCo = "ConditionCheck" +_Pu = "Put" +_SVI = "SearchVectorsInput" +_SV = "SearchVector" +_SCE = "SearchConditionExpression" +_TKo = "TopK" +_BSRa = "BatchStatementResponse" +_Er = "Error" +_DIOe = "DeleteItemOutput" +_At = "Attributes" +_ESO = "ExecuteStatementOutput" +_Ite = "Items" +_LEK = "LastEvaluatedKey" +_EAM = "ExpectedAttributeMap" +_GI = "GetItem" +_PIOu = "PutItemOutput" +_QO = "QueryOutput" +_Cou = "Count" +_SC = "ScannedCount" +_SO = "ScanOutput" +_UIO = "UpdateItemOutput" +_WR = "WriteRequest" +_PQLBRa = "PartiQLBatchResponse" +_ETTPIT = "ExportTableToPointInTime" +_WRr = "WriteRequests" +_BESO = "BatchExecuteStatementOutput" +_BGIO = "BatchGetItemOutput" +_UK = "UnprocessedKeys" +_BWIRM = "BatchWriteItemRequestMap" +_SI = "ScanInput" +_SF = "ScanFilter" +_ESK = "ExclusiveStartKey" +_TSo = "TotalSegments" +_Seg = "Segment" +_SVe = "SearchVectors" +_BWII = "BatchWriteItemInput" +_DIIe = "DeleteItemInput" +_Exp = "Expected" +_RVe = "ReturnValues" +_ESxe = "ExecuteStatement" +_PII = "PutItemInput" +_ETxe = "ExecuteTransaction" +_QI = "QueryInput" +_QF = "QueryFilter" +_SIF = "ScanIndexForward" +_BES = "BatchExecuteStatement" +_TGIr = "TransactGetItems" +_BGI = "BatchGetItem" +_BWIO = "BatchWriteItemOutput" +_UI = "UnprocessedItems" +_UII = "UpdateItemInput" +_Sca = "Scan" +_Q = "Query" +_DIel = "DeleteItem" +_PI = "PutItem" +_TWI = "TransactWriteItem" +_UIp = "UpdateItem" +_BWI = "BatchWriteItem" +_TWIL = "TransactWriteItemList" +_TWII = "TransactWriteItemsInput" +_TWIr = "TransactWriteItems" +_D_ = "DynamoDB_20120810" +_a = "aws.auth#sigv4" +_a_ = "aws.protocols#awsJson1_0" +_sB = "smithy.rules#endpointBdd" +_aw = "aws.api#service" +_sN = "smithy.api#xmlNamespace" + +APPROXIMATE_CREATION_DATE_TIME_PRECISION: StaticSchema = ( + 14, + n0, + _ACDTP, + 0, + (_MILLISECOND, _MICROSECOND), + ((-1, {_sV: _MILLISECOND}), (-1, {_sV: _MICROSECOND})), +) + +ARCHIVAL_REASON: StaticSchema = (3, n0, _AR, 0) + +BACKUP_ARN: StaticSchema = (3, n0, _BA, 0) + +DATE: StaticSchema = (4, n0, _D, 0) + +ARCHIVAL_SUMMARY: StaticSchema = ( + 18, + n0, + _AS, + 0, + (_ADT, _AR, _ABA), + ((DATE, 0), (ARCHIVAL_REASON, 0), (BACKUP_ARN, 0)), +) + +ATTRIBUTE_ACTION: StaticSchema = ( + 14, + n0, + _AA, + 0, + (_ADD, _PUT, _DELETE), + ((-1, {_sV: _ADD}), (-1, {_sV: _PUT}), (-1, {_sV: _DELETE})), +) + +KEY_SCHEMA_ATTRIBUTE_NAME: StaticSchema = (3, n0, _KSAN, 0) + +SCALAR_ATTRIBUTE_TYPE: StaticSchema = ( + 14, + n0, + _SAT, + 0, + (_S, _N, _B), + ((-1, {_sV: _S}), (-1, {_sV: _N}), (-1, {_sV: _B})), +) + +ATTRIBUTE_DEFINITION: StaticSchema = ( + 18, + n0, + _AD, + 0, + (_AN, _AT), + ((KEY_SCHEMA_ATTRIBUTE_NAME, 1), (SCALAR_ATTRIBUTE_TYPE, 1)), +) + +ATTRIBUTE_DEFINITIONS: StaticSchema = ( + 16, + n0, + _ADt, + 0, + (_m,), + ((ATTRIBUTE_DEFINITION, 0),), +) + +ATTRIBUTE_NAME: StaticSchema = (3, n0, _AN, 0) + +BINARY_ATTRIBUTE_VALUE: StaticSchema = (1, n0, _BAV, 0) + +BOOLEAN_ATTRIBUTE_VALUE: StaticSchema = (2, n0, _BAVo, 0) + +BINARY_SET_ATTRIBUTE_VALUE: StaticSchema = ( + 16, + n0, + _BSAV, + 0, + (_m,), + ((BINARY_ATTRIBUTE_VALUE, 0),), +) + +NUMBER_ATTRIBUTE_VALUE: StaticSchema = (3, n0, _NAV, 0) + +NUMBER_SET_ATTRIBUTE_VALUE: StaticSchema = ( + 16, + n0, + _NSAV, + 0, + (_m,), + ((NUMBER_ATTRIBUTE_VALUE, 0),), +) +NULL_ATTRIBUTE_VALUE: StaticSchema = (2, n0, _NAVu, 0) -APPROXIMATE_CREATION_DATE_TIME_PRECISION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ApproximateCreationDateTimePrecision"), - shape_type=ShapeType.ENUM, - members={"MILLISECOND": {"target": UNIT}, "MICROSECOND": {"target": UNIT}}, -) +STRING_ATTRIBUTE_VALUE: StaticSchema = (3, n0, _SAV, 0) -ARCHIVAL_REASON = Schema( - id=ShapeID("com.amazonaws.dynamodb#ArchivalReason"), shape_type=ShapeType.STRING +STRING_SET_ATTRIBUTE_VALUE: StaticSchema = ( + 16, + n0, + _SSAV, + 0, + (_m,), + ((STRING_ATTRIBUTE_VALUE, 0),), ) -BACKUP_ARN = Schema( - id=ShapeID("com.amazonaws.dynamodb#BackupArn"), shape_type=ShapeType.STRING -) +ATTRIBUTE_NAME_LIST: StaticSchema = (16, n0, _ANL, 0, (_m,), ((ATTRIBUTE_NAME, 0),)) -DATE = Schema(id=ShapeID("com.amazonaws.dynamodb#Date"), shape_type=ShapeType.TIMESTAMP) +AUTO_SCALING_POLICY_NAME: StaticSchema = (3, n0, _ASPN, 0) -ARCHIVAL_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ArchivalSummary"), - members={ - "ArchivalDateTime": {"target": DATE}, - "ArchivalReason": {"target": ARCHIVAL_REASON}, - "ArchivalBackupArn": {"target": BACKUP_ARN}, - }, -) +BOOLEAN_OBJECT: StaticSchema = (2, n0, _BO, 0) -ATTRIBUTE_ACTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#AttributeAction"), - shape_type=ShapeType.ENUM, - members={ - "ADD": {"target": UNIT}, - "PUT": {"target": UNIT}, - "DELETE": {"target": UNIT}, - }, -) +INTEGER_OBJECT: StaticSchema = (7, n0, _IO, 0) -KEY_SCHEMA_ATTRIBUTE_NAME = Schema( - id=ShapeID("com.amazonaws.dynamodb#KeySchemaAttributeName"), - shape_type=ShapeType.STRING, -) +DOUBLE_OBJECT: StaticSchema = (10, n0, _DO, 0) -SCALAR_ATTRIBUTE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ScalarAttributeType"), - shape_type=ShapeType.ENUM, - members={"S": {"target": UNIT}, "N": {"target": UNIT}, "B": {"target": UNIT}}, +AUTO_SCALING_TARGET_TRACKING_SCALING_POLICY_CONFIGURATION_DESCRIPTION: StaticSchema = ( + 18, + n0, + _ASTTSPCD, + 0, + (_DSI, _SIC, _SOC, _TV), + ((BOOLEAN_OBJECT, 0), (INTEGER_OBJECT, 0), (INTEGER_OBJECT, 0), (DOUBLE_OBJECT, 1)), ) -ATTRIBUTE_DEFINITION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#AttributeDefinition"), - members={ - "AttributeName": { - "target": KEY_SCHEMA_ATTRIBUTE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "AttributeType": { - "target": SCALAR_ATTRIBUTE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +AUTO_SCALING_POLICY_DESCRIPTION: StaticSchema = ( + 18, + n0, + _ASPD, + 0, + (_PN, _TTSPC), + ( + (AUTO_SCALING_POLICY_NAME, 0), + (AUTO_SCALING_TARGET_TRACKING_SCALING_POLICY_CONFIGURATION_DESCRIPTION, 0), + ), ) -ATTRIBUTE_DEFINITIONS = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#AttributeDefinitions"), - shape_type=ShapeType.LIST, - members={"member": {"target": ATTRIBUTE_DEFINITION}}, +AUTO_SCALING_POLICY_DESCRIPTION_LIST: StaticSchema = ( + 16, + n0, + _ASPDL, + 0, + (_m,), + ((AUTO_SCALING_POLICY_DESCRIPTION, 0),), +) + +AUTO_SCALING_TARGET_TRACKING_SCALING_POLICY_CONFIGURATION_UPDATE: StaticSchema = ( + 18, + n0, + _ASTTSPCU, + 0, + (_DSI, _SIC, _SOC, _TV), + ((BOOLEAN_OBJECT, 0), (INTEGER_OBJECT, 0), (INTEGER_OBJECT, 0), (DOUBLE_OBJECT, 1)), +) + +AUTO_SCALING_POLICY_UPDATE: StaticSchema = ( + 18, + n0, + _ASPU, + 0, + (_PN, _TTSPC), + ( + (AUTO_SCALING_POLICY_NAME, 0), + (AUTO_SCALING_TARGET_TRACKING_SCALING_POLICY_CONFIGURATION_UPDATE, 1), + ), ) -ATTRIBUTE_NAME = Schema( - id=ShapeID("com.amazonaws.dynamodb#AttributeName"), shape_type=ShapeType.STRING -) +AUTO_SCALING_ROLE_ARN: StaticSchema = (3, n0, _ASRA, 0) -BINARY_ATTRIBUTE_VALUE = Schema( - id=ShapeID("com.amazonaws.dynamodb#BinaryAttributeValue"), shape_type=ShapeType.BLOB -) +STRING: StaticSchema = (3, n0, _St, 0) -BOOLEAN_ATTRIBUTE_VALUE = Schema( - id=ShapeID("com.amazonaws.dynamodb#BooleanAttributeValue"), - shape_type=ShapeType.BOOLEAN, -) +POSITIVE_LONG_OBJECT: StaticSchema = (8, n0, _PLO, 0) -BINARY_SET_ATTRIBUTE_VALUE = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#BinarySetAttributeValue"), - shape_type=ShapeType.LIST, - members={"member": {"target": BINARY_ATTRIBUTE_VALUE}}, +AUTO_SCALING_SETTINGS_DESCRIPTION: StaticSchema = ( + 18, + n0, + _ASSD, + 0, + (_MU, _MUa, _ASD, _ASRA, _SP), + ( + (POSITIVE_LONG_OBJECT, 0), + (POSITIVE_LONG_OBJECT, 0), + (BOOLEAN_OBJECT, 0), + (STRING, 0), + (AUTO_SCALING_POLICY_DESCRIPTION_LIST, 0), + ), ) -NUMBER_ATTRIBUTE_VALUE = Schema( - id=ShapeID("com.amazonaws.dynamodb#NumberAttributeValue"), - shape_type=ShapeType.STRING, +AUTO_SCALING_SETTINGS_UPDATE: StaticSchema = ( + 18, + n0, + _ASSU, + 0, + (_MU, _MUa, _ASD, _ASRA, _SPU), + ( + (POSITIVE_LONG_OBJECT, 0), + (POSITIVE_LONG_OBJECT, 0), + (BOOLEAN_OBJECT, 0), + (AUTO_SCALING_ROLE_ARN, 0), + (AUTO_SCALING_POLICY_UPDATE, 0), + ), ) -NUMBER_SET_ATTRIBUTE_VALUE = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#NumberSetAttributeValue"), - shape_type=ShapeType.LIST, - members={"member": {"target": NUMBER_ATTRIBUTE_VALUE}}, -) +AVAILABILITY_ERROR_MESSAGE: StaticSchema = (3, n0, _AEM, 0) + +BACKFILLING: StaticSchema = (2, n0, _Ba, 0) + +BACKUP_CREATION_DATE_TIME: StaticSchema = (4, n0, _BCDT, 0) + +BACKUP_NAME: StaticSchema = (3, n0, _BN, 0) -NULL_ATTRIBUTE_VALUE = Schema( - id=ShapeID("com.amazonaws.dynamodb#NullAttributeValue"), - shape_type=ShapeType.BOOLEAN, +BACKUP_SIZE_BYTES: StaticSchema = (8, n0, _BSB, 0) + +BACKUP_STATUS: StaticSchema = ( + 14, + n0, + _BS, + 0, + (_CREATING, _DELETED, _AVAILABLE), + ((-1, {_sV: _CREATING}), (-1, {_sV: _DELETED}), (-1, {_sV: _AVAILABLE})), ) -STRING_ATTRIBUTE_VALUE = Schema( - id=ShapeID("com.amazonaws.dynamodb#StringAttributeValue"), - shape_type=ShapeType.STRING, +BACKUP_TYPE: StaticSchema = ( + 14, + n0, + _BT, + 0, + (_USER, _SYSTEM, _AB), + ((-1, {_sV: _USER}), (-1, {_sV: _SYSTEM}), (-1, {_sV: _AB})), ) -STRING_SET_ATTRIBUTE_VALUE = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#StringSetAttributeValue"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING_ATTRIBUTE_VALUE}}, +BACKUP_DETAILS: StaticSchema = ( + 18, + n0, + _BD, + 0, + (_BA, _BN, _BSB, _BS, _BT, _BCDT, _BEDT), + ( + (BACKUP_ARN, 1), + (BACKUP_NAME, 1), + (BACKUP_SIZE_BYTES, 0), + (BACKUP_STATUS, 1), + (BACKUP_TYPE, 1), + (BACKUP_CREATION_DATE_TIME, 1), + (DATE, 0), + ), ) -ATTRIBUTE_NAME_LIST = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#AttributeNameList"), - shape_type=ShapeType.LIST, - members={"member": {"target": ATTRIBUTE_NAME}}, +BILLING_MODE: StaticSchema = ( + 14, + n0, + _BM, + 0, + (_PROVISIONED, _PPR), + ((-1, {_sV: _PROVISIONED}), (-1, {_sV: _PPR})), ) -AUTO_SCALING_POLICY_NAME = Schema( - id=ShapeID("com.amazonaws.dynamodb#AutoScalingPolicyName"), - shape_type=ShapeType.STRING, +ITEM_COUNT: StaticSchema = (8, n0, _IC, 0) + +KEY_TYPE: StaticSchema = ( + 14, + n0, + _KT, + 0, + (_HASH, _RANGE), + ((-1, {_sV: _HASH}), (-1, {_sV: _RANGE})), ) -BOOLEAN_OBJECT = Schema( - id=ShapeID("com.amazonaws.dynamodb#BooleanObject"), shape_type=ShapeType.BOOLEAN +KEY_SCHEMA_ELEMENT: StaticSchema = ( + 18, + n0, + _KSE, + 0, + (_AN, _KT), + ((KEY_SCHEMA_ATTRIBUTE_NAME, 1), (KEY_TYPE, 1)), ) -INTEGER_OBJECT = Schema( - id=ShapeID("com.amazonaws.dynamodb#IntegerObject"), shape_type=ShapeType.INTEGER +KEY_SCHEMA: StaticSchema = (16, n0, _KS, 0, (_m,), ((KEY_SCHEMA_ELEMENT, 0),)) + +LONG_OBJECT: StaticSchema = (8, n0, _LO, 0) + +ON_DEMAND_THROUGHPUT: StaticSchema = ( + 18, + n0, + _ODT, + 0, + (_MRRU, _MWRU), + ((LONG_OBJECT, 0), (LONG_OBJECT, 0)), ) -DOUBLE_OBJECT = Schema( - id=ShapeID("com.amazonaws.dynamodb#DoubleObject"), shape_type=ShapeType.DOUBLE +PROVISIONED_THROUGHPUT: StaticSchema = ( + 18, + n0, + _PT, + 0, + (_RCU, _WCU), + ((POSITIVE_LONG_OBJECT, 1), (POSITIVE_LONG_OBJECT, 1)), ) -AUTO_SCALING_TARGET_TRACKING_SCALING_POLICY_CONFIGURATION_DESCRIPTION = Schema.collection( - id=ShapeID( - "com.amazonaws.dynamodb#AutoScalingTargetTrackingScalingPolicyConfigurationDescription" +TABLE_ARN: StaticSchema = (3, n0, _TA, 0) + +TABLE_CREATION_DATE_TIME: StaticSchema = (4, n0, _TCDT, 0) + +TABLE_ID: StaticSchema = (3, n0, _TI, 0) + +TABLE_NAME: StaticSchema = (3, n0, _TN, 0) + +SOURCE_TABLE_DETAILS: StaticSchema = ( + 18, + n0, + _STD, + 0, + (_TN, _TI, _TA, _TSB, _KS, _TCDT, _PT, _ODT, _IC, _BM), + ( + (TABLE_NAME, 1), + (TABLE_ID, 1), + (TABLE_ARN, 0), + (LONG_OBJECT, 0), + (KEY_SCHEMA, 1), + (TABLE_CREATION_DATE_TIME, 1), + (PROVISIONED_THROUGHPUT, 1), + (ON_DEMAND_THROUGHPUT, 0), + (ITEM_COUNT, 0), + (BILLING_MODE, 0), ), - members={ - "DisableScaleIn": {"target": BOOLEAN_OBJECT}, - "ScaleInCooldown": {"target": INTEGER_OBJECT}, - "ScaleOutCooldown": {"target": INTEGER_OBJECT}, - "TargetValue": { - "target": DOUBLE_OBJECT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, ) -AUTO_SCALING_POLICY_DESCRIPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#AutoScalingPolicyDescription"), - members={ - "PolicyName": {"target": AUTO_SCALING_POLICY_NAME}, - "TargetTrackingScalingPolicyConfiguration": { - "target": AUTO_SCALING_TARGET_TRACKING_SCALING_POLICY_CONFIGURATION_DESCRIPTION - }, - }, +INDEX_NAME: StaticSchema = (3, n0, _IN, 0) + +NON_KEY_ATTRIBUTE_NAME: StaticSchema = (3, n0, _NKAN, 0) + +NON_KEY_ATTRIBUTE_NAME_LIST: StaticSchema = ( + 16, + n0, + _NKANL, + 0, + (_m,), + ((NON_KEY_ATTRIBUTE_NAME, 0),), +) + +PROJECTION_TYPE: StaticSchema = ( + 14, + n0, + _PTr, + 0, + (_ALL, _KO, _INCLUDE), + ((-1, {_sV: _ALL}), (-1, {_sV: _KO}), (-1, {_sV: _INCLUDE})), +) + +PROJECTION: StaticSchema = ( + 18, + n0, + _P, + 0, + (_PTr, _NKA), + ((PROJECTION_TYPE, 0), (NON_KEY_ATTRIBUTE_NAME_LIST, 0)), +) + +GLOBAL_SECONDARY_INDEX_INFO: StaticSchema = ( + 18, + n0, + _GSII, + 0, + (_IN, _KS, _P, _PT, _ODT), + ( + (INDEX_NAME, 0), + (KEY_SCHEMA, 0), + (PROJECTION, 0), + (PROVISIONED_THROUGHPUT, 0), + (ON_DEMAND_THROUGHPUT, 0), + ), ) -AUTO_SCALING_POLICY_DESCRIPTION_LIST = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#AutoScalingPolicyDescriptionList"), - shape_type=ShapeType.LIST, - members={"member": {"target": AUTO_SCALING_POLICY_DESCRIPTION}}, +GLOBAL_SECONDARY_INDEXES: StaticSchema = ( + 16, + n0, + _GSI, + 0, + (_m,), + ((GLOBAL_SECONDARY_INDEX_INFO, 0),), +) + +LOCAL_SECONDARY_INDEX_INFO: StaticSchema = ( + 18, + n0, + _LSII, + 0, + (_IN, _KS, _P), + ((INDEX_NAME, 0), (KEY_SCHEMA, 0), (PROJECTION, 0)), +) + +LOCAL_SECONDARY_INDEXES: StaticSchema = ( + 16, + n0, + _LSI, + 0, + (_m,), + ((LOCAL_SECONDARY_INDEX_INFO, 0),), +) + +KMS_MASTER_KEY_ARN: StaticSchema = (3, n0, _KMSMKA, 0) + +SSE_TYPE: StaticSchema = ( + 14, + n0, + _SSET, + 0, + (_AES, _KMS), + ((-1, {_sV: _AES}), (-1, {_sV: _KMS})), +) + +SSE_STATUS: StaticSchema = ( + 14, + n0, + _SSES, + 0, + (_ENABLING, _ENABLED, _DISABLING, _DISABLED, _UPDATING), + ( + (-1, {_sV: _ENABLING}), + (-1, {_sV: _ENABLED}), + (-1, {_sV: _DISABLING}), + (-1, {_sV: _DISABLED}), + (-1, {_sV: _UPDATING}), + ), ) -AUTO_SCALING_TARGET_TRACKING_SCALING_POLICY_CONFIGURATION_UPDATE = Schema.collection( - id=ShapeID( - "com.amazonaws.dynamodb#AutoScalingTargetTrackingScalingPolicyConfigurationUpdate" +SSE_DESCRIPTION: StaticSchema = ( + 18, + n0, + _SSED, + 0, + (_Sta, _SSET, _KMSMKA, _IEDT), + ((SSE_STATUS, 0), (SSE_TYPE, 0), (KMS_MASTER_KEY_ARN, 0), (DATE, 0)), +) + +STREAM_ENABLED: StaticSchema = (2, n0, _SE, 0) + +STREAM_VIEW_TYPE: StaticSchema = ( + 14, + n0, + _SVT, + 0, + (_NI, _OI, _NAOI, _KO), + ((-1, {_sV: _NI}), (-1, {_sV: _OI}), (-1, {_sV: _NAOI}), (-1, {_sV: _KO})), +) + +STREAM_SPECIFICATION: StaticSchema = ( + 18, + n0, + _SS, + 0, + (_SE, _SVT), + ((STREAM_ENABLED, 1), (STREAM_VIEW_TYPE, 0)), +) + +TIME_TO_LIVE_ATTRIBUTE_NAME: StaticSchema = (3, n0, _TTLAN, 0) + +TIME_TO_LIVE_STATUS: StaticSchema = ( + 14, + n0, + _TTLS, + 0, + (_ENABLING, _DISABLING, _ENABLED, _DISABLED), + ( + (-1, {_sV: _ENABLING}), + (-1, {_sV: _DISABLING}), + (-1, {_sV: _ENABLED}), + (-1, {_sV: _DISABLED}), ), - members={ - "DisableScaleIn": {"target": BOOLEAN_OBJECT}, - "ScaleInCooldown": {"target": INTEGER_OBJECT}, - "ScaleOutCooldown": {"target": INTEGER_OBJECT}, - "TargetValue": { - "target": DOUBLE_OBJECT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, ) -AUTO_SCALING_POLICY_UPDATE = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#AutoScalingPolicyUpdate"), - members={ - "PolicyName": {"target": AUTO_SCALING_POLICY_NAME}, - "TargetTrackingScalingPolicyConfiguration": { - "target": AUTO_SCALING_TARGET_TRACKING_SCALING_POLICY_CONFIGURATION_UPDATE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +TIME_TO_LIVE_DESCRIPTION: StaticSchema = ( + 18, + n0, + _TTLD, + 0, + (_TTLS, _AN), + ((TIME_TO_LIVE_STATUS, 0), (TIME_TO_LIVE_ATTRIBUTE_NAME, 0)), +) + +VECTOR_DISTANCE_FUNCTION: StaticSchema = ( + 14, + n0, + _VDF, + 0, + (_COSINE, _DP, _EUCLIDEAN), + ((-1, {_sV: _COSINE}), (-1, {_sV: _DP}), (-1, {_sV: _EUCLIDEAN})), +) + +SEARCH_SCHEMA_ELEMENT_TYPE: StaticSchema = ( + 14, + n0, + _SSETe, + 0, + (_HASH, _IF), + ((-1, {_sV: _HASH}), (-1, {_sV: _IF})), +) + +SEARCH_SCHEMA_ELEMENT: StaticSchema = ( + 18, + n0, + _SSE, + 0, + (_AN, _SSETe), + ((ATTRIBUTE_NAME, 1), (SEARCH_SCHEMA_ELEMENT_TYPE, 1)), +) + +SEARCH_SCHEMA: StaticSchema = (16, n0, _SSe, 0, (_m,), ((SEARCH_SCHEMA_ELEMENT, 0),)) + +VECTOR_ATTRIBUTE_NAME: StaticSchema = (3, n0, _VAN, 0) + +VECTOR_ATTRIBUTE_DEFINITION: StaticSchema = ( + 18, + n0, + _VAD, + 0, + (_AN,), + ((VECTOR_ATTRIBUTE_NAME, 1),), +) + +VECTOR_INDEX_INFO: StaticSchema = ( + 18, + n0, + _VII, + 0, + (_IN, _VA, _SSe, _P, _Di, _DF), + ( + (INDEX_NAME, 0), + (VECTOR_ATTRIBUTE_DEFINITION, 0), + (SEARCH_SCHEMA, 0), + (PROJECTION, 0), + (POSITIVE_LONG_OBJECT, 0), + (VECTOR_DISTANCE_FUNCTION, 0), + ), ) -AUTO_SCALING_ROLE_ARN = Schema( - id=ShapeID("com.amazonaws.dynamodb#AutoScalingRoleArn"), shape_type=ShapeType.STRING +VECTOR_INDEXES: StaticSchema = (16, n0, _VI, 0, (_m,), ((VECTOR_INDEX_INFO, 0),)) + +SOURCE_TABLE_FEATURE_DETAILS: StaticSchema = ( + 18, + n0, + _STFD, + 0, + (_LSI, _GSI, _SD, _TTLD, _SSED, _VI), + ( + (LOCAL_SECONDARY_INDEXES, 0), + (GLOBAL_SECONDARY_INDEXES, 0), + (STREAM_SPECIFICATION, 0), + (TIME_TO_LIVE_DESCRIPTION, 0), + (SSE_DESCRIPTION, 0), + (VECTOR_INDEXES, 0), + ), ) -STRING = Schema( - id=ShapeID("com.amazonaws.dynamodb#String"), shape_type=ShapeType.STRING +BACKUP_DESCRIPTION: StaticSchema = ( + 18, + n0, + _BDa, + 0, + (_BD, _STD, _STFD), + ((BACKUP_DETAILS, 0), (SOURCE_TABLE_DETAILS, 0), (SOURCE_TABLE_FEATURE_DETAILS, 0)), +) + +ERROR_MESSAGE: StaticSchema = (3, n0, _EM, 0) + +BACKUP_IN_USE_EXCEPTION: StaticSchema = ( + 18, + n0, + _BIUE, + {_sm: _c}, + (_me,), + ((ERROR_MESSAGE, 0),), +) + +BACKUP_NOT_FOUND_EXCEPTION: StaticSchema = ( + 18, + n0, + _BNFE, + {_sm: _c}, + (_me,), + ((ERROR_MESSAGE, 0),), +) + +BACKUPS_INPUT_LIMIT: StaticSchema = (7, n0, _BIL, 0) + +BACKUP_SUMMARY: StaticSchema = ( + 18, + n0, + _BSa, + 0, + (_TN, _TI, _TA, _BA, _BN, _BCDT, _BEDT, _BS, _BT, _BSB), + ( + (TABLE_NAME, 0), + (TABLE_ID, 0), + (TABLE_ARN, 0), + (BACKUP_ARN, 0), + (BACKUP_NAME, 0), + (BACKUP_CREATION_DATE_TIME, 0), + (DATE, 0), + (BACKUP_STATUS, 0), + (BACKUP_TYPE, 0), + (BACKUP_SIZE_BYTES, 0), + ), ) -POSITIVE_LONG_OBJECT = Schema( - id=ShapeID("com.amazonaws.dynamodb#PositiveLongObject"), shape_type=ShapeType.LONG -) +BACKUP_SUMMARIES: StaticSchema = (16, n0, _BSac, 0, (_m,), ((BACKUP_SUMMARY, 0),)) -AUTO_SCALING_SETTINGS_DESCRIPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#AutoScalingSettingsDescription"), - members={ - "MinimumUnits": {"target": POSITIVE_LONG_OBJECT}, - "MaximumUnits": {"target": POSITIVE_LONG_OBJECT}, - "AutoScalingDisabled": {"target": BOOLEAN_OBJECT}, - "AutoScalingRoleArn": {"target": STRING}, - "ScalingPolicies": {"target": AUTO_SCALING_POLICY_DESCRIPTION_LIST}, - }, +BACKUP_TYPE_FILTER: StaticSchema = ( + 14, + n0, + _BTF, + 0, + (_USER, _SYSTEM, _AB, _ALL), + ((-1, {_sV: _USER}), (-1, {_sV: _SYSTEM}), (-1, {_sV: _AB}), (-1, {_sV: _ALL})), ) -AUTO_SCALING_SETTINGS_UPDATE = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#AutoScalingSettingsUpdate"), - members={ - "MinimumUnits": {"target": POSITIVE_LONG_OBJECT}, - "MaximumUnits": {"target": POSITIVE_LONG_OBJECT}, - "AutoScalingDisabled": {"target": BOOLEAN_OBJECT}, - "AutoScalingRoleArn": {"target": AUTO_SCALING_ROLE_ARN}, - "ScalingPolicyUpdate": {"target": AUTO_SCALING_POLICY_UPDATE}, - }, +RETURN_CONSUMED_CAPACITY: StaticSchema = ( + 14, + n0, + _RCC, + 0, + (_INDEXES, _TOTAL, _NONE), + ((-1, {_sV: _INDEXES}), (-1, {_sV: _TOTAL}), (-1, {_sV: _NONE})), ) -AVAILABILITY_ERROR_MESSAGE = Schema( - id=ShapeID("com.amazonaws.dynamodb#AvailabilityErrorMessage"), - shape_type=ShapeType.STRING, -) +CONSISTENT_READ: StaticSchema = (2, n0, _CR, 0) -BACKFILLING = Schema( - id=ShapeID("com.amazonaws.dynamodb#Backfilling"), shape_type=ShapeType.BOOLEAN +RETURN_VALUES_ON_CONDITION_CHECK_FAILURE: StaticSchema = ( + 14, + n0, + _RVOCCF, + 0, + (_AO, _NONE), + ((-1, {_sV: _AO}), (-1, {_sV: _NONE})), ) -BACKUP_CREATION_DATE_TIME = Schema( - id=ShapeID("com.amazonaws.dynamodb#BackupCreationDateTime"), - shape_type=ShapeType.TIMESTAMP, -) +PARTI_QL_STATEMENT: StaticSchema = (3, n0, _PQLS, 0) -BACKUP_NAME = Schema( - id=ShapeID("com.amazonaws.dynamodb#BackupName"), shape_type=ShapeType.STRING -) +CONSUMED_CAPACITY_UNITS: StaticSchema = (10, n0, _CCU, 0) -BACKUP_SIZE_BYTES = Schema( - id=ShapeID("com.amazonaws.dynamodb#BackupSizeBytes"), shape_type=ShapeType.LONG +CAPACITY: StaticSchema = ( + 18, + n0, + _C, + 0, + (_RCU, _WCU, _CU), + ( + (CONSUMED_CAPACITY_UNITS, 0), + (CONSUMED_CAPACITY_UNITS, 0), + (CONSUMED_CAPACITY_UNITS, 0), + ), ) -BACKUP_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#BackupStatus"), - shape_type=ShapeType.ENUM, - members={ - "CREATING": {"target": UNIT}, - "DELETED": {"target": UNIT}, - "AVAILABLE": {"target": UNIT}, - }, +SECONDARY_INDEXES_CAPACITY_MAP: StaticSchema = ( + 17, + n0, + _SICM, + 0, + (_k, _v), + ((INDEX_NAME, 0), (CAPACITY, 0)), +) + +VECTOR_CAPACITY: StaticSchema = ( + 18, + n0, + _VC, + 0, + (_VSRB, _VWRB), + ((CONSUMED_CAPACITY_UNITS, 0), (CONSUMED_CAPACITY_UNITS, 0)), +) + +VECTOR_INDEXES_CAPACITY_MAP: StaticSchema = ( + 17, + n0, + _VICM, + 0, + (_k, _v), + ((INDEX_NAME, 0), (VECTOR_CAPACITY, 0)), +) + +CONSUMED_CAPACITY: StaticSchema = ( + 18, + n0, + _CC, + 0, + (_TN, _CU, _RCU, _WCU, _T, _LSI, _GSI, _VI), + ( + (TABLE_ARN, 0), + (CONSUMED_CAPACITY_UNITS, 0), + (CONSUMED_CAPACITY_UNITS, 0), + (CONSUMED_CAPACITY_UNITS, 0), + (CAPACITY, 0), + (SECONDARY_INDEXES_CAPACITY_MAP, 0), + (SECONDARY_INDEXES_CAPACITY_MAP, 0), + (VECTOR_INDEXES_CAPACITY_MAP, 0), + ), ) -BACKUP_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#BackupType"), - shape_type=ShapeType.ENUM, - members={ - "USER": {"target": UNIT}, - "SYSTEM": {"target": UNIT}, - "AWS_BACKUP": {"target": UNIT}, - }, +CONSUMED_CAPACITY_MULTIPLE: StaticSchema = ( + 16, + n0, + _CCM, + 0, + (_m,), + ((CONSUMED_CAPACITY, 0),), +) + +BATCH_STATEMENT_ERROR_CODE_ENUM: StaticSchema = ( + 14, + n0, + _BSECE, + 0, + (_CCF, _ICSLE, _RLE, _VE, _PTE, _TC, _TE, _ISE, _RNF, _ADc, _DI), + ( + (-1, {_sV: _CCF}), + (-1, {_sV: _ICSLE}), + (-1, {_sV: _RLE}), + (-1, {_sV: _VE}), + (-1, {_sV: _PTE}), + (-1, {_sV: _TC}), + (-1, {_sV: _TE}), + (-1, {_sV: _ISE}), + (-1, {_sV: _RNF}), + (-1, {_sV: _ADc}), + (-1, {_sV: _DI}), + ), ) -BACKUP_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#BackupDetails"), - members={ - "BackupArn": { - "target": BACKUP_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "BackupName": { - "target": BACKUP_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "BackupSizeBytes": {"target": BACKUP_SIZE_BYTES}, - "BackupStatus": { - "target": BACKUP_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "BackupType": { - "target": BACKUP_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "BackupCreationDateTime": { - "target": BACKUP_CREATION_DATE_TIME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "BackupExpiryDateTime": {"target": DATE}, - }, +INTERNAL_SERVER_ERROR: StaticSchema = ( + 18, + n0, + _ISE, + {_sm: _se}, + (_me,), + ((ERROR_MESSAGE, 0),), ) -BILLING_MODE = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#BillingMode"), - shape_type=ShapeType.ENUM, - members={"PROVISIONED": {"target": UNIT}, "PAY_PER_REQUEST": {"target": UNIT}}, -) +REASON: StaticSchema = (3, n0, _R, 0) -ITEM_COUNT = Schema( - id=ShapeID("com.amazonaws.dynamodb#ItemCount"), shape_type=ShapeType.LONG -) +RESOURCE: StaticSchema = (3, n0, _Re, 0) -KEY_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#KeyType"), - shape_type=ShapeType.ENUM, - members={"HASH": {"target": UNIT}, "RANGE": {"target": UNIT}}, +THROTTLING_REASON: StaticSchema = ( + 18, + n0, + _TR, + 0, + (_r, _re), + ((REASON, 0), (RESOURCE, 0)), ) -KEY_SCHEMA_ELEMENT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#KeySchemaElement"), - members={ - "AttributeName": { - "target": KEY_SCHEMA_ATTRIBUTE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "KeyType": { - "target": KEY_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +THROTTLING_REASON_LIST: StaticSchema = ( + 16, + n0, + _TRL, + 0, + (_m,), + ((THROTTLING_REASON, 0),), ) -KEY_SCHEMA = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#KeySchema"), - shape_type=ShapeType.LIST, - members={"member": {"target": KEY_SCHEMA_ELEMENT}}, +REQUEST_LIMIT_EXCEEDED: StaticSchema = ( + 18, + n0, + _RLE, + {_sm: _c}, + (_me, _TRh), + ((ERROR_MESSAGE, 0), (THROTTLING_REASON_LIST, 0)), ) -LONG_OBJECT = Schema( - id=ShapeID("com.amazonaws.dynamodb#LongObject"), shape_type=ShapeType.LONG +THROTTLING_EXCEPTION: StaticSchema = ( + 18, + n0, + _TEh, + {_sm: _c, _sE: 400}, + (_me, _tR), + ((AVAILABILITY_ERROR_MESSAGE, 0), (THROTTLING_REASON_LIST, 0)), ) -ON_DEMAND_THROUGHPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#OnDemandThroughput"), - members={ - "MaxReadRequestUnits": {"target": LONG_OBJECT}, - "MaxWriteRequestUnits": {"target": LONG_OBJECT}, - }, -) +EXPRESSION_ATTRIBUTE_NAME_VARIABLE: StaticSchema = (3, n0, _EANV, 0) -PROVISIONED_THROUGHPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ProvisionedThroughput"), - members={ - "ReadCapacityUnits": { - "target": POSITIVE_LONG_OBJECT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "WriteCapacityUnits": { - "target": POSITIVE_LONG_OBJECT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +EXPRESSION_ATTRIBUTE_NAME_MAP: StaticSchema = ( + 17, + n0, + _EANM, + 0, + (_k, _v), + ((EXPRESSION_ATTRIBUTE_NAME_VARIABLE, 0), (ATTRIBUTE_NAME, 0)), ) -TABLE_ARN = Schema( - id=ShapeID("com.amazonaws.dynamodb#TableArn"), shape_type=ShapeType.STRING -) - -TABLE_CREATION_DATE_TIME = Schema( - id=ShapeID("com.amazonaws.dynamodb#TableCreationDateTime"), - shape_type=ShapeType.TIMESTAMP, -) - -TABLE_ID = Schema( - id=ShapeID("com.amazonaws.dynamodb#TableId"), shape_type=ShapeType.STRING -) - -TABLE_NAME = Schema( - id=ShapeID("com.amazonaws.dynamodb#TableName"), shape_type=ShapeType.STRING -) - -SOURCE_TABLE_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#SourceTableDetails"), - members={ - "TableName": { - "target": TABLE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "TableId": { - "target": TABLE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "TableArn": {"target": TABLE_ARN}, - "TableSizeBytes": {"target": LONG_OBJECT}, - "KeySchema": { - "target": KEY_SCHEMA, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "TableCreationDateTime": { - "target": TABLE_CREATION_DATE_TIME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ProvisionedThroughput": { - "target": PROVISIONED_THROUGHPUT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "OnDemandThroughput": {"target": ON_DEMAND_THROUGHPUT}, - "ItemCount": {"target": ITEM_COUNT}, - "BillingMode": {"target": BILLING_MODE}, - }, +PROJECTION_EXPRESSION: StaticSchema = (3, n0, _PE, 0) + +INVALID_ENDPOINT_EXCEPTION: StaticSchema = ( + 18, + n0, + _IEE, + {_sm: _c, _sE: 421}, + (_M,), + ((STRING, 0),), +) + +PROVISIONED_THROUGHPUT_EXCEEDED_EXCEPTION: StaticSchema = ( + 18, + n0, + _PTEE, + {_sm: _c}, + (_me, _TRh), + ((ERROR_MESSAGE, 0), (THROTTLING_REASON_LIST, 0)), +) + +RESOURCE_NOT_FOUND_EXCEPTION: StaticSchema = ( + 18, + n0, + _RNFE, + {_sm: _c}, + (_me,), + ((ERROR_MESSAGE, 0),), +) + +RETURN_ITEM_COLLECTION_METRICS: StaticSchema = ( + 14, + n0, + _RICM, + 0, + (_SIZE, _NONE), + ((-1, {_sV: _SIZE}), (-1, {_sV: _NONE})), +) + +ITEM_COLLECTION_SIZE_ESTIMATE_BOUND: StaticSchema = (10, n0, _ICSEB, 0) + +ITEM_COLLECTION_SIZE_ESTIMATE_RANGE: StaticSchema = ( + 16, + n0, + _ICSER, + 0, + (_m,), + ((ITEM_COLLECTION_SIZE_ESTIMATE_BOUND, 0),), +) + +ITEM_COLLECTION_SIZE_LIMIT_EXCEEDED_EXCEPTION: StaticSchema = ( + 18, + n0, + _ICSLEE, + {_sm: _c}, + (_me,), + ((ERROR_MESSAGE, 0),), +) + +REPLICATED_WRITE_CONFLICT_EXCEPTION: StaticSchema = ( + 18, + n0, + _RWCE, + {_sm: _c}, + (_me,), + ((ERROR_MESSAGE, 0),), +) + +BILLED_SIZE_BYTES: StaticSchema = (8, n0, _BSBi, 0) + +BILLING_MODE_SUMMARY: StaticSchema = ( + 18, + n0, + _BMS, + 0, + (_BM, _LUTPPRDT), + ((BILLING_MODE, 0), (DATE, 0)), +) + +CODE: StaticSchema = (3, n0, _Co, 0) + +CLIENT_REQUEST_TOKEN: StaticSchema = (3, n0, _CRT, 0) + +CLIENT_TOKEN: StaticSchema = (3, n0, _CT, 0) + +CLOUD_WATCH_LOG_GROUP_ARN: StaticSchema = (3, n0, _CWLGA, 0) + +COMPARISON_OPERATOR: StaticSchema = ( + 14, + n0, + _CO, + 0, + (_EQ, _NE, _IN_, _LE, _LT, _GE, _GT, _BETWEEN, _NN, _NULL, _CONTAINS, _NC, _BW), + ( + (-1, {_sV: _EQ}), + (-1, {_sV: _NE}), + (-1, {_sV: _IN_}), + (-1, {_sV: _LE}), + (-1, {_sV: _LT}), + (-1, {_sV: _GE}), + (-1, {_sV: _GT}), + (-1, {_sV: _BETWEEN}), + (-1, {_sV: _NN}), + (-1, {_sV: _NULL}), + (-1, {_sV: _CONTAINS}), + (-1, {_sV: _NC}), + (-1, {_sV: _BW}), + ), ) -INDEX_NAME = Schema( - id=ShapeID("com.amazonaws.dynamodb#IndexName"), shape_type=ShapeType.STRING +CONDITIONAL_OPERATOR: StaticSchema = ( + 14, + n0, + _COo, + 0, + (_AND, _OR), + ((-1, {_sV: _AND}), (-1, {_sV: _OR})), ) -NON_KEY_ATTRIBUTE_NAME = Schema( - id=ShapeID("com.amazonaws.dynamodb#NonKeyAttributeName"), - shape_type=ShapeType.STRING, -) +CONDITION_EXPRESSION: StaticSchema = (3, n0, _CE, 0) -NON_KEY_ATTRIBUTE_NAME_LIST = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#NonKeyAttributeNameList"), - shape_type=ShapeType.LIST, - members={"member": {"target": NON_KEY_ATTRIBUTE_NAME}}, -) +EXPRESSION_ATTRIBUTE_VALUE_VARIABLE: StaticSchema = (3, n0, _EAVV, 0) -PROJECTION_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ProjectionType"), - shape_type=ShapeType.ENUM, - members={ - "ALL": {"target": UNIT}, - "KEYS_ONLY": {"target": UNIT}, - "INCLUDE": {"target": UNIT}, - }, -) +CONFIRM_REMOVE_SELF_RESOURCE_ACCESS: StaticSchema = (2, n0, _CRSRA, {_smi: False}) -PROJECTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#Projection"), - members={ - "ProjectionType": {"target": PROJECTION_TYPE}, - "NonKeyAttributes": {"target": NON_KEY_ATTRIBUTE_NAME_LIST}, - }, +CONTINUOUS_BACKUPS_STATUS: StaticSchema = ( + 14, + n0, + _CBS, + 0, + (_ENABLED, _DISABLED), + ((-1, {_sV: _ENABLED}), (-1, {_sV: _DISABLED})), ) -GLOBAL_SECONDARY_INDEX_INFO = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#GlobalSecondaryIndexInfo"), - members={ - "IndexName": {"target": INDEX_NAME}, - "KeySchema": {"target": KEY_SCHEMA}, - "Projection": {"target": PROJECTION}, - "ProvisionedThroughput": {"target": PROVISIONED_THROUGHPUT}, - "OnDemandThroughput": {"target": ON_DEMAND_THROUGHPUT}, - }, +POINT_IN_TIME_RECOVERY_STATUS: StaticSchema = ( + 14, + n0, + _PITRS, + 0, + (_ENABLED, _DISABLED), + ((-1, {_sV: _ENABLED}), (-1, {_sV: _DISABLED})), ) -GLOBAL_SECONDARY_INDEXES = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#GlobalSecondaryIndexes"), - shape_type=ShapeType.LIST, - members={"member": {"target": GLOBAL_SECONDARY_INDEX_INFO}}, -) +RECOVERY_PERIOD_IN_DAYS: StaticSchema = (7, n0, _RPID, 0) -LOCAL_SECONDARY_INDEX_INFO = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#LocalSecondaryIndexInfo"), - members={ - "IndexName": {"target": INDEX_NAME}, - "KeySchema": {"target": KEY_SCHEMA}, - "Projection": {"target": PROJECTION}, - }, +POINT_IN_TIME_RECOVERY_DESCRIPTION: StaticSchema = ( + 18, + n0, + _PITRD, + 0, + (_PITRS, _RPID, _ERDT, _LRDT), + ( + (POINT_IN_TIME_RECOVERY_STATUS, 0), + (RECOVERY_PERIOD_IN_DAYS, 0), + (DATE, 0), + (DATE, 0), + ), ) -LOCAL_SECONDARY_INDEXES = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#LocalSecondaryIndexes"), - shape_type=ShapeType.LIST, - members={"member": {"target": LOCAL_SECONDARY_INDEX_INFO}}, +CONTINUOUS_BACKUPS_DESCRIPTION: StaticSchema = ( + 18, + n0, + _CBD, + 0, + (_CBS, _PITRD), + ((CONTINUOUS_BACKUPS_STATUS, 1), (POINT_IN_TIME_RECOVERY_DESCRIPTION, 0)), +) + +CONTINUOUS_BACKUPS_UNAVAILABLE_EXCEPTION: StaticSchema = ( + 18, + n0, + _CBUE, + {_sm: _c}, + (_me,), + ((ERROR_MESSAGE, 0),), +) + +CONTRIBUTOR_INSIGHTS_ACTION: StaticSchema = ( + 14, + n0, + _CIA, + 0, + (_ENABLE, _DISABLE), + ((-1, {_sV: _ENABLE}), (-1, {_sV: _DISABLE})), +) + +CONTRIBUTOR_INSIGHTS_MODE: StaticSchema = ( + 14, + n0, + _CIM, + 0, + (_AATK, _TK), + ((-1, {_sV: _AATK}), (-1, {_sV: _TK})), +) + +CONTRIBUTOR_INSIGHTS_RULE: StaticSchema = (3, n0, _CIR, 0) + +CONTRIBUTOR_INSIGHTS_RULE_LIST: StaticSchema = ( + 16, + n0, + _CIRL, + 0, + (_m,), + ((CONTRIBUTOR_INSIGHTS_RULE, 0),), +) + +CONTRIBUTOR_INSIGHTS_STATUS: StaticSchema = ( + 14, + n0, + _CIS, + 0, + (_ENABLING, _ENABLED, _DISABLING, _DISABLED, _FAILED), + ( + (-1, {_sV: _ENABLING}), + (-1, {_sV: _ENABLED}), + (-1, {_sV: _DISABLING}), + (-1, {_sV: _DISABLED}), + (-1, {_sV: _FAILED}), + ), ) -KMS_MASTER_KEY_ARN = Schema( - id=ShapeID("com.amazonaws.dynamodb#KMSMasterKeyArn"), shape_type=ShapeType.STRING +CONTRIBUTOR_INSIGHTS_SUMMARY: StaticSchema = ( + 18, + n0, + _CISo, + 0, + (_TN, _IN, _CIS, _CIM), + ( + (TABLE_NAME, 0), + (INDEX_NAME, 0), + (CONTRIBUTOR_INSIGHTS_STATUS, 0), + (CONTRIBUTOR_INSIGHTS_MODE, 0), + ), ) -SSE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#SSEType"), - shape_type=ShapeType.ENUM, - members={"AES256": {"target": UNIT}, "KMS": {"target": UNIT}}, +CONTRIBUTOR_INSIGHTS_SUMMARIES: StaticSchema = ( + 16, + n0, + _CISon, + 0, + (_m,), + ((CONTRIBUTOR_INSIGHTS_SUMMARY, 0),), +) + +CREATE_BACKUP_INPUT: StaticSchema = ( + 18, + n0, + _CBI, + {_smit: None}, + (_TN, _BN), + ((TABLE_ARN, 1), (BACKUP_NAME, 1)), +) + +CREATE_BACKUP_OUTPUT: StaticSchema = ( + 18, + n0, + _CBO, + {_smith: None}, + (_BD,), + ((BACKUP_DETAILS, 0),), +) + +LIMIT_EXCEEDED_EXCEPTION: StaticSchema = ( + 18, + n0, + _LEE, + {_sm: _c}, + (_me,), + ((ERROR_MESSAGE, 0),), +) + +TABLE_IN_USE_EXCEPTION: StaticSchema = ( + 18, + n0, + _TIUE, + {_sm: _c}, + (_me,), + ((ERROR_MESSAGE, 0),), +) + +TABLE_NOT_FOUND_EXCEPTION: StaticSchema = ( + 18, + n0, + _TNFE, + {_sm: _c}, + (_me,), + ((ERROR_MESSAGE, 0),), +) + +CREATE_BACKUP: StaticOperationSchema = ( + 23, + n0, + _CB, + 0, + CREATE_BACKUP_INPUT, + CREATE_BACKUP_OUTPUT, + ( + BACKUP_IN_USE_EXCEPTION, + CONTINUOUS_BACKUPS_UNAVAILABLE_EXCEPTION, + INTERNAL_SERVER_ERROR, + INVALID_ENDPOINT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + TABLE_IN_USE_EXCEPTION, + TABLE_NOT_FOUND_EXCEPTION, + ), ) -SSE_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#SSEStatus"), - shape_type=ShapeType.ENUM, - members={ - "ENABLING": {"target": UNIT}, - "ENABLED": {"target": UNIT}, - "DISABLING": {"target": UNIT}, - "DISABLED": {"target": UNIT}, - "UPDATING": {"target": UNIT}, - }, +WARM_THROUGHPUT: StaticSchema = ( + 18, + n0, + _WT, + 0, + (_RUPS, _WUPS), + ((LONG_OBJECT, 0), (LONG_OBJECT, 0)), +) + +CREATE_GLOBAL_SECONDARY_INDEX_ACTION: StaticSchema = ( + 18, + n0, + _CGSIA, + 0, + (_IN, _KS, _P, _PT, _ODT, _WT), + ( + (INDEX_NAME, 1), + (KEY_SCHEMA, 1), + (PROJECTION, 1), + (PROVISIONED_THROUGHPUT, 0), + (ON_DEMAND_THROUGHPUT, 0), + (WARM_THROUGHPUT, 0), + ), ) -SSE_DESCRIPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#SSEDescription"), - members={ - "Status": {"target": SSE_STATUS}, - "SSEType": {"target": SSE_TYPE}, - "KMSMasterKeyArn": {"target": KMS_MASTER_KEY_ARN}, - "InaccessibleEncryptionDateTime": {"target": DATE}, - }, -) +REGION_NAME: StaticSchema = (3, n0, _RN, 0) -STREAM_ENABLED = Schema( - id=ShapeID("com.amazonaws.dynamodb#StreamEnabled"), shape_type=ShapeType.BOOLEAN -) +REPLICA: StaticSchema = (18, n0, _Rep, 0, (_RN,), ((REGION_NAME, 0),)) -STREAM_VIEW_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#StreamViewType"), - shape_type=ShapeType.ENUM, - members={ - "NEW_IMAGE": {"target": UNIT}, - "OLD_IMAGE": {"target": UNIT}, - "NEW_AND_OLD_IMAGES": {"target": UNIT}, - "KEYS_ONLY": {"target": UNIT}, - }, -) +REPLICA_LIST: StaticSchema = (16, n0, _RL, 0, (_m,), ((REPLICA, 0),)) -STREAM_SPECIFICATION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#StreamSpecification"), - members={ - "StreamEnabled": { - "target": STREAM_ENABLED, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "StreamViewType": {"target": STREAM_VIEW_TYPE}, - }, +CREATE_GLOBAL_TABLE_INPUT: StaticSchema = ( + 18, + n0, + _CGTI, + {_smit: None}, + (_GTN, _RG), + ((TABLE_NAME, 1), (REPLICA_LIST, 1)), ) -TIME_TO_LIVE_ATTRIBUTE_NAME = Schema( - id=ShapeID("com.amazonaws.dynamodb#TimeToLiveAttributeName"), - shape_type=ShapeType.STRING, -) +GLOBAL_TABLE_ARN_STRING: StaticSchema = (3, n0, _GTAS, 0) -TIME_TO_LIVE_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#TimeToLiveStatus"), - shape_type=ShapeType.ENUM, - members={ - "ENABLING": {"target": UNIT}, - "DISABLING": {"target": UNIT}, - "ENABLED": {"target": UNIT}, - "DISABLED": {"target": UNIT}, - }, +GLOBAL_TABLE_STATUS: StaticSchema = ( + 14, + n0, + _GTS, + 0, + (_CREATING, _ACTIVE, _DELETING, _UPDATING), + ( + (-1, {_sV: _CREATING}), + (-1, {_sV: _ACTIVE}), + (-1, {_sV: _DELETING}), + (-1, {_sV: _UPDATING}), + ), ) -TIME_TO_LIVE_DESCRIPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#TimeToLiveDescription"), - members={ - "TimeToLiveStatus": {"target": TIME_TO_LIVE_STATUS}, - "AttributeName": {"target": TIME_TO_LIVE_ATTRIBUTE_NAME}, - }, +ON_DEMAND_THROUGHPUT_OVERRIDE: StaticSchema = ( + 18, + n0, + _ODTO, + 0, + (_MRRU,), + ((LONG_OBJECT, 0),), +) + +PROVISIONED_THROUGHPUT_OVERRIDE: StaticSchema = ( + 18, + n0, + _PTO, + 0, + (_RCU,), + ((POSITIVE_LONG_OBJECT, 0),), +) + +INDEX_STATUS: StaticSchema = ( + 14, + n0, + _IS, + 0, + (_CREATING, _UPDATING, _DELETING, _ACTIVE), + ( + (-1, {_sV: _CREATING}), + (-1, {_sV: _UPDATING}), + (-1, {_sV: _DELETING}), + (-1, {_sV: _ACTIVE}), + ), ) -VECTOR_DISTANCE_FUNCTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#VectorDistanceFunction"), - shape_type=ShapeType.ENUM, - members={ - "COSINE": {"target": UNIT}, - "DOT_PRODUCT": {"target": UNIT}, - "EUCLIDEAN": {"target": UNIT}, - }, +GLOBAL_SECONDARY_INDEX_WARM_THROUGHPUT_DESCRIPTION: StaticSchema = ( + 18, + n0, + _GSIWTD, + 0, + (_RUPS, _WUPS, _Sta), + ((POSITIVE_LONG_OBJECT, 0), (POSITIVE_LONG_OBJECT, 0), (INDEX_STATUS, 0)), +) + +REPLICA_GLOBAL_SECONDARY_INDEX_DESCRIPTION: StaticSchema = ( + 18, + n0, + _RGSID, + 0, + (_IN, _PTO, _ODTO, _WT), + ( + (INDEX_NAME, 0), + (PROVISIONED_THROUGHPUT_OVERRIDE, 0), + (ON_DEMAND_THROUGHPUT_OVERRIDE, 0), + (GLOBAL_SECONDARY_INDEX_WARM_THROUGHPUT_DESCRIPTION, 0), + ), ) -SEARCH_SCHEMA_ELEMENT_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#SearchSchemaElementType"), - shape_type=ShapeType.ENUM, - members={"HASH": {"target": UNIT}, "INLINE_FILTER": {"target": UNIT}}, +REPLICA_GLOBAL_SECONDARY_INDEX_DESCRIPTION_LIST: StaticSchema = ( + 16, + n0, + _RGSIDL, + 0, + (_m,), + ((REPLICA_GLOBAL_SECONDARY_INDEX_DESCRIPTION, 0),), +) + +GLOBAL_TABLE_SETTINGS_REPLICATION_MODE: StaticSchema = ( + 14, + n0, + _GTSRM, + 0, + (_ENABLED, _DISABLED, _EWO), + ((-1, {_sV: _ENABLED}), (-1, {_sV: _DISABLED}), (-1, {_sV: _EWO})), +) + +KMS_MASTER_KEY_ID: StaticSchema = (3, n0, _KMSMKI, 0) + +REPLICA_STATUS: StaticSchema = ( + 14, + n0, + _RS, + 0, + ( + _CREATING, + _CF, + _UPDATING, + _DELETING, + _ACTIVE, + _RD, + _IEC, + _ARCHIVING, + _ARCHIVED, + _RNA, + ), + ( + (-1, {_sV: _CREATING}), + (-1, {_sV: _CF}), + (-1, {_sV: _UPDATING}), + (-1, {_sV: _DELETING}), + (-1, {_sV: _ACTIVE}), + (-1, {_sV: _RD}), + (-1, {_sV: _IEC}), + (-1, {_sV: _ARCHIVING}), + (-1, {_sV: _ARCHIVED}), + (-1, {_sV: _RNA}), + ), ) -SEARCH_SCHEMA_ELEMENT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#SearchSchemaElement"), - members={ - "AttributeName": { - "target": ATTRIBUTE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "SearchSchemaElementType": { - "target": SEARCH_SCHEMA_ELEMENT_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +REPLICA_STATUS_DESCRIPTION: StaticSchema = (3, n0, _RSD, 0) + +REPLICA_STATUS_PERCENT_PROGRESS: StaticSchema = (3, n0, _RSPP, 0) + +TABLE_CLASS: StaticSchema = ( + 14, + n0, + _TCa, + 0, + (_STANDARD, _SIA), + ((-1, {_sV: _STANDARD}), (-1, {_sV: _SIA})), +) + +TABLE_CLASS_SUMMARY: StaticSchema = ( + 18, + n0, + _TCS, + 0, + (_TCa, _LUDT), + ((TABLE_CLASS, 0), (DATE, 0)), +) + +TABLE_STATUS: StaticSchema = ( + 14, + n0, + _TS, + 0, + (_CREATING, _UPDATING, _DELETING, _ACTIVE, _IEC, _ARCHIVING, _ARCHIVED, _RNA), + ( + (-1, {_sV: _CREATING}), + (-1, {_sV: _UPDATING}), + (-1, {_sV: _DELETING}), + (-1, {_sV: _ACTIVE}), + (-1, {_sV: _IEC}), + (-1, {_sV: _ARCHIVING}), + (-1, {_sV: _ARCHIVED}), + (-1, {_sV: _RNA}), + ), ) -SEARCH_SCHEMA = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#SearchSchema"), - shape_type=ShapeType.LIST, - members={"member": {"target": SEARCH_SCHEMA_ELEMENT}}, +TABLE_WARM_THROUGHPUT_DESCRIPTION: StaticSchema = ( + 18, + n0, + _TWTD, + 0, + (_RUPS, _WUPS, _Sta), + ((POSITIVE_LONG_OBJECT, 0), (POSITIVE_LONG_OBJECT, 0), (TABLE_STATUS, 0)), +) + +REPLICA_DESCRIPTION: StaticSchema = ( + 18, + n0, + _RDe, + 0, + (_RN, _RS, _RA, _RSD, _RSPP, _KMSMKI, _PTO, _ODTO, _WT, _GSI, _RIDT, _RTCS, _GTSRM), + ( + (REGION_NAME, 0), + (REPLICA_STATUS, 0), + (STRING, 0), + (REPLICA_STATUS_DESCRIPTION, 0), + (REPLICA_STATUS_PERCENT_PROGRESS, 0), + (KMS_MASTER_KEY_ID, 0), + (PROVISIONED_THROUGHPUT_OVERRIDE, 0), + (ON_DEMAND_THROUGHPUT_OVERRIDE, 0), + (TABLE_WARM_THROUGHPUT_DESCRIPTION, 0), + (REPLICA_GLOBAL_SECONDARY_INDEX_DESCRIPTION_LIST, 0), + (DATE, 0), + (TABLE_CLASS_SUMMARY, 0), + (GLOBAL_TABLE_SETTINGS_REPLICATION_MODE, 0), + ), ) -VECTOR_ATTRIBUTE_NAME = Schema( - id=ShapeID("com.amazonaws.dynamodb#VectorAttributeName"), - shape_type=ShapeType.STRING, +REPLICA_DESCRIPTION_LIST: StaticSchema = ( + 16, + n0, + _RDL, + 0, + (_m,), + ((REPLICA_DESCRIPTION, 0),), +) + +GLOBAL_TABLE_DESCRIPTION: StaticSchema = ( + 18, + n0, + _GTD, + 0, + (_RG, _GTA, _CDT, _GTS, _GTN), + ( + (REPLICA_DESCRIPTION_LIST, 0), + (GLOBAL_TABLE_ARN_STRING, 0), + (DATE, 0), + (GLOBAL_TABLE_STATUS, 0), + (TABLE_NAME, 0), + ), ) -VECTOR_ATTRIBUTE_DEFINITION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#VectorAttributeDefinition"), - members={ - "AttributeName": { - "target": VECTOR_ATTRIBUTE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +CREATE_GLOBAL_TABLE_OUTPUT: StaticSchema = ( + 18, + n0, + _CGTO, + {_smith: None}, + (_GTD,), + ((GLOBAL_TABLE_DESCRIPTION, 0),), +) + +GLOBAL_TABLE_ALREADY_EXISTS_EXCEPTION: StaticSchema = ( + 18, + n0, + _GTAEE, + {_sm: _c}, + (_me,), + ((ERROR_MESSAGE, 0),), +) + +CREATE_GLOBAL_TABLE: StaticOperationSchema = ( + 23, + n0, + _CGT, + 0, + CREATE_GLOBAL_TABLE_INPUT, + CREATE_GLOBAL_TABLE_OUTPUT, + ( + GLOBAL_TABLE_ALREADY_EXISTS_EXCEPTION, + INTERNAL_SERVER_ERROR, + INVALID_ENDPOINT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + TABLE_NOT_FOUND_EXCEPTION, + ), ) -VECTOR_INDEX_INFO = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#VectorIndexInfo"), - members={ - "IndexName": {"target": INDEX_NAME}, - "VectorAttribute": {"target": VECTOR_ATTRIBUTE_DEFINITION}, - "SearchSchema": {"target": SEARCH_SCHEMA}, - "Projection": {"target": PROJECTION}, - "Dimensions": {"target": POSITIVE_LONG_OBJECT}, - "DistanceFunction": {"target": VECTOR_DISTANCE_FUNCTION}, - }, +CREATE_GLOBAL_TABLE_WITNESS_GROUP_MEMBER_ACTION: StaticSchema = ( + 18, + n0, + _CGTWGMA, + 0, + (_RN,), + ((REGION_NAME, 1),), ) -VECTOR_INDEXES = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#VectorIndexes"), - shape_type=ShapeType.LIST, - members={"member": {"target": VECTOR_INDEX_INFO}}, -) +CREATE_REPLICA_ACTION: StaticSchema = (18, n0, _CRA, 0, (_RN,), ((REGION_NAME, 1),)) -SOURCE_TABLE_FEATURE_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#SourceTableFeatureDetails"), - members={ - "LocalSecondaryIndexes": {"target": LOCAL_SECONDARY_INDEXES}, - "GlobalSecondaryIndexes": {"target": GLOBAL_SECONDARY_INDEXES}, - "StreamDescription": {"target": STREAM_SPECIFICATION}, - "TimeToLiveDescription": {"target": TIME_TO_LIVE_DESCRIPTION}, - "SSEDescription": {"target": SSE_DESCRIPTION}, - "VectorIndexes": {"target": VECTOR_INDEXES}, - }, +REPLICA_GLOBAL_SECONDARY_INDEX: StaticSchema = ( + 18, + n0, + _RGSI, + 0, + (_IN, _PTO, _ODTO), + ( + (INDEX_NAME, 1), + (PROVISIONED_THROUGHPUT_OVERRIDE, 0), + (ON_DEMAND_THROUGHPUT_OVERRIDE, 0), + ), ) -BACKUP_DESCRIPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#BackupDescription"), - members={ - "BackupDetails": {"target": BACKUP_DETAILS}, - "SourceTableDetails": {"target": SOURCE_TABLE_DETAILS}, - "SourceTableFeatureDetails": {"target": SOURCE_TABLE_FEATURE_DETAILS}, - }, +REPLICA_GLOBAL_SECONDARY_INDEX_LIST: StaticSchema = ( + 16, + n0, + _RGSIL, + 0, + (_m,), + ((REPLICA_GLOBAL_SECONDARY_INDEX, 0),), +) + +CREATE_REPLICATION_GROUP_MEMBER_ACTION: StaticSchema = ( + 18, + n0, + _CRGMA, + 0, + (_RN, _KMSMKI, _PTO, _ODTO, _GSI, _TCO), + ( + (REGION_NAME, 1), + (KMS_MASTER_KEY_ID, 0), + (PROVISIONED_THROUGHPUT_OVERRIDE, 0), + (ON_DEMAND_THROUGHPUT_OVERRIDE, 0), + (REPLICA_GLOBAL_SECONDARY_INDEX_LIST, 0), + (TABLE_CLASS, 0), + ), ) -ERROR_MESSAGE = Schema( - id=ShapeID("com.amazonaws.dynamodb#ErrorMessage"), shape_type=ShapeType.STRING +DELETION_PROTECTION_ENABLED: StaticSchema = (2, n0, _DPE, 0) + +GLOBAL_SECONDARY_INDEX: StaticSchema = ( + 18, + n0, + _GSIl, + 0, + (_IN, _KS, _P, _PT, _ODT, _WT), + ( + (INDEX_NAME, 1), + (KEY_SCHEMA, 1), + (PROJECTION, 1), + (PROVISIONED_THROUGHPUT, 0), + (ON_DEMAND_THROUGHPUT, 0), + (WARM_THROUGHPUT, 0), + ), ) -BACKUP_IN_USE_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#BackupInUseException"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], - members={"message": {"target": ERROR_MESSAGE}}, +GLOBAL_SECONDARY_INDEX_LIST: StaticSchema = ( + 16, + n0, + _GSIL, + 0, + (_m,), + ((GLOBAL_SECONDARY_INDEX, 0),), ) -BACKUP_NOT_FOUND_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#BackupNotFoundException"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], - members={"message": {"target": ERROR_MESSAGE}}, +LOCAL_SECONDARY_INDEX: StaticSchema = ( + 18, + n0, + _LSIo, + 0, + (_IN, _KS, _P), + ((INDEX_NAME, 1), (KEY_SCHEMA, 1), (PROJECTION, 1)), ) -BACKUPS_INPUT_LIMIT = Schema( - id=ShapeID("com.amazonaws.dynamodb#BackupsInputLimit"), shape_type=ShapeType.INTEGER +LOCAL_SECONDARY_INDEX_LIST: StaticSchema = ( + 16, + n0, + _LSIL, + 0, + (_m,), + ((LOCAL_SECONDARY_INDEX, 0),), ) -BACKUP_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#BackupSummary"), - members={ - "TableName": {"target": TABLE_NAME}, - "TableId": {"target": TABLE_ID}, - "TableArn": {"target": TABLE_ARN}, - "BackupArn": {"target": BACKUP_ARN}, - "BackupName": {"target": BACKUP_NAME}, - "BackupCreationDateTime": {"target": BACKUP_CREATION_DATE_TIME}, - "BackupExpiryDateTime": {"target": DATE}, - "BackupStatus": {"target": BACKUP_STATUS}, - "BackupType": {"target": BACKUP_TYPE}, - "BackupSizeBytes": {"target": BACKUP_SIZE_BYTES}, - }, -) +RESOURCE_POLICY: StaticSchema = (3, n0, _RP, 0) -BACKUP_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#BackupSummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": BACKUP_SUMMARY}}, -) +SSE_ENABLED: StaticSchema = (2, n0, _SSEE, 0) -BACKUP_TYPE_FILTER = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#BackupTypeFilter"), - shape_type=ShapeType.ENUM, - members={ - "USER": {"target": UNIT}, - "SYSTEM": {"target": UNIT}, - "AWS_BACKUP": {"target": UNIT}, - "ALL": {"target": UNIT}, - }, +SSE_SPECIFICATION: StaticSchema = ( + 18, + n0, + _SSESp, + 0, + (_E, _SSET, _KMSMKI), + ((SSE_ENABLED, 0), (SSE_TYPE, 0), (KMS_MASTER_KEY_ID, 0)), ) -RETURN_CONSUMED_CAPACITY = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ReturnConsumedCapacity"), - shape_type=ShapeType.ENUM, - members={ - "INDEXES": {"target": UNIT}, - "TOTAL": {"target": UNIT}, - "NONE": {"target": UNIT}, - }, -) +TAG_KEY_STRING: StaticSchema = (3, n0, _TKS, 0) -CONSISTENT_READ = Schema( - id=ShapeID("com.amazonaws.dynamodb#ConsistentRead"), shape_type=ShapeType.BOOLEAN -) +TAG_VALUE_STRING: StaticSchema = (3, n0, _TVS, 0) -RETURN_VALUES_ON_CONDITION_CHECK_FAILURE = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ReturnValuesOnConditionCheckFailure"), - shape_type=ShapeType.ENUM, - members={"ALL_OLD": {"target": UNIT}, "NONE": {"target": UNIT}}, +TAG: StaticSchema = ( + 18, + n0, + _Ta, + 0, + (_K, _V), + ((TAG_KEY_STRING, 1), (TAG_VALUE_STRING, 1)), ) -PARTI_QL_STATEMENT = Schema( - id=ShapeID("com.amazonaws.dynamodb#PartiQLStatement"), shape_type=ShapeType.STRING -) +TAG_LIST: StaticSchema = (16, n0, _TL, 0, (_m,), ((TAG, 0),)) -CONSUMED_CAPACITY_UNITS = Schema( - id=ShapeID("com.amazonaws.dynamodb#ConsumedCapacityUnits"), - shape_type=ShapeType.DOUBLE, +VECTOR_INDEX: StaticSchema = ( + 18, + n0, + _VIe, + 0, + (_IN, _VA, _SSe, _P, _Di, _DF), + ( + (INDEX_NAME, 1), + (VECTOR_ATTRIBUTE_DEFINITION, 1), + (SEARCH_SCHEMA, 0), + (PROJECTION, 1), + (POSITIVE_LONG_OBJECT, 1), + (VECTOR_DISTANCE_FUNCTION, 1), + ), ) -CAPACITY = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#Capacity"), - members={ - "ReadCapacityUnits": {"target": CONSUMED_CAPACITY_UNITS}, - "WriteCapacityUnits": {"target": CONSUMED_CAPACITY_UNITS}, - "CapacityUnits": {"target": CONSUMED_CAPACITY_UNITS}, - }, +VECTOR_INDEX_LIST: StaticSchema = (16, n0, _VIL, 0, (_m,), ((VECTOR_INDEX, 0),)) + +CREATE_TABLE_INPUT: StaticSchema = ( + 18, + n0, + _CTI, + {_smit: None}, + ( + _ADt, + _TN, + _KS, + _LSI, + _GSI, + _BM, + _PT, + _SS, + _SSESp, + _Tag, + _TCa, + _DPE, + _WT, + _RP, + _ODT, + _GTSA, + _GTSRM, + _VI, + ), + ( + (ATTRIBUTE_DEFINITIONS, 0), + (TABLE_ARN, 1), + (KEY_SCHEMA, 0), + (LOCAL_SECONDARY_INDEX_LIST, 0), + (GLOBAL_SECONDARY_INDEX_LIST, 0), + (BILLING_MODE, 0), + (PROVISIONED_THROUGHPUT, 0), + (STREAM_SPECIFICATION, 0), + (SSE_SPECIFICATION, 0), + (TAG_LIST, 0), + (TABLE_CLASS, 0), + (DELETION_PROTECTION_ENABLED, 0), + (WARM_THROUGHPUT, 0), + (RESOURCE_POLICY, 0), + (ON_DEMAND_THROUGHPUT, 0), + (TABLE_ARN, 0), + (GLOBAL_TABLE_SETTINGS_REPLICATION_MODE, 0), + (VECTOR_INDEX_LIST, 0), + ), ) -SECONDARY_INDEXES_CAPACITY_MAP = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#SecondaryIndexesCapacityMap"), - shape_type=ShapeType.MAP, - members={"key": {"target": INDEX_NAME}, "value": {"target": CAPACITY}}, +NON_NEGATIVE_LONG_OBJECT: StaticSchema = (8, n0, _NNLO, 0) + +PROVISIONED_THROUGHPUT_DESCRIPTION: StaticSchema = ( + 18, + n0, + _PTD, + 0, + (_LIDT, _LDDT, _NODT, _RCU, _WCU), + ( + (DATE, 0), + (DATE, 0), + (POSITIVE_LONG_OBJECT, 0), + (NON_NEGATIVE_LONG_OBJECT, 0), + (NON_NEGATIVE_LONG_OBJECT, 0), + ), ) -VECTOR_CAPACITY = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#VectorCapacity"), - members={ - "VectorSearchRequestBytes": {"target": CONSUMED_CAPACITY_UNITS}, - "VectorWriteRequestBytes": {"target": CONSUMED_CAPACITY_UNITS}, - }, +GLOBAL_SECONDARY_INDEX_DESCRIPTION: StaticSchema = ( + 18, + n0, + _GSID, + 0, + (_IN, _KS, _P, _IS, _Ba, _PT, _ISB, _IC, _IA, _ODT, _WT), + ( + (INDEX_NAME, 0), + (KEY_SCHEMA, 0), + (PROJECTION, 0), + (INDEX_STATUS, 0), + (BACKFILLING, 0), + (PROVISIONED_THROUGHPUT_DESCRIPTION, 0), + (LONG_OBJECT, 0), + (LONG_OBJECT, 0), + (STRING, 0), + (ON_DEMAND_THROUGHPUT, 0), + (GLOBAL_SECONDARY_INDEX_WARM_THROUGHPUT_DESCRIPTION, 0), + ), ) -VECTOR_INDEXES_CAPACITY_MAP = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#VectorIndexesCapacityMap"), - shape_type=ShapeType.MAP, - members={"key": {"target": INDEX_NAME}, "value": {"target": VECTOR_CAPACITY}}, +GLOBAL_SECONDARY_INDEX_DESCRIPTION_LIST: StaticSchema = ( + 16, + n0, + _GSIDL, + 0, + (_m,), + ((GLOBAL_SECONDARY_INDEX_DESCRIPTION, 0),), +) + +WITNESS_STATUS: StaticSchema = ( + 14, + n0, + _WS, + 0, + (_CREATING, _DELETING, _ACTIVE), + ((-1, {_sV: _CREATING}), (-1, {_sV: _DELETING}), (-1, {_sV: _ACTIVE})), +) + +GLOBAL_TABLE_WITNESS_DESCRIPTION: StaticSchema = ( + 18, + n0, + _GTWD, + 0, + (_RN, _WS), + ((REGION_NAME, 0), (WITNESS_STATUS, 0)), +) + +GLOBAL_TABLE_WITNESS_DESCRIPTION_LIST: StaticSchema = ( + 16, + n0, + _GTWDL, + 0, + (_m,), + ((GLOBAL_TABLE_WITNESS_DESCRIPTION, 0),), +) + +STREAM_ARN: StaticSchema = (3, n0, _SA, 0) + +LOCAL_SECONDARY_INDEX_DESCRIPTION: StaticSchema = ( + 18, + n0, + _LSID, + 0, + (_IN, _KS, _P, _ISB, _IC, _IA), + ( + (INDEX_NAME, 0), + (KEY_SCHEMA, 0), + (PROJECTION, 0), + (LONG_OBJECT, 0), + (LONG_OBJECT, 0), + (STRING, 0), + ), ) -CONSUMED_CAPACITY = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ConsumedCapacity"), - members={ - "TableName": {"target": TABLE_ARN}, - "CapacityUnits": {"target": CONSUMED_CAPACITY_UNITS}, - "ReadCapacityUnits": {"target": CONSUMED_CAPACITY_UNITS}, - "WriteCapacityUnits": {"target": CONSUMED_CAPACITY_UNITS}, - "Table": {"target": CAPACITY}, - "LocalSecondaryIndexes": {"target": SECONDARY_INDEXES_CAPACITY_MAP}, - "GlobalSecondaryIndexes": {"target": SECONDARY_INDEXES_CAPACITY_MAP}, - "VectorIndexes": {"target": VECTOR_INDEXES_CAPACITY_MAP}, - }, +LOCAL_SECONDARY_INDEX_DESCRIPTION_LIST: StaticSchema = ( + 16, + n0, + _LSIDL, + 0, + (_m,), + ((LOCAL_SECONDARY_INDEX_DESCRIPTION, 0),), +) + +MULTI_REGION_CONSISTENCY: StaticSchema = ( + 14, + n0, + _MRC, + 0, + (_EVENTUAL, _STRONG), + ((-1, {_sV: _EVENTUAL}), (-1, {_sV: _STRONG})), +) + +RESTORE_IN_PROGRESS: StaticSchema = (2, n0, _RIP, 0) + +RESTORE_SUMMARY: StaticSchema = ( + 18, + n0, + _RSe, + 0, + (_SBA, _STA, _RDT, _RIP), + ((BACKUP_ARN, 0), (TABLE_ARN, 0), (DATE, 1), (RESTORE_IN_PROGRESS, 1)), +) + +VECTOR_INDEX_DESCRIPTION: StaticSchema = ( + 18, + n0, + _VID, + 0, + (_IN, _SSe, _P, _VA, _Di, _DF, _IS, _Ba, _ISB, _IC, _IA), + ( + (INDEX_NAME, 0), + (SEARCH_SCHEMA, 0), + (PROJECTION, 0), + (VECTOR_ATTRIBUTE_DEFINITION, 0), + (POSITIVE_LONG_OBJECT, 0), + (VECTOR_DISTANCE_FUNCTION, 0), + (INDEX_STATUS, 0), + (BACKFILLING, 0), + (LONG_OBJECT, 0), + (LONG_OBJECT, 0), + (STRING, 0), + ), ) -CONSUMED_CAPACITY_MULTIPLE = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ConsumedCapacityMultiple"), - shape_type=ShapeType.LIST, - members={"member": {"target": CONSUMED_CAPACITY}}, -) - -BATCH_STATEMENT_ERROR_CODE_ENUM = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#BatchStatementErrorCodeEnum"), - shape_type=ShapeType.ENUM, - members={ - "ConditionalCheckFailed": {"target": UNIT}, - "ItemCollectionSizeLimitExceeded": {"target": UNIT}, - "RequestLimitExceeded": {"target": UNIT}, - "ValidationError": {"target": UNIT}, - "ProvisionedThroughputExceeded": {"target": UNIT}, - "TransactionConflict": {"target": UNIT}, - "ThrottlingError": {"target": UNIT}, - "InternalServerError": {"target": UNIT}, - "ResourceNotFound": {"target": UNIT}, - "AccessDenied": {"target": UNIT}, - "DuplicateItem": {"target": UNIT}, - }, +VECTOR_INDEX_DESCRIPTION_LIST: StaticSchema = ( + 16, + n0, + _VIDL, + 0, + (_m,), + ((VECTOR_INDEX_DESCRIPTION, 0),), +) + +TABLE_DESCRIPTION: StaticSchema = ( + 18, + n0, + _TD, + 0, + ( + _ADt, + _TN, + _KS, + _TS, + _CDT, + _PT, + _TSB, + _IC, + _TA, + _TI, + _BMS, + _LSI, + _GSI, + _SS, + _LSL, + _LSA, + _GTV, + _Repl, + _GTW, + _GTSRM, + _RSe, + _SSED, + _AS, + _TCS, + _DPE, + _ODT, + _WT, + _MRC, + _VI, + ), + ( + (ATTRIBUTE_DEFINITIONS, 0), + (TABLE_NAME, 0), + (KEY_SCHEMA, 0), + (TABLE_STATUS, 0), + (DATE, 0), + (PROVISIONED_THROUGHPUT_DESCRIPTION, 0), + (LONG_OBJECT, 0), + (LONG_OBJECT, 0), + (STRING, 0), + (TABLE_ID, 0), + (BILLING_MODE_SUMMARY, 0), + (LOCAL_SECONDARY_INDEX_DESCRIPTION_LIST, 0), + (GLOBAL_SECONDARY_INDEX_DESCRIPTION_LIST, 0), + (STREAM_SPECIFICATION, 0), + (STRING, 0), + (STREAM_ARN, 0), + (STRING, 0), + (REPLICA_DESCRIPTION_LIST, 0), + (GLOBAL_TABLE_WITNESS_DESCRIPTION_LIST, 0), + (GLOBAL_TABLE_SETTINGS_REPLICATION_MODE, 0), + (RESTORE_SUMMARY, 0), + (SSE_DESCRIPTION, 0), + (ARCHIVAL_SUMMARY, 0), + (TABLE_CLASS_SUMMARY, 0), + (DELETION_PROTECTION_ENABLED, 0), + (ON_DEMAND_THROUGHPUT, 0), + (TABLE_WARM_THROUGHPUT_DESCRIPTION, 0), + (MULTI_REGION_CONSISTENCY, 0), + (VECTOR_INDEX_DESCRIPTION_LIST, 0), + ), ) -INTERNAL_SERVER_ERROR = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#InternalServerError"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="server")], - members={"message": {"target": ERROR_MESSAGE}}, +CREATE_TABLE_OUTPUT: StaticSchema = ( + 18, + n0, + _CTO, + {_smith: None}, + (_TD,), + ((TABLE_DESCRIPTION, 0),), +) + +RESOURCE_IN_USE_EXCEPTION: StaticSchema = ( + 18, + n0, + _RIUE, + {_sm: _c}, + (_me,), + ((ERROR_MESSAGE, 0),), +) + +CREATE_TABLE: StaticOperationSchema = ( + 23, + n0, + _CTr, + 0, + CREATE_TABLE_INPUT, + CREATE_TABLE_OUTPUT, + ( + INTERNAL_SERVER_ERROR, + INVALID_ENDPOINT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + RESOURCE_IN_USE_EXCEPTION, + ), ) -REASON = Schema( - id=ShapeID("com.amazonaws.dynamodb#Reason"), shape_type=ShapeType.STRING +CREATE_VECTOR_INDEX_ACTION: StaticSchema = ( + 18, + n0, + _CVIA, + 0, + (_IN, _VA, _SSe, _P, _Di, _DF), + ( + (INDEX_NAME, 1), + (VECTOR_ATTRIBUTE_DEFINITION, 1), + (SEARCH_SCHEMA, 0), + (PROJECTION, 1), + (POSITIVE_LONG_OBJECT, 1), + (VECTOR_DISTANCE_FUNCTION, 1), + ), ) -RESOURCE = Schema( - id=ShapeID("com.amazonaws.dynamodb#Resource"), shape_type=ShapeType.STRING +CSV_DELIMITER: StaticSchema = (3, n0, _CD, 0) + +CSV_HEADER: StaticSchema = (3, n0, _CH, 0) + +CSV_HEADER_LIST: StaticSchema = (16, n0, _CHL, 0, (_m,), ((CSV_HEADER, 0),)) + +CSV_OPTIONS: StaticSchema = ( + 18, + n0, + _COs, + 0, + (_De, _HL), + ((CSV_DELIMITER, 0), (CSV_HEADER_LIST, 0)), +) + +DELETE_BACKUP_INPUT: StaticSchema = ( + 18, + n0, + _DBI, + {_smit: None}, + (_BA,), + ((BACKUP_ARN, 1),), +) + +DELETE_BACKUP_OUTPUT: StaticSchema = ( + 18, + n0, + _DBO, + {_smith: None}, + (_BDa,), + ((BACKUP_DESCRIPTION, 0),), +) + +DELETE_BACKUP: StaticOperationSchema = ( + 23, + n0, + _DB, + 0, + DELETE_BACKUP_INPUT, + DELETE_BACKUP_OUTPUT, + ( + BACKUP_IN_USE_EXCEPTION, + BACKUP_NOT_FOUND_EXCEPTION, + INTERNAL_SERVER_ERROR, + INVALID_ENDPOINT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + ), ) -THROTTLING_REASON = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ThrottlingReason"), - members={"reason": {"target": REASON}, "resource": {"target": RESOURCE}}, +DELETE_GLOBAL_SECONDARY_INDEX_ACTION: StaticSchema = ( + 18, + n0, + _DGSIA, + 0, + (_IN,), + ((INDEX_NAME, 1),), +) + +DELETE_GLOBAL_TABLE_WITNESS_GROUP_MEMBER_ACTION: StaticSchema = ( + 18, + n0, + _DGTWGMA, + 0, + (_RN,), + ((REGION_NAME, 1),), +) + +RETURN_VALUE: StaticSchema = ( + 14, + n0, + _RV, + 0, + (_NONE, _AO, _UO, _AN_, _UN), + ( + (-1, {_sV: _NONE}), + (-1, {_sV: _AO}), + (-1, {_sV: _UO}), + (-1, {_sV: _AN_}), + (-1, {_sV: _UN}), + ), ) -THROTTLING_REASON_LIST = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ThrottlingReasonList"), - shape_type=ShapeType.LIST, - members={"member": {"target": THROTTLING_REASON}}, +TRANSACTION_CONFLICT_EXCEPTION: StaticSchema = ( + 18, + n0, + _TCE, + {_sm: _c}, + (_me,), + ((ERROR_MESSAGE, 0),), +) + +DELETE_REPLICA_ACTION: StaticSchema = (18, n0, _DRA, 0, (_RN,), ((REGION_NAME, 1),)) + +DELETE_REPLICATION_GROUP_MEMBER_ACTION: StaticSchema = ( + 18, + n0, + _DRGMA, + 0, + (_RN,), + ((REGION_NAME, 1),), +) + +POLICY_REVISION_ID: StaticSchema = (3, n0, _PRI, 0) + +RESOURCE_ARN_STRING: StaticSchema = (3, n0, _RAS, 0) + +DELETE_RESOURCE_POLICY_INPUT: StaticSchema = ( + 18, + n0, + _DRPI, + {_smit: None}, + (_RAe, _ERI), + ((RESOURCE_ARN_STRING, 1), (POLICY_REVISION_ID, 0)), +) + +DELETE_RESOURCE_POLICY_OUTPUT: StaticSchema = ( + 18, + n0, + _DRPO, + {_smith: None}, + (_RI,), + ((POLICY_REVISION_ID, 0),), +) + +POLICY_NOT_FOUND_EXCEPTION: StaticSchema = ( + 18, + n0, + _PNFE, + {_sm: _c}, + (_me,), + ((ERROR_MESSAGE, 0),), +) + +DELETE_RESOURCE_POLICY: StaticOperationSchema = ( + 23, + n0, + _DRP, + 0, + DELETE_RESOURCE_POLICY_INPUT, + DELETE_RESOURCE_POLICY_OUTPUT, + ( + INTERNAL_SERVER_ERROR, + INVALID_ENDPOINT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + POLICY_NOT_FOUND_EXCEPTION, + RESOURCE_IN_USE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + ), ) -REQUEST_LIMIT_EXCEEDED = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#RequestLimitExceeded"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], - members={ - "message": {"target": ERROR_MESSAGE}, - "ThrottlingReasons": {"target": THROTTLING_REASON_LIST}, - }, +DELETE_TABLE_INPUT: StaticSchema = ( + 18, + n0, + _DTI, + {_smit: None}, + (_TN,), + ((TABLE_ARN, 1),), +) + +DELETE_TABLE_OUTPUT: StaticSchema = ( + 18, + n0, + _DTO, + {_smith: None}, + (_TD,), + ((TABLE_DESCRIPTION, 0),), +) + +DELETE_TABLE: StaticOperationSchema = ( + 23, + n0, + _DT, + 0, + DELETE_TABLE_INPUT, + DELETE_TABLE_OUTPUT, + ( + INTERNAL_SERVER_ERROR, + INVALID_ENDPOINT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + RESOURCE_IN_USE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + ), ) -THROTTLING_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ThrottlingException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType({"code": "Throttling", "httpResponseCode": 400}), - ), - ], - members={ - "message": {"target": AVAILABILITY_ERROR_MESSAGE}, - "throttlingReasons": {"target": THROTTLING_REASON_LIST}, - }, +DELETE_VECTOR_INDEX_ACTION: StaticSchema = ( + 18, + n0, + _DVIA, + 0, + (_IN,), + ((INDEX_NAME, 1),), +) + +DESCRIBE_BACKUP_INPUT: StaticSchema = ( + 18, + n0, + _DBIe, + {_smit: None}, + (_BA,), + ((BACKUP_ARN, 1),), +) + +DESCRIBE_BACKUP_OUTPUT: StaticSchema = ( + 18, + n0, + _DBOe, + {_smith: None}, + (_BDa,), + ((BACKUP_DESCRIPTION, 0),), +) + +DESCRIBE_BACKUP: StaticOperationSchema = ( + 23, + n0, + _DBe, + 0, + DESCRIBE_BACKUP_INPUT, + DESCRIBE_BACKUP_OUTPUT, + (BACKUP_NOT_FOUND_EXCEPTION, INTERNAL_SERVER_ERROR, INVALID_ENDPOINT_EXCEPTION), +) + +DESCRIBE_CONTINUOUS_BACKUPS_INPUT: StaticSchema = ( + 18, + n0, + _DCBI, + {_smit: None}, + (_TN,), + ((TABLE_ARN, 1),), +) + +DESCRIBE_CONTINUOUS_BACKUPS_OUTPUT: StaticSchema = ( + 18, + n0, + _DCBO, + {_smith: None}, + (_CBD,), + ((CONTINUOUS_BACKUPS_DESCRIPTION, 0),), +) + +DESCRIBE_CONTINUOUS_BACKUPS: StaticOperationSchema = ( + 23, + n0, + _DCB, + 0, + DESCRIBE_CONTINUOUS_BACKUPS_INPUT, + DESCRIBE_CONTINUOUS_BACKUPS_OUTPUT, + (INTERNAL_SERVER_ERROR, INVALID_ENDPOINT_EXCEPTION, TABLE_NOT_FOUND_EXCEPTION), +) + +DESCRIBE_CONTRIBUTOR_INSIGHTS_INPUT: StaticSchema = ( + 18, + n0, + _DCII, + {_smit: None}, + (_TN, _IN), + ((TABLE_ARN, 1), (INDEX_NAME, 0)), +) + +EXCEPTION_DESCRIPTION: StaticSchema = (3, n0, _ED, 0) + +EXCEPTION_NAME: StaticSchema = (3, n0, _EN, 0) + +FAILURE_EXCEPTION: StaticSchema = ( + 18, + n0, + _FE, + 0, + (_EN, _ED), + ((EXCEPTION_NAME, 0), (EXCEPTION_DESCRIPTION, 0)), +) + +LAST_UPDATE_DATE_TIME: StaticSchema = (4, n0, _LUDT, 0) + +DESCRIBE_CONTRIBUTOR_INSIGHTS_OUTPUT: StaticSchema = ( + 18, + n0, + _DCIO, + {_smith: None}, + (_TN, _IN, _CIRL, _CIS, _LUDT, _FE, _CIM), + ( + (TABLE_NAME, 0), + (INDEX_NAME, 0), + (CONTRIBUTOR_INSIGHTS_RULE_LIST, 0), + (CONTRIBUTOR_INSIGHTS_STATUS, 0), + (LAST_UPDATE_DATE_TIME, 0), + (FAILURE_EXCEPTION, 0), + (CONTRIBUTOR_INSIGHTS_MODE, 0), + ), ) -EXPRESSION_ATTRIBUTE_NAME_VARIABLE = Schema( - id=ShapeID("com.amazonaws.dynamodb#ExpressionAttributeNameVariable"), - shape_type=ShapeType.STRING, +DESCRIBE_CONTRIBUTOR_INSIGHTS: StaticOperationSchema = ( + 23, + n0, + _DCI, + 0, + DESCRIBE_CONTRIBUTOR_INSIGHTS_INPUT, + DESCRIBE_CONTRIBUTOR_INSIGHTS_OUTPUT, + (INTERNAL_SERVER_ERROR, RESOURCE_NOT_FOUND_EXCEPTION), ) -EXPRESSION_ATTRIBUTE_NAME_MAP = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ExpressionAttributeNameMap"), - shape_type=ShapeType.MAP, - members={ - "key": {"target": EXPRESSION_ATTRIBUTE_NAME_VARIABLE}, - "value": {"target": ATTRIBUTE_NAME}, - }, -) +DESCRIBE_ENDPOINTS_INPUT: StaticSchema = (18, n0, _DEI, {_sSI: _cDER, _smit: None}) -PROJECTION_EXPRESSION = Schema( - id=ShapeID("com.amazonaws.dynamodb#ProjectionExpression"), - shape_type=ShapeType.STRING, -) +LONG: StaticSchema = (8, n0, _L, {_smi: 0}) -INVALID_ENDPOINT_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#InvalidEndpointException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=421), - ], - members={"Message": {"target": STRING}}, +ENDPOINT: StaticSchema = ( + 18, + n0, + _En, + 0, + (_A, _CPIM), + ((STRING, 1), (LONG, {_smi: 0, _s: None})), ) -PROVISIONED_THROUGHPUT_EXCEEDED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ProvisionedThroughputExceededException"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], - members={ - "message": {"target": ERROR_MESSAGE}, - "ThrottlingReasons": {"target": THROTTLING_REASON_LIST}, - }, -) +ENDPOINTS: StaticSchema = (16, n0, _End, 0, (_m,), ((ENDPOINT, 0),)) -RESOURCE_NOT_FOUND_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ResourceNotFoundException"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], - members={"message": {"target": ERROR_MESSAGE}}, +DESCRIBE_ENDPOINTS_OUTPUT: StaticSchema = ( + 18, + n0, + _DEO, + {_sSI: _cDERo, _smith: None}, + (_End,), + ((ENDPOINTS, 1),), ) -RETURN_ITEM_COLLECTION_METRICS = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ReturnItemCollectionMetrics"), - shape_type=ShapeType.ENUM, - members={"SIZE": {"target": UNIT}, "NONE": {"target": UNIT}}, +DESCRIBE_ENDPOINTS: StaticOperationSchema = ( + 23, + n0, + _DE, + 0, + DESCRIBE_ENDPOINTS_INPUT, + DESCRIBE_ENDPOINTS_OUTPUT, + (), ) -ITEM_COLLECTION_SIZE_ESTIMATE_BOUND = Schema( - id=ShapeID("com.amazonaws.dynamodb#ItemCollectionSizeEstimateBound"), - shape_type=ShapeType.DOUBLE, -) +EXPORT_ARN: StaticSchema = (3, n0, _EA, 0) -ITEM_COLLECTION_SIZE_ESTIMATE_RANGE = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ItemCollectionSizeEstimateRange"), - shape_type=ShapeType.LIST, - members={"member": {"target": ITEM_COLLECTION_SIZE_ESTIMATE_BOUND}}, +DESCRIBE_EXPORT_INPUT: StaticSchema = ( + 18, + n0, + _DEIe, + {_smit: None}, + (_EA,), + ((EXPORT_ARN, 1),), ) -ITEM_COLLECTION_SIZE_LIMIT_EXCEEDED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ItemCollectionSizeLimitExceededException"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], - members={"message": {"target": ERROR_MESSAGE}}, -) +EXPORT_END_TIME: StaticSchema = (4, n0, _EET, 0) -REPLICATED_WRITE_CONFLICT_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ReplicatedWriteConflictException"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], - members={"message": {"target": ERROR_MESSAGE}}, +EXPORT_FORMAT: StaticSchema = ( + 14, + n0, + _EF, + 0, + (_DJ, _ION), + ((-1, {_sV: _DJ}), (-1, {_sV: _ION})), ) -BILLED_SIZE_BYTES = Schema( - id=ShapeID("com.amazonaws.dynamodb#BilledSizeBytes"), shape_type=ShapeType.LONG -) +EXPORT_MANIFEST: StaticSchema = (3, n0, _EMx, 0) -BILLING_MODE_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#BillingModeSummary"), - members={ - "BillingMode": {"target": BILLING_MODE}, - "LastUpdateToPayPerRequestDateTime": {"target": DATE}, - }, +EXPORT_STATUS: StaticSchema = ( + 14, + n0, + _ES, + 0, + (_IP, _COMPLETED, _FAILED), + ((-1, {_sV: _IP}), (-1, {_sV: _COMPLETED}), (-1, {_sV: _FAILED})), ) -CODE = Schema(id=ShapeID("com.amazonaws.dynamodb#Code"), shape_type=ShapeType.STRING) +EXPORT_TIME: StaticSchema = (4, n0, _ET, 0) -CLIENT_REQUEST_TOKEN = Schema( - id=ShapeID("com.amazonaws.dynamodb#ClientRequestToken"), shape_type=ShapeType.STRING +EXPORT_TYPE: StaticSchema = ( + 14, + n0, + _ETx, + 0, + (_FE_, _IE), + ((-1, {_sV: _FE_}), (-1, {_sV: _IE})), ) -CLIENT_TOKEN = Schema( - id=ShapeID("com.amazonaws.dynamodb#ClientToken"), shape_type=ShapeType.STRING -) +FAILURE_CODE: StaticSchema = (3, n0, _FC, 0) -CLOUD_WATCH_LOG_GROUP_ARN = Schema( - id=ShapeID("com.amazonaws.dynamodb#CloudWatchLogGroupArn"), - shape_type=ShapeType.STRING, -) +FAILURE_MESSAGE: StaticSchema = (3, n0, _FM, 0) -COMPARISON_OPERATOR = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ComparisonOperator"), - shape_type=ShapeType.ENUM, - members={ - "EQ": {"target": UNIT}, - "NE": {"target": UNIT}, - "IN": {"target": UNIT}, - "LE": {"target": UNIT}, - "LT": {"target": UNIT}, - "GE": {"target": UNIT}, - "GT": {"target": UNIT}, - "BETWEEN": {"target": UNIT}, - "NOT_NULL": {"target": UNIT}, - "NULL": {"target": UNIT}, - "CONTAINS": {"target": UNIT}, - "NOT_CONTAINS": {"target": UNIT}, - "BEGINS_WITH": {"target": UNIT}, - }, -) +KEY_EXPRESSION: StaticSchema = (3, n0, _KE, 0) -CONDITIONAL_OPERATOR = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ConditionalOperator"), - shape_type=ShapeType.ENUM, - members={"AND": {"target": UNIT}, "OR": {"target": UNIT}}, -) +EXPORT_FROM_TIME: StaticSchema = (4, n0, _EFT, 0) -CONDITION_EXPRESSION = Schema( - id=ShapeID("com.amazonaws.dynamodb#ConditionExpression"), - shape_type=ShapeType.STRING, -) +EXPORT_TO_TIME: StaticSchema = (4, n0, _ETT, 0) -EXPRESSION_ATTRIBUTE_VALUE_VARIABLE = Schema( - id=ShapeID("com.amazonaws.dynamodb#ExpressionAttributeValueVariable"), - shape_type=ShapeType.STRING, +EXPORT_VIEW_TYPE: StaticSchema = ( + 14, + n0, + _EVT, + 0, + (_NI, _NAOI), + ((-1, {_sV: _NI}), (-1, {_sV: _NAOI})), ) -CONFIRM_REMOVE_SELF_RESOURCE_ACCESS = Schema( - id=ShapeID("com.amazonaws.dynamodb#ConfirmRemoveSelfResourceAccess"), - shape_type=ShapeType.BOOLEAN, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=False)], +INCREMENTAL_EXPORT_SPECIFICATION: StaticSchema = ( + 18, + n0, + _IES, + 0, + (_EFT, _ETT, _EVT), + ((EXPORT_FROM_TIME, 0), (EXPORT_TO_TIME, 0), (EXPORT_VIEW_TYPE, 0)), ) -CONTINUOUS_BACKUPS_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ContinuousBackupsStatus"), - shape_type=ShapeType.ENUM, - members={"ENABLED": {"target": UNIT}, "DISABLED": {"target": UNIT}}, -) +S3_BUCKET: StaticSchema = (3, n0, _SB, 0) -POINT_IN_TIME_RECOVERY_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#PointInTimeRecoveryStatus"), - shape_type=ShapeType.ENUM, - members={"ENABLED": {"target": UNIT}, "DISABLED": {"target": UNIT}}, -) +S3_BUCKET_OWNER: StaticSchema = (3, n0, _SBO, 0) -RECOVERY_PERIOD_IN_DAYS = Schema( - id=ShapeID("com.amazonaws.dynamodb#RecoveryPeriodInDays"), - shape_type=ShapeType.INTEGER, -) +S3_PREFIX: StaticSchema = (3, n0, _SPr, 0) -POINT_IN_TIME_RECOVERY_DESCRIPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#PointInTimeRecoveryDescription"), - members={ - "PointInTimeRecoveryStatus": {"target": POINT_IN_TIME_RECOVERY_STATUS}, - "RecoveryPeriodInDays": {"target": RECOVERY_PERIOD_IN_DAYS}, - "EarliestRestorableDateTime": {"target": DATE}, - "LatestRestorableDateTime": {"target": DATE}, - }, +S3_SSE_ALGORITHM: StaticSchema = ( + 14, + n0, + _SSA, + 0, + (_AES, _KMS), + ((-1, {_sV: _AES}), (-1, {_sV: _KMS})), ) -CONTINUOUS_BACKUPS_DESCRIPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ContinuousBackupsDescription"), - members={ - "ContinuousBackupsStatus": { - "target": CONTINUOUS_BACKUPS_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "PointInTimeRecoveryDescription": { - "target": POINT_IN_TIME_RECOVERY_DESCRIPTION - }, - }, -) +S3_SSE_KMS_KEY_ID: StaticSchema = (3, n0, _SSKKI, 0) -CONTINUOUS_BACKUPS_UNAVAILABLE_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ContinuousBackupsUnavailableException"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], - members={"message": {"target": ERROR_MESSAGE}}, -) +EXPORT_START_TIME: StaticSchema = (4, n0, _EST, 0) -CONTRIBUTOR_INSIGHTS_ACTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ContributorInsightsAction"), - shape_type=ShapeType.ENUM, - members={"ENABLE": {"target": UNIT}, "DISABLE": {"target": UNIT}}, +EXPORT_NOT_FOUND_EXCEPTION: StaticSchema = ( + 18, + n0, + _ENFE, + {_sm: _c}, + (_me,), + ((ERROR_MESSAGE, 0),), ) -CONTRIBUTOR_INSIGHTS_MODE = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ContributorInsightsMode"), - shape_type=ShapeType.ENUM, - members={ - "ACCESSED_AND_THROTTLED_KEYS": {"target": UNIT}, - "THROTTLED_KEYS": {"target": UNIT}, - }, +DESCRIBE_GLOBAL_TABLE_INPUT: StaticSchema = ( + 18, + n0, + _DGTI, + {_smit: None}, + (_GTN,), + ((TABLE_NAME, 1),), ) -CONTRIBUTOR_INSIGHTS_RULE = Schema( - id=ShapeID("com.amazonaws.dynamodb#ContributorInsightsRule"), - shape_type=ShapeType.STRING, +DESCRIBE_GLOBAL_TABLE_OUTPUT: StaticSchema = ( + 18, + n0, + _DGTO, + {_smith: None}, + (_GTD,), + ((GLOBAL_TABLE_DESCRIPTION, 0),), ) -CONTRIBUTOR_INSIGHTS_RULE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ContributorInsightsRuleList"), - shape_type=ShapeType.LIST, - members={"member": {"target": CONTRIBUTOR_INSIGHTS_RULE}}, +GLOBAL_TABLE_NOT_FOUND_EXCEPTION: StaticSchema = ( + 18, + n0, + _GTNFE, + {_sm: _c}, + (_me,), + ((ERROR_MESSAGE, 0),), ) -CONTRIBUTOR_INSIGHTS_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ContributorInsightsStatus"), - shape_type=ShapeType.ENUM, - members={ - "ENABLING": {"target": UNIT}, - "ENABLED": {"target": UNIT}, - "DISABLING": {"target": UNIT}, - "DISABLED": {"target": UNIT}, - "FAILED": {"target": UNIT}, - }, +DESCRIBE_GLOBAL_TABLE: StaticOperationSchema = ( + 23, + n0, + _DGT, + 0, + DESCRIBE_GLOBAL_TABLE_INPUT, + DESCRIBE_GLOBAL_TABLE_OUTPUT, + ( + GLOBAL_TABLE_NOT_FOUND_EXCEPTION, + INTERNAL_SERVER_ERROR, + INVALID_ENDPOINT_EXCEPTION, + ), ) -CONTRIBUTOR_INSIGHTS_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ContributorInsightsSummary"), - members={ - "TableName": {"target": TABLE_NAME}, - "IndexName": {"target": INDEX_NAME}, - "ContributorInsightsStatus": {"target": CONTRIBUTOR_INSIGHTS_STATUS}, - "ContributorInsightsMode": {"target": CONTRIBUTOR_INSIGHTS_MODE}, - }, +DESCRIBE_GLOBAL_TABLE_SETTINGS_INPUT: StaticSchema = ( + 18, + n0, + _DGTSI, + {_smit: None}, + (_GTN,), + ((TABLE_NAME, 1),), +) + +REPLICA_GLOBAL_SECONDARY_INDEX_SETTINGS_DESCRIPTION: StaticSchema = ( + 18, + n0, + _RGSISD, + 0, + (_IN, _IS, _PRCU, _PRCASS, _PWCU, _PWCASS), + ( + (INDEX_NAME, 1), + (INDEX_STATUS, 0), + (POSITIVE_LONG_OBJECT, 0), + (AUTO_SCALING_SETTINGS_DESCRIPTION, 0), + (POSITIVE_LONG_OBJECT, 0), + (AUTO_SCALING_SETTINGS_DESCRIPTION, 0), + ), ) -CONTRIBUTOR_INSIGHTS_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ContributorInsightsSummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": CONTRIBUTOR_INSIGHTS_SUMMARY}}, +REPLICA_GLOBAL_SECONDARY_INDEX_SETTINGS_DESCRIPTION_LIST: StaticSchema = ( + 16, + n0, + _RGSISDL, + 0, + (_m,), + ((REPLICA_GLOBAL_SECONDARY_INDEX_SETTINGS_DESCRIPTION, 0),), +) + +REPLICA_SETTINGS_DESCRIPTION: StaticSchema = ( + 18, + n0, + _RSDe, + 0, + (_RN, _RS, _RBMS, _RPRCU, _RPRCASS, _RPWCU, _RPWCASS, _RGSIS, _RTCS), + ( + (REGION_NAME, 1), + (REPLICA_STATUS, 0), + (BILLING_MODE_SUMMARY, 0), + (NON_NEGATIVE_LONG_OBJECT, 0), + (AUTO_SCALING_SETTINGS_DESCRIPTION, 0), + (NON_NEGATIVE_LONG_OBJECT, 0), + (AUTO_SCALING_SETTINGS_DESCRIPTION, 0), + (REPLICA_GLOBAL_SECONDARY_INDEX_SETTINGS_DESCRIPTION_LIST, 0), + (TABLE_CLASS_SUMMARY, 0), + ), ) -CREATE_BACKUP_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#CreateBackupInput"), - members={ - "TableName": { - "target": TABLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "BackupName": { - "target": BACKUP_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +REPLICA_SETTINGS_DESCRIPTION_LIST: StaticSchema = ( + 16, + n0, + _RSDL, + 0, + (_m,), + ((REPLICA_SETTINGS_DESCRIPTION, 0),), +) + +DESCRIBE_GLOBAL_TABLE_SETTINGS_OUTPUT: StaticSchema = ( + 18, + n0, + _DGTSO, + {_smith: None}, + (_GTN, _RSep), + ((TABLE_NAME, 0), (REPLICA_SETTINGS_DESCRIPTION_LIST, 0)), +) + +DESCRIBE_GLOBAL_TABLE_SETTINGS: StaticOperationSchema = ( + 23, + n0, + _DGTS, + 0, + DESCRIBE_GLOBAL_TABLE_SETTINGS_INPUT, + DESCRIBE_GLOBAL_TABLE_SETTINGS_OUTPUT, + ( + GLOBAL_TABLE_NOT_FOUND_EXCEPTION, + INTERNAL_SERVER_ERROR, + INVALID_ENDPOINT_EXCEPTION, + ), ) -CREATE_BACKUP_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#CreateBackupOutput"), - members={"BackupDetails": {"target": BACKUP_DETAILS}}, -) +IMPORT_ARN: StaticSchema = (3, n0, _IAm, 0) -LIMIT_EXCEEDED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#LimitExceededException"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], - members={"message": {"target": ERROR_MESSAGE}}, +DESCRIBE_IMPORT_INPUT: StaticSchema = ( + 18, + n0, + _DII, + {_smit: None}, + (_IAm,), + ((IMPORT_ARN, 1),), ) -TABLE_IN_USE_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#TableInUseException"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], - members={"message": {"target": ERROR_MESSAGE}}, -) +IMPORT_END_TIME: StaticSchema = (4, n0, _IET, 0) -TABLE_NOT_FOUND_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#TableNotFoundException"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], - members={"message": {"target": ERROR_MESSAGE}}, -) +ERROR_COUNT: StaticSchema = (8, n0, _EC, {_smi: 0}) -CREATE_BACKUP = Schema( - id=ShapeID("com.amazonaws.dynamodb#CreateBackup"), shape_type=ShapeType.OPERATION -) +IMPORTED_ITEM_COUNT: StaticSchema = (8, n0, _IIC, {_smi: 0}) -WARM_THROUGHPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#WarmThroughput"), - members={ - "ReadUnitsPerSecond": {"target": LONG_OBJECT}, - "WriteUnitsPerSecond": {"target": LONG_OBJECT}, - }, +IMPORT_STATUS: StaticSchema = ( + 14, + n0, + _ISm, + 0, + (_IP, _COMPLETED, _CANCELLING, _CANCELLED, _FAILED), + ( + (-1, {_sV: _IP}), + (-1, {_sV: _COMPLETED}), + (-1, {_sV: _CANCELLING}), + (-1, {_sV: _CANCELLED}), + (-1, {_sV: _FAILED}), + ), ) -CREATE_GLOBAL_SECONDARY_INDEX_ACTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#CreateGlobalSecondaryIndexAction"), - members={ - "IndexName": { - "target": INDEX_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "KeySchema": { - "target": KEY_SCHEMA, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Projection": { - "target": PROJECTION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ProvisionedThroughput": {"target": PROVISIONED_THROUGHPUT}, - "OnDemandThroughput": {"target": ON_DEMAND_THROUGHPUT}, - "WarmThroughput": {"target": WARM_THROUGHPUT}, - }, +INPUT_COMPRESSION_TYPE: StaticSchema = ( + 14, + n0, + _ICT, + 0, + (_GZIP, _ZSTD, _NONE), + ((-1, {_sV: _GZIP}), (-1, {_sV: _ZSTD}), (-1, {_sV: _NONE})), +) + +INPUT_FORMAT: StaticSchema = ( + 14, + n0, + _IFn, + 0, + (_DJ, _ION, _CSV), + ((-1, {_sV: _DJ}), (-1, {_sV: _ION}), (-1, {_sV: _CSV})), +) + +INPUT_FORMAT_OPTIONS: StaticSchema = (18, n0, _IFO, 0, (_Cs,), ((CSV_OPTIONS, 0),)) + +PROCESSED_ITEM_COUNT: StaticSchema = (8, n0, _PIC, {_smi: 0}) + +S3_BUCKET_SOURCE: StaticSchema = ( + 18, + n0, + _SBS, + 0, + (_SBO, _SB, _SKP), + ((S3_BUCKET_OWNER, 0), (S3_BUCKET, 1), (S3_PREFIX, 0)), +) + +IMPORT_START_TIME: StaticSchema = (4, n0, _IST, 0) + +TABLE_CREATION_PARAMETERS: StaticSchema = ( + 18, + n0, + _TCP, + 0, + (_TN, _ADt, _KS, _BM, _PT, _ODT, _SSESp, _GSI, _VI), + ( + (TABLE_NAME, 1), + (ATTRIBUTE_DEFINITIONS, 1), + (KEY_SCHEMA, 1), + (BILLING_MODE, 0), + (PROVISIONED_THROUGHPUT, 0), + (ON_DEMAND_THROUGHPUT, 0), + (SSE_SPECIFICATION, 0), + (GLOBAL_SECONDARY_INDEX_LIST, 0), + (VECTOR_INDEX_LIST, 0), + ), ) -REGION_NAME = Schema( - id=ShapeID("com.amazonaws.dynamodb#RegionName"), shape_type=ShapeType.STRING +IMPORT_TABLE_DESCRIPTION: StaticSchema = ( + 18, + n0, + _ITD, + 0, + ( + _IAm, + _ISm, + _TA, + _TI, + _CT, + _SBS, + _EC, + _CWLGA, + _IFn, + _IFO, + _ICT, + _TCP, + _ST, + _ETn, + _PSB, + _PIC, + _IIC, + _FC, + _FM, + ), + ( + (IMPORT_ARN, 0), + (IMPORT_STATUS, 0), + (TABLE_ARN, 0), + (TABLE_ID, 0), + (CLIENT_TOKEN, 0), + (S3_BUCKET_SOURCE, 0), + (ERROR_COUNT, {_smi: 0}), + (CLOUD_WATCH_LOG_GROUP_ARN, 0), + (INPUT_FORMAT, 0), + (INPUT_FORMAT_OPTIONS, 0), + (INPUT_COMPRESSION_TYPE, 0), + (TABLE_CREATION_PARAMETERS, 0), + (IMPORT_START_TIME, 0), + (IMPORT_END_TIME, 0), + (LONG_OBJECT, 0), + (PROCESSED_ITEM_COUNT, {_smi: 0}), + (IMPORTED_ITEM_COUNT, {_smi: 0}), + (FAILURE_CODE, 0), + (FAILURE_MESSAGE, 0), + ), ) -REPLICA = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#Replica"), - members={"RegionName": {"target": REGION_NAME}}, +DESCRIBE_IMPORT_OUTPUT: StaticSchema = ( + 18, + n0, + _DIO, + {_smith: None}, + (_ITD,), + ((IMPORT_TABLE_DESCRIPTION, 1),), +) + +IMPORT_NOT_FOUND_EXCEPTION: StaticSchema = ( + 18, + n0, + _INFE, + {_sm: _c}, + (_me,), + ((ERROR_MESSAGE, 0),), +) + +DESCRIBE_IMPORT: StaticOperationSchema = ( + 23, + n0, + _DIe, + 0, + DESCRIBE_IMPORT_INPUT, + DESCRIBE_IMPORT_OUTPUT, + (IMPORT_NOT_FOUND_EXCEPTION,), +) + +DESCRIBE_KINESIS_STREAMING_DESTINATION_INPUT: StaticSchema = ( + 18, + n0, + _DKSDI, + {_smit: None}, + (_TN,), + ((TABLE_ARN, 1),), +) + +DESTINATION_STATUS: StaticSchema = ( + 14, + n0, + _DS, + 0, + (_ENABLING, _ACTIVE, _DISABLING, _DISABLED, _EF_, _UPDATING), + ( + (-1, {_sV: _ENABLING}), + (-1, {_sV: _ACTIVE}), + (-1, {_sV: _DISABLING}), + (-1, {_sV: _DISABLED}), + (-1, {_sV: _EF_}), + (-1, {_sV: _UPDATING}), + ), ) -REPLICA_LIST = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ReplicaList"), - shape_type=ShapeType.LIST, - members={"member": {"target": REPLICA}}, +KINESIS_DATA_STREAM_DESTINATION: StaticSchema = ( + 18, + n0, + _KDSD, + 0, + (_SA, _DS, _DSD, _ACDTP), + ( + (STREAM_ARN, 0), + (DESTINATION_STATUS, 0), + (STRING, 0), + (APPROXIMATE_CREATION_DATE_TIME_PRECISION, 0), + ), ) -CREATE_GLOBAL_TABLE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#CreateGlobalTableInput"), - members={ - "GlobalTableName": { - "target": TABLE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ReplicationGroup": { - "target": REPLICA_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +KINESIS_DATA_STREAM_DESTINATIONS: StaticSchema = ( + 16, + n0, + _KDSDi, + 0, + (_m,), + ((KINESIS_DATA_STREAM_DESTINATION, 0),), +) + +DESCRIBE_KINESIS_STREAMING_DESTINATION_OUTPUT: StaticSchema = ( + 18, + n0, + _DKSDO, + {_smith: None}, + (_TN, _KDSDi), + ((TABLE_NAME, 0), (KINESIS_DATA_STREAM_DESTINATIONS, 0)), +) + +DESCRIBE_KINESIS_STREAMING_DESTINATION: StaticOperationSchema = ( + 23, + n0, + _DKSD, + 0, + DESCRIBE_KINESIS_STREAMING_DESTINATION_INPUT, + DESCRIBE_KINESIS_STREAMING_DESTINATION_OUTPUT, + (INTERNAL_SERVER_ERROR, INVALID_ENDPOINT_EXCEPTION, RESOURCE_NOT_FOUND_EXCEPTION), +) + +DESCRIBE_LIMITS_INPUT: StaticSchema = (18, n0, _DLI, {_smit: None}) + +DESCRIBE_LIMITS_OUTPUT: StaticSchema = ( + 18, + n0, + _DLO, + {_smith: None}, + (_AMRCU, _AMWCU, _TMRCU, _TMWCU), + ( + (POSITIVE_LONG_OBJECT, 0), + (POSITIVE_LONG_OBJECT, 0), + (POSITIVE_LONG_OBJECT, 0), + (POSITIVE_LONG_OBJECT, 0), + ), ) -GLOBAL_TABLE_ARN_STRING = Schema( - id=ShapeID("com.amazonaws.dynamodb#GlobalTableArnString"), - shape_type=ShapeType.STRING, +DESCRIBE_LIMITS: StaticOperationSchema = ( + 23, + n0, + _DL, + 0, + DESCRIBE_LIMITS_INPUT, + DESCRIBE_LIMITS_OUTPUT, + (INTERNAL_SERVER_ERROR, INVALID_ENDPOINT_EXCEPTION), +) + +DESCRIBE_TABLE_INPUT: StaticSchema = ( + 18, + n0, + _DTIe, + {_smit: None}, + (_TN,), + ((TABLE_ARN, 1),), +) + +DESCRIBE_TABLE_OUTPUT: StaticSchema = ( + 18, + n0, + _DTOe, + {_smith: None}, + (_T,), + ((TABLE_DESCRIPTION, 0),), +) + +DESCRIBE_TABLE: StaticOperationSchema = ( + 23, + n0, + _DTe, + 0, + DESCRIBE_TABLE_INPUT, + DESCRIBE_TABLE_OUTPUT, + (INTERNAL_SERVER_ERROR, INVALID_ENDPOINT_EXCEPTION, RESOURCE_NOT_FOUND_EXCEPTION), +) + +DESCRIBE_TABLE_REPLICA_AUTO_SCALING_INPUT: StaticSchema = ( + 18, + n0, + _DTRASI, + {_smit: None}, + (_TN,), + ((TABLE_ARN, 1),), +) + +REPLICA_GLOBAL_SECONDARY_INDEX_AUTO_SCALING_DESCRIPTION: StaticSchema = ( + 18, + n0, + _RGSIASD, + 0, + (_IN, _IS, _PRCASS, _PWCASS), + ( + (INDEX_NAME, 0), + (INDEX_STATUS, 0), + (AUTO_SCALING_SETTINGS_DESCRIPTION, 0), + (AUTO_SCALING_SETTINGS_DESCRIPTION, 0), + ), ) -GLOBAL_TABLE_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#GlobalTableStatus"), - shape_type=ShapeType.ENUM, - members={ - "CREATING": {"target": UNIT}, - "ACTIVE": {"target": UNIT}, - "DELETING": {"target": UNIT}, - "UPDATING": {"target": UNIT}, - }, +REPLICA_GLOBAL_SECONDARY_INDEX_AUTO_SCALING_DESCRIPTION_LIST: StaticSchema = ( + 16, + n0, + _RGSIASDL, + 0, + (_m,), + ((REPLICA_GLOBAL_SECONDARY_INDEX_AUTO_SCALING_DESCRIPTION, 0),), +) + +REPLICA_AUTO_SCALING_DESCRIPTION: StaticSchema = ( + 18, + n0, + _RASD, + 0, + (_RN, _GSI, _RPRCASS, _RPWCASS, _RS), + ( + (REGION_NAME, 0), + (REPLICA_GLOBAL_SECONDARY_INDEX_AUTO_SCALING_DESCRIPTION_LIST, 0), + (AUTO_SCALING_SETTINGS_DESCRIPTION, 0), + (AUTO_SCALING_SETTINGS_DESCRIPTION, 0), + (REPLICA_STATUS, 0), + ), ) -ON_DEMAND_THROUGHPUT_OVERRIDE = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#OnDemandThroughputOverride"), - members={"MaxReadRequestUnits": {"target": LONG_OBJECT}}, +REPLICA_AUTO_SCALING_DESCRIPTION_LIST: StaticSchema = ( + 16, + n0, + _RASDL, + 0, + (_m,), + ((REPLICA_AUTO_SCALING_DESCRIPTION, 0),), +) + +TABLE_AUTO_SCALING_DESCRIPTION: StaticSchema = ( + 18, + n0, + _TASD, + 0, + (_TN, _TS, _Repl), + ((TABLE_NAME, 0), (TABLE_STATUS, 0), (REPLICA_AUTO_SCALING_DESCRIPTION_LIST, 0)), +) + +DESCRIBE_TABLE_REPLICA_AUTO_SCALING_OUTPUT: StaticSchema = ( + 18, + n0, + _DTRASO, + {_smith: None}, + (_TASD,), + ((TABLE_AUTO_SCALING_DESCRIPTION, 0),), +) + +DESCRIBE_TABLE_REPLICA_AUTO_SCALING: StaticOperationSchema = ( + 23, + n0, + _DTRAS, + 0, + DESCRIBE_TABLE_REPLICA_AUTO_SCALING_INPUT, + DESCRIBE_TABLE_REPLICA_AUTO_SCALING_OUTPUT, + (INTERNAL_SERVER_ERROR, RESOURCE_NOT_FOUND_EXCEPTION), +) + +DESCRIBE_TIME_TO_LIVE_INPUT: StaticSchema = ( + 18, + n0, + _DTTLI, + {_smit: None}, + (_TN,), + ((TABLE_ARN, 1),), +) + +DESCRIBE_TIME_TO_LIVE_OUTPUT: StaticSchema = ( + 18, + n0, + _DTTLO, + {_smith: None}, + (_TTLD,), + ((TIME_TO_LIVE_DESCRIPTION, 0),), +) + +DESCRIBE_TIME_TO_LIVE: StaticOperationSchema = ( + 23, + n0, + _DTTL, + 0, + DESCRIBE_TIME_TO_LIVE_INPUT, + DESCRIBE_TIME_TO_LIVE_OUTPUT, + (INTERNAL_SERVER_ERROR, INVALID_ENDPOINT_EXCEPTION, RESOURCE_NOT_FOUND_EXCEPTION), +) + +ENABLE_KINESIS_STREAMING_CONFIGURATION: StaticSchema = ( + 18, + n0, + _EKSC, + 0, + (_ACDTP,), + ((APPROXIMATE_CREATION_DATE_TIME_PRECISION, 0),), +) + +DISABLE_KINESIS_STREAMING_DESTINATION_INPUT: StaticSchema = ( + 18, + n0, + _DKSDIi, + {_sSI: _cKSDI, _smit: None}, + (_TN, _SA, _EKSC), + ((TABLE_ARN, 1), (STREAM_ARN, 1), (ENABLE_KINESIS_STREAMING_CONFIGURATION, 0)), +) + +DISABLE_KINESIS_STREAMING_DESTINATION_OUTPUT: StaticSchema = ( + 18, + n0, + _DKSDOi, + {_sSI: _cKSDO, _smith: None}, + (_TN, _SA, _DS, _EKSC), + ( + (TABLE_NAME, 0), + (STREAM_ARN, 0), + (DESTINATION_STATUS, 0), + (ENABLE_KINESIS_STREAMING_CONFIGURATION, 0), + ), ) -PROVISIONED_THROUGHPUT_OVERRIDE = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ProvisionedThroughputOverride"), - members={"ReadCapacityUnits": {"target": POSITIVE_LONG_OBJECT}}, +DISABLE_KINESIS_STREAMING_DESTINATION: StaticOperationSchema = ( + 23, + n0, + _DKSDi, + 0, + DISABLE_KINESIS_STREAMING_DESTINATION_INPUT, + DISABLE_KINESIS_STREAMING_DESTINATION_OUTPUT, + ( + INTERNAL_SERVER_ERROR, + INVALID_ENDPOINT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + RESOURCE_IN_USE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + ), ) -INDEX_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#IndexStatus"), - shape_type=ShapeType.ENUM, - members={ - "CREATING": {"target": UNIT}, - "UPDATING": {"target": UNIT}, - "DELETING": {"target": UNIT}, - "ACTIVE": {"target": UNIT}, - }, +DUPLICATE_ITEM_EXCEPTION: StaticSchema = ( + 18, + n0, + _DIE, + {_sm: _c}, + (_me,), + ((ERROR_MESSAGE, 0),), +) + +ENABLE_KINESIS_STREAMING_DESTINATION_INPUT: StaticSchema = ( + 18, + n0, + _EKSDI, + {_sSI: _cKSDI, _smit: None}, + (_TN, _SA, _EKSC), + ((TABLE_ARN, 1), (STREAM_ARN, 1), (ENABLE_KINESIS_STREAMING_CONFIGURATION, 0)), +) + +ENABLE_KINESIS_STREAMING_DESTINATION_OUTPUT: StaticSchema = ( + 18, + n0, + _EKSDO, + {_sSI: _cKSDO, _smith: None}, + (_TN, _SA, _DS, _EKSC), + ( + (TABLE_NAME, 0), + (STREAM_ARN, 0), + (DESTINATION_STATUS, 0), + (ENABLE_KINESIS_STREAMING_CONFIGURATION, 0), + ), ) -GLOBAL_SECONDARY_INDEX_WARM_THROUGHPUT_DESCRIPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#GlobalSecondaryIndexWarmThroughputDescription"), - members={ - "ReadUnitsPerSecond": {"target": POSITIVE_LONG_OBJECT}, - "WriteUnitsPerSecond": {"target": POSITIVE_LONG_OBJECT}, - "Status": {"target": INDEX_STATUS}, - }, +ENABLE_KINESIS_STREAMING_DESTINATION: StaticOperationSchema = ( + 23, + n0, + _EKSD, + 0, + ENABLE_KINESIS_STREAMING_DESTINATION_INPUT, + ENABLE_KINESIS_STREAMING_DESTINATION_OUTPUT, + ( + INTERNAL_SERVER_ERROR, + INVALID_ENDPOINT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + RESOURCE_IN_USE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + ), ) -REPLICA_GLOBAL_SECONDARY_INDEX_DESCRIPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ReplicaGlobalSecondaryIndexDescription"), - members={ - "IndexName": {"target": INDEX_NAME}, - "ProvisionedThroughputOverride": {"target": PROVISIONED_THROUGHPUT_OVERRIDE}, - "OnDemandThroughputOverride": {"target": ON_DEMAND_THROUGHPUT_OVERRIDE}, - "WarmThroughput": { - "target": GLOBAL_SECONDARY_INDEX_WARM_THROUGHPUT_DESCRIPTION - }, - }, +POSITIVE_INTEGER_OBJECT: StaticSchema = (7, n0, _PIO, 0) + +PARTI_QL_NEXT_TOKEN: StaticSchema = (3, n0, _PQLNT, 0) + +IDEMPOTENT_PARAMETER_MISMATCH_EXCEPTION: StaticSchema = ( + 18, + n0, + _IPME, + {_sm: _c}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +TRANSACTION_IN_PROGRESS_EXCEPTION: StaticSchema = ( + 18, + n0, + _TIPE, + {_sm: _c}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +EXPORT_CONFLICT_EXCEPTION: StaticSchema = ( + 18, + n0, + _ECE, + {_sm: _c}, + (_me,), + ((ERROR_MESSAGE, 0),), +) + +INVALID_EXPORT_TIME_EXCEPTION: StaticSchema = ( + 18, + n0, + _IETE, + {_sm: _c}, + (_me,), + ((ERROR_MESSAGE, 0),), +) + +POINT_IN_TIME_RECOVERY_UNAVAILABLE_EXCEPTION: StaticSchema = ( + 18, + n0, + _PITRUE, + {_sm: _c}, + (_me,), + ((ERROR_MESSAGE, 0),), +) + +GET_RESOURCE_POLICY_INPUT: StaticSchema = ( + 18, + n0, + _GRPI, + {_smit: None}, + (_RAe,), + ((RESOURCE_ARN_STRING, 1),), +) + +GET_RESOURCE_POLICY_OUTPUT: StaticSchema = ( + 18, + n0, + _GRPO, + {_smith: None}, + (_Po, _RI), + ((RESOURCE_POLICY, 0), (POLICY_REVISION_ID, 0)), +) + +GET_RESOURCE_POLICY: StaticOperationSchema = ( + 23, + n0, + _GRP, + 0, + GET_RESOURCE_POLICY_INPUT, + GET_RESOURCE_POLICY_OUTPUT, + ( + INTERNAL_SERVER_ERROR, + INVALID_ENDPOINT_EXCEPTION, + POLICY_NOT_FOUND_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + ), ) -REPLICA_GLOBAL_SECONDARY_INDEX_DESCRIPTION_LIST = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ReplicaGlobalSecondaryIndexDescriptionList"), - shape_type=ShapeType.LIST, - members={"member": {"target": REPLICA_GLOBAL_SECONDARY_INDEX_DESCRIPTION}}, +IMPORT_CONFLICT_EXCEPTION: StaticSchema = ( + 18, + n0, + _ICE, + {_sm: _c}, + (_me,), + ((ERROR_MESSAGE, 0),), +) + +IMPORT_TABLE_INPUT: StaticSchema = ( + 18, + n0, + _ITI, + {_smit: None}, + (_CT, _SBS, _IFn, _IFO, _ICT, _TCP), + ( + (CLIENT_TOKEN, 2), + (S3_BUCKET_SOURCE, 1), + (INPUT_FORMAT, 1), + (INPUT_FORMAT_OPTIONS, 0), + (INPUT_COMPRESSION_TYPE, 0), + (TABLE_CREATION_PARAMETERS, 1), + ), ) -GLOBAL_TABLE_SETTINGS_REPLICATION_MODE = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#GlobalTableSettingsReplicationMode"), - shape_type=ShapeType.ENUM, - members={ - "ENABLED": {"target": UNIT}, - "DISABLED": {"target": UNIT}, - "ENABLED_WITH_OVERRIDES": {"target": UNIT}, - }, +IMPORT_TABLE_OUTPUT: StaticSchema = ( + 18, + n0, + _ITO, + {_smith: None}, + (_ITD,), + ((IMPORT_TABLE_DESCRIPTION, 1),), +) + +IMPORT_TABLE: StaticOperationSchema = ( + 23, + n0, + _IT, + 0, + IMPORT_TABLE_INPUT, + IMPORT_TABLE_OUTPUT, + (IMPORT_CONFLICT_EXCEPTION, LIMIT_EXCEEDED_EXCEPTION, RESOURCE_IN_USE_EXCEPTION), +) + +TIME_RANGE_LOWER_BOUND: StaticSchema = (4, n0, _TRLB, 0) + +TIME_RANGE_UPPER_BOUND: StaticSchema = (4, n0, _TRUB, 0) + +LIST_BACKUPS_INPUT: StaticSchema = ( + 18, + n0, + _LBI, + {_smit: None}, + (_TN, _Li, _TRLB, _TRUB, _ESBA, _BT), + ( + (TABLE_ARN, 0), + (BACKUPS_INPUT_LIMIT, 0), + (TIME_RANGE_LOWER_BOUND, 0), + (TIME_RANGE_UPPER_BOUND, 0), + (BACKUP_ARN, 0), + (BACKUP_TYPE_FILTER, 0), + ), ) -KMS_MASTER_KEY_ID = Schema( - id=ShapeID("com.amazonaws.dynamodb#KMSMasterKeyId"), shape_type=ShapeType.STRING -) - -REPLICA_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ReplicaStatus"), - shape_type=ShapeType.ENUM, - members={ - "CREATING": {"target": UNIT}, - "CREATION_FAILED": {"target": UNIT}, - "UPDATING": {"target": UNIT}, - "DELETING": {"target": UNIT}, - "ACTIVE": {"target": UNIT}, - "REGION_DISABLED": {"target": UNIT}, - "INACCESSIBLE_ENCRYPTION_CREDENTIALS": {"target": UNIT}, - "ARCHIVING": {"target": UNIT}, - "ARCHIVED": {"target": UNIT}, - "REPLICATION_NOT_AUTHORIZED": {"target": UNIT}, - }, +LIST_BACKUPS_OUTPUT: StaticSchema = ( + 18, + n0, + _LBO, + {_smith: None}, + (_BSac, _LEBA), + ((BACKUP_SUMMARIES, 0), (BACKUP_ARN, 0)), ) -REPLICA_STATUS_DESCRIPTION = Schema( - id=ShapeID("com.amazonaws.dynamodb#ReplicaStatusDescription"), - shape_type=ShapeType.STRING, +LIST_BACKUPS: StaticOperationSchema = ( + 23, + n0, + _LB, + 0, + LIST_BACKUPS_INPUT, + LIST_BACKUPS_OUTPUT, + (INTERNAL_SERVER_ERROR, INVALID_ENDPOINT_EXCEPTION), ) -REPLICA_STATUS_PERCENT_PROGRESS = Schema( - id=ShapeID("com.amazonaws.dynamodb#ReplicaStatusPercentProgress"), - shape_type=ShapeType.STRING, -) +LIST_CONTRIBUTOR_INSIGHTS_LIMIT: StaticSchema = (7, n0, _LCIL, {_smi: 0}) -TABLE_CLASS = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#TableClass"), - shape_type=ShapeType.ENUM, - members={ - "STANDARD": {"target": UNIT}, - "STANDARD_INFREQUENT_ACCESS": {"target": UNIT}, - }, -) +NEXT_TOKEN_STRING: StaticSchema = (3, n0, _NTS, 0) -TABLE_CLASS_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#TableClassSummary"), - members={ - "TableClass": {"target": TABLE_CLASS}, - "LastUpdateDateTime": {"target": DATE}, - }, +LIST_CONTRIBUTOR_INSIGHTS_INPUT: StaticSchema = ( + 18, + n0, + _LCII, + {_smit: None}, + (_TN, _NT, _MR), + ( + (TABLE_ARN, 0), + (NEXT_TOKEN_STRING, 0), + (LIST_CONTRIBUTOR_INSIGHTS_LIMIT, {_smi: 0}), + ), ) -TABLE_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#TableStatus"), - shape_type=ShapeType.ENUM, - members={ - "CREATING": {"target": UNIT}, - "UPDATING": {"target": UNIT}, - "DELETING": {"target": UNIT}, - "ACTIVE": {"target": UNIT}, - "INACCESSIBLE_ENCRYPTION_CREDENTIALS": {"target": UNIT}, - "ARCHIVING": {"target": UNIT}, - "ARCHIVED": {"target": UNIT}, - "REPLICATION_NOT_AUTHORIZED": {"target": UNIT}, - }, +LIST_CONTRIBUTOR_INSIGHTS_OUTPUT: StaticSchema = ( + 18, + n0, + _LCIO, + {_smith: None}, + (_CISon, _NT), + ((CONTRIBUTOR_INSIGHTS_SUMMARIES, 0), (NEXT_TOKEN_STRING, 0)), ) -TABLE_WARM_THROUGHPUT_DESCRIPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#TableWarmThroughputDescription"), - members={ - "ReadUnitsPerSecond": {"target": POSITIVE_LONG_OBJECT}, - "WriteUnitsPerSecond": {"target": POSITIVE_LONG_OBJECT}, - "Status": {"target": TABLE_STATUS}, - }, +LIST_CONTRIBUTOR_INSIGHTS: StaticOperationSchema = ( + 23, + n0, + _LCI, + 0, + LIST_CONTRIBUTOR_INSIGHTS_INPUT, + LIST_CONTRIBUTOR_INSIGHTS_OUTPUT, + (INTERNAL_SERVER_ERROR, RESOURCE_NOT_FOUND_EXCEPTION), ) -REPLICA_DESCRIPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ReplicaDescription"), - members={ - "RegionName": {"target": REGION_NAME}, - "ReplicaStatus": {"target": REPLICA_STATUS}, - "ReplicaArn": {"target": STRING}, - "ReplicaStatusDescription": {"target": REPLICA_STATUS_DESCRIPTION}, - "ReplicaStatusPercentProgress": {"target": REPLICA_STATUS_PERCENT_PROGRESS}, - "KMSMasterKeyId": {"target": KMS_MASTER_KEY_ID}, - "ProvisionedThroughputOverride": {"target": PROVISIONED_THROUGHPUT_OVERRIDE}, - "OnDemandThroughputOverride": {"target": ON_DEMAND_THROUGHPUT_OVERRIDE}, - "WarmThroughput": {"target": TABLE_WARM_THROUGHPUT_DESCRIPTION}, - "GlobalSecondaryIndexes": { - "target": REPLICA_GLOBAL_SECONDARY_INDEX_DESCRIPTION_LIST - }, - "ReplicaInaccessibleDateTime": {"target": DATE}, - "ReplicaTableClassSummary": {"target": TABLE_CLASS_SUMMARY}, - "GlobalTableSettingsReplicationMode": { - "target": GLOBAL_TABLE_SETTINGS_REPLICATION_MODE - }, - }, -) +LIST_EXPORTS_MAX_LIMIT: StaticSchema = (7, n0, _LEML, 0) -REPLICA_DESCRIPTION_LIST = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ReplicaDescriptionList"), - shape_type=ShapeType.LIST, - members={"member": {"target": REPLICA_DESCRIPTION}}, +EXPORT_NEXT_TOKEN: StaticSchema = (3, n0, _ENT, 0) + +LIST_EXPORTS_INPUT: StaticSchema = ( + 18, + n0, + _LEI, + {_smit: None}, + (_TA, _MR, _NT), + ((TABLE_ARN, 0), (LIST_EXPORTS_MAX_LIMIT, 0), (EXPORT_NEXT_TOKEN, 0)), +) + +EXPORT_SUMMARY: StaticSchema = ( + 18, + n0, + _ESx, + 0, + (_EA, _ES, _ETx), + ((EXPORT_ARN, 0), (EXPORT_STATUS, 0), (EXPORT_TYPE, 0)), +) + +EXPORT_SUMMARIES: StaticSchema = (16, n0, _ESxp, 0, (_m,), ((EXPORT_SUMMARY, 0),)) + +LIST_EXPORTS_OUTPUT: StaticSchema = ( + 18, + n0, + _LEO, + {_smith: None}, + (_ESxp, _NT), + ((EXPORT_SUMMARIES, 0), (EXPORT_NEXT_TOKEN, 0)), +) + +LIST_EXPORTS: StaticOperationSchema = ( + 23, + n0, + _LEi, + 0, + LIST_EXPORTS_INPUT, + LIST_EXPORTS_OUTPUT, + (INTERNAL_SERVER_ERROR, LIMIT_EXCEEDED_EXCEPTION), +) + +LIST_GLOBAL_TABLES_INPUT: StaticSchema = ( + 18, + n0, + _LGTI, + {_smit: None}, + (_ESGTN, _Li, _RN), + ((TABLE_NAME, 0), (POSITIVE_INTEGER_OBJECT, 0), (REGION_NAME, 0)), +) + +GLOBAL_TABLE: StaticSchema = ( + 18, + n0, + _GTl, + 0, + (_GTN, _RG), + ((TABLE_NAME, 0), (REPLICA_LIST, 0)), +) + +GLOBAL_TABLE_LIST: StaticSchema = (16, n0, _GTL, 0, (_m,), ((GLOBAL_TABLE, 0),)) + +LIST_GLOBAL_TABLES_OUTPUT: StaticSchema = ( + 18, + n0, + _LGTO, + {_smith: None}, + (_GTlo, _LEGTN), + ((GLOBAL_TABLE_LIST, 0), (TABLE_NAME, 0)), +) + +LIST_GLOBAL_TABLES: StaticOperationSchema = ( + 23, + n0, + _LGT, + 0, + LIST_GLOBAL_TABLES_INPUT, + LIST_GLOBAL_TABLES_OUTPUT, + (INTERNAL_SERVER_ERROR, INVALID_ENDPOINT_EXCEPTION), +) + +IMPORT_NEXT_TOKEN: StaticSchema = (3, n0, _INT, 0) + +LIST_IMPORTS_MAX_LIMIT: StaticSchema = (7, n0, _LIML, 0) + +LIST_IMPORTS_INPUT: StaticSchema = ( + 18, + n0, + _LII, + {_smit: None}, + (_TA, _PS, _NT), + ((TABLE_ARN, 0), (LIST_IMPORTS_MAX_LIMIT, 0), (IMPORT_NEXT_TOKEN, 0)), +) + +IMPORT_SUMMARY: StaticSchema = ( + 18, + n0, + _ISmp, + 0, + (_IAm, _ISm, _TA, _SBS, _CWLGA, _IFn, _ST, _ETn), + ( + (IMPORT_ARN, 0), + (IMPORT_STATUS, 0), + (TABLE_ARN, 0), + (S3_BUCKET_SOURCE, 0), + (CLOUD_WATCH_LOG_GROUP_ARN, 0), + (INPUT_FORMAT, 0), + (IMPORT_START_TIME, 0), + (IMPORT_END_TIME, 0), + ), ) -GLOBAL_TABLE_DESCRIPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#GlobalTableDescription"), - members={ - "ReplicationGroup": {"target": REPLICA_DESCRIPTION_LIST}, - "GlobalTableArn": {"target": GLOBAL_TABLE_ARN_STRING}, - "CreationDateTime": {"target": DATE}, - "GlobalTableStatus": {"target": GLOBAL_TABLE_STATUS}, - "GlobalTableName": {"target": TABLE_NAME}, - }, +IMPORT_SUMMARY_LIST: StaticSchema = (16, n0, _ISL, 0, (_m,), ((IMPORT_SUMMARY, 0),)) + +LIST_IMPORTS_OUTPUT: StaticSchema = ( + 18, + n0, + _LIO, + {_smith: None}, + (_ISL, _NT), + ((IMPORT_SUMMARY_LIST, 0), (IMPORT_NEXT_TOKEN, 0)), +) + +LIST_IMPORTS: StaticOperationSchema = ( + 23, + n0, + _LI, + 0, + LIST_IMPORTS_INPUT, + LIST_IMPORTS_OUTPUT, + (LIMIT_EXCEEDED_EXCEPTION,), +) + +LIST_TABLES_INPUT_LIMIT: StaticSchema = (7, n0, _LTIL, 0) + +LIST_TABLES_INPUT: StaticSchema = ( + 18, + n0, + _LTI, + {_smit: None}, + (_ESTN, _Li), + ((TABLE_NAME, 0), (LIST_TABLES_INPUT_LIMIT, 0)), +) + +TABLE_NAME_LIST: StaticSchema = (16, n0, _TNL, 0, (_m,), ((TABLE_NAME, 0),)) + +LIST_TABLES_OUTPUT: StaticSchema = ( + 18, + n0, + _LTO, + {_smith: None}, + (_TNa, _LETN), + ((TABLE_NAME_LIST, 0), (TABLE_NAME, 0)), +) + +LIST_TABLES: StaticOperationSchema = ( + 23, + n0, + _LTi, + 0, + LIST_TABLES_INPUT, + LIST_TABLES_OUTPUT, + (INTERNAL_SERVER_ERROR, INVALID_ENDPOINT_EXCEPTION), +) + +LIST_TAGS_OF_RESOURCE_INPUT: StaticSchema = ( + 18, + n0, + _LTORI, + {_smit: None}, + (_RAe, _NT), + ((RESOURCE_ARN_STRING, 1), (NEXT_TOKEN_STRING, 0)), +) + +LIST_TAGS_OF_RESOURCE_OUTPUT: StaticSchema = ( + 18, + n0, + _LTORO, + {_smith: None}, + (_Tag, _NT), + ((TAG_LIST, 0), (NEXT_TOKEN_STRING, 0)), +) + +LIST_TAGS_OF_RESOURCE: StaticOperationSchema = ( + 23, + n0, + _LTOR, + 0, + LIST_TAGS_OF_RESOURCE_INPUT, + LIST_TAGS_OF_RESOURCE_OUTPUT, + (INTERNAL_SERVER_ERROR, INVALID_ENDPOINT_EXCEPTION, RESOURCE_NOT_FOUND_EXCEPTION), +) + +PUT_RESOURCE_POLICY_INPUT: StaticSchema = ( + 18, + n0, + _PRPI, + {_smit: None}, + (_RAe, _Po, _ERI, _CRSRA), + ( + (RESOURCE_ARN_STRING, 1), + (RESOURCE_POLICY, 1), + (POLICY_REVISION_ID, 0), + (CONFIRM_REMOVE_SELF_RESOURCE_ACCESS, {_smi: False, _sH: _xacrsra}), + ), ) -CREATE_GLOBAL_TABLE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#CreateGlobalTableOutput"), - members={"GlobalTableDescription": {"target": GLOBAL_TABLE_DESCRIPTION}}, +PUT_RESOURCE_POLICY_OUTPUT: StaticSchema = ( + 18, + n0, + _PRPO, + {_smith: None}, + (_RI,), + ((POLICY_REVISION_ID, 0),), +) + +PUT_RESOURCE_POLICY: StaticOperationSchema = ( + 23, + n0, + _PRP, + 0, + PUT_RESOURCE_POLICY_INPUT, + PUT_RESOURCE_POLICY_OUTPUT, + ( + INTERNAL_SERVER_ERROR, + INVALID_ENDPOINT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + POLICY_NOT_FOUND_EXCEPTION, + RESOURCE_IN_USE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + ), ) -GLOBAL_TABLE_ALREADY_EXISTS_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#GlobalTableAlreadyExistsException"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], - members={"message": {"target": ERROR_MESSAGE}}, +SELECT: StaticSchema = ( + 14, + n0, + _Se, + 0, + (_AA_, _APA, _SA_, _COUNT), + ((-1, {_sV: _AA_}), (-1, {_sV: _APA}), (-1, {_sV: _SA_}), (-1, {_sV: _COUNT})), +) + +INTEGER: StaticSchema = (7, n0, _I, {_smi: 0}) + +RESTORE_TABLE_FROM_BACKUP_INPUT: StaticSchema = ( + 18, + n0, + _RTFBI, + {_smit: None}, + (_TTN, _BA, _BMO, _GSIO, _LSIO, _PTO, _ODTO, _SSESO, _VIO), + ( + (TABLE_NAME, 1), + (BACKUP_ARN, 1), + (BILLING_MODE, 0), + (GLOBAL_SECONDARY_INDEX_LIST, 0), + (LOCAL_SECONDARY_INDEX_LIST, 0), + (PROVISIONED_THROUGHPUT, 0), + (ON_DEMAND_THROUGHPUT, 0), + (SSE_SPECIFICATION, 0), + (VECTOR_INDEX_LIST, 0), + ), ) -CREATE_GLOBAL_TABLE = Schema( - id=ShapeID("com.amazonaws.dynamodb#CreateGlobalTable"), - shape_type=ShapeType.OPERATION, +RESTORE_TABLE_FROM_BACKUP_OUTPUT: StaticSchema = ( + 18, + n0, + _RTFBO, + {_smith: None}, + (_TD,), + ((TABLE_DESCRIPTION, 0),), +) + +TABLE_ALREADY_EXISTS_EXCEPTION: StaticSchema = ( + 18, + n0, + _TAEE, + {_sm: _c}, + (_me,), + ((ERROR_MESSAGE, 0),), +) + +RESTORE_TABLE_FROM_BACKUP: StaticOperationSchema = ( + 23, + n0, + _RTFB, + 0, + RESTORE_TABLE_FROM_BACKUP_INPUT, + RESTORE_TABLE_FROM_BACKUP_OUTPUT, + ( + BACKUP_IN_USE_EXCEPTION, + BACKUP_NOT_FOUND_EXCEPTION, + INTERNAL_SERVER_ERROR, + INVALID_ENDPOINT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + TABLE_ALREADY_EXISTS_EXCEPTION, + TABLE_IN_USE_EXCEPTION, + ), ) -CREATE_GLOBAL_TABLE_WITNESS_GROUP_MEMBER_ACTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#CreateGlobalTableWitnessGroupMemberAction"), - members={ - "RegionName": { - "target": REGION_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +INVALID_RESTORE_TIME_EXCEPTION: StaticSchema = ( + 18, + n0, + _IRTE, + {_sm: _c}, + (_me,), + ((ERROR_MESSAGE, 0),), +) + +RESTORE_TABLE_TO_POINT_IN_TIME_INPUT: StaticSchema = ( + 18, + n0, + _RTTPITI, + {_smit: None}, + (_STA, _STN, _TTN, _ULRT, _RDT, _BMO, _GSIO, _LSIO, _PTO, _ODTO, _SSESO, _VIO), + ( + (TABLE_ARN, 0), + (TABLE_NAME, 0), + (TABLE_NAME, 1), + (BOOLEAN_OBJECT, 0), + (DATE, 0), + (BILLING_MODE, 0), + (GLOBAL_SECONDARY_INDEX_LIST, 0), + (LOCAL_SECONDARY_INDEX_LIST, 0), + (PROVISIONED_THROUGHPUT, 0), + (ON_DEMAND_THROUGHPUT, 0), + (SSE_SPECIFICATION, 0), + (VECTOR_INDEX_LIST, 0), + ), ) -CREATE_REPLICA_ACTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#CreateReplicaAction"), - members={ - "RegionName": { - "target": REGION_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +RESTORE_TABLE_TO_POINT_IN_TIME_OUTPUT: StaticSchema = ( + 18, + n0, + _RTTPITO, + {_smith: None}, + (_TD,), + ((TABLE_DESCRIPTION, 0),), +) + +RESTORE_TABLE_TO_POINT_IN_TIME: StaticOperationSchema = ( + 23, + n0, + _RTTPIT, + 0, + RESTORE_TABLE_TO_POINT_IN_TIME_INPUT, + RESTORE_TABLE_TO_POINT_IN_TIME_OUTPUT, + ( + INTERNAL_SERVER_ERROR, + INVALID_ENDPOINT_EXCEPTION, + INVALID_RESTORE_TIME_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + POINT_IN_TIME_RECOVERY_UNAVAILABLE_EXCEPTION, + TABLE_ALREADY_EXISTS_EXCEPTION, + TABLE_IN_USE_EXCEPTION, + TABLE_NOT_FOUND_EXCEPTION, + ), ) -REPLICA_GLOBAL_SECONDARY_INDEX = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ReplicaGlobalSecondaryIndex"), - members={ - "IndexName": { - "target": INDEX_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ProvisionedThroughputOverride": {"target": PROVISIONED_THROUGHPUT_OVERRIDE}, - "OnDemandThroughputOverride": {"target": ON_DEMAND_THROUGHPUT_OVERRIDE}, - }, -) +SCAN_SEGMENT: StaticSchema = (7, n0, _SSc, 0) -REPLICA_GLOBAL_SECONDARY_INDEX_LIST = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ReplicaGlobalSecondaryIndexList"), - shape_type=ShapeType.LIST, - members={"member": {"target": REPLICA_GLOBAL_SECONDARY_INDEX}}, -) - -CREATE_REPLICATION_GROUP_MEMBER_ACTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#CreateReplicationGroupMemberAction"), - members={ - "RegionName": { - "target": REGION_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "KMSMasterKeyId": {"target": KMS_MASTER_KEY_ID}, - "ProvisionedThroughputOverride": {"target": PROVISIONED_THROUGHPUT_OVERRIDE}, - "OnDemandThroughputOverride": {"target": ON_DEMAND_THROUGHPUT_OVERRIDE}, - "GlobalSecondaryIndexes": {"target": REPLICA_GLOBAL_SECONDARY_INDEX_LIST}, - "TableClassOverride": {"target": TABLE_CLASS}, - }, -) +SCAN_TOTAL_SEGMENTS: StaticSchema = (7, n0, _STS, 0) -DELETION_PROTECTION_ENABLED = Schema( - id=ShapeID("com.amazonaws.dynamodb#DeletionProtectionEnabled"), - shape_type=ShapeType.BOOLEAN, -) - -GLOBAL_SECONDARY_INDEX = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#GlobalSecondaryIndex"), - members={ - "IndexName": { - "target": INDEX_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "KeySchema": { - "target": KEY_SCHEMA, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Projection": { - "target": PROJECTION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ProvisionedThroughput": {"target": PROVISIONED_THROUGHPUT}, - "OnDemandThroughput": {"target": ON_DEMAND_THROUGHPUT}, - "WarmThroughput": {"target": WARM_THROUGHPUT}, - }, -) +TOP_K_INTEGER: StaticSchema = (7, n0, _TKI, 0) -GLOBAL_SECONDARY_INDEX_LIST = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#GlobalSecondaryIndexList"), - shape_type=ShapeType.LIST, - members={"member": {"target": GLOBAL_SECONDARY_INDEX}}, -) - -LOCAL_SECONDARY_INDEX = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#LocalSecondaryIndex"), - members={ - "IndexName": { - "target": INDEX_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "KeySchema": { - "target": KEY_SCHEMA, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Projection": { - "target": PROJECTION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +SCORE_NUMBER: StaticSchema = (10, n0, _SN, {_smi: 0}) -LOCAL_SECONDARY_INDEX_LIST = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#LocalSecondaryIndexList"), - shape_type=ShapeType.LIST, - members={"member": {"target": LOCAL_SECONDARY_INDEX}}, +TAG_RESOURCE_INPUT: StaticSchema = ( + 18, + n0, + _TRI, + {_smit: None}, + (_RAe, _Tag), + ((RESOURCE_ARN_STRING, 1), (TAG_LIST, 1)), ) -RESOURCE_POLICY = Schema( - id=ShapeID("com.amazonaws.dynamodb#ResourcePolicy"), shape_type=ShapeType.STRING -) +TAG_RESOURCE_OUTPUT: StaticSchema = (18, n0, _TRO, {_sSI: _sU, _smith: None}) -SSE_ENABLED = Schema( - id=ShapeID("com.amazonaws.dynamodb#SSEEnabled"), shape_type=ShapeType.BOOLEAN +TAG_RESOURCE: StaticOperationSchema = ( + 23, + n0, + _TRa, + 0, + TAG_RESOURCE_INPUT, + TAG_RESOURCE_OUTPUT, + ( + INTERNAL_SERVER_ERROR, + INVALID_ENDPOINT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + RESOURCE_IN_USE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + ), ) -SSE_SPECIFICATION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#SSESpecification"), - members={ - "Enabled": {"target": SSE_ENABLED}, - "SSEType": {"target": SSE_TYPE}, - "KMSMasterKeyId": {"target": KMS_MASTER_KEY_ID}, - }, -) +UPDATE_EXPRESSION: StaticSchema = (3, n0, _UE, 0) -TAG_KEY_STRING = Schema( - id=ShapeID("com.amazonaws.dynamodb#TagKeyString"), shape_type=ShapeType.STRING -) +TAG_KEY_LIST: StaticSchema = (16, n0, _TKL, 0, (_m,), ((TAG_KEY_STRING, 0),)) -TAG_VALUE_STRING = Schema( - id=ShapeID("com.amazonaws.dynamodb#TagValueString"), shape_type=ShapeType.STRING +UNTAG_RESOURCE_INPUT: StaticSchema = ( + 18, + n0, + _URI, + {_smit: None}, + (_RAe, _TKa), + ((RESOURCE_ARN_STRING, 1), (TAG_KEY_LIST, 1)), ) -TAG = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#Tag"), - members={ - "Key": { - "target": TAG_KEY_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Value": { - "target": TAG_VALUE_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +UNTAG_RESOURCE_OUTPUT: StaticSchema = (18, n0, _URO, {_sSI: _sU, _smith: None}) -TAG_LIST = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#TagList"), - shape_type=ShapeType.LIST, - members={"member": {"target": TAG}}, -) - -VECTOR_INDEX = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#VectorIndex"), - members={ - "IndexName": { - "target": INDEX_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "VectorAttribute": { - "target": VECTOR_ATTRIBUTE_DEFINITION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "SearchSchema": {"target": SEARCH_SCHEMA}, - "Projection": { - "target": PROJECTION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Dimensions": { - "target": POSITIVE_LONG_OBJECT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "DistanceFunction": { - "target": VECTOR_DISTANCE_FUNCTION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +UNTAG_RESOURCE: StaticOperationSchema = ( + 23, + n0, + _UR, + 0, + UNTAG_RESOURCE_INPUT, + UNTAG_RESOURCE_OUTPUT, + ( + INTERNAL_SERVER_ERROR, + INVALID_ENDPOINT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + RESOURCE_IN_USE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + ), ) -VECTOR_INDEX_LIST = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#VectorIndexList"), - shape_type=ShapeType.LIST, - members={"member": {"target": VECTOR_INDEX}}, -) - -CREATE_TABLE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#CreateTableInput"), - members={ - "AttributeDefinitions": {"target": ATTRIBUTE_DEFINITIONS}, - "TableName": { - "target": TABLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "KeySchema": {"target": KEY_SCHEMA}, - "LocalSecondaryIndexes": {"target": LOCAL_SECONDARY_INDEX_LIST}, - "GlobalSecondaryIndexes": {"target": GLOBAL_SECONDARY_INDEX_LIST}, - "BillingMode": {"target": BILLING_MODE}, - "ProvisionedThroughput": {"target": PROVISIONED_THROUGHPUT}, - "StreamSpecification": {"target": STREAM_SPECIFICATION}, - "SSESpecification": {"target": SSE_SPECIFICATION}, - "Tags": {"target": TAG_LIST}, - "TableClass": {"target": TABLE_CLASS}, - "DeletionProtectionEnabled": {"target": DELETION_PROTECTION_ENABLED}, - "WarmThroughput": {"target": WARM_THROUGHPUT}, - "ResourcePolicy": {"target": RESOURCE_POLICY}, - "OnDemandThroughput": {"target": ON_DEMAND_THROUGHPUT}, - "GlobalTableSourceArn": {"target": TABLE_ARN}, - "GlobalTableSettingsReplicationMode": { - "target": GLOBAL_TABLE_SETTINGS_REPLICATION_MODE - }, - "VectorIndexes": {"target": VECTOR_INDEX_LIST}, - }, +POINT_IN_TIME_RECOVERY_SPECIFICATION: StaticSchema = ( + 18, + n0, + _PITRSo, + 0, + (_PITRE, _RPID), + ((BOOLEAN_OBJECT, 1), (RECOVERY_PERIOD_IN_DAYS, 0)), +) + +UPDATE_CONTINUOUS_BACKUPS_INPUT: StaticSchema = ( + 18, + n0, + _UCBI, + {_smit: None}, + (_TN, _PITRSo), + ((TABLE_ARN, 1), (POINT_IN_TIME_RECOVERY_SPECIFICATION, 1)), +) + +UPDATE_CONTINUOUS_BACKUPS_OUTPUT: StaticSchema = ( + 18, + n0, + _UCBO, + {_smith: None}, + (_CBD,), + ((CONTINUOUS_BACKUPS_DESCRIPTION, 0),), +) + +UPDATE_CONTINUOUS_BACKUPS: StaticOperationSchema = ( + 23, + n0, + _UCB, + 0, + UPDATE_CONTINUOUS_BACKUPS_INPUT, + UPDATE_CONTINUOUS_BACKUPS_OUTPUT, + ( + CONTINUOUS_BACKUPS_UNAVAILABLE_EXCEPTION, + INTERNAL_SERVER_ERROR, + INVALID_ENDPOINT_EXCEPTION, + TABLE_NOT_FOUND_EXCEPTION, + ), ) -NON_NEGATIVE_LONG_OBJECT = Schema( - id=ShapeID("com.amazonaws.dynamodb#NonNegativeLongObject"), - shape_type=ShapeType.LONG, +UPDATE_CONTRIBUTOR_INSIGHTS_INPUT: StaticSchema = ( + 18, + n0, + _UCII, + {_smit: None}, + (_TN, _IN, _CIA, _CIM), + ( + (TABLE_ARN, 1), + (INDEX_NAME, 0), + (CONTRIBUTOR_INSIGHTS_ACTION, 1), + (CONTRIBUTOR_INSIGHTS_MODE, 0), + ), ) -PROVISIONED_THROUGHPUT_DESCRIPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ProvisionedThroughputDescription"), - members={ - "LastIncreaseDateTime": {"target": DATE}, - "LastDecreaseDateTime": {"target": DATE}, - "NumberOfDecreasesToday": {"target": POSITIVE_LONG_OBJECT}, - "ReadCapacityUnits": {"target": NON_NEGATIVE_LONG_OBJECT}, - "WriteCapacityUnits": {"target": NON_NEGATIVE_LONG_OBJECT}, - }, +UPDATE_CONTRIBUTOR_INSIGHTS_OUTPUT: StaticSchema = ( + 18, + n0, + _UCIO, + {_smith: None}, + (_TN, _IN, _CIS, _CIM), + ( + (TABLE_NAME, 0), + (INDEX_NAME, 0), + (CONTRIBUTOR_INSIGHTS_STATUS, 0), + (CONTRIBUTOR_INSIGHTS_MODE, 0), + ), ) -GLOBAL_SECONDARY_INDEX_DESCRIPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#GlobalSecondaryIndexDescription"), - members={ - "IndexName": {"target": INDEX_NAME}, - "KeySchema": {"target": KEY_SCHEMA}, - "Projection": {"target": PROJECTION}, - "IndexStatus": {"target": INDEX_STATUS}, - "Backfilling": {"target": BACKFILLING}, - "ProvisionedThroughput": {"target": PROVISIONED_THROUGHPUT_DESCRIPTION}, - "IndexSizeBytes": {"target": LONG_OBJECT}, - "ItemCount": {"target": LONG_OBJECT}, - "IndexArn": {"target": STRING}, - "OnDemandThroughput": {"target": ON_DEMAND_THROUGHPUT}, - "WarmThroughput": { - "target": GLOBAL_SECONDARY_INDEX_WARM_THROUGHPUT_DESCRIPTION - }, - }, +UPDATE_CONTRIBUTOR_INSIGHTS: StaticOperationSchema = ( + 23, + n0, + _UCI, + 0, + UPDATE_CONTRIBUTOR_INSIGHTS_INPUT, + UPDATE_CONTRIBUTOR_INSIGHTS_OUTPUT, + (INTERNAL_SERVER_ERROR, RESOURCE_NOT_FOUND_EXCEPTION), +) + +REPLICA_ALREADY_EXISTS_EXCEPTION: StaticSchema = ( + 18, + n0, + _RAEE, + {_sm: _c}, + (_me,), + ((ERROR_MESSAGE, 0),), +) + +REPLICA_NOT_FOUND_EXCEPTION: StaticSchema = ( + 18, + n0, + _RNFEe, + {_sm: _c}, + (_me,), + ((ERROR_MESSAGE, 0),), +) + +REPLICA_UPDATE: StaticSchema = ( + 18, + n0, + _RU, + 0, + (_Cr, _Del), + ((CREATE_REPLICA_ACTION, 0), (DELETE_REPLICA_ACTION, 0)), +) + +REPLICA_UPDATE_LIST: StaticSchema = (16, n0, _RUL, 0, (_m,), ((REPLICA_UPDATE, 0),)) + +UPDATE_GLOBAL_TABLE_INPUT: StaticSchema = ( + 18, + n0, + _UGTI, + {_smit: None}, + (_GTN, _RUe), + ((TABLE_NAME, 1), (REPLICA_UPDATE_LIST, 1)), +) + +UPDATE_GLOBAL_TABLE_OUTPUT: StaticSchema = ( + 18, + n0, + _UGTO, + {_smith: None}, + (_GTD,), + ((GLOBAL_TABLE_DESCRIPTION, 0),), +) + +UPDATE_GLOBAL_TABLE: StaticOperationSchema = ( + 23, + n0, + _UGT, + 0, + UPDATE_GLOBAL_TABLE_INPUT, + UPDATE_GLOBAL_TABLE_OUTPUT, + ( + GLOBAL_TABLE_NOT_FOUND_EXCEPTION, + INTERNAL_SERVER_ERROR, + INVALID_ENDPOINT_EXCEPTION, + REPLICA_ALREADY_EXISTS_EXCEPTION, + REPLICA_NOT_FOUND_EXCEPTION, + TABLE_NOT_FOUND_EXCEPTION, + ), ) -GLOBAL_SECONDARY_INDEX_DESCRIPTION_LIST = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#GlobalSecondaryIndexDescriptionList"), - shape_type=ShapeType.LIST, - members={"member": {"target": GLOBAL_SECONDARY_INDEX_DESCRIPTION}}, +INDEX_NOT_FOUND_EXCEPTION: StaticSchema = ( + 18, + n0, + _INFEn, + {_sm: _c}, + (_me,), + ((ERROR_MESSAGE, 0),), +) + +GLOBAL_TABLE_GLOBAL_SECONDARY_INDEX_SETTINGS_UPDATE: StaticSchema = ( + 18, + n0, + _GTGSISU, + 0, + (_IN, _PWCU, _PWCASSU), + ((INDEX_NAME, 1), (POSITIVE_LONG_OBJECT, 0), (AUTO_SCALING_SETTINGS_UPDATE, 0)), +) + +GLOBAL_TABLE_GLOBAL_SECONDARY_INDEX_SETTINGS_UPDATE_LIST: StaticSchema = ( + 16, + n0, + _GTGSISUL, + 0, + (_m,), + ((GLOBAL_TABLE_GLOBAL_SECONDARY_INDEX_SETTINGS_UPDATE, 0),), +) + +REPLICA_GLOBAL_SECONDARY_INDEX_SETTINGS_UPDATE: StaticSchema = ( + 18, + n0, + _RGSISU, + 0, + (_IN, _PRCU, _PRCASSU), + ((INDEX_NAME, 1), (POSITIVE_LONG_OBJECT, 0), (AUTO_SCALING_SETTINGS_UPDATE, 0)), +) + +REPLICA_GLOBAL_SECONDARY_INDEX_SETTINGS_UPDATE_LIST: StaticSchema = ( + 16, + n0, + _RGSISUL, + 0, + (_m,), + ((REPLICA_GLOBAL_SECONDARY_INDEX_SETTINGS_UPDATE, 0),), +) + +REPLICA_SETTINGS_UPDATE: StaticSchema = ( + 18, + n0, + _RSU, + 0, + (_RN, _RPRCU, _RPRCASSU, _RGSISU, _RTC), + ( + (REGION_NAME, 1), + (POSITIVE_LONG_OBJECT, 0), + (AUTO_SCALING_SETTINGS_UPDATE, 0), + (REPLICA_GLOBAL_SECONDARY_INDEX_SETTINGS_UPDATE_LIST, 0), + (TABLE_CLASS, 0), + ), ) -WITNESS_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#WitnessStatus"), - shape_type=ShapeType.ENUM, - members={ - "CREATING": {"target": UNIT}, - "DELETING": {"target": UNIT}, - "ACTIVE": {"target": UNIT}, - }, +REPLICA_SETTINGS_UPDATE_LIST: StaticSchema = ( + 16, + n0, + _RSUL, + 0, + (_m,), + ((REPLICA_SETTINGS_UPDATE, 0),), +) + +UPDATE_GLOBAL_TABLE_SETTINGS_INPUT: StaticSchema = ( + 18, + n0, + _UGTSI, + {_smit: None}, + (_GTN, _GTBM, _GTPWCU, _GTPWCASSU, _GTGSISU, _RSU), + ( + (TABLE_NAME, 1), + (BILLING_MODE, 0), + (POSITIVE_LONG_OBJECT, 0), + (AUTO_SCALING_SETTINGS_UPDATE, 0), + (GLOBAL_TABLE_GLOBAL_SECONDARY_INDEX_SETTINGS_UPDATE_LIST, 0), + (REPLICA_SETTINGS_UPDATE_LIST, 0), + ), ) -GLOBAL_TABLE_WITNESS_DESCRIPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#GlobalTableWitnessDescription"), - members={ - "RegionName": {"target": REGION_NAME}, - "WitnessStatus": {"target": WITNESS_STATUS}, - }, +UPDATE_GLOBAL_TABLE_SETTINGS_OUTPUT: StaticSchema = ( + 18, + n0, + _UGTSO, + {_smith: None}, + (_GTN, _RSep), + ((TABLE_NAME, 0), (REPLICA_SETTINGS_DESCRIPTION_LIST, 0)), +) + +UPDATE_GLOBAL_TABLE_SETTINGS: StaticOperationSchema = ( + 23, + n0, + _UGTS, + 0, + UPDATE_GLOBAL_TABLE_SETTINGS_INPUT, + UPDATE_GLOBAL_TABLE_SETTINGS_OUTPUT, + ( + GLOBAL_TABLE_NOT_FOUND_EXCEPTION, + INDEX_NOT_FOUND_EXCEPTION, + INTERNAL_SERVER_ERROR, + INVALID_ENDPOINT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + REPLICA_NOT_FOUND_EXCEPTION, + RESOURCE_IN_USE_EXCEPTION, + ), ) -GLOBAL_TABLE_WITNESS_DESCRIPTION_LIST = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#GlobalTableWitnessDescriptionList"), - shape_type=ShapeType.LIST, - members={"member": {"target": GLOBAL_TABLE_WITNESS_DESCRIPTION}}, +UPDATE_KINESIS_STREAMING_CONFIGURATION: StaticSchema = ( + 18, + n0, + _UKSC, + 0, + (_ACDTP,), + ((APPROXIMATE_CREATION_DATE_TIME_PRECISION, 0),), +) + +UPDATE_KINESIS_STREAMING_DESTINATION_INPUT: StaticSchema = ( + 18, + n0, + _UKSDI, + {_smit: None}, + (_TN, _SA, _UKSC), + ((TABLE_ARN, 1), (STREAM_ARN, 1), (UPDATE_KINESIS_STREAMING_CONFIGURATION, 0)), +) + +UPDATE_KINESIS_STREAMING_DESTINATION_OUTPUT: StaticSchema = ( + 18, + n0, + _UKSDO, + {_smith: None}, + (_TN, _SA, _DS, _UKSC), + ( + (TABLE_NAME, 0), + (STREAM_ARN, 0), + (DESTINATION_STATUS, 0), + (UPDATE_KINESIS_STREAMING_CONFIGURATION, 0), + ), ) -STREAM_ARN = Schema( - id=ShapeID("com.amazonaws.dynamodb#StreamArn"), shape_type=ShapeType.STRING +UPDATE_KINESIS_STREAMING_DESTINATION: StaticOperationSchema = ( + 23, + n0, + _UKSD, + 0, + UPDATE_KINESIS_STREAMING_DESTINATION_INPUT, + UPDATE_KINESIS_STREAMING_DESTINATION_OUTPUT, + ( + INTERNAL_SERVER_ERROR, + INVALID_ENDPOINT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + RESOURCE_IN_USE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + ), ) -LOCAL_SECONDARY_INDEX_DESCRIPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#LocalSecondaryIndexDescription"), - members={ - "IndexName": {"target": INDEX_NAME}, - "KeySchema": {"target": KEY_SCHEMA}, - "Projection": {"target": PROJECTION}, - "IndexSizeBytes": {"target": LONG_OBJECT}, - "ItemCount": {"target": LONG_OBJECT}, - "IndexArn": {"target": STRING}, - }, +UPDATE_GLOBAL_SECONDARY_INDEX_ACTION: StaticSchema = ( + 18, + n0, + _UGSIA, + 0, + (_IN, _PT, _ODT, _WT), + ( + (INDEX_NAME, 1), + (PROVISIONED_THROUGHPUT, 0), + (ON_DEMAND_THROUGHPUT, 0), + (WARM_THROUGHPUT, 0), + ), ) -LOCAL_SECONDARY_INDEX_DESCRIPTION_LIST = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#LocalSecondaryIndexDescriptionList"), - shape_type=ShapeType.LIST, - members={"member": {"target": LOCAL_SECONDARY_INDEX_DESCRIPTION}}, +GLOBAL_SECONDARY_INDEX_UPDATE: StaticSchema = ( + 18, + n0, + _GSIU, + 0, + (_U, _Cr, _Del), + ( + (UPDATE_GLOBAL_SECONDARY_INDEX_ACTION, 0), + (CREATE_GLOBAL_SECONDARY_INDEX_ACTION, 0), + (DELETE_GLOBAL_SECONDARY_INDEX_ACTION, 0), + ), ) -MULTI_REGION_CONSISTENCY = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#MultiRegionConsistency"), - shape_type=ShapeType.ENUM, - members={"EVENTUAL": {"target": UNIT}, "STRONG": {"target": UNIT}}, +GLOBAL_SECONDARY_INDEX_UPDATE_LIST: StaticSchema = ( + 16, + n0, + _GSIUL, + 0, + (_m,), + ((GLOBAL_SECONDARY_INDEX_UPDATE, 0),), +) + +GLOBAL_TABLE_WITNESS_GROUP_UPDATE: StaticSchema = ( + 18, + n0, + _GTWGU, + 0, + (_Cr, _Del), + ( + (CREATE_GLOBAL_TABLE_WITNESS_GROUP_MEMBER_ACTION, 0), + (DELETE_GLOBAL_TABLE_WITNESS_GROUP_MEMBER_ACTION, 0), + ), ) -RESTORE_IN_PROGRESS = Schema( - id=ShapeID("com.amazonaws.dynamodb#RestoreInProgress"), shape_type=ShapeType.BOOLEAN +GLOBAL_TABLE_WITNESS_GROUP_UPDATE_LIST: StaticSchema = ( + 16, + n0, + _GTWGUL, + 0, + (_m,), + ((GLOBAL_TABLE_WITNESS_GROUP_UPDATE, 0),), +) + +UPDATE_REPLICATION_GROUP_MEMBER_ACTION: StaticSchema = ( + 18, + n0, + _URGMA, + 0, + (_RN, _KMSMKI, _PTO, _ODTO, _GSI, _TCO), + ( + (REGION_NAME, 1), + (KMS_MASTER_KEY_ID, 0), + (PROVISIONED_THROUGHPUT_OVERRIDE, 0), + (ON_DEMAND_THROUGHPUT_OVERRIDE, 0), + (REPLICA_GLOBAL_SECONDARY_INDEX_LIST, 0), + (TABLE_CLASS, 0), + ), ) -RESTORE_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#RestoreSummary"), - members={ - "SourceBackupArn": {"target": BACKUP_ARN}, - "SourceTableArn": {"target": TABLE_ARN}, - "RestoreDateTime": { - "target": DATE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "RestoreInProgress": { - "target": RESTORE_IN_PROGRESS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +REPLICATION_GROUP_UPDATE: StaticSchema = ( + 18, + n0, + _RGU, + 0, + (_Cr, _U, _Del), + ( + (CREATE_REPLICATION_GROUP_MEMBER_ACTION, 0), + (UPDATE_REPLICATION_GROUP_MEMBER_ACTION, 0), + (DELETE_REPLICATION_GROUP_MEMBER_ACTION, 0), + ), ) -VECTOR_INDEX_DESCRIPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#VectorIndexDescription"), - members={ - "IndexName": {"target": INDEX_NAME}, - "SearchSchema": {"target": SEARCH_SCHEMA}, - "Projection": {"target": PROJECTION}, - "VectorAttribute": {"target": VECTOR_ATTRIBUTE_DEFINITION}, - "Dimensions": {"target": POSITIVE_LONG_OBJECT}, - "DistanceFunction": {"target": VECTOR_DISTANCE_FUNCTION}, - "IndexStatus": {"target": INDEX_STATUS}, - "Backfilling": {"target": BACKFILLING}, - "IndexSizeBytes": {"target": LONG_OBJECT}, - "ItemCount": {"target": LONG_OBJECT}, - "IndexArn": {"target": STRING}, - }, +REPLICATION_GROUP_UPDATE_LIST: StaticSchema = ( + 16, + n0, + _RGUL, + 0, + (_m,), + ((REPLICATION_GROUP_UPDATE, 0),), +) + +VECTOR_INDEX_UPDATE: StaticSchema = ( + 18, + n0, + _VIU, + 0, + (_Cr, _Del), + ((CREATE_VECTOR_INDEX_ACTION, 0), (DELETE_VECTOR_INDEX_ACTION, 0)), +) + +VECTOR_INDEX_UPDATE_LIST: StaticSchema = ( + 16, + n0, + _VIUL, + 0, + (_m,), + ((VECTOR_INDEX_UPDATE, 0),), +) + +UPDATE_TABLE_INPUT: StaticSchema = ( + 18, + n0, + _UTI, + {_smit: None}, + ( + _ADt, + _TN, + _BM, + _PT, + _GSIUl, + _SS, + _SSESp, + _RUe, + _TCa, + _DPE, + _MRC, + _GTWU, + _ODT, + _WT, + _GTSRM, + _VIUe, + ), + ( + (ATTRIBUTE_DEFINITIONS, 0), + (TABLE_ARN, 1), + (BILLING_MODE, 0), + (PROVISIONED_THROUGHPUT, 0), + (GLOBAL_SECONDARY_INDEX_UPDATE_LIST, 0), + (STREAM_SPECIFICATION, 0), + (SSE_SPECIFICATION, 0), + (REPLICATION_GROUP_UPDATE_LIST, 0), + (TABLE_CLASS, 0), + (DELETION_PROTECTION_ENABLED, 0), + (MULTI_REGION_CONSISTENCY, 0), + (GLOBAL_TABLE_WITNESS_GROUP_UPDATE_LIST, 0), + (ON_DEMAND_THROUGHPUT, 0), + (WARM_THROUGHPUT, 0), + (GLOBAL_TABLE_SETTINGS_REPLICATION_MODE, 0), + (VECTOR_INDEX_UPDATE_LIST, 0), + ), ) -VECTOR_INDEX_DESCRIPTION_LIST = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#VectorIndexDescriptionList"), - shape_type=ShapeType.LIST, - members={"member": {"target": VECTOR_INDEX_DESCRIPTION}}, -) - -TABLE_DESCRIPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#TableDescription"), - members={ - "AttributeDefinitions": {"target": ATTRIBUTE_DEFINITIONS}, - "TableName": {"target": TABLE_NAME}, - "KeySchema": {"target": KEY_SCHEMA}, - "TableStatus": {"target": TABLE_STATUS}, - "CreationDateTime": {"target": DATE}, - "ProvisionedThroughput": {"target": PROVISIONED_THROUGHPUT_DESCRIPTION}, - "TableSizeBytes": {"target": LONG_OBJECT}, - "ItemCount": {"target": LONG_OBJECT}, - "TableArn": {"target": STRING}, - "TableId": {"target": TABLE_ID}, - "BillingModeSummary": {"target": BILLING_MODE_SUMMARY}, - "LocalSecondaryIndexes": {"target": LOCAL_SECONDARY_INDEX_DESCRIPTION_LIST}, - "GlobalSecondaryIndexes": {"target": GLOBAL_SECONDARY_INDEX_DESCRIPTION_LIST}, - "StreamSpecification": {"target": STREAM_SPECIFICATION}, - "LatestStreamLabel": {"target": STRING}, - "LatestStreamArn": {"target": STREAM_ARN}, - "GlobalTableVersion": {"target": STRING}, - "Replicas": {"target": REPLICA_DESCRIPTION_LIST}, - "GlobalTableWitnesses": {"target": GLOBAL_TABLE_WITNESS_DESCRIPTION_LIST}, - "GlobalTableSettingsReplicationMode": { - "target": GLOBAL_TABLE_SETTINGS_REPLICATION_MODE - }, - "RestoreSummary": {"target": RESTORE_SUMMARY}, - "SSEDescription": {"target": SSE_DESCRIPTION}, - "ArchivalSummary": {"target": ARCHIVAL_SUMMARY}, - "TableClassSummary": {"target": TABLE_CLASS_SUMMARY}, - "DeletionProtectionEnabled": {"target": DELETION_PROTECTION_ENABLED}, - "OnDemandThroughput": {"target": ON_DEMAND_THROUGHPUT}, - "WarmThroughput": {"target": TABLE_WARM_THROUGHPUT_DESCRIPTION}, - "MultiRegionConsistency": {"target": MULTI_REGION_CONSISTENCY}, - "VectorIndexes": {"target": VECTOR_INDEX_DESCRIPTION_LIST}, - }, +UPDATE_TABLE_OUTPUT: StaticSchema = ( + 18, + n0, + _UTO, + {_smith: None}, + (_TD,), + ((TABLE_DESCRIPTION, 0),), +) + +UPDATE_TABLE: StaticOperationSchema = ( + 23, + n0, + _UT, + 0, + UPDATE_TABLE_INPUT, + UPDATE_TABLE_OUTPUT, + ( + INTERNAL_SERVER_ERROR, + INVALID_ENDPOINT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + RESOURCE_IN_USE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + ), ) -CREATE_TABLE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#CreateTableOutput"), - members={"TableDescription": {"target": TABLE_DESCRIPTION}}, -) - -RESOURCE_IN_USE_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ResourceInUseException"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], - members={"message": {"target": ERROR_MESSAGE}}, -) - -CREATE_TABLE = Schema( - id=ShapeID("com.amazonaws.dynamodb#CreateTable"), shape_type=ShapeType.OPERATION -) - -CREATE_VECTOR_INDEX_ACTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#CreateVectorIndexAction"), - members={ - "IndexName": { - "target": INDEX_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "VectorAttribute": { - "target": VECTOR_ATTRIBUTE_DEFINITION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "SearchSchema": {"target": SEARCH_SCHEMA}, - "Projection": { - "target": PROJECTION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Dimensions": { - "target": POSITIVE_LONG_OBJECT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "DistanceFunction": { - "target": VECTOR_DISTANCE_FUNCTION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +GLOBAL_SECONDARY_INDEX_AUTO_SCALING_UPDATE: StaticSchema = ( + 18, + n0, + _GSIASU, + 0, + (_IN, _PWCASU), + ((INDEX_NAME, 0), (AUTO_SCALING_SETTINGS_UPDATE, 0)), +) + +GLOBAL_SECONDARY_INDEX_AUTO_SCALING_UPDATE_LIST: StaticSchema = ( + 16, + n0, + _GSIASUL, + 0, + (_m,), + ((GLOBAL_SECONDARY_INDEX_AUTO_SCALING_UPDATE, 0),), +) + +REPLICA_GLOBAL_SECONDARY_INDEX_AUTO_SCALING_UPDATE: StaticSchema = ( + 18, + n0, + _RGSIASU, + 0, + (_IN, _PRCASU), + ((INDEX_NAME, 0), (AUTO_SCALING_SETTINGS_UPDATE, 0)), +) + +REPLICA_GLOBAL_SECONDARY_INDEX_AUTO_SCALING_UPDATE_LIST: StaticSchema = ( + 16, + n0, + _RGSIASUL, + 0, + (_m,), + ((REPLICA_GLOBAL_SECONDARY_INDEX_AUTO_SCALING_UPDATE, 0),), +) + +REPLICA_AUTO_SCALING_UPDATE: StaticSchema = ( + 18, + n0, + _RASU, + 0, + (_RN, _RGSIU, _RPRCASU), + ( + (REGION_NAME, 1), + (REPLICA_GLOBAL_SECONDARY_INDEX_AUTO_SCALING_UPDATE_LIST, 0), + (AUTO_SCALING_SETTINGS_UPDATE, 0), + ), ) -CSV_DELIMITER = Schema( - id=ShapeID("com.amazonaws.dynamodb#CsvDelimiter"), shape_type=ShapeType.STRING +REPLICA_AUTO_SCALING_UPDATE_LIST: StaticSchema = ( + 16, + n0, + _RASUL, + 0, + (_m,), + ((REPLICA_AUTO_SCALING_UPDATE, 0),), +) + +UPDATE_TABLE_REPLICA_AUTO_SCALING_INPUT: StaticSchema = ( + 18, + n0, + _UTRASI, + {_smit: None}, + (_GSIUl, _TN, _PWCASU, _RUe), + ( + (GLOBAL_SECONDARY_INDEX_AUTO_SCALING_UPDATE_LIST, 0), + (TABLE_ARN, 1), + (AUTO_SCALING_SETTINGS_UPDATE, 0), + (REPLICA_AUTO_SCALING_UPDATE_LIST, 0), + ), ) -CSV_HEADER = Schema( - id=ShapeID("com.amazonaws.dynamodb#CsvHeader"), shape_type=ShapeType.STRING +UPDATE_TABLE_REPLICA_AUTO_SCALING_OUTPUT: StaticSchema = ( + 18, + n0, + _UTRASO, + {_smith: None}, + (_TASD,), + ((TABLE_AUTO_SCALING_DESCRIPTION, 0),), +) + +UPDATE_TABLE_REPLICA_AUTO_SCALING: StaticOperationSchema = ( + 23, + n0, + _UTRAS, + 0, + UPDATE_TABLE_REPLICA_AUTO_SCALING_INPUT, + UPDATE_TABLE_REPLICA_AUTO_SCALING_OUTPUT, + ( + INTERNAL_SERVER_ERROR, + LIMIT_EXCEEDED_EXCEPTION, + RESOURCE_IN_USE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + ), ) -CSV_HEADER_LIST = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#CsvHeaderList"), - shape_type=ShapeType.LIST, - members={"member": {"target": CSV_HEADER}}, -) - -CSV_OPTIONS = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#CsvOptions"), - members={ - "Delimiter": {"target": CSV_DELIMITER}, - "HeaderList": {"target": CSV_HEADER_LIST}, - }, -) - -DELETE_BACKUP_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#DeleteBackupInput"), - members={ - "BackupArn": { - "target": BACKUP_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -DELETE_BACKUP_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#DeleteBackupOutput"), - members={"BackupDescription": {"target": BACKUP_DESCRIPTION}}, -) - -DELETE_BACKUP = Schema( - id=ShapeID("com.amazonaws.dynamodb#DeleteBackup"), shape_type=ShapeType.OPERATION -) - -DELETE_GLOBAL_SECONDARY_INDEX_ACTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#DeleteGlobalSecondaryIndexAction"), - members={ - "IndexName": { - "target": INDEX_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -DELETE_GLOBAL_TABLE_WITNESS_GROUP_MEMBER_ACTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#DeleteGlobalTableWitnessGroupMemberAction"), - members={ - "RegionName": { - "target": REGION_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -RETURN_VALUE = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ReturnValue"), - shape_type=ShapeType.ENUM, - members={ - "NONE": {"target": UNIT}, - "ALL_OLD": {"target": UNIT}, - "UPDATED_OLD": {"target": UNIT}, - "ALL_NEW": {"target": UNIT}, - "UPDATED_NEW": {"target": UNIT}, - }, -) - -TRANSACTION_CONFLICT_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#TransactionConflictException"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], - members={"message": {"target": ERROR_MESSAGE}}, -) - -DELETE_REPLICA_ACTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#DeleteReplicaAction"), - members={ - "RegionName": { - "target": REGION_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -DELETE_REPLICATION_GROUP_MEMBER_ACTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#DeleteReplicationGroupMemberAction"), - members={ - "RegionName": { - "target": REGION_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -POLICY_REVISION_ID = Schema( - id=ShapeID("com.amazonaws.dynamodb#PolicyRevisionId"), shape_type=ShapeType.STRING -) - -RESOURCE_ARN_STRING = Schema( - id=ShapeID("com.amazonaws.dynamodb#ResourceArnString"), shape_type=ShapeType.STRING -) - -DELETE_RESOURCE_POLICY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#DeleteResourcePolicyInput"), - members={ - "ResourceArn": { - "target": RESOURCE_ARN_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ExpectedRevisionId": {"target": POLICY_REVISION_ID}, - }, -) - -DELETE_RESOURCE_POLICY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#DeleteResourcePolicyOutput"), - members={"RevisionId": {"target": POLICY_REVISION_ID}}, -) - -POLICY_NOT_FOUND_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#PolicyNotFoundException"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], - members={"message": {"target": ERROR_MESSAGE}}, -) - -DELETE_RESOURCE_POLICY = Schema( - id=ShapeID("com.amazonaws.dynamodb#DeleteResourcePolicy"), - shape_type=ShapeType.OPERATION, -) - -DELETE_TABLE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#DeleteTableInput"), - members={ - "TableName": { - "target": TABLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -DELETE_TABLE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#DeleteTableOutput"), - members={"TableDescription": {"target": TABLE_DESCRIPTION}}, -) - -DELETE_TABLE = Schema( - id=ShapeID("com.amazonaws.dynamodb#DeleteTable"), shape_type=ShapeType.OPERATION -) - -DELETE_VECTOR_INDEX_ACTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#DeleteVectorIndexAction"), - members={ - "IndexName": { - "target": INDEX_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -DESCRIBE_BACKUP_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#DescribeBackupInput"), - members={ - "BackupArn": { - "target": BACKUP_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -DESCRIBE_BACKUP_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#DescribeBackupOutput"), - members={"BackupDescription": {"target": BACKUP_DESCRIPTION}}, -) - -DESCRIBE_BACKUP = Schema( - id=ShapeID("com.amazonaws.dynamodb#DescribeBackup"), shape_type=ShapeType.OPERATION -) - -DESCRIBE_CONTINUOUS_BACKUPS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#DescribeContinuousBackupsInput"), - members={ - "TableName": { - "target": TABLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -DESCRIBE_CONTINUOUS_BACKUPS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#DescribeContinuousBackupsOutput"), - members={ - "ContinuousBackupsDescription": {"target": CONTINUOUS_BACKUPS_DESCRIPTION} - }, -) - -DESCRIBE_CONTINUOUS_BACKUPS = Schema( - id=ShapeID("com.amazonaws.dynamodb#DescribeContinuousBackups"), - shape_type=ShapeType.OPERATION, -) - -DESCRIBE_CONTRIBUTOR_INSIGHTS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#DescribeContributorInsightsInput"), - members={ - "TableName": { - "target": TABLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "IndexName": {"target": INDEX_NAME}, - }, -) - -EXCEPTION_DESCRIPTION = Schema( - id=ShapeID("com.amazonaws.dynamodb#ExceptionDescription"), - shape_type=ShapeType.STRING, -) - -EXCEPTION_NAME = Schema( - id=ShapeID("com.amazonaws.dynamodb#ExceptionName"), shape_type=ShapeType.STRING -) - -FAILURE_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#FailureException"), - members={ - "ExceptionName": {"target": EXCEPTION_NAME}, - "ExceptionDescription": {"target": EXCEPTION_DESCRIPTION}, - }, -) - -LAST_UPDATE_DATE_TIME = Schema( - id=ShapeID("com.amazonaws.dynamodb#LastUpdateDateTime"), - shape_type=ShapeType.TIMESTAMP, -) - -DESCRIBE_CONTRIBUTOR_INSIGHTS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#DescribeContributorInsightsOutput"), - members={ - "TableName": {"target": TABLE_NAME}, - "IndexName": {"target": INDEX_NAME}, - "ContributorInsightsRuleList": {"target": CONTRIBUTOR_INSIGHTS_RULE_LIST}, - "ContributorInsightsStatus": {"target": CONTRIBUTOR_INSIGHTS_STATUS}, - "LastUpdateDateTime": {"target": LAST_UPDATE_DATE_TIME}, - "FailureException": {"target": FAILURE_EXCEPTION}, - "ContributorInsightsMode": {"target": CONTRIBUTOR_INSIGHTS_MODE}, - }, -) - -DESCRIBE_CONTRIBUTOR_INSIGHTS = Schema( - id=ShapeID("com.amazonaws.dynamodb#DescribeContributorInsights"), - shape_type=ShapeType.OPERATION, -) - -DESCRIBE_ENDPOINTS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#DescribeEndpointsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.dynamodb#DescribeEndpointsRequest", - ) - ], -) - -LONG = Schema( - id=ShapeID("com.amazonaws.dynamodb#Long"), - shape_type=ShapeType.LONG, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=0)], -) - -ENDPOINT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#Endpoint"), - members={ - "Address": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "CachePeriodInMinutes": { - "target": LONG, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=0), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - }, -) - -ENDPOINTS = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#Endpoints"), - shape_type=ShapeType.LIST, - members={"member": {"target": ENDPOINT}}, -) - -DESCRIBE_ENDPOINTS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#DescribeEndpointsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.dynamodb#DescribeEndpointsResponse", - ) - ], - members={ - "Endpoints": { - "target": ENDPOINTS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -DESCRIBE_ENDPOINTS = Schema( - id=ShapeID("com.amazonaws.dynamodb#DescribeEndpoints"), - shape_type=ShapeType.OPERATION, -) - -EXPORT_ARN = Schema( - id=ShapeID("com.amazonaws.dynamodb#ExportArn"), shape_type=ShapeType.STRING -) - -DESCRIBE_EXPORT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#DescribeExportInput"), - members={ - "ExportArn": { - "target": EXPORT_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -EXPORT_END_TIME = Schema( - id=ShapeID("com.amazonaws.dynamodb#ExportEndTime"), shape_type=ShapeType.TIMESTAMP -) - -EXPORT_FORMAT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ExportFormat"), - shape_type=ShapeType.ENUM, - members={"DYNAMODB_JSON": {"target": UNIT}, "ION": {"target": UNIT}}, -) - -EXPORT_MANIFEST = Schema( - id=ShapeID("com.amazonaws.dynamodb#ExportManifest"), shape_type=ShapeType.STRING -) - -EXPORT_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ExportStatus"), - shape_type=ShapeType.ENUM, - members={ - "IN_PROGRESS": {"target": UNIT}, - "COMPLETED": {"target": UNIT}, - "FAILED": {"target": UNIT}, - }, -) - -EXPORT_TIME = Schema( - id=ShapeID("com.amazonaws.dynamodb#ExportTime"), shape_type=ShapeType.TIMESTAMP -) - -EXPORT_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ExportType"), - shape_type=ShapeType.ENUM, - members={"FULL_EXPORT": {"target": UNIT}, "INCREMENTAL_EXPORT": {"target": UNIT}}, -) - -FAILURE_CODE = Schema( - id=ShapeID("com.amazonaws.dynamodb#FailureCode"), shape_type=ShapeType.STRING -) - -FAILURE_MESSAGE = Schema( - id=ShapeID("com.amazonaws.dynamodb#FailureMessage"), shape_type=ShapeType.STRING -) - -KEY_EXPRESSION = Schema( - id=ShapeID("com.amazonaws.dynamodb#KeyExpression"), shape_type=ShapeType.STRING -) - -EXPORT_FROM_TIME = Schema( - id=ShapeID("com.amazonaws.dynamodb#ExportFromTime"), shape_type=ShapeType.TIMESTAMP -) - -EXPORT_TO_TIME = Schema( - id=ShapeID("com.amazonaws.dynamodb#ExportToTime"), shape_type=ShapeType.TIMESTAMP -) - -EXPORT_VIEW_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ExportViewType"), - shape_type=ShapeType.ENUM, - members={"NEW_IMAGE": {"target": UNIT}, "NEW_AND_OLD_IMAGES": {"target": UNIT}}, -) - -INCREMENTAL_EXPORT_SPECIFICATION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#IncrementalExportSpecification"), - members={ - "ExportFromTime": {"target": EXPORT_FROM_TIME}, - "ExportToTime": {"target": EXPORT_TO_TIME}, - "ExportViewType": {"target": EXPORT_VIEW_TYPE}, - }, -) - -S3_BUCKET = Schema( - id=ShapeID("com.amazonaws.dynamodb#S3Bucket"), shape_type=ShapeType.STRING -) - -S3_BUCKET_OWNER = Schema( - id=ShapeID("com.amazonaws.dynamodb#S3BucketOwner"), shape_type=ShapeType.STRING -) - -S3_PREFIX = Schema( - id=ShapeID("com.amazonaws.dynamodb#S3Prefix"), shape_type=ShapeType.STRING -) - -S3_SSE_ALGORITHM = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#S3SseAlgorithm"), - shape_type=ShapeType.ENUM, - members={"AES256": {"target": UNIT}, "KMS": {"target": UNIT}}, -) - -S3_SSE_KMS_KEY_ID = Schema( - id=ShapeID("com.amazonaws.dynamodb#S3SseKmsKeyId"), shape_type=ShapeType.STRING -) - -EXPORT_START_TIME = Schema( - id=ShapeID("com.amazonaws.dynamodb#ExportStartTime"), shape_type=ShapeType.TIMESTAMP -) - -EXPORT_NOT_FOUND_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ExportNotFoundException"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], - members={"message": {"target": ERROR_MESSAGE}}, -) - -DESCRIBE_GLOBAL_TABLE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#DescribeGlobalTableInput"), - members={ - "GlobalTableName": { - "target": TABLE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -DESCRIBE_GLOBAL_TABLE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#DescribeGlobalTableOutput"), - members={"GlobalTableDescription": {"target": GLOBAL_TABLE_DESCRIPTION}}, -) - -GLOBAL_TABLE_NOT_FOUND_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#GlobalTableNotFoundException"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], - members={"message": {"target": ERROR_MESSAGE}}, -) - -DESCRIBE_GLOBAL_TABLE = Schema( - id=ShapeID("com.amazonaws.dynamodb#DescribeGlobalTable"), - shape_type=ShapeType.OPERATION, -) - -DESCRIBE_GLOBAL_TABLE_SETTINGS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#DescribeGlobalTableSettingsInput"), - members={ - "GlobalTableName": { - "target": TABLE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -REPLICA_GLOBAL_SECONDARY_INDEX_SETTINGS_DESCRIPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ReplicaGlobalSecondaryIndexSettingsDescription"), - members={ - "IndexName": { - "target": INDEX_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "IndexStatus": {"target": INDEX_STATUS}, - "ProvisionedReadCapacityUnits": {"target": POSITIVE_LONG_OBJECT}, - "ProvisionedReadCapacityAutoScalingSettings": { - "target": AUTO_SCALING_SETTINGS_DESCRIPTION - }, - "ProvisionedWriteCapacityUnits": {"target": POSITIVE_LONG_OBJECT}, - "ProvisionedWriteCapacityAutoScalingSettings": { - "target": AUTO_SCALING_SETTINGS_DESCRIPTION - }, - }, -) - -REPLICA_GLOBAL_SECONDARY_INDEX_SETTINGS_DESCRIPTION_LIST = Schema.collection( - id=ShapeID( - "com.amazonaws.dynamodb#ReplicaGlobalSecondaryIndexSettingsDescriptionList" - ), - shape_type=ShapeType.LIST, - members={"member": {"target": REPLICA_GLOBAL_SECONDARY_INDEX_SETTINGS_DESCRIPTION}}, -) - -REPLICA_SETTINGS_DESCRIPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ReplicaSettingsDescription"), - members={ - "RegionName": { - "target": REGION_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ReplicaStatus": {"target": REPLICA_STATUS}, - "ReplicaBillingModeSummary": {"target": BILLING_MODE_SUMMARY}, - "ReplicaProvisionedReadCapacityUnits": {"target": NON_NEGATIVE_LONG_OBJECT}, - "ReplicaProvisionedReadCapacityAutoScalingSettings": { - "target": AUTO_SCALING_SETTINGS_DESCRIPTION - }, - "ReplicaProvisionedWriteCapacityUnits": {"target": NON_NEGATIVE_LONG_OBJECT}, - "ReplicaProvisionedWriteCapacityAutoScalingSettings": { - "target": AUTO_SCALING_SETTINGS_DESCRIPTION - }, - "ReplicaGlobalSecondaryIndexSettings": { - "target": REPLICA_GLOBAL_SECONDARY_INDEX_SETTINGS_DESCRIPTION_LIST - }, - "ReplicaTableClassSummary": {"target": TABLE_CLASS_SUMMARY}, - }, -) - -REPLICA_SETTINGS_DESCRIPTION_LIST = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ReplicaSettingsDescriptionList"), - shape_type=ShapeType.LIST, - members={"member": {"target": REPLICA_SETTINGS_DESCRIPTION}}, -) - -DESCRIBE_GLOBAL_TABLE_SETTINGS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#DescribeGlobalTableSettingsOutput"), - members={ - "GlobalTableName": {"target": TABLE_NAME}, - "ReplicaSettings": {"target": REPLICA_SETTINGS_DESCRIPTION_LIST}, - }, -) - -DESCRIBE_GLOBAL_TABLE_SETTINGS = Schema( - id=ShapeID("com.amazonaws.dynamodb#DescribeGlobalTableSettings"), - shape_type=ShapeType.OPERATION, -) - -IMPORT_ARN = Schema( - id=ShapeID("com.amazonaws.dynamodb#ImportArn"), shape_type=ShapeType.STRING -) - -DESCRIBE_IMPORT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#DescribeImportInput"), - members={ - "ImportArn": { - "target": IMPORT_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -IMPORT_END_TIME = Schema( - id=ShapeID("com.amazonaws.dynamodb#ImportEndTime"), shape_type=ShapeType.TIMESTAMP -) - -ERROR_COUNT = Schema( - id=ShapeID("com.amazonaws.dynamodb#ErrorCount"), - shape_type=ShapeType.LONG, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=0)], -) - -IMPORTED_ITEM_COUNT = Schema( - id=ShapeID("com.amazonaws.dynamodb#ImportedItemCount"), - shape_type=ShapeType.LONG, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=0)], -) - -IMPORT_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ImportStatus"), - shape_type=ShapeType.ENUM, - members={ - "IN_PROGRESS": {"target": UNIT}, - "COMPLETED": {"target": UNIT}, - "CANCELLING": {"target": UNIT}, - "CANCELLED": {"target": UNIT}, - "FAILED": {"target": UNIT}, - }, -) - -INPUT_COMPRESSION_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#InputCompressionType"), - shape_type=ShapeType.ENUM, - members={ - "GZIP": {"target": UNIT}, - "ZSTD": {"target": UNIT}, - "NONE": {"target": UNIT}, - }, -) - -INPUT_FORMAT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#InputFormat"), - shape_type=ShapeType.ENUM, - members={ - "DYNAMODB_JSON": {"target": UNIT}, - "ION": {"target": UNIT}, - "CSV": {"target": UNIT}, - }, -) - -INPUT_FORMAT_OPTIONS = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#InputFormatOptions"), - members={"Csv": {"target": CSV_OPTIONS}}, +TIME_TO_LIVE_ENABLED: StaticSchema = (2, n0, _TTLE, 0) + +TIME_TO_LIVE_SPECIFICATION: StaticSchema = ( + 18, + n0, + _TTLSi, + 0, + (_E, _AN), + ((TIME_TO_LIVE_ENABLED, 1), (TIME_TO_LIVE_ATTRIBUTE_NAME, 1)), +) + +UPDATE_TIME_TO_LIVE_INPUT: StaticSchema = ( + 18, + n0, + _UTTLI, + {_smit: None}, + (_TN, _TTLSi), + ((TABLE_ARN, 1), (TIME_TO_LIVE_SPECIFICATION, 1)), +) + +UPDATE_TIME_TO_LIVE_OUTPUT: StaticSchema = ( + 18, + n0, + _UTTLO, + {_smith: None}, + (_TTLSi,), + ((TIME_TO_LIVE_SPECIFICATION, 0),), +) + +UPDATE_TIME_TO_LIVE: StaticOperationSchema = ( + 23, + n0, + _UTTL, + 0, + UPDATE_TIME_TO_LIVE_INPUT, + UPDATE_TIME_TO_LIVE_OUTPUT, + ( + INTERNAL_SERVER_ERROR, + INVALID_ENDPOINT_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + RESOURCE_IN_USE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + ), ) -PROCESSED_ITEM_COUNT = Schema( - id=ShapeID("com.amazonaws.dynamodb#ProcessedItemCount"), - shape_type=ShapeType.LONG, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=0)], +ATTRIBUTE_VALUE: StaticSchema = ( + 19, + n0, + _AV, + 0, + (_S, _N, _B, _SS_, _NS, _BS_, _M_, _L_, _NULL, _BOOL), + ( + (STRING_ATTRIBUTE_VALUE, 0), + (NUMBER_ATTRIBUTE_VALUE, 0), + (BINARY_ATTRIBUTE_VALUE, 0), + (STRING_SET_ATTRIBUTE_VALUE, 0), + (NUMBER_SET_ATTRIBUTE_VALUE, 0), + (BINARY_SET_ATTRIBUTE_VALUE, 0), + (lambda: MAP_ATTRIBUTE_VALUE, 0), + (lambda: LIST_ATTRIBUTE_VALUE, 0), + (NULL_ATTRIBUTE_VALUE, 0), + (BOOLEAN_ATTRIBUTE_VALUE, 0), + ), ) -S3_BUCKET_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#S3BucketSource"), - members={ - "S3BucketOwner": {"target": S3_BUCKET_OWNER}, - "S3Bucket": { - "target": S3_BUCKET, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "S3KeyPrefix": {"target": S3_PREFIX}, - }, +LIST_ATTRIBUTE_VALUE: StaticSchema = (16, n0, _LAV, 0, (_m,), ((ATTRIBUTE_VALUE, 0),)) + +MAP_ATTRIBUTE_VALUE: StaticSchema = ( + 17, + n0, + _MAV, + 0, + (_k, _v), + ((ATTRIBUTE_NAME, 0), (ATTRIBUTE_VALUE, 0)), +) + +ATTRIBUTE_MAP: StaticSchema = ( + 17, + n0, + _AM, + 0, + (_k, _v), + ((ATTRIBUTE_NAME, 0), (ATTRIBUTE_VALUE, 0)), +) + +ATTRIBUTE_VALUE_LIST: StaticSchema = (16, n0, _AVL, 0, (_m,), ((ATTRIBUTE_VALUE, 0),)) + +ATTRIBUTE_VALUE_UPDATE: StaticSchema = ( + 18, + n0, + _AVU, + 0, + (_V, _Ac), + ((ATTRIBUTE_VALUE, 0), (ATTRIBUTE_ACTION, 0)), +) + +EXPRESSION_ATTRIBUTE_VALUE_MAP: StaticSchema = ( + 17, + n0, + _EAVM, + 0, + (_k, _v), + ((EXPRESSION_ATTRIBUTE_VALUE_VARIABLE, 0), (ATTRIBUTE_VALUE, 0)), +) + +ITEM_COLLECTION_KEY_ATTRIBUTE_MAP: StaticSchema = ( + 17, + n0, + _ICKAM, + 0, + (_k, _v), + ((ATTRIBUTE_NAME, 0), (ATTRIBUTE_VALUE, 0)), +) + +KEY: StaticSchema = ( + 17, + n0, + _K, + 0, + (_k, _v), + ((ATTRIBUTE_NAME, 0), (ATTRIBUTE_VALUE, 0)), +) + +PREPARED_STATEMENT_PARAMETERS: StaticSchema = ( + 16, + n0, + _PSP, + 0, + (_m,), + ((ATTRIBUTE_VALUE, 0),), +) + +PUT_ITEM_INPUT_ATTRIBUTE_MAP: StaticSchema = ( + 17, + n0, + _PIIAM, + 0, + (_k, _v), + ((ATTRIBUTE_NAME, 0), (ATTRIBUTE_VALUE, 0)), +) + +SEARCH_VECTOR_LIST: StaticSchema = (16, n0, _SVL, 0, (_m,), ((ATTRIBUTE_VALUE, 0),)) + +ATTRIBUTE_UPDATES: StaticSchema = ( + 17, + n0, + _AU, + 0, + (_k, _v), + ((ATTRIBUTE_NAME, 0), (ATTRIBUTE_VALUE_UPDATE, 0)), +) + +BATCH_STATEMENT_ERROR: StaticSchema = ( + 18, + n0, + _BSE, + 0, + (_Co, _M, _It), + ((BATCH_STATEMENT_ERROR_CODE_ENUM, 0), (STRING, 0), (ATTRIBUTE_MAP, 0)), +) + +BATCH_STATEMENT_REQUEST: StaticSchema = ( + 18, + n0, + _BSR, + 0, + (_Stat, _Pa, _CR, _RVOCCF), + ( + (PARTI_QL_STATEMENT, 1), + (PREPARED_STATEMENT_PARAMETERS, 0), + (CONSISTENT_READ, 0), + (RETURN_VALUES_ON_CONDITION_CHECK_FAILURE, 0), + ), ) -IMPORT_START_TIME = Schema( - id=ShapeID("com.amazonaws.dynamodb#ImportStartTime"), shape_type=ShapeType.TIMESTAMP -) - -TABLE_CREATION_PARAMETERS = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#TableCreationParameters"), - members={ - "TableName": { - "target": TABLE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "AttributeDefinitions": { - "target": ATTRIBUTE_DEFINITIONS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "KeySchema": { - "target": KEY_SCHEMA, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "BillingMode": {"target": BILLING_MODE}, - "ProvisionedThroughput": {"target": PROVISIONED_THROUGHPUT}, - "OnDemandThroughput": {"target": ON_DEMAND_THROUGHPUT}, - "SSESpecification": {"target": SSE_SPECIFICATION}, - "GlobalSecondaryIndexes": {"target": GLOBAL_SECONDARY_INDEX_LIST}, - "VectorIndexes": {"target": VECTOR_INDEX_LIST}, - }, +CANCELLATION_REASON: StaticSchema = ( + 18, + n0, + _CRa, + 0, + (_It, _Co, _M), + ((ATTRIBUTE_MAP, 0), (CODE, 0), (ERROR_MESSAGE, 0)), +) + +CONDITION: StaticSchema = ( + 18, + n0, + _Con, + 0, + (_AVL, _CO), + ((ATTRIBUTE_VALUE_LIST, 0), (COMPARISON_OPERATOR, 1)), +) + +CONDITIONAL_CHECK_FAILED_EXCEPTION: StaticSchema = ( + 18, + n0, + _CCFE, + {_sm: _c}, + (_me, _It), + ((ERROR_MESSAGE, 0), (ATTRIBUTE_MAP, 0)), +) + +DELETE_REQUEST: StaticSchema = (18, n0, _DR, 0, (_K,), ((KEY, 1),)) + +EXECUTE_STATEMENT_INPUT: StaticSchema = ( + 18, + n0, + _ESI, + {_smit: None}, + (_Stat, _Pa, _CR, _NT, _RCC, _Li, _RVOCCF), + ( + (PARTI_QL_STATEMENT, 1), + (PREPARED_STATEMENT_PARAMETERS, 0), + (CONSISTENT_READ, 0), + (PARTI_QL_NEXT_TOKEN, 0), + (RETURN_CONSUMED_CAPACITY, 0), + (POSITIVE_INTEGER_OBJECT, 0), + (RETURN_VALUES_ON_CONDITION_CHECK_FAILURE, 0), + ), ) -IMPORT_TABLE_DESCRIPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ImportTableDescription"), - members={ - "ImportArn": {"target": IMPORT_ARN}, - "ImportStatus": {"target": IMPORT_STATUS}, - "TableArn": {"target": TABLE_ARN}, - "TableId": {"target": TABLE_ID}, - "ClientToken": {"target": CLIENT_TOKEN}, - "S3BucketSource": {"target": S3_BUCKET_SOURCE}, - "ErrorCount": { - "target": ERROR_COUNT, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "CloudWatchLogGroupArn": {"target": CLOUD_WATCH_LOG_GROUP_ARN}, - "InputFormat": {"target": INPUT_FORMAT}, - "InputFormatOptions": {"target": INPUT_FORMAT_OPTIONS}, - "InputCompressionType": {"target": INPUT_COMPRESSION_TYPE}, - "TableCreationParameters": {"target": TABLE_CREATION_PARAMETERS}, - "StartTime": {"target": IMPORT_START_TIME}, - "EndTime": {"target": IMPORT_END_TIME}, - "ProcessedSizeBytes": {"target": LONG_OBJECT}, - "ProcessedItemCount": { - "target": PROCESSED_ITEM_COUNT, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "ImportedItemCount": { - "target": IMPORTED_ITEM_COUNT, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "FailureCode": {"target": FAILURE_CODE}, - "FailureMessage": {"target": FAILURE_MESSAGE}, - }, +FILTER_SPECIFICATION: StaticSchema = ( + 18, + n0, + _FS, + 0, + (_FEi, _PE, _KCE, _EAN, _EAV), + ( + (CONDITION_EXPRESSION, 0), + (PROJECTION_EXPRESSION, 0), + (KEY_EXPRESSION, 0), + (EXPRESSION_ATTRIBUTE_NAME_MAP, 0), + (EXPRESSION_ATTRIBUTE_VALUE_MAP, 0), + ), ) -DESCRIBE_IMPORT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#DescribeImportOutput"), - members={ - "ImportTableDescription": { - "target": IMPORT_TABLE_DESCRIPTION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +GET: StaticSchema = ( + 18, + n0, + _G, + 0, + (_K, _TN, _PE, _EAN), + ( + (KEY, 1), + (TABLE_ARN, 1), + (PROJECTION_EXPRESSION, 0), + (EXPRESSION_ATTRIBUTE_NAME_MAP, 0), + ), ) -IMPORT_NOT_FOUND_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ImportNotFoundException"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], - members={"message": {"target": ERROR_MESSAGE}}, +GET_ITEM_INPUT: StaticSchema = ( + 18, + n0, + _GII, + {_smit: None}, + (_TN, _K, _ATG, _CR, _RCC, _PE, _EAN), + ( + (TABLE_ARN, 1), + (KEY, 1), + (ATTRIBUTE_NAME_LIST, 0), + (CONSISTENT_READ, 0), + (RETURN_CONSUMED_CAPACITY, 0), + (PROJECTION_EXPRESSION, 0), + (EXPRESSION_ATTRIBUTE_NAME_MAP, 0), + ), ) -DESCRIBE_IMPORT = Schema( - id=ShapeID("com.amazonaws.dynamodb#DescribeImport"), shape_type=ShapeType.OPERATION +GET_ITEM_OUTPUT: StaticSchema = ( + 18, + n0, + _GIO, + {_smith: None}, + (_It, _CC), + ((ATTRIBUTE_MAP, 0), (CONSUMED_CAPACITY, 0)), ) -DESCRIBE_KINESIS_STREAMING_DESTINATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#DescribeKinesisStreamingDestinationInput"), - members={ - "TableName": { - "target": TABLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +ITEM_COLLECTION_METRICS: StaticSchema = ( + 18, + n0, + _ICM, + 0, + (_ICK, _SERGB), + ((ITEM_COLLECTION_KEY_ATTRIBUTE_MAP, 0), (ITEM_COLLECTION_SIZE_ESTIMATE_RANGE, 0)), ) -DESTINATION_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#DestinationStatus"), - shape_type=ShapeType.ENUM, - members={ - "ENABLING": {"target": UNIT}, - "ACTIVE": {"target": UNIT}, - "DISABLING": {"target": UNIT}, - "DISABLED": {"target": UNIT}, - "ENABLE_FAILED": {"target": UNIT}, - "UPDATING": {"target": UNIT}, - }, -) +ITEM_LIST: StaticSchema = (16, n0, _IL, 0, (_m,), ((ATTRIBUTE_MAP, 0),)) -KINESIS_DATA_STREAM_DESTINATION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#KinesisDataStreamDestination"), - members={ - "StreamArn": {"target": STREAM_ARN}, - "DestinationStatus": {"target": DESTINATION_STATUS}, - "DestinationStatusDescription": {"target": STRING}, - "ApproximateCreationDateTimePrecision": { - "target": APPROXIMATE_CREATION_DATE_TIME_PRECISION - }, - }, -) +ITEM_RESPONSE: StaticSchema = (18, n0, _IR, 0, (_It,), ((ATTRIBUTE_MAP, 0),)) -KINESIS_DATA_STREAM_DESTINATIONS = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#KinesisDataStreamDestinations"), - shape_type=ShapeType.LIST, - members={"member": {"target": KINESIS_DATA_STREAM_DESTINATION}}, -) +KEY_LIST: StaticSchema = (16, n0, _KL, 0, (_m,), ((KEY, 0),)) -DESCRIBE_KINESIS_STREAMING_DESTINATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#DescribeKinesisStreamingDestinationOutput"), - members={ - "TableName": {"target": TABLE_NAME}, - "KinesisDataStreamDestinations": {"target": KINESIS_DATA_STREAM_DESTINATIONS}, - }, +PARAMETERIZED_STATEMENT: StaticSchema = ( + 18, + n0, + _PSa, + 0, + (_Stat, _Pa, _RVOCCF), + ( + (PARTI_QL_STATEMENT, 1), + (PREPARED_STATEMENT_PARAMETERS, 0), + (RETURN_VALUES_ON_CONDITION_CHECK_FAILURE, 0), + ), ) -DESCRIBE_KINESIS_STREAMING_DESTINATION = Schema( - id=ShapeID("com.amazonaws.dynamodb#DescribeKinesisStreamingDestination"), - shape_type=ShapeType.OPERATION, +PUT_REQUEST: StaticSchema = ( + 18, + n0, + _PR, + 0, + (_It,), + ((PUT_ITEM_INPUT_ATTRIBUTE_MAP, 1),), +) + +SEARCH_RESULT_ITEM: StaticSchema = ( + 18, + n0, + _SRI, + 0, + (_It, _Sc), + ((ATTRIBUTE_MAP, 0), (SCORE_NUMBER, {_smi: 0})), +) + +BATCH_GET_RESPONSE_MAP: StaticSchema = ( + 17, + n0, + _BGRM, + 0, + (_k, _v), + ((TABLE_ARN, 0), (ITEM_LIST, 0)), +) + +CANCELLATION_REASON_LIST: StaticSchema = ( + 16, + n0, + _CRL, + 0, + (_m,), + ((CANCELLATION_REASON, 0),), +) + +EXPORT_DESCRIPTION: StaticSchema = ( + 18, + n0, + _EDx, + 0, + ( + _EA, + _ES, + _ST, + _ETn, + _EMx, + _TA, + _TI, + _ET, + _CT, + _SB, + _SBO, + _SPr, + _SSA, + _SSKKI, + _FC, + _FM, + _EF, + _BSBi, + _IC, + _ETx, + _IES, + _FS, + ), + ( + (EXPORT_ARN, 0), + (EXPORT_STATUS, 0), + (EXPORT_START_TIME, 0), + (EXPORT_END_TIME, 0), + (EXPORT_MANIFEST, 0), + (TABLE_ARN, 0), + (TABLE_ID, 0), + (EXPORT_TIME, 0), + (CLIENT_TOKEN, 0), + (S3_BUCKET, 0), + (S3_BUCKET_OWNER, 0), + (S3_PREFIX, 0), + (S3_SSE_ALGORITHM, 0), + (S3_SSE_KMS_KEY_ID, 0), + (FAILURE_CODE, 0), + (FAILURE_MESSAGE, 0), + (EXPORT_FORMAT, 0), + (BILLED_SIZE_BYTES, 0), + (ITEM_COUNT, 0), + (EXPORT_TYPE, 0), + (INCREMENTAL_EXPORT_SPECIFICATION, 0), + (FILTER_SPECIFICATION, 0), + ), ) -DESCRIBE_LIMITS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#DescribeLimitsInput") +EXPORT_TABLE_TO_POINT_IN_TIME_INPUT: StaticSchema = ( + 18, + n0, + _ETTPITI, + {_smit: None}, + (_TA, _ET, _CT, _SB, _SBO, _SPr, _SSA, _SSKKI, _EF, _ETx, _IES, _FS), + ( + (TABLE_ARN, 1), + (EXPORT_TIME, 0), + (CLIENT_TOKEN, 2), + (S3_BUCKET, 1), + (S3_BUCKET_OWNER, 0), + (S3_PREFIX, 0), + (S3_SSE_ALGORITHM, 0), + (S3_SSE_KMS_KEY_ID, 0), + (EXPORT_FORMAT, 0), + (EXPORT_TYPE, 0), + (INCREMENTAL_EXPORT_SPECIFICATION, 0), + (FILTER_SPECIFICATION, 0), + ), ) -DESCRIBE_LIMITS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#DescribeLimitsOutput"), - members={ - "AccountMaxReadCapacityUnits": {"target": POSITIVE_LONG_OBJECT}, - "AccountMaxWriteCapacityUnits": {"target": POSITIVE_LONG_OBJECT}, - "TableMaxReadCapacityUnits": {"target": POSITIVE_LONG_OBJECT}, - "TableMaxWriteCapacityUnits": {"target": POSITIVE_LONG_OBJECT}, - }, +FILTER_CONDITION_MAP: StaticSchema = ( + 17, + n0, + _FCM, + 0, + (_k, _v), + ((ATTRIBUTE_NAME, 0), (CONDITION, 0)), +) + +ITEM_COLLECTION_METRICS_MULTIPLE: StaticSchema = ( + 16, + n0, + _ICMM, + 0, + (_m,), + ((ITEM_COLLECTION_METRICS, 0),), +) + +ITEM_RESPONSE_LIST: StaticSchema = (16, n0, _IRL, 0, (_m,), ((ITEM_RESPONSE, 0),)) + +KEY_CONDITIONS: StaticSchema = ( + 17, + n0, + _KC, + 0, + (_k, _v), + ((ATTRIBUTE_NAME, 0), (CONDITION, 0)), +) + +KEYS_AND_ATTRIBUTES: StaticSchema = ( + 18, + n0, + _KAA, + 0, + (_Ke, _ATG, _CR, _PE, _EAN), + ( + (KEY_LIST, 1), + (ATTRIBUTE_NAME_LIST, 0), + (CONSISTENT_READ, 0), + (PROJECTION_EXPRESSION, 0), + (EXPRESSION_ATTRIBUTE_NAME_MAP, 0), + ), ) -DESCRIBE_LIMITS = Schema( - id=ShapeID("com.amazonaws.dynamodb#DescribeLimits"), shape_type=ShapeType.OPERATION +PARAMETERIZED_STATEMENTS: StaticSchema = ( + 16, + n0, + _PSar, + 0, + (_m,), + ((PARAMETERIZED_STATEMENT, 0),), +) + +PARTI_QL_BATCH_REQUEST: StaticSchema = ( + 16, + n0, + _PQLBR, + 0, + (_m,), + ((BATCH_STATEMENT_REQUEST, 0),), +) + +SEARCH_RESULT_LIST: StaticSchema = (16, n0, _SRL, 0, (_m,), ((SEARCH_RESULT_ITEM, 0),)) + +TRANSACT_GET_ITEM: StaticSchema = (18, n0, _TGI, 0, (_G,), ((GET, 1),)) + +BATCH_EXECUTE_STATEMENT_INPUT: StaticSchema = ( + 18, + n0, + _BESI, + {_smit: None}, + (_State, _RCC), + ((PARTI_QL_BATCH_REQUEST, 1), (RETURN_CONSUMED_CAPACITY, 0)), +) + +BATCH_GET_REQUEST_MAP: StaticSchema = ( + 17, + n0, + _BGRMa, + 0, + (_k, _v), + ((TABLE_ARN, 0), (KEYS_AND_ATTRIBUTES, 0)), +) + +DESCRIBE_EXPORT_OUTPUT: StaticSchema = ( + 18, + n0, + _DEOe, + {_smith: None}, + (_EDx,), + ((EXPORT_DESCRIPTION, 0),), +) + +EXECUTE_TRANSACTION_INPUT: StaticSchema = ( + 18, + n0, + _ETI, + {_smit: None}, + (_TSr, _CRT, _RCC), + ( + (PARAMETERIZED_STATEMENTS, 1), + (CLIENT_REQUEST_TOKEN, 2), + (RETURN_CONSUMED_CAPACITY, 0), + ), ) -DESCRIBE_TABLE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#DescribeTableInput"), - members={ - "TableName": { - "target": TABLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +EXECUTE_TRANSACTION_OUTPUT: StaticSchema = ( + 18, + n0, + _ETO, + {_smith: None}, + (_Res, _CC), + ((ITEM_RESPONSE_LIST, 0), (CONSUMED_CAPACITY_MULTIPLE, 0)), +) + +EXPORT_TABLE_TO_POINT_IN_TIME_OUTPUT: StaticSchema = ( + 18, + n0, + _ETTPITO, + {_smith: None}, + (_EDx,), + ((EXPORT_DESCRIPTION, 0),), +) + +ITEM_COLLECTION_METRICS_PER_TABLE: StaticSchema = ( + 17, + n0, + _ICMPT, + 0, + (_k, _v), + ((TABLE_ARN, 0), (ITEM_COLLECTION_METRICS_MULTIPLE, 0)), +) + +SEARCH_VECTORS_OUTPUT: StaticSchema = ( + 18, + n0, + _SVO, + {_smith: None}, + (_CC, _SR), + ((VECTOR_CAPACITY, 0), (SEARCH_RESULT_LIST, 0)), +) + +TRANSACT_GET_ITEM_LIST: StaticSchema = ( + 16, + n0, + _TGIL, + 0, + (_m,), + ((TRANSACT_GET_ITEM, 0),), +) + +TRANSACT_GET_ITEMS_OUTPUT: StaticSchema = ( + 18, + n0, + _TGIO, + {_smith: None}, + (_CC, _Res), + ((CONSUMED_CAPACITY_MULTIPLE, 0), (ITEM_RESPONSE_LIST, 0)), +) + +TRANSACTION_CANCELED_EXCEPTION: StaticSchema = ( + 18, + n0, + _TCEr, + {_sm: _c}, + (_M, _CRan), + ((ERROR_MESSAGE, 0), (CANCELLATION_REASON_LIST, 0)), +) + +DESCRIBE_EXPORT: StaticOperationSchema = ( + 23, + n0, + _DEe, + 0, + DESCRIBE_EXPORT_INPUT, + DESCRIBE_EXPORT_OUTPUT, + (EXPORT_NOT_FOUND_EXCEPTION, INTERNAL_SERVER_ERROR, LIMIT_EXCEEDED_EXCEPTION), +) + +BATCH_GET_ITEM_INPUT: StaticSchema = ( + 18, + n0, + _BGII, + {_smit: None}, + (_RIe, _RCC), + ((BATCH_GET_REQUEST_MAP, 1), (RETURN_CONSUMED_CAPACITY, 0)), +) + +EXPECTED_ATTRIBUTE_VALUE: StaticSchema = ( + 18, + n0, + _EAVx, + 0, + (_V, _Ex, _CO, _AVL), + ( + (ATTRIBUTE_VALUE, 0), + (BOOLEAN_OBJECT, 0), + (COMPARISON_OPERATOR, 0), + (ATTRIBUTE_VALUE_LIST, 0), + ), ) -DESCRIBE_TABLE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#DescribeTableOutput"), - members={"Table": {"target": TABLE_DESCRIPTION}}, +TRANSACT_GET_ITEMS_INPUT: StaticSchema = ( + 18, + n0, + _TGII, + {_smit: None}, + (_TIr, _RCC), + ((TRANSACT_GET_ITEM_LIST, 1), (RETURN_CONSUMED_CAPACITY, 0)), +) + +TRANSACT_WRITE_ITEMS_OUTPUT: StaticSchema = ( + 18, + n0, + _TWIO, + {_smith: None}, + (_CC, _ICM), + ((CONSUMED_CAPACITY_MULTIPLE, 0), (ITEM_COLLECTION_METRICS_PER_TABLE, 0)), +) + +CONDITION_CHECK: StaticSchema = ( + 18, + n0, + _CCo, + 0, + (_K, _TN, _CE, _EAN, _EAV, _RVOCCF), + ( + (KEY, 1), + (TABLE_ARN, 1), + (CONDITION_EXPRESSION, 1), + (EXPRESSION_ATTRIBUTE_NAME_MAP, 0), + (EXPRESSION_ATTRIBUTE_VALUE_MAP, 0), + (RETURN_VALUES_ON_CONDITION_CHECK_FAILURE, 0), + ), ) -DESCRIBE_TABLE = Schema( - id=ShapeID("com.amazonaws.dynamodb#DescribeTable"), shape_type=ShapeType.OPERATION +DELETE: StaticSchema = ( + 18, + n0, + _Del, + 0, + (_K, _TN, _CE, _EAN, _EAV, _RVOCCF), + ( + (KEY, 1), + (TABLE_ARN, 1), + (CONDITION_EXPRESSION, 0), + (EXPRESSION_ATTRIBUTE_NAME_MAP, 0), + (EXPRESSION_ATTRIBUTE_VALUE_MAP, 0), + (RETURN_VALUES_ON_CONDITION_CHECK_FAILURE, 0), + ), ) -DESCRIBE_TABLE_REPLICA_AUTO_SCALING_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#DescribeTableReplicaAutoScalingInput"), - members={ - "TableName": { - "target": TABLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +PUT: StaticSchema = ( + 18, + n0, + _Pu, + 0, + (_It, _TN, _CE, _EAN, _EAV, _RVOCCF), + ( + (PUT_ITEM_INPUT_ATTRIBUTE_MAP, 1), + (TABLE_ARN, 1), + (CONDITION_EXPRESSION, 0), + (EXPRESSION_ATTRIBUTE_NAME_MAP, 0), + (EXPRESSION_ATTRIBUTE_VALUE_MAP, 0), + (RETURN_VALUES_ON_CONDITION_CHECK_FAILURE, 0), + ), ) -REPLICA_GLOBAL_SECONDARY_INDEX_AUTO_SCALING_DESCRIPTION = Schema.collection( - id=ShapeID( - "com.amazonaws.dynamodb#ReplicaGlobalSecondaryIndexAutoScalingDescription" +SEARCH_VECTORS_INPUT: StaticSchema = ( + 18, + n0, + _SVI, + {_smit: None}, + (_TN, _IN, _RCC, _EAN, _EAV, _PE, _SV, _SCE, _TKo), + ( + (TABLE_ARN, 1), + (INDEX_NAME, 1), + (RETURN_CONSUMED_CAPACITY, 0), + (EXPRESSION_ATTRIBUTE_NAME_MAP, 0), + (EXPRESSION_ATTRIBUTE_VALUE_MAP, 0), + (PROJECTION_EXPRESSION, 0), + (SEARCH_VECTOR_LIST, 1), + (STRING, 0), + (TOP_K_INTEGER, 1), ), - members={ - "IndexName": {"target": INDEX_NAME}, - "IndexStatus": {"target": INDEX_STATUS}, - "ProvisionedReadCapacityAutoScalingSettings": { - "target": AUTO_SCALING_SETTINGS_DESCRIPTION - }, - "ProvisionedWriteCapacityAutoScalingSettings": { - "target": AUTO_SCALING_SETTINGS_DESCRIPTION - }, - }, ) -REPLICA_GLOBAL_SECONDARY_INDEX_AUTO_SCALING_DESCRIPTION_LIST = Schema.collection( - id=ShapeID( - "com.amazonaws.dynamodb#ReplicaGlobalSecondaryIndexAutoScalingDescriptionList" +UPDATE: StaticSchema = ( + 18, + n0, + _U, + 0, + (_K, _UE, _TN, _CE, _EAN, _EAV, _RVOCCF), + ( + (KEY, 1), + (UPDATE_EXPRESSION, 1), + (TABLE_ARN, 1), + (CONDITION_EXPRESSION, 0), + (EXPRESSION_ATTRIBUTE_NAME_MAP, 0), + (EXPRESSION_ATTRIBUTE_VALUE_MAP, 0), + (RETURN_VALUES_ON_CONDITION_CHECK_FAILURE, 0), ), - shape_type=ShapeType.LIST, - members={ - "member": {"target": REPLICA_GLOBAL_SECONDARY_INDEX_AUTO_SCALING_DESCRIPTION} - }, ) -REPLICA_AUTO_SCALING_DESCRIPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ReplicaAutoScalingDescription"), - members={ - "RegionName": {"target": REGION_NAME}, - "GlobalSecondaryIndexes": { - "target": REPLICA_GLOBAL_SECONDARY_INDEX_AUTO_SCALING_DESCRIPTION_LIST - }, - "ReplicaProvisionedReadCapacityAutoScalingSettings": { - "target": AUTO_SCALING_SETTINGS_DESCRIPTION - }, - "ReplicaProvisionedWriteCapacityAutoScalingSettings": { - "target": AUTO_SCALING_SETTINGS_DESCRIPTION - }, - "ReplicaStatus": {"target": REPLICA_STATUS}, - }, +BATCH_STATEMENT_RESPONSE: StaticSchema = ( + 18, + n0, + _BSRa, + 0, + (_Er, _TN, _It), + ((BATCH_STATEMENT_ERROR, 0), (TABLE_NAME, 0), (ATTRIBUTE_MAP, 0)), +) + +DELETE_ITEM_OUTPUT: StaticSchema = ( + 18, + n0, + _DIOe, + {_smith: None}, + (_At, _CC, _ICM), + ((ATTRIBUTE_MAP, 0), (CONSUMED_CAPACITY, 0), (ITEM_COLLECTION_METRICS, 0)), +) + +EXECUTE_STATEMENT_OUTPUT: StaticSchema = ( + 18, + n0, + _ESO, + {_smith: None}, + (_Ite, _NT, _CC, _LEK), + ((ITEM_LIST, 0), (PARTI_QL_NEXT_TOKEN, 0), (CONSUMED_CAPACITY, 0), (KEY, 0)), +) + +EXPECTED_ATTRIBUTE_MAP: StaticSchema = ( + 17, + n0, + _EAM, + 0, + (_k, _v), + ((ATTRIBUTE_NAME, 0), (EXPECTED_ATTRIBUTE_VALUE, 0)), +) + +GET_ITEM: StaticOperationSchema = ( + 23, + n0, + _GI, + 0, + GET_ITEM_INPUT, + GET_ITEM_OUTPUT, + ( + INTERNAL_SERVER_ERROR, + INVALID_ENDPOINT_EXCEPTION, + PROVISIONED_THROUGHPUT_EXCEEDED_EXCEPTION, + REQUEST_LIMIT_EXCEEDED, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + ), ) -REPLICA_AUTO_SCALING_DESCRIPTION_LIST = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ReplicaAutoScalingDescriptionList"), - shape_type=ShapeType.LIST, - members={"member": {"target": REPLICA_AUTO_SCALING_DESCRIPTION}}, +PUT_ITEM_OUTPUT: StaticSchema = ( + 18, + n0, + _PIOu, + {_smith: None}, + (_At, _CC, _ICM), + ((ATTRIBUTE_MAP, 0), (CONSUMED_CAPACITY, 0), (ITEM_COLLECTION_METRICS, 0)), +) + +QUERY_OUTPUT: StaticSchema = ( + 18, + n0, + _QO, + {_smith: None}, + (_Ite, _Cou, _SC, _LEK, _CC), + ( + (ITEM_LIST, 0), + (INTEGER, {_smi: 0}), + (INTEGER, {_smi: 0}), + (KEY, 0), + (CONSUMED_CAPACITY, 0), + ), ) -TABLE_AUTO_SCALING_DESCRIPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#TableAutoScalingDescription"), - members={ - "TableName": {"target": TABLE_NAME}, - "TableStatus": {"target": TABLE_STATUS}, - "Replicas": {"target": REPLICA_AUTO_SCALING_DESCRIPTION_LIST}, - }, +SCAN_OUTPUT: StaticSchema = ( + 18, + n0, + _SO, + {_smith: None}, + (_Ite, _Cou, _SC, _LEK, _CC), + ( + (ITEM_LIST, 0), + (INTEGER, {_smi: 0}), + (INTEGER, {_smi: 0}), + (KEY, 0), + (CONSUMED_CAPACITY, 0), + ), ) -DESCRIBE_TABLE_REPLICA_AUTO_SCALING_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#DescribeTableReplicaAutoScalingOutput"), - members={"TableAutoScalingDescription": {"target": TABLE_AUTO_SCALING_DESCRIPTION}}, +UPDATE_ITEM_OUTPUT: StaticSchema = ( + 18, + n0, + _UIO, + {_smith: None}, + (_At, _CC, _ICM), + ((ATTRIBUTE_MAP, 0), (CONSUMED_CAPACITY, 0), (ITEM_COLLECTION_METRICS, 0)), +) + +WRITE_REQUEST: StaticSchema = ( + 18, + n0, + _WR, + 0, + (_PR, _DR), + ((PUT_REQUEST, 0), (DELETE_REQUEST, 0)), +) + +PARTI_QL_BATCH_RESPONSE: StaticSchema = ( + 16, + n0, + _PQLBRa, + 0, + (_m,), + ((BATCH_STATEMENT_RESPONSE, 0),), +) + +EXPORT_TABLE_TO_POINT_IN_TIME: StaticOperationSchema = ( + 23, + n0, + _ETTPIT, + 0, + EXPORT_TABLE_TO_POINT_IN_TIME_INPUT, + EXPORT_TABLE_TO_POINT_IN_TIME_OUTPUT, + ( + EXPORT_CONFLICT_EXCEPTION, + INTERNAL_SERVER_ERROR, + INVALID_EXPORT_TIME_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + POINT_IN_TIME_RECOVERY_UNAVAILABLE_EXCEPTION, + TABLE_NOT_FOUND_EXCEPTION, + ), ) -DESCRIBE_TABLE_REPLICA_AUTO_SCALING = Schema( - id=ShapeID("com.amazonaws.dynamodb#DescribeTableReplicaAutoScaling"), - shape_type=ShapeType.OPERATION, -) +WRITE_REQUESTS: StaticSchema = (16, n0, _WRr, 0, (_m,), ((WRITE_REQUEST, 0),)) -DESCRIBE_TIME_TO_LIVE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#DescribeTimeToLiveInput"), - members={ - "TableName": { - "target": TABLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +BATCH_EXECUTE_STATEMENT_OUTPUT: StaticSchema = ( + 18, + n0, + _BESO, + {_smith: None}, + (_Res, _CC), + ((PARTI_QL_BATCH_RESPONSE, 0), (CONSUMED_CAPACITY_MULTIPLE, 0)), ) -DESCRIBE_TIME_TO_LIVE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#DescribeTimeToLiveOutput"), - members={"TimeToLiveDescription": {"target": TIME_TO_LIVE_DESCRIPTION}}, +BATCH_GET_ITEM_OUTPUT: StaticSchema = ( + 18, + n0, + _BGIO, + {_smith: None}, + (_Res, _UK, _CC), + ( + (BATCH_GET_RESPONSE_MAP, 0), + (BATCH_GET_REQUEST_MAP, 0), + (CONSUMED_CAPACITY_MULTIPLE, 0), + ), ) -DESCRIBE_TIME_TO_LIVE = Schema( - id=ShapeID("com.amazonaws.dynamodb#DescribeTimeToLive"), - shape_type=ShapeType.OPERATION, +BATCH_WRITE_ITEM_REQUEST_MAP: StaticSchema = ( + 17, + n0, + _BWIRM, + 0, + (_k, _v), + ((TABLE_ARN, 0), (WRITE_REQUESTS, 0)), +) + +SCAN_INPUT: StaticSchema = ( + 18, + n0, + _SI, + {_smit: None}, + ( + _TN, + _IN, + _ATG, + _Li, + _Se, + _SF, + _COo, + _ESK, + _RCC, + _TSo, + _Seg, + _PE, + _FEi, + _EAN, + _EAV, + _CR, + ), + ( + (TABLE_ARN, 1), + (INDEX_NAME, 0), + (ATTRIBUTE_NAME_LIST, 0), + (POSITIVE_INTEGER_OBJECT, 0), + (SELECT, 0), + (FILTER_CONDITION_MAP, 0), + (CONDITIONAL_OPERATOR, 0), + (KEY, 0), + (RETURN_CONSUMED_CAPACITY, 0), + (SCAN_TOTAL_SEGMENTS, 0), + (SCAN_SEGMENT, 0), + (PROJECTION_EXPRESSION, 0), + (CONDITION_EXPRESSION, 0), + (EXPRESSION_ATTRIBUTE_NAME_MAP, 0), + (EXPRESSION_ATTRIBUTE_VALUE_MAP, 0), + (CONSISTENT_READ, 0), + ), ) -ENABLE_KINESIS_STREAMING_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#EnableKinesisStreamingConfiguration"), - members={ - "ApproximateCreationDateTimePrecision": { - "target": APPROXIMATE_CREATION_DATE_TIME_PRECISION - } - }, +SEARCH_VECTORS: StaticOperationSchema = ( + 23, + n0, + _SVe, + 0, + SEARCH_VECTORS_INPUT, + SEARCH_VECTORS_OUTPUT, + ( + INTERNAL_SERVER_ERROR, + REQUEST_LIMIT_EXCEEDED, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + ), ) -DISABLE_KINESIS_STREAMING_DESTINATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#DisableKinesisStreamingDestinationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.dynamodb#KinesisStreamingDestinationInput", - ) - ], - members={ - "TableName": { - "target": TABLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "StreamArn": { - "target": STREAM_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "EnableKinesisStreamingConfiguration": { - "target": ENABLE_KINESIS_STREAMING_CONFIGURATION - }, - }, +BATCH_WRITE_ITEM_INPUT: StaticSchema = ( + 18, + n0, + _BWII, + {_smit: None}, + (_RIe, _RCC, _RICM), + ( + (BATCH_WRITE_ITEM_REQUEST_MAP, 1), + (RETURN_CONSUMED_CAPACITY, 0), + (RETURN_ITEM_COLLECTION_METRICS, 0), + ), ) -DISABLE_KINESIS_STREAMING_DESTINATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#DisableKinesisStreamingDestinationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.dynamodb#KinesisStreamingDestinationOutput", - ) - ], - members={ - "TableName": {"target": TABLE_NAME}, - "StreamArn": {"target": STREAM_ARN}, - "DestinationStatus": {"target": DESTINATION_STATUS}, - "EnableKinesisStreamingConfiguration": { - "target": ENABLE_KINESIS_STREAMING_CONFIGURATION - }, - }, +DELETE_ITEM_INPUT: StaticSchema = ( + 18, + n0, + _DIIe, + {_smit: None}, + (_TN, _K, _Exp, _COo, _RVe, _RCC, _RICM, _CE, _EAN, _EAV, _RVOCCF), + ( + (TABLE_ARN, 1), + (KEY, 1), + (EXPECTED_ATTRIBUTE_MAP, 0), + (CONDITIONAL_OPERATOR, 0), + (RETURN_VALUE, 0), + (RETURN_CONSUMED_CAPACITY, 0), + (RETURN_ITEM_COLLECTION_METRICS, 0), + (CONDITION_EXPRESSION, 0), + (EXPRESSION_ATTRIBUTE_NAME_MAP, 0), + (EXPRESSION_ATTRIBUTE_VALUE_MAP, 0), + (RETURN_VALUES_ON_CONDITION_CHECK_FAILURE, 0), + ), ) -DISABLE_KINESIS_STREAMING_DESTINATION = Schema( - id=ShapeID("com.amazonaws.dynamodb#DisableKinesisStreamingDestination"), - shape_type=ShapeType.OPERATION, -) - -DUPLICATE_ITEM_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#DuplicateItemException"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], - members={"message": {"target": ERROR_MESSAGE}}, -) - -ENABLE_KINESIS_STREAMING_DESTINATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#EnableKinesisStreamingDestinationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.dynamodb#KinesisStreamingDestinationInput", - ) - ], - members={ - "TableName": { - "target": TABLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "StreamArn": { - "target": STREAM_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "EnableKinesisStreamingConfiguration": { - "target": ENABLE_KINESIS_STREAMING_CONFIGURATION - }, - }, +EXECUTE_STATEMENT: StaticOperationSchema = ( + 23, + n0, + _ESxe, + 0, + EXECUTE_STATEMENT_INPUT, + EXECUTE_STATEMENT_OUTPUT, + ( + CONDITIONAL_CHECK_FAILED_EXCEPTION, + DUPLICATE_ITEM_EXCEPTION, + INTERNAL_SERVER_ERROR, + ITEM_COLLECTION_SIZE_LIMIT_EXCEEDED_EXCEPTION, + PROVISIONED_THROUGHPUT_EXCEEDED_EXCEPTION, + REQUEST_LIMIT_EXCEEDED, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + TRANSACTION_CONFLICT_EXCEPTION, + ), ) -ENABLE_KINESIS_STREAMING_DESTINATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#EnableKinesisStreamingDestinationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.dynamodb#KinesisStreamingDestinationOutput", - ) - ], - members={ - "TableName": {"target": TABLE_NAME}, - "StreamArn": {"target": STREAM_ARN}, - "DestinationStatus": {"target": DESTINATION_STATUS}, - "EnableKinesisStreamingConfiguration": { - "target": ENABLE_KINESIS_STREAMING_CONFIGURATION - }, - }, +PUT_ITEM_INPUT: StaticSchema = ( + 18, + n0, + _PII, + {_smit: None}, + (_TN, _It, _Exp, _RVe, _RCC, _RICM, _COo, _CE, _EAN, _EAV, _RVOCCF), + ( + (TABLE_ARN, 1), + (PUT_ITEM_INPUT_ATTRIBUTE_MAP, 1), + (EXPECTED_ATTRIBUTE_MAP, 0), + (RETURN_VALUE, 0), + (RETURN_CONSUMED_CAPACITY, 0), + (RETURN_ITEM_COLLECTION_METRICS, 0), + (CONDITIONAL_OPERATOR, 0), + (CONDITION_EXPRESSION, 0), + (EXPRESSION_ATTRIBUTE_NAME_MAP, 0), + (EXPRESSION_ATTRIBUTE_VALUE_MAP, 0), + (RETURN_VALUES_ON_CONDITION_CHECK_FAILURE, 0), + ), ) -ENABLE_KINESIS_STREAMING_DESTINATION = Schema( - id=ShapeID("com.amazonaws.dynamodb#EnableKinesisStreamingDestination"), - shape_type=ShapeType.OPERATION, +EXECUTE_TRANSACTION: StaticOperationSchema = ( + 23, + n0, + _ETxe, + 0, + EXECUTE_TRANSACTION_INPUT, + EXECUTE_TRANSACTION_OUTPUT, + ( + IDEMPOTENT_PARAMETER_MISMATCH_EXCEPTION, + INTERNAL_SERVER_ERROR, + PROVISIONED_THROUGHPUT_EXCEEDED_EXCEPTION, + REQUEST_LIMIT_EXCEEDED, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + TRANSACTION_CANCELED_EXCEPTION, + TRANSACTION_IN_PROGRESS_EXCEPTION, + ), ) -POSITIVE_INTEGER_OBJECT = Schema( - id=ShapeID("com.amazonaws.dynamodb#PositiveIntegerObject"), - shape_type=ShapeType.INTEGER, +QUERY_INPUT: StaticSchema = ( + 18, + n0, + _QI, + {_smit: None}, + ( + _TN, + _IN, + _Se, + _ATG, + _Li, + _CR, + _KC, + _QF, + _COo, + _SIF, + _ESK, + _RCC, + _PE, + _FEi, + _KCE, + _EAN, + _EAV, + ), + ( + (TABLE_ARN, 1), + (INDEX_NAME, 0), + (SELECT, 0), + (ATTRIBUTE_NAME_LIST, 0), + (POSITIVE_INTEGER_OBJECT, 0), + (CONSISTENT_READ, 0), + (KEY_CONDITIONS, 0), + (FILTER_CONDITION_MAP, 0), + (CONDITIONAL_OPERATOR, 0), + (BOOLEAN_OBJECT, 0), + (KEY, 0), + (RETURN_CONSUMED_CAPACITY, 0), + (PROJECTION_EXPRESSION, 0), + (CONDITION_EXPRESSION, 0), + (KEY_EXPRESSION, 0), + (EXPRESSION_ATTRIBUTE_NAME_MAP, 0), + (EXPRESSION_ATTRIBUTE_VALUE_MAP, 0), + ), ) -PARTI_QL_NEXT_TOKEN = Schema( - id=ShapeID("com.amazonaws.dynamodb#PartiQLNextToken"), shape_type=ShapeType.STRING +BATCH_EXECUTE_STATEMENT: StaticOperationSchema = ( + 23, + n0, + _BES, + 0, + BATCH_EXECUTE_STATEMENT_INPUT, + BATCH_EXECUTE_STATEMENT_OUTPUT, + (INTERNAL_SERVER_ERROR, REQUEST_LIMIT_EXCEEDED, THROTTLING_EXCEPTION), +) + +TRANSACT_GET_ITEMS: StaticOperationSchema = ( + 23, + n0, + _TGIr, + 0, + TRANSACT_GET_ITEMS_INPUT, + TRANSACT_GET_ITEMS_OUTPUT, + ( + INTERNAL_SERVER_ERROR, + INVALID_ENDPOINT_EXCEPTION, + PROVISIONED_THROUGHPUT_EXCEEDED_EXCEPTION, + REQUEST_LIMIT_EXCEEDED, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + TRANSACTION_CANCELED_EXCEPTION, + ), ) -IDEMPOTENT_PARAMETER_MISMATCH_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#IdempotentParameterMismatchException"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], - members={"Message": {"target": ERROR_MESSAGE}}, +BATCH_GET_ITEM: StaticOperationSchema = ( + 23, + n0, + _BGI, + 0, + BATCH_GET_ITEM_INPUT, + BATCH_GET_ITEM_OUTPUT, + ( + INTERNAL_SERVER_ERROR, + INVALID_ENDPOINT_EXCEPTION, + PROVISIONED_THROUGHPUT_EXCEEDED_EXCEPTION, + REQUEST_LIMIT_EXCEEDED, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + ), ) -TRANSACTION_IN_PROGRESS_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#TransactionInProgressException"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], - members={"Message": {"target": ERROR_MESSAGE}}, +BATCH_WRITE_ITEM_OUTPUT: StaticSchema = ( + 18, + n0, + _BWIO, + {_smith: None}, + (_UI, _ICM, _CC), + ( + (BATCH_WRITE_ITEM_REQUEST_MAP, 0), + (ITEM_COLLECTION_METRICS_PER_TABLE, 0), + (CONSUMED_CAPACITY_MULTIPLE, 0), + ), ) -EXPORT_CONFLICT_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ExportConflictException"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], - members={"message": {"target": ERROR_MESSAGE}}, +UPDATE_ITEM_INPUT: StaticSchema = ( + 18, + n0, + _UII, + {_smit: None}, + (_TN, _K, _AU, _Exp, _COo, _RVe, _RCC, _RICM, _UE, _CE, _EAN, _EAV, _RVOCCF), + ( + (TABLE_ARN, 1), + (KEY, 1), + (ATTRIBUTE_UPDATES, 0), + (EXPECTED_ATTRIBUTE_MAP, 0), + (CONDITIONAL_OPERATOR, 0), + (RETURN_VALUE, 0), + (RETURN_CONSUMED_CAPACITY, 0), + (RETURN_ITEM_COLLECTION_METRICS, 0), + (UPDATE_EXPRESSION, 0), + (CONDITION_EXPRESSION, 0), + (EXPRESSION_ATTRIBUTE_NAME_MAP, 0), + (EXPRESSION_ATTRIBUTE_VALUE_MAP, 0), + (RETURN_VALUES_ON_CONDITION_CHECK_FAILURE, 0), + ), ) -INVALID_EXPORT_TIME_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#InvalidExportTimeException"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], - members={"message": {"target": ERROR_MESSAGE}}, +SCAN: StaticOperationSchema = ( + 23, + n0, + _Sca, + 0, + SCAN_INPUT, + SCAN_OUTPUT, + ( + INTERNAL_SERVER_ERROR, + INVALID_ENDPOINT_EXCEPTION, + PROVISIONED_THROUGHPUT_EXCEEDED_EXCEPTION, + REQUEST_LIMIT_EXCEEDED, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + ), ) -POINT_IN_TIME_RECOVERY_UNAVAILABLE_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#PointInTimeRecoveryUnavailableException"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], - members={"message": {"target": ERROR_MESSAGE}}, +QUERY: StaticOperationSchema = ( + 23, + n0, + _Q, + 0, + QUERY_INPUT, + QUERY_OUTPUT, + ( + INTERNAL_SERVER_ERROR, + INVALID_ENDPOINT_EXCEPTION, + PROVISIONED_THROUGHPUT_EXCEEDED_EXCEPTION, + REQUEST_LIMIT_EXCEEDED, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + ), ) -GET_RESOURCE_POLICY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#GetResourcePolicyInput"), - members={ - "ResourceArn": { - "target": RESOURCE_ARN_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +DELETE_ITEM: StaticOperationSchema = ( + 23, + n0, + _DIel, + 0, + DELETE_ITEM_INPUT, + DELETE_ITEM_OUTPUT, + ( + CONDITIONAL_CHECK_FAILED_EXCEPTION, + INTERNAL_SERVER_ERROR, + INVALID_ENDPOINT_EXCEPTION, + ITEM_COLLECTION_SIZE_LIMIT_EXCEEDED_EXCEPTION, + PROVISIONED_THROUGHPUT_EXCEEDED_EXCEPTION, + REPLICATED_WRITE_CONFLICT_EXCEPTION, + REQUEST_LIMIT_EXCEEDED, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + TRANSACTION_CONFLICT_EXCEPTION, + ), ) -GET_RESOURCE_POLICY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#GetResourcePolicyOutput"), - members={ - "Policy": {"target": RESOURCE_POLICY}, - "RevisionId": {"target": POLICY_REVISION_ID}, - }, +PUT_ITEM: StaticOperationSchema = ( + 23, + n0, + _PI, + 0, + PUT_ITEM_INPUT, + PUT_ITEM_OUTPUT, + ( + CONDITIONAL_CHECK_FAILED_EXCEPTION, + INTERNAL_SERVER_ERROR, + INVALID_ENDPOINT_EXCEPTION, + ITEM_COLLECTION_SIZE_LIMIT_EXCEEDED_EXCEPTION, + PROVISIONED_THROUGHPUT_EXCEEDED_EXCEPTION, + REPLICATED_WRITE_CONFLICT_EXCEPTION, + REQUEST_LIMIT_EXCEEDED, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + TRANSACTION_CONFLICT_EXCEPTION, + ), ) -GET_RESOURCE_POLICY = Schema( - id=ShapeID("com.amazonaws.dynamodb#GetResourcePolicy"), - shape_type=ShapeType.OPERATION, -) - -IMPORT_CONFLICT_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ImportConflictException"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], - members={"message": {"target": ERROR_MESSAGE}}, -) - -IMPORT_TABLE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ImportTableInput"), - members={ - "ClientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "S3BucketSource": { - "target": S3_BUCKET_SOURCE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "InputFormat": { - "target": INPUT_FORMAT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "InputFormatOptions": {"target": INPUT_FORMAT_OPTIONS}, - "InputCompressionType": {"target": INPUT_COMPRESSION_TYPE}, - "TableCreationParameters": { - "target": TABLE_CREATION_PARAMETERS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +TRANSACT_WRITE_ITEM: StaticSchema = ( + 18, + n0, + _TWI, + 0, + (_CCo, _Pu, _Del, _U), + ((CONDITION_CHECK, 0), (PUT, 0), (DELETE, 0), (UPDATE, 0)), +) + +UPDATE_ITEM: StaticOperationSchema = ( + 23, + n0, + _UIp, + 0, + UPDATE_ITEM_INPUT, + UPDATE_ITEM_OUTPUT, + ( + CONDITIONAL_CHECK_FAILED_EXCEPTION, + INTERNAL_SERVER_ERROR, + INVALID_ENDPOINT_EXCEPTION, + ITEM_COLLECTION_SIZE_LIMIT_EXCEEDED_EXCEPTION, + PROVISIONED_THROUGHPUT_EXCEEDED_EXCEPTION, + REPLICATED_WRITE_CONFLICT_EXCEPTION, + REQUEST_LIMIT_EXCEEDED, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + TRANSACTION_CONFLICT_EXCEPTION, + ), ) -IMPORT_TABLE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ImportTableOutput"), - members={ - "ImportTableDescription": { - "target": IMPORT_TABLE_DESCRIPTION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +BATCH_WRITE_ITEM: StaticOperationSchema = ( + 23, + n0, + _BWI, + 0, + BATCH_WRITE_ITEM_INPUT, + BATCH_WRITE_ITEM_OUTPUT, + ( + INTERNAL_SERVER_ERROR, + INVALID_ENDPOINT_EXCEPTION, + ITEM_COLLECTION_SIZE_LIMIT_EXCEEDED_EXCEPTION, + PROVISIONED_THROUGHPUT_EXCEEDED_EXCEPTION, + REPLICATED_WRITE_CONFLICT_EXCEPTION, + REQUEST_LIMIT_EXCEEDED, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + ), ) -IMPORT_TABLE = Schema( - id=ShapeID("com.amazonaws.dynamodb#ImportTable"), shape_type=ShapeType.OPERATION +TRANSACT_WRITE_ITEM_LIST: StaticSchema = ( + 16, + n0, + _TWIL, + 0, + (_m,), + ((TRANSACT_WRITE_ITEM, 0),), +) + +TRANSACT_WRITE_ITEMS_INPUT: StaticSchema = ( + 18, + n0, + _TWII, + {_smit: None}, + (_TIr, _RCC, _RICM, _CRT), + ( + (TRANSACT_WRITE_ITEM_LIST, 1), + (RETURN_CONSUMED_CAPACITY, 0), + (RETURN_ITEM_COLLECTION_METRICS, 0), + (CLIENT_REQUEST_TOKEN, 2), + ), ) -TIME_RANGE_LOWER_BOUND = Schema( - id=ShapeID("com.amazonaws.dynamodb#TimeRangeLowerBound"), - shape_type=ShapeType.TIMESTAMP, +TRANSACT_WRITE_ITEMS: StaticOperationSchema = ( + 23, + n0, + _TWIr, + 0, + TRANSACT_WRITE_ITEMS_INPUT, + TRANSACT_WRITE_ITEMS_OUTPUT, + ( + IDEMPOTENT_PARAMETER_MISMATCH_EXCEPTION, + INTERNAL_SERVER_ERROR, + INVALID_ENDPOINT_EXCEPTION, + PROVISIONED_THROUGHPUT_EXCEEDED_EXCEPTION, + REQUEST_LIMIT_EXCEEDED, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + TRANSACTION_CANCELED_EXCEPTION, + TRANSACTION_IN_PROGRESS_EXCEPTION, + ), ) -TIME_RANGE_UPPER_BOUND = Schema( - id=ShapeID("com.amazonaws.dynamodb#TimeRangeUpperBound"), - shape_type=ShapeType.TIMESTAMP, -) - -LIST_BACKUPS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ListBackupsInput"), - members={ - "TableName": {"target": TABLE_ARN}, - "Limit": {"target": BACKUPS_INPUT_LIMIT}, - "TimeRangeLowerBound": {"target": TIME_RANGE_LOWER_BOUND}, - "TimeRangeUpperBound": {"target": TIME_RANGE_UPPER_BOUND}, - "ExclusiveStartBackupArn": {"target": BACKUP_ARN}, - "BackupType": {"target": BACKUP_TYPE_FILTER}, - }, -) - -LIST_BACKUPS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ListBackupsOutput"), - members={ - "BackupSummaries": {"target": BACKUP_SUMMARIES}, - "LastEvaluatedBackupArn": {"target": BACKUP_ARN}, - }, -) - -LIST_BACKUPS = Schema( - id=ShapeID("com.amazonaws.dynamodb#ListBackups"), shape_type=ShapeType.OPERATION -) - -LIST_CONTRIBUTOR_INSIGHTS_LIMIT = Schema( - id=ShapeID("com.amazonaws.dynamodb#ListContributorInsightsLimit"), - shape_type=ShapeType.INTEGER, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=0)], -) - -NEXT_TOKEN_STRING = Schema( - id=ShapeID("com.amazonaws.dynamodb#NextTokenString"), shape_type=ShapeType.STRING -) - -LIST_CONTRIBUTOR_INSIGHTS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ListContributorInsightsInput"), - members={ - "TableName": {"target": TABLE_ARN}, - "NextToken": {"target": NEXT_TOKEN_STRING}, - "MaxResults": { - "target": LIST_CONTRIBUTOR_INSIGHTS_LIMIT, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - }, -) - -LIST_CONTRIBUTOR_INSIGHTS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ListContributorInsightsOutput"), - members={ - "ContributorInsightsSummaries": {"target": CONTRIBUTOR_INSIGHTS_SUMMARIES}, - "NextToken": {"target": NEXT_TOKEN_STRING}, - }, -) - -LIST_CONTRIBUTOR_INSIGHTS = Schema( - id=ShapeID("com.amazonaws.dynamodb#ListContributorInsights"), - shape_type=ShapeType.OPERATION, -) - -LIST_EXPORTS_MAX_LIMIT = Schema( - id=ShapeID("com.amazonaws.dynamodb#ListExportsMaxLimit"), - shape_type=ShapeType.INTEGER, -) - -EXPORT_NEXT_TOKEN = Schema( - id=ShapeID("com.amazonaws.dynamodb#ExportNextToken"), shape_type=ShapeType.STRING -) - -LIST_EXPORTS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ListExportsInput"), - members={ - "TableArn": {"target": TABLE_ARN}, - "MaxResults": {"target": LIST_EXPORTS_MAX_LIMIT}, - "NextToken": {"target": EXPORT_NEXT_TOKEN}, - }, -) - -EXPORT_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ExportSummary"), - members={ - "ExportArn": {"target": EXPORT_ARN}, - "ExportStatus": {"target": EXPORT_STATUS}, - "ExportType": {"target": EXPORT_TYPE}, - }, -) - -EXPORT_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ExportSummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": EXPORT_SUMMARY}}, -) - -LIST_EXPORTS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ListExportsOutput"), - members={ - "ExportSummaries": {"target": EXPORT_SUMMARIES}, - "NextToken": {"target": EXPORT_NEXT_TOKEN}, - }, -) - -LIST_EXPORTS = Schema( - id=ShapeID("com.amazonaws.dynamodb#ListExports"), shape_type=ShapeType.OPERATION -) - -LIST_GLOBAL_TABLES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ListGlobalTablesInput"), - members={ - "ExclusiveStartGlobalTableName": {"target": TABLE_NAME}, - "Limit": {"target": POSITIVE_INTEGER_OBJECT}, - "RegionName": {"target": REGION_NAME}, - }, -) - -GLOBAL_TABLE = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#GlobalTable"), - members={ - "GlobalTableName": {"target": TABLE_NAME}, - "ReplicationGroup": {"target": REPLICA_LIST}, - }, -) - -GLOBAL_TABLE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#GlobalTableList"), - shape_type=ShapeType.LIST, - members={"member": {"target": GLOBAL_TABLE}}, -) - -LIST_GLOBAL_TABLES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ListGlobalTablesOutput"), - members={ - "GlobalTables": {"target": GLOBAL_TABLE_LIST}, - "LastEvaluatedGlobalTableName": {"target": TABLE_NAME}, - }, -) - -LIST_GLOBAL_TABLES = Schema( - id=ShapeID("com.amazonaws.dynamodb#ListGlobalTables"), - shape_type=ShapeType.OPERATION, -) - -IMPORT_NEXT_TOKEN = Schema( - id=ShapeID("com.amazonaws.dynamodb#ImportNextToken"), shape_type=ShapeType.STRING -) - -LIST_IMPORTS_MAX_LIMIT = Schema( - id=ShapeID("com.amazonaws.dynamodb#ListImportsMaxLimit"), - shape_type=ShapeType.INTEGER, -) - -LIST_IMPORTS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ListImportsInput"), - members={ - "TableArn": {"target": TABLE_ARN}, - "PageSize": {"target": LIST_IMPORTS_MAX_LIMIT}, - "NextToken": {"target": IMPORT_NEXT_TOKEN}, - }, -) - -IMPORT_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ImportSummary"), - members={ - "ImportArn": {"target": IMPORT_ARN}, - "ImportStatus": {"target": IMPORT_STATUS}, - "TableArn": {"target": TABLE_ARN}, - "S3BucketSource": {"target": S3_BUCKET_SOURCE}, - "CloudWatchLogGroupArn": {"target": CLOUD_WATCH_LOG_GROUP_ARN}, - "InputFormat": {"target": INPUT_FORMAT}, - "StartTime": {"target": IMPORT_START_TIME}, - "EndTime": {"target": IMPORT_END_TIME}, - }, -) - -IMPORT_SUMMARY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ImportSummaryList"), - shape_type=ShapeType.LIST, - members={"member": {"target": IMPORT_SUMMARY}}, -) - -LIST_IMPORTS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ListImportsOutput"), - members={ - "ImportSummaryList": {"target": IMPORT_SUMMARY_LIST}, - "NextToken": {"target": IMPORT_NEXT_TOKEN}, - }, -) - -LIST_IMPORTS = Schema( - id=ShapeID("com.amazonaws.dynamodb#ListImports"), shape_type=ShapeType.OPERATION -) - -LIST_TABLES_INPUT_LIMIT = Schema( - id=ShapeID("com.amazonaws.dynamodb#ListTablesInputLimit"), - shape_type=ShapeType.INTEGER, -) - -LIST_TABLES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ListTablesInput"), - members={ - "ExclusiveStartTableName": {"target": TABLE_NAME}, - "Limit": {"target": LIST_TABLES_INPUT_LIMIT}, - }, -) - -TABLE_NAME_LIST = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#TableNameList"), - shape_type=ShapeType.LIST, - members={"member": {"target": TABLE_NAME}}, -) - -LIST_TABLES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ListTablesOutput"), - members={ - "TableNames": {"target": TABLE_NAME_LIST}, - "LastEvaluatedTableName": {"target": TABLE_NAME}, - }, -) - -LIST_TABLES = Schema( - id=ShapeID("com.amazonaws.dynamodb#ListTables"), shape_type=ShapeType.OPERATION -) - -LIST_TAGS_OF_RESOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ListTagsOfResourceInput"), - members={ - "ResourceArn": { - "target": RESOURCE_ARN_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "NextToken": {"target": NEXT_TOKEN_STRING}, - }, -) - -LIST_TAGS_OF_RESOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ListTagsOfResourceOutput"), - members={"Tags": {"target": TAG_LIST}, "NextToken": {"target": NEXT_TOKEN_STRING}}, -) - -LIST_TAGS_OF_RESOURCE = Schema( - id=ShapeID("com.amazonaws.dynamodb#ListTagsOfResource"), - shape_type=ShapeType.OPERATION, -) - -PUT_RESOURCE_POLICY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#PutResourcePolicyInput"), - members={ - "ResourceArn": { - "target": RESOURCE_ARN_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Policy": { - "target": RESOURCE_POLICY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ExpectedRevisionId": {"target": POLICY_REVISION_ID}, - "ConfirmRemoveSelfResourceAccess": { - "target": CONFIRM_REMOVE_SELF_RESOURCE_ACCESS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=False), - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amz-confirm-remove-self-resource-access", - ), - ], - }, - }, -) - -PUT_RESOURCE_POLICY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#PutResourcePolicyOutput"), - members={"RevisionId": {"target": POLICY_REVISION_ID}}, -) - -PUT_RESOURCE_POLICY = Schema( - id=ShapeID("com.amazonaws.dynamodb#PutResourcePolicy"), - shape_type=ShapeType.OPERATION, -) - -SELECT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#Select"), - shape_type=ShapeType.ENUM, - members={ - "ALL_ATTRIBUTES": {"target": UNIT}, - "ALL_PROJECTED_ATTRIBUTES": {"target": UNIT}, - "SPECIFIC_ATTRIBUTES": {"target": UNIT}, - "COUNT": {"target": UNIT}, - }, -) - -INTEGER = Schema( - id=ShapeID("com.amazonaws.dynamodb#Integer"), - shape_type=ShapeType.INTEGER, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=0)], -) - -RESTORE_TABLE_FROM_BACKUP_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#RestoreTableFromBackupInput"), - members={ - "TargetTableName": { - "target": TABLE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "BackupArn": { - "target": BACKUP_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "BillingModeOverride": {"target": BILLING_MODE}, - "GlobalSecondaryIndexOverride": {"target": GLOBAL_SECONDARY_INDEX_LIST}, - "LocalSecondaryIndexOverride": {"target": LOCAL_SECONDARY_INDEX_LIST}, - "ProvisionedThroughputOverride": {"target": PROVISIONED_THROUGHPUT}, - "OnDemandThroughputOverride": {"target": ON_DEMAND_THROUGHPUT}, - "SSESpecificationOverride": {"target": SSE_SPECIFICATION}, - "VectorIndexOverride": {"target": VECTOR_INDEX_LIST}, - }, -) - -RESTORE_TABLE_FROM_BACKUP_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#RestoreTableFromBackupOutput"), - members={"TableDescription": {"target": TABLE_DESCRIPTION}}, -) - -TABLE_ALREADY_EXISTS_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#TableAlreadyExistsException"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], - members={"message": {"target": ERROR_MESSAGE}}, -) - -RESTORE_TABLE_FROM_BACKUP = Schema( - id=ShapeID("com.amazonaws.dynamodb#RestoreTableFromBackup"), - shape_type=ShapeType.OPERATION, -) - -INVALID_RESTORE_TIME_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#InvalidRestoreTimeException"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], - members={"message": {"target": ERROR_MESSAGE}}, -) - -RESTORE_TABLE_TO_POINT_IN_TIME_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#RestoreTableToPointInTimeInput"), - members={ - "SourceTableArn": {"target": TABLE_ARN}, - "SourceTableName": {"target": TABLE_NAME}, - "TargetTableName": { - "target": TABLE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "UseLatestRestorableTime": {"target": BOOLEAN_OBJECT}, - "RestoreDateTime": {"target": DATE}, - "BillingModeOverride": {"target": BILLING_MODE}, - "GlobalSecondaryIndexOverride": {"target": GLOBAL_SECONDARY_INDEX_LIST}, - "LocalSecondaryIndexOverride": {"target": LOCAL_SECONDARY_INDEX_LIST}, - "ProvisionedThroughputOverride": {"target": PROVISIONED_THROUGHPUT}, - "OnDemandThroughputOverride": {"target": ON_DEMAND_THROUGHPUT}, - "SSESpecificationOverride": {"target": SSE_SPECIFICATION}, - "VectorIndexOverride": {"target": VECTOR_INDEX_LIST}, - }, -) - -RESTORE_TABLE_TO_POINT_IN_TIME_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#RestoreTableToPointInTimeOutput"), - members={"TableDescription": {"target": TABLE_DESCRIPTION}}, -) - -RESTORE_TABLE_TO_POINT_IN_TIME = Schema( - id=ShapeID("com.amazonaws.dynamodb#RestoreTableToPointInTime"), - shape_type=ShapeType.OPERATION, -) - -SCAN_SEGMENT = Schema( - id=ShapeID("com.amazonaws.dynamodb#ScanSegment"), shape_type=ShapeType.INTEGER -) - -SCAN_TOTAL_SEGMENTS = Schema( - id=ShapeID("com.amazonaws.dynamodb#ScanTotalSegments"), shape_type=ShapeType.INTEGER -) - -TOP_K_INTEGER = Schema( - id=ShapeID("com.amazonaws.dynamodb#TopKInteger"), shape_type=ShapeType.INTEGER -) - -SCORE_NUMBER = Schema( - id=ShapeID("com.amazonaws.dynamodb#ScoreNumber"), - shape_type=ShapeType.DOUBLE, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=0)], -) - -TAG_RESOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#TagResourceInput"), - members={ - "ResourceArn": { - "target": RESOURCE_ARN_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Tags": { - "target": TAG_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -TAG_RESOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#TagResourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -TAG_RESOURCE = Schema( - id=ShapeID("com.amazonaws.dynamodb#TagResource"), shape_type=ShapeType.OPERATION -) - -UPDATE_EXPRESSION = Schema( - id=ShapeID("com.amazonaws.dynamodb#UpdateExpression"), shape_type=ShapeType.STRING -) - -TAG_KEY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#TagKeyList"), - shape_type=ShapeType.LIST, - members={"member": {"target": TAG_KEY_STRING}}, -) - -UNTAG_RESOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#UntagResourceInput"), - members={ - "ResourceArn": { - "target": RESOURCE_ARN_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "TagKeys": { - "target": TAG_KEY_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -UNTAG_RESOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#UntagResourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -UNTAG_RESOURCE = Schema( - id=ShapeID("com.amazonaws.dynamodb#UntagResource"), shape_type=ShapeType.OPERATION -) - -POINT_IN_TIME_RECOVERY_SPECIFICATION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#PointInTimeRecoverySpecification"), - members={ - "PointInTimeRecoveryEnabled": { - "target": BOOLEAN_OBJECT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "RecoveryPeriodInDays": {"target": RECOVERY_PERIOD_IN_DAYS}, - }, -) - -UPDATE_CONTINUOUS_BACKUPS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#UpdateContinuousBackupsInput"), - members={ - "TableName": { - "target": TABLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "PointInTimeRecoverySpecification": { - "target": POINT_IN_TIME_RECOVERY_SPECIFICATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -UPDATE_CONTINUOUS_BACKUPS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#UpdateContinuousBackupsOutput"), - members={ - "ContinuousBackupsDescription": {"target": CONTINUOUS_BACKUPS_DESCRIPTION} - }, -) - -UPDATE_CONTINUOUS_BACKUPS = Schema( - id=ShapeID("com.amazonaws.dynamodb#UpdateContinuousBackups"), - shape_type=ShapeType.OPERATION, -) - -UPDATE_CONTRIBUTOR_INSIGHTS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#UpdateContributorInsightsInput"), - members={ - "TableName": { - "target": TABLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "IndexName": {"target": INDEX_NAME}, - "ContributorInsightsAction": { - "target": CONTRIBUTOR_INSIGHTS_ACTION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ContributorInsightsMode": {"target": CONTRIBUTOR_INSIGHTS_MODE}, - }, -) - -UPDATE_CONTRIBUTOR_INSIGHTS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#UpdateContributorInsightsOutput"), - members={ - "TableName": {"target": TABLE_NAME}, - "IndexName": {"target": INDEX_NAME}, - "ContributorInsightsStatus": {"target": CONTRIBUTOR_INSIGHTS_STATUS}, - "ContributorInsightsMode": {"target": CONTRIBUTOR_INSIGHTS_MODE}, - }, -) - -UPDATE_CONTRIBUTOR_INSIGHTS = Schema( - id=ShapeID("com.amazonaws.dynamodb#UpdateContributorInsights"), - shape_type=ShapeType.OPERATION, -) - -REPLICA_ALREADY_EXISTS_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ReplicaAlreadyExistsException"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], - members={"message": {"target": ERROR_MESSAGE}}, -) - -REPLICA_NOT_FOUND_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ReplicaNotFoundException"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], - members={"message": {"target": ERROR_MESSAGE}}, -) - -REPLICA_UPDATE = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ReplicaUpdate"), - members={ - "Create": {"target": CREATE_REPLICA_ACTION}, - "Delete": {"target": DELETE_REPLICA_ACTION}, - }, -) - -REPLICA_UPDATE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ReplicaUpdateList"), - shape_type=ShapeType.LIST, - members={"member": {"target": REPLICA_UPDATE}}, -) - -UPDATE_GLOBAL_TABLE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#UpdateGlobalTableInput"), - members={ - "GlobalTableName": { - "target": TABLE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ReplicaUpdates": { - "target": REPLICA_UPDATE_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -UPDATE_GLOBAL_TABLE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#UpdateGlobalTableOutput"), - members={"GlobalTableDescription": {"target": GLOBAL_TABLE_DESCRIPTION}}, -) - -UPDATE_GLOBAL_TABLE = Schema( - id=ShapeID("com.amazonaws.dynamodb#UpdateGlobalTable"), - shape_type=ShapeType.OPERATION, -) - -INDEX_NOT_FOUND_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#IndexNotFoundException"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], - members={"message": {"target": ERROR_MESSAGE}}, -) - -GLOBAL_TABLE_GLOBAL_SECONDARY_INDEX_SETTINGS_UPDATE = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#GlobalTableGlobalSecondaryIndexSettingsUpdate"), - members={ - "IndexName": { - "target": INDEX_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ProvisionedWriteCapacityUnits": {"target": POSITIVE_LONG_OBJECT}, - "ProvisionedWriteCapacityAutoScalingSettingsUpdate": { - "target": AUTO_SCALING_SETTINGS_UPDATE - }, - }, -) - -GLOBAL_TABLE_GLOBAL_SECONDARY_INDEX_SETTINGS_UPDATE_LIST = Schema.collection( - id=ShapeID( - "com.amazonaws.dynamodb#GlobalTableGlobalSecondaryIndexSettingsUpdateList" - ), - shape_type=ShapeType.LIST, - members={"member": {"target": GLOBAL_TABLE_GLOBAL_SECONDARY_INDEX_SETTINGS_UPDATE}}, -) - -REPLICA_GLOBAL_SECONDARY_INDEX_SETTINGS_UPDATE = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ReplicaGlobalSecondaryIndexSettingsUpdate"), - members={ - "IndexName": { - "target": INDEX_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ProvisionedReadCapacityUnits": {"target": POSITIVE_LONG_OBJECT}, - "ProvisionedReadCapacityAutoScalingSettingsUpdate": { - "target": AUTO_SCALING_SETTINGS_UPDATE - }, - }, -) - -REPLICA_GLOBAL_SECONDARY_INDEX_SETTINGS_UPDATE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ReplicaGlobalSecondaryIndexSettingsUpdateList"), - shape_type=ShapeType.LIST, - members={"member": {"target": REPLICA_GLOBAL_SECONDARY_INDEX_SETTINGS_UPDATE}}, -) - -REPLICA_SETTINGS_UPDATE = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ReplicaSettingsUpdate"), - members={ - "RegionName": { - "target": REGION_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ReplicaProvisionedReadCapacityUnits": {"target": POSITIVE_LONG_OBJECT}, - "ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate": { - "target": AUTO_SCALING_SETTINGS_UPDATE - }, - "ReplicaGlobalSecondaryIndexSettingsUpdate": { - "target": REPLICA_GLOBAL_SECONDARY_INDEX_SETTINGS_UPDATE_LIST - }, - "ReplicaTableClass": {"target": TABLE_CLASS}, - }, -) - -REPLICA_SETTINGS_UPDATE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ReplicaSettingsUpdateList"), - shape_type=ShapeType.LIST, - members={"member": {"target": REPLICA_SETTINGS_UPDATE}}, -) - -UPDATE_GLOBAL_TABLE_SETTINGS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#UpdateGlobalTableSettingsInput"), - members={ - "GlobalTableName": { - "target": TABLE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "GlobalTableBillingMode": {"target": BILLING_MODE}, - "GlobalTableProvisionedWriteCapacityUnits": {"target": POSITIVE_LONG_OBJECT}, - "GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate": { - "target": AUTO_SCALING_SETTINGS_UPDATE - }, - "GlobalTableGlobalSecondaryIndexSettingsUpdate": { - "target": GLOBAL_TABLE_GLOBAL_SECONDARY_INDEX_SETTINGS_UPDATE_LIST - }, - "ReplicaSettingsUpdate": {"target": REPLICA_SETTINGS_UPDATE_LIST}, - }, -) - -UPDATE_GLOBAL_TABLE_SETTINGS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#UpdateGlobalTableSettingsOutput"), - members={ - "GlobalTableName": {"target": TABLE_NAME}, - "ReplicaSettings": {"target": REPLICA_SETTINGS_DESCRIPTION_LIST}, - }, -) - -UPDATE_GLOBAL_TABLE_SETTINGS = Schema( - id=ShapeID("com.amazonaws.dynamodb#UpdateGlobalTableSettings"), - shape_type=ShapeType.OPERATION, -) - -UPDATE_KINESIS_STREAMING_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#UpdateKinesisStreamingConfiguration"), - members={ - "ApproximateCreationDateTimePrecision": { - "target": APPROXIMATE_CREATION_DATE_TIME_PRECISION - } - }, -) - -UPDATE_KINESIS_STREAMING_DESTINATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#UpdateKinesisStreamingDestinationInput"), - members={ - "TableName": { - "target": TABLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "StreamArn": { - "target": STREAM_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "UpdateKinesisStreamingConfiguration": { - "target": UPDATE_KINESIS_STREAMING_CONFIGURATION - }, - }, -) - -UPDATE_KINESIS_STREAMING_DESTINATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#UpdateKinesisStreamingDestinationOutput"), - members={ - "TableName": {"target": TABLE_NAME}, - "StreamArn": {"target": STREAM_ARN}, - "DestinationStatus": {"target": DESTINATION_STATUS}, - "UpdateKinesisStreamingConfiguration": { - "target": UPDATE_KINESIS_STREAMING_CONFIGURATION - }, - }, -) - -UPDATE_KINESIS_STREAMING_DESTINATION = Schema( - id=ShapeID("com.amazonaws.dynamodb#UpdateKinesisStreamingDestination"), - shape_type=ShapeType.OPERATION, -) - -UPDATE_GLOBAL_SECONDARY_INDEX_ACTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#UpdateGlobalSecondaryIndexAction"), - members={ - "IndexName": { - "target": INDEX_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ProvisionedThroughput": {"target": PROVISIONED_THROUGHPUT}, - "OnDemandThroughput": {"target": ON_DEMAND_THROUGHPUT}, - "WarmThroughput": {"target": WARM_THROUGHPUT}, - }, -) - -GLOBAL_SECONDARY_INDEX_UPDATE = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#GlobalSecondaryIndexUpdate"), - members={ - "Update": {"target": UPDATE_GLOBAL_SECONDARY_INDEX_ACTION}, - "Create": {"target": CREATE_GLOBAL_SECONDARY_INDEX_ACTION}, - "Delete": {"target": DELETE_GLOBAL_SECONDARY_INDEX_ACTION}, - }, -) - -GLOBAL_SECONDARY_INDEX_UPDATE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#GlobalSecondaryIndexUpdateList"), - shape_type=ShapeType.LIST, - members={"member": {"target": GLOBAL_SECONDARY_INDEX_UPDATE}}, -) - -GLOBAL_TABLE_WITNESS_GROUP_UPDATE = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#GlobalTableWitnessGroupUpdate"), - members={ - "Create": {"target": CREATE_GLOBAL_TABLE_WITNESS_GROUP_MEMBER_ACTION}, - "Delete": {"target": DELETE_GLOBAL_TABLE_WITNESS_GROUP_MEMBER_ACTION}, - }, -) - -GLOBAL_TABLE_WITNESS_GROUP_UPDATE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#GlobalTableWitnessGroupUpdateList"), - shape_type=ShapeType.LIST, - members={"member": {"target": GLOBAL_TABLE_WITNESS_GROUP_UPDATE}}, -) - -UPDATE_REPLICATION_GROUP_MEMBER_ACTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#UpdateReplicationGroupMemberAction"), - members={ - "RegionName": { - "target": REGION_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "KMSMasterKeyId": {"target": KMS_MASTER_KEY_ID}, - "ProvisionedThroughputOverride": {"target": PROVISIONED_THROUGHPUT_OVERRIDE}, - "OnDemandThroughputOverride": {"target": ON_DEMAND_THROUGHPUT_OVERRIDE}, - "GlobalSecondaryIndexes": {"target": REPLICA_GLOBAL_SECONDARY_INDEX_LIST}, - "TableClassOverride": {"target": TABLE_CLASS}, - }, -) - -REPLICATION_GROUP_UPDATE = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ReplicationGroupUpdate"), - members={ - "Create": {"target": CREATE_REPLICATION_GROUP_MEMBER_ACTION}, - "Update": {"target": UPDATE_REPLICATION_GROUP_MEMBER_ACTION}, - "Delete": {"target": DELETE_REPLICATION_GROUP_MEMBER_ACTION}, - }, -) - -REPLICATION_GROUP_UPDATE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ReplicationGroupUpdateList"), - shape_type=ShapeType.LIST, - members={"member": {"target": REPLICATION_GROUP_UPDATE}}, -) - -VECTOR_INDEX_UPDATE = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#VectorIndexUpdate"), - members={ - "Create": {"target": CREATE_VECTOR_INDEX_ACTION}, - "Delete": {"target": DELETE_VECTOR_INDEX_ACTION}, - }, -) - -VECTOR_INDEX_UPDATE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#VectorIndexUpdateList"), - shape_type=ShapeType.LIST, - members={"member": {"target": VECTOR_INDEX_UPDATE}}, -) - -UPDATE_TABLE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#UpdateTableInput"), - members={ - "AttributeDefinitions": {"target": ATTRIBUTE_DEFINITIONS}, - "TableName": { - "target": TABLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "BillingMode": {"target": BILLING_MODE}, - "ProvisionedThroughput": {"target": PROVISIONED_THROUGHPUT}, - "GlobalSecondaryIndexUpdates": {"target": GLOBAL_SECONDARY_INDEX_UPDATE_LIST}, - "StreamSpecification": {"target": STREAM_SPECIFICATION}, - "SSESpecification": {"target": SSE_SPECIFICATION}, - "ReplicaUpdates": {"target": REPLICATION_GROUP_UPDATE_LIST}, - "TableClass": {"target": TABLE_CLASS}, - "DeletionProtectionEnabled": {"target": DELETION_PROTECTION_ENABLED}, - "MultiRegionConsistency": {"target": MULTI_REGION_CONSISTENCY}, - "GlobalTableWitnessUpdates": {"target": GLOBAL_TABLE_WITNESS_GROUP_UPDATE_LIST}, - "OnDemandThroughput": {"target": ON_DEMAND_THROUGHPUT}, - "WarmThroughput": {"target": WARM_THROUGHPUT}, - "GlobalTableSettingsReplicationMode": { - "target": GLOBAL_TABLE_SETTINGS_REPLICATION_MODE - }, - "VectorIndexUpdates": {"target": VECTOR_INDEX_UPDATE_LIST}, - }, -) - -UPDATE_TABLE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#UpdateTableOutput"), - members={"TableDescription": {"target": TABLE_DESCRIPTION}}, -) - -UPDATE_TABLE = Schema( - id=ShapeID("com.amazonaws.dynamodb#UpdateTable"), shape_type=ShapeType.OPERATION -) - -GLOBAL_SECONDARY_INDEX_AUTO_SCALING_UPDATE = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#GlobalSecondaryIndexAutoScalingUpdate"), - members={ - "IndexName": {"target": INDEX_NAME}, - "ProvisionedWriteCapacityAutoScalingUpdate": { - "target": AUTO_SCALING_SETTINGS_UPDATE - }, - }, -) - -GLOBAL_SECONDARY_INDEX_AUTO_SCALING_UPDATE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#GlobalSecondaryIndexAutoScalingUpdateList"), - shape_type=ShapeType.LIST, - members={"member": {"target": GLOBAL_SECONDARY_INDEX_AUTO_SCALING_UPDATE}}, -) - -REPLICA_GLOBAL_SECONDARY_INDEX_AUTO_SCALING_UPDATE = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ReplicaGlobalSecondaryIndexAutoScalingUpdate"), - members={ - "IndexName": {"target": INDEX_NAME}, - "ProvisionedReadCapacityAutoScalingUpdate": { - "target": AUTO_SCALING_SETTINGS_UPDATE - }, - }, -) - -REPLICA_GLOBAL_SECONDARY_INDEX_AUTO_SCALING_UPDATE_LIST = Schema.collection( - id=ShapeID( - "com.amazonaws.dynamodb#ReplicaGlobalSecondaryIndexAutoScalingUpdateList" - ), - shape_type=ShapeType.LIST, - members={"member": {"target": REPLICA_GLOBAL_SECONDARY_INDEX_AUTO_SCALING_UPDATE}}, -) - -REPLICA_AUTO_SCALING_UPDATE = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ReplicaAutoScalingUpdate"), - members={ - "RegionName": { - "target": REGION_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ReplicaGlobalSecondaryIndexUpdates": { - "target": REPLICA_GLOBAL_SECONDARY_INDEX_AUTO_SCALING_UPDATE_LIST - }, - "ReplicaProvisionedReadCapacityAutoScalingUpdate": { - "target": AUTO_SCALING_SETTINGS_UPDATE - }, - }, -) - -REPLICA_AUTO_SCALING_UPDATE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ReplicaAutoScalingUpdateList"), - shape_type=ShapeType.LIST, - members={"member": {"target": REPLICA_AUTO_SCALING_UPDATE}}, -) - -UPDATE_TABLE_REPLICA_AUTO_SCALING_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#UpdateTableReplicaAutoScalingInput"), - members={ - "GlobalSecondaryIndexUpdates": { - "target": GLOBAL_SECONDARY_INDEX_AUTO_SCALING_UPDATE_LIST - }, - "TableName": { - "target": TABLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ProvisionedWriteCapacityAutoScalingUpdate": { - "target": AUTO_SCALING_SETTINGS_UPDATE - }, - "ReplicaUpdates": {"target": REPLICA_AUTO_SCALING_UPDATE_LIST}, - }, -) - -UPDATE_TABLE_REPLICA_AUTO_SCALING_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#UpdateTableReplicaAutoScalingOutput"), - members={"TableAutoScalingDescription": {"target": TABLE_AUTO_SCALING_DESCRIPTION}}, -) - -UPDATE_TABLE_REPLICA_AUTO_SCALING = Schema( - id=ShapeID("com.amazonaws.dynamodb#UpdateTableReplicaAutoScaling"), - shape_type=ShapeType.OPERATION, -) - -TIME_TO_LIVE_ENABLED = Schema( - id=ShapeID("com.amazonaws.dynamodb#TimeToLiveEnabled"), shape_type=ShapeType.BOOLEAN -) - -TIME_TO_LIVE_SPECIFICATION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#TimeToLiveSpecification"), - members={ - "Enabled": { - "target": TIME_TO_LIVE_ENABLED, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "AttributeName": { - "target": TIME_TO_LIVE_ATTRIBUTE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -UPDATE_TIME_TO_LIVE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#UpdateTimeToLiveInput"), - members={ - "TableName": { - "target": TABLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "TimeToLiveSpecification": { - "target": TIME_TO_LIVE_SPECIFICATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -UPDATE_TIME_TO_LIVE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#UpdateTimeToLiveOutput"), - members={"TimeToLiveSpecification": {"target": TIME_TO_LIVE_SPECIFICATION}}, -) - -UPDATE_TIME_TO_LIVE = Schema( - id=ShapeID("com.amazonaws.dynamodb#UpdateTimeToLive"), - shape_type=ShapeType.OPERATION, -) - -ATTRIBUTE_VALUE = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#AttributeValue"), - shape_type=ShapeType.UNION, - members={ - "S": {"target": STRING_ATTRIBUTE_VALUE}, - "N": {"target": NUMBER_ATTRIBUTE_VALUE}, - "B": {"target": BINARY_ATTRIBUTE_VALUE}, - "SS": {"target": STRING_SET_ATTRIBUTE_VALUE}, - "NS": {"target": NUMBER_SET_ATTRIBUTE_VALUE}, - "BS": {"target": BINARY_SET_ATTRIBUTE_VALUE}, - # This needs to reference a schema that isn't defined yet. - # It will be populated with a non-null value at the end of the file. - "M": None, - # This needs to reference a schema that isn't defined yet. - # It will be populated with a non-null value at the end of the file. - "L": None, - "NULL": {"target": NULL_ATTRIBUTE_VALUE}, - "BOOL": {"target": BOOLEAN_ATTRIBUTE_VALUE}, - }, -) - -LIST_ATTRIBUTE_VALUE = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ListAttributeValue"), - shape_type=ShapeType.LIST, - members={"member": {"target": ATTRIBUTE_VALUE}}, -) - -MAP_ATTRIBUTE_VALUE = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#MapAttributeValue"), - shape_type=ShapeType.MAP, - members={"key": {"target": ATTRIBUTE_NAME}, "value": {"target": ATTRIBUTE_VALUE}}, -) - -ATTRIBUTE_MAP = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#AttributeMap"), - shape_type=ShapeType.MAP, - members={"key": {"target": ATTRIBUTE_NAME}, "value": {"target": ATTRIBUTE_VALUE}}, -) - -ATTRIBUTE_VALUE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#AttributeValueList"), - shape_type=ShapeType.LIST, - members={"member": {"target": ATTRIBUTE_VALUE}}, -) - -ATTRIBUTE_VALUE_UPDATE = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#AttributeValueUpdate"), - members={ - "Value": {"target": ATTRIBUTE_VALUE}, - "Action": {"target": ATTRIBUTE_ACTION}, - }, -) - -EXPRESSION_ATTRIBUTE_VALUE_MAP = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ExpressionAttributeValueMap"), - shape_type=ShapeType.MAP, - members={ - "key": {"target": EXPRESSION_ATTRIBUTE_VALUE_VARIABLE}, - "value": {"target": ATTRIBUTE_VALUE}, - }, -) - -ITEM_COLLECTION_KEY_ATTRIBUTE_MAP = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ItemCollectionKeyAttributeMap"), - shape_type=ShapeType.MAP, - members={"key": {"target": ATTRIBUTE_NAME}, "value": {"target": ATTRIBUTE_VALUE}}, -) - -KEY = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#Key"), - shape_type=ShapeType.MAP, - members={"key": {"target": ATTRIBUTE_NAME}, "value": {"target": ATTRIBUTE_VALUE}}, -) - -PREPARED_STATEMENT_PARAMETERS = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#PreparedStatementParameters"), - shape_type=ShapeType.LIST, - members={"member": {"target": ATTRIBUTE_VALUE}}, -) - -PUT_ITEM_INPUT_ATTRIBUTE_MAP = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#PutItemInputAttributeMap"), - shape_type=ShapeType.MAP, - members={"key": {"target": ATTRIBUTE_NAME}, "value": {"target": ATTRIBUTE_VALUE}}, -) - -SEARCH_VECTOR_LIST = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#SearchVectorList"), - shape_type=ShapeType.LIST, - members={"member": {"target": ATTRIBUTE_VALUE}}, -) - -ATTRIBUTE_UPDATES = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#AttributeUpdates"), - shape_type=ShapeType.MAP, - members={ - "key": {"target": ATTRIBUTE_NAME}, - "value": {"target": ATTRIBUTE_VALUE_UPDATE}, - }, -) - -BATCH_STATEMENT_ERROR = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#BatchStatementError"), - members={ - "Code": {"target": BATCH_STATEMENT_ERROR_CODE_ENUM}, - "Message": {"target": STRING}, - "Item": {"target": ATTRIBUTE_MAP}, - }, -) - -BATCH_STATEMENT_REQUEST = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#BatchStatementRequest"), - members={ - "Statement": { - "target": PARTI_QL_STATEMENT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Parameters": {"target": PREPARED_STATEMENT_PARAMETERS}, - "ConsistentRead": {"target": CONSISTENT_READ}, - "ReturnValuesOnConditionCheckFailure": { - "target": RETURN_VALUES_ON_CONDITION_CHECK_FAILURE - }, - }, -) - -CANCELLATION_REASON = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#CancellationReason"), - members={ - "Item": {"target": ATTRIBUTE_MAP}, - "Code": {"target": CODE}, - "Message": {"target": ERROR_MESSAGE}, - }, -) - -CONDITION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#Condition"), - members={ - "AttributeValueList": {"target": ATTRIBUTE_VALUE_LIST}, - "ComparisonOperator": { - "target": COMPARISON_OPERATOR, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -CONDITIONAL_CHECK_FAILED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ConditionalCheckFailedException"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], - members={"message": {"target": ERROR_MESSAGE}, "Item": {"target": ATTRIBUTE_MAP}}, -) - -DELETE_REQUEST = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#DeleteRequest"), - members={ - "Key": {"target": KEY, "traits": [Trait.new(id=ShapeID("smithy.api#required"))]} - }, -) - -EXECUTE_STATEMENT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ExecuteStatementInput"), - members={ - "Statement": { - "target": PARTI_QL_STATEMENT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Parameters": {"target": PREPARED_STATEMENT_PARAMETERS}, - "ConsistentRead": {"target": CONSISTENT_READ}, - "NextToken": {"target": PARTI_QL_NEXT_TOKEN}, - "ReturnConsumedCapacity": {"target": RETURN_CONSUMED_CAPACITY}, - "Limit": {"target": POSITIVE_INTEGER_OBJECT}, - "ReturnValuesOnConditionCheckFailure": { - "target": RETURN_VALUES_ON_CONDITION_CHECK_FAILURE - }, - }, -) - -FILTER_SPECIFICATION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#FilterSpecification"), - members={ - "FilterExpression": {"target": CONDITION_EXPRESSION}, - "ProjectionExpression": {"target": PROJECTION_EXPRESSION}, - "KeyConditionExpression": {"target": KEY_EXPRESSION}, - "ExpressionAttributeNames": {"target": EXPRESSION_ATTRIBUTE_NAME_MAP}, - "ExpressionAttributeValues": {"target": EXPRESSION_ATTRIBUTE_VALUE_MAP}, - }, -) - -GET = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#Get"), - members={ - "Key": { - "target": KEY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "TableName": { - "target": TABLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ProjectionExpression": {"target": PROJECTION_EXPRESSION}, - "ExpressionAttributeNames": {"target": EXPRESSION_ATTRIBUTE_NAME_MAP}, - }, -) - -GET_ITEM_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#GetItemInput"), - members={ - "TableName": { - "target": TABLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Key": { - "target": KEY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "AttributesToGet": {"target": ATTRIBUTE_NAME_LIST}, - "ConsistentRead": {"target": CONSISTENT_READ}, - "ReturnConsumedCapacity": {"target": RETURN_CONSUMED_CAPACITY}, - "ProjectionExpression": {"target": PROJECTION_EXPRESSION}, - "ExpressionAttributeNames": {"target": EXPRESSION_ATTRIBUTE_NAME_MAP}, - }, -) - -GET_ITEM_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#GetItemOutput"), - members={ - "Item": {"target": ATTRIBUTE_MAP}, - "ConsumedCapacity": {"target": CONSUMED_CAPACITY}, - }, -) - -ITEM_COLLECTION_METRICS = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ItemCollectionMetrics"), - members={ - "ItemCollectionKey": {"target": ITEM_COLLECTION_KEY_ATTRIBUTE_MAP}, - "SizeEstimateRangeGB": {"target": ITEM_COLLECTION_SIZE_ESTIMATE_RANGE}, - }, -) - -ITEM_LIST = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ItemList"), - shape_type=ShapeType.LIST, - members={"member": {"target": ATTRIBUTE_MAP}}, -) - -ITEM_RESPONSE = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ItemResponse"), - members={"Item": {"target": ATTRIBUTE_MAP}}, -) - -KEY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#KeyList"), - shape_type=ShapeType.LIST, - members={"member": {"target": KEY}}, -) - -PARAMETERIZED_STATEMENT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ParameterizedStatement"), - members={ - "Statement": { - "target": PARTI_QL_STATEMENT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Parameters": {"target": PREPARED_STATEMENT_PARAMETERS}, - "ReturnValuesOnConditionCheckFailure": { - "target": RETURN_VALUES_ON_CONDITION_CHECK_FAILURE - }, - }, -) - -PUT_REQUEST = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#PutRequest"), - members={ - "Item": { - "target": PUT_ITEM_INPUT_ATTRIBUTE_MAP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -SEARCH_RESULT_ITEM = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#SearchResultItem"), - members={ - "Item": {"target": ATTRIBUTE_MAP}, - "Score": { - "target": SCORE_NUMBER, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - }, -) - -BATCH_GET_RESPONSE_MAP = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#BatchGetResponseMap"), - shape_type=ShapeType.MAP, - members={"key": {"target": TABLE_ARN}, "value": {"target": ITEM_LIST}}, -) - -CANCELLATION_REASON_LIST = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#CancellationReasonList"), - shape_type=ShapeType.LIST, - members={"member": {"target": CANCELLATION_REASON}}, -) - -EXPORT_DESCRIPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ExportDescription"), - members={ - "ExportArn": {"target": EXPORT_ARN}, - "ExportStatus": {"target": EXPORT_STATUS}, - "StartTime": {"target": EXPORT_START_TIME}, - "EndTime": {"target": EXPORT_END_TIME}, - "ExportManifest": {"target": EXPORT_MANIFEST}, - "TableArn": {"target": TABLE_ARN}, - "TableId": {"target": TABLE_ID}, - "ExportTime": {"target": EXPORT_TIME}, - "ClientToken": {"target": CLIENT_TOKEN}, - "S3Bucket": {"target": S3_BUCKET}, - "S3BucketOwner": {"target": S3_BUCKET_OWNER}, - "S3Prefix": {"target": S3_PREFIX}, - "S3SseAlgorithm": {"target": S3_SSE_ALGORITHM}, - "S3SseKmsKeyId": {"target": S3_SSE_KMS_KEY_ID}, - "FailureCode": {"target": FAILURE_CODE}, - "FailureMessage": {"target": FAILURE_MESSAGE}, - "ExportFormat": {"target": EXPORT_FORMAT}, - "BilledSizeBytes": {"target": BILLED_SIZE_BYTES}, - "ItemCount": {"target": ITEM_COUNT}, - "ExportType": {"target": EXPORT_TYPE}, - "IncrementalExportSpecification": {"target": INCREMENTAL_EXPORT_SPECIFICATION}, - "FilterSpecification": {"target": FILTER_SPECIFICATION}, - }, -) - -EXPORT_TABLE_TO_POINT_IN_TIME_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ExportTableToPointInTimeInput"), - members={ - "TableArn": { - "target": TABLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ExportTime": {"target": EXPORT_TIME}, - "ClientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "S3Bucket": { - "target": S3_BUCKET, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "S3BucketOwner": {"target": S3_BUCKET_OWNER}, - "S3Prefix": {"target": S3_PREFIX}, - "S3SseAlgorithm": {"target": S3_SSE_ALGORITHM}, - "S3SseKmsKeyId": {"target": S3_SSE_KMS_KEY_ID}, - "ExportFormat": {"target": EXPORT_FORMAT}, - "ExportType": {"target": EXPORT_TYPE}, - "IncrementalExportSpecification": {"target": INCREMENTAL_EXPORT_SPECIFICATION}, - "FilterSpecification": {"target": FILTER_SPECIFICATION}, - }, -) - -FILTER_CONDITION_MAP = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#FilterConditionMap"), - shape_type=ShapeType.MAP, - members={"key": {"target": ATTRIBUTE_NAME}, "value": {"target": CONDITION}}, -) - -ITEM_COLLECTION_METRICS_MULTIPLE = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ItemCollectionMetricsMultiple"), - shape_type=ShapeType.LIST, - members={"member": {"target": ITEM_COLLECTION_METRICS}}, -) - -ITEM_RESPONSE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ItemResponseList"), - shape_type=ShapeType.LIST, - members={"member": {"target": ITEM_RESPONSE}}, -) - -KEY_CONDITIONS = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#KeyConditions"), - shape_type=ShapeType.MAP, - members={"key": {"target": ATTRIBUTE_NAME}, "value": {"target": CONDITION}}, -) - -KEYS_AND_ATTRIBUTES = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#KeysAndAttributes"), - members={ - "Keys": { - "target": KEY_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "AttributesToGet": {"target": ATTRIBUTE_NAME_LIST}, - "ConsistentRead": {"target": CONSISTENT_READ}, - "ProjectionExpression": {"target": PROJECTION_EXPRESSION}, - "ExpressionAttributeNames": {"target": EXPRESSION_ATTRIBUTE_NAME_MAP}, - }, -) - -PARAMETERIZED_STATEMENTS = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ParameterizedStatements"), - shape_type=ShapeType.LIST, - members={"member": {"target": PARAMETERIZED_STATEMENT}}, -) - -PARTI_QL_BATCH_REQUEST = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#PartiQLBatchRequest"), - shape_type=ShapeType.LIST, - members={"member": {"target": BATCH_STATEMENT_REQUEST}}, -) - -SEARCH_RESULT_LIST = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#SearchResultList"), - shape_type=ShapeType.LIST, - members={"member": {"target": SEARCH_RESULT_ITEM}}, -) - -TRANSACT_GET_ITEM = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#TransactGetItem"), - members={ - "Get": {"target": GET, "traits": [Trait.new(id=ShapeID("smithy.api#required"))]} - }, -) - -BATCH_EXECUTE_STATEMENT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#BatchExecuteStatementInput"), - members={ - "Statements": { - "target": PARTI_QL_BATCH_REQUEST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ReturnConsumedCapacity": {"target": RETURN_CONSUMED_CAPACITY}, - }, -) - -BATCH_GET_REQUEST_MAP = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#BatchGetRequestMap"), - shape_type=ShapeType.MAP, - members={"key": {"target": TABLE_ARN}, "value": {"target": KEYS_AND_ATTRIBUTES}}, -) - -DESCRIBE_EXPORT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#DescribeExportOutput"), - members={"ExportDescription": {"target": EXPORT_DESCRIPTION}}, -) - -EXECUTE_TRANSACTION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ExecuteTransactionInput"), - members={ - "TransactStatements": { - "target": PARAMETERIZED_STATEMENTS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ClientRequestToken": { - "target": CLIENT_REQUEST_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "ReturnConsumedCapacity": {"target": RETURN_CONSUMED_CAPACITY}, - }, -) - -EXECUTE_TRANSACTION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ExecuteTransactionOutput"), - members={ - "Responses": {"target": ITEM_RESPONSE_LIST}, - "ConsumedCapacity": {"target": CONSUMED_CAPACITY_MULTIPLE}, - }, -) - -EXPORT_TABLE_TO_POINT_IN_TIME_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ExportTableToPointInTimeOutput"), - members={"ExportDescription": {"target": EXPORT_DESCRIPTION}}, -) - -ITEM_COLLECTION_METRICS_PER_TABLE = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ItemCollectionMetricsPerTable"), - shape_type=ShapeType.MAP, - members={ - "key": {"target": TABLE_ARN}, - "value": {"target": ITEM_COLLECTION_METRICS_MULTIPLE}, - }, -) - -SEARCH_VECTORS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#SearchVectorsOutput"), - members={ - "ConsumedCapacity": {"target": VECTOR_CAPACITY}, - "SearchResults": {"target": SEARCH_RESULT_LIST}, - }, -) - -TRANSACT_GET_ITEM_LIST = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#TransactGetItemList"), - shape_type=ShapeType.LIST, - members={"member": {"target": TRANSACT_GET_ITEM}}, -) - -TRANSACT_GET_ITEMS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#TransactGetItemsOutput"), - members={ - "ConsumedCapacity": {"target": CONSUMED_CAPACITY_MULTIPLE}, - "Responses": {"target": ITEM_RESPONSE_LIST}, - }, -) - -TRANSACTION_CANCELED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#TransactionCanceledException"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], - members={ - "Message": {"target": ERROR_MESSAGE}, - "CancellationReasons": {"target": CANCELLATION_REASON_LIST}, - }, -) - -DESCRIBE_EXPORT = Schema( - id=ShapeID("com.amazonaws.dynamodb#DescribeExport"), shape_type=ShapeType.OPERATION -) - -BATCH_GET_ITEM_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#BatchGetItemInput"), - members={ - "RequestItems": { - "target": BATCH_GET_REQUEST_MAP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ReturnConsumedCapacity": {"target": RETURN_CONSUMED_CAPACITY}, - }, -) - -EXPECTED_ATTRIBUTE_VALUE = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ExpectedAttributeValue"), - members={ - "Value": {"target": ATTRIBUTE_VALUE}, - "Exists": {"target": BOOLEAN_OBJECT}, - "ComparisonOperator": {"target": COMPARISON_OPERATOR}, - "AttributeValueList": {"target": ATTRIBUTE_VALUE_LIST}, - }, -) - -TRANSACT_GET_ITEMS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#TransactGetItemsInput"), - members={ - "TransactItems": { - "target": TRANSACT_GET_ITEM_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ReturnConsumedCapacity": {"target": RETURN_CONSUMED_CAPACITY}, - }, -) - -TRANSACT_WRITE_ITEMS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#TransactWriteItemsOutput"), - members={ - "ConsumedCapacity": {"target": CONSUMED_CAPACITY_MULTIPLE}, - "ItemCollectionMetrics": {"target": ITEM_COLLECTION_METRICS_PER_TABLE}, - }, -) - -CONDITION_CHECK = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ConditionCheck"), - members={ - "Key": { - "target": KEY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "TableName": { - "target": TABLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ConditionExpression": { - "target": CONDITION_EXPRESSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ExpressionAttributeNames": {"target": EXPRESSION_ATTRIBUTE_NAME_MAP}, - "ExpressionAttributeValues": {"target": EXPRESSION_ATTRIBUTE_VALUE_MAP}, - "ReturnValuesOnConditionCheckFailure": { - "target": RETURN_VALUES_ON_CONDITION_CHECK_FAILURE - }, - }, -) - -DELETE = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#Delete"), - members={ - "Key": { - "target": KEY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "TableName": { - "target": TABLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ConditionExpression": {"target": CONDITION_EXPRESSION}, - "ExpressionAttributeNames": {"target": EXPRESSION_ATTRIBUTE_NAME_MAP}, - "ExpressionAttributeValues": {"target": EXPRESSION_ATTRIBUTE_VALUE_MAP}, - "ReturnValuesOnConditionCheckFailure": { - "target": RETURN_VALUES_ON_CONDITION_CHECK_FAILURE - }, - }, -) - -PUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#Put"), - members={ - "Item": { - "target": PUT_ITEM_INPUT_ATTRIBUTE_MAP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "TableName": { - "target": TABLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ConditionExpression": {"target": CONDITION_EXPRESSION}, - "ExpressionAttributeNames": {"target": EXPRESSION_ATTRIBUTE_NAME_MAP}, - "ExpressionAttributeValues": {"target": EXPRESSION_ATTRIBUTE_VALUE_MAP}, - "ReturnValuesOnConditionCheckFailure": { - "target": RETURN_VALUES_ON_CONDITION_CHECK_FAILURE - }, - }, -) - -SEARCH_VECTORS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#SearchVectorsInput"), - members={ - "TableName": { - "target": TABLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "IndexName": { - "target": INDEX_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ReturnConsumedCapacity": {"target": RETURN_CONSUMED_CAPACITY}, - "ExpressionAttributeNames": {"target": EXPRESSION_ATTRIBUTE_NAME_MAP}, - "ExpressionAttributeValues": {"target": EXPRESSION_ATTRIBUTE_VALUE_MAP}, - "ProjectionExpression": {"target": PROJECTION_EXPRESSION}, - "SearchVector": { - "target": SEARCH_VECTOR_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "SearchConditionExpression": {"target": STRING}, - "TopK": { - "target": TOP_K_INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -UPDATE = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#Update"), - members={ - "Key": { - "target": KEY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "UpdateExpression": { - "target": UPDATE_EXPRESSION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "TableName": { - "target": TABLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ConditionExpression": {"target": CONDITION_EXPRESSION}, - "ExpressionAttributeNames": {"target": EXPRESSION_ATTRIBUTE_NAME_MAP}, - "ExpressionAttributeValues": {"target": EXPRESSION_ATTRIBUTE_VALUE_MAP}, - "ReturnValuesOnConditionCheckFailure": { - "target": RETURN_VALUES_ON_CONDITION_CHECK_FAILURE - }, - }, -) - -BATCH_STATEMENT_RESPONSE = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#BatchStatementResponse"), - members={ - "Error": {"target": BATCH_STATEMENT_ERROR}, - "TableName": {"target": TABLE_NAME}, - "Item": {"target": ATTRIBUTE_MAP}, - }, -) - -DELETE_ITEM_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#DeleteItemOutput"), - members={ - "Attributes": {"target": ATTRIBUTE_MAP}, - "ConsumedCapacity": {"target": CONSUMED_CAPACITY}, - "ItemCollectionMetrics": {"target": ITEM_COLLECTION_METRICS}, - }, -) - -EXECUTE_STATEMENT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ExecuteStatementOutput"), - members={ - "Items": {"target": ITEM_LIST}, - "NextToken": {"target": PARTI_QL_NEXT_TOKEN}, - "ConsumedCapacity": {"target": CONSUMED_CAPACITY}, - "LastEvaluatedKey": {"target": KEY}, - }, -) - -EXPECTED_ATTRIBUTE_MAP = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ExpectedAttributeMap"), - shape_type=ShapeType.MAP, - members={ - "key": {"target": ATTRIBUTE_NAME}, - "value": {"target": EXPECTED_ATTRIBUTE_VALUE}, - }, -) - -GET_ITEM = Schema( - id=ShapeID("com.amazonaws.dynamodb#GetItem"), shape_type=ShapeType.OPERATION -) - -PUT_ITEM_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#PutItemOutput"), - members={ - "Attributes": {"target": ATTRIBUTE_MAP}, - "ConsumedCapacity": {"target": CONSUMED_CAPACITY}, - "ItemCollectionMetrics": {"target": ITEM_COLLECTION_METRICS}, - }, -) - -QUERY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#QueryOutput"), - members={ - "Items": {"target": ITEM_LIST}, - "Count": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "ScannedCount": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "LastEvaluatedKey": {"target": KEY}, - "ConsumedCapacity": {"target": CONSUMED_CAPACITY}, - }, -) - -SCAN_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ScanOutput"), - members={ - "Items": {"target": ITEM_LIST}, - "Count": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "ScannedCount": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "LastEvaluatedKey": {"target": KEY}, - "ConsumedCapacity": {"target": CONSUMED_CAPACITY}, - }, -) - -UPDATE_ITEM_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#UpdateItemOutput"), - members={ - "Attributes": {"target": ATTRIBUTE_MAP}, - "ConsumedCapacity": {"target": CONSUMED_CAPACITY}, - "ItemCollectionMetrics": {"target": ITEM_COLLECTION_METRICS}, - }, -) - -WRITE_REQUEST = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#WriteRequest"), - members={ - "PutRequest": {"target": PUT_REQUEST}, - "DeleteRequest": {"target": DELETE_REQUEST}, - }, -) - -PARTI_QL_BATCH_RESPONSE = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#PartiQLBatchResponse"), - shape_type=ShapeType.LIST, - members={"member": {"target": BATCH_STATEMENT_RESPONSE}}, -) - -EXPORT_TABLE_TO_POINT_IN_TIME = Schema( - id=ShapeID("com.amazonaws.dynamodb#ExportTableToPointInTime"), - shape_type=ShapeType.OPERATION, -) - -WRITE_REQUESTS = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#WriteRequests"), - shape_type=ShapeType.LIST, - members={"member": {"target": WRITE_REQUEST}}, -) - -BATCH_EXECUTE_STATEMENT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#BatchExecuteStatementOutput"), - members={ - "Responses": {"target": PARTI_QL_BATCH_RESPONSE}, - "ConsumedCapacity": {"target": CONSUMED_CAPACITY_MULTIPLE}, - }, -) - -BATCH_GET_ITEM_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#BatchGetItemOutput"), - members={ - "Responses": {"target": BATCH_GET_RESPONSE_MAP}, - "UnprocessedKeys": {"target": BATCH_GET_REQUEST_MAP}, - "ConsumedCapacity": {"target": CONSUMED_CAPACITY_MULTIPLE}, - }, -) - -BATCH_WRITE_ITEM_REQUEST_MAP = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#BatchWriteItemRequestMap"), - shape_type=ShapeType.MAP, - members={"key": {"target": TABLE_ARN}, "value": {"target": WRITE_REQUESTS}}, -) - -SCAN_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#ScanInput"), - members={ - "TableName": { - "target": TABLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "IndexName": {"target": INDEX_NAME}, - "AttributesToGet": {"target": ATTRIBUTE_NAME_LIST}, - "Limit": {"target": POSITIVE_INTEGER_OBJECT}, - "Select": {"target": SELECT}, - "ScanFilter": {"target": FILTER_CONDITION_MAP}, - "ConditionalOperator": {"target": CONDITIONAL_OPERATOR}, - "ExclusiveStartKey": {"target": KEY}, - "ReturnConsumedCapacity": {"target": RETURN_CONSUMED_CAPACITY}, - "TotalSegments": {"target": SCAN_TOTAL_SEGMENTS}, - "Segment": {"target": SCAN_SEGMENT}, - "ProjectionExpression": {"target": PROJECTION_EXPRESSION}, - "FilterExpression": {"target": CONDITION_EXPRESSION}, - "ExpressionAttributeNames": {"target": EXPRESSION_ATTRIBUTE_NAME_MAP}, - "ExpressionAttributeValues": {"target": EXPRESSION_ATTRIBUTE_VALUE_MAP}, - "ConsistentRead": {"target": CONSISTENT_READ}, - }, -) - -SEARCH_VECTORS = Schema( - id=ShapeID("com.amazonaws.dynamodb#SearchVectors"), shape_type=ShapeType.OPERATION -) - -BATCH_WRITE_ITEM_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#BatchWriteItemInput"), - members={ - "RequestItems": { - "target": BATCH_WRITE_ITEM_REQUEST_MAP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ReturnConsumedCapacity": {"target": RETURN_CONSUMED_CAPACITY}, - "ReturnItemCollectionMetrics": {"target": RETURN_ITEM_COLLECTION_METRICS}, - }, -) - -DELETE_ITEM_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#DeleteItemInput"), - members={ - "TableName": { - "target": TABLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Key": { - "target": KEY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Expected": {"target": EXPECTED_ATTRIBUTE_MAP}, - "ConditionalOperator": {"target": CONDITIONAL_OPERATOR}, - "ReturnValues": {"target": RETURN_VALUE}, - "ReturnConsumedCapacity": {"target": RETURN_CONSUMED_CAPACITY}, - "ReturnItemCollectionMetrics": {"target": RETURN_ITEM_COLLECTION_METRICS}, - "ConditionExpression": {"target": CONDITION_EXPRESSION}, - "ExpressionAttributeNames": {"target": EXPRESSION_ATTRIBUTE_NAME_MAP}, - "ExpressionAttributeValues": {"target": EXPRESSION_ATTRIBUTE_VALUE_MAP}, - "ReturnValuesOnConditionCheckFailure": { - "target": RETURN_VALUES_ON_CONDITION_CHECK_FAILURE - }, - }, -) - -EXECUTE_STATEMENT = Schema( - id=ShapeID("com.amazonaws.dynamodb#ExecuteStatement"), - shape_type=ShapeType.OPERATION, -) - -PUT_ITEM_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#PutItemInput"), - members={ - "TableName": { - "target": TABLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Item": { - "target": PUT_ITEM_INPUT_ATTRIBUTE_MAP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Expected": {"target": EXPECTED_ATTRIBUTE_MAP}, - "ReturnValues": {"target": RETURN_VALUE}, - "ReturnConsumedCapacity": {"target": RETURN_CONSUMED_CAPACITY}, - "ReturnItemCollectionMetrics": {"target": RETURN_ITEM_COLLECTION_METRICS}, - "ConditionalOperator": {"target": CONDITIONAL_OPERATOR}, - "ConditionExpression": {"target": CONDITION_EXPRESSION}, - "ExpressionAttributeNames": {"target": EXPRESSION_ATTRIBUTE_NAME_MAP}, - "ExpressionAttributeValues": {"target": EXPRESSION_ATTRIBUTE_VALUE_MAP}, - "ReturnValuesOnConditionCheckFailure": { - "target": RETURN_VALUES_ON_CONDITION_CHECK_FAILURE - }, - }, -) - -EXECUTE_TRANSACTION = Schema( - id=ShapeID("com.amazonaws.dynamodb#ExecuteTransaction"), - shape_type=ShapeType.OPERATION, -) - -QUERY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#QueryInput"), - members={ - "TableName": { - "target": TABLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "IndexName": {"target": INDEX_NAME}, - "Select": {"target": SELECT}, - "AttributesToGet": {"target": ATTRIBUTE_NAME_LIST}, - "Limit": {"target": POSITIVE_INTEGER_OBJECT}, - "ConsistentRead": {"target": CONSISTENT_READ}, - "KeyConditions": {"target": KEY_CONDITIONS}, - "QueryFilter": {"target": FILTER_CONDITION_MAP}, - "ConditionalOperator": {"target": CONDITIONAL_OPERATOR}, - "ScanIndexForward": {"target": BOOLEAN_OBJECT}, - "ExclusiveStartKey": {"target": KEY}, - "ReturnConsumedCapacity": {"target": RETURN_CONSUMED_CAPACITY}, - "ProjectionExpression": {"target": PROJECTION_EXPRESSION}, - "FilterExpression": {"target": CONDITION_EXPRESSION}, - "KeyConditionExpression": {"target": KEY_EXPRESSION}, - "ExpressionAttributeNames": {"target": EXPRESSION_ATTRIBUTE_NAME_MAP}, - "ExpressionAttributeValues": {"target": EXPRESSION_ATTRIBUTE_VALUE_MAP}, - }, -) - -BATCH_EXECUTE_STATEMENT = Schema( - id=ShapeID("com.amazonaws.dynamodb#BatchExecuteStatement"), - shape_type=ShapeType.OPERATION, -) - -TRANSACT_GET_ITEMS = Schema( - id=ShapeID("com.amazonaws.dynamodb#TransactGetItems"), - shape_type=ShapeType.OPERATION, -) - -BATCH_GET_ITEM = Schema( - id=ShapeID("com.amazonaws.dynamodb#BatchGetItem"), shape_type=ShapeType.OPERATION -) - -BATCH_WRITE_ITEM_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#BatchWriteItemOutput"), - members={ - "UnprocessedItems": {"target": BATCH_WRITE_ITEM_REQUEST_MAP}, - "ItemCollectionMetrics": {"target": ITEM_COLLECTION_METRICS_PER_TABLE}, - "ConsumedCapacity": {"target": CONSUMED_CAPACITY_MULTIPLE}, - }, -) - -UPDATE_ITEM_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#UpdateItemInput"), - members={ - "TableName": { - "target": TABLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Key": { - "target": KEY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "AttributeUpdates": {"target": ATTRIBUTE_UPDATES}, - "Expected": {"target": EXPECTED_ATTRIBUTE_MAP}, - "ConditionalOperator": {"target": CONDITIONAL_OPERATOR}, - "ReturnValues": {"target": RETURN_VALUE}, - "ReturnConsumedCapacity": {"target": RETURN_CONSUMED_CAPACITY}, - "ReturnItemCollectionMetrics": {"target": RETURN_ITEM_COLLECTION_METRICS}, - "UpdateExpression": {"target": UPDATE_EXPRESSION}, - "ConditionExpression": {"target": CONDITION_EXPRESSION}, - "ExpressionAttributeNames": {"target": EXPRESSION_ATTRIBUTE_NAME_MAP}, - "ExpressionAttributeValues": {"target": EXPRESSION_ATTRIBUTE_VALUE_MAP}, - "ReturnValuesOnConditionCheckFailure": { - "target": RETURN_VALUES_ON_CONDITION_CHECK_FAILURE - }, - }, -) - -SCAN = Schema(id=ShapeID("com.amazonaws.dynamodb#Scan"), shape_type=ShapeType.OPERATION) - -QUERY = Schema( - id=ShapeID("com.amazonaws.dynamodb#Query"), shape_type=ShapeType.OPERATION -) - -DELETE_ITEM = Schema( - id=ShapeID("com.amazonaws.dynamodb#DeleteItem"), shape_type=ShapeType.OPERATION -) - -PUT_ITEM = Schema( - id=ShapeID("com.amazonaws.dynamodb#PutItem"), shape_type=ShapeType.OPERATION -) - -TRANSACT_WRITE_ITEM = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#TransactWriteItem"), - members={ - "ConditionCheck": {"target": CONDITION_CHECK}, - "Put": {"target": PUT}, - "Delete": {"target": DELETE}, - "Update": {"target": UPDATE}, - }, -) - -UPDATE_ITEM = Schema( - id=ShapeID("com.amazonaws.dynamodb#UpdateItem"), shape_type=ShapeType.OPERATION -) - -BATCH_WRITE_ITEM = Schema( - id=ShapeID("com.amazonaws.dynamodb#BatchWriteItem"), shape_type=ShapeType.OPERATION -) - -TRANSACT_WRITE_ITEM_LIST = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#TransactWriteItemList"), - shape_type=ShapeType.LIST, - members={"member": {"target": TRANSACT_WRITE_ITEM}}, -) - -TRANSACT_WRITE_ITEMS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.dynamodb#TransactWriteItemsInput"), - members={ - "TransactItems": { - "target": TRANSACT_WRITE_ITEM_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ReturnConsumedCapacity": {"target": RETURN_CONSUMED_CAPACITY}, - "ReturnItemCollectionMetrics": {"target": RETURN_ITEM_COLLECTION_METRICS}, - "ClientRequestToken": { - "target": CLIENT_REQUEST_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - }, -) - -TRANSACT_WRITE_ITEMS = Schema( - id=ShapeID("com.amazonaws.dynamodb#TransactWriteItems"), - shape_type=ShapeType.OPERATION, -) - -DYNAMO_DB_20120810 = Schema( - id=ShapeID("com.amazonaws.dynamodb#DynamoDB_20120810"), - shape_type=ShapeType.SERVICE, - traits=[ - Trait.new( - id=ShapeID("aws.auth#sigv4"), value=MappingProxyType({"name": "dynamodb"}) - ), - Trait.new(id=ShapeID("aws.protocols#awsJson1_0")), - Trait.new( - id=ShapeID("smithy.rules#endpointBdd"), - value=MappingProxyType( - { - "version": "1.1", - "parameters": MappingProxyType( - { - "Region": MappingProxyType( - { - "builtIn": "AWS::Region", - "required": False, - "documentation": "The AWS region used to dispatch the request.", - "type": "string", - } - ), - "UseDualStack": MappingProxyType( - { - "builtIn": "AWS::UseDualStack", - "required": True, - "default": False, - "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", - "type": "boolean", - } - ), - "UseFIPS": MappingProxyType( - { - "builtIn": "AWS::UseFIPS", - "required": True, - "default": False, - "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", - "type": "boolean", - } - ), - "Endpoint": MappingProxyType( - { - "builtIn": "SDK::Endpoint", - "required": False, - "documentation": "Override the endpoint used to send this request", - "type": "string", - } - ), - "AccountId": MappingProxyType( - { - "builtIn": "AWS::Auth::AccountId", - "required": False, - "documentation": "The AWS AccountId used for the request.", - "type": "string", - } - ), - "AccountIdEndpointMode": MappingProxyType( - { - "builtIn": "AWS::Auth::AccountIdEndpointMode", - "required": False, - "documentation": "The AccountId Endpoint Mode.", - "type": "string", - } - ), - "ResourceArn": MappingProxyType( - { - "required": False, - "documentation": "ResourceArn containing arn of resource", - "type": "string", - } - ), - "ResourceArnList": MappingProxyType( - { - "required": False, - "documentation": "ResourceArnList containing list of resource arns", - "type": "stringArray", - } - ), - "IsSearchOperation": MappingProxyType( - { - "required": False, - "documentation": "Set to true for SearchVectors to route to the Search FQDN", - "type": "boolean", - } - ), - } - ), - "conditions": ( - MappingProxyType( - { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "Region"}),), - } - ), - MappingProxyType( - { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "Endpoint"}),), - } - ), - MappingProxyType( - { - "fn": "booleanEquals", - "argv": (MappingProxyType({"ref": "UseFIPS"}), True), - } - ), - MappingProxyType( - { - "fn": "booleanEquals", - "argv": ( - MappingProxyType({"ref": "UseDualStack"}), - True, - ), - } - ), - MappingProxyType( - { - "fn": "aws.partition", - "argv": (MappingProxyType({"ref": "Region"}),), - "assign": "PartitionResult", - } - ), - MappingProxyType( - { - "fn": "stringEquals", - "argv": (MappingProxyType({"ref": "Region"}), "local"), - } - ), - MappingProxyType( - { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "supportsFIPS", - ), - } - ), - True, - ), - } - ), - MappingProxyType( - { - "fn": "parseURL", - "argv": (MappingProxyType({"ref": "Endpoint"}),), - "assign": "parsedEndpoint", - } - ), - MappingProxyType( - { - "fn": "stringEquals", - "argv": ( - "dynamodb.{Region}.{PartitionResult#dualStackDnsSuffix}", - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "parsedEndpoint"} - ), - "authority", - ), - } - ), - ), - } - ), - MappingProxyType( - { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "supportsDualStack", - ), - } - ), - True, - ), - } - ), - MappingProxyType( - { - "fn": "stringEquals", - "argv": ( - "search-dynamodb.{Region}.{PartitionResult#dualStackDnsSuffix}", - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "parsedEndpoint"} - ), - "authority", - ), - } - ), - ), - } - ), - MappingProxyType( - { - "fn": "isSet", - "argv": ( - MappingProxyType({"ref": "AccountIdEndpointMode"}), - ), - } - ), - MappingProxyType( - { - "fn": "stringEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "name", - ), - } - ), - "aws", - ), - } - ), - MappingProxyType( - { - "fn": "stringEquals", - "argv": ( - MappingProxyType({"ref": "AccountIdEndpointMode"}), - "disabled", - ), - } - ), - MappingProxyType( - { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "ResourceArn"}),), - } - ), - MappingProxyType( - { - "fn": "aws.parseArn", - "argv": (MappingProxyType({"ref": "ResourceArn"}),), - "assign": "ParsedArn_ssa_2", - } - ), - MappingProxyType( - { - "fn": "stringEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "ParsedArn_ssa_2"} - ), - "region", - ), - } - ), - MappingProxyType({"ref": "Region"}), - ), - } - ), - MappingProxyType( - { - "fn": "stringEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "ParsedArn_ssa_2"} - ), - "service", - ), - } - ), - "dynamodb", - ), - } - ), - MappingProxyType( - { - "fn": "isValidHostLabel", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "ParsedArn_ssa_2"} - ), - "region", - ), - } - ), - False, - ), - } - ), - MappingProxyType( +DYNAMO_DB_20120810: StaticSchema = ( + 21, + n0, + _D_, + { + _a: MappingProxyType({"name": "dynamodb"}), + _a_: None, + _sB: MappingProxyType( + { + "version": "1.1", + "parameters": MappingProxyType( + { + "Region": MappingProxyType( { - "fn": "isValidHostLabel", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "ParsedArn_ssa_2"} - ), - "accountId", - ), - } - ), - False, - ), - } - ), - MappingProxyType( - { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "ResourceArnList"}),), - } - ), - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType({"ref": "ResourceArnList"}), - "[0]", - ), - "assign": "FirstArn", - } - ), - MappingProxyType( - { - "fn": "aws.parseArn", - "argv": (MappingProxyType({"ref": "FirstArn"}),), - "assign": "ParsedArn_ssa_1", - } - ), - MappingProxyType( - { - "fn": "stringEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "ParsedArn_ssa_1"} - ), - "region", - ), - } - ), - MappingProxyType({"ref": "Region"}), - ), + "builtIn": "AWS::Region", + "required": False, + "documentation": "The AWS region used to dispatch the request.", + "type": "string", } ), - MappingProxyType( + "UseDualStack": MappingProxyType( { - "fn": "stringEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "ParsedArn_ssa_1"} - ), - "service", - ), - } - ), - "dynamodb", - ), + "builtIn": "AWS::UseDualStack", + "required": True, + "default": False, + "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", + "type": "boolean", } ), - MappingProxyType( + "UseFIPS": MappingProxyType( { - "fn": "isValidHostLabel", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "ParsedArn_ssa_1"} - ), - "accountId", - ), - } - ), - False, - ), + "builtIn": "AWS::UseFIPS", + "required": True, + "default": False, + "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", + "type": "boolean", } ), - MappingProxyType( + "Endpoint": MappingProxyType( { - "fn": "isValidHostLabel", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "ParsedArn_ssa_1"} - ), - "region", - ), - } - ), - False, - ), + "builtIn": "SDK::Endpoint", + "required": False, + "documentation": "Override the endpoint used to send this request", + "type": "string", } ), - MappingProxyType( + "AccountId": MappingProxyType( { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "AccountId"}),), + "builtIn": "AWS::Auth::AccountId", + "required": False, + "documentation": "The AWS AccountId used for the request.", + "type": "string", } ), - MappingProxyType( + "AccountIdEndpointMode": MappingProxyType( { - "fn": "stringEquals", - "argv": ( - MappingProxyType({"ref": "AccountIdEndpointMode"}), - "required", - ), + "builtIn": "AWS::Auth::AccountIdEndpointMode", + "required": False, + "documentation": "The AccountId Endpoint Mode.", + "type": "string", } ), - MappingProxyType( + "ResourceArn": MappingProxyType( { - "fn": "isValidHostLabel", - "argv": (MappingProxyType({"ref": "AccountId"}), False), + "required": False, + "documentation": "ResourceArn containing arn of resource", + "type": "string", } ), - MappingProxyType( + "ResourceArnList": MappingProxyType( { - "fn": "stringEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "name", - ), - } - ), - "aws-us-gov", - ), + "required": False, + "documentation": "ResourceArnList containing list of resource arns", + "type": "stringArray", } ), - MappingProxyType( + "IsSearchOperation": MappingProxyType( { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( - { - "fn": "coalesce", - "argv": ( - MappingProxyType( - {"ref": "IsSearchOperation"} - ), - False, - ), - } - ), - True, - ), + "required": False, + "documentation": "Set to true for SearchVectors to route to the Search FQDN", + "type": "boolean", } ), + } + ), + "conditions": ( + MappingProxyType( + {"fn": "isSet", "argv": (MappingProxyType({"ref": "Region"}),)} ), - "results": ( - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: FIPS and custom endpoint are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Endpoint override is not supported for dual-stack endpoints. Please enable dual-stack functionality by enabling the configuration. For more details, see: https://docs.aws.amazon.com/sdkref/latest/guide/feature-endpoints.html", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "{Endpoint}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: FIPS and local endpoint are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: Dualstack and local endpoint are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + MappingProxyType( + { + "fn": "isSet", + "argv": (MappingProxyType({"ref": "Endpoint"}),), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": (MappingProxyType({"ref": "UseFIPS"}), True), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": (MappingProxyType({"ref": "UseDualStack"}), True), + } + ), + MappingProxyType( + { + "fn": "aws.partition", + "argv": (MappingProxyType({"ref": "Region"}),), + "assign": "PartitionResult", + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": (MappingProxyType({"ref": "Region"}), "local"), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( { - "url": "http://localhost:8000", - "properties": MappingProxyType( - { - "authSchemes": ( - MappingProxyType( - { - "signingRegion": "us-east-1", - "signingName": "dynamodb", - "name": "sigv4", - } - ), - ) - } + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "supportsFIPS", ), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: AccountIdEndpointMode is required and FIPS is enabled, but FIPS account endpoints are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://search-dynamodb-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://dynamodb-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "FIPS and DualStack are enabled, but this partition does not support one or both", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://search-dynamodb.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://dynamodb.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://search-dynamodb-fips.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://dynamodb-fips.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "FIPS is enabled but this partition does not support FIPS", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + True, + ), + } + ), + MappingProxyType( + { + "fn": "parseURL", + "argv": (MappingProxyType({"ref": "Endpoint"}),), + "assign": "parsedEndpoint", + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + "dynamodb.{Region}.{PartitionResult#dualStackDnsSuffix}", + MappingProxyType( { - "url": "https://{ParsedArn_ssa_2#accountId}.search-ddb.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType( - {"metricValues": ("O",)} + "fn": "getAttr", + "argv": ( + MappingProxyType({"ref": "parsedEndpoint"}), + "authority", ), - "headers": MappingProxyType({}), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( { - "url": "https://{ParsedArn_ssa_2#accountId}.ddb.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType( - {"metricValues": ("O",)} + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "supportsDualStack", ), - "headers": MappingProxyType({}), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + True, + ), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + "search-dynamodb.{Region}.{PartitionResult#dualStackDnsSuffix}", + MappingProxyType( { - "url": "https://{ParsedArn_ssa_1#accountId}.search-ddb.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType( - {"metricValues": ("O",)} + "fn": "getAttr", + "argv": ( + MappingProxyType({"ref": "parsedEndpoint"}), + "authority", ), - "headers": MappingProxyType({}), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + ), + } + ), + MappingProxyType( + { + "fn": "isSet", + "argv": ( + MappingProxyType({"ref": "AccountIdEndpointMode"}), + ), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( { - "url": "https://{ParsedArn_ssa_1#accountId}.ddb.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType( - {"metricValues": ("O",)} + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "name", ), - "headers": MappingProxyType({}), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + "aws", + ), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType({"ref": "AccountIdEndpointMode"}), + "disabled", + ), + } + ), + MappingProxyType( + { + "fn": "isSet", + "argv": (MappingProxyType({"ref": "ResourceArn"}),), + } + ), + MappingProxyType( + { + "fn": "aws.parseArn", + "argv": (MappingProxyType({"ref": "ResourceArn"}),), + "assign": "ParsedArn_ssa_2", + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( { - "url": "https://{AccountId}.search-ddb.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType( - {"metricValues": ("O",)} + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "ParsedArn_ssa_2"} + ), + "region", ), - "headers": MappingProxyType({}), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + MappingProxyType({"ref": "Region"}), + ), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( { - "url": "https://{AccountId}.ddb.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType( - {"metricValues": ("O",)} + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "ParsedArn_ssa_2"} + ), + "service", ), - "headers": MappingProxyType({}), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Credentials-sourced account ID parameter is invalid", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "AccountIdEndpointMode is required but no AccountID was provided or able to be loaded", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: AccountIdEndpointMode is required but account endpoints are not supported in this partition", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + "dynamodb", + ), + } + ), + MappingProxyType( + { + "fn": "isValidHostLabel", + "argv": ( + MappingProxyType( { - "url": "https://search-dynamodb.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "ParsedArn_ssa_2"} + ), + "region", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + False, + ), + } + ), + MappingProxyType( + { + "fn": "isValidHostLabel", + "argv": ( + MappingProxyType( { - "url": "https://dynamodb.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "ParsedArn_ssa_2"} + ), + "accountId", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "DualStack is enabled but this partition does not support DualStack", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + False, + ), + } + ), + MappingProxyType( + { + "fn": "isSet", + "argv": (MappingProxyType({"ref": "ResourceArnList"}),), + } + ), + MappingProxyType( + { + "fn": "getAttr", + "argv": ( + MappingProxyType({"ref": "ResourceArnList"}), + "[0]", + ), + "assign": "FirstArn", + } + ), + MappingProxyType( + { + "fn": "aws.parseArn", + "argv": (MappingProxyType({"ref": "FirstArn"}),), + "assign": "ParsedArn_ssa_1", + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( { - "url": "https://{ParsedArn_ssa_2#accountId}.search-ddb.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType( - {"metricValues": ("O",)} + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "ParsedArn_ssa_1"} + ), + "region", ), - "headers": MappingProxyType({}), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + MappingProxyType({"ref": "Region"}), + ), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( { - "url": "https://{ParsedArn_ssa_2#accountId}.ddb.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType( - {"metricValues": ("O",)} + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "ParsedArn_ssa_1"} + ), + "service", ), - "headers": MappingProxyType({}), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + "dynamodb", + ), + } + ), + MappingProxyType( + { + "fn": "isValidHostLabel", + "argv": ( + MappingProxyType( { - "url": "https://{ParsedArn_ssa_1#accountId}.search-ddb.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType( - {"metricValues": ("O",)} + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "ParsedArn_ssa_1"} + ), + "accountId", ), - "headers": MappingProxyType({}), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + False, + ), + } + ), + MappingProxyType( + { + "fn": "isValidHostLabel", + "argv": ( + MappingProxyType( { - "url": "https://{ParsedArn_ssa_1#accountId}.ddb.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType( - {"metricValues": ("O",)} + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "ParsedArn_ssa_1"} + ), + "region", ), - "headers": MappingProxyType({}), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + False, + ), + } + ), + MappingProxyType( + { + "fn": "isSet", + "argv": (MappingProxyType({"ref": "AccountId"}),), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType({"ref": "AccountIdEndpointMode"}), + "required", + ), + } + ), + MappingProxyType( + { + "fn": "isValidHostLabel", + "argv": (MappingProxyType({"ref": "AccountId"}), False), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( { - "url": "https://{AccountId}.search-ddb.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType( - {"metricValues": ("O",)} + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "name", ), - "headers": MappingProxyType({}), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + "aws-us-gov", + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( { - "url": "https://{AccountId}.ddb.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType( - {"metricValues": ("O",)} + "fn": "coalesce", + "argv": ( + MappingProxyType( + {"ref": "IsSearchOperation"} + ), + False, ), - "headers": MappingProxyType({}), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: Missing Region", - "type": "error", - } - ), + True, + ), + } ), - "root": 2, - "nodeCount": 82, - "nodes": "/////wAAAAH/////AAAAAAAAAAYAAAADAAAAAQAAAAQF9eEjAAAAAgX14QEAAAAFAAAAAwX14QIF9eEEAAAAAQAAAE0AAAAHAAAAAgAAAD0AAAAIAAAAAwAAACIAAAAJAAAABAAAAAoF9eEjAAAABQX14QcAAAALAAAACwAAAAwAAABFAAAADAAAAA4AAAANAAAAHAX14RkAAABFAAAADQAAACEAAAAPAAAADgAAABAAAAAVAAAADwAAABEAAAAVAAAAEAAAABIAAAAVAAAAEQAAABMAAAAVAAAAEgAAABQAAAAVAAAAEwAAACAAAAAVAAAAFAAAABYAAAAcAAAAFQAAABcAAAAcAAAAFgAAABgAAAAcAAAAFwAAABkAAAAcAAAAGAAAABoAAAAcAAAAGQAAABsAAAAcAAAAGgAAAB8AAAAcAAAAGwAAAB0AAAAhAAAAHQAAAB4F9eEXAAAAHwX14SEF9eEiAAAAHwX14R8F9eEgAAAAHwX14R0F9eEeAAAAHAX14RgAAABFAAAABAAAACMF9eEjAAAABQX14QYAAAAkAAAACQAAACUF9eEcAAAACwAAACYAAAA8AAAADAAAACgAAAAnAAAAHAX14RkAAAA8AAAADQAAADsAAAApAAAADgAAACoAAAAvAAAADwAAACsAAAAvAAAAEAAAACwAAAAvAAAAEQAAAC0AAAAvAAAAEgAAAC4AAAAvAAAAEwAAADoAAAAvAAAAFAAAADAAAAA2AAAAFQAAADEAAAA2AAAAFgAAADIAAAA2AAAAFwAAADMAAAA2AAAAGAAAADQAAAA2AAAAGQAAADUAAAA2AAAAGgAAADkAAAA2AAAAGwAAADcAAAA7AAAAHQAAADgF9eEXAAAAHwX14RUF9eEWAAAAHwX14RMF9eEUAAAAHwX14REF9eESAAAAHAX14RgAAAA8AAAAHwX14RoF9eEbAAAAAwAAAEYAAAA+AAAABAAAAD8F9eEjAAAABQX14QUAAABAAAAABgAAAEEF9eEQAAAACwAAAEIAAABDAAAAHAX14QgAAABDAAAAHgAAAEUAAABEAAAAHwX14Q4F9eEPAAAAHwX14QwF9eENAAAABAAAAEcF9eEjAAAABQX14QUAAABIAAAABgAAAEkF9eELAAAACQAAAEoF9eELAAAACwAAAEsAAABMAAAAHAX14QgAAABMAAAAHwX14QkF9eEKAAAAAgX14QEAAABOAAAAAwX14QIAAABPAAAABAAAAFAF9eEEAAAABwAAAFEF9eEEAAAACAX14QMAAABSAAAACgX14QMF9eEE", - } - ), - ), - Trait.new( - id=ShapeID("aws.api#service"), - value=MappingProxyType( - { - "sdkId": "DynamoDB", - "arnNamespace": "dynamodb", - "cloudFormationName": "DynamoDB", - "cloudTrailEventSource": "dynamodb.amazonaws.com", - "endpointPrefix": "dynamodb", - } - ), + ), + "results": ( + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: FIPS and custom endpoint are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Endpoint override is not supported for dual-stack endpoints. Please enable dual-stack functionality by enabling the configuration. For more details, see: https://docs.aws.amazon.com/sdkref/latest/guide/feature-endpoints.html", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "{Endpoint}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: FIPS and local endpoint are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Dualstack and local endpoint are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "http://localhost:8000", + "properties": MappingProxyType( + { + "authSchemes": ( + MappingProxyType( + { + "signingRegion": "us-east-1", + "signingName": "dynamodb", + "name": "sigv4", + } + ), + ) + } + ), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: AccountIdEndpointMode is required and FIPS is enabled, but FIPS account endpoints are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://search-dynamodb-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://dynamodb-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS and DualStack are enabled, but this partition does not support one or both", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://search-dynamodb.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://dynamodb.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://search-dynamodb-fips.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://dynamodb-fips.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS is enabled but this partition does not support FIPS", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://{ParsedArn_ssa_2#accountId}.search-ddb.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType( + {"metricValues": ("O",)} + ), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://{ParsedArn_ssa_2#accountId}.ddb.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType( + {"metricValues": ("O",)} + ), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://{ParsedArn_ssa_1#accountId}.search-ddb.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType( + {"metricValues": ("O",)} + ), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://{ParsedArn_ssa_1#accountId}.ddb.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType( + {"metricValues": ("O",)} + ), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://{AccountId}.search-ddb.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType( + {"metricValues": ("O",)} + ), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://{AccountId}.ddb.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType( + {"metricValues": ("O",)} + ), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Credentials-sourced account ID parameter is invalid", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "AccountIdEndpointMode is required but no AccountID was provided or able to be loaded", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: AccountIdEndpointMode is required but account endpoints are not supported in this partition", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://search-dynamodb.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://dynamodb.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "DualStack is enabled but this partition does not support DualStack", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://{ParsedArn_ssa_2#accountId}.search-ddb.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType( + {"metricValues": ("O",)} + ), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://{ParsedArn_ssa_2#accountId}.ddb.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType( + {"metricValues": ("O",)} + ), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://{ParsedArn_ssa_1#accountId}.search-ddb.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType( + {"metricValues": ("O",)} + ), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://{ParsedArn_ssa_1#accountId}.ddb.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType( + {"metricValues": ("O",)} + ), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://{AccountId}.search-ddb.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType( + {"metricValues": ("O",)} + ), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://{AccountId}.ddb.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType( + {"metricValues": ("O",)} + ), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Missing Region", + "type": "error", + } + ), + ), + "root": 2, + "nodeCount": 82, + "nodes": "/////wAAAAH/////AAAAAAAAAAYAAAADAAAAAQAAAAQF9eEjAAAAAgX14QEAAAAFAAAAAwX14QIF9eEEAAAAAQAAAE0AAAAHAAAAAgAAAD0AAAAIAAAAAwAAACIAAAAJAAAABAAAAAoF9eEjAAAABQX14QcAAAALAAAACwAAAAwAAABFAAAADAAAAA4AAAANAAAAHAX14RkAAABFAAAADQAAACEAAAAPAAAADgAAABAAAAAVAAAADwAAABEAAAAVAAAAEAAAABIAAAAVAAAAEQAAABMAAAAVAAAAEgAAABQAAAAVAAAAEwAAACAAAAAVAAAAFAAAABYAAAAcAAAAFQAAABcAAAAcAAAAFgAAABgAAAAcAAAAFwAAABkAAAAcAAAAGAAAABoAAAAcAAAAGQAAABsAAAAcAAAAGgAAAB8AAAAcAAAAGwAAAB0AAAAhAAAAHQAAAB4F9eEXAAAAHwX14SEF9eEiAAAAHwX14R8F9eEgAAAAHwX14R0F9eEeAAAAHAX14RgAAABFAAAABAAAACMF9eEjAAAABQX14QYAAAAkAAAACQAAACUF9eEcAAAACwAAACYAAAA8AAAADAAAACgAAAAnAAAAHAX14RkAAAA8AAAADQAAADsAAAApAAAADgAAACoAAAAvAAAADwAAACsAAAAvAAAAEAAAACwAAAAvAAAAEQAAAC0AAAAvAAAAEgAAAC4AAAAvAAAAEwAAADoAAAAvAAAAFAAAADAAAAA2AAAAFQAAADEAAAA2AAAAFgAAADIAAAA2AAAAFwAAADMAAAA2AAAAGAAAADQAAAA2AAAAGQAAADUAAAA2AAAAGgAAADkAAAA2AAAAGwAAADcAAAA7AAAAHQAAADgF9eEXAAAAHwX14RUF9eEWAAAAHwX14RMF9eEUAAAAHwX14REF9eESAAAAHAX14RgAAAA8AAAAHwX14RoF9eEbAAAAAwAAAEYAAAA+AAAABAAAAD8F9eEjAAAABQX14QUAAABAAAAABgAAAEEF9eEQAAAACwAAAEIAAABDAAAAHAX14QgAAABDAAAAHgAAAEUAAABEAAAAHwX14Q4F9eEPAAAAHwX14QwF9eENAAAABAAAAEcF9eEjAAAABQX14QUAAABIAAAABgAAAEkF9eELAAAACQAAAEoF9eELAAAACwAAAEsAAABMAAAAHAX14QgAAABMAAAAHwX14QkF9eEKAAAAAgX14QEAAABOAAAAAwX14QIAAABPAAAABAAAAFAF9eEEAAAABwAAAFEF9eEEAAAACAX14QMAAABSAAAACgX14QMF9eEE", + } ), - Trait.new( - id=ShapeID("smithy.api#xmlNamespace"), - value=MappingProxyType( - {"uri": "http://dynamodb.amazonaws.com/doc/2012-08-10/"} - ), + _aw: MappingProxyType( + { + "sdkId": "DynamoDB", + "arnNamespace": "dynamodb", + "cloudFormationName": "DynamoDB", + "cloudTrailEventSource": "dynamodb.amazonaws.com", + "endpointPrefix": "dynamodb", + } ), - ], -) - -ATTRIBUTE_VALUE.members["L"] = Schema.member( - id=ATTRIBUTE_VALUE.id.with_member("L"), target=LIST_ATTRIBUTE_VALUE, index=7 -) - -ATTRIBUTE_VALUE.members["M"] = Schema.member( - id=ATTRIBUTE_VALUE.id.with_member("M"), target=MAP_ATTRIBUTE_VALUE, index=6 + _sN: MappingProxyType({"uri": "http://dynamodb.amazonaws.com/doc/2012-08-10/"}), + }, ) diff --git a/clients/aws-sdk-dynamodb/src/aws_sdk_dynamodb/client.py b/clients/aws-sdk-dynamodb/src/aws_sdk_dynamodb/client.py index 3e2bef0d..c3b9e54f 100644 --- a/clients/aws-sdk-dynamodb/src/aws_sdk_dynamodb/client.py +++ b/clients/aws-sdk-dynamodb/src/aws_sdk_dynamodb/client.py @@ -1,18 +1,20 @@ # Code generated by smithy-python-codegen DO NOT EDIT. +from __future__ import annotations + from copy import deepcopy import logging from typing import Any, cast +from smithy_aws_core.aio.identity.chain import AsyncIdentityChain from smithy_aws_core.config import ConfigSource from smithy_aws_core.identity import AWSCredentialsIdentity -from smithy_aws_core.identity.chain import IdentityChain -from smithy_core.aio.client import AsyncClient, ClientCall, RequestPipeline +from smithy_core.aio.client import AsyncClient, AsyncClientCall, AsyncRequestPipeline from smithy_core.deserializers import DeserializeableShape from smithy_core.exceptions import ExpectationNotMetError from smithy_core.schemas import APIOperation from smithy_core.serializers import SerializeableShape -from smithy_http.aio.interfaces import HTTPClient +from smithy_http.aio.interfaces import AsyncHTTPClient from smithy_http.plugins import user_agent_plugin from .config import AsyncDynamoDBConfig, Plugin @@ -20,21 +22,9 @@ BATCH_EXECUTE_STATEMENT, BATCH_GET_ITEM, BATCH_WRITE_ITEM, - BatchExecuteStatementInput, - BatchExecuteStatementOutput, - BatchGetItemInput, - BatchGetItemOutput, - BatchWriteItemInput, - BatchWriteItemOutput, CREATE_BACKUP, CREATE_GLOBAL_TABLE, CREATE_TABLE, - CreateBackupInput, - CreateBackupOutput, - CreateGlobalTableInput, - CreateGlobalTableOutput, - CreateTableInput, - CreateTableOutput, DELETE_BACKUP, DELETE_ITEM, DELETE_RESOURCE_POLICY, @@ -53,63 +43,13 @@ DESCRIBE_TABLE_REPLICA_AUTO_SCALING, DESCRIBE_TIME_TO_LIVE, DISABLE_KINESIS_STREAMING_DESTINATION, - DeleteBackupInput, - DeleteBackupOutput, - DeleteItemInput, - DeleteItemOutput, - DeleteResourcePolicyInput, - DeleteResourcePolicyOutput, - DeleteTableInput, - DeleteTableOutput, - DescribeBackupInput, - DescribeBackupOutput, - DescribeContinuousBackupsInput, - DescribeContinuousBackupsOutput, - DescribeContributorInsightsInput, - DescribeContributorInsightsOutput, - DescribeEndpointsInput, - DescribeEndpointsOutput, - DescribeExportInput, - DescribeExportOutput, - DescribeGlobalTableInput, - DescribeGlobalTableOutput, - DescribeGlobalTableSettingsInput, - DescribeGlobalTableSettingsOutput, - DescribeImportInput, - DescribeImportOutput, - DescribeKinesisStreamingDestinationInput, - DescribeKinesisStreamingDestinationOutput, - DescribeLimitsInput, - DescribeLimitsOutput, - DescribeTableInput, - DescribeTableOutput, - DescribeTableReplicaAutoScalingInput, - DescribeTableReplicaAutoScalingOutput, - DescribeTimeToLiveInput, - DescribeTimeToLiveOutput, - DisableKinesisStreamingDestinationInput, - DisableKinesisStreamingDestinationOutput, ENABLE_KINESIS_STREAMING_DESTINATION, EXECUTE_STATEMENT, EXECUTE_TRANSACTION, EXPORT_TABLE_TO_POINT_IN_TIME, - EnableKinesisStreamingDestinationInput, - EnableKinesisStreamingDestinationOutput, - ExecuteStatementInput, - ExecuteStatementOutput, - ExecuteTransactionInput, - ExecuteTransactionOutput, - ExportTableToPointInTimeInput, - ExportTableToPointInTimeOutput, GET_ITEM, GET_RESOURCE_POLICY, - GetItemInput, - GetItemOutput, - GetResourcePolicyInput, - GetResourcePolicyOutput, IMPORT_TABLE, - ImportTableInput, - ImportTableOutput, LIST_BACKUPS, LIST_CONTRIBUTOR_INSIGHTS, LIST_EXPORTS, @@ -117,50 +57,16 @@ LIST_IMPORTS, LIST_TABLES, LIST_TAGS_OF_RESOURCE, - ListBackupsInput, - ListBackupsOutput, - ListContributorInsightsInput, - ListContributorInsightsOutput, - ListExportsInput, - ListExportsOutput, - ListGlobalTablesInput, - ListGlobalTablesOutput, - ListImportsInput, - ListImportsOutput, - ListTablesInput, - ListTablesOutput, - ListTagsOfResourceInput, - ListTagsOfResourceOutput, PUT_ITEM, PUT_RESOURCE_POLICY, - PutItemInput, - PutItemOutput, - PutResourcePolicyInput, - PutResourcePolicyOutput, QUERY, - QueryInput, - QueryOutput, RESTORE_TABLE_FROM_BACKUP, RESTORE_TABLE_TO_POINT_IN_TIME, - RestoreTableFromBackupInput, - RestoreTableFromBackupOutput, - RestoreTableToPointInTimeInput, - RestoreTableToPointInTimeOutput, SCAN, SEARCH_VECTORS, - ScanInput, - ScanOutput, - SearchVectorsInput, - SearchVectorsOutput, TAG_RESOURCE, TRANSACT_GET_ITEMS, TRANSACT_WRITE_ITEMS, - TagResourceInput, - TagResourceOutput, - TransactGetItemsInput, - TransactGetItemsOutput, - TransactWriteItemsInput, - TransactWriteItemsOutput, UNTAG_RESOURCE, UPDATE_CONTINUOUS_BACKUPS, UPDATE_CONTRIBUTOR_INSIGHTS, @@ -171,30 +77,132 @@ UPDATE_TABLE, UPDATE_TABLE_REPLICA_AUTO_SCALING, UPDATE_TIME_TO_LIVE, - UntagResourceInput, - UntagResourceOutput, - UpdateContinuousBackupsInput, - UpdateContinuousBackupsOutput, - UpdateContributorInsightsInput, - UpdateContributorInsightsOutput, - UpdateGlobalTableInput, - UpdateGlobalTableOutput, - UpdateGlobalTableSettingsInput, - UpdateGlobalTableSettingsOutput, - UpdateItemInput, - UpdateItemOutput, - UpdateKinesisStreamingDestinationInput, - UpdateKinesisStreamingDestinationOutput, - UpdateTableInput, - UpdateTableOutput, - UpdateTableReplicaAutoScalingInput, - UpdateTableReplicaAutoScalingOutput, - UpdateTimeToLiveInput, - UpdateTimeToLiveOutput, ) from .retries import dynamodb_retry_plugin from .user_agent import aws_user_agent_plugin +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .models import ( + BatchExecuteStatementInput, + BatchExecuteStatementOutput, + BatchGetItemInput, + BatchGetItemOutput, + BatchWriteItemInput, + BatchWriteItemOutput, + CreateBackupInput, + CreateBackupOutput, + CreateGlobalTableInput, + CreateGlobalTableOutput, + CreateTableInput, + CreateTableOutput, + DeleteBackupInput, + DeleteBackupOutput, + DeleteItemInput, + DeleteItemOutput, + DeleteResourcePolicyInput, + DeleteResourcePolicyOutput, + DeleteTableInput, + DeleteTableOutput, + DescribeBackupInput, + DescribeBackupOutput, + DescribeContinuousBackupsInput, + DescribeContinuousBackupsOutput, + DescribeContributorInsightsInput, + DescribeContributorInsightsOutput, + DescribeEndpointsInput, + DescribeEndpointsOutput, + DescribeExportInput, + DescribeExportOutput, + DescribeGlobalTableInput, + DescribeGlobalTableOutput, + DescribeGlobalTableSettingsInput, + DescribeGlobalTableSettingsOutput, + DescribeImportInput, + DescribeImportOutput, + DescribeKinesisStreamingDestinationInput, + DescribeKinesisStreamingDestinationOutput, + DescribeLimitsInput, + DescribeLimitsOutput, + DescribeTableInput, + DescribeTableOutput, + DescribeTableReplicaAutoScalingInput, + DescribeTableReplicaAutoScalingOutput, + DescribeTimeToLiveInput, + DescribeTimeToLiveOutput, + DisableKinesisStreamingDestinationInput, + DisableKinesisStreamingDestinationOutput, + EnableKinesisStreamingDestinationInput, + EnableKinesisStreamingDestinationOutput, + ExecuteStatementInput, + ExecuteStatementOutput, + ExecuteTransactionInput, + ExecuteTransactionOutput, + ExportTableToPointInTimeInput, + ExportTableToPointInTimeOutput, + GetItemInput, + GetItemOutput, + GetResourcePolicyInput, + GetResourcePolicyOutput, + ImportTableInput, + ImportTableOutput, + ListBackupsInput, + ListBackupsOutput, + ListContributorInsightsInput, + ListContributorInsightsOutput, + ListExportsInput, + ListExportsOutput, + ListGlobalTablesInput, + ListGlobalTablesOutput, + ListImportsInput, + ListImportsOutput, + ListTablesInput, + ListTablesOutput, + ListTagsOfResourceInput, + ListTagsOfResourceOutput, + PutItemInput, + PutItemOutput, + PutResourcePolicyInput, + PutResourcePolicyOutput, + QueryInput, + QueryOutput, + RestoreTableFromBackupInput, + RestoreTableFromBackupOutput, + RestoreTableToPointInTimeInput, + RestoreTableToPointInTimeOutput, + ScanInput, + ScanOutput, + SearchVectorsInput, + SearchVectorsOutput, + TagResourceInput, + TagResourceOutput, + TransactGetItemsInput, + TransactGetItemsOutput, + TransactWriteItemsInput, + TransactWriteItemsOutput, + UntagResourceInput, + UntagResourceOutput, + UpdateContinuousBackupsInput, + UpdateContinuousBackupsOutput, + UpdateContributorInsightsInput, + UpdateContributorInsightsOutput, + UpdateGlobalTableInput, + UpdateGlobalTableOutput, + UpdateGlobalTableSettingsInput, + UpdateGlobalTableSettingsOutput, + UpdateItemInput, + UpdateItemOutput, + UpdateKinesisStreamingDestinationInput, + UpdateKinesisStreamingDestinationOutput, + UpdateTableInput, + UpdateTableOutput, + UpdateTableReplicaAutoScalingInput, + UpdateTableReplicaAutoScalingOutput, + UpdateTimeToLiveInput, + UpdateTimeToLiveOutput, + ) + logger = logging.getLogger(__name__) @@ -285,12 +293,12 @@ async def _post_setup(self, config: AsyncDynamoDBConfig) -> None: config_file = await config_context.parsed_profiles() if config_context.profile_source is ConfigSource.OVERRIDE: profile_name = config_context.profile_name - config.aws_credentials_identity_resolver = await IdentityChain.create( + config.aws_credentials_identity_resolver = await AsyncIdentityChain.create( AWSCredentialsIdentity, config_file=config_file, profile_name=profile_name, region_override=config.region, - http_client=cast(HTTPClient | None, config.transport), + http_client=cast(AsyncHTTPClient | None, config.transport), ) async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( @@ -299,7 +307,7 @@ async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( operation: APIOperation[I, O], default_plugins: list[Plugin], plugins: list[Plugin] | None, - ) -> tuple[RequestPipeline[Any, Any], ClientCall[I, O]]: + ) -> tuple[AsyncRequestPipeline[Any, Any], AsyncClientCall[I, O]]: if self._closed: raise RuntimeError( "Cannot invoke an operation on a client that has been closed." diff --git a/clients/aws-sdk-dynamodb/src/aws_sdk_dynamodb/config.py b/clients/aws-sdk-dynamodb/src/aws_sdk_dynamodb/config.py index 0c9ec54f..7300226e 100644 --- a/clients/aws-sdk-dynamodb/src/aws_sdk_dynamodb/config.py +++ b/clients/aws-sdk-dynamodb/src/aws_sdk_dynamodb/config.py @@ -1,267 +1,294 @@ # Code generated by smithy-python-codegen DO NOT EDIT. from dataclasses import dataclass, field -from typing import Any, Callable, ClassVar, Self, TypeAlias, Union, Unpack +from typing import ( + Any, + Callable, + ClassVar, + Self, + TYPE_CHECKING, + TypeAlias, + Union, + Unpack, +) -from smithy_aws_core.aio.protocols import AwsJson10ClientProtocol -from smithy_aws_core.auth import SigV4AuthScheme -from smithy_aws_core.config import AwsConfigOverrides, FileSystem -from smithy_aws_core.config.aws_config import AsyncAwsConfig -from smithy_aws_core.config.resolvers import EndpointUriResolver -from smithy_aws_core.config.types import FieldSpec -from smithy_aws_core.endpoints.standard_regional import ( - StandardRegionalEndpointsResolver, +from smithy_aws_core.aio.auth.sigv4 import AsyncSigV4AuthScheme +from smithy_aws_core.aio.config import AsyncFileSystem +from smithy_aws_core.aio.config.aws_config import AsyncAwsConfig, AwsConfigOverrides +from smithy_aws_core.aio.config.resolvers import EndpointUriResolver +from smithy_aws_core.aio.endpoints.standard_regional import ( + AsyncStandardRegionalEndpointsResolver, ) +from smithy_aws_core.aio.protocols import AsyncAwsJson10ClientProtocol +from smithy_aws_core.config.types import FieldSpec from smithy_aws_core.identity import AWSCredentialsIdentity, AWSIdentityProperties -from smithy_core.aio.interfaces import ( - ClientProtocol, - EndpointResolver, - ProtocolConstructor, - ProtocolSettings, -) -from smithy_core.aio.interfaces.auth import AuthScheme -from smithy_core.aio.interfaces.identity import IdentityResolver -from smithy_core.interceptors import Interceptor +from smithy_core.aio.interfaces import AsyncClientProtocol, AsyncEndpointResolver +from smithy_core.aio.interfaces.auth import AsyncAuthScheme +from smithy_core.aio.interfaces.identity import AsyncIdentityResolver +from smithy_core.interfaces import ProtocolConstructor, ProtocolSettings from smithy_core.interfaces.auth import AuthSchemeResolver from smithy_core.shapes import ShapeID from smithy_http.aio.aiohttp import AIOHTTPClient +from ._private.schemas import DYNAMO_DB_20120810 from .auth import HTTPAuthSchemeResolver -from .models import ( - BatchExecuteStatementInput, - BatchExecuteStatementOutput, - BatchGetItemInput, - BatchGetItemOutput, - BatchWriteItemInput, - BatchWriteItemOutput, - CreateBackupInput, - CreateBackupOutput, - CreateGlobalTableInput, - CreateGlobalTableOutput, - CreateTableInput, - CreateTableOutput, - DeleteBackupInput, - DeleteBackupOutput, - DeleteItemInput, - DeleteItemOutput, - DeleteResourcePolicyInput, - DeleteResourcePolicyOutput, - DeleteTableInput, - DeleteTableOutput, - DescribeBackupInput, - DescribeBackupOutput, - DescribeContinuousBackupsInput, - DescribeContinuousBackupsOutput, - DescribeContributorInsightsInput, - DescribeContributorInsightsOutput, - DescribeEndpointsInput, - DescribeEndpointsOutput, - DescribeExportInput, - DescribeExportOutput, - DescribeGlobalTableInput, - DescribeGlobalTableOutput, - DescribeGlobalTableSettingsInput, - DescribeGlobalTableSettingsOutput, - DescribeImportInput, - DescribeImportOutput, - DescribeKinesisStreamingDestinationInput, - DescribeKinesisStreamingDestinationOutput, - DescribeLimitsInput, - DescribeLimitsOutput, - DescribeTableInput, - DescribeTableOutput, - DescribeTableReplicaAutoScalingInput, - DescribeTableReplicaAutoScalingOutput, - DescribeTimeToLiveInput, - DescribeTimeToLiveOutput, - DisableKinesisStreamingDestinationInput, - DisableKinesisStreamingDestinationOutput, - EnableKinesisStreamingDestinationInput, - EnableKinesisStreamingDestinationOutput, - ExecuteStatementInput, - ExecuteStatementOutput, - ExecuteTransactionInput, - ExecuteTransactionOutput, - ExportTableToPointInTimeInput, - ExportTableToPointInTimeOutput, - GetItemInput, - GetItemOutput, - GetResourcePolicyInput, - GetResourcePolicyOutput, - ImportTableInput, - ImportTableOutput, - ListBackupsInput, - ListBackupsOutput, - ListContributorInsightsInput, - ListContributorInsightsOutput, - ListExportsInput, - ListExportsOutput, - ListGlobalTablesInput, - ListGlobalTablesOutput, - ListImportsInput, - ListImportsOutput, - ListTablesInput, - ListTablesOutput, - ListTagsOfResourceInput, - ListTagsOfResourceOutput, - PutItemInput, - PutItemOutput, - PutResourcePolicyInput, - PutResourcePolicyOutput, - QueryInput, - QueryOutput, - RestoreTableFromBackupInput, - RestoreTableFromBackupOutput, - RestoreTableToPointInTimeInput, - RestoreTableToPointInTimeOutput, - ScanInput, - ScanOutput, - SearchVectorsInput, - SearchVectorsOutput, - TagResourceInput, - TagResourceOutput, - TransactGetItemsInput, - TransactGetItemsOutput, - TransactWriteItemsInput, - TransactWriteItemsOutput, - UntagResourceInput, - UntagResourceOutput, - UpdateContinuousBackupsInput, - UpdateContinuousBackupsOutput, - UpdateContributorInsightsInput, - UpdateContributorInsightsOutput, - UpdateGlobalTableInput, - UpdateGlobalTableOutput, - UpdateGlobalTableSettingsInput, - UpdateGlobalTableSettingsOutput, - UpdateItemInput, - UpdateItemOutput, - UpdateKinesisStreamingDestinationInput, - UpdateKinesisStreamingDestinationOutput, - UpdateTableInput, - UpdateTableOutput, - UpdateTableReplicaAutoScalingInput, - UpdateTableReplicaAutoScalingOutput, - UpdateTimeToLiveInput, - UpdateTimeToLiveOutput, -) -_ServiceInterceptor = Union[ - Interceptor[BatchExecuteStatementInput, BatchExecuteStatementOutput, Any, Any], - Interceptor[BatchGetItemInput, BatchGetItemOutput, Any, Any], - Interceptor[BatchWriteItemInput, BatchWriteItemOutput, Any, Any], - Interceptor[CreateBackupInput, CreateBackupOutput, Any, Any], - Interceptor[CreateGlobalTableInput, CreateGlobalTableOutput, Any, Any], - Interceptor[CreateTableInput, CreateTableOutput, Any, Any], - Interceptor[DeleteBackupInput, DeleteBackupOutput, Any, Any], - Interceptor[DeleteItemInput, DeleteItemOutput, Any, Any], - Interceptor[DeleteResourcePolicyInput, DeleteResourcePolicyOutput, Any, Any], - Interceptor[DeleteTableInput, DeleteTableOutput, Any, Any], - Interceptor[DescribeBackupInput, DescribeBackupOutput, Any, Any], - Interceptor[ - DescribeContinuousBackupsInput, DescribeContinuousBackupsOutput, Any, Any - ], - Interceptor[ - DescribeContributorInsightsInput, DescribeContributorInsightsOutput, Any, Any - ], - Interceptor[DescribeEndpointsInput, DescribeEndpointsOutput, Any, Any], - Interceptor[DescribeExportInput, DescribeExportOutput, Any, Any], - Interceptor[DescribeGlobalTableInput, DescribeGlobalTableOutput, Any, Any], - Interceptor[ - DescribeGlobalTableSettingsInput, DescribeGlobalTableSettingsOutput, Any, Any - ], - Interceptor[DescribeImportInput, DescribeImportOutput, Any, Any], - Interceptor[ +if TYPE_CHECKING: + from smithy_core.interceptors import Interceptor + from .models import ( + BatchExecuteStatementInput, + BatchExecuteStatementOutput, + BatchGetItemInput, + BatchGetItemOutput, + BatchWriteItemInput, + BatchWriteItemOutput, + CreateBackupInput, + CreateBackupOutput, + CreateGlobalTableInput, + CreateGlobalTableOutput, + CreateTableInput, + CreateTableOutput, + DeleteBackupInput, + DeleteBackupOutput, + DeleteItemInput, + DeleteItemOutput, + DeleteResourcePolicyInput, + DeleteResourcePolicyOutput, + DeleteTableInput, + DeleteTableOutput, + DescribeBackupInput, + DescribeBackupOutput, + DescribeContinuousBackupsInput, + DescribeContinuousBackupsOutput, + DescribeContributorInsightsInput, + DescribeContributorInsightsOutput, + DescribeEndpointsInput, + DescribeEndpointsOutput, + DescribeExportInput, + DescribeExportOutput, + DescribeGlobalTableInput, + DescribeGlobalTableOutput, + DescribeGlobalTableSettingsInput, + DescribeGlobalTableSettingsOutput, + DescribeImportInput, + DescribeImportOutput, DescribeKinesisStreamingDestinationInput, DescribeKinesisStreamingDestinationOutput, - Any, - Any, - ], - Interceptor[DescribeLimitsInput, DescribeLimitsOutput, Any, Any], - Interceptor[DescribeTableInput, DescribeTableOutput, Any, Any], - Interceptor[ + DescribeLimitsInput, + DescribeLimitsOutput, + DescribeTableInput, + DescribeTableOutput, DescribeTableReplicaAutoScalingInput, DescribeTableReplicaAutoScalingOutput, - Any, - Any, - ], - Interceptor[DescribeTimeToLiveInput, DescribeTimeToLiveOutput, Any, Any], - Interceptor[ + DescribeTimeToLiveInput, + DescribeTimeToLiveOutput, DisableKinesisStreamingDestinationInput, DisableKinesisStreamingDestinationOutput, - Any, - Any, - ], - Interceptor[ EnableKinesisStreamingDestinationInput, EnableKinesisStreamingDestinationOutput, - Any, - Any, - ], - Interceptor[ExecuteStatementInput, ExecuteStatementOutput, Any, Any], - Interceptor[ExecuteTransactionInput, ExecuteTransactionOutput, Any, Any], - Interceptor[ - ExportTableToPointInTimeInput, ExportTableToPointInTimeOutput, Any, Any - ], - Interceptor[GetItemInput, GetItemOutput, Any, Any], - Interceptor[GetResourcePolicyInput, GetResourcePolicyOutput, Any, Any], - Interceptor[ImportTableInput, ImportTableOutput, Any, Any], - Interceptor[ListBackupsInput, ListBackupsOutput, Any, Any], - Interceptor[ListContributorInsightsInput, ListContributorInsightsOutput, Any, Any], - Interceptor[ListExportsInput, ListExportsOutput, Any, Any], - Interceptor[ListGlobalTablesInput, ListGlobalTablesOutput, Any, Any], - Interceptor[ListImportsInput, ListImportsOutput, Any, Any], - Interceptor[ListTablesInput, ListTablesOutput, Any, Any], - Interceptor[ListTagsOfResourceInput, ListTagsOfResourceOutput, Any, Any], - Interceptor[PutItemInput, PutItemOutput, Any, Any], - Interceptor[PutResourcePolicyInput, PutResourcePolicyOutput, Any, Any], - Interceptor[QueryInput, QueryOutput, Any, Any], - Interceptor[RestoreTableFromBackupInput, RestoreTableFromBackupOutput, Any, Any], - Interceptor[ - RestoreTableToPointInTimeInput, RestoreTableToPointInTimeOutput, Any, Any - ], - Interceptor[ScanInput, ScanOutput, Any, Any], - Interceptor[SearchVectorsInput, SearchVectorsOutput, Any, Any], - Interceptor[TagResourceInput, TagResourceOutput, Any, Any], - Interceptor[TransactGetItemsInput, TransactGetItemsOutput, Any, Any], - Interceptor[TransactWriteItemsInput, TransactWriteItemsOutput, Any, Any], - Interceptor[UntagResourceInput, UntagResourceOutput, Any, Any], - Interceptor[UpdateContinuousBackupsInput, UpdateContinuousBackupsOutput, Any, Any], - Interceptor[ - UpdateContributorInsightsInput, UpdateContributorInsightsOutput, Any, Any - ], - Interceptor[UpdateGlobalTableInput, UpdateGlobalTableOutput, Any, Any], - Interceptor[ - UpdateGlobalTableSettingsInput, UpdateGlobalTableSettingsOutput, Any, Any - ], - Interceptor[UpdateItemInput, UpdateItemOutput, Any, Any], - Interceptor[ + ExecuteStatementInput, + ExecuteStatementOutput, + ExecuteTransactionInput, + ExecuteTransactionOutput, + ExportTableToPointInTimeInput, + ExportTableToPointInTimeOutput, + GetItemInput, + GetItemOutput, + GetResourcePolicyInput, + GetResourcePolicyOutput, + ImportTableInput, + ImportTableOutput, + ListBackupsInput, + ListBackupsOutput, + ListContributorInsightsInput, + ListContributorInsightsOutput, + ListExportsInput, + ListExportsOutput, + ListGlobalTablesInput, + ListGlobalTablesOutput, + ListImportsInput, + ListImportsOutput, + ListTablesInput, + ListTablesOutput, + ListTagsOfResourceInput, + ListTagsOfResourceOutput, + PutItemInput, + PutItemOutput, + PutResourcePolicyInput, + PutResourcePolicyOutput, + QueryInput, + QueryOutput, + RestoreTableFromBackupInput, + RestoreTableFromBackupOutput, + RestoreTableToPointInTimeInput, + RestoreTableToPointInTimeOutput, + ScanInput, + ScanOutput, + SearchVectorsInput, + SearchVectorsOutput, + TagResourceInput, + TagResourceOutput, + TransactGetItemsInput, + TransactGetItemsOutput, + TransactWriteItemsInput, + TransactWriteItemsOutput, + UntagResourceInput, + UntagResourceOutput, + UpdateContinuousBackupsInput, + UpdateContinuousBackupsOutput, + UpdateContributorInsightsInput, + UpdateContributorInsightsOutput, + UpdateGlobalTableInput, + UpdateGlobalTableOutput, + UpdateGlobalTableSettingsInput, + UpdateGlobalTableSettingsOutput, + UpdateItemInput, + UpdateItemOutput, UpdateKinesisStreamingDestinationInput, UpdateKinesisStreamingDestinationOutput, - Any, - Any, - ], - Interceptor[UpdateTableInput, UpdateTableOutput, Any, Any], - Interceptor[ + UpdateTableInput, + UpdateTableOutput, UpdateTableReplicaAutoScalingInput, UpdateTableReplicaAutoScalingOutput, - Any, - Any, - ], - Interceptor[UpdateTimeToLiveInput, UpdateTimeToLiveOutput, Any, Any], -] + UpdateTimeToLiveInput, + UpdateTimeToLiveOutput, + ) + + _ServiceInterceptor = Union[ + Interceptor[BatchExecuteStatementInput, BatchExecuteStatementOutput, Any, Any], + Interceptor[BatchGetItemInput, BatchGetItemOutput, Any, Any], + Interceptor[BatchWriteItemInput, BatchWriteItemOutput, Any, Any], + Interceptor[CreateBackupInput, CreateBackupOutput, Any, Any], + Interceptor[CreateGlobalTableInput, CreateGlobalTableOutput, Any, Any], + Interceptor[CreateTableInput, CreateTableOutput, Any, Any], + Interceptor[DeleteBackupInput, DeleteBackupOutput, Any, Any], + Interceptor[DeleteItemInput, DeleteItemOutput, Any, Any], + Interceptor[DeleteResourcePolicyInput, DeleteResourcePolicyOutput, Any, Any], + Interceptor[DeleteTableInput, DeleteTableOutput, Any, Any], + Interceptor[DescribeBackupInput, DescribeBackupOutput, Any, Any], + Interceptor[ + DescribeContinuousBackupsInput, DescribeContinuousBackupsOutput, Any, Any + ], + Interceptor[ + DescribeContributorInsightsInput, + DescribeContributorInsightsOutput, + Any, + Any, + ], + Interceptor[DescribeEndpointsInput, DescribeEndpointsOutput, Any, Any], + Interceptor[DescribeExportInput, DescribeExportOutput, Any, Any], + Interceptor[DescribeGlobalTableInput, DescribeGlobalTableOutput, Any, Any], + Interceptor[ + DescribeGlobalTableSettingsInput, + DescribeGlobalTableSettingsOutput, + Any, + Any, + ], + Interceptor[DescribeImportInput, DescribeImportOutput, Any, Any], + Interceptor[ + DescribeKinesisStreamingDestinationInput, + DescribeKinesisStreamingDestinationOutput, + Any, + Any, + ], + Interceptor[DescribeLimitsInput, DescribeLimitsOutput, Any, Any], + Interceptor[DescribeTableInput, DescribeTableOutput, Any, Any], + Interceptor[ + DescribeTableReplicaAutoScalingInput, + DescribeTableReplicaAutoScalingOutput, + Any, + Any, + ], + Interceptor[DescribeTimeToLiveInput, DescribeTimeToLiveOutput, Any, Any], + Interceptor[ + DisableKinesisStreamingDestinationInput, + DisableKinesisStreamingDestinationOutput, + Any, + Any, + ], + Interceptor[ + EnableKinesisStreamingDestinationInput, + EnableKinesisStreamingDestinationOutput, + Any, + Any, + ], + Interceptor[ExecuteStatementInput, ExecuteStatementOutput, Any, Any], + Interceptor[ExecuteTransactionInput, ExecuteTransactionOutput, Any, Any], + Interceptor[ + ExportTableToPointInTimeInput, ExportTableToPointInTimeOutput, Any, Any + ], + Interceptor[GetItemInput, GetItemOutput, Any, Any], + Interceptor[GetResourcePolicyInput, GetResourcePolicyOutput, Any, Any], + Interceptor[ImportTableInput, ImportTableOutput, Any, Any], + Interceptor[ListBackupsInput, ListBackupsOutput, Any, Any], + Interceptor[ + ListContributorInsightsInput, ListContributorInsightsOutput, Any, Any + ], + Interceptor[ListExportsInput, ListExportsOutput, Any, Any], + Interceptor[ListGlobalTablesInput, ListGlobalTablesOutput, Any, Any], + Interceptor[ListImportsInput, ListImportsOutput, Any, Any], + Interceptor[ListTablesInput, ListTablesOutput, Any, Any], + Interceptor[ListTagsOfResourceInput, ListTagsOfResourceOutput, Any, Any], + Interceptor[PutItemInput, PutItemOutput, Any, Any], + Interceptor[PutResourcePolicyInput, PutResourcePolicyOutput, Any, Any], + Interceptor[QueryInput, QueryOutput, Any, Any], + Interceptor[ + RestoreTableFromBackupInput, RestoreTableFromBackupOutput, Any, Any + ], + Interceptor[ + RestoreTableToPointInTimeInput, RestoreTableToPointInTimeOutput, Any, Any + ], + Interceptor[ScanInput, ScanOutput, Any, Any], + Interceptor[SearchVectorsInput, SearchVectorsOutput, Any, Any], + Interceptor[TagResourceInput, TagResourceOutput, Any, Any], + Interceptor[TransactGetItemsInput, TransactGetItemsOutput, Any, Any], + Interceptor[TransactWriteItemsInput, TransactWriteItemsOutput, Any, Any], + Interceptor[UntagResourceInput, UntagResourceOutput, Any, Any], + Interceptor[ + UpdateContinuousBackupsInput, UpdateContinuousBackupsOutput, Any, Any + ], + Interceptor[ + UpdateContributorInsightsInput, UpdateContributorInsightsOutput, Any, Any + ], + Interceptor[UpdateGlobalTableInput, UpdateGlobalTableOutput, Any, Any], + Interceptor[ + UpdateGlobalTableSettingsInput, UpdateGlobalTableSettingsOutput, Any, Any + ], + Interceptor[UpdateItemInput, UpdateItemOutput, Any, Any], + Interceptor[ + UpdateKinesisStreamingDestinationInput, + UpdateKinesisStreamingDestinationOutput, + Any, + Any, + ], + Interceptor[UpdateTableInput, UpdateTableOutput, Any, Any], + Interceptor[ + UpdateTableReplicaAutoScalingInput, + UpdateTableReplicaAutoScalingOutput, + Any, + Any, + ], + Interceptor[UpdateTimeToLiveInput, UpdateTimeToLiveOutput, Any, Any], + ] +else: + _ServiceInterceptor = Any + _PROTOCOL_SETTINGS = ProtocolSettings( - namespace="com.amazonaws.dynamodb", service_target="DynamoDB_20120810" + namespace="com.amazonaws.dynamodb", + service_target="DynamoDB_20120810", + service_schema=DYNAMO_DB_20120810, ) class _AsyncDynamoDBConfigOverrides(AwsConfigOverrides, total=False): - endpoint_resolver: EndpointResolver | None + endpoint_resolver: AsyncEndpointResolver | None protocol: ( - ClientProtocol[Any, Any] | ProtocolConstructor[ClientProtocol[Any, Any]] | None + AsyncClientProtocol[Any, Any] + | ProtocolConstructor[AsyncClientProtocol[Any, Any]] + | None ) - auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None + auth_schemes: dict[ShapeID, AsyncAuthScheme[Any, Any, Any, Any]] | None auth_scheme_resolver: AuthSchemeResolver | None @@ -269,17 +296,17 @@ class _AsyncDynamoDBConfigOverrides(AwsConfigOverrides, total=False): class AsyncDynamoDBConfig(AsyncAwsConfig): """DynamoDB configuration (async-resolved).""" - endpoint_resolver: EndpointResolver | None = None + endpoint_resolver: AsyncEndpointResolver | None = None """ The endpoint resolver used to resolve the final endpoint per-operation based on the configuration. """ - protocol: ClientProtocol[Any, Any] | None = None + protocol: AsyncClientProtocol[Any, Any] | None = None """ Pass a protocol class reference from smithy_aws_core.aio.protocols to - select the protocol, e.g. protocol=AwsJson10ClientProtocol. For custom - protocols a protocol instance may also be passed. + select the protocol, e.g. protocol=AsyncAwsJson10ClientProtocol. For + custom protocols a protocol instance may also be passed. """ interceptors: list[_ServiceInterceptor] = field(default_factory=lambda: []) @@ -288,7 +315,7 @@ class AsyncDynamoDBConfig(AsyncAwsConfig): execution of a request. """ - auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None = None + auth_schemes: dict[ShapeID, AsyncAuthScheme[Any, Any, Any, Any]] | None = None """A map of auth scheme ids to auth schemes.""" auth_scheme_resolver: AuthSchemeResolver | None = None @@ -298,7 +325,7 @@ class AsyncDynamoDBConfig(AsyncAwsConfig): """ aws_credentials_identity_resolver: ( - IdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None + AsyncIdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None ) = None """Resolves AWS Credentials. Required for operations that use Sigv4 Auth.""" @@ -339,24 +366,24 @@ class AsyncDynamoDBConfig(AsyncAwsConfig): default=None, resolver=EndpointUriResolver("dynamodb") ), "endpoint_resolver": FieldSpec( - default_factory=lambda: StandardRegionalEndpointsResolver( + default_factory=lambda: AsyncStandardRegionalEndpointsResolver( endpoint_prefix="dynamodb" ) ), "protocol": FieldSpec( - default_factory=lambda: AwsJson10ClientProtocol(_PROTOCOL_SETTINGS), + default_factory=lambda: AsyncAwsJson10ClientProtocol(_PROTOCOL_SETTINGS), converter=lambda p: p(_PROTOCOL_SETTINGS) if isinstance(p, type) else p, ), "auth_schemes": FieldSpec( default_factory=lambda: { - ShapeID("aws.auth#sigv4"): SigV4AuthScheme(service="dynamodb") + ShapeID("aws.auth#sigv4"): AsyncSigV4AuthScheme(service="dynamodb") } ), "auth_scheme_resolver": FieldSpec(default_factory=HTTPAuthSchemeResolver), "transport": FieldSpec(default_factory=lambda: AIOHTTPClient()), } - def set_auth_scheme(self, scheme: AuthScheme[Any, Any, Any, Any]) -> None: + def set_auth_scheme(self, scheme: AsyncAuthScheme[Any, Any, Any, Any]) -> None: """ Set an auth scheme implementation using its scheme ID. :param scheme: The auth scheme to add or replace. @@ -370,7 +397,7 @@ async def resolve( # pyright: ignore[reportIncompatibleMethodOverride] cls, *, profile: str | None = None, - fs: FileSystem | None = None, + fs: AsyncFileSystem | None = None, config_file_path: str | None = None, credentials_file_path: str | None = None, **overrides: Unpack[_AsyncDynamoDBConfigOverrides], diff --git a/clients/aws-sdk-dynamodb/src/aws_sdk_dynamodb/models.py b/clients/aws-sdk-dynamodb/src/aws_sdk_dynamodb/models.py index f081c3eb..d3b5c3d4 100644 --- a/clients/aws-sdk-dynamodb/src/aws_sdk_dynamodb/models.py +++ b/clients/aws-sdk-dynamodb/src/aws_sdk_dynamodb/models.py @@ -1,32237 +1,1668 @@ # Code generated by smithy-python-codegen DO NOT EDIT. -from dataclasses import dataclass, field -from datetime import datetime, timezone -from enum import StrEnum -import logging -from typing import Any, Literal, Self, Union +from __future__ import annotations -from smithy_core.deserializers import ShapeDeserializer -from smithy_core.documents import TypeRegistry -from smithy_core.exceptions import ModeledError, SerializationError -from smithy_core.response import EMPTY_RESPONSE_METADATA, ResponseMetadata -from smithy_core.schemas import APIOperation, Schema -from smithy_core.serializers import ShapeSerializer +from ._private import schemas as _schemas +from smithy_core._dynamic_models import ModelRegistry +from smithy_core.exceptions import ModeledError +from smithy_core.schemas import APIOperation from smithy_core.shapes import ShapeID -from smithy_core.types import UnknownEnumMixin from ._private.schemas import ( - ARCHIVAL_SUMMARY as _SCHEMA_ARCHIVAL_SUMMARY, - ATTRIBUTE_DEFINITION as _SCHEMA_ATTRIBUTE_DEFINITION, - ATTRIBUTE_VALUE as _SCHEMA_ATTRIBUTE_VALUE, - ATTRIBUTE_VALUE_UPDATE as _SCHEMA_ATTRIBUTE_VALUE_UPDATE, - AUTO_SCALING_POLICY_DESCRIPTION as _SCHEMA_AUTO_SCALING_POLICY_DESCRIPTION, - AUTO_SCALING_POLICY_UPDATE as _SCHEMA_AUTO_SCALING_POLICY_UPDATE, - AUTO_SCALING_SETTINGS_DESCRIPTION as _SCHEMA_AUTO_SCALING_SETTINGS_DESCRIPTION, - AUTO_SCALING_SETTINGS_UPDATE as _SCHEMA_AUTO_SCALING_SETTINGS_UPDATE, - AUTO_SCALING_TARGET_TRACKING_SCALING_POLICY_CONFIGURATION_DESCRIPTION as _SCHEMA_AUTO_SCALING_TARGET_TRACKING_SCALING_POLICY_CONFIGURATION_DESCRIPTION, - AUTO_SCALING_TARGET_TRACKING_SCALING_POLICY_CONFIGURATION_UPDATE as _SCHEMA_AUTO_SCALING_TARGET_TRACKING_SCALING_POLICY_CONFIGURATION_UPDATE, - BACKUP_DESCRIPTION as _SCHEMA_BACKUP_DESCRIPTION, - BACKUP_DETAILS as _SCHEMA_BACKUP_DETAILS, - BACKUP_IN_USE_EXCEPTION as _SCHEMA_BACKUP_IN_USE_EXCEPTION, - BACKUP_NOT_FOUND_EXCEPTION as _SCHEMA_BACKUP_NOT_FOUND_EXCEPTION, - BACKUP_SUMMARY as _SCHEMA_BACKUP_SUMMARY, BATCH_EXECUTE_STATEMENT as _SCHEMA_BATCH_EXECUTE_STATEMENT, - BATCH_EXECUTE_STATEMENT_INPUT as _SCHEMA_BATCH_EXECUTE_STATEMENT_INPUT, - BATCH_EXECUTE_STATEMENT_OUTPUT as _SCHEMA_BATCH_EXECUTE_STATEMENT_OUTPUT, BATCH_GET_ITEM as _SCHEMA_BATCH_GET_ITEM, - BATCH_GET_ITEM_INPUT as _SCHEMA_BATCH_GET_ITEM_INPUT, - BATCH_GET_ITEM_OUTPUT as _SCHEMA_BATCH_GET_ITEM_OUTPUT, - BATCH_STATEMENT_ERROR as _SCHEMA_BATCH_STATEMENT_ERROR, - BATCH_STATEMENT_REQUEST as _SCHEMA_BATCH_STATEMENT_REQUEST, - BATCH_STATEMENT_RESPONSE as _SCHEMA_BATCH_STATEMENT_RESPONSE, BATCH_WRITE_ITEM as _SCHEMA_BATCH_WRITE_ITEM, - BATCH_WRITE_ITEM_INPUT as _SCHEMA_BATCH_WRITE_ITEM_INPUT, - BATCH_WRITE_ITEM_OUTPUT as _SCHEMA_BATCH_WRITE_ITEM_OUTPUT, - BILLING_MODE_SUMMARY as _SCHEMA_BILLING_MODE_SUMMARY, - CANCELLATION_REASON as _SCHEMA_CANCELLATION_REASON, - CAPACITY as _SCHEMA_CAPACITY, - CONDITION as _SCHEMA_CONDITION, - CONDITIONAL_CHECK_FAILED_EXCEPTION as _SCHEMA_CONDITIONAL_CHECK_FAILED_EXCEPTION, - CONDITION_CHECK as _SCHEMA_CONDITION_CHECK, - CONSUMED_CAPACITY as _SCHEMA_CONSUMED_CAPACITY, - CONTINUOUS_BACKUPS_DESCRIPTION as _SCHEMA_CONTINUOUS_BACKUPS_DESCRIPTION, - CONTINUOUS_BACKUPS_UNAVAILABLE_EXCEPTION as _SCHEMA_CONTINUOUS_BACKUPS_UNAVAILABLE_EXCEPTION, - CONTRIBUTOR_INSIGHTS_SUMMARY as _SCHEMA_CONTRIBUTOR_INSIGHTS_SUMMARY, CREATE_BACKUP as _SCHEMA_CREATE_BACKUP, - CREATE_BACKUP_INPUT as _SCHEMA_CREATE_BACKUP_INPUT, - CREATE_BACKUP_OUTPUT as _SCHEMA_CREATE_BACKUP_OUTPUT, - CREATE_GLOBAL_SECONDARY_INDEX_ACTION as _SCHEMA_CREATE_GLOBAL_SECONDARY_INDEX_ACTION, CREATE_GLOBAL_TABLE as _SCHEMA_CREATE_GLOBAL_TABLE, - CREATE_GLOBAL_TABLE_INPUT as _SCHEMA_CREATE_GLOBAL_TABLE_INPUT, - CREATE_GLOBAL_TABLE_OUTPUT as _SCHEMA_CREATE_GLOBAL_TABLE_OUTPUT, - CREATE_GLOBAL_TABLE_WITNESS_GROUP_MEMBER_ACTION as _SCHEMA_CREATE_GLOBAL_TABLE_WITNESS_GROUP_MEMBER_ACTION, - CREATE_REPLICATION_GROUP_MEMBER_ACTION as _SCHEMA_CREATE_REPLICATION_GROUP_MEMBER_ACTION, - CREATE_REPLICA_ACTION as _SCHEMA_CREATE_REPLICA_ACTION, CREATE_TABLE as _SCHEMA_CREATE_TABLE, - CREATE_TABLE_INPUT as _SCHEMA_CREATE_TABLE_INPUT, - CREATE_TABLE_OUTPUT as _SCHEMA_CREATE_TABLE_OUTPUT, - CREATE_VECTOR_INDEX_ACTION as _SCHEMA_CREATE_VECTOR_INDEX_ACTION, - CSV_OPTIONS as _SCHEMA_CSV_OPTIONS, - DELETE as _SCHEMA_DELETE, DELETE_BACKUP as _SCHEMA_DELETE_BACKUP, - DELETE_BACKUP_INPUT as _SCHEMA_DELETE_BACKUP_INPUT, - DELETE_BACKUP_OUTPUT as _SCHEMA_DELETE_BACKUP_OUTPUT, - DELETE_GLOBAL_SECONDARY_INDEX_ACTION as _SCHEMA_DELETE_GLOBAL_SECONDARY_INDEX_ACTION, - DELETE_GLOBAL_TABLE_WITNESS_GROUP_MEMBER_ACTION as _SCHEMA_DELETE_GLOBAL_TABLE_WITNESS_GROUP_MEMBER_ACTION, DELETE_ITEM as _SCHEMA_DELETE_ITEM, - DELETE_ITEM_INPUT as _SCHEMA_DELETE_ITEM_INPUT, - DELETE_ITEM_OUTPUT as _SCHEMA_DELETE_ITEM_OUTPUT, - DELETE_REPLICATION_GROUP_MEMBER_ACTION as _SCHEMA_DELETE_REPLICATION_GROUP_MEMBER_ACTION, - DELETE_REPLICA_ACTION as _SCHEMA_DELETE_REPLICA_ACTION, - DELETE_REQUEST as _SCHEMA_DELETE_REQUEST, DELETE_RESOURCE_POLICY as _SCHEMA_DELETE_RESOURCE_POLICY, - DELETE_RESOURCE_POLICY_INPUT as _SCHEMA_DELETE_RESOURCE_POLICY_INPUT, - DELETE_RESOURCE_POLICY_OUTPUT as _SCHEMA_DELETE_RESOURCE_POLICY_OUTPUT, DELETE_TABLE as _SCHEMA_DELETE_TABLE, - DELETE_TABLE_INPUT as _SCHEMA_DELETE_TABLE_INPUT, - DELETE_TABLE_OUTPUT as _SCHEMA_DELETE_TABLE_OUTPUT, - DELETE_VECTOR_INDEX_ACTION as _SCHEMA_DELETE_VECTOR_INDEX_ACTION, DESCRIBE_BACKUP as _SCHEMA_DESCRIBE_BACKUP, - DESCRIBE_BACKUP_INPUT as _SCHEMA_DESCRIBE_BACKUP_INPUT, - DESCRIBE_BACKUP_OUTPUT as _SCHEMA_DESCRIBE_BACKUP_OUTPUT, DESCRIBE_CONTINUOUS_BACKUPS as _SCHEMA_DESCRIBE_CONTINUOUS_BACKUPS, - DESCRIBE_CONTINUOUS_BACKUPS_INPUT as _SCHEMA_DESCRIBE_CONTINUOUS_BACKUPS_INPUT, - DESCRIBE_CONTINUOUS_BACKUPS_OUTPUT as _SCHEMA_DESCRIBE_CONTINUOUS_BACKUPS_OUTPUT, DESCRIBE_CONTRIBUTOR_INSIGHTS as _SCHEMA_DESCRIBE_CONTRIBUTOR_INSIGHTS, - DESCRIBE_CONTRIBUTOR_INSIGHTS_INPUT as _SCHEMA_DESCRIBE_CONTRIBUTOR_INSIGHTS_INPUT, - DESCRIBE_CONTRIBUTOR_INSIGHTS_OUTPUT as _SCHEMA_DESCRIBE_CONTRIBUTOR_INSIGHTS_OUTPUT, DESCRIBE_ENDPOINTS as _SCHEMA_DESCRIBE_ENDPOINTS, - DESCRIBE_ENDPOINTS_INPUT as _SCHEMA_DESCRIBE_ENDPOINTS_INPUT, - DESCRIBE_ENDPOINTS_OUTPUT as _SCHEMA_DESCRIBE_ENDPOINTS_OUTPUT, DESCRIBE_EXPORT as _SCHEMA_DESCRIBE_EXPORT, - DESCRIBE_EXPORT_INPUT as _SCHEMA_DESCRIBE_EXPORT_INPUT, - DESCRIBE_EXPORT_OUTPUT as _SCHEMA_DESCRIBE_EXPORT_OUTPUT, DESCRIBE_GLOBAL_TABLE as _SCHEMA_DESCRIBE_GLOBAL_TABLE, - DESCRIBE_GLOBAL_TABLE_INPUT as _SCHEMA_DESCRIBE_GLOBAL_TABLE_INPUT, - DESCRIBE_GLOBAL_TABLE_OUTPUT as _SCHEMA_DESCRIBE_GLOBAL_TABLE_OUTPUT, DESCRIBE_GLOBAL_TABLE_SETTINGS as _SCHEMA_DESCRIBE_GLOBAL_TABLE_SETTINGS, - DESCRIBE_GLOBAL_TABLE_SETTINGS_INPUT as _SCHEMA_DESCRIBE_GLOBAL_TABLE_SETTINGS_INPUT, - DESCRIBE_GLOBAL_TABLE_SETTINGS_OUTPUT as _SCHEMA_DESCRIBE_GLOBAL_TABLE_SETTINGS_OUTPUT, DESCRIBE_IMPORT as _SCHEMA_DESCRIBE_IMPORT, - DESCRIBE_IMPORT_INPUT as _SCHEMA_DESCRIBE_IMPORT_INPUT, - DESCRIBE_IMPORT_OUTPUT as _SCHEMA_DESCRIBE_IMPORT_OUTPUT, DESCRIBE_KINESIS_STREAMING_DESTINATION as _SCHEMA_DESCRIBE_KINESIS_STREAMING_DESTINATION, - DESCRIBE_KINESIS_STREAMING_DESTINATION_INPUT as _SCHEMA_DESCRIBE_KINESIS_STREAMING_DESTINATION_INPUT, - DESCRIBE_KINESIS_STREAMING_DESTINATION_OUTPUT as _SCHEMA_DESCRIBE_KINESIS_STREAMING_DESTINATION_OUTPUT, DESCRIBE_LIMITS as _SCHEMA_DESCRIBE_LIMITS, - DESCRIBE_LIMITS_INPUT as _SCHEMA_DESCRIBE_LIMITS_INPUT, - DESCRIBE_LIMITS_OUTPUT as _SCHEMA_DESCRIBE_LIMITS_OUTPUT, DESCRIBE_TABLE as _SCHEMA_DESCRIBE_TABLE, - DESCRIBE_TABLE_INPUT as _SCHEMA_DESCRIBE_TABLE_INPUT, - DESCRIBE_TABLE_OUTPUT as _SCHEMA_DESCRIBE_TABLE_OUTPUT, DESCRIBE_TABLE_REPLICA_AUTO_SCALING as _SCHEMA_DESCRIBE_TABLE_REPLICA_AUTO_SCALING, - DESCRIBE_TABLE_REPLICA_AUTO_SCALING_INPUT as _SCHEMA_DESCRIBE_TABLE_REPLICA_AUTO_SCALING_INPUT, - DESCRIBE_TABLE_REPLICA_AUTO_SCALING_OUTPUT as _SCHEMA_DESCRIBE_TABLE_REPLICA_AUTO_SCALING_OUTPUT, DESCRIBE_TIME_TO_LIVE as _SCHEMA_DESCRIBE_TIME_TO_LIVE, - DESCRIBE_TIME_TO_LIVE_INPUT as _SCHEMA_DESCRIBE_TIME_TO_LIVE_INPUT, - DESCRIBE_TIME_TO_LIVE_OUTPUT as _SCHEMA_DESCRIBE_TIME_TO_LIVE_OUTPUT, DISABLE_KINESIS_STREAMING_DESTINATION as _SCHEMA_DISABLE_KINESIS_STREAMING_DESTINATION, - DISABLE_KINESIS_STREAMING_DESTINATION_INPUT as _SCHEMA_DISABLE_KINESIS_STREAMING_DESTINATION_INPUT, - DISABLE_KINESIS_STREAMING_DESTINATION_OUTPUT as _SCHEMA_DISABLE_KINESIS_STREAMING_DESTINATION_OUTPUT, - DUPLICATE_ITEM_EXCEPTION as _SCHEMA_DUPLICATE_ITEM_EXCEPTION, - ENABLE_KINESIS_STREAMING_CONFIGURATION as _SCHEMA_ENABLE_KINESIS_STREAMING_CONFIGURATION, ENABLE_KINESIS_STREAMING_DESTINATION as _SCHEMA_ENABLE_KINESIS_STREAMING_DESTINATION, - ENABLE_KINESIS_STREAMING_DESTINATION_INPUT as _SCHEMA_ENABLE_KINESIS_STREAMING_DESTINATION_INPUT, - ENABLE_KINESIS_STREAMING_DESTINATION_OUTPUT as _SCHEMA_ENABLE_KINESIS_STREAMING_DESTINATION_OUTPUT, - ENDPOINT as _SCHEMA_ENDPOINT, EXECUTE_STATEMENT as _SCHEMA_EXECUTE_STATEMENT, - EXECUTE_STATEMENT_INPUT as _SCHEMA_EXECUTE_STATEMENT_INPUT, - EXECUTE_STATEMENT_OUTPUT as _SCHEMA_EXECUTE_STATEMENT_OUTPUT, EXECUTE_TRANSACTION as _SCHEMA_EXECUTE_TRANSACTION, - EXECUTE_TRANSACTION_INPUT as _SCHEMA_EXECUTE_TRANSACTION_INPUT, - EXECUTE_TRANSACTION_OUTPUT as _SCHEMA_EXECUTE_TRANSACTION_OUTPUT, - EXPECTED_ATTRIBUTE_VALUE as _SCHEMA_EXPECTED_ATTRIBUTE_VALUE, - EXPORT_CONFLICT_EXCEPTION as _SCHEMA_EXPORT_CONFLICT_EXCEPTION, - EXPORT_DESCRIPTION as _SCHEMA_EXPORT_DESCRIPTION, - EXPORT_NOT_FOUND_EXCEPTION as _SCHEMA_EXPORT_NOT_FOUND_EXCEPTION, - EXPORT_SUMMARY as _SCHEMA_EXPORT_SUMMARY, EXPORT_TABLE_TO_POINT_IN_TIME as _SCHEMA_EXPORT_TABLE_TO_POINT_IN_TIME, - EXPORT_TABLE_TO_POINT_IN_TIME_INPUT as _SCHEMA_EXPORT_TABLE_TO_POINT_IN_TIME_INPUT, - EXPORT_TABLE_TO_POINT_IN_TIME_OUTPUT as _SCHEMA_EXPORT_TABLE_TO_POINT_IN_TIME_OUTPUT, - FAILURE_EXCEPTION as _SCHEMA_FAILURE_EXCEPTION, - FILTER_SPECIFICATION as _SCHEMA_FILTER_SPECIFICATION, - GET as _SCHEMA_GET, GET_ITEM as _SCHEMA_GET_ITEM, - GET_ITEM_INPUT as _SCHEMA_GET_ITEM_INPUT, - GET_ITEM_OUTPUT as _SCHEMA_GET_ITEM_OUTPUT, GET_RESOURCE_POLICY as _SCHEMA_GET_RESOURCE_POLICY, - GET_RESOURCE_POLICY_INPUT as _SCHEMA_GET_RESOURCE_POLICY_INPUT, - GET_RESOURCE_POLICY_OUTPUT as _SCHEMA_GET_RESOURCE_POLICY_OUTPUT, - GLOBAL_SECONDARY_INDEX as _SCHEMA_GLOBAL_SECONDARY_INDEX, - GLOBAL_SECONDARY_INDEX_AUTO_SCALING_UPDATE as _SCHEMA_GLOBAL_SECONDARY_INDEX_AUTO_SCALING_UPDATE, - GLOBAL_SECONDARY_INDEX_DESCRIPTION as _SCHEMA_GLOBAL_SECONDARY_INDEX_DESCRIPTION, - GLOBAL_SECONDARY_INDEX_INFO as _SCHEMA_GLOBAL_SECONDARY_INDEX_INFO, - GLOBAL_SECONDARY_INDEX_UPDATE as _SCHEMA_GLOBAL_SECONDARY_INDEX_UPDATE, - GLOBAL_SECONDARY_INDEX_WARM_THROUGHPUT_DESCRIPTION as _SCHEMA_GLOBAL_SECONDARY_INDEX_WARM_THROUGHPUT_DESCRIPTION, - GLOBAL_TABLE as _SCHEMA_GLOBAL_TABLE, - GLOBAL_TABLE_ALREADY_EXISTS_EXCEPTION as _SCHEMA_GLOBAL_TABLE_ALREADY_EXISTS_EXCEPTION, - GLOBAL_TABLE_DESCRIPTION as _SCHEMA_GLOBAL_TABLE_DESCRIPTION, - GLOBAL_TABLE_GLOBAL_SECONDARY_INDEX_SETTINGS_UPDATE as _SCHEMA_GLOBAL_TABLE_GLOBAL_SECONDARY_INDEX_SETTINGS_UPDATE, - GLOBAL_TABLE_NOT_FOUND_EXCEPTION as _SCHEMA_GLOBAL_TABLE_NOT_FOUND_EXCEPTION, - GLOBAL_TABLE_WITNESS_DESCRIPTION as _SCHEMA_GLOBAL_TABLE_WITNESS_DESCRIPTION, - GLOBAL_TABLE_WITNESS_GROUP_UPDATE as _SCHEMA_GLOBAL_TABLE_WITNESS_GROUP_UPDATE, - IDEMPOTENT_PARAMETER_MISMATCH_EXCEPTION as _SCHEMA_IDEMPOTENT_PARAMETER_MISMATCH_EXCEPTION, - IMPORT_CONFLICT_EXCEPTION as _SCHEMA_IMPORT_CONFLICT_EXCEPTION, - IMPORT_NOT_FOUND_EXCEPTION as _SCHEMA_IMPORT_NOT_FOUND_EXCEPTION, - IMPORT_SUMMARY as _SCHEMA_IMPORT_SUMMARY, IMPORT_TABLE as _SCHEMA_IMPORT_TABLE, - IMPORT_TABLE_DESCRIPTION as _SCHEMA_IMPORT_TABLE_DESCRIPTION, - IMPORT_TABLE_INPUT as _SCHEMA_IMPORT_TABLE_INPUT, - IMPORT_TABLE_OUTPUT as _SCHEMA_IMPORT_TABLE_OUTPUT, - INCREMENTAL_EXPORT_SPECIFICATION as _SCHEMA_INCREMENTAL_EXPORT_SPECIFICATION, - INDEX_NOT_FOUND_EXCEPTION as _SCHEMA_INDEX_NOT_FOUND_EXCEPTION, - INPUT_FORMAT_OPTIONS as _SCHEMA_INPUT_FORMAT_OPTIONS, - INTERNAL_SERVER_ERROR as _SCHEMA_INTERNAL_SERVER_ERROR, - INVALID_ENDPOINT_EXCEPTION as _SCHEMA_INVALID_ENDPOINT_EXCEPTION, - INVALID_EXPORT_TIME_EXCEPTION as _SCHEMA_INVALID_EXPORT_TIME_EXCEPTION, - INVALID_RESTORE_TIME_EXCEPTION as _SCHEMA_INVALID_RESTORE_TIME_EXCEPTION, - ITEM_COLLECTION_METRICS as _SCHEMA_ITEM_COLLECTION_METRICS, - ITEM_COLLECTION_SIZE_LIMIT_EXCEEDED_EXCEPTION as _SCHEMA_ITEM_COLLECTION_SIZE_LIMIT_EXCEEDED_EXCEPTION, - ITEM_RESPONSE as _SCHEMA_ITEM_RESPONSE, - KEYS_AND_ATTRIBUTES as _SCHEMA_KEYS_AND_ATTRIBUTES, - KEY_SCHEMA_ELEMENT as _SCHEMA_KEY_SCHEMA_ELEMENT, - KINESIS_DATA_STREAM_DESTINATION as _SCHEMA_KINESIS_DATA_STREAM_DESTINATION, - LIMIT_EXCEEDED_EXCEPTION as _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, LIST_BACKUPS as _SCHEMA_LIST_BACKUPS, - LIST_BACKUPS_INPUT as _SCHEMA_LIST_BACKUPS_INPUT, - LIST_BACKUPS_OUTPUT as _SCHEMA_LIST_BACKUPS_OUTPUT, LIST_CONTRIBUTOR_INSIGHTS as _SCHEMA_LIST_CONTRIBUTOR_INSIGHTS, - LIST_CONTRIBUTOR_INSIGHTS_INPUT as _SCHEMA_LIST_CONTRIBUTOR_INSIGHTS_INPUT, - LIST_CONTRIBUTOR_INSIGHTS_OUTPUT as _SCHEMA_LIST_CONTRIBUTOR_INSIGHTS_OUTPUT, LIST_EXPORTS as _SCHEMA_LIST_EXPORTS, - LIST_EXPORTS_INPUT as _SCHEMA_LIST_EXPORTS_INPUT, - LIST_EXPORTS_OUTPUT as _SCHEMA_LIST_EXPORTS_OUTPUT, LIST_GLOBAL_TABLES as _SCHEMA_LIST_GLOBAL_TABLES, - LIST_GLOBAL_TABLES_INPUT as _SCHEMA_LIST_GLOBAL_TABLES_INPUT, - LIST_GLOBAL_TABLES_OUTPUT as _SCHEMA_LIST_GLOBAL_TABLES_OUTPUT, LIST_IMPORTS as _SCHEMA_LIST_IMPORTS, - LIST_IMPORTS_INPUT as _SCHEMA_LIST_IMPORTS_INPUT, - LIST_IMPORTS_OUTPUT as _SCHEMA_LIST_IMPORTS_OUTPUT, LIST_TABLES as _SCHEMA_LIST_TABLES, - LIST_TABLES_INPUT as _SCHEMA_LIST_TABLES_INPUT, - LIST_TABLES_OUTPUT as _SCHEMA_LIST_TABLES_OUTPUT, LIST_TAGS_OF_RESOURCE as _SCHEMA_LIST_TAGS_OF_RESOURCE, - LIST_TAGS_OF_RESOURCE_INPUT as _SCHEMA_LIST_TAGS_OF_RESOURCE_INPUT, - LIST_TAGS_OF_RESOURCE_OUTPUT as _SCHEMA_LIST_TAGS_OF_RESOURCE_OUTPUT, - LOCAL_SECONDARY_INDEX as _SCHEMA_LOCAL_SECONDARY_INDEX, - LOCAL_SECONDARY_INDEX_DESCRIPTION as _SCHEMA_LOCAL_SECONDARY_INDEX_DESCRIPTION, - LOCAL_SECONDARY_INDEX_INFO as _SCHEMA_LOCAL_SECONDARY_INDEX_INFO, - ON_DEMAND_THROUGHPUT as _SCHEMA_ON_DEMAND_THROUGHPUT, - ON_DEMAND_THROUGHPUT_OVERRIDE as _SCHEMA_ON_DEMAND_THROUGHPUT_OVERRIDE, - PARAMETERIZED_STATEMENT as _SCHEMA_PARAMETERIZED_STATEMENT, - POINT_IN_TIME_RECOVERY_DESCRIPTION as _SCHEMA_POINT_IN_TIME_RECOVERY_DESCRIPTION, - POINT_IN_TIME_RECOVERY_SPECIFICATION as _SCHEMA_POINT_IN_TIME_RECOVERY_SPECIFICATION, - POINT_IN_TIME_RECOVERY_UNAVAILABLE_EXCEPTION as _SCHEMA_POINT_IN_TIME_RECOVERY_UNAVAILABLE_EXCEPTION, - POLICY_NOT_FOUND_EXCEPTION as _SCHEMA_POLICY_NOT_FOUND_EXCEPTION, - PROJECTION as _SCHEMA_PROJECTION, - PROVISIONED_THROUGHPUT as _SCHEMA_PROVISIONED_THROUGHPUT, - PROVISIONED_THROUGHPUT_DESCRIPTION as _SCHEMA_PROVISIONED_THROUGHPUT_DESCRIPTION, - PROVISIONED_THROUGHPUT_EXCEEDED_EXCEPTION as _SCHEMA_PROVISIONED_THROUGHPUT_EXCEEDED_EXCEPTION, - PROVISIONED_THROUGHPUT_OVERRIDE as _SCHEMA_PROVISIONED_THROUGHPUT_OVERRIDE, - PUT as _SCHEMA_PUT, PUT_ITEM as _SCHEMA_PUT_ITEM, - PUT_ITEM_INPUT as _SCHEMA_PUT_ITEM_INPUT, - PUT_ITEM_OUTPUT as _SCHEMA_PUT_ITEM_OUTPUT, - PUT_REQUEST as _SCHEMA_PUT_REQUEST, PUT_RESOURCE_POLICY as _SCHEMA_PUT_RESOURCE_POLICY, - PUT_RESOURCE_POLICY_INPUT as _SCHEMA_PUT_RESOURCE_POLICY_INPUT, - PUT_RESOURCE_POLICY_OUTPUT as _SCHEMA_PUT_RESOURCE_POLICY_OUTPUT, QUERY as _SCHEMA_QUERY, - QUERY_INPUT as _SCHEMA_QUERY_INPUT, - QUERY_OUTPUT as _SCHEMA_QUERY_OUTPUT, - REPLICA as _SCHEMA_REPLICA, - REPLICATED_WRITE_CONFLICT_EXCEPTION as _SCHEMA_REPLICATED_WRITE_CONFLICT_EXCEPTION, - REPLICATION_GROUP_UPDATE as _SCHEMA_REPLICATION_GROUP_UPDATE, - REPLICA_ALREADY_EXISTS_EXCEPTION as _SCHEMA_REPLICA_ALREADY_EXISTS_EXCEPTION, - REPLICA_AUTO_SCALING_DESCRIPTION as _SCHEMA_REPLICA_AUTO_SCALING_DESCRIPTION, - REPLICA_AUTO_SCALING_UPDATE as _SCHEMA_REPLICA_AUTO_SCALING_UPDATE, - REPLICA_DESCRIPTION as _SCHEMA_REPLICA_DESCRIPTION, - REPLICA_GLOBAL_SECONDARY_INDEX as _SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX, - REPLICA_GLOBAL_SECONDARY_INDEX_AUTO_SCALING_DESCRIPTION as _SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX_AUTO_SCALING_DESCRIPTION, - REPLICA_GLOBAL_SECONDARY_INDEX_AUTO_SCALING_UPDATE as _SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX_AUTO_SCALING_UPDATE, - REPLICA_GLOBAL_SECONDARY_INDEX_DESCRIPTION as _SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX_DESCRIPTION, - REPLICA_GLOBAL_SECONDARY_INDEX_SETTINGS_DESCRIPTION as _SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX_SETTINGS_DESCRIPTION, - REPLICA_GLOBAL_SECONDARY_INDEX_SETTINGS_UPDATE as _SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX_SETTINGS_UPDATE, - REPLICA_NOT_FOUND_EXCEPTION as _SCHEMA_REPLICA_NOT_FOUND_EXCEPTION, - REPLICA_SETTINGS_DESCRIPTION as _SCHEMA_REPLICA_SETTINGS_DESCRIPTION, - REPLICA_SETTINGS_UPDATE as _SCHEMA_REPLICA_SETTINGS_UPDATE, - REPLICA_UPDATE as _SCHEMA_REPLICA_UPDATE, - REQUEST_LIMIT_EXCEEDED as _SCHEMA_REQUEST_LIMIT_EXCEEDED, - RESOURCE_IN_USE_EXCEPTION as _SCHEMA_RESOURCE_IN_USE_EXCEPTION, - RESOURCE_NOT_FOUND_EXCEPTION as _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - RESTORE_SUMMARY as _SCHEMA_RESTORE_SUMMARY, RESTORE_TABLE_FROM_BACKUP as _SCHEMA_RESTORE_TABLE_FROM_BACKUP, - RESTORE_TABLE_FROM_BACKUP_INPUT as _SCHEMA_RESTORE_TABLE_FROM_BACKUP_INPUT, - RESTORE_TABLE_FROM_BACKUP_OUTPUT as _SCHEMA_RESTORE_TABLE_FROM_BACKUP_OUTPUT, RESTORE_TABLE_TO_POINT_IN_TIME as _SCHEMA_RESTORE_TABLE_TO_POINT_IN_TIME, - RESTORE_TABLE_TO_POINT_IN_TIME_INPUT as _SCHEMA_RESTORE_TABLE_TO_POINT_IN_TIME_INPUT, - RESTORE_TABLE_TO_POINT_IN_TIME_OUTPUT as _SCHEMA_RESTORE_TABLE_TO_POINT_IN_TIME_OUTPUT, - S3_BUCKET_SOURCE as _SCHEMA_S3_BUCKET_SOURCE, SCAN as _SCHEMA_SCAN, - SCAN_INPUT as _SCHEMA_SCAN_INPUT, - SCAN_OUTPUT as _SCHEMA_SCAN_OUTPUT, - SEARCH_RESULT_ITEM as _SCHEMA_SEARCH_RESULT_ITEM, - SEARCH_SCHEMA_ELEMENT as _SCHEMA_SEARCH_SCHEMA_ELEMENT, SEARCH_VECTORS as _SCHEMA_SEARCH_VECTORS, - SEARCH_VECTORS_INPUT as _SCHEMA_SEARCH_VECTORS_INPUT, - SEARCH_VECTORS_OUTPUT as _SCHEMA_SEARCH_VECTORS_OUTPUT, - SOURCE_TABLE_DETAILS as _SCHEMA_SOURCE_TABLE_DETAILS, - SOURCE_TABLE_FEATURE_DETAILS as _SCHEMA_SOURCE_TABLE_FEATURE_DETAILS, - SSE_DESCRIPTION as _SCHEMA_SSE_DESCRIPTION, - SSE_SPECIFICATION as _SCHEMA_SSE_SPECIFICATION, - STREAM_SPECIFICATION as _SCHEMA_STREAM_SPECIFICATION, - TABLE_ALREADY_EXISTS_EXCEPTION as _SCHEMA_TABLE_ALREADY_EXISTS_EXCEPTION, - TABLE_AUTO_SCALING_DESCRIPTION as _SCHEMA_TABLE_AUTO_SCALING_DESCRIPTION, - TABLE_CLASS_SUMMARY as _SCHEMA_TABLE_CLASS_SUMMARY, - TABLE_CREATION_PARAMETERS as _SCHEMA_TABLE_CREATION_PARAMETERS, - TABLE_DESCRIPTION as _SCHEMA_TABLE_DESCRIPTION, - TABLE_IN_USE_EXCEPTION as _SCHEMA_TABLE_IN_USE_EXCEPTION, - TABLE_NOT_FOUND_EXCEPTION as _SCHEMA_TABLE_NOT_FOUND_EXCEPTION, - TABLE_WARM_THROUGHPUT_DESCRIPTION as _SCHEMA_TABLE_WARM_THROUGHPUT_DESCRIPTION, - TAG as _SCHEMA_TAG, TAG_RESOURCE as _SCHEMA_TAG_RESOURCE, - TAG_RESOURCE_INPUT as _SCHEMA_TAG_RESOURCE_INPUT, - TAG_RESOURCE_OUTPUT as _SCHEMA_TAG_RESOURCE_OUTPUT, - THROTTLING_EXCEPTION as _SCHEMA_THROTTLING_EXCEPTION, - THROTTLING_REASON as _SCHEMA_THROTTLING_REASON, - TIME_TO_LIVE_DESCRIPTION as _SCHEMA_TIME_TO_LIVE_DESCRIPTION, - TIME_TO_LIVE_SPECIFICATION as _SCHEMA_TIME_TO_LIVE_SPECIFICATION, - TRANSACTION_CANCELED_EXCEPTION as _SCHEMA_TRANSACTION_CANCELED_EXCEPTION, - TRANSACTION_CONFLICT_EXCEPTION as _SCHEMA_TRANSACTION_CONFLICT_EXCEPTION, - TRANSACTION_IN_PROGRESS_EXCEPTION as _SCHEMA_TRANSACTION_IN_PROGRESS_EXCEPTION, - TRANSACT_GET_ITEM as _SCHEMA_TRANSACT_GET_ITEM, TRANSACT_GET_ITEMS as _SCHEMA_TRANSACT_GET_ITEMS, - TRANSACT_GET_ITEMS_INPUT as _SCHEMA_TRANSACT_GET_ITEMS_INPUT, - TRANSACT_GET_ITEMS_OUTPUT as _SCHEMA_TRANSACT_GET_ITEMS_OUTPUT, - TRANSACT_WRITE_ITEM as _SCHEMA_TRANSACT_WRITE_ITEM, TRANSACT_WRITE_ITEMS as _SCHEMA_TRANSACT_WRITE_ITEMS, - TRANSACT_WRITE_ITEMS_INPUT as _SCHEMA_TRANSACT_WRITE_ITEMS_INPUT, - TRANSACT_WRITE_ITEMS_OUTPUT as _SCHEMA_TRANSACT_WRITE_ITEMS_OUTPUT, UNTAG_RESOURCE as _SCHEMA_UNTAG_RESOURCE, - UNTAG_RESOURCE_INPUT as _SCHEMA_UNTAG_RESOURCE_INPUT, - UNTAG_RESOURCE_OUTPUT as _SCHEMA_UNTAG_RESOURCE_OUTPUT, - UPDATE as _SCHEMA_UPDATE, UPDATE_CONTINUOUS_BACKUPS as _SCHEMA_UPDATE_CONTINUOUS_BACKUPS, - UPDATE_CONTINUOUS_BACKUPS_INPUT as _SCHEMA_UPDATE_CONTINUOUS_BACKUPS_INPUT, - UPDATE_CONTINUOUS_BACKUPS_OUTPUT as _SCHEMA_UPDATE_CONTINUOUS_BACKUPS_OUTPUT, UPDATE_CONTRIBUTOR_INSIGHTS as _SCHEMA_UPDATE_CONTRIBUTOR_INSIGHTS, - UPDATE_CONTRIBUTOR_INSIGHTS_INPUT as _SCHEMA_UPDATE_CONTRIBUTOR_INSIGHTS_INPUT, - UPDATE_CONTRIBUTOR_INSIGHTS_OUTPUT as _SCHEMA_UPDATE_CONTRIBUTOR_INSIGHTS_OUTPUT, - UPDATE_GLOBAL_SECONDARY_INDEX_ACTION as _SCHEMA_UPDATE_GLOBAL_SECONDARY_INDEX_ACTION, UPDATE_GLOBAL_TABLE as _SCHEMA_UPDATE_GLOBAL_TABLE, - UPDATE_GLOBAL_TABLE_INPUT as _SCHEMA_UPDATE_GLOBAL_TABLE_INPUT, - UPDATE_GLOBAL_TABLE_OUTPUT as _SCHEMA_UPDATE_GLOBAL_TABLE_OUTPUT, UPDATE_GLOBAL_TABLE_SETTINGS as _SCHEMA_UPDATE_GLOBAL_TABLE_SETTINGS, - UPDATE_GLOBAL_TABLE_SETTINGS_INPUT as _SCHEMA_UPDATE_GLOBAL_TABLE_SETTINGS_INPUT, - UPDATE_GLOBAL_TABLE_SETTINGS_OUTPUT as _SCHEMA_UPDATE_GLOBAL_TABLE_SETTINGS_OUTPUT, UPDATE_ITEM as _SCHEMA_UPDATE_ITEM, - UPDATE_ITEM_INPUT as _SCHEMA_UPDATE_ITEM_INPUT, - UPDATE_ITEM_OUTPUT as _SCHEMA_UPDATE_ITEM_OUTPUT, - UPDATE_KINESIS_STREAMING_CONFIGURATION as _SCHEMA_UPDATE_KINESIS_STREAMING_CONFIGURATION, UPDATE_KINESIS_STREAMING_DESTINATION as _SCHEMA_UPDATE_KINESIS_STREAMING_DESTINATION, - UPDATE_KINESIS_STREAMING_DESTINATION_INPUT as _SCHEMA_UPDATE_KINESIS_STREAMING_DESTINATION_INPUT, - UPDATE_KINESIS_STREAMING_DESTINATION_OUTPUT as _SCHEMA_UPDATE_KINESIS_STREAMING_DESTINATION_OUTPUT, - UPDATE_REPLICATION_GROUP_MEMBER_ACTION as _SCHEMA_UPDATE_REPLICATION_GROUP_MEMBER_ACTION, UPDATE_TABLE as _SCHEMA_UPDATE_TABLE, - UPDATE_TABLE_INPUT as _SCHEMA_UPDATE_TABLE_INPUT, - UPDATE_TABLE_OUTPUT as _SCHEMA_UPDATE_TABLE_OUTPUT, UPDATE_TABLE_REPLICA_AUTO_SCALING as _SCHEMA_UPDATE_TABLE_REPLICA_AUTO_SCALING, - UPDATE_TABLE_REPLICA_AUTO_SCALING_INPUT as _SCHEMA_UPDATE_TABLE_REPLICA_AUTO_SCALING_INPUT, - UPDATE_TABLE_REPLICA_AUTO_SCALING_OUTPUT as _SCHEMA_UPDATE_TABLE_REPLICA_AUTO_SCALING_OUTPUT, UPDATE_TIME_TO_LIVE as _SCHEMA_UPDATE_TIME_TO_LIVE, - UPDATE_TIME_TO_LIVE_INPUT as _SCHEMA_UPDATE_TIME_TO_LIVE_INPUT, - UPDATE_TIME_TO_LIVE_OUTPUT as _SCHEMA_UPDATE_TIME_TO_LIVE_OUTPUT, - VECTOR_ATTRIBUTE_DEFINITION as _SCHEMA_VECTOR_ATTRIBUTE_DEFINITION, - VECTOR_CAPACITY as _SCHEMA_VECTOR_CAPACITY, - VECTOR_INDEX as _SCHEMA_VECTOR_INDEX, - VECTOR_INDEX_DESCRIPTION as _SCHEMA_VECTOR_INDEX_DESCRIPTION, - VECTOR_INDEX_INFO as _SCHEMA_VECTOR_INDEX_INFO, - VECTOR_INDEX_UPDATE as _SCHEMA_VECTOR_INDEX_UPDATE, - WARM_THROUGHPUT as _SCHEMA_WARM_THROUGHPUT, - WRITE_REQUEST as _SCHEMA_WRITE_REQUEST, ) +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .models import ( + BatchExecuteStatementInput, + BatchExecuteStatementOutput, + BatchGetItemInput, + BatchGetItemOutput, + BatchWriteItemInput, + BatchWriteItemOutput, + CreateBackupInput, + CreateBackupOutput, + CreateGlobalTableInput, + CreateGlobalTableOutput, + CreateTableInput, + CreateTableOutput, + DeleteBackupInput, + DeleteBackupOutput, + DeleteItemInput, + DeleteItemOutput, + DeleteResourcePolicyInput, + DeleteResourcePolicyOutput, + DeleteTableInput, + DeleteTableOutput, + DescribeBackupInput, + DescribeBackupOutput, + DescribeContinuousBackupsInput, + DescribeContinuousBackupsOutput, + DescribeContributorInsightsInput, + DescribeContributorInsightsOutput, + DescribeEndpointsInput, + DescribeEndpointsOutput, + DescribeExportInput, + DescribeExportOutput, + DescribeGlobalTableInput, + DescribeGlobalTableOutput, + DescribeGlobalTableSettingsInput, + DescribeGlobalTableSettingsOutput, + DescribeImportInput, + DescribeImportOutput, + DescribeKinesisStreamingDestinationInput, + DescribeKinesisStreamingDestinationOutput, + DescribeLimitsInput, + DescribeLimitsOutput, + DescribeTableInput, + DescribeTableOutput, + DescribeTableReplicaAutoScalingInput, + DescribeTableReplicaAutoScalingOutput, + DescribeTimeToLiveInput, + DescribeTimeToLiveOutput, + DisableKinesisStreamingDestinationInput, + DisableKinesisStreamingDestinationOutput, + EnableKinesisStreamingDestinationInput, + EnableKinesisStreamingDestinationOutput, + ExecuteStatementInput, + ExecuteStatementOutput, + ExecuteTransactionInput, + ExecuteTransactionOutput, + ExportTableToPointInTimeInput, + ExportTableToPointInTimeOutput, + GetItemInput, + GetItemOutput, + GetResourcePolicyInput, + GetResourcePolicyOutput, + ImportTableInput, + ImportTableOutput, + ListBackupsInput, + ListBackupsOutput, + ListContributorInsightsInput, + ListContributorInsightsOutput, + ListExportsInput, + ListExportsOutput, + ListGlobalTablesInput, + ListGlobalTablesOutput, + ListImportsInput, + ListImportsOutput, + ListTablesInput, + ListTablesOutput, + ListTagsOfResourceInput, + ListTagsOfResourceOutput, + PutItemInput, + PutItemOutput, + PutResourcePolicyInput, + PutResourcePolicyOutput, + QueryInput, + QueryOutput, + RestoreTableFromBackupInput, + RestoreTableFromBackupOutput, + RestoreTableToPointInTimeInput, + RestoreTableToPointInTimeOutput, + ScanInput, + ScanOutput, + SearchVectorsInput, + SearchVectorsOutput, + TagResourceInput, + TagResourceOutput, + TransactGetItemsInput, + TransactGetItemsOutput, + TransactWriteItemsInput, + TransactWriteItemsOutput, + UntagResourceInput, + UntagResourceOutput, + UpdateContinuousBackupsInput, + UpdateContinuousBackupsOutput, + UpdateContributorInsightsInput, + UpdateContributorInsightsOutput, + UpdateGlobalTableInput, + UpdateGlobalTableOutput, + UpdateGlobalTableSettingsInput, + UpdateGlobalTableSettingsOutput, + UpdateItemInput, + UpdateItemOutput, + UpdateKinesisStreamingDestinationInput, + UpdateKinesisStreamingDestinationOutput, + UpdateTableInput, + UpdateTableOutput, + UpdateTableReplicaAutoScalingInput, + UpdateTableReplicaAutoScalingOutput, + UpdateTimeToLiveInput, + UpdateTimeToLiveOutput, + ) -logger = logging.getLogger(__name__) - - -class ServiceError(ModeledError): - """ - Base error for all errors in the service. - - Some exceptions do not extend from this class, including - synthetic, implicit, and shared exception types. - """ - - -class ApproximateCreationDateTimePrecision(UnknownEnumMixin, StrEnum): - MILLISECOND = "MILLISECOND" - MICROSECOND = "MICROSECOND" - - -@dataclass(kw_only=True) -class ArchivalSummary: - """Contains details of a table archival operation.""" - - archival_date_time: datetime | None = None - """ - The date and time when table archival was initiated by DynamoDB, in UNIX - epoch time format. - """ - - archival_reason: str | None = None - """ - The reason DynamoDB archived the table. Currently, the only possible - value is: - - - `INACCESSIBLE_ENCRYPTION_CREDENTIALS` - The table was archived due to - the table's KMS key being inaccessible for more than seven days. An - On-Demand backup was created at the archival time. - """ - - archival_backup_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the backup the table was archived to, - when applicable in the archival reason. If you wish to restore this - backup to the same table name, you will need to delete the original - table. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ARCHIVAL_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.archival_date_time is not None: - serializer.write_timestamp( - _SCHEMA_ARCHIVAL_SUMMARY.members["ArchivalDateTime"], - self.archival_date_time, - ) - - if self.archival_reason is not None: - serializer.write_string( - _SCHEMA_ARCHIVAL_SUMMARY.members["ArchivalReason"], self.archival_reason - ) - - if self.archival_backup_arn is not None: - serializer.write_string( - _SCHEMA_ARCHIVAL_SUMMARY.members["ArchivalBackupArn"], - self.archival_backup_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["archival_date_time"] = de.read_timestamp( - _SCHEMA_ARCHIVAL_SUMMARY.members["ArchivalDateTime"] - ) - - case 1: - kwargs["archival_reason"] = de.read_string( - _SCHEMA_ARCHIVAL_SUMMARY.members["ArchivalReason"] - ) - - case 2: - kwargs["archival_backup_arn"] = de.read_string( - _SCHEMA_ARCHIVAL_SUMMARY.members["ArchivalBackupArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ARCHIVAL_SUMMARY, consumer=_consumer) - return kwargs - - -class AttributeAction(UnknownEnumMixin, StrEnum): - ADD = "ADD" - PUT = "PUT" - DELETE = "DELETE" - - -class ScalarAttributeType(UnknownEnumMixin, StrEnum): - S = "S" - N = "N" - B = "B" - - -@dataclass(kw_only=True) -class AttributeDefinition: - """ - Represents an attribute for describing the schema for the table and - indexes. - """ - - attribute_name: str - """A name for the attribute.""" - - attribute_type: str - """ - The data type for the attribute, where: - - - `S` - the attribute is of type String - - - `N` - the attribute is of type Number - - - `B` - the attribute is of type Binary - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ATTRIBUTE_DEFINITION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_ATTRIBUTE_DEFINITION.members["AttributeName"], self.attribute_name - ) - serializer.write_string( - _SCHEMA_ATTRIBUTE_DEFINITION.members["AttributeType"], self.attribute_type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["attribute_name"] = de.read_string( - _SCHEMA_ATTRIBUTE_DEFINITION.members["AttributeName"] - ) - - case 1: - kwargs["attribute_type"] = ScalarAttributeType( - de.read_string( - _SCHEMA_ATTRIBUTE_DEFINITION.members["AttributeType"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ATTRIBUTE_DEFINITION, consumer=_consumer) - if "attribute_name" not in kwargs: - kwargs["attribute_name"] = "" - if "attribute_type" not in kwargs: - kwargs["attribute_type"] = ScalarAttributeType._corrected("") - return kwargs - - -def _serialize_attribute_definitions( - serializer: ShapeSerializer, schema: Schema, value: list[AttributeDefinition] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_attribute_definitions( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AttributeDefinition]: - result: list[AttributeDefinition] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AttributeDefinition.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_binary_set_attribute_value( - serializer: ShapeSerializer, schema: Schema, value: list[bytes] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_blob(member_schema, e) - - -def _deserialize_binary_set_attribute_value( - deserializer: ShapeDeserializer, schema: Schema -) -> list[bytes]: - result: list[bytes] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_blob(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_number_set_attribute_value( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_number_set_attribute_value( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_string_set_attribute_value( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_string_set_attribute_value( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_attribute_name_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_attribute_name_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AutoScalingTargetTrackingScalingPolicyConfigurationDescription: - """Represents the properties of a target tracking scaling policy.""" - - target_value: float - """ - The target value for the metric. The range is 8.515920e-109 to - 1.174271e+108 (Base 10) or 2e-360 to 2e360 (Base 2). - """ - - disable_scale_in: bool | None = None - """ - Indicates whether scale in by the target tracking policy is disabled. If - the value is true, scale in is disabled and the target tracking policy - won't remove capacity from the scalable resource. Otherwise, scale in - is enabled and the target tracking policy can remove capacity from the - scalable resource. The default value is false. - """ - - scale_in_cooldown: int | None = None - """ - The amount of time, in seconds, after a scale in activity completes - before another scale in activity can start. The cooldown period is used - to block subsequent scale in requests until it has expired. You should - scale in conservatively to protect your application's availability. - However, if another alarm triggers a scale out policy during the - cooldown period after a scale-in, application auto scaling scales out - your scalable target immediately. - """ - - scale_out_cooldown: int | None = None - """ - The amount of time, in seconds, after a scale out activity completes - before another scale out activity can start. While the cooldown period - is in effect, the capacity that has been added by the previous scale out - event that initiated the cooldown is calculated as part of the desired - capacity for the next scale out. You should continuously (but not - excessively) scale out. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTO_SCALING_TARGET_TRACKING_SCALING_POLICY_CONFIGURATION_DESCRIPTION, - self, - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.disable_scale_in is not None: - serializer.write_boolean( - _SCHEMA_AUTO_SCALING_TARGET_TRACKING_SCALING_POLICY_CONFIGURATION_DESCRIPTION.members[ - "DisableScaleIn" - ], - self.disable_scale_in, - ) - - if self.scale_in_cooldown is not None: - serializer.write_integer( - _SCHEMA_AUTO_SCALING_TARGET_TRACKING_SCALING_POLICY_CONFIGURATION_DESCRIPTION.members[ - "ScaleInCooldown" - ], - self.scale_in_cooldown, - ) - - if self.scale_out_cooldown is not None: - serializer.write_integer( - _SCHEMA_AUTO_SCALING_TARGET_TRACKING_SCALING_POLICY_CONFIGURATION_DESCRIPTION.members[ - "ScaleOutCooldown" - ], - self.scale_out_cooldown, - ) - - serializer.write_double( - _SCHEMA_AUTO_SCALING_TARGET_TRACKING_SCALING_POLICY_CONFIGURATION_DESCRIPTION.members[ - "TargetValue" - ], - self.target_value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["disable_scale_in"] = de.read_boolean( - _SCHEMA_AUTO_SCALING_TARGET_TRACKING_SCALING_POLICY_CONFIGURATION_DESCRIPTION.members[ - "DisableScaleIn" - ] - ) - - case 1: - kwargs["scale_in_cooldown"] = de.read_integer( - _SCHEMA_AUTO_SCALING_TARGET_TRACKING_SCALING_POLICY_CONFIGURATION_DESCRIPTION.members[ - "ScaleInCooldown" - ] - ) - - case 2: - kwargs["scale_out_cooldown"] = de.read_integer( - _SCHEMA_AUTO_SCALING_TARGET_TRACKING_SCALING_POLICY_CONFIGURATION_DESCRIPTION.members[ - "ScaleOutCooldown" - ] - ) - - case 3: - kwargs["target_value"] = de.read_double( - _SCHEMA_AUTO_SCALING_TARGET_TRACKING_SCALING_POLICY_CONFIGURATION_DESCRIPTION.members[ - "TargetValue" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTO_SCALING_TARGET_TRACKING_SCALING_POLICY_CONFIGURATION_DESCRIPTION, - consumer=_consumer, - ) - if "target_value" not in kwargs: - kwargs["target_value"] = 0.0 - return kwargs - - -@dataclass(kw_only=True) -class AutoScalingPolicyDescription: - """Represents the properties of the scaling policy.""" - - policy_name: str | None = None - """The name of the scaling policy.""" - - target_tracking_scaling_policy_configuration: ( - AutoScalingTargetTrackingScalingPolicyConfigurationDescription | None - ) = None - """Represents a target tracking scaling policy configuration.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTO_SCALING_POLICY_DESCRIPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.policy_name is not None: - serializer.write_string( - _SCHEMA_AUTO_SCALING_POLICY_DESCRIPTION.members["PolicyName"], - self.policy_name, - ) - - if self.target_tracking_scaling_policy_configuration is not None: - serializer.write_struct( - _SCHEMA_AUTO_SCALING_POLICY_DESCRIPTION.members[ - "TargetTrackingScalingPolicyConfiguration" - ], - self.target_tracking_scaling_policy_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_name"] = de.read_string( - _SCHEMA_AUTO_SCALING_POLICY_DESCRIPTION.members["PolicyName"] - ) - - case 1: - kwargs["target_tracking_scaling_policy_configuration"] = ( - AutoScalingTargetTrackingScalingPolicyConfigurationDescription.deserialize( - de - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTO_SCALING_POLICY_DESCRIPTION, consumer=_consumer - ) - return kwargs - - -def _serialize_auto_scaling_policy_description_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[AutoScalingPolicyDescription], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_auto_scaling_policy_description_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AutoScalingPolicyDescription]: - result: list[AutoScalingPolicyDescription] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AutoScalingPolicyDescription.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AutoScalingTargetTrackingScalingPolicyConfigurationUpdate: - """ - Represents the settings of a target tracking scaling policy that will be - modified. - """ - - target_value: float - """ - The target value for the metric. The range is 8.515920e-109 to - 1.174271e+108 (Base 10) or 2e-360 to 2e360 (Base 2). - """ - - disable_scale_in: bool | None = None - """ - Indicates whether scale in by the target tracking policy is disabled. If - the value is true, scale in is disabled and the target tracking policy - won't remove capacity from the scalable resource. Otherwise, scale in - is enabled and the target tracking policy can remove capacity from the - scalable resource. The default value is false. - """ - - scale_in_cooldown: int | None = None - """ - The amount of time, in seconds, after a scale in activity completes - before another scale in activity can start. The cooldown period is used - to block subsequent scale in requests until it has expired. You should - scale in conservatively to protect your application's availability. - However, if another alarm triggers a scale out policy during the - cooldown period after a scale-in, application auto scaling scales out - your scalable target immediately. - """ - - scale_out_cooldown: int | None = None - """ - The amount of time, in seconds, after a scale out activity completes - before another scale out activity can start. While the cooldown period - is in effect, the capacity that has been added by the previous scale out - event that initiated the cooldown is calculated as part of the desired - capacity for the next scale out. You should continuously (but not - excessively) scale out. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUTO_SCALING_TARGET_TRACKING_SCALING_POLICY_CONFIGURATION_UPDATE, - self, - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.disable_scale_in is not None: - serializer.write_boolean( - _SCHEMA_AUTO_SCALING_TARGET_TRACKING_SCALING_POLICY_CONFIGURATION_UPDATE.members[ - "DisableScaleIn" - ], - self.disable_scale_in, - ) - - if self.scale_in_cooldown is not None: - serializer.write_integer( - _SCHEMA_AUTO_SCALING_TARGET_TRACKING_SCALING_POLICY_CONFIGURATION_UPDATE.members[ - "ScaleInCooldown" - ], - self.scale_in_cooldown, - ) - - if self.scale_out_cooldown is not None: - serializer.write_integer( - _SCHEMA_AUTO_SCALING_TARGET_TRACKING_SCALING_POLICY_CONFIGURATION_UPDATE.members[ - "ScaleOutCooldown" - ], - self.scale_out_cooldown, - ) - - serializer.write_double( - _SCHEMA_AUTO_SCALING_TARGET_TRACKING_SCALING_POLICY_CONFIGURATION_UPDATE.members[ - "TargetValue" - ], - self.target_value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["disable_scale_in"] = de.read_boolean( - _SCHEMA_AUTO_SCALING_TARGET_TRACKING_SCALING_POLICY_CONFIGURATION_UPDATE.members[ - "DisableScaleIn" - ] - ) - - case 1: - kwargs["scale_in_cooldown"] = de.read_integer( - _SCHEMA_AUTO_SCALING_TARGET_TRACKING_SCALING_POLICY_CONFIGURATION_UPDATE.members[ - "ScaleInCooldown" - ] - ) - - case 2: - kwargs["scale_out_cooldown"] = de.read_integer( - _SCHEMA_AUTO_SCALING_TARGET_TRACKING_SCALING_POLICY_CONFIGURATION_UPDATE.members[ - "ScaleOutCooldown" - ] - ) - - case 3: - kwargs["target_value"] = de.read_double( - _SCHEMA_AUTO_SCALING_TARGET_TRACKING_SCALING_POLICY_CONFIGURATION_UPDATE.members[ - "TargetValue" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTO_SCALING_TARGET_TRACKING_SCALING_POLICY_CONFIGURATION_UPDATE, - consumer=_consumer, - ) - if "target_value" not in kwargs: - kwargs["target_value"] = 0.0 - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(target_value=0.0) - - -@dataclass(kw_only=True) -class AutoScalingPolicyUpdate: - """Represents the auto scaling policy to be modified.""" - - target_tracking_scaling_policy_configuration: ( - AutoScalingTargetTrackingScalingPolicyConfigurationUpdate - ) - """Represents a target tracking scaling policy configuration.""" - - policy_name: str | None = None - """The name of the scaling policy.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTO_SCALING_POLICY_UPDATE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.policy_name is not None: - serializer.write_string( - _SCHEMA_AUTO_SCALING_POLICY_UPDATE.members["PolicyName"], - self.policy_name, - ) - - serializer.write_struct( - _SCHEMA_AUTO_SCALING_POLICY_UPDATE.members[ - "TargetTrackingScalingPolicyConfiguration" - ], - self.target_tracking_scaling_policy_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_name"] = de.read_string( - _SCHEMA_AUTO_SCALING_POLICY_UPDATE.members["PolicyName"] - ) - - case 1: - kwargs["target_tracking_scaling_policy_configuration"] = ( - AutoScalingTargetTrackingScalingPolicyConfigurationUpdate.deserialize( - de - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AUTO_SCALING_POLICY_UPDATE, consumer=_consumer) - if "target_tracking_scaling_policy_configuration" not in kwargs: - kwargs["target_tracking_scaling_policy_configuration"] = ( - AutoScalingTargetTrackingScalingPolicyConfigurationUpdate._smithy_default() - ) - return kwargs - - -@dataclass(kw_only=True) -class AutoScalingSettingsDescription: - """ - Represents the auto scaling settings for a global table or global - secondary index. - """ - - minimum_units: int | None = None - """ - The minimum capacity units that a global table or global secondary index - should be scaled down to. - """ - - maximum_units: int | None = None - """ - The maximum capacity units that a global table or global secondary index - should be scaled up to. - """ - - auto_scaling_disabled: bool | None = None - """Disabled auto scaling for this global table or global secondary index.""" - - auto_scaling_role_arn: str | None = None - """Role ARN used for configuring the auto scaling policy.""" - - scaling_policies: list[AutoScalingPolicyDescription] | None = None - """Information about the scaling policies.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTO_SCALING_SETTINGS_DESCRIPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.minimum_units is not None: - serializer.write_long( - _SCHEMA_AUTO_SCALING_SETTINGS_DESCRIPTION.members["MinimumUnits"], - self.minimum_units, - ) - - if self.maximum_units is not None: - serializer.write_long( - _SCHEMA_AUTO_SCALING_SETTINGS_DESCRIPTION.members["MaximumUnits"], - self.maximum_units, - ) - - if self.auto_scaling_disabled is not None: - serializer.write_boolean( - _SCHEMA_AUTO_SCALING_SETTINGS_DESCRIPTION.members[ - "AutoScalingDisabled" - ], - self.auto_scaling_disabled, - ) - - if self.auto_scaling_role_arn is not None: - serializer.write_string( - _SCHEMA_AUTO_SCALING_SETTINGS_DESCRIPTION.members["AutoScalingRoleArn"], - self.auto_scaling_role_arn, - ) - - if self.scaling_policies is not None: - _serialize_auto_scaling_policy_description_list( - serializer, - _SCHEMA_AUTO_SCALING_SETTINGS_DESCRIPTION.members["ScalingPolicies"], - self.scaling_policies, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["minimum_units"] = de.read_long( - _SCHEMA_AUTO_SCALING_SETTINGS_DESCRIPTION.members[ - "MinimumUnits" - ] - ) - - case 1: - kwargs["maximum_units"] = de.read_long( - _SCHEMA_AUTO_SCALING_SETTINGS_DESCRIPTION.members[ - "MaximumUnits" - ] - ) - - case 2: - kwargs["auto_scaling_disabled"] = de.read_boolean( - _SCHEMA_AUTO_SCALING_SETTINGS_DESCRIPTION.members[ - "AutoScalingDisabled" - ] - ) - - case 3: - kwargs["auto_scaling_role_arn"] = de.read_string( - _SCHEMA_AUTO_SCALING_SETTINGS_DESCRIPTION.members[ - "AutoScalingRoleArn" - ] - ) - - case 4: - kwargs["scaling_policies"] = ( - _deserialize_auto_scaling_policy_description_list( - de, - _SCHEMA_AUTO_SCALING_SETTINGS_DESCRIPTION.members[ - "ScalingPolicies" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTO_SCALING_SETTINGS_DESCRIPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class AutoScalingSettingsUpdate: - """ - Represents the auto scaling settings to be modified for a global table - or global secondary index. - """ - - minimum_units: int | None = None - """ - The minimum capacity units that a global table or global secondary index - should be scaled down to. - """ - - maximum_units: int | None = None - """ - The maximum capacity units that a global table or global secondary index - should be scaled up to. - """ - - auto_scaling_disabled: bool | None = None - """Disabled auto scaling for this global table or global secondary index.""" - - auto_scaling_role_arn: str | None = None - """Role ARN used for configuring auto scaling policy.""" - - scaling_policy_update: AutoScalingPolicyUpdate | None = None - """ - The scaling policy to apply for scaling target global table or global - secondary index capacity units. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTO_SCALING_SETTINGS_UPDATE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.minimum_units is not None: - serializer.write_long( - _SCHEMA_AUTO_SCALING_SETTINGS_UPDATE.members["MinimumUnits"], - self.minimum_units, - ) - - if self.maximum_units is not None: - serializer.write_long( - _SCHEMA_AUTO_SCALING_SETTINGS_UPDATE.members["MaximumUnits"], - self.maximum_units, - ) - - if self.auto_scaling_disabled is not None: - serializer.write_boolean( - _SCHEMA_AUTO_SCALING_SETTINGS_UPDATE.members["AutoScalingDisabled"], - self.auto_scaling_disabled, - ) - - if self.auto_scaling_role_arn is not None: - serializer.write_string( - _SCHEMA_AUTO_SCALING_SETTINGS_UPDATE.members["AutoScalingRoleArn"], - self.auto_scaling_role_arn, - ) - - if self.scaling_policy_update is not None: - serializer.write_struct( - _SCHEMA_AUTO_SCALING_SETTINGS_UPDATE.members["ScalingPolicyUpdate"], - self.scaling_policy_update, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["minimum_units"] = de.read_long( - _SCHEMA_AUTO_SCALING_SETTINGS_UPDATE.members["MinimumUnits"] - ) - - case 1: - kwargs["maximum_units"] = de.read_long( - _SCHEMA_AUTO_SCALING_SETTINGS_UPDATE.members["MaximumUnits"] - ) - - case 2: - kwargs["auto_scaling_disabled"] = de.read_boolean( - _SCHEMA_AUTO_SCALING_SETTINGS_UPDATE.members[ - "AutoScalingDisabled" - ] - ) - - case 3: - kwargs["auto_scaling_role_arn"] = de.read_string( - _SCHEMA_AUTO_SCALING_SETTINGS_UPDATE.members[ - "AutoScalingRoleArn" - ] - ) - - case 4: - kwargs["scaling_policy_update"] = ( - AutoScalingPolicyUpdate.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTO_SCALING_SETTINGS_UPDATE, consumer=_consumer - ) - return kwargs - - -class BackupStatus(UnknownEnumMixin, StrEnum): - CREATING = "CREATING" - DELETED = "DELETED" - AVAILABLE = "AVAILABLE" - - -class BackupType(UnknownEnumMixin, StrEnum): - USER = "USER" - SYSTEM = "SYSTEM" - AWS_BACKUP = "AWS_BACKUP" - - -@dataclass(kw_only=True) -class BackupDetails: - """Contains the details of the backup created for the table.""" - - backup_arn: str - """ARN associated with the backup.""" - - backup_name: str - """Name of the requested backup.""" - - backup_status: str - """Backup can be in one of the following states: CREATING, ACTIVE, DELETED.""" - - backup_type: str - """ - BackupType: - - - `USER` - You create and manage these using the on-demand backup - feature. - - - `SYSTEM` - If you delete a table with point-in-time recovery enabled, - a `SYSTEM` backup is automatically created and is retained for 35 days - (at no additional cost). System backups allow you to restore the - deleted table to the state it was in just before the point of - deletion. - - - `AWS_BACKUP` - On-demand backup created by you from Backup service. - """ - - backup_creation_date_time: datetime - """ - Time at which the backup was created. This is the request time of the - backup. - """ - - backup_size_bytes: int | None = None - """ - Size of the backup in bytes. DynamoDB updates this value approximately - every six hours. Recent changes might not be reflected in this value. - """ - - backup_expiry_date_time: datetime | None = None - """ - Time at which the automatic on-demand backup created by DynamoDB will - expire. This `SYSTEM` on-demand backup expires automatically 35 days - after its creation. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BACKUP_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_BACKUP_DETAILS.members["BackupArn"], self.backup_arn - ) - serializer.write_string( - _SCHEMA_BACKUP_DETAILS.members["BackupName"], self.backup_name - ) - if self.backup_size_bytes is not None: - serializer.write_long( - _SCHEMA_BACKUP_DETAILS.members["BackupSizeBytes"], - self.backup_size_bytes, - ) - - serializer.write_string( - _SCHEMA_BACKUP_DETAILS.members["BackupStatus"], self.backup_status - ) - serializer.write_string( - _SCHEMA_BACKUP_DETAILS.members["BackupType"], self.backup_type - ) - serializer.write_timestamp( - _SCHEMA_BACKUP_DETAILS.members["BackupCreationDateTime"], - self.backup_creation_date_time, - ) - if self.backup_expiry_date_time is not None: - serializer.write_timestamp( - _SCHEMA_BACKUP_DETAILS.members["BackupExpiryDateTime"], - self.backup_expiry_date_time, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["backup_arn"] = de.read_string( - _SCHEMA_BACKUP_DETAILS.members["BackupArn"] - ) - - case 1: - kwargs["backup_name"] = de.read_string( - _SCHEMA_BACKUP_DETAILS.members["BackupName"] - ) - - case 2: - kwargs["backup_size_bytes"] = de.read_long( - _SCHEMA_BACKUP_DETAILS.members["BackupSizeBytes"] - ) - - case 3: - kwargs["backup_status"] = BackupStatus( - de.read_string(_SCHEMA_BACKUP_DETAILS.members["BackupStatus"]) - ) - - case 4: - kwargs["backup_type"] = BackupType( - de.read_string(_SCHEMA_BACKUP_DETAILS.members["BackupType"]) - ) - - case 5: - kwargs["backup_creation_date_time"] = de.read_timestamp( - _SCHEMA_BACKUP_DETAILS.members["BackupCreationDateTime"] - ) - - case 6: - kwargs["backup_expiry_date_time"] = de.read_timestamp( - _SCHEMA_BACKUP_DETAILS.members["BackupExpiryDateTime"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BACKUP_DETAILS, consumer=_consumer) - if "backup_arn" not in kwargs: - kwargs["backup_arn"] = "" - if "backup_name" not in kwargs: - kwargs["backup_name"] = "" - if "backup_status" not in kwargs: - kwargs["backup_status"] = BackupStatus._corrected("") - if "backup_type" not in kwargs: - kwargs["backup_type"] = BackupType._corrected("") - if "backup_creation_date_time" not in kwargs: - kwargs["backup_creation_date_time"] = datetime.fromtimestamp( - 0, tz=timezone.utc - ) - return kwargs - - -class BillingMode(UnknownEnumMixin, StrEnum): - PROVISIONED = "PROVISIONED" - PAY_PER_REQUEST = "PAY_PER_REQUEST" - - -class KeyType(UnknownEnumMixin, StrEnum): - HASH = "HASH" - RANGE = "RANGE" - - -@dataclass(kw_only=True) -class KeySchemaElement: - """ - Represents *a single element* of a key schema. A key schema specifies - the attributes that make up the primary key of a table, or the key - attributes of an index. - - A `KeySchemaElement` represents exactly one attribute of the primary - key. For example, a simple primary key would be represented by one - `KeySchemaElement` (for the partition key). A composite primary key - would require one `KeySchemaElement` for the partition key, and another - `KeySchemaElement` for the sort key. - - A `KeySchemaElement` must be a scalar, top-level attribute (not a nested - attribute). The data type must be one of String, Number, or Binary. The - attribute cannot be nested within a List or a Map. - """ - - attribute_name: str - """The name of a key attribute.""" - - key_type: str - """ - The role that this key attribute will assume: - - - `HASH` - partition key - - - `RANGE` - sort key - - Note: - The partition key of an item is also known as its *hash attribute*. The - term \"hash attribute\" derives from DynamoDB's usage of an internal - hash function to evenly distribute data items across partitions, based - on their partition key values. - - The sort key of an item is also known as its *range attribute*. The term - \"range attribute\" derives from the way DynamoDB stores items with the - same partition key physically close together, in sorted order by the - sort key value. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KEY_SCHEMA_ELEMENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_KEY_SCHEMA_ELEMENT.members["AttributeName"], self.attribute_name - ) - serializer.write_string( - _SCHEMA_KEY_SCHEMA_ELEMENT.members["KeyType"], self.key_type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["attribute_name"] = de.read_string( - _SCHEMA_KEY_SCHEMA_ELEMENT.members["AttributeName"] - ) - - case 1: - kwargs["key_type"] = KeyType( - de.read_string(_SCHEMA_KEY_SCHEMA_ELEMENT.members["KeyType"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_KEY_SCHEMA_ELEMENT, consumer=_consumer) - if "attribute_name" not in kwargs: - kwargs["attribute_name"] = "" - if "key_type" not in kwargs: - kwargs["key_type"] = KeyType._corrected("") - return kwargs - - -def _serialize_key_schema( - serializer: ShapeSerializer, schema: Schema, value: list[KeySchemaElement] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_key_schema( - deserializer: ShapeDeserializer, schema: Schema -) -> list[KeySchemaElement]: - result: list[KeySchemaElement] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(KeySchemaElement.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class OnDemandThroughput: - """ - Sets the maximum number of read and write units for the specified - on-demand table. If you use this parameter, you must specify - `MaxReadRequestUnits`, `MaxWriteRequestUnits`, or both. - """ - - max_read_request_units: int | None = None - """ - Maximum number of read request units for the specified table. - - To specify a maximum `OnDemandThroughput` on your table, set the value - of `MaxReadRequestUnits` as greater than or equal to 1. To remove the - maximum `OnDemandThroughput` that is currently set on your table, set - the value of `MaxReadRequestUnits` to -1. - """ - - max_write_request_units: int | None = None - """ - Maximum number of write request units for the specified table. - - To specify a maximum `OnDemandThroughput` on your table, set the value - of `MaxWriteRequestUnits` as greater than or equal to 1. To remove the - maximum `OnDemandThroughput` that is currently set on your table, set - the value of `MaxWriteRequestUnits` to -1. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ON_DEMAND_THROUGHPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.max_read_request_units is not None: - serializer.write_long( - _SCHEMA_ON_DEMAND_THROUGHPUT.members["MaxReadRequestUnits"], - self.max_read_request_units, - ) - - if self.max_write_request_units is not None: - serializer.write_long( - _SCHEMA_ON_DEMAND_THROUGHPUT.members["MaxWriteRequestUnits"], - self.max_write_request_units, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["max_read_request_units"] = de.read_long( - _SCHEMA_ON_DEMAND_THROUGHPUT.members["MaxReadRequestUnits"] - ) - - case 1: - kwargs["max_write_request_units"] = de.read_long( - _SCHEMA_ON_DEMAND_THROUGHPUT.members["MaxWriteRequestUnits"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ON_DEMAND_THROUGHPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ProvisionedThroughput: - """ - Represents the provisioned throughput settings for the specified global - secondary index. You must use `ProvisionedThroughput` or - `OnDemandThroughput` based on your table's capacity mode. - - For current minimum and maximum provisioned throughput values, see - [Service, Account, and Table - Quotas](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - read_capacity_units: int - """ - The maximum number of strongly consistent reads consumed per second - before DynamoDB returns a `ThrottlingException`. For more information, - see [Specifying Read and Write - Requirements](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughput.html) - in the *Amazon DynamoDB Developer Guide*. - - If read/write capacity mode is `PAY_PER_REQUEST` the value is set to 0. - """ - - write_capacity_units: int - """ - The maximum number of writes consumed per second before DynamoDB returns - a `ThrottlingException`. For more information, see [Specifying Read and - Write - Requirements](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughput.html) - in the *Amazon DynamoDB Developer Guide*. - - If read/write capacity mode is `PAY_PER_REQUEST` the value is set to 0. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PROVISIONED_THROUGHPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_long( - _SCHEMA_PROVISIONED_THROUGHPUT.members["ReadCapacityUnits"], - self.read_capacity_units, - ) - serializer.write_long( - _SCHEMA_PROVISIONED_THROUGHPUT.members["WriteCapacityUnits"], - self.write_capacity_units, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["read_capacity_units"] = de.read_long( - _SCHEMA_PROVISIONED_THROUGHPUT.members["ReadCapacityUnits"] - ) - - case 1: - kwargs["write_capacity_units"] = de.read_long( - _SCHEMA_PROVISIONED_THROUGHPUT.members["WriteCapacityUnits"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PROVISIONED_THROUGHPUT, consumer=_consumer) - if "read_capacity_units" not in kwargs: - kwargs["read_capacity_units"] = 0 - if "write_capacity_units" not in kwargs: - kwargs["write_capacity_units"] = 0 - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(read_capacity_units=0, write_capacity_units=0) - - -@dataclass(kw_only=True) -class SourceTableDetails: - """Contains the details of the table when the backup was created.""" - - table_name: str - """The name of the table for which the backup was created.""" - - table_id: str - """Unique identifier for the table for which the backup was created.""" - - key_schema: list[KeySchemaElement] - """Schema of the table.""" - - table_creation_date_time: datetime - """Time when the source table was created.""" - - provisioned_throughput: ProvisionedThroughput - """Read IOPs and Write IOPS on the table when the backup was created.""" - - table_arn: str | None = None - """ARN of the table for which backup was created.""" - - table_size_bytes: int | None = None - """Size of the table in bytes. Note that this is an approximate value.""" - - on_demand_throughput: OnDemandThroughput | None = None - """ - Sets the maximum number of read and write units for the specified - on-demand table. If you use this parameter, you must specify - `MaxReadRequestUnits`, `MaxWriteRequestUnits`, or both. - """ - - item_count: int | None = None - """Number of items in the table. Note that this is an approximate value.""" - - billing_mode: str | None = None - """ - Controls how you are charged for read and write throughput and how you - manage capacity. This setting can be changed later. - - - `PROVISIONED` - Sets the read/write capacity mode to `PROVISIONED`. We - recommend using `PROVISIONED` for predictable workloads. - - - `PAY_PER_REQUEST` - Sets the read/write capacity mode to - `PAY_PER_REQUEST`. We recommend using `PAY_PER_REQUEST` for - unpredictable workloads. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SOURCE_TABLE_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SOURCE_TABLE_DETAILS.members["TableName"], self.table_name - ) - serializer.write_string( - _SCHEMA_SOURCE_TABLE_DETAILS.members["TableId"], self.table_id - ) - if self.table_arn is not None: - serializer.write_string( - _SCHEMA_SOURCE_TABLE_DETAILS.members["TableArn"], self.table_arn - ) - - if self.table_size_bytes is not None: - serializer.write_long( - _SCHEMA_SOURCE_TABLE_DETAILS.members["TableSizeBytes"], - self.table_size_bytes, - ) - - _serialize_key_schema( - serializer, - _SCHEMA_SOURCE_TABLE_DETAILS.members["KeySchema"], - self.key_schema, - ) - serializer.write_timestamp( - _SCHEMA_SOURCE_TABLE_DETAILS.members["TableCreationDateTime"], - self.table_creation_date_time, - ) - serializer.write_struct( - _SCHEMA_SOURCE_TABLE_DETAILS.members["ProvisionedThroughput"], - self.provisioned_throughput, - ) - if self.on_demand_throughput is not None: - serializer.write_struct( - _SCHEMA_SOURCE_TABLE_DETAILS.members["OnDemandThroughput"], - self.on_demand_throughput, - ) - - if self.item_count is not None: - serializer.write_long( - _SCHEMA_SOURCE_TABLE_DETAILS.members["ItemCount"], self.item_count - ) - - if self.billing_mode is not None: - serializer.write_string( - _SCHEMA_SOURCE_TABLE_DETAILS.members["BillingMode"], self.billing_mode - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["table_name"] = de.read_string( - _SCHEMA_SOURCE_TABLE_DETAILS.members["TableName"] - ) - - case 1: - kwargs["table_id"] = de.read_string( - _SCHEMA_SOURCE_TABLE_DETAILS.members["TableId"] - ) - - case 2: - kwargs["table_arn"] = de.read_string( - _SCHEMA_SOURCE_TABLE_DETAILS.members["TableArn"] - ) - - case 3: - kwargs["table_size_bytes"] = de.read_long( - _SCHEMA_SOURCE_TABLE_DETAILS.members["TableSizeBytes"] - ) - - case 4: - kwargs["key_schema"] = _deserialize_key_schema( - de, _SCHEMA_SOURCE_TABLE_DETAILS.members["KeySchema"] - ) - - case 5: - kwargs["table_creation_date_time"] = de.read_timestamp( - _SCHEMA_SOURCE_TABLE_DETAILS.members["TableCreationDateTime"] - ) - - case 6: - kwargs["provisioned_throughput"] = ( - ProvisionedThroughput.deserialize(de) - ) - - case 7: - kwargs["on_demand_throughput"] = OnDemandThroughput.deserialize(de) - - case 8: - kwargs["item_count"] = de.read_long( - _SCHEMA_SOURCE_TABLE_DETAILS.members["ItemCount"] - ) - - case 9: - kwargs["billing_mode"] = BillingMode( - de.read_string( - _SCHEMA_SOURCE_TABLE_DETAILS.members["BillingMode"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SOURCE_TABLE_DETAILS, consumer=_consumer) - if "table_name" not in kwargs: - kwargs["table_name"] = "" - if "table_id" not in kwargs: - kwargs["table_id"] = "" - if "key_schema" not in kwargs: - kwargs["key_schema"] = [] - if "table_creation_date_time" not in kwargs: - kwargs["table_creation_date_time"] = datetime.fromtimestamp( - 0, tz=timezone.utc - ) - if "provisioned_throughput" not in kwargs: - kwargs["provisioned_throughput"] = ProvisionedThroughput._smithy_default() - return kwargs - - -def _serialize_non_key_attribute_name_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_non_key_attribute_name_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -class ProjectionType(UnknownEnumMixin, StrEnum): - ALL = "ALL" - KEYS_ONLY = "KEYS_ONLY" - INCLUDE = "INCLUDE" - - -@dataclass(kw_only=True) -class Projection: - """ - Represents attributes that are copied (projected) from the table into an - index. These are in addition to the primary key attributes and index key - attributes, which are automatically projected. - """ - - projection_type: str | None = None - """ - The set of attributes that are projected into the index: - - - `KEYS_ONLY` - Only the index and primary keys are projected into the - index. - - - `INCLUDE` - In addition to the attributes described in `KEYS_ONLY`, - the secondary index will include other non-key attributes that you - specify. - - - `ALL` - All of the table attributes are projected into the index. - - When using the DynamoDB console, `ALL` is selected by default. - """ - - non_key_attributes: list[str] | None = None - """ - Represents the non-key attribute names which will be projected into the - index. - - For global and local secondary indexes, the total count of - `NonKeyAttributes` summed across all of the secondary indexes, must not - exceed 100. If you project the same attribute into two different - indexes, this counts as two distinct attributes when determining the - total. This limit only applies when you specify the ProjectionType of - `INCLUDE`. You still can specify the ProjectionType of `ALL` to project - all attributes from the source table, even if the table has more than - 100 attributes. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PROJECTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.projection_type is not None: - serializer.write_string( - _SCHEMA_PROJECTION.members["ProjectionType"], self.projection_type - ) - - if self.non_key_attributes is not None: - _serialize_non_key_attribute_name_list( - serializer, - _SCHEMA_PROJECTION.members["NonKeyAttributes"], - self.non_key_attributes, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["projection_type"] = ProjectionType( - de.read_string(_SCHEMA_PROJECTION.members["ProjectionType"]) - ) - - case 1: - kwargs["non_key_attributes"] = ( - _deserialize_non_key_attribute_name_list( - de, _SCHEMA_PROJECTION.members["NonKeyAttributes"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PROJECTION, consumer=_consumer) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls() - - -@dataclass(kw_only=True) -class GlobalSecondaryIndexInfo: - """ - Represents the properties of a global secondary index for the table when - the backup was created. - """ - - index_name: str | None = None - """The name of the global secondary index.""" - - key_schema: list[KeySchemaElement] | None = None - """ - The complete key schema for a global secondary index, which consists of - one or more pairs of attribute names and key types: - - - `HASH` - partition key - - - `RANGE` - sort key - - Note: - The partition key of an item is also known as its *hash attribute*. The - term \"hash attribute\" derives from DynamoDB's usage of an internal - hash function to evenly distribute data items across partitions, based - on their partition key values. - - The sort key of an item is also known as its *range attribute*. The term - \"range attribute\" derives from the way DynamoDB stores items with the - same partition key physically close together, in sorted order by the - sort key value. - """ - - projection: Projection | None = None - """ - Represents attributes that are copied (projected) from the table into - the global secondary index. These are in addition to the primary key - attributes and index key attributes, which are automatically projected. - """ - - provisioned_throughput: ProvisionedThroughput | None = None - """ - Represents the provisioned throughput settings for the specified global - secondary index. - """ - - on_demand_throughput: OnDemandThroughput | None = None - """ - Sets the maximum number of read and write units for the specified - on-demand table. If you use this parameter, you must specify - `MaxReadRequestUnits`, `MaxWriteRequestUnits`, or both. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GLOBAL_SECONDARY_INDEX_INFO, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.index_name is not None: - serializer.write_string( - _SCHEMA_GLOBAL_SECONDARY_INDEX_INFO.members["IndexName"], - self.index_name, - ) - - if self.key_schema is not None: - _serialize_key_schema( - serializer, - _SCHEMA_GLOBAL_SECONDARY_INDEX_INFO.members["KeySchema"], - self.key_schema, - ) - - if self.projection is not None: - serializer.write_struct( - _SCHEMA_GLOBAL_SECONDARY_INDEX_INFO.members["Projection"], - self.projection, - ) - - if self.provisioned_throughput is not None: - serializer.write_struct( - _SCHEMA_GLOBAL_SECONDARY_INDEX_INFO.members["ProvisionedThroughput"], - self.provisioned_throughput, - ) - - if self.on_demand_throughput is not None: - serializer.write_struct( - _SCHEMA_GLOBAL_SECONDARY_INDEX_INFO.members["OnDemandThroughput"], - self.on_demand_throughput, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["index_name"] = de.read_string( - _SCHEMA_GLOBAL_SECONDARY_INDEX_INFO.members["IndexName"] - ) - - case 1: - kwargs["key_schema"] = _deserialize_key_schema( - de, _SCHEMA_GLOBAL_SECONDARY_INDEX_INFO.members["KeySchema"] - ) - - case 2: - kwargs["projection"] = Projection.deserialize(de) - - case 3: - kwargs["provisioned_throughput"] = ( - ProvisionedThroughput.deserialize(de) - ) - - case 4: - kwargs["on_demand_throughput"] = OnDemandThroughput.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GLOBAL_SECONDARY_INDEX_INFO, consumer=_consumer - ) - return kwargs - - -def _serialize_global_secondary_indexes( - serializer: ShapeSerializer, schema: Schema, value: list[GlobalSecondaryIndexInfo] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_global_secondary_indexes( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GlobalSecondaryIndexInfo]: - result: list[GlobalSecondaryIndexInfo] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GlobalSecondaryIndexInfo.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class LocalSecondaryIndexInfo: - """ - Represents the properties of a local secondary index for the table when - the backup was created. - """ - - index_name: str | None = None - """Represents the name of the local secondary index.""" - - key_schema: list[KeySchemaElement] | None = None - """ - The complete key schema for a local secondary index, which consists of - one or more pairs of attribute names and key types: - - - `HASH` - partition key - - - `RANGE` - sort key - - Note: - The partition key of an item is also known as its *hash attribute*. The - term \"hash attribute\" derives from DynamoDB's usage of an internal - hash function to evenly distribute data items across partitions, based - on their partition key values. - - The sort key of an item is also known as its *range attribute*. The term - \"range attribute\" derives from the way DynamoDB stores items with the - same partition key physically close together, in sorted order by the - sort key value. - """ - - projection: Projection | None = None - """ - Represents attributes that are copied (projected) from the table into - the global secondary index. These are in addition to the primary key - attributes and index key attributes, which are automatically projected. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LOCAL_SECONDARY_INDEX_INFO, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.index_name is not None: - serializer.write_string( - _SCHEMA_LOCAL_SECONDARY_INDEX_INFO.members["IndexName"], self.index_name - ) - - if self.key_schema is not None: - _serialize_key_schema( - serializer, - _SCHEMA_LOCAL_SECONDARY_INDEX_INFO.members["KeySchema"], - self.key_schema, - ) - - if self.projection is not None: - serializer.write_struct( - _SCHEMA_LOCAL_SECONDARY_INDEX_INFO.members["Projection"], - self.projection, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["index_name"] = de.read_string( - _SCHEMA_LOCAL_SECONDARY_INDEX_INFO.members["IndexName"] - ) - - case 1: - kwargs["key_schema"] = _deserialize_key_schema( - de, _SCHEMA_LOCAL_SECONDARY_INDEX_INFO.members["KeySchema"] - ) - - case 2: - kwargs["projection"] = Projection.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LOCAL_SECONDARY_INDEX_INFO, consumer=_consumer) - return kwargs - - -def _serialize_local_secondary_indexes( - serializer: ShapeSerializer, schema: Schema, value: list[LocalSecondaryIndexInfo] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_local_secondary_indexes( - deserializer: ShapeDeserializer, schema: Schema -) -> list[LocalSecondaryIndexInfo]: - result: list[LocalSecondaryIndexInfo] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(LocalSecondaryIndexInfo.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class SSEType(UnknownEnumMixin, StrEnum): - AES256 = "AES256" - KMS = "KMS" - - -class SSEStatus(UnknownEnumMixin, StrEnum): - ENABLING = "ENABLING" - ENABLED = "ENABLED" - DISABLING = "DISABLING" - DISABLED = "DISABLED" - UPDATING = "UPDATING" - - -@dataclass(kw_only=True) -class SSEDescription: - """ - The description of the server-side encryption status on the specified - table. - """ - - status: str | None = None - """ - Represents the current state of server-side encryption. The only - supported values are: - - - `ENABLED` - Server-side encryption is enabled. - - - `UPDATING` - Server-side encryption is being updated. - """ - - sse_type: str | None = None - """ - Server-side encryption type. The only supported value is: - - - `KMS` - Server-side encryption that uses Key Management Service. The - key is stored in your account and is managed by KMS (KMS charges - apply). - """ - - kms_master_key_arn: str | None = None - """The KMS key ARN used for the KMS encryption.""" - - inaccessible_encryption_date_time: datetime | None = None - """ - Indicates the time, in UNIX epoch date format, when DynamoDB detected - that the table's KMS key was inaccessible. This attribute will - automatically be cleared when DynamoDB detects that the table's KMS key - is accessible again. DynamoDB will initiate the table archival process - when table's KMS key remains inaccessible for more than seven days from - this date. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SSE_DESCRIPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.status is not None: - serializer.write_string( - _SCHEMA_SSE_DESCRIPTION.members["Status"], self.status - ) - - if self.sse_type is not None: - serializer.write_string( - _SCHEMA_SSE_DESCRIPTION.members["SSEType"], self.sse_type - ) - - if self.kms_master_key_arn is not None: - serializer.write_string( - _SCHEMA_SSE_DESCRIPTION.members["KMSMasterKeyArn"], - self.kms_master_key_arn, - ) - - if self.inaccessible_encryption_date_time is not None: - serializer.write_timestamp( - _SCHEMA_SSE_DESCRIPTION.members["InaccessibleEncryptionDateTime"], - self.inaccessible_encryption_date_time, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["status"] = SSEStatus( - de.read_string(_SCHEMA_SSE_DESCRIPTION.members["Status"]) - ) - - case 1: - kwargs["sse_type"] = SSEType( - de.read_string(_SCHEMA_SSE_DESCRIPTION.members["SSEType"]) - ) - - case 2: - kwargs["kms_master_key_arn"] = de.read_string( - _SCHEMA_SSE_DESCRIPTION.members["KMSMasterKeyArn"] - ) - - case 3: - kwargs["inaccessible_encryption_date_time"] = de.read_timestamp( - _SCHEMA_SSE_DESCRIPTION.members[ - "InaccessibleEncryptionDateTime" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SSE_DESCRIPTION, consumer=_consumer) - return kwargs - - -class StreamViewType(UnknownEnumMixin, StrEnum): - NEW_IMAGE = "NEW_IMAGE" - OLD_IMAGE = "OLD_IMAGE" - NEW_AND_OLD_IMAGES = "NEW_AND_OLD_IMAGES" - KEYS_ONLY = "KEYS_ONLY" - - -@dataclass(kw_only=True) -class StreamSpecification: - """Represents the DynamoDB Streams configuration for a table in DynamoDB.""" - - stream_enabled: bool - """ - Indicates whether DynamoDB Streams is enabled (true) or disabled (false) - on the table. - """ - - stream_view_type: str | None = None - """ - When an item in the table is modified, `StreamViewType` determines what - information is written to the stream for this table. Valid values for - `StreamViewType` are: - - - `KEYS_ONLY` - Only the key attributes of the modified item are written - to the stream. - - - `NEW_IMAGE` - The entire item, as it appears after it was modified, is - written to the stream. - - - `OLD_IMAGE` - The entire item, as it appeared before it was modified, - is written to the stream. - - - `NEW_AND_OLD_IMAGES` - Both the new and the old item images of the - item are written to the stream. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STREAM_SPECIFICATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_boolean( - _SCHEMA_STREAM_SPECIFICATION.members["StreamEnabled"], self.stream_enabled - ) - if self.stream_view_type is not None: - serializer.write_string( - _SCHEMA_STREAM_SPECIFICATION.members["StreamViewType"], - self.stream_view_type, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["stream_enabled"] = de.read_boolean( - _SCHEMA_STREAM_SPECIFICATION.members["StreamEnabled"] - ) - - case 1: - kwargs["stream_view_type"] = StreamViewType( - de.read_string( - _SCHEMA_STREAM_SPECIFICATION.members["StreamViewType"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_STREAM_SPECIFICATION, consumer=_consumer) - if "stream_enabled" not in kwargs: - kwargs["stream_enabled"] = False - return kwargs - - -class TimeToLiveStatus(UnknownEnumMixin, StrEnum): - ENABLING = "ENABLING" - DISABLING = "DISABLING" - ENABLED = "ENABLED" - DISABLED = "DISABLED" - - -@dataclass(kw_only=True) -class TimeToLiveDescription: - """The description of the Time to Live (TTL) status on the specified table.""" - - time_to_live_status: str | None = None - """The TTL status for the table.""" - - attribute_name: str | None = None - """The name of the TTL attribute for items in the table.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TIME_TO_LIVE_DESCRIPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.time_to_live_status is not None: - serializer.write_string( - _SCHEMA_TIME_TO_LIVE_DESCRIPTION.members["TimeToLiveStatus"], - self.time_to_live_status, - ) - - if self.attribute_name is not None: - serializer.write_string( - _SCHEMA_TIME_TO_LIVE_DESCRIPTION.members["AttributeName"], - self.attribute_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["time_to_live_status"] = TimeToLiveStatus( - de.read_string( - _SCHEMA_TIME_TO_LIVE_DESCRIPTION.members["TimeToLiveStatus"] - ) - ) - - case 1: - kwargs["attribute_name"] = de.read_string( - _SCHEMA_TIME_TO_LIVE_DESCRIPTION.members["AttributeName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TIME_TO_LIVE_DESCRIPTION, consumer=_consumer) - return kwargs - - -class VectorDistanceFunction(UnknownEnumMixin, StrEnum): - COSINE = "COSINE" - DOT_PRODUCT = "DOT_PRODUCT" - EUCLIDEAN = "EUCLIDEAN" - - -class SearchSchemaElementType(UnknownEnumMixin, StrEnum): - HASH = "HASH" - INLINE_FILTER = "INLINE_FILTER" - - -@dataclass(kw_only=True) -class SearchSchemaElement: - """An element in the search schema of a vector index.""" - - attribute_name: str - """The name of the attribute.""" - - search_schema_element_type: str - """ - The role of the attribute in the search schema. Valid values: - - - `HASH` - A partition key that partitions the vector index for - independent scaling. When specified, you must provide this - attribute's value in the `SearchConditionExpression`. - - - `INLINE_FILTER` - An attribute projected into the vector index for - filtering at the storage layer during search. Inline filters are - optional in the `SearchConditionExpression`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SEARCH_SCHEMA_ELEMENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SEARCH_SCHEMA_ELEMENT.members["AttributeName"], self.attribute_name - ) - serializer.write_string( - _SCHEMA_SEARCH_SCHEMA_ELEMENT.members["SearchSchemaElementType"], - self.search_schema_element_type, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["attribute_name"] = de.read_string( - _SCHEMA_SEARCH_SCHEMA_ELEMENT.members["AttributeName"] - ) - - case 1: - kwargs["search_schema_element_type"] = SearchSchemaElementType( - de.read_string( - _SCHEMA_SEARCH_SCHEMA_ELEMENT.members[ - "SearchSchemaElementType" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SEARCH_SCHEMA_ELEMENT, consumer=_consumer) - if "attribute_name" not in kwargs: - kwargs["attribute_name"] = "" - if "search_schema_element_type" not in kwargs: - kwargs["search_schema_element_type"] = SearchSchemaElementType._corrected( - "" - ) - return kwargs - - -def _serialize_search_schema( - serializer: ShapeSerializer, schema: Schema, value: list[SearchSchemaElement] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_search_schema( - deserializer: ShapeDeserializer, schema: Schema -) -> list[SearchSchemaElement]: - result: list[SearchSchemaElement] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(SearchSchemaElement.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class VectorAttributeDefinition: - """The definition of a vector attribute for a vector index.""" - - attribute_name: str - """The name of the vector attribute.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VECTOR_ATTRIBUTE_DEFINITION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_VECTOR_ATTRIBUTE_DEFINITION.members["AttributeName"], - self.attribute_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["attribute_name"] = de.read_string( - _SCHEMA_VECTOR_ATTRIBUTE_DEFINITION.members["AttributeName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_VECTOR_ATTRIBUTE_DEFINITION, consumer=_consumer - ) - if "attribute_name" not in kwargs: - kwargs["attribute_name"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(attribute_name="") - - -@dataclass(kw_only=True) -class VectorIndexInfo: - """ - Contains the configuration of a vector index as it existed at the time a - backup was created. - """ - - index_name: str | None = None - """The name of the vector index.""" - - vector_attribute: VectorAttributeDefinition | None = None - """The vector attribute configuration for the index.""" - - search_schema: list[SearchSchemaElement] | None = None - """ - The search schema that defines partition key and inline filter - attributes for the vector index. - """ - - projection: Projection | None = None - """ - Specifies attributes that are copied (projected) from the table into the - vector index. - """ - - dimensions: int | None = None - """The number of dimensions in each vector.""" - - distance_function: str | None = None - """The distance function used to calculate similarity between vectors.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VECTOR_INDEX_INFO, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.index_name is not None: - serializer.write_string( - _SCHEMA_VECTOR_INDEX_INFO.members["IndexName"], self.index_name - ) - - if self.vector_attribute is not None: - serializer.write_struct( - _SCHEMA_VECTOR_INDEX_INFO.members["VectorAttribute"], - self.vector_attribute, - ) - - if self.search_schema is not None: - _serialize_search_schema( - serializer, - _SCHEMA_VECTOR_INDEX_INFO.members["SearchSchema"], - self.search_schema, - ) - - if self.projection is not None: - serializer.write_struct( - _SCHEMA_VECTOR_INDEX_INFO.members["Projection"], self.projection - ) - - if self.dimensions is not None: - serializer.write_long( - _SCHEMA_VECTOR_INDEX_INFO.members["Dimensions"], self.dimensions - ) - - if self.distance_function is not None: - serializer.write_string( - _SCHEMA_VECTOR_INDEX_INFO.members["DistanceFunction"], - self.distance_function, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["index_name"] = de.read_string( - _SCHEMA_VECTOR_INDEX_INFO.members["IndexName"] - ) - - case 1: - kwargs["vector_attribute"] = VectorAttributeDefinition.deserialize( - de - ) - - case 2: - kwargs["search_schema"] = _deserialize_search_schema( - de, _SCHEMA_VECTOR_INDEX_INFO.members["SearchSchema"] - ) - - case 3: - kwargs["projection"] = Projection.deserialize(de) - - case 4: - kwargs["dimensions"] = de.read_long( - _SCHEMA_VECTOR_INDEX_INFO.members["Dimensions"] - ) - - case 5: - kwargs["distance_function"] = VectorDistanceFunction( - de.read_string( - _SCHEMA_VECTOR_INDEX_INFO.members["DistanceFunction"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VECTOR_INDEX_INFO, consumer=_consumer) - return kwargs - - -def _serialize_vector_indexes( - serializer: ShapeSerializer, schema: Schema, value: list[VectorIndexInfo] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_vector_indexes( - deserializer: ShapeDeserializer, schema: Schema -) -> list[VectorIndexInfo]: - result: list[VectorIndexInfo] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(VectorIndexInfo.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class SourceTableFeatureDetails: - """ - Contains the details of the features enabled on the table when the - backup was created. For example, LSIs, GSIs, streams, TTL. - """ - - local_secondary_indexes: list[LocalSecondaryIndexInfo] | None = None - """ - Represents the LSI properties for the table when the backup was created. - It includes the IndexName, KeySchema and Projection for the LSIs on the - table at the time of backup. - """ - - global_secondary_indexes: list[GlobalSecondaryIndexInfo] | None = None - """ - Represents the GSI properties for the table when the backup was created. - It includes the IndexName, KeySchema, Projection, and - ProvisionedThroughput for the GSIs on the table at the time of backup. - """ - - stream_description: StreamSpecification | None = None - """Stream settings on the table when the backup was created.""" - - time_to_live_description: TimeToLiveDescription | None = None - """Time to Live settings on the table when the backup was created.""" - - sse_description: SSEDescription | None = None - """ - The description of the server-side encryption status on the table when - the backup was created. - """ - - vector_indexes: list[VectorIndexInfo] | None = None - """ - The vector index properties for the table at the time the backup was - created, including the index name, vector attribute, dimensions, - distance function, search schema, and projection. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SOURCE_TABLE_FEATURE_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.local_secondary_indexes is not None: - _serialize_local_secondary_indexes( - serializer, - _SCHEMA_SOURCE_TABLE_FEATURE_DETAILS.members["LocalSecondaryIndexes"], - self.local_secondary_indexes, - ) - - if self.global_secondary_indexes is not None: - _serialize_global_secondary_indexes( - serializer, - _SCHEMA_SOURCE_TABLE_FEATURE_DETAILS.members["GlobalSecondaryIndexes"], - self.global_secondary_indexes, - ) - - if self.stream_description is not None: - serializer.write_struct( - _SCHEMA_SOURCE_TABLE_FEATURE_DETAILS.members["StreamDescription"], - self.stream_description, - ) - - if self.time_to_live_description is not None: - serializer.write_struct( - _SCHEMA_SOURCE_TABLE_FEATURE_DETAILS.members["TimeToLiveDescription"], - self.time_to_live_description, - ) - - if self.sse_description is not None: - serializer.write_struct( - _SCHEMA_SOURCE_TABLE_FEATURE_DETAILS.members["SSEDescription"], - self.sse_description, - ) - - if self.vector_indexes is not None: - _serialize_vector_indexes( - serializer, - _SCHEMA_SOURCE_TABLE_FEATURE_DETAILS.members["VectorIndexes"], - self.vector_indexes, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["local_secondary_indexes"] = ( - _deserialize_local_secondary_indexes( - de, - _SCHEMA_SOURCE_TABLE_FEATURE_DETAILS.members[ - "LocalSecondaryIndexes" - ], - ) - ) - - case 1: - kwargs["global_secondary_indexes"] = ( - _deserialize_global_secondary_indexes( - de, - _SCHEMA_SOURCE_TABLE_FEATURE_DETAILS.members[ - "GlobalSecondaryIndexes" - ], - ) - ) - - case 2: - kwargs["stream_description"] = StreamSpecification.deserialize(de) - - case 3: - kwargs["time_to_live_description"] = ( - TimeToLiveDescription.deserialize(de) - ) - - case 4: - kwargs["sse_description"] = SSEDescription.deserialize(de) - - case 5: - kwargs["vector_indexes"] = _deserialize_vector_indexes( - de, - _SCHEMA_SOURCE_TABLE_FEATURE_DETAILS.members["VectorIndexes"], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SOURCE_TABLE_FEATURE_DETAILS, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class BackupDescription: - """Contains the description of the backup created for the table.""" - - backup_details: BackupDetails | None = None - """Contains the details of the backup created for the table.""" - - source_table_details: SourceTableDetails | None = None - """Contains the details of the table when the backup was created.""" - - source_table_feature_details: SourceTableFeatureDetails | None = None - """ - Contains the details of the features enabled on the table when the - backup was created. For example, LSIs, GSIs, streams, TTL. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BACKUP_DESCRIPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.backup_details is not None: - serializer.write_struct( - _SCHEMA_BACKUP_DESCRIPTION.members["BackupDetails"], self.backup_details - ) - - if self.source_table_details is not None: - serializer.write_struct( - _SCHEMA_BACKUP_DESCRIPTION.members["SourceTableDetails"], - self.source_table_details, - ) - - if self.source_table_feature_details is not None: - serializer.write_struct( - _SCHEMA_BACKUP_DESCRIPTION.members["SourceTableFeatureDetails"], - self.source_table_feature_details, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["backup_details"] = BackupDetails.deserialize(de) - - case 1: - kwargs["source_table_details"] = SourceTableDetails.deserialize(de) - - case 2: - kwargs["source_table_feature_details"] = ( - SourceTableFeatureDetails.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BACKUP_DESCRIPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class BackupInUseException(ServiceError): - """ - There is another ongoing conflicting backup control plane operation on - the table. The backup is either being created, deleted or restored to a - table. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BACKUP_IN_USE_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_BACKUP_IN_USE_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_BACKUP_IN_USE_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BACKUP_IN_USE_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class BackupNotFoundException(ServiceError): - """Backup not found for the given BackupARN.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BACKUP_NOT_FOUND_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_BACKUP_NOT_FOUND_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_BACKUP_NOT_FOUND_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BACKUP_NOT_FOUND_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class BackupSummary: - """Contains details for the backup.""" - - table_name: str | None = None - """Name of the table.""" - - table_id: str | None = None - """Unique identifier for the table.""" - - table_arn: str | None = None - """ARN associated with the table.""" - - backup_arn: str | None = None - """ARN associated with the backup.""" - - backup_name: str | None = None - """Name of the specified backup.""" - - backup_creation_date_time: datetime | None = None - """Time at which the backup was created.""" - - backup_expiry_date_time: datetime | None = None - """ - Time at which the automatic on-demand backup created by DynamoDB will - expire. This `SYSTEM` on-demand backup expires automatically 35 days - after its creation. - """ - - backup_status: str | None = None - """Backup can be in one of the following states: CREATING, ACTIVE, DELETED.""" - - backup_type: str | None = None - """ - BackupType: - - - `USER` - You create and manage these using the on-demand backup - feature. - - - `SYSTEM` - If you delete a table with point-in-time recovery enabled, - a `SYSTEM` backup is automatically created and is retained for 35 days - (at no additional cost). System backups allow you to restore the - deleted table to the state it was in just before the point of - deletion. - - - `AWS_BACKUP` - On-demand backup created by you from Backup service. - """ - - backup_size_bytes: int | None = None - """Size of the backup in bytes.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BACKUP_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.table_name is not None: - serializer.write_string( - _SCHEMA_BACKUP_SUMMARY.members["TableName"], self.table_name - ) - - if self.table_id is not None: - serializer.write_string( - _SCHEMA_BACKUP_SUMMARY.members["TableId"], self.table_id - ) - - if self.table_arn is not None: - serializer.write_string( - _SCHEMA_BACKUP_SUMMARY.members["TableArn"], self.table_arn - ) - - if self.backup_arn is not None: - serializer.write_string( - _SCHEMA_BACKUP_SUMMARY.members["BackupArn"], self.backup_arn - ) - - if self.backup_name is not None: - serializer.write_string( - _SCHEMA_BACKUP_SUMMARY.members["BackupName"], self.backup_name - ) - - if self.backup_creation_date_time is not None: - serializer.write_timestamp( - _SCHEMA_BACKUP_SUMMARY.members["BackupCreationDateTime"], - self.backup_creation_date_time, - ) - - if self.backup_expiry_date_time is not None: - serializer.write_timestamp( - _SCHEMA_BACKUP_SUMMARY.members["BackupExpiryDateTime"], - self.backup_expiry_date_time, - ) - - if self.backup_status is not None: - serializer.write_string( - _SCHEMA_BACKUP_SUMMARY.members["BackupStatus"], self.backup_status - ) - - if self.backup_type is not None: - serializer.write_string( - _SCHEMA_BACKUP_SUMMARY.members["BackupType"], self.backup_type - ) - - if self.backup_size_bytes is not None: - serializer.write_long( - _SCHEMA_BACKUP_SUMMARY.members["BackupSizeBytes"], - self.backup_size_bytes, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["table_name"] = de.read_string( - _SCHEMA_BACKUP_SUMMARY.members["TableName"] - ) - - case 1: - kwargs["table_id"] = de.read_string( - _SCHEMA_BACKUP_SUMMARY.members["TableId"] - ) - - case 2: - kwargs["table_arn"] = de.read_string( - _SCHEMA_BACKUP_SUMMARY.members["TableArn"] - ) - - case 3: - kwargs["backup_arn"] = de.read_string( - _SCHEMA_BACKUP_SUMMARY.members["BackupArn"] - ) - - case 4: - kwargs["backup_name"] = de.read_string( - _SCHEMA_BACKUP_SUMMARY.members["BackupName"] - ) - - case 5: - kwargs["backup_creation_date_time"] = de.read_timestamp( - _SCHEMA_BACKUP_SUMMARY.members["BackupCreationDateTime"] - ) - - case 6: - kwargs["backup_expiry_date_time"] = de.read_timestamp( - _SCHEMA_BACKUP_SUMMARY.members["BackupExpiryDateTime"] - ) - - case 7: - kwargs["backup_status"] = BackupStatus( - de.read_string(_SCHEMA_BACKUP_SUMMARY.members["BackupStatus"]) - ) - - case 8: - kwargs["backup_type"] = BackupType( - de.read_string(_SCHEMA_BACKUP_SUMMARY.members["BackupType"]) - ) - - case 9: - kwargs["backup_size_bytes"] = de.read_long( - _SCHEMA_BACKUP_SUMMARY.members["BackupSizeBytes"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BACKUP_SUMMARY, consumer=_consumer) - return kwargs - - -def _serialize_backup_summaries( - serializer: ShapeSerializer, schema: Schema, value: list[BackupSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_backup_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[BackupSummary]: - result: list[BackupSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(BackupSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class BackupTypeFilter(UnknownEnumMixin, StrEnum): - USER = "USER" - SYSTEM = "SYSTEM" - AWS_BACKUP = "AWS_BACKUP" - ALL = "ALL" - - -class ReturnConsumedCapacity(UnknownEnumMixin, StrEnum): - """ - Determines the level of detail about either provisioned or on-demand - throughput consumption that is returned in the response: - - - `INDEXES` - The response includes the aggregate `ConsumedCapacity` for - the operation, together with `ConsumedCapacity` for each table and - secondary index that was accessed. - - Note that some operations, such as `GetItem` and `BatchGetItem`, do - not access any indexes at all. In these cases, specifying `INDEXES` - will only return `ConsumedCapacity` information for table(s). - - - `TOTAL` - The response includes only the aggregate `ConsumedCapacity` - for the operation. - - - `NONE` - No `ConsumedCapacity` details are included in the response. - """ - - INDEXES = "INDEXES" - TOTAL = "TOTAL" - NONE = "NONE" - - -class ReturnValuesOnConditionCheckFailure(UnknownEnumMixin, StrEnum): - ALL_OLD = "ALL_OLD" - NONE = "NONE" - - -@dataclass(kw_only=True) -class Capacity: - """ - Represents the amount of provisioned throughput capacity consumed on a - table or an index. - """ - - read_capacity_units: float | None = None - """The total number of read capacity units consumed on a table or an index.""" - - write_capacity_units: float | None = None - """ - The total number of write capacity units consumed on a table or an - index. - """ - - capacity_units: float | None = None - """The total number of capacity units consumed on a table or an index.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CAPACITY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.read_capacity_units is not None: - serializer.write_double( - _SCHEMA_CAPACITY.members["ReadCapacityUnits"], self.read_capacity_units - ) - - if self.write_capacity_units is not None: - serializer.write_double( - _SCHEMA_CAPACITY.members["WriteCapacityUnits"], - self.write_capacity_units, - ) - - if self.capacity_units is not None: - serializer.write_double( - _SCHEMA_CAPACITY.members["CapacityUnits"], self.capacity_units - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["read_capacity_units"] = de.read_double( - _SCHEMA_CAPACITY.members["ReadCapacityUnits"] - ) - - case 1: - kwargs["write_capacity_units"] = de.read_double( - _SCHEMA_CAPACITY.members["WriteCapacityUnits"] - ) - - case 2: - kwargs["capacity_units"] = de.read_double( - _SCHEMA_CAPACITY.members["CapacityUnits"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CAPACITY, consumer=_consumer) - return kwargs - - -def _serialize_secondary_indexes_capacity_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, Capacity] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_struct(value_schema, v)) - - -def _deserialize_secondary_indexes_capacity_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, Capacity]: - result: dict[str, Capacity] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = Capacity.deserialize(d) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class VectorCapacity: - """ - The consumed capacity for vector index operations, including vector - search request bytes and vector write request bytes. - """ - - vector_search_request_bytes: float | None = None - """ - The number of vector search request bytes consumed by a `SearchVectors` - operation. - """ - - vector_write_request_bytes: float | None = None - """ - The number of vector write request bytes consumed when writing to a - vector index. Reported for write operations that modify attributes - indexed by a vector index. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VECTOR_CAPACITY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.vector_search_request_bytes is not None: - serializer.write_double( - _SCHEMA_VECTOR_CAPACITY.members["VectorSearchRequestBytes"], - self.vector_search_request_bytes, - ) - - if self.vector_write_request_bytes is not None: - serializer.write_double( - _SCHEMA_VECTOR_CAPACITY.members["VectorWriteRequestBytes"], - self.vector_write_request_bytes, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["vector_search_request_bytes"] = de.read_double( - _SCHEMA_VECTOR_CAPACITY.members["VectorSearchRequestBytes"] - ) - - case 1: - kwargs["vector_write_request_bytes"] = de.read_double( - _SCHEMA_VECTOR_CAPACITY.members["VectorWriteRequestBytes"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VECTOR_CAPACITY, consumer=_consumer) - return kwargs - - -def _serialize_vector_indexes_capacity_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, VectorCapacity] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_struct(value_schema, v)) - - -def _deserialize_vector_indexes_capacity_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, VectorCapacity]: - result: dict[str, VectorCapacity] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = VectorCapacity.deserialize(d) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ConsumedCapacity: - """ - The capacity units consumed by an operation. The data returned includes - the total provisioned throughput consumed, along with statistics for the - table and any indexes involved in the operation. `ConsumedCapacity` is - only returned if the request asked for it. For more information, see - [Provisioned capacity - mode](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/provisioned-capacity-mode.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - table_name: str | None = None - """ - The name of the table that was affected by the operation. If you had - specified the Amazon Resource Name (ARN) of a table in the input, - you'll see the table ARN in the response. - """ - - capacity_units: float | None = None - """The total number of capacity units consumed by the operation.""" - - read_capacity_units: float | None = None - """The total number of read capacity units consumed by the operation.""" - - write_capacity_units: float | None = None - """The total number of write capacity units consumed by the operation.""" - - table: Capacity | None = None - """ - The amount of throughput consumed on the table affected by the - operation. - """ - - local_secondary_indexes: dict[str, Capacity] | None = None - """ - The amount of throughput consumed on each local index affected by the - operation. - """ - - global_secondary_indexes: dict[str, Capacity] | None = None - """ - The amount of throughput consumed on each global index affected by the - operation. - """ - - vector_indexes: dict[str, VectorCapacity] | None = None - """ - The amount of throughput consumed on each vector index affected by the - operation. Each entry contains `VectorWriteRequestBytes` (for write - operations) or `VectorSearchRequestBytes` (for search operations). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONSUMED_CAPACITY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.table_name is not None: - serializer.write_string( - _SCHEMA_CONSUMED_CAPACITY.members["TableName"], self.table_name - ) - - if self.capacity_units is not None: - serializer.write_double( - _SCHEMA_CONSUMED_CAPACITY.members["CapacityUnits"], self.capacity_units - ) - - if self.read_capacity_units is not None: - serializer.write_double( - _SCHEMA_CONSUMED_CAPACITY.members["ReadCapacityUnits"], - self.read_capacity_units, - ) - - if self.write_capacity_units is not None: - serializer.write_double( - _SCHEMA_CONSUMED_CAPACITY.members["WriteCapacityUnits"], - self.write_capacity_units, - ) - - if self.table is not None: - serializer.write_struct( - _SCHEMA_CONSUMED_CAPACITY.members["Table"], self.table - ) - - if self.local_secondary_indexes is not None: - _serialize_secondary_indexes_capacity_map( - serializer, - _SCHEMA_CONSUMED_CAPACITY.members["LocalSecondaryIndexes"], - self.local_secondary_indexes, - ) - - if self.global_secondary_indexes is not None: - _serialize_secondary_indexes_capacity_map( - serializer, - _SCHEMA_CONSUMED_CAPACITY.members["GlobalSecondaryIndexes"], - self.global_secondary_indexes, - ) - - if self.vector_indexes is not None: - _serialize_vector_indexes_capacity_map( - serializer, - _SCHEMA_CONSUMED_CAPACITY.members["VectorIndexes"], - self.vector_indexes, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["table_name"] = de.read_string( - _SCHEMA_CONSUMED_CAPACITY.members["TableName"] - ) - - case 1: - kwargs["capacity_units"] = de.read_double( - _SCHEMA_CONSUMED_CAPACITY.members["CapacityUnits"] - ) - - case 2: - kwargs["read_capacity_units"] = de.read_double( - _SCHEMA_CONSUMED_CAPACITY.members["ReadCapacityUnits"] - ) - - case 3: - kwargs["write_capacity_units"] = de.read_double( - _SCHEMA_CONSUMED_CAPACITY.members["WriteCapacityUnits"] - ) - - case 4: - kwargs["table"] = Capacity.deserialize(de) - - case 5: - kwargs["local_secondary_indexes"] = ( - _deserialize_secondary_indexes_capacity_map( - de, - _SCHEMA_CONSUMED_CAPACITY.members["LocalSecondaryIndexes"], - ) - ) - - case 6: - kwargs["global_secondary_indexes"] = ( - _deserialize_secondary_indexes_capacity_map( - de, - _SCHEMA_CONSUMED_CAPACITY.members["GlobalSecondaryIndexes"], - ) - ) - - case 7: - kwargs["vector_indexes"] = _deserialize_vector_indexes_capacity_map( - de, _SCHEMA_CONSUMED_CAPACITY.members["VectorIndexes"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONSUMED_CAPACITY, consumer=_consumer) - return kwargs - - -def _serialize_consumed_capacity_multiple( - serializer: ShapeSerializer, schema: Schema, value: list[ConsumedCapacity] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_consumed_capacity_multiple( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ConsumedCapacity]: - result: list[ConsumedCapacity] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ConsumedCapacity.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class BatchStatementErrorCodeEnum(UnknownEnumMixin, StrEnum): - CONDITIONAL_CHECK_FAILED = "ConditionalCheckFailed" - ITEM_COLLECTION_SIZE_LIMIT_EXCEEDED = "ItemCollectionSizeLimitExceeded" - REQUEST_LIMIT_EXCEEDED = "RequestLimitExceeded" - VALIDATION_ERROR = "ValidationError" - PROVISIONED_THROUGHPUT_EXCEEDED = "ProvisionedThroughputExceeded" - TRANSACTION_CONFLICT = "TransactionConflict" - THROTTLING_ERROR = "ThrottlingError" - INTERNAL_SERVER_ERROR = "InternalServerError" - RESOURCE_NOT_FOUND = "ResourceNotFound" - ACCESS_DENIED = "AccessDenied" - DUPLICATE_ITEM = "DuplicateItem" - - -@dataclass(kw_only=True) -class InternalServerError(ServiceError): - """An error occurred on the server side.""" - - fault: Literal["client", "server"] | None = "server" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INTERNAL_SERVER_ERROR, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INTERNAL_SERVER_ERROR.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INTERNAL_SERVER_ERROR.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INTERNAL_SERVER_ERROR, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ThrottlingReason: - """ - Represents the specific reason why a DynamoDB request was throttled and - the ARN of the impacted resource. This helps identify exactly what - resource is being throttled, what type of operation caused it, and why - the throttling occurred. - """ - - reason: str | None = None - """ - The reason for throttling. The throttling reason follows a specific - format: `ResourceType+OperationType+LimitType`: - - - Resource Type (What is being throttled): Table or Index - - - Operation Type (What kind of operation): Read or Write - - - Limit Type (Why the throttling occurred): - - - `ProvisionedThroughputExceeded`: The request rate is exceeding the - [provisioned throughput - capacity](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/provisioned-capacity-mode.html) - (read or write capacity units) configured for a table or a global - secondary index (GSI) in provisioned capacity mode. - - - `AccountLimitExceeded`: The request rate has caused a table or - global secondary index (GSI) in on-demand mode to exceed the - [per-table account-level service - quotas](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ServiceQuotas.html#default-limits-throughput) - for read/write throughput in the current Amazon Web Services Region. - - - `KeyRangeThroughputExceeded`: The request rate directed at a - specific partition key value has exceeded the [internal - partition-level throughput - limits](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/bp-partition-key-design.html), - indicating uneven access patterns across the table's or GSI's key - space. - - - `MaxOnDemandThroughputExceeded`: The request rate has exceeded the - [configured maximum throughput - limits](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/on-demand-capacity-mode-max-throughput.html) - set for a table or index in on-demand capacity mode. - - Examples of complete throttling reasons: - - - TableReadProvisionedThroughputExceeded - - - IndexWriteAccountLimitExceeded - - This helps identify exactly what resource is being throttled, what type - of operation caused it, and why the throttling occurred. - """ - - resource: str | None = None - """ - The Amazon Resource Name (ARN) of the DynamoDB table or index that - experienced the throttling event. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_THROTTLING_REASON, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.reason is not None: - serializer.write_string( - _SCHEMA_THROTTLING_REASON.members["reason"], self.reason - ) - - if self.resource is not None: - serializer.write_string( - _SCHEMA_THROTTLING_REASON.members["resource"], self.resource - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["reason"] = de.read_string( - _SCHEMA_THROTTLING_REASON.members["reason"] - ) - - case 1: - kwargs["resource"] = de.read_string( - _SCHEMA_THROTTLING_REASON.members["resource"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_THROTTLING_REASON, consumer=_consumer) - return kwargs - - -def _serialize_throttling_reason_list( - serializer: ShapeSerializer, schema: Schema, value: list[ThrottlingReason] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_throttling_reason_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ThrottlingReason]: - result: list[ThrottlingReason] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ThrottlingReason.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class RequestLimitExceeded(ServiceError): - """ - Throughput exceeds the current throughput quota for your account. For - detailed information about why the request was throttled and the ARN of - the impacted resource, find the - [ThrottlingReason](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ThrottlingReason.html) - field in the returned exception. Contact [Amazon Web Services - Support](https://aws.amazon.com/support) to request a quota increase. - """ - - fault: Literal["client", "server"] | None = "client" - - throttling_reasons: list[ThrottlingReason] | None = None - """ - A list of - [ThrottlingReason](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ThrottlingReason.html) - that provide detailed diagnostic information about why the request was - throttled. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REQUEST_LIMIT_EXCEEDED, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_REQUEST_LIMIT_EXCEEDED.members["message"], self.message - ) - - if self.throttling_reasons is not None: - _serialize_throttling_reason_list( - serializer, - _SCHEMA_REQUEST_LIMIT_EXCEEDED.members["ThrottlingReasons"], - self.throttling_reasons, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_REQUEST_LIMIT_EXCEEDED.members["message"] - ) - - case 1: - kwargs["throttling_reasons"] = _deserialize_throttling_reason_list( - de, _SCHEMA_REQUEST_LIMIT_EXCEEDED.members["ThrottlingReasons"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_REQUEST_LIMIT_EXCEEDED, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ThrottlingException(ServiceError): - """ - The request was denied due to request throttling. For detailed - information about why the request was throttled and the ARN of the - impacted resource, find the - [ThrottlingReason](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ThrottlingReason.html) - field in the returned exception. - """ - - fault: Literal["client", "server"] | None = "client" - - throttling_reasons: list[ThrottlingReason] | None = None - """ - A list of - [ThrottlingReason](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ThrottlingReason.html) - that provide detailed diagnostic information about why the request was - throttled. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_THROTTLING_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_THROTTLING_EXCEPTION.members["message"], self.message - ) - - if self.throttling_reasons is not None: - _serialize_throttling_reason_list( - serializer, - _SCHEMA_THROTTLING_EXCEPTION.members["throttlingReasons"], - self.throttling_reasons, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_THROTTLING_EXCEPTION.members["message"] - ) - - case 1: - kwargs["throttling_reasons"] = _deserialize_throttling_reason_list( - de, _SCHEMA_THROTTLING_EXCEPTION.members["throttlingReasons"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_THROTTLING_EXCEPTION, consumer=_consumer) - return kwargs - - -def _serialize_expression_attribute_name_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_expression_attribute_name_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class InvalidEndpointException(ServiceError): - """Dataclass for InvalidEndpointException structure.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_ENDPOINT_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_ENDPOINT_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_ENDPOINT_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INVALID_ENDPOINT_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ProvisionedThroughputExceededException(ServiceError): - """ - The request was denied due to request throttling. For detailed - information about why the request was throttled and the ARN of the - impacted resource, find the - [ThrottlingReason](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ThrottlingReason.html) - field in the returned exception. The Amazon Web Services SDKs for - DynamoDB automatically retry requests that receive this exception. Your - request is eventually successful, unless your retry queue is too large - to finish. Reduce the frequency of requests and use exponential backoff. - For more information, go to [Error Retries and Exponential - Backoff](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff) - in the *Amazon DynamoDB Developer Guide*. - """ - - fault: Literal["client", "server"] | None = "client" - - throttling_reasons: list[ThrottlingReason] | None = None - """ - A list of - [ThrottlingReason](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ThrottlingReason.html) - that provide detailed diagnostic information about why the request was - throttled. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PROVISIONED_THROUGHPUT_EXCEEDED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_PROVISIONED_THROUGHPUT_EXCEEDED_EXCEPTION.members["message"], - self.message, - ) - - if self.throttling_reasons is not None: - _serialize_throttling_reason_list( - serializer, - _SCHEMA_PROVISIONED_THROUGHPUT_EXCEEDED_EXCEPTION.members[ - "ThrottlingReasons" - ], - self.throttling_reasons, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_PROVISIONED_THROUGHPUT_EXCEEDED_EXCEPTION.members[ - "message" - ] - ) - - case 1: - kwargs["throttling_reasons"] = _deserialize_throttling_reason_list( - de, - _SCHEMA_PROVISIONED_THROUGHPUT_EXCEEDED_EXCEPTION.members[ - "ThrottlingReasons" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PROVISIONED_THROUGHPUT_EXCEEDED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ResourceNotFoundException(ServiceError): - """ - The operation tried to access a nonexistent table or index. The resource - might not be specified correctly, or its status might not be `ACTIVE`. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, consumer=_consumer - ) - return kwargs - - -class ReturnItemCollectionMetrics(UnknownEnumMixin, StrEnum): - SIZE = "SIZE" - NONE = "NONE" - - -def _serialize_item_collection_size_estimate_range( - serializer: ShapeSerializer, schema: Schema, value: list[float] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_double(member_schema, e) - - -def _deserialize_item_collection_size_estimate_range( - deserializer: ShapeDeserializer, schema: Schema -) -> list[float]: - result: list[float] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_double(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ItemCollectionSizeLimitExceededException(ServiceError): - """ - An item collection is too large. This exception is only returned for - tables that have one or more local secondary indexes. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_ITEM_COLLECTION_SIZE_LIMIT_EXCEEDED_EXCEPTION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_ITEM_COLLECTION_SIZE_LIMIT_EXCEEDED_EXCEPTION.members[ - "message" - ], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_ITEM_COLLECTION_SIZE_LIMIT_EXCEEDED_EXCEPTION.members[ - "message" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ITEM_COLLECTION_SIZE_LIMIT_EXCEEDED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ReplicatedWriteConflictException(ServiceError): - """ - The request was rejected because one or more items in the request are - being modified by a request in another Region. - """ - - fault: Literal["client", "server"] | None = "client" - is_retry_safe: bool | None = True - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REPLICATED_WRITE_CONFLICT_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_REPLICATED_WRITE_CONFLICT_EXCEPTION.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_REPLICATED_WRITE_CONFLICT_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_REPLICATED_WRITE_CONFLICT_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class BillingModeSummary: - """ - Contains the details for the read/write capacity mode. This page talks - about `PROVISIONED` and `PAY_PER_REQUEST` billing modes. For more - information about these modes, see [Read/write capacity - mode](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html). - - Note: - You may need to switch to on-demand mode at least once in order to - return a `BillingModeSummary` response. - """ - - billing_mode: str | None = None - """ - Controls how you are charged for read and write throughput and how you - manage capacity. This setting can be changed later. - - - `PROVISIONED` - Sets the read/write capacity mode to `PROVISIONED`. We - recommend using `PROVISIONED` for predictable workloads. - - - `PAY_PER_REQUEST` - Sets the read/write capacity mode to - `PAY_PER_REQUEST`. We recommend using `PAY_PER_REQUEST` for - unpredictable workloads. - """ - - last_update_to_pay_per_request_date_time: datetime | None = None - """ - Represents the time when `PAY_PER_REQUEST` was last set as the - read/write capacity mode. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BILLING_MODE_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.billing_mode is not None: - serializer.write_string( - _SCHEMA_BILLING_MODE_SUMMARY.members["BillingMode"], self.billing_mode - ) - - if self.last_update_to_pay_per_request_date_time is not None: - serializer.write_timestamp( - _SCHEMA_BILLING_MODE_SUMMARY.members[ - "LastUpdateToPayPerRequestDateTime" - ], - self.last_update_to_pay_per_request_date_time, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["billing_mode"] = BillingMode( - de.read_string( - _SCHEMA_BILLING_MODE_SUMMARY.members["BillingMode"] - ) - ) - - case 1: - kwargs["last_update_to_pay_per_request_date_time"] = ( - de.read_timestamp( - _SCHEMA_BILLING_MODE_SUMMARY.members[ - "LastUpdateToPayPerRequestDateTime" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BILLING_MODE_SUMMARY, consumer=_consumer) - return kwargs - - -class ComparisonOperator(UnknownEnumMixin, StrEnum): - EQ = "EQ" - NE = "NE" - IN_ = "IN" - LE = "LE" - LT = "LT" - GE = "GE" - GT = "GT" - BETWEEN = "BETWEEN" - NOT_NULL = "NOT_NULL" - NULL = "NULL" - CONTAINS = "CONTAINS" - NOT_CONTAINS = "NOT_CONTAINS" - BEGINS_WITH = "BEGINS_WITH" - - -class ConditionalOperator(UnknownEnumMixin, StrEnum): - AND_ = "AND" - OR_ = "OR" - - -class ContinuousBackupsStatus(UnknownEnumMixin, StrEnum): - ENABLED = "ENABLED" - DISABLED = "DISABLED" - - -class PointInTimeRecoveryStatus(UnknownEnumMixin, StrEnum): - ENABLED = "ENABLED" - DISABLED = "DISABLED" - - -@dataclass(kw_only=True) -class PointInTimeRecoveryDescription: - """The description of the point in time settings applied to the table.""" - - point_in_time_recovery_status: str | None = None - """ - The current state of point in time recovery: - - - `ENABLED` - Point in time recovery is enabled. - - - `DISABLED` - Point in time recovery is disabled. - """ - - recovery_period_in_days: int | None = None - """ - The number of preceding days for which continuous backups are taken and - maintained. Your table data is only recoverable to any point-in-time - from within the configured recovery period. This parameter is optional. - """ - - earliest_restorable_date_time: datetime | None = None - """ - Specifies the earliest point in time you can restore your table to. You - can restore your table to any point in time during the last 35 days. - """ - - latest_restorable_date_time: datetime | None = None - """ - `LatestRestorableDateTime` is typically 5 minutes before the current - time. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_POINT_IN_TIME_RECOVERY_DESCRIPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.point_in_time_recovery_status is not None: - serializer.write_string( - _SCHEMA_POINT_IN_TIME_RECOVERY_DESCRIPTION.members[ - "PointInTimeRecoveryStatus" - ], - self.point_in_time_recovery_status, - ) - - if self.recovery_period_in_days is not None: - serializer.write_integer( - _SCHEMA_POINT_IN_TIME_RECOVERY_DESCRIPTION.members[ - "RecoveryPeriodInDays" - ], - self.recovery_period_in_days, - ) - - if self.earliest_restorable_date_time is not None: - serializer.write_timestamp( - _SCHEMA_POINT_IN_TIME_RECOVERY_DESCRIPTION.members[ - "EarliestRestorableDateTime" - ], - self.earliest_restorable_date_time, - ) - - if self.latest_restorable_date_time is not None: - serializer.write_timestamp( - _SCHEMA_POINT_IN_TIME_RECOVERY_DESCRIPTION.members[ - "LatestRestorableDateTime" - ], - self.latest_restorable_date_time, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["point_in_time_recovery_status"] = PointInTimeRecoveryStatus( - de.read_string( - _SCHEMA_POINT_IN_TIME_RECOVERY_DESCRIPTION.members[ - "PointInTimeRecoveryStatus" - ] - ) - ) - - case 1: - kwargs["recovery_period_in_days"] = de.read_integer( - _SCHEMA_POINT_IN_TIME_RECOVERY_DESCRIPTION.members[ - "RecoveryPeriodInDays" - ] - ) - - case 2: - kwargs["earliest_restorable_date_time"] = de.read_timestamp( - _SCHEMA_POINT_IN_TIME_RECOVERY_DESCRIPTION.members[ - "EarliestRestorableDateTime" - ] - ) - - case 3: - kwargs["latest_restorable_date_time"] = de.read_timestamp( - _SCHEMA_POINT_IN_TIME_RECOVERY_DESCRIPTION.members[ - "LatestRestorableDateTime" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_POINT_IN_TIME_RECOVERY_DESCRIPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ContinuousBackupsDescription: - """ - Represents the continuous backups and point in time recovery settings on - the table. - """ - - continuous_backups_status: str - """ - `ContinuousBackupsStatus` can be one of the following states: ENABLED, - DISABLED - """ - - point_in_time_recovery_description: PointInTimeRecoveryDescription | None = None - """ - The description of the point in time recovery settings applied to the - table. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTINUOUS_BACKUPS_DESCRIPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CONTINUOUS_BACKUPS_DESCRIPTION.members["ContinuousBackupsStatus"], - self.continuous_backups_status, - ) - if self.point_in_time_recovery_description is not None: - serializer.write_struct( - _SCHEMA_CONTINUOUS_BACKUPS_DESCRIPTION.members[ - "PointInTimeRecoveryDescription" - ], - self.point_in_time_recovery_description, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["continuous_backups_status"] = ContinuousBackupsStatus( - de.read_string( - _SCHEMA_CONTINUOUS_BACKUPS_DESCRIPTION.members[ - "ContinuousBackupsStatus" - ] - ) - ) - - case 1: - kwargs["point_in_time_recovery_description"] = ( - PointInTimeRecoveryDescription.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CONTINUOUS_BACKUPS_DESCRIPTION, consumer=_consumer - ) - if "continuous_backups_status" not in kwargs: - kwargs["continuous_backups_status"] = ContinuousBackupsStatus._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class ContinuousBackupsUnavailableException(ServiceError): - """Backups have not yet been enabled for this table.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTINUOUS_BACKUPS_UNAVAILABLE_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_CONTINUOUS_BACKUPS_UNAVAILABLE_EXCEPTION.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_CONTINUOUS_BACKUPS_UNAVAILABLE_EXCEPTION.members[ - "message" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CONTINUOUS_BACKUPS_UNAVAILABLE_EXCEPTION, consumer=_consumer - ) - return kwargs - - -class ContributorInsightsAction(UnknownEnumMixin, StrEnum): - ENABLE = "ENABLE" - DISABLE = "DISABLE" - - -class ContributorInsightsMode(UnknownEnumMixin, StrEnum): - ACCESSED_AND_THROTTLED_KEYS = "ACCESSED_AND_THROTTLED_KEYS" - THROTTLED_KEYS = "THROTTLED_KEYS" - - -def _serialize_contributor_insights_rule_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_contributor_insights_rule_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -class ContributorInsightsStatus(UnknownEnumMixin, StrEnum): - ENABLING = "ENABLING" - ENABLED = "ENABLED" - DISABLING = "DISABLING" - DISABLED = "DISABLED" - FAILED = "FAILED" - - -@dataclass(kw_only=True) -class ContributorInsightsSummary: - """Represents a Contributor Insights summary entry.""" - - table_name: str | None = None - """Name of the table associated with the summary.""" - - index_name: str | None = None - """Name of the index associated with the summary, if any.""" - - contributor_insights_status: str | None = None - """ - Describes the current status for contributor insights for the given - table and index, if applicable. - """ - - contributor_insights_mode: str | None = None - """ - Indicates the current mode of CloudWatch Contributor Insights, - specifying whether it tracks all access and throttled events or - throttled events only for the DynamoDB table or index. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTRIBUTOR_INSIGHTS_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.table_name is not None: - serializer.write_string( - _SCHEMA_CONTRIBUTOR_INSIGHTS_SUMMARY.members["TableName"], - self.table_name, - ) - - if self.index_name is not None: - serializer.write_string( - _SCHEMA_CONTRIBUTOR_INSIGHTS_SUMMARY.members["IndexName"], - self.index_name, - ) - - if self.contributor_insights_status is not None: - serializer.write_string( - _SCHEMA_CONTRIBUTOR_INSIGHTS_SUMMARY.members[ - "ContributorInsightsStatus" - ], - self.contributor_insights_status, - ) - - if self.contributor_insights_mode is not None: - serializer.write_string( - _SCHEMA_CONTRIBUTOR_INSIGHTS_SUMMARY.members["ContributorInsightsMode"], - self.contributor_insights_mode, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["table_name"] = de.read_string( - _SCHEMA_CONTRIBUTOR_INSIGHTS_SUMMARY.members["TableName"] - ) - - case 1: - kwargs["index_name"] = de.read_string( - _SCHEMA_CONTRIBUTOR_INSIGHTS_SUMMARY.members["IndexName"] - ) - - case 2: - kwargs["contributor_insights_status"] = ContributorInsightsStatus( - de.read_string( - _SCHEMA_CONTRIBUTOR_INSIGHTS_SUMMARY.members[ - "ContributorInsightsStatus" - ] - ) - ) - - case 3: - kwargs["contributor_insights_mode"] = ContributorInsightsMode( - de.read_string( - _SCHEMA_CONTRIBUTOR_INSIGHTS_SUMMARY.members[ - "ContributorInsightsMode" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CONTRIBUTOR_INSIGHTS_SUMMARY, consumer=_consumer - ) - return kwargs - - -def _serialize_contributor_insights_summaries( - serializer: ShapeSerializer, schema: Schema, value: list[ContributorInsightsSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_contributor_insights_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ContributorInsightsSummary]: - result: list[ContributorInsightsSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ContributorInsightsSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CreateBackupInput: - """Dataclass for CreateBackupInput structure.""" - - table_name: str | None = None - """ - The name of the table. You can also provide the Amazon Resource Name - (ARN) of the table in this parameter. - """ - - backup_name: str | None = None - """Specified name for the backup.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_BACKUP_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.table_name is not None: - serializer.write_string( - _SCHEMA_CREATE_BACKUP_INPUT.members["TableName"], self.table_name - ) - - if self.backup_name is not None: - serializer.write_string( - _SCHEMA_CREATE_BACKUP_INPUT.members["BackupName"], self.backup_name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["table_name"] = de.read_string( - _SCHEMA_CREATE_BACKUP_INPUT.members["TableName"] - ) - - case 1: - kwargs["backup_name"] = de.read_string( - _SCHEMA_CREATE_BACKUP_INPUT.members["BackupName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_BACKUP_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CreateBackupOutput: - """Dataclass for CreateBackupOutput structure.""" - - backup_details: BackupDetails | None = None - """Contains the details of the backup created for the table.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_BACKUP_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.backup_details is not None: - serializer.write_struct( - _SCHEMA_CREATE_BACKUP_OUTPUT.members["BackupDetails"], - self.backup_details, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["backup_details"] = BackupDetails.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_BACKUP_OUTPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class LimitExceededException(ServiceError): - """ - There is no limit to the number of daily on-demand backups that can be - taken. - - For most purposes, up to 500 simultaneous table operations are allowed - per account. These operations include `CreateTable`, `UpdateTable`, - `DeleteTable`,`UpdateTimeToLive`, `RestoreTableFromBackup`, and - `RestoreTableToPointInTime`. - - When you are creating a table with one or more secondary indexes, you - can have up to 250 such requests running at a time. However, if the - table or index specifications are complex, then DynamoDB might - temporarily reduce the number of concurrent operations. - - When importing into DynamoDB, up to 50 simultaneous import table - operations are allowed per account. - - There is a soft account quota of 2,500 tables. - - GetRecords was called with a value of more than 1000 for the limit - request parameter. - - More than 2 processes are reading from the same streams shard at the - same time. Exceeding this limit may result in request throttling. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIMIT_EXCEEDED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIMIT_EXCEEDED_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class TableInUseException(ServiceError): - """ - A target table with the specified name is either being created or - deleted. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TABLE_IN_USE_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_TABLE_IN_USE_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_TABLE_IN_USE_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TABLE_IN_USE_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class TableNotFoundException(ServiceError): - """ - A source table with the name `TableName` does not currently exist within - the subscriber's account or the subscriber is operating in the wrong - Amazon Web Services Region. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TABLE_NOT_FOUND_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_TABLE_NOT_FOUND_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_TABLE_NOT_FOUND_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TABLE_NOT_FOUND_EXCEPTION, consumer=_consumer) - return kwargs - - -CREATE_BACKUP = APIOperation( - input=CreateBackupInput, - output=CreateBackupOutput, - schema=_SCHEMA_CREATE_BACKUP, - input_schema=_SCHEMA_CREATE_BACKUP_INPUT, - output_schema=_SCHEMA_CREATE_BACKUP_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.dynamodb#BackupInUseException" - ): BackupInUseException, - ShapeID( - "com.amazonaws.dynamodb#ContinuousBackupsUnavailableException" - ): ContinuousBackupsUnavailableException, - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#InvalidEndpointException" - ): InvalidEndpointException, - ShapeID( - "com.amazonaws.dynamodb#LimitExceededException" - ): LimitExceededException, - ShapeID("com.amazonaws.dynamodb#TableInUseException"): TableInUseException, - ShapeID( - "com.amazonaws.dynamodb#TableNotFoundException" - ): TableNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BACKUP_IN_USE_EXCEPTION, - _SCHEMA_CONTINUOUS_BACKUPS_UNAVAILABLE_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR, - _SCHEMA_INVALID_ENDPOINT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_TABLE_IN_USE_EXCEPTION, - _SCHEMA_TABLE_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class WarmThroughput: - """ - Provides visibility into the number of read and write operations your - table or secondary index can instantaneously support. The settings can - be modified using the `UpdateTable` operation to meet the throughput - requirements of an upcoming peak event. - """ - - read_units_per_second: int | None = None - """ - Represents the number of read operations your base table can - instantaneously support. - """ - - write_units_per_second: int | None = None - """ - Represents the number of write operations your base table can - instantaneously support. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_WARM_THROUGHPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.read_units_per_second is not None: - serializer.write_long( - _SCHEMA_WARM_THROUGHPUT.members["ReadUnitsPerSecond"], - self.read_units_per_second, - ) - - if self.write_units_per_second is not None: - serializer.write_long( - _SCHEMA_WARM_THROUGHPUT.members["WriteUnitsPerSecond"], - self.write_units_per_second, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["read_units_per_second"] = de.read_long( - _SCHEMA_WARM_THROUGHPUT.members["ReadUnitsPerSecond"] - ) - - case 1: - kwargs["write_units_per_second"] = de.read_long( - _SCHEMA_WARM_THROUGHPUT.members["WriteUnitsPerSecond"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_WARM_THROUGHPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CreateGlobalSecondaryIndexAction: - """ - Represents a new global secondary index to be added to an existing - table. - """ - - index_name: str - """The name of the global secondary index to be created.""" - - key_schema: list[KeySchemaElement] - """ - The key schema for the global secondary index. Global secondary index - supports up to 4 partition and up to 4 sort keys. - """ - - projection: Projection - """ - Represents attributes that are copied (projected) from the table into an - index. These are in addition to the primary key attributes and index key - attributes, which are automatically projected. - """ - - provisioned_throughput: ProvisionedThroughput | None = None - """ - Represents the provisioned throughput settings for the specified global - secondary index. - - For current minimum and maximum provisioned throughput values, see - [Service, Account, and Table - Quotas](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - on_demand_throughput: OnDemandThroughput | None = None - """ - The maximum number of read and write units for the global secondary - index being created. If you use this parameter, you must specify - `MaxReadRequestUnits`, `MaxWriteRequestUnits`, or both. You must use - either `OnDemand Throughput` or `ProvisionedThroughput` based on your - table's capacity mode. - """ - - warm_throughput: WarmThroughput | None = None - """ - Represents the warm throughput value (in read units per second and write - units per second) when creating a secondary index. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_GLOBAL_SECONDARY_INDEX_ACTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_GLOBAL_SECONDARY_INDEX_ACTION.members["IndexName"], - self.index_name, - ) - _serialize_key_schema( - serializer, - _SCHEMA_CREATE_GLOBAL_SECONDARY_INDEX_ACTION.members["KeySchema"], - self.key_schema, - ) - serializer.write_struct( - _SCHEMA_CREATE_GLOBAL_SECONDARY_INDEX_ACTION.members["Projection"], - self.projection, - ) - if self.provisioned_throughput is not None: - serializer.write_struct( - _SCHEMA_CREATE_GLOBAL_SECONDARY_INDEX_ACTION.members[ - "ProvisionedThroughput" - ], - self.provisioned_throughput, - ) - - if self.on_demand_throughput is not None: - serializer.write_struct( - _SCHEMA_CREATE_GLOBAL_SECONDARY_INDEX_ACTION.members[ - "OnDemandThroughput" - ], - self.on_demand_throughput, - ) - - if self.warm_throughput is not None: - serializer.write_struct( - _SCHEMA_CREATE_GLOBAL_SECONDARY_INDEX_ACTION.members["WarmThroughput"], - self.warm_throughput, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["index_name"] = de.read_string( - _SCHEMA_CREATE_GLOBAL_SECONDARY_INDEX_ACTION.members[ - "IndexName" - ] - ) - - case 1: - kwargs["key_schema"] = _deserialize_key_schema( - de, - _SCHEMA_CREATE_GLOBAL_SECONDARY_INDEX_ACTION.members[ - "KeySchema" - ], - ) - - case 2: - kwargs["projection"] = Projection.deserialize(de) - - case 3: - kwargs["provisioned_throughput"] = ( - ProvisionedThroughput.deserialize(de) - ) - - case 4: - kwargs["on_demand_throughput"] = OnDemandThroughput.deserialize(de) - - case 5: - kwargs["warm_throughput"] = WarmThroughput.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_GLOBAL_SECONDARY_INDEX_ACTION, consumer=_consumer - ) - if "index_name" not in kwargs: - kwargs["index_name"] = "" - if "key_schema" not in kwargs: - kwargs["key_schema"] = [] - if "projection" not in kwargs: - kwargs["projection"] = Projection._smithy_default() - return kwargs - - -@dataclass(kw_only=True) -class Replica: - """Represents the properties of a replica.""" - - region_name: str | None = None - """The Region where the replica needs to be created.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REPLICA, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.region_name is not None: - serializer.write_string( - _SCHEMA_REPLICA.members["RegionName"], self.region_name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["region_name"] = de.read_string( - _SCHEMA_REPLICA.members["RegionName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_REPLICA, consumer=_consumer) - return kwargs - - -def _serialize_replica_list( - serializer: ShapeSerializer, schema: Schema, value: list[Replica] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_replica_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Replica]: - result: list[Replica] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Replica.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CreateGlobalTableInput: - """Dataclass for CreateGlobalTableInput structure.""" - - global_table_name: str | None = None - """The global table name.""" - - replication_group: list[Replica] | None = None - """The Regions where the global table needs to be created.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_GLOBAL_TABLE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.global_table_name is not None: - serializer.write_string( - _SCHEMA_CREATE_GLOBAL_TABLE_INPUT.members["GlobalTableName"], - self.global_table_name, - ) - - if self.replication_group is not None: - _serialize_replica_list( - serializer, - _SCHEMA_CREATE_GLOBAL_TABLE_INPUT.members["ReplicationGroup"], - self.replication_group, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["global_table_name"] = de.read_string( - _SCHEMA_CREATE_GLOBAL_TABLE_INPUT.members["GlobalTableName"] - ) - - case 1: - kwargs["replication_group"] = _deserialize_replica_list( - de, - _SCHEMA_CREATE_GLOBAL_TABLE_INPUT.members["ReplicationGroup"], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_GLOBAL_TABLE_INPUT, consumer=_consumer) - return kwargs - - -class GlobalTableStatus(UnknownEnumMixin, StrEnum): - CREATING = "CREATING" - ACTIVE = "ACTIVE" - DELETING = "DELETING" - UPDATING = "UPDATING" - - -@dataclass(kw_only=True) -class OnDemandThroughputOverride: - """ - Overrides the on-demand throughput settings for this replica table. If - you don't specify a value for this parameter, it uses the source - table's on-demand throughput settings. - """ - - max_read_request_units: int | None = None - """Maximum number of read request units for the specified replica table.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ON_DEMAND_THROUGHPUT_OVERRIDE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.max_read_request_units is not None: - serializer.write_long( - _SCHEMA_ON_DEMAND_THROUGHPUT_OVERRIDE.members["MaxReadRequestUnits"], - self.max_read_request_units, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["max_read_request_units"] = de.read_long( - _SCHEMA_ON_DEMAND_THROUGHPUT_OVERRIDE.members[ - "MaxReadRequestUnits" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ON_DEMAND_THROUGHPUT_OVERRIDE, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ProvisionedThroughputOverride: - """ - Replica-specific provisioned throughput settings. If not specified, uses - the source table's provisioned throughput settings. - """ - - read_capacity_units: int | None = None - """ - Replica-specific read capacity units. If not specified, uses the source - table's read capacity settings. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PROVISIONED_THROUGHPUT_OVERRIDE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.read_capacity_units is not None: - serializer.write_long( - _SCHEMA_PROVISIONED_THROUGHPUT_OVERRIDE.members["ReadCapacityUnits"], - self.read_capacity_units, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["read_capacity_units"] = de.read_long( - _SCHEMA_PROVISIONED_THROUGHPUT_OVERRIDE.members[ - "ReadCapacityUnits" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PROVISIONED_THROUGHPUT_OVERRIDE, consumer=_consumer - ) - return kwargs - - -class IndexStatus(UnknownEnumMixin, StrEnum): - CREATING = "CREATING" - UPDATING = "UPDATING" - DELETING = "DELETING" - ACTIVE = "ACTIVE" - - -@dataclass(kw_only=True) -class GlobalSecondaryIndexWarmThroughputDescription: - """ - The description of the warm throughput value on a global secondary - index. - """ - - read_units_per_second: int | None = None - """ - Represents warm throughput read units per second value for a global - secondary index. - """ - - write_units_per_second: int | None = None - """ - Represents warm throughput write units per second value for a global - secondary index. - """ - - status: str | None = None - """ - Represents the warm throughput status being created or updated on a - global secondary index. The status can only be `UPDATING` or `ACTIVE`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GLOBAL_SECONDARY_INDEX_WARM_THROUGHPUT_DESCRIPTION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.read_units_per_second is not None: - serializer.write_long( - _SCHEMA_GLOBAL_SECONDARY_INDEX_WARM_THROUGHPUT_DESCRIPTION.members[ - "ReadUnitsPerSecond" - ], - self.read_units_per_second, - ) - - if self.write_units_per_second is not None: - serializer.write_long( - _SCHEMA_GLOBAL_SECONDARY_INDEX_WARM_THROUGHPUT_DESCRIPTION.members[ - "WriteUnitsPerSecond" - ], - self.write_units_per_second, - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_GLOBAL_SECONDARY_INDEX_WARM_THROUGHPUT_DESCRIPTION.members[ - "Status" - ], - self.status, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["read_units_per_second"] = de.read_long( - _SCHEMA_GLOBAL_SECONDARY_INDEX_WARM_THROUGHPUT_DESCRIPTION.members[ - "ReadUnitsPerSecond" - ] - ) - - case 1: - kwargs["write_units_per_second"] = de.read_long( - _SCHEMA_GLOBAL_SECONDARY_INDEX_WARM_THROUGHPUT_DESCRIPTION.members[ - "WriteUnitsPerSecond" - ] - ) - - case 2: - kwargs["status"] = IndexStatus( - de.read_string( - _SCHEMA_GLOBAL_SECONDARY_INDEX_WARM_THROUGHPUT_DESCRIPTION.members[ - "Status" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GLOBAL_SECONDARY_INDEX_WARM_THROUGHPUT_DESCRIPTION, - consumer=_consumer, - ) - return kwargs - - -@dataclass(kw_only=True) -class ReplicaGlobalSecondaryIndexDescription: - """Represents the properties of a replica global secondary index.""" - - index_name: str | None = None - """The name of the global secondary index.""" - - provisioned_throughput_override: ProvisionedThroughputOverride | None = None - """If not described, uses the source table GSI's read capacity settings.""" - - on_demand_throughput_override: OnDemandThroughputOverride | None = None - """ - Overrides the maximum on-demand throughput for the specified global - secondary index in the specified replica table. - """ - - warm_throughput: GlobalSecondaryIndexWarmThroughputDescription | None = None - """ - Represents the warm throughput of the global secondary index for this - replica. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX_DESCRIPTION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.index_name is not None: - serializer.write_string( - _SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX_DESCRIPTION.members["IndexName"], - self.index_name, - ) - - if self.provisioned_throughput_override is not None: - serializer.write_struct( - _SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX_DESCRIPTION.members[ - "ProvisionedThroughputOverride" - ], - self.provisioned_throughput_override, - ) - - if self.on_demand_throughput_override is not None: - serializer.write_struct( - _SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX_DESCRIPTION.members[ - "OnDemandThroughputOverride" - ], - self.on_demand_throughput_override, - ) - - if self.warm_throughput is not None: - serializer.write_struct( - _SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX_DESCRIPTION.members[ - "WarmThroughput" - ], - self.warm_throughput, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["index_name"] = de.read_string( - _SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX_DESCRIPTION.members[ - "IndexName" - ] - ) - - case 1: - kwargs["provisioned_throughput_override"] = ( - ProvisionedThroughputOverride.deserialize(de) - ) - - case 2: - kwargs["on_demand_throughput_override"] = ( - OnDemandThroughputOverride.deserialize(de) - ) - - case 3: - kwargs["warm_throughput"] = ( - GlobalSecondaryIndexWarmThroughputDescription.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX_DESCRIPTION, consumer=_consumer - ) - return kwargs - - -def _serialize_replica_global_secondary_index_description_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[ReplicaGlobalSecondaryIndexDescription], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_replica_global_secondary_index_description_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ReplicaGlobalSecondaryIndexDescription]: - result: list[ReplicaGlobalSecondaryIndexDescription] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ReplicaGlobalSecondaryIndexDescription.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class GlobalTableSettingsReplicationMode(UnknownEnumMixin, StrEnum): - ENABLED = "ENABLED" - DISABLED = "DISABLED" - ENABLED_WITH_OVERRIDES = "ENABLED_WITH_OVERRIDES" - - -class ReplicaStatus(UnknownEnumMixin, StrEnum): - CREATING = "CREATING" - CREATION_FAILED = "CREATION_FAILED" - UPDATING = "UPDATING" - DELETING = "DELETING" - ACTIVE = "ACTIVE" - REGION_DISABLED = "REGION_DISABLED" - INACCESSIBLE_ENCRYPTION_CREDENTIALS = "INACCESSIBLE_ENCRYPTION_CREDENTIALS" - ARCHIVING = "ARCHIVING" - ARCHIVED = "ARCHIVED" - REPLICATION_NOT_AUTHORIZED = "REPLICATION_NOT_AUTHORIZED" - - -class TableClass(UnknownEnumMixin, StrEnum): - STANDARD = "STANDARD" - STANDARD_INFREQUENT_ACCESS = "STANDARD_INFREQUENT_ACCESS" - - -@dataclass(kw_only=True) -class TableClassSummary: - """Contains details of the table class.""" - - table_class: str | None = None - """ - The table class of the specified table. Valid values are `STANDARD` and - `STANDARD_INFREQUENT_ACCESS`. - """ - - last_update_date_time: datetime | None = None - """The date and time at which the table class was last updated.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TABLE_CLASS_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.table_class is not None: - serializer.write_string( - _SCHEMA_TABLE_CLASS_SUMMARY.members["TableClass"], self.table_class - ) - - if self.last_update_date_time is not None: - serializer.write_timestamp( - _SCHEMA_TABLE_CLASS_SUMMARY.members["LastUpdateDateTime"], - self.last_update_date_time, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["table_class"] = TableClass( - de.read_string( - _SCHEMA_TABLE_CLASS_SUMMARY.members["TableClass"] - ) - ) - - case 1: - kwargs["last_update_date_time"] = de.read_timestamp( - _SCHEMA_TABLE_CLASS_SUMMARY.members["LastUpdateDateTime"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TABLE_CLASS_SUMMARY, consumer=_consumer) - return kwargs - - -class TableStatus(UnknownEnumMixin, StrEnum): - CREATING = "CREATING" - UPDATING = "UPDATING" - DELETING = "DELETING" - ACTIVE = "ACTIVE" - INACCESSIBLE_ENCRYPTION_CREDENTIALS = "INACCESSIBLE_ENCRYPTION_CREDENTIALS" - ARCHIVING = "ARCHIVING" - ARCHIVED = "ARCHIVED" - REPLICATION_NOT_AUTHORIZED = "REPLICATION_NOT_AUTHORIZED" - - -@dataclass(kw_only=True) -class TableWarmThroughputDescription: - """ - Represents the warm throughput value (in read units per second and write - units per second) of the table. Warm throughput is applicable for - DynamoDB Standard-IA tables and specifies the minimum provisioned - capacity maintained for immediate data access. - """ - - read_units_per_second: int | None = None - """ - Represents the base table's warm throughput value in read units per - second. - """ - - write_units_per_second: int | None = None - """ - Represents the base table's warm throughput value in write units per - second. - """ - - status: str | None = None - """Represents warm throughput value of the base table.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TABLE_WARM_THROUGHPUT_DESCRIPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.read_units_per_second is not None: - serializer.write_long( - _SCHEMA_TABLE_WARM_THROUGHPUT_DESCRIPTION.members["ReadUnitsPerSecond"], - self.read_units_per_second, - ) - - if self.write_units_per_second is not None: - serializer.write_long( - _SCHEMA_TABLE_WARM_THROUGHPUT_DESCRIPTION.members[ - "WriteUnitsPerSecond" - ], - self.write_units_per_second, - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_TABLE_WARM_THROUGHPUT_DESCRIPTION.members["Status"], self.status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["read_units_per_second"] = de.read_long( - _SCHEMA_TABLE_WARM_THROUGHPUT_DESCRIPTION.members[ - "ReadUnitsPerSecond" - ] - ) - - case 1: - kwargs["write_units_per_second"] = de.read_long( - _SCHEMA_TABLE_WARM_THROUGHPUT_DESCRIPTION.members[ - "WriteUnitsPerSecond" - ] - ) - - case 2: - kwargs["status"] = TableStatus( - de.read_string( - _SCHEMA_TABLE_WARM_THROUGHPUT_DESCRIPTION.members["Status"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_TABLE_WARM_THROUGHPUT_DESCRIPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ReplicaDescription: - """Contains the details of the replica.""" - - region_name: str | None = None - """The name of the Region.""" - - replica_status: str | None = None - """ - The current state of the replica: - - - `CREATING` - The replica is being created. - - - `UPDATING` - The replica is being updated. - - - `DELETING` - The replica is being deleted. - - - `ACTIVE` - The replica is ready for use. - - - `REGION_DISABLED` - The replica is inaccessible because the Amazon Web - Services Region has been disabled. - - Note: - If the Amazon Web Services Region remains inaccessible for more than - 20 hours, DynamoDB will remove this replica from the replication - group. The replica will not be deleted and replication will stop from - and to this region. - - - `INACCESSIBLE_ENCRYPTION_CREDENTIALS ` - The KMS key used to encrypt - the table is inaccessible. - - Note: - If the KMS key remains inaccessible for more than 20 hours, DynamoDB - will remove this replica from the replication group. The replica will - not be deleted and replication will stop from and to this region. - """ - - replica_arn: str | None = None - """The Amazon Resource Name (ARN) of the global table replica.""" - - replica_status_description: str | None = None - """Detailed information about the replica status.""" - - replica_status_percent_progress: str | None = None - """ - Specifies the progress of a Create, Update, or Delete action on the - replica as a percentage. - """ - - kms_master_key_id: str | None = None - """The KMS key of the replica that will be used for KMS encryption.""" - - provisioned_throughput_override: ProvisionedThroughputOverride | None = None - """ - Replica-specific provisioned throughput. If not described, uses the - source table's provisioned throughput settings. - """ - - on_demand_throughput_override: OnDemandThroughputOverride | None = None - """ - Overrides the maximum on-demand throughput settings for the specified - replica table. - """ - - warm_throughput: TableWarmThroughputDescription | None = None - """Represents the warm throughput value for this replica.""" - - global_secondary_indexes: list[ReplicaGlobalSecondaryIndexDescription] | None = None - """Replica-specific global secondary index settings.""" - - replica_inaccessible_date_time: datetime | None = None - """ - The time at which the replica was first detected as inaccessible. To - determine cause of inaccessibility check the `ReplicaStatus` property. - """ - - replica_table_class_summary: TableClassSummary | None = None - """Contains details of the table class.""" - - global_table_settings_replication_mode: str | None = None - """ - Indicates one of the settings synchronization modes for the global table - replica: - - - `ENABLED`: Indicates that the settings synchronization mode for the - global table replica is enabled. - - - `DISABLED`: Indicates that the settings synchronization mode for the - global table replica is disabled. - - - `ENABLED_WITH_OVERRIDES`: This mode is set by default for a same - account global table. Indicates that certain global table settings can - be overridden. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REPLICA_DESCRIPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.region_name is not None: - serializer.write_string( - _SCHEMA_REPLICA_DESCRIPTION.members["RegionName"], self.region_name - ) - - if self.replica_status is not None: - serializer.write_string( - _SCHEMA_REPLICA_DESCRIPTION.members["ReplicaStatus"], - self.replica_status, - ) - - if self.replica_arn is not None: - serializer.write_string( - _SCHEMA_REPLICA_DESCRIPTION.members["ReplicaArn"], self.replica_arn - ) - - if self.replica_status_description is not None: - serializer.write_string( - _SCHEMA_REPLICA_DESCRIPTION.members["ReplicaStatusDescription"], - self.replica_status_description, - ) - - if self.replica_status_percent_progress is not None: - serializer.write_string( - _SCHEMA_REPLICA_DESCRIPTION.members["ReplicaStatusPercentProgress"], - self.replica_status_percent_progress, - ) - - if self.kms_master_key_id is not None: - serializer.write_string( - _SCHEMA_REPLICA_DESCRIPTION.members["KMSMasterKeyId"], - self.kms_master_key_id, - ) - - if self.provisioned_throughput_override is not None: - serializer.write_struct( - _SCHEMA_REPLICA_DESCRIPTION.members["ProvisionedThroughputOverride"], - self.provisioned_throughput_override, - ) - - if self.on_demand_throughput_override is not None: - serializer.write_struct( - _SCHEMA_REPLICA_DESCRIPTION.members["OnDemandThroughputOverride"], - self.on_demand_throughput_override, - ) - - if self.warm_throughput is not None: - serializer.write_struct( - _SCHEMA_REPLICA_DESCRIPTION.members["WarmThroughput"], - self.warm_throughput, - ) - - if self.global_secondary_indexes is not None: - _serialize_replica_global_secondary_index_description_list( - serializer, - _SCHEMA_REPLICA_DESCRIPTION.members["GlobalSecondaryIndexes"], - self.global_secondary_indexes, - ) - - if self.replica_inaccessible_date_time is not None: - serializer.write_timestamp( - _SCHEMA_REPLICA_DESCRIPTION.members["ReplicaInaccessibleDateTime"], - self.replica_inaccessible_date_time, - ) - - if self.replica_table_class_summary is not None: - serializer.write_struct( - _SCHEMA_REPLICA_DESCRIPTION.members["ReplicaTableClassSummary"], - self.replica_table_class_summary, - ) - - if self.global_table_settings_replication_mode is not None: - serializer.write_string( - _SCHEMA_REPLICA_DESCRIPTION.members[ - "GlobalTableSettingsReplicationMode" - ], - self.global_table_settings_replication_mode, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["region_name"] = de.read_string( - _SCHEMA_REPLICA_DESCRIPTION.members["RegionName"] - ) - - case 1: - kwargs["replica_status"] = ReplicaStatus( - de.read_string( - _SCHEMA_REPLICA_DESCRIPTION.members["ReplicaStatus"] - ) - ) - - case 2: - kwargs["replica_arn"] = de.read_string( - _SCHEMA_REPLICA_DESCRIPTION.members["ReplicaArn"] - ) - - case 3: - kwargs["replica_status_description"] = de.read_string( - _SCHEMA_REPLICA_DESCRIPTION.members["ReplicaStatusDescription"] - ) - - case 4: - kwargs["replica_status_percent_progress"] = de.read_string( - _SCHEMA_REPLICA_DESCRIPTION.members[ - "ReplicaStatusPercentProgress" - ] - ) - - case 5: - kwargs["kms_master_key_id"] = de.read_string( - _SCHEMA_REPLICA_DESCRIPTION.members["KMSMasterKeyId"] - ) - - case 6: - kwargs["provisioned_throughput_override"] = ( - ProvisionedThroughputOverride.deserialize(de) - ) - - case 7: - kwargs["on_demand_throughput_override"] = ( - OnDemandThroughputOverride.deserialize(de) - ) - - case 8: - kwargs["warm_throughput"] = ( - TableWarmThroughputDescription.deserialize(de) - ) - - case 9: - kwargs["global_secondary_indexes"] = ( - _deserialize_replica_global_secondary_index_description_list( - de, - _SCHEMA_REPLICA_DESCRIPTION.members[ - "GlobalSecondaryIndexes" - ], - ) - ) - - case 10: - kwargs["replica_inaccessible_date_time"] = de.read_timestamp( - _SCHEMA_REPLICA_DESCRIPTION.members[ - "ReplicaInaccessibleDateTime" - ] - ) - - case 11: - kwargs["replica_table_class_summary"] = ( - TableClassSummary.deserialize(de) - ) - - case 12: - kwargs["global_table_settings_replication_mode"] = ( - GlobalTableSettingsReplicationMode( - de.read_string( - _SCHEMA_REPLICA_DESCRIPTION.members[ - "GlobalTableSettingsReplicationMode" - ] - ) - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_REPLICA_DESCRIPTION, consumer=_consumer) - return kwargs - - -def _serialize_replica_description_list( - serializer: ShapeSerializer, schema: Schema, value: list[ReplicaDescription] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_replica_description_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ReplicaDescription]: - result: list[ReplicaDescription] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ReplicaDescription.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GlobalTableDescription: - """Contains details about the global table.""" - - replication_group: list[ReplicaDescription] | None = None - """The Regions where the global table has replicas.""" - - global_table_arn: str | None = None - """The unique identifier of the global table.""" - - creation_date_time: datetime | None = None - """The creation time of the global table.""" - - global_table_status: str | None = None - """ - The current state of the global table: - - - `CREATING` - The global table is being created. - - - `UPDATING` - The global table is being updated. - - - `DELETING` - The global table is being deleted. - - - `ACTIVE` - The global table is ready for use. - """ - - global_table_name: str | None = None - """The global table name.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GLOBAL_TABLE_DESCRIPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.replication_group is not None: - _serialize_replica_description_list( - serializer, - _SCHEMA_GLOBAL_TABLE_DESCRIPTION.members["ReplicationGroup"], - self.replication_group, - ) - - if self.global_table_arn is not None: - serializer.write_string( - _SCHEMA_GLOBAL_TABLE_DESCRIPTION.members["GlobalTableArn"], - self.global_table_arn, - ) - - if self.creation_date_time is not None: - serializer.write_timestamp( - _SCHEMA_GLOBAL_TABLE_DESCRIPTION.members["CreationDateTime"], - self.creation_date_time, - ) - - if self.global_table_status is not None: - serializer.write_string( - _SCHEMA_GLOBAL_TABLE_DESCRIPTION.members["GlobalTableStatus"], - self.global_table_status, - ) - - if self.global_table_name is not None: - serializer.write_string( - _SCHEMA_GLOBAL_TABLE_DESCRIPTION.members["GlobalTableName"], - self.global_table_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["replication_group"] = _deserialize_replica_description_list( - de, _SCHEMA_GLOBAL_TABLE_DESCRIPTION.members["ReplicationGroup"] - ) - - case 1: - kwargs["global_table_arn"] = de.read_string( - _SCHEMA_GLOBAL_TABLE_DESCRIPTION.members["GlobalTableArn"] - ) - - case 2: - kwargs["creation_date_time"] = de.read_timestamp( - _SCHEMA_GLOBAL_TABLE_DESCRIPTION.members["CreationDateTime"] - ) - - case 3: - kwargs["global_table_status"] = GlobalTableStatus( - de.read_string( - _SCHEMA_GLOBAL_TABLE_DESCRIPTION.members[ - "GlobalTableStatus" - ] - ) - ) - - case 4: - kwargs["global_table_name"] = de.read_string( - _SCHEMA_GLOBAL_TABLE_DESCRIPTION.members["GlobalTableName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GLOBAL_TABLE_DESCRIPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CreateGlobalTableOutput: - """Dataclass for CreateGlobalTableOutput structure.""" - - global_table_description: GlobalTableDescription | None = None - """Contains the details of the global table.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_GLOBAL_TABLE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.global_table_description is not None: - serializer.write_struct( - _SCHEMA_CREATE_GLOBAL_TABLE_OUTPUT.members["GlobalTableDescription"], - self.global_table_description, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["global_table_description"] = ( - GlobalTableDescription.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_GLOBAL_TABLE_OUTPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GlobalTableAlreadyExistsException(ServiceError): - """The specified global table already exists.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GLOBAL_TABLE_ALREADY_EXISTS_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_GLOBAL_TABLE_ALREADY_EXISTS_EXCEPTION.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_GLOBAL_TABLE_ALREADY_EXISTS_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GLOBAL_TABLE_ALREADY_EXISTS_EXCEPTION, consumer=_consumer - ) - return kwargs - - -CREATE_GLOBAL_TABLE = APIOperation( - input=CreateGlobalTableInput, - output=CreateGlobalTableOutput, - schema=_SCHEMA_CREATE_GLOBAL_TABLE, - input_schema=_SCHEMA_CREATE_GLOBAL_TABLE_INPUT, - output_schema=_SCHEMA_CREATE_GLOBAL_TABLE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.dynamodb#GlobalTableAlreadyExistsException" - ): GlobalTableAlreadyExistsException, - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#InvalidEndpointException" - ): InvalidEndpointException, - ShapeID( - "com.amazonaws.dynamodb#LimitExceededException" - ): LimitExceededException, - ShapeID( - "com.amazonaws.dynamodb#TableNotFoundException" - ): TableNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_GLOBAL_TABLE_ALREADY_EXISTS_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR, - _SCHEMA_INVALID_ENDPOINT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_TABLE_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class CreateGlobalTableWitnessGroupMemberAction: - """ - Specifies the action to add a new witness Region to a MRSC global table. - A MRSC global table can be configured with either three replicas, or - with two replicas and one witness. - """ - - region_name: str - """ - The Amazon Web Services Region name to be added as a witness Region for - the MRSC global table. The witness must be in a different Region than - the replicas and within the same Region set: - - - US Region set: US East (N. Virginia), US East (Ohio), US West (Oregon) - - - EU Region set: Europe (Ireland), Europe (London), Europe (Paris), - Europe (Frankfurt) - - - AP Region set: Asia Pacific (Tokyo), Asia Pacific (Seoul), Asia - Pacific (Osaka) - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CREATE_GLOBAL_TABLE_WITNESS_GROUP_MEMBER_ACTION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_GLOBAL_TABLE_WITNESS_GROUP_MEMBER_ACTION.members[ - "RegionName" - ], - self.region_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["region_name"] = de.read_string( - _SCHEMA_CREATE_GLOBAL_TABLE_WITNESS_GROUP_MEMBER_ACTION.members[ - "RegionName" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_GLOBAL_TABLE_WITNESS_GROUP_MEMBER_ACTION, consumer=_consumer - ) - if "region_name" not in kwargs: - kwargs["region_name"] = "" - return kwargs - - -@dataclass(kw_only=True) -class CreateReplicaAction: - """Represents a replica to be added.""" - - region_name: str - """The Region of the replica to be added.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_REPLICA_ACTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_REPLICA_ACTION.members["RegionName"], self.region_name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["region_name"] = de.read_string( - _SCHEMA_CREATE_REPLICA_ACTION.members["RegionName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_REPLICA_ACTION, consumer=_consumer) - if "region_name" not in kwargs: - kwargs["region_name"] = "" - return kwargs - - -@dataclass(kw_only=True) -class ReplicaGlobalSecondaryIndex: - """Represents the properties of a replica global secondary index.""" - - index_name: str - """The name of the global secondary index.""" - - provisioned_throughput_override: ProvisionedThroughputOverride | None = None - """ - Replica table GSI-specific provisioned throughput. If not specified, - uses the source table GSI's read capacity settings. - """ - - on_demand_throughput_override: OnDemandThroughputOverride | None = None - """ - Overrides the maximum on-demand throughput settings for the specified - global secondary index in the specified replica table. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX.members["IndexName"], self.index_name - ) - if self.provisioned_throughput_override is not None: - serializer.write_struct( - _SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX.members[ - "ProvisionedThroughputOverride" - ], - self.provisioned_throughput_override, - ) - - if self.on_demand_throughput_override is not None: - serializer.write_struct( - _SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX.members[ - "OnDemandThroughputOverride" - ], - self.on_demand_throughput_override, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["index_name"] = de.read_string( - _SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX.members["IndexName"] - ) - - case 1: - kwargs["provisioned_throughput_override"] = ( - ProvisionedThroughputOverride.deserialize(de) - ) - - case 2: - kwargs["on_demand_throughput_override"] = ( - OnDemandThroughputOverride.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX, consumer=_consumer - ) - if "index_name" not in kwargs: - kwargs["index_name"] = "" - return kwargs - - -def _serialize_replica_global_secondary_index_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[ReplicaGlobalSecondaryIndex], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_replica_global_secondary_index_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ReplicaGlobalSecondaryIndex]: - result: list[ReplicaGlobalSecondaryIndex] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ReplicaGlobalSecondaryIndex.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CreateReplicationGroupMemberAction: - """Represents a replica to be created.""" - - region_name: str - """The Region where the new replica will be created.""" - - kms_master_key_id: str | None = None - """ - The KMS key that should be used for KMS encryption in the new replica. - To specify a key, use its key ID, Amazon Resource Name (ARN), alias - name, or alias ARN. Note that you should only provide this parameter if - the key is different from the default DynamoDB KMS key - `alias/aws/dynamodb`. - """ - - provisioned_throughput_override: ProvisionedThroughputOverride | None = None - """ - Replica-specific provisioned throughput. If not specified, uses the - source table's provisioned throughput settings. - """ - - on_demand_throughput_override: OnDemandThroughputOverride | None = None - """ - The maximum on-demand throughput settings for the specified replica - table being created. You can only modify `MaxReadRequestUnits`, because - you can't modify `MaxWriteRequestUnits` for individual replica tables. - """ - - global_secondary_indexes: list[ReplicaGlobalSecondaryIndex] | None = None - """Replica-specific global secondary index settings.""" - - table_class_override: str | None = None - """ - Replica-specific table class. If not specified, uses the source table's - table class. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_REPLICATION_GROUP_MEMBER_ACTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_REPLICATION_GROUP_MEMBER_ACTION.members["RegionName"], - self.region_name, - ) - if self.kms_master_key_id is not None: - serializer.write_string( - _SCHEMA_CREATE_REPLICATION_GROUP_MEMBER_ACTION.members[ - "KMSMasterKeyId" - ], - self.kms_master_key_id, - ) - - if self.provisioned_throughput_override is not None: - serializer.write_struct( - _SCHEMA_CREATE_REPLICATION_GROUP_MEMBER_ACTION.members[ - "ProvisionedThroughputOverride" - ], - self.provisioned_throughput_override, - ) - - if self.on_demand_throughput_override is not None: - serializer.write_struct( - _SCHEMA_CREATE_REPLICATION_GROUP_MEMBER_ACTION.members[ - "OnDemandThroughputOverride" - ], - self.on_demand_throughput_override, - ) - - if self.global_secondary_indexes is not None: - _serialize_replica_global_secondary_index_list( - serializer, - _SCHEMA_CREATE_REPLICATION_GROUP_MEMBER_ACTION.members[ - "GlobalSecondaryIndexes" - ], - self.global_secondary_indexes, - ) - - if self.table_class_override is not None: - serializer.write_string( - _SCHEMA_CREATE_REPLICATION_GROUP_MEMBER_ACTION.members[ - "TableClassOverride" - ], - self.table_class_override, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["region_name"] = de.read_string( - _SCHEMA_CREATE_REPLICATION_GROUP_MEMBER_ACTION.members[ - "RegionName" - ] - ) - - case 1: - kwargs["kms_master_key_id"] = de.read_string( - _SCHEMA_CREATE_REPLICATION_GROUP_MEMBER_ACTION.members[ - "KMSMasterKeyId" - ] - ) - - case 2: - kwargs["provisioned_throughput_override"] = ( - ProvisionedThroughputOverride.deserialize(de) - ) - - case 3: - kwargs["on_demand_throughput_override"] = ( - OnDemandThroughputOverride.deserialize(de) - ) - - case 4: - kwargs["global_secondary_indexes"] = ( - _deserialize_replica_global_secondary_index_list( - de, - _SCHEMA_CREATE_REPLICATION_GROUP_MEMBER_ACTION.members[ - "GlobalSecondaryIndexes" - ], - ) - ) - - case 5: - kwargs["table_class_override"] = TableClass( - de.read_string( - _SCHEMA_CREATE_REPLICATION_GROUP_MEMBER_ACTION.members[ - "TableClassOverride" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_REPLICATION_GROUP_MEMBER_ACTION, consumer=_consumer - ) - if "region_name" not in kwargs: - kwargs["region_name"] = "" - return kwargs - - -@dataclass(kw_only=True) -class GlobalSecondaryIndex: - """Represents the properties of a global secondary index.""" - - index_name: str - """ - The name of the global secondary index. The name must be unique among - all other indexes on this table. - """ - - key_schema: list[KeySchemaElement] - """ - The complete key schema for a global secondary index, which consists of - one or more pairs of attribute names and key types: - - - `HASH` - partition key - - - `RANGE` - sort key - - Note: - The partition key of an item is also known as its *hash attribute*. The - term \"hash attribute\" derives from DynamoDB's usage of an internal - hash function to evenly distribute data items across partitions, based - on their partition key values. - - The sort key of an item is also known as its *range attribute*. The term - \"range attribute\" derives from the way DynamoDB stores items with the - same partition key physically close together, in sorted order by the - sort key value. - """ - - projection: Projection - """ - Represents attributes that are copied (projected) from the table into - the global secondary index. These are in addition to the primary key - attributes and index key attributes, which are automatically projected. - """ - - provisioned_throughput: ProvisionedThroughput | None = None - """ - Represents the provisioned throughput settings for the specified global - secondary index. You must use either `OnDemandThroughput` or - `ProvisionedThroughput` based on your table's capacity mode. - - For current minimum and maximum provisioned throughput values, see - [Service, Account, and Table - Quotas](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - on_demand_throughput: OnDemandThroughput | None = None - """ - The maximum number of read and write units for the specified global - secondary index. If you use this parameter, you must specify - `MaxReadRequestUnits`, `MaxWriteRequestUnits`, or both. You must use - either `OnDemandThroughput` or `ProvisionedThroughput` based on your - table's capacity mode. - """ - - warm_throughput: WarmThroughput | None = None - """ - Represents the warm throughput value (in read units per second and write - units per second) for the specified secondary index. If you use this - parameter, you must specify `ReadUnitsPerSecond`, `WriteUnitsPerSecond`, - or both. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GLOBAL_SECONDARY_INDEX, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GLOBAL_SECONDARY_INDEX.members["IndexName"], self.index_name - ) - _serialize_key_schema( - serializer, - _SCHEMA_GLOBAL_SECONDARY_INDEX.members["KeySchema"], - self.key_schema, - ) - serializer.write_struct( - _SCHEMA_GLOBAL_SECONDARY_INDEX.members["Projection"], self.projection - ) - if self.provisioned_throughput is not None: - serializer.write_struct( - _SCHEMA_GLOBAL_SECONDARY_INDEX.members["ProvisionedThroughput"], - self.provisioned_throughput, - ) - - if self.on_demand_throughput is not None: - serializer.write_struct( - _SCHEMA_GLOBAL_SECONDARY_INDEX.members["OnDemandThroughput"], - self.on_demand_throughput, - ) - - if self.warm_throughput is not None: - serializer.write_struct( - _SCHEMA_GLOBAL_SECONDARY_INDEX.members["WarmThroughput"], - self.warm_throughput, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["index_name"] = de.read_string( - _SCHEMA_GLOBAL_SECONDARY_INDEX.members["IndexName"] - ) - - case 1: - kwargs["key_schema"] = _deserialize_key_schema( - de, _SCHEMA_GLOBAL_SECONDARY_INDEX.members["KeySchema"] - ) - - case 2: - kwargs["projection"] = Projection.deserialize(de) - - case 3: - kwargs["provisioned_throughput"] = ( - ProvisionedThroughput.deserialize(de) - ) - - case 4: - kwargs["on_demand_throughput"] = OnDemandThroughput.deserialize(de) - - case 5: - kwargs["warm_throughput"] = WarmThroughput.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GLOBAL_SECONDARY_INDEX, consumer=_consumer) - if "index_name" not in kwargs: - kwargs["index_name"] = "" - if "key_schema" not in kwargs: - kwargs["key_schema"] = [] - if "projection" not in kwargs: - kwargs["projection"] = Projection._smithy_default() - return kwargs - - -def _serialize_global_secondary_index_list( - serializer: ShapeSerializer, schema: Schema, value: list[GlobalSecondaryIndex] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_global_secondary_index_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GlobalSecondaryIndex]: - result: list[GlobalSecondaryIndex] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GlobalSecondaryIndex.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class LocalSecondaryIndex: - """Represents the properties of a local secondary index.""" - - index_name: str - """ - The name of the local secondary index. The name must be unique among all - other indexes on this table. - """ - - key_schema: list[KeySchemaElement] - """ - The complete key schema for the local secondary index, consisting of one - or more pairs of attribute names and key types: - - - `HASH` - partition key - - - `RANGE` - sort key - - Note: - The partition key of an item is also known as its *hash attribute*. The - term \"hash attribute\" derives from DynamoDB's usage of an internal - hash function to evenly distribute data items across partitions, based - on their partition key values. - - The sort key of an item is also known as its *range attribute*. The term - \"range attribute\" derives from the way DynamoDB stores items with the - same partition key physically close together, in sorted order by the - sort key value. - """ - - projection: Projection - """ - Represents attributes that are copied (projected) from the table into - the local secondary index. These are in addition to the primary key - attributes and index key attributes, which are automatically projected. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LOCAL_SECONDARY_INDEX, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_LOCAL_SECONDARY_INDEX.members["IndexName"], self.index_name - ) - _serialize_key_schema( - serializer, - _SCHEMA_LOCAL_SECONDARY_INDEX.members["KeySchema"], - self.key_schema, - ) - serializer.write_struct( - _SCHEMA_LOCAL_SECONDARY_INDEX.members["Projection"], self.projection - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["index_name"] = de.read_string( - _SCHEMA_LOCAL_SECONDARY_INDEX.members["IndexName"] - ) - - case 1: - kwargs["key_schema"] = _deserialize_key_schema( - de, _SCHEMA_LOCAL_SECONDARY_INDEX.members["KeySchema"] - ) - - case 2: - kwargs["projection"] = Projection.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LOCAL_SECONDARY_INDEX, consumer=_consumer) - if "index_name" not in kwargs: - kwargs["index_name"] = "" - if "key_schema" not in kwargs: - kwargs["key_schema"] = [] - if "projection" not in kwargs: - kwargs["projection"] = Projection._smithy_default() - return kwargs - - -def _serialize_local_secondary_index_list( - serializer: ShapeSerializer, schema: Schema, value: list[LocalSecondaryIndex] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_local_secondary_index_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[LocalSecondaryIndex]: - result: list[LocalSecondaryIndex] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(LocalSecondaryIndex.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class SSESpecification: - """Represents the settings used to enable server-side encryption.""" - - enabled: bool | None = None - """ - Indicates whether server-side encryption is done using an Amazon Web - Services managed key or an Amazon Web Services owned key. If enabled - (true), server-side encryption type is set to `KMS` and an Amazon Web - Services managed key is used (KMS charges apply). If disabled (false) or - not specified, server-side encryption is set to Amazon Web Services - owned key. - """ - - sse_type: str | None = None - """ - Server-side encryption type. The only supported value is: - - - `KMS` - Server-side encryption that uses Key Management Service. The - key is stored in your account and is managed by KMS (KMS charges - apply). - """ - - kms_master_key_id: str | None = None - """ - The KMS key that should be used for the KMS encryption. To specify a - key, use its key ID, Amazon Resource Name (ARN), alias name, or alias - ARN. Note that you should only provide this parameter if the key is - different from the default DynamoDB key `alias/aws/dynamodb`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SSE_SPECIFICATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.enabled is not None: - serializer.write_boolean( - _SCHEMA_SSE_SPECIFICATION.members["Enabled"], self.enabled - ) - - if self.sse_type is not None: - serializer.write_string( - _SCHEMA_SSE_SPECIFICATION.members["SSEType"], self.sse_type - ) - - if self.kms_master_key_id is not None: - serializer.write_string( - _SCHEMA_SSE_SPECIFICATION.members["KMSMasterKeyId"], - self.kms_master_key_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["enabled"] = de.read_boolean( - _SCHEMA_SSE_SPECIFICATION.members["Enabled"] - ) - - case 1: - kwargs["sse_type"] = SSEType( - de.read_string(_SCHEMA_SSE_SPECIFICATION.members["SSEType"]) - ) - - case 2: - kwargs["kms_master_key_id"] = de.read_string( - _SCHEMA_SSE_SPECIFICATION.members["KMSMasterKeyId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SSE_SPECIFICATION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Tag: - """ - Describes a tag. A tag is a key-value pair. You can add up to 50 tags to - a single DynamoDB table. - - Amazon Web Services-assigned tag names and values are automatically - assigned the `aws:` prefix, which the user cannot assign. Amazon Web - Services-assigned tag names do not count towards the tag limit of 50. - User-assigned tag names have the prefix `user:` in the Cost Allocation - Report. You cannot backdate the application of a tag. - - For an overview on tagging DynamoDB resources, see [Tagging for - DynamoDB](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tagging.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - key: str - """ - The key of the tag. Tag keys are case sensitive. Each DynamoDB table can - only have up to one tag with the same key. If you try to add an existing - tag (same key), the existing tag value will be updated to the new value. - """ - - value: str - """The value of the tag. Tag values are case-sensitive and can be null.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TAG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_TAG.members["Key"], self.key) - serializer.write_string(_SCHEMA_TAG.members["Value"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["key"] = de.read_string(_SCHEMA_TAG.members["Key"]) - - case 1: - kwargs["value"] = de.read_string(_SCHEMA_TAG.members["Value"]) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TAG, consumer=_consumer) - if "key" not in kwargs: - kwargs["key"] = "" - if "value" not in kwargs: - kwargs["value"] = "" - return kwargs - - -def _serialize_tag_list( - serializer: ShapeSerializer, schema: Schema, value: list[Tag] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_tag_list(deserializer: ShapeDeserializer, schema: Schema) -> list[Tag]: - result: list[Tag] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Tag.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class VectorIndex: - """ - Contains the configuration settings for a vector index, including the - index name, vector attribute, dimensions, distance function, search - schema, and projection. - """ - - index_name: str - """The name of the vector index.""" - - vector_attribute: VectorAttributeDefinition - """The vector attribute configuration for the index.""" - - projection: Projection - """ - Specifies attributes that are copied (projected) from the table into the - vector index. - """ - - dimensions: int - """The number of dimensions in each vector.""" - - distance_function: str - """ - The distance function used to calculate similarity between vectors. - Valid values: `COSINE`, `EUCLIDEAN`, `DOT_PRODUCT`. - """ - - search_schema: list[SearchSchemaElement] | None = None - """ - The search schema that defines partition key and inline filter - attributes for the vector index. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VECTOR_INDEX, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_VECTOR_INDEX.members["IndexName"], self.index_name - ) - serializer.write_struct( - _SCHEMA_VECTOR_INDEX.members["VectorAttribute"], self.vector_attribute - ) - if self.search_schema is not None: - _serialize_search_schema( - serializer, - _SCHEMA_VECTOR_INDEX.members["SearchSchema"], - self.search_schema, - ) - - serializer.write_struct( - _SCHEMA_VECTOR_INDEX.members["Projection"], self.projection - ) - serializer.write_long( - _SCHEMA_VECTOR_INDEX.members["Dimensions"], self.dimensions - ) - serializer.write_string( - _SCHEMA_VECTOR_INDEX.members["DistanceFunction"], self.distance_function - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["index_name"] = de.read_string( - _SCHEMA_VECTOR_INDEX.members["IndexName"] - ) - - case 1: - kwargs["vector_attribute"] = VectorAttributeDefinition.deserialize( - de - ) - - case 2: - kwargs["search_schema"] = _deserialize_search_schema( - de, _SCHEMA_VECTOR_INDEX.members["SearchSchema"] - ) - - case 3: - kwargs["projection"] = Projection.deserialize(de) - - case 4: - kwargs["dimensions"] = de.read_long( - _SCHEMA_VECTOR_INDEX.members["Dimensions"] - ) - - case 5: - kwargs["distance_function"] = VectorDistanceFunction( - de.read_string(_SCHEMA_VECTOR_INDEX.members["DistanceFunction"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VECTOR_INDEX, consumer=_consumer) - if "index_name" not in kwargs: - kwargs["index_name"] = "" - if "vector_attribute" not in kwargs: - kwargs["vector_attribute"] = VectorAttributeDefinition._smithy_default() - if "projection" not in kwargs: - kwargs["projection"] = Projection._smithy_default() - if "dimensions" not in kwargs: - kwargs["dimensions"] = 0 - if "distance_function" not in kwargs: - kwargs["distance_function"] = VectorDistanceFunction._corrected("") - return kwargs - - -def _serialize_vector_index_list( - serializer: ShapeSerializer, schema: Schema, value: list[VectorIndex] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_vector_index_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[VectorIndex]: - result: list[VectorIndex] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(VectorIndex.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CreateTableInput: - """Represents the input of a `CreateTable` operation.""" - - attribute_definitions: list[AttributeDefinition] | None = None - """ - An array of attributes that describe the key schema for the table and - indexes. - """ - - table_name: str | None = None - """ - The name of the table to create. You can also provide the Amazon - Resource Name (ARN) of the table in this parameter. - """ - - key_schema: list[KeySchemaElement] | None = None - """ - Specifies the attributes that make up the primary key for a table or an - index. The attributes in `KeySchema` must also be defined in the - `AttributeDefinitions` array. For more information, see [Data - Model](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataModel.html) - in the *Amazon DynamoDB Developer Guide*. - - Each `KeySchemaElement` in the array is composed of: - - - `AttributeName` - The name of this key attribute. - - - `KeyType` - The role that the key attribute will assume: - - - `HASH` - partition key - - - `RANGE` - sort key - - Note: - The partition key of an item is also known as its *hash attribute*. The - term \"hash attribute\" derives from the DynamoDB usage of an internal - hash function to evenly distribute data items across partitions, based - on their partition key values. - - The sort key of an item is also known as its *range attribute*. The term - \"range attribute\" derives from the way DynamoDB stores items with the - same partition key physically close together, in sorted order by the - sort key value. - - For a simple primary key (partition key), you must provide exactly one - element with a `KeyType` of `HASH`. - - For a composite primary key (partition key and sort key), you must - provide exactly two elements, in this order: The first element must have - a `KeyType` of `HASH`, and the second element must have a `KeyType` of - `RANGE`. - - For more information, see [Working with - Tables](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#WorkingWithTables.primary.key) - in the *Amazon DynamoDB Developer Guide*. - """ - - local_secondary_indexes: list[LocalSecondaryIndex] | None = None - """ - One or more local secondary indexes (the maximum is 5) to be created on - the table. Each index is scoped to a given partition key value. There is - a 10 GB size limit per partition key value; otherwise, the size of a - local secondary index is unconstrained. - - Each local secondary index in the array includes the following: - - - `IndexName` - The name of the local secondary index. Must be unique - only for this table. - - - `KeySchema` - Specifies the key schema for the local secondary index. - The key schema must begin with the same partition key as the table. - - - `Projection` - Specifies attributes that are copied (projected) from - the table into the index. These are in addition to the primary key - attributes and index key attributes, which are automatically - projected. Each attribute specification is composed of: - - - `ProjectionType` - One of the following: - - - `KEYS_ONLY` - Only the index and primary keys are projected into - the index. - - - `INCLUDE` - Only the specified table attributes are projected into - the index. The list of projected attributes is in - `NonKeyAttributes`. - - - `ALL` - All of the table attributes are projected into the index. - - - `NonKeyAttributes` - A list of one or more non-key attribute names - that are projected into the secondary index. The total count of - attributes provided in `NonKeyAttributes`, summed across all of the - secondary indexes, must not exceed 100. If you project the same - attribute into two different indexes, this counts as two distinct - attributes when determining the total. This limit only applies when - you specify the ProjectionType of `INCLUDE`. You still can specify - the ProjectionType of `ALL` to project all attributes from the - source table, even if the table has more than 100 attributes. - """ - - global_secondary_indexes: list[GlobalSecondaryIndex] | None = None - """ - One or more global secondary indexes (the maximum is 20) to be created - on the table. Each global secondary index in the array includes the - following: - - - `IndexName` - The name of the global secondary index. Must be unique - only for this table. - - - `KeySchema` - Specifies the key schema for the global secondary index. - Each global secondary index supports up to 4 partition keys and up to - 4 sort keys. - - - `Projection` - Specifies attributes that are copied (projected) from - the table into the index. These are in addition to the primary key - attributes and index key attributes, which are automatically - projected. Each attribute specification is composed of: - - - `ProjectionType` - One of the following: - - - `KEYS_ONLY` - Only the index and primary keys are projected into - the index. - - - `INCLUDE` - Only the specified table attributes are projected into - the index. The list of projected attributes is in - `NonKeyAttributes`. - - - `ALL` - All of the table attributes are projected into the index. - - - `NonKeyAttributes` - A list of one or more non-key attribute names - that are projected into the secondary index. The total count of - attributes provided in `NonKeyAttributes`, summed across all of the - secondary indexes, must not exceed 100. If you project the same - attribute into two different indexes, this counts as two distinct - attributes when determining the total. This limit only applies when - you specify the ProjectionType of `INCLUDE`. You still can specify - the ProjectionType of `ALL` to project all attributes from the - source table, even if the table has more than 100 attributes. - - - `ProvisionedThroughput` - The provisioned throughput settings for the - global secondary index, consisting of read and write capacity units. - """ - - billing_mode: str | None = None - """ - Controls how you are charged for read and write throughput and how you - manage capacity. This setting can be changed later. - - - `PAY_PER_REQUEST` - We recommend using `PAY_PER_REQUEST` for most - DynamoDB workloads. `PAY_PER_REQUEST` sets the billing mode to - [On-demand capacity - mode](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/on-demand-capacity-mode.html). - - - `PROVISIONED` - We recommend using `PROVISIONED` for steady workloads - with predictable growth where capacity requirements can be reliably - forecasted. `PROVISIONED` sets the billing mode to [Provisioned - capacity - mode](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/provisioned-capacity-mode.html). - """ - - provisioned_throughput: ProvisionedThroughput | None = None - """ - Represents the provisioned throughput settings for a specified table or - index. The settings can be modified using the `UpdateTable` operation. - - If you set BillingMode as `PROVISIONED`, you must specify this property. - If you set BillingMode as `PAY_PER_REQUEST`, you cannot specify this - property. - - For current minimum and maximum provisioned throughput values, see - [Service, Account, and Table - Quotas](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - stream_specification: StreamSpecification | None = None - """ - The settings for DynamoDB Streams on the table. These settings consist - of: - - - `StreamEnabled` - Indicates whether DynamoDB Streams is to be enabled - (true) or disabled (false). - - - `StreamViewType` - When an item in the table is modified, - `StreamViewType` determines what information is written to the - table's stream. Valid values for `StreamViewType` are: - - - `KEYS_ONLY` - Only the key attributes of the modified item are - written to the stream. - - - `NEW_IMAGE` - The entire item, as it appears after it was modified, - is written to the stream. - - - `OLD_IMAGE` - The entire item, as it appeared before it was - modified, is written to the stream. - - - `NEW_AND_OLD_IMAGES` - Both the new and the old item images of the - item are written to the stream. - """ - - sse_specification: SSESpecification | None = None - """Represents the settings used to enable server-side encryption.""" - - tags: list[Tag] | None = None - """ - A list of key-value pairs to label the table. For more information, see - [Tagging for - DynamoDB](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tagging.html). - """ - - table_class: str | None = None - """ - The table class of the new table. Valid values are `STANDARD` and - `STANDARD_INFREQUENT_ACCESS`. - """ - - deletion_protection_enabled: bool | None = None - """ - Indicates whether deletion protection is to be enabled (true) or - disabled (false) on the table. - """ - - warm_throughput: WarmThroughput | None = None - """ - Represents the warm throughput (in read units per second and write units - per second) for creating a table. - """ - - resource_policy: str | None = None - """ - An Amazon Web Services resource-based policy document in JSON format - that will be attached to the table. - - When you attach a resource-based policy while creating a table, the - policy application is *strongly consistent*. - - The maximum size supported for a resource-based policy document is 20 - KB. DynamoDB counts whitespaces when calculating the size of a policy - against this limit. For a full list of all considerations that apply for - resource-based policies, see [Resource-based policy - considerations](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/rbac-considerations.html). - - Note: - You need to specify the `CreateTable` and `PutResourcePolicy` IAM - actions for authorizing a user to create a table with a resource-based - policy. - """ - - on_demand_throughput: OnDemandThroughput | None = None - """ - Sets the maximum number of read and write units for the specified table - in on-demand capacity mode. If you use this parameter, you must specify - `MaxReadRequestUnits`, `MaxWriteRequestUnits`, or both. - """ - - global_table_source_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the source table used for the creation - of a multi-account global table. - """ - - global_table_settings_replication_mode: str | None = None - """ - Controls the settings synchronization mode for the global table. For - multi-account global tables, this parameter is required and the only - supported value is ENABLED. For same-account global tables, this - parameter is set to ENABLED_WITH_OVERRIDES. - """ - - vector_indexes: list[VectorIndex] | None = None - """ - One or more vector indexes to be created on the table. Each vector index - enables similarity search on a vector attribute. Each element in the - list consists of: - - - `IndexName` - The name of the vector index. Must be unique within the - table. - - - `VectorAttribute` - The attribute that contains vector embeddings. If - multiple vector indexes reference the same attribute, they must all - use the same number of dimensions. - - - `Dimensions` - The number of dimensions in each vector. - - - `DistanceFunction` - The distance function used to calculate - similarity. Valid values: `COSINE`, `EUCLIDEAN`, `DOT_PRODUCT`. - - - `Projection` - Specifies attributes that are copied (projected) from - the table into the vector index. The total number of projected non-key - attributes is shared across the vector attribute (counts as 1) and - `INLINE_FILTER` search schema elements (each counts as 1). `HASH` - search schema elements do not count toward this limit. - - - `SearchSchema` - (Optional) Defines the partition key (`HASH`) and - inline filter (`INLINE_FILTER`) attributes for the vector index. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_TABLE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.attribute_definitions is not None: - _serialize_attribute_definitions( - serializer, - _SCHEMA_CREATE_TABLE_INPUT.members["AttributeDefinitions"], - self.attribute_definitions, - ) - - if self.table_name is not None: - serializer.write_string( - _SCHEMA_CREATE_TABLE_INPUT.members["TableName"], self.table_name - ) - - if self.key_schema is not None: - _serialize_key_schema( - serializer, - _SCHEMA_CREATE_TABLE_INPUT.members["KeySchema"], - self.key_schema, - ) - - if self.local_secondary_indexes is not None: - _serialize_local_secondary_index_list( - serializer, - _SCHEMA_CREATE_TABLE_INPUT.members["LocalSecondaryIndexes"], - self.local_secondary_indexes, - ) - - if self.global_secondary_indexes is not None: - _serialize_global_secondary_index_list( - serializer, - _SCHEMA_CREATE_TABLE_INPUT.members["GlobalSecondaryIndexes"], - self.global_secondary_indexes, - ) - - if self.billing_mode is not None: - serializer.write_string( - _SCHEMA_CREATE_TABLE_INPUT.members["BillingMode"], self.billing_mode - ) - - if self.provisioned_throughput is not None: - serializer.write_struct( - _SCHEMA_CREATE_TABLE_INPUT.members["ProvisionedThroughput"], - self.provisioned_throughput, - ) - - if self.stream_specification is not None: - serializer.write_struct( - _SCHEMA_CREATE_TABLE_INPUT.members["StreamSpecification"], - self.stream_specification, - ) - - if self.sse_specification is not None: - serializer.write_struct( - _SCHEMA_CREATE_TABLE_INPUT.members["SSESpecification"], - self.sse_specification, - ) - - if self.tags is not None: - _serialize_tag_list( - serializer, _SCHEMA_CREATE_TABLE_INPUT.members["Tags"], self.tags - ) - - if self.table_class is not None: - serializer.write_string( - _SCHEMA_CREATE_TABLE_INPUT.members["TableClass"], self.table_class - ) - - if self.deletion_protection_enabled is not None: - serializer.write_boolean( - _SCHEMA_CREATE_TABLE_INPUT.members["DeletionProtectionEnabled"], - self.deletion_protection_enabled, - ) - - if self.warm_throughput is not None: - serializer.write_struct( - _SCHEMA_CREATE_TABLE_INPUT.members["WarmThroughput"], - self.warm_throughput, - ) - - if self.resource_policy is not None: - serializer.write_string( - _SCHEMA_CREATE_TABLE_INPUT.members["ResourcePolicy"], - self.resource_policy, - ) - - if self.on_demand_throughput is not None: - serializer.write_struct( - _SCHEMA_CREATE_TABLE_INPUT.members["OnDemandThroughput"], - self.on_demand_throughput, - ) - - if self.global_table_source_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_TABLE_INPUT.members["GlobalTableSourceArn"], - self.global_table_source_arn, - ) - - if self.global_table_settings_replication_mode is not None: - serializer.write_string( - _SCHEMA_CREATE_TABLE_INPUT.members[ - "GlobalTableSettingsReplicationMode" - ], - self.global_table_settings_replication_mode, - ) - - if self.vector_indexes is not None: - _serialize_vector_index_list( - serializer, - _SCHEMA_CREATE_TABLE_INPUT.members["VectorIndexes"], - self.vector_indexes, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["attribute_definitions"] = ( - _deserialize_attribute_definitions( - de, - _SCHEMA_CREATE_TABLE_INPUT.members["AttributeDefinitions"], - ) - ) - - case 1: - kwargs["table_name"] = de.read_string( - _SCHEMA_CREATE_TABLE_INPUT.members["TableName"] - ) - - case 2: - kwargs["key_schema"] = _deserialize_key_schema( - de, _SCHEMA_CREATE_TABLE_INPUT.members["KeySchema"] - ) - - case 3: - kwargs["local_secondary_indexes"] = ( - _deserialize_local_secondary_index_list( - de, - _SCHEMA_CREATE_TABLE_INPUT.members["LocalSecondaryIndexes"], - ) - ) - - case 4: - kwargs["global_secondary_indexes"] = ( - _deserialize_global_secondary_index_list( - de, - _SCHEMA_CREATE_TABLE_INPUT.members[ - "GlobalSecondaryIndexes" - ], - ) - ) - - case 5: - kwargs["billing_mode"] = BillingMode( - de.read_string( - _SCHEMA_CREATE_TABLE_INPUT.members["BillingMode"] - ) - ) - - case 6: - kwargs["provisioned_throughput"] = ( - ProvisionedThroughput.deserialize(de) - ) - - case 7: - kwargs["stream_specification"] = StreamSpecification.deserialize(de) - - case 8: - kwargs["sse_specification"] = SSESpecification.deserialize(de) - - case 9: - kwargs["tags"] = _deserialize_tag_list( - de, _SCHEMA_CREATE_TABLE_INPUT.members["Tags"] - ) - - case 10: - kwargs["table_class"] = TableClass( - de.read_string(_SCHEMA_CREATE_TABLE_INPUT.members["TableClass"]) - ) - - case 11: - kwargs["deletion_protection_enabled"] = de.read_boolean( - _SCHEMA_CREATE_TABLE_INPUT.members["DeletionProtectionEnabled"] - ) - - case 12: - kwargs["warm_throughput"] = WarmThroughput.deserialize(de) - - case 13: - kwargs["resource_policy"] = de.read_string( - _SCHEMA_CREATE_TABLE_INPUT.members["ResourcePolicy"] - ) - - case 14: - kwargs["on_demand_throughput"] = OnDemandThroughput.deserialize(de) - - case 15: - kwargs["global_table_source_arn"] = de.read_string( - _SCHEMA_CREATE_TABLE_INPUT.members["GlobalTableSourceArn"] - ) - - case 16: - kwargs["global_table_settings_replication_mode"] = ( - GlobalTableSettingsReplicationMode( - de.read_string( - _SCHEMA_CREATE_TABLE_INPUT.members[ - "GlobalTableSettingsReplicationMode" - ] - ) - ) - ) - - case 17: - kwargs["vector_indexes"] = _deserialize_vector_index_list( - de, _SCHEMA_CREATE_TABLE_INPUT.members["VectorIndexes"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_TABLE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ProvisionedThroughputDescription: - """ - Represents the provisioned throughput settings for the table, consisting - of read and write capacity units, along with data about increases and - decreases. - """ - - last_increase_date_time: datetime | None = None - """ - The date and time of the last provisioned throughput increase for this - table. - """ - - last_decrease_date_time: datetime | None = None - """ - The date and time of the last provisioned throughput decrease for this - table. - """ - - number_of_decreases_today: int | None = None - """ - The number of provisioned throughput decreases for this table during - this UTC calendar day. For current maximums on provisioned throughput - decreases, see [Service, Account, and Table - Quotas](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - read_capacity_units: int | None = None - """ - The maximum number of strongly consistent reads consumed per second - before DynamoDB returns a `ThrottlingException`. Eventually consistent - reads require less effort than strongly consistent reads, so a setting - of 50 `ReadCapacityUnits` per second provides 100 eventually consistent - `ReadCapacityUnits` per second. - - For a table or global secondary index that uses on-demand capacity mode - (`PAY_PER_REQUEST`), this value is `0`, because on-demand mode does not - use provisioned throughput. - """ - - write_capacity_units: int | None = None - """ - The maximum number of writes consumed per second before DynamoDB returns - a `ThrottlingException`. - - For a table or global secondary index that uses on-demand capacity mode - (`PAY_PER_REQUEST`), this value is `0`, because on-demand mode does not - use provisioned throughput. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PROVISIONED_THROUGHPUT_DESCRIPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.last_increase_date_time is not None: - serializer.write_timestamp( - _SCHEMA_PROVISIONED_THROUGHPUT_DESCRIPTION.members[ - "LastIncreaseDateTime" - ], - self.last_increase_date_time, - ) - - if self.last_decrease_date_time is not None: - serializer.write_timestamp( - _SCHEMA_PROVISIONED_THROUGHPUT_DESCRIPTION.members[ - "LastDecreaseDateTime" - ], - self.last_decrease_date_time, - ) - - if self.number_of_decreases_today is not None: - serializer.write_long( - _SCHEMA_PROVISIONED_THROUGHPUT_DESCRIPTION.members[ - "NumberOfDecreasesToday" - ], - self.number_of_decreases_today, - ) - - if self.read_capacity_units is not None: - serializer.write_long( - _SCHEMA_PROVISIONED_THROUGHPUT_DESCRIPTION.members["ReadCapacityUnits"], - self.read_capacity_units, - ) - - if self.write_capacity_units is not None: - serializer.write_long( - _SCHEMA_PROVISIONED_THROUGHPUT_DESCRIPTION.members[ - "WriteCapacityUnits" - ], - self.write_capacity_units, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["last_increase_date_time"] = de.read_timestamp( - _SCHEMA_PROVISIONED_THROUGHPUT_DESCRIPTION.members[ - "LastIncreaseDateTime" - ] - ) - - case 1: - kwargs["last_decrease_date_time"] = de.read_timestamp( - _SCHEMA_PROVISIONED_THROUGHPUT_DESCRIPTION.members[ - "LastDecreaseDateTime" - ] - ) - - case 2: - kwargs["number_of_decreases_today"] = de.read_long( - _SCHEMA_PROVISIONED_THROUGHPUT_DESCRIPTION.members[ - "NumberOfDecreasesToday" - ] - ) - - case 3: - kwargs["read_capacity_units"] = de.read_long( - _SCHEMA_PROVISIONED_THROUGHPUT_DESCRIPTION.members[ - "ReadCapacityUnits" - ] - ) - - case 4: - kwargs["write_capacity_units"] = de.read_long( - _SCHEMA_PROVISIONED_THROUGHPUT_DESCRIPTION.members[ - "WriteCapacityUnits" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PROVISIONED_THROUGHPUT_DESCRIPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GlobalSecondaryIndexDescription: - """Represents the properties of a global secondary index.""" - - index_name: str | None = None - """The name of the global secondary index.""" - - key_schema: list[KeySchemaElement] | None = None - """ - The complete key schema for a global secondary index, which consists of - one or more pairs of attribute names and key types: - - - `HASH` - partition key - - - `RANGE` - sort key - - Note: - The partition key of an item is also known as its *hash attribute*. The - term \"hash attribute\" derives from DynamoDB's usage of an internal - hash function to evenly distribute data items across partitions, based - on their partition key values. - - The sort key of an item is also known as its *range attribute*. The term - \"range attribute\" derives from the way DynamoDB stores items with the - same partition key physically close together, in sorted order by the - sort key value. - """ - - projection: Projection | None = None - """ - Represents attributes that are copied (projected) from the table into - the global secondary index. These are in addition to the primary key - attributes and index key attributes, which are automatically projected. - """ - - index_status: str | None = None - """ - The current state of the global secondary index: - - - `CREATING` - The index is being created. - - - `UPDATING` - The index is being updated. - - - `DELETING` - The index is being deleted. - - - `ACTIVE` - The index is ready for use. - """ - - backfilling: bool | None = None - """ - Indicates whether the index is currently backfilling. *Backfilling* is - the process of reading items from the table and determining whether they - can be added to the index. (Not all items will qualify: For example, a - partition key cannot have any duplicate values.) If an item can be added - to the index, DynamoDB will do so. After all items have been processed, - the backfilling operation is complete and `Backfilling` is false. - - You can delete an index that is being created during the `Backfilling` - phase when `IndexStatus` is set to CREATING and `Backfilling` is true. - You can't delete the index that is being created when `IndexStatus` is - set to CREATING and `Backfilling` is false. - - Note: - For indexes that were created during a `CreateTable` operation, the - `Backfilling` attribute does not appear in the `DescribeTable` output. - """ - - provisioned_throughput: ProvisionedThroughputDescription | None = None - """ - Represents the provisioned throughput settings for the specified global - secondary index. - - For current minimum and maximum provisioned throughput values, see - [Service, Account, and Table - Quotas](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - index_size_bytes: int | None = None - """ - The total size of the specified index, in bytes. DynamoDB updates this - value approximately every six hours. Recent changes might not be - reflected in this value. - """ - - item_count: int | None = None - """ - The number of items in the specified index. DynamoDB updates this value - approximately every six hours. Recent changes might not be reflected in - this value. - """ - - index_arn: str | None = None - """The Amazon Resource Name (ARN) that uniquely identifies the index.""" - - on_demand_throughput: OnDemandThroughput | None = None - """ - The maximum number of read and write units for the specified global - secondary index. If you use this parameter, you must specify - `MaxReadRequestUnits`, `MaxWriteRequestUnits`, or both. - """ - - warm_throughput: GlobalSecondaryIndexWarmThroughputDescription | None = None - """ - Represents the warm throughput value (in read units per second and write - units per second) for the specified secondary index. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GLOBAL_SECONDARY_INDEX_DESCRIPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.index_name is not None: - serializer.write_string( - _SCHEMA_GLOBAL_SECONDARY_INDEX_DESCRIPTION.members["IndexName"], - self.index_name, - ) - - if self.key_schema is not None: - _serialize_key_schema( - serializer, - _SCHEMA_GLOBAL_SECONDARY_INDEX_DESCRIPTION.members["KeySchema"], - self.key_schema, - ) - - if self.projection is not None: - serializer.write_struct( - _SCHEMA_GLOBAL_SECONDARY_INDEX_DESCRIPTION.members["Projection"], - self.projection, - ) - - if self.index_status is not None: - serializer.write_string( - _SCHEMA_GLOBAL_SECONDARY_INDEX_DESCRIPTION.members["IndexStatus"], - self.index_status, - ) - - if self.backfilling is not None: - serializer.write_boolean( - _SCHEMA_GLOBAL_SECONDARY_INDEX_DESCRIPTION.members["Backfilling"], - self.backfilling, - ) - - if self.provisioned_throughput is not None: - serializer.write_struct( - _SCHEMA_GLOBAL_SECONDARY_INDEX_DESCRIPTION.members[ - "ProvisionedThroughput" - ], - self.provisioned_throughput, - ) - - if self.index_size_bytes is not None: - serializer.write_long( - _SCHEMA_GLOBAL_SECONDARY_INDEX_DESCRIPTION.members["IndexSizeBytes"], - self.index_size_bytes, - ) - - if self.item_count is not None: - serializer.write_long( - _SCHEMA_GLOBAL_SECONDARY_INDEX_DESCRIPTION.members["ItemCount"], - self.item_count, - ) - - if self.index_arn is not None: - serializer.write_string( - _SCHEMA_GLOBAL_SECONDARY_INDEX_DESCRIPTION.members["IndexArn"], - self.index_arn, - ) - - if self.on_demand_throughput is not None: - serializer.write_struct( - _SCHEMA_GLOBAL_SECONDARY_INDEX_DESCRIPTION.members[ - "OnDemandThroughput" - ], - self.on_demand_throughput, - ) - - if self.warm_throughput is not None: - serializer.write_struct( - _SCHEMA_GLOBAL_SECONDARY_INDEX_DESCRIPTION.members["WarmThroughput"], - self.warm_throughput, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["index_name"] = de.read_string( - _SCHEMA_GLOBAL_SECONDARY_INDEX_DESCRIPTION.members["IndexName"] - ) - - case 1: - kwargs["key_schema"] = _deserialize_key_schema( - de, - _SCHEMA_GLOBAL_SECONDARY_INDEX_DESCRIPTION.members["KeySchema"], - ) - - case 2: - kwargs["projection"] = Projection.deserialize(de) - - case 3: - kwargs["index_status"] = IndexStatus( - de.read_string( - _SCHEMA_GLOBAL_SECONDARY_INDEX_DESCRIPTION.members[ - "IndexStatus" - ] - ) - ) - - case 4: - kwargs["backfilling"] = de.read_boolean( - _SCHEMA_GLOBAL_SECONDARY_INDEX_DESCRIPTION.members[ - "Backfilling" - ] - ) - - case 5: - kwargs["provisioned_throughput"] = ( - ProvisionedThroughputDescription.deserialize(de) - ) - - case 6: - kwargs["index_size_bytes"] = de.read_long( - _SCHEMA_GLOBAL_SECONDARY_INDEX_DESCRIPTION.members[ - "IndexSizeBytes" - ] - ) - - case 7: - kwargs["item_count"] = de.read_long( - _SCHEMA_GLOBAL_SECONDARY_INDEX_DESCRIPTION.members["ItemCount"] - ) - - case 8: - kwargs["index_arn"] = de.read_string( - _SCHEMA_GLOBAL_SECONDARY_INDEX_DESCRIPTION.members["IndexArn"] - ) - - case 9: - kwargs["on_demand_throughput"] = OnDemandThroughput.deserialize(de) - - case 10: - kwargs["warm_throughput"] = ( - GlobalSecondaryIndexWarmThroughputDescription.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GLOBAL_SECONDARY_INDEX_DESCRIPTION, consumer=_consumer - ) - return kwargs - - -def _serialize_global_secondary_index_description_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[GlobalSecondaryIndexDescription], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_global_secondary_index_description_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GlobalSecondaryIndexDescription]: - result: list[GlobalSecondaryIndexDescription] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GlobalSecondaryIndexDescription.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class WitnessStatus(UnknownEnumMixin, StrEnum): - CREATING = "CREATING" - DELETING = "DELETING" - ACTIVE = "ACTIVE" - - -@dataclass(kw_only=True) -class GlobalTableWitnessDescription: - """Represents the properties of a witness Region in a MRSC global table.""" - - region_name: str | None = None - """ - The name of the Amazon Web Services Region that serves as a witness for - the MRSC global table. - """ - - witness_status: str | None = None - """The current status of the witness Region in the MRSC global table.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GLOBAL_TABLE_WITNESS_DESCRIPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.region_name is not None: - serializer.write_string( - _SCHEMA_GLOBAL_TABLE_WITNESS_DESCRIPTION.members["RegionName"], - self.region_name, - ) - - if self.witness_status is not None: - serializer.write_string( - _SCHEMA_GLOBAL_TABLE_WITNESS_DESCRIPTION.members["WitnessStatus"], - self.witness_status, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["region_name"] = de.read_string( - _SCHEMA_GLOBAL_TABLE_WITNESS_DESCRIPTION.members["RegionName"] - ) - - case 1: - kwargs["witness_status"] = WitnessStatus( - de.read_string( - _SCHEMA_GLOBAL_TABLE_WITNESS_DESCRIPTION.members[ - "WitnessStatus" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GLOBAL_TABLE_WITNESS_DESCRIPTION, consumer=_consumer - ) - return kwargs - - -def _serialize_global_table_witness_description_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[GlobalTableWitnessDescription], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_global_table_witness_description_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GlobalTableWitnessDescription]: - result: list[GlobalTableWitnessDescription] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GlobalTableWitnessDescription.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class LocalSecondaryIndexDescription: - """Represents the properties of a local secondary index.""" - - index_name: str | None = None - """Represents the name of the local secondary index.""" - - key_schema: list[KeySchemaElement] | None = None - """ - The complete key schema for the local secondary index, consisting of one - or more pairs of attribute names and key types: - - - `HASH` - partition key - - - `RANGE` - sort key - - Note: - The partition key of an item is also known as its *hash attribute*. The - term \"hash attribute\" derives from DynamoDB's usage of an internal - hash function to evenly distribute data items across partitions, based - on their partition key values. - - The sort key of an item is also known as its *range attribute*. The term - \"range attribute\" derives from the way DynamoDB stores items with the - same partition key physically close together, in sorted order by the - sort key value. - """ - - projection: Projection | None = None - """ - Represents attributes that are copied (projected) from the table into - the global secondary index. These are in addition to the primary key - attributes and index key attributes, which are automatically projected. - """ - - index_size_bytes: int | None = None - """ - The total size of the specified index, in bytes. DynamoDB updates this - value approximately every six hours. Recent changes might not be - reflected in this value. - """ - - item_count: int | None = None - """ - The number of items in the specified index. DynamoDB updates this value - approximately every six hours. Recent changes might not be reflected in - this value. - """ - - index_arn: str | None = None - """The Amazon Resource Name (ARN) that uniquely identifies the index.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LOCAL_SECONDARY_INDEX_DESCRIPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.index_name is not None: - serializer.write_string( - _SCHEMA_LOCAL_SECONDARY_INDEX_DESCRIPTION.members["IndexName"], - self.index_name, - ) - - if self.key_schema is not None: - _serialize_key_schema( - serializer, - _SCHEMA_LOCAL_SECONDARY_INDEX_DESCRIPTION.members["KeySchema"], - self.key_schema, - ) - - if self.projection is not None: - serializer.write_struct( - _SCHEMA_LOCAL_SECONDARY_INDEX_DESCRIPTION.members["Projection"], - self.projection, - ) - - if self.index_size_bytes is not None: - serializer.write_long( - _SCHEMA_LOCAL_SECONDARY_INDEX_DESCRIPTION.members["IndexSizeBytes"], - self.index_size_bytes, - ) - - if self.item_count is not None: - serializer.write_long( - _SCHEMA_LOCAL_SECONDARY_INDEX_DESCRIPTION.members["ItemCount"], - self.item_count, - ) - - if self.index_arn is not None: - serializer.write_string( - _SCHEMA_LOCAL_SECONDARY_INDEX_DESCRIPTION.members["IndexArn"], - self.index_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["index_name"] = de.read_string( - _SCHEMA_LOCAL_SECONDARY_INDEX_DESCRIPTION.members["IndexName"] - ) - - case 1: - kwargs["key_schema"] = _deserialize_key_schema( - de, - _SCHEMA_LOCAL_SECONDARY_INDEX_DESCRIPTION.members["KeySchema"], - ) - - case 2: - kwargs["projection"] = Projection.deserialize(de) - - case 3: - kwargs["index_size_bytes"] = de.read_long( - _SCHEMA_LOCAL_SECONDARY_INDEX_DESCRIPTION.members[ - "IndexSizeBytes" - ] - ) - - case 4: - kwargs["item_count"] = de.read_long( - _SCHEMA_LOCAL_SECONDARY_INDEX_DESCRIPTION.members["ItemCount"] - ) - - case 5: - kwargs["index_arn"] = de.read_string( - _SCHEMA_LOCAL_SECONDARY_INDEX_DESCRIPTION.members["IndexArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LOCAL_SECONDARY_INDEX_DESCRIPTION, consumer=_consumer - ) - return kwargs - - -def _serialize_local_secondary_index_description_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[LocalSecondaryIndexDescription], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_local_secondary_index_description_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[LocalSecondaryIndexDescription]: - result: list[LocalSecondaryIndexDescription] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(LocalSecondaryIndexDescription.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class MultiRegionConsistency(UnknownEnumMixin, StrEnum): - EVENTUAL = "EVENTUAL" - STRONG = "STRONG" - - -@dataclass(kw_only=True) -class RestoreSummary: - """Contains details for the restore.""" - - restore_date_time: datetime - """Point in time or source backup time.""" - - restore_in_progress: bool - """Indicates if a restore is in progress or not.""" - - source_backup_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the backup from which the table was - restored. - """ - - source_table_arn: str | None = None - """The ARN of the source table of the backup that is being restored.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESTORE_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.source_backup_arn is not None: - serializer.write_string( - _SCHEMA_RESTORE_SUMMARY.members["SourceBackupArn"], - self.source_backup_arn, - ) - - if self.source_table_arn is not None: - serializer.write_string( - _SCHEMA_RESTORE_SUMMARY.members["SourceTableArn"], self.source_table_arn - ) - - serializer.write_timestamp( - _SCHEMA_RESTORE_SUMMARY.members["RestoreDateTime"], self.restore_date_time - ) - serializer.write_boolean( - _SCHEMA_RESTORE_SUMMARY.members["RestoreInProgress"], - self.restore_in_progress, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["source_backup_arn"] = de.read_string( - _SCHEMA_RESTORE_SUMMARY.members["SourceBackupArn"] - ) - - case 1: - kwargs["source_table_arn"] = de.read_string( - _SCHEMA_RESTORE_SUMMARY.members["SourceTableArn"] - ) - - case 2: - kwargs["restore_date_time"] = de.read_timestamp( - _SCHEMA_RESTORE_SUMMARY.members["RestoreDateTime"] - ) - - case 3: - kwargs["restore_in_progress"] = de.read_boolean( - _SCHEMA_RESTORE_SUMMARY.members["RestoreInProgress"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RESTORE_SUMMARY, consumer=_consumer) - if "restore_date_time" not in kwargs: - kwargs["restore_date_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "restore_in_progress" not in kwargs: - kwargs["restore_in_progress"] = False - return kwargs - - -@dataclass(kw_only=True) -class VectorIndexDescription: - """ - Contains the current state and configuration of a vector index, - including its status, size, item count, and the settings specified when - the index was created. - """ - - index_name: str | None = None - """The name of the vector index.""" - - search_schema: list[SearchSchemaElement] | None = None - """ - The search schema that defines partition key and inline filter - attributes for the vector index. - """ - - projection: Projection | None = None - """ - Specifies attributes that are copied (projected) from the table into the - vector index. - """ - - vector_attribute: VectorAttributeDefinition | None = None - """The vector attribute configuration for the index.""" - - dimensions: int | None = None - """The number of dimensions in each vector.""" - - distance_function: str | None = None - """The distance function used to calculate similarity between vectors.""" - - index_status: str | None = None - """ - The current state of the vector index: - - - `CREATING` - The index is being created. - - - `ACTIVE` - The index is ready for use. - - - `DELETING` - The index is being deleted. - """ - - backfilling: bool | None = None - """ - Specifies whether the index is currently backfilling. During backfill, - `SearchVectors` operations might return incomplete results. - """ - - index_size_bytes: int | None = None - """ - The total size of the vector index, in bytes. Amazon DynamoDB updates - this value approximately every six hours. Recent changes might not be - reflected in this value. - """ - - item_count: int | None = None - """ - The number of items indexed in the vector index. Amazon DynamoDB updates - this value approximately every six hours. Recent changes might not be - reflected in this value. - """ - - index_arn: str | None = None - """ - The Amazon Resource Name (ARN) that uniquely identifies the vector - index. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VECTOR_INDEX_DESCRIPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.index_name is not None: - serializer.write_string( - _SCHEMA_VECTOR_INDEX_DESCRIPTION.members["IndexName"], self.index_name - ) - - if self.search_schema is not None: - _serialize_search_schema( - serializer, - _SCHEMA_VECTOR_INDEX_DESCRIPTION.members["SearchSchema"], - self.search_schema, - ) - - if self.projection is not None: - serializer.write_struct( - _SCHEMA_VECTOR_INDEX_DESCRIPTION.members["Projection"], self.projection - ) - - if self.vector_attribute is not None: - serializer.write_struct( - _SCHEMA_VECTOR_INDEX_DESCRIPTION.members["VectorAttribute"], - self.vector_attribute, - ) - - if self.dimensions is not None: - serializer.write_long( - _SCHEMA_VECTOR_INDEX_DESCRIPTION.members["Dimensions"], self.dimensions - ) - - if self.distance_function is not None: - serializer.write_string( - _SCHEMA_VECTOR_INDEX_DESCRIPTION.members["DistanceFunction"], - self.distance_function, - ) - - if self.index_status is not None: - serializer.write_string( - _SCHEMA_VECTOR_INDEX_DESCRIPTION.members["IndexStatus"], - self.index_status, - ) - - if self.backfilling is not None: - serializer.write_boolean( - _SCHEMA_VECTOR_INDEX_DESCRIPTION.members["Backfilling"], - self.backfilling, - ) - - if self.index_size_bytes is not None: - serializer.write_long( - _SCHEMA_VECTOR_INDEX_DESCRIPTION.members["IndexSizeBytes"], - self.index_size_bytes, - ) - - if self.item_count is not None: - serializer.write_long( - _SCHEMA_VECTOR_INDEX_DESCRIPTION.members["ItemCount"], self.item_count - ) - - if self.index_arn is not None: - serializer.write_string( - _SCHEMA_VECTOR_INDEX_DESCRIPTION.members["IndexArn"], self.index_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["index_name"] = de.read_string( - _SCHEMA_VECTOR_INDEX_DESCRIPTION.members["IndexName"] - ) - - case 1: - kwargs["search_schema"] = _deserialize_search_schema( - de, _SCHEMA_VECTOR_INDEX_DESCRIPTION.members["SearchSchema"] - ) - - case 2: - kwargs["projection"] = Projection.deserialize(de) - - case 3: - kwargs["vector_attribute"] = VectorAttributeDefinition.deserialize( - de - ) - - case 4: - kwargs["dimensions"] = de.read_long( - _SCHEMA_VECTOR_INDEX_DESCRIPTION.members["Dimensions"] - ) - - case 5: - kwargs["distance_function"] = VectorDistanceFunction( - de.read_string( - _SCHEMA_VECTOR_INDEX_DESCRIPTION.members["DistanceFunction"] - ) - ) - - case 6: - kwargs["index_status"] = IndexStatus( - de.read_string( - _SCHEMA_VECTOR_INDEX_DESCRIPTION.members["IndexStatus"] - ) - ) - - case 7: - kwargs["backfilling"] = de.read_boolean( - _SCHEMA_VECTOR_INDEX_DESCRIPTION.members["Backfilling"] - ) - - case 8: - kwargs["index_size_bytes"] = de.read_long( - _SCHEMA_VECTOR_INDEX_DESCRIPTION.members["IndexSizeBytes"] - ) - - case 9: - kwargs["item_count"] = de.read_long( - _SCHEMA_VECTOR_INDEX_DESCRIPTION.members["ItemCount"] - ) - - case 10: - kwargs["index_arn"] = de.read_string( - _SCHEMA_VECTOR_INDEX_DESCRIPTION.members["IndexArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VECTOR_INDEX_DESCRIPTION, consumer=_consumer) - return kwargs - - -def _serialize_vector_index_description_list( - serializer: ShapeSerializer, schema: Schema, value: list[VectorIndexDescription] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_vector_index_description_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[VectorIndexDescription]: - result: list[VectorIndexDescription] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(VectorIndexDescription.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class TableDescription: - """Represents the properties of a table.""" - - attribute_definitions: list[AttributeDefinition] | None = None - """ - An array of `AttributeDefinition` objects. Each of these objects - describes one attribute in the table and index key schema. - - Each `AttributeDefinition` object in this array is composed of: - - - `AttributeName` - The name of the attribute. - - - `AttributeType` - The data type for the attribute. - """ - - table_name: str | None = None - """The name of the table.""" - - key_schema: list[KeySchemaElement] | None = None - """ - The primary key structure for the table. Each `KeySchemaElement` - consists of: - - - `AttributeName` - The name of the attribute. - - - `KeyType` - The role of the attribute: - - - `HASH` - partition key - - - `RANGE` - sort key - - Note: - The partition key of an item is also known as its *hash attribute*. - The term \"hash attribute\" derives from DynamoDB's usage of an - internal hash function to evenly distribute data items across - partitions, based on their partition key values. - - The sort key of an item is also known as its *range attribute*. The - term \"range attribute\" derives from the way DynamoDB stores items - with the same partition key physically close together, in sorted order - by the sort key value. - - For more information about primary keys, see [Primary - Key](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataModel.html#DataModelPrimaryKey) - in the *Amazon DynamoDB Developer Guide*. - """ - - table_status: str | None = None - """ - The current state of the table: - - - `CREATING` - The table is being created. - - - `UPDATING` - The table/index configuration is being updated. The - table/index remains available for data operations when `UPDATING`. - - - `DELETING` - The table is being deleted. - - - `ACTIVE` - The table is ready for use. - - - `INACCESSIBLE_ENCRYPTION_CREDENTIALS` - The KMS key used to encrypt - the table in inaccessible. Table operations may fail due to failure to - use the KMS key. DynamoDB will initiate the table archival process - when a table's KMS key remains inaccessible for more than seven days. - - - `ARCHIVING` - The table is being archived. Operations are not allowed - until archival is complete. - - - `ARCHIVED` - The table has been archived. See the ArchivalReason for - more information. - """ - - creation_date_time: datetime | None = None - """ - The date and time when the table was created, in [UNIX epoch - time](http://www.epochconverter.com/) format. - """ - - provisioned_throughput: ProvisionedThroughputDescription | None = None - """ - The provisioned throughput settings for the table, consisting of read - and write capacity units, along with data about increases and decreases. - """ - - table_size_bytes: int | None = None - """ - The total size of the specified table, in bytes. DynamoDB updates this - value approximately every six hours. Recent changes might not be - reflected in this value. - """ - - item_count: int | None = None - """ - The number of items in the specified table. DynamoDB updates this value - approximately every six hours. Recent changes might not be reflected in - this value. - """ - - table_arn: str | None = None - """The Amazon Resource Name (ARN) that uniquely identifies the table.""" - - table_id: str | None = None - """ - A unique identifier for the table, in UUID format, generated by DynamoDB - when the table is created. - """ - - billing_mode_summary: BillingModeSummary | None = None - """Contains the details for the read/write capacity mode.""" - - local_secondary_indexes: list[LocalSecondaryIndexDescription] | None = None - """ - Represents one or more local secondary indexes on the table. Each index - is scoped to a given partition key value. Tables with one or more local - secondary indexes are subject to an item collection size limit, where - the amount of data within a given item collection cannot exceed 10 GB. - Each element is composed of: - - - `IndexName` - The name of the local secondary index. - - - `KeySchema` - Specifies the complete index key schema. The attribute - names in the key schema must be between 1 and 255 characters - (inclusive). The key schema must begin with the same partition key as - the table. - - - `Projection` - Specifies attributes that are copied (projected) from - the table into the index. These are in addition to the primary key - attributes and index key attributes, which are automatically - projected. Each attribute specification is composed of: - - - `ProjectionType` - One of the following: - - - `KEYS_ONLY` - Only the index and primary keys are projected into - the index. - - - `INCLUDE` - Only the specified table attributes are projected into - the index. The list of projected attributes is in - `NonKeyAttributes`. - - - `ALL` - All of the table attributes are projected into the index. - - - `NonKeyAttributes` - A list of one or more non-key attribute names - that are projected into the secondary index. The total count of - attributes provided in `NonKeyAttributes`, summed across all of the - secondary indexes, must not exceed 100. If you project the same - attribute into two different indexes, this counts as two distinct - attributes when determining the total. This limit only applies when - you specify the ProjectionType of `INCLUDE`. You still can specify - the ProjectionType of `ALL` to project all attributes from the - source table, even if the table has more than 100 attributes. - - - `IndexSizeBytes` - Represents the total size of the index, in bytes. - DynamoDB updates this value approximately every six hours. Recent - changes might not be reflected in this value. - - - `ItemCount` - Represents the number of items in the index. DynamoDB - updates this value approximately every six hours. Recent changes might - not be reflected in this value. - - If the table is in the `DELETING` state, no information about indexes - will be returned. - """ - - global_secondary_indexes: list[GlobalSecondaryIndexDescription] | None = None - """ - The global secondary indexes, if any, on the table. Each index is scoped - to a given partition key value. Each element is composed of: - - - `Backfilling` - If true, then the index is currently in the - backfilling phase. Backfilling occurs only when a new global secondary - index is added to the table. It is the process by which DynamoDB - populates the new index with data from the table. (This attribute does - not appear for indexes that were created during a `CreateTable` - operation.) - - You can delete an index that is being created during the `Backfilling` - phase when `IndexStatus` is set to CREATING and `Backfilling` is true. - You can't delete the index that is being created when `IndexStatus` - is set to CREATING and `Backfilling` is false. (This attribute does - not appear for indexes that were created during a `CreateTable` - operation.) - - - `IndexName` - The name of the global secondary index. - - - `IndexSizeBytes` - The total size of the global secondary index, in - bytes. DynamoDB updates this value approximately every six hours. - Recent changes might not be reflected in this value. - - - `IndexStatus` - The current status of the global secondary index: - - - `CREATING` - The index is being created. - - - `UPDATING` - The index is being updated. - - - `DELETING` - The index is being deleted. - - - `ACTIVE` - The index is ready for use. - - - `ItemCount` - The number of items in the global secondary index. - DynamoDB updates this value approximately every six hours. Recent - changes might not be reflected in this value. - - - `KeySchema` - Specifies the complete index key schema. The attribute - names in the key schema must be between 1 and 255 characters - (inclusive). The key schema must begin with the same partition key as - the table. - - - `Projection` - Specifies attributes that are copied (projected) from - the table into the index. These are in addition to the primary key - attributes and index key attributes, which are automatically - projected. Each attribute specification is composed of: - - - `ProjectionType` - One of the following: - - - `KEYS_ONLY` - Only the index and primary keys are projected into - the index. - - - `INCLUDE` - In addition to the attributes described in - `KEYS_ONLY`, the secondary index will include other non-key - attributes that you specify. - - - `ALL` - All of the table attributes are projected into the index. - - - `NonKeyAttributes` - A list of one or more non-key attribute names - that are projected into the secondary index. The total count of - attributes provided in `NonKeyAttributes`, summed across all of the - secondary indexes, must not exceed 100. If you project the same - attribute into two different indexes, this counts as two distinct - attributes when determining the total. This limit only applies when - you specify the ProjectionType of `INCLUDE`. You still can specify - the ProjectionType of `ALL` to project all attributes from the - source table, even if the table has more than 100 attributes. - - - `ProvisionedThroughput` - The provisioned throughput settings for the - global secondary index, consisting of read and write capacity units, - along with data about increases and decreases. - - If the table is in the `DELETING` state, no information about indexes - will be returned. - """ - - stream_specification: StreamSpecification | None = None - """The current DynamoDB Streams configuration for the table.""" - - latest_stream_label: str | None = None - """ - A timestamp, in ISO 8601 format, for this stream. - - Note that `LatestStreamLabel` is not a unique identifier for the stream, - because it is possible that a stream from another table might have the - same timestamp. However, the combination of the following three elements - is guaranteed to be unique: - - - Amazon Web Services customer ID - - - Table name - - - `StreamLabel` - """ - - latest_stream_arn: str | None = None - """ - The Amazon Resource Name (ARN) that uniquely identifies the latest - stream for this table. - """ - - global_table_version: str | None = None - """ - Represents the version of [global - tables](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GlobalTables.html) - in use, if the table is replicated across Amazon Web Services Regions. - """ - - replicas: list[ReplicaDescription] | None = None - """Represents replicas of the table.""" - - global_table_witnesses: list[GlobalTableWitnessDescription] | None = None - """ - The witness Region and its current status in the MRSC global table. Only - one witness Region can be configured per MRSC global table. - """ - - global_table_settings_replication_mode: str | None = None - """ - Indicates one of the settings synchronization modes for the global - table: - - - `ENABLED`: Indicates that the settings synchronization mode for the - global table is enabled. - - - `DISABLED`: Indicates that the settings synchronization mode for the - global table is disabled. - - - `ENABLED_WITH_OVERRIDES`: This mode is set by default for a same - account global table. Indicates that certain global table settings can - be overridden. - """ - - restore_summary: RestoreSummary | None = None - """Contains details for the restore.""" - - sse_description: SSEDescription | None = None - """ - The description of the server-side encryption status on the specified - table. - """ - - archival_summary: ArchivalSummary | None = None - """Contains information about the table archive.""" - - table_class_summary: TableClassSummary | None = None - """Contains details of the table class.""" - - deletion_protection_enabled: bool | None = None - """ - Indicates whether deletion protection is enabled (true) or disabled - (false) on the table. - """ - - on_demand_throughput: OnDemandThroughput | None = None - """ - The maximum number of read and write units for the specified on-demand - table. If you use this parameter, you must specify - `MaxReadRequestUnits`, `MaxWriteRequestUnits`, or both. - """ - - warm_throughput: TableWarmThroughputDescription | None = None - """Describes the warm throughput value of the base table.""" - - multi_region_consistency: str | None = None - """ - Indicates one of the following consistency modes for a global table: - - - `EVENTUAL`: Indicates that the global table is configured for - multi-Region eventual consistency (MREC). - - - `STRONG`: Indicates that the global table is configured for - multi-Region strong consistency (MRSC). - - If you don't specify this field, the global table consistency mode - defaults to `EVENTUAL`. For more information about global tables - consistency modes, see [Consistency - modes](https://docs.aws.amazon.com/V2globaltables_HowItWorks.html#V2globaltables_HowItWorks.consistency-modes) - in DynamoDB developer guide. - """ - - vector_indexes: list[VectorIndexDescription] | None = None - """ - The vector indexes, if any, on the table. Each element is composed of: - - - `IndexName` - The name of the vector index. - - - `IndexStatus` - The current status of the vector index: `CREATING`, - `ACTIVE`, or `DELETING`. - - - `Backfilling` - Specifies whether the index is currently backfilling. - During backfill, `SearchVectors` operations might return incomplete - results. - - - `VectorAttribute` - The attribute that contains vector embeddings. - - - `Dimensions` - The number of dimensions in each vector. - - - `DistanceFunction` - The distance function used to calculate - similarity (`COSINE`, `EUCLIDEAN`, or `DOT_PRODUCT`). - - - `SearchSchema` - The partition key and inline filter attributes for - the vector index. - - - `Projection` - Specifies attributes that are copied (projected) from - the table into the vector index. - - - `IndexArn` - The Amazon Resource Name (ARN) that uniquely identifies - the index. - - - `IndexSizeBytes` - The total size of the vector index, in bytes. - Amazon DynamoDB updates this value approximately every six hours. - Recent changes might not be reflected in this value. - - - `ItemCount` - The number of items indexed in the vector index. Amazon - DynamoDB updates this value approximately every six hours. Recent - changes might not be reflected in this value. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TABLE_DESCRIPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.attribute_definitions is not None: - _serialize_attribute_definitions( - serializer, - _SCHEMA_TABLE_DESCRIPTION.members["AttributeDefinitions"], - self.attribute_definitions, - ) - - if self.table_name is not None: - serializer.write_string( - _SCHEMA_TABLE_DESCRIPTION.members["TableName"], self.table_name - ) - - if self.key_schema is not None: - _serialize_key_schema( - serializer, - _SCHEMA_TABLE_DESCRIPTION.members["KeySchema"], - self.key_schema, - ) - - if self.table_status is not None: - serializer.write_string( - _SCHEMA_TABLE_DESCRIPTION.members["TableStatus"], self.table_status - ) - - if self.creation_date_time is not None: - serializer.write_timestamp( - _SCHEMA_TABLE_DESCRIPTION.members["CreationDateTime"], - self.creation_date_time, - ) - - if self.provisioned_throughput is not None: - serializer.write_struct( - _SCHEMA_TABLE_DESCRIPTION.members["ProvisionedThroughput"], - self.provisioned_throughput, - ) - - if self.table_size_bytes is not None: - serializer.write_long( - _SCHEMA_TABLE_DESCRIPTION.members["TableSizeBytes"], - self.table_size_bytes, - ) - - if self.item_count is not None: - serializer.write_long( - _SCHEMA_TABLE_DESCRIPTION.members["ItemCount"], self.item_count - ) - - if self.table_arn is not None: - serializer.write_string( - _SCHEMA_TABLE_DESCRIPTION.members["TableArn"], self.table_arn - ) - - if self.table_id is not None: - serializer.write_string( - _SCHEMA_TABLE_DESCRIPTION.members["TableId"], self.table_id - ) - - if self.billing_mode_summary is not None: - serializer.write_struct( - _SCHEMA_TABLE_DESCRIPTION.members["BillingModeSummary"], - self.billing_mode_summary, - ) - - if self.local_secondary_indexes is not None: - _serialize_local_secondary_index_description_list( - serializer, - _SCHEMA_TABLE_DESCRIPTION.members["LocalSecondaryIndexes"], - self.local_secondary_indexes, - ) - - if self.global_secondary_indexes is not None: - _serialize_global_secondary_index_description_list( - serializer, - _SCHEMA_TABLE_DESCRIPTION.members["GlobalSecondaryIndexes"], - self.global_secondary_indexes, - ) - - if self.stream_specification is not None: - serializer.write_struct( - _SCHEMA_TABLE_DESCRIPTION.members["StreamSpecification"], - self.stream_specification, - ) - - if self.latest_stream_label is not None: - serializer.write_string( - _SCHEMA_TABLE_DESCRIPTION.members["LatestStreamLabel"], - self.latest_stream_label, - ) - - if self.latest_stream_arn is not None: - serializer.write_string( - _SCHEMA_TABLE_DESCRIPTION.members["LatestStreamArn"], - self.latest_stream_arn, - ) - - if self.global_table_version is not None: - serializer.write_string( - _SCHEMA_TABLE_DESCRIPTION.members["GlobalTableVersion"], - self.global_table_version, - ) - - if self.replicas is not None: - _serialize_replica_description_list( - serializer, _SCHEMA_TABLE_DESCRIPTION.members["Replicas"], self.replicas - ) - - if self.global_table_witnesses is not None: - _serialize_global_table_witness_description_list( - serializer, - _SCHEMA_TABLE_DESCRIPTION.members["GlobalTableWitnesses"], - self.global_table_witnesses, - ) - - if self.global_table_settings_replication_mode is not None: - serializer.write_string( - _SCHEMA_TABLE_DESCRIPTION.members["GlobalTableSettingsReplicationMode"], - self.global_table_settings_replication_mode, - ) - - if self.restore_summary is not None: - serializer.write_struct( - _SCHEMA_TABLE_DESCRIPTION.members["RestoreSummary"], - self.restore_summary, - ) - - if self.sse_description is not None: - serializer.write_struct( - _SCHEMA_TABLE_DESCRIPTION.members["SSEDescription"], - self.sse_description, - ) - - if self.archival_summary is not None: - serializer.write_struct( - _SCHEMA_TABLE_DESCRIPTION.members["ArchivalSummary"], - self.archival_summary, - ) - - if self.table_class_summary is not None: - serializer.write_struct( - _SCHEMA_TABLE_DESCRIPTION.members["TableClassSummary"], - self.table_class_summary, - ) - - if self.deletion_protection_enabled is not None: - serializer.write_boolean( - _SCHEMA_TABLE_DESCRIPTION.members["DeletionProtectionEnabled"], - self.deletion_protection_enabled, - ) - - if self.on_demand_throughput is not None: - serializer.write_struct( - _SCHEMA_TABLE_DESCRIPTION.members["OnDemandThroughput"], - self.on_demand_throughput, - ) - - if self.warm_throughput is not None: - serializer.write_struct( - _SCHEMA_TABLE_DESCRIPTION.members["WarmThroughput"], - self.warm_throughput, - ) - - if self.multi_region_consistency is not None: - serializer.write_string( - _SCHEMA_TABLE_DESCRIPTION.members["MultiRegionConsistency"], - self.multi_region_consistency, - ) - - if self.vector_indexes is not None: - _serialize_vector_index_description_list( - serializer, - _SCHEMA_TABLE_DESCRIPTION.members["VectorIndexes"], - self.vector_indexes, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["attribute_definitions"] = ( - _deserialize_attribute_definitions( - de, - _SCHEMA_TABLE_DESCRIPTION.members["AttributeDefinitions"], - ) - ) - - case 1: - kwargs["table_name"] = de.read_string( - _SCHEMA_TABLE_DESCRIPTION.members["TableName"] - ) - - case 2: - kwargs["key_schema"] = _deserialize_key_schema( - de, _SCHEMA_TABLE_DESCRIPTION.members["KeySchema"] - ) - - case 3: - kwargs["table_status"] = TableStatus( - de.read_string(_SCHEMA_TABLE_DESCRIPTION.members["TableStatus"]) - ) - - case 4: - kwargs["creation_date_time"] = de.read_timestamp( - _SCHEMA_TABLE_DESCRIPTION.members["CreationDateTime"] - ) - - case 5: - kwargs["provisioned_throughput"] = ( - ProvisionedThroughputDescription.deserialize(de) - ) - - case 6: - kwargs["table_size_bytes"] = de.read_long( - _SCHEMA_TABLE_DESCRIPTION.members["TableSizeBytes"] - ) - - case 7: - kwargs["item_count"] = de.read_long( - _SCHEMA_TABLE_DESCRIPTION.members["ItemCount"] - ) - - case 8: - kwargs["table_arn"] = de.read_string( - _SCHEMA_TABLE_DESCRIPTION.members["TableArn"] - ) - - case 9: - kwargs["table_id"] = de.read_string( - _SCHEMA_TABLE_DESCRIPTION.members["TableId"] - ) - - case 10: - kwargs["billing_mode_summary"] = BillingModeSummary.deserialize(de) - - case 11: - kwargs["local_secondary_indexes"] = ( - _deserialize_local_secondary_index_description_list( - de, - _SCHEMA_TABLE_DESCRIPTION.members["LocalSecondaryIndexes"], - ) - ) - - case 12: - kwargs["global_secondary_indexes"] = ( - _deserialize_global_secondary_index_description_list( - de, - _SCHEMA_TABLE_DESCRIPTION.members["GlobalSecondaryIndexes"], - ) - ) - - case 13: - kwargs["stream_specification"] = StreamSpecification.deserialize(de) - - case 14: - kwargs["latest_stream_label"] = de.read_string( - _SCHEMA_TABLE_DESCRIPTION.members["LatestStreamLabel"] - ) - - case 15: - kwargs["latest_stream_arn"] = de.read_string( - _SCHEMA_TABLE_DESCRIPTION.members["LatestStreamArn"] - ) - - case 16: - kwargs["global_table_version"] = de.read_string( - _SCHEMA_TABLE_DESCRIPTION.members["GlobalTableVersion"] - ) - - case 17: - kwargs["replicas"] = _deserialize_replica_description_list( - de, _SCHEMA_TABLE_DESCRIPTION.members["Replicas"] - ) - - case 18: - kwargs["global_table_witnesses"] = ( - _deserialize_global_table_witness_description_list( - de, - _SCHEMA_TABLE_DESCRIPTION.members["GlobalTableWitnesses"], - ) - ) - - case 19: - kwargs["global_table_settings_replication_mode"] = ( - GlobalTableSettingsReplicationMode( - de.read_string( - _SCHEMA_TABLE_DESCRIPTION.members[ - "GlobalTableSettingsReplicationMode" - ] - ) - ) - ) - - case 20: - kwargs["restore_summary"] = RestoreSummary.deserialize(de) - - case 21: - kwargs["sse_description"] = SSEDescription.deserialize(de) - - case 22: - kwargs["archival_summary"] = ArchivalSummary.deserialize(de) - - case 23: - kwargs["table_class_summary"] = TableClassSummary.deserialize(de) - - case 24: - kwargs["deletion_protection_enabled"] = de.read_boolean( - _SCHEMA_TABLE_DESCRIPTION.members["DeletionProtectionEnabled"] - ) - - case 25: - kwargs["on_demand_throughput"] = OnDemandThroughput.deserialize(de) - - case 26: - kwargs["warm_throughput"] = ( - TableWarmThroughputDescription.deserialize(de) - ) - - case 27: - kwargs["multi_region_consistency"] = MultiRegionConsistency( - de.read_string( - _SCHEMA_TABLE_DESCRIPTION.members["MultiRegionConsistency"] - ) - ) - - case 28: - kwargs["vector_indexes"] = ( - _deserialize_vector_index_description_list( - de, _SCHEMA_TABLE_DESCRIPTION.members["VectorIndexes"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TABLE_DESCRIPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CreateTableOutput: - """Represents the output of a `CreateTable` operation.""" - - table_description: TableDescription | None = None - """Represents the properties of the table.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_TABLE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.table_description is not None: - serializer.write_struct( - _SCHEMA_CREATE_TABLE_OUTPUT.members["TableDescription"], - self.table_description, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["table_description"] = TableDescription.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_TABLE_OUTPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ResourceInUseException(ServiceError): - """ - The operation conflicts with the resource's availability. For example: - - - You attempted to recreate an existing table. - - - You tried to delete a table currently in the `CREATING` state. - - - You tried to update a resource that was already being updated. - - When appropriate, wait for the ongoing update to complete and attempt - the request again. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESOURCE_IN_USE_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_RESOURCE_IN_USE_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_RESOURCE_IN_USE_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RESOURCE_IN_USE_EXCEPTION, consumer=_consumer) - return kwargs - - -CREATE_TABLE = APIOperation( - input=CreateTableInput, - output=CreateTableOutput, - schema=_SCHEMA_CREATE_TABLE, - input_schema=_SCHEMA_CREATE_TABLE_INPUT, - output_schema=_SCHEMA_CREATE_TABLE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#InvalidEndpointException" - ): InvalidEndpointException, - ShapeID( - "com.amazonaws.dynamodb#LimitExceededException" - ): LimitExceededException, - ShapeID( - "com.amazonaws.dynamodb#ResourceInUseException" - ): ResourceInUseException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_SERVER_ERROR, - _SCHEMA_INVALID_ENDPOINT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_RESOURCE_IN_USE_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class CreateVectorIndexAction: - """A new vector index to be added to a table.""" - - index_name: str - """The name of the vector index. Must be unique within the table.""" - - vector_attribute: VectorAttributeDefinition - """ - The attribute that contains vector embeddings. If multiple vector - indexes reference the same attribute, they must all use the same number - of dimensions. - """ - - projection: Projection - """ - Specifies attributes that are copied (projected) from the table into the - vector index. - """ - - dimensions: int - """The number of dimensions in each vector.""" - - distance_function: str - """ - The distance function used to calculate similarity. Valid values: - `COSINE`, `EUCLIDEAN`, `DOT_PRODUCT`. - """ - - search_schema: list[SearchSchemaElement] | None = None - """ - The partition key and inline filter attribute definitions for the vector - index. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_VECTOR_INDEX_ACTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_VECTOR_INDEX_ACTION.members["IndexName"], self.index_name - ) - serializer.write_struct( - _SCHEMA_CREATE_VECTOR_INDEX_ACTION.members["VectorAttribute"], - self.vector_attribute, - ) - if self.search_schema is not None: - _serialize_search_schema( - serializer, - _SCHEMA_CREATE_VECTOR_INDEX_ACTION.members["SearchSchema"], - self.search_schema, - ) - - serializer.write_struct( - _SCHEMA_CREATE_VECTOR_INDEX_ACTION.members["Projection"], self.projection - ) - serializer.write_long( - _SCHEMA_CREATE_VECTOR_INDEX_ACTION.members["Dimensions"], self.dimensions - ) - serializer.write_string( - _SCHEMA_CREATE_VECTOR_INDEX_ACTION.members["DistanceFunction"], - self.distance_function, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["index_name"] = de.read_string( - _SCHEMA_CREATE_VECTOR_INDEX_ACTION.members["IndexName"] - ) - - case 1: - kwargs["vector_attribute"] = VectorAttributeDefinition.deserialize( - de - ) - - case 2: - kwargs["search_schema"] = _deserialize_search_schema( - de, _SCHEMA_CREATE_VECTOR_INDEX_ACTION.members["SearchSchema"] - ) - - case 3: - kwargs["projection"] = Projection.deserialize(de) - - case 4: - kwargs["dimensions"] = de.read_long( - _SCHEMA_CREATE_VECTOR_INDEX_ACTION.members["Dimensions"] - ) - - case 5: - kwargs["distance_function"] = VectorDistanceFunction( - de.read_string( - _SCHEMA_CREATE_VECTOR_INDEX_ACTION.members[ - "DistanceFunction" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_VECTOR_INDEX_ACTION, consumer=_consumer) - if "index_name" not in kwargs: - kwargs["index_name"] = "" - if "vector_attribute" not in kwargs: - kwargs["vector_attribute"] = VectorAttributeDefinition._smithy_default() - if "projection" not in kwargs: - kwargs["projection"] = Projection._smithy_default() - if "dimensions" not in kwargs: - kwargs["dimensions"] = 0 - if "distance_function" not in kwargs: - kwargs["distance_function"] = VectorDistanceFunction._corrected("") - return kwargs - - -def _serialize_csv_header_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_csv_header_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CsvOptions: - """Processing options for the CSV file being imported.""" - - delimiter: str | None = None - """The delimiter used for separating items in the CSV file being imported.""" - - header_list: list[str] | None = None - """ - List of the headers used to specify a common header for all source CSV - files being imported. If this field is specified then the first line of - each CSV file is treated as data instead of the header. If this field is - not specified the the first line of each CSV file is treated as the - header. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CSV_OPTIONS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.delimiter is not None: - serializer.write_string( - _SCHEMA_CSV_OPTIONS.members["Delimiter"], self.delimiter - ) - - if self.header_list is not None: - _serialize_csv_header_list( - serializer, _SCHEMA_CSV_OPTIONS.members["HeaderList"], self.header_list - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["delimiter"] = de.read_string( - _SCHEMA_CSV_OPTIONS.members["Delimiter"] - ) - - case 1: - kwargs["header_list"] = _deserialize_csv_header_list( - de, _SCHEMA_CSV_OPTIONS.members["HeaderList"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CSV_OPTIONS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteBackupInput: - """Dataclass for DeleteBackupInput structure.""" - - backup_arn: str | None = None - """The ARN associated with the backup.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_BACKUP_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.backup_arn is not None: - serializer.write_string( - _SCHEMA_DELETE_BACKUP_INPUT.members["BackupArn"], self.backup_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["backup_arn"] = de.read_string( - _SCHEMA_DELETE_BACKUP_INPUT.members["BackupArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_BACKUP_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteBackupOutput: - """Dataclass for DeleteBackupOutput structure.""" - - backup_description: BackupDescription | None = None - """Contains the description of the backup created for the table.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_BACKUP_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.backup_description is not None: - serializer.write_struct( - _SCHEMA_DELETE_BACKUP_OUTPUT.members["BackupDescription"], - self.backup_description, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["backup_description"] = BackupDescription.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_BACKUP_OUTPUT, consumer=_consumer) - return kwargs - - -DELETE_BACKUP = APIOperation( - input=DeleteBackupInput, - output=DeleteBackupOutput, - schema=_SCHEMA_DELETE_BACKUP, - input_schema=_SCHEMA_DELETE_BACKUP_INPUT, - output_schema=_SCHEMA_DELETE_BACKUP_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.dynamodb#BackupInUseException" - ): BackupInUseException, - ShapeID( - "com.amazonaws.dynamodb#BackupNotFoundException" - ): BackupNotFoundException, - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#InvalidEndpointException" - ): InvalidEndpointException, - ShapeID( - "com.amazonaws.dynamodb#LimitExceededException" - ): LimitExceededException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BACKUP_IN_USE_EXCEPTION, - _SCHEMA_BACKUP_NOT_FOUND_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR, - _SCHEMA_INVALID_ENDPOINT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteGlobalSecondaryIndexAction: - """ - Represents a global secondary index to be deleted from an existing - table. - """ - - index_name: str - """The name of the global secondary index to be deleted.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_GLOBAL_SECONDARY_INDEX_ACTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DELETE_GLOBAL_SECONDARY_INDEX_ACTION.members["IndexName"], - self.index_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["index_name"] = de.read_string( - _SCHEMA_DELETE_GLOBAL_SECONDARY_INDEX_ACTION.members[ - "IndexName" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_GLOBAL_SECONDARY_INDEX_ACTION, consumer=_consumer - ) - if "index_name" not in kwargs: - kwargs["index_name"] = "" - return kwargs - - -@dataclass(kw_only=True) -class DeleteGlobalTableWitnessGroupMemberAction: - """ - Specifies the action to remove a witness Region from a MRSC global - table. You cannot delete a single witness from a MRSC global table - you - must delete both a replica and the witness together. The deletion of - both a witness and replica converts the remaining replica to a - single-Region DynamoDB table. - """ - - region_name: str - """The witness Region name to be removed from the MRSC global table.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DELETE_GLOBAL_TABLE_WITNESS_GROUP_MEMBER_ACTION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DELETE_GLOBAL_TABLE_WITNESS_GROUP_MEMBER_ACTION.members[ - "RegionName" - ], - self.region_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["region_name"] = de.read_string( - _SCHEMA_DELETE_GLOBAL_TABLE_WITNESS_GROUP_MEMBER_ACTION.members[ - "RegionName" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_GLOBAL_TABLE_WITNESS_GROUP_MEMBER_ACTION, consumer=_consumer - ) - if "region_name" not in kwargs: - kwargs["region_name"] = "" - return kwargs - - -class ReturnValue(UnknownEnumMixin, StrEnum): - NONE = "NONE" - ALL_OLD = "ALL_OLD" - UPDATED_OLD = "UPDATED_OLD" - ALL_NEW = "ALL_NEW" - UPDATED_NEW = "UPDATED_NEW" - - -@dataclass(kw_only=True) -class TransactionConflictException(ServiceError): - """ - Operation was rejected because there is an ongoing transaction for the - item. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRANSACTION_CONFLICT_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_TRANSACTION_CONFLICT_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_TRANSACTION_CONFLICT_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_TRANSACTION_CONFLICT_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteReplicaAction: - """Represents a replica to be removed.""" - - region_name: str - """The Region of the replica to be removed.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_REPLICA_ACTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DELETE_REPLICA_ACTION.members["RegionName"], self.region_name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["region_name"] = de.read_string( - _SCHEMA_DELETE_REPLICA_ACTION.members["RegionName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_REPLICA_ACTION, consumer=_consumer) - if "region_name" not in kwargs: - kwargs["region_name"] = "" - return kwargs - - -@dataclass(kw_only=True) -class DeleteReplicationGroupMemberAction: - """Represents a replica to be deleted.""" - - region_name: str - """The Region where the replica exists.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_REPLICATION_GROUP_MEMBER_ACTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DELETE_REPLICATION_GROUP_MEMBER_ACTION.members["RegionName"], - self.region_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["region_name"] = de.read_string( - _SCHEMA_DELETE_REPLICATION_GROUP_MEMBER_ACTION.members[ - "RegionName" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_REPLICATION_GROUP_MEMBER_ACTION, consumer=_consumer - ) - if "region_name" not in kwargs: - kwargs["region_name"] = "" - return kwargs - - -@dataclass(kw_only=True) -class DeleteResourcePolicyInput: - """Dataclass for DeleteResourcePolicyInput structure.""" - - resource_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the DynamoDB resource from which the - policy will be removed. The resources you can specify include tables and - streams. If you remove the policy of a table, it will also remove the - permissions for the table's indexes defined in that policy document. - This is because index permissions are defined in the table's policy. - """ - - expected_revision_id: str | None = None - """ - A string value that you can use to conditionally delete your policy. - When you provide an expected revision ID, if the revision ID of the - existing policy on the resource doesn't match or if there's no policy - attached to the resource, the request will fail and return a - `PolicyNotFoundException`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_RESOURCE_POLICY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_DELETE_RESOURCE_POLICY_INPUT.members["ResourceArn"], - self.resource_arn, - ) - - if self.expected_revision_id is not None: - serializer.write_string( - _SCHEMA_DELETE_RESOURCE_POLICY_INPUT.members["ExpectedRevisionId"], - self.expected_revision_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_DELETE_RESOURCE_POLICY_INPUT.members["ResourceArn"] - ) - - case 1: - kwargs["expected_revision_id"] = de.read_string( - _SCHEMA_DELETE_RESOURCE_POLICY_INPUT.members[ - "ExpectedRevisionId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_RESOURCE_POLICY_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteResourcePolicyOutput: - """Dataclass for DeleteResourcePolicyOutput structure.""" - - revision_id: str | None = None - """ - A unique string that represents the revision ID of the policy. If - you're comparing revision IDs, make sure to always use string - comparison logic. - - This value will be empty if you make a request against a resource - without a policy. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_RESOURCE_POLICY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.revision_id is not None: - serializer.write_string( - _SCHEMA_DELETE_RESOURCE_POLICY_OUTPUT.members["RevisionId"], - self.revision_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["revision_id"] = de.read_string( - _SCHEMA_DELETE_RESOURCE_POLICY_OUTPUT.members["RevisionId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_RESOURCE_POLICY_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class PolicyNotFoundException(ServiceError): - """ - The operation tried to access a nonexistent resource-based policy. - - If you specified an `ExpectedRevisionId`, it's possible that a policy - is present for the resource but its revision ID didn't match the - expected value. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_POLICY_NOT_FOUND_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_POLICY_NOT_FOUND_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_POLICY_NOT_FOUND_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_POLICY_NOT_FOUND_EXCEPTION, consumer=_consumer) - return kwargs - - -DELETE_RESOURCE_POLICY = APIOperation( - input=DeleteResourcePolicyInput, - output=DeleteResourcePolicyOutput, - schema=_SCHEMA_DELETE_RESOURCE_POLICY, - input_schema=_SCHEMA_DELETE_RESOURCE_POLICY_INPUT, - output_schema=_SCHEMA_DELETE_RESOURCE_POLICY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#InvalidEndpointException" - ): InvalidEndpointException, - ShapeID( - "com.amazonaws.dynamodb#LimitExceededException" - ): LimitExceededException, - ShapeID( - "com.amazonaws.dynamodb#PolicyNotFoundException" - ): PolicyNotFoundException, - ShapeID( - "com.amazonaws.dynamodb#ResourceInUseException" - ): ResourceInUseException, - ShapeID( - "com.amazonaws.dynamodb#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_SERVER_ERROR, - _SCHEMA_INVALID_ENDPOINT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_POLICY_NOT_FOUND_EXCEPTION, - _SCHEMA_RESOURCE_IN_USE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteTableInput: - """Represents the input of a `DeleteTable` operation.""" - - table_name: str | None = None - """ - The name of the table to delete. You can also provide the Amazon - Resource Name (ARN) of the table in this parameter. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_TABLE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.table_name is not None: - serializer.write_string( - _SCHEMA_DELETE_TABLE_INPUT.members["TableName"], self.table_name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["table_name"] = de.read_string( - _SCHEMA_DELETE_TABLE_INPUT.members["TableName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_TABLE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteTableOutput: - """Represents the output of a `DeleteTable` operation.""" - - table_description: TableDescription | None = None - """Represents the properties of a table.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_TABLE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.table_description is not None: - serializer.write_struct( - _SCHEMA_DELETE_TABLE_OUTPUT.members["TableDescription"], - self.table_description, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["table_description"] = TableDescription.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_TABLE_OUTPUT, consumer=_consumer) - return kwargs - - -DELETE_TABLE = APIOperation( - input=DeleteTableInput, - output=DeleteTableOutput, - schema=_SCHEMA_DELETE_TABLE, - input_schema=_SCHEMA_DELETE_TABLE_INPUT, - output_schema=_SCHEMA_DELETE_TABLE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#InvalidEndpointException" - ): InvalidEndpointException, - ShapeID( - "com.amazonaws.dynamodb#LimitExceededException" - ): LimitExceededException, - ShapeID( - "com.amazonaws.dynamodb#ResourceInUseException" - ): ResourceInUseException, - ShapeID( - "com.amazonaws.dynamodb#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_SERVER_ERROR, - _SCHEMA_INVALID_ENDPOINT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_RESOURCE_IN_USE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteVectorIndexAction: - """A vector index to be removed from a table.""" - - index_name: str - """The name of the vector index to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_VECTOR_INDEX_ACTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DELETE_VECTOR_INDEX_ACTION.members["IndexName"], self.index_name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["index_name"] = de.read_string( - _SCHEMA_DELETE_VECTOR_INDEX_ACTION.members["IndexName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_VECTOR_INDEX_ACTION, consumer=_consumer) - if "index_name" not in kwargs: - kwargs["index_name"] = "" - return kwargs - - -@dataclass(kw_only=True) -class DescribeBackupInput: - """Dataclass for DescribeBackupInput structure.""" - - backup_arn: str | None = None - """The Amazon Resource Name (ARN) associated with the backup.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DESCRIBE_BACKUP_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.backup_arn is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_BACKUP_INPUT.members["BackupArn"], self.backup_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["backup_arn"] = de.read_string( - _SCHEMA_DESCRIBE_BACKUP_INPUT.members["BackupArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DESCRIBE_BACKUP_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DescribeBackupOutput: - """Dataclass for DescribeBackupOutput structure.""" - - backup_description: BackupDescription | None = None - """Contains the description of the backup created for the table.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DESCRIBE_BACKUP_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.backup_description is not None: - serializer.write_struct( - _SCHEMA_DESCRIBE_BACKUP_OUTPUT.members["BackupDescription"], - self.backup_description, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["backup_description"] = BackupDescription.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DESCRIBE_BACKUP_OUTPUT, consumer=_consumer) - return kwargs - - -DESCRIBE_BACKUP = APIOperation( - input=DescribeBackupInput, - output=DescribeBackupOutput, - schema=_SCHEMA_DESCRIBE_BACKUP, - input_schema=_SCHEMA_DESCRIBE_BACKUP_INPUT, - output_schema=_SCHEMA_DESCRIBE_BACKUP_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.dynamodb#BackupNotFoundException" - ): BackupNotFoundException, - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#InvalidEndpointException" - ): InvalidEndpointException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BACKUP_NOT_FOUND_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR, - _SCHEMA_INVALID_ENDPOINT_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DescribeContinuousBackupsInput: - """Dataclass for DescribeContinuousBackupsInput structure.""" - - table_name: str | None = None - """ - Name of the table for which the customer wants to check the continuous - backups and point in time recovery settings. - - You can also provide the Amazon Resource Name (ARN) of the table in this - parameter. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DESCRIBE_CONTINUOUS_BACKUPS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.table_name is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_CONTINUOUS_BACKUPS_INPUT.members["TableName"], - self.table_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["table_name"] = de.read_string( - _SCHEMA_DESCRIBE_CONTINUOUS_BACKUPS_INPUT.members["TableName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DESCRIBE_CONTINUOUS_BACKUPS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DescribeContinuousBackupsOutput: - """Dataclass for DescribeContinuousBackupsOutput structure.""" - - continuous_backups_description: ContinuousBackupsDescription | None = None - """ - Represents the continuous backups and point in time recovery settings on - the table. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DESCRIBE_CONTINUOUS_BACKUPS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.continuous_backups_description is not None: - serializer.write_struct( - _SCHEMA_DESCRIBE_CONTINUOUS_BACKUPS_OUTPUT.members[ - "ContinuousBackupsDescription" - ], - self.continuous_backups_description, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["continuous_backups_description"] = ( - ContinuousBackupsDescription.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DESCRIBE_CONTINUOUS_BACKUPS_OUTPUT, consumer=_consumer - ) - return kwargs - - -DESCRIBE_CONTINUOUS_BACKUPS = APIOperation( - input=DescribeContinuousBackupsInput, - output=DescribeContinuousBackupsOutput, - schema=_SCHEMA_DESCRIBE_CONTINUOUS_BACKUPS, - input_schema=_SCHEMA_DESCRIBE_CONTINUOUS_BACKUPS_INPUT, - output_schema=_SCHEMA_DESCRIBE_CONTINUOUS_BACKUPS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#InvalidEndpointException" - ): InvalidEndpointException, - ShapeID( - "com.amazonaws.dynamodb#TableNotFoundException" - ): TableNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_SERVER_ERROR, - _SCHEMA_INVALID_ENDPOINT_EXCEPTION, - _SCHEMA_TABLE_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DescribeContributorInsightsInput: - """Dataclass for DescribeContributorInsightsInput structure.""" - - table_name: str | None = None - """ - The name of the table to describe. You can also provide the Amazon - Resource Name (ARN) of the table in this parameter. - """ - - index_name: str | None = None - """The name of the global secondary index to describe, if applicable.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DESCRIBE_CONTRIBUTOR_INSIGHTS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.table_name is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_CONTRIBUTOR_INSIGHTS_INPUT.members["TableName"], - self.table_name, - ) - - if self.index_name is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_CONTRIBUTOR_INSIGHTS_INPUT.members["IndexName"], - self.index_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["table_name"] = de.read_string( - _SCHEMA_DESCRIBE_CONTRIBUTOR_INSIGHTS_INPUT.members["TableName"] - ) - - case 1: - kwargs["index_name"] = de.read_string( - _SCHEMA_DESCRIBE_CONTRIBUTOR_INSIGHTS_INPUT.members["IndexName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DESCRIBE_CONTRIBUTOR_INSIGHTS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class FailureException: - """Represents a failure a contributor insights operation.""" - - exception_name: str | None = None - """Exception name.""" - - exception_description: str | None = None - """Description of the failure.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FAILURE_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.exception_name is not None: - serializer.write_string( - _SCHEMA_FAILURE_EXCEPTION.members["ExceptionName"], self.exception_name - ) - - if self.exception_description is not None: - serializer.write_string( - _SCHEMA_FAILURE_EXCEPTION.members["ExceptionDescription"], - self.exception_description, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["exception_name"] = de.read_string( - _SCHEMA_FAILURE_EXCEPTION.members["ExceptionName"] - ) - - case 1: - kwargs["exception_description"] = de.read_string( - _SCHEMA_FAILURE_EXCEPTION.members["ExceptionDescription"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FAILURE_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DescribeContributorInsightsOutput: - """Dataclass for DescribeContributorInsightsOutput structure.""" - - table_name: str | None = None - """The name of the table being described.""" - - index_name: str | None = None - """The name of the global secondary index being described.""" - - contributor_insights_rule_list: list[str] | None = None - """List of names of the associated contributor insights rules.""" - - contributor_insights_status: str | None = None - """Current status of contributor insights.""" - - last_update_date_time: datetime | None = None - """Timestamp of the last time the status was changed.""" - - failure_exception: FailureException | None = None - """ - Returns information about the last failure that was encountered. - - The most common exceptions for a FAILED status are: - - - LimitExceededException - Per-account Amazon CloudWatch Contributor - Insights rule limit reached. Please disable Contributor Insights for - other tables/indexes OR disable Contributor Insights rules before - retrying. - - - AccessDeniedException - Amazon CloudWatch Contributor Insights rules - cannot be modified due to insufficient permissions. - - - AccessDeniedException - Failed to create service-linked role for - Contributor Insights due to insufficient permissions. - - - InternalServerError - Failed to create Amazon CloudWatch Contributor - Insights rules. Please retry request. - """ - - contributor_insights_mode: str | None = None - """ - The mode of CloudWatch Contributor Insights for DynamoDB that determines - which events are emitted. Can be set to track all access and throttled - events or throttled events only. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DESCRIBE_CONTRIBUTOR_INSIGHTS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.table_name is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_CONTRIBUTOR_INSIGHTS_OUTPUT.members["TableName"], - self.table_name, - ) - - if self.index_name is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_CONTRIBUTOR_INSIGHTS_OUTPUT.members["IndexName"], - self.index_name, - ) - - if self.contributor_insights_rule_list is not None: - _serialize_contributor_insights_rule_list( - serializer, - _SCHEMA_DESCRIBE_CONTRIBUTOR_INSIGHTS_OUTPUT.members[ - "ContributorInsightsRuleList" - ], - self.contributor_insights_rule_list, - ) - - if self.contributor_insights_status is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_CONTRIBUTOR_INSIGHTS_OUTPUT.members[ - "ContributorInsightsStatus" - ], - self.contributor_insights_status, - ) - - if self.last_update_date_time is not None: - serializer.write_timestamp( - _SCHEMA_DESCRIBE_CONTRIBUTOR_INSIGHTS_OUTPUT.members[ - "LastUpdateDateTime" - ], - self.last_update_date_time, - ) - - if self.failure_exception is not None: - serializer.write_struct( - _SCHEMA_DESCRIBE_CONTRIBUTOR_INSIGHTS_OUTPUT.members[ - "FailureException" - ], - self.failure_exception, - ) - - if self.contributor_insights_mode is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_CONTRIBUTOR_INSIGHTS_OUTPUT.members[ - "ContributorInsightsMode" - ], - self.contributor_insights_mode, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["table_name"] = de.read_string( - _SCHEMA_DESCRIBE_CONTRIBUTOR_INSIGHTS_OUTPUT.members[ - "TableName" - ] - ) - - case 1: - kwargs["index_name"] = de.read_string( - _SCHEMA_DESCRIBE_CONTRIBUTOR_INSIGHTS_OUTPUT.members[ - "IndexName" - ] - ) - - case 2: - kwargs["contributor_insights_rule_list"] = ( - _deserialize_contributor_insights_rule_list( - de, - _SCHEMA_DESCRIBE_CONTRIBUTOR_INSIGHTS_OUTPUT.members[ - "ContributorInsightsRuleList" - ], - ) - ) - - case 3: - kwargs["contributor_insights_status"] = ContributorInsightsStatus( - de.read_string( - _SCHEMA_DESCRIBE_CONTRIBUTOR_INSIGHTS_OUTPUT.members[ - "ContributorInsightsStatus" - ] - ) - ) - - case 4: - kwargs["last_update_date_time"] = de.read_timestamp( - _SCHEMA_DESCRIBE_CONTRIBUTOR_INSIGHTS_OUTPUT.members[ - "LastUpdateDateTime" - ] - ) - - case 5: - kwargs["failure_exception"] = FailureException.deserialize(de) - - case 6: - kwargs["contributor_insights_mode"] = ContributorInsightsMode( - de.read_string( - _SCHEMA_DESCRIBE_CONTRIBUTOR_INSIGHTS_OUTPUT.members[ - "ContributorInsightsMode" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DESCRIBE_CONTRIBUTOR_INSIGHTS_OUTPUT, consumer=_consumer - ) - return kwargs - - -DESCRIBE_CONTRIBUTOR_INSIGHTS = APIOperation( - input=DescribeContributorInsightsInput, - output=DescribeContributorInsightsOutput, - schema=_SCHEMA_DESCRIBE_CONTRIBUTOR_INSIGHTS, - input_schema=_SCHEMA_DESCRIBE_CONTRIBUTOR_INSIGHTS_INPUT, - output_schema=_SCHEMA_DESCRIBE_CONTRIBUTOR_INSIGHTS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[_SCHEMA_INTERNAL_SERVER_ERROR, _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION], -) - - -@dataclass(kw_only=True) -class DescribeEndpointsInput: - """Dataclass for DescribeEndpointsInput structure.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DESCRIBE_ENDPOINTS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DESCRIBE_ENDPOINTS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Endpoint: - """An endpoint information details.""" - - address: str - """IP address of the endpoint.""" - - cache_period_in_minutes: int = 0 - """Endpoint cache time to live (TTL) value.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ENDPOINT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_ENDPOINT.members["Address"], self.address) - serializer.write_long( - _SCHEMA_ENDPOINT.members["CachePeriodInMinutes"], - self.cache_period_in_minutes, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["address"] = de.read_string( - _SCHEMA_ENDPOINT.members["Address"] - ) - - case 1: - kwargs["cache_period_in_minutes"] = de.read_long( - _SCHEMA_ENDPOINT.members["CachePeriodInMinutes"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ENDPOINT, consumer=_consumer) - if "address" not in kwargs: - kwargs["address"] = "" - return kwargs - - -def _serialize_endpoints( - serializer: ShapeSerializer, schema: Schema, value: list[Endpoint] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_endpoints( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Endpoint]: - result: list[Endpoint] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Endpoint.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class DescribeEndpointsOutput: - """Dataclass for DescribeEndpointsOutput structure.""" - - endpoints: list[Endpoint] - """List of endpoints.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DESCRIBE_ENDPOINTS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_endpoints( - serializer, - _SCHEMA_DESCRIBE_ENDPOINTS_OUTPUT.members["Endpoints"], - self.endpoints, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["endpoints"] = _deserialize_endpoints( - de, _SCHEMA_DESCRIBE_ENDPOINTS_OUTPUT.members["Endpoints"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DESCRIBE_ENDPOINTS_OUTPUT, consumer=_consumer) - if "endpoints" not in kwargs: - kwargs["endpoints"] = [] - return kwargs - - -DESCRIBE_ENDPOINTS = APIOperation( - input=DescribeEndpointsInput, - output=DescribeEndpointsOutput, - schema=_SCHEMA_DESCRIBE_ENDPOINTS, - input_schema=_SCHEMA_DESCRIBE_ENDPOINTS_INPUT, - output_schema=_SCHEMA_DESCRIBE_ENDPOINTS_OUTPUT, - error_registry=TypeRegistry({}), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[], -) - - -@dataclass(kw_only=True) -class DescribeExportInput: - """Dataclass for DescribeExportInput structure.""" - - export_arn: str | None = None - """The Amazon Resource Name (ARN) associated with the export.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DESCRIBE_EXPORT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.export_arn is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_EXPORT_INPUT.members["ExportArn"], self.export_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["export_arn"] = de.read_string( - _SCHEMA_DESCRIBE_EXPORT_INPUT.members["ExportArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DESCRIBE_EXPORT_INPUT, consumer=_consumer) - return kwargs - - -class ExportFormat(UnknownEnumMixin, StrEnum): - DYNAMODB_JSON = "DYNAMODB_JSON" - ION = "ION" - - -class ExportStatus(UnknownEnumMixin, StrEnum): - IN_PROGRESS = "IN_PROGRESS" - COMPLETED = "COMPLETED" - FAILED = "FAILED" - - -class ExportType(UnknownEnumMixin, StrEnum): - FULL_EXPORT = "FULL_EXPORT" - INCREMENTAL_EXPORT = "INCREMENTAL_EXPORT" - - -class ExportViewType(UnknownEnumMixin, StrEnum): - NEW_IMAGE = "NEW_IMAGE" - NEW_AND_OLD_IMAGES = "NEW_AND_OLD_IMAGES" - - -@dataclass(kw_only=True) -class IncrementalExportSpecification: - """ - Optional object containing the parameters specific to an incremental - export. - """ - - export_from_time: datetime | None = None - """ - Time in the past which provides the inclusive start range for the export - table's data, counted in seconds from the start of the Unix epoch. The - incremental export will reflect the table's state including and after - this point in time. - """ - - export_to_time: datetime | None = None - """ - Time in the past which provides the exclusive end range for the export - table's data, counted in seconds from the start of the Unix epoch. The - incremental export will reflect the table's state just prior to this - point in time. If this is not provided, the latest time with data - available will be used. - """ - - export_view_type: str | None = None - """ - The view type that was chosen for the export. Valid values are - `NEW_AND_OLD_IMAGES` and `NEW_IMAGES`. The default value is - `NEW_AND_OLD_IMAGES`. - - `NEW_AND_OLD_IMAGES` exports both the new and old images of each changed - item, while `NEW_IMAGES` exports only the new (latest) image. The view - type you choose determines the structure of each item in the output for - `insert`, `update`, and `delete` operations. For details and examples of - how each view type shapes the export output, see [DynamoDB table export - output - format](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/S3DataExport.Output.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INCREMENTAL_EXPORT_SPECIFICATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.export_from_time is not None: - serializer.write_timestamp( - _SCHEMA_INCREMENTAL_EXPORT_SPECIFICATION.members["ExportFromTime"], - self.export_from_time, - ) - - if self.export_to_time is not None: - serializer.write_timestamp( - _SCHEMA_INCREMENTAL_EXPORT_SPECIFICATION.members["ExportToTime"], - self.export_to_time, - ) - - if self.export_view_type is not None: - serializer.write_string( - _SCHEMA_INCREMENTAL_EXPORT_SPECIFICATION.members["ExportViewType"], - self.export_view_type, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["export_from_time"] = de.read_timestamp( - _SCHEMA_INCREMENTAL_EXPORT_SPECIFICATION.members[ - "ExportFromTime" - ] - ) - - case 1: - kwargs["export_to_time"] = de.read_timestamp( - _SCHEMA_INCREMENTAL_EXPORT_SPECIFICATION.members["ExportToTime"] - ) - - case 2: - kwargs["export_view_type"] = ExportViewType( - de.read_string( - _SCHEMA_INCREMENTAL_EXPORT_SPECIFICATION.members[ - "ExportViewType" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INCREMENTAL_EXPORT_SPECIFICATION, consumer=_consumer - ) - return kwargs - - -class S3SseAlgorithm(UnknownEnumMixin, StrEnum): - AES256 = "AES256" - KMS = "KMS" - - -@dataclass(kw_only=True) -class ExportNotFoundException(ServiceError): - """The specified export was not found.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EXPORT_NOT_FOUND_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_EXPORT_NOT_FOUND_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_EXPORT_NOT_FOUND_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EXPORT_NOT_FOUND_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DescribeGlobalTableInput: - """Dataclass for DescribeGlobalTableInput structure.""" - - global_table_name: str | None = None - """The name of the global table.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DESCRIBE_GLOBAL_TABLE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.global_table_name is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_GLOBAL_TABLE_INPUT.members["GlobalTableName"], - self.global_table_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["global_table_name"] = de.read_string( - _SCHEMA_DESCRIBE_GLOBAL_TABLE_INPUT.members["GlobalTableName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DESCRIBE_GLOBAL_TABLE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DescribeGlobalTableOutput: - """Dataclass for DescribeGlobalTableOutput structure.""" - - global_table_description: GlobalTableDescription | None = None - """Contains the details of the global table.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DESCRIBE_GLOBAL_TABLE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.global_table_description is not None: - serializer.write_struct( - _SCHEMA_DESCRIBE_GLOBAL_TABLE_OUTPUT.members["GlobalTableDescription"], - self.global_table_description, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["global_table_description"] = ( - GlobalTableDescription.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DESCRIBE_GLOBAL_TABLE_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GlobalTableNotFoundException(ServiceError): - """The specified global table does not exist.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GLOBAL_TABLE_NOT_FOUND_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_GLOBAL_TABLE_NOT_FOUND_EXCEPTION.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_GLOBAL_TABLE_NOT_FOUND_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GLOBAL_TABLE_NOT_FOUND_EXCEPTION, consumer=_consumer - ) - return kwargs - - -DESCRIBE_GLOBAL_TABLE = APIOperation( - input=DescribeGlobalTableInput, - output=DescribeGlobalTableOutput, - schema=_SCHEMA_DESCRIBE_GLOBAL_TABLE, - input_schema=_SCHEMA_DESCRIBE_GLOBAL_TABLE_INPUT, - output_schema=_SCHEMA_DESCRIBE_GLOBAL_TABLE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.dynamodb#GlobalTableNotFoundException" - ): GlobalTableNotFoundException, - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#InvalidEndpointException" - ): InvalidEndpointException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_GLOBAL_TABLE_NOT_FOUND_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR, - _SCHEMA_INVALID_ENDPOINT_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DescribeGlobalTableSettingsInput: - """Dataclass for DescribeGlobalTableSettingsInput structure.""" - - global_table_name: str | None = None - """The name of the global table to describe.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DESCRIBE_GLOBAL_TABLE_SETTINGS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.global_table_name is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_GLOBAL_TABLE_SETTINGS_INPUT.members["GlobalTableName"], - self.global_table_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["global_table_name"] = de.read_string( - _SCHEMA_DESCRIBE_GLOBAL_TABLE_SETTINGS_INPUT.members[ - "GlobalTableName" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DESCRIBE_GLOBAL_TABLE_SETTINGS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ReplicaGlobalSecondaryIndexSettingsDescription: - """Represents the properties of a global secondary index.""" - - index_name: str - """ - The name of the global secondary index. The name must be unique among - all other indexes on this table. - """ - - index_status: str | None = None - """ - The current status of the global secondary index: - - - `CREATING` - The global secondary index is being created. - - - `UPDATING` - The global secondary index is being updated. - - - `DELETING` - The global secondary index is being deleted. - - - `ACTIVE` - The global secondary index is ready for use. - """ - - provisioned_read_capacity_units: int | None = None - """ - The maximum number of strongly consistent reads consumed per second - before DynamoDB returns a `ThrottlingException`. - """ - - provisioned_read_capacity_auto_scaling_settings: ( - AutoScalingSettingsDescription | None - ) = None - """ - Auto scaling settings for a global secondary index replica's read - capacity units. - """ - - provisioned_write_capacity_units: int | None = None - """ - The maximum number of writes consumed per second before DynamoDB returns - a `ThrottlingException`. - """ - - provisioned_write_capacity_auto_scaling_settings: ( - AutoScalingSettingsDescription | None - ) = None - """ - Auto scaling settings for a global secondary index replica's write - capacity units. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX_SETTINGS_DESCRIPTION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX_SETTINGS_DESCRIPTION.members[ - "IndexName" - ], - self.index_name, - ) - if self.index_status is not None: - serializer.write_string( - _SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX_SETTINGS_DESCRIPTION.members[ - "IndexStatus" - ], - self.index_status, - ) - - if self.provisioned_read_capacity_units is not None: - serializer.write_long( - _SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX_SETTINGS_DESCRIPTION.members[ - "ProvisionedReadCapacityUnits" - ], - self.provisioned_read_capacity_units, - ) - - if self.provisioned_read_capacity_auto_scaling_settings is not None: - serializer.write_struct( - _SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX_SETTINGS_DESCRIPTION.members[ - "ProvisionedReadCapacityAutoScalingSettings" - ], - self.provisioned_read_capacity_auto_scaling_settings, - ) - - if self.provisioned_write_capacity_units is not None: - serializer.write_long( - _SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX_SETTINGS_DESCRIPTION.members[ - "ProvisionedWriteCapacityUnits" - ], - self.provisioned_write_capacity_units, - ) - - if self.provisioned_write_capacity_auto_scaling_settings is not None: - serializer.write_struct( - _SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX_SETTINGS_DESCRIPTION.members[ - "ProvisionedWriteCapacityAutoScalingSettings" - ], - self.provisioned_write_capacity_auto_scaling_settings, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["index_name"] = de.read_string( - _SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX_SETTINGS_DESCRIPTION.members[ - "IndexName" - ] - ) - - case 1: - kwargs["index_status"] = IndexStatus( - de.read_string( - _SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX_SETTINGS_DESCRIPTION.members[ - "IndexStatus" - ] - ) - ) - - case 2: - kwargs["provisioned_read_capacity_units"] = de.read_long( - _SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX_SETTINGS_DESCRIPTION.members[ - "ProvisionedReadCapacityUnits" - ] - ) - - case 3: - kwargs["provisioned_read_capacity_auto_scaling_settings"] = ( - AutoScalingSettingsDescription.deserialize(de) - ) - - case 4: - kwargs["provisioned_write_capacity_units"] = de.read_long( - _SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX_SETTINGS_DESCRIPTION.members[ - "ProvisionedWriteCapacityUnits" - ] - ) - - case 5: - kwargs["provisioned_write_capacity_auto_scaling_settings"] = ( - AutoScalingSettingsDescription.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX_SETTINGS_DESCRIPTION, - consumer=_consumer, - ) - if "index_name" not in kwargs: - kwargs["index_name"] = "" - return kwargs - - -def _serialize_replica_global_secondary_index_settings_description_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[ReplicaGlobalSecondaryIndexSettingsDescription], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_replica_global_secondary_index_settings_description_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ReplicaGlobalSecondaryIndexSettingsDescription]: - result: list[ReplicaGlobalSecondaryIndexSettingsDescription] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ReplicaGlobalSecondaryIndexSettingsDescription.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ReplicaSettingsDescription: - """Represents the properties of a replica.""" - - region_name: str - """The Region name of the replica.""" - - replica_status: str | None = None - """ - The current state of the Region: - - - `CREATING` - The Region is being created. - - - `UPDATING` - The Region is being updated. - - - `DELETING` - The Region is being deleted. - - - `ACTIVE` - The Region is ready for use. - """ - - replica_billing_mode_summary: BillingModeSummary | None = None - """The read/write capacity mode of the replica.""" - - replica_provisioned_read_capacity_units: int | None = None - """ - The maximum number of strongly consistent reads consumed per second - before DynamoDB returns a `ThrottlingException`. For more information, - see [Specifying Read and Write - Requirements](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#ProvisionedThroughput) - in the *Amazon DynamoDB Developer Guide*. - """ - - replica_provisioned_read_capacity_auto_scaling_settings: ( - AutoScalingSettingsDescription | None - ) = None - """Auto scaling settings for a global table replica's read capacity units.""" - - replica_provisioned_write_capacity_units: int | None = None - """ - The maximum number of writes consumed per second before DynamoDB returns - a `ThrottlingException`. For more information, see [Specifying Read and - Write - Requirements](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#ProvisionedThroughput) - in the *Amazon DynamoDB Developer Guide*. - """ - - replica_provisioned_write_capacity_auto_scaling_settings: ( - AutoScalingSettingsDescription | None - ) = None - """ - Auto scaling settings for a global table replica's write capacity - units. - """ - - replica_global_secondary_index_settings: ( - list[ReplicaGlobalSecondaryIndexSettingsDescription] | None - ) = None - """Replica global secondary index settings for the global table.""" - - replica_table_class_summary: TableClassSummary | None = None - """Contains details of the table class.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REPLICA_SETTINGS_DESCRIPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_REPLICA_SETTINGS_DESCRIPTION.members["RegionName"], self.region_name - ) - if self.replica_status is not None: - serializer.write_string( - _SCHEMA_REPLICA_SETTINGS_DESCRIPTION.members["ReplicaStatus"], - self.replica_status, - ) - - if self.replica_billing_mode_summary is not None: - serializer.write_struct( - _SCHEMA_REPLICA_SETTINGS_DESCRIPTION.members[ - "ReplicaBillingModeSummary" - ], - self.replica_billing_mode_summary, - ) - - if self.replica_provisioned_read_capacity_units is not None: - serializer.write_long( - _SCHEMA_REPLICA_SETTINGS_DESCRIPTION.members[ - "ReplicaProvisionedReadCapacityUnits" - ], - self.replica_provisioned_read_capacity_units, - ) - - if self.replica_provisioned_read_capacity_auto_scaling_settings is not None: - serializer.write_struct( - _SCHEMA_REPLICA_SETTINGS_DESCRIPTION.members[ - "ReplicaProvisionedReadCapacityAutoScalingSettings" - ], - self.replica_provisioned_read_capacity_auto_scaling_settings, - ) - - if self.replica_provisioned_write_capacity_units is not None: - serializer.write_long( - _SCHEMA_REPLICA_SETTINGS_DESCRIPTION.members[ - "ReplicaProvisionedWriteCapacityUnits" - ], - self.replica_provisioned_write_capacity_units, - ) - - if self.replica_provisioned_write_capacity_auto_scaling_settings is not None: - serializer.write_struct( - _SCHEMA_REPLICA_SETTINGS_DESCRIPTION.members[ - "ReplicaProvisionedWriteCapacityAutoScalingSettings" - ], - self.replica_provisioned_write_capacity_auto_scaling_settings, - ) - - if self.replica_global_secondary_index_settings is not None: - _serialize_replica_global_secondary_index_settings_description_list( - serializer, - _SCHEMA_REPLICA_SETTINGS_DESCRIPTION.members[ - "ReplicaGlobalSecondaryIndexSettings" - ], - self.replica_global_secondary_index_settings, - ) - - if self.replica_table_class_summary is not None: - serializer.write_struct( - _SCHEMA_REPLICA_SETTINGS_DESCRIPTION.members[ - "ReplicaTableClassSummary" - ], - self.replica_table_class_summary, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["region_name"] = de.read_string( - _SCHEMA_REPLICA_SETTINGS_DESCRIPTION.members["RegionName"] - ) - - case 1: - kwargs["replica_status"] = ReplicaStatus( - de.read_string( - _SCHEMA_REPLICA_SETTINGS_DESCRIPTION.members[ - "ReplicaStatus" - ] - ) - ) - - case 2: - kwargs["replica_billing_mode_summary"] = ( - BillingModeSummary.deserialize(de) - ) - - case 3: - kwargs["replica_provisioned_read_capacity_units"] = de.read_long( - _SCHEMA_REPLICA_SETTINGS_DESCRIPTION.members[ - "ReplicaProvisionedReadCapacityUnits" - ] - ) - - case 4: - kwargs[ - "replica_provisioned_read_capacity_auto_scaling_settings" - ] = AutoScalingSettingsDescription.deserialize(de) - - case 5: - kwargs["replica_provisioned_write_capacity_units"] = de.read_long( - _SCHEMA_REPLICA_SETTINGS_DESCRIPTION.members[ - "ReplicaProvisionedWriteCapacityUnits" - ] - ) - - case 6: - kwargs[ - "replica_provisioned_write_capacity_auto_scaling_settings" - ] = AutoScalingSettingsDescription.deserialize(de) - - case 7: - kwargs["replica_global_secondary_index_settings"] = ( - _deserialize_replica_global_secondary_index_settings_description_list( - de, - _SCHEMA_REPLICA_SETTINGS_DESCRIPTION.members[ - "ReplicaGlobalSecondaryIndexSettings" - ], - ) - ) - - case 8: - kwargs["replica_table_class_summary"] = ( - TableClassSummary.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_REPLICA_SETTINGS_DESCRIPTION, consumer=_consumer - ) - if "region_name" not in kwargs: - kwargs["region_name"] = "" - return kwargs - - -def _serialize_replica_settings_description_list( - serializer: ShapeSerializer, schema: Schema, value: list[ReplicaSettingsDescription] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_replica_settings_description_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ReplicaSettingsDescription]: - result: list[ReplicaSettingsDescription] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ReplicaSettingsDescription.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class DescribeGlobalTableSettingsOutput: - """Dataclass for DescribeGlobalTableSettingsOutput structure.""" - - global_table_name: str | None = None - """The name of the global table.""" - - replica_settings: list[ReplicaSettingsDescription] | None = None - """The Region-specific settings for the global table.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DESCRIBE_GLOBAL_TABLE_SETTINGS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.global_table_name is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_GLOBAL_TABLE_SETTINGS_OUTPUT.members[ - "GlobalTableName" - ], - self.global_table_name, - ) - - if self.replica_settings is not None: - _serialize_replica_settings_description_list( - serializer, - _SCHEMA_DESCRIBE_GLOBAL_TABLE_SETTINGS_OUTPUT.members[ - "ReplicaSettings" - ], - self.replica_settings, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["global_table_name"] = de.read_string( - _SCHEMA_DESCRIBE_GLOBAL_TABLE_SETTINGS_OUTPUT.members[ - "GlobalTableName" - ] - ) - - case 1: - kwargs["replica_settings"] = ( - _deserialize_replica_settings_description_list( - de, - _SCHEMA_DESCRIBE_GLOBAL_TABLE_SETTINGS_OUTPUT.members[ - "ReplicaSettings" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DESCRIBE_GLOBAL_TABLE_SETTINGS_OUTPUT, consumer=_consumer - ) - return kwargs - - -DESCRIBE_GLOBAL_TABLE_SETTINGS = APIOperation( - input=DescribeGlobalTableSettingsInput, - output=DescribeGlobalTableSettingsOutput, - schema=_SCHEMA_DESCRIBE_GLOBAL_TABLE_SETTINGS, - input_schema=_SCHEMA_DESCRIBE_GLOBAL_TABLE_SETTINGS_INPUT, - output_schema=_SCHEMA_DESCRIBE_GLOBAL_TABLE_SETTINGS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.dynamodb#GlobalTableNotFoundException" - ): GlobalTableNotFoundException, - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#InvalidEndpointException" - ): InvalidEndpointException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_GLOBAL_TABLE_NOT_FOUND_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR, - _SCHEMA_INVALID_ENDPOINT_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DescribeImportInput: - """Dataclass for DescribeImportInput structure.""" - - import_arn: str | None = None - """ - The Amazon Resource Name (ARN) associated with the table you're - importing to. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DESCRIBE_IMPORT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.import_arn is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_IMPORT_INPUT.members["ImportArn"], self.import_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["import_arn"] = de.read_string( - _SCHEMA_DESCRIBE_IMPORT_INPUT.members["ImportArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DESCRIBE_IMPORT_INPUT, consumer=_consumer) - return kwargs - - -class ImportStatus(UnknownEnumMixin, StrEnum): - IN_PROGRESS = "IN_PROGRESS" - COMPLETED = "COMPLETED" - CANCELLING = "CANCELLING" - CANCELLED = "CANCELLED" - FAILED = "FAILED" - - -class InputCompressionType(UnknownEnumMixin, StrEnum): - GZIP = "GZIP" - ZSTD = "ZSTD" - NONE = "NONE" - - -class InputFormat(UnknownEnumMixin, StrEnum): - DYNAMODB_JSON = "DYNAMODB_JSON" - ION = "ION" - CSV = "CSV" - - -@dataclass(kw_only=True) -class InputFormatOptions: - """ - The format options for the data that was imported into the target table. - There is one value, CsvOption. - """ - - csv: CsvOptions | None = None - """ - The options for imported source files in CSV format. The values are - Delimiter and HeaderList. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INPUT_FORMAT_OPTIONS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.csv is not None: - serializer.write_struct( - _SCHEMA_INPUT_FORMAT_OPTIONS.members["Csv"], self.csv - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["csv"] = CsvOptions.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INPUT_FORMAT_OPTIONS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class S3BucketSource: - """The S3 bucket that is being imported from.""" - - s3_bucket: str - """The S3 bucket that is being imported from.""" - - s3_bucket_owner: str | None = None - """ - The account number of the S3 bucket that is being imported from. If the - bucket is owned by the requester this is optional. - """ - - s3_key_prefix: str | None = None - """The key prefix shared by all S3 Objects that are being imported.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_S3_BUCKET_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.s3_bucket_owner is not None: - serializer.write_string( - _SCHEMA_S3_BUCKET_SOURCE.members["S3BucketOwner"], self.s3_bucket_owner - ) - - serializer.write_string( - _SCHEMA_S3_BUCKET_SOURCE.members["S3Bucket"], self.s3_bucket - ) - if self.s3_key_prefix is not None: - serializer.write_string( - _SCHEMA_S3_BUCKET_SOURCE.members["S3KeyPrefix"], self.s3_key_prefix - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["s3_bucket_owner"] = de.read_string( - _SCHEMA_S3_BUCKET_SOURCE.members["S3BucketOwner"] - ) - - case 1: - kwargs["s3_bucket"] = de.read_string( - _SCHEMA_S3_BUCKET_SOURCE.members["S3Bucket"] - ) - - case 2: - kwargs["s3_key_prefix"] = de.read_string( - _SCHEMA_S3_BUCKET_SOURCE.members["S3KeyPrefix"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_S3_BUCKET_SOURCE, consumer=_consumer) - if "s3_bucket" not in kwargs: - kwargs["s3_bucket"] = "" - return kwargs - - -@dataclass(kw_only=True) -class TableCreationParameters: - """The parameters for the table created as part of the import operation.""" - - table_name: str - """The name of the table created as part of the import operation.""" - - attribute_definitions: list[AttributeDefinition] - """The attributes of the table created as part of the import operation.""" - - key_schema: list[KeySchemaElement] - """ - The primary key and option sort key of the table created as part of the - import operation. - """ - - billing_mode: str | None = None - """ - The billing mode for provisioning the table created as part of the - import operation. - """ - - provisioned_throughput: ProvisionedThroughput | None = None - """ - Represents the provisioned throughput settings for the specified global - secondary index. You must use `ProvisionedThroughput` or - `OnDemandThroughput` based on your table's capacity mode. - - For current minimum and maximum provisioned throughput values, see - [Service, Account, and Table - Quotas](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - on_demand_throughput: OnDemandThroughput | None = None - """ - Sets the maximum number of read and write units for the specified - on-demand table. If you use this parameter, you must specify - `MaxReadRequestUnits`, `MaxWriteRequestUnits`, or both. - """ - - sse_specification: SSESpecification | None = None - """Represents the settings used to enable server-side encryption.""" - - global_secondary_indexes: list[GlobalSecondaryIndex] | None = None - """ - The Global Secondary Indexes (GSI) of the table to be created as part of - the import operation. - """ - - vector_indexes: list[VectorIndex] | None = None - """ - The vector indexes of the table to be created as part of the import - operation. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TABLE_CREATION_PARAMETERS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_TABLE_CREATION_PARAMETERS.members["TableName"], self.table_name - ) - _serialize_attribute_definitions( - serializer, - _SCHEMA_TABLE_CREATION_PARAMETERS.members["AttributeDefinitions"], - self.attribute_definitions, - ) - _serialize_key_schema( - serializer, - _SCHEMA_TABLE_CREATION_PARAMETERS.members["KeySchema"], - self.key_schema, - ) - if self.billing_mode is not None: - serializer.write_string( - _SCHEMA_TABLE_CREATION_PARAMETERS.members["BillingMode"], - self.billing_mode, - ) - - if self.provisioned_throughput is not None: - serializer.write_struct( - _SCHEMA_TABLE_CREATION_PARAMETERS.members["ProvisionedThroughput"], - self.provisioned_throughput, - ) - - if self.on_demand_throughput is not None: - serializer.write_struct( - _SCHEMA_TABLE_CREATION_PARAMETERS.members["OnDemandThroughput"], - self.on_demand_throughput, - ) - - if self.sse_specification is not None: - serializer.write_struct( - _SCHEMA_TABLE_CREATION_PARAMETERS.members["SSESpecification"], - self.sse_specification, - ) - - if self.global_secondary_indexes is not None: - _serialize_global_secondary_index_list( - serializer, - _SCHEMA_TABLE_CREATION_PARAMETERS.members["GlobalSecondaryIndexes"], - self.global_secondary_indexes, - ) - - if self.vector_indexes is not None: - _serialize_vector_index_list( - serializer, - _SCHEMA_TABLE_CREATION_PARAMETERS.members["VectorIndexes"], - self.vector_indexes, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["table_name"] = de.read_string( - _SCHEMA_TABLE_CREATION_PARAMETERS.members["TableName"] - ) - - case 1: - kwargs["attribute_definitions"] = ( - _deserialize_attribute_definitions( - de, - _SCHEMA_TABLE_CREATION_PARAMETERS.members[ - "AttributeDefinitions" - ], - ) - ) - - case 2: - kwargs["key_schema"] = _deserialize_key_schema( - de, _SCHEMA_TABLE_CREATION_PARAMETERS.members["KeySchema"] - ) - - case 3: - kwargs["billing_mode"] = BillingMode( - de.read_string( - _SCHEMA_TABLE_CREATION_PARAMETERS.members["BillingMode"] - ) - ) - - case 4: - kwargs["provisioned_throughput"] = ( - ProvisionedThroughput.deserialize(de) - ) - - case 5: - kwargs["on_demand_throughput"] = OnDemandThroughput.deserialize(de) - - case 6: - kwargs["sse_specification"] = SSESpecification.deserialize(de) - - case 7: - kwargs["global_secondary_indexes"] = ( - _deserialize_global_secondary_index_list( - de, - _SCHEMA_TABLE_CREATION_PARAMETERS.members[ - "GlobalSecondaryIndexes" - ], - ) - ) - - case 8: - kwargs["vector_indexes"] = _deserialize_vector_index_list( - de, _SCHEMA_TABLE_CREATION_PARAMETERS.members["VectorIndexes"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TABLE_CREATION_PARAMETERS, consumer=_consumer) - if "table_name" not in kwargs: - kwargs["table_name"] = "" - if "attribute_definitions" not in kwargs: - kwargs["attribute_definitions"] = [] - if "key_schema" not in kwargs: - kwargs["key_schema"] = [] - return kwargs - - -@dataclass(kw_only=True) -class ImportTableDescription: - """Represents the properties of the table being imported into.""" - - import_arn: str | None = None - """The Amazon Resource Number (ARN) corresponding to the import request.""" - - import_status: str | None = None - """The status of the import.""" - - table_arn: str | None = None - """The Amazon Resource Number (ARN) of the table being imported into.""" - - table_id: str | None = None - """The table id corresponding to the table created by import table process.""" - - client_token: str | None = None - """ - The client token that was provided for the import task. Reusing the - client token on retry makes a call to `ImportTable` idempotent. - """ - - s3_bucket_source: S3BucketSource | None = None - """ - Values for the S3 bucket the source file is imported from. Includes - bucket name (required), key prefix (optional) and bucket account owner - ID (optional). - """ - - error_count: int = 0 - """ - The number of errors occurred on importing the source file into the - target table. - """ - - cloud_watch_log_group_arn: str | None = None - """ - The Amazon Resource Number (ARN) of the Cloudwatch Log Group associated - with the target table. - """ - - input_format: str | None = None - """The format of the source data going into the target table.""" - - input_format_options: InputFormatOptions | None = None - """ - The format options for the data that was imported into the target table. - There is one value, CsvOption. - """ - - input_compression_type: str | None = None - """ - The compression options for the data that has been imported into the - target table. The values are NONE, GZIP, or ZSTD. - """ - - table_creation_parameters: TableCreationParameters | None = None - """The parameters for the new table that is being imported into.""" - - start_time: datetime | None = None - """The time when this import task started.""" - - end_time: datetime | None = None - """ - The time at which the creation of the table associated with this import - task completed. - """ - - processed_size_bytes: int | None = None - """The total size of data processed from the source file, in Bytes.""" - - processed_item_count: int = 0 - """The total number of items processed from the source file.""" - - imported_item_count: int = 0 - """The number of items successfully imported into the new table.""" - - failure_code: str | None = None - """ - The error code corresponding to the failure that the import job ran into - during execution. - """ - - failure_message: str | None = None - """ - The error message corresponding to the failure that the import job ran - into during execution. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IMPORT_TABLE_DESCRIPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.import_arn is not None: - serializer.write_string( - _SCHEMA_IMPORT_TABLE_DESCRIPTION.members["ImportArn"], self.import_arn - ) - - if self.import_status is not None: - serializer.write_string( - _SCHEMA_IMPORT_TABLE_DESCRIPTION.members["ImportStatus"], - self.import_status, - ) - - if self.table_arn is not None: - serializer.write_string( - _SCHEMA_IMPORT_TABLE_DESCRIPTION.members["TableArn"], self.table_arn - ) - - if self.table_id is not None: - serializer.write_string( - _SCHEMA_IMPORT_TABLE_DESCRIPTION.members["TableId"], self.table_id - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_IMPORT_TABLE_DESCRIPTION.members["ClientToken"], - self.client_token, - ) - - if self.s3_bucket_source is not None: - serializer.write_struct( - _SCHEMA_IMPORT_TABLE_DESCRIPTION.members["S3BucketSource"], - self.s3_bucket_source, - ) - - serializer.write_long( - _SCHEMA_IMPORT_TABLE_DESCRIPTION.members["ErrorCount"], self.error_count - ) - if self.cloud_watch_log_group_arn is not None: - serializer.write_string( - _SCHEMA_IMPORT_TABLE_DESCRIPTION.members["CloudWatchLogGroupArn"], - self.cloud_watch_log_group_arn, - ) - - if self.input_format is not None: - serializer.write_string( - _SCHEMA_IMPORT_TABLE_DESCRIPTION.members["InputFormat"], - self.input_format, - ) - - if self.input_format_options is not None: - serializer.write_struct( - _SCHEMA_IMPORT_TABLE_DESCRIPTION.members["InputFormatOptions"], - self.input_format_options, - ) - - if self.input_compression_type is not None: - serializer.write_string( - _SCHEMA_IMPORT_TABLE_DESCRIPTION.members["InputCompressionType"], - self.input_compression_type, - ) - - if self.table_creation_parameters is not None: - serializer.write_struct( - _SCHEMA_IMPORT_TABLE_DESCRIPTION.members["TableCreationParameters"], - self.table_creation_parameters, - ) - - if self.start_time is not None: - serializer.write_timestamp( - _SCHEMA_IMPORT_TABLE_DESCRIPTION.members["StartTime"], self.start_time - ) - - if self.end_time is not None: - serializer.write_timestamp( - _SCHEMA_IMPORT_TABLE_DESCRIPTION.members["EndTime"], self.end_time - ) - - if self.processed_size_bytes is not None: - serializer.write_long( - _SCHEMA_IMPORT_TABLE_DESCRIPTION.members["ProcessedSizeBytes"], - self.processed_size_bytes, - ) - - serializer.write_long( - _SCHEMA_IMPORT_TABLE_DESCRIPTION.members["ProcessedItemCount"], - self.processed_item_count, - ) - serializer.write_long( - _SCHEMA_IMPORT_TABLE_DESCRIPTION.members["ImportedItemCount"], - self.imported_item_count, - ) - if self.failure_code is not None: - serializer.write_string( - _SCHEMA_IMPORT_TABLE_DESCRIPTION.members["FailureCode"], - self.failure_code, - ) - - if self.failure_message is not None: - serializer.write_string( - _SCHEMA_IMPORT_TABLE_DESCRIPTION.members["FailureMessage"], - self.failure_message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["import_arn"] = de.read_string( - _SCHEMA_IMPORT_TABLE_DESCRIPTION.members["ImportArn"] - ) - - case 1: - kwargs["import_status"] = ImportStatus( - de.read_string( - _SCHEMA_IMPORT_TABLE_DESCRIPTION.members["ImportStatus"] - ) - ) - - case 2: - kwargs["table_arn"] = de.read_string( - _SCHEMA_IMPORT_TABLE_DESCRIPTION.members["TableArn"] - ) - - case 3: - kwargs["table_id"] = de.read_string( - _SCHEMA_IMPORT_TABLE_DESCRIPTION.members["TableId"] - ) - - case 4: - kwargs["client_token"] = de.read_string( - _SCHEMA_IMPORT_TABLE_DESCRIPTION.members["ClientToken"] - ) - - case 5: - kwargs["s3_bucket_source"] = S3BucketSource.deserialize(de) - - case 6: - kwargs["error_count"] = de.read_long( - _SCHEMA_IMPORT_TABLE_DESCRIPTION.members["ErrorCount"] - ) - - case 7: - kwargs["cloud_watch_log_group_arn"] = de.read_string( - _SCHEMA_IMPORT_TABLE_DESCRIPTION.members[ - "CloudWatchLogGroupArn" - ] - ) - - case 8: - kwargs["input_format"] = InputFormat( - de.read_string( - _SCHEMA_IMPORT_TABLE_DESCRIPTION.members["InputFormat"] - ) - ) - - case 9: - kwargs["input_format_options"] = InputFormatOptions.deserialize(de) - - case 10: - kwargs["input_compression_type"] = InputCompressionType( - de.read_string( - _SCHEMA_IMPORT_TABLE_DESCRIPTION.members[ - "InputCompressionType" - ] - ) - ) - - case 11: - kwargs["table_creation_parameters"] = ( - TableCreationParameters.deserialize(de) - ) - - case 12: - kwargs["start_time"] = de.read_timestamp( - _SCHEMA_IMPORT_TABLE_DESCRIPTION.members["StartTime"] - ) - - case 13: - kwargs["end_time"] = de.read_timestamp( - _SCHEMA_IMPORT_TABLE_DESCRIPTION.members["EndTime"] - ) - - case 14: - kwargs["processed_size_bytes"] = de.read_long( - _SCHEMA_IMPORT_TABLE_DESCRIPTION.members["ProcessedSizeBytes"] - ) - - case 15: - kwargs["processed_item_count"] = de.read_long( - _SCHEMA_IMPORT_TABLE_DESCRIPTION.members["ProcessedItemCount"] - ) - - case 16: - kwargs["imported_item_count"] = de.read_long( - _SCHEMA_IMPORT_TABLE_DESCRIPTION.members["ImportedItemCount"] - ) - - case 17: - kwargs["failure_code"] = de.read_string( - _SCHEMA_IMPORT_TABLE_DESCRIPTION.members["FailureCode"] - ) - - case 18: - kwargs["failure_message"] = de.read_string( - _SCHEMA_IMPORT_TABLE_DESCRIPTION.members["FailureMessage"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_IMPORT_TABLE_DESCRIPTION, consumer=_consumer) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls() - - -@dataclass(kw_only=True) -class DescribeImportOutput: - """Dataclass for DescribeImportOutput structure.""" - - import_table_description: ImportTableDescription - """ - Represents the properties of the table created for the import, and - parameters of the import. The import parameters include import status, - how many items were processed, and how many errors were encountered. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DESCRIBE_IMPORT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DESCRIBE_IMPORT_OUTPUT.members["ImportTableDescription"], - self.import_table_description, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["import_table_description"] = ( - ImportTableDescription.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DESCRIBE_IMPORT_OUTPUT, consumer=_consumer) - if "import_table_description" not in kwargs: - kwargs["import_table_description"] = ( - ImportTableDescription._smithy_default() - ) - return kwargs - - -@dataclass(kw_only=True) -class ImportNotFoundException(ServiceError): - """The specified import was not found.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IMPORT_NOT_FOUND_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_IMPORT_NOT_FOUND_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_IMPORT_NOT_FOUND_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_IMPORT_NOT_FOUND_EXCEPTION, consumer=_consumer) - return kwargs - - -DESCRIBE_IMPORT = APIOperation( - input=DescribeImportInput, - output=DescribeImportOutput, - schema=_SCHEMA_DESCRIBE_IMPORT, - input_schema=_SCHEMA_DESCRIBE_IMPORT_INPUT, - output_schema=_SCHEMA_DESCRIBE_IMPORT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.dynamodb#ImportNotFoundException" - ): ImportNotFoundException - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[_SCHEMA_IMPORT_NOT_FOUND_EXCEPTION], -) - - -@dataclass(kw_only=True) -class DescribeKinesisStreamingDestinationInput: - """Dataclass for DescribeKinesisStreamingDestinationInput structure.""" - - table_name: str | None = None - """ - The name of the table being described. You can also provide the Amazon - Resource Name (ARN) of the table in this parameter. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DESCRIBE_KINESIS_STREAMING_DESTINATION_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.table_name is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_KINESIS_STREAMING_DESTINATION_INPUT.members[ - "TableName" - ], - self.table_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["table_name"] = de.read_string( - _SCHEMA_DESCRIBE_KINESIS_STREAMING_DESTINATION_INPUT.members[ - "TableName" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DESCRIBE_KINESIS_STREAMING_DESTINATION_INPUT, consumer=_consumer - ) - return kwargs - - -class DestinationStatus(UnknownEnumMixin, StrEnum): - ENABLING = "ENABLING" - ACTIVE = "ACTIVE" - DISABLING = "DISABLING" - DISABLED = "DISABLED" - ENABLE_FAILED = "ENABLE_FAILED" - UPDATING = "UPDATING" - - -@dataclass(kw_only=True) -class KinesisDataStreamDestination: - """Describes a Kinesis data stream destination.""" - - stream_arn: str | None = None - """The ARN for a specific Kinesis data stream.""" - - destination_status: str | None = None - """The current status of replication.""" - - destination_status_description: str | None = None - """The human-readable string that corresponds to the replica status.""" - - approximate_creation_date_time_precision: str | None = None - """ - The precision of the Kinesis data stream timestamp. The values are - either `MILLISECOND` or `MICROSECOND`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KINESIS_DATA_STREAM_DESTINATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.stream_arn is not None: - serializer.write_string( - _SCHEMA_KINESIS_DATA_STREAM_DESTINATION.members["StreamArn"], - self.stream_arn, - ) - - if self.destination_status is not None: - serializer.write_string( - _SCHEMA_KINESIS_DATA_STREAM_DESTINATION.members["DestinationStatus"], - self.destination_status, - ) - - if self.destination_status_description is not None: - serializer.write_string( - _SCHEMA_KINESIS_DATA_STREAM_DESTINATION.members[ - "DestinationStatusDescription" - ], - self.destination_status_description, - ) - - if self.approximate_creation_date_time_precision is not None: - serializer.write_string( - _SCHEMA_KINESIS_DATA_STREAM_DESTINATION.members[ - "ApproximateCreationDateTimePrecision" - ], - self.approximate_creation_date_time_precision, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["stream_arn"] = de.read_string( - _SCHEMA_KINESIS_DATA_STREAM_DESTINATION.members["StreamArn"] - ) - - case 1: - kwargs["destination_status"] = DestinationStatus( - de.read_string( - _SCHEMA_KINESIS_DATA_STREAM_DESTINATION.members[ - "DestinationStatus" - ] - ) - ) - - case 2: - kwargs["destination_status_description"] = de.read_string( - _SCHEMA_KINESIS_DATA_STREAM_DESTINATION.members[ - "DestinationStatusDescription" - ] - ) - - case 3: - kwargs["approximate_creation_date_time_precision"] = ( - ApproximateCreationDateTimePrecision( - de.read_string( - _SCHEMA_KINESIS_DATA_STREAM_DESTINATION.members[ - "ApproximateCreationDateTimePrecision" - ] - ) - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_KINESIS_DATA_STREAM_DESTINATION, consumer=_consumer - ) - return kwargs - - -def _serialize_kinesis_data_stream_destinations( - serializer: ShapeSerializer, - schema: Schema, - value: list[KinesisDataStreamDestination], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_kinesis_data_stream_destinations( - deserializer: ShapeDeserializer, schema: Schema -) -> list[KinesisDataStreamDestination]: - result: list[KinesisDataStreamDestination] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(KinesisDataStreamDestination.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class DescribeKinesisStreamingDestinationOutput: - """Dataclass for DescribeKinesisStreamingDestinationOutput structure.""" - - table_name: str | None = None - """The name of the table being described.""" - - kinesis_data_stream_destinations: list[KinesisDataStreamDestination] | None = None - """The list of replica structures for the table being described.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DESCRIBE_KINESIS_STREAMING_DESTINATION_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.table_name is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_KINESIS_STREAMING_DESTINATION_OUTPUT.members[ - "TableName" - ], - self.table_name, - ) - - if self.kinesis_data_stream_destinations is not None: - _serialize_kinesis_data_stream_destinations( - serializer, - _SCHEMA_DESCRIBE_KINESIS_STREAMING_DESTINATION_OUTPUT.members[ - "KinesisDataStreamDestinations" - ], - self.kinesis_data_stream_destinations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["table_name"] = de.read_string( - _SCHEMA_DESCRIBE_KINESIS_STREAMING_DESTINATION_OUTPUT.members[ - "TableName" - ] - ) - - case 1: - kwargs["kinesis_data_stream_destinations"] = ( - _deserialize_kinesis_data_stream_destinations( - de, - _SCHEMA_DESCRIBE_KINESIS_STREAMING_DESTINATION_OUTPUT.members[ - "KinesisDataStreamDestinations" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DESCRIBE_KINESIS_STREAMING_DESTINATION_OUTPUT, consumer=_consumer - ) - return kwargs - - -DESCRIBE_KINESIS_STREAMING_DESTINATION = APIOperation( - input=DescribeKinesisStreamingDestinationInput, - output=DescribeKinesisStreamingDestinationOutput, - schema=_SCHEMA_DESCRIBE_KINESIS_STREAMING_DESTINATION, - input_schema=_SCHEMA_DESCRIBE_KINESIS_STREAMING_DESTINATION_INPUT, - output_schema=_SCHEMA_DESCRIBE_KINESIS_STREAMING_DESTINATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#InvalidEndpointException" - ): InvalidEndpointException, - ShapeID( - "com.amazonaws.dynamodb#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_SERVER_ERROR, - _SCHEMA_INVALID_ENDPOINT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DescribeLimitsInput: - """Represents the input of a `DescribeLimits` operation. Has no content.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DESCRIBE_LIMITS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DESCRIBE_LIMITS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DescribeLimitsOutput: - """Represents the output of a `DescribeLimits` operation.""" - - account_max_read_capacity_units: int | None = None - """ - The maximum total read capacity units that your account allows you to - provision across all of your tables in this Region. - """ - - account_max_write_capacity_units: int | None = None - """ - The maximum total write capacity units that your account allows you to - provision across all of your tables in this Region. - """ - - table_max_read_capacity_units: int | None = None - """ - The maximum read capacity units that your account allows you to - provision for a new table that you are creating in this Region, - including the read capacity units provisioned for its global secondary - indexes (GSIs). - """ - - table_max_write_capacity_units: int | None = None - """ - The maximum write capacity units that your account allows you to - provision for a new table that you are creating in this Region, - including the write capacity units provisioned for its global secondary - indexes (GSIs). - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DESCRIBE_LIMITS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.account_max_read_capacity_units is not None: - serializer.write_long( - _SCHEMA_DESCRIBE_LIMITS_OUTPUT.members["AccountMaxReadCapacityUnits"], - self.account_max_read_capacity_units, - ) - - if self.account_max_write_capacity_units is not None: - serializer.write_long( - _SCHEMA_DESCRIBE_LIMITS_OUTPUT.members["AccountMaxWriteCapacityUnits"], - self.account_max_write_capacity_units, - ) - - if self.table_max_read_capacity_units is not None: - serializer.write_long( - _SCHEMA_DESCRIBE_LIMITS_OUTPUT.members["TableMaxReadCapacityUnits"], - self.table_max_read_capacity_units, - ) - - if self.table_max_write_capacity_units is not None: - serializer.write_long( - _SCHEMA_DESCRIBE_LIMITS_OUTPUT.members["TableMaxWriteCapacityUnits"], - self.table_max_write_capacity_units, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["account_max_read_capacity_units"] = de.read_long( - _SCHEMA_DESCRIBE_LIMITS_OUTPUT.members[ - "AccountMaxReadCapacityUnits" - ] - ) - - case 1: - kwargs["account_max_write_capacity_units"] = de.read_long( - _SCHEMA_DESCRIBE_LIMITS_OUTPUT.members[ - "AccountMaxWriteCapacityUnits" - ] - ) - - case 2: - kwargs["table_max_read_capacity_units"] = de.read_long( - _SCHEMA_DESCRIBE_LIMITS_OUTPUT.members[ - "TableMaxReadCapacityUnits" - ] - ) - - case 3: - kwargs["table_max_write_capacity_units"] = de.read_long( - _SCHEMA_DESCRIBE_LIMITS_OUTPUT.members[ - "TableMaxWriteCapacityUnits" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DESCRIBE_LIMITS_OUTPUT, consumer=_consumer) - return kwargs - - -DESCRIBE_LIMITS = APIOperation( - input=DescribeLimitsInput, - output=DescribeLimitsOutput, - schema=_SCHEMA_DESCRIBE_LIMITS, - input_schema=_SCHEMA_DESCRIBE_LIMITS_INPUT, - output_schema=_SCHEMA_DESCRIBE_LIMITS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#InvalidEndpointException" - ): InvalidEndpointException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[_SCHEMA_INTERNAL_SERVER_ERROR, _SCHEMA_INVALID_ENDPOINT_EXCEPTION], -) - - -@dataclass(kw_only=True) -class DescribeTableInput: - """Represents the input of a `DescribeTable` operation.""" - - table_name: str | None = None - """ - The name of the table to describe. You can also provide the Amazon - Resource Name (ARN) of the table in this parameter. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DESCRIBE_TABLE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.table_name is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_TABLE_INPUT.members["TableName"], self.table_name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["table_name"] = de.read_string( - _SCHEMA_DESCRIBE_TABLE_INPUT.members["TableName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DESCRIBE_TABLE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DescribeTableOutput: - """Represents the output of a `DescribeTable` operation.""" - - table: TableDescription | None = None - """The properties of the table.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DESCRIBE_TABLE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.table is not None: - serializer.write_struct( - _SCHEMA_DESCRIBE_TABLE_OUTPUT.members["Table"], self.table - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["table"] = TableDescription.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DESCRIBE_TABLE_OUTPUT, consumer=_consumer) - return kwargs - - -DESCRIBE_TABLE = APIOperation( - input=DescribeTableInput, - output=DescribeTableOutput, - schema=_SCHEMA_DESCRIBE_TABLE, - input_schema=_SCHEMA_DESCRIBE_TABLE_INPUT, - output_schema=_SCHEMA_DESCRIBE_TABLE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#InvalidEndpointException" - ): InvalidEndpointException, - ShapeID( - "com.amazonaws.dynamodb#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_SERVER_ERROR, - _SCHEMA_INVALID_ENDPOINT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DescribeTableReplicaAutoScalingInput: - """Dataclass for DescribeTableReplicaAutoScalingInput structure.""" - - table_name: str | None = None - """ - The name of the table. You can also provide the Amazon Resource Name - (ARN) of the table in this parameter. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DESCRIBE_TABLE_REPLICA_AUTO_SCALING_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.table_name is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_TABLE_REPLICA_AUTO_SCALING_INPUT.members["TableName"], - self.table_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["table_name"] = de.read_string( - _SCHEMA_DESCRIBE_TABLE_REPLICA_AUTO_SCALING_INPUT.members[ - "TableName" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DESCRIBE_TABLE_REPLICA_AUTO_SCALING_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ReplicaGlobalSecondaryIndexAutoScalingDescription: - """ - Represents the auto scaling configuration for a replica global secondary - index. - """ - - index_name: str | None = None - """The name of the global secondary index.""" - - index_status: str | None = None - """ - The current state of the replica global secondary index: - - - `CREATING` - The index is being created. - - - `UPDATING` - The table/index configuration is being updated. The - table/index remains available for data operations when `UPDATING` - - - `DELETING` - The index is being deleted. - - - `ACTIVE` - The index is ready for use. - """ - - provisioned_read_capacity_auto_scaling_settings: ( - AutoScalingSettingsDescription | None - ) = None - """ - Represents the auto scaling settings for a global table or global - secondary index. - """ - - provisioned_write_capacity_auto_scaling_settings: ( - AutoScalingSettingsDescription | None - ) = None - """ - Represents the auto scaling settings for a global table or global - secondary index. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX_AUTO_SCALING_DESCRIPTION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.index_name is not None: - serializer.write_string( - _SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX_AUTO_SCALING_DESCRIPTION.members[ - "IndexName" - ], - self.index_name, - ) - - if self.index_status is not None: - serializer.write_string( - _SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX_AUTO_SCALING_DESCRIPTION.members[ - "IndexStatus" - ], - self.index_status, - ) - - if self.provisioned_read_capacity_auto_scaling_settings is not None: - serializer.write_struct( - _SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX_AUTO_SCALING_DESCRIPTION.members[ - "ProvisionedReadCapacityAutoScalingSettings" - ], - self.provisioned_read_capacity_auto_scaling_settings, - ) - - if self.provisioned_write_capacity_auto_scaling_settings is not None: - serializer.write_struct( - _SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX_AUTO_SCALING_DESCRIPTION.members[ - "ProvisionedWriteCapacityAutoScalingSettings" - ], - self.provisioned_write_capacity_auto_scaling_settings, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["index_name"] = de.read_string( - _SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX_AUTO_SCALING_DESCRIPTION.members[ - "IndexName" - ] - ) - - case 1: - kwargs["index_status"] = IndexStatus( - de.read_string( - _SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX_AUTO_SCALING_DESCRIPTION.members[ - "IndexStatus" - ] - ) - ) - - case 2: - kwargs["provisioned_read_capacity_auto_scaling_settings"] = ( - AutoScalingSettingsDescription.deserialize(de) - ) - - case 3: - kwargs["provisioned_write_capacity_auto_scaling_settings"] = ( - AutoScalingSettingsDescription.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX_AUTO_SCALING_DESCRIPTION, - consumer=_consumer, - ) - return kwargs - - -def _serialize_replica_global_secondary_index_auto_scaling_description_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[ReplicaGlobalSecondaryIndexAutoScalingDescription], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_replica_global_secondary_index_auto_scaling_description_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ReplicaGlobalSecondaryIndexAutoScalingDescription]: - result: list[ReplicaGlobalSecondaryIndexAutoScalingDescription] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append( - ReplicaGlobalSecondaryIndexAutoScalingDescription.deserialize(d) - ) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ReplicaAutoScalingDescription: - """Represents the auto scaling settings of the replica.""" - - region_name: str | None = None - """The Region where the replica exists.""" - - global_secondary_indexes: ( - list[ReplicaGlobalSecondaryIndexAutoScalingDescription] | None - ) = None - """Replica-specific global secondary index auto scaling settings.""" - - replica_provisioned_read_capacity_auto_scaling_settings: ( - AutoScalingSettingsDescription | None - ) = None - """ - Represents the auto scaling settings for a global table or global - secondary index. - """ - - replica_provisioned_write_capacity_auto_scaling_settings: ( - AutoScalingSettingsDescription | None - ) = None - """ - Represents the auto scaling settings for a global table or global - secondary index. - """ - - replica_status: str | None = None - """ - The current state of the replica: - - - `CREATING` - The replica is being created. - - - `UPDATING` - The replica is being updated. - - - `DELETING` - The replica is being deleted. - - - `ACTIVE` - The replica is ready for use. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REPLICA_AUTO_SCALING_DESCRIPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.region_name is not None: - serializer.write_string( - _SCHEMA_REPLICA_AUTO_SCALING_DESCRIPTION.members["RegionName"], - self.region_name, - ) - - if self.global_secondary_indexes is not None: - _serialize_replica_global_secondary_index_auto_scaling_description_list( - serializer, - _SCHEMA_REPLICA_AUTO_SCALING_DESCRIPTION.members[ - "GlobalSecondaryIndexes" - ], - self.global_secondary_indexes, - ) - - if self.replica_provisioned_read_capacity_auto_scaling_settings is not None: - serializer.write_struct( - _SCHEMA_REPLICA_AUTO_SCALING_DESCRIPTION.members[ - "ReplicaProvisionedReadCapacityAutoScalingSettings" - ], - self.replica_provisioned_read_capacity_auto_scaling_settings, - ) - - if self.replica_provisioned_write_capacity_auto_scaling_settings is not None: - serializer.write_struct( - _SCHEMA_REPLICA_AUTO_SCALING_DESCRIPTION.members[ - "ReplicaProvisionedWriteCapacityAutoScalingSettings" - ], - self.replica_provisioned_write_capacity_auto_scaling_settings, - ) - - if self.replica_status is not None: - serializer.write_string( - _SCHEMA_REPLICA_AUTO_SCALING_DESCRIPTION.members["ReplicaStatus"], - self.replica_status, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["region_name"] = de.read_string( - _SCHEMA_REPLICA_AUTO_SCALING_DESCRIPTION.members["RegionName"] - ) - - case 1: - kwargs["global_secondary_indexes"] = ( - _deserialize_replica_global_secondary_index_auto_scaling_description_list( - de, - _SCHEMA_REPLICA_AUTO_SCALING_DESCRIPTION.members[ - "GlobalSecondaryIndexes" - ], - ) - ) - - case 2: - kwargs[ - "replica_provisioned_read_capacity_auto_scaling_settings" - ] = AutoScalingSettingsDescription.deserialize(de) - - case 3: - kwargs[ - "replica_provisioned_write_capacity_auto_scaling_settings" - ] = AutoScalingSettingsDescription.deserialize(de) - - case 4: - kwargs["replica_status"] = ReplicaStatus( - de.read_string( - _SCHEMA_REPLICA_AUTO_SCALING_DESCRIPTION.members[ - "ReplicaStatus" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_REPLICA_AUTO_SCALING_DESCRIPTION, consumer=_consumer - ) - return kwargs - - -def _serialize_replica_auto_scaling_description_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[ReplicaAutoScalingDescription], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_replica_auto_scaling_description_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ReplicaAutoScalingDescription]: - result: list[ReplicaAutoScalingDescription] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ReplicaAutoScalingDescription.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class TableAutoScalingDescription: - """Represents the auto scaling configuration for a global table.""" - - table_name: str | None = None - """The name of the table.""" - - table_status: str | None = None - """ - The current state of the table: - - - `CREATING` - The table is being created. - - - `UPDATING` - The table is being updated. - - - `DELETING` - The table is being deleted. - - - `ACTIVE` - The table is ready for use. - """ - - replicas: list[ReplicaAutoScalingDescription] | None = None - """Represents replicas of the global table.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TABLE_AUTO_SCALING_DESCRIPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.table_name is not None: - serializer.write_string( - _SCHEMA_TABLE_AUTO_SCALING_DESCRIPTION.members["TableName"], - self.table_name, - ) - - if self.table_status is not None: - serializer.write_string( - _SCHEMA_TABLE_AUTO_SCALING_DESCRIPTION.members["TableStatus"], - self.table_status, - ) - - if self.replicas is not None: - _serialize_replica_auto_scaling_description_list( - serializer, - _SCHEMA_TABLE_AUTO_SCALING_DESCRIPTION.members["Replicas"], - self.replicas, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["table_name"] = de.read_string( - _SCHEMA_TABLE_AUTO_SCALING_DESCRIPTION.members["TableName"] - ) - - case 1: - kwargs["table_status"] = TableStatus( - de.read_string( - _SCHEMA_TABLE_AUTO_SCALING_DESCRIPTION.members[ - "TableStatus" - ] - ) - ) - - case 2: - kwargs["replicas"] = ( - _deserialize_replica_auto_scaling_description_list( - de, - _SCHEMA_TABLE_AUTO_SCALING_DESCRIPTION.members["Replicas"], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_TABLE_AUTO_SCALING_DESCRIPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DescribeTableReplicaAutoScalingOutput: - """Dataclass for DescribeTableReplicaAutoScalingOutput structure.""" - - table_auto_scaling_description: TableAutoScalingDescription | None = None - """Represents the auto scaling properties of the table.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DESCRIBE_TABLE_REPLICA_AUTO_SCALING_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.table_auto_scaling_description is not None: - serializer.write_struct( - _SCHEMA_DESCRIBE_TABLE_REPLICA_AUTO_SCALING_OUTPUT.members[ - "TableAutoScalingDescription" - ], - self.table_auto_scaling_description, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["table_auto_scaling_description"] = ( - TableAutoScalingDescription.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DESCRIBE_TABLE_REPLICA_AUTO_SCALING_OUTPUT, consumer=_consumer - ) - return kwargs - - -DESCRIBE_TABLE_REPLICA_AUTO_SCALING = APIOperation( - input=DescribeTableReplicaAutoScalingInput, - output=DescribeTableReplicaAutoScalingOutput, - schema=_SCHEMA_DESCRIBE_TABLE_REPLICA_AUTO_SCALING, - input_schema=_SCHEMA_DESCRIBE_TABLE_REPLICA_AUTO_SCALING_INPUT, - output_schema=_SCHEMA_DESCRIBE_TABLE_REPLICA_AUTO_SCALING_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[_SCHEMA_INTERNAL_SERVER_ERROR, _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION], -) - - -@dataclass(kw_only=True) -class DescribeTimeToLiveInput: - """Dataclass for DescribeTimeToLiveInput structure.""" - - table_name: str | None = None - """ - The name of the table to be described. You can also provide the Amazon - Resource Name (ARN) of the table in this parameter. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DESCRIBE_TIME_TO_LIVE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.table_name is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_TIME_TO_LIVE_INPUT.members["TableName"], - self.table_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["table_name"] = de.read_string( - _SCHEMA_DESCRIBE_TIME_TO_LIVE_INPUT.members["TableName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DESCRIBE_TIME_TO_LIVE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DescribeTimeToLiveOutput: - """Dataclass for DescribeTimeToLiveOutput structure.""" - - time_to_live_description: TimeToLiveDescription | None = None - """""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DESCRIBE_TIME_TO_LIVE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.time_to_live_description is not None: - serializer.write_struct( - _SCHEMA_DESCRIBE_TIME_TO_LIVE_OUTPUT.members["TimeToLiveDescription"], - self.time_to_live_description, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["time_to_live_description"] = ( - TimeToLiveDescription.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DESCRIBE_TIME_TO_LIVE_OUTPUT, consumer=_consumer - ) - return kwargs - - -DESCRIBE_TIME_TO_LIVE = APIOperation( - input=DescribeTimeToLiveInput, - output=DescribeTimeToLiveOutput, - schema=_SCHEMA_DESCRIBE_TIME_TO_LIVE, - input_schema=_SCHEMA_DESCRIBE_TIME_TO_LIVE_INPUT, - output_schema=_SCHEMA_DESCRIBE_TIME_TO_LIVE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#InvalidEndpointException" - ): InvalidEndpointException, - ShapeID( - "com.amazonaws.dynamodb#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_SERVER_ERROR, - _SCHEMA_INVALID_ENDPOINT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class EnableKinesisStreamingConfiguration: - """Enables setting the configuration for Kinesis Streaming.""" - - approximate_creation_date_time_precision: str | None = None - """ - Toggle for the precision of Kinesis data stream timestamp. The values - are either `MILLISECOND` or `MICROSECOND`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ENABLE_KINESIS_STREAMING_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.approximate_creation_date_time_precision is not None: - serializer.write_string( - _SCHEMA_ENABLE_KINESIS_STREAMING_CONFIGURATION.members[ - "ApproximateCreationDateTimePrecision" - ], - self.approximate_creation_date_time_precision, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["approximate_creation_date_time_precision"] = ( - ApproximateCreationDateTimePrecision( - de.read_string( - _SCHEMA_ENABLE_KINESIS_STREAMING_CONFIGURATION.members[ - "ApproximateCreationDateTimePrecision" - ] - ) - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ENABLE_KINESIS_STREAMING_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DisableKinesisStreamingDestinationInput: - """Dataclass for DisableKinesisStreamingDestinationInput structure.""" - - table_name: str | None = None - """ - The name of the DynamoDB table. You can also provide the Amazon Resource - Name (ARN) of the table in this parameter. - """ - - stream_arn: str | None = None - """The ARN for a Kinesis data stream.""" - - enable_kinesis_streaming_configuration: ( - EnableKinesisStreamingConfiguration | None - ) = None - """The source for the Kinesis streaming information that is being enabled.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DISABLE_KINESIS_STREAMING_DESTINATION_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.table_name is not None: - serializer.write_string( - _SCHEMA_DISABLE_KINESIS_STREAMING_DESTINATION_INPUT.members[ - "TableName" - ], - self.table_name, - ) - - if self.stream_arn is not None: - serializer.write_string( - _SCHEMA_DISABLE_KINESIS_STREAMING_DESTINATION_INPUT.members[ - "StreamArn" - ], - self.stream_arn, - ) - - if self.enable_kinesis_streaming_configuration is not None: - serializer.write_struct( - _SCHEMA_DISABLE_KINESIS_STREAMING_DESTINATION_INPUT.members[ - "EnableKinesisStreamingConfiguration" - ], - self.enable_kinesis_streaming_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["table_name"] = de.read_string( - _SCHEMA_DISABLE_KINESIS_STREAMING_DESTINATION_INPUT.members[ - "TableName" - ] - ) - - case 1: - kwargs["stream_arn"] = de.read_string( - _SCHEMA_DISABLE_KINESIS_STREAMING_DESTINATION_INPUT.members[ - "StreamArn" - ] - ) - - case 2: - kwargs["enable_kinesis_streaming_configuration"] = ( - EnableKinesisStreamingConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DISABLE_KINESIS_STREAMING_DESTINATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DisableKinesisStreamingDestinationOutput: - """Dataclass for DisableKinesisStreamingDestinationOutput structure.""" - - table_name: str | None = None - """The name of the table being modified.""" - - stream_arn: str | None = None - """The ARN for the specific Kinesis data stream.""" - - destination_status: str | None = None - """The current status of the replication.""" - - enable_kinesis_streaming_configuration: ( - EnableKinesisStreamingConfiguration | None - ) = None - """ - The destination for the Kinesis streaming information that is being - enabled. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DISABLE_KINESIS_STREAMING_DESTINATION_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.table_name is not None: - serializer.write_string( - _SCHEMA_DISABLE_KINESIS_STREAMING_DESTINATION_OUTPUT.members[ - "TableName" - ], - self.table_name, - ) - - if self.stream_arn is not None: - serializer.write_string( - _SCHEMA_DISABLE_KINESIS_STREAMING_DESTINATION_OUTPUT.members[ - "StreamArn" - ], - self.stream_arn, - ) - - if self.destination_status is not None: - serializer.write_string( - _SCHEMA_DISABLE_KINESIS_STREAMING_DESTINATION_OUTPUT.members[ - "DestinationStatus" - ], - self.destination_status, - ) - - if self.enable_kinesis_streaming_configuration is not None: - serializer.write_struct( - _SCHEMA_DISABLE_KINESIS_STREAMING_DESTINATION_OUTPUT.members[ - "EnableKinesisStreamingConfiguration" - ], - self.enable_kinesis_streaming_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["table_name"] = de.read_string( - _SCHEMA_DISABLE_KINESIS_STREAMING_DESTINATION_OUTPUT.members[ - "TableName" - ] - ) - - case 1: - kwargs["stream_arn"] = de.read_string( - _SCHEMA_DISABLE_KINESIS_STREAMING_DESTINATION_OUTPUT.members[ - "StreamArn" - ] - ) - - case 2: - kwargs["destination_status"] = DestinationStatus( - de.read_string( - _SCHEMA_DISABLE_KINESIS_STREAMING_DESTINATION_OUTPUT.members[ - "DestinationStatus" - ] - ) - ) - - case 3: - kwargs["enable_kinesis_streaming_configuration"] = ( - EnableKinesisStreamingConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DISABLE_KINESIS_STREAMING_DESTINATION_OUTPUT, consumer=_consumer - ) - return kwargs - - -DISABLE_KINESIS_STREAMING_DESTINATION = APIOperation( - input=DisableKinesisStreamingDestinationInput, - output=DisableKinesisStreamingDestinationOutput, - schema=_SCHEMA_DISABLE_KINESIS_STREAMING_DESTINATION, - input_schema=_SCHEMA_DISABLE_KINESIS_STREAMING_DESTINATION_INPUT, - output_schema=_SCHEMA_DISABLE_KINESIS_STREAMING_DESTINATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#InvalidEndpointException" - ): InvalidEndpointException, - ShapeID( - "com.amazonaws.dynamodb#LimitExceededException" - ): LimitExceededException, - ShapeID( - "com.amazonaws.dynamodb#ResourceInUseException" - ): ResourceInUseException, - ShapeID( - "com.amazonaws.dynamodb#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_SERVER_ERROR, - _SCHEMA_INVALID_ENDPOINT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_RESOURCE_IN_USE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DuplicateItemException(ServiceError): - """ - There was an attempt to insert an item with the same primary key as an - item that already exists in the DynamoDB table. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DUPLICATE_ITEM_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_DUPLICATE_ITEM_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_DUPLICATE_ITEM_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DUPLICATE_ITEM_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class EnableKinesisStreamingDestinationInput: - """Dataclass for EnableKinesisStreamingDestinationInput structure.""" - - table_name: str | None = None - """ - The name of the DynamoDB table. You can also provide the Amazon Resource - Name (ARN) of the table in this parameter. - """ - - stream_arn: str | None = None - """The ARN for a Kinesis data stream.""" - - enable_kinesis_streaming_configuration: ( - EnableKinesisStreamingConfiguration | None - ) = None - """The source for the Kinesis streaming information that is being enabled.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_ENABLE_KINESIS_STREAMING_DESTINATION_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.table_name is not None: - serializer.write_string( - _SCHEMA_ENABLE_KINESIS_STREAMING_DESTINATION_INPUT.members["TableName"], - self.table_name, - ) - - if self.stream_arn is not None: - serializer.write_string( - _SCHEMA_ENABLE_KINESIS_STREAMING_DESTINATION_INPUT.members["StreamArn"], - self.stream_arn, - ) - - if self.enable_kinesis_streaming_configuration is not None: - serializer.write_struct( - _SCHEMA_ENABLE_KINESIS_STREAMING_DESTINATION_INPUT.members[ - "EnableKinesisStreamingConfiguration" - ], - self.enable_kinesis_streaming_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["table_name"] = de.read_string( - _SCHEMA_ENABLE_KINESIS_STREAMING_DESTINATION_INPUT.members[ - "TableName" - ] - ) - - case 1: - kwargs["stream_arn"] = de.read_string( - _SCHEMA_ENABLE_KINESIS_STREAMING_DESTINATION_INPUT.members[ - "StreamArn" - ] - ) - - case 2: - kwargs["enable_kinesis_streaming_configuration"] = ( - EnableKinesisStreamingConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ENABLE_KINESIS_STREAMING_DESTINATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class EnableKinesisStreamingDestinationOutput: - """Dataclass for EnableKinesisStreamingDestinationOutput structure.""" - - table_name: str | None = None - """The name of the table being modified.""" - - stream_arn: str | None = None - """The ARN for the specific Kinesis data stream.""" - - destination_status: str | None = None - """The current status of the replication.""" - - enable_kinesis_streaming_configuration: ( - EnableKinesisStreamingConfiguration | None - ) = None - """ - The destination for the Kinesis streaming information that is being - enabled. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_ENABLE_KINESIS_STREAMING_DESTINATION_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.table_name is not None: - serializer.write_string( - _SCHEMA_ENABLE_KINESIS_STREAMING_DESTINATION_OUTPUT.members[ - "TableName" - ], - self.table_name, - ) - - if self.stream_arn is not None: - serializer.write_string( - _SCHEMA_ENABLE_KINESIS_STREAMING_DESTINATION_OUTPUT.members[ - "StreamArn" - ], - self.stream_arn, - ) - - if self.destination_status is not None: - serializer.write_string( - _SCHEMA_ENABLE_KINESIS_STREAMING_DESTINATION_OUTPUT.members[ - "DestinationStatus" - ], - self.destination_status, - ) - - if self.enable_kinesis_streaming_configuration is not None: - serializer.write_struct( - _SCHEMA_ENABLE_KINESIS_STREAMING_DESTINATION_OUTPUT.members[ - "EnableKinesisStreamingConfiguration" - ], - self.enable_kinesis_streaming_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["table_name"] = de.read_string( - _SCHEMA_ENABLE_KINESIS_STREAMING_DESTINATION_OUTPUT.members[ - "TableName" - ] - ) - - case 1: - kwargs["stream_arn"] = de.read_string( - _SCHEMA_ENABLE_KINESIS_STREAMING_DESTINATION_OUTPUT.members[ - "StreamArn" - ] - ) - - case 2: - kwargs["destination_status"] = DestinationStatus( - de.read_string( - _SCHEMA_ENABLE_KINESIS_STREAMING_DESTINATION_OUTPUT.members[ - "DestinationStatus" - ] - ) - ) - - case 3: - kwargs["enable_kinesis_streaming_configuration"] = ( - EnableKinesisStreamingConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ENABLE_KINESIS_STREAMING_DESTINATION_OUTPUT, consumer=_consumer - ) - return kwargs - - -ENABLE_KINESIS_STREAMING_DESTINATION = APIOperation( - input=EnableKinesisStreamingDestinationInput, - output=EnableKinesisStreamingDestinationOutput, - schema=_SCHEMA_ENABLE_KINESIS_STREAMING_DESTINATION, - input_schema=_SCHEMA_ENABLE_KINESIS_STREAMING_DESTINATION_INPUT, - output_schema=_SCHEMA_ENABLE_KINESIS_STREAMING_DESTINATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#InvalidEndpointException" - ): InvalidEndpointException, - ShapeID( - "com.amazonaws.dynamodb#LimitExceededException" - ): LimitExceededException, - ShapeID( - "com.amazonaws.dynamodb#ResourceInUseException" - ): ResourceInUseException, - ShapeID( - "com.amazonaws.dynamodb#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_SERVER_ERROR, - _SCHEMA_INVALID_ENDPOINT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_RESOURCE_IN_USE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class IdempotentParameterMismatchException(ServiceError): - """ - DynamoDB rejected the request because you retried a request with a - different payload but with an idempotent token that was already used. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IDEMPOTENT_PARAMETER_MISMATCH_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_IDEMPOTENT_PARAMETER_MISMATCH_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_IDEMPOTENT_PARAMETER_MISMATCH_EXCEPTION.members[ - "Message" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_IDEMPOTENT_PARAMETER_MISMATCH_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class TransactionInProgressException(ServiceError): - """ - The transaction with the given request token is already in progress. - - Recommended Settings - - Note: - This is a general recommendation for handling the - `TransactionInProgressException`. These settings help ensure that the - client retries will trigger completion of the ongoing - `TransactWriteItems` request. - - - Set `clientExecutionTimeout` to a value that allows at least one retry - to be processed after 5 seconds have elapsed since the first attempt - for the `TransactWriteItems` operation. - - - Set `socketTimeout` to a value a little lower than the - `requestTimeout` setting. - - - `requestTimeout` should be set based on the time taken for the - individual retries of a single HTTP request for your use case, but - setting it to 1 second or higher should work well to reduce chances of - retries and `TransactionInProgressException` errors. - - - Use exponential backoff when retrying and tune backoff if needed. - - Assuming [default retry - policy](https://github.com/aws/aws-sdk-java/blob/fd409dee8ae23fb8953e0bb4dbde65536a7e0514/aws-java-sdk-core/src/main/java/com/amazonaws/retry/PredefinedRetryPolicies.java#L97), - example timeout settings based on the guidelines above are as follows: - - Example timeline: - - - 0-1000 first attempt - - - 1000-1500 first sleep/delay (default retry policy uses 500 ms as base - delay for 4xx errors) - - - 1500-2500 second attempt - - - 2500-3500 second sleep/delay (500 * 2, exponential backoff) - - - 3500-4500 third attempt - - - 4500-6500 third sleep/delay (500 * 2^2) - - - 6500-7500 fourth attempt (this can trigger inline recovery since 5 - seconds have elapsed since the first attempt reached TC) - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRANSACTION_IN_PROGRESS_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_TRANSACTION_IN_PROGRESS_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_TRANSACTION_IN_PROGRESS_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_TRANSACTION_IN_PROGRESS_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ExportConflictException(ServiceError): - """There was a conflict when writing to the specified S3 bucket.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EXPORT_CONFLICT_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_EXPORT_CONFLICT_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_EXPORT_CONFLICT_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EXPORT_CONFLICT_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class InvalidExportTimeException(ServiceError): - """ - The specified `ExportTime` is outside of the point in time recovery - window. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_EXPORT_TIME_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_EXPORT_TIME_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_EXPORT_TIME_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVALID_EXPORT_TIME_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class PointInTimeRecoveryUnavailableException(ServiceError): - """Point in time recovery has not yet been enabled for this source table.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_POINT_IN_TIME_RECOVERY_UNAVAILABLE_EXCEPTION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_POINT_IN_TIME_RECOVERY_UNAVAILABLE_EXCEPTION.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_POINT_IN_TIME_RECOVERY_UNAVAILABLE_EXCEPTION.members[ - "message" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_POINT_IN_TIME_RECOVERY_UNAVAILABLE_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetResourcePolicyInput: - """Dataclass for GetResourcePolicyInput structure.""" - - resource_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the DynamoDB resource to which the - policy is attached. The resources you can specify include tables and - streams. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_RESOURCE_POLICY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_GET_RESOURCE_POLICY_INPUT.members["ResourceArn"], - self.resource_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_GET_RESOURCE_POLICY_INPUT.members["ResourceArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_RESOURCE_POLICY_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetResourcePolicyOutput: - """Dataclass for GetResourcePolicyOutput structure.""" - - policy: str | None = None - """ - The resource-based policy document attached to the resource, which can - be a table or stream, in JSON format. - """ - - revision_id: str | None = None - """ - A unique string that represents the revision ID of the policy. If - you're comparing revision IDs, make sure to always use string - comparison logic. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_RESOURCE_POLICY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.policy is not None: - serializer.write_string( - _SCHEMA_GET_RESOURCE_POLICY_OUTPUT.members["Policy"], self.policy - ) - - if self.revision_id is not None: - serializer.write_string( - _SCHEMA_GET_RESOURCE_POLICY_OUTPUT.members["RevisionId"], - self.revision_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy"] = de.read_string( - _SCHEMA_GET_RESOURCE_POLICY_OUTPUT.members["Policy"] - ) - - case 1: - kwargs["revision_id"] = de.read_string( - _SCHEMA_GET_RESOURCE_POLICY_OUTPUT.members["RevisionId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_RESOURCE_POLICY_OUTPUT, consumer=_consumer) - return kwargs - - -GET_RESOURCE_POLICY = APIOperation( - input=GetResourcePolicyInput, - output=GetResourcePolicyOutput, - schema=_SCHEMA_GET_RESOURCE_POLICY, - input_schema=_SCHEMA_GET_RESOURCE_POLICY_INPUT, - output_schema=_SCHEMA_GET_RESOURCE_POLICY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#InvalidEndpointException" - ): InvalidEndpointException, - ShapeID( - "com.amazonaws.dynamodb#PolicyNotFoundException" - ): PolicyNotFoundException, - ShapeID( - "com.amazonaws.dynamodb#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_SERVER_ERROR, - _SCHEMA_INVALID_ENDPOINT_EXCEPTION, - _SCHEMA_POLICY_NOT_FOUND_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ImportConflictException(ServiceError): - """ - There was a conflict when importing from the specified S3 source. This - can occur when the current import conflicts with a previous import - request that had the same client token. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IMPORT_CONFLICT_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_IMPORT_CONFLICT_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_IMPORT_CONFLICT_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_IMPORT_CONFLICT_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ImportTableInput: - """Dataclass for ImportTableInput structure.""" - - client_token: str | None = None - """ - Providing a `ClientToken` makes the call to `ImportTableInput` - idempotent, meaning that multiple identical calls have the same effect - as one single call. - - A client token is valid for 8 hours after the first request that uses it - is completed. After 8 hours, any request with the same client token is - treated as a new request. Do not resubmit the same request with the same - client token for more than 8 hours, or the result might not be - idempotent. - - If you submit a request with the same client token but a change in other - parameters within the 8-hour idempotency window, DynamoDB returns an - `IdempotentParameterMismatch` exception. - """ - - s3_bucket_source: S3BucketSource | None = None - """The S3 bucket that provides the source for the import.""" - - input_format: str | None = None - """ - The format of the source data. Valid values for `ImportFormat` are - `CSV`, `DYNAMODB_JSON` or `ION`. - """ - - input_format_options: InputFormatOptions | None = None - """Additional properties that specify how the input is formatted,""" - - input_compression_type: str | None = None - """ - Type of compression to be used on the input coming from the imported - table. - """ - - table_creation_parameters: TableCreationParameters | None = None - """Parameters for the table to import the data into.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IMPORT_TABLE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.client_token is not None: - serializer.write_string( - _SCHEMA_IMPORT_TABLE_INPUT.members["ClientToken"], self.client_token - ) - - if self.s3_bucket_source is not None: - serializer.write_struct( - _SCHEMA_IMPORT_TABLE_INPUT.members["S3BucketSource"], - self.s3_bucket_source, - ) - - if self.input_format is not None: - serializer.write_string( - _SCHEMA_IMPORT_TABLE_INPUT.members["InputFormat"], self.input_format - ) - - if self.input_format_options is not None: - serializer.write_struct( - _SCHEMA_IMPORT_TABLE_INPUT.members["InputFormatOptions"], - self.input_format_options, - ) - - if self.input_compression_type is not None: - serializer.write_string( - _SCHEMA_IMPORT_TABLE_INPUT.members["InputCompressionType"], - self.input_compression_type, - ) - - if self.table_creation_parameters is not None: - serializer.write_struct( - _SCHEMA_IMPORT_TABLE_INPUT.members["TableCreationParameters"], - self.table_creation_parameters, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["client_token"] = de.read_string( - _SCHEMA_IMPORT_TABLE_INPUT.members["ClientToken"] - ) - - case 1: - kwargs["s3_bucket_source"] = S3BucketSource.deserialize(de) - - case 2: - kwargs["input_format"] = InputFormat( - de.read_string( - _SCHEMA_IMPORT_TABLE_INPUT.members["InputFormat"] - ) - ) - - case 3: - kwargs["input_format_options"] = InputFormatOptions.deserialize(de) - - case 4: - kwargs["input_compression_type"] = InputCompressionType( - de.read_string( - _SCHEMA_IMPORT_TABLE_INPUT.members["InputCompressionType"] - ) - ) - - case 5: - kwargs["table_creation_parameters"] = ( - TableCreationParameters.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_IMPORT_TABLE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ImportTableOutput: - """Dataclass for ImportTableOutput structure.""" - - import_table_description: ImportTableDescription - """ - Represents the properties of the table created for the import, and - parameters of the import. The import parameters include import status, - how many items were processed, and how many errors were encountered. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IMPORT_TABLE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_IMPORT_TABLE_OUTPUT.members["ImportTableDescription"], - self.import_table_description, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["import_table_description"] = ( - ImportTableDescription.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_IMPORT_TABLE_OUTPUT, consumer=_consumer) - if "import_table_description" not in kwargs: - kwargs["import_table_description"] = ( - ImportTableDescription._smithy_default() - ) - return kwargs - - -IMPORT_TABLE = APIOperation( - input=ImportTableInput, - output=ImportTableOutput, - schema=_SCHEMA_IMPORT_TABLE, - input_schema=_SCHEMA_IMPORT_TABLE_INPUT, - output_schema=_SCHEMA_IMPORT_TABLE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.dynamodb#ImportConflictException" - ): ImportConflictException, - ShapeID( - "com.amazonaws.dynamodb#LimitExceededException" - ): LimitExceededException, - ShapeID( - "com.amazonaws.dynamodb#ResourceInUseException" - ): ResourceInUseException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_IMPORT_CONFLICT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_RESOURCE_IN_USE_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListBackupsInput: - """Dataclass for ListBackupsInput structure.""" - - table_name: str | None = None - """ - Lists the backups from the table specified in `TableName`. You can also - provide the Amazon Resource Name (ARN) of the table in this parameter. - """ - - limit: int | None = None - """Maximum number of backups to return at once.""" - - time_range_lower_bound: datetime | None = None - """ - Only backups created after this time are listed. `TimeRangeLowerBound` - is inclusive. - """ - - time_range_upper_bound: datetime | None = None - """ - Only backups created before this time are listed. `TimeRangeUpperBound` - is exclusive. - """ - - exclusive_start_backup_arn: str | None = None - """ - `LastEvaluatedBackupArn` is the Amazon Resource Name (ARN) of the backup - last evaluated when the current page of results was returned, inclusive - of the current page of results. This value may be specified as the - `ExclusiveStartBackupArn` of a new `ListBackups` operation in order to - fetch the next page of results. - """ - - backup_type: str | None = None - """ - The backups from the table specified by `BackupType` are listed. - - Where `BackupType` can be: - - - `USER` - On-demand backup created by you. (The default setting if no - other backup types are specified.) - - - `SYSTEM` - On-demand backup automatically created by DynamoDB. - - - `ALL` - All types of on-demand backups (USER and SYSTEM). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_BACKUPS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.table_name is not None: - serializer.write_string( - _SCHEMA_LIST_BACKUPS_INPUT.members["TableName"], self.table_name - ) - - if self.limit is not None: - serializer.write_integer( - _SCHEMA_LIST_BACKUPS_INPUT.members["Limit"], self.limit - ) - - if self.time_range_lower_bound is not None: - serializer.write_timestamp( - _SCHEMA_LIST_BACKUPS_INPUT.members["TimeRangeLowerBound"], - self.time_range_lower_bound, - ) - - if self.time_range_upper_bound is not None: - serializer.write_timestamp( - _SCHEMA_LIST_BACKUPS_INPUT.members["TimeRangeUpperBound"], - self.time_range_upper_bound, - ) - - if self.exclusive_start_backup_arn is not None: - serializer.write_string( - _SCHEMA_LIST_BACKUPS_INPUT.members["ExclusiveStartBackupArn"], - self.exclusive_start_backup_arn, - ) - - if self.backup_type is not None: - serializer.write_string( - _SCHEMA_LIST_BACKUPS_INPUT.members["BackupType"], self.backup_type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["table_name"] = de.read_string( - _SCHEMA_LIST_BACKUPS_INPUT.members["TableName"] - ) - - case 1: - kwargs["limit"] = de.read_integer( - _SCHEMA_LIST_BACKUPS_INPUT.members["Limit"] - ) - - case 2: - kwargs["time_range_lower_bound"] = de.read_timestamp( - _SCHEMA_LIST_BACKUPS_INPUT.members["TimeRangeLowerBound"] - ) - - case 3: - kwargs["time_range_upper_bound"] = de.read_timestamp( - _SCHEMA_LIST_BACKUPS_INPUT.members["TimeRangeUpperBound"] - ) - - case 4: - kwargs["exclusive_start_backup_arn"] = de.read_string( - _SCHEMA_LIST_BACKUPS_INPUT.members["ExclusiveStartBackupArn"] - ) - - case 5: - kwargs["backup_type"] = BackupTypeFilter( - de.read_string(_SCHEMA_LIST_BACKUPS_INPUT.members["BackupType"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_BACKUPS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ListBackupsOutput: - """Dataclass for ListBackupsOutput structure.""" - - backup_summaries: list[BackupSummary] | None = None - """List of `BackupSummary` objects.""" - - last_evaluated_backup_arn: str | None = None - """ - The ARN of the backup last evaluated when the current page of results - was returned, inclusive of the current page of results. This value may - be specified as the `ExclusiveStartBackupArn` of a new `ListBackups` - operation in order to fetch the next page of results. - - If `LastEvaluatedBackupArn` is empty, then the last page of results has - been processed and there are no more results to be retrieved. - - If `LastEvaluatedBackupArn` is not empty, this may or may not indicate - that there is more data to be returned. All results are guaranteed to - have been returned if and only if no value for `LastEvaluatedBackupArn` - is returned. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_BACKUPS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.backup_summaries is not None: - _serialize_backup_summaries( - serializer, - _SCHEMA_LIST_BACKUPS_OUTPUT.members["BackupSummaries"], - self.backup_summaries, - ) - - if self.last_evaluated_backup_arn is not None: - serializer.write_string( - _SCHEMA_LIST_BACKUPS_OUTPUT.members["LastEvaluatedBackupArn"], - self.last_evaluated_backup_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["backup_summaries"] = _deserialize_backup_summaries( - de, _SCHEMA_LIST_BACKUPS_OUTPUT.members["BackupSummaries"] - ) - - case 1: - kwargs["last_evaluated_backup_arn"] = de.read_string( - _SCHEMA_LIST_BACKUPS_OUTPUT.members["LastEvaluatedBackupArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_BACKUPS_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_BACKUPS = APIOperation( - input=ListBackupsInput, - output=ListBackupsOutput, - schema=_SCHEMA_LIST_BACKUPS, - input_schema=_SCHEMA_LIST_BACKUPS_INPUT, - output_schema=_SCHEMA_LIST_BACKUPS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#InvalidEndpointException" - ): InvalidEndpointException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[_SCHEMA_INTERNAL_SERVER_ERROR, _SCHEMA_INVALID_ENDPOINT_EXCEPTION], -) - - -@dataclass(kw_only=True) -class ListContributorInsightsInput: - """Dataclass for ListContributorInsightsInput structure.""" - - table_name: str | None = None - """ - The name of the table. You can also provide the Amazon Resource Name - (ARN) of the table in this parameter. - """ - - next_token: str | None = None - """A token to for the desired page, if there is one.""" - - max_results: int = 0 - """Maximum number of results to return per page.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_CONTRIBUTOR_INSIGHTS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.table_name is not None: - serializer.write_string( - _SCHEMA_LIST_CONTRIBUTOR_INSIGHTS_INPUT.members["TableName"], - self.table_name, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_CONTRIBUTOR_INSIGHTS_INPUT.members["NextToken"], - self.next_token, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_CONTRIBUTOR_INSIGHTS_INPUT.members["MaxResults"], - self.max_results, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["table_name"] = de.read_string( - _SCHEMA_LIST_CONTRIBUTOR_INSIGHTS_INPUT.members["TableName"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_CONTRIBUTOR_INSIGHTS_INPUT.members["NextToken"] - ) - - case 2: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_CONTRIBUTOR_INSIGHTS_INPUT.members["MaxResults"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_CONTRIBUTOR_INSIGHTS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ListContributorInsightsOutput: - """Dataclass for ListContributorInsightsOutput structure.""" - - contributor_insights_summaries: list[ContributorInsightsSummary] | None = None - """A list of ContributorInsightsSummary.""" - - next_token: str | None = None - """A token to go to the next page if there is one.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_CONTRIBUTOR_INSIGHTS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.contributor_insights_summaries is not None: - _serialize_contributor_insights_summaries( - serializer, - _SCHEMA_LIST_CONTRIBUTOR_INSIGHTS_OUTPUT.members[ - "ContributorInsightsSummaries" - ], - self.contributor_insights_summaries, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_CONTRIBUTOR_INSIGHTS_OUTPUT.members["NextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["contributor_insights_summaries"] = ( - _deserialize_contributor_insights_summaries( - de, - _SCHEMA_LIST_CONTRIBUTOR_INSIGHTS_OUTPUT.members[ - "ContributorInsightsSummaries" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_CONTRIBUTOR_INSIGHTS_OUTPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_CONTRIBUTOR_INSIGHTS_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_CONTRIBUTOR_INSIGHTS = APIOperation( - input=ListContributorInsightsInput, - output=ListContributorInsightsOutput, - schema=_SCHEMA_LIST_CONTRIBUTOR_INSIGHTS, - input_schema=_SCHEMA_LIST_CONTRIBUTOR_INSIGHTS_INPUT, - output_schema=_SCHEMA_LIST_CONTRIBUTOR_INSIGHTS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[_SCHEMA_INTERNAL_SERVER_ERROR, _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION], -) - - -@dataclass(kw_only=True) -class ListExportsInput: - """Dataclass for ListExportsInput structure.""" - - table_arn: str | None = None - """The Amazon Resource Name (ARN) associated with the exported table.""" - - max_results: int | None = None - """Maximum number of results to return per page.""" - - next_token: str | None = None - """ - An optional string that, if supplied, must be copied from the output of - a previous call to `ListExports`. When provided in this manner, the API - fetches the next page of results. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_EXPORTS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.table_arn is not None: - serializer.write_string( - _SCHEMA_LIST_EXPORTS_INPUT.members["TableArn"], self.table_arn - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_EXPORTS_INPUT.members["MaxResults"], self.max_results - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_EXPORTS_INPUT.members["NextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["table_arn"] = de.read_string( - _SCHEMA_LIST_EXPORTS_INPUT.members["TableArn"] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_EXPORTS_INPUT.members["MaxResults"] - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_EXPORTS_INPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_EXPORTS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ExportSummary: - """Summary information about an export task.""" - - export_arn: str | None = None - """The Amazon Resource Name (ARN) of the export.""" - - export_status: str | None = None - """ - Export can be in one of the following states: IN_PROGRESS, COMPLETED, or - FAILED. - """ - - export_type: str | None = None - """ - The type of export that was performed. Valid values are `FULL_EXPORT` or - `INCREMENTAL_EXPORT`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EXPORT_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.export_arn is not None: - serializer.write_string( - _SCHEMA_EXPORT_SUMMARY.members["ExportArn"], self.export_arn - ) - - if self.export_status is not None: - serializer.write_string( - _SCHEMA_EXPORT_SUMMARY.members["ExportStatus"], self.export_status - ) - - if self.export_type is not None: - serializer.write_string( - _SCHEMA_EXPORT_SUMMARY.members["ExportType"], self.export_type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["export_arn"] = de.read_string( - _SCHEMA_EXPORT_SUMMARY.members["ExportArn"] - ) - - case 1: - kwargs["export_status"] = ExportStatus( - de.read_string(_SCHEMA_EXPORT_SUMMARY.members["ExportStatus"]) - ) - - case 2: - kwargs["export_type"] = ExportType( - de.read_string(_SCHEMA_EXPORT_SUMMARY.members["ExportType"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EXPORT_SUMMARY, consumer=_consumer) - return kwargs - - -def _serialize_export_summaries( - serializer: ShapeSerializer, schema: Schema, value: list[ExportSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_export_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ExportSummary]: - result: list[ExportSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ExportSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListExportsOutput: - """Dataclass for ListExportsOutput structure.""" - - export_summaries: list[ExportSummary] | None = None - """A list of `ExportSummary` objects.""" - - next_token: str | None = None - """ - If this value is returned, there are additional results to be displayed. - To retrieve them, call `ListExports` again, with `NextToken` set to this - value. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_EXPORTS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.export_summaries is not None: - _serialize_export_summaries( - serializer, - _SCHEMA_LIST_EXPORTS_OUTPUT.members["ExportSummaries"], - self.export_summaries, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_EXPORTS_OUTPUT.members["NextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["export_summaries"] = _deserialize_export_summaries( - de, _SCHEMA_LIST_EXPORTS_OUTPUT.members["ExportSummaries"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_EXPORTS_OUTPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_EXPORTS_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_EXPORTS = APIOperation( - input=ListExportsInput, - output=ListExportsOutput, - schema=_SCHEMA_LIST_EXPORTS, - input_schema=_SCHEMA_LIST_EXPORTS_INPUT, - output_schema=_SCHEMA_LIST_EXPORTS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#LimitExceededException" - ): LimitExceededException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[_SCHEMA_INTERNAL_SERVER_ERROR, _SCHEMA_LIMIT_EXCEEDED_EXCEPTION], -) - - -@dataclass(kw_only=True) -class ListGlobalTablesInput: - """Dataclass for ListGlobalTablesInput structure.""" - - exclusive_start_global_table_name: str | None = None - """The first global table name that this operation will evaluate.""" - - limit: int | None = None - """ - The maximum number of table names to return, if the parameter is not - specified DynamoDB defaults to 100. - - If the number of global tables DynamoDB finds reaches this limit, it - stops the operation and returns the table names collected up to that - point, with a table name in the `LastEvaluatedGlobalTableName` to apply - in a subsequent operation to the `ExclusiveStartGlobalTableName` - parameter. - """ - - region_name: str | None = None - """Lists the global tables in a specific Region.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_GLOBAL_TABLES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.exclusive_start_global_table_name is not None: - serializer.write_string( - _SCHEMA_LIST_GLOBAL_TABLES_INPUT.members[ - "ExclusiveStartGlobalTableName" - ], - self.exclusive_start_global_table_name, - ) - - if self.limit is not None: - serializer.write_integer( - _SCHEMA_LIST_GLOBAL_TABLES_INPUT.members["Limit"], self.limit - ) - - if self.region_name is not None: - serializer.write_string( - _SCHEMA_LIST_GLOBAL_TABLES_INPUT.members["RegionName"], self.region_name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["exclusive_start_global_table_name"] = de.read_string( - _SCHEMA_LIST_GLOBAL_TABLES_INPUT.members[ - "ExclusiveStartGlobalTableName" - ] - ) - - case 1: - kwargs["limit"] = de.read_integer( - _SCHEMA_LIST_GLOBAL_TABLES_INPUT.members["Limit"] - ) - - case 2: - kwargs["region_name"] = de.read_string( - _SCHEMA_LIST_GLOBAL_TABLES_INPUT.members["RegionName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_GLOBAL_TABLES_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GlobalTable: - """Represents the properties of a global table.""" - - global_table_name: str | None = None - """The global table name.""" - - replication_group: list[Replica] | None = None - """The Regions where the global table has replicas.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GLOBAL_TABLE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.global_table_name is not None: - serializer.write_string( - _SCHEMA_GLOBAL_TABLE.members["GlobalTableName"], self.global_table_name - ) - - if self.replication_group is not None: - _serialize_replica_list( - serializer, - _SCHEMA_GLOBAL_TABLE.members["ReplicationGroup"], - self.replication_group, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["global_table_name"] = de.read_string( - _SCHEMA_GLOBAL_TABLE.members["GlobalTableName"] - ) - - case 1: - kwargs["replication_group"] = _deserialize_replica_list( - de, _SCHEMA_GLOBAL_TABLE.members["ReplicationGroup"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GLOBAL_TABLE, consumer=_consumer) - return kwargs - - -def _serialize_global_table_list( - serializer: ShapeSerializer, schema: Schema, value: list[GlobalTable] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_global_table_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GlobalTable]: - result: list[GlobalTable] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GlobalTable.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListGlobalTablesOutput: - """Dataclass for ListGlobalTablesOutput structure.""" - - global_tables: list[GlobalTable] | None = None - """List of global table names.""" - - last_evaluated_global_table_name: str | None = None - """Last evaluated global table name.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_GLOBAL_TABLES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.global_tables is not None: - _serialize_global_table_list( - serializer, - _SCHEMA_LIST_GLOBAL_TABLES_OUTPUT.members["GlobalTables"], - self.global_tables, - ) - - if self.last_evaluated_global_table_name is not None: - serializer.write_string( - _SCHEMA_LIST_GLOBAL_TABLES_OUTPUT.members[ - "LastEvaluatedGlobalTableName" - ], - self.last_evaluated_global_table_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["global_tables"] = _deserialize_global_table_list( - de, _SCHEMA_LIST_GLOBAL_TABLES_OUTPUT.members["GlobalTables"] - ) - - case 1: - kwargs["last_evaluated_global_table_name"] = de.read_string( - _SCHEMA_LIST_GLOBAL_TABLES_OUTPUT.members[ - "LastEvaluatedGlobalTableName" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_GLOBAL_TABLES_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_GLOBAL_TABLES = APIOperation( - input=ListGlobalTablesInput, - output=ListGlobalTablesOutput, - schema=_SCHEMA_LIST_GLOBAL_TABLES, - input_schema=_SCHEMA_LIST_GLOBAL_TABLES_INPUT, - output_schema=_SCHEMA_LIST_GLOBAL_TABLES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#InvalidEndpointException" - ): InvalidEndpointException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[_SCHEMA_INTERNAL_SERVER_ERROR, _SCHEMA_INVALID_ENDPOINT_EXCEPTION], -) - - -@dataclass(kw_only=True) -class ListImportsInput: - """Dataclass for ListImportsInput structure.""" - - table_arn: str | None = None - """ - The Amazon Resource Name (ARN) associated with the table that was - imported to. - """ - - page_size: int | None = None - """The number of `ImportSummary `objects returned in a single page.""" - - next_token: str | None = None - """ - An optional string that, if supplied, must be copied from the output of - a previous call to `ListImports`. When provided in this manner, the API - fetches the next page of results. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_IMPORTS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.table_arn is not None: - serializer.write_string( - _SCHEMA_LIST_IMPORTS_INPUT.members["TableArn"], self.table_arn - ) - - if self.page_size is not None: - serializer.write_integer( - _SCHEMA_LIST_IMPORTS_INPUT.members["PageSize"], self.page_size - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_IMPORTS_INPUT.members["NextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["table_arn"] = de.read_string( - _SCHEMA_LIST_IMPORTS_INPUT.members["TableArn"] - ) - - case 1: - kwargs["page_size"] = de.read_integer( - _SCHEMA_LIST_IMPORTS_INPUT.members["PageSize"] - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_IMPORTS_INPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_IMPORTS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ImportSummary: - """Summary information about the source file for the import.""" - - import_arn: str | None = None - """The Amazon Resource Number (ARN) corresponding to the import request.""" - - import_status: str | None = None - """The status of the import operation.""" - - table_arn: str | None = None - """The Amazon Resource Number (ARN) of the table being imported into.""" - - s3_bucket_source: S3BucketSource | None = None - """ - The path and S3 bucket of the source file that is being imported. This - includes the S3Bucket (required), S3KeyPrefix (optional) and - S3BucketOwner (optional if the bucket is owned by the requester). - """ - - cloud_watch_log_group_arn: str | None = None - """ - The Amazon Resource Number (ARN) of the Cloudwatch Log Group associated - with this import task. - """ - - input_format: str | None = None - """ - The format of the source data. Valid values are `CSV`, `DYNAMODB_JSON` - or `ION`. - """ - - start_time: datetime | None = None - """The time at which this import task began.""" - - end_time: datetime | None = None - """The time at which this import task ended.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IMPORT_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.import_arn is not None: - serializer.write_string( - _SCHEMA_IMPORT_SUMMARY.members["ImportArn"], self.import_arn - ) - - if self.import_status is not None: - serializer.write_string( - _SCHEMA_IMPORT_SUMMARY.members["ImportStatus"], self.import_status - ) - - if self.table_arn is not None: - serializer.write_string( - _SCHEMA_IMPORT_SUMMARY.members["TableArn"], self.table_arn - ) - - if self.s3_bucket_source is not None: - serializer.write_struct( - _SCHEMA_IMPORT_SUMMARY.members["S3BucketSource"], self.s3_bucket_source - ) - - if self.cloud_watch_log_group_arn is not None: - serializer.write_string( - _SCHEMA_IMPORT_SUMMARY.members["CloudWatchLogGroupArn"], - self.cloud_watch_log_group_arn, - ) - - if self.input_format is not None: - serializer.write_string( - _SCHEMA_IMPORT_SUMMARY.members["InputFormat"], self.input_format - ) - - if self.start_time is not None: - serializer.write_timestamp( - _SCHEMA_IMPORT_SUMMARY.members["StartTime"], self.start_time - ) - - if self.end_time is not None: - serializer.write_timestamp( - _SCHEMA_IMPORT_SUMMARY.members["EndTime"], self.end_time - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["import_arn"] = de.read_string( - _SCHEMA_IMPORT_SUMMARY.members["ImportArn"] - ) - - case 1: - kwargs["import_status"] = ImportStatus( - de.read_string(_SCHEMA_IMPORT_SUMMARY.members["ImportStatus"]) - ) - - case 2: - kwargs["table_arn"] = de.read_string( - _SCHEMA_IMPORT_SUMMARY.members["TableArn"] - ) - - case 3: - kwargs["s3_bucket_source"] = S3BucketSource.deserialize(de) - - case 4: - kwargs["cloud_watch_log_group_arn"] = de.read_string( - _SCHEMA_IMPORT_SUMMARY.members["CloudWatchLogGroupArn"] - ) - - case 5: - kwargs["input_format"] = InputFormat( - de.read_string(_SCHEMA_IMPORT_SUMMARY.members["InputFormat"]) - ) - - case 6: - kwargs["start_time"] = de.read_timestamp( - _SCHEMA_IMPORT_SUMMARY.members["StartTime"] - ) - - case 7: - kwargs["end_time"] = de.read_timestamp( - _SCHEMA_IMPORT_SUMMARY.members["EndTime"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_IMPORT_SUMMARY, consumer=_consumer) - return kwargs - - -def _serialize_import_summary_list( - serializer: ShapeSerializer, schema: Schema, value: list[ImportSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_import_summary_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ImportSummary]: - result: list[ImportSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ImportSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListImportsOutput: - """Dataclass for ListImportsOutput structure.""" - - import_summary_list: list[ImportSummary] | None = None - """A list of `ImportSummary` objects.""" - - next_token: str | None = None - """ - If this value is returned, there are additional results to be displayed. - To retrieve them, call `ListImports` again, with `NextToken` set to this - value. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_IMPORTS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.import_summary_list is not None: - _serialize_import_summary_list( - serializer, - _SCHEMA_LIST_IMPORTS_OUTPUT.members["ImportSummaryList"], - self.import_summary_list, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_IMPORTS_OUTPUT.members["NextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["import_summary_list"] = _deserialize_import_summary_list( - de, _SCHEMA_LIST_IMPORTS_OUTPUT.members["ImportSummaryList"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_IMPORTS_OUTPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_IMPORTS_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_IMPORTS = APIOperation( - input=ListImportsInput, - output=ListImportsOutput, - schema=_SCHEMA_LIST_IMPORTS, - input_schema=_SCHEMA_LIST_IMPORTS_INPUT, - output_schema=_SCHEMA_LIST_IMPORTS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.dynamodb#LimitExceededException" - ): LimitExceededException - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[_SCHEMA_LIMIT_EXCEEDED_EXCEPTION], -) - - -@dataclass(kw_only=True) -class ListTablesInput: - """Represents the input of a `ListTables` operation.""" - - exclusive_start_table_name: str | None = None - """ - The first table name that this operation will evaluate. Use the value - that was returned for `LastEvaluatedTableName` in a previous operation, - so that you can obtain the next page of results. - """ - - limit: int | None = None - """ - A maximum number of table names to return. If this parameter is not - specified, the limit is 100. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_TABLES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.exclusive_start_table_name is not None: - serializer.write_string( - _SCHEMA_LIST_TABLES_INPUT.members["ExclusiveStartTableName"], - self.exclusive_start_table_name, - ) - - if self.limit is not None: - serializer.write_integer( - _SCHEMA_LIST_TABLES_INPUT.members["Limit"], self.limit - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["exclusive_start_table_name"] = de.read_string( - _SCHEMA_LIST_TABLES_INPUT.members["ExclusiveStartTableName"] - ) - - case 1: - kwargs["limit"] = de.read_integer( - _SCHEMA_LIST_TABLES_INPUT.members["Limit"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_TABLES_INPUT, consumer=_consumer) - return kwargs - - -def _serialize_table_name_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_table_name_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListTablesOutput: - """Represents the output of a `ListTables` operation.""" - - table_names: list[str] | None = None - """ - The names of the tables associated with the current account at the - current endpoint. The maximum size of this array is 100. - - If `LastEvaluatedTableName` also appears in the output, you can use this - value as the `ExclusiveStartTableName` parameter in a subsequent - `ListTables` request and obtain the next page of results. - """ - - last_evaluated_table_name: str | None = None - """ - The name of the last table in the current page of results. Use this - value as the `ExclusiveStartTableName` in a new request to obtain the - next page of results, until all the table names are returned. - - If you do not receive a `LastEvaluatedTableName` value in the response, - this means that there are no more table names to be retrieved. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_TABLES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.table_names is not None: - _serialize_table_name_list( - serializer, - _SCHEMA_LIST_TABLES_OUTPUT.members["TableNames"], - self.table_names, - ) - - if self.last_evaluated_table_name is not None: - serializer.write_string( - _SCHEMA_LIST_TABLES_OUTPUT.members["LastEvaluatedTableName"], - self.last_evaluated_table_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["table_names"] = _deserialize_table_name_list( - de, _SCHEMA_LIST_TABLES_OUTPUT.members["TableNames"] - ) - - case 1: - kwargs["last_evaluated_table_name"] = de.read_string( - _SCHEMA_LIST_TABLES_OUTPUT.members["LastEvaluatedTableName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_TABLES_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_TABLES = APIOperation( - input=ListTablesInput, - output=ListTablesOutput, - schema=_SCHEMA_LIST_TABLES, - input_schema=_SCHEMA_LIST_TABLES_INPUT, - output_schema=_SCHEMA_LIST_TABLES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#InvalidEndpointException" - ): InvalidEndpointException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[_SCHEMA_INTERNAL_SERVER_ERROR, _SCHEMA_INVALID_ENDPOINT_EXCEPTION], -) - - -@dataclass(kw_only=True) -class ListTagsOfResourceInput: - """Dataclass for ListTagsOfResourceInput structure.""" - - resource_arn: str | None = None - """ - The Amazon DynamoDB resource with tags to be listed. This value is an - Amazon Resource Name (ARN). - """ - - next_token: str | None = None - """ - An optional string that, if supplied, must be copied from the output of - a previous call to ListTagOfResource. When provided in this manner, this - API fetches the next page of results. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_TAGS_OF_RESOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_LIST_TAGS_OF_RESOURCE_INPUT.members["ResourceArn"], - self.resource_arn, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_TAGS_OF_RESOURCE_INPUT.members["NextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_LIST_TAGS_OF_RESOURCE_INPUT.members["ResourceArn"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_TAGS_OF_RESOURCE_INPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_TAGS_OF_RESOURCE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ListTagsOfResourceOutput: - """Dataclass for ListTagsOfResourceOutput structure.""" - - tags: list[Tag] | None = None - """The tags currently associated with the Amazon DynamoDB resource.""" - - next_token: str | None = None - """ - If this value is returned, there are additional results to be displayed. - To retrieve them, call ListTagsOfResource again, with NextToken set to - this value. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_TAGS_OF_RESOURCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.tags is not None: - _serialize_tag_list( - serializer, - _SCHEMA_LIST_TAGS_OF_RESOURCE_OUTPUT.members["Tags"], - self.tags, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_TAGS_OF_RESOURCE_OUTPUT.members["NextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["tags"] = _deserialize_tag_list( - de, _SCHEMA_LIST_TAGS_OF_RESOURCE_OUTPUT.members["Tags"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_TAGS_OF_RESOURCE_OUTPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_TAGS_OF_RESOURCE_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_TAGS_OF_RESOURCE = APIOperation( - input=ListTagsOfResourceInput, - output=ListTagsOfResourceOutput, - schema=_SCHEMA_LIST_TAGS_OF_RESOURCE, - input_schema=_SCHEMA_LIST_TAGS_OF_RESOURCE_INPUT, - output_schema=_SCHEMA_LIST_TAGS_OF_RESOURCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#InvalidEndpointException" - ): InvalidEndpointException, - ShapeID( - "com.amazonaws.dynamodb#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_SERVER_ERROR, - _SCHEMA_INVALID_ENDPOINT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class PutResourcePolicyInput: - """Dataclass for PutResourcePolicyInput structure.""" - - resource_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the DynamoDB resource to which the - policy will be attached. The resources you can specify include tables - and streams. - - You can control index permissions using the base table's policy. To - specify the same permission level for your table and its indexes, you - can provide both the table and index Amazon Resource Name (ARN)s in the - `Resource` field of a given `Statement` in your policy document. - Alternatively, to specify different permissions for your table, indexes, - or both, you can define multiple `Statement` fields in your policy - document. - """ - - policy: str | None = None - """ - An Amazon Web Services resource-based policy document in JSON format. - - - The maximum size supported for a resource-based policy document is 20 - KB. DynamoDB counts whitespaces when calculating the size of a policy - against this limit. - - - Within a resource-based policy, if the action for a DynamoDB - service-linked role (SLR) to replicate data for a global table is - denied, adding or deleting a replica will fail with an error. - - For a full list of all considerations that apply while attaching a - resource-based policy, see [Resource-based policy - considerations](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/rbac-considerations.html). - """ - - expected_revision_id: str | None = None - """ - A string value that you can use to conditionally update your policy. You - can provide the revision ID of your existing policy to make mutating - requests against that policy. - - Note: - When you provide an expected revision ID, if the revision ID of the - existing policy on the resource doesn't match or if there's no policy - attached to the resource, your request will be rejected with a - `PolicyNotFoundException`. - - To conditionally attach a policy when no policy exists for the resource, - specify `NO_POLICY` for the revision ID. - """ - - confirm_remove_self_resource_access: bool = False - """ - Set this parameter to `true` to confirm that you want to remove your - permissions to change the policy of this resource in the future. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_RESOURCE_POLICY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_PUT_RESOURCE_POLICY_INPUT.members["ResourceArn"], - self.resource_arn, - ) - - if self.policy is not None: - serializer.write_string( - _SCHEMA_PUT_RESOURCE_POLICY_INPUT.members["Policy"], self.policy - ) - - if self.expected_revision_id is not None: - serializer.write_string( - _SCHEMA_PUT_RESOURCE_POLICY_INPUT.members["ExpectedRevisionId"], - self.expected_revision_id, - ) - - if self.confirm_remove_self_resource_access is not None: - serializer.write_boolean( - _SCHEMA_PUT_RESOURCE_POLICY_INPUT.members[ - "ConfirmRemoveSelfResourceAccess" - ], - self.confirm_remove_self_resource_access, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_PUT_RESOURCE_POLICY_INPUT.members["ResourceArn"] - ) - - case 1: - kwargs["policy"] = de.read_string( - _SCHEMA_PUT_RESOURCE_POLICY_INPUT.members["Policy"] - ) - - case 2: - kwargs["expected_revision_id"] = de.read_string( - _SCHEMA_PUT_RESOURCE_POLICY_INPUT.members["ExpectedRevisionId"] - ) - - case 3: - kwargs["confirm_remove_self_resource_access"] = de.read_boolean( - _SCHEMA_PUT_RESOURCE_POLICY_INPUT.members[ - "ConfirmRemoveSelfResourceAccess" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUT_RESOURCE_POLICY_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class PutResourcePolicyOutput: - """Dataclass for PutResourcePolicyOutput structure.""" - - revision_id: str | None = None - """ - A unique string that represents the revision ID of the policy. If - you're comparing revision IDs, make sure to always use string - comparison logic. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_RESOURCE_POLICY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.revision_id is not None: - serializer.write_string( - _SCHEMA_PUT_RESOURCE_POLICY_OUTPUT.members["RevisionId"], - self.revision_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["revision_id"] = de.read_string( - _SCHEMA_PUT_RESOURCE_POLICY_OUTPUT.members["RevisionId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUT_RESOURCE_POLICY_OUTPUT, consumer=_consumer) - return kwargs - - -PUT_RESOURCE_POLICY = APIOperation( - input=PutResourcePolicyInput, - output=PutResourcePolicyOutput, - schema=_SCHEMA_PUT_RESOURCE_POLICY, - input_schema=_SCHEMA_PUT_RESOURCE_POLICY_INPUT, - output_schema=_SCHEMA_PUT_RESOURCE_POLICY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#InvalidEndpointException" - ): InvalidEndpointException, - ShapeID( - "com.amazonaws.dynamodb#LimitExceededException" - ): LimitExceededException, - ShapeID( - "com.amazonaws.dynamodb#PolicyNotFoundException" - ): PolicyNotFoundException, - ShapeID( - "com.amazonaws.dynamodb#ResourceInUseException" - ): ResourceInUseException, - ShapeID( - "com.amazonaws.dynamodb#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_SERVER_ERROR, - _SCHEMA_INVALID_ENDPOINT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_POLICY_NOT_FOUND_EXCEPTION, - _SCHEMA_RESOURCE_IN_USE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - ], -) - - -class Select(UnknownEnumMixin, StrEnum): - ALL_ATTRIBUTES = "ALL_ATTRIBUTES" - ALL_PROJECTED_ATTRIBUTES = "ALL_PROJECTED_ATTRIBUTES" - SPECIFIC_ATTRIBUTES = "SPECIFIC_ATTRIBUTES" - COUNT = "COUNT" - - -@dataclass(kw_only=True) -class RestoreTableFromBackupInput: - """Dataclass for RestoreTableFromBackupInput structure.""" - - target_table_name: str | None = None - """The name of the new table to which the backup must be restored.""" - - backup_arn: str | None = None - """The Amazon Resource Name (ARN) associated with the backup.""" - - billing_mode_override: str | None = None - """The billing mode of the restored table.""" - - global_secondary_index_override: list[GlobalSecondaryIndex] | None = None - """ - List of global secondary indexes for the restored table. The indexes - provided should match existing secondary indexes. You can choose to - exclude some or all of the indexes at the time of restore. - """ - - local_secondary_index_override: list[LocalSecondaryIndex] | None = None - """ - List of local secondary indexes for the restored table. The indexes - provided should match existing secondary indexes. You can choose to - exclude some or all of the indexes at the time of restore. - """ - - provisioned_throughput_override: ProvisionedThroughput | None = None - """Provisioned throughput settings for the restored table.""" - - on_demand_throughput_override: OnDemandThroughput | None = None - """ - Sets the maximum number of read and write units for the specified - on-demand table. If you use this parameter, you must specify - `MaxReadRequestUnits`, `MaxWriteRequestUnits`, or both. - """ - - sse_specification_override: SSESpecification | None = None - """The new server-side encryption settings for the restored table.""" - - vector_index_override: list[VectorIndex] | None = None - """ - The vector indexes for the restored table. If not specified, all vector - indexes from the backup are restored. The indexes provided must match - existing vector indexes from the backup. You can choose to exclude some - or all of the vector indexes at the time of restore. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESTORE_TABLE_FROM_BACKUP_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.target_table_name is not None: - serializer.write_string( - _SCHEMA_RESTORE_TABLE_FROM_BACKUP_INPUT.members["TargetTableName"], - self.target_table_name, - ) - - if self.backup_arn is not None: - serializer.write_string( - _SCHEMA_RESTORE_TABLE_FROM_BACKUP_INPUT.members["BackupArn"], - self.backup_arn, - ) - - if self.billing_mode_override is not None: - serializer.write_string( - _SCHEMA_RESTORE_TABLE_FROM_BACKUP_INPUT.members["BillingModeOverride"], - self.billing_mode_override, - ) - - if self.global_secondary_index_override is not None: - _serialize_global_secondary_index_list( - serializer, - _SCHEMA_RESTORE_TABLE_FROM_BACKUP_INPUT.members[ - "GlobalSecondaryIndexOverride" - ], - self.global_secondary_index_override, - ) - - if self.local_secondary_index_override is not None: - _serialize_local_secondary_index_list( - serializer, - _SCHEMA_RESTORE_TABLE_FROM_BACKUP_INPUT.members[ - "LocalSecondaryIndexOverride" - ], - self.local_secondary_index_override, - ) - - if self.provisioned_throughput_override is not None: - serializer.write_struct( - _SCHEMA_RESTORE_TABLE_FROM_BACKUP_INPUT.members[ - "ProvisionedThroughputOverride" - ], - self.provisioned_throughput_override, - ) - - if self.on_demand_throughput_override is not None: - serializer.write_struct( - _SCHEMA_RESTORE_TABLE_FROM_BACKUP_INPUT.members[ - "OnDemandThroughputOverride" - ], - self.on_demand_throughput_override, - ) - - if self.sse_specification_override is not None: - serializer.write_struct( - _SCHEMA_RESTORE_TABLE_FROM_BACKUP_INPUT.members[ - "SSESpecificationOverride" - ], - self.sse_specification_override, - ) - - if self.vector_index_override is not None: - _serialize_vector_index_list( - serializer, - _SCHEMA_RESTORE_TABLE_FROM_BACKUP_INPUT.members["VectorIndexOverride"], - self.vector_index_override, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["target_table_name"] = de.read_string( - _SCHEMA_RESTORE_TABLE_FROM_BACKUP_INPUT.members[ - "TargetTableName" - ] - ) - - case 1: - kwargs["backup_arn"] = de.read_string( - _SCHEMA_RESTORE_TABLE_FROM_BACKUP_INPUT.members["BackupArn"] - ) - - case 2: - kwargs["billing_mode_override"] = BillingMode( - de.read_string( - _SCHEMA_RESTORE_TABLE_FROM_BACKUP_INPUT.members[ - "BillingModeOverride" - ] - ) - ) - - case 3: - kwargs["global_secondary_index_override"] = ( - _deserialize_global_secondary_index_list( - de, - _SCHEMA_RESTORE_TABLE_FROM_BACKUP_INPUT.members[ - "GlobalSecondaryIndexOverride" - ], - ) - ) - - case 4: - kwargs["local_secondary_index_override"] = ( - _deserialize_local_secondary_index_list( - de, - _SCHEMA_RESTORE_TABLE_FROM_BACKUP_INPUT.members[ - "LocalSecondaryIndexOverride" - ], - ) - ) - - case 5: - kwargs["provisioned_throughput_override"] = ( - ProvisionedThroughput.deserialize(de) - ) - - case 6: - kwargs["on_demand_throughput_override"] = ( - OnDemandThroughput.deserialize(de) - ) - - case 7: - kwargs["sse_specification_override"] = SSESpecification.deserialize( - de - ) - - case 8: - kwargs["vector_index_override"] = _deserialize_vector_index_list( - de, - _SCHEMA_RESTORE_TABLE_FROM_BACKUP_INPUT.members[ - "VectorIndexOverride" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RESTORE_TABLE_FROM_BACKUP_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class RestoreTableFromBackupOutput: - """Dataclass for RestoreTableFromBackupOutput structure.""" - - table_description: TableDescription | None = None - """The description of the table created from an existing backup.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESTORE_TABLE_FROM_BACKUP_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.table_description is not None: - serializer.write_struct( - _SCHEMA_RESTORE_TABLE_FROM_BACKUP_OUTPUT.members["TableDescription"], - self.table_description, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["table_description"] = TableDescription.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RESTORE_TABLE_FROM_BACKUP_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class TableAlreadyExistsException(ServiceError): - """A target table with the specified name already exists.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TABLE_ALREADY_EXISTS_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_TABLE_ALREADY_EXISTS_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_TABLE_ALREADY_EXISTS_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_TABLE_ALREADY_EXISTS_EXCEPTION, consumer=_consumer - ) - return kwargs - - -RESTORE_TABLE_FROM_BACKUP = APIOperation( - input=RestoreTableFromBackupInput, - output=RestoreTableFromBackupOutput, - schema=_SCHEMA_RESTORE_TABLE_FROM_BACKUP, - input_schema=_SCHEMA_RESTORE_TABLE_FROM_BACKUP_INPUT, - output_schema=_SCHEMA_RESTORE_TABLE_FROM_BACKUP_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.dynamodb#BackupInUseException" - ): BackupInUseException, - ShapeID( - "com.amazonaws.dynamodb#BackupNotFoundException" - ): BackupNotFoundException, - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#InvalidEndpointException" - ): InvalidEndpointException, - ShapeID( - "com.amazonaws.dynamodb#LimitExceededException" - ): LimitExceededException, - ShapeID( - "com.amazonaws.dynamodb#TableAlreadyExistsException" - ): TableAlreadyExistsException, - ShapeID("com.amazonaws.dynamodb#TableInUseException"): TableInUseException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BACKUP_IN_USE_EXCEPTION, - _SCHEMA_BACKUP_NOT_FOUND_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR, - _SCHEMA_INVALID_ENDPOINT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_TABLE_ALREADY_EXISTS_EXCEPTION, - _SCHEMA_TABLE_IN_USE_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class InvalidRestoreTimeException(ServiceError): - """ - An invalid restore time was specified. RestoreDateTime must be between - EarliestRestorableDateTime and LatestRestorableDateTime. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_RESTORE_TIME_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_RESTORE_TIME_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_RESTORE_TIME_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVALID_RESTORE_TIME_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class RestoreTableToPointInTimeInput: - """Dataclass for RestoreTableToPointInTimeInput structure.""" - - source_table_arn: str | None = None - """ - The DynamoDB table that will be restored. This value is an Amazon - Resource Name (ARN). - """ - - source_table_name: str | None = None - """Name of the source table that is being restored.""" - - target_table_name: str | None = None - """The name of the new table to which it must be restored to.""" - - use_latest_restorable_time: bool | None = None - """ - Restore the table to the latest possible time. - `LatestRestorableDateTime` is typically 5 minutes before the current - time. - """ - - restore_date_time: datetime | None = None - """Time in the past to restore the table to.""" - - billing_mode_override: str | None = None - """The billing mode of the restored table.""" - - global_secondary_index_override: list[GlobalSecondaryIndex] | None = None - """ - List of global secondary indexes for the restored table. The indexes - provided should match existing secondary indexes. You can choose to - exclude some or all of the indexes at the time of restore. - - The `WarmThroughput` setting is not supported on global secondary - indexes when you use `RestoreTableToPointInTime`. Although - `WarmThroughput` appears in the shared index definition, including it in - a `GlobalSecondaryIndexOverride` entry causes the request to fail with a - validation error. - """ - - local_secondary_index_override: list[LocalSecondaryIndex] | None = None - """ - List of local secondary indexes for the restored table. The indexes - provided should match existing secondary indexes. You can choose to - exclude some or all of the indexes at the time of restore. - """ - - provisioned_throughput_override: ProvisionedThroughput | None = None - """Provisioned throughput settings for the restored table.""" - - on_demand_throughput_override: OnDemandThroughput | None = None - """ - Sets the maximum number of read and write units for the specified - on-demand table. If you use this parameter, you must specify - `MaxReadRequestUnits`, `MaxWriteRequestUnits`, or both. - """ - - sse_specification_override: SSESpecification | None = None - """The new server-side encryption settings for the restored table.""" - - vector_index_override: list[VectorIndex] | None = None - """ - The vector indexes for the restored table. If not specified, all vector - indexes from the source table are restored. The indexes provided must - match existing vector indexes from the source table. You can choose to - exclude some or all of the vector indexes at the time of restore. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESTORE_TABLE_TO_POINT_IN_TIME_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.source_table_arn is not None: - serializer.write_string( - _SCHEMA_RESTORE_TABLE_TO_POINT_IN_TIME_INPUT.members["SourceTableArn"], - self.source_table_arn, - ) - - if self.source_table_name is not None: - serializer.write_string( - _SCHEMA_RESTORE_TABLE_TO_POINT_IN_TIME_INPUT.members["SourceTableName"], - self.source_table_name, - ) - - if self.target_table_name is not None: - serializer.write_string( - _SCHEMA_RESTORE_TABLE_TO_POINT_IN_TIME_INPUT.members["TargetTableName"], - self.target_table_name, - ) - - if self.use_latest_restorable_time is not None: - serializer.write_boolean( - _SCHEMA_RESTORE_TABLE_TO_POINT_IN_TIME_INPUT.members[ - "UseLatestRestorableTime" - ], - self.use_latest_restorable_time, - ) - - if self.restore_date_time is not None: - serializer.write_timestamp( - _SCHEMA_RESTORE_TABLE_TO_POINT_IN_TIME_INPUT.members["RestoreDateTime"], - self.restore_date_time, - ) - - if self.billing_mode_override is not None: - serializer.write_string( - _SCHEMA_RESTORE_TABLE_TO_POINT_IN_TIME_INPUT.members[ - "BillingModeOverride" - ], - self.billing_mode_override, - ) - - if self.global_secondary_index_override is not None: - _serialize_global_secondary_index_list( - serializer, - _SCHEMA_RESTORE_TABLE_TO_POINT_IN_TIME_INPUT.members[ - "GlobalSecondaryIndexOverride" - ], - self.global_secondary_index_override, - ) - - if self.local_secondary_index_override is not None: - _serialize_local_secondary_index_list( - serializer, - _SCHEMA_RESTORE_TABLE_TO_POINT_IN_TIME_INPUT.members[ - "LocalSecondaryIndexOverride" - ], - self.local_secondary_index_override, - ) - - if self.provisioned_throughput_override is not None: - serializer.write_struct( - _SCHEMA_RESTORE_TABLE_TO_POINT_IN_TIME_INPUT.members[ - "ProvisionedThroughputOverride" - ], - self.provisioned_throughput_override, - ) - - if self.on_demand_throughput_override is not None: - serializer.write_struct( - _SCHEMA_RESTORE_TABLE_TO_POINT_IN_TIME_INPUT.members[ - "OnDemandThroughputOverride" - ], - self.on_demand_throughput_override, - ) - - if self.sse_specification_override is not None: - serializer.write_struct( - _SCHEMA_RESTORE_TABLE_TO_POINT_IN_TIME_INPUT.members[ - "SSESpecificationOverride" - ], - self.sse_specification_override, - ) - - if self.vector_index_override is not None: - _serialize_vector_index_list( - serializer, - _SCHEMA_RESTORE_TABLE_TO_POINT_IN_TIME_INPUT.members[ - "VectorIndexOverride" - ], - self.vector_index_override, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["source_table_arn"] = de.read_string( - _SCHEMA_RESTORE_TABLE_TO_POINT_IN_TIME_INPUT.members[ - "SourceTableArn" - ] - ) - - case 1: - kwargs["source_table_name"] = de.read_string( - _SCHEMA_RESTORE_TABLE_TO_POINT_IN_TIME_INPUT.members[ - "SourceTableName" - ] - ) - - case 2: - kwargs["target_table_name"] = de.read_string( - _SCHEMA_RESTORE_TABLE_TO_POINT_IN_TIME_INPUT.members[ - "TargetTableName" - ] - ) - - case 3: - kwargs["use_latest_restorable_time"] = de.read_boolean( - _SCHEMA_RESTORE_TABLE_TO_POINT_IN_TIME_INPUT.members[ - "UseLatestRestorableTime" - ] - ) - - case 4: - kwargs["restore_date_time"] = de.read_timestamp( - _SCHEMA_RESTORE_TABLE_TO_POINT_IN_TIME_INPUT.members[ - "RestoreDateTime" - ] - ) - - case 5: - kwargs["billing_mode_override"] = BillingMode( - de.read_string( - _SCHEMA_RESTORE_TABLE_TO_POINT_IN_TIME_INPUT.members[ - "BillingModeOverride" - ] - ) - ) - - case 6: - kwargs["global_secondary_index_override"] = ( - _deserialize_global_secondary_index_list( - de, - _SCHEMA_RESTORE_TABLE_TO_POINT_IN_TIME_INPUT.members[ - "GlobalSecondaryIndexOverride" - ], - ) - ) - - case 7: - kwargs["local_secondary_index_override"] = ( - _deserialize_local_secondary_index_list( - de, - _SCHEMA_RESTORE_TABLE_TO_POINT_IN_TIME_INPUT.members[ - "LocalSecondaryIndexOverride" - ], - ) - ) - - case 8: - kwargs["provisioned_throughput_override"] = ( - ProvisionedThroughput.deserialize(de) - ) - - case 9: - kwargs["on_demand_throughput_override"] = ( - OnDemandThroughput.deserialize(de) - ) - - case 10: - kwargs["sse_specification_override"] = SSESpecification.deserialize( - de - ) - - case 11: - kwargs["vector_index_override"] = _deserialize_vector_index_list( - de, - _SCHEMA_RESTORE_TABLE_TO_POINT_IN_TIME_INPUT.members[ - "VectorIndexOverride" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RESTORE_TABLE_TO_POINT_IN_TIME_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class RestoreTableToPointInTimeOutput: - """Dataclass for RestoreTableToPointInTimeOutput structure.""" - - table_description: TableDescription | None = None - """Represents the properties of a table.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESTORE_TABLE_TO_POINT_IN_TIME_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.table_description is not None: - serializer.write_struct( - _SCHEMA_RESTORE_TABLE_TO_POINT_IN_TIME_OUTPUT.members[ - "TableDescription" - ], - self.table_description, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["table_description"] = TableDescription.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RESTORE_TABLE_TO_POINT_IN_TIME_OUTPUT, consumer=_consumer - ) - return kwargs - - -RESTORE_TABLE_TO_POINT_IN_TIME = APIOperation( - input=RestoreTableToPointInTimeInput, - output=RestoreTableToPointInTimeOutput, - schema=_SCHEMA_RESTORE_TABLE_TO_POINT_IN_TIME, - input_schema=_SCHEMA_RESTORE_TABLE_TO_POINT_IN_TIME_INPUT, - output_schema=_SCHEMA_RESTORE_TABLE_TO_POINT_IN_TIME_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#InvalidEndpointException" - ): InvalidEndpointException, - ShapeID( - "com.amazonaws.dynamodb#InvalidRestoreTimeException" - ): InvalidRestoreTimeException, - ShapeID( - "com.amazonaws.dynamodb#LimitExceededException" - ): LimitExceededException, - ShapeID( - "com.amazonaws.dynamodb#PointInTimeRecoveryUnavailableException" - ): PointInTimeRecoveryUnavailableException, - ShapeID( - "com.amazonaws.dynamodb#TableAlreadyExistsException" - ): TableAlreadyExistsException, - ShapeID("com.amazonaws.dynamodb#TableInUseException"): TableInUseException, - ShapeID( - "com.amazonaws.dynamodb#TableNotFoundException" - ): TableNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_SERVER_ERROR, - _SCHEMA_INVALID_ENDPOINT_EXCEPTION, - _SCHEMA_INVALID_RESTORE_TIME_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_POINT_IN_TIME_RECOVERY_UNAVAILABLE_EXCEPTION, - _SCHEMA_TABLE_ALREADY_EXISTS_EXCEPTION, - _SCHEMA_TABLE_IN_USE_EXCEPTION, - _SCHEMA_TABLE_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class TagResourceInput: - """Dataclass for TagResourceInput structure.""" - - resource_arn: str | None = None - """ - Identifies the Amazon DynamoDB resource to which tags should be added. - This value is an Amazon Resource Name (ARN). - """ - - tags: list[Tag] | None = None - """The tags to be assigned to the Amazon DynamoDB resource.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TAG_RESOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_TAG_RESOURCE_INPUT.members["ResourceArn"], self.resource_arn - ) - - if self.tags is not None: - _serialize_tag_list( - serializer, _SCHEMA_TAG_RESOURCE_INPUT.members["Tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_TAG_RESOURCE_INPUT.members["ResourceArn"] - ) - - case 1: - kwargs["tags"] = _deserialize_tag_list( - de, _SCHEMA_TAG_RESOURCE_INPUT.members["Tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TAG_RESOURCE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class TagResourceOutput: - """Dataclass for TagResourceOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TAG_RESOURCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TAG_RESOURCE_OUTPUT, consumer=_consumer) - return kwargs - - -TAG_RESOURCE = APIOperation( - input=TagResourceInput, - output=TagResourceOutput, - schema=_SCHEMA_TAG_RESOURCE, - input_schema=_SCHEMA_TAG_RESOURCE_INPUT, - output_schema=_SCHEMA_TAG_RESOURCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#InvalidEndpointException" - ): InvalidEndpointException, - ShapeID( - "com.amazonaws.dynamodb#LimitExceededException" - ): LimitExceededException, - ShapeID( - "com.amazonaws.dynamodb#ResourceInUseException" - ): ResourceInUseException, - ShapeID( - "com.amazonaws.dynamodb#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_SERVER_ERROR, - _SCHEMA_INVALID_ENDPOINT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_RESOURCE_IN_USE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - ], -) - - -def _serialize_tag_key_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_tag_key_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class UntagResourceInput: - """Dataclass for UntagResourceInput structure.""" - - resource_arn: str | None = None - """ - The DynamoDB resource that the tags will be removed from. This value is - an Amazon Resource Name (ARN). - """ - - tag_keys: list[str] | None = None - """ - A list of tag keys. Existing tags of the resource whose keys are members - of this list will be removed from the DynamoDB resource. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNTAG_RESOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_UNTAG_RESOURCE_INPUT.members["ResourceArn"], self.resource_arn - ) - - if self.tag_keys is not None: - _serialize_tag_key_list( - serializer, - _SCHEMA_UNTAG_RESOURCE_INPUT.members["TagKeys"], - self.tag_keys, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_UNTAG_RESOURCE_INPUT.members["ResourceArn"] - ) - - case 1: - kwargs["tag_keys"] = _deserialize_tag_key_list( - de, _SCHEMA_UNTAG_RESOURCE_INPUT.members["TagKeys"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UNTAG_RESOURCE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UntagResourceOutput: - """Dataclass for UntagResourceOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNTAG_RESOURCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UNTAG_RESOURCE_OUTPUT, consumer=_consumer) - return kwargs - - -UNTAG_RESOURCE = APIOperation( - input=UntagResourceInput, - output=UntagResourceOutput, - schema=_SCHEMA_UNTAG_RESOURCE, - input_schema=_SCHEMA_UNTAG_RESOURCE_INPUT, - output_schema=_SCHEMA_UNTAG_RESOURCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#InvalidEndpointException" - ): InvalidEndpointException, - ShapeID( - "com.amazonaws.dynamodb#LimitExceededException" - ): LimitExceededException, - ShapeID( - "com.amazonaws.dynamodb#ResourceInUseException" - ): ResourceInUseException, - ShapeID( - "com.amazonaws.dynamodb#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_SERVER_ERROR, - _SCHEMA_INVALID_ENDPOINT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_RESOURCE_IN_USE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class PointInTimeRecoverySpecification: - """Represents the settings used to enable point in time recovery.""" - - point_in_time_recovery_enabled: bool - """ - Indicates whether point in time recovery is enabled (true) or disabled - (false) on the table. - """ - - recovery_period_in_days: int | None = None - """ - The number of preceding days for which continuous backups are taken and - maintained. Your table data is only recoverable to any point-in-time - from within the configured recovery period. This parameter is optional. - If no value is provided, the value will default to 35. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_POINT_IN_TIME_RECOVERY_SPECIFICATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_boolean( - _SCHEMA_POINT_IN_TIME_RECOVERY_SPECIFICATION.members[ - "PointInTimeRecoveryEnabled" - ], - self.point_in_time_recovery_enabled, - ) - if self.recovery_period_in_days is not None: - serializer.write_integer( - _SCHEMA_POINT_IN_TIME_RECOVERY_SPECIFICATION.members[ - "RecoveryPeriodInDays" - ], - self.recovery_period_in_days, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["point_in_time_recovery_enabled"] = de.read_boolean( - _SCHEMA_POINT_IN_TIME_RECOVERY_SPECIFICATION.members[ - "PointInTimeRecoveryEnabled" - ] - ) - - case 1: - kwargs["recovery_period_in_days"] = de.read_integer( - _SCHEMA_POINT_IN_TIME_RECOVERY_SPECIFICATION.members[ - "RecoveryPeriodInDays" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_POINT_IN_TIME_RECOVERY_SPECIFICATION, consumer=_consumer - ) - if "point_in_time_recovery_enabled" not in kwargs: - kwargs["point_in_time_recovery_enabled"] = False - return kwargs - - -@dataclass(kw_only=True) -class UpdateContinuousBackupsInput: - """Dataclass for UpdateContinuousBackupsInput structure.""" - - table_name: str | None = None - """ - The name of the table. You can also provide the Amazon Resource Name - (ARN) of the table in this parameter. - """ - - point_in_time_recovery_specification: PointInTimeRecoverySpecification | None = None - """Represents the settings used to enable point in time recovery.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_CONTINUOUS_BACKUPS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.table_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_CONTINUOUS_BACKUPS_INPUT.members["TableName"], - self.table_name, - ) - - if self.point_in_time_recovery_specification is not None: - serializer.write_struct( - _SCHEMA_UPDATE_CONTINUOUS_BACKUPS_INPUT.members[ - "PointInTimeRecoverySpecification" - ], - self.point_in_time_recovery_specification, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["table_name"] = de.read_string( - _SCHEMA_UPDATE_CONTINUOUS_BACKUPS_INPUT.members["TableName"] - ) - - case 1: - kwargs["point_in_time_recovery_specification"] = ( - PointInTimeRecoverySpecification.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_CONTINUOUS_BACKUPS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateContinuousBackupsOutput: - """Dataclass for UpdateContinuousBackupsOutput structure.""" - - continuous_backups_description: ContinuousBackupsDescription | None = None - """ - Represents the continuous backups and point in time recovery settings on - the table. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_CONTINUOUS_BACKUPS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.continuous_backups_description is not None: - serializer.write_struct( - _SCHEMA_UPDATE_CONTINUOUS_BACKUPS_OUTPUT.members[ - "ContinuousBackupsDescription" - ], - self.continuous_backups_description, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["continuous_backups_description"] = ( - ContinuousBackupsDescription.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_CONTINUOUS_BACKUPS_OUTPUT, consumer=_consumer - ) - return kwargs - - -UPDATE_CONTINUOUS_BACKUPS = APIOperation( - input=UpdateContinuousBackupsInput, - output=UpdateContinuousBackupsOutput, - schema=_SCHEMA_UPDATE_CONTINUOUS_BACKUPS, - input_schema=_SCHEMA_UPDATE_CONTINUOUS_BACKUPS_INPUT, - output_schema=_SCHEMA_UPDATE_CONTINUOUS_BACKUPS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.dynamodb#ContinuousBackupsUnavailableException" - ): ContinuousBackupsUnavailableException, - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#InvalidEndpointException" - ): InvalidEndpointException, - ShapeID( - "com.amazonaws.dynamodb#TableNotFoundException" - ): TableNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CONTINUOUS_BACKUPS_UNAVAILABLE_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR, - _SCHEMA_INVALID_ENDPOINT_EXCEPTION, - _SCHEMA_TABLE_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateContributorInsightsInput: - """Dataclass for UpdateContributorInsightsInput structure.""" - - table_name: str | None = None - """ - The name of the table. You can also provide the Amazon Resource Name - (ARN) of the table in this parameter. - """ - - index_name: str | None = None - """The global secondary index name, if applicable.""" - - contributor_insights_action: str | None = None - """Represents the contributor insights action.""" - - contributor_insights_mode: str | None = None - """ - Specifies whether to track all access and throttled events or throttled - events only for the DynamoDB table or index. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_CONTRIBUTOR_INSIGHTS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.table_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_CONTRIBUTOR_INSIGHTS_INPUT.members["TableName"], - self.table_name, - ) - - if self.index_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_CONTRIBUTOR_INSIGHTS_INPUT.members["IndexName"], - self.index_name, - ) - - if self.contributor_insights_action is not None: - serializer.write_string( - _SCHEMA_UPDATE_CONTRIBUTOR_INSIGHTS_INPUT.members[ - "ContributorInsightsAction" - ], - self.contributor_insights_action, - ) - - if self.contributor_insights_mode is not None: - serializer.write_string( - _SCHEMA_UPDATE_CONTRIBUTOR_INSIGHTS_INPUT.members[ - "ContributorInsightsMode" - ], - self.contributor_insights_mode, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["table_name"] = de.read_string( - _SCHEMA_UPDATE_CONTRIBUTOR_INSIGHTS_INPUT.members["TableName"] - ) - - case 1: - kwargs["index_name"] = de.read_string( - _SCHEMA_UPDATE_CONTRIBUTOR_INSIGHTS_INPUT.members["IndexName"] - ) - - case 2: - kwargs["contributor_insights_action"] = ContributorInsightsAction( - de.read_string( - _SCHEMA_UPDATE_CONTRIBUTOR_INSIGHTS_INPUT.members[ - "ContributorInsightsAction" - ] - ) - ) - - case 3: - kwargs["contributor_insights_mode"] = ContributorInsightsMode( - de.read_string( - _SCHEMA_UPDATE_CONTRIBUTOR_INSIGHTS_INPUT.members[ - "ContributorInsightsMode" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_CONTRIBUTOR_INSIGHTS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateContributorInsightsOutput: - """Dataclass for UpdateContributorInsightsOutput structure.""" - - table_name: str | None = None - """The name of the table.""" - - index_name: str | None = None - """The name of the global secondary index, if applicable.""" - - contributor_insights_status: str | None = None - """The status of contributor insights""" - - contributor_insights_mode: str | None = None - """ - The updated mode of CloudWatch Contributor Insights that determines - whether to monitor all access and throttled events or to track throttled - events exclusively. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_CONTRIBUTOR_INSIGHTS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.table_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_CONTRIBUTOR_INSIGHTS_OUTPUT.members["TableName"], - self.table_name, - ) - - if self.index_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_CONTRIBUTOR_INSIGHTS_OUTPUT.members["IndexName"], - self.index_name, - ) - - if self.contributor_insights_status is not None: - serializer.write_string( - _SCHEMA_UPDATE_CONTRIBUTOR_INSIGHTS_OUTPUT.members[ - "ContributorInsightsStatus" - ], - self.contributor_insights_status, - ) - - if self.contributor_insights_mode is not None: - serializer.write_string( - _SCHEMA_UPDATE_CONTRIBUTOR_INSIGHTS_OUTPUT.members[ - "ContributorInsightsMode" - ], - self.contributor_insights_mode, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["table_name"] = de.read_string( - _SCHEMA_UPDATE_CONTRIBUTOR_INSIGHTS_OUTPUT.members["TableName"] - ) - - case 1: - kwargs["index_name"] = de.read_string( - _SCHEMA_UPDATE_CONTRIBUTOR_INSIGHTS_OUTPUT.members["IndexName"] - ) - - case 2: - kwargs["contributor_insights_status"] = ContributorInsightsStatus( - de.read_string( - _SCHEMA_UPDATE_CONTRIBUTOR_INSIGHTS_OUTPUT.members[ - "ContributorInsightsStatus" - ] - ) - ) - - case 3: - kwargs["contributor_insights_mode"] = ContributorInsightsMode( - de.read_string( - _SCHEMA_UPDATE_CONTRIBUTOR_INSIGHTS_OUTPUT.members[ - "ContributorInsightsMode" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_CONTRIBUTOR_INSIGHTS_OUTPUT, consumer=_consumer - ) - return kwargs - - -UPDATE_CONTRIBUTOR_INSIGHTS = APIOperation( - input=UpdateContributorInsightsInput, - output=UpdateContributorInsightsOutput, - schema=_SCHEMA_UPDATE_CONTRIBUTOR_INSIGHTS, - input_schema=_SCHEMA_UPDATE_CONTRIBUTOR_INSIGHTS_INPUT, - output_schema=_SCHEMA_UPDATE_CONTRIBUTOR_INSIGHTS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[_SCHEMA_INTERNAL_SERVER_ERROR, _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION], -) - - -@dataclass(kw_only=True) -class ReplicaAlreadyExistsException(ServiceError): - """The specified replica is already part of the global table.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REPLICA_ALREADY_EXISTS_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_REPLICA_ALREADY_EXISTS_EXCEPTION.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_REPLICA_ALREADY_EXISTS_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_REPLICA_ALREADY_EXISTS_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ReplicaNotFoundException(ServiceError): - """The specified replica is no longer part of the global table.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REPLICA_NOT_FOUND_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_REPLICA_NOT_FOUND_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_REPLICA_NOT_FOUND_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_REPLICA_NOT_FOUND_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ReplicaUpdate: - """ - Represents one of the following: - - - A new replica to be added to an existing global table. - - - New parameters for an existing replica. - - - An existing replica to be removed from an existing global table. - """ - - create: CreateReplicaAction | None = None - """ - The parameters required for creating a replica on an existing global - table. - """ - - delete: DeleteReplicaAction | None = None - """The name of the existing replica to be removed.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REPLICA_UPDATE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.create is not None: - serializer.write_struct( - _SCHEMA_REPLICA_UPDATE.members["Create"], self.create - ) - - if self.delete is not None: - serializer.write_struct( - _SCHEMA_REPLICA_UPDATE.members["Delete"], self.delete - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["create"] = CreateReplicaAction.deserialize(de) - - case 1: - kwargs["delete"] = DeleteReplicaAction.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_REPLICA_UPDATE, consumer=_consumer) - return kwargs - - -def _serialize_replica_update_list( - serializer: ShapeSerializer, schema: Schema, value: list[ReplicaUpdate] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_replica_update_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ReplicaUpdate]: - result: list[ReplicaUpdate] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ReplicaUpdate.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class UpdateGlobalTableInput: - """Dataclass for UpdateGlobalTableInput structure.""" - - global_table_name: str | None = None - """The global table name.""" - - replica_updates: list[ReplicaUpdate] | None = None - """A list of Regions that should be added or removed from the global table.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_GLOBAL_TABLE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.global_table_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_GLOBAL_TABLE_INPUT.members["GlobalTableName"], - self.global_table_name, - ) - - if self.replica_updates is not None: - _serialize_replica_update_list( - serializer, - _SCHEMA_UPDATE_GLOBAL_TABLE_INPUT.members["ReplicaUpdates"], - self.replica_updates, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["global_table_name"] = de.read_string( - _SCHEMA_UPDATE_GLOBAL_TABLE_INPUT.members["GlobalTableName"] - ) - - case 1: - kwargs["replica_updates"] = _deserialize_replica_update_list( - de, _SCHEMA_UPDATE_GLOBAL_TABLE_INPUT.members["ReplicaUpdates"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_GLOBAL_TABLE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateGlobalTableOutput: - """Dataclass for UpdateGlobalTableOutput structure.""" - - global_table_description: GlobalTableDescription | None = None - """Contains the details of the global table.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_GLOBAL_TABLE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.global_table_description is not None: - serializer.write_struct( - _SCHEMA_UPDATE_GLOBAL_TABLE_OUTPUT.members["GlobalTableDescription"], - self.global_table_description, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["global_table_description"] = ( - GlobalTableDescription.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_GLOBAL_TABLE_OUTPUT, consumer=_consumer) - return kwargs - - -UPDATE_GLOBAL_TABLE = APIOperation( - input=UpdateGlobalTableInput, - output=UpdateGlobalTableOutput, - schema=_SCHEMA_UPDATE_GLOBAL_TABLE, - input_schema=_SCHEMA_UPDATE_GLOBAL_TABLE_INPUT, - output_schema=_SCHEMA_UPDATE_GLOBAL_TABLE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.dynamodb#GlobalTableNotFoundException" - ): GlobalTableNotFoundException, - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#InvalidEndpointException" - ): InvalidEndpointException, - ShapeID( - "com.amazonaws.dynamodb#ReplicaAlreadyExistsException" - ): ReplicaAlreadyExistsException, - ShapeID( - "com.amazonaws.dynamodb#ReplicaNotFoundException" - ): ReplicaNotFoundException, - ShapeID( - "com.amazonaws.dynamodb#TableNotFoundException" - ): TableNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_GLOBAL_TABLE_NOT_FOUND_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR, - _SCHEMA_INVALID_ENDPOINT_EXCEPTION, - _SCHEMA_REPLICA_ALREADY_EXISTS_EXCEPTION, - _SCHEMA_REPLICA_NOT_FOUND_EXCEPTION, - _SCHEMA_TABLE_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class IndexNotFoundException(ServiceError): - """The operation tried to access a nonexistent index.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INDEX_NOT_FOUND_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INDEX_NOT_FOUND_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INDEX_NOT_FOUND_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INDEX_NOT_FOUND_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GlobalTableGlobalSecondaryIndexSettingsUpdate: - """ - Represents the settings of a global secondary index for a global table - that will be modified. - """ - - index_name: str - """ - The name of the global secondary index. The name must be unique among - all other indexes on this table. - """ - - provisioned_write_capacity_units: int | None = None - """ - The maximum number of writes consumed per second before DynamoDB returns - a `ThrottlingException.` - """ - - provisioned_write_capacity_auto_scaling_settings_update: ( - AutoScalingSettingsUpdate | None - ) = None - """ - Auto scaling settings for managing a global secondary index's write - capacity units. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GLOBAL_TABLE_GLOBAL_SECONDARY_INDEX_SETTINGS_UPDATE, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GLOBAL_TABLE_GLOBAL_SECONDARY_INDEX_SETTINGS_UPDATE.members[ - "IndexName" - ], - self.index_name, - ) - if self.provisioned_write_capacity_units is not None: - serializer.write_long( - _SCHEMA_GLOBAL_TABLE_GLOBAL_SECONDARY_INDEX_SETTINGS_UPDATE.members[ - "ProvisionedWriteCapacityUnits" - ], - self.provisioned_write_capacity_units, - ) - - if self.provisioned_write_capacity_auto_scaling_settings_update is not None: - serializer.write_struct( - _SCHEMA_GLOBAL_TABLE_GLOBAL_SECONDARY_INDEX_SETTINGS_UPDATE.members[ - "ProvisionedWriteCapacityAutoScalingSettingsUpdate" - ], - self.provisioned_write_capacity_auto_scaling_settings_update, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["index_name"] = de.read_string( - _SCHEMA_GLOBAL_TABLE_GLOBAL_SECONDARY_INDEX_SETTINGS_UPDATE.members[ - "IndexName" - ] - ) - - case 1: - kwargs["provisioned_write_capacity_units"] = de.read_long( - _SCHEMA_GLOBAL_TABLE_GLOBAL_SECONDARY_INDEX_SETTINGS_UPDATE.members[ - "ProvisionedWriteCapacityUnits" - ] - ) - - case 2: - kwargs[ - "provisioned_write_capacity_auto_scaling_settings_update" - ] = AutoScalingSettingsUpdate.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GLOBAL_TABLE_GLOBAL_SECONDARY_INDEX_SETTINGS_UPDATE, - consumer=_consumer, - ) - if "index_name" not in kwargs: - kwargs["index_name"] = "" - return kwargs - - -def _serialize_global_table_global_secondary_index_settings_update_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[GlobalTableGlobalSecondaryIndexSettingsUpdate], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_global_table_global_secondary_index_settings_update_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GlobalTableGlobalSecondaryIndexSettingsUpdate]: - result: list[GlobalTableGlobalSecondaryIndexSettingsUpdate] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GlobalTableGlobalSecondaryIndexSettingsUpdate.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ReplicaGlobalSecondaryIndexSettingsUpdate: - """ - Represents the settings of a global secondary index for a global table - that will be modified. - """ - - index_name: str - """ - The name of the global secondary index. The name must be unique among - all other indexes on this table. - """ - - provisioned_read_capacity_units: int | None = None - """ - The maximum number of strongly consistent reads consumed per second - before DynamoDB returns a `ThrottlingException`. - """ - - provisioned_read_capacity_auto_scaling_settings_update: ( - AutoScalingSettingsUpdate | None - ) = None - """ - Auto scaling settings for managing a global secondary index replica's - read capacity units. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX_SETTINGS_UPDATE, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX_SETTINGS_UPDATE.members["IndexName"], - self.index_name, - ) - if self.provisioned_read_capacity_units is not None: - serializer.write_long( - _SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX_SETTINGS_UPDATE.members[ - "ProvisionedReadCapacityUnits" - ], - self.provisioned_read_capacity_units, - ) - - if self.provisioned_read_capacity_auto_scaling_settings_update is not None: - serializer.write_struct( - _SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX_SETTINGS_UPDATE.members[ - "ProvisionedReadCapacityAutoScalingSettingsUpdate" - ], - self.provisioned_read_capacity_auto_scaling_settings_update, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["index_name"] = de.read_string( - _SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX_SETTINGS_UPDATE.members[ - "IndexName" - ] - ) - - case 1: - kwargs["provisioned_read_capacity_units"] = de.read_long( - _SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX_SETTINGS_UPDATE.members[ - "ProvisionedReadCapacityUnits" - ] - ) - - case 2: - kwargs["provisioned_read_capacity_auto_scaling_settings_update"] = ( - AutoScalingSettingsUpdate.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX_SETTINGS_UPDATE, consumer=_consumer - ) - if "index_name" not in kwargs: - kwargs["index_name"] = "" - return kwargs - - -def _serialize_replica_global_secondary_index_settings_update_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[ReplicaGlobalSecondaryIndexSettingsUpdate], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_replica_global_secondary_index_settings_update_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ReplicaGlobalSecondaryIndexSettingsUpdate]: - result: list[ReplicaGlobalSecondaryIndexSettingsUpdate] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ReplicaGlobalSecondaryIndexSettingsUpdate.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ReplicaSettingsUpdate: - """ - Represents the settings for a global table in a Region that will be - modified. - """ - - region_name: str - """The Region of the replica to be added.""" - - replica_provisioned_read_capacity_units: int | None = None - """ - The maximum number of strongly consistent reads consumed per second - before DynamoDB returns a `ThrottlingException`. For more information, - see [Specifying Read and Write - Requirements](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#ProvisionedThroughput) - in the *Amazon DynamoDB Developer Guide*. - """ - - replica_provisioned_read_capacity_auto_scaling_settings_update: ( - AutoScalingSettingsUpdate | None - ) = None - """ - Auto scaling settings for managing a global table replica's read - capacity units. - """ - - replica_global_secondary_index_settings_update: ( - list[ReplicaGlobalSecondaryIndexSettingsUpdate] | None - ) = None - """ - Represents the settings of a global secondary index for a global table - that will be modified. - """ - - replica_table_class: str | None = None - """ - Replica-specific table class. If not specified, uses the source table's - table class. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REPLICA_SETTINGS_UPDATE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_REPLICA_SETTINGS_UPDATE.members["RegionName"], self.region_name - ) - if self.replica_provisioned_read_capacity_units is not None: - serializer.write_long( - _SCHEMA_REPLICA_SETTINGS_UPDATE.members[ - "ReplicaProvisionedReadCapacityUnits" - ], - self.replica_provisioned_read_capacity_units, - ) - - if ( - self.replica_provisioned_read_capacity_auto_scaling_settings_update - is not None - ): - serializer.write_struct( - _SCHEMA_REPLICA_SETTINGS_UPDATE.members[ - "ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate" - ], - self.replica_provisioned_read_capacity_auto_scaling_settings_update, - ) - - if self.replica_global_secondary_index_settings_update is not None: - _serialize_replica_global_secondary_index_settings_update_list( - serializer, - _SCHEMA_REPLICA_SETTINGS_UPDATE.members[ - "ReplicaGlobalSecondaryIndexSettingsUpdate" - ], - self.replica_global_secondary_index_settings_update, - ) - - if self.replica_table_class is not None: - serializer.write_string( - _SCHEMA_REPLICA_SETTINGS_UPDATE.members["ReplicaTableClass"], - self.replica_table_class, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["region_name"] = de.read_string( - _SCHEMA_REPLICA_SETTINGS_UPDATE.members["RegionName"] - ) - - case 1: - kwargs["replica_provisioned_read_capacity_units"] = de.read_long( - _SCHEMA_REPLICA_SETTINGS_UPDATE.members[ - "ReplicaProvisionedReadCapacityUnits" - ] - ) - - case 2: - kwargs[ - "replica_provisioned_read_capacity_auto_scaling_settings_update" - ] = AutoScalingSettingsUpdate.deserialize(de) - - case 3: - kwargs["replica_global_secondary_index_settings_update"] = ( - _deserialize_replica_global_secondary_index_settings_update_list( - de, - _SCHEMA_REPLICA_SETTINGS_UPDATE.members[ - "ReplicaGlobalSecondaryIndexSettingsUpdate" - ], - ) - ) - - case 4: - kwargs["replica_table_class"] = TableClass( - de.read_string( - _SCHEMA_REPLICA_SETTINGS_UPDATE.members["ReplicaTableClass"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_REPLICA_SETTINGS_UPDATE, consumer=_consumer) - if "region_name" not in kwargs: - kwargs["region_name"] = "" - return kwargs - - -def _serialize_replica_settings_update_list( - serializer: ShapeSerializer, schema: Schema, value: list[ReplicaSettingsUpdate] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_replica_settings_update_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ReplicaSettingsUpdate]: - result: list[ReplicaSettingsUpdate] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ReplicaSettingsUpdate.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class UpdateGlobalTableSettingsInput: - """Dataclass for UpdateGlobalTableSettingsInput structure.""" - - global_table_name: str | None = None - """The name of the global table""" - - global_table_billing_mode: str | None = None - """ - The billing mode of the global table. If `GlobalTableBillingMode` is not - specified, the global table defaults to `PROVISIONED` capacity billing - mode. - - - `PROVISIONED` - We recommend using `PROVISIONED` for predictable - workloads. `PROVISIONED` sets the billing mode to [Provisioned - capacity - mode](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/provisioned-capacity-mode.html). - - - `PAY_PER_REQUEST` - We recommend using `PAY_PER_REQUEST` for - unpredictable workloads. `PAY_PER_REQUEST` sets the billing mode to - [On-demand capacity - mode](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/on-demand-capacity-mode.html). - """ - - global_table_provisioned_write_capacity_units: int | None = None - """ - The maximum number of writes consumed per second before DynamoDB returns - a `ThrottlingException.` - """ - - global_table_provisioned_write_capacity_auto_scaling_settings_update: ( - AutoScalingSettingsUpdate | None - ) = None - """ - Auto scaling settings for managing provisioned write capacity for the - global table. - """ - - global_table_global_secondary_index_settings_update: ( - list[GlobalTableGlobalSecondaryIndexSettingsUpdate] | None - ) = None - """ - Represents the settings of a global secondary index for a global table - that will be modified. - """ - - replica_settings_update: list[ReplicaSettingsUpdate] | None = None - """ - Represents the settings for a global table in a Region that will be - modified. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_GLOBAL_TABLE_SETTINGS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.global_table_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_GLOBAL_TABLE_SETTINGS_INPUT.members["GlobalTableName"], - self.global_table_name, - ) - - if self.global_table_billing_mode is not None: - serializer.write_string( - _SCHEMA_UPDATE_GLOBAL_TABLE_SETTINGS_INPUT.members[ - "GlobalTableBillingMode" - ], - self.global_table_billing_mode, - ) - - if self.global_table_provisioned_write_capacity_units is not None: - serializer.write_long( - _SCHEMA_UPDATE_GLOBAL_TABLE_SETTINGS_INPUT.members[ - "GlobalTableProvisionedWriteCapacityUnits" - ], - self.global_table_provisioned_write_capacity_units, - ) - - if ( - self.global_table_provisioned_write_capacity_auto_scaling_settings_update - is not None - ): - serializer.write_struct( - _SCHEMA_UPDATE_GLOBAL_TABLE_SETTINGS_INPUT.members[ - "GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate" - ], - self.global_table_provisioned_write_capacity_auto_scaling_settings_update, - ) - - if self.global_table_global_secondary_index_settings_update is not None: - _serialize_global_table_global_secondary_index_settings_update_list( - serializer, - _SCHEMA_UPDATE_GLOBAL_TABLE_SETTINGS_INPUT.members[ - "GlobalTableGlobalSecondaryIndexSettingsUpdate" - ], - self.global_table_global_secondary_index_settings_update, - ) - - if self.replica_settings_update is not None: - _serialize_replica_settings_update_list( - serializer, - _SCHEMA_UPDATE_GLOBAL_TABLE_SETTINGS_INPUT.members[ - "ReplicaSettingsUpdate" - ], - self.replica_settings_update, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["global_table_name"] = de.read_string( - _SCHEMA_UPDATE_GLOBAL_TABLE_SETTINGS_INPUT.members[ - "GlobalTableName" - ] - ) - - case 1: - kwargs["global_table_billing_mode"] = BillingMode( - de.read_string( - _SCHEMA_UPDATE_GLOBAL_TABLE_SETTINGS_INPUT.members[ - "GlobalTableBillingMode" - ] - ) - ) - - case 2: - kwargs["global_table_provisioned_write_capacity_units"] = ( - de.read_long( - _SCHEMA_UPDATE_GLOBAL_TABLE_SETTINGS_INPUT.members[ - "GlobalTableProvisionedWriteCapacityUnits" - ] - ) - ) - - case 3: - kwargs[ - "global_table_provisioned_write_capacity_auto_scaling_settings_update" - ] = AutoScalingSettingsUpdate.deserialize(de) - - case 4: - kwargs["global_table_global_secondary_index_settings_update"] = ( - _deserialize_global_table_global_secondary_index_settings_update_list( - de, - _SCHEMA_UPDATE_GLOBAL_TABLE_SETTINGS_INPUT.members[ - "GlobalTableGlobalSecondaryIndexSettingsUpdate" - ], - ) - ) - - case 5: - kwargs["replica_settings_update"] = ( - _deserialize_replica_settings_update_list( - de, - _SCHEMA_UPDATE_GLOBAL_TABLE_SETTINGS_INPUT.members[ - "ReplicaSettingsUpdate" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_GLOBAL_TABLE_SETTINGS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateGlobalTableSettingsOutput: - """Dataclass for UpdateGlobalTableSettingsOutput structure.""" - - global_table_name: str | None = None - """The name of the global table.""" - - replica_settings: list[ReplicaSettingsDescription] | None = None - """The Region-specific settings for the global table.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_GLOBAL_TABLE_SETTINGS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.global_table_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_GLOBAL_TABLE_SETTINGS_OUTPUT.members["GlobalTableName"], - self.global_table_name, - ) - - if self.replica_settings is not None: - _serialize_replica_settings_description_list( - serializer, - _SCHEMA_UPDATE_GLOBAL_TABLE_SETTINGS_OUTPUT.members["ReplicaSettings"], - self.replica_settings, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["global_table_name"] = de.read_string( - _SCHEMA_UPDATE_GLOBAL_TABLE_SETTINGS_OUTPUT.members[ - "GlobalTableName" - ] - ) - - case 1: - kwargs["replica_settings"] = ( - _deserialize_replica_settings_description_list( - de, - _SCHEMA_UPDATE_GLOBAL_TABLE_SETTINGS_OUTPUT.members[ - "ReplicaSettings" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_GLOBAL_TABLE_SETTINGS_OUTPUT, consumer=_consumer - ) - return kwargs - - -UPDATE_GLOBAL_TABLE_SETTINGS = APIOperation( - input=UpdateGlobalTableSettingsInput, - output=UpdateGlobalTableSettingsOutput, - schema=_SCHEMA_UPDATE_GLOBAL_TABLE_SETTINGS, - input_schema=_SCHEMA_UPDATE_GLOBAL_TABLE_SETTINGS_INPUT, - output_schema=_SCHEMA_UPDATE_GLOBAL_TABLE_SETTINGS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.dynamodb#GlobalTableNotFoundException" - ): GlobalTableNotFoundException, - ShapeID( - "com.amazonaws.dynamodb#IndexNotFoundException" - ): IndexNotFoundException, - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#InvalidEndpointException" - ): InvalidEndpointException, - ShapeID( - "com.amazonaws.dynamodb#LimitExceededException" - ): LimitExceededException, - ShapeID( - "com.amazonaws.dynamodb#ReplicaNotFoundException" - ): ReplicaNotFoundException, - ShapeID( - "com.amazonaws.dynamodb#ResourceInUseException" - ): ResourceInUseException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_GLOBAL_TABLE_NOT_FOUND_EXCEPTION, - _SCHEMA_INDEX_NOT_FOUND_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR, - _SCHEMA_INVALID_ENDPOINT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_REPLICA_NOT_FOUND_EXCEPTION, - _SCHEMA_RESOURCE_IN_USE_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateKinesisStreamingConfiguration: - """Enables updating the configuration for Kinesis Streaming.""" - - approximate_creation_date_time_precision: str | None = None - """Enables updating the precision of Kinesis data stream timestamp.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_KINESIS_STREAMING_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.approximate_creation_date_time_precision is not None: - serializer.write_string( - _SCHEMA_UPDATE_KINESIS_STREAMING_CONFIGURATION.members[ - "ApproximateCreationDateTimePrecision" - ], - self.approximate_creation_date_time_precision, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["approximate_creation_date_time_precision"] = ( - ApproximateCreationDateTimePrecision( - de.read_string( - _SCHEMA_UPDATE_KINESIS_STREAMING_CONFIGURATION.members[ - "ApproximateCreationDateTimePrecision" - ] - ) - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_KINESIS_STREAMING_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateKinesisStreamingDestinationInput: - """Dataclass for UpdateKinesisStreamingDestinationInput structure.""" - - table_name: str | None = None - """ - The table name for the Kinesis streaming destination input. You can also - provide the ARN of the table in this parameter. - """ - - stream_arn: str | None = None - """The Amazon Resource Name (ARN) for the Kinesis stream input.""" - - update_kinesis_streaming_configuration: ( - UpdateKinesisStreamingConfiguration | None - ) = None - """The command to update the Kinesis stream configuration.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_UPDATE_KINESIS_STREAMING_DESTINATION_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.table_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_KINESIS_STREAMING_DESTINATION_INPUT.members["TableName"], - self.table_name, - ) - - if self.stream_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_KINESIS_STREAMING_DESTINATION_INPUT.members["StreamArn"], - self.stream_arn, - ) - - if self.update_kinesis_streaming_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_KINESIS_STREAMING_DESTINATION_INPUT.members[ - "UpdateKinesisStreamingConfiguration" - ], - self.update_kinesis_streaming_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["table_name"] = de.read_string( - _SCHEMA_UPDATE_KINESIS_STREAMING_DESTINATION_INPUT.members[ - "TableName" - ] - ) - - case 1: - kwargs["stream_arn"] = de.read_string( - _SCHEMA_UPDATE_KINESIS_STREAMING_DESTINATION_INPUT.members[ - "StreamArn" - ] - ) - - case 2: - kwargs["update_kinesis_streaming_configuration"] = ( - UpdateKinesisStreamingConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_KINESIS_STREAMING_DESTINATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateKinesisStreamingDestinationOutput: - """Dataclass for UpdateKinesisStreamingDestinationOutput structure.""" - - table_name: str | None = None - """The table name for the Kinesis streaming destination output.""" - - stream_arn: str | None = None - """The ARN for the Kinesis stream input.""" - - destination_status: str | None = None - """ - The status of the attempt to update the Kinesis streaming destination - output. - """ - - update_kinesis_streaming_configuration: ( - UpdateKinesisStreamingConfiguration | None - ) = None - """The command to update the Kinesis streaming destination configuration.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_UPDATE_KINESIS_STREAMING_DESTINATION_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.table_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_KINESIS_STREAMING_DESTINATION_OUTPUT.members[ - "TableName" - ], - self.table_name, - ) - - if self.stream_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_KINESIS_STREAMING_DESTINATION_OUTPUT.members[ - "StreamArn" - ], - self.stream_arn, - ) - - if self.destination_status is not None: - serializer.write_string( - _SCHEMA_UPDATE_KINESIS_STREAMING_DESTINATION_OUTPUT.members[ - "DestinationStatus" - ], - self.destination_status, - ) - - if self.update_kinesis_streaming_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_KINESIS_STREAMING_DESTINATION_OUTPUT.members[ - "UpdateKinesisStreamingConfiguration" - ], - self.update_kinesis_streaming_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["table_name"] = de.read_string( - _SCHEMA_UPDATE_KINESIS_STREAMING_DESTINATION_OUTPUT.members[ - "TableName" - ] - ) - - case 1: - kwargs["stream_arn"] = de.read_string( - _SCHEMA_UPDATE_KINESIS_STREAMING_DESTINATION_OUTPUT.members[ - "StreamArn" - ] - ) - - case 2: - kwargs["destination_status"] = DestinationStatus( - de.read_string( - _SCHEMA_UPDATE_KINESIS_STREAMING_DESTINATION_OUTPUT.members[ - "DestinationStatus" - ] - ) - ) - - case 3: - kwargs["update_kinesis_streaming_configuration"] = ( - UpdateKinesisStreamingConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_KINESIS_STREAMING_DESTINATION_OUTPUT, consumer=_consumer - ) - return kwargs - - -UPDATE_KINESIS_STREAMING_DESTINATION = APIOperation( - input=UpdateKinesisStreamingDestinationInput, - output=UpdateKinesisStreamingDestinationOutput, - schema=_SCHEMA_UPDATE_KINESIS_STREAMING_DESTINATION, - input_schema=_SCHEMA_UPDATE_KINESIS_STREAMING_DESTINATION_INPUT, - output_schema=_SCHEMA_UPDATE_KINESIS_STREAMING_DESTINATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#InvalidEndpointException" - ): InvalidEndpointException, - ShapeID( - "com.amazonaws.dynamodb#LimitExceededException" - ): LimitExceededException, - ShapeID( - "com.amazonaws.dynamodb#ResourceInUseException" - ): ResourceInUseException, - ShapeID( - "com.amazonaws.dynamodb#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_SERVER_ERROR, - _SCHEMA_INVALID_ENDPOINT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_RESOURCE_IN_USE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateGlobalSecondaryIndexAction: - """ - Represents the new provisioned throughput settings to be applied to a - global secondary index. - """ - - index_name: str - """The name of the global secondary index to be updated.""" - - provisioned_throughput: ProvisionedThroughput | None = None - """ - Represents the provisioned throughput settings for the specified global - secondary index. - - For current minimum and maximum provisioned throughput values, see - [Service, Account, and Table - Quotas](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - on_demand_throughput: OnDemandThroughput | None = None - """ - Updates the maximum number of read and write units for the specified - global secondary index. If you use this parameter, you must specify - `MaxReadRequestUnits`, `MaxWriteRequestUnits`, or both. - """ - - warm_throughput: WarmThroughput | None = None - """ - Represents the warm throughput value of the new provisioned throughput - settings to be applied to a global secondary index. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_GLOBAL_SECONDARY_INDEX_ACTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_UPDATE_GLOBAL_SECONDARY_INDEX_ACTION.members["IndexName"], - self.index_name, - ) - if self.provisioned_throughput is not None: - serializer.write_struct( - _SCHEMA_UPDATE_GLOBAL_SECONDARY_INDEX_ACTION.members[ - "ProvisionedThroughput" - ], - self.provisioned_throughput, - ) - - if self.on_demand_throughput is not None: - serializer.write_struct( - _SCHEMA_UPDATE_GLOBAL_SECONDARY_INDEX_ACTION.members[ - "OnDemandThroughput" - ], - self.on_demand_throughput, - ) - - if self.warm_throughput is not None: - serializer.write_struct( - _SCHEMA_UPDATE_GLOBAL_SECONDARY_INDEX_ACTION.members["WarmThroughput"], - self.warm_throughput, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["index_name"] = de.read_string( - _SCHEMA_UPDATE_GLOBAL_SECONDARY_INDEX_ACTION.members[ - "IndexName" - ] - ) - - case 1: - kwargs["provisioned_throughput"] = ( - ProvisionedThroughput.deserialize(de) - ) - - case 2: - kwargs["on_demand_throughput"] = OnDemandThroughput.deserialize(de) - - case 3: - kwargs["warm_throughput"] = WarmThroughput.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_GLOBAL_SECONDARY_INDEX_ACTION, consumer=_consumer - ) - if "index_name" not in kwargs: - kwargs["index_name"] = "" - return kwargs - - -@dataclass(kw_only=True) -class GlobalSecondaryIndexUpdate: - """ - Represents one of the following: - - - A new global secondary index to be added to an existing table. - - - New provisioned throughput parameters for an existing global secondary - index. - - - An existing global secondary index to be removed from an existing - table. - """ - - update: UpdateGlobalSecondaryIndexAction | None = None - """ - The name of an existing global secondary index, along with new - provisioned throughput settings to be applied to that index. - """ - - create: CreateGlobalSecondaryIndexAction | None = None - """ - The parameters required for creating a global secondary index on an - existing table: - - - `IndexName ` - - - `KeySchema ` - - - `AttributeDefinitions ` - - - `Projection ` - - - `ProvisionedThroughput ` - """ - - delete: DeleteGlobalSecondaryIndexAction | None = None - """The name of an existing global secondary index to be removed.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GLOBAL_SECONDARY_INDEX_UPDATE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.update is not None: - serializer.write_struct( - _SCHEMA_GLOBAL_SECONDARY_INDEX_UPDATE.members["Update"], self.update - ) - - if self.create is not None: - serializer.write_struct( - _SCHEMA_GLOBAL_SECONDARY_INDEX_UPDATE.members["Create"], self.create - ) - - if self.delete is not None: - serializer.write_struct( - _SCHEMA_GLOBAL_SECONDARY_INDEX_UPDATE.members["Delete"], self.delete - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["update"] = UpdateGlobalSecondaryIndexAction.deserialize(de) - - case 1: - kwargs["create"] = CreateGlobalSecondaryIndexAction.deserialize(de) - - case 2: - kwargs["delete"] = DeleteGlobalSecondaryIndexAction.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GLOBAL_SECONDARY_INDEX_UPDATE, consumer=_consumer - ) - return kwargs - - -def _serialize_global_secondary_index_update_list( - serializer: ShapeSerializer, schema: Schema, value: list[GlobalSecondaryIndexUpdate] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_global_secondary_index_update_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GlobalSecondaryIndexUpdate]: - result: list[GlobalSecondaryIndexUpdate] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GlobalSecondaryIndexUpdate.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GlobalTableWitnessGroupUpdate: - """ - Represents one of the following: - - - A new witness to be added to a new global table. - - - An existing witness to be removed from an existing global table. - - You can configure one witness per MRSC global table. - """ - - create: CreateGlobalTableWitnessGroupMemberAction | None = None - """ - Specifies a witness Region to be added to a new MRSC global table. The - witness must be added when creating the MRSC global table. - """ - - delete: DeleteGlobalTableWitnessGroupMemberAction | None = None - """ - Specifies a witness Region to be removed from an existing global table. - Must be done in conjunction with removing a replica. The deletion of - both a witness and replica converts the remaining replica to a - single-Region DynamoDB table. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GLOBAL_TABLE_WITNESS_GROUP_UPDATE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.create is not None: - serializer.write_struct( - _SCHEMA_GLOBAL_TABLE_WITNESS_GROUP_UPDATE.members["Create"], self.create - ) - - if self.delete is not None: - serializer.write_struct( - _SCHEMA_GLOBAL_TABLE_WITNESS_GROUP_UPDATE.members["Delete"], self.delete - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["create"] = ( - CreateGlobalTableWitnessGroupMemberAction.deserialize(de) - ) - - case 1: - kwargs["delete"] = ( - DeleteGlobalTableWitnessGroupMemberAction.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GLOBAL_TABLE_WITNESS_GROUP_UPDATE, consumer=_consumer - ) - return kwargs - - -def _serialize_global_table_witness_group_update_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[GlobalTableWitnessGroupUpdate], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_global_table_witness_group_update_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GlobalTableWitnessGroupUpdate]: - result: list[GlobalTableWitnessGroupUpdate] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GlobalTableWitnessGroupUpdate.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class UpdateReplicationGroupMemberAction: - """Represents a replica to be modified.""" - - region_name: str - """The Region where the replica exists.""" - - kms_master_key_id: str | None = None - """ - The KMS key of the replica that should be used for KMS encryption. To - specify a key, use its key ID, Amazon Resource Name (ARN), alias name, - or alias ARN. Note that you should only provide this parameter if the - key is different from the default DynamoDB KMS key `alias/aws/dynamodb`. - """ - - provisioned_throughput_override: ProvisionedThroughputOverride | None = None - """ - Replica-specific provisioned throughput. If not specified, uses the - source table's provisioned throughput settings. - """ - - on_demand_throughput_override: OnDemandThroughputOverride | None = None - """Overrides the maximum on-demand throughput for the replica table.""" - - global_secondary_indexes: list[ReplicaGlobalSecondaryIndex] | None = None - """Replica-specific global secondary index settings.""" - - table_class_override: str | None = None - """ - Replica-specific table class. If not specified, uses the source table's - table class. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_REPLICATION_GROUP_MEMBER_ACTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_UPDATE_REPLICATION_GROUP_MEMBER_ACTION.members["RegionName"], - self.region_name, - ) - if self.kms_master_key_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_REPLICATION_GROUP_MEMBER_ACTION.members[ - "KMSMasterKeyId" - ], - self.kms_master_key_id, - ) - - if self.provisioned_throughput_override is not None: - serializer.write_struct( - _SCHEMA_UPDATE_REPLICATION_GROUP_MEMBER_ACTION.members[ - "ProvisionedThroughputOverride" - ], - self.provisioned_throughput_override, - ) - - if self.on_demand_throughput_override is not None: - serializer.write_struct( - _SCHEMA_UPDATE_REPLICATION_GROUP_MEMBER_ACTION.members[ - "OnDemandThroughputOverride" - ], - self.on_demand_throughput_override, - ) - - if self.global_secondary_indexes is not None: - _serialize_replica_global_secondary_index_list( - serializer, - _SCHEMA_UPDATE_REPLICATION_GROUP_MEMBER_ACTION.members[ - "GlobalSecondaryIndexes" - ], - self.global_secondary_indexes, - ) - - if self.table_class_override is not None: - serializer.write_string( - _SCHEMA_UPDATE_REPLICATION_GROUP_MEMBER_ACTION.members[ - "TableClassOverride" - ], - self.table_class_override, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["region_name"] = de.read_string( - _SCHEMA_UPDATE_REPLICATION_GROUP_MEMBER_ACTION.members[ - "RegionName" - ] - ) - - case 1: - kwargs["kms_master_key_id"] = de.read_string( - _SCHEMA_UPDATE_REPLICATION_GROUP_MEMBER_ACTION.members[ - "KMSMasterKeyId" - ] - ) - - case 2: - kwargs["provisioned_throughput_override"] = ( - ProvisionedThroughputOverride.deserialize(de) - ) - - case 3: - kwargs["on_demand_throughput_override"] = ( - OnDemandThroughputOverride.deserialize(de) - ) - - case 4: - kwargs["global_secondary_indexes"] = ( - _deserialize_replica_global_secondary_index_list( - de, - _SCHEMA_UPDATE_REPLICATION_GROUP_MEMBER_ACTION.members[ - "GlobalSecondaryIndexes" - ], - ) - ) - - case 5: - kwargs["table_class_override"] = TableClass( - de.read_string( - _SCHEMA_UPDATE_REPLICATION_GROUP_MEMBER_ACTION.members[ - "TableClassOverride" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_REPLICATION_GROUP_MEMBER_ACTION, consumer=_consumer - ) - if "region_name" not in kwargs: - kwargs["region_name"] = "" - return kwargs - - -@dataclass(kw_only=True) -class ReplicationGroupUpdate: - """ - Represents one of the following: - - - A new replica to be added to an existing regional table or global - table. This request invokes the `CreateTableReplica` action in the - destination Region. - - - New parameters for an existing replica. This request invokes the - `UpdateTable` action in the destination Region. - - - An existing replica to be deleted. The request invokes the - `DeleteTableReplica` action in the destination Region, deleting the - replica and all if its items in the destination Region. - - Note: - When you manually remove a table or global table replica, you do not - automatically remove any associated scalable targets, scaling policies, - or CloudWatch alarms. - """ - - create: CreateReplicationGroupMemberAction | None = None - """The parameters required for creating a replica for the table.""" - - update: UpdateReplicationGroupMemberAction | None = None - """The parameters required for updating a replica for the table.""" - - delete: DeleteReplicationGroupMemberAction | None = None - """The parameters required for deleting a replica for the table.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REPLICATION_GROUP_UPDATE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.create is not None: - serializer.write_struct( - _SCHEMA_REPLICATION_GROUP_UPDATE.members["Create"], self.create - ) - - if self.update is not None: - serializer.write_struct( - _SCHEMA_REPLICATION_GROUP_UPDATE.members["Update"], self.update - ) - - if self.delete is not None: - serializer.write_struct( - _SCHEMA_REPLICATION_GROUP_UPDATE.members["Delete"], self.delete - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["create"] = CreateReplicationGroupMemberAction.deserialize( - de - ) - - case 1: - kwargs["update"] = UpdateReplicationGroupMemberAction.deserialize( - de - ) - - case 2: - kwargs["delete"] = DeleteReplicationGroupMemberAction.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_REPLICATION_GROUP_UPDATE, consumer=_consumer) - return kwargs - - -def _serialize_replication_group_update_list( - serializer: ShapeSerializer, schema: Schema, value: list[ReplicationGroupUpdate] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_replication_group_update_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ReplicationGroupUpdate]: - result: list[ReplicationGroupUpdate] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ReplicationGroupUpdate.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class VectorIndexUpdate: - """A vector index to be added to or removed from a table.""" - - create: CreateVectorIndexAction | None = None - """The configuration for creating a new vector index on the table.""" - - delete: DeleteVectorIndexAction | None = None - """The configuration for deleting an existing vector index from the table.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VECTOR_INDEX_UPDATE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.create is not None: - serializer.write_struct( - _SCHEMA_VECTOR_INDEX_UPDATE.members["Create"], self.create - ) - - if self.delete is not None: - serializer.write_struct( - _SCHEMA_VECTOR_INDEX_UPDATE.members["Delete"], self.delete - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["create"] = CreateVectorIndexAction.deserialize(de) - - case 1: - kwargs["delete"] = DeleteVectorIndexAction.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VECTOR_INDEX_UPDATE, consumer=_consumer) - return kwargs - - -def _serialize_vector_index_update_list( - serializer: ShapeSerializer, schema: Schema, value: list[VectorIndexUpdate] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_vector_index_update_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[VectorIndexUpdate]: - result: list[VectorIndexUpdate] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(VectorIndexUpdate.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class UpdateTableInput: - """Represents the input of an `UpdateTable` operation.""" - - attribute_definitions: list[AttributeDefinition] | None = None - """ - An array of attributes that describe the key schema for the table and - indexes. If you are adding a new global secondary index to the table, - `AttributeDefinitions` must include the key element(s) of the new index. - """ - - table_name: str | None = None - """ - The name of the table to be updated. You can also provide the Amazon - Resource Name (ARN) of the table in this parameter. - """ - - billing_mode: str | None = None - """ - Controls how you are charged for read and write throughput and how you - manage capacity. When switching from pay-per-request to provisioned - capacity, initial provisioned capacity values must be set. The initial - provisioned capacity values are estimated based on the consumed read and - write capacity of your table and global secondary indexes over the past - 30 minutes. - - - `PAY_PER_REQUEST` - We recommend using `PAY_PER_REQUEST` for most - DynamoDB workloads. `PAY_PER_REQUEST` sets the billing mode to - [On-demand capacity - mode](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/on-demand-capacity-mode.html). - - - `PROVISIONED` - We recommend using `PROVISIONED` for steady workloads - with predictable growth where capacity requirements can be reliably - forecasted. `PROVISIONED` sets the billing mode to [Provisioned - capacity - mode](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/provisioned-capacity-mode.html). - """ - - provisioned_throughput: ProvisionedThroughput | None = None - """ - The new provisioned throughput settings for the specified table or - index. - """ - - global_secondary_index_updates: list[GlobalSecondaryIndexUpdate] | None = None - """ - An array of one or more global secondary indexes for the table. For each - index in the array, you can request one action: - - - `Create` - add a new global secondary index to the table. - - - `Update` - modify the provisioned throughput settings of an existing - global secondary index. - - - `Delete` - remove a global secondary index from the table. - - You can create or delete only one global secondary index per - `UpdateTable` operation. - - For more information, see [Managing Global Secondary - Indexes](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GSI.OnlineOps.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - stream_specification: StreamSpecification | None = None - """ - Represents the DynamoDB Streams configuration for the table. - - Note: - You receive a `ValidationException` if you try to enable a stream on a - table that already has a stream, or if you try to disable a stream on a - table that doesn't have a stream. - """ - - sse_specification: SSESpecification | None = None - """The new server-side encryption settings for the specified table.""" - - replica_updates: list[ReplicationGroupUpdate] | None = None - """ - A list of replica update actions (create, delete, or update) for the - table. - """ - - table_class: str | None = None - """ - The table class of the table to be updated. Valid values are `STANDARD` - and `STANDARD_INFREQUENT_ACCESS`. - """ - - deletion_protection_enabled: bool | None = None - """ - Indicates whether deletion protection is to be enabled (true) or - disabled (false) on the table. - """ - - multi_region_consistency: str | None = None - """ - Specifies the consistency mode for a new global table. This parameter is - only valid when you create a global table by specifying one or more - [Create](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ReplicationGroupUpdate.html#DDB-Type-ReplicationGroupUpdate-Create) - actions in the - [ReplicaUpdates](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_UpdateTable.html#DDB-UpdateTable-request-ReplicaUpdates) - action list. - - You can specify one of the following consistency modes: - - - `EVENTUAL`: Configures a new global table for multi-Region eventual - consistency (MREC). This is the default consistency mode for global - tables. - - - `STRONG`: Configures a new global table for multi-Region strong - consistency (MRSC). - - If you don't specify this field, the global table consistency mode - defaults to `EVENTUAL`. For more information about global tables - consistency modes, see [Consistency - modes](https://docs.aws.amazon.com/V2globaltables_HowItWorks.html#V2globaltables_HowItWorks.consistency-modes) - in DynamoDB developer guide. - """ - - global_table_witness_updates: list[GlobalTableWitnessGroupUpdate] | None = None - """ - A list of witness updates for a MRSC global table. A witness provides a - cost-effective alternative to a full replica in a MRSC global table by - maintaining replicated change data written to global table replicas. You - cannot perform read or write operations on a witness. For each witness, - you can request one action: - - - `Create` - add a new witness to the global table. - - - `Delete` - remove a witness from the global table. - - You can create or delete only one witness per `UpdateTable` operation. - - For more information, see [Multi-Region strong consistency - (MRSC)](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/V2globaltables_HowItWorks.html#V2globaltables_HowItWorks.consistency-modes) - in the Amazon DynamoDB Developer Guide - """ - - on_demand_throughput: OnDemandThroughput | None = None - """ - Updates the maximum number of read and write units for the specified - table in on-demand capacity mode. If you use this parameter, you must - specify `MaxReadRequestUnits`, `MaxWriteRequestUnits`, or both. - """ - - warm_throughput: WarmThroughput | None = None - """ - Represents the warm throughput (in read units per second and write units - per second) for updating a table. - """ - - global_table_settings_replication_mode: str | None = None - """ - Controls the settings replication mode for a global table replica. This - attribute can be defined using UpdateTable operation only on a regional - table with values: - - - `ENABLED`: Defines settings replication on a regional table to be used - as a source table for creating Multi-Account Global Table. - - - `DISABLED`: Remove settings replication on a regional table. Settings - replication needs to be defined to ENABLED again in order to create a - Multi-Account Global Table using this table. - """ - - vector_index_updates: list[VectorIndexUpdate] | None = None - """ - A list of vector indexes to be added to or removed from the table. You - can add or remove one vector index for each `UpdateTable` operation. - - To add a vector index, specify `IndexName`, `VectorAttribute`, - `Dimensions`, `DistanceFunction`, and `Projection`. To remove a vector - index, specify only the `IndexName`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_TABLE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.attribute_definitions is not None: - _serialize_attribute_definitions( - serializer, - _SCHEMA_UPDATE_TABLE_INPUT.members["AttributeDefinitions"], - self.attribute_definitions, - ) - - if self.table_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_TABLE_INPUT.members["TableName"], self.table_name - ) - - if self.billing_mode is not None: - serializer.write_string( - _SCHEMA_UPDATE_TABLE_INPUT.members["BillingMode"], self.billing_mode - ) - - if self.provisioned_throughput is not None: - serializer.write_struct( - _SCHEMA_UPDATE_TABLE_INPUT.members["ProvisionedThroughput"], - self.provisioned_throughput, - ) - - if self.global_secondary_index_updates is not None: - _serialize_global_secondary_index_update_list( - serializer, - _SCHEMA_UPDATE_TABLE_INPUT.members["GlobalSecondaryIndexUpdates"], - self.global_secondary_index_updates, - ) - - if self.stream_specification is not None: - serializer.write_struct( - _SCHEMA_UPDATE_TABLE_INPUT.members["StreamSpecification"], - self.stream_specification, - ) - - if self.sse_specification is not None: - serializer.write_struct( - _SCHEMA_UPDATE_TABLE_INPUT.members["SSESpecification"], - self.sse_specification, - ) - - if self.replica_updates is not None: - _serialize_replication_group_update_list( - serializer, - _SCHEMA_UPDATE_TABLE_INPUT.members["ReplicaUpdates"], - self.replica_updates, - ) - - if self.table_class is not None: - serializer.write_string( - _SCHEMA_UPDATE_TABLE_INPUT.members["TableClass"], self.table_class - ) - - if self.deletion_protection_enabled is not None: - serializer.write_boolean( - _SCHEMA_UPDATE_TABLE_INPUT.members["DeletionProtectionEnabled"], - self.deletion_protection_enabled, - ) - - if self.multi_region_consistency is not None: - serializer.write_string( - _SCHEMA_UPDATE_TABLE_INPUT.members["MultiRegionConsistency"], - self.multi_region_consistency, - ) - - if self.global_table_witness_updates is not None: - _serialize_global_table_witness_group_update_list( - serializer, - _SCHEMA_UPDATE_TABLE_INPUT.members["GlobalTableWitnessUpdates"], - self.global_table_witness_updates, - ) - - if self.on_demand_throughput is not None: - serializer.write_struct( - _SCHEMA_UPDATE_TABLE_INPUT.members["OnDemandThroughput"], - self.on_demand_throughput, - ) - - if self.warm_throughput is not None: - serializer.write_struct( - _SCHEMA_UPDATE_TABLE_INPUT.members["WarmThroughput"], - self.warm_throughput, - ) - - if self.global_table_settings_replication_mode is not None: - serializer.write_string( - _SCHEMA_UPDATE_TABLE_INPUT.members[ - "GlobalTableSettingsReplicationMode" - ], - self.global_table_settings_replication_mode, - ) - - if self.vector_index_updates is not None: - _serialize_vector_index_update_list( - serializer, - _SCHEMA_UPDATE_TABLE_INPUT.members["VectorIndexUpdates"], - self.vector_index_updates, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["attribute_definitions"] = ( - _deserialize_attribute_definitions( - de, - _SCHEMA_UPDATE_TABLE_INPUT.members["AttributeDefinitions"], - ) - ) - - case 1: - kwargs["table_name"] = de.read_string( - _SCHEMA_UPDATE_TABLE_INPUT.members["TableName"] - ) - - case 2: - kwargs["billing_mode"] = BillingMode( - de.read_string( - _SCHEMA_UPDATE_TABLE_INPUT.members["BillingMode"] - ) - ) - - case 3: - kwargs["provisioned_throughput"] = ( - ProvisionedThroughput.deserialize(de) - ) - - case 4: - kwargs["global_secondary_index_updates"] = ( - _deserialize_global_secondary_index_update_list( - de, - _SCHEMA_UPDATE_TABLE_INPUT.members[ - "GlobalSecondaryIndexUpdates" - ], - ) - ) - - case 5: - kwargs["stream_specification"] = StreamSpecification.deserialize(de) - - case 6: - kwargs["sse_specification"] = SSESpecification.deserialize(de) - - case 7: - kwargs["replica_updates"] = ( - _deserialize_replication_group_update_list( - de, _SCHEMA_UPDATE_TABLE_INPUT.members["ReplicaUpdates"] - ) - ) - - case 8: - kwargs["table_class"] = TableClass( - de.read_string(_SCHEMA_UPDATE_TABLE_INPUT.members["TableClass"]) - ) - - case 9: - kwargs["deletion_protection_enabled"] = de.read_boolean( - _SCHEMA_UPDATE_TABLE_INPUT.members["DeletionProtectionEnabled"] - ) - - case 10: - kwargs["multi_region_consistency"] = MultiRegionConsistency( - de.read_string( - _SCHEMA_UPDATE_TABLE_INPUT.members["MultiRegionConsistency"] - ) - ) - - case 11: - kwargs["global_table_witness_updates"] = ( - _deserialize_global_table_witness_group_update_list( - de, - _SCHEMA_UPDATE_TABLE_INPUT.members[ - "GlobalTableWitnessUpdates" - ], - ) - ) - - case 12: - kwargs["on_demand_throughput"] = OnDemandThroughput.deserialize(de) - - case 13: - kwargs["warm_throughput"] = WarmThroughput.deserialize(de) - - case 14: - kwargs["global_table_settings_replication_mode"] = ( - GlobalTableSettingsReplicationMode( - de.read_string( - _SCHEMA_UPDATE_TABLE_INPUT.members[ - "GlobalTableSettingsReplicationMode" - ] - ) - ) - ) - - case 15: - kwargs["vector_index_updates"] = ( - _deserialize_vector_index_update_list( - de, _SCHEMA_UPDATE_TABLE_INPUT.members["VectorIndexUpdates"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_TABLE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateTableOutput: - """Represents the output of an `UpdateTable` operation.""" - - table_description: TableDescription | None = None - """Represents the properties of the table.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_TABLE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.table_description is not None: - serializer.write_struct( - _SCHEMA_UPDATE_TABLE_OUTPUT.members["TableDescription"], - self.table_description, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["table_description"] = TableDescription.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_TABLE_OUTPUT, consumer=_consumer) - return kwargs - - -UPDATE_TABLE = APIOperation( - input=UpdateTableInput, - output=UpdateTableOutput, - schema=_SCHEMA_UPDATE_TABLE, - input_schema=_SCHEMA_UPDATE_TABLE_INPUT, - output_schema=_SCHEMA_UPDATE_TABLE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#InvalidEndpointException" - ): InvalidEndpointException, - ShapeID( - "com.amazonaws.dynamodb#LimitExceededException" - ): LimitExceededException, - ShapeID( - "com.amazonaws.dynamodb#ResourceInUseException" - ): ResourceInUseException, - ShapeID( - "com.amazonaws.dynamodb#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_SERVER_ERROR, - _SCHEMA_INVALID_ENDPOINT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_RESOURCE_IN_USE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GlobalSecondaryIndexAutoScalingUpdate: - """ - Represents the auto scaling settings of a global secondary index for a - global table that will be modified. - """ - - index_name: str | None = None - """The name of the global secondary index.""" - - provisioned_write_capacity_auto_scaling_update: AutoScalingSettingsUpdate | None = ( - None - ) - """ - Represents the auto scaling settings to be modified for a global table - or global secondary index. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GLOBAL_SECONDARY_INDEX_AUTO_SCALING_UPDATE, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.index_name is not None: - serializer.write_string( - _SCHEMA_GLOBAL_SECONDARY_INDEX_AUTO_SCALING_UPDATE.members["IndexName"], - self.index_name, - ) - - if self.provisioned_write_capacity_auto_scaling_update is not None: - serializer.write_struct( - _SCHEMA_GLOBAL_SECONDARY_INDEX_AUTO_SCALING_UPDATE.members[ - "ProvisionedWriteCapacityAutoScalingUpdate" - ], - self.provisioned_write_capacity_auto_scaling_update, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["index_name"] = de.read_string( - _SCHEMA_GLOBAL_SECONDARY_INDEX_AUTO_SCALING_UPDATE.members[ - "IndexName" - ] - ) - - case 1: - kwargs["provisioned_write_capacity_auto_scaling_update"] = ( - AutoScalingSettingsUpdate.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GLOBAL_SECONDARY_INDEX_AUTO_SCALING_UPDATE, consumer=_consumer - ) - return kwargs - - -def _serialize_global_secondary_index_auto_scaling_update_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[GlobalSecondaryIndexAutoScalingUpdate], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_global_secondary_index_auto_scaling_update_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GlobalSecondaryIndexAutoScalingUpdate]: - result: list[GlobalSecondaryIndexAutoScalingUpdate] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GlobalSecondaryIndexAutoScalingUpdate.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ReplicaGlobalSecondaryIndexAutoScalingUpdate: - """ - Represents the auto scaling settings of a global secondary index for a - replica that will be modified. - """ - - index_name: str | None = None - """The name of the global secondary index.""" - - provisioned_read_capacity_auto_scaling_update: AutoScalingSettingsUpdate | None = ( - None - ) - """ - Represents the auto scaling settings to be modified for a global table - or global secondary index. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX_AUTO_SCALING_UPDATE, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.index_name is not None: - serializer.write_string( - _SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX_AUTO_SCALING_UPDATE.members[ - "IndexName" - ], - self.index_name, - ) - - if self.provisioned_read_capacity_auto_scaling_update is not None: - serializer.write_struct( - _SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX_AUTO_SCALING_UPDATE.members[ - "ProvisionedReadCapacityAutoScalingUpdate" - ], - self.provisioned_read_capacity_auto_scaling_update, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["index_name"] = de.read_string( - _SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX_AUTO_SCALING_UPDATE.members[ - "IndexName" - ] - ) - - case 1: - kwargs["provisioned_read_capacity_auto_scaling_update"] = ( - AutoScalingSettingsUpdate.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_REPLICA_GLOBAL_SECONDARY_INDEX_AUTO_SCALING_UPDATE, - consumer=_consumer, - ) - return kwargs - - -def _serialize_replica_global_secondary_index_auto_scaling_update_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[ReplicaGlobalSecondaryIndexAutoScalingUpdate], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_replica_global_secondary_index_auto_scaling_update_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ReplicaGlobalSecondaryIndexAutoScalingUpdate]: - result: list[ReplicaGlobalSecondaryIndexAutoScalingUpdate] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ReplicaGlobalSecondaryIndexAutoScalingUpdate.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ReplicaAutoScalingUpdate: - """Represents the auto scaling settings of a replica that will be modified.""" - - region_name: str - """The Region where the replica exists.""" - - replica_global_secondary_index_updates: ( - list[ReplicaGlobalSecondaryIndexAutoScalingUpdate] | None - ) = None - """ - Represents the auto scaling settings of global secondary indexes that - will be modified. - """ - - replica_provisioned_read_capacity_auto_scaling_update: ( - AutoScalingSettingsUpdate | None - ) = None - """ - Represents the auto scaling settings to be modified for a global table - or global secondary index. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REPLICA_AUTO_SCALING_UPDATE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_REPLICA_AUTO_SCALING_UPDATE.members["RegionName"], self.region_name - ) - if self.replica_global_secondary_index_updates is not None: - _serialize_replica_global_secondary_index_auto_scaling_update_list( - serializer, - _SCHEMA_REPLICA_AUTO_SCALING_UPDATE.members[ - "ReplicaGlobalSecondaryIndexUpdates" - ], - self.replica_global_secondary_index_updates, - ) - - if self.replica_provisioned_read_capacity_auto_scaling_update is not None: - serializer.write_struct( - _SCHEMA_REPLICA_AUTO_SCALING_UPDATE.members[ - "ReplicaProvisionedReadCapacityAutoScalingUpdate" - ], - self.replica_provisioned_read_capacity_auto_scaling_update, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["region_name"] = de.read_string( - _SCHEMA_REPLICA_AUTO_SCALING_UPDATE.members["RegionName"] - ) - - case 1: - kwargs["replica_global_secondary_index_updates"] = ( - _deserialize_replica_global_secondary_index_auto_scaling_update_list( - de, - _SCHEMA_REPLICA_AUTO_SCALING_UPDATE.members[ - "ReplicaGlobalSecondaryIndexUpdates" - ], - ) - ) - - case 2: - kwargs["replica_provisioned_read_capacity_auto_scaling_update"] = ( - AutoScalingSettingsUpdate.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_REPLICA_AUTO_SCALING_UPDATE, consumer=_consumer - ) - if "region_name" not in kwargs: - kwargs["region_name"] = "" - return kwargs - - -def _serialize_replica_auto_scaling_update_list( - serializer: ShapeSerializer, schema: Schema, value: list[ReplicaAutoScalingUpdate] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_replica_auto_scaling_update_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ReplicaAutoScalingUpdate]: - result: list[ReplicaAutoScalingUpdate] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ReplicaAutoScalingUpdate.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class UpdateTableReplicaAutoScalingInput: - """Dataclass for UpdateTableReplicaAutoScalingInput structure.""" - - global_secondary_index_updates: ( - list[GlobalSecondaryIndexAutoScalingUpdate] | None - ) = None - """ - Represents the auto scaling settings of the global secondary indexes of - the replica to be updated. - """ - - table_name: str | None = None - """ - The name of the global table to be updated. You can also provide the - Amazon Resource Name (ARN) of the table in this parameter. - """ - - provisioned_write_capacity_auto_scaling_update: AutoScalingSettingsUpdate | None = ( - None - ) - """ - Represents the auto scaling settings to be modified for a global table - or global secondary index. - """ - - replica_updates: list[ReplicaAutoScalingUpdate] | None = None - """ - Represents the auto scaling settings of replicas of the table that will - be modified. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_TABLE_REPLICA_AUTO_SCALING_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.global_secondary_index_updates is not None: - _serialize_global_secondary_index_auto_scaling_update_list( - serializer, - _SCHEMA_UPDATE_TABLE_REPLICA_AUTO_SCALING_INPUT.members[ - "GlobalSecondaryIndexUpdates" - ], - self.global_secondary_index_updates, - ) - - if self.table_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_TABLE_REPLICA_AUTO_SCALING_INPUT.members["TableName"], - self.table_name, - ) - - if self.provisioned_write_capacity_auto_scaling_update is not None: - serializer.write_struct( - _SCHEMA_UPDATE_TABLE_REPLICA_AUTO_SCALING_INPUT.members[ - "ProvisionedWriteCapacityAutoScalingUpdate" - ], - self.provisioned_write_capacity_auto_scaling_update, - ) - - if self.replica_updates is not None: - _serialize_replica_auto_scaling_update_list( - serializer, - _SCHEMA_UPDATE_TABLE_REPLICA_AUTO_SCALING_INPUT.members[ - "ReplicaUpdates" - ], - self.replica_updates, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["global_secondary_index_updates"] = ( - _deserialize_global_secondary_index_auto_scaling_update_list( - de, - _SCHEMA_UPDATE_TABLE_REPLICA_AUTO_SCALING_INPUT.members[ - "GlobalSecondaryIndexUpdates" - ], - ) - ) - - case 1: - kwargs["table_name"] = de.read_string( - _SCHEMA_UPDATE_TABLE_REPLICA_AUTO_SCALING_INPUT.members[ - "TableName" - ] - ) - - case 2: - kwargs["provisioned_write_capacity_auto_scaling_update"] = ( - AutoScalingSettingsUpdate.deserialize(de) - ) - - case 3: - kwargs["replica_updates"] = ( - _deserialize_replica_auto_scaling_update_list( - de, - _SCHEMA_UPDATE_TABLE_REPLICA_AUTO_SCALING_INPUT.members[ - "ReplicaUpdates" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_TABLE_REPLICA_AUTO_SCALING_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateTableReplicaAutoScalingOutput: - """Dataclass for UpdateTableReplicaAutoScalingOutput structure.""" - - table_auto_scaling_description: TableAutoScalingDescription | None = None - """ - Returns information about the auto scaling settings of a table with - replicas. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_TABLE_REPLICA_AUTO_SCALING_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.table_auto_scaling_description is not None: - serializer.write_struct( - _SCHEMA_UPDATE_TABLE_REPLICA_AUTO_SCALING_OUTPUT.members[ - "TableAutoScalingDescription" - ], - self.table_auto_scaling_description, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["table_auto_scaling_description"] = ( - TableAutoScalingDescription.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_TABLE_REPLICA_AUTO_SCALING_OUTPUT, consumer=_consumer - ) - return kwargs - - -UPDATE_TABLE_REPLICA_AUTO_SCALING = APIOperation( - input=UpdateTableReplicaAutoScalingInput, - output=UpdateTableReplicaAutoScalingOutput, - schema=_SCHEMA_UPDATE_TABLE_REPLICA_AUTO_SCALING, - input_schema=_SCHEMA_UPDATE_TABLE_REPLICA_AUTO_SCALING_INPUT, - output_schema=_SCHEMA_UPDATE_TABLE_REPLICA_AUTO_SCALING_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#LimitExceededException" - ): LimitExceededException, - ShapeID( - "com.amazonaws.dynamodb#ResourceInUseException" - ): ResourceInUseException, - ShapeID( - "com.amazonaws.dynamodb#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_SERVER_ERROR, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_RESOURCE_IN_USE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class TimeToLiveSpecification: - """ - Represents the settings used to enable or disable Time to Live (TTL) for - the specified table. - """ - - enabled: bool - """ - Indicates whether TTL is to be enabled (true) or disabled (false) on the - table. - """ - - attribute_name: str - """ - The name of the TTL attribute used to store the expiration time for - items in the table. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TIME_TO_LIVE_SPECIFICATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_boolean( - _SCHEMA_TIME_TO_LIVE_SPECIFICATION.members["Enabled"], self.enabled - ) - serializer.write_string( - _SCHEMA_TIME_TO_LIVE_SPECIFICATION.members["AttributeName"], - self.attribute_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["enabled"] = de.read_boolean( - _SCHEMA_TIME_TO_LIVE_SPECIFICATION.members["Enabled"] - ) - - case 1: - kwargs["attribute_name"] = de.read_string( - _SCHEMA_TIME_TO_LIVE_SPECIFICATION.members["AttributeName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TIME_TO_LIVE_SPECIFICATION, consumer=_consumer) - if "enabled" not in kwargs: - kwargs["enabled"] = False - if "attribute_name" not in kwargs: - kwargs["attribute_name"] = "" - return kwargs - - -@dataclass(kw_only=True) -class UpdateTimeToLiveInput: - """Represents the input of an `UpdateTimeToLive` operation.""" - - table_name: str | None = None - """ - The name of the table to be configured. You can also provide the Amazon - Resource Name (ARN) of the table in this parameter. - """ - - time_to_live_specification: TimeToLiveSpecification | None = None - """ - Represents the settings used to enable or disable Time to Live for the - specified table. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_TIME_TO_LIVE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.table_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_TIME_TO_LIVE_INPUT.members["TableName"], self.table_name - ) - - if self.time_to_live_specification is not None: - serializer.write_struct( - _SCHEMA_UPDATE_TIME_TO_LIVE_INPUT.members["TimeToLiveSpecification"], - self.time_to_live_specification, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["table_name"] = de.read_string( - _SCHEMA_UPDATE_TIME_TO_LIVE_INPUT.members["TableName"] - ) - - case 1: - kwargs["time_to_live_specification"] = ( - TimeToLiveSpecification.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_TIME_TO_LIVE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateTimeToLiveOutput: - """Dataclass for UpdateTimeToLiveOutput structure.""" - - time_to_live_specification: TimeToLiveSpecification | None = None - """Represents the output of an `UpdateTimeToLive` operation.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_TIME_TO_LIVE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.time_to_live_specification is not None: - serializer.write_struct( - _SCHEMA_UPDATE_TIME_TO_LIVE_OUTPUT.members["TimeToLiveSpecification"], - self.time_to_live_specification, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["time_to_live_specification"] = ( - TimeToLiveSpecification.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_TIME_TO_LIVE_OUTPUT, consumer=_consumer) - return kwargs - - -UPDATE_TIME_TO_LIVE = APIOperation( - input=UpdateTimeToLiveInput, - output=UpdateTimeToLiveOutput, - schema=_SCHEMA_UPDATE_TIME_TO_LIVE, - input_schema=_SCHEMA_UPDATE_TIME_TO_LIVE_INPUT, - output_schema=_SCHEMA_UPDATE_TIME_TO_LIVE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#InvalidEndpointException" - ): InvalidEndpointException, - ShapeID( - "com.amazonaws.dynamodb#LimitExceededException" - ): LimitExceededException, - ShapeID( - "com.amazonaws.dynamodb#ResourceInUseException" - ): ResourceInUseException, - ShapeID( - "com.amazonaws.dynamodb#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_SERVER_ERROR, - _SCHEMA_INVALID_ENDPOINT_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_RESOURCE_IN_USE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass -class AttributeValueS: - """ - An attribute of type String. For example: - - `"S": "Hello"` - """ - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ATTRIBUTE_VALUE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_ATTRIBUTE_VALUE.members["S"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=deserializer.read_string(_SCHEMA_ATTRIBUTE_VALUE.members["S"])) - - -@dataclass -class AttributeValueN: - """ - An attribute of type Number. For example: - - `"N": "123.45"` - - Numbers are sent across the network to DynamoDB as strings, to maximize - compatibility across languages and libraries. However, DynamoDB treats - them as number type attributes for mathematical operations. - """ - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ATTRIBUTE_VALUE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_ATTRIBUTE_VALUE.members["N"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=deserializer.read_string(_SCHEMA_ATTRIBUTE_VALUE.members["N"])) - - -@dataclass -class AttributeValueB: - """ - An attribute of type Binary. For example: - - `"B": "dGhpcyB0ZXh0IGlzIGJhc2U2NC1lbmNvZGVk"` - """ - - value: bytes - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ATTRIBUTE_VALUE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_blob(_SCHEMA_ATTRIBUTE_VALUE.members["B"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=deserializer.read_blob(_SCHEMA_ATTRIBUTE_VALUE.members["B"])) - - -@dataclass -class AttributeValueSS: - """ - An attribute of type String Set. For example: - - `"SS": ["Giraffe", "Hippo" ,"Zebra"]` - """ - - value: list[str] - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ATTRIBUTE_VALUE, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_string_set_attribute_value( - serializer, _SCHEMA_ATTRIBUTE_VALUE.members["SS"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_deserialize_string_set_attribute_value( - deserializer, _SCHEMA_ATTRIBUTE_VALUE.members["SS"] - ) - ) - - -@dataclass -class AttributeValueNS: - """ - An attribute of type Number Set. For example: - - `"NS": ["42.2", "-19", "7.5", "3.14"]` - - Numbers are sent across the network to DynamoDB as strings, to maximize - compatibility across languages and libraries. However, DynamoDB treats - them as number type attributes for mathematical operations. - """ - - value: list[str] - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ATTRIBUTE_VALUE, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_number_set_attribute_value( - serializer, _SCHEMA_ATTRIBUTE_VALUE.members["NS"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_deserialize_number_set_attribute_value( - deserializer, _SCHEMA_ATTRIBUTE_VALUE.members["NS"] - ) - ) - - -@dataclass -class AttributeValueBS: - """ - An attribute of type Binary Set. For example: - - `"BS": ["U3Vubnk=", "UmFpbnk=", "U25vd3k="]` - """ - - value: list[bytes] - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ATTRIBUTE_VALUE, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_binary_set_attribute_value( - serializer, _SCHEMA_ATTRIBUTE_VALUE.members["BS"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_deserialize_binary_set_attribute_value( - deserializer, _SCHEMA_ATTRIBUTE_VALUE.members["BS"] - ) - ) - - -@dataclass -class AttributeValueM: - """ - An attribute of type Map. For example: - - `"M": {"Name": {"S": "Joe"}, "Age": {"N": "35"}}` - """ - - value: "dict[str, AttributeValue]" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ATTRIBUTE_VALUE, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_map_attribute_value( - serializer, _SCHEMA_ATTRIBUTE_VALUE.members["M"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_deserialize_map_attribute_value( - deserializer, _SCHEMA_ATTRIBUTE_VALUE.members["M"] - ) - ) - - -@dataclass -class AttributeValueL: - """ - An attribute of type List. For example: - - `"L": [ {"S": "Cookies"} , {"S": "Coffee"}, {"N": "3.14159"}]` - """ - - value: "list[AttributeValue]" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ATTRIBUTE_VALUE, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_list_attribute_value( - serializer, _SCHEMA_ATTRIBUTE_VALUE.members["L"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_deserialize_list_attribute_value( - deserializer, _SCHEMA_ATTRIBUTE_VALUE.members["L"] - ) - ) - - -@dataclass -class AttributeValueNULL: - """ - An attribute of type Null. For example: - - `"NULL": true` - """ - - value: bool - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ATTRIBUTE_VALUE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_boolean(_SCHEMA_ATTRIBUTE_VALUE.members["NULL"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_boolean(_SCHEMA_ATTRIBUTE_VALUE.members["NULL"]) - ) - - -@dataclass -class AttributeValueBOOL: - """ - An attribute of type Boolean. For example: - - `"BOOL": true` - """ - - value: bool - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ATTRIBUTE_VALUE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_boolean(_SCHEMA_ATTRIBUTE_VALUE.members["BOOL"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_boolean(_SCHEMA_ATTRIBUTE_VALUE.members["BOOL"]) - ) - - -@dataclass -class AttributeValueUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -AttributeValue = Union[ - AttributeValueS - | AttributeValueN - | AttributeValueB - | AttributeValueSS - | AttributeValueNS - | AttributeValueBS - | AttributeValueM - | AttributeValueL - | AttributeValueNULL - | AttributeValueBOOL - | AttributeValueUnknown -] -""" -Represents the data for an attribute. - -Each attribute value is described as a name-value pair. The name is the -data type, and the value is the data itself. - -For more information, see [Data -Types](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.NamingRulesDataTypes.html#HowItWorks.DataTypes) -in the *Amazon DynamoDB Developer Guide*. -""" - - -class _AttributeValueDeserializer: - _result: AttributeValue | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> AttributeValue: - self._result = None - deserializer.read_struct(_SCHEMA_ATTRIBUTE_VALUE, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(AttributeValueS.deserialize(de)) - - case 1: - self._set_result(AttributeValueN.deserialize(de)) - - case 2: - self._set_result(AttributeValueB.deserialize(de)) - - case 3: - self._set_result(AttributeValueSS.deserialize(de)) - - case 4: - self._set_result(AttributeValueNS.deserialize(de)) - - case 5: - self._set_result(AttributeValueBS.deserialize(de)) - - case 6: - self._set_result(AttributeValueM.deserialize(de)) - - case 7: - self._set_result(AttributeValueL.deserialize(de)) - - case 8: - self._set_result(AttributeValueNULL.deserialize(de)) - - case 9: - self._set_result(AttributeValueBOOL.deserialize(de)) - - case _: - self._set_result(AttributeValueUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: AttributeValue) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_list_attribute_value( - serializer: ShapeSerializer, schema: Schema, value: list[AttributeValue] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_list_attribute_value( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AttributeValue]: - result: list[AttributeValue] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_AttributeValueDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_map_attribute_value( - serializer: ShapeSerializer, schema: Schema, value: dict[str, AttributeValue] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_struct(value_schema, v)) - - -def _deserialize_map_attribute_value( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, AttributeValue]: - result: dict[str, AttributeValue] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = _AttributeValueDeserializer().deserialize(d) - - deserializer.read_map(schema, _read_value) - return result - - -def _serialize_attribute_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, AttributeValue] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_struct(value_schema, v)) - - -def _deserialize_attribute_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, AttributeValue]: - result: dict[str, AttributeValue] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = _AttributeValueDeserializer().deserialize(d) - - deserializer.read_map(schema, _read_value) - return result - - -def _serialize_attribute_value_list( - serializer: ShapeSerializer, schema: Schema, value: list[AttributeValue] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_attribute_value_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AttributeValue]: - result: list[AttributeValue] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_AttributeValueDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AttributeValueUpdate: - """ - For the `UpdateItem` operation, represents the attributes to be - modified, the action to perform on each, and the new value for each. - - Note: - You cannot use `UpdateItem` to update any primary key attributes. - Instead, you will need to delete the item, and then use `PutItem` to - create a new item with new attributes. - - Attribute values cannot be null; string and binary type attributes must - have lengths greater than zero; and set type attributes must not be - empty. Requests with empty values will be rejected with a - `ValidationException` exception. - """ - - value: "AttributeValue | None" = None - """ - Represents the data for an attribute. - - Each attribute value is described as a name-value pair. The name is the - data type, and the value is the data itself. - - For more information, see [Data - Types](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.NamingRulesDataTypes.html#HowItWorks.DataTypes) - in the *Amazon DynamoDB Developer Guide*. - """ - - action: str | None = None - """ - Specifies how to perform the update. Valid values are `PUT` (default), - `DELETE`, and `ADD`. The behavior depends on whether the specified - primary key already exists in the table. - - **If an item with the specified *Key* is found in the table:** - - - `PUT` - Adds the specified attribute to the item. If the attribute - already exists, it is replaced by the new value. - - - `DELETE` - If no value is specified, the attribute and its value are - removed from the item. The data type of the specified value must match - the existing value's data type. - - If a *set* of values is specified, then those values are subtracted - from the old set. For example, if the attribute value was the set - `[a,b,c]` and the `DELETE` action specified `[a,c]`, then the final - attribute value would be `[b]`. Specifying an empty set is an error. - - - `ADD` - If the attribute does not already exist, then the attribute - and its values are added to the item. If the attribute does exist, - then the behavior of `ADD` depends on the data type of the attribute: - - - If the existing attribute is a number, and if `Value` is also a - number, then the `Value` is mathematically added to the existing - attribute. If `Value` is a negative number, then it is subtracted - from the existing attribute. - - Note: - If you use `ADD` to increment or decrement a number value for an - item that doesn't exist before the update, DynamoDB uses 0 as the - initial value. - - In addition, if you use `ADD` to update an existing item, and intend - to increment or decrement an attribute value which does not yet - exist, DynamoDB uses `0` as the initial value. For example, suppose - that the item you want to update does not yet have an attribute - named *itemcount*, but you decide to `ADD` the number `3` to this - attribute anyway, even though it currently does not exist. DynamoDB - will create the *itemcount* attribute, set its initial value to `0`, - and finally add `3` to it. The result will be a new *itemcount* - attribute in the item, with a value of `3`. - - - If the existing data type is a set, and if the `Value` is also a - set, then the `Value` is added to the existing set. (This is a *set* - operation, not mathematical addition.) For example, if the attribute - value was the set `[1,2]`, and the `ADD` action specified `[3]`, - then the final attribute value would be `[1,2,3]`. An error occurs - if an Add action is specified for a set attribute and the attribute - type specified does not match the existing set type. - - Both sets must have the same primitive data type. For example, if - the existing data type is a set of strings, the `Value` must also be - a set of strings. The same holds true for number sets and binary - sets. - - This action is only valid for an existing attribute whose data type is - number or is a set. Do not use `ADD` for any other data types. - - **If no item with the specified *Key* is found:** - - - `PUT` - DynamoDB creates a new item with the specified primary key, - and then adds the attribute. - - - `DELETE` - Nothing happens; there is no attribute to delete. - - - `ADD` - DynamoDB creates a new item with the supplied primary key and - number (or set) for the attribute value. The only data types allowed - are number, number set, string set or binary set. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ATTRIBUTE_VALUE_UPDATE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.value is not None: - serializer.write_struct( - _SCHEMA_ATTRIBUTE_VALUE_UPDATE.members["Value"], self.value - ) - - if self.action is not None: - serializer.write_string( - _SCHEMA_ATTRIBUTE_VALUE_UPDATE.members["Action"], self.action - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["value"] = _AttributeValueDeserializer().deserialize(de) - - case 1: - kwargs["action"] = AttributeAction( - de.read_string(_SCHEMA_ATTRIBUTE_VALUE_UPDATE.members["Action"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ATTRIBUTE_VALUE_UPDATE, consumer=_consumer) - return kwargs - - -def _serialize_expression_attribute_value_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, AttributeValue] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_struct(value_schema, v)) - - -def _deserialize_expression_attribute_value_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, AttributeValue]: - result: dict[str, AttributeValue] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = _AttributeValueDeserializer().deserialize(d) - - deserializer.read_map(schema, _read_value) - return result - - -def _serialize_item_collection_key_attribute_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, AttributeValue] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_struct(value_schema, v)) - - -def _deserialize_item_collection_key_attribute_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, AttributeValue]: - result: dict[str, AttributeValue] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = _AttributeValueDeserializer().deserialize(d) - - deserializer.read_map(schema, _read_value) - return result - - -def _serialize_key( - serializer: ShapeSerializer, schema: Schema, value: dict[str, AttributeValue] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_struct(value_schema, v)) - - -def _deserialize_key( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, AttributeValue]: - result: dict[str, AttributeValue] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = _AttributeValueDeserializer().deserialize(d) - - deserializer.read_map(schema, _read_value) - return result - - -def _serialize_prepared_statement_parameters( - serializer: ShapeSerializer, schema: Schema, value: list[AttributeValue] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_prepared_statement_parameters( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AttributeValue]: - result: list[AttributeValue] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_AttributeValueDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_put_item_input_attribute_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, AttributeValue] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_struct(value_schema, v)) - - -def _deserialize_put_item_input_attribute_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, AttributeValue]: - result: dict[str, AttributeValue] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = _AttributeValueDeserializer().deserialize(d) - - deserializer.read_map(schema, _read_value) - return result - - -def _serialize_search_vector_list( - serializer: ShapeSerializer, schema: Schema, value: list[AttributeValue] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_search_vector_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AttributeValue]: - result: list[AttributeValue] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_AttributeValueDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_attribute_updates( - serializer: ShapeSerializer, schema: Schema, value: dict[str, AttributeValueUpdate] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_struct(value_schema, v)) - - -def _deserialize_attribute_updates( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, AttributeValueUpdate]: - result: dict[str, AttributeValueUpdate] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = AttributeValueUpdate.deserialize(d) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class BatchStatementError: - """An error associated with a statement in a PartiQL batch that was run.""" - - code: str | None = None - """The error code associated with the failed PartiQL batch statement.""" - - message: str | None = None - """The error message associated with the PartiQL batch response.""" - - item: "dict[str, AttributeValue] | None" = None - """ - The item which caused the condition check to fail. This will be set if - ReturnValuesOnConditionCheckFailure is specified as `ALL_OLD`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BATCH_STATEMENT_ERROR, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.code is not None: - serializer.write_string( - _SCHEMA_BATCH_STATEMENT_ERROR.members["Code"], self.code - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_BATCH_STATEMENT_ERROR.members["Message"], self.message - ) - - if self.item is not None: - _serialize_attribute_map( - serializer, _SCHEMA_BATCH_STATEMENT_ERROR.members["Item"], self.item - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["code"] = BatchStatementErrorCodeEnum( - de.read_string(_SCHEMA_BATCH_STATEMENT_ERROR.members["Code"]) - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_BATCH_STATEMENT_ERROR.members["Message"] - ) - - case 2: - kwargs["item"] = _deserialize_attribute_map( - de, _SCHEMA_BATCH_STATEMENT_ERROR.members["Item"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BATCH_STATEMENT_ERROR, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class BatchStatementRequest: - """A PartiQL batch statement request.""" - - statement: str - """A valid PartiQL statement.""" - - parameters: "list[AttributeValue] | None" = None - """The parameters associated with a PartiQL statement in the batch request.""" - - consistent_read: bool | None = None - """The read consistency of the PartiQL batch request.""" - - return_values_on_condition_check_failure: str | None = None - """ - An optional parameter that returns the item attributes for a PartiQL - batch request operation that failed a condition check. - - There is no additional cost associated with requesting a return value - aside from the small network and processing overhead of receiving a - larger response. No read capacity units are consumed. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BATCH_STATEMENT_REQUEST, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_BATCH_STATEMENT_REQUEST.members["Statement"], self.statement - ) - if self.parameters is not None: - _serialize_prepared_statement_parameters( - serializer, - _SCHEMA_BATCH_STATEMENT_REQUEST.members["Parameters"], - self.parameters, - ) - - if self.consistent_read is not None: - serializer.write_boolean( - _SCHEMA_BATCH_STATEMENT_REQUEST.members["ConsistentRead"], - self.consistent_read, - ) - - if self.return_values_on_condition_check_failure is not None: - serializer.write_string( - _SCHEMA_BATCH_STATEMENT_REQUEST.members[ - "ReturnValuesOnConditionCheckFailure" - ], - self.return_values_on_condition_check_failure, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["statement"] = de.read_string( - _SCHEMA_BATCH_STATEMENT_REQUEST.members["Statement"] - ) - - case 1: - kwargs["parameters"] = _deserialize_prepared_statement_parameters( - de, _SCHEMA_BATCH_STATEMENT_REQUEST.members["Parameters"] - ) - - case 2: - kwargs["consistent_read"] = de.read_boolean( - _SCHEMA_BATCH_STATEMENT_REQUEST.members["ConsistentRead"] - ) - - case 3: - kwargs["return_values_on_condition_check_failure"] = ( - ReturnValuesOnConditionCheckFailure( - de.read_string( - _SCHEMA_BATCH_STATEMENT_REQUEST.members[ - "ReturnValuesOnConditionCheckFailure" - ] - ) - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BATCH_STATEMENT_REQUEST, consumer=_consumer) - if "statement" not in kwargs: - kwargs["statement"] = "" - return kwargs - - -@dataclass(kw_only=True) -class CancellationReason: - """ - An ordered list of errors for each item in the request which caused the - transaction to get cancelled. The values of the list are ordered - according to the ordering of the `TransactWriteItems` request parameter. - If no error occurred for the associated item an error with a Null code - and Null message will be present. - """ - - item: "dict[str, AttributeValue] | None" = None - """Item in the request which caused the transaction to get cancelled.""" - - code: str | None = None - """Status code for the result of the cancelled transaction.""" - - message: str | None = None - """Cancellation reason message description.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CANCELLATION_REASON, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.item is not None: - _serialize_attribute_map( - serializer, _SCHEMA_CANCELLATION_REASON.members["Item"], self.item - ) - - if self.code is not None: - serializer.write_string( - _SCHEMA_CANCELLATION_REASON.members["Code"], self.code - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_CANCELLATION_REASON.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["item"] = _deserialize_attribute_map( - de, _SCHEMA_CANCELLATION_REASON.members["Item"] - ) - - case 1: - kwargs["code"] = de.read_string( - _SCHEMA_CANCELLATION_REASON.members["Code"] - ) - - case 2: - kwargs["message"] = de.read_string( - _SCHEMA_CANCELLATION_REASON.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CANCELLATION_REASON, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Condition: - """ - Represents the selection criteria for a `Query` or `Scan` operation: - - - For a `Query` operation, `Condition` is used for specifying the - `KeyConditions` to use when querying a table or an index. For - `KeyConditions`, only the following comparison operators are - supported: - - `EQ | LE | LT | GE | GT | BEGINS_WITH | BETWEEN` - - `Condition` is also used in a `QueryFilter`, which evaluates the query - results and returns only the desired values. - - - For a `Scan` operation, `Condition` is used in a `ScanFilter`, which - evaluates the scan results and returns only the desired values. - """ - - comparison_operator: str - """ - A comparator for evaluating attributes. For example, equals, greater - than, less than, etc. - - The following comparison operators are available: - - `EQ | NE | LE | LT | GE | GT | NOT_NULL | NULL | CONTAINS | NOT_CONTAINS | BEGINS_WITH | IN | BETWEEN` - - The following are descriptions of each comparison operator. - - - `EQ` : Equal. `EQ` is supported for all data types, including lists - and maps. - - `AttributeValueList` can contain only one `AttributeValue` element of - type String, Number, Binary, String Set, Number Set, or Binary Set. If - an item contains an `AttributeValue` element of a different type than - the one provided in the request, the value does not match. For - example, `{"S":"6"}` does not equal `{"N":"6"}`. Also, `{"N":"6"}` - does not equal `{"NS":["6", "2", "1"]}`. - - - `NE` : Not equal. `NE` is supported for all data types, including - lists and maps. - - `AttributeValueList` can contain only one `AttributeValue` of type - String, Number, Binary, String Set, Number Set, or Binary Set. If an - item contains an `AttributeValue` of a different type than the one - provided in the request, the value does not match. For example, - `{"S":"6"}` does not equal `{"N":"6"}`. Also, `{"N":"6"}` does not - equal `{"NS":["6", "2", "1"]}`. - - - `LE` : Less than or equal. - - `AttributeValueList` can contain only one `AttributeValue` element of - type String, Number, or Binary (not a set type). If an item contains - an `AttributeValue` element of a different type than the one provided - in the request, the value does not match. For example, `{"S":"6"}` - does not equal `{"N":"6"}`. Also, `{"N":"6"}` does not compare to - `{"NS":["6", "2", "1"]}`. - - - `LT` : Less than. - - `AttributeValueList` can contain only one `AttributeValue` of type - String, Number, or Binary (not a set type). If an item contains an - `AttributeValue` element of a different type than the one provided in - the request, the value does not match. For example, `{"S":"6"}` does - not equal `{"N":"6"}`. Also, `{"N":"6"}` does not compare to - `{"NS":["6", "2", "1"]}`. - - - `GE` : Greater than or equal. - - `AttributeValueList` can contain only one `AttributeValue` element of - type String, Number, or Binary (not a set type). If an item contains - an `AttributeValue` element of a different type than the one provided - in the request, the value does not match. For example, `{"S":"6"}` - does not equal `{"N":"6"}`. Also, `{"N":"6"}` does not compare to - `{"NS":["6", "2", "1"]}`. - - - `GT` : Greater than. - - `AttributeValueList` can contain only one `AttributeValue` element of - type String, Number, or Binary (not a set type). If an item contains - an `AttributeValue` element of a different type than the one provided - in the request, the value does not match. For example, `{"S":"6"}` - does not equal `{"N":"6"}`. Also, `{"N":"6"}` does not compare to - `{"NS":["6", "2", "1"]}`. - - - `NOT_NULL` : The attribute exists. `NOT_NULL` is supported for all - data types, including lists and maps. - - Note: - This operator tests for the existence of an attribute, not its data - type. If the data type of attribute \"`a`\" is null, and you evaluate - it using `NOT_NULL`, the result is a Boolean `true`. This result is - because the attribute \"`a`\" exists; its data type is not relevant to - the `NOT_NULL` comparison operator. - - - `NULL` : The attribute does not exist. `NULL` is supported for all - data types, including lists and maps. - - Note: - This operator tests for the nonexistence of an attribute, not its data - type. If the data type of attribute \"`a`\" is null, and you evaluate - it using `NULL`, the result is a Boolean `false`. This is because the - attribute \"`a`\" exists; its data type is not relevant to the `NULL` - comparison operator. - - - `CONTAINS` : Checks for a subsequence, or value in a set. - - `AttributeValueList` can contain only one `AttributeValue` element of - type String, Number, or Binary (not a set type). If the target - attribute of the comparison is of type String, then the operator - checks for a substring match. If the target attribute of the - comparison is of type Binary, then the operator looks for a - subsequence of the target that matches the input. If the target - attribute of the comparison is a set (\"`SS`\", \"`NS`\", or - \"`BS`\"), then the operator evaluates to true if it finds an exact - match with any member of the set. - - CONTAINS is supported for lists: When evaluating \"`a CONTAINS b`\", - \"`a`\" can be a list; however, \"`b`\" cannot be a set, a map, or a - list. - - - `NOT_CONTAINS` : Checks for absence of a subsequence, or absence of a - value in a set. - - `AttributeValueList` can contain only one `AttributeValue` element of - type String, Number, or Binary (not a set type). If the target - attribute of the comparison is a String, then the operator checks for - the absence of a substring match. If the target attribute of the - comparison is Binary, then the operator checks for the absence of a - subsequence of the target that matches the input. If the target - attribute of the comparison is a set (\"`SS`\", \"`NS`\", or - \"`BS`\"), then the operator evaluates to true if it *does not* find - an exact match with any member of the set. - - NOT_CONTAINS is supported for lists: When evaluating - \"`a NOT CONTAINS b`\", \"`a`\" can be a list; however, \"`b`\" cannot - be a set, a map, or a list. - - - `BEGINS_WITH` : Checks for a prefix. - - `AttributeValueList` can contain only one `AttributeValue` of type - String or Binary (not a Number or a set type). The target attribute of - the comparison must be of type String or Binary (not a Number or a set - type). - - - `IN` : Checks for matching elements in a list. - - `AttributeValueList` can contain one or more `AttributeValue` elements - of type String, Number, or Binary. These attributes are compared - against an existing attribute of an item. If any elements of the input - are equal to the item attribute, the expression evaluates to true. - - - `BETWEEN` : Greater than or equal to the first value, and less than or - equal to the second value. - - `AttributeValueList` must contain two `AttributeValue` elements of the - same type, either String, Number, or Binary (not a set type). A target - attribute matches if the target value is greater than, or equal to, - the first element and less than, or equal to, the second element. If - an item contains an `AttributeValue` element of a different type than - the one provided in the request, the value does not match. For - example, `{"S":"6"}` does not compare to `{"N":"6"}`. Also, - `{"N":"6"}` does not compare to `{"NS":["6", "2", "1"]}` - - For usage examples of `AttributeValueList` and `ComparisonOperator`, see - [Legacy Conditional - Parameters](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - attribute_value_list: "list[AttributeValue] | None" = None - """ - One or more values to evaluate against the supplied attribute. The - number of values in the list depends on the `ComparisonOperator` being - used. - - For type Number, value comparisons are numeric. - - String value comparisons for greater than, equals, or less than are - based on ASCII character code values. For example, `a` is greater than - `A`, and `a` is greater than `B`. For a list of code values, see - . - - For Binary, DynamoDB treats each byte of the binary data as unsigned - when it compares binary values. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONDITION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.attribute_value_list is not None: - _serialize_attribute_value_list( - serializer, - _SCHEMA_CONDITION.members["AttributeValueList"], - self.attribute_value_list, - ) - - serializer.write_string( - _SCHEMA_CONDITION.members["ComparisonOperator"], self.comparison_operator - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["attribute_value_list"] = _deserialize_attribute_value_list( - de, _SCHEMA_CONDITION.members["AttributeValueList"] - ) - - case 1: - kwargs["comparison_operator"] = ComparisonOperator( - de.read_string(_SCHEMA_CONDITION.members["ComparisonOperator"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONDITION, consumer=_consumer) - if "comparison_operator" not in kwargs: - kwargs["comparison_operator"] = ComparisonOperator._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class ConditionalCheckFailedException(ServiceError): - """A condition specified in the operation failed to be evaluated.""" - - fault: Literal["client", "server"] | None = "client" - - item: "dict[str, AttributeValue] | None" = None - """Item which caused the `ConditionalCheckFailedException`.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONDITIONAL_CHECK_FAILED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_CONDITIONAL_CHECK_FAILED_EXCEPTION.members["message"], - self.message, - ) - - if self.item is not None: - _serialize_attribute_map( - serializer, - _SCHEMA_CONDITIONAL_CHECK_FAILED_EXCEPTION.members["Item"], - self.item, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_CONDITIONAL_CHECK_FAILED_EXCEPTION.members["message"] - ) - - case 1: - kwargs["item"] = _deserialize_attribute_map( - de, _SCHEMA_CONDITIONAL_CHECK_FAILED_EXCEPTION.members["Item"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CONDITIONAL_CHECK_FAILED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteRequest: - """Represents a request to perform a `DeleteItem` operation on an item.""" - - key: "dict[str, AttributeValue]" - """ - A map of attribute name to attribute values, representing the primary - key of the item to delete. All of the table's primary key attributes - must be specified, and their data types must match those of the table's - key schema. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_REQUEST, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_key(serializer, _SCHEMA_DELETE_REQUEST.members["Key"], self.key) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["key"] = _deserialize_key( - de, _SCHEMA_DELETE_REQUEST.members["Key"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_REQUEST, consumer=_consumer) - if "key" not in kwargs: - kwargs["key"] = {} - return kwargs - - -@dataclass(kw_only=True) -class ExecuteStatementInput: - """Dataclass for ExecuteStatementInput structure.""" - - statement: str | None = None - """The PartiQL statement representing the operation to run.""" - - parameters: "list[AttributeValue] | None" = None - """The parameters for the PartiQL statement, if any.""" - - consistent_read: bool | None = None - """ - The consistency of a read operation. If set to `true`, then a strongly - consistent read is used; otherwise, an eventually consistent read is - used. - """ - - next_token: str | None = None - """ - Set this value to get remaining results, if `NextToken` was returned in - the statement response. - """ - - return_consumed_capacity: str | None = None - """ - Determines the level of detail about either provisioned or on-demand - throughput consumption that is returned in the response: - - - `INDEXES` - The response includes the aggregate `ConsumedCapacity` for - the operation, together with `ConsumedCapacity` for each table and - secondary index that was accessed. - - Note that some operations, such as `GetItem` and `BatchGetItem`, do - not access any indexes at all. In these cases, specifying `INDEXES` - will only return `ConsumedCapacity` information for table(s). - - - `TOTAL` - The response includes only the aggregate `ConsumedCapacity` - for the operation. - - - `NONE` - No `ConsumedCapacity` details are included in the response. - """ - - limit: int | None = None - """ - The maximum number of items to evaluate (not necessarily the number of - matching items). If DynamoDB processes the number of items up to the - limit while processing the results, it stops the operation and returns - the matching values up to that point, along with a key in - `LastEvaluatedKey` to apply in a subsequent operation so you can pick up - where you left off. Also, if the processed dataset size exceeds 1 MB - before DynamoDB reaches this limit, it stops the operation and returns - the matching values up to the limit, and a key in `LastEvaluatedKey` to - apply in a subsequent operation to continue the operation. - """ - - return_values_on_condition_check_failure: str | None = None - """ - An optional parameter that returns the item attributes for an - `ExecuteStatement` operation that failed a condition check. - - There is no additional cost associated with requesting a return value - aside from the small network and processing overhead of receiving a - larger response. No read capacity units are consumed. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EXECUTE_STATEMENT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.statement is not None: - serializer.write_string( - _SCHEMA_EXECUTE_STATEMENT_INPUT.members["Statement"], self.statement - ) - - if self.parameters is not None: - _serialize_prepared_statement_parameters( - serializer, - _SCHEMA_EXECUTE_STATEMENT_INPUT.members["Parameters"], - self.parameters, - ) - - if self.consistent_read is not None: - serializer.write_boolean( - _SCHEMA_EXECUTE_STATEMENT_INPUT.members["ConsistentRead"], - self.consistent_read, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_EXECUTE_STATEMENT_INPUT.members["NextToken"], self.next_token - ) - - if self.return_consumed_capacity is not None: - serializer.write_string( - _SCHEMA_EXECUTE_STATEMENT_INPUT.members["ReturnConsumedCapacity"], - self.return_consumed_capacity, - ) - - if self.limit is not None: - serializer.write_integer( - _SCHEMA_EXECUTE_STATEMENT_INPUT.members["Limit"], self.limit - ) - - if self.return_values_on_condition_check_failure is not None: - serializer.write_string( - _SCHEMA_EXECUTE_STATEMENT_INPUT.members[ - "ReturnValuesOnConditionCheckFailure" - ], - self.return_values_on_condition_check_failure, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["statement"] = de.read_string( - _SCHEMA_EXECUTE_STATEMENT_INPUT.members["Statement"] - ) - - case 1: - kwargs["parameters"] = _deserialize_prepared_statement_parameters( - de, _SCHEMA_EXECUTE_STATEMENT_INPUT.members["Parameters"] - ) - - case 2: - kwargs["consistent_read"] = de.read_boolean( - _SCHEMA_EXECUTE_STATEMENT_INPUT.members["ConsistentRead"] - ) - - case 3: - kwargs["next_token"] = de.read_string( - _SCHEMA_EXECUTE_STATEMENT_INPUT.members["NextToken"] - ) - - case 4: - kwargs["return_consumed_capacity"] = ReturnConsumedCapacity( - de.read_string( - _SCHEMA_EXECUTE_STATEMENT_INPUT.members[ - "ReturnConsumedCapacity" - ] - ) - ) - - case 5: - kwargs["limit"] = de.read_integer( - _SCHEMA_EXECUTE_STATEMENT_INPUT.members["Limit"] - ) - - case 6: - kwargs["return_values_on_condition_check_failure"] = ( - ReturnValuesOnConditionCheckFailure( - de.read_string( - _SCHEMA_EXECUTE_STATEMENT_INPUT.members[ - "ReturnValuesOnConditionCheckFailure" - ] - ) - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EXECUTE_STATEMENT_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class FilterSpecification: - """ - Contains the filter criteria used to limit which items are included in - an export. If you don't include this parameter, all items and - attributes are exported. - """ - - filter_expression: str | None = None - """ - A condition that filters which items are included in the export. This - parameter uses the same syntax as `FilterExpression` in `Query` and - `Scan`. If you don't provide `KeyConditionExpression`, this expression - can also reference key attributes. If you don't specify this parameter, - all items are included in the export. - """ - - projection_expression: str | None = None - """ - The attributes you want to retrieve for items included in the export. - Separate attribute names in the expression with commas. If you don't - specify this parameter, all attributes are returned. - """ - - key_condition_expression: str | None = None - """ - A condition expression that filters items by key values. The expression - must test equality on a single partition key value and can optionally - compare a sort key value. This parameter uses the same syntax as - `KeyConditionExpression` in `Query`. When you provide this parameter, - `FilterExpression` can only reference non-key attributes. If you don't - specify this parameter, all items are eligible for export. - """ - - expression_attribute_names: dict[str, str] | None = None - """ - One or more substitution tokens for attribute names in an expression. - For more information, see [Expression Attribute - Names](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.ExpressionAttributeNames.html) - in the Amazon DynamoDB Developer Guide. - """ - - expression_attribute_values: "dict[str, AttributeValue] | None" = None - """ - One or more values that can be substituted in an expression. For more - information, see [Expression Attribute - Values](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.ExpressionAttributeValues.html) - in the Amazon DynamoDB Developer Guide. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FILTER_SPECIFICATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.filter_expression is not None: - serializer.write_string( - _SCHEMA_FILTER_SPECIFICATION.members["FilterExpression"], - self.filter_expression, - ) - - if self.projection_expression is not None: - serializer.write_string( - _SCHEMA_FILTER_SPECIFICATION.members["ProjectionExpression"], - self.projection_expression, - ) - - if self.key_condition_expression is not None: - serializer.write_string( - _SCHEMA_FILTER_SPECIFICATION.members["KeyConditionExpression"], - self.key_condition_expression, - ) - - if self.expression_attribute_names is not None: - _serialize_expression_attribute_name_map( - serializer, - _SCHEMA_FILTER_SPECIFICATION.members["ExpressionAttributeNames"], - self.expression_attribute_names, - ) - - if self.expression_attribute_values is not None: - _serialize_expression_attribute_value_map( - serializer, - _SCHEMA_FILTER_SPECIFICATION.members["ExpressionAttributeValues"], - self.expression_attribute_values, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["filter_expression"] = de.read_string( - _SCHEMA_FILTER_SPECIFICATION.members["FilterExpression"] - ) - - case 1: - kwargs["projection_expression"] = de.read_string( - _SCHEMA_FILTER_SPECIFICATION.members["ProjectionExpression"] - ) - - case 2: - kwargs["key_condition_expression"] = de.read_string( - _SCHEMA_FILTER_SPECIFICATION.members["KeyConditionExpression"] - ) - - case 3: - kwargs["expression_attribute_names"] = ( - _deserialize_expression_attribute_name_map( - de, - _SCHEMA_FILTER_SPECIFICATION.members[ - "ExpressionAttributeNames" - ], - ) - ) - - case 4: - kwargs["expression_attribute_values"] = ( - _deserialize_expression_attribute_value_map( - de, - _SCHEMA_FILTER_SPECIFICATION.members[ - "ExpressionAttributeValues" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FILTER_SPECIFICATION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Get: - """ - Specifies an item and related attribute values to retrieve in a - `TransactGetItem` object. - """ - - key: "dict[str, AttributeValue]" - """ - A map of attribute names to `AttributeValue` objects that specifies the - primary key of the item to retrieve. - """ - - table_name: str - """ - The name of the table from which to retrieve the specified item. You can - also provide the Amazon Resource Name (ARN) of the table in this - parameter. - """ - - projection_expression: str | None = None - """ - A string that identifies one or more attributes of the specified item to - retrieve from the table. The attributes in the expression must be - separated by commas. If no attribute names are specified, then all - attributes of the specified item are returned. If any of the requested - attributes are not found, they do not appear in the result. - """ - - expression_attribute_names: dict[str, str] | None = None - """ - One or more substitution tokens for attribute names in the - ProjectionExpression parameter. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_key(serializer, _SCHEMA_GET.members["Key"], self.key) - serializer.write_string(_SCHEMA_GET.members["TableName"], self.table_name) - if self.projection_expression is not None: - serializer.write_string( - _SCHEMA_GET.members["ProjectionExpression"], self.projection_expression - ) - - if self.expression_attribute_names is not None: - _serialize_expression_attribute_name_map( - serializer, - _SCHEMA_GET.members["ExpressionAttributeNames"], - self.expression_attribute_names, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["key"] = _deserialize_key(de, _SCHEMA_GET.members["Key"]) - - case 1: - kwargs["table_name"] = de.read_string( - _SCHEMA_GET.members["TableName"] - ) - - case 2: - kwargs["projection_expression"] = de.read_string( - _SCHEMA_GET.members["ProjectionExpression"] - ) - - case 3: - kwargs["expression_attribute_names"] = ( - _deserialize_expression_attribute_name_map( - de, _SCHEMA_GET.members["ExpressionAttributeNames"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET, consumer=_consumer) - if "key" not in kwargs: - kwargs["key"] = {} - if "table_name" not in kwargs: - kwargs["table_name"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(key={}, table_name="") - - -@dataclass(kw_only=True) -class GetItemInput: - """Represents the input of a `GetItem` operation.""" - - table_name: str | None = None - """ - The name of the table containing the requested item. You can also - provide the Amazon Resource Name (ARN) of the table in this parameter. - """ - - key: "dict[str, AttributeValue] | None" = None - """ - A map of attribute names to `AttributeValue` objects, representing the - primary key of the item to retrieve. - - For the primary key, you must provide all of the attributes. For - example, with a simple primary key, you only need to provide a value for - the partition key. For a composite primary key, you must provide values - for both the partition key and the sort key. - """ - - attributes_to_get: list[str] | None = None - """ - This is a legacy parameter. Use `ProjectionExpression` instead. For more - information, see - [AttributesToGet](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.AttributesToGet.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - consistent_read: bool | None = None - """ - Determines the read consistency model: If set to `true`, then the - operation uses strongly consistent reads; otherwise, the operation uses - eventually consistent reads. - """ - - return_consumed_capacity: str | None = None - """ - Determines the level of detail about either provisioned or on-demand - throughput consumption that is returned in the response: - - - `INDEXES` - The response includes the aggregate `ConsumedCapacity` for - the operation, together with `ConsumedCapacity` for each table and - secondary index that was accessed. - - Note that some operations, such as `GetItem` and `BatchGetItem`, do - not access any indexes at all. In these cases, specifying `INDEXES` - will only return `ConsumedCapacity` information for table(s). - - - `TOTAL` - The response includes only the aggregate `ConsumedCapacity` - for the operation. - - - `NONE` - No `ConsumedCapacity` details are included in the response. - """ - - projection_expression: str | None = None - """ - A string that identifies one or more attributes to retrieve from the - table. These attributes can include scalars, sets, or elements of a JSON - document. The attributes in the expression must be separated by commas. - - If no attribute names are specified, then all attributes are returned. - If any of the requested attributes are not found, they do not appear in - the result. - - For more information, see [Specifying Item - Attributes](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - expression_attribute_names: dict[str, str] | None = None - """ - One or more substitution tokens for attribute names in an expression. - The following are some use cases for using `ExpressionAttributeNames`: - - - To access an attribute whose name conflicts with a DynamoDB reserved - word. - - - To create a placeholder for repeating occurrences of an attribute name - in an expression. - - - To prevent special characters in an attribute name from being - misinterpreted in an expression. - - Use the **#** character in an expression to dereference an attribute - name. For example, consider the following attribute name: - - - `Percentile` - - The name of this attribute conflicts with a reserved word, so it cannot - be used directly in an expression. (For the complete list of reserved - words, see [Reserved - Words](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html) - in the *Amazon DynamoDB Developer Guide*). To work around this, you - could specify the following for `ExpressionAttributeNames`: - - - `{"#P":"Percentile"}` - - You could then use this substitution in an expression, as in this - example: - - - `#P = :val` - - Note: - Tokens that begin with the **:** character are *expression attribute - values*, which are placeholders for the actual value at runtime. - - For more information on expression attribute names, see [Specifying Item - Attributes](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_ITEM_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.table_name is not None: - serializer.write_string( - _SCHEMA_GET_ITEM_INPUT.members["TableName"], self.table_name - ) - - if self.key is not None: - _serialize_key(serializer, _SCHEMA_GET_ITEM_INPUT.members["Key"], self.key) - - if self.attributes_to_get is not None: - _serialize_attribute_name_list( - serializer, - _SCHEMA_GET_ITEM_INPUT.members["AttributesToGet"], - self.attributes_to_get, - ) - - if self.consistent_read is not None: - serializer.write_boolean( - _SCHEMA_GET_ITEM_INPUT.members["ConsistentRead"], self.consistent_read - ) - - if self.return_consumed_capacity is not None: - serializer.write_string( - _SCHEMA_GET_ITEM_INPUT.members["ReturnConsumedCapacity"], - self.return_consumed_capacity, - ) - - if self.projection_expression is not None: - serializer.write_string( - _SCHEMA_GET_ITEM_INPUT.members["ProjectionExpression"], - self.projection_expression, - ) - - if self.expression_attribute_names is not None: - _serialize_expression_attribute_name_map( - serializer, - _SCHEMA_GET_ITEM_INPUT.members["ExpressionAttributeNames"], - self.expression_attribute_names, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["table_name"] = de.read_string( - _SCHEMA_GET_ITEM_INPUT.members["TableName"] - ) - - case 1: - kwargs["key"] = _deserialize_key( - de, _SCHEMA_GET_ITEM_INPUT.members["Key"] - ) - - case 2: - kwargs["attributes_to_get"] = _deserialize_attribute_name_list( - de, _SCHEMA_GET_ITEM_INPUT.members["AttributesToGet"] - ) - - case 3: - kwargs["consistent_read"] = de.read_boolean( - _SCHEMA_GET_ITEM_INPUT.members["ConsistentRead"] - ) - - case 4: - kwargs["return_consumed_capacity"] = ReturnConsumedCapacity( - de.read_string( - _SCHEMA_GET_ITEM_INPUT.members["ReturnConsumedCapacity"] - ) - ) - - case 5: - kwargs["projection_expression"] = de.read_string( - _SCHEMA_GET_ITEM_INPUT.members["ProjectionExpression"] - ) - - case 6: - kwargs["expression_attribute_names"] = ( - _deserialize_expression_attribute_name_map( - de, - _SCHEMA_GET_ITEM_INPUT.members["ExpressionAttributeNames"], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_ITEM_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetItemOutput: - """Represents the output of a `GetItem` operation.""" - - item: "dict[str, AttributeValue] | None" = None - """ - A map of attribute names to `AttributeValue` objects, as specified by - `ProjectionExpression`. - """ - - consumed_capacity: ConsumedCapacity | None = None - """ - The capacity units consumed by the `GetItem` operation. The data - returned includes the total provisioned throughput consumed, along with - statistics for the table and any indexes involved in the operation. - `ConsumedCapacity` is only returned if the `ReturnConsumedCapacity` - parameter was specified. For more information, see [Capacity unit - consumption for read - operations](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/read-write-operations.html#read-operation-consumption) - in the *Amazon DynamoDB Developer Guide*. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_ITEM_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.item is not None: - _serialize_attribute_map( - serializer, _SCHEMA_GET_ITEM_OUTPUT.members["Item"], self.item - ) - - if self.consumed_capacity is not None: - serializer.write_struct( - _SCHEMA_GET_ITEM_OUTPUT.members["ConsumedCapacity"], - self.consumed_capacity, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["item"] = _deserialize_attribute_map( - de, _SCHEMA_GET_ITEM_OUTPUT.members["Item"] - ) - - case 1: - kwargs["consumed_capacity"] = ConsumedCapacity.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_ITEM_OUTPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ItemCollectionMetrics: - """ - Information about item collections, if any, that were affected by the - operation. `ItemCollectionMetrics` is only returned if the request asked - for it. If the table does not have any local secondary indexes, this - information is not returned in the response. - """ - - item_collection_key: "dict[str, AttributeValue] | None" = None - """ - The partition key value of the item collection. This value is the same - as the partition key value of the item. - """ - - size_estimate_range_gb: list[float] | None = None - """ - An estimate of item collection size, in gigabytes. This value is a - two-element array containing a lower bound and an upper bound for the - estimate. The estimate includes the size of all the items in the table, - plus the size of all attributes projected into all of the local - secondary indexes on that table. Use this estimate to measure whether a - local secondary index is approaching its size limit. - - The estimate is subject to change over time; therefore, do not rely on - the precision or accuracy of the estimate. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ITEM_COLLECTION_METRICS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.item_collection_key is not None: - _serialize_item_collection_key_attribute_map( - serializer, - _SCHEMA_ITEM_COLLECTION_METRICS.members["ItemCollectionKey"], - self.item_collection_key, - ) - - if self.size_estimate_range_gb is not None: - _serialize_item_collection_size_estimate_range( - serializer, - _SCHEMA_ITEM_COLLECTION_METRICS.members["SizeEstimateRangeGB"], - self.size_estimate_range_gb, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["item_collection_key"] = ( - _deserialize_item_collection_key_attribute_map( - de, - _SCHEMA_ITEM_COLLECTION_METRICS.members[ - "ItemCollectionKey" - ], - ) - ) - - case 1: - kwargs["size_estimate_range_gb"] = ( - _deserialize_item_collection_size_estimate_range( - de, - _SCHEMA_ITEM_COLLECTION_METRICS.members[ - "SizeEstimateRangeGB" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ITEM_COLLECTION_METRICS, consumer=_consumer) - return kwargs - - -def _serialize_item_list( - serializer: ShapeSerializer, schema: Schema, value: list[dict[str, AttributeValue]] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - _serialize_attribute_map(ls, member_schema, e) - - -def _deserialize_item_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[dict[str, AttributeValue]]: - result: list[dict[str, AttributeValue]] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_deserialize_attribute_map(d, member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ItemResponse: - """Details for the requested item.""" - - item: "dict[str, AttributeValue] | None" = None - """Map of attribute data consisting of the data type and attribute value.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ITEM_RESPONSE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.item is not None: - _serialize_attribute_map( - serializer, _SCHEMA_ITEM_RESPONSE.members["Item"], self.item - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["item"] = _deserialize_attribute_map( - de, _SCHEMA_ITEM_RESPONSE.members["Item"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ITEM_RESPONSE, consumer=_consumer) - return kwargs - - -def _serialize_key_list( - serializer: ShapeSerializer, schema: Schema, value: list[dict[str, AttributeValue]] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - _serialize_key(ls, member_schema, e) - - -def _deserialize_key_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[dict[str, AttributeValue]]: - result: list[dict[str, AttributeValue]] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_deserialize_key(d, member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ParameterizedStatement: - """Represents a PartiQL statement that uses parameters.""" - - statement: str - """A PartiQL statement that uses parameters.""" - - parameters: "list[AttributeValue] | None" = None - """The parameter values.""" - - return_values_on_condition_check_failure: str | None = None - """ - An optional parameter that returns the item attributes for a PartiQL - `ParameterizedStatement` operation that failed a condition check. - - There is no additional cost associated with requesting a return value - aside from the small network and processing overhead of receiving a - larger response. No read capacity units are consumed. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PARAMETERIZED_STATEMENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_PARAMETERIZED_STATEMENT.members["Statement"], self.statement - ) - if self.parameters is not None: - _serialize_prepared_statement_parameters( - serializer, - _SCHEMA_PARAMETERIZED_STATEMENT.members["Parameters"], - self.parameters, - ) - - if self.return_values_on_condition_check_failure is not None: - serializer.write_string( - _SCHEMA_PARAMETERIZED_STATEMENT.members[ - "ReturnValuesOnConditionCheckFailure" - ], - self.return_values_on_condition_check_failure, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["statement"] = de.read_string( - _SCHEMA_PARAMETERIZED_STATEMENT.members["Statement"] - ) - - case 1: - kwargs["parameters"] = _deserialize_prepared_statement_parameters( - de, _SCHEMA_PARAMETERIZED_STATEMENT.members["Parameters"] - ) - - case 2: - kwargs["return_values_on_condition_check_failure"] = ( - ReturnValuesOnConditionCheckFailure( - de.read_string( - _SCHEMA_PARAMETERIZED_STATEMENT.members[ - "ReturnValuesOnConditionCheckFailure" - ] - ) - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PARAMETERIZED_STATEMENT, consumer=_consumer) - if "statement" not in kwargs: - kwargs["statement"] = "" - return kwargs - - -@dataclass(kw_only=True) -class PutRequest: - """Represents a request to perform a `PutItem` operation on an item.""" - - item: "dict[str, AttributeValue]" - """ - A map of attribute name to attribute values, representing the primary - key of an item to be processed by `PutItem`. All of the table's primary - key attributes must be specified, and their data types must match those - of the table's key schema. If any attributes are present in the item - that are part of an index key schema for the table, their types must - match the index key schema. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_REQUEST, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_put_item_input_attribute_map( - serializer, _SCHEMA_PUT_REQUEST.members["Item"], self.item - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["item"] = _deserialize_put_item_input_attribute_map( - de, _SCHEMA_PUT_REQUEST.members["Item"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUT_REQUEST, consumer=_consumer) - if "item" not in kwargs: - kwargs["item"] = {} - return kwargs - - -@dataclass(kw_only=True) -class SearchResultItem: - """A single result from a `SearchVectors` operation.""" - - item: "dict[str, AttributeValue] | None" = None - """ - A map of attribute names to `AttributeValue` objects, representing the - projected attributes of the item returned by the vector search. - """ - - score: float = 0 - """ - The similarity score for this item relative to the search vector. The - interpretation depends on the distance function configured for the - vector index. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SEARCH_RESULT_ITEM, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.item is not None: - _serialize_attribute_map( - serializer, _SCHEMA_SEARCH_RESULT_ITEM.members["Item"], self.item - ) - - serializer.write_double(_SCHEMA_SEARCH_RESULT_ITEM.members["Score"], self.score) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["item"] = _deserialize_attribute_map( - de, _SCHEMA_SEARCH_RESULT_ITEM.members["Item"] - ) - - case 1: - kwargs["score"] = de.read_double( - _SCHEMA_SEARCH_RESULT_ITEM.members["Score"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SEARCH_RESULT_ITEM, consumer=_consumer) - return kwargs - - -def _serialize_batch_get_response_map( - serializer: ShapeSerializer, - schema: Schema, - value: dict[str, list[dict[str, AttributeValue]]], -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: _serialize_item_list(vs, value_schema, v)) - - -def _deserialize_batch_get_response_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, list[dict[str, AttributeValue]]]: - result: dict[str, list[dict[str, AttributeValue]]] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = _deserialize_item_list(d, value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -def _serialize_cancellation_reason_list( - serializer: ShapeSerializer, schema: Schema, value: list[CancellationReason] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_cancellation_reason_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[CancellationReason]: - result: list[CancellationReason] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(CancellationReason.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ExportDescription: - """Represents the properties of the exported table.""" - - export_arn: str | None = None - """The Amazon Resource Name (ARN) of the table export.""" - - export_status: str | None = None - """ - Export can be in one of the following states: IN_PROGRESS, COMPLETED, or - FAILED. - """ - - start_time: datetime | None = None - """The time at which the export task began.""" - - end_time: datetime | None = None - """The time at which the export task completed.""" - - export_manifest: str | None = None - """The name of the manifest file for the export task.""" - - table_arn: str | None = None - """The Amazon Resource Name (ARN) of the table that was exported.""" - - table_id: str | None = None - """Unique ID of the table that was exported.""" - - export_time: datetime | None = None - """Point in time from which table data was exported.""" - - client_token: str | None = None - """ - The client token that was provided for the export task. A client token - makes calls to `ExportTableToPointInTimeInput` idempotent, meaning that - multiple identical calls have the same effect as one single call. - """ - - s3_bucket: str | None = None - """The name of the Amazon S3 bucket containing the export.""" - - s3_bucket_owner: str | None = None - """ - The ID of the Amazon Web Services account that owns the bucket - containing the export. - """ - - s3_prefix: str | None = None - """ - The Amazon S3 bucket prefix used as the file name and path of the - exported snapshot. - """ - - s3_sse_algorithm: str | None = None - """ - Type of encryption used on the bucket where export data is stored. Valid - values for `S3SseAlgorithm` are: - - - `AES256` - server-side encryption with Amazon S3 managed keys - - - `KMS` - server-side encryption with KMS managed keys - """ - - s3_sse_kms_key_id: str | None = None - """ - The ID of the KMS managed key used to encrypt the S3 bucket where export - data is stored (if applicable). - """ - - failure_code: str | None = None - """Status code for the result of the failed export.""" - - failure_message: str | None = None - """Export failure reason description.""" - - export_format: str | None = None - """ - The format of the exported data. Valid values for `ExportFormat` are - `DYNAMODB_JSON` or `ION`. - """ - - billed_size_bytes: int | None = None - """The billable size of the table export.""" - - item_count: int | None = None - """The number of items exported.""" - - export_type: str | None = None - """ - The type of export that was performed. Valid values are `FULL_EXPORT` or - `INCREMENTAL_EXPORT`. - """ - - incremental_export_specification: IncrementalExportSpecification | None = None - """ - Optional object containing the parameters specific to an incremental - export. - """ - - filter_specification: "FilterSpecification | None" = None - """ - The filter criteria applied to the export. When present, only items that - match the specified key conditions and filter expressions are included - in the export output. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EXPORT_DESCRIPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.export_arn is not None: - serializer.write_string( - _SCHEMA_EXPORT_DESCRIPTION.members["ExportArn"], self.export_arn - ) - - if self.export_status is not None: - serializer.write_string( - _SCHEMA_EXPORT_DESCRIPTION.members["ExportStatus"], self.export_status - ) - - if self.start_time is not None: - serializer.write_timestamp( - _SCHEMA_EXPORT_DESCRIPTION.members["StartTime"], self.start_time - ) - - if self.end_time is not None: - serializer.write_timestamp( - _SCHEMA_EXPORT_DESCRIPTION.members["EndTime"], self.end_time - ) - - if self.export_manifest is not None: - serializer.write_string( - _SCHEMA_EXPORT_DESCRIPTION.members["ExportManifest"], - self.export_manifest, - ) - - if self.table_arn is not None: - serializer.write_string( - _SCHEMA_EXPORT_DESCRIPTION.members["TableArn"], self.table_arn - ) - - if self.table_id is not None: - serializer.write_string( - _SCHEMA_EXPORT_DESCRIPTION.members["TableId"], self.table_id - ) - - if self.export_time is not None: - serializer.write_timestamp( - _SCHEMA_EXPORT_DESCRIPTION.members["ExportTime"], self.export_time - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_EXPORT_DESCRIPTION.members["ClientToken"], self.client_token - ) - - if self.s3_bucket is not None: - serializer.write_string( - _SCHEMA_EXPORT_DESCRIPTION.members["S3Bucket"], self.s3_bucket - ) - - if self.s3_bucket_owner is not None: - serializer.write_string( - _SCHEMA_EXPORT_DESCRIPTION.members["S3BucketOwner"], - self.s3_bucket_owner, - ) - - if self.s3_prefix is not None: - serializer.write_string( - _SCHEMA_EXPORT_DESCRIPTION.members["S3Prefix"], self.s3_prefix - ) - - if self.s3_sse_algorithm is not None: - serializer.write_string( - _SCHEMA_EXPORT_DESCRIPTION.members["S3SseAlgorithm"], - self.s3_sse_algorithm, - ) - - if self.s3_sse_kms_key_id is not None: - serializer.write_string( - _SCHEMA_EXPORT_DESCRIPTION.members["S3SseKmsKeyId"], - self.s3_sse_kms_key_id, - ) - - if self.failure_code is not None: - serializer.write_string( - _SCHEMA_EXPORT_DESCRIPTION.members["FailureCode"], self.failure_code - ) - - if self.failure_message is not None: - serializer.write_string( - _SCHEMA_EXPORT_DESCRIPTION.members["FailureMessage"], - self.failure_message, - ) - - if self.export_format is not None: - serializer.write_string( - _SCHEMA_EXPORT_DESCRIPTION.members["ExportFormat"], self.export_format - ) - - if self.billed_size_bytes is not None: - serializer.write_long( - _SCHEMA_EXPORT_DESCRIPTION.members["BilledSizeBytes"], - self.billed_size_bytes, - ) - - if self.item_count is not None: - serializer.write_long( - _SCHEMA_EXPORT_DESCRIPTION.members["ItemCount"], self.item_count - ) - - if self.export_type is not None: - serializer.write_string( - _SCHEMA_EXPORT_DESCRIPTION.members["ExportType"], self.export_type - ) - - if self.incremental_export_specification is not None: - serializer.write_struct( - _SCHEMA_EXPORT_DESCRIPTION.members["IncrementalExportSpecification"], - self.incremental_export_specification, - ) - - if self.filter_specification is not None: - serializer.write_struct( - _SCHEMA_EXPORT_DESCRIPTION.members["FilterSpecification"], - self.filter_specification, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["export_arn"] = de.read_string( - _SCHEMA_EXPORT_DESCRIPTION.members["ExportArn"] - ) - - case 1: - kwargs["export_status"] = ExportStatus( - de.read_string( - _SCHEMA_EXPORT_DESCRIPTION.members["ExportStatus"] - ) - ) - - case 2: - kwargs["start_time"] = de.read_timestamp( - _SCHEMA_EXPORT_DESCRIPTION.members["StartTime"] - ) - - case 3: - kwargs["end_time"] = de.read_timestamp( - _SCHEMA_EXPORT_DESCRIPTION.members["EndTime"] - ) - - case 4: - kwargs["export_manifest"] = de.read_string( - _SCHEMA_EXPORT_DESCRIPTION.members["ExportManifest"] - ) - - case 5: - kwargs["table_arn"] = de.read_string( - _SCHEMA_EXPORT_DESCRIPTION.members["TableArn"] - ) - - case 6: - kwargs["table_id"] = de.read_string( - _SCHEMA_EXPORT_DESCRIPTION.members["TableId"] - ) - - case 7: - kwargs["export_time"] = de.read_timestamp( - _SCHEMA_EXPORT_DESCRIPTION.members["ExportTime"] - ) - - case 8: - kwargs["client_token"] = de.read_string( - _SCHEMA_EXPORT_DESCRIPTION.members["ClientToken"] - ) - - case 9: - kwargs["s3_bucket"] = de.read_string( - _SCHEMA_EXPORT_DESCRIPTION.members["S3Bucket"] - ) - - case 10: - kwargs["s3_bucket_owner"] = de.read_string( - _SCHEMA_EXPORT_DESCRIPTION.members["S3BucketOwner"] - ) - - case 11: - kwargs["s3_prefix"] = de.read_string( - _SCHEMA_EXPORT_DESCRIPTION.members["S3Prefix"] - ) - - case 12: - kwargs["s3_sse_algorithm"] = S3SseAlgorithm( - de.read_string( - _SCHEMA_EXPORT_DESCRIPTION.members["S3SseAlgorithm"] - ) - ) - - case 13: - kwargs["s3_sse_kms_key_id"] = de.read_string( - _SCHEMA_EXPORT_DESCRIPTION.members["S3SseKmsKeyId"] - ) - - case 14: - kwargs["failure_code"] = de.read_string( - _SCHEMA_EXPORT_DESCRIPTION.members["FailureCode"] - ) - - case 15: - kwargs["failure_message"] = de.read_string( - _SCHEMA_EXPORT_DESCRIPTION.members["FailureMessage"] - ) - - case 16: - kwargs["export_format"] = ExportFormat( - de.read_string( - _SCHEMA_EXPORT_DESCRIPTION.members["ExportFormat"] - ) - ) - - case 17: - kwargs["billed_size_bytes"] = de.read_long( - _SCHEMA_EXPORT_DESCRIPTION.members["BilledSizeBytes"] - ) - - case 18: - kwargs["item_count"] = de.read_long( - _SCHEMA_EXPORT_DESCRIPTION.members["ItemCount"] - ) - - case 19: - kwargs["export_type"] = ExportType( - de.read_string(_SCHEMA_EXPORT_DESCRIPTION.members["ExportType"]) - ) - - case 20: - kwargs["incremental_export_specification"] = ( - IncrementalExportSpecification.deserialize(de) - ) - - case 21: - kwargs["filter_specification"] = FilterSpecification.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EXPORT_DESCRIPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ExportTableToPointInTimeInput: - """Dataclass for ExportTableToPointInTimeInput structure.""" - - table_arn: str | None = None - """The Amazon Resource Name (ARN) associated with the table to export.""" - - export_time: datetime | None = None - """ - Time in the past from which to export table data, counted in seconds - from the start of the Unix epoch. The table export will be a snapshot of - the table's state at this point in time. - """ - - client_token: str | None = None - """ - Providing a `ClientToken` makes the call to - `ExportTableToPointInTimeInput` idempotent, meaning that multiple - identical calls have the same effect as one single call. - - A client token is valid for 8 hours after the first request that uses it - is completed. After 8 hours, any request with the same client token is - treated as a new request. Do not resubmit the same request with the same - client token for more than 8 hours, or the result might not be - idempotent. - - If you submit a request with the same client token but a change in other - parameters within the 8-hour idempotency window, DynamoDB returns an - `ExportConflictException`. - """ - - s3_bucket: str | None = None - """The name of the Amazon S3 bucket to export the snapshot to.""" - - s3_bucket_owner: str | None = None - """ - The ID of the Amazon Web Services account that owns the bucket the - export will be stored in. - - Note: - S3BucketOwner is a required parameter when exporting to a S3 bucket in - another account. - """ - - s3_prefix: str | None = None - """ - The Amazon S3 bucket prefix to use as the file name and path of the - exported snapshot. - """ - - s3_sse_algorithm: str | None = None - """ - Type of encryption used on the bucket where export data will be stored. - Valid values for `S3SseAlgorithm` are: - - - `AES256` - server-side encryption with Amazon S3 managed keys - - - `KMS` - server-side encryption with KMS managed keys - """ - - s3_sse_kms_key_id: str | None = None - """ - The ID of the KMS managed key used to encrypt the S3 bucket where export - data will be stored (if applicable). - """ - - export_format: str | None = None - """ - The format for the exported data. Valid values for `ExportFormat` are - `DYNAMODB_JSON` or `ION`. - """ - - export_type: str | None = None - """ - Choice of whether to execute as a full export or incremental export. - Valid values are FULL_EXPORT or INCREMENTAL_EXPORT. The default value is - FULL_EXPORT. If INCREMENTAL_EXPORT is provided, the - IncrementalExportSpecification must also be used. - """ - - incremental_export_specification: IncrementalExportSpecification | None = None - """ - Optional object containing the parameters specific to an incremental - export. - """ - - filter_specification: "FilterSpecification | None" = None - """ - The criteria used to filter which items are included in the - point-in-time export. When you specify this parameter, only items that - match the key conditions and filter expressions are exported. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EXPORT_TABLE_TO_POINT_IN_TIME_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.table_arn is not None: - serializer.write_string( - _SCHEMA_EXPORT_TABLE_TO_POINT_IN_TIME_INPUT.members["TableArn"], - self.table_arn, - ) - - if self.export_time is not None: - serializer.write_timestamp( - _SCHEMA_EXPORT_TABLE_TO_POINT_IN_TIME_INPUT.members["ExportTime"], - self.export_time, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_EXPORT_TABLE_TO_POINT_IN_TIME_INPUT.members["ClientToken"], - self.client_token, - ) - - if self.s3_bucket is not None: - serializer.write_string( - _SCHEMA_EXPORT_TABLE_TO_POINT_IN_TIME_INPUT.members["S3Bucket"], - self.s3_bucket, - ) - - if self.s3_bucket_owner is not None: - serializer.write_string( - _SCHEMA_EXPORT_TABLE_TO_POINT_IN_TIME_INPUT.members["S3BucketOwner"], - self.s3_bucket_owner, - ) - - if self.s3_prefix is not None: - serializer.write_string( - _SCHEMA_EXPORT_TABLE_TO_POINT_IN_TIME_INPUT.members["S3Prefix"], - self.s3_prefix, - ) - - if self.s3_sse_algorithm is not None: - serializer.write_string( - _SCHEMA_EXPORT_TABLE_TO_POINT_IN_TIME_INPUT.members["S3SseAlgorithm"], - self.s3_sse_algorithm, - ) - - if self.s3_sse_kms_key_id is not None: - serializer.write_string( - _SCHEMA_EXPORT_TABLE_TO_POINT_IN_TIME_INPUT.members["S3SseKmsKeyId"], - self.s3_sse_kms_key_id, - ) - - if self.export_format is not None: - serializer.write_string( - _SCHEMA_EXPORT_TABLE_TO_POINT_IN_TIME_INPUT.members["ExportFormat"], - self.export_format, - ) - - if self.export_type is not None: - serializer.write_string( - _SCHEMA_EXPORT_TABLE_TO_POINT_IN_TIME_INPUT.members["ExportType"], - self.export_type, - ) - - if self.incremental_export_specification is not None: - serializer.write_struct( - _SCHEMA_EXPORT_TABLE_TO_POINT_IN_TIME_INPUT.members[ - "IncrementalExportSpecification" - ], - self.incremental_export_specification, - ) - - if self.filter_specification is not None: - serializer.write_struct( - _SCHEMA_EXPORT_TABLE_TO_POINT_IN_TIME_INPUT.members[ - "FilterSpecification" - ], - self.filter_specification, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["table_arn"] = de.read_string( - _SCHEMA_EXPORT_TABLE_TO_POINT_IN_TIME_INPUT.members["TableArn"] - ) - - case 1: - kwargs["export_time"] = de.read_timestamp( - _SCHEMA_EXPORT_TABLE_TO_POINT_IN_TIME_INPUT.members[ - "ExportTime" - ] - ) - - case 2: - kwargs["client_token"] = de.read_string( - _SCHEMA_EXPORT_TABLE_TO_POINT_IN_TIME_INPUT.members[ - "ClientToken" - ] - ) - - case 3: - kwargs["s3_bucket"] = de.read_string( - _SCHEMA_EXPORT_TABLE_TO_POINT_IN_TIME_INPUT.members["S3Bucket"] - ) - - case 4: - kwargs["s3_bucket_owner"] = de.read_string( - _SCHEMA_EXPORT_TABLE_TO_POINT_IN_TIME_INPUT.members[ - "S3BucketOwner" - ] - ) - - case 5: - kwargs["s3_prefix"] = de.read_string( - _SCHEMA_EXPORT_TABLE_TO_POINT_IN_TIME_INPUT.members["S3Prefix"] - ) - - case 6: - kwargs["s3_sse_algorithm"] = S3SseAlgorithm( - de.read_string( - _SCHEMA_EXPORT_TABLE_TO_POINT_IN_TIME_INPUT.members[ - "S3SseAlgorithm" - ] - ) - ) - - case 7: - kwargs["s3_sse_kms_key_id"] = de.read_string( - _SCHEMA_EXPORT_TABLE_TO_POINT_IN_TIME_INPUT.members[ - "S3SseKmsKeyId" - ] - ) - - case 8: - kwargs["export_format"] = ExportFormat( - de.read_string( - _SCHEMA_EXPORT_TABLE_TO_POINT_IN_TIME_INPUT.members[ - "ExportFormat" - ] - ) - ) - - case 9: - kwargs["export_type"] = ExportType( - de.read_string( - _SCHEMA_EXPORT_TABLE_TO_POINT_IN_TIME_INPUT.members[ - "ExportType" - ] - ) - ) - - case 10: - kwargs["incremental_export_specification"] = ( - IncrementalExportSpecification.deserialize(de) - ) - - case 11: - kwargs["filter_specification"] = FilterSpecification.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EXPORT_TABLE_TO_POINT_IN_TIME_INPUT, consumer=_consumer - ) - return kwargs - - -def _serialize_filter_condition_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, Condition] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_struct(value_schema, v)) - - -def _deserialize_filter_condition_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, Condition]: - result: dict[str, Condition] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = Condition.deserialize(d) - - deserializer.read_map(schema, _read_value) - return result - - -def _serialize_item_collection_metrics_multiple( - serializer: ShapeSerializer, schema: Schema, value: list[ItemCollectionMetrics] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_item_collection_metrics_multiple( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ItemCollectionMetrics]: - result: list[ItemCollectionMetrics] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ItemCollectionMetrics.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_item_response_list( - serializer: ShapeSerializer, schema: Schema, value: list[ItemResponse] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_item_response_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ItemResponse]: - result: list[ItemResponse] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ItemResponse.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_key_conditions( - serializer: ShapeSerializer, schema: Schema, value: dict[str, Condition] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_struct(value_schema, v)) - - -def _deserialize_key_conditions( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, Condition]: - result: dict[str, Condition] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = Condition.deserialize(d) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class KeysAndAttributes: - """ - Represents a set of primary keys and, for each key, the attributes to - retrieve from the table. - - For each primary key, you must provide *all* of the key attributes. For - example, with a simple primary key, you only need to provide the - partition key. For a composite primary key, you must provide *both* the - partition key and the sort key. - """ - - keys: "list[dict[str, AttributeValue]]" - """ - The primary key attribute values that define the items and the - attributes associated with the items. - """ - - attributes_to_get: list[str] | None = None - """ - This is a legacy parameter. Use `ProjectionExpression` instead. For more - information, see [Legacy Conditional - Parameters](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - consistent_read: bool | None = None - """ - The consistency of a read operation. If set to `true`, then a strongly - consistent read is used; otherwise, an eventually consistent read is - used. - """ - - projection_expression: str | None = None - """ - A string that identifies one or more attributes to retrieve from the - table. These attributes can include scalars, sets, or elements of a JSON - document. The attributes in the `ProjectionExpression` must be separated - by commas. - - If no attribute names are specified, then all attributes will be - returned. If any of the requested attributes are not found, they will - not appear in the result. - - For more information, see [Accessing Item - Attributes](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - expression_attribute_names: dict[str, str] | None = None - """ - One or more substitution tokens for attribute names in an expression. - The following are some use cases for using `ExpressionAttributeNames`: - - - To access an attribute whose name conflicts with a DynamoDB reserved - word. - - - To create a placeholder for repeating occurrences of an attribute name - in an expression. - - - To prevent special characters in an attribute name from being - misinterpreted in an expression. - - Use the **#** character in an expression to dereference an attribute - name. For example, consider the following attribute name: - - - `Percentile` - - The name of this attribute conflicts with a reserved word, so it cannot - be used directly in an expression. (For the complete list of reserved - words, see [Reserved - Words](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html) - in the *Amazon DynamoDB Developer Guide*). To work around this, you - could specify the following for `ExpressionAttributeNames`: - - - `{"#P":"Percentile"}` - - You could then use this substitution in an expression, as in this - example: - - - `#P = :val` - - Note: - Tokens that begin with the **:** character are *expression attribute - values*, which are placeholders for the actual value at runtime. - - For more information on expression attribute names, see [Accessing Item - Attributes](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KEYS_AND_ATTRIBUTES, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_key_list( - serializer, _SCHEMA_KEYS_AND_ATTRIBUTES.members["Keys"], self.keys - ) - if self.attributes_to_get is not None: - _serialize_attribute_name_list( - serializer, - _SCHEMA_KEYS_AND_ATTRIBUTES.members["AttributesToGet"], - self.attributes_to_get, - ) - - if self.consistent_read is not None: - serializer.write_boolean( - _SCHEMA_KEYS_AND_ATTRIBUTES.members["ConsistentRead"], - self.consistent_read, - ) - - if self.projection_expression is not None: - serializer.write_string( - _SCHEMA_KEYS_AND_ATTRIBUTES.members["ProjectionExpression"], - self.projection_expression, - ) - - if self.expression_attribute_names is not None: - _serialize_expression_attribute_name_map( - serializer, - _SCHEMA_KEYS_AND_ATTRIBUTES.members["ExpressionAttributeNames"], - self.expression_attribute_names, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["keys"] = _deserialize_key_list( - de, _SCHEMA_KEYS_AND_ATTRIBUTES.members["Keys"] - ) - - case 1: - kwargs["attributes_to_get"] = _deserialize_attribute_name_list( - de, _SCHEMA_KEYS_AND_ATTRIBUTES.members["AttributesToGet"] - ) - - case 2: - kwargs["consistent_read"] = de.read_boolean( - _SCHEMA_KEYS_AND_ATTRIBUTES.members["ConsistentRead"] - ) - - case 3: - kwargs["projection_expression"] = de.read_string( - _SCHEMA_KEYS_AND_ATTRIBUTES.members["ProjectionExpression"] - ) - - case 4: - kwargs["expression_attribute_names"] = ( - _deserialize_expression_attribute_name_map( - de, - _SCHEMA_KEYS_AND_ATTRIBUTES.members[ - "ExpressionAttributeNames" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_KEYS_AND_ATTRIBUTES, consumer=_consumer) - if "keys" not in kwargs: - kwargs["keys"] = [] - return kwargs - - -def _serialize_parameterized_statements( - serializer: ShapeSerializer, schema: Schema, value: list[ParameterizedStatement] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_parameterized_statements( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ParameterizedStatement]: - result: list[ParameterizedStatement] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ParameterizedStatement.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_parti_ql_batch_request( - serializer: ShapeSerializer, schema: Schema, value: list[BatchStatementRequest] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_parti_ql_batch_request( - deserializer: ShapeDeserializer, schema: Schema -) -> list[BatchStatementRequest]: - result: list[BatchStatementRequest] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(BatchStatementRequest.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_search_result_list( - serializer: ShapeSerializer, schema: Schema, value: list[SearchResultItem] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_search_result_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[SearchResultItem]: - result: list[SearchResultItem] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(SearchResultItem.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class TransactGetItem: - """Specifies an item to be retrieved as part of the transaction.""" - - get: "Get" - """ - Contains the primary key that identifies the item to get, together with - the name of the table that contains the item, and optionally the - specific attributes of the item to retrieve. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRANSACT_GET_ITEM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRANSACT_GET_ITEM.members["Get"], self.get) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["get"] = Get.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TRANSACT_GET_ITEM, consumer=_consumer) - if "get" not in kwargs: - kwargs["get"] = Get._smithy_default() - return kwargs - - -@dataclass(kw_only=True) -class BatchExecuteStatementInput: - """Dataclass for BatchExecuteStatementInput structure.""" - - statements: "list[BatchStatementRequest] | None" = None - """The list of PartiQL statements representing the batch to run.""" - - return_consumed_capacity: str | None = None - """ - Determines the level of detail about either provisioned or on-demand - throughput consumption that is returned in the response: - - - `INDEXES` - The response includes the aggregate `ConsumedCapacity` for - the operation, together with `ConsumedCapacity` for each table and - secondary index that was accessed. - - Note that some operations, such as `GetItem` and `BatchGetItem`, do - not access any indexes at all. In these cases, specifying `INDEXES` - will only return `ConsumedCapacity` information for table(s). - - - `TOTAL` - The response includes only the aggregate `ConsumedCapacity` - for the operation. - - - `NONE` - No `ConsumedCapacity` details are included in the response. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BATCH_EXECUTE_STATEMENT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.statements is not None: - _serialize_parti_ql_batch_request( - serializer, - _SCHEMA_BATCH_EXECUTE_STATEMENT_INPUT.members["Statements"], - self.statements, - ) - - if self.return_consumed_capacity is not None: - serializer.write_string( - _SCHEMA_BATCH_EXECUTE_STATEMENT_INPUT.members["ReturnConsumedCapacity"], - self.return_consumed_capacity, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["statements"] = _deserialize_parti_ql_batch_request( - de, _SCHEMA_BATCH_EXECUTE_STATEMENT_INPUT.members["Statements"] - ) - - case 1: - kwargs["return_consumed_capacity"] = ReturnConsumedCapacity( - de.read_string( - _SCHEMA_BATCH_EXECUTE_STATEMENT_INPUT.members[ - "ReturnConsumedCapacity" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_BATCH_EXECUTE_STATEMENT_INPUT, consumer=_consumer - ) - return kwargs - - -def _serialize_batch_get_request_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, KeysAndAttributes] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_struct(value_schema, v)) - - -def _deserialize_batch_get_request_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, KeysAndAttributes]: - result: dict[str, KeysAndAttributes] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = KeysAndAttributes.deserialize(d) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class DescribeExportOutput: - """Dataclass for DescribeExportOutput structure.""" - - export_description: "ExportDescription | None" = None - """Represents the properties of the export.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DESCRIBE_EXPORT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.export_description is not None: - serializer.write_struct( - _SCHEMA_DESCRIBE_EXPORT_OUTPUT.members["ExportDescription"], - self.export_description, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["export_description"] = ExportDescription.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DESCRIBE_EXPORT_OUTPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ExecuteTransactionInput: - """Dataclass for ExecuteTransactionInput structure.""" - - transact_statements: "list[ParameterizedStatement] | None" = None - """The list of PartiQL statements representing the transaction to run.""" - - client_request_token: str | None = None - """ - Set this value to get remaining results, if `NextToken` was returned in - the statement response. - """ - - return_consumed_capacity: str | None = None - """ - Determines the level of detail about either provisioned or on-demand - throughput consumption that is returned in the response. For more - information, see - [TransactGetItems](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_TransactGetItems.html) - and - [TransactWriteItems](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_TransactWriteItems.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EXECUTE_TRANSACTION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.transact_statements is not None: - _serialize_parameterized_statements( - serializer, - _SCHEMA_EXECUTE_TRANSACTION_INPUT.members["TransactStatements"], - self.transact_statements, - ) - - if self.client_request_token is not None: - serializer.write_string( - _SCHEMA_EXECUTE_TRANSACTION_INPUT.members["ClientRequestToken"], - self.client_request_token, - ) - - if self.return_consumed_capacity is not None: - serializer.write_string( - _SCHEMA_EXECUTE_TRANSACTION_INPUT.members["ReturnConsumedCapacity"], - self.return_consumed_capacity, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["transact_statements"] = ( - _deserialize_parameterized_statements( - de, - _SCHEMA_EXECUTE_TRANSACTION_INPUT.members[ - "TransactStatements" - ], - ) - ) - - case 1: - kwargs["client_request_token"] = de.read_string( - _SCHEMA_EXECUTE_TRANSACTION_INPUT.members["ClientRequestToken"] - ) - - case 2: - kwargs["return_consumed_capacity"] = ReturnConsumedCapacity( - de.read_string( - _SCHEMA_EXECUTE_TRANSACTION_INPUT.members[ - "ReturnConsumedCapacity" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EXECUTE_TRANSACTION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ExecuteTransactionOutput: - """Dataclass for ExecuteTransactionOutput structure.""" - - responses: "list[ItemResponse] | None" = None - """The response to a PartiQL transaction.""" - - consumed_capacity: list[ConsumedCapacity] | None = None - """ - The capacity units consumed by the entire operation. The values of the - list are ordered according to the ordering of the statements. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EXECUTE_TRANSACTION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.responses is not None: - _serialize_item_response_list( - serializer, - _SCHEMA_EXECUTE_TRANSACTION_OUTPUT.members["Responses"], - self.responses, - ) - - if self.consumed_capacity is not None: - _serialize_consumed_capacity_multiple( - serializer, - _SCHEMA_EXECUTE_TRANSACTION_OUTPUT.members["ConsumedCapacity"], - self.consumed_capacity, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["responses"] = _deserialize_item_response_list( - de, _SCHEMA_EXECUTE_TRANSACTION_OUTPUT.members["Responses"] - ) - - case 1: - kwargs["consumed_capacity"] = ( - _deserialize_consumed_capacity_multiple( - de, - _SCHEMA_EXECUTE_TRANSACTION_OUTPUT.members[ - "ConsumedCapacity" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EXECUTE_TRANSACTION_OUTPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ExportTableToPointInTimeOutput: - """Dataclass for ExportTableToPointInTimeOutput structure.""" - - export_description: "ExportDescription | None" = None - """Contains a description of the table export.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EXPORT_TABLE_TO_POINT_IN_TIME_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.export_description is not None: - serializer.write_struct( - _SCHEMA_EXPORT_TABLE_TO_POINT_IN_TIME_OUTPUT.members[ - "ExportDescription" - ], - self.export_description, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["export_description"] = ExportDescription.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EXPORT_TABLE_TO_POINT_IN_TIME_OUTPUT, consumer=_consumer - ) - return kwargs - - -def _serialize_item_collection_metrics_per_table( - serializer: ShapeSerializer, - schema: Schema, - value: dict[str, list[ItemCollectionMetrics]], -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry( - k, - lambda vs: _serialize_item_collection_metrics_multiple( - vs, value_schema, v - ), - ) - - -def _deserialize_item_collection_metrics_per_table( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, list[ItemCollectionMetrics]]: - result: dict[str, list[ItemCollectionMetrics]] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = _deserialize_item_collection_metrics_multiple(d, value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class SearchVectorsOutput: - """Dataclass for SearchVectorsOutput structure.""" - - consumed_capacity: VectorCapacity | None = None - """ - The capacity units consumed by the `SearchVectors` operation. Contains - `VectorSearchRequestBytes`, which represents the vector search capacity - consumed. - """ - - search_results: "list[SearchResultItem] | None" = None - """ - A list of items returned by the vector similarity search, sorted by - similarity with the most similar item first. Each item contains the - projected attributes and a similarity score. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SEARCH_VECTORS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.consumed_capacity is not None: - serializer.write_struct( - _SCHEMA_SEARCH_VECTORS_OUTPUT.members["ConsumedCapacity"], - self.consumed_capacity, - ) - - if self.search_results is not None: - _serialize_search_result_list( - serializer, - _SCHEMA_SEARCH_VECTORS_OUTPUT.members["SearchResults"], - self.search_results, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["consumed_capacity"] = VectorCapacity.deserialize(de) - - case 1: - kwargs["search_results"] = _deserialize_search_result_list( - de, _SCHEMA_SEARCH_VECTORS_OUTPUT.members["SearchResults"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SEARCH_VECTORS_OUTPUT, consumer=_consumer) - return kwargs - - -def _serialize_transact_get_item_list( - serializer: ShapeSerializer, schema: Schema, value: list[TransactGetItem] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_transact_get_item_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[TransactGetItem]: - result: list[TransactGetItem] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(TransactGetItem.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class TransactGetItemsOutput: - """Dataclass for TransactGetItemsOutput structure.""" - - consumed_capacity: list[ConsumedCapacity] | None = None - """ - If the *ReturnConsumedCapacity* value was `TOTAL`, this is an array of - `ConsumedCapacity` objects, one for each table addressed by - `TransactGetItem` objects in the *TransactItems* parameter. These - `ConsumedCapacity` objects report the read-capacity units consumed by - the `TransactGetItems` call in that table. - """ - - responses: "list[ItemResponse] | None" = None - """ - An ordered array of up to 100 `ItemResponse` objects, each of which - corresponds to the `TransactGetItem` object in the same position in the - *TransactItems* array. Each `ItemResponse` object contains a Map of the - name-value pairs that are the projected attributes of the requested - item. - - If a requested item could not be retrieved, the corresponding - `ItemResponse` object is Null, or if the requested item has no projected - attributes, the corresponding `ItemResponse` object is an empty Map. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRANSACT_GET_ITEMS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.consumed_capacity is not None: - _serialize_consumed_capacity_multiple( - serializer, - _SCHEMA_TRANSACT_GET_ITEMS_OUTPUT.members["ConsumedCapacity"], - self.consumed_capacity, - ) - - if self.responses is not None: - _serialize_item_response_list( - serializer, - _SCHEMA_TRANSACT_GET_ITEMS_OUTPUT.members["Responses"], - self.responses, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["consumed_capacity"] = ( - _deserialize_consumed_capacity_multiple( - de, - _SCHEMA_TRANSACT_GET_ITEMS_OUTPUT.members[ - "ConsumedCapacity" - ], - ) - ) - - case 1: - kwargs["responses"] = _deserialize_item_response_list( - de, _SCHEMA_TRANSACT_GET_ITEMS_OUTPUT.members["Responses"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TRANSACT_GET_ITEMS_OUTPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class TransactionCanceledException(ServiceError): - """ - The entire transaction request was canceled. - - DynamoDB cancels a `TransactWriteItems` request under the following - circumstances: - - - A condition in one of the condition expressions is not met. - - - A table in the `TransactWriteItems` request is in a different account - or region. - - - More than one action in the `TransactWriteItems` operation targets the - same item. - - - There is insufficient provisioned capacity for the transaction to be - completed. - - - An item size becomes too large (larger than 400 KB), or a local - secondary index (LSI) becomes too large, or a similar validation error - occurs because of changes made by the transaction. - - - There is a user error, such as an invalid data format. - - - There is an ongoing `TransactWriteItems` operation that conflicts with - a concurrent `TransactWriteItems` request. In this case the - `TransactWriteItems` operation fails with a - `TransactionCanceledException`. - - DynamoDB cancels a `TransactGetItems` request under the following - circumstances: - - - There is an ongoing `TransactGetItems` operation that conflicts with a - concurrent `PutItem`, `UpdateItem`, `DeleteItem` or - `TransactWriteItems` request. In this case the `TransactGetItems` - operation fails with a `TransactionCanceledException`. - - - A table in the `TransactGetItems` request is in a different account or - region. - - - There is insufficient provisioned capacity for the transaction to be - completed. - - - There is a user error, such as an invalid data format. - - Note: - DynamoDB lists the cancellation reasons on the `CancellationReasons` - property. Transaction cancellation reasons are ordered in the order of - requested items, if an item has no error it will have `None` code and - `Null` message. The `None` code is returned as the literal string - `"None"`, not a null or absent value; the message field is omitted - entirely for an item that has no error. This is important to note when - using an SDK that surfaces the code as an optional or nullable type. - - Cancellation reason codes and possible error messages: - - - No Errors: - - - Code: `None` - - - Message: `null` - - - Conditional Check Failed: - - - Code: `ConditionalCheckFailed` - - - Message: The conditional request failed. - - - Item Collection Size Limit Exceeded: - - - Code: `ItemCollectionSizeLimitExceeded` - - - Message: Collection size exceeded. - - - Transaction Conflict: - - - Code: `TransactionConflict` - - - Message: Transaction is ongoing for the item. - - - Provisioned Throughput Exceeded: - - - Code: `ProvisionedThroughputExceeded` - - - Messages: - - - The level of configured provisioned throughput for the table was - exceeded. Consider increasing your provisioning level with the - UpdateTable API. - - Note: - This Message is received when provisioned throughput is exceeded - is on a provisioned DynamoDB table. - - - The level of configured provisioned throughput for one or more - global secondary indexes of the table was exceeded. Consider - increasing your provisioning level for the under-provisioned - global secondary indexes with the UpdateTable API. - - Note: - This message is returned when provisioned throughput is exceeded - is on a provisioned GSI. - - - Throttling Error: - - - Code: `ThrottlingError` - - - Messages: - - - Throughput exceeds the current capacity of your table or index. - DynamoDB is automatically scaling your table or index so please - try again shortly. If exceptions persist, check if you have a hot - key: - https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/bp-partition-key-design.html. - - Note: - This message is returned when writes get throttled on an On-Demand - table as DynamoDB is automatically scaling the table. - - - Throughput exceeds the current capacity for one or more global - secondary indexes. DynamoDB is automatically scaling your index so - please try again shortly. - - Note: - This message is returned when writes get throttled on an On-Demand - GSI as DynamoDB is automatically scaling the GSI. - - - Validation Error: - - - Code: `ValidationError` - - - Messages: - - - One or more parameter values were invalid. - - - The update expression attempted to update the secondary index key - beyond allowed size limits. - - - The update expression attempted to update the secondary index key - to unsupported type. - - - An operand in the update expression has an incorrect data type. - - - Item size to update has exceeded the maximum allowed size. - - - Number overflow. Attempting to store a number with magnitude - larger than supported range. - - - Type mismatch for attribute to update. - - - Nesting Levels have exceeded supported limits. - - - The document path provided in the update expression is invalid for - update. - - - The provided expression refers to an attribute that does not exist - in the item. - """ - - fault: Literal["client", "server"] | None = "client" - - cancellation_reasons: "list[CancellationReason] | None" = None - """A list of cancellation reasons.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRANSACTION_CANCELED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_TRANSACTION_CANCELED_EXCEPTION.members["Message"], self.message - ) - - if self.cancellation_reasons is not None: - _serialize_cancellation_reason_list( - serializer, - _SCHEMA_TRANSACTION_CANCELED_EXCEPTION.members["CancellationReasons"], - self.cancellation_reasons, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_TRANSACTION_CANCELED_EXCEPTION.members["Message"] - ) - - case 1: - kwargs["cancellation_reasons"] = ( - _deserialize_cancellation_reason_list( - de, - _SCHEMA_TRANSACTION_CANCELED_EXCEPTION.members[ - "CancellationReasons" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_TRANSACTION_CANCELED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -DESCRIBE_EXPORT = APIOperation( - input=DescribeExportInput, - output=DescribeExportOutput, - schema=_SCHEMA_DESCRIBE_EXPORT, - input_schema=_SCHEMA_DESCRIBE_EXPORT_INPUT, - output_schema=_SCHEMA_DESCRIBE_EXPORT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.dynamodb#ExportNotFoundException" - ): ExportNotFoundException, - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#LimitExceededException" - ): LimitExceededException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_EXPORT_NOT_FOUND_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class BatchGetItemInput: - """Represents the input of a `BatchGetItem` operation.""" - - request_items: "dict[str, KeysAndAttributes] | None" = None - """ - A map of one or more table names or table ARNs and, for each table, a - map that describes one or more items to retrieve from that table. Each - table name or ARN can be used only once per `BatchGetItem` request. - - Each element in the map of items to retrieve consists of the following: - - - `ConsistentRead` - If `true`, a strongly consistent read is used; if - `false` (the default), an eventually consistent read is used. - - - `ExpressionAttributeNames` - One or more substitution tokens for - attribute names in the `ProjectionExpression` parameter. The following - are some use cases for using `ExpressionAttributeNames`: - - - To access an attribute whose name conflicts with a DynamoDB reserved - word. - - - To create a placeholder for repeating occurrences of an attribute - name in an expression. - - - To prevent special characters in an attribute name from being - misinterpreted in an expression. - - Use the **#** character in an expression to dereference an attribute - name. For example, consider the following attribute name: - - - `Percentile` - - The name of this attribute conflicts with a reserved word, so it - cannot be used directly in an expression. (For the complete list of - reserved words, see [Reserved - Words](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html) - in the *Amazon DynamoDB Developer Guide*). To work around this, you - could specify the following for `ExpressionAttributeNames`: - - - `{"#P":"Percentile"}` - - You could then use this substitution in an expression, as in this - example: - - - `#P = :val` - - Note: - Tokens that begin with the **:** character are *expression attribute - values*, which are placeholders for the actual value at runtime. - - For more information about expression attribute names, see [Accessing - Item - Attributes](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) - in the *Amazon DynamoDB Developer Guide*. - - - `Keys` - An array of primary key attribute values that define specific - items in the table. For each primary key, you must provide *all* of - the key attributes. For example, with a simple primary key, you only - need to provide the partition key value. For a composite key, you must - provide *both* the partition key value and the sort key value. - - - `ProjectionExpression` - A string that identifies one or more - attributes to retrieve from the table. These attributes can include - scalars, sets, or elements of a JSON document. The attributes in the - expression must be separated by commas. - - If no attribute names are specified, then all attributes are returned. - If any of the requested attributes are not found, they do not appear - in the result. - - For more information, see [Accessing Item - Attributes](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) - in the *Amazon DynamoDB Developer Guide*. - - - `AttributesToGet` - This is a legacy parameter. Use - `ProjectionExpression` instead. For more information, see - [AttributesToGet](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.AttributesToGet.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - return_consumed_capacity: str | None = None - """ - Determines the level of detail about either provisioned or on-demand - throughput consumption that is returned in the response: - - - `INDEXES` - The response includes the aggregate `ConsumedCapacity` for - the operation, together with `ConsumedCapacity` for each table and - secondary index that was accessed. - - Note that some operations, such as `GetItem` and `BatchGetItem`, do - not access any indexes at all. In these cases, specifying `INDEXES` - will only return `ConsumedCapacity` information for table(s). - - - `TOTAL` - The response includes only the aggregate `ConsumedCapacity` - for the operation. - - - `NONE` - No `ConsumedCapacity` details are included in the response. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BATCH_GET_ITEM_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.request_items is not None: - _serialize_batch_get_request_map( - serializer, - _SCHEMA_BATCH_GET_ITEM_INPUT.members["RequestItems"], - self.request_items, - ) - - if self.return_consumed_capacity is not None: - serializer.write_string( - _SCHEMA_BATCH_GET_ITEM_INPUT.members["ReturnConsumedCapacity"], - self.return_consumed_capacity, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["request_items"] = _deserialize_batch_get_request_map( - de, _SCHEMA_BATCH_GET_ITEM_INPUT.members["RequestItems"] - ) - - case 1: - kwargs["return_consumed_capacity"] = ReturnConsumedCapacity( - de.read_string( - _SCHEMA_BATCH_GET_ITEM_INPUT.members[ - "ReturnConsumedCapacity" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BATCH_GET_ITEM_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ExpectedAttributeValue: - """ - Represents a condition to be compared with an attribute value. This - condition can be used with `DeleteItem`, `PutItem`, or `UpdateItem` - operations; if the comparison evaluates to true, the operation succeeds; - if not, the operation fails. You can use `ExpectedAttributeValue` in one - of two different ways: - - - Use `AttributeValueList` to specify one or more values to compare - against an attribute. Use `ComparisonOperator` to specify how you want - to perform the comparison. If the comparison evaluates to true, then - the conditional operation succeeds. - - - Use `Value` to specify a value that DynamoDB will compare against an - attribute. If the values match, then `ExpectedAttributeValue` - evaluates to true and the conditional operation succeeds. Optionally, - you can also set `Exists` to false, indicating that you *do not* - expect to find the attribute value in the table. In this case, the - conditional operation succeeds only if the comparison evaluates to - false. - - `Value` and `Exists` are incompatible with `AttributeValueList` and - `ComparisonOperator`. Note that if you use both sets of parameters at - once, DynamoDB will return a `ValidationException` exception. - """ - - value: "AttributeValue | None" = None - """ - Represents the data for the expected attribute. - - Each attribute value is described as a name-value pair. The name is the - data type, and the value is the data itself. - - For more information, see [Data - Types](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.NamingRulesDataTypes.html#HowItWorks.DataTypes) - in the *Amazon DynamoDB Developer Guide*. - """ - - exists: bool | None = None - """ - Causes DynamoDB to evaluate the value before attempting a conditional - operation: - - - If `Exists` is `true`, DynamoDB will check to see if that attribute - value already exists in the table. If it is found, then the operation - succeeds. If it is not found, the operation fails with a - `ConditionCheckFailedException`. - - - If `Exists` is `false`, DynamoDB assumes that the attribute value does - not exist in the table. If in fact the value does not exist, then the - assumption is valid and the operation succeeds. If the value is found, - despite the assumption that it does not exist, the operation fails - with a `ConditionCheckFailedException`. - - The default setting for `Exists` is `true`. If you supply a `Value` all - by itself, DynamoDB assumes the attribute exists: You don't have to set - `Exists` to `true`, because it is implied. - - DynamoDB returns a `ValidationException` if: - - - `Exists` is `true` but there is no `Value` to check. (You expect a - value to exist, but don't specify what that value is.) - - - `Exists` is `false` but you also provide a `Value`. (You cannot expect - an attribute to have a value, while also expecting it not to exist.) - """ - - comparison_operator: str | None = None - """ - A comparator for evaluating attributes in the `AttributeValueList`. For - example, equals, greater than, less than, etc. - - The following comparison operators are available: - - `EQ | NE | LE | LT | GE | GT | NOT_NULL | NULL | CONTAINS | NOT_CONTAINS | BEGINS_WITH | IN | BETWEEN` - - The following are descriptions of each comparison operator. - - - `EQ` : Equal. `EQ` is supported for all data types, including lists - and maps. - - `AttributeValueList` can contain only one `AttributeValue` element of - type String, Number, Binary, String Set, Number Set, or Binary Set. If - an item contains an `AttributeValue` element of a different type than - the one provided in the request, the value does not match. For - example, `{"S":"6"}` does not equal `{"N":"6"}`. Also, `{"N":"6"}` - does not equal `{"NS":["6", "2", "1"]}`. - - - `NE` : Not equal. `NE` is supported for all data types, including - lists and maps. - - `AttributeValueList` can contain only one `AttributeValue` of type - String, Number, Binary, String Set, Number Set, or Binary Set. If an - item contains an `AttributeValue` of a different type than the one - provided in the request, the value does not match. For example, - `{"S":"6"}` does not equal `{"N":"6"}`. Also, `{"N":"6"}` does not - equal `{"NS":["6", "2", "1"]}`. - - - `LE` : Less than or equal. - - `AttributeValueList` can contain only one `AttributeValue` element of - type String, Number, or Binary (not a set type). If an item contains - an `AttributeValue` element of a different type than the one provided - in the request, the value does not match. For example, `{"S":"6"}` - does not equal `{"N":"6"}`. Also, `{"N":"6"}` does not compare to - `{"NS":["6", "2", "1"]}`. - - - `LT` : Less than. - - `AttributeValueList` can contain only one `AttributeValue` of type - String, Number, or Binary (not a set type). If an item contains an - `AttributeValue` element of a different type than the one provided in - the request, the value does not match. For example, `{"S":"6"}` does - not equal `{"N":"6"}`. Also, `{"N":"6"}` does not compare to - `{"NS":["6", "2", "1"]}`. - - - `GE` : Greater than or equal. - - `AttributeValueList` can contain only one `AttributeValue` element of - type String, Number, or Binary (not a set type). If an item contains - an `AttributeValue` element of a different type than the one provided - in the request, the value does not match. For example, `{"S":"6"}` - does not equal `{"N":"6"}`. Also, `{"N":"6"}` does not compare to - `{"NS":["6", "2", "1"]}`. - - - `GT` : Greater than. - - `AttributeValueList` can contain only one `AttributeValue` element of - type String, Number, or Binary (not a set type). If an item contains - an `AttributeValue` element of a different type than the one provided - in the request, the value does not match. For example, `{"S":"6"}` - does not equal `{"N":"6"}`. Also, `{"N":"6"}` does not compare to - `{"NS":["6", "2", "1"]}`. - - - `NOT_NULL` : The attribute exists. `NOT_NULL` is supported for all - data types, including lists and maps. - - Note: - This operator tests for the existence of an attribute, not its data - type. If the data type of attribute \"`a`\" is null, and you evaluate - it using `NOT_NULL`, the result is a Boolean `true`. This result is - because the attribute \"`a`\" exists; its data type is not relevant to - the `NOT_NULL` comparison operator. - - - `NULL` : The attribute does not exist. `NULL` is supported for all - data types, including lists and maps. - - Note: - This operator tests for the nonexistence of an attribute, not its data - type. If the data type of attribute \"`a`\" is null, and you evaluate - it using `NULL`, the result is a Boolean `false`. This is because the - attribute \"`a`\" exists; its data type is not relevant to the `NULL` - comparison operator. - - - `CONTAINS` : Checks for a subsequence, or value in a set. - - `AttributeValueList` can contain only one `AttributeValue` element of - type String, Number, or Binary (not a set type). If the target - attribute of the comparison is of type String, then the operator - checks for a substring match. If the target attribute of the - comparison is of type Binary, then the operator looks for a - subsequence of the target that matches the input. If the target - attribute of the comparison is a set (\"`SS`\", \"`NS`\", or - \"`BS`\"), then the operator evaluates to true if it finds an exact - match with any member of the set. - - CONTAINS is supported for lists: When evaluating \"`a CONTAINS b`\", - \"`a`\" can be a list; however, \"`b`\" cannot be a set, a map, or a - list. - - - `NOT_CONTAINS` : Checks for absence of a subsequence, or absence of a - value in a set. - - `AttributeValueList` can contain only one `AttributeValue` element of - type String, Number, or Binary (not a set type). If the target - attribute of the comparison is a String, then the operator checks for - the absence of a substring match. If the target attribute of the - comparison is Binary, then the operator checks for the absence of a - subsequence of the target that matches the input. If the target - attribute of the comparison is a set (\"`SS`\", \"`NS`\", or - \"`BS`\"), then the operator evaluates to true if it *does not* find - an exact match with any member of the set. - - NOT_CONTAINS is supported for lists: When evaluating - \"`a NOT CONTAINS b`\", \"`a`\" can be a list; however, \"`b`\" cannot - be a set, a map, or a list. - - - `BEGINS_WITH` : Checks for a prefix. - - `AttributeValueList` can contain only one `AttributeValue` of type - String or Binary (not a Number or a set type). The target attribute of - the comparison must be of type String or Binary (not a Number or a set - type). - - - `IN` : Checks for matching elements in a list. - - `AttributeValueList` can contain one or more `AttributeValue` elements - of type String, Number, or Binary. These attributes are compared - against an existing attribute of an item. If any elements of the input - are equal to the item attribute, the expression evaluates to true. - - - `BETWEEN` : Greater than or equal to the first value, and less than or - equal to the second value. - - `AttributeValueList` must contain two `AttributeValue` elements of the - same type, either String, Number, or Binary (not a set type). A target - attribute matches if the target value is greater than, or equal to, - the first element and less than, or equal to, the second element. If - an item contains an `AttributeValue` element of a different type than - the one provided in the request, the value does not match. For - example, `{"S":"6"}` does not compare to `{"N":"6"}`. Also, - `{"N":"6"}` does not compare to `{"NS":["6", "2", "1"]}` - """ - - attribute_value_list: "list[AttributeValue] | None" = None - """ - One or more values to evaluate against the supplied attribute. The - number of values in the list depends on the `ComparisonOperator` being - used. - - For type Number, value comparisons are numeric. - - String value comparisons for greater than, equals, or less than are - based on ASCII character code values. For example, `a` is greater than - `A`, and `a` is greater than `B`. For a list of code values, see - . - - For Binary, DynamoDB treats each byte of the binary data as unsigned - when it compares binary values. - - For information on specifying data types in JSON, see [JSON Data - Format](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataFormat.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EXPECTED_ATTRIBUTE_VALUE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.value is not None: - serializer.write_struct( - _SCHEMA_EXPECTED_ATTRIBUTE_VALUE.members["Value"], self.value - ) - - if self.exists is not None: - serializer.write_boolean( - _SCHEMA_EXPECTED_ATTRIBUTE_VALUE.members["Exists"], self.exists - ) - - if self.comparison_operator is not None: - serializer.write_string( - _SCHEMA_EXPECTED_ATTRIBUTE_VALUE.members["ComparisonOperator"], - self.comparison_operator, - ) - - if self.attribute_value_list is not None: - _serialize_attribute_value_list( - serializer, - _SCHEMA_EXPECTED_ATTRIBUTE_VALUE.members["AttributeValueList"], - self.attribute_value_list, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["value"] = _AttributeValueDeserializer().deserialize(de) - - case 1: - kwargs["exists"] = de.read_boolean( - _SCHEMA_EXPECTED_ATTRIBUTE_VALUE.members["Exists"] - ) - - case 2: - kwargs["comparison_operator"] = ComparisonOperator( - de.read_string( - _SCHEMA_EXPECTED_ATTRIBUTE_VALUE.members[ - "ComparisonOperator" - ] - ) - ) - - case 3: - kwargs["attribute_value_list"] = _deserialize_attribute_value_list( - de, - _SCHEMA_EXPECTED_ATTRIBUTE_VALUE.members["AttributeValueList"], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EXPECTED_ATTRIBUTE_VALUE, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class TransactGetItemsInput: - """Dataclass for TransactGetItemsInput structure.""" - - transact_items: "list[TransactGetItem] | None" = None - """ - An ordered array of up to 100 `TransactGetItem` objects, each of which - contains a `Get` structure. - """ - - return_consumed_capacity: str | None = None - """ - A value of `TOTAL` causes consumed capacity information to be returned, - and a value of `NONE` prevents that information from being returned. No - other value is valid. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRANSACT_GET_ITEMS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.transact_items is not None: - _serialize_transact_get_item_list( - serializer, - _SCHEMA_TRANSACT_GET_ITEMS_INPUT.members["TransactItems"], - self.transact_items, - ) - - if self.return_consumed_capacity is not None: - serializer.write_string( - _SCHEMA_TRANSACT_GET_ITEMS_INPUT.members["ReturnConsumedCapacity"], - self.return_consumed_capacity, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["transact_items"] = _deserialize_transact_get_item_list( - de, _SCHEMA_TRANSACT_GET_ITEMS_INPUT.members["TransactItems"] - ) - - case 1: - kwargs["return_consumed_capacity"] = ReturnConsumedCapacity( - de.read_string( - _SCHEMA_TRANSACT_GET_ITEMS_INPUT.members[ - "ReturnConsumedCapacity" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TRANSACT_GET_ITEMS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class TransactWriteItemsOutput: - """Dataclass for TransactWriteItemsOutput structure.""" - - consumed_capacity: list[ConsumedCapacity] | None = None - """ - The capacity units consumed by the entire `TransactWriteItems` - operation. The values of the list are ordered according to the ordering - of the `TransactItems` request parameter. - - If the table has vector indexes, each element also includes a - `VectorIndexes` field with `VectorWriteRequestBytes` consumed for each - affected vector index. - """ - - item_collection_metrics: "dict[str, list[ItemCollectionMetrics]] | None" = None - """ - A list of tables that were processed by `TransactWriteItems` and, for - each table, information about any item collections that were affected by - individual `UpdateItem`, `PutItem`, or `DeleteItem` operations. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRANSACT_WRITE_ITEMS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.consumed_capacity is not None: - _serialize_consumed_capacity_multiple( - serializer, - _SCHEMA_TRANSACT_WRITE_ITEMS_OUTPUT.members["ConsumedCapacity"], - self.consumed_capacity, - ) - - if self.item_collection_metrics is not None: - _serialize_item_collection_metrics_per_table( - serializer, - _SCHEMA_TRANSACT_WRITE_ITEMS_OUTPUT.members["ItemCollectionMetrics"], - self.item_collection_metrics, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["consumed_capacity"] = ( - _deserialize_consumed_capacity_multiple( - de, - _SCHEMA_TRANSACT_WRITE_ITEMS_OUTPUT.members[ - "ConsumedCapacity" - ], - ) - ) - - case 1: - kwargs["item_collection_metrics"] = ( - _deserialize_item_collection_metrics_per_table( - de, - _SCHEMA_TRANSACT_WRITE_ITEMS_OUTPUT.members[ - "ItemCollectionMetrics" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_TRANSACT_WRITE_ITEMS_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ConditionCheck: - """ - Represents a request to perform a check that an item exists or to check - the condition of specific attributes of the item. - """ - - key: "dict[str, AttributeValue]" - """ - The primary key of the item to be checked. Each element consists of an - attribute name and a value for that attribute. - """ - - table_name: str - """ - Name of the table for the check item request. You can also provide the - Amazon Resource Name (ARN) of the table in this parameter. - """ - - condition_expression: str - """ - A condition that must be satisfied in order for a conditional update to - succeed. For more information, see [Condition - expressions](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.ConditionExpressions.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - expression_attribute_names: dict[str, str] | None = None - """ - One or more substitution tokens for attribute names in an expression. - For more information, see [Expression attribute - names](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.ExpressionAttributeNames.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - expression_attribute_values: "dict[str, AttributeValue] | None" = None - """ - One or more values that can be substituted in an expression. For more - information, see [Condition - expressions](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.ConditionExpressions.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - return_values_on_condition_check_failure: str | None = None - """ - Use `ReturnValuesOnConditionCheckFailure` to get the item attributes if - the `ConditionCheck` condition fails. For - `ReturnValuesOnConditionCheckFailure`, the valid values are: NONE and - ALL_OLD. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONDITION_CHECK, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_key(serializer, _SCHEMA_CONDITION_CHECK.members["Key"], self.key) - serializer.write_string( - _SCHEMA_CONDITION_CHECK.members["TableName"], self.table_name - ) - serializer.write_string( - _SCHEMA_CONDITION_CHECK.members["ConditionExpression"], - self.condition_expression, - ) - if self.expression_attribute_names is not None: - _serialize_expression_attribute_name_map( - serializer, - _SCHEMA_CONDITION_CHECK.members["ExpressionAttributeNames"], - self.expression_attribute_names, - ) - - if self.expression_attribute_values is not None: - _serialize_expression_attribute_value_map( - serializer, - _SCHEMA_CONDITION_CHECK.members["ExpressionAttributeValues"], - self.expression_attribute_values, - ) - - if self.return_values_on_condition_check_failure is not None: - serializer.write_string( - _SCHEMA_CONDITION_CHECK.members["ReturnValuesOnConditionCheckFailure"], - self.return_values_on_condition_check_failure, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["key"] = _deserialize_key( - de, _SCHEMA_CONDITION_CHECK.members["Key"] - ) - - case 1: - kwargs["table_name"] = de.read_string( - _SCHEMA_CONDITION_CHECK.members["TableName"] - ) - - case 2: - kwargs["condition_expression"] = de.read_string( - _SCHEMA_CONDITION_CHECK.members["ConditionExpression"] - ) - - case 3: - kwargs["expression_attribute_names"] = ( - _deserialize_expression_attribute_name_map( - de, - _SCHEMA_CONDITION_CHECK.members["ExpressionAttributeNames"], - ) - ) - - case 4: - kwargs["expression_attribute_values"] = ( - _deserialize_expression_attribute_value_map( - de, - _SCHEMA_CONDITION_CHECK.members[ - "ExpressionAttributeValues" - ], - ) - ) - - case 5: - kwargs["return_values_on_condition_check_failure"] = ( - ReturnValuesOnConditionCheckFailure( - de.read_string( - _SCHEMA_CONDITION_CHECK.members[ - "ReturnValuesOnConditionCheckFailure" - ] - ) - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONDITION_CHECK, consumer=_consumer) - if "key" not in kwargs: - kwargs["key"] = {} - if "table_name" not in kwargs: - kwargs["table_name"] = "" - if "condition_expression" not in kwargs: - kwargs["condition_expression"] = "" - return kwargs - - -@dataclass(kw_only=True) -class Delete: - """Represents a request to perform a `DeleteItem` operation.""" - - key: "dict[str, AttributeValue]" - """ - The primary key of the item to be deleted. Each element consists of an - attribute name and a value for that attribute. - """ - - table_name: str - """ - Name of the table in which the item to be deleted resides. You can also - provide the Amazon Resource Name (ARN) of the table in this parameter. - """ - - condition_expression: str | None = None - """ - A condition that must be satisfied in order for a conditional delete to - succeed. - """ - - expression_attribute_names: dict[str, str] | None = None - """One or more substitution tokens for attribute names in an expression.""" - - expression_attribute_values: "dict[str, AttributeValue] | None" = None - """One or more values that can be substituted in an expression.""" - - return_values_on_condition_check_failure: str | None = None - """ - Use `ReturnValuesOnConditionCheckFailure` to get the item attributes if - the `Delete` condition fails. For `ReturnValuesOnConditionCheckFailure`, - the valid values are: NONE and ALL_OLD. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_key(serializer, _SCHEMA_DELETE.members["Key"], self.key) - serializer.write_string(_SCHEMA_DELETE.members["TableName"], self.table_name) - if self.condition_expression is not None: - serializer.write_string( - _SCHEMA_DELETE.members["ConditionExpression"], self.condition_expression - ) - - if self.expression_attribute_names is not None: - _serialize_expression_attribute_name_map( - serializer, - _SCHEMA_DELETE.members["ExpressionAttributeNames"], - self.expression_attribute_names, - ) - - if self.expression_attribute_values is not None: - _serialize_expression_attribute_value_map( - serializer, - _SCHEMA_DELETE.members["ExpressionAttributeValues"], - self.expression_attribute_values, - ) - - if self.return_values_on_condition_check_failure is not None: - serializer.write_string( - _SCHEMA_DELETE.members["ReturnValuesOnConditionCheckFailure"], - self.return_values_on_condition_check_failure, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["key"] = _deserialize_key(de, _SCHEMA_DELETE.members["Key"]) - - case 1: - kwargs["table_name"] = de.read_string( - _SCHEMA_DELETE.members["TableName"] - ) - - case 2: - kwargs["condition_expression"] = de.read_string( - _SCHEMA_DELETE.members["ConditionExpression"] - ) - - case 3: - kwargs["expression_attribute_names"] = ( - _deserialize_expression_attribute_name_map( - de, _SCHEMA_DELETE.members["ExpressionAttributeNames"] - ) - ) - - case 4: - kwargs["expression_attribute_values"] = ( - _deserialize_expression_attribute_value_map( - de, _SCHEMA_DELETE.members["ExpressionAttributeValues"] - ) - ) - - case 5: - kwargs["return_values_on_condition_check_failure"] = ( - ReturnValuesOnConditionCheckFailure( - de.read_string( - _SCHEMA_DELETE.members[ - "ReturnValuesOnConditionCheckFailure" - ] - ) - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE, consumer=_consumer) - if "key" not in kwargs: - kwargs["key"] = {} - if "table_name" not in kwargs: - kwargs["table_name"] = "" - return kwargs - - -@dataclass(kw_only=True) -class Put: - """Represents a request to perform a `PutItem` operation.""" - - item: "dict[str, AttributeValue]" - """ - A map of attribute name to attribute values, representing the primary - key of the item to be written by `PutItem`. All of the table's primary - key attributes must be specified, and their data types must match those - of the table's key schema. If any attributes are present in the item - that are part of an index key schema for the table, their types must - match the index key schema. - """ - - table_name: str - """ - Name of the table in which to write the item. You can also provide the - Amazon Resource Name (ARN) of the table in this parameter. - """ - - condition_expression: str | None = None - """ - A condition that must be satisfied in order for a conditional update to - succeed. - """ - - expression_attribute_names: dict[str, str] | None = None - """One or more substitution tokens for attribute names in an expression.""" - - expression_attribute_values: "dict[str, AttributeValue] | None" = None - """One or more values that can be substituted in an expression.""" - - return_values_on_condition_check_failure: str | None = None - """ - Use `ReturnValuesOnConditionCheckFailure` to get the item attributes if - the `Put` condition fails. For `ReturnValuesOnConditionCheckFailure`, - the valid values are: NONE and ALL_OLD. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_put_item_input_attribute_map( - serializer, _SCHEMA_PUT.members["Item"], self.item - ) - serializer.write_string(_SCHEMA_PUT.members["TableName"], self.table_name) - if self.condition_expression is not None: - serializer.write_string( - _SCHEMA_PUT.members["ConditionExpression"], self.condition_expression - ) - - if self.expression_attribute_names is not None: - _serialize_expression_attribute_name_map( - serializer, - _SCHEMA_PUT.members["ExpressionAttributeNames"], - self.expression_attribute_names, - ) - - if self.expression_attribute_values is not None: - _serialize_expression_attribute_value_map( - serializer, - _SCHEMA_PUT.members["ExpressionAttributeValues"], - self.expression_attribute_values, - ) - - if self.return_values_on_condition_check_failure is not None: - serializer.write_string( - _SCHEMA_PUT.members["ReturnValuesOnConditionCheckFailure"], - self.return_values_on_condition_check_failure, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["item"] = _deserialize_put_item_input_attribute_map( - de, _SCHEMA_PUT.members["Item"] - ) - - case 1: - kwargs["table_name"] = de.read_string( - _SCHEMA_PUT.members["TableName"] - ) - - case 2: - kwargs["condition_expression"] = de.read_string( - _SCHEMA_PUT.members["ConditionExpression"] - ) - - case 3: - kwargs["expression_attribute_names"] = ( - _deserialize_expression_attribute_name_map( - de, _SCHEMA_PUT.members["ExpressionAttributeNames"] - ) - ) - - case 4: - kwargs["expression_attribute_values"] = ( - _deserialize_expression_attribute_value_map( - de, _SCHEMA_PUT.members["ExpressionAttributeValues"] - ) - ) - - case 5: - kwargs["return_values_on_condition_check_failure"] = ( - ReturnValuesOnConditionCheckFailure( - de.read_string( - _SCHEMA_PUT.members[ - "ReturnValuesOnConditionCheckFailure" - ] - ) - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUT, consumer=_consumer) - if "item" not in kwargs: - kwargs["item"] = {} - if "table_name" not in kwargs: - kwargs["table_name"] = "" - return kwargs - - -@dataclass(kw_only=True) -class SearchVectorsInput: - """Dataclass for SearchVectorsInput structure.""" - - table_name: str | None = None - """ - The name or Amazon Resource Name (ARN) of the table containing the - vector index. - """ - - index_name: str | None = None - """ - The name of the vector index to search. The index must be in the - `ACTIVE` state. - """ - - return_consumed_capacity: str | None = None - """ - Determines the level of detail about either provisioned or on-demand - throughput consumption that is returned in the response: - - - `INDEXES` - The response includes the aggregate `ConsumedCapacity` for - the operation, together with `ConsumedCapacity` for each table and - secondary index that was accessed. - - Note that some operations, such as `GetItem` and `BatchGetItem`, do - not access any indexes at all. In these cases, specifying `INDEXES` - will only return `ConsumedCapacity` information for table(s). - - - `TOTAL` - The response includes only the aggregate `ConsumedCapacity` - for the operation. - - - `NONE` - No `ConsumedCapacity` details are included in the response. - """ - - expression_attribute_names: dict[str, str] | None = None - """ - One or more substitution tokens for attribute names in an expression. - Use the `#` character in an expression to dereference an attribute name. - """ - - expression_attribute_values: "dict[str, AttributeValue] | None" = None - """ - One or more values that can be substituted in an expression. Use the `:` - character in an expression to dereference an attribute value. - """ - - projection_expression: str | None = None - """ - A string that identifies one or more attributes to retrieve from the - index. Separate attribute names with commas. If not specified, the - operation returns all attributes projected into the vector index. - - Only attributes projected into the vector index can be retrieved. - """ - - search_vector: "list[AttributeValue] | None" = None - """ - The search vector to compare against the indexed vectors. Each element - is a 32-bit IEEE-754 floating point number, provided in DynamoDB list - format. - - The number of dimensions must match the number of dimensions configured - for the vector index. - """ - - search_condition_expression: str | None = None - """ - A condition expression used to filter the vector search results. The - expression can reference attributes defined in the vector index search - schema, including `HASH` and `INLINE_FILTER` key elements. - - Only the equality operator (`=`) is supported for `HASH` attributes. - Comparison and range operators are supported for `INLINE_FILTER` - attributes. Only top-level attributes from the search schema can be - referenced. - """ - - top_k: int | None = None - """The number of most similar results to return.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SEARCH_VECTORS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.table_name is not None: - serializer.write_string( - _SCHEMA_SEARCH_VECTORS_INPUT.members["TableName"], self.table_name - ) - - if self.index_name is not None: - serializer.write_string( - _SCHEMA_SEARCH_VECTORS_INPUT.members["IndexName"], self.index_name - ) - - if self.return_consumed_capacity is not None: - serializer.write_string( - _SCHEMA_SEARCH_VECTORS_INPUT.members["ReturnConsumedCapacity"], - self.return_consumed_capacity, - ) - - if self.expression_attribute_names is not None: - _serialize_expression_attribute_name_map( - serializer, - _SCHEMA_SEARCH_VECTORS_INPUT.members["ExpressionAttributeNames"], - self.expression_attribute_names, - ) - - if self.expression_attribute_values is not None: - _serialize_expression_attribute_value_map( - serializer, - _SCHEMA_SEARCH_VECTORS_INPUT.members["ExpressionAttributeValues"], - self.expression_attribute_values, - ) - - if self.projection_expression is not None: - serializer.write_string( - _SCHEMA_SEARCH_VECTORS_INPUT.members["ProjectionExpression"], - self.projection_expression, - ) - - if self.search_vector is not None: - _serialize_search_vector_list( - serializer, - _SCHEMA_SEARCH_VECTORS_INPUT.members["SearchVector"], - self.search_vector, - ) - - if self.search_condition_expression is not None: - serializer.write_string( - _SCHEMA_SEARCH_VECTORS_INPUT.members["SearchConditionExpression"], - self.search_condition_expression, - ) - - if self.top_k is not None: - serializer.write_integer( - _SCHEMA_SEARCH_VECTORS_INPUT.members["TopK"], self.top_k - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["table_name"] = de.read_string( - _SCHEMA_SEARCH_VECTORS_INPUT.members["TableName"] - ) - - case 1: - kwargs["index_name"] = de.read_string( - _SCHEMA_SEARCH_VECTORS_INPUT.members["IndexName"] - ) - - case 2: - kwargs["return_consumed_capacity"] = ReturnConsumedCapacity( - de.read_string( - _SCHEMA_SEARCH_VECTORS_INPUT.members[ - "ReturnConsumedCapacity" - ] - ) - ) - - case 3: - kwargs["expression_attribute_names"] = ( - _deserialize_expression_attribute_name_map( - de, - _SCHEMA_SEARCH_VECTORS_INPUT.members[ - "ExpressionAttributeNames" - ], - ) - ) - - case 4: - kwargs["expression_attribute_values"] = ( - _deserialize_expression_attribute_value_map( - de, - _SCHEMA_SEARCH_VECTORS_INPUT.members[ - "ExpressionAttributeValues" - ], - ) - ) - - case 5: - kwargs["projection_expression"] = de.read_string( - _SCHEMA_SEARCH_VECTORS_INPUT.members["ProjectionExpression"] - ) - - case 6: - kwargs["search_vector"] = _deserialize_search_vector_list( - de, _SCHEMA_SEARCH_VECTORS_INPUT.members["SearchVector"] - ) - - case 7: - kwargs["search_condition_expression"] = de.read_string( - _SCHEMA_SEARCH_VECTORS_INPUT.members[ - "SearchConditionExpression" - ] - ) - - case 8: - kwargs["top_k"] = de.read_integer( - _SCHEMA_SEARCH_VECTORS_INPUT.members["TopK"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SEARCH_VECTORS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Update: - """Represents a request to perform an `UpdateItem` operation.""" - - key: "dict[str, AttributeValue]" - """ - The primary key of the item to be updated. Each element consists of an - attribute name and a value for that attribute. - """ - - update_expression: str - """ - An expression that defines one or more attributes to be updated, the - action to be performed on them, and new value(s) for them. - """ - - table_name: str - """ - Name of the table for the `UpdateItem` request. You can also provide the - Amazon Resource Name (ARN) of the table in this parameter. - """ - - condition_expression: str | None = None - """ - A condition that must be satisfied in order for a conditional update to - succeed. - """ - - expression_attribute_names: dict[str, str] | None = None - """One or more substitution tokens for attribute names in an expression.""" - - expression_attribute_values: "dict[str, AttributeValue] | None" = None - """One or more values that can be substituted in an expression.""" - - return_values_on_condition_check_failure: str | None = None - """ - Use `ReturnValuesOnConditionCheckFailure` to get the item attributes if - the `Update` condition fails. For `ReturnValuesOnConditionCheckFailure`, - the valid values are: NONE and ALL_OLD. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_key(serializer, _SCHEMA_UPDATE.members["Key"], self.key) - serializer.write_string( - _SCHEMA_UPDATE.members["UpdateExpression"], self.update_expression - ) - serializer.write_string(_SCHEMA_UPDATE.members["TableName"], self.table_name) - if self.condition_expression is not None: - serializer.write_string( - _SCHEMA_UPDATE.members["ConditionExpression"], self.condition_expression - ) - - if self.expression_attribute_names is not None: - _serialize_expression_attribute_name_map( - serializer, - _SCHEMA_UPDATE.members["ExpressionAttributeNames"], - self.expression_attribute_names, - ) - - if self.expression_attribute_values is not None: - _serialize_expression_attribute_value_map( - serializer, - _SCHEMA_UPDATE.members["ExpressionAttributeValues"], - self.expression_attribute_values, - ) - - if self.return_values_on_condition_check_failure is not None: - serializer.write_string( - _SCHEMA_UPDATE.members["ReturnValuesOnConditionCheckFailure"], - self.return_values_on_condition_check_failure, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["key"] = _deserialize_key(de, _SCHEMA_UPDATE.members["Key"]) - - case 1: - kwargs["update_expression"] = de.read_string( - _SCHEMA_UPDATE.members["UpdateExpression"] - ) - - case 2: - kwargs["table_name"] = de.read_string( - _SCHEMA_UPDATE.members["TableName"] - ) - - case 3: - kwargs["condition_expression"] = de.read_string( - _SCHEMA_UPDATE.members["ConditionExpression"] - ) - - case 4: - kwargs["expression_attribute_names"] = ( - _deserialize_expression_attribute_name_map( - de, _SCHEMA_UPDATE.members["ExpressionAttributeNames"] - ) - ) - - case 5: - kwargs["expression_attribute_values"] = ( - _deserialize_expression_attribute_value_map( - de, _SCHEMA_UPDATE.members["ExpressionAttributeValues"] - ) - ) - - case 6: - kwargs["return_values_on_condition_check_failure"] = ( - ReturnValuesOnConditionCheckFailure( - de.read_string( - _SCHEMA_UPDATE.members[ - "ReturnValuesOnConditionCheckFailure" - ] - ) - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE, consumer=_consumer) - if "key" not in kwargs: - kwargs["key"] = {} - if "update_expression" not in kwargs: - kwargs["update_expression"] = "" - if "table_name" not in kwargs: - kwargs["table_name"] = "" - return kwargs - - -@dataclass(kw_only=True) -class BatchStatementResponse: - """A PartiQL batch statement response..""" - - error: "BatchStatementError | None" = None - """The error associated with a failed PartiQL batch statement.""" - - table_name: str | None = None - """The table name associated with a failed PartiQL batch statement.""" - - item: "dict[str, AttributeValue] | None" = None - """A DynamoDB item associated with a BatchStatementResponse""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BATCH_STATEMENT_RESPONSE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.error is not None: - serializer.write_struct( - _SCHEMA_BATCH_STATEMENT_RESPONSE.members["Error"], self.error - ) - - if self.table_name is not None: - serializer.write_string( - _SCHEMA_BATCH_STATEMENT_RESPONSE.members["TableName"], self.table_name - ) - - if self.item is not None: - _serialize_attribute_map( - serializer, _SCHEMA_BATCH_STATEMENT_RESPONSE.members["Item"], self.item - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["error"] = BatchStatementError.deserialize(de) - - case 1: - kwargs["table_name"] = de.read_string( - _SCHEMA_BATCH_STATEMENT_RESPONSE.members["TableName"] - ) - - case 2: - kwargs["item"] = _deserialize_attribute_map( - de, _SCHEMA_BATCH_STATEMENT_RESPONSE.members["Item"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BATCH_STATEMENT_RESPONSE, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteItemOutput: - """Represents the output of a `DeleteItem` operation.""" - - attributes: "dict[str, AttributeValue] | None" = None - """ - A map of attribute names to `AttributeValue` objects, representing the - item as it appeared before the `DeleteItem` operation. This map appears - in the response only if `ReturnValues` was specified as `ALL_OLD` in the - request. - """ - - consumed_capacity: ConsumedCapacity | None = None - """ - The capacity units consumed by the `DeleteItem` operation. The data - returned includes the total provisioned throughput consumed, along with - statistics for the table and any indexes involved in the operation. - `ConsumedCapacity` is only returned if the `ReturnConsumedCapacity` - parameter was specified. For more information, see [Provisioned capacity - mode](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/provisioned-capacity-mode.html) - in the *Amazon DynamoDB Developer Guide*. - - If the table has vector indexes, the response includes a `VectorIndexes` - field with `VectorWriteRequestBytes` consumed for each affected vector - index. - """ - - item_collection_metrics: "ItemCollectionMetrics | None" = None - """ - Information about item collections, if any, that were affected by the - `DeleteItem` operation. `ItemCollectionMetrics` is only returned if the - `ReturnItemCollectionMetrics` parameter was specified. If the table does - not have any local secondary indexes, this information is not returned - in the response. - - Each `ItemCollectionMetrics` element consists of: - - - `ItemCollectionKey` - The partition key value of the item collection. - This is the same as the partition key value of the item itself. - - - `SizeEstimateRangeGB` - An estimate of item collection size, in - gigabytes. This value is a two-element array containing a lower bound - and an upper bound for the estimate. The estimate includes the size of - all the items in the table, plus the size of all attributes projected - into all of the local secondary indexes on that table. Use this - estimate to measure whether a local secondary index is approaching its - size limit. - - The estimate is subject to change over time; therefore, do not rely on - the precision or accuracy of the estimate. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_ITEM_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.attributes is not None: - _serialize_attribute_map( - serializer, - _SCHEMA_DELETE_ITEM_OUTPUT.members["Attributes"], - self.attributes, - ) - - if self.consumed_capacity is not None: - serializer.write_struct( - _SCHEMA_DELETE_ITEM_OUTPUT.members["ConsumedCapacity"], - self.consumed_capacity, - ) - - if self.item_collection_metrics is not None: - serializer.write_struct( - _SCHEMA_DELETE_ITEM_OUTPUT.members["ItemCollectionMetrics"], - self.item_collection_metrics, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["attributes"] = _deserialize_attribute_map( - de, _SCHEMA_DELETE_ITEM_OUTPUT.members["Attributes"] - ) - - case 1: - kwargs["consumed_capacity"] = ConsumedCapacity.deserialize(de) - - case 2: - kwargs["item_collection_metrics"] = ( - ItemCollectionMetrics.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_ITEM_OUTPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ExecuteStatementOutput: - """Dataclass for ExecuteStatementOutput structure.""" - - items: "list[dict[str, AttributeValue]] | None" = None - """ - If a read operation was used, this property will contain the result of - the read operation; a map of attribute names and their values. For the - write operations this value will be empty. - """ - - next_token: str | None = None - """ - If the response of a read request exceeds the response payload limit - DynamoDB will set this value in the response. If set, you can use that - this value in the subsequent request to get the remaining results. - """ - - consumed_capacity: ConsumedCapacity | None = None - """ - The capacity units consumed by an operation. The data returned includes - the total provisioned throughput consumed, along with statistics for the - table and any indexes involved in the operation. `ConsumedCapacity` is - only returned if the request asked for it. For more information, see - [Provisioned capacity - mode](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/provisioned-capacity-mode.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - last_evaluated_key: "dict[str, AttributeValue] | None" = None - """ - The primary key of the item where the operation stopped, inclusive of - the previous result set. Use this value to start a new operation, - excluding this value in the new request. If `LastEvaluatedKey` is empty, - then the \"last page\" of results has been processed and there is no - more data to be retrieved. If `LastEvaluatedKey` is not empty, it does - not necessarily mean that there is more data in the result set. The only - way to know when you have reached the end of the result set is when - `LastEvaluatedKey` is empty. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EXECUTE_STATEMENT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.items is not None: - _serialize_item_list( - serializer, - _SCHEMA_EXECUTE_STATEMENT_OUTPUT.members["Items"], - self.items, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_EXECUTE_STATEMENT_OUTPUT.members["NextToken"], self.next_token - ) - - if self.consumed_capacity is not None: - serializer.write_struct( - _SCHEMA_EXECUTE_STATEMENT_OUTPUT.members["ConsumedCapacity"], - self.consumed_capacity, - ) - - if self.last_evaluated_key is not None: - _serialize_key( - serializer, - _SCHEMA_EXECUTE_STATEMENT_OUTPUT.members["LastEvaluatedKey"], - self.last_evaluated_key, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["items"] = _deserialize_item_list( - de, _SCHEMA_EXECUTE_STATEMENT_OUTPUT.members["Items"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_EXECUTE_STATEMENT_OUTPUT.members["NextToken"] - ) - - case 2: - kwargs["consumed_capacity"] = ConsumedCapacity.deserialize(de) - - case 3: - kwargs["last_evaluated_key"] = _deserialize_key( - de, _SCHEMA_EXECUTE_STATEMENT_OUTPUT.members["LastEvaluatedKey"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EXECUTE_STATEMENT_OUTPUT, consumer=_consumer) - return kwargs - - -def _serialize_expected_attribute_map( - serializer: ShapeSerializer, - schema: Schema, - value: dict[str, ExpectedAttributeValue], -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_struct(value_schema, v)) - - -def _deserialize_expected_attribute_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, ExpectedAttributeValue]: - result: dict[str, ExpectedAttributeValue] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = ExpectedAttributeValue.deserialize(d) - - deserializer.read_map(schema, _read_value) - return result - - -GET_ITEM = APIOperation( - input=GetItemInput, - output=GetItemOutput, - schema=_SCHEMA_GET_ITEM, - input_schema=_SCHEMA_GET_ITEM_INPUT, - output_schema=_SCHEMA_GET_ITEM_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#InvalidEndpointException" - ): InvalidEndpointException, - ShapeID( - "com.amazonaws.dynamodb#ProvisionedThroughputExceededException" - ): ProvisionedThroughputExceededException, - ShapeID( - "com.amazonaws.dynamodb#RequestLimitExceeded" - ): RequestLimitExceeded, - ShapeID( - "com.amazonaws.dynamodb#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.dynamodb#ThrottlingException"): ThrottlingException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_SERVER_ERROR, - _SCHEMA_INVALID_ENDPOINT_EXCEPTION, - _SCHEMA_PROVISIONED_THROUGHPUT_EXCEEDED_EXCEPTION, - _SCHEMA_REQUEST_LIMIT_EXCEEDED, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class PutItemOutput: - """Represents the output of a `PutItem` operation.""" - - attributes: "dict[str, AttributeValue] | None" = None - """ - The attribute values as they appeared before the `PutItem` operation, - but only if `ReturnValues` is specified as `ALL_OLD` in the request. - Each element consists of an attribute name and an attribute value. - """ - - consumed_capacity: ConsumedCapacity | None = None - """ - The capacity units consumed by the `PutItem` operation. The data - returned includes the total provisioned throughput consumed, along with - statistics for the table and any indexes involved in the operation. - `ConsumedCapacity` is only returned if the `ReturnConsumedCapacity` - parameter was specified. For more information, see [Capacity unity - consumption for write - operations](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/read-write-operations.html#write-operation-consumption) - in the *Amazon DynamoDB Developer Guide*. - - If the table has vector indexes, the response includes a `VectorIndexes` - field with `VectorWriteRequestBytes` consumed for each affected vector - index. - """ - - item_collection_metrics: "ItemCollectionMetrics | None" = None - """ - Information about item collections, if any, that were affected by the - `PutItem` operation. `ItemCollectionMetrics` is only returned if the - `ReturnItemCollectionMetrics` parameter was specified. If the table does - not have any local secondary indexes, this information is not returned - in the response. - - Each `ItemCollectionMetrics` element consists of: - - - `ItemCollectionKey` - The partition key value of the item collection. - This is the same as the partition key value of the item itself. - - - `SizeEstimateRangeGB` - An estimate of item collection size, in - gigabytes. This value is a two-element array containing a lower bound - and an upper bound for the estimate. The estimate includes the size of - all the items in the table, plus the size of all attributes projected - into all of the local secondary indexes on that table. Use this - estimate to measure whether a local secondary index is approaching its - size limit. - - The estimate is subject to change over time; therefore, do not rely on - the precision or accuracy of the estimate. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_ITEM_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.attributes is not None: - _serialize_attribute_map( - serializer, - _SCHEMA_PUT_ITEM_OUTPUT.members["Attributes"], - self.attributes, - ) - - if self.consumed_capacity is not None: - serializer.write_struct( - _SCHEMA_PUT_ITEM_OUTPUT.members["ConsumedCapacity"], - self.consumed_capacity, - ) - - if self.item_collection_metrics is not None: - serializer.write_struct( - _SCHEMA_PUT_ITEM_OUTPUT.members["ItemCollectionMetrics"], - self.item_collection_metrics, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["attributes"] = _deserialize_attribute_map( - de, _SCHEMA_PUT_ITEM_OUTPUT.members["Attributes"] - ) - - case 1: - kwargs["consumed_capacity"] = ConsumedCapacity.deserialize(de) - - case 2: - kwargs["item_collection_metrics"] = ( - ItemCollectionMetrics.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUT_ITEM_OUTPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class QueryOutput: - """Represents the output of a `Query` operation.""" - - items: "list[dict[str, AttributeValue]] | None" = None - """ - An array of item attributes that match the query criteria. Each element - in this array consists of an attribute name and the value for that - attribute. - """ - - count: int = 0 - """ - The number of items in the response. - - If you used a `QueryFilter` in the request, then `Count` is the number - of items returned after the filter was applied, and `ScannedCount` is - the number of matching items before the filter was applied. - - If you did not use a filter in the request, then `Count` and - `ScannedCount` are the same. - """ - - scanned_count: int = 0 - """ - The number of items evaluated, before any `QueryFilter` is applied. A - high `ScannedCount` value with few, or no, `Count` results indicates an - inefficient `Query` operation. For more information, see [Count and - ScannedCount](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Scan.html#Scan.Count) - in the *Amazon DynamoDB Developer Guide*. - - If you did not use a filter in the request, then `ScannedCount` is the - same as `Count`. - """ - - last_evaluated_key: "dict[str, AttributeValue] | None" = None - """ - The primary key of the item where the operation stopped, inclusive of - the previous result set. Use this value to start a new operation, - excluding this value in the new request. - - If `LastEvaluatedKey` is empty, then the \"last page\" of results has - been processed and there is no more data to be retrieved. - - If `LastEvaluatedKey` is not empty, it does not necessarily mean that - there is more data in the result set. The only way to know when you have - reached the end of the result set is when `LastEvaluatedKey` is empty. - """ - - consumed_capacity: ConsumedCapacity | None = None - """ - The capacity units consumed by the `Query` operation. The data returned - includes the total provisioned throughput consumed, along with - statistics for the table and any indexes involved in the operation. - `ConsumedCapacity` is only returned if the `ReturnConsumedCapacity` - parameter was specified. For more information, see [Capacity unit - consumption for read - operations](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/read-write-operations.html#read-operation-consumption) - in the *Amazon DynamoDB Developer Guide*. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_QUERY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.items is not None: - _serialize_item_list( - serializer, _SCHEMA_QUERY_OUTPUT.members["Items"], self.items - ) - - serializer.write_integer(_SCHEMA_QUERY_OUTPUT.members["Count"], self.count) - serializer.write_integer( - _SCHEMA_QUERY_OUTPUT.members["ScannedCount"], self.scanned_count - ) - if self.last_evaluated_key is not None: - _serialize_key( - serializer, - _SCHEMA_QUERY_OUTPUT.members["LastEvaluatedKey"], - self.last_evaluated_key, - ) - - if self.consumed_capacity is not None: - serializer.write_struct( - _SCHEMA_QUERY_OUTPUT.members["ConsumedCapacity"], self.consumed_capacity - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["items"] = _deserialize_item_list( - de, _SCHEMA_QUERY_OUTPUT.members["Items"] - ) - - case 1: - kwargs["count"] = de.read_integer( - _SCHEMA_QUERY_OUTPUT.members["Count"] - ) - - case 2: - kwargs["scanned_count"] = de.read_integer( - _SCHEMA_QUERY_OUTPUT.members["ScannedCount"] - ) - - case 3: - kwargs["last_evaluated_key"] = _deserialize_key( - de, _SCHEMA_QUERY_OUTPUT.members["LastEvaluatedKey"] - ) - - case 4: - kwargs["consumed_capacity"] = ConsumedCapacity.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_QUERY_OUTPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ScanOutput: - """Represents the output of a `Scan` operation.""" - - items: "list[dict[str, AttributeValue]] | None" = None - """ - An array of item attributes that match the scan criteria. Each element - in this array consists of an attribute name and the value for that - attribute. - """ - - count: int = 0 - """ - The number of items in the response. - - If you set `ScanFilter` in the request, then `Count` is the number of - items returned after the filter was applied, and `ScannedCount` is the - number of matching items before the filter was applied. - - If you did not use a filter in the request, then `Count` is the same as - `ScannedCount`. - """ - - scanned_count: int = 0 - """ - The number of items evaluated, before any `ScanFilter` is applied. A - high `ScannedCount` value with few, or no, `Count` results indicates an - inefficient `Scan` operation. For more information, see [Count and - ScannedCount](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html#Count) - in the *Amazon DynamoDB Developer Guide*. - - If you did not use a filter in the request, then `ScannedCount` is the - same as `Count`. - """ - - last_evaluated_key: "dict[str, AttributeValue] | None" = None - """ - The primary key of the item where the operation stopped, inclusive of - the previous result set. Use this value to start a new operation, - excluding this value in the new request. - - If `LastEvaluatedKey` is empty, then the \"last page\" of results has - been processed and there is no more data to be retrieved. - - If `LastEvaluatedKey` is not empty, it does not necessarily mean that - there is more data in the result set. The only way to know when you have - reached the end of the result set is when `LastEvaluatedKey` is empty. - """ - - consumed_capacity: ConsumedCapacity | None = None - """ - The capacity units consumed by the `Scan` operation. The data returned - includes the total provisioned throughput consumed, along with - statistics for the table and any indexes involved in the operation. - `ConsumedCapacity` is only returned if the `ReturnConsumedCapacity` - parameter was specified. For more information, see [Capacity unit - consumption for read - operations](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/read-write-operations.html#read-operation-consumption) - in the *Amazon DynamoDB Developer Guide*. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SCAN_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.items is not None: - _serialize_item_list( - serializer, _SCHEMA_SCAN_OUTPUT.members["Items"], self.items - ) - - serializer.write_integer(_SCHEMA_SCAN_OUTPUT.members["Count"], self.count) - serializer.write_integer( - _SCHEMA_SCAN_OUTPUT.members["ScannedCount"], self.scanned_count - ) - if self.last_evaluated_key is not None: - _serialize_key( - serializer, - _SCHEMA_SCAN_OUTPUT.members["LastEvaluatedKey"], - self.last_evaluated_key, - ) - - if self.consumed_capacity is not None: - serializer.write_struct( - _SCHEMA_SCAN_OUTPUT.members["ConsumedCapacity"], self.consumed_capacity - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["items"] = _deserialize_item_list( - de, _SCHEMA_SCAN_OUTPUT.members["Items"] - ) - - case 1: - kwargs["count"] = de.read_integer( - _SCHEMA_SCAN_OUTPUT.members["Count"] - ) - - case 2: - kwargs["scanned_count"] = de.read_integer( - _SCHEMA_SCAN_OUTPUT.members["ScannedCount"] - ) - - case 3: - kwargs["last_evaluated_key"] = _deserialize_key( - de, _SCHEMA_SCAN_OUTPUT.members["LastEvaluatedKey"] - ) - - case 4: - kwargs["consumed_capacity"] = ConsumedCapacity.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SCAN_OUTPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateItemOutput: - """Represents the output of an `UpdateItem` operation.""" - - attributes: "dict[str, AttributeValue] | None" = None - """ - A map of attribute values as they appear before or after the - `UpdateItem` operation, as determined by the `ReturnValues` parameter. - - The `Attributes` map is only present if the update was successful and - `ReturnValues` was specified as something other than `NONE` in the - request. Each element represents one attribute. - """ - - consumed_capacity: ConsumedCapacity | None = None - """ - The capacity units consumed by the `UpdateItem` operation. The data - returned includes the total provisioned throughput consumed, along with - statistics for the table and any indexes involved in the operation. - `ConsumedCapacity` is only returned if the `ReturnConsumedCapacity` - parameter was specified. For more information, see [Capacity unity - consumption for write - operations](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/read-write-operations.html#write-operation-consumption) - in the *Amazon DynamoDB Developer Guide*. - - If the table has vector indexes, the response includes a `VectorIndexes` - field with `VectorWriteRequestBytes` consumed for each affected vector - index. - """ - - item_collection_metrics: "ItemCollectionMetrics | None" = None - """ - Information about item collections, if any, that were affected by the - `UpdateItem` operation. `ItemCollectionMetrics` is only returned if the - `ReturnItemCollectionMetrics` parameter was specified. If the table does - not have any local secondary indexes, this information is not returned - in the response. - - Each `ItemCollectionMetrics` element consists of: - - - `ItemCollectionKey` - The partition key value of the item collection. - This is the same as the partition key value of the item itself. - - - `SizeEstimateRangeGB` - An estimate of item collection size, in - gigabytes. This value is a two-element array containing a lower bound - and an upper bound for the estimate. The estimate includes the size of - all the items in the table, plus the size of all attributes projected - into all of the local secondary indexes on that table. Use this - estimate to measure whether a local secondary index is approaching its - size limit. - - The estimate is subject to change over time; therefore, do not rely on - the precision or accuracy of the estimate. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_ITEM_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.attributes is not None: - _serialize_attribute_map( - serializer, - _SCHEMA_UPDATE_ITEM_OUTPUT.members["Attributes"], - self.attributes, - ) - - if self.consumed_capacity is not None: - serializer.write_struct( - _SCHEMA_UPDATE_ITEM_OUTPUT.members["ConsumedCapacity"], - self.consumed_capacity, - ) - - if self.item_collection_metrics is not None: - serializer.write_struct( - _SCHEMA_UPDATE_ITEM_OUTPUT.members["ItemCollectionMetrics"], - self.item_collection_metrics, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["attributes"] = _deserialize_attribute_map( - de, _SCHEMA_UPDATE_ITEM_OUTPUT.members["Attributes"] - ) - - case 1: - kwargs["consumed_capacity"] = ConsumedCapacity.deserialize(de) - - case 2: - kwargs["item_collection_metrics"] = ( - ItemCollectionMetrics.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_ITEM_OUTPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class WriteRequest: - """ - Represents an operation to perform - either `DeleteItem` or `PutItem`. - You can only request one of these operations, not both, in a single - `WriteRequest`. If you do need to perform both of these operations, you - need to provide two separate `WriteRequest` objects. - """ - - put_request: "PutRequest | None" = None - """A request to perform a `PutItem` operation.""" - - delete_request: "DeleteRequest | None" = None - """A request to perform a `DeleteItem` operation.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_WRITE_REQUEST, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.put_request is not None: - serializer.write_struct( - _SCHEMA_WRITE_REQUEST.members["PutRequest"], self.put_request - ) - - if self.delete_request is not None: - serializer.write_struct( - _SCHEMA_WRITE_REQUEST.members["DeleteRequest"], self.delete_request - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["put_request"] = PutRequest.deserialize(de) - - case 1: - kwargs["delete_request"] = DeleteRequest.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_WRITE_REQUEST, consumer=_consumer) - return kwargs - - -def _serialize_parti_ql_batch_response( - serializer: ShapeSerializer, schema: Schema, value: list[BatchStatementResponse] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_parti_ql_batch_response( - deserializer: ShapeDeserializer, schema: Schema -) -> list[BatchStatementResponse]: - result: list[BatchStatementResponse] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(BatchStatementResponse.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -EXPORT_TABLE_TO_POINT_IN_TIME = APIOperation( - input=ExportTableToPointInTimeInput, - output=ExportTableToPointInTimeOutput, - schema=_SCHEMA_EXPORT_TABLE_TO_POINT_IN_TIME, - input_schema=_SCHEMA_EXPORT_TABLE_TO_POINT_IN_TIME_INPUT, - output_schema=_SCHEMA_EXPORT_TABLE_TO_POINT_IN_TIME_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.dynamodb#ExportConflictException" - ): ExportConflictException, - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#InvalidExportTimeException" - ): InvalidExportTimeException, - ShapeID( - "com.amazonaws.dynamodb#LimitExceededException" - ): LimitExceededException, - ShapeID( - "com.amazonaws.dynamodb#PointInTimeRecoveryUnavailableException" - ): PointInTimeRecoveryUnavailableException, - ShapeID( - "com.amazonaws.dynamodb#TableNotFoundException" - ): TableNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_EXPORT_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR, - _SCHEMA_INVALID_EXPORT_TIME_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_POINT_IN_TIME_RECOVERY_UNAVAILABLE_EXCEPTION, - _SCHEMA_TABLE_NOT_FOUND_EXCEPTION, - ], -) - - -def _serialize_write_requests( - serializer: ShapeSerializer, schema: Schema, value: list[WriteRequest] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_write_requests( - deserializer: ShapeDeserializer, schema: Schema -) -> list[WriteRequest]: - result: list[WriteRequest] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(WriteRequest.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class BatchExecuteStatementOutput: - """Dataclass for BatchExecuteStatementOutput structure.""" - - responses: "list[BatchStatementResponse] | None" = None - """ - The response to each PartiQL statement in the batch. The values of the - list are ordered according to the ordering of the request statements. - """ - - consumed_capacity: list[ConsumedCapacity] | None = None - """ - The capacity units consumed by the entire operation. The values of the - list are ordered according to the ordering of the statements. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BATCH_EXECUTE_STATEMENT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.responses is not None: - _serialize_parti_ql_batch_response( - serializer, - _SCHEMA_BATCH_EXECUTE_STATEMENT_OUTPUT.members["Responses"], - self.responses, - ) - - if self.consumed_capacity is not None: - _serialize_consumed_capacity_multiple( - serializer, - _SCHEMA_BATCH_EXECUTE_STATEMENT_OUTPUT.members["ConsumedCapacity"], - self.consumed_capacity, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["responses"] = _deserialize_parti_ql_batch_response( - de, _SCHEMA_BATCH_EXECUTE_STATEMENT_OUTPUT.members["Responses"] - ) - - case 1: - kwargs["consumed_capacity"] = ( - _deserialize_consumed_capacity_multiple( - de, - _SCHEMA_BATCH_EXECUTE_STATEMENT_OUTPUT.members[ - "ConsumedCapacity" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_BATCH_EXECUTE_STATEMENT_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class BatchGetItemOutput: - """Represents the output of a `BatchGetItem` operation.""" - - responses: "dict[str, list[dict[str, AttributeValue]]] | None" = None - """ - A map of table name or table ARN to a list of items. Each object in - `Responses` consists of a table name or ARN, along with a map of - attribute data consisting of the data type and attribute value. - """ - - unprocessed_keys: "dict[str, KeysAndAttributes] | None" = None - """ - A map of tables and their respective keys that were not processed with - the current response. The `UnprocessedKeys` value is in the same form as - `RequestItems`, so the value can be provided directly to a subsequent - `BatchGetItem` operation. For more information, see `RequestItems` in - the Request Parameters section. - - Each element consists of: - - - `Keys` - An array of primary key attribute values that define specific - items in the table. - - - `ProjectionExpression` - One or more attributes to be retrieved from - the table or index. By default, all attributes are returned. If a - requested attribute is not found, it does not appear in the result. - - - `ConsistentRead` - The consistency of a read operation. If set to - `true`, then a strongly consistent read is used; otherwise, an - eventually consistent read is used. - - If there are no unprocessed keys remaining, the response contains an - empty `UnprocessedKeys` map. - """ - - consumed_capacity: list[ConsumedCapacity] | None = None - """ - The read capacity units consumed by the entire `BatchGetItem` operation. - - Each element consists of: - - - `TableName` - The table that consumed the provisioned throughput. - - - `CapacityUnits` - The total number of capacity units consumed. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BATCH_GET_ITEM_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.responses is not None: - _serialize_batch_get_response_map( - serializer, - _SCHEMA_BATCH_GET_ITEM_OUTPUT.members["Responses"], - self.responses, - ) - - if self.unprocessed_keys is not None: - _serialize_batch_get_request_map( - serializer, - _SCHEMA_BATCH_GET_ITEM_OUTPUT.members["UnprocessedKeys"], - self.unprocessed_keys, - ) - - if self.consumed_capacity is not None: - _serialize_consumed_capacity_multiple( - serializer, - _SCHEMA_BATCH_GET_ITEM_OUTPUT.members["ConsumedCapacity"], - self.consumed_capacity, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["responses"] = _deserialize_batch_get_response_map( - de, _SCHEMA_BATCH_GET_ITEM_OUTPUT.members["Responses"] - ) - - case 1: - kwargs["unprocessed_keys"] = _deserialize_batch_get_request_map( - de, _SCHEMA_BATCH_GET_ITEM_OUTPUT.members["UnprocessedKeys"] - ) - - case 2: - kwargs["consumed_capacity"] = ( - _deserialize_consumed_capacity_multiple( - de, - _SCHEMA_BATCH_GET_ITEM_OUTPUT.members["ConsumedCapacity"], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BATCH_GET_ITEM_OUTPUT, consumer=_consumer) - return kwargs - - -def _serialize_batch_write_item_request_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, list[WriteRequest]] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: _serialize_write_requests(vs, value_schema, v)) - - -def _deserialize_batch_write_item_request_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, list[WriteRequest]]: - result: dict[str, list[WriteRequest]] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = _deserialize_write_requests(d, value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ScanInput: - """Represents the input of a `Scan` operation.""" - - table_name: str | None = None - """ - The name of the table containing the requested items or if you provide - `IndexName`, the name of the table to which that index belongs. - - You can also provide the Amazon Resource Name (ARN) of the table in this - parameter. - """ - - index_name: str | None = None - """ - The name of a secondary index to scan. This index can be any local - secondary index or global secondary index. Note that if you use the - `IndexName` parameter, you must also provide `TableName`. - """ - - attributes_to_get: list[str] | None = None - """ - This is a legacy parameter. Use `ProjectionExpression` instead. For more - information, see - [AttributesToGet](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.AttributesToGet.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - limit: int | None = None - """ - The maximum number of items to evaluate (not necessarily the number of - matching items). If DynamoDB processes the number of items up to the - limit while processing the results, it stops the operation and returns - the matching values up to that point, and a key in `LastEvaluatedKey` to - apply in a subsequent operation, so that you can pick up where you left - off. Also, if the processed dataset size exceeds 1 MB before DynamoDB - reaches this limit, it stops the operation and returns the matching - values up to the limit, and a key in `LastEvaluatedKey` to apply in a - subsequent operation to continue the operation. For more information, - see [Working with - Queries](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - select: str | None = None - """ - The attributes to be returned in the result. You can retrieve all item - attributes, specific item attributes, the count of matching items, or in - the case of an index, some or all of the attributes projected into the - index. - - - `ALL_ATTRIBUTES` - Returns all of the item attributes from the - specified table or index. If you query a local secondary index, then - for each matching item in the index, DynamoDB fetches the entire item - from the parent table. If the index is configured to project all item - attributes, then all of the data can be obtained from the local - secondary index, and no fetching is required. - - - `ALL_PROJECTED_ATTRIBUTES` - Allowed only when querying an index. - Retrieves all attributes that have been projected into the index. If - the index is configured to project all attributes, this return value - is equivalent to specifying `ALL_ATTRIBUTES`. - - - `COUNT` - Returns the number of matching items, rather than the - matching items themselves. Note that this uses the same quantity of - read capacity units as getting the items, and is subject to the same - item size calculations. - - - `SPECIFIC_ATTRIBUTES` - Returns only the attributes listed in - `ProjectionExpression`. This return value is equivalent to specifying - `ProjectionExpression` without specifying any value for `Select`. - - If you query or scan a local secondary index and request only - attributes that are projected into that index, the operation reads - only the index and not the table. If any of the requested attributes - are not projected into the local secondary index, DynamoDB fetches - each of these attributes from the parent table. This extra fetching - incurs additional throughput cost and latency. - - If you query or scan a global secondary index, you can only request - attributes that are projected into the index. Global secondary index - queries cannot fetch attributes from the parent table. - - If neither `Select` nor `ProjectionExpression` are specified, DynamoDB - defaults to `ALL_ATTRIBUTES` when accessing a table, and - `ALL_PROJECTED_ATTRIBUTES` when accessing an index. You cannot use both - `Select` and `ProjectionExpression` together in a single request, unless - the value for `Select` is `SPECIFIC_ATTRIBUTES`. (This usage is - equivalent to specifying `ProjectionExpression` without any value for - `Select`.) - - Note: - If you use the `ProjectionExpression` parameter, then the value for - `Select` can only be `SPECIFIC_ATTRIBUTES`. Any other value for `Select` - will return an error. - """ - - scan_filter: "dict[str, Condition] | None" = None - """ - This is a legacy parameter. Use `FilterExpression` instead. For more - information, see - [ScanFilter](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.ScanFilter.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - conditional_operator: str | None = None - """ - This is a legacy parameter. Use `FilterExpression` instead. For more - information, see - [ConditionalOperator](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.ConditionalOperator.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - exclusive_start_key: "dict[str, AttributeValue] | None" = None - """ - The primary key of the first item that this operation will evaluate. Use - the value that was returned for `LastEvaluatedKey` in the previous - operation. - - The data type for `ExclusiveStartKey` must be String, Number or Binary. - No set data types are allowed. - - In a parallel scan, a `Scan` request that includes `ExclusiveStartKey` - must specify the same segment whose previous `Scan` returned the - corresponding value of `LastEvaluatedKey`. - """ - - return_consumed_capacity: str | None = None - """ - Determines the level of detail about either provisioned or on-demand - throughput consumption that is returned in the response: - - - `INDEXES` - The response includes the aggregate `ConsumedCapacity` for - the operation, together with `ConsumedCapacity` for each table and - secondary index that was accessed. - - Note that some operations, such as `GetItem` and `BatchGetItem`, do - not access any indexes at all. In these cases, specifying `INDEXES` - will only return `ConsumedCapacity` information for table(s). - - - `TOTAL` - The response includes only the aggregate `ConsumedCapacity` - for the operation. - - - `NONE` - No `ConsumedCapacity` details are included in the response. - """ - - total_segments: int | None = None - """ - For a parallel `Scan` request, `TotalSegments` represents the total - number of segments into which the `Scan` operation will be divided. The - value of `TotalSegments` corresponds to the number of application - workers that will perform the parallel scan. For example, if you want to - use four application threads to scan a table or an index, specify a - `TotalSegments` value of 4. - - The value for `TotalSegments` must be greater than or equal to 1, and - less than or equal to 1000000. If you specify a `TotalSegments` value of - 1, the `Scan` operation will be sequential rather than parallel. - - If you specify `TotalSegments`, you must also specify `Segment`. - """ - - segment: int | None = None - """ - For a parallel `Scan` request, `Segment` identifies an individual - segment to be scanned by an application worker. - - Segment IDs are zero-based, so the first segment is always 0. For - example, if you want to use four application threads to scan a table or - an index, then the first thread specifies a `Segment` value of 0, the - second thread specifies 1, and so on. - - The value of `LastEvaluatedKey` returned from a parallel `Scan` request - must be used as `ExclusiveStartKey` with the same segment ID in a - subsequent `Scan` operation. - - The value for `Segment` must be greater than or equal to 0, and less - than the value provided for `TotalSegments`. - - If you provide `Segment`, you must also provide `TotalSegments`. - """ - - projection_expression: str | None = None - """ - A string that identifies one or more attributes to retrieve from the - specified table or index. These attributes can include scalars, sets, or - elements of a JSON document. The attributes in the expression must be - separated by commas. - - If no attribute names are specified, then all attributes will be - returned. If any of the requested attributes are not found, they will - not appear in the result. - - For more information, see [Specifying Item - Attributes](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - filter_expression: str | None = None - """ - A string that contains conditions that DynamoDB applies after the `Scan` - operation, but before the data is returned to you. Items that do not - satisfy the `FilterExpression` criteria are not returned. - - Note: - A `FilterExpression` is applied after the items have already been read; - the process of filtering does not consume any additional read capacity - units. - - For more information, see [Filter - Expressions](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Scan.html#Scan.FilterExpression) - in the *Amazon DynamoDB Developer Guide*. - """ - - expression_attribute_names: dict[str, str] | None = None - """ - One or more substitution tokens for attribute names in an expression. - The following are some use cases for using `ExpressionAttributeNames`: - - - To access an attribute whose name conflicts with a DynamoDB reserved - word. - - - To create a placeholder for repeating occurrences of an attribute name - in an expression. - - - To prevent special characters in an attribute name from being - misinterpreted in an expression. - - Use the **#** character in an expression to dereference an attribute - name. For example, consider the following attribute name: - - - `Percentile` - - The name of this attribute conflicts with a reserved word, so it cannot - be used directly in an expression. (For the complete list of reserved - words, see [Reserved - Words](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html) - in the *Amazon DynamoDB Developer Guide*). To work around this, you - could specify the following for `ExpressionAttributeNames`: - - - `{"#P":"Percentile"}` - - You could then use this substitution in an expression, as in this - example: - - - `#P = :val` - - Note: - Tokens that begin with the **:** character are *expression attribute - values*, which are placeholders for the actual value at runtime. - - For more information on expression attribute names, see [Specifying Item - Attributes](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - expression_attribute_values: "dict[str, AttributeValue] | None" = None - """ - One or more values that can be substituted in an expression. - - Use the **:** (colon) character in an expression to dereference an - attribute value. For example, suppose that you wanted to check whether - the value of the `ProductStatus` attribute was one of the following: - - `Available | Backordered | Discontinued` - - You would first need to specify `ExpressionAttributeValues` as follows: - - `{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }` - - You could then use these values in an expression, such as this: - - `ProductStatus IN (:avail, :back, :disc)` - - For more information on expression attribute values, see [Condition - Expressions](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - consistent_read: bool | None = None - """ - A Boolean value that determines the read consistency model during the - scan: - - - If `ConsistentRead` is `false`, then the data returned from `Scan` - might not contain the results from other recently completed write - operations (`PutItem`, `UpdateItem`, or `DeleteItem`). - - - If `ConsistentRead` is `true`, then all of the write operations that - completed before the `Scan` began are guaranteed to be contained in - the `Scan` response. - - The default setting for `ConsistentRead` is `false`. - - The `ConsistentRead` parameter is not supported on global secondary - indexes. If you scan a global secondary index with `ConsistentRead` set - to true, you will receive a `ValidationException`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SCAN_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.table_name is not None: - serializer.write_string( - _SCHEMA_SCAN_INPUT.members["TableName"], self.table_name - ) - - if self.index_name is not None: - serializer.write_string( - _SCHEMA_SCAN_INPUT.members["IndexName"], self.index_name - ) - - if self.attributes_to_get is not None: - _serialize_attribute_name_list( - serializer, - _SCHEMA_SCAN_INPUT.members["AttributesToGet"], - self.attributes_to_get, - ) - - if self.limit is not None: - serializer.write_integer(_SCHEMA_SCAN_INPUT.members["Limit"], self.limit) - - if self.select is not None: - serializer.write_string(_SCHEMA_SCAN_INPUT.members["Select"], self.select) - - if self.scan_filter is not None: - _serialize_filter_condition_map( - serializer, _SCHEMA_SCAN_INPUT.members["ScanFilter"], self.scan_filter - ) - - if self.conditional_operator is not None: - serializer.write_string( - _SCHEMA_SCAN_INPUT.members["ConditionalOperator"], - self.conditional_operator, - ) - - if self.exclusive_start_key is not None: - _serialize_key( - serializer, - _SCHEMA_SCAN_INPUT.members["ExclusiveStartKey"], - self.exclusive_start_key, - ) - - if self.return_consumed_capacity is not None: - serializer.write_string( - _SCHEMA_SCAN_INPUT.members["ReturnConsumedCapacity"], - self.return_consumed_capacity, - ) - - if self.total_segments is not None: - serializer.write_integer( - _SCHEMA_SCAN_INPUT.members["TotalSegments"], self.total_segments - ) - - if self.segment is not None: - serializer.write_integer( - _SCHEMA_SCAN_INPUT.members["Segment"], self.segment - ) - - if self.projection_expression is not None: - serializer.write_string( - _SCHEMA_SCAN_INPUT.members["ProjectionExpression"], - self.projection_expression, - ) - - if self.filter_expression is not None: - serializer.write_string( - _SCHEMA_SCAN_INPUT.members["FilterExpression"], self.filter_expression - ) - - if self.expression_attribute_names is not None: - _serialize_expression_attribute_name_map( - serializer, - _SCHEMA_SCAN_INPUT.members["ExpressionAttributeNames"], - self.expression_attribute_names, - ) - - if self.expression_attribute_values is not None: - _serialize_expression_attribute_value_map( - serializer, - _SCHEMA_SCAN_INPUT.members["ExpressionAttributeValues"], - self.expression_attribute_values, - ) - - if self.consistent_read is not None: - serializer.write_boolean( - _SCHEMA_SCAN_INPUT.members["ConsistentRead"], self.consistent_read - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["table_name"] = de.read_string( - _SCHEMA_SCAN_INPUT.members["TableName"] - ) - - case 1: - kwargs["index_name"] = de.read_string( - _SCHEMA_SCAN_INPUT.members["IndexName"] - ) - - case 2: - kwargs["attributes_to_get"] = _deserialize_attribute_name_list( - de, _SCHEMA_SCAN_INPUT.members["AttributesToGet"] - ) - - case 3: - kwargs["limit"] = de.read_integer( - _SCHEMA_SCAN_INPUT.members["Limit"] - ) - - case 4: - kwargs["select"] = Select( - de.read_string(_SCHEMA_SCAN_INPUT.members["Select"]) - ) - - case 5: - kwargs["scan_filter"] = _deserialize_filter_condition_map( - de, _SCHEMA_SCAN_INPUT.members["ScanFilter"] - ) - - case 6: - kwargs["conditional_operator"] = ConditionalOperator( - de.read_string( - _SCHEMA_SCAN_INPUT.members["ConditionalOperator"] - ) - ) - - case 7: - kwargs["exclusive_start_key"] = _deserialize_key( - de, _SCHEMA_SCAN_INPUT.members["ExclusiveStartKey"] - ) - - case 8: - kwargs["return_consumed_capacity"] = ReturnConsumedCapacity( - de.read_string( - _SCHEMA_SCAN_INPUT.members["ReturnConsumedCapacity"] - ) - ) - - case 9: - kwargs["total_segments"] = de.read_integer( - _SCHEMA_SCAN_INPUT.members["TotalSegments"] - ) - - case 10: - kwargs["segment"] = de.read_integer( - _SCHEMA_SCAN_INPUT.members["Segment"] - ) - - case 11: - kwargs["projection_expression"] = de.read_string( - _SCHEMA_SCAN_INPUT.members["ProjectionExpression"] - ) - - case 12: - kwargs["filter_expression"] = de.read_string( - _SCHEMA_SCAN_INPUT.members["FilterExpression"] - ) - - case 13: - kwargs["expression_attribute_names"] = ( - _deserialize_expression_attribute_name_map( - de, _SCHEMA_SCAN_INPUT.members["ExpressionAttributeNames"] - ) - ) - - case 14: - kwargs["expression_attribute_values"] = ( - _deserialize_expression_attribute_value_map( - de, _SCHEMA_SCAN_INPUT.members["ExpressionAttributeValues"] - ) - ) - - case 15: - kwargs["consistent_read"] = de.read_boolean( - _SCHEMA_SCAN_INPUT.members["ConsistentRead"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SCAN_INPUT, consumer=_consumer) - return kwargs - - -SEARCH_VECTORS = APIOperation( - input=SearchVectorsInput, - output=SearchVectorsOutput, - schema=_SCHEMA_SEARCH_VECTORS, - input_schema=_SCHEMA_SEARCH_VECTORS_INPUT, - output_schema=_SCHEMA_SEARCH_VECTORS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#RequestLimitExceeded" - ): RequestLimitExceeded, - ShapeID( - "com.amazonaws.dynamodb#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.dynamodb#ThrottlingException"): ThrottlingException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_SERVER_ERROR, - _SCHEMA_REQUEST_LIMIT_EXCEEDED, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class BatchWriteItemInput: - """Represents the input of a `BatchWriteItem` operation.""" - - request_items: "dict[str, list[WriteRequest]] | None" = None - """ - A map of one or more table names or table ARNs and, for each table, a - list of operations to be performed (`DeleteRequest` or `PutRequest`). - Each element in the map consists of the following: - - - `DeleteRequest` - Perform a `DeleteItem` operation on the specified - item. The item to be deleted is identified by a `Key` subelement: - - - `Key` - A map of primary key attribute values that uniquely identify - the item. Each entry in this map consists of an attribute name and - an attribute value. For each primary key, you must provide *all* of - the key attributes. For example, with a simple primary key, you only - need to provide a value for the partition key. For a composite - primary key, you must provide values for *both* the partition key - and the sort key. - - - `PutRequest` - Perform a `PutItem` operation on the specified item. - The item to be put is identified by an `Item` subelement: - - - `Item` - A map of attributes and their values. Each entry in this - map consists of an attribute name and an attribute value. Attribute - values must not be null; string and binary type attributes must have - lengths greater than zero; and set type attributes must not be - empty. Requests that contain empty values are rejected with a - `ValidationException` exception. - - If you specify any attributes that are part of an index key, then - the data types for those attributes must match those of the schema - in the table's attribute definition. - """ - - return_consumed_capacity: str | None = None - """ - Determines the level of detail about either provisioned or on-demand - throughput consumption that is returned in the response: - - - `INDEXES` - The response includes the aggregate `ConsumedCapacity` for - the operation, together with `ConsumedCapacity` for each table and - secondary index that was accessed. - - Note that some operations, such as `GetItem` and `BatchGetItem`, do - not access any indexes at all. In these cases, specifying `INDEXES` - will only return `ConsumedCapacity` information for table(s). - - - `TOTAL` - The response includes only the aggregate `ConsumedCapacity` - for the operation. - - - `NONE` - No `ConsumedCapacity` details are included in the response. - """ - - return_item_collection_metrics: str | None = None - """ - Determines whether item collection metrics are returned. If set to - `SIZE`, the response includes statistics about item collections, if any, - that were modified during the operation are returned in the response. If - set to `NONE` (the default), no statistics are returned. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BATCH_WRITE_ITEM_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.request_items is not None: - _serialize_batch_write_item_request_map( - serializer, - _SCHEMA_BATCH_WRITE_ITEM_INPUT.members["RequestItems"], - self.request_items, - ) - - if self.return_consumed_capacity is not None: - serializer.write_string( - _SCHEMA_BATCH_WRITE_ITEM_INPUT.members["ReturnConsumedCapacity"], - self.return_consumed_capacity, - ) - - if self.return_item_collection_metrics is not None: - serializer.write_string( - _SCHEMA_BATCH_WRITE_ITEM_INPUT.members["ReturnItemCollectionMetrics"], - self.return_item_collection_metrics, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["request_items"] = _deserialize_batch_write_item_request_map( - de, _SCHEMA_BATCH_WRITE_ITEM_INPUT.members["RequestItems"] - ) - - case 1: - kwargs["return_consumed_capacity"] = ReturnConsumedCapacity( - de.read_string( - _SCHEMA_BATCH_WRITE_ITEM_INPUT.members[ - "ReturnConsumedCapacity" - ] - ) - ) - - case 2: - kwargs["return_item_collection_metrics"] = ( - ReturnItemCollectionMetrics( - de.read_string( - _SCHEMA_BATCH_WRITE_ITEM_INPUT.members[ - "ReturnItemCollectionMetrics" - ] - ) - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BATCH_WRITE_ITEM_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteItemInput: - """Represents the input of a `DeleteItem` operation.""" - - table_name: str | None = None - """ - The name of the table from which to delete the item. You can also - provide the Amazon Resource Name (ARN) of the table in this parameter. - """ - - key: "dict[str, AttributeValue] | None" = None - """ - A map of attribute names to `AttributeValue` objects, representing the - primary key of the item to delete. - - For the primary key, you must provide all of the key attributes. For - example, with a simple primary key, you only need to provide a value for - the partition key. For a composite primary key, you must provide values - for both the partition key and the sort key. - """ - - expected: "dict[str, ExpectedAttributeValue] | None" = None - """ - This is a legacy parameter. Use `ConditionExpression` instead. For more - information, see - [Expected](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.Expected.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - conditional_operator: str | None = None - """ - This is a legacy parameter. Use `ConditionExpression` instead. For more - information, see - [ConditionalOperator](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.ConditionalOperator.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - return_values: str | None = None - """ - Use `ReturnValues` if you want to get the item attributes as they - appeared before they were deleted. For `DeleteItem`, the valid values - are: - - - `NONE` - If `ReturnValues` is not specified, or if its value is - `NONE`, then nothing is returned. (This setting is the default for - `ReturnValues`.) - - - `ALL_OLD` - The content of the old item is returned. - - There is no additional cost associated with requesting a return value - aside from the small network and processing overhead of receiving a - larger response. No read capacity units are consumed. - - Note: - The `ReturnValues` parameter is used by several DynamoDB operations; - however, `DeleteItem` does not recognize any values other than `NONE` or - `ALL_OLD`. - """ - - return_consumed_capacity: str | None = None - """ - Determines the level of detail about either provisioned or on-demand - throughput consumption that is returned in the response: - - - `INDEXES` - The response includes the aggregate `ConsumedCapacity` for - the operation, together with `ConsumedCapacity` for each table and - secondary index that was accessed. - - Note that some operations, such as `GetItem` and `BatchGetItem`, do - not access any indexes at all. In these cases, specifying `INDEXES` - will only return `ConsumedCapacity` information for table(s). - - - `TOTAL` - The response includes only the aggregate `ConsumedCapacity` - for the operation. - - - `NONE` - No `ConsumedCapacity` details are included in the response. - """ - - return_item_collection_metrics: str | None = None - """ - Determines whether item collection metrics are returned. If set to - `SIZE`, the response includes statistics about item collections, if any, - that were modified during the operation are returned in the response. If - set to `NONE` (the default), no statistics are returned. - """ - - condition_expression: str | None = None - """ - A condition that must be satisfied in order for a conditional - `DeleteItem` to succeed. - - An expression can contain any of the following: - - - Functions: - `attribute_exists | attribute_not_exists | attribute_type | contains | begins_with | size` - - These function names are case-sensitive. - - - Comparison operators: `= | <> | < | > | <= | >= | BETWEEN | IN ` - - - Logical operators: `AND | OR | NOT` - - For more information about condition expressions, see [Condition - Expressions](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - expression_attribute_names: dict[str, str] | None = None - """ - One or more substitution tokens for attribute names in an expression. - The following are some use cases for using `ExpressionAttributeNames`: - - - To access an attribute whose name conflicts with a DynamoDB reserved - word. - - - To create a placeholder for repeating occurrences of an attribute name - in an expression. - - - To prevent special characters in an attribute name from being - misinterpreted in an expression. - - Use the **#** character in an expression to dereference an attribute - name. For example, consider the following attribute name: - - - `Percentile` - - The name of this attribute conflicts with a reserved word, so it cannot - be used directly in an expression. (For the complete list of reserved - words, see [Reserved - Words](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html) - in the *Amazon DynamoDB Developer Guide*). To work around this, you - could specify the following for `ExpressionAttributeNames`: - - - `{"#P":"Percentile"}` - - You could then use this substitution in an expression, as in this - example: - - - `#P = :val` - - Note: - Tokens that begin with the **:** character are *expression attribute - values*, which are placeholders for the actual value at runtime. - - For more information on expression attribute names, see [Specifying Item - Attributes](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - expression_attribute_values: "dict[str, AttributeValue] | None" = None - """ - One or more values that can be substituted in an expression. - - Use the **:** (colon) character in an expression to dereference an - attribute value. For example, suppose that you wanted to check whether - the value of the *ProductStatus* attribute was one of the following: - - `Available | Backordered | Discontinued` - - You would first need to specify `ExpressionAttributeValues` as follows: - - `{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }` - - You could then use these values in an expression, such as this: - - `ProductStatus IN (:avail, :back, :disc)` - - For more information on expression attribute values, see [Condition - Expressions](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - return_values_on_condition_check_failure: str | None = None - """ - An optional parameter that returns the item attributes for a - `DeleteItem` operation that failed a condition check. - - There is no additional cost associated with requesting a return value - aside from the small network and processing overhead of receiving a - larger response. No read capacity units are consumed. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_ITEM_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.table_name is not None: - serializer.write_string( - _SCHEMA_DELETE_ITEM_INPUT.members["TableName"], self.table_name - ) - - if self.key is not None: - _serialize_key( - serializer, _SCHEMA_DELETE_ITEM_INPUT.members["Key"], self.key - ) - - if self.expected is not None: - _serialize_expected_attribute_map( - serializer, _SCHEMA_DELETE_ITEM_INPUT.members["Expected"], self.expected - ) - - if self.conditional_operator is not None: - serializer.write_string( - _SCHEMA_DELETE_ITEM_INPUT.members["ConditionalOperator"], - self.conditional_operator, - ) - - if self.return_values is not None: - serializer.write_string( - _SCHEMA_DELETE_ITEM_INPUT.members["ReturnValues"], self.return_values - ) - - if self.return_consumed_capacity is not None: - serializer.write_string( - _SCHEMA_DELETE_ITEM_INPUT.members["ReturnConsumedCapacity"], - self.return_consumed_capacity, - ) - - if self.return_item_collection_metrics is not None: - serializer.write_string( - _SCHEMA_DELETE_ITEM_INPUT.members["ReturnItemCollectionMetrics"], - self.return_item_collection_metrics, - ) - - if self.condition_expression is not None: - serializer.write_string( - _SCHEMA_DELETE_ITEM_INPUT.members["ConditionExpression"], - self.condition_expression, - ) - - if self.expression_attribute_names is not None: - _serialize_expression_attribute_name_map( - serializer, - _SCHEMA_DELETE_ITEM_INPUT.members["ExpressionAttributeNames"], - self.expression_attribute_names, - ) - - if self.expression_attribute_values is not None: - _serialize_expression_attribute_value_map( - serializer, - _SCHEMA_DELETE_ITEM_INPUT.members["ExpressionAttributeValues"], - self.expression_attribute_values, - ) - - if self.return_values_on_condition_check_failure is not None: - serializer.write_string( - _SCHEMA_DELETE_ITEM_INPUT.members[ - "ReturnValuesOnConditionCheckFailure" - ], - self.return_values_on_condition_check_failure, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["table_name"] = de.read_string( - _SCHEMA_DELETE_ITEM_INPUT.members["TableName"] - ) - - case 1: - kwargs["key"] = _deserialize_key( - de, _SCHEMA_DELETE_ITEM_INPUT.members["Key"] - ) - - case 2: - kwargs["expected"] = _deserialize_expected_attribute_map( - de, _SCHEMA_DELETE_ITEM_INPUT.members["Expected"] - ) - - case 3: - kwargs["conditional_operator"] = ConditionalOperator( - de.read_string( - _SCHEMA_DELETE_ITEM_INPUT.members["ConditionalOperator"] - ) - ) - - case 4: - kwargs["return_values"] = ReturnValue( - de.read_string( - _SCHEMA_DELETE_ITEM_INPUT.members["ReturnValues"] - ) - ) - - case 5: - kwargs["return_consumed_capacity"] = ReturnConsumedCapacity( - de.read_string( - _SCHEMA_DELETE_ITEM_INPUT.members["ReturnConsumedCapacity"] - ) - ) - - case 6: - kwargs["return_item_collection_metrics"] = ( - ReturnItemCollectionMetrics( - de.read_string( - _SCHEMA_DELETE_ITEM_INPUT.members[ - "ReturnItemCollectionMetrics" - ] - ) - ) - ) - - case 7: - kwargs["condition_expression"] = de.read_string( - _SCHEMA_DELETE_ITEM_INPUT.members["ConditionExpression"] - ) - - case 8: - kwargs["expression_attribute_names"] = ( - _deserialize_expression_attribute_name_map( - de, - _SCHEMA_DELETE_ITEM_INPUT.members[ - "ExpressionAttributeNames" - ], - ) - ) - - case 9: - kwargs["expression_attribute_values"] = ( - _deserialize_expression_attribute_value_map( - de, - _SCHEMA_DELETE_ITEM_INPUT.members[ - "ExpressionAttributeValues" - ], - ) - ) - - case 10: - kwargs["return_values_on_condition_check_failure"] = ( - ReturnValuesOnConditionCheckFailure( - de.read_string( - _SCHEMA_DELETE_ITEM_INPUT.members[ - "ReturnValuesOnConditionCheckFailure" - ] - ) - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_ITEM_INPUT, consumer=_consumer) - return kwargs - - -EXECUTE_STATEMENT = APIOperation( - input=ExecuteStatementInput, - output=ExecuteStatementOutput, - schema=_SCHEMA_EXECUTE_STATEMENT, - input_schema=_SCHEMA_EXECUTE_STATEMENT_INPUT, - output_schema=_SCHEMA_EXECUTE_STATEMENT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.dynamodb#ConditionalCheckFailedException" - ): ConditionalCheckFailedException, - ShapeID( - "com.amazonaws.dynamodb#DuplicateItemException" - ): DuplicateItemException, - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#ItemCollectionSizeLimitExceededException" - ): ItemCollectionSizeLimitExceededException, - ShapeID( - "com.amazonaws.dynamodb#ProvisionedThroughputExceededException" - ): ProvisionedThroughputExceededException, - ShapeID( - "com.amazonaws.dynamodb#RequestLimitExceeded" - ): RequestLimitExceeded, - ShapeID( - "com.amazonaws.dynamodb#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.dynamodb#ThrottlingException"): ThrottlingException, - ShapeID( - "com.amazonaws.dynamodb#TransactionConflictException" - ): TransactionConflictException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CONDITIONAL_CHECK_FAILED_EXCEPTION, - _SCHEMA_DUPLICATE_ITEM_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR, - _SCHEMA_ITEM_COLLECTION_SIZE_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_PROVISIONED_THROUGHPUT_EXCEEDED_EXCEPTION, - _SCHEMA_REQUEST_LIMIT_EXCEEDED, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_TRANSACTION_CONFLICT_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class PutItemInput: - """Represents the input of a `PutItem` operation.""" - - table_name: str | None = None - """ - The name of the table to contain the item. You can also provide the - Amazon Resource Name (ARN) of the table in this parameter. - """ - - item: "dict[str, AttributeValue] | None" = None - """ - A map of attribute name/value pairs, one for each attribute. Only the - primary key attributes are required; you can optionally provide other - attribute name-value pairs for the item. - - You must provide all of the attributes for the primary key. For example, - with a simple primary key, you only need to provide a value for the - partition key. For a composite primary key, you must provide both values - for both the partition key and the sort key. - - If you specify any attributes that are part of an index key, then the - data types for those attributes must match those of the schema in the - table's attribute definition. - - If the table has vector indexes, the following validations apply to - write operations. A violation of any of these constraints results in a - `ValidationException`: - - - The vector attribute must be a list of numbers with dimensions - matching the index configuration. - - - Vector values must fit in 32-bit IEEE-754 floating point format (f32). - - - Partition key and inline filter attributes defined in the search - schema must have data types matching the index schema definition. - - Empty String and Binary attribute values are allowed. Attribute values - of type String and Binary must have a length greater than zero if the - attribute is used as a key attribute for a table or index. - - For more information about primary keys, see [Primary - Key](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.CoreComponents.html#HowItWorks.CoreComponents.PrimaryKey) - in the *Amazon DynamoDB Developer Guide*. - - Each element in the `Item` map is an `AttributeValue` object. - """ - - expected: "dict[str, ExpectedAttributeValue] | None" = None - """ - This is a legacy parameter. Use `ConditionExpression` instead. For more - information, see - [Expected](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.Expected.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - return_values: str | None = None - """ - Use `ReturnValues` if you want to get the item attributes as they - appeared before they were updated with the `PutItem` request. For - `PutItem`, the valid values are: - - - `NONE` - If `ReturnValues` is not specified, or if its value is - `NONE`, then nothing is returned. (This setting is the default for - `ReturnValues`.) - - - `ALL_OLD` - If `PutItem` overwrote an attribute name-value pair, then - the content of the old item is returned. - - The values returned are strongly consistent. - - There is no additional cost associated with requesting a return value - aside from the small network and processing overhead of receiving a - larger response. No read capacity units are consumed. - - Note: - The `ReturnValues` parameter is used by several DynamoDB operations; - however, `PutItem` does not recognize any values other than `NONE` or - `ALL_OLD`. - """ - - return_consumed_capacity: str | None = None - """ - Determines the level of detail about either provisioned or on-demand - throughput consumption that is returned in the response: - - - `INDEXES` - The response includes the aggregate `ConsumedCapacity` for - the operation, together with `ConsumedCapacity` for each table and - secondary index that was accessed. - - Note that some operations, such as `GetItem` and `BatchGetItem`, do - not access any indexes at all. In these cases, specifying `INDEXES` - will only return `ConsumedCapacity` information for table(s). - - - `TOTAL` - The response includes only the aggregate `ConsumedCapacity` - for the operation. - - - `NONE` - No `ConsumedCapacity` details are included in the response. - """ - - return_item_collection_metrics: str | None = None - """ - Determines whether item collection metrics are returned. If set to - `SIZE`, the response includes statistics about item collections, if any, - that were modified during the operation are returned in the response. If - set to `NONE` (the default), no statistics are returned. - """ - - conditional_operator: str | None = None - """ - This is a legacy parameter. Use `ConditionExpression` instead. For more - information, see - [ConditionalOperator](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.ConditionalOperator.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - condition_expression: str | None = None - """ - A condition that must be satisfied in order for a conditional `PutItem` - operation to succeed. - - An expression can contain any of the following: - - - Functions: - `attribute_exists | attribute_not_exists | attribute_type | contains | begins_with | size` - - These function names are case-sensitive. - - - Comparison operators: `= | <> | < | > | <= | >= | BETWEEN | IN ` - - - Logical operators: `AND | OR | NOT` - - For more information on condition expressions, see [Condition - Expressions](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - expression_attribute_names: dict[str, str] | None = None - """ - One or more substitution tokens for attribute names in an expression. - The following are some use cases for using `ExpressionAttributeNames`: - - - To access an attribute whose name conflicts with a DynamoDB reserved - word. - - - To create a placeholder for repeating occurrences of an attribute name - in an expression. - - - To prevent special characters in an attribute name from being - misinterpreted in an expression. - - Use the **#** character in an expression to dereference an attribute - name. For example, consider the following attribute name: - - - `Percentile` - - The name of this attribute conflicts with a reserved word, so it cannot - be used directly in an expression. (For the complete list of reserved - words, see [Reserved - Words](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html) - in the *Amazon DynamoDB Developer Guide*). To work around this, you - could specify the following for `ExpressionAttributeNames`: - - - `{"#P":"Percentile"}` - - You could then use this substitution in an expression, as in this - example: - - - `#P = :val` - - Note: - Tokens that begin with the **:** character are *expression attribute - values*, which are placeholders for the actual value at runtime. - - For more information on expression attribute names, see [Specifying Item - Attributes](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - expression_attribute_values: "dict[str, AttributeValue] | None" = None - """ - One or more values that can be substituted in an expression. - - Use the **:** (colon) character in an expression to dereference an - attribute value. For example, suppose that you wanted to check whether - the value of the *ProductStatus* attribute was one of the following: - - `Available | Backordered | Discontinued` - - You would first need to specify `ExpressionAttributeValues` as follows: - - `{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }` - - You could then use these values in an expression, such as this: - - `ProductStatus IN (:avail, :back, :disc)` - - For more information on expression attribute values, see [Condition - Expressions](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - return_values_on_condition_check_failure: str | None = None - """ - An optional parameter that returns the item attributes for a `PutItem` - operation that failed a condition check. - - There is no additional cost associated with requesting a return value - aside from the small network and processing overhead of receiving a - larger response. No read capacity units are consumed. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_ITEM_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.table_name is not None: - serializer.write_string( - _SCHEMA_PUT_ITEM_INPUT.members["TableName"], self.table_name - ) - - if self.item is not None: - _serialize_put_item_input_attribute_map( - serializer, _SCHEMA_PUT_ITEM_INPUT.members["Item"], self.item - ) - - if self.expected is not None: - _serialize_expected_attribute_map( - serializer, _SCHEMA_PUT_ITEM_INPUT.members["Expected"], self.expected - ) - - if self.return_values is not None: - serializer.write_string( - _SCHEMA_PUT_ITEM_INPUT.members["ReturnValues"], self.return_values - ) - - if self.return_consumed_capacity is not None: - serializer.write_string( - _SCHEMA_PUT_ITEM_INPUT.members["ReturnConsumedCapacity"], - self.return_consumed_capacity, - ) - - if self.return_item_collection_metrics is not None: - serializer.write_string( - _SCHEMA_PUT_ITEM_INPUT.members["ReturnItemCollectionMetrics"], - self.return_item_collection_metrics, - ) - - if self.conditional_operator is not None: - serializer.write_string( - _SCHEMA_PUT_ITEM_INPUT.members["ConditionalOperator"], - self.conditional_operator, - ) - - if self.condition_expression is not None: - serializer.write_string( - _SCHEMA_PUT_ITEM_INPUT.members["ConditionExpression"], - self.condition_expression, - ) - - if self.expression_attribute_names is not None: - _serialize_expression_attribute_name_map( - serializer, - _SCHEMA_PUT_ITEM_INPUT.members["ExpressionAttributeNames"], - self.expression_attribute_names, - ) - - if self.expression_attribute_values is not None: - _serialize_expression_attribute_value_map( - serializer, - _SCHEMA_PUT_ITEM_INPUT.members["ExpressionAttributeValues"], - self.expression_attribute_values, - ) - - if self.return_values_on_condition_check_failure is not None: - serializer.write_string( - _SCHEMA_PUT_ITEM_INPUT.members["ReturnValuesOnConditionCheckFailure"], - self.return_values_on_condition_check_failure, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["table_name"] = de.read_string( - _SCHEMA_PUT_ITEM_INPUT.members["TableName"] - ) - - case 1: - kwargs["item"] = _deserialize_put_item_input_attribute_map( - de, _SCHEMA_PUT_ITEM_INPUT.members["Item"] - ) - - case 2: - kwargs["expected"] = _deserialize_expected_attribute_map( - de, _SCHEMA_PUT_ITEM_INPUT.members["Expected"] - ) - - case 3: - kwargs["return_values"] = ReturnValue( - de.read_string(_SCHEMA_PUT_ITEM_INPUT.members["ReturnValues"]) - ) - - case 4: - kwargs["return_consumed_capacity"] = ReturnConsumedCapacity( - de.read_string( - _SCHEMA_PUT_ITEM_INPUT.members["ReturnConsumedCapacity"] - ) - ) - - case 5: - kwargs["return_item_collection_metrics"] = ( - ReturnItemCollectionMetrics( - de.read_string( - _SCHEMA_PUT_ITEM_INPUT.members[ - "ReturnItemCollectionMetrics" - ] - ) - ) - ) - - case 6: - kwargs["conditional_operator"] = ConditionalOperator( - de.read_string( - _SCHEMA_PUT_ITEM_INPUT.members["ConditionalOperator"] - ) - ) - - case 7: - kwargs["condition_expression"] = de.read_string( - _SCHEMA_PUT_ITEM_INPUT.members["ConditionExpression"] - ) - - case 8: - kwargs["expression_attribute_names"] = ( - _deserialize_expression_attribute_name_map( - de, - _SCHEMA_PUT_ITEM_INPUT.members["ExpressionAttributeNames"], - ) - ) - - case 9: - kwargs["expression_attribute_values"] = ( - _deserialize_expression_attribute_value_map( - de, - _SCHEMA_PUT_ITEM_INPUT.members["ExpressionAttributeValues"], - ) - ) - - case 10: - kwargs["return_values_on_condition_check_failure"] = ( - ReturnValuesOnConditionCheckFailure( - de.read_string( - _SCHEMA_PUT_ITEM_INPUT.members[ - "ReturnValuesOnConditionCheckFailure" - ] - ) - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUT_ITEM_INPUT, consumer=_consumer) - return kwargs - - -EXECUTE_TRANSACTION = APIOperation( - input=ExecuteTransactionInput, - output=ExecuteTransactionOutput, - schema=_SCHEMA_EXECUTE_TRANSACTION, - input_schema=_SCHEMA_EXECUTE_TRANSACTION_INPUT, - output_schema=_SCHEMA_EXECUTE_TRANSACTION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.dynamodb#IdempotentParameterMismatchException" - ): IdempotentParameterMismatchException, - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#ProvisionedThroughputExceededException" - ): ProvisionedThroughputExceededException, - ShapeID( - "com.amazonaws.dynamodb#RequestLimitExceeded" - ): RequestLimitExceeded, - ShapeID( - "com.amazonaws.dynamodb#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.dynamodb#ThrottlingException"): ThrottlingException, - ShapeID( - "com.amazonaws.dynamodb#TransactionCanceledException" - ): TransactionCanceledException, - ShapeID( - "com.amazonaws.dynamodb#TransactionInProgressException" - ): TransactionInProgressException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_IDEMPOTENT_PARAMETER_MISMATCH_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR, - _SCHEMA_PROVISIONED_THROUGHPUT_EXCEEDED_EXCEPTION, - _SCHEMA_REQUEST_LIMIT_EXCEEDED, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_TRANSACTION_CANCELED_EXCEPTION, - _SCHEMA_TRANSACTION_IN_PROGRESS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class QueryInput: - """Represents the input of a `Query` operation.""" - - table_name: str | None = None - """ - The name of the table containing the requested items. You can also - provide the Amazon Resource Name (ARN) of the table in this parameter. - """ - - index_name: str | None = None - """ - The name of an index to query. This index can be any local secondary - index or global secondary index on the table. Note that if you use the - `IndexName` parameter, you must also provide `TableName.` - """ - - select: str | None = None - """ - The attributes to be returned in the result. You can retrieve all item - attributes, specific item attributes, the count of matching items, or in - the case of an index, some or all of the attributes projected into the - index. - - - `ALL_ATTRIBUTES` - Returns all of the item attributes from the - specified table or index. If you query a local secondary index, then - for each matching item in the index, DynamoDB fetches the entire item - from the parent table. If the index is configured to project all item - attributes, then all of the data can be obtained from the local - secondary index, and no fetching is required. - - - `ALL_PROJECTED_ATTRIBUTES` - Allowed only when querying an index. - Retrieves all attributes that have been projected into the index. If - the index is configured to project all attributes, this return value - is equivalent to specifying `ALL_ATTRIBUTES`. - - - `COUNT` - Returns the number of matching items, rather than the - matching items themselves. Note that this uses the same quantity of - read capacity units as getting the items, and is subject to the same - item size calculations. - - - `SPECIFIC_ATTRIBUTES` - Returns only the attributes listed in - `ProjectionExpression`. This return value is equivalent to specifying - `ProjectionExpression` without specifying any value for `Select`. - - If you query or scan a local secondary index and request only - attributes that are projected into that index, the operation will read - only the index and not the table. If any of the requested attributes - are not projected into the local secondary index, DynamoDB fetches - each of these attributes from the parent table. This extra fetching - incurs additional throughput cost and latency. - - If you query or scan a global secondary index, you can only request - attributes that are projected into the index. Global secondary index - queries cannot fetch attributes from the parent table. - - If neither `Select` nor `ProjectionExpression` are specified, DynamoDB - defaults to `ALL_ATTRIBUTES` when accessing a table, and - `ALL_PROJECTED_ATTRIBUTES` when accessing an index. You cannot use both - `Select` and `ProjectionExpression` together in a single request, unless - the value for `Select` is `SPECIFIC_ATTRIBUTES`. (This usage is - equivalent to specifying `ProjectionExpression` without any value for - `Select`.) - - Note: - If you use the `ProjectionExpression` parameter, then the value for - `Select` can only be `SPECIFIC_ATTRIBUTES`. Any other value for `Select` - will return an error. - """ - - attributes_to_get: list[str] | None = None - """ - This is a legacy parameter. Use `ProjectionExpression` instead. For more - information, see - [AttributesToGet](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.AttributesToGet.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - limit: int | None = None - """ - The maximum number of items to evaluate (not necessarily the number of - matching items). If DynamoDB processes the number of items up to the - limit while processing the results, it stops the operation and returns - the matching values up to that point, and a key in `LastEvaluatedKey` to - apply in a subsequent operation, so that you can pick up where you left - off. Also, if the processed dataset size exceeds 1 MB before DynamoDB - reaches this limit, it stops the operation and returns the matching - values up to the limit, and a key in `LastEvaluatedKey` to apply in a - subsequent operation to continue the operation. For more information, - see [Query and - Scan](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - consistent_read: bool | None = None - """ - Determines the read consistency model: If set to `true`, then the - operation uses strongly consistent reads; otherwise, the operation uses - eventually consistent reads. - - Strongly consistent reads are not supported on global secondary indexes. - If you query a global secondary index with `ConsistentRead` set to - `true`, you will receive a `ValidationException`. - """ - - key_conditions: "dict[str, Condition] | None" = None - """ - This is a legacy parameter. Use `KeyConditionExpression` instead. For - more information, see - [KeyConditions](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.KeyConditions.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - query_filter: "dict[str, Condition] | None" = None - """ - This is a legacy parameter. Use `FilterExpression` instead. For more - information, see - [QueryFilter](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.QueryFilter.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - conditional_operator: str | None = None - """ - This is a legacy parameter. Use `FilterExpression` instead. For more - information, see - [ConditionalOperator](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.ConditionalOperator.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - scan_index_forward: bool | None = None - """ - Specifies the order for index traversal: If `true` (default), the - traversal is performed in ascending order; if `false`, the traversal is - performed in descending order. - - Items with the same partition key value are stored in sorted order by - sort key. If the sort key data type is Number, the results are stored in - numeric order. For type String, the results are stored in order of UTF-8 - bytes. For type Binary, DynamoDB treats each byte of the binary data as - unsigned. - - If `ScanIndexForward` is `true`, DynamoDB returns the results in the - order in which they are stored (by sort key value). This is the default - behavior. If `ScanIndexForward` is `false`, DynamoDB reads the results - in reverse order by sort key value, and then returns the results to the - client. - """ - - exclusive_start_key: "dict[str, AttributeValue] | None" = None - """ - The primary key of the first item that this operation will evaluate. Use - the value that was returned for `LastEvaluatedKey` in the previous - operation. - - The data type for `ExclusiveStartKey` must be String, Number, or Binary. - No set data types are allowed. - """ - - return_consumed_capacity: str | None = None - """ - Determines the level of detail about either provisioned or on-demand - throughput consumption that is returned in the response: - - - `INDEXES` - The response includes the aggregate `ConsumedCapacity` for - the operation, together with `ConsumedCapacity` for each table and - secondary index that was accessed. - - Note that some operations, such as `GetItem` and `BatchGetItem`, do - not access any indexes at all. In these cases, specifying `INDEXES` - will only return `ConsumedCapacity` information for table(s). - - - `TOTAL` - The response includes only the aggregate `ConsumedCapacity` - for the operation. - - - `NONE` - No `ConsumedCapacity` details are included in the response. - """ - - projection_expression: str | None = None - """ - A string that identifies one or more attributes to retrieve from the - table. These attributes can include scalars, sets, or elements of a JSON - document. The attributes in the expression must be separated by commas. - - If no attribute names are specified, then all attributes will be - returned. If any of the requested attributes are not found, they will - not appear in the result. - - For more information, see [Accessing Item - Attributes](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - filter_expression: str | None = None - """ - A string that contains conditions that DynamoDB applies after the - `Query` operation, but before the data is returned to you. Items that do - not satisfy the `FilterExpression` criteria are not returned. - - A `FilterExpression` does not allow key attributes. You cannot define a - filter expression based on a partition key or a sort key. - - Note: - A `FilterExpression` is applied after the items have already been read; - the process of filtering does not consume any additional read capacity - units. - - For more information, see [Filter - Expressions](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Query.FilterExpression.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - key_condition_expression: str | None = None - """ - The condition that specifies the key values for items to be retrieved by - the `Query` action. - - The condition must perform an equality test on a single partition key - value. - - The condition can optionally perform one of several comparison tests on - a single sort key value. This allows `Query` to retrieve one item with a - given partition key value and sort key value, or several items that have - the same partition key value but different sort key values. - - The partition key equality test is required, and must be specified in - the following format: - - `partitionKeyName` *=* `:partitionkeyval` - - If you also want to provide a condition for the sort key, it must be - combined using `AND` with the condition for the sort key. Following is - an example, using the **=** comparison operator for the sort key: - - `partitionKeyName` `=` `:partitionkeyval` `AND` `sortKeyName` `=` - `:sortkeyval` - - Valid comparisons for the sort key condition are as follows: - - - `sortKeyName` `=` `:sortkeyval` - true if the sort key value is equal - to `:sortkeyval`. - - - `sortKeyName` `<` `:sortkeyval` - true if the sort key value is less - than `:sortkeyval`. - - - `sortKeyName` `<=` `:sortkeyval` - true if the sort key value is less - than or equal to `:sortkeyval`. - - - `sortKeyName` `>` `:sortkeyval` - true if the sort key value is - greater than `:sortkeyval`. - - - `sortKeyName` `>= ` `:sortkeyval` - true if the sort key value is - greater than or equal to `:sortkeyval`. - - - `sortKeyName` `BETWEEN` `:sortkeyval1` `AND` `:sortkeyval2` - true if - the sort key value is greater than or equal to `:sortkeyval1`, and - less than or equal to `:sortkeyval2`. - - - `begins_with (` `sortKeyName`, `:sortkeyval` `)` - true if the sort - key value begins with a particular operand. (You cannot use this - function with a sort key that is of type Number.) Note that the - function name `begins_with` is case-sensitive. - - Use the `ExpressionAttributeValues` parameter to replace tokens such as - `:partitionval` and `:sortval` with actual values at runtime. - - You can optionally use the `ExpressionAttributeNames` parameter to - replace the names of the partition key and sort key with placeholder - tokens. This option might be necessary if an attribute name conflicts - with a DynamoDB reserved word. For example, the following - `KeyConditionExpression` parameter causes an error because *Size* is a - reserved word: - - - `Size = :myval` - - To work around this, define a placeholder (such a `#S`) to represent the - attribute name *Size*. `KeyConditionExpression` then is as follows: - - - `#S = :myval` - - For a list of reserved words, see [Reserved - Words](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html) - in the *Amazon DynamoDB Developer Guide*. - - For more information on `ExpressionAttributeNames` and - `ExpressionAttributeValues`, see [Using Placeholders for Attribute Names - and - Values](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ExpressionPlaceholders.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - expression_attribute_names: dict[str, str] | None = None - """ - One or more substitution tokens for attribute names in an expression. - The following are some use cases for using `ExpressionAttributeNames`: - - - To access an attribute whose name conflicts with a DynamoDB reserved - word. - - - To create a placeholder for repeating occurrences of an attribute name - in an expression. - - - To prevent special characters in an attribute name from being - misinterpreted in an expression. - - Use the **#** character in an expression to dereference an attribute - name. For example, consider the following attribute name: - - - `Percentile` - - The name of this attribute conflicts with a reserved word, so it cannot - be used directly in an expression. (For the complete list of reserved - words, see [Reserved - Words](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html) - in the *Amazon DynamoDB Developer Guide*). To work around this, you - could specify the following for `ExpressionAttributeNames`: - - - `{"#P":"Percentile"}` - - You could then use this substitution in an expression, as in this - example: - - - `#P = :val` - - Note: - Tokens that begin with the **:** character are *expression attribute - values*, which are placeholders for the actual value at runtime. - - For more information on expression attribute names, see [Specifying Item - Attributes](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - expression_attribute_values: "dict[str, AttributeValue] | None" = None - """ - One or more values that can be substituted in an expression. - - Use the **:** (colon) character in an expression to dereference an - attribute value. For example, suppose that you wanted to check whether - the value of the *ProductStatus* attribute was one of the following: - - `Available | Backordered | Discontinued` - - You would first need to specify `ExpressionAttributeValues` as follows: - - `{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }` - - You could then use these values in an expression, such as this: - - `ProductStatus IN (:avail, :back, :disc)` - - For more information on expression attribute values, see [Specifying - Conditions](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_QUERY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.table_name is not None: - serializer.write_string( - _SCHEMA_QUERY_INPUT.members["TableName"], self.table_name - ) - - if self.index_name is not None: - serializer.write_string( - _SCHEMA_QUERY_INPUT.members["IndexName"], self.index_name - ) - - if self.select is not None: - serializer.write_string(_SCHEMA_QUERY_INPUT.members["Select"], self.select) - - if self.attributes_to_get is not None: - _serialize_attribute_name_list( - serializer, - _SCHEMA_QUERY_INPUT.members["AttributesToGet"], - self.attributes_to_get, - ) - - if self.limit is not None: - serializer.write_integer(_SCHEMA_QUERY_INPUT.members["Limit"], self.limit) - - if self.consistent_read is not None: - serializer.write_boolean( - _SCHEMA_QUERY_INPUT.members["ConsistentRead"], self.consistent_read - ) - - if self.key_conditions is not None: - _serialize_key_conditions( - serializer, - _SCHEMA_QUERY_INPUT.members["KeyConditions"], - self.key_conditions, - ) - - if self.query_filter is not None: - _serialize_filter_condition_map( - serializer, - _SCHEMA_QUERY_INPUT.members["QueryFilter"], - self.query_filter, - ) - - if self.conditional_operator is not None: - serializer.write_string( - _SCHEMA_QUERY_INPUT.members["ConditionalOperator"], - self.conditional_operator, - ) - - if self.scan_index_forward is not None: - serializer.write_boolean( - _SCHEMA_QUERY_INPUT.members["ScanIndexForward"], self.scan_index_forward - ) - - if self.exclusive_start_key is not None: - _serialize_key( - serializer, - _SCHEMA_QUERY_INPUT.members["ExclusiveStartKey"], - self.exclusive_start_key, - ) - - if self.return_consumed_capacity is not None: - serializer.write_string( - _SCHEMA_QUERY_INPUT.members["ReturnConsumedCapacity"], - self.return_consumed_capacity, - ) - - if self.projection_expression is not None: - serializer.write_string( - _SCHEMA_QUERY_INPUT.members["ProjectionExpression"], - self.projection_expression, - ) - - if self.filter_expression is not None: - serializer.write_string( - _SCHEMA_QUERY_INPUT.members["FilterExpression"], self.filter_expression - ) - - if self.key_condition_expression is not None: - serializer.write_string( - _SCHEMA_QUERY_INPUT.members["KeyConditionExpression"], - self.key_condition_expression, - ) - - if self.expression_attribute_names is not None: - _serialize_expression_attribute_name_map( - serializer, - _SCHEMA_QUERY_INPUT.members["ExpressionAttributeNames"], - self.expression_attribute_names, - ) - - if self.expression_attribute_values is not None: - _serialize_expression_attribute_value_map( - serializer, - _SCHEMA_QUERY_INPUT.members["ExpressionAttributeValues"], - self.expression_attribute_values, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["table_name"] = de.read_string( - _SCHEMA_QUERY_INPUT.members["TableName"] - ) - - case 1: - kwargs["index_name"] = de.read_string( - _SCHEMA_QUERY_INPUT.members["IndexName"] - ) - - case 2: - kwargs["select"] = Select( - de.read_string(_SCHEMA_QUERY_INPUT.members["Select"]) - ) - - case 3: - kwargs["attributes_to_get"] = _deserialize_attribute_name_list( - de, _SCHEMA_QUERY_INPUT.members["AttributesToGet"] - ) - - case 4: - kwargs["limit"] = de.read_integer( - _SCHEMA_QUERY_INPUT.members["Limit"] - ) - - case 5: - kwargs["consistent_read"] = de.read_boolean( - _SCHEMA_QUERY_INPUT.members["ConsistentRead"] - ) - - case 6: - kwargs["key_conditions"] = _deserialize_key_conditions( - de, _SCHEMA_QUERY_INPUT.members["KeyConditions"] - ) - - case 7: - kwargs["query_filter"] = _deserialize_filter_condition_map( - de, _SCHEMA_QUERY_INPUT.members["QueryFilter"] - ) - - case 8: - kwargs["conditional_operator"] = ConditionalOperator( - de.read_string( - _SCHEMA_QUERY_INPUT.members["ConditionalOperator"] - ) - ) - - case 9: - kwargs["scan_index_forward"] = de.read_boolean( - _SCHEMA_QUERY_INPUT.members["ScanIndexForward"] - ) - - case 10: - kwargs["exclusive_start_key"] = _deserialize_key( - de, _SCHEMA_QUERY_INPUT.members["ExclusiveStartKey"] - ) - - case 11: - kwargs["return_consumed_capacity"] = ReturnConsumedCapacity( - de.read_string( - _SCHEMA_QUERY_INPUT.members["ReturnConsumedCapacity"] - ) - ) - - case 12: - kwargs["projection_expression"] = de.read_string( - _SCHEMA_QUERY_INPUT.members["ProjectionExpression"] - ) - - case 13: - kwargs["filter_expression"] = de.read_string( - _SCHEMA_QUERY_INPUT.members["FilterExpression"] - ) - - case 14: - kwargs["key_condition_expression"] = de.read_string( - _SCHEMA_QUERY_INPUT.members["KeyConditionExpression"] - ) - - case 15: - kwargs["expression_attribute_names"] = ( - _deserialize_expression_attribute_name_map( - de, _SCHEMA_QUERY_INPUT.members["ExpressionAttributeNames"] - ) - ) - - case 16: - kwargs["expression_attribute_values"] = ( - _deserialize_expression_attribute_value_map( - de, _SCHEMA_QUERY_INPUT.members["ExpressionAttributeValues"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_QUERY_INPUT, consumer=_consumer) - return kwargs - - -BATCH_EXECUTE_STATEMENT = APIOperation( - input=BatchExecuteStatementInput, - output=BatchExecuteStatementOutput, - schema=_SCHEMA_BATCH_EXECUTE_STATEMENT, - input_schema=_SCHEMA_BATCH_EXECUTE_STATEMENT_INPUT, - output_schema=_SCHEMA_BATCH_EXECUTE_STATEMENT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#RequestLimitExceeded" - ): RequestLimitExceeded, - ShapeID("com.amazonaws.dynamodb#ThrottlingException"): ThrottlingException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_SERVER_ERROR, - _SCHEMA_REQUEST_LIMIT_EXCEEDED, - _SCHEMA_THROTTLING_EXCEPTION, - ], -) - -TRANSACT_GET_ITEMS = APIOperation( - input=TransactGetItemsInput, - output=TransactGetItemsOutput, - schema=_SCHEMA_TRANSACT_GET_ITEMS, - input_schema=_SCHEMA_TRANSACT_GET_ITEMS_INPUT, - output_schema=_SCHEMA_TRANSACT_GET_ITEMS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#InvalidEndpointException" - ): InvalidEndpointException, - ShapeID( - "com.amazonaws.dynamodb#ProvisionedThroughputExceededException" - ): ProvisionedThroughputExceededException, - ShapeID( - "com.amazonaws.dynamodb#RequestLimitExceeded" - ): RequestLimitExceeded, - ShapeID( - "com.amazonaws.dynamodb#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.dynamodb#ThrottlingException"): ThrottlingException, - ShapeID( - "com.amazonaws.dynamodb#TransactionCanceledException" - ): TransactionCanceledException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_SERVER_ERROR, - _SCHEMA_INVALID_ENDPOINT_EXCEPTION, - _SCHEMA_PROVISIONED_THROUGHPUT_EXCEEDED_EXCEPTION, - _SCHEMA_REQUEST_LIMIT_EXCEEDED, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_TRANSACTION_CANCELED_EXCEPTION, - ], -) - -BATCH_GET_ITEM = APIOperation( - input=BatchGetItemInput, - output=BatchGetItemOutput, - schema=_SCHEMA_BATCH_GET_ITEM, - input_schema=_SCHEMA_BATCH_GET_ITEM_INPUT, - output_schema=_SCHEMA_BATCH_GET_ITEM_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#InvalidEndpointException" - ): InvalidEndpointException, - ShapeID( - "com.amazonaws.dynamodb#ProvisionedThroughputExceededException" - ): ProvisionedThroughputExceededException, - ShapeID( - "com.amazonaws.dynamodb#RequestLimitExceeded" - ): RequestLimitExceeded, - ShapeID( - "com.amazonaws.dynamodb#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.dynamodb#ThrottlingException"): ThrottlingException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_SERVER_ERROR, - _SCHEMA_INVALID_ENDPOINT_EXCEPTION, - _SCHEMA_PROVISIONED_THROUGHPUT_EXCEEDED_EXCEPTION, - _SCHEMA_REQUEST_LIMIT_EXCEEDED, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class BatchWriteItemOutput: - """Represents the output of a `BatchWriteItem` operation.""" - - unprocessed_items: "dict[str, list[WriteRequest]] | None" = None - """ - A map of tables and requests against those tables that were not - processed. The `UnprocessedItems` value is in the same form as - `RequestItems`, so you can provide this value directly to a subsequent - `BatchWriteItem` operation. For more information, see `RequestItems` in - the Request Parameters section. - - Each `UnprocessedItems` entry consists of a table name or table ARN and, - for that table, a list of operations to perform (`DeleteRequest` or - `PutRequest`). - - - `DeleteRequest` - Perform a `DeleteItem` operation on the specified - item. The item to be deleted is identified by a `Key` subelement: - - - `Key` - A map of primary key attribute values that uniquely identify - the item. Each entry in this map consists of an attribute name and - an attribute value. - - - `PutRequest` - Perform a `PutItem` operation on the specified item. - The item to be put is identified by an `Item` subelement: - - - `Item` - A map of attributes and their values. Each entry in this - map consists of an attribute name and an attribute value. Attribute - values must not be null; string and binary type attributes must have - lengths greater than zero; and set type attributes must not be - empty. Requests that contain empty values will be rejected with a - `ValidationException` exception. - - If you specify any attributes that are part of an index key, then - the data types for those attributes must match those of the schema - in the table's attribute definition. - - If there are no unprocessed items remaining, the response contains an - empty `UnprocessedItems` map. - """ - - item_collection_metrics: "dict[str, list[ItemCollectionMetrics]] | None" = None - """ - A list of tables that were processed by `BatchWriteItem` and, for each - table, information about any item collections that were affected by - individual `DeleteItem` or `PutItem` operations. - - Each entry consists of the following subelements: - - - `ItemCollectionKey` - The partition key value of the item collection. - This is the same as the partition key value of the item. - - - `SizeEstimateRangeGB` - An estimate of item collection size, expressed - in GB. This is a two-element array containing a lower bound and an - upper bound for the estimate. The estimate includes the size of all - the items in the table, plus the size of all attributes projected into - all of the local secondary indexes on the table. Use this estimate to - measure whether a local secondary index is approaching its size limit. - - The estimate is subject to change over time; therefore, do not rely on - the precision or accuracy of the estimate. - """ - - consumed_capacity: list[ConsumedCapacity] | None = None - """ - The capacity units consumed by the entire `BatchWriteItem` operation. - - Each element consists of: - - - `TableName` - The table that consumed the provisioned throughput. - - - `CapacityUnits` - The total number of capacity units consumed. - - If the table has vector indexes, each element also includes a - `VectorIndexes` field with `VectorWriteRequestBytes` consumed for each - affected vector index. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BATCH_WRITE_ITEM_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.unprocessed_items is not None: - _serialize_batch_write_item_request_map( - serializer, - _SCHEMA_BATCH_WRITE_ITEM_OUTPUT.members["UnprocessedItems"], - self.unprocessed_items, - ) - - if self.item_collection_metrics is not None: - _serialize_item_collection_metrics_per_table( - serializer, - _SCHEMA_BATCH_WRITE_ITEM_OUTPUT.members["ItemCollectionMetrics"], - self.item_collection_metrics, - ) - - if self.consumed_capacity is not None: - _serialize_consumed_capacity_multiple( - serializer, - _SCHEMA_BATCH_WRITE_ITEM_OUTPUT.members["ConsumedCapacity"], - self.consumed_capacity, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["unprocessed_items"] = ( - _deserialize_batch_write_item_request_map( - de, - _SCHEMA_BATCH_WRITE_ITEM_OUTPUT.members["UnprocessedItems"], - ) - ) - - case 1: - kwargs["item_collection_metrics"] = ( - _deserialize_item_collection_metrics_per_table( - de, - _SCHEMA_BATCH_WRITE_ITEM_OUTPUT.members[ - "ItemCollectionMetrics" - ], - ) - ) - - case 2: - kwargs["consumed_capacity"] = ( - _deserialize_consumed_capacity_multiple( - de, - _SCHEMA_BATCH_WRITE_ITEM_OUTPUT.members["ConsumedCapacity"], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BATCH_WRITE_ITEM_OUTPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateItemInput: - """Represents the input of an `UpdateItem` operation.""" - - table_name: str | None = None - """ - The name of the table containing the item to update. You can also - provide the Amazon Resource Name (ARN) of the table in this parameter. - """ - - key: "dict[str, AttributeValue] | None" = None - """ - The primary key of the item to be updated. Each element consists of an - attribute name and a value for that attribute. - - For the primary key, you must provide all of the attributes. For - example, with a simple primary key, you only need to provide a value for - the partition key. For a composite primary key, you must provide values - for both the partition key and the sort key. - """ - - attribute_updates: "dict[str, AttributeValueUpdate] | None" = None - """ - This is a legacy parameter. Use `UpdateExpression` instead. For more - information, see - [AttributeUpdates](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.AttributeUpdates.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - expected: "dict[str, ExpectedAttributeValue] | None" = None - """ - This is a legacy parameter. Use `ConditionExpression` instead. For more - information, see - [Expected](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.Expected.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - conditional_operator: str | None = None - """ - This is a legacy parameter. Use `ConditionExpression` instead. For more - information, see - [ConditionalOperator](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.ConditionalOperator.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - return_values: str | None = None - """ - Use `ReturnValues` if you want to get the item attributes as they appear - before or after they are successfully updated. For `UpdateItem`, the - valid values are: - - - `NONE` - If `ReturnValues` is not specified, or if its value is - `NONE`, then nothing is returned. (This setting is the default for - `ReturnValues`.) - - - `ALL_OLD` - Returns all of the attributes of the item, as they - appeared before the UpdateItem operation. - - - `UPDATED_OLD` - Returns only the updated attributes, as they appeared - before the UpdateItem operation. - - - `ALL_NEW` - Returns all of the attributes of the item, as they appear - after the UpdateItem operation. - - - `UPDATED_NEW` - Returns only the updated attributes, as they appear - after the UpdateItem operation. - - There is no additional cost associated with requesting a return value - aside from the small network and processing overhead of receiving a - larger response. No read capacity units are consumed. - - The values returned are strongly consistent. - """ - - return_consumed_capacity: str | None = None - """ - Determines the level of detail about either provisioned or on-demand - throughput consumption that is returned in the response: - - - `INDEXES` - The response includes the aggregate `ConsumedCapacity` for - the operation, together with `ConsumedCapacity` for each table and - secondary index that was accessed. - - Note that some operations, such as `GetItem` and `BatchGetItem`, do - not access any indexes at all. In these cases, specifying `INDEXES` - will only return `ConsumedCapacity` information for table(s). - - - `TOTAL` - The response includes only the aggregate `ConsumedCapacity` - for the operation. - - - `NONE` - No `ConsumedCapacity` details are included in the response. - """ - - return_item_collection_metrics: str | None = None - """ - Determines whether item collection metrics are returned. If set to - `SIZE`, the response includes statistics about item collections, if any, - that were modified during the operation are returned in the response. If - set to `NONE` (the default), no statistics are returned. - """ - - update_expression: str | None = None - """ - An expression that defines one or more attributes to be updated, the - action to be performed on them, and new values for them. - - The following action values are available for `UpdateExpression`. - - - `SET` - Adds one or more attributes and values to an item. If any of - these attributes already exist, they are replaced by the new values. - You can also use `SET` to add or subtract from an attribute that is of - type Number. For example: `SET myNum = myNum + :val` - - `SET` supports the following functions: - - - `if_not_exists (path, operand)` - if the item does not contain an - attribute at the specified path, then `if_not_exists` evaluates to - operand; otherwise, it evaluates to path. You can use this function - to avoid overwriting an attribute that may already be present in the - item. - - - `list_append (operand, operand)` - evaluates to a list with a new - element added to it. You can append the new element to the start or - the end of the list by reversing the order of the operands. - - These function names are case-sensitive. - - - `REMOVE` - Removes one or more attributes from an item. - - - `ADD` - Adds the specified value to the item, if the attribute does - not already exist. If the attribute does exist, then the behavior of - `ADD` depends on the data type of the attribute: - - - If the existing attribute is a number, and if `Value` is also a - number, then `Value` is mathematically added to the existing - attribute. If `Value` is a negative number, then it is subtracted - from the existing attribute. - - Note: - If you use `ADD` to increment or decrement a number value for an - item that doesn't exist before the update, DynamoDB uses `0` as the - initial value. - - Similarly, if you use `ADD` for an existing item to increment or - decrement an attribute value that doesn't exist before the update, - DynamoDB uses `0` as the initial value. For example, suppose that - the item you want to update doesn't have an attribute named - `itemcount`, but you decide to `ADD` the number `3` to this - attribute anyway. DynamoDB will create the `itemcount` attribute, - set its initial value to `0`, and finally add `3` to it. The result - will be a new `itemcount` attribute in the item, with a value of - `3`. - - - If the existing data type is a set and if `Value` is also a set, - then `Value` is added to the existing set. For example, if the - attribute value is the set `[1,2]`, and the `ADD` action specified - `[3]`, then the final attribute value is `[1,2,3]`. An error occurs - if an `ADD` action is specified for a set attribute and the - attribute type specified does not match the existing set type. - - Both sets must have the same primitive data type. For example, if - the existing data type is a set of strings, the `Value` must also be - a set of strings. - - Warning: - The `ADD` action only supports Number and set data types. - - - `DELETE` - Deletes an element from a set. - - If a set of values is specified, then those values are subtracted from - the old set. For example, if the attribute value was the set `[a,b,c]` - and the `DELETE` action specifies `[a,c]`, then the final attribute - value is `[b]`. Specifying an empty set is an error. - - Warning: - The `DELETE` action only supports set data types. - - You can have many actions in a single expression, such as the following: - `SET a=:value1, b=:value2 DELETE :value3, :value4, :value5` - - For more information on update expressions, see [Modifying Items and - Attributes](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.Modifying.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - condition_expression: str | None = None - """ - A condition that must be satisfied in order for a conditional update to - succeed. - - An expression can contain any of the following: - - - Functions: - `attribute_exists | attribute_not_exists | attribute_type | contains | begins_with | size` - - These function names are case-sensitive. - - - Comparison operators: `= | <> | < | > | <= | >= | BETWEEN | IN ` - - - Logical operators: `AND | OR | NOT` - - For more information about condition expressions, see [Specifying - Conditions](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - expression_attribute_names: dict[str, str] | None = None - """ - One or more substitution tokens for attribute names in an expression. - The following are some use cases for using `ExpressionAttributeNames`: - - - To access an attribute whose name conflicts with a DynamoDB reserved - word. - - - To create a placeholder for repeating occurrences of an attribute name - in an expression. - - - To prevent special characters in an attribute name from being - misinterpreted in an expression. - - Use the **#** character in an expression to dereference an attribute - name. For example, consider the following attribute name: - - - `Percentile` - - The name of this attribute conflicts with a reserved word, so it cannot - be used directly in an expression. (For the complete list of reserved - words, see [Reserved - Words](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html) - in the *Amazon DynamoDB Developer Guide*.) To work around this, you - could specify the following for `ExpressionAttributeNames`: - - - `{"#P":"Percentile"}` - - You could then use this substitution in an expression, as in this - example: - - - `#P = :val` - - Note: - Tokens that begin with the **:** character are *expression attribute - values*, which are placeholders for the actual value at runtime. - - For more information about expression attribute names, see [Specifying - Item - Attributes](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) - in the *Amazon DynamoDB Developer Guide*. - """ - - expression_attribute_values: "dict[str, AttributeValue] | None" = None - """ - One or more values that can be substituted in an expression. - - Use the **:** (colon) character in an expression to dereference an - attribute value. For example, suppose that you wanted to check whether - the value of the `ProductStatus` attribute was one of the following: - - `Available | Backordered | Discontinued` - - You would first need to specify `ExpressionAttributeValues` as follows: - - `{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }` - - You could then use these values in an expression, such as this: - - `ProductStatus IN (:avail, :back, :disc)` - - For more information on expression attribute values, see [Condition - Expressions](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html) - in the *Amazon DynamoDB Developer Guide*. - """ - return_values_on_condition_check_failure: str | None = None +class ServiceError(ModeledError): """ - An optional parameter that returns the item attributes for an - `UpdateItem` operation that failed a condition check. + Base error for all errors in the service. - There is no additional cost associated with requesting a return value - aside from the small network and processing overhead of receiving a - larger response. No read capacity units are consumed. + Some exceptions do not extend from this class, including + synthetic, implicit, and shared exception types. """ - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_ITEM_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.table_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_ITEM_INPUT.members["TableName"], self.table_name - ) - - if self.key is not None: - _serialize_key( - serializer, _SCHEMA_UPDATE_ITEM_INPUT.members["Key"], self.key - ) - - if self.attribute_updates is not None: - _serialize_attribute_updates( - serializer, - _SCHEMA_UPDATE_ITEM_INPUT.members["AttributeUpdates"], - self.attribute_updates, - ) - - if self.expected is not None: - _serialize_expected_attribute_map( - serializer, _SCHEMA_UPDATE_ITEM_INPUT.members["Expected"], self.expected - ) - - if self.conditional_operator is not None: - serializer.write_string( - _SCHEMA_UPDATE_ITEM_INPUT.members["ConditionalOperator"], - self.conditional_operator, - ) - - if self.return_values is not None: - serializer.write_string( - _SCHEMA_UPDATE_ITEM_INPUT.members["ReturnValues"], self.return_values - ) - - if self.return_consumed_capacity is not None: - serializer.write_string( - _SCHEMA_UPDATE_ITEM_INPUT.members["ReturnConsumedCapacity"], - self.return_consumed_capacity, - ) - - if self.return_item_collection_metrics is not None: - serializer.write_string( - _SCHEMA_UPDATE_ITEM_INPUT.members["ReturnItemCollectionMetrics"], - self.return_item_collection_metrics, - ) - - if self.update_expression is not None: - serializer.write_string( - _SCHEMA_UPDATE_ITEM_INPUT.members["UpdateExpression"], - self.update_expression, - ) - - if self.condition_expression is not None: - serializer.write_string( - _SCHEMA_UPDATE_ITEM_INPUT.members["ConditionExpression"], - self.condition_expression, - ) - - if self.expression_attribute_names is not None: - _serialize_expression_attribute_name_map( - serializer, - _SCHEMA_UPDATE_ITEM_INPUT.members["ExpressionAttributeNames"], - self.expression_attribute_names, - ) - if self.expression_attribute_values is not None: - _serialize_expression_attribute_value_map( - serializer, - _SCHEMA_UPDATE_ITEM_INPUT.members["ExpressionAttributeValues"], - self.expression_attribute_values, - ) - - if self.return_values_on_condition_check_failure is not None: - serializer.write_string( - _SCHEMA_UPDATE_ITEM_INPUT.members[ - "ReturnValuesOnConditionCheckFailure" - ], - self.return_values_on_condition_check_failure, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["table_name"] = de.read_string( - _SCHEMA_UPDATE_ITEM_INPUT.members["TableName"] - ) - - case 1: - kwargs["key"] = _deserialize_key( - de, _SCHEMA_UPDATE_ITEM_INPUT.members["Key"] - ) - - case 2: - kwargs["attribute_updates"] = _deserialize_attribute_updates( - de, _SCHEMA_UPDATE_ITEM_INPUT.members["AttributeUpdates"] - ) - - case 3: - kwargs["expected"] = _deserialize_expected_attribute_map( - de, _SCHEMA_UPDATE_ITEM_INPUT.members["Expected"] - ) - - case 4: - kwargs["conditional_operator"] = ConditionalOperator( - de.read_string( - _SCHEMA_UPDATE_ITEM_INPUT.members["ConditionalOperator"] - ) - ) - - case 5: - kwargs["return_values"] = ReturnValue( - de.read_string( - _SCHEMA_UPDATE_ITEM_INPUT.members["ReturnValues"] - ) - ) - - case 6: - kwargs["return_consumed_capacity"] = ReturnConsumedCapacity( - de.read_string( - _SCHEMA_UPDATE_ITEM_INPUT.members["ReturnConsumedCapacity"] - ) - ) - - case 7: - kwargs["return_item_collection_metrics"] = ( - ReturnItemCollectionMetrics( - de.read_string( - _SCHEMA_UPDATE_ITEM_INPUT.members[ - "ReturnItemCollectionMetrics" - ] - ) - ) - ) - - case 8: - kwargs["update_expression"] = de.read_string( - _SCHEMA_UPDATE_ITEM_INPUT.members["UpdateExpression"] - ) - - case 9: - kwargs["condition_expression"] = de.read_string( - _SCHEMA_UPDATE_ITEM_INPUT.members["ConditionExpression"] - ) - - case 10: - kwargs["expression_attribute_names"] = ( - _deserialize_expression_attribute_name_map( - de, - _SCHEMA_UPDATE_ITEM_INPUT.members[ - "ExpressionAttributeNames" - ], - ) - ) +_registry = ModelRegistry( + _schemas, + renames={}, + index={ + "ApproximateCreationDateTimePrecision": "APPROXIMATE_CREATION_DATE_TIME_PRECISION", + "ArchivalSummary": "ARCHIVAL_SUMMARY", + "AttributeAction": "ATTRIBUTE_ACTION", + "AttributeDefinition": "ATTRIBUTE_DEFINITION", + "AttributeValue": "ATTRIBUTE_VALUE", + "AttributeValueS": "ATTRIBUTE_VALUE", + "AttributeValueN": "ATTRIBUTE_VALUE", + "AttributeValueB": "ATTRIBUTE_VALUE", + "AttributeValueSS": "ATTRIBUTE_VALUE", + "AttributeValueNS": "ATTRIBUTE_VALUE", + "AttributeValueBS": "ATTRIBUTE_VALUE", + "AttributeValueM": "ATTRIBUTE_VALUE", + "AttributeValueL": "ATTRIBUTE_VALUE", + "AttributeValueNULL": "ATTRIBUTE_VALUE", + "AttributeValueBOOL": "ATTRIBUTE_VALUE", + "AttributeValueUnknown": "ATTRIBUTE_VALUE", + "AttributeValueUpdate": "ATTRIBUTE_VALUE_UPDATE", + "AutoScalingPolicyDescription": "AUTO_SCALING_POLICY_DESCRIPTION", + "AutoScalingPolicyUpdate": "AUTO_SCALING_POLICY_UPDATE", + "AutoScalingSettingsDescription": "AUTO_SCALING_SETTINGS_DESCRIPTION", + "AutoScalingSettingsUpdate": "AUTO_SCALING_SETTINGS_UPDATE", + "AutoScalingTargetTrackingScalingPolicyConfigurationDescription": "AUTO_SCALING_TARGET_TRACKING_SCALING_POLICY_CONFIGURATION_DESCRIPTION", + "AutoScalingTargetTrackingScalingPolicyConfigurationUpdate": "AUTO_SCALING_TARGET_TRACKING_SCALING_POLICY_CONFIGURATION_UPDATE", + "BackupDescription": "BACKUP_DESCRIPTION", + "BackupDetails": "BACKUP_DETAILS", + "BackupInUseException": "BACKUP_IN_USE_EXCEPTION", + "BackupNotFoundException": "BACKUP_NOT_FOUND_EXCEPTION", + "BackupStatus": "BACKUP_STATUS", + "BackupSummary": "BACKUP_SUMMARY", + "BackupType": "BACKUP_TYPE", + "BackupTypeFilter": "BACKUP_TYPE_FILTER", + "BatchExecuteStatementInput": "BATCH_EXECUTE_STATEMENT_INPUT", + "BatchExecuteStatementOutput": "BATCH_EXECUTE_STATEMENT_OUTPUT", + "BatchGetItemInput": "BATCH_GET_ITEM_INPUT", + "BatchGetItemOutput": "BATCH_GET_ITEM_OUTPUT", + "BatchStatementError": "BATCH_STATEMENT_ERROR", + "BatchStatementErrorCodeEnum": "BATCH_STATEMENT_ERROR_CODE_ENUM", + "BatchStatementRequest": "BATCH_STATEMENT_REQUEST", + "BatchStatementResponse": "BATCH_STATEMENT_RESPONSE", + "BatchWriteItemInput": "BATCH_WRITE_ITEM_INPUT", + "BatchWriteItemOutput": "BATCH_WRITE_ITEM_OUTPUT", + "BillingMode": "BILLING_MODE", + "BillingModeSummary": "BILLING_MODE_SUMMARY", + "CancellationReason": "CANCELLATION_REASON", + "Capacity": "CAPACITY", + "ComparisonOperator": "COMPARISON_OPERATOR", + "Condition": "CONDITION", + "ConditionalCheckFailedException": "CONDITIONAL_CHECK_FAILED_EXCEPTION", + "ConditionalOperator": "CONDITIONAL_OPERATOR", + "ConditionCheck": "CONDITION_CHECK", + "ConsumedCapacity": "CONSUMED_CAPACITY", + "ContinuousBackupsDescription": "CONTINUOUS_BACKUPS_DESCRIPTION", + "ContinuousBackupsStatus": "CONTINUOUS_BACKUPS_STATUS", + "ContinuousBackupsUnavailableException": "CONTINUOUS_BACKUPS_UNAVAILABLE_EXCEPTION", + "ContributorInsightsAction": "CONTRIBUTOR_INSIGHTS_ACTION", + "ContributorInsightsMode": "CONTRIBUTOR_INSIGHTS_MODE", + "ContributorInsightsStatus": "CONTRIBUTOR_INSIGHTS_STATUS", + "ContributorInsightsSummary": "CONTRIBUTOR_INSIGHTS_SUMMARY", + "CreateBackupInput": "CREATE_BACKUP_INPUT", + "CreateBackupOutput": "CREATE_BACKUP_OUTPUT", + "CreateGlobalSecondaryIndexAction": "CREATE_GLOBAL_SECONDARY_INDEX_ACTION", + "CreateGlobalTableInput": "CREATE_GLOBAL_TABLE_INPUT", + "CreateGlobalTableOutput": "CREATE_GLOBAL_TABLE_OUTPUT", + "CreateGlobalTableWitnessGroupMemberAction": "CREATE_GLOBAL_TABLE_WITNESS_GROUP_MEMBER_ACTION", + "CreateReplicaAction": "CREATE_REPLICA_ACTION", + "CreateReplicationGroupMemberAction": "CREATE_REPLICATION_GROUP_MEMBER_ACTION", + "CreateTableInput": "CREATE_TABLE_INPUT", + "CreateTableOutput": "CREATE_TABLE_OUTPUT", + "CreateVectorIndexAction": "CREATE_VECTOR_INDEX_ACTION", + "CsvOptions": "CSV_OPTIONS", + "Delete": "DELETE", + "DeleteBackupInput": "DELETE_BACKUP_INPUT", + "DeleteBackupOutput": "DELETE_BACKUP_OUTPUT", + "DeleteGlobalSecondaryIndexAction": "DELETE_GLOBAL_SECONDARY_INDEX_ACTION", + "DeleteGlobalTableWitnessGroupMemberAction": "DELETE_GLOBAL_TABLE_WITNESS_GROUP_MEMBER_ACTION", + "DeleteItemInput": "DELETE_ITEM_INPUT", + "DeleteItemOutput": "DELETE_ITEM_OUTPUT", + "DeleteReplicaAction": "DELETE_REPLICA_ACTION", + "DeleteReplicationGroupMemberAction": "DELETE_REPLICATION_GROUP_MEMBER_ACTION", + "DeleteRequest": "DELETE_REQUEST", + "DeleteResourcePolicyInput": "DELETE_RESOURCE_POLICY_INPUT", + "DeleteResourcePolicyOutput": "DELETE_RESOURCE_POLICY_OUTPUT", + "DeleteTableInput": "DELETE_TABLE_INPUT", + "DeleteTableOutput": "DELETE_TABLE_OUTPUT", + "DeleteVectorIndexAction": "DELETE_VECTOR_INDEX_ACTION", + "DescribeBackupInput": "DESCRIBE_BACKUP_INPUT", + "DescribeBackupOutput": "DESCRIBE_BACKUP_OUTPUT", + "DescribeContinuousBackupsInput": "DESCRIBE_CONTINUOUS_BACKUPS_INPUT", + "DescribeContinuousBackupsOutput": "DESCRIBE_CONTINUOUS_BACKUPS_OUTPUT", + "DescribeContributorInsightsInput": "DESCRIBE_CONTRIBUTOR_INSIGHTS_INPUT", + "DescribeContributorInsightsOutput": "DESCRIBE_CONTRIBUTOR_INSIGHTS_OUTPUT", + "DescribeEndpointsInput": "DESCRIBE_ENDPOINTS_INPUT", + "DescribeEndpointsOutput": "DESCRIBE_ENDPOINTS_OUTPUT", + "DescribeExportInput": "DESCRIBE_EXPORT_INPUT", + "DescribeExportOutput": "DESCRIBE_EXPORT_OUTPUT", + "DescribeGlobalTableInput": "DESCRIBE_GLOBAL_TABLE_INPUT", + "DescribeGlobalTableOutput": "DESCRIBE_GLOBAL_TABLE_OUTPUT", + "DescribeGlobalTableSettingsInput": "DESCRIBE_GLOBAL_TABLE_SETTINGS_INPUT", + "DescribeGlobalTableSettingsOutput": "DESCRIBE_GLOBAL_TABLE_SETTINGS_OUTPUT", + "DescribeImportInput": "DESCRIBE_IMPORT_INPUT", + "DescribeImportOutput": "DESCRIBE_IMPORT_OUTPUT", + "DescribeKinesisStreamingDestinationInput": "DESCRIBE_KINESIS_STREAMING_DESTINATION_INPUT", + "DescribeKinesisStreamingDestinationOutput": "DESCRIBE_KINESIS_STREAMING_DESTINATION_OUTPUT", + "DescribeLimitsInput": "DESCRIBE_LIMITS_INPUT", + "DescribeLimitsOutput": "DESCRIBE_LIMITS_OUTPUT", + "DescribeTableInput": "DESCRIBE_TABLE_INPUT", + "DescribeTableOutput": "DESCRIBE_TABLE_OUTPUT", + "DescribeTableReplicaAutoScalingInput": "DESCRIBE_TABLE_REPLICA_AUTO_SCALING_INPUT", + "DescribeTableReplicaAutoScalingOutput": "DESCRIBE_TABLE_REPLICA_AUTO_SCALING_OUTPUT", + "DescribeTimeToLiveInput": "DESCRIBE_TIME_TO_LIVE_INPUT", + "DescribeTimeToLiveOutput": "DESCRIBE_TIME_TO_LIVE_OUTPUT", + "DestinationStatus": "DESTINATION_STATUS", + "DisableKinesisStreamingDestinationInput": "DISABLE_KINESIS_STREAMING_DESTINATION_INPUT", + "DisableKinesisStreamingDestinationOutput": "DISABLE_KINESIS_STREAMING_DESTINATION_OUTPUT", + "DuplicateItemException": "DUPLICATE_ITEM_EXCEPTION", + "EnableKinesisStreamingConfiguration": "ENABLE_KINESIS_STREAMING_CONFIGURATION", + "EnableKinesisStreamingDestinationInput": "ENABLE_KINESIS_STREAMING_DESTINATION_INPUT", + "EnableKinesisStreamingDestinationOutput": "ENABLE_KINESIS_STREAMING_DESTINATION_OUTPUT", + "Endpoint": "ENDPOINT", + "ExecuteStatementInput": "EXECUTE_STATEMENT_INPUT", + "ExecuteStatementOutput": "EXECUTE_STATEMENT_OUTPUT", + "ExecuteTransactionInput": "EXECUTE_TRANSACTION_INPUT", + "ExecuteTransactionOutput": "EXECUTE_TRANSACTION_OUTPUT", + "ExpectedAttributeValue": "EXPECTED_ATTRIBUTE_VALUE", + "ExportConflictException": "EXPORT_CONFLICT_EXCEPTION", + "ExportDescription": "EXPORT_DESCRIPTION", + "ExportFormat": "EXPORT_FORMAT", + "ExportNotFoundException": "EXPORT_NOT_FOUND_EXCEPTION", + "ExportStatus": "EXPORT_STATUS", + "ExportSummary": "EXPORT_SUMMARY", + "ExportTableToPointInTimeInput": "EXPORT_TABLE_TO_POINT_IN_TIME_INPUT", + "ExportTableToPointInTimeOutput": "EXPORT_TABLE_TO_POINT_IN_TIME_OUTPUT", + "ExportType": "EXPORT_TYPE", + "ExportViewType": "EXPORT_VIEW_TYPE", + "FailureException": "FAILURE_EXCEPTION", + "FilterSpecification": "FILTER_SPECIFICATION", + "Get": "GET", + "GetItemInput": "GET_ITEM_INPUT", + "GetItemOutput": "GET_ITEM_OUTPUT", + "GetResourcePolicyInput": "GET_RESOURCE_POLICY_INPUT", + "GetResourcePolicyOutput": "GET_RESOURCE_POLICY_OUTPUT", + "GlobalSecondaryIndex": "GLOBAL_SECONDARY_INDEX", + "GlobalSecondaryIndexAutoScalingUpdate": "GLOBAL_SECONDARY_INDEX_AUTO_SCALING_UPDATE", + "GlobalSecondaryIndexDescription": "GLOBAL_SECONDARY_INDEX_DESCRIPTION", + "GlobalSecondaryIndexInfo": "GLOBAL_SECONDARY_INDEX_INFO", + "GlobalSecondaryIndexUpdate": "GLOBAL_SECONDARY_INDEX_UPDATE", + "GlobalSecondaryIndexWarmThroughputDescription": "GLOBAL_SECONDARY_INDEX_WARM_THROUGHPUT_DESCRIPTION", + "GlobalTable": "GLOBAL_TABLE", + "GlobalTableAlreadyExistsException": "GLOBAL_TABLE_ALREADY_EXISTS_EXCEPTION", + "GlobalTableDescription": "GLOBAL_TABLE_DESCRIPTION", + "GlobalTableGlobalSecondaryIndexSettingsUpdate": "GLOBAL_TABLE_GLOBAL_SECONDARY_INDEX_SETTINGS_UPDATE", + "GlobalTableNotFoundException": "GLOBAL_TABLE_NOT_FOUND_EXCEPTION", + "GlobalTableSettingsReplicationMode": "GLOBAL_TABLE_SETTINGS_REPLICATION_MODE", + "GlobalTableStatus": "GLOBAL_TABLE_STATUS", + "GlobalTableWitnessDescription": "GLOBAL_TABLE_WITNESS_DESCRIPTION", + "GlobalTableWitnessGroupUpdate": "GLOBAL_TABLE_WITNESS_GROUP_UPDATE", + "IdempotentParameterMismatchException": "IDEMPOTENT_PARAMETER_MISMATCH_EXCEPTION", + "ImportConflictException": "IMPORT_CONFLICT_EXCEPTION", + "ImportNotFoundException": "IMPORT_NOT_FOUND_EXCEPTION", + "ImportStatus": "IMPORT_STATUS", + "ImportSummary": "IMPORT_SUMMARY", + "ImportTableDescription": "IMPORT_TABLE_DESCRIPTION", + "ImportTableInput": "IMPORT_TABLE_INPUT", + "ImportTableOutput": "IMPORT_TABLE_OUTPUT", + "IncrementalExportSpecification": "INCREMENTAL_EXPORT_SPECIFICATION", + "IndexNotFoundException": "INDEX_NOT_FOUND_EXCEPTION", + "IndexStatus": "INDEX_STATUS", + "InputCompressionType": "INPUT_COMPRESSION_TYPE", + "InputFormat": "INPUT_FORMAT", + "InputFormatOptions": "INPUT_FORMAT_OPTIONS", + "InternalServerError": "INTERNAL_SERVER_ERROR", + "InvalidEndpointException": "INVALID_ENDPOINT_EXCEPTION", + "InvalidExportTimeException": "INVALID_EXPORT_TIME_EXCEPTION", + "InvalidRestoreTimeException": "INVALID_RESTORE_TIME_EXCEPTION", + "ItemCollectionMetrics": "ITEM_COLLECTION_METRICS", + "ItemCollectionSizeLimitExceededException": "ITEM_COLLECTION_SIZE_LIMIT_EXCEEDED_EXCEPTION", + "ItemResponse": "ITEM_RESPONSE", + "KeysAndAttributes": "KEYS_AND_ATTRIBUTES", + "KeySchemaElement": "KEY_SCHEMA_ELEMENT", + "KeyType": "KEY_TYPE", + "KinesisDataStreamDestination": "KINESIS_DATA_STREAM_DESTINATION", + "LimitExceededException": "LIMIT_EXCEEDED_EXCEPTION", + "ListBackupsInput": "LIST_BACKUPS_INPUT", + "ListBackupsOutput": "LIST_BACKUPS_OUTPUT", + "ListContributorInsightsInput": "LIST_CONTRIBUTOR_INSIGHTS_INPUT", + "ListContributorInsightsOutput": "LIST_CONTRIBUTOR_INSIGHTS_OUTPUT", + "ListExportsInput": "LIST_EXPORTS_INPUT", + "ListExportsOutput": "LIST_EXPORTS_OUTPUT", + "ListGlobalTablesInput": "LIST_GLOBAL_TABLES_INPUT", + "ListGlobalTablesOutput": "LIST_GLOBAL_TABLES_OUTPUT", + "ListImportsInput": "LIST_IMPORTS_INPUT", + "ListImportsOutput": "LIST_IMPORTS_OUTPUT", + "ListTablesInput": "LIST_TABLES_INPUT", + "ListTablesOutput": "LIST_TABLES_OUTPUT", + "ListTagsOfResourceInput": "LIST_TAGS_OF_RESOURCE_INPUT", + "ListTagsOfResourceOutput": "LIST_TAGS_OF_RESOURCE_OUTPUT", + "LocalSecondaryIndex": "LOCAL_SECONDARY_INDEX", + "LocalSecondaryIndexDescription": "LOCAL_SECONDARY_INDEX_DESCRIPTION", + "LocalSecondaryIndexInfo": "LOCAL_SECONDARY_INDEX_INFO", + "MultiRegionConsistency": "MULTI_REGION_CONSISTENCY", + "OnDemandThroughput": "ON_DEMAND_THROUGHPUT", + "OnDemandThroughputOverride": "ON_DEMAND_THROUGHPUT_OVERRIDE", + "ParameterizedStatement": "PARAMETERIZED_STATEMENT", + "PointInTimeRecoveryDescription": "POINT_IN_TIME_RECOVERY_DESCRIPTION", + "PointInTimeRecoverySpecification": "POINT_IN_TIME_RECOVERY_SPECIFICATION", + "PointInTimeRecoveryStatus": "POINT_IN_TIME_RECOVERY_STATUS", + "PointInTimeRecoveryUnavailableException": "POINT_IN_TIME_RECOVERY_UNAVAILABLE_EXCEPTION", + "PolicyNotFoundException": "POLICY_NOT_FOUND_EXCEPTION", + "Projection": "PROJECTION", + "ProjectionType": "PROJECTION_TYPE", + "ProvisionedThroughput": "PROVISIONED_THROUGHPUT", + "ProvisionedThroughputDescription": "PROVISIONED_THROUGHPUT_DESCRIPTION", + "ProvisionedThroughputExceededException": "PROVISIONED_THROUGHPUT_EXCEEDED_EXCEPTION", + "ProvisionedThroughputOverride": "PROVISIONED_THROUGHPUT_OVERRIDE", + "Put": "PUT", + "PutItemInput": "PUT_ITEM_INPUT", + "PutItemOutput": "PUT_ITEM_OUTPUT", + "PutRequest": "PUT_REQUEST", + "PutResourcePolicyInput": "PUT_RESOURCE_POLICY_INPUT", + "PutResourcePolicyOutput": "PUT_RESOURCE_POLICY_OUTPUT", + "QueryInput": "QUERY_INPUT", + "QueryOutput": "QUERY_OUTPUT", + "Replica": "REPLICA", + "ReplicaAlreadyExistsException": "REPLICA_ALREADY_EXISTS_EXCEPTION", + "ReplicaAutoScalingDescription": "REPLICA_AUTO_SCALING_DESCRIPTION", + "ReplicaAutoScalingUpdate": "REPLICA_AUTO_SCALING_UPDATE", + "ReplicaDescription": "REPLICA_DESCRIPTION", + "ReplicaGlobalSecondaryIndex": "REPLICA_GLOBAL_SECONDARY_INDEX", + "ReplicaGlobalSecondaryIndexAutoScalingDescription": "REPLICA_GLOBAL_SECONDARY_INDEX_AUTO_SCALING_DESCRIPTION", + "ReplicaGlobalSecondaryIndexAutoScalingUpdate": "REPLICA_GLOBAL_SECONDARY_INDEX_AUTO_SCALING_UPDATE", + "ReplicaGlobalSecondaryIndexDescription": "REPLICA_GLOBAL_SECONDARY_INDEX_DESCRIPTION", + "ReplicaGlobalSecondaryIndexSettingsDescription": "REPLICA_GLOBAL_SECONDARY_INDEX_SETTINGS_DESCRIPTION", + "ReplicaGlobalSecondaryIndexSettingsUpdate": "REPLICA_GLOBAL_SECONDARY_INDEX_SETTINGS_UPDATE", + "ReplicaNotFoundException": "REPLICA_NOT_FOUND_EXCEPTION", + "ReplicaSettingsDescription": "REPLICA_SETTINGS_DESCRIPTION", + "ReplicaSettingsUpdate": "REPLICA_SETTINGS_UPDATE", + "ReplicaStatus": "REPLICA_STATUS", + "ReplicatedWriteConflictException": "REPLICATED_WRITE_CONFLICT_EXCEPTION", + "ReplicationGroupUpdate": "REPLICATION_GROUP_UPDATE", + "ReplicaUpdate": "REPLICA_UPDATE", + "RequestLimitExceeded": "REQUEST_LIMIT_EXCEEDED", + "ResourceInUseException": "RESOURCE_IN_USE_EXCEPTION", + "ResourceNotFoundException": "RESOURCE_NOT_FOUND_EXCEPTION", + "RestoreSummary": "RESTORE_SUMMARY", + "RestoreTableFromBackupInput": "RESTORE_TABLE_FROM_BACKUP_INPUT", + "RestoreTableFromBackupOutput": "RESTORE_TABLE_FROM_BACKUP_OUTPUT", + "RestoreTableToPointInTimeInput": "RESTORE_TABLE_TO_POINT_IN_TIME_INPUT", + "RestoreTableToPointInTimeOutput": "RESTORE_TABLE_TO_POINT_IN_TIME_OUTPUT", + "ReturnConsumedCapacity": "RETURN_CONSUMED_CAPACITY", + "ReturnItemCollectionMetrics": "RETURN_ITEM_COLLECTION_METRICS", + "ReturnValue": "RETURN_VALUE", + "ReturnValuesOnConditionCheckFailure": "RETURN_VALUES_ON_CONDITION_CHECK_FAILURE", + "S3BucketSource": "S3_BUCKET_SOURCE", + "S3SseAlgorithm": "S3_SSE_ALGORITHM", + "ScalarAttributeType": "SCALAR_ATTRIBUTE_TYPE", + "ScanInput": "SCAN_INPUT", + "ScanOutput": "SCAN_OUTPUT", + "SearchResultItem": "SEARCH_RESULT_ITEM", + "SearchSchemaElement": "SEARCH_SCHEMA_ELEMENT", + "SearchSchemaElementType": "SEARCH_SCHEMA_ELEMENT_TYPE", + "SearchVectorsInput": "SEARCH_VECTORS_INPUT", + "SearchVectorsOutput": "SEARCH_VECTORS_OUTPUT", + "Select": "SELECT", + "SourceTableDetails": "SOURCE_TABLE_DETAILS", + "SourceTableFeatureDetails": "SOURCE_TABLE_FEATURE_DETAILS", + "SSEDescription": "SSE_DESCRIPTION", + "SSESpecification": "SSE_SPECIFICATION", + "SSEStatus": "SSE_STATUS", + "SSEType": "SSE_TYPE", + "StreamSpecification": "STREAM_SPECIFICATION", + "StreamViewType": "STREAM_VIEW_TYPE", + "TableAlreadyExistsException": "TABLE_ALREADY_EXISTS_EXCEPTION", + "TableAutoScalingDescription": "TABLE_AUTO_SCALING_DESCRIPTION", + "TableClass": "TABLE_CLASS", + "TableClassSummary": "TABLE_CLASS_SUMMARY", + "TableCreationParameters": "TABLE_CREATION_PARAMETERS", + "TableDescription": "TABLE_DESCRIPTION", + "TableInUseException": "TABLE_IN_USE_EXCEPTION", + "TableNotFoundException": "TABLE_NOT_FOUND_EXCEPTION", + "TableStatus": "TABLE_STATUS", + "TableWarmThroughputDescription": "TABLE_WARM_THROUGHPUT_DESCRIPTION", + "Tag": "TAG", + "TagResourceInput": "TAG_RESOURCE_INPUT", + "TagResourceOutput": "TAG_RESOURCE_OUTPUT", + "ThrottlingException": "THROTTLING_EXCEPTION", + "ThrottlingReason": "THROTTLING_REASON", + "TimeToLiveDescription": "TIME_TO_LIVE_DESCRIPTION", + "TimeToLiveSpecification": "TIME_TO_LIVE_SPECIFICATION", + "TimeToLiveStatus": "TIME_TO_LIVE_STATUS", + "TransactGetItem": "TRANSACT_GET_ITEM", + "TransactGetItemsInput": "TRANSACT_GET_ITEMS_INPUT", + "TransactGetItemsOutput": "TRANSACT_GET_ITEMS_OUTPUT", + "TransactionCanceledException": "TRANSACTION_CANCELED_EXCEPTION", + "TransactionConflictException": "TRANSACTION_CONFLICT_EXCEPTION", + "TransactionInProgressException": "TRANSACTION_IN_PROGRESS_EXCEPTION", + "TransactWriteItem": "TRANSACT_WRITE_ITEM", + "TransactWriteItemsInput": "TRANSACT_WRITE_ITEMS_INPUT", + "TransactWriteItemsOutput": "TRANSACT_WRITE_ITEMS_OUTPUT", + "UntagResourceInput": "UNTAG_RESOURCE_INPUT", + "UntagResourceOutput": "UNTAG_RESOURCE_OUTPUT", + "Update": "UPDATE", + "UpdateContinuousBackupsInput": "UPDATE_CONTINUOUS_BACKUPS_INPUT", + "UpdateContinuousBackupsOutput": "UPDATE_CONTINUOUS_BACKUPS_OUTPUT", + "UpdateContributorInsightsInput": "UPDATE_CONTRIBUTOR_INSIGHTS_INPUT", + "UpdateContributorInsightsOutput": "UPDATE_CONTRIBUTOR_INSIGHTS_OUTPUT", + "UpdateGlobalSecondaryIndexAction": "UPDATE_GLOBAL_SECONDARY_INDEX_ACTION", + "UpdateGlobalTableInput": "UPDATE_GLOBAL_TABLE_INPUT", + "UpdateGlobalTableOutput": "UPDATE_GLOBAL_TABLE_OUTPUT", + "UpdateGlobalTableSettingsInput": "UPDATE_GLOBAL_TABLE_SETTINGS_INPUT", + "UpdateGlobalTableSettingsOutput": "UPDATE_GLOBAL_TABLE_SETTINGS_OUTPUT", + "UpdateItemInput": "UPDATE_ITEM_INPUT", + "UpdateItemOutput": "UPDATE_ITEM_OUTPUT", + "UpdateKinesisStreamingConfiguration": "UPDATE_KINESIS_STREAMING_CONFIGURATION", + "UpdateKinesisStreamingDestinationInput": "UPDATE_KINESIS_STREAMING_DESTINATION_INPUT", + "UpdateKinesisStreamingDestinationOutput": "UPDATE_KINESIS_STREAMING_DESTINATION_OUTPUT", + "UpdateReplicationGroupMemberAction": "UPDATE_REPLICATION_GROUP_MEMBER_ACTION", + "UpdateTableInput": "UPDATE_TABLE_INPUT", + "UpdateTableOutput": "UPDATE_TABLE_OUTPUT", + "UpdateTableReplicaAutoScalingInput": "UPDATE_TABLE_REPLICA_AUTO_SCALING_INPUT", + "UpdateTableReplicaAutoScalingOutput": "UPDATE_TABLE_REPLICA_AUTO_SCALING_OUTPUT", + "UpdateTimeToLiveInput": "UPDATE_TIME_TO_LIVE_INPUT", + "UpdateTimeToLiveOutput": "UPDATE_TIME_TO_LIVE_OUTPUT", + "VectorAttributeDefinition": "VECTOR_ATTRIBUTE_DEFINITION", + "VectorCapacity": "VECTOR_CAPACITY", + "VectorDistanceFunction": "VECTOR_DISTANCE_FUNCTION", + "VectorIndex": "VECTOR_INDEX", + "VectorIndexDescription": "VECTOR_INDEX_DESCRIPTION", + "VectorIndexInfo": "VECTOR_INDEX_INFO", + "VectorIndexUpdate": "VECTOR_INDEX_UPDATE", + "WarmThroughput": "WARM_THROUGHPUT", + "WitnessStatus": "WITNESS_STATUS", + "WriteRequest": "WRITE_REQUEST", + }, + shape_names=frozenset( + { + "ApproximateCreationDateTimePrecision", + "ArchivalSummary", + "AttributeAction", + "AttributeDefinition", + "AttributeValue", + "AttributeValueUpdate", + "AutoScalingPolicyDescription", + "AutoScalingPolicyUpdate", + "AutoScalingSettingsDescription", + "AutoScalingSettingsUpdate", + "AutoScalingTargetTrackingScalingPolicyConfigurationDescription", + "AutoScalingTargetTrackingScalingPolicyConfigurationUpdate", + "BackupDescription", + "BackupDetails", + "BackupInUseException", + "BackupNotFoundException", + "BackupStatus", + "BackupSummary", + "BackupType", + "BackupTypeFilter", + "BatchExecuteStatementInput", + "BatchExecuteStatementOutput", + "BatchGetItemInput", + "BatchGetItemOutput", + "BatchStatementError", + "BatchStatementErrorCodeEnum", + "BatchStatementRequest", + "BatchStatementResponse", + "BatchWriteItemInput", + "BatchWriteItemOutput", + "BillingMode", + "BillingModeSummary", + "CancellationReason", + "Capacity", + "ComparisonOperator", + "Condition", + "ConditionCheck", + "ConditionalCheckFailedException", + "ConditionalOperator", + "ConsumedCapacity", + "ContinuousBackupsDescription", + "ContinuousBackupsStatus", + "ContinuousBackupsUnavailableException", + "ContributorInsightsAction", + "ContributorInsightsMode", + "ContributorInsightsStatus", + "ContributorInsightsSummary", + "CreateBackupInput", + "CreateBackupOutput", + "CreateGlobalSecondaryIndexAction", + "CreateGlobalTableInput", + "CreateGlobalTableOutput", + "CreateGlobalTableWitnessGroupMemberAction", + "CreateReplicaAction", + "CreateReplicationGroupMemberAction", + "CreateTableInput", + "CreateTableOutput", + "CreateVectorIndexAction", + "CsvOptions", + "Delete", + "DeleteBackupInput", + "DeleteBackupOutput", + "DeleteGlobalSecondaryIndexAction", + "DeleteGlobalTableWitnessGroupMemberAction", + "DeleteItemInput", + "DeleteItemOutput", + "DeleteReplicaAction", + "DeleteReplicationGroupMemberAction", + "DeleteRequest", + "DeleteResourcePolicyInput", + "DeleteResourcePolicyOutput", + "DeleteTableInput", + "DeleteTableOutput", + "DeleteVectorIndexAction", + "DescribeBackupInput", + "DescribeBackupOutput", + "DescribeContinuousBackupsInput", + "DescribeContinuousBackupsOutput", + "DescribeContributorInsightsInput", + "DescribeContributorInsightsOutput", + "DescribeEndpointsInput", + "DescribeEndpointsOutput", + "DescribeExportInput", + "DescribeExportOutput", + "DescribeGlobalTableInput", + "DescribeGlobalTableOutput", + "DescribeGlobalTableSettingsInput", + "DescribeGlobalTableSettingsOutput", + "DescribeImportInput", + "DescribeImportOutput", + "DescribeKinesisStreamingDestinationInput", + "DescribeKinesisStreamingDestinationOutput", + "DescribeLimitsInput", + "DescribeLimitsOutput", + "DescribeTableInput", + "DescribeTableOutput", + "DescribeTableReplicaAutoScalingInput", + "DescribeTableReplicaAutoScalingOutput", + "DescribeTimeToLiveInput", + "DescribeTimeToLiveOutput", + "DestinationStatus", + "DisableKinesisStreamingDestinationInput", + "DisableKinesisStreamingDestinationOutput", + "DuplicateItemException", + "EnableKinesisStreamingConfiguration", + "EnableKinesisStreamingDestinationInput", + "EnableKinesisStreamingDestinationOutput", + "Endpoint", + "ExecuteStatementInput", + "ExecuteStatementOutput", + "ExecuteTransactionInput", + "ExecuteTransactionOutput", + "ExpectedAttributeValue", + "ExportConflictException", + "ExportDescription", + "ExportFormat", + "ExportNotFoundException", + "ExportStatus", + "ExportSummary", + "ExportTableToPointInTimeInput", + "ExportTableToPointInTimeOutput", + "ExportType", + "ExportViewType", + "FailureException", + "FilterSpecification", + "Get", + "GetItemInput", + "GetItemOutput", + "GetResourcePolicyInput", + "GetResourcePolicyOutput", + "GlobalSecondaryIndex", + "GlobalSecondaryIndexAutoScalingUpdate", + "GlobalSecondaryIndexDescription", + "GlobalSecondaryIndexInfo", + "GlobalSecondaryIndexUpdate", + "GlobalSecondaryIndexWarmThroughputDescription", + "GlobalTable", + "GlobalTableAlreadyExistsException", + "GlobalTableDescription", + "GlobalTableGlobalSecondaryIndexSettingsUpdate", + "GlobalTableNotFoundException", + "GlobalTableSettingsReplicationMode", + "GlobalTableStatus", + "GlobalTableWitnessDescription", + "GlobalTableWitnessGroupUpdate", + "IdempotentParameterMismatchException", + "ImportConflictException", + "ImportNotFoundException", + "ImportStatus", + "ImportSummary", + "ImportTableDescription", + "ImportTableInput", + "ImportTableOutput", + "IncrementalExportSpecification", + "IndexNotFoundException", + "IndexStatus", + "InputCompressionType", + "InputFormat", + "InputFormatOptions", + "InternalServerError", + "InvalidEndpointException", + "InvalidExportTimeException", + "InvalidRestoreTimeException", + "ItemCollectionMetrics", + "ItemCollectionSizeLimitExceededException", + "ItemResponse", + "KeySchemaElement", + "KeyType", + "KeysAndAttributes", + "KinesisDataStreamDestination", + "LimitExceededException", + "ListBackupsInput", + "ListBackupsOutput", + "ListContributorInsightsInput", + "ListContributorInsightsOutput", + "ListExportsInput", + "ListExportsOutput", + "ListGlobalTablesInput", + "ListGlobalTablesOutput", + "ListImportsInput", + "ListImportsOutput", + "ListTablesInput", + "ListTablesOutput", + "ListTagsOfResourceInput", + "ListTagsOfResourceOutput", + "LocalSecondaryIndex", + "LocalSecondaryIndexDescription", + "LocalSecondaryIndexInfo", + "MultiRegionConsistency", + "OnDemandThroughput", + "OnDemandThroughputOverride", + "ParameterizedStatement", + "PointInTimeRecoveryDescription", + "PointInTimeRecoverySpecification", + "PointInTimeRecoveryStatus", + "PointInTimeRecoveryUnavailableException", + "PolicyNotFoundException", + "Projection", + "ProjectionType", + "ProvisionedThroughput", + "ProvisionedThroughputDescription", + "ProvisionedThroughputExceededException", + "ProvisionedThroughputOverride", + "Put", + "PutItemInput", + "PutItemOutput", + "PutRequest", + "PutResourcePolicyInput", + "PutResourcePolicyOutput", + "QueryInput", + "QueryOutput", + "Replica", + "ReplicaAlreadyExistsException", + "ReplicaAutoScalingDescription", + "ReplicaAutoScalingUpdate", + "ReplicaDescription", + "ReplicaGlobalSecondaryIndex", + "ReplicaGlobalSecondaryIndexAutoScalingDescription", + "ReplicaGlobalSecondaryIndexAutoScalingUpdate", + "ReplicaGlobalSecondaryIndexDescription", + "ReplicaGlobalSecondaryIndexSettingsDescription", + "ReplicaGlobalSecondaryIndexSettingsUpdate", + "ReplicaNotFoundException", + "ReplicaSettingsDescription", + "ReplicaSettingsUpdate", + "ReplicaStatus", + "ReplicaUpdate", + "ReplicatedWriteConflictException", + "ReplicationGroupUpdate", + "RequestLimitExceeded", + "ResourceInUseException", + "ResourceNotFoundException", + "RestoreSummary", + "RestoreTableFromBackupInput", + "RestoreTableFromBackupOutput", + "RestoreTableToPointInTimeInput", + "RestoreTableToPointInTimeOutput", + "ReturnConsumedCapacity", + "ReturnItemCollectionMetrics", + "ReturnValue", + "ReturnValuesOnConditionCheckFailure", + "S3BucketSource", + "S3SseAlgorithm", + "SSEDescription", + "SSESpecification", + "SSEStatus", + "SSEType", + "ScalarAttributeType", + "ScanInput", + "ScanOutput", + "SearchResultItem", + "SearchSchemaElement", + "SearchSchemaElementType", + "SearchVectorsInput", + "SearchVectorsOutput", + "Select", + "SourceTableDetails", + "SourceTableFeatureDetails", + "StreamSpecification", + "StreamViewType", + "TableAlreadyExistsException", + "TableAutoScalingDescription", + "TableClass", + "TableClassSummary", + "TableCreationParameters", + "TableDescription", + "TableInUseException", + "TableNotFoundException", + "TableStatus", + "TableWarmThroughputDescription", + "Tag", + "TagResourceInput", + "TagResourceOutput", + "ThrottlingException", + "ThrottlingReason", + "TimeToLiveDescription", + "TimeToLiveSpecification", + "TimeToLiveStatus", + "TransactGetItem", + "TransactGetItemsInput", + "TransactGetItemsOutput", + "TransactWriteItem", + "TransactWriteItemsInput", + "TransactWriteItemsOutput", + "TransactionCanceledException", + "TransactionConflictException", + "TransactionInProgressException", + "UntagResourceInput", + "UntagResourceOutput", + "Update", + "UpdateContinuousBackupsInput", + "UpdateContinuousBackupsOutput", + "UpdateContributorInsightsInput", + "UpdateContributorInsightsOutput", + "UpdateGlobalSecondaryIndexAction", + "UpdateGlobalTableInput", + "UpdateGlobalTableOutput", + "UpdateGlobalTableSettingsInput", + "UpdateGlobalTableSettingsOutput", + "UpdateItemInput", + "UpdateItemOutput", + "UpdateKinesisStreamingConfiguration", + "UpdateKinesisStreamingDestinationInput", + "UpdateKinesisStreamingDestinationOutput", + "UpdateReplicationGroupMemberAction", + "UpdateTableInput", + "UpdateTableOutput", + "UpdateTableReplicaAutoScalingInput", + "UpdateTableReplicaAutoScalingOutput", + "UpdateTimeToLiveInput", + "UpdateTimeToLiveOutput", + "VectorAttributeDefinition", + "VectorCapacity", + "VectorDistanceFunction", + "VectorIndex", + "VectorIndexDescription", + "VectorIndexInfo", + "VectorIndexUpdate", + "WarmThroughput", + "WitnessStatus", + "WriteRequest", + } + ), + service_error="ServiceError", +) - case 11: - kwargs["expression_attribute_values"] = ( - _deserialize_expression_attribute_value_map( - de, - _SCHEMA_UPDATE_ITEM_INPUT.members[ - "ExpressionAttributeValues" - ], - ) - ) - case 12: - kwargs["return_values_on_condition_check_failure"] = ( - ReturnValuesOnConditionCheckFailure( - de.read_string( - _SCHEMA_UPDATE_ITEM_INPUT.members[ - "ReturnValuesOnConditionCheckFailure" - ] - ) - ) - ) +def __getattr__(name: str): + return _registry.build(name) - case _: - logger.debug("Unexpected member schema: %s", schema) - deserializer.read_struct(_SCHEMA_UPDATE_ITEM_INPUT, consumer=_consumer) - return kwargs +CREATE_BACKUP: APIOperation[CreateBackupInput, CreateBackupOutput] = APIOperation( + static_schema=_SCHEMA_CREATE_BACKUP, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#BackupInUseException"), + ShapeID("com.amazonaws.dynamodb#ContinuousBackupsUnavailableException"), + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#InvalidEndpointException"), + ShapeID("com.amazonaws.dynamodb#LimitExceededException"), + ShapeID("com.amazonaws.dynamodb#TableInUseException"), + ShapeID("com.amazonaws.dynamodb#TableNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +CREATE_GLOBAL_TABLE: APIOperation[CreateGlobalTableInput, CreateGlobalTableOutput] = ( + APIOperation( + static_schema=_SCHEMA_CREATE_GLOBAL_TABLE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#GlobalTableAlreadyExistsException"), + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#InvalidEndpointException"), + ShapeID("com.amazonaws.dynamodb#LimitExceededException"), + ShapeID("com.amazonaws.dynamodb#TableNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) -SCAN = APIOperation( - input=ScanInput, - output=ScanOutput, - schema=_SCHEMA_SCAN, - input_schema=_SCHEMA_SCAN_INPUT, - output_schema=_SCHEMA_SCAN_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#InvalidEndpointException" - ): InvalidEndpointException, - ShapeID( - "com.amazonaws.dynamodb#ProvisionedThroughputExceededException" - ): ProvisionedThroughputExceededException, - ShapeID( - "com.amazonaws.dynamodb#RequestLimitExceeded" - ): RequestLimitExceeded, - ShapeID( - "com.amazonaws.dynamodb#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.dynamodb#ThrottlingException"): ThrottlingException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_SERVER_ERROR, - _SCHEMA_INVALID_ENDPOINT_EXCEPTION, - _SCHEMA_PROVISIONED_THROUGHPUT_EXCEEDED_EXCEPTION, - _SCHEMA_REQUEST_LIMIT_EXCEEDED, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, +CREATE_TABLE: APIOperation[CreateTableInput, CreateTableOutput] = APIOperation( + static_schema=_SCHEMA_CREATE_TABLE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#InvalidEndpointException"), + ShapeID("com.amazonaws.dynamodb#LimitExceededException"), + ShapeID("com.amazonaws.dynamodb#ResourceInUseException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) -QUERY = APIOperation( - input=QueryInput, - output=QueryOutput, - schema=_SCHEMA_QUERY, - input_schema=_SCHEMA_QUERY_INPUT, - output_schema=_SCHEMA_QUERY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#InvalidEndpointException" - ): InvalidEndpointException, - ShapeID( - "com.amazonaws.dynamodb#ProvisionedThroughputExceededException" - ): ProvisionedThroughputExceededException, - ShapeID( - "com.amazonaws.dynamodb#RequestLimitExceeded" - ): RequestLimitExceeded, - ShapeID( - "com.amazonaws.dynamodb#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.dynamodb#ThrottlingException"): ThrottlingException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_SERVER_ERROR, - _SCHEMA_INVALID_ENDPOINT_EXCEPTION, - _SCHEMA_PROVISIONED_THROUGHPUT_EXCEEDED_EXCEPTION, - _SCHEMA_REQUEST_LIMIT_EXCEEDED, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, +DELETE_BACKUP: APIOperation[DeleteBackupInput, DeleteBackupOutput] = APIOperation( + static_schema=_SCHEMA_DELETE_BACKUP, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#BackupInUseException"), + ShapeID("com.amazonaws.dynamodb#BackupNotFoundException"), + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#InvalidEndpointException"), + ShapeID("com.amazonaws.dynamodb#LimitExceededException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) -DELETE_ITEM = APIOperation( - input=DeleteItemInput, - output=DeleteItemOutput, - schema=_SCHEMA_DELETE_ITEM, - input_schema=_SCHEMA_DELETE_ITEM_INPUT, - output_schema=_SCHEMA_DELETE_ITEM_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.dynamodb#ConditionalCheckFailedException" - ): ConditionalCheckFailedException, - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#InvalidEndpointException" - ): InvalidEndpointException, - ShapeID( - "com.amazonaws.dynamodb#ItemCollectionSizeLimitExceededException" - ): ItemCollectionSizeLimitExceededException, - ShapeID( - "com.amazonaws.dynamodb#ProvisionedThroughputExceededException" - ): ProvisionedThroughputExceededException, - ShapeID( - "com.amazonaws.dynamodb#ReplicatedWriteConflictException" - ): ReplicatedWriteConflictException, - ShapeID( - "com.amazonaws.dynamodb#RequestLimitExceeded" - ): RequestLimitExceeded, - ShapeID( - "com.amazonaws.dynamodb#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.dynamodb#ThrottlingException"): ThrottlingException, - ShapeID( - "com.amazonaws.dynamodb#TransactionConflictException" - ): TransactionConflictException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CONDITIONAL_CHECK_FAILED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR, - _SCHEMA_INVALID_ENDPOINT_EXCEPTION, - _SCHEMA_ITEM_COLLECTION_SIZE_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_PROVISIONED_THROUGHPUT_EXCEEDED_EXCEPTION, - _SCHEMA_REPLICATED_WRITE_CONFLICT_EXCEPTION, - _SCHEMA_REQUEST_LIMIT_EXCEEDED, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_TRANSACTION_CONFLICT_EXCEPTION, +DELETE_RESOURCE_POLICY: APIOperation[ + DeleteResourcePolicyInput, DeleteResourcePolicyOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_RESOURCE_POLICY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#InvalidEndpointException"), + ShapeID("com.amazonaws.dynamodb#LimitExceededException"), + ShapeID("com.amazonaws.dynamodb#PolicyNotFoundException"), + ShapeID("com.amazonaws.dynamodb#ResourceInUseException"), + ShapeID("com.amazonaws.dynamodb#ResourceNotFoundException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) -PUT_ITEM = APIOperation( - input=PutItemInput, - output=PutItemOutput, - schema=_SCHEMA_PUT_ITEM, - input_schema=_SCHEMA_PUT_ITEM_INPUT, - output_schema=_SCHEMA_PUT_ITEM_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.dynamodb#ConditionalCheckFailedException" - ): ConditionalCheckFailedException, - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#InvalidEndpointException" - ): InvalidEndpointException, - ShapeID( - "com.amazonaws.dynamodb#ItemCollectionSizeLimitExceededException" - ): ItemCollectionSizeLimitExceededException, - ShapeID( - "com.amazonaws.dynamodb#ProvisionedThroughputExceededException" - ): ProvisionedThroughputExceededException, - ShapeID( - "com.amazonaws.dynamodb#ReplicatedWriteConflictException" - ): ReplicatedWriteConflictException, - ShapeID( - "com.amazonaws.dynamodb#RequestLimitExceeded" - ): RequestLimitExceeded, - ShapeID( - "com.amazonaws.dynamodb#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.dynamodb#ThrottlingException"): ThrottlingException, - ShapeID( - "com.amazonaws.dynamodb#TransactionConflictException" - ): TransactionConflictException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CONDITIONAL_CHECK_FAILED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR, - _SCHEMA_INVALID_ENDPOINT_EXCEPTION, - _SCHEMA_ITEM_COLLECTION_SIZE_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_PROVISIONED_THROUGHPUT_EXCEEDED_EXCEPTION, - _SCHEMA_REPLICATED_WRITE_CONFLICT_EXCEPTION, - _SCHEMA_REQUEST_LIMIT_EXCEEDED, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_TRANSACTION_CONFLICT_EXCEPTION, +DELETE_TABLE: APIOperation[DeleteTableInput, DeleteTableOutput] = APIOperation( + static_schema=_SCHEMA_DELETE_TABLE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#InvalidEndpointException"), + ShapeID("com.amazonaws.dynamodb#LimitExceededException"), + ShapeID("com.amazonaws.dynamodb#ResourceInUseException"), + ShapeID("com.amazonaws.dynamodb#ResourceNotFoundException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) +DESCRIBE_BACKUP: APIOperation[DescribeBackupInput, DescribeBackupOutput] = APIOperation( + static_schema=_SCHEMA_DESCRIBE_BACKUP, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#BackupNotFoundException"), + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#InvalidEndpointException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -@dataclass(kw_only=True) -class TransactWriteItem: - """ - A list of requests that can perform update, put, delete, or check - operations on multiple items in one or more tables atomically. - """ - - condition_check: "ConditionCheck | None" = None - """A request to perform a check item operation.""" - - put: "Put | None" = None - """A request to perform a `PutItem` operation.""" - - delete: "Delete | None" = None - """A request to perform a `DeleteItem` operation.""" - - update: "Update | None" = None - """A request to perform an `UpdateItem` operation.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRANSACT_WRITE_ITEM, self) +DESCRIBE_CONTINUOUS_BACKUPS: APIOperation[ + DescribeContinuousBackupsInput, DescribeContinuousBackupsOutput +] = APIOperation( + static_schema=_SCHEMA_DESCRIBE_CONTINUOUS_BACKUPS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#InvalidEndpointException"), + ShapeID("com.amazonaws.dynamodb#TableNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize_members(self, serializer: ShapeSerializer): - if self.condition_check is not None: - serializer.write_struct( - _SCHEMA_TRANSACT_WRITE_ITEM.members["ConditionCheck"], - self.condition_check, - ) +DESCRIBE_CONTRIBUTOR_INSIGHTS: APIOperation[ + DescribeContributorInsightsInput, DescribeContributorInsightsOutput +] = APIOperation( + static_schema=_SCHEMA_DESCRIBE_CONTRIBUTOR_INSIGHTS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#ResourceNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - if self.put is not None: - serializer.write_struct( - _SCHEMA_TRANSACT_WRITE_ITEM.members["Put"], self.put - ) +DESCRIBE_ENDPOINTS: APIOperation[DescribeEndpointsInput, DescribeEndpointsOutput] = ( + APIOperation( + static_schema=_SCHEMA_DESCRIBE_ENDPOINTS, + model_registry=_registry, + error_ids=[], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - if self.delete is not None: - serializer.write_struct( - _SCHEMA_TRANSACT_WRITE_ITEM.members["Delete"], self.delete - ) +DESCRIBE_GLOBAL_TABLE: APIOperation[ + DescribeGlobalTableInput, DescribeGlobalTableOutput +] = APIOperation( + static_schema=_SCHEMA_DESCRIBE_GLOBAL_TABLE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#GlobalTableNotFoundException"), + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#InvalidEndpointException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - if self.update is not None: - serializer.write_struct( - _SCHEMA_TRANSACT_WRITE_ITEM.members["Update"], self.update - ) +DESCRIBE_GLOBAL_TABLE_SETTINGS: APIOperation[ + DescribeGlobalTableSettingsInput, DescribeGlobalTableSettingsOutput +] = APIOperation( + static_schema=_SCHEMA_DESCRIBE_GLOBAL_TABLE_SETTINGS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#GlobalTableNotFoundException"), + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#InvalidEndpointException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) +DESCRIBE_IMPORT: APIOperation[DescribeImportInput, DescribeImportOutput] = APIOperation( + static_schema=_SCHEMA_DESCRIBE_IMPORT, + model_registry=_registry, + error_ids=[ShapeID("com.amazonaws.dynamodb#ImportNotFoundException")], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +DESCRIBE_KINESIS_STREAMING_DESTINATION: APIOperation[ + DescribeKinesisStreamingDestinationInput, DescribeKinesisStreamingDestinationOutput +] = APIOperation( + static_schema=_SCHEMA_DESCRIBE_KINESIS_STREAMING_DESTINATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#InvalidEndpointException"), + ShapeID("com.amazonaws.dynamodb#ResourceNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["condition_check"] = ConditionCheck.deserialize(de) +DESCRIBE_LIMITS: APIOperation[DescribeLimitsInput, DescribeLimitsOutput] = APIOperation( + static_schema=_SCHEMA_DESCRIBE_LIMITS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#InvalidEndpointException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 1: - kwargs["put"] = Put.deserialize(de) +DESCRIBE_TABLE: APIOperation[DescribeTableInput, DescribeTableOutput] = APIOperation( + static_schema=_SCHEMA_DESCRIBE_TABLE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#InvalidEndpointException"), + ShapeID("com.amazonaws.dynamodb#ResourceNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 2: - kwargs["delete"] = Delete.deserialize(de) +DESCRIBE_TABLE_REPLICA_AUTO_SCALING: APIOperation[ + DescribeTableReplicaAutoScalingInput, DescribeTableReplicaAutoScalingOutput +] = APIOperation( + static_schema=_SCHEMA_DESCRIBE_TABLE_REPLICA_AUTO_SCALING, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#ResourceNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 3: - kwargs["update"] = Update.deserialize(de) +DESCRIBE_TIME_TO_LIVE: APIOperation[ + DescribeTimeToLiveInput, DescribeTimeToLiveOutput +] = APIOperation( + static_schema=_SCHEMA_DESCRIBE_TIME_TO_LIVE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#InvalidEndpointException"), + ShapeID("com.amazonaws.dynamodb#ResourceNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case _: - logger.debug("Unexpected member schema: %s", schema) +DISABLE_KINESIS_STREAMING_DESTINATION: APIOperation[ + DisableKinesisStreamingDestinationInput, DisableKinesisStreamingDestinationOutput +] = APIOperation( + static_schema=_SCHEMA_DISABLE_KINESIS_STREAMING_DESTINATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#InvalidEndpointException"), + ShapeID("com.amazonaws.dynamodb#LimitExceededException"), + ShapeID("com.amazonaws.dynamodb#ResourceInUseException"), + ShapeID("com.amazonaws.dynamodb#ResourceNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - deserializer.read_struct(_SCHEMA_TRANSACT_WRITE_ITEM, consumer=_consumer) - return kwargs +ENABLE_KINESIS_STREAMING_DESTINATION: APIOperation[ + EnableKinesisStreamingDestinationInput, EnableKinesisStreamingDestinationOutput +] = APIOperation( + static_schema=_SCHEMA_ENABLE_KINESIS_STREAMING_DESTINATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#InvalidEndpointException"), + ShapeID("com.amazonaws.dynamodb#LimitExceededException"), + ShapeID("com.amazonaws.dynamodb#ResourceInUseException"), + ShapeID("com.amazonaws.dynamodb#ResourceNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +GET_RESOURCE_POLICY: APIOperation[GetResourcePolicyInput, GetResourcePolicyOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_RESOURCE_POLICY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#InvalidEndpointException"), + ShapeID("com.amazonaws.dynamodb#PolicyNotFoundException"), + ShapeID("com.amazonaws.dynamodb#ResourceNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) -UPDATE_ITEM = APIOperation( - input=UpdateItemInput, - output=UpdateItemOutput, - schema=_SCHEMA_UPDATE_ITEM, - input_schema=_SCHEMA_UPDATE_ITEM_INPUT, - output_schema=_SCHEMA_UPDATE_ITEM_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.dynamodb#ConditionalCheckFailedException" - ): ConditionalCheckFailedException, - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#InvalidEndpointException" - ): InvalidEndpointException, - ShapeID( - "com.amazonaws.dynamodb#ItemCollectionSizeLimitExceededException" - ): ItemCollectionSizeLimitExceededException, - ShapeID( - "com.amazonaws.dynamodb#ProvisionedThroughputExceededException" - ): ProvisionedThroughputExceededException, - ShapeID( - "com.amazonaws.dynamodb#ReplicatedWriteConflictException" - ): ReplicatedWriteConflictException, - ShapeID( - "com.amazonaws.dynamodb#RequestLimitExceeded" - ): RequestLimitExceeded, - ShapeID( - "com.amazonaws.dynamodb#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.dynamodb#ThrottlingException"): ThrottlingException, - ShapeID( - "com.amazonaws.dynamodb#TransactionConflictException" - ): TransactionConflictException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CONDITIONAL_CHECK_FAILED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR, - _SCHEMA_INVALID_ENDPOINT_EXCEPTION, - _SCHEMA_ITEM_COLLECTION_SIZE_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_PROVISIONED_THROUGHPUT_EXCEEDED_EXCEPTION, - _SCHEMA_REPLICATED_WRITE_CONFLICT_EXCEPTION, - _SCHEMA_REQUEST_LIMIT_EXCEEDED, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_TRANSACTION_CONFLICT_EXCEPTION, +IMPORT_TABLE: APIOperation[ImportTableInput, ImportTableOutput] = APIOperation( + static_schema=_SCHEMA_IMPORT_TABLE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#ImportConflictException"), + ShapeID("com.amazonaws.dynamodb#LimitExceededException"), + ShapeID("com.amazonaws.dynamodb#ResourceInUseException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) -BATCH_WRITE_ITEM = APIOperation( - input=BatchWriteItemInput, - output=BatchWriteItemOutput, - schema=_SCHEMA_BATCH_WRITE_ITEM, - input_schema=_SCHEMA_BATCH_WRITE_ITEM_INPUT, - output_schema=_SCHEMA_BATCH_WRITE_ITEM_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#InvalidEndpointException" - ): InvalidEndpointException, - ShapeID( - "com.amazonaws.dynamodb#ItemCollectionSizeLimitExceededException" - ): ItemCollectionSizeLimitExceededException, - ShapeID( - "com.amazonaws.dynamodb#ProvisionedThroughputExceededException" - ): ProvisionedThroughputExceededException, - ShapeID( - "com.amazonaws.dynamodb#ReplicatedWriteConflictException" - ): ReplicatedWriteConflictException, - ShapeID( - "com.amazonaws.dynamodb#RequestLimitExceeded" - ): RequestLimitExceeded, - ShapeID( - "com.amazonaws.dynamodb#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.dynamodb#ThrottlingException"): ThrottlingException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_SERVER_ERROR, - _SCHEMA_INVALID_ENDPOINT_EXCEPTION, - _SCHEMA_ITEM_COLLECTION_SIZE_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_PROVISIONED_THROUGHPUT_EXCEEDED_EXCEPTION, - _SCHEMA_REPLICATED_WRITE_CONFLICT_EXCEPTION, - _SCHEMA_REQUEST_LIMIT_EXCEEDED, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, +LIST_BACKUPS: APIOperation[ListBackupsInput, ListBackupsOutput] = APIOperation( + static_schema=_SCHEMA_LIST_BACKUPS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#InvalidEndpointException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) +LIST_CONTRIBUTOR_INSIGHTS: APIOperation[ + ListContributorInsightsInput, ListContributorInsightsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_CONTRIBUTOR_INSIGHTS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#ResourceNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -def _serialize_transact_write_item_list( - serializer: ShapeSerializer, schema: Schema, value: list[TransactWriteItem] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) +LIST_EXPORTS: APIOperation[ListExportsInput, ListExportsOutput] = APIOperation( + static_schema=_SCHEMA_LIST_EXPORTS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#LimitExceededException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +LIST_GLOBAL_TABLES: APIOperation[ListGlobalTablesInput, ListGlobalTablesOutput] = ( + APIOperation( + static_schema=_SCHEMA_LIST_GLOBAL_TABLES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#InvalidEndpointException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) -def _deserialize_transact_write_item_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[TransactWriteItem]: - result: list[TransactWriteItem] = [] +LIST_IMPORTS: APIOperation[ListImportsInput, ListImportsOutput] = APIOperation( + static_schema=_SCHEMA_LIST_IMPORTS, + model_registry=_registry, + error_ids=[ShapeID("com.amazonaws.dynamodb#LimitExceededException")], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() +LIST_TABLES: APIOperation[ListTablesInput, ListTablesOutput] = APIOperation( + static_schema=_SCHEMA_LIST_TABLES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#InvalidEndpointException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - else: - result.append(TransactWriteItem.deserialize(d)) +LIST_TAGS_OF_RESOURCE: APIOperation[ + ListTagsOfResourceInput, ListTagsOfResourceOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_TAGS_OF_RESOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#InvalidEndpointException"), + ShapeID("com.amazonaws.dynamodb#ResourceNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - deserializer.read_list(schema, _read_value) - return result +PUT_RESOURCE_POLICY: APIOperation[PutResourcePolicyInput, PutResourcePolicyOutput] = ( + APIOperation( + static_schema=_SCHEMA_PUT_RESOURCE_POLICY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#InvalidEndpointException"), + ShapeID("com.amazonaws.dynamodb#LimitExceededException"), + ShapeID("com.amazonaws.dynamodb#PolicyNotFoundException"), + ShapeID("com.amazonaws.dynamodb#ResourceInUseException"), + ShapeID("com.amazonaws.dynamodb#ResourceNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) +RESTORE_TABLE_FROM_BACKUP: APIOperation[ + RestoreTableFromBackupInput, RestoreTableFromBackupOutput +] = APIOperation( + static_schema=_SCHEMA_RESTORE_TABLE_FROM_BACKUP, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#BackupInUseException"), + ShapeID("com.amazonaws.dynamodb#BackupNotFoundException"), + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#InvalidEndpointException"), + ShapeID("com.amazonaws.dynamodb#LimitExceededException"), + ShapeID("com.amazonaws.dynamodb#TableAlreadyExistsException"), + ShapeID("com.amazonaws.dynamodb#TableInUseException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -@dataclass(kw_only=True) -class TransactWriteItemsInput: - """Dataclass for TransactWriteItemsInput structure.""" +RESTORE_TABLE_TO_POINT_IN_TIME: APIOperation[ + RestoreTableToPointInTimeInput, RestoreTableToPointInTimeOutput +] = APIOperation( + static_schema=_SCHEMA_RESTORE_TABLE_TO_POINT_IN_TIME, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#InvalidEndpointException"), + ShapeID("com.amazonaws.dynamodb#InvalidRestoreTimeException"), + ShapeID("com.amazonaws.dynamodb#LimitExceededException"), + ShapeID("com.amazonaws.dynamodb#PointInTimeRecoveryUnavailableException"), + ShapeID("com.amazonaws.dynamodb#TableAlreadyExistsException"), + ShapeID("com.amazonaws.dynamodb#TableInUseException"), + ShapeID("com.amazonaws.dynamodb#TableNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - transact_items: "list[TransactWriteItem] | None" = None - """ - An ordered array of up to 100 `TransactWriteItem` objects, each of which - contains a `ConditionCheck`, `Put`, `Update`, or `Delete` object. These - can operate on items in different tables, but the tables must reside in - the same Amazon Web Services account and Region, and no two of them can - operate on the same item. - """ +TAG_RESOURCE: APIOperation[TagResourceInput, TagResourceOutput] = APIOperation( + static_schema=_SCHEMA_TAG_RESOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#InvalidEndpointException"), + ShapeID("com.amazonaws.dynamodb#LimitExceededException"), + ShapeID("com.amazonaws.dynamodb#ResourceInUseException"), + ShapeID("com.amazonaws.dynamodb#ResourceNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - return_consumed_capacity: str | None = None - """ - Determines the level of detail about either provisioned or on-demand - throughput consumption that is returned in the response: +UNTAG_RESOURCE: APIOperation[UntagResourceInput, UntagResourceOutput] = APIOperation( + static_schema=_SCHEMA_UNTAG_RESOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#InvalidEndpointException"), + ShapeID("com.amazonaws.dynamodb#LimitExceededException"), + ShapeID("com.amazonaws.dynamodb#ResourceInUseException"), + ShapeID("com.amazonaws.dynamodb#ResourceNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - - `INDEXES` - The response includes the aggregate `ConsumedCapacity` for - the operation, together with `ConsumedCapacity` for each table and - secondary index that was accessed. +UPDATE_CONTINUOUS_BACKUPS: APIOperation[ + UpdateContinuousBackupsInput, UpdateContinuousBackupsOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_CONTINUOUS_BACKUPS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#ContinuousBackupsUnavailableException"), + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#InvalidEndpointException"), + ShapeID("com.amazonaws.dynamodb#TableNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - Note that some operations, such as `GetItem` and `BatchGetItem`, do - not access any indexes at all. In these cases, specifying `INDEXES` - will only return `ConsumedCapacity` information for table(s). +UPDATE_CONTRIBUTOR_INSIGHTS: APIOperation[ + UpdateContributorInsightsInput, UpdateContributorInsightsOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_CONTRIBUTOR_INSIGHTS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#ResourceNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - - `TOTAL` - The response includes only the aggregate `ConsumedCapacity` - for the operation. +UPDATE_GLOBAL_TABLE: APIOperation[UpdateGlobalTableInput, UpdateGlobalTableOutput] = ( + APIOperation( + static_schema=_SCHEMA_UPDATE_GLOBAL_TABLE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#GlobalTableNotFoundException"), + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#InvalidEndpointException"), + ShapeID("com.amazonaws.dynamodb#ReplicaAlreadyExistsException"), + ShapeID("com.amazonaws.dynamodb#ReplicaNotFoundException"), + ShapeID("com.amazonaws.dynamodb#TableNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - - `NONE` - No `ConsumedCapacity` details are included in the response. - """ +UPDATE_GLOBAL_TABLE_SETTINGS: APIOperation[ + UpdateGlobalTableSettingsInput, UpdateGlobalTableSettingsOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_GLOBAL_TABLE_SETTINGS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#GlobalTableNotFoundException"), + ShapeID("com.amazonaws.dynamodb#IndexNotFoundException"), + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#InvalidEndpointException"), + ShapeID("com.amazonaws.dynamodb#LimitExceededException"), + ShapeID("com.amazonaws.dynamodb#ReplicaNotFoundException"), + ShapeID("com.amazonaws.dynamodb#ResourceInUseException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - return_item_collection_metrics: str | None = None - """ - Determines whether item collection metrics are returned. If set to - `SIZE`, the response includes statistics about item collections (if - any), that were modified during the operation and are returned in the - response. If set to `NONE` (the default), no statistics are returned. - """ +UPDATE_KINESIS_STREAMING_DESTINATION: APIOperation[ + UpdateKinesisStreamingDestinationInput, UpdateKinesisStreamingDestinationOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_KINESIS_STREAMING_DESTINATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#InvalidEndpointException"), + ShapeID("com.amazonaws.dynamodb#LimitExceededException"), + ShapeID("com.amazonaws.dynamodb#ResourceInUseException"), + ShapeID("com.amazonaws.dynamodb#ResourceNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - client_request_token: str | None = None - """ - Providing a `ClientRequestToken` makes the call to `TransactWriteItems` - idempotent, meaning that multiple identical calls have the same effect - as one single call. +UPDATE_TABLE: APIOperation[UpdateTableInput, UpdateTableOutput] = APIOperation( + static_schema=_SCHEMA_UPDATE_TABLE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#InvalidEndpointException"), + ShapeID("com.amazonaws.dynamodb#LimitExceededException"), + ShapeID("com.amazonaws.dynamodb#ResourceInUseException"), + ShapeID("com.amazonaws.dynamodb#ResourceNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - Although multiple identical calls using the same client request token - produce the same result on the server (no side effects), the responses - to the calls might not be the same. If the `ReturnConsumedCapacity` - parameter is set, then the initial `TransactWriteItems` call returns the - amount of write capacity units consumed in making the changes. - Subsequent `TransactWriteItems` calls with the same client token return - the number of read capacity units consumed in reading the item. +UPDATE_TABLE_REPLICA_AUTO_SCALING: APIOperation[ + UpdateTableReplicaAutoScalingInput, UpdateTableReplicaAutoScalingOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_TABLE_REPLICA_AUTO_SCALING, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#LimitExceededException"), + ShapeID("com.amazonaws.dynamodb#ResourceInUseException"), + ShapeID("com.amazonaws.dynamodb#ResourceNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - A client request token is valid for 10 minutes after the first request - that uses it is completed. After 10 minutes, any request with the same - client token is treated as a new request. Do not resubmit the same - request with the same client token for more than 10 minutes, or the - result might not be idempotent. +UPDATE_TIME_TO_LIVE: APIOperation[UpdateTimeToLiveInput, UpdateTimeToLiveOutput] = ( + APIOperation( + static_schema=_SCHEMA_UPDATE_TIME_TO_LIVE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#InvalidEndpointException"), + ShapeID("com.amazonaws.dynamodb#LimitExceededException"), + ShapeID("com.amazonaws.dynamodb#ResourceInUseException"), + ShapeID("com.amazonaws.dynamodb#ResourceNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - If you submit a request with the same client token but a change in other - parameters within the 10-minute idempotency window, DynamoDB returns an - `IdempotentParameterMismatch` exception. - """ +DESCRIBE_EXPORT: APIOperation[DescribeExportInput, DescribeExportOutput] = APIOperation( + static_schema=_SCHEMA_DESCRIBE_EXPORT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#ExportNotFoundException"), + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#LimitExceededException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRANSACT_WRITE_ITEMS_INPUT, self) +GET_ITEM: APIOperation[GetItemInput, GetItemOutput] = APIOperation( + static_schema=_SCHEMA_GET_ITEM, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#InvalidEndpointException"), + ShapeID("com.amazonaws.dynamodb#ProvisionedThroughputExceededException"), + ShapeID("com.amazonaws.dynamodb#RequestLimitExceeded"), + ShapeID("com.amazonaws.dynamodb#ResourceNotFoundException"), + ShapeID("com.amazonaws.dynamodb#ThrottlingException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize_members(self, serializer: ShapeSerializer): - if self.transact_items is not None: - _serialize_transact_write_item_list( - serializer, - _SCHEMA_TRANSACT_WRITE_ITEMS_INPUT.members["TransactItems"], - self.transact_items, - ) +EXPORT_TABLE_TO_POINT_IN_TIME: APIOperation[ + ExportTableToPointInTimeInput, ExportTableToPointInTimeOutput +] = APIOperation( + static_schema=_SCHEMA_EXPORT_TABLE_TO_POINT_IN_TIME, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#ExportConflictException"), + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#InvalidExportTimeException"), + ShapeID("com.amazonaws.dynamodb#LimitExceededException"), + ShapeID("com.amazonaws.dynamodb#PointInTimeRecoveryUnavailableException"), + ShapeID("com.amazonaws.dynamodb#TableNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - if self.return_consumed_capacity is not None: - serializer.write_string( - _SCHEMA_TRANSACT_WRITE_ITEMS_INPUT.members["ReturnConsumedCapacity"], - self.return_consumed_capacity, - ) +SEARCH_VECTORS: APIOperation[SearchVectorsInput, SearchVectorsOutput] = APIOperation( + static_schema=_SCHEMA_SEARCH_VECTORS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#RequestLimitExceeded"), + ShapeID("com.amazonaws.dynamodb#ResourceNotFoundException"), + ShapeID("com.amazonaws.dynamodb#ThrottlingException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - if self.return_item_collection_metrics is not None: - serializer.write_string( - _SCHEMA_TRANSACT_WRITE_ITEMS_INPUT.members[ - "ReturnItemCollectionMetrics" - ], - self.return_item_collection_metrics, - ) +EXECUTE_STATEMENT: APIOperation[ExecuteStatementInput, ExecuteStatementOutput] = ( + APIOperation( + static_schema=_SCHEMA_EXECUTE_STATEMENT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#ConditionalCheckFailedException"), + ShapeID("com.amazonaws.dynamodb#DuplicateItemException"), + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#ItemCollectionSizeLimitExceededException"), + ShapeID("com.amazonaws.dynamodb#ProvisionedThroughputExceededException"), + ShapeID("com.amazonaws.dynamodb#RequestLimitExceeded"), + ShapeID("com.amazonaws.dynamodb#ResourceNotFoundException"), + ShapeID("com.amazonaws.dynamodb#ThrottlingException"), + ShapeID("com.amazonaws.dynamodb#TransactionConflictException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - if self.client_request_token is not None: - serializer.write_string( - _SCHEMA_TRANSACT_WRITE_ITEMS_INPUT.members["ClientRequestToken"], - self.client_request_token, - ) +EXECUTE_TRANSACTION: APIOperation[ExecuteTransactionInput, ExecuteTransactionOutput] = ( + APIOperation( + static_schema=_SCHEMA_EXECUTE_TRANSACTION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#IdempotentParameterMismatchException"), + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#ProvisionedThroughputExceededException"), + ShapeID("com.amazonaws.dynamodb#RequestLimitExceeded"), + ShapeID("com.amazonaws.dynamodb#ResourceNotFoundException"), + ShapeID("com.amazonaws.dynamodb#ThrottlingException"), + ShapeID("com.amazonaws.dynamodb#TransactionCanceledException"), + ShapeID("com.amazonaws.dynamodb#TransactionInProgressException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) +BATCH_EXECUTE_STATEMENT: APIOperation[ + BatchExecuteStatementInput, BatchExecuteStatementOutput +] = APIOperation( + static_schema=_SCHEMA_BATCH_EXECUTE_STATEMENT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#RequestLimitExceeded"), + ShapeID("com.amazonaws.dynamodb#ThrottlingException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +TRANSACT_GET_ITEMS: APIOperation[TransactGetItemsInput, TransactGetItemsOutput] = ( + APIOperation( + static_schema=_SCHEMA_TRANSACT_GET_ITEMS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#InvalidEndpointException"), + ShapeID("com.amazonaws.dynamodb#ProvisionedThroughputExceededException"), + ShapeID("com.amazonaws.dynamodb#RequestLimitExceeded"), + ShapeID("com.amazonaws.dynamodb#ResourceNotFoundException"), + ShapeID("com.amazonaws.dynamodb#ThrottlingException"), + ShapeID("com.amazonaws.dynamodb#TransactionCanceledException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["transact_items"] = _deserialize_transact_write_item_list( - de, _SCHEMA_TRANSACT_WRITE_ITEMS_INPUT.members["TransactItems"] - ) +BATCH_GET_ITEM: APIOperation[BatchGetItemInput, BatchGetItemOutput] = APIOperation( + static_schema=_SCHEMA_BATCH_GET_ITEM, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#InvalidEndpointException"), + ShapeID("com.amazonaws.dynamodb#ProvisionedThroughputExceededException"), + ShapeID("com.amazonaws.dynamodb#RequestLimitExceeded"), + ShapeID("com.amazonaws.dynamodb#ResourceNotFoundException"), + ShapeID("com.amazonaws.dynamodb#ThrottlingException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 1: - kwargs["return_consumed_capacity"] = ReturnConsumedCapacity( - de.read_string( - _SCHEMA_TRANSACT_WRITE_ITEMS_INPUT.members[ - "ReturnConsumedCapacity" - ] - ) - ) +SCAN: APIOperation[ScanInput, ScanOutput] = APIOperation( + static_schema=_SCHEMA_SCAN, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#InvalidEndpointException"), + ShapeID("com.amazonaws.dynamodb#ProvisionedThroughputExceededException"), + ShapeID("com.amazonaws.dynamodb#RequestLimitExceeded"), + ShapeID("com.amazonaws.dynamodb#ResourceNotFoundException"), + ShapeID("com.amazonaws.dynamodb#ThrottlingException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 2: - kwargs["return_item_collection_metrics"] = ( - ReturnItemCollectionMetrics( - de.read_string( - _SCHEMA_TRANSACT_WRITE_ITEMS_INPUT.members[ - "ReturnItemCollectionMetrics" - ] - ) - ) - ) +QUERY: APIOperation[QueryInput, QueryOutput] = APIOperation( + static_schema=_SCHEMA_QUERY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#InvalidEndpointException"), + ShapeID("com.amazonaws.dynamodb#ProvisionedThroughputExceededException"), + ShapeID("com.amazonaws.dynamodb#RequestLimitExceeded"), + ShapeID("com.amazonaws.dynamodb#ResourceNotFoundException"), + ShapeID("com.amazonaws.dynamodb#ThrottlingException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 3: - kwargs["client_request_token"] = de.read_string( - _SCHEMA_TRANSACT_WRITE_ITEMS_INPUT.members["ClientRequestToken"] - ) +DELETE_ITEM: APIOperation[DeleteItemInput, DeleteItemOutput] = APIOperation( + static_schema=_SCHEMA_DELETE_ITEM, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#ConditionalCheckFailedException"), + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#InvalidEndpointException"), + ShapeID("com.amazonaws.dynamodb#ItemCollectionSizeLimitExceededException"), + ShapeID("com.amazonaws.dynamodb#ProvisionedThroughputExceededException"), + ShapeID("com.amazonaws.dynamodb#ReplicatedWriteConflictException"), + ShapeID("com.amazonaws.dynamodb#RequestLimitExceeded"), + ShapeID("com.amazonaws.dynamodb#ResourceNotFoundException"), + ShapeID("com.amazonaws.dynamodb#ThrottlingException"), + ShapeID("com.amazonaws.dynamodb#TransactionConflictException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case _: - logger.debug("Unexpected member schema: %s", schema) +PUT_ITEM: APIOperation[PutItemInput, PutItemOutput] = APIOperation( + static_schema=_SCHEMA_PUT_ITEM, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#ConditionalCheckFailedException"), + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#InvalidEndpointException"), + ShapeID("com.amazonaws.dynamodb#ItemCollectionSizeLimitExceededException"), + ShapeID("com.amazonaws.dynamodb#ProvisionedThroughputExceededException"), + ShapeID("com.amazonaws.dynamodb#ReplicatedWriteConflictException"), + ShapeID("com.amazonaws.dynamodb#RequestLimitExceeded"), + ShapeID("com.amazonaws.dynamodb#ResourceNotFoundException"), + ShapeID("com.amazonaws.dynamodb#ThrottlingException"), + ShapeID("com.amazonaws.dynamodb#TransactionConflictException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - deserializer.read_struct(_SCHEMA_TRANSACT_WRITE_ITEMS_INPUT, consumer=_consumer) - return kwargs +UPDATE_ITEM: APIOperation[UpdateItemInput, UpdateItemOutput] = APIOperation( + static_schema=_SCHEMA_UPDATE_ITEM, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#ConditionalCheckFailedException"), + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#InvalidEndpointException"), + ShapeID("com.amazonaws.dynamodb#ItemCollectionSizeLimitExceededException"), + ShapeID("com.amazonaws.dynamodb#ProvisionedThroughputExceededException"), + ShapeID("com.amazonaws.dynamodb#ReplicatedWriteConflictException"), + ShapeID("com.amazonaws.dynamodb#RequestLimitExceeded"), + ShapeID("com.amazonaws.dynamodb#ResourceNotFoundException"), + ShapeID("com.amazonaws.dynamodb#ThrottlingException"), + ShapeID("com.amazonaws.dynamodb#TransactionConflictException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +BATCH_WRITE_ITEM: APIOperation[BatchWriteItemInput, BatchWriteItemOutput] = ( + APIOperation( + static_schema=_SCHEMA_BATCH_WRITE_ITEM, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#InvalidEndpointException"), + ShapeID("com.amazonaws.dynamodb#ItemCollectionSizeLimitExceededException"), + ShapeID("com.amazonaws.dynamodb#ProvisionedThroughputExceededException"), + ShapeID("com.amazonaws.dynamodb#ReplicatedWriteConflictException"), + ShapeID("com.amazonaws.dynamodb#RequestLimitExceeded"), + ShapeID("com.amazonaws.dynamodb#ResourceNotFoundException"), + ShapeID("com.amazonaws.dynamodb#ThrottlingException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) -TRANSACT_WRITE_ITEMS = APIOperation( - input=TransactWriteItemsInput, - output=TransactWriteItemsOutput, - schema=_SCHEMA_TRANSACT_WRITE_ITEMS, - input_schema=_SCHEMA_TRANSACT_WRITE_ITEMS_INPUT, - output_schema=_SCHEMA_TRANSACT_WRITE_ITEMS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.dynamodb#IdempotentParameterMismatchException" - ): IdempotentParameterMismatchException, - ShapeID("com.amazonaws.dynamodb#InternalServerError"): InternalServerError, - ShapeID( - "com.amazonaws.dynamodb#InvalidEndpointException" - ): InvalidEndpointException, - ShapeID( - "com.amazonaws.dynamodb#ProvisionedThroughputExceededException" - ): ProvisionedThroughputExceededException, - ShapeID( - "com.amazonaws.dynamodb#RequestLimitExceeded" - ): RequestLimitExceeded, - ShapeID( - "com.amazonaws.dynamodb#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.dynamodb#ThrottlingException"): ThrottlingException, - ShapeID( - "com.amazonaws.dynamodb#TransactionCanceledException" - ): TransactionCanceledException, - ShapeID( - "com.amazonaws.dynamodb#TransactionInProgressException" - ): TransactionInProgressException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_IDEMPOTENT_PARAMETER_MISMATCH_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR, - _SCHEMA_INVALID_ENDPOINT_EXCEPTION, - _SCHEMA_PROVISIONED_THROUGHPUT_EXCEEDED_EXCEPTION, - _SCHEMA_REQUEST_LIMIT_EXCEEDED, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_TRANSACTION_CANCELED_EXCEPTION, - _SCHEMA_TRANSACTION_IN_PROGRESS_EXCEPTION, +TRANSACT_WRITE_ITEMS: APIOperation[ + TransactWriteItemsInput, TransactWriteItemsOutput +] = APIOperation( + static_schema=_SCHEMA_TRANSACT_WRITE_ITEMS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.dynamodb#IdempotentParameterMismatchException"), + ShapeID("com.amazonaws.dynamodb#InternalServerError"), + ShapeID("com.amazonaws.dynamodb#InvalidEndpointException"), + ShapeID("com.amazonaws.dynamodb#ProvisionedThroughputExceededException"), + ShapeID("com.amazonaws.dynamodb#RequestLimitExceeded"), + ShapeID("com.amazonaws.dynamodb#ResourceNotFoundException"), + ShapeID("com.amazonaws.dynamodb#ThrottlingException"), + ShapeID("com.amazonaws.dynamodb#TransactionCanceledException"), + ShapeID("com.amazonaws.dynamodb#TransactionInProgressException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) diff --git a/clients/aws-sdk-dynamodb/src/aws_sdk_dynamodb/models.pyi b/clients/aws-sdk-dynamodb/src/aws_sdk_dynamodb/models.pyi new file mode 100644 index 00000000..5e7041d7 --- /dev/null +++ b/clients/aws-sdk-dynamodb/src/aws_sdk_dynamodb/models.pyi @@ -0,0 +1,9942 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. + +from dataclasses import dataclass +from datetime import datetime +from enum import StrEnum +from typing import Self, Union + +from smithy_core.deserializers import ShapeDeserializer +from smithy_core.exceptions import ModeledError +from smithy_core.response import ResponseMetadata +from smithy_core.schemas import APIOperation +from smithy_core.serializers import ShapeSerializer +from smithy_core.types import UnknownEnumMixin + +class _SerdeShape: + def serialize(self, serializer: ShapeSerializer) -> None: ... + def serialize_members(self, serializer: ShapeSerializer) -> None: ... + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: ... + +class ServiceError(ModeledError): + """ + Base error for all errors in the service. + + Some exceptions do not extend from this class, including + synthetic, implicit, and shared exception types. + """ + +class ApproximateCreationDateTimePrecision(UnknownEnumMixin, StrEnum): + MILLISECOND = "MILLISECOND" + MICROSECOND = "MICROSECOND" + +@dataclass(kw_only=True) +class ArchivalSummary(_SerdeShape): + """Contains details of a table archival operation.""" + + archival_date_time: datetime | None = ... + """ + The date and time when table archival was initiated by DynamoDB, in UNIX + epoch time format. + """ + archival_reason: str | None = ... + """ + The reason DynamoDB archived the table. Currently, the only possible + value is: + + - `INACCESSIBLE_ENCRYPTION_CREDENTIALS` - The table was archived due to + the table's KMS key being inaccessible for more than seven days. An + On-Demand backup was created at the archival time. + """ + archival_backup_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the backup the table was archived to, + when applicable in the archival reason. If you wish to restore this + backup to the same table name, you will need to delete the original + table. + """ + +class AttributeAction(UnknownEnumMixin, StrEnum): + ADD = "ADD" + PUT = "PUT" + DELETE = "DELETE" + +@dataclass(kw_only=True) +class AttributeDefinition(_SerdeShape): + """ + Represents an attribute for describing the schema for the table and + indexes. + """ + + attribute_name: str + """A name for the attribute.""" + attribute_type: str + """ + The data type for the attribute, where: + + - `S` - the attribute is of type String + + - `N` - the attribute is of type Number + + - `B` - the attribute is of type Binary + """ + +@dataclass +class AttributeValueS(_SerdeShape): + """ + An attribute of type String. For example: + + `"S": "Hello"` + """ + + value: str + +@dataclass +class AttributeValueN(_SerdeShape): + """ + An attribute of type Number. For example: + + `"N": "123.45"` + + Numbers are sent across the network to DynamoDB as strings, to maximize + compatibility across languages and libraries. However, DynamoDB treats + them as number type attributes for mathematical operations. + """ + + value: str + +@dataclass +class AttributeValueB(_SerdeShape): + """ + An attribute of type Binary. For example: + + `"B": "dGhpcyB0ZXh0IGlzIGJhc2U2NC1lbmNvZGVk"` + """ + + value: bytes + +@dataclass +class AttributeValueSS(_SerdeShape): + """ + An attribute of type String Set. For example: + + `"SS": ["Giraffe", "Hippo" ,"Zebra"]` + """ + + value: list[str] + +@dataclass +class AttributeValueNS(_SerdeShape): + """ + An attribute of type Number Set. For example: + + `"NS": ["42.2", "-19", "7.5", "3.14"]` + + Numbers are sent across the network to DynamoDB as strings, to maximize + compatibility across languages and libraries. However, DynamoDB treats + them as number type attributes for mathematical operations. + """ + + value: list[str] + +@dataclass +class AttributeValueBS(_SerdeShape): + """ + An attribute of type Binary Set. For example: + + `"BS": ["U3Vubnk=", "UmFpbnk=", "U25vd3k="]` + """ + + value: list[bytes] + +@dataclass +class AttributeValueM(_SerdeShape): + """ + An attribute of type Map. For example: + + `"M": {"Name": {"S": "Joe"}, "Age": {"N": "35"}}` + """ + + value: dict[str, AttributeValue] + +@dataclass +class AttributeValueL(_SerdeShape): + """ + An attribute of type List. For example: + + `"L": [ {"S": "Cookies"} , {"S": "Coffee"}, {"N": "3.14159"}]` + """ + + value: list[AttributeValue] + +@dataclass +class AttributeValueNULL(_SerdeShape): + """ + An attribute of type Null. For example: + + `"NULL": true` + """ + + value: bool + +@dataclass +class AttributeValueBOOL(_SerdeShape): + """ + An attribute of type Boolean. For example: + + `"BOOL": true` + """ + + value: bool + +@dataclass +class AttributeValueUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +AttributeValue = Union[ + AttributeValueS + | AttributeValueN + | AttributeValueB + | AttributeValueSS + | AttributeValueNS + | AttributeValueBS + | AttributeValueM + | AttributeValueL + | AttributeValueNULL + | AttributeValueBOOL + | AttributeValueUnknown +] +""" +Represents the data for an attribute. + +Each attribute value is described as a name-value pair. The name is the +data type, and the value is the data itself. + +For more information, see [Data +Types](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.NamingRulesDataTypes.html#HowItWorks.DataTypes) +in the *Amazon DynamoDB Developer Guide*. +""" + +class _AttributeValueDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> AttributeValue: ... + +@dataclass(kw_only=True) +class AttributeValueUpdate(_SerdeShape): + """ + For the `UpdateItem` operation, represents the attributes to be + modified, the action to perform on each, and the new value for each. + + Note: + You cannot use `UpdateItem` to update any primary key attributes. + Instead, you will need to delete the item, and then use `PutItem` to + create a new item with new attributes. + + Attribute values cannot be null; string and binary type attributes must + have lengths greater than zero; and set type attributes must not be + empty. Requests with empty values will be rejected with a + `ValidationException` exception. + """ + + value: AttributeValue | None = ... + """ + Represents the data for an attribute. + + Each attribute value is described as a name-value pair. The name is the + data type, and the value is the data itself. + + For more information, see [Data + Types](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.NamingRulesDataTypes.html#HowItWorks.DataTypes) + in the *Amazon DynamoDB Developer Guide*. + """ + action: str | None = ... + """ + Specifies how to perform the update. Valid values are `PUT` (default), + `DELETE`, and `ADD`. The behavior depends on whether the specified + primary key already exists in the table. + + **If an item with the specified *Key* is found in the table:** + + - `PUT` - Adds the specified attribute to the item. If the attribute + already exists, it is replaced by the new value. + + - `DELETE` - If no value is specified, the attribute and its value are + removed from the item. The data type of the specified value must match + the existing value's data type. + + If a *set* of values is specified, then those values are subtracted + from the old set. For example, if the attribute value was the set + `[a,b,c]` and the `DELETE` action specified `[a,c]`, then the final + attribute value would be `[b]`. Specifying an empty set is an error. + + - `ADD` - If the attribute does not already exist, then the attribute + and its values are added to the item. If the attribute does exist, + then the behavior of `ADD` depends on the data type of the attribute: + + - If the existing attribute is a number, and if `Value` is also a + number, then the `Value` is mathematically added to the existing + attribute. If `Value` is a negative number, then it is subtracted + from the existing attribute. + + Note: + If you use `ADD` to increment or decrement a number value for an + item that doesn't exist before the update, DynamoDB uses 0 as the + initial value. + + In addition, if you use `ADD` to update an existing item, and intend + to increment or decrement an attribute value which does not yet + exist, DynamoDB uses `0` as the initial value. For example, suppose + that the item you want to update does not yet have an attribute + named *itemcount*, but you decide to `ADD` the number `3` to this + attribute anyway, even though it currently does not exist. DynamoDB + will create the *itemcount* attribute, set its initial value to `0`, + and finally add `3` to it. The result will be a new *itemcount* + attribute in the item, with a value of `3`. + + - If the existing data type is a set, and if the `Value` is also a + set, then the `Value` is added to the existing set. (This is a *set* + operation, not mathematical addition.) For example, if the attribute + value was the set `[1,2]`, and the `ADD` action specified `[3]`, + then the final attribute value would be `[1,2,3]`. An error occurs + if an Add action is specified for a set attribute and the attribute + type specified does not match the existing set type. + + Both sets must have the same primitive data type. For example, if + the existing data type is a set of strings, the `Value` must also be + a set of strings. The same holds true for number sets and binary + sets. + + This action is only valid for an existing attribute whose data type is + number or is a set. Do not use `ADD` for any other data types. + + **If no item with the specified *Key* is found:** + + - `PUT` - DynamoDB creates a new item with the specified primary key, + and then adds the attribute. + + - `DELETE` - Nothing happens; there is no attribute to delete. + + - `ADD` - DynamoDB creates a new item with the supplied primary key and + number (or set) for the attribute value. The only data types allowed + are number, number set, string set or binary set. + """ + +@dataclass(kw_only=True) +class AutoScalingPolicyDescription(_SerdeShape): + """Represents the properties of the scaling policy.""" + + policy_name: str | None = ... + """The name of the scaling policy.""" + target_tracking_scaling_policy_configuration: ( + AutoScalingTargetTrackingScalingPolicyConfigurationDescription | None + ) = ... + """Represents a target tracking scaling policy configuration.""" + +@dataclass(kw_only=True) +class AutoScalingPolicyUpdate(_SerdeShape): + """Represents the auto scaling policy to be modified.""" + + policy_name: str | None = ... + """The name of the scaling policy.""" + target_tracking_scaling_policy_configuration: ( + AutoScalingTargetTrackingScalingPolicyConfigurationUpdate + ) + """Represents a target tracking scaling policy configuration.""" + +@dataclass(kw_only=True) +class AutoScalingSettingsDescription(_SerdeShape): + """ + Represents the auto scaling settings for a global table or global + secondary index. + """ + + minimum_units: int | None = ... + """ + The minimum capacity units that a global table or global secondary index + should be scaled down to. + """ + maximum_units: int | None = ... + """ + The maximum capacity units that a global table or global secondary index + should be scaled up to. + """ + auto_scaling_disabled: bool | None = ... + """Disabled auto scaling for this global table or global secondary index.""" + auto_scaling_role_arn: str | None = ... + """Role ARN used for configuring the auto scaling policy.""" + scaling_policies: list[AutoScalingPolicyDescription] | None = ... + """Information about the scaling policies.""" + +@dataclass(kw_only=True) +class AutoScalingSettingsUpdate(_SerdeShape): + """ + Represents the auto scaling settings to be modified for a global table + or global secondary index. + """ + + minimum_units: int | None = ... + """ + The minimum capacity units that a global table or global secondary index + should be scaled down to. + """ + maximum_units: int | None = ... + """ + The maximum capacity units that a global table or global secondary index + should be scaled up to. + """ + auto_scaling_disabled: bool | None = ... + """Disabled auto scaling for this global table or global secondary index.""" + auto_scaling_role_arn: str | None = ... + """Role ARN used for configuring auto scaling policy.""" + scaling_policy_update: AutoScalingPolicyUpdate | None = ... + """ + The scaling policy to apply for scaling target global table or global + secondary index capacity units. + """ + +@dataclass(kw_only=True) +class AutoScalingTargetTrackingScalingPolicyConfigurationDescription(_SerdeShape): + """Represents the properties of a target tracking scaling policy.""" + + disable_scale_in: bool | None = ... + """ + Indicates whether scale in by the target tracking policy is disabled. If + the value is true, scale in is disabled and the target tracking policy + won't remove capacity from the scalable resource. Otherwise, scale in + is enabled and the target tracking policy can remove capacity from the + scalable resource. The default value is false. + """ + scale_in_cooldown: int | None = ... + """ + The amount of time, in seconds, after a scale in activity completes + before another scale in activity can start. The cooldown period is used + to block subsequent scale in requests until it has expired. You should + scale in conservatively to protect your application's availability. + However, if another alarm triggers a scale out policy during the + cooldown period after a scale-in, application auto scaling scales out + your scalable target immediately. + """ + scale_out_cooldown: int | None = ... + """ + The amount of time, in seconds, after a scale out activity completes + before another scale out activity can start. While the cooldown period + is in effect, the capacity that has been added by the previous scale out + event that initiated the cooldown is calculated as part of the desired + capacity for the next scale out. You should continuously (but not + excessively) scale out. + """ + target_value: float + """ + The target value for the metric. The range is 8.515920e-109 to + 1.174271e+108 (Base 10) or 2e-360 to 2e360 (Base 2). + """ + +@dataclass(kw_only=True) +class AutoScalingTargetTrackingScalingPolicyConfigurationUpdate(_SerdeShape): + """ + Represents the settings of a target tracking scaling policy that will be + modified. + """ + + disable_scale_in: bool | None = ... + """ + Indicates whether scale in by the target tracking policy is disabled. If + the value is true, scale in is disabled and the target tracking policy + won't remove capacity from the scalable resource. Otherwise, scale in + is enabled and the target tracking policy can remove capacity from the + scalable resource. The default value is false. + """ + scale_in_cooldown: int | None = ... + """ + The amount of time, in seconds, after a scale in activity completes + before another scale in activity can start. The cooldown period is used + to block subsequent scale in requests until it has expired. You should + scale in conservatively to protect your application's availability. + However, if another alarm triggers a scale out policy during the + cooldown period after a scale-in, application auto scaling scales out + your scalable target immediately. + """ + scale_out_cooldown: int | None = ... + """ + The amount of time, in seconds, after a scale out activity completes + before another scale out activity can start. While the cooldown period + is in effect, the capacity that has been added by the previous scale out + event that initiated the cooldown is calculated as part of the desired + capacity for the next scale out. You should continuously (but not + excessively) scale out. + """ + target_value: float + """ + The target value for the metric. The range is 8.515920e-109 to + 1.174271e+108 (Base 10) or 2e-360 to 2e360 (Base 2). + """ + +@dataclass(kw_only=True) +class BackupDescription(_SerdeShape): + """Contains the description of the backup created for the table.""" + + backup_details: BackupDetails | None = ... + """Contains the details of the backup created for the table.""" + source_table_details: SourceTableDetails | None = ... + """Contains the details of the table when the backup was created.""" + source_table_feature_details: SourceTableFeatureDetails | None = ... + """ + Contains the details of the features enabled on the table when the + backup was created. For example, LSIs, GSIs, streams, TTL. + """ + +@dataclass(kw_only=True) +class BackupDetails(_SerdeShape): + """Contains the details of the backup created for the table.""" + + backup_arn: str + """ARN associated with the backup.""" + backup_name: str + """Name of the requested backup.""" + backup_size_bytes: int | None = ... + """ + Size of the backup in bytes. DynamoDB updates this value approximately + every six hours. Recent changes might not be reflected in this value. + """ + backup_status: str + """Backup can be in one of the following states: CREATING, ACTIVE, DELETED.""" + backup_type: str + """ + BackupType: + + - `USER` - You create and manage these using the on-demand backup + feature. + + - `SYSTEM` - If you delete a table with point-in-time recovery enabled, + a `SYSTEM` backup is automatically created and is retained for 35 days + (at no additional cost). System backups allow you to restore the + deleted table to the state it was in just before the point of + deletion. + + - `AWS_BACKUP` - On-demand backup created by you from Backup service. + """ + backup_creation_date_time: datetime + """ + Time at which the backup was created. This is the request time of the + backup. + """ + backup_expiry_date_time: datetime | None = ... + """ + Time at which the automatic on-demand backup created by DynamoDB will + expire. This `SYSTEM` on-demand backup expires automatically 35 days + after its creation. + """ + +@dataclass(kw_only=True) +class BackupInUseException(ServiceError, _SerdeShape): + """ + There is another ongoing conflicting backup control plane operation on + the table. The backup is either being created, deleted or restored to a + table. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class BackupNotFoundException(ServiceError, _SerdeShape): + """Backup not found for the given BackupARN.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class BackupStatus(UnknownEnumMixin, StrEnum): + CREATING = "CREATING" + DELETED = "DELETED" + AVAILABLE = "AVAILABLE" + +@dataclass(kw_only=True) +class BackupSummary(_SerdeShape): + """Contains details for the backup.""" + + table_name: str | None = ... + """Name of the table.""" + table_id: str | None = ... + """Unique identifier for the table.""" + table_arn: str | None = ... + """ARN associated with the table.""" + backup_arn: str | None = ... + """ARN associated with the backup.""" + backup_name: str | None = ... + """Name of the specified backup.""" + backup_creation_date_time: datetime | None = ... + """Time at which the backup was created.""" + backup_expiry_date_time: datetime | None = ... + """ + Time at which the automatic on-demand backup created by DynamoDB will + expire. This `SYSTEM` on-demand backup expires automatically 35 days + after its creation. + """ + backup_status: str | None = ... + """Backup can be in one of the following states: CREATING, ACTIVE, DELETED.""" + backup_type: str | None = ... + """ + BackupType: + + - `USER` - You create and manage these using the on-demand backup + feature. + + - `SYSTEM` - If you delete a table with point-in-time recovery enabled, + a `SYSTEM` backup is automatically created and is retained for 35 days + (at no additional cost). System backups allow you to restore the + deleted table to the state it was in just before the point of + deletion. + + - `AWS_BACKUP` - On-demand backup created by you from Backup service. + """ + backup_size_bytes: int | None = ... + """Size of the backup in bytes.""" + +class BackupType(UnknownEnumMixin, StrEnum): + USER = "USER" + SYSTEM = "SYSTEM" + AWS_BACKUP = "AWS_BACKUP" + +class BackupTypeFilter(UnknownEnumMixin, StrEnum): + USER = "USER" + SYSTEM = "SYSTEM" + AWS_BACKUP = "AWS_BACKUP" + ALL = "ALL" + +@dataclass(kw_only=True) +class BatchExecuteStatementInput(_SerdeShape): + """Dataclass for BatchExecuteStatementInput structure.""" + + statements: list[BatchStatementRequest] | None = ... + """The list of PartiQL statements representing the batch to run.""" + return_consumed_capacity: str | None = ... + """ + Determines the level of detail about either provisioned or on-demand + throughput consumption that is returned in the response: + + - `INDEXES` - The response includes the aggregate `ConsumedCapacity` for + the operation, together with `ConsumedCapacity` for each table and + secondary index that was accessed. + + Note that some operations, such as `GetItem` and `BatchGetItem`, do + not access any indexes at all. In these cases, specifying `INDEXES` + will only return `ConsumedCapacity` information for table(s). + + - `TOTAL` - The response includes only the aggregate `ConsumedCapacity` + for the operation. + + - `NONE` - No `ConsumedCapacity` details are included in the response. + """ + +@dataclass(kw_only=True) +class BatchExecuteStatementOutput(_SerdeShape): + """Dataclass for BatchExecuteStatementOutput structure.""" + + responses: list[BatchStatementResponse] | None = ... + """ + The response to each PartiQL statement in the batch. The values of the + list are ordered according to the ordering of the request statements. + """ + consumed_capacity: list[ConsumedCapacity] | None = ... + """ + The capacity units consumed by the entire operation. The values of the + list are ordered according to the ordering of the statements. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class BatchGetItemInput(_SerdeShape): + """Represents the input of a `BatchGetItem` operation.""" + + request_items: dict[str, KeysAndAttributes] | None = ... + """ + A map of one or more table names or table ARNs and, for each table, a + map that describes one or more items to retrieve from that table. Each + table name or ARN can be used only once per `BatchGetItem` request. + + Each element in the map of items to retrieve consists of the following: + + - `ConsistentRead` - If `true`, a strongly consistent read is used; if + `false` (the default), an eventually consistent read is used. + + - `ExpressionAttributeNames` - One or more substitution tokens for + attribute names in the `ProjectionExpression` parameter. The following + are some use cases for using `ExpressionAttributeNames`: + + - To access an attribute whose name conflicts with a DynamoDB reserved + word. + + - To create a placeholder for repeating occurrences of an attribute + name in an expression. + + - To prevent special characters in an attribute name from being + misinterpreted in an expression. + + Use the **#** character in an expression to dereference an attribute + name. For example, consider the following attribute name: + + - `Percentile` + + The name of this attribute conflicts with a reserved word, so it + cannot be used directly in an expression. (For the complete list of + reserved words, see [Reserved + Words](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html) + in the *Amazon DynamoDB Developer Guide*). To work around this, you + could specify the following for `ExpressionAttributeNames`: + + - `{"#P":"Percentile"}` + + You could then use this substitution in an expression, as in this + example: + + - `#P = :val` + + Note: + Tokens that begin with the **:** character are *expression attribute + values*, which are placeholders for the actual value at runtime. + + For more information about expression attribute names, see [Accessing + Item + Attributes](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) + in the *Amazon DynamoDB Developer Guide*. + + - `Keys` - An array of primary key attribute values that define specific + items in the table. For each primary key, you must provide *all* of + the key attributes. For example, with a simple primary key, you only + need to provide the partition key value. For a composite key, you must + provide *both* the partition key value and the sort key value. + + - `ProjectionExpression` - A string that identifies one or more + attributes to retrieve from the table. These attributes can include + scalars, sets, or elements of a JSON document. The attributes in the + expression must be separated by commas. + + If no attribute names are specified, then all attributes are returned. + If any of the requested attributes are not found, they do not appear + in the result. + + For more information, see [Accessing Item + Attributes](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) + in the *Amazon DynamoDB Developer Guide*. + + - `AttributesToGet` - This is a legacy parameter. Use + `ProjectionExpression` instead. For more information, see + [AttributesToGet](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.AttributesToGet.html) + in the *Amazon DynamoDB Developer Guide*. + """ + return_consumed_capacity: str | None = ... + """ + Determines the level of detail about either provisioned or on-demand + throughput consumption that is returned in the response: + + - `INDEXES` - The response includes the aggregate `ConsumedCapacity` for + the operation, together with `ConsumedCapacity` for each table and + secondary index that was accessed. + + Note that some operations, such as `GetItem` and `BatchGetItem`, do + not access any indexes at all. In these cases, specifying `INDEXES` + will only return `ConsumedCapacity` information for table(s). + + - `TOTAL` - The response includes only the aggregate `ConsumedCapacity` + for the operation. + + - `NONE` - No `ConsumedCapacity` details are included in the response. + """ + +@dataclass(kw_only=True) +class BatchGetItemOutput(_SerdeShape): + """Represents the output of a `BatchGetItem` operation.""" + + responses: dict[str, list[dict[str, AttributeValue]]] | None = ... + """ + A map of table name or table ARN to a list of items. Each object in + `Responses` consists of a table name or ARN, along with a map of + attribute data consisting of the data type and attribute value. + """ + unprocessed_keys: dict[str, KeysAndAttributes] | None = ... + """ + A map of tables and their respective keys that were not processed with + the current response. The `UnprocessedKeys` value is in the same form as + `RequestItems`, so the value can be provided directly to a subsequent + `BatchGetItem` operation. For more information, see `RequestItems` in + the Request Parameters section. + + Each element consists of: + + - `Keys` - An array of primary key attribute values that define specific + items in the table. + + - `ProjectionExpression` - One or more attributes to be retrieved from + the table or index. By default, all attributes are returned. If a + requested attribute is not found, it does not appear in the result. + + - `ConsistentRead` - The consistency of a read operation. If set to + `true`, then a strongly consistent read is used; otherwise, an + eventually consistent read is used. + + If there are no unprocessed keys remaining, the response contains an + empty `UnprocessedKeys` map. + """ + consumed_capacity: list[ConsumedCapacity] | None = ... + """ + The read capacity units consumed by the entire `BatchGetItem` operation. + + Each element consists of: + + - `TableName` - The table that consumed the provisioned throughput. + + - `CapacityUnits` - The total number of capacity units consumed. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class BatchStatementError(_SerdeShape): + """An error associated with a statement in a PartiQL batch that was run.""" + + code: str | None = ... + """The error code associated with the failed PartiQL batch statement.""" + message: str | None = ... + """The error message associated with the PartiQL batch response.""" + item: dict[str, AttributeValue] | None = ... + """ + The item which caused the condition check to fail. This will be set if + ReturnValuesOnConditionCheckFailure is specified as `ALL_OLD`. + """ + +class BatchStatementErrorCodeEnum(UnknownEnumMixin, StrEnum): + CONDITIONAL_CHECK_FAILED = "ConditionalCheckFailed" + ITEM_COLLECTION_SIZE_LIMIT_EXCEEDED = "ItemCollectionSizeLimitExceeded" + REQUEST_LIMIT_EXCEEDED = "RequestLimitExceeded" + VALIDATION_ERROR = "ValidationError" + PROVISIONED_THROUGHPUT_EXCEEDED = "ProvisionedThroughputExceeded" + TRANSACTION_CONFLICT = "TransactionConflict" + THROTTLING_ERROR = "ThrottlingError" + INTERNAL_SERVER_ERROR = "InternalServerError" + RESOURCE_NOT_FOUND = "ResourceNotFound" + ACCESS_DENIED = "AccessDenied" + DUPLICATE_ITEM = "DuplicateItem" + +@dataclass(kw_only=True) +class BatchStatementRequest(_SerdeShape): + """A PartiQL batch statement request.""" + + statement: str + """A valid PartiQL statement.""" + parameters: list[AttributeValue] | None = ... + """The parameters associated with a PartiQL statement in the batch request.""" + consistent_read: bool | None = ... + """The read consistency of the PartiQL batch request.""" + return_values_on_condition_check_failure: str | None = ... + """ + An optional parameter that returns the item attributes for a PartiQL + batch request operation that failed a condition check. + + There is no additional cost associated with requesting a return value + aside from the small network and processing overhead of receiving a + larger response. No read capacity units are consumed. + """ + +@dataclass(kw_only=True) +class BatchStatementResponse(_SerdeShape): + """A PartiQL batch statement response..""" + + error: BatchStatementError | None = ... + """The error associated with a failed PartiQL batch statement.""" + table_name: str | None = ... + """The table name associated with a failed PartiQL batch statement.""" + item: dict[str, AttributeValue] | None = ... + """A DynamoDB item associated with a BatchStatementResponse""" + +@dataclass(kw_only=True) +class BatchWriteItemInput(_SerdeShape): + """Represents the input of a `BatchWriteItem` operation.""" + + request_items: dict[str, list[WriteRequest]] | None = ... + """ + A map of one or more table names or table ARNs and, for each table, a + list of operations to be performed (`DeleteRequest` or `PutRequest`). + Each element in the map consists of the following: + + - `DeleteRequest` - Perform a `DeleteItem` operation on the specified + item. The item to be deleted is identified by a `Key` subelement: + + - `Key` - A map of primary key attribute values that uniquely identify + the item. Each entry in this map consists of an attribute name and + an attribute value. For each primary key, you must provide *all* of + the key attributes. For example, with a simple primary key, you only + need to provide a value for the partition key. For a composite + primary key, you must provide values for *both* the partition key + and the sort key. + + - `PutRequest` - Perform a `PutItem` operation on the specified item. + The item to be put is identified by an `Item` subelement: + + - `Item` - A map of attributes and their values. Each entry in this + map consists of an attribute name and an attribute value. Attribute + values must not be null; string and binary type attributes must have + lengths greater than zero; and set type attributes must not be + empty. Requests that contain empty values are rejected with a + `ValidationException` exception. + + If you specify any attributes that are part of an index key, then + the data types for those attributes must match those of the schema + in the table's attribute definition. + """ + return_consumed_capacity: str | None = ... + """ + Determines the level of detail about either provisioned or on-demand + throughput consumption that is returned in the response: + + - `INDEXES` - The response includes the aggregate `ConsumedCapacity` for + the operation, together with `ConsumedCapacity` for each table and + secondary index that was accessed. + + Note that some operations, such as `GetItem` and `BatchGetItem`, do + not access any indexes at all. In these cases, specifying `INDEXES` + will only return `ConsumedCapacity` information for table(s). + + - `TOTAL` - The response includes only the aggregate `ConsumedCapacity` + for the operation. + + - `NONE` - No `ConsumedCapacity` details are included in the response. + """ + return_item_collection_metrics: str | None = ... + """ + Determines whether item collection metrics are returned. If set to + `SIZE`, the response includes statistics about item collections, if any, + that were modified during the operation are returned in the response. If + set to `NONE` (the default), no statistics are returned. + """ + +@dataclass(kw_only=True) +class BatchWriteItemOutput(_SerdeShape): + """Represents the output of a `BatchWriteItem` operation.""" + + unprocessed_items: dict[str, list[WriteRequest]] | None = ... + """ + A map of tables and requests against those tables that were not + processed. The `UnprocessedItems` value is in the same form as + `RequestItems`, so you can provide this value directly to a subsequent + `BatchWriteItem` operation. For more information, see `RequestItems` in + the Request Parameters section. + + Each `UnprocessedItems` entry consists of a table name or table ARN and, + for that table, a list of operations to perform (`DeleteRequest` or + `PutRequest`). + + - `DeleteRequest` - Perform a `DeleteItem` operation on the specified + item. The item to be deleted is identified by a `Key` subelement: + + - `Key` - A map of primary key attribute values that uniquely identify + the item. Each entry in this map consists of an attribute name and + an attribute value. + + - `PutRequest` - Perform a `PutItem` operation on the specified item. + The item to be put is identified by an `Item` subelement: + + - `Item` - A map of attributes and their values. Each entry in this + map consists of an attribute name and an attribute value. Attribute + values must not be null; string and binary type attributes must have + lengths greater than zero; and set type attributes must not be + empty. Requests that contain empty values will be rejected with a + `ValidationException` exception. + + If you specify any attributes that are part of an index key, then + the data types for those attributes must match those of the schema + in the table's attribute definition. + + If there are no unprocessed items remaining, the response contains an + empty `UnprocessedItems` map. + """ + item_collection_metrics: dict[str, list[ItemCollectionMetrics]] | None = ... + """ + A list of tables that were processed by `BatchWriteItem` and, for each + table, information about any item collections that were affected by + individual `DeleteItem` or `PutItem` operations. + + Each entry consists of the following subelements: + + - `ItemCollectionKey` - The partition key value of the item collection. + This is the same as the partition key value of the item. + + - `SizeEstimateRangeGB` - An estimate of item collection size, expressed + in GB. This is a two-element array containing a lower bound and an + upper bound for the estimate. The estimate includes the size of all + the items in the table, plus the size of all attributes projected into + all of the local secondary indexes on the table. Use this estimate to + measure whether a local secondary index is approaching its size limit. + + The estimate is subject to change over time; therefore, do not rely on + the precision or accuracy of the estimate. + """ + consumed_capacity: list[ConsumedCapacity] | None = ... + """ + The capacity units consumed by the entire `BatchWriteItem` operation. + + Each element consists of: + + - `TableName` - The table that consumed the provisioned throughput. + + - `CapacityUnits` - The total number of capacity units consumed. + + If the table has vector indexes, each element also includes a + `VectorIndexes` field with `VectorWriteRequestBytes` consumed for each + affected vector index. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class BillingMode(UnknownEnumMixin, StrEnum): + PROVISIONED = "PROVISIONED" + PAY_PER_REQUEST = "PAY_PER_REQUEST" + +@dataclass(kw_only=True) +class BillingModeSummary(_SerdeShape): + """ + Contains the details for the read/write capacity mode. This page talks + about `PROVISIONED` and `PAY_PER_REQUEST` billing modes. For more + information about these modes, see [Read/write capacity + mode](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html). + + Note: + You may need to switch to on-demand mode at least once in order to + return a `BillingModeSummary` response. + """ + + billing_mode: str | None = ... + """ + Controls how you are charged for read and write throughput and how you + manage capacity. This setting can be changed later. + + - `PROVISIONED` - Sets the read/write capacity mode to `PROVISIONED`. We + recommend using `PROVISIONED` for predictable workloads. + + - `PAY_PER_REQUEST` - Sets the read/write capacity mode to + `PAY_PER_REQUEST`. We recommend using `PAY_PER_REQUEST` for + unpredictable workloads. + """ + last_update_to_pay_per_request_date_time: datetime | None = ... + """ + Represents the time when `PAY_PER_REQUEST` was last set as the + read/write capacity mode. + """ + +@dataclass(kw_only=True) +class CancellationReason(_SerdeShape): + """ + An ordered list of errors for each item in the request which caused the + transaction to get cancelled. The values of the list are ordered + according to the ordering of the `TransactWriteItems` request parameter. + If no error occurred for the associated item an error with a Null code + and Null message will be present. + """ + + item: dict[str, AttributeValue] | None = ... + """Item in the request which caused the transaction to get cancelled.""" + code: str | None = ... + """Status code for the result of the cancelled transaction.""" + message: str | None = ... + """Cancellation reason message description.""" + +@dataclass(kw_only=True) +class Capacity(_SerdeShape): + """ + Represents the amount of provisioned throughput capacity consumed on a + table or an index. + """ + + read_capacity_units: float | None = ... + """The total number of read capacity units consumed on a table or an index.""" + write_capacity_units: float | None = ... + """ + The total number of write capacity units consumed on a table or an + index. + """ + capacity_units: float | None = ... + """The total number of capacity units consumed on a table or an index.""" + +class ComparisonOperator(UnknownEnumMixin, StrEnum): + EQ = "EQ" + NE = "NE" + IN_ = "IN" + LE = "LE" + LT = "LT" + GE = "GE" + GT = "GT" + BETWEEN = "BETWEEN" + NOT_NULL = "NOT_NULL" + NULL = "NULL" + CONTAINS = "CONTAINS" + NOT_CONTAINS = "NOT_CONTAINS" + BEGINS_WITH = "BEGINS_WITH" + +@dataclass(kw_only=True) +class Condition(_SerdeShape): + """ + Represents the selection criteria for a `Query` or `Scan` operation: + + - For a `Query` operation, `Condition` is used for specifying the + `KeyConditions` to use when querying a table or an index. For + `KeyConditions`, only the following comparison operators are + supported: + + `EQ | LE | LT | GE | GT | BEGINS_WITH | BETWEEN` + + `Condition` is also used in a `QueryFilter`, which evaluates the query + results and returns only the desired values. + + - For a `Scan` operation, `Condition` is used in a `ScanFilter`, which + evaluates the scan results and returns only the desired values. + """ + + attribute_value_list: list[AttributeValue] | None = ... + """ + One or more values to evaluate against the supplied attribute. The + number of values in the list depends on the `ComparisonOperator` being + used. + + For type Number, value comparisons are numeric. + + String value comparisons for greater than, equals, or less than are + based on ASCII character code values. For example, `a` is greater than + `A`, and `a` is greater than `B`. For a list of code values, see + . + + For Binary, DynamoDB treats each byte of the binary data as unsigned + when it compares binary values. + """ + comparison_operator: str + """ + A comparator for evaluating attributes. For example, equals, greater + than, less than, etc. + + The following comparison operators are available: + + `EQ | NE | LE | LT | GE | GT | NOT_NULL | NULL | CONTAINS | NOT_CONTAINS | BEGINS_WITH | IN | BETWEEN` + + The following are descriptions of each comparison operator. + + - `EQ` : Equal. `EQ` is supported for all data types, including lists + and maps. + + `AttributeValueList` can contain only one `AttributeValue` element of + type String, Number, Binary, String Set, Number Set, or Binary Set. If + an item contains an `AttributeValue` element of a different type than + the one provided in the request, the value does not match. For + example, `{"S":"6"}` does not equal `{"N":"6"}`. Also, `{"N":"6"}` + does not equal `{"NS":["6", "2", "1"]}`. + + - `NE` : Not equal. `NE` is supported for all data types, including + lists and maps. + + `AttributeValueList` can contain only one `AttributeValue` of type + String, Number, Binary, String Set, Number Set, or Binary Set. If an + item contains an `AttributeValue` of a different type than the one + provided in the request, the value does not match. For example, + `{"S":"6"}` does not equal `{"N":"6"}`. Also, `{"N":"6"}` does not + equal `{"NS":["6", "2", "1"]}`. + + - `LE` : Less than or equal. + + `AttributeValueList` can contain only one `AttributeValue` element of + type String, Number, or Binary (not a set type). If an item contains + an `AttributeValue` element of a different type than the one provided + in the request, the value does not match. For example, `{"S":"6"}` + does not equal `{"N":"6"}`. Also, `{"N":"6"}` does not compare to + `{"NS":["6", "2", "1"]}`. + + - `LT` : Less than. + + `AttributeValueList` can contain only one `AttributeValue` of type + String, Number, or Binary (not a set type). If an item contains an + `AttributeValue` element of a different type than the one provided in + the request, the value does not match. For example, `{"S":"6"}` does + not equal `{"N":"6"}`. Also, `{"N":"6"}` does not compare to + `{"NS":["6", "2", "1"]}`. + + - `GE` : Greater than or equal. + + `AttributeValueList` can contain only one `AttributeValue` element of + type String, Number, or Binary (not a set type). If an item contains + an `AttributeValue` element of a different type than the one provided + in the request, the value does not match. For example, `{"S":"6"}` + does not equal `{"N":"6"}`. Also, `{"N":"6"}` does not compare to + `{"NS":["6", "2", "1"]}`. + + - `GT` : Greater than. + + `AttributeValueList` can contain only one `AttributeValue` element of + type String, Number, or Binary (not a set type). If an item contains + an `AttributeValue` element of a different type than the one provided + in the request, the value does not match. For example, `{"S":"6"}` + does not equal `{"N":"6"}`. Also, `{"N":"6"}` does not compare to + `{"NS":["6", "2", "1"]}`. + + - `NOT_NULL` : The attribute exists. `NOT_NULL` is supported for all + data types, including lists and maps. + + Note: + This operator tests for the existence of an attribute, not its data + type. If the data type of attribute \"`a`\" is null, and you evaluate + it using `NOT_NULL`, the result is a Boolean `true`. This result is + because the attribute \"`a`\" exists; its data type is not relevant to + the `NOT_NULL` comparison operator. + + - `NULL` : The attribute does not exist. `NULL` is supported for all + data types, including lists and maps. + + Note: + This operator tests for the nonexistence of an attribute, not its data + type. If the data type of attribute \"`a`\" is null, and you evaluate + it using `NULL`, the result is a Boolean `false`. This is because the + attribute \"`a`\" exists; its data type is not relevant to the `NULL` + comparison operator. + + - `CONTAINS` : Checks for a subsequence, or value in a set. + + `AttributeValueList` can contain only one `AttributeValue` element of + type String, Number, or Binary (not a set type). If the target + attribute of the comparison is of type String, then the operator + checks for a substring match. If the target attribute of the + comparison is of type Binary, then the operator looks for a + subsequence of the target that matches the input. If the target + attribute of the comparison is a set (\"`SS`\", \"`NS`\", or + \"`BS`\"), then the operator evaluates to true if it finds an exact + match with any member of the set. + + CONTAINS is supported for lists: When evaluating \"`a CONTAINS b`\", + \"`a`\" can be a list; however, \"`b`\" cannot be a set, a map, or a + list. + + - `NOT_CONTAINS` : Checks for absence of a subsequence, or absence of a + value in a set. + + `AttributeValueList` can contain only one `AttributeValue` element of + type String, Number, or Binary (not a set type). If the target + attribute of the comparison is a String, then the operator checks for + the absence of a substring match. If the target attribute of the + comparison is Binary, then the operator checks for the absence of a + subsequence of the target that matches the input. If the target + attribute of the comparison is a set (\"`SS`\", \"`NS`\", or + \"`BS`\"), then the operator evaluates to true if it *does not* find + an exact match with any member of the set. + + NOT_CONTAINS is supported for lists: When evaluating + \"`a NOT CONTAINS b`\", \"`a`\" can be a list; however, \"`b`\" cannot + be a set, a map, or a list. + + - `BEGINS_WITH` : Checks for a prefix. + + `AttributeValueList` can contain only one `AttributeValue` of type + String or Binary (not a Number or a set type). The target attribute of + the comparison must be of type String or Binary (not a Number or a set + type). + + - `IN` : Checks for matching elements in a list. + + `AttributeValueList` can contain one or more `AttributeValue` elements + of type String, Number, or Binary. These attributes are compared + against an existing attribute of an item. If any elements of the input + are equal to the item attribute, the expression evaluates to true. + + - `BETWEEN` : Greater than or equal to the first value, and less than or + equal to the second value. + + `AttributeValueList` must contain two `AttributeValue` elements of the + same type, either String, Number, or Binary (not a set type). A target + attribute matches if the target value is greater than, or equal to, + the first element and less than, or equal to, the second element. If + an item contains an `AttributeValue` element of a different type than + the one provided in the request, the value does not match. For + example, `{"S":"6"}` does not compare to `{"N":"6"}`. Also, + `{"N":"6"}` does not compare to `{"NS":["6", "2", "1"]}` + + For usage examples of `AttributeValueList` and `ComparisonOperator`, see + [Legacy Conditional + Parameters](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.html) + in the *Amazon DynamoDB Developer Guide*. + """ + +@dataclass(kw_only=True) +class ConditionalCheckFailedException(ServiceError, _SerdeShape): + """A condition specified in the operation failed to be evaluated.""" + + item: dict[str, AttributeValue] | None = ... + """Item which caused the `ConditionalCheckFailedException`.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class ConditionalOperator(UnknownEnumMixin, StrEnum): + AND_ = "AND" + OR_ = "OR" + +@dataclass(kw_only=True) +class ConditionCheck(_SerdeShape): + """ + Represents a request to perform a check that an item exists or to check + the condition of specific attributes of the item. + """ + + key: dict[str, AttributeValue] + """ + The primary key of the item to be checked. Each element consists of an + attribute name and a value for that attribute. + """ + table_name: str + """ + Name of the table for the check item request. You can also provide the + Amazon Resource Name (ARN) of the table in this parameter. + """ + condition_expression: str + """ + A condition that must be satisfied in order for a conditional update to + succeed. For more information, see [Condition + expressions](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.ConditionExpressions.html) + in the *Amazon DynamoDB Developer Guide*. + """ + expression_attribute_names: dict[str, str] | None = ... + """ + One or more substitution tokens for attribute names in an expression. + For more information, see [Expression attribute + names](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.ExpressionAttributeNames.html) + in the *Amazon DynamoDB Developer Guide*. + """ + expression_attribute_values: dict[str, AttributeValue] | None = ... + """ + One or more values that can be substituted in an expression. For more + information, see [Condition + expressions](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.ConditionExpressions.html) + in the *Amazon DynamoDB Developer Guide*. + """ + return_values_on_condition_check_failure: str | None = ... + """ + Use `ReturnValuesOnConditionCheckFailure` to get the item attributes if + the `ConditionCheck` condition fails. For + `ReturnValuesOnConditionCheckFailure`, the valid values are: NONE and + ALL_OLD. + """ + +@dataclass(kw_only=True) +class ConsumedCapacity(_SerdeShape): + """ + The capacity units consumed by an operation. The data returned includes + the total provisioned throughput consumed, along with statistics for the + table and any indexes involved in the operation. `ConsumedCapacity` is + only returned if the request asked for it. For more information, see + [Provisioned capacity + mode](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/provisioned-capacity-mode.html) + in the *Amazon DynamoDB Developer Guide*. + """ + + table_name: str | None = ... + """ + The name of the table that was affected by the operation. If you had + specified the Amazon Resource Name (ARN) of a table in the input, + you'll see the table ARN in the response. + """ + capacity_units: float | None = ... + """The total number of capacity units consumed by the operation.""" + read_capacity_units: float | None = ... + """The total number of read capacity units consumed by the operation.""" + write_capacity_units: float | None = ... + """The total number of write capacity units consumed by the operation.""" + table: Capacity | None = ... + """ + The amount of throughput consumed on the table affected by the + operation. + """ + local_secondary_indexes: dict[str, Capacity] | None = ... + """ + The amount of throughput consumed on each local index affected by the + operation. + """ + global_secondary_indexes: dict[str, Capacity] | None = ... + """ + The amount of throughput consumed on each global index affected by the + operation. + """ + vector_indexes: dict[str, VectorCapacity] | None = ... + """ + The amount of throughput consumed on each vector index affected by the + operation. Each entry contains `VectorWriteRequestBytes` (for write + operations) or `VectorSearchRequestBytes` (for search operations). + """ + +@dataclass(kw_only=True) +class ContinuousBackupsDescription(_SerdeShape): + """ + Represents the continuous backups and point in time recovery settings on + the table. + """ + + continuous_backups_status: str + """ + `ContinuousBackupsStatus` can be one of the following states: ENABLED, + DISABLED + """ + point_in_time_recovery_description: PointInTimeRecoveryDescription | None = ... + """ + The description of the point in time recovery settings applied to the + table. + """ + +class ContinuousBackupsStatus(UnknownEnumMixin, StrEnum): + ENABLED = "ENABLED" + DISABLED = "DISABLED" + +@dataclass(kw_only=True) +class ContinuousBackupsUnavailableException(ServiceError, _SerdeShape): + """Backups have not yet been enabled for this table.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class ContributorInsightsAction(UnknownEnumMixin, StrEnum): + ENABLE = "ENABLE" + DISABLE = "DISABLE" + +class ContributorInsightsMode(UnknownEnumMixin, StrEnum): + ACCESSED_AND_THROTTLED_KEYS = "ACCESSED_AND_THROTTLED_KEYS" + THROTTLED_KEYS = "THROTTLED_KEYS" + +class ContributorInsightsStatus(UnknownEnumMixin, StrEnum): + ENABLING = "ENABLING" + ENABLED = "ENABLED" + DISABLING = "DISABLING" + DISABLED = "DISABLED" + FAILED = "FAILED" + +@dataclass(kw_only=True) +class ContributorInsightsSummary(_SerdeShape): + """Represents a Contributor Insights summary entry.""" + + table_name: str | None = ... + """Name of the table associated with the summary.""" + index_name: str | None = ... + """Name of the index associated with the summary, if any.""" + contributor_insights_status: str | None = ... + """ + Describes the current status for contributor insights for the given + table and index, if applicable. + """ + contributor_insights_mode: str | None = ... + """ + Indicates the current mode of CloudWatch Contributor Insights, + specifying whether it tracks all access and throttled events or + throttled events only for the DynamoDB table or index. + """ + +@dataclass(kw_only=True) +class CreateBackupInput(_SerdeShape): + """Dataclass for CreateBackupInput structure.""" + + table_name: str | None = ... + """ + The name of the table. You can also provide the Amazon Resource Name + (ARN) of the table in this parameter. + """ + backup_name: str | None = ... + """Specified name for the backup.""" + +@dataclass(kw_only=True) +class CreateBackupOutput(_SerdeShape): + """Dataclass for CreateBackupOutput structure.""" + + backup_details: BackupDetails | None = ... + """Contains the details of the backup created for the table.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateGlobalSecondaryIndexAction(_SerdeShape): + """ + Represents a new global secondary index to be added to an existing + table. + """ + + index_name: str + """The name of the global secondary index to be created.""" + key_schema: list[KeySchemaElement] + """ + The key schema for the global secondary index. Global secondary index + supports up to 4 partition and up to 4 sort keys. + """ + projection: Projection + """ + Represents attributes that are copied (projected) from the table into an + index. These are in addition to the primary key attributes and index key + attributes, which are automatically projected. + """ + provisioned_throughput: ProvisionedThroughput | None = ... + """ + Represents the provisioned throughput settings for the specified global + secondary index. + + For current minimum and maximum provisioned throughput values, see + [Service, Account, and Table + Quotas](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html) + in the *Amazon DynamoDB Developer Guide*. + """ + on_demand_throughput: OnDemandThroughput | None = ... + """ + The maximum number of read and write units for the global secondary + index being created. If you use this parameter, you must specify + `MaxReadRequestUnits`, `MaxWriteRequestUnits`, or both. You must use + either `OnDemand Throughput` or `ProvisionedThroughput` based on your + table's capacity mode. + """ + warm_throughput: WarmThroughput | None = ... + """ + Represents the warm throughput value (in read units per second and write + units per second) when creating a secondary index. + """ + +@dataclass(kw_only=True) +class CreateGlobalTableInput(_SerdeShape): + """Dataclass for CreateGlobalTableInput structure.""" + + global_table_name: str | None = ... + """The global table name.""" + replication_group: list[Replica] | None = ... + """The Regions where the global table needs to be created.""" + +@dataclass(kw_only=True) +class CreateGlobalTableOutput(_SerdeShape): + """Dataclass for CreateGlobalTableOutput structure.""" + + global_table_description: GlobalTableDescription | None = ... + """Contains the details of the global table.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateGlobalTableWitnessGroupMemberAction(_SerdeShape): + """ + Specifies the action to add a new witness Region to a MRSC global table. + A MRSC global table can be configured with either three replicas, or + with two replicas and one witness. + """ + + region_name: str + """ + The Amazon Web Services Region name to be added as a witness Region for + the MRSC global table. The witness must be in a different Region than + the replicas and within the same Region set: + + - US Region set: US East (N. Virginia), US East (Ohio), US West (Oregon) + + - EU Region set: Europe (Ireland), Europe (London), Europe (Paris), + Europe (Frankfurt) + + - AP Region set: Asia Pacific (Tokyo), Asia Pacific (Seoul), Asia + Pacific (Osaka) + """ + +@dataclass(kw_only=True) +class CreateReplicaAction(_SerdeShape): + """Represents a replica to be added.""" + + region_name: str + """The Region of the replica to be added.""" + +@dataclass(kw_only=True) +class CreateReplicationGroupMemberAction(_SerdeShape): + """Represents a replica to be created.""" + + region_name: str + """The Region where the new replica will be created.""" + kms_master_key_id: str | None = ... + """ + The KMS key that should be used for KMS encryption in the new replica. + To specify a key, use its key ID, Amazon Resource Name (ARN), alias + name, or alias ARN. Note that you should only provide this parameter if + the key is different from the default DynamoDB KMS key + `alias/aws/dynamodb`. + """ + provisioned_throughput_override: ProvisionedThroughputOverride | None = ... + """ + Replica-specific provisioned throughput. If not specified, uses the + source table's provisioned throughput settings. + """ + on_demand_throughput_override: OnDemandThroughputOverride | None = ... + """ + The maximum on-demand throughput settings for the specified replica + table being created. You can only modify `MaxReadRequestUnits`, because + you can't modify `MaxWriteRequestUnits` for individual replica tables. + """ + global_secondary_indexes: list[ReplicaGlobalSecondaryIndex] | None = ... + """Replica-specific global secondary index settings.""" + table_class_override: str | None = ... + """ + Replica-specific table class. If not specified, uses the source table's + table class. + """ + +@dataclass(kw_only=True) +class CreateTableInput(_SerdeShape): + """Represents the input of a `CreateTable` operation.""" + + attribute_definitions: list[AttributeDefinition] | None = ... + """ + An array of attributes that describe the key schema for the table and + indexes. + """ + table_name: str | None = ... + """ + The name of the table to create. You can also provide the Amazon + Resource Name (ARN) of the table in this parameter. + """ + key_schema: list[KeySchemaElement] | None = ... + """ + Specifies the attributes that make up the primary key for a table or an + index. The attributes in `KeySchema` must also be defined in the + `AttributeDefinitions` array. For more information, see [Data + Model](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataModel.html) + in the *Amazon DynamoDB Developer Guide*. + + Each `KeySchemaElement` in the array is composed of: + + - `AttributeName` - The name of this key attribute. + + - `KeyType` - The role that the key attribute will assume: + + - `HASH` - partition key + + - `RANGE` - sort key + + Note: + The partition key of an item is also known as its *hash attribute*. The + term \"hash attribute\" derives from the DynamoDB usage of an internal + hash function to evenly distribute data items across partitions, based + on their partition key values. + + The sort key of an item is also known as its *range attribute*. The term + \"range attribute\" derives from the way DynamoDB stores items with the + same partition key physically close together, in sorted order by the + sort key value. + + For a simple primary key (partition key), you must provide exactly one + element with a `KeyType` of `HASH`. + + For a composite primary key (partition key and sort key), you must + provide exactly two elements, in this order: The first element must have + a `KeyType` of `HASH`, and the second element must have a `KeyType` of + `RANGE`. + + For more information, see [Working with + Tables](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#WorkingWithTables.primary.key) + in the *Amazon DynamoDB Developer Guide*. + """ + local_secondary_indexes: list[LocalSecondaryIndex] | None = ... + """ + One or more local secondary indexes (the maximum is 5) to be created on + the table. Each index is scoped to a given partition key value. There is + a 10 GB size limit per partition key value; otherwise, the size of a + local secondary index is unconstrained. + + Each local secondary index in the array includes the following: + + - `IndexName` - The name of the local secondary index. Must be unique + only for this table. + + - `KeySchema` - Specifies the key schema for the local secondary index. + The key schema must begin with the same partition key as the table. + + - `Projection` - Specifies attributes that are copied (projected) from + the table into the index. These are in addition to the primary key + attributes and index key attributes, which are automatically + projected. Each attribute specification is composed of: + + - `ProjectionType` - One of the following: + + - `KEYS_ONLY` - Only the index and primary keys are projected into + the index. + + - `INCLUDE` - Only the specified table attributes are projected into + the index. The list of projected attributes is in + `NonKeyAttributes`. + + - `ALL` - All of the table attributes are projected into the index. + + - `NonKeyAttributes` - A list of one or more non-key attribute names + that are projected into the secondary index. The total count of + attributes provided in `NonKeyAttributes`, summed across all of the + secondary indexes, must not exceed 100. If you project the same + attribute into two different indexes, this counts as two distinct + attributes when determining the total. This limit only applies when + you specify the ProjectionType of `INCLUDE`. You still can specify + the ProjectionType of `ALL` to project all attributes from the + source table, even if the table has more than 100 attributes. + """ + global_secondary_indexes: list[GlobalSecondaryIndex] | None = ... + """ + One or more global secondary indexes (the maximum is 20) to be created + on the table. Each global secondary index in the array includes the + following: + + - `IndexName` - The name of the global secondary index. Must be unique + only for this table. + + - `KeySchema` - Specifies the key schema for the global secondary index. + Each global secondary index supports up to 4 partition keys and up to + 4 sort keys. + + - `Projection` - Specifies attributes that are copied (projected) from + the table into the index. These are in addition to the primary key + attributes and index key attributes, which are automatically + projected. Each attribute specification is composed of: + + - `ProjectionType` - One of the following: + + - `KEYS_ONLY` - Only the index and primary keys are projected into + the index. + + - `INCLUDE` - Only the specified table attributes are projected into + the index. The list of projected attributes is in + `NonKeyAttributes`. + + - `ALL` - All of the table attributes are projected into the index. + + - `NonKeyAttributes` - A list of one or more non-key attribute names + that are projected into the secondary index. The total count of + attributes provided in `NonKeyAttributes`, summed across all of the + secondary indexes, must not exceed 100. If you project the same + attribute into two different indexes, this counts as two distinct + attributes when determining the total. This limit only applies when + you specify the ProjectionType of `INCLUDE`. You still can specify + the ProjectionType of `ALL` to project all attributes from the + source table, even if the table has more than 100 attributes. + + - `ProvisionedThroughput` - The provisioned throughput settings for the + global secondary index, consisting of read and write capacity units. + """ + billing_mode: str | None = ... + """ + Controls how you are charged for read and write throughput and how you + manage capacity. This setting can be changed later. + + - `PAY_PER_REQUEST` - We recommend using `PAY_PER_REQUEST` for most + DynamoDB workloads. `PAY_PER_REQUEST` sets the billing mode to + [On-demand capacity + mode](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/on-demand-capacity-mode.html). + + - `PROVISIONED` - We recommend using `PROVISIONED` for steady workloads + with predictable growth where capacity requirements can be reliably + forecasted. `PROVISIONED` sets the billing mode to [Provisioned + capacity + mode](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/provisioned-capacity-mode.html). + """ + provisioned_throughput: ProvisionedThroughput | None = ... + """ + Represents the provisioned throughput settings for a specified table or + index. The settings can be modified using the `UpdateTable` operation. + + If you set BillingMode as `PROVISIONED`, you must specify this property. + If you set BillingMode as `PAY_PER_REQUEST`, you cannot specify this + property. + + For current minimum and maximum provisioned throughput values, see + [Service, Account, and Table + Quotas](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html) + in the *Amazon DynamoDB Developer Guide*. + """ + stream_specification: StreamSpecification | None = ... + """ + The settings for DynamoDB Streams on the table. These settings consist + of: + + - `StreamEnabled` - Indicates whether DynamoDB Streams is to be enabled + (true) or disabled (false). + + - `StreamViewType` - When an item in the table is modified, + `StreamViewType` determines what information is written to the + table's stream. Valid values for `StreamViewType` are: + + - `KEYS_ONLY` - Only the key attributes of the modified item are + written to the stream. + + - `NEW_IMAGE` - The entire item, as it appears after it was modified, + is written to the stream. + + - `OLD_IMAGE` - The entire item, as it appeared before it was + modified, is written to the stream. + + - `NEW_AND_OLD_IMAGES` - Both the new and the old item images of the + item are written to the stream. + """ + sse_specification: SSESpecification | None = ... + """Represents the settings used to enable server-side encryption.""" + tags: list[Tag] | None = ... + """ + A list of key-value pairs to label the table. For more information, see + [Tagging for + DynamoDB](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tagging.html). + """ + table_class: str | None = ... + """ + The table class of the new table. Valid values are `STANDARD` and + `STANDARD_INFREQUENT_ACCESS`. + """ + deletion_protection_enabled: bool | None = ... + """ + Indicates whether deletion protection is to be enabled (true) or + disabled (false) on the table. + """ + warm_throughput: WarmThroughput | None = ... + """ + Represents the warm throughput (in read units per second and write units + per second) for creating a table. + """ + resource_policy: str | None = ... + """ + An Amazon Web Services resource-based policy document in JSON format + that will be attached to the table. + + When you attach a resource-based policy while creating a table, the + policy application is *strongly consistent*. + + The maximum size supported for a resource-based policy document is 20 + KB. DynamoDB counts whitespaces when calculating the size of a policy + against this limit. For a full list of all considerations that apply for + resource-based policies, see [Resource-based policy + considerations](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/rbac-considerations.html). + + Note: + You need to specify the `CreateTable` and `PutResourcePolicy` IAM + actions for authorizing a user to create a table with a resource-based + policy. + """ + on_demand_throughput: OnDemandThroughput | None = ... + """ + Sets the maximum number of read and write units for the specified table + in on-demand capacity mode. If you use this parameter, you must specify + `MaxReadRequestUnits`, `MaxWriteRequestUnits`, or both. + """ + global_table_source_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the source table used for the creation + of a multi-account global table. + """ + global_table_settings_replication_mode: str | None = ... + """ + Controls the settings synchronization mode for the global table. For + multi-account global tables, this parameter is required and the only + supported value is ENABLED. For same-account global tables, this + parameter is set to ENABLED_WITH_OVERRIDES. + """ + vector_indexes: list[VectorIndex] | None = ... + """ + One or more vector indexes to be created on the table. Each vector index + enables similarity search on a vector attribute. Each element in the + list consists of: + + - `IndexName` - The name of the vector index. Must be unique within the + table. + + - `VectorAttribute` - The attribute that contains vector embeddings. If + multiple vector indexes reference the same attribute, they must all + use the same number of dimensions. + + - `Dimensions` - The number of dimensions in each vector. + + - `DistanceFunction` - The distance function used to calculate + similarity. Valid values: `COSINE`, `EUCLIDEAN`, `DOT_PRODUCT`. + + - `Projection` - Specifies attributes that are copied (projected) from + the table into the vector index. The total number of projected non-key + attributes is shared across the vector attribute (counts as 1) and + `INLINE_FILTER` search schema elements (each counts as 1). `HASH` + search schema elements do not count toward this limit. + + - `SearchSchema` - (Optional) Defines the partition key (`HASH`) and + inline filter (`INLINE_FILTER`) attributes for the vector index. + """ + +@dataclass(kw_only=True) +class CreateTableOutput(_SerdeShape): + """Represents the output of a `CreateTable` operation.""" + + table_description: TableDescription | None = ... + """Represents the properties of the table.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateVectorIndexAction(_SerdeShape): + """A new vector index to be added to a table.""" + + index_name: str + """The name of the vector index. Must be unique within the table.""" + vector_attribute: VectorAttributeDefinition + """ + The attribute that contains vector embeddings. If multiple vector + indexes reference the same attribute, they must all use the same number + of dimensions. + """ + search_schema: list[SearchSchemaElement] | None = ... + """ + The partition key and inline filter attribute definitions for the vector + index. + """ + projection: Projection + """ + Specifies attributes that are copied (projected) from the table into the + vector index. + """ + dimensions: int + """The number of dimensions in each vector.""" + distance_function: str + """ + The distance function used to calculate similarity. Valid values: + `COSINE`, `EUCLIDEAN`, `DOT_PRODUCT`. + """ + +@dataclass(kw_only=True) +class CsvOptions(_SerdeShape): + """Processing options for the CSV file being imported.""" + + delimiter: str | None = ... + """The delimiter used for separating items in the CSV file being imported.""" + header_list: list[str] | None = ... + """ + List of the headers used to specify a common header for all source CSV + files being imported. If this field is specified then the first line of + each CSV file is treated as data instead of the header. If this field is + not specified the the first line of each CSV file is treated as the + header. + """ + +@dataclass(kw_only=True) +class Delete(_SerdeShape): + """Represents a request to perform a `DeleteItem` operation.""" + + key: dict[str, AttributeValue] + """ + The primary key of the item to be deleted. Each element consists of an + attribute name and a value for that attribute. + """ + table_name: str + """ + Name of the table in which the item to be deleted resides. You can also + provide the Amazon Resource Name (ARN) of the table in this parameter. + """ + condition_expression: str | None = ... + """ + A condition that must be satisfied in order for a conditional delete to + succeed. + """ + expression_attribute_names: dict[str, str] | None = ... + """One or more substitution tokens for attribute names in an expression.""" + expression_attribute_values: dict[str, AttributeValue] | None = ... + """One or more values that can be substituted in an expression.""" + return_values_on_condition_check_failure: str | None = ... + """ + Use `ReturnValuesOnConditionCheckFailure` to get the item attributes if + the `Delete` condition fails. For `ReturnValuesOnConditionCheckFailure`, + the valid values are: NONE and ALL_OLD. + """ + +@dataclass(kw_only=True) +class DeleteBackupInput(_SerdeShape): + """Dataclass for DeleteBackupInput structure.""" + + backup_arn: str | None = ... + """The ARN associated with the backup.""" + +@dataclass(kw_only=True) +class DeleteBackupOutput(_SerdeShape): + """Dataclass for DeleteBackupOutput structure.""" + + backup_description: BackupDescription | None = ... + """Contains the description of the backup created for the table.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteGlobalSecondaryIndexAction(_SerdeShape): + """ + Represents a global secondary index to be deleted from an existing + table. + """ + + index_name: str + """The name of the global secondary index to be deleted.""" + +@dataclass(kw_only=True) +class DeleteGlobalTableWitnessGroupMemberAction(_SerdeShape): + """ + Specifies the action to remove a witness Region from a MRSC global + table. You cannot delete a single witness from a MRSC global table - you + must delete both a replica and the witness together. The deletion of + both a witness and replica converts the remaining replica to a + single-Region DynamoDB table. + """ + + region_name: str + """The witness Region name to be removed from the MRSC global table.""" + +@dataclass(kw_only=True) +class DeleteItemInput(_SerdeShape): + """Represents the input of a `DeleteItem` operation.""" + + table_name: str | None = ... + """ + The name of the table from which to delete the item. You can also + provide the Amazon Resource Name (ARN) of the table in this parameter. + """ + key: dict[str, AttributeValue] | None = ... + """ + A map of attribute names to `AttributeValue` objects, representing the + primary key of the item to delete. + + For the primary key, you must provide all of the key attributes. For + example, with a simple primary key, you only need to provide a value for + the partition key. For a composite primary key, you must provide values + for both the partition key and the sort key. + """ + expected: dict[str, ExpectedAttributeValue] | None = ... + """ + This is a legacy parameter. Use `ConditionExpression` instead. For more + information, see + [Expected](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.Expected.html) + in the *Amazon DynamoDB Developer Guide*. + """ + conditional_operator: str | None = ... + """ + This is a legacy parameter. Use `ConditionExpression` instead. For more + information, see + [ConditionalOperator](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.ConditionalOperator.html) + in the *Amazon DynamoDB Developer Guide*. + """ + return_values: str | None = ... + """ + Use `ReturnValues` if you want to get the item attributes as they + appeared before they were deleted. For `DeleteItem`, the valid values + are: + + - `NONE` - If `ReturnValues` is not specified, or if its value is + `NONE`, then nothing is returned. (This setting is the default for + `ReturnValues`.) + + - `ALL_OLD` - The content of the old item is returned. + + There is no additional cost associated with requesting a return value + aside from the small network and processing overhead of receiving a + larger response. No read capacity units are consumed. + + Note: + The `ReturnValues` parameter is used by several DynamoDB operations; + however, `DeleteItem` does not recognize any values other than `NONE` or + `ALL_OLD`. + """ + return_consumed_capacity: str | None = ... + """ + Determines the level of detail about either provisioned or on-demand + throughput consumption that is returned in the response: + + - `INDEXES` - The response includes the aggregate `ConsumedCapacity` for + the operation, together with `ConsumedCapacity` for each table and + secondary index that was accessed. + + Note that some operations, such as `GetItem` and `BatchGetItem`, do + not access any indexes at all. In these cases, specifying `INDEXES` + will only return `ConsumedCapacity` information for table(s). + + - `TOTAL` - The response includes only the aggregate `ConsumedCapacity` + for the operation. + + - `NONE` - No `ConsumedCapacity` details are included in the response. + """ + return_item_collection_metrics: str | None = ... + """ + Determines whether item collection metrics are returned. If set to + `SIZE`, the response includes statistics about item collections, if any, + that were modified during the operation are returned in the response. If + set to `NONE` (the default), no statistics are returned. + """ + condition_expression: str | None = ... + """ + A condition that must be satisfied in order for a conditional + `DeleteItem` to succeed. + + An expression can contain any of the following: + + - Functions: + `attribute_exists | attribute_not_exists | attribute_type | contains | begins_with | size` + + These function names are case-sensitive. + + - Comparison operators: `= | <> | < | > | <= | >= | BETWEEN | IN ` + + - Logical operators: `AND | OR | NOT` + + For more information about condition expressions, see [Condition + Expressions](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html) + in the *Amazon DynamoDB Developer Guide*. + """ + expression_attribute_names: dict[str, str] | None = ... + """ + One or more substitution tokens for attribute names in an expression. + The following are some use cases for using `ExpressionAttributeNames`: + + - To access an attribute whose name conflicts with a DynamoDB reserved + word. + + - To create a placeholder for repeating occurrences of an attribute name + in an expression. + + - To prevent special characters in an attribute name from being + misinterpreted in an expression. + + Use the **#** character in an expression to dereference an attribute + name. For example, consider the following attribute name: + + - `Percentile` + + The name of this attribute conflicts with a reserved word, so it cannot + be used directly in an expression. (For the complete list of reserved + words, see [Reserved + Words](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html) + in the *Amazon DynamoDB Developer Guide*). To work around this, you + could specify the following for `ExpressionAttributeNames`: + + - `{"#P":"Percentile"}` + + You could then use this substitution in an expression, as in this + example: + + - `#P = :val` + + Note: + Tokens that begin with the **:** character are *expression attribute + values*, which are placeholders for the actual value at runtime. + + For more information on expression attribute names, see [Specifying Item + Attributes](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) + in the *Amazon DynamoDB Developer Guide*. + """ + expression_attribute_values: dict[str, AttributeValue] | None = ... + """ + One or more values that can be substituted in an expression. + + Use the **:** (colon) character in an expression to dereference an + attribute value. For example, suppose that you wanted to check whether + the value of the *ProductStatus* attribute was one of the following: + + `Available | Backordered | Discontinued` + + You would first need to specify `ExpressionAttributeValues` as follows: + + `{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }` + + You could then use these values in an expression, such as this: + + `ProductStatus IN (:avail, :back, :disc)` + + For more information on expression attribute values, see [Condition + Expressions](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html) + in the *Amazon DynamoDB Developer Guide*. + """ + return_values_on_condition_check_failure: str | None = ... + """ + An optional parameter that returns the item attributes for a + `DeleteItem` operation that failed a condition check. + + There is no additional cost associated with requesting a return value + aside from the small network and processing overhead of receiving a + larger response. No read capacity units are consumed. + """ + +@dataclass(kw_only=True) +class DeleteItemOutput(_SerdeShape): + """Represents the output of a `DeleteItem` operation.""" + + attributes: dict[str, AttributeValue] | None = ... + """ + A map of attribute names to `AttributeValue` objects, representing the + item as it appeared before the `DeleteItem` operation. This map appears + in the response only if `ReturnValues` was specified as `ALL_OLD` in the + request. + """ + consumed_capacity: ConsumedCapacity | None = ... + """ + The capacity units consumed by the `DeleteItem` operation. The data + returned includes the total provisioned throughput consumed, along with + statistics for the table and any indexes involved in the operation. + `ConsumedCapacity` is only returned if the `ReturnConsumedCapacity` + parameter was specified. For more information, see [Provisioned capacity + mode](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/provisioned-capacity-mode.html) + in the *Amazon DynamoDB Developer Guide*. + + If the table has vector indexes, the response includes a `VectorIndexes` + field with `VectorWriteRequestBytes` consumed for each affected vector + index. + """ + item_collection_metrics: ItemCollectionMetrics | None = ... + """ + Information about item collections, if any, that were affected by the + `DeleteItem` operation. `ItemCollectionMetrics` is only returned if the + `ReturnItemCollectionMetrics` parameter was specified. If the table does + not have any local secondary indexes, this information is not returned + in the response. + + Each `ItemCollectionMetrics` element consists of: + + - `ItemCollectionKey` - The partition key value of the item collection. + This is the same as the partition key value of the item itself. + + - `SizeEstimateRangeGB` - An estimate of item collection size, in + gigabytes. This value is a two-element array containing a lower bound + and an upper bound for the estimate. The estimate includes the size of + all the items in the table, plus the size of all attributes projected + into all of the local secondary indexes on that table. Use this + estimate to measure whether a local secondary index is approaching its + size limit. + + The estimate is subject to change over time; therefore, do not rely on + the precision or accuracy of the estimate. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteReplicaAction(_SerdeShape): + """Represents a replica to be removed.""" + + region_name: str + """The Region of the replica to be removed.""" + +@dataclass(kw_only=True) +class DeleteReplicationGroupMemberAction(_SerdeShape): + """Represents a replica to be deleted.""" + + region_name: str + """The Region where the replica exists.""" + +@dataclass(kw_only=True) +class DeleteRequest(_SerdeShape): + """Represents a request to perform a `DeleteItem` operation on an item.""" + + key: dict[str, AttributeValue] + """ + A map of attribute name to attribute values, representing the primary + key of the item to delete. All of the table's primary key attributes + must be specified, and their data types must match those of the table's + key schema. + """ + +@dataclass(kw_only=True) +class DeleteResourcePolicyInput(_SerdeShape): + """Dataclass for DeleteResourcePolicyInput structure.""" + + resource_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the DynamoDB resource from which the + policy will be removed. The resources you can specify include tables and + streams. If you remove the policy of a table, it will also remove the + permissions for the table's indexes defined in that policy document. + This is because index permissions are defined in the table's policy. + """ + expected_revision_id: str | None = ... + """ + A string value that you can use to conditionally delete your policy. + When you provide an expected revision ID, if the revision ID of the + existing policy on the resource doesn't match or if there's no policy + attached to the resource, the request will fail and return a + `PolicyNotFoundException`. + """ + +@dataclass(kw_only=True) +class DeleteResourcePolicyOutput(_SerdeShape): + """Dataclass for DeleteResourcePolicyOutput structure.""" + + revision_id: str | None = ... + """ + A unique string that represents the revision ID of the policy. If + you're comparing revision IDs, make sure to always use string + comparison logic. + + This value will be empty if you make a request against a resource + without a policy. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteTableInput(_SerdeShape): + """Represents the input of a `DeleteTable` operation.""" + + table_name: str | None = ... + """ + The name of the table to delete. You can also provide the Amazon + Resource Name (ARN) of the table in this parameter. + """ + +@dataclass(kw_only=True) +class DeleteTableOutput(_SerdeShape): + """Represents the output of a `DeleteTable` operation.""" + + table_description: TableDescription | None = ... + """Represents the properties of a table.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteVectorIndexAction(_SerdeShape): + """A vector index to be removed from a table.""" + + index_name: str + """The name of the vector index to delete.""" + +@dataclass(kw_only=True) +class DescribeBackupInput(_SerdeShape): + """Dataclass for DescribeBackupInput structure.""" + + backup_arn: str | None = ... + """The Amazon Resource Name (ARN) associated with the backup.""" + +@dataclass(kw_only=True) +class DescribeBackupOutput(_SerdeShape): + """Dataclass for DescribeBackupOutput structure.""" + + backup_description: BackupDescription | None = ... + """Contains the description of the backup created for the table.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DescribeContinuousBackupsInput(_SerdeShape): + """Dataclass for DescribeContinuousBackupsInput structure.""" + + table_name: str | None = ... + """ + Name of the table for which the customer wants to check the continuous + backups and point in time recovery settings. + + You can also provide the Amazon Resource Name (ARN) of the table in this + parameter. + """ + +@dataclass(kw_only=True) +class DescribeContinuousBackupsOutput(_SerdeShape): + """Dataclass for DescribeContinuousBackupsOutput structure.""" + + continuous_backups_description: ContinuousBackupsDescription | None = ... + """ + Represents the continuous backups and point in time recovery settings on + the table. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DescribeContributorInsightsInput(_SerdeShape): + """Dataclass for DescribeContributorInsightsInput structure.""" + + table_name: str | None = ... + """ + The name of the table to describe. You can also provide the Amazon + Resource Name (ARN) of the table in this parameter. + """ + index_name: str | None = ... + """The name of the global secondary index to describe, if applicable.""" + +@dataclass(kw_only=True) +class DescribeContributorInsightsOutput(_SerdeShape): + """Dataclass for DescribeContributorInsightsOutput structure.""" + + table_name: str | None = ... + """The name of the table being described.""" + index_name: str | None = ... + """The name of the global secondary index being described.""" + contributor_insights_rule_list: list[str] | None = ... + """List of names of the associated contributor insights rules.""" + contributor_insights_status: str | None = ... + """Current status of contributor insights.""" + last_update_date_time: datetime | None = ... + """Timestamp of the last time the status was changed.""" + failure_exception: FailureException | None = ... + """ + Returns information about the last failure that was encountered. + + The most common exceptions for a FAILED status are: + + - LimitExceededException - Per-account Amazon CloudWatch Contributor + Insights rule limit reached. Please disable Contributor Insights for + other tables/indexes OR disable Contributor Insights rules before + retrying. + + - AccessDeniedException - Amazon CloudWatch Contributor Insights rules + cannot be modified due to insufficient permissions. + + - AccessDeniedException - Failed to create service-linked role for + Contributor Insights due to insufficient permissions. + + - InternalServerError - Failed to create Amazon CloudWatch Contributor + Insights rules. Please retry request. + """ + contributor_insights_mode: str | None = ... + """ + The mode of CloudWatch Contributor Insights for DynamoDB that determines + which events are emitted. Can be set to track all access and throttled + events or throttled events only. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DescribeEndpointsInput(_SerdeShape): + """Dataclass for DescribeEndpointsInput structure.""" + +@dataclass(kw_only=True) +class DescribeEndpointsOutput(_SerdeShape): + """Dataclass for DescribeEndpointsOutput structure.""" + + endpoints: list[Endpoint] + """List of endpoints.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DescribeExportInput(_SerdeShape): + """Dataclass for DescribeExportInput structure.""" + + export_arn: str | None = ... + """The Amazon Resource Name (ARN) associated with the export.""" + +@dataclass(kw_only=True) +class DescribeExportOutput(_SerdeShape): + """Dataclass for DescribeExportOutput structure.""" + + export_description: ExportDescription | None = ... + """Represents the properties of the export.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DescribeGlobalTableInput(_SerdeShape): + """Dataclass for DescribeGlobalTableInput structure.""" + + global_table_name: str | None = ... + """The name of the global table.""" + +@dataclass(kw_only=True) +class DescribeGlobalTableOutput(_SerdeShape): + """Dataclass for DescribeGlobalTableOutput structure.""" + + global_table_description: GlobalTableDescription | None = ... + """Contains the details of the global table.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DescribeGlobalTableSettingsInput(_SerdeShape): + """Dataclass for DescribeGlobalTableSettingsInput structure.""" + + global_table_name: str | None = ... + """The name of the global table to describe.""" + +@dataclass(kw_only=True) +class DescribeGlobalTableSettingsOutput(_SerdeShape): + """Dataclass for DescribeGlobalTableSettingsOutput structure.""" + + global_table_name: str | None = ... + """The name of the global table.""" + replica_settings: list[ReplicaSettingsDescription] | None = ... + """The Region-specific settings for the global table.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DescribeImportInput(_SerdeShape): + """Dataclass for DescribeImportInput structure.""" + + import_arn: str | None = ... + """ + The Amazon Resource Name (ARN) associated with the table you're + importing to. + """ + +@dataclass(kw_only=True) +class DescribeImportOutput(_SerdeShape): + """Dataclass for DescribeImportOutput structure.""" + + import_table_description: ImportTableDescription + """ + Represents the properties of the table created for the import, and + parameters of the import. The import parameters include import status, + how many items were processed, and how many errors were encountered. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DescribeKinesisStreamingDestinationInput(_SerdeShape): + """Dataclass for DescribeKinesisStreamingDestinationInput structure.""" + + table_name: str | None = ... + """ + The name of the table being described. You can also provide the Amazon + Resource Name (ARN) of the table in this parameter. + """ + +@dataclass(kw_only=True) +class DescribeKinesisStreamingDestinationOutput(_SerdeShape): + """Dataclass for DescribeKinesisStreamingDestinationOutput structure.""" + + table_name: str | None = ... + """The name of the table being described.""" + kinesis_data_stream_destinations: list[KinesisDataStreamDestination] | None = ... + """The list of replica structures for the table being described.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DescribeLimitsInput(_SerdeShape): + """Represents the input of a `DescribeLimits` operation. Has no content.""" + +@dataclass(kw_only=True) +class DescribeLimitsOutput(_SerdeShape): + """Represents the output of a `DescribeLimits` operation.""" + + account_max_read_capacity_units: int | None = ... + """ + The maximum total read capacity units that your account allows you to + provision across all of your tables in this Region. + """ + account_max_write_capacity_units: int | None = ... + """ + The maximum total write capacity units that your account allows you to + provision across all of your tables in this Region. + """ + table_max_read_capacity_units: int | None = ... + """ + The maximum read capacity units that your account allows you to + provision for a new table that you are creating in this Region, + including the read capacity units provisioned for its global secondary + indexes (GSIs). + """ + table_max_write_capacity_units: int | None = ... + """ + The maximum write capacity units that your account allows you to + provision for a new table that you are creating in this Region, + including the write capacity units provisioned for its global secondary + indexes (GSIs). + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DescribeTableInput(_SerdeShape): + """Represents the input of a `DescribeTable` operation.""" + + table_name: str | None = ... + """ + The name of the table to describe. You can also provide the Amazon + Resource Name (ARN) of the table in this parameter. + """ + +@dataclass(kw_only=True) +class DescribeTableOutput(_SerdeShape): + """Represents the output of a `DescribeTable` operation.""" + + table: TableDescription | None = ... + """The properties of the table.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DescribeTableReplicaAutoScalingInput(_SerdeShape): + """Dataclass for DescribeTableReplicaAutoScalingInput structure.""" + + table_name: str | None = ... + """ + The name of the table. You can also provide the Amazon Resource Name + (ARN) of the table in this parameter. + """ + +@dataclass(kw_only=True) +class DescribeTableReplicaAutoScalingOutput(_SerdeShape): + """Dataclass for DescribeTableReplicaAutoScalingOutput structure.""" + + table_auto_scaling_description: TableAutoScalingDescription | None = ... + """Represents the auto scaling properties of the table.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DescribeTimeToLiveInput(_SerdeShape): + """Dataclass for DescribeTimeToLiveInput structure.""" + + table_name: str | None = ... + """ + The name of the table to be described. You can also provide the Amazon + Resource Name (ARN) of the table in this parameter. + """ + +@dataclass(kw_only=True) +class DescribeTimeToLiveOutput(_SerdeShape): + """Dataclass for DescribeTimeToLiveOutput structure.""" + + time_to_live_description: TimeToLiveDescription | None = ... + """""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class DestinationStatus(UnknownEnumMixin, StrEnum): + ENABLING = "ENABLING" + ACTIVE = "ACTIVE" + DISABLING = "DISABLING" + DISABLED = "DISABLED" + ENABLE_FAILED = "ENABLE_FAILED" + UPDATING = "UPDATING" + +@dataclass(kw_only=True) +class DisableKinesisStreamingDestinationInput(_SerdeShape): + """Dataclass for DisableKinesisStreamingDestinationInput structure.""" + + table_name: str | None = ... + """ + The name of the DynamoDB table. You can also provide the Amazon Resource + Name (ARN) of the table in this parameter. + """ + stream_arn: str | None = ... + """The ARN for a Kinesis data stream.""" + enable_kinesis_streaming_configuration: ( + EnableKinesisStreamingConfiguration | None + ) = ... + """The source for the Kinesis streaming information that is being enabled.""" + +@dataclass(kw_only=True) +class DisableKinesisStreamingDestinationOutput(_SerdeShape): + """Dataclass for DisableKinesisStreamingDestinationOutput structure.""" + + table_name: str | None = ... + """The name of the table being modified.""" + stream_arn: str | None = ... + """The ARN for the specific Kinesis data stream.""" + destination_status: str | None = ... + """The current status of the replication.""" + enable_kinesis_streaming_configuration: ( + EnableKinesisStreamingConfiguration | None + ) = ... + """ + The destination for the Kinesis streaming information that is being + enabled. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DuplicateItemException(ServiceError, _SerdeShape): + """ + There was an attempt to insert an item with the same primary key as an + item that already exists in the DynamoDB table. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class EnableKinesisStreamingConfiguration(_SerdeShape): + """Enables setting the configuration for Kinesis Streaming.""" + + approximate_creation_date_time_precision: str | None = ... + """ + Toggle for the precision of Kinesis data stream timestamp. The values + are either `MILLISECOND` or `MICROSECOND`. + """ + +@dataclass(kw_only=True) +class EnableKinesisStreamingDestinationInput(_SerdeShape): + """Dataclass for EnableKinesisStreamingDestinationInput structure.""" + + table_name: str | None = ... + """ + The name of the DynamoDB table. You can also provide the Amazon Resource + Name (ARN) of the table in this parameter. + """ + stream_arn: str | None = ... + """The ARN for a Kinesis data stream.""" + enable_kinesis_streaming_configuration: ( + EnableKinesisStreamingConfiguration | None + ) = ... + """The source for the Kinesis streaming information that is being enabled.""" + +@dataclass(kw_only=True) +class EnableKinesisStreamingDestinationOutput(_SerdeShape): + """Dataclass for EnableKinesisStreamingDestinationOutput structure.""" + + table_name: str | None = ... + """The name of the table being modified.""" + stream_arn: str | None = ... + """The ARN for the specific Kinesis data stream.""" + destination_status: str | None = ... + """The current status of the replication.""" + enable_kinesis_streaming_configuration: ( + EnableKinesisStreamingConfiguration | None + ) = ... + """ + The destination for the Kinesis streaming information that is being + enabled. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class Endpoint(_SerdeShape): + """An endpoint information details.""" + + address: str + """IP address of the endpoint.""" + cache_period_in_minutes: int = ... + """Endpoint cache time to live (TTL) value.""" + +@dataclass(kw_only=True) +class ExecuteStatementInput(_SerdeShape): + """Dataclass for ExecuteStatementInput structure.""" + + statement: str | None = ... + """The PartiQL statement representing the operation to run.""" + parameters: list[AttributeValue] | None = ... + """The parameters for the PartiQL statement, if any.""" + consistent_read: bool | None = ... + """ + The consistency of a read operation. If set to `true`, then a strongly + consistent read is used; otherwise, an eventually consistent read is + used. + """ + next_token: str | None = ... + """ + Set this value to get remaining results, if `NextToken` was returned in + the statement response. + """ + return_consumed_capacity: str | None = ... + """ + Determines the level of detail about either provisioned or on-demand + throughput consumption that is returned in the response: + + - `INDEXES` - The response includes the aggregate `ConsumedCapacity` for + the operation, together with `ConsumedCapacity` for each table and + secondary index that was accessed. + + Note that some operations, such as `GetItem` and `BatchGetItem`, do + not access any indexes at all. In these cases, specifying `INDEXES` + will only return `ConsumedCapacity` information for table(s). + + - `TOTAL` - The response includes only the aggregate `ConsumedCapacity` + for the operation. + + - `NONE` - No `ConsumedCapacity` details are included in the response. + """ + limit: int | None = ... + """ + The maximum number of items to evaluate (not necessarily the number of + matching items). If DynamoDB processes the number of items up to the + limit while processing the results, it stops the operation and returns + the matching values up to that point, along with a key in + `LastEvaluatedKey` to apply in a subsequent operation so you can pick up + where you left off. Also, if the processed dataset size exceeds 1 MB + before DynamoDB reaches this limit, it stops the operation and returns + the matching values up to the limit, and a key in `LastEvaluatedKey` to + apply in a subsequent operation to continue the operation. + """ + return_values_on_condition_check_failure: str | None = ... + """ + An optional parameter that returns the item attributes for an + `ExecuteStatement` operation that failed a condition check. + + There is no additional cost associated with requesting a return value + aside from the small network and processing overhead of receiving a + larger response. No read capacity units are consumed. + """ + +@dataclass(kw_only=True) +class ExecuteStatementOutput(_SerdeShape): + """Dataclass for ExecuteStatementOutput structure.""" + + items: list[dict[str, AttributeValue]] | None = ... + """ + If a read operation was used, this property will contain the result of + the read operation; a map of attribute names and their values. For the + write operations this value will be empty. + """ + next_token: str | None = ... + """ + If the response of a read request exceeds the response payload limit + DynamoDB will set this value in the response. If set, you can use that + this value in the subsequent request to get the remaining results. + """ + consumed_capacity: ConsumedCapacity | None = ... + """ + The capacity units consumed by an operation. The data returned includes + the total provisioned throughput consumed, along with statistics for the + table and any indexes involved in the operation. `ConsumedCapacity` is + only returned if the request asked for it. For more information, see + [Provisioned capacity + mode](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/provisioned-capacity-mode.html) + in the *Amazon DynamoDB Developer Guide*. + """ + last_evaluated_key: dict[str, AttributeValue] | None = ... + """ + The primary key of the item where the operation stopped, inclusive of + the previous result set. Use this value to start a new operation, + excluding this value in the new request. If `LastEvaluatedKey` is empty, + then the \"last page\" of results has been processed and there is no + more data to be retrieved. If `LastEvaluatedKey` is not empty, it does + not necessarily mean that there is more data in the result set. The only + way to know when you have reached the end of the result set is when + `LastEvaluatedKey` is empty. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ExecuteTransactionInput(_SerdeShape): + """Dataclass for ExecuteTransactionInput structure.""" + + transact_statements: list[ParameterizedStatement] | None = ... + """The list of PartiQL statements representing the transaction to run.""" + client_request_token: str | None = ... + """ + Set this value to get remaining results, if `NextToken` was returned in + the statement response. + """ + return_consumed_capacity: str | None = ... + """ + Determines the level of detail about either provisioned or on-demand + throughput consumption that is returned in the response. For more + information, see + [TransactGetItems](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_TransactGetItems.html) + and + [TransactWriteItems](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_TransactWriteItems.html). + """ + +@dataclass(kw_only=True) +class ExecuteTransactionOutput(_SerdeShape): + """Dataclass for ExecuteTransactionOutput structure.""" + + responses: list[ItemResponse] | None = ... + """The response to a PartiQL transaction.""" + consumed_capacity: list[ConsumedCapacity] | None = ... + """ + The capacity units consumed by the entire operation. The values of the + list are ordered according to the ordering of the statements. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ExpectedAttributeValue(_SerdeShape): + """ + Represents a condition to be compared with an attribute value. This + condition can be used with `DeleteItem`, `PutItem`, or `UpdateItem` + operations; if the comparison evaluates to true, the operation succeeds; + if not, the operation fails. You can use `ExpectedAttributeValue` in one + of two different ways: + + - Use `AttributeValueList` to specify one or more values to compare + against an attribute. Use `ComparisonOperator` to specify how you want + to perform the comparison. If the comparison evaluates to true, then + the conditional operation succeeds. + + - Use `Value` to specify a value that DynamoDB will compare against an + attribute. If the values match, then `ExpectedAttributeValue` + evaluates to true and the conditional operation succeeds. Optionally, + you can also set `Exists` to false, indicating that you *do not* + expect to find the attribute value in the table. In this case, the + conditional operation succeeds only if the comparison evaluates to + false. + + `Value` and `Exists` are incompatible with `AttributeValueList` and + `ComparisonOperator`. Note that if you use both sets of parameters at + once, DynamoDB will return a `ValidationException` exception. + """ + + value: AttributeValue | None = ... + """ + Represents the data for the expected attribute. + + Each attribute value is described as a name-value pair. The name is the + data type, and the value is the data itself. + + For more information, see [Data + Types](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.NamingRulesDataTypes.html#HowItWorks.DataTypes) + in the *Amazon DynamoDB Developer Guide*. + """ + exists: bool | None = ... + """ + Causes DynamoDB to evaluate the value before attempting a conditional + operation: + + - If `Exists` is `true`, DynamoDB will check to see if that attribute + value already exists in the table. If it is found, then the operation + succeeds. If it is not found, the operation fails with a + `ConditionCheckFailedException`. + + - If `Exists` is `false`, DynamoDB assumes that the attribute value does + not exist in the table. If in fact the value does not exist, then the + assumption is valid and the operation succeeds. If the value is found, + despite the assumption that it does not exist, the operation fails + with a `ConditionCheckFailedException`. + + The default setting for `Exists` is `true`. If you supply a `Value` all + by itself, DynamoDB assumes the attribute exists: You don't have to set + `Exists` to `true`, because it is implied. + + DynamoDB returns a `ValidationException` if: + + - `Exists` is `true` but there is no `Value` to check. (You expect a + value to exist, but don't specify what that value is.) + + - `Exists` is `false` but you also provide a `Value`. (You cannot expect + an attribute to have a value, while also expecting it not to exist.) + """ + comparison_operator: str | None = ... + """ + A comparator for evaluating attributes in the `AttributeValueList`. For + example, equals, greater than, less than, etc. + + The following comparison operators are available: + + `EQ | NE | LE | LT | GE | GT | NOT_NULL | NULL | CONTAINS | NOT_CONTAINS | BEGINS_WITH | IN | BETWEEN` + + The following are descriptions of each comparison operator. + + - `EQ` : Equal. `EQ` is supported for all data types, including lists + and maps. + + `AttributeValueList` can contain only one `AttributeValue` element of + type String, Number, Binary, String Set, Number Set, or Binary Set. If + an item contains an `AttributeValue` element of a different type than + the one provided in the request, the value does not match. For + example, `{"S":"6"}` does not equal `{"N":"6"}`. Also, `{"N":"6"}` + does not equal `{"NS":["6", "2", "1"]}`. + + - `NE` : Not equal. `NE` is supported for all data types, including + lists and maps. + + `AttributeValueList` can contain only one `AttributeValue` of type + String, Number, Binary, String Set, Number Set, or Binary Set. If an + item contains an `AttributeValue` of a different type than the one + provided in the request, the value does not match. For example, + `{"S":"6"}` does not equal `{"N":"6"}`. Also, `{"N":"6"}` does not + equal `{"NS":["6", "2", "1"]}`. + + - `LE` : Less than or equal. + + `AttributeValueList` can contain only one `AttributeValue` element of + type String, Number, or Binary (not a set type). If an item contains + an `AttributeValue` element of a different type than the one provided + in the request, the value does not match. For example, `{"S":"6"}` + does not equal `{"N":"6"}`. Also, `{"N":"6"}` does not compare to + `{"NS":["6", "2", "1"]}`. + + - `LT` : Less than. + + `AttributeValueList` can contain only one `AttributeValue` of type + String, Number, or Binary (not a set type). If an item contains an + `AttributeValue` element of a different type than the one provided in + the request, the value does not match. For example, `{"S":"6"}` does + not equal `{"N":"6"}`. Also, `{"N":"6"}` does not compare to + `{"NS":["6", "2", "1"]}`. + + - `GE` : Greater than or equal. + + `AttributeValueList` can contain only one `AttributeValue` element of + type String, Number, or Binary (not a set type). If an item contains + an `AttributeValue` element of a different type than the one provided + in the request, the value does not match. For example, `{"S":"6"}` + does not equal `{"N":"6"}`. Also, `{"N":"6"}` does not compare to + `{"NS":["6", "2", "1"]}`. + + - `GT` : Greater than. + + `AttributeValueList` can contain only one `AttributeValue` element of + type String, Number, or Binary (not a set type). If an item contains + an `AttributeValue` element of a different type than the one provided + in the request, the value does not match. For example, `{"S":"6"}` + does not equal `{"N":"6"}`. Also, `{"N":"6"}` does not compare to + `{"NS":["6", "2", "1"]}`. + + - `NOT_NULL` : The attribute exists. `NOT_NULL` is supported for all + data types, including lists and maps. + + Note: + This operator tests for the existence of an attribute, not its data + type. If the data type of attribute \"`a`\" is null, and you evaluate + it using `NOT_NULL`, the result is a Boolean `true`. This result is + because the attribute \"`a`\" exists; its data type is not relevant to + the `NOT_NULL` comparison operator. + + - `NULL` : The attribute does not exist. `NULL` is supported for all + data types, including lists and maps. + + Note: + This operator tests for the nonexistence of an attribute, not its data + type. If the data type of attribute \"`a`\" is null, and you evaluate + it using `NULL`, the result is a Boolean `false`. This is because the + attribute \"`a`\" exists; its data type is not relevant to the `NULL` + comparison operator. + + - `CONTAINS` : Checks for a subsequence, or value in a set. + + `AttributeValueList` can contain only one `AttributeValue` element of + type String, Number, or Binary (not a set type). If the target + attribute of the comparison is of type String, then the operator + checks for a substring match. If the target attribute of the + comparison is of type Binary, then the operator looks for a + subsequence of the target that matches the input. If the target + attribute of the comparison is a set (\"`SS`\", \"`NS`\", or + \"`BS`\"), then the operator evaluates to true if it finds an exact + match with any member of the set. + + CONTAINS is supported for lists: When evaluating \"`a CONTAINS b`\", + \"`a`\" can be a list; however, \"`b`\" cannot be a set, a map, or a + list. + + - `NOT_CONTAINS` : Checks for absence of a subsequence, or absence of a + value in a set. + + `AttributeValueList` can contain only one `AttributeValue` element of + type String, Number, or Binary (not a set type). If the target + attribute of the comparison is a String, then the operator checks for + the absence of a substring match. If the target attribute of the + comparison is Binary, then the operator checks for the absence of a + subsequence of the target that matches the input. If the target + attribute of the comparison is a set (\"`SS`\", \"`NS`\", or + \"`BS`\"), then the operator evaluates to true if it *does not* find + an exact match with any member of the set. + + NOT_CONTAINS is supported for lists: When evaluating + \"`a NOT CONTAINS b`\", \"`a`\" can be a list; however, \"`b`\" cannot + be a set, a map, or a list. + + - `BEGINS_WITH` : Checks for a prefix. + + `AttributeValueList` can contain only one `AttributeValue` of type + String or Binary (not a Number or a set type). The target attribute of + the comparison must be of type String or Binary (not a Number or a set + type). + + - `IN` : Checks for matching elements in a list. + + `AttributeValueList` can contain one or more `AttributeValue` elements + of type String, Number, or Binary. These attributes are compared + against an existing attribute of an item. If any elements of the input + are equal to the item attribute, the expression evaluates to true. + + - `BETWEEN` : Greater than or equal to the first value, and less than or + equal to the second value. + + `AttributeValueList` must contain two `AttributeValue` elements of the + same type, either String, Number, or Binary (not a set type). A target + attribute matches if the target value is greater than, or equal to, + the first element and less than, or equal to, the second element. If + an item contains an `AttributeValue` element of a different type than + the one provided in the request, the value does not match. For + example, `{"S":"6"}` does not compare to `{"N":"6"}`. Also, + `{"N":"6"}` does not compare to `{"NS":["6", "2", "1"]}` + """ + attribute_value_list: list[AttributeValue] | None = ... + """ + One or more values to evaluate against the supplied attribute. The + number of values in the list depends on the `ComparisonOperator` being + used. + + For type Number, value comparisons are numeric. + + String value comparisons for greater than, equals, or less than are + based on ASCII character code values. For example, `a` is greater than + `A`, and `a` is greater than `B`. For a list of code values, see + . + + For Binary, DynamoDB treats each byte of the binary data as unsigned + when it compares binary values. + + For information on specifying data types in JSON, see [JSON Data + Format](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataFormat.html) + in the *Amazon DynamoDB Developer Guide*. + """ + +@dataclass(kw_only=True) +class ExportConflictException(ServiceError, _SerdeShape): + """There was a conflict when writing to the specified S3 bucket.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ExportDescription(_SerdeShape): + """Represents the properties of the exported table.""" + + export_arn: str | None = ... + """The Amazon Resource Name (ARN) of the table export.""" + export_status: str | None = ... + """ + Export can be in one of the following states: IN_PROGRESS, COMPLETED, or + FAILED. + """ + start_time: datetime | None = ... + """The time at which the export task began.""" + end_time: datetime | None = ... + """The time at which the export task completed.""" + export_manifest: str | None = ... + """The name of the manifest file for the export task.""" + table_arn: str | None = ... + """The Amazon Resource Name (ARN) of the table that was exported.""" + table_id: str | None = ... + """Unique ID of the table that was exported.""" + export_time: datetime | None = ... + """Point in time from which table data was exported.""" + client_token: str | None = ... + """ + The client token that was provided for the export task. A client token + makes calls to `ExportTableToPointInTimeInput` idempotent, meaning that + multiple identical calls have the same effect as one single call. + """ + s3_bucket: str | None = ... + """The name of the Amazon S3 bucket containing the export.""" + s3_bucket_owner: str | None = ... + """ + The ID of the Amazon Web Services account that owns the bucket + containing the export. + """ + s3_prefix: str | None = ... + """ + The Amazon S3 bucket prefix used as the file name and path of the + exported snapshot. + """ + s3_sse_algorithm: str | None = ... + """ + Type of encryption used on the bucket where export data is stored. Valid + values for `S3SseAlgorithm` are: + + - `AES256` - server-side encryption with Amazon S3 managed keys + + - `KMS` - server-side encryption with KMS managed keys + """ + s3_sse_kms_key_id: str | None = ... + """ + The ID of the KMS managed key used to encrypt the S3 bucket where export + data is stored (if applicable). + """ + failure_code: str | None = ... + """Status code for the result of the failed export.""" + failure_message: str | None = ... + """Export failure reason description.""" + export_format: str | None = ... + """ + The format of the exported data. Valid values for `ExportFormat` are + `DYNAMODB_JSON` or `ION`. + """ + billed_size_bytes: int | None = ... + """The billable size of the table export.""" + item_count: int | None = ... + """The number of items exported.""" + export_type: str | None = ... + """ + The type of export that was performed. Valid values are `FULL_EXPORT` or + `INCREMENTAL_EXPORT`. + """ + incremental_export_specification: IncrementalExportSpecification | None = ... + """ + Optional object containing the parameters specific to an incremental + export. + """ + filter_specification: FilterSpecification | None = ... + """ + The filter criteria applied to the export. When present, only items that + match the specified key conditions and filter expressions are included + in the export output. + """ + +class ExportFormat(UnknownEnumMixin, StrEnum): + DYNAMODB_JSON = "DYNAMODB_JSON" + ION = "ION" + +@dataclass(kw_only=True) +class ExportNotFoundException(ServiceError, _SerdeShape): + """The specified export was not found.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class ExportStatus(UnknownEnumMixin, StrEnum): + IN_PROGRESS = "IN_PROGRESS" + COMPLETED = "COMPLETED" + FAILED = "FAILED" + +@dataclass(kw_only=True) +class ExportSummary(_SerdeShape): + """Summary information about an export task.""" + + export_arn: str | None = ... + """The Amazon Resource Name (ARN) of the export.""" + export_status: str | None = ... + """ + Export can be in one of the following states: IN_PROGRESS, COMPLETED, or + FAILED. + """ + export_type: str | None = ... + """ + The type of export that was performed. Valid values are `FULL_EXPORT` or + `INCREMENTAL_EXPORT`. + """ + +@dataclass(kw_only=True) +class ExportTableToPointInTimeInput(_SerdeShape): + """Dataclass for ExportTableToPointInTimeInput structure.""" + + table_arn: str | None = ... + """The Amazon Resource Name (ARN) associated with the table to export.""" + export_time: datetime | None = ... + """ + Time in the past from which to export table data, counted in seconds + from the start of the Unix epoch. The table export will be a snapshot of + the table's state at this point in time. + """ + client_token: str | None = ... + """ + Providing a `ClientToken` makes the call to + `ExportTableToPointInTimeInput` idempotent, meaning that multiple + identical calls have the same effect as one single call. + + A client token is valid for 8 hours after the first request that uses it + is completed. After 8 hours, any request with the same client token is + treated as a new request. Do not resubmit the same request with the same + client token for more than 8 hours, or the result might not be + idempotent. + + If you submit a request with the same client token but a change in other + parameters within the 8-hour idempotency window, DynamoDB returns an + `ExportConflictException`. + """ + s3_bucket: str | None = ... + """The name of the Amazon S3 bucket to export the snapshot to.""" + s3_bucket_owner: str | None = ... + """ + The ID of the Amazon Web Services account that owns the bucket the + export will be stored in. + + Note: + S3BucketOwner is a required parameter when exporting to a S3 bucket in + another account. + """ + s3_prefix: str | None = ... + """ + The Amazon S3 bucket prefix to use as the file name and path of the + exported snapshot. + """ + s3_sse_algorithm: str | None = ... + """ + Type of encryption used on the bucket where export data will be stored. + Valid values for `S3SseAlgorithm` are: + + - `AES256` - server-side encryption with Amazon S3 managed keys + + - `KMS` - server-side encryption with KMS managed keys + """ + s3_sse_kms_key_id: str | None = ... + """ + The ID of the KMS managed key used to encrypt the S3 bucket where export + data will be stored (if applicable). + """ + export_format: str | None = ... + """ + The format for the exported data. Valid values for `ExportFormat` are + `DYNAMODB_JSON` or `ION`. + """ + export_type: str | None = ... + """ + Choice of whether to execute as a full export or incremental export. + Valid values are FULL_EXPORT or INCREMENTAL_EXPORT. The default value is + FULL_EXPORT. If INCREMENTAL_EXPORT is provided, the + IncrementalExportSpecification must also be used. + """ + incremental_export_specification: IncrementalExportSpecification | None = ... + """ + Optional object containing the parameters specific to an incremental + export. + """ + filter_specification: FilterSpecification | None = ... + """ + The criteria used to filter which items are included in the + point-in-time export. When you specify this parameter, only items that + match the key conditions and filter expressions are exported. + """ + +@dataclass(kw_only=True) +class ExportTableToPointInTimeOutput(_SerdeShape): + """Dataclass for ExportTableToPointInTimeOutput structure.""" + + export_description: ExportDescription | None = ... + """Contains a description of the table export.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class ExportType(UnknownEnumMixin, StrEnum): + FULL_EXPORT = "FULL_EXPORT" + INCREMENTAL_EXPORT = "INCREMENTAL_EXPORT" + +class ExportViewType(UnknownEnumMixin, StrEnum): + NEW_IMAGE = "NEW_IMAGE" + NEW_AND_OLD_IMAGES = "NEW_AND_OLD_IMAGES" + +@dataclass(kw_only=True) +class FailureException(_SerdeShape): + """Represents a failure a contributor insights operation.""" + + exception_name: str | None = ... + """Exception name.""" + exception_description: str | None = ... + """Description of the failure.""" + +@dataclass(kw_only=True) +class FilterSpecification(_SerdeShape): + """ + Contains the filter criteria used to limit which items are included in + an export. If you don't include this parameter, all items and + attributes are exported. + """ + + filter_expression: str | None = ... + """ + A condition that filters which items are included in the export. This + parameter uses the same syntax as `FilterExpression` in `Query` and + `Scan`. If you don't provide `KeyConditionExpression`, this expression + can also reference key attributes. If you don't specify this parameter, + all items are included in the export. + """ + projection_expression: str | None = ... + """ + The attributes you want to retrieve for items included in the export. + Separate attribute names in the expression with commas. If you don't + specify this parameter, all attributes are returned. + """ + key_condition_expression: str | None = ... + """ + A condition expression that filters items by key values. The expression + must test equality on a single partition key value and can optionally + compare a sort key value. This parameter uses the same syntax as + `KeyConditionExpression` in `Query`. When you provide this parameter, + `FilterExpression` can only reference non-key attributes. If you don't + specify this parameter, all items are eligible for export. + """ + expression_attribute_names: dict[str, str] | None = ... + """ + One or more substitution tokens for attribute names in an expression. + For more information, see [Expression Attribute + Names](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.ExpressionAttributeNames.html) + in the Amazon DynamoDB Developer Guide. + """ + expression_attribute_values: dict[str, AttributeValue] | None = ... + """ + One or more values that can be substituted in an expression. For more + information, see [Expression Attribute + Values](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.ExpressionAttributeValues.html) + in the Amazon DynamoDB Developer Guide. + """ + +@dataclass(kw_only=True) +class Get(_SerdeShape): + """ + Specifies an item and related attribute values to retrieve in a + `TransactGetItem` object. + """ + + key: dict[str, AttributeValue] + """ + A map of attribute names to `AttributeValue` objects that specifies the + primary key of the item to retrieve. + """ + table_name: str + """ + The name of the table from which to retrieve the specified item. You can + also provide the Amazon Resource Name (ARN) of the table in this + parameter. + """ + projection_expression: str | None = ... + """ + A string that identifies one or more attributes of the specified item to + retrieve from the table. The attributes in the expression must be + separated by commas. If no attribute names are specified, then all + attributes of the specified item are returned. If any of the requested + attributes are not found, they do not appear in the result. + """ + expression_attribute_names: dict[str, str] | None = ... + """ + One or more substitution tokens for attribute names in the + ProjectionExpression parameter. + """ + +@dataclass(kw_only=True) +class GetItemInput(_SerdeShape): + """Represents the input of a `GetItem` operation.""" + + table_name: str | None = ... + """ + The name of the table containing the requested item. You can also + provide the Amazon Resource Name (ARN) of the table in this parameter. + """ + key: dict[str, AttributeValue] | None = ... + """ + A map of attribute names to `AttributeValue` objects, representing the + primary key of the item to retrieve. + + For the primary key, you must provide all of the attributes. For + example, with a simple primary key, you only need to provide a value for + the partition key. For a composite primary key, you must provide values + for both the partition key and the sort key. + """ + attributes_to_get: list[str] | None = ... + """ + This is a legacy parameter. Use `ProjectionExpression` instead. For more + information, see + [AttributesToGet](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.AttributesToGet.html) + in the *Amazon DynamoDB Developer Guide*. + """ + consistent_read: bool | None = ... + """ + Determines the read consistency model: If set to `true`, then the + operation uses strongly consistent reads; otherwise, the operation uses + eventually consistent reads. + """ + return_consumed_capacity: str | None = ... + """ + Determines the level of detail about either provisioned or on-demand + throughput consumption that is returned in the response: + + - `INDEXES` - The response includes the aggregate `ConsumedCapacity` for + the operation, together with `ConsumedCapacity` for each table and + secondary index that was accessed. + + Note that some operations, such as `GetItem` and `BatchGetItem`, do + not access any indexes at all. In these cases, specifying `INDEXES` + will only return `ConsumedCapacity` information for table(s). + + - `TOTAL` - The response includes only the aggregate `ConsumedCapacity` + for the operation. + + - `NONE` - No `ConsumedCapacity` details are included in the response. + """ + projection_expression: str | None = ... + """ + A string that identifies one or more attributes to retrieve from the + table. These attributes can include scalars, sets, or elements of a JSON + document. The attributes in the expression must be separated by commas. + + If no attribute names are specified, then all attributes are returned. + If any of the requested attributes are not found, they do not appear in + the result. + + For more information, see [Specifying Item + Attributes](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) + in the *Amazon DynamoDB Developer Guide*. + """ + expression_attribute_names: dict[str, str] | None = ... + """ + One or more substitution tokens for attribute names in an expression. + The following are some use cases for using `ExpressionAttributeNames`: + + - To access an attribute whose name conflicts with a DynamoDB reserved + word. + + - To create a placeholder for repeating occurrences of an attribute name + in an expression. + + - To prevent special characters in an attribute name from being + misinterpreted in an expression. + + Use the **#** character in an expression to dereference an attribute + name. For example, consider the following attribute name: + + - `Percentile` + + The name of this attribute conflicts with a reserved word, so it cannot + be used directly in an expression. (For the complete list of reserved + words, see [Reserved + Words](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html) + in the *Amazon DynamoDB Developer Guide*). To work around this, you + could specify the following for `ExpressionAttributeNames`: + + - `{"#P":"Percentile"}` + + You could then use this substitution in an expression, as in this + example: + + - `#P = :val` + + Note: + Tokens that begin with the **:** character are *expression attribute + values*, which are placeholders for the actual value at runtime. + + For more information on expression attribute names, see [Specifying Item + Attributes](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) + in the *Amazon DynamoDB Developer Guide*. + """ + +@dataclass(kw_only=True) +class GetItemOutput(_SerdeShape): + """Represents the output of a `GetItem` operation.""" + + item: dict[str, AttributeValue] | None = ... + """ + A map of attribute names to `AttributeValue` objects, as specified by + `ProjectionExpression`. + """ + consumed_capacity: ConsumedCapacity | None = ... + """ + The capacity units consumed by the `GetItem` operation. The data + returned includes the total provisioned throughput consumed, along with + statistics for the table and any indexes involved in the operation. + `ConsumedCapacity` is only returned if the `ReturnConsumedCapacity` + parameter was specified. For more information, see [Capacity unit + consumption for read + operations](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/read-write-operations.html#read-operation-consumption) + in the *Amazon DynamoDB Developer Guide*. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetResourcePolicyInput(_SerdeShape): + """Dataclass for GetResourcePolicyInput structure.""" + + resource_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the DynamoDB resource to which the + policy is attached. The resources you can specify include tables and + streams. + """ + +@dataclass(kw_only=True) +class GetResourcePolicyOutput(_SerdeShape): + """Dataclass for GetResourcePolicyOutput structure.""" + + policy: str | None = ... + """ + The resource-based policy document attached to the resource, which can + be a table or stream, in JSON format. + """ + revision_id: str | None = ... + """ + A unique string that represents the revision ID of the policy. If + you're comparing revision IDs, make sure to always use string + comparison logic. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GlobalSecondaryIndex(_SerdeShape): + """Represents the properties of a global secondary index.""" + + index_name: str + """ + The name of the global secondary index. The name must be unique among + all other indexes on this table. + """ + key_schema: list[KeySchemaElement] + """ + The complete key schema for a global secondary index, which consists of + one or more pairs of attribute names and key types: + + - `HASH` - partition key + + - `RANGE` - sort key + + Note: + The partition key of an item is also known as its *hash attribute*. The + term \"hash attribute\" derives from DynamoDB's usage of an internal + hash function to evenly distribute data items across partitions, based + on their partition key values. + + The sort key of an item is also known as its *range attribute*. The term + \"range attribute\" derives from the way DynamoDB stores items with the + same partition key physically close together, in sorted order by the + sort key value. + """ + projection: Projection + """ + Represents attributes that are copied (projected) from the table into + the global secondary index. These are in addition to the primary key + attributes and index key attributes, which are automatically projected. + """ + provisioned_throughput: ProvisionedThroughput | None = ... + """ + Represents the provisioned throughput settings for the specified global + secondary index. You must use either `OnDemandThroughput` or + `ProvisionedThroughput` based on your table's capacity mode. + + For current minimum and maximum provisioned throughput values, see + [Service, Account, and Table + Quotas](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html) + in the *Amazon DynamoDB Developer Guide*. + """ + on_demand_throughput: OnDemandThroughput | None = ... + """ + The maximum number of read and write units for the specified global + secondary index. If you use this parameter, you must specify + `MaxReadRequestUnits`, `MaxWriteRequestUnits`, or both. You must use + either `OnDemandThroughput` or `ProvisionedThroughput` based on your + table's capacity mode. + """ + warm_throughput: WarmThroughput | None = ... + """ + Represents the warm throughput value (in read units per second and write + units per second) for the specified secondary index. If you use this + parameter, you must specify `ReadUnitsPerSecond`, `WriteUnitsPerSecond`, + or both. + """ + +@dataclass(kw_only=True) +class GlobalSecondaryIndexAutoScalingUpdate(_SerdeShape): + """ + Represents the auto scaling settings of a global secondary index for a + global table that will be modified. + """ + + index_name: str | None = ... + """The name of the global secondary index.""" + provisioned_write_capacity_auto_scaling_update: ( + AutoScalingSettingsUpdate | None + ) = ... + """ + Represents the auto scaling settings to be modified for a global table + or global secondary index. + """ + +@dataclass(kw_only=True) +class GlobalSecondaryIndexDescription(_SerdeShape): + """Represents the properties of a global secondary index.""" + + index_name: str | None = ... + """The name of the global secondary index.""" + key_schema: list[KeySchemaElement] | None = ... + """ + The complete key schema for a global secondary index, which consists of + one or more pairs of attribute names and key types: + + - `HASH` - partition key + + - `RANGE` - sort key + + Note: + The partition key of an item is also known as its *hash attribute*. The + term \"hash attribute\" derives from DynamoDB's usage of an internal + hash function to evenly distribute data items across partitions, based + on their partition key values. + + The sort key of an item is also known as its *range attribute*. The term + \"range attribute\" derives from the way DynamoDB stores items with the + same partition key physically close together, in sorted order by the + sort key value. + """ + projection: Projection | None = ... + """ + Represents attributes that are copied (projected) from the table into + the global secondary index. These are in addition to the primary key + attributes and index key attributes, which are automatically projected. + """ + index_status: str | None = ... + """ + The current state of the global secondary index: + + - `CREATING` - The index is being created. + + - `UPDATING` - The index is being updated. + + - `DELETING` - The index is being deleted. + + - `ACTIVE` - The index is ready for use. + """ + backfilling: bool | None = ... + """ + Indicates whether the index is currently backfilling. *Backfilling* is + the process of reading items from the table and determining whether they + can be added to the index. (Not all items will qualify: For example, a + partition key cannot have any duplicate values.) If an item can be added + to the index, DynamoDB will do so. After all items have been processed, + the backfilling operation is complete and `Backfilling` is false. + + You can delete an index that is being created during the `Backfilling` + phase when `IndexStatus` is set to CREATING and `Backfilling` is true. + You can't delete the index that is being created when `IndexStatus` is + set to CREATING and `Backfilling` is false. + + Note: + For indexes that were created during a `CreateTable` operation, the + `Backfilling` attribute does not appear in the `DescribeTable` output. + """ + provisioned_throughput: ProvisionedThroughputDescription | None = ... + """ + Represents the provisioned throughput settings for the specified global + secondary index. + + For current minimum and maximum provisioned throughput values, see + [Service, Account, and Table + Quotas](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html) + in the *Amazon DynamoDB Developer Guide*. + """ + index_size_bytes: int | None = ... + """ + The total size of the specified index, in bytes. DynamoDB updates this + value approximately every six hours. Recent changes might not be + reflected in this value. + """ + item_count: int | None = ... + """ + The number of items in the specified index. DynamoDB updates this value + approximately every six hours. Recent changes might not be reflected in + this value. + """ + index_arn: str | None = ... + """The Amazon Resource Name (ARN) that uniquely identifies the index.""" + on_demand_throughput: OnDemandThroughput | None = ... + """ + The maximum number of read and write units for the specified global + secondary index. If you use this parameter, you must specify + `MaxReadRequestUnits`, `MaxWriteRequestUnits`, or both. + """ + warm_throughput: GlobalSecondaryIndexWarmThroughputDescription | None = ... + """ + Represents the warm throughput value (in read units per second and write + units per second) for the specified secondary index. + """ + +@dataclass(kw_only=True) +class GlobalSecondaryIndexInfo(_SerdeShape): + """ + Represents the properties of a global secondary index for the table when + the backup was created. + """ + + index_name: str | None = ... + """The name of the global secondary index.""" + key_schema: list[KeySchemaElement] | None = ... + """ + The complete key schema for a global secondary index, which consists of + one or more pairs of attribute names and key types: + + - `HASH` - partition key + + - `RANGE` - sort key + + Note: + The partition key of an item is also known as its *hash attribute*. The + term \"hash attribute\" derives from DynamoDB's usage of an internal + hash function to evenly distribute data items across partitions, based + on their partition key values. + + The sort key of an item is also known as its *range attribute*. The term + \"range attribute\" derives from the way DynamoDB stores items with the + same partition key physically close together, in sorted order by the + sort key value. + """ + projection: Projection | None = ... + """ + Represents attributes that are copied (projected) from the table into + the global secondary index. These are in addition to the primary key + attributes and index key attributes, which are automatically projected. + """ + provisioned_throughput: ProvisionedThroughput | None = ... + """ + Represents the provisioned throughput settings for the specified global + secondary index. + """ + on_demand_throughput: OnDemandThroughput | None = ... + """ + Sets the maximum number of read and write units for the specified + on-demand table. If you use this parameter, you must specify + `MaxReadRequestUnits`, `MaxWriteRequestUnits`, or both. + """ + +@dataclass(kw_only=True) +class GlobalSecondaryIndexUpdate(_SerdeShape): + """ + Represents one of the following: + + - A new global secondary index to be added to an existing table. + + - New provisioned throughput parameters for an existing global secondary + index. + + - An existing global secondary index to be removed from an existing + table. + """ + + update: UpdateGlobalSecondaryIndexAction | None = ... + """ + The name of an existing global secondary index, along with new + provisioned throughput settings to be applied to that index. + """ + create: CreateGlobalSecondaryIndexAction | None = ... + """ + The parameters required for creating a global secondary index on an + existing table: + + - `IndexName ` + + - `KeySchema ` + + - `AttributeDefinitions ` + + - `Projection ` + + - `ProvisionedThroughput ` + """ + delete: DeleteGlobalSecondaryIndexAction | None = ... + """The name of an existing global secondary index to be removed.""" + +@dataclass(kw_only=True) +class GlobalSecondaryIndexWarmThroughputDescription(_SerdeShape): + """ + The description of the warm throughput value on a global secondary + index. + """ + + read_units_per_second: int | None = ... + """ + Represents warm throughput read units per second value for a global + secondary index. + """ + write_units_per_second: int | None = ... + """ + Represents warm throughput write units per second value for a global + secondary index. + """ + status: str | None = ... + """ + Represents the warm throughput status being created or updated on a + global secondary index. The status can only be `UPDATING` or `ACTIVE`. + """ + +@dataclass(kw_only=True) +class GlobalTable(_SerdeShape): + """Represents the properties of a global table.""" + + global_table_name: str | None = ... + """The global table name.""" + replication_group: list[Replica] | None = ... + """The Regions where the global table has replicas.""" + +@dataclass(kw_only=True) +class GlobalTableAlreadyExistsException(ServiceError, _SerdeShape): + """The specified global table already exists.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GlobalTableDescription(_SerdeShape): + """Contains details about the global table.""" + + replication_group: list[ReplicaDescription] | None = ... + """The Regions where the global table has replicas.""" + global_table_arn: str | None = ... + """The unique identifier of the global table.""" + creation_date_time: datetime | None = ... + """The creation time of the global table.""" + global_table_status: str | None = ... + """ + The current state of the global table: + + - `CREATING` - The global table is being created. + + - `UPDATING` - The global table is being updated. + + - `DELETING` - The global table is being deleted. + + - `ACTIVE` - The global table is ready for use. + """ + global_table_name: str | None = ... + """The global table name.""" + +@dataclass(kw_only=True) +class GlobalTableGlobalSecondaryIndexSettingsUpdate(_SerdeShape): + """ + Represents the settings of a global secondary index for a global table + that will be modified. + """ + + index_name: str + """ + The name of the global secondary index. The name must be unique among + all other indexes on this table. + """ + provisioned_write_capacity_units: int | None = ... + """ + The maximum number of writes consumed per second before DynamoDB returns + a `ThrottlingException.` + """ + provisioned_write_capacity_auto_scaling_settings_update: ( + AutoScalingSettingsUpdate | None + ) = ... + """ + Auto scaling settings for managing a global secondary index's write + capacity units. + """ + +@dataclass(kw_only=True) +class GlobalTableNotFoundException(ServiceError, _SerdeShape): + """The specified global table does not exist.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class GlobalTableSettingsReplicationMode(UnknownEnumMixin, StrEnum): + ENABLED = "ENABLED" + DISABLED = "DISABLED" + ENABLED_WITH_OVERRIDES = "ENABLED_WITH_OVERRIDES" + +class GlobalTableStatus(UnknownEnumMixin, StrEnum): + CREATING = "CREATING" + ACTIVE = "ACTIVE" + DELETING = "DELETING" + UPDATING = "UPDATING" + +@dataclass(kw_only=True) +class GlobalTableWitnessDescription(_SerdeShape): + """Represents the properties of a witness Region in a MRSC global table.""" + + region_name: str | None = ... + """ + The name of the Amazon Web Services Region that serves as a witness for + the MRSC global table. + """ + witness_status: str | None = ... + """The current status of the witness Region in the MRSC global table.""" + +@dataclass(kw_only=True) +class GlobalTableWitnessGroupUpdate(_SerdeShape): + """ + Represents one of the following: + + - A new witness to be added to a new global table. + + - An existing witness to be removed from an existing global table. + + You can configure one witness per MRSC global table. + """ + + create: CreateGlobalTableWitnessGroupMemberAction | None = ... + """ + Specifies a witness Region to be added to a new MRSC global table. The + witness must be added when creating the MRSC global table. + """ + delete: DeleteGlobalTableWitnessGroupMemberAction | None = ... + """ + Specifies a witness Region to be removed from an existing global table. + Must be done in conjunction with removing a replica. The deletion of + both a witness and replica converts the remaining replica to a + single-Region DynamoDB table. + """ + +@dataclass(kw_only=True) +class IdempotentParameterMismatchException(ServiceError, _SerdeShape): + """ + DynamoDB rejected the request because you retried a request with a + different payload but with an idempotent token that was already used. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ImportConflictException(ServiceError, _SerdeShape): + """ + There was a conflict when importing from the specified S3 source. This + can occur when the current import conflicts with a previous import + request that had the same client token. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ImportNotFoundException(ServiceError, _SerdeShape): + """The specified import was not found.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class ImportStatus(UnknownEnumMixin, StrEnum): + IN_PROGRESS = "IN_PROGRESS" + COMPLETED = "COMPLETED" + CANCELLING = "CANCELLING" + CANCELLED = "CANCELLED" + FAILED = "FAILED" + +@dataclass(kw_only=True) +class ImportSummary(_SerdeShape): + """Summary information about the source file for the import.""" + + import_arn: str | None = ... + """The Amazon Resource Number (ARN) corresponding to the import request.""" + import_status: str | None = ... + """The status of the import operation.""" + table_arn: str | None = ... + """The Amazon Resource Number (ARN) of the table being imported into.""" + s3_bucket_source: S3BucketSource | None = ... + """ + The path and S3 bucket of the source file that is being imported. This + includes the S3Bucket (required), S3KeyPrefix (optional) and + S3BucketOwner (optional if the bucket is owned by the requester). + """ + cloud_watch_log_group_arn: str | None = ... + """ + The Amazon Resource Number (ARN) of the Cloudwatch Log Group associated + with this import task. + """ + input_format: str | None = ... + """ + The format of the source data. Valid values are `CSV`, `DYNAMODB_JSON` + or `ION`. + """ + start_time: datetime | None = ... + """The time at which this import task began.""" + end_time: datetime | None = ... + """The time at which this import task ended.""" + +@dataclass(kw_only=True) +class ImportTableDescription(_SerdeShape): + """Represents the properties of the table being imported into.""" + + import_arn: str | None = ... + """The Amazon Resource Number (ARN) corresponding to the import request.""" + import_status: str | None = ... + """The status of the import.""" + table_arn: str | None = ... + """The Amazon Resource Number (ARN) of the table being imported into.""" + table_id: str | None = ... + """The table id corresponding to the table created by import table process.""" + client_token: str | None = ... + """ + The client token that was provided for the import task. Reusing the + client token on retry makes a call to `ImportTable` idempotent. + """ + s3_bucket_source: S3BucketSource | None = ... + """ + Values for the S3 bucket the source file is imported from. Includes + bucket name (required), key prefix (optional) and bucket account owner + ID (optional). + """ + error_count: int = ... + """ + The number of errors occurred on importing the source file into the + target table. + """ + cloud_watch_log_group_arn: str | None = ... + """ + The Amazon Resource Number (ARN) of the Cloudwatch Log Group associated + with the target table. + """ + input_format: str | None = ... + """The format of the source data going into the target table.""" + input_format_options: InputFormatOptions | None = ... + """ + The format options for the data that was imported into the target table. + There is one value, CsvOption. + """ + input_compression_type: str | None = ... + """ + The compression options for the data that has been imported into the + target table. The values are NONE, GZIP, or ZSTD. + """ + table_creation_parameters: TableCreationParameters | None = ... + """The parameters for the new table that is being imported into.""" + start_time: datetime | None = ... + """The time when this import task started.""" + end_time: datetime | None = ... + """ + The time at which the creation of the table associated with this import + task completed. + """ + processed_size_bytes: int | None = ... + """The total size of data processed from the source file, in Bytes.""" + processed_item_count: int = ... + """The total number of items processed from the source file.""" + imported_item_count: int = ... + """The number of items successfully imported into the new table.""" + failure_code: str | None = ... + """ + The error code corresponding to the failure that the import job ran into + during execution. + """ + failure_message: str | None = ... + """ + The error message corresponding to the failure that the import job ran + into during execution. + """ + +@dataclass(kw_only=True) +class ImportTableInput(_SerdeShape): + """Dataclass for ImportTableInput structure.""" + + client_token: str | None = ... + """ + Providing a `ClientToken` makes the call to `ImportTableInput` + idempotent, meaning that multiple identical calls have the same effect + as one single call. + + A client token is valid for 8 hours after the first request that uses it + is completed. After 8 hours, any request with the same client token is + treated as a new request. Do not resubmit the same request with the same + client token for more than 8 hours, or the result might not be + idempotent. + + If you submit a request with the same client token but a change in other + parameters within the 8-hour idempotency window, DynamoDB returns an + `IdempotentParameterMismatch` exception. + """ + s3_bucket_source: S3BucketSource | None = ... + """The S3 bucket that provides the source for the import.""" + input_format: str | None = ... + """ + The format of the source data. Valid values for `ImportFormat` are + `CSV`, `DYNAMODB_JSON` or `ION`. + """ + input_format_options: InputFormatOptions | None = ... + """Additional properties that specify how the input is formatted,""" + input_compression_type: str | None = ... + """ + Type of compression to be used on the input coming from the imported + table. + """ + table_creation_parameters: TableCreationParameters | None = ... + """Parameters for the table to import the data into.""" + +@dataclass(kw_only=True) +class ImportTableOutput(_SerdeShape): + """Dataclass for ImportTableOutput structure.""" + + import_table_description: ImportTableDescription + """ + Represents the properties of the table created for the import, and + parameters of the import. The import parameters include import status, + how many items were processed, and how many errors were encountered. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class IncrementalExportSpecification(_SerdeShape): + """ + Optional object containing the parameters specific to an incremental + export. + """ + + export_from_time: datetime | None = ... + """ + Time in the past which provides the inclusive start range for the export + table's data, counted in seconds from the start of the Unix epoch. The + incremental export will reflect the table's state including and after + this point in time. + """ + export_to_time: datetime | None = ... + """ + Time in the past which provides the exclusive end range for the export + table's data, counted in seconds from the start of the Unix epoch. The + incremental export will reflect the table's state just prior to this + point in time. If this is not provided, the latest time with data + available will be used. + """ + export_view_type: str | None = ... + """ + The view type that was chosen for the export. Valid values are + `NEW_AND_OLD_IMAGES` and `NEW_IMAGES`. The default value is + `NEW_AND_OLD_IMAGES`. + + `NEW_AND_OLD_IMAGES` exports both the new and old images of each changed + item, while `NEW_IMAGES` exports only the new (latest) image. The view + type you choose determines the structure of each item in the output for + `insert`, `update`, and `delete` operations. For details and examples of + how each view type shapes the export output, see [DynamoDB table export + output + format](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/S3DataExport.Output.html) + in the *Amazon DynamoDB Developer Guide*. + """ + +@dataclass(kw_only=True) +class IndexNotFoundException(ServiceError, _SerdeShape): + """The operation tried to access a nonexistent index.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class IndexStatus(UnknownEnumMixin, StrEnum): + CREATING = "CREATING" + UPDATING = "UPDATING" + DELETING = "DELETING" + ACTIVE = "ACTIVE" + +class InputCompressionType(UnknownEnumMixin, StrEnum): + GZIP = "GZIP" + ZSTD = "ZSTD" + NONE = "NONE" + +class InputFormat(UnknownEnumMixin, StrEnum): + DYNAMODB_JSON = "DYNAMODB_JSON" + ION = "ION" + CSV = "CSV" + +@dataclass(kw_only=True) +class InputFormatOptions(_SerdeShape): + """ + The format options for the data that was imported into the target table. + There is one value, CsvOption. + """ + + csv: CsvOptions | None = ... + """ + The options for imported source files in CSV format. The values are + Delimiter and HeaderList. + """ + +@dataclass(kw_only=True) +class InternalServerError(ServiceError, _SerdeShape): + """An error occurred on the server side.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidEndpointException(ServiceError, _SerdeShape): + """Dataclass for InvalidEndpointException structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidExportTimeException(ServiceError, _SerdeShape): + """ + The specified `ExportTime` is outside of the point in time recovery + window. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidRestoreTimeException(ServiceError, _SerdeShape): + """ + An invalid restore time was specified. RestoreDateTime must be between + EarliestRestorableDateTime and LatestRestorableDateTime. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ItemCollectionMetrics(_SerdeShape): + """ + Information about item collections, if any, that were affected by the + operation. `ItemCollectionMetrics` is only returned if the request asked + for it. If the table does not have any local secondary indexes, this + information is not returned in the response. + """ + + item_collection_key: dict[str, AttributeValue] | None = ... + """ + The partition key value of the item collection. This value is the same + as the partition key value of the item. + """ + size_estimate_range_gb: list[float] | None = ... + """ + An estimate of item collection size, in gigabytes. This value is a + two-element array containing a lower bound and an upper bound for the + estimate. The estimate includes the size of all the items in the table, + plus the size of all attributes projected into all of the local + secondary indexes on that table. Use this estimate to measure whether a + local secondary index is approaching its size limit. + + The estimate is subject to change over time; therefore, do not rely on + the precision or accuracy of the estimate. + """ + +@dataclass(kw_only=True) +class ItemCollectionSizeLimitExceededException(ServiceError, _SerdeShape): + """ + An item collection is too large. This exception is only returned for + tables that have one or more local secondary indexes. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ItemResponse(_SerdeShape): + """Details for the requested item.""" + + item: dict[str, AttributeValue] | None = ... + """Map of attribute data consisting of the data type and attribute value.""" + +@dataclass(kw_only=True) +class KeysAndAttributes(_SerdeShape): + """ + Represents a set of primary keys and, for each key, the attributes to + retrieve from the table. + + For each primary key, you must provide *all* of the key attributes. For + example, with a simple primary key, you only need to provide the + partition key. For a composite primary key, you must provide *both* the + partition key and the sort key. + """ + + keys: list[dict[str, AttributeValue]] + """ + The primary key attribute values that define the items and the + attributes associated with the items. + """ + attributes_to_get: list[str] | None = ... + """ + This is a legacy parameter. Use `ProjectionExpression` instead. For more + information, see [Legacy Conditional + Parameters](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.html) + in the *Amazon DynamoDB Developer Guide*. + """ + consistent_read: bool | None = ... + """ + The consistency of a read operation. If set to `true`, then a strongly + consistent read is used; otherwise, an eventually consistent read is + used. + """ + projection_expression: str | None = ... + """ + A string that identifies one or more attributes to retrieve from the + table. These attributes can include scalars, sets, or elements of a JSON + document. The attributes in the `ProjectionExpression` must be separated + by commas. + + If no attribute names are specified, then all attributes will be + returned. If any of the requested attributes are not found, they will + not appear in the result. + + For more information, see [Accessing Item + Attributes](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) + in the *Amazon DynamoDB Developer Guide*. + """ + expression_attribute_names: dict[str, str] | None = ... + """ + One or more substitution tokens for attribute names in an expression. + The following are some use cases for using `ExpressionAttributeNames`: + + - To access an attribute whose name conflicts with a DynamoDB reserved + word. + + - To create a placeholder for repeating occurrences of an attribute name + in an expression. + + - To prevent special characters in an attribute name from being + misinterpreted in an expression. + + Use the **#** character in an expression to dereference an attribute + name. For example, consider the following attribute name: + + - `Percentile` + + The name of this attribute conflicts with a reserved word, so it cannot + be used directly in an expression. (For the complete list of reserved + words, see [Reserved + Words](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html) + in the *Amazon DynamoDB Developer Guide*). To work around this, you + could specify the following for `ExpressionAttributeNames`: + + - `{"#P":"Percentile"}` + + You could then use this substitution in an expression, as in this + example: + + - `#P = :val` + + Note: + Tokens that begin with the **:** character are *expression attribute + values*, which are placeholders for the actual value at runtime. + + For more information on expression attribute names, see [Accessing Item + Attributes](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) + in the *Amazon DynamoDB Developer Guide*. + """ + +@dataclass(kw_only=True) +class KeySchemaElement(_SerdeShape): + """ + Represents *a single element* of a key schema. A key schema specifies + the attributes that make up the primary key of a table, or the key + attributes of an index. + + A `KeySchemaElement` represents exactly one attribute of the primary + key. For example, a simple primary key would be represented by one + `KeySchemaElement` (for the partition key). A composite primary key + would require one `KeySchemaElement` for the partition key, and another + `KeySchemaElement` for the sort key. + + A `KeySchemaElement` must be a scalar, top-level attribute (not a nested + attribute). The data type must be one of String, Number, or Binary. The + attribute cannot be nested within a List or a Map. + """ + + attribute_name: str + """The name of a key attribute.""" + key_type: str + """ + The role that this key attribute will assume: + + - `HASH` - partition key + + - `RANGE` - sort key + + Note: + The partition key of an item is also known as its *hash attribute*. The + term \"hash attribute\" derives from DynamoDB's usage of an internal + hash function to evenly distribute data items across partitions, based + on their partition key values. + + The sort key of an item is also known as its *range attribute*. The term + \"range attribute\" derives from the way DynamoDB stores items with the + same partition key physically close together, in sorted order by the + sort key value. + """ + +class KeyType(UnknownEnumMixin, StrEnum): + HASH = "HASH" + RANGE = "RANGE" + +@dataclass(kw_only=True) +class KinesisDataStreamDestination(_SerdeShape): + """Describes a Kinesis data stream destination.""" + + stream_arn: str | None = ... + """The ARN for a specific Kinesis data stream.""" + destination_status: str | None = ... + """The current status of replication.""" + destination_status_description: str | None = ... + """The human-readable string that corresponds to the replica status.""" + approximate_creation_date_time_precision: str | None = ... + """ + The precision of the Kinesis data stream timestamp. The values are + either `MILLISECOND` or `MICROSECOND`. + """ + +@dataclass(kw_only=True) +class LimitExceededException(ServiceError, _SerdeShape): + """ + There is no limit to the number of daily on-demand backups that can be + taken. + + For most purposes, up to 500 simultaneous table operations are allowed + per account. These operations include `CreateTable`, `UpdateTable`, + `DeleteTable`,`UpdateTimeToLive`, `RestoreTableFromBackup`, and + `RestoreTableToPointInTime`. + + When you are creating a table with one or more secondary indexes, you + can have up to 250 such requests running at a time. However, if the + table or index specifications are complex, then DynamoDB might + temporarily reduce the number of concurrent operations. + + When importing into DynamoDB, up to 50 simultaneous import table + operations are allowed per account. + + There is a soft account quota of 2,500 tables. + + GetRecords was called with a value of more than 1000 for the limit + request parameter. + + More than 2 processes are reading from the same streams shard at the + same time. Exceeding this limit may result in request throttling. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListBackupsInput(_SerdeShape): + """Dataclass for ListBackupsInput structure.""" + + table_name: str | None = ... + """ + Lists the backups from the table specified in `TableName`. You can also + provide the Amazon Resource Name (ARN) of the table in this parameter. + """ + limit: int | None = ... + """Maximum number of backups to return at once.""" + time_range_lower_bound: datetime | None = ... + """ + Only backups created after this time are listed. `TimeRangeLowerBound` + is inclusive. + """ + time_range_upper_bound: datetime | None = ... + """ + Only backups created before this time are listed. `TimeRangeUpperBound` + is exclusive. + """ + exclusive_start_backup_arn: str | None = ... + """ + `LastEvaluatedBackupArn` is the Amazon Resource Name (ARN) of the backup + last evaluated when the current page of results was returned, inclusive + of the current page of results. This value may be specified as the + `ExclusiveStartBackupArn` of a new `ListBackups` operation in order to + fetch the next page of results. + """ + backup_type: str | None = ... + """ + The backups from the table specified by `BackupType` are listed. + + Where `BackupType` can be: + + - `USER` - On-demand backup created by you. (The default setting if no + other backup types are specified.) + + - `SYSTEM` - On-demand backup automatically created by DynamoDB. + + - `ALL` - All types of on-demand backups (USER and SYSTEM). + """ + +@dataclass(kw_only=True) +class ListBackupsOutput(_SerdeShape): + """Dataclass for ListBackupsOutput structure.""" + + backup_summaries: list[BackupSummary] | None = ... + """List of `BackupSummary` objects.""" + last_evaluated_backup_arn: str | None = ... + """ + The ARN of the backup last evaluated when the current page of results + was returned, inclusive of the current page of results. This value may + be specified as the `ExclusiveStartBackupArn` of a new `ListBackups` + operation in order to fetch the next page of results. + + If `LastEvaluatedBackupArn` is empty, then the last page of results has + been processed and there are no more results to be retrieved. + + If `LastEvaluatedBackupArn` is not empty, this may or may not indicate + that there is more data to be returned. All results are guaranteed to + have been returned if and only if no value for `LastEvaluatedBackupArn` + is returned. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListContributorInsightsInput(_SerdeShape): + """Dataclass for ListContributorInsightsInput structure.""" + + table_name: str | None = ... + """ + The name of the table. You can also provide the Amazon Resource Name + (ARN) of the table in this parameter. + """ + next_token: str | None = ... + """A token to for the desired page, if there is one.""" + max_results: int = ... + """Maximum number of results to return per page.""" + +@dataclass(kw_only=True) +class ListContributorInsightsOutput(_SerdeShape): + """Dataclass for ListContributorInsightsOutput structure.""" + + contributor_insights_summaries: list[ContributorInsightsSummary] | None = ... + """A list of ContributorInsightsSummary.""" + next_token: str | None = ... + """A token to go to the next page if there is one.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListExportsInput(_SerdeShape): + """Dataclass for ListExportsInput structure.""" + + table_arn: str | None = ... + """The Amazon Resource Name (ARN) associated with the exported table.""" + max_results: int | None = ... + """Maximum number of results to return per page.""" + next_token: str | None = ... + """ + An optional string that, if supplied, must be copied from the output of + a previous call to `ListExports`. When provided in this manner, the API + fetches the next page of results. + """ + +@dataclass(kw_only=True) +class ListExportsOutput(_SerdeShape): + """Dataclass for ListExportsOutput structure.""" + + export_summaries: list[ExportSummary] | None = ... + """A list of `ExportSummary` objects.""" + next_token: str | None = ... + """ + If this value is returned, there are additional results to be displayed. + To retrieve them, call `ListExports` again, with `NextToken` set to this + value. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListGlobalTablesInput(_SerdeShape): + """Dataclass for ListGlobalTablesInput structure.""" + + exclusive_start_global_table_name: str | None = ... + """The first global table name that this operation will evaluate.""" + limit: int | None = ... + """ + The maximum number of table names to return, if the parameter is not + specified DynamoDB defaults to 100. + + If the number of global tables DynamoDB finds reaches this limit, it + stops the operation and returns the table names collected up to that + point, with a table name in the `LastEvaluatedGlobalTableName` to apply + in a subsequent operation to the `ExclusiveStartGlobalTableName` + parameter. + """ + region_name: str | None = ... + """Lists the global tables in a specific Region.""" + +@dataclass(kw_only=True) +class ListGlobalTablesOutput(_SerdeShape): + """Dataclass for ListGlobalTablesOutput structure.""" + + global_tables: list[GlobalTable] | None = ... + """List of global table names.""" + last_evaluated_global_table_name: str | None = ... + """Last evaluated global table name.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListImportsInput(_SerdeShape): + """Dataclass for ListImportsInput structure.""" + + table_arn: str | None = ... + """ + The Amazon Resource Name (ARN) associated with the table that was + imported to. + """ + page_size: int | None = ... + """The number of `ImportSummary `objects returned in a single page.""" + next_token: str | None = ... + """ + An optional string that, if supplied, must be copied from the output of + a previous call to `ListImports`. When provided in this manner, the API + fetches the next page of results. + """ + +@dataclass(kw_only=True) +class ListImportsOutput(_SerdeShape): + """Dataclass for ListImportsOutput structure.""" + + import_summary_list: list[ImportSummary] | None = ... + """A list of `ImportSummary` objects.""" + next_token: str | None = ... + """ + If this value is returned, there are additional results to be displayed. + To retrieve them, call `ListImports` again, with `NextToken` set to this + value. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListTablesInput(_SerdeShape): + """Represents the input of a `ListTables` operation.""" + + exclusive_start_table_name: str | None = ... + """ + The first table name that this operation will evaluate. Use the value + that was returned for `LastEvaluatedTableName` in a previous operation, + so that you can obtain the next page of results. + """ + limit: int | None = ... + """ + A maximum number of table names to return. If this parameter is not + specified, the limit is 100. + """ + +@dataclass(kw_only=True) +class ListTablesOutput(_SerdeShape): + """Represents the output of a `ListTables` operation.""" + + table_names: list[str] | None = ... + """ + The names of the tables associated with the current account at the + current endpoint. The maximum size of this array is 100. + + If `LastEvaluatedTableName` also appears in the output, you can use this + value as the `ExclusiveStartTableName` parameter in a subsequent + `ListTables` request and obtain the next page of results. + """ + last_evaluated_table_name: str | None = ... + """ + The name of the last table in the current page of results. Use this + value as the `ExclusiveStartTableName` in a new request to obtain the + next page of results, until all the table names are returned. + + If you do not receive a `LastEvaluatedTableName` value in the response, + this means that there are no more table names to be retrieved. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListTagsOfResourceInput(_SerdeShape): + """Dataclass for ListTagsOfResourceInput structure.""" + + resource_arn: str | None = ... + """ + The Amazon DynamoDB resource with tags to be listed. This value is an + Amazon Resource Name (ARN). + """ + next_token: str | None = ... + """ + An optional string that, if supplied, must be copied from the output of + a previous call to ListTagOfResource. When provided in this manner, this + API fetches the next page of results. + """ + +@dataclass(kw_only=True) +class ListTagsOfResourceOutput(_SerdeShape): + """Dataclass for ListTagsOfResourceOutput structure.""" + + tags: list[Tag] | None = ... + """The tags currently associated with the Amazon DynamoDB resource.""" + next_token: str | None = ... + """ + If this value is returned, there are additional results to be displayed. + To retrieve them, call ListTagsOfResource again, with NextToken set to + this value. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class LocalSecondaryIndex(_SerdeShape): + """Represents the properties of a local secondary index.""" + + index_name: str + """ + The name of the local secondary index. The name must be unique among all + other indexes on this table. + """ + key_schema: list[KeySchemaElement] + """ + The complete key schema for the local secondary index, consisting of one + or more pairs of attribute names and key types: + + - `HASH` - partition key + + - `RANGE` - sort key + + Note: + The partition key of an item is also known as its *hash attribute*. The + term \"hash attribute\" derives from DynamoDB's usage of an internal + hash function to evenly distribute data items across partitions, based + on their partition key values. + + The sort key of an item is also known as its *range attribute*. The term + \"range attribute\" derives from the way DynamoDB stores items with the + same partition key physically close together, in sorted order by the + sort key value. + """ + projection: Projection + """ + Represents attributes that are copied (projected) from the table into + the local secondary index. These are in addition to the primary key + attributes and index key attributes, which are automatically projected. + """ + +@dataclass(kw_only=True) +class LocalSecondaryIndexDescription(_SerdeShape): + """Represents the properties of a local secondary index.""" + + index_name: str | None = ... + """Represents the name of the local secondary index.""" + key_schema: list[KeySchemaElement] | None = ... + """ + The complete key schema for the local secondary index, consisting of one + or more pairs of attribute names and key types: + + - `HASH` - partition key + + - `RANGE` - sort key + + Note: + The partition key of an item is also known as its *hash attribute*. The + term \"hash attribute\" derives from DynamoDB's usage of an internal + hash function to evenly distribute data items across partitions, based + on their partition key values. + + The sort key of an item is also known as its *range attribute*. The term + \"range attribute\" derives from the way DynamoDB stores items with the + same partition key physically close together, in sorted order by the + sort key value. + """ + projection: Projection | None = ... + """ + Represents attributes that are copied (projected) from the table into + the global secondary index. These are in addition to the primary key + attributes and index key attributes, which are automatically projected. + """ + index_size_bytes: int | None = ... + """ + The total size of the specified index, in bytes. DynamoDB updates this + value approximately every six hours. Recent changes might not be + reflected in this value. + """ + item_count: int | None = ... + """ + The number of items in the specified index. DynamoDB updates this value + approximately every six hours. Recent changes might not be reflected in + this value. + """ + index_arn: str | None = ... + """The Amazon Resource Name (ARN) that uniquely identifies the index.""" + +@dataclass(kw_only=True) +class LocalSecondaryIndexInfo(_SerdeShape): + """ + Represents the properties of a local secondary index for the table when + the backup was created. + """ + + index_name: str | None = ... + """Represents the name of the local secondary index.""" + key_schema: list[KeySchemaElement] | None = ... + """ + The complete key schema for a local secondary index, which consists of + one or more pairs of attribute names and key types: + + - `HASH` - partition key + + - `RANGE` - sort key + + Note: + The partition key of an item is also known as its *hash attribute*. The + term \"hash attribute\" derives from DynamoDB's usage of an internal + hash function to evenly distribute data items across partitions, based + on their partition key values. + + The sort key of an item is also known as its *range attribute*. The term + \"range attribute\" derives from the way DynamoDB stores items with the + same partition key physically close together, in sorted order by the + sort key value. + """ + projection: Projection | None = ... + """ + Represents attributes that are copied (projected) from the table into + the global secondary index. These are in addition to the primary key + attributes and index key attributes, which are automatically projected. + """ + +class MultiRegionConsistency(UnknownEnumMixin, StrEnum): + EVENTUAL = "EVENTUAL" + STRONG = "STRONG" + +@dataclass(kw_only=True) +class OnDemandThroughput(_SerdeShape): + """ + Sets the maximum number of read and write units for the specified + on-demand table. If you use this parameter, you must specify + `MaxReadRequestUnits`, `MaxWriteRequestUnits`, or both. + """ + + max_read_request_units: int | None = ... + """ + Maximum number of read request units for the specified table. + + To specify a maximum `OnDemandThroughput` on your table, set the value + of `MaxReadRequestUnits` as greater than or equal to 1. To remove the + maximum `OnDemandThroughput` that is currently set on your table, set + the value of `MaxReadRequestUnits` to -1. + """ + max_write_request_units: int | None = ... + """ + Maximum number of write request units for the specified table. + + To specify a maximum `OnDemandThroughput` on your table, set the value + of `MaxWriteRequestUnits` as greater than or equal to 1. To remove the + maximum `OnDemandThroughput` that is currently set on your table, set + the value of `MaxWriteRequestUnits` to -1. + """ + +@dataclass(kw_only=True) +class OnDemandThroughputOverride(_SerdeShape): + """ + Overrides the on-demand throughput settings for this replica table. If + you don't specify a value for this parameter, it uses the source + table's on-demand throughput settings. + """ + + max_read_request_units: int | None = ... + """Maximum number of read request units for the specified replica table.""" + +@dataclass(kw_only=True) +class ParameterizedStatement(_SerdeShape): + """Represents a PartiQL statement that uses parameters.""" + + statement: str + """A PartiQL statement that uses parameters.""" + parameters: list[AttributeValue] | None = ... + """The parameter values.""" + return_values_on_condition_check_failure: str | None = ... + """ + An optional parameter that returns the item attributes for a PartiQL + `ParameterizedStatement` operation that failed a condition check. + + There is no additional cost associated with requesting a return value + aside from the small network and processing overhead of receiving a + larger response. No read capacity units are consumed. + """ + +@dataclass(kw_only=True) +class PointInTimeRecoveryDescription(_SerdeShape): + """The description of the point in time settings applied to the table.""" + + point_in_time_recovery_status: str | None = ... + """ + The current state of point in time recovery: + + - `ENABLED` - Point in time recovery is enabled. + + - `DISABLED` - Point in time recovery is disabled. + """ + recovery_period_in_days: int | None = ... + """ + The number of preceding days for which continuous backups are taken and + maintained. Your table data is only recoverable to any point-in-time + from within the configured recovery period. This parameter is optional. + """ + earliest_restorable_date_time: datetime | None = ... + """ + Specifies the earliest point in time you can restore your table to. You + can restore your table to any point in time during the last 35 days. + """ + latest_restorable_date_time: datetime | None = ... + """ + `LatestRestorableDateTime` is typically 5 minutes before the current + time. + """ + +@dataclass(kw_only=True) +class PointInTimeRecoverySpecification(_SerdeShape): + """Represents the settings used to enable point in time recovery.""" + + point_in_time_recovery_enabled: bool + """ + Indicates whether point in time recovery is enabled (true) or disabled + (false) on the table. + """ + recovery_period_in_days: int | None = ... + """ + The number of preceding days for which continuous backups are taken and + maintained. Your table data is only recoverable to any point-in-time + from within the configured recovery period. This parameter is optional. + If no value is provided, the value will default to 35. + """ + +class PointInTimeRecoveryStatus(UnknownEnumMixin, StrEnum): + ENABLED = "ENABLED" + DISABLED = "DISABLED" + +@dataclass(kw_only=True) +class PointInTimeRecoveryUnavailableException(ServiceError, _SerdeShape): + """Point in time recovery has not yet been enabled for this source table.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class PolicyNotFoundException(ServiceError, _SerdeShape): + """ + The operation tried to access a nonexistent resource-based policy. + + If you specified an `ExpectedRevisionId`, it's possible that a policy + is present for the resource but its revision ID didn't match the + expected value. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class Projection(_SerdeShape): + """ + Represents attributes that are copied (projected) from the table into an + index. These are in addition to the primary key attributes and index key + attributes, which are automatically projected. + """ + + projection_type: str | None = ... + """ + The set of attributes that are projected into the index: + + - `KEYS_ONLY` - Only the index and primary keys are projected into the + index. + + - `INCLUDE` - In addition to the attributes described in `KEYS_ONLY`, + the secondary index will include other non-key attributes that you + specify. + + - `ALL` - All of the table attributes are projected into the index. + + When using the DynamoDB console, `ALL` is selected by default. + """ + non_key_attributes: list[str] | None = ... + """ + Represents the non-key attribute names which will be projected into the + index. + + For global and local secondary indexes, the total count of + `NonKeyAttributes` summed across all of the secondary indexes, must not + exceed 100. If you project the same attribute into two different + indexes, this counts as two distinct attributes when determining the + total. This limit only applies when you specify the ProjectionType of + `INCLUDE`. You still can specify the ProjectionType of `ALL` to project + all attributes from the source table, even if the table has more than + 100 attributes. + """ + +class ProjectionType(UnknownEnumMixin, StrEnum): + ALL = "ALL" + KEYS_ONLY = "KEYS_ONLY" + INCLUDE = "INCLUDE" + +@dataclass(kw_only=True) +class ProvisionedThroughput(_SerdeShape): + """ + Represents the provisioned throughput settings for the specified global + secondary index. You must use `ProvisionedThroughput` or + `OnDemandThroughput` based on your table's capacity mode. + + For current minimum and maximum provisioned throughput values, see + [Service, Account, and Table + Quotas](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html) + in the *Amazon DynamoDB Developer Guide*. + """ + + read_capacity_units: int + """ + The maximum number of strongly consistent reads consumed per second + before DynamoDB returns a `ThrottlingException`. For more information, + see [Specifying Read and Write + Requirements](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughput.html) + in the *Amazon DynamoDB Developer Guide*. + + If read/write capacity mode is `PAY_PER_REQUEST` the value is set to 0. + """ + write_capacity_units: int + """ + The maximum number of writes consumed per second before DynamoDB returns + a `ThrottlingException`. For more information, see [Specifying Read and + Write + Requirements](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughput.html) + in the *Amazon DynamoDB Developer Guide*. + + If read/write capacity mode is `PAY_PER_REQUEST` the value is set to 0. + """ + +@dataclass(kw_only=True) +class ProvisionedThroughputDescription(_SerdeShape): + """ + Represents the provisioned throughput settings for the table, consisting + of read and write capacity units, along with data about increases and + decreases. + """ + + last_increase_date_time: datetime | None = ... + """ + The date and time of the last provisioned throughput increase for this + table. + """ + last_decrease_date_time: datetime | None = ... + """ + The date and time of the last provisioned throughput decrease for this + table. + """ + number_of_decreases_today: int | None = ... + """ + The number of provisioned throughput decreases for this table during + this UTC calendar day. For current maximums on provisioned throughput + decreases, see [Service, Account, and Table + Quotas](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html) + in the *Amazon DynamoDB Developer Guide*. + """ + read_capacity_units: int | None = ... + """ + The maximum number of strongly consistent reads consumed per second + before DynamoDB returns a `ThrottlingException`. Eventually consistent + reads require less effort than strongly consistent reads, so a setting + of 50 `ReadCapacityUnits` per second provides 100 eventually consistent + `ReadCapacityUnits` per second. + + For a table or global secondary index that uses on-demand capacity mode + (`PAY_PER_REQUEST`), this value is `0`, because on-demand mode does not + use provisioned throughput. + """ + write_capacity_units: int | None = ... + """ + The maximum number of writes consumed per second before DynamoDB returns + a `ThrottlingException`. + + For a table or global secondary index that uses on-demand capacity mode + (`PAY_PER_REQUEST`), this value is `0`, because on-demand mode does not + use provisioned throughput. + """ + +@dataclass(kw_only=True) +class ProvisionedThroughputExceededException(ServiceError, _SerdeShape): + """ + The request was denied due to request throttling. For detailed + information about why the request was throttled and the ARN of the + impacted resource, find the + [ThrottlingReason](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ThrottlingReason.html) + field in the returned exception. The Amazon Web Services SDKs for + DynamoDB automatically retry requests that receive this exception. Your + request is eventually successful, unless your retry queue is too large + to finish. Reduce the frequency of requests and use exponential backoff. + For more information, go to [Error Retries and Exponential + Backoff](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff) + in the *Amazon DynamoDB Developer Guide*. + """ + + throttling_reasons: list[ThrottlingReason] | None = ... + """ + A list of + [ThrottlingReason](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ThrottlingReason.html) + that provide detailed diagnostic information about why the request was + throttled. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ProvisionedThroughputOverride(_SerdeShape): + """ + Replica-specific provisioned throughput settings. If not specified, uses + the source table's provisioned throughput settings. + """ + + read_capacity_units: int | None = ... + """ + Replica-specific read capacity units. If not specified, uses the source + table's read capacity settings. + """ + +@dataclass(kw_only=True) +class Put(_SerdeShape): + """Represents a request to perform a `PutItem` operation.""" + + item: dict[str, AttributeValue] + """ + A map of attribute name to attribute values, representing the primary + key of the item to be written by `PutItem`. All of the table's primary + key attributes must be specified, and their data types must match those + of the table's key schema. If any attributes are present in the item + that are part of an index key schema for the table, their types must + match the index key schema. + """ + table_name: str + """ + Name of the table in which to write the item. You can also provide the + Amazon Resource Name (ARN) of the table in this parameter. + """ + condition_expression: str | None = ... + """ + A condition that must be satisfied in order for a conditional update to + succeed. + """ + expression_attribute_names: dict[str, str] | None = ... + """One or more substitution tokens for attribute names in an expression.""" + expression_attribute_values: dict[str, AttributeValue] | None = ... + """One or more values that can be substituted in an expression.""" + return_values_on_condition_check_failure: str | None = ... + """ + Use `ReturnValuesOnConditionCheckFailure` to get the item attributes if + the `Put` condition fails. For `ReturnValuesOnConditionCheckFailure`, + the valid values are: NONE and ALL_OLD. + """ + +@dataclass(kw_only=True) +class PutItemInput(_SerdeShape): + """Represents the input of a `PutItem` operation.""" + + table_name: str | None = ... + """ + The name of the table to contain the item. You can also provide the + Amazon Resource Name (ARN) of the table in this parameter. + """ + item: dict[str, AttributeValue] | None = ... + """ + A map of attribute name/value pairs, one for each attribute. Only the + primary key attributes are required; you can optionally provide other + attribute name-value pairs for the item. + + You must provide all of the attributes for the primary key. For example, + with a simple primary key, you only need to provide a value for the + partition key. For a composite primary key, you must provide both values + for both the partition key and the sort key. + + If you specify any attributes that are part of an index key, then the + data types for those attributes must match those of the schema in the + table's attribute definition. + + If the table has vector indexes, the following validations apply to + write operations. A violation of any of these constraints results in a + `ValidationException`: + + - The vector attribute must be a list of numbers with dimensions + matching the index configuration. + + - Vector values must fit in 32-bit IEEE-754 floating point format (f32). + + - Partition key and inline filter attributes defined in the search + schema must have data types matching the index schema definition. + + Empty String and Binary attribute values are allowed. Attribute values + of type String and Binary must have a length greater than zero if the + attribute is used as a key attribute for a table or index. + + For more information about primary keys, see [Primary + Key](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.CoreComponents.html#HowItWorks.CoreComponents.PrimaryKey) + in the *Amazon DynamoDB Developer Guide*. + + Each element in the `Item` map is an `AttributeValue` object. + """ + expected: dict[str, ExpectedAttributeValue] | None = ... + """ + This is a legacy parameter. Use `ConditionExpression` instead. For more + information, see + [Expected](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.Expected.html) + in the *Amazon DynamoDB Developer Guide*. + """ + return_values: str | None = ... + """ + Use `ReturnValues` if you want to get the item attributes as they + appeared before they were updated with the `PutItem` request. For + `PutItem`, the valid values are: + + - `NONE` - If `ReturnValues` is not specified, or if its value is + `NONE`, then nothing is returned. (This setting is the default for + `ReturnValues`.) + + - `ALL_OLD` - If `PutItem` overwrote an attribute name-value pair, then + the content of the old item is returned. + + The values returned are strongly consistent. + + There is no additional cost associated with requesting a return value + aside from the small network and processing overhead of receiving a + larger response. No read capacity units are consumed. + + Note: + The `ReturnValues` parameter is used by several DynamoDB operations; + however, `PutItem` does not recognize any values other than `NONE` or + `ALL_OLD`. + """ + return_consumed_capacity: str | None = ... + """ + Determines the level of detail about either provisioned or on-demand + throughput consumption that is returned in the response: + + - `INDEXES` - The response includes the aggregate `ConsumedCapacity` for + the operation, together with `ConsumedCapacity` for each table and + secondary index that was accessed. + + Note that some operations, such as `GetItem` and `BatchGetItem`, do + not access any indexes at all. In these cases, specifying `INDEXES` + will only return `ConsumedCapacity` information for table(s). + + - `TOTAL` - The response includes only the aggregate `ConsumedCapacity` + for the operation. + + - `NONE` - No `ConsumedCapacity` details are included in the response. + """ + return_item_collection_metrics: str | None = ... + """ + Determines whether item collection metrics are returned. If set to + `SIZE`, the response includes statistics about item collections, if any, + that were modified during the operation are returned in the response. If + set to `NONE` (the default), no statistics are returned. + """ + conditional_operator: str | None = ... + """ + This is a legacy parameter. Use `ConditionExpression` instead. For more + information, see + [ConditionalOperator](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.ConditionalOperator.html) + in the *Amazon DynamoDB Developer Guide*. + """ + condition_expression: str | None = ... + """ + A condition that must be satisfied in order for a conditional `PutItem` + operation to succeed. + + An expression can contain any of the following: + + - Functions: + `attribute_exists | attribute_not_exists | attribute_type | contains | begins_with | size` + + These function names are case-sensitive. + + - Comparison operators: `= | <> | < | > | <= | >= | BETWEEN | IN ` + + - Logical operators: `AND | OR | NOT` + + For more information on condition expressions, see [Condition + Expressions](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html) + in the *Amazon DynamoDB Developer Guide*. + """ + expression_attribute_names: dict[str, str] | None = ... + """ + One or more substitution tokens for attribute names in an expression. + The following are some use cases for using `ExpressionAttributeNames`: + + - To access an attribute whose name conflicts with a DynamoDB reserved + word. + + - To create a placeholder for repeating occurrences of an attribute name + in an expression. + + - To prevent special characters in an attribute name from being + misinterpreted in an expression. + + Use the **#** character in an expression to dereference an attribute + name. For example, consider the following attribute name: + + - `Percentile` + + The name of this attribute conflicts with a reserved word, so it cannot + be used directly in an expression. (For the complete list of reserved + words, see [Reserved + Words](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html) + in the *Amazon DynamoDB Developer Guide*). To work around this, you + could specify the following for `ExpressionAttributeNames`: + + - `{"#P":"Percentile"}` + + You could then use this substitution in an expression, as in this + example: + + - `#P = :val` + + Note: + Tokens that begin with the **:** character are *expression attribute + values*, which are placeholders for the actual value at runtime. + + For more information on expression attribute names, see [Specifying Item + Attributes](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) + in the *Amazon DynamoDB Developer Guide*. + """ + expression_attribute_values: dict[str, AttributeValue] | None = ... + """ + One or more values that can be substituted in an expression. + + Use the **:** (colon) character in an expression to dereference an + attribute value. For example, suppose that you wanted to check whether + the value of the *ProductStatus* attribute was one of the following: + + `Available | Backordered | Discontinued` + + You would first need to specify `ExpressionAttributeValues` as follows: + + `{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }` + + You could then use these values in an expression, such as this: + + `ProductStatus IN (:avail, :back, :disc)` + + For more information on expression attribute values, see [Condition + Expressions](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html) + in the *Amazon DynamoDB Developer Guide*. + """ + return_values_on_condition_check_failure: str | None = ... + """ + An optional parameter that returns the item attributes for a `PutItem` + operation that failed a condition check. + + There is no additional cost associated with requesting a return value + aside from the small network and processing overhead of receiving a + larger response. No read capacity units are consumed. + """ + +@dataclass(kw_only=True) +class PutItemOutput(_SerdeShape): + """Represents the output of a `PutItem` operation.""" + + attributes: dict[str, AttributeValue] | None = ... + """ + The attribute values as they appeared before the `PutItem` operation, + but only if `ReturnValues` is specified as `ALL_OLD` in the request. + Each element consists of an attribute name and an attribute value. + """ + consumed_capacity: ConsumedCapacity | None = ... + """ + The capacity units consumed by the `PutItem` operation. The data + returned includes the total provisioned throughput consumed, along with + statistics for the table and any indexes involved in the operation. + `ConsumedCapacity` is only returned if the `ReturnConsumedCapacity` + parameter was specified. For more information, see [Capacity unity + consumption for write + operations](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/read-write-operations.html#write-operation-consumption) + in the *Amazon DynamoDB Developer Guide*. + + If the table has vector indexes, the response includes a `VectorIndexes` + field with `VectorWriteRequestBytes` consumed for each affected vector + index. + """ + item_collection_metrics: ItemCollectionMetrics | None = ... + """ + Information about item collections, if any, that were affected by the + `PutItem` operation. `ItemCollectionMetrics` is only returned if the + `ReturnItemCollectionMetrics` parameter was specified. If the table does + not have any local secondary indexes, this information is not returned + in the response. + + Each `ItemCollectionMetrics` element consists of: + + - `ItemCollectionKey` - The partition key value of the item collection. + This is the same as the partition key value of the item itself. + + - `SizeEstimateRangeGB` - An estimate of item collection size, in + gigabytes. This value is a two-element array containing a lower bound + and an upper bound for the estimate. The estimate includes the size of + all the items in the table, plus the size of all attributes projected + into all of the local secondary indexes on that table. Use this + estimate to measure whether a local secondary index is approaching its + size limit. + + The estimate is subject to change over time; therefore, do not rely on + the precision or accuracy of the estimate. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class PutRequest(_SerdeShape): + """Represents a request to perform a `PutItem` operation on an item.""" + + item: dict[str, AttributeValue] + """ + A map of attribute name to attribute values, representing the primary + key of an item to be processed by `PutItem`. All of the table's primary + key attributes must be specified, and their data types must match those + of the table's key schema. If any attributes are present in the item + that are part of an index key schema for the table, their types must + match the index key schema. + """ + +@dataclass(kw_only=True) +class PutResourcePolicyInput(_SerdeShape): + """Dataclass for PutResourcePolicyInput structure.""" + + resource_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the DynamoDB resource to which the + policy will be attached. The resources you can specify include tables + and streams. + + You can control index permissions using the base table's policy. To + specify the same permission level for your table and its indexes, you + can provide both the table and index Amazon Resource Name (ARN)s in the + `Resource` field of a given `Statement` in your policy document. + Alternatively, to specify different permissions for your table, indexes, + or both, you can define multiple `Statement` fields in your policy + document. + """ + policy: str | None = ... + """ + An Amazon Web Services resource-based policy document in JSON format. + + - The maximum size supported for a resource-based policy document is 20 + KB. DynamoDB counts whitespaces when calculating the size of a policy + against this limit. + + - Within a resource-based policy, if the action for a DynamoDB + service-linked role (SLR) to replicate data for a global table is + denied, adding or deleting a replica will fail with an error. + + For a full list of all considerations that apply while attaching a + resource-based policy, see [Resource-based policy + considerations](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/rbac-considerations.html). + """ + expected_revision_id: str | None = ... + """ + A string value that you can use to conditionally update your policy. You + can provide the revision ID of your existing policy to make mutating + requests against that policy. + + Note: + When you provide an expected revision ID, if the revision ID of the + existing policy on the resource doesn't match or if there's no policy + attached to the resource, your request will be rejected with a + `PolicyNotFoundException`. + + To conditionally attach a policy when no policy exists for the resource, + specify `NO_POLICY` for the revision ID. + """ + confirm_remove_self_resource_access: bool = ... + """ + Set this parameter to `true` to confirm that you want to remove your + permissions to change the policy of this resource in the future. + """ + +@dataclass(kw_only=True) +class PutResourcePolicyOutput(_SerdeShape): + """Dataclass for PutResourcePolicyOutput structure.""" + + revision_id: str | None = ... + """ + A unique string that represents the revision ID of the policy. If + you're comparing revision IDs, make sure to always use string + comparison logic. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class QueryInput(_SerdeShape): + """Represents the input of a `Query` operation.""" + + table_name: str | None = ... + """ + The name of the table containing the requested items. You can also + provide the Amazon Resource Name (ARN) of the table in this parameter. + """ + index_name: str | None = ... + """ + The name of an index to query. This index can be any local secondary + index or global secondary index on the table. Note that if you use the + `IndexName` parameter, you must also provide `TableName.` + """ + select: str | None = ... + """ + The attributes to be returned in the result. You can retrieve all item + attributes, specific item attributes, the count of matching items, or in + the case of an index, some or all of the attributes projected into the + index. + + - `ALL_ATTRIBUTES` - Returns all of the item attributes from the + specified table or index. If you query a local secondary index, then + for each matching item in the index, DynamoDB fetches the entire item + from the parent table. If the index is configured to project all item + attributes, then all of the data can be obtained from the local + secondary index, and no fetching is required. + + - `ALL_PROJECTED_ATTRIBUTES` - Allowed only when querying an index. + Retrieves all attributes that have been projected into the index. If + the index is configured to project all attributes, this return value + is equivalent to specifying `ALL_ATTRIBUTES`. + + - `COUNT` - Returns the number of matching items, rather than the + matching items themselves. Note that this uses the same quantity of + read capacity units as getting the items, and is subject to the same + item size calculations. + + - `SPECIFIC_ATTRIBUTES` - Returns only the attributes listed in + `ProjectionExpression`. This return value is equivalent to specifying + `ProjectionExpression` without specifying any value for `Select`. + + If you query or scan a local secondary index and request only + attributes that are projected into that index, the operation will read + only the index and not the table. If any of the requested attributes + are not projected into the local secondary index, DynamoDB fetches + each of these attributes from the parent table. This extra fetching + incurs additional throughput cost and latency. + + If you query or scan a global secondary index, you can only request + attributes that are projected into the index. Global secondary index + queries cannot fetch attributes from the parent table. + + If neither `Select` nor `ProjectionExpression` are specified, DynamoDB + defaults to `ALL_ATTRIBUTES` when accessing a table, and + `ALL_PROJECTED_ATTRIBUTES` when accessing an index. You cannot use both + `Select` and `ProjectionExpression` together in a single request, unless + the value for `Select` is `SPECIFIC_ATTRIBUTES`. (This usage is + equivalent to specifying `ProjectionExpression` without any value for + `Select`.) + + Note: + If you use the `ProjectionExpression` parameter, then the value for + `Select` can only be `SPECIFIC_ATTRIBUTES`. Any other value for `Select` + will return an error. + """ + attributes_to_get: list[str] | None = ... + """ + This is a legacy parameter. Use `ProjectionExpression` instead. For more + information, see + [AttributesToGet](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.AttributesToGet.html) + in the *Amazon DynamoDB Developer Guide*. + """ + limit: int | None = ... + """ + The maximum number of items to evaluate (not necessarily the number of + matching items). If DynamoDB processes the number of items up to the + limit while processing the results, it stops the operation and returns + the matching values up to that point, and a key in `LastEvaluatedKey` to + apply in a subsequent operation, so that you can pick up where you left + off. Also, if the processed dataset size exceeds 1 MB before DynamoDB + reaches this limit, it stops the operation and returns the matching + values up to the limit, and a key in `LastEvaluatedKey` to apply in a + subsequent operation to continue the operation. For more information, + see [Query and + Scan](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html) + in the *Amazon DynamoDB Developer Guide*. + """ + consistent_read: bool | None = ... + """ + Determines the read consistency model: If set to `true`, then the + operation uses strongly consistent reads; otherwise, the operation uses + eventually consistent reads. + + Strongly consistent reads are not supported on global secondary indexes. + If you query a global secondary index with `ConsistentRead` set to + `true`, you will receive a `ValidationException`. + """ + key_conditions: dict[str, Condition] | None = ... + """ + This is a legacy parameter. Use `KeyConditionExpression` instead. For + more information, see + [KeyConditions](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.KeyConditions.html) + in the *Amazon DynamoDB Developer Guide*. + """ + query_filter: dict[str, Condition] | None = ... + """ + This is a legacy parameter. Use `FilterExpression` instead. For more + information, see + [QueryFilter](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.QueryFilter.html) + in the *Amazon DynamoDB Developer Guide*. + """ + conditional_operator: str | None = ... + """ + This is a legacy parameter. Use `FilterExpression` instead. For more + information, see + [ConditionalOperator](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.ConditionalOperator.html) + in the *Amazon DynamoDB Developer Guide*. + """ + scan_index_forward: bool | None = ... + """ + Specifies the order for index traversal: If `true` (default), the + traversal is performed in ascending order; if `false`, the traversal is + performed in descending order. + + Items with the same partition key value are stored in sorted order by + sort key. If the sort key data type is Number, the results are stored in + numeric order. For type String, the results are stored in order of UTF-8 + bytes. For type Binary, DynamoDB treats each byte of the binary data as + unsigned. + + If `ScanIndexForward` is `true`, DynamoDB returns the results in the + order in which they are stored (by sort key value). This is the default + behavior. If `ScanIndexForward` is `false`, DynamoDB reads the results + in reverse order by sort key value, and then returns the results to the + client. + """ + exclusive_start_key: dict[str, AttributeValue] | None = ... + """ + The primary key of the first item that this operation will evaluate. Use + the value that was returned for `LastEvaluatedKey` in the previous + operation. + + The data type for `ExclusiveStartKey` must be String, Number, or Binary. + No set data types are allowed. + """ + return_consumed_capacity: str | None = ... + """ + Determines the level of detail about either provisioned or on-demand + throughput consumption that is returned in the response: + + - `INDEXES` - The response includes the aggregate `ConsumedCapacity` for + the operation, together with `ConsumedCapacity` for each table and + secondary index that was accessed. + + Note that some operations, such as `GetItem` and `BatchGetItem`, do + not access any indexes at all. In these cases, specifying `INDEXES` + will only return `ConsumedCapacity` information for table(s). + + - `TOTAL` - The response includes only the aggregate `ConsumedCapacity` + for the operation. + + - `NONE` - No `ConsumedCapacity` details are included in the response. + """ + projection_expression: str | None = ... + """ + A string that identifies one or more attributes to retrieve from the + table. These attributes can include scalars, sets, or elements of a JSON + document. The attributes in the expression must be separated by commas. + + If no attribute names are specified, then all attributes will be + returned. If any of the requested attributes are not found, they will + not appear in the result. + + For more information, see [Accessing Item + Attributes](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) + in the *Amazon DynamoDB Developer Guide*. + """ + filter_expression: str | None = ... + """ + A string that contains conditions that DynamoDB applies after the + `Query` operation, but before the data is returned to you. Items that do + not satisfy the `FilterExpression` criteria are not returned. + + A `FilterExpression` does not allow key attributes. You cannot define a + filter expression based on a partition key or a sort key. + + Note: + A `FilterExpression` is applied after the items have already been read; + the process of filtering does not consume any additional read capacity + units. + + For more information, see [Filter + Expressions](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Query.FilterExpression.html) + in the *Amazon DynamoDB Developer Guide*. + """ + key_condition_expression: str | None = ... + """ + The condition that specifies the key values for items to be retrieved by + the `Query` action. + + The condition must perform an equality test on a single partition key + value. + + The condition can optionally perform one of several comparison tests on + a single sort key value. This allows `Query` to retrieve one item with a + given partition key value and sort key value, or several items that have + the same partition key value but different sort key values. + + The partition key equality test is required, and must be specified in + the following format: + + `partitionKeyName` *=* `:partitionkeyval` + + If you also want to provide a condition for the sort key, it must be + combined using `AND` with the condition for the sort key. Following is + an example, using the **=** comparison operator for the sort key: + + `partitionKeyName` `=` `:partitionkeyval` `AND` `sortKeyName` `=` + `:sortkeyval` + + Valid comparisons for the sort key condition are as follows: + + - `sortKeyName` `=` `:sortkeyval` - true if the sort key value is equal + to `:sortkeyval`. + + - `sortKeyName` `<` `:sortkeyval` - true if the sort key value is less + than `:sortkeyval`. + + - `sortKeyName` `<=` `:sortkeyval` - true if the sort key value is less + than or equal to `:sortkeyval`. + + - `sortKeyName` `>` `:sortkeyval` - true if the sort key value is + greater than `:sortkeyval`. + + - `sortKeyName` `>= ` `:sortkeyval` - true if the sort key value is + greater than or equal to `:sortkeyval`. + + - `sortKeyName` `BETWEEN` `:sortkeyval1` `AND` `:sortkeyval2` - true if + the sort key value is greater than or equal to `:sortkeyval1`, and + less than or equal to `:sortkeyval2`. + + - `begins_with (` `sortKeyName`, `:sortkeyval` `)` - true if the sort + key value begins with a particular operand. (You cannot use this + function with a sort key that is of type Number.) Note that the + function name `begins_with` is case-sensitive. + + Use the `ExpressionAttributeValues` parameter to replace tokens such as + `:partitionval` and `:sortval` with actual values at runtime. + + You can optionally use the `ExpressionAttributeNames` parameter to + replace the names of the partition key and sort key with placeholder + tokens. This option might be necessary if an attribute name conflicts + with a DynamoDB reserved word. For example, the following + `KeyConditionExpression` parameter causes an error because *Size* is a + reserved word: + + - `Size = :myval` + + To work around this, define a placeholder (such a `#S`) to represent the + attribute name *Size*. `KeyConditionExpression` then is as follows: + + - `#S = :myval` + + For a list of reserved words, see [Reserved + Words](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html) + in the *Amazon DynamoDB Developer Guide*. + + For more information on `ExpressionAttributeNames` and + `ExpressionAttributeValues`, see [Using Placeholders for Attribute Names + and + Values](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ExpressionPlaceholders.html) + in the *Amazon DynamoDB Developer Guide*. + """ + expression_attribute_names: dict[str, str] | None = ... + """ + One or more substitution tokens for attribute names in an expression. + The following are some use cases for using `ExpressionAttributeNames`: + + - To access an attribute whose name conflicts with a DynamoDB reserved + word. + + - To create a placeholder for repeating occurrences of an attribute name + in an expression. + + - To prevent special characters in an attribute name from being + misinterpreted in an expression. + + Use the **#** character in an expression to dereference an attribute + name. For example, consider the following attribute name: + + - `Percentile` + + The name of this attribute conflicts with a reserved word, so it cannot + be used directly in an expression. (For the complete list of reserved + words, see [Reserved + Words](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html) + in the *Amazon DynamoDB Developer Guide*). To work around this, you + could specify the following for `ExpressionAttributeNames`: + + - `{"#P":"Percentile"}` + + You could then use this substitution in an expression, as in this + example: + + - `#P = :val` + + Note: + Tokens that begin with the **:** character are *expression attribute + values*, which are placeholders for the actual value at runtime. + + For more information on expression attribute names, see [Specifying Item + Attributes](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) + in the *Amazon DynamoDB Developer Guide*. + """ + expression_attribute_values: dict[str, AttributeValue] | None = ... + """ + One or more values that can be substituted in an expression. + + Use the **:** (colon) character in an expression to dereference an + attribute value. For example, suppose that you wanted to check whether + the value of the *ProductStatus* attribute was one of the following: + + `Available | Backordered | Discontinued` + + You would first need to specify `ExpressionAttributeValues` as follows: + + `{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }` + + You could then use these values in an expression, such as this: + + `ProductStatus IN (:avail, :back, :disc)` + + For more information on expression attribute values, see [Specifying + Conditions](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html) + in the *Amazon DynamoDB Developer Guide*. + """ + +@dataclass(kw_only=True) +class QueryOutput(_SerdeShape): + """Represents the output of a `Query` operation.""" + + items: list[dict[str, AttributeValue]] | None = ... + """ + An array of item attributes that match the query criteria. Each element + in this array consists of an attribute name and the value for that + attribute. + """ + count: int = ... + """ + The number of items in the response. + + If you used a `QueryFilter` in the request, then `Count` is the number + of items returned after the filter was applied, and `ScannedCount` is + the number of matching items before the filter was applied. + + If you did not use a filter in the request, then `Count` and + `ScannedCount` are the same. + """ + scanned_count: int = ... + """ + The number of items evaluated, before any `QueryFilter` is applied. A + high `ScannedCount` value with few, or no, `Count` results indicates an + inefficient `Query` operation. For more information, see [Count and + ScannedCount](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Scan.html#Scan.Count) + in the *Amazon DynamoDB Developer Guide*. + + If you did not use a filter in the request, then `ScannedCount` is the + same as `Count`. + """ + last_evaluated_key: dict[str, AttributeValue] | None = ... + """ + The primary key of the item where the operation stopped, inclusive of + the previous result set. Use this value to start a new operation, + excluding this value in the new request. + + If `LastEvaluatedKey` is empty, then the \"last page\" of results has + been processed and there is no more data to be retrieved. + + If `LastEvaluatedKey` is not empty, it does not necessarily mean that + there is more data in the result set. The only way to know when you have + reached the end of the result set is when `LastEvaluatedKey` is empty. + """ + consumed_capacity: ConsumedCapacity | None = ... + """ + The capacity units consumed by the `Query` operation. The data returned + includes the total provisioned throughput consumed, along with + statistics for the table and any indexes involved in the operation. + `ConsumedCapacity` is only returned if the `ReturnConsumedCapacity` + parameter was specified. For more information, see [Capacity unit + consumption for read + operations](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/read-write-operations.html#read-operation-consumption) + in the *Amazon DynamoDB Developer Guide*. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class Replica(_SerdeShape): + """Represents the properties of a replica.""" + + region_name: str | None = ... + """The Region where the replica needs to be created.""" + +@dataclass(kw_only=True) +class ReplicaAlreadyExistsException(ServiceError, _SerdeShape): + """The specified replica is already part of the global table.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ReplicaAutoScalingDescription(_SerdeShape): + """Represents the auto scaling settings of the replica.""" + + region_name: str | None = ... + """The Region where the replica exists.""" + global_secondary_indexes: ( + list[ReplicaGlobalSecondaryIndexAutoScalingDescription] | None + ) = ... + """Replica-specific global secondary index auto scaling settings.""" + replica_provisioned_read_capacity_auto_scaling_settings: ( + AutoScalingSettingsDescription | None + ) = ... + """ + Represents the auto scaling settings for a global table or global + secondary index. + """ + replica_provisioned_write_capacity_auto_scaling_settings: ( + AutoScalingSettingsDescription | None + ) = ... + """ + Represents the auto scaling settings for a global table or global + secondary index. + """ + replica_status: str | None = ... + """ + The current state of the replica: + + - `CREATING` - The replica is being created. + + - `UPDATING` - The replica is being updated. + + - `DELETING` - The replica is being deleted. + + - `ACTIVE` - The replica is ready for use. + """ + +@dataclass(kw_only=True) +class ReplicaAutoScalingUpdate(_SerdeShape): + """Represents the auto scaling settings of a replica that will be modified.""" + + region_name: str + """The Region where the replica exists.""" + replica_global_secondary_index_updates: ( + list[ReplicaGlobalSecondaryIndexAutoScalingUpdate] | None + ) = ... + """ + Represents the auto scaling settings of global secondary indexes that + will be modified. + """ + replica_provisioned_read_capacity_auto_scaling_update: ( + AutoScalingSettingsUpdate | None + ) = ... + """ + Represents the auto scaling settings to be modified for a global table + or global secondary index. + """ + +@dataclass(kw_only=True) +class ReplicaDescription(_SerdeShape): + """Contains the details of the replica.""" + + region_name: str | None = ... + """The name of the Region.""" + replica_status: str | None = ... + """ + The current state of the replica: + + - `CREATING` - The replica is being created. + + - `UPDATING` - The replica is being updated. + + - `DELETING` - The replica is being deleted. + + - `ACTIVE` - The replica is ready for use. + + - `REGION_DISABLED` - The replica is inaccessible because the Amazon Web + Services Region has been disabled. + + Note: + If the Amazon Web Services Region remains inaccessible for more than + 20 hours, DynamoDB will remove this replica from the replication + group. The replica will not be deleted and replication will stop from + and to this region. + + - `INACCESSIBLE_ENCRYPTION_CREDENTIALS ` - The KMS key used to encrypt + the table is inaccessible. + + Note: + If the KMS key remains inaccessible for more than 20 hours, DynamoDB + will remove this replica from the replication group. The replica will + not be deleted and replication will stop from and to this region. + """ + replica_arn: str | None = ... + """The Amazon Resource Name (ARN) of the global table replica.""" + replica_status_description: str | None = ... + """Detailed information about the replica status.""" + replica_status_percent_progress: str | None = ... + """ + Specifies the progress of a Create, Update, or Delete action on the + replica as a percentage. + """ + kms_master_key_id: str | None = ... + """The KMS key of the replica that will be used for KMS encryption.""" + provisioned_throughput_override: ProvisionedThroughputOverride | None = ... + """ + Replica-specific provisioned throughput. If not described, uses the + source table's provisioned throughput settings. + """ + on_demand_throughput_override: OnDemandThroughputOverride | None = ... + """ + Overrides the maximum on-demand throughput settings for the specified + replica table. + """ + warm_throughput: TableWarmThroughputDescription | None = ... + """Represents the warm throughput value for this replica.""" + global_secondary_indexes: list[ReplicaGlobalSecondaryIndexDescription] | None = ... + """Replica-specific global secondary index settings.""" + replica_inaccessible_date_time: datetime | None = ... + """ + The time at which the replica was first detected as inaccessible. To + determine cause of inaccessibility check the `ReplicaStatus` property. + """ + replica_table_class_summary: TableClassSummary | None = ... + """Contains details of the table class.""" + global_table_settings_replication_mode: str | None = ... + """ + Indicates one of the settings synchronization modes for the global table + replica: + + - `ENABLED`: Indicates that the settings synchronization mode for the + global table replica is enabled. + + - `DISABLED`: Indicates that the settings synchronization mode for the + global table replica is disabled. + + - `ENABLED_WITH_OVERRIDES`: This mode is set by default for a same + account global table. Indicates that certain global table settings can + be overridden. + """ + +@dataclass(kw_only=True) +class ReplicaGlobalSecondaryIndex(_SerdeShape): + """Represents the properties of a replica global secondary index.""" + + index_name: str + """The name of the global secondary index.""" + provisioned_throughput_override: ProvisionedThroughputOverride | None = ... + """ + Replica table GSI-specific provisioned throughput. If not specified, + uses the source table GSI's read capacity settings. + """ + on_demand_throughput_override: OnDemandThroughputOverride | None = ... + """ + Overrides the maximum on-demand throughput settings for the specified + global secondary index in the specified replica table. + """ + +@dataclass(kw_only=True) +class ReplicaGlobalSecondaryIndexAutoScalingDescription(_SerdeShape): + """ + Represents the auto scaling configuration for a replica global secondary + index. + """ + + index_name: str | None = ... + """The name of the global secondary index.""" + index_status: str | None = ... + """ + The current state of the replica global secondary index: + + - `CREATING` - The index is being created. + + - `UPDATING` - The table/index configuration is being updated. The + table/index remains available for data operations when `UPDATING` + + - `DELETING` - The index is being deleted. + + - `ACTIVE` - The index is ready for use. + """ + provisioned_read_capacity_auto_scaling_settings: ( + AutoScalingSettingsDescription | None + ) = ... + """ + Represents the auto scaling settings for a global table or global + secondary index. + """ + provisioned_write_capacity_auto_scaling_settings: ( + AutoScalingSettingsDescription | None + ) = ... + """ + Represents the auto scaling settings for a global table or global + secondary index. + """ + +@dataclass(kw_only=True) +class ReplicaGlobalSecondaryIndexAutoScalingUpdate(_SerdeShape): + """ + Represents the auto scaling settings of a global secondary index for a + replica that will be modified. + """ + + index_name: str | None = ... + """The name of the global secondary index.""" + provisioned_read_capacity_auto_scaling_update: ( + AutoScalingSettingsUpdate | None + ) = ... + """ + Represents the auto scaling settings to be modified for a global table + or global secondary index. + """ + +@dataclass(kw_only=True) +class ReplicaGlobalSecondaryIndexDescription(_SerdeShape): + """Represents the properties of a replica global secondary index.""" + + index_name: str | None = ... + """The name of the global secondary index.""" + provisioned_throughput_override: ProvisionedThroughputOverride | None = ... + """If not described, uses the source table GSI's read capacity settings.""" + on_demand_throughput_override: OnDemandThroughputOverride | None = ... + """ + Overrides the maximum on-demand throughput for the specified global + secondary index in the specified replica table. + """ + warm_throughput: GlobalSecondaryIndexWarmThroughputDescription | None = ... + """ + Represents the warm throughput of the global secondary index for this + replica. + """ + +@dataclass(kw_only=True) +class ReplicaGlobalSecondaryIndexSettingsDescription(_SerdeShape): + """Represents the properties of a global secondary index.""" + + index_name: str + """ + The name of the global secondary index. The name must be unique among + all other indexes on this table. + """ + index_status: str | None = ... + """ + The current status of the global secondary index: + + - `CREATING` - The global secondary index is being created. + + - `UPDATING` - The global secondary index is being updated. + + - `DELETING` - The global secondary index is being deleted. + + - `ACTIVE` - The global secondary index is ready for use. + """ + provisioned_read_capacity_units: int | None = ... + """ + The maximum number of strongly consistent reads consumed per second + before DynamoDB returns a `ThrottlingException`. + """ + provisioned_read_capacity_auto_scaling_settings: ( + AutoScalingSettingsDescription | None + ) = ... + """ + Auto scaling settings for a global secondary index replica's read + capacity units. + """ + provisioned_write_capacity_units: int | None = ... + """ + The maximum number of writes consumed per second before DynamoDB returns + a `ThrottlingException`. + """ + provisioned_write_capacity_auto_scaling_settings: ( + AutoScalingSettingsDescription | None + ) = ... + """ + Auto scaling settings for a global secondary index replica's write + capacity units. + """ + +@dataclass(kw_only=True) +class ReplicaGlobalSecondaryIndexSettingsUpdate(_SerdeShape): + """ + Represents the settings of a global secondary index for a global table + that will be modified. + """ + + index_name: str + """ + The name of the global secondary index. The name must be unique among + all other indexes on this table. + """ + provisioned_read_capacity_units: int | None = ... + """ + The maximum number of strongly consistent reads consumed per second + before DynamoDB returns a `ThrottlingException`. + """ + provisioned_read_capacity_auto_scaling_settings_update: ( + AutoScalingSettingsUpdate | None + ) = ... + """ + Auto scaling settings for managing a global secondary index replica's + read capacity units. + """ + +@dataclass(kw_only=True) +class ReplicaNotFoundException(ServiceError, _SerdeShape): + """The specified replica is no longer part of the global table.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ReplicaSettingsDescription(_SerdeShape): + """Represents the properties of a replica.""" + + region_name: str + """The Region name of the replica.""" + replica_status: str | None = ... + """ + The current state of the Region: + + - `CREATING` - The Region is being created. + + - `UPDATING` - The Region is being updated. + + - `DELETING` - The Region is being deleted. + + - `ACTIVE` - The Region is ready for use. + """ + replica_billing_mode_summary: BillingModeSummary | None = ... + """The read/write capacity mode of the replica.""" + replica_provisioned_read_capacity_units: int | None = ... + """ + The maximum number of strongly consistent reads consumed per second + before DynamoDB returns a `ThrottlingException`. For more information, + see [Specifying Read and Write + Requirements](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#ProvisionedThroughput) + in the *Amazon DynamoDB Developer Guide*. + """ + replica_provisioned_read_capacity_auto_scaling_settings: ( + AutoScalingSettingsDescription | None + ) = ... + """Auto scaling settings for a global table replica's read capacity units.""" + replica_provisioned_write_capacity_units: int | None = ... + """ + The maximum number of writes consumed per second before DynamoDB returns + a `ThrottlingException`. For more information, see [Specifying Read and + Write + Requirements](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#ProvisionedThroughput) + in the *Amazon DynamoDB Developer Guide*. + """ + replica_provisioned_write_capacity_auto_scaling_settings: ( + AutoScalingSettingsDescription | None + ) = ... + """ + Auto scaling settings for a global table replica's write capacity + units. + """ + replica_global_secondary_index_settings: ( + list[ReplicaGlobalSecondaryIndexSettingsDescription] | None + ) = ... + """Replica global secondary index settings for the global table.""" + replica_table_class_summary: TableClassSummary | None = ... + """Contains details of the table class.""" + +@dataclass(kw_only=True) +class ReplicaSettingsUpdate(_SerdeShape): + """ + Represents the settings for a global table in a Region that will be + modified. + """ + + region_name: str + """The Region of the replica to be added.""" + replica_provisioned_read_capacity_units: int | None = ... + """ + The maximum number of strongly consistent reads consumed per second + before DynamoDB returns a `ThrottlingException`. For more information, + see [Specifying Read and Write + Requirements](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#ProvisionedThroughput) + in the *Amazon DynamoDB Developer Guide*. + """ + replica_provisioned_read_capacity_auto_scaling_settings_update: ( + AutoScalingSettingsUpdate | None + ) = ... + """ + Auto scaling settings for managing a global table replica's read + capacity units. + """ + replica_global_secondary_index_settings_update: ( + list[ReplicaGlobalSecondaryIndexSettingsUpdate] | None + ) = ... + """ + Represents the settings of a global secondary index for a global table + that will be modified. + """ + replica_table_class: str | None = ... + """ + Replica-specific table class. If not specified, uses the source table's + table class. + """ + +class ReplicaStatus(UnknownEnumMixin, StrEnum): + CREATING = "CREATING" + CREATION_FAILED = "CREATION_FAILED" + UPDATING = "UPDATING" + DELETING = "DELETING" + ACTIVE = "ACTIVE" + REGION_DISABLED = "REGION_DISABLED" + INACCESSIBLE_ENCRYPTION_CREDENTIALS = "INACCESSIBLE_ENCRYPTION_CREDENTIALS" + ARCHIVING = "ARCHIVING" + ARCHIVED = "ARCHIVED" + REPLICATION_NOT_AUTHORIZED = "REPLICATION_NOT_AUTHORIZED" + +@dataclass(kw_only=True) +class ReplicatedWriteConflictException(ServiceError, _SerdeShape): + """ + The request was rejected because one or more items in the request are + being modified by a request in another Region. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ReplicationGroupUpdate(_SerdeShape): + """ + Represents one of the following: + + - A new replica to be added to an existing regional table or global + table. This request invokes the `CreateTableReplica` action in the + destination Region. + + - New parameters for an existing replica. This request invokes the + `UpdateTable` action in the destination Region. + + - An existing replica to be deleted. The request invokes the + `DeleteTableReplica` action in the destination Region, deleting the + replica and all if its items in the destination Region. + + Note: + When you manually remove a table or global table replica, you do not + automatically remove any associated scalable targets, scaling policies, + or CloudWatch alarms. + """ + + create: CreateReplicationGroupMemberAction | None = ... + """The parameters required for creating a replica for the table.""" + update: UpdateReplicationGroupMemberAction | None = ... + """The parameters required for updating a replica for the table.""" + delete: DeleteReplicationGroupMemberAction | None = ... + """The parameters required for deleting a replica for the table.""" + +@dataclass(kw_only=True) +class ReplicaUpdate(_SerdeShape): + """ + Represents one of the following: + + - A new replica to be added to an existing global table. + + - New parameters for an existing replica. + + - An existing replica to be removed from an existing global table. + """ + + create: CreateReplicaAction | None = ... + """ + The parameters required for creating a replica on an existing global + table. + """ + delete: DeleteReplicaAction | None = ... + """The name of the existing replica to be removed.""" + +@dataclass(kw_only=True) +class RequestLimitExceeded(ServiceError, _SerdeShape): + """ + Throughput exceeds the current throughput quota for your account. For + detailed information about why the request was throttled and the ARN of + the impacted resource, find the + [ThrottlingReason](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ThrottlingReason.html) + field in the returned exception. Contact [Amazon Web Services + Support](https://aws.amazon.com/support) to request a quota increase. + """ + + throttling_reasons: list[ThrottlingReason] | None = ... + """ + A list of + [ThrottlingReason](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ThrottlingReason.html) + that provide detailed diagnostic information about why the request was + throttled. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ResourceInUseException(ServiceError, _SerdeShape): + """ + The operation conflicts with the resource's availability. For example: + + - You attempted to recreate an existing table. + + - You tried to delete a table currently in the `CREATING` state. + + - You tried to update a resource that was already being updated. + + When appropriate, wait for the ongoing update to complete and attempt + the request again. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ResourceNotFoundException(ServiceError, _SerdeShape): + """ + The operation tried to access a nonexistent table or index. The resource + might not be specified correctly, or its status might not be `ACTIVE`. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class RestoreSummary(_SerdeShape): + """Contains details for the restore.""" + + source_backup_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the backup from which the table was + restored. + """ + source_table_arn: str | None = ... + """The ARN of the source table of the backup that is being restored.""" + restore_date_time: datetime + """Point in time or source backup time.""" + restore_in_progress: bool + """Indicates if a restore is in progress or not.""" + +@dataclass(kw_only=True) +class RestoreTableFromBackupInput(_SerdeShape): + """Dataclass for RestoreTableFromBackupInput structure.""" + + target_table_name: str | None = ... + """The name of the new table to which the backup must be restored.""" + backup_arn: str | None = ... + """The Amazon Resource Name (ARN) associated with the backup.""" + billing_mode_override: str | None = ... + """The billing mode of the restored table.""" + global_secondary_index_override: list[GlobalSecondaryIndex] | None = ... + """ + List of global secondary indexes for the restored table. The indexes + provided should match existing secondary indexes. You can choose to + exclude some or all of the indexes at the time of restore. + """ + local_secondary_index_override: list[LocalSecondaryIndex] | None = ... + """ + List of local secondary indexes for the restored table. The indexes + provided should match existing secondary indexes. You can choose to + exclude some or all of the indexes at the time of restore. + """ + provisioned_throughput_override: ProvisionedThroughput | None = ... + """Provisioned throughput settings for the restored table.""" + on_demand_throughput_override: OnDemandThroughput | None = ... + """ + Sets the maximum number of read and write units for the specified + on-demand table. If you use this parameter, you must specify + `MaxReadRequestUnits`, `MaxWriteRequestUnits`, or both. + """ + sse_specification_override: SSESpecification | None = ... + """The new server-side encryption settings for the restored table.""" + vector_index_override: list[VectorIndex] | None = ... + """ + The vector indexes for the restored table. If not specified, all vector + indexes from the backup are restored. The indexes provided must match + existing vector indexes from the backup. You can choose to exclude some + or all of the vector indexes at the time of restore. + """ + +@dataclass(kw_only=True) +class RestoreTableFromBackupOutput(_SerdeShape): + """Dataclass for RestoreTableFromBackupOutput structure.""" + + table_description: TableDescription | None = ... + """The description of the table created from an existing backup.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class RestoreTableToPointInTimeInput(_SerdeShape): + """Dataclass for RestoreTableToPointInTimeInput structure.""" + + source_table_arn: str | None = ... + """ + The DynamoDB table that will be restored. This value is an Amazon + Resource Name (ARN). + """ + source_table_name: str | None = ... + """Name of the source table that is being restored.""" + target_table_name: str | None = ... + """The name of the new table to which it must be restored to.""" + use_latest_restorable_time: bool | None = ... + """ + Restore the table to the latest possible time. + `LatestRestorableDateTime` is typically 5 minutes before the current + time. + """ + restore_date_time: datetime | None = ... + """Time in the past to restore the table to.""" + billing_mode_override: str | None = ... + """The billing mode of the restored table.""" + global_secondary_index_override: list[GlobalSecondaryIndex] | None = ... + """ + List of global secondary indexes for the restored table. The indexes + provided should match existing secondary indexes. You can choose to + exclude some or all of the indexes at the time of restore. + + The `WarmThroughput` setting is not supported on global secondary + indexes when you use `RestoreTableToPointInTime`. Although + `WarmThroughput` appears in the shared index definition, including it in + a `GlobalSecondaryIndexOverride` entry causes the request to fail with a + validation error. + """ + local_secondary_index_override: list[LocalSecondaryIndex] | None = ... + """ + List of local secondary indexes for the restored table. The indexes + provided should match existing secondary indexes. You can choose to + exclude some or all of the indexes at the time of restore. + """ + provisioned_throughput_override: ProvisionedThroughput | None = ... + """Provisioned throughput settings for the restored table.""" + on_demand_throughput_override: OnDemandThroughput | None = ... + """ + Sets the maximum number of read and write units for the specified + on-demand table. If you use this parameter, you must specify + `MaxReadRequestUnits`, `MaxWriteRequestUnits`, or both. + """ + sse_specification_override: SSESpecification | None = ... + """The new server-side encryption settings for the restored table.""" + vector_index_override: list[VectorIndex] | None = ... + """ + The vector indexes for the restored table. If not specified, all vector + indexes from the source table are restored. The indexes provided must + match existing vector indexes from the source table. You can choose to + exclude some or all of the vector indexes at the time of restore. + """ + +@dataclass(kw_only=True) +class RestoreTableToPointInTimeOutput(_SerdeShape): + """Dataclass for RestoreTableToPointInTimeOutput structure.""" + + table_description: TableDescription | None = ... + """Represents the properties of a table.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class ReturnConsumedCapacity(UnknownEnumMixin, StrEnum): + """ + Determines the level of detail about either provisioned or on-demand + throughput consumption that is returned in the response: + + - `INDEXES` - The response includes the aggregate `ConsumedCapacity` for + the operation, together with `ConsumedCapacity` for each table and + secondary index that was accessed. + + Note that some operations, such as `GetItem` and `BatchGetItem`, do + not access any indexes at all. In these cases, specifying `INDEXES` + will only return `ConsumedCapacity` information for table(s). + + - `TOTAL` - The response includes only the aggregate `ConsumedCapacity` + for the operation. + + - `NONE` - No `ConsumedCapacity` details are included in the response. + """ + + INDEXES = "INDEXES" + TOTAL = "TOTAL" + NONE = "NONE" + +class ReturnItemCollectionMetrics(UnknownEnumMixin, StrEnum): + SIZE = "SIZE" + NONE = "NONE" + +class ReturnValue(UnknownEnumMixin, StrEnum): + NONE = "NONE" + ALL_OLD = "ALL_OLD" + UPDATED_OLD = "UPDATED_OLD" + ALL_NEW = "ALL_NEW" + UPDATED_NEW = "UPDATED_NEW" + +class ReturnValuesOnConditionCheckFailure(UnknownEnumMixin, StrEnum): + ALL_OLD = "ALL_OLD" + NONE = "NONE" + +@dataclass(kw_only=True) +class S3BucketSource(_SerdeShape): + """The S3 bucket that is being imported from.""" + + s3_bucket_owner: str | None = ... + """ + The account number of the S3 bucket that is being imported from. If the + bucket is owned by the requester this is optional. + """ + s3_bucket: str + """The S3 bucket that is being imported from.""" + s3_key_prefix: str | None = ... + """The key prefix shared by all S3 Objects that are being imported.""" + +class S3SseAlgorithm(UnknownEnumMixin, StrEnum): + AES256 = "AES256" + KMS = "KMS" + +class ScalarAttributeType(UnknownEnumMixin, StrEnum): + S = "S" + N = "N" + B = "B" + +@dataclass(kw_only=True) +class ScanInput(_SerdeShape): + """Represents the input of a `Scan` operation.""" + + table_name: str | None = ... + """ + The name of the table containing the requested items or if you provide + `IndexName`, the name of the table to which that index belongs. + + You can also provide the Amazon Resource Name (ARN) of the table in this + parameter. + """ + index_name: str | None = ... + """ + The name of a secondary index to scan. This index can be any local + secondary index or global secondary index. Note that if you use the + `IndexName` parameter, you must also provide `TableName`. + """ + attributes_to_get: list[str] | None = ... + """ + This is a legacy parameter. Use `ProjectionExpression` instead. For more + information, see + [AttributesToGet](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.AttributesToGet.html) + in the *Amazon DynamoDB Developer Guide*. + """ + limit: int | None = ... + """ + The maximum number of items to evaluate (not necessarily the number of + matching items). If DynamoDB processes the number of items up to the + limit while processing the results, it stops the operation and returns + the matching values up to that point, and a key in `LastEvaluatedKey` to + apply in a subsequent operation, so that you can pick up where you left + off. Also, if the processed dataset size exceeds 1 MB before DynamoDB + reaches this limit, it stops the operation and returns the matching + values up to the limit, and a key in `LastEvaluatedKey` to apply in a + subsequent operation to continue the operation. For more information, + see [Working with + Queries](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html) + in the *Amazon DynamoDB Developer Guide*. + """ + select: str | None = ... + """ + The attributes to be returned in the result. You can retrieve all item + attributes, specific item attributes, the count of matching items, or in + the case of an index, some or all of the attributes projected into the + index. + + - `ALL_ATTRIBUTES` - Returns all of the item attributes from the + specified table or index. If you query a local secondary index, then + for each matching item in the index, DynamoDB fetches the entire item + from the parent table. If the index is configured to project all item + attributes, then all of the data can be obtained from the local + secondary index, and no fetching is required. + + - `ALL_PROJECTED_ATTRIBUTES` - Allowed only when querying an index. + Retrieves all attributes that have been projected into the index. If + the index is configured to project all attributes, this return value + is equivalent to specifying `ALL_ATTRIBUTES`. + + - `COUNT` - Returns the number of matching items, rather than the + matching items themselves. Note that this uses the same quantity of + read capacity units as getting the items, and is subject to the same + item size calculations. + + - `SPECIFIC_ATTRIBUTES` - Returns only the attributes listed in + `ProjectionExpression`. This return value is equivalent to specifying + `ProjectionExpression` without specifying any value for `Select`. + + If you query or scan a local secondary index and request only + attributes that are projected into that index, the operation reads + only the index and not the table. If any of the requested attributes + are not projected into the local secondary index, DynamoDB fetches + each of these attributes from the parent table. This extra fetching + incurs additional throughput cost and latency. + + If you query or scan a global secondary index, you can only request + attributes that are projected into the index. Global secondary index + queries cannot fetch attributes from the parent table. + + If neither `Select` nor `ProjectionExpression` are specified, DynamoDB + defaults to `ALL_ATTRIBUTES` when accessing a table, and + `ALL_PROJECTED_ATTRIBUTES` when accessing an index. You cannot use both + `Select` and `ProjectionExpression` together in a single request, unless + the value for `Select` is `SPECIFIC_ATTRIBUTES`. (This usage is + equivalent to specifying `ProjectionExpression` without any value for + `Select`.) + + Note: + If you use the `ProjectionExpression` parameter, then the value for + `Select` can only be `SPECIFIC_ATTRIBUTES`. Any other value for `Select` + will return an error. + """ + scan_filter: dict[str, Condition] | None = ... + """ + This is a legacy parameter. Use `FilterExpression` instead. For more + information, see + [ScanFilter](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.ScanFilter.html) + in the *Amazon DynamoDB Developer Guide*. + """ + conditional_operator: str | None = ... + """ + This is a legacy parameter. Use `FilterExpression` instead. For more + information, see + [ConditionalOperator](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.ConditionalOperator.html) + in the *Amazon DynamoDB Developer Guide*. + """ + exclusive_start_key: dict[str, AttributeValue] | None = ... + """ + The primary key of the first item that this operation will evaluate. Use + the value that was returned for `LastEvaluatedKey` in the previous + operation. + + The data type for `ExclusiveStartKey` must be String, Number or Binary. + No set data types are allowed. + + In a parallel scan, a `Scan` request that includes `ExclusiveStartKey` + must specify the same segment whose previous `Scan` returned the + corresponding value of `LastEvaluatedKey`. + """ + return_consumed_capacity: str | None = ... + """ + Determines the level of detail about either provisioned or on-demand + throughput consumption that is returned in the response: + + - `INDEXES` - The response includes the aggregate `ConsumedCapacity` for + the operation, together with `ConsumedCapacity` for each table and + secondary index that was accessed. + + Note that some operations, such as `GetItem` and `BatchGetItem`, do + not access any indexes at all. In these cases, specifying `INDEXES` + will only return `ConsumedCapacity` information for table(s). + + - `TOTAL` - The response includes only the aggregate `ConsumedCapacity` + for the operation. + + - `NONE` - No `ConsumedCapacity` details are included in the response. + """ + total_segments: int | None = ... + """ + For a parallel `Scan` request, `TotalSegments` represents the total + number of segments into which the `Scan` operation will be divided. The + value of `TotalSegments` corresponds to the number of application + workers that will perform the parallel scan. For example, if you want to + use four application threads to scan a table or an index, specify a + `TotalSegments` value of 4. + + The value for `TotalSegments` must be greater than or equal to 1, and + less than or equal to 1000000. If you specify a `TotalSegments` value of + 1, the `Scan` operation will be sequential rather than parallel. + + If you specify `TotalSegments`, you must also specify `Segment`. + """ + segment: int | None = ... + """ + For a parallel `Scan` request, `Segment` identifies an individual + segment to be scanned by an application worker. + + Segment IDs are zero-based, so the first segment is always 0. For + example, if you want to use four application threads to scan a table or + an index, then the first thread specifies a `Segment` value of 0, the + second thread specifies 1, and so on. + + The value of `LastEvaluatedKey` returned from a parallel `Scan` request + must be used as `ExclusiveStartKey` with the same segment ID in a + subsequent `Scan` operation. + + The value for `Segment` must be greater than or equal to 0, and less + than the value provided for `TotalSegments`. + + If you provide `Segment`, you must also provide `TotalSegments`. + """ + projection_expression: str | None = ... + """ + A string that identifies one or more attributes to retrieve from the + specified table or index. These attributes can include scalars, sets, or + elements of a JSON document. The attributes in the expression must be + separated by commas. + + If no attribute names are specified, then all attributes will be + returned. If any of the requested attributes are not found, they will + not appear in the result. + + For more information, see [Specifying Item + Attributes](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) + in the *Amazon DynamoDB Developer Guide*. + """ + filter_expression: str | None = ... + """ + A string that contains conditions that DynamoDB applies after the `Scan` + operation, but before the data is returned to you. Items that do not + satisfy the `FilterExpression` criteria are not returned. + + Note: + A `FilterExpression` is applied after the items have already been read; + the process of filtering does not consume any additional read capacity + units. + + For more information, see [Filter + Expressions](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Scan.html#Scan.FilterExpression) + in the *Amazon DynamoDB Developer Guide*. + """ + expression_attribute_names: dict[str, str] | None = ... + """ + One or more substitution tokens for attribute names in an expression. + The following are some use cases for using `ExpressionAttributeNames`: + + - To access an attribute whose name conflicts with a DynamoDB reserved + word. + + - To create a placeholder for repeating occurrences of an attribute name + in an expression. + + - To prevent special characters in an attribute name from being + misinterpreted in an expression. + + Use the **#** character in an expression to dereference an attribute + name. For example, consider the following attribute name: + + - `Percentile` + + The name of this attribute conflicts with a reserved word, so it cannot + be used directly in an expression. (For the complete list of reserved + words, see [Reserved + Words](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html) + in the *Amazon DynamoDB Developer Guide*). To work around this, you + could specify the following for `ExpressionAttributeNames`: + + - `{"#P":"Percentile"}` + + You could then use this substitution in an expression, as in this + example: + + - `#P = :val` + + Note: + Tokens that begin with the **:** character are *expression attribute + values*, which are placeholders for the actual value at runtime. + + For more information on expression attribute names, see [Specifying Item + Attributes](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) + in the *Amazon DynamoDB Developer Guide*. + """ + expression_attribute_values: dict[str, AttributeValue] | None = ... + """ + One or more values that can be substituted in an expression. + + Use the **:** (colon) character in an expression to dereference an + attribute value. For example, suppose that you wanted to check whether + the value of the `ProductStatus` attribute was one of the following: + + `Available | Backordered | Discontinued` + + You would first need to specify `ExpressionAttributeValues` as follows: + + `{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }` + + You could then use these values in an expression, such as this: + + `ProductStatus IN (:avail, :back, :disc)` + + For more information on expression attribute values, see [Condition + Expressions](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html) + in the *Amazon DynamoDB Developer Guide*. + """ + consistent_read: bool | None = ... + """ + A Boolean value that determines the read consistency model during the + scan: + + - If `ConsistentRead` is `false`, then the data returned from `Scan` + might not contain the results from other recently completed write + operations (`PutItem`, `UpdateItem`, or `DeleteItem`). + + - If `ConsistentRead` is `true`, then all of the write operations that + completed before the `Scan` began are guaranteed to be contained in + the `Scan` response. + + The default setting for `ConsistentRead` is `false`. + + The `ConsistentRead` parameter is not supported on global secondary + indexes. If you scan a global secondary index with `ConsistentRead` set + to true, you will receive a `ValidationException`. + """ + +@dataclass(kw_only=True) +class ScanOutput(_SerdeShape): + """Represents the output of a `Scan` operation.""" + + items: list[dict[str, AttributeValue]] | None = ... + """ + An array of item attributes that match the scan criteria. Each element + in this array consists of an attribute name and the value for that + attribute. + """ + count: int = ... + """ + The number of items in the response. + + If you set `ScanFilter` in the request, then `Count` is the number of + items returned after the filter was applied, and `ScannedCount` is the + number of matching items before the filter was applied. + + If you did not use a filter in the request, then `Count` is the same as + `ScannedCount`. + """ + scanned_count: int = ... + """ + The number of items evaluated, before any `ScanFilter` is applied. A + high `ScannedCount` value with few, or no, `Count` results indicates an + inefficient `Scan` operation. For more information, see [Count and + ScannedCount](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html#Count) + in the *Amazon DynamoDB Developer Guide*. + + If you did not use a filter in the request, then `ScannedCount` is the + same as `Count`. + """ + last_evaluated_key: dict[str, AttributeValue] | None = ... + """ + The primary key of the item where the operation stopped, inclusive of + the previous result set. Use this value to start a new operation, + excluding this value in the new request. + + If `LastEvaluatedKey` is empty, then the \"last page\" of results has + been processed and there is no more data to be retrieved. + + If `LastEvaluatedKey` is not empty, it does not necessarily mean that + there is more data in the result set. The only way to know when you have + reached the end of the result set is when `LastEvaluatedKey` is empty. + """ + consumed_capacity: ConsumedCapacity | None = ... + """ + The capacity units consumed by the `Scan` operation. The data returned + includes the total provisioned throughput consumed, along with + statistics for the table and any indexes involved in the operation. + `ConsumedCapacity` is only returned if the `ReturnConsumedCapacity` + parameter was specified. For more information, see [Capacity unit + consumption for read + operations](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/read-write-operations.html#read-operation-consumption) + in the *Amazon DynamoDB Developer Guide*. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class SearchResultItem(_SerdeShape): + """A single result from a `SearchVectors` operation.""" + + item: dict[str, AttributeValue] | None = ... + """ + A map of attribute names to `AttributeValue` objects, representing the + projected attributes of the item returned by the vector search. + """ + score: float = ... + """ + The similarity score for this item relative to the search vector. The + interpretation depends on the distance function configured for the + vector index. + """ + +@dataclass(kw_only=True) +class SearchSchemaElement(_SerdeShape): + """An element in the search schema of a vector index.""" + + attribute_name: str + """The name of the attribute.""" + search_schema_element_type: str + """ + The role of the attribute in the search schema. Valid values: + + - `HASH` - A partition key that partitions the vector index for + independent scaling. When specified, you must provide this + attribute's value in the `SearchConditionExpression`. + + - `INLINE_FILTER` - An attribute projected into the vector index for + filtering at the storage layer during search. Inline filters are + optional in the `SearchConditionExpression`. + """ + +class SearchSchemaElementType(UnknownEnumMixin, StrEnum): + HASH = "HASH" + INLINE_FILTER = "INLINE_FILTER" + +@dataclass(kw_only=True) +class SearchVectorsInput(_SerdeShape): + """Dataclass for SearchVectorsInput structure.""" + + table_name: str | None = ... + """ + The name or Amazon Resource Name (ARN) of the table containing the + vector index. + """ + index_name: str | None = ... + """ + The name of the vector index to search. The index must be in the + `ACTIVE` state. + """ + return_consumed_capacity: str | None = ... + """ + Determines the level of detail about either provisioned or on-demand + throughput consumption that is returned in the response: + + - `INDEXES` - The response includes the aggregate `ConsumedCapacity` for + the operation, together with `ConsumedCapacity` for each table and + secondary index that was accessed. + + Note that some operations, such as `GetItem` and `BatchGetItem`, do + not access any indexes at all. In these cases, specifying `INDEXES` + will only return `ConsumedCapacity` information for table(s). + + - `TOTAL` - The response includes only the aggregate `ConsumedCapacity` + for the operation. + + - `NONE` - No `ConsumedCapacity` details are included in the response. + """ + expression_attribute_names: dict[str, str] | None = ... + """ + One or more substitution tokens for attribute names in an expression. + Use the `#` character in an expression to dereference an attribute name. + """ + expression_attribute_values: dict[str, AttributeValue] | None = ... + """ + One or more values that can be substituted in an expression. Use the `:` + character in an expression to dereference an attribute value. + """ + projection_expression: str | None = ... + """ + A string that identifies one or more attributes to retrieve from the + index. Separate attribute names with commas. If not specified, the + operation returns all attributes projected into the vector index. + + Only attributes projected into the vector index can be retrieved. + """ + search_vector: list[AttributeValue] | None = ... + """ + The search vector to compare against the indexed vectors. Each element + is a 32-bit IEEE-754 floating point number, provided in DynamoDB list + format. + + The number of dimensions must match the number of dimensions configured + for the vector index. + """ + search_condition_expression: str | None = ... + """ + A condition expression used to filter the vector search results. The + expression can reference attributes defined in the vector index search + schema, including `HASH` and `INLINE_FILTER` key elements. + + Only the equality operator (`=`) is supported for `HASH` attributes. + Comparison and range operators are supported for `INLINE_FILTER` + attributes. Only top-level attributes from the search schema can be + referenced. + """ + top_k: int | None = ... + """The number of most similar results to return.""" + +@dataclass(kw_only=True) +class SearchVectorsOutput(_SerdeShape): + """Dataclass for SearchVectorsOutput structure.""" + + consumed_capacity: VectorCapacity | None = ... + """ + The capacity units consumed by the `SearchVectors` operation. Contains + `VectorSearchRequestBytes`, which represents the vector search capacity + consumed. + """ + search_results: list[SearchResultItem] | None = ... + """ + A list of items returned by the vector similarity search, sorted by + similarity with the most similar item first. Each item contains the + projected attributes and a similarity score. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class Select(UnknownEnumMixin, StrEnum): + ALL_ATTRIBUTES = "ALL_ATTRIBUTES" + ALL_PROJECTED_ATTRIBUTES = "ALL_PROJECTED_ATTRIBUTES" + SPECIFIC_ATTRIBUTES = "SPECIFIC_ATTRIBUTES" + COUNT = "COUNT" + +@dataclass(kw_only=True) +class SourceTableDetails(_SerdeShape): + """Contains the details of the table when the backup was created.""" + + table_name: str + """The name of the table for which the backup was created.""" + table_id: str + """Unique identifier for the table for which the backup was created.""" + table_arn: str | None = ... + """ARN of the table for which backup was created.""" + table_size_bytes: int | None = ... + """Size of the table in bytes. Note that this is an approximate value.""" + key_schema: list[KeySchemaElement] + """Schema of the table.""" + table_creation_date_time: datetime + """Time when the source table was created.""" + provisioned_throughput: ProvisionedThroughput + """Read IOPs and Write IOPS on the table when the backup was created.""" + on_demand_throughput: OnDemandThroughput | None = ... + """ + Sets the maximum number of read and write units for the specified + on-demand table. If you use this parameter, you must specify + `MaxReadRequestUnits`, `MaxWriteRequestUnits`, or both. + """ + item_count: int | None = ... + """Number of items in the table. Note that this is an approximate value.""" + billing_mode: str | None = ... + """ + Controls how you are charged for read and write throughput and how you + manage capacity. This setting can be changed later. + + - `PROVISIONED` - Sets the read/write capacity mode to `PROVISIONED`. We + recommend using `PROVISIONED` for predictable workloads. + + - `PAY_PER_REQUEST` - Sets the read/write capacity mode to + `PAY_PER_REQUEST`. We recommend using `PAY_PER_REQUEST` for + unpredictable workloads. + """ + +@dataclass(kw_only=True) +class SourceTableFeatureDetails(_SerdeShape): + """ + Contains the details of the features enabled on the table when the + backup was created. For example, LSIs, GSIs, streams, TTL. + """ + + local_secondary_indexes: list[LocalSecondaryIndexInfo] | None = ... + """ + Represents the LSI properties for the table when the backup was created. + It includes the IndexName, KeySchema and Projection for the LSIs on the + table at the time of backup. + """ + global_secondary_indexes: list[GlobalSecondaryIndexInfo] | None = ... + """ + Represents the GSI properties for the table when the backup was created. + It includes the IndexName, KeySchema, Projection, and + ProvisionedThroughput for the GSIs on the table at the time of backup. + """ + stream_description: StreamSpecification | None = ... + """Stream settings on the table when the backup was created.""" + time_to_live_description: TimeToLiveDescription | None = ... + """Time to Live settings on the table when the backup was created.""" + sse_description: SSEDescription | None = ... + """ + The description of the server-side encryption status on the table when + the backup was created. + """ + vector_indexes: list[VectorIndexInfo] | None = ... + """ + The vector index properties for the table at the time the backup was + created, including the index name, vector attribute, dimensions, + distance function, search schema, and projection. + """ + +@dataclass(kw_only=True) +class SSEDescription(_SerdeShape): + """ + The description of the server-side encryption status on the specified + table. + """ + + status: str | None = ... + """ + Represents the current state of server-side encryption. The only + supported values are: + + - `ENABLED` - Server-side encryption is enabled. + + - `UPDATING` - Server-side encryption is being updated. + """ + sse_type: str | None = ... + """ + Server-side encryption type. The only supported value is: + + - `KMS` - Server-side encryption that uses Key Management Service. The + key is stored in your account and is managed by KMS (KMS charges + apply). + """ + kms_master_key_arn: str | None = ... + """The KMS key ARN used for the KMS encryption.""" + inaccessible_encryption_date_time: datetime | None = ... + """ + Indicates the time, in UNIX epoch date format, when DynamoDB detected + that the table's KMS key was inaccessible. This attribute will + automatically be cleared when DynamoDB detects that the table's KMS key + is accessible again. DynamoDB will initiate the table archival process + when table's KMS key remains inaccessible for more than seven days from + this date. + """ + +@dataclass(kw_only=True) +class SSESpecification(_SerdeShape): + """Represents the settings used to enable server-side encryption.""" + + enabled: bool | None = ... + """ + Indicates whether server-side encryption is done using an Amazon Web + Services managed key or an Amazon Web Services owned key. If enabled + (true), server-side encryption type is set to `KMS` and an Amazon Web + Services managed key is used (KMS charges apply). If disabled (false) or + not specified, server-side encryption is set to Amazon Web Services + owned key. + """ + sse_type: str | None = ... + """ + Server-side encryption type. The only supported value is: + + - `KMS` - Server-side encryption that uses Key Management Service. The + key is stored in your account and is managed by KMS (KMS charges + apply). + """ + kms_master_key_id: str | None = ... + """ + The KMS key that should be used for the KMS encryption. To specify a + key, use its key ID, Amazon Resource Name (ARN), alias name, or alias + ARN. Note that you should only provide this parameter if the key is + different from the default DynamoDB key `alias/aws/dynamodb`. + """ + +class SSEStatus(UnknownEnumMixin, StrEnum): + ENABLING = "ENABLING" + ENABLED = "ENABLED" + DISABLING = "DISABLING" + DISABLED = "DISABLED" + UPDATING = "UPDATING" + +class SSEType(UnknownEnumMixin, StrEnum): + AES256 = "AES256" + KMS = "KMS" + +@dataclass(kw_only=True) +class StreamSpecification(_SerdeShape): + """Represents the DynamoDB Streams configuration for a table in DynamoDB.""" + + stream_enabled: bool + """ + Indicates whether DynamoDB Streams is enabled (true) or disabled (false) + on the table. + """ + stream_view_type: str | None = ... + """ + When an item in the table is modified, `StreamViewType` determines what + information is written to the stream for this table. Valid values for + `StreamViewType` are: + + - `KEYS_ONLY` - Only the key attributes of the modified item are written + to the stream. + + - `NEW_IMAGE` - The entire item, as it appears after it was modified, is + written to the stream. + + - `OLD_IMAGE` - The entire item, as it appeared before it was modified, + is written to the stream. + + - `NEW_AND_OLD_IMAGES` - Both the new and the old item images of the + item are written to the stream. + """ + +class StreamViewType(UnknownEnumMixin, StrEnum): + NEW_IMAGE = "NEW_IMAGE" + OLD_IMAGE = "OLD_IMAGE" + NEW_AND_OLD_IMAGES = "NEW_AND_OLD_IMAGES" + KEYS_ONLY = "KEYS_ONLY" + +@dataclass(kw_only=True) +class TableAlreadyExistsException(ServiceError, _SerdeShape): + """A target table with the specified name already exists.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class TableAutoScalingDescription(_SerdeShape): + """Represents the auto scaling configuration for a global table.""" + + table_name: str | None = ... + """The name of the table.""" + table_status: str | None = ... + """ + The current state of the table: + + - `CREATING` - The table is being created. + + - `UPDATING` - The table is being updated. + + - `DELETING` - The table is being deleted. + + - `ACTIVE` - The table is ready for use. + """ + replicas: list[ReplicaAutoScalingDescription] | None = ... + """Represents replicas of the global table.""" + +class TableClass(UnknownEnumMixin, StrEnum): + STANDARD = "STANDARD" + STANDARD_INFREQUENT_ACCESS = "STANDARD_INFREQUENT_ACCESS" + +@dataclass(kw_only=True) +class TableClassSummary(_SerdeShape): + """Contains details of the table class.""" + + table_class: str | None = ... + """ + The table class of the specified table. Valid values are `STANDARD` and + `STANDARD_INFREQUENT_ACCESS`. + """ + last_update_date_time: datetime | None = ... + """The date and time at which the table class was last updated.""" + +@dataclass(kw_only=True) +class TableCreationParameters(_SerdeShape): + """The parameters for the table created as part of the import operation.""" + + table_name: str + """The name of the table created as part of the import operation.""" + attribute_definitions: list[AttributeDefinition] + """The attributes of the table created as part of the import operation.""" + key_schema: list[KeySchemaElement] + """ + The primary key and option sort key of the table created as part of the + import operation. + """ + billing_mode: str | None = ... + """ + The billing mode for provisioning the table created as part of the + import operation. + """ + provisioned_throughput: ProvisionedThroughput | None = ... + """ + Represents the provisioned throughput settings for the specified global + secondary index. You must use `ProvisionedThroughput` or + `OnDemandThroughput` based on your table's capacity mode. + + For current minimum and maximum provisioned throughput values, see + [Service, Account, and Table + Quotas](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html) + in the *Amazon DynamoDB Developer Guide*. + """ + on_demand_throughput: OnDemandThroughput | None = ... + """ + Sets the maximum number of read and write units for the specified + on-demand table. If you use this parameter, you must specify + `MaxReadRequestUnits`, `MaxWriteRequestUnits`, or both. + """ + sse_specification: SSESpecification | None = ... + """Represents the settings used to enable server-side encryption.""" + global_secondary_indexes: list[GlobalSecondaryIndex] | None = ... + """ + The Global Secondary Indexes (GSI) of the table to be created as part of + the import operation. + """ + vector_indexes: list[VectorIndex] | None = ... + """ + The vector indexes of the table to be created as part of the import + operation. + """ + +@dataclass(kw_only=True) +class TableDescription(_SerdeShape): + """Represents the properties of a table.""" + + attribute_definitions: list[AttributeDefinition] | None = ... + """ + An array of `AttributeDefinition` objects. Each of these objects + describes one attribute in the table and index key schema. + + Each `AttributeDefinition` object in this array is composed of: + + - `AttributeName` - The name of the attribute. + + - `AttributeType` - The data type for the attribute. + """ + table_name: str | None = ... + """The name of the table.""" + key_schema: list[KeySchemaElement] | None = ... + """ + The primary key structure for the table. Each `KeySchemaElement` + consists of: + + - `AttributeName` - The name of the attribute. + + - `KeyType` - The role of the attribute: + + - `HASH` - partition key + + - `RANGE` - sort key + + Note: + The partition key of an item is also known as its *hash attribute*. + The term \"hash attribute\" derives from DynamoDB's usage of an + internal hash function to evenly distribute data items across + partitions, based on their partition key values. + + The sort key of an item is also known as its *range attribute*. The + term \"range attribute\" derives from the way DynamoDB stores items + with the same partition key physically close together, in sorted order + by the sort key value. + + For more information about primary keys, see [Primary + Key](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataModel.html#DataModelPrimaryKey) + in the *Amazon DynamoDB Developer Guide*. + """ + table_status: str | None = ... + """ + The current state of the table: + + - `CREATING` - The table is being created. + + - `UPDATING` - The table/index configuration is being updated. The + table/index remains available for data operations when `UPDATING`. + + - `DELETING` - The table is being deleted. + + - `ACTIVE` - The table is ready for use. + + - `INACCESSIBLE_ENCRYPTION_CREDENTIALS` - The KMS key used to encrypt + the table in inaccessible. Table operations may fail due to failure to + use the KMS key. DynamoDB will initiate the table archival process + when a table's KMS key remains inaccessible for more than seven days. + + - `ARCHIVING` - The table is being archived. Operations are not allowed + until archival is complete. + + - `ARCHIVED` - The table has been archived. See the ArchivalReason for + more information. + """ + creation_date_time: datetime | None = ... + """ + The date and time when the table was created, in [UNIX epoch + time](http://www.epochconverter.com/) format. + """ + provisioned_throughput: ProvisionedThroughputDescription | None = ... + """ + The provisioned throughput settings for the table, consisting of read + and write capacity units, along with data about increases and decreases. + """ + table_size_bytes: int | None = ... + """ + The total size of the specified table, in bytes. DynamoDB updates this + value approximately every six hours. Recent changes might not be + reflected in this value. + """ + item_count: int | None = ... + """ + The number of items in the specified table. DynamoDB updates this value + approximately every six hours. Recent changes might not be reflected in + this value. + """ + table_arn: str | None = ... + """The Amazon Resource Name (ARN) that uniquely identifies the table.""" + table_id: str | None = ... + """ + A unique identifier for the table, in UUID format, generated by DynamoDB + when the table is created. + """ + billing_mode_summary: BillingModeSummary | None = ... + """Contains the details for the read/write capacity mode.""" + local_secondary_indexes: list[LocalSecondaryIndexDescription] | None = ... + """ + Represents one or more local secondary indexes on the table. Each index + is scoped to a given partition key value. Tables with one or more local + secondary indexes are subject to an item collection size limit, where + the amount of data within a given item collection cannot exceed 10 GB. + Each element is composed of: + + - `IndexName` - The name of the local secondary index. + + - `KeySchema` - Specifies the complete index key schema. The attribute + names in the key schema must be between 1 and 255 characters + (inclusive). The key schema must begin with the same partition key as + the table. + + - `Projection` - Specifies attributes that are copied (projected) from + the table into the index. These are in addition to the primary key + attributes and index key attributes, which are automatically + projected. Each attribute specification is composed of: + + - `ProjectionType` - One of the following: + + - `KEYS_ONLY` - Only the index and primary keys are projected into + the index. + + - `INCLUDE` - Only the specified table attributes are projected into + the index. The list of projected attributes is in + `NonKeyAttributes`. + + - `ALL` - All of the table attributes are projected into the index. + + - `NonKeyAttributes` - A list of one or more non-key attribute names + that are projected into the secondary index. The total count of + attributes provided in `NonKeyAttributes`, summed across all of the + secondary indexes, must not exceed 100. If you project the same + attribute into two different indexes, this counts as two distinct + attributes when determining the total. This limit only applies when + you specify the ProjectionType of `INCLUDE`. You still can specify + the ProjectionType of `ALL` to project all attributes from the + source table, even if the table has more than 100 attributes. + + - `IndexSizeBytes` - Represents the total size of the index, in bytes. + DynamoDB updates this value approximately every six hours. Recent + changes might not be reflected in this value. + + - `ItemCount` - Represents the number of items in the index. DynamoDB + updates this value approximately every six hours. Recent changes might + not be reflected in this value. + + If the table is in the `DELETING` state, no information about indexes + will be returned. + """ + global_secondary_indexes: list[GlobalSecondaryIndexDescription] | None = ... + """ + The global secondary indexes, if any, on the table. Each index is scoped + to a given partition key value. Each element is composed of: + + - `Backfilling` - If true, then the index is currently in the + backfilling phase. Backfilling occurs only when a new global secondary + index is added to the table. It is the process by which DynamoDB + populates the new index with data from the table. (This attribute does + not appear for indexes that were created during a `CreateTable` + operation.) + + You can delete an index that is being created during the `Backfilling` + phase when `IndexStatus` is set to CREATING and `Backfilling` is true. + You can't delete the index that is being created when `IndexStatus` + is set to CREATING and `Backfilling` is false. (This attribute does + not appear for indexes that were created during a `CreateTable` + operation.) + + - `IndexName` - The name of the global secondary index. + + - `IndexSizeBytes` - The total size of the global secondary index, in + bytes. DynamoDB updates this value approximately every six hours. + Recent changes might not be reflected in this value. + + - `IndexStatus` - The current status of the global secondary index: + + - `CREATING` - The index is being created. + + - `UPDATING` - The index is being updated. + + - `DELETING` - The index is being deleted. + + - `ACTIVE` - The index is ready for use. + + - `ItemCount` - The number of items in the global secondary index. + DynamoDB updates this value approximately every six hours. Recent + changes might not be reflected in this value. + + - `KeySchema` - Specifies the complete index key schema. The attribute + names in the key schema must be between 1 and 255 characters + (inclusive). The key schema must begin with the same partition key as + the table. + + - `Projection` - Specifies attributes that are copied (projected) from + the table into the index. These are in addition to the primary key + attributes and index key attributes, which are automatically + projected. Each attribute specification is composed of: + + - `ProjectionType` - One of the following: + + - `KEYS_ONLY` - Only the index and primary keys are projected into + the index. + + - `INCLUDE` - In addition to the attributes described in + `KEYS_ONLY`, the secondary index will include other non-key + attributes that you specify. + + - `ALL` - All of the table attributes are projected into the index. + + - `NonKeyAttributes` - A list of one or more non-key attribute names + that are projected into the secondary index. The total count of + attributes provided in `NonKeyAttributes`, summed across all of the + secondary indexes, must not exceed 100. If you project the same + attribute into two different indexes, this counts as two distinct + attributes when determining the total. This limit only applies when + you specify the ProjectionType of `INCLUDE`. You still can specify + the ProjectionType of `ALL` to project all attributes from the + source table, even if the table has more than 100 attributes. + + - `ProvisionedThroughput` - The provisioned throughput settings for the + global secondary index, consisting of read and write capacity units, + along with data about increases and decreases. + + If the table is in the `DELETING` state, no information about indexes + will be returned. + """ + stream_specification: StreamSpecification | None = ... + """The current DynamoDB Streams configuration for the table.""" + latest_stream_label: str | None = ... + """ + A timestamp, in ISO 8601 format, for this stream. + + Note that `LatestStreamLabel` is not a unique identifier for the stream, + because it is possible that a stream from another table might have the + same timestamp. However, the combination of the following three elements + is guaranteed to be unique: + + - Amazon Web Services customer ID + + - Table name + + - `StreamLabel` + """ + latest_stream_arn: str | None = ... + """ + The Amazon Resource Name (ARN) that uniquely identifies the latest + stream for this table. + """ + global_table_version: str | None = ... + """ + Represents the version of [global + tables](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GlobalTables.html) + in use, if the table is replicated across Amazon Web Services Regions. + """ + replicas: list[ReplicaDescription] | None = ... + """Represents replicas of the table.""" + global_table_witnesses: list[GlobalTableWitnessDescription] | None = ... + """ + The witness Region and its current status in the MRSC global table. Only + one witness Region can be configured per MRSC global table. + """ + global_table_settings_replication_mode: str | None = ... + """ + Indicates one of the settings synchronization modes for the global + table: + + - `ENABLED`: Indicates that the settings synchronization mode for the + global table is enabled. + + - `DISABLED`: Indicates that the settings synchronization mode for the + global table is disabled. + + - `ENABLED_WITH_OVERRIDES`: This mode is set by default for a same + account global table. Indicates that certain global table settings can + be overridden. + """ + restore_summary: RestoreSummary | None = ... + """Contains details for the restore.""" + sse_description: SSEDescription | None = ... + """ + The description of the server-side encryption status on the specified + table. + """ + archival_summary: ArchivalSummary | None = ... + """Contains information about the table archive.""" + table_class_summary: TableClassSummary | None = ... + """Contains details of the table class.""" + deletion_protection_enabled: bool | None = ... + """ + Indicates whether deletion protection is enabled (true) or disabled + (false) on the table. + """ + on_demand_throughput: OnDemandThroughput | None = ... + """ + The maximum number of read and write units for the specified on-demand + table. If you use this parameter, you must specify + `MaxReadRequestUnits`, `MaxWriteRequestUnits`, or both. + """ + warm_throughput: TableWarmThroughputDescription | None = ... + """Describes the warm throughput value of the base table.""" + multi_region_consistency: str | None = ... + """ + Indicates one of the following consistency modes for a global table: + + - `EVENTUAL`: Indicates that the global table is configured for + multi-Region eventual consistency (MREC). + + - `STRONG`: Indicates that the global table is configured for + multi-Region strong consistency (MRSC). + + If you don't specify this field, the global table consistency mode + defaults to `EVENTUAL`. For more information about global tables + consistency modes, see [Consistency + modes](https://docs.aws.amazon.com/V2globaltables_HowItWorks.html#V2globaltables_HowItWorks.consistency-modes) + in DynamoDB developer guide. + """ + vector_indexes: list[VectorIndexDescription] | None = ... + """ + The vector indexes, if any, on the table. Each element is composed of: + + - `IndexName` - The name of the vector index. + + - `IndexStatus` - The current status of the vector index: `CREATING`, + `ACTIVE`, or `DELETING`. + + - `Backfilling` - Specifies whether the index is currently backfilling. + During backfill, `SearchVectors` operations might return incomplete + results. + + - `VectorAttribute` - The attribute that contains vector embeddings. + + - `Dimensions` - The number of dimensions in each vector. + + - `DistanceFunction` - The distance function used to calculate + similarity (`COSINE`, `EUCLIDEAN`, or `DOT_PRODUCT`). + + - `SearchSchema` - The partition key and inline filter attributes for + the vector index. + + - `Projection` - Specifies attributes that are copied (projected) from + the table into the vector index. + + - `IndexArn` - The Amazon Resource Name (ARN) that uniquely identifies + the index. + + - `IndexSizeBytes` - The total size of the vector index, in bytes. + Amazon DynamoDB updates this value approximately every six hours. + Recent changes might not be reflected in this value. + + - `ItemCount` - The number of items indexed in the vector index. Amazon + DynamoDB updates this value approximately every six hours. Recent + changes might not be reflected in this value. + """ + +@dataclass(kw_only=True) +class TableInUseException(ServiceError, _SerdeShape): + """ + A target table with the specified name is either being created or + deleted. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class TableNotFoundException(ServiceError, _SerdeShape): + """ + A source table with the name `TableName` does not currently exist within + the subscriber's account or the subscriber is operating in the wrong + Amazon Web Services Region. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class TableStatus(UnknownEnumMixin, StrEnum): + CREATING = "CREATING" + UPDATING = "UPDATING" + DELETING = "DELETING" + ACTIVE = "ACTIVE" + INACCESSIBLE_ENCRYPTION_CREDENTIALS = "INACCESSIBLE_ENCRYPTION_CREDENTIALS" + ARCHIVING = "ARCHIVING" + ARCHIVED = "ARCHIVED" + REPLICATION_NOT_AUTHORIZED = "REPLICATION_NOT_AUTHORIZED" + +@dataclass(kw_only=True) +class TableWarmThroughputDescription(_SerdeShape): + """ + Represents the warm throughput value (in read units per second and write + units per second) of the table. Warm throughput is applicable for + DynamoDB Standard-IA tables and specifies the minimum provisioned + capacity maintained for immediate data access. + """ + + read_units_per_second: int | None = ... + """ + Represents the base table's warm throughput value in read units per + second. + """ + write_units_per_second: int | None = ... + """ + Represents the base table's warm throughput value in write units per + second. + """ + status: str | None = ... + """Represents warm throughput value of the base table.""" + +@dataclass(kw_only=True) +class Tag(_SerdeShape): + """ + Describes a tag. A tag is a key-value pair. You can add up to 50 tags to + a single DynamoDB table. + + Amazon Web Services-assigned tag names and values are automatically + assigned the `aws:` prefix, which the user cannot assign. Amazon Web + Services-assigned tag names do not count towards the tag limit of 50. + User-assigned tag names have the prefix `user:` in the Cost Allocation + Report. You cannot backdate the application of a tag. + + For an overview on tagging DynamoDB resources, see [Tagging for + DynamoDB](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tagging.html) + in the *Amazon DynamoDB Developer Guide*. + """ + + key: str + """ + The key of the tag. Tag keys are case sensitive. Each DynamoDB table can + only have up to one tag with the same key. If you try to add an existing + tag (same key), the existing tag value will be updated to the new value. + """ + value: str + """The value of the tag. Tag values are case-sensitive and can be null.""" + +@dataclass(kw_only=True) +class TagResourceInput(_SerdeShape): + """Dataclass for TagResourceInput structure.""" + + resource_arn: str | None = ... + """ + Identifies the Amazon DynamoDB resource to which tags should be added. + This value is an Amazon Resource Name (ARN). + """ + tags: list[Tag] | None = ... + """The tags to be assigned to the Amazon DynamoDB resource.""" + +@dataclass(kw_only=True) +class TagResourceOutput(_SerdeShape): + """Dataclass for TagResourceOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ThrottlingException(ServiceError, _SerdeShape): + """ + The request was denied due to request throttling. For detailed + information about why the request was throttled and the ARN of the + impacted resource, find the + [ThrottlingReason](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ThrottlingReason.html) + field in the returned exception. + """ + + throttling_reasons: list[ThrottlingReason] | None = ... + """ + A list of + [ThrottlingReason](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ThrottlingReason.html) + that provide detailed diagnostic information about why the request was + throttled. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ThrottlingReason(_SerdeShape): + """ + Represents the specific reason why a DynamoDB request was throttled and + the ARN of the impacted resource. This helps identify exactly what + resource is being throttled, what type of operation caused it, and why + the throttling occurred. + """ + + reason: str | None = ... + """ + The reason for throttling. The throttling reason follows a specific + format: `ResourceType+OperationType+LimitType`: + + - Resource Type (What is being throttled): Table or Index + + - Operation Type (What kind of operation): Read or Write + + - Limit Type (Why the throttling occurred): + + - `ProvisionedThroughputExceeded`: The request rate is exceeding the + [provisioned throughput + capacity](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/provisioned-capacity-mode.html) + (read or write capacity units) configured for a table or a global + secondary index (GSI) in provisioned capacity mode. + + - `AccountLimitExceeded`: The request rate has caused a table or + global secondary index (GSI) in on-demand mode to exceed the + [per-table account-level service + quotas](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ServiceQuotas.html#default-limits-throughput) + for read/write throughput in the current Amazon Web Services Region. + + - `KeyRangeThroughputExceeded`: The request rate directed at a + specific partition key value has exceeded the [internal + partition-level throughput + limits](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/bp-partition-key-design.html), + indicating uneven access patterns across the table's or GSI's key + space. + + - `MaxOnDemandThroughputExceeded`: The request rate has exceeded the + [configured maximum throughput + limits](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/on-demand-capacity-mode-max-throughput.html) + set for a table or index in on-demand capacity mode. + + Examples of complete throttling reasons: + + - TableReadProvisionedThroughputExceeded + + - IndexWriteAccountLimitExceeded + + This helps identify exactly what resource is being throttled, what type + of operation caused it, and why the throttling occurred. + """ + resource: str | None = ... + """ + The Amazon Resource Name (ARN) of the DynamoDB table or index that + experienced the throttling event. + """ + +@dataclass(kw_only=True) +class TimeToLiveDescription(_SerdeShape): + """The description of the Time to Live (TTL) status on the specified table.""" + + time_to_live_status: str | None = ... + """The TTL status for the table.""" + attribute_name: str | None = ... + """The name of the TTL attribute for items in the table.""" + +@dataclass(kw_only=True) +class TimeToLiveSpecification(_SerdeShape): + """ + Represents the settings used to enable or disable Time to Live (TTL) for + the specified table. + """ + + enabled: bool + """ + Indicates whether TTL is to be enabled (true) or disabled (false) on the + table. + """ + attribute_name: str + """ + The name of the TTL attribute used to store the expiration time for + items in the table. + """ + +class TimeToLiveStatus(UnknownEnumMixin, StrEnum): + ENABLING = "ENABLING" + DISABLING = "DISABLING" + ENABLED = "ENABLED" + DISABLED = "DISABLED" + +@dataclass(kw_only=True) +class TransactGetItem(_SerdeShape): + """Specifies an item to be retrieved as part of the transaction.""" + + get: Get + """ + Contains the primary key that identifies the item to get, together with + the name of the table that contains the item, and optionally the + specific attributes of the item to retrieve. + """ + +@dataclass(kw_only=True) +class TransactGetItemsInput(_SerdeShape): + """Dataclass for TransactGetItemsInput structure.""" + + transact_items: list[TransactGetItem] | None = ... + """ + An ordered array of up to 100 `TransactGetItem` objects, each of which + contains a `Get` structure. + """ + return_consumed_capacity: str | None = ... + """ + A value of `TOTAL` causes consumed capacity information to be returned, + and a value of `NONE` prevents that information from being returned. No + other value is valid. + """ + +@dataclass(kw_only=True) +class TransactGetItemsOutput(_SerdeShape): + """Dataclass for TransactGetItemsOutput structure.""" + + consumed_capacity: list[ConsumedCapacity] | None = ... + """ + If the *ReturnConsumedCapacity* value was `TOTAL`, this is an array of + `ConsumedCapacity` objects, one for each table addressed by + `TransactGetItem` objects in the *TransactItems* parameter. These + `ConsumedCapacity` objects report the read-capacity units consumed by + the `TransactGetItems` call in that table. + """ + responses: list[ItemResponse] | None = ... + """ + An ordered array of up to 100 `ItemResponse` objects, each of which + corresponds to the `TransactGetItem` object in the same position in the + *TransactItems* array. Each `ItemResponse` object contains a Map of the + name-value pairs that are the projected attributes of the requested + item. + + If a requested item could not be retrieved, the corresponding + `ItemResponse` object is Null, or if the requested item has no projected + attributes, the corresponding `ItemResponse` object is an empty Map. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class TransactionCanceledException(ServiceError, _SerdeShape): + """ + The entire transaction request was canceled. + + DynamoDB cancels a `TransactWriteItems` request under the following + circumstances: + + - A condition in one of the condition expressions is not met. + + - A table in the `TransactWriteItems` request is in a different account + or region. + + - More than one action in the `TransactWriteItems` operation targets the + same item. + + - There is insufficient provisioned capacity for the transaction to be + completed. + + - An item size becomes too large (larger than 400 KB), or a local + secondary index (LSI) becomes too large, or a similar validation error + occurs because of changes made by the transaction. + + - There is a user error, such as an invalid data format. + + - There is an ongoing `TransactWriteItems` operation that conflicts with + a concurrent `TransactWriteItems` request. In this case the + `TransactWriteItems` operation fails with a + `TransactionCanceledException`. + + DynamoDB cancels a `TransactGetItems` request under the following + circumstances: + + - There is an ongoing `TransactGetItems` operation that conflicts with a + concurrent `PutItem`, `UpdateItem`, `DeleteItem` or + `TransactWriteItems` request. In this case the `TransactGetItems` + operation fails with a `TransactionCanceledException`. + + - A table in the `TransactGetItems` request is in a different account or + region. + + - There is insufficient provisioned capacity for the transaction to be + completed. + + - There is a user error, such as an invalid data format. + + Note: + DynamoDB lists the cancellation reasons on the `CancellationReasons` + property. Transaction cancellation reasons are ordered in the order of + requested items, if an item has no error it will have `None` code and + `Null` message. The `None` code is returned as the literal string + `"None"`, not a null or absent value; the message field is omitted + entirely for an item that has no error. This is important to note when + using an SDK that surfaces the code as an optional or nullable type. + + Cancellation reason codes and possible error messages: + + - No Errors: + + - Code: `None` + + - Message: `null` + + - Conditional Check Failed: + + - Code: `ConditionalCheckFailed` + + - Message: The conditional request failed. + + - Item Collection Size Limit Exceeded: + + - Code: `ItemCollectionSizeLimitExceeded` + + - Message: Collection size exceeded. + + - Transaction Conflict: + + - Code: `TransactionConflict` + + - Message: Transaction is ongoing for the item. + + - Provisioned Throughput Exceeded: + + - Code: `ProvisionedThroughputExceeded` + + - Messages: + + - The level of configured provisioned throughput for the table was + exceeded. Consider increasing your provisioning level with the + UpdateTable API. + + Note: + This Message is received when provisioned throughput is exceeded + is on a provisioned DynamoDB table. + + - The level of configured provisioned throughput for one or more + global secondary indexes of the table was exceeded. Consider + increasing your provisioning level for the under-provisioned + global secondary indexes with the UpdateTable API. + + Note: + This message is returned when provisioned throughput is exceeded + is on a provisioned GSI. + + - Throttling Error: + + - Code: `ThrottlingError` + + - Messages: + + - Throughput exceeds the current capacity of your table or index. + DynamoDB is automatically scaling your table or index so please + try again shortly. If exceptions persist, check if you have a hot + key: + https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/bp-partition-key-design.html. + + Note: + This message is returned when writes get throttled on an On-Demand + table as DynamoDB is automatically scaling the table. + + - Throughput exceeds the current capacity for one or more global + secondary indexes. DynamoDB is automatically scaling your index so + please try again shortly. + + Note: + This message is returned when writes get throttled on an On-Demand + GSI as DynamoDB is automatically scaling the GSI. + + - Validation Error: + + - Code: `ValidationError` + + - Messages: + + - One or more parameter values were invalid. + + - The update expression attempted to update the secondary index key + beyond allowed size limits. + + - The update expression attempted to update the secondary index key + to unsupported type. + + - An operand in the update expression has an incorrect data type. + + - Item size to update has exceeded the maximum allowed size. + + - Number overflow. Attempting to store a number with magnitude + larger than supported range. + + - Type mismatch for attribute to update. + + - Nesting Levels have exceeded supported limits. + + - The document path provided in the update expression is invalid for + update. + + - The provided expression refers to an attribute that does not exist + in the item. + """ + + cancellation_reasons: list[CancellationReason] | None = ... + """A list of cancellation reasons.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class TransactionConflictException(ServiceError, _SerdeShape): + """ + Operation was rejected because there is an ongoing transaction for the + item. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class TransactionInProgressException(ServiceError, _SerdeShape): + """ + The transaction with the given request token is already in progress. + + Recommended Settings + + Note: + This is a general recommendation for handling the + `TransactionInProgressException`. These settings help ensure that the + client retries will trigger completion of the ongoing + `TransactWriteItems` request. + + - Set `clientExecutionTimeout` to a value that allows at least one retry + to be processed after 5 seconds have elapsed since the first attempt + for the `TransactWriteItems` operation. + + - Set `socketTimeout` to a value a little lower than the + `requestTimeout` setting. + + - `requestTimeout` should be set based on the time taken for the + individual retries of a single HTTP request for your use case, but + setting it to 1 second or higher should work well to reduce chances of + retries and `TransactionInProgressException` errors. + + - Use exponential backoff when retrying and tune backoff if needed. + + Assuming [default retry + policy](https://github.com/aws/aws-sdk-java/blob/fd409dee8ae23fb8953e0bb4dbde65536a7e0514/aws-java-sdk-core/src/main/java/com/amazonaws/retry/PredefinedRetryPolicies.java#L97), + example timeout settings based on the guidelines above are as follows: + + Example timeline: + + - 0-1000 first attempt + + - 1000-1500 first sleep/delay (default retry policy uses 500 ms as base + delay for 4xx errors) + + - 1500-2500 second attempt + + - 2500-3500 second sleep/delay (500 * 2, exponential backoff) + + - 3500-4500 third attempt + + - 4500-6500 third sleep/delay (500 * 2^2) + + - 6500-7500 fourth attempt (this can trigger inline recovery since 5 + seconds have elapsed since the first attempt reached TC) + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class TransactWriteItem(_SerdeShape): + """ + A list of requests that can perform update, put, delete, or check + operations on multiple items in one or more tables atomically. + """ + + condition_check: ConditionCheck | None = ... + """A request to perform a check item operation.""" + put: Put | None = ... + """A request to perform a `PutItem` operation.""" + delete: Delete | None = ... + """A request to perform a `DeleteItem` operation.""" + update: Update | None = ... + """A request to perform an `UpdateItem` operation.""" + +@dataclass(kw_only=True) +class TransactWriteItemsInput(_SerdeShape): + """Dataclass for TransactWriteItemsInput structure.""" + + transact_items: list[TransactWriteItem] | None = ... + """ + An ordered array of up to 100 `TransactWriteItem` objects, each of which + contains a `ConditionCheck`, `Put`, `Update`, or `Delete` object. These + can operate on items in different tables, but the tables must reside in + the same Amazon Web Services account and Region, and no two of them can + operate on the same item. + """ + return_consumed_capacity: str | None = ... + """ + Determines the level of detail about either provisioned or on-demand + throughput consumption that is returned in the response: + + - `INDEXES` - The response includes the aggregate `ConsumedCapacity` for + the operation, together with `ConsumedCapacity` for each table and + secondary index that was accessed. + + Note that some operations, such as `GetItem` and `BatchGetItem`, do + not access any indexes at all. In these cases, specifying `INDEXES` + will only return `ConsumedCapacity` information for table(s). + + - `TOTAL` - The response includes only the aggregate `ConsumedCapacity` + for the operation. + + - `NONE` - No `ConsumedCapacity` details are included in the response. + """ + return_item_collection_metrics: str | None = ... + """ + Determines whether item collection metrics are returned. If set to + `SIZE`, the response includes statistics about item collections (if + any), that were modified during the operation and are returned in the + response. If set to `NONE` (the default), no statistics are returned. + """ + client_request_token: str | None = ... + """ + Providing a `ClientRequestToken` makes the call to `TransactWriteItems` + idempotent, meaning that multiple identical calls have the same effect + as one single call. + + Although multiple identical calls using the same client request token + produce the same result on the server (no side effects), the responses + to the calls might not be the same. If the `ReturnConsumedCapacity` + parameter is set, then the initial `TransactWriteItems` call returns the + amount of write capacity units consumed in making the changes. + Subsequent `TransactWriteItems` calls with the same client token return + the number of read capacity units consumed in reading the item. + + A client request token is valid for 10 minutes after the first request + that uses it is completed. After 10 minutes, any request with the same + client token is treated as a new request. Do not resubmit the same + request with the same client token for more than 10 minutes, or the + result might not be idempotent. + + If you submit a request with the same client token but a change in other + parameters within the 10-minute idempotency window, DynamoDB returns an + `IdempotentParameterMismatch` exception. + """ + +@dataclass(kw_only=True) +class TransactWriteItemsOutput(_SerdeShape): + """Dataclass for TransactWriteItemsOutput structure.""" + + consumed_capacity: list[ConsumedCapacity] | None = ... + """ + The capacity units consumed by the entire `TransactWriteItems` + operation. The values of the list are ordered according to the ordering + of the `TransactItems` request parameter. + + If the table has vector indexes, each element also includes a + `VectorIndexes` field with `VectorWriteRequestBytes` consumed for each + affected vector index. + """ + item_collection_metrics: dict[str, list[ItemCollectionMetrics]] | None = ... + """ + A list of tables that were processed by `TransactWriteItems` and, for + each table, information about any item collections that were affected by + individual `UpdateItem`, `PutItem`, or `DeleteItem` operations. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UntagResourceInput(_SerdeShape): + """Dataclass for UntagResourceInput structure.""" + + resource_arn: str | None = ... + """ + The DynamoDB resource that the tags will be removed from. This value is + an Amazon Resource Name (ARN). + """ + tag_keys: list[str] | None = ... + """ + A list of tag keys. Existing tags of the resource whose keys are members + of this list will be removed from the DynamoDB resource. + """ + +@dataclass(kw_only=True) +class UntagResourceOutput(_SerdeShape): + """Dataclass for UntagResourceOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class Update(_SerdeShape): + """Represents a request to perform an `UpdateItem` operation.""" + + key: dict[str, AttributeValue] + """ + The primary key of the item to be updated. Each element consists of an + attribute name and a value for that attribute. + """ + update_expression: str + """ + An expression that defines one or more attributes to be updated, the + action to be performed on them, and new value(s) for them. + """ + table_name: str + """ + Name of the table for the `UpdateItem` request. You can also provide the + Amazon Resource Name (ARN) of the table in this parameter. + """ + condition_expression: str | None = ... + """ + A condition that must be satisfied in order for a conditional update to + succeed. + """ + expression_attribute_names: dict[str, str] | None = ... + """One or more substitution tokens for attribute names in an expression.""" + expression_attribute_values: dict[str, AttributeValue] | None = ... + """One or more values that can be substituted in an expression.""" + return_values_on_condition_check_failure: str | None = ... + """ + Use `ReturnValuesOnConditionCheckFailure` to get the item attributes if + the `Update` condition fails. For `ReturnValuesOnConditionCheckFailure`, + the valid values are: NONE and ALL_OLD. + """ + +@dataclass(kw_only=True) +class UpdateContinuousBackupsInput(_SerdeShape): + """Dataclass for UpdateContinuousBackupsInput structure.""" + + table_name: str | None = ... + """ + The name of the table. You can also provide the Amazon Resource Name + (ARN) of the table in this parameter. + """ + point_in_time_recovery_specification: PointInTimeRecoverySpecification | None = ... + """Represents the settings used to enable point in time recovery.""" + +@dataclass(kw_only=True) +class UpdateContinuousBackupsOutput(_SerdeShape): + """Dataclass for UpdateContinuousBackupsOutput structure.""" + + continuous_backups_description: ContinuousBackupsDescription | None = ... + """ + Represents the continuous backups and point in time recovery settings on + the table. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateContributorInsightsInput(_SerdeShape): + """Dataclass for UpdateContributorInsightsInput structure.""" + + table_name: str | None = ... + """ + The name of the table. You can also provide the Amazon Resource Name + (ARN) of the table in this parameter. + """ + index_name: str | None = ... + """The global secondary index name, if applicable.""" + contributor_insights_action: str | None = ... + """Represents the contributor insights action.""" + contributor_insights_mode: str | None = ... + """ + Specifies whether to track all access and throttled events or throttled + events only for the DynamoDB table or index. + """ + +@dataclass(kw_only=True) +class UpdateContributorInsightsOutput(_SerdeShape): + """Dataclass for UpdateContributorInsightsOutput structure.""" + + table_name: str | None = ... + """The name of the table.""" + index_name: str | None = ... + """The name of the global secondary index, if applicable.""" + contributor_insights_status: str | None = ... + """The status of contributor insights""" + contributor_insights_mode: str | None = ... + """ + The updated mode of CloudWatch Contributor Insights that determines + whether to monitor all access and throttled events or to track throttled + events exclusively. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateGlobalSecondaryIndexAction(_SerdeShape): + """ + Represents the new provisioned throughput settings to be applied to a + global secondary index. + """ + + index_name: str + """The name of the global secondary index to be updated.""" + provisioned_throughput: ProvisionedThroughput | None = ... + """ + Represents the provisioned throughput settings for the specified global + secondary index. + + For current minimum and maximum provisioned throughput values, see + [Service, Account, and Table + Quotas](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html) + in the *Amazon DynamoDB Developer Guide*. + """ + on_demand_throughput: OnDemandThroughput | None = ... + """ + Updates the maximum number of read and write units for the specified + global secondary index. If you use this parameter, you must specify + `MaxReadRequestUnits`, `MaxWriteRequestUnits`, or both. + """ + warm_throughput: WarmThroughput | None = ... + """ + Represents the warm throughput value of the new provisioned throughput + settings to be applied to a global secondary index. + """ + +@dataclass(kw_only=True) +class UpdateGlobalTableInput(_SerdeShape): + """Dataclass for UpdateGlobalTableInput structure.""" + + global_table_name: str | None = ... + """The global table name.""" + replica_updates: list[ReplicaUpdate] | None = ... + """A list of Regions that should be added or removed from the global table.""" + +@dataclass(kw_only=True) +class UpdateGlobalTableOutput(_SerdeShape): + """Dataclass for UpdateGlobalTableOutput structure.""" + + global_table_description: GlobalTableDescription | None = ... + """Contains the details of the global table.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateGlobalTableSettingsInput(_SerdeShape): + """Dataclass for UpdateGlobalTableSettingsInput structure.""" + + global_table_name: str | None = ... + """The name of the global table""" + global_table_billing_mode: str | None = ... + """ + The billing mode of the global table. If `GlobalTableBillingMode` is not + specified, the global table defaults to `PROVISIONED` capacity billing + mode. + + - `PROVISIONED` - We recommend using `PROVISIONED` for predictable + workloads. `PROVISIONED` sets the billing mode to [Provisioned + capacity + mode](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/provisioned-capacity-mode.html). + + - `PAY_PER_REQUEST` - We recommend using `PAY_PER_REQUEST` for + unpredictable workloads. `PAY_PER_REQUEST` sets the billing mode to + [On-demand capacity + mode](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/on-demand-capacity-mode.html). + """ + global_table_provisioned_write_capacity_units: int | None = ... + """ + The maximum number of writes consumed per second before DynamoDB returns + a `ThrottlingException.` + """ + global_table_provisioned_write_capacity_auto_scaling_settings_update: ( + AutoScalingSettingsUpdate | None + ) = ... + """ + Auto scaling settings for managing provisioned write capacity for the + global table. + """ + global_table_global_secondary_index_settings_update: ( + list[GlobalTableGlobalSecondaryIndexSettingsUpdate] | None + ) = ... + """ + Represents the settings of a global secondary index for a global table + that will be modified. + """ + replica_settings_update: list[ReplicaSettingsUpdate] | None = ... + """ + Represents the settings for a global table in a Region that will be + modified. + """ + +@dataclass(kw_only=True) +class UpdateGlobalTableSettingsOutput(_SerdeShape): + """Dataclass for UpdateGlobalTableSettingsOutput structure.""" + + global_table_name: str | None = ... + """The name of the global table.""" + replica_settings: list[ReplicaSettingsDescription] | None = ... + """The Region-specific settings for the global table.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateItemInput(_SerdeShape): + """Represents the input of an `UpdateItem` operation.""" + + table_name: str | None = ... + """ + The name of the table containing the item to update. You can also + provide the Amazon Resource Name (ARN) of the table in this parameter. + """ + key: dict[str, AttributeValue] | None = ... + """ + The primary key of the item to be updated. Each element consists of an + attribute name and a value for that attribute. + + For the primary key, you must provide all of the attributes. For + example, with a simple primary key, you only need to provide a value for + the partition key. For a composite primary key, you must provide values + for both the partition key and the sort key. + """ + attribute_updates: dict[str, AttributeValueUpdate] | None = ... + """ + This is a legacy parameter. Use `UpdateExpression` instead. For more + information, see + [AttributeUpdates](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.AttributeUpdates.html) + in the *Amazon DynamoDB Developer Guide*. + """ + expected: dict[str, ExpectedAttributeValue] | None = ... + """ + This is a legacy parameter. Use `ConditionExpression` instead. For more + information, see + [Expected](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.Expected.html) + in the *Amazon DynamoDB Developer Guide*. + """ + conditional_operator: str | None = ... + """ + This is a legacy parameter. Use `ConditionExpression` instead. For more + information, see + [ConditionalOperator](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.ConditionalOperator.html) + in the *Amazon DynamoDB Developer Guide*. + """ + return_values: str | None = ... + """ + Use `ReturnValues` if you want to get the item attributes as they appear + before or after they are successfully updated. For `UpdateItem`, the + valid values are: + + - `NONE` - If `ReturnValues` is not specified, or if its value is + `NONE`, then nothing is returned. (This setting is the default for + `ReturnValues`.) + + - `ALL_OLD` - Returns all of the attributes of the item, as they + appeared before the UpdateItem operation. + + - `UPDATED_OLD` - Returns only the updated attributes, as they appeared + before the UpdateItem operation. + + - `ALL_NEW` - Returns all of the attributes of the item, as they appear + after the UpdateItem operation. + + - `UPDATED_NEW` - Returns only the updated attributes, as they appear + after the UpdateItem operation. + + There is no additional cost associated with requesting a return value + aside from the small network and processing overhead of receiving a + larger response. No read capacity units are consumed. + + The values returned are strongly consistent. + """ + return_consumed_capacity: str | None = ... + """ + Determines the level of detail about either provisioned or on-demand + throughput consumption that is returned in the response: + + - `INDEXES` - The response includes the aggregate `ConsumedCapacity` for + the operation, together with `ConsumedCapacity` for each table and + secondary index that was accessed. + + Note that some operations, such as `GetItem` and `BatchGetItem`, do + not access any indexes at all. In these cases, specifying `INDEXES` + will only return `ConsumedCapacity` information for table(s). + + - `TOTAL` - The response includes only the aggregate `ConsumedCapacity` + for the operation. + + - `NONE` - No `ConsumedCapacity` details are included in the response. + """ + return_item_collection_metrics: str | None = ... + """ + Determines whether item collection metrics are returned. If set to + `SIZE`, the response includes statistics about item collections, if any, + that were modified during the operation are returned in the response. If + set to `NONE` (the default), no statistics are returned. + """ + update_expression: str | None = ... + """ + An expression that defines one or more attributes to be updated, the + action to be performed on them, and new values for them. + + The following action values are available for `UpdateExpression`. + + - `SET` - Adds one or more attributes and values to an item. If any of + these attributes already exist, they are replaced by the new values. + You can also use `SET` to add or subtract from an attribute that is of + type Number. For example: `SET myNum = myNum + :val` + + `SET` supports the following functions: + + - `if_not_exists (path, operand)` - if the item does not contain an + attribute at the specified path, then `if_not_exists` evaluates to + operand; otherwise, it evaluates to path. You can use this function + to avoid overwriting an attribute that may already be present in the + item. + + - `list_append (operand, operand)` - evaluates to a list with a new + element added to it. You can append the new element to the start or + the end of the list by reversing the order of the operands. + + These function names are case-sensitive. + + - `REMOVE` - Removes one or more attributes from an item. + + - `ADD` - Adds the specified value to the item, if the attribute does + not already exist. If the attribute does exist, then the behavior of + `ADD` depends on the data type of the attribute: + + - If the existing attribute is a number, and if `Value` is also a + number, then `Value` is mathematically added to the existing + attribute. If `Value` is a negative number, then it is subtracted + from the existing attribute. + + Note: + If you use `ADD` to increment or decrement a number value for an + item that doesn't exist before the update, DynamoDB uses `0` as the + initial value. + + Similarly, if you use `ADD` for an existing item to increment or + decrement an attribute value that doesn't exist before the update, + DynamoDB uses `0` as the initial value. For example, suppose that + the item you want to update doesn't have an attribute named + `itemcount`, but you decide to `ADD` the number `3` to this + attribute anyway. DynamoDB will create the `itemcount` attribute, + set its initial value to `0`, and finally add `3` to it. The result + will be a new `itemcount` attribute in the item, with a value of + `3`. + + - If the existing data type is a set and if `Value` is also a set, + then `Value` is added to the existing set. For example, if the + attribute value is the set `[1,2]`, and the `ADD` action specified + `[3]`, then the final attribute value is `[1,2,3]`. An error occurs + if an `ADD` action is specified for a set attribute and the + attribute type specified does not match the existing set type. + + Both sets must have the same primitive data type. For example, if + the existing data type is a set of strings, the `Value` must also be + a set of strings. + + Warning: + The `ADD` action only supports Number and set data types. + + - `DELETE` - Deletes an element from a set. + + If a set of values is specified, then those values are subtracted from + the old set. For example, if the attribute value was the set `[a,b,c]` + and the `DELETE` action specifies `[a,c]`, then the final attribute + value is `[b]`. Specifying an empty set is an error. + + Warning: + The `DELETE` action only supports set data types. + + You can have many actions in a single expression, such as the following: + `SET a=:value1, b=:value2 DELETE :value3, :value4, :value5` + + For more information on update expressions, see [Modifying Items and + Attributes](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.Modifying.html) + in the *Amazon DynamoDB Developer Guide*. + """ + condition_expression: str | None = ... + """ + A condition that must be satisfied in order for a conditional update to + succeed. + + An expression can contain any of the following: + + - Functions: + `attribute_exists | attribute_not_exists | attribute_type | contains | begins_with | size` + + These function names are case-sensitive. + + - Comparison operators: `= | <> | < | > | <= | >= | BETWEEN | IN ` + + - Logical operators: `AND | OR | NOT` + + For more information about condition expressions, see [Specifying + Conditions](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html) + in the *Amazon DynamoDB Developer Guide*. + """ + expression_attribute_names: dict[str, str] | None = ... + """ + One or more substitution tokens for attribute names in an expression. + The following are some use cases for using `ExpressionAttributeNames`: + + - To access an attribute whose name conflicts with a DynamoDB reserved + word. + + - To create a placeholder for repeating occurrences of an attribute name + in an expression. + + - To prevent special characters in an attribute name from being + misinterpreted in an expression. + + Use the **#** character in an expression to dereference an attribute + name. For example, consider the following attribute name: + + - `Percentile` + + The name of this attribute conflicts with a reserved word, so it cannot + be used directly in an expression. (For the complete list of reserved + words, see [Reserved + Words](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html) + in the *Amazon DynamoDB Developer Guide*.) To work around this, you + could specify the following for `ExpressionAttributeNames`: + + - `{"#P":"Percentile"}` + + You could then use this substitution in an expression, as in this + example: + + - `#P = :val` + + Note: + Tokens that begin with the **:** character are *expression attribute + values*, which are placeholders for the actual value at runtime. + + For more information about expression attribute names, see [Specifying + Item + Attributes](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) + in the *Amazon DynamoDB Developer Guide*. + """ + expression_attribute_values: dict[str, AttributeValue] | None = ... + """ + One or more values that can be substituted in an expression. + + Use the **:** (colon) character in an expression to dereference an + attribute value. For example, suppose that you wanted to check whether + the value of the `ProductStatus` attribute was one of the following: + + `Available | Backordered | Discontinued` + + You would first need to specify `ExpressionAttributeValues` as follows: + + `{ ":avail":{"S":"Available"}, ":back":{"S":"Backordered"}, ":disc":{"S":"Discontinued"} }` + + You could then use these values in an expression, such as this: + + `ProductStatus IN (:avail, :back, :disc)` + + For more information on expression attribute values, see [Condition + Expressions](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html) + in the *Amazon DynamoDB Developer Guide*. + """ + return_values_on_condition_check_failure: str | None = ... + """ + An optional parameter that returns the item attributes for an + `UpdateItem` operation that failed a condition check. + + There is no additional cost associated with requesting a return value + aside from the small network and processing overhead of receiving a + larger response. No read capacity units are consumed. + """ + +@dataclass(kw_only=True) +class UpdateItemOutput(_SerdeShape): + """Represents the output of an `UpdateItem` operation.""" + + attributes: dict[str, AttributeValue] | None = ... + """ + A map of attribute values as they appear before or after the + `UpdateItem` operation, as determined by the `ReturnValues` parameter. + + The `Attributes` map is only present if the update was successful and + `ReturnValues` was specified as something other than `NONE` in the + request. Each element represents one attribute. + """ + consumed_capacity: ConsumedCapacity | None = ... + """ + The capacity units consumed by the `UpdateItem` operation. The data + returned includes the total provisioned throughput consumed, along with + statistics for the table and any indexes involved in the operation. + `ConsumedCapacity` is only returned if the `ReturnConsumedCapacity` + parameter was specified. For more information, see [Capacity unity + consumption for write + operations](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/read-write-operations.html#write-operation-consumption) + in the *Amazon DynamoDB Developer Guide*. + + If the table has vector indexes, the response includes a `VectorIndexes` + field with `VectorWriteRequestBytes` consumed for each affected vector + index. + """ + item_collection_metrics: ItemCollectionMetrics | None = ... + """ + Information about item collections, if any, that were affected by the + `UpdateItem` operation. `ItemCollectionMetrics` is only returned if the + `ReturnItemCollectionMetrics` parameter was specified. If the table does + not have any local secondary indexes, this information is not returned + in the response. + + Each `ItemCollectionMetrics` element consists of: + + - `ItemCollectionKey` - The partition key value of the item collection. + This is the same as the partition key value of the item itself. + + - `SizeEstimateRangeGB` - An estimate of item collection size, in + gigabytes. This value is a two-element array containing a lower bound + and an upper bound for the estimate. The estimate includes the size of + all the items in the table, plus the size of all attributes projected + into all of the local secondary indexes on that table. Use this + estimate to measure whether a local secondary index is approaching its + size limit. + + The estimate is subject to change over time; therefore, do not rely on + the precision or accuracy of the estimate. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateKinesisStreamingConfiguration(_SerdeShape): + """Enables updating the configuration for Kinesis Streaming.""" + + approximate_creation_date_time_precision: str | None = ... + """Enables updating the precision of Kinesis data stream timestamp.""" + +@dataclass(kw_only=True) +class UpdateKinesisStreamingDestinationInput(_SerdeShape): + """Dataclass for UpdateKinesisStreamingDestinationInput structure.""" + + table_name: str | None = ... + """ + The table name for the Kinesis streaming destination input. You can also + provide the ARN of the table in this parameter. + """ + stream_arn: str | None = ... + """The Amazon Resource Name (ARN) for the Kinesis stream input.""" + update_kinesis_streaming_configuration: ( + UpdateKinesisStreamingConfiguration | None + ) = ... + """The command to update the Kinesis stream configuration.""" + +@dataclass(kw_only=True) +class UpdateKinesisStreamingDestinationOutput(_SerdeShape): + """Dataclass for UpdateKinesisStreamingDestinationOutput structure.""" + + table_name: str | None = ... + """The table name for the Kinesis streaming destination output.""" + stream_arn: str | None = ... + """The ARN for the Kinesis stream input.""" + destination_status: str | None = ... + """ + The status of the attempt to update the Kinesis streaming destination + output. + """ + update_kinesis_streaming_configuration: ( + UpdateKinesisStreamingConfiguration | None + ) = ... + """The command to update the Kinesis streaming destination configuration.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateReplicationGroupMemberAction(_SerdeShape): + """Represents a replica to be modified.""" + + region_name: str + """The Region where the replica exists.""" + kms_master_key_id: str | None = ... + """ + The KMS key of the replica that should be used for KMS encryption. To + specify a key, use its key ID, Amazon Resource Name (ARN), alias name, + or alias ARN. Note that you should only provide this parameter if the + key is different from the default DynamoDB KMS key `alias/aws/dynamodb`. + """ + provisioned_throughput_override: ProvisionedThroughputOverride | None = ... + """ + Replica-specific provisioned throughput. If not specified, uses the + source table's provisioned throughput settings. + """ + on_demand_throughput_override: OnDemandThroughputOverride | None = ... + """Overrides the maximum on-demand throughput for the replica table.""" + global_secondary_indexes: list[ReplicaGlobalSecondaryIndex] | None = ... + """Replica-specific global secondary index settings.""" + table_class_override: str | None = ... + """ + Replica-specific table class. If not specified, uses the source table's + table class. + """ + +@dataclass(kw_only=True) +class UpdateTableInput(_SerdeShape): + """Represents the input of an `UpdateTable` operation.""" + + attribute_definitions: list[AttributeDefinition] | None = ... + """ + An array of attributes that describe the key schema for the table and + indexes. If you are adding a new global secondary index to the table, + `AttributeDefinitions` must include the key element(s) of the new index. + """ + table_name: str | None = ... + """ + The name of the table to be updated. You can also provide the Amazon + Resource Name (ARN) of the table in this parameter. + """ + billing_mode: str | None = ... + """ + Controls how you are charged for read and write throughput and how you + manage capacity. When switching from pay-per-request to provisioned + capacity, initial provisioned capacity values must be set. The initial + provisioned capacity values are estimated based on the consumed read and + write capacity of your table and global secondary indexes over the past + 30 minutes. + + - `PAY_PER_REQUEST` - We recommend using `PAY_PER_REQUEST` for most + DynamoDB workloads. `PAY_PER_REQUEST` sets the billing mode to + [On-demand capacity + mode](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/on-demand-capacity-mode.html). + + - `PROVISIONED` - We recommend using `PROVISIONED` for steady workloads + with predictable growth where capacity requirements can be reliably + forecasted. `PROVISIONED` sets the billing mode to [Provisioned + capacity + mode](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/provisioned-capacity-mode.html). + """ + provisioned_throughput: ProvisionedThroughput | None = ... + """ + The new provisioned throughput settings for the specified table or + index. + """ + global_secondary_index_updates: list[GlobalSecondaryIndexUpdate] | None = ... + """ + An array of one or more global secondary indexes for the table. For each + index in the array, you can request one action: + + - `Create` - add a new global secondary index to the table. + + - `Update` - modify the provisioned throughput settings of an existing + global secondary index. + + - `Delete` - remove a global secondary index from the table. + + You can create or delete only one global secondary index per + `UpdateTable` operation. + + For more information, see [Managing Global Secondary + Indexes](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GSI.OnlineOps.html) + in the *Amazon DynamoDB Developer Guide*. + """ + stream_specification: StreamSpecification | None = ... + """ + Represents the DynamoDB Streams configuration for the table. + + Note: + You receive a `ValidationException` if you try to enable a stream on a + table that already has a stream, or if you try to disable a stream on a + table that doesn't have a stream. + """ + sse_specification: SSESpecification | None = ... + """The new server-side encryption settings for the specified table.""" + replica_updates: list[ReplicationGroupUpdate] | None = ... + """ + A list of replica update actions (create, delete, or update) for the + table. + """ + table_class: str | None = ... + """ + The table class of the table to be updated. Valid values are `STANDARD` + and `STANDARD_INFREQUENT_ACCESS`. + """ + deletion_protection_enabled: bool | None = ... + """ + Indicates whether deletion protection is to be enabled (true) or + disabled (false) on the table. + """ + multi_region_consistency: str | None = ... + """ + Specifies the consistency mode for a new global table. This parameter is + only valid when you create a global table by specifying one or more + [Create](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ReplicationGroupUpdate.html#DDB-Type-ReplicationGroupUpdate-Create) + actions in the + [ReplicaUpdates](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_UpdateTable.html#DDB-UpdateTable-request-ReplicaUpdates) + action list. + + You can specify one of the following consistency modes: + + - `EVENTUAL`: Configures a new global table for multi-Region eventual + consistency (MREC). This is the default consistency mode for global + tables. + + - `STRONG`: Configures a new global table for multi-Region strong + consistency (MRSC). + + If you don't specify this field, the global table consistency mode + defaults to `EVENTUAL`. For more information about global tables + consistency modes, see [Consistency + modes](https://docs.aws.amazon.com/V2globaltables_HowItWorks.html#V2globaltables_HowItWorks.consistency-modes) + in DynamoDB developer guide. + """ + global_table_witness_updates: list[GlobalTableWitnessGroupUpdate] | None = ... + """ + A list of witness updates for a MRSC global table. A witness provides a + cost-effective alternative to a full replica in a MRSC global table by + maintaining replicated change data written to global table replicas. You + cannot perform read or write operations on a witness. For each witness, + you can request one action: + + - `Create` - add a new witness to the global table. + + - `Delete` - remove a witness from the global table. + + You can create or delete only one witness per `UpdateTable` operation. + + For more information, see [Multi-Region strong consistency + (MRSC)](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/V2globaltables_HowItWorks.html#V2globaltables_HowItWorks.consistency-modes) + in the Amazon DynamoDB Developer Guide + """ + on_demand_throughput: OnDemandThroughput | None = ... + """ + Updates the maximum number of read and write units for the specified + table in on-demand capacity mode. If you use this parameter, you must + specify `MaxReadRequestUnits`, `MaxWriteRequestUnits`, or both. + """ + warm_throughput: WarmThroughput | None = ... + """ + Represents the warm throughput (in read units per second and write units + per second) for updating a table. + """ + global_table_settings_replication_mode: str | None = ... + """ + Controls the settings replication mode for a global table replica. This + attribute can be defined using UpdateTable operation only on a regional + table with values: + + - `ENABLED`: Defines settings replication on a regional table to be used + as a source table for creating Multi-Account Global Table. + + - `DISABLED`: Remove settings replication on a regional table. Settings + replication needs to be defined to ENABLED again in order to create a + Multi-Account Global Table using this table. + """ + vector_index_updates: list[VectorIndexUpdate] | None = ... + """ + A list of vector indexes to be added to or removed from the table. You + can add or remove one vector index for each `UpdateTable` operation. + + To add a vector index, specify `IndexName`, `VectorAttribute`, + `Dimensions`, `DistanceFunction`, and `Projection`. To remove a vector + index, specify only the `IndexName`. + """ + +@dataclass(kw_only=True) +class UpdateTableOutput(_SerdeShape): + """Represents the output of an `UpdateTable` operation.""" + + table_description: TableDescription | None = ... + """Represents the properties of the table.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateTableReplicaAutoScalingInput(_SerdeShape): + """Dataclass for UpdateTableReplicaAutoScalingInput structure.""" + + global_secondary_index_updates: ( + list[GlobalSecondaryIndexAutoScalingUpdate] | None + ) = ... + """ + Represents the auto scaling settings of the global secondary indexes of + the replica to be updated. + """ + table_name: str | None = ... + """ + The name of the global table to be updated. You can also provide the + Amazon Resource Name (ARN) of the table in this parameter. + """ + provisioned_write_capacity_auto_scaling_update: ( + AutoScalingSettingsUpdate | None + ) = ... + """ + Represents the auto scaling settings to be modified for a global table + or global secondary index. + """ + replica_updates: list[ReplicaAutoScalingUpdate] | None = ... + """ + Represents the auto scaling settings of replicas of the table that will + be modified. + """ + +@dataclass(kw_only=True) +class UpdateTableReplicaAutoScalingOutput(_SerdeShape): + """Dataclass for UpdateTableReplicaAutoScalingOutput structure.""" + + table_auto_scaling_description: TableAutoScalingDescription | None = ... + """ + Returns information about the auto scaling settings of a table with + replicas. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateTimeToLiveInput(_SerdeShape): + """Represents the input of an `UpdateTimeToLive` operation.""" + + table_name: str | None = ... + """ + The name of the table to be configured. You can also provide the Amazon + Resource Name (ARN) of the table in this parameter. + """ + time_to_live_specification: TimeToLiveSpecification | None = ... + """ + Represents the settings used to enable or disable Time to Live for the + specified table. + """ + +@dataclass(kw_only=True) +class UpdateTimeToLiveOutput(_SerdeShape): + """Dataclass for UpdateTimeToLiveOutput structure.""" + + time_to_live_specification: TimeToLiveSpecification | None = ... + """Represents the output of an `UpdateTimeToLive` operation.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class VectorAttributeDefinition(_SerdeShape): + """The definition of a vector attribute for a vector index.""" + + attribute_name: str + """The name of the vector attribute.""" + +@dataclass(kw_only=True) +class VectorCapacity(_SerdeShape): + """ + The consumed capacity for vector index operations, including vector + search request bytes and vector write request bytes. + """ + + vector_search_request_bytes: float | None = ... + """ + The number of vector search request bytes consumed by a `SearchVectors` + operation. + """ + vector_write_request_bytes: float | None = ... + """ + The number of vector write request bytes consumed when writing to a + vector index. Reported for write operations that modify attributes + indexed by a vector index. + """ + +class VectorDistanceFunction(UnknownEnumMixin, StrEnum): + COSINE = "COSINE" + DOT_PRODUCT = "DOT_PRODUCT" + EUCLIDEAN = "EUCLIDEAN" + +@dataclass(kw_only=True) +class VectorIndex(_SerdeShape): + """ + Contains the configuration settings for a vector index, including the + index name, vector attribute, dimensions, distance function, search + schema, and projection. + """ + + index_name: str + """The name of the vector index.""" + vector_attribute: VectorAttributeDefinition + """The vector attribute configuration for the index.""" + search_schema: list[SearchSchemaElement] | None = ... + """ + The search schema that defines partition key and inline filter + attributes for the vector index. + """ + projection: Projection + """ + Specifies attributes that are copied (projected) from the table into the + vector index. + """ + dimensions: int + """The number of dimensions in each vector.""" + distance_function: str + """ + The distance function used to calculate similarity between vectors. + Valid values: `COSINE`, `EUCLIDEAN`, `DOT_PRODUCT`. + """ + +@dataclass(kw_only=True) +class VectorIndexDescription(_SerdeShape): + """ + Contains the current state and configuration of a vector index, + including its status, size, item count, and the settings specified when + the index was created. + """ + + index_name: str | None = ... + """The name of the vector index.""" + search_schema: list[SearchSchemaElement] | None = ... + """ + The search schema that defines partition key and inline filter + attributes for the vector index. + """ + projection: Projection | None = ... + """ + Specifies attributes that are copied (projected) from the table into the + vector index. + """ + vector_attribute: VectorAttributeDefinition | None = ... + """The vector attribute configuration for the index.""" + dimensions: int | None = ... + """The number of dimensions in each vector.""" + distance_function: str | None = ... + """The distance function used to calculate similarity between vectors.""" + index_status: str | None = ... + """ + The current state of the vector index: + + - `CREATING` - The index is being created. + + - `ACTIVE` - The index is ready for use. + + - `DELETING` - The index is being deleted. + """ + backfilling: bool | None = ... + """ + Specifies whether the index is currently backfilling. During backfill, + `SearchVectors` operations might return incomplete results. + """ + index_size_bytes: int | None = ... + """ + The total size of the vector index, in bytes. Amazon DynamoDB updates + this value approximately every six hours. Recent changes might not be + reflected in this value. + """ + item_count: int | None = ... + """ + The number of items indexed in the vector index. Amazon DynamoDB updates + this value approximately every six hours. Recent changes might not be + reflected in this value. + """ + index_arn: str | None = ... + """ + The Amazon Resource Name (ARN) that uniquely identifies the vector + index. + """ + +@dataclass(kw_only=True) +class VectorIndexInfo(_SerdeShape): + """ + Contains the configuration of a vector index as it existed at the time a + backup was created. + """ + + index_name: str | None = ... + """The name of the vector index.""" + vector_attribute: VectorAttributeDefinition | None = ... + """The vector attribute configuration for the index.""" + search_schema: list[SearchSchemaElement] | None = ... + """ + The search schema that defines partition key and inline filter + attributes for the vector index. + """ + projection: Projection | None = ... + """ + Specifies attributes that are copied (projected) from the table into the + vector index. + """ + dimensions: int | None = ... + """The number of dimensions in each vector.""" + distance_function: str | None = ... + """The distance function used to calculate similarity between vectors.""" + +@dataclass(kw_only=True) +class VectorIndexUpdate(_SerdeShape): + """A vector index to be added to or removed from a table.""" + + create: CreateVectorIndexAction | None = ... + """The configuration for creating a new vector index on the table.""" + delete: DeleteVectorIndexAction | None = ... + """The configuration for deleting an existing vector index from the table.""" + +@dataclass(kw_only=True) +class WarmThroughput(_SerdeShape): + """ + Provides visibility into the number of read and write operations your + table or secondary index can instantaneously support. The settings can + be modified using the `UpdateTable` operation to meet the throughput + requirements of an upcoming peak event. + """ + + read_units_per_second: int | None = ... + """ + Represents the number of read operations your base table can + instantaneously support. + """ + write_units_per_second: int | None = ... + """ + Represents the number of write operations your base table can + instantaneously support. + """ + +class WitnessStatus(UnknownEnumMixin, StrEnum): + CREATING = "CREATING" + DELETING = "DELETING" + ACTIVE = "ACTIVE" + +@dataclass(kw_only=True) +class WriteRequest(_SerdeShape): + """ + Represents an operation to perform - either `DeleteItem` or `PutItem`. + You can only request one of these operations, not both, in a single + `WriteRequest`. If you do need to perform both of these operations, you + need to provide two separate `WriteRequest` objects. + """ + + put_request: PutRequest | None = ... + """A request to perform a `PutItem` operation.""" + delete_request: DeleteRequest | None = ... + """A request to perform a `DeleteItem` operation.""" + +BATCH_EXECUTE_STATEMENT: APIOperation[ + BatchExecuteStatementInput, BatchExecuteStatementOutput +] +BATCH_GET_ITEM: APIOperation[BatchGetItemInput, BatchGetItemOutput] +BATCH_WRITE_ITEM: APIOperation[BatchWriteItemInput, BatchWriteItemOutput] +CREATE_BACKUP: APIOperation[CreateBackupInput, CreateBackupOutput] +CREATE_GLOBAL_TABLE: APIOperation[CreateGlobalTableInput, CreateGlobalTableOutput] +CREATE_TABLE: APIOperation[CreateTableInput, CreateTableOutput] +DELETE_BACKUP: APIOperation[DeleteBackupInput, DeleteBackupOutput] +DELETE_ITEM: APIOperation[DeleteItemInput, DeleteItemOutput] +DELETE_RESOURCE_POLICY: APIOperation[ + DeleteResourcePolicyInput, DeleteResourcePolicyOutput +] +DELETE_TABLE: APIOperation[DeleteTableInput, DeleteTableOutput] +DESCRIBE_BACKUP: APIOperation[DescribeBackupInput, DescribeBackupOutput] +DESCRIBE_CONTINUOUS_BACKUPS: APIOperation[ + DescribeContinuousBackupsInput, DescribeContinuousBackupsOutput +] +DESCRIBE_CONTRIBUTOR_INSIGHTS: APIOperation[ + DescribeContributorInsightsInput, DescribeContributorInsightsOutput +] +DESCRIBE_ENDPOINTS: APIOperation[DescribeEndpointsInput, DescribeEndpointsOutput] +DESCRIBE_EXPORT: APIOperation[DescribeExportInput, DescribeExportOutput] +DESCRIBE_GLOBAL_TABLE: APIOperation[DescribeGlobalTableInput, DescribeGlobalTableOutput] +DESCRIBE_GLOBAL_TABLE_SETTINGS: APIOperation[ + DescribeGlobalTableSettingsInput, DescribeGlobalTableSettingsOutput +] +DESCRIBE_IMPORT: APIOperation[DescribeImportInput, DescribeImportOutput] +DESCRIBE_KINESIS_STREAMING_DESTINATION: APIOperation[ + DescribeKinesisStreamingDestinationInput, DescribeKinesisStreamingDestinationOutput +] +DESCRIBE_LIMITS: APIOperation[DescribeLimitsInput, DescribeLimitsOutput] +DESCRIBE_TABLE: APIOperation[DescribeTableInput, DescribeTableOutput] +DESCRIBE_TABLE_REPLICA_AUTO_SCALING: APIOperation[ + DescribeTableReplicaAutoScalingInput, DescribeTableReplicaAutoScalingOutput +] +DESCRIBE_TIME_TO_LIVE: APIOperation[DescribeTimeToLiveInput, DescribeTimeToLiveOutput] +DISABLE_KINESIS_STREAMING_DESTINATION: APIOperation[ + DisableKinesisStreamingDestinationInput, DisableKinesisStreamingDestinationOutput +] +ENABLE_KINESIS_STREAMING_DESTINATION: APIOperation[ + EnableKinesisStreamingDestinationInput, EnableKinesisStreamingDestinationOutput +] +EXECUTE_STATEMENT: APIOperation[ExecuteStatementInput, ExecuteStatementOutput] +EXECUTE_TRANSACTION: APIOperation[ExecuteTransactionInput, ExecuteTransactionOutput] +EXPORT_TABLE_TO_POINT_IN_TIME: APIOperation[ + ExportTableToPointInTimeInput, ExportTableToPointInTimeOutput +] +GET_ITEM: APIOperation[GetItemInput, GetItemOutput] +GET_RESOURCE_POLICY: APIOperation[GetResourcePolicyInput, GetResourcePolicyOutput] +IMPORT_TABLE: APIOperation[ImportTableInput, ImportTableOutput] +LIST_BACKUPS: APIOperation[ListBackupsInput, ListBackupsOutput] +LIST_CONTRIBUTOR_INSIGHTS: APIOperation[ + ListContributorInsightsInput, ListContributorInsightsOutput +] +LIST_EXPORTS: APIOperation[ListExportsInput, ListExportsOutput] +LIST_GLOBAL_TABLES: APIOperation[ListGlobalTablesInput, ListGlobalTablesOutput] +LIST_IMPORTS: APIOperation[ListImportsInput, ListImportsOutput] +LIST_TABLES: APIOperation[ListTablesInput, ListTablesOutput] +LIST_TAGS_OF_RESOURCE: APIOperation[ListTagsOfResourceInput, ListTagsOfResourceOutput] +PUT_ITEM: APIOperation[PutItemInput, PutItemOutput] +PUT_RESOURCE_POLICY: APIOperation[PutResourcePolicyInput, PutResourcePolicyOutput] +QUERY: APIOperation[QueryInput, QueryOutput] +RESTORE_TABLE_FROM_BACKUP: APIOperation[ + RestoreTableFromBackupInput, RestoreTableFromBackupOutput +] +RESTORE_TABLE_TO_POINT_IN_TIME: APIOperation[ + RestoreTableToPointInTimeInput, RestoreTableToPointInTimeOutput +] +SCAN: APIOperation[ScanInput, ScanOutput] +SEARCH_VECTORS: APIOperation[SearchVectorsInput, SearchVectorsOutput] +TAG_RESOURCE: APIOperation[TagResourceInput, TagResourceOutput] +TRANSACT_GET_ITEMS: APIOperation[TransactGetItemsInput, TransactGetItemsOutput] +TRANSACT_WRITE_ITEMS: APIOperation[TransactWriteItemsInput, TransactWriteItemsOutput] +UNTAG_RESOURCE: APIOperation[UntagResourceInput, UntagResourceOutput] +UPDATE_CONTINUOUS_BACKUPS: APIOperation[ + UpdateContinuousBackupsInput, UpdateContinuousBackupsOutput +] +UPDATE_CONTRIBUTOR_INSIGHTS: APIOperation[ + UpdateContributorInsightsInput, UpdateContributorInsightsOutput +] +UPDATE_GLOBAL_TABLE: APIOperation[UpdateGlobalTableInput, UpdateGlobalTableOutput] +UPDATE_GLOBAL_TABLE_SETTINGS: APIOperation[ + UpdateGlobalTableSettingsInput, UpdateGlobalTableSettingsOutput +] +UPDATE_ITEM: APIOperation[UpdateItemInput, UpdateItemOutput] +UPDATE_KINESIS_STREAMING_DESTINATION: APIOperation[ + UpdateKinesisStreamingDestinationInput, UpdateKinesisStreamingDestinationOutput +] +UPDATE_TABLE: APIOperation[UpdateTableInput, UpdateTableOutput] +UPDATE_TABLE_REPLICA_AUTO_SCALING: APIOperation[ + UpdateTableReplicaAutoScalingInput, UpdateTableReplicaAutoScalingOutput +] +UPDATE_TIME_TO_LIVE: APIOperation[UpdateTimeToLiveInput, UpdateTimeToLiveOutput] diff --git a/clients/aws-sdk-dynamodb/src/aws_sdk_dynamodb/retries.py b/clients/aws-sdk-dynamodb/src/aws_sdk_dynamodb/retries.py index 2ee0fc76..e627f71c 100644 --- a/clients/aws-sdk-dynamodb/src/aws_sdk_dynamodb/retries.py +++ b/clients/aws-sdk-dynamodb/src/aws_sdk_dynamodb/retries.py @@ -1,7 +1,10 @@ # Code generated by smithy-python-codegen DO NOT EDIT. from smithy_aws_core.config import ConfigSource -from smithy_core.aio.retries import StandardRetryStrategy +from smithy_core.aio.retries import ( + AsyncAdaptiveRetryStrategy, + AsyncStandardRetryStrategy, +) from smithy_core.retries import ( ExponentialBackoffJitterType, ExponentialRetryBackoffStrategy, @@ -17,7 +20,7 @@ def dynamodb_retry_plugin(config: AsyncDynamoDBConfig) -> None: - """Apply DynamoDB's standard-mode retry defaults for any option left unset.""" + """Apply DynamoDB's standard and adaptive mode retry defaults for any option left unset.""" retry_strategy = config.retry_strategy if retry_strategy is not None and not isinstance( retry_strategy, RetryStrategyOptions @@ -35,10 +38,15 @@ def dynamodb_retry_plugin(config: AsyncDynamoDBConfig) -> None: if config.source_of("max_attempts") == ConfigSource.DEFAULT: max_attempts = None - if retry_mode != "standard": + if retry_mode not in ("standard", "adaptive"): return - config.retry_strategy = StandardRetryStrategy( + strategy_cls = ( + AsyncAdaptiveRetryStrategy + if retry_mode == "adaptive" + else AsyncStandardRetryStrategy + ) + config.retry_strategy = strategy_cls( max_attempts=( max_attempts if max_attempts is not None else _DYNAMODB_DEFAULT_MAX_ATTEMPTS ), diff --git a/clients/aws-sdk-guardduty/scripts/docs/generate_doc_stubs.py b/clients/aws-sdk-guardduty/scripts/docs/generate_doc_stubs.py index 52d470bc..795f2e4b 100644 --- a/clients/aws-sdk-guardduty/scripts/docs/generate_doc_stubs.py +++ b/clients/aws-sdk-guardduty/scripts/docs/generate_doc_stubs.py @@ -126,7 +126,9 @@ class ClientInfo: class DocStubGenerator: """Generate markdown API Reference stubs for AWS SDK for Python v4 clients.""" - def __init__(self, client_dir: Path, output_dir: Path, service_name: str | None = None) -> None: + def __init__( + self, client_dir: Path, output_dir: Path, service_name: str | None = None + ) -> None: """ Initialize the documentation generator. @@ -190,7 +192,9 @@ def _analyze_client_package(self, package_name: str) -> ClientInfo: required = ("client", "config", "models") missing = [name for name in required if not package.modules.get(name)] if missing: - raise ValueError(f"Missing required modules in {package_name}: {', '.join(missing)}") + raise ValueError( + f"Missing required modules in {package_name}: {', '.join(missing)}" + ) # Parse submodules client_module = package.modules["client"] @@ -199,11 +203,15 @@ def _analyze_client_package(self, package_name: str) -> ClientInfo: client_class = self._find_class_with_suffix(client_module, "Client") if not client_class: - raise ValueError(f"No class ending with 'Client' found in {package_name}.client") + raise ValueError( + f"No class ending with 'Client' found in {package_name}.client" + ) config_class = self._find_class_with_suffix(config_module, "Config") if not config_class: - raise ValueError(f"No class ending with 'Config' found in {package_name}.config") + raise ValueError( + f"No class ending with 'Config' found in {package_name}.config" + ) plugin_alias = config_module.members.get("Plugin") if not plugin_alias: @@ -288,7 +296,9 @@ def _analyze_operation(self, operation: Function) -> OperationInfo: if output_type in stream_type_map: stream_type = stream_type_map[output_type] - stream_args = self._get_subscript_elements(returns, f"'{operation.name}' stream type") + stream_args = self._get_subscript_elements( + returns, f"'{operation.name}' stream type" + ) if stream_type in (StreamType.INPUT, StreamType.DUPLEX): event_input_type = stream_args[0].canonical_name @@ -316,7 +326,9 @@ def _analyze_operation(self, operation: Function) -> OperationInfo: def _get_expr(self, annotation: str | Expr | None, context: str) -> Expr: """Extract and validate an Expr from an annotation.""" if not isinstance(annotation, Expr): - raise TypeError(f"{context}: expected Expr, got {type(annotation).__name__}") + raise TypeError( + f"{context}: expected Expr, got {type(annotation).__name__}" + ) return annotation def _get_subscript_elements(self, expr: Expr, context: str) -> list[Expr]: @@ -330,7 +342,9 @@ def _get_subscript_elements(self, expr: Expr, context: str) -> list[Expr]: return [el for el in slice_expr.elements if isinstance(el, Expr)] return [slice_expr] - def _extract_models(self, models_module: Module, operations: list[OperationInfo]) -> ModelsInfo: + def _extract_models( + self, models_module: Module, operations: list[OperationInfo] + ) -> ModelsInfo: """Extract structures, unions, enums, and errors from models module.""" structures, unions, enums, errors = [], [], [], [] @@ -356,14 +370,16 @@ def _extract_models(self, models_module: Module, operations: list[OperationInfo] duplicates = [] for structure in structures: - if self._is_operation_io_type(structure.name, operations) or self._is_union_member( - structure.name, unions - ): + if self._is_operation_io_type( + structure.name, operations + ) or self._is_union_member(structure.name, unions): duplicates.append(structure) structures = [struct for struct in structures if struct not in duplicates] - return ModelsInfo(structures=structures, unions=unions, enums=enums, errors=errors) + return ModelsInfo( + structures=structures, unions=unions, enums=enums, errors=errors + ) def _is_union(self, member: Object | Alias) -> TypeGuard[Attribute]: """Check if a module member is a union type.""" @@ -399,7 +415,9 @@ def _extract_union_members( for name in member_names: if not (member_object := models_module.members.get(name)): raise ValueError(f"Union member '{name}' not found in models module") - members.append(TypeInfo(name=member_object.name, module_path=member_object.path)) + members.append( + TypeInfo(name=member_object.name, module_path=member_object.path) + ) return members @@ -408,7 +426,8 @@ def _is_enum(self, member: Object | Alias) -> TypeGuard[Class]: if not isinstance(member, Class): return False return any( - isinstance(base, ExprName) and base.name in ENUM_BASE_CLASSES for base in member.bases + isinstance(base, ExprName) and base.name in ENUM_BASE_CLASSES + for base in member.bases ) def _is_error(self, member: Object | Alias) -> TypeGuard[Class]: @@ -416,10 +435,13 @@ def _is_error(self, member: Object | Alias) -> TypeGuard[Class]: if not isinstance(member, Class): return False return any( - isinstance(base, ExprName) and base.name in ERROR_BASE_CLASSES for base in member.bases + isinstance(base, ExprName) and base.name in ERROR_BASE_CLASSES + for base in member.bases ) - def _is_operation_io_type(self, type_name: str, operations: list[OperationInfo]) -> bool: + def _is_operation_io_type( + self, type_name: str, operations: list[OperationInfo] + ) -> bool: """Check if a type is used as operation input/output.""" return any(type_name in (op.input.name, op.output.name) for op in operations) @@ -437,8 +459,12 @@ def _generate_client_docs(self, client_info: ClientInfo) -> bool: self._generate_type_stubs( client_info.models.structures, "structures", "Structure Class" ) - self._generate_type_stubs(client_info.models.errors, "errors", "Error Class") - self._generate_type_stubs(client_info.models.enums, "enums", "Enum Class", members=True) + self._generate_type_stubs( + client_info.models.errors, "errors", "Error Class" + ) + self._generate_type_stubs( + client_info.models.enums, "enums", "Enum Class", members=True + ) self._generate_union_stubs(client_info.models.unions) except OSError as e: logger.error(f"Failed to write documentation files: {e}") @@ -470,7 +496,9 @@ def _generate_index(self, client_info: ClientInfo) -> None: ] for method in sorted(client_info.client_methods, key=lambda x: x.name): - lines.extend([*self._mkdocs_directive(method.module_path, heading_level=4), ""]) + lines.extend( + [*self._mkdocs_directive(method.module_path, heading_level=4), ""] + ) # Operations section if client_info.operations: @@ -578,7 +606,9 @@ def _generate_operation_stubs(self, operations: list[OperationInfo]) -> None: output_path = self.output_dir / "operations" / f"{op.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb("Operations", op.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb("Operations", op.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(operations)} operation file(s)") @@ -600,7 +630,9 @@ def _generate_type_stubs( output_path = self.output_dir / category / f"{item.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb(category.title(), item.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb(category.title(), item.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(items)} {category} file(s)") @@ -624,7 +656,9 @@ def _generate_union_stubs(self, unions: list[UnionInfo]) -> None: output_path = self.output_dir / "unions" / f"{union.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb("Unions", union.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb("Unions", union.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(unions)} union file(s)") diff --git a/clients/aws-sdk-guardduty/src/aws_sdk_guardduty/_private/schemas.py b/clients/aws-sdk-guardduty/src/aws_sdk_guardduty/_private/schemas.py index 5dcfed97..e998f672 100644 --- a/clients/aws-sdk-guardduty/src/aws_sdk_guardduty/_private/schemas.py +++ b/clients/aws-sdk-guardduty/src/aws_sdk_guardduty/_private/schemas.py @@ -2,16746 +2,11884 @@ from types import MappingProxyType -from smithy_core.prelude import UNIT -from smithy_core.schemas import Schema -from smithy_core.shapes import ShapeID, ShapeType -from smithy_core.traits import Trait - - -STRING = Schema( - id=ShapeID("com.amazonaws.guardduty#String"), shape_type=ShapeType.STRING +from smithy_core._schema_compact import StaticOperationSchema, StaticSchema + + +n0 = "com.amazonaws.guardduty" +_S = "String" +_DI = "DetectorId" +_AAII = "AcceptAdministratorInvitationInput" +_sSI = "smithy.synthetic#originalShapeId" +_cAAIR = "com.amazonaws.guardduty#AcceptAdministratorInvitationRequest" +_s = "smithy.api#input" +_sm = "smithy.api#required" +_sL = "smithy.api#httpLabel" +_AI = "AdministratorId" +_sN = "smithy.api#jsonName" +_aI = "administratorId" +_II = "InvitationId" +_iI = "invitationId" +_AAIO = "AcceptAdministratorInvitationOutput" +_cAAIRo = "com.amazonaws.guardduty#AcceptAdministratorInvitationResponse" +_smi = "smithy.api#output" +_BRE = "BadRequestException" +_smit = "smithy.api#error" +_c = "client" +_sE = "smithy.api#httpError" +_M = "Message" +_m = "message" +_T = "Type" +_t = "type" +_ISEE = "InternalServerErrorException" +_se = "server" +_AAI = "AcceptAdministratorInvitation" +_smith = "smithy.api#http" +_AII = "AcceptInvitationInput" +_cAIR = "com.amazonaws.guardduty#AcceptInvitationRequest" +_MI = "MasterId" +_mI = "masterId" +_AIO = "AcceptInvitationOutput" +_cAIRo = "com.amazonaws.guardduty#AcceptInvitationResponse" +_AIc = "AcceptInvitation" +_B = "Boolean" +_ACL = "AccessControlList" +_APRA = "AllowsPublicReadAccess" +_aPRA = "allowsPublicReadAccess" +_APWA = "AllowsPublicWriteAccess" +_aPWA = "allowsPublicWriteAccess" +_ADE = "AccessDeniedException" +_AK = "AccessKey" +_PI = "PrincipalId" +_pI = "principalId" +_UN = "UserName" +_uN = "userName" +_UT = "UserType" +_uT = "userType" +_AKD = "AccessKeyDetails" +_AKI = "AccessKeyId" +_aKI = "accessKeyId" +_A = "Account" +_U = "Uid" +_u = "uid" +_N = "Name" +_a = "account" +_AIcc = "AccountId" +_E = "Email" +_smithy = "smithy.api#sensitive" +_AD = "AccountDetail" +_aIc = "accountId" +_e = "email" +_ADc = "AccountDetails" +_me = "member" +_I = "Integer" +_DSFT = "DataSourceFreeTrial" +_FTDR = "FreeTrialDaysRemaining" +_fTDR = "freeTrialDaysRemaining" +_KDSFT = "KubernetesDataSourceFreeTrial" +_AL = "AuditLogs" +_aL = "auditLogs" +_MPDSFT = "MalwareProtectionDataSourceFreeTrial" +_SEIWF = "ScanEc2InstanceWithFindings" +_sEIWF = "scanEc2InstanceWithFindings" +_DSFTa = "DataSourcesFreeTrial" +_CT = "CloudTrail" +_cT = "cloudTrail" +_DL = "DnsLogs" +_dL = "dnsLogs" +_FL = "FlowLogs" +_fL = "flowLogs" +_SL = "S3Logs" +_sLo = "s3Logs" +_K = "Kubernetes" +_k = "kubernetes" +_MP = "MalwareProtection" +_mP = "malwareProtection" +_FTFR = "FreeTrialFeatureResult" +_FL_ = "FLOW_LOGS" +_sV = "smithy.api#enumValue" +_CT_ = "CLOUD_TRAIL" +_DL_ = "DNS_LOGS" +_SDE = "S3_DATA_EVENTS" +_EAL = "EKS_AUDIT_LOGS" +_EMP = "EBS_MALWARE_PROTECTION" +_RLE = "RDS_LOGIN_EVENTS" +_LNL = "LAMBDA_NETWORK_LOGS" +_ERM = "EKS_RUNTIME_MONITORING" +_ERM_ = "EC2_RUNTIME_MONITORING" +_FRM = "FARGATE_RUNTIME_MONITORING" +_AP = "AI_PROTECTION" +_FTFCR = "FreeTrialFeatureConfigurationResult" +_n = "name" +_FTFCRr = "FreeTrialFeatureConfigurationsResults" +_AFTI = "AccountFreeTrialInfo" +_DS = "DataSources" +_dS = "dataSources" +_F = "Features" +_f = "features" +_AFTIc = "AccountFreeTrialInfos" +_AIcco = "AccountIds" +_BPA = "BlockPublicAccess" +_IPA = "IgnorePublicAcls" +_iPA = "ignorePublicAcls" +_RPB = "RestrictPublicBuckets" +_rPB = "restrictPublicBuckets" +_BPAl = "BlockPublicAcls" +_bPA = "blockPublicAcls" +_BPP = "BlockPublicPolicy" +_bPP = "blockPublicPolicy" +_ALP = "AccountLevelPermissions" +_bPAl = "blockPublicAccess" +_Ti = "Timestamp" +_AS = "AccountStatistics" +_LGA = "LastGeneratedAt" +_lGA = "lastGeneratedAt" +_TF = "TotalFindings" +_tF = "totalFindings" +_AR = "AffectedResources" +_ke = "key" +_v = "value" +_DD = "DomainDetails" +_D = "Domain" +_d = "domain" +_RAD = "RemoteAccountDetails" +_Af = "Affiliated" +_af = "affiliated" +_ASN = "AwsServiceName" +_aSN = "awsServiceName" +_C = "City" +_CN = "CityName" +_cN = "cityName" +_Co = "Country" +_CC = "CountryCode" +_cC = "countryCode" +_CNo = "CountryName" +_cNo = "countryName" +_Do = "Double" +_GL = "GeoLocation" +_L = "Lat" +_l = "lat" +_Lo = "Lon" +_lo = "lon" +_SS = "SensitiveString" +_O = "Organization" +_As = "Asn" +_as = "asn" +_AO = "AsnOrg" +_aO = "asnOrg" +_Is = "Isp" +_i = "isp" +_Or = "Org" +_o = "org" +_RID = "RemoteIpDetails" +_ci = "city" +_co = "country" +_gL = "geoLocation" +_IAV = "IpAddressV4" +_iAV = "ipAddressV4" +_IAVp = "IpAddressV6" +_iAVp = "ipAddressV6" +_or = "organization" +_AACA = "AwsApiCallAction" +_Ap = "Api" +_ap = "api" +_CTa = "CallerType" +_cTa = "callerType" +_dD = "domainDetails" +_EC = "ErrorCode" +_eC = "errorCode" +_UA = "UserAgent" +_uA = "userAgent" +_rID = "remoteIpDetails" +_SN = "ServiceName" +_sNe = "serviceName" +_rAD = "remoteAccountDetails" +_aR = "affectedResources" +_DRA = "DnsRequestAction" +_P = "Protocol" +_p = "protocol" +_Bl = "Blocked" +_b = "blocked" +_DWS = "DomainWithSuffix" +_dWS = "domainWithSuffix" +_VOAI = "VpcOwnerAccountId" +_vOAI = "vpcOwnerAccountId" +_SI = "SourceIps" +_KACA = "KubernetesApiCallAction" +_RU = "RequestUri" +_rU = "requestUri" +_V = "Verb" +_ve = "verb" +_R = "Resource" +_r = "resource" +_Su = "Subresource" +_su = "subresource" +_Na = "Namespace" +_na = "namespace" +_RN = "ResourceName" +_rN = "resourceName" +_sIP = "sourceIPs" +_SC = "StatusCode" +_sC = "statusCode" +_Pa = "Parameters" +_pa = "parameters" +_KPCD = "KubernetesPermissionCheckedDetails" +_Al = "Allowed" +_al = "allowed" +_KRBD = "KubernetesRoleBindingDetails" +_Ki = "Kind" +_ki = "kind" +_RRN = "RoleRefName" +_rRN = "roleRefName" +_RRK = "RoleRefKind" +_rRK = "roleRefKind" +_KRD = "KubernetesRoleDetails" +_LID = "LocalIpDetails" +_LPD = "LocalPortDetails" +_Po = "Port" +_po = "port" +_PN = "PortName" +_pN = "portName" +_RPD = "RemotePortDetails" +_NCA = "NetworkConnectionAction" +_CD = "ConnectionDirection" +_cD = "connectionDirection" +_lPD = "localPortDetails" +_lID = "localIpDetails" +_LNI = "LocalNetworkInterface" +_lNI = "localNetworkInterface" +_rPD = "remotePortDetails" +_PPD = "PortProbeDetail" +_PPDo = "PortProbeDetails" +_PPA = "PortProbeAction" +_pPD = "portProbeDetails" +_LA = "LoginAttribute" +_Us = "User" +_us = "user" +_App = "Application" +_app = "application" +_FLA = "FailedLoginAttempts" +_fLA = "failedLoginAttempts" +_SLA = "SuccessfulLoginAttempts" +_sLA = "successfulLoginAttempts" +_LAo = "LoginAttributes" +_RLAA = "RdsLoginAttemptAction" +_Ac = "Action" +_AT = "ActionType" +_aT = "actionType" +_aACA = "awsApiCallAction" +_dRA = "dnsRequestAction" +_nCA = "networkConnectionAction" +_pPA = "portProbeAction" +_kACA = "kubernetesApiCallAction" +_kPCD = "kubernetesPermissionCheckedDetails" +_kRBD = "kubernetesRoleBindingDetails" +_kRD = "kubernetesRoleDetails" +_rLAA = "rdsLoginAttemptAction" +_AC = "ApiCall" +_Op = "Operation" +_op = "operation" +_Se = "Service" +_ser = "service" +_Er = "Error" +_er = "error" +_ATc = "ActivityType" +_AC_ = "API_CALL" +_Act = "Activity" +_Acti = "Activities" +_PNr = "ProcessName" +_PP = "ProcessPath" +_PS = "ProcessSha256" +_APc = "ActorProcess" +_Pat = "Path" +_pat = "path" +_Sh = "Sha256" +_sh = "sha256" +_MS = "MfaStatus" +_ENABLED = "ENABLED" +_DISABLED = "DISABLED" +_Ses = "Session" +_mS = "mfaStatus" +_CTr = "CreatedTime" +_cTr = "createdTime" +_Iss = "Issuer" +_is = "issuer" +_CU = "CredentialUid" +_cU = "credentialUid" +_Acto = "Actor" +_Id = "Id" +_id = "id" +_ses = "session" +_Pr = "Process" +_pr = "process" +_AIct = "ActorIds" +_Actor = "Actors" +_NES = "NonEmptyString" +_AId = "AdditionalInfo" +_VI = "VersionId" +_vI = "versionId" +_DN = "DeviceName" +_dN = "deviceName" +_FT = "FindingType" +_AST = "AdditionalSequenceTypes" +_ADd = "AddonDetails" +_AV = "AddonVersion" +_aV = "addonVersion" +_ASd = "AddonStatus" +_aS = "addonStatus" +_ASdm = "AdminStatus" +_DIP = "DISABLE_IN_PROGRESS" +_AA = "AdminAccount" +_AAId = "AdminAccountId" +_aAI = "adminAccountId" +_aSd = "adminStatus" +_AAd = "AdminAccounts" +_Ad = "Administrator" +_RS = "RelationshipStatus" +_rS = "relationshipStatus" +_IA = "InvitedAt" +_iA = "invitedAt" +_ADg = "AgentDetails" +_Ve = "Version" +_ver = "version" +_Lon = "Long" +_ON = "ObservationNumbers" +_OT = "ObservationTexts" +_Ob = "Observations" +_Te = "Text" +_te = "text" +_Nu = "Number" +_nu = "number" +_PSr = "ProfileSubtype" +_FREQUENT = "FREQUENT" +_INFREQUENT = "INFREQUENT" +_UNSEEN = "UNSEEN" +_RARE = "RARE" +_COUNT = "COUNT" +_AVERAGE = "AVERAGE" +_PT = "ProfileType" +_FREQUENCY = "FREQUENCY" +_VOLUME = "VOLUME" +_AOn = "AnomalyObject" +_pT = "profileType" +_pS = "profileSubtype" +_ob = "observations" +_APFO = "AnomalyProfileFeatureObjects" +_APF = "AnomalyProfileFeatures" +_APn = "AnomalyProfiles" +_AUBF = "AnomalyUnusualBehaviorFeature" +_Be = "Behavior" +_AU = "AnomalyUnusual" +_be = "behavior" +_An = "Anomaly" +_Pro = "Profiles" +_pro = "profiles" +_Un = "Unusual" +_un = "unusual" +_FI = "FindingId" +_FIi = "FindingIds" +_AFI = "ArchiveFindingsInput" +_cAFR = "com.amazonaws.guardduty#ArchiveFindingsRequest" +_fI = "findingIds" +_AFO = "ArchiveFindingsOutput" +_cAFRo = "com.amazonaws.guardduty#ArchiveFindingsResponse" +_AF = "ArchiveFindings" +_DRAe = "DetectionRuleArn" +_AIs = "AssociationId" +_AM = "AssociationMode" +_LIVE = "LIVE" +_DR = "DRY_RUN" +_RI = "RuleId" +_ADs = "AssociationDetail" +_aIs = "associationId" +_Ar = "Arn" +_ar = "arn" +_rI = "ruleId" +_Mo = "Mode" +_mo = "mode" +_CA = "CreatedAt" +_cA = "createdAt" +_UAp = "UpdatedAt" +_uAp = "updatedAt" +_EA = "ExpiresAt" +_eA = "expiresAt" +_ASs = "AssociationSummary" +_ASL = "AssociationSummaryList" +_AEM = "AutoEnableMembers" +_NEW = "NEW" +_ALL = "ALL" +_NONE = "NONE" +_ASu = "AutonomousSystem" +_EIU = "Ec2InstanceUid" +_EIUc = "Ec2InstanceUids" +_AASG = "AutoscalingAutoScalingGroup" +_eIU = "ec2InstanceUids" +_BG = "BedrockGuardrail" +_CPFA = "ContentPolicyFilterAction" +_BLOCKED = "BLOCKED" +_CL = "ConfidenceLevel" +_HIGH = "HIGH" +_MEDIUM = "MEDIUM" +_LOW = "LOW" +_CPFT = "ContentPolicyFilterType" +_PA = "PROMPT_ATTACK" +_JAILBREAK = "JAILBREAK" +_HATE = "HATE" +_INSULTS = "INSULTS" +_SEXUAL = "SEXUAL" +_VIOLENCE = "VIOLENCE" +_MISCONDUCT = "MISCONDUCT" +_CPF = "ContentPolicyFilter" +_Con = "Confidence" +_con = "confidence" +_ac = "action" +_CPFo = "ContentPolicyFilters" +_GA = "GuardrailAction" +_GI = "GUARDRAIL_INTERVENED" +_BGe = "BedrockGuardrails" +_GS = "GuardrailSource" +_INPUT = "INPUT" +_OUTPUT = "OUTPUT" +_BGD = "BedrockGuardrailDetails" +_GAu = "GuardrailArn" +_gA = "guardrailArn" +_GV = "GuardrailVersion" +_gV = "guardrailVersion" +_G = "Guardrails" +_g = "guardrails" +_gAu = "guardrailAction" +_gS = "guardrailSource" +_cPF = "contentPolicyFilters" +_BGR = "BedrockGuardrailResource" +_BP = "BucketPolicy" +_BLP = "BucketLevelPermissions" +_aCL = "accessControlList" +_bP = "bucketPolicy" +_CTl = "ClientToken" +_CP = "CloudProvider" +_AWS = "AWS" +_CDl = "CloudDetails" +_Prov = "Provider" +_prov = "provider" +_Re = "Region" +_re = "region" +_CS = "CloudformationStack" +_DSS = "DataSourceStatus" +_CTCR = "CloudTrailConfigurationResult" +_St = "Status" +_st = "status" +_CSl = "ClusterStatus" +_CREATING = "CREATING" +_ACTIVE = "ACTIVE" +_DELETING = "DELETING" +_FAILED = "FAILED" +_UPDATING = "UPDATING" +_PENDING = "PENDING" +_Eq = "Eq" +_Equ = "Equals" +_Ma = "Match" +_Mat = "Matches" +_Ne = "Neq" +_NE = "NotEquals" +_NM = "NotMatch" +_NMo = "NotMatches" +_Cond = "Condition" +_eq = "eq" +_ne = "neq" +_Gt = "Gt" +_gt = "gt" +_Gte = "Gte" +_gte = "gte" +_Lt = "Lt" +_lt = "lt" +_Lte = "Lte" +_lte = "lte" +_equ = "equals" +_nE = "notEquals" +_GT = "GreaterThan" +_gT = "greaterThan" +_GTOE = "GreaterThanOrEqual" +_gTOE = "greaterThanOrEqual" +_LT = "LessThan" +_lT = "lessThan" +_LTOE = "LessThanOrEqual" +_lTOE = "lessThanOrEqual" +_ma = "matches" +_nM = "notMatches" +_UNKNOWN = "UNKNOWN" +_Unk = "Unknown" +_Low = "Low" +_Me = "Medium" +_H = "High" +_CE = "ConflictException" +_SCe = "SecurityContext" +_Pri = "Privileged" +_pri = "privileged" +_APE = "AllowPrivilegeEscalation" +_aPE = "allowPrivilegeEscalation" +_VM = "VolumeMount" +_MPo = "MountPath" +_mPo = "mountPath" +_VMo = "VolumeMounts" +_Cont = "Container" +_CR = "ContainerRuntime" +_cR = "containerRuntime" +_Im = "Image" +_im = "image" +_IP = "ImagePrefix" +_iP = "imagePrefix" +_vM = "volumeMounts" +_sCe = "securityContext" +_CIU = "ContainerImageUid" +_CFR = "ContainerFindingResource" +_IU = "ImageUid" +_iU = "imageUid" +_CID = "ContainerInstanceDetails" +_CCI = "CoveredContainerInstances" +_cCI = "coveredContainerInstances" +_CCIo = "CompatibleContainerInstances" +_cCIo = "compatibleContainerInstances" +_Conta = "Containers" +_CUo = "ContainerUid" +_CUon = "ContainerUids" +_CSD = "ContinuousScanDetails" +_ST = "StartTime" +_sT = "startTime" +_ET = "EndTime" +_eT = "endTime" +_CSo = "CoverageStatus" +_HEALTHY = "HEALTHY" +_UNHEALTHY = "UNHEALTHY" +_CBCS = "CountByCoverageStatus" +_RT = "ResourceType" +_EKS = "EKS" +_ECS = "ECS" +_EC_ = "EC2" +_CBRT = "CountByResourceType" +_CBS = "CountBySeverity" +_MT = "ManagementType" +_AM_ = "AUTO_MANAGED" +_MANUAL = "MANUAL" +_CEID = "CoverageEc2InstanceDetails" +_IIn = "InstanceId" +_iIn = "instanceId" +_IT = "InstanceType" +_iT = "instanceType" +_CAl = "ClusterArn" +_cAl = "clusterArn" +_aD = "agentDetails" +_mT = "managementType" +_Issu = "Issues" +_FD = "FargateDetails" +_iss = "issues" +_CECD = "CoverageEcsClusterDetails" +_CNl = "ClusterName" +_cNl = "clusterName" +_fD = "fargateDetails" +_cID = "containerInstanceDetails" +_CECDo = "CoverageEksClusterDetails" +_CNov = "CoveredNodes" +_cNov = "coveredNodes" +_CNom = "CompatibleNodes" +_cNom = "compatibleNodes" +_aDd = "addonDetails" +_CFC = "CoverageFilterCondition" +_CFCK = "CoverageFilterCriterionKey" +_AI_ = "ACCOUNT_ID" +_RT_ = "RESOURCE_TYPE" +_CS_ = "COVERAGE_STATUS" +_AV_ = "ADDON_VERSION" +_CN_ = "CLUSTER_NAME" +_ECN = "ECS_CLUSTER_NAME" +_MT_ = "MANAGEMENT_TYPE" +_ECN_ = "EKS_CLUSTER_NAME" +_AV__ = "AGENT_VERSION" +_II_ = "INSTANCE_ID" +_CA_ = "CLUSTER_ARN" +_CFCo = "CoverageFilterCriterion" +_CK = "CriterionKey" +_cK = "criterionKey" +_FC = "FilterCondition" +_fC = "filterCondition" +_CFCL = "CoverageFilterCriterionList" +_CFCov = "CoverageFilterCriteria" +_FCi = "FilterCriterion" +_fCi = "filterCriterion" +_CRD = "CoverageResourceDetails" +_ECD = "EksClusterDetails" +_eCD = "eksClusterDetails" +_ECDc = "EcsClusterDetails" +_eCDc = "ecsClusterDetails" +_EID = "Ec2InstanceDetails" +_eID = "ec2InstanceDetails" +_rT = "resourceType" +_CRo = "CoverageResource" +_RIe = "ResourceId" +_rIe = "resourceId" +_dI = "detectorId" +_RD = "ResourceDetails" +_rD = "resourceDetails" +_cS = "coverageStatus" +_Issue = "Issue" +_issu = "issue" +_CRov = "CoverageResources" +_CSK = "CoverageSortKey" +_ISSUE = "ISSUE" +_UA_ = "UPDATED_AT" +_OB = "OrderBy" +_ASC = "ASC" +_DESC = "DESC" +_CSC = "CoverageSortCriteria" +_AN = "AttributeName" +_aN = "attributeName" +_oB = "orderBy" +_CSov = "CoverageStatistics" +_cBRT = "countByResourceType" +_cBCS = "countByCoverageStatus" +_CST = "CoverageStatisticsType" +_CBRT_ = "COUNT_BY_RESOURCE_TYPE" +_CBCS_ = "COUNT_BY_COVERAGE_STATUS" +_CSTL = "CoverageStatisticsTypeList" +_TK = "TagKey" +_TV = "TagValue" +_TM = "TagMap" +_CCDRAI = "CreateCustomDetectionRuleAssociationInput" +_cCCDRAR = "com.amazonaws.guardduty#CreateCustomDetectionRuleAssociationRequest" +_sTm = "smithy.api#idempotencyToken" +_cTl = "clientToken" +_Ta = "Tags" +_ta = "tags" +_CCDRAO = "CreateCustomDetectionRuleAssociationOutput" +_cCCDRARo = "com.amazonaws.guardduty#CreateCustomDetectionRuleAssociationResponse" +_RA = "RuleAssociation" +_rA = "ruleAssociation" +_RNFE = "ResourceNotFoundException" +_CCDRA = "CreateCustomDetectionRuleAssociation" +_DRAI = "DetectionRuleAccountIds" +_CCDROCI = "CreateCustomDetectionRuleOrgConfigurationInput" +_cCCDROCR = "com.amazonaws.guardduty#CreateCustomDetectionRuleOrgConfigurationRequest" +_IAI = "IncludeAccountIds" +_iAI = "includeAccountIds" +_EAI = "ExcludeAccountIds" +_eAI = "excludeAccountIds" +_CCDROCO = "CreateCustomDetectionRuleOrgConfigurationOutput" +_cCCDROCRo = "com.amazonaws.guardduty#CreateCustomDetectionRuleOrgConfigurationResponse" +_CCDROC = "CreateCustomDetectionRuleOrgConfiguration" +_KALC = "KubernetesAuditLogsConfiguration" +_En = "Enable" +_en = "enable" +_KC = "KubernetesConfiguration" +_EV = "EbsVolumes" +_eV = "ebsVolumes" +_MPC = "MalwareProtectionConfiguration" +_SLC = "S3LogsConfiguration" +_DSC = "DataSourceConfigurations" +_FAC = "FeatureAdditionalConfiguration" +_EAM = "EKS_ADDON_MANAGEMENT" +_EFAM = "ECS_FARGATE_AGENT_MANAGEMENT" +_EAM_ = "EC2_AGENT_MANAGEMENT" +_FS = "FeatureStatus" +_DAC = "DetectorAdditionalConfiguration" +_DACe = "DetectorAdditionalConfigurations" +_DF = "DetectorFeature" +_RM = "RUNTIME_MONITORING" +_AA_ = "AI_ANALYST" +_DFC = "DetectorFeatureConfiguration" +_ACd = "AdditionalConfiguration" +_aC = "additionalConfiguration" +_DFCe = "DetectorFeatureConfigurations" +_FPF = "FindingPublishingFrequency" +_FM = "FIFTEEN_MINUTES" +_OH = "ONE_HOUR" +_SH = "SIX_HOURS" +_CDI = "CreateDetectorInput" +_cCDR = "com.amazonaws.guardduty#CreateDetectorRequest" +_fPF = "findingPublishingFrequency" +_EVR = "EbsVolumesResult" +_Rea = "Reason" +_rea = "reason" +_SEIWFR = "ScanEc2InstanceWithFindingsResult" +_MPCR = "MalwareProtectionConfigurationResult" +_SR = "ServiceRole" +_sR = "serviceRole" +_UDSR = "UnprocessedDataSourcesResult" +_CDO = "CreateDetectorOutput" +_cCDRo = "com.amazonaws.guardduty#CreateDetectorResponse" +_UDS = "UnprocessedDataSources" +_uDS = "unprocessedDataSources" +_CDr = "CreateDetector" +_FA = "FilterAction" +_NOOP = "NOOP" +_ARCHIVE = "ARCHIVE" +_FDi = "FilterDescription" +_Cr = "Criterion" +_FCin = "FindingCriteria" +_cr = "criterion" +_FN = "FilterName" +_FR = "FilterRank" +_CFI = "CreateFilterInput" +_cCFR = "com.amazonaws.guardduty#CreateFilterRequest" +_De = "Description" +_de = "description" +_Ra = "Rank" +_ra = "rank" +_fCin = "findingCriteria" +_CFO = "CreateFilterOutput" +_cCFRo = "com.amazonaws.guardduty#CreateFilterResponse" +_CF = "CreateFilter" +_TP = "TriggerPrompt" +_CII = "CreateInvestigationInput" +_cCIR = "com.amazonaws.guardduty#CreateInvestigationRequest" +_tP = "triggerPrompt" +_IInv = "InvestigationId" +_CIO = "CreateInvestigationOutput" +_cCIRo = "com.amazonaws.guardduty#CreateInvestigationResponse" +_iInv = "investigationId" +_CI = "CreateInvestigation" +_ISF = "IpSetFormat" +_TXT = "TXT" +_STIX = "STIX" +_OC = "OTX_CSV" +_AV___ = "ALIEN_VAULT" +_PP_ = "PROOF_POINT" +_FE = "FIRE_EYE" +_Loc = "Location" +_CIPSI = "CreateIPSetInput" +_cCIPSR = "com.amazonaws.guardduty#CreateIPSetRequest" +_Fo = "Format" +_fo = "format" +_loc = "location" +_Activ = "Activate" +_act = "activate" +_EBO = "ExpectedBucketOwner" +_eBO = "expectedBucketOwner" +_CIPSO = "CreateIPSetOutput" +_cCIPSRo = "com.amazonaws.guardduty#CreateIPSetResponse" +_ISI = "IpSetId" +_iSI = "ipSetId" +_CIPS = "CreateIPSet" +_MPPTAS = "MalwareProtectionPlanTaggingActionStatus" +_MPPTA = "MalwareProtectionPlanTaggingAction" +_MPPA = "MalwareProtectionPlanActions" +_Tag = "Tagging" +_tag = "tagging" +_MPPOPL = "MalwareProtectionPlanObjectPrefixesList" +_CSBR = "CreateS3BucketResource" +_BN = "BucketName" +_bN = "bucketName" +_OP = "ObjectPrefixes" +_oP = "objectPrefixes" +_CPR = "CreateProtectedResource" +_SB = "S3Bucket" +_sB = "s3Bucket" +_CMPPI = "CreateMalwareProtectionPlanInput" +_cCMPPR = "com.amazonaws.guardduty#CreateMalwareProtectionPlanRequest" +_Ro = "Role" +_ro = "role" +_PR = "ProtectedResource" +_pR = "protectedResource" +_Actio = "Actions" +_acti = "actions" +_CMPPO = "CreateMalwareProtectionPlanOutput" +_cCMPPRo = "com.amazonaws.guardduty#CreateMalwareProtectionPlanResponse" +_MPPI = "MalwareProtectionPlanId" +_mPPI = "malwareProtectionPlanId" +_CMPP = "CreateMalwareProtectionPlan" +_CMI = "CreateMembersInput" +_cCMR = "com.amazonaws.guardduty#CreateMembersRequest" +_aDc = "accountDetails" +_UAn = "UnprocessedAccount" +_Res = "Result" +_res = "result" +_UAnp = "UnprocessedAccounts" +_CMO = "CreateMembersOutput" +_cCMRo = "com.amazonaws.guardduty#CreateMembersResponse" +_uAn = "unprocessedAccounts" +_CM = "CreateMembers" +_DP = "DestinationProperties" +_DA = "DestinationArn" +_dA = "destinationArn" +_KKA = "KmsKeyArn" +_kKA = "kmsKeyArn" +_DT = "DestinationType" +_S_ = "S3" +_CPDI = "CreatePublishingDestinationInput" +_cCPDR = "com.amazonaws.guardduty#CreatePublishingDestinationRequest" +_dT = "destinationType" +_dP = "destinationProperties" +_CPDO = "CreatePublishingDestinationOutput" +_cCPDRo = "com.amazonaws.guardduty#CreatePublishingDestinationResponse" +_DIe = "DestinationId" +_dIe = "destinationId" +_CPD = "CreatePublishingDestination" +_FTi = "FindingTypes" +_CSFI = "CreateSampleFindingsInput" +_cCSFR = "com.amazonaws.guardduty#CreateSampleFindingsRequest" +_fT = "findingTypes" +_CSFO = "CreateSampleFindingsOutput" +_cCSFRo = "com.amazonaws.guardduty#CreateSampleFindingsResponse" +_CSF = "CreateSampleFindings" +_TESF = "ThreatEntitySetFormat" +_CTESI = "CreateThreatEntitySetInput" +_cCTESR = "com.amazonaws.guardduty#CreateThreatEntitySetRequest" +_CTESO = "CreateThreatEntitySetOutput" +_cCTESRo = "com.amazonaws.guardduty#CreateThreatEntitySetResponse" +_TESI = "ThreatEntitySetId" +_tESI = "threatEntitySetId" +_CTES = "CreateThreatEntitySet" +_TISF = "ThreatIntelSetFormat" +_CTISI = "CreateThreatIntelSetInput" +_cCTISR = "com.amazonaws.guardduty#CreateThreatIntelSetRequest" +_CTISO = "CreateThreatIntelSetOutput" +_cCTISRo = "com.amazonaws.guardduty#CreateThreatIntelSetResponse" +_TISI = "ThreatIntelSetId" +_tISI = "threatIntelSetId" +_CTIS = "CreateThreatIntelSet" +_TESFr = "TrustedEntitySetFormat" +_CTESIr = "CreateTrustedEntitySetInput" +_cCTESRom = "com.amazonaws.guardduty#CreateTrustedEntitySetRequest" +_CTESOr = "CreateTrustedEntitySetOutput" +_cCTESRoma = "com.amazonaws.guardduty#CreateTrustedEntitySetResponse" +_TESIr = "TrustedEntitySetId" +_tESIr = "trustedEntitySetId" +_CTESr = "CreateTrustedEntitySet" +_EIA = "EC2_INSTANCE_ARN" +_SI_ = "SCAN_ID" +_GFI = "GUARDDUTY_FINDING_ID" +_SST = "SCAN_START_TIME" +_SS_ = "SCAN_STATUS" +_ST_ = "SCAN_TYPE" +_DSa = "DataSource" +_SL_ = "S3_LOGS" +_KAL = "KUBERNETES_AUDIT_LOGS" +_EMS = "EC2_MALWARE_SCAN" +_DNSLCR = "DNSLogsConfigurationResult" +_FLCR = "FlowLogsConfigurationResult" +_KALCR = "KubernetesAuditLogsConfigurationResult" +_KCR = "KubernetesConfigurationResult" +_SLCR = "S3LogsConfigurationResult" +_DSCR = "DataSourceConfigurationsResult" +_DNSL = "DNSLogs" +_DSL = "DataSourceList" +_DSat = "DateStatistics" +_Da = "Date" +_da = "date" +_Sev = "Severity" +_sev = "severity" +_DII = "DeclineInvitationsInput" +_cDIR = "com.amazonaws.guardduty#DeclineInvitationsRequest" +_aIcc = "accountIds" +_DIO = "DeclineInvitationsOutput" +_cDIRo = "com.amazonaws.guardduty#DeclineInvitationsResponse" +_DIec = "DeclineInvitations" +_DSSE = "DefaultServerSideEncryption" +_ETn = "EncryptionType" +_eTn = "encryptionType" +_KMKA = "KmsMasterKeyArn" +_kMKA = "kmsMasterKeyArn" +_DCDRAI = "DeleteCustomDetectionRuleAssociationInput" +_cDCDRAR = "com.amazonaws.guardduty#DeleteCustomDetectionRuleAssociationRequest" +_DCDRAO = "DeleteCustomDetectionRuleAssociationOutput" +_cDCDRARo = "com.amazonaws.guardduty#DeleteCustomDetectionRuleAssociationResponse" +_DCDRA = "DeleteCustomDetectionRuleAssociation" +_DCDROCI = "DeleteCustomDetectionRuleOrgConfigurationInput" +_cDCDROCR = "com.amazonaws.guardduty#DeleteCustomDetectionRuleOrgConfigurationRequest" +_sQ = "smithy.api#httpQuery" +_DCDROCO = "DeleteCustomDetectionRuleOrgConfigurationOutput" +_cDCDROCRo = "com.amazonaws.guardduty#DeleteCustomDetectionRuleOrgConfigurationResponse" +_DCDROC = "DeleteCustomDetectionRuleOrgConfiguration" +_DDI = "DeleteDetectorInput" +_cDDR = "com.amazonaws.guardduty#DeleteDetectorRequest" +_DDO = "DeleteDetectorOutput" +_cDDRo = "com.amazonaws.guardduty#DeleteDetectorResponse" +_DDe = "DeleteDetector" +_DFI = "DeleteFilterInput" +_cDFR = "com.amazonaws.guardduty#DeleteFilterRequest" +_DFO = "DeleteFilterOutput" +_cDFRo = "com.amazonaws.guardduty#DeleteFilterResponse" +_DFe = "DeleteFilter" +_DIIe = "DeleteInvitationsInput" +_cDIRom = "com.amazonaws.guardduty#DeleteInvitationsRequest" +_DIOe = "DeleteInvitationsOutput" +_cDIRoma = "com.amazonaws.guardduty#DeleteInvitationsResponse" +_DIel = "DeleteInvitations" +_DIPSI = "DeleteIPSetInput" +_cDIPSR = "com.amazonaws.guardduty#DeleteIPSetRequest" +_DIPSO = "DeleteIPSetOutput" +_cDIPSRo = "com.amazonaws.guardduty#DeleteIPSetResponse" +_DIPS = "DeleteIPSet" +_DMPPI = "DeleteMalwareProtectionPlanInput" +_cDMPPR = "com.amazonaws.guardduty#DeleteMalwareProtectionPlanRequest" +_DMPPO = "DeleteMalwareProtectionPlanOutput" +_sU = "smithy.api#Unit" +_DMPP = "DeleteMalwareProtectionPlan" +_DMI = "DeleteMembersInput" +_cDMR = "com.amazonaws.guardduty#DeleteMembersRequest" +_DMO = "DeleteMembersOutput" +_cDMRo = "com.amazonaws.guardduty#DeleteMembersResponse" +_DM = "DeleteMembers" +_DPDI = "DeletePublishingDestinationInput" +_cDPDR = "com.amazonaws.guardduty#DeletePublishingDestinationRequest" +_DPDO = "DeletePublishingDestinationOutput" +_cDPDRo = "com.amazonaws.guardduty#DeletePublishingDestinationResponse" +_DPD = "DeletePublishingDestination" +_DTESI = "DeleteThreatEntitySetInput" +_cDTESR = "com.amazonaws.guardduty#DeleteThreatEntitySetRequest" +_DTESO = "DeleteThreatEntitySetOutput" +_cDTESRo = "com.amazonaws.guardduty#DeleteThreatEntitySetResponse" +_DTES = "DeleteThreatEntitySet" +_DTISI = "DeleteThreatIntelSetInput" +_cDTISR = "com.amazonaws.guardduty#DeleteThreatIntelSetRequest" +_DTISO = "DeleteThreatIntelSetOutput" +_cDTISRo = "com.amazonaws.guardduty#DeleteThreatIntelSetResponse" +_DTIS = "DeleteThreatIntelSet" +_DTESIe = "DeleteTrustedEntitySetInput" +_cDTESRom = "com.amazonaws.guardduty#DeleteTrustedEntitySetRequest" +_DTESOe = "DeleteTrustedEntitySetOutput" +_cDTESRoma = "com.amazonaws.guardduty#DeleteTrustedEntitySetResponse" +_DTESe = "DeleteTrustedEntitySet" +_LV = "LongValue" +_EVq = "EqualsValue" +_eVq = "equalsValue" +_FCL = "FilterCriterionList" +_FCil = "FilterCriteria" +_IVWM = "IntegerValueWithMax" +_SCo = "SortCriteria" +_DMSI = "DescribeMalwareScansInput" +_cDMSR = "com.amazonaws.guardduty#DescribeMalwareScansRequest" +_NT = "NextToken" +_nT = "nextToken" +_MR = "MaxResults" +_mR = "maxResults" +_fCil = "filterCriteria" +_sCo = "sortCriteria" +_VD = "VolumeDetail" +_VA = "VolumeArn" +_vA = "volumeArn" +_VT = "VolumeType" +_vT = "volumeType" +_VSIGB = "VolumeSizeInGB" +_vSIGB = "volumeSizeInGB" +_SA = "SnapshotArn" +_sA = "snapshotArn" +_VDo = "VolumeDetails" +_PL = "PositiveLong" +_IAn = "InstanceArn" +_iAn = "instanceArn" +_SRc = "ScanResult" +_CLEAN = "CLEAN" +_INFECTED = "INFECTED" +_SRD = "ScanResultDetails" +_sRc = "scanResult" +_SSc = "ScanStatus" +_RUNNING = "RUNNING" +_COMPLETED = "COMPLETED" +_SKIPPED = "SKIPPED" +_STc = "ScanType" +_GI_ = "GUARDDUTY_INITIATED" +_OD = "ON_DEMAND" +_TT = "TriggerType" +_BACKUP = "BACKUP" +_GUARDDUTY = "GUARDDUTY" +_TD = "TriggerDetails" +_GDFI = "GuardDutyFindingId" +_gDFI = "guardDutyFindingId" +_tT = "triggerType" +_Sc = "Scan" +_ADI = "AdminDetectorId" +_aDI = "adminDetectorId" +_SIc = "ScanId" +_sI = "scanId" +_sS = "scanStatus" +_FRa = "FailureReason" +_fR = "failureReason" +_SSTc = "ScanStartTime" +_sST = "scanStartTime" +_SET = "ScanEndTime" +_sET = "scanEndTime" +_tD = "triggerDetails" +_sRD = "scanResultDetails" +_TB = "TotalBytes" +_tB = "totalBytes" +_FCile = "FileCount" +_fCile = "fileCount" +_AVt = "AttachedVolumes" +_aVt = "attachedVolumes" +_sTc = "scanType" +_Sca = "Scans" +_DMSO = "DescribeMalwareScansOutput" +_cDMSRo = "com.amazonaws.guardduty#DescribeMalwareScansResponse" +_sc = "scans" +_DMS = "DescribeMalwareScans" +_DOCI = "DescribeOrganizationConfigurationInput" +_cDOCR = "com.amazonaws.guardduty#DescribeOrganizationConfigurationRequest" +_OKALCR = "OrganizationKubernetesAuditLogsConfigurationResult" +_AE = "AutoEnable" +_aE = "autoEnable" +_OKCR = "OrganizationKubernetesConfigurationResult" +_OEVR = "OrganizationEbsVolumesResult" +_OSEIWFR = "OrganizationScanEc2InstanceWithFindingsResult" +_OMPCR = "OrganizationMalwareProtectionConfigurationResult" +_OSLCR = "OrganizationS3LogsConfigurationResult" +_ODSCR = "OrganizationDataSourceConfigurationsResult" +_OFS = "OrgFeatureStatus" +_OFAC = "OrgFeatureAdditionalConfiguration" +_OACR = "OrganizationAdditionalConfigurationResult" +_OACRr = "OrganizationAdditionalConfigurationResults" +_OF = "OrgFeature" +_OFCR = "OrganizationFeatureConfigurationResult" +_OFCRr = "OrganizationFeaturesConfigurationsResults" +_DOCO = "DescribeOrganizationConfigurationOutput" +_cDOCRo = "com.amazonaws.guardduty#DescribeOrganizationConfigurationResponse" +_MALR = "MemberAccountLimitReached" +_mALR = "memberAccountLimitReached" +_AEOM = "AutoEnableOrganizationMembers" +_aEOM = "autoEnableOrganizationMembers" +_DOC = "DescribeOrganizationConfiguration" +_DPDIe = "DescribePublishingDestinationInput" +_cDPDRom = "com.amazonaws.guardduty#DescribePublishingDestinationRequest" +_PSu = "PublishingStatus" +_PV = "PENDING_VERIFICATION" +_PUBLISHING = "PUBLISHING" +_UTPFDP = "UNABLE_TO_PUBLISH_FIX_DESTINATION_PROPERTY" +_STOPPED = "STOPPED" +_DPDOe = "DescribePublishingDestinationOutput" +_cDPDRoma = "com.amazonaws.guardduty#DescribePublishingDestinationResponse" +_PFST = "PublishingFailureStartTimestamp" +_pFST = "publishingFailureStartTimestamp" +_DPDe = "DescribePublishingDestination" +_Des = "Destination" +_Dest = "Destinations" +_SD = "SequenceDescription" +_ND = "NetworkDirection" +_INBOUND = "INBOUND" +_OUTBOUND = "OUTBOUND" +_NC = "NetworkConnection" +_Di = "Direction" +_di = "direction" +_NGL = "NetworkGeoLocation" +_La = "Latitude" +_Long = "Longitude" +_NEe = "NetworkEndpoint" +_Ip = "Ip" +_ip = "ip" +_aSu = "autonomousSystem" +_Conn = "Connection" +_conn = "connection" +_NEet = "NetworkEndpoints" +_EI = "Ec2Image" +_ENIU = "Ec2NetworkInterfaceUids" +_IIP = "IamInstanceProfile" +_PC = "ProductCode" +_Cod = "Code" +_pCI = "productCodeId" +_PTr = "ProductType" +_pCT = "productCodeType" +_PCr = "ProductCodes" +_EIc = "Ec2Instance" +_AZ = "AvailabilityZone" +_aZ = "availabilityZone" +_ID = "ImageDescription" +_iD = "imageDescription" +_IS = "InstanceState" +_iS = "instanceState" +_OA = "OutpostArn" +_oA = "outpostArn" +_Pl = "Platform" +_pl = "platform" +_pC = "productCodes" +_eNIU = "ec2NetworkInterfaceUids" +_LTV = "LaunchTemplateVersion" +_ELT = "Ec2LaunchTemplate" +_IAp = "Ipv6Addresses" +_PIAD = "PrivateIpAddressDetails" +_PDN = "PrivateDnsName" +_pDN = "privateDnsName" +_PIA = "PrivateIpAddress" +_pIA = "privateIpAddress" +_PIAr = "PrivateIpAddresses" +_SG = "SecurityGroup" +_GIr = "GroupId" +_gI = "groupId" +_GN = "GroupName" +_gN = "groupName" +_SGe = "SecurityGroups" +_ENI = "Ec2NetworkInterface" +_iAp = "ipv6Addresses" +_pIAr = "privateIpAddresses" +_PIu = "PublicIp" +_pIu = "publicIp" +_sG = "securityGroups" +_SNI = "SubNetId" +_sNI = "subNetId" +_VIp = "VpcId" +_vIp = "vpcId" +_EVc = "Ec2Vpc" +_ECSc = "EcsClusterStatus" +_PROVISIONING = "PROVISIONING" +_DEPROVISIONING = "DEPROVISIONING" +_INACTIVE = "INACTIVE" +_ECc = "EcsCluster" +_ELTc = "EcsLaunchType" +_FARGATE = "FARGATE" +_ETc = "EcsTask" +_TDA = "TaskDefinitionArn" +_tDA = "taskDefinitionArn" +_LTa = "LaunchType" +_lTa = "launchType" +_cUo = "containerUids" +_ECk = "EksCluster" +_IIPV = "IamInstanceProfileV2" +_KRT = "KubernetesResourcesTypes" +_PODS = "PODS" +_JOBS = "JOBS" +_CRONJOBS = "CRONJOBS" +_DEPLOYMENTS = "DEPLOYMENTS" +_DAEMONSETS = "DAEMONSETS" +_STATEFULSETS = "STATEFULSETS" +_REPLICASETS = "REPLICASETS" +_REPLICATIONCONTROLLERS = "REPLICATIONCONTROLLERS" +_KW = "KubernetesWorkload" +_PAS = "PublicAccessStatus" +_ALLOWED = "ALLOWED" +_PAIB = "PublicAclIgnoreBehavior" +_IGNORED = "IGNORED" +_NI = "NOT_IGNORED" +_PBRB = "PublicBucketRestrictBehavior" +_RESTRICTED = "RESTRICTED" +_NR = "NOT_RESTRICTED" +_PAC = "PublicAccessConfiguration" +_PAA = "PublicAclAccess" +_pAA = "publicAclAccess" +_PPAu = "PublicPolicyAccess" +_pPAu = "publicPolicyAccess" +_pAIB = "publicAclIgnoreBehavior" +_pBRB = "publicBucketRestrictBehavior" +_SOU = "S3ObjectUids" +_OI = "OwnerId" +_oI = "ownerId" +_EKA = "EncryptionKeyArn" +_eKA = "encryptionKeyArn" +_EP = "EffectivePermission" +_eP = "effectivePermission" +_PRA = "PublicReadAccess" +_pRA = "publicReadAccess" +_PWA = "PublicWriteAccess" +_pWA = "publicWriteAccess" +_APA = "AccountPublicAccess" +_aPA = "accountPublicAccess" +_BPAu = "BucketPublicAccess" +_bPAu = "bucketPublicAccess" +_sOU = "s3ObjectUids" +_SO = "S3Object" +_ETa = "ETag" +_eTa = "eTag" +_Ke = "Key" +_RDe = "ResourceData" +_eI = "ec2Instance" +_aK = "accessKey" +_eNI = "ec2NetworkInterface" +_sO = "s3Object" +_eCk = "eksCluster" +_kW = "kubernetesWorkload" +_cont = "container" +_eCc = "ecsCluster" +_eTc = "ecsTask" +_iIP = "iamInstanceProfile" +_aASG = "autoscalingAutoScalingGroup" +_eLT = "ec2LaunchTemplate" +_eVc = "ec2Vpc" +_eIc = "ec2Image" +_cSl = "cloudformationStack" +_bG = "bedrockGuardrail" +_FRT = "FindingResourceType" +_EI_ = "EC2_INSTANCE" +_ENI_ = "EC2_NETWORK_INTERFACE" +_SB_ = "S3_BUCKET" +_SO_ = "S3_OBJECT" +_AK_ = "ACCESS_KEY" +_EC__ = "EKS_CLUSTER" +_KW_ = "KUBERNETES_WORKLOAD" +_CONTAINER = "CONTAINER" +_EC___ = "ECS_CLUSTER" +_ET_ = "ECS_TASK" +_AASG_ = "AUTOSCALING_AUTO_SCALING_GROUP" +_IIP_ = "IAM_INSTANCE_PROFILE" +_CS__ = "CLOUDFORMATION_STACK" +_ELT_ = "EC2_LAUNCH_TEMPLATE" +_EV_ = "EC2_VPC" +_EI__ = "EC2_IMAGE" +_BCM = "BEDROCK_CUSTOM_MODEL" +_BIM = "BEDROCK_IMPORTED_MODEL" +_BPM = "BEDROCK_PROVISIONED_MODEL" +_BCMD = "BEDROCK_CUSTOM_MODEL_DEPLOYMENT" +_BIP = "BEDROCK_INFERENCE_PROFILE" +_BAIP = "BEDROCK_APPLICATION_INFERENCE_PROFILE" +_BP_ = "BEDROCK_PROMPT" +_BPR = "BEDROCK_PROMPT_ROUTER" +_BG_ = "BEDROCK_GUARDRAIL" +_SE = "SAGEMAKER_ENDPOINT" +_Tag_ = "Tag" +_Va = "Value" +_RV = "ResourceV2" +_CPl = "CloudPartition" +_cP = "cloudPartition" +_Dat = "Data" +_dat = "data" +_Reso = "Resources" +_ITn = "IndicatorType" +_SUA = "SUSPICIOUS_USER_AGENT" +_SN_ = "SUSPICIOUS_NETWORK" +_MI_ = "MALICIOUS_IP" +_TI = "TOR_IP" +_AT_ = "ATTACK_TACTIC" +_HRA = "HIGH_RISK_API" +_AT__ = "ATTACK_TECHNIQUE" +_UAFA = "UNUSUAL_API_FOR_ACCOUNT" +_UAFA_ = "UNUSUAL_ASN_FOR_ACCOUNT" +_UAFU = "UNUSUAL_ASN_FOR_USER" +_SP = "SUSPICIOUS_PROCESS" +_MD = "MALICIOUS_DOMAIN" +_MP_ = "MALICIOUS_PROCESS" +_CI_ = "CRYPTOMINING_IP" +_CD_ = "CRYPTOMINING_DOMAIN" +_CP_ = "CRYPTOMINING_PROCESS" +_MF = "MALICIOUS_FILE" +_VULNERABILITY = "VULNERABILITY" +_MP__ = "MALICIOUS_PACKAGE" +_MISCONFIGURATION = "MISCONFIGURATION" +_REACHABILITY = "REACHABILITY" +_SD_ = "SENSITIVE_DATA" +_ITnd = "IndicatorTitle" +_IVS = "IndicatorValueString" +_IV = "IndicatorValues" +_In = "Indicator" +_Val = "Values" +_va = "values" +_Tit = "Title" +_ti = "title" +_Ind = "Indicators" +_SDi = "SignalDescription" +_EIn = "EndpointIds" +_RUe = "ResourceUids" +_STi = "SignalType" +_FINDING = "FINDING" +_Si = "Signal" +_FSA = "FirstSeenAt" +_fSA = "firstSeenAt" +_LSA = "LastSeenAt" +_lSA = "lastSeenAt" +_Cou = "Count" +_cou = "count" +_rUe = "resourceUids" +_aIct = "actorIds" +_eIn = "endpointIds" +_SIi = "SignalIndicators" +_sIi = "signalIndicators" +_activ = "activities" +_Sig = "Signals" +_Seq = "Sequence" +_acto = "actors" +_reso = "resources" +_End = "Endpoints" +_end = "endpoints" +_si = "signals" +_SIe = "SequenceIndicators" +_sIe = "sequenceIndicators" +_aST = "additionalSequenceTypes" +_Det = "Detection" +_an = "anomaly" +_seq = "sequence" +_DRCS = "DetectionRuleConfigurationStatus" +_PROCESSING = "PROCESSING" +_DRDS = "DetectionRuleDataSource" +_CME = "CLOUDTRAIL_MANAGEMENT_EVENT" +_CTME = "CloudTrailManagementEvent" +_DRD = "DetectionRuleDescription" +_DRFC = "DetectionRuleFilterCondition" +_EQUALS = "EQUALS" +_CONTAINS = "CONTAINS" +_FFN = "FilterFieldName" +_NAME = "NAME" +_DESCRIPTION = "DESCRIPTION" +_DS_ = "DATA_SOURCE" +_dSa = "dataSource" +_SEVERITY = "SEVERITY" +_TACTIC = "TACTIC" +_tac = "tactic" +_TECHNIQUE = "TECHNIQUE" +_tec = "technique" +_SERVICE = "SERVICE" +_DRFV = "DetectionRuleFilterValue" +_DRFVe = "DetectionRuleFilterValues" +_DRF = "DetectionRuleFilter" +_cond = "condition" +_DRFL = "DetectionRuleFilterList" +_DRMR = "DetectionRuleMaxResults" +_DROC = "DetectionRuleOrgConfiguration" +_SRt = "StatusReason" +_sRt = "statusReason" +_DROCS = "DetectionRuleOrgConfigurationSummary" +_DROCSL = "DetectionRuleOrgConfigurationSummaryList" +_DRSN = "DetectionRuleServiceName" +_DRS = "DetectionRuleSeverity" +_CRITICAL = "CRITICAL" +_DSe = "DetectionSource" +_AMAZON = "AMAZON" +_BITDEFENDER = "BITDEFENDER" +_MB = "ManagedBy" +_GP = "GUARDDUTY_POLICY" +_DACR = "DetectorAdditionalConfigurationResult" +_mB = "managedBy" +_DACRe = "DetectorAdditionalConfigurationResults" +_DFR = "DetectorFeatureResult" +_DFCR = "DetectorFeatureConfigurationResult" +_DFCRe = "DetectorFeatureConfigurationsResults" +_DIet = "DetectorIds" +_DSet = "DetectorStatus" +_DOAAI = "DisableOrganizationAdminAccountInput" +_cDOAAR = "com.amazonaws.guardduty#DisableOrganizationAdminAccountRequest" +_DOAAO = "DisableOrganizationAdminAccountOutput" +_cDOAARo = "com.amazonaws.guardduty#DisableOrganizationAdminAccountResponse" +_DOAA = "DisableOrganizationAdminAccount" +_DFAAI = "DisassociateFromAdministratorAccountInput" +_cDFAAR = "com.amazonaws.guardduty#DisassociateFromAdministratorAccountRequest" +_DFAAO = "DisassociateFromAdministratorAccountOutput" +_cDFAARo = "com.amazonaws.guardduty#DisassociateFromAdministratorAccountResponse" +_DFAA = "DisassociateFromAdministratorAccount" +_DFMAI = "DisassociateFromMasterAccountInput" +_cDFMAR = "com.amazonaws.guardduty#DisassociateFromMasterAccountRequest" +_DFMAO = "DisassociateFromMasterAccountOutput" +_cDFMARo = "com.amazonaws.guardduty#DisassociateFromMasterAccountResponse" +_DFMA = "DisassociateFromMasterAccount" +_DMIi = "DisassociateMembersInput" +_cDMRom = "com.amazonaws.guardduty#DisassociateMembersRequest" +_DMOi = "DisassociateMembersOutput" +_cDMRoma = "com.amazonaws.guardduty#DisassociateMembersResponse" +_DMi = "DisassociateMembers" +_ES = "EbsSnapshot" +_ESD = "EbsSnapshotDetails" +_ESP = "EbsSnapshotPreservation" +_NR_ = "NO_RETENTION" +_RWF = "RETENTION_WITH_FINDING" +_EVD = "EbsVolumeDetails" +_SVD = "ScannedVolumeDetails" +_sVD = "scannedVolumeDetails" +_SVDk = "SkippedVolumeDetails" +_sVDk = "skippedVolumeDetails" +_HSTD = "HighestSeverityThreatDetails" +_TN = "ThreatName" +_tN = "threatName" +_SIC = "ScannedItemCount" +_TG = "TotalGb" +_tG = "totalGb" +_Fi = "Files" +_fi = "files" +_Vo = "Volumes" +_vo = "volumes" +_SFP = "ScanFilePath" +_FP = "FilePath" +_fP = "filePath" +_Ha = "Hash" +_h = "hash" +_FNi = "FileName" +_fN = "fileName" +_FPi = "FilePaths" +_STN = "ScanThreatName" +_IC = "ItemCount" +_iC = "itemCount" +_fPi = "filePaths" +_STNc = "ScanThreatNames" +_TDBN = "ThreatDetectedByName" +_UTNC = "UniqueThreatNameCount" +_uTNC = "uniqueThreatNameCount" +_Sho = "Shortened" +_sho = "shortened" +_TNh = "ThreatNames" +_tNh = "threatNames" +_TDIC = "ThreatsDetectedItemCount" +_SDc = "ScanDetections" +_sIC = "scannedItemCount" +_tDIC = "threatsDetectedItemCount" +_hSTD = "highestSeverityThreatDetails" +_tDBN = "threatDetectedByName" +_So = "Sources" +_EVSD = "EbsVolumeScanDetails" +_SSA = "ScanStartedAt" +_sSA = "scanStartedAt" +_SCA = "ScanCompletedAt" +_sCA = "scanCompletedAt" +_TFI = "TriggerFindingId" +_tFI = "triggerFindingId" +_so = "sources" +_sD = "scanDetections" +_EIDc = "Ec2ImageDetails" +_IAm = "ImageArn" +_iAm = "imageArn" +_HP = "HostPath" +_Vol = "Volume" +_hP = "hostPath" +_ETD = "EcsTaskDetails" +_DAe = "DefinitionArn" +_dAe = "definitionArn" +_TCA = "TaskCreatedAt" +_SAt = "StartedAt" +_sAt = "startedAt" +_SBt = "StartedBy" +_sBt = "startedBy" +_conta = "containers" +_Gr = "Group" +_gr = "group" +_ASCc = "ActiveServicesCount" +_aSC = "activeServicesCount" +_RCIC = "RegisteredContainerInstancesCount" +_rCIC = "registeredContainerInstancesCount" +_RTC = "RunningTasksCount" +_rTC = "runningTasksCount" +_TDa = "TaskDetails" +_tDa = "taskDetails" +_EOAAI = "EnableOrganizationAdminAccountInput" +_cEOAAR = "com.amazonaws.guardduty#EnableOrganizationAdminAccountRequest" +_EOAAO = "EnableOrganizationAdminAccountOutput" +_cEOAARo = "com.amazonaws.guardduty#EnableOrganizationAdminAccountResponse" +_EOAA = "EnableOrganizationAdminAccount" +_TID = "ThreatIntelligenceDetail" +_TLN = "ThreatListName" +_tLN = "threatListName" +_TFS = "ThreatFileSha256" +_tFS = "threatFileSha256" +_TIDh = "ThreatIntelligenceDetails" +_Ev = "Evidence" +_tID = "threatIntelligenceDetails" +_Fe = "Feedback" +_USEFUL = "USEFUL" +_NU = "NOT_USEFUL" +_FNil = "FilterNames" +_FV = "FilterVersion" +_NIe = "NetworkInterface" +_NII = "NetworkInterfaceId" +_nII = "networkInterfaceId" +_PDNu = "PublicDnsName" +_pDNu = "publicDnsName" +_SIu = "SubnetId" +_sIu = "subnetId" +_NIet = "NetworkInterfaces" +_IDn = "InstanceDetails" +_IIm = "ImageId" +_iIm = "imageId" +_LTau = "LaunchTime" +_lTau = "launchTime" +_nI = "networkInterfaces" +_Gro = "Groups" +_IUm = "ImpersonatedUser" +_Use = "Username" +_use = "username" +_gro = "groups" +_SNL = "SessionNameList" +_KUD = "KubernetesUserDetails" +_SNe = "SessionName" +_sNes = "sessionName" +_iUm = "impersonatedUser" +_KWD = "KubernetesWorkloadDetails" +_HN = "HostNetwork" +_hN = "hostNetwork" +_SAN = "ServiceAccountName" +_sAN = "serviceAccountName" +_HIPC = "HostIPC" +_hIPC = "hostIPC" +_HPID = "HostPID" +_hPID = "hostPID" +_KD = "KubernetesDetails" +_kUD = "kubernetesUserDetails" +_kWD = "kubernetesWorkloadDetails" +_SIub = "SubnetIds" +_VC = "VpcConfig" +_sIub = "subnetIds" +_LD = "LambdaDetails" +_FAu = "FunctionArn" +_fA = "functionArn" +_FNu = "FunctionName" +_fNu = "functionName" +_LMA = "LastModifiedAt" +_lMA = "lastModifiedAt" +_RIev = "RevisionId" +_rIev = "revisionId" +_FVu = "FunctionVersion" +_fV = "functionVersion" +_vC = "vpcConfig" +_MDo = "ModelDetail" +_MIo = "ModelId" +_mIo = "modelId" +_MDod = "ModelDetails" +_RDID = "RdsDbInstanceDetails" +_DIIb = "DbInstanceIdentifier" +_dII = "dbInstanceIdentifier" +_Eng = "Engine" +_eng = "engine" +_EVn = "EngineVersion" +_eVn = "engineVersion" +_DCI = "DbClusterIdentifier" +_dCI = "dbClusterIdentifier" +_DIA = "DbInstanceArn" +_dIA = "dbInstanceArn" +_DRI = "DbiResourceId" +_dRI = "dbiResourceId" +_RDUD = "RdsDbUserDetails" +_Data = "Database" +_data = "database" +_Ss = "Ssl" +_ss = "ssl" +_AMu = "AuthMethod" +_aM = "authMethod" +_RLDD = "RdsLimitlessDbDetails" +_DSGI = "DbShardGroupIdentifier" +_dSGI = "dbShardGroupIdentifier" +_DSGRI = "DbShardGroupResourceId" +_dSGRI = "dbShardGroupResourceId" +_DSGA = "DbShardGroupArn" +_dSGA = "dbShardGroupArn" +_SCCSD = "ScanConfigurationContinuousScanDetails" +_RPDe = "RecoveryPointDetails" +_RPA = "RecoveryPointArn" +_rPA = "recoveryPointArn" +_BVN = "BackupVaultName" +_bVN = "backupVaultName" +_cSD = "continuousScanDetails" +_Ow = "Owner" +_PCe = "PermissionConfiguration" +_bLP = "bucketLevelPermissions" +_aLP = "accountLevelPermissions" +_PAu = "PublicAccess" +_pCe = "permissionConfiguration" +_SOD = "S3ObjectDetail" +_OAb = "ObjectArn" +_oAb = "objectArn" +_SODb = "S3ObjectDetails" +_SBD = "S3BucketDetail" +_ow = "owner" +_dSSE = "defaultServerSideEncryption" +_pA = "publicAccess" +_sOD = "s3ObjectDetails" +_SBDu = "S3BucketDetails" +_aKD = "accessKeyDetails" +_sBD = "s3BucketDetails" +_iDn = "instanceDetails" +_kD = "kubernetesDetails" +_eVD = "ebsVolumeDetails" +_CDo = "ContainerDetails" +_cDo = "containerDetails" +_lD = "lambdaDetails" +_rDID = "rdsDbInstanceDetails" +_rLDD = "rdsLimitlessDbDetails" +_rDUD = "rdsDbUserDetails" +_eSD = "ebsSnapshotDetails" +_eIDc = "ec2ImageDetails" +_rPDe = "recoveryPointDetails" +_bGD = "bedrockGuardrailDetails" +_mD = "modelDetails" +_SAI = "ServiceAdditionalInfo" +_SCc = "ScanCategory" +_FS_ = "FULL_SCAN" +_IS_ = "INCREMENTAL_SCAN" +_ISD = "IncrementalScanDetails" +_BRA = "BaselineResourceArn" +_bRA = "baselineResourceArn" +_MPFSC = "MalwareProtectionFindingsScanConfiguration" +_iSD = "incrementalScanDetails" +_MPST = "MalwareProtectionScanType" +_BI = "BACKUP_INITIATED" +_IDt = "ItemDetails" +_RAe = "ResourceArn" +_rAe = "resourceArn" +_IPt = "ItemPath" +_iPt = "itemPath" +_aId = "additionalInfo" +_IDL = "ItemDetailsList" +_NIP = "NestedItemPath" +_nIP = "nestedItemPath" +_IPte = "ItemPaths" +_Th = "Threat" +_Sou = "Source" +_sou = "source" +_iPte = "itemPaths" +_iDt = "itemDetails" +_Thr = "Threats" +_MSD = "MalwareScanDetails" +_th = "threats" +_sCc = "scanCategory" +_SCca = "ScanConfiguration" +_sCca = "scanConfiguration" +_UTC = "UniqueThreatCount" +_uTC = "uniqueThreatCount" +_FLl = "FlagsList" +_MRL = "MemoryRegionsList" +_LO = "LineageObject" +_NP = "NamespacePid" +_nP = "namespacePid" +_UI = "UserId" +_uI = "userId" +_Pi = "Pid" +_pi = "pid" +_Uu = "Uuid" +_uu = "uuid" +_EPx = "ExecutablePath" +_ePx = "executablePath" +_Eu = "Euid" +_eu = "euid" +_PU = "ParentUuid" +_pU = "parentUuid" +_Li = "Lineage" +_PD = "ProcessDetails" +_ESx = "ExecutableSha256" +_eS = "executableSha256" +_Pw = "Pwd" +_pw = "pwd" +_li = "lineage" +_RFPL = "RelatedFilePathsList" +_RC = "RuntimeContext" +_MPod = "ModifyingProcess" +_mPod = "modifyingProcess" +_MA = "ModifiedAt" +_mA = "modifiedAt" +_SPc = "ScriptPath" +_sP = "scriptPath" +_LP = "LibraryPath" +_lP = "libraryPath" +_LPV = "LdPreloadValue" +_lPV = "ldPreloadValue" +_SPo = "SocketPath" +_sPo = "socketPath" +_RBP = "RuncBinaryPath" +_rBP = "runcBinaryPath" +_RAP = "ReleaseAgentPath" +_rAP = "releaseAgentPath" +_MSo = "MountSource" +_mSo = "mountSource" +_MTo = "MountTarget" +_mTo = "mountTarget" +_FST = "FileSystemType" +_fST = "fileSystemType" +_Fl = "Flags" +_fl = "flags" +_MN = "ModuleName" +_mN = "moduleName" +_MFP = "ModuleFilePath" +_mFP = "moduleFilePath" +_MSod = "ModuleSha256" +_mSod = "moduleSha256" +_SHFP = "ShellHistoryFilePath" +_sHFP = "shellHistoryFilePath" +_TPa = "TargetProcess" +_tPa = "targetProcess" +_AFd = "AddressFamily" +_aF = "addressFamily" +_IPN = "IanaProtocolNumber" +_iPN = "ianaProtocolNumber" +_MRe = "MemoryRegions" +_mRe = "memoryRegions" +_TNo = "ToolName" +_tNo = "toolName" +_TC = "ToolCategory" +_tC = "toolCategory" +_CLE = "CommandLineExample" +_cLE = "commandLineExample" +_TFP = "ThreatFilePath" +_tFP = "threatFilePath" +_FO = "FileOperation" +_fO = "fileOperation" +_RFP = "RelatedFilePaths" +_rFP = "relatedFilePaths" +_RDu = "RuntimeDetails" +_Conte = "Context" +_conte = "context" +_ev = "evidence" +_Arc = "Archived" +_arc = "archived" +_EFS = "EventFirstSeen" +_eFS = "eventFirstSeen" +_ELS = "EventLastSeen" +_eLS = "eventLastSeen" +_RR = "ResourceRole" +_rR = "resourceRole" +_UF = "UserFeedback" +_uF = "userFeedback" +_FNe = "FeatureName" +_fNe = "featureName" +_eVSD = "ebsVolumeScanDetails" +_rDu = "runtimeDetails" +_det = "detection" +_mSD = "malwareScanDetails" +_Fin = "Finding" +_Par = "Partition" +_par = "partition" +_SV = "SchemaVersion" +_sVc = "schemaVersion" +_AASA = "AssociatedAttackSequenceArn" +_aASA = "associatedAttackSequenceArn" +_Find = "Findings" +_GBA = "GroupedByAccount" +_GBD = "GroupedByDate" +_FTS = "FindingTypeStatistics" +_fTi = "findingType" +_GBFT = "GroupedByFindingType" +_RSe = "ResourceStatistics" +_GBR = "GroupedByResource" +_SSe = "SeverityStatistics" +_GBS = "GroupedBySeverity" +_FSi = "FindingStatistics" +_cBS = "countBySeverity" +_gBA = "groupedByAccount" +_gBD = "groupedByDate" +_gBFT = "groupedByFindingType" +_gBR = "groupedByResource" +_gBS = "groupedBySeverity" +_FSTi = "FindingStatisticType" +_CBS_ = "COUNT_BY_SEVERITY" +_FSTin = "FindingStatisticTypes" +_GAAI = "GetAdministratorAccountInput" +_cGAAR = "com.amazonaws.guardduty#GetAdministratorAccountRequest" +_GAAO = "GetAdministratorAccountOutput" +_cGAARo = "com.amazonaws.guardduty#GetAdministratorAccountResponse" +_ad = "administrator" +_GAA = "GetAdministratorAccount" +_GCSI = "GetCoverageStatisticsInput" +_cGCSR = "com.amazonaws.guardduty#GetCoverageStatisticsRequest" +_STt = "StatisticsType" +_sTt = "statisticsType" +_GCSO = "GetCoverageStatisticsOutput" +_cGCSRo = "com.amazonaws.guardduty#GetCoverageStatisticsResponse" +_cSo = "coverageStatistics" +_GCS = "GetCoverageStatistics" +_GCDRI = "GetCustomDetectionRuleInput" +_cGCDRR = "com.amazonaws.guardduty#GetCustomDetectionRuleRequest" +_RE = "RuleExpression" +_RDul = "RuleDefinition" +_Ex = "Expression" +_ex = "expression" +_RL = "RuleLanguage" +_SQL = "SQL" +_RNu = "RuleName" +_RSu = "RuleSchema" +_MTi = "MitreTactic" +_MTit = "MitreTechnique" +_RDule = "RuleDetail" +_Tac = "Tactic" +_Tec = "Technique" +_Def = "Definition" +_def = "definition" +_Lan = "Language" +_la = "language" +_Sch = "Schema" +_sch = "schema" +_GCDRO = "GetCustomDetectionRuleOutput" +_cGCDRRo = "com.amazonaws.guardduty#GetCustomDetectionRuleResponse" +_Ru = "Rule" +_ru = "rule" +_GCDR = "GetCustomDetectionRule" +_GCDRAI = "GetCustomDetectionRuleAssociationInput" +_cGCDRAR = "com.amazonaws.guardduty#GetCustomDetectionRuleAssociationRequest" +_GCDRAO = "GetCustomDetectionRuleAssociationOutput" +_cGCDRARo = "com.amazonaws.guardduty#GetCustomDetectionRuleAssociationResponse" +_GCDRA = "GetCustomDetectionRuleAssociation" +_GCDROCI = "GetCustomDetectionRuleOrgConfigurationInput" +_cGCDROCR = "com.amazonaws.guardduty#GetCustomDetectionRuleOrgConfigurationRequest" +_GCDROCO = "GetCustomDetectionRuleOrgConfigurationOutput" +_cGCDROCRo = "com.amazonaws.guardduty#GetCustomDetectionRuleOrgConfigurationResponse" +_Conf = "Configuration" +_conf = "configuration" +_GCDROC = "GetCustomDetectionRuleOrgConfiguration" +_GDI = "GetDetectorInput" +_cGDR = "com.amazonaws.guardduty#GetDetectorRequest" +_GDO = "GetDetectorOutput" +_cGDRo = "com.amazonaws.guardduty#GetDetectorResponse" +_GD = "GetDetector" +_GFIe = "GetFilterInput" +_cGFR = "com.amazonaws.guardduty#GetFilterRequest" +_GFO = "GetFilterOutput" +_cGFRo = "com.amazonaws.guardduty#GetFilterResponse" +_GF = "GetFilter" +_GFIet = "GetFindingsInput" +_cGFRom = "com.amazonaws.guardduty#GetFindingsRequest" +_GFOe = "GetFindingsOutput" +_cGFRoma = "com.amazonaws.guardduty#GetFindingsResponse" +_fin = "findings" +_GFe = "GetFindings" +_GBT = "GroupByType" +_ACCOUNT = "ACCOUNT" +_DATE = "DATE" +_FT_ = "FINDING_TYPE" +_RESOURCE = "RESOURCE" +_MRa = "MaxResults100" +_GFSI = "GetFindingsStatisticsInput" +_cGFSR = "com.amazonaws.guardduty#GetFindingsStatisticsRequest" +_fSTi = "findingStatisticTypes" +_GB = "GroupBy" +_gB = "groupBy" +_GFSO = "GetFindingsStatisticsOutput" +_cGFSRo = "com.amazonaws.guardduty#GetFindingsStatisticsResponse" +_fS = "findingStatistics" +_GFS = "GetFindingsStatistics" +_GII = "GetInvestigationInput" +_cGIR = "com.amazonaws.guardduty#GetInvestigationRequest" +_IED = "InvestigationErrorDetails" +_Prod = "Product" +_Fea = "Feature" +_fe = "feature" +_IM = "InvestigationMetadata" +_prod = "product" +_RDi = "RiskDetails" +_RLi = "RiskLevel" +_INFO = "INFO" +_Inf = "Info" +_Cri = "Critical" +_ISn = "InvestigationStatus" +_TBr = "TriggeredBy" +_Inv = "Investigation" +_tBr = "triggeredBy" +_Met = "Metadata" +_met = "metadata" +_Cl = "Cloud" +_cl = "cloud" +_rL = "riskLevel" +_Ri = "Risk" +_ri = "risk" +_Sum = "Summary" +_sum = "summary" +_GIO = "GetInvestigationOutput" +_cGIRo = "com.amazonaws.guardduty#GetInvestigationResponse" +_in = "investigation" +_GIe = "GetInvestigation" +_GICI = "GetInvitationsCountInput" +_cGICR = "com.amazonaws.guardduty#GetInvitationsCountRequest" +_GICO = "GetInvitationsCountOutput" +_cGICRo = "com.amazonaws.guardduty#GetInvitationsCountResponse" +_ICn = "InvitationsCount" +_iCn = "invitationsCount" +_GIC = "GetInvitationsCount" +_GIPSI = "GetIPSetInput" +_cGIPSR = "com.amazonaws.guardduty#GetIPSetRequest" +_ISS = "IpSetStatus" +_ACTIVATING = "ACTIVATING" +_DEACTIVATING = "DEACTIVATING" +_ERROR = "ERROR" +_DP_ = "DELETE_PENDING" +_DELETED = "DELETED" +_GIPSO = "GetIPSetOutput" +_cGIPSRo = "com.amazonaws.guardduty#GetIPSetResponse" +_GIPS = "GetIPSet" +_GMPPI = "GetMalwareProtectionPlanInput" +_cGMPPR = "com.amazonaws.guardduty#GetMalwareProtectionPlanRequest" +_MPPS = "MalwareProtectionPlanStatus" +_WARNING = "WARNING" +_MPPSR = "MalwareProtectionPlanStatusReason" +_cod = "code" +_MPPSRL = "MalwareProtectionPlanStatusReasonsList" +_GMPPO = "GetMalwareProtectionPlanOutput" +_cGMPPRo = "com.amazonaws.guardduty#GetMalwareProtectionPlanResponse" +_SRta = "StatusReasons" +_sRta = "statusReasons" +_GMPP = "GetMalwareProtectionPlan" +_GMSI = "GetMalwareScanInput" +_cGMSR = "com.amazonaws.guardduty#GetMalwareScanRequest" +_NNI = "NonNegativeInteger" +_MPRT = "MalwareProtectionResourceType" +_ERP = "EBS_RECOVERY_POINT" +_ES_ = "EBS_SNAPSHOT" +_EV__ = "EBS_VOLUME" +_EA_ = "EC2_AMI" +_ERP_ = "EC2_RECOVERY_POINT" +_SRP = "S3_RECOVERY_POINT" +_SPITR = "S3_POINT_IN_TIME_RECOVERY" +_SCRP = "ScanConfigurationRecoveryPoint" +_RP = "RecoveryPoint" +_rP = "recoveryPoint" +_SRDc = "ScannedResourceDetails" +_EVb = "EbsVolume" +_eVb = "ebsVolume" +_eSb = "ebsSnapshot" +_MPSS = "MalwareProtectionScanStatus" +_CWI = "COMPLETED_WITH_ISSUES" +_SSR = "ScanStatusReason" +_AD_ = "ACCESS_DENIED" +_RNF = "RESOURCE_NOT_FOUND" +_SSLE = "SNAPSHOT_SIZE_LIMIT_EXCEEDED" +_RU_ = "RESOURCE_UNAVAILABLE" +_IS__ = "INCONSISTENT_SOURCE" +_IND = "INCREMENTAL_NO_DIFFERENCE" +_NEVF = "NO_EBS_VOLUMES_FOUND" +_UPCT = "UNSUPPORTED_PRODUCT_CODE_TYPE" +_ASLE = "AMI_SNAPSHOT_LIMIT_EXCEEDED" +_UR = "UNRELATED_RESOURCES" +_BRNS = "BASE_RESOURCE_NOT_SCANNED" +_BCAT = "BASE_CREATED_AFTER_TARGET" +_UFI = "UNSUPPORTED_FOR_INCREMENTAL" +_UA__ = "UNSUPPORTED_AMI" +_US = "UNSUPPORTED_SNAPSHOT" +_UCRP = "UNSUPPORTED_COMPOSITE_RECOVERY_POINT" +_AFSOF = "ALL_FILES_SKIPPED_OR_FAILED" +_SRca = "ScannedResource" +_SRA = "ScannedResourceArn" +_sRA = "scannedResourceArn" +_SRT = "ScannedResourceType" +_sRT = "scannedResourceType" +_SRS = "ScannedResourceStatus" +_sRS = "scannedResourceStatus" +_sSR = "scanStatusReason" +_SRcan = "ScannedResources" +_SRSc = "ScanResultStatus" +_NTF = "NO_THREATS_FOUND" +_TF_ = "THREATS_FOUND" +_SRTc = "ScanResultThreat" +_SRTca = "ScanResultThreats" +_GMSRD = "GetMalwareScanResultDetails" +_sRSc = "scanResultStatus" +_SFC = "SkippedFileCount" +_sFC = "skippedFileCount" +_FFC = "FailedFileCount" +_fFC = "failedFileCount" +_TFFC = "ThreatFoundFileCount" +_tFFC = "threatFoundFileCount" +_TFC = "TotalFileCount" +_tFC = "totalFileCount" +_GMSO = "GetMalwareScanOutput" +_cGMSRo = "com.amazonaws.guardduty#GetMalwareScanResponse" +_SRC = "ScannedResourcesCount" +_sRC = "scannedResourcesCount" +_SRCk = "SkippedResourcesCount" +_sRCk = "skippedResourcesCount" +_FRC = "FailedResourcesCount" +_fRC = "failedResourcesCount" +_sRca = "scannedResources" +_GMS = "GetMalwareScan" +_GMSSI = "GetMalwareScanSettingsInput" +_cGMSSR = "com.amazonaws.guardduty#GetMalwareScanSettingsRequest" +_SCK = "ScanCriterionKey" +_EIT = "EC2_INSTANCE_TAG" +_SCP = "ScanConditionPair" +_ME = "MapEquals" +_SCcan = "ScanCondition" +_mE = "mapEquals" +_SCcanr = "ScanCriterion" +_SRCc = "ScanResourceCriteria" +_Inc = "Include" +_inc = "include" +_Exc = "Exclude" +_exc = "exclude" +_GMSSO = "GetMalwareScanSettingsOutput" +_cGMSSRo = "com.amazonaws.guardduty#GetMalwareScanSettingsResponse" +_sRCc = "scanResourceCriteria" +_eSP = "ebsSnapshotPreservation" +_GMSS = "GetMalwareScanSettings" +_GMAI = "GetMasterAccountInput" +_cGMAR = "com.amazonaws.guardduty#GetMasterAccountRequest" +_Mas = "Master" +_GMAO = "GetMasterAccountOutput" +_cGMARo = "com.amazonaws.guardduty#GetMasterAccountResponse" +_mas = "master" +_GMA = "GetMasterAccount" +_GMDI = "GetMemberDetectorsInput" +_cGMDR = "com.amazonaws.guardduty#GetMemberDetectorsRequest" +_MACR = "MemberAdditionalConfigurationResult" +_MACRe = "MemberAdditionalConfigurationResults" +_MFCR = "MemberFeaturesConfigurationResult" +_MFCRe = "MemberFeaturesConfigurationsResults" +_MDSC = "MemberDataSourceConfiguration" +_MDSCe = "MemberDataSourceConfigurations" +_GMDO = "GetMemberDetectorsOutput" +_cGMDRo = "com.amazonaws.guardduty#GetMemberDetectorsResponse" +_mem = "members" +_GMD = "GetMemberDetectors" +_GMI = "GetMembersInput" +_cGMR = "com.amazonaws.guardduty#GetMembersRequest" +_Mem = "Member" +_Memb = "Members" +_GMO = "GetMembersOutput" +_cGMRo = "com.amazonaws.guardduty#GetMembersResponse" +_GM = "GetMembers" +_GOSI = "GetOrganizationStatisticsInput" +_OFSAC = "OrganizationFeatureStatisticsAdditionalConfiguration" +_EAC = "EnabledAccountsCount" +_eAC = "enabledAccountsCount" +_OFSACr = "OrganizationFeatureStatisticsAdditionalConfigurations" +_OFSr = "OrganizationFeatureStatistics" +_OFSR = "OrganizationFeatureStatisticsResults" +_OS = "OrganizationStatistics" +_TAC = "TotalAccountsCount" +_tAC = "totalAccountsCount" +_MAC = "MemberAccountsCount" +_mAC = "memberAccountsCount" +_AAC = "ActiveAccountsCount" +_aAC = "activeAccountsCount" +_CBF = "CountByFeature" +_cBF = "countByFeature" +_ODr = "OrganizationDetails" +_oS = "organizationStatistics" +_GOSO = "GetOrganizationStatisticsOutput" +_cGOSR = "com.amazonaws.guardduty#GetOrganizationStatisticsResponse" +_oD = "organizationDetails" +_GOS = "GetOrganizationStatistics" +_GRFTDI = "GetRemainingFreeTrialDaysInput" +_cGRFTDR = "com.amazonaws.guardduty#GetRemainingFreeTrialDaysRequest" +_GRFTDO = "GetRemainingFreeTrialDaysOutput" +_cGRFTDRo = "com.amazonaws.guardduty#GetRemainingFreeTrialDaysResponse" +_Acc = "Accounts" +_acc = "accounts" +_GRFTD = "GetRemainingFreeTrialDays" +_GTESI = "GetThreatEntitySetInput" +_cGTESR = "com.amazonaws.guardduty#GetThreatEntitySetRequest" +_TESS = "ThreatEntitySetStatus" +_GTESO = "GetThreatEntitySetOutput" +_cGTESRo = "com.amazonaws.guardduty#GetThreatEntitySetResponse" +_ED = "ErrorDetails" +_eD = "errorDetails" +_GTES = "GetThreatEntitySet" +_GTISI = "GetThreatIntelSetInput" +_cGTISR = "com.amazonaws.guardduty#GetThreatIntelSetRequest" +_TISS = "ThreatIntelSetStatus" +_GTISO = "GetThreatIntelSetOutput" +_cGTISRo = "com.amazonaws.guardduty#GetThreatIntelSetResponse" +_GTIS = "GetThreatIntelSet" +_GTESIe = "GetTrustedEntitySetInput" +_cGTESRom = "com.amazonaws.guardduty#GetTrustedEntitySetRequest" +_TESSr = "TrustedEntitySetStatus" +_GTESOe = "GetTrustedEntitySetOutput" +_cGTESRoma = "com.amazonaws.guardduty#GetTrustedEntitySetResponse" +_GTESe = "GetTrustedEntitySet" +_UFs = "UsageFeature" +_RDPP = "RDS_DBI_PROTECTION_PROVISIONED" +_RDPS = "RDS_DBI_PROTECTION_SERVERLESS" +_UFL = "UsageFeatureList" +_RLe = "ResourceList" +_UC = "UsageCriteria" +_UST = "UsageStatisticType" +_SBA = "SUM_BY_ACCOUNT" +_SBDS = "SUM_BY_DATA_SOURCE" +_SBR = "SUM_BY_RESOURCE" +_TR = "TOP_RESOURCES" +_SBF = "SUM_BY_FEATURES" +_TABF = "TOP_ACCOUNTS_BY_FEATURE" +_GUSI = "GetUsageStatisticsInput" +_cGUSR = "com.amazonaws.guardduty#GetUsageStatisticsRequest" +_uST = "usageStatisticsType" +_uC = "usageCriteria" +_Uni = "Unit" +_uni = "unit" +_To = "Total" +_Am = "Amount" +_am = "amount" +_UAR = "UsageAccountResult" +_to = "total" +_UARL = "UsageAccountResultList" +_UDSRs = "UsageDataSourceResult" +_UDSRL = "UsageDataSourceResultList" +_UFR = "UsageFeatureResult" +_UFRL = "UsageFeatureResultList" +_URR = "UsageResourceResult" +_URRL = "UsageResourceResultList" +_UTAR = "UsageTopAccountResult" +_UTABFL = "UsageTopAccountsByFeatureList" +_UTARs = "UsageTopAccountsResult" +_UTARL = "UsageTopAccountsResultList" +_USs = "UsageStatistics" +_SBAu = "SumByAccount" +_sBA = "sumByAccount" +_TABFo = "TopAccountsByFeature" +_tABF = "topAccountsByFeature" +_SBDSu = "SumByDataSource" +_sBDS = "sumByDataSource" +_SBRu = "SumByResource" +_sBR = "sumByResource" +_TRo = "TopResources" +_tR = "topResources" +_SBFu = "SumByFeature" +_sBF = "sumByFeature" +_GUSO = "GetUsageStatisticsOutput" +_cGUSRo = "com.amazonaws.guardduty#GetUsageStatisticsResponse" +_uS = "usageStatistics" +_GUS = "GetUsageStatistics" +_IMI = "InviteMembersInput" +_cIMR = "com.amazonaws.guardduty#InviteMembersRequest" +_DEN = "DisableEmailNotification" +_dEN = "disableEmailNotification" +_IMO = "InviteMembersOutput" +_cIMRo = "com.amazonaws.guardduty#InviteMembersResponse" +_IMn = "InviteMembers" +_LCI = "ListCoverageInput" +_cLCR = "com.amazonaws.guardduty#ListCoverageRequest" +_LCO = "ListCoverageOutput" +_cLCRo = "com.amazonaws.guardduty#ListCoverageResponse" +_LC = "ListCoverage" +_LCDRAI = "ListCustomDetectionRuleAssociationsInput" +_cLCDRAR = "com.amazonaws.guardduty#ListCustomDetectionRuleAssociationsRequest" +_LCDRAO = "ListCustomDetectionRuleAssociationsOutput" +_cLCDRARo = "com.amazonaws.guardduty#ListCustomDetectionRuleAssociationsResponse" +_RAu = "RuleAssociations" +_rAu = "ruleAssociations" +_LCDRA = "ListCustomDetectionRuleAssociations" +_LCDROCI = "ListCustomDetectionRuleOrgConfigurationsInput" +_cLCDROCR = "com.amazonaws.guardduty#ListCustomDetectionRuleOrgConfigurationsRequest" +_LCDROCO = "ListCustomDetectionRuleOrgConfigurationsOutput" +_cLCDROCRo = "com.amazonaws.guardduty#ListCustomDetectionRuleOrgConfigurationsResponse" +_Confi = "Configurations" +_confi = "configurations" +_LCDROC = "ListCustomDetectionRuleOrgConfigurations" +_LCDRI = "ListCustomDetectionRulesInput" +_cLCDRR = "com.amazonaws.guardduty#ListCustomDetectionRulesRequest" +_Fil = "Filters" +_fil = "filters" +_RSul = "RuleSummary" +_RSL = "RuleSummaryList" +_LCDRO = "ListCustomDetectionRulesOutput" +_cLCDRRo = "com.amazonaws.guardduty#ListCustomDetectionRulesResponse" +_Rul = "Rules" +_rul = "rules" +_LCDR = "ListCustomDetectionRules" +_LDI = "ListDetectorsInput" +_cLDR = "com.amazonaws.guardduty#ListDetectorsRequest" +_LDO = "ListDetectorsOutput" +_cLDRo = "com.amazonaws.guardduty#ListDetectorsResponse" +_dIet = "detectorIds" +_LDi = "ListDetectors" +_LFI = "ListFiltersInput" +_cLFR = "com.amazonaws.guardduty#ListFiltersRequest" +_LFO = "ListFiltersOutput" +_cLFRo = "com.amazonaws.guardduty#ListFiltersResponse" +_fNi = "filterNames" +_LF = "ListFilters" +_LFIi = "ListFindingsInput" +_cLFRom = "com.amazonaws.guardduty#ListFindingsRequest" +_LFOi = "ListFindingsOutput" +_cLFRoma = "com.amazonaws.guardduty#ListFindingsResponse" +_LFi = "ListFindings" +_ISFn = "InvestigationSortField" +_ST__ = "START_TIME" +_ET__ = "END_TIME" +_STATUS = "STATUS" +_RL_ = "RISK_LEVEL" +_CONFIDENCE = "CONFIDENCE" +_ISC = "InvestigationSortCriteria" +_LII = "ListInvestigationsInput" +_cLIR = "com.amazonaws.guardduty#ListInvestigationsRequest" +_ITnv = "InvestigationTitle" +_ISnv = "InvestigationSummary" +_ISnve = "InvestigationSummaries" +_LIO = "ListInvestigationsOutput" +_cLIRo = "com.amazonaws.guardduty#ListInvestigationsResponse" +_Inve = "Investigations" +_inv = "investigations" +_LI = "ListInvestigations" +_LIIi = "ListInvitationsInput" +_cLIRom = "com.amazonaws.guardduty#ListInvitationsRequest" +_Invi = "Invitation" +_Invit = "Invitations" +_LIOi = "ListInvitationsOutput" +_cLIRoma = "com.amazonaws.guardduty#ListInvitationsResponse" +_invi = "invitations" +_LIi = "ListInvitations" +_LIPSI = "ListIPSetsInput" +_cLIPSR = "com.amazonaws.guardduty#ListIPSetsRequest" +_ISIp = "IpSetIds" +_LIPSO = "ListIPSetsOutput" +_cLIPSRo = "com.amazonaws.guardduty#ListIPSetsResponse" +_iSIp = "ipSetIds" +_LIPS = "ListIPSets" +_LMPPI = "ListMalwareProtectionPlansInput" +_cLMPPR = "com.amazonaws.guardduty#ListMalwareProtectionPlansRequest" +_MPPSa = "MalwareProtectionPlanSummary" +_MPPSal = "MalwareProtectionPlansSummary" +_LMPPO = "ListMalwareProtectionPlansOutput" +_cLMPPRo = "com.amazonaws.guardduty#ListMalwareProtectionPlansResponse" +_MPP = "MalwareProtectionPlans" +_mPP = "malwareProtectionPlans" +_LMPP = "ListMalwareProtectionPlans" +_LMSCK = "ListMalwareScansCriterionKey" +_RA_ = "RESOURCE_ARN" +_LMSFC = "ListMalwareScansFilterCriterion" +_LMSFCL = "ListMalwareScansFilterCriterionList" +_LMSFCi = "ListMalwareScansFilterCriteria" +_LMSI = "ListMalwareScansInput" +_cLMSR = "com.amazonaws.guardduty#ListMalwareScansRequest" +_MSa = "MalwareScan" +_MSal = "MalwareScans" +_LMSO = "ListMalwareScansOutput" +_cLMSRo = "com.amazonaws.guardduty#ListMalwareScansResponse" +_LMS = "ListMalwareScans" +_LMI = "ListMembersInput" +_cLMR = "com.amazonaws.guardduty#ListMembersRequest" +_OAn = "OnlyAssociated" +_oAn = "onlyAssociated" +_LMO = "ListMembersOutput" +_cLMRo = "com.amazonaws.guardduty#ListMembersResponse" +_LM = "ListMembers" +_LOAAI = "ListOrganizationAdminAccountsInput" +_cLOAAR = "com.amazonaws.guardduty#ListOrganizationAdminAccountsRequest" +_LOAAO = "ListOrganizationAdminAccountsOutput" +_cLOAARo = "com.amazonaws.guardduty#ListOrganizationAdminAccountsResponse" +_aA = "adminAccounts" +_LOAA = "ListOrganizationAdminAccounts" +_LPDI = "ListPublishingDestinationsInput" +_cLPDR = "com.amazonaws.guardduty#ListPublishingDestinationsRequest" +_LPDO = "ListPublishingDestinationsOutput" +_cLPDRo = "com.amazonaws.guardduty#ListPublishingDestinationsResponse" +_des = "destinations" +_LPDi = "ListPublishingDestinations" +_GDA = "GuardDutyArn" +_LTFRI = "ListTagsForResourceInput" +_cLTFRR = "com.amazonaws.guardduty#ListTagsForResourceRequest" +_LTFRO = "ListTagsForResourceOutput" +_cLTFRRo = "com.amazonaws.guardduty#ListTagsForResourceResponse" +_LTFR = "ListTagsForResource" +_LTESI = "ListThreatEntitySetsInput" +_cLTESR = "com.amazonaws.guardduty#ListThreatEntitySetsRequest" +_TESIh = "ThreatEntitySetIds" +_LTESO = "ListThreatEntitySetsOutput" +_cLTESRo = "com.amazonaws.guardduty#ListThreatEntitySetsResponse" +_tESIh = "threatEntitySetIds" +_LTES = "ListThreatEntitySets" +_LTISI = "ListThreatIntelSetsInput" +_cLTISR = "com.amazonaws.guardduty#ListThreatIntelSetsRequest" +_TISIh = "ThreatIntelSetIds" +_LTISO = "ListThreatIntelSetsOutput" +_cLTISRo = "com.amazonaws.guardduty#ListThreatIntelSetsResponse" +_tISIh = "threatIntelSetIds" +_LTIS = "ListThreatIntelSets" +_LTESIi = "ListTrustedEntitySetsInput" +_cLTESRom = "com.amazonaws.guardduty#ListTrustedEntitySetsRequest" +_TESIru = "TrustedEntitySetIds" +_LTESOi = "ListTrustedEntitySetsOutput" +_cLTESRoma = "com.amazonaws.guardduty#ListTrustedEntitySetsResponse" +_tESIru = "trustedEntitySetIds" +_LTESi = "ListTrustedEntitySets" +_SOFSOMS = "S3ObjectForSendObjectMalwareScan" +_Bu = "Bucket" +_bu = "bucket" +_SOMSI = "SendObjectMalwareScanInput" +_cSOMSR = "com.amazonaws.guardduty#SendObjectMalwareScanRequest" +_SOMSO = "SendObjectMalwareScanOutput" +_cSOMSRo = "com.amazonaws.guardduty#SendObjectMalwareScanResponse" +_SOMS = "SendObjectMalwareScan" +_SMSC = "StartMalwareScanConfiguration" +_SMSI = "StartMalwareScanInput" +_cSMSR = "com.amazonaws.guardduty#StartMalwareScanRequest" +_SMSO = "StartMalwareScanOutput" +_cSMSRo = "com.amazonaws.guardduty#StartMalwareScanResponse" +_SMS = "StartMalwareScan" +_SMMI = "StartMonitoringMembersInput" +_cSMMR = "com.amazonaws.guardduty#StartMonitoringMembersRequest" +_SMMO = "StartMonitoringMembersOutput" +_cSMMRo = "com.amazonaws.guardduty#StartMonitoringMembersResponse" +_SMM = "StartMonitoringMembers" +_SMMIt = "StopMonitoringMembersInput" +_cSMMRom = "com.amazonaws.guardduty#StopMonitoringMembersRequest" +_SMMOt = "StopMonitoringMembersOutput" +_cSMMRoma = "com.amazonaws.guardduty#StopMonitoringMembersResponse" +_SMMt = "StopMonitoringMembers" +_TRI = "TagResourceInput" +_cTRR = "com.amazonaws.guardduty#TagResourceRequest" +_TRO = "TagResourceOutput" +_cTRRo = "com.amazonaws.guardduty#TagResourceResponse" +_TRa = "TagResource" +_UFIn = "UnarchiveFindingsInput" +_cUFR = "com.amazonaws.guardduty#UnarchiveFindingsRequest" +_UFO = "UnarchiveFindingsOutput" +_cUFRo = "com.amazonaws.guardduty#UnarchiveFindingsResponse" +_UFn = "UnarchiveFindings" +_TKL = "TagKeyList" +_URI = "UntagResourceInput" +_cURR = "com.amazonaws.guardduty#UntagResourceRequest" +_TKa = "TagKeys" +_tK = "tagKeys" +_URO = "UntagResourceOutput" +_cURRo = "com.amazonaws.guardduty#UntagResourceResponse" +_URn = "UntagResource" +_UCDRAI = "UpdateCustomDetectionRuleAssociationInput" +_cUCDRAR = "com.amazonaws.guardduty#UpdateCustomDetectionRuleAssociationRequest" +_UCDRAO = "UpdateCustomDetectionRuleAssociationOutput" +_cUCDRARo = "com.amazonaws.guardduty#UpdateCustomDetectionRuleAssociationResponse" +_UCDRA = "UpdateCustomDetectionRuleAssociation" +_UCDROCI = "UpdateCustomDetectionRuleOrgConfigurationInput" +_cUCDROCR = "com.amazonaws.guardduty#UpdateCustomDetectionRuleOrgConfigurationRequest" +_UCDROCO = "UpdateCustomDetectionRuleOrgConfigurationOutput" +_cUCDROCRo = "com.amazonaws.guardduty#UpdateCustomDetectionRuleOrgConfigurationResponse" +_UCDROC = "UpdateCustomDetectionRuleOrgConfiguration" +_UDI = "UpdateDetectorInput" +_cUDR = "com.amazonaws.guardduty#UpdateDetectorRequest" +_UDO = "UpdateDetectorOutput" +_cUDRo = "com.amazonaws.guardduty#UpdateDetectorResponse" +_UD = "UpdateDetector" +_UFIp = "UpdateFilterInput" +_cUFRom = "com.amazonaws.guardduty#UpdateFilterRequest" +_UFOp = "UpdateFilterOutput" +_cUFRoma = "com.amazonaws.guardduty#UpdateFilterResponse" +_UFp = "UpdateFilter" +_UFFI = "UpdateFindingsFeedbackInput" +_cUFFR = "com.amazonaws.guardduty#UpdateFindingsFeedbackRequest" +_fee = "feedback" +_Com = "Comments" +_com = "comments" +_UFFO = "UpdateFindingsFeedbackOutput" +_cUFFRo = "com.amazonaws.guardduty#UpdateFindingsFeedbackResponse" +_UFF = "UpdateFindingsFeedback" +_UIPSI = "UpdateIPSetInput" +_cUIPSR = "com.amazonaws.guardduty#UpdateIPSetRequest" +_UIPSO = "UpdateIPSetOutput" +_cUIPSRo = "com.amazonaws.guardduty#UpdateIPSetResponse" +_UIPS = "UpdateIPSet" +_USBR = "UpdateS3BucketResource" +_UPR = "UpdateProtectedResource" +_UMPPI = "UpdateMalwareProtectionPlanInput" +_cUMPPR = "com.amazonaws.guardduty#UpdateMalwareProtectionPlanRequest" +_UMPPO = "UpdateMalwareProtectionPlanOutput" +_UMPP = "UpdateMalwareProtectionPlan" +_UMSSI = "UpdateMalwareScanSettingsInput" +_cUMSSR = "com.amazonaws.guardduty#UpdateMalwareScanSettingsRequest" +_UMSSO = "UpdateMalwareScanSettingsOutput" +_cUMSSRo = "com.amazonaws.guardduty#UpdateMalwareScanSettingsResponse" +_UMSS = "UpdateMalwareScanSettings" +_MACe = "MemberAdditionalConfiguration" +_MACem = "MemberAdditionalConfigurations" +_MFC = "MemberFeaturesConfiguration" +_MFCe = "MemberFeaturesConfigurations" +_UMDI = "UpdateMemberDetectorsInput" +_cUMDR = "com.amazonaws.guardduty#UpdateMemberDetectorsRequest" +_UMDO = "UpdateMemberDetectorsOutput" +_cUMDRo = "com.amazonaws.guardduty#UpdateMemberDetectorsResponse" +_UMD = "UpdateMemberDetectors" +_OKALC = "OrganizationKubernetesAuditLogsConfiguration" +_OKC = "OrganizationKubernetesConfiguration" +_OEV = "OrganizationEbsVolumes" +_OSEIWF = "OrganizationScanEc2InstanceWithFindings" +_OMPC = "OrganizationMalwareProtectionConfiguration" +_OSLC = "OrganizationS3LogsConfiguration" +_ODSC = "OrganizationDataSourceConfigurations" +_OAC = "OrganizationAdditionalConfiguration" +_OACr = "OrganizationAdditionalConfigurations" +_OFC = "OrganizationFeatureConfiguration" +_OFCr = "OrganizationFeaturesConfigurations" +_UOCI = "UpdateOrganizationConfigurationInput" +_cUOCR = "com.amazonaws.guardduty#UpdateOrganizationConfigurationRequest" +_UOCO = "UpdateOrganizationConfigurationOutput" +_cUOCRo = "com.amazonaws.guardduty#UpdateOrganizationConfigurationResponse" +_UOC = "UpdateOrganizationConfiguration" +_UPDI = "UpdatePublishingDestinationInput" +_cUPDR = "com.amazonaws.guardduty#UpdatePublishingDestinationRequest" +_UPDO = "UpdatePublishingDestinationOutput" +_cUPDRo = "com.amazonaws.guardduty#UpdatePublishingDestinationResponse" +_UPD = "UpdatePublishingDestination" +_UTESI = "UpdateThreatEntitySetInput" +_cUTESR = "com.amazonaws.guardduty#UpdateThreatEntitySetRequest" +_UTESO = "UpdateThreatEntitySetOutput" +_cUTESRo = "com.amazonaws.guardduty#UpdateThreatEntitySetResponse" +_UTES = "UpdateThreatEntitySet" +_UTISI = "UpdateThreatIntelSetInput" +_cUTISR = "com.amazonaws.guardduty#UpdateThreatIntelSetRequest" +_UTISO = "UpdateThreatIntelSetOutput" +_cUTISRo = "com.amazonaws.guardduty#UpdateThreatIntelSetResponse" +_UTIS = "UpdateThreatIntelSet" +_UTESIp = "UpdateTrustedEntitySetInput" +_cUTESRom = "com.amazonaws.guardduty#UpdateTrustedEntitySetRequest" +_UTESOp = "UpdateTrustedEntitySetOutput" +_cUTESRoma = "com.amazonaws.guardduty#UpdateTrustedEntitySetResponse" +_UTESp = "UpdateTrustedEntitySet" +_GDAPIS = "GuardDutyAPIService" +_aw = "aws.auth#sigv4" +_sBm = "smithy.rules#endpointBdd" +_aws = "aws.api#service" +_aJ = "aws.protocols#restJson1" + +STRING: StaticSchema = (3, n0, _S, 0) + +DETECTOR_ID: StaticSchema = (3, n0, _DI, 0) + +ACCEPT_ADMINISTRATOR_INVITATION_INPUT: StaticSchema = ( + 18, + n0, + _AAII, + {_sSI: _cAAIR, _s: None}, + (_DI, _AI, _II), + ( + (DETECTOR_ID, 9), + (STRING, {_sN: _aI, _sm: None}), + (STRING, {_sN: _iI, _sm: None}), + ), ) -DETECTOR_ID = Schema( - id=ShapeID("com.amazonaws.guardduty#DetectorId"), shape_type=ShapeType.STRING +ACCEPT_ADMINISTRATOR_INVITATION_OUTPUT: StaticSchema = ( + 18, + n0, + _AAIO, + {_sSI: _cAAIRo, _smi: None}, +) + +BAD_REQUEST_EXCEPTION: StaticSchema = ( + 18, + n0, + _BRE, + {_smit: _c, _sE: 400}, + (_M, _T), + ((STRING, {_sN: _m}), (STRING, {_sN: _t})), +) + +INTERNAL_SERVER_ERROR_EXCEPTION: StaticSchema = ( + 18, + n0, + _ISEE, + {_smit: _se, _sE: 500}, + (_M, _T), + ((STRING, {_sN: _m}), (STRING, {_sN: _t})), +) + +ACCEPT_ADMINISTRATOR_INVITATION: StaticOperationSchema = ( + 23, + n0, + _AAI, + { + _smith: MappingProxyType( + { + "method": "POST", + "uri": "/detector/{DetectorId}/administrator", + "code": 200, + } + ) + }, + ACCEPT_ADMINISTRATOR_INVITATION_INPUT, + ACCEPT_ADMINISTRATOR_INVITATION_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +ACCEPT_INVITATION_INPUT: StaticSchema = ( + 18, + n0, + _AII, + {_sSI: _cAIR, _s: None}, + (_DI, _MI, _II), + ( + (DETECTOR_ID, 9), + (STRING, {_sN: _mI, _sm: None}), + (STRING, {_sN: _iI, _sm: None}), + ), ) -ACCEPT_ADMINISTRATOR_INVITATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#AcceptAdministratorInvitationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#AcceptAdministratorInvitationRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "AdministratorId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="administratorId"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "InvitationId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="invitationId"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - }, -) +ACCEPT_INVITATION_OUTPUT: StaticSchema = (18, n0, _AIO, {_sSI: _cAIRo, _smi: None}) -ACCEPT_ADMINISTRATOR_INVITATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#AcceptAdministratorInvitationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#AcceptAdministratorInvitationResponse", +ACCEPT_INVITATION: StaticOperationSchema = ( + 23, + n0, + _AIc, + { + _smith: MappingProxyType( + {"method": "POST", "uri": "/detector/{DetectorId}/master", "code": 200} ) - ], -) - -BAD_REQUEST_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#BadRequestException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={ - "Message": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="message")], - }, - "Type": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="type")], - }, }, + ACCEPT_INVITATION_INPUT, + ACCEPT_INVITATION_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), ) -INTERNAL_SERVER_ERROR_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="server"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=500), - ], - members={ - "Message": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="message")], - }, - "Type": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="type")], - }, - }, -) +BOOLEAN: StaticSchema = (2, n0, _B, 0) -ACCEPT_ADMINISTRATOR_INVITATION = Schema( - id=ShapeID("com.amazonaws.guardduty#AcceptAdministratorInvitation"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/detector/{DetectorId}/administrator", - "code": 200, - } - ), - ) - ], +ACCESS_CONTROL_LIST: StaticSchema = ( + 18, + n0, + _ACL, + 0, + (_APRA, _APWA), + ((BOOLEAN, {_sN: _aPRA}), (BOOLEAN, {_sN: _aPWA})), ) -ACCEPT_INVITATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#AcceptInvitationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#AcceptInvitationRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "MasterId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="masterId"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "InvitationId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="invitationId"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - }, +ACCESS_DENIED_EXCEPTION: StaticSchema = ( + 18, + n0, + _ADE, + {_smit: _c, _sE: 403}, + (_M, _T), + ((STRING, {_sN: _m}), (STRING, {_sN: _t})), ) -ACCEPT_INVITATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#AcceptInvitationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#AcceptInvitationResponse", - ) - ], -) - -ACCEPT_INVITATION = Schema( - id=ShapeID("com.amazonaws.guardduty#AcceptInvitation"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/detector/{DetectorId}/master", "code": 200} - ), - ) - ], -) - -BOOLEAN = Schema( - id=ShapeID("com.amazonaws.guardduty#Boolean"), shape_type=ShapeType.BOOLEAN -) - -ACCESS_CONTROL_LIST = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#AccessControlList"), - members={ - "AllowsPublicReadAccess": { - "target": BOOLEAN, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="allowsPublicReadAccess" - ) - ], - }, - "AllowsPublicWriteAccess": { - "target": BOOLEAN, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="allowsPublicWriteAccess" - ) - ], - }, - }, +ACCESS_KEY: StaticSchema = ( + 18, + n0, + _AK, + 0, + (_PI, _UN, _UT), + ((STRING, {_sN: _pI}), (STRING, {_sN: _uN}), (STRING, {_sN: _uT})), ) -ACCESS_DENIED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#AccessDeniedException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=403), - ], - members={ - "Message": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="message")], - }, - "Type": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="type")], - }, - }, +ACCESS_KEY_DETAILS: StaticSchema = ( + 18, + n0, + _AKD, + 0, + (_AKI, _PI, _UN, _UT), + ( + (STRING, {_sN: _aKI}), + (STRING, {_sN: _pI}), + (STRING, {_sN: _uN}), + (STRING, {_sN: _uT}), + ), ) -ACCESS_KEY = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#AccessKey"), - members={ - "PrincipalId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="principalId") - ], - }, - "UserName": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="userName")], - }, - "UserType": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="userType")], - }, - }, +ACCOUNT: StaticSchema = ( + 18, + n0, + _A, + 0, + (_U, _N), + ((STRING, {_sN: _u, _sm: None}), (STRING, {_sN: _a})), +) + +ACCOUNT_ID: StaticSchema = (3, n0, _AIcc, 0) + +EMAIL: StaticSchema = (3, n0, _E, 4) + +ACCOUNT_DETAIL: StaticSchema = ( + 18, + n0, + _AD, + 0, + (_AIcc, _E), + ((ACCOUNT_ID, {_sN: _aIc, _sm: None}), (EMAIL, {_sN: _e, _sm: None})), +) + +ACCOUNT_DETAILS: StaticSchema = (16, n0, _ADc, 0, (_me,), ((ACCOUNT_DETAIL, 0),)) + +INTEGER: StaticSchema = (7, n0, _I, 0) + +DATA_SOURCE_FREE_TRIAL: StaticSchema = ( + 18, + n0, + _DSFT, + 0, + (_FTDR,), + ((INTEGER, {_sN: _fTDR}),), +) + +KUBERNETES_DATA_SOURCE_FREE_TRIAL: StaticSchema = ( + 18, + n0, + _KDSFT, + 0, + (_AL,), + ((DATA_SOURCE_FREE_TRIAL, {_sN: _aL}),), +) + +MALWARE_PROTECTION_DATA_SOURCE_FREE_TRIAL: StaticSchema = ( + 18, + n0, + _MPDSFT, + 0, + (_SEIWF,), + ((DATA_SOURCE_FREE_TRIAL, {_sN: _sEIWF}),), +) + +DATA_SOURCES_FREE_TRIAL: StaticSchema = ( + 18, + n0, + _DSFTa, + 0, + (_CT, _DL, _FL, _SL, _K, _MP), + ( + (DATA_SOURCE_FREE_TRIAL, {_sN: _cT}), + (DATA_SOURCE_FREE_TRIAL, {_sN: _dL}), + (DATA_SOURCE_FREE_TRIAL, {_sN: _fL}), + (DATA_SOURCE_FREE_TRIAL, {_sN: _sLo}), + (KUBERNETES_DATA_SOURCE_FREE_TRIAL, {_sN: _k}), + (MALWARE_PROTECTION_DATA_SOURCE_FREE_TRIAL, {_sN: _mP}), + ), ) -ACCESS_KEY_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#AccessKeyDetails"), - members={ - "AccessKeyId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="accessKeyId") - ], - }, - "PrincipalId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="principalId") - ], - }, - "UserName": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="userName")], - }, - "UserType": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="userType")], - }, - }, +FREE_TRIAL_FEATURE_RESULT: StaticSchema = ( + 14, + n0, + _FTFR, + 0, + (_FL_, _CT_, _DL_, _SDE, _EAL, _EMP, _RLE, _LNL, _ERM, _ERM_, _FRM, _AP), + ( + (-1, {_sV: _FL_}), + (-1, {_sV: _CT_}), + (-1, {_sV: _DL_}), + (-1, {_sV: _SDE}), + (-1, {_sV: _EAL}), + (-1, {_sV: _EMP}), + (-1, {_sV: _RLE}), + (-1, {_sV: _LNL}), + (-1, {_sV: _ERM}), + (-1, {_sV: _ERM_}), + (-1, {_sV: _FRM}), + (-1, {_sV: _AP}), + ), ) -ACCOUNT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Account"), - members={ - "Uid": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="uid"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Name": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="account")], - }, - }, +FREE_TRIAL_FEATURE_CONFIGURATION_RESULT: StaticSchema = ( + 18, + n0, + _FTFCR, + 0, + (_N, _FTDR), + ((FREE_TRIAL_FEATURE_RESULT, {_sN: _n}), (INTEGER, {_sN: _fTDR})), +) + +FREE_TRIAL_FEATURE_CONFIGURATIONS_RESULTS: StaticSchema = ( + 16, + n0, + _FTFCRr, + 0, + (_me,), + ((FREE_TRIAL_FEATURE_CONFIGURATION_RESULT, 0),), +) + +ACCOUNT_FREE_TRIAL_INFO: StaticSchema = ( + 18, + n0, + _AFTI, + 0, + (_AIcc, _DS, _F), + ( + (STRING, {_sN: _aIc}), + (DATA_SOURCES_FREE_TRIAL, {_sN: _dS}), + (FREE_TRIAL_FEATURE_CONFIGURATIONS_RESULTS, {_sN: _f}), + ), ) -ACCOUNT_ID = Schema( - id=ShapeID("com.amazonaws.guardduty#AccountId"), shape_type=ShapeType.STRING -) - -EMAIL = Schema( - id=ShapeID("com.amazonaws.guardduty#Email"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -ACCOUNT_DETAIL = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#AccountDetail"), - members={ - "AccountId": { - "target": ACCOUNT_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="accountId"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Email": { - "target": EMAIL, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="email"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - }, +ACCOUNT_FREE_TRIAL_INFOS: StaticSchema = ( + 16, + n0, + _AFTIc, + 0, + (_me,), + ((ACCOUNT_FREE_TRIAL_INFO, 0),), +) + +ACCOUNT_IDS: StaticSchema = (16, n0, _AIcco, 0, (_me,), ((ACCOUNT_ID, 0),)) + +BLOCK_PUBLIC_ACCESS: StaticSchema = ( + 18, + n0, + _BPA, + 0, + (_IPA, _RPB, _BPAl, _BPP), + ( + (BOOLEAN, {_sN: _iPA}), + (BOOLEAN, {_sN: _rPB}), + (BOOLEAN, {_sN: _bPA}), + (BOOLEAN, {_sN: _bPP}), + ), ) -ACCOUNT_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#AccountDetails"), - shape_type=ShapeType.LIST, - members={"member": {"target": ACCOUNT_DETAIL}}, +ACCOUNT_LEVEL_PERMISSIONS: StaticSchema = ( + 18, + n0, + _ALP, + 0, + (_BPA,), + ((BLOCK_PUBLIC_ACCESS, {_sN: _bPAl}),), ) -INTEGER = Schema( - id=ShapeID("com.amazonaws.guardduty#Integer"), shape_type=ShapeType.INTEGER -) +TIMESTAMP: StaticSchema = (4, n0, _Ti, 0) -DATA_SOURCE_FREE_TRIAL = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DataSourceFreeTrial"), - members={ - "FreeTrialDaysRemaining": { - "target": INTEGER, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="freeTrialDaysRemaining" - ) - ], - } - }, +ACCOUNT_STATISTICS: StaticSchema = ( + 18, + n0, + _AS, + 0, + (_AIcc, _LGA, _TF), + ((STRING, {_sN: _aIc}), (TIMESTAMP, {_sN: _lGA}), (INTEGER, {_sN: _tF})), ) -KUBERNETES_DATA_SOURCE_FREE_TRIAL = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#KubernetesDataSourceFreeTrial"), - members={ - "AuditLogs": { - "target": DATA_SOURCE_FREE_TRIAL, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="auditLogs")], - } - }, +AFFECTED_RESOURCES: StaticSchema = ( + 17, + n0, + _AR, + 0, + (_ke, _v), + ((STRING, 0), (STRING, 0)), ) -MALWARE_PROTECTION_DATA_SOURCE_FREE_TRIAL = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#MalwareProtectionDataSourceFreeTrial"), - members={ - "ScanEc2InstanceWithFindings": { - "target": DATA_SOURCE_FREE_TRIAL, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), - value="scanEc2InstanceWithFindings", - ) - ], - } - }, -) +DOMAIN_DETAILS: StaticSchema = (18, n0, _DD, 0, (_D,), ((STRING, {_sN: _d}),)) -DATA_SOURCES_FREE_TRIAL = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DataSourcesFreeTrial"), - members={ - "CloudTrail": { - "target": DATA_SOURCE_FREE_TRIAL, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="cloudTrail") - ], - }, - "DnsLogs": { - "target": DATA_SOURCE_FREE_TRIAL, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="dnsLogs")], - }, - "FlowLogs": { - "target": DATA_SOURCE_FREE_TRIAL, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="flowLogs")], - }, - "S3Logs": { - "target": DATA_SOURCE_FREE_TRIAL, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="s3Logs")], - }, - "Kubernetes": { - "target": KUBERNETES_DATA_SOURCE_FREE_TRIAL, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="kubernetes") - ], - }, - "MalwareProtection": { - "target": MALWARE_PROTECTION_DATA_SOURCE_FREE_TRIAL, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="malwareProtection") - ], - }, - }, +REMOTE_ACCOUNT_DETAILS: StaticSchema = ( + 18, + n0, + _RAD, + 0, + (_AIcc, _Af, _ASN), + ((STRING, {_sN: _aIc}), (BOOLEAN, {_sN: _af}), (STRING, {_sN: _aSN})), ) -FREE_TRIAL_FEATURE_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#FreeTrialFeatureResult"), - shape_type=ShapeType.ENUM, - members={ - "FLOW_LOGS": {"target": UNIT}, - "CLOUD_TRAIL": {"target": UNIT}, - "DNS_LOGS": {"target": UNIT}, - "S3_DATA_EVENTS": {"target": UNIT}, - "EKS_AUDIT_LOGS": {"target": UNIT}, - "EBS_MALWARE_PROTECTION": {"target": UNIT}, - "RDS_LOGIN_EVENTS": {"target": UNIT}, - "LAMBDA_NETWORK_LOGS": {"target": UNIT}, - "EKS_RUNTIME_MONITORING": {"target": UNIT}, - "EC2_RUNTIME_MONITORING": {"target": UNIT}, - "FARGATE_RUNTIME_MONITORING": {"target": UNIT}, - "AI_PROTECTION": {"target": UNIT}, - }, -) +CITY: StaticSchema = (18, n0, _C, 0, (_CN,), ((STRING, {_sN: _cN}),)) -FREE_TRIAL_FEATURE_CONFIGURATION_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#FreeTrialFeatureConfigurationResult"), - members={ - "Name": { - "target": FREE_TRIAL_FEATURE_RESULT, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="name")], - }, - "FreeTrialDaysRemaining": { - "target": INTEGER, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="freeTrialDaysRemaining" - ) - ], - }, - }, +COUNTRY: StaticSchema = ( + 18, + n0, + _Co, + 0, + (_CC, _CNo), + ((STRING, {_sN: _cC}), (STRING, {_sN: _cNo})), ) -FREE_TRIAL_FEATURE_CONFIGURATIONS_RESULTS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#FreeTrialFeatureConfigurationsResults"), - shape_type=ShapeType.LIST, - members={"member": {"target": FREE_TRIAL_FEATURE_CONFIGURATION_RESULT}}, -) - -ACCOUNT_FREE_TRIAL_INFO = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#AccountFreeTrialInfo"), - members={ - "AccountId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="accountId")], - }, - "DataSources": { - "target": DATA_SOURCES_FREE_TRIAL, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="dataSources") - ], - }, - "Features": { - "target": FREE_TRIAL_FEATURE_CONFIGURATIONS_RESULTS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="features")], - }, - }, -) +DOUBLE: StaticSchema = (10, n0, _Do, 0) -ACCOUNT_FREE_TRIAL_INFOS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#AccountFreeTrialInfos"), - shape_type=ShapeType.LIST, - members={"member": {"target": ACCOUNT_FREE_TRIAL_INFO}}, -) - -ACCOUNT_IDS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#AccountIds"), - shape_type=ShapeType.LIST, - members={"member": {"target": ACCOUNT_ID}}, -) - -BLOCK_PUBLIC_ACCESS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#BlockPublicAccess"), - members={ - "IgnorePublicAcls": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="ignorePublicAcls") - ], - }, - "RestrictPublicBuckets": { - "target": BOOLEAN, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="restrictPublicBuckets" - ) - ], - }, - "BlockPublicAcls": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="blockPublicAcls") - ], - }, - "BlockPublicPolicy": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="blockPublicPolicy") - ], - }, - }, +GEO_LOCATION: StaticSchema = ( + 18, + n0, + _GL, + 0, + (_L, _Lo), + ((DOUBLE, {_sN: _l}), (DOUBLE, {_sN: _lo})), ) -ACCOUNT_LEVEL_PERMISSIONS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#AccountLevelPermissions"), - members={ - "BlockPublicAccess": { - "target": BLOCK_PUBLIC_ACCESS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="blockPublicAccess") - ], - } - }, -) +SENSITIVE_STRING: StaticSchema = (3, n0, _SS, 4) -TIMESTAMP = Schema( - id=ShapeID("com.amazonaws.guardduty#Timestamp"), shape_type=ShapeType.TIMESTAMP -) - -ACCOUNT_STATISTICS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#AccountStatistics"), - members={ - "AccountId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="accountId")], - }, - "LastGeneratedAt": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="lastGeneratedAt") - ], - }, - "TotalFindings": { - "target": INTEGER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="totalFindings") - ], - }, - }, +ORGANIZATION: StaticSchema = ( + 18, + n0, + _O, + 0, + (_As, _AO, _Is, _Or), + ( + (STRING, {_sN: _as}), + (STRING, {_sN: _aO}), + (STRING, {_sN: _i}), + (STRING, {_sN: _o}), + ), ) -AFFECTED_RESOURCES = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#AffectedResources"), - shape_type=ShapeType.MAP, - members={"key": {"target": STRING}, "value": {"target": STRING}}, +REMOTE_IP_DETAILS: StaticSchema = ( + 18, + n0, + _RID, + 0, + (_C, _Co, _GL, _IAV, _IAVp, _O), + ( + (CITY, {_sN: _ci}), + (COUNTRY, {_sN: _co}), + (GEO_LOCATION, {_sN: _gL}), + (SENSITIVE_STRING, {_sN: _iAV}), + (SENSITIVE_STRING, {_sN: _iAVp}), + (ORGANIZATION, {_sN: _or}), + ), ) -DOMAIN_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DomainDetails"), - members={ - "Domain": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="domain")], - } - }, +AWS_API_CALL_ACTION: StaticSchema = ( + 18, + n0, + _AACA, + 0, + (_Ap, _CTa, _DD, _EC, _UA, _RID, _SN, _RAD, _AR), + ( + (STRING, {_sN: _ap}), + (STRING, {_sN: _cTa}), + (DOMAIN_DETAILS, {_sN: _dD}), + (STRING, {_sN: _eC}), + (STRING, {_sN: _uA}), + (REMOTE_IP_DETAILS, {_sN: _rID}), + (STRING, {_sN: _sNe}), + (REMOTE_ACCOUNT_DETAILS, {_sN: _rAD}), + (AFFECTED_RESOURCES, {_sN: _aR}), + ), ) -REMOTE_ACCOUNT_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#RemoteAccountDetails"), - members={ - "AccountId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="accountId")], - }, - "Affiliated": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="affiliated") - ], - }, - "AwsServiceName": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="awsServiceName") - ], - }, - }, +DNS_REQUEST_ACTION: StaticSchema = ( + 18, + n0, + _DRA, + 0, + (_D, _P, _Bl, _DWS, _VOAI), + ( + (STRING, {_sN: _d}), + (STRING, {_sN: _p}), + (BOOLEAN, {_sN: _b}), + (STRING, {_sN: _dWS}), + (ACCOUNT_ID, {_sN: _vOAI}), + ), ) -CITY = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#City"), - members={ - "CityName": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="cityName")], - } - }, +SOURCE_IPS: StaticSchema = (16, n0, _SI, 0, (_me,), ((STRING, 0),)) + +KUBERNETES_API_CALL_ACTION: StaticSchema = ( + 18, + n0, + _KACA, + 0, + (_RU, _V, _R, _Su, _Na, _RN, _SI, _UA, _RID, _SC, _Pa), + ( + (STRING, {_sN: _rU}), + (STRING, {_sN: _ve}), + (STRING, {_sN: _r}), + (STRING, {_sN: _su}), + (STRING, {_sN: _na}), + (STRING, {_sN: _rN}), + (SOURCE_IPS, {_sN: _sIP}), + (STRING, {_sN: _uA}), + (REMOTE_IP_DETAILS, {_sN: _rID}), + (INTEGER, {_sN: _sC}), + (STRING, {_sN: _pa}), + ), ) -COUNTRY = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Country"), - members={ - "CountryCode": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="countryCode") - ], - }, - "CountryName": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="countryName") - ], - }, - }, +KUBERNETES_PERMISSION_CHECKED_DETAILS: StaticSchema = ( + 18, + n0, + _KPCD, + 0, + (_V, _R, _Na, _Al), + ( + (STRING, {_sN: _ve}), + (STRING, {_sN: _r}), + (STRING, {_sN: _na}), + (BOOLEAN, {_sN: _al}), + ), ) -DOUBLE = Schema( - id=ShapeID("com.amazonaws.guardduty#Double"), shape_type=ShapeType.DOUBLE +KUBERNETES_ROLE_BINDING_DETAILS: StaticSchema = ( + 18, + n0, + _KRBD, + 0, + (_Ki, _N, _U, _RRN, _RRK), + ( + (STRING, {_sN: _ki}), + (STRING, {_sN: _n}), + (STRING, {_sN: _u}), + (STRING, {_sN: _rRN}), + (STRING, {_sN: _rRK}), + ), ) -GEO_LOCATION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GeoLocation"), - members={ - "Lat": { - "target": DOUBLE, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="lat")], - }, - "Lon": { - "target": DOUBLE, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="lon")], - }, - }, +KUBERNETES_ROLE_DETAILS: StaticSchema = ( + 18, + n0, + _KRD, + 0, + (_Ki, _N, _U), + ((STRING, {_sN: _ki}), (STRING, {_sN: _n}), (STRING, {_sN: _u})), +) + +LOCAL_IP_DETAILS: StaticSchema = ( + 18, + n0, + _LID, + 0, + (_IAV, _IAVp), + ((SENSITIVE_STRING, {_sN: _iAV}), (SENSITIVE_STRING, {_sN: _iAVp})), +) + +LOCAL_PORT_DETAILS: StaticSchema = ( + 18, + n0, + _LPD, + 0, + (_Po, _PN), + ((INTEGER, {_sN: _po}), (STRING, {_sN: _pN})), +) + +REMOTE_PORT_DETAILS: StaticSchema = ( + 18, + n0, + _RPD, + 0, + (_Po, _PN), + ((INTEGER, {_sN: _po}), (STRING, {_sN: _pN})), +) + +NETWORK_CONNECTION_ACTION: StaticSchema = ( + 18, + n0, + _NCA, + 0, + (_Bl, _CD, _LPD, _P, _LID, _LNI, _RID, _RPD), + ( + (BOOLEAN, {_sN: _b}), + (STRING, {_sN: _cD}), + (LOCAL_PORT_DETAILS, {_sN: _lPD}), + (STRING, {_sN: _p}), + (LOCAL_IP_DETAILS, {_sN: _lID}), + (STRING, {_sN: _lNI}), + (REMOTE_IP_DETAILS, {_sN: _rID}), + (REMOTE_PORT_DETAILS, {_sN: _rPD}), + ), ) -SENSITIVE_STRING = Schema( - id=ShapeID("com.amazonaws.guardduty#SensitiveString"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -ORGANIZATION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Organization"), - members={ - "Asn": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="asn")], - }, - "AsnOrg": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="asnOrg")], - }, - "Isp": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="isp")], - }, - "Org": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="org")], - }, - }, +PORT_PROBE_DETAIL: StaticSchema = ( + 18, + n0, + _PPD, + 0, + (_LPD, _LID, _RID), + ( + (LOCAL_PORT_DETAILS, {_sN: _lPD}), + (LOCAL_IP_DETAILS, {_sN: _lID}), + (REMOTE_IP_DETAILS, {_sN: _rID}), + ), ) -REMOTE_IP_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#RemoteIpDetails"), - members={ - "City": { - "target": CITY, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="city")], - }, - "Country": { - "target": COUNTRY, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="country")], - }, - "GeoLocation": { - "target": GEO_LOCATION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="geoLocation") - ], - }, - "IpAddressV4": { - "target": SENSITIVE_STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="ipAddressV4") - ], - }, - "IpAddressV6": { - "target": SENSITIVE_STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="ipAddressV6") - ], - }, - "Organization": { - "target": ORGANIZATION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="organization") - ], - }, - }, +PORT_PROBE_DETAILS: StaticSchema = (16, n0, _PPDo, 0, (_me,), ((PORT_PROBE_DETAIL, 0),)) + +PORT_PROBE_ACTION: StaticSchema = ( + 18, + n0, + _PPA, + 0, + (_Bl, _PPDo), + ((BOOLEAN, {_sN: _b}), (PORT_PROBE_DETAILS, {_sN: _pPD})), +) + +LOGIN_ATTRIBUTE: StaticSchema = ( + 18, + n0, + _LA, + 0, + (_Us, _App, _FLA, _SLA), + ( + (STRING, {_sN: _us}), + (STRING, {_sN: _app}), + (INTEGER, {_sN: _fLA}), + (INTEGER, {_sN: _sLA}), + ), ) -AWS_API_CALL_ACTION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#AwsApiCallAction"), - members={ - "Api": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="api")], - }, - "CallerType": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="callerType") - ], - }, - "DomainDetails": { - "target": DOMAIN_DETAILS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="domainDetails") - ], - }, - "ErrorCode": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="errorCode")], - }, - "UserAgent": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="userAgent")], - }, - "RemoteIpDetails": { - "target": REMOTE_IP_DETAILS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="remoteIpDetails") - ], - }, - "ServiceName": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="serviceName") - ], - }, - "RemoteAccountDetails": { - "target": REMOTE_ACCOUNT_DETAILS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="remoteAccountDetails" - ) - ], - }, - "AffectedResources": { - "target": AFFECTED_RESOURCES, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="affectedResources") - ], - }, - }, +LOGIN_ATTRIBUTES: StaticSchema = (16, n0, _LAo, 0, (_me,), ((LOGIN_ATTRIBUTE, 0),)) + +RDS_LOGIN_ATTEMPT_ACTION: StaticSchema = ( + 18, + n0, + _RLAA, + 0, + (_RID, _LAo), + ((REMOTE_IP_DETAILS, {_sN: _rID}), (LOGIN_ATTRIBUTES, 0)), +) + +ACTION: StaticSchema = ( + 18, + n0, + _Ac, + 0, + (_AT, _AACA, _DRA, _NCA, _PPA, _KACA, _KPCD, _KRBD, _KRD, _RLAA), + ( + (STRING, {_sN: _aT}), + (AWS_API_CALL_ACTION, {_sN: _aACA}), + (DNS_REQUEST_ACTION, {_sN: _dRA}), + (NETWORK_CONNECTION_ACTION, {_sN: _nCA}), + (PORT_PROBE_ACTION, {_sN: _pPA}), + (KUBERNETES_API_CALL_ACTION, {_sN: _kACA}), + (KUBERNETES_PERMISSION_CHECKED_DETAILS, {_sN: _kPCD}), + (KUBERNETES_ROLE_BINDING_DETAILS, {_sN: _kRBD}), + (KUBERNETES_ROLE_DETAILS, {_sN: _kRD}), + (RDS_LOGIN_ATTEMPT_ACTION, {_sN: _rLAA}), + ), ) -DNS_REQUEST_ACTION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DnsRequestAction"), - members={ - "Domain": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="domain")], - }, - "Protocol": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="protocol")], - }, - "Blocked": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="blocked")], - }, - "DomainWithSuffix": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="domainWithSuffix") - ], - }, - "VpcOwnerAccountId": { - "target": ACCOUNT_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="vpcOwnerAccountId") - ], - }, - }, +API_CALL: StaticSchema = ( + 18, + n0, + _AC, + 0, + (_Op, _Se, _Er, _UA), + ( + (STRING, {_sN: _op}), + (STRING, {_sN: _ser}), + (STRING, {_sN: _er}), + (STRING, {_sN: _uA}), + ), ) -SOURCE_IPS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#SourceIps"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, -) - -KUBERNETES_API_CALL_ACTION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#KubernetesApiCallAction"), - members={ - "RequestUri": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="requestUri") - ], - }, - "Verb": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="verb")], - }, - "Resource": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="resource")], - }, - "Subresource": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="subresource") - ], - }, - "Namespace": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="namespace")], - }, - "ResourceName": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="resourceName") - ], - }, - "SourceIps": { - "target": SOURCE_IPS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="sourceIPs")], - }, - "UserAgent": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="userAgent")], - }, - "RemoteIpDetails": { - "target": REMOTE_IP_DETAILS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="remoteIpDetails") - ], - }, - "StatusCode": { - "target": INTEGER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="statusCode") - ], - }, - "Parameters": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="parameters") - ], - }, - }, -) +ACTIVITY_TYPE: StaticSchema = (14, n0, _ATc, 0, (_AC_,), ((-1, {_sV: _AC_}),)) -KUBERNETES_PERMISSION_CHECKED_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#KubernetesPermissionCheckedDetails"), - members={ - "Verb": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="verb")], - }, - "Resource": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="resource")], - }, - "Namespace": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="namespace")], - }, - "Allowed": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="allowed")], - }, - }, +ACTIVITY: StaticSchema = ( + 18, + n0, + _Act, + 0, + (_T, _Ap), + ((ACTIVITY_TYPE, {_sN: _t, _sm: None}), (API_CALL, {_sN: _ap})), ) -KUBERNETES_ROLE_BINDING_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#KubernetesRoleBindingDetails"), - members={ - "Kind": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="kind")], - }, - "Name": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="name")], - }, - "Uid": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="uid")], - }, - "RoleRefName": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="roleRefName") - ], - }, - "RoleRefKind": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="roleRefKind") - ], - }, - }, -) +ACTIVITIES: StaticSchema = (16, n0, _Acti, 0, (_me,), ((ACTIVITY, 0),)) -KUBERNETES_ROLE_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#KubernetesRoleDetails"), - members={ - "Kind": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="kind")], - }, - "Name": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="name")], - }, - "Uid": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="uid")], - }, - }, -) +PROCESS_NAME: StaticSchema = (3, n0, _PNr, 0) -LOCAL_IP_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#LocalIpDetails"), - members={ - "IpAddressV4": { - "target": SENSITIVE_STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="ipAddressV4") - ], - }, - "IpAddressV6": { - "target": SENSITIVE_STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="ipAddressV6") - ], - }, - }, -) +PROCESS_PATH: StaticSchema = (3, n0, _PP, 0) -LOCAL_PORT_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#LocalPortDetails"), - members={ - "Port": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="port")], - }, - "PortName": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="portName")], - }, - }, -) +PROCESS_SHA256: StaticSchema = (3, n0, _PS, 0) -REMOTE_PORT_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#RemotePortDetails"), - members={ - "Port": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="port")], - }, - "PortName": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="portName")], - }, - }, +ACTOR_PROCESS: StaticSchema = ( + 18, + n0, + _APc, + 0, + (_N, _Pat, _Sh), + ( + (PROCESS_NAME, {_sN: _n, _sm: None}), + (PROCESS_PATH, {_sN: _pat, _sm: None}), + (PROCESS_SHA256, {_sN: _sh}), + ), ) -NETWORK_CONNECTION_ACTION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#NetworkConnectionAction"), - members={ - "Blocked": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="blocked")], - }, - "ConnectionDirection": { - "target": STRING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="connectionDirection" - ) - ], - }, - "LocalPortDetails": { - "target": LOCAL_PORT_DETAILS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="localPortDetails") - ], - }, - "Protocol": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="protocol")], - }, - "LocalIpDetails": { - "target": LOCAL_IP_DETAILS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="localIpDetails") - ], - }, - "LocalNetworkInterface": { - "target": STRING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="localNetworkInterface" - ) - ], - }, - "RemoteIpDetails": { - "target": REMOTE_IP_DETAILS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="remoteIpDetails") - ], - }, - "RemotePortDetails": { - "target": REMOTE_PORT_DETAILS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="remotePortDetails") - ], - }, - }, +MFA_STATUS: StaticSchema = ( + 14, + n0, + _MS, + 0, + (_ENABLED, _DISABLED), + ((-1, {_sV: _ENABLED}), (-1, {_sV: _DISABLED})), +) + +SESSION: StaticSchema = ( + 18, + n0, + _Ses, + 0, + (_U, _MS, _CTr, _Iss), + ( + (STRING, {_sN: _u}), + (MFA_STATUS, {_sN: _mS}), + (TIMESTAMP, {_sN: _cTr}), + (STRING, {_sN: _is}), + ), ) -PORT_PROBE_DETAIL = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#PortProbeDetail"), - members={ - "LocalPortDetails": { - "target": LOCAL_PORT_DETAILS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="localPortDetails") - ], - }, - "LocalIpDetails": { - "target": LOCAL_IP_DETAILS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="localIpDetails") - ], - }, - "RemoteIpDetails": { - "target": REMOTE_IP_DETAILS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="remoteIpDetails") - ], - }, - }, +USER: StaticSchema = ( + 18, + n0, + _Us, + 0, + (_N, _U, _T, _CU, _A), + ( + (STRING, {_sN: _n, _sm: None}), + (STRING, {_sN: _u, _sm: None}), + (STRING, {_sN: _t, _sm: None}), + (STRING, {_sN: _cU}), + (ACCOUNT, {_sN: _a}), + ), ) -PORT_PROBE_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#PortProbeDetails"), - shape_type=ShapeType.LIST, - members={"member": {"target": PORT_PROBE_DETAIL}}, -) - -PORT_PROBE_ACTION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#PortProbeAction"), - members={ - "Blocked": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="blocked")], - }, - "PortProbeDetails": { - "target": PORT_PROBE_DETAILS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="portProbeDetails") - ], - }, - }, +ACTOR: StaticSchema = ( + 18, + n0, + _Acto, + 0, + (_Id, _Us, _Ses, _Pr), + ( + (STRING, {_sN: _id, _sm: None}), + (USER, {_sN: _us}), + (SESSION, {_sN: _ses}), + (ACTOR_PROCESS, {_sN: _pr}), + ), ) -LOGIN_ATTRIBUTE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#LoginAttribute"), - members={ - "User": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="user")], - }, - "Application": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="application") - ], - }, - "FailedLoginAttempts": { - "target": INTEGER, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="failedLoginAttempts" - ) - ], - }, - "SuccessfulLoginAttempts": { - "target": INTEGER, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="successfulLoginAttempts" - ) - ], - }, - }, -) +ACTOR_IDS: StaticSchema = (16, n0, _AIct, 0, (_me,), ((STRING, 0),)) -LOGIN_ATTRIBUTES = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#LoginAttributes"), - shape_type=ShapeType.LIST, - members={"member": {"target": LOGIN_ATTRIBUTE}}, -) +ACTORS: StaticSchema = (16, n0, _Actor, 0, (_me,), ((ACTOR, 0),)) -RDS_LOGIN_ATTEMPT_ACTION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#RdsLoginAttemptAction"), - members={ - "RemoteIpDetails": { - "target": REMOTE_IP_DETAILS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="remoteIpDetails") - ], - }, - "LoginAttributes": {"target": LOGIN_ATTRIBUTES}, - }, -) +NON_EMPTY_STRING: StaticSchema = (3, n0, _NES, 0) -ACTION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Action"), - members={ - "ActionType": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="actionType") - ], - }, - "AwsApiCallAction": { - "target": AWS_API_CALL_ACTION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="awsApiCallAction") - ], - }, - "DnsRequestAction": { - "target": DNS_REQUEST_ACTION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="dnsRequestAction") - ], - }, - "NetworkConnectionAction": { - "target": NETWORK_CONNECTION_ACTION, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="networkConnectionAction" - ) - ], - }, - "PortProbeAction": { - "target": PORT_PROBE_ACTION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="portProbeAction") - ], - }, - "KubernetesApiCallAction": { - "target": KUBERNETES_API_CALL_ACTION, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="kubernetesApiCallAction" - ) - ], - }, - "KubernetesPermissionCheckedDetails": { - "target": KUBERNETES_PERMISSION_CHECKED_DETAILS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), - value="kubernetesPermissionCheckedDetails", - ) - ], - }, - "KubernetesRoleBindingDetails": { - "target": KUBERNETES_ROLE_BINDING_DETAILS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), - value="kubernetesRoleBindingDetails", - ) - ], - }, - "KubernetesRoleDetails": { - "target": KUBERNETES_ROLE_DETAILS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="kubernetesRoleDetails" - ) - ], - }, - "RdsLoginAttemptAction": { - "target": RDS_LOGIN_ATTEMPT_ACTION, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="rdsLoginAttemptAction" - ) - ], - }, - }, +ADDITIONAL_INFO: StaticSchema = ( + 18, + n0, + _AId, + 0, + (_VI, _DN), + ((NON_EMPTY_STRING, {_sN: _vI}), (NON_EMPTY_STRING, {_sN: _dN})), ) -API_CALL = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ApiCall"), - members={ - "Operation": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="operation")], - }, - "Service": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="service")], - }, - "Error": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="error")], - }, - "UserAgent": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="userAgent")], - }, - }, -) +FINDING_TYPE: StaticSchema = (3, n0, _FT, 0) -ACTIVITY_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ActivityType"), - shape_type=ShapeType.ENUM, - members={"API_CALL": {"target": UNIT}}, -) - -ACTIVITY = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Activity"), - members={ - "Type": { - "target": ACTIVITY_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="type"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Api": { - "target": API_CALL, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="api")], - }, - }, +ADDITIONAL_SEQUENCE_TYPES: StaticSchema = ( + 16, + n0, + _AST, + 0, + (_me,), + ((FINDING_TYPE, 0),), ) -ACTIVITIES = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Activities"), - shape_type=ShapeType.LIST, - members={"member": {"target": ACTIVITY}}, +ADDON_DETAILS: StaticSchema = ( + 18, + n0, + _ADd, + 0, + (_AV, _ASd), + ((STRING, {_sN: _aV}), (STRING, {_sN: _aS})), ) -PROCESS_NAME = Schema( - id=ShapeID("com.amazonaws.guardduty#ProcessName"), shape_type=ShapeType.STRING +ADMIN_STATUS: StaticSchema = ( + 14, + n0, + _ASdm, + 0, + (_ENABLED, _DIP), + ((-1, {_sV: _ENABLED}), (-1, {_sV: _DIP})), ) -PROCESS_PATH = Schema( - id=ShapeID("com.amazonaws.guardduty#ProcessPath"), shape_type=ShapeType.STRING +ADMIN_ACCOUNT: StaticSchema = ( + 18, + n0, + _AA, + 0, + (_AAId, _ASdm), + ((STRING, {_sN: _aAI}), (ADMIN_STATUS, {_sN: _aSd})), ) -PROCESS_SHA256 = Schema( - id=ShapeID("com.amazonaws.guardduty#ProcessSha256"), shape_type=ShapeType.STRING -) +ADMIN_ACCOUNTS: StaticSchema = (16, n0, _AAd, 0, (_me,), ((ADMIN_ACCOUNT, 0),)) -ACTOR_PROCESS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ActorProcess"), - members={ - "Name": { - "target": PROCESS_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="name"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Path": { - "target": PROCESS_PATH, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="path"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Sha256": { - "target": PROCESS_SHA256, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="sha256")], - }, - }, +ADMINISTRATOR: StaticSchema = ( + 18, + n0, + _Ad, + 0, + (_AIcc, _II, _RS, _IA), + ( + (ACCOUNT_ID, {_sN: _aIc}), + (STRING, {_sN: _iI}), + (STRING, {_sN: _rS}), + (STRING, {_sN: _iA}), + ), ) -MFA_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#MfaStatus"), - shape_type=ShapeType.ENUM, - members={"ENABLED": {"target": UNIT}, "DISABLED": {"target": UNIT}}, -) - -SESSION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Session"), - members={ - "Uid": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="uid")], - }, - "MfaStatus": { - "target": MFA_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="mfaStatus")], - }, - "CreatedTime": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="createdTime") - ], - }, - "Issuer": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="issuer")], - }, - }, -) +AGENT_DETAILS: StaticSchema = (18, n0, _ADg, 0, (_Ve,), ((STRING, {_sN: _ver}),)) -USER = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#User"), - members={ - "Name": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="name"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Uid": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="uid"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Type": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="type"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "CredentialUid": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="credentialUid") - ], - }, - "Account": { - "target": ACCOUNT, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="account")], - }, - }, -) +LONG: StaticSchema = (8, n0, _Lon, 0) -ACTOR = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Actor"), - members={ - "Id": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="id"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "User": { - "target": USER, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="user")], - }, - "Session": { - "target": SESSION, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="session")], - }, - "Process": { - "target": ACTOR_PROCESS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="process")], - }, - }, +OBSERVATION_NUMBERS: StaticSchema = (16, n0, _ON, 0, (_me,), ((LONG, 0),)) + +OBSERVATION_TEXTS: StaticSchema = (16, n0, _OT, 0, (_me,), ((STRING, 0),)) + +OBSERVATIONS: StaticSchema = ( + 18, + n0, + _Ob, + 0, + (_Te, _Nu), + ((OBSERVATION_TEXTS, {_sN: _te}), (OBSERVATION_NUMBERS, {_sN: _nu})), ) -ACTOR_IDS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ActorIds"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, +PROFILE_SUBTYPE: StaticSchema = ( + 14, + n0, + _PSr, + 0, + (_FREQUENT, _INFREQUENT, _UNSEEN, _RARE, _COUNT, _AVERAGE), + ( + (-1, {_sV: _FREQUENT}), + (-1, {_sV: _INFREQUENT}), + (-1, {_sV: _UNSEEN}), + (-1, {_sV: _RARE}), + (-1, {_sV: _COUNT}), + (-1, {_sV: _AVERAGE}), + ), ) -ACTORS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Actors"), - shape_type=ShapeType.LIST, - members={"member": {"target": ACTOR}}, +PROFILE_TYPE: StaticSchema = ( + 14, + n0, + _PT, + 0, + (_FREQUENCY, _VOLUME), + ((-1, {_sV: _FREQUENCY}), (-1, {_sV: _VOLUME})), +) + +ANOMALY_OBJECT: StaticSchema = ( + 18, + n0, + _AOn, + 0, + (_PT, _PSr, _Ob), + ( + (PROFILE_TYPE, {_sN: _pT}), + (PROFILE_SUBTYPE, {_sN: _pS}), + (OBSERVATIONS, {_sN: _ob}), + ), ) -NON_EMPTY_STRING = Schema( - id=ShapeID("com.amazonaws.guardduty#NonEmptyString"), shape_type=ShapeType.STRING +ANOMALY_PROFILE_FEATURE_OBJECTS: StaticSchema = ( + 16, + n0, + _APFO, + 0, + (_me,), + ((ANOMALY_OBJECT, 0),), ) -ADDITIONAL_INFO = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#AdditionalInfo"), - members={ - "VersionId": { - "target": NON_EMPTY_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="versionId")], - }, - "DeviceName": { - "target": NON_EMPTY_STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="deviceName") - ], - }, - }, +ANOMALY_PROFILE_FEATURES: StaticSchema = ( + 17, + n0, + _APF, + 0, + (_ke, _v), + ((STRING, 0), (ANOMALY_PROFILE_FEATURE_OBJECTS, 0)), +) + +ANOMALY_PROFILES: StaticSchema = ( + 17, + n0, + _APn, + 0, + (_ke, _v), + ((STRING, 0), (ANOMALY_PROFILE_FEATURES, 0)), +) + +ANOMALY_UNUSUAL_BEHAVIOR_FEATURE: StaticSchema = ( + 17, + n0, + _AUBF, + 0, + (_ke, _v), + ((STRING, 0), (ANOMALY_OBJECT, 0)), +) + +BEHAVIOR: StaticSchema = ( + 17, + n0, + _Be, + 0, + (_ke, _v), + ((STRING, 0), (ANOMALY_UNUSUAL_BEHAVIOR_FEATURE, 0)), +) + +ANOMALY_UNUSUAL: StaticSchema = (18, n0, _AU, 0, (_Be,), ((BEHAVIOR, {_sN: _be}),)) + +ANOMALY: StaticSchema = ( + 18, + n0, + _An, + 0, + (_Pro, _Un), + ((ANOMALY_PROFILES, {_sN: _pro}), (ANOMALY_UNUSUAL, {_sN: _un})), +) + +FINDING_ID: StaticSchema = (3, n0, _FI, 0) + +FINDING_IDS: StaticSchema = (16, n0, _FIi, 0, (_me,), ((FINDING_ID, 0),)) + +ARCHIVE_FINDINGS_INPUT: StaticSchema = ( + 18, + n0, + _AFI, + {_sSI: _cAFR, _s: None}, + (_DI, _FIi), + ((DETECTOR_ID, 9), (FINDING_IDS, {_sN: _fI, _sm: None})), +) + +ARCHIVE_FINDINGS_OUTPUT: StaticSchema = (18, n0, _AFO, {_sSI: _cAFRo, _smi: None}) + +ARCHIVE_FINDINGS: StaticOperationSchema = ( + 23, + n0, + _AF, + { + _smith: MappingProxyType( + { + "method": "POST", + "uri": "/detector/{DetectorId}/findings/archive", + "code": 200, + } + ) + }, + ARCHIVE_FINDINGS_INPUT, + ARCHIVE_FINDINGS_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +DETECTION_RULE_ARN: StaticSchema = (3, n0, _DRAe, 0) + +ASSOCIATION_ID: StaticSchema = (3, n0, _AIs, 0) + +ASSOCIATION_MODE: StaticSchema = ( + 14, + n0, + _AM, + 0, + (_LIVE, _DR), + ((-1, {_sV: _LIVE}), (-1, {_sV: _DR})), +) + +RULE_ID: StaticSchema = (3, n0, _RI, 0) + +ASSOCIATION_DETAIL: StaticSchema = ( + 18, + n0, + _ADs, + 0, + (_AIs, _Ar, _RI, _AIcc, _Mo, _CA, _UAp, _EA), + ( + (ASSOCIATION_ID, {_sN: _aIs, _sm: None}), + (DETECTION_RULE_ARN, {_sN: _ar, _sm: None}), + (RULE_ID, {_sN: _rI, _sm: None}), + (ACCOUNT_ID, {_sN: _aIc, _sm: None}), + (ASSOCIATION_MODE, {_sN: _mo, _sm: None}), + (TIMESTAMP, {_sN: _cA, _sm: None}), + (TIMESTAMP, {_sN: _uAp, _sm: None}), + (TIMESTAMP, {_sN: _eA}), + ), ) -FINDING_TYPE = Schema( - id=ShapeID("com.amazonaws.guardduty#FindingType"), shape_type=ShapeType.STRING +ASSOCIATION_SUMMARY: StaticSchema = ( + 18, + n0, + _ASs, + 0, + (_AIs, _Ar, _RI, _Mo, _CA, _UAp, _EA), + ( + (ASSOCIATION_ID, {_sN: _aIs, _sm: None}), + (DETECTION_RULE_ARN, {_sN: _ar, _sm: None}), + (RULE_ID, {_sN: _rI, _sm: None}), + (ASSOCIATION_MODE, {_sN: _mo, _sm: None}), + (TIMESTAMP, {_sN: _cA, _sm: None}), + (TIMESTAMP, {_sN: _uAp, _sm: None}), + (TIMESTAMP, {_sN: _eA}), + ), ) -ADDITIONAL_SEQUENCE_TYPES = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#AdditionalSequenceTypes"), - shape_type=ShapeType.LIST, - members={"member": {"target": FINDING_TYPE}}, +ASSOCIATION_SUMMARY_LIST: StaticSchema = ( + 16, + n0, + _ASL, + 0, + (_me,), + ((ASSOCIATION_SUMMARY, 0),), +) + +AUTO_ENABLE_MEMBERS: StaticSchema = ( + 14, + n0, + _AEM, + 0, + (_NEW, _ALL, _NONE), + ((-1, {_sV: _NEW}), (-1, {_sV: _ALL}), (-1, {_sV: _NONE})), +) + +AUTONOMOUS_SYSTEM: StaticSchema = ( + 18, + n0, + _ASu, + 0, + (_N, _Nu), + ((STRING, {_sN: _n, _sm: None}), (INTEGER, {_sN: _nu, _sm: None})), +) + +EC2_INSTANCE_UID: StaticSchema = (3, n0, _EIU, 0) + +EC2_INSTANCE_UIDS: StaticSchema = (16, n0, _EIUc, 0, (_me,), ((EC2_INSTANCE_UID, 0),)) + +AUTOSCALING_AUTO_SCALING_GROUP: StaticSchema = ( + 18, + n0, + _AASG, + 0, + (_EIUc,), + ((EC2_INSTANCE_UIDS, {_sN: _eIU}),), +) + +BEDROCK_GUARDRAIL: StaticSchema = ( + 18, + n0, + _BG, + 0, + (_Ar, _Ve), + ((STRING, {_sN: _ar}), (STRING, {_sN: _ver})), +) + +CONTENT_POLICY_FILTER_ACTION: StaticSchema = ( + 14, + n0, + _CPFA, + 0, + (_BLOCKED, _NONE), + ((-1, {_sV: _BLOCKED}), (-1, {_sV: _NONE})), +) + +CONFIDENCE_LEVEL: StaticSchema = ( + 14, + n0, + _CL, + 0, + (_HIGH, _MEDIUM, _LOW, _NONE), + ((-1, {_sV: _HIGH}), (-1, {_sV: _MEDIUM}), (-1, {_sV: _LOW}), (-1, {_sV: _NONE})), +) + +CONTENT_POLICY_FILTER_TYPE: StaticSchema = ( + 14, + n0, + _CPFT, + 0, + (_PA, _JAILBREAK, _HATE, _INSULTS, _SEXUAL, _VIOLENCE, _MISCONDUCT), + ( + (-1, {_sV: _PA}), + (-1, {_sV: _JAILBREAK}), + (-1, {_sV: _HATE}), + (-1, {_sV: _INSULTS}), + (-1, {_sV: _SEXUAL}), + (-1, {_sV: _VIOLENCE}), + (-1, {_sV: _MISCONDUCT}), + ), ) -ADDON_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#AddonDetails"), - members={ - "AddonVersion": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="addonVersion") - ], - }, - "AddonStatus": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="addonStatus") - ], - }, - }, +CONTENT_POLICY_FILTER: StaticSchema = ( + 18, + n0, + _CPF, + 0, + (_T, _Con, _Ac), + ( + (CONTENT_POLICY_FILTER_TYPE, {_sN: _t}), + (CONFIDENCE_LEVEL, {_sN: _con}), + (CONTENT_POLICY_FILTER_ACTION, {_sN: _ac}), + ), ) -ADMIN_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#AdminStatus"), - shape_type=ShapeType.ENUM, - members={"ENABLED": {"target": UNIT}, "DISABLE_IN_PROGRESS": {"target": UNIT}}, -) - -ADMIN_ACCOUNT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#AdminAccount"), - members={ - "AdminAccountId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="adminAccountId") - ], - }, - "AdminStatus": { - "target": ADMIN_STATUS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="adminStatus") - ], - }, - }, +CONTENT_POLICY_FILTERS: StaticSchema = ( + 16, + n0, + _CPFo, + 0, + (_me,), + ((CONTENT_POLICY_FILTER, 0),), +) + +GUARDRAIL_ACTION: StaticSchema = ( + 14, + n0, + _GA, + 0, + (_GI, _NONE), + ((-1, {_sV: _GI}), (-1, {_sV: _NONE})), +) + +BEDROCK_GUARDRAILS: StaticSchema = (16, n0, _BGe, 0, (_me,), ((BEDROCK_GUARDRAIL, 0),)) + +GUARDRAIL_SOURCE: StaticSchema = ( + 14, + n0, + _GS, + 0, + (_INPUT, _OUTPUT), + ((-1, {_sV: _INPUT}), (-1, {_sV: _OUTPUT})), +) + +BEDROCK_GUARDRAIL_DETAILS: StaticSchema = ( + 18, + n0, + _BGD, + 0, + (_GAu, _GV, _G, _GA, _GS, _CPFo), + ( + (STRING, {_sN: _gA}), + (STRING, {_sN: _gV}), + (BEDROCK_GUARDRAILS, {_sN: _g}), + (GUARDRAIL_ACTION, {_sN: _gAu}), + (GUARDRAIL_SOURCE, {_sN: _gS}), + (CONTENT_POLICY_FILTERS, {_sN: _cPF}), + ), ) -ADMIN_ACCOUNTS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#AdminAccounts"), - shape_type=ShapeType.LIST, - members={"member": {"target": ADMIN_ACCOUNT}}, -) - -ADMINISTRATOR = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Administrator"), - members={ - "AccountId": { - "target": ACCOUNT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="accountId")], - }, - "InvitationId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="invitationId") - ], - }, - "RelationshipStatus": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="relationshipStatus") - ], - }, - "InvitedAt": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="invitedAt")], - }, - }, +BEDROCK_GUARDRAIL_RESOURCE: StaticSchema = ( + 18, + n0, + _BGR, + 0, + (_Ve, _GA, _GS), + ( + (STRING, {_sN: _ver}), + (GUARDRAIL_ACTION, {_sN: _gAu}), + (GUARDRAIL_SOURCE, {_sN: _gS}), + ), ) -AGENT_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#AgentDetails"), - members={ - "Version": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="version")], - } - }, +BUCKET_POLICY: StaticSchema = ( + 18, + n0, + _BP, + 0, + (_APRA, _APWA), + ((BOOLEAN, {_sN: _aPRA}), (BOOLEAN, {_sN: _aPWA})), +) + +BUCKET_LEVEL_PERMISSIONS: StaticSchema = ( + 18, + n0, + _BLP, + 0, + (_ACL, _BP, _BPA), + ( + (ACCESS_CONTROL_LIST, {_sN: _aCL}), + (BUCKET_POLICY, {_sN: _bP}), + (BLOCK_PUBLIC_ACCESS, {_sN: _bPAl}), + ), ) -LONG = Schema(id=ShapeID("com.amazonaws.guardduty#Long"), shape_type=ShapeType.LONG) +CLIENT_TOKEN: StaticSchema = (3, n0, _CTl, 0) -OBSERVATION_NUMBERS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ObservationNumbers"), - shape_type=ShapeType.LIST, - members={"member": {"target": LONG}}, -) +CLOUD_PROVIDER: StaticSchema = (14, n0, _CP, 0, (_AWS,), ((-1, {_sV: _AWS}),)) -OBSERVATION_TEXTS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ObservationTexts"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, +CLOUD_DETAILS: StaticSchema = ( + 18, + n0, + _CDl, + 0, + (_Prov, _Re, _A), + ( + (CLOUD_PROVIDER, {_sN: _prov, _sm: None}), + (STRING, {_sN: _re, _sm: None}), + (STRING, {_sN: _a, _sm: None}), + ), ) -OBSERVATIONS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Observations"), - members={ - "Text": { - "target": OBSERVATION_TEXTS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="text")], - }, - "Number": { - "target": OBSERVATION_NUMBERS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="number")], - }, - }, +CLOUDFORMATION_STACK: StaticSchema = ( + 18, + n0, + _CS, + 0, + (_EIUc,), + ((EC2_INSTANCE_UIDS, {_sN: _eIU}),), +) + +DATA_SOURCE_STATUS: StaticSchema = ( + 14, + n0, + _DSS, + 0, + (_ENABLED, _DISABLED), + ((-1, {_sV: _ENABLED}), (-1, {_sV: _DISABLED})), +) + +CLOUD_TRAIL_CONFIGURATION_RESULT: StaticSchema = ( + 18, + n0, + _CTCR, + 0, + (_St,), + ((DATA_SOURCE_STATUS, {_sN: _st, _sm: None}),), +) + +CLUSTER_STATUS: StaticSchema = ( + 14, + n0, + _CSl, + 0, + (_CREATING, _ACTIVE, _DELETING, _FAILED, _UPDATING, _PENDING), + ( + (-1, {_sV: _CREATING}), + (-1, {_sV: _ACTIVE}), + (-1, {_sV: _DELETING}), + (-1, {_sV: _FAILED}), + (-1, {_sV: _UPDATING}), + (-1, {_sV: _PENDING}), + ), ) -PROFILE_SUBTYPE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ProfileSubtype"), - shape_type=ShapeType.ENUM, - members={ - "FREQUENT": {"target": UNIT}, - "INFREQUENT": {"target": UNIT}, - "UNSEEN": {"target": UNIT}, - "RARE": {"target": UNIT}, - "COUNT": {"target": UNIT}, - "AVERAGE": {"target": UNIT}, - }, -) +EQ: StaticSchema = (16, n0, _Eq, 0, (_me,), ((STRING, 0),)) -PROFILE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ProfileType"), - shape_type=ShapeType.ENUM, - members={"FREQUENCY": {"target": UNIT}, "VOLUME": {"target": UNIT}}, -) - -ANOMALY_OBJECT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#AnomalyObject"), - members={ - "ProfileType": { - "target": PROFILE_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="profileType") - ], - }, - "ProfileSubtype": { - "target": PROFILE_SUBTYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="profileSubtype") - ], - }, - "Observations": { - "target": OBSERVATIONS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="observations") - ], - }, - }, -) +EQUALS: StaticSchema = (16, n0, _Equ, 0, (_me,), ((STRING, 0),)) -ANOMALY_PROFILE_FEATURE_OBJECTS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#AnomalyProfileFeatureObjects"), - shape_type=ShapeType.LIST, - members={"member": {"target": ANOMALY_OBJECT}}, -) +MATCH: StaticSchema = (3, n0, _Ma, 0) -ANOMALY_PROFILE_FEATURES = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#AnomalyProfileFeatures"), - shape_type=ShapeType.MAP, - members={ - "key": {"target": STRING}, - "value": {"target": ANOMALY_PROFILE_FEATURE_OBJECTS}, - }, -) +MATCHES: StaticSchema = (16, n0, _Mat, 0, (_me,), ((MATCH, 0),)) -ANOMALY_PROFILES = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#AnomalyProfiles"), - shape_type=ShapeType.MAP, - members={"key": {"target": STRING}, "value": {"target": ANOMALY_PROFILE_FEATURES}}, -) +NEQ: StaticSchema = (16, n0, _Ne, 0, (_me,), ((STRING, 0),)) -ANOMALY_UNUSUAL_BEHAVIOR_FEATURE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#AnomalyUnusualBehaviorFeature"), - shape_type=ShapeType.MAP, - members={"key": {"target": STRING}, "value": {"target": ANOMALY_OBJECT}}, -) +NOT_EQUALS: StaticSchema = (16, n0, _NE, 0, (_me,), ((STRING, 0),)) -BEHAVIOR = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Behavior"), - shape_type=ShapeType.MAP, - members={ - "key": {"target": STRING}, - "value": {"target": ANOMALY_UNUSUAL_BEHAVIOR_FEATURE}, - }, -) +NOT_MATCH: StaticSchema = (3, n0, _NM, 0) -ANOMALY_UNUSUAL = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#AnomalyUnusual"), - members={ - "Behavior": { - "target": BEHAVIOR, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="behavior")], - } - }, -) +NOT_MATCHES: StaticSchema = (16, n0, _NMo, 0, (_me,), ((NOT_MATCH, 0),)) -ANOMALY = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Anomaly"), - members={ - "Profiles": { - "target": ANOMALY_PROFILES, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="profiles")], - }, - "Unusual": { - "target": ANOMALY_UNUSUAL, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="unusual")], - }, - }, +CONDITION: StaticSchema = ( + 18, + n0, + _Cond, + 0, + (_Eq, _Ne, _Gt, _Gte, _Lt, _Lte, _Equ, _NE, _GT, _GTOE, _LT, _LTOE, _Mat, _NMo), + ( + (EQ, {_sN: _eq}), + (NEQ, {_sN: _ne}), + (INTEGER, {_sN: _gt}), + (INTEGER, {_sN: _gte}), + (INTEGER, {_sN: _lt}), + (INTEGER, {_sN: _lte}), + (EQUALS, {_sN: _equ}), + (NOT_EQUALS, {_sN: _nE}), + (LONG, {_sN: _gT}), + (LONG, {_sN: _gTOE}), + (LONG, {_sN: _lT}), + (LONG, {_sN: _lTOE}), + (MATCHES, {_sN: _ma}), + (NOT_MATCHES, {_sN: _nM}), + ), ) -FINDING_ID = Schema( - id=ShapeID("com.amazonaws.guardduty#FindingId"), shape_type=ShapeType.STRING +CONFIDENCE: StaticSchema = ( + 14, + n0, + _Con, + 0, + (_UNKNOWN, _LOW, _MEDIUM, _HIGH), + ((-1, {_sV: _Unk}), (-1, {_sV: _Low}), (-1, {_sV: _Me}), (-1, {_sV: _H})), +) + +CONFLICT_EXCEPTION: StaticSchema = ( + 18, + n0, + _CE, + {_smit: _c, _sE: 409}, + (_M, _T), + ((STRING, {_sN: _m}), (STRING, {_sN: _t})), +) + +SECURITY_CONTEXT: StaticSchema = ( + 18, + n0, + _SCe, + 0, + (_Pri, _APE), + ((BOOLEAN, {_sN: _pri}), (BOOLEAN, {_sN: _aPE})), +) + +VOLUME_MOUNT: StaticSchema = ( + 18, + n0, + _VM, + 0, + (_N, _MPo), + ((STRING, {_sN: _n}), (STRING, {_sN: _mPo})), +) + +VOLUME_MOUNTS: StaticSchema = (16, n0, _VMo, 0, (_me,), ((VOLUME_MOUNT, 0),)) + +CONTAINER: StaticSchema = ( + 18, + n0, + _Cont, + 0, + (_CR, _Id, _N, _Im, _IP, _VMo, _SCe), + ( + (STRING, {_sN: _cR}), + (STRING, {_sN: _id}), + (STRING, {_sN: _n}), + (STRING, {_sN: _im}), + (STRING, {_sN: _iP}), + (VOLUME_MOUNTS, {_sN: _vM}), + (SECURITY_CONTEXT, {_sN: _sCe}), + ), ) -FINDING_IDS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#FindingIds"), - shape_type=ShapeType.LIST, - members={"member": {"target": FINDING_ID}}, +CONTAINER_IMAGE_UID: StaticSchema = (3, n0, _CIU, 0) + +CONTAINER_FINDING_RESOURCE: StaticSchema = ( + 18, + n0, + _CFR, + 0, + (_Im, _IU), + ((STRING, {_sN: _im, _sm: None}), (CONTAINER_IMAGE_UID, {_sN: _iU})), +) + +CONTAINER_INSTANCE_DETAILS: StaticSchema = ( + 18, + n0, + _CID, + 0, + (_CCI, _CCIo), + ((LONG, {_sN: _cCI}), (LONG, {_sN: _cCIo})), +) + +CONTAINERS: StaticSchema = (16, n0, _Conta, 0, (_me,), ((CONTAINER, 0),)) + +CONTAINER_UID: StaticSchema = (3, n0, _CUo, 0) + +CONTAINER_UIDS: StaticSchema = (16, n0, _CUon, 0, (_me,), ((CONTAINER_UID, 0),)) + +CONTINUOUS_SCAN_DETAILS: StaticSchema = ( + 18, + n0, + _CSD, + 0, + (_ST, _ET), + ((TIMESTAMP, {_sN: _sT}), (TIMESTAMP, {_sN: _eT, _sm: None})), +) + +COVERAGE_STATUS: StaticSchema = ( + 14, + n0, + _CSo, + 0, + (_HEALTHY, _UNHEALTHY), + ((-1, {_sV: _HEALTHY}), (-1, {_sV: _UNHEALTHY})), +) + +COUNT_BY_COVERAGE_STATUS: StaticSchema = ( + 17, + n0, + _CBCS, + 0, + (_ke, _v), + ((COVERAGE_STATUS, 0), (LONG, 0)), +) + +RESOURCE_TYPE: StaticSchema = ( + 14, + n0, + _RT, + 0, + (_EKS, _ECS, _EC_), + ((-1, {_sV: _EKS}), (-1, {_sV: _ECS}), (-1, {_sV: _EC_})), +) + +COUNT_BY_RESOURCE_TYPE: StaticSchema = ( + 17, + n0, + _CBRT, + 0, + (_ke, _v), + ((RESOURCE_TYPE, 0), (LONG, 0)), +) + +COUNT_BY_SEVERITY: StaticSchema = ( + 17, + n0, + _CBS, + 0, + (_ke, _v), + ((STRING, 0), (INTEGER, 0)), +) + +MANAGEMENT_TYPE: StaticSchema = ( + 14, + n0, + _MT, + 0, + (_AM_, _MANUAL, _DISABLED), + ((-1, {_sV: _AM_}), (-1, {_sV: _MANUAL}), (-1, {_sV: _DISABLED})), +) + +COVERAGE_EC2_INSTANCE_DETAILS: StaticSchema = ( + 18, + n0, + _CEID, + 0, + (_IIn, _IT, _CAl, _ADg, _MT), + ( + (STRING, {_sN: _iIn}), + (STRING, {_sN: _iT}), + (STRING, {_sN: _cAl}), + (AGENT_DETAILS, {_sN: _aD}), + (MANAGEMENT_TYPE, {_sN: _mT}), + ), ) -ARCHIVE_FINDINGS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ArchiveFindingsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#ArchiveFindingsRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "FindingIds": { - "target": FINDING_IDS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="findingIds"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - }, -) +ISSUES: StaticSchema = (16, n0, _Issu, 0, (_me,), ((STRING, 0),)) -ARCHIVE_FINDINGS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ArchiveFindingsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#ArchiveFindingsResponse", - ) - ], -) - -ARCHIVE_FINDINGS = Schema( - id=ShapeID("com.amazonaws.guardduty#ArchiveFindings"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/detector/{DetectorId}/findings/archive", - "code": 200, - } - ), - ) - ], -) - -DETECTION_RULE_ARN = Schema( - id=ShapeID("com.amazonaws.guardduty#DetectionRuleArn"), shape_type=ShapeType.STRING -) - -ASSOCIATION_ID = Schema( - id=ShapeID("com.amazonaws.guardduty#AssociationId"), shape_type=ShapeType.STRING -) - -ASSOCIATION_MODE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#AssociationMode"), - shape_type=ShapeType.ENUM, - members={"LIVE": {"target": UNIT}, "DRY_RUN": {"target": UNIT}}, -) - -RULE_ID = Schema( - id=ShapeID("com.amazonaws.guardduty#RuleId"), shape_type=ShapeType.STRING -) - -ASSOCIATION_DETAIL = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#AssociationDetail"), - members={ - "AssociationId": { - "target": ASSOCIATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="associationId"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Arn": { - "target": DETECTION_RULE_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="arn"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "RuleId": { - "target": RULE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="ruleId"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "AccountId": { - "target": ACCOUNT_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="accountId"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Mode": { - "target": ASSOCIATION_MODE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="mode"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "CreatedAt": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="createdAt"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "UpdatedAt": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="updatedAt"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "ExpiresAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="expiresAt")], - }, - }, +FARGATE_DETAILS: StaticSchema = ( + 18, + n0, + _FD, + 0, + (_Issu, _MT), + ((ISSUES, {_sN: _iss}), (MANAGEMENT_TYPE, {_sN: _mT})), ) -ASSOCIATION_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#AssociationSummary"), - members={ - "AssociationId": { - "target": ASSOCIATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="associationId"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Arn": { - "target": DETECTION_RULE_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="arn"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "RuleId": { - "target": RULE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="ruleId"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Mode": { - "target": ASSOCIATION_MODE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="mode"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "CreatedAt": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="createdAt"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "UpdatedAt": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="updatedAt"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "ExpiresAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="expiresAt")], - }, - }, +COVERAGE_ECS_CLUSTER_DETAILS: StaticSchema = ( + 18, + n0, + _CECD, + 0, + (_CNl, _FD, _CID), + ( + (STRING, {_sN: _cNl}), + (FARGATE_DETAILS, {_sN: _fD}), + (CONTAINER_INSTANCE_DETAILS, {_sN: _cID}), + ), ) -ASSOCIATION_SUMMARY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#AssociationSummaryList"), - shape_type=ShapeType.LIST, - members={"member": {"target": ASSOCIATION_SUMMARY}}, +COVERAGE_EKS_CLUSTER_DETAILS: StaticSchema = ( + 18, + n0, + _CECDo, + 0, + (_CNl, _CNov, _CNom, _ADd, _MT), + ( + (STRING, {_sN: _cNl}), + (LONG, {_sN: _cNov}), + (LONG, {_sN: _cNom}), + (ADDON_DETAILS, {_sN: _aDd}), + (MANAGEMENT_TYPE, {_sN: _mT}), + ), ) -AUTO_ENABLE_MEMBERS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#AutoEnableMembers"), - shape_type=ShapeType.ENUM, - members={ - "NEW": {"target": UNIT}, - "ALL": {"target": UNIT}, - "NONE": {"target": UNIT}, - }, +COVERAGE_FILTER_CONDITION: StaticSchema = ( + 18, + n0, + _CFC, + 0, + (_Equ, _NE), + ((EQUALS, {_sN: _equ}), (NOT_EQUALS, {_sN: _nE})), +) + +COVERAGE_FILTER_CRITERION_KEY: StaticSchema = ( + 14, + n0, + _CFCK, + 0, + (_AI_, _RT_, _CS_, _AV_, _CN_, _ECN, _MT_, _ECN_, _AV__, _II_, _CA_), + ( + (-1, {_sV: _AI_}), + (-1, {_sV: _RT_}), + (-1, {_sV: _CS_}), + (-1, {_sV: _AV_}), + (-1, {_sV: _CN_}), + (-1, {_sV: _ECN}), + (-1, {_sV: _MT_}), + (-1, {_sV: _ECN_}), + (-1, {_sV: _AV__}), + (-1, {_sV: _II_}), + (-1, {_sV: _CA_}), + ), ) -AUTONOMOUS_SYSTEM = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#AutonomousSystem"), - members={ - "Name": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="name"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Number": { - "target": INTEGER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="number"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - }, +COVERAGE_FILTER_CRITERION: StaticSchema = ( + 18, + n0, + _CFCo, + 0, + (_CK, _FC), + ( + (COVERAGE_FILTER_CRITERION_KEY, {_sN: _cK}), + (COVERAGE_FILTER_CONDITION, {_sN: _fC}), + ), ) -EC2_INSTANCE_UID = Schema( - id=ShapeID("com.amazonaws.guardduty#Ec2InstanceUid"), shape_type=ShapeType.STRING +COVERAGE_FILTER_CRITERION_LIST: StaticSchema = ( + 16, + n0, + _CFCL, + 0, + (_me,), + ((COVERAGE_FILTER_CRITERION, 0),), +) + +COVERAGE_FILTER_CRITERIA: StaticSchema = ( + 18, + n0, + _CFCov, + 0, + (_FCi,), + ((COVERAGE_FILTER_CRITERION_LIST, {_sN: _fCi}),), +) + +COVERAGE_RESOURCE_DETAILS: StaticSchema = ( + 18, + n0, + _CRD, + 0, + (_ECD, _ECDc, _EID, _RT), + ( + (COVERAGE_EKS_CLUSTER_DETAILS, {_sN: _eCD}), + (COVERAGE_ECS_CLUSTER_DETAILS, {_sN: _eCDc}), + (COVERAGE_EC2_INSTANCE_DETAILS, {_sN: _eID}), + (RESOURCE_TYPE, {_sN: _rT}), + ), ) -EC2_INSTANCE_UIDS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Ec2InstanceUids"), - shape_type=ShapeType.LIST, - members={"member": {"target": EC2_INSTANCE_UID}}, +COVERAGE_RESOURCE: StaticSchema = ( + 18, + n0, + _CRo, + 0, + (_RIe, _DI, _AIcc, _RD, _CSo, _Issue, _UAp), + ( + (STRING, {_sN: _rIe}), + (DETECTOR_ID, {_sN: _dI}), + (ACCOUNT_ID, {_sN: _aIc}), + (COVERAGE_RESOURCE_DETAILS, {_sN: _rD}), + (COVERAGE_STATUS, {_sN: _cS}), + (STRING, {_sN: _issu}), + (TIMESTAMP, {_sN: _uAp}), + ), ) -AUTOSCALING_AUTO_SCALING_GROUP = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#AutoscalingAutoScalingGroup"), - members={ - "Ec2InstanceUids": { - "target": EC2_INSTANCE_UIDS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="ec2InstanceUids") - ], - } - }, +COVERAGE_RESOURCES: StaticSchema = (16, n0, _CRov, 0, (_me,), ((COVERAGE_RESOURCE, 0),)) + +COVERAGE_SORT_KEY: StaticSchema = ( + 14, + n0, + _CSK, + 0, + (_AI_, _CS_, _ISSUE, _AV_, _UA_, _CN_, _ECN_, _ECN, _II_), + ( + (-1, {_sV: _AI_}), + (-1, {_sV: _CS_}), + (-1, {_sV: _ISSUE}), + (-1, {_sV: _AV_}), + (-1, {_sV: _UA_}), + (-1, {_sV: _CN_}), + (-1, {_sV: _ECN_}), + (-1, {_sV: _ECN}), + (-1, {_sV: _II_}), + ), ) -BEDROCK_GUARDRAIL = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#BedrockGuardrail"), - members={ - "Arn": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="arn")], - }, - "Version": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="version")], - }, - }, +ORDER_BY: StaticSchema = ( + 14, + n0, + _OB, + 0, + (_ASC, _DESC), + ((-1, {_sV: _ASC}), (-1, {_sV: _DESC})), +) + +COVERAGE_SORT_CRITERIA: StaticSchema = ( + 18, + n0, + _CSC, + 0, + (_AN, _OB), + ((COVERAGE_SORT_KEY, {_sN: _aN}), (ORDER_BY, {_sN: _oB})), +) + +COVERAGE_STATISTICS: StaticSchema = ( + 18, + n0, + _CSov, + 0, + (_CBRT, _CBCS), + ((COUNT_BY_RESOURCE_TYPE, {_sN: _cBRT}), (COUNT_BY_COVERAGE_STATUS, {_sN: _cBCS})), +) + +COVERAGE_STATISTICS_TYPE: StaticSchema = ( + 14, + n0, + _CST, + 0, + (_CBRT_, _CBCS_), + ((-1, {_sV: _CBRT_}), (-1, {_sV: _CBCS_})), +) + +COVERAGE_STATISTICS_TYPE_LIST: StaticSchema = ( + 16, + n0, + _CSTL, + 0, + (_me,), + ((COVERAGE_STATISTICS_TYPE, 0),), +) + +TAG_KEY: StaticSchema = (3, n0, _TK, 0) + +TAG_VALUE: StaticSchema = (3, n0, _TV, 0) + +TAG_MAP: StaticSchema = (17, n0, _TM, 0, (_ke, _v), ((TAG_KEY, 0), (TAG_VALUE, 0))) + +CREATE_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT: StaticSchema = ( + 18, + n0, + _CCDRAI, + {_sSI: _cCCDRAR, _s: None}, + (_RI, _Mo, _CTl, _Ta), + ( + (RULE_ID, {_sN: _rI, _sm: None}), + (ASSOCIATION_MODE, {_sN: _mo, _sm: None}), + (CLIENT_TOKEN, {_sN: _cTl, _sTm: None}), + (TAG_MAP, {_sN: _ta}), + ), ) -CONTENT_POLICY_FILTER_ACTION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ContentPolicyFilterAction"), - shape_type=ShapeType.ENUM, - members={"BLOCKED": {"target": UNIT}, "NONE": {"target": UNIT}}, +CREATE_CUSTOM_DETECTION_RULE_ASSOCIATION_OUTPUT: StaticSchema = ( + 18, + n0, + _CCDRAO, + {_sSI: _cCCDRARo, _smi: None}, + (_RA,), + ((ASSOCIATION_DETAIL, {_sN: _rA, _sm: None}),), +) + +RESOURCE_NOT_FOUND_EXCEPTION: StaticSchema = ( + 18, + n0, + _RNFE, + {_smit: _c, _sE: 404}, + (_M, _T), + ((STRING, {_sN: _m}), (STRING, {_sN: _t})), +) + +CREATE_CUSTOM_DETECTION_RULE_ASSOCIATION: StaticOperationSchema = ( + 23, + n0, + _CCDRA, + { + _smith: MappingProxyType( + {"method": "POST", "uri": "/custom-detection-rule/association", "code": 200} + ) + }, + CREATE_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT, + CREATE_CUSTOM_DETECTION_RULE_ASSOCIATION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_ERROR_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + ), ) -CONFIDENCE_LEVEL = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ConfidenceLevel"), - shape_type=ShapeType.ENUM, - members={ - "HIGH": {"target": UNIT}, - "MEDIUM": {"target": UNIT}, - "LOW": {"target": UNIT}, - "NONE": {"target": UNIT}, - }, +DETECTION_RULE_ACCOUNT_IDS: StaticSchema = ( + 16, + n0, + _DRAI, + 0, + (_me,), + ((ACCOUNT_ID, 0),), +) + +CREATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT: StaticSchema = ( + 18, + n0, + _CCDROCI, + {_sSI: _cCCDROCR, _s: None}, + (_RI, _Mo, _IAI, _EAI, _CTl), + ( + (RULE_ID, {_sN: _rI, _sm: None}), + (ASSOCIATION_MODE, {_sN: _mo, _sm: None}), + (DETECTION_RULE_ACCOUNT_IDS, {_sN: _iAI}), + (DETECTION_RULE_ACCOUNT_IDS, {_sN: _eAI}), + (CLIENT_TOKEN, {_sN: _cTl, _sTm: None}), + ), ) -CONTENT_POLICY_FILTER_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ContentPolicyFilterType"), - shape_type=ShapeType.ENUM, - members={ - "PROMPT_ATTACK": {"target": UNIT}, - "JAILBREAK": {"target": UNIT}, - "HATE": {"target": UNIT}, - "INSULTS": {"target": UNIT}, - "SEXUAL": {"target": UNIT}, - "VIOLENCE": {"target": UNIT}, - "MISCONDUCT": {"target": UNIT}, - }, +CREATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_OUTPUT: StaticSchema = ( + 18, + n0, + _CCDROCO, + {_sSI: _cCCDROCRo, _smi: None}, +) + +CREATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION: StaticOperationSchema = ( + 23, + n0, + _CCDROC, + { + _smith: MappingProxyType( + { + "method": "POST", + "uri": "/custom-detection-rule/org-configuration", + "code": 200, + } + ) + }, + CREATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT, + CREATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_ERROR_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + ), ) -CONTENT_POLICY_FILTER = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ContentPolicyFilter"), - members={ - "Type": { - "target": CONTENT_POLICY_FILTER_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="type")], - }, - "Confidence": { - "target": CONFIDENCE_LEVEL, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="confidence") - ], - }, - "Action": { - "target": CONTENT_POLICY_FILTER_ACTION, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="action")], - }, - }, +KUBERNETES_AUDIT_LOGS_CONFIGURATION: StaticSchema = ( + 18, + n0, + _KALC, + 0, + (_En,), + ((BOOLEAN, {_sN: _en, _sm: None}),), +) + +KUBERNETES_CONFIGURATION: StaticSchema = ( + 18, + n0, + _KC, + 0, + (_AL,), + ((KUBERNETES_AUDIT_LOGS_CONFIGURATION, {_sN: _aL, _sm: None}),), +) + +SCAN_EC2_INSTANCE_WITH_FINDINGS: StaticSchema = ( + 18, + n0, + _SEIWF, + 0, + (_EV,), + ((BOOLEAN, {_sN: _eV}),), +) + +MALWARE_PROTECTION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _MPC, + 0, + (_SEIWF,), + ((SCAN_EC2_INSTANCE_WITH_FINDINGS, {_sN: _sEIWF}),), +) + +S3_LOGS_CONFIGURATION: StaticSchema = ( + 18, + n0, + _SLC, + 0, + (_En,), + ((BOOLEAN, {_sN: _en, _sm: None}),), +) + +DATA_SOURCE_CONFIGURATIONS: StaticSchema = ( + 18, + n0, + _DSC, + 0, + (_SL, _K, _MP), + ( + (S3_LOGS_CONFIGURATION, {_sN: _sLo}), + (KUBERNETES_CONFIGURATION, {_sN: _k}), + (MALWARE_PROTECTION_CONFIGURATION, {_sN: _mP}), + ), ) -CONTENT_POLICY_FILTERS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ContentPolicyFilters"), - shape_type=ShapeType.LIST, - members={"member": {"target": CONTENT_POLICY_FILTER}}, -) - -GUARDRAIL_ACTION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GuardrailAction"), - shape_type=ShapeType.ENUM, - members={"GUARDRAIL_INTERVENED": {"target": UNIT}, "NONE": {"target": UNIT}}, -) - -BEDROCK_GUARDRAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#BedrockGuardrails"), - shape_type=ShapeType.LIST, - members={"member": {"target": BEDROCK_GUARDRAIL}}, -) - -GUARDRAIL_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GuardrailSource"), - shape_type=ShapeType.ENUM, - members={"INPUT": {"target": UNIT}, "OUTPUT": {"target": UNIT}}, -) - -BEDROCK_GUARDRAIL_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#BedrockGuardrailDetails"), - members={ - "GuardrailArn": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="guardrailArn") - ], - }, - "GuardrailVersion": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="guardrailVersion") - ], - }, - "Guardrails": { - "target": BEDROCK_GUARDRAILS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="guardrails") - ], - }, - "GuardrailAction": { - "target": GUARDRAIL_ACTION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="guardrailAction") - ], - }, - "GuardrailSource": { - "target": GUARDRAIL_SOURCE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="guardrailSource") - ], - }, - "ContentPolicyFilters": { - "target": CONTENT_POLICY_FILTERS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="contentPolicyFilters" - ) - ], - }, - }, +FEATURE_ADDITIONAL_CONFIGURATION: StaticSchema = ( + 14, + n0, + _FAC, + 0, + (_EAM, _EFAM, _EAM_), + ((-1, {_sV: _EAM}), (-1, {_sV: _EFAM}), (-1, {_sV: _EAM_})), +) + +FEATURE_STATUS: StaticSchema = ( + 14, + n0, + _FS, + 0, + (_ENABLED, _DISABLED), + ((-1, {_sV: _ENABLED}), (-1, {_sV: _DISABLED})), +) + +DETECTOR_ADDITIONAL_CONFIGURATION: StaticSchema = ( + 18, + n0, + _DAC, + 0, + (_N, _St), + ((FEATURE_ADDITIONAL_CONFIGURATION, {_sN: _n}), (FEATURE_STATUS, {_sN: _st})), +) + +DETECTOR_ADDITIONAL_CONFIGURATIONS: StaticSchema = ( + 16, + n0, + _DACe, + 0, + (_me,), + ((DETECTOR_ADDITIONAL_CONFIGURATION, 0),), +) + +DETECTOR_FEATURE: StaticSchema = ( + 14, + n0, + _DF, + 0, + (_SDE, _EAL, _EMP, _RLE, _LNL, _ERM, _RM, _AP, _AA_), + ( + (-1, {_sV: _SDE}), + (-1, {_sV: _EAL}), + (-1, {_sV: _EMP}), + (-1, {_sV: _RLE}), + (-1, {_sV: _LNL}), + (-1, {_sV: _ERM}), + (-1, {_sV: _RM}), + (-1, {_sV: _AP}), + (-1, {_sV: _AA_}), + ), ) -BEDROCK_GUARDRAIL_RESOURCE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#BedrockGuardrailResource"), - members={ - "Version": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="version")], - }, - "GuardrailAction": { - "target": GUARDRAIL_ACTION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="guardrailAction") - ], - }, - "GuardrailSource": { - "target": GUARDRAIL_SOURCE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="guardrailSource") - ], - }, - }, +DETECTOR_FEATURE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _DFC, + 0, + (_N, _St, _ACd), + ( + (DETECTOR_FEATURE, {_sN: _n}), + (FEATURE_STATUS, {_sN: _st}), + (DETECTOR_ADDITIONAL_CONFIGURATIONS, {_sN: _aC}), + ), ) -BUCKET_POLICY = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#BucketPolicy"), - members={ - "AllowsPublicReadAccess": { - "target": BOOLEAN, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="allowsPublicReadAccess" - ) - ], - }, - "AllowsPublicWriteAccess": { - "target": BOOLEAN, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="allowsPublicWriteAccess" - ) - ], - }, - }, +DETECTOR_FEATURE_CONFIGURATIONS: StaticSchema = ( + 16, + n0, + _DFCe, + 0, + (_me,), + ((DETECTOR_FEATURE_CONFIGURATION, 0),), +) + +FINDING_PUBLISHING_FREQUENCY: StaticSchema = ( + 14, + n0, + _FPF, + 0, + (_FM, _OH, _SH), + ((-1, {_sV: _FM}), (-1, {_sV: _OH}), (-1, {_sV: _SH})), +) + +CREATE_DETECTOR_INPUT: StaticSchema = ( + 18, + n0, + _CDI, + {_sSI: _cCDR, _s: None}, + (_En, _CTl, _FPF, _DS, _Ta, _F), + ( + (BOOLEAN, {_sN: _en, _sm: None}), + (CLIENT_TOKEN, {_sN: _cTl, _sTm: None}), + (FINDING_PUBLISHING_FREQUENCY, {_sN: _fPF}), + (DATA_SOURCE_CONFIGURATIONS, {_sN: _dS}), + (TAG_MAP, {_sN: _ta}), + (DETECTOR_FEATURE_CONFIGURATIONS, {_sN: _f}), + ), ) -BUCKET_LEVEL_PERMISSIONS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#BucketLevelPermissions"), - members={ - "AccessControlList": { - "target": ACCESS_CONTROL_LIST, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="accessControlList") - ], - }, - "BucketPolicy": { - "target": BUCKET_POLICY, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="bucketPolicy") - ], - }, - "BlockPublicAccess": { - "target": BLOCK_PUBLIC_ACCESS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="blockPublicAccess") - ], - }, - }, +EBS_VOLUMES_RESULT: StaticSchema = ( + 18, + n0, + _EVR, + 0, + (_St, _Rea), + ((DATA_SOURCE_STATUS, {_sN: _st}), (STRING, {_sN: _rea})), +) + +SCAN_EC2_INSTANCE_WITH_FINDINGS_RESULT: StaticSchema = ( + 18, + n0, + _SEIWFR, + 0, + (_EV,), + ((EBS_VOLUMES_RESULT, {_sN: _eV}),), +) + +MALWARE_PROTECTION_CONFIGURATION_RESULT: StaticSchema = ( + 18, + n0, + _MPCR, + 0, + (_SEIWF, _SR), + ((SCAN_EC2_INSTANCE_WITH_FINDINGS_RESULT, {_sN: _sEIWF}), (STRING, {_sN: _sR})), +) + +UNPROCESSED_DATA_SOURCES_RESULT: StaticSchema = ( + 18, + n0, + _UDSR, + 0, + (_MP,), + ((MALWARE_PROTECTION_CONFIGURATION_RESULT, {_sN: _mP}),), +) + +CREATE_DETECTOR_OUTPUT: StaticSchema = ( + 18, + n0, + _CDO, + {_sSI: _cCDRo, _smi: None}, + (_DI, _UDS), + ((DETECTOR_ID, {_sN: _dI}), (UNPROCESSED_DATA_SOURCES_RESULT, {_sN: _uDS})), +) + +CREATE_DETECTOR: StaticOperationSchema = ( + 23, + n0, + _CDr, + {_smith: MappingProxyType({"method": "POST", "uri": "/detector", "code": 200})}, + CREATE_DETECTOR_INPUT, + CREATE_DETECTOR_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +FILTER_ACTION: StaticSchema = ( + 14, + n0, + _FA, + 0, + (_NOOP, _ARCHIVE), + ((-1, {_sV: _NOOP}), (-1, {_sV: _ARCHIVE})), +) + +FILTER_DESCRIPTION: StaticSchema = (3, n0, _FDi, 0) + +CRITERION: StaticSchema = (17, n0, _Cr, 0, (_ke, _v), ((STRING, 0), (CONDITION, 0))) + +FINDING_CRITERIA: StaticSchema = (18, n0, _FCin, 0, (_Cr,), ((CRITERION, {_sN: _cr}),)) + +FILTER_NAME: StaticSchema = (3, n0, _FN, 0) + +FILTER_RANK: StaticSchema = (7, n0, _FR, 0) + +CREATE_FILTER_INPUT: StaticSchema = ( + 18, + n0, + _CFI, + {_sSI: _cCFR, _s: None}, + (_DI, _N, _De, _Ac, _Ra, _FCin, _CTl, _Ta), + ( + (DETECTOR_ID, 9), + (FILTER_NAME, {_sN: _n, _sm: None}), + (FILTER_DESCRIPTION, {_sN: _de}), + (FILTER_ACTION, {_sN: _ac}), + (FILTER_RANK, {_sN: _ra}), + (FINDING_CRITERIA, {_sN: _fCin, _sm: None}), + (CLIENT_TOKEN, {_sN: _cTl, _sTm: None}), + (TAG_MAP, {_sN: _ta}), + ), ) -CLIENT_TOKEN = Schema( - id=ShapeID("com.amazonaws.guardduty#ClientToken"), shape_type=ShapeType.STRING -) - -CLOUD_PROVIDER = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CloudProvider"), - shape_type=ShapeType.ENUM, - members={"AWS": {"target": UNIT}}, -) - -CLOUD_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CloudDetails"), - members={ - "Provider": { - "target": CLOUD_PROVIDER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="provider"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Region": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="region"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Account": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="account"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - }, +CREATE_FILTER_OUTPUT: StaticSchema = ( + 18, + n0, + _CFO, + {_sSI: _cCFRo, _smi: None}, + (_N,), + ((FILTER_NAME, {_sN: _n, _sm: None}),), ) -CLOUDFORMATION_STACK = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CloudformationStack"), - members={ - "Ec2InstanceUids": { - "target": EC2_INSTANCE_UIDS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="ec2InstanceUids") - ], - } +CREATE_FILTER: StaticOperationSchema = ( + 23, + n0, + _CF, + { + _smith: MappingProxyType( + {"method": "POST", "uri": "/detector/{DetectorId}/filter", "code": 200} + ) }, + CREATE_FILTER_INPUT, + CREATE_FILTER_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), ) -DATA_SOURCE_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DataSourceStatus"), - shape_type=ShapeType.ENUM, - members={"ENABLED": {"target": UNIT}, "DISABLED": {"target": UNIT}}, -) +TRIGGER_PROMPT: StaticSchema = (3, n0, _TP, 0) -CLOUD_TRAIL_CONFIGURATION_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CloudTrailConfigurationResult"), - members={ - "Status": { - "target": DATA_SOURCE_STATUS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="status"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, +CREATE_INVESTIGATION_INPUT: StaticSchema = ( + 18, + n0, + _CII, + {_sSI: _cCIR, _s: None}, + (_DI, _TP, _CTl), + ( + (DETECTOR_ID, 9), + (TRIGGER_PROMPT, {_sN: _tP, _sm: None}), + (CLIENT_TOKEN, {_sN: _cTl, _sTm: None}), + ), ) -CLUSTER_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ClusterStatus"), - shape_type=ShapeType.ENUM, - members={ - "CREATING": {"target": UNIT}, - "ACTIVE": {"target": UNIT}, - "DELETING": {"target": UNIT}, - "FAILED": {"target": UNIT}, - "UPDATING": {"target": UNIT}, - "PENDING": {"target": UNIT}, - }, +INVESTIGATION_ID: StaticSchema = (3, n0, _IInv, 0) + +CREATE_INVESTIGATION_OUTPUT: StaticSchema = ( + 18, + n0, + _CIO, + {_sSI: _cCIRo, _smi: None}, + (_IInv,), + ((INVESTIGATION_ID, {_sN: _iInv, _sm: None}),), +) + +CREATE_INVESTIGATION: StaticOperationSchema = ( + 23, + n0, + _CI, + { + _smith: MappingProxyType( + { + "method": "POST", + "uri": "/detector/{DetectorId}/investigation", + "code": 202, + } + ) + }, + CREATE_INVESTIGATION_INPUT, + CREATE_INVESTIGATION_OUTPUT, + (ACCESS_DENIED_EXCEPTION, BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +IP_SET_FORMAT: StaticSchema = ( + 14, + n0, + _ISF, + 0, + (_TXT, _STIX, _OC, _AV___, _PP_, _FE), + ( + (-1, {_sV: _TXT}), + (-1, {_sV: _STIX}), + (-1, {_sV: _OC}), + (-1, {_sV: _AV___}), + (-1, {_sV: _PP_}), + (-1, {_sV: _FE}), + ), ) -EQ = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Eq"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, -) - -EQUALS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Equals"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, -) - -MATCH = Schema(id=ShapeID("com.amazonaws.guardduty#Match"), shape_type=ShapeType.STRING) - -MATCHES = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Matches"), - shape_type=ShapeType.LIST, - members={"member": {"target": MATCH}}, -) - -NEQ = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Neq"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, -) - -NOT_EQUALS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#NotEquals"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, -) - -NOT_MATCH = Schema( - id=ShapeID("com.amazonaws.guardduty#NotMatch"), shape_type=ShapeType.STRING -) - -NOT_MATCHES = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#NotMatches"), - shape_type=ShapeType.LIST, - members={"member": {"target": NOT_MATCH}}, -) - -CONDITION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Condition"), - members={ - "Eq": { - "target": EQ, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="eq")], - }, - "Neq": { - "target": NEQ, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="neq")], - }, - "Gt": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="gt")], - }, - "Gte": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="gte")], - }, - "Lt": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="lt")], - }, - "Lte": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="lte")], - }, - "Equals": { - "target": EQUALS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="equals")], - }, - "NotEquals": { - "target": NOT_EQUALS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="notEquals")], - }, - "GreaterThan": { - "target": LONG, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="greaterThan") - ], - }, - "GreaterThanOrEqual": { - "target": LONG, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="greaterThanOrEqual") - ], - }, - "LessThan": { - "target": LONG, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="lessThan")], - }, - "LessThanOrEqual": { - "target": LONG, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="lessThanOrEqual") - ], - }, - "Matches": { - "target": MATCHES, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="matches")], - }, - "NotMatches": { - "target": NOT_MATCHES, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="notMatches") - ], - }, - }, +LOCATION: StaticSchema = (3, n0, _Loc, 0) + +NAME: StaticSchema = (3, n0, _N, 0) + +CREATE_IP_SET_INPUT: StaticSchema = ( + 18, + n0, + _CIPSI, + {_sSI: _cCIPSR, _s: None}, + (_DI, _N, _Fo, _Loc, _Activ, _CTl, _Ta, _EBO), + ( + (DETECTOR_ID, 9), + (NAME, {_sN: _n, _sm: None}), + (IP_SET_FORMAT, {_sN: _fo, _sm: None}), + (LOCATION, {_sN: _loc, _sm: None}), + (BOOLEAN, {_sN: _act, _sm: None}), + (CLIENT_TOKEN, {_sN: _cTl, _sTm: None}), + (TAG_MAP, {_sN: _ta}), + (ACCOUNT_ID, {_sN: _eBO}), + ), ) -CONFIDENCE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Confidence"), - shape_type=ShapeType.ENUM, - members={ - "UNKNOWN": {"target": UNIT}, - "LOW": {"target": UNIT}, - "MEDIUM": {"target": UNIT}, - "HIGH": {"target": UNIT}, - }, +CREATE_IP_SET_OUTPUT: StaticSchema = ( + 18, + n0, + _CIPSO, + {_sSI: _cCIPSRo, _smi: None}, + (_ISI,), + ((STRING, {_sN: _iSI, _sm: None}),), +) + +CREATE_IP_SET: StaticOperationSchema = ( + 23, + n0, + _CIPS, + { + _smith: MappingProxyType( + {"method": "POST", "uri": "/detector/{DetectorId}/ipset", "code": 200} + ) + }, + CREATE_IP_SET_INPUT, + CREATE_IP_SET_OUTPUT, + (ACCESS_DENIED_EXCEPTION, BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +MALWARE_PROTECTION_PLAN_TAGGING_ACTION_STATUS: StaticSchema = ( + 14, + n0, + _MPPTAS, + 0, + (_ENABLED, _DISABLED), + ((-1, {_sV: _ENABLED}), (-1, {_sV: _DISABLED})), +) + +MALWARE_PROTECTION_PLAN_TAGGING_ACTION: StaticSchema = ( + 18, + n0, + _MPPTA, + 0, + (_St,), + ((MALWARE_PROTECTION_PLAN_TAGGING_ACTION_STATUS, {_sN: _st}),), +) + +MALWARE_PROTECTION_PLAN_ACTIONS: StaticSchema = ( + 18, + n0, + _MPPA, + 0, + (_Tag,), + ((MALWARE_PROTECTION_PLAN_TAGGING_ACTION, {_sN: _tag}),), +) + +MALWARE_PROTECTION_PLAN_OBJECT_PREFIXES_LIST: StaticSchema = ( + 16, + n0, + _MPPOPL, + 0, + (_me,), + ((STRING, 0),), +) + +CREATE_S3_BUCKET_RESOURCE: StaticSchema = ( + 18, + n0, + _CSBR, + 0, + (_BN, _OP), + ((STRING, {_sN: _bN}), (MALWARE_PROTECTION_PLAN_OBJECT_PREFIXES_LIST, {_sN: _oP})), +) + +CREATE_PROTECTED_RESOURCE: StaticSchema = ( + 18, + n0, + _CPR, + 0, + (_SB,), + ((CREATE_S3_BUCKET_RESOURCE, {_sN: _sB}),), +) + +CREATE_MALWARE_PROTECTION_PLAN_INPUT: StaticSchema = ( + 18, + n0, + _CMPPI, + {_sSI: _cCMPPR, _s: None}, + (_CTl, _Ro, _PR, _Actio, _Ta), + ( + (CLIENT_TOKEN, {_sN: _cTl, _sTm: None}), + (STRING, {_sN: _ro, _sm: None}), + (CREATE_PROTECTED_RESOURCE, {_sN: _pR, _sm: None}), + (MALWARE_PROTECTION_PLAN_ACTIONS, {_sN: _acti}), + (TAG_MAP, {_sN: _ta}), + ), ) -CONFLICT_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ConflictException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=409), - ], - members={ - "Message": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="message")], - }, - "Type": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="type")], - }, - }, +CREATE_MALWARE_PROTECTION_PLAN_OUTPUT: StaticSchema = ( + 18, + n0, + _CMPPO, + {_sSI: _cCMPPRo, _smi: None}, + (_MPPI,), + ((STRING, {_sN: _mPPI}),), ) -SECURITY_CONTEXT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#SecurityContext"), - members={ - "Privileged": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="privileged") - ], - }, - "AllowPrivilegeEscalation": { - "target": BOOLEAN, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="allowPrivilegeEscalation" - ) - ], - }, +CREATE_MALWARE_PROTECTION_PLAN: StaticOperationSchema = ( + 23, + n0, + _CMPP, + { + _smith: MappingProxyType( + {"method": "POST", "uri": "/malware-protection-plan", "code": 200} + ) }, + CREATE_MALWARE_PROTECTION_PLAN_INPUT, + CREATE_MALWARE_PROTECTION_PLAN_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_ERROR_EXCEPTION, + ), ) -VOLUME_MOUNT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#VolumeMount"), - members={ - "Name": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="name")], - }, - "MountPath": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="mountPath")], - }, - }, +CREATE_MEMBERS_INPUT: StaticSchema = ( + 18, + n0, + _CMI, + {_sSI: _cCMR, _s: None}, + (_DI, _ADc), + ((DETECTOR_ID, 9), (ACCOUNT_DETAILS, {_sN: _aDc, _sm: None})), +) + +UNPROCESSED_ACCOUNT: StaticSchema = ( + 18, + n0, + _UAn, + 0, + (_AIcc, _Res), + ((ACCOUNT_ID, {_sN: _aIc, _sm: None}), (STRING, {_sN: _res, _sm: None})), +) + +UNPROCESSED_ACCOUNTS: StaticSchema = ( + 16, + n0, + _UAnp, + 0, + (_me,), + ((UNPROCESSED_ACCOUNT, 0),), +) + +CREATE_MEMBERS_OUTPUT: StaticSchema = ( + 18, + n0, + _CMO, + {_sSI: _cCMRo, _smi: None}, + (_UAnp,), + ((UNPROCESSED_ACCOUNTS, {_sN: _uAn, _sm: None}),), +) + +CREATE_MEMBERS: StaticOperationSchema = ( + 23, + n0, + _CM, + { + _smith: MappingProxyType( + {"method": "POST", "uri": "/detector/{DetectorId}/member", "code": 200} + ) + }, + CREATE_MEMBERS_INPUT, + CREATE_MEMBERS_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +DESTINATION_PROPERTIES: StaticSchema = ( + 18, + n0, + _DP, + 0, + (_DA, _KKA), + ((STRING, {_sN: _dA}), (STRING, {_sN: _kKA})), +) + +DESTINATION_TYPE: StaticSchema = (14, n0, _DT, 0, (_S_,), ((-1, {_sV: _S_}),)) + +CREATE_PUBLISHING_DESTINATION_INPUT: StaticSchema = ( + 18, + n0, + _CPDI, + {_sSI: _cCPDR, _s: None}, + (_DI, _DT, _DP, _CTl, _Ta), + ( + (DETECTOR_ID, 9), + (DESTINATION_TYPE, {_sN: _dT, _sm: None}), + (DESTINATION_PROPERTIES, {_sN: _dP, _sm: None}), + (CLIENT_TOKEN, {_sN: _cTl, _sTm: None}), + (TAG_MAP, {_sN: _ta}), + ), ) -VOLUME_MOUNTS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#VolumeMounts"), - shape_type=ShapeType.LIST, - members={"member": {"target": VOLUME_MOUNT}}, -) - -CONTAINER = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Container"), - members={ - "ContainerRuntime": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="containerRuntime") - ], - }, - "Id": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="id")], - }, - "Name": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="name")], - }, - "Image": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="image")], - }, - "ImagePrefix": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="imagePrefix") - ], - }, - "VolumeMounts": { - "target": VOLUME_MOUNTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="volumeMounts") - ], - }, - "SecurityContext": { - "target": SECURITY_CONTEXT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="securityContext") - ], - }, - }, +CREATE_PUBLISHING_DESTINATION_OUTPUT: StaticSchema = ( + 18, + n0, + _CPDO, + {_sSI: _cCPDRo, _smi: None}, + (_DIe,), + ((STRING, {_sN: _dIe, _sm: None}),), +) + +CREATE_PUBLISHING_DESTINATION: StaticOperationSchema = ( + 23, + n0, + _CPD, + { + _smith: MappingProxyType( + { + "method": "POST", + "uri": "/detector/{DetectorId}/publishingDestination", + "code": 200, + } + ) + }, + CREATE_PUBLISHING_DESTINATION_INPUT, + CREATE_PUBLISHING_DESTINATION_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +FINDING_TYPES: StaticSchema = (16, n0, _FTi, 0, (_me,), ((FINDING_TYPE, 0),)) + +CREATE_SAMPLE_FINDINGS_INPUT: StaticSchema = ( + 18, + n0, + _CSFI, + {_sSI: _cCSFR, _s: None}, + (_DI, _FTi), + ((DETECTOR_ID, 9), (FINDING_TYPES, {_sN: _fT})), +) + +CREATE_SAMPLE_FINDINGS_OUTPUT: StaticSchema = ( + 18, + n0, + _CSFO, + {_sSI: _cCSFRo, _smi: None}, +) + +CREATE_SAMPLE_FINDINGS: StaticOperationSchema = ( + 23, + n0, + _CSF, + { + _smith: MappingProxyType( + { + "method": "POST", + "uri": "/detector/{DetectorId}/findings/create", + "code": 200, + } + ) + }, + CREATE_SAMPLE_FINDINGS_INPUT, + CREATE_SAMPLE_FINDINGS_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +EXPECTED_BUCKET_OWNER: StaticSchema = (3, n0, _EBO, 0) + +THREAT_ENTITY_SET_FORMAT: StaticSchema = ( + 14, + n0, + _TESF, + 0, + (_TXT, _STIX, _OC, _AV___, _PP_, _FE), + ( + (-1, {_sV: _TXT}), + (-1, {_sV: _STIX}), + (-1, {_sV: _OC}), + (-1, {_sV: _AV___}), + (-1, {_sV: _PP_}), + (-1, {_sV: _FE}), + ), ) -CONTAINER_IMAGE_UID = Schema( - id=ShapeID("com.amazonaws.guardduty#ContainerImageUid"), shape_type=ShapeType.STRING -) - -CONTAINER_FINDING_RESOURCE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ContainerFindingResource"), - members={ - "Image": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="image"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "ImageUid": { - "target": CONTAINER_IMAGE_UID, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="imageUid")], - }, - }, +CREATE_THREAT_ENTITY_SET_INPUT: StaticSchema = ( + 18, + n0, + _CTESI, + {_sSI: _cCTESR, _s: None}, + (_DI, _N, _Fo, _Loc, _EBO, _Activ, _CTl, _Ta), + ( + (DETECTOR_ID, 9), + (NAME, {_sN: _n, _sm: None}), + (THREAT_ENTITY_SET_FORMAT, {_sN: _fo, _sm: None}), + (LOCATION, {_sN: _loc, _sm: None}), + (EXPECTED_BUCKET_OWNER, {_sN: _eBO}), + (BOOLEAN, {_sN: _act, _sm: None}), + (CLIENT_TOKEN, {_sN: _cTl, _sTm: None}), + (TAG_MAP, {_sN: _ta}), + ), ) -CONTAINER_INSTANCE_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ContainerInstanceDetails"), - members={ - "CoveredContainerInstances": { - "target": LONG, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="coveredContainerInstances" - ) - ], - }, - "CompatibleContainerInstances": { - "target": LONG, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), - value="compatibleContainerInstances", - ) - ], - }, - }, +CREATE_THREAT_ENTITY_SET_OUTPUT: StaticSchema = ( + 18, + n0, + _CTESO, + {_sSI: _cCTESRo, _smi: None}, + (_TESI,), + ((STRING, {_sN: _tESI, _sm: None}),), +) + +CREATE_THREAT_ENTITY_SET: StaticOperationSchema = ( + 23, + n0, + _CTES, + { + _smith: MappingProxyType( + { + "method": "POST", + "uri": "/detector/{DetectorId}/threatentityset", + "code": 200, + } + ) + }, + CREATE_THREAT_ENTITY_SET_INPUT, + CREATE_THREAT_ENTITY_SET_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +THREAT_INTEL_SET_FORMAT: StaticSchema = ( + 14, + n0, + _TISF, + 0, + (_TXT, _STIX, _OC, _AV___, _PP_, _FE), + ( + (-1, {_sV: _TXT}), + (-1, {_sV: _STIX}), + (-1, {_sV: _OC}), + (-1, {_sV: _AV___}), + (-1, {_sV: _PP_}), + (-1, {_sV: _FE}), + ), ) -CONTAINERS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Containers"), - shape_type=ShapeType.LIST, - members={"member": {"target": CONTAINER}}, +CREATE_THREAT_INTEL_SET_INPUT: StaticSchema = ( + 18, + n0, + _CTISI, + {_sSI: _cCTISR, _s: None}, + (_DI, _N, _Fo, _Loc, _Activ, _CTl, _Ta, _EBO), + ( + (DETECTOR_ID, 9), + (NAME, {_sN: _n, _sm: None}), + (THREAT_INTEL_SET_FORMAT, {_sN: _fo, _sm: None}), + (LOCATION, {_sN: _loc, _sm: None}), + (BOOLEAN, {_sN: _act, _sm: None}), + (CLIENT_TOKEN, {_sN: _cTl, _sTm: None}), + (TAG_MAP, {_sN: _ta}), + (ACCOUNT_ID, {_sN: _eBO}), + ), ) -CONTAINER_UID = Schema( - id=ShapeID("com.amazonaws.guardduty#ContainerUid"), shape_type=ShapeType.STRING +CREATE_THREAT_INTEL_SET_OUTPUT: StaticSchema = ( + 18, + n0, + _CTISO, + {_sSI: _cCTISRo, _smi: None}, + (_TISI,), + ((STRING, {_sN: _tISI, _sm: None}),), +) + +CREATE_THREAT_INTEL_SET: StaticOperationSchema = ( + 23, + n0, + _CTIS, + { + _smith: MappingProxyType( + { + "method": "POST", + "uri": "/detector/{DetectorId}/threatintelset", + "code": 200, + } + ) + }, + CREATE_THREAT_INTEL_SET_INPUT, + CREATE_THREAT_INTEL_SET_OUTPUT, + (ACCESS_DENIED_EXCEPTION, BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +TRUSTED_ENTITY_SET_FORMAT: StaticSchema = ( + 14, + n0, + _TESFr, + 0, + (_TXT, _STIX, _OC, _AV___, _PP_, _FE), + ( + (-1, {_sV: _TXT}), + (-1, {_sV: _STIX}), + (-1, {_sV: _OC}), + (-1, {_sV: _AV___}), + (-1, {_sV: _PP_}), + (-1, {_sV: _FE}), + ), ) -CONTAINER_UIDS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ContainerUids"), - shape_type=ShapeType.LIST, - members={"member": {"target": CONTAINER_UID}}, +CREATE_TRUSTED_ENTITY_SET_INPUT: StaticSchema = ( + 18, + n0, + _CTESIr, + {_sSI: _cCTESRom, _s: None}, + (_DI, _N, _Fo, _Loc, _EBO, _Activ, _CTl, _Ta), + ( + (DETECTOR_ID, 9), + (NAME, {_sN: _n, _sm: None}), + (TRUSTED_ENTITY_SET_FORMAT, {_sN: _fo, _sm: None}), + (LOCATION, {_sN: _loc, _sm: None}), + (EXPECTED_BUCKET_OWNER, {_sN: _eBO}), + (BOOLEAN, {_sN: _act, _sm: None}), + (CLIENT_TOKEN, {_sN: _cTl, _sTm: None}), + (TAG_MAP, {_sN: _ta}), + ), ) -CONTINUOUS_SCAN_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ContinuousScanDetails"), - members={ - "StartTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="startTime")], - }, - "EndTime": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="endTime"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - }, +CREATE_TRUSTED_ENTITY_SET_OUTPUT: StaticSchema = ( + 18, + n0, + _CTESOr, + {_sSI: _cCTESRoma, _smi: None}, + (_TESIr,), + ((STRING, {_sN: _tESIr, _sm: None}),), +) + +CREATE_TRUSTED_ENTITY_SET: StaticOperationSchema = ( + 23, + n0, + _CTESr, + { + _smith: MappingProxyType( + { + "method": "POST", + "uri": "/detector/{DetectorId}/trustedentityset", + "code": 200, + } + ) + }, + CREATE_TRUSTED_ENTITY_SET_INPUT, + CREATE_TRUSTED_ENTITY_SET_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +CRITERION_KEY: StaticSchema = ( + 14, + n0, + _CK, + 0, + (_EIA, _SI_, _AI_, _GFI, _SST, _SS_, _ST_), + ( + (-1, {_sV: _EIA}), + (-1, {_sV: _SI_}), + (-1, {_sV: _AI_}), + (-1, {_sV: _GFI}), + (-1, {_sV: _SST}), + (-1, {_sV: _SS_}), + (-1, {_sV: _ST_}), + ), ) -COVERAGE_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CoverageStatus"), - shape_type=ShapeType.ENUM, - members={"HEALTHY": {"target": UNIT}, "UNHEALTHY": {"target": UNIT}}, +DATA_SOURCE: StaticSchema = ( + 14, + n0, + _DSa, + 0, + (_FL_, _CT_, _DL_, _SL_, _KAL, _EMS), + ( + (-1, {_sV: _FL_}), + (-1, {_sV: _CT_}), + (-1, {_sV: _DL_}), + (-1, {_sV: _SL_}), + (-1, {_sV: _KAL}), + (-1, {_sV: _EMS}), + ), ) -COUNT_BY_COVERAGE_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CountByCoverageStatus"), - shape_type=ShapeType.MAP, - members={"key": {"target": COVERAGE_STATUS}, "value": {"target": LONG}}, +DNS_LOGS_CONFIGURATION_RESULT: StaticSchema = ( + 18, + n0, + _DNSLCR, + 0, + (_St,), + ((DATA_SOURCE_STATUS, {_sN: _st, _sm: None}),), +) + +FLOW_LOGS_CONFIGURATION_RESULT: StaticSchema = ( + 18, + n0, + _FLCR, + 0, + (_St,), + ((DATA_SOURCE_STATUS, {_sN: _st, _sm: None}),), +) + +KUBERNETES_AUDIT_LOGS_CONFIGURATION_RESULT: StaticSchema = ( + 18, + n0, + _KALCR, + 0, + (_St,), + ((DATA_SOURCE_STATUS, {_sN: _st, _sm: None}),), +) + +KUBERNETES_CONFIGURATION_RESULT: StaticSchema = ( + 18, + n0, + _KCR, + 0, + (_AL,), + ((KUBERNETES_AUDIT_LOGS_CONFIGURATION_RESULT, {_sN: _aL, _sm: None}),), +) + +S3_LOGS_CONFIGURATION_RESULT: StaticSchema = ( + 18, + n0, + _SLCR, + 0, + (_St,), + ((DATA_SOURCE_STATUS, {_sN: _st, _sm: None}),), +) + +DATA_SOURCE_CONFIGURATIONS_RESULT: StaticSchema = ( + 18, + n0, + _DSCR, + 0, + (_CT, _DNSL, _FL, _SL, _K, _MP), + ( + (CLOUD_TRAIL_CONFIGURATION_RESULT, {_sN: _cT, _sm: None}), + (DNS_LOGS_CONFIGURATION_RESULT, {_sN: _dL, _sm: None}), + (FLOW_LOGS_CONFIGURATION_RESULT, {_sN: _fL, _sm: None}), + (S3_LOGS_CONFIGURATION_RESULT, {_sN: _sLo, _sm: None}), + (KUBERNETES_CONFIGURATION_RESULT, {_sN: _k}), + (MALWARE_PROTECTION_CONFIGURATION_RESULT, {_sN: _mP}), + ), ) -RESOURCE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ResourceType"), - shape_type=ShapeType.ENUM, - members={"EKS": {"target": UNIT}, "ECS": {"target": UNIT}, "EC2": {"target": UNIT}}, -) +DATA_SOURCE_LIST: StaticSchema = (16, n0, _DSL, 0, (_me,), ((DATA_SOURCE, 0),)) -COUNT_BY_RESOURCE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CountByResourceType"), - shape_type=ShapeType.MAP, - members={"key": {"target": RESOURCE_TYPE}, "value": {"target": LONG}}, +DATE_STATISTICS: StaticSchema = ( + 18, + n0, + _DSat, + 0, + (_Da, _LGA, _Sev, _TF), + ( + (TIMESTAMP, {_sN: _da}), + (TIMESTAMP, {_sN: _lGA}), + (DOUBLE, {_sN: _sev}), + (INTEGER, {_sN: _tF}), + ), ) -COUNT_BY_SEVERITY = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CountBySeverity"), - shape_type=ShapeType.MAP, - members={"key": {"target": STRING}, "value": {"target": INTEGER}}, +DECLINE_INVITATIONS_INPUT: StaticSchema = ( + 18, + n0, + _DII, + {_sSI: _cDIR, _s: None}, + (_AIcco,), + ((ACCOUNT_IDS, {_sN: _aIcc, _sm: None}),), +) + +DECLINE_INVITATIONS_OUTPUT: StaticSchema = ( + 18, + n0, + _DIO, + {_sSI: _cDIRo, _smi: None}, + (_UAnp,), + ((UNPROCESSED_ACCOUNTS, {_sN: _uAn, _sm: None}),), +) + +DECLINE_INVITATIONS: StaticOperationSchema = ( + 23, + n0, + _DIec, + { + _smith: MappingProxyType( + {"method": "POST", "uri": "/invitation/decline", "code": 200} + ) + }, + DECLINE_INVITATIONS_INPUT, + DECLINE_INVITATIONS_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +DEFAULT_SERVER_SIDE_ENCRYPTION: StaticSchema = ( + 18, + n0, + _DSSE, + 0, + (_ETn, _KMKA), + ((STRING, {_sN: _eTn}), (STRING, {_sN: _kMKA})), +) + +DELETE_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT: StaticSchema = ( + 18, + n0, + _DCDRAI, + {_sSI: _cDCDRAR, _s: None}, + (_RI, _AIs), + ((RULE_ID, 9), (ASSOCIATION_ID, 9)), +) + +DELETE_CUSTOM_DETECTION_RULE_ASSOCIATION_OUTPUT: StaticSchema = ( + 18, + n0, + _DCDRAO, + {_sSI: _cDCDRARo, _smi: None}, +) + +DELETE_CUSTOM_DETECTION_RULE_ASSOCIATION: StaticOperationSchema = ( + 23, + n0, + _DCDRA, + { + _smith: MappingProxyType( + { + "method": "DELETE", + "uri": "/custom-detection-rule/rule/{RuleId}/association/{AssociationId}", + "code": 200, + } + ) + }, + DELETE_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT, + DELETE_CUSTOM_DETECTION_RULE_ASSOCIATION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + BAD_REQUEST_EXCEPTION, + INTERNAL_SERVER_ERROR_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + ), ) -MANAGEMENT_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ManagementType"), - shape_type=ShapeType.ENUM, - members={ - "AUTO_MANAGED": {"target": UNIT}, - "MANUAL": {"target": UNIT}, - "DISABLED": {"target": UNIT}, - }, +DELETE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT: StaticSchema = ( + 18, + n0, + _DCDROCI, + {_sSI: _cDCDROCR, _s: None}, + (_RI, _Mo), + ((RULE_ID, 9), (ASSOCIATION_MODE, {_sQ: _mo, _sm: None})), +) + +DELETE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_OUTPUT: StaticSchema = ( + 18, + n0, + _DCDROCO, + {_sSI: _cDCDROCRo, _smi: None}, +) + +DELETE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION: StaticOperationSchema = ( + 23, + n0, + _DCDROC, + { + _smith: MappingProxyType( + { + "method": "DELETE", + "uri": "/custom-detection-rule/org-configuration/{RuleId}", + "code": 200, + } + ) + }, + DELETE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT, + DELETE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_ERROR_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + ), ) -COVERAGE_EC2_INSTANCE_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CoverageEc2InstanceDetails"), - members={ - "InstanceId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="instanceId") - ], - }, - "InstanceType": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="instanceType") - ], - }, - "ClusterArn": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="clusterArn") - ], - }, - "AgentDetails": { - "target": AGENT_DETAILS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="agentDetails") - ], - }, - "ManagementType": { - "target": MANAGEMENT_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="managementType") - ], - }, - }, +DELETE_DETECTOR_INPUT: StaticSchema = ( + 18, + n0, + _DDI, + {_sSI: _cDDR, _s: None}, + (_DI,), + ((DETECTOR_ID, 9),), ) -ISSUES = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Issues"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, -) - -FARGATE_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#FargateDetails"), - members={ - "Issues": { - "target": ISSUES, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="issues")], - }, - "ManagementType": { - "target": MANAGEMENT_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="managementType") - ], - }, - }, -) +DELETE_DETECTOR_OUTPUT: StaticSchema = (18, n0, _DDO, {_sSI: _cDDRo, _smi: None}) -COVERAGE_ECS_CLUSTER_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CoverageEcsClusterDetails"), - members={ - "ClusterName": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="clusterName") - ], - }, - "FargateDetails": { - "target": FARGATE_DETAILS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="fargateDetails") - ], - }, - "ContainerInstanceDetails": { - "target": CONTAINER_INSTANCE_DETAILS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="containerInstanceDetails" - ) - ], - }, +DELETE_DETECTOR: StaticOperationSchema = ( + 23, + n0, + _DDe, + { + _smith: MappingProxyType( + {"method": "DELETE", "uri": "/detector/{DetectorId}", "code": 200} + ) }, + DELETE_DETECTOR_INPUT, + DELETE_DETECTOR_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), ) -COVERAGE_EKS_CLUSTER_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CoverageEksClusterDetails"), - members={ - "ClusterName": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="clusterName") - ], - }, - "CoveredNodes": { - "target": LONG, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="coveredNodes") - ], - }, - "CompatibleNodes": { - "target": LONG, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="compatibleNodes") - ], - }, - "AddonDetails": { - "target": ADDON_DETAILS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="addonDetails") - ], - }, - "ManagementType": { - "target": MANAGEMENT_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="managementType") - ], - }, - }, +DELETE_FILTER_INPUT: StaticSchema = ( + 18, + n0, + _DFI, + {_sSI: _cDFR, _s: None}, + (_DI, _FN), + ((DETECTOR_ID, 9), (STRING, 9)), ) -COVERAGE_FILTER_CONDITION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CoverageFilterCondition"), - members={ - "Equals": { - "target": EQUALS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="equals")], - }, - "NotEquals": { - "target": NOT_EQUALS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="notEquals")], - }, - }, -) +DELETE_FILTER_OUTPUT: StaticSchema = (18, n0, _DFO, {_sSI: _cDFRo, _smi: None}) -COVERAGE_FILTER_CRITERION_KEY = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CoverageFilterCriterionKey"), - shape_type=ShapeType.ENUM, - members={ - "ACCOUNT_ID": {"target": UNIT}, - "RESOURCE_TYPE": {"target": UNIT}, - "COVERAGE_STATUS": {"target": UNIT}, - "ADDON_VERSION": {"target": UNIT}, - "CLUSTER_NAME": {"target": UNIT}, - "ECS_CLUSTER_NAME": {"target": UNIT}, - "MANAGEMENT_TYPE": {"target": UNIT}, - "EKS_CLUSTER_NAME": {"target": UNIT}, - "AGENT_VERSION": {"target": UNIT}, - "INSTANCE_ID": {"target": UNIT}, - "CLUSTER_ARN": {"target": UNIT}, +DELETE_FILTER: StaticOperationSchema = ( + 23, + n0, + _DFe, + { + _smith: MappingProxyType( + { + "method": "DELETE", + "uri": "/detector/{DetectorId}/filter/{FilterName}", + "code": 200, + } + ) }, + DELETE_FILTER_INPUT, + DELETE_FILTER_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +DELETE_INVITATIONS_INPUT: StaticSchema = ( + 18, + n0, + _DIIe, + {_sSI: _cDIRom, _s: None}, + (_AIcco,), + ((ACCOUNT_IDS, {_sN: _aIcc, _sm: None}),), +) + +DELETE_INVITATIONS_OUTPUT: StaticSchema = ( + 18, + n0, + _DIOe, + {_sSI: _cDIRoma, _smi: None}, + (_UAnp,), + ((UNPROCESSED_ACCOUNTS, {_sN: _uAn, _sm: None}),), +) + +DELETE_INVITATIONS: StaticOperationSchema = ( + 23, + n0, + _DIel, + { + _smith: MappingProxyType( + {"method": "POST", "uri": "/invitation/delete", "code": 200} + ) + }, + DELETE_INVITATIONS_INPUT, + DELETE_INVITATIONS_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +DELETE_IP_SET_INPUT: StaticSchema = ( + 18, + n0, + _DIPSI, + {_sSI: _cDIPSR, _s: None}, + (_DI, _ISI), + ((DETECTOR_ID, 9), (STRING, 9)), +) + +DELETE_IP_SET_OUTPUT: StaticSchema = (18, n0, _DIPSO, {_sSI: _cDIPSRo, _smi: None}) + +DELETE_IP_SET: StaticOperationSchema = ( + 23, + n0, + _DIPS, + { + _smith: MappingProxyType( + { + "method": "DELETE", + "uri": "/detector/{DetectorId}/ipset/{IpSetId}", + "code": 200, + } + ) + }, + DELETE_IP_SET_INPUT, + DELETE_IP_SET_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +DELETE_MALWARE_PROTECTION_PLAN_INPUT: StaticSchema = ( + 18, + n0, + _DMPPI, + {_sSI: _cDMPPR, _s: None}, + (_MPPI,), + ((STRING, 9),), +) + +DELETE_MALWARE_PROTECTION_PLAN_OUTPUT: StaticSchema = ( + 18, + n0, + _DMPPO, + {_sSI: _sU, _smi: None}, +) + +DELETE_MALWARE_PROTECTION_PLAN: StaticOperationSchema = ( + 23, + n0, + _DMPP, + { + _smith: MappingProxyType( + { + "method": "DELETE", + "uri": "/malware-protection-plan/{MalwareProtectionPlanId}", + "code": 200, + } + ) + }, + DELETE_MALWARE_PROTECTION_PLAN_INPUT, + DELETE_MALWARE_PROTECTION_PLAN_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + BAD_REQUEST_EXCEPTION, + INTERNAL_SERVER_ERROR_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + ), ) -COVERAGE_FILTER_CRITERION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CoverageFilterCriterion"), - members={ - "CriterionKey": { - "target": COVERAGE_FILTER_CRITERION_KEY, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="criterionKey") - ], - }, - "FilterCondition": { - "target": COVERAGE_FILTER_CONDITION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="filterCondition") - ], - }, - }, +DELETE_MEMBERS_INPUT: StaticSchema = ( + 18, + n0, + _DMI, + {_sSI: _cDMR, _s: None}, + (_DI, _AIcco), + ((DETECTOR_ID, 9), (ACCOUNT_IDS, {_sN: _aIcc, _sm: None})), +) + +DELETE_MEMBERS_OUTPUT: StaticSchema = ( + 18, + n0, + _DMO, + {_sSI: _cDMRo, _smi: None}, + (_UAnp,), + ((UNPROCESSED_ACCOUNTS, {_sN: _uAn, _sm: None}),), +) + +DELETE_MEMBERS: StaticOperationSchema = ( + 23, + n0, + _DM, + { + _smith: MappingProxyType( + { + "method": "POST", + "uri": "/detector/{DetectorId}/member/delete", + "code": 200, + } + ) + }, + DELETE_MEMBERS_INPUT, + DELETE_MEMBERS_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +DELETE_PUBLISHING_DESTINATION_INPUT: StaticSchema = ( + 18, + n0, + _DPDI, + {_sSI: _cDPDR, _s: None}, + (_DI, _DIe), + ((DETECTOR_ID, 9), (STRING, 9)), +) + +DELETE_PUBLISHING_DESTINATION_OUTPUT: StaticSchema = ( + 18, + n0, + _DPDO, + {_sSI: _cDPDRo, _smi: None}, +) + +DELETE_PUBLISHING_DESTINATION: StaticOperationSchema = ( + 23, + n0, + _DPD, + { + _smith: MappingProxyType( + { + "method": "DELETE", + "uri": "/detector/{DetectorId}/publishingDestination/{DestinationId}", + "code": 200, + } + ) + }, + DELETE_PUBLISHING_DESTINATION_INPUT, + DELETE_PUBLISHING_DESTINATION_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +DELETE_THREAT_ENTITY_SET_INPUT: StaticSchema = ( + 18, + n0, + _DTESI, + {_sSI: _cDTESR, _s: None}, + (_DI, _TESI), + ((DETECTOR_ID, 9), (STRING, 9)), +) + +DELETE_THREAT_ENTITY_SET_OUTPUT: StaticSchema = ( + 18, + n0, + _DTESO, + {_sSI: _cDTESRo, _smi: None}, +) + +DELETE_THREAT_ENTITY_SET: StaticOperationSchema = ( + 23, + n0, + _DTES, + { + _smith: MappingProxyType( + { + "method": "DELETE", + "uri": "/detector/{DetectorId}/threatentityset/{ThreatEntitySetId}", + "code": 200, + } + ) + }, + DELETE_THREAT_ENTITY_SET_INPUT, + DELETE_THREAT_ENTITY_SET_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +DELETE_THREAT_INTEL_SET_INPUT: StaticSchema = ( + 18, + n0, + _DTISI, + {_sSI: _cDTISR, _s: None}, + (_DI, _TISI), + ((DETECTOR_ID, 9), (STRING, 9)), +) + +DELETE_THREAT_INTEL_SET_OUTPUT: StaticSchema = ( + 18, + n0, + _DTISO, + {_sSI: _cDTISRo, _smi: None}, +) + +DELETE_THREAT_INTEL_SET: StaticOperationSchema = ( + 23, + n0, + _DTIS, + { + _smith: MappingProxyType( + { + "method": "DELETE", + "uri": "/detector/{DetectorId}/threatintelset/{ThreatIntelSetId}", + "code": 200, + } + ) + }, + DELETE_THREAT_INTEL_SET_INPUT, + DELETE_THREAT_INTEL_SET_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +DELETE_TRUSTED_ENTITY_SET_INPUT: StaticSchema = ( + 18, + n0, + _DTESIe, + {_sSI: _cDTESRom, _s: None}, + (_DI, _TESIr), + ((DETECTOR_ID, 9), (STRING, 9)), +) + +DELETE_TRUSTED_ENTITY_SET_OUTPUT: StaticSchema = ( + 18, + n0, + _DTESOe, + {_sSI: _cDTESRoma, _smi: None}, +) + +DELETE_TRUSTED_ENTITY_SET: StaticOperationSchema = ( + 23, + n0, + _DTESe, + { + _smith: MappingProxyType( + { + "method": "DELETE", + "uri": "/detector/{DetectorId}/trustedentityset/{TrustedEntitySetId}", + "code": 200, + } + ) + }, + DELETE_TRUSTED_ENTITY_SET_INPUT, + DELETE_TRUSTED_ENTITY_SET_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +LONG_VALUE: StaticSchema = (8, n0, _LV, 0) + +FILTER_CONDITION: StaticSchema = ( + 18, + n0, + _FC, + 0, + (_EVq, _GT, _LT), + ( + (NON_EMPTY_STRING, {_sN: _eVq}), + (LONG_VALUE, {_sN: _gT}), + (LONG_VALUE, {_sN: _lT}), + ), ) -COVERAGE_FILTER_CRITERION_LIST = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CoverageFilterCriterionList"), - shape_type=ShapeType.LIST, - members={"member": {"target": COVERAGE_FILTER_CRITERION}}, +FILTER_CRITERION: StaticSchema = ( + 18, + n0, + _FCi, + 0, + (_CK, _FC), + ((CRITERION_KEY, {_sN: _cK}), (FILTER_CONDITION, {_sN: _fC})), +) + +FILTER_CRITERION_LIST: StaticSchema = ( + 16, + n0, + _FCL, + 0, + (_me,), + ((FILTER_CRITERION, 0),), +) + +FILTER_CRITERIA: StaticSchema = ( + 18, + n0, + _FCil, + 0, + (_FCi,), + ((FILTER_CRITERION_LIST, {_sN: _fCi}),), +) + +INTEGER_VALUE_WITH_MAX: StaticSchema = (7, n0, _IVWM, 0) + +SORT_CRITERIA: StaticSchema = ( + 18, + n0, + _SCo, + 0, + (_AN, _OB), + ((STRING, {_sN: _aN}), (ORDER_BY, {_sN: _oB})), +) + +DESCRIBE_MALWARE_SCANS_INPUT: StaticSchema = ( + 18, + n0, + _DMSI, + {_sSI: _cDMSR, _s: None}, + (_DI, _NT, _MR, _FCil, _SCo), + ( + (DETECTOR_ID, 9), + (STRING, {_sN: _nT}), + (INTEGER_VALUE_WITH_MAX, {_sN: _mR}), + (FILTER_CRITERIA, {_sN: _fCil}), + (SORT_CRITERIA, {_sN: _sCo}), + ), ) -COVERAGE_FILTER_CRITERIA = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CoverageFilterCriteria"), - members={ - "FilterCriterion": { - "target": COVERAGE_FILTER_CRITERION_LIST, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="filterCriterion") - ], - } - }, +VOLUME_DETAIL: StaticSchema = ( + 18, + n0, + _VD, + 0, + (_VA, _VT, _DN, _VSIGB, _ETn, _SA, _KKA), + ( + (STRING, {_sN: _vA}), + (STRING, {_sN: _vT}), + (STRING, {_sN: _dN}), + (INTEGER, {_sN: _vSIGB}), + (STRING, {_sN: _eTn}), + (STRING, {_sN: _sA}), + (STRING, {_sN: _kKA}), + ), ) -COVERAGE_RESOURCE_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CoverageResourceDetails"), - members={ - "EksClusterDetails": { - "target": COVERAGE_EKS_CLUSTER_DETAILS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="eksClusterDetails") - ], - }, - "EcsClusterDetails": { - "target": COVERAGE_ECS_CLUSTER_DETAILS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="ecsClusterDetails") - ], - }, - "Ec2InstanceDetails": { - "target": COVERAGE_EC2_INSTANCE_DETAILS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="ec2InstanceDetails") - ], - }, - "ResourceType": { - "target": RESOURCE_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="resourceType") - ], - }, - }, -) +VOLUME_DETAILS: StaticSchema = (16, n0, _VDo, 0, (_me,), ((VOLUME_DETAIL, 0),)) -COVERAGE_RESOURCE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CoverageResource"), - members={ - "ResourceId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="resourceId") - ], - }, - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="detectorId") - ], - }, - "AccountId": { - "target": ACCOUNT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="accountId")], - }, - "ResourceDetails": { - "target": COVERAGE_RESOURCE_DETAILS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="resourceDetails") - ], - }, - "CoverageStatus": { - "target": COVERAGE_STATUS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="coverageStatus") - ], - }, - "Issue": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="issue")], - }, - "UpdatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="updatedAt")], - }, - }, -) +POSITIVE_LONG: StaticSchema = (8, n0, _PL, 0) -COVERAGE_RESOURCES = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CoverageResources"), - shape_type=ShapeType.LIST, - members={"member": {"target": COVERAGE_RESOURCE}}, -) - -COVERAGE_SORT_KEY = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CoverageSortKey"), - shape_type=ShapeType.ENUM, - members={ - "ACCOUNT_ID": {"target": UNIT}, - "COVERAGE_STATUS": {"target": UNIT}, - "ISSUE": {"target": UNIT}, - "ADDON_VERSION": {"target": UNIT}, - "UPDATED_AT": {"target": UNIT}, - "CLUSTER_NAME": {"target": UNIT}, - "EKS_CLUSTER_NAME": {"target": UNIT}, - "ECS_CLUSTER_NAME": {"target": UNIT}, - "INSTANCE_ID": {"target": UNIT}, - }, -) +INSTANCE_ARN: StaticSchema = (3, n0, _IAn, 0) -ORDER_BY = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#OrderBy"), - shape_type=ShapeType.ENUM, - members={"ASC": {"target": UNIT}, "DESC": {"target": UNIT}}, -) - -COVERAGE_SORT_CRITERIA = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CoverageSortCriteria"), - members={ - "AttributeName": { - "target": COVERAGE_SORT_KEY, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="attributeName") - ], - }, - "OrderBy": { - "target": ORDER_BY, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="orderBy")], - }, - }, +RESOURCE_DETAILS: StaticSchema = ( + 18, + n0, + _RD, + 0, + (_IAn,), + ((INSTANCE_ARN, {_sN: _iAn}),), ) -COVERAGE_STATISTICS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CoverageStatistics"), - members={ - "CountByResourceType": { - "target": COUNT_BY_RESOURCE_TYPE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="countByResourceType" - ) - ], - }, - "CountByCoverageStatus": { - "target": COUNT_BY_COVERAGE_STATUS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="countByCoverageStatus" - ) - ], - }, - }, +SCAN_RESULT: StaticSchema = ( + 14, + n0, + _SRc, + 0, + (_CLEAN, _INFECTED), + ((-1, {_sV: _CLEAN}), (-1, {_sV: _INFECTED})), ) -COVERAGE_STATISTICS_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CoverageStatisticsType"), - shape_type=ShapeType.ENUM, - members={ - "COUNT_BY_RESOURCE_TYPE": {"target": UNIT}, - "COUNT_BY_COVERAGE_STATUS": {"target": UNIT}, - }, +SCAN_RESULT_DETAILS: StaticSchema = ( + 18, + n0, + _SRD, + 0, + (_SRc,), + ((SCAN_RESULT, {_sN: _sRc}),), ) -COVERAGE_STATISTICS_TYPE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CoverageStatisticsTypeList"), - shape_type=ShapeType.LIST, - members={"member": {"target": COVERAGE_STATISTICS_TYPE}}, +SCAN_STATUS: StaticSchema = ( + 14, + n0, + _SSc, + 0, + (_RUNNING, _COMPLETED, _FAILED, _SKIPPED), + ( + (-1, {_sV: _RUNNING}), + (-1, {_sV: _COMPLETED}), + (-1, {_sV: _FAILED}), + (-1, {_sV: _SKIPPED}), + ), ) -TAG_KEY = Schema( - id=ShapeID("com.amazonaws.guardduty#TagKey"), shape_type=ShapeType.STRING +SCAN_TYPE: StaticSchema = ( + 14, + n0, + _STc, + 0, + (_GI_, _OD), + ((-1, {_sV: _GI_}), (-1, {_sV: _OD})), +) + +TRIGGER_TYPE: StaticSchema = ( + 14, + n0, + _TT, + 0, + (_BACKUP, _GUARDDUTY), + ((-1, {_sV: _BACKUP}), (-1, {_sV: _GUARDDUTY})), +) + +TRIGGER_DETAILS: StaticSchema = ( + 18, + n0, + _TD, + 0, + (_GDFI, _De, _TT), + ( + (NON_EMPTY_STRING, {_sN: _gDFI}), + (NON_EMPTY_STRING, {_sN: _de}), + (TRIGGER_TYPE, {_sN: _tT}), + ), ) -TAG_VALUE = Schema( - id=ShapeID("com.amazonaws.guardduty#TagValue"), shape_type=ShapeType.STRING +SCAN: StaticSchema = ( + 18, + n0, + _Sc, + 0, + ( + _DI, + _ADI, + _SIc, + _SSc, + _FRa, + _SSTc, + _SET, + _TD, + _RD, + _SRD, + _AIcc, + _TB, + _FCile, + _AVt, + _STc, + ), + ( + (DETECTOR_ID, {_sN: _dI}), + (DETECTOR_ID, {_sN: _aDI}), + (NON_EMPTY_STRING, {_sN: _sI}), + (SCAN_STATUS, {_sN: _sS}), + (NON_EMPTY_STRING, {_sN: _fR}), + (TIMESTAMP, {_sN: _sST}), + (TIMESTAMP, {_sN: _sET}), + (TRIGGER_DETAILS, {_sN: _tD}), + (RESOURCE_DETAILS, {_sN: _rD}), + (SCAN_RESULT_DETAILS, {_sN: _sRD}), + (ACCOUNT_ID, {_sN: _aIc}), + (POSITIVE_LONG, {_sN: _tB}), + (POSITIVE_LONG, {_sN: _fCile}), + (VOLUME_DETAILS, {_sN: _aVt}), + (SCAN_TYPE, {_sN: _sTc}), + ), ) -TAG_MAP = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#TagMap"), - shape_type=ShapeType.MAP, - members={"key": {"target": TAG_KEY}, "value": {"target": TAG_VALUE}}, +SCANS: StaticSchema = (16, n0, _Sca, 0, (_me,), ((SCAN, 0),)) + +DESCRIBE_MALWARE_SCANS_OUTPUT: StaticSchema = ( + 18, + n0, + _DMSO, + {_sSI: _cDMSRo, _smi: None}, + (_Sca, _NT), + ((SCANS, {_sN: _sc, _sm: None}), (STRING, {_sN: _nT})), +) + +DESCRIBE_MALWARE_SCANS: StaticOperationSchema = ( + 23, + n0, + _DMS, + { + _smith: MappingProxyType( + { + "method": "POST", + "uri": "/detector/{DetectorId}/malware-scans", + "code": 200, + } + ) + }, + DESCRIBE_MALWARE_SCANS_INPUT, + DESCRIBE_MALWARE_SCANS_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +MAX_RESULTS: StaticSchema = (7, n0, _MR, 0) + +DESCRIBE_ORGANIZATION_CONFIGURATION_INPUT: StaticSchema = ( + 18, + n0, + _DOCI, + {_sSI: _cDOCR, _s: None}, + (_DI, _MR, _NT), + ((DETECTOR_ID, 9), (MAX_RESULTS, {_sQ: _mR}), (STRING, {_sQ: _nT})), +) + +ORGANIZATION_KUBERNETES_AUDIT_LOGS_CONFIGURATION_RESULT: StaticSchema = ( + 18, + n0, + _OKALCR, + 0, + (_AE,), + ((BOOLEAN, {_sN: _aE, _sm: None}),), +) + +ORGANIZATION_KUBERNETES_CONFIGURATION_RESULT: StaticSchema = ( + 18, + n0, + _OKCR, + 0, + (_AL,), + ((ORGANIZATION_KUBERNETES_AUDIT_LOGS_CONFIGURATION_RESULT, {_sN: _aL, _sm: None}),), +) + +ORGANIZATION_EBS_VOLUMES_RESULT: StaticSchema = ( + 18, + n0, + _OEVR, + 0, + (_AE,), + ((BOOLEAN, {_sN: _aE}),), +) + +ORGANIZATION_SCAN_EC2_INSTANCE_WITH_FINDINGS_RESULT: StaticSchema = ( + 18, + n0, + _OSEIWFR, + 0, + (_EV,), + ((ORGANIZATION_EBS_VOLUMES_RESULT, {_sN: _eV}),), +) + +ORGANIZATION_MALWARE_PROTECTION_CONFIGURATION_RESULT: StaticSchema = ( + 18, + n0, + _OMPCR, + 0, + (_SEIWF,), + ((ORGANIZATION_SCAN_EC2_INSTANCE_WITH_FINDINGS_RESULT, {_sN: _sEIWF}),), +) + +ORGANIZATION_S3_LOGS_CONFIGURATION_RESULT: StaticSchema = ( + 18, + n0, + _OSLCR, + 0, + (_AE,), + ((BOOLEAN, {_sN: _aE, _sm: None}),), +) + +ORGANIZATION_DATA_SOURCE_CONFIGURATIONS_RESULT: StaticSchema = ( + 18, + n0, + _ODSCR, + 0, + (_SL, _K, _MP), + ( + (ORGANIZATION_S3_LOGS_CONFIGURATION_RESULT, {_sN: _sLo, _sm: None}), + (ORGANIZATION_KUBERNETES_CONFIGURATION_RESULT, {_sN: _k}), + (ORGANIZATION_MALWARE_PROTECTION_CONFIGURATION_RESULT, {_sN: _mP}), + ), ) -CREATE_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CreateCustomDetectionRuleAssociationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#CreateCustomDetectionRuleAssociationRequest", - ) - ], - members={ - "RuleId": { - "target": RULE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="ruleId"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Mode": { - "target": ASSOCIATION_MODE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="mode"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "ClientToken": { - "target": CLIENT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#idempotencyToken")), - Trait.new(id=ShapeID("smithy.api#jsonName"), value="clientToken"), - ], - }, - "Tags": { - "target": TAG_MAP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="tags")], - }, - }, +ORG_FEATURE_STATUS: StaticSchema = ( + 14, + n0, + _OFS, + 0, + (_NEW, _NONE, _ALL), + ((-1, {_sV: _NEW}), (-1, {_sV: _NONE}), (-1, {_sV: _ALL})), +) + +ORG_FEATURE_ADDITIONAL_CONFIGURATION: StaticSchema = ( + 14, + n0, + _OFAC, + 0, + (_EAM, _EFAM, _EAM_), + ((-1, {_sV: _EAM}), (-1, {_sV: _EFAM}), (-1, {_sV: _EAM_})), +) + +ORGANIZATION_ADDITIONAL_CONFIGURATION_RESULT: StaticSchema = ( + 18, + n0, + _OACR, + 0, + (_N, _AE), + ( + (ORG_FEATURE_ADDITIONAL_CONFIGURATION, {_sN: _n}), + (ORG_FEATURE_STATUS, {_sN: _aE}), + ), ) -CREATE_CUSTOM_DETECTION_RULE_ASSOCIATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CreateCustomDetectionRuleAssociationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#CreateCustomDetectionRuleAssociationResponse", - ) - ], - members={ - "RuleAssociation": { - "target": ASSOCIATION_DETAIL, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="ruleAssociation"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, +ORGANIZATION_ADDITIONAL_CONFIGURATION_RESULTS: StaticSchema = ( + 16, + n0, + _OACRr, + 0, + (_me,), + ((ORGANIZATION_ADDITIONAL_CONFIGURATION_RESULT, 0),), +) + +ORG_FEATURE: StaticSchema = ( + 14, + n0, + _OF, + 0, + (_SDE, _EAL, _EMP, _RLE, _LNL, _ERM, _RM, _AP), + ( + (-1, {_sV: _SDE}), + (-1, {_sV: _EAL}), + (-1, {_sV: _EMP}), + (-1, {_sV: _RLE}), + (-1, {_sV: _LNL}), + (-1, {_sV: _ERM}), + (-1, {_sV: _RM}), + (-1, {_sV: _AP}), + ), ) -RESOURCE_NOT_FOUND_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ResourceNotFoundException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=404), - ], - members={ - "Message": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="message")], - }, - "Type": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="type")], - }, - }, +ORGANIZATION_FEATURE_CONFIGURATION_RESULT: StaticSchema = ( + 18, + n0, + _OFCR, + 0, + (_N, _AE, _ACd), + ( + (ORG_FEATURE, {_sN: _n}), + (ORG_FEATURE_STATUS, {_sN: _aE}), + (ORGANIZATION_ADDITIONAL_CONFIGURATION_RESULTS, {_sN: _aC}), + ), ) -CREATE_CUSTOM_DETECTION_RULE_ASSOCIATION = Schema( - id=ShapeID("com.amazonaws.guardduty#CreateCustomDetectionRuleAssociation"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/custom-detection-rule/association", - "code": 200, - } - ), - ) - ], +ORGANIZATION_FEATURES_CONFIGURATIONS_RESULTS: StaticSchema = ( + 16, + n0, + _OFCRr, + 0, + (_me,), + ((ORGANIZATION_FEATURE_CONFIGURATION_RESULT, 0),), +) + +DESCRIBE_ORGANIZATION_CONFIGURATION_OUTPUT: StaticSchema = ( + 18, + n0, + _DOCO, + {_sSI: _cDOCRo, _smi: None}, + (_AE, _MALR, _DS, _F, _NT, _AEOM), + ( + (BOOLEAN, {_sN: _aE}), + (BOOLEAN, {_sN: _mALR, _sm: None}), + (ORGANIZATION_DATA_SOURCE_CONFIGURATIONS_RESULT, {_sN: _dS}), + (ORGANIZATION_FEATURES_CONFIGURATIONS_RESULTS, {_sN: _f}), + (STRING, {_sN: _nT}), + (AUTO_ENABLE_MEMBERS, {_sN: _aEOM}), + ), ) -DETECTION_RULE_ACCOUNT_IDS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DetectionRuleAccountIds"), - shape_type=ShapeType.LIST, - members={"member": {"target": ACCOUNT_ID}}, +DESCRIBE_ORGANIZATION_CONFIGURATION: StaticOperationSchema = ( + 23, + n0, + _DOC, + { + _smith: MappingProxyType( + {"method": "GET", "uri": "/detector/{DetectorId}/admin", "code": 200} + ) + }, + DESCRIBE_ORGANIZATION_CONFIGURATION_INPUT, + DESCRIBE_ORGANIZATION_CONFIGURATION_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +DESCRIBE_PUBLISHING_DESTINATION_INPUT: StaticSchema = ( + 18, + n0, + _DPDIe, + {_sSI: _cDPDRom, _s: None}, + (_DI, _DIe), + ((DETECTOR_ID, 9), (STRING, 9)), +) + +PUBLISHING_STATUS: StaticSchema = ( + 14, + n0, + _PSu, + 0, + (_PV, _PUBLISHING, _UTPFDP, _STOPPED), + ( + (-1, {_sV: _PV}), + (-1, {_sV: _PUBLISHING}), + (-1, {_sV: _UTPFDP}), + (-1, {_sV: _STOPPED}), + ), ) -CREATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.guardduty#CreateCustomDetectionRuleOrgConfigurationInput" +DESCRIBE_PUBLISHING_DESTINATION_OUTPUT: StaticSchema = ( + 18, + n0, + _DPDOe, + {_sSI: _cDPDRoma, _smi: None}, + (_DIe, _DT, _St, _PFST, _DP, _Ta), + ( + (STRING, {_sN: _dIe, _sm: None}), + (DESTINATION_TYPE, {_sN: _dT, _sm: None}), + (PUBLISHING_STATUS, {_sN: _st, _sm: None}), + (LONG, {_sN: _pFST, _sm: None}), + (DESTINATION_PROPERTIES, {_sN: _dP, _sm: None}), + (TAG_MAP, {_sN: _ta}), ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#CreateCustomDetectionRuleOrgConfigurationRequest", - ) - ], - members={ - "RuleId": { - "target": RULE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="ruleId"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Mode": { - "target": ASSOCIATION_MODE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="mode"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "IncludeAccountIds": { - "target": DETECTION_RULE_ACCOUNT_IDS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="includeAccountIds") - ], - }, - "ExcludeAccountIds": { - "target": DETECTION_RULE_ACCOUNT_IDS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="excludeAccountIds") - ], - }, - "ClientToken": { - "target": CLIENT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#idempotencyToken")), - Trait.new(id=ShapeID("smithy.api#jsonName"), value="clientToken"), - ], - }, - }, ) -CREATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.guardduty#CreateCustomDetectionRuleOrgConfigurationOutput" +DESCRIBE_PUBLISHING_DESTINATION: StaticOperationSchema = ( + 23, + n0, + _DPDe, + { + _smith: MappingProxyType( + { + "method": "GET", + "uri": "/detector/{DetectorId}/publishingDestination/{DestinationId}", + "code": 200, + } + ) + }, + DESCRIBE_PUBLISHING_DESTINATION_INPUT, + DESCRIBE_PUBLISHING_DESTINATION_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +DESTINATION: StaticSchema = ( + 18, + n0, + _Des, + 0, + (_DIe, _DT, _St), + ( + (STRING, {_sN: _dIe, _sm: None}), + (DESTINATION_TYPE, {_sN: _dT, _sm: None}), + (PUBLISHING_STATUS, {_sN: _st, _sm: None}), ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#CreateCustomDetectionRuleOrgConfigurationResponse", - ) - ], -) - -CREATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION = Schema( - id=ShapeID("com.amazonaws.guardduty#CreateCustomDetectionRuleOrgConfiguration"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/custom-detection-rule/org-configuration", - "code": 200, - } - ), - ) - ], -) - -KUBERNETES_AUDIT_LOGS_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#KubernetesAuditLogsConfiguration"), - members={ - "Enable": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="enable"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, ) -KUBERNETES_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#KubernetesConfiguration"), - members={ - "AuditLogs": { - "target": KUBERNETES_AUDIT_LOGS_CONFIGURATION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="auditLogs"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, -) +DESTINATIONS: StaticSchema = (16, n0, _Dest, 0, (_me,), ((DESTINATION, 0),)) -SCAN_EC2_INSTANCE_WITH_FINDINGS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ScanEc2InstanceWithFindings"), - members={ - "EbsVolumes": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="ebsVolumes") - ], - } - }, +SEQUENCE_DESCRIPTION: StaticSchema = (3, n0, _SD, 0) + +NETWORK_DIRECTION: StaticSchema = ( + 14, + n0, + _ND, + 0, + (_INBOUND, _OUTBOUND), + ((-1, {_sV: _INBOUND}), (-1, {_sV: _OUTBOUND})), ) -MALWARE_PROTECTION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#MalwareProtectionConfiguration"), - members={ - "ScanEc2InstanceWithFindings": { - "target": SCAN_EC2_INSTANCE_WITH_FINDINGS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), - value="scanEc2InstanceWithFindings", - ) - ], - } - }, +NETWORK_CONNECTION: StaticSchema = ( + 18, + n0, + _NC, + 0, + (_Di,), + ((NETWORK_DIRECTION, {_sN: _di, _sm: None}),), ) -S3_LOGS_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#S3LogsConfiguration"), - members={ - "Enable": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="enable"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, +NETWORK_GEO_LOCATION: StaticSchema = ( + 18, + n0, + _NGL, + 0, + (_C, _Co, _La, _Long), + ( + (STRING, {_sN: _ci, _sm: None}), + (STRING, {_sN: _co, _sm: None}), + (DOUBLE, {_sN: _l, _sm: None}), + (DOUBLE, {_sN: _lo, _sm: None}), + ), ) -DATA_SOURCE_CONFIGURATIONS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DataSourceConfigurations"), - members={ - "S3Logs": { - "target": S3_LOGS_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="s3Logs")], - }, - "Kubernetes": { - "target": KUBERNETES_CONFIGURATION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="kubernetes") - ], - }, - "MalwareProtection": { - "target": MALWARE_PROTECTION_CONFIGURATION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="malwareProtection") - ], - }, - }, +NETWORK_ENDPOINT: StaticSchema = ( + 18, + n0, + _NEe, + 0, + (_Id, _Ip, _D, _Po, _Loc, _ASu, _Conn), + ( + (STRING, {_sN: _id, _sm: None}), + (STRING, {_sN: _ip}), + (STRING, {_sN: _d}), + (INTEGER, {_sN: _po}), + (NETWORK_GEO_LOCATION, {_sN: _loc}), + (AUTONOMOUS_SYSTEM, {_sN: _aSu}), + (NETWORK_CONNECTION, {_sN: _conn}), + ), ) -FEATURE_ADDITIONAL_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#FeatureAdditionalConfiguration"), - shape_type=ShapeType.ENUM, - members={ - "EKS_ADDON_MANAGEMENT": {"target": UNIT}, - "ECS_FARGATE_AGENT_MANAGEMENT": {"target": UNIT}, - "EC2_AGENT_MANAGEMENT": {"target": UNIT}, - }, +NETWORK_ENDPOINTS: StaticSchema = (16, n0, _NEet, 0, (_me,), ((NETWORK_ENDPOINT, 0),)) + +EC2_IMAGE: StaticSchema = ( + 18, + n0, + _EI, + 0, + (_EIUc,), + ((EC2_INSTANCE_UIDS, {_sN: _eIU}),), +) + +EC2_NETWORK_INTERFACE_UIDS: StaticSchema = (16, n0, _ENIU, 0, (_me,), ((STRING, 0),)) + +IAM_INSTANCE_PROFILE: StaticSchema = ( + 18, + n0, + _IIP, + 0, + (_Ar, _Id), + ((STRING, {_sN: _ar}), (STRING, {_sN: _id})), +) + +PRODUCT_CODE: StaticSchema = ( + 18, + n0, + _PC, + 0, + (_Cod, _PTr), + ((STRING, {_sN: _pCI}), (STRING, {_sN: _pCT})), +) + +PRODUCT_CODES: StaticSchema = (16, n0, _PCr, 0, (_me,), ((PRODUCT_CODE, 0),)) + +EC2_INSTANCE: StaticSchema = ( + 18, + n0, + _EIc, + 0, + (_AZ, _ID, _IS, _IIP, _IT, _OA, _Pl, _PCr, _ENIU), + ( + (STRING, {_sN: _aZ}), + (STRING, {_sN: _iD}), + (STRING, {_sN: _iS}), + (IAM_INSTANCE_PROFILE, 0), + (STRING, {_sN: _iT}), + (STRING, {_sN: _oA}), + (STRING, {_sN: _pl}), + (PRODUCT_CODES, {_sN: _pC}), + (EC2_NETWORK_INTERFACE_UIDS, {_sN: _eNIU}), + ), ) -FEATURE_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#FeatureStatus"), - shape_type=ShapeType.ENUM, - members={"ENABLED": {"target": UNIT}, "DISABLED": {"target": UNIT}}, +LAUNCH_TEMPLATE_VERSION: StaticSchema = (3, n0, _LTV, 0) + +EC2_LAUNCH_TEMPLATE: StaticSchema = ( + 18, + n0, + _ELT, + 0, + (_EIUc, _Ve), + ((EC2_INSTANCE_UIDS, {_sN: _eIU}), (LAUNCH_TEMPLATE_VERSION, {_sN: _ver})), +) + +IPV6_ADDRESSES: StaticSchema = (16, n0, _IAp, 0, (_me,), ((STRING, 0),)) + +PRIVATE_IP_ADDRESS_DETAILS: StaticSchema = ( + 18, + n0, + _PIAD, + 0, + (_PDN, _PIA), + ((STRING, {_sN: _pDN}), (SENSITIVE_STRING, {_sN: _pIA})), +) + +PRIVATE_IP_ADDRESSES: StaticSchema = ( + 16, + n0, + _PIAr, + 0, + (_me,), + ((PRIVATE_IP_ADDRESS_DETAILS, 0),), +) + +SECURITY_GROUP: StaticSchema = ( + 18, + n0, + _SG, + 0, + (_GIr, _GN), + ((STRING, {_sN: _gI}), (STRING, {_sN: _gN})), +) + +SECURITY_GROUPS: StaticSchema = (16, n0, _SGe, 0, (_me,), ((SECURITY_GROUP, 0),)) + +EC2_NETWORK_INTERFACE: StaticSchema = ( + 18, + n0, + _ENI, + 0, + (_IAp, _PIAr, _PIu, _SGe, _SNI, _VIp), + ( + (IPV6_ADDRESSES, {_sN: _iAp}), + (PRIVATE_IP_ADDRESSES, {_sN: _pIAr}), + (STRING, {_sN: _pIu}), + (SECURITY_GROUPS, {_sN: _sG}), + (STRING, {_sN: _sNI}), + (STRING, {_sN: _vIp}), + ), ) -DETECTOR_ADDITIONAL_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DetectorAdditionalConfiguration"), - members={ - "Name": { - "target": FEATURE_ADDITIONAL_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="name")], - }, - "Status": { - "target": FEATURE_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="status")], - }, - }, +EC2_VPC: StaticSchema = (18, n0, _EVc, 0, (_EIUc,), ((EC2_INSTANCE_UIDS, {_sN: _eIU}),)) + +ECS_CLUSTER_STATUS: StaticSchema = ( + 14, + n0, + _ECSc, + 0, + (_ACTIVE, _PROVISIONING, _DEPROVISIONING, _FAILED, _INACTIVE), + ( + (-1, {_sV: _ACTIVE}), + (-1, {_sV: _PROVISIONING}), + (-1, {_sV: _DEPROVISIONING}), + (-1, {_sV: _FAILED}), + (-1, {_sV: _INACTIVE}), + ), ) -DETECTOR_ADDITIONAL_CONFIGURATIONS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DetectorAdditionalConfigurations"), - shape_type=ShapeType.LIST, - members={"member": {"target": DETECTOR_ADDITIONAL_CONFIGURATION}}, -) - -DETECTOR_FEATURE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DetectorFeature"), - shape_type=ShapeType.ENUM, - members={ - "S3_DATA_EVENTS": {"target": UNIT}, - "EKS_AUDIT_LOGS": {"target": UNIT}, - "EBS_MALWARE_PROTECTION": {"target": UNIT}, - "RDS_LOGIN_EVENTS": {"target": UNIT}, - "LAMBDA_NETWORK_LOGS": {"target": UNIT}, - "EKS_RUNTIME_MONITORING": {"target": UNIT}, - "RUNTIME_MONITORING": {"target": UNIT}, - "AI_PROTECTION": {"target": UNIT}, - "AI_ANALYST": {"target": UNIT}, - }, +ECS_CLUSTER: StaticSchema = ( + 18, + n0, + _ECc, + 0, + (_St, _EIUc), + ((ECS_CLUSTER_STATUS, {_sN: _st}), (EC2_INSTANCE_UIDS, {_sN: _eIU})), +) + +ECS_LAUNCH_TYPE: StaticSchema = ( + 14, + n0, + _ELTc, + 0, + (_FARGATE, _EC_), + ((-1, {_sV: _FARGATE}), (-1, {_sV: _EC_})), +) + +ECS_TASK: StaticSchema = ( + 18, + n0, + _ETc, + 0, + (_CA, _TDA, _LTa, _CUon), + ( + (TIMESTAMP, {_sN: _cA}), + (STRING, {_sN: _tDA}), + (ECS_LAUNCH_TYPE, {_sN: _lTa}), + (CONTAINER_UIDS, {_sN: _cUo}), + ), ) -DETECTOR_FEATURE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DetectorFeatureConfiguration"), - members={ - "Name": { - "target": DETECTOR_FEATURE, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="name")], - }, - "Status": { - "target": FEATURE_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="status")], - }, - "AdditionalConfiguration": { - "target": DETECTOR_ADDITIONAL_CONFIGURATIONS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="additionalConfiguration" - ) - ], - }, - }, +EKS_CLUSTER: StaticSchema = ( + 18, + n0, + _ECk, + 0, + (_Ar, _CA, _St, _VIp, _EIUc), + ( + (STRING, {_sN: _ar}), + (TIMESTAMP, {_sN: _cA}), + (CLUSTER_STATUS, {_sN: _st}), + (STRING, {_sN: _vIp}), + (EC2_INSTANCE_UIDS, {_sN: _eIU}), + ), ) -DETECTOR_FEATURE_CONFIGURATIONS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DetectorFeatureConfigurations"), - shape_type=ShapeType.LIST, - members={"member": {"target": DETECTOR_FEATURE_CONFIGURATION}}, +IAM_INSTANCE_PROFILE_V2: StaticSchema = ( + 18, + n0, + _IIPV, + 0, + (_EIUc,), + ((EC2_INSTANCE_UIDS, {_sN: _eIU}),), +) + +KUBERNETES_RESOURCES_TYPES: StaticSchema = ( + 14, + n0, + _KRT, + 0, + ( + _PODS, + _JOBS, + _CRONJOBS, + _DEPLOYMENTS, + _DAEMONSETS, + _STATEFULSETS, + _REPLICASETS, + _REPLICATIONCONTROLLERS, + ), + ( + (-1, {_sV: _PODS}), + (-1, {_sV: _JOBS}), + (-1, {_sV: _CRONJOBS}), + (-1, {_sV: _DEPLOYMENTS}), + (-1, {_sV: _DAEMONSETS}), + (-1, {_sV: _STATEFULSETS}), + (-1, {_sV: _REPLICASETS}), + (-1, {_sV: _REPLICATIONCONTROLLERS}), + ), ) -FINDING_PUBLISHING_FREQUENCY = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#FindingPublishingFrequency"), - shape_type=ShapeType.ENUM, - members={ - "FIFTEEN_MINUTES": {"target": UNIT}, - "ONE_HOUR": {"target": UNIT}, - "SIX_HOURS": {"target": UNIT}, - }, +KUBERNETES_WORKLOAD: StaticSchema = ( + 18, + n0, + _KW, + 0, + (_CUon, _Na, _KRT), + ( + (CONTAINER_UIDS, {_sN: _cUo}), + (STRING, {_sN: _na}), + (KUBERNETES_RESOURCES_TYPES, {_sN: _t}), + ), ) -CREATE_DETECTOR_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CreateDetectorInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#CreateDetectorRequest", - ) - ], - members={ - "Enable": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="enable"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "ClientToken": { - "target": CLIENT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#idempotencyToken")), - Trait.new(id=ShapeID("smithy.api#jsonName"), value="clientToken"), - ], - }, - "FindingPublishingFrequency": { - "target": FINDING_PUBLISHING_FREQUENCY, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), - value="findingPublishingFrequency", - ) - ], - }, - "DataSources": { - "target": DATA_SOURCE_CONFIGURATIONS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="dataSources") - ], - }, - "Tags": { - "target": TAG_MAP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="tags")], - }, - "Features": { - "target": DETECTOR_FEATURE_CONFIGURATIONS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="features")], - }, - }, +PUBLIC_ACCESS_STATUS: StaticSchema = ( + 14, + n0, + _PAS, + 0, + (_BLOCKED, _ALLOWED), + ((-1, {_sV: _BLOCKED}), (-1, {_sV: _ALLOWED})), +) + +PUBLIC_ACL_IGNORE_BEHAVIOR: StaticSchema = ( + 14, + n0, + _PAIB, + 0, + (_IGNORED, _NI), + ((-1, {_sV: _IGNORED}), (-1, {_sV: _NI})), +) + +PUBLIC_BUCKET_RESTRICT_BEHAVIOR: StaticSchema = ( + 14, + n0, + _PBRB, + 0, + (_RESTRICTED, _NR), + ((-1, {_sV: _RESTRICTED}), (-1, {_sV: _NR})), +) + +PUBLIC_ACCESS_CONFIGURATION: StaticSchema = ( + 18, + n0, + _PAC, + 0, + (_PAA, _PPAu, _PAIB, _PBRB), + ( + (PUBLIC_ACCESS_STATUS, {_sN: _pAA}), + (PUBLIC_ACCESS_STATUS, {_sN: _pPAu}), + (PUBLIC_ACL_IGNORE_BEHAVIOR, {_sN: _pAIB}), + (PUBLIC_BUCKET_RESTRICT_BEHAVIOR, {_sN: _pBRB}), + ), ) -EBS_VOLUMES_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#EbsVolumesResult"), - members={ - "Status": { - "target": DATA_SOURCE_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="status")], - }, - "Reason": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="reason")], - }, - }, +S3_OBJECT_UIDS: StaticSchema = (16, n0, _SOU, 0, (_me,), ((STRING, 0),)) + +S3_BUCKET: StaticSchema = ( + 18, + n0, + _SB, + 0, + (_OI, _CA, _ETn, _EKA, _EP, _PRA, _PWA, _APA, _BPAu, _SOU), + ( + (STRING, {_sN: _oI}), + (TIMESTAMP, {_sN: _cA}), + (STRING, {_sN: _eTn}), + (STRING, {_sN: _eKA}), + (STRING, {_sN: _eP}), + (PUBLIC_ACCESS_STATUS, {_sN: _pRA}), + (PUBLIC_ACCESS_STATUS, {_sN: _pWA}), + (PUBLIC_ACCESS_CONFIGURATION, {_sN: _aPA}), + (PUBLIC_ACCESS_CONFIGURATION, {_sN: _bPAu}), + (S3_OBJECT_UIDS, {_sN: _sOU}), + ), ) -SCAN_EC2_INSTANCE_WITH_FINDINGS_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ScanEc2InstanceWithFindingsResult"), - members={ - "EbsVolumes": { - "target": EBS_VOLUMES_RESULT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="ebsVolumes") - ], - } - }, +S3_OBJECT: StaticSchema = ( + 18, + n0, + _SO, + 0, + (_ETa, _Ke, _VI), + ((STRING, {_sN: _eTa}), (STRING, {_sN: _ke}), (STRING, {_sN: _vI})), +) + +RESOURCE_DATA: StaticSchema = ( + 18, + n0, + _RDe, + 0, + ( + _SB, + _EIc, + _AK, + _ENI, + _SO, + _ECk, + _KW, + _Cont, + _ECc, + _ETc, + _IIP, + _AASG, + _ELT, + _EVc, + _EI, + _CS, + _BG, + ), + ( + (S3_BUCKET, {_sN: _sB}), + (EC2_INSTANCE, {_sN: _eI}), + (ACCESS_KEY, {_sN: _aK}), + (EC2_NETWORK_INTERFACE, {_sN: _eNI}), + (S3_OBJECT, {_sN: _sO}), + (EKS_CLUSTER, {_sN: _eCk}), + (KUBERNETES_WORKLOAD, {_sN: _kW}), + (CONTAINER_FINDING_RESOURCE, {_sN: _cont}), + (ECS_CLUSTER, {_sN: _eCc}), + (ECS_TASK, {_sN: _eTc}), + (IAM_INSTANCE_PROFILE_V2, {_sN: _iIP}), + (AUTOSCALING_AUTO_SCALING_GROUP, {_sN: _aASG}), + (EC2_LAUNCH_TEMPLATE, {_sN: _eLT}), + (EC2_VPC, {_sN: _eVc}), + (EC2_IMAGE, {_sN: _eIc}), + (CLOUDFORMATION_STACK, {_sN: _cSl}), + (BEDROCK_GUARDRAIL_RESOURCE, {_sN: _bG}), + ), ) -MALWARE_PROTECTION_CONFIGURATION_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#MalwareProtectionConfigurationResult"), - members={ - "ScanEc2InstanceWithFindings": { - "target": SCAN_EC2_INSTANCE_WITH_FINDINGS_RESULT, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), - value="scanEc2InstanceWithFindings", - ) - ], - }, - "ServiceRole": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="serviceRole") - ], - }, - }, +FINDING_RESOURCE_TYPE: StaticSchema = ( + 14, + n0, + _FRT, + 0, + ( + _EI_, + _ENI_, + _SB_, + _SO_, + _AK_, + _EC__, + _KW_, + _CONTAINER, + _EC___, + _ET_, + _AASG_, + _IIP_, + _CS__, + _ELT_, + _EV_, + _EI__, + _BCM, + _BIM, + _BPM, + _BCMD, + _BIP, + _BAIP, + _BP_, + _BPR, + _BG_, + _SE, + ), + ( + (-1, {_sV: _EI_}), + (-1, {_sV: _ENI_}), + (-1, {_sV: _SB_}), + (-1, {_sV: _SO_}), + (-1, {_sV: _AK_}), + (-1, {_sV: _EC__}), + (-1, {_sV: _KW_}), + (-1, {_sV: _CONTAINER}), + (-1, {_sV: _EC___}), + (-1, {_sV: _ET_}), + (-1, {_sV: _AASG_}), + (-1, {_sV: _IIP_}), + (-1, {_sV: _CS__}), + (-1, {_sV: _ELT_}), + (-1, {_sV: _EV_}), + (-1, {_sV: _EI__}), + (-1, {_sV: _BCM}), + (-1, {_sV: _BIM}), + (-1, {_sV: _BPM}), + (-1, {_sV: _BCMD}), + (-1, {_sV: _BIP}), + (-1, {_sV: _BAIP}), + (-1, {_sV: _BP_}), + (-1, {_sV: _BPR}), + (-1, {_sV: _BG_}), + (-1, {_sV: _SE}), + ), ) -UNPROCESSED_DATA_SOURCES_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UnprocessedDataSourcesResult"), - members={ - "MalwareProtection": { - "target": MALWARE_PROTECTION_CONFIGURATION_RESULT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="malwareProtection") - ], - } - }, +TAG: StaticSchema = ( + 18, + n0, + _Tag_, + 0, + (_Ke, _Va), + ((STRING, {_sN: _ke}), (STRING, {_sN: _v})), +) + +TAGS: StaticSchema = (16, n0, _Ta, 0, (_me,), ((TAG, 0),)) + +RESOURCE_V2: StaticSchema = ( + 18, + n0, + _RV, + 0, + (_U, _N, _AIcc, _RT, _Re, _Se, _CPl, _Ta, _Dat), + ( + (STRING, {_sN: _u, _sm: None}), + (STRING, {_sN: _n}), + (STRING, {_sN: _aIc}), + (FINDING_RESOURCE_TYPE, {_sN: _rT, _sm: None}), + (STRING, {_sN: _re}), + (STRING, {_sN: _ser}), + (STRING, {_sN: _cP}), + (TAGS, {_sN: _ta}), + (RESOURCE_DATA, {_sN: _dat}), + ), ) -CREATE_DETECTOR_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CreateDetectorOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#CreateDetectorResponse", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="detectorId") - ], - }, - "UnprocessedDataSources": { - "target": UNPROCESSED_DATA_SOURCES_RESULT, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="unprocessedDataSources" - ) - ], - }, - }, +RESOURCES: StaticSchema = (16, n0, _Reso, 0, (_me,), ((RESOURCE_V2, 0),)) + +INDICATOR_TYPE: StaticSchema = ( + 14, + n0, + _ITn, + 0, + ( + _SUA, + _SN_, + _MI_, + _TI, + _AT_, + _HRA, + _AT__, + _UAFA, + _UAFA_, + _UAFU, + _SP, + _MD, + _MP_, + _CI_, + _CD_, + _CP_, + _MF, + _VULNERABILITY, + _MP__, + _MISCONFIGURATION, + _REACHABILITY, + _SD_, + ), + ( + (-1, {_sV: _SUA}), + (-1, {_sV: _SN_}), + (-1, {_sV: _MI_}), + (-1, {_sV: _TI}), + (-1, {_sV: _AT_}), + (-1, {_sV: _HRA}), + (-1, {_sV: _AT__}), + (-1, {_sV: _UAFA}), + (-1, {_sV: _UAFA_}), + (-1, {_sV: _UAFU}), + (-1, {_sV: _SP}), + (-1, {_sV: _MD}), + (-1, {_sV: _MP_}), + (-1, {_sV: _CI_}), + (-1, {_sV: _CD_}), + (-1, {_sV: _CP_}), + (-1, {_sV: _MF}), + (-1, {_sV: _VULNERABILITY}), + (-1, {_sV: _MP__}), + (-1, {_sV: _MISCONFIGURATION}), + (-1, {_sV: _REACHABILITY}), + (-1, {_sV: _SD_}), + ), ) -CREATE_DETECTOR = Schema( - id=ShapeID("com.amazonaws.guardduty#CreateDetector"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType({"method": "POST", "uri": "/detector", "code": 200}), - ) - ], -) +INDICATOR_TITLE: StaticSchema = (3, n0, _ITnd, 0) -FILTER_ACTION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#FilterAction"), - shape_type=ShapeType.ENUM, - members={"NOOP": {"target": UNIT}, "ARCHIVE": {"target": UNIT}}, -) +INDICATOR_VALUE_STRING: StaticSchema = (3, n0, _IVS, 0) -FILTER_DESCRIPTION = Schema( - id=ShapeID("com.amazonaws.guardduty#FilterDescription"), shape_type=ShapeType.STRING +INDICATOR_VALUES: StaticSchema = ( + 16, + n0, + _IV, + 0, + (_me,), + ((INDICATOR_VALUE_STRING, 0),), ) -CRITERION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Criterion"), - shape_type=ShapeType.MAP, - members={"key": {"target": STRING}, "value": {"target": CONDITION}}, +INDICATOR: StaticSchema = ( + 18, + n0, + _In, + 0, + (_Ke, _Val, _Tit), + ( + (INDICATOR_TYPE, {_sN: _ke, _sm: None}), + (INDICATOR_VALUES, {_sN: _va}), + (INDICATOR_TITLE, {_sN: _ti}), + ), ) -FINDING_CRITERIA = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#FindingCriteria"), - members={ - "Criterion": { - "target": CRITERION, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="criterion")], - } - }, -) +INDICATORS: StaticSchema = (16, n0, _Ind, 0, (_me,), ((INDICATOR, 0),)) -FILTER_NAME = Schema( - id=ShapeID("com.amazonaws.guardduty#FilterName"), shape_type=ShapeType.STRING -) +SIGNAL_DESCRIPTION: StaticSchema = (3, n0, _SDi, 0) -FILTER_RANK = Schema( - id=ShapeID("com.amazonaws.guardduty#FilterRank"), shape_type=ShapeType.INTEGER -) +ENDPOINT_IDS: StaticSchema = (16, n0, _EIn, 0, (_me,), ((STRING, 0),)) -CREATE_FILTER_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CreateFilterInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#CreateFilterRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Name": { - "target": FILTER_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="name"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Description": { - "target": FILTER_DESCRIPTION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="description") - ], - }, - "Action": { - "target": FILTER_ACTION, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="action")], - }, - "Rank": { - "target": FILTER_RANK, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="rank")], - }, - "FindingCriteria": { - "target": FINDING_CRITERIA, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="findingCriteria"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "ClientToken": { - "target": CLIENT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#idempotencyToken")), - Trait.new(id=ShapeID("smithy.api#jsonName"), value="clientToken"), - ], - }, - "Tags": { - "target": TAG_MAP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="tags")], - }, - }, -) +RESOURCE_UIDS: StaticSchema = (16, n0, _RUe, 0, (_me,), ((STRING, 0),)) -CREATE_FILTER_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CreateFilterOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#CreateFilterResponse", - ) - ], - members={ - "Name": { - "target": FILTER_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="name"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, +SIGNAL_TYPE: StaticSchema = ( + 14, + n0, + _STi, + 0, + (_FINDING, _CT_, _SDE, _EAL, _FL_, _DL_, _RM), + ( + (-1, {_sV: _FINDING}), + (-1, {_sV: _CT_}), + (-1, {_sV: _SDE}), + (-1, {_sV: _EAL}), + (-1, {_sV: _FL_}), + (-1, {_sV: _DL_}), + (-1, {_sV: _RM}), + ), ) -CREATE_FILTER = Schema( - id=ShapeID("com.amazonaws.guardduty#CreateFilter"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/detector/{DetectorId}/filter", "code": 200} - ), - ) - ], +SIGNAL: StaticSchema = ( + 18, + n0, + _Si, + 0, + ( + _U, + _T, + _De, + _N, + _CA, + _UAp, + _FSA, + _LSA, + _Sev, + _Cou, + _RUe, + _AIct, + _EIn, + _SIi, + _Acti, + ), + ( + (STRING, {_sN: _u, _sm: None}), + (SIGNAL_TYPE, {_sN: _t, _sm: None}), + (SIGNAL_DESCRIPTION, {_sN: _de}), + (STRING, {_sN: _n, _sm: None}), + (TIMESTAMP, {_sN: _cA, _sm: None}), + (TIMESTAMP, {_sN: _uAp, _sm: None}), + (TIMESTAMP, {_sN: _fSA, _sm: None}), + (TIMESTAMP, {_sN: _lSA, _sm: None}), + (DOUBLE, {_sN: _sev}), + (INTEGER, {_sN: _cou, _sm: None}), + (RESOURCE_UIDS, {_sN: _rUe}), + (ACTOR_IDS, {_sN: _aIct}), + (ENDPOINT_IDS, {_sN: _eIn}), + (INDICATORS, {_sN: _sIi}), + (ACTIVITIES, {_sN: _activ}), + ), ) -TRIGGER_PROMPT = Schema( - id=ShapeID("com.amazonaws.guardduty#TriggerPrompt"), shape_type=ShapeType.STRING +SIGNALS: StaticSchema = (16, n0, _Sig, 0, (_me,), ((SIGNAL, 0),)) + +SEQUENCE: StaticSchema = ( + 18, + n0, + _Seq, + 0, + (_U, _De, _Actor, _Reso, _End, _Sig, _SIe, _AST), + ( + (STRING, {_sN: _u, _sm: None}), + (SEQUENCE_DESCRIPTION, {_sN: _de, _sm: None}), + (ACTORS, {_sN: _acto}), + (RESOURCES, {_sN: _reso}), + (NETWORK_ENDPOINTS, {_sN: _end}), + (SIGNALS, {_sN: _si, _sm: None}), + (INDICATORS, {_sN: _sIe}), + (ADDITIONAL_SEQUENCE_TYPES, {_sN: _aST}), + ), ) -CREATE_INVESTIGATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CreateInvestigationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#CreateInvestigationRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "TriggerPrompt": { - "target": TRIGGER_PROMPT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="triggerPrompt"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "ClientToken": { - "target": CLIENT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#idempotencyToken")), - Trait.new(id=ShapeID("smithy.api#jsonName"), value="clientToken"), - ], - }, - }, +DETECTION: StaticSchema = ( + 18, + n0, + _Det, + 0, + (_An, _Seq), + ((ANOMALY, {_sN: _an}), (SEQUENCE, {_sN: _seq})), +) + +DETECTION_RULE_CONFIGURATION_STATUS: StaticSchema = ( + 14, + n0, + _DRCS, + 0, + (_ACTIVE, _PROCESSING, _FAILED), + ((-1, {_sV: _ACTIVE}), (-1, {_sV: _PROCESSING}), (-1, {_sV: _FAILED})), +) + +DETECTION_RULE_DATA_SOURCE: StaticSchema = ( + 14, + n0, + _DRDS, + 0, + (_CME,), + ((-1, {_sV: _CTME}),), +) + +DETECTION_RULE_DESCRIPTION: StaticSchema = (3, n0, _DRD, 0) + +DETECTION_RULE_FILTER_CONDITION: StaticSchema = ( + 14, + n0, + _DRFC, + 0, + (_EQUALS, _CONTAINS), + ((-1, {_sV: _EQUALS}), (-1, {_sV: _CONTAINS})), +) + +FILTER_FIELD_NAME: StaticSchema = ( + 14, + n0, + _FFN, + 0, + (_NAME, _DESCRIPTION, _DS_, _SEVERITY, _TACTIC, _TECHNIQUE, _SERVICE), + ( + (-1, {_sV: _n}), + (-1, {_sV: _de}), + (-1, {_sV: _dSa}), + (-1, {_sV: _sev}), + (-1, {_sV: _tac}), + (-1, {_sV: _tec}), + (-1, {_sV: _ser}), + ), ) -INVESTIGATION_ID = Schema( - id=ShapeID("com.amazonaws.guardduty#InvestigationId"), shape_type=ShapeType.STRING +DETECTION_RULE_FILTER_VALUE: StaticSchema = (3, n0, _DRFV, 0) + +DETECTION_RULE_FILTER_VALUES: StaticSchema = ( + 16, + n0, + _DRFVe, + 0, + (_me,), + ((DETECTION_RULE_FILTER_VALUE, 0),), ) -CREATE_INVESTIGATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CreateInvestigationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#CreateInvestigationResponse", - ) - ], - members={ - "InvestigationId": { - "target": INVESTIGATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="investigationId"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, +DETECTION_RULE_FILTER: StaticSchema = ( + 18, + n0, + _DRF, + 0, + (_N, _Val, _Cond), + ( + (FILTER_FIELD_NAME, {_sN: _n, _sm: None}), + (DETECTION_RULE_FILTER_VALUES, {_sN: _va, _sm: None}), + (DETECTION_RULE_FILTER_CONDITION, {_sN: _cond}), + ), ) -CREATE_INVESTIGATION = Schema( - id=ShapeID("com.amazonaws.guardduty#CreateInvestigation"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/detector/{DetectorId}/investigation", - "code": 202, - } - ), - ) - ], -) - -IP_SET_FORMAT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#IpSetFormat"), - shape_type=ShapeType.ENUM, - members={ - "TXT": {"target": UNIT}, - "STIX": {"target": UNIT}, - "OTX_CSV": {"target": UNIT}, - "ALIEN_VAULT": {"target": UNIT}, - "PROOF_POINT": {"target": UNIT}, - "FIRE_EYE": {"target": UNIT}, - }, +DETECTION_RULE_FILTER_LIST: StaticSchema = ( + 16, + n0, + _DRFL, + 0, + (_me,), + ((DETECTION_RULE_FILTER, 0),), +) + +DETECTION_RULE_MAX_RESULTS: StaticSchema = (7, n0, _DRMR, 0) + +DETECTION_RULE_ORG_CONFIGURATION: StaticSchema = ( + 18, + n0, + _DROC, + 0, + (_RI, _Mo, _St, _SRt, _IAI, _EAI, _CA, _UAp, _EA), + ( + (RULE_ID, {_sN: _rI, _sm: None}), + (ASSOCIATION_MODE, {_sN: _mo, _sm: None}), + (DETECTION_RULE_CONFIGURATION_STATUS, {_sN: _st, _sm: None}), + (STRING, {_sN: _sRt}), + (DETECTION_RULE_ACCOUNT_IDS, {_sN: _iAI, _sm: None}), + (DETECTION_RULE_ACCOUNT_IDS, {_sN: _eAI, _sm: None}), + (TIMESTAMP, {_sN: _cA, _sm: None}), + (TIMESTAMP, {_sN: _uAp, _sm: None}), + (TIMESTAMP, {_sN: _eA}), + ), ) -LOCATION = Schema( - id=ShapeID("com.amazonaws.guardduty#Location"), shape_type=ShapeType.STRING +DETECTION_RULE_ORG_CONFIGURATION_SUMMARY: StaticSchema = ( + 18, + n0, + _DROCS, + 0, + (_RI, _Mo, _St, _SRt, _CA, _UAp, _EA), + ( + (RULE_ID, {_sN: _rI, _sm: None}), + (ASSOCIATION_MODE, {_sN: _mo, _sm: None}), + (DETECTION_RULE_CONFIGURATION_STATUS, {_sN: _st, _sm: None}), + (STRING, {_sN: _sRt}), + (TIMESTAMP, {_sN: _cA, _sm: None}), + (TIMESTAMP, {_sN: _uAp, _sm: None}), + (TIMESTAMP, {_sN: _eA}), + ), ) -NAME = Schema(id=ShapeID("com.amazonaws.guardduty#Name"), shape_type=ShapeType.STRING) +DETECTION_RULE_ORG_CONFIGURATION_SUMMARY_LIST: StaticSchema = ( + 16, + n0, + _DROCSL, + 0, + (_me,), + ((DETECTION_RULE_ORG_CONFIGURATION_SUMMARY, 0),), +) + +DETECTION_RULE_SERVICE_NAME: StaticSchema = (3, n0, _DRSN, 0) + +DETECTION_RULE_SEVERITY: StaticSchema = ( + 14, + n0, + _DRS, + 0, + (_CRITICAL, _HIGH, _MEDIUM, _LOW), + ( + (-1, {_sV: _CRITICAL}), + (-1, {_sV: _HIGH}), + (-1, {_sV: _MEDIUM}), + (-1, {_sV: _LOW}), + ), +) -CREATE_IP_SET_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CreateIPSetInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#CreateIPSetRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Name": { - "target": NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="name"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Format": { - "target": IP_SET_FORMAT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="format"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Location": { - "target": LOCATION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="location"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Activate": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="activate"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "ClientToken": { - "target": CLIENT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#idempotencyToken")), - Trait.new(id=ShapeID("smithy.api#jsonName"), value="clientToken"), - ], - }, - "Tags": { - "target": TAG_MAP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="tags")], - }, - "ExpectedBucketOwner": { - "target": ACCOUNT_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="expectedBucketOwner" - ) - ], - }, - }, +DETECTION_SOURCE: StaticSchema = ( + 14, + n0, + _DSe, + 0, + (_AMAZON, _BITDEFENDER), + ((-1, {_sV: _AMAZON}), (-1, {_sV: _BITDEFENDER})), +) + +MANAGED_BY: StaticSchema = (14, n0, _MB, 0, (_GP,), ((-1, {_sV: _GP}),)) + +DETECTOR_ADDITIONAL_CONFIGURATION_RESULT: StaticSchema = ( + 18, + n0, + _DACR, + 0, + (_N, _St, _UAp, _MB), + ( + (FEATURE_ADDITIONAL_CONFIGURATION, {_sN: _n}), + (FEATURE_STATUS, {_sN: _st}), + (TIMESTAMP, {_sN: _uAp}), + (MANAGED_BY, {_sN: _mB}), + ), ) -CREATE_IP_SET_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CreateIPSetOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#CreateIPSetResponse", - ) - ], - members={ - "IpSetId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="ipSetId"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, +DETECTOR_ADDITIONAL_CONFIGURATION_RESULTS: StaticSchema = ( + 16, + n0, + _DACRe, + 0, + (_me,), + ((DETECTOR_ADDITIONAL_CONFIGURATION_RESULT, 0),), +) + +DETECTOR_FEATURE_RESULT: StaticSchema = ( + 14, + n0, + _DFR, + 0, + (_FL_, _CT_, _DL_, _SDE, _EAL, _EMP, _RLE, _LNL, _ERM, _RM, _AP, _AA_), + ( + (-1, {_sV: _FL_}), + (-1, {_sV: _CT_}), + (-1, {_sV: _DL_}), + (-1, {_sV: _SDE}), + (-1, {_sV: _EAL}), + (-1, {_sV: _EMP}), + (-1, {_sV: _RLE}), + (-1, {_sV: _LNL}), + (-1, {_sV: _ERM}), + (-1, {_sV: _RM}), + (-1, {_sV: _AP}), + (-1, {_sV: _AA_}), + ), ) -CREATE_IP_SET = Schema( - id=ShapeID("com.amazonaws.guardduty#CreateIPSet"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/detector/{DetectorId}/ipset", "code": 200} - ), - ) - ], +DETECTOR_FEATURE_CONFIGURATION_RESULT: StaticSchema = ( + 18, + n0, + _DFCR, + 0, + (_N, _St, _UAp, _ACd, _MB), + ( + (DETECTOR_FEATURE_RESULT, {_sN: _n}), + (FEATURE_STATUS, {_sN: _st}), + (TIMESTAMP, {_sN: _uAp}), + (DETECTOR_ADDITIONAL_CONFIGURATION_RESULTS, {_sN: _aC}), + (MANAGED_BY, {_sN: _mB}), + ), ) -MALWARE_PROTECTION_PLAN_TAGGING_ACTION_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#MalwareProtectionPlanTaggingActionStatus"), - shape_type=ShapeType.ENUM, - members={"ENABLED": {"target": UNIT}, "DISABLED": {"target": UNIT}}, +DETECTOR_FEATURE_CONFIGURATIONS_RESULTS: StaticSchema = ( + 16, + n0, + _DFCRe, + 0, + (_me,), + ((DETECTOR_FEATURE_CONFIGURATION_RESULT, 0),), ) -MALWARE_PROTECTION_PLAN_TAGGING_ACTION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#MalwareProtectionPlanTaggingAction"), - members={ - "Status": { - "target": MALWARE_PROTECTION_PLAN_TAGGING_ACTION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="status")], - } - }, +DETECTOR_IDS: StaticSchema = (16, n0, _DIet, 0, (_me,), ((DETECTOR_ID, 0),)) + +DETECTOR_STATUS: StaticSchema = ( + 14, + n0, + _DSet, + 0, + (_ENABLED, _DISABLED), + ((-1, {_sV: _ENABLED}), (-1, {_sV: _DISABLED})), ) -MALWARE_PROTECTION_PLAN_ACTIONS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#MalwareProtectionPlanActions"), - members={ - "Tagging": { - "target": MALWARE_PROTECTION_PLAN_TAGGING_ACTION, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="tagging")], - } - }, +DISABLE_ORGANIZATION_ADMIN_ACCOUNT_INPUT: StaticSchema = ( + 18, + n0, + _DOAAI, + {_sSI: _cDOAAR, _s: None}, + (_AAId,), + ((STRING, {_sN: _aAI, _sm: None}),), ) -MALWARE_PROTECTION_PLAN_OBJECT_PREFIXES_LIST = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#MalwareProtectionPlanObjectPrefixesList"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, -) - -CREATE_S3_BUCKET_RESOURCE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CreateS3BucketResource"), - members={ - "BucketName": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="bucketName") - ], - }, - "ObjectPrefixes": { - "target": MALWARE_PROTECTION_PLAN_OBJECT_PREFIXES_LIST, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="objectPrefixes") - ], - }, - }, +DISABLE_ORGANIZATION_ADMIN_ACCOUNT_OUTPUT: StaticSchema = ( + 18, + n0, + _DOAAO, + {_sSI: _cDOAARo, _smi: None}, ) -CREATE_PROTECTED_RESOURCE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CreateProtectedResource"), - members={ - "S3Bucket": { - "target": CREATE_S3_BUCKET_RESOURCE, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="s3Bucket")], - } - }, +DISABLE_ORGANIZATION_ADMIN_ACCOUNT: StaticOperationSchema = ( + 23, + n0, + _DOAA, + { + _smith: MappingProxyType( + {"method": "POST", "uri": "/admin/disable", "code": 200} + ) + }, + DISABLE_ORGANIZATION_ADMIN_ACCOUNT_INPUT, + DISABLE_ORGANIZATION_ADMIN_ACCOUNT_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +DISASSOCIATE_FROM_ADMINISTRATOR_ACCOUNT_INPUT: StaticSchema = ( + 18, + n0, + _DFAAI, + {_sSI: _cDFAAR, _s: None}, + (_DI,), + ((DETECTOR_ID, 9),), ) -CREATE_MALWARE_PROTECTION_PLAN_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CreateMalwareProtectionPlanInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#CreateMalwareProtectionPlanRequest", - ) - ], - members={ - "ClientToken": { - "target": CLIENT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#idempotencyToken")), - Trait.new(id=ShapeID("smithy.api#jsonName"), value="clientToken"), - ], - }, - "Role": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="role"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "ProtectedResource": { - "target": CREATE_PROTECTED_RESOURCE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="protectedResource"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Actions": { - "target": MALWARE_PROTECTION_PLAN_ACTIONS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="actions")], - }, - "Tags": { - "target": TAG_MAP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="tags")], - }, - }, +DISASSOCIATE_FROM_ADMINISTRATOR_ACCOUNT_OUTPUT: StaticSchema = ( + 18, + n0, + _DFAAO, + {_sSI: _cDFAARo, _smi: None}, ) -CREATE_MALWARE_PROTECTION_PLAN_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CreateMalwareProtectionPlanOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#CreateMalwareProtectionPlanResponse", +DISASSOCIATE_FROM_ADMINISTRATOR_ACCOUNT: StaticOperationSchema = ( + 23, + n0, + _DFAA, + { + _smith: MappingProxyType( + { + "method": "POST", + "uri": "/detector/{DetectorId}/administrator/disassociate", + "code": 200, + } ) - ], - members={ - "MalwareProtectionPlanId": { - "target": STRING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="malwareProtectionPlanId" - ) - ], - } }, + DISASSOCIATE_FROM_ADMINISTRATOR_ACCOUNT_INPUT, + DISASSOCIATE_FROM_ADMINISTRATOR_ACCOUNT_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +DISASSOCIATE_FROM_MASTER_ACCOUNT_INPUT: StaticSchema = ( + 18, + n0, + _DFMAI, + {_sSI: _cDFMAR, _s: None}, + (_DI,), + ((DETECTOR_ID, 9),), +) + +DISASSOCIATE_FROM_MASTER_ACCOUNT_OUTPUT: StaticSchema = ( + 18, + n0, + _DFMAO, + {_sSI: _cDFMARo, _smi: None}, +) + +DISASSOCIATE_FROM_MASTER_ACCOUNT: StaticOperationSchema = ( + 23, + n0, + _DFMA, + { + _smith: MappingProxyType( + { + "method": "POST", + "uri": "/detector/{DetectorId}/master/disassociate", + "code": 200, + } + ) + }, + DISASSOCIATE_FROM_MASTER_ACCOUNT_INPUT, + DISASSOCIATE_FROM_MASTER_ACCOUNT_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +DISASSOCIATE_MEMBERS_INPUT: StaticSchema = ( + 18, + n0, + _DMIi, + {_sSI: _cDMRom, _s: None}, + (_DI, _AIcco), + ((DETECTOR_ID, 9), (ACCOUNT_IDS, {_sN: _aIcc, _sm: None})), +) + +DISASSOCIATE_MEMBERS_OUTPUT: StaticSchema = ( + 18, + n0, + _DMOi, + {_sSI: _cDMRoma, _smi: None}, + (_UAnp,), + ((UNPROCESSED_ACCOUNTS, {_sN: _uAn, _sm: None}),), +) + +DISASSOCIATE_MEMBERS: StaticOperationSchema = ( + 23, + n0, + _DMi, + { + _smith: MappingProxyType( + { + "method": "POST", + "uri": "/detector/{DetectorId}/member/disassociate", + "code": 200, + } + ) + }, + DISASSOCIATE_MEMBERS_INPUT, + DISASSOCIATE_MEMBERS_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +EBS_SNAPSHOT: StaticSchema = (18, n0, _ES, 0, (_DN,), ((NON_EMPTY_STRING, {_sN: _dN}),)) + +EBS_SNAPSHOT_DETAILS: StaticSchema = (18, n0, _ESD, 0, (_SA,), ((STRING, {_sN: _sA}),)) + +EBS_SNAPSHOT_PRESERVATION: StaticSchema = ( + 14, + n0, + _ESP, + 0, + (_NR_, _RWF), + ((-1, {_sV: _NR_}), (-1, {_sV: _RWF})), +) + +EBS_VOLUME_DETAILS: StaticSchema = ( + 18, + n0, + _EVD, + 0, + (_SVD, _SVDk), + ((VOLUME_DETAILS, {_sN: _sVD}), (VOLUME_DETAILS, {_sN: _sVDk})), +) + +HIGHEST_SEVERITY_THREAT_DETAILS: StaticSchema = ( + 18, + n0, + _HSTD, + 0, + (_Sev, _TN, _Cou), + ((STRING, {_sN: _sev}), (STRING, {_sN: _tN}), (INTEGER, {_sN: _cou})), +) + +SCANNED_ITEM_COUNT: StaticSchema = ( + 18, + n0, + _SIC, + 0, + (_TG, _Fi, _Vo), + ((INTEGER, {_sN: _tG}), (INTEGER, {_sN: _fi}), (INTEGER, {_sN: _vo})), +) + +SCAN_FILE_PATH: StaticSchema = ( + 18, + n0, + _SFP, + 0, + (_FP, _VA, _Ha, _FNi), + ( + (STRING, {_sN: _fP}), + (STRING, {_sN: _vA}), + (STRING, {_sN: _h}), + (STRING, {_sN: _fN}), + ), ) -CREATE_MALWARE_PROTECTION_PLAN = Schema( - id=ShapeID("com.amazonaws.guardduty#CreateMalwareProtectionPlan"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/malware-protection-plan", "code": 200} - ), - ) - ], +FILE_PATHS: StaticSchema = (16, n0, _FPi, 0, (_me,), ((SCAN_FILE_PATH, 0),)) + +SCAN_THREAT_NAME: StaticSchema = ( + 18, + n0, + _STN, + 0, + (_N, _Sev, _IC, _FPi), + ( + (STRING, {_sN: _n}), + (STRING, {_sN: _sev}), + (INTEGER, {_sN: _iC}), + (FILE_PATHS, {_sN: _fPi}), + ), ) -CREATE_MEMBERS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CreateMembersInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#CreateMembersRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "AccountDetails": { - "target": ACCOUNT_DETAILS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="accountDetails"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - }, +SCAN_THREAT_NAMES: StaticSchema = (16, n0, _STNc, 0, (_me,), ((SCAN_THREAT_NAME, 0),)) + +THREAT_DETECTED_BY_NAME: StaticSchema = ( + 18, + n0, + _TDBN, + 0, + (_IC, _UTNC, _Sho, _TNh), + ( + (INTEGER, {_sN: _iC}), + (INTEGER, {_sN: _uTNC}), + (BOOLEAN, {_sN: _sho}), + (SCAN_THREAT_NAMES, {_sN: _tNh}), + ), ) -UNPROCESSED_ACCOUNT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UnprocessedAccount"), - members={ - "AccountId": { - "target": ACCOUNT_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="accountId"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Result": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="result"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - }, +THREATS_DETECTED_ITEM_COUNT: StaticSchema = ( + 18, + n0, + _TDIC, + 0, + (_Fi,), + ((INTEGER, {_sN: _fi}),), +) + +SCAN_DETECTIONS: StaticSchema = ( + 18, + n0, + _SDc, + 0, + (_SIC, _TDIC, _HSTD, _TDBN), + ( + (SCANNED_ITEM_COUNT, {_sN: _sIC}), + (THREATS_DETECTED_ITEM_COUNT, {_sN: _tDIC}), + (HIGHEST_SEVERITY_THREAT_DETAILS, {_sN: _hSTD}), + (THREAT_DETECTED_BY_NAME, {_sN: _tDBN}), + ), ) -UNPROCESSED_ACCOUNTS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UnprocessedAccounts"), - shape_type=ShapeType.LIST, - members={"member": {"target": UNPROCESSED_ACCOUNT}}, +SOURCES: StaticSchema = (16, n0, _So, 0, (_me,), ((STRING, 0),)) + +EBS_VOLUME_SCAN_DETAILS: StaticSchema = ( + 18, + n0, + _EVSD, + 0, + (_SIc, _SSA, _SCA, _TFI, _So, _SDc, _STc), + ( + (STRING, {_sN: _sI}), + (TIMESTAMP, {_sN: _sSA}), + (TIMESTAMP, {_sN: _sCA}), + (STRING, {_sN: _tFI}), + (SOURCES, {_sN: _so}), + (SCAN_DETECTIONS, {_sN: _sD}), + (SCAN_TYPE, {_sN: _sTc}), + ), ) -CREATE_MEMBERS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CreateMembersOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#CreateMembersResponse", - ) - ], - members={ - "UnprocessedAccounts": { - "target": UNPROCESSED_ACCOUNTS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="unprocessedAccounts" - ), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, +EC2_IMAGE_DETAILS: StaticSchema = (18, n0, _EIDc, 0, (_IAm,), ((STRING, {_sN: _iAm}),)) + +HOST_PATH: StaticSchema = (18, n0, _HP, 0, (_Pat,), ((STRING, {_sN: _pat}),)) + +VOLUME: StaticSchema = ( + 18, + n0, + _Vol, + 0, + (_N, _HP), + ((STRING, {_sN: _n}), (HOST_PATH, {_sN: _hP})), +) + +VOLUMES: StaticSchema = (16, n0, _Vo, 0, (_me,), ((VOLUME, 0),)) + +ECS_TASK_DETAILS: StaticSchema = ( + 18, + n0, + _ETD, + 0, + (_Ar, _DAe, _Ve, _TCA, _SAt, _SBt, _Ta, _Vo, _Conta, _Gr, _LTa), + ( + (STRING, {_sN: _ar}), + (STRING, {_sN: _dAe}), + (STRING, {_sN: _ver}), + (TIMESTAMP, {_sN: _cA}), + (TIMESTAMP, {_sN: _sAt}), + (STRING, {_sN: _sBt}), + (TAGS, {_sN: _ta}), + (VOLUMES, {_sN: _vo}), + (CONTAINERS, {_sN: _conta}), + (STRING, {_sN: _gr}), + (STRING, {_sN: _lTa}), + ), ) -CREATE_MEMBERS = Schema( - id=ShapeID("com.amazonaws.guardduty#CreateMembers"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/detector/{DetectorId}/member", "code": 200} - ), - ) - ], -) - -DESTINATION_PROPERTIES = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DestinationProperties"), - members={ - "DestinationArn": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="destinationArn") - ], - }, - "KmsKeyArn": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="kmsKeyArn")], - }, - }, +ECS_CLUSTER_DETAILS: StaticSchema = ( + 18, + n0, + _ECDc, + 0, + (_N, _Ar, _St, _ASCc, _RCIC, _RTC, _Ta, _TDa), + ( + (STRING, {_sN: _n}), + (STRING, {_sN: _ar}), + (STRING, {_sN: _st}), + (INTEGER, {_sN: _aSC}), + (INTEGER, {_sN: _rCIC}), + (INTEGER, {_sN: _rTC}), + (TAGS, {_sN: _ta}), + (ECS_TASK_DETAILS, {_sN: _tDa}), + ), ) -DESTINATION_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DestinationType"), - shape_type=ShapeType.ENUM, - members={"S3": {"target": UNIT}}, +EKS_CLUSTER_DETAILS: StaticSchema = ( + 18, + n0, + _ECD, + 0, + (_N, _Ar, _VIp, _St, _Ta, _CA), + ( + (STRING, {_sN: _n}), + (STRING, {_sN: _ar}), + (STRING, {_sN: _vIp}), + (STRING, {_sN: _st}), + (TAGS, {_sN: _ta}), + (TIMESTAMP, {_sN: _cA}), + ), ) -CREATE_PUBLISHING_DESTINATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CreatePublishingDestinationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#CreatePublishingDestinationRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "DestinationType": { - "target": DESTINATION_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="destinationType"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "DestinationProperties": { - "target": DESTINATION_PROPERTIES, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="destinationProperties" - ), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "ClientToken": { - "target": CLIENT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#idempotencyToken")), - Trait.new(id=ShapeID("smithy.api#jsonName"), value="clientToken"), - ], - }, - "Tags": { - "target": TAG_MAP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="tags")], - }, - }, +ENABLE_ORGANIZATION_ADMIN_ACCOUNT_INPUT: StaticSchema = ( + 18, + n0, + _EOAAI, + {_sSI: _cEOAAR, _s: None}, + (_AAId,), + ((STRING, {_sN: _aAI, _sm: None}),), +) + +ENABLE_ORGANIZATION_ADMIN_ACCOUNT_OUTPUT: StaticSchema = ( + 18, + n0, + _EOAAO, + {_sSI: _cEOAARo, _smi: None}, +) + +ENABLE_ORGANIZATION_ADMIN_ACCOUNT: StaticOperationSchema = ( + 23, + n0, + _EOAA, + {_smith: MappingProxyType({"method": "POST", "uri": "/admin/enable", "code": 200})}, + ENABLE_ORGANIZATION_ADMIN_ACCOUNT_INPUT, + ENABLE_ORGANIZATION_ADMIN_ACCOUNT_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +THREAT_NAMES: StaticSchema = (16, n0, _TNh, 0, (_me,), ((STRING, 0),)) + +THREAT_INTELLIGENCE_DETAIL: StaticSchema = ( + 18, + n0, + _TID, + 0, + (_TLN, _TNh, _TFS), + ((STRING, {_sN: _tLN}), (THREAT_NAMES, {_sN: _tNh}), (STRING, {_sN: _tFS})), +) + +THREAT_INTELLIGENCE_DETAILS: StaticSchema = ( + 16, + n0, + _TIDh, + 0, + (_me,), + ((THREAT_INTELLIGENCE_DETAIL, 0),), +) + +EVIDENCE: StaticSchema = ( + 18, + n0, + _Ev, + 0, + (_TIDh,), + ((THREAT_INTELLIGENCE_DETAILS, {_sN: _tID}),), +) + +FEEDBACK: StaticSchema = ( + 14, + n0, + _Fe, + 0, + (_USEFUL, _NU), + ((-1, {_sV: _USEFUL}), (-1, {_sV: _NU})), +) + +FILTER_NAMES: StaticSchema = (16, n0, _FNil, 0, (_me,), ((FILTER_NAME, 0),)) + +FILTER_VERSION: StaticSchema = (8, n0, _FV, 0) + +NETWORK_INTERFACE: StaticSchema = ( + 18, + n0, + _NIe, + 0, + (_IAp, _NII, _PDN, _PIA, _PIAr, _PDNu, _PIu, _SGe, _SIu, _VIp), + ( + (IPV6_ADDRESSES, {_sN: _iAp}), + (STRING, {_sN: _nII}), + (STRING, {_sN: _pDN}), + (SENSITIVE_STRING, {_sN: _pIA}), + (PRIVATE_IP_ADDRESSES, {_sN: _pIAr}), + (STRING, {_sN: _pDNu}), + (STRING, {_sN: _pIu}), + (SECURITY_GROUPS, {_sN: _sG}), + (STRING, {_sN: _sIu}), + (STRING, {_sN: _vIp}), + ), ) -CREATE_PUBLISHING_DESTINATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CreatePublishingDestinationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#CreatePublishingDestinationResponse", - ) - ], - members={ - "DestinationId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="destinationId"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, +NETWORK_INTERFACES: StaticSchema = (16, n0, _NIet, 0, (_me,), ((NETWORK_INTERFACE, 0),)) + +INSTANCE_DETAILS: StaticSchema = ( + 18, + n0, + _IDn, + 0, + (_AZ, _IIP, _ID, _IIm, _IIn, _IS, _IT, _OA, _LTau, _NIet, _Pl, _PCr, _Ta), + ( + (STRING, {_sN: _aZ}), + (IAM_INSTANCE_PROFILE, {_sN: _iIP}), + (STRING, {_sN: _iD}), + (STRING, {_sN: _iIm}), + (STRING, {_sN: _iIn}), + (STRING, {_sN: _iS}), + (STRING, {_sN: _iT}), + (STRING, {_sN: _oA}), + (STRING, {_sN: _lTau}), + (NETWORK_INTERFACES, {_sN: _nI}), + (STRING, {_sN: _pl}), + (PRODUCT_CODES, {_sN: _pC}), + (TAGS, {_sN: _ta}), + ), ) -CREATE_PUBLISHING_DESTINATION = Schema( - id=ShapeID("com.amazonaws.guardduty#CreatePublishingDestination"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/detector/{DetectorId}/publishingDestination", - "code": 200, - } - ), - ) - ], +GROUPS: StaticSchema = (16, n0, _Gro, 0, (_me,), ((STRING, 0),)) + +IMPERSONATED_USER: StaticSchema = ( + 18, + n0, + _IUm, + 0, + (_Use, _Gro), + ((STRING, {_sN: _use}), (GROUPS, {_sN: _gro})), ) -FINDING_TYPES = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#FindingTypes"), - shape_type=ShapeType.LIST, - members={"member": {"target": FINDING_TYPE}}, +SESSION_NAME_LIST: StaticSchema = (16, n0, _SNL, 0, (_me,), ((STRING, 0),)) + +KUBERNETES_USER_DETAILS: StaticSchema = ( + 18, + n0, + _KUD, + 0, + (_Use, _U, _Gro, _SNe, _IUm), + ( + (STRING, {_sN: _use}), + (STRING, {_sN: _u}), + (GROUPS, {_sN: _gro}), + (SESSION_NAME_LIST, {_sN: _sNes}), + (IMPERSONATED_USER, {_sN: _iUm}), + ), ) -CREATE_SAMPLE_FINDINGS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CreateSampleFindingsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#CreateSampleFindingsRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "FindingTypes": { - "target": FINDING_TYPES, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="findingTypes") - ], - }, - }, +KUBERNETES_WORKLOAD_DETAILS: StaticSchema = ( + 18, + n0, + _KWD, + 0, + (_N, _T, _U, _Na, _HN, _SAN, _Conta, _Vo, _HIPC, _HPID), + ( + (STRING, {_sN: _n}), + (STRING, {_sN: _t}), + (STRING, {_sN: _u}), + (STRING, {_sN: _na}), + (BOOLEAN, {_sN: _hN}), + (STRING, {_sN: _sAN}), + (CONTAINERS, {_sN: _conta}), + (VOLUMES, {_sN: _vo}), + (BOOLEAN, {_sN: _hIPC}), + (BOOLEAN, {_sN: _hPID}), + ), ) -CREATE_SAMPLE_FINDINGS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CreateSampleFindingsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#CreateSampleFindingsResponse", - ) - ], -) - -CREATE_SAMPLE_FINDINGS = Schema( - id=ShapeID("com.amazonaws.guardduty#CreateSampleFindings"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/detector/{DetectorId}/findings/create", - "code": 200, - } - ), - ) - ], +KUBERNETES_DETAILS: StaticSchema = ( + 18, + n0, + _KD, + 0, + (_KUD, _KWD), + ( + (KUBERNETES_USER_DETAILS, {_sN: _kUD}), + (KUBERNETES_WORKLOAD_DETAILS, {_sN: _kWD}), + ), ) -EXPECTED_BUCKET_OWNER = Schema( - id=ShapeID("com.amazonaws.guardduty#ExpectedBucketOwner"), - shape_type=ShapeType.STRING, +SUBNET_IDS: StaticSchema = (16, n0, _SIub, 0, (_me,), ((STRING, 0),)) + +VPC_CONFIG: StaticSchema = ( + 18, + n0, + _VC, + 0, + (_SIub, _VIp, _SGe), + ((SUBNET_IDS, {_sN: _sIub}), (STRING, {_sN: _vIp}), (SECURITY_GROUPS, {_sN: _sG})), +) + +LAMBDA_DETAILS: StaticSchema = ( + 18, + n0, + _LD, + 0, + (_FAu, _FNu, _De, _LMA, _RIev, _FVu, _Ro, _VC, _Ta), + ( + (STRING, {_sN: _fA}), + (STRING, {_sN: _fNu}), + (STRING, {_sN: _de}), + (TIMESTAMP, {_sN: _lMA}), + (STRING, {_sN: _rIev}), + (STRING, {_sN: _fV}), + (STRING, {_sN: _ro}), + (VPC_CONFIG, {_sN: _vC}), + (TAGS, {_sN: _ta}), + ), ) -THREAT_ENTITY_SET_FORMAT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ThreatEntitySetFormat"), - shape_type=ShapeType.ENUM, - members={ - "TXT": {"target": UNIT}, - "STIX": {"target": UNIT}, - "OTX_CSV": {"target": UNIT}, - "ALIEN_VAULT": {"target": UNIT}, - "PROOF_POINT": {"target": UNIT}, - "FIRE_EYE": {"target": UNIT}, - }, +MODEL_DETAIL: StaticSchema = (18, n0, _MDo, 0, (_MIo,), ((STRING, {_sN: _mIo}),)) + +MODEL_DETAILS: StaticSchema = (16, n0, _MDod, 0, (_me,), ((MODEL_DETAIL, 0),)) + +RDS_DB_INSTANCE_DETAILS: StaticSchema = ( + 18, + n0, + _RDID, + 0, + (_DIIb, _Eng, _EVn, _DCI, _DIA, _DRI, _Ta), + ( + (STRING, {_sN: _dII}), + (STRING, {_sN: _eng}), + (STRING, {_sN: _eVn}), + (STRING, {_sN: _dCI}), + (STRING, {_sN: _dIA}), + (STRING, {_sN: _dRI}), + (TAGS, {_sN: _ta}), + ), ) -CREATE_THREAT_ENTITY_SET_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CreateThreatEntitySetInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#CreateThreatEntitySetRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Name": { - "target": NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="name"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Format": { - "target": THREAT_ENTITY_SET_FORMAT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="format"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Location": { - "target": LOCATION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="location"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "ExpectedBucketOwner": { - "target": EXPECTED_BUCKET_OWNER, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="expectedBucketOwner" - ) - ], - }, - "Activate": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="activate"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "ClientToken": { - "target": CLIENT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#idempotencyToken")), - Trait.new(id=ShapeID("smithy.api#jsonName"), value="clientToken"), - ], - }, - "Tags": { - "target": TAG_MAP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="tags")], - }, - }, +RDS_DB_USER_DETAILS: StaticSchema = ( + 18, + n0, + _RDUD, + 0, + (_Us, _App, _Data, _Ss, _AMu), + ( + (STRING, {_sN: _us}), + (STRING, {_sN: _app}), + (STRING, {_sN: _data}), + (STRING, {_sN: _ss}), + (STRING, {_sN: _aM}), + ), ) -CREATE_THREAT_ENTITY_SET_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CreateThreatEntitySetOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#CreateThreatEntitySetResponse", - ) - ], - members={ - "ThreatEntitySetId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="threatEntitySetId"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, +RDS_LIMITLESS_DB_DETAILS: StaticSchema = ( + 18, + n0, + _RLDD, + 0, + (_DSGI, _DSGRI, _DSGA, _Eng, _EVn, _DCI, _Ta), + ( + (STRING, {_sN: _dSGI}), + (STRING, {_sN: _dSGRI}), + (STRING, {_sN: _dSGA}), + (STRING, {_sN: _eng}), + (STRING, {_sN: _eVn}), + (STRING, {_sN: _dCI}), + (TAGS, {_sN: _ta}), + ), ) -CREATE_THREAT_ENTITY_SET = Schema( - id=ShapeID("com.amazonaws.guardduty#CreateThreatEntitySet"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/detector/{DetectorId}/threatentityset", - "code": 200, - } - ), - ) - ], -) - -THREAT_INTEL_SET_FORMAT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ThreatIntelSetFormat"), - shape_type=ShapeType.ENUM, - members={ - "TXT": {"target": UNIT}, - "STIX": {"target": UNIT}, - "OTX_CSV": {"target": UNIT}, - "ALIEN_VAULT": {"target": UNIT}, - "PROOF_POINT": {"target": UNIT}, - "FIRE_EYE": {"target": UNIT}, - }, +SCAN_CONFIGURATION_CONTINUOUS_SCAN_DETAILS: StaticSchema = ( + 18, + n0, + _SCCSD, + 0, + (_ST, _ET), + ((TIMESTAMP, {_sN: _sT}), (TIMESTAMP, {_sN: _eT, _sm: None})), +) + +RECOVERY_POINT_DETAILS: StaticSchema = ( + 18, + n0, + _RPDe, + 0, + (_RPA, _BVN, _CSD), + ( + (STRING, {_sN: _rPA}), + (STRING, {_sN: _bVN}), + (SCAN_CONFIGURATION_CONTINUOUS_SCAN_DETAILS, {_sN: _cSD}), + ), ) -CREATE_THREAT_INTEL_SET_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CreateThreatIntelSetInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#CreateThreatIntelSetRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Name": { - "target": NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="name"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Format": { - "target": THREAT_INTEL_SET_FORMAT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="format"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Location": { - "target": LOCATION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="location"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Activate": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="activate"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "ClientToken": { - "target": CLIENT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#idempotencyToken")), - Trait.new(id=ShapeID("smithy.api#jsonName"), value="clientToken"), - ], - }, - "Tags": { - "target": TAG_MAP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="tags")], - }, - "ExpectedBucketOwner": { - "target": ACCOUNT_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="expectedBucketOwner" - ) - ], - }, - }, +OWNER: StaticSchema = (18, n0, _Ow, 0, (_Id,), ((STRING, {_sN: _id}),)) + +PERMISSION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _PCe, + 0, + (_BLP, _ALP), + ((BUCKET_LEVEL_PERMISSIONS, {_sN: _bLP}), (ACCOUNT_LEVEL_PERMISSIONS, {_sN: _aLP})), +) + +PUBLIC_ACCESS: StaticSchema = ( + 18, + n0, + _PAu, + 0, + (_PCe, _EP), + ((PERMISSION_CONFIGURATION, {_sN: _pCe}), (STRING, {_sN: _eP})), +) + +S3_OBJECT_DETAIL: StaticSchema = ( + 18, + n0, + _SOD, + 0, + (_OAb, _Ke, _ETa, _Ha, _VI), + ( + (STRING, {_sN: _oAb}), + (STRING, {_sN: _ke}), + (STRING, {_sN: _eTa}), + (STRING, {_sN: _h}), + (STRING, {_sN: _vI}), + ), ) -CREATE_THREAT_INTEL_SET_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CreateThreatIntelSetOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#CreateThreatIntelSetResponse", - ) - ], - members={ - "ThreatIntelSetId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="threatIntelSetId"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, +S3_OBJECT_DETAILS: StaticSchema = (16, n0, _SODb, 0, (_me,), ((S3_OBJECT_DETAIL, 0),)) + +S3_BUCKET_DETAIL: StaticSchema = ( + 18, + n0, + _SBD, + 0, + (_Ar, _N, _T, _CA, _Ow, _Ta, _DSSE, _PAu, _SODb), + ( + (STRING, {_sN: _ar}), + (STRING, {_sN: _n}), + (STRING, {_sN: _t}), + (TIMESTAMP, {_sN: _cA}), + (OWNER, {_sN: _ow}), + (TAGS, {_sN: _ta}), + (DEFAULT_SERVER_SIDE_ENCRYPTION, {_sN: _dSSE}), + (PUBLIC_ACCESS, {_sN: _pA}), + (S3_OBJECT_DETAILS, {_sN: _sOD}), + ), ) -CREATE_THREAT_INTEL_SET = Schema( - id=ShapeID("com.amazonaws.guardduty#CreateThreatIntelSet"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/detector/{DetectorId}/threatintelset", - "code": 200, - } - ), - ) - ], -) - -TRUSTED_ENTITY_SET_FORMAT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#TrustedEntitySetFormat"), - shape_type=ShapeType.ENUM, - members={ - "TXT": {"target": UNIT}, - "STIX": {"target": UNIT}, - "OTX_CSV": {"target": UNIT}, - "ALIEN_VAULT": {"target": UNIT}, - "PROOF_POINT": {"target": UNIT}, - "FIRE_EYE": {"target": UNIT}, - }, +S3_BUCKET_DETAILS: StaticSchema = (16, n0, _SBDu, 0, (_me,), ((S3_BUCKET_DETAIL, 0),)) + +RESOURCE: StaticSchema = ( + 18, + n0, + _R, + 0, + ( + _AKD, + _SBDu, + _IDn, + _ECD, + _KD, + _RT, + _EVD, + _ECDc, + _CDo, + _LD, + _RDID, + _RLDD, + _RDUD, + _ESD, + _EIDc, + _RPDe, + _BGD, + _MDod, + ), + ( + (ACCESS_KEY_DETAILS, {_sN: _aKD}), + (S3_BUCKET_DETAILS, {_sN: _sBD}), + (INSTANCE_DETAILS, {_sN: _iDn}), + (EKS_CLUSTER_DETAILS, {_sN: _eCD}), + (KUBERNETES_DETAILS, {_sN: _kD}), + (STRING, {_sN: _rT}), + (EBS_VOLUME_DETAILS, {_sN: _eVD}), + (ECS_CLUSTER_DETAILS, {_sN: _eCDc}), + (CONTAINER, {_sN: _cDo}), + (LAMBDA_DETAILS, {_sN: _lD}), + (RDS_DB_INSTANCE_DETAILS, {_sN: _rDID}), + (RDS_LIMITLESS_DB_DETAILS, {_sN: _rLDD}), + (RDS_DB_USER_DETAILS, {_sN: _rDUD}), + (EBS_SNAPSHOT_DETAILS, {_sN: _eSD}), + (EC2_IMAGE_DETAILS, {_sN: _eIDc}), + (RECOVERY_POINT_DETAILS, {_sN: _rPDe}), + (BEDROCK_GUARDRAIL_DETAILS, {_sN: _bGD}), + (MODEL_DETAILS, {_sN: _mD}), + ), ) -CREATE_TRUSTED_ENTITY_SET_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CreateTrustedEntitySetInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#CreateTrustedEntitySetRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Name": { - "target": NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="name"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Format": { - "target": TRUSTED_ENTITY_SET_FORMAT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="format"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Location": { - "target": LOCATION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="location"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "ExpectedBucketOwner": { - "target": EXPECTED_BUCKET_OWNER, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="expectedBucketOwner" - ) - ], - }, - "Activate": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="activate"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "ClientToken": { - "target": CLIENT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#idempotencyToken")), - Trait.new(id=ShapeID("smithy.api#jsonName"), value="clientToken"), - ], - }, - "Tags": { - "target": TAG_MAP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="tags")], - }, - }, +SERVICE_ADDITIONAL_INFO: StaticSchema = ( + 18, + n0, + _SAI, + 0, + (_Va, _T), + ((STRING, {_sN: _v}), (STRING, {_sN: _t})), +) + +SCAN_CATEGORY: StaticSchema = ( + 14, + n0, + _SCc, + 0, + (_FS_, _IS_), + ((-1, {_sV: _FS_}), (-1, {_sV: _IS_})), +) + +INCREMENTAL_SCAN_DETAILS: StaticSchema = ( + 18, + n0, + _ISD, + 0, + (_BRA,), + ((NON_EMPTY_STRING, {_sN: _bRA, _sm: None}),), +) + +MALWARE_PROTECTION_FINDINGS_SCAN_CONFIGURATION: StaticSchema = ( + 18, + n0, + _MPFSC, + 0, + (_TT, _ISD), + ((TRIGGER_TYPE, {_sN: _tT}), (INCREMENTAL_SCAN_DETAILS, {_sN: _iSD})), +) + +MALWARE_PROTECTION_SCAN_TYPE: StaticSchema = ( + 14, + n0, + _MPST, + 0, + (_BI, _OD, _GI_), + ((-1, {_sV: _BI}), (-1, {_sV: _OD}), (-1, {_sV: _GI_})), +) + +ITEM_DETAILS: StaticSchema = ( + 18, + n0, + _IDt, + 0, + (_RAe, _IPt, _Ha, _AId), + ( + (NON_EMPTY_STRING, {_sN: _rAe}), + (NON_EMPTY_STRING, {_sN: _iPt}), + (STRING, {_sN: _h}), + (ADDITIONAL_INFO, {_sN: _aId}), + ), ) -CREATE_TRUSTED_ENTITY_SET_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CreateTrustedEntitySetOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#CreateTrustedEntitySetResponse", - ) - ], - members={ - "TrustedEntitySetId": { - "target": STRING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="trustedEntitySetId" - ), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, +ITEM_DETAILS_LIST: StaticSchema = (16, n0, _IDL, 0, (_me,), ((ITEM_DETAILS, 0),)) + +ITEM_PATH: StaticSchema = ( + 18, + n0, + _IPt, + 0, + (_NIP, _Ha), + ((STRING, {_sN: _nIP}), (STRING, {_sN: _h})), +) + +ITEM_PATHS: StaticSchema = (16, n0, _IPte, 0, (_me,), ((ITEM_PATH, 0),)) + +THREAT: StaticSchema = ( + 18, + n0, + _Th, + 0, + (_N, _Sou, _IPte, _Cou, _Ha, _IDt), + ( + (STRING, {_sN: _n}), + (STRING, {_sN: _sou}), + (ITEM_PATHS, {_sN: _iPte}), + (LONG, {_sN: _cou}), + (STRING, {_sN: _h}), + (ITEM_DETAILS_LIST, {_sN: _iDt}), + ), ) -CREATE_TRUSTED_ENTITY_SET = Schema( - id=ShapeID("com.amazonaws.guardduty#CreateTrustedEntitySet"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/detector/{DetectorId}/trustedentityset", - "code": 200, - } - ), - ) - ], -) - -CRITERION_KEY = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#CriterionKey"), - shape_type=ShapeType.ENUM, - members={ - "EC2_INSTANCE_ARN": {"target": UNIT}, - "SCAN_ID": {"target": UNIT}, - "ACCOUNT_ID": {"target": UNIT}, - "GUARDDUTY_FINDING_ID": {"target": UNIT}, - "SCAN_START_TIME": {"target": UNIT}, - "SCAN_STATUS": {"target": UNIT}, - "SCAN_TYPE": {"target": UNIT}, - }, +THREATS: StaticSchema = (16, n0, _Thr, 0, (_me,), ((THREAT, 0),)) + +MALWARE_SCAN_DETAILS: StaticSchema = ( + 18, + n0, + _MSD, + 0, + (_Thr, _SIc, _STc, _SCc, _SCca, _UTC), + ( + (THREATS, {_sN: _th}), + (STRING, {_sN: _sI}), + (MALWARE_PROTECTION_SCAN_TYPE, {_sN: _sTc}), + (SCAN_CATEGORY, {_sN: _sCc}), + (MALWARE_PROTECTION_FINDINGS_SCAN_CONFIGURATION, {_sN: _sCca}), + (INTEGER, {_sN: _uTC}), + ), ) -DATA_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DataSource"), - shape_type=ShapeType.ENUM, - members={ - "FLOW_LOGS": {"target": UNIT}, - "CLOUD_TRAIL": {"target": UNIT}, - "DNS_LOGS": {"target": UNIT}, - "S3_LOGS": {"target": UNIT}, - "KUBERNETES_AUDIT_LOGS": {"target": UNIT}, - "EC2_MALWARE_SCAN": {"target": UNIT}, - }, +FLAGS_LIST: StaticSchema = (16, n0, _FLl, 0, (_me,), ((STRING, 0),)) + +MEMORY_REGIONS_LIST: StaticSchema = (16, n0, _MRL, 0, (_me,), ((STRING, 0),)) + +LINEAGE_OBJECT: StaticSchema = ( + 18, + n0, + _LO, + 0, + (_ST, _NP, _UI, _N, _Pi, _Uu, _EPx, _Eu, _PU), + ( + (TIMESTAMP, {_sN: _sT}), + (INTEGER, {_sN: _nP}), + (INTEGER, {_sN: _uI}), + (STRING, {_sN: _n}), + (INTEGER, {_sN: _pi}), + (STRING, {_sN: _uu}), + (STRING, {_sN: _ePx}), + (INTEGER, {_sN: _eu}), + (STRING, {_sN: _pU}), + ), ) -DNS_LOGS_CONFIGURATION_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DNSLogsConfigurationResult"), - members={ - "Status": { - "target": DATA_SOURCE_STATUS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="status"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, +LINEAGE: StaticSchema = (16, n0, _Li, 0, (_me,), ((LINEAGE_OBJECT, 0),)) + +PROCESS_DETAILS: StaticSchema = ( + 18, + n0, + _PD, + 0, + (_N, _EPx, _ESx, _NP, _Pw, _Pi, _ST, _Uu, _PU, _Us, _UI, _Eu, _Li), + ( + (STRING, {_sN: _n}), + (STRING, {_sN: _ePx}), + (STRING, {_sN: _eS}), + (INTEGER, {_sN: _nP}), + (STRING, {_sN: _pw}), + (INTEGER, {_sN: _pi}), + (TIMESTAMP, {_sN: _sT}), + (STRING, {_sN: _uu}), + (STRING, {_sN: _pU}), + (STRING, {_sN: _us}), + (INTEGER, {_sN: _uI}), + (INTEGER, {_sN: _eu}), + (LINEAGE, {_sN: _li}), + ), ) -FLOW_LOGS_CONFIGURATION_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#FlowLogsConfigurationResult"), - members={ - "Status": { - "target": DATA_SOURCE_STATUS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="status"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, +RELATED_FILE_PATHS_LIST: StaticSchema = (16, n0, _RFPL, 0, (_me,), ((STRING, 0),)) + +RUNTIME_CONTEXT: StaticSchema = ( + 18, + n0, + _RC, + 0, + ( + _MPod, + _MA, + _SPc, + _LP, + _LPV, + _SPo, + _RBP, + _RAP, + _MSo, + _MTo, + _FST, + _Fl, + _MN, + _MFP, + _MSod, + _SHFP, + _TPa, + _AFd, + _IPN, + _MRe, + _TNo, + _TC, + _SN, + _CLE, + _TFP, + _FO, + _FP, + _RFP, + ), + ( + (PROCESS_DETAILS, {_sN: _mPod}), + (TIMESTAMP, {_sN: _mA}), + (STRING, {_sN: _sP}), + (STRING, {_sN: _lP}), + (STRING, {_sN: _lPV}), + (STRING, {_sN: _sPo}), + (STRING, {_sN: _rBP}), + (STRING, {_sN: _rAP}), + (STRING, {_sN: _mSo}), + (STRING, {_sN: _mTo}), + (STRING, {_sN: _fST}), + (FLAGS_LIST, {_sN: _fl}), + (STRING, {_sN: _mN}), + (STRING, {_sN: _mFP}), + (STRING, {_sN: _mSod}), + (STRING, {_sN: _sHFP}), + (PROCESS_DETAILS, {_sN: _tPa}), + (STRING, {_sN: _aF}), + (INTEGER, {_sN: _iPN}), + (MEMORY_REGIONS_LIST, {_sN: _mRe}), + (STRING, {_sN: _tNo}), + (STRING, {_sN: _tC}), + (STRING, {_sN: _sNe}), + (STRING, {_sN: _cLE}), + (STRING, {_sN: _tFP}), + (STRING, {_sN: _fO}), + (STRING, {_sN: _fP}), + (RELATED_FILE_PATHS_LIST, {_sN: _rFP}), + ), ) -KUBERNETES_AUDIT_LOGS_CONFIGURATION_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#KubernetesAuditLogsConfigurationResult"), - members={ - "Status": { - "target": DATA_SOURCE_STATUS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="status"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, +RUNTIME_DETAILS: StaticSchema = ( + 18, + n0, + _RDu, + 0, + (_Pr, _Conte), + ((PROCESS_DETAILS, {_sN: _pr}), (RUNTIME_CONTEXT, {_sN: _conte})), +) + +SERVICE: StaticSchema = ( + 18, + n0, + _Se, + 0, + ( + _Ac, + _Ev, + _Arc, + _Cou, + _DI, + _EFS, + _ELS, + _RR, + _SN, + _UF, + _AId, + _FNe, + _EVSD, + _RDu, + _Det, + _MSD, + ), + ( + (ACTION, {_sN: _ac}), + (EVIDENCE, {_sN: _ev}), + (BOOLEAN, {_sN: _arc}), + (INTEGER, {_sN: _cou}), + (DETECTOR_ID, {_sN: _dI}), + (STRING, {_sN: _eFS}), + (STRING, {_sN: _eLS}), + (STRING, {_sN: _rR}), + (STRING, {_sN: _sNe}), + (STRING, {_sN: _uF}), + (SERVICE_ADDITIONAL_INFO, {_sN: _aId}), + (STRING, {_sN: _fNe}), + (EBS_VOLUME_SCAN_DETAILS, {_sN: _eVSD}), + (RUNTIME_DETAILS, {_sN: _rDu}), + (DETECTION, {_sN: _det}), + (MALWARE_SCAN_DETAILS, {_sN: _mSD}), + ), ) -KUBERNETES_CONFIGURATION_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#KubernetesConfigurationResult"), - members={ - "AuditLogs": { - "target": KUBERNETES_AUDIT_LOGS_CONFIGURATION_RESULT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="auditLogs"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, +FINDING: StaticSchema = ( + 18, + n0, + _Fin, + 0, + ( + _AIcc, + _Ar, + _Con, + _CA, + _De, + _Id, + _Par, + _Re, + _R, + _SV, + _Se, + _Sev, + _Tit, + _T, + _UAp, + _AASA, + ), + ( + (STRING, {_sN: _aIc, _sm: None}), + (STRING, {_sN: _ar, _sm: None}), + (DOUBLE, {_sN: _con}), + (STRING, {_sN: _cA, _sm: None}), + (STRING, {_sN: _de}), + (STRING, {_sN: _id, _sm: None}), + (STRING, {_sN: _par}), + (STRING, {_sN: _re, _sm: None}), + (RESOURCE, {_sN: _r, _sm: None}), + (STRING, {_sN: _sVc, _sm: None}), + (SERVICE, {_sN: _ser}), + (DOUBLE, {_sN: _sev, _sm: None}), + (STRING, {_sN: _ti}), + (FINDING_TYPE, {_sN: _t, _sm: None}), + (STRING, {_sN: _uAp, _sm: None}), + (STRING, {_sN: _aASA}), + ), ) -S3_LOGS_CONFIGURATION_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#S3LogsConfigurationResult"), - members={ - "Status": { - "target": DATA_SOURCE_STATUS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="status"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, +FINDINGS: StaticSchema = (16, n0, _Find, 0, (_me,), ((FINDING, 0),)) + +GROUPED_BY_ACCOUNT: StaticSchema = (16, n0, _GBA, 0, (_me,), ((ACCOUNT_STATISTICS, 0),)) + +GROUPED_BY_DATE: StaticSchema = (16, n0, _GBD, 0, (_me,), ((DATE_STATISTICS, 0),)) + +FINDING_TYPE_STATISTICS: StaticSchema = ( + 18, + n0, + _FTS, + 0, + (_FT, _LGA, _TF), + ((STRING, {_sN: _fTi}), (TIMESTAMP, {_sN: _lGA}), (INTEGER, {_sN: _tF})), ) -DATA_SOURCE_CONFIGURATIONS_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DataSourceConfigurationsResult"), - members={ - "CloudTrail": { - "target": CLOUD_TRAIL_CONFIGURATION_RESULT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="cloudTrail"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "DNSLogs": { - "target": DNS_LOGS_CONFIGURATION_RESULT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="dnsLogs"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "FlowLogs": { - "target": FLOW_LOGS_CONFIGURATION_RESULT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="flowLogs"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "S3Logs": { - "target": S3_LOGS_CONFIGURATION_RESULT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="s3Logs"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Kubernetes": { - "target": KUBERNETES_CONFIGURATION_RESULT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="kubernetes") - ], - }, - "MalwareProtection": { - "target": MALWARE_PROTECTION_CONFIGURATION_RESULT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="malwareProtection") - ], - }, - }, +GROUPED_BY_FINDING_TYPE: StaticSchema = ( + 16, + n0, + _GBFT, + 0, + (_me,), + ((FINDING_TYPE_STATISTICS, 0),), ) -DATA_SOURCE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DataSourceList"), - shape_type=ShapeType.LIST, - members={"member": {"target": DATA_SOURCE}}, -) - -DATE_STATISTICS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DateStatistics"), - members={ - "Date": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="date")], - }, - "LastGeneratedAt": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="lastGeneratedAt") - ], - }, - "Severity": { - "target": DOUBLE, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="severity")], - }, - "TotalFindings": { - "target": INTEGER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="totalFindings") - ], - }, - }, +RESOURCE_STATISTICS: StaticSchema = ( + 18, + n0, + _RSe, + 0, + (_AIcc, _LGA, _RIe, _RT, _TF), + ( + (STRING, {_sN: _aIc}), + (TIMESTAMP, {_sN: _lGA}), + (STRING, {_sN: _rIe}), + (STRING, {_sN: _rT}), + (INTEGER, {_sN: _tF}), + ), ) -DECLINE_INVITATIONS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DeclineInvitationsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#DeclineInvitationsRequest", - ) - ], - members={ - "AccountIds": { - "target": ACCOUNT_IDS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="accountIds"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, +GROUPED_BY_RESOURCE: StaticSchema = ( + 16, + n0, + _GBR, + 0, + (_me,), + ((RESOURCE_STATISTICS, 0),), +) + +SEVERITY_STATISTICS: StaticSchema = ( + 18, + n0, + _SSe, + 0, + (_LGA, _Sev, _TF), + ((TIMESTAMP, {_sN: _lGA}), (DOUBLE, {_sN: _sev}), (INTEGER, {_sN: _tF})), +) + +GROUPED_BY_SEVERITY: StaticSchema = ( + 16, + n0, + _GBS, + 0, + (_me,), + ((SEVERITY_STATISTICS, 0),), +) + +FINDING_STATISTICS: StaticSchema = ( + 18, + n0, + _FSi, + 0, + (_CBS, _GBA, _GBD, _GBFT, _GBR, _GBS), + ( + (COUNT_BY_SEVERITY, {_sN: _cBS}), + (GROUPED_BY_ACCOUNT, {_sN: _gBA}), + (GROUPED_BY_DATE, {_sN: _gBD}), + (GROUPED_BY_FINDING_TYPE, {_sN: _gBFT}), + (GROUPED_BY_RESOURCE, {_sN: _gBR}), + (GROUPED_BY_SEVERITY, {_sN: _gBS}), + ), ) -DECLINE_INVITATIONS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DeclineInvitationsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#DeclineInvitationsResponse", - ) - ], - members={ - "UnprocessedAccounts": { - "target": UNPROCESSED_ACCOUNTS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="unprocessedAccounts" - ), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, +FINDING_STATISTIC_TYPE: StaticSchema = ( + 14, + n0, + _FSTi, + 0, + (_CBS_,), + ((-1, {_sV: _CBS_}),), +) + +FINDING_STATISTIC_TYPES: StaticSchema = ( + 16, + n0, + _FSTin, + 0, + (_me,), + ((FINDING_STATISTIC_TYPE, 0),), +) + +GET_ADMINISTRATOR_ACCOUNT_INPUT: StaticSchema = ( + 18, + n0, + _GAAI, + {_sSI: _cGAAR, _s: None}, + (_DI,), + ((DETECTOR_ID, 9),), +) + +GET_ADMINISTRATOR_ACCOUNT_OUTPUT: StaticSchema = ( + 18, + n0, + _GAAO, + {_sSI: _cGAARo, _smi: None}, + (_Ad,), + ((ADMINISTRATOR, {_sN: _ad, _sm: None}),), +) + +GET_ADMINISTRATOR_ACCOUNT: StaticOperationSchema = ( + 23, + n0, + _GAA, + { + _smith: MappingProxyType( + { + "method": "GET", + "uri": "/detector/{DetectorId}/administrator", + "code": 200, + } + ) + }, + GET_ADMINISTRATOR_ACCOUNT_INPUT, + GET_ADMINISTRATOR_ACCOUNT_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +GET_COVERAGE_STATISTICS_INPUT: StaticSchema = ( + 18, + n0, + _GCSI, + {_sSI: _cGCSR, _s: None}, + (_DI, _FCil, _STt), + ( + (DETECTOR_ID, 9), + (COVERAGE_FILTER_CRITERIA, {_sN: _fCil}), + (COVERAGE_STATISTICS_TYPE_LIST, {_sN: _sTt, _sm: None}), + ), ) -DECLINE_INVITATIONS = Schema( - id=ShapeID("com.amazonaws.guardduty#DeclineInvitations"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/invitation/decline", "code": 200} - ), - ) - ], -) - -DEFAULT_SERVER_SIDE_ENCRYPTION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DefaultServerSideEncryption"), - members={ - "EncryptionType": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="encryptionType") - ], - }, - "KmsMasterKeyArn": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="kmsMasterKeyArn") - ], - }, - }, +GET_COVERAGE_STATISTICS_OUTPUT: StaticSchema = ( + 18, + n0, + _GCSO, + {_sSI: _cGCSRo, _smi: None}, + (_CSov,), + ((COVERAGE_STATISTICS, {_sN: _cSo}),), +) + +GET_COVERAGE_STATISTICS: StaticOperationSchema = ( + 23, + n0, + _GCS, + { + _smith: MappingProxyType( + { + "method": "POST", + "uri": "/detector/{DetectorId}/coverage/statistics", + "code": 200, + } + ) + }, + GET_COVERAGE_STATISTICS_INPUT, + GET_COVERAGE_STATISTICS_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +GET_CUSTOM_DETECTION_RULE_INPUT: StaticSchema = ( + 18, + n0, + _GCDRI, + {_sSI: _cGCDRR, _s: None}, + (_RI,), + ((RULE_ID, 9),), +) + +RULE_EXPRESSION: StaticSchema = (3, n0, _RE, 0) + +RULE_DEFINITION: StaticSchema = ( + 18, + n0, + _RDul, + 0, + (_Ex,), + ((RULE_EXPRESSION, {_sN: _ex, _sm: None}),), +) + +RULE_LANGUAGE: StaticSchema = (14, n0, _RL, 0, (_SQL,), ((-1, {_sV: _SQL}),)) + +RULE_NAME: StaticSchema = (3, n0, _RNu, 0) + +RULE_SCHEMA: StaticSchema = (14, n0, _RSu, 0, (_CT_,), ((-1, {_sV: _CT}),)) + +MITRE_TACTIC: StaticSchema = (3, n0, _MTi, 0) + +MITRE_TECHNIQUE: StaticSchema = (3, n0, _MTit, 0) + +RULE_DETAIL: StaticSchema = ( + 18, + n0, + _RDule, + 0, + (_RI, _Ar, _N, _De, _Sev, _DSa, _Tac, _Tec, _Se, _Def, _Lan, _Sch, _CA, _UAp), + ( + (RULE_ID, {_sN: _rI, _sm: None}), + (DETECTION_RULE_ARN, {_sN: _ar, _sm: None}), + (RULE_NAME, {_sN: _n, _sm: None}), + (DETECTION_RULE_DESCRIPTION, {_sN: _de, _sm: None}), + (DETECTION_RULE_SEVERITY, {_sN: _sev, _sm: None}), + (DETECTION_RULE_DATA_SOURCE, {_sN: _dSa, _sm: None}), + (MITRE_TACTIC, {_sN: _tac, _sm: None}), + (MITRE_TECHNIQUE, {_sN: _tec, _sm: None}), + (DETECTION_RULE_SERVICE_NAME, {_sN: _ser, _sm: None}), + (RULE_DEFINITION, {_sN: _def, _sm: None}), + (RULE_LANGUAGE, {_sN: _la}), + (RULE_SCHEMA, {_sN: _sch}), + (TIMESTAMP, {_sN: _cA, _sm: None}), + (TIMESTAMP, {_sN: _uAp}), + ), ) -DELETE_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DeleteCustomDetectionRuleAssociationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#DeleteCustomDetectionRuleAssociationRequest", - ) - ], - members={ - "RuleId": { - "target": RULE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "AssociationId": { - "target": ASSOCIATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, +GET_CUSTOM_DETECTION_RULE_OUTPUT: StaticSchema = ( + 18, + n0, + _GCDRO, + {_sSI: _cGCDRRo, _smi: None}, + (_Ru,), + ((RULE_DETAIL, {_sN: _ru, _sm: None}),), +) + +GET_CUSTOM_DETECTION_RULE: StaticOperationSchema = ( + 23, + n0, + _GCDR, + { + _smith: MappingProxyType( + { + "method": "GET", + "uri": "/custom-detection-rule/rule/{RuleId}", + "code": 200, + } + ) + }, + GET_CUSTOM_DETECTION_RULE_INPUT, + GET_CUSTOM_DETECTION_RULE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + BAD_REQUEST_EXCEPTION, + INTERNAL_SERVER_ERROR_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + ), ) -DELETE_CUSTOM_DETECTION_RULE_ASSOCIATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DeleteCustomDetectionRuleAssociationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#DeleteCustomDetectionRuleAssociationResponse", - ) - ], -) - -DELETE_CUSTOM_DETECTION_RULE_ASSOCIATION = Schema( - id=ShapeID("com.amazonaws.guardduty#DeleteCustomDetectionRuleAssociation"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/custom-detection-rule/rule/{RuleId}/association/{AssociationId}", - "code": 200, - } - ), - ) - ], +GET_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT: StaticSchema = ( + 18, + n0, + _GCDRAI, + {_sSI: _cGCDRAR, _s: None}, + (_RI, _AIs), + ((RULE_ID, 9), (ASSOCIATION_ID, 9)), +) + +GET_CUSTOM_DETECTION_RULE_ASSOCIATION_OUTPUT: StaticSchema = ( + 18, + n0, + _GCDRAO, + {_sSI: _cGCDRARo, _smi: None}, + (_RA, _Ta), + ((ASSOCIATION_DETAIL, {_sN: _rA, _sm: None}), (TAG_MAP, {_sN: _ta})), +) + +GET_CUSTOM_DETECTION_RULE_ASSOCIATION: StaticOperationSchema = ( + 23, + n0, + _GCDRA, + { + _smith: MappingProxyType( + { + "method": "GET", + "uri": "/custom-detection-rule/rule/{RuleId}/association/{AssociationId}", + "code": 200, + } + ) + }, + GET_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT, + GET_CUSTOM_DETECTION_RULE_ASSOCIATION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + BAD_REQUEST_EXCEPTION, + INTERNAL_SERVER_ERROR_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + ), ) -DELETE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.guardduty#DeleteCustomDetectionRuleOrgConfigurationInput" +GET_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT: StaticSchema = ( + 18, + n0, + _GCDROCI, + {_sSI: _cGCDROCR, _s: None}, + (_RI, _Mo), + ((RULE_ID, 9), (ASSOCIATION_MODE, {_sQ: _mo, _sm: None})), +) + +GET_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_OUTPUT: StaticSchema = ( + 18, + n0, + _GCDROCO, + {_sSI: _cGCDROCRo, _smi: None}, + (_Conf,), + ((DETECTION_RULE_ORG_CONFIGURATION, {_sN: _conf, _sm: None}),), +) + +GET_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION: StaticOperationSchema = ( + 23, + n0, + _GCDROC, + { + _smith: MappingProxyType( + { + "method": "GET", + "uri": "/custom-detection-rule/org-configuration/{RuleId}", + "code": 200, + } + ) + }, + GET_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT, + GET_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + BAD_REQUEST_EXCEPTION, + INTERNAL_SERVER_ERROR_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#DeleteCustomDetectionRuleOrgConfigurationRequest", - ) - ], - members={ - "RuleId": { - "target": RULE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Mode": { - "target": ASSOCIATION_MODE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="mode"), - ], - }, - }, ) -DELETE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.guardduty#DeleteCustomDetectionRuleOrgConfigurationOutput" +GET_DETECTOR_INPUT: StaticSchema = ( + 18, + n0, + _GDI, + {_sSI: _cGDR, _s: None}, + (_DI,), + ((DETECTOR_ID, 9),), +) + +GET_DETECTOR_OUTPUT: StaticSchema = ( + 18, + n0, + _GDO, + {_sSI: _cGDRo, _smi: None}, + (_CA, _FPF, _SR, _St, _UAp, _DS, _Ta, _F), + ( + (STRING, {_sN: _cA}), + (FINDING_PUBLISHING_FREQUENCY, {_sN: _fPF}), + (STRING, {_sN: _sR, _sm: None}), + (DETECTOR_STATUS, {_sN: _st, _sm: None}), + (STRING, {_sN: _uAp}), + (DATA_SOURCE_CONFIGURATIONS_RESULT, {_sN: _dS}), + (TAG_MAP, {_sN: _ta}), + (DETECTOR_FEATURE_CONFIGURATIONS_RESULTS, {_sN: _f}), ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#DeleteCustomDetectionRuleOrgConfigurationResponse", - ) - ], -) - -DELETE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION = Schema( - id=ShapeID("com.amazonaws.guardduty#DeleteCustomDetectionRuleOrgConfiguration"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/custom-detection-rule/org-configuration/{RuleId}", - "code": 200, - } - ), - ) - ], ) -DELETE_DETECTOR_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DeleteDetectorInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#DeleteDetectorRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, +GET_DETECTOR: StaticOperationSchema = ( + 23, + n0, + _GD, + { + _smith: MappingProxyType( + {"method": "GET", "uri": "/detector/{DetectorId}", "code": 200} + ) + }, + GET_DETECTOR_INPUT, + GET_DETECTOR_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +GET_FILTER_INPUT: StaticSchema = ( + 18, + n0, + _GFIe, + {_sSI: _cGFR, _s: None}, + (_DI, _FN), + ((DETECTOR_ID, 9), (STRING, 9)), +) + +GET_FILTER_OUTPUT: StaticSchema = ( + 18, + n0, + _GFO, + {_sSI: _cGFRo, _smi: None}, + (_N, _De, _Ac, _Ra, _FCin, _Ta, _CA, _UAp, _Ve), + ( + (FILTER_NAME, {_sN: _n, _sm: None}), + (FILTER_DESCRIPTION, {_sN: _de}), + (FILTER_ACTION, {_sN: _ac, _sm: None}), + (FILTER_RANK, {_sN: _ra}), + (FINDING_CRITERIA, {_sN: _fCin, _sm: None}), + (TAG_MAP, {_sN: _ta}), + (TIMESTAMP, {_sN: _cA}), + (TIMESTAMP, {_sN: _uAp}), + (FILTER_VERSION, {_sN: _ver}), + ), ) -DELETE_DETECTOR_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DeleteDetectorOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#DeleteDetectorResponse", - ) - ], -) - -DELETE_DETECTOR = Schema( - id=ShapeID("com.amazonaws.guardduty#DeleteDetector"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "DELETE", "uri": "/detector/{DetectorId}", "code": 200} - ), - ) - ], +GET_FILTER: StaticOperationSchema = ( + 23, + n0, + _GF, + { + _smith: MappingProxyType( + { + "method": "GET", + "uri": "/detector/{DetectorId}/filter/{FilterName}", + "code": 200, + } + ) + }, + GET_FILTER_INPUT, + GET_FILTER_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +GET_FINDINGS_INPUT: StaticSchema = ( + 18, + n0, + _GFIet, + {_sSI: _cGFRom, _s: None}, + (_DI, _FIi, _SCo), + ( + (DETECTOR_ID, 9), + (FINDING_IDS, {_sN: _fI, _sm: None}), + (SORT_CRITERIA, {_sN: _sCo}), + ), ) -DELETE_FILTER_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DeleteFilterInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#DeleteFilterRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "FilterName": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, +GET_FINDINGS_OUTPUT: StaticSchema = ( + 18, + n0, + _GFOe, + {_sSI: _cGFRoma, _smi: None}, + (_Find,), + ((FINDINGS, {_sN: _fin, _sm: None}),), +) + +GET_FINDINGS: StaticOperationSchema = ( + 23, + n0, + _GFe, + { + _smith: MappingProxyType( + { + "method": "POST", + "uri": "/detector/{DetectorId}/findings/get", + "code": 200, + } + ) + }, + GET_FINDINGS_INPUT, + GET_FINDINGS_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +GROUP_BY_TYPE: StaticSchema = ( + 14, + n0, + _GBT, + 0, + (_ACCOUNT, _DATE, _FT_, _RESOURCE, _SEVERITY), + ( + (-1, {_sV: _ACCOUNT}), + (-1, {_sV: _DATE}), + (-1, {_sV: _FT_}), + (-1, {_sV: _RESOURCE}), + (-1, {_sV: _SEVERITY}), + ), ) -DELETE_FILTER_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DeleteFilterOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#DeleteFilterResponse", - ) - ], -) - -DELETE_FILTER = Schema( - id=ShapeID("com.amazonaws.guardduty#DeleteFilter"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/detector/{DetectorId}/filter/{FilterName}", - "code": 200, - } - ), - ) - ], +MAX_RESULTS100: StaticSchema = (7, n0, _MRa, 0) + +GET_FINDINGS_STATISTICS_INPUT: StaticSchema = ( + 18, + n0, + _GFSI, + {_sSI: _cGFSR, _s: None}, + (_DI, _FSTin, _FCin, _GB, _OB, _MR), + ( + (DETECTOR_ID, 9), + (FINDING_STATISTIC_TYPES, {_sN: _fSTi}), + (FINDING_CRITERIA, {_sN: _fCin}), + (GROUP_BY_TYPE, {_sN: _gB}), + (ORDER_BY, {_sN: _oB}), + (MAX_RESULTS100, {_sN: _mR}), + ), ) -DELETE_INVITATIONS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DeleteInvitationsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#DeleteInvitationsRequest", - ) - ], - members={ - "AccountIds": { - "target": ACCOUNT_IDS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="accountIds"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, +GET_FINDINGS_STATISTICS_OUTPUT: StaticSchema = ( + 18, + n0, + _GFSO, + {_sSI: _cGFSRo, _smi: None}, + (_FSi, _NT), + ((FINDING_STATISTICS, {_sN: _fS, _sm: None}), (STRING, {_sN: _nT})), +) + +GET_FINDINGS_STATISTICS: StaticOperationSchema = ( + 23, + n0, + _GFS, + { + _smith: MappingProxyType( + { + "method": "POST", + "uri": "/detector/{DetectorId}/findings/statistics", + "code": 200, + } + ) + }, + GET_FINDINGS_STATISTICS_INPUT, + GET_FINDINGS_STATISTICS_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +GET_INVESTIGATION_INPUT: StaticSchema = ( + 18, + n0, + _GII, + {_sSI: _cGIR, _s: None}, + (_DI, _IInv), + ((DETECTOR_ID, 9), (INVESTIGATION_ID, 9)), +) + +INVESTIGATION_ERROR_DETAILS: StaticSchema = (3, n0, _IED, 0) + +PRODUCT: StaticSchema = ( + 18, + n0, + _Prod, + 0, + (_N, _Fea), + ((STRING, {_sN: _n, _sm: None}), (STRING, {_sN: _fe})), +) + +INVESTIGATION_METADATA: StaticSchema = ( + 18, + n0, + _IM, + 0, + (_Ve, _Prod), + ((STRING, {_sN: _ver, _sm: None}), (PRODUCT, {_sN: _prod, _sm: None})), +) + +RISK_DETAILS: StaticSchema = (3, n0, _RDi, 0) + +RISK_LEVEL: StaticSchema = ( + 14, + n0, + _RLi, + 0, + (_INFO, _LOW, _MEDIUM, _HIGH, _CRITICAL), + ( + (-1, {_sV: _Inf}), + (-1, {_sV: _Low}), + (-1, {_sV: _Me}), + (-1, {_sV: _H}), + (-1, {_sV: _Cri}), + ), ) -DELETE_INVITATIONS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DeleteInvitationsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#DeleteInvitationsResponse", - ) - ], - members={ - "UnprocessedAccounts": { - "target": UNPROCESSED_ACCOUNTS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="unprocessedAccounts" - ), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, +INVESTIGATION_STATUS: StaticSchema = ( + 14, + n0, + _ISn, + 0, + (_RUNNING, _COMPLETED, _FAILED), + ((-1, {_sV: _RUNNING}), (-1, {_sV: _COMPLETED}), (-1, {_sV: _FAILED})), +) + +TRIGGERED_BY: StaticSchema = (3, n0, _TBr, 0) + +INVESTIGATION: StaticSchema = ( + 18, + n0, + _Inv, + 0, + (_IInv, _St, _TP, _TBr, _Met, _Cl, _RLi, _Ri, _Con, _Sum, _ST, _ET, _Er), + ( + (INVESTIGATION_ID, {_sN: _iInv, _sm: None}), + (INVESTIGATION_STATUS, {_sN: _st, _sm: None}), + (TRIGGER_PROMPT, {_sN: _tP, _sm: None}), + (TRIGGERED_BY, {_sN: _tBr, _sm: None}), + (INVESTIGATION_METADATA, {_sN: _met}), + (CLOUD_DETAILS, {_sN: _cl}), + (RISK_LEVEL, {_sN: _rL}), + (RISK_DETAILS, {_sN: _ri}), + (CONFIDENCE, {_sN: _con}), + (STRING, {_sN: _sum}), + (TIMESTAMP, {_sN: _sT}), + (TIMESTAMP, {_sN: _eT}), + (INVESTIGATION_ERROR_DETAILS, {_sN: _er}), + ), ) -DELETE_INVITATIONS = Schema( - id=ShapeID("com.amazonaws.guardduty#DeleteInvitations"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/invitation/delete", "code": 200} - ), - ) - ], +GET_INVESTIGATION_OUTPUT: StaticSchema = ( + 18, + n0, + _GIO, + {_sSI: _cGIRo, _smi: None}, + (_Inv,), + ((INVESTIGATION, {_sN: _in, _sm: None}),), +) + +GET_INVESTIGATION: StaticOperationSchema = ( + 23, + n0, + _GIe, + { + _smith: MappingProxyType( + { + "method": "GET", + "uri": "/detector/{DetectorId}/investigation/{InvestigationId}", + "code": 200, + } + ) + }, + GET_INVESTIGATION_INPUT, + GET_INVESTIGATION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + BAD_REQUEST_EXCEPTION, + INTERNAL_SERVER_ERROR_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + ), ) -DELETE_IP_SET_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DeleteIPSetInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#DeleteIPSetRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "IpSetId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, +GET_INVITATIONS_COUNT_INPUT: StaticSchema = (18, n0, _GICI, {_sSI: _cGICR, _s: None}) + +GET_INVITATIONS_COUNT_OUTPUT: StaticSchema = ( + 18, + n0, + _GICO, + {_sSI: _cGICRo, _smi: None}, + (_ICn,), + ((INTEGER, {_sN: _iCn}),), +) + +GET_INVITATIONS_COUNT: StaticOperationSchema = ( + 23, + n0, + _GIC, + { + _smith: MappingProxyType( + {"method": "GET", "uri": "/invitation/count", "code": 200} + ) + }, + GET_INVITATIONS_COUNT_INPUT, + GET_INVITATIONS_COUNT_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +GET_IP_SET_INPUT: StaticSchema = ( + 18, + n0, + _GIPSI, + {_sSI: _cGIPSR, _s: None}, + (_DI, _ISI), + ((DETECTOR_ID, 9), (STRING, 9)), +) + +IP_SET_STATUS: StaticSchema = ( + 14, + n0, + _ISS, + 0, + (_INACTIVE, _ACTIVATING, _ACTIVE, _DEACTIVATING, _ERROR, _DP_, _DELETED), + ( + (-1, {_sV: _INACTIVE}), + (-1, {_sV: _ACTIVATING}), + (-1, {_sV: _ACTIVE}), + (-1, {_sV: _DEACTIVATING}), + (-1, {_sV: _ERROR}), + (-1, {_sV: _DP_}), + (-1, {_sV: _DELETED}), + ), ) -DELETE_IP_SET_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DeleteIPSetOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#DeleteIPSetResponse", - ) - ], -) - -DELETE_IP_SET = Schema( - id=ShapeID("com.amazonaws.guardduty#DeleteIPSet"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/detector/{DetectorId}/ipset/{IpSetId}", - "code": 200, - } - ), - ) - ], +GET_IP_SET_OUTPUT: StaticSchema = ( + 18, + n0, + _GIPSO, + {_sSI: _cGIPSRo, _smi: None}, + (_N, _Fo, _Loc, _St, _Ta, _EBO), + ( + (NAME, {_sN: _n, _sm: None}), + (IP_SET_FORMAT, {_sN: _fo, _sm: None}), + (LOCATION, {_sN: _loc, _sm: None}), + (IP_SET_STATUS, {_sN: _st, _sm: None}), + (TAG_MAP, {_sN: _ta}), + (ACCOUNT_ID, {_sN: _eBO}), + ), ) -DELETE_MALWARE_PROTECTION_PLAN_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DeleteMalwareProtectionPlanInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#DeleteMalwareProtectionPlanRequest", - ) - ], - members={ - "MalwareProtectionPlanId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, +GET_IP_SET: StaticOperationSchema = ( + 23, + n0, + _GIPS, + { + _smith: MappingProxyType( + { + "method": "GET", + "uri": "/detector/{DetectorId}/ipset/{IpSetId}", + "code": 200, + } + ) + }, + GET_IP_SET_INPUT, + GET_IP_SET_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +GET_MALWARE_PROTECTION_PLAN_INPUT: StaticSchema = ( + 18, + n0, + _GMPPI, + {_sSI: _cGMPPR, _s: None}, + (_MPPI,), + ((STRING, 9),), +) + +MALWARE_PROTECTION_PLAN_STATUS: StaticSchema = ( + 14, + n0, + _MPPS, + 0, + (_ACTIVE, _WARNING, _ERROR), + ((-1, {_sV: _ACTIVE}), (-1, {_sV: _WARNING}), (-1, {_sV: _ERROR})), +) + +MALWARE_PROTECTION_PLAN_STATUS_REASON: StaticSchema = ( + 18, + n0, + _MPPSR, + 0, + (_Cod, _M), + ((STRING, {_sN: _cod}), (STRING, {_sN: _m})), +) + +MALWARE_PROTECTION_PLAN_STATUS_REASONS_LIST: StaticSchema = ( + 16, + n0, + _MPPSRL, + 0, + (_me,), + ((MALWARE_PROTECTION_PLAN_STATUS_REASON, 0),), +) + +GET_MALWARE_PROTECTION_PLAN_OUTPUT: StaticSchema = ( + 18, + n0, + _GMPPO, + {_sSI: _cGMPPRo, _smi: None}, + (_Ar, _Ro, _PR, _Actio, _CA, _St, _SRta, _Ta), + ( + (STRING, {_sN: _ar}), + (STRING, {_sN: _ro}), + (CREATE_PROTECTED_RESOURCE, {_sN: _pR}), + (MALWARE_PROTECTION_PLAN_ACTIONS, {_sN: _acti}), + (TIMESTAMP, {_sN: _cA}), + (MALWARE_PROTECTION_PLAN_STATUS, {_sN: _st}), + (MALWARE_PROTECTION_PLAN_STATUS_REASONS_LIST, {_sN: _sRta}), + (TAG_MAP, {_sN: _ta}), + ), ) -DELETE_MALWARE_PROTECTION_PLAN_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DeleteMalwareProtectionPlanOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -DELETE_MALWARE_PROTECTION_PLAN = Schema( - id=ShapeID("com.amazonaws.guardduty#DeleteMalwareProtectionPlan"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/malware-protection-plan/{MalwareProtectionPlanId}", - "code": 200, - } - ), - ) - ], +GET_MALWARE_PROTECTION_PLAN: StaticOperationSchema = ( + 23, + n0, + _GMPP, + { + _smith: MappingProxyType( + { + "method": "GET", + "uri": "/malware-protection-plan/{MalwareProtectionPlanId}", + "code": 200, + } + ) + }, + GET_MALWARE_PROTECTION_PLAN_INPUT, + GET_MALWARE_PROTECTION_PLAN_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + BAD_REQUEST_EXCEPTION, + INTERNAL_SERVER_ERROR_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + ), ) -DELETE_MEMBERS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DeleteMembersInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#DeleteMembersRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "AccountIds": { - "target": ACCOUNT_IDS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="accountIds"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - }, +GET_MALWARE_SCAN_INPUT: StaticSchema = ( + 18, + n0, + _GMSI, + {_sSI: _cGMSR, _s: None}, + (_SIc,), + ((STRING, 9),), +) + +NON_NEGATIVE_INTEGER: StaticSchema = (7, n0, _NNI, 0) + +MALWARE_PROTECTION_RESOURCE_TYPE: StaticSchema = ( + 14, + n0, + _MPRT, + 0, + (_ERP, _ES_, _EV__, _EA_, _EI_, _ERP_, _SRP, _SB_, _SPITR), + ( + (-1, {_sV: _ERP}), + (-1, {_sV: _ES_}), + (-1, {_sV: _EV__}), + (-1, {_sV: _EA_}), + (-1, {_sV: _EI_}), + (-1, {_sV: _ERP_}), + (-1, {_sV: _SRP}), + (-1, {_sV: _SB_}), + (-1, {_sV: _SPITR}), + ), ) -DELETE_MEMBERS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DeleteMembersOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#DeleteMembersResponse", - ) - ], - members={ - "UnprocessedAccounts": { - "target": UNPROCESSED_ACCOUNTS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="unprocessedAccounts" - ), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, +SCAN_CONFIGURATION_RECOVERY_POINT: StaticSchema = ( + 18, + n0, + _SCRP, + 0, + (_BVN, _CSD), + ( + (NON_EMPTY_STRING, {_sN: _bVN}), + (SCAN_CONFIGURATION_CONTINUOUS_SCAN_DETAILS, {_sN: _cSD}), + ), ) -DELETE_MEMBERS = Schema( - id=ShapeID("com.amazonaws.guardduty#DeleteMembers"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/detector/{DetectorId}/member/delete", - "code": 200, - } - ), - ) - ], +SCAN_CONFIGURATION: StaticSchema = ( + 18, + n0, + _SCca, + 0, + (_Ro, _TD, _ISD, _RP), + ( + (NON_EMPTY_STRING, {_sN: _ro}), + (TRIGGER_DETAILS, {_sN: _tD}), + (INCREMENTAL_SCAN_DETAILS, {_sN: _iSD}), + (SCAN_CONFIGURATION_RECOVERY_POINT, {_sN: _rP}), + ), ) -DELETE_PUBLISHING_DESTINATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DeletePublishingDestinationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#DeletePublishingDestinationRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "DestinationId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, +SCANNED_RESOURCE_DETAILS: StaticSchema = ( + 18, + n0, + _SRDc, + 0, + (_EVb, _ES), + ((VOLUME_DETAIL, {_sN: _eVb}), (EBS_SNAPSHOT, {_sN: _eSb})), +) + +MALWARE_PROTECTION_SCAN_STATUS: StaticSchema = ( + 14, + n0, + _MPSS, + 0, + (_RUNNING, _COMPLETED, _CWI, _FAILED, _SKIPPED), + ( + (-1, {_sV: _RUNNING}), + (-1, {_sV: _COMPLETED}), + (-1, {_sV: _CWI}), + (-1, {_sV: _FAILED}), + (-1, {_sV: _SKIPPED}), + ), ) -DELETE_PUBLISHING_DESTINATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DeletePublishingDestinationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#DeletePublishingDestinationResponse", - ) - ], -) - -DELETE_PUBLISHING_DESTINATION = Schema( - id=ShapeID("com.amazonaws.guardduty#DeletePublishingDestination"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/detector/{DetectorId}/publishingDestination/{DestinationId}", - "code": 200, - } - ), - ) - ], +SCAN_STATUS_REASON: StaticSchema = ( + 14, + n0, + _SSR, + 0, + ( + _AD_, + _RNF, + _SSLE, + _RU_, + _IS__, + _IND, + _NEVF, + _UPCT, + _ASLE, + _UR, + _BRNS, + _BCAT, + _UFI, + _UA__, + _US, + _UCRP, + _AFSOF, + ), + ( + (-1, {_sV: _AD_}), + (-1, {_sV: _RNF}), + (-1, {_sV: _SSLE}), + (-1, {_sV: _RU_}), + (-1, {_sV: _IS__}), + (-1, {_sV: _IND}), + (-1, {_sV: _NEVF}), + (-1, {_sV: _UPCT}), + (-1, {_sV: _ASLE}), + (-1, {_sV: _UR}), + (-1, {_sV: _BRNS}), + (-1, {_sV: _BCAT}), + (-1, {_sV: _UFI}), + (-1, {_sV: _UA__}), + (-1, {_sV: _US}), + (-1, {_sV: _UCRP}), + (-1, {_sV: _AFSOF}), + ), ) -DELETE_THREAT_ENTITY_SET_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DeleteThreatEntitySetInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#DeleteThreatEntitySetRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "ThreatEntitySetId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, +SCANNED_RESOURCE: StaticSchema = ( + 18, + n0, + _SRca, + 0, + (_SRA, _SRT, _SRS, _SSR, _RD), + ( + (NON_EMPTY_STRING, {_sN: _sRA}), + (MALWARE_PROTECTION_RESOURCE_TYPE, {_sN: _sRT}), + (MALWARE_PROTECTION_SCAN_STATUS, {_sN: _sRS}), + (SCAN_STATUS_REASON, {_sN: _sSR}), + (SCANNED_RESOURCE_DETAILS, {_sN: _rD}), + ), ) -DELETE_THREAT_ENTITY_SET_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DeleteThreatEntitySetOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#DeleteThreatEntitySetResponse", - ) - ], -) - -DELETE_THREAT_ENTITY_SET = Schema( - id=ShapeID("com.amazonaws.guardduty#DeleteThreatEntitySet"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/detector/{DetectorId}/threatentityset/{ThreatEntitySetId}", - "code": 200, - } - ), - ) - ], +SCANNED_RESOURCES: StaticSchema = (16, n0, _SRcan, 0, (_me,), ((SCANNED_RESOURCE, 0),)) + +SCAN_RESULT_STATUS: StaticSchema = ( + 14, + n0, + _SRSc, + 0, + (_NTF, _TF_), + ((-1, {_sV: _NTF}), (-1, {_sV: _TF_})), +) + +SCAN_RESULT_THREAT: StaticSchema = ( + 18, + n0, + _SRTc, + 0, + (_N, _Sou, _Cou, _Ha, _IDt), + ( + (NON_EMPTY_STRING, {_sN: _n}), + (DETECTION_SOURCE, {_sN: _sou}), + (POSITIVE_LONG, {_sN: _cou}), + (NON_EMPTY_STRING, {_sN: _h}), + (ITEM_DETAILS_LIST, {_sN: _iDt}), + ), ) -DELETE_THREAT_INTEL_SET_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DeleteThreatIntelSetInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#DeleteThreatIntelSetRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "ThreatIntelSetId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, +SCAN_RESULT_THREATS: StaticSchema = ( + 16, + n0, + _SRTca, + 0, + (_me,), + ((SCAN_RESULT_THREAT, 0),), +) + +GET_MALWARE_SCAN_RESULT_DETAILS: StaticSchema = ( + 18, + n0, + _GMSRD, + 0, + (_SRSc, _SFC, _FFC, _TFFC, _TFC, _TB, _UTC, _Thr), + ( + (SCAN_RESULT_STATUS, {_sN: _sRSc}), + (POSITIVE_LONG, {_sN: _sFC}), + (POSITIVE_LONG, {_sN: _fFC}), + (POSITIVE_LONG, {_sN: _tFFC}), + (POSITIVE_LONG, {_sN: _tFC}), + (POSITIVE_LONG, {_sN: _tB}), + (POSITIVE_LONG, {_sN: _uTC}), + (SCAN_RESULT_THREATS, {_sN: _th}), + ), ) -DELETE_THREAT_INTEL_SET_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DeleteThreatIntelSetOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#DeleteThreatIntelSetResponse", - ) - ], -) - -DELETE_THREAT_INTEL_SET = Schema( - id=ShapeID("com.amazonaws.guardduty#DeleteThreatIntelSet"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/detector/{DetectorId}/threatintelset/{ThreatIntelSetId}", - "code": 200, - } - ), - ) - ], +GET_MALWARE_SCAN_OUTPUT: StaticSchema = ( + 18, + n0, + _GMSO, + {_sSI: _cGMSRo, _smi: None}, + ( + _SIc, + _DI, + _ADI, + _RAe, + _RT, + _SRC, + _SRCk, + _FRC, + _SRcan, + _SCca, + _SCc, + _SSc, + _SSR, + _STc, + _SSA, + _SCA, + _SRD, + ), + ( + (NON_EMPTY_STRING, {_sN: _sI}), + (DETECTOR_ID, {_sN: _dI}), + (DETECTOR_ID, {_sN: _aDI}), + (NON_EMPTY_STRING, {_sN: _rAe}), + (MALWARE_PROTECTION_RESOURCE_TYPE, {_sN: _rT}), + (NON_NEGATIVE_INTEGER, {_sN: _sRC}), + (NON_NEGATIVE_INTEGER, {_sN: _sRCk}), + (NON_NEGATIVE_INTEGER, {_sN: _fRC}), + (SCANNED_RESOURCES, {_sN: _sRca}), + (SCAN_CONFIGURATION, {_sN: _sCca}), + (SCAN_CATEGORY, {_sN: _sCc}), + (MALWARE_PROTECTION_SCAN_STATUS, {_sN: _sS}), + (SCAN_STATUS_REASON, {_sN: _sSR}), + (MALWARE_PROTECTION_SCAN_TYPE, {_sN: _sTc}), + (TIMESTAMP, {_sN: _sSA}), + (TIMESTAMP, {_sN: _sCA}), + (GET_MALWARE_SCAN_RESULT_DETAILS, {_sN: _sRD}), + ), ) -DELETE_TRUSTED_ENTITY_SET_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DeleteTrustedEntitySetInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#DeleteTrustedEntitySetRequest", +GET_MALWARE_SCAN: StaticOperationSchema = ( + 23, + n0, + _GMS, + { + _smith: MappingProxyType( + {"method": "GET", "uri": "/malware-scan/{ScanId}", "code": 200} ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "TrustedEntitySetId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, }, + GET_MALWARE_SCAN_INPUT, + GET_MALWARE_SCAN_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + INTERNAL_SERVER_ERROR_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + ), ) -DELETE_TRUSTED_ENTITY_SET_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DeleteTrustedEntitySetOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#DeleteTrustedEntitySetResponse", - ) - ], -) - -DELETE_TRUSTED_ENTITY_SET = Schema( - id=ShapeID("com.amazonaws.guardduty#DeleteTrustedEntitySet"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/detector/{DetectorId}/trustedentityset/{TrustedEntitySetId}", - "code": 200, - } - ), - ) - ], -) - -LONG_VALUE = Schema( - id=ShapeID("com.amazonaws.guardduty#LongValue"), shape_type=ShapeType.LONG -) - -FILTER_CONDITION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#FilterCondition"), - members={ - "EqualsValue": { - "target": NON_EMPTY_STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="equalsValue") - ], - }, - "GreaterThan": { - "target": LONG_VALUE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="greaterThan") - ], - }, - "LessThan": { - "target": LONG_VALUE, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="lessThan")], - }, - }, +GET_MALWARE_SCAN_SETTINGS_INPUT: StaticSchema = ( + 18, + n0, + _GMSSI, + {_sSI: _cGMSSR, _s: None}, + (_DI,), + ((DETECTOR_ID, 9),), +) + +SCAN_CRITERION_KEY: StaticSchema = (14, n0, _SCK, 0, (_EIT,), ((-1, {_sV: _EIT}),)) + +SCAN_CONDITION_PAIR: StaticSchema = ( + 18, + n0, + _SCP, + 0, + (_Ke, _Va), + ((TAG_KEY, {_sN: _ke, _sm: None}), (TAG_VALUE, {_sN: _v})), +) + +MAP_EQUALS: StaticSchema = (16, n0, _ME, 0, (_me,), ((SCAN_CONDITION_PAIR, 0),)) + +SCAN_CONDITION: StaticSchema = ( + 18, + n0, + _SCcan, + 0, + (_ME,), + ((MAP_EQUALS, {_sN: _mE, _sm: None}),), +) + +SCAN_CRITERION: StaticSchema = ( + 17, + n0, + _SCcanr, + 0, + (_ke, _v), + ((SCAN_CRITERION_KEY, 0), (SCAN_CONDITION, 0)), +) + +SCAN_RESOURCE_CRITERIA: StaticSchema = ( + 18, + n0, + _SRCc, + 0, + (_Inc, _Exc), + ((SCAN_CRITERION, {_sN: _inc}), (SCAN_CRITERION, {_sN: _exc})), +) + +GET_MALWARE_SCAN_SETTINGS_OUTPUT: StaticSchema = ( + 18, + n0, + _GMSSO, + {_sSI: _cGMSSRo, _smi: None}, + (_SRCc, _ESP), + ((SCAN_RESOURCE_CRITERIA, {_sN: _sRCc}), (EBS_SNAPSHOT_PRESERVATION, {_sN: _eSP})), +) + +GET_MALWARE_SCAN_SETTINGS: StaticOperationSchema = ( + 23, + n0, + _GMSS, + { + _smith: MappingProxyType( + { + "method": "GET", + "uri": "/detector/{DetectorId}/malware-scan-settings", + "code": 200, + } + ) + }, + GET_MALWARE_SCAN_SETTINGS_INPUT, + GET_MALWARE_SCAN_SETTINGS_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +GET_MASTER_ACCOUNT_INPUT: StaticSchema = ( + 18, + n0, + _GMAI, + {_sSI: _cGMAR, _s: None}, + (_DI,), + ((DETECTOR_ID, 9),), +) + +MASTER: StaticSchema = ( + 18, + n0, + _Mas, + 0, + (_AIcc, _II, _RS, _IA), + ( + (ACCOUNT_ID, {_sN: _aIc}), + (STRING, {_sN: _iI}), + (STRING, {_sN: _rS}), + (STRING, {_sN: _iA}), + ), ) -FILTER_CRITERION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#FilterCriterion"), - members={ - "CriterionKey": { - "target": CRITERION_KEY, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="criterionKey") - ], - }, - "FilterCondition": { - "target": FILTER_CONDITION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="filterCondition") - ], - }, - }, +GET_MASTER_ACCOUNT_OUTPUT: StaticSchema = ( + 18, + n0, + _GMAO, + {_sSI: _cGMARo, _smi: None}, + (_Mas,), + ((MASTER, {_sN: _mas, _sm: None}),), +) + +GET_MASTER_ACCOUNT: StaticOperationSchema = ( + 23, + n0, + _GMA, + { + _smith: MappingProxyType( + {"method": "GET", "uri": "/detector/{DetectorId}/master", "code": 200} + ) + }, + GET_MASTER_ACCOUNT_INPUT, + GET_MASTER_ACCOUNT_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +GET_MEMBER_DETECTORS_INPUT: StaticSchema = ( + 18, + n0, + _GMDI, + {_sSI: _cGMDR, _s: None}, + (_DI, _AIcco), + ((DETECTOR_ID, 9), (ACCOUNT_IDS, {_sN: _aIcc, _sm: None})), +) + +MEMBER_ADDITIONAL_CONFIGURATION_RESULT: StaticSchema = ( + 18, + n0, + _MACR, + 0, + (_N, _St, _UAp, _MB), + ( + (ORG_FEATURE_ADDITIONAL_CONFIGURATION, {_sN: _n}), + (FEATURE_STATUS, {_sN: _st}), + (TIMESTAMP, {_sN: _uAp}), + (MANAGED_BY, {_sN: _mB}), + ), ) -FILTER_CRITERION_LIST = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#FilterCriterionList"), - shape_type=ShapeType.LIST, - members={"member": {"target": FILTER_CRITERION}}, +MEMBER_ADDITIONAL_CONFIGURATION_RESULTS: StaticSchema = ( + 16, + n0, + _MACRe, + 0, + (_me,), + ((MEMBER_ADDITIONAL_CONFIGURATION_RESULT, 0),), +) + +MEMBER_FEATURES_CONFIGURATION_RESULT: StaticSchema = ( + 18, + n0, + _MFCR, + 0, + (_N, _St, _UAp, _ACd, _MB), + ( + (ORG_FEATURE, {_sN: _n}), + (FEATURE_STATUS, {_sN: _st}), + (TIMESTAMP, {_sN: _uAp}), + (MEMBER_ADDITIONAL_CONFIGURATION_RESULTS, {_sN: _aC}), + (MANAGED_BY, {_sN: _mB}), + ), ) -FILTER_CRITERIA = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#FilterCriteria"), - members={ - "FilterCriterion": { - "target": FILTER_CRITERION_LIST, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="filterCriterion") - ], - } - }, -) - -INTEGER_VALUE_WITH_MAX = Schema( - id=ShapeID("com.amazonaws.guardduty#IntegerValueWithMax"), - shape_type=ShapeType.INTEGER, -) - -SORT_CRITERIA = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#SortCriteria"), - members={ - "AttributeName": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="attributeName") - ], - }, - "OrderBy": { - "target": ORDER_BY, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="orderBy")], - }, - }, -) - -DESCRIBE_MALWARE_SCANS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DescribeMalwareScansInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#DescribeMalwareScansRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "NextToken": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="nextToken")], - }, - "MaxResults": { - "target": INTEGER_VALUE_WITH_MAX, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="maxResults") - ], - }, - "FilterCriteria": { - "target": FILTER_CRITERIA, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="filterCriteria") - ], - }, - "SortCriteria": { - "target": SORT_CRITERIA, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="sortCriteria") - ], - }, - }, -) - -VOLUME_DETAIL = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#VolumeDetail"), - members={ - "VolumeArn": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="volumeArn")], - }, - "VolumeType": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="volumeType") - ], - }, - "DeviceName": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="deviceName") - ], - }, - "VolumeSizeInGB": { - "target": INTEGER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="volumeSizeInGB") - ], - }, - "EncryptionType": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="encryptionType") - ], - }, - "SnapshotArn": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="snapshotArn") - ], - }, - "KmsKeyArn": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="kmsKeyArn")], - }, - }, -) - -VOLUME_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#VolumeDetails"), - shape_type=ShapeType.LIST, - members={"member": {"target": VOLUME_DETAIL}}, -) - -POSITIVE_LONG = Schema( - id=ShapeID("com.amazonaws.guardduty#PositiveLong"), shape_type=ShapeType.LONG -) - -INSTANCE_ARN = Schema( - id=ShapeID("com.amazonaws.guardduty#InstanceArn"), shape_type=ShapeType.STRING -) - -RESOURCE_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ResourceDetails"), - members={ - "InstanceArn": { - "target": INSTANCE_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="instanceArn") - ], - } - }, -) - -SCAN_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ScanResult"), - shape_type=ShapeType.ENUM, - members={"CLEAN": {"target": UNIT}, "INFECTED": {"target": UNIT}}, -) - -SCAN_RESULT_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ScanResultDetails"), - members={ - "ScanResult": { - "target": SCAN_RESULT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="scanResult") - ], - } - }, -) - -SCAN_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ScanStatus"), - shape_type=ShapeType.ENUM, - members={ - "RUNNING": {"target": UNIT}, - "COMPLETED": {"target": UNIT}, - "FAILED": {"target": UNIT}, - "SKIPPED": {"target": UNIT}, - }, -) - -SCAN_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ScanType"), - shape_type=ShapeType.ENUM, - members={"GUARDDUTY_INITIATED": {"target": UNIT}, "ON_DEMAND": {"target": UNIT}}, -) - -TRIGGER_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#TriggerType"), - shape_type=ShapeType.ENUM, - members={"BACKUP": {"target": UNIT}, "GUARDDUTY": {"target": UNIT}}, -) - -TRIGGER_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#TriggerDetails"), - members={ - "GuardDutyFindingId": { - "target": NON_EMPTY_STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="guardDutyFindingId") - ], - }, - "Description": { - "target": NON_EMPTY_STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="description") - ], - }, - "TriggerType": { - "target": TRIGGER_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="triggerType") - ], - }, - }, -) - -SCAN = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Scan"), - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="detectorId") - ], - }, - "AdminDetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="adminDetectorId") - ], - }, - "ScanId": { - "target": NON_EMPTY_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="scanId")], - }, - "ScanStatus": { - "target": SCAN_STATUS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="scanStatus") - ], - }, - "FailureReason": { - "target": NON_EMPTY_STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="failureReason") - ], - }, - "ScanStartTime": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="scanStartTime") - ], - }, - "ScanEndTime": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="scanEndTime") - ], - }, - "TriggerDetails": { - "target": TRIGGER_DETAILS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="triggerDetails") - ], - }, - "ResourceDetails": { - "target": RESOURCE_DETAILS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="resourceDetails") - ], - }, - "ScanResultDetails": { - "target": SCAN_RESULT_DETAILS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="scanResultDetails") - ], - }, - "AccountId": { - "target": ACCOUNT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="accountId")], - }, - "TotalBytes": { - "target": POSITIVE_LONG, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="totalBytes") - ], - }, - "FileCount": { - "target": POSITIVE_LONG, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="fileCount")], - }, - "AttachedVolumes": { - "target": VOLUME_DETAILS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="attachedVolumes") - ], - }, - "ScanType": { - "target": SCAN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="scanType")], - }, - }, -) - -SCANS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Scans"), - shape_type=ShapeType.LIST, - members={"member": {"target": SCAN}}, -) - -DESCRIBE_MALWARE_SCANS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DescribeMalwareScansOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#DescribeMalwareScansResponse", - ) - ], - members={ - "Scans": { - "target": SCANS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="scans"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "NextToken": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="nextToken")], - }, - }, -) - -DESCRIBE_MALWARE_SCANS = Schema( - id=ShapeID("com.amazonaws.guardduty#DescribeMalwareScans"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/detector/{DetectorId}/malware-scans", - "code": 200, - } - ), - ) - ], -) - -MAX_RESULTS = Schema( - id=ShapeID("com.amazonaws.guardduty#MaxResults"), shape_type=ShapeType.INTEGER -) - -DESCRIBE_ORGANIZATION_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DescribeOrganizationConfigurationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#DescribeOrganizationConfigurationRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "MaxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "NextToken": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - }, -) - -ORGANIZATION_KUBERNETES_AUDIT_LOGS_CONFIGURATION_RESULT = Schema.collection( - id=ShapeID( - "com.amazonaws.guardduty#OrganizationKubernetesAuditLogsConfigurationResult" +MEMBER_FEATURES_CONFIGURATIONS_RESULTS: StaticSchema = ( + 16, + n0, + _MFCRe, + 0, + (_me,), + ((MEMBER_FEATURES_CONFIGURATION_RESULT, 0),), +) + +MEMBER_DATA_SOURCE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _MDSC, + 0, + (_AIcc, _DS, _F), + ( + (ACCOUNT_ID, {_sN: _aIc, _sm: None}), + (DATA_SOURCE_CONFIGURATIONS_RESULT, {_sN: _dS, _sm: None}), + (MEMBER_FEATURES_CONFIGURATIONS_RESULTS, {_sN: _f}), ), - members={ - "AutoEnable": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="autoEnable"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, -) - -ORGANIZATION_KUBERNETES_CONFIGURATION_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#OrganizationKubernetesConfigurationResult"), - members={ - "AuditLogs": { - "target": ORGANIZATION_KUBERNETES_AUDIT_LOGS_CONFIGURATION_RESULT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="auditLogs"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, -) - -ORGANIZATION_EBS_VOLUMES_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#OrganizationEbsVolumesResult"), - members={ - "AutoEnable": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="autoEnable") - ], - } - }, -) - -ORGANIZATION_SCAN_EC2_INSTANCE_WITH_FINDINGS_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#OrganizationScanEc2InstanceWithFindingsResult"), - members={ - "EbsVolumes": { - "target": ORGANIZATION_EBS_VOLUMES_RESULT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="ebsVolumes") - ], - } - }, ) -ORGANIZATION_MALWARE_PROTECTION_CONFIGURATION_RESULT = Schema.collection( - id=ShapeID( - "com.amazonaws.guardduty#OrganizationMalwareProtectionConfigurationResult" +MEMBER_DATA_SOURCE_CONFIGURATIONS: StaticSchema = ( + 16, + n0, + _MDSCe, + 0, + (_me,), + ((MEMBER_DATA_SOURCE_CONFIGURATION, 0),), +) + +GET_MEMBER_DETECTORS_OUTPUT: StaticSchema = ( + 18, + n0, + _GMDO, + {_sSI: _cGMDRo, _smi: None}, + (_MDSCe, _UAnp), + ( + (MEMBER_DATA_SOURCE_CONFIGURATIONS, {_sN: _mem, _sm: None}), + (UNPROCESSED_ACCOUNTS, {_sN: _uAn, _sm: None}), ), - members={ - "ScanEc2InstanceWithFindings": { - "target": ORGANIZATION_SCAN_EC2_INSTANCE_WITH_FINDINGS_RESULT, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), - value="scanEc2InstanceWithFindings", - ) - ], - } - }, -) - -ORGANIZATION_S3_LOGS_CONFIGURATION_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#OrganizationS3LogsConfigurationResult"), - members={ - "AutoEnable": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="autoEnable"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, -) - -ORGANIZATION_DATA_SOURCE_CONFIGURATIONS_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#OrganizationDataSourceConfigurationsResult"), - members={ - "S3Logs": { - "target": ORGANIZATION_S3_LOGS_CONFIGURATION_RESULT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="s3Logs"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Kubernetes": { - "target": ORGANIZATION_KUBERNETES_CONFIGURATION_RESULT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="kubernetes") - ], - }, - "MalwareProtection": { - "target": ORGANIZATION_MALWARE_PROTECTION_CONFIGURATION_RESULT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="malwareProtection") - ], - }, - }, -) - -ORG_FEATURE_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#OrgFeatureStatus"), - shape_type=ShapeType.ENUM, - members={ - "NEW": {"target": UNIT}, - "NONE": {"target": UNIT}, - "ALL": {"target": UNIT}, - }, -) - -ORG_FEATURE_ADDITIONAL_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#OrgFeatureAdditionalConfiguration"), - shape_type=ShapeType.ENUM, - members={ - "EKS_ADDON_MANAGEMENT": {"target": UNIT}, - "ECS_FARGATE_AGENT_MANAGEMENT": {"target": UNIT}, - "EC2_AGENT_MANAGEMENT": {"target": UNIT}, - }, -) - -ORGANIZATION_ADDITIONAL_CONFIGURATION_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#OrganizationAdditionalConfigurationResult"), - members={ - "Name": { - "target": ORG_FEATURE_ADDITIONAL_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="name")], - }, - "AutoEnable": { - "target": ORG_FEATURE_STATUS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="autoEnable") - ], - }, - }, -) - -ORGANIZATION_ADDITIONAL_CONFIGURATION_RESULTS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#OrganizationAdditionalConfigurationResults"), - shape_type=ShapeType.LIST, - members={"member": {"target": ORGANIZATION_ADDITIONAL_CONFIGURATION_RESULT}}, -) - -ORG_FEATURE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#OrgFeature"), - shape_type=ShapeType.ENUM, - members={ - "S3_DATA_EVENTS": {"target": UNIT}, - "EKS_AUDIT_LOGS": {"target": UNIT}, - "EBS_MALWARE_PROTECTION": {"target": UNIT}, - "RDS_LOGIN_EVENTS": {"target": UNIT}, - "LAMBDA_NETWORK_LOGS": {"target": UNIT}, - "EKS_RUNTIME_MONITORING": {"target": UNIT}, - "RUNTIME_MONITORING": {"target": UNIT}, - "AI_PROTECTION": {"target": UNIT}, - }, ) -ORGANIZATION_FEATURE_CONFIGURATION_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#OrganizationFeatureConfigurationResult"), - members={ - "Name": { - "target": ORG_FEATURE, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="name")], - }, - "AutoEnable": { - "target": ORG_FEATURE_STATUS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="autoEnable") - ], - }, - "AdditionalConfiguration": { - "target": ORGANIZATION_ADDITIONAL_CONFIGURATION_RESULTS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="additionalConfiguration" - ) - ], - }, - }, -) - -ORGANIZATION_FEATURES_CONFIGURATIONS_RESULTS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#OrganizationFeaturesConfigurationsResults"), - shape_type=ShapeType.LIST, - members={"member": {"target": ORGANIZATION_FEATURE_CONFIGURATION_RESULT}}, -) - -DESCRIBE_ORGANIZATION_CONFIGURATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DescribeOrganizationConfigurationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#DescribeOrganizationConfigurationResponse", - ) - ], - members={ - "AutoEnable": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="autoEnable") - ], - }, - "MemberAccountLimitReached": { - "target": BOOLEAN, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="memberAccountLimitReached" - ), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "DataSources": { - "target": ORGANIZATION_DATA_SOURCE_CONFIGURATIONS_RESULT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="dataSources") - ], - }, - "Features": { - "target": ORGANIZATION_FEATURES_CONFIGURATIONS_RESULTS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="features")], - }, - "NextToken": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="nextToken")], - }, - "AutoEnableOrganizationMembers": { - "target": AUTO_ENABLE_MEMBERS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), - value="autoEnableOrganizationMembers", - ) - ], - }, - }, -) - -DESCRIBE_ORGANIZATION_CONFIGURATION = Schema( - id=ShapeID("com.amazonaws.guardduty#DescribeOrganizationConfiguration"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/detector/{DetectorId}/admin", "code": 200} - ), - ) - ], -) - -DESCRIBE_PUBLISHING_DESTINATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DescribePublishingDestinationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#DescribePublishingDestinationRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "DestinationId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, +GET_MEMBER_DETECTORS: StaticOperationSchema = ( + 23, + n0, + _GMD, + { + _smith: MappingProxyType( + { + "method": "POST", + "uri": "/detector/{DetectorId}/member/detector/get", + "code": 200, + } + ) + }, + GET_MEMBER_DETECTORS_INPUT, + GET_MEMBER_DETECTORS_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +GET_MEMBERS_INPUT: StaticSchema = ( + 18, + n0, + _GMI, + {_sSI: _cGMR, _s: None}, + (_DI, _AIcco), + ((DETECTOR_ID, 9), (ACCOUNT_IDS, {_sN: _aIcc, _sm: None})), +) + +MEMBER: StaticSchema = ( + 18, + n0, + _Mem, + 0, + (_AIcc, _DI, _MI, _E, _RS, _IA, _UAp, _AI), + ( + (ACCOUNT_ID, {_sN: _aIc, _sm: None}), + (DETECTOR_ID, {_sN: _dI}), + (STRING, {_sN: _mI, _sm: None}), + (EMAIL, {_sN: _e, _sm: None}), + (STRING, {_sN: _rS, _sm: None}), + (STRING, {_sN: _iA}), + (STRING, {_sN: _uAp, _sm: None}), + (STRING, {_sN: _aI}), + ), ) -PUBLISHING_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#PublishingStatus"), - shape_type=ShapeType.ENUM, - members={ - "PENDING_VERIFICATION": {"target": UNIT}, - "PUBLISHING": {"target": UNIT}, - "UNABLE_TO_PUBLISH_FIX_DESTINATION_PROPERTY": {"target": UNIT}, - "STOPPED": {"target": UNIT}, - }, -) +MEMBERS: StaticSchema = (16, n0, _Memb, 0, (_me,), ((MEMBER, 0),)) -DESCRIBE_PUBLISHING_DESTINATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DescribePublishingDestinationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#DescribePublishingDestinationResponse", - ) - ], - members={ - "DestinationId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="destinationId"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "DestinationType": { - "target": DESTINATION_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="destinationType"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Status": { - "target": PUBLISHING_STATUS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="status"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "PublishingFailureStartTimestamp": { - "target": LONG, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), - value="publishingFailureStartTimestamp", - ), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "DestinationProperties": { - "target": DESTINATION_PROPERTIES, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="destinationProperties" - ), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Tags": { - "target": TAG_MAP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="tags")], - }, - }, +GET_MEMBERS_OUTPUT: StaticSchema = ( + 18, + n0, + _GMO, + {_sSI: _cGMRo, _smi: None}, + (_Memb, _UAnp), + ((MEMBERS, {_sN: _mem, _sm: None}), (UNPROCESSED_ACCOUNTS, {_sN: _uAn, _sm: None})), ) -DESCRIBE_PUBLISHING_DESTINATION = Schema( - id=ShapeID("com.amazonaws.guardduty#DescribePublishingDestination"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/detector/{DetectorId}/publishingDestination/{DestinationId}", - "code": 200, - } - ), +GET_MEMBERS: StaticOperationSchema = ( + 23, + n0, + _GM, + { + _smith: MappingProxyType( + {"method": "POST", "uri": "/detector/{DetectorId}/member/get", "code": 200} ) - ], -) - -DESTINATION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Destination"), - members={ - "DestinationId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="destinationId"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "DestinationType": { - "target": DESTINATION_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="destinationType"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Status": { - "target": PUBLISHING_STATUS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="status"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, }, + GET_MEMBERS_INPUT, + GET_MEMBERS_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), ) -DESTINATIONS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Destinations"), - shape_type=ShapeType.LIST, - members={"member": {"target": DESTINATION}}, -) - -SEQUENCE_DESCRIPTION = Schema( - id=ShapeID("com.amazonaws.guardduty#SequenceDescription"), - shape_type=ShapeType.STRING, -) - -NETWORK_DIRECTION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#NetworkDirection"), - shape_type=ShapeType.ENUM, - members={"INBOUND": {"target": UNIT}, "OUTBOUND": {"target": UNIT}}, -) +GET_ORGANIZATION_STATISTICS_INPUT: StaticSchema = (18, n0, _GOSI, {_sSI: _sU, _s: None}) -NETWORK_CONNECTION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#NetworkConnection"), - members={ - "Direction": { - "target": NETWORK_DIRECTION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="direction"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, +ORGANIZATION_FEATURE_STATISTICS_ADDITIONAL_CONFIGURATION: StaticSchema = ( + 18, + n0, + _OFSAC, + 0, + (_N, _EAC), + ((ORG_FEATURE_ADDITIONAL_CONFIGURATION, {_sN: _n}), (INTEGER, {_sN: _eAC})), ) -NETWORK_GEO_LOCATION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#NetworkGeoLocation"), - members={ - "City": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="city"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Country": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="country"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Latitude": { - "target": DOUBLE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="lat"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Longitude": { - "target": DOUBLE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="lon"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - }, +ORGANIZATION_FEATURE_STATISTICS_ADDITIONAL_CONFIGURATIONS: StaticSchema = ( + 16, + n0, + _OFSACr, + 0, + (_me,), + ((ORGANIZATION_FEATURE_STATISTICS_ADDITIONAL_CONFIGURATION, 0),), ) -NETWORK_ENDPOINT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#NetworkEndpoint"), - members={ - "Id": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="id"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Ip": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="ip")], - }, - "Domain": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="domain")], - }, - "Port": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="port")], - }, - "Location": { - "target": NETWORK_GEO_LOCATION, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="location")], - }, - "AutonomousSystem": { - "target": AUTONOMOUS_SYSTEM, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="autonomousSystem") - ], - }, - "Connection": { - "target": NETWORK_CONNECTION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="connection") - ], - }, - }, +ORGANIZATION_FEATURE_STATISTICS: StaticSchema = ( + 18, + n0, + _OFSr, + 0, + (_N, _EAC, _ACd), + ( + (ORG_FEATURE, {_sN: _n}), + (INTEGER, {_sN: _eAC}), + (ORGANIZATION_FEATURE_STATISTICS_ADDITIONAL_CONFIGURATIONS, {_sN: _aC}), + ), ) -NETWORK_ENDPOINTS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#NetworkEndpoints"), - shape_type=ShapeType.LIST, - members={"member": {"target": NETWORK_ENDPOINT}}, +ORGANIZATION_FEATURE_STATISTICS_RESULTS: StaticSchema = ( + 16, + n0, + _OFSR, + 0, + (_me,), + ((ORGANIZATION_FEATURE_STATISTICS, 0),), +) + +ORGANIZATION_STATISTICS: StaticSchema = ( + 18, + n0, + _OS, + 0, + (_TAC, _MAC, _AAC, _EAC, _CBF), + ( + (INTEGER, {_sN: _tAC}), + (INTEGER, {_sN: _mAC}), + (INTEGER, {_sN: _aAC}), + (INTEGER, {_sN: _eAC}), + (ORGANIZATION_FEATURE_STATISTICS_RESULTS, {_sN: _cBF}), + ), ) -EC2_IMAGE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Ec2Image"), - members={ - "Ec2InstanceUids": { - "target": EC2_INSTANCE_UIDS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="ec2InstanceUids") - ], - } - }, +ORGANIZATION_DETAILS: StaticSchema = ( + 18, + n0, + _ODr, + 0, + (_UAp, _OS), + ((TIMESTAMP, {_sN: _uAp}), (ORGANIZATION_STATISTICS, {_sN: _oS})), +) + +GET_ORGANIZATION_STATISTICS_OUTPUT: StaticSchema = ( + 18, + n0, + _GOSO, + {_sSI: _cGOSR, _smi: None}, + (_ODr,), + ((ORGANIZATION_DETAILS, {_sN: _oD}),), +) + +GET_ORGANIZATION_STATISTICS: StaticOperationSchema = ( + 23, + n0, + _GOS, + { + _smith: MappingProxyType( + {"method": "GET", "uri": "/organization/statistics", "code": 200} + ) + }, + GET_ORGANIZATION_STATISTICS_INPUT, + GET_ORGANIZATION_STATISTICS_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +GET_REMAINING_FREE_TRIAL_DAYS_INPUT: StaticSchema = ( + 18, + n0, + _GRFTDI, + {_sSI: _cGRFTDR, _s: None}, + (_DI, _AIcco), + ((DETECTOR_ID, 9), (ACCOUNT_IDS, {_sN: _aIcc, _sm: None})), +) + +GET_REMAINING_FREE_TRIAL_DAYS_OUTPUT: StaticSchema = ( + 18, + n0, + _GRFTDO, + {_sSI: _cGRFTDRo, _smi: None}, + (_Acc, _UAnp), + ((ACCOUNT_FREE_TRIAL_INFOS, {_sN: _acc}), (UNPROCESSED_ACCOUNTS, {_sN: _uAn})), +) + +GET_REMAINING_FREE_TRIAL_DAYS: StaticOperationSchema = ( + 23, + n0, + _GRFTD, + { + _smith: MappingProxyType( + { + "method": "POST", + "uri": "/detector/{DetectorId}/freeTrial/daysRemaining", + "code": 200, + } + ) + }, + GET_REMAINING_FREE_TRIAL_DAYS_INPUT, + GET_REMAINING_FREE_TRIAL_DAYS_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +GET_THREAT_ENTITY_SET_INPUT: StaticSchema = ( + 18, + n0, + _GTESI, + {_sSI: _cGTESR, _s: None}, + (_DI, _TESI), + ((DETECTOR_ID, 9), (STRING, 9)), +) + +THREAT_ENTITY_SET_STATUS: StaticSchema = ( + 14, + n0, + _TESS, + 0, + (_INACTIVE, _ACTIVATING, _ACTIVE, _DEACTIVATING, _ERROR, _DP_, _DELETED), + ( + (-1, {_sV: _INACTIVE}), + (-1, {_sV: _ACTIVATING}), + (-1, {_sV: _ACTIVE}), + (-1, {_sV: _DEACTIVATING}), + (-1, {_sV: _ERROR}), + (-1, {_sV: _DP_}), + (-1, {_sV: _DELETED}), + ), ) -EC2_NETWORK_INTERFACE_UIDS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Ec2NetworkInterfaceUids"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, +GET_THREAT_ENTITY_SET_OUTPUT: StaticSchema = ( + 18, + n0, + _GTESO, + {_sSI: _cGTESRo, _smi: None}, + (_N, _Fo, _Loc, _EBO, _St, _Ta, _CA, _UAp, _ED), + ( + (NAME, {_sN: _n, _sm: None}), + (THREAT_ENTITY_SET_FORMAT, {_sN: _fo, _sm: None}), + (LOCATION, {_sN: _loc, _sm: None}), + (EXPECTED_BUCKET_OWNER, {_sN: _eBO}), + (THREAT_ENTITY_SET_STATUS, {_sN: _st, _sm: None}), + (TAG_MAP, {_sN: _ta}), + (TIMESTAMP, {_sN: _cA}), + (TIMESTAMP, {_sN: _uAp}), + (STRING, {_sN: _eD}), + ), ) -IAM_INSTANCE_PROFILE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#IamInstanceProfile"), - members={ - "Arn": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="arn")], - }, - "Id": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="id")], - }, - }, +GET_THREAT_ENTITY_SET: StaticOperationSchema = ( + 23, + n0, + _GTES, + { + _smith: MappingProxyType( + { + "method": "GET", + "uri": "/detector/{DetectorId}/threatentityset/{ThreatEntitySetId}", + "code": 200, + } + ) + }, + GET_THREAT_ENTITY_SET_INPUT, + GET_THREAT_ENTITY_SET_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +GET_THREAT_INTEL_SET_INPUT: StaticSchema = ( + 18, + n0, + _GTISI, + {_sSI: _cGTISR, _s: None}, + (_DI, _TISI), + ((DETECTOR_ID, 9), (STRING, 9)), +) + +THREAT_INTEL_SET_STATUS: StaticSchema = ( + 14, + n0, + _TISS, + 0, + (_INACTIVE, _ACTIVATING, _ACTIVE, _DEACTIVATING, _ERROR, _DP_, _DELETED), + ( + (-1, {_sV: _INACTIVE}), + (-1, {_sV: _ACTIVATING}), + (-1, {_sV: _ACTIVE}), + (-1, {_sV: _DEACTIVATING}), + (-1, {_sV: _ERROR}), + (-1, {_sV: _DP_}), + (-1, {_sV: _DELETED}), + ), ) -PRODUCT_CODE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ProductCode"), - members={ - "Code": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="productCodeId") - ], - }, - "ProductType": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="productCodeType") - ], - }, - }, +GET_THREAT_INTEL_SET_OUTPUT: StaticSchema = ( + 18, + n0, + _GTISO, + {_sSI: _cGTISRo, _smi: None}, + (_N, _Fo, _Loc, _St, _Ta, _EBO), + ( + (NAME, {_sN: _n, _sm: None}), + (THREAT_INTEL_SET_FORMAT, {_sN: _fo, _sm: None}), + (LOCATION, {_sN: _loc, _sm: None}), + (THREAT_INTEL_SET_STATUS, {_sN: _st, _sm: None}), + (TAG_MAP, {_sN: _ta}), + (ACCOUNT_ID, {_sN: _eBO}), + ), ) -PRODUCT_CODES = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ProductCodes"), - shape_type=ShapeType.LIST, - members={"member": {"target": PRODUCT_CODE}}, -) - -EC2_INSTANCE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Ec2Instance"), - members={ - "AvailabilityZone": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="availabilityZone") - ], - }, - "ImageDescription": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="imageDescription") - ], - }, - "InstanceState": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="instanceState") - ], - }, - "IamInstanceProfile": {"target": IAM_INSTANCE_PROFILE}, - "InstanceType": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="instanceType") - ], - }, - "OutpostArn": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="outpostArn") - ], - }, - "Platform": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="platform")], - }, - "ProductCodes": { - "target": PRODUCT_CODES, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="productCodes") - ], - }, - "Ec2NetworkInterfaceUids": { - "target": EC2_NETWORK_INTERFACE_UIDS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="ec2NetworkInterfaceUids" - ) - ], - }, - }, +GET_THREAT_INTEL_SET: StaticOperationSchema = ( + 23, + n0, + _GTIS, + { + _smith: MappingProxyType( + { + "method": "GET", + "uri": "/detector/{DetectorId}/threatintelset/{ThreatIntelSetId}", + "code": 200, + } + ) + }, + GET_THREAT_INTEL_SET_INPUT, + GET_THREAT_INTEL_SET_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +GET_TRUSTED_ENTITY_SET_INPUT: StaticSchema = ( + 18, + n0, + _GTESIe, + {_sSI: _cGTESRom, _s: None}, + (_DI, _TESIr), + ((DETECTOR_ID, 9), (STRING, 9)), +) + +TRUSTED_ENTITY_SET_STATUS: StaticSchema = ( + 14, + n0, + _TESSr, + 0, + (_INACTIVE, _ACTIVATING, _ACTIVE, _DEACTIVATING, _ERROR, _DP_, _DELETED), + ( + (-1, {_sV: _INACTIVE}), + (-1, {_sV: _ACTIVATING}), + (-1, {_sV: _ACTIVE}), + (-1, {_sV: _DEACTIVATING}), + (-1, {_sV: _ERROR}), + (-1, {_sV: _DP_}), + (-1, {_sV: _DELETED}), + ), ) -LAUNCH_TEMPLATE_VERSION = Schema( - id=ShapeID("com.amazonaws.guardduty#LaunchTemplateVersion"), - shape_type=ShapeType.STRING, -) - -EC2_LAUNCH_TEMPLATE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Ec2LaunchTemplate"), - members={ - "Ec2InstanceUids": { - "target": EC2_INSTANCE_UIDS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="ec2InstanceUids") - ], - }, - "Version": { - "target": LAUNCH_TEMPLATE_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="version")], - }, - }, +GET_TRUSTED_ENTITY_SET_OUTPUT: StaticSchema = ( + 18, + n0, + _GTESOe, + {_sSI: _cGTESRoma, _smi: None}, + (_N, _Fo, _Loc, _EBO, _St, _Ta, _CA, _UAp, _ED), + ( + (NAME, {_sN: _n, _sm: None}), + (TRUSTED_ENTITY_SET_FORMAT, {_sN: _fo, _sm: None}), + (LOCATION, {_sN: _loc, _sm: None}), + (EXPECTED_BUCKET_OWNER, {_sN: _eBO}), + (TRUSTED_ENTITY_SET_STATUS, {_sN: _st, _sm: None}), + (TAG_MAP, {_sN: _ta}), + (TIMESTAMP, {_sN: _cA}), + (TIMESTAMP, {_sN: _uAp}), + (STRING, {_sN: _eD}), + ), ) -IPV6_ADDRESSES = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Ipv6Addresses"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, -) - -PRIVATE_IP_ADDRESS_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#PrivateIpAddressDetails"), - members={ - "PrivateDnsName": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="privateDnsName") - ], - }, - "PrivateIpAddress": { - "target": SENSITIVE_STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="privateIpAddress") - ], - }, - }, +GET_TRUSTED_ENTITY_SET: StaticOperationSchema = ( + 23, + n0, + _GTESe, + { + _smith: MappingProxyType( + { + "method": "GET", + "uri": "/detector/{DetectorId}/trustedentityset/{TrustedEntitySetId}", + "code": 200, + } + ) + }, + GET_TRUSTED_ENTITY_SET_INPUT, + GET_TRUSTED_ENTITY_SET_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +USAGE_FEATURE: StaticSchema = ( + 14, + n0, + _UFs, + 0, + ( + _FL_, + _CT_, + _DL_, + _SDE, + _EAL, + _EMP, + _RLE, + _LNL, + _ERM, + _ERM_, + _FRM, + _RDPP, + _RDPS, + _AP, + ), + ( + (-1, {_sV: _FL_}), + (-1, {_sV: _CT_}), + (-1, {_sV: _DL_}), + (-1, {_sV: _SDE}), + (-1, {_sV: _EAL}), + (-1, {_sV: _EMP}), + (-1, {_sV: _RLE}), + (-1, {_sV: _LNL}), + (-1, {_sV: _ERM}), + (-1, {_sV: _ERM_}), + (-1, {_sV: _FRM}), + (-1, {_sV: _RDPP}), + (-1, {_sV: _RDPS}), + (-1, {_sV: _AP}), + ), ) -PRIVATE_IP_ADDRESSES = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#PrivateIpAddresses"), - shape_type=ShapeType.LIST, - members={"member": {"target": PRIVATE_IP_ADDRESS_DETAILS}}, -) +USAGE_FEATURE_LIST: StaticSchema = (16, n0, _UFL, 0, (_me,), ((USAGE_FEATURE, 0),)) -SECURITY_GROUP = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#SecurityGroup"), - members={ - "GroupId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="groupId")], - }, - "GroupName": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="groupName")], - }, - }, -) +RESOURCE_LIST: StaticSchema = (16, n0, _RLe, 0, (_me,), ((STRING, 0),)) -SECURITY_GROUPS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#SecurityGroups"), - shape_type=ShapeType.LIST, - members={"member": {"target": SECURITY_GROUP}}, -) - -EC2_NETWORK_INTERFACE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Ec2NetworkInterface"), - members={ - "Ipv6Addresses": { - "target": IPV6_ADDRESSES, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="ipv6Addresses") - ], - }, - "PrivateIpAddresses": { - "target": PRIVATE_IP_ADDRESSES, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="privateIpAddresses") - ], - }, - "PublicIp": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="publicIp")], - }, - "SecurityGroups": { - "target": SECURITY_GROUPS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="securityGroups") - ], - }, - "SubNetId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="subNetId")], - }, - "VpcId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="vpcId")], - }, - }, +USAGE_CRITERIA: StaticSchema = ( + 18, + n0, + _UC, + 0, + (_AIcco, _DS, _Reso, _F), + ( + (ACCOUNT_IDS, {_sN: _aIcc}), + (DATA_SOURCE_LIST, {_sN: _dS}), + (RESOURCE_LIST, {_sN: _reso}), + (USAGE_FEATURE_LIST, {_sN: _f}), + ), ) -EC2_VPC = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Ec2Vpc"), - members={ - "Ec2InstanceUids": { - "target": EC2_INSTANCE_UIDS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="ec2InstanceUids") - ], - } - }, +USAGE_STATISTIC_TYPE: StaticSchema = ( + 14, + n0, + _UST, + 0, + (_SBA, _SBDS, _SBR, _TR, _SBF, _TABF), + ( + (-1, {_sV: _SBA}), + (-1, {_sV: _SBDS}), + (-1, {_sV: _SBR}), + (-1, {_sV: _TR}), + (-1, {_sV: _SBF}), + (-1, {_sV: _TABF}), + ), ) -ECS_CLUSTER_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#EcsClusterStatus"), - shape_type=ShapeType.ENUM, - members={ - "ACTIVE": {"target": UNIT}, - "PROVISIONING": {"target": UNIT}, - "DEPROVISIONING": {"target": UNIT}, - "FAILED": {"target": UNIT}, - "INACTIVE": {"target": UNIT}, - }, +GET_USAGE_STATISTICS_INPUT: StaticSchema = ( + 18, + n0, + _GUSI, + {_sSI: _cGUSR, _s: None}, + (_DI, _UST, _UC, _Uni, _MR, _NT), + ( + (DETECTOR_ID, 9), + (USAGE_STATISTIC_TYPE, {_sN: _uST, _sm: None}), + (USAGE_CRITERIA, {_sN: _uC, _sm: None}), + (STRING, {_sN: _uni}), + (MAX_RESULTS, {_sN: _mR}), + (STRING, {_sN: _nT}), + ), ) -ECS_CLUSTER = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#EcsCluster"), - members={ - "Status": { - "target": ECS_CLUSTER_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="status")], - }, - "Ec2InstanceUids": { - "target": EC2_INSTANCE_UIDS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="ec2InstanceUids") - ], - }, - }, +TOTAL: StaticSchema = ( + 18, + n0, + _To, + 0, + (_Am, _Uni), + ((STRING, {_sN: _am}), (STRING, {_sN: _uni})), +) + +USAGE_ACCOUNT_RESULT: StaticSchema = ( + 18, + n0, + _UAR, + 0, + (_AIcc, _To), + ((ACCOUNT_ID, {_sN: _aIc}), (TOTAL, {_sN: _to})), +) + +USAGE_ACCOUNT_RESULT_LIST: StaticSchema = ( + 16, + n0, + _UARL, + 0, + (_me,), + ((USAGE_ACCOUNT_RESULT, 0),), +) + +USAGE_DATA_SOURCE_RESULT: StaticSchema = ( + 18, + n0, + _UDSRs, + 0, + (_DSa, _To), + ((DATA_SOURCE, {_sN: _dSa}), (TOTAL, {_sN: _to})), +) + +USAGE_DATA_SOURCE_RESULT_LIST: StaticSchema = ( + 16, + n0, + _UDSRL, + 0, + (_me,), + ((USAGE_DATA_SOURCE_RESULT, 0),), +) + +USAGE_FEATURE_RESULT: StaticSchema = ( + 18, + n0, + _UFR, + 0, + (_Fea, _To), + ((USAGE_FEATURE, {_sN: _fe}), (TOTAL, {_sN: _to})), +) + +USAGE_FEATURE_RESULT_LIST: StaticSchema = ( + 16, + n0, + _UFRL, + 0, + (_me,), + ((USAGE_FEATURE_RESULT, 0),), +) + +USAGE_RESOURCE_RESULT: StaticSchema = ( + 18, + n0, + _URR, + 0, + (_R, _To), + ((STRING, {_sN: _r}), (TOTAL, {_sN: _to})), +) + +USAGE_RESOURCE_RESULT_LIST: StaticSchema = ( + 16, + n0, + _URRL, + 0, + (_me,), + ((USAGE_RESOURCE_RESULT, 0),), +) + +USAGE_TOP_ACCOUNT_RESULT: StaticSchema = ( + 18, + n0, + _UTAR, + 0, + (_AIcc, _To), + ((ACCOUNT_ID, {_sN: _aIc}), (TOTAL, {_sN: _to})), +) + +USAGE_TOP_ACCOUNTS_BY_FEATURE_LIST: StaticSchema = ( + 16, + n0, + _UTABFL, + 0, + (_me,), + ((USAGE_TOP_ACCOUNT_RESULT, 0),), +) + +USAGE_TOP_ACCOUNTS_RESULT: StaticSchema = ( + 18, + n0, + _UTARs, + 0, + (_Fea, _Acc), + ((USAGE_FEATURE, {_sN: _fe}), (USAGE_TOP_ACCOUNTS_BY_FEATURE_LIST, {_sN: _acc})), +) + +USAGE_TOP_ACCOUNTS_RESULT_LIST: StaticSchema = ( + 16, + n0, + _UTARL, + 0, + (_me,), + ((USAGE_TOP_ACCOUNTS_RESULT, 0),), +) + +USAGE_STATISTICS: StaticSchema = ( + 18, + n0, + _USs, + 0, + (_SBAu, _TABFo, _SBDSu, _SBRu, _TRo, _SBFu), + ( + (USAGE_ACCOUNT_RESULT_LIST, {_sN: _sBA}), + (USAGE_TOP_ACCOUNTS_RESULT_LIST, {_sN: _tABF}), + (USAGE_DATA_SOURCE_RESULT_LIST, {_sN: _sBDS}), + (USAGE_RESOURCE_RESULT_LIST, {_sN: _sBR}), + (USAGE_RESOURCE_RESULT_LIST, {_sN: _tR}), + (USAGE_FEATURE_RESULT_LIST, {_sN: _sBF}), + ), ) -ECS_LAUNCH_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#EcsLaunchType"), - shape_type=ShapeType.ENUM, - members={"FARGATE": {"target": UNIT}, "EC2": {"target": UNIT}}, -) - -ECS_TASK = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#EcsTask"), - members={ - "CreatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="createdAt")], - }, - "TaskDefinitionArn": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="taskDefinitionArn") - ], - }, - "LaunchType": { - "target": ECS_LAUNCH_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="launchType") - ], - }, - "ContainerUids": { - "target": CONTAINER_UIDS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="containerUids") - ], - }, - }, +GET_USAGE_STATISTICS_OUTPUT: StaticSchema = ( + 18, + n0, + _GUSO, + {_sSI: _cGUSRo, _smi: None}, + (_USs, _NT), + ((USAGE_STATISTICS, {_sN: _uS}), (STRING, {_sN: _nT})), +) + +GET_USAGE_STATISTICS: StaticOperationSchema = ( + 23, + n0, + _GUS, + { + _smith: MappingProxyType( + { + "method": "POST", + "uri": "/detector/{DetectorId}/usage/statistics", + "code": 200, + } + ) + }, + GET_USAGE_STATISTICS_INPUT, + GET_USAGE_STATISTICS_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +INVITE_MEMBERS_INPUT: StaticSchema = ( + 18, + n0, + _IMI, + {_sSI: _cIMR, _s: None}, + (_DI, _AIcco, _DEN, _M), + ( + (DETECTOR_ID, 9), + (ACCOUNT_IDS, {_sN: _aIcc, _sm: None}), + (BOOLEAN, {_sN: _dEN}), + (STRING, {_sN: _m}), + ), ) -EKS_CLUSTER = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#EksCluster"), - members={ - "Arn": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="arn")], - }, - "CreatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="createdAt")], - }, - "Status": { - "target": CLUSTER_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="status")], - }, - "VpcId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="vpcId")], - }, - "Ec2InstanceUids": { - "target": EC2_INSTANCE_UIDS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="ec2InstanceUids") - ], - }, - }, +INVITE_MEMBERS_OUTPUT: StaticSchema = ( + 18, + n0, + _IMO, + {_sSI: _cIMRo, _smi: None}, + (_UAnp,), + ((UNPROCESSED_ACCOUNTS, {_sN: _uAn, _sm: None}),), +) + +INVITE_MEMBERS: StaticOperationSchema = ( + 23, + n0, + _IMn, + { + _smith: MappingProxyType( + { + "method": "POST", + "uri": "/detector/{DetectorId}/member/invite", + "code": 200, + } + ) + }, + INVITE_MEMBERS_INPUT, + INVITE_MEMBERS_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +LIST_COVERAGE_INPUT: StaticSchema = ( + 18, + n0, + _LCI, + {_sSI: _cLCR, _s: None}, + (_DI, _NT, _MR, _FCil, _SCo), + ( + (DETECTOR_ID, 9), + (STRING, {_sN: _nT}), + (MAX_RESULTS, {_sN: _mR}), + (COVERAGE_FILTER_CRITERIA, {_sN: _fCil}), + (COVERAGE_SORT_CRITERIA, {_sN: _sCo}), + ), ) -IAM_INSTANCE_PROFILE_V2 = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#IamInstanceProfileV2"), - members={ - "Ec2InstanceUids": { - "target": EC2_INSTANCE_UIDS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="ec2InstanceUids") - ], - } - }, +LIST_COVERAGE_OUTPUT: StaticSchema = ( + 18, + n0, + _LCO, + {_sSI: _cLCRo, _smi: None}, + (_Reso, _NT), + ((COVERAGE_RESOURCES, {_sN: _reso, _sm: None}), (STRING, {_sN: _nT})), +) + +LIST_COVERAGE: StaticOperationSchema = ( + 23, + n0, + _LC, + { + _smith: MappingProxyType( + {"method": "POST", "uri": "/detector/{DetectorId}/coverage", "code": 200} + ) + }, + LIST_COVERAGE_INPUT, + LIST_COVERAGE_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +LIST_CUSTOM_DETECTION_RULE_ASSOCIATIONS_INPUT: StaticSchema = ( + 18, + n0, + _LCDRAI, + {_sSI: _cLCDRAR, _s: None}, + (_MR, _NT, _RI, _Mo), + ( + (DETECTION_RULE_MAX_RESULTS, {_sQ: _mR}), + (STRING, {_sQ: _nT}), + (RULE_ID, {_sQ: _rI}), + (ASSOCIATION_MODE, {_sQ: _mo}), + ), ) -KUBERNETES_RESOURCES_TYPES = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#KubernetesResourcesTypes"), - shape_type=ShapeType.ENUM, - members={ - "PODS": {"target": UNIT}, - "JOBS": {"target": UNIT}, - "CRONJOBS": {"target": UNIT}, - "DEPLOYMENTS": {"target": UNIT}, - "DAEMONSETS": {"target": UNIT}, - "STATEFULSETS": {"target": UNIT}, - "REPLICASETS": {"target": UNIT}, - "REPLICATIONCONTROLLERS": {"target": UNIT}, - }, +LIST_CUSTOM_DETECTION_RULE_ASSOCIATIONS_OUTPUT: StaticSchema = ( + 18, + n0, + _LCDRAO, + {_sSI: _cLCDRARo, _smi: None}, + (_RAu, _NT), + ((ASSOCIATION_SUMMARY_LIST, {_sN: _rAu, _sm: None}), (STRING, {_sN: _nT})), ) -KUBERNETES_WORKLOAD = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#KubernetesWorkload"), - members={ - "ContainerUids": { - "target": CONTAINER_UIDS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="containerUids") - ], - }, - "Namespace": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="namespace")], - }, - "KubernetesResourcesTypes": { - "target": KUBERNETES_RESOURCES_TYPES, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="type")], - }, +LIST_CUSTOM_DETECTION_RULE_ASSOCIATIONS: StaticOperationSchema = ( + 23, + n0, + _LCDRA, + { + _smith: MappingProxyType( + {"method": "GET", "uri": "/custom-detection-rule/association", "code": 200} + ) }, + LIST_CUSTOM_DETECTION_RULE_ASSOCIATIONS_INPUT, + LIST_CUSTOM_DETECTION_RULE_ASSOCIATIONS_OUTPUT, + (ACCESS_DENIED_EXCEPTION, BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), ) -PUBLIC_ACCESS_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#PublicAccessStatus"), - shape_type=ShapeType.ENUM, - members={"BLOCKED": {"target": UNIT}, "ALLOWED": {"target": UNIT}}, -) - -PUBLIC_ACL_IGNORE_BEHAVIOR = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#PublicAclIgnoreBehavior"), - shape_type=ShapeType.ENUM, - members={"IGNORED": {"target": UNIT}, "NOT_IGNORED": {"target": UNIT}}, -) - -PUBLIC_BUCKET_RESTRICT_BEHAVIOR = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#PublicBucketRestrictBehavior"), - shape_type=ShapeType.ENUM, - members={"RESTRICTED": {"target": UNIT}, "NOT_RESTRICTED": {"target": UNIT}}, -) - -PUBLIC_ACCESS_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#PublicAccessConfiguration"), - members={ - "PublicAclAccess": { - "target": PUBLIC_ACCESS_STATUS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="publicAclAccess") - ], - }, - "PublicPolicyAccess": { - "target": PUBLIC_ACCESS_STATUS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="publicPolicyAccess") - ], - }, - "PublicAclIgnoreBehavior": { - "target": PUBLIC_ACL_IGNORE_BEHAVIOR, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="publicAclIgnoreBehavior" - ) - ], - }, - "PublicBucketRestrictBehavior": { - "target": PUBLIC_BUCKET_RESTRICT_BEHAVIOR, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), - value="publicBucketRestrictBehavior", - ) - ], - }, - }, +LIST_CUSTOM_DETECTION_RULE_ORG_CONFIGURATIONS_INPUT: StaticSchema = ( + 18, + n0, + _LCDROCI, + {_sSI: _cLCDROCR, _s: None}, + (_MR, _NT, _St), + ( + (DETECTION_RULE_MAX_RESULTS, {_sQ: _mR}), + (STRING, {_sQ: _nT}), + (DETECTION_RULE_CONFIGURATION_STATUS, {_sQ: _st}), + ), ) -S3_OBJECT_UIDS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#S3ObjectUids"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, -) - -S3_BUCKET = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#S3Bucket"), - members={ - "OwnerId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="ownerId")], - }, - "CreatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="createdAt")], - }, - "EncryptionType": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="encryptionType") - ], - }, - "EncryptionKeyArn": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="encryptionKeyArn") - ], - }, - "EffectivePermission": { - "target": STRING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="effectivePermission" - ) - ], - }, - "PublicReadAccess": { - "target": PUBLIC_ACCESS_STATUS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="publicReadAccess") - ], - }, - "PublicWriteAccess": { - "target": PUBLIC_ACCESS_STATUS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="publicWriteAccess") - ], - }, - "AccountPublicAccess": { - "target": PUBLIC_ACCESS_CONFIGURATION, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="accountPublicAccess" - ) - ], - }, - "BucketPublicAccess": { - "target": PUBLIC_ACCESS_CONFIGURATION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="bucketPublicAccess") - ], - }, - "S3ObjectUids": { - "target": S3_OBJECT_UIDS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="s3ObjectUids") - ], - }, - }, +LIST_CUSTOM_DETECTION_RULE_ORG_CONFIGURATIONS_OUTPUT: StaticSchema = ( + 18, + n0, + _LCDROCO, + {_sSI: _cLCDROCRo, _smi: None}, + (_Confi, _NT), + ( + (DETECTION_RULE_ORG_CONFIGURATION_SUMMARY_LIST, {_sN: _confi, _sm: None}), + (STRING, {_sN: _nT}), + ), ) -S3_OBJECT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#S3Object"), - members={ - "ETag": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="eTag")], - }, - "Key": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="key")], - }, - "VersionId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="versionId")], - }, - }, +LIST_CUSTOM_DETECTION_RULE_ORG_CONFIGURATIONS: StaticOperationSchema = ( + 23, + n0, + _LCDROC, + { + _smith: MappingProxyType( + { + "method": "GET", + "uri": "/custom-detection-rule/org-configuration", + "code": 200, + } + ) + }, + LIST_CUSTOM_DETECTION_RULE_ORG_CONFIGURATIONS_INPUT, + LIST_CUSTOM_DETECTION_RULE_ORG_CONFIGURATIONS_OUTPUT, + (ACCESS_DENIED_EXCEPTION, BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +LIST_CUSTOM_DETECTION_RULES_INPUT: StaticSchema = ( + 18, + n0, + _LCDRI, + {_sSI: _cLCDRR, _s: None}, + (_MR, _NT, _Fil), + ( + (DETECTION_RULE_MAX_RESULTS, {_sN: _mR}), + (STRING, {_sN: _nT}), + (DETECTION_RULE_FILTER_LIST, {_sN: _fil}), + ), ) -RESOURCE_DATA = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ResourceData"), - members={ - "S3Bucket": { - "target": S3_BUCKET, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="s3Bucket")], - }, - "Ec2Instance": { - "target": EC2_INSTANCE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="ec2Instance") - ], - }, - "AccessKey": { - "target": ACCESS_KEY, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="accessKey")], - }, - "Ec2NetworkInterface": { - "target": EC2_NETWORK_INTERFACE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="ec2NetworkInterface" - ) - ], - }, - "S3Object": { - "target": S3_OBJECT, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="s3Object")], - }, - "EksCluster": { - "target": EKS_CLUSTER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="eksCluster") - ], - }, - "KubernetesWorkload": { - "target": KUBERNETES_WORKLOAD, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="kubernetesWorkload") - ], - }, - "Container": { - "target": CONTAINER_FINDING_RESOURCE, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="container")], - }, - "EcsCluster": { - "target": ECS_CLUSTER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="ecsCluster") - ], - }, - "EcsTask": { - "target": ECS_TASK, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="ecsTask")], - }, - "IamInstanceProfile": { - "target": IAM_INSTANCE_PROFILE_V2, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="iamInstanceProfile") - ], - }, - "AutoscalingAutoScalingGroup": { - "target": AUTOSCALING_AUTO_SCALING_GROUP, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), - value="autoscalingAutoScalingGroup", - ) - ], - }, - "Ec2LaunchTemplate": { - "target": EC2_LAUNCH_TEMPLATE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="ec2LaunchTemplate") - ], - }, - "Ec2Vpc": { - "target": EC2_VPC, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="ec2Vpc")], - }, - "Ec2Image": { - "target": EC2_IMAGE, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="ec2Image")], - }, - "CloudformationStack": { - "target": CLOUDFORMATION_STACK, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="cloudformationStack" - ) - ], - }, - "BedrockGuardrail": { - "target": BEDROCK_GUARDRAIL_RESOURCE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="bedrockGuardrail") - ], - }, - }, +RULE_SUMMARY: StaticSchema = ( + 18, + n0, + _RSul, + 0, + (_RI, _Ar, _N, _De, _Sev, _DSa, _Tac, _Tec, _Se, _Lan, _Sch, _CA, _UAp), + ( + (RULE_ID, {_sN: _rI, _sm: None}), + (DETECTION_RULE_ARN, {_sN: _ar, _sm: None}), + (RULE_NAME, {_sN: _n, _sm: None}), + (DETECTION_RULE_DESCRIPTION, {_sN: _de, _sm: None}), + (DETECTION_RULE_SEVERITY, {_sN: _sev, _sm: None}), + (DETECTION_RULE_DATA_SOURCE, {_sN: _dSa, _sm: None}), + (MITRE_TACTIC, {_sN: _tac, _sm: None}), + (MITRE_TECHNIQUE, {_sN: _tec, _sm: None}), + (DETECTION_RULE_SERVICE_NAME, {_sN: _ser, _sm: None}), + (RULE_LANGUAGE, {_sN: _la}), + (RULE_SCHEMA, {_sN: _sch}), + (TIMESTAMP, {_sN: _cA, _sm: None}), + (TIMESTAMP, {_sN: _uAp}), + ), ) -FINDING_RESOURCE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#FindingResourceType"), - shape_type=ShapeType.ENUM, - members={ - "EC2_INSTANCE": {"target": UNIT}, - "EC2_NETWORK_INTERFACE": {"target": UNIT}, - "S3_BUCKET": {"target": UNIT}, - "S3_OBJECT": {"target": UNIT}, - "ACCESS_KEY": {"target": UNIT}, - "EKS_CLUSTER": {"target": UNIT}, - "KUBERNETES_WORKLOAD": {"target": UNIT}, - "CONTAINER": {"target": UNIT}, - "ECS_CLUSTER": {"target": UNIT}, - "ECS_TASK": {"target": UNIT}, - "AUTOSCALING_AUTO_SCALING_GROUP": {"target": UNIT}, - "IAM_INSTANCE_PROFILE": {"target": UNIT}, - "CLOUDFORMATION_STACK": {"target": UNIT}, - "EC2_LAUNCH_TEMPLATE": {"target": UNIT}, - "EC2_VPC": {"target": UNIT}, - "EC2_IMAGE": {"target": UNIT}, - "BEDROCK_CUSTOM_MODEL": {"target": UNIT}, - "BEDROCK_IMPORTED_MODEL": {"target": UNIT}, - "BEDROCK_PROVISIONED_MODEL": {"target": UNIT}, - "BEDROCK_CUSTOM_MODEL_DEPLOYMENT": {"target": UNIT}, - "BEDROCK_INFERENCE_PROFILE": {"target": UNIT}, - "BEDROCK_APPLICATION_INFERENCE_PROFILE": {"target": UNIT}, - "BEDROCK_PROMPT": {"target": UNIT}, - "BEDROCK_PROMPT_ROUTER": {"target": UNIT}, - "BEDROCK_GUARDRAIL": {"target": UNIT}, - "SAGEMAKER_ENDPOINT": {"target": UNIT}, - }, +RULE_SUMMARY_LIST: StaticSchema = (16, n0, _RSL, 0, (_me,), ((RULE_SUMMARY, 0),)) + +LIST_CUSTOM_DETECTION_RULES_OUTPUT: StaticSchema = ( + 18, + n0, + _LCDRO, + {_sSI: _cLCDRRo, _smi: None}, + (_Rul, _NT), + ((RULE_SUMMARY_LIST, {_sN: _rul, _sm: None}), (STRING, {_sN: _nT})), +) + +LIST_CUSTOM_DETECTION_RULES: StaticOperationSchema = ( + 23, + n0, + _LCDR, + { + _smith: MappingProxyType( + {"method": "POST", "uri": "/custom-detection-rule/rule", "code": 200} + ) + }, + LIST_CUSTOM_DETECTION_RULES_INPUT, + LIST_CUSTOM_DETECTION_RULES_OUTPUT, + (ACCESS_DENIED_EXCEPTION, BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +LIST_DETECTORS_INPUT: StaticSchema = ( + 18, + n0, + _LDI, + {_sSI: _cLDR, _s: None}, + (_MR, _NT), + ((MAX_RESULTS, {_sQ: _mR}), (STRING, {_sQ: _nT})), +) + +LIST_DETECTORS_OUTPUT: StaticSchema = ( + 18, + n0, + _LDO, + {_sSI: _cLDRo, _smi: None}, + (_DIet, _NT), + ((DETECTOR_IDS, {_sN: _dIet, _sm: None}), (STRING, {_sN: _nT})), +) + +LIST_DETECTORS: StaticOperationSchema = ( + 23, + n0, + _LDi, + {_smith: MappingProxyType({"method": "GET", "uri": "/detector", "code": 200})}, + LIST_DETECTORS_INPUT, + LIST_DETECTORS_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +LIST_FILTERS_INPUT: StaticSchema = ( + 18, + n0, + _LFI, + {_sSI: _cLFR, _s: None}, + (_DI, _MR, _NT), + ((DETECTOR_ID, 9), (MAX_RESULTS, {_sQ: _mR}), (STRING, {_sQ: _nT})), +) + +LIST_FILTERS_OUTPUT: StaticSchema = ( + 18, + n0, + _LFO, + {_sSI: _cLFRo, _smi: None}, + (_FNil, _NT), + ((FILTER_NAMES, {_sN: _fNi, _sm: None}), (STRING, {_sN: _nT})), +) + +LIST_FILTERS: StaticOperationSchema = ( + 23, + n0, + _LF, + { + _smith: MappingProxyType( + {"method": "GET", "uri": "/detector/{DetectorId}/filter", "code": 200} + ) + }, + LIST_FILTERS_INPUT, + LIST_FILTERS_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +LIST_FINDINGS_INPUT: StaticSchema = ( + 18, + n0, + _LFIi, + {_sSI: _cLFRom, _s: None}, + (_DI, _FCin, _SCo, _MR, _NT), + ( + (DETECTOR_ID, 9), + (FINDING_CRITERIA, {_sN: _fCin}), + (SORT_CRITERIA, {_sN: _sCo}), + (MAX_RESULTS, {_sN: _mR}), + (STRING, {_sN: _nT}), + ), ) -TAG = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Tag"), - members={ - "Key": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="key")], - }, - "Value": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="value")], - }, - }, +LIST_FINDINGS_OUTPUT: StaticSchema = ( + 18, + n0, + _LFOi, + {_sSI: _cLFRoma, _smi: None}, + (_FIi, _NT), + ((FINDING_IDS, {_sN: _fI, _sm: None}), (STRING, {_sN: _nT})), ) -TAGS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Tags"), - shape_type=ShapeType.LIST, - members={"member": {"target": TAG}}, -) - -RESOURCE_V2 = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ResourceV2"), - members={ - "Uid": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="uid"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Name": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="name")], - }, - "AccountId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="accountId")], - }, - "ResourceType": { - "target": FINDING_RESOURCE_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="resourceType"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Region": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="region")], - }, - "Service": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="service")], - }, - "CloudPartition": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="cloudPartition") - ], - }, - "Tags": { - "target": TAGS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="tags")], - }, - "Data": { - "target": RESOURCE_DATA, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="data")], - }, +LIST_FINDINGS: StaticOperationSchema = ( + 23, + n0, + _LFi, + { + _smith: MappingProxyType( + {"method": "POST", "uri": "/detector/{DetectorId}/findings", "code": 200} + ) }, + LIST_FINDINGS_INPUT, + LIST_FINDINGS_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), ) -RESOURCES = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Resources"), - shape_type=ShapeType.LIST, - members={"member": {"target": RESOURCE_V2}}, -) - -INDICATOR_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#IndicatorType"), - shape_type=ShapeType.ENUM, - members={ - "SUSPICIOUS_USER_AGENT": {"target": UNIT}, - "SUSPICIOUS_NETWORK": {"target": UNIT}, - "MALICIOUS_IP": {"target": UNIT}, - "TOR_IP": {"target": UNIT}, - "ATTACK_TACTIC": {"target": UNIT}, - "HIGH_RISK_API": {"target": UNIT}, - "ATTACK_TECHNIQUE": {"target": UNIT}, - "UNUSUAL_API_FOR_ACCOUNT": {"target": UNIT}, - "UNUSUAL_ASN_FOR_ACCOUNT": {"target": UNIT}, - "UNUSUAL_ASN_FOR_USER": {"target": UNIT}, - "SUSPICIOUS_PROCESS": {"target": UNIT}, - "MALICIOUS_DOMAIN": {"target": UNIT}, - "MALICIOUS_PROCESS": {"target": UNIT}, - "CRYPTOMINING_IP": {"target": UNIT}, - "CRYPTOMINING_DOMAIN": {"target": UNIT}, - "CRYPTOMINING_PROCESS": {"target": UNIT}, - "MALICIOUS_FILE": {"target": UNIT}, - "VULNERABILITY": {"target": UNIT}, - "MALICIOUS_PACKAGE": {"target": UNIT}, - "MISCONFIGURATION": {"target": UNIT}, - "REACHABILITY": {"target": UNIT}, - "SENSITIVE_DATA": {"target": UNIT}, - }, -) +NEXT_TOKEN: StaticSchema = (3, n0, _NT, 0) -INDICATOR_TITLE = Schema( - id=ShapeID("com.amazonaws.guardduty#IndicatorTitle"), shape_type=ShapeType.STRING +INVESTIGATION_SORT_FIELD: StaticSchema = ( + 14, + n0, + _ISFn, + 0, + (_ST__, _ET__, _STATUS, _RL_, _CONFIDENCE), + ( + (-1, {_sV: _ST__}), + (-1, {_sV: _ET__}), + (-1, {_sV: _STATUS}), + (-1, {_sV: _RL_}), + (-1, {_sV: _CONFIDENCE}), + ), ) -INDICATOR_VALUE_STRING = Schema( - id=ShapeID("com.amazonaws.guardduty#IndicatorValueString"), - shape_type=ShapeType.STRING, +INVESTIGATION_SORT_CRITERIA: StaticSchema = ( + 18, + n0, + _ISC, + 0, + (_AN, _OB), + ((INVESTIGATION_SORT_FIELD, {_sN: _aN}), (ORDER_BY, {_sN: _oB})), +) + +LIST_INVESTIGATIONS_INPUT: StaticSchema = ( + 18, + n0, + _LII, + {_sSI: _cLIR, _s: None}, + (_DI, _SCo, _MR, _NT), + ( + (DETECTOR_ID, 9), + (INVESTIGATION_SORT_CRITERIA, {_sN: _sCo}), + (MAX_RESULTS, {_sN: _mR}), + (NEXT_TOKEN, {_sN: _nT}), + ), ) -INDICATOR_VALUES = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#IndicatorValues"), - shape_type=ShapeType.LIST, - members={"member": {"target": INDICATOR_VALUE_STRING}}, +INVESTIGATION_TITLE: StaticSchema = (3, n0, _ITnv, 0) + +INVESTIGATION_SUMMARY: StaticSchema = ( + 18, + n0, + _ISnv, + 0, + (_IInv, _St, _TP, _RLi, _Con, _Tit, _AIcc, _ST, _ET), + ( + (INVESTIGATION_ID, {_sN: _iInv}), + (INVESTIGATION_STATUS, {_sN: _st}), + (TRIGGER_PROMPT, {_sN: _tP}), + (RISK_LEVEL, {_sN: _rL}), + (CONFIDENCE, {_sN: _con}), + (INVESTIGATION_TITLE, {_sN: _ti}), + (STRING, {_sN: _aIc}), + (TIMESTAMP, {_sN: _sT}), + (TIMESTAMP, {_sN: _eT}), + ), ) -INDICATOR = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Indicator"), - members={ - "Key": { - "target": INDICATOR_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="key"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Values": { - "target": INDICATOR_VALUES, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="values")], - }, - "Title": { - "target": INDICATOR_TITLE, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="title")], - }, - }, +INVESTIGATION_SUMMARIES: StaticSchema = ( + 16, + n0, + _ISnve, + 0, + (_me,), + ((INVESTIGATION_SUMMARY, 0),), +) + +LIST_INVESTIGATIONS_OUTPUT: StaticSchema = ( + 18, + n0, + _LIO, + {_sSI: _cLIRo, _smi: None}, + (_Inve, _NT), + ((INVESTIGATION_SUMMARIES, {_sN: _inv, _sm: None}), (NEXT_TOKEN, {_sN: _nT})), +) + +LIST_INVESTIGATIONS: StaticOperationSchema = ( + 23, + n0, + _LI, + { + _smith: MappingProxyType( + { + "method": "POST", + "uri": "/detector/{DetectorId}/investigation/list", + "code": 200, + } + ) + }, + LIST_INVESTIGATIONS_INPUT, + LIST_INVESTIGATIONS_OUTPUT, + (ACCESS_DENIED_EXCEPTION, BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +LIST_INVITATIONS_INPUT: StaticSchema = ( + 18, + n0, + _LIIi, + {_sSI: _cLIRom, _s: None}, + (_MR, _NT), + ((MAX_RESULTS, {_sQ: _mR}), (STRING, {_sQ: _nT})), +) + +INVITATION: StaticSchema = ( + 18, + n0, + _Invi, + 0, + (_AIcc, _II, _RS, _IA), + ( + (ACCOUNT_ID, {_sN: _aIc}), + (STRING, {_sN: _iI}), + (STRING, {_sN: _rS}), + (STRING, {_sN: _iA}), + ), ) -INDICATORS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Indicators"), - shape_type=ShapeType.LIST, - members={"member": {"target": INDICATOR}}, -) +INVITATIONS: StaticSchema = (16, n0, _Invit, 0, (_me,), ((INVITATION, 0),)) -SIGNAL_DESCRIPTION = Schema( - id=ShapeID("com.amazonaws.guardduty#SignalDescription"), shape_type=ShapeType.STRING +LIST_INVITATIONS_OUTPUT: StaticSchema = ( + 18, + n0, + _LIOi, + {_sSI: _cLIRoma, _smi: None}, + (_Invit, _NT), + ((INVITATIONS, {_sN: _invi}), (STRING, {_sN: _nT})), ) -ENDPOINT_IDS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#EndpointIds"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, +LIST_INVITATIONS: StaticOperationSchema = ( + 23, + n0, + _LIi, + {_smith: MappingProxyType({"method": "GET", "uri": "/invitation", "code": 200})}, + LIST_INVITATIONS_INPUT, + LIST_INVITATIONS_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +LIST_IP_SETS_INPUT: StaticSchema = ( + 18, + n0, + _LIPSI, + {_sSI: _cLIPSR, _s: None}, + (_DI, _MR, _NT), + ((DETECTOR_ID, 9), (MAX_RESULTS, {_sQ: _mR}), (STRING, {_sQ: _nT})), +) + +IP_SET_IDS: StaticSchema = (16, n0, _ISIp, 0, (_me,), ((STRING, 0),)) + +LIST_IP_SETS_OUTPUT: StaticSchema = ( + 18, + n0, + _LIPSO, + {_sSI: _cLIPSRo, _smi: None}, + (_ISIp, _NT), + ((IP_SET_IDS, {_sN: _iSIp, _sm: None}), (STRING, {_sN: _nT})), +) + +LIST_IP_SETS: StaticOperationSchema = ( + 23, + n0, + _LIPS, + { + _smith: MappingProxyType( + {"method": "GET", "uri": "/detector/{DetectorId}/ipset", "code": 200} + ) + }, + LIST_IP_SETS_INPUT, + LIST_IP_SETS_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +LIST_MALWARE_PROTECTION_PLANS_INPUT: StaticSchema = ( + 18, + n0, + _LMPPI, + {_sSI: _cLMPPR, _s: None}, + (_NT,), + ((STRING, {_sQ: _nT}),), +) + +MALWARE_PROTECTION_PLAN_SUMMARY: StaticSchema = ( + 18, + n0, + _MPPSa, + 0, + (_MPPI,), + ((STRING, {_sN: _mPPI}),), +) + +MALWARE_PROTECTION_PLANS_SUMMARY: StaticSchema = ( + 16, + n0, + _MPPSal, + 0, + (_me,), + ((MALWARE_PROTECTION_PLAN_SUMMARY, 0),), +) + +LIST_MALWARE_PROTECTION_PLANS_OUTPUT: StaticSchema = ( + 18, + n0, + _LMPPO, + {_sSI: _cLMPPRo, _smi: None}, + (_MPP, _NT), + ((MALWARE_PROTECTION_PLANS_SUMMARY, {_sN: _mPP}), (STRING, {_sN: _nT})), +) + +LIST_MALWARE_PROTECTION_PLANS: StaticOperationSchema = ( + 23, + n0, + _LMPP, + { + _smith: MappingProxyType( + {"method": "GET", "uri": "/malware-protection-plan", "code": 200} + ) + }, + LIST_MALWARE_PROTECTION_PLANS_INPUT, + LIST_MALWARE_PROTECTION_PLANS_OUTPUT, + (ACCESS_DENIED_EXCEPTION, BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +LIST_MALWARE_SCANS_CRITERION_KEY: StaticSchema = ( + 14, + n0, + _LMSCK, + 0, + (_RA_, _SI_, _AI_, _GFI, _RT_, _SST, _SS_, _ST_), + ( + (-1, {_sV: _RA_}), + (-1, {_sV: _SI_}), + (-1, {_sV: _AI_}), + (-1, {_sV: _GFI}), + (-1, {_sV: _RT_}), + (-1, {_sV: _SST}), + (-1, {_sV: _SS_}), + (-1, {_sV: _ST_}), + ), ) -RESOURCE_UIDS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ResourceUids"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, +LIST_MALWARE_SCANS_FILTER_CRITERION: StaticSchema = ( + 18, + n0, + _LMSFC, + 0, + (_LMSCK, _FC), + ((LIST_MALWARE_SCANS_CRITERION_KEY, {_sN: _cK}), (FILTER_CONDITION, {_sN: _fC})), +) + +LIST_MALWARE_SCANS_FILTER_CRITERION_LIST: StaticSchema = ( + 16, + n0, + _LMSFCL, + 0, + (_me,), + ((LIST_MALWARE_SCANS_FILTER_CRITERION, 0),), +) + +LIST_MALWARE_SCANS_FILTER_CRITERIA: StaticSchema = ( + 18, + n0, + _LMSFCi, + 0, + (_LMSFC,), + ((LIST_MALWARE_SCANS_FILTER_CRITERION_LIST, {_sN: _fCi}),), +) + +LIST_MALWARE_SCANS_INPUT: StaticSchema = ( + 18, + n0, + _LMSI, + {_sSI: _cLMSR, _s: None}, + (_MR, _NT, _FCil, _SCo), + ( + (MAX_RESULTS, {_sQ: _mR}), + (STRING, {_sQ: _nT}), + (LIST_MALWARE_SCANS_FILTER_CRITERIA, {_sN: _fCil}), + (SORT_CRITERIA, {_sN: _sCo}), + ), ) -SIGNAL_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#SignalType"), - shape_type=ShapeType.ENUM, - members={ - "FINDING": {"target": UNIT}, - "CLOUD_TRAIL": {"target": UNIT}, - "S3_DATA_EVENTS": {"target": UNIT}, - "EKS_AUDIT_LOGS": {"target": UNIT}, - "FLOW_LOGS": {"target": UNIT}, - "DNS_LOGS": {"target": UNIT}, - "RUNTIME_MONITORING": {"target": UNIT}, - }, +MALWARE_SCAN: StaticSchema = ( + 18, + n0, + _MSa, + 0, + (_RAe, _RT, _SIc, _SSc, _SRSc, _STc, _SSA, _SCA), + ( + (NON_EMPTY_STRING, {_sN: _rAe}), + (MALWARE_PROTECTION_RESOURCE_TYPE, {_sN: _rT}), + (NON_EMPTY_STRING, {_sN: _sI}), + (MALWARE_PROTECTION_SCAN_STATUS, {_sN: _sS}), + (SCAN_RESULT_STATUS, {_sN: _sRSc}), + (MALWARE_PROTECTION_SCAN_TYPE, {_sN: _sTc}), + (TIMESTAMP, {_sN: _sSA}), + (TIMESTAMP, {_sN: _sCA}), + ), ) -SIGNAL = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Signal"), - members={ - "Uid": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="uid"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Type": { - "target": SIGNAL_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="type"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Description": { - "target": SIGNAL_DESCRIPTION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="description") - ], - }, - "Name": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="name"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "CreatedAt": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="createdAt"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "UpdatedAt": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="updatedAt"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "FirstSeenAt": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="firstSeenAt"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "LastSeenAt": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="lastSeenAt"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Severity": { - "target": DOUBLE, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="severity")], - }, - "Count": { - "target": INTEGER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="count"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "ResourceUids": { - "target": RESOURCE_UIDS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="resourceUids") - ], - }, - "ActorIds": { - "target": ACTOR_IDS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="actorIds")], - }, - "EndpointIds": { - "target": ENDPOINT_IDS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="endpointIds") - ], - }, - "SignalIndicators": { - "target": INDICATORS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="signalIndicators") - ], - }, - "Activities": { - "target": ACTIVITIES, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="activities") - ], - }, - }, +MALWARE_SCANS: StaticSchema = (16, n0, _MSal, 0, (_me,), ((MALWARE_SCAN, 0),)) + +LIST_MALWARE_SCANS_OUTPUT: StaticSchema = ( + 18, + n0, + _LMSO, + {_sSI: _cLMSRo, _smi: None}, + (_Sca, _NT), + ((MALWARE_SCANS, {_sN: _sc, _sm: None}), (STRING, {_sN: _nT})), +) + +LIST_MALWARE_SCANS: StaticOperationSchema = ( + 23, + n0, + _LMS, + {_smith: MappingProxyType({"method": "POST", "uri": "/malware-scan", "code": 200})}, + LIST_MALWARE_SCANS_INPUT, + LIST_MALWARE_SCANS_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +LIST_MEMBERS_INPUT: StaticSchema = ( + 18, + n0, + _LMI, + {_sSI: _cLMR, _s: None}, + (_DI, _MR, _NT, _OAn), + ( + (DETECTOR_ID, 9), + (MAX_RESULTS, {_sQ: _mR}), + (STRING, {_sQ: _nT}), + (STRING, {_sQ: _oAn}), + ), ) -SIGNALS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Signals"), - shape_type=ShapeType.LIST, - members={"member": {"target": SIGNAL}}, -) - -SEQUENCE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Sequence"), - members={ - "Uid": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="uid"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Description": { - "target": SEQUENCE_DESCRIPTION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="description"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Actors": { - "target": ACTORS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="actors")], - }, - "Resources": { - "target": RESOURCES, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="resources")], - }, - "Endpoints": { - "target": NETWORK_ENDPOINTS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="endpoints")], - }, - "Signals": { - "target": SIGNALS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="signals"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "SequenceIndicators": { - "target": INDICATORS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="sequenceIndicators") - ], - }, - "AdditionalSequenceTypes": { - "target": ADDITIONAL_SEQUENCE_TYPES, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="additionalSequenceTypes" - ) - ], - }, - }, +LIST_MEMBERS_OUTPUT: StaticSchema = ( + 18, + n0, + _LMO, + {_sSI: _cLMRo, _smi: None}, + (_Memb, _NT), + ((MEMBERS, {_sN: _mem}), (STRING, {_sN: _nT})), ) -DETECTION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Detection"), - members={ - "Anomaly": { - "target": ANOMALY, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="anomaly")], - }, - "Sequence": { - "target": SEQUENCE, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="sequence")], - }, - }, +LIST_MEMBERS: StaticOperationSchema = ( + 23, + n0, + _LM, + { + _smith: MappingProxyType( + {"method": "GET", "uri": "/detector/{DetectorId}/member", "code": 200} + ) + }, + LIST_MEMBERS_INPUT, + LIST_MEMBERS_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), ) -DETECTION_RULE_CONFIGURATION_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DetectionRuleConfigurationStatus"), - shape_type=ShapeType.ENUM, - members={ - "ACTIVE": {"target": UNIT}, - "PROCESSING": {"target": UNIT}, - "FAILED": {"target": UNIT}, - }, +LIST_ORGANIZATION_ADMIN_ACCOUNTS_INPUT: StaticSchema = ( + 18, + n0, + _LOAAI, + {_sSI: _cLOAAR, _s: None}, + (_MR, _NT), + ((MAX_RESULTS, {_sQ: _mR}), (STRING, {_sQ: _nT})), ) -DETECTION_RULE_DATA_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DetectionRuleDataSource"), - shape_type=ShapeType.ENUM, - members={"CLOUDTRAIL_MANAGEMENT_EVENT": {"target": UNIT}}, +LIST_ORGANIZATION_ADMIN_ACCOUNTS_OUTPUT: StaticSchema = ( + 18, + n0, + _LOAAO, + {_sSI: _cLOAARo, _smi: None}, + (_AAd, _NT), + ((ADMIN_ACCOUNTS, {_sN: _aA}), (STRING, {_sN: _nT})), ) -DETECTION_RULE_DESCRIPTION = Schema( - id=ShapeID("com.amazonaws.guardduty#DetectionRuleDescription"), - shape_type=ShapeType.STRING, +LIST_ORGANIZATION_ADMIN_ACCOUNTS: StaticOperationSchema = ( + 23, + n0, + _LOAA, + {_smith: MappingProxyType({"method": "GET", "uri": "/admin", "code": 200})}, + LIST_ORGANIZATION_ADMIN_ACCOUNTS_INPUT, + LIST_ORGANIZATION_ADMIN_ACCOUNTS_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +LIST_PUBLISHING_DESTINATIONS_INPUT: StaticSchema = ( + 18, + n0, + _LPDI, + {_sSI: _cLPDR, _s: None}, + (_DI, _MR, _NT), + ((DETECTOR_ID, 9), (MAX_RESULTS, {_sQ: _mR}), (STRING, {_sQ: _nT})), ) -DETECTION_RULE_FILTER_CONDITION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DetectionRuleFilterCondition"), - shape_type=ShapeType.ENUM, - members={"EQUALS": {"target": UNIT}, "CONTAINS": {"target": UNIT}}, +LIST_PUBLISHING_DESTINATIONS_OUTPUT: StaticSchema = ( + 18, + n0, + _LPDO, + {_sSI: _cLPDRo, _smi: None}, + (_Dest, _NT), + ((DESTINATIONS, {_sN: _des, _sm: None}), (STRING, {_sN: _nT})), ) -FILTER_FIELD_NAME = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#FilterFieldName"), - shape_type=ShapeType.ENUM, - members={ - "NAME": {"target": UNIT}, - "DESCRIPTION": {"target": UNIT}, - "DATA_SOURCE": {"target": UNIT}, - "SEVERITY": {"target": UNIT}, - "TACTIC": {"target": UNIT}, - "TECHNIQUE": {"target": UNIT}, - "SERVICE": {"target": UNIT}, - }, +LIST_PUBLISHING_DESTINATIONS: StaticOperationSchema = ( + 23, + n0, + _LPDi, + { + _smith: MappingProxyType( + { + "method": "GET", + "uri": "/detector/{DetectorId}/publishingDestination", + "code": 200, + } + ) + }, + LIST_PUBLISHING_DESTINATIONS_INPUT, + LIST_PUBLISHING_DESTINATIONS_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +GUARD_DUTY_ARN: StaticSchema = (3, n0, _GDA, 0) + +LIST_TAGS_FOR_RESOURCE_INPUT: StaticSchema = ( + 18, + n0, + _LTFRI, + {_sSI: _cLTFRR, _s: None}, + (_RAe,), + ((GUARD_DUTY_ARN, 9),), ) - -DETECTION_RULE_FILTER_VALUE = Schema( - id=ShapeID("com.amazonaws.guardduty#DetectionRuleFilterValue"), - shape_type=ShapeType.STRING, -) - -DETECTION_RULE_FILTER_VALUES = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DetectionRuleFilterValues"), - shape_type=ShapeType.LIST, - members={"member": {"target": DETECTION_RULE_FILTER_VALUE}}, -) - -DETECTION_RULE_FILTER = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DetectionRuleFilter"), - members={ - "Name": { - "target": FILTER_FIELD_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="name"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Values": { - "target": DETECTION_RULE_FILTER_VALUES, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="values"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Condition": { - "target": DETECTION_RULE_FILTER_CONDITION, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="condition")], - }, - }, + +LIST_TAGS_FOR_RESOURCE_OUTPUT: StaticSchema = ( + 18, + n0, + _LTFRO, + {_sSI: _cLTFRRo, _smi: None}, + (_Ta,), + ((TAG_MAP, {_sN: _ta}),), +) + +LIST_TAGS_FOR_RESOURCE: StaticOperationSchema = ( + 23, + n0, + _LTFR, + { + _smith: MappingProxyType( + {"method": "GET", "uri": "/tags/{ResourceArn}", "code": 200} + ) + }, + LIST_TAGS_FOR_RESOURCE_INPUT, + LIST_TAGS_FOR_RESOURCE_OUTPUT, + (ACCESS_DENIED_EXCEPTION, BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +LIST_THREAT_ENTITY_SETS_INPUT: StaticSchema = ( + 18, + n0, + _LTESI, + {_sSI: _cLTESR, _s: None}, + (_DI, _MR, _NT), + ((DETECTOR_ID, 9), (MAX_RESULTS, {_sQ: _mR}), (STRING, {_sQ: _nT})), +) + +THREAT_ENTITY_SET_IDS: StaticSchema = (16, n0, _TESIh, 0, (_me,), ((STRING, 0),)) + +LIST_THREAT_ENTITY_SETS_OUTPUT: StaticSchema = ( + 18, + n0, + _LTESO, + {_sSI: _cLTESRo, _smi: None}, + (_TESIh, _NT), + ((THREAT_ENTITY_SET_IDS, {_sN: _tESIh, _sm: None}), (STRING, {_sN: _nT})), +) + +LIST_THREAT_ENTITY_SETS: StaticOperationSchema = ( + 23, + n0, + _LTES, + { + _smith: MappingProxyType( + { + "method": "GET", + "uri": "/detector/{DetectorId}/threatentityset", + "code": 200, + } + ) + }, + LIST_THREAT_ENTITY_SETS_INPUT, + LIST_THREAT_ENTITY_SETS_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +LIST_THREAT_INTEL_SETS_INPUT: StaticSchema = ( + 18, + n0, + _LTISI, + {_sSI: _cLTISR, _s: None}, + (_DI, _MR, _NT), + ((DETECTOR_ID, 9), (MAX_RESULTS, {_sQ: _mR}), (STRING, {_sQ: _nT})), +) + +THREAT_INTEL_SET_IDS: StaticSchema = (16, n0, _TISIh, 0, (_me,), ((STRING, 0),)) + +LIST_THREAT_INTEL_SETS_OUTPUT: StaticSchema = ( + 18, + n0, + _LTISO, + {_sSI: _cLTISRo, _smi: None}, + (_TISIh, _NT), + ((THREAT_INTEL_SET_IDS, {_sN: _tISIh, _sm: None}), (STRING, {_sN: _nT})), ) -DETECTION_RULE_FILTER_LIST = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DetectionRuleFilterList"), - shape_type=ShapeType.LIST, - members={"member": {"target": DETECTION_RULE_FILTER}}, -) - -DETECTION_RULE_MAX_RESULTS = Schema( - id=ShapeID("com.amazonaws.guardduty#DetectionRuleMaxResults"), - shape_type=ShapeType.INTEGER, -) - -DETECTION_RULE_ORG_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DetectionRuleOrgConfiguration"), - members={ - "RuleId": { - "target": RULE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="ruleId"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Mode": { - "target": ASSOCIATION_MODE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="mode"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Status": { - "target": DETECTION_RULE_CONFIGURATION_STATUS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="status"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "StatusReason": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="statusReason") - ], - }, - "IncludeAccountIds": { - "target": DETECTION_RULE_ACCOUNT_IDS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="includeAccountIds"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "ExcludeAccountIds": { - "target": DETECTION_RULE_ACCOUNT_IDS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="excludeAccountIds"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "CreatedAt": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="createdAt"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "UpdatedAt": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="updatedAt"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "ExpiresAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="expiresAt")], - }, - }, -) +LIST_THREAT_INTEL_SETS: StaticOperationSchema = ( + 23, + n0, + _LTIS, + { + _smith: MappingProxyType( + { + "method": "GET", + "uri": "/detector/{DetectorId}/threatintelset", + "code": 200, + } + ) + }, + LIST_THREAT_INTEL_SETS_INPUT, + LIST_THREAT_INTEL_SETS_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +LIST_TRUSTED_ENTITY_SETS_INPUT: StaticSchema = ( + 18, + n0, + _LTESIi, + {_sSI: _cLTESRom, _s: None}, + (_DI, _MR, _NT), + ((DETECTOR_ID, 9), (MAX_RESULTS, {_sQ: _mR}), (STRING, {_sQ: _nT})), +) + +TRUSTED_ENTITY_SET_IDS: StaticSchema = (16, n0, _TESIru, 0, (_me,), ((STRING, 0),)) + +LIST_TRUSTED_ENTITY_SETS_OUTPUT: StaticSchema = ( + 18, + n0, + _LTESOi, + {_sSI: _cLTESRoma, _smi: None}, + (_TESIru, _NT), + ((TRUSTED_ENTITY_SET_IDS, {_sN: _tESIru, _sm: None}), (STRING, {_sN: _nT})), +) + +LIST_TRUSTED_ENTITY_SETS: StaticOperationSchema = ( + 23, + n0, + _LTESi, + { + _smith: MappingProxyType( + { + "method": "GET", + "uri": "/detector/{DetectorId}/trustedentityset", + "code": 200, + } + ) + }, + LIST_TRUSTED_ENTITY_SETS_INPUT, + LIST_TRUSTED_ENTITY_SETS_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +S3_OBJECT_FOR_SEND_OBJECT_MALWARE_SCAN: StaticSchema = ( + 18, + n0, + _SOFSOMS, + 0, + (_Bu, _Ke, _VI), + ((STRING, {_sN: _bu}), (STRING, {_sN: _ke}), (STRING, {_sN: _vI})), +) + +SEND_OBJECT_MALWARE_SCAN_INPUT: StaticSchema = ( + 18, + n0, + _SOMSI, + {_sSI: _cSOMSR, _s: None}, + (_SO,), + ((S3_OBJECT_FOR_SEND_OBJECT_MALWARE_SCAN, {_sN: _sO}),), +) -DETECTION_RULE_ORG_CONFIGURATION_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DetectionRuleOrgConfigurationSummary"), - members={ - "RuleId": { - "target": RULE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="ruleId"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Mode": { - "target": ASSOCIATION_MODE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="mode"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Status": { - "target": DETECTION_RULE_CONFIGURATION_STATUS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="status"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "StatusReason": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="statusReason") - ], - }, - "CreatedAt": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="createdAt"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "UpdatedAt": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="updatedAt"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "ExpiresAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="expiresAt")], - }, - }, +SEND_OBJECT_MALWARE_SCAN_OUTPUT: StaticSchema = ( + 18, + n0, + _SOMSO, + {_sSI: _cSOMSRo, _smi: None}, +) + +SEND_OBJECT_MALWARE_SCAN: StaticOperationSchema = ( + 23, + n0, + _SOMS, + { + _smith: MappingProxyType( + {"method": "POST", "uri": "/object-malware-scan/send", "code": 200} + ) + }, + SEND_OBJECT_MALWARE_SCAN_INPUT, + SEND_OBJECT_MALWARE_SCAN_OUTPUT, + (ACCESS_DENIED_EXCEPTION, BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +RESOURCE_ARN: StaticSchema = (3, n0, _RAe, 0) + +RECOVERY_POINT: StaticSchema = ( + 18, + n0, + _RP, + 0, + (_BVN, _CSD), + ((STRING, {_sN: _bVN, _sm: None}), (CONTINUOUS_SCAN_DETAILS, {_sN: _cSD})), +) + +START_MALWARE_SCAN_CONFIGURATION: StaticSchema = ( + 18, + n0, + _SMSC, + 0, + (_Ro, _ISD, _RP), + ( + (NON_EMPTY_STRING, {_sN: _ro, _sm: None}), + (INCREMENTAL_SCAN_DETAILS, {_sN: _iSD}), + (RECOVERY_POINT, {_sN: _rP}), + ), ) -DETECTION_RULE_ORG_CONFIGURATION_SUMMARY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DetectionRuleOrgConfigurationSummaryList"), - shape_type=ShapeType.LIST, - members={"member": {"target": DETECTION_RULE_ORG_CONFIGURATION_SUMMARY}}, +START_MALWARE_SCAN_INPUT: StaticSchema = ( + 18, + n0, + _SMSI, + {_sSI: _cSMSR, _s: None}, + (_RAe, _CTl, _SCca), + ( + (RESOURCE_ARN, {_sN: _rAe, _sm: None}), + (CLIENT_TOKEN, {_sN: _cTl, _sTm: None}), + (START_MALWARE_SCAN_CONFIGURATION, {_sN: _sCca}), + ), ) -DETECTION_RULE_SERVICE_NAME = Schema( - id=ShapeID("com.amazonaws.guardduty#DetectionRuleServiceName"), - shape_type=ShapeType.STRING, +START_MALWARE_SCAN_OUTPUT: StaticSchema = ( + 18, + n0, + _SMSO, + {_sSI: _cSMSRo, _smi: None}, + (_SIc,), + ((NON_EMPTY_STRING, {_sN: _sI}),), ) -DETECTION_RULE_SEVERITY = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DetectionRuleSeverity"), - shape_type=ShapeType.ENUM, - members={ - "CRITICAL": {"target": UNIT}, - "HIGH": {"target": UNIT}, - "MEDIUM": {"target": UNIT}, - "LOW": {"target": UNIT}, +START_MALWARE_SCAN: StaticOperationSchema = ( + 23, + n0, + _SMS, + { + _smith: MappingProxyType( + {"method": "POST", "uri": "/malware-scan/start", "code": 200} + ) }, + START_MALWARE_SCAN_INPUT, + START_MALWARE_SCAN_OUTPUT, + (BAD_REQUEST_EXCEPTION, CONFLICT_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), ) -DETECTION_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DetectionSource"), - shape_type=ShapeType.ENUM, - members={"AMAZON": {"target": UNIT}, "BITDEFENDER": {"target": UNIT}}, -) - -MANAGED_BY = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ManagedBy"), - shape_type=ShapeType.ENUM, - members={"GUARDDUTY_POLICY": {"target": UNIT}}, -) - -DETECTOR_ADDITIONAL_CONFIGURATION_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DetectorAdditionalConfigurationResult"), - members={ - "Name": { - "target": FEATURE_ADDITIONAL_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="name")], - }, - "Status": { - "target": FEATURE_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="status")], - }, - "UpdatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="updatedAt")], - }, - "ManagedBy": { - "target": MANAGED_BY, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="managedBy")], - }, - }, +START_MONITORING_MEMBERS_INPUT: StaticSchema = ( + 18, + n0, + _SMMI, + {_sSI: _cSMMR, _s: None}, + (_DI, _AIcco), + ((DETECTOR_ID, 9), (ACCOUNT_IDS, {_sN: _aIcc, _sm: None})), ) -DETECTOR_ADDITIONAL_CONFIGURATION_RESULTS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DetectorAdditionalConfigurationResults"), - shape_type=ShapeType.LIST, - members={"member": {"target": DETECTOR_ADDITIONAL_CONFIGURATION_RESULT}}, -) - -DETECTOR_FEATURE_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DetectorFeatureResult"), - shape_type=ShapeType.ENUM, - members={ - "FLOW_LOGS": {"target": UNIT}, - "CLOUD_TRAIL": {"target": UNIT}, - "DNS_LOGS": {"target": UNIT}, - "S3_DATA_EVENTS": {"target": UNIT}, - "EKS_AUDIT_LOGS": {"target": UNIT}, - "EBS_MALWARE_PROTECTION": {"target": UNIT}, - "RDS_LOGIN_EVENTS": {"target": UNIT}, - "LAMBDA_NETWORK_LOGS": {"target": UNIT}, - "EKS_RUNTIME_MONITORING": {"target": UNIT}, - "RUNTIME_MONITORING": {"target": UNIT}, - "AI_PROTECTION": {"target": UNIT}, - "AI_ANALYST": {"target": UNIT}, - }, +START_MONITORING_MEMBERS_OUTPUT: StaticSchema = ( + 18, + n0, + _SMMO, + {_sSI: _cSMMRo, _smi: None}, + (_UAnp,), + ((UNPROCESSED_ACCOUNTS, {_sN: _uAn, _sm: None}),), ) -DETECTOR_FEATURE_CONFIGURATION_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DetectorFeatureConfigurationResult"), - members={ - "Name": { - "target": DETECTOR_FEATURE_RESULT, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="name")], - }, - "Status": { - "target": FEATURE_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="status")], - }, - "UpdatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="updatedAt")], - }, - "AdditionalConfiguration": { - "target": DETECTOR_ADDITIONAL_CONFIGURATION_RESULTS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="additionalConfiguration" - ) - ], - }, - "ManagedBy": { - "target": MANAGED_BY, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="managedBy")], - }, +START_MONITORING_MEMBERS: StaticOperationSchema = ( + 23, + n0, + _SMM, + { + _smith: MappingProxyType( + { + "method": "POST", + "uri": "/detector/{DetectorId}/member/start", + "code": 200, + } + ) }, + START_MONITORING_MEMBERS_INPUT, + START_MONITORING_MEMBERS_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), ) -DETECTOR_FEATURE_CONFIGURATIONS_RESULTS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DetectorFeatureConfigurationsResults"), - shape_type=ShapeType.LIST, - members={"member": {"target": DETECTOR_FEATURE_CONFIGURATION_RESULT}}, +STOP_MONITORING_MEMBERS_INPUT: StaticSchema = ( + 18, + n0, + _SMMIt, + {_sSI: _cSMMRom, _s: None}, + (_DI, _AIcco), + ((DETECTOR_ID, 9), (ACCOUNT_IDS, {_sN: _aIcc, _sm: None})), ) -DETECTOR_IDS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DetectorIds"), - shape_type=ShapeType.LIST, - members={"member": {"target": DETECTOR_ID}}, +STOP_MONITORING_MEMBERS_OUTPUT: StaticSchema = ( + 18, + n0, + _SMMOt, + {_sSI: _cSMMRoma, _smi: None}, + (_UAnp,), + ((UNPROCESSED_ACCOUNTS, {_sN: _uAn, _sm: None}),), ) -DETECTOR_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DetectorStatus"), - shape_type=ShapeType.ENUM, - members={"ENABLED": {"target": UNIT}, "DISABLED": {"target": UNIT}}, -) - -DISABLE_ORGANIZATION_ADMIN_ACCOUNT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DisableOrganizationAdminAccountInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#DisableOrganizationAdminAccountRequest", +STOP_MONITORING_MEMBERS: StaticOperationSchema = ( + 23, + n0, + _SMMt, + { + _smith: MappingProxyType( + {"method": "POST", "uri": "/detector/{DetectorId}/member/stop", "code": 200} ) - ], - members={ - "AdminAccountId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="adminAccountId"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } }, + STOP_MONITORING_MEMBERS_INPUT, + STOP_MONITORING_MEMBERS_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), ) -DISABLE_ORGANIZATION_ADMIN_ACCOUNT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DisableOrganizationAdminAccountOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#DisableOrganizationAdminAccountResponse", - ) - ], -) - -DISABLE_ORGANIZATION_ADMIN_ACCOUNT = Schema( - id=ShapeID("com.amazonaws.guardduty#DisableOrganizationAdminAccount"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/admin/disable", "code": 200} - ), - ) - ], +TAG_RESOURCE_INPUT: StaticSchema = ( + 18, + n0, + _TRI, + {_sSI: _cTRR, _s: None}, + (_RAe, _Ta), + ((GUARD_DUTY_ARN, 9), (TAG_MAP, {_sN: _ta, _sm: None})), ) -DISASSOCIATE_FROM_ADMINISTRATOR_ACCOUNT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DisassociateFromAdministratorAccountInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#DisassociateFromAdministratorAccountRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) +TAG_RESOURCE_OUTPUT: StaticSchema = (18, n0, _TRO, {_sSI: _cTRRo, _smi: None}) -DISASSOCIATE_FROM_ADMINISTRATOR_ACCOUNT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DisassociateFromAdministratorAccountOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#DisassociateFromAdministratorAccountResponse", - ) - ], -) - -DISASSOCIATE_FROM_ADMINISTRATOR_ACCOUNT = Schema( - id=ShapeID("com.amazonaws.guardduty#DisassociateFromAdministratorAccount"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/detector/{DetectorId}/administrator/disassociate", - "code": 200, - } - ), - ) - ], +TAG_RESOURCE: StaticOperationSchema = ( + 23, + n0, + _TRa, + { + _smith: MappingProxyType( + {"method": "POST", "uri": "/tags/{ResourceArn}", "code": 204} + ) + }, + TAG_RESOURCE_INPUT, + TAG_RESOURCE_OUTPUT, + (ACCESS_DENIED_EXCEPTION, BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), ) -DISASSOCIATE_FROM_MASTER_ACCOUNT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DisassociateFromMasterAccountInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#DisassociateFromMasterAccountRequest", +UNARCHIVE_FINDINGS_INPUT: StaticSchema = ( + 18, + n0, + _UFIn, + {_sSI: _cUFR, _s: None}, + (_DI, _FIi), + ((DETECTOR_ID, 9), (FINDING_IDS, {_sN: _fI, _sm: None})), +) + +UNARCHIVE_FINDINGS_OUTPUT: StaticSchema = (18, n0, _UFO, {_sSI: _cUFRo, _smi: None}) + +UNARCHIVE_FINDINGS: StaticOperationSchema = ( + 23, + n0, + _UFn, + { + _smith: MappingProxyType( + { + "method": "POST", + "uri": "/detector/{DetectorId}/findings/unarchive", + "code": 200, + } ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } }, -) - -DISASSOCIATE_FROM_MASTER_ACCOUNT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DisassociateFromMasterAccountOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#DisassociateFromMasterAccountResponse", - ) - ], -) - -DISASSOCIATE_FROM_MASTER_ACCOUNT = Schema( - id=ShapeID("com.amazonaws.guardduty#DisassociateFromMasterAccount"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/detector/{DetectorId}/master/disassociate", - "code": 200, - } - ), - ) - ], -) + UNARCHIVE_FINDINGS_INPUT, + UNARCHIVE_FINDINGS_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +TAG_KEY_LIST: StaticSchema = (16, n0, _TKL, 0, (_me,), ((TAG_KEY, 0),)) -DISASSOCIATE_MEMBERS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DisassociateMembersInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#DisassociateMembersRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "AccountIds": { - "target": ACCOUNT_IDS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="accountIds"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - }, +UNTAG_RESOURCE_INPUT: StaticSchema = ( + 18, + n0, + _URI, + {_sSI: _cURR, _s: None}, + (_RAe, _TKa), + ((GUARD_DUTY_ARN, 9), (TAG_KEY_LIST, {_sQ: _tK, _sm: None})), ) -DISASSOCIATE_MEMBERS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#DisassociateMembersOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#DisassociateMembersResponse", - ) - ], - members={ - "UnprocessedAccounts": { - "target": UNPROCESSED_ACCOUNTS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="unprocessedAccounts" - ), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, -) +UNTAG_RESOURCE_OUTPUT: StaticSchema = (18, n0, _URO, {_sSI: _cURRo, _smi: None}) -DISASSOCIATE_MEMBERS = Schema( - id=ShapeID("com.amazonaws.guardduty#DisassociateMembers"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/detector/{DetectorId}/member/disassociate", - "code": 200, - } - ), +UNTAG_RESOURCE: StaticOperationSchema = ( + 23, + n0, + _URn, + { + _smith: MappingProxyType( + {"method": "DELETE", "uri": "/tags/{ResourceArn}", "code": 204} ) - ], -) - -EBS_SNAPSHOT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#EbsSnapshot"), - members={ - "DeviceName": { - "target": NON_EMPTY_STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="deviceName") - ], - } }, + UNTAG_RESOURCE_INPUT, + UNTAG_RESOURCE_OUTPUT, + (ACCESS_DENIED_EXCEPTION, BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), ) -EBS_SNAPSHOT_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#EbsSnapshotDetails"), - members={ - "SnapshotArn": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="snapshotArn") - ], - } - }, -) - -EBS_SNAPSHOT_PRESERVATION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#EbsSnapshotPreservation"), - shape_type=ShapeType.ENUM, - members={ - "NO_RETENTION": {"target": UNIT}, - "RETENTION_WITH_FINDING": {"target": UNIT}, - }, +UPDATE_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT: StaticSchema = ( + 18, + n0, + _UCDRAI, + {_sSI: _cUCDRAR, _s: None}, + (_RI, _AIs, _Mo), + ((RULE_ID, 9), (ASSOCIATION_ID, 9), (ASSOCIATION_MODE, {_sN: _mo, _sm: None})), ) -EBS_VOLUME_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#EbsVolumeDetails"), - members={ - "ScannedVolumeDetails": { - "target": VOLUME_DETAILS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="scannedVolumeDetails" - ) - ], - }, - "SkippedVolumeDetails": { - "target": VOLUME_DETAILS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="skippedVolumeDetails" - ) - ], - }, - }, +UPDATE_CUSTOM_DETECTION_RULE_ASSOCIATION_OUTPUT: StaticSchema = ( + 18, + n0, + _UCDRAO, + {_sSI: _cUCDRARo, _smi: None}, ) -HIGHEST_SEVERITY_THREAT_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#HighestSeverityThreatDetails"), - members={ - "Severity": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="severity")], - }, - "ThreatName": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="threatName") - ], - }, - "Count": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="count")], - }, - }, +UPDATE_CUSTOM_DETECTION_RULE_ASSOCIATION: StaticOperationSchema = ( + 23, + n0, + _UCDRA, + { + _smith: MappingProxyType( + { + "method": "PUT", + "uri": "/custom-detection-rule/rule/{RuleId}/association/{AssociationId}", + "code": 200, + } + ) + }, + UPDATE_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT, + UPDATE_CUSTOM_DETECTION_RULE_ASSOCIATION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_ERROR_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + ), ) -SCANNED_ITEM_COUNT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ScannedItemCount"), - members={ - "TotalGb": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="totalGb")], - }, - "Files": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="files")], - }, - "Volumes": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="volumes")], - }, - }, +UPDATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT: StaticSchema = ( + 18, + n0, + _UCDROCI, + {_sSI: _cUCDROCR, _s: None}, + (_RI, _Mo, _IAI, _EAI), + ( + (RULE_ID, 9), + (ASSOCIATION_MODE, {_sN: _mo, _sm: None}), + (DETECTION_RULE_ACCOUNT_IDS, {_sN: _iAI}), + (DETECTION_RULE_ACCOUNT_IDS, {_sN: _eAI}), + ), ) -SCAN_FILE_PATH = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ScanFilePath"), - members={ - "FilePath": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="filePath")], - }, - "VolumeArn": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="volumeArn")], - }, - "Hash": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="hash")], - }, - "FileName": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="fileName")], - }, - }, +UPDATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_OUTPUT: StaticSchema = ( + 18, + n0, + _UCDROCO, + {_sSI: _cUCDROCRo, _smi: None}, +) + +UPDATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION: StaticOperationSchema = ( + 23, + n0, + _UCDROC, + { + _smith: MappingProxyType( + { + "method": "PUT", + "uri": "/custom-detection-rule/org-configuration/{RuleId}", + "code": 200, + } + ) + }, + UPDATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT, + UPDATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_ERROR_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + ), ) -FILE_PATHS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#FilePaths"), - shape_type=ShapeType.LIST, - members={"member": {"target": SCAN_FILE_PATH}}, -) - -SCAN_THREAT_NAME = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ScanThreatName"), - members={ - "Name": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="name")], - }, - "Severity": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="severity")], - }, - "ItemCount": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="itemCount")], - }, - "FilePaths": { - "target": FILE_PATHS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="filePaths")], - }, - }, +UPDATE_DETECTOR_INPUT: StaticSchema = ( + 18, + n0, + _UDI, + {_sSI: _cUDR, _s: None}, + (_DI, _En, _FPF, _DS, _F), + ( + (DETECTOR_ID, 9), + (BOOLEAN, {_sN: _en}), + (FINDING_PUBLISHING_FREQUENCY, {_sN: _fPF}), + (DATA_SOURCE_CONFIGURATIONS, {_sN: _dS}), + (DETECTOR_FEATURE_CONFIGURATIONS, {_sN: _f}), + ), ) -SCAN_THREAT_NAMES = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ScanThreatNames"), - shape_type=ShapeType.LIST, - members={"member": {"target": SCAN_THREAT_NAME}}, -) - -THREAT_DETECTED_BY_NAME = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ThreatDetectedByName"), - members={ - "ItemCount": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="itemCount")], - }, - "UniqueThreatNameCount": { - "target": INTEGER, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="uniqueThreatNameCount" - ) - ], - }, - "Shortened": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="shortened")], - }, - "ThreatNames": { - "target": SCAN_THREAT_NAMES, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="threatNames") - ], - }, - }, -) +UPDATE_DETECTOR_OUTPUT: StaticSchema = (18, n0, _UDO, {_sSI: _cUDRo, _smi: None}) -THREATS_DETECTED_ITEM_COUNT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ThreatsDetectedItemCount"), - members={ - "Files": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="files")], - } +UPDATE_DETECTOR: StaticOperationSchema = ( + 23, + n0, + _UD, + { + _smith: MappingProxyType( + {"method": "POST", "uri": "/detector/{DetectorId}", "code": 200} + ) }, + UPDATE_DETECTOR_INPUT, + UPDATE_DETECTOR_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), ) -SCAN_DETECTIONS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ScanDetections"), - members={ - "ScannedItemCount": { - "target": SCANNED_ITEM_COUNT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="scannedItemCount") - ], - }, - "ThreatsDetectedItemCount": { - "target": THREATS_DETECTED_ITEM_COUNT, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="threatsDetectedItemCount" - ) - ], - }, - "HighestSeverityThreatDetails": { - "target": HIGHEST_SEVERITY_THREAT_DETAILS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), - value="highestSeverityThreatDetails", - ) - ], - }, - "ThreatDetectedByName": { - "target": THREAT_DETECTED_BY_NAME, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="threatDetectedByName" - ) - ], - }, - }, +UPDATE_FILTER_INPUT: StaticSchema = ( + 18, + n0, + _UFIp, + {_sSI: _cUFRom, _s: None}, + (_DI, _FN, _De, _Ac, _Ra, _FCin), + ( + (DETECTOR_ID, 9), + (STRING, 9), + (FILTER_DESCRIPTION, {_sN: _de}), + (FILTER_ACTION, {_sN: _ac}), + (FILTER_RANK, {_sN: _ra}), + (FINDING_CRITERIA, {_sN: _fCin}), + ), ) -SOURCES = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Sources"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, -) - -EBS_VOLUME_SCAN_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#EbsVolumeScanDetails"), - members={ - "ScanId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="scanId")], - }, - "ScanStartedAt": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="scanStartedAt") - ], - }, - "ScanCompletedAt": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="scanCompletedAt") - ], - }, - "TriggerFindingId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="triggerFindingId") - ], - }, - "Sources": { - "target": SOURCES, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="sources")], - }, - "ScanDetections": { - "target": SCAN_DETECTIONS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="scanDetections") - ], - }, - "ScanType": { - "target": SCAN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="scanType")], - }, - }, +UPDATE_FILTER_OUTPUT: StaticSchema = ( + 18, + n0, + _UFOp, + {_sSI: _cUFRoma, _smi: None}, + (_N,), + ((FILTER_NAME, {_sN: _n, _sm: None}),), +) + +UPDATE_FILTER: StaticOperationSchema = ( + 23, + n0, + _UFp, + { + _smith: MappingProxyType( + { + "method": "POST", + "uri": "/detector/{DetectorId}/filter/{FilterName}", + "code": 200, + } + ) + }, + UPDATE_FILTER_INPUT, + UPDATE_FILTER_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +UPDATE_FINDINGS_FEEDBACK_INPUT: StaticSchema = ( + 18, + n0, + _UFFI, + {_sSI: _cUFFR, _s: None}, + (_DI, _FIi, _Fe, _Com), + ( + (DETECTOR_ID, 9), + (FINDING_IDS, {_sN: _fI, _sm: None}), + (FEEDBACK, {_sN: _fee, _sm: None}), + (SENSITIVE_STRING, {_sN: _com}), + ), ) -EC2_IMAGE_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Ec2ImageDetails"), - members={ - "ImageArn": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="imageArn")], - } - }, +UPDATE_FINDINGS_FEEDBACK_OUTPUT: StaticSchema = ( + 18, + n0, + _UFFO, + {_sSI: _cUFFRo, _smi: None}, +) + +UPDATE_FINDINGS_FEEDBACK: StaticOperationSchema = ( + 23, + n0, + _UFF, + { + _smith: MappingProxyType( + { + "method": "POST", + "uri": "/detector/{DetectorId}/findings/feedback", + "code": 200, + } + ) + }, + UPDATE_FINDINGS_FEEDBACK_INPUT, + UPDATE_FINDINGS_FEEDBACK_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +UPDATE_IP_SET_INPUT: StaticSchema = ( + 18, + n0, + _UIPSI, + {_sSI: _cUIPSR, _s: None}, + (_DI, _ISI, _N, _Loc, _Activ, _EBO), + ( + (DETECTOR_ID, 9), + (STRING, 9), + (NAME, {_sN: _n}), + (LOCATION, {_sN: _loc}), + (BOOLEAN, {_sN: _act}), + (ACCOUNT_ID, {_sN: _eBO}), + ), ) -HOST_PATH = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#HostPath"), - members={ - "Path": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="path")], - } - }, +UPDATE_IP_SET_OUTPUT: StaticSchema = (18, n0, _UIPSO, {_sSI: _cUIPSRo, _smi: None}) + +UPDATE_IP_SET: StaticOperationSchema = ( + 23, + n0, + _UIPS, + { + _smith: MappingProxyType( + { + "method": "POST", + "uri": "/detector/{DetectorId}/ipset/{IpSetId}", + "code": 200, + } + ) + }, + UPDATE_IP_SET_INPUT, + UPDATE_IP_SET_OUTPUT, + (ACCESS_DENIED_EXCEPTION, BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +UPDATE_S3_BUCKET_RESOURCE: StaticSchema = ( + 18, + n0, + _USBR, + 0, + (_OP,), + ((MALWARE_PROTECTION_PLAN_OBJECT_PREFIXES_LIST, {_sN: _oP}),), +) + +UPDATE_PROTECTED_RESOURCE: StaticSchema = ( + 18, + n0, + _UPR, + 0, + (_SB,), + ((UPDATE_S3_BUCKET_RESOURCE, {_sN: _sB}),), +) + +UPDATE_MALWARE_PROTECTION_PLAN_INPUT: StaticSchema = ( + 18, + n0, + _UMPPI, + {_sSI: _cUMPPR, _s: None}, + (_MPPI, _Ro, _Actio, _PR), + ( + (STRING, 9), + (STRING, {_sN: _ro}), + (MALWARE_PROTECTION_PLAN_ACTIONS, {_sN: _acti}), + (UPDATE_PROTECTED_RESOURCE, {_sN: _pR}), + ), ) -VOLUME = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Volume"), - members={ - "Name": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="name")], - }, - "HostPath": { - "target": HOST_PATH, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="hostPath")], - }, - }, +UPDATE_MALWARE_PROTECTION_PLAN_OUTPUT: StaticSchema = ( + 18, + n0, + _UMPPO, + {_sSI: _sU, _smi: None}, +) + +UPDATE_MALWARE_PROTECTION_PLAN: StaticOperationSchema = ( + 23, + n0, + _UMPP, + { + _smith: MappingProxyType( + { + "method": "PATCH", + "uri": "/malware-protection-plan/{MalwareProtectionPlanId}", + "code": 200, + } + ) + }, + UPDATE_MALWARE_PROTECTION_PLAN_INPUT, + UPDATE_MALWARE_PROTECTION_PLAN_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + BAD_REQUEST_EXCEPTION, + INTERNAL_SERVER_ERROR_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + ), ) -VOLUMES = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Volumes"), - shape_type=ShapeType.LIST, - members={"member": {"target": VOLUME}}, -) - -ECS_TASK_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#EcsTaskDetails"), - members={ - "Arn": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="arn")], - }, - "DefinitionArn": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="definitionArn") - ], - }, - "Version": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="version")], - }, - "TaskCreatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="createdAt")], - }, - "StartedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="startedAt")], - }, - "StartedBy": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="startedBy")], - }, - "Tags": { - "target": TAGS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="tags")], - }, - "Volumes": { - "target": VOLUMES, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="volumes")], - }, - "Containers": { - "target": CONTAINERS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="containers") - ], - }, - "Group": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="group")], - }, - "LaunchType": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="launchType") - ], - }, - }, +UPDATE_MALWARE_SCAN_SETTINGS_INPUT: StaticSchema = ( + 18, + n0, + _UMSSI, + {_sSI: _cUMSSR, _s: None}, + (_DI, _SRCc, _ESP), + ( + (DETECTOR_ID, 9), + (SCAN_RESOURCE_CRITERIA, {_sN: _sRCc}), + (EBS_SNAPSHOT_PRESERVATION, {_sN: _eSP}), + ), ) -ECS_CLUSTER_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#EcsClusterDetails"), - members={ - "Name": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="name")], - }, - "Arn": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="arn")], - }, - "Status": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="status")], - }, - "ActiveServicesCount": { - "target": INTEGER, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="activeServicesCount" - ) - ], - }, - "RegisteredContainerInstancesCount": { - "target": INTEGER, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), - value="registeredContainerInstancesCount", - ) - ], - }, - "RunningTasksCount": { - "target": INTEGER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="runningTasksCount") - ], - }, - "Tags": { - "target": TAGS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="tags")], - }, - "TaskDetails": { - "target": ECS_TASK_DETAILS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="taskDetails") - ], - }, - }, +UPDATE_MALWARE_SCAN_SETTINGS_OUTPUT: StaticSchema = ( + 18, + n0, + _UMSSO, + {_sSI: _cUMSSRo, _smi: None}, +) + +UPDATE_MALWARE_SCAN_SETTINGS: StaticOperationSchema = ( + 23, + n0, + _UMSS, + { + _smith: MappingProxyType( + { + "method": "POST", + "uri": "/detector/{DetectorId}/malware-scan-settings", + "code": 200, + } + ) + }, + UPDATE_MALWARE_SCAN_SETTINGS_INPUT, + UPDATE_MALWARE_SCAN_SETTINGS_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +MEMBER_ADDITIONAL_CONFIGURATION: StaticSchema = ( + 18, + n0, + _MACe, + 0, + (_N, _St), + ((ORG_FEATURE_ADDITIONAL_CONFIGURATION, {_sN: _n}), (FEATURE_STATUS, {_sN: _st})), +) + +MEMBER_ADDITIONAL_CONFIGURATIONS: StaticSchema = ( + 16, + n0, + _MACem, + 0, + (_me,), + ((MEMBER_ADDITIONAL_CONFIGURATION, 0),), +) + +MEMBER_FEATURES_CONFIGURATION: StaticSchema = ( + 18, + n0, + _MFC, + 0, + (_N, _St, _ACd), + ( + (ORG_FEATURE, {_sN: _n}), + (FEATURE_STATUS, {_sN: _st}), + (MEMBER_ADDITIONAL_CONFIGURATIONS, {_sN: _aC}), + ), ) -EKS_CLUSTER_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#EksClusterDetails"), - members={ - "Name": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="name")], - }, - "Arn": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="arn")], - }, - "VpcId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="vpcId")], - }, - "Status": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="status")], - }, - "Tags": { - "target": TAGS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="tags")], - }, - "CreatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="createdAt")], - }, - }, +MEMBER_FEATURES_CONFIGURATIONS: StaticSchema = ( + 16, + n0, + _MFCe, + 0, + (_me,), + ((MEMBER_FEATURES_CONFIGURATION, 0),), +) + +UPDATE_MEMBER_DETECTORS_INPUT: StaticSchema = ( + 18, + n0, + _UMDI, + {_sSI: _cUMDR, _s: None}, + (_DI, _AIcco, _DS, _F), + ( + (DETECTOR_ID, 9), + (ACCOUNT_IDS, {_sN: _aIcc, _sm: None}), + (DATA_SOURCE_CONFIGURATIONS, {_sN: _dS}), + (MEMBER_FEATURES_CONFIGURATIONS, {_sN: _f}), + ), ) -ENABLE_ORGANIZATION_ADMIN_ACCOUNT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#EnableOrganizationAdminAccountInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#EnableOrganizationAdminAccountRequest", - ) - ], - members={ - "AdminAccountId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="adminAccountId"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, +UPDATE_MEMBER_DETECTORS_OUTPUT: StaticSchema = ( + 18, + n0, + _UMDO, + {_sSI: _cUMDRo, _smi: None}, + (_UAnp,), + ((UNPROCESSED_ACCOUNTS, {_sN: _uAn, _sm: None}),), +) + +UPDATE_MEMBER_DETECTORS: StaticOperationSchema = ( + 23, + n0, + _UMD, + { + _smith: MappingProxyType( + { + "method": "POST", + "uri": "/detector/{DetectorId}/member/detector/update", + "code": 200, + } + ) + }, + UPDATE_MEMBER_DETECTORS_INPUT, + UPDATE_MEMBER_DETECTORS_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +ORGANIZATION_KUBERNETES_AUDIT_LOGS_CONFIGURATION: StaticSchema = ( + 18, + n0, + _OKALC, + 0, + (_AE,), + ((BOOLEAN, {_sN: _aE, _sm: None}),), +) + +ORGANIZATION_KUBERNETES_CONFIGURATION: StaticSchema = ( + 18, + n0, + _OKC, + 0, + (_AL,), + ((ORGANIZATION_KUBERNETES_AUDIT_LOGS_CONFIGURATION, {_sN: _aL, _sm: None}),), +) + +ORGANIZATION_EBS_VOLUMES: StaticSchema = ( + 18, + n0, + _OEV, + 0, + (_AE,), + ((BOOLEAN, {_sN: _aE}),), +) + +ORGANIZATION_SCAN_EC2_INSTANCE_WITH_FINDINGS: StaticSchema = ( + 18, + n0, + _OSEIWF, + 0, + (_EV,), + ((ORGANIZATION_EBS_VOLUMES, {_sN: _eV}),), +) + +ORGANIZATION_MALWARE_PROTECTION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _OMPC, + 0, + (_SEIWF,), + ((ORGANIZATION_SCAN_EC2_INSTANCE_WITH_FINDINGS, {_sN: _sEIWF}),), +) + +ORGANIZATION_S3_LOGS_CONFIGURATION: StaticSchema = ( + 18, + n0, + _OSLC, + 0, + (_AE,), + ((BOOLEAN, {_sN: _aE, _sm: None}),), +) + +ORGANIZATION_DATA_SOURCE_CONFIGURATIONS: StaticSchema = ( + 18, + n0, + _ODSC, + 0, + (_SL, _K, _MP), + ( + (ORGANIZATION_S3_LOGS_CONFIGURATION, {_sN: _sLo}), + (ORGANIZATION_KUBERNETES_CONFIGURATION, {_sN: _k}), + (ORGANIZATION_MALWARE_PROTECTION_CONFIGURATION, {_sN: _mP}), + ), ) -ENABLE_ORGANIZATION_ADMIN_ACCOUNT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#EnableOrganizationAdminAccountOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#EnableOrganizationAdminAccountResponse", - ) - ], -) - -ENABLE_ORGANIZATION_ADMIN_ACCOUNT = Schema( - id=ShapeID("com.amazonaws.guardduty#EnableOrganizationAdminAccount"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/admin/enable", "code": 200} - ), - ) - ], -) - -THREAT_NAMES = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ThreatNames"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, -) - -THREAT_INTELLIGENCE_DETAIL = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ThreatIntelligenceDetail"), - members={ - "ThreatListName": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="threatListName") - ], - }, - "ThreatNames": { - "target": THREAT_NAMES, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="threatNames") - ], - }, - "ThreatFileSha256": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="threatFileSha256") - ], - }, - }, +ORGANIZATION_ADDITIONAL_CONFIGURATION: StaticSchema = ( + 18, + n0, + _OAC, + 0, + (_N, _AE), + ( + (ORG_FEATURE_ADDITIONAL_CONFIGURATION, {_sN: _n}), + (ORG_FEATURE_STATUS, {_sN: _aE}), + ), ) -THREAT_INTELLIGENCE_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ThreatIntelligenceDetails"), - shape_type=ShapeType.LIST, - members={"member": {"target": THREAT_INTELLIGENCE_DETAIL}}, +ORGANIZATION_ADDITIONAL_CONFIGURATIONS: StaticSchema = ( + 16, + n0, + _OACr, + 0, + (_me,), + ((ORGANIZATION_ADDITIONAL_CONFIGURATION, 0),), +) + +ORGANIZATION_FEATURE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _OFC, + 0, + (_N, _AE, _ACd), + ( + (ORG_FEATURE, {_sN: _n}), + (ORG_FEATURE_STATUS, {_sN: _aE}), + (ORGANIZATION_ADDITIONAL_CONFIGURATIONS, {_sN: _aC}), + ), ) -EVIDENCE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Evidence"), - members={ - "ThreatIntelligenceDetails": { - "target": THREAT_INTELLIGENCE_DETAILS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="threatIntelligenceDetails" - ) - ], - } - }, +ORGANIZATION_FEATURES_CONFIGURATIONS: StaticSchema = ( + 16, + n0, + _OFCr, + 0, + (_me,), + ((ORGANIZATION_FEATURE_CONFIGURATION, 0),), +) + +UPDATE_ORGANIZATION_CONFIGURATION_INPUT: StaticSchema = ( + 18, + n0, + _UOCI, + {_sSI: _cUOCR, _s: None}, + (_DI, _AE, _DS, _F, _AEOM), + ( + (DETECTOR_ID, 9), + (BOOLEAN, {_sN: _aE}), + (ORGANIZATION_DATA_SOURCE_CONFIGURATIONS, {_sN: _dS}), + (ORGANIZATION_FEATURES_CONFIGURATIONS, {_sN: _f}), + (AUTO_ENABLE_MEMBERS, {_sN: _aEOM}), + ), ) -FEEDBACK = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Feedback"), - shape_type=ShapeType.ENUM, - members={"USEFUL": {"target": UNIT}, "NOT_USEFUL": {"target": UNIT}}, -) - -FILTER_NAMES = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#FilterNames"), - shape_type=ShapeType.LIST, - members={"member": {"target": FILTER_NAME}}, -) - -FILTER_VERSION = Schema( - id=ShapeID("com.amazonaws.guardduty#FilterVersion"), shape_type=ShapeType.LONG -) - -NETWORK_INTERFACE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#NetworkInterface"), - members={ - "Ipv6Addresses": { - "target": IPV6_ADDRESSES, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="ipv6Addresses") - ], - }, - "NetworkInterfaceId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="networkInterfaceId") - ], - }, - "PrivateDnsName": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="privateDnsName") - ], - }, - "PrivateIpAddress": { - "target": SENSITIVE_STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="privateIpAddress") - ], - }, - "PrivateIpAddresses": { - "target": PRIVATE_IP_ADDRESSES, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="privateIpAddresses") - ], - }, - "PublicDnsName": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="publicDnsName") - ], - }, - "PublicIp": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="publicIp")], - }, - "SecurityGroups": { - "target": SECURITY_GROUPS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="securityGroups") - ], - }, - "SubnetId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="subnetId")], - }, - "VpcId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="vpcId")], - }, - }, +UPDATE_ORGANIZATION_CONFIGURATION_OUTPUT: StaticSchema = ( + 18, + n0, + _UOCO, + {_sSI: _cUOCRo, _smi: None}, +) + +UPDATE_ORGANIZATION_CONFIGURATION: StaticOperationSchema = ( + 23, + n0, + _UOC, + { + _smith: MappingProxyType( + {"method": "POST", "uri": "/detector/{DetectorId}/admin", "code": 200} + ) + }, + UPDATE_ORGANIZATION_CONFIGURATION_INPUT, + UPDATE_ORGANIZATION_CONFIGURATION_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +UPDATE_PUBLISHING_DESTINATION_INPUT: StaticSchema = ( + 18, + n0, + _UPDI, + {_sSI: _cUPDR, _s: None}, + (_DI, _DIe, _DP), + ((DETECTOR_ID, 9), (STRING, 9), (DESTINATION_PROPERTIES, {_sN: _dP})), +) + +UPDATE_PUBLISHING_DESTINATION_OUTPUT: StaticSchema = ( + 18, + n0, + _UPDO, + {_sSI: _cUPDRo, _smi: None}, +) + +UPDATE_PUBLISHING_DESTINATION: StaticOperationSchema = ( + 23, + n0, + _UPD, + { + _smith: MappingProxyType( + { + "method": "POST", + "uri": "/detector/{DetectorId}/publishingDestination/{DestinationId}", + "code": 200, + } + ) + }, + UPDATE_PUBLISHING_DESTINATION_INPUT, + UPDATE_PUBLISHING_DESTINATION_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +UPDATE_THREAT_ENTITY_SET_INPUT: StaticSchema = ( + 18, + n0, + _UTESI, + {_sSI: _cUTESR, _s: None}, + (_DI, _TESI, _N, _Loc, _EBO, _Activ), + ( + (DETECTOR_ID, 9), + (STRING, 9), + (NAME, {_sN: _n}), + (LOCATION, {_sN: _loc}), + (EXPECTED_BUCKET_OWNER, {_sN: _eBO}), + (BOOLEAN, {_sN: _act}), + ), ) -NETWORK_INTERFACES = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#NetworkInterfaces"), - shape_type=ShapeType.LIST, - members={"member": {"target": NETWORK_INTERFACE}}, -) - -INSTANCE_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#InstanceDetails"), - members={ - "AvailabilityZone": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="availabilityZone") - ], - }, - "IamInstanceProfile": { - "target": IAM_INSTANCE_PROFILE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="iamInstanceProfile") - ], - }, - "ImageDescription": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="imageDescription") - ], - }, - "ImageId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="imageId")], - }, - "InstanceId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="instanceId") - ], - }, - "InstanceState": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="instanceState") - ], - }, - "InstanceType": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="instanceType") - ], - }, - "OutpostArn": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="outpostArn") - ], - }, - "LaunchTime": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="launchTime") - ], - }, - "NetworkInterfaces": { - "target": NETWORK_INTERFACES, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="networkInterfaces") - ], - }, - "Platform": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="platform")], - }, - "ProductCodes": { - "target": PRODUCT_CODES, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="productCodes") - ], - }, - "Tags": { - "target": TAGS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="tags")], - }, - }, +UPDATE_THREAT_ENTITY_SET_OUTPUT: StaticSchema = ( + 18, + n0, + _UTESO, + {_sSI: _cUTESRo, _smi: None}, +) + +UPDATE_THREAT_ENTITY_SET: StaticOperationSchema = ( + 23, + n0, + _UTES, + { + _smith: MappingProxyType( + { + "method": "POST", + "uri": "/detector/{DetectorId}/threatentityset/{ThreatEntitySetId}", + "code": 200, + } + ) + }, + UPDATE_THREAT_ENTITY_SET_INPUT, + UPDATE_THREAT_ENTITY_SET_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +UPDATE_THREAT_INTEL_SET_INPUT: StaticSchema = ( + 18, + n0, + _UTISI, + {_sSI: _cUTISR, _s: None}, + (_DI, _TISI, _N, _Loc, _Activ, _EBO), + ( + (DETECTOR_ID, 9), + (STRING, 9), + (NAME, {_sN: _n}), + (LOCATION, {_sN: _loc}), + (BOOLEAN, {_sN: _act}), + (ACCOUNT_ID, {_sN: _eBO}), + ), ) -GROUPS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Groups"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, +UPDATE_THREAT_INTEL_SET_OUTPUT: StaticSchema = ( + 18, + n0, + _UTISO, + {_sSI: _cUTISRo, _smi: None}, +) + +UPDATE_THREAT_INTEL_SET: StaticOperationSchema = ( + 23, + n0, + _UTIS, + { + _smith: MappingProxyType( + { + "method": "POST", + "uri": "/detector/{DetectorId}/threatintelset/{ThreatIntelSetId}", + "code": 200, + } + ) + }, + UPDATE_THREAT_INTEL_SET_INPUT, + UPDATE_THREAT_INTEL_SET_OUTPUT, + (ACCESS_DENIED_EXCEPTION, BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +UPDATE_TRUSTED_ENTITY_SET_INPUT: StaticSchema = ( + 18, + n0, + _UTESIp, + {_sSI: _cUTESRom, _s: None}, + (_DI, _TESIr, _N, _Loc, _EBO, _Activ), + ( + (DETECTOR_ID, 9), + (STRING, 9), + (NAME, {_sN: _n}), + (LOCATION, {_sN: _loc}), + (EXPECTED_BUCKET_OWNER, {_sN: _eBO}), + (BOOLEAN, {_sN: _act}), + ), ) -IMPERSONATED_USER = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ImpersonatedUser"), - members={ - "Username": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="username")], - }, - "Groups": { - "target": GROUPS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="groups")], - }, - }, -) - -SESSION_NAME_LIST = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#SessionNameList"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, -) - -KUBERNETES_USER_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#KubernetesUserDetails"), - members={ - "Username": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="username")], - }, - "Uid": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="uid")], - }, - "Groups": { - "target": GROUPS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="groups")], - }, - "SessionName": { - "target": SESSION_NAME_LIST, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="sessionName") - ], - }, - "ImpersonatedUser": { - "target": IMPERSONATED_USER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="impersonatedUser") - ], - }, - }, -) - -KUBERNETES_WORKLOAD_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#KubernetesWorkloadDetails"), - members={ - "Name": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="name")], - }, - "Type": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="type")], - }, - "Uid": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="uid")], - }, - "Namespace": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="namespace")], - }, - "HostNetwork": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="hostNetwork") - ], - }, - "ServiceAccountName": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="serviceAccountName") - ], - }, - "Containers": { - "target": CONTAINERS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="containers") - ], - }, - "Volumes": { - "target": VOLUMES, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="volumes")], - }, - "HostIPC": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="hostIPC")], - }, - "HostPID": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="hostPID")], - }, - }, -) - -KUBERNETES_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#KubernetesDetails"), - members={ - "KubernetesUserDetails": { - "target": KUBERNETES_USER_DETAILS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="kubernetesUserDetails" - ) - ], - }, - "KubernetesWorkloadDetails": { - "target": KUBERNETES_WORKLOAD_DETAILS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="kubernetesWorkloadDetails" - ) - ], - }, - }, -) - -SUBNET_IDS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#SubnetIds"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, -) - -VPC_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#VpcConfig"), - members={ - "SubnetIds": { - "target": SUBNET_IDS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="subnetIds")], - }, - "VpcId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="vpcId")], - }, - "SecurityGroups": { - "target": SECURITY_GROUPS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="securityGroups") - ], - }, - }, -) - -LAMBDA_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#LambdaDetails"), - members={ - "FunctionArn": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="functionArn") - ], - }, - "FunctionName": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="functionName") - ], - }, - "Description": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="description") - ], - }, - "LastModifiedAt": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="lastModifiedAt") - ], - }, - "RevisionId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="revisionId") - ], - }, - "FunctionVersion": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="functionVersion") - ], - }, - "Role": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="role")], - }, - "VpcConfig": { - "target": VPC_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="vpcConfig")], - }, - "Tags": { - "target": TAGS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="tags")], - }, - }, -) - -MODEL_DETAIL = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ModelDetail"), - members={ - "ModelId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="modelId")], - } - }, -) - -MODEL_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ModelDetails"), - shape_type=ShapeType.LIST, - members={"member": {"target": MODEL_DETAIL}}, -) - -RDS_DB_INSTANCE_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#RdsDbInstanceDetails"), - members={ - "DbInstanceIdentifier": { - "target": STRING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="dbInstanceIdentifier" - ) - ], - }, - "Engine": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="engine")], - }, - "EngineVersion": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="engineVersion") - ], - }, - "DbClusterIdentifier": { - "target": STRING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="dbClusterIdentifier" - ) - ], - }, - "DbInstanceArn": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="dbInstanceArn") - ], - }, - "DbiResourceId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="dbiResourceId") - ], - }, - "Tags": { - "target": TAGS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="tags")], - }, - }, -) - -RDS_DB_USER_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#RdsDbUserDetails"), - members={ - "User": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="user")], - }, - "Application": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="application") - ], - }, - "Database": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="database")], - }, - "Ssl": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="ssl")], - }, - "AuthMethod": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="authMethod") - ], - }, - }, -) - -RDS_LIMITLESS_DB_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#RdsLimitlessDbDetails"), - members={ - "DbShardGroupIdentifier": { - "target": STRING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="dbShardGroupIdentifier" - ) - ], - }, - "DbShardGroupResourceId": { - "target": STRING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="dbShardGroupResourceId" - ) - ], - }, - "DbShardGroupArn": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="dbShardGroupArn") - ], - }, - "Engine": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="engine")], - }, - "EngineVersion": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="engineVersion") - ], - }, - "DbClusterIdentifier": { - "target": STRING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="dbClusterIdentifier" - ) - ], - }, - "Tags": { - "target": TAGS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="tags")], - }, - }, -) - -SCAN_CONFIGURATION_CONTINUOUS_SCAN_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ScanConfigurationContinuousScanDetails"), - members={ - "StartTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="startTime")], - }, - "EndTime": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="endTime"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - }, -) - -RECOVERY_POINT_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#RecoveryPointDetails"), - members={ - "RecoveryPointArn": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="recoveryPointArn") - ], - }, - "BackupVaultName": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="backupVaultName") - ], - }, - "ContinuousScanDetails": { - "target": SCAN_CONFIGURATION_CONTINUOUS_SCAN_DETAILS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="continuousScanDetails" - ) - ], - }, - }, -) - -OWNER = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Owner"), - members={ - "Id": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="id")], - } - }, -) - -PERMISSION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#PermissionConfiguration"), - members={ - "BucketLevelPermissions": { - "target": BUCKET_LEVEL_PERMISSIONS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="bucketLevelPermissions" - ) - ], - }, - "AccountLevelPermissions": { - "target": ACCOUNT_LEVEL_PERMISSIONS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="accountLevelPermissions" - ) - ], - }, - }, -) - -PUBLIC_ACCESS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#PublicAccess"), - members={ - "PermissionConfiguration": { - "target": PERMISSION_CONFIGURATION, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="permissionConfiguration" - ) - ], - }, - "EffectivePermission": { - "target": STRING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="effectivePermission" - ) - ], - }, - }, -) - -S3_OBJECT_DETAIL = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#S3ObjectDetail"), - members={ - "ObjectArn": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="objectArn")], - }, - "Key": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="key")], - }, - "ETag": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="eTag")], - }, - "Hash": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="hash")], - }, - "VersionId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="versionId")], - }, - }, -) - -S3_OBJECT_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#S3ObjectDetails"), - shape_type=ShapeType.LIST, - members={"member": {"target": S3_OBJECT_DETAIL}}, -) - -S3_BUCKET_DETAIL = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#S3BucketDetail"), - members={ - "Arn": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="arn")], - }, - "Name": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="name")], - }, - "Type": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="type")], - }, - "CreatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="createdAt")], - }, - "Owner": { - "target": OWNER, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="owner")], - }, - "Tags": { - "target": TAGS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="tags")], - }, - "DefaultServerSideEncryption": { - "target": DEFAULT_SERVER_SIDE_ENCRYPTION, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), - value="defaultServerSideEncryption", - ) - ], - }, - "PublicAccess": { - "target": PUBLIC_ACCESS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="publicAccess") - ], - }, - "S3ObjectDetails": { - "target": S3_OBJECT_DETAILS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="s3ObjectDetails") - ], - }, - }, -) - -S3_BUCKET_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#S3BucketDetails"), - shape_type=ShapeType.LIST, - members={"member": {"target": S3_BUCKET_DETAIL}}, -) - -RESOURCE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Resource"), - members={ - "AccessKeyDetails": { - "target": ACCESS_KEY_DETAILS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="accessKeyDetails") - ], - }, - "S3BucketDetails": { - "target": S3_BUCKET_DETAILS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="s3BucketDetails") - ], - }, - "InstanceDetails": { - "target": INSTANCE_DETAILS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="instanceDetails") - ], - }, - "EksClusterDetails": { - "target": EKS_CLUSTER_DETAILS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="eksClusterDetails") - ], - }, - "KubernetesDetails": { - "target": KUBERNETES_DETAILS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="kubernetesDetails") - ], - }, - "ResourceType": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="resourceType") - ], - }, - "EbsVolumeDetails": { - "target": EBS_VOLUME_DETAILS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="ebsVolumeDetails") - ], - }, - "EcsClusterDetails": { - "target": ECS_CLUSTER_DETAILS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="ecsClusterDetails") - ], - }, - "ContainerDetails": { - "target": CONTAINER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="containerDetails") - ], - }, - "LambdaDetails": { - "target": LAMBDA_DETAILS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="lambdaDetails") - ], - }, - "RdsDbInstanceDetails": { - "target": RDS_DB_INSTANCE_DETAILS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="rdsDbInstanceDetails" - ) - ], - }, - "RdsLimitlessDbDetails": { - "target": RDS_LIMITLESS_DB_DETAILS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="rdsLimitlessDbDetails" - ) - ], - }, - "RdsDbUserDetails": { - "target": RDS_DB_USER_DETAILS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="rdsDbUserDetails") - ], - }, - "EbsSnapshotDetails": { - "target": EBS_SNAPSHOT_DETAILS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="ebsSnapshotDetails") - ], - }, - "Ec2ImageDetails": { - "target": EC2_IMAGE_DETAILS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="ec2ImageDetails") - ], - }, - "RecoveryPointDetails": { - "target": RECOVERY_POINT_DETAILS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="recoveryPointDetails" - ) - ], - }, - "BedrockGuardrailDetails": { - "target": BEDROCK_GUARDRAIL_DETAILS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="bedrockGuardrailDetails" - ) - ], - }, - "ModelDetails": { - "target": MODEL_DETAILS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="modelDetails") - ], - }, - }, -) - -SERVICE_ADDITIONAL_INFO = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ServiceAdditionalInfo"), - members={ - "Value": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="value")], - }, - "Type": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="type")], - }, - }, -) - -SCAN_CATEGORY = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ScanCategory"), - shape_type=ShapeType.ENUM, - members={"FULL_SCAN": {"target": UNIT}, "INCREMENTAL_SCAN": {"target": UNIT}}, -) - -INCREMENTAL_SCAN_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#IncrementalScanDetails"), - members={ - "BaselineResourceArn": { - "target": NON_EMPTY_STRING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="baselineResourceArn" - ), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, -) - -MALWARE_PROTECTION_FINDINGS_SCAN_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#MalwareProtectionFindingsScanConfiguration"), - members={ - "TriggerType": { - "target": TRIGGER_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="triggerType") - ], - }, - "IncrementalScanDetails": { - "target": INCREMENTAL_SCAN_DETAILS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="incrementalScanDetails" - ) - ], - }, - }, -) - -MALWARE_PROTECTION_SCAN_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#MalwareProtectionScanType"), - shape_type=ShapeType.ENUM, - members={ - "BACKUP_INITIATED": {"target": UNIT}, - "ON_DEMAND": {"target": UNIT}, - "GUARDDUTY_INITIATED": {"target": UNIT}, - }, -) - -ITEM_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ItemDetails"), - members={ - "ResourceArn": { - "target": NON_EMPTY_STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="resourceArn") - ], - }, - "ItemPath": { - "target": NON_EMPTY_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="itemPath")], - }, - "Hash": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="hash")], - }, - "AdditionalInfo": { - "target": ADDITIONAL_INFO, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="additionalInfo") - ], - }, - }, -) - -ITEM_DETAILS_LIST = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ItemDetailsList"), - shape_type=ShapeType.LIST, - members={"member": {"target": ITEM_DETAILS}}, -) - -ITEM_PATH = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ItemPath"), - members={ - "NestedItemPath": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="nestedItemPath") - ], - }, - "Hash": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="hash")], - }, - }, -) - -ITEM_PATHS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ItemPaths"), - shape_type=ShapeType.LIST, - members={"member": {"target": ITEM_PATH}}, -) - -THREAT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Threat"), - members={ - "Name": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="name")], - }, - "Source": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="source")], - }, - "ItemPaths": { - "target": ITEM_PATHS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="itemPaths")], - }, - "Count": { - "target": LONG, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="count")], - }, - "Hash": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="hash")], - }, - "ItemDetails": { - "target": ITEM_DETAILS_LIST, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="itemDetails") - ], - }, - }, -) - -THREATS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Threats"), - shape_type=ShapeType.LIST, - members={"member": {"target": THREAT}}, -) - -MALWARE_SCAN_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#MalwareScanDetails"), - members={ - "Threats": { - "target": THREATS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="threats")], - }, - "ScanId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="scanId")], - }, - "ScanType": { - "target": MALWARE_PROTECTION_SCAN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="scanType")], - }, - "ScanCategory": { - "target": SCAN_CATEGORY, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="scanCategory") - ], - }, - "ScanConfiguration": { - "target": MALWARE_PROTECTION_FINDINGS_SCAN_CONFIGURATION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="scanConfiguration") - ], - }, - "UniqueThreatCount": { - "target": INTEGER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="uniqueThreatCount") - ], - }, - }, -) - -FLAGS_LIST = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#FlagsList"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, -) - -MEMORY_REGIONS_LIST = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#MemoryRegionsList"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, -) - -LINEAGE_OBJECT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#LineageObject"), - members={ - "StartTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="startTime")], - }, - "NamespacePid": { - "target": INTEGER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="namespacePid") - ], - }, - "UserId": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="userId")], - }, - "Name": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="name")], - }, - "Pid": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="pid")], - }, - "Uuid": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="uuid")], - }, - "ExecutablePath": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="executablePath") - ], - }, - "Euid": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="euid")], - }, - "ParentUuid": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="parentUuid") - ], - }, - }, -) - -LINEAGE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Lineage"), - shape_type=ShapeType.LIST, - members={"member": {"target": LINEAGE_OBJECT}}, -) - -PROCESS_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ProcessDetails"), - members={ - "Name": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="name")], - }, - "ExecutablePath": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="executablePath") - ], - }, - "ExecutableSha256": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="executableSha256") - ], - }, - "NamespacePid": { - "target": INTEGER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="namespacePid") - ], - }, - "Pwd": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="pwd")], - }, - "Pid": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="pid")], - }, - "StartTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="startTime")], - }, - "Uuid": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="uuid")], - }, - "ParentUuid": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="parentUuid") - ], - }, - "User": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="user")], - }, - "UserId": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="userId")], - }, - "Euid": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="euid")], - }, - "Lineage": { - "target": LINEAGE, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="lineage")], - }, - }, -) - -RELATED_FILE_PATHS_LIST = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#RelatedFilePathsList"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, -) - -RUNTIME_CONTEXT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#RuntimeContext"), - members={ - "ModifyingProcess": { - "target": PROCESS_DETAILS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="modifyingProcess") - ], - }, - "ModifiedAt": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="modifiedAt") - ], - }, - "ScriptPath": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="scriptPath") - ], - }, - "LibraryPath": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="libraryPath") - ], - }, - "LdPreloadValue": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="ldPreloadValue") - ], - }, - "SocketPath": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="socketPath") - ], - }, - "RuncBinaryPath": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="runcBinaryPath") - ], - }, - "ReleaseAgentPath": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="releaseAgentPath") - ], - }, - "MountSource": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="mountSource") - ], - }, - "MountTarget": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="mountTarget") - ], - }, - "FileSystemType": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="fileSystemType") - ], - }, - "Flags": { - "target": FLAGS_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="flags")], - }, - "ModuleName": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="moduleName") - ], - }, - "ModuleFilePath": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="moduleFilePath") - ], - }, - "ModuleSha256": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="moduleSha256") - ], - }, - "ShellHistoryFilePath": { - "target": STRING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="shellHistoryFilePath" - ) - ], - }, - "TargetProcess": { - "target": PROCESS_DETAILS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="targetProcess") - ], - }, - "AddressFamily": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="addressFamily") - ], - }, - "IanaProtocolNumber": { - "target": INTEGER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="ianaProtocolNumber") - ], - }, - "MemoryRegions": { - "target": MEMORY_REGIONS_LIST, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="memoryRegions") - ], - }, - "ToolName": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="toolName")], - }, - "ToolCategory": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="toolCategory") - ], - }, - "ServiceName": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="serviceName") - ], - }, - "CommandLineExample": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="commandLineExample") - ], - }, - "ThreatFilePath": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="threatFilePath") - ], - }, - "FileOperation": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="fileOperation") - ], - }, - "FilePath": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="filePath")], - }, - "RelatedFilePaths": { - "target": RELATED_FILE_PATHS_LIST, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="relatedFilePaths") - ], - }, - }, -) - -RUNTIME_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#RuntimeDetails"), - members={ - "Process": { - "target": PROCESS_DETAILS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="process")], - }, - "Context": { - "target": RUNTIME_CONTEXT, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="context")], - }, - }, -) - -SERVICE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Service"), - members={ - "Action": { - "target": ACTION, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="action")], - }, - "Evidence": { - "target": EVIDENCE, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="evidence")], - }, - "Archived": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="archived")], - }, - "Count": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="count")], - }, - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="detectorId") - ], - }, - "EventFirstSeen": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="eventFirstSeen") - ], - }, - "EventLastSeen": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="eventLastSeen") - ], - }, - "ResourceRole": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="resourceRole") - ], - }, - "ServiceName": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="serviceName") - ], - }, - "UserFeedback": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="userFeedback") - ], - }, - "AdditionalInfo": { - "target": SERVICE_ADDITIONAL_INFO, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="additionalInfo") - ], - }, - "FeatureName": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="featureName") - ], - }, - "EbsVolumeScanDetails": { - "target": EBS_VOLUME_SCAN_DETAILS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="ebsVolumeScanDetails" - ) - ], - }, - "RuntimeDetails": { - "target": RUNTIME_DETAILS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="runtimeDetails") - ], - }, - "Detection": { - "target": DETECTION, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="detection")], - }, - "MalwareScanDetails": { - "target": MALWARE_SCAN_DETAILS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="malwareScanDetails") - ], - }, - }, -) - -FINDING = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Finding"), - members={ - "AccountId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="accountId"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Arn": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="arn"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Confidence": { - "target": DOUBLE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="confidence") - ], - }, - "CreatedAt": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="createdAt"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Description": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="description") - ], - }, - "Id": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="id"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Partition": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="partition")], - }, - "Region": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="region"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Resource": { - "target": RESOURCE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="resource"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "SchemaVersion": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="schemaVersion"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Service": { - "target": SERVICE, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="service")], - }, - "Severity": { - "target": DOUBLE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="severity"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Title": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="title")], - }, - "Type": { - "target": FINDING_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="type"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "UpdatedAt": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="updatedAt"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "AssociatedAttackSequenceArn": { - "target": STRING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), - value="associatedAttackSequenceArn", - ) - ], - }, - }, -) - -FINDINGS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Findings"), - shape_type=ShapeType.LIST, - members={"member": {"target": FINDING}}, -) - -GROUPED_BY_ACCOUNT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GroupedByAccount"), - shape_type=ShapeType.LIST, - members={"member": {"target": ACCOUNT_STATISTICS}}, -) - -GROUPED_BY_DATE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GroupedByDate"), - shape_type=ShapeType.LIST, - members={"member": {"target": DATE_STATISTICS}}, -) - -FINDING_TYPE_STATISTICS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#FindingTypeStatistics"), - members={ - "FindingType": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="findingType") - ], - }, - "LastGeneratedAt": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="lastGeneratedAt") - ], - }, - "TotalFindings": { - "target": INTEGER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="totalFindings") - ], - }, - }, -) - -GROUPED_BY_FINDING_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GroupedByFindingType"), - shape_type=ShapeType.LIST, - members={"member": {"target": FINDING_TYPE_STATISTICS}}, -) - -RESOURCE_STATISTICS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ResourceStatistics"), - members={ - "AccountId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="accountId")], - }, - "LastGeneratedAt": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="lastGeneratedAt") - ], - }, - "ResourceId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="resourceId") - ], - }, - "ResourceType": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="resourceType") - ], - }, - "TotalFindings": { - "target": INTEGER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="totalFindings") - ], - }, - }, -) - -GROUPED_BY_RESOURCE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GroupedByResource"), - shape_type=ShapeType.LIST, - members={"member": {"target": RESOURCE_STATISTICS}}, -) - -SEVERITY_STATISTICS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#SeverityStatistics"), - members={ - "LastGeneratedAt": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="lastGeneratedAt") - ], - }, - "Severity": { - "target": DOUBLE, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="severity")], - }, - "TotalFindings": { - "target": INTEGER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="totalFindings") - ], - }, - }, -) - -GROUPED_BY_SEVERITY = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GroupedBySeverity"), - shape_type=ShapeType.LIST, - members={"member": {"target": SEVERITY_STATISTICS}}, -) - -FINDING_STATISTICS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#FindingStatistics"), - members={ - "CountBySeverity": { - "target": COUNT_BY_SEVERITY, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="countBySeverity") - ], - }, - "GroupedByAccount": { - "target": GROUPED_BY_ACCOUNT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="groupedByAccount") - ], - }, - "GroupedByDate": { - "target": GROUPED_BY_DATE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="groupedByDate") - ], - }, - "GroupedByFindingType": { - "target": GROUPED_BY_FINDING_TYPE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="groupedByFindingType" - ) - ], - }, - "GroupedByResource": { - "target": GROUPED_BY_RESOURCE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="groupedByResource") - ], - }, - "GroupedBySeverity": { - "target": GROUPED_BY_SEVERITY, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="groupedBySeverity") - ], - }, - }, -) - -FINDING_STATISTIC_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#FindingStatisticType"), - shape_type=ShapeType.ENUM, - members={"COUNT_BY_SEVERITY": {"target": UNIT}}, -) - -FINDING_STATISTIC_TYPES = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#FindingStatisticTypes"), - shape_type=ShapeType.LIST, - members={"member": {"target": FINDING_STATISTIC_TYPE}}, -) - -GET_ADMINISTRATOR_ACCOUNT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GetAdministratorAccountInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#GetAdministratorAccountRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -GET_ADMINISTRATOR_ACCOUNT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GetAdministratorAccountOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#GetAdministratorAccountResponse", - ) - ], - members={ - "Administrator": { - "target": ADMINISTRATOR, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="administrator"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, -) - -GET_ADMINISTRATOR_ACCOUNT = Schema( - id=ShapeID("com.amazonaws.guardduty#GetAdministratorAccount"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/detector/{DetectorId}/administrator", - "code": 200, - } - ), - ) - ], -) - -GET_COVERAGE_STATISTICS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GetCoverageStatisticsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#GetCoverageStatisticsRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "FilterCriteria": { - "target": COVERAGE_FILTER_CRITERIA, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="filterCriteria") - ], - }, - "StatisticsType": { - "target": COVERAGE_STATISTICS_TYPE_LIST, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="statisticsType"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - }, -) - -GET_COVERAGE_STATISTICS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GetCoverageStatisticsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#GetCoverageStatisticsResponse", - ) - ], - members={ - "CoverageStatistics": { - "target": COVERAGE_STATISTICS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="coverageStatistics") - ], - } - }, -) - -GET_COVERAGE_STATISTICS = Schema( - id=ShapeID("com.amazonaws.guardduty#GetCoverageStatistics"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/detector/{DetectorId}/coverage/statistics", - "code": 200, - } - ), - ) - ], -) - -GET_CUSTOM_DETECTION_RULE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GetCustomDetectionRuleInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#GetCustomDetectionRuleRequest", - ) - ], - members={ - "RuleId": { - "target": RULE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -RULE_EXPRESSION = Schema( - id=ShapeID("com.amazonaws.guardduty#RuleExpression"), shape_type=ShapeType.STRING -) - -RULE_DEFINITION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#RuleDefinition"), - members={ - "Expression": { - "target": RULE_EXPRESSION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="expression"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, -) - -RULE_LANGUAGE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#RuleLanguage"), - shape_type=ShapeType.ENUM, - members={"SQL": {"target": UNIT}}, -) - -RULE_NAME = Schema( - id=ShapeID("com.amazonaws.guardduty#RuleName"), shape_type=ShapeType.STRING -) - -RULE_SCHEMA = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#RuleSchema"), - shape_type=ShapeType.ENUM, - members={"CLOUD_TRAIL": {"target": UNIT}}, -) - -MITRE_TACTIC = Schema( - id=ShapeID("com.amazonaws.guardduty#MitreTactic"), shape_type=ShapeType.STRING -) - -MITRE_TECHNIQUE = Schema( - id=ShapeID("com.amazonaws.guardduty#MitreTechnique"), shape_type=ShapeType.STRING -) - -RULE_DETAIL = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#RuleDetail"), - members={ - "RuleId": { - "target": RULE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="ruleId"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Arn": { - "target": DETECTION_RULE_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="arn"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Name": { - "target": RULE_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="name"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Description": { - "target": DETECTION_RULE_DESCRIPTION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="description"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Severity": { - "target": DETECTION_RULE_SEVERITY, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="severity"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "DataSource": { - "target": DETECTION_RULE_DATA_SOURCE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="dataSource"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Tactic": { - "target": MITRE_TACTIC, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="tactic"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Technique": { - "target": MITRE_TECHNIQUE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="technique"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Service": { - "target": DETECTION_RULE_SERVICE_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="service"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Definition": { - "target": RULE_DEFINITION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="definition"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Language": { - "target": RULE_LANGUAGE, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="language")], - }, - "Schema": { - "target": RULE_SCHEMA, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="schema")], - }, - "CreatedAt": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="createdAt"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "UpdatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="updatedAt")], - }, - }, -) - -GET_CUSTOM_DETECTION_RULE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GetCustomDetectionRuleOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#GetCustomDetectionRuleResponse", - ) - ], - members={ - "Rule": { - "target": RULE_DETAIL, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="rule"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, -) - -GET_CUSTOM_DETECTION_RULE = Schema( - id=ShapeID("com.amazonaws.guardduty#GetCustomDetectionRule"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/custom-detection-rule/rule/{RuleId}", - "code": 200, - } - ), - ) - ], -) - -GET_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GetCustomDetectionRuleAssociationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#GetCustomDetectionRuleAssociationRequest", - ) - ], - members={ - "RuleId": { - "target": RULE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "AssociationId": { - "target": ASSOCIATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -GET_CUSTOM_DETECTION_RULE_ASSOCIATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GetCustomDetectionRuleAssociationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#GetCustomDetectionRuleAssociationResponse", - ) - ], - members={ - "RuleAssociation": { - "target": ASSOCIATION_DETAIL, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="ruleAssociation"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Tags": { - "target": TAG_MAP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="tags")], - }, - }, -) - -GET_CUSTOM_DETECTION_RULE_ASSOCIATION = Schema( - id=ShapeID("com.amazonaws.guardduty#GetCustomDetectionRuleAssociation"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/custom-detection-rule/rule/{RuleId}/association/{AssociationId}", - "code": 200, - } - ), - ) - ], -) - -GET_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GetCustomDetectionRuleOrgConfigurationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#GetCustomDetectionRuleOrgConfigurationRequest", - ) - ], - members={ - "RuleId": { - "target": RULE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Mode": { - "target": ASSOCIATION_MODE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="mode"), - ], - }, - }, -) - -GET_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GetCustomDetectionRuleOrgConfigurationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#GetCustomDetectionRuleOrgConfigurationResponse", - ) - ], - members={ - "Configuration": { - "target": DETECTION_RULE_ORG_CONFIGURATION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="configuration"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, -) - -GET_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION = Schema( - id=ShapeID("com.amazonaws.guardduty#GetCustomDetectionRuleOrgConfiguration"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/custom-detection-rule/org-configuration/{RuleId}", - "code": 200, - } - ), - ) - ], -) - -GET_DETECTOR_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GetDetectorInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#GetDetectorRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -GET_DETECTOR_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GetDetectorOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#GetDetectorResponse", - ) - ], - members={ - "CreatedAt": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="createdAt")], - }, - "FindingPublishingFrequency": { - "target": FINDING_PUBLISHING_FREQUENCY, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), - value="findingPublishingFrequency", - ) - ], - }, - "ServiceRole": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="serviceRole"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Status": { - "target": DETECTOR_STATUS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="status"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "UpdatedAt": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="updatedAt")], - }, - "DataSources": { - "target": DATA_SOURCE_CONFIGURATIONS_RESULT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="dataSources") - ], - }, - "Tags": { - "target": TAG_MAP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="tags")], - }, - "Features": { - "target": DETECTOR_FEATURE_CONFIGURATIONS_RESULTS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="features")], - }, - }, -) - -GET_DETECTOR = Schema( - id=ShapeID("com.amazonaws.guardduty#GetDetector"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/detector/{DetectorId}", "code": 200} - ), - ) - ], -) - -GET_FILTER_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GetFilterInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#GetFilterRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "FilterName": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -GET_FILTER_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GetFilterOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#GetFilterResponse", - ) - ], - members={ - "Name": { - "target": FILTER_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="name"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Description": { - "target": FILTER_DESCRIPTION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="description") - ], - }, - "Action": { - "target": FILTER_ACTION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="action"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Rank": { - "target": FILTER_RANK, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="rank")], - }, - "FindingCriteria": { - "target": FINDING_CRITERIA, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="findingCriteria"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Tags": { - "target": TAG_MAP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="tags")], - }, - "CreatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="createdAt")], - }, - "UpdatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="updatedAt")], - }, - "Version": { - "target": FILTER_VERSION, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="version")], - }, - }, -) - -GET_FILTER = Schema( - id=ShapeID("com.amazonaws.guardduty#GetFilter"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/detector/{DetectorId}/filter/{FilterName}", - "code": 200, - } - ), - ) - ], -) - -GET_FINDINGS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GetFindingsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#GetFindingsRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "FindingIds": { - "target": FINDING_IDS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="findingIds"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "SortCriteria": { - "target": SORT_CRITERIA, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="sortCriteria") - ], - }, - }, -) - -GET_FINDINGS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GetFindingsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#GetFindingsResponse", - ) - ], - members={ - "Findings": { - "target": FINDINGS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="findings"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, -) - -GET_FINDINGS = Schema( - id=ShapeID("com.amazonaws.guardduty#GetFindings"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/detector/{DetectorId}/findings/get", - "code": 200, - } - ), - ) - ], -) - -GROUP_BY_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GroupByType"), - shape_type=ShapeType.ENUM, - members={ - "ACCOUNT": {"target": UNIT}, - "DATE": {"target": UNIT}, - "FINDING_TYPE": {"target": UNIT}, - "RESOURCE": {"target": UNIT}, - "SEVERITY": {"target": UNIT}, - }, -) - -MAX_RESULTS100 = Schema( - id=ShapeID("com.amazonaws.guardduty#MaxResults100"), shape_type=ShapeType.INTEGER -) - -GET_FINDINGS_STATISTICS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GetFindingsStatisticsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#GetFindingsStatisticsRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "FindingStatisticTypes": { - "target": FINDING_STATISTIC_TYPES, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="findingStatisticTypes" - ) - ], - }, - "FindingCriteria": { - "target": FINDING_CRITERIA, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="findingCriteria") - ], - }, - "GroupBy": { - "target": GROUP_BY_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="groupBy")], - }, - "OrderBy": { - "target": ORDER_BY, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="orderBy")], - }, - "MaxResults": { - "target": MAX_RESULTS100, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="maxResults") - ], - }, - }, -) - -GET_FINDINGS_STATISTICS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GetFindingsStatisticsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#GetFindingsStatisticsResponse", - ) - ], - members={ - "FindingStatistics": { - "target": FINDING_STATISTICS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="findingStatistics"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "NextToken": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="nextToken")], - }, - }, -) - -GET_FINDINGS_STATISTICS = Schema( - id=ShapeID("com.amazonaws.guardduty#GetFindingsStatistics"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/detector/{DetectorId}/findings/statistics", - "code": 200, - } - ), - ) - ], -) - -GET_INVESTIGATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GetInvestigationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#GetInvestigationRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "InvestigationId": { - "target": INVESTIGATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -INVESTIGATION_ERROR_DETAILS = Schema( - id=ShapeID("com.amazonaws.guardduty#InvestigationErrorDetails"), - shape_type=ShapeType.STRING, -) - -PRODUCT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Product"), - members={ - "Name": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="name"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Feature": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="feature")], - }, - }, -) - -INVESTIGATION_METADATA = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#InvestigationMetadata"), - members={ - "Version": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="version"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Product": { - "target": PRODUCT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="product"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - }, -) - -RISK_DETAILS = Schema( - id=ShapeID("com.amazonaws.guardduty#RiskDetails"), shape_type=ShapeType.STRING -) - -RISK_LEVEL = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#RiskLevel"), - shape_type=ShapeType.ENUM, - members={ - "INFO": {"target": UNIT}, - "LOW": {"target": UNIT}, - "MEDIUM": {"target": UNIT}, - "HIGH": {"target": UNIT}, - "CRITICAL": {"target": UNIT}, - }, -) - -INVESTIGATION_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#InvestigationStatus"), - shape_type=ShapeType.ENUM, - members={ - "RUNNING": {"target": UNIT}, - "COMPLETED": {"target": UNIT}, - "FAILED": {"target": UNIT}, - }, -) - -TRIGGERED_BY = Schema( - id=ShapeID("com.amazonaws.guardduty#TriggeredBy"), shape_type=ShapeType.STRING -) - -INVESTIGATION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Investigation"), - members={ - "InvestigationId": { - "target": INVESTIGATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="investigationId"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Status": { - "target": INVESTIGATION_STATUS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="status"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "TriggerPrompt": { - "target": TRIGGER_PROMPT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="triggerPrompt"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "TriggeredBy": { - "target": TRIGGERED_BY, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="triggeredBy"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Metadata": { - "target": INVESTIGATION_METADATA, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="metadata")], - }, - "Cloud": { - "target": CLOUD_DETAILS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="cloud")], - }, - "RiskLevel": { - "target": RISK_LEVEL, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="riskLevel")], - }, - "Risk": { - "target": RISK_DETAILS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="risk")], - }, - "Confidence": { - "target": CONFIDENCE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="confidence") - ], - }, - "Summary": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="summary")], - }, - "StartTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="startTime")], - }, - "EndTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="endTime")], - }, - "Error": { - "target": INVESTIGATION_ERROR_DETAILS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="error")], - }, - }, -) - -GET_INVESTIGATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GetInvestigationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#GetInvestigationResponse", - ) - ], - members={ - "Investigation": { - "target": INVESTIGATION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="investigation"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, -) - -GET_INVESTIGATION = Schema( - id=ShapeID("com.amazonaws.guardduty#GetInvestigation"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/detector/{DetectorId}/investigation/{InvestigationId}", - "code": 200, - } - ), - ) - ], -) - -GET_INVITATIONS_COUNT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GetInvitationsCountInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#GetInvitationsCountRequest", - ) - ], -) - -GET_INVITATIONS_COUNT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GetInvitationsCountOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#GetInvitationsCountResponse", - ) - ], - members={ - "InvitationsCount": { - "target": INTEGER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="invitationsCount") - ], - } - }, -) - -GET_INVITATIONS_COUNT = Schema( - id=ShapeID("com.amazonaws.guardduty#GetInvitationsCount"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/invitation/count", "code": 200} - ), - ) - ], -) - -GET_IP_SET_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GetIPSetInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#GetIPSetRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "IpSetId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -IP_SET_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#IpSetStatus"), - shape_type=ShapeType.ENUM, - members={ - "INACTIVE": {"target": UNIT}, - "ACTIVATING": {"target": UNIT}, - "ACTIVE": {"target": UNIT}, - "DEACTIVATING": {"target": UNIT}, - "ERROR": {"target": UNIT}, - "DELETE_PENDING": {"target": UNIT}, - "DELETED": {"target": UNIT}, - }, -) - -GET_IP_SET_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GetIPSetOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#GetIPSetResponse", - ) - ], - members={ - "Name": { - "target": NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="name"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Format": { - "target": IP_SET_FORMAT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="format"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Location": { - "target": LOCATION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="location"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Status": { - "target": IP_SET_STATUS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="status"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Tags": { - "target": TAG_MAP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="tags")], - }, - "ExpectedBucketOwner": { - "target": ACCOUNT_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="expectedBucketOwner" - ) - ], - }, - }, -) - -GET_IP_SET = Schema( - id=ShapeID("com.amazonaws.guardduty#GetIPSet"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/detector/{DetectorId}/ipset/{IpSetId}", - "code": 200, - } - ), - ) - ], -) - -GET_MALWARE_PROTECTION_PLAN_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GetMalwareProtectionPlanInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#GetMalwareProtectionPlanRequest", - ) - ], - members={ - "MalwareProtectionPlanId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -MALWARE_PROTECTION_PLAN_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#MalwareProtectionPlanStatus"), - shape_type=ShapeType.ENUM, - members={ - "ACTIVE": {"target": UNIT}, - "WARNING": {"target": UNIT}, - "ERROR": {"target": UNIT}, - }, -) - -MALWARE_PROTECTION_PLAN_STATUS_REASON = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#MalwareProtectionPlanStatusReason"), - members={ - "Code": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="code")], - }, - "Message": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="message")], - }, - }, -) - -MALWARE_PROTECTION_PLAN_STATUS_REASONS_LIST = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#MalwareProtectionPlanStatusReasonsList"), - shape_type=ShapeType.LIST, - members={"member": {"target": MALWARE_PROTECTION_PLAN_STATUS_REASON}}, -) - -GET_MALWARE_PROTECTION_PLAN_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GetMalwareProtectionPlanOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#GetMalwareProtectionPlanResponse", - ) - ], - members={ - "Arn": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="arn")], - }, - "Role": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="role")], - }, - "ProtectedResource": { - "target": CREATE_PROTECTED_RESOURCE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="protectedResource") - ], - }, - "Actions": { - "target": MALWARE_PROTECTION_PLAN_ACTIONS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="actions")], - }, - "CreatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="createdAt")], - }, - "Status": { - "target": MALWARE_PROTECTION_PLAN_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="status")], - }, - "StatusReasons": { - "target": MALWARE_PROTECTION_PLAN_STATUS_REASONS_LIST, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="statusReasons") - ], - }, - "Tags": { - "target": TAG_MAP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="tags")], - }, - }, -) - -GET_MALWARE_PROTECTION_PLAN = Schema( - id=ShapeID("com.amazonaws.guardduty#GetMalwareProtectionPlan"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/malware-protection-plan/{MalwareProtectionPlanId}", - "code": 200, - } - ), - ) - ], -) - -GET_MALWARE_SCAN_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GetMalwareScanInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#GetMalwareScanRequest", - ) - ], - members={ - "ScanId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -NON_NEGATIVE_INTEGER = Schema( - id=ShapeID("com.amazonaws.guardduty#NonNegativeInteger"), - shape_type=ShapeType.INTEGER, -) - -MALWARE_PROTECTION_RESOURCE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#MalwareProtectionResourceType"), - shape_type=ShapeType.ENUM, - members={ - "EBS_RECOVERY_POINT": {"target": UNIT}, - "EBS_SNAPSHOT": {"target": UNIT}, - "EBS_VOLUME": {"target": UNIT}, - "EC2_AMI": {"target": UNIT}, - "EC2_INSTANCE": {"target": UNIT}, - "EC2_RECOVERY_POINT": {"target": UNIT}, - "S3_RECOVERY_POINT": {"target": UNIT}, - "S3_BUCKET": {"target": UNIT}, - "S3_POINT_IN_TIME_RECOVERY": {"target": UNIT}, - }, -) - -SCAN_CONFIGURATION_RECOVERY_POINT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ScanConfigurationRecoveryPoint"), - members={ - "BackupVaultName": { - "target": NON_EMPTY_STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="backupVaultName") - ], - }, - "ContinuousScanDetails": { - "target": SCAN_CONFIGURATION_CONTINUOUS_SCAN_DETAILS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="continuousScanDetails" - ) - ], - }, - }, -) - -SCAN_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ScanConfiguration"), - members={ - "Role": { - "target": NON_EMPTY_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="role")], - }, - "TriggerDetails": { - "target": TRIGGER_DETAILS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="triggerDetails") - ], - }, - "IncrementalScanDetails": { - "target": INCREMENTAL_SCAN_DETAILS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="incrementalScanDetails" - ) - ], - }, - "RecoveryPoint": { - "target": SCAN_CONFIGURATION_RECOVERY_POINT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="recoveryPoint") - ], - }, - }, -) - -SCANNED_RESOURCE_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ScannedResourceDetails"), - members={ - "EbsVolume": { - "target": VOLUME_DETAIL, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="ebsVolume")], - }, - "EbsSnapshot": { - "target": EBS_SNAPSHOT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="ebsSnapshot") - ], - }, - }, -) - -MALWARE_PROTECTION_SCAN_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#MalwareProtectionScanStatus"), - shape_type=ShapeType.ENUM, - members={ - "RUNNING": {"target": UNIT}, - "COMPLETED": {"target": UNIT}, - "COMPLETED_WITH_ISSUES": {"target": UNIT}, - "FAILED": {"target": UNIT}, - "SKIPPED": {"target": UNIT}, - }, -) - -SCAN_STATUS_REASON = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ScanStatusReason"), - shape_type=ShapeType.ENUM, - members={ - "ACCESS_DENIED": {"target": UNIT}, - "RESOURCE_NOT_FOUND": {"target": UNIT}, - "SNAPSHOT_SIZE_LIMIT_EXCEEDED": {"target": UNIT}, - "RESOURCE_UNAVAILABLE": {"target": UNIT}, - "INCONSISTENT_SOURCE": {"target": UNIT}, - "INCREMENTAL_NO_DIFFERENCE": {"target": UNIT}, - "NO_EBS_VOLUMES_FOUND": {"target": UNIT}, - "UNSUPPORTED_PRODUCT_CODE_TYPE": {"target": UNIT}, - "AMI_SNAPSHOT_LIMIT_EXCEEDED": {"target": UNIT}, - "UNRELATED_RESOURCES": {"target": UNIT}, - "BASE_RESOURCE_NOT_SCANNED": {"target": UNIT}, - "BASE_CREATED_AFTER_TARGET": {"target": UNIT}, - "UNSUPPORTED_FOR_INCREMENTAL": {"target": UNIT}, - "UNSUPPORTED_AMI": {"target": UNIT}, - "UNSUPPORTED_SNAPSHOT": {"target": UNIT}, - "UNSUPPORTED_COMPOSITE_RECOVERY_POINT": {"target": UNIT}, - "ALL_FILES_SKIPPED_OR_FAILED": {"target": UNIT}, - }, -) - -SCANNED_RESOURCE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ScannedResource"), - members={ - "ScannedResourceArn": { - "target": NON_EMPTY_STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="scannedResourceArn") - ], - }, - "ScannedResourceType": { - "target": MALWARE_PROTECTION_RESOURCE_TYPE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="scannedResourceType" - ) - ], - }, - "ScannedResourceStatus": { - "target": MALWARE_PROTECTION_SCAN_STATUS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="scannedResourceStatus" - ) - ], - }, - "ScanStatusReason": { - "target": SCAN_STATUS_REASON, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="scanStatusReason") - ], - }, - "ResourceDetails": { - "target": SCANNED_RESOURCE_DETAILS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="resourceDetails") - ], - }, - }, -) - -SCANNED_RESOURCES = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ScannedResources"), - shape_type=ShapeType.LIST, - members={"member": {"target": SCANNED_RESOURCE}}, -) - -SCAN_RESULT_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ScanResultStatus"), - shape_type=ShapeType.ENUM, - members={"NO_THREATS_FOUND": {"target": UNIT}, "THREATS_FOUND": {"target": UNIT}}, -) - -SCAN_RESULT_THREAT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ScanResultThreat"), - members={ - "Name": { - "target": NON_EMPTY_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="name")], - }, - "Source": { - "target": DETECTION_SOURCE, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="source")], - }, - "Count": { - "target": POSITIVE_LONG, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="count")], - }, - "Hash": { - "target": NON_EMPTY_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="hash")], - }, - "ItemDetails": { - "target": ITEM_DETAILS_LIST, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="itemDetails") - ], - }, - }, -) - -SCAN_RESULT_THREATS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ScanResultThreats"), - shape_type=ShapeType.LIST, - members={"member": {"target": SCAN_RESULT_THREAT}}, -) - -GET_MALWARE_SCAN_RESULT_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GetMalwareScanResultDetails"), - members={ - "ScanResultStatus": { - "target": SCAN_RESULT_STATUS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="scanResultStatus") - ], - }, - "SkippedFileCount": { - "target": POSITIVE_LONG, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="skippedFileCount") - ], - }, - "FailedFileCount": { - "target": POSITIVE_LONG, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="failedFileCount") - ], - }, - "ThreatFoundFileCount": { - "target": POSITIVE_LONG, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="threatFoundFileCount" - ) - ], - }, - "TotalFileCount": { - "target": POSITIVE_LONG, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="totalFileCount") - ], - }, - "TotalBytes": { - "target": POSITIVE_LONG, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="totalBytes") - ], - }, - "UniqueThreatCount": { - "target": POSITIVE_LONG, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="uniqueThreatCount") - ], - }, - "Threats": { - "target": SCAN_RESULT_THREATS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="threats")], - }, - }, -) - -GET_MALWARE_SCAN_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GetMalwareScanOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#GetMalwareScanResponse", - ) - ], - members={ - "ScanId": { - "target": NON_EMPTY_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="scanId")], - }, - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="detectorId") - ], - }, - "AdminDetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="adminDetectorId") - ], - }, - "ResourceArn": { - "target": NON_EMPTY_STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="resourceArn") - ], - }, - "ResourceType": { - "target": MALWARE_PROTECTION_RESOURCE_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="resourceType") - ], - }, - "ScannedResourcesCount": { - "target": NON_NEGATIVE_INTEGER, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="scannedResourcesCount" - ) - ], - }, - "SkippedResourcesCount": { - "target": NON_NEGATIVE_INTEGER, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="skippedResourcesCount" - ) - ], - }, - "FailedResourcesCount": { - "target": NON_NEGATIVE_INTEGER, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="failedResourcesCount" - ) - ], - }, - "ScannedResources": { - "target": SCANNED_RESOURCES, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="scannedResources") - ], - }, - "ScanConfiguration": { - "target": SCAN_CONFIGURATION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="scanConfiguration") - ], - }, - "ScanCategory": { - "target": SCAN_CATEGORY, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="scanCategory") - ], - }, - "ScanStatus": { - "target": MALWARE_PROTECTION_SCAN_STATUS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="scanStatus") - ], - }, - "ScanStatusReason": { - "target": SCAN_STATUS_REASON, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="scanStatusReason") - ], - }, - "ScanType": { - "target": MALWARE_PROTECTION_SCAN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="scanType")], - }, - "ScanStartedAt": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="scanStartedAt") - ], - }, - "ScanCompletedAt": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="scanCompletedAt") - ], - }, - "ScanResultDetails": { - "target": GET_MALWARE_SCAN_RESULT_DETAILS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="scanResultDetails") - ], - }, - }, -) - -GET_MALWARE_SCAN = Schema( - id=ShapeID("com.amazonaws.guardduty#GetMalwareScan"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/malware-scan/{ScanId}", "code": 200} - ), - ) - ], -) - -GET_MALWARE_SCAN_SETTINGS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GetMalwareScanSettingsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#GetMalwareScanSettingsRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -SCAN_CRITERION_KEY = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ScanCriterionKey"), - shape_type=ShapeType.ENUM, - members={"EC2_INSTANCE_TAG": {"target": UNIT}}, -) - -SCAN_CONDITION_PAIR = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ScanConditionPair"), - members={ - "Key": { - "target": TAG_KEY, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="key"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Value": { - "target": TAG_VALUE, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="value")], - }, - }, -) - -MAP_EQUALS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#MapEquals"), - shape_type=ShapeType.LIST, - members={"member": {"target": SCAN_CONDITION_PAIR}}, -) - -SCAN_CONDITION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ScanCondition"), - members={ - "MapEquals": { - "target": MAP_EQUALS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="mapEquals"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, -) - -SCAN_CRITERION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ScanCriterion"), - shape_type=ShapeType.MAP, - members={ - "key": {"target": SCAN_CRITERION_KEY}, - "value": {"target": SCAN_CONDITION}, - }, -) - -SCAN_RESOURCE_CRITERIA = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ScanResourceCriteria"), - members={ - "Include": { - "target": SCAN_CRITERION, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="include")], - }, - "Exclude": { - "target": SCAN_CRITERION, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="exclude")], - }, - }, -) - -GET_MALWARE_SCAN_SETTINGS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GetMalwareScanSettingsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#GetMalwareScanSettingsResponse", - ) - ], - members={ - "ScanResourceCriteria": { - "target": SCAN_RESOURCE_CRITERIA, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="scanResourceCriteria" - ) - ], - }, - "EbsSnapshotPreservation": { - "target": EBS_SNAPSHOT_PRESERVATION, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="ebsSnapshotPreservation" - ) - ], - }, - }, -) - -GET_MALWARE_SCAN_SETTINGS = Schema( - id=ShapeID("com.amazonaws.guardduty#GetMalwareScanSettings"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/detector/{DetectorId}/malware-scan-settings", - "code": 200, - } - ), - ) - ], -) - -GET_MASTER_ACCOUNT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GetMasterAccountInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#GetMasterAccountRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -MASTER = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Master"), - members={ - "AccountId": { - "target": ACCOUNT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="accountId")], - }, - "InvitationId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="invitationId") - ], - }, - "RelationshipStatus": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="relationshipStatus") - ], - }, - "InvitedAt": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="invitedAt")], - }, - }, -) - -GET_MASTER_ACCOUNT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GetMasterAccountOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#GetMasterAccountResponse", - ) - ], - members={ - "Master": { - "target": MASTER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="master"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, -) - -GET_MASTER_ACCOUNT = Schema( - id=ShapeID("com.amazonaws.guardduty#GetMasterAccount"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/detector/{DetectorId}/master", "code": 200} - ), - ) - ], -) - -GET_MEMBER_DETECTORS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GetMemberDetectorsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#GetMemberDetectorsRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "AccountIds": { - "target": ACCOUNT_IDS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="accountIds"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - }, -) - -MEMBER_ADDITIONAL_CONFIGURATION_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#MemberAdditionalConfigurationResult"), - members={ - "Name": { - "target": ORG_FEATURE_ADDITIONAL_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="name")], - }, - "Status": { - "target": FEATURE_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="status")], - }, - "UpdatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="updatedAt")], - }, - "ManagedBy": { - "target": MANAGED_BY, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="managedBy")], - }, - }, -) - -MEMBER_ADDITIONAL_CONFIGURATION_RESULTS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#MemberAdditionalConfigurationResults"), - shape_type=ShapeType.LIST, - members={"member": {"target": MEMBER_ADDITIONAL_CONFIGURATION_RESULT}}, -) - -MEMBER_FEATURES_CONFIGURATION_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#MemberFeaturesConfigurationResult"), - members={ - "Name": { - "target": ORG_FEATURE, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="name")], - }, - "Status": { - "target": FEATURE_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="status")], - }, - "UpdatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="updatedAt")], - }, - "AdditionalConfiguration": { - "target": MEMBER_ADDITIONAL_CONFIGURATION_RESULTS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="additionalConfiguration" - ) - ], - }, - "ManagedBy": { - "target": MANAGED_BY, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="managedBy")], - }, - }, -) - -MEMBER_FEATURES_CONFIGURATIONS_RESULTS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#MemberFeaturesConfigurationsResults"), - shape_type=ShapeType.LIST, - members={"member": {"target": MEMBER_FEATURES_CONFIGURATION_RESULT}}, -) - -MEMBER_DATA_SOURCE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#MemberDataSourceConfiguration"), - members={ - "AccountId": { - "target": ACCOUNT_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="accountId"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "DataSources": { - "target": DATA_SOURCE_CONFIGURATIONS_RESULT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="dataSources"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Features": { - "target": MEMBER_FEATURES_CONFIGURATIONS_RESULTS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="features")], - }, - }, -) - -MEMBER_DATA_SOURCE_CONFIGURATIONS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#MemberDataSourceConfigurations"), - shape_type=ShapeType.LIST, - members={"member": {"target": MEMBER_DATA_SOURCE_CONFIGURATION}}, -) - -GET_MEMBER_DETECTORS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GetMemberDetectorsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#GetMemberDetectorsResponse", - ) - ], - members={ - "MemberDataSourceConfigurations": { - "target": MEMBER_DATA_SOURCE_CONFIGURATIONS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="members"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "UnprocessedAccounts": { - "target": UNPROCESSED_ACCOUNTS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="unprocessedAccounts" - ), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - }, -) - -GET_MEMBER_DETECTORS = Schema( - id=ShapeID("com.amazonaws.guardduty#GetMemberDetectors"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/detector/{DetectorId}/member/detector/get", - "code": 200, - } - ), - ) - ], -) - -GET_MEMBERS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GetMembersInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#GetMembersRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "AccountIds": { - "target": ACCOUNT_IDS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="accountIds"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - }, -) - -MEMBER = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Member"), - members={ - "AccountId": { - "target": ACCOUNT_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="accountId"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="detectorId") - ], - }, - "MasterId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="masterId"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Email": { - "target": EMAIL, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="email"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "RelationshipStatus": { - "target": STRING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="relationshipStatus" - ), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "InvitedAt": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="invitedAt")], - }, - "UpdatedAt": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="updatedAt"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "AdministratorId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="administratorId") - ], - }, - }, -) - -MEMBERS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Members"), - shape_type=ShapeType.LIST, - members={"member": {"target": MEMBER}}, -) - -GET_MEMBERS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GetMembersOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#GetMembersResponse", - ) - ], - members={ - "Members": { - "target": MEMBERS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="members"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "UnprocessedAccounts": { - "target": UNPROCESSED_ACCOUNTS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="unprocessedAccounts" - ), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - }, -) - -GET_MEMBERS = Schema( - id=ShapeID("com.amazonaws.guardduty#GetMembers"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/detector/{DetectorId}/member/get", - "code": 200, - } - ), - ) - ], -) - -GET_ORGANIZATION_STATISTICS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GetOrganizationStatisticsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -ORGANIZATION_FEATURE_STATISTICS_ADDITIONAL_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.guardduty#OrganizationFeatureStatisticsAdditionalConfiguration" - ), - members={ - "Name": { - "target": ORG_FEATURE_ADDITIONAL_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="name")], - }, - "EnabledAccountsCount": { - "target": INTEGER, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="enabledAccountsCount" - ) - ], - }, - }, -) - -ORGANIZATION_FEATURE_STATISTICS_ADDITIONAL_CONFIGURATIONS = Schema.collection( - id=ShapeID( - "com.amazonaws.guardduty#OrganizationFeatureStatisticsAdditionalConfigurations" - ), - shape_type=ShapeType.LIST, - members={ - "member": {"target": ORGANIZATION_FEATURE_STATISTICS_ADDITIONAL_CONFIGURATION} - }, -) - -ORGANIZATION_FEATURE_STATISTICS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#OrganizationFeatureStatistics"), - members={ - "Name": { - "target": ORG_FEATURE, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="name")], - }, - "EnabledAccountsCount": { - "target": INTEGER, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="enabledAccountsCount" - ) - ], - }, - "AdditionalConfiguration": { - "target": ORGANIZATION_FEATURE_STATISTICS_ADDITIONAL_CONFIGURATIONS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="additionalConfiguration" - ) - ], - }, - }, -) - -ORGANIZATION_FEATURE_STATISTICS_RESULTS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#OrganizationFeatureStatisticsResults"), - shape_type=ShapeType.LIST, - members={"member": {"target": ORGANIZATION_FEATURE_STATISTICS}}, -) - -ORGANIZATION_STATISTICS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#OrganizationStatistics"), - members={ - "TotalAccountsCount": { - "target": INTEGER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="totalAccountsCount") - ], - }, - "MemberAccountsCount": { - "target": INTEGER, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="memberAccountsCount" - ) - ], - }, - "ActiveAccountsCount": { - "target": INTEGER, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="activeAccountsCount" - ) - ], - }, - "EnabledAccountsCount": { - "target": INTEGER, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="enabledAccountsCount" - ) - ], - }, - "CountByFeature": { - "target": ORGANIZATION_FEATURE_STATISTICS_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="countByFeature") - ], - }, - }, -) - -ORGANIZATION_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#OrganizationDetails"), - members={ - "UpdatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="updatedAt")], - }, - "OrganizationStatistics": { - "target": ORGANIZATION_STATISTICS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="organizationStatistics" - ) - ], - }, - }, -) - -GET_ORGANIZATION_STATISTICS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GetOrganizationStatisticsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#GetOrganizationStatisticsResponse", - ) - ], - members={ - "OrganizationDetails": { - "target": ORGANIZATION_DETAILS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="organizationDetails" - ) - ], - } - }, -) - -GET_ORGANIZATION_STATISTICS = Schema( - id=ShapeID("com.amazonaws.guardduty#GetOrganizationStatistics"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/organization/statistics", "code": 200} - ), - ) - ], -) - -GET_REMAINING_FREE_TRIAL_DAYS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GetRemainingFreeTrialDaysInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#GetRemainingFreeTrialDaysRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "AccountIds": { - "target": ACCOUNT_IDS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="accountIds"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - }, -) - -GET_REMAINING_FREE_TRIAL_DAYS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GetRemainingFreeTrialDaysOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#GetRemainingFreeTrialDaysResponse", - ) - ], - members={ - "Accounts": { - "target": ACCOUNT_FREE_TRIAL_INFOS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="accounts")], - }, - "UnprocessedAccounts": { - "target": UNPROCESSED_ACCOUNTS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="unprocessedAccounts" - ) - ], - }, - }, -) - -GET_REMAINING_FREE_TRIAL_DAYS = Schema( - id=ShapeID("com.amazonaws.guardduty#GetRemainingFreeTrialDays"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/detector/{DetectorId}/freeTrial/daysRemaining", - "code": 200, - } - ), - ) - ], -) - -GET_THREAT_ENTITY_SET_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GetThreatEntitySetInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#GetThreatEntitySetRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "ThreatEntitySetId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -THREAT_ENTITY_SET_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ThreatEntitySetStatus"), - shape_type=ShapeType.ENUM, - members={ - "INACTIVE": {"target": UNIT}, - "ACTIVATING": {"target": UNIT}, - "ACTIVE": {"target": UNIT}, - "DEACTIVATING": {"target": UNIT}, - "ERROR": {"target": UNIT}, - "DELETE_PENDING": {"target": UNIT}, - "DELETED": {"target": UNIT}, - }, -) - -GET_THREAT_ENTITY_SET_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GetThreatEntitySetOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#GetThreatEntitySetResponse", - ) - ], - members={ - "Name": { - "target": NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="name"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Format": { - "target": THREAT_ENTITY_SET_FORMAT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="format"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Location": { - "target": LOCATION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="location"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "ExpectedBucketOwner": { - "target": EXPECTED_BUCKET_OWNER, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="expectedBucketOwner" - ) - ], - }, - "Status": { - "target": THREAT_ENTITY_SET_STATUS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="status"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Tags": { - "target": TAG_MAP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="tags")], - }, - "CreatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="createdAt")], - }, - "UpdatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="updatedAt")], - }, - "ErrorDetails": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="errorDetails") - ], - }, - }, -) - -GET_THREAT_ENTITY_SET = Schema( - id=ShapeID("com.amazonaws.guardduty#GetThreatEntitySet"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/detector/{DetectorId}/threatentityset/{ThreatEntitySetId}", - "code": 200, - } - ), - ) - ], -) - -GET_THREAT_INTEL_SET_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GetThreatIntelSetInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#GetThreatIntelSetRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "ThreatIntelSetId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -THREAT_INTEL_SET_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ThreatIntelSetStatus"), - shape_type=ShapeType.ENUM, - members={ - "INACTIVE": {"target": UNIT}, - "ACTIVATING": {"target": UNIT}, - "ACTIVE": {"target": UNIT}, - "DEACTIVATING": {"target": UNIT}, - "ERROR": {"target": UNIT}, - "DELETE_PENDING": {"target": UNIT}, - "DELETED": {"target": UNIT}, - }, -) - -GET_THREAT_INTEL_SET_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GetThreatIntelSetOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#GetThreatIntelSetResponse", - ) - ], - members={ - "Name": { - "target": NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="name"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Format": { - "target": THREAT_INTEL_SET_FORMAT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="format"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Location": { - "target": LOCATION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="location"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Status": { - "target": THREAT_INTEL_SET_STATUS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="status"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Tags": { - "target": TAG_MAP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="tags")], - }, - "ExpectedBucketOwner": { - "target": ACCOUNT_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="expectedBucketOwner" - ) - ], - }, - }, -) - -GET_THREAT_INTEL_SET = Schema( - id=ShapeID("com.amazonaws.guardduty#GetThreatIntelSet"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/detector/{DetectorId}/threatintelset/{ThreatIntelSetId}", - "code": 200, - } - ), - ) - ], -) - -GET_TRUSTED_ENTITY_SET_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GetTrustedEntitySetInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#GetTrustedEntitySetRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "TrustedEntitySetId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -TRUSTED_ENTITY_SET_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#TrustedEntitySetStatus"), - shape_type=ShapeType.ENUM, - members={ - "INACTIVE": {"target": UNIT}, - "ACTIVATING": {"target": UNIT}, - "ACTIVE": {"target": UNIT}, - "DEACTIVATING": {"target": UNIT}, - "ERROR": {"target": UNIT}, - "DELETE_PENDING": {"target": UNIT}, - "DELETED": {"target": UNIT}, - }, -) - -GET_TRUSTED_ENTITY_SET_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GetTrustedEntitySetOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#GetTrustedEntitySetResponse", - ) - ], - members={ - "Name": { - "target": NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="name"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Format": { - "target": TRUSTED_ENTITY_SET_FORMAT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="format"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Location": { - "target": LOCATION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="location"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "ExpectedBucketOwner": { - "target": EXPECTED_BUCKET_OWNER, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="expectedBucketOwner" - ) - ], - }, - "Status": { - "target": TRUSTED_ENTITY_SET_STATUS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="status"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Tags": { - "target": TAG_MAP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="tags")], - }, - "CreatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="createdAt")], - }, - "UpdatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="updatedAt")], - }, - "ErrorDetails": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="errorDetails") - ], - }, - }, -) - -GET_TRUSTED_ENTITY_SET = Schema( - id=ShapeID("com.amazonaws.guardduty#GetTrustedEntitySet"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/detector/{DetectorId}/trustedentityset/{TrustedEntitySetId}", - "code": 200, - } - ), - ) - ], -) - -USAGE_FEATURE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UsageFeature"), - shape_type=ShapeType.ENUM, - members={ - "FLOW_LOGS": {"target": UNIT}, - "CLOUD_TRAIL": {"target": UNIT}, - "DNS_LOGS": {"target": UNIT}, - "S3_DATA_EVENTS": {"target": UNIT}, - "EKS_AUDIT_LOGS": {"target": UNIT}, - "EBS_MALWARE_PROTECTION": {"target": UNIT}, - "RDS_LOGIN_EVENTS": {"target": UNIT}, - "LAMBDA_NETWORK_LOGS": {"target": UNIT}, - "EKS_RUNTIME_MONITORING": {"target": UNIT}, - "EC2_RUNTIME_MONITORING": {"target": UNIT}, - "FARGATE_RUNTIME_MONITORING": {"target": UNIT}, - "RDS_DBI_PROTECTION_PROVISIONED": {"target": UNIT}, - "RDS_DBI_PROTECTION_SERVERLESS": {"target": UNIT}, - "AI_PROTECTION": {"target": UNIT}, - }, -) - -USAGE_FEATURE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UsageFeatureList"), - shape_type=ShapeType.LIST, - members={"member": {"target": USAGE_FEATURE}}, -) - -RESOURCE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ResourceList"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, -) - -USAGE_CRITERIA = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UsageCriteria"), - members={ - "AccountIds": { - "target": ACCOUNT_IDS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="accountIds") - ], - }, - "DataSources": { - "target": DATA_SOURCE_LIST, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="dataSources") - ], - }, - "Resources": { - "target": RESOURCE_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="resources")], - }, - "Features": { - "target": USAGE_FEATURE_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="features")], - }, - }, -) - -USAGE_STATISTIC_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UsageStatisticType"), - shape_type=ShapeType.ENUM, - members={ - "SUM_BY_ACCOUNT": {"target": UNIT}, - "SUM_BY_DATA_SOURCE": {"target": UNIT}, - "SUM_BY_RESOURCE": {"target": UNIT}, - "TOP_RESOURCES": {"target": UNIT}, - "SUM_BY_FEATURES": {"target": UNIT}, - "TOP_ACCOUNTS_BY_FEATURE": {"target": UNIT}, - }, -) - -GET_USAGE_STATISTICS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GetUsageStatisticsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#GetUsageStatisticsRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "UsageStatisticType": { - "target": USAGE_STATISTIC_TYPE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="usageStatisticsType" - ), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "UsageCriteria": { - "target": USAGE_CRITERIA, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="usageCriteria"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Unit": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="unit")], - }, - "MaxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="maxResults") - ], - }, - "NextToken": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="nextToken")], - }, - }, -) - -TOTAL = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Total"), - members={ - "Amount": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="amount")], - }, - "Unit": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="unit")], - }, - }, -) - -USAGE_ACCOUNT_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UsageAccountResult"), - members={ - "AccountId": { - "target": ACCOUNT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="accountId")], - }, - "Total": { - "target": TOTAL, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="total")], - }, - }, -) - -USAGE_ACCOUNT_RESULT_LIST = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UsageAccountResultList"), - shape_type=ShapeType.LIST, - members={"member": {"target": USAGE_ACCOUNT_RESULT}}, -) - -USAGE_DATA_SOURCE_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UsageDataSourceResult"), - members={ - "DataSource": { - "target": DATA_SOURCE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="dataSource") - ], - }, - "Total": { - "target": TOTAL, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="total")], - }, - }, -) - -USAGE_DATA_SOURCE_RESULT_LIST = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UsageDataSourceResultList"), - shape_type=ShapeType.LIST, - members={"member": {"target": USAGE_DATA_SOURCE_RESULT}}, -) - -USAGE_FEATURE_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UsageFeatureResult"), - members={ - "Feature": { - "target": USAGE_FEATURE, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="feature")], - }, - "Total": { - "target": TOTAL, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="total")], - }, - }, -) - -USAGE_FEATURE_RESULT_LIST = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UsageFeatureResultList"), - shape_type=ShapeType.LIST, - members={"member": {"target": USAGE_FEATURE_RESULT}}, -) - -USAGE_RESOURCE_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UsageResourceResult"), - members={ - "Resource": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="resource")], - }, - "Total": { - "target": TOTAL, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="total")], - }, - }, -) - -USAGE_RESOURCE_RESULT_LIST = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UsageResourceResultList"), - shape_type=ShapeType.LIST, - members={"member": {"target": USAGE_RESOURCE_RESULT}}, -) - -USAGE_TOP_ACCOUNT_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UsageTopAccountResult"), - members={ - "AccountId": { - "target": ACCOUNT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="accountId")], - }, - "Total": { - "target": TOTAL, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="total")], - }, - }, -) - -USAGE_TOP_ACCOUNTS_BY_FEATURE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UsageTopAccountsByFeatureList"), - shape_type=ShapeType.LIST, - members={"member": {"target": USAGE_TOP_ACCOUNT_RESULT}}, -) - -USAGE_TOP_ACCOUNTS_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UsageTopAccountsResult"), - members={ - "Feature": { - "target": USAGE_FEATURE, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="feature")], - }, - "Accounts": { - "target": USAGE_TOP_ACCOUNTS_BY_FEATURE_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="accounts")], - }, - }, -) - -USAGE_TOP_ACCOUNTS_RESULT_LIST = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UsageTopAccountsResultList"), - shape_type=ShapeType.LIST, - members={"member": {"target": USAGE_TOP_ACCOUNTS_RESULT}}, -) - -USAGE_STATISTICS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UsageStatistics"), - members={ - "SumByAccount": { - "target": USAGE_ACCOUNT_RESULT_LIST, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="sumByAccount") - ], - }, - "TopAccountsByFeature": { - "target": USAGE_TOP_ACCOUNTS_RESULT_LIST, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="topAccountsByFeature" - ) - ], - }, - "SumByDataSource": { - "target": USAGE_DATA_SOURCE_RESULT_LIST, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="sumByDataSource") - ], - }, - "SumByResource": { - "target": USAGE_RESOURCE_RESULT_LIST, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="sumByResource") - ], - }, - "TopResources": { - "target": USAGE_RESOURCE_RESULT_LIST, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="topResources") - ], - }, - "SumByFeature": { - "target": USAGE_FEATURE_RESULT_LIST, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="sumByFeature") - ], - }, - }, -) - -GET_USAGE_STATISTICS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#GetUsageStatisticsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#GetUsageStatisticsResponse", - ) - ], - members={ - "UsageStatistics": { - "target": USAGE_STATISTICS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="usageStatistics") - ], - }, - "NextToken": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="nextToken")], - }, - }, -) - -GET_USAGE_STATISTICS = Schema( - id=ShapeID("com.amazonaws.guardduty#GetUsageStatistics"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/detector/{DetectorId}/usage/statistics", - "code": 200, - } - ), - ) - ], -) - -INVITE_MEMBERS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#InviteMembersInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#InviteMembersRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "AccountIds": { - "target": ACCOUNT_IDS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="accountIds"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "DisableEmailNotification": { - "target": BOOLEAN, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="disableEmailNotification" - ) - ], - }, - "Message": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="message")], - }, - }, -) - -INVITE_MEMBERS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#InviteMembersOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#InviteMembersResponse", - ) - ], - members={ - "UnprocessedAccounts": { - "target": UNPROCESSED_ACCOUNTS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="unprocessedAccounts" - ), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, -) - -INVITE_MEMBERS = Schema( - id=ShapeID("com.amazonaws.guardduty#InviteMembers"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/detector/{DetectorId}/member/invite", - "code": 200, - } - ), - ) - ], -) - -LIST_COVERAGE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ListCoverageInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#ListCoverageRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "NextToken": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="nextToken")], - }, - "MaxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="maxResults") - ], - }, - "FilterCriteria": { - "target": COVERAGE_FILTER_CRITERIA, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="filterCriteria") - ], - }, - "SortCriteria": { - "target": COVERAGE_SORT_CRITERIA, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="sortCriteria") - ], - }, - }, -) - -LIST_COVERAGE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ListCoverageOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#ListCoverageResponse", - ) - ], - members={ - "Resources": { - "target": COVERAGE_RESOURCES, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="resources"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "NextToken": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="nextToken")], - }, - }, -) - -LIST_COVERAGE = Schema( - id=ShapeID("com.amazonaws.guardduty#ListCoverage"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/detector/{DetectorId}/coverage", - "code": 200, - } - ), - ) - ], -) - -LIST_CUSTOM_DETECTION_RULE_ASSOCIATIONS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ListCustomDetectionRuleAssociationsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#ListCustomDetectionRuleAssociationsRequest", - ) - ], - members={ - "MaxResults": { - "target": DETECTION_RULE_MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "NextToken": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "RuleId": { - "target": RULE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="ruleId")], - }, - "Mode": { - "target": ASSOCIATION_MODE, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="mode")], - }, - }, -) - -LIST_CUSTOM_DETECTION_RULE_ASSOCIATIONS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ListCustomDetectionRuleAssociationsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#ListCustomDetectionRuleAssociationsResponse", - ) - ], - members={ - "RuleAssociations": { - "target": ASSOCIATION_SUMMARY_LIST, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="ruleAssociations"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "NextToken": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="nextToken")], - }, - }, -) - -LIST_CUSTOM_DETECTION_RULE_ASSOCIATIONS = Schema( - id=ShapeID("com.amazonaws.guardduty#ListCustomDetectionRuleAssociations"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/custom-detection-rule/association", - "code": 200, - } - ), - ) - ], -) - -LIST_CUSTOM_DETECTION_RULE_ORG_CONFIGURATIONS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ListCustomDetectionRuleOrgConfigurationsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#ListCustomDetectionRuleOrgConfigurationsRequest", - ) - ], - members={ - "MaxResults": { - "target": DETECTION_RULE_MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "NextToken": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "Status": { - "target": DETECTION_RULE_CONFIGURATION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="status")], - }, - }, -) - -LIST_CUSTOM_DETECTION_RULE_ORG_CONFIGURATIONS_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.guardduty#ListCustomDetectionRuleOrgConfigurationsOutput" - ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#ListCustomDetectionRuleOrgConfigurationsResponse", - ) - ], - members={ - "Configurations": { - "target": DETECTION_RULE_ORG_CONFIGURATION_SUMMARY_LIST, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="configurations"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "NextToken": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="nextToken")], - }, - }, -) - -LIST_CUSTOM_DETECTION_RULE_ORG_CONFIGURATIONS = Schema( - id=ShapeID("com.amazonaws.guardduty#ListCustomDetectionRuleOrgConfigurations"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/custom-detection-rule/org-configuration", - "code": 200, - } - ), - ) - ], -) - -LIST_CUSTOM_DETECTION_RULES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ListCustomDetectionRulesInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#ListCustomDetectionRulesRequest", - ) - ], - members={ - "MaxResults": { - "target": DETECTION_RULE_MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="maxResults") - ], - }, - "NextToken": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="nextToken")], - }, - "Filters": { - "target": DETECTION_RULE_FILTER_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="filters")], - }, - }, -) - -RULE_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#RuleSummary"), - members={ - "RuleId": { - "target": RULE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="ruleId"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Arn": { - "target": DETECTION_RULE_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="arn"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Name": { - "target": RULE_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="name"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Description": { - "target": DETECTION_RULE_DESCRIPTION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="description"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Severity": { - "target": DETECTION_RULE_SEVERITY, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="severity"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "DataSource": { - "target": DETECTION_RULE_DATA_SOURCE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="dataSource"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Tactic": { - "target": MITRE_TACTIC, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="tactic"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Technique": { - "target": MITRE_TECHNIQUE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="technique"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Service": { - "target": DETECTION_RULE_SERVICE_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="service"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Language": { - "target": RULE_LANGUAGE, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="language")], - }, - "Schema": { - "target": RULE_SCHEMA, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="schema")], - }, - "CreatedAt": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="createdAt"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "UpdatedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="updatedAt")], - }, - }, -) - -RULE_SUMMARY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#RuleSummaryList"), - shape_type=ShapeType.LIST, - members={"member": {"target": RULE_SUMMARY}}, -) - -LIST_CUSTOM_DETECTION_RULES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ListCustomDetectionRulesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#ListCustomDetectionRulesResponse", - ) - ], - members={ - "Rules": { - "target": RULE_SUMMARY_LIST, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="rules"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "NextToken": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="nextToken")], - }, - }, -) - -LIST_CUSTOM_DETECTION_RULES = Schema( - id=ShapeID("com.amazonaws.guardduty#ListCustomDetectionRules"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/custom-detection-rule/rule", "code": 200} - ), - ) - ], -) - -LIST_DETECTORS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ListDetectorsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#ListDetectorsRequest", - ) - ], - members={ - "MaxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "NextToken": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - }, -) - -LIST_DETECTORS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ListDetectorsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#ListDetectorsResponse", - ) - ], - members={ - "DetectorIds": { - "target": DETECTOR_IDS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="detectorIds"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "NextToken": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="nextToken")], - }, - }, -) - -LIST_DETECTORS = Schema( - id=ShapeID("com.amazonaws.guardduty#ListDetectors"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType({"method": "GET", "uri": "/detector", "code": 200}), - ) - ], -) - -LIST_FILTERS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ListFiltersInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#ListFiltersRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "MaxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "NextToken": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - }, -) - -LIST_FILTERS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ListFiltersOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#ListFiltersResponse", - ) - ], - members={ - "FilterNames": { - "target": FILTER_NAMES, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="filterNames"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "NextToken": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="nextToken")], - }, - }, -) - -LIST_FILTERS = Schema( - id=ShapeID("com.amazonaws.guardduty#ListFilters"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/detector/{DetectorId}/filter", "code": 200} - ), - ) - ], -) - -LIST_FINDINGS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ListFindingsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#ListFindingsRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "FindingCriteria": { - "target": FINDING_CRITERIA, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="findingCriteria") - ], - }, - "SortCriteria": { - "target": SORT_CRITERIA, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="sortCriteria") - ], - }, - "MaxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="maxResults") - ], - }, - "NextToken": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="nextToken")], - }, - }, -) - -LIST_FINDINGS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ListFindingsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#ListFindingsResponse", - ) - ], - members={ - "FindingIds": { - "target": FINDING_IDS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="findingIds"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "NextToken": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="nextToken")], - }, - }, -) - -LIST_FINDINGS = Schema( - id=ShapeID("com.amazonaws.guardduty#ListFindings"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/detector/{DetectorId}/findings", - "code": 200, - } - ), - ) - ], -) - -NEXT_TOKEN = Schema( - id=ShapeID("com.amazonaws.guardduty#NextToken"), shape_type=ShapeType.STRING -) - -INVESTIGATION_SORT_FIELD = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#InvestigationSortField"), - shape_type=ShapeType.ENUM, - members={ - "START_TIME": {"target": UNIT}, - "END_TIME": {"target": UNIT}, - "STATUS": {"target": UNIT}, - "RISK_LEVEL": {"target": UNIT}, - "CONFIDENCE": {"target": UNIT}, - }, -) - -INVESTIGATION_SORT_CRITERIA = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#InvestigationSortCriteria"), - members={ - "AttributeName": { - "target": INVESTIGATION_SORT_FIELD, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="attributeName") - ], - }, - "OrderBy": { - "target": ORDER_BY, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="orderBy")], - }, - }, -) - -LIST_INVESTIGATIONS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ListInvestigationsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#ListInvestigationsRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "SortCriteria": { - "target": INVESTIGATION_SORT_CRITERIA, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="sortCriteria") - ], - }, - "MaxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="maxResults") - ], - }, - "NextToken": { - "target": NEXT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="nextToken")], - }, - }, -) - -INVESTIGATION_TITLE = Schema( - id=ShapeID("com.amazonaws.guardduty#InvestigationTitle"), - shape_type=ShapeType.STRING, -) - -INVESTIGATION_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#InvestigationSummary"), - members={ - "InvestigationId": { - "target": INVESTIGATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="investigationId") - ], - }, - "Status": { - "target": INVESTIGATION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="status")], - }, - "TriggerPrompt": { - "target": TRIGGER_PROMPT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="triggerPrompt") - ], - }, - "RiskLevel": { - "target": RISK_LEVEL, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="riskLevel")], - }, - "Confidence": { - "target": CONFIDENCE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="confidence") - ], - }, - "Title": { - "target": INVESTIGATION_TITLE, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="title")], - }, - "AccountId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="accountId")], - }, - "StartTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="startTime")], - }, - "EndTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="endTime")], - }, - }, -) - -INVESTIGATION_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#InvestigationSummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": INVESTIGATION_SUMMARY}}, -) - -LIST_INVESTIGATIONS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ListInvestigationsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#ListInvestigationsResponse", - ) - ], - members={ - "Investigations": { - "target": INVESTIGATION_SUMMARIES, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="investigations"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "NextToken": { - "target": NEXT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="nextToken")], - }, - }, -) - -LIST_INVESTIGATIONS = Schema( - id=ShapeID("com.amazonaws.guardduty#ListInvestigations"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/detector/{DetectorId}/investigation/list", - "code": 200, - } - ), - ) - ], -) - -LIST_INVITATIONS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ListInvitationsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#ListInvitationsRequest", - ) - ], - members={ - "MaxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "NextToken": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - }, -) - -INVITATION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Invitation"), - members={ - "AccountId": { - "target": ACCOUNT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="accountId")], - }, - "InvitationId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="invitationId") - ], - }, - "RelationshipStatus": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="relationshipStatus") - ], - }, - "InvitedAt": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="invitedAt")], - }, - }, -) - -INVITATIONS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#Invitations"), - shape_type=ShapeType.LIST, - members={"member": {"target": INVITATION}}, -) - -LIST_INVITATIONS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ListInvitationsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#ListInvitationsResponse", - ) - ], - members={ - "Invitations": { - "target": INVITATIONS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="invitations") - ], - }, - "NextToken": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="nextToken")], - }, - }, -) - -LIST_INVITATIONS = Schema( - id=ShapeID("com.amazonaws.guardduty#ListInvitations"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/invitation", "code": 200} - ), - ) - ], -) - -LIST_IP_SETS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ListIPSetsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#ListIPSetsRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "MaxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "NextToken": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - }, -) - -IP_SET_IDS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#IpSetIds"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, -) - -LIST_IP_SETS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ListIPSetsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#ListIPSetsResponse", - ) - ], - members={ - "IpSetIds": { - "target": IP_SET_IDS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="ipSetIds"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "NextToken": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="nextToken")], - }, - }, -) - -LIST_IP_SETS = Schema( - id=ShapeID("com.amazonaws.guardduty#ListIPSets"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/detector/{DetectorId}/ipset", "code": 200} - ), - ) - ], -) - -LIST_MALWARE_PROTECTION_PLANS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ListMalwareProtectionPlansInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#ListMalwareProtectionPlansRequest", - ) - ], - members={ - "NextToken": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - } - }, -) - -MALWARE_PROTECTION_PLAN_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#MalwareProtectionPlanSummary"), - members={ - "MalwareProtectionPlanId": { - "target": STRING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="malwareProtectionPlanId" - ) - ], - } - }, -) - -MALWARE_PROTECTION_PLANS_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#MalwareProtectionPlansSummary"), - shape_type=ShapeType.LIST, - members={"member": {"target": MALWARE_PROTECTION_PLAN_SUMMARY}}, -) - -LIST_MALWARE_PROTECTION_PLANS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ListMalwareProtectionPlansOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#ListMalwareProtectionPlansResponse", - ) - ], - members={ - "MalwareProtectionPlans": { - "target": MALWARE_PROTECTION_PLANS_SUMMARY, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="malwareProtectionPlans" - ) - ], - }, - "NextToken": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="nextToken")], - }, - }, -) - -LIST_MALWARE_PROTECTION_PLANS = Schema( - id=ShapeID("com.amazonaws.guardduty#ListMalwareProtectionPlans"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/malware-protection-plan", "code": 200} - ), - ) - ], -) - -LIST_MALWARE_SCANS_CRITERION_KEY = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ListMalwareScansCriterionKey"), - shape_type=ShapeType.ENUM, - members={ - "RESOURCE_ARN": {"target": UNIT}, - "SCAN_ID": {"target": UNIT}, - "ACCOUNT_ID": {"target": UNIT}, - "GUARDDUTY_FINDING_ID": {"target": UNIT}, - "RESOURCE_TYPE": {"target": UNIT}, - "SCAN_START_TIME": {"target": UNIT}, - "SCAN_STATUS": {"target": UNIT}, - "SCAN_TYPE": {"target": UNIT}, - }, -) - -LIST_MALWARE_SCANS_FILTER_CRITERION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ListMalwareScansFilterCriterion"), - members={ - "ListMalwareScansCriterionKey": { - "target": LIST_MALWARE_SCANS_CRITERION_KEY, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="criterionKey") - ], - }, - "FilterCondition": { - "target": FILTER_CONDITION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="filterCondition") - ], - }, - }, -) - -LIST_MALWARE_SCANS_FILTER_CRITERION_LIST = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ListMalwareScansFilterCriterionList"), - shape_type=ShapeType.LIST, - members={"member": {"target": LIST_MALWARE_SCANS_FILTER_CRITERION}}, -) - -LIST_MALWARE_SCANS_FILTER_CRITERIA = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ListMalwareScansFilterCriteria"), - members={ - "ListMalwareScansFilterCriterion": { - "target": LIST_MALWARE_SCANS_FILTER_CRITERION_LIST, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="filterCriterion") - ], - } - }, -) - -LIST_MALWARE_SCANS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ListMalwareScansInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#ListMalwareScansRequest", - ) - ], - members={ - "MaxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "NextToken": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "FilterCriteria": { - "target": LIST_MALWARE_SCANS_FILTER_CRITERIA, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="filterCriteria") - ], - }, - "SortCriteria": { - "target": SORT_CRITERIA, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="sortCriteria") - ], - }, - }, -) - -MALWARE_SCAN = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#MalwareScan"), - members={ - "ResourceArn": { - "target": NON_EMPTY_STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="resourceArn") - ], - }, - "ResourceType": { - "target": MALWARE_PROTECTION_RESOURCE_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="resourceType") - ], - }, - "ScanId": { - "target": NON_EMPTY_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="scanId")], - }, - "ScanStatus": { - "target": MALWARE_PROTECTION_SCAN_STATUS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="scanStatus") - ], - }, - "ScanResultStatus": { - "target": SCAN_RESULT_STATUS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="scanResultStatus") - ], - }, - "ScanType": { - "target": MALWARE_PROTECTION_SCAN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="scanType")], - }, - "ScanStartedAt": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="scanStartedAt") - ], - }, - "ScanCompletedAt": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="scanCompletedAt") - ], - }, - }, -) - -MALWARE_SCANS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#MalwareScans"), - shape_type=ShapeType.LIST, - members={"member": {"target": MALWARE_SCAN}}, -) - -LIST_MALWARE_SCANS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ListMalwareScansOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#ListMalwareScansResponse", - ) - ], - members={ - "Scans": { - "target": MALWARE_SCANS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="scans"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "NextToken": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="nextToken")], - }, - }, -) - -LIST_MALWARE_SCANS = Schema( - id=ShapeID("com.amazonaws.guardduty#ListMalwareScans"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/malware-scan", "code": 200} - ), - ) - ], -) - -LIST_MEMBERS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ListMembersInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#ListMembersRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "MaxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "NextToken": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "OnlyAssociated": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="onlyAssociated") - ], - }, - }, -) - -LIST_MEMBERS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ListMembersOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#ListMembersResponse", - ) - ], - members={ - "Members": { - "target": MEMBERS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="members")], - }, - "NextToken": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="nextToken")], - }, - }, -) - -LIST_MEMBERS = Schema( - id=ShapeID("com.amazonaws.guardduty#ListMembers"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/detector/{DetectorId}/member", "code": 200} - ), - ) - ], -) - -LIST_ORGANIZATION_ADMIN_ACCOUNTS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ListOrganizationAdminAccountsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#ListOrganizationAdminAccountsRequest", - ) - ], - members={ - "MaxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "NextToken": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - }, -) - -LIST_ORGANIZATION_ADMIN_ACCOUNTS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ListOrganizationAdminAccountsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#ListOrganizationAdminAccountsResponse", - ) - ], - members={ - "AdminAccounts": { - "target": ADMIN_ACCOUNTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="adminAccounts") - ], - }, - "NextToken": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="nextToken")], - }, - }, -) - -LIST_ORGANIZATION_ADMIN_ACCOUNTS = Schema( - id=ShapeID("com.amazonaws.guardduty#ListOrganizationAdminAccounts"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType({"method": "GET", "uri": "/admin", "code": 200}), - ) - ], -) - -LIST_PUBLISHING_DESTINATIONS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ListPublishingDestinationsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#ListPublishingDestinationsRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "MaxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "NextToken": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - }, -) - -LIST_PUBLISHING_DESTINATIONS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ListPublishingDestinationsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#ListPublishingDestinationsResponse", - ) - ], - members={ - "Destinations": { - "target": DESTINATIONS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="destinations"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "NextToken": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="nextToken")], - }, - }, -) - -LIST_PUBLISHING_DESTINATIONS = Schema( - id=ShapeID("com.amazonaws.guardduty#ListPublishingDestinations"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/detector/{DetectorId}/publishingDestination", - "code": 200, - } - ), - ) - ], -) - -GUARD_DUTY_ARN = Schema( - id=ShapeID("com.amazonaws.guardduty#GuardDutyArn"), shape_type=ShapeType.STRING -) - -LIST_TAGS_FOR_RESOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ListTagsForResourceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#ListTagsForResourceRequest", - ) - ], - members={ - "ResourceArn": { - "target": GUARD_DUTY_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -LIST_TAGS_FOR_RESOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ListTagsForResourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#ListTagsForResourceResponse", - ) - ], - members={ - "Tags": { - "target": TAG_MAP, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="tags")], - } - }, -) - -LIST_TAGS_FOR_RESOURCE = Schema( - id=ShapeID("com.amazonaws.guardduty#ListTagsForResource"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/tags/{ResourceArn}", "code": 200} - ), - ) - ], -) - -LIST_THREAT_ENTITY_SETS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ListThreatEntitySetsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#ListThreatEntitySetsRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "MaxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "NextToken": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - }, -) - -THREAT_ENTITY_SET_IDS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ThreatEntitySetIds"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, -) - -LIST_THREAT_ENTITY_SETS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ListThreatEntitySetsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#ListThreatEntitySetsResponse", - ) - ], - members={ - "ThreatEntitySetIds": { - "target": THREAT_ENTITY_SET_IDS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="threatEntitySetIds" - ), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "NextToken": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="nextToken")], - }, - }, -) - -LIST_THREAT_ENTITY_SETS = Schema( - id=ShapeID("com.amazonaws.guardduty#ListThreatEntitySets"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/detector/{DetectorId}/threatentityset", - "code": 200, - } - ), - ) - ], -) - -LIST_THREAT_INTEL_SETS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ListThreatIntelSetsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#ListThreatIntelSetsRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "MaxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "NextToken": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - }, -) - -THREAT_INTEL_SET_IDS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ThreatIntelSetIds"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, -) - -LIST_THREAT_INTEL_SETS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ListThreatIntelSetsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#ListThreatIntelSetsResponse", - ) - ], - members={ - "ThreatIntelSetIds": { - "target": THREAT_INTEL_SET_IDS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="threatIntelSetIds"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "NextToken": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="nextToken")], - }, - }, -) - -LIST_THREAT_INTEL_SETS = Schema( - id=ShapeID("com.amazonaws.guardduty#ListThreatIntelSets"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/detector/{DetectorId}/threatintelset", - "code": 200, - } - ), - ) - ], -) - -LIST_TRUSTED_ENTITY_SETS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ListTrustedEntitySetsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#ListTrustedEntitySetsRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "MaxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "NextToken": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - }, -) - -TRUSTED_ENTITY_SET_IDS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#TrustedEntitySetIds"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, -) - -LIST_TRUSTED_ENTITY_SETS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#ListTrustedEntitySetsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#ListTrustedEntitySetsResponse", - ) - ], - members={ - "TrustedEntitySetIds": { - "target": TRUSTED_ENTITY_SET_IDS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="trustedEntitySetIds" - ), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "NextToken": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="nextToken")], - }, - }, -) - -LIST_TRUSTED_ENTITY_SETS = Schema( - id=ShapeID("com.amazonaws.guardduty#ListTrustedEntitySets"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/detector/{DetectorId}/trustedentityset", - "code": 200, - } - ), - ) - ], -) - -S3_OBJECT_FOR_SEND_OBJECT_MALWARE_SCAN = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#S3ObjectForSendObjectMalwareScan"), - members={ - "Bucket": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="bucket")], - }, - "Key": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="key")], - }, - "VersionId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="versionId")], - }, - }, -) - -SEND_OBJECT_MALWARE_SCAN_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#SendObjectMalwareScanInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#SendObjectMalwareScanRequest", - ) - ], - members={ - "S3Object": { - "target": S3_OBJECT_FOR_SEND_OBJECT_MALWARE_SCAN, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="s3Object")], - } - }, -) - -SEND_OBJECT_MALWARE_SCAN_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#SendObjectMalwareScanOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#SendObjectMalwareScanResponse", - ) - ], -) - -SEND_OBJECT_MALWARE_SCAN = Schema( - id=ShapeID("com.amazonaws.guardduty#SendObjectMalwareScan"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/object-malware-scan/send", "code": 200} - ), - ) - ], -) - -RESOURCE_ARN = Schema( - id=ShapeID("com.amazonaws.guardduty#ResourceArn"), shape_type=ShapeType.STRING -) - -RECOVERY_POINT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#RecoveryPoint"), - members={ - "BackupVaultName": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="backupVaultName"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "ContinuousScanDetails": { - "target": CONTINUOUS_SCAN_DETAILS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="continuousScanDetails" - ) - ], - }, - }, -) - -START_MALWARE_SCAN_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#StartMalwareScanConfiguration"), - members={ - "Role": { - "target": NON_EMPTY_STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="role"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "IncrementalScanDetails": { - "target": INCREMENTAL_SCAN_DETAILS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="incrementalScanDetails" - ) - ], - }, - "RecoveryPoint": { - "target": RECOVERY_POINT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="recoveryPoint") - ], - }, - }, -) - -START_MALWARE_SCAN_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#StartMalwareScanInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#StartMalwareScanRequest", - ) - ], - members={ - "ResourceArn": { - "target": RESOURCE_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="resourceArn"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "ClientToken": { - "target": CLIENT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#idempotencyToken")), - Trait.new(id=ShapeID("smithy.api#jsonName"), value="clientToken"), - ], - }, - "ScanConfiguration": { - "target": START_MALWARE_SCAN_CONFIGURATION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="scanConfiguration") - ], - }, - }, -) - -START_MALWARE_SCAN_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#StartMalwareScanOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#StartMalwareScanResponse", - ) - ], - members={ - "ScanId": { - "target": NON_EMPTY_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="scanId")], - } - }, -) - -START_MALWARE_SCAN = Schema( - id=ShapeID("com.amazonaws.guardduty#StartMalwareScan"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/malware-scan/start", "code": 200} - ), - ) - ], -) - -START_MONITORING_MEMBERS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#StartMonitoringMembersInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#StartMonitoringMembersRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "AccountIds": { - "target": ACCOUNT_IDS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="accountIds"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - }, -) - -START_MONITORING_MEMBERS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#StartMonitoringMembersOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#StartMonitoringMembersResponse", - ) - ], - members={ - "UnprocessedAccounts": { - "target": UNPROCESSED_ACCOUNTS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="unprocessedAccounts" - ), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, -) - -START_MONITORING_MEMBERS = Schema( - id=ShapeID("com.amazonaws.guardduty#StartMonitoringMembers"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/detector/{DetectorId}/member/start", - "code": 200, - } - ), - ) - ], -) - -STOP_MONITORING_MEMBERS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#StopMonitoringMembersInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#StopMonitoringMembersRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "AccountIds": { - "target": ACCOUNT_IDS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="accountIds"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - }, -) - -STOP_MONITORING_MEMBERS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#StopMonitoringMembersOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#StopMonitoringMembersResponse", - ) - ], - members={ - "UnprocessedAccounts": { - "target": UNPROCESSED_ACCOUNTS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="unprocessedAccounts" - ), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, -) - -STOP_MONITORING_MEMBERS = Schema( - id=ShapeID("com.amazonaws.guardduty#StopMonitoringMembers"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/detector/{DetectorId}/member/stop", - "code": 200, - } - ), - ) - ], -) - -TAG_RESOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#TagResourceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#TagResourceRequest", - ) - ], - members={ - "ResourceArn": { - "target": GUARD_DUTY_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Tags": { - "target": TAG_MAP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="tags"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - }, -) - -TAG_RESOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#TagResourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#TagResourceResponse", - ) - ], -) - -TAG_RESOURCE = Schema( - id=ShapeID("com.amazonaws.guardduty#TagResource"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/tags/{ResourceArn}", "code": 204} - ), - ) - ], -) - -UNARCHIVE_FINDINGS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UnarchiveFindingsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#UnarchiveFindingsRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "FindingIds": { - "target": FINDING_IDS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="findingIds"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - }, -) - -UNARCHIVE_FINDINGS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UnarchiveFindingsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#UnarchiveFindingsResponse", - ) - ], -) - -UNARCHIVE_FINDINGS = Schema( - id=ShapeID("com.amazonaws.guardduty#UnarchiveFindings"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/detector/{DetectorId}/findings/unarchive", - "code": 200, - } - ), - ) - ], -) - -TAG_KEY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#TagKeyList"), - shape_type=ShapeType.LIST, - members={"member": {"target": TAG_KEY}}, -) - -UNTAG_RESOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UntagResourceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#UntagResourceRequest", - ) - ], - members={ - "ResourceArn": { - "target": GUARD_DUTY_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "TagKeys": { - "target": TAG_KEY_LIST, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="tagKeys"), - ], - }, - }, -) - -UNTAG_RESOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UntagResourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#UntagResourceResponse", - ) - ], -) - -UNTAG_RESOURCE = Schema( - id=ShapeID("com.amazonaws.guardduty#UntagResource"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "DELETE", "uri": "/tags/{ResourceArn}", "code": 204} - ), - ) - ], -) - -UPDATE_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UpdateCustomDetectionRuleAssociationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#UpdateCustomDetectionRuleAssociationRequest", - ) - ], - members={ - "RuleId": { - "target": RULE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "AssociationId": { - "target": ASSOCIATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Mode": { - "target": ASSOCIATION_MODE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="mode"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - }, -) - -UPDATE_CUSTOM_DETECTION_RULE_ASSOCIATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UpdateCustomDetectionRuleAssociationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#UpdateCustomDetectionRuleAssociationResponse", - ) - ], -) - -UPDATE_CUSTOM_DETECTION_RULE_ASSOCIATION = Schema( - id=ShapeID("com.amazonaws.guardduty#UpdateCustomDetectionRuleAssociation"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PUT", - "uri": "/custom-detection-rule/rule/{RuleId}/association/{AssociationId}", - "code": 200, - } - ), - ) - ], -) - -UPDATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.guardduty#UpdateCustomDetectionRuleOrgConfigurationInput" - ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#UpdateCustomDetectionRuleOrgConfigurationRequest", - ) - ], - members={ - "RuleId": { - "target": RULE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Mode": { - "target": ASSOCIATION_MODE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="mode"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "IncludeAccountIds": { - "target": DETECTION_RULE_ACCOUNT_IDS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="includeAccountIds") - ], - }, - "ExcludeAccountIds": { - "target": DETECTION_RULE_ACCOUNT_IDS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="excludeAccountIds") - ], - }, - }, -) - -UPDATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.guardduty#UpdateCustomDetectionRuleOrgConfigurationOutput" - ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#UpdateCustomDetectionRuleOrgConfigurationResponse", - ) - ], -) - -UPDATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION = Schema( - id=ShapeID("com.amazonaws.guardduty#UpdateCustomDetectionRuleOrgConfiguration"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PUT", - "uri": "/custom-detection-rule/org-configuration/{RuleId}", - "code": 200, - } - ), - ) - ], -) - -UPDATE_DETECTOR_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UpdateDetectorInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#UpdateDetectorRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Enable": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="enable")], - }, - "FindingPublishingFrequency": { - "target": FINDING_PUBLISHING_FREQUENCY, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), - value="findingPublishingFrequency", - ) - ], - }, - "DataSources": { - "target": DATA_SOURCE_CONFIGURATIONS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="dataSources") - ], - }, - "Features": { - "target": DETECTOR_FEATURE_CONFIGURATIONS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="features")], - }, - }, -) - -UPDATE_DETECTOR_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UpdateDetectorOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#UpdateDetectorResponse", - ) - ], -) - -UPDATE_DETECTOR = Schema( - id=ShapeID("com.amazonaws.guardduty#UpdateDetector"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/detector/{DetectorId}", "code": 200} - ), - ) - ], -) - -UPDATE_FILTER_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UpdateFilterInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#UpdateFilterRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "FilterName": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Description": { - "target": FILTER_DESCRIPTION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="description") - ], - }, - "Action": { - "target": FILTER_ACTION, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="action")], - }, - "Rank": { - "target": FILTER_RANK, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="rank")], - }, - "FindingCriteria": { - "target": FINDING_CRITERIA, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="findingCriteria") - ], - }, - }, -) - -UPDATE_FILTER_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UpdateFilterOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#UpdateFilterResponse", - ) - ], - members={ - "Name": { - "target": FILTER_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="name"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, -) - -UPDATE_FILTER = Schema( - id=ShapeID("com.amazonaws.guardduty#UpdateFilter"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/detector/{DetectorId}/filter/{FilterName}", - "code": 200, - } - ), - ) - ], -) - -UPDATE_FINDINGS_FEEDBACK_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UpdateFindingsFeedbackInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#UpdateFindingsFeedbackRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "FindingIds": { - "target": FINDING_IDS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="findingIds"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Feedback": { - "target": FEEDBACK, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="feedback"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Comments": { - "target": SENSITIVE_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="comments")], - }, - }, -) - -UPDATE_FINDINGS_FEEDBACK_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UpdateFindingsFeedbackOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#UpdateFindingsFeedbackResponse", - ) - ], -) - -UPDATE_FINDINGS_FEEDBACK = Schema( - id=ShapeID("com.amazonaws.guardduty#UpdateFindingsFeedback"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/detector/{DetectorId}/findings/feedback", - "code": 200, - } - ), - ) - ], -) - -UPDATE_IP_SET_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UpdateIPSetInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#UpdateIPSetRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "IpSetId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Name": { - "target": NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="name")], - }, - "Location": { - "target": LOCATION, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="location")], - }, - "Activate": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="activate")], - }, - "ExpectedBucketOwner": { - "target": ACCOUNT_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="expectedBucketOwner" - ) - ], - }, - }, -) - -UPDATE_IP_SET_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UpdateIPSetOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#UpdateIPSetResponse", - ) - ], -) - -UPDATE_IP_SET = Schema( - id=ShapeID("com.amazonaws.guardduty#UpdateIPSet"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/detector/{DetectorId}/ipset/{IpSetId}", - "code": 200, - } - ), - ) - ], -) - -UPDATE_S3_BUCKET_RESOURCE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UpdateS3BucketResource"), - members={ - "ObjectPrefixes": { - "target": MALWARE_PROTECTION_PLAN_OBJECT_PREFIXES_LIST, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="objectPrefixes") - ], - } - }, -) - -UPDATE_PROTECTED_RESOURCE = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UpdateProtectedResource"), - members={ - "S3Bucket": { - "target": UPDATE_S3_BUCKET_RESOURCE, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="s3Bucket")], - } - }, -) - -UPDATE_MALWARE_PROTECTION_PLAN_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UpdateMalwareProtectionPlanInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#UpdateMalwareProtectionPlanRequest", - ) - ], - members={ - "MalwareProtectionPlanId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Role": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="role")], - }, - "Actions": { - "target": MALWARE_PROTECTION_PLAN_ACTIONS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="actions")], - }, - "ProtectedResource": { - "target": UPDATE_PROTECTED_RESOURCE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="protectedResource") - ], - }, - }, -) - -UPDATE_MALWARE_PROTECTION_PLAN_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UpdateMalwareProtectionPlanOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -UPDATE_MALWARE_PROTECTION_PLAN = Schema( - id=ShapeID("com.amazonaws.guardduty#UpdateMalwareProtectionPlan"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PATCH", - "uri": "/malware-protection-plan/{MalwareProtectionPlanId}", - "code": 200, - } - ), - ) - ], -) - -UPDATE_MALWARE_SCAN_SETTINGS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UpdateMalwareScanSettingsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#UpdateMalwareScanSettingsRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "ScanResourceCriteria": { - "target": SCAN_RESOURCE_CRITERIA, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="scanResourceCriteria" - ) - ], - }, - "EbsSnapshotPreservation": { - "target": EBS_SNAPSHOT_PRESERVATION, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="ebsSnapshotPreservation" - ) - ], - }, - }, -) - -UPDATE_MALWARE_SCAN_SETTINGS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UpdateMalwareScanSettingsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#UpdateMalwareScanSettingsResponse", - ) - ], -) - -UPDATE_MALWARE_SCAN_SETTINGS = Schema( - id=ShapeID("com.amazonaws.guardduty#UpdateMalwareScanSettings"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/detector/{DetectorId}/malware-scan-settings", - "code": 200, - } - ), - ) - ], -) - -MEMBER_ADDITIONAL_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#MemberAdditionalConfiguration"), - members={ - "Name": { - "target": ORG_FEATURE_ADDITIONAL_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="name")], - }, - "Status": { - "target": FEATURE_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="status")], - }, - }, -) - -MEMBER_ADDITIONAL_CONFIGURATIONS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#MemberAdditionalConfigurations"), - shape_type=ShapeType.LIST, - members={"member": {"target": MEMBER_ADDITIONAL_CONFIGURATION}}, -) - -MEMBER_FEATURES_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#MemberFeaturesConfiguration"), - members={ - "Name": { - "target": ORG_FEATURE, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="name")], - }, - "Status": { - "target": FEATURE_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="status")], - }, - "AdditionalConfiguration": { - "target": MEMBER_ADDITIONAL_CONFIGURATIONS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="additionalConfiguration" - ) - ], - }, - }, -) - -MEMBER_FEATURES_CONFIGURATIONS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#MemberFeaturesConfigurations"), - shape_type=ShapeType.LIST, - members={"member": {"target": MEMBER_FEATURES_CONFIGURATION}}, -) - -UPDATE_MEMBER_DETECTORS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UpdateMemberDetectorsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#UpdateMemberDetectorsRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "AccountIds": { - "target": ACCOUNT_IDS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="accountIds"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "DataSources": { - "target": DATA_SOURCE_CONFIGURATIONS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="dataSources") - ], - }, - "Features": { - "target": MEMBER_FEATURES_CONFIGURATIONS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="features")], - }, - }, -) - -UPDATE_MEMBER_DETECTORS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UpdateMemberDetectorsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#UpdateMemberDetectorsResponse", - ) - ], - members={ - "UnprocessedAccounts": { - "target": UNPROCESSED_ACCOUNTS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="unprocessedAccounts" - ), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, -) - -UPDATE_MEMBER_DETECTORS = Schema( - id=ShapeID("com.amazonaws.guardduty#UpdateMemberDetectors"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/detector/{DetectorId}/member/detector/update", - "code": 200, - } - ), - ) - ], -) - -ORGANIZATION_KUBERNETES_AUDIT_LOGS_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#OrganizationKubernetesAuditLogsConfiguration"), - members={ - "AutoEnable": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="autoEnable"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, -) - -ORGANIZATION_KUBERNETES_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#OrganizationKubernetesConfiguration"), - members={ - "AuditLogs": { - "target": ORGANIZATION_KUBERNETES_AUDIT_LOGS_CONFIGURATION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="auditLogs"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, -) - -ORGANIZATION_EBS_VOLUMES = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#OrganizationEbsVolumes"), - members={ - "AutoEnable": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="autoEnable") - ], - } - }, -) - -ORGANIZATION_SCAN_EC2_INSTANCE_WITH_FINDINGS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#OrganizationScanEc2InstanceWithFindings"), - members={ - "EbsVolumes": { - "target": ORGANIZATION_EBS_VOLUMES, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="ebsVolumes") - ], - } - }, -) - -ORGANIZATION_MALWARE_PROTECTION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#OrganizationMalwareProtectionConfiguration"), - members={ - "ScanEc2InstanceWithFindings": { - "target": ORGANIZATION_SCAN_EC2_INSTANCE_WITH_FINDINGS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), - value="scanEc2InstanceWithFindings", - ) - ], - } - }, -) - -ORGANIZATION_S3_LOGS_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#OrganizationS3LogsConfiguration"), - members={ - "AutoEnable": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="autoEnable"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, -) - -ORGANIZATION_DATA_SOURCE_CONFIGURATIONS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#OrganizationDataSourceConfigurations"), - members={ - "S3Logs": { - "target": ORGANIZATION_S3_LOGS_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="s3Logs")], - }, - "Kubernetes": { - "target": ORGANIZATION_KUBERNETES_CONFIGURATION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="kubernetes") - ], - }, - "MalwareProtection": { - "target": ORGANIZATION_MALWARE_PROTECTION_CONFIGURATION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="malwareProtection") - ], - }, - }, -) - -ORGANIZATION_ADDITIONAL_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#OrganizationAdditionalConfiguration"), - members={ - "Name": { - "target": ORG_FEATURE_ADDITIONAL_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="name")], - }, - "AutoEnable": { - "target": ORG_FEATURE_STATUS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="autoEnable") - ], - }, - }, -) - -ORGANIZATION_ADDITIONAL_CONFIGURATIONS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#OrganizationAdditionalConfigurations"), - shape_type=ShapeType.LIST, - members={"member": {"target": ORGANIZATION_ADDITIONAL_CONFIGURATION}}, -) - -ORGANIZATION_FEATURE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#OrganizationFeatureConfiguration"), - members={ - "Name": { - "target": ORG_FEATURE, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="name")], - }, - "AutoEnable": { - "target": ORG_FEATURE_STATUS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="autoEnable") - ], - }, - "AdditionalConfiguration": { - "target": ORGANIZATION_ADDITIONAL_CONFIGURATIONS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="additionalConfiguration" - ) - ], - }, - }, -) - -ORGANIZATION_FEATURES_CONFIGURATIONS = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#OrganizationFeaturesConfigurations"), - shape_type=ShapeType.LIST, - members={"member": {"target": ORGANIZATION_FEATURE_CONFIGURATION}}, -) - -UPDATE_ORGANIZATION_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UpdateOrganizationConfigurationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#UpdateOrganizationConfigurationRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "AutoEnable": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="autoEnable") - ], - }, - "DataSources": { - "target": ORGANIZATION_DATA_SOURCE_CONFIGURATIONS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="dataSources") - ], - }, - "Features": { - "target": ORGANIZATION_FEATURES_CONFIGURATIONS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="features")], - }, - "AutoEnableOrganizationMembers": { - "target": AUTO_ENABLE_MEMBERS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), - value="autoEnableOrganizationMembers", - ) - ], - }, - }, -) - -UPDATE_ORGANIZATION_CONFIGURATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UpdateOrganizationConfigurationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#UpdateOrganizationConfigurationResponse", - ) - ], -) - -UPDATE_ORGANIZATION_CONFIGURATION = Schema( - id=ShapeID("com.amazonaws.guardduty#UpdateOrganizationConfiguration"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/detector/{DetectorId}/admin", "code": 200} - ), - ) - ], -) - -UPDATE_PUBLISHING_DESTINATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UpdatePublishingDestinationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#UpdatePublishingDestinationRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "DestinationId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "DestinationProperties": { - "target": DESTINATION_PROPERTIES, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="destinationProperties" - ) - ], - }, - }, -) - -UPDATE_PUBLISHING_DESTINATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UpdatePublishingDestinationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#UpdatePublishingDestinationResponse", - ) - ], -) - -UPDATE_PUBLISHING_DESTINATION = Schema( - id=ShapeID("com.amazonaws.guardduty#UpdatePublishingDestination"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/detector/{DetectorId}/publishingDestination/{DestinationId}", - "code": 200, - } - ), - ) - ], -) - -UPDATE_THREAT_ENTITY_SET_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UpdateThreatEntitySetInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#UpdateThreatEntitySetRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "ThreatEntitySetId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Name": { - "target": NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="name")], - }, - "Location": { - "target": LOCATION, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="location")], - }, - "ExpectedBucketOwner": { - "target": EXPECTED_BUCKET_OWNER, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="expectedBucketOwner" - ) - ], - }, - "Activate": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="activate")], - }, - }, -) - -UPDATE_THREAT_ENTITY_SET_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UpdateThreatEntitySetOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#UpdateThreatEntitySetResponse", - ) - ], -) - -UPDATE_THREAT_ENTITY_SET = Schema( - id=ShapeID("com.amazonaws.guardduty#UpdateThreatEntitySet"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/detector/{DetectorId}/threatentityset/{ThreatEntitySetId}", - "code": 200, - } - ), - ) - ], -) - -UPDATE_THREAT_INTEL_SET_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UpdateThreatIntelSetInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#UpdateThreatIntelSetRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "ThreatIntelSetId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Name": { - "target": NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="name")], - }, - "Location": { - "target": LOCATION, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="location")], - }, - "Activate": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="activate")], - }, - "ExpectedBucketOwner": { - "target": ACCOUNT_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="expectedBucketOwner" - ) - ], - }, - }, -) - -UPDATE_THREAT_INTEL_SET_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UpdateThreatIntelSetOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#UpdateThreatIntelSetResponse", - ) - ], -) - -UPDATE_THREAT_INTEL_SET = Schema( - id=ShapeID("com.amazonaws.guardduty#UpdateThreatIntelSet"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/detector/{DetectorId}/threatintelset/{ThreatIntelSetId}", - "code": 200, - } - ), - ) - ], -) - -UPDATE_TRUSTED_ENTITY_SET_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UpdateTrustedEntitySetInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#UpdateTrustedEntitySetRequest", - ) - ], - members={ - "DetectorId": { - "target": DETECTOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "TrustedEntitySetId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Name": { - "target": NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="name")], - }, - "Location": { - "target": LOCATION, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="location")], - }, - "ExpectedBucketOwner": { - "target": EXPECTED_BUCKET_OWNER, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#jsonName"), value="expectedBucketOwner" - ) - ], - }, - "Activate": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="activate")], - }, - }, -) - -UPDATE_TRUSTED_ENTITY_SET_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.guardduty#UpdateTrustedEntitySetOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.guardduty#UpdateTrustedEntitySetResponse", - ) - ], -) - -UPDATE_TRUSTED_ENTITY_SET = Schema( - id=ShapeID("com.amazonaws.guardduty#UpdateTrustedEntitySet"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/detector/{DetectorId}/trustedentityset/{TrustedEntitySetId}", - "code": 200, - } - ), - ) - ], -) - -GUARD_DUTY_API_SERVICE = Schema( - id=ShapeID("com.amazonaws.guardduty#GuardDutyAPIService"), - shape_type=ShapeType.SERVICE, - traits=[ - Trait.new( - id=ShapeID("aws.auth#sigv4"), value=MappingProxyType({"name": "guardduty"}) - ), - Trait.new( - id=ShapeID("smithy.rules#endpointBdd"), - value=MappingProxyType( - { - "version": "1.1", - "parameters": MappingProxyType( - { - "Region": MappingProxyType( - { - "builtIn": "AWS::Region", - "required": False, - "documentation": "The AWS region used to dispatch the request.", - "type": "string", - } - ), - "UseDualStack": MappingProxyType( - { - "builtIn": "AWS::UseDualStack", - "required": True, - "default": False, - "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", - "type": "boolean", - } - ), - "UseFIPS": MappingProxyType( - { - "builtIn": "AWS::UseFIPS", - "required": True, - "default": False, - "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", - "type": "boolean", - } - ), - "Endpoint": MappingProxyType( - { - "builtIn": "SDK::Endpoint", - "required": False, - "documentation": "Override the endpoint used to send this request", - "type": "string", - } - ), - } - ), - "conditions": ( - MappingProxyType( - { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "Endpoint"}),), - } - ), - MappingProxyType( - { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "Region"}),), - } - ), - MappingProxyType( - { - "fn": "aws.partition", - "argv": (MappingProxyType({"ref": "Region"}),), - "assign": "PartitionResult", - } - ), - MappingProxyType( - { - "fn": "booleanEquals", - "argv": (MappingProxyType({"ref": "UseFIPS"}), True), - } - ), - MappingProxyType( +UPDATE_TRUSTED_ENTITY_SET_OUTPUT: StaticSchema = ( + 18, + n0, + _UTESOp, + {_sSI: _cUTESRoma, _smi: None}, +) + +UPDATE_TRUSTED_ENTITY_SET: StaticOperationSchema = ( + 23, + n0, + _UTESp, + { + _smith: MappingProxyType( + { + "method": "POST", + "uri": "/detector/{DetectorId}/trustedentityset/{TrustedEntitySetId}", + "code": 200, + } + ) + }, + UPDATE_TRUSTED_ENTITY_SET_INPUT, + UPDATE_TRUSTED_ENTITY_SET_OUTPUT, + (BAD_REQUEST_EXCEPTION, INTERNAL_SERVER_ERROR_EXCEPTION), +) + +GUARD_DUTY_API_SERVICE: StaticSchema = ( + 21, + n0, + _GDAPIS, + { + _aw: MappingProxyType({"name": "guardduty"}), + _sBm: MappingProxyType( + { + "version": "1.1", + "parameters": MappingProxyType( + { + "Region": MappingProxyType( { - "fn": "booleanEquals", - "argv": ( - MappingProxyType({"ref": "UseDualStack"}), - True, - ), + "builtIn": "AWS::Region", + "required": False, + "documentation": "The AWS region used to dispatch the request.", + "type": "string", } ), - MappingProxyType( + "UseDualStack": MappingProxyType( { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "supportsDualStack", - ), - } - ), - True, - ), + "builtIn": "AWS::UseDualStack", + "required": True, + "default": False, + "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", + "type": "boolean", } ), - MappingProxyType( + "UseFIPS": MappingProxyType( { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "supportsFIPS", - ), - } - ), - True, - ), + "builtIn": "AWS::UseFIPS", + "required": True, + "default": False, + "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", + "type": "boolean", } ), - MappingProxyType( + "Endpoint": MappingProxyType( { - "fn": "stringEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "name", - ), - } - ), - "aws-us-gov", - ), + "builtIn": "SDK::Endpoint", + "required": False, + "documentation": "Override the endpoint used to send this request", + "type": "string", } ), + } + ), + "conditions": ( + MappingProxyType( + { + "fn": "isSet", + "argv": (MappingProxyType({"ref": "Endpoint"}),), + } ), - "results": ( - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: FIPS and custom endpoint are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": MappingProxyType({"ref": "Endpoint"}), - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://guardduty-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "FIPS and DualStack are enabled, but this partition does not support one or both", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://guardduty.{Region}.amazonaws.com", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + MappingProxyType( + {"fn": "isSet", "argv": (MappingProxyType({"ref": "Region"}),)} + ), + MappingProxyType( + { + "fn": "aws.partition", + "argv": (MappingProxyType({"ref": "Region"}),), + "assign": "PartitionResult", + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": (MappingProxyType({"ref": "UseFIPS"}), True), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": (MappingProxyType({"ref": "UseDualStack"}), True), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( { - "url": "https://guardduty-fips.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "supportsDualStack", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "FIPS is enabled but this partition does not support FIPS", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + True, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( { - "url": "https://guardduty.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "supportsFIPS", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "DualStack is enabled but this partition does not support DualStack", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + True, + ), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( { - "url": "https://guardduty.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "name", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: Missing Region", - "type": "error", - } - ), + "aws-us-gov", + ), + } + ), + ), + "results": ( + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: FIPS and custom endpoint are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": MappingProxyType({"ref": "Endpoint"}), + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://guardduty-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS and DualStack are enabled, but this partition does not support one or both", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://guardduty.{Region}.amazonaws.com", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://guardduty-fips.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS is enabled but this partition does not support FIPS", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://guardduty.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "DualStack is enabled but this partition does not support DualStack", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://guardduty.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Missing Region", + "type": "error", + } ), - "root": 2, - "nodeCount": 14, - "nodes": "/////wAAAAH/////AAAAAAAAAA0AAAADAAAAAQAAAAQF9eEMAAAAAgAAAAUF9eEMAAAAAwAAAAgAAAAGAAAABAAAAAcF9eELAAAABQX14QkF9eEKAAAABAAAAAsAAAAJAAAABgAAAAoF9eEIAAAABwX14QYF9eEHAAAABQAAAAwF9eEFAAAABgX14QQF9eEFAAAAAwX14QEAAAAOAAAABAX14QIF9eED", - } - ), + ), + "root": 2, + "nodeCount": 14, + "nodes": "/////wAAAAH/////AAAAAAAAAA0AAAADAAAAAQAAAAQF9eEMAAAAAgAAAAUF9eEMAAAAAwAAAAgAAAAGAAAABAAAAAcF9eELAAAABQX14QkF9eEKAAAABAAAAAsAAAAJAAAABgAAAAoF9eEIAAAABwX14QYF9eEHAAAABQAAAAwF9eEFAAAABgX14QQF9eEFAAAAAwX14QEAAAAOAAAABAX14QIF9eED", + } ), - Trait.new( - id=ShapeID("aws.api#service"), - value=MappingProxyType( - { - "sdkId": "GuardDuty", - "arnNamespace": "guardduty", - "cloudFormationName": "GuardDuty", - "cloudTrailEventSource": "guardduty.amazonaws.com", - "endpointPrefix": "guardduty", - } - ), + _aws: MappingProxyType( + { + "sdkId": "GuardDuty", + "arnNamespace": "guardduty", + "cloudFormationName": "GuardDuty", + "cloudTrailEventSource": "guardduty.amazonaws.com", + "endpointPrefix": "guardduty", + } ), - Trait.new(id=ShapeID("aws.protocols#restJson1")), - ], + _aJ: None, + }, ) diff --git a/clients/aws-sdk-guardduty/src/aws_sdk_guardduty/client.py b/clients/aws-sdk-guardduty/src/aws_sdk_guardduty/client.py index cfeaaf25..e3138591 100644 --- a/clients/aws-sdk-guardduty/src/aws_sdk_guardduty/client.py +++ b/clients/aws-sdk-guardduty/src/aws_sdk_guardduty/client.py @@ -1,18 +1,20 @@ # Code generated by smithy-python-codegen DO NOT EDIT. +from __future__ import annotations + from copy import deepcopy import logging from typing import Any, cast +from smithy_aws_core.aio.identity.chain import AsyncIdentityChain from smithy_aws_core.config import ConfigSource from smithy_aws_core.identity import AWSCredentialsIdentity -from smithy_aws_core.identity.chain import IdentityChain -from smithy_core.aio.client import AsyncClient, ClientCall, RequestPipeline +from smithy_core.aio.client import AsyncClient, AsyncClientCall, AsyncRequestPipeline from smithy_core.deserializers import DeserializeableShape from smithy_core.exceptions import ExpectationNotMetError from smithy_core.schemas import APIOperation from smithy_core.serializers import SerializeableShape -from smithy_http.aio.interfaces import HTTPClient +from smithy_http.aio.interfaces import AsyncHTTPClient from smithy_http.plugins import user_agent_plugin from .config import AsyncGuardDutyConfig, Plugin @@ -20,12 +22,6 @@ ACCEPT_ADMINISTRATOR_INVITATION, ACCEPT_INVITATION, ARCHIVE_FINDINGS, - AcceptAdministratorInvitationInput, - AcceptAdministratorInvitationOutput, - AcceptInvitationInput, - AcceptInvitationOutput, - ArchiveFindingsInput, - ArchiveFindingsOutput, CREATE_CUSTOM_DETECTION_RULE_ASSOCIATION, CREATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION, CREATE_DETECTOR, @@ -39,32 +35,6 @@ CREATE_THREAT_ENTITY_SET, CREATE_THREAT_INTEL_SET, CREATE_TRUSTED_ENTITY_SET, - CreateCustomDetectionRuleAssociationInput, - CreateCustomDetectionRuleAssociationOutput, - CreateCustomDetectionRuleOrgConfigurationInput, - CreateCustomDetectionRuleOrgConfigurationOutput, - CreateDetectorInput, - CreateDetectorOutput, - CreateFilterInput, - CreateFilterOutput, - CreateIPSetInput, - CreateIPSetOutput, - CreateInvestigationInput, - CreateInvestigationOutput, - CreateMalwareProtectionPlanInput, - CreateMalwareProtectionPlanOutput, - CreateMembersInput, - CreateMembersOutput, - CreatePublishingDestinationInput, - CreatePublishingDestinationOutput, - CreateSampleFindingsInput, - CreateSampleFindingsOutput, - CreateThreatEntitySetInput, - CreateThreatEntitySetOutput, - CreateThreatIntelSetInput, - CreateThreatIntelSetOutput, - CreateTrustedEntitySetInput, - CreateTrustedEntitySetOutput, DECLINE_INVITATIONS, DELETE_CUSTOM_DETECTION_RULE_ASSOCIATION, DELETE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION, @@ -85,49 +55,7 @@ DISASSOCIATE_FROM_ADMINISTRATOR_ACCOUNT, DISASSOCIATE_FROM_MASTER_ACCOUNT, DISASSOCIATE_MEMBERS, - DeclineInvitationsInput, - DeclineInvitationsOutput, - DeleteCustomDetectionRuleAssociationInput, - DeleteCustomDetectionRuleAssociationOutput, - DeleteCustomDetectionRuleOrgConfigurationInput, - DeleteCustomDetectionRuleOrgConfigurationOutput, - DeleteDetectorInput, - DeleteDetectorOutput, - DeleteFilterInput, - DeleteFilterOutput, - DeleteIPSetInput, - DeleteIPSetOutput, - DeleteInvitationsInput, - DeleteInvitationsOutput, - DeleteMalwareProtectionPlanInput, - DeleteMalwareProtectionPlanOutput, - DeleteMembersInput, - DeleteMembersOutput, - DeletePublishingDestinationInput, - DeletePublishingDestinationOutput, - DeleteThreatEntitySetInput, - DeleteThreatEntitySetOutput, - DeleteThreatIntelSetInput, - DeleteThreatIntelSetOutput, - DeleteTrustedEntitySetInput, - DeleteTrustedEntitySetOutput, - DescribeMalwareScansInput, - DescribeMalwareScansOutput, - DescribeOrganizationConfigurationInput, - DescribeOrganizationConfigurationOutput, - DescribePublishingDestinationInput, - DescribePublishingDestinationOutput, - DisableOrganizationAdminAccountInput, - DisableOrganizationAdminAccountOutput, - DisassociateFromAdministratorAccountInput, - DisassociateFromAdministratorAccountOutput, - DisassociateFromMasterAccountInput, - DisassociateFromMasterAccountOutput, - DisassociateMembersInput, - DisassociateMembersOutput, ENABLE_ORGANIZATION_ADMIN_ACCOUNT, - EnableOrganizationAdminAccountInput, - EnableOrganizationAdminAccountOutput, GET_ADMINISTRATOR_ACCOUNT, GET_COVERAGE_STATISTICS, GET_CUSTOM_DETECTION_RULE, @@ -152,57 +80,7 @@ GET_THREAT_INTEL_SET, GET_TRUSTED_ENTITY_SET, GET_USAGE_STATISTICS, - GetAdministratorAccountInput, - GetAdministratorAccountOutput, - GetCoverageStatisticsInput, - GetCoverageStatisticsOutput, - GetCustomDetectionRuleAssociationInput, - GetCustomDetectionRuleAssociationOutput, - GetCustomDetectionRuleInput, - GetCustomDetectionRuleOrgConfigurationInput, - GetCustomDetectionRuleOrgConfigurationOutput, - GetCustomDetectionRuleOutput, - GetDetectorInput, - GetDetectorOutput, - GetFilterInput, - GetFilterOutput, - GetFindingsInput, - GetFindingsOutput, - GetFindingsStatisticsInput, - GetFindingsStatisticsOutput, - GetIPSetInput, - GetIPSetOutput, - GetInvestigationInput, - GetInvestigationOutput, - GetInvitationsCountInput, - GetInvitationsCountOutput, - GetMalwareProtectionPlanInput, - GetMalwareProtectionPlanOutput, - GetMalwareScanInput, - GetMalwareScanOutput, - GetMalwareScanSettingsInput, - GetMalwareScanSettingsOutput, - GetMasterAccountInput, - GetMasterAccountOutput, - GetMemberDetectorsInput, - GetMemberDetectorsOutput, - GetMembersInput, - GetMembersOutput, - GetOrganizationStatisticsInput, - GetOrganizationStatisticsOutput, - GetRemainingFreeTrialDaysInput, - GetRemainingFreeTrialDaysOutput, - GetThreatEntitySetInput, - GetThreatEntitySetOutput, - GetThreatIntelSetInput, - GetThreatIntelSetOutput, - GetTrustedEntitySetInput, - GetTrustedEntitySetOutput, - GetUsageStatisticsInput, - GetUsageStatisticsOutput, INVITE_MEMBERS, - InviteMembersInput, - InviteMembersOutput, LIST_COVERAGE, LIST_CUSTOM_DETECTION_RULES, LIST_CUSTOM_DETECTION_RULE_ASSOCIATIONS, @@ -222,59 +100,11 @@ LIST_THREAT_ENTITY_SETS, LIST_THREAT_INTEL_SETS, LIST_TRUSTED_ENTITY_SETS, - ListCoverageInput, - ListCoverageOutput, - ListCustomDetectionRuleAssociationsInput, - ListCustomDetectionRuleAssociationsOutput, - ListCustomDetectionRuleOrgConfigurationsInput, - ListCustomDetectionRuleOrgConfigurationsOutput, - ListCustomDetectionRulesInput, - ListCustomDetectionRulesOutput, - ListDetectorsInput, - ListDetectorsOutput, - ListFiltersInput, - ListFiltersOutput, - ListFindingsInput, - ListFindingsOutput, - ListIPSetsInput, - ListIPSetsOutput, - ListInvestigationsInput, - ListInvestigationsOutput, - ListInvitationsInput, - ListInvitationsOutput, - ListMalwareProtectionPlansInput, - ListMalwareProtectionPlansOutput, - ListMalwareScansInput, - ListMalwareScansOutput, - ListMembersInput, - ListMembersOutput, - ListOrganizationAdminAccountsInput, - ListOrganizationAdminAccountsOutput, - ListPublishingDestinationsInput, - ListPublishingDestinationsOutput, - ListTagsForResourceInput, - ListTagsForResourceOutput, - ListThreatEntitySetsInput, - ListThreatEntitySetsOutput, - ListThreatIntelSetsInput, - ListThreatIntelSetsOutput, - ListTrustedEntitySetsInput, - ListTrustedEntitySetsOutput, SEND_OBJECT_MALWARE_SCAN, START_MALWARE_SCAN, START_MONITORING_MEMBERS, STOP_MONITORING_MEMBERS, - SendObjectMalwareScanInput, - SendObjectMalwareScanOutput, - StartMalwareScanInput, - StartMalwareScanOutput, - StartMonitoringMembersInput, - StartMonitoringMembersOutput, - StopMonitoringMembersInput, - StopMonitoringMembersOutput, TAG_RESOURCE, - TagResourceInput, - TagResourceOutput, UNARCHIVE_FINDINGS, UNTAG_RESOURCE, UPDATE_CUSTOM_DETECTION_RULE_ASSOCIATION, @@ -291,41 +121,219 @@ UPDATE_THREAT_ENTITY_SET, UPDATE_THREAT_INTEL_SET, UPDATE_TRUSTED_ENTITY_SET, - UnarchiveFindingsInput, - UnarchiveFindingsOutput, - UntagResourceInput, - UntagResourceOutput, - UpdateCustomDetectionRuleAssociationInput, - UpdateCustomDetectionRuleAssociationOutput, - UpdateCustomDetectionRuleOrgConfigurationInput, - UpdateCustomDetectionRuleOrgConfigurationOutput, - UpdateDetectorInput, - UpdateDetectorOutput, - UpdateFilterInput, - UpdateFilterOutput, - UpdateFindingsFeedbackInput, - UpdateFindingsFeedbackOutput, - UpdateIPSetInput, - UpdateIPSetOutput, - UpdateMalwareProtectionPlanInput, - UpdateMalwareProtectionPlanOutput, - UpdateMalwareScanSettingsInput, - UpdateMalwareScanSettingsOutput, - UpdateMemberDetectorsInput, - UpdateMemberDetectorsOutput, - UpdateOrganizationConfigurationInput, - UpdateOrganizationConfigurationOutput, - UpdatePublishingDestinationInput, - UpdatePublishingDestinationOutput, - UpdateThreatEntitySetInput, - UpdateThreatEntitySetOutput, - UpdateThreatIntelSetInput, - UpdateThreatIntelSetOutput, - UpdateTrustedEntitySetInput, - UpdateTrustedEntitySetOutput, ) from .user_agent import aws_user_agent_plugin +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .models import ( + AcceptAdministratorInvitationInput, + AcceptAdministratorInvitationOutput, + AcceptInvitationInput, + AcceptInvitationOutput, + ArchiveFindingsInput, + ArchiveFindingsOutput, + CreateCustomDetectionRuleAssociationInput, + CreateCustomDetectionRuleAssociationOutput, + CreateCustomDetectionRuleOrgConfigurationInput, + CreateCustomDetectionRuleOrgConfigurationOutput, + CreateDetectorInput, + CreateDetectorOutput, + CreateFilterInput, + CreateFilterOutput, + CreateIPSetInput, + CreateIPSetOutput, + CreateInvestigationInput, + CreateInvestigationOutput, + CreateMalwareProtectionPlanInput, + CreateMalwareProtectionPlanOutput, + CreateMembersInput, + CreateMembersOutput, + CreatePublishingDestinationInput, + CreatePublishingDestinationOutput, + CreateSampleFindingsInput, + CreateSampleFindingsOutput, + CreateThreatEntitySetInput, + CreateThreatEntitySetOutput, + CreateThreatIntelSetInput, + CreateThreatIntelSetOutput, + CreateTrustedEntitySetInput, + CreateTrustedEntitySetOutput, + DeclineInvitationsInput, + DeclineInvitationsOutput, + DeleteCustomDetectionRuleAssociationInput, + DeleteCustomDetectionRuleAssociationOutput, + DeleteCustomDetectionRuleOrgConfigurationInput, + DeleteCustomDetectionRuleOrgConfigurationOutput, + DeleteDetectorInput, + DeleteDetectorOutput, + DeleteFilterInput, + DeleteFilterOutput, + DeleteIPSetInput, + DeleteIPSetOutput, + DeleteInvitationsInput, + DeleteInvitationsOutput, + DeleteMalwareProtectionPlanInput, + DeleteMalwareProtectionPlanOutput, + DeleteMembersInput, + DeleteMembersOutput, + DeletePublishingDestinationInput, + DeletePublishingDestinationOutput, + DeleteThreatEntitySetInput, + DeleteThreatEntitySetOutput, + DeleteThreatIntelSetInput, + DeleteThreatIntelSetOutput, + DeleteTrustedEntitySetInput, + DeleteTrustedEntitySetOutput, + DescribeMalwareScansInput, + DescribeMalwareScansOutput, + DescribeOrganizationConfigurationInput, + DescribeOrganizationConfigurationOutput, + DescribePublishingDestinationInput, + DescribePublishingDestinationOutput, + DisableOrganizationAdminAccountInput, + DisableOrganizationAdminAccountOutput, + DisassociateFromAdministratorAccountInput, + DisassociateFromAdministratorAccountOutput, + DisassociateFromMasterAccountInput, + DisassociateFromMasterAccountOutput, + DisassociateMembersInput, + DisassociateMembersOutput, + EnableOrganizationAdminAccountInput, + EnableOrganizationAdminAccountOutput, + GetAdministratorAccountInput, + GetAdministratorAccountOutput, + GetCoverageStatisticsInput, + GetCoverageStatisticsOutput, + GetCustomDetectionRuleAssociationInput, + GetCustomDetectionRuleAssociationOutput, + GetCustomDetectionRuleInput, + GetCustomDetectionRuleOrgConfigurationInput, + GetCustomDetectionRuleOrgConfigurationOutput, + GetCustomDetectionRuleOutput, + GetDetectorInput, + GetDetectorOutput, + GetFilterInput, + GetFilterOutput, + GetFindingsInput, + GetFindingsOutput, + GetFindingsStatisticsInput, + GetFindingsStatisticsOutput, + GetIPSetInput, + GetIPSetOutput, + GetInvestigationInput, + GetInvestigationOutput, + GetInvitationsCountInput, + GetInvitationsCountOutput, + GetMalwareProtectionPlanInput, + GetMalwareProtectionPlanOutput, + GetMalwareScanInput, + GetMalwareScanOutput, + GetMalwareScanSettingsInput, + GetMalwareScanSettingsOutput, + GetMasterAccountInput, + GetMasterAccountOutput, + GetMemberDetectorsInput, + GetMemberDetectorsOutput, + GetMembersInput, + GetMembersOutput, + GetOrganizationStatisticsInput, + GetOrganizationStatisticsOutput, + GetRemainingFreeTrialDaysInput, + GetRemainingFreeTrialDaysOutput, + GetThreatEntitySetInput, + GetThreatEntitySetOutput, + GetThreatIntelSetInput, + GetThreatIntelSetOutput, + GetTrustedEntitySetInput, + GetTrustedEntitySetOutput, + GetUsageStatisticsInput, + GetUsageStatisticsOutput, + InviteMembersInput, + InviteMembersOutput, + ListCoverageInput, + ListCoverageOutput, + ListCustomDetectionRuleAssociationsInput, + ListCustomDetectionRuleAssociationsOutput, + ListCustomDetectionRuleOrgConfigurationsInput, + ListCustomDetectionRuleOrgConfigurationsOutput, + ListCustomDetectionRulesInput, + ListCustomDetectionRulesOutput, + ListDetectorsInput, + ListDetectorsOutput, + ListFiltersInput, + ListFiltersOutput, + ListFindingsInput, + ListFindingsOutput, + ListIPSetsInput, + ListIPSetsOutput, + ListInvestigationsInput, + ListInvestigationsOutput, + ListInvitationsInput, + ListInvitationsOutput, + ListMalwareProtectionPlansInput, + ListMalwareProtectionPlansOutput, + ListMalwareScansInput, + ListMalwareScansOutput, + ListMembersInput, + ListMembersOutput, + ListOrganizationAdminAccountsInput, + ListOrganizationAdminAccountsOutput, + ListPublishingDestinationsInput, + ListPublishingDestinationsOutput, + ListTagsForResourceInput, + ListTagsForResourceOutput, + ListThreatEntitySetsInput, + ListThreatEntitySetsOutput, + ListThreatIntelSetsInput, + ListThreatIntelSetsOutput, + ListTrustedEntitySetsInput, + ListTrustedEntitySetsOutput, + SendObjectMalwareScanInput, + SendObjectMalwareScanOutput, + StartMalwareScanInput, + StartMalwareScanOutput, + StartMonitoringMembersInput, + StartMonitoringMembersOutput, + StopMonitoringMembersInput, + StopMonitoringMembersOutput, + TagResourceInput, + TagResourceOutput, + UnarchiveFindingsInput, + UnarchiveFindingsOutput, + UntagResourceInput, + UntagResourceOutput, + UpdateCustomDetectionRuleAssociationInput, + UpdateCustomDetectionRuleAssociationOutput, + UpdateCustomDetectionRuleOrgConfigurationInput, + UpdateCustomDetectionRuleOrgConfigurationOutput, + UpdateDetectorInput, + UpdateDetectorOutput, + UpdateFilterInput, + UpdateFilterOutput, + UpdateFindingsFeedbackInput, + UpdateFindingsFeedbackOutput, + UpdateIPSetInput, + UpdateIPSetOutput, + UpdateMalwareProtectionPlanInput, + UpdateMalwareProtectionPlanOutput, + UpdateMalwareScanSettingsInput, + UpdateMalwareScanSettingsOutput, + UpdateMemberDetectorsInput, + UpdateMemberDetectorsOutput, + UpdateOrganizationConfigurationInput, + UpdateOrganizationConfigurationOutput, + UpdatePublishingDestinationInput, + UpdatePublishingDestinationOutput, + UpdateThreatEntitySetInput, + UpdateThreatEntitySetOutput, + UpdateThreatIntelSetInput, + UpdateThreatIntelSetOutput, + UpdateTrustedEntitySetInput, + UpdateTrustedEntitySetOutput, + ) + logger = logging.getLogger(__name__) @@ -420,12 +428,12 @@ async def _post_setup(self, config: AsyncGuardDutyConfig) -> None: config_file = await config_context.parsed_profiles() if config_context.profile_source is ConfigSource.OVERRIDE: profile_name = config_context.profile_name - config.aws_credentials_identity_resolver = await IdentityChain.create( + config.aws_credentials_identity_resolver = await AsyncIdentityChain.create( AWSCredentialsIdentity, config_file=config_file, profile_name=profile_name, region_override=config.region, - http_client=cast(HTTPClient | None, config.transport), + http_client=cast(AsyncHTTPClient | None, config.transport), ) async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( @@ -434,7 +442,7 @@ async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( operation: APIOperation[I, O], default_plugins: list[Plugin], plugins: list[Plugin] | None, - ) -> tuple[RequestPipeline[Any, Any], ClientCall[I, O]]: + ) -> tuple[AsyncRequestPipeline[Any, Any], AsyncClientCall[I, O]]: if self._closed: raise RuntimeError( "Cannot invoke an operation on a client that has been closed." diff --git a/clients/aws-sdk-guardduty/src/aws_sdk_guardduty/config.py b/clients/aws-sdk-guardduty/src/aws_sdk_guardduty/config.py index 358bcf54..6b359cb2 100644 --- a/clients/aws-sdk-guardduty/src/aws_sdk_guardduty/config.py +++ b/clients/aws-sdk-guardduty/src/aws_sdk_guardduty/config.py @@ -1,476 +1,525 @@ # Code generated by smithy-python-codegen DO NOT EDIT. from dataclasses import dataclass, field -from typing import Any, Callable, ClassVar, Self, TypeAlias, Union, Unpack +from typing import ( + Any, + Callable, + ClassVar, + Self, + TYPE_CHECKING, + TypeAlias, + Union, + Unpack, +) -from smithy_aws_core.aio.protocols import RestJsonClientProtocol -from smithy_aws_core.auth import SigV4AuthScheme -from smithy_aws_core.config import AwsConfigOverrides, FileSystem -from smithy_aws_core.config.aws_config import AsyncAwsConfig -from smithy_aws_core.config.resolvers import EndpointUriResolver -from smithy_aws_core.config.types import FieldSpec -from smithy_aws_core.endpoints.standard_regional import ( - StandardRegionalEndpointsResolver, +from smithy_aws_core.aio.auth.sigv4 import AsyncSigV4AuthScheme +from smithy_aws_core.aio.config import AsyncFileSystem +from smithy_aws_core.aio.config.aws_config import AsyncAwsConfig, AwsConfigOverrides +from smithy_aws_core.aio.config.resolvers import EndpointUriResolver +from smithy_aws_core.aio.endpoints.standard_regional import ( + AsyncStandardRegionalEndpointsResolver, ) +from smithy_aws_core.aio.protocols import AsyncRestJsonClientProtocol +from smithy_aws_core.config.types import FieldSpec from smithy_aws_core.identity import AWSCredentialsIdentity, AWSIdentityProperties -from smithy_core.aio.interfaces import ( - ClientProtocol, - EndpointResolver, - ProtocolConstructor, - ProtocolSettings, -) -from smithy_core.aio.interfaces.auth import AuthScheme -from smithy_core.aio.interfaces.identity import IdentityResolver -from smithy_core.interceptors import Interceptor +from smithy_core.aio.interfaces import AsyncClientProtocol, AsyncEndpointResolver +from smithy_core.aio.interfaces.auth import AsyncAuthScheme +from smithy_core.aio.interfaces.identity import AsyncIdentityResolver +from smithy_core.interfaces import ProtocolConstructor, ProtocolSettings from smithy_core.interfaces.auth import AuthSchemeResolver from smithy_core.shapes import ShapeID from smithy_http.aio.aiohttp import AIOHTTPClient +from ._private.schemas import GUARD_DUTY_API_SERVICE from .auth import HTTPAuthSchemeResolver -from .models import ( - AcceptAdministratorInvitationInput, - AcceptAdministratorInvitationOutput, - AcceptInvitationInput, - AcceptInvitationOutput, - ArchiveFindingsInput, - ArchiveFindingsOutput, - CreateCustomDetectionRuleAssociationInput, - CreateCustomDetectionRuleAssociationOutput, - CreateCustomDetectionRuleOrgConfigurationInput, - CreateCustomDetectionRuleOrgConfigurationOutput, - CreateDetectorInput, - CreateDetectorOutput, - CreateFilterInput, - CreateFilterOutput, - CreateIPSetInput, - CreateIPSetOutput, - CreateInvestigationInput, - CreateInvestigationOutput, - CreateMalwareProtectionPlanInput, - CreateMalwareProtectionPlanOutput, - CreateMembersInput, - CreateMembersOutput, - CreatePublishingDestinationInput, - CreatePublishingDestinationOutput, - CreateSampleFindingsInput, - CreateSampleFindingsOutput, - CreateThreatEntitySetInput, - CreateThreatEntitySetOutput, - CreateThreatIntelSetInput, - CreateThreatIntelSetOutput, - CreateTrustedEntitySetInput, - CreateTrustedEntitySetOutput, - DeclineInvitationsInput, - DeclineInvitationsOutput, - DeleteCustomDetectionRuleAssociationInput, - DeleteCustomDetectionRuleAssociationOutput, - DeleteCustomDetectionRuleOrgConfigurationInput, - DeleteCustomDetectionRuleOrgConfigurationOutput, - DeleteDetectorInput, - DeleteDetectorOutput, - DeleteFilterInput, - DeleteFilterOutput, - DeleteIPSetInput, - DeleteIPSetOutput, - DeleteInvitationsInput, - DeleteInvitationsOutput, - DeleteMalwareProtectionPlanInput, - DeleteMalwareProtectionPlanOutput, - DeleteMembersInput, - DeleteMembersOutput, - DeletePublishingDestinationInput, - DeletePublishingDestinationOutput, - DeleteThreatEntitySetInput, - DeleteThreatEntitySetOutput, - DeleteThreatIntelSetInput, - DeleteThreatIntelSetOutput, - DeleteTrustedEntitySetInput, - DeleteTrustedEntitySetOutput, - DescribeMalwareScansInput, - DescribeMalwareScansOutput, - DescribeOrganizationConfigurationInput, - DescribeOrganizationConfigurationOutput, - DescribePublishingDestinationInput, - DescribePublishingDestinationOutput, - DisableOrganizationAdminAccountInput, - DisableOrganizationAdminAccountOutput, - DisassociateFromAdministratorAccountInput, - DisassociateFromAdministratorAccountOutput, - DisassociateFromMasterAccountInput, - DisassociateFromMasterAccountOutput, - DisassociateMembersInput, - DisassociateMembersOutput, - EnableOrganizationAdminAccountInput, - EnableOrganizationAdminAccountOutput, - GetAdministratorAccountInput, - GetAdministratorAccountOutput, - GetCoverageStatisticsInput, - GetCoverageStatisticsOutput, - GetCustomDetectionRuleAssociationInput, - GetCustomDetectionRuleAssociationOutput, - GetCustomDetectionRuleInput, - GetCustomDetectionRuleOrgConfigurationInput, - GetCustomDetectionRuleOrgConfigurationOutput, - GetCustomDetectionRuleOutput, - GetDetectorInput, - GetDetectorOutput, - GetFilterInput, - GetFilterOutput, - GetFindingsInput, - GetFindingsOutput, - GetFindingsStatisticsInput, - GetFindingsStatisticsOutput, - GetIPSetInput, - GetIPSetOutput, - GetInvestigationInput, - GetInvestigationOutput, - GetInvitationsCountInput, - GetInvitationsCountOutput, - GetMalwareProtectionPlanInput, - GetMalwareProtectionPlanOutput, - GetMalwareScanInput, - GetMalwareScanOutput, - GetMalwareScanSettingsInput, - GetMalwareScanSettingsOutput, - GetMasterAccountInput, - GetMasterAccountOutput, - GetMemberDetectorsInput, - GetMemberDetectorsOutput, - GetMembersInput, - GetMembersOutput, - GetOrganizationStatisticsInput, - GetOrganizationStatisticsOutput, - GetRemainingFreeTrialDaysInput, - GetRemainingFreeTrialDaysOutput, - GetThreatEntitySetInput, - GetThreatEntitySetOutput, - GetThreatIntelSetInput, - GetThreatIntelSetOutput, - GetTrustedEntitySetInput, - GetTrustedEntitySetOutput, - GetUsageStatisticsInput, - GetUsageStatisticsOutput, - InviteMembersInput, - InviteMembersOutput, - ListCoverageInput, - ListCoverageOutput, - ListCustomDetectionRuleAssociationsInput, - ListCustomDetectionRuleAssociationsOutput, - ListCustomDetectionRuleOrgConfigurationsInput, - ListCustomDetectionRuleOrgConfigurationsOutput, - ListCustomDetectionRulesInput, - ListCustomDetectionRulesOutput, - ListDetectorsInput, - ListDetectorsOutput, - ListFiltersInput, - ListFiltersOutput, - ListFindingsInput, - ListFindingsOutput, - ListIPSetsInput, - ListIPSetsOutput, - ListInvestigationsInput, - ListInvestigationsOutput, - ListInvitationsInput, - ListInvitationsOutput, - ListMalwareProtectionPlansInput, - ListMalwareProtectionPlansOutput, - ListMalwareScansInput, - ListMalwareScansOutput, - ListMembersInput, - ListMembersOutput, - ListOrganizationAdminAccountsInput, - ListOrganizationAdminAccountsOutput, - ListPublishingDestinationsInput, - ListPublishingDestinationsOutput, - ListTagsForResourceInput, - ListTagsForResourceOutput, - ListThreatEntitySetsInput, - ListThreatEntitySetsOutput, - ListThreatIntelSetsInput, - ListThreatIntelSetsOutput, - ListTrustedEntitySetsInput, - ListTrustedEntitySetsOutput, - SendObjectMalwareScanInput, - SendObjectMalwareScanOutput, - StartMalwareScanInput, - StartMalwareScanOutput, - StartMonitoringMembersInput, - StartMonitoringMembersOutput, - StopMonitoringMembersInput, - StopMonitoringMembersOutput, - TagResourceInput, - TagResourceOutput, - UnarchiveFindingsInput, - UnarchiveFindingsOutput, - UntagResourceInput, - UntagResourceOutput, - UpdateCustomDetectionRuleAssociationInput, - UpdateCustomDetectionRuleAssociationOutput, - UpdateCustomDetectionRuleOrgConfigurationInput, - UpdateCustomDetectionRuleOrgConfigurationOutput, - UpdateDetectorInput, - UpdateDetectorOutput, - UpdateFilterInput, - UpdateFilterOutput, - UpdateFindingsFeedbackInput, - UpdateFindingsFeedbackOutput, - UpdateIPSetInput, - UpdateIPSetOutput, - UpdateMalwareProtectionPlanInput, - UpdateMalwareProtectionPlanOutput, - UpdateMalwareScanSettingsInput, - UpdateMalwareScanSettingsOutput, - UpdateMemberDetectorsInput, - UpdateMemberDetectorsOutput, - UpdateOrganizationConfigurationInput, - UpdateOrganizationConfigurationOutput, - UpdatePublishingDestinationInput, - UpdatePublishingDestinationOutput, - UpdateThreatEntitySetInput, - UpdateThreatEntitySetOutput, - UpdateThreatIntelSetInput, - UpdateThreatIntelSetOutput, - UpdateTrustedEntitySetInput, - UpdateTrustedEntitySetOutput, -) -_ServiceInterceptor = Union[ - Interceptor[ +if TYPE_CHECKING: + from smithy_core.interceptors import Interceptor + from .models import ( AcceptAdministratorInvitationInput, AcceptAdministratorInvitationOutput, - Any, - Any, - ], - Interceptor[AcceptInvitationInput, AcceptInvitationOutput, Any, Any], - Interceptor[ArchiveFindingsInput, ArchiveFindingsOutput, Any, Any], - Interceptor[ + AcceptInvitationInput, + AcceptInvitationOutput, + ArchiveFindingsInput, + ArchiveFindingsOutput, CreateCustomDetectionRuleAssociationInput, CreateCustomDetectionRuleAssociationOutput, - Any, - Any, - ], - Interceptor[ CreateCustomDetectionRuleOrgConfigurationInput, CreateCustomDetectionRuleOrgConfigurationOutput, - Any, - Any, - ], - Interceptor[CreateDetectorInput, CreateDetectorOutput, Any, Any], - Interceptor[CreateFilterInput, CreateFilterOutput, Any, Any], - Interceptor[CreateInvestigationInput, CreateInvestigationOutput, Any, Any], - Interceptor[CreateIPSetInput, CreateIPSetOutput, Any, Any], - Interceptor[ - CreateMalwareProtectionPlanInput, CreateMalwareProtectionPlanOutput, Any, Any - ], - Interceptor[CreateMembersInput, CreateMembersOutput, Any, Any], - Interceptor[ - CreatePublishingDestinationInput, CreatePublishingDestinationOutput, Any, Any - ], - Interceptor[CreateSampleFindingsInput, CreateSampleFindingsOutput, Any, Any], - Interceptor[CreateThreatEntitySetInput, CreateThreatEntitySetOutput, Any, Any], - Interceptor[CreateThreatIntelSetInput, CreateThreatIntelSetOutput, Any, Any], - Interceptor[CreateTrustedEntitySetInput, CreateTrustedEntitySetOutput, Any, Any], - Interceptor[DeclineInvitationsInput, DeclineInvitationsOutput, Any, Any], - Interceptor[ + CreateDetectorInput, + CreateDetectorOutput, + CreateFilterInput, + CreateFilterOutput, + CreateIPSetInput, + CreateIPSetOutput, + CreateInvestigationInput, + CreateInvestigationOutput, + CreateMalwareProtectionPlanInput, + CreateMalwareProtectionPlanOutput, + CreateMembersInput, + CreateMembersOutput, + CreatePublishingDestinationInput, + CreatePublishingDestinationOutput, + CreateSampleFindingsInput, + CreateSampleFindingsOutput, + CreateThreatEntitySetInput, + CreateThreatEntitySetOutput, + CreateThreatIntelSetInput, + CreateThreatIntelSetOutput, + CreateTrustedEntitySetInput, + CreateTrustedEntitySetOutput, + DeclineInvitationsInput, + DeclineInvitationsOutput, DeleteCustomDetectionRuleAssociationInput, DeleteCustomDetectionRuleAssociationOutput, - Any, - Any, - ], - Interceptor[ DeleteCustomDetectionRuleOrgConfigurationInput, DeleteCustomDetectionRuleOrgConfigurationOutput, - Any, - Any, - ], - Interceptor[DeleteDetectorInput, DeleteDetectorOutput, Any, Any], - Interceptor[DeleteFilterInput, DeleteFilterOutput, Any, Any], - Interceptor[DeleteInvitationsInput, DeleteInvitationsOutput, Any, Any], - Interceptor[DeleteIPSetInput, DeleteIPSetOutput, Any, Any], - Interceptor[ - DeleteMalwareProtectionPlanInput, DeleteMalwareProtectionPlanOutput, Any, Any - ], - Interceptor[DeleteMembersInput, DeleteMembersOutput, Any, Any], - Interceptor[ - DeletePublishingDestinationInput, DeletePublishingDestinationOutput, Any, Any - ], - Interceptor[DeleteThreatEntitySetInput, DeleteThreatEntitySetOutput, Any, Any], - Interceptor[DeleteThreatIntelSetInput, DeleteThreatIntelSetOutput, Any, Any], - Interceptor[DeleteTrustedEntitySetInput, DeleteTrustedEntitySetOutput, Any, Any], - Interceptor[DescribeMalwareScansInput, DescribeMalwareScansOutput, Any, Any], - Interceptor[ + DeleteDetectorInput, + DeleteDetectorOutput, + DeleteFilterInput, + DeleteFilterOutput, + DeleteIPSetInput, + DeleteIPSetOutput, + DeleteInvitationsInput, + DeleteInvitationsOutput, + DeleteMalwareProtectionPlanInput, + DeleteMalwareProtectionPlanOutput, + DeleteMembersInput, + DeleteMembersOutput, + DeletePublishingDestinationInput, + DeletePublishingDestinationOutput, + DeleteThreatEntitySetInput, + DeleteThreatEntitySetOutput, + DeleteThreatIntelSetInput, + DeleteThreatIntelSetOutput, + DeleteTrustedEntitySetInput, + DeleteTrustedEntitySetOutput, + DescribeMalwareScansInput, + DescribeMalwareScansOutput, DescribeOrganizationConfigurationInput, DescribeOrganizationConfigurationOutput, - Any, - Any, - ], - Interceptor[ DescribePublishingDestinationInput, DescribePublishingDestinationOutput, - Any, - Any, - ], - Interceptor[ DisableOrganizationAdminAccountInput, DisableOrganizationAdminAccountOutput, - Any, - Any, - ], - Interceptor[ DisassociateFromAdministratorAccountInput, DisassociateFromAdministratorAccountOutput, - Any, - Any, - ], - Interceptor[ DisassociateFromMasterAccountInput, DisassociateFromMasterAccountOutput, - Any, - Any, - ], - Interceptor[DisassociateMembersInput, DisassociateMembersOutput, Any, Any], - Interceptor[ + DisassociateMembersInput, + DisassociateMembersOutput, EnableOrganizationAdminAccountInput, EnableOrganizationAdminAccountOutput, - Any, - Any, - ], - Interceptor[GetAdministratorAccountInput, GetAdministratorAccountOutput, Any, Any], - Interceptor[GetCoverageStatisticsInput, GetCoverageStatisticsOutput, Any, Any], - Interceptor[GetCustomDetectionRuleInput, GetCustomDetectionRuleOutput, Any, Any], - Interceptor[ + GetAdministratorAccountInput, + GetAdministratorAccountOutput, + GetCoverageStatisticsInput, + GetCoverageStatisticsOutput, GetCustomDetectionRuleAssociationInput, GetCustomDetectionRuleAssociationOutput, - Any, - Any, - ], - Interceptor[ + GetCustomDetectionRuleInput, GetCustomDetectionRuleOrgConfigurationInput, GetCustomDetectionRuleOrgConfigurationOutput, - Any, - Any, - ], - Interceptor[GetDetectorInput, GetDetectorOutput, Any, Any], - Interceptor[GetFilterInput, GetFilterOutput, Any, Any], - Interceptor[GetFindingsInput, GetFindingsOutput, Any, Any], - Interceptor[GetFindingsStatisticsInput, GetFindingsStatisticsOutput, Any, Any], - Interceptor[GetInvestigationInput, GetInvestigationOutput, Any, Any], - Interceptor[GetInvitationsCountInput, GetInvitationsCountOutput, Any, Any], - Interceptor[GetIPSetInput, GetIPSetOutput, Any, Any], - Interceptor[ - GetMalwareProtectionPlanInput, GetMalwareProtectionPlanOutput, Any, Any - ], - Interceptor[GetMalwareScanInput, GetMalwareScanOutput, Any, Any], - Interceptor[GetMalwareScanSettingsInput, GetMalwareScanSettingsOutput, Any, Any], - Interceptor[GetMasterAccountInput, GetMasterAccountOutput, Any, Any], - Interceptor[GetMemberDetectorsInput, GetMemberDetectorsOutput, Any, Any], - Interceptor[GetMembersInput, GetMembersOutput, Any, Any], - Interceptor[ - GetOrganizationStatisticsInput, GetOrganizationStatisticsOutput, Any, Any - ], - Interceptor[ - GetRemainingFreeTrialDaysInput, GetRemainingFreeTrialDaysOutput, Any, Any - ], - Interceptor[GetThreatEntitySetInput, GetThreatEntitySetOutput, Any, Any], - Interceptor[GetThreatIntelSetInput, GetThreatIntelSetOutput, Any, Any], - Interceptor[GetTrustedEntitySetInput, GetTrustedEntitySetOutput, Any, Any], - Interceptor[GetUsageStatisticsInput, GetUsageStatisticsOutput, Any, Any], - Interceptor[InviteMembersInput, InviteMembersOutput, Any, Any], - Interceptor[ListCoverageInput, ListCoverageOutput, Any, Any], - Interceptor[ + GetCustomDetectionRuleOutput, + GetDetectorInput, + GetDetectorOutput, + GetFilterInput, + GetFilterOutput, + GetFindingsInput, + GetFindingsOutput, + GetFindingsStatisticsInput, + GetFindingsStatisticsOutput, + GetIPSetInput, + GetIPSetOutput, + GetInvestigationInput, + GetInvestigationOutput, + GetInvitationsCountInput, + GetInvitationsCountOutput, + GetMalwareProtectionPlanInput, + GetMalwareProtectionPlanOutput, + GetMalwareScanInput, + GetMalwareScanOutput, + GetMalwareScanSettingsInput, + GetMalwareScanSettingsOutput, + GetMasterAccountInput, + GetMasterAccountOutput, + GetMemberDetectorsInput, + GetMemberDetectorsOutput, + GetMembersInput, + GetMembersOutput, + GetOrganizationStatisticsInput, + GetOrganizationStatisticsOutput, + GetRemainingFreeTrialDaysInput, + GetRemainingFreeTrialDaysOutput, + GetThreatEntitySetInput, + GetThreatEntitySetOutput, + GetThreatIntelSetInput, + GetThreatIntelSetOutput, + GetTrustedEntitySetInput, + GetTrustedEntitySetOutput, + GetUsageStatisticsInput, + GetUsageStatisticsOutput, + InviteMembersInput, + InviteMembersOutput, + ListCoverageInput, + ListCoverageOutput, ListCustomDetectionRuleAssociationsInput, ListCustomDetectionRuleAssociationsOutput, - Any, - Any, - ], - Interceptor[ ListCustomDetectionRuleOrgConfigurationsInput, ListCustomDetectionRuleOrgConfigurationsOutput, - Any, - Any, - ], - Interceptor[ - ListCustomDetectionRulesInput, ListCustomDetectionRulesOutput, Any, Any - ], - Interceptor[ListDetectorsInput, ListDetectorsOutput, Any, Any], - Interceptor[ListFiltersInput, ListFiltersOutput, Any, Any], - Interceptor[ListFindingsInput, ListFindingsOutput, Any, Any], - Interceptor[ListInvestigationsInput, ListInvestigationsOutput, Any, Any], - Interceptor[ListInvitationsInput, ListInvitationsOutput, Any, Any], - Interceptor[ListIPSetsInput, ListIPSetsOutput, Any, Any], - Interceptor[ - ListMalwareProtectionPlansInput, ListMalwareProtectionPlansOutput, Any, Any - ], - Interceptor[ListMalwareScansInput, ListMalwareScansOutput, Any, Any], - Interceptor[ListMembersInput, ListMembersOutput, Any, Any], - Interceptor[ + ListCustomDetectionRulesInput, + ListCustomDetectionRulesOutput, + ListDetectorsInput, + ListDetectorsOutput, + ListFiltersInput, + ListFiltersOutput, + ListFindingsInput, + ListFindingsOutput, + ListIPSetsInput, + ListIPSetsOutput, + ListInvestigationsInput, + ListInvestigationsOutput, + ListInvitationsInput, + ListInvitationsOutput, + ListMalwareProtectionPlansInput, + ListMalwareProtectionPlansOutput, + ListMalwareScansInput, + ListMalwareScansOutput, + ListMembersInput, + ListMembersOutput, ListOrganizationAdminAccountsInput, ListOrganizationAdminAccountsOutput, - Any, - Any, - ], - Interceptor[ - ListPublishingDestinationsInput, ListPublishingDestinationsOutput, Any, Any - ], - Interceptor[ListTagsForResourceInput, ListTagsForResourceOutput, Any, Any], - Interceptor[ListThreatEntitySetsInput, ListThreatEntitySetsOutput, Any, Any], - Interceptor[ListThreatIntelSetsInput, ListThreatIntelSetsOutput, Any, Any], - Interceptor[ListTrustedEntitySetsInput, ListTrustedEntitySetsOutput, Any, Any], - Interceptor[SendObjectMalwareScanInput, SendObjectMalwareScanOutput, Any, Any], - Interceptor[StartMalwareScanInput, StartMalwareScanOutput, Any, Any], - Interceptor[StartMonitoringMembersInput, StartMonitoringMembersOutput, Any, Any], - Interceptor[StopMonitoringMembersInput, StopMonitoringMembersOutput, Any, Any], - Interceptor[TagResourceInput, TagResourceOutput, Any, Any], - Interceptor[UnarchiveFindingsInput, UnarchiveFindingsOutput, Any, Any], - Interceptor[UntagResourceInput, UntagResourceOutput, Any, Any], - Interceptor[ + ListPublishingDestinationsInput, + ListPublishingDestinationsOutput, + ListTagsForResourceInput, + ListTagsForResourceOutput, + ListThreatEntitySetsInput, + ListThreatEntitySetsOutput, + ListThreatIntelSetsInput, + ListThreatIntelSetsOutput, + ListTrustedEntitySetsInput, + ListTrustedEntitySetsOutput, + SendObjectMalwareScanInput, + SendObjectMalwareScanOutput, + StartMalwareScanInput, + StartMalwareScanOutput, + StartMonitoringMembersInput, + StartMonitoringMembersOutput, + StopMonitoringMembersInput, + StopMonitoringMembersOutput, + TagResourceInput, + TagResourceOutput, + UnarchiveFindingsInput, + UnarchiveFindingsOutput, + UntagResourceInput, + UntagResourceOutput, UpdateCustomDetectionRuleAssociationInput, UpdateCustomDetectionRuleAssociationOutput, - Any, - Any, - ], - Interceptor[ UpdateCustomDetectionRuleOrgConfigurationInput, UpdateCustomDetectionRuleOrgConfigurationOutput, - Any, - Any, - ], - Interceptor[UpdateDetectorInput, UpdateDetectorOutput, Any, Any], - Interceptor[UpdateFilterInput, UpdateFilterOutput, Any, Any], - Interceptor[UpdateFindingsFeedbackInput, UpdateFindingsFeedbackOutput, Any, Any], - Interceptor[UpdateIPSetInput, UpdateIPSetOutput, Any, Any], - Interceptor[ - UpdateMalwareProtectionPlanInput, UpdateMalwareProtectionPlanOutput, Any, Any - ], - Interceptor[ - UpdateMalwareScanSettingsInput, UpdateMalwareScanSettingsOutput, Any, Any - ], - Interceptor[UpdateMemberDetectorsInput, UpdateMemberDetectorsOutput, Any, Any], - Interceptor[ + UpdateDetectorInput, + UpdateDetectorOutput, + UpdateFilterInput, + UpdateFilterOutput, + UpdateFindingsFeedbackInput, + UpdateFindingsFeedbackOutput, + UpdateIPSetInput, + UpdateIPSetOutput, + UpdateMalwareProtectionPlanInput, + UpdateMalwareProtectionPlanOutput, + UpdateMalwareScanSettingsInput, + UpdateMalwareScanSettingsOutput, + UpdateMemberDetectorsInput, + UpdateMemberDetectorsOutput, UpdateOrganizationConfigurationInput, UpdateOrganizationConfigurationOutput, - Any, - Any, - ], - Interceptor[ - UpdatePublishingDestinationInput, UpdatePublishingDestinationOutput, Any, Any - ], - Interceptor[UpdateThreatEntitySetInput, UpdateThreatEntitySetOutput, Any, Any], - Interceptor[UpdateThreatIntelSetInput, UpdateThreatIntelSetOutput, Any, Any], - Interceptor[UpdateTrustedEntitySetInput, UpdateTrustedEntitySetOutput, Any, Any], -] + UpdatePublishingDestinationInput, + UpdatePublishingDestinationOutput, + UpdateThreatEntitySetInput, + UpdateThreatEntitySetOutput, + UpdateThreatIntelSetInput, + UpdateThreatIntelSetOutput, + UpdateTrustedEntitySetInput, + UpdateTrustedEntitySetOutput, + ) + + _ServiceInterceptor = Union[ + Interceptor[ + AcceptAdministratorInvitationInput, + AcceptAdministratorInvitationOutput, + Any, + Any, + ], + Interceptor[AcceptInvitationInput, AcceptInvitationOutput, Any, Any], + Interceptor[ArchiveFindingsInput, ArchiveFindingsOutput, Any, Any], + Interceptor[ + CreateCustomDetectionRuleAssociationInput, + CreateCustomDetectionRuleAssociationOutput, + Any, + Any, + ], + Interceptor[ + CreateCustomDetectionRuleOrgConfigurationInput, + CreateCustomDetectionRuleOrgConfigurationOutput, + Any, + Any, + ], + Interceptor[CreateDetectorInput, CreateDetectorOutput, Any, Any], + Interceptor[CreateFilterInput, CreateFilterOutput, Any, Any], + Interceptor[CreateInvestigationInput, CreateInvestigationOutput, Any, Any], + Interceptor[CreateIPSetInput, CreateIPSetOutput, Any, Any], + Interceptor[ + CreateMalwareProtectionPlanInput, + CreateMalwareProtectionPlanOutput, + Any, + Any, + ], + Interceptor[CreateMembersInput, CreateMembersOutput, Any, Any], + Interceptor[ + CreatePublishingDestinationInput, + CreatePublishingDestinationOutput, + Any, + Any, + ], + Interceptor[CreateSampleFindingsInput, CreateSampleFindingsOutput, Any, Any], + Interceptor[CreateThreatEntitySetInput, CreateThreatEntitySetOutput, Any, Any], + Interceptor[CreateThreatIntelSetInput, CreateThreatIntelSetOutput, Any, Any], + Interceptor[ + CreateTrustedEntitySetInput, CreateTrustedEntitySetOutput, Any, Any + ], + Interceptor[DeclineInvitationsInput, DeclineInvitationsOutput, Any, Any], + Interceptor[ + DeleteCustomDetectionRuleAssociationInput, + DeleteCustomDetectionRuleAssociationOutput, + Any, + Any, + ], + Interceptor[ + DeleteCustomDetectionRuleOrgConfigurationInput, + DeleteCustomDetectionRuleOrgConfigurationOutput, + Any, + Any, + ], + Interceptor[DeleteDetectorInput, DeleteDetectorOutput, Any, Any], + Interceptor[DeleteFilterInput, DeleteFilterOutput, Any, Any], + Interceptor[DeleteInvitationsInput, DeleteInvitationsOutput, Any, Any], + Interceptor[DeleteIPSetInput, DeleteIPSetOutput, Any, Any], + Interceptor[ + DeleteMalwareProtectionPlanInput, + DeleteMalwareProtectionPlanOutput, + Any, + Any, + ], + Interceptor[DeleteMembersInput, DeleteMembersOutput, Any, Any], + Interceptor[ + DeletePublishingDestinationInput, + DeletePublishingDestinationOutput, + Any, + Any, + ], + Interceptor[DeleteThreatEntitySetInput, DeleteThreatEntitySetOutput, Any, Any], + Interceptor[DeleteThreatIntelSetInput, DeleteThreatIntelSetOutput, Any, Any], + Interceptor[ + DeleteTrustedEntitySetInput, DeleteTrustedEntitySetOutput, Any, Any + ], + Interceptor[DescribeMalwareScansInput, DescribeMalwareScansOutput, Any, Any], + Interceptor[ + DescribeOrganizationConfigurationInput, + DescribeOrganizationConfigurationOutput, + Any, + Any, + ], + Interceptor[ + DescribePublishingDestinationInput, + DescribePublishingDestinationOutput, + Any, + Any, + ], + Interceptor[ + DisableOrganizationAdminAccountInput, + DisableOrganizationAdminAccountOutput, + Any, + Any, + ], + Interceptor[ + DisassociateFromAdministratorAccountInput, + DisassociateFromAdministratorAccountOutput, + Any, + Any, + ], + Interceptor[ + DisassociateFromMasterAccountInput, + DisassociateFromMasterAccountOutput, + Any, + Any, + ], + Interceptor[DisassociateMembersInput, DisassociateMembersOutput, Any, Any], + Interceptor[ + EnableOrganizationAdminAccountInput, + EnableOrganizationAdminAccountOutput, + Any, + Any, + ], + Interceptor[ + GetAdministratorAccountInput, GetAdministratorAccountOutput, Any, Any + ], + Interceptor[GetCoverageStatisticsInput, GetCoverageStatisticsOutput, Any, Any], + Interceptor[ + GetCustomDetectionRuleInput, GetCustomDetectionRuleOutput, Any, Any + ], + Interceptor[ + GetCustomDetectionRuleAssociationInput, + GetCustomDetectionRuleAssociationOutput, + Any, + Any, + ], + Interceptor[ + GetCustomDetectionRuleOrgConfigurationInput, + GetCustomDetectionRuleOrgConfigurationOutput, + Any, + Any, + ], + Interceptor[GetDetectorInput, GetDetectorOutput, Any, Any], + Interceptor[GetFilterInput, GetFilterOutput, Any, Any], + Interceptor[GetFindingsInput, GetFindingsOutput, Any, Any], + Interceptor[GetFindingsStatisticsInput, GetFindingsStatisticsOutput, Any, Any], + Interceptor[GetInvestigationInput, GetInvestigationOutput, Any, Any], + Interceptor[GetInvitationsCountInput, GetInvitationsCountOutput, Any, Any], + Interceptor[GetIPSetInput, GetIPSetOutput, Any, Any], + Interceptor[ + GetMalwareProtectionPlanInput, GetMalwareProtectionPlanOutput, Any, Any + ], + Interceptor[GetMalwareScanInput, GetMalwareScanOutput, Any, Any], + Interceptor[ + GetMalwareScanSettingsInput, GetMalwareScanSettingsOutput, Any, Any + ], + Interceptor[GetMasterAccountInput, GetMasterAccountOutput, Any, Any], + Interceptor[GetMemberDetectorsInput, GetMemberDetectorsOutput, Any, Any], + Interceptor[GetMembersInput, GetMembersOutput, Any, Any], + Interceptor[ + GetOrganizationStatisticsInput, GetOrganizationStatisticsOutput, Any, Any + ], + Interceptor[ + GetRemainingFreeTrialDaysInput, GetRemainingFreeTrialDaysOutput, Any, Any + ], + Interceptor[GetThreatEntitySetInput, GetThreatEntitySetOutput, Any, Any], + Interceptor[GetThreatIntelSetInput, GetThreatIntelSetOutput, Any, Any], + Interceptor[GetTrustedEntitySetInput, GetTrustedEntitySetOutput, Any, Any], + Interceptor[GetUsageStatisticsInput, GetUsageStatisticsOutput, Any, Any], + Interceptor[InviteMembersInput, InviteMembersOutput, Any, Any], + Interceptor[ListCoverageInput, ListCoverageOutput, Any, Any], + Interceptor[ + ListCustomDetectionRuleAssociationsInput, + ListCustomDetectionRuleAssociationsOutput, + Any, + Any, + ], + Interceptor[ + ListCustomDetectionRuleOrgConfigurationsInput, + ListCustomDetectionRuleOrgConfigurationsOutput, + Any, + Any, + ], + Interceptor[ + ListCustomDetectionRulesInput, ListCustomDetectionRulesOutput, Any, Any + ], + Interceptor[ListDetectorsInput, ListDetectorsOutput, Any, Any], + Interceptor[ListFiltersInput, ListFiltersOutput, Any, Any], + Interceptor[ListFindingsInput, ListFindingsOutput, Any, Any], + Interceptor[ListInvestigationsInput, ListInvestigationsOutput, Any, Any], + Interceptor[ListInvitationsInput, ListInvitationsOutput, Any, Any], + Interceptor[ListIPSetsInput, ListIPSetsOutput, Any, Any], + Interceptor[ + ListMalwareProtectionPlansInput, ListMalwareProtectionPlansOutput, Any, Any + ], + Interceptor[ListMalwareScansInput, ListMalwareScansOutput, Any, Any], + Interceptor[ListMembersInput, ListMembersOutput, Any, Any], + Interceptor[ + ListOrganizationAdminAccountsInput, + ListOrganizationAdminAccountsOutput, + Any, + Any, + ], + Interceptor[ + ListPublishingDestinationsInput, ListPublishingDestinationsOutput, Any, Any + ], + Interceptor[ListTagsForResourceInput, ListTagsForResourceOutput, Any, Any], + Interceptor[ListThreatEntitySetsInput, ListThreatEntitySetsOutput, Any, Any], + Interceptor[ListThreatIntelSetsInput, ListThreatIntelSetsOutput, Any, Any], + Interceptor[ListTrustedEntitySetsInput, ListTrustedEntitySetsOutput, Any, Any], + Interceptor[SendObjectMalwareScanInput, SendObjectMalwareScanOutput, Any, Any], + Interceptor[StartMalwareScanInput, StartMalwareScanOutput, Any, Any], + Interceptor[ + StartMonitoringMembersInput, StartMonitoringMembersOutput, Any, Any + ], + Interceptor[StopMonitoringMembersInput, StopMonitoringMembersOutput, Any, Any], + Interceptor[TagResourceInput, TagResourceOutput, Any, Any], + Interceptor[UnarchiveFindingsInput, UnarchiveFindingsOutput, Any, Any], + Interceptor[UntagResourceInput, UntagResourceOutput, Any, Any], + Interceptor[ + UpdateCustomDetectionRuleAssociationInput, + UpdateCustomDetectionRuleAssociationOutput, + Any, + Any, + ], + Interceptor[ + UpdateCustomDetectionRuleOrgConfigurationInput, + UpdateCustomDetectionRuleOrgConfigurationOutput, + Any, + Any, + ], + Interceptor[UpdateDetectorInput, UpdateDetectorOutput, Any, Any], + Interceptor[UpdateFilterInput, UpdateFilterOutput, Any, Any], + Interceptor[ + UpdateFindingsFeedbackInput, UpdateFindingsFeedbackOutput, Any, Any + ], + Interceptor[UpdateIPSetInput, UpdateIPSetOutput, Any, Any], + Interceptor[ + UpdateMalwareProtectionPlanInput, + UpdateMalwareProtectionPlanOutput, + Any, + Any, + ], + Interceptor[ + UpdateMalwareScanSettingsInput, UpdateMalwareScanSettingsOutput, Any, Any + ], + Interceptor[UpdateMemberDetectorsInput, UpdateMemberDetectorsOutput, Any, Any], + Interceptor[ + UpdateOrganizationConfigurationInput, + UpdateOrganizationConfigurationOutput, + Any, + Any, + ], + Interceptor[ + UpdatePublishingDestinationInput, + UpdatePublishingDestinationOutput, + Any, + Any, + ], + Interceptor[UpdateThreatEntitySetInput, UpdateThreatEntitySetOutput, Any, Any], + Interceptor[UpdateThreatIntelSetInput, UpdateThreatIntelSetOutput, Any, Any], + Interceptor[ + UpdateTrustedEntitySetInput, UpdateTrustedEntitySetOutput, Any, Any + ], + ] +else: + _ServiceInterceptor = Any + _PROTOCOL_SETTINGS = ProtocolSettings( - namespace="com.amazonaws.guardduty", service_target="GuardDutyAPIService" + namespace="com.amazonaws.guardduty", + service_target="GuardDutyAPIService", + service_schema=GUARD_DUTY_API_SERVICE, ) class _AsyncGuardDutyConfigOverrides(AwsConfigOverrides, total=False): - endpoint_resolver: EndpointResolver | None + endpoint_resolver: AsyncEndpointResolver | None protocol: ( - ClientProtocol[Any, Any] | ProtocolConstructor[ClientProtocol[Any, Any]] | None + AsyncClientProtocol[Any, Any] + | ProtocolConstructor[AsyncClientProtocol[Any, Any]] + | None ) - auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None + auth_schemes: dict[ShapeID, AsyncAuthScheme[Any, Any, Any, Any]] | None auth_scheme_resolver: AuthSchemeResolver | None @@ -478,17 +527,17 @@ class _AsyncGuardDutyConfigOverrides(AwsConfigOverrides, total=False): class AsyncGuardDutyConfig(AsyncAwsConfig): """GuardDuty configuration (async-resolved).""" - endpoint_resolver: EndpointResolver | None = None + endpoint_resolver: AsyncEndpointResolver | None = None """ The endpoint resolver used to resolve the final endpoint per-operation based on the configuration. """ - protocol: ClientProtocol[Any, Any] | None = None + protocol: AsyncClientProtocol[Any, Any] | None = None """ Pass a protocol class reference from smithy_aws_core.aio.protocols to - select the protocol, e.g. protocol=AwsJson10ClientProtocol. For custom - protocols a protocol instance may also be passed. + select the protocol, e.g. protocol=AsyncAwsJson10ClientProtocol. For + custom protocols a protocol instance may also be passed. """ interceptors: list[_ServiceInterceptor] = field(default_factory=lambda: []) @@ -497,7 +546,7 @@ class AsyncGuardDutyConfig(AsyncAwsConfig): execution of a request. """ - auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None = None + auth_schemes: dict[ShapeID, AsyncAuthScheme[Any, Any, Any, Any]] | None = None """A map of auth scheme ids to auth schemes.""" auth_scheme_resolver: AuthSchemeResolver | None = None @@ -507,7 +556,7 @@ class AsyncGuardDutyConfig(AsyncAwsConfig): """ aws_credentials_identity_resolver: ( - IdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None + AsyncIdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None ) = None """Resolves AWS Credentials. Required for operations that use Sigv4 Auth.""" @@ -548,24 +597,24 @@ class AsyncGuardDutyConfig(AsyncAwsConfig): default=None, resolver=EndpointUriResolver("guardduty") ), "endpoint_resolver": FieldSpec( - default_factory=lambda: StandardRegionalEndpointsResolver( + default_factory=lambda: AsyncStandardRegionalEndpointsResolver( endpoint_prefix="guardduty" ) ), "protocol": FieldSpec( - default_factory=lambda: RestJsonClientProtocol(_PROTOCOL_SETTINGS), + default_factory=lambda: AsyncRestJsonClientProtocol(_PROTOCOL_SETTINGS), converter=lambda p: p(_PROTOCOL_SETTINGS) if isinstance(p, type) else p, ), "auth_schemes": FieldSpec( default_factory=lambda: { - ShapeID("aws.auth#sigv4"): SigV4AuthScheme(service="guardduty") + ShapeID("aws.auth#sigv4"): AsyncSigV4AuthScheme(service="guardduty") } ), "auth_scheme_resolver": FieldSpec(default_factory=HTTPAuthSchemeResolver), "transport": FieldSpec(default_factory=lambda: AIOHTTPClient()), } - def set_auth_scheme(self, scheme: AuthScheme[Any, Any, Any, Any]) -> None: + def set_auth_scheme(self, scheme: AsyncAuthScheme[Any, Any, Any, Any]) -> None: """ Set an auth scheme implementation using its scheme ID. :param scheme: The auth scheme to add or replace. @@ -579,7 +628,7 @@ async def resolve( # pyright: ignore[reportIncompatibleMethodOverride] cls, *, profile: str | None = None, - fs: FileSystem | None = None, + fs: AsyncFileSystem | None = None, config_file_path: str | None = None, credentials_file_path: str | None = None, **overrides: Unpack[_AsyncGuardDutyConfigOverrides], diff --git a/clients/aws-sdk-guardduty/src/aws_sdk_guardduty/models.py b/clients/aws-sdk-guardduty/src/aws_sdk_guardduty/models.py index 00866955..a91a33c4 100644 --- a/clients/aws-sdk-guardduty/src/aws_sdk_guardduty/models.py +++ b/clients/aws-sdk-guardduty/src/aws_sdk_guardduty/models.py @@ -1,609 +1,327 @@ # Code generated by smithy-python-codegen DO NOT EDIT. -from dataclasses import dataclass, field -from datetime import datetime, timezone -from enum import StrEnum -import logging -from typing import Any, Literal, Self +from __future__ import annotations -from smithy_core.deserializers import ShapeDeserializer -from smithy_core.documents import TypeRegistry +from ._private import schemas as _schemas +from smithy_core._dynamic_models import ModelRegistry from smithy_core.exceptions import ModeledError -from smithy_core.response import EMPTY_RESPONSE_METADATA, ResponseMetadata -from smithy_core.schemas import APIOperation, Schema -from smithy_core.serializers import ShapeSerializer +from smithy_core.schemas import APIOperation from smithy_core.shapes import ShapeID -from smithy_core.types import UnknownEnumMixin from ._private.schemas import ( ACCEPT_ADMINISTRATOR_INVITATION as _SCHEMA_ACCEPT_ADMINISTRATOR_INVITATION, - ACCEPT_ADMINISTRATOR_INVITATION_INPUT as _SCHEMA_ACCEPT_ADMINISTRATOR_INVITATION_INPUT, - ACCEPT_ADMINISTRATOR_INVITATION_OUTPUT as _SCHEMA_ACCEPT_ADMINISTRATOR_INVITATION_OUTPUT, ACCEPT_INVITATION as _SCHEMA_ACCEPT_INVITATION, - ACCEPT_INVITATION_INPUT as _SCHEMA_ACCEPT_INVITATION_INPUT, - ACCEPT_INVITATION_OUTPUT as _SCHEMA_ACCEPT_INVITATION_OUTPUT, - ACCESS_CONTROL_LIST as _SCHEMA_ACCESS_CONTROL_LIST, - ACCESS_DENIED_EXCEPTION as _SCHEMA_ACCESS_DENIED_EXCEPTION, - ACCESS_KEY as _SCHEMA_ACCESS_KEY, - ACCESS_KEY_DETAILS as _SCHEMA_ACCESS_KEY_DETAILS, - ACCOUNT as _SCHEMA_ACCOUNT, - ACCOUNT_DETAIL as _SCHEMA_ACCOUNT_DETAIL, - ACCOUNT_FREE_TRIAL_INFO as _SCHEMA_ACCOUNT_FREE_TRIAL_INFO, - ACCOUNT_LEVEL_PERMISSIONS as _SCHEMA_ACCOUNT_LEVEL_PERMISSIONS, - ACCOUNT_STATISTICS as _SCHEMA_ACCOUNT_STATISTICS, - ACTION as _SCHEMA_ACTION, - ACTIVITY as _SCHEMA_ACTIVITY, - ACTOR as _SCHEMA_ACTOR, - ACTOR_PROCESS as _SCHEMA_ACTOR_PROCESS, - ADDITIONAL_INFO as _SCHEMA_ADDITIONAL_INFO, - ADDON_DETAILS as _SCHEMA_ADDON_DETAILS, - ADMINISTRATOR as _SCHEMA_ADMINISTRATOR, - ADMIN_ACCOUNT as _SCHEMA_ADMIN_ACCOUNT, - AGENT_DETAILS as _SCHEMA_AGENT_DETAILS, - ANOMALY as _SCHEMA_ANOMALY, - ANOMALY_OBJECT as _SCHEMA_ANOMALY_OBJECT, - ANOMALY_UNUSUAL as _SCHEMA_ANOMALY_UNUSUAL, - API_CALL as _SCHEMA_API_CALL, ARCHIVE_FINDINGS as _SCHEMA_ARCHIVE_FINDINGS, - ARCHIVE_FINDINGS_INPUT as _SCHEMA_ARCHIVE_FINDINGS_INPUT, - ARCHIVE_FINDINGS_OUTPUT as _SCHEMA_ARCHIVE_FINDINGS_OUTPUT, - ASSOCIATION_DETAIL as _SCHEMA_ASSOCIATION_DETAIL, - ASSOCIATION_SUMMARY as _SCHEMA_ASSOCIATION_SUMMARY, - AUTONOMOUS_SYSTEM as _SCHEMA_AUTONOMOUS_SYSTEM, - AUTOSCALING_AUTO_SCALING_GROUP as _SCHEMA_AUTOSCALING_AUTO_SCALING_GROUP, - AWS_API_CALL_ACTION as _SCHEMA_AWS_API_CALL_ACTION, - BAD_REQUEST_EXCEPTION as _SCHEMA_BAD_REQUEST_EXCEPTION, - BEDROCK_GUARDRAIL as _SCHEMA_BEDROCK_GUARDRAIL, - BEDROCK_GUARDRAIL_DETAILS as _SCHEMA_BEDROCK_GUARDRAIL_DETAILS, - BEDROCK_GUARDRAIL_RESOURCE as _SCHEMA_BEDROCK_GUARDRAIL_RESOURCE, - BLOCK_PUBLIC_ACCESS as _SCHEMA_BLOCK_PUBLIC_ACCESS, - BUCKET_LEVEL_PERMISSIONS as _SCHEMA_BUCKET_LEVEL_PERMISSIONS, - BUCKET_POLICY as _SCHEMA_BUCKET_POLICY, - CITY as _SCHEMA_CITY, - CLOUDFORMATION_STACK as _SCHEMA_CLOUDFORMATION_STACK, - CLOUD_DETAILS as _SCHEMA_CLOUD_DETAILS, - CLOUD_TRAIL_CONFIGURATION_RESULT as _SCHEMA_CLOUD_TRAIL_CONFIGURATION_RESULT, - CONDITION as _SCHEMA_CONDITION, - CONFLICT_EXCEPTION as _SCHEMA_CONFLICT_EXCEPTION, - CONTAINER as _SCHEMA_CONTAINER, - CONTAINER_FINDING_RESOURCE as _SCHEMA_CONTAINER_FINDING_RESOURCE, - CONTAINER_INSTANCE_DETAILS as _SCHEMA_CONTAINER_INSTANCE_DETAILS, - CONTENT_POLICY_FILTER as _SCHEMA_CONTENT_POLICY_FILTER, - CONTINUOUS_SCAN_DETAILS as _SCHEMA_CONTINUOUS_SCAN_DETAILS, - COUNTRY as _SCHEMA_COUNTRY, - COVERAGE_EC2_INSTANCE_DETAILS as _SCHEMA_COVERAGE_EC2_INSTANCE_DETAILS, - COVERAGE_ECS_CLUSTER_DETAILS as _SCHEMA_COVERAGE_ECS_CLUSTER_DETAILS, - COVERAGE_EKS_CLUSTER_DETAILS as _SCHEMA_COVERAGE_EKS_CLUSTER_DETAILS, - COVERAGE_FILTER_CONDITION as _SCHEMA_COVERAGE_FILTER_CONDITION, - COVERAGE_FILTER_CRITERIA as _SCHEMA_COVERAGE_FILTER_CRITERIA, - COVERAGE_FILTER_CRITERION as _SCHEMA_COVERAGE_FILTER_CRITERION, - COVERAGE_RESOURCE as _SCHEMA_COVERAGE_RESOURCE, - COVERAGE_RESOURCE_DETAILS as _SCHEMA_COVERAGE_RESOURCE_DETAILS, - COVERAGE_SORT_CRITERIA as _SCHEMA_COVERAGE_SORT_CRITERIA, - COVERAGE_STATISTICS as _SCHEMA_COVERAGE_STATISTICS, CREATE_CUSTOM_DETECTION_RULE_ASSOCIATION as _SCHEMA_CREATE_CUSTOM_DETECTION_RULE_ASSOCIATION, - CREATE_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT as _SCHEMA_CREATE_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT, - CREATE_CUSTOM_DETECTION_RULE_ASSOCIATION_OUTPUT as _SCHEMA_CREATE_CUSTOM_DETECTION_RULE_ASSOCIATION_OUTPUT, CREATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION as _SCHEMA_CREATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION, - CREATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT as _SCHEMA_CREATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT, - CREATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_OUTPUT as _SCHEMA_CREATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_OUTPUT, CREATE_DETECTOR as _SCHEMA_CREATE_DETECTOR, - CREATE_DETECTOR_INPUT as _SCHEMA_CREATE_DETECTOR_INPUT, - CREATE_DETECTOR_OUTPUT as _SCHEMA_CREATE_DETECTOR_OUTPUT, CREATE_FILTER as _SCHEMA_CREATE_FILTER, - CREATE_FILTER_INPUT as _SCHEMA_CREATE_FILTER_INPUT, - CREATE_FILTER_OUTPUT as _SCHEMA_CREATE_FILTER_OUTPUT, CREATE_INVESTIGATION as _SCHEMA_CREATE_INVESTIGATION, - CREATE_INVESTIGATION_INPUT as _SCHEMA_CREATE_INVESTIGATION_INPUT, - CREATE_INVESTIGATION_OUTPUT as _SCHEMA_CREATE_INVESTIGATION_OUTPUT, CREATE_IP_SET as _SCHEMA_CREATE_IP_SET, - CREATE_IP_SET_INPUT as _SCHEMA_CREATE_IP_SET_INPUT, - CREATE_IP_SET_OUTPUT as _SCHEMA_CREATE_IP_SET_OUTPUT, CREATE_MALWARE_PROTECTION_PLAN as _SCHEMA_CREATE_MALWARE_PROTECTION_PLAN, - CREATE_MALWARE_PROTECTION_PLAN_INPUT as _SCHEMA_CREATE_MALWARE_PROTECTION_PLAN_INPUT, - CREATE_MALWARE_PROTECTION_PLAN_OUTPUT as _SCHEMA_CREATE_MALWARE_PROTECTION_PLAN_OUTPUT, CREATE_MEMBERS as _SCHEMA_CREATE_MEMBERS, - CREATE_MEMBERS_INPUT as _SCHEMA_CREATE_MEMBERS_INPUT, - CREATE_MEMBERS_OUTPUT as _SCHEMA_CREATE_MEMBERS_OUTPUT, - CREATE_PROTECTED_RESOURCE as _SCHEMA_CREATE_PROTECTED_RESOURCE, CREATE_PUBLISHING_DESTINATION as _SCHEMA_CREATE_PUBLISHING_DESTINATION, - CREATE_PUBLISHING_DESTINATION_INPUT as _SCHEMA_CREATE_PUBLISHING_DESTINATION_INPUT, - CREATE_PUBLISHING_DESTINATION_OUTPUT as _SCHEMA_CREATE_PUBLISHING_DESTINATION_OUTPUT, - CREATE_S3_BUCKET_RESOURCE as _SCHEMA_CREATE_S3_BUCKET_RESOURCE, CREATE_SAMPLE_FINDINGS as _SCHEMA_CREATE_SAMPLE_FINDINGS, - CREATE_SAMPLE_FINDINGS_INPUT as _SCHEMA_CREATE_SAMPLE_FINDINGS_INPUT, - CREATE_SAMPLE_FINDINGS_OUTPUT as _SCHEMA_CREATE_SAMPLE_FINDINGS_OUTPUT, CREATE_THREAT_ENTITY_SET as _SCHEMA_CREATE_THREAT_ENTITY_SET, - CREATE_THREAT_ENTITY_SET_INPUT as _SCHEMA_CREATE_THREAT_ENTITY_SET_INPUT, - CREATE_THREAT_ENTITY_SET_OUTPUT as _SCHEMA_CREATE_THREAT_ENTITY_SET_OUTPUT, CREATE_THREAT_INTEL_SET as _SCHEMA_CREATE_THREAT_INTEL_SET, - CREATE_THREAT_INTEL_SET_INPUT as _SCHEMA_CREATE_THREAT_INTEL_SET_INPUT, - CREATE_THREAT_INTEL_SET_OUTPUT as _SCHEMA_CREATE_THREAT_INTEL_SET_OUTPUT, CREATE_TRUSTED_ENTITY_SET as _SCHEMA_CREATE_TRUSTED_ENTITY_SET, - CREATE_TRUSTED_ENTITY_SET_INPUT as _SCHEMA_CREATE_TRUSTED_ENTITY_SET_INPUT, - CREATE_TRUSTED_ENTITY_SET_OUTPUT as _SCHEMA_CREATE_TRUSTED_ENTITY_SET_OUTPUT, - DATA_SOURCES_FREE_TRIAL as _SCHEMA_DATA_SOURCES_FREE_TRIAL, - DATA_SOURCE_CONFIGURATIONS as _SCHEMA_DATA_SOURCE_CONFIGURATIONS, - DATA_SOURCE_CONFIGURATIONS_RESULT as _SCHEMA_DATA_SOURCE_CONFIGURATIONS_RESULT, - DATA_SOURCE_FREE_TRIAL as _SCHEMA_DATA_SOURCE_FREE_TRIAL, - DATE_STATISTICS as _SCHEMA_DATE_STATISTICS, DECLINE_INVITATIONS as _SCHEMA_DECLINE_INVITATIONS, - DECLINE_INVITATIONS_INPUT as _SCHEMA_DECLINE_INVITATIONS_INPUT, - DECLINE_INVITATIONS_OUTPUT as _SCHEMA_DECLINE_INVITATIONS_OUTPUT, - DEFAULT_SERVER_SIDE_ENCRYPTION as _SCHEMA_DEFAULT_SERVER_SIDE_ENCRYPTION, DELETE_CUSTOM_DETECTION_RULE_ASSOCIATION as _SCHEMA_DELETE_CUSTOM_DETECTION_RULE_ASSOCIATION, - DELETE_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT as _SCHEMA_DELETE_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT, - DELETE_CUSTOM_DETECTION_RULE_ASSOCIATION_OUTPUT as _SCHEMA_DELETE_CUSTOM_DETECTION_RULE_ASSOCIATION_OUTPUT, DELETE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION as _SCHEMA_DELETE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION, - DELETE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT as _SCHEMA_DELETE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT, - DELETE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_OUTPUT as _SCHEMA_DELETE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_OUTPUT, DELETE_DETECTOR as _SCHEMA_DELETE_DETECTOR, - DELETE_DETECTOR_INPUT as _SCHEMA_DELETE_DETECTOR_INPUT, - DELETE_DETECTOR_OUTPUT as _SCHEMA_DELETE_DETECTOR_OUTPUT, DELETE_FILTER as _SCHEMA_DELETE_FILTER, - DELETE_FILTER_INPUT as _SCHEMA_DELETE_FILTER_INPUT, - DELETE_FILTER_OUTPUT as _SCHEMA_DELETE_FILTER_OUTPUT, DELETE_INVITATIONS as _SCHEMA_DELETE_INVITATIONS, - DELETE_INVITATIONS_INPUT as _SCHEMA_DELETE_INVITATIONS_INPUT, - DELETE_INVITATIONS_OUTPUT as _SCHEMA_DELETE_INVITATIONS_OUTPUT, DELETE_IP_SET as _SCHEMA_DELETE_IP_SET, - DELETE_IP_SET_INPUT as _SCHEMA_DELETE_IP_SET_INPUT, - DELETE_IP_SET_OUTPUT as _SCHEMA_DELETE_IP_SET_OUTPUT, DELETE_MALWARE_PROTECTION_PLAN as _SCHEMA_DELETE_MALWARE_PROTECTION_PLAN, - DELETE_MALWARE_PROTECTION_PLAN_INPUT as _SCHEMA_DELETE_MALWARE_PROTECTION_PLAN_INPUT, - DELETE_MALWARE_PROTECTION_PLAN_OUTPUT as _SCHEMA_DELETE_MALWARE_PROTECTION_PLAN_OUTPUT, DELETE_MEMBERS as _SCHEMA_DELETE_MEMBERS, - DELETE_MEMBERS_INPUT as _SCHEMA_DELETE_MEMBERS_INPUT, - DELETE_MEMBERS_OUTPUT as _SCHEMA_DELETE_MEMBERS_OUTPUT, DELETE_PUBLISHING_DESTINATION as _SCHEMA_DELETE_PUBLISHING_DESTINATION, - DELETE_PUBLISHING_DESTINATION_INPUT as _SCHEMA_DELETE_PUBLISHING_DESTINATION_INPUT, - DELETE_PUBLISHING_DESTINATION_OUTPUT as _SCHEMA_DELETE_PUBLISHING_DESTINATION_OUTPUT, DELETE_THREAT_ENTITY_SET as _SCHEMA_DELETE_THREAT_ENTITY_SET, - DELETE_THREAT_ENTITY_SET_INPUT as _SCHEMA_DELETE_THREAT_ENTITY_SET_INPUT, - DELETE_THREAT_ENTITY_SET_OUTPUT as _SCHEMA_DELETE_THREAT_ENTITY_SET_OUTPUT, DELETE_THREAT_INTEL_SET as _SCHEMA_DELETE_THREAT_INTEL_SET, - DELETE_THREAT_INTEL_SET_INPUT as _SCHEMA_DELETE_THREAT_INTEL_SET_INPUT, - DELETE_THREAT_INTEL_SET_OUTPUT as _SCHEMA_DELETE_THREAT_INTEL_SET_OUTPUT, DELETE_TRUSTED_ENTITY_SET as _SCHEMA_DELETE_TRUSTED_ENTITY_SET, - DELETE_TRUSTED_ENTITY_SET_INPUT as _SCHEMA_DELETE_TRUSTED_ENTITY_SET_INPUT, - DELETE_TRUSTED_ENTITY_SET_OUTPUT as _SCHEMA_DELETE_TRUSTED_ENTITY_SET_OUTPUT, DESCRIBE_MALWARE_SCANS as _SCHEMA_DESCRIBE_MALWARE_SCANS, - DESCRIBE_MALWARE_SCANS_INPUT as _SCHEMA_DESCRIBE_MALWARE_SCANS_INPUT, - DESCRIBE_MALWARE_SCANS_OUTPUT as _SCHEMA_DESCRIBE_MALWARE_SCANS_OUTPUT, DESCRIBE_ORGANIZATION_CONFIGURATION as _SCHEMA_DESCRIBE_ORGANIZATION_CONFIGURATION, - DESCRIBE_ORGANIZATION_CONFIGURATION_INPUT as _SCHEMA_DESCRIBE_ORGANIZATION_CONFIGURATION_INPUT, - DESCRIBE_ORGANIZATION_CONFIGURATION_OUTPUT as _SCHEMA_DESCRIBE_ORGANIZATION_CONFIGURATION_OUTPUT, DESCRIBE_PUBLISHING_DESTINATION as _SCHEMA_DESCRIBE_PUBLISHING_DESTINATION, - DESCRIBE_PUBLISHING_DESTINATION_INPUT as _SCHEMA_DESCRIBE_PUBLISHING_DESTINATION_INPUT, - DESCRIBE_PUBLISHING_DESTINATION_OUTPUT as _SCHEMA_DESCRIBE_PUBLISHING_DESTINATION_OUTPUT, - DESTINATION as _SCHEMA_DESTINATION, - DESTINATION_PROPERTIES as _SCHEMA_DESTINATION_PROPERTIES, - DETECTION as _SCHEMA_DETECTION, - DETECTION_RULE_FILTER as _SCHEMA_DETECTION_RULE_FILTER, - DETECTION_RULE_ORG_CONFIGURATION as _SCHEMA_DETECTION_RULE_ORG_CONFIGURATION, - DETECTION_RULE_ORG_CONFIGURATION_SUMMARY as _SCHEMA_DETECTION_RULE_ORG_CONFIGURATION_SUMMARY, - DETECTOR_ADDITIONAL_CONFIGURATION as _SCHEMA_DETECTOR_ADDITIONAL_CONFIGURATION, - DETECTOR_ADDITIONAL_CONFIGURATION_RESULT as _SCHEMA_DETECTOR_ADDITIONAL_CONFIGURATION_RESULT, - DETECTOR_FEATURE_CONFIGURATION as _SCHEMA_DETECTOR_FEATURE_CONFIGURATION, - DETECTOR_FEATURE_CONFIGURATION_RESULT as _SCHEMA_DETECTOR_FEATURE_CONFIGURATION_RESULT, DISABLE_ORGANIZATION_ADMIN_ACCOUNT as _SCHEMA_DISABLE_ORGANIZATION_ADMIN_ACCOUNT, - DISABLE_ORGANIZATION_ADMIN_ACCOUNT_INPUT as _SCHEMA_DISABLE_ORGANIZATION_ADMIN_ACCOUNT_INPUT, - DISABLE_ORGANIZATION_ADMIN_ACCOUNT_OUTPUT as _SCHEMA_DISABLE_ORGANIZATION_ADMIN_ACCOUNT_OUTPUT, DISASSOCIATE_FROM_ADMINISTRATOR_ACCOUNT as _SCHEMA_DISASSOCIATE_FROM_ADMINISTRATOR_ACCOUNT, - DISASSOCIATE_FROM_ADMINISTRATOR_ACCOUNT_INPUT as _SCHEMA_DISASSOCIATE_FROM_ADMINISTRATOR_ACCOUNT_INPUT, - DISASSOCIATE_FROM_ADMINISTRATOR_ACCOUNT_OUTPUT as _SCHEMA_DISASSOCIATE_FROM_ADMINISTRATOR_ACCOUNT_OUTPUT, DISASSOCIATE_FROM_MASTER_ACCOUNT as _SCHEMA_DISASSOCIATE_FROM_MASTER_ACCOUNT, - DISASSOCIATE_FROM_MASTER_ACCOUNT_INPUT as _SCHEMA_DISASSOCIATE_FROM_MASTER_ACCOUNT_INPUT, - DISASSOCIATE_FROM_MASTER_ACCOUNT_OUTPUT as _SCHEMA_DISASSOCIATE_FROM_MASTER_ACCOUNT_OUTPUT, DISASSOCIATE_MEMBERS as _SCHEMA_DISASSOCIATE_MEMBERS, - DISASSOCIATE_MEMBERS_INPUT as _SCHEMA_DISASSOCIATE_MEMBERS_INPUT, - DISASSOCIATE_MEMBERS_OUTPUT as _SCHEMA_DISASSOCIATE_MEMBERS_OUTPUT, - DNS_LOGS_CONFIGURATION_RESULT as _SCHEMA_DNS_LOGS_CONFIGURATION_RESULT, - DNS_REQUEST_ACTION as _SCHEMA_DNS_REQUEST_ACTION, - DOMAIN_DETAILS as _SCHEMA_DOMAIN_DETAILS, - EBS_SNAPSHOT as _SCHEMA_EBS_SNAPSHOT, - EBS_SNAPSHOT_DETAILS as _SCHEMA_EBS_SNAPSHOT_DETAILS, - EBS_VOLUMES_RESULT as _SCHEMA_EBS_VOLUMES_RESULT, - EBS_VOLUME_DETAILS as _SCHEMA_EBS_VOLUME_DETAILS, - EBS_VOLUME_SCAN_DETAILS as _SCHEMA_EBS_VOLUME_SCAN_DETAILS, - EC2_IMAGE as _SCHEMA_EC2_IMAGE, - EC2_IMAGE_DETAILS as _SCHEMA_EC2_IMAGE_DETAILS, - EC2_INSTANCE as _SCHEMA_EC2_INSTANCE, - EC2_LAUNCH_TEMPLATE as _SCHEMA_EC2_LAUNCH_TEMPLATE, - EC2_NETWORK_INTERFACE as _SCHEMA_EC2_NETWORK_INTERFACE, - EC2_VPC as _SCHEMA_EC2_VPC, - ECS_CLUSTER as _SCHEMA_ECS_CLUSTER, - ECS_CLUSTER_DETAILS as _SCHEMA_ECS_CLUSTER_DETAILS, - ECS_TASK as _SCHEMA_ECS_TASK, - ECS_TASK_DETAILS as _SCHEMA_ECS_TASK_DETAILS, - EKS_CLUSTER as _SCHEMA_EKS_CLUSTER, - EKS_CLUSTER_DETAILS as _SCHEMA_EKS_CLUSTER_DETAILS, ENABLE_ORGANIZATION_ADMIN_ACCOUNT as _SCHEMA_ENABLE_ORGANIZATION_ADMIN_ACCOUNT, - ENABLE_ORGANIZATION_ADMIN_ACCOUNT_INPUT as _SCHEMA_ENABLE_ORGANIZATION_ADMIN_ACCOUNT_INPUT, - ENABLE_ORGANIZATION_ADMIN_ACCOUNT_OUTPUT as _SCHEMA_ENABLE_ORGANIZATION_ADMIN_ACCOUNT_OUTPUT, - EVIDENCE as _SCHEMA_EVIDENCE, - FARGATE_DETAILS as _SCHEMA_FARGATE_DETAILS, - FILTER_CONDITION as _SCHEMA_FILTER_CONDITION, - FILTER_CRITERIA as _SCHEMA_FILTER_CRITERIA, - FILTER_CRITERION as _SCHEMA_FILTER_CRITERION, - FINDING as _SCHEMA_FINDING, - FINDING_CRITERIA as _SCHEMA_FINDING_CRITERIA, - FINDING_STATISTICS as _SCHEMA_FINDING_STATISTICS, - FINDING_TYPE_STATISTICS as _SCHEMA_FINDING_TYPE_STATISTICS, - FLOW_LOGS_CONFIGURATION_RESULT as _SCHEMA_FLOW_LOGS_CONFIGURATION_RESULT, - FREE_TRIAL_FEATURE_CONFIGURATION_RESULT as _SCHEMA_FREE_TRIAL_FEATURE_CONFIGURATION_RESULT, - GEO_LOCATION as _SCHEMA_GEO_LOCATION, GET_ADMINISTRATOR_ACCOUNT as _SCHEMA_GET_ADMINISTRATOR_ACCOUNT, - GET_ADMINISTRATOR_ACCOUNT_INPUT as _SCHEMA_GET_ADMINISTRATOR_ACCOUNT_INPUT, - GET_ADMINISTRATOR_ACCOUNT_OUTPUT as _SCHEMA_GET_ADMINISTRATOR_ACCOUNT_OUTPUT, GET_COVERAGE_STATISTICS as _SCHEMA_GET_COVERAGE_STATISTICS, - GET_COVERAGE_STATISTICS_INPUT as _SCHEMA_GET_COVERAGE_STATISTICS_INPUT, - GET_COVERAGE_STATISTICS_OUTPUT as _SCHEMA_GET_COVERAGE_STATISTICS_OUTPUT, GET_CUSTOM_DETECTION_RULE as _SCHEMA_GET_CUSTOM_DETECTION_RULE, GET_CUSTOM_DETECTION_RULE_ASSOCIATION as _SCHEMA_GET_CUSTOM_DETECTION_RULE_ASSOCIATION, - GET_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT as _SCHEMA_GET_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT, - GET_CUSTOM_DETECTION_RULE_ASSOCIATION_OUTPUT as _SCHEMA_GET_CUSTOM_DETECTION_RULE_ASSOCIATION_OUTPUT, - GET_CUSTOM_DETECTION_RULE_INPUT as _SCHEMA_GET_CUSTOM_DETECTION_RULE_INPUT, GET_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION as _SCHEMA_GET_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION, - GET_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT as _SCHEMA_GET_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT, - GET_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_OUTPUT as _SCHEMA_GET_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_OUTPUT, - GET_CUSTOM_DETECTION_RULE_OUTPUT as _SCHEMA_GET_CUSTOM_DETECTION_RULE_OUTPUT, GET_DETECTOR as _SCHEMA_GET_DETECTOR, - GET_DETECTOR_INPUT as _SCHEMA_GET_DETECTOR_INPUT, - GET_DETECTOR_OUTPUT as _SCHEMA_GET_DETECTOR_OUTPUT, GET_FILTER as _SCHEMA_GET_FILTER, - GET_FILTER_INPUT as _SCHEMA_GET_FILTER_INPUT, - GET_FILTER_OUTPUT as _SCHEMA_GET_FILTER_OUTPUT, GET_FINDINGS as _SCHEMA_GET_FINDINGS, - GET_FINDINGS_INPUT as _SCHEMA_GET_FINDINGS_INPUT, - GET_FINDINGS_OUTPUT as _SCHEMA_GET_FINDINGS_OUTPUT, GET_FINDINGS_STATISTICS as _SCHEMA_GET_FINDINGS_STATISTICS, - GET_FINDINGS_STATISTICS_INPUT as _SCHEMA_GET_FINDINGS_STATISTICS_INPUT, - GET_FINDINGS_STATISTICS_OUTPUT as _SCHEMA_GET_FINDINGS_STATISTICS_OUTPUT, GET_INVESTIGATION as _SCHEMA_GET_INVESTIGATION, - GET_INVESTIGATION_INPUT as _SCHEMA_GET_INVESTIGATION_INPUT, - GET_INVESTIGATION_OUTPUT as _SCHEMA_GET_INVESTIGATION_OUTPUT, GET_INVITATIONS_COUNT as _SCHEMA_GET_INVITATIONS_COUNT, - GET_INVITATIONS_COUNT_INPUT as _SCHEMA_GET_INVITATIONS_COUNT_INPUT, - GET_INVITATIONS_COUNT_OUTPUT as _SCHEMA_GET_INVITATIONS_COUNT_OUTPUT, GET_IP_SET as _SCHEMA_GET_IP_SET, - GET_IP_SET_INPUT as _SCHEMA_GET_IP_SET_INPUT, - GET_IP_SET_OUTPUT as _SCHEMA_GET_IP_SET_OUTPUT, GET_MALWARE_PROTECTION_PLAN as _SCHEMA_GET_MALWARE_PROTECTION_PLAN, - GET_MALWARE_PROTECTION_PLAN_INPUT as _SCHEMA_GET_MALWARE_PROTECTION_PLAN_INPUT, - GET_MALWARE_PROTECTION_PLAN_OUTPUT as _SCHEMA_GET_MALWARE_PROTECTION_PLAN_OUTPUT, GET_MALWARE_SCAN as _SCHEMA_GET_MALWARE_SCAN, - GET_MALWARE_SCAN_INPUT as _SCHEMA_GET_MALWARE_SCAN_INPUT, - GET_MALWARE_SCAN_OUTPUT as _SCHEMA_GET_MALWARE_SCAN_OUTPUT, - GET_MALWARE_SCAN_RESULT_DETAILS as _SCHEMA_GET_MALWARE_SCAN_RESULT_DETAILS, GET_MALWARE_SCAN_SETTINGS as _SCHEMA_GET_MALWARE_SCAN_SETTINGS, - GET_MALWARE_SCAN_SETTINGS_INPUT as _SCHEMA_GET_MALWARE_SCAN_SETTINGS_INPUT, - GET_MALWARE_SCAN_SETTINGS_OUTPUT as _SCHEMA_GET_MALWARE_SCAN_SETTINGS_OUTPUT, GET_MASTER_ACCOUNT as _SCHEMA_GET_MASTER_ACCOUNT, - GET_MASTER_ACCOUNT_INPUT as _SCHEMA_GET_MASTER_ACCOUNT_INPUT, - GET_MASTER_ACCOUNT_OUTPUT as _SCHEMA_GET_MASTER_ACCOUNT_OUTPUT, GET_MEMBERS as _SCHEMA_GET_MEMBERS, - GET_MEMBERS_INPUT as _SCHEMA_GET_MEMBERS_INPUT, - GET_MEMBERS_OUTPUT as _SCHEMA_GET_MEMBERS_OUTPUT, GET_MEMBER_DETECTORS as _SCHEMA_GET_MEMBER_DETECTORS, - GET_MEMBER_DETECTORS_INPUT as _SCHEMA_GET_MEMBER_DETECTORS_INPUT, - GET_MEMBER_DETECTORS_OUTPUT as _SCHEMA_GET_MEMBER_DETECTORS_OUTPUT, GET_ORGANIZATION_STATISTICS as _SCHEMA_GET_ORGANIZATION_STATISTICS, - GET_ORGANIZATION_STATISTICS_INPUT as _SCHEMA_GET_ORGANIZATION_STATISTICS_INPUT, - GET_ORGANIZATION_STATISTICS_OUTPUT as _SCHEMA_GET_ORGANIZATION_STATISTICS_OUTPUT, GET_REMAINING_FREE_TRIAL_DAYS as _SCHEMA_GET_REMAINING_FREE_TRIAL_DAYS, - GET_REMAINING_FREE_TRIAL_DAYS_INPUT as _SCHEMA_GET_REMAINING_FREE_TRIAL_DAYS_INPUT, - GET_REMAINING_FREE_TRIAL_DAYS_OUTPUT as _SCHEMA_GET_REMAINING_FREE_TRIAL_DAYS_OUTPUT, GET_THREAT_ENTITY_SET as _SCHEMA_GET_THREAT_ENTITY_SET, - GET_THREAT_ENTITY_SET_INPUT as _SCHEMA_GET_THREAT_ENTITY_SET_INPUT, - GET_THREAT_ENTITY_SET_OUTPUT as _SCHEMA_GET_THREAT_ENTITY_SET_OUTPUT, GET_THREAT_INTEL_SET as _SCHEMA_GET_THREAT_INTEL_SET, - GET_THREAT_INTEL_SET_INPUT as _SCHEMA_GET_THREAT_INTEL_SET_INPUT, - GET_THREAT_INTEL_SET_OUTPUT as _SCHEMA_GET_THREAT_INTEL_SET_OUTPUT, GET_TRUSTED_ENTITY_SET as _SCHEMA_GET_TRUSTED_ENTITY_SET, - GET_TRUSTED_ENTITY_SET_INPUT as _SCHEMA_GET_TRUSTED_ENTITY_SET_INPUT, - GET_TRUSTED_ENTITY_SET_OUTPUT as _SCHEMA_GET_TRUSTED_ENTITY_SET_OUTPUT, GET_USAGE_STATISTICS as _SCHEMA_GET_USAGE_STATISTICS, - GET_USAGE_STATISTICS_INPUT as _SCHEMA_GET_USAGE_STATISTICS_INPUT, - GET_USAGE_STATISTICS_OUTPUT as _SCHEMA_GET_USAGE_STATISTICS_OUTPUT, - HIGHEST_SEVERITY_THREAT_DETAILS as _SCHEMA_HIGHEST_SEVERITY_THREAT_DETAILS, - HOST_PATH as _SCHEMA_HOST_PATH, - IAM_INSTANCE_PROFILE as _SCHEMA_IAM_INSTANCE_PROFILE, - IAM_INSTANCE_PROFILE_V2 as _SCHEMA_IAM_INSTANCE_PROFILE_V2, - IMPERSONATED_USER as _SCHEMA_IMPERSONATED_USER, - INCREMENTAL_SCAN_DETAILS as _SCHEMA_INCREMENTAL_SCAN_DETAILS, - INDICATOR as _SCHEMA_INDICATOR, - INSTANCE_DETAILS as _SCHEMA_INSTANCE_DETAILS, - INTERNAL_SERVER_ERROR_EXCEPTION as _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - INVESTIGATION as _SCHEMA_INVESTIGATION, - INVESTIGATION_METADATA as _SCHEMA_INVESTIGATION_METADATA, - INVESTIGATION_SORT_CRITERIA as _SCHEMA_INVESTIGATION_SORT_CRITERIA, - INVESTIGATION_SUMMARY as _SCHEMA_INVESTIGATION_SUMMARY, - INVITATION as _SCHEMA_INVITATION, INVITE_MEMBERS as _SCHEMA_INVITE_MEMBERS, - INVITE_MEMBERS_INPUT as _SCHEMA_INVITE_MEMBERS_INPUT, - INVITE_MEMBERS_OUTPUT as _SCHEMA_INVITE_MEMBERS_OUTPUT, - ITEM_DETAILS as _SCHEMA_ITEM_DETAILS, - ITEM_PATH as _SCHEMA_ITEM_PATH, - KUBERNETES_API_CALL_ACTION as _SCHEMA_KUBERNETES_API_CALL_ACTION, - KUBERNETES_AUDIT_LOGS_CONFIGURATION as _SCHEMA_KUBERNETES_AUDIT_LOGS_CONFIGURATION, - KUBERNETES_AUDIT_LOGS_CONFIGURATION_RESULT as _SCHEMA_KUBERNETES_AUDIT_LOGS_CONFIGURATION_RESULT, - KUBERNETES_CONFIGURATION as _SCHEMA_KUBERNETES_CONFIGURATION, - KUBERNETES_CONFIGURATION_RESULT as _SCHEMA_KUBERNETES_CONFIGURATION_RESULT, - KUBERNETES_DATA_SOURCE_FREE_TRIAL as _SCHEMA_KUBERNETES_DATA_SOURCE_FREE_TRIAL, - KUBERNETES_DETAILS as _SCHEMA_KUBERNETES_DETAILS, - KUBERNETES_PERMISSION_CHECKED_DETAILS as _SCHEMA_KUBERNETES_PERMISSION_CHECKED_DETAILS, - KUBERNETES_ROLE_BINDING_DETAILS as _SCHEMA_KUBERNETES_ROLE_BINDING_DETAILS, - KUBERNETES_ROLE_DETAILS as _SCHEMA_KUBERNETES_ROLE_DETAILS, - KUBERNETES_USER_DETAILS as _SCHEMA_KUBERNETES_USER_DETAILS, - KUBERNETES_WORKLOAD as _SCHEMA_KUBERNETES_WORKLOAD, - KUBERNETES_WORKLOAD_DETAILS as _SCHEMA_KUBERNETES_WORKLOAD_DETAILS, - LAMBDA_DETAILS as _SCHEMA_LAMBDA_DETAILS, - LINEAGE_OBJECT as _SCHEMA_LINEAGE_OBJECT, LIST_COVERAGE as _SCHEMA_LIST_COVERAGE, - LIST_COVERAGE_INPUT as _SCHEMA_LIST_COVERAGE_INPUT, - LIST_COVERAGE_OUTPUT as _SCHEMA_LIST_COVERAGE_OUTPUT, LIST_CUSTOM_DETECTION_RULES as _SCHEMA_LIST_CUSTOM_DETECTION_RULES, - LIST_CUSTOM_DETECTION_RULES_INPUT as _SCHEMA_LIST_CUSTOM_DETECTION_RULES_INPUT, - LIST_CUSTOM_DETECTION_RULES_OUTPUT as _SCHEMA_LIST_CUSTOM_DETECTION_RULES_OUTPUT, LIST_CUSTOM_DETECTION_RULE_ASSOCIATIONS as _SCHEMA_LIST_CUSTOM_DETECTION_RULE_ASSOCIATIONS, - LIST_CUSTOM_DETECTION_RULE_ASSOCIATIONS_INPUT as _SCHEMA_LIST_CUSTOM_DETECTION_RULE_ASSOCIATIONS_INPUT, - LIST_CUSTOM_DETECTION_RULE_ASSOCIATIONS_OUTPUT as _SCHEMA_LIST_CUSTOM_DETECTION_RULE_ASSOCIATIONS_OUTPUT, LIST_CUSTOM_DETECTION_RULE_ORG_CONFIGURATIONS as _SCHEMA_LIST_CUSTOM_DETECTION_RULE_ORG_CONFIGURATIONS, - LIST_CUSTOM_DETECTION_RULE_ORG_CONFIGURATIONS_INPUT as _SCHEMA_LIST_CUSTOM_DETECTION_RULE_ORG_CONFIGURATIONS_INPUT, - LIST_CUSTOM_DETECTION_RULE_ORG_CONFIGURATIONS_OUTPUT as _SCHEMA_LIST_CUSTOM_DETECTION_RULE_ORG_CONFIGURATIONS_OUTPUT, LIST_DETECTORS as _SCHEMA_LIST_DETECTORS, - LIST_DETECTORS_INPUT as _SCHEMA_LIST_DETECTORS_INPUT, - LIST_DETECTORS_OUTPUT as _SCHEMA_LIST_DETECTORS_OUTPUT, LIST_FILTERS as _SCHEMA_LIST_FILTERS, - LIST_FILTERS_INPUT as _SCHEMA_LIST_FILTERS_INPUT, - LIST_FILTERS_OUTPUT as _SCHEMA_LIST_FILTERS_OUTPUT, LIST_FINDINGS as _SCHEMA_LIST_FINDINGS, - LIST_FINDINGS_INPUT as _SCHEMA_LIST_FINDINGS_INPUT, - LIST_FINDINGS_OUTPUT as _SCHEMA_LIST_FINDINGS_OUTPUT, LIST_INVESTIGATIONS as _SCHEMA_LIST_INVESTIGATIONS, - LIST_INVESTIGATIONS_INPUT as _SCHEMA_LIST_INVESTIGATIONS_INPUT, - LIST_INVESTIGATIONS_OUTPUT as _SCHEMA_LIST_INVESTIGATIONS_OUTPUT, LIST_INVITATIONS as _SCHEMA_LIST_INVITATIONS, - LIST_INVITATIONS_INPUT as _SCHEMA_LIST_INVITATIONS_INPUT, - LIST_INVITATIONS_OUTPUT as _SCHEMA_LIST_INVITATIONS_OUTPUT, LIST_IP_SETS as _SCHEMA_LIST_IP_SETS, - LIST_IP_SETS_INPUT as _SCHEMA_LIST_IP_SETS_INPUT, - LIST_IP_SETS_OUTPUT as _SCHEMA_LIST_IP_SETS_OUTPUT, LIST_MALWARE_PROTECTION_PLANS as _SCHEMA_LIST_MALWARE_PROTECTION_PLANS, - LIST_MALWARE_PROTECTION_PLANS_INPUT as _SCHEMA_LIST_MALWARE_PROTECTION_PLANS_INPUT, - LIST_MALWARE_PROTECTION_PLANS_OUTPUT as _SCHEMA_LIST_MALWARE_PROTECTION_PLANS_OUTPUT, LIST_MALWARE_SCANS as _SCHEMA_LIST_MALWARE_SCANS, - LIST_MALWARE_SCANS_FILTER_CRITERIA as _SCHEMA_LIST_MALWARE_SCANS_FILTER_CRITERIA, - LIST_MALWARE_SCANS_FILTER_CRITERION as _SCHEMA_LIST_MALWARE_SCANS_FILTER_CRITERION, - LIST_MALWARE_SCANS_INPUT as _SCHEMA_LIST_MALWARE_SCANS_INPUT, - LIST_MALWARE_SCANS_OUTPUT as _SCHEMA_LIST_MALWARE_SCANS_OUTPUT, LIST_MEMBERS as _SCHEMA_LIST_MEMBERS, - LIST_MEMBERS_INPUT as _SCHEMA_LIST_MEMBERS_INPUT, - LIST_MEMBERS_OUTPUT as _SCHEMA_LIST_MEMBERS_OUTPUT, LIST_ORGANIZATION_ADMIN_ACCOUNTS as _SCHEMA_LIST_ORGANIZATION_ADMIN_ACCOUNTS, - LIST_ORGANIZATION_ADMIN_ACCOUNTS_INPUT as _SCHEMA_LIST_ORGANIZATION_ADMIN_ACCOUNTS_INPUT, - LIST_ORGANIZATION_ADMIN_ACCOUNTS_OUTPUT as _SCHEMA_LIST_ORGANIZATION_ADMIN_ACCOUNTS_OUTPUT, LIST_PUBLISHING_DESTINATIONS as _SCHEMA_LIST_PUBLISHING_DESTINATIONS, - LIST_PUBLISHING_DESTINATIONS_INPUT as _SCHEMA_LIST_PUBLISHING_DESTINATIONS_INPUT, - LIST_PUBLISHING_DESTINATIONS_OUTPUT as _SCHEMA_LIST_PUBLISHING_DESTINATIONS_OUTPUT, LIST_TAGS_FOR_RESOURCE as _SCHEMA_LIST_TAGS_FOR_RESOURCE, - LIST_TAGS_FOR_RESOURCE_INPUT as _SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT, - LIST_TAGS_FOR_RESOURCE_OUTPUT as _SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT, LIST_THREAT_ENTITY_SETS as _SCHEMA_LIST_THREAT_ENTITY_SETS, - LIST_THREAT_ENTITY_SETS_INPUT as _SCHEMA_LIST_THREAT_ENTITY_SETS_INPUT, - LIST_THREAT_ENTITY_SETS_OUTPUT as _SCHEMA_LIST_THREAT_ENTITY_SETS_OUTPUT, LIST_THREAT_INTEL_SETS as _SCHEMA_LIST_THREAT_INTEL_SETS, - LIST_THREAT_INTEL_SETS_INPUT as _SCHEMA_LIST_THREAT_INTEL_SETS_INPUT, - LIST_THREAT_INTEL_SETS_OUTPUT as _SCHEMA_LIST_THREAT_INTEL_SETS_OUTPUT, LIST_TRUSTED_ENTITY_SETS as _SCHEMA_LIST_TRUSTED_ENTITY_SETS, - LIST_TRUSTED_ENTITY_SETS_INPUT as _SCHEMA_LIST_TRUSTED_ENTITY_SETS_INPUT, - LIST_TRUSTED_ENTITY_SETS_OUTPUT as _SCHEMA_LIST_TRUSTED_ENTITY_SETS_OUTPUT, - LOCAL_IP_DETAILS as _SCHEMA_LOCAL_IP_DETAILS, - LOCAL_PORT_DETAILS as _SCHEMA_LOCAL_PORT_DETAILS, - LOGIN_ATTRIBUTE as _SCHEMA_LOGIN_ATTRIBUTE, - MALWARE_PROTECTION_CONFIGURATION as _SCHEMA_MALWARE_PROTECTION_CONFIGURATION, - MALWARE_PROTECTION_CONFIGURATION_RESULT as _SCHEMA_MALWARE_PROTECTION_CONFIGURATION_RESULT, - MALWARE_PROTECTION_DATA_SOURCE_FREE_TRIAL as _SCHEMA_MALWARE_PROTECTION_DATA_SOURCE_FREE_TRIAL, - MALWARE_PROTECTION_FINDINGS_SCAN_CONFIGURATION as _SCHEMA_MALWARE_PROTECTION_FINDINGS_SCAN_CONFIGURATION, - MALWARE_PROTECTION_PLAN_ACTIONS as _SCHEMA_MALWARE_PROTECTION_PLAN_ACTIONS, - MALWARE_PROTECTION_PLAN_STATUS_REASON as _SCHEMA_MALWARE_PROTECTION_PLAN_STATUS_REASON, - MALWARE_PROTECTION_PLAN_SUMMARY as _SCHEMA_MALWARE_PROTECTION_PLAN_SUMMARY, - MALWARE_PROTECTION_PLAN_TAGGING_ACTION as _SCHEMA_MALWARE_PROTECTION_PLAN_TAGGING_ACTION, - MALWARE_SCAN as _SCHEMA_MALWARE_SCAN, - MALWARE_SCAN_DETAILS as _SCHEMA_MALWARE_SCAN_DETAILS, - MASTER as _SCHEMA_MASTER, - MEMBER as _SCHEMA_MEMBER, - MEMBER_ADDITIONAL_CONFIGURATION as _SCHEMA_MEMBER_ADDITIONAL_CONFIGURATION, - MEMBER_ADDITIONAL_CONFIGURATION_RESULT as _SCHEMA_MEMBER_ADDITIONAL_CONFIGURATION_RESULT, - MEMBER_DATA_SOURCE_CONFIGURATION as _SCHEMA_MEMBER_DATA_SOURCE_CONFIGURATION, - MEMBER_FEATURES_CONFIGURATION as _SCHEMA_MEMBER_FEATURES_CONFIGURATION, - MEMBER_FEATURES_CONFIGURATION_RESULT as _SCHEMA_MEMBER_FEATURES_CONFIGURATION_RESULT, - MODEL_DETAIL as _SCHEMA_MODEL_DETAIL, - NETWORK_CONNECTION as _SCHEMA_NETWORK_CONNECTION, - NETWORK_CONNECTION_ACTION as _SCHEMA_NETWORK_CONNECTION_ACTION, - NETWORK_ENDPOINT as _SCHEMA_NETWORK_ENDPOINT, - NETWORK_GEO_LOCATION as _SCHEMA_NETWORK_GEO_LOCATION, - NETWORK_INTERFACE as _SCHEMA_NETWORK_INTERFACE, - OBSERVATIONS as _SCHEMA_OBSERVATIONS, - ORGANIZATION as _SCHEMA_ORGANIZATION, - ORGANIZATION_ADDITIONAL_CONFIGURATION as _SCHEMA_ORGANIZATION_ADDITIONAL_CONFIGURATION, - ORGANIZATION_ADDITIONAL_CONFIGURATION_RESULT as _SCHEMA_ORGANIZATION_ADDITIONAL_CONFIGURATION_RESULT, - ORGANIZATION_DATA_SOURCE_CONFIGURATIONS as _SCHEMA_ORGANIZATION_DATA_SOURCE_CONFIGURATIONS, - ORGANIZATION_DATA_SOURCE_CONFIGURATIONS_RESULT as _SCHEMA_ORGANIZATION_DATA_SOURCE_CONFIGURATIONS_RESULT, - ORGANIZATION_DETAILS as _SCHEMA_ORGANIZATION_DETAILS, - ORGANIZATION_EBS_VOLUMES as _SCHEMA_ORGANIZATION_EBS_VOLUMES, - ORGANIZATION_EBS_VOLUMES_RESULT as _SCHEMA_ORGANIZATION_EBS_VOLUMES_RESULT, - ORGANIZATION_FEATURE_CONFIGURATION as _SCHEMA_ORGANIZATION_FEATURE_CONFIGURATION, - ORGANIZATION_FEATURE_CONFIGURATION_RESULT as _SCHEMA_ORGANIZATION_FEATURE_CONFIGURATION_RESULT, - ORGANIZATION_FEATURE_STATISTICS as _SCHEMA_ORGANIZATION_FEATURE_STATISTICS, - ORGANIZATION_FEATURE_STATISTICS_ADDITIONAL_CONFIGURATION as _SCHEMA_ORGANIZATION_FEATURE_STATISTICS_ADDITIONAL_CONFIGURATION, - ORGANIZATION_KUBERNETES_AUDIT_LOGS_CONFIGURATION as _SCHEMA_ORGANIZATION_KUBERNETES_AUDIT_LOGS_CONFIGURATION, - ORGANIZATION_KUBERNETES_AUDIT_LOGS_CONFIGURATION_RESULT as _SCHEMA_ORGANIZATION_KUBERNETES_AUDIT_LOGS_CONFIGURATION_RESULT, - ORGANIZATION_KUBERNETES_CONFIGURATION as _SCHEMA_ORGANIZATION_KUBERNETES_CONFIGURATION, - ORGANIZATION_KUBERNETES_CONFIGURATION_RESULT as _SCHEMA_ORGANIZATION_KUBERNETES_CONFIGURATION_RESULT, - ORGANIZATION_MALWARE_PROTECTION_CONFIGURATION as _SCHEMA_ORGANIZATION_MALWARE_PROTECTION_CONFIGURATION, - ORGANIZATION_MALWARE_PROTECTION_CONFIGURATION_RESULT as _SCHEMA_ORGANIZATION_MALWARE_PROTECTION_CONFIGURATION_RESULT, - ORGANIZATION_S3_LOGS_CONFIGURATION as _SCHEMA_ORGANIZATION_S3_LOGS_CONFIGURATION, - ORGANIZATION_S3_LOGS_CONFIGURATION_RESULT as _SCHEMA_ORGANIZATION_S3_LOGS_CONFIGURATION_RESULT, - ORGANIZATION_SCAN_EC2_INSTANCE_WITH_FINDINGS as _SCHEMA_ORGANIZATION_SCAN_EC2_INSTANCE_WITH_FINDINGS, - ORGANIZATION_SCAN_EC2_INSTANCE_WITH_FINDINGS_RESULT as _SCHEMA_ORGANIZATION_SCAN_EC2_INSTANCE_WITH_FINDINGS_RESULT, - ORGANIZATION_STATISTICS as _SCHEMA_ORGANIZATION_STATISTICS, - OWNER as _SCHEMA_OWNER, - PERMISSION_CONFIGURATION as _SCHEMA_PERMISSION_CONFIGURATION, - PORT_PROBE_ACTION as _SCHEMA_PORT_PROBE_ACTION, - PORT_PROBE_DETAIL as _SCHEMA_PORT_PROBE_DETAIL, - PRIVATE_IP_ADDRESS_DETAILS as _SCHEMA_PRIVATE_IP_ADDRESS_DETAILS, - PROCESS_DETAILS as _SCHEMA_PROCESS_DETAILS, - PRODUCT as _SCHEMA_PRODUCT, - PRODUCT_CODE as _SCHEMA_PRODUCT_CODE, - PUBLIC_ACCESS as _SCHEMA_PUBLIC_ACCESS, - PUBLIC_ACCESS_CONFIGURATION as _SCHEMA_PUBLIC_ACCESS_CONFIGURATION, - RDS_DB_INSTANCE_DETAILS as _SCHEMA_RDS_DB_INSTANCE_DETAILS, - RDS_DB_USER_DETAILS as _SCHEMA_RDS_DB_USER_DETAILS, - RDS_LIMITLESS_DB_DETAILS as _SCHEMA_RDS_LIMITLESS_DB_DETAILS, - RDS_LOGIN_ATTEMPT_ACTION as _SCHEMA_RDS_LOGIN_ATTEMPT_ACTION, - RECOVERY_POINT as _SCHEMA_RECOVERY_POINT, - RECOVERY_POINT_DETAILS as _SCHEMA_RECOVERY_POINT_DETAILS, - REMOTE_ACCOUNT_DETAILS as _SCHEMA_REMOTE_ACCOUNT_DETAILS, - REMOTE_IP_DETAILS as _SCHEMA_REMOTE_IP_DETAILS, - REMOTE_PORT_DETAILS as _SCHEMA_REMOTE_PORT_DETAILS, - RESOURCE as _SCHEMA_RESOURCE, - RESOURCE_DATA as _SCHEMA_RESOURCE_DATA, - RESOURCE_DETAILS as _SCHEMA_RESOURCE_DETAILS, - RESOURCE_NOT_FOUND_EXCEPTION as _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - RESOURCE_STATISTICS as _SCHEMA_RESOURCE_STATISTICS, - RESOURCE_V2 as _SCHEMA_RESOURCE_V2, - RULE_DEFINITION as _SCHEMA_RULE_DEFINITION, - RULE_DETAIL as _SCHEMA_RULE_DETAIL, - RULE_SUMMARY as _SCHEMA_RULE_SUMMARY, - RUNTIME_CONTEXT as _SCHEMA_RUNTIME_CONTEXT, - RUNTIME_DETAILS as _SCHEMA_RUNTIME_DETAILS, - S3_BUCKET as _SCHEMA_S3_BUCKET, - S3_BUCKET_DETAIL as _SCHEMA_S3_BUCKET_DETAIL, - S3_LOGS_CONFIGURATION as _SCHEMA_S3_LOGS_CONFIGURATION, - S3_LOGS_CONFIGURATION_RESULT as _SCHEMA_S3_LOGS_CONFIGURATION_RESULT, - S3_OBJECT as _SCHEMA_S3_OBJECT, - S3_OBJECT_DETAIL as _SCHEMA_S3_OBJECT_DETAIL, - S3_OBJECT_FOR_SEND_OBJECT_MALWARE_SCAN as _SCHEMA_S3_OBJECT_FOR_SEND_OBJECT_MALWARE_SCAN, - SCAN as _SCHEMA_SCAN, - SCANNED_ITEM_COUNT as _SCHEMA_SCANNED_ITEM_COUNT, - SCANNED_RESOURCE as _SCHEMA_SCANNED_RESOURCE, - SCANNED_RESOURCE_DETAILS as _SCHEMA_SCANNED_RESOURCE_DETAILS, - SCAN_CONDITION as _SCHEMA_SCAN_CONDITION, - SCAN_CONDITION_PAIR as _SCHEMA_SCAN_CONDITION_PAIR, - SCAN_CONFIGURATION as _SCHEMA_SCAN_CONFIGURATION, - SCAN_CONFIGURATION_CONTINUOUS_SCAN_DETAILS as _SCHEMA_SCAN_CONFIGURATION_CONTINUOUS_SCAN_DETAILS, - SCAN_CONFIGURATION_RECOVERY_POINT as _SCHEMA_SCAN_CONFIGURATION_RECOVERY_POINT, - SCAN_DETECTIONS as _SCHEMA_SCAN_DETECTIONS, - SCAN_EC2_INSTANCE_WITH_FINDINGS as _SCHEMA_SCAN_EC2_INSTANCE_WITH_FINDINGS, - SCAN_EC2_INSTANCE_WITH_FINDINGS_RESULT as _SCHEMA_SCAN_EC2_INSTANCE_WITH_FINDINGS_RESULT, - SCAN_FILE_PATH as _SCHEMA_SCAN_FILE_PATH, - SCAN_RESOURCE_CRITERIA as _SCHEMA_SCAN_RESOURCE_CRITERIA, - SCAN_RESULT_DETAILS as _SCHEMA_SCAN_RESULT_DETAILS, - SCAN_RESULT_THREAT as _SCHEMA_SCAN_RESULT_THREAT, - SCAN_THREAT_NAME as _SCHEMA_SCAN_THREAT_NAME, - SECURITY_CONTEXT as _SCHEMA_SECURITY_CONTEXT, - SECURITY_GROUP as _SCHEMA_SECURITY_GROUP, SEND_OBJECT_MALWARE_SCAN as _SCHEMA_SEND_OBJECT_MALWARE_SCAN, - SEND_OBJECT_MALWARE_SCAN_INPUT as _SCHEMA_SEND_OBJECT_MALWARE_SCAN_INPUT, - SEND_OBJECT_MALWARE_SCAN_OUTPUT as _SCHEMA_SEND_OBJECT_MALWARE_SCAN_OUTPUT, - SEQUENCE as _SCHEMA_SEQUENCE, - SERVICE as _SCHEMA_SERVICE, - SERVICE_ADDITIONAL_INFO as _SCHEMA_SERVICE_ADDITIONAL_INFO, - SESSION as _SCHEMA_SESSION, - SEVERITY_STATISTICS as _SCHEMA_SEVERITY_STATISTICS, - SIGNAL as _SCHEMA_SIGNAL, - SORT_CRITERIA as _SCHEMA_SORT_CRITERIA, START_MALWARE_SCAN as _SCHEMA_START_MALWARE_SCAN, - START_MALWARE_SCAN_CONFIGURATION as _SCHEMA_START_MALWARE_SCAN_CONFIGURATION, - START_MALWARE_SCAN_INPUT as _SCHEMA_START_MALWARE_SCAN_INPUT, - START_MALWARE_SCAN_OUTPUT as _SCHEMA_START_MALWARE_SCAN_OUTPUT, START_MONITORING_MEMBERS as _SCHEMA_START_MONITORING_MEMBERS, - START_MONITORING_MEMBERS_INPUT as _SCHEMA_START_MONITORING_MEMBERS_INPUT, - START_MONITORING_MEMBERS_OUTPUT as _SCHEMA_START_MONITORING_MEMBERS_OUTPUT, STOP_MONITORING_MEMBERS as _SCHEMA_STOP_MONITORING_MEMBERS, - STOP_MONITORING_MEMBERS_INPUT as _SCHEMA_STOP_MONITORING_MEMBERS_INPUT, - STOP_MONITORING_MEMBERS_OUTPUT as _SCHEMA_STOP_MONITORING_MEMBERS_OUTPUT, - TAG as _SCHEMA_TAG, TAG_RESOURCE as _SCHEMA_TAG_RESOURCE, - TAG_RESOURCE_INPUT as _SCHEMA_TAG_RESOURCE_INPUT, - TAG_RESOURCE_OUTPUT as _SCHEMA_TAG_RESOURCE_OUTPUT, - THREAT as _SCHEMA_THREAT, - THREATS_DETECTED_ITEM_COUNT as _SCHEMA_THREATS_DETECTED_ITEM_COUNT, - THREAT_DETECTED_BY_NAME as _SCHEMA_THREAT_DETECTED_BY_NAME, - THREAT_INTELLIGENCE_DETAIL as _SCHEMA_THREAT_INTELLIGENCE_DETAIL, - TOTAL as _SCHEMA_TOTAL, - TRIGGER_DETAILS as _SCHEMA_TRIGGER_DETAILS, UNARCHIVE_FINDINGS as _SCHEMA_UNARCHIVE_FINDINGS, - UNARCHIVE_FINDINGS_INPUT as _SCHEMA_UNARCHIVE_FINDINGS_INPUT, - UNARCHIVE_FINDINGS_OUTPUT as _SCHEMA_UNARCHIVE_FINDINGS_OUTPUT, - UNPROCESSED_ACCOUNT as _SCHEMA_UNPROCESSED_ACCOUNT, - UNPROCESSED_DATA_SOURCES_RESULT as _SCHEMA_UNPROCESSED_DATA_SOURCES_RESULT, UNTAG_RESOURCE as _SCHEMA_UNTAG_RESOURCE, - UNTAG_RESOURCE_INPUT as _SCHEMA_UNTAG_RESOURCE_INPUT, - UNTAG_RESOURCE_OUTPUT as _SCHEMA_UNTAG_RESOURCE_OUTPUT, UPDATE_CUSTOM_DETECTION_RULE_ASSOCIATION as _SCHEMA_UPDATE_CUSTOM_DETECTION_RULE_ASSOCIATION, - UPDATE_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT as _SCHEMA_UPDATE_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT, - UPDATE_CUSTOM_DETECTION_RULE_ASSOCIATION_OUTPUT as _SCHEMA_UPDATE_CUSTOM_DETECTION_RULE_ASSOCIATION_OUTPUT, UPDATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION as _SCHEMA_UPDATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION, - UPDATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT as _SCHEMA_UPDATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT, - UPDATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_OUTPUT as _SCHEMA_UPDATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_OUTPUT, UPDATE_DETECTOR as _SCHEMA_UPDATE_DETECTOR, - UPDATE_DETECTOR_INPUT as _SCHEMA_UPDATE_DETECTOR_INPUT, - UPDATE_DETECTOR_OUTPUT as _SCHEMA_UPDATE_DETECTOR_OUTPUT, UPDATE_FILTER as _SCHEMA_UPDATE_FILTER, - UPDATE_FILTER_INPUT as _SCHEMA_UPDATE_FILTER_INPUT, - UPDATE_FILTER_OUTPUT as _SCHEMA_UPDATE_FILTER_OUTPUT, UPDATE_FINDINGS_FEEDBACK as _SCHEMA_UPDATE_FINDINGS_FEEDBACK, - UPDATE_FINDINGS_FEEDBACK_INPUT as _SCHEMA_UPDATE_FINDINGS_FEEDBACK_INPUT, - UPDATE_FINDINGS_FEEDBACK_OUTPUT as _SCHEMA_UPDATE_FINDINGS_FEEDBACK_OUTPUT, UPDATE_IP_SET as _SCHEMA_UPDATE_IP_SET, - UPDATE_IP_SET_INPUT as _SCHEMA_UPDATE_IP_SET_INPUT, - UPDATE_IP_SET_OUTPUT as _SCHEMA_UPDATE_IP_SET_OUTPUT, UPDATE_MALWARE_PROTECTION_PLAN as _SCHEMA_UPDATE_MALWARE_PROTECTION_PLAN, - UPDATE_MALWARE_PROTECTION_PLAN_INPUT as _SCHEMA_UPDATE_MALWARE_PROTECTION_PLAN_INPUT, - UPDATE_MALWARE_PROTECTION_PLAN_OUTPUT as _SCHEMA_UPDATE_MALWARE_PROTECTION_PLAN_OUTPUT, UPDATE_MALWARE_SCAN_SETTINGS as _SCHEMA_UPDATE_MALWARE_SCAN_SETTINGS, - UPDATE_MALWARE_SCAN_SETTINGS_INPUT as _SCHEMA_UPDATE_MALWARE_SCAN_SETTINGS_INPUT, - UPDATE_MALWARE_SCAN_SETTINGS_OUTPUT as _SCHEMA_UPDATE_MALWARE_SCAN_SETTINGS_OUTPUT, UPDATE_MEMBER_DETECTORS as _SCHEMA_UPDATE_MEMBER_DETECTORS, - UPDATE_MEMBER_DETECTORS_INPUT as _SCHEMA_UPDATE_MEMBER_DETECTORS_INPUT, - UPDATE_MEMBER_DETECTORS_OUTPUT as _SCHEMA_UPDATE_MEMBER_DETECTORS_OUTPUT, UPDATE_ORGANIZATION_CONFIGURATION as _SCHEMA_UPDATE_ORGANIZATION_CONFIGURATION, - UPDATE_ORGANIZATION_CONFIGURATION_INPUT as _SCHEMA_UPDATE_ORGANIZATION_CONFIGURATION_INPUT, - UPDATE_ORGANIZATION_CONFIGURATION_OUTPUT as _SCHEMA_UPDATE_ORGANIZATION_CONFIGURATION_OUTPUT, - UPDATE_PROTECTED_RESOURCE as _SCHEMA_UPDATE_PROTECTED_RESOURCE, UPDATE_PUBLISHING_DESTINATION as _SCHEMA_UPDATE_PUBLISHING_DESTINATION, - UPDATE_PUBLISHING_DESTINATION_INPUT as _SCHEMA_UPDATE_PUBLISHING_DESTINATION_INPUT, - UPDATE_PUBLISHING_DESTINATION_OUTPUT as _SCHEMA_UPDATE_PUBLISHING_DESTINATION_OUTPUT, - UPDATE_S3_BUCKET_RESOURCE as _SCHEMA_UPDATE_S3_BUCKET_RESOURCE, UPDATE_THREAT_ENTITY_SET as _SCHEMA_UPDATE_THREAT_ENTITY_SET, - UPDATE_THREAT_ENTITY_SET_INPUT as _SCHEMA_UPDATE_THREAT_ENTITY_SET_INPUT, - UPDATE_THREAT_ENTITY_SET_OUTPUT as _SCHEMA_UPDATE_THREAT_ENTITY_SET_OUTPUT, UPDATE_THREAT_INTEL_SET as _SCHEMA_UPDATE_THREAT_INTEL_SET, - UPDATE_THREAT_INTEL_SET_INPUT as _SCHEMA_UPDATE_THREAT_INTEL_SET_INPUT, - UPDATE_THREAT_INTEL_SET_OUTPUT as _SCHEMA_UPDATE_THREAT_INTEL_SET_OUTPUT, UPDATE_TRUSTED_ENTITY_SET as _SCHEMA_UPDATE_TRUSTED_ENTITY_SET, - UPDATE_TRUSTED_ENTITY_SET_INPUT as _SCHEMA_UPDATE_TRUSTED_ENTITY_SET_INPUT, - UPDATE_TRUSTED_ENTITY_SET_OUTPUT as _SCHEMA_UPDATE_TRUSTED_ENTITY_SET_OUTPUT, - USAGE_ACCOUNT_RESULT as _SCHEMA_USAGE_ACCOUNT_RESULT, - USAGE_CRITERIA as _SCHEMA_USAGE_CRITERIA, - USAGE_DATA_SOURCE_RESULT as _SCHEMA_USAGE_DATA_SOURCE_RESULT, - USAGE_FEATURE_RESULT as _SCHEMA_USAGE_FEATURE_RESULT, - USAGE_RESOURCE_RESULT as _SCHEMA_USAGE_RESOURCE_RESULT, - USAGE_STATISTICS as _SCHEMA_USAGE_STATISTICS, - USAGE_TOP_ACCOUNTS_RESULT as _SCHEMA_USAGE_TOP_ACCOUNTS_RESULT, - USAGE_TOP_ACCOUNT_RESULT as _SCHEMA_USAGE_TOP_ACCOUNT_RESULT, - USER as _SCHEMA_USER, - VOLUME as _SCHEMA_VOLUME, - VOLUME_DETAIL as _SCHEMA_VOLUME_DETAIL, - VOLUME_MOUNT as _SCHEMA_VOLUME_MOUNT, - VPC_CONFIG as _SCHEMA_VPC_CONFIG, ) - -logger = logging.getLogger(__name__) +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .models import ( + AcceptAdministratorInvitationInput, + AcceptAdministratorInvitationOutput, + AcceptInvitationInput, + AcceptInvitationOutput, + ArchiveFindingsInput, + ArchiveFindingsOutput, + CreateCustomDetectionRuleAssociationInput, + CreateCustomDetectionRuleAssociationOutput, + CreateCustomDetectionRuleOrgConfigurationInput, + CreateCustomDetectionRuleOrgConfigurationOutput, + CreateDetectorInput, + CreateDetectorOutput, + CreateFilterInput, + CreateFilterOutput, + CreateIPSetInput, + CreateIPSetOutput, + CreateInvestigationInput, + CreateInvestigationOutput, + CreateMalwareProtectionPlanInput, + CreateMalwareProtectionPlanOutput, + CreateMembersInput, + CreateMembersOutput, + CreatePublishingDestinationInput, + CreatePublishingDestinationOutput, + CreateSampleFindingsInput, + CreateSampleFindingsOutput, + CreateThreatEntitySetInput, + CreateThreatEntitySetOutput, + CreateThreatIntelSetInput, + CreateThreatIntelSetOutput, + CreateTrustedEntitySetInput, + CreateTrustedEntitySetOutput, + DeclineInvitationsInput, + DeclineInvitationsOutput, + DeleteCustomDetectionRuleAssociationInput, + DeleteCustomDetectionRuleAssociationOutput, + DeleteCustomDetectionRuleOrgConfigurationInput, + DeleteCustomDetectionRuleOrgConfigurationOutput, + DeleteDetectorInput, + DeleteDetectorOutput, + DeleteFilterInput, + DeleteFilterOutput, + DeleteIPSetInput, + DeleteIPSetOutput, + DeleteInvitationsInput, + DeleteInvitationsOutput, + DeleteMalwareProtectionPlanInput, + DeleteMalwareProtectionPlanOutput, + DeleteMembersInput, + DeleteMembersOutput, + DeletePublishingDestinationInput, + DeletePublishingDestinationOutput, + DeleteThreatEntitySetInput, + DeleteThreatEntitySetOutput, + DeleteThreatIntelSetInput, + DeleteThreatIntelSetOutput, + DeleteTrustedEntitySetInput, + DeleteTrustedEntitySetOutput, + DescribeMalwareScansInput, + DescribeMalwareScansOutput, + DescribeOrganizationConfigurationInput, + DescribeOrganizationConfigurationOutput, + DescribePublishingDestinationInput, + DescribePublishingDestinationOutput, + DisableOrganizationAdminAccountInput, + DisableOrganizationAdminAccountOutput, + DisassociateFromAdministratorAccountInput, + DisassociateFromAdministratorAccountOutput, + DisassociateFromMasterAccountInput, + DisassociateFromMasterAccountOutput, + DisassociateMembersInput, + DisassociateMembersOutput, + EnableOrganizationAdminAccountInput, + EnableOrganizationAdminAccountOutput, + GetAdministratorAccountInput, + GetAdministratorAccountOutput, + GetCoverageStatisticsInput, + GetCoverageStatisticsOutput, + GetCustomDetectionRuleAssociationInput, + GetCustomDetectionRuleAssociationOutput, + GetCustomDetectionRuleInput, + GetCustomDetectionRuleOrgConfigurationInput, + GetCustomDetectionRuleOrgConfigurationOutput, + GetCustomDetectionRuleOutput, + GetDetectorInput, + GetDetectorOutput, + GetFilterInput, + GetFilterOutput, + GetFindingsInput, + GetFindingsOutput, + GetFindingsStatisticsInput, + GetFindingsStatisticsOutput, + GetIPSetInput, + GetIPSetOutput, + GetInvestigationInput, + GetInvestigationOutput, + GetInvitationsCountInput, + GetInvitationsCountOutput, + GetMalwareProtectionPlanInput, + GetMalwareProtectionPlanOutput, + GetMalwareScanInput, + GetMalwareScanOutput, + GetMalwareScanSettingsInput, + GetMalwareScanSettingsOutput, + GetMasterAccountInput, + GetMasterAccountOutput, + GetMemberDetectorsInput, + GetMemberDetectorsOutput, + GetMembersInput, + GetMembersOutput, + GetOrganizationStatisticsInput, + GetOrganizationStatisticsOutput, + GetRemainingFreeTrialDaysInput, + GetRemainingFreeTrialDaysOutput, + GetThreatEntitySetInput, + GetThreatEntitySetOutput, + GetThreatIntelSetInput, + GetThreatIntelSetOutput, + GetTrustedEntitySetInput, + GetTrustedEntitySetOutput, + GetUsageStatisticsInput, + GetUsageStatisticsOutput, + InviteMembersInput, + InviteMembersOutput, + ListCoverageInput, + ListCoverageOutput, + ListCustomDetectionRuleAssociationsInput, + ListCustomDetectionRuleAssociationsOutput, + ListCustomDetectionRuleOrgConfigurationsInput, + ListCustomDetectionRuleOrgConfigurationsOutput, + ListCustomDetectionRulesInput, + ListCustomDetectionRulesOutput, + ListDetectorsInput, + ListDetectorsOutput, + ListFiltersInput, + ListFiltersOutput, + ListFindingsInput, + ListFindingsOutput, + ListIPSetsInput, + ListIPSetsOutput, + ListInvestigationsInput, + ListInvestigationsOutput, + ListInvitationsInput, + ListInvitationsOutput, + ListMalwareProtectionPlansInput, + ListMalwareProtectionPlansOutput, + ListMalwareScansInput, + ListMalwareScansOutput, + ListMembersInput, + ListMembersOutput, + ListOrganizationAdminAccountsInput, + ListOrganizationAdminAccountsOutput, + ListPublishingDestinationsInput, + ListPublishingDestinationsOutput, + ListTagsForResourceInput, + ListTagsForResourceOutput, + ListThreatEntitySetsInput, + ListThreatEntitySetsOutput, + ListThreatIntelSetsInput, + ListThreatIntelSetsOutput, + ListTrustedEntitySetsInput, + ListTrustedEntitySetsOutput, + SendObjectMalwareScanInput, + SendObjectMalwareScanOutput, + StartMalwareScanInput, + StartMalwareScanOutput, + StartMonitoringMembersInput, + StartMonitoringMembersOutput, + StopMonitoringMembersInput, + StopMonitoringMembersOutput, + TagResourceInput, + TagResourceOutput, + UnarchiveFindingsInput, + UnarchiveFindingsOutput, + UntagResourceInput, + UntagResourceOutput, + UpdateCustomDetectionRuleAssociationInput, + UpdateCustomDetectionRuleAssociationOutput, + UpdateCustomDetectionRuleOrgConfigurationInput, + UpdateCustomDetectionRuleOrgConfigurationOutput, + UpdateDetectorInput, + UpdateDetectorOutput, + UpdateFilterInput, + UpdateFilterOutput, + UpdateFindingsFeedbackInput, + UpdateFindingsFeedbackOutput, + UpdateIPSetInput, + UpdateIPSetOutput, + UpdateMalwareProtectionPlanInput, + UpdateMalwareProtectionPlanOutput, + UpdateMalwareScanSettingsInput, + UpdateMalwareScanSettingsOutput, + UpdateMemberDetectorsInput, + UpdateMemberDetectorsOutput, + UpdateOrganizationConfigurationInput, + UpdateOrganizationConfigurationOutput, + UpdatePublishingDestinationInput, + UpdatePublishingDestinationOutput, + UpdateThreatEntitySetInput, + UpdateThreatEntitySetOutput, + UpdateThreatIntelSetInput, + UpdateThreatIntelSetOutput, + UpdateTrustedEntitySetInput, + UpdateTrustedEntitySetOutput, + ) class ServiceError(ModeledError): @@ -615,46895 +333,2391 @@ class ServiceError(ModeledError): """ -@dataclass(kw_only=True) -class AcceptAdministratorInvitationInput: - """Dataclass for AcceptAdministratorInvitationInput structure.""" - - detector_id: str | None = None - """The unique ID of the detector of the GuardDuty member account.""" +_registry = ModelRegistry( + _schemas, + renames={}, + index={ + "AcceptAdministratorInvitationInput": "ACCEPT_ADMINISTRATOR_INVITATION_INPUT", + "AcceptAdministratorInvitationOutput": "ACCEPT_ADMINISTRATOR_INVITATION_OUTPUT", + "AcceptInvitationInput": "ACCEPT_INVITATION_INPUT", + "AcceptInvitationOutput": "ACCEPT_INVITATION_OUTPUT", + "AccessControlList": "ACCESS_CONTROL_LIST", + "AccessDeniedException": "ACCESS_DENIED_EXCEPTION", + "AccessKey": "ACCESS_KEY", + "AccessKeyDetails": "ACCESS_KEY_DETAILS", + "Account": "ACCOUNT", + "AccountDetail": "ACCOUNT_DETAIL", + "AccountFreeTrialInfo": "ACCOUNT_FREE_TRIAL_INFO", + "AccountLevelPermissions": "ACCOUNT_LEVEL_PERMISSIONS", + "AccountStatistics": "ACCOUNT_STATISTICS", + "Action": "ACTION", + "Activity": "ACTIVITY", + "ActivityType": "ACTIVITY_TYPE", + "Actor": "ACTOR", + "ActorProcess": "ACTOR_PROCESS", + "AdditionalInfo": "ADDITIONAL_INFO", + "AddonDetails": "ADDON_DETAILS", + "AdminAccount": "ADMIN_ACCOUNT", + "Administrator": "ADMINISTRATOR", + "AdminStatus": "ADMIN_STATUS", + "AgentDetails": "AGENT_DETAILS", + "Anomaly": "ANOMALY", + "AnomalyObject": "ANOMALY_OBJECT", + "AnomalyUnusual": "ANOMALY_UNUSUAL", + "ApiCall": "API_CALL", + "ArchiveFindingsInput": "ARCHIVE_FINDINGS_INPUT", + "ArchiveFindingsOutput": "ARCHIVE_FINDINGS_OUTPUT", + "AssociationDetail": "ASSOCIATION_DETAIL", + "AssociationMode": "ASSOCIATION_MODE", + "AssociationSummary": "ASSOCIATION_SUMMARY", + "AutoEnableMembers": "AUTO_ENABLE_MEMBERS", + "AutonomousSystem": "AUTONOMOUS_SYSTEM", + "AutoscalingAutoScalingGroup": "AUTOSCALING_AUTO_SCALING_GROUP", + "AwsApiCallAction": "AWS_API_CALL_ACTION", + "BadRequestException": "BAD_REQUEST_EXCEPTION", + "BedrockGuardrail": "BEDROCK_GUARDRAIL", + "BedrockGuardrailDetails": "BEDROCK_GUARDRAIL_DETAILS", + "BedrockGuardrailResource": "BEDROCK_GUARDRAIL_RESOURCE", + "BlockPublicAccess": "BLOCK_PUBLIC_ACCESS", + "BucketLevelPermissions": "BUCKET_LEVEL_PERMISSIONS", + "BucketPolicy": "BUCKET_POLICY", + "City": "CITY", + "CloudDetails": "CLOUD_DETAILS", + "CloudformationStack": "CLOUDFORMATION_STACK", + "CloudProvider": "CLOUD_PROVIDER", + "CloudTrailConfigurationResult": "CLOUD_TRAIL_CONFIGURATION_RESULT", + "ClusterStatus": "CLUSTER_STATUS", + "Condition": "CONDITION", + "Confidence": "CONFIDENCE", + "ConfidenceLevel": "CONFIDENCE_LEVEL", + "ConflictException": "CONFLICT_EXCEPTION", + "Container": "CONTAINER", + "ContainerFindingResource": "CONTAINER_FINDING_RESOURCE", + "ContainerInstanceDetails": "CONTAINER_INSTANCE_DETAILS", + "ContentPolicyFilter": "CONTENT_POLICY_FILTER", + "ContentPolicyFilterAction": "CONTENT_POLICY_FILTER_ACTION", + "ContentPolicyFilterType": "CONTENT_POLICY_FILTER_TYPE", + "ContinuousScanDetails": "CONTINUOUS_SCAN_DETAILS", + "Country": "COUNTRY", + "CoverageEc2InstanceDetails": "COVERAGE_EC2_INSTANCE_DETAILS", + "CoverageEcsClusterDetails": "COVERAGE_ECS_CLUSTER_DETAILS", + "CoverageEksClusterDetails": "COVERAGE_EKS_CLUSTER_DETAILS", + "CoverageFilterCondition": "COVERAGE_FILTER_CONDITION", + "CoverageFilterCriteria": "COVERAGE_FILTER_CRITERIA", + "CoverageFilterCriterion": "COVERAGE_FILTER_CRITERION", + "CoverageFilterCriterionKey": "COVERAGE_FILTER_CRITERION_KEY", + "CoverageResource": "COVERAGE_RESOURCE", + "CoverageResourceDetails": "COVERAGE_RESOURCE_DETAILS", + "CoverageSortCriteria": "COVERAGE_SORT_CRITERIA", + "CoverageSortKey": "COVERAGE_SORT_KEY", + "CoverageStatistics": "COVERAGE_STATISTICS", + "CoverageStatisticsType": "COVERAGE_STATISTICS_TYPE", + "CoverageStatus": "COVERAGE_STATUS", + "CreateCustomDetectionRuleAssociationInput": "CREATE_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT", + "CreateCustomDetectionRuleAssociationOutput": "CREATE_CUSTOM_DETECTION_RULE_ASSOCIATION_OUTPUT", + "CreateCustomDetectionRuleOrgConfigurationInput": "CREATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT", + "CreateCustomDetectionRuleOrgConfigurationOutput": "CREATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_OUTPUT", + "CreateDetectorInput": "CREATE_DETECTOR_INPUT", + "CreateDetectorOutput": "CREATE_DETECTOR_OUTPUT", + "CreateFilterInput": "CREATE_FILTER_INPUT", + "CreateFilterOutput": "CREATE_FILTER_OUTPUT", + "CreateInvestigationInput": "CREATE_INVESTIGATION_INPUT", + "CreateInvestigationOutput": "CREATE_INVESTIGATION_OUTPUT", + "CreateIPSetInput": "CREATE_IP_SET_INPUT", + "CreateIPSetOutput": "CREATE_IP_SET_OUTPUT", + "CreateMalwareProtectionPlanInput": "CREATE_MALWARE_PROTECTION_PLAN_INPUT", + "CreateMalwareProtectionPlanOutput": "CREATE_MALWARE_PROTECTION_PLAN_OUTPUT", + "CreateMembersInput": "CREATE_MEMBERS_INPUT", + "CreateMembersOutput": "CREATE_MEMBERS_OUTPUT", + "CreateProtectedResource": "CREATE_PROTECTED_RESOURCE", + "CreatePublishingDestinationInput": "CREATE_PUBLISHING_DESTINATION_INPUT", + "CreatePublishingDestinationOutput": "CREATE_PUBLISHING_DESTINATION_OUTPUT", + "CreateS3BucketResource": "CREATE_S3_BUCKET_RESOURCE", + "CreateSampleFindingsInput": "CREATE_SAMPLE_FINDINGS_INPUT", + "CreateSampleFindingsOutput": "CREATE_SAMPLE_FINDINGS_OUTPUT", + "CreateThreatEntitySetInput": "CREATE_THREAT_ENTITY_SET_INPUT", + "CreateThreatEntitySetOutput": "CREATE_THREAT_ENTITY_SET_OUTPUT", + "CreateThreatIntelSetInput": "CREATE_THREAT_INTEL_SET_INPUT", + "CreateThreatIntelSetOutput": "CREATE_THREAT_INTEL_SET_OUTPUT", + "CreateTrustedEntitySetInput": "CREATE_TRUSTED_ENTITY_SET_INPUT", + "CreateTrustedEntitySetOutput": "CREATE_TRUSTED_ENTITY_SET_OUTPUT", + "CriterionKey": "CRITERION_KEY", + "DataSource": "DATA_SOURCE", + "DataSourceConfigurations": "DATA_SOURCE_CONFIGURATIONS", + "DataSourceConfigurationsResult": "DATA_SOURCE_CONFIGURATIONS_RESULT", + "DataSourceFreeTrial": "DATA_SOURCE_FREE_TRIAL", + "DataSourcesFreeTrial": "DATA_SOURCES_FREE_TRIAL", + "DataSourceStatus": "DATA_SOURCE_STATUS", + "DateStatistics": "DATE_STATISTICS", + "DeclineInvitationsInput": "DECLINE_INVITATIONS_INPUT", + "DeclineInvitationsOutput": "DECLINE_INVITATIONS_OUTPUT", + "DefaultServerSideEncryption": "DEFAULT_SERVER_SIDE_ENCRYPTION", + "DeleteCustomDetectionRuleAssociationInput": "DELETE_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT", + "DeleteCustomDetectionRuleAssociationOutput": "DELETE_CUSTOM_DETECTION_RULE_ASSOCIATION_OUTPUT", + "DeleteCustomDetectionRuleOrgConfigurationInput": "DELETE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT", + "DeleteCustomDetectionRuleOrgConfigurationOutput": "DELETE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_OUTPUT", + "DeleteDetectorInput": "DELETE_DETECTOR_INPUT", + "DeleteDetectorOutput": "DELETE_DETECTOR_OUTPUT", + "DeleteFilterInput": "DELETE_FILTER_INPUT", + "DeleteFilterOutput": "DELETE_FILTER_OUTPUT", + "DeleteInvitationsInput": "DELETE_INVITATIONS_INPUT", + "DeleteInvitationsOutput": "DELETE_INVITATIONS_OUTPUT", + "DeleteIPSetInput": "DELETE_IP_SET_INPUT", + "DeleteIPSetOutput": "DELETE_IP_SET_OUTPUT", + "DeleteMalwareProtectionPlanInput": "DELETE_MALWARE_PROTECTION_PLAN_INPUT", + "DeleteMalwareProtectionPlanOutput": "DELETE_MALWARE_PROTECTION_PLAN_OUTPUT", + "DeleteMembersInput": "DELETE_MEMBERS_INPUT", + "DeleteMembersOutput": "DELETE_MEMBERS_OUTPUT", + "DeletePublishingDestinationInput": "DELETE_PUBLISHING_DESTINATION_INPUT", + "DeletePublishingDestinationOutput": "DELETE_PUBLISHING_DESTINATION_OUTPUT", + "DeleteThreatEntitySetInput": "DELETE_THREAT_ENTITY_SET_INPUT", + "DeleteThreatEntitySetOutput": "DELETE_THREAT_ENTITY_SET_OUTPUT", + "DeleteThreatIntelSetInput": "DELETE_THREAT_INTEL_SET_INPUT", + "DeleteThreatIntelSetOutput": "DELETE_THREAT_INTEL_SET_OUTPUT", + "DeleteTrustedEntitySetInput": "DELETE_TRUSTED_ENTITY_SET_INPUT", + "DeleteTrustedEntitySetOutput": "DELETE_TRUSTED_ENTITY_SET_OUTPUT", + "DescribeMalwareScansInput": "DESCRIBE_MALWARE_SCANS_INPUT", + "DescribeMalwareScansOutput": "DESCRIBE_MALWARE_SCANS_OUTPUT", + "DescribeOrganizationConfigurationInput": "DESCRIBE_ORGANIZATION_CONFIGURATION_INPUT", + "DescribeOrganizationConfigurationOutput": "DESCRIBE_ORGANIZATION_CONFIGURATION_OUTPUT", + "DescribePublishingDestinationInput": "DESCRIBE_PUBLISHING_DESTINATION_INPUT", + "DescribePublishingDestinationOutput": "DESCRIBE_PUBLISHING_DESTINATION_OUTPUT", + "Destination": "DESTINATION", + "DestinationProperties": "DESTINATION_PROPERTIES", + "DestinationType": "DESTINATION_TYPE", + "Detection": "DETECTION", + "DetectionRuleConfigurationStatus": "DETECTION_RULE_CONFIGURATION_STATUS", + "DetectionRuleDataSource": "DETECTION_RULE_DATA_SOURCE", + "DetectionRuleFilter": "DETECTION_RULE_FILTER", + "DetectionRuleFilterCondition": "DETECTION_RULE_FILTER_CONDITION", + "DetectionRuleOrgConfiguration": "DETECTION_RULE_ORG_CONFIGURATION", + "DetectionRuleOrgConfigurationSummary": "DETECTION_RULE_ORG_CONFIGURATION_SUMMARY", + "DetectionRuleSeverity": "DETECTION_RULE_SEVERITY", + "DetectionSource": "DETECTION_SOURCE", + "DetectorAdditionalConfiguration": "DETECTOR_ADDITIONAL_CONFIGURATION", + "DetectorAdditionalConfigurationResult": "DETECTOR_ADDITIONAL_CONFIGURATION_RESULT", + "DetectorFeature": "DETECTOR_FEATURE", + "DetectorFeatureConfiguration": "DETECTOR_FEATURE_CONFIGURATION", + "DetectorFeatureConfigurationResult": "DETECTOR_FEATURE_CONFIGURATION_RESULT", + "DetectorFeatureResult": "DETECTOR_FEATURE_RESULT", + "DetectorStatus": "DETECTOR_STATUS", + "DisableOrganizationAdminAccountInput": "DISABLE_ORGANIZATION_ADMIN_ACCOUNT_INPUT", + "DisableOrganizationAdminAccountOutput": "DISABLE_ORGANIZATION_ADMIN_ACCOUNT_OUTPUT", + "DisassociateFromAdministratorAccountInput": "DISASSOCIATE_FROM_ADMINISTRATOR_ACCOUNT_INPUT", + "DisassociateFromAdministratorAccountOutput": "DISASSOCIATE_FROM_ADMINISTRATOR_ACCOUNT_OUTPUT", + "DisassociateFromMasterAccountInput": "DISASSOCIATE_FROM_MASTER_ACCOUNT_INPUT", + "DisassociateFromMasterAccountOutput": "DISASSOCIATE_FROM_MASTER_ACCOUNT_OUTPUT", + "DisassociateMembersInput": "DISASSOCIATE_MEMBERS_INPUT", + "DisassociateMembersOutput": "DISASSOCIATE_MEMBERS_OUTPUT", + "DNSLogsConfigurationResult": "DNS_LOGS_CONFIGURATION_RESULT", + "DnsRequestAction": "DNS_REQUEST_ACTION", + "DomainDetails": "DOMAIN_DETAILS", + "EbsSnapshot": "EBS_SNAPSHOT", + "EbsSnapshotDetails": "EBS_SNAPSHOT_DETAILS", + "EbsSnapshotPreservation": "EBS_SNAPSHOT_PRESERVATION", + "EbsVolumeDetails": "EBS_VOLUME_DETAILS", + "EbsVolumeScanDetails": "EBS_VOLUME_SCAN_DETAILS", + "EbsVolumesResult": "EBS_VOLUMES_RESULT", + "Ec2Image": "EC2_IMAGE", + "Ec2ImageDetails": "EC2_IMAGE_DETAILS", + "Ec2Instance": "EC2_INSTANCE", + "Ec2LaunchTemplate": "EC2_LAUNCH_TEMPLATE", + "Ec2NetworkInterface": "EC2_NETWORK_INTERFACE", + "Ec2Vpc": "EC2_VPC", + "EcsCluster": "ECS_CLUSTER", + "EcsClusterDetails": "ECS_CLUSTER_DETAILS", + "EcsClusterStatus": "ECS_CLUSTER_STATUS", + "EcsLaunchType": "ECS_LAUNCH_TYPE", + "EcsTask": "ECS_TASK", + "EcsTaskDetails": "ECS_TASK_DETAILS", + "EksCluster": "EKS_CLUSTER", + "EksClusterDetails": "EKS_CLUSTER_DETAILS", + "EnableOrganizationAdminAccountInput": "ENABLE_ORGANIZATION_ADMIN_ACCOUNT_INPUT", + "EnableOrganizationAdminAccountOutput": "ENABLE_ORGANIZATION_ADMIN_ACCOUNT_OUTPUT", + "Evidence": "EVIDENCE", + "FargateDetails": "FARGATE_DETAILS", + "FeatureAdditionalConfiguration": "FEATURE_ADDITIONAL_CONFIGURATION", + "FeatureStatus": "FEATURE_STATUS", + "Feedback": "FEEDBACK", + "FilterAction": "FILTER_ACTION", + "FilterCondition": "FILTER_CONDITION", + "FilterCriteria": "FILTER_CRITERIA", + "FilterCriterion": "FILTER_CRITERION", + "FilterFieldName": "FILTER_FIELD_NAME", + "Finding": "FINDING", + "FindingCriteria": "FINDING_CRITERIA", + "FindingPublishingFrequency": "FINDING_PUBLISHING_FREQUENCY", + "FindingResourceType": "FINDING_RESOURCE_TYPE", + "FindingStatistics": "FINDING_STATISTICS", + "FindingStatisticType": "FINDING_STATISTIC_TYPE", + "FindingTypeStatistics": "FINDING_TYPE_STATISTICS", + "FlowLogsConfigurationResult": "FLOW_LOGS_CONFIGURATION_RESULT", + "FreeTrialFeatureConfigurationResult": "FREE_TRIAL_FEATURE_CONFIGURATION_RESULT", + "FreeTrialFeatureResult": "FREE_TRIAL_FEATURE_RESULT", + "GeoLocation": "GEO_LOCATION", + "GetAdministratorAccountInput": "GET_ADMINISTRATOR_ACCOUNT_INPUT", + "GetAdministratorAccountOutput": "GET_ADMINISTRATOR_ACCOUNT_OUTPUT", + "GetCoverageStatisticsInput": "GET_COVERAGE_STATISTICS_INPUT", + "GetCoverageStatisticsOutput": "GET_COVERAGE_STATISTICS_OUTPUT", + "GetCustomDetectionRuleAssociationInput": "GET_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT", + "GetCustomDetectionRuleAssociationOutput": "GET_CUSTOM_DETECTION_RULE_ASSOCIATION_OUTPUT", + "GetCustomDetectionRuleInput": "GET_CUSTOM_DETECTION_RULE_INPUT", + "GetCustomDetectionRuleOrgConfigurationInput": "GET_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT", + "GetCustomDetectionRuleOrgConfigurationOutput": "GET_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_OUTPUT", + "GetCustomDetectionRuleOutput": "GET_CUSTOM_DETECTION_RULE_OUTPUT", + "GetDetectorInput": "GET_DETECTOR_INPUT", + "GetDetectorOutput": "GET_DETECTOR_OUTPUT", + "GetFilterInput": "GET_FILTER_INPUT", + "GetFilterOutput": "GET_FILTER_OUTPUT", + "GetFindingsInput": "GET_FINDINGS_INPUT", + "GetFindingsOutput": "GET_FINDINGS_OUTPUT", + "GetFindingsStatisticsInput": "GET_FINDINGS_STATISTICS_INPUT", + "GetFindingsStatisticsOutput": "GET_FINDINGS_STATISTICS_OUTPUT", + "GetInvestigationInput": "GET_INVESTIGATION_INPUT", + "GetInvestigationOutput": "GET_INVESTIGATION_OUTPUT", + "GetInvitationsCountInput": "GET_INVITATIONS_COUNT_INPUT", + "GetInvitationsCountOutput": "GET_INVITATIONS_COUNT_OUTPUT", + "GetIPSetInput": "GET_IP_SET_INPUT", + "GetIPSetOutput": "GET_IP_SET_OUTPUT", + "GetMalwareProtectionPlanInput": "GET_MALWARE_PROTECTION_PLAN_INPUT", + "GetMalwareProtectionPlanOutput": "GET_MALWARE_PROTECTION_PLAN_OUTPUT", + "GetMalwareScanInput": "GET_MALWARE_SCAN_INPUT", + "GetMalwareScanOutput": "GET_MALWARE_SCAN_OUTPUT", + "GetMalwareScanResultDetails": "GET_MALWARE_SCAN_RESULT_DETAILS", + "GetMalwareScanSettingsInput": "GET_MALWARE_SCAN_SETTINGS_INPUT", + "GetMalwareScanSettingsOutput": "GET_MALWARE_SCAN_SETTINGS_OUTPUT", + "GetMasterAccountInput": "GET_MASTER_ACCOUNT_INPUT", + "GetMasterAccountOutput": "GET_MASTER_ACCOUNT_OUTPUT", + "GetMemberDetectorsInput": "GET_MEMBER_DETECTORS_INPUT", + "GetMemberDetectorsOutput": "GET_MEMBER_DETECTORS_OUTPUT", + "GetMembersInput": "GET_MEMBERS_INPUT", + "GetMembersOutput": "GET_MEMBERS_OUTPUT", + "GetOrganizationStatisticsInput": "GET_ORGANIZATION_STATISTICS_INPUT", + "GetOrganizationStatisticsOutput": "GET_ORGANIZATION_STATISTICS_OUTPUT", + "GetRemainingFreeTrialDaysInput": "GET_REMAINING_FREE_TRIAL_DAYS_INPUT", + "GetRemainingFreeTrialDaysOutput": "GET_REMAINING_FREE_TRIAL_DAYS_OUTPUT", + "GetThreatEntitySetInput": "GET_THREAT_ENTITY_SET_INPUT", + "GetThreatEntitySetOutput": "GET_THREAT_ENTITY_SET_OUTPUT", + "GetThreatIntelSetInput": "GET_THREAT_INTEL_SET_INPUT", + "GetThreatIntelSetOutput": "GET_THREAT_INTEL_SET_OUTPUT", + "GetTrustedEntitySetInput": "GET_TRUSTED_ENTITY_SET_INPUT", + "GetTrustedEntitySetOutput": "GET_TRUSTED_ENTITY_SET_OUTPUT", + "GetUsageStatisticsInput": "GET_USAGE_STATISTICS_INPUT", + "GetUsageStatisticsOutput": "GET_USAGE_STATISTICS_OUTPUT", + "GroupByType": "GROUP_BY_TYPE", + "GuardrailAction": "GUARDRAIL_ACTION", + "GuardrailSource": "GUARDRAIL_SOURCE", + "HighestSeverityThreatDetails": "HIGHEST_SEVERITY_THREAT_DETAILS", + "HostPath": "HOST_PATH", + "IamInstanceProfile": "IAM_INSTANCE_PROFILE", + "IamInstanceProfileV2": "IAM_INSTANCE_PROFILE_V2", + "ImpersonatedUser": "IMPERSONATED_USER", + "IncrementalScanDetails": "INCREMENTAL_SCAN_DETAILS", + "Indicator": "INDICATOR", + "IndicatorType": "INDICATOR_TYPE", + "InstanceDetails": "INSTANCE_DETAILS", + "InternalServerErrorException": "INTERNAL_SERVER_ERROR_EXCEPTION", + "Investigation": "INVESTIGATION", + "InvestigationMetadata": "INVESTIGATION_METADATA", + "InvestigationSortCriteria": "INVESTIGATION_SORT_CRITERIA", + "InvestigationSortField": "INVESTIGATION_SORT_FIELD", + "InvestigationStatus": "INVESTIGATION_STATUS", + "InvestigationSummary": "INVESTIGATION_SUMMARY", + "Invitation": "INVITATION", + "InviteMembersInput": "INVITE_MEMBERS_INPUT", + "InviteMembersOutput": "INVITE_MEMBERS_OUTPUT", + "IpSetFormat": "IP_SET_FORMAT", + "IpSetStatus": "IP_SET_STATUS", + "ItemDetails": "ITEM_DETAILS", + "ItemPath": "ITEM_PATH", + "KubernetesApiCallAction": "KUBERNETES_API_CALL_ACTION", + "KubernetesAuditLogsConfiguration": "KUBERNETES_AUDIT_LOGS_CONFIGURATION", + "KubernetesAuditLogsConfigurationResult": "KUBERNETES_AUDIT_LOGS_CONFIGURATION_RESULT", + "KubernetesConfiguration": "KUBERNETES_CONFIGURATION", + "KubernetesConfigurationResult": "KUBERNETES_CONFIGURATION_RESULT", + "KubernetesDataSourceFreeTrial": "KUBERNETES_DATA_SOURCE_FREE_TRIAL", + "KubernetesDetails": "KUBERNETES_DETAILS", + "KubernetesPermissionCheckedDetails": "KUBERNETES_PERMISSION_CHECKED_DETAILS", + "KubernetesResourcesTypes": "KUBERNETES_RESOURCES_TYPES", + "KubernetesRoleBindingDetails": "KUBERNETES_ROLE_BINDING_DETAILS", + "KubernetesRoleDetails": "KUBERNETES_ROLE_DETAILS", + "KubernetesUserDetails": "KUBERNETES_USER_DETAILS", + "KubernetesWorkload": "KUBERNETES_WORKLOAD", + "KubernetesWorkloadDetails": "KUBERNETES_WORKLOAD_DETAILS", + "LambdaDetails": "LAMBDA_DETAILS", + "LineageObject": "LINEAGE_OBJECT", + "ListCoverageInput": "LIST_COVERAGE_INPUT", + "ListCoverageOutput": "LIST_COVERAGE_OUTPUT", + "ListCustomDetectionRuleAssociationsInput": "LIST_CUSTOM_DETECTION_RULE_ASSOCIATIONS_INPUT", + "ListCustomDetectionRuleAssociationsOutput": "LIST_CUSTOM_DETECTION_RULE_ASSOCIATIONS_OUTPUT", + "ListCustomDetectionRuleOrgConfigurationsInput": "LIST_CUSTOM_DETECTION_RULE_ORG_CONFIGURATIONS_INPUT", + "ListCustomDetectionRuleOrgConfigurationsOutput": "LIST_CUSTOM_DETECTION_RULE_ORG_CONFIGURATIONS_OUTPUT", + "ListCustomDetectionRulesInput": "LIST_CUSTOM_DETECTION_RULES_INPUT", + "ListCustomDetectionRulesOutput": "LIST_CUSTOM_DETECTION_RULES_OUTPUT", + "ListDetectorsInput": "LIST_DETECTORS_INPUT", + "ListDetectorsOutput": "LIST_DETECTORS_OUTPUT", + "ListFiltersInput": "LIST_FILTERS_INPUT", + "ListFiltersOutput": "LIST_FILTERS_OUTPUT", + "ListFindingsInput": "LIST_FINDINGS_INPUT", + "ListFindingsOutput": "LIST_FINDINGS_OUTPUT", + "ListInvestigationsInput": "LIST_INVESTIGATIONS_INPUT", + "ListInvestigationsOutput": "LIST_INVESTIGATIONS_OUTPUT", + "ListInvitationsInput": "LIST_INVITATIONS_INPUT", + "ListInvitationsOutput": "LIST_INVITATIONS_OUTPUT", + "ListIPSetsInput": "LIST_IP_SETS_INPUT", + "ListIPSetsOutput": "LIST_IP_SETS_OUTPUT", + "ListMalwareProtectionPlansInput": "LIST_MALWARE_PROTECTION_PLANS_INPUT", + "ListMalwareProtectionPlansOutput": "LIST_MALWARE_PROTECTION_PLANS_OUTPUT", + "ListMalwareScansCriterionKey": "LIST_MALWARE_SCANS_CRITERION_KEY", + "ListMalwareScansFilterCriteria": "LIST_MALWARE_SCANS_FILTER_CRITERIA", + "ListMalwareScansFilterCriterion": "LIST_MALWARE_SCANS_FILTER_CRITERION", + "ListMalwareScansInput": "LIST_MALWARE_SCANS_INPUT", + "ListMalwareScansOutput": "LIST_MALWARE_SCANS_OUTPUT", + "ListMembersInput": "LIST_MEMBERS_INPUT", + "ListMembersOutput": "LIST_MEMBERS_OUTPUT", + "ListOrganizationAdminAccountsInput": "LIST_ORGANIZATION_ADMIN_ACCOUNTS_INPUT", + "ListOrganizationAdminAccountsOutput": "LIST_ORGANIZATION_ADMIN_ACCOUNTS_OUTPUT", + "ListPublishingDestinationsInput": "LIST_PUBLISHING_DESTINATIONS_INPUT", + "ListPublishingDestinationsOutput": "LIST_PUBLISHING_DESTINATIONS_OUTPUT", + "ListTagsForResourceInput": "LIST_TAGS_FOR_RESOURCE_INPUT", + "ListTagsForResourceOutput": "LIST_TAGS_FOR_RESOURCE_OUTPUT", + "ListThreatEntitySetsInput": "LIST_THREAT_ENTITY_SETS_INPUT", + "ListThreatEntitySetsOutput": "LIST_THREAT_ENTITY_SETS_OUTPUT", + "ListThreatIntelSetsInput": "LIST_THREAT_INTEL_SETS_INPUT", + "ListThreatIntelSetsOutput": "LIST_THREAT_INTEL_SETS_OUTPUT", + "ListTrustedEntitySetsInput": "LIST_TRUSTED_ENTITY_SETS_INPUT", + "ListTrustedEntitySetsOutput": "LIST_TRUSTED_ENTITY_SETS_OUTPUT", + "LocalIpDetails": "LOCAL_IP_DETAILS", + "LocalPortDetails": "LOCAL_PORT_DETAILS", + "LoginAttribute": "LOGIN_ATTRIBUTE", + "MalwareProtectionConfiguration": "MALWARE_PROTECTION_CONFIGURATION", + "MalwareProtectionConfigurationResult": "MALWARE_PROTECTION_CONFIGURATION_RESULT", + "MalwareProtectionDataSourceFreeTrial": "MALWARE_PROTECTION_DATA_SOURCE_FREE_TRIAL", + "MalwareProtectionFindingsScanConfiguration": "MALWARE_PROTECTION_FINDINGS_SCAN_CONFIGURATION", + "MalwareProtectionPlanActions": "MALWARE_PROTECTION_PLAN_ACTIONS", + "MalwareProtectionPlanStatus": "MALWARE_PROTECTION_PLAN_STATUS", + "MalwareProtectionPlanStatusReason": "MALWARE_PROTECTION_PLAN_STATUS_REASON", + "MalwareProtectionPlanSummary": "MALWARE_PROTECTION_PLAN_SUMMARY", + "MalwareProtectionPlanTaggingAction": "MALWARE_PROTECTION_PLAN_TAGGING_ACTION", + "MalwareProtectionPlanTaggingActionStatus": "MALWARE_PROTECTION_PLAN_TAGGING_ACTION_STATUS", + "MalwareProtectionResourceType": "MALWARE_PROTECTION_RESOURCE_TYPE", + "MalwareProtectionScanStatus": "MALWARE_PROTECTION_SCAN_STATUS", + "MalwareProtectionScanType": "MALWARE_PROTECTION_SCAN_TYPE", + "MalwareScan": "MALWARE_SCAN", + "MalwareScanDetails": "MALWARE_SCAN_DETAILS", + "ManagedBy": "MANAGED_BY", + "ManagementType": "MANAGEMENT_TYPE", + "Master": "MASTER", + "Member": "MEMBER", + "MemberAdditionalConfiguration": "MEMBER_ADDITIONAL_CONFIGURATION", + "MemberAdditionalConfigurationResult": "MEMBER_ADDITIONAL_CONFIGURATION_RESULT", + "MemberDataSourceConfiguration": "MEMBER_DATA_SOURCE_CONFIGURATION", + "MemberFeaturesConfiguration": "MEMBER_FEATURES_CONFIGURATION", + "MemberFeaturesConfigurationResult": "MEMBER_FEATURES_CONFIGURATION_RESULT", + "MfaStatus": "MFA_STATUS", + "ModelDetail": "MODEL_DETAIL", + "NetworkConnection": "NETWORK_CONNECTION", + "NetworkConnectionAction": "NETWORK_CONNECTION_ACTION", + "NetworkDirection": "NETWORK_DIRECTION", + "NetworkEndpoint": "NETWORK_ENDPOINT", + "NetworkGeoLocation": "NETWORK_GEO_LOCATION", + "NetworkInterface": "NETWORK_INTERFACE", + "Observations": "OBSERVATIONS", + "OrderBy": "ORDER_BY", + "Organization": "ORGANIZATION", + "OrganizationAdditionalConfiguration": "ORGANIZATION_ADDITIONAL_CONFIGURATION", + "OrganizationAdditionalConfigurationResult": "ORGANIZATION_ADDITIONAL_CONFIGURATION_RESULT", + "OrganizationDataSourceConfigurations": "ORGANIZATION_DATA_SOURCE_CONFIGURATIONS", + "OrganizationDataSourceConfigurationsResult": "ORGANIZATION_DATA_SOURCE_CONFIGURATIONS_RESULT", + "OrganizationDetails": "ORGANIZATION_DETAILS", + "OrganizationEbsVolumes": "ORGANIZATION_EBS_VOLUMES", + "OrganizationEbsVolumesResult": "ORGANIZATION_EBS_VOLUMES_RESULT", + "OrganizationFeatureConfiguration": "ORGANIZATION_FEATURE_CONFIGURATION", + "OrganizationFeatureConfigurationResult": "ORGANIZATION_FEATURE_CONFIGURATION_RESULT", + "OrganizationFeatureStatistics": "ORGANIZATION_FEATURE_STATISTICS", + "OrganizationFeatureStatisticsAdditionalConfiguration": "ORGANIZATION_FEATURE_STATISTICS_ADDITIONAL_CONFIGURATION", + "OrganizationKubernetesAuditLogsConfiguration": "ORGANIZATION_KUBERNETES_AUDIT_LOGS_CONFIGURATION", + "OrganizationKubernetesAuditLogsConfigurationResult": "ORGANIZATION_KUBERNETES_AUDIT_LOGS_CONFIGURATION_RESULT", + "OrganizationKubernetesConfiguration": "ORGANIZATION_KUBERNETES_CONFIGURATION", + "OrganizationKubernetesConfigurationResult": "ORGANIZATION_KUBERNETES_CONFIGURATION_RESULT", + "OrganizationMalwareProtectionConfiguration": "ORGANIZATION_MALWARE_PROTECTION_CONFIGURATION", + "OrganizationMalwareProtectionConfigurationResult": "ORGANIZATION_MALWARE_PROTECTION_CONFIGURATION_RESULT", + "OrganizationS3LogsConfiguration": "ORGANIZATION_S3_LOGS_CONFIGURATION", + "OrganizationS3LogsConfigurationResult": "ORGANIZATION_S3_LOGS_CONFIGURATION_RESULT", + "OrganizationScanEc2InstanceWithFindings": "ORGANIZATION_SCAN_EC2_INSTANCE_WITH_FINDINGS", + "OrganizationScanEc2InstanceWithFindingsResult": "ORGANIZATION_SCAN_EC2_INSTANCE_WITH_FINDINGS_RESULT", + "OrganizationStatistics": "ORGANIZATION_STATISTICS", + "OrgFeature": "ORG_FEATURE", + "OrgFeatureAdditionalConfiguration": "ORG_FEATURE_ADDITIONAL_CONFIGURATION", + "OrgFeatureStatus": "ORG_FEATURE_STATUS", + "Owner": "OWNER", + "PermissionConfiguration": "PERMISSION_CONFIGURATION", + "PortProbeAction": "PORT_PROBE_ACTION", + "PortProbeDetail": "PORT_PROBE_DETAIL", + "PrivateIpAddressDetails": "PRIVATE_IP_ADDRESS_DETAILS", + "ProcessDetails": "PROCESS_DETAILS", + "Product": "PRODUCT", + "ProductCode": "PRODUCT_CODE", + "ProfileSubtype": "PROFILE_SUBTYPE", + "ProfileType": "PROFILE_TYPE", + "PublicAccess": "PUBLIC_ACCESS", + "PublicAccessConfiguration": "PUBLIC_ACCESS_CONFIGURATION", + "PublicAccessStatus": "PUBLIC_ACCESS_STATUS", + "PublicAclIgnoreBehavior": "PUBLIC_ACL_IGNORE_BEHAVIOR", + "PublicBucketRestrictBehavior": "PUBLIC_BUCKET_RESTRICT_BEHAVIOR", + "PublishingStatus": "PUBLISHING_STATUS", + "RdsDbInstanceDetails": "RDS_DB_INSTANCE_DETAILS", + "RdsDbUserDetails": "RDS_DB_USER_DETAILS", + "RdsLimitlessDbDetails": "RDS_LIMITLESS_DB_DETAILS", + "RdsLoginAttemptAction": "RDS_LOGIN_ATTEMPT_ACTION", + "RecoveryPoint": "RECOVERY_POINT", + "RecoveryPointDetails": "RECOVERY_POINT_DETAILS", + "RemoteAccountDetails": "REMOTE_ACCOUNT_DETAILS", + "RemoteIpDetails": "REMOTE_IP_DETAILS", + "RemotePortDetails": "REMOTE_PORT_DETAILS", + "Resource": "RESOURCE", + "ResourceData": "RESOURCE_DATA", + "ResourceDetails": "RESOURCE_DETAILS", + "ResourceNotFoundException": "RESOURCE_NOT_FOUND_EXCEPTION", + "ResourceStatistics": "RESOURCE_STATISTICS", + "ResourceType": "RESOURCE_TYPE", + "ResourceV2": "RESOURCE_V2", + "RiskLevel": "RISK_LEVEL", + "RuleDefinition": "RULE_DEFINITION", + "RuleDetail": "RULE_DETAIL", + "RuleLanguage": "RULE_LANGUAGE", + "RuleSchema": "RULE_SCHEMA", + "RuleSummary": "RULE_SUMMARY", + "RuntimeContext": "RUNTIME_CONTEXT", + "RuntimeDetails": "RUNTIME_DETAILS", + "S3Bucket": "S3_BUCKET", + "S3BucketDetail": "S3_BUCKET_DETAIL", + "S3LogsConfiguration": "S3_LOGS_CONFIGURATION", + "S3LogsConfigurationResult": "S3_LOGS_CONFIGURATION_RESULT", + "S3Object": "S3_OBJECT", + "S3ObjectDetail": "S3_OBJECT_DETAIL", + "S3ObjectForSendObjectMalwareScan": "S3_OBJECT_FOR_SEND_OBJECT_MALWARE_SCAN", + "Scan": "SCAN", + "ScanCategory": "SCAN_CATEGORY", + "ScanCondition": "SCAN_CONDITION", + "ScanConditionPair": "SCAN_CONDITION_PAIR", + "ScanConfiguration": "SCAN_CONFIGURATION", + "ScanConfigurationContinuousScanDetails": "SCAN_CONFIGURATION_CONTINUOUS_SCAN_DETAILS", + "ScanConfigurationRecoveryPoint": "SCAN_CONFIGURATION_RECOVERY_POINT", + "ScanCriterionKey": "SCAN_CRITERION_KEY", + "ScanDetections": "SCAN_DETECTIONS", + "ScanEc2InstanceWithFindings": "SCAN_EC2_INSTANCE_WITH_FINDINGS", + "ScanEc2InstanceWithFindingsResult": "SCAN_EC2_INSTANCE_WITH_FINDINGS_RESULT", + "ScanFilePath": "SCAN_FILE_PATH", + "ScannedItemCount": "SCANNED_ITEM_COUNT", + "ScannedResource": "SCANNED_RESOURCE", + "ScannedResourceDetails": "SCANNED_RESOURCE_DETAILS", + "ScanResourceCriteria": "SCAN_RESOURCE_CRITERIA", + "ScanResult": "SCAN_RESULT", + "ScanResultDetails": "SCAN_RESULT_DETAILS", + "ScanResultStatus": "SCAN_RESULT_STATUS", + "ScanResultThreat": "SCAN_RESULT_THREAT", + "ScanStatus": "SCAN_STATUS", + "ScanStatusReason": "SCAN_STATUS_REASON", + "ScanThreatName": "SCAN_THREAT_NAME", + "ScanType": "SCAN_TYPE", + "SecurityContext": "SECURITY_CONTEXT", + "SecurityGroup": "SECURITY_GROUP", + "SendObjectMalwareScanInput": "SEND_OBJECT_MALWARE_SCAN_INPUT", + "SendObjectMalwareScanOutput": "SEND_OBJECT_MALWARE_SCAN_OUTPUT", + "Sequence": "SEQUENCE", + "Service": "SERVICE", + "ServiceAdditionalInfo": "SERVICE_ADDITIONAL_INFO", + "Session": "SESSION", + "SeverityStatistics": "SEVERITY_STATISTICS", + "Signal": "SIGNAL", + "SignalType": "SIGNAL_TYPE", + "SortCriteria": "SORT_CRITERIA", + "StartMalwareScanConfiguration": "START_MALWARE_SCAN_CONFIGURATION", + "StartMalwareScanInput": "START_MALWARE_SCAN_INPUT", + "StartMalwareScanOutput": "START_MALWARE_SCAN_OUTPUT", + "StartMonitoringMembersInput": "START_MONITORING_MEMBERS_INPUT", + "StartMonitoringMembersOutput": "START_MONITORING_MEMBERS_OUTPUT", + "StopMonitoringMembersInput": "STOP_MONITORING_MEMBERS_INPUT", + "StopMonitoringMembersOutput": "STOP_MONITORING_MEMBERS_OUTPUT", + "Tag": "TAG", + "TagResourceInput": "TAG_RESOURCE_INPUT", + "TagResourceOutput": "TAG_RESOURCE_OUTPUT", + "Threat": "THREAT", + "ThreatDetectedByName": "THREAT_DETECTED_BY_NAME", + "ThreatEntitySetFormat": "THREAT_ENTITY_SET_FORMAT", + "ThreatEntitySetStatus": "THREAT_ENTITY_SET_STATUS", + "ThreatIntelligenceDetail": "THREAT_INTELLIGENCE_DETAIL", + "ThreatIntelSetFormat": "THREAT_INTEL_SET_FORMAT", + "ThreatIntelSetStatus": "THREAT_INTEL_SET_STATUS", + "ThreatsDetectedItemCount": "THREATS_DETECTED_ITEM_COUNT", + "Total": "TOTAL", + "TriggerDetails": "TRIGGER_DETAILS", + "TriggerType": "TRIGGER_TYPE", + "TrustedEntitySetFormat": "TRUSTED_ENTITY_SET_FORMAT", + "TrustedEntitySetStatus": "TRUSTED_ENTITY_SET_STATUS", + "UnarchiveFindingsInput": "UNARCHIVE_FINDINGS_INPUT", + "UnarchiveFindingsOutput": "UNARCHIVE_FINDINGS_OUTPUT", + "UnprocessedAccount": "UNPROCESSED_ACCOUNT", + "UnprocessedDataSourcesResult": "UNPROCESSED_DATA_SOURCES_RESULT", + "UntagResourceInput": "UNTAG_RESOURCE_INPUT", + "UntagResourceOutput": "UNTAG_RESOURCE_OUTPUT", + "UpdateCustomDetectionRuleAssociationInput": "UPDATE_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT", + "UpdateCustomDetectionRuleAssociationOutput": "UPDATE_CUSTOM_DETECTION_RULE_ASSOCIATION_OUTPUT", + "UpdateCustomDetectionRuleOrgConfigurationInput": "UPDATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT", + "UpdateCustomDetectionRuleOrgConfigurationOutput": "UPDATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_OUTPUT", + "UpdateDetectorInput": "UPDATE_DETECTOR_INPUT", + "UpdateDetectorOutput": "UPDATE_DETECTOR_OUTPUT", + "UpdateFilterInput": "UPDATE_FILTER_INPUT", + "UpdateFilterOutput": "UPDATE_FILTER_OUTPUT", + "UpdateFindingsFeedbackInput": "UPDATE_FINDINGS_FEEDBACK_INPUT", + "UpdateFindingsFeedbackOutput": "UPDATE_FINDINGS_FEEDBACK_OUTPUT", + "UpdateIPSetInput": "UPDATE_IP_SET_INPUT", + "UpdateIPSetOutput": "UPDATE_IP_SET_OUTPUT", + "UpdateMalwareProtectionPlanInput": "UPDATE_MALWARE_PROTECTION_PLAN_INPUT", + "UpdateMalwareProtectionPlanOutput": "UPDATE_MALWARE_PROTECTION_PLAN_OUTPUT", + "UpdateMalwareScanSettingsInput": "UPDATE_MALWARE_SCAN_SETTINGS_INPUT", + "UpdateMalwareScanSettingsOutput": "UPDATE_MALWARE_SCAN_SETTINGS_OUTPUT", + "UpdateMemberDetectorsInput": "UPDATE_MEMBER_DETECTORS_INPUT", + "UpdateMemberDetectorsOutput": "UPDATE_MEMBER_DETECTORS_OUTPUT", + "UpdateOrganizationConfigurationInput": "UPDATE_ORGANIZATION_CONFIGURATION_INPUT", + "UpdateOrganizationConfigurationOutput": "UPDATE_ORGANIZATION_CONFIGURATION_OUTPUT", + "UpdateProtectedResource": "UPDATE_PROTECTED_RESOURCE", + "UpdatePublishingDestinationInput": "UPDATE_PUBLISHING_DESTINATION_INPUT", + "UpdatePublishingDestinationOutput": "UPDATE_PUBLISHING_DESTINATION_OUTPUT", + "UpdateS3BucketResource": "UPDATE_S3_BUCKET_RESOURCE", + "UpdateThreatEntitySetInput": "UPDATE_THREAT_ENTITY_SET_INPUT", + "UpdateThreatEntitySetOutput": "UPDATE_THREAT_ENTITY_SET_OUTPUT", + "UpdateThreatIntelSetInput": "UPDATE_THREAT_INTEL_SET_INPUT", + "UpdateThreatIntelSetOutput": "UPDATE_THREAT_INTEL_SET_OUTPUT", + "UpdateTrustedEntitySetInput": "UPDATE_TRUSTED_ENTITY_SET_INPUT", + "UpdateTrustedEntitySetOutput": "UPDATE_TRUSTED_ENTITY_SET_OUTPUT", + "UsageAccountResult": "USAGE_ACCOUNT_RESULT", + "UsageCriteria": "USAGE_CRITERIA", + "UsageDataSourceResult": "USAGE_DATA_SOURCE_RESULT", + "UsageFeature": "USAGE_FEATURE", + "UsageFeatureResult": "USAGE_FEATURE_RESULT", + "UsageResourceResult": "USAGE_RESOURCE_RESULT", + "UsageStatistics": "USAGE_STATISTICS", + "UsageStatisticType": "USAGE_STATISTIC_TYPE", + "UsageTopAccountResult": "USAGE_TOP_ACCOUNT_RESULT", + "UsageTopAccountsResult": "USAGE_TOP_ACCOUNTS_RESULT", + "User": "USER", + "Volume": "VOLUME", + "VolumeDetail": "VOLUME_DETAIL", + "VolumeMount": "VOLUME_MOUNT", + "VpcConfig": "VPC_CONFIG", + }, + shape_names=frozenset( + { + "AcceptAdministratorInvitationInput", + "AcceptAdministratorInvitationOutput", + "AcceptInvitationInput", + "AcceptInvitationOutput", + "AccessControlList", + "AccessDeniedException", + "AccessKey", + "AccessKeyDetails", + "Account", + "AccountDetail", + "AccountFreeTrialInfo", + "AccountLevelPermissions", + "AccountStatistics", + "Action", + "Activity", + "ActivityType", + "Actor", + "ActorProcess", + "AdditionalInfo", + "AddonDetails", + "AdminAccount", + "AdminStatus", + "Administrator", + "AgentDetails", + "Anomaly", + "AnomalyObject", + "AnomalyUnusual", + "ApiCall", + "ArchiveFindingsInput", + "ArchiveFindingsOutput", + "AssociationDetail", + "AssociationMode", + "AssociationSummary", + "AutoEnableMembers", + "AutonomousSystem", + "AutoscalingAutoScalingGroup", + "AwsApiCallAction", + "BadRequestException", + "BedrockGuardrail", + "BedrockGuardrailDetails", + "BedrockGuardrailResource", + "BlockPublicAccess", + "BucketLevelPermissions", + "BucketPolicy", + "City", + "CloudDetails", + "CloudProvider", + "CloudTrailConfigurationResult", + "CloudformationStack", + "ClusterStatus", + "Condition", + "Confidence", + "ConfidenceLevel", + "ConflictException", + "Container", + "ContainerFindingResource", + "ContainerInstanceDetails", + "ContentPolicyFilter", + "ContentPolicyFilterAction", + "ContentPolicyFilterType", + "ContinuousScanDetails", + "Country", + "CoverageEc2InstanceDetails", + "CoverageEcsClusterDetails", + "CoverageEksClusterDetails", + "CoverageFilterCondition", + "CoverageFilterCriteria", + "CoverageFilterCriterion", + "CoverageFilterCriterionKey", + "CoverageResource", + "CoverageResourceDetails", + "CoverageSortCriteria", + "CoverageSortKey", + "CoverageStatistics", + "CoverageStatisticsType", + "CoverageStatus", + "CreateCustomDetectionRuleAssociationInput", + "CreateCustomDetectionRuleAssociationOutput", + "CreateCustomDetectionRuleOrgConfigurationInput", + "CreateCustomDetectionRuleOrgConfigurationOutput", + "CreateDetectorInput", + "CreateDetectorOutput", + "CreateFilterInput", + "CreateFilterOutput", + "CreateIPSetInput", + "CreateIPSetOutput", + "CreateInvestigationInput", + "CreateInvestigationOutput", + "CreateMalwareProtectionPlanInput", + "CreateMalwareProtectionPlanOutput", + "CreateMembersInput", + "CreateMembersOutput", + "CreateProtectedResource", + "CreatePublishingDestinationInput", + "CreatePublishingDestinationOutput", + "CreateS3BucketResource", + "CreateSampleFindingsInput", + "CreateSampleFindingsOutput", + "CreateThreatEntitySetInput", + "CreateThreatEntitySetOutput", + "CreateThreatIntelSetInput", + "CreateThreatIntelSetOutput", + "CreateTrustedEntitySetInput", + "CreateTrustedEntitySetOutput", + "CriterionKey", + "DNSLogsConfigurationResult", + "DataSource", + "DataSourceConfigurations", + "DataSourceConfigurationsResult", + "DataSourceFreeTrial", + "DataSourceStatus", + "DataSourcesFreeTrial", + "DateStatistics", + "DeclineInvitationsInput", + "DeclineInvitationsOutput", + "DefaultServerSideEncryption", + "DeleteCustomDetectionRuleAssociationInput", + "DeleteCustomDetectionRuleAssociationOutput", + "DeleteCustomDetectionRuleOrgConfigurationInput", + "DeleteCustomDetectionRuleOrgConfigurationOutput", + "DeleteDetectorInput", + "DeleteDetectorOutput", + "DeleteFilterInput", + "DeleteFilterOutput", + "DeleteIPSetInput", + "DeleteIPSetOutput", + "DeleteInvitationsInput", + "DeleteInvitationsOutput", + "DeleteMalwareProtectionPlanInput", + "DeleteMalwareProtectionPlanOutput", + "DeleteMembersInput", + "DeleteMembersOutput", + "DeletePublishingDestinationInput", + "DeletePublishingDestinationOutput", + "DeleteThreatEntitySetInput", + "DeleteThreatEntitySetOutput", + "DeleteThreatIntelSetInput", + "DeleteThreatIntelSetOutput", + "DeleteTrustedEntitySetInput", + "DeleteTrustedEntitySetOutput", + "DescribeMalwareScansInput", + "DescribeMalwareScansOutput", + "DescribeOrganizationConfigurationInput", + "DescribeOrganizationConfigurationOutput", + "DescribePublishingDestinationInput", + "DescribePublishingDestinationOutput", + "Destination", + "DestinationProperties", + "DestinationType", + "Detection", + "DetectionRuleConfigurationStatus", + "DetectionRuleDataSource", + "DetectionRuleFilter", + "DetectionRuleFilterCondition", + "DetectionRuleOrgConfiguration", + "DetectionRuleOrgConfigurationSummary", + "DetectionRuleSeverity", + "DetectionSource", + "DetectorAdditionalConfiguration", + "DetectorAdditionalConfigurationResult", + "DetectorFeature", + "DetectorFeatureConfiguration", + "DetectorFeatureConfigurationResult", + "DetectorFeatureResult", + "DetectorStatus", + "DisableOrganizationAdminAccountInput", + "DisableOrganizationAdminAccountOutput", + "DisassociateFromAdministratorAccountInput", + "DisassociateFromAdministratorAccountOutput", + "DisassociateFromMasterAccountInput", + "DisassociateFromMasterAccountOutput", + "DisassociateMembersInput", + "DisassociateMembersOutput", + "DnsRequestAction", + "DomainDetails", + "EbsSnapshot", + "EbsSnapshotDetails", + "EbsSnapshotPreservation", + "EbsVolumeDetails", + "EbsVolumeScanDetails", + "EbsVolumesResult", + "Ec2Image", + "Ec2ImageDetails", + "Ec2Instance", + "Ec2LaunchTemplate", + "Ec2NetworkInterface", + "Ec2Vpc", + "EcsCluster", + "EcsClusterDetails", + "EcsClusterStatus", + "EcsLaunchType", + "EcsTask", + "EcsTaskDetails", + "EksCluster", + "EksClusterDetails", + "EnableOrganizationAdminAccountInput", + "EnableOrganizationAdminAccountOutput", + "Evidence", + "FargateDetails", + "FeatureAdditionalConfiguration", + "FeatureStatus", + "Feedback", + "FilterAction", + "FilterCondition", + "FilterCriteria", + "FilterCriterion", + "FilterFieldName", + "Finding", + "FindingCriteria", + "FindingPublishingFrequency", + "FindingResourceType", + "FindingStatisticType", + "FindingStatistics", + "FindingTypeStatistics", + "FlowLogsConfigurationResult", + "FreeTrialFeatureConfigurationResult", + "FreeTrialFeatureResult", + "GeoLocation", + "GetAdministratorAccountInput", + "GetAdministratorAccountOutput", + "GetCoverageStatisticsInput", + "GetCoverageStatisticsOutput", + "GetCustomDetectionRuleAssociationInput", + "GetCustomDetectionRuleAssociationOutput", + "GetCustomDetectionRuleInput", + "GetCustomDetectionRuleOrgConfigurationInput", + "GetCustomDetectionRuleOrgConfigurationOutput", + "GetCustomDetectionRuleOutput", + "GetDetectorInput", + "GetDetectorOutput", + "GetFilterInput", + "GetFilterOutput", + "GetFindingsInput", + "GetFindingsOutput", + "GetFindingsStatisticsInput", + "GetFindingsStatisticsOutput", + "GetIPSetInput", + "GetIPSetOutput", + "GetInvestigationInput", + "GetInvestigationOutput", + "GetInvitationsCountInput", + "GetInvitationsCountOutput", + "GetMalwareProtectionPlanInput", + "GetMalwareProtectionPlanOutput", + "GetMalwareScanInput", + "GetMalwareScanOutput", + "GetMalwareScanResultDetails", + "GetMalwareScanSettingsInput", + "GetMalwareScanSettingsOutput", + "GetMasterAccountInput", + "GetMasterAccountOutput", + "GetMemberDetectorsInput", + "GetMemberDetectorsOutput", + "GetMembersInput", + "GetMembersOutput", + "GetOrganizationStatisticsInput", + "GetOrganizationStatisticsOutput", + "GetRemainingFreeTrialDaysInput", + "GetRemainingFreeTrialDaysOutput", + "GetThreatEntitySetInput", + "GetThreatEntitySetOutput", + "GetThreatIntelSetInput", + "GetThreatIntelSetOutput", + "GetTrustedEntitySetInput", + "GetTrustedEntitySetOutput", + "GetUsageStatisticsInput", + "GetUsageStatisticsOutput", + "GroupByType", + "GuardrailAction", + "GuardrailSource", + "HighestSeverityThreatDetails", + "HostPath", + "IamInstanceProfile", + "IamInstanceProfileV2", + "ImpersonatedUser", + "IncrementalScanDetails", + "Indicator", + "IndicatorType", + "InstanceDetails", + "InternalServerErrorException", + "Investigation", + "InvestigationMetadata", + "InvestigationSortCriteria", + "InvestigationSortField", + "InvestigationStatus", + "InvestigationSummary", + "Invitation", + "InviteMembersInput", + "InviteMembersOutput", + "IpSetFormat", + "IpSetStatus", + "ItemDetails", + "ItemPath", + "KubernetesApiCallAction", + "KubernetesAuditLogsConfiguration", + "KubernetesAuditLogsConfigurationResult", + "KubernetesConfiguration", + "KubernetesConfigurationResult", + "KubernetesDataSourceFreeTrial", + "KubernetesDetails", + "KubernetesPermissionCheckedDetails", + "KubernetesResourcesTypes", + "KubernetesRoleBindingDetails", + "KubernetesRoleDetails", + "KubernetesUserDetails", + "KubernetesWorkload", + "KubernetesWorkloadDetails", + "LambdaDetails", + "LineageObject", + "ListCoverageInput", + "ListCoverageOutput", + "ListCustomDetectionRuleAssociationsInput", + "ListCustomDetectionRuleAssociationsOutput", + "ListCustomDetectionRuleOrgConfigurationsInput", + "ListCustomDetectionRuleOrgConfigurationsOutput", + "ListCustomDetectionRulesInput", + "ListCustomDetectionRulesOutput", + "ListDetectorsInput", + "ListDetectorsOutput", + "ListFiltersInput", + "ListFiltersOutput", + "ListFindingsInput", + "ListFindingsOutput", + "ListIPSetsInput", + "ListIPSetsOutput", + "ListInvestigationsInput", + "ListInvestigationsOutput", + "ListInvitationsInput", + "ListInvitationsOutput", + "ListMalwareProtectionPlansInput", + "ListMalwareProtectionPlansOutput", + "ListMalwareScansCriterionKey", + "ListMalwareScansFilterCriteria", + "ListMalwareScansFilterCriterion", + "ListMalwareScansInput", + "ListMalwareScansOutput", + "ListMembersInput", + "ListMembersOutput", + "ListOrganizationAdminAccountsInput", + "ListOrganizationAdminAccountsOutput", + "ListPublishingDestinationsInput", + "ListPublishingDestinationsOutput", + "ListTagsForResourceInput", + "ListTagsForResourceOutput", + "ListThreatEntitySetsInput", + "ListThreatEntitySetsOutput", + "ListThreatIntelSetsInput", + "ListThreatIntelSetsOutput", + "ListTrustedEntitySetsInput", + "ListTrustedEntitySetsOutput", + "LocalIpDetails", + "LocalPortDetails", + "LoginAttribute", + "MalwareProtectionConfiguration", + "MalwareProtectionConfigurationResult", + "MalwareProtectionDataSourceFreeTrial", + "MalwareProtectionFindingsScanConfiguration", + "MalwareProtectionPlanActions", + "MalwareProtectionPlanStatus", + "MalwareProtectionPlanStatusReason", + "MalwareProtectionPlanSummary", + "MalwareProtectionPlanTaggingAction", + "MalwareProtectionPlanTaggingActionStatus", + "MalwareProtectionResourceType", + "MalwareProtectionScanStatus", + "MalwareProtectionScanType", + "MalwareScan", + "MalwareScanDetails", + "ManagedBy", + "ManagementType", + "Master", + "Member", + "MemberAdditionalConfiguration", + "MemberAdditionalConfigurationResult", + "MemberDataSourceConfiguration", + "MemberFeaturesConfiguration", + "MemberFeaturesConfigurationResult", + "MfaStatus", + "ModelDetail", + "NetworkConnection", + "NetworkConnectionAction", + "NetworkDirection", + "NetworkEndpoint", + "NetworkGeoLocation", + "NetworkInterface", + "Observations", + "OrderBy", + "OrgFeature", + "OrgFeatureAdditionalConfiguration", + "OrgFeatureStatus", + "Organization", + "OrganizationAdditionalConfiguration", + "OrganizationAdditionalConfigurationResult", + "OrganizationDataSourceConfigurations", + "OrganizationDataSourceConfigurationsResult", + "OrganizationDetails", + "OrganizationEbsVolumes", + "OrganizationEbsVolumesResult", + "OrganizationFeatureConfiguration", + "OrganizationFeatureConfigurationResult", + "OrganizationFeatureStatistics", + "OrganizationFeatureStatisticsAdditionalConfiguration", + "OrganizationKubernetesAuditLogsConfiguration", + "OrganizationKubernetesAuditLogsConfigurationResult", + "OrganizationKubernetesConfiguration", + "OrganizationKubernetesConfigurationResult", + "OrganizationMalwareProtectionConfiguration", + "OrganizationMalwareProtectionConfigurationResult", + "OrganizationS3LogsConfiguration", + "OrganizationS3LogsConfigurationResult", + "OrganizationScanEc2InstanceWithFindings", + "OrganizationScanEc2InstanceWithFindingsResult", + "OrganizationStatistics", + "Owner", + "PermissionConfiguration", + "PortProbeAction", + "PortProbeDetail", + "PrivateIpAddressDetails", + "ProcessDetails", + "Product", + "ProductCode", + "ProfileSubtype", + "ProfileType", + "PublicAccess", + "PublicAccessConfiguration", + "PublicAccessStatus", + "PublicAclIgnoreBehavior", + "PublicBucketRestrictBehavior", + "PublishingStatus", + "RdsDbInstanceDetails", + "RdsDbUserDetails", + "RdsLimitlessDbDetails", + "RdsLoginAttemptAction", + "RecoveryPoint", + "RecoveryPointDetails", + "RemoteAccountDetails", + "RemoteIpDetails", + "RemotePortDetails", + "Resource", + "ResourceData", + "ResourceDetails", + "ResourceNotFoundException", + "ResourceStatistics", + "ResourceType", + "ResourceV2", + "RiskLevel", + "RuleDefinition", + "RuleDetail", + "RuleLanguage", + "RuleSchema", + "RuleSummary", + "RuntimeContext", + "RuntimeDetails", + "S3Bucket", + "S3BucketDetail", + "S3LogsConfiguration", + "S3LogsConfigurationResult", + "S3Object", + "S3ObjectDetail", + "S3ObjectForSendObjectMalwareScan", + "Scan", + "ScanCategory", + "ScanCondition", + "ScanConditionPair", + "ScanConfiguration", + "ScanConfigurationContinuousScanDetails", + "ScanConfigurationRecoveryPoint", + "ScanCriterionKey", + "ScanDetections", + "ScanEc2InstanceWithFindings", + "ScanEc2InstanceWithFindingsResult", + "ScanFilePath", + "ScanResourceCriteria", + "ScanResult", + "ScanResultDetails", + "ScanResultStatus", + "ScanResultThreat", + "ScanStatus", + "ScanStatusReason", + "ScanThreatName", + "ScanType", + "ScannedItemCount", + "ScannedResource", + "ScannedResourceDetails", + "SecurityContext", + "SecurityGroup", + "SendObjectMalwareScanInput", + "SendObjectMalwareScanOutput", + "Sequence", + "Service", + "ServiceAdditionalInfo", + "Session", + "SeverityStatistics", + "Signal", + "SignalType", + "SortCriteria", + "StartMalwareScanConfiguration", + "StartMalwareScanInput", + "StartMalwareScanOutput", + "StartMonitoringMembersInput", + "StartMonitoringMembersOutput", + "StopMonitoringMembersInput", + "StopMonitoringMembersOutput", + "Tag", + "TagResourceInput", + "TagResourceOutput", + "Threat", + "ThreatDetectedByName", + "ThreatEntitySetFormat", + "ThreatEntitySetStatus", + "ThreatIntelSetFormat", + "ThreatIntelSetStatus", + "ThreatIntelligenceDetail", + "ThreatsDetectedItemCount", + "Total", + "TriggerDetails", + "TriggerType", + "TrustedEntitySetFormat", + "TrustedEntitySetStatus", + "UnarchiveFindingsInput", + "UnarchiveFindingsOutput", + "UnprocessedAccount", + "UnprocessedDataSourcesResult", + "UntagResourceInput", + "UntagResourceOutput", + "UpdateCustomDetectionRuleAssociationInput", + "UpdateCustomDetectionRuleAssociationOutput", + "UpdateCustomDetectionRuleOrgConfigurationInput", + "UpdateCustomDetectionRuleOrgConfigurationOutput", + "UpdateDetectorInput", + "UpdateDetectorOutput", + "UpdateFilterInput", + "UpdateFilterOutput", + "UpdateFindingsFeedbackInput", + "UpdateFindingsFeedbackOutput", + "UpdateIPSetInput", + "UpdateIPSetOutput", + "UpdateMalwareProtectionPlanInput", + "UpdateMalwareProtectionPlanOutput", + "UpdateMalwareScanSettingsInput", + "UpdateMalwareScanSettingsOutput", + "UpdateMemberDetectorsInput", + "UpdateMemberDetectorsOutput", + "UpdateOrganizationConfigurationInput", + "UpdateOrganizationConfigurationOutput", + "UpdateProtectedResource", + "UpdatePublishingDestinationInput", + "UpdatePublishingDestinationOutput", + "UpdateS3BucketResource", + "UpdateThreatEntitySetInput", + "UpdateThreatEntitySetOutput", + "UpdateThreatIntelSetInput", + "UpdateThreatIntelSetOutput", + "UpdateTrustedEntitySetInput", + "UpdateTrustedEntitySetOutput", + "UsageAccountResult", + "UsageCriteria", + "UsageDataSourceResult", + "UsageFeature", + "UsageFeatureResult", + "UsageResourceResult", + "UsageStatisticType", + "UsageStatistics", + "UsageTopAccountResult", + "UsageTopAccountsResult", + "User", + "Volume", + "VolumeDetail", + "VolumeMount", + "VpcConfig", + } + ), + service_error="ServiceError", +) + + +def __getattr__(name: str): + return _registry.build(name) + + +ACCEPT_ADMINISTRATOR_INVITATION: APIOperation[ + AcceptAdministratorInvitationInput, AcceptAdministratorInvitationOutput +] = APIOperation( + static_schema=_SCHEMA_ACCEPT_ADMINISTRATOR_INVITATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +ACCEPT_INVITATION: APIOperation[AcceptInvitationInput, AcceptInvitationOutput] = ( + APIOperation( + static_schema=_SCHEMA_ACCEPT_INVITATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +ARCHIVE_FINDINGS: APIOperation[ArchiveFindingsInput, ArchiveFindingsOutput] = ( + APIOperation( + static_schema=_SCHEMA_ARCHIVE_FINDINGS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +CREATE_CUSTOM_DETECTION_RULE_ASSOCIATION: APIOperation[ + CreateCustomDetectionRuleAssociationInput, + CreateCustomDetectionRuleAssociationOutput, +] = APIOperation( + static_schema=_SCHEMA_CREATE_CUSTOM_DETECTION_RULE_ASSOCIATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#AccessDeniedException"), + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#ConflictException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ShapeID("com.amazonaws.guardduty#ResourceNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - administrator_id: str | None = None - """ - The account ID of the GuardDuty administrator account whose invitation - you're accepting. - """ +CREATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION: APIOperation[ + CreateCustomDetectionRuleOrgConfigurationInput, + CreateCustomDetectionRuleOrgConfigurationOutput, +] = APIOperation( + static_schema=_SCHEMA_CREATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#AccessDeniedException"), + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#ConflictException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ShapeID("com.amazonaws.guardduty#ResourceNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - invitation_id: str | None = None - """ - The value that is used to validate the administrator account to the - member account. - """ +CREATE_DETECTOR: APIOperation[CreateDetectorInput, CreateDetectorOutput] = APIOperation( + static_schema=_SCHEMA_CREATE_DETECTOR, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACCEPT_ADMINISTRATOR_INVITATION_INPUT, self) +CREATE_FILTER: APIOperation[CreateFilterInput, CreateFilterOutput] = APIOperation( + static_schema=_SCHEMA_CREATE_FILTER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_ACCEPT_ADMINISTRATOR_INVITATION_INPUT.members["DetectorId"], - self.detector_id, - ) +CREATE_INVESTIGATION: APIOperation[ + CreateInvestigationInput, CreateInvestigationOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_INVESTIGATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#AccessDeniedException"), + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - if self.administrator_id is not None: - serializer.write_string( - _SCHEMA_ACCEPT_ADMINISTRATOR_INVITATION_INPUT.members[ - "AdministratorId" - ], - self.administrator_id, - ) +CREATE_IP_SET: APIOperation[CreateIPSetInput, CreateIPSetOutput] = APIOperation( + static_schema=_SCHEMA_CREATE_IP_SET, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#AccessDeniedException"), + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - if self.invitation_id is not None: - serializer.write_string( - _SCHEMA_ACCEPT_ADMINISTRATOR_INVITATION_INPUT.members["InvitationId"], - self.invitation_id, - ) +CREATE_MALWARE_PROTECTION_PLAN: APIOperation[ + CreateMalwareProtectionPlanInput, CreateMalwareProtectionPlanOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_MALWARE_PROTECTION_PLAN, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#AccessDeniedException"), + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#ConflictException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) +CREATE_MEMBERS: APIOperation[CreateMembersInput, CreateMembersOutput] = APIOperation( + static_schema=_SCHEMA_CREATE_MEMBERS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +CREATE_PUBLISHING_DESTINATION: APIOperation[ + CreatePublishingDestinationInput, CreatePublishingDestinationOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_PUBLISHING_DESTINATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_ACCEPT_ADMINISTRATOR_INVITATION_INPUT.members[ - "DetectorId" - ] - ) +CREATE_SAMPLE_FINDINGS: APIOperation[ + CreateSampleFindingsInput, CreateSampleFindingsOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_SAMPLE_FINDINGS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 1: - kwargs["administrator_id"] = de.read_string( - _SCHEMA_ACCEPT_ADMINISTRATOR_INVITATION_INPUT.members[ - "AdministratorId" - ] - ) +CREATE_THREAT_ENTITY_SET: APIOperation[ + CreateThreatEntitySetInput, CreateThreatEntitySetOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_THREAT_ENTITY_SET, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 2: - kwargs["invitation_id"] = de.read_string( - _SCHEMA_ACCEPT_ADMINISTRATOR_INVITATION_INPUT.members[ - "InvitationId" - ] - ) +CREATE_THREAT_INTEL_SET: APIOperation[ + CreateThreatIntelSetInput, CreateThreatIntelSetOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_THREAT_INTEL_SET, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#AccessDeniedException"), + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case _: - logger.debug("Unexpected member schema: %s", schema) +CREATE_TRUSTED_ENTITY_SET: APIOperation[ + CreateTrustedEntitySetInput, CreateTrustedEntitySetOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_TRUSTED_ENTITY_SET, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - deserializer.read_struct( - _SCHEMA_ACCEPT_ADMINISTRATOR_INVITATION_INPUT, consumer=_consumer - ) - return kwargs +DECLINE_INVITATIONS: APIOperation[DeclineInvitationsInput, DeclineInvitationsOutput] = ( + APIOperation( + static_schema=_SCHEMA_DECLINE_INVITATIONS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) +DELETE_CUSTOM_DETECTION_RULE_ASSOCIATION: APIOperation[ + DeleteCustomDetectionRuleAssociationInput, + DeleteCustomDetectionRuleAssociationOutput, +] = APIOperation( + static_schema=_SCHEMA_DELETE_CUSTOM_DETECTION_RULE_ASSOCIATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#AccessDeniedException"), + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ShapeID("com.amazonaws.guardduty#ResourceNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -@dataclass(kw_only=True) -class AcceptAdministratorInvitationOutput: - """Dataclass for AcceptAdministratorInvitationOutput structure.""" +DELETE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION: APIOperation[ + DeleteCustomDetectionRuleOrgConfigurationInput, + DeleteCustomDetectionRuleOrgConfigurationOutput, +] = APIOperation( + static_schema=_SCHEMA_DELETE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#AccessDeniedException"), + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#ConflictException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ShapeID("com.amazonaws.guardduty#ResourceNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ +DELETE_DETECTOR: APIOperation[DeleteDetectorInput, DeleteDetectorOutput] = APIOperation( + static_schema=_SCHEMA_DELETE_DETECTOR, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACCEPT_ADMINISTRATOR_INVITATION_OUTPUT, self) +DELETE_FILTER: APIOperation[DeleteFilterInput, DeleteFilterOutput] = APIOperation( + static_schema=_SCHEMA_DELETE_FILTER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize_members(self, serializer: ShapeSerializer): - pass +DELETE_INVITATIONS: APIOperation[DeleteInvitationsInput, DeleteInvitationsOutput] = ( + APIOperation( + static_schema=_SCHEMA_DELETE_INVITATIONS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) +DELETE_IP_SET: APIOperation[DeleteIPSetInput, DeleteIPSetOutput] = APIOperation( + static_schema=_SCHEMA_DELETE_IP_SET, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +DELETE_MALWARE_PROTECTION_PLAN: APIOperation[ + DeleteMalwareProtectionPlanInput, DeleteMalwareProtectionPlanOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_MALWARE_PROTECTION_PLAN, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#AccessDeniedException"), + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ShapeID("com.amazonaws.guardduty#ResourceNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) +DELETE_MEMBERS: APIOperation[DeleteMembersInput, DeleteMembersOutput] = APIOperation( + static_schema=_SCHEMA_DELETE_MEMBERS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - deserializer.read_struct( - _SCHEMA_ACCEPT_ADMINISTRATOR_INVITATION_OUTPUT, consumer=_consumer - ) - return kwargs +DELETE_PUBLISHING_DESTINATION: APIOperation[ + DeletePublishingDestinationInput, DeletePublishingDestinationOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_PUBLISHING_DESTINATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +DELETE_THREAT_ENTITY_SET: APIOperation[ + DeleteThreatEntitySetInput, DeleteThreatEntitySetOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_THREAT_ENTITY_SET, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -@dataclass(kw_only=True) -class BadRequestException(ServiceError): - """A bad request exception object.""" +DELETE_THREAT_INTEL_SET: APIOperation[ + DeleteThreatIntelSetInput, DeleteThreatIntelSetOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_THREAT_INTEL_SET, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - fault: Literal["client", "server"] | None = "client" +DELETE_TRUSTED_ENTITY_SET: APIOperation[ + DeleteTrustedEntitySetInput, DeleteTrustedEntitySetOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_TRUSTED_ENTITY_SET, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - type: str | None = None - """The error type.""" +DESCRIBE_MALWARE_SCANS: APIOperation[ + DescribeMalwareScansInput, DescribeMalwareScansOutput +] = APIOperation( + static_schema=_SCHEMA_DESCRIBE_MALWARE_SCANS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BAD_REQUEST_EXCEPTION, self) +DESCRIBE_ORGANIZATION_CONFIGURATION: APIOperation[ + DescribeOrganizationConfigurationInput, DescribeOrganizationConfigurationOutput +] = APIOperation( + static_schema=_SCHEMA_DESCRIBE_ORGANIZATION_CONFIGURATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_BAD_REQUEST_EXCEPTION.members["Message"], self.message - ) +DESCRIBE_PUBLISHING_DESTINATION: APIOperation[ + DescribePublishingDestinationInput, DescribePublishingDestinationOutput +] = APIOperation( + static_schema=_SCHEMA_DESCRIBE_PUBLISHING_DESTINATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - if self.type is not None: - serializer.write_string( - _SCHEMA_BAD_REQUEST_EXCEPTION.members["Type"], self.type - ) +DISABLE_ORGANIZATION_ADMIN_ACCOUNT: APIOperation[ + DisableOrganizationAdminAccountInput, DisableOrganizationAdminAccountOutput +] = APIOperation( + static_schema=_SCHEMA_DISABLE_ORGANIZATION_ADMIN_ACCOUNT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) +DISASSOCIATE_FROM_ADMINISTRATOR_ACCOUNT: APIOperation[ + DisassociateFromAdministratorAccountInput, + DisassociateFromAdministratorAccountOutput, +] = APIOperation( + static_schema=_SCHEMA_DISASSOCIATE_FROM_ADMINISTRATOR_ACCOUNT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +DISASSOCIATE_FROM_MASTER_ACCOUNT: APIOperation[ + DisassociateFromMasterAccountInput, DisassociateFromMasterAccountOutput +] = APIOperation( + static_schema=_SCHEMA_DISASSOCIATE_FROM_MASTER_ACCOUNT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_BAD_REQUEST_EXCEPTION.members["Message"] - ) +DISASSOCIATE_MEMBERS: APIOperation[ + DisassociateMembersInput, DisassociateMembersOutput +] = APIOperation( + static_schema=_SCHEMA_DISASSOCIATE_MEMBERS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 1: - kwargs["type"] = de.read_string( - _SCHEMA_BAD_REQUEST_EXCEPTION.members["Type"] - ) +ENABLE_ORGANIZATION_ADMIN_ACCOUNT: APIOperation[ + EnableOrganizationAdminAccountInput, EnableOrganizationAdminAccountOutput +] = APIOperation( + static_schema=_SCHEMA_ENABLE_ORGANIZATION_ADMIN_ACCOUNT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case _: - logger.debug("Unexpected member schema: %s", schema) +GET_ADMINISTRATOR_ACCOUNT: APIOperation[ + GetAdministratorAccountInput, GetAdministratorAccountOutput +] = APIOperation( + static_schema=_SCHEMA_GET_ADMINISTRATOR_ACCOUNT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - deserializer.read_struct(_SCHEMA_BAD_REQUEST_EXCEPTION, consumer=_consumer) - return kwargs +GET_COVERAGE_STATISTICS: APIOperation[ + GetCoverageStatisticsInput, GetCoverageStatisticsOutput +] = APIOperation( + static_schema=_SCHEMA_GET_COVERAGE_STATISTICS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +GET_CUSTOM_DETECTION_RULE: APIOperation[ + GetCustomDetectionRuleInput, GetCustomDetectionRuleOutput +] = APIOperation( + static_schema=_SCHEMA_GET_CUSTOM_DETECTION_RULE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#AccessDeniedException"), + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ShapeID("com.amazonaws.guardduty#ResourceNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -@dataclass(kw_only=True) -class InternalServerErrorException(ServiceError): - """An internal server error exception object.""" +GET_CUSTOM_DETECTION_RULE_ASSOCIATION: APIOperation[ + GetCustomDetectionRuleAssociationInput, GetCustomDetectionRuleAssociationOutput +] = APIOperation( + static_schema=_SCHEMA_GET_CUSTOM_DETECTION_RULE_ASSOCIATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#AccessDeniedException"), + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ShapeID("com.amazonaws.guardduty#ResourceNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - fault: Literal["client", "server"] | None = "server" +GET_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION: APIOperation[ + GetCustomDetectionRuleOrgConfigurationInput, + GetCustomDetectionRuleOrgConfigurationOutput, +] = APIOperation( + static_schema=_SCHEMA_GET_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#AccessDeniedException"), + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ShapeID("com.amazonaws.guardduty#ResourceNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - type: str | None = None - """The error type.""" +GET_DETECTOR: APIOperation[GetDetectorInput, GetDetectorOutput] = APIOperation( + static_schema=_SCHEMA_GET_DETECTOR, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, self) +GET_FILTER: APIOperation[GetFilterInput, GetFilterOutput] = APIOperation( + static_schema=_SCHEMA_GET_FILTER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION.members["Message"], self.message - ) +GET_FINDINGS: APIOperation[GetFindingsInput, GetFindingsOutput] = APIOperation( + static_schema=_SCHEMA_GET_FINDINGS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - if self.type is not None: - serializer.write_string( - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION.members["Type"], self.type - ) +GET_FINDINGS_STATISTICS: APIOperation[ + GetFindingsStatisticsInput, GetFindingsStatisticsOutput +] = APIOperation( + static_schema=_SCHEMA_GET_FINDINGS_STATISTICS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) +GET_INVESTIGATION: APIOperation[GetInvestigationInput, GetInvestigationOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_INVESTIGATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#AccessDeniedException"), + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ShapeID("com.amazonaws.guardduty#ResourceNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +GET_INVITATIONS_COUNT: APIOperation[ + GetInvitationsCountInput, GetInvitationsCountOutput +] = APIOperation( + static_schema=_SCHEMA_GET_INVITATIONS_COUNT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION.members["Message"] - ) +GET_IP_SET: APIOperation[GetIPSetInput, GetIPSetOutput] = APIOperation( + static_schema=_SCHEMA_GET_IP_SET, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 1: - kwargs["type"] = de.read_string( - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION.members["Type"] - ) +GET_MALWARE_PROTECTION_PLAN: APIOperation[ + GetMalwareProtectionPlanInput, GetMalwareProtectionPlanOutput +] = APIOperation( + static_schema=_SCHEMA_GET_MALWARE_PROTECTION_PLAN, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#AccessDeniedException"), + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ShapeID("com.amazonaws.guardduty#ResourceNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case _: - logger.debug("Unexpected member schema: %s", schema) +GET_MALWARE_SCAN: APIOperation[GetMalwareScanInput, GetMalwareScanOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_MALWARE_SCAN, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ShapeID("com.amazonaws.guardduty#ResourceNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - deserializer.read_struct( - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, consumer=_consumer - ) - return kwargs +GET_MALWARE_SCAN_SETTINGS: APIOperation[ + GetMalwareScanSettingsInput, GetMalwareScanSettingsOutput +] = APIOperation( + static_schema=_SCHEMA_GET_MALWARE_SCAN_SETTINGS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +GET_MASTER_ACCOUNT: APIOperation[GetMasterAccountInput, GetMasterAccountOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_MASTER_ACCOUNT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) -ACCEPT_ADMINISTRATOR_INVITATION = APIOperation( - input=AcceptAdministratorInvitationInput, - output=AcceptAdministratorInvitationOutput, - schema=_SCHEMA_ACCEPT_ADMINISTRATOR_INVITATION, - input_schema=_SCHEMA_ACCEPT_ADMINISTRATOR_INVITATION_INPUT, - output_schema=_SCHEMA_ACCEPT_ADMINISTRATOR_INVITATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, +GET_MEMBER_DETECTORS: APIOperation[ + GetMemberDetectorsInput, GetMemberDetectorsOutput +] = APIOperation( + static_schema=_SCHEMA_GET_MEMBER_DETECTORS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) +GET_MEMBERS: APIOperation[GetMembersInput, GetMembersOutput] = APIOperation( + static_schema=_SCHEMA_GET_MEMBERS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -@dataclass(kw_only=True) -class AcceptInvitationInput: - """Dataclass for AcceptInvitationInput structure.""" +GET_ORGANIZATION_STATISTICS: APIOperation[ + GetOrganizationStatisticsInput, GetOrganizationStatisticsOutput +] = APIOperation( + static_schema=_SCHEMA_GET_ORGANIZATION_STATISTICS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - detector_id: str | None = None - """ - The unique ID of the detector of the GuardDuty member account. +GET_REMAINING_FREE_TRIAL_DAYS: APIOperation[ + GetRemainingFreeTrialDaysInput, GetRemainingFreeTrialDaysOutput +] = APIOperation( + static_schema=_SCHEMA_GET_REMAINING_FREE_TRIAL_DAYS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ +GET_THREAT_ENTITY_SET: APIOperation[ + GetThreatEntitySetInput, GetThreatEntitySetOutput +] = APIOperation( + static_schema=_SCHEMA_GET_THREAT_ENTITY_SET, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - master_id: str | None = None - """ - The account ID of the GuardDuty administrator account whose invitation - you're accepting. - """ +GET_THREAT_INTEL_SET: APIOperation[GetThreatIntelSetInput, GetThreatIntelSetOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_THREAT_INTEL_SET, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - invitation_id: str | None = None - """ - The value that is used to validate the administrator account to the - member account. - """ +GET_TRUSTED_ENTITY_SET: APIOperation[ + GetTrustedEntitySetInput, GetTrustedEntitySetOutput +] = APIOperation( + static_schema=_SCHEMA_GET_TRUSTED_ENTITY_SET, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACCEPT_INVITATION_INPUT, self) +GET_USAGE_STATISTICS: APIOperation[ + GetUsageStatisticsInput, GetUsageStatisticsOutput +] = APIOperation( + static_schema=_SCHEMA_GET_USAGE_STATISTICS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_ACCEPT_INVITATION_INPUT.members["DetectorId"], self.detector_id - ) +INVITE_MEMBERS: APIOperation[InviteMembersInput, InviteMembersOutput] = APIOperation( + static_schema=_SCHEMA_INVITE_MEMBERS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - if self.master_id is not None: - serializer.write_string( - _SCHEMA_ACCEPT_INVITATION_INPUT.members["MasterId"], self.master_id - ) +LIST_COVERAGE: APIOperation[ListCoverageInput, ListCoverageOutput] = APIOperation( + static_schema=_SCHEMA_LIST_COVERAGE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - if self.invitation_id is not None: - serializer.write_string( - _SCHEMA_ACCEPT_INVITATION_INPUT.members["InvitationId"], - self.invitation_id, - ) +LIST_CUSTOM_DETECTION_RULE_ASSOCIATIONS: APIOperation[ + ListCustomDetectionRuleAssociationsInput, ListCustomDetectionRuleAssociationsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_CUSTOM_DETECTION_RULE_ASSOCIATIONS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#AccessDeniedException"), + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) +LIST_CUSTOM_DETECTION_RULE_ORG_CONFIGURATIONS: APIOperation[ + ListCustomDetectionRuleOrgConfigurationsInput, + ListCustomDetectionRuleOrgConfigurationsOutput, +] = APIOperation( + static_schema=_SCHEMA_LIST_CUSTOM_DETECTION_RULE_ORG_CONFIGURATIONS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#AccessDeniedException"), + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +LIST_CUSTOM_DETECTION_RULES: APIOperation[ + ListCustomDetectionRulesInput, ListCustomDetectionRulesOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_CUSTOM_DETECTION_RULES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#AccessDeniedException"), + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_ACCEPT_INVITATION_INPUT.members["DetectorId"] - ) +LIST_DETECTORS: APIOperation[ListDetectorsInput, ListDetectorsOutput] = APIOperation( + static_schema=_SCHEMA_LIST_DETECTORS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 1: - kwargs["master_id"] = de.read_string( - _SCHEMA_ACCEPT_INVITATION_INPUT.members["MasterId"] - ) +LIST_FILTERS: APIOperation[ListFiltersInput, ListFiltersOutput] = APIOperation( + static_schema=_SCHEMA_LIST_FILTERS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 2: - kwargs["invitation_id"] = de.read_string( - _SCHEMA_ACCEPT_INVITATION_INPUT.members["InvitationId"] - ) +LIST_FINDINGS: APIOperation[ListFindingsInput, ListFindingsOutput] = APIOperation( + static_schema=_SCHEMA_LIST_FINDINGS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case _: - logger.debug("Unexpected member schema: %s", schema) +LIST_INVESTIGATIONS: APIOperation[ListInvestigationsInput, ListInvestigationsOutput] = ( + APIOperation( + static_schema=_SCHEMA_LIST_INVESTIGATIONS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#AccessDeniedException"), + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - deserializer.read_struct(_SCHEMA_ACCEPT_INVITATION_INPUT, consumer=_consumer) - return kwargs +LIST_INVITATIONS: APIOperation[ListInvitationsInput, ListInvitationsOutput] = ( + APIOperation( + static_schema=_SCHEMA_LIST_INVITATIONS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) +LIST_IP_SETS: APIOperation[ListIPSetsInput, ListIPSetsOutput] = APIOperation( + static_schema=_SCHEMA_LIST_IP_SETS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -@dataclass(kw_only=True) -class AcceptInvitationOutput: - """Dataclass for AcceptInvitationOutput structure.""" +LIST_MALWARE_PROTECTION_PLANS: APIOperation[ + ListMalwareProtectionPlansInput, ListMalwareProtectionPlansOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_MALWARE_PROTECTION_PLANS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#AccessDeniedException"), + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False +LIST_MALWARE_SCANS: APIOperation[ListMalwareScansInput, ListMalwareScansOutput] = ( + APIOperation( + static_schema=_SCHEMA_LIST_MALWARE_SCANS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACCEPT_INVITATION_OUTPUT, self) +) - def serialize_members(self, serializer: ShapeSerializer): - pass +LIST_MEMBERS: APIOperation[ListMembersInput, ListMembersOutput] = APIOperation( + static_schema=_SCHEMA_LIST_MEMBERS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) +LIST_ORGANIZATION_ADMIN_ACCOUNTS: APIOperation[ + ListOrganizationAdminAccountsInput, ListOrganizationAdminAccountsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_ORGANIZATION_ADMIN_ACCOUNTS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +LIST_PUBLISHING_DESTINATIONS: APIOperation[ + ListPublishingDestinationsInput, ListPublishingDestinationsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_PUBLISHING_DESTINATIONS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) +LIST_TAGS_FOR_RESOURCE: APIOperation[ + ListTagsForResourceInput, ListTagsForResourceOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_TAGS_FOR_RESOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#AccessDeniedException"), + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - deserializer.read_struct(_SCHEMA_ACCEPT_INVITATION_OUTPUT, consumer=_consumer) - return kwargs +LIST_THREAT_ENTITY_SETS: APIOperation[ + ListThreatEntitySetsInput, ListThreatEntitySetsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_THREAT_ENTITY_SETS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +LIST_THREAT_INTEL_SETS: APIOperation[ + ListThreatIntelSetsInput, ListThreatIntelSetsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_THREAT_INTEL_SETS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -ACCEPT_INVITATION = APIOperation( - input=AcceptInvitationInput, - output=AcceptInvitationOutput, - schema=_SCHEMA_ACCEPT_INVITATION, - input_schema=_SCHEMA_ACCEPT_INVITATION_INPUT, - output_schema=_SCHEMA_ACCEPT_INVITATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), +LIST_TRUSTED_ENTITY_SETS: APIOperation[ + ListTrustedEntitySetsInput, ListTrustedEntitySetsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_TRUSTED_ENTITY_SETS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, +) + +SEND_OBJECT_MALWARE_SCAN: APIOperation[ + SendObjectMalwareScanInput, SendObjectMalwareScanOutput +] = APIOperation( + static_schema=_SCHEMA_SEND_OBJECT_MALWARE_SCAN, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#AccessDeniedException"), + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) +START_MALWARE_SCAN: APIOperation[StartMalwareScanInput, StartMalwareScanOutput] = ( + APIOperation( + static_schema=_SCHEMA_START_MALWARE_SCAN, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#ConflictException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) -@dataclass(kw_only=True) -class AccessControlList: - """ - Contains information on the current access control policies for the - bucket. - """ +START_MONITORING_MEMBERS: APIOperation[ + StartMonitoringMembersInput, StartMonitoringMembersOutput +] = APIOperation( + static_schema=_SCHEMA_START_MONITORING_MEMBERS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - allows_public_read_access: bool | None = None - """ - A value that indicates whether public read access for the bucket is - enabled through an Access Control List (ACL). - """ - - allows_public_write_access: bool | None = None - """ - A value that indicates whether public write access for the bucket is - enabled through an Access Control List (ACL). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACCESS_CONTROL_LIST, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.allows_public_read_access is not None: - serializer.write_boolean( - _SCHEMA_ACCESS_CONTROL_LIST.members["AllowsPublicReadAccess"], - self.allows_public_read_access, - ) - - if self.allows_public_write_access is not None: - serializer.write_boolean( - _SCHEMA_ACCESS_CONTROL_LIST.members["AllowsPublicWriteAccess"], - self.allows_public_write_access, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["allows_public_read_access"] = de.read_boolean( - _SCHEMA_ACCESS_CONTROL_LIST.members["AllowsPublicReadAccess"] - ) - - case 1: - kwargs["allows_public_write_access"] = de.read_boolean( - _SCHEMA_ACCESS_CONTROL_LIST.members["AllowsPublicWriteAccess"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ACCESS_CONTROL_LIST, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class AccessDeniedException(ServiceError): - """An access denied exception object.""" - - fault: Literal["client", "server"] | None = "client" - - type: str | None = None - """The error type.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACCESS_DENIED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_ACCESS_DENIED_EXCEPTION.members["Message"], self.message - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_ACCESS_DENIED_EXCEPTION.members["Type"], self.type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_ACCESS_DENIED_EXCEPTION.members["Message"] - ) - - case 1: - kwargs["type"] = de.read_string( - _SCHEMA_ACCESS_DENIED_EXCEPTION.members["Type"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ACCESS_DENIED_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class AccessKey: - """Contains information about the access keys.""" - - principal_id: str | None = None - """Principal ID of the user.""" - - user_name: str | None = None - """Name of the user.""" - - user_type: str | None = None - """Type of the user.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACCESS_KEY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.principal_id is not None: - serializer.write_string( - _SCHEMA_ACCESS_KEY.members["PrincipalId"], self.principal_id - ) - - if self.user_name is not None: - serializer.write_string( - _SCHEMA_ACCESS_KEY.members["UserName"], self.user_name - ) - - if self.user_type is not None: - serializer.write_string( - _SCHEMA_ACCESS_KEY.members["UserType"], self.user_type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["principal_id"] = de.read_string( - _SCHEMA_ACCESS_KEY.members["PrincipalId"] - ) - - case 1: - kwargs["user_name"] = de.read_string( - _SCHEMA_ACCESS_KEY.members["UserName"] - ) - - case 2: - kwargs["user_type"] = de.read_string( - _SCHEMA_ACCESS_KEY.members["UserType"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ACCESS_KEY, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class AccessKeyDetails: - """Contains information about the access keys.""" - - access_key_id: str | None = None - """The access key ID of the user.""" - - principal_id: str | None = None - """The principal ID of the user.""" - - user_name: str | None = None - """The name of the user.""" - - user_type: str | None = None - """The type of the user.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACCESS_KEY_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.access_key_id is not None: - serializer.write_string( - _SCHEMA_ACCESS_KEY_DETAILS.members["AccessKeyId"], self.access_key_id - ) - - if self.principal_id is not None: - serializer.write_string( - _SCHEMA_ACCESS_KEY_DETAILS.members["PrincipalId"], self.principal_id - ) - - if self.user_name is not None: - serializer.write_string( - _SCHEMA_ACCESS_KEY_DETAILS.members["UserName"], self.user_name - ) - - if self.user_type is not None: - serializer.write_string( - _SCHEMA_ACCESS_KEY_DETAILS.members["UserType"], self.user_type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["access_key_id"] = de.read_string( - _SCHEMA_ACCESS_KEY_DETAILS.members["AccessKeyId"] - ) - - case 1: - kwargs["principal_id"] = de.read_string( - _SCHEMA_ACCESS_KEY_DETAILS.members["PrincipalId"] - ) - - case 2: - kwargs["user_name"] = de.read_string( - _SCHEMA_ACCESS_KEY_DETAILS.members["UserName"] - ) - - case 3: - kwargs["user_type"] = de.read_string( - _SCHEMA_ACCESS_KEY_DETAILS.members["UserType"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ACCESS_KEY_DETAILS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Account: - """ - Contains information about the Amazon Web Services account within which - the activity took place. - """ - - uid: str | None = None - """ - The Amazon Web Services account ID within which the activity took place. - This may differ from the account that owns the user identity. - """ - - name: str | None = None - """Name of the member's Amazon Web Services account.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACCOUNT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.uid is not None: - serializer.write_string(_SCHEMA_ACCOUNT.members["Uid"], self.uid) - - if self.name is not None: - serializer.write_string(_SCHEMA_ACCOUNT.members["Name"], self.name) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["uid"] = de.read_string(_SCHEMA_ACCOUNT.members["Uid"]) - - case 1: - kwargs["name"] = de.read_string(_SCHEMA_ACCOUNT.members["Name"]) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ACCOUNT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class AccountDetail: - """Contains information about the account.""" - - account_id: str | None = None - """The member account ID.""" - - email: str | None = field(repr=False, default=None) - """ - The email address of the member account. The following list includes the - rules for a valid email address: - - - The email address must be a minimum of 6 and a maximum of 64 - characters long. - - - All characters must be 7-bit ASCII characters. - - - There must be one and only one @ symbol, which separates the local - name from the domain name. - - - The local name can't contain any of the following characters: - - whitespace, \" ' ( ) < > [ ] : ' , \\ | % & - - - The local name can't begin with a dot (.). - - - The domain name can consist of only the characters [a-z], [A-Z], - [0-9], hyphen (-), or dot (.). - - - The domain name can't begin or end with a dot (.) or hyphen (-). - - - The domain name must contain at least one dot. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACCOUNT_DETAIL, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.account_id is not None: - serializer.write_string( - _SCHEMA_ACCOUNT_DETAIL.members["AccountId"], self.account_id - ) - - if self.email is not None: - serializer.write_string(_SCHEMA_ACCOUNT_DETAIL.members["Email"], self.email) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["account_id"] = de.read_string( - _SCHEMA_ACCOUNT_DETAIL.members["AccountId"] - ) - - case 1: - kwargs["email"] = de.read_string( - _SCHEMA_ACCOUNT_DETAIL.members["Email"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ACCOUNT_DETAIL, consumer=_consumer) - return kwargs - - -def _serialize_account_details( - serializer: ShapeSerializer, schema: Schema, value: list[AccountDetail] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_account_details( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AccountDetail]: - result: list[AccountDetail] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AccountDetail.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class DataSourceFreeTrial: - """ - Contains information about which data sources are enabled for the - GuardDuty member account. - """ - - free_trial_days_remaining: int | None = None - """ - A value that specifies the number of days left to use each enabled data - source. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DATA_SOURCE_FREE_TRIAL, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.free_trial_days_remaining is not None: - serializer.write_integer( - _SCHEMA_DATA_SOURCE_FREE_TRIAL.members["FreeTrialDaysRemaining"], - self.free_trial_days_remaining, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["free_trial_days_remaining"] = de.read_integer( - _SCHEMA_DATA_SOURCE_FREE_TRIAL.members["FreeTrialDaysRemaining"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DATA_SOURCE_FREE_TRIAL, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class KubernetesDataSourceFreeTrial: - """ - Provides details about the Kubernetes resources when it is enabled as a - data source. - """ - - audit_logs: DataSourceFreeTrial | None = None - """Describes whether Kubernetes audit logs are enabled as a data source.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KUBERNETES_DATA_SOURCE_FREE_TRIAL, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.audit_logs is not None: - serializer.write_struct( - _SCHEMA_KUBERNETES_DATA_SOURCE_FREE_TRIAL.members["AuditLogs"], - self.audit_logs, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["audit_logs"] = DataSourceFreeTrial.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_KUBERNETES_DATA_SOURCE_FREE_TRIAL, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class MalwareProtectionDataSourceFreeTrial: - """ - Provides details about Malware Protection when it is enabled as a data - source. - """ - - scan_ec2_instance_with_findings: DataSourceFreeTrial | None = None - """ - Describes whether Malware Protection for EC2 instances with findings is - enabled as a data source. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MALWARE_PROTECTION_DATA_SOURCE_FREE_TRIAL, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.scan_ec2_instance_with_findings is not None: - serializer.write_struct( - _SCHEMA_MALWARE_PROTECTION_DATA_SOURCE_FREE_TRIAL.members[ - "ScanEc2InstanceWithFindings" - ], - self.scan_ec2_instance_with_findings, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["scan_ec2_instance_with_findings"] = ( - DataSourceFreeTrial.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MALWARE_PROTECTION_DATA_SOURCE_FREE_TRIAL, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DataSourcesFreeTrial: - """ - Contains information about which data sources are enabled for the - GuardDuty member account. - """ - - cloud_trail: DataSourceFreeTrial | None = None - """ - Describes whether any Amazon Web Services CloudTrail management event - logs are enabled as data sources. - """ - - dns_logs: DataSourceFreeTrial | None = None - """Describes whether any DNS logs are enabled as data sources.""" - - flow_logs: DataSourceFreeTrial | None = None - """Describes whether any VPC Flow logs are enabled as data sources.""" - - s3_logs: DataSourceFreeTrial | None = None - """Describes whether any S3 data event logs are enabled as data sources.""" - - kubernetes: KubernetesDataSourceFreeTrial | None = None - """Describes whether any Kubernetes logs are enabled as data sources.""" - - malware_protection: MalwareProtectionDataSourceFreeTrial | None = None - """Describes whether Malware Protection is enabled as a data source.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DATA_SOURCES_FREE_TRIAL, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.cloud_trail is not None: - serializer.write_struct( - _SCHEMA_DATA_SOURCES_FREE_TRIAL.members["CloudTrail"], self.cloud_trail - ) - - if self.dns_logs is not None: - serializer.write_struct( - _SCHEMA_DATA_SOURCES_FREE_TRIAL.members["DnsLogs"], self.dns_logs - ) - - if self.flow_logs is not None: - serializer.write_struct( - _SCHEMA_DATA_SOURCES_FREE_TRIAL.members["FlowLogs"], self.flow_logs - ) - - if self.s3_logs is not None: - serializer.write_struct( - _SCHEMA_DATA_SOURCES_FREE_TRIAL.members["S3Logs"], self.s3_logs - ) - - if self.kubernetes is not None: - serializer.write_struct( - _SCHEMA_DATA_SOURCES_FREE_TRIAL.members["Kubernetes"], self.kubernetes - ) - - if self.malware_protection is not None: - serializer.write_struct( - _SCHEMA_DATA_SOURCES_FREE_TRIAL.members["MalwareProtection"], - self.malware_protection, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["cloud_trail"] = DataSourceFreeTrial.deserialize(de) - - case 1: - kwargs["dns_logs"] = DataSourceFreeTrial.deserialize(de) - - case 2: - kwargs["flow_logs"] = DataSourceFreeTrial.deserialize(de) - - case 3: - kwargs["s3_logs"] = DataSourceFreeTrial.deserialize(de) - - case 4: - kwargs["kubernetes"] = KubernetesDataSourceFreeTrial.deserialize(de) - - case 5: - kwargs["malware_protection"] = ( - MalwareProtectionDataSourceFreeTrial.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DATA_SOURCES_FREE_TRIAL, consumer=_consumer) - return kwargs - - -class FreeTrialFeatureResult(UnknownEnumMixin, StrEnum): - FLOW_LOGS = "FLOW_LOGS" - CLOUD_TRAIL = "CLOUD_TRAIL" - DNS_LOGS = "DNS_LOGS" - S3_DATA_EVENTS = "S3_DATA_EVENTS" - EKS_AUDIT_LOGS = "EKS_AUDIT_LOGS" - EBS_MALWARE_PROTECTION = "EBS_MALWARE_PROTECTION" - RDS_LOGIN_EVENTS = "RDS_LOGIN_EVENTS" - LAMBDA_NETWORK_LOGS = "LAMBDA_NETWORK_LOGS" - EKS_RUNTIME_MONITORING = "EKS_RUNTIME_MONITORING" - EC2_RUNTIME_MONITORING = "EC2_RUNTIME_MONITORING" - FARGATE_RUNTIME_MONITORING = "FARGATE_RUNTIME_MONITORING" - AI_PROTECTION = "AI_PROTECTION" - - -@dataclass(kw_only=True) -class FreeTrialFeatureConfigurationResult: - """Contains information about the free trial period for a feature.""" - - name: str | None = None - """The name of the feature for which the free trial is configured.""" - - free_trial_days_remaining: int | None = None - """The number of the remaining free trial days for the feature.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FREE_TRIAL_FEATURE_CONFIGURATION_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_FREE_TRIAL_FEATURE_CONFIGURATION_RESULT.members["Name"], - self.name, - ) - - if self.free_trial_days_remaining is not None: - serializer.write_integer( - _SCHEMA_FREE_TRIAL_FEATURE_CONFIGURATION_RESULT.members[ - "FreeTrialDaysRemaining" - ], - self.free_trial_days_remaining, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = FreeTrialFeatureResult( - de.read_string( - _SCHEMA_FREE_TRIAL_FEATURE_CONFIGURATION_RESULT.members[ - "Name" - ] - ) - ) - - case 1: - kwargs["free_trial_days_remaining"] = de.read_integer( - _SCHEMA_FREE_TRIAL_FEATURE_CONFIGURATION_RESULT.members[ - "FreeTrialDaysRemaining" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_FREE_TRIAL_FEATURE_CONFIGURATION_RESULT, consumer=_consumer - ) - return kwargs - - -def _serialize_free_trial_feature_configurations_results( - serializer: ShapeSerializer, - schema: Schema, - value: list[FreeTrialFeatureConfigurationResult], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_free_trial_feature_configurations_results( - deserializer: ShapeDeserializer, schema: Schema -) -> list[FreeTrialFeatureConfigurationResult]: - result: list[FreeTrialFeatureConfigurationResult] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(FreeTrialFeatureConfigurationResult.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AccountFreeTrialInfo: - """ - Provides details of the GuardDuty member account that uses a free trial - service. - """ - - account_id: str | None = None - """The account identifier of the GuardDuty member account.""" - - data_sources: DataSourcesFreeTrial | None = None - """Describes the data source enabled for the GuardDuty member account.""" - - features: list[FreeTrialFeatureConfigurationResult] | None = None - """A list of features enabled for the GuardDuty account.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACCOUNT_FREE_TRIAL_INFO, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.account_id is not None: - serializer.write_string( - _SCHEMA_ACCOUNT_FREE_TRIAL_INFO.members["AccountId"], self.account_id - ) - - if self.data_sources is not None: - serializer.write_struct( - _SCHEMA_ACCOUNT_FREE_TRIAL_INFO.members["DataSources"], - self.data_sources, - ) - - if self.features is not None: - _serialize_free_trial_feature_configurations_results( - serializer, - _SCHEMA_ACCOUNT_FREE_TRIAL_INFO.members["Features"], - self.features, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["account_id"] = de.read_string( - _SCHEMA_ACCOUNT_FREE_TRIAL_INFO.members["AccountId"] - ) - - case 1: - kwargs["data_sources"] = DataSourcesFreeTrial.deserialize(de) - - case 2: - kwargs["features"] = ( - _deserialize_free_trial_feature_configurations_results( - de, _SCHEMA_ACCOUNT_FREE_TRIAL_INFO.members["Features"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ACCOUNT_FREE_TRIAL_INFO, consumer=_consumer) - return kwargs - - -def _serialize_account_free_trial_infos( - serializer: ShapeSerializer, schema: Schema, value: list[AccountFreeTrialInfo] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_account_free_trial_infos( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AccountFreeTrialInfo]: - result: list[AccountFreeTrialInfo] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AccountFreeTrialInfo.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_account_ids( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_account_ids( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class BlockPublicAccess: - """ - Contains information on how the bucker owner's S3 Block Public Access - settings are being applied to the S3 bucket. See [S3 Block Public - Access](https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html) - for more information. - """ - - ignore_public_acls: bool | None = None - """Indicates if S3 Block Public Access is set to `IgnorePublicAcls`.""" - - restrict_public_buckets: bool | None = None - """Indicates if S3 Block Public Access is set to `RestrictPublicBuckets`.""" - - block_public_acls: bool | None = None - """Indicates if S3 Block Public Access is set to `BlockPublicAcls`.""" - - block_public_policy: bool | None = None - """Indicates if S3 Block Public Access is set to `BlockPublicPolicy`.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BLOCK_PUBLIC_ACCESS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.ignore_public_acls is not None: - serializer.write_boolean( - _SCHEMA_BLOCK_PUBLIC_ACCESS.members["IgnorePublicAcls"], - self.ignore_public_acls, - ) - - if self.restrict_public_buckets is not None: - serializer.write_boolean( - _SCHEMA_BLOCK_PUBLIC_ACCESS.members["RestrictPublicBuckets"], - self.restrict_public_buckets, - ) - - if self.block_public_acls is not None: - serializer.write_boolean( - _SCHEMA_BLOCK_PUBLIC_ACCESS.members["BlockPublicAcls"], - self.block_public_acls, - ) - - if self.block_public_policy is not None: - serializer.write_boolean( - _SCHEMA_BLOCK_PUBLIC_ACCESS.members["BlockPublicPolicy"], - self.block_public_policy, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["ignore_public_acls"] = de.read_boolean( - _SCHEMA_BLOCK_PUBLIC_ACCESS.members["IgnorePublicAcls"] - ) - - case 1: - kwargs["restrict_public_buckets"] = de.read_boolean( - _SCHEMA_BLOCK_PUBLIC_ACCESS.members["RestrictPublicBuckets"] - ) - - case 2: - kwargs["block_public_acls"] = de.read_boolean( - _SCHEMA_BLOCK_PUBLIC_ACCESS.members["BlockPublicAcls"] - ) - - case 3: - kwargs["block_public_policy"] = de.read_boolean( - _SCHEMA_BLOCK_PUBLIC_ACCESS.members["BlockPublicPolicy"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BLOCK_PUBLIC_ACCESS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class AccountLevelPermissions: - """ - Contains information about the account level permissions on the S3 - bucket. - """ - - block_public_access: BlockPublicAccess | None = None - """ - Describes the S3 Block Public Access settings of the bucket's parent - account. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACCOUNT_LEVEL_PERMISSIONS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.block_public_access is not None: - serializer.write_struct( - _SCHEMA_ACCOUNT_LEVEL_PERMISSIONS.members["BlockPublicAccess"], - self.block_public_access, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["block_public_access"] = BlockPublicAccess.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ACCOUNT_LEVEL_PERMISSIONS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class AccountStatistics: - """ - Represents a list of map of accounts with the number of findings - associated with each account. - """ - - account_id: str | None = None - """The ID of the Amazon Web Services account.""" - - last_generated_at: datetime | None = None - """The timestamp at which the finding for this account was last generated.""" - - total_findings: int | None = None - """The total number of findings associated with an account.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACCOUNT_STATISTICS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.account_id is not None: - serializer.write_string( - _SCHEMA_ACCOUNT_STATISTICS.members["AccountId"], self.account_id - ) - - if self.last_generated_at is not None: - serializer.write_timestamp( - _SCHEMA_ACCOUNT_STATISTICS.members["LastGeneratedAt"], - self.last_generated_at, - ) - - if self.total_findings is not None: - serializer.write_integer( - _SCHEMA_ACCOUNT_STATISTICS.members["TotalFindings"], self.total_findings - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["account_id"] = de.read_string( - _SCHEMA_ACCOUNT_STATISTICS.members["AccountId"] - ) - - case 1: - kwargs["last_generated_at"] = de.read_timestamp( - _SCHEMA_ACCOUNT_STATISTICS.members["LastGeneratedAt"] - ) - - case 2: - kwargs["total_findings"] = de.read_integer( - _SCHEMA_ACCOUNT_STATISTICS.members["TotalFindings"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ACCOUNT_STATISTICS, consumer=_consumer) - return kwargs - - -def _serialize_affected_resources( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_affected_resources( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class DomainDetails: - """Contains information about the domain.""" - - domain: str | None = None - """The domain information for the Amazon Web Services API call.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOMAIN_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.domain is not None: - serializer.write_string( - _SCHEMA_DOMAIN_DETAILS.members["Domain"], self.domain - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["domain"] = de.read_string( - _SCHEMA_DOMAIN_DETAILS.members["Domain"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DOMAIN_DETAILS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class RemoteAccountDetails: - """ - Contains details about the remote Amazon Web Services account that made - the API call. - """ - - account_id: str | None = None - """The Amazon Web Services account ID of the remote API caller.""" - - affiliated: bool | None = None - """ - Details on whether the Amazon Web Services account of the remote API - caller is related to your GuardDuty environment. If this value is `True` - the API caller is affiliated to your account in some way. If it is - `False` the API caller is from outside your environment. - """ - - aws_service_name: str | None = None - """ - If the remote account belongs to an Amazon Web Services service, this - field indicates which service the remote account belongs to. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REMOTE_ACCOUNT_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.account_id is not None: - serializer.write_string( - _SCHEMA_REMOTE_ACCOUNT_DETAILS.members["AccountId"], self.account_id - ) - - if self.affiliated is not None: - serializer.write_boolean( - _SCHEMA_REMOTE_ACCOUNT_DETAILS.members["Affiliated"], self.affiliated - ) - - if self.aws_service_name is not None: - serializer.write_string( - _SCHEMA_REMOTE_ACCOUNT_DETAILS.members["AwsServiceName"], - self.aws_service_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["account_id"] = de.read_string( - _SCHEMA_REMOTE_ACCOUNT_DETAILS.members["AccountId"] - ) - - case 1: - kwargs["affiliated"] = de.read_boolean( - _SCHEMA_REMOTE_ACCOUNT_DETAILS.members["Affiliated"] - ) - - case 2: - kwargs["aws_service_name"] = de.read_string( - _SCHEMA_REMOTE_ACCOUNT_DETAILS.members["AwsServiceName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_REMOTE_ACCOUNT_DETAILS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class City: - """Contains information about the city associated with the IP address.""" - - city_name: str | None = None - """The city name of the remote IP address.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CITY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.city_name is not None: - serializer.write_string(_SCHEMA_CITY.members["CityName"], self.city_name) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["city_name"] = de.read_string( - _SCHEMA_CITY.members["CityName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CITY, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Country: - """ - Contains information about the country where the remote IP address is - located. - """ - - country_code: str | None = None - """The country code of the remote IP address.""" - - country_name: str | None = None - """The country name of the remote IP address.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_COUNTRY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.country_code is not None: - serializer.write_string( - _SCHEMA_COUNTRY.members["CountryCode"], self.country_code - ) - - if self.country_name is not None: - serializer.write_string( - _SCHEMA_COUNTRY.members["CountryName"], self.country_name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["country_code"] = de.read_string( - _SCHEMA_COUNTRY.members["CountryCode"] - ) - - case 1: - kwargs["country_name"] = de.read_string( - _SCHEMA_COUNTRY.members["CountryName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_COUNTRY, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GeoLocation: - """ - Contains information about the location of the remote IP address. By - default, GuardDuty returns `Geolocation` with `Lat` and `Lon` as `0.0`. - """ - - lat: float | None = None - """The latitude information of the remote IP address.""" - - lon: float | None = None - """The longitude information of the remote IP address.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GEO_LOCATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.lat is not None: - serializer.write_double(_SCHEMA_GEO_LOCATION.members["Lat"], self.lat) - - if self.lon is not None: - serializer.write_double(_SCHEMA_GEO_LOCATION.members["Lon"], self.lon) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["lat"] = de.read_double(_SCHEMA_GEO_LOCATION.members["Lat"]) - - case 1: - kwargs["lon"] = de.read_double(_SCHEMA_GEO_LOCATION.members["Lon"]) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GEO_LOCATION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Organization: - """ - Contains information about the ISP organization of the remote IP - address. - """ - - asn: str | None = None - """ - The Autonomous System Number (ASN) of the internet provider of the - remote IP address. - """ - - asn_org: str | None = None - """The organization that registered this ASN.""" - - isp: str | None = None - """The ISP information for the internet provider.""" - - org: str | None = None - """The name of the internet provider.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ORGANIZATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.asn is not None: - serializer.write_string(_SCHEMA_ORGANIZATION.members["Asn"], self.asn) - - if self.asn_org is not None: - serializer.write_string( - _SCHEMA_ORGANIZATION.members["AsnOrg"], self.asn_org - ) - - if self.isp is not None: - serializer.write_string(_SCHEMA_ORGANIZATION.members["Isp"], self.isp) - - if self.org is not None: - serializer.write_string(_SCHEMA_ORGANIZATION.members["Org"], self.org) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["asn"] = de.read_string(_SCHEMA_ORGANIZATION.members["Asn"]) - - case 1: - kwargs["asn_org"] = de.read_string( - _SCHEMA_ORGANIZATION.members["AsnOrg"] - ) - - case 2: - kwargs["isp"] = de.read_string(_SCHEMA_ORGANIZATION.members["Isp"]) - - case 3: - kwargs["org"] = de.read_string(_SCHEMA_ORGANIZATION.members["Org"]) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ORGANIZATION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class RemoteIpDetails: - """Contains information about the remote IP address of the connection.""" - - city: City | None = None - """The city information of the remote IP address.""" - - country: Country | None = None - """The country code of the remote IP address.""" - - geo_location: GeoLocation | None = None - """The location information of the remote IP address.""" - - ip_address_v4: str | None = field(repr=False, default=None) - """The IPv4 remote address of the connection.""" - - ip_address_v6: str | None = field(repr=False, default=None) - """The IPv6 remote address of the connection.""" - - organization: Organization | None = None - """The ISP organization information of the remote IP address.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REMOTE_IP_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.city is not None: - serializer.write_struct( - _SCHEMA_REMOTE_IP_DETAILS.members["City"], self.city - ) - - if self.country is not None: - serializer.write_struct( - _SCHEMA_REMOTE_IP_DETAILS.members["Country"], self.country - ) - - if self.geo_location is not None: - serializer.write_struct( - _SCHEMA_REMOTE_IP_DETAILS.members["GeoLocation"], self.geo_location - ) - - if self.ip_address_v4 is not None: - serializer.write_string( - _SCHEMA_REMOTE_IP_DETAILS.members["IpAddressV4"], self.ip_address_v4 - ) - - if self.ip_address_v6 is not None: - serializer.write_string( - _SCHEMA_REMOTE_IP_DETAILS.members["IpAddressV6"], self.ip_address_v6 - ) - - if self.organization is not None: - serializer.write_struct( - _SCHEMA_REMOTE_IP_DETAILS.members["Organization"], self.organization - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["city"] = City.deserialize(de) - - case 1: - kwargs["country"] = Country.deserialize(de) - - case 2: - kwargs["geo_location"] = GeoLocation.deserialize(de) - - case 3: - kwargs["ip_address_v4"] = de.read_string( - _SCHEMA_REMOTE_IP_DETAILS.members["IpAddressV4"] - ) - - case 4: - kwargs["ip_address_v6"] = de.read_string( - _SCHEMA_REMOTE_IP_DETAILS.members["IpAddressV6"] - ) - - case 5: - kwargs["organization"] = Organization.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_REMOTE_IP_DETAILS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class AwsApiCallAction: - """Contains information about the API action.""" - - api: str | None = None - """The Amazon Web Services API name.""" - - caller_type: str | None = None - """The Amazon Web Services API caller type.""" - - domain_details: DomainDetails | None = None - """The domain information for the Amazon Web Services API call.""" - - error_code: str | None = None - """The error code of the failed Amazon Web Services API action.""" - - user_agent: str | None = None - """The agent through which the API request was made.""" - - remote_ip_details: RemoteIpDetails | None = None - """ - The remote IP information of the connection that initiated the Amazon - Web Services API call. - """ - - service_name: str | None = None - """The Amazon Web Services service name whose API was invoked.""" - - remote_account_details: RemoteAccountDetails | None = None - """ - The details of the Amazon Web Services account that made the API call. - This field appears if the call was made from outside your account. - """ - - affected_resources: dict[str, str] | None = None - """ - The details of the Amazon Web Services account that made the API call. - This field identifies the resources that were affected by this API call. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AWS_API_CALL_ACTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.api is not None: - serializer.write_string( - _SCHEMA_AWS_API_CALL_ACTION.members["Api"], self.api - ) - - if self.caller_type is not None: - serializer.write_string( - _SCHEMA_AWS_API_CALL_ACTION.members["CallerType"], self.caller_type - ) - - if self.domain_details is not None: - serializer.write_struct( - _SCHEMA_AWS_API_CALL_ACTION.members["DomainDetails"], - self.domain_details, - ) - - if self.error_code is not None: - serializer.write_string( - _SCHEMA_AWS_API_CALL_ACTION.members["ErrorCode"], self.error_code - ) - - if self.user_agent is not None: - serializer.write_string( - _SCHEMA_AWS_API_CALL_ACTION.members["UserAgent"], self.user_agent - ) - - if self.remote_ip_details is not None: - serializer.write_struct( - _SCHEMA_AWS_API_CALL_ACTION.members["RemoteIpDetails"], - self.remote_ip_details, - ) - - if self.service_name is not None: - serializer.write_string( - _SCHEMA_AWS_API_CALL_ACTION.members["ServiceName"], self.service_name - ) - - if self.remote_account_details is not None: - serializer.write_struct( - _SCHEMA_AWS_API_CALL_ACTION.members["RemoteAccountDetails"], - self.remote_account_details, - ) - - if self.affected_resources is not None: - _serialize_affected_resources( - serializer, - _SCHEMA_AWS_API_CALL_ACTION.members["AffectedResources"], - self.affected_resources, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["api"] = de.read_string( - _SCHEMA_AWS_API_CALL_ACTION.members["Api"] - ) - - case 1: - kwargs["caller_type"] = de.read_string( - _SCHEMA_AWS_API_CALL_ACTION.members["CallerType"] - ) - - case 2: - kwargs["domain_details"] = DomainDetails.deserialize(de) - - case 3: - kwargs["error_code"] = de.read_string( - _SCHEMA_AWS_API_CALL_ACTION.members["ErrorCode"] - ) - - case 4: - kwargs["user_agent"] = de.read_string( - _SCHEMA_AWS_API_CALL_ACTION.members["UserAgent"] - ) - - case 5: - kwargs["remote_ip_details"] = RemoteIpDetails.deserialize(de) - - case 6: - kwargs["service_name"] = de.read_string( - _SCHEMA_AWS_API_CALL_ACTION.members["ServiceName"] - ) - - case 7: - kwargs["remote_account_details"] = RemoteAccountDetails.deserialize( - de - ) - - case 8: - kwargs["affected_resources"] = _deserialize_affected_resources( - de, _SCHEMA_AWS_API_CALL_ACTION.members["AffectedResources"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AWS_API_CALL_ACTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DnsRequestAction: - """ - Contains information about the DNS_REQUEST action described in this - finding. - """ - - domain: str | None = None - """The domain information for the DNS query.""" - - protocol: str | None = None - """ - The network connection protocol observed in the activity that prompted - GuardDuty to generate the finding. - """ - - blocked: bool | None = None - """Indicates whether the targeted port is blocked.""" - - domain_with_suffix: str | None = None - """ - The second and top level domain involved in the activity that - potentially prompted GuardDuty to generate this finding. For a list of - top-level and second-level domains, see [public suffix - list](https://publicsuffix.org/). - """ - - vpc_owner_account_id: str | None = None - """ - The Amazon Web Services account ID that owns the VPC through which the - DNS request was made. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DNS_REQUEST_ACTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.domain is not None: - serializer.write_string( - _SCHEMA_DNS_REQUEST_ACTION.members["Domain"], self.domain - ) - - if self.protocol is not None: - serializer.write_string( - _SCHEMA_DNS_REQUEST_ACTION.members["Protocol"], self.protocol - ) - - if self.blocked is not None: - serializer.write_boolean( - _SCHEMA_DNS_REQUEST_ACTION.members["Blocked"], self.blocked - ) - - if self.domain_with_suffix is not None: - serializer.write_string( - _SCHEMA_DNS_REQUEST_ACTION.members["DomainWithSuffix"], - self.domain_with_suffix, - ) - - if self.vpc_owner_account_id is not None: - serializer.write_string( - _SCHEMA_DNS_REQUEST_ACTION.members["VpcOwnerAccountId"], - self.vpc_owner_account_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["domain"] = de.read_string( - _SCHEMA_DNS_REQUEST_ACTION.members["Domain"] - ) - - case 1: - kwargs["protocol"] = de.read_string( - _SCHEMA_DNS_REQUEST_ACTION.members["Protocol"] - ) - - case 2: - kwargs["blocked"] = de.read_boolean( - _SCHEMA_DNS_REQUEST_ACTION.members["Blocked"] - ) - - case 3: - kwargs["domain_with_suffix"] = de.read_string( - _SCHEMA_DNS_REQUEST_ACTION.members["DomainWithSuffix"] - ) - - case 4: - kwargs["vpc_owner_account_id"] = de.read_string( - _SCHEMA_DNS_REQUEST_ACTION.members["VpcOwnerAccountId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DNS_REQUEST_ACTION, consumer=_consumer) - return kwargs - - -def _serialize_source_ips( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_source_ips( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class KubernetesApiCallAction: - """ - Information about the Kubernetes API call action described in this - finding. - """ - - request_uri: str | None = None - """The Kubernetes API request URI.""" - - verb: str | None = None - """The Kubernetes API request HTTP verb.""" - - resource: str | None = None - """The resource component in the Kubernetes API call action.""" - - subresource: str | None = None - """The name of the sub-resource in the Kubernetes API call action.""" - - namespace: str | None = None - """ - The name of the namespace where the Kubernetes API call action takes - place. - """ - - resource_name: str | None = None - """The name of the resource in the Kubernetes API call action.""" - - source_ips: list[str] | None = None - """ - The IP of the Kubernetes API caller and the IPs of any proxies or load - balancers between the caller and the API endpoint. - """ - - user_agent: str | None = None - """The user agent of the caller of the Kubernetes API.""" - - remote_ip_details: RemoteIpDetails | None = None - """Contains information about the remote IP address of the connection.""" - - status_code: int | None = None - """The resulting HTTP response code of the Kubernetes API call action.""" - - parameters: str | None = None - """Parameters related to the Kubernetes API call action.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KUBERNETES_API_CALL_ACTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.request_uri is not None: - serializer.write_string( - _SCHEMA_KUBERNETES_API_CALL_ACTION.members["RequestUri"], - self.request_uri, - ) - - if self.verb is not None: - serializer.write_string( - _SCHEMA_KUBERNETES_API_CALL_ACTION.members["Verb"], self.verb - ) - - if self.resource is not None: - serializer.write_string( - _SCHEMA_KUBERNETES_API_CALL_ACTION.members["Resource"], self.resource - ) - - if self.subresource is not None: - serializer.write_string( - _SCHEMA_KUBERNETES_API_CALL_ACTION.members["Subresource"], - self.subresource, - ) - - if self.namespace is not None: - serializer.write_string( - _SCHEMA_KUBERNETES_API_CALL_ACTION.members["Namespace"], self.namespace - ) - - if self.resource_name is not None: - serializer.write_string( - _SCHEMA_KUBERNETES_API_CALL_ACTION.members["ResourceName"], - self.resource_name, - ) - - if self.source_ips is not None: - _serialize_source_ips( - serializer, - _SCHEMA_KUBERNETES_API_CALL_ACTION.members["SourceIps"], - self.source_ips, - ) - - if self.user_agent is not None: - serializer.write_string( - _SCHEMA_KUBERNETES_API_CALL_ACTION.members["UserAgent"], self.user_agent - ) - - if self.remote_ip_details is not None: - serializer.write_struct( - _SCHEMA_KUBERNETES_API_CALL_ACTION.members["RemoteIpDetails"], - self.remote_ip_details, - ) - - if self.status_code is not None: - serializer.write_integer( - _SCHEMA_KUBERNETES_API_CALL_ACTION.members["StatusCode"], - self.status_code, - ) - - if self.parameters is not None: - serializer.write_string( - _SCHEMA_KUBERNETES_API_CALL_ACTION.members["Parameters"], - self.parameters, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["request_uri"] = de.read_string( - _SCHEMA_KUBERNETES_API_CALL_ACTION.members["RequestUri"] - ) - - case 1: - kwargs["verb"] = de.read_string( - _SCHEMA_KUBERNETES_API_CALL_ACTION.members["Verb"] - ) - - case 2: - kwargs["resource"] = de.read_string( - _SCHEMA_KUBERNETES_API_CALL_ACTION.members["Resource"] - ) - - case 3: - kwargs["subresource"] = de.read_string( - _SCHEMA_KUBERNETES_API_CALL_ACTION.members["Subresource"] - ) - - case 4: - kwargs["namespace"] = de.read_string( - _SCHEMA_KUBERNETES_API_CALL_ACTION.members["Namespace"] - ) - - case 5: - kwargs["resource_name"] = de.read_string( - _SCHEMA_KUBERNETES_API_CALL_ACTION.members["ResourceName"] - ) - - case 6: - kwargs["source_ips"] = _deserialize_source_ips( - de, _SCHEMA_KUBERNETES_API_CALL_ACTION.members["SourceIps"] - ) - - case 7: - kwargs["user_agent"] = de.read_string( - _SCHEMA_KUBERNETES_API_CALL_ACTION.members["UserAgent"] - ) - - case 8: - kwargs["remote_ip_details"] = RemoteIpDetails.deserialize(de) - - case 9: - kwargs["status_code"] = de.read_integer( - _SCHEMA_KUBERNETES_API_CALL_ACTION.members["StatusCode"] - ) - - case 10: - kwargs["parameters"] = de.read_string( - _SCHEMA_KUBERNETES_API_CALL_ACTION.members["Parameters"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_KUBERNETES_API_CALL_ACTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class KubernetesPermissionCheckedDetails: - """ - Information about the Kubernetes API for which you check if you have - permission to call. - """ - - verb: str | None = None - """ - The verb component of the Kubernetes API call. For example, when you - check whether or not you have the permission to call the `CreatePod` - API, the verb component will be `Create`. - """ - - resource: str | None = None - """ - The Kubernetes resource with which your Kubernetes API call will - interact. - """ - - namespace: str | None = None - """The namespace where the Kubernetes API action will take place.""" - - allowed: bool | None = None - """ - Information whether the user has the permission to call the Kubernetes - API. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KUBERNETES_PERMISSION_CHECKED_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.verb is not None: - serializer.write_string( - _SCHEMA_KUBERNETES_PERMISSION_CHECKED_DETAILS.members["Verb"], self.verb - ) - - if self.resource is not None: - serializer.write_string( - _SCHEMA_KUBERNETES_PERMISSION_CHECKED_DETAILS.members["Resource"], - self.resource, - ) - - if self.namespace is not None: - serializer.write_string( - _SCHEMA_KUBERNETES_PERMISSION_CHECKED_DETAILS.members["Namespace"], - self.namespace, - ) - - if self.allowed is not None: - serializer.write_boolean( - _SCHEMA_KUBERNETES_PERMISSION_CHECKED_DETAILS.members["Allowed"], - self.allowed, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["verb"] = de.read_string( - _SCHEMA_KUBERNETES_PERMISSION_CHECKED_DETAILS.members["Verb"] - ) - - case 1: - kwargs["resource"] = de.read_string( - _SCHEMA_KUBERNETES_PERMISSION_CHECKED_DETAILS.members[ - "Resource" - ] - ) - - case 2: - kwargs["namespace"] = de.read_string( - _SCHEMA_KUBERNETES_PERMISSION_CHECKED_DETAILS.members[ - "Namespace" - ] - ) - - case 3: - kwargs["allowed"] = de.read_boolean( - _SCHEMA_KUBERNETES_PERMISSION_CHECKED_DETAILS.members["Allowed"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_KUBERNETES_PERMISSION_CHECKED_DETAILS, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class KubernetesRoleBindingDetails: - """ - Contains information about the role binding that grants the permission - defined in a Kubernetes role. - """ - - kind: str | None = None - """ - The kind of the role. For role binding, this value will be - `RoleBinding`. - """ - - name: str | None = None - """The name of the `RoleBinding`.""" - - uid: str | None = None - """The unique identifier of the role binding.""" - - role_ref_name: str | None = None - """ - The name of the role being referenced. This must match the name of the - `Role` or `ClusterRole` that you want to bind to. - """ - - role_ref_kind: str | None = None - """ - The type of the role being referenced. This could be either `Role` or - `ClusterRole`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KUBERNETES_ROLE_BINDING_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.kind is not None: - serializer.write_string( - _SCHEMA_KUBERNETES_ROLE_BINDING_DETAILS.members["Kind"], self.kind - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_KUBERNETES_ROLE_BINDING_DETAILS.members["Name"], self.name - ) - - if self.uid is not None: - serializer.write_string( - _SCHEMA_KUBERNETES_ROLE_BINDING_DETAILS.members["Uid"], self.uid - ) - - if self.role_ref_name is not None: - serializer.write_string( - _SCHEMA_KUBERNETES_ROLE_BINDING_DETAILS.members["RoleRefName"], - self.role_ref_name, - ) - - if self.role_ref_kind is not None: - serializer.write_string( - _SCHEMA_KUBERNETES_ROLE_BINDING_DETAILS.members["RoleRefKind"], - self.role_ref_kind, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["kind"] = de.read_string( - _SCHEMA_KUBERNETES_ROLE_BINDING_DETAILS.members["Kind"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_KUBERNETES_ROLE_BINDING_DETAILS.members["Name"] - ) - - case 2: - kwargs["uid"] = de.read_string( - _SCHEMA_KUBERNETES_ROLE_BINDING_DETAILS.members["Uid"] - ) - - case 3: - kwargs["role_ref_name"] = de.read_string( - _SCHEMA_KUBERNETES_ROLE_BINDING_DETAILS.members["RoleRefName"] - ) - - case 4: - kwargs["role_ref_kind"] = de.read_string( - _SCHEMA_KUBERNETES_ROLE_BINDING_DETAILS.members["RoleRefKind"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_KUBERNETES_ROLE_BINDING_DETAILS, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class KubernetesRoleDetails: - """Information about the Kubernetes role name and role type.""" - - kind: str | None = None - """The kind of role. For this API, the value of `kind` will be `Role`.""" - - name: str | None = None - """The name of the Kubernetes role.""" - - uid: str | None = None - """The unique identifier of the Kubernetes role name.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KUBERNETES_ROLE_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.kind is not None: - serializer.write_string( - _SCHEMA_KUBERNETES_ROLE_DETAILS.members["Kind"], self.kind - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_KUBERNETES_ROLE_DETAILS.members["Name"], self.name - ) - - if self.uid is not None: - serializer.write_string( - _SCHEMA_KUBERNETES_ROLE_DETAILS.members["Uid"], self.uid - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["kind"] = de.read_string( - _SCHEMA_KUBERNETES_ROLE_DETAILS.members["Kind"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_KUBERNETES_ROLE_DETAILS.members["Name"] - ) - - case 2: - kwargs["uid"] = de.read_string( - _SCHEMA_KUBERNETES_ROLE_DETAILS.members["Uid"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_KUBERNETES_ROLE_DETAILS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class LocalIpDetails: - """Contains information about the local IP address of the connection.""" - - ip_address_v4: str | None = field(repr=False, default=None) - """The IPv4 local address of the connection.""" - - ip_address_v6: str | None = field(repr=False, default=None) - """The IPv6 local address of the connection.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LOCAL_IP_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.ip_address_v4 is not None: - serializer.write_string( - _SCHEMA_LOCAL_IP_DETAILS.members["IpAddressV4"], self.ip_address_v4 - ) - - if self.ip_address_v6 is not None: - serializer.write_string( - _SCHEMA_LOCAL_IP_DETAILS.members["IpAddressV6"], self.ip_address_v6 - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["ip_address_v4"] = de.read_string( - _SCHEMA_LOCAL_IP_DETAILS.members["IpAddressV4"] - ) - - case 1: - kwargs["ip_address_v6"] = de.read_string( - _SCHEMA_LOCAL_IP_DETAILS.members["IpAddressV6"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LOCAL_IP_DETAILS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class LocalPortDetails: - """Contains information about the port for the local connection.""" - - port: int | None = None - """The port number of the local connection.""" - - port_name: str | None = None - """The port name of the local connection.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LOCAL_PORT_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.port is not None: - serializer.write_integer( - _SCHEMA_LOCAL_PORT_DETAILS.members["Port"], self.port - ) - - if self.port_name is not None: - serializer.write_string( - _SCHEMA_LOCAL_PORT_DETAILS.members["PortName"], self.port_name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["port"] = de.read_integer( - _SCHEMA_LOCAL_PORT_DETAILS.members["Port"] - ) - - case 1: - kwargs["port_name"] = de.read_string( - _SCHEMA_LOCAL_PORT_DETAILS.members["PortName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LOCAL_PORT_DETAILS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class RemotePortDetails: - """Contains information about the remote port.""" - - port: int | None = None - """The port number of the remote connection.""" - - port_name: str | None = None - """The port name of the remote connection.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REMOTE_PORT_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.port is not None: - serializer.write_integer( - _SCHEMA_REMOTE_PORT_DETAILS.members["Port"], self.port - ) - - if self.port_name is not None: - serializer.write_string( - _SCHEMA_REMOTE_PORT_DETAILS.members["PortName"], self.port_name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["port"] = de.read_integer( - _SCHEMA_REMOTE_PORT_DETAILS.members["Port"] - ) - - case 1: - kwargs["port_name"] = de.read_string( - _SCHEMA_REMOTE_PORT_DETAILS.members["PortName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_REMOTE_PORT_DETAILS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class NetworkConnectionAction: - """ - Contains information about the NETWORK_CONNECTION action described in - the finding. - """ - - blocked: bool | None = None - """Indicates whether EC2 blocked the network connection to your instance.""" - - connection_direction: str | None = None - """The network connection direction.""" - - local_port_details: LocalPortDetails | None = None - """The local port information of the connection.""" - - protocol: str | None = None - """The network connection protocol.""" - - local_ip_details: LocalIpDetails | None = None - """The local IP information of the connection.""" - - local_network_interface: str | None = None - """ - The EC2 instance's local elastic network interface utilized for the - connection. - """ - - remote_ip_details: RemoteIpDetails | None = None - """The remote IP information of the connection.""" - - remote_port_details: RemotePortDetails | None = None - """The remote port information of the connection.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_NETWORK_CONNECTION_ACTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.blocked is not None: - serializer.write_boolean( - _SCHEMA_NETWORK_CONNECTION_ACTION.members["Blocked"], self.blocked - ) - - if self.connection_direction is not None: - serializer.write_string( - _SCHEMA_NETWORK_CONNECTION_ACTION.members["ConnectionDirection"], - self.connection_direction, - ) - - if self.local_port_details is not None: - serializer.write_struct( - _SCHEMA_NETWORK_CONNECTION_ACTION.members["LocalPortDetails"], - self.local_port_details, - ) - - if self.protocol is not None: - serializer.write_string( - _SCHEMA_NETWORK_CONNECTION_ACTION.members["Protocol"], self.protocol - ) - - if self.local_ip_details is not None: - serializer.write_struct( - _SCHEMA_NETWORK_CONNECTION_ACTION.members["LocalIpDetails"], - self.local_ip_details, - ) - - if self.local_network_interface is not None: - serializer.write_string( - _SCHEMA_NETWORK_CONNECTION_ACTION.members["LocalNetworkInterface"], - self.local_network_interface, - ) - - if self.remote_ip_details is not None: - serializer.write_struct( - _SCHEMA_NETWORK_CONNECTION_ACTION.members["RemoteIpDetails"], - self.remote_ip_details, - ) - - if self.remote_port_details is not None: - serializer.write_struct( - _SCHEMA_NETWORK_CONNECTION_ACTION.members["RemotePortDetails"], - self.remote_port_details, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["blocked"] = de.read_boolean( - _SCHEMA_NETWORK_CONNECTION_ACTION.members["Blocked"] - ) - - case 1: - kwargs["connection_direction"] = de.read_string( - _SCHEMA_NETWORK_CONNECTION_ACTION.members["ConnectionDirection"] - ) - - case 2: - kwargs["local_port_details"] = LocalPortDetails.deserialize(de) - - case 3: - kwargs["protocol"] = de.read_string( - _SCHEMA_NETWORK_CONNECTION_ACTION.members["Protocol"] - ) - - case 4: - kwargs["local_ip_details"] = LocalIpDetails.deserialize(de) - - case 5: - kwargs["local_network_interface"] = de.read_string( - _SCHEMA_NETWORK_CONNECTION_ACTION.members[ - "LocalNetworkInterface" - ] - ) - - case 6: - kwargs["remote_ip_details"] = RemoteIpDetails.deserialize(de) - - case 7: - kwargs["remote_port_details"] = RemotePortDetails.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_NETWORK_CONNECTION_ACTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class PortProbeDetail: - """Contains information about the port probe details.""" - - local_port_details: LocalPortDetails | None = None - """The local port information of the connection.""" - - local_ip_details: LocalIpDetails | None = None - """The local IP information of the connection.""" - - remote_ip_details: RemoteIpDetails | None = None - """The remote IP information of the connection.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PORT_PROBE_DETAIL, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.local_port_details is not None: - serializer.write_struct( - _SCHEMA_PORT_PROBE_DETAIL.members["LocalPortDetails"], - self.local_port_details, - ) - - if self.local_ip_details is not None: - serializer.write_struct( - _SCHEMA_PORT_PROBE_DETAIL.members["LocalIpDetails"], - self.local_ip_details, - ) - - if self.remote_ip_details is not None: - serializer.write_struct( - _SCHEMA_PORT_PROBE_DETAIL.members["RemoteIpDetails"], - self.remote_ip_details, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["local_port_details"] = LocalPortDetails.deserialize(de) - - case 1: - kwargs["local_ip_details"] = LocalIpDetails.deserialize(de) - - case 2: - kwargs["remote_ip_details"] = RemoteIpDetails.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PORT_PROBE_DETAIL, consumer=_consumer) - return kwargs - - -def _serialize_port_probe_details( - serializer: ShapeSerializer, schema: Schema, value: list[PortProbeDetail] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_port_probe_details( - deserializer: ShapeDeserializer, schema: Schema -) -> list[PortProbeDetail]: - result: list[PortProbeDetail] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(PortProbeDetail.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class PortProbeAction: - """ - Contains information about the PORT_PROBE action described in the - finding. - """ - - blocked: bool | None = None - """ - Indicates whether EC2 blocked the port probe to the instance, such as - with an ACL. - """ - - port_probe_details: list[PortProbeDetail] | None = None - """A list of objects related to port probe details.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PORT_PROBE_ACTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.blocked is not None: - serializer.write_boolean( - _SCHEMA_PORT_PROBE_ACTION.members["Blocked"], self.blocked - ) - - if self.port_probe_details is not None: - _serialize_port_probe_details( - serializer, - _SCHEMA_PORT_PROBE_ACTION.members["PortProbeDetails"], - self.port_probe_details, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["blocked"] = de.read_boolean( - _SCHEMA_PORT_PROBE_ACTION.members["Blocked"] - ) - - case 1: - kwargs["port_probe_details"] = _deserialize_port_probe_details( - de, _SCHEMA_PORT_PROBE_ACTION.members["PortProbeDetails"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PORT_PROBE_ACTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class LoginAttribute: - """Information about the login attempts.""" - - user: str | None = None - """Indicates the user name which attempted to log in.""" - - application: str | None = None - """Indicates the application name used to attempt log in.""" - - failed_login_attempts: int | None = None - """ - Represents the sum of failed (unsuccessful) login attempts made to - establish a connection to the database instance. - """ - - successful_login_attempts: int | None = None - """ - Represents the sum of successful connections (a correct combination of - login attributes) made to the database instance by the actor. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LOGIN_ATTRIBUTE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.user is not None: - serializer.write_string(_SCHEMA_LOGIN_ATTRIBUTE.members["User"], self.user) - - if self.application is not None: - serializer.write_string( - _SCHEMA_LOGIN_ATTRIBUTE.members["Application"], self.application - ) - - if self.failed_login_attempts is not None: - serializer.write_integer( - _SCHEMA_LOGIN_ATTRIBUTE.members["FailedLoginAttempts"], - self.failed_login_attempts, - ) - - if self.successful_login_attempts is not None: - serializer.write_integer( - _SCHEMA_LOGIN_ATTRIBUTE.members["SuccessfulLoginAttempts"], - self.successful_login_attempts, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["user"] = de.read_string( - _SCHEMA_LOGIN_ATTRIBUTE.members["User"] - ) - - case 1: - kwargs["application"] = de.read_string( - _SCHEMA_LOGIN_ATTRIBUTE.members["Application"] - ) - - case 2: - kwargs["failed_login_attempts"] = de.read_integer( - _SCHEMA_LOGIN_ATTRIBUTE.members["FailedLoginAttempts"] - ) - - case 3: - kwargs["successful_login_attempts"] = de.read_integer( - _SCHEMA_LOGIN_ATTRIBUTE.members["SuccessfulLoginAttempts"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LOGIN_ATTRIBUTE, consumer=_consumer) - return kwargs - - -def _serialize_login_attributes( - serializer: ShapeSerializer, schema: Schema, value: list[LoginAttribute] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_login_attributes( - deserializer: ShapeDeserializer, schema: Schema -) -> list[LoginAttribute]: - result: list[LoginAttribute] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(LoginAttribute.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class RdsLoginAttemptAction: - """ - Indicates that a login attempt was made to the potentially compromised - database from a remote IP address. - """ - - remote_ip_details: RemoteIpDetails | None = None - """Contains information about the remote IP address of the connection.""" - - login_attributes: list[LoginAttribute] | None = None - """Indicates the login attributes used in the login attempt.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RDS_LOGIN_ATTEMPT_ACTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.remote_ip_details is not None: - serializer.write_struct( - _SCHEMA_RDS_LOGIN_ATTEMPT_ACTION.members["RemoteIpDetails"], - self.remote_ip_details, - ) - - if self.login_attributes is not None: - _serialize_login_attributes( - serializer, - _SCHEMA_RDS_LOGIN_ATTEMPT_ACTION.members["LoginAttributes"], - self.login_attributes, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["remote_ip_details"] = RemoteIpDetails.deserialize(de) - - case 1: - kwargs["login_attributes"] = _deserialize_login_attributes( - de, _SCHEMA_RDS_LOGIN_ATTEMPT_ACTION.members["LoginAttributes"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RDS_LOGIN_ATTEMPT_ACTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Action: - """Contains information about actions.""" - - action_type: str | None = None - """The GuardDuty finding activity type.""" - - aws_api_call_action: AwsApiCallAction | None = None - """Information about the AWS_API_CALL action described in this finding.""" - - dns_request_action: DnsRequestAction | None = None - """Information about the DNS_REQUEST action described in this finding.""" - - network_connection_action: NetworkConnectionAction | None = None - """ - Information about the NETWORK_CONNECTION action described in this - finding. - """ - - port_probe_action: PortProbeAction | None = None - """Information about the PORT_PROBE action described in this finding.""" - - kubernetes_api_call_action: KubernetesApiCallAction | None = None - """ - Information about the Kubernetes API call action described in this - finding. - """ - - kubernetes_permission_checked_details: KubernetesPermissionCheckedDetails | None = ( - None - ) - """ - Information whether the user has the permission to use a specific - Kubernetes API. - """ - - kubernetes_role_binding_details: KubernetesRoleBindingDetails | None = None - """ - Information about the role binding that grants the permission defined in - a Kubernetes role. - """ - - kubernetes_role_details: KubernetesRoleDetails | None = None - """Information about the Kubernetes role name and role type.""" - - rds_login_attempt_action: RdsLoginAttemptAction | None = None - """Information about `RDS_LOGIN_ATTEMPT` action described in this finding.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.action_type is not None: - serializer.write_string( - _SCHEMA_ACTION.members["ActionType"], self.action_type - ) - - if self.aws_api_call_action is not None: - serializer.write_struct( - _SCHEMA_ACTION.members["AwsApiCallAction"], self.aws_api_call_action - ) - - if self.dns_request_action is not None: - serializer.write_struct( - _SCHEMA_ACTION.members["DnsRequestAction"], self.dns_request_action - ) - - if self.network_connection_action is not None: - serializer.write_struct( - _SCHEMA_ACTION.members["NetworkConnectionAction"], - self.network_connection_action, - ) - - if self.port_probe_action is not None: - serializer.write_struct( - _SCHEMA_ACTION.members["PortProbeAction"], self.port_probe_action - ) - - if self.kubernetes_api_call_action is not None: - serializer.write_struct( - _SCHEMA_ACTION.members["KubernetesApiCallAction"], - self.kubernetes_api_call_action, - ) - - if self.kubernetes_permission_checked_details is not None: - serializer.write_struct( - _SCHEMA_ACTION.members["KubernetesPermissionCheckedDetails"], - self.kubernetes_permission_checked_details, - ) - - if self.kubernetes_role_binding_details is not None: - serializer.write_struct( - _SCHEMA_ACTION.members["KubernetesRoleBindingDetails"], - self.kubernetes_role_binding_details, - ) - - if self.kubernetes_role_details is not None: - serializer.write_struct( - _SCHEMA_ACTION.members["KubernetesRoleDetails"], - self.kubernetes_role_details, - ) - - if self.rds_login_attempt_action is not None: - serializer.write_struct( - _SCHEMA_ACTION.members["RdsLoginAttemptAction"], - self.rds_login_attempt_action, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["action_type"] = de.read_string( - _SCHEMA_ACTION.members["ActionType"] - ) - - case 1: - kwargs["aws_api_call_action"] = AwsApiCallAction.deserialize(de) - - case 2: - kwargs["dns_request_action"] = DnsRequestAction.deserialize(de) - - case 3: - kwargs["network_connection_action"] = ( - NetworkConnectionAction.deserialize(de) - ) - - case 4: - kwargs["port_probe_action"] = PortProbeAction.deserialize(de) - - case 5: - kwargs["kubernetes_api_call_action"] = ( - KubernetesApiCallAction.deserialize(de) - ) - - case 6: - kwargs["kubernetes_permission_checked_details"] = ( - KubernetesPermissionCheckedDetails.deserialize(de) - ) - - case 7: - kwargs["kubernetes_role_binding_details"] = ( - KubernetesRoleBindingDetails.deserialize(de) - ) - - case 8: - kwargs["kubernetes_role_details"] = ( - KubernetesRoleDetails.deserialize(de) - ) - - case 9: - kwargs["rds_login_attempt_action"] = ( - RdsLoginAttemptAction.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ACTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ApiCall: - """ - Contains information about an API call that was observed as part of an - activity. - """ - - operation: str | None = None - """The name of the API operation that was invoked.""" - - service: str | None = None - """The service that the API operation was invoked against.""" - - error: str | None = None - """The error code that was returned, if the API call failed.""" - - user_agent: str | None = None - """User agent in the request to the API operation""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_API_CALL, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.operation is not None: - serializer.write_string( - _SCHEMA_API_CALL.members["Operation"], self.operation - ) - - if self.service is not None: - serializer.write_string(_SCHEMA_API_CALL.members["Service"], self.service) - - if self.error is not None: - serializer.write_string(_SCHEMA_API_CALL.members["Error"], self.error) - - if self.user_agent is not None: - serializer.write_string( - _SCHEMA_API_CALL.members["UserAgent"], self.user_agent - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["operation"] = de.read_string( - _SCHEMA_API_CALL.members["Operation"] - ) - - case 1: - kwargs["service"] = de.read_string( - _SCHEMA_API_CALL.members["Service"] - ) - - case 2: - kwargs["error"] = de.read_string(_SCHEMA_API_CALL.members["Error"]) - - case 3: - kwargs["user_agent"] = de.read_string( - _SCHEMA_API_CALL.members["UserAgent"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_API_CALL, consumer=_consumer) - return kwargs - - -class ActivityType(UnknownEnumMixin, StrEnum): - """The type of an observed activity.""" - - API_CALL = "API_CALL" - """The observed activity is an API call.""" - - -@dataclass(kw_only=True) -class Activity: - """ - Contains information about an activity, such as an API call, that was - observed for a signal. - """ - - type: str | None = None - """The type of the observed activity.""" - - api: ApiCall | None = None - """ - Contains information about the API call that was observed, when the - activity type is `API_CALL`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACTIVITY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string(_SCHEMA_ACTIVITY.members["Type"], self.type) - - if self.api is not None: - serializer.write_struct(_SCHEMA_ACTIVITY.members["Api"], self.api) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = ActivityType( - de.read_string(_SCHEMA_ACTIVITY.members["Type"]) - ) - - case 1: - kwargs["api"] = ApiCall.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ACTIVITY, consumer=_consumer) - return kwargs - - -def _serialize_activities( - serializer: ShapeSerializer, schema: Schema, value: list[Activity] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_activities( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Activity]: - result: list[Activity] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Activity.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ActorProcess: - """ - Contains information about a process involved in a GuardDuty finding, - including process identification, execution details, and file - information. - """ - - name: str | None = None - """The name of the process as it appears in the system.""" - - path: str | None = None - """The full file path to the process executable on the system.""" - - sha256: str | None = None - """ - The SHA256 hash of the process executable file, which can be used for - identification and verification purposes. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACTOR_PROCESS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string(_SCHEMA_ACTOR_PROCESS.members["Name"], self.name) - - if self.path is not None: - serializer.write_string(_SCHEMA_ACTOR_PROCESS.members["Path"], self.path) - - if self.sha256 is not None: - serializer.write_string( - _SCHEMA_ACTOR_PROCESS.members["Sha256"], self.sha256 - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_ACTOR_PROCESS.members["Name"] - ) - - case 1: - kwargs["path"] = de.read_string( - _SCHEMA_ACTOR_PROCESS.members["Path"] - ) - - case 2: - kwargs["sha256"] = de.read_string( - _SCHEMA_ACTOR_PROCESS.members["Sha256"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ACTOR_PROCESS, consumer=_consumer) - return kwargs - - -class MfaStatus(UnknownEnumMixin, StrEnum): - ENABLED = "ENABLED" - DISABLED = "DISABLED" - - -@dataclass(kw_only=True) -class Session: - """Contains information about the authenticated session.""" - - uid: str | None = None - """The unique identifier of the session.""" - - mfa_status: str | None = None - """ - Indicates whether or not multi-factor authencation (MFA) was used during - authentication. - - In Amazon Web Services CloudTrail, you can find this value as - `userIdentity.sessionContext.attributes.mfaAuthenticated`. - """ - - created_time: datetime | None = None - """ - The timestamp for when the session was created. - - In Amazon Web Services CloudTrail, you can find this value as - `userIdentity.sessionContext.attributes.creationDate`. - """ - - issuer: str | None = None - """ - Identifier of the session issuer. - - In Amazon Web Services CloudTrail, you can find this value as - `userIdentity.sessionContext.sessionIssuer.arn`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SESSION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.uid is not None: - serializer.write_string(_SCHEMA_SESSION.members["Uid"], self.uid) - - if self.mfa_status is not None: - serializer.write_string( - _SCHEMA_SESSION.members["MfaStatus"], self.mfa_status - ) - - if self.created_time is not None: - serializer.write_timestamp( - _SCHEMA_SESSION.members["CreatedTime"], self.created_time - ) - - if self.issuer is not None: - serializer.write_string(_SCHEMA_SESSION.members["Issuer"], self.issuer) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["uid"] = de.read_string(_SCHEMA_SESSION.members["Uid"]) - - case 1: - kwargs["mfa_status"] = MfaStatus( - de.read_string(_SCHEMA_SESSION.members["MfaStatus"]) - ) - - case 2: - kwargs["created_time"] = de.read_timestamp( - _SCHEMA_SESSION.members["CreatedTime"] - ) - - case 3: - kwargs["issuer"] = de.read_string(_SCHEMA_SESSION.members["Issuer"]) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SESSION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class User: - """Contains information about the user involved in the attack sequence.""" - - name: str | None = None - """The name of the user.""" - - uid: str | None = None - """The unique identifier of the user.""" - - type: str | None = None - """The type of the user.""" - - credential_uid: str | None = None - """The credentials of the user ID.""" - - account: Account | None = None - """ - Contains information about the Amazon Web Services account within which - the activity took place. This is not necessarily the account that owns - the user identity. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_USER, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string(_SCHEMA_USER.members["Name"], self.name) - - if self.uid is not None: - serializer.write_string(_SCHEMA_USER.members["Uid"], self.uid) - - if self.type is not None: - serializer.write_string(_SCHEMA_USER.members["Type"], self.type) - - if self.credential_uid is not None: - serializer.write_string( - _SCHEMA_USER.members["CredentialUid"], self.credential_uid - ) - - if self.account is not None: - serializer.write_struct(_SCHEMA_USER.members["Account"], self.account) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string(_SCHEMA_USER.members["Name"]) - - case 1: - kwargs["uid"] = de.read_string(_SCHEMA_USER.members["Uid"]) - - case 2: - kwargs["type"] = de.read_string(_SCHEMA_USER.members["Type"]) - - case 3: - kwargs["credential_uid"] = de.read_string( - _SCHEMA_USER.members["CredentialUid"] - ) - - case 4: - kwargs["account"] = Account.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_USER, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Actor: - """Information about the actors involved in an attack sequence.""" - - id: str | None = None - """ID of the threat actor.""" - - user: User | None = None - """ - Contains information about the user credentials used by the threat - actor. - """ - - session: Session | None = None - """ - Contains information about the user session where the activity - initiated. - """ - - process: ActorProcess | None = None - """ - Contains information about the process associated with the threat actor. - This includes details such as process name, path, execution time, and - unique identifiers that help track the actor's activities within the - system. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACTOR, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string(_SCHEMA_ACTOR.members["Id"], self.id) - - if self.user is not None: - serializer.write_struct(_SCHEMA_ACTOR.members["User"], self.user) - - if self.session is not None: - serializer.write_struct(_SCHEMA_ACTOR.members["Session"], self.session) - - if self.process is not None: - serializer.write_struct(_SCHEMA_ACTOR.members["Process"], self.process) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string(_SCHEMA_ACTOR.members["Id"]) - - case 1: - kwargs["user"] = User.deserialize(de) - - case 2: - kwargs["session"] = Session.deserialize(de) - - case 3: - kwargs["process"] = ActorProcess.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ACTOR, consumer=_consumer) - return kwargs - - -def _serialize_actor_ids( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_actor_ids( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_actors( - serializer: ShapeSerializer, schema: Schema, value: list[Actor] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_actors(deserializer: ShapeDeserializer, schema: Schema) -> list[Actor]: - result: list[Actor] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Actor.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AdditionalInfo: - """Contains additional information about the detected threat.""" - - version_id: str | None = None - """The version ID of the S3 object, if applicable.""" - - device_name: str | None = None - """The device name of the EBS volume, if applicable.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ADDITIONAL_INFO, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.version_id is not None: - serializer.write_string( - _SCHEMA_ADDITIONAL_INFO.members["VersionId"], self.version_id - ) - - if self.device_name is not None: - serializer.write_string( - _SCHEMA_ADDITIONAL_INFO.members["DeviceName"], self.device_name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["version_id"] = de.read_string( - _SCHEMA_ADDITIONAL_INFO.members["VersionId"] - ) - - case 1: - kwargs["device_name"] = de.read_string( - _SCHEMA_ADDITIONAL_INFO.members["DeviceName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ADDITIONAL_INFO, consumer=_consumer) - return kwargs - - -def _serialize_additional_sequence_types( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_additional_sequence_types( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AddonDetails: - """Information about the installed EKS add-on (GuardDuty security agent).""" - - addon_version: str | None = None - """Version of the installed EKS add-on.""" - - addon_status: str | None = None - """Status of the installed EKS add-on.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ADDON_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.addon_version is not None: - serializer.write_string( - _SCHEMA_ADDON_DETAILS.members["AddonVersion"], self.addon_version - ) - - if self.addon_status is not None: - serializer.write_string( - _SCHEMA_ADDON_DETAILS.members["AddonStatus"], self.addon_status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["addon_version"] = de.read_string( - _SCHEMA_ADDON_DETAILS.members["AddonVersion"] - ) - - case 1: - kwargs["addon_status"] = de.read_string( - _SCHEMA_ADDON_DETAILS.members["AddonStatus"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ADDON_DETAILS, consumer=_consumer) - return kwargs - - -class AdminStatus(UnknownEnumMixin, StrEnum): - ENABLED = "ENABLED" - DISABLE_IN_PROGRESS = "DISABLE_IN_PROGRESS" - - -@dataclass(kw_only=True) -class AdminAccount: - """ - The account within the organization specified as the GuardDuty delegated - administrator. - """ - - admin_account_id: str | None = None - """The Amazon Web Services account ID for the account.""" - - admin_status: str | None = None - """Indicates whether the account is enabled as the delegated administrator.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ADMIN_ACCOUNT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.admin_account_id is not None: - serializer.write_string( - _SCHEMA_ADMIN_ACCOUNT.members["AdminAccountId"], self.admin_account_id - ) - - if self.admin_status is not None: - serializer.write_string( - _SCHEMA_ADMIN_ACCOUNT.members["AdminStatus"], self.admin_status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["admin_account_id"] = de.read_string( - _SCHEMA_ADMIN_ACCOUNT.members["AdminAccountId"] - ) - - case 1: - kwargs["admin_status"] = AdminStatus( - de.read_string(_SCHEMA_ADMIN_ACCOUNT.members["AdminStatus"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ADMIN_ACCOUNT, consumer=_consumer) - return kwargs - - -def _serialize_admin_accounts( - serializer: ShapeSerializer, schema: Schema, value: list[AdminAccount] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_admin_accounts( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AdminAccount]: - result: list[AdminAccount] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AdminAccount.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class Administrator: - """Contains information about the administrator account and invitation.""" - - account_id: str | None = None - """The ID of the account used as the administrator account.""" - - invitation_id: str | None = None - """ - The value that is used to validate the administrator account to the - member account. - """ - - relationship_status: str | None = None - """ - The status of the relationship between the administrator and member - accounts. - """ - - invited_at: str | None = None - """The timestamp when the invitation was sent.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ADMINISTRATOR, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.account_id is not None: - serializer.write_string( - _SCHEMA_ADMINISTRATOR.members["AccountId"], self.account_id - ) - - if self.invitation_id is not None: - serializer.write_string( - _SCHEMA_ADMINISTRATOR.members["InvitationId"], self.invitation_id - ) - - if self.relationship_status is not None: - serializer.write_string( - _SCHEMA_ADMINISTRATOR.members["RelationshipStatus"], - self.relationship_status, - ) - - if self.invited_at is not None: - serializer.write_string( - _SCHEMA_ADMINISTRATOR.members["InvitedAt"], self.invited_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["account_id"] = de.read_string( - _SCHEMA_ADMINISTRATOR.members["AccountId"] - ) - - case 1: - kwargs["invitation_id"] = de.read_string( - _SCHEMA_ADMINISTRATOR.members["InvitationId"] - ) - - case 2: - kwargs["relationship_status"] = de.read_string( - _SCHEMA_ADMINISTRATOR.members["RelationshipStatus"] - ) - - case 3: - kwargs["invited_at"] = de.read_string( - _SCHEMA_ADMINISTRATOR.members["InvitedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ADMINISTRATOR, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class AgentDetails: - """Information about the installed GuardDuty security agent.""" - - version: str | None = None - """Version of the installed GuardDuty security agent.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AGENT_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.version is not None: - serializer.write_string( - _SCHEMA_AGENT_DETAILS.members["Version"], self.version - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["version"] = de.read_string( - _SCHEMA_AGENT_DETAILS.members["Version"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AGENT_DETAILS, consumer=_consumer) - return kwargs - - -def _serialize_observation_numbers( - serializer: ShapeSerializer, schema: Schema, value: list[int] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_long(member_schema, e) - - -def _deserialize_observation_numbers( - deserializer: ShapeDeserializer, schema: Schema -) -> list[int]: - result: list[int] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_long(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_observation_texts( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_observation_texts( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class Observations: - """Contains information about the observed behavior.""" - - text: list[str] | None = None - """The text that was unusual.""" - - number: list[int] | None = None - """The numeric values that were unusual.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OBSERVATIONS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.text is not None: - _serialize_observation_texts( - serializer, _SCHEMA_OBSERVATIONS.members["Text"], self.text - ) - - if self.number is not None: - _serialize_observation_numbers( - serializer, _SCHEMA_OBSERVATIONS.members["Number"], self.number - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["text"] = _deserialize_observation_texts( - de, _SCHEMA_OBSERVATIONS.members["Text"] - ) - - case 1: - kwargs["number"] = _deserialize_observation_numbers( - de, _SCHEMA_OBSERVATIONS.members["Number"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_OBSERVATIONS, consumer=_consumer) - return kwargs - - -class ProfileSubtype(UnknownEnumMixin, StrEnum): - FREQUENT = "FREQUENT" - INFREQUENT = "INFREQUENT" - UNSEEN = "UNSEEN" - RARE = "RARE" - COUNT = "COUNT" - AVERAGE = "AVERAGE" - - -class ProfileType(UnknownEnumMixin, StrEnum): - FREQUENCY = "FREQUENCY" - VOLUME = "VOLUME" - - -@dataclass(kw_only=True) -class AnomalyObject: - """Contains information about the unusual anomalies.""" - - profile_type: str | None = None - """The type of behavior of the profile.""" - - profile_subtype: str | None = None - """The frequency of the anomaly.""" - - observations: Observations | None = None - """The recorded value.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ANOMALY_OBJECT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.profile_type is not None: - serializer.write_string( - _SCHEMA_ANOMALY_OBJECT.members["ProfileType"], self.profile_type - ) - - if self.profile_subtype is not None: - serializer.write_string( - _SCHEMA_ANOMALY_OBJECT.members["ProfileSubtype"], self.profile_subtype - ) - - if self.observations is not None: - serializer.write_struct( - _SCHEMA_ANOMALY_OBJECT.members["Observations"], self.observations - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["profile_type"] = ProfileType( - de.read_string(_SCHEMA_ANOMALY_OBJECT.members["ProfileType"]) - ) - - case 1: - kwargs["profile_subtype"] = ProfileSubtype( - de.read_string(_SCHEMA_ANOMALY_OBJECT.members["ProfileSubtype"]) - ) - - case 2: - kwargs["observations"] = Observations.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ANOMALY_OBJECT, consumer=_consumer) - return kwargs - - -def _serialize_anomaly_profile_feature_objects( - serializer: ShapeSerializer, schema: Schema, value: list[AnomalyObject] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_anomaly_profile_feature_objects( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AnomalyObject]: - result: list[AnomalyObject] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AnomalyObject.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_anomaly_profile_features( - serializer: ShapeSerializer, schema: Schema, value: dict[str, list[AnomalyObject]] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry( - k, - lambda vs: _serialize_anomaly_profile_feature_objects( - vs, value_schema, v - ), - ) - - -def _deserialize_anomaly_profile_features( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, list[AnomalyObject]]: - result: dict[str, list[AnomalyObject]] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = _deserialize_anomaly_profile_feature_objects(d, value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -def _serialize_anomaly_profiles( - serializer: ShapeSerializer, - schema: Schema, - value: dict[str, dict[str, list[AnomalyObject]]], -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry( - k, lambda vs: _serialize_anomaly_profile_features(vs, value_schema, v) - ) - - -def _deserialize_anomaly_profiles( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, dict[str, list[AnomalyObject]]]: - result: dict[str, dict[str, list[AnomalyObject]]] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = _deserialize_anomaly_profile_features(d, value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -def _serialize_anomaly_unusual_behavior_feature( - serializer: ShapeSerializer, schema: Schema, value: dict[str, AnomalyObject] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_struct(value_schema, v)) - - -def _deserialize_anomaly_unusual_behavior_feature( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, AnomalyObject]: - result: dict[str, AnomalyObject] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = AnomalyObject.deserialize(d) - - deserializer.read_map(schema, _read_value) - return result - - -def _serialize_behavior( - serializer: ShapeSerializer, - schema: Schema, - value: dict[str, dict[str, AnomalyObject]], -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry( - k, - lambda vs: _serialize_anomaly_unusual_behavior_feature( - vs, value_schema, v - ), - ) - - -def _deserialize_behavior( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, dict[str, AnomalyObject]]: - result: dict[str, dict[str, AnomalyObject]] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = _deserialize_anomaly_unusual_behavior_feature(d, value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AnomalyUnusual: - """ - Contains information about the behavior of the anomaly that is new to - GuardDuty. - """ - - behavior: dict[str, dict[str, AnomalyObject]] | None = None - """ - The behavior of the anomalous activity that caused GuardDuty to generate - the finding. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ANOMALY_UNUSUAL, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.behavior is not None: - _serialize_behavior( - serializer, _SCHEMA_ANOMALY_UNUSUAL.members["Behavior"], self.behavior - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["behavior"] = _deserialize_behavior( - de, _SCHEMA_ANOMALY_UNUSUAL.members["Behavior"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ANOMALY_UNUSUAL, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Anomaly: - """Contains information about the anomalies.""" - - profiles: dict[str, dict[str, list[AnomalyObject]]] | None = None - """Information about the types of profiles.""" - - unusual: AnomalyUnusual | None = None - """Information about the behavior of the anomalies.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ANOMALY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.profiles is not None: - _serialize_anomaly_profiles( - serializer, _SCHEMA_ANOMALY.members["Profiles"], self.profiles - ) - - if self.unusual is not None: - serializer.write_struct(_SCHEMA_ANOMALY.members["Unusual"], self.unusual) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["profiles"] = _deserialize_anomaly_profiles( - de, _SCHEMA_ANOMALY.members["Profiles"] - ) - - case 1: - kwargs["unusual"] = AnomalyUnusual.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ANOMALY, consumer=_consumer) - return kwargs - - -def _serialize_finding_ids( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_finding_ids( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ArchiveFindingsInput: - """Dataclass for ArchiveFindingsInput structure.""" - - detector_id: str | None = None - """ - The ID of the detector that specifies the GuardDuty service whose - findings you want to archive. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - finding_ids: list[str] | None = None - """The IDs of the findings that you want to archive.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ARCHIVE_FINDINGS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_ARCHIVE_FINDINGS_INPUT.members["DetectorId"], self.detector_id - ) - - if self.finding_ids is not None: - _serialize_finding_ids( - serializer, - _SCHEMA_ARCHIVE_FINDINGS_INPUT.members["FindingIds"], - self.finding_ids, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_ARCHIVE_FINDINGS_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["finding_ids"] = _deserialize_finding_ids( - de, _SCHEMA_ARCHIVE_FINDINGS_INPUT.members["FindingIds"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ARCHIVE_FINDINGS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ArchiveFindingsOutput: - """Dataclass for ArchiveFindingsOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ARCHIVE_FINDINGS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ARCHIVE_FINDINGS_OUTPUT, consumer=_consumer) - return kwargs - - -ARCHIVE_FINDINGS = APIOperation( - input=ArchiveFindingsInput, - output=ArchiveFindingsOutput, - schema=_SCHEMA_ARCHIVE_FINDINGS, - input_schema=_SCHEMA_ARCHIVE_FINDINGS_INPUT, - output_schema=_SCHEMA_ARCHIVE_FINDINGS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -class AssociationMode(UnknownEnumMixin, StrEnum): - LIVE = "LIVE" - DRY_RUN = "DRY_RUN" - - -@dataclass(kw_only=True) -class AssociationDetail: - """Contains the full details of a custom detection rule association.""" - - association_id: str | None = None - """The unique identifier for the association.""" - - arn: str | None = None - """The Amazon Resource Name (ARN) of the association.""" - - rule_id: str | None = None - """The unique identifier for the custom detection rule.""" - - account_id: str | None = None - """ - The Amazon Web Services account ID associated with this rule - association. - """ - - mode: str | None = None - """The rule execution mode. Valid values: `LIVE` | `DRY_RUN`.""" - - created_at: datetime | None = None - """The timestamp when the association was created.""" - - updated_at: datetime | None = None - """The timestamp when the association was last updated.""" - - expires_at: datetime | None = None - """The timestamp when the association expires.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ASSOCIATION_DETAIL, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.association_id is not None: - serializer.write_string( - _SCHEMA_ASSOCIATION_DETAIL.members["AssociationId"], self.association_id - ) - - if self.arn is not None: - serializer.write_string(_SCHEMA_ASSOCIATION_DETAIL.members["Arn"], self.arn) - - if self.rule_id is not None: - serializer.write_string( - _SCHEMA_ASSOCIATION_DETAIL.members["RuleId"], self.rule_id - ) - - if self.account_id is not None: - serializer.write_string( - _SCHEMA_ASSOCIATION_DETAIL.members["AccountId"], self.account_id - ) - - if self.mode is not None: - serializer.write_string( - _SCHEMA_ASSOCIATION_DETAIL.members["Mode"], self.mode - ) - - if self.created_at is not None: - serializer.write_timestamp( - _SCHEMA_ASSOCIATION_DETAIL.members["CreatedAt"], self.created_at - ) - - if self.updated_at is not None: - serializer.write_timestamp( - _SCHEMA_ASSOCIATION_DETAIL.members["UpdatedAt"], self.updated_at - ) - - if self.expires_at is not None: - serializer.write_timestamp( - _SCHEMA_ASSOCIATION_DETAIL.members["ExpiresAt"], self.expires_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["association_id"] = de.read_string( - _SCHEMA_ASSOCIATION_DETAIL.members["AssociationId"] - ) - - case 1: - kwargs["arn"] = de.read_string( - _SCHEMA_ASSOCIATION_DETAIL.members["Arn"] - ) - - case 2: - kwargs["rule_id"] = de.read_string( - _SCHEMA_ASSOCIATION_DETAIL.members["RuleId"] - ) - - case 3: - kwargs["account_id"] = de.read_string( - _SCHEMA_ASSOCIATION_DETAIL.members["AccountId"] - ) - - case 4: - kwargs["mode"] = AssociationMode( - de.read_string(_SCHEMA_ASSOCIATION_DETAIL.members["Mode"]) - ) - - case 5: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_ASSOCIATION_DETAIL.members["CreatedAt"] - ) - - case 6: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_ASSOCIATION_DETAIL.members["UpdatedAt"] - ) - - case 7: - kwargs["expires_at"] = de.read_timestamp( - _SCHEMA_ASSOCIATION_DETAIL.members["ExpiresAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ASSOCIATION_DETAIL, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class AssociationSummary: - """Contains summary information about a custom detection rule association.""" - - association_id: str | None = None - """The unique identifier for the association.""" - - arn: str | None = None - """The Amazon Resource Name (ARN) of the association.""" - - rule_id: str | None = None - """The unique identifier for the custom detection rule.""" - - mode: str | None = None - """The rule execution mode. Valid values: `LIVE` | `DRY_RUN`.""" - - created_at: datetime | None = None - """The timestamp when the association was created.""" - - updated_at: datetime | None = None - """The timestamp when the association was last updated.""" - - expires_at: datetime | None = None - """The timestamp when the association expires.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ASSOCIATION_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.association_id is not None: - serializer.write_string( - _SCHEMA_ASSOCIATION_SUMMARY.members["AssociationId"], - self.association_id, - ) - - if self.arn is not None: - serializer.write_string( - _SCHEMA_ASSOCIATION_SUMMARY.members["Arn"], self.arn - ) - - if self.rule_id is not None: - serializer.write_string( - _SCHEMA_ASSOCIATION_SUMMARY.members["RuleId"], self.rule_id - ) - - if self.mode is not None: - serializer.write_string( - _SCHEMA_ASSOCIATION_SUMMARY.members["Mode"], self.mode - ) - - if self.created_at is not None: - serializer.write_timestamp( - _SCHEMA_ASSOCIATION_SUMMARY.members["CreatedAt"], self.created_at - ) - - if self.updated_at is not None: - serializer.write_timestamp( - _SCHEMA_ASSOCIATION_SUMMARY.members["UpdatedAt"], self.updated_at - ) - - if self.expires_at is not None: - serializer.write_timestamp( - _SCHEMA_ASSOCIATION_SUMMARY.members["ExpiresAt"], self.expires_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["association_id"] = de.read_string( - _SCHEMA_ASSOCIATION_SUMMARY.members["AssociationId"] - ) - - case 1: - kwargs["arn"] = de.read_string( - _SCHEMA_ASSOCIATION_SUMMARY.members["Arn"] - ) - - case 2: - kwargs["rule_id"] = de.read_string( - _SCHEMA_ASSOCIATION_SUMMARY.members["RuleId"] - ) - - case 3: - kwargs["mode"] = AssociationMode( - de.read_string(_SCHEMA_ASSOCIATION_SUMMARY.members["Mode"]) - ) - - case 4: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_ASSOCIATION_SUMMARY.members["CreatedAt"] - ) - - case 5: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_ASSOCIATION_SUMMARY.members["UpdatedAt"] - ) - - case 6: - kwargs["expires_at"] = de.read_timestamp( - _SCHEMA_ASSOCIATION_SUMMARY.members["ExpiresAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ASSOCIATION_SUMMARY, consumer=_consumer) - return kwargs - - -def _serialize_association_summary_list( - serializer: ShapeSerializer, schema: Schema, value: list[AssociationSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_association_summary_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AssociationSummary]: - result: list[AssociationSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AssociationSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class AutoEnableMembers(UnknownEnumMixin, StrEnum): - NEW = "NEW" - ALL = "ALL" - NONE = "NONE" - - -@dataclass(kw_only=True) -class AutonomousSystem: - """ - Contains information about the Autonomous System (AS) associated with - the network endpoints involved in an attack sequence. - """ - - name: str | None = None - """Name associated with the Autonomous System (AS).""" - - number: int | None = None - """The unique number that identifies the Autonomous System (AS).""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTONOMOUS_SYSTEM, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_AUTONOMOUS_SYSTEM.members["Name"], self.name - ) - - if self.number is not None: - serializer.write_integer( - _SCHEMA_AUTONOMOUS_SYSTEM.members["Number"], self.number - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_AUTONOMOUS_SYSTEM.members["Name"] - ) - - case 1: - kwargs["number"] = de.read_integer( - _SCHEMA_AUTONOMOUS_SYSTEM.members["Number"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AUTONOMOUS_SYSTEM, consumer=_consumer) - return kwargs - - -def _serialize_ec2_instance_uids( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_ec2_instance_uids( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AutoscalingAutoScalingGroup: - """ - Contains information about the Auto Scaling Group involved in a - GuardDuty finding, including unique identifiers of the Amazon EC2 - instances. - """ - - ec2_instance_uids: list[str] | None = None - """ - A list of unique identifiers for the compromised Amazon EC2 instances - that are part of the same Auto Scaling Group. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTOSCALING_AUTO_SCALING_GROUP, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.ec2_instance_uids is not None: - _serialize_ec2_instance_uids( - serializer, - _SCHEMA_AUTOSCALING_AUTO_SCALING_GROUP.members["Ec2InstanceUids"], - self.ec2_instance_uids, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["ec2_instance_uids"] = _deserialize_ec2_instance_uids( - de, - _SCHEMA_AUTOSCALING_AUTO_SCALING_GROUP.members[ - "Ec2InstanceUids" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTOSCALING_AUTO_SCALING_GROUP, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class BedrockGuardrail: - """ - Contains information about a Bedrock guardrail associated with a - finding. - """ - - arn: str | None = None - """The ARN of the Bedrock guardrail.""" - - version: str | None = None - """The version of the Bedrock guardrail.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BEDROCK_GUARDRAIL, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.arn is not None: - serializer.write_string(_SCHEMA_BEDROCK_GUARDRAIL.members["Arn"], self.arn) - - if self.version is not None: - serializer.write_string( - _SCHEMA_BEDROCK_GUARDRAIL.members["Version"], self.version - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["arn"] = de.read_string( - _SCHEMA_BEDROCK_GUARDRAIL.members["Arn"] - ) - - case 1: - kwargs["version"] = de.read_string( - _SCHEMA_BEDROCK_GUARDRAIL.members["Version"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BEDROCK_GUARDRAIL, consumer=_consumer) - return kwargs - - -class ContentPolicyFilterAction(UnknownEnumMixin, StrEnum): - BLOCKED = "BLOCKED" - NONE = "NONE" - - -class ConfidenceLevel(UnknownEnumMixin, StrEnum): - HIGH = "HIGH" - MEDIUM = "MEDIUM" - LOW = "LOW" - NONE = "NONE" - - -class ContentPolicyFilterType(UnknownEnumMixin, StrEnum): - PROMPT_ATTACK = "PROMPT_ATTACK" - JAILBREAK = "JAILBREAK" - HATE = "HATE" - INSULTS = "INSULTS" - SEXUAL = "SEXUAL" - VIOLENCE = "VIOLENCE" - MISCONDUCT = "MISCONDUCT" - - -@dataclass(kw_only=True) -class ContentPolicyFilter: - """ - Contains information about a content policy filter that matched during a - guardrail evaluation. - """ - - type: str | None = None - """The type of content that was filtered by the guardrail.""" - - confidence: str | None = None - """The confidence level that the content matched the filter.""" - - action: str | None = None - """The action taken by the guardrail filter.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT_POLICY_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_CONTENT_POLICY_FILTER.members["Type"], self.type - ) - - if self.confidence is not None: - serializer.write_string( - _SCHEMA_CONTENT_POLICY_FILTER.members["Confidence"], self.confidence - ) - - if self.action is not None: - serializer.write_string( - _SCHEMA_CONTENT_POLICY_FILTER.members["Action"], self.action - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = ContentPolicyFilterType( - de.read_string(_SCHEMA_CONTENT_POLICY_FILTER.members["Type"]) - ) - - case 1: - kwargs["confidence"] = ConfidenceLevel( - de.read_string( - _SCHEMA_CONTENT_POLICY_FILTER.members["Confidence"] - ) - ) - - case 2: - kwargs["action"] = ContentPolicyFilterAction( - de.read_string(_SCHEMA_CONTENT_POLICY_FILTER.members["Action"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONTENT_POLICY_FILTER, consumer=_consumer) - return kwargs - - -def _serialize_content_policy_filters( - serializer: ShapeSerializer, schema: Schema, value: list[ContentPolicyFilter] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_content_policy_filters( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ContentPolicyFilter]: - result: list[ContentPolicyFilter] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ContentPolicyFilter.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class GuardrailAction(UnknownEnumMixin, StrEnum): - GUARDRAIL_INTERVENED = "GUARDRAIL_INTERVENED" - NONE = "NONE" - - -def _serialize_bedrock_guardrails( - serializer: ShapeSerializer, schema: Schema, value: list[BedrockGuardrail] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_bedrock_guardrails( - deserializer: ShapeDeserializer, schema: Schema -) -> list[BedrockGuardrail]: - result: list[BedrockGuardrail] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(BedrockGuardrail.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class GuardrailSource(UnknownEnumMixin, StrEnum): - INPUT = "INPUT" - OUTPUT = "OUTPUT" - - -@dataclass(kw_only=True) -class BedrockGuardrailDetails: - """ - Contains information about the Bedrock guardrail that was involved in a - finding. - """ - - guardrail_arn: str | None = None - """ - The ARN of the Bedrock guardrail. This field is deprecated. Use the - `guardrails` list instead. - """ - - guardrail_version: str | None = None - """ - The version of the Bedrock guardrail. This field is deprecated. Use the - `guardrails` list instead. - """ - - guardrails: list[BedrockGuardrail] | None = None - """The list of Bedrock guardrails associated with the finding.""" - - guardrail_action: str | None = None - """Indicates whether the guardrail intervened or not.""" - - guardrail_source: str | None = None - """ - Indicates whether the guardrail was applied on the input or output of - the model invocation. - """ - - content_policy_filters: list[ContentPolicyFilter] | None = None - """ - The list of content policy filters that matched during the guardrail - evaluation. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BEDROCK_GUARDRAIL_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.guardrail_arn is not None: - serializer.write_string( - _SCHEMA_BEDROCK_GUARDRAIL_DETAILS.members["GuardrailArn"], - self.guardrail_arn, - ) - - if self.guardrail_version is not None: - serializer.write_string( - _SCHEMA_BEDROCK_GUARDRAIL_DETAILS.members["GuardrailVersion"], - self.guardrail_version, - ) - - if self.guardrails is not None: - _serialize_bedrock_guardrails( - serializer, - _SCHEMA_BEDROCK_GUARDRAIL_DETAILS.members["Guardrails"], - self.guardrails, - ) - - if self.guardrail_action is not None: - serializer.write_string( - _SCHEMA_BEDROCK_GUARDRAIL_DETAILS.members["GuardrailAction"], - self.guardrail_action, - ) - - if self.guardrail_source is not None: - serializer.write_string( - _SCHEMA_BEDROCK_GUARDRAIL_DETAILS.members["GuardrailSource"], - self.guardrail_source, - ) - - if self.content_policy_filters is not None: - _serialize_content_policy_filters( - serializer, - _SCHEMA_BEDROCK_GUARDRAIL_DETAILS.members["ContentPolicyFilters"], - self.content_policy_filters, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["guardrail_arn"] = de.read_string( - _SCHEMA_BEDROCK_GUARDRAIL_DETAILS.members["GuardrailArn"] - ) - - case 1: - kwargs["guardrail_version"] = de.read_string( - _SCHEMA_BEDROCK_GUARDRAIL_DETAILS.members["GuardrailVersion"] - ) - - case 2: - kwargs["guardrails"] = _deserialize_bedrock_guardrails( - de, _SCHEMA_BEDROCK_GUARDRAIL_DETAILS.members["Guardrails"] - ) - - case 3: - kwargs["guardrail_action"] = GuardrailAction( - de.read_string( - _SCHEMA_BEDROCK_GUARDRAIL_DETAILS.members["GuardrailAction"] - ) - ) - - case 4: - kwargs["guardrail_source"] = GuardrailSource( - de.read_string( - _SCHEMA_BEDROCK_GUARDRAIL_DETAILS.members["GuardrailSource"] - ) - ) - - case 5: - kwargs["content_policy_filters"] = ( - _deserialize_content_policy_filters( - de, - _SCHEMA_BEDROCK_GUARDRAIL_DETAILS.members[ - "ContentPolicyFilters" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BEDROCK_GUARDRAIL_DETAILS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class BedrockGuardrailResource: - """ - Contains details about an Amazon Bedrock guardrail evaluated during a - model invocation. - """ - - version: str | None = None - """ - The version of the Amazon Bedrock guardrail. Valid values are a numeric - version, `DRAFT`, or `ENFORCED`. - """ - - guardrail_action: str | None = None - """Indicates whether the guardrail intervened during the model invocation.""" - - guardrail_source: str | None = None - """ - Indicates whether the guardrail was applied on the input or output of - the model invocation. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BEDROCK_GUARDRAIL_RESOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.version is not None: - serializer.write_string( - _SCHEMA_BEDROCK_GUARDRAIL_RESOURCE.members["Version"], self.version - ) - - if self.guardrail_action is not None: - serializer.write_string( - _SCHEMA_BEDROCK_GUARDRAIL_RESOURCE.members["GuardrailAction"], - self.guardrail_action, - ) - - if self.guardrail_source is not None: - serializer.write_string( - _SCHEMA_BEDROCK_GUARDRAIL_RESOURCE.members["GuardrailSource"], - self.guardrail_source, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["version"] = de.read_string( - _SCHEMA_BEDROCK_GUARDRAIL_RESOURCE.members["Version"] - ) - - case 1: - kwargs["guardrail_action"] = GuardrailAction( - de.read_string( - _SCHEMA_BEDROCK_GUARDRAIL_RESOURCE.members[ - "GuardrailAction" - ] - ) - ) - - case 2: - kwargs["guardrail_source"] = GuardrailSource( - de.read_string( - _SCHEMA_BEDROCK_GUARDRAIL_RESOURCE.members[ - "GuardrailSource" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BEDROCK_GUARDRAIL_RESOURCE, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class BucketPolicy: - """Contains information on the current bucket policies for the S3 bucket.""" - - allows_public_read_access: bool | None = None - """ - A value that indicates whether public read access for the bucket is - enabled through a bucket policy. - """ - - allows_public_write_access: bool | None = None - """ - A value that indicates whether public write access for the bucket is - enabled through a bucket policy. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BUCKET_POLICY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.allows_public_read_access is not None: - serializer.write_boolean( - _SCHEMA_BUCKET_POLICY.members["AllowsPublicReadAccess"], - self.allows_public_read_access, - ) - - if self.allows_public_write_access is not None: - serializer.write_boolean( - _SCHEMA_BUCKET_POLICY.members["AllowsPublicWriteAccess"], - self.allows_public_write_access, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["allows_public_read_access"] = de.read_boolean( - _SCHEMA_BUCKET_POLICY.members["AllowsPublicReadAccess"] - ) - - case 1: - kwargs["allows_public_write_access"] = de.read_boolean( - _SCHEMA_BUCKET_POLICY.members["AllowsPublicWriteAccess"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BUCKET_POLICY, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class BucketLevelPermissions: - """ - Contains information about the bucket level permissions for the S3 - bucket. - """ - - access_control_list: AccessControlList | None = None - """ - Contains information on how Access Control Policies are applied to the - bucket. - """ - - bucket_policy: BucketPolicy | None = None - """Contains information on the bucket policies for the S3 bucket.""" - - block_public_access: BlockPublicAccess | None = None - """ - Contains information on which account level S3 Block Public Access - settings are applied to the S3 bucket. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BUCKET_LEVEL_PERMISSIONS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.access_control_list is not None: - serializer.write_struct( - _SCHEMA_BUCKET_LEVEL_PERMISSIONS.members["AccessControlList"], - self.access_control_list, - ) - - if self.bucket_policy is not None: - serializer.write_struct( - _SCHEMA_BUCKET_LEVEL_PERMISSIONS.members["BucketPolicy"], - self.bucket_policy, - ) - - if self.block_public_access is not None: - serializer.write_struct( - _SCHEMA_BUCKET_LEVEL_PERMISSIONS.members["BlockPublicAccess"], - self.block_public_access, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["access_control_list"] = AccessControlList.deserialize(de) - - case 1: - kwargs["bucket_policy"] = BucketPolicy.deserialize(de) - - case 2: - kwargs["block_public_access"] = BlockPublicAccess.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BUCKET_LEVEL_PERMISSIONS, consumer=_consumer) - return kwargs - - -class CloudProvider(UnknownEnumMixin, StrEnum): - AWS = "AWS" - - -@dataclass(kw_only=True) -class CloudDetails: - """ - Contains details about the cloud environment associated with an - investigation. - """ - - provider: str | None = None - """The cloud provider. Currently, only `AWS` is supported.""" - - region: str | None = None - """ - The Amazon Web Services Region in which the investigated resource - resides. - """ - - account: str | None = None - """The Amazon Web Services account ID of the investigated resource.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CLOUD_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.provider is not None: - serializer.write_string( - _SCHEMA_CLOUD_DETAILS.members["Provider"], self.provider - ) - - if self.region is not None: - serializer.write_string( - _SCHEMA_CLOUD_DETAILS.members["Region"], self.region - ) - - if self.account is not None: - serializer.write_string( - _SCHEMA_CLOUD_DETAILS.members["Account"], self.account - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["provider"] = CloudProvider( - de.read_string(_SCHEMA_CLOUD_DETAILS.members["Provider"]) - ) - - case 1: - kwargs["region"] = de.read_string( - _SCHEMA_CLOUD_DETAILS.members["Region"] - ) - - case 2: - kwargs["account"] = de.read_string( - _SCHEMA_CLOUD_DETAILS.members["Account"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CLOUD_DETAILS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CloudformationStack: - """ - Contains information about the CloudFormation stack involved in a - GuardDuty finding, including unique identifiers of the Amazon EC2 - instances. - """ - - ec2_instance_uids: list[str] | None = None - """ - A list of unique identifiers for the compromised Amazon EC2 instances - that were created as part of the same CloudFormation stack. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CLOUDFORMATION_STACK, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.ec2_instance_uids is not None: - _serialize_ec2_instance_uids( - serializer, - _SCHEMA_CLOUDFORMATION_STACK.members["Ec2InstanceUids"], - self.ec2_instance_uids, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["ec2_instance_uids"] = _deserialize_ec2_instance_uids( - de, _SCHEMA_CLOUDFORMATION_STACK.members["Ec2InstanceUids"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CLOUDFORMATION_STACK, consumer=_consumer) - return kwargs - - -class DataSourceStatus(UnknownEnumMixin, StrEnum): - ENABLED = "ENABLED" - DISABLED = "DISABLED" - - -@dataclass(kw_only=True) -class CloudTrailConfigurationResult: - """ - Contains information on the status of CloudTrail as a data source for - the detector. - """ - - status: str | None = None - """ - Describes whether CloudTrail is enabled as a data source for the - detector. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CLOUD_TRAIL_CONFIGURATION_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.status is not None: - serializer.write_string( - _SCHEMA_CLOUD_TRAIL_CONFIGURATION_RESULT.members["Status"], self.status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["status"] = DataSourceStatus( - de.read_string( - _SCHEMA_CLOUD_TRAIL_CONFIGURATION_RESULT.members["Status"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CLOUD_TRAIL_CONFIGURATION_RESULT, consumer=_consumer - ) - return kwargs - - -class ClusterStatus(UnknownEnumMixin, StrEnum): - CREATING = "CREATING" - ACTIVE = "ACTIVE" - DELETING = "DELETING" - FAILED = "FAILED" - UPDATING = "UPDATING" - PENDING = "PENDING" - - -def _serialize_eq( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_eq(deserializer: ShapeDeserializer, schema: Schema) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_equals( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_equals(deserializer: ShapeDeserializer, schema: Schema) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_matches( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_matches(deserializer: ShapeDeserializer, schema: Schema) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_neq( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_neq(deserializer: ShapeDeserializer, schema: Schema) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_not_equals( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_not_equals( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_not_matches( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_not_matches( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class Condition: - """Contains information about the condition.""" - - eq: list[str] | None = None - """ - Represents the *equal* condition to be applied to a single field when - querying for findings. - - Max values: 50 - """ - - neq: list[str] | None = None - """ - Represents the *not equal* condition to be applied to a single field - when querying for findings. - - Max values: 50 - """ - - gt: int | None = None - """ - Represents a *greater than* condition to be applied to a single field - when querying for findings. - """ - - gte: int | None = None - """ - Represents a *greater than or equal* condition to be applied to a single - field when querying for findings. - """ - - lt: int | None = None - """ - Represents a *less than* condition to be applied to a single field when - querying for findings. - """ - - lte: int | None = None - """ - Represents a *less than or equal* condition to be applied to a single - field when querying for findings. - """ - - equals: list[str] | None = None - """ - Represents an *equal* condition to be applied to a single field when - querying for findings. - - Max values: 50 - """ - - not_equals: list[str] | None = None - """ - Represents a *not equal* condition to be applied to a single field when - querying for findings. - - Max values: 50 - """ - - greater_than: int | None = None - """ - Represents a *greater than* condition to be applied to a single field - when querying for findings. - """ - - greater_than_or_equal: int | None = None - """ - Represents a *greater than or equal* condition to be applied to a single - field when querying for findings. - """ - - less_than: int | None = None - """ - Represents a *less than* condition to be applied to a single field when - querying for findings. - """ - - less_than_or_equal: int | None = None - """ - Represents a *less than or equal* condition to be applied to a single - field when querying for findings. - """ - - matches: list[str] | None = None - """ - Represents the *match* condition to be applied to a single field when - querying for findings. - - Note: - The *matches* condition is available only for create-filter and - update-filter APIs. - """ - - not_matches: list[str] | None = None - """ - Represents the *not match* condition to be applied to a single field - when querying for findings. - - Note: - The *not-matches* condition is available only for create-filter and - update-filter APIs. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONDITION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.eq is not None: - _serialize_eq(serializer, _SCHEMA_CONDITION.members["Eq"], self.eq) - - if self.neq is not None: - _serialize_neq(serializer, _SCHEMA_CONDITION.members["Neq"], self.neq) - - if self.gt is not None: - serializer.write_integer(_SCHEMA_CONDITION.members["Gt"], self.gt) - - if self.gte is not None: - serializer.write_integer(_SCHEMA_CONDITION.members["Gte"], self.gte) - - if self.lt is not None: - serializer.write_integer(_SCHEMA_CONDITION.members["Lt"], self.lt) - - if self.lte is not None: - serializer.write_integer(_SCHEMA_CONDITION.members["Lte"], self.lte) - - if self.equals is not None: - _serialize_equals( - serializer, _SCHEMA_CONDITION.members["Equals"], self.equals - ) - - if self.not_equals is not None: - _serialize_not_equals( - serializer, _SCHEMA_CONDITION.members["NotEquals"], self.not_equals - ) - - if self.greater_than is not None: - serializer.write_long( - _SCHEMA_CONDITION.members["GreaterThan"], self.greater_than - ) - - if self.greater_than_or_equal is not None: - serializer.write_long( - _SCHEMA_CONDITION.members["GreaterThanOrEqual"], - self.greater_than_or_equal, - ) - - if self.less_than is not None: - serializer.write_long(_SCHEMA_CONDITION.members["LessThan"], self.less_than) - - if self.less_than_or_equal is not None: - serializer.write_long( - _SCHEMA_CONDITION.members["LessThanOrEqual"], self.less_than_or_equal - ) - - if self.matches is not None: - _serialize_matches( - serializer, _SCHEMA_CONDITION.members["Matches"], self.matches - ) - - if self.not_matches is not None: - _serialize_not_matches( - serializer, _SCHEMA_CONDITION.members["NotMatches"], self.not_matches - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["eq"] = _deserialize_eq(de, _SCHEMA_CONDITION.members["Eq"]) - - case 1: - kwargs["neq"] = _deserialize_neq( - de, _SCHEMA_CONDITION.members["Neq"] - ) - - case 2: - kwargs["gt"] = de.read_integer(_SCHEMA_CONDITION.members["Gt"]) - - case 3: - kwargs["gte"] = de.read_integer(_SCHEMA_CONDITION.members["Gte"]) - - case 4: - kwargs["lt"] = de.read_integer(_SCHEMA_CONDITION.members["Lt"]) - - case 5: - kwargs["lte"] = de.read_integer(_SCHEMA_CONDITION.members["Lte"]) - - case 6: - kwargs["equals"] = _deserialize_equals( - de, _SCHEMA_CONDITION.members["Equals"] - ) - - case 7: - kwargs["not_equals"] = _deserialize_not_equals( - de, _SCHEMA_CONDITION.members["NotEquals"] - ) - - case 8: - kwargs["greater_than"] = de.read_long( - _SCHEMA_CONDITION.members["GreaterThan"] - ) - - case 9: - kwargs["greater_than_or_equal"] = de.read_long( - _SCHEMA_CONDITION.members["GreaterThanOrEqual"] - ) - - case 10: - kwargs["less_than"] = de.read_long( - _SCHEMA_CONDITION.members["LessThan"] - ) - - case 11: - kwargs["less_than_or_equal"] = de.read_long( - _SCHEMA_CONDITION.members["LessThanOrEqual"] - ) - - case 12: - kwargs["matches"] = _deserialize_matches( - de, _SCHEMA_CONDITION.members["Matches"] - ) - - case 13: - kwargs["not_matches"] = _deserialize_not_matches( - de, _SCHEMA_CONDITION.members["NotMatches"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONDITION, consumer=_consumer) - return kwargs - - -class Confidence(UnknownEnumMixin, StrEnum): - UNKNOWN = "Unknown" - LOW = "Low" - MEDIUM = "Medium" - HIGH = "High" - - -@dataclass(kw_only=True) -class ConflictException(ServiceError): - """A request conflict exception object.""" - - fault: Literal["client", "server"] | None = "client" - - type: str | None = None - """The error type.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONFLICT_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_CONFLICT_EXCEPTION.members["Message"], self.message - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_CONFLICT_EXCEPTION.members["Type"], self.type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_CONFLICT_EXCEPTION.members["Message"] - ) - - case 1: - kwargs["type"] = de.read_string( - _SCHEMA_CONFLICT_EXCEPTION.members["Type"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONFLICT_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class SecurityContext: - """Container security context.""" - - privileged: bool | None = None - """Whether the container is privileged.""" - - allow_privilege_escalation: bool | None = None - """ - Whether or not a container or a Kubernetes pod is allowed to gain more - privileges than its parent process. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SECURITY_CONTEXT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.privileged is not None: - serializer.write_boolean( - _SCHEMA_SECURITY_CONTEXT.members["Privileged"], self.privileged - ) - - if self.allow_privilege_escalation is not None: - serializer.write_boolean( - _SCHEMA_SECURITY_CONTEXT.members["AllowPrivilegeEscalation"], - self.allow_privilege_escalation, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["privileged"] = de.read_boolean( - _SCHEMA_SECURITY_CONTEXT.members["Privileged"] - ) - - case 1: - kwargs["allow_privilege_escalation"] = de.read_boolean( - _SCHEMA_SECURITY_CONTEXT.members["AllowPrivilegeEscalation"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SECURITY_CONTEXT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class VolumeMount: - """Container volume mount.""" - - name: str | None = None - """Volume mount name.""" - - mount_path: str | None = None - """Volume mount path.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VOLUME_MOUNT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string(_SCHEMA_VOLUME_MOUNT.members["Name"], self.name) - - if self.mount_path is not None: - serializer.write_string( - _SCHEMA_VOLUME_MOUNT.members["MountPath"], self.mount_path - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_VOLUME_MOUNT.members["Name"] - ) - - case 1: - kwargs["mount_path"] = de.read_string( - _SCHEMA_VOLUME_MOUNT.members["MountPath"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VOLUME_MOUNT, consumer=_consumer) - return kwargs - - -def _serialize_volume_mounts( - serializer: ShapeSerializer, schema: Schema, value: list[VolumeMount] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_volume_mounts( - deserializer: ShapeDeserializer, schema: Schema -) -> list[VolumeMount]: - result: list[VolumeMount] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(VolumeMount.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class Container: - """Details of a container.""" - - container_runtime: str | None = None - """ - The container runtime (such as, Docker or containerd) used to run the - container. - """ - - id: str | None = None - """Container ID.""" - - name: str | None = None - """Container name.""" - - image: str | None = None - """Container image.""" - - image_prefix: str | None = None - """ - Part of the image name before the last slash. For example, imagePrefix - for public.ecr.aws/amazonlinux/amazonlinux:latest would be - public.ecr.aws/amazonlinux. If the image name is relative and does not - have a slash, this field is empty. - """ - - volume_mounts: list[VolumeMount] | None = None - """Container volume mounts.""" - - security_context: SecurityContext | None = None - """Container security context.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTAINER, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.container_runtime is not None: - serializer.write_string( - _SCHEMA_CONTAINER.members["ContainerRuntime"], self.container_runtime - ) - - if self.id is not None: - serializer.write_string(_SCHEMA_CONTAINER.members["Id"], self.id) - - if self.name is not None: - serializer.write_string(_SCHEMA_CONTAINER.members["Name"], self.name) - - if self.image is not None: - serializer.write_string(_SCHEMA_CONTAINER.members["Image"], self.image) - - if self.image_prefix is not None: - serializer.write_string( - _SCHEMA_CONTAINER.members["ImagePrefix"], self.image_prefix - ) - - if self.volume_mounts is not None: - _serialize_volume_mounts( - serializer, - _SCHEMA_CONTAINER.members["VolumeMounts"], - self.volume_mounts, - ) - - if self.security_context is not None: - serializer.write_struct( - _SCHEMA_CONTAINER.members["SecurityContext"], self.security_context - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["container_runtime"] = de.read_string( - _SCHEMA_CONTAINER.members["ContainerRuntime"] - ) - - case 1: - kwargs["id"] = de.read_string(_SCHEMA_CONTAINER.members["Id"]) - - case 2: - kwargs["name"] = de.read_string(_SCHEMA_CONTAINER.members["Name"]) - - case 3: - kwargs["image"] = de.read_string(_SCHEMA_CONTAINER.members["Image"]) - - case 4: - kwargs["image_prefix"] = de.read_string( - _SCHEMA_CONTAINER.members["ImagePrefix"] - ) - - case 5: - kwargs["volume_mounts"] = _deserialize_volume_mounts( - de, _SCHEMA_CONTAINER.members["VolumeMounts"] - ) - - case 6: - kwargs["security_context"] = SecurityContext.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONTAINER, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ContainerFindingResource: - """ - Contains information about container resources involved in a GuardDuty - finding. This structure provides details about containers that were - identified as part of suspicious or malicious activity. - """ - - image: str | None = None - """ - The container image information, including the image name and tag used - to run the container that was involved in the finding. - """ - - image_uid: str | None = None - """The unique ID associated with the container image.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTAINER_FINDING_RESOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.image is not None: - serializer.write_string( - _SCHEMA_CONTAINER_FINDING_RESOURCE.members["Image"], self.image - ) - - if self.image_uid is not None: - serializer.write_string( - _SCHEMA_CONTAINER_FINDING_RESOURCE.members["ImageUid"], self.image_uid - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["image"] = de.read_string( - _SCHEMA_CONTAINER_FINDING_RESOURCE.members["Image"] - ) - - case 1: - kwargs["image_uid"] = de.read_string( - _SCHEMA_CONTAINER_FINDING_RESOURCE.members["ImageUid"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONTAINER_FINDING_RESOURCE, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ContainerInstanceDetails: - """ - Contains information about the Amazon EC2 instance that is running the - Amazon ECS container. - """ - - covered_container_instances: int | None = None - """ - Represents the nodes in the Amazon ECS cluster that has a `HEALTHY` - coverage status. - """ - - compatible_container_instances: int | None = None - """Represents total number of nodes in the Amazon ECS cluster.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTAINER_INSTANCE_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.covered_container_instances is not None: - serializer.write_long( - _SCHEMA_CONTAINER_INSTANCE_DETAILS.members["CoveredContainerInstances"], - self.covered_container_instances, - ) - - if self.compatible_container_instances is not None: - serializer.write_long( - _SCHEMA_CONTAINER_INSTANCE_DETAILS.members[ - "CompatibleContainerInstances" - ], - self.compatible_container_instances, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["covered_container_instances"] = de.read_long( - _SCHEMA_CONTAINER_INSTANCE_DETAILS.members[ - "CoveredContainerInstances" - ] - ) - - case 1: - kwargs["compatible_container_instances"] = de.read_long( - _SCHEMA_CONTAINER_INSTANCE_DETAILS.members[ - "CompatibleContainerInstances" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONTAINER_INSTANCE_DETAILS, consumer=_consumer) - return kwargs - - -def _serialize_containers( - serializer: ShapeSerializer, schema: Schema, value: list[Container] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_containers( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Container]: - result: list[Container] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Container.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_container_uids( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_container_uids( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ContinuousScanDetails: - """ - Contains information about the time range within the continuous backup - in Amazon Web Services Backup to scan for a point-in-time recovery - resource. - """ - - end_time: datetime - """The timestamp representing the end of the time range to scan.""" - - start_time: datetime | None = None - """ - The timestamp representing the start of the time range to scan. Reserved - for internal use. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTINUOUS_SCAN_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.start_time is not None: - serializer.write_timestamp( - _SCHEMA_CONTINUOUS_SCAN_DETAILS.members["StartTime"], self.start_time - ) - - serializer.write_timestamp( - _SCHEMA_CONTINUOUS_SCAN_DETAILS.members["EndTime"], self.end_time - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["start_time"] = de.read_timestamp( - _SCHEMA_CONTINUOUS_SCAN_DETAILS.members["StartTime"] - ) - - case 1: - kwargs["end_time"] = de.read_timestamp( - _SCHEMA_CONTINUOUS_SCAN_DETAILS.members["EndTime"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONTINUOUS_SCAN_DETAILS, consumer=_consumer) - if "end_time" not in kwargs: - kwargs["end_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -class CoverageStatus(UnknownEnumMixin, StrEnum): - HEALTHY = "HEALTHY" - UNHEALTHY = "UNHEALTHY" - - -def _serialize_count_by_coverage_status( - serializer: ShapeSerializer, schema: Schema, value: dict[str, int] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_long(value_schema, v)) - - -def _deserialize_count_by_coverage_status( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, int]: - result: dict[str, int] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_long(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -class ResourceType(UnknownEnumMixin, StrEnum): - EKS = "EKS" - ECS = "ECS" - EC2 = "EC2" - - -def _serialize_count_by_resource_type( - serializer: ShapeSerializer, schema: Schema, value: dict[str, int] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_long(value_schema, v)) - - -def _deserialize_count_by_resource_type( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, int]: - result: dict[str, int] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_long(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -def _serialize_count_by_severity( - serializer: ShapeSerializer, schema: Schema, value: dict[str, int] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_integer(value_schema, v)) - - -def _deserialize_count_by_severity( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, int]: - result: dict[str, int] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_integer(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -class ManagementType(UnknownEnumMixin, StrEnum): - AUTO_MANAGED = "AUTO_MANAGED" - MANUAL = "MANUAL" - DISABLED = "DISABLED" - - -@dataclass(kw_only=True) -class CoverageEc2InstanceDetails: - """ - Contains information about the Amazon EC2 instance runtime coverage - details. - """ - - instance_id: str | None = None - """The Amazon EC2 instance ID.""" - - instance_type: str | None = None - """The instance type of the Amazon EC2 instance.""" - - cluster_arn: str | None = None - """ - The cluster ARN of the Amazon ECS cluster running on the Amazon EC2 - instance. - """ - - agent_details: AgentDetails | None = None - """Information about the installed security agent.""" - - management_type: str | None = None - """ - Indicates how the GuardDuty security agent is managed for this resource. - - - `AUTO_MANAGED` indicates that GuardDuty deploys and manages updates - for this resource. - - - `MANUAL` indicates that you are responsible to deploy, update, and - manage the GuardDuty security agent updates for this resource. - - Note: - The `DISABLED` status doesn't apply to Amazon EC2 instances and Amazon - EKS clusters. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_COVERAGE_EC2_INSTANCE_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.instance_id is not None: - serializer.write_string( - _SCHEMA_COVERAGE_EC2_INSTANCE_DETAILS.members["InstanceId"], - self.instance_id, - ) - - if self.instance_type is not None: - serializer.write_string( - _SCHEMA_COVERAGE_EC2_INSTANCE_DETAILS.members["InstanceType"], - self.instance_type, - ) - - if self.cluster_arn is not None: - serializer.write_string( - _SCHEMA_COVERAGE_EC2_INSTANCE_DETAILS.members["ClusterArn"], - self.cluster_arn, - ) - - if self.agent_details is not None: - serializer.write_struct( - _SCHEMA_COVERAGE_EC2_INSTANCE_DETAILS.members["AgentDetails"], - self.agent_details, - ) - - if self.management_type is not None: - serializer.write_string( - _SCHEMA_COVERAGE_EC2_INSTANCE_DETAILS.members["ManagementType"], - self.management_type, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["instance_id"] = de.read_string( - _SCHEMA_COVERAGE_EC2_INSTANCE_DETAILS.members["InstanceId"] - ) - - case 1: - kwargs["instance_type"] = de.read_string( - _SCHEMA_COVERAGE_EC2_INSTANCE_DETAILS.members["InstanceType"] - ) - - case 2: - kwargs["cluster_arn"] = de.read_string( - _SCHEMA_COVERAGE_EC2_INSTANCE_DETAILS.members["ClusterArn"] - ) - - case 3: - kwargs["agent_details"] = AgentDetails.deserialize(de) - - case 4: - kwargs["management_type"] = ManagementType( - de.read_string( - _SCHEMA_COVERAGE_EC2_INSTANCE_DETAILS.members[ - "ManagementType" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_COVERAGE_EC2_INSTANCE_DETAILS, consumer=_consumer - ) - return kwargs - - -def _serialize_issues( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_issues(deserializer: ShapeDeserializer, schema: Schema) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class FargateDetails: - """ - Contains information about Amazon Web Services Fargate details - associated with an Amazon ECS cluster. - """ - - issues: list[str] | None = None - """ - Runtime coverage issues identified for the resource running on Amazon - Web Services Fargate. - """ - - management_type: str | None = None - """ - Indicates how the GuardDuty security agent is managed for this resource. - - - `AUTO_MANAGED` indicates that GuardDuty deploys and manages updates - for this resource. - - - `DISABLED` indicates that the deployment of the GuardDuty security - agent is disabled for this resource. - - Note: - The `MANUAL` status doesn't apply to the Amazon Web Services Fargate - (Amazon ECS only) woprkloads. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FARGATE_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.issues is not None: - _serialize_issues( - serializer, _SCHEMA_FARGATE_DETAILS.members["Issues"], self.issues - ) - - if self.management_type is not None: - serializer.write_string( - _SCHEMA_FARGATE_DETAILS.members["ManagementType"], self.management_type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["issues"] = _deserialize_issues( - de, _SCHEMA_FARGATE_DETAILS.members["Issues"] - ) - - case 1: - kwargs["management_type"] = ManagementType( - de.read_string( - _SCHEMA_FARGATE_DETAILS.members["ManagementType"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FARGATE_DETAILS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CoverageEcsClusterDetails: - """Contains information about Amazon ECS cluster runtime coverage details.""" - - cluster_name: str | None = None - """The name of the Amazon ECS cluster.""" - - fargate_details: FargateDetails | None = None - """ - Information about the Fargate details associated with the Amazon ECS - cluster. - """ - - container_instance_details: ContainerInstanceDetails | None = None - """ - Information about the Amazon ECS container running on Amazon EC2 - instance. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_COVERAGE_ECS_CLUSTER_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.cluster_name is not None: - serializer.write_string( - _SCHEMA_COVERAGE_ECS_CLUSTER_DETAILS.members["ClusterName"], - self.cluster_name, - ) - - if self.fargate_details is not None: - serializer.write_struct( - _SCHEMA_COVERAGE_ECS_CLUSTER_DETAILS.members["FargateDetails"], - self.fargate_details, - ) - - if self.container_instance_details is not None: - serializer.write_struct( - _SCHEMA_COVERAGE_ECS_CLUSTER_DETAILS.members[ - "ContainerInstanceDetails" - ], - self.container_instance_details, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["cluster_name"] = de.read_string( - _SCHEMA_COVERAGE_ECS_CLUSTER_DETAILS.members["ClusterName"] - ) - - case 1: - kwargs["fargate_details"] = FargateDetails.deserialize(de) - - case 2: - kwargs["container_instance_details"] = ( - ContainerInstanceDetails.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_COVERAGE_ECS_CLUSTER_DETAILS, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CoverageEksClusterDetails: - """Information about the EKS cluster that has a coverage status.""" - - cluster_name: str | None = None - """Name of the EKS cluster.""" - - covered_nodes: int | None = None - """ - Represents the nodes within the EKS cluster that have a `HEALTHY` - coverage status. - """ - - compatible_nodes: int | None = None - """Represents all the nodes within the EKS cluster in your account.""" - - addon_details: AddonDetails | None = None - """Information about the installed EKS add-on.""" - - management_type: str | None = None - """ - Indicates how the Amazon EKS add-on GuardDuty agent is managed for this - EKS cluster. - - `AUTO_MANAGED` indicates GuardDuty deploys and manages updates for this - resource. - - `MANUAL` indicates that you are responsible to deploy, update, and - manage the Amazon EKS add-on GuardDuty agent for this resource. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_COVERAGE_EKS_CLUSTER_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.cluster_name is not None: - serializer.write_string( - _SCHEMA_COVERAGE_EKS_CLUSTER_DETAILS.members["ClusterName"], - self.cluster_name, - ) - - if self.covered_nodes is not None: - serializer.write_long( - _SCHEMA_COVERAGE_EKS_CLUSTER_DETAILS.members["CoveredNodes"], - self.covered_nodes, - ) - - if self.compatible_nodes is not None: - serializer.write_long( - _SCHEMA_COVERAGE_EKS_CLUSTER_DETAILS.members["CompatibleNodes"], - self.compatible_nodes, - ) - - if self.addon_details is not None: - serializer.write_struct( - _SCHEMA_COVERAGE_EKS_CLUSTER_DETAILS.members["AddonDetails"], - self.addon_details, - ) - - if self.management_type is not None: - serializer.write_string( - _SCHEMA_COVERAGE_EKS_CLUSTER_DETAILS.members["ManagementType"], - self.management_type, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["cluster_name"] = de.read_string( - _SCHEMA_COVERAGE_EKS_CLUSTER_DETAILS.members["ClusterName"] - ) - - case 1: - kwargs["covered_nodes"] = de.read_long( - _SCHEMA_COVERAGE_EKS_CLUSTER_DETAILS.members["CoveredNodes"] - ) - - case 2: - kwargs["compatible_nodes"] = de.read_long( - _SCHEMA_COVERAGE_EKS_CLUSTER_DETAILS.members["CompatibleNodes"] - ) - - case 3: - kwargs["addon_details"] = AddonDetails.deserialize(de) - - case 4: - kwargs["management_type"] = ManagementType( - de.read_string( - _SCHEMA_COVERAGE_EKS_CLUSTER_DETAILS.members[ - "ManagementType" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_COVERAGE_EKS_CLUSTER_DETAILS, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CoverageFilterCondition: - """ - Represents a condition that when matched will be added to the response - of the operation. - """ - - equals: list[str] | None = None - """ - Represents an equal condition that is applied to a single field while - retrieving the coverage details. - """ - - not_equals: list[str] | None = None - """ - Represents a not equal condition that is applied to a single field while - retrieving the coverage details. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_COVERAGE_FILTER_CONDITION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.equals is not None: - _serialize_equals( - serializer, - _SCHEMA_COVERAGE_FILTER_CONDITION.members["Equals"], - self.equals, - ) - - if self.not_equals is not None: - _serialize_not_equals( - serializer, - _SCHEMA_COVERAGE_FILTER_CONDITION.members["NotEquals"], - self.not_equals, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["equals"] = _deserialize_equals( - de, _SCHEMA_COVERAGE_FILTER_CONDITION.members["Equals"] - ) - - case 1: - kwargs["not_equals"] = _deserialize_not_equals( - de, _SCHEMA_COVERAGE_FILTER_CONDITION.members["NotEquals"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_COVERAGE_FILTER_CONDITION, consumer=_consumer) - return kwargs - - -class CoverageFilterCriterionKey(UnknownEnumMixin, StrEnum): - ACCOUNT_ID = "ACCOUNT_ID" - RESOURCE_TYPE = "RESOURCE_TYPE" - COVERAGE_STATUS = "COVERAGE_STATUS" - ADDON_VERSION = "ADDON_VERSION" - CLUSTER_NAME = "CLUSTER_NAME" - ECS_CLUSTER_NAME = "ECS_CLUSTER_NAME" - MANAGEMENT_TYPE = "MANAGEMENT_TYPE" - EKS_CLUSTER_NAME = "EKS_CLUSTER_NAME" - AGENT_VERSION = "AGENT_VERSION" - INSTANCE_ID = "INSTANCE_ID" - CLUSTER_ARN = "CLUSTER_ARN" - - -@dataclass(kw_only=True) -class CoverageFilterCriterion: - """ - Represents a condition that when matched will be added to the response - of the operation. - """ - - criterion_key: str | None = None - """ - An enum value representing possible filter fields. - - Note: - Replace the enum value `CLUSTER_NAME` with `EKS_CLUSTER_NAME`. - `CLUSTER_NAME` has been deprecated. - """ - - filter_condition: CoverageFilterCondition | None = None - """Contains information about the condition.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_COVERAGE_FILTER_CRITERION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.criterion_key is not None: - serializer.write_string( - _SCHEMA_COVERAGE_FILTER_CRITERION.members["CriterionKey"], - self.criterion_key, - ) - - if self.filter_condition is not None: - serializer.write_struct( - _SCHEMA_COVERAGE_FILTER_CRITERION.members["FilterCondition"], - self.filter_condition, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["criterion_key"] = CoverageFilterCriterionKey( - de.read_string( - _SCHEMA_COVERAGE_FILTER_CRITERION.members["CriterionKey"] - ) - ) - - case 1: - kwargs["filter_condition"] = CoverageFilterCondition.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_COVERAGE_FILTER_CRITERION, consumer=_consumer) - return kwargs - - -def _serialize_coverage_filter_criterion_list( - serializer: ShapeSerializer, schema: Schema, value: list[CoverageFilterCriterion] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_coverage_filter_criterion_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[CoverageFilterCriterion]: - result: list[CoverageFilterCriterion] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(CoverageFilterCriterion.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CoverageFilterCriteria: - """Represents the criteria used in the filter.""" - - filter_criterion: list[CoverageFilterCriterion] | None = None - """ - Represents a condition that when matched will be added to the response - of the operation. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_COVERAGE_FILTER_CRITERIA, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.filter_criterion is not None: - _serialize_coverage_filter_criterion_list( - serializer, - _SCHEMA_COVERAGE_FILTER_CRITERIA.members["FilterCriterion"], - self.filter_criterion, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["filter_criterion"] = ( - _deserialize_coverage_filter_criterion_list( - de, - _SCHEMA_COVERAGE_FILTER_CRITERIA.members["FilterCriterion"], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_COVERAGE_FILTER_CRITERIA, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CoverageResourceDetails: - """Information about the resource for each individual EKS cluster.""" - - eks_cluster_details: CoverageEksClusterDetails | None = None - """EKS cluster details involved in the coverage statistics.""" - - ecs_cluster_details: CoverageEcsClusterDetails | None = None - """ - Information about the Amazon ECS cluster that is assessed for runtime - coverage. - """ - - ec2_instance_details: CoverageEc2InstanceDetails | None = None - """Information about the Amazon EC2 instance assessed for runtime coverage.""" - - resource_type: str | None = None - """The type of Amazon Web Services resource.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_COVERAGE_RESOURCE_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.eks_cluster_details is not None: - serializer.write_struct( - _SCHEMA_COVERAGE_RESOURCE_DETAILS.members["EksClusterDetails"], - self.eks_cluster_details, - ) - - if self.ecs_cluster_details is not None: - serializer.write_struct( - _SCHEMA_COVERAGE_RESOURCE_DETAILS.members["EcsClusterDetails"], - self.ecs_cluster_details, - ) - - if self.ec2_instance_details is not None: - serializer.write_struct( - _SCHEMA_COVERAGE_RESOURCE_DETAILS.members["Ec2InstanceDetails"], - self.ec2_instance_details, - ) - - if self.resource_type is not None: - serializer.write_string( - _SCHEMA_COVERAGE_RESOURCE_DETAILS.members["ResourceType"], - self.resource_type, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["eks_cluster_details"] = ( - CoverageEksClusterDetails.deserialize(de) - ) - - case 1: - kwargs["ecs_cluster_details"] = ( - CoverageEcsClusterDetails.deserialize(de) - ) - - case 2: - kwargs["ec2_instance_details"] = ( - CoverageEc2InstanceDetails.deserialize(de) - ) - - case 3: - kwargs["resource_type"] = ResourceType( - de.read_string( - _SCHEMA_COVERAGE_RESOURCE_DETAILS.members["ResourceType"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_COVERAGE_RESOURCE_DETAILS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CoverageResource: - """Information about the resource of the GuardDuty account.""" - - resource_id: str | None = None - """The unique ID of the resource.""" - - detector_id: str | None = None - """The unique ID of the GuardDuty detector associated with the resource.""" - - account_id: str | None = None - """The unique ID of the Amazon Web Services account.""" - - resource_details: CoverageResourceDetails | None = None - """ - Information about the resource for which the coverage statistics are - retrieved. - """ - - coverage_status: str | None = None - """Represents the status of the EKS cluster coverage.""" - - issue: str | None = None - """ - Represents the reason why a coverage status was `UNHEALTHY` for the EKS - cluster. - """ - - updated_at: datetime | None = None - """ - The timestamp at which the coverage details for the resource were last - updated. This is in UTC format. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_COVERAGE_RESOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_id is not None: - serializer.write_string( - _SCHEMA_COVERAGE_RESOURCE.members["ResourceId"], self.resource_id - ) - - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_COVERAGE_RESOURCE.members["DetectorId"], self.detector_id - ) - - if self.account_id is not None: - serializer.write_string( - _SCHEMA_COVERAGE_RESOURCE.members["AccountId"], self.account_id - ) - - if self.resource_details is not None: - serializer.write_struct( - _SCHEMA_COVERAGE_RESOURCE.members["ResourceDetails"], - self.resource_details, - ) - - if self.coverage_status is not None: - serializer.write_string( - _SCHEMA_COVERAGE_RESOURCE.members["CoverageStatus"], - self.coverage_status, - ) - - if self.issue is not None: - serializer.write_string( - _SCHEMA_COVERAGE_RESOURCE.members["Issue"], self.issue - ) - - if self.updated_at is not None: - serializer.write_timestamp( - _SCHEMA_COVERAGE_RESOURCE.members["UpdatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_id"] = de.read_string( - _SCHEMA_COVERAGE_RESOURCE.members["ResourceId"] - ) - - case 1: - kwargs["detector_id"] = de.read_string( - _SCHEMA_COVERAGE_RESOURCE.members["DetectorId"] - ) - - case 2: - kwargs["account_id"] = de.read_string( - _SCHEMA_COVERAGE_RESOURCE.members["AccountId"] - ) - - case 3: - kwargs["resource_details"] = CoverageResourceDetails.deserialize(de) - - case 4: - kwargs["coverage_status"] = CoverageStatus( - de.read_string( - _SCHEMA_COVERAGE_RESOURCE.members["CoverageStatus"] - ) - ) - - case 5: - kwargs["issue"] = de.read_string( - _SCHEMA_COVERAGE_RESOURCE.members["Issue"] - ) - - case 6: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_COVERAGE_RESOURCE.members["UpdatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_COVERAGE_RESOURCE, consumer=_consumer) - return kwargs - - -def _serialize_coverage_resources( - serializer: ShapeSerializer, schema: Schema, value: list[CoverageResource] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_coverage_resources( - deserializer: ShapeDeserializer, schema: Schema -) -> list[CoverageResource]: - result: list[CoverageResource] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(CoverageResource.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class CoverageSortKey(UnknownEnumMixin, StrEnum): - ACCOUNT_ID = "ACCOUNT_ID" - COVERAGE_STATUS = "COVERAGE_STATUS" - ISSUE = "ISSUE" - ADDON_VERSION = "ADDON_VERSION" - UPDATED_AT = "UPDATED_AT" - CLUSTER_NAME = "CLUSTER_NAME" - EKS_CLUSTER_NAME = "EKS_CLUSTER_NAME" - ECS_CLUSTER_NAME = "ECS_CLUSTER_NAME" - INSTANCE_ID = "INSTANCE_ID" - - -class OrderBy(UnknownEnumMixin, StrEnum): - ASC = "ASC" - DESC = "DESC" - - -@dataclass(kw_only=True) -class CoverageSortCriteria: - """Information about the sorting criteria used in the coverage statistics.""" - - attribute_name: str | None = None - """ - Represents the field name used to sort the coverage details. - - Note: - Replace the enum value `CLUSTER_NAME` with `EKS_CLUSTER_NAME`. - `CLUSTER_NAME` has been deprecated. - """ - - order_by: str | None = None - """The order in which the sorted findings are to be displayed.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_COVERAGE_SORT_CRITERIA, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.attribute_name is not None: - serializer.write_string( - _SCHEMA_COVERAGE_SORT_CRITERIA.members["AttributeName"], - self.attribute_name, - ) - - if self.order_by is not None: - serializer.write_string( - _SCHEMA_COVERAGE_SORT_CRITERIA.members["OrderBy"], self.order_by - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["attribute_name"] = CoverageSortKey( - de.read_string( - _SCHEMA_COVERAGE_SORT_CRITERIA.members["AttributeName"] - ) - ) - - case 1: - kwargs["order_by"] = OrderBy( - de.read_string( - _SCHEMA_COVERAGE_SORT_CRITERIA.members["OrderBy"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_COVERAGE_SORT_CRITERIA, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CoverageStatistics: - """Information about the coverage statistics for a resource.""" - - count_by_resource_type: dict[str, int] | None = None - """ - Represents coverage statistics for EKS clusters aggregated by resource - type. - """ - - count_by_coverage_status: dict[str, int] | None = None - """ - Represents coverage statistics for EKS clusters aggregated by coverage - status. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_COVERAGE_STATISTICS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.count_by_resource_type is not None: - _serialize_count_by_resource_type( - serializer, - _SCHEMA_COVERAGE_STATISTICS.members["CountByResourceType"], - self.count_by_resource_type, - ) - - if self.count_by_coverage_status is not None: - _serialize_count_by_coverage_status( - serializer, - _SCHEMA_COVERAGE_STATISTICS.members["CountByCoverageStatus"], - self.count_by_coverage_status, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["count_by_resource_type"] = ( - _deserialize_count_by_resource_type( - de, - _SCHEMA_COVERAGE_STATISTICS.members["CountByResourceType"], - ) - ) - - case 1: - kwargs["count_by_coverage_status"] = ( - _deserialize_count_by_coverage_status( - de, - _SCHEMA_COVERAGE_STATISTICS.members[ - "CountByCoverageStatus" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_COVERAGE_STATISTICS, consumer=_consumer) - return kwargs - - -class CoverageStatisticsType(UnknownEnumMixin, StrEnum): - COUNT_BY_RESOURCE_TYPE = "COUNT_BY_RESOURCE_TYPE" - COUNT_BY_COVERAGE_STATUS = "COUNT_BY_COVERAGE_STATUS" - - -def _serialize_coverage_statistics_type_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_coverage_statistics_type_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(CoverageStatisticsType(d.read_string(member_schema))) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_tag_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_tag_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CreateCustomDetectionRuleAssociationInput: - """Dataclass for CreateCustomDetectionRuleAssociationInput structure.""" - - rule_id: str | None = None - """The unique identifier for the custom detection rule.""" - - mode: str | None = None - """The rule execution mode. Valid values: `LIVE` | `DRY_RUN`.""" - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the operation - completes no more than one time. Maximum 64 characters. - """ - - tags: dict[str, str] | None = None - """ - The tags to be added to the new custom detection rule association - resource. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CREATE_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rule_id is not None: - serializer.write_string( - _SCHEMA_CREATE_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT.members[ - "RuleId" - ], - self.rule_id, - ) - - if self.mode is not None: - serializer.write_string( - _SCHEMA_CREATE_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT.members["Mode"], - self.mode, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT.members[ - "ClientToken" - ], - self.client_token, - ) - - if self.tags is not None: - _serialize_tag_map( - serializer, - _SCHEMA_CREATE_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT.members["Tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rule_id"] = de.read_string( - _SCHEMA_CREATE_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT.members[ - "RuleId" - ] - ) - - case 1: - kwargs["mode"] = AssociationMode( - de.read_string( - _SCHEMA_CREATE_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT.members[ - "Mode" - ] - ) - ) - - case 2: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT.members[ - "ClientToken" - ] - ) - - case 3: - kwargs["tags"] = _deserialize_tag_map( - de, - _SCHEMA_CREATE_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT.members[ - "Tags" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CreateCustomDetectionRuleAssociationOutput: - """Dataclass for CreateCustomDetectionRuleAssociationOutput structure.""" - - rule_association: AssociationDetail | None = None - """The details of the newly created custom detection rule association.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CREATE_CUSTOM_DETECTION_RULE_ASSOCIATION_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rule_association is not None: - serializer.write_struct( - _SCHEMA_CREATE_CUSTOM_DETECTION_RULE_ASSOCIATION_OUTPUT.members[ - "RuleAssociation" - ], - self.rule_association, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rule_association"] = AssociationDetail.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_CUSTOM_DETECTION_RULE_ASSOCIATION_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ResourceNotFoundException(ServiceError): - """The requested resource can't be found.""" - - fault: Literal["client", "server"] | None = "client" - - type: str | None = None - """The error type.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["Message"], self.message - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["Type"], self.type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["Message"] - ) - - case 1: - kwargs["type"] = de.read_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["Type"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, consumer=_consumer - ) - return kwargs - - -CREATE_CUSTOM_DETECTION_RULE_ASSOCIATION = APIOperation( - input=CreateCustomDetectionRuleAssociationInput, - output=CreateCustomDetectionRuleAssociationOutput, - schema=_SCHEMA_CREATE_CUSTOM_DETECTION_RULE_ASSOCIATION, - input_schema=_SCHEMA_CREATE_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT, - output_schema=_SCHEMA_CREATE_CUSTOM_DETECTION_RULE_ASSOCIATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.guardduty#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID("com.amazonaws.guardduty#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - ShapeID( - "com.amazonaws.guardduty#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - ], -) - - -def _serialize_detection_rule_account_ids( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_detection_rule_account_ids( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CreateCustomDetectionRuleOrgConfigurationInput: - """Dataclass for CreateCustomDetectionRuleOrgConfigurationInput structure.""" - - rule_id: str | None = None - """The unique identifier for the custom detection rule.""" - - mode: str | None = None - """ - The execution mode of the organization configuration. Valid values: - `LIVE` | `DRY_RUN`. - """ - - include_account_ids: list[str] | None = None - """ - The account IDs to include in the organization configuration. Mutually - exclusive with `ExcludeAccountIds`. - """ - - exclude_account_ids: list[str] | None = None - """ - The account IDs to exclude from the organization configuration. Mutually - exclusive with `IncludeAccountIds`. - """ - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure that the operation - completes no more than one time. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CREATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rule_id is not None: - serializer.write_string( - _SCHEMA_CREATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT.members[ - "RuleId" - ], - self.rule_id, - ) - - if self.mode is not None: - serializer.write_string( - _SCHEMA_CREATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT.members[ - "Mode" - ], - self.mode, - ) - - if self.include_account_ids is not None: - _serialize_detection_rule_account_ids( - serializer, - _SCHEMA_CREATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT.members[ - "IncludeAccountIds" - ], - self.include_account_ids, - ) - - if self.exclude_account_ids is not None: - _serialize_detection_rule_account_ids( - serializer, - _SCHEMA_CREATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT.members[ - "ExcludeAccountIds" - ], - self.exclude_account_ids, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT.members[ - "ClientToken" - ], - self.client_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rule_id"] = de.read_string( - _SCHEMA_CREATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT.members[ - "RuleId" - ] - ) - - case 1: - kwargs["mode"] = AssociationMode( - de.read_string( - _SCHEMA_CREATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT.members[ - "Mode" - ] - ) - ) - - case 2: - kwargs["include_account_ids"] = ( - _deserialize_detection_rule_account_ids( - de, - _SCHEMA_CREATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT.members[ - "IncludeAccountIds" - ], - ) - ) - - case 3: - kwargs["exclude_account_ids"] = ( - _deserialize_detection_rule_account_ids( - de, - _SCHEMA_CREATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT.members[ - "ExcludeAccountIds" - ], - ) - ) - - case 4: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT.members[ - "ClientToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT, - consumer=_consumer, - ) - return kwargs - - -@dataclass(kw_only=True) -class CreateCustomDetectionRuleOrgConfigurationOutput: - """Dataclass for CreateCustomDetectionRuleOrgConfigurationOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CREATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_OUTPUT, - consumer=_consumer, - ) - return kwargs - - -CREATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION = APIOperation( - input=CreateCustomDetectionRuleOrgConfigurationInput, - output=CreateCustomDetectionRuleOrgConfigurationOutput, - schema=_SCHEMA_CREATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION, - input_schema=_SCHEMA_CREATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT, - output_schema=_SCHEMA_CREATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.guardduty#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID("com.amazonaws.guardduty#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - ShapeID( - "com.amazonaws.guardduty#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class KubernetesAuditLogsConfiguration: - """Describes whether Kubernetes audit logs are enabled as a data source.""" - - enable: bool | None = None - """The status of Kubernetes audit logs as a data source.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KUBERNETES_AUDIT_LOGS_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.enable is not None: - serializer.write_boolean( - _SCHEMA_KUBERNETES_AUDIT_LOGS_CONFIGURATION.members["Enable"], - self.enable, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["enable"] = de.read_boolean( - _SCHEMA_KUBERNETES_AUDIT_LOGS_CONFIGURATION.members["Enable"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_KUBERNETES_AUDIT_LOGS_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class KubernetesConfiguration: - """Describes whether any Kubernetes data sources are enabled.""" - - audit_logs: KubernetesAuditLogsConfiguration | None = None - """The status of Kubernetes audit logs as a data source.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KUBERNETES_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.audit_logs is not None: - serializer.write_struct( - _SCHEMA_KUBERNETES_CONFIGURATION.members["AuditLogs"], self.audit_logs - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["audit_logs"] = KubernetesAuditLogsConfiguration.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_KUBERNETES_CONFIGURATION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ScanEc2InstanceWithFindings: - """ - Describes whether Malware Protection for EC2 instances with findings - will be enabled as a data source. - """ - - ebs_volumes: bool | None = None - """Describes the configuration for scanning EBS volumes as data source.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SCAN_EC2_INSTANCE_WITH_FINDINGS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.ebs_volumes is not None: - serializer.write_boolean( - _SCHEMA_SCAN_EC2_INSTANCE_WITH_FINDINGS.members["EbsVolumes"], - self.ebs_volumes, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["ebs_volumes"] = de.read_boolean( - _SCHEMA_SCAN_EC2_INSTANCE_WITH_FINDINGS.members["EbsVolumes"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SCAN_EC2_INSTANCE_WITH_FINDINGS, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class MalwareProtectionConfiguration: - """Describes whether Malware Protection will be enabled as a data source.""" - - scan_ec2_instance_with_findings: ScanEc2InstanceWithFindings | None = None - """ - Describes the configuration of Malware Protection for EC2 instances with - findings. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MALWARE_PROTECTION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.scan_ec2_instance_with_findings is not None: - serializer.write_struct( - _SCHEMA_MALWARE_PROTECTION_CONFIGURATION.members[ - "ScanEc2InstanceWithFindings" - ], - self.scan_ec2_instance_with_findings, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["scan_ec2_instance_with_findings"] = ( - ScanEc2InstanceWithFindings.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MALWARE_PROTECTION_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class S3LogsConfiguration: - """Describes whether S3 data event logs will be enabled as a data source.""" - - enable: bool | None = None - """The status of S3 data event logs as a data source.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_S3_LOGS_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.enable is not None: - serializer.write_boolean( - _SCHEMA_S3_LOGS_CONFIGURATION.members["Enable"], self.enable - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["enable"] = de.read_boolean( - _SCHEMA_S3_LOGS_CONFIGURATION.members["Enable"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_S3_LOGS_CONFIGURATION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DataSourceConfigurations: - """Contains information about which data sources are enabled.""" - - s3_logs: S3LogsConfiguration | None = None - """Describes whether S3 data event logs are enabled as a data source.""" - - kubernetes: KubernetesConfiguration | None = None - """Describes whether any Kubernetes logs are enabled as data sources.""" - - malware_protection: MalwareProtectionConfiguration | None = None - """Describes whether Malware Protection is enabled as a data source.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DATA_SOURCE_CONFIGURATIONS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.s3_logs is not None: - serializer.write_struct( - _SCHEMA_DATA_SOURCE_CONFIGURATIONS.members["S3Logs"], self.s3_logs - ) - - if self.kubernetes is not None: - serializer.write_struct( - _SCHEMA_DATA_SOURCE_CONFIGURATIONS.members["Kubernetes"], - self.kubernetes, - ) - - if self.malware_protection is not None: - serializer.write_struct( - _SCHEMA_DATA_SOURCE_CONFIGURATIONS.members["MalwareProtection"], - self.malware_protection, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["s3_logs"] = S3LogsConfiguration.deserialize(de) - - case 1: - kwargs["kubernetes"] = KubernetesConfiguration.deserialize(de) - - case 2: - kwargs["malware_protection"] = ( - MalwareProtectionConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DATA_SOURCE_CONFIGURATIONS, consumer=_consumer) - return kwargs - - -class FeatureAdditionalConfiguration(UnknownEnumMixin, StrEnum): - EKS_ADDON_MANAGEMENT = "EKS_ADDON_MANAGEMENT" - ECS_FARGATE_AGENT_MANAGEMENT = "ECS_FARGATE_AGENT_MANAGEMENT" - EC2_AGENT_MANAGEMENT = "EC2_AGENT_MANAGEMENT" - - -class FeatureStatus(UnknownEnumMixin, StrEnum): - ENABLED = "ENABLED" - DISABLED = "DISABLED" - - -@dataclass(kw_only=True) -class DetectorAdditionalConfiguration: - """ - Information about the additional configuration for a feature in your - GuardDuty account. - """ - - name: str | None = None - """Name of the additional configuration.""" - - status: str | None = None - """Status of the additional configuration.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DETECTOR_ADDITIONAL_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_DETECTOR_ADDITIONAL_CONFIGURATION.members["Name"], self.name - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_DETECTOR_ADDITIONAL_CONFIGURATION.members["Status"], self.status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = FeatureAdditionalConfiguration( - de.read_string( - _SCHEMA_DETECTOR_ADDITIONAL_CONFIGURATION.members["Name"] - ) - ) - - case 1: - kwargs["status"] = FeatureStatus( - de.read_string( - _SCHEMA_DETECTOR_ADDITIONAL_CONFIGURATION.members["Status"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DETECTOR_ADDITIONAL_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -def _serialize_detector_additional_configurations( - serializer: ShapeSerializer, - schema: Schema, - value: list[DetectorAdditionalConfiguration], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_detector_additional_configurations( - deserializer: ShapeDeserializer, schema: Schema -) -> list[DetectorAdditionalConfiguration]: - result: list[DetectorAdditionalConfiguration] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(DetectorAdditionalConfiguration.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class DetectorFeature(UnknownEnumMixin, StrEnum): - S3_DATA_EVENTS = "S3_DATA_EVENTS" - EKS_AUDIT_LOGS = "EKS_AUDIT_LOGS" - EBS_MALWARE_PROTECTION = "EBS_MALWARE_PROTECTION" - RDS_LOGIN_EVENTS = "RDS_LOGIN_EVENTS" - LAMBDA_NETWORK_LOGS = "LAMBDA_NETWORK_LOGS" - EKS_RUNTIME_MONITORING = "EKS_RUNTIME_MONITORING" - RUNTIME_MONITORING = "RUNTIME_MONITORING" - AI_PROTECTION = "AI_PROTECTION" - AI_ANALYST = "AI_ANALYST" - - -@dataclass(kw_only=True) -class DetectorFeatureConfiguration: - """ - Contains information about a GuardDuty feature. - - Specifying both EKS Runtime Monitoring (`EKS_RUNTIME_MONITORING`) and - Runtime Monitoring (`RUNTIME_MONITORING`) will cause an error. You can - add only one of these two features because Runtime Monitoring already - includes the threat detection for Amazon EKS resources. For more - information, see [Runtime - Monitoring](https://docs.aws.amazon.com/guardduty/latest/ug/runtime-monitoring.html). - """ - - name: str | None = None - """The name of the feature.""" - - status: str | None = None - """The status of the feature.""" - - additional_configuration: list[DetectorAdditionalConfiguration] | None = None - """Additional configuration for a resource.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DETECTOR_FEATURE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_DETECTOR_FEATURE_CONFIGURATION.members["Name"], self.name - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_DETECTOR_FEATURE_CONFIGURATION.members["Status"], self.status - ) - - if self.additional_configuration is not None: - _serialize_detector_additional_configurations( - serializer, - _SCHEMA_DETECTOR_FEATURE_CONFIGURATION.members[ - "AdditionalConfiguration" - ], - self.additional_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = DetectorFeature( - de.read_string( - _SCHEMA_DETECTOR_FEATURE_CONFIGURATION.members["Name"] - ) - ) - - case 1: - kwargs["status"] = FeatureStatus( - de.read_string( - _SCHEMA_DETECTOR_FEATURE_CONFIGURATION.members["Status"] - ) - ) - - case 2: - kwargs["additional_configuration"] = ( - _deserialize_detector_additional_configurations( - de, - _SCHEMA_DETECTOR_FEATURE_CONFIGURATION.members[ - "AdditionalConfiguration" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DETECTOR_FEATURE_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -def _serialize_detector_feature_configurations( - serializer: ShapeSerializer, - schema: Schema, - value: list[DetectorFeatureConfiguration], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_detector_feature_configurations( - deserializer: ShapeDeserializer, schema: Schema -) -> list[DetectorFeatureConfiguration]: - result: list[DetectorFeatureConfiguration] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(DetectorFeatureConfiguration.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class FindingPublishingFrequency(UnknownEnumMixin, StrEnum): - FIFTEEN_MINUTES = "FIFTEEN_MINUTES" - ONE_HOUR = "ONE_HOUR" - SIX_HOURS = "SIX_HOURS" - - -@dataclass(kw_only=True) -class CreateDetectorInput: - """Dataclass for CreateDetectorInput structure.""" - - enable: bool | None = None - """A Boolean value that specifies whether the detector is to be enabled.""" - - client_token: str | None = None - """The idempotency token for the create request.""" - - finding_publishing_frequency: str | None = None - """A value that specifies how frequently updated findings are exported.""" - - data_sources: DataSourceConfigurations | None = None - """ - Describes which data sources will be enabled for the detector. - - There might be regional differences because some data sources might not - be available in all the Amazon Web Services Regions where GuardDuty is - presently supported. For more information, see [Regions and - endpoints](https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_regions.html). - """ - - tags: dict[str, str] | None = None - """The tags to be added to a new detector resource.""" - - features: list[DetectorFeatureConfiguration] | None = None - """A list of features that will be configured for the detector.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_DETECTOR_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.enable is not None: - serializer.write_boolean( - _SCHEMA_CREATE_DETECTOR_INPUT.members["Enable"], self.enable - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_DETECTOR_INPUT.members["ClientToken"], self.client_token - ) - - if self.finding_publishing_frequency is not None: - serializer.write_string( - _SCHEMA_CREATE_DETECTOR_INPUT.members["FindingPublishingFrequency"], - self.finding_publishing_frequency, - ) - - if self.data_sources is not None: - serializer.write_struct( - _SCHEMA_CREATE_DETECTOR_INPUT.members["DataSources"], self.data_sources - ) - - if self.tags is not None: - _serialize_tag_map( - serializer, _SCHEMA_CREATE_DETECTOR_INPUT.members["Tags"], self.tags - ) - - if self.features is not None: - _serialize_detector_feature_configurations( - serializer, - _SCHEMA_CREATE_DETECTOR_INPUT.members["Features"], - self.features, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["enable"] = de.read_boolean( - _SCHEMA_CREATE_DETECTOR_INPUT.members["Enable"] - ) - - case 1: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_DETECTOR_INPUT.members["ClientToken"] - ) - - case 2: - kwargs["finding_publishing_frequency"] = FindingPublishingFrequency( - de.read_string( - _SCHEMA_CREATE_DETECTOR_INPUT.members[ - "FindingPublishingFrequency" - ] - ) - ) - - case 3: - kwargs["data_sources"] = DataSourceConfigurations.deserialize(de) - - case 4: - kwargs["tags"] = _deserialize_tag_map( - de, _SCHEMA_CREATE_DETECTOR_INPUT.members["Tags"] - ) - - case 5: - kwargs["features"] = _deserialize_detector_feature_configurations( - de, _SCHEMA_CREATE_DETECTOR_INPUT.members["Features"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_DETECTOR_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class EbsVolumesResult: - """Describes the configuration of scanning EBS volumes as a data source.""" - - status: str | None = None - """Describes whether scanning EBS volumes is enabled as a data source.""" - - reason: str | None = None - """ - Specifies the reason why scanning EBS volumes (Malware Protection) was - not enabled as a data source. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EBS_VOLUMES_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.status is not None: - serializer.write_string( - _SCHEMA_EBS_VOLUMES_RESULT.members["Status"], self.status - ) - - if self.reason is not None: - serializer.write_string( - _SCHEMA_EBS_VOLUMES_RESULT.members["Reason"], self.reason - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["status"] = DataSourceStatus( - de.read_string(_SCHEMA_EBS_VOLUMES_RESULT.members["Status"]) - ) - - case 1: - kwargs["reason"] = de.read_string( - _SCHEMA_EBS_VOLUMES_RESULT.members["Reason"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EBS_VOLUMES_RESULT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ScanEc2InstanceWithFindingsResult: - """ - An object that contains information on the status of whether Malware - Protection for EC2 instances with findings will be enabled as a data - source. - """ - - ebs_volumes: EbsVolumesResult | None = None - """Describes the configuration of scanning EBS volumes as a data source.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SCAN_EC2_INSTANCE_WITH_FINDINGS_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.ebs_volumes is not None: - serializer.write_struct( - _SCHEMA_SCAN_EC2_INSTANCE_WITH_FINDINGS_RESULT.members["EbsVolumes"], - self.ebs_volumes, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["ebs_volumes"] = EbsVolumesResult.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SCAN_EC2_INSTANCE_WITH_FINDINGS_RESULT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class MalwareProtectionConfigurationResult: - """ - An object that contains information on the status of all Malware - Protection data sources. - """ - - scan_ec2_instance_with_findings: ScanEc2InstanceWithFindingsResult | None = None - """ - Describes the configuration of Malware Protection for EC2 instances with - findings. - """ - - service_role: str | None = None - """The GuardDuty Malware Protection service role.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MALWARE_PROTECTION_CONFIGURATION_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.scan_ec2_instance_with_findings is not None: - serializer.write_struct( - _SCHEMA_MALWARE_PROTECTION_CONFIGURATION_RESULT.members[ - "ScanEc2InstanceWithFindings" - ], - self.scan_ec2_instance_with_findings, - ) - - if self.service_role is not None: - serializer.write_string( - _SCHEMA_MALWARE_PROTECTION_CONFIGURATION_RESULT.members["ServiceRole"], - self.service_role, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["scan_ec2_instance_with_findings"] = ( - ScanEc2InstanceWithFindingsResult.deserialize(de) - ) - - case 1: - kwargs["service_role"] = de.read_string( - _SCHEMA_MALWARE_PROTECTION_CONFIGURATION_RESULT.members[ - "ServiceRole" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MALWARE_PROTECTION_CONFIGURATION_RESULT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UnprocessedDataSourcesResult: - """Specifies the names of the data sources that couldn't be enabled.""" - - malware_protection: MalwareProtectionConfigurationResult | None = None - """ - An object that contains information on the status of all Malware - Protection data sources. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNPROCESSED_DATA_SOURCES_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.malware_protection is not None: - serializer.write_struct( - _SCHEMA_UNPROCESSED_DATA_SOURCES_RESULT.members["MalwareProtection"], - self.malware_protection, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["malware_protection"] = ( - MalwareProtectionConfigurationResult.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UNPROCESSED_DATA_SOURCES_RESULT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CreateDetectorOutput: - """Dataclass for CreateDetectorOutput structure.""" - - detector_id: str | None = None - """The unique ID of the created detector.""" - - unprocessed_data_sources: UnprocessedDataSourcesResult | None = None - """ - Specifies the data sources that couldn't be enabled when GuardDuty was - enabled for the first time. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_DETECTOR_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_CREATE_DETECTOR_OUTPUT.members["DetectorId"], self.detector_id - ) - - if self.unprocessed_data_sources is not None: - serializer.write_struct( - _SCHEMA_CREATE_DETECTOR_OUTPUT.members["UnprocessedDataSources"], - self.unprocessed_data_sources, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_CREATE_DETECTOR_OUTPUT.members["DetectorId"] - ) - - case 1: - kwargs["unprocessed_data_sources"] = ( - UnprocessedDataSourcesResult.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_DETECTOR_OUTPUT, consumer=_consumer) - return kwargs - - -CREATE_DETECTOR = APIOperation( - input=CreateDetectorInput, - output=CreateDetectorOutput, - schema=_SCHEMA_CREATE_DETECTOR, - input_schema=_SCHEMA_CREATE_DETECTOR_INPUT, - output_schema=_SCHEMA_CREATE_DETECTOR_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -class FilterAction(UnknownEnumMixin, StrEnum): - NOOP = "NOOP" - ARCHIVE = "ARCHIVE" - - -def _serialize_criterion( - serializer: ShapeSerializer, schema: Schema, value: dict[str, Condition] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_struct(value_schema, v)) - - -def _deserialize_criterion( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, Condition]: - result: dict[str, Condition] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = Condition.deserialize(d) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class FindingCriteria: - """Contains information about the criteria used for querying findings.""" - - criterion: dict[str, Condition] | None = None - """ - Represents a map of finding properties that match specified conditions - and values when querying findings. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FINDING_CRITERIA, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.criterion is not None: - _serialize_criterion( - serializer, - _SCHEMA_FINDING_CRITERIA.members["Criterion"], - self.criterion, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["criterion"] = _deserialize_criterion( - de, _SCHEMA_FINDING_CRITERIA.members["Criterion"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FINDING_CRITERIA, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CreateFilterInput: - """Dataclass for CreateFilterInput structure.""" - - detector_id: str | None = None - """ - The detector ID associated with the GuardDuty account for which you want - to create a filter. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - name: str | None = None - """ - The name of the filter. Valid characters include period (.), underscore - (_), dash (-), and alphanumeric characters. A whitespace is considered - to be an invalid character. - """ - - description: str | None = None - """ - The description of the filter. Valid characters include alphanumeric - characters, and special characters such as hyphen, period, colon, - underscore, parentheses (`{ }`, `[ ]`, and `( )`), forward slash, - horizontal tab, vertical tab, newline, form feed, return, and - whitespace. - """ - - action: str | None = None - """ - Specifies the action that is to be applied to the findings that match - the filter. - - Default: NOOP - """ - - rank: int | None = None - """ - Specifies the position of the filter in the list of current filters. - Also specifies the order in which this filter is applied to the - findings. - """ - - finding_criteria: FindingCriteria | None = None - """ - Represents the criteria to be used in the filter for querying findings. - The following fields are available for filtering: - - - accountId - - - arn - - - associatedAttackSequenceArn - - - confidence - - - createdAt - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - id - - - partition - - - region - - - resource.accessKeyDetails.accessKeyId - - - resource.accessKeyDetails.principalId - - - resource.accessKeyDetails.userIdentity.accessKeyId - - - resource.accessKeyDetails.userIdentity.accountId - - - resource.accessKeyDetails.userIdentity.arn - - - resource.accessKeyDetails.userIdentity.principalId - - - resource.accessKeyDetails.userIdentity.sessionContext.attributes.mfaAuthenticated - - - resource.accessKeyDetails.userIdentity.sessionContext.ec2RoleDelivery - - - resource.accessKeyDetails.userIdentity.sessionContext.invokedBy - - - resource.accessKeyDetails.userIdentity.sessionContext.sessionIssuer.accountId - - - resource.accessKeyDetails.userIdentity.sessionContext.sessionIssuer.arn - - - resource.accessKeyDetails.userIdentity.sessionContext.sessionIssuer.principalId - - - resource.accessKeyDetails.userIdentity.sessionContext.sessionIssuer.type - - - resource.accessKeyDetails.userIdentity.sessionContext.sessionIssuer.userName - - - resource.accessKeyDetails.userIdentity.sessionContext.sourceIdentity - - - resource.accessKeyDetails.userIdentity.sessionContext.webIdFederationData.attributes - - - resource.accessKeyDetails.userIdentity.sessionContext.webIdFederationData.federatedProvider - - - resource.accessKeyDetails.userIdentity.type - - - resource.accessKeyDetails.userIdentity.userName - - - resource.accessKeyDetails.userName - - - resource.accessKeyDetails.userType - - - resource.bedrockGuardrailDetails.guardrailArn - - - resource.bedrockGuardrailDetails.guardrailVersion - - - resource.containerDetails.containerRuntime - - - resource.containerDetails.id - - - resource.containerDetails.image - - - resource.containerDetails.imagePrefix - - - resource.containerDetails.name - - - resource.containerDetails.securityContext.allowPrivilegeEscalation - - - resource.containerDetails.securityContext.privileged - - - resource.containerDetails.volumeMounts.mountPath - - - resource.containerDetails.volumeMounts.name - - - resource.ebsSnapshotDetails.snapshotArn - - - resource.ebsVolumeDetails.scannedVolumeDetails.deviceName - - - resource.ebsVolumeDetails.scannedVolumeDetails.encryptionType - - - resource.ebsVolumeDetails.scannedVolumeDetails.kmsKeyArn - - - resource.ebsVolumeDetails.scannedVolumeDetails.snapshotArn - - - resource.ebsVolumeDetails.scannedVolumeDetails.volumeArn - - - resource.ebsVolumeDetails.scannedVolumeDetails.volumeSizeInGB - - - resource.ebsVolumeDetails.scannedVolumeDetails.volumeType - - - resource.ebsVolumeDetails.skippedVolumeDetails.deviceName - - - resource.ebsVolumeDetails.skippedVolumeDetails.encryptionType - - - resource.ebsVolumeDetails.skippedVolumeDetails.kmsKeyArn - - - resource.ebsVolumeDetails.skippedVolumeDetails.snapshotArn - - - resource.ebsVolumeDetails.skippedVolumeDetails.volumeArn - - - resource.ebsVolumeDetails.skippedVolumeDetails.volumeSizeInGB - - - resource.ebsVolumeDetails.skippedVolumeDetails.volumeType - - - resource.ec2ImageDetails.imageArn - - - resource.ecsClusterDetails.activeServicesCount - - - resource.ecsClusterDetails.arn - - - resource.ecsClusterDetails.name - - - resource.ecsClusterDetails.registeredContainerInstancesCount - - - resource.ecsClusterDetails.runningTasksCount - - - resource.ecsClusterDetails.status - - - resource.ecsClusterDetails.tags.key - - - resource.ecsClusterDetails.tags.value - - - resource.ecsClusterDetails.taskDetails.arn - - - resource.ecsClusterDetails.taskDetails.containers.containerRuntime - - - resource.ecsClusterDetails.taskDetails.containers.id - - - resource.ecsClusterDetails.taskDetails.containers.image - - - resource.ecsClusterDetails.taskDetails.containers.imagePrefix - - - resource.ecsClusterDetails.taskDetails.containers.name - - - resource.ecsClusterDetails.taskDetails.containers.securityContext.allowPrivilegeEscalation - - - resource.ecsClusterDetails.taskDetails.containers.securityContext.privileged - - - resource.ecsClusterDetails.taskDetails.containers.volumeMounts.mountPath - - - resource.ecsClusterDetails.taskDetails.containers.volumeMounts.name - - - resource.ecsClusterDetails.taskDetails.createdAt - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - resource.ecsClusterDetails.taskDetails.definitionArn - - - resource.ecsClusterDetails.taskDetails.group - - - resource.ecsClusterDetails.taskDetails.launchType - - - resource.ecsClusterDetails.taskDetails.startedAt - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - resource.ecsClusterDetails.taskDetails.startedBy - - - resource.ecsClusterDetails.taskDetails.tags.key - - - resource.ecsClusterDetails.taskDetails.tags.value - - - resource.ecsClusterDetails.taskDetails.version - - - resource.ecsClusterDetails.taskDetails.volumes.hostPath.path - - - resource.ecsClusterDetails.taskDetails.volumes.name - - - resource.eksClusterDetails.arn - - - resource.eksClusterDetails.createdAt - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - resource.eksClusterDetails.name - - - resource.eksClusterDetails.status - - - resource.eksClusterDetails.tags.key - - - resource.eksClusterDetails.tags.value - - - resource.eksClusterDetails.vpcId - - - resource.instanceDetails.availabilityZone - - - resource.instanceDetails.iamInstanceProfile.arn - - - resource.instanceDetails.iamInstanceProfile.id - - - resource.instanceDetails.imageDescription - - - resource.instanceDetails.imageId - - - resource.instanceDetails.instanceId - - - resource.instanceDetails.instanceState - - - resource.instanceDetails.instanceType - - - resource.instanceDetails.launchTime - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - resource.instanceDetails.networkInterfaces.ipv6Addresses - - - resource.instanceDetails.networkInterfaces.networkInterfaceId - - - resource.instanceDetails.networkInterfaces.privateDnsName - - - resource.instanceDetails.networkInterfaces.privateIpAddress - - - resource.instanceDetails.networkInterfaces.privateIpAddresses.privateDnsName - - - resource.instanceDetails.networkInterfaces.privateIpAddresses.privateIpAddress - - - resource.instanceDetails.networkInterfaces.publicDnsName - - - resource.instanceDetails.networkInterfaces.publicIp - - - resource.instanceDetails.networkInterfaces.securityGroups.groupId - - - resource.instanceDetails.networkInterfaces.securityGroups.groupName - - - resource.instanceDetails.networkInterfaces.subnetId - - - resource.instanceDetails.networkInterfaces.vpcId - - - resource.instanceDetails.outpostArn - - - resource.instanceDetails.platform - - - resource.instanceDetails.productCodes.productCodeId - - - resource.instanceDetails.productCodes.productCodeType - - - resource.instanceDetails.tags.key - - - resource.instanceDetails.tags.value - - - resource.kubernetesDetails.kubernetesUserDetails.groups - - - resource.kubernetesDetails.kubernetesUserDetails.impersonatedUser.groups - - - resource.kubernetesDetails.kubernetesUserDetails.impersonatedUser.username - - - resource.kubernetesDetails.kubernetesUserDetails.sessionName - - - resource.kubernetesDetails.kubernetesUserDetails.uid - - - resource.kubernetesDetails.kubernetesUserDetails.username - - - resource.kubernetesDetails.kubernetesWorkloadDetails.containers.containerRuntime - - - resource.kubernetesDetails.kubernetesWorkloadDetails.containers.id - - - resource.kubernetesDetails.kubernetesWorkloadDetails.containers.image - - - resource.kubernetesDetails.kubernetesWorkloadDetails.containers.imagePrefix - - - resource.kubernetesDetails.kubernetesWorkloadDetails.containers.name - - - resource.kubernetesDetails.kubernetesWorkloadDetails.containers.securityContext.allowPrivilegeEscalation - - - resource.kubernetesDetails.kubernetesWorkloadDetails.containers.securityContext.privileged - - - resource.kubernetesDetails.kubernetesWorkloadDetails.containers.volumeMounts.mountPath - - - resource.kubernetesDetails.kubernetesWorkloadDetails.containers.volumeMounts.name - - - resource.kubernetesDetails.kubernetesWorkloadDetails.hostIpc - - - resource.kubernetesDetails.kubernetesWorkloadDetails.hostNetwork - - - resource.kubernetesDetails.kubernetesWorkloadDetails.hostPid - - - resource.kubernetesDetails.kubernetesWorkloadDetails.name - - - resource.kubernetesDetails.kubernetesWorkloadDetails.namespace - - - resource.kubernetesDetails.kubernetesWorkloadDetails.serviceAccountName - - - resource.kubernetesDetails.kubernetesWorkloadDetails.type - - - resource.kubernetesDetails.kubernetesWorkloadDetails.uid - - - resource.kubernetesDetails.kubernetesWorkloadDetails.volumes.hostPath.path - - - resource.kubernetesDetails.kubernetesWorkloadDetails.volumes.name - - - resource.lambdaDetails.description - - - resource.lambdaDetails.functionArn - - - resource.lambdaDetails.functionName - - - resource.lambdaDetails.functionVersion - - - resource.lambdaDetails.lastModifiedAt - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - resource.lambdaDetails.revisionId - - - resource.lambdaDetails.role - - - resource.lambdaDetails.tags.key - - - resource.lambdaDetails.tags.value - - - resource.lambdaDetails.vpcConfig.securityGroups.groupId - - - resource.lambdaDetails.vpcConfig.securityGroups.groupName - - - resource.lambdaDetails.vpcConfig.subnetIds - - - resource.lambdaDetails.vpcConfig.vpcId - - - resource.rdsDbInstanceDetails.dbClusterIdentifier - - - resource.rdsDbInstanceDetails.dbInstanceArn - - - resource.rdsDbInstanceDetails.dbInstanceIdentifier - - - resource.rdsDbInstanceDetails.dbSecurityGroups.name - - - resource.rdsDbInstanceDetails.dbSecurityGroups.status - - - resource.rdsDbInstanceDetails.dbiResourceId - - - resource.rdsDbInstanceDetails.engine - - - resource.rdsDbInstanceDetails.engineVersion - - - resource.rdsDbInstanceDetails.iamDatabaseAuthenticationEnabled - - - resource.rdsDbInstanceDetails.publiclyAccessible - - - resource.rdsDbInstanceDetails.vpcId - - - resource.rdsDbInstanceDetails.vpcSecurityGroups.status - - - resource.rdsDbInstanceDetails.vpcSecurityGroups.vpcSecurityGroupId - - - resource.rdsDbUserDetails.application - - - resource.rdsDbUserDetails.authMethod - - - resource.rdsDbUserDetails.database - - - resource.rdsDbUserDetails.ssl - - - resource.rdsDbUserDetails.user - - - resource.rdsLimitlessDbDetails.dbClusterIdentifier - - - resource.rdsLimitlessDbDetails.dbShardGroupArn - - - resource.rdsLimitlessDbDetails.dbShardGroupIdentifier - - - resource.rdsLimitlessDbDetails.dbShardGroupResourceId - - - resource.rdsLimitlessDbDetails.engine - - - resource.rdsLimitlessDbDetails.engineVersion - - - resource.rdsLimitlessDbDetails.tags.key - - - resource.rdsLimitlessDbDetails.tags.value - - - resource.recoveryPointDetails.backupVaultName - - - resource.recoveryPointDetails.recoveryPointArn - - - resource.resourceType - - - resource.s3BucketDetails.arn - - - resource.s3BucketDetails.createdAt - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - resource.s3BucketDetails.defaultServerSideEncryption.encryptionType - - - resource.s3BucketDetails.defaultServerSideEncryption.kmsMasterKeyArn - - - resource.s3BucketDetails.name - - - resource.s3BucketDetails.owner.id - - - resource.s3BucketDetails.publicAccess.effectivePermission - - - resource.s3BucketDetails.publicAccess.permissionConfiguration.accountLevelPermissions.blockPublicAccess.blockPublicAcls - - - resource.s3BucketDetails.publicAccess.permissionConfiguration.accountLevelPermissions.blockPublicAccess.blockPublicPolicy - - - resource.s3BucketDetails.publicAccess.permissionConfiguration.accountLevelPermissions.blockPublicAccess.ignorePublicAcls - - - resource.s3BucketDetails.publicAccess.permissionConfiguration.accountLevelPermissions.blockPublicAccess.restrictPublicBuckets - - - resource.s3BucketDetails.publicAccess.permissionConfiguration.bucketLevelPermissions.accessControlList.allowsPublicReadAccess - - - resource.s3BucketDetails.publicAccess.permissionConfiguration.bucketLevelPermissions.accessControlList.allowsPublicWriteAccess - - - resource.s3BucketDetails.publicAccess.permissionConfiguration.bucketLevelPermissions.blockPublicAccess.blockPublicAcls - - - resource.s3BucketDetails.publicAccess.permissionConfiguration.bucketLevelPermissions.blockPublicAccess.blockPublicPolicy - - - resource.s3BucketDetails.publicAccess.permissionConfiguration.bucketLevelPermissions.blockPublicAccess.ignorePublicAcls - - - resource.s3BucketDetails.publicAccess.permissionConfiguration.bucketLevelPermissions.blockPublicAccess.restrictPublicBuckets - - - resource.s3BucketDetails.publicAccess.permissionConfiguration.bucketLevelPermissions.bucketPolicy.allowsPublicReadAccess - - - resource.s3BucketDetails.publicAccess.permissionConfiguration.bucketLevelPermissions.bucketPolicy.allowsPublicWriteAccess - - - resource.s3BucketDetails.s3ObjectDetails.eTag - - - resource.s3BucketDetails.s3ObjectDetails.hash - - - resource.s3BucketDetails.s3ObjectDetails.key - - - resource.s3BucketDetails.s3ObjectDetails.objectArn - - - resource.s3BucketDetails.s3ObjectDetails.versionId - - - resource.s3BucketDetails.tags.key - - - resource.s3BucketDetails.tags.value - - - resource.s3BucketDetails.type - - - schemaVersion - - - service.action.actionType - - - service.action.awsApiCallAction.api - - - service.action.awsApiCallAction.callerType - - - service.action.awsApiCallAction.domainDetails.domain - - - service.action.awsApiCallAction.errorCode - - - service.action.awsApiCallAction.remoteAccountDetails.accountId - - - service.action.awsApiCallAction.remoteAccountDetails.affiliated - - - service.action.awsApiCallAction.remoteAccountDetails.awsServiceName - - - service.action.awsApiCallAction.remoteIpDetails.city.cityName - - - service.action.awsApiCallAction.remoteIpDetails.country.countryCode - - - service.action.awsApiCallAction.remoteIpDetails.country.countryName - - - service.action.awsApiCallAction.remoteIpDetails.geoLocation.lat - - - service.action.awsApiCallAction.remoteIpDetails.geoLocation.lon - - - service.action.awsApiCallAction.remoteIpDetails.ipAddressV4 - - - service.action.awsApiCallAction.remoteIpDetails.ipAddressV6 - - - service.action.awsApiCallAction.remoteIpDetails.organization.asn - - - service.action.awsApiCallAction.remoteIpDetails.organization.asnOrg - - - service.action.awsApiCallAction.remoteIpDetails.organization.isp - - - service.action.awsApiCallAction.remoteIpDetails.organization.org - - - service.action.awsApiCallAction.serviceName - - - service.action.awsApiCallAction.userAgent - - - service.action.dnsRequestAction.blocked - - - service.action.dnsRequestAction.domain - - - service.action.dnsRequestAction.domainWithSuffix - - - service.action.dnsRequestAction.protocol - - - service.action.dnsRequestAction.vpcOwnerAccountId - - - service.action.kubernetesApiCallAction.namespace - - - service.action.kubernetesApiCallAction.parameters - - - service.action.kubernetesApiCallAction.remoteIpDetails.city.cityName - - - service.action.kubernetesApiCallAction.remoteIpDetails.country.countryCode - - - service.action.kubernetesApiCallAction.remoteIpDetails.country.countryName - - - service.action.kubernetesApiCallAction.remoteIpDetails.geoLocation.lat - - - service.action.kubernetesApiCallAction.remoteIpDetails.geoLocation.lon - - - service.action.kubernetesApiCallAction.remoteIpDetails.ipAddressV4 - - - service.action.kubernetesApiCallAction.remoteIpDetails.ipAddressV6 - - - service.action.kubernetesApiCallAction.remoteIpDetails.organization.asn - - - service.action.kubernetesApiCallAction.remoteIpDetails.organization.asnOrg - - - service.action.kubernetesApiCallAction.remoteIpDetails.organization.isp - - - service.action.kubernetesApiCallAction.remoteIpDetails.organization.org - - - service.action.kubernetesApiCallAction.requestUri - - - service.action.kubernetesApiCallAction.resource - - - service.action.kubernetesApiCallAction.resourceName - - - service.action.kubernetesApiCallAction.sourceIPs - - - service.action.kubernetesApiCallAction.statusCode - - - service.action.kubernetesApiCallAction.subresource - - - service.action.kubernetesApiCallAction.userAgent - - - service.action.kubernetesApiCallAction.verb - - - service.action.kubernetesPermissionCheckedDetails.allowed - - - service.action.kubernetesPermissionCheckedDetails.namespace - - - service.action.kubernetesPermissionCheckedDetails.resource - - - service.action.kubernetesPermissionCheckedDetails.verb - - - service.action.kubernetesRoleBindingDetails.kind - - - service.action.kubernetesRoleBindingDetails.name - - - service.action.kubernetesRoleBindingDetails.roleRefKind - - - service.action.kubernetesRoleBindingDetails.roleRefName - - - service.action.kubernetesRoleBindingDetails.uid - - - service.action.kubernetesRoleDetails.kind - - - service.action.kubernetesRoleDetails.name - - - service.action.kubernetesRoleDetails.uid - - - service.action.networkConnectionAction.blocked - - - service.action.networkConnectionAction.connectionDirection - - - service.action.networkConnectionAction.localIpDetails.ipAddressV4 - - - service.action.networkConnectionAction.localIpDetails.ipAddressV6 - - - service.action.networkConnectionAction.localNetworkInterface - - - service.action.networkConnectionAction.localPortDetails.port - - - service.action.networkConnectionAction.localPortDetails.portName - - - service.action.networkConnectionAction.protocol - - - service.action.networkConnectionAction.remoteIpDetails.city.cityName - - - service.action.networkConnectionAction.remoteIpDetails.country.countryCode - - - service.action.networkConnectionAction.remoteIpDetails.country.countryName - - - service.action.networkConnectionAction.remoteIpDetails.geoLocation.lat - - - service.action.networkConnectionAction.remoteIpDetails.geoLocation.lon - - - service.action.networkConnectionAction.remoteIpDetails.ipAddressV4 - - - service.action.networkConnectionAction.remoteIpDetails.ipAddressV6 - - - service.action.networkConnectionAction.remoteIpDetails.organization.asn - - - service.action.networkConnectionAction.remoteIpDetails.organization.asnOrg - - - service.action.networkConnectionAction.remoteIpDetails.organization.isp - - - service.action.networkConnectionAction.remoteIpDetails.organization.org - - - service.action.networkConnectionAction.remotePortDetails.port - - - service.action.networkConnectionAction.remotePortDetails.portName - - - service.action.portProbeAction.blocked - - - service.action.portProbeAction.portProbeDetails.localIpDetails.ipAddressV4 - - - service.action.portProbeAction.portProbeDetails.localIpDetails.ipAddressV6 - - - service.action.portProbeAction.portProbeDetails.localPortDetails.port - - - service.action.portProbeAction.portProbeDetails.localPortDetails.portName - - - service.action.portProbeAction.portProbeDetails.remoteIpDetails.city.cityName - - - service.action.portProbeAction.portProbeDetails.remoteIpDetails.country.countryCode - - - service.action.portProbeAction.portProbeDetails.remoteIpDetails.country.countryName - - - service.action.portProbeAction.portProbeDetails.remoteIpDetails.geoLocation.lat - - - service.action.portProbeAction.portProbeDetails.remoteIpDetails.geoLocation.lon - - - service.action.portProbeAction.portProbeDetails.remoteIpDetails.ipAddressV4 - - - service.action.portProbeAction.portProbeDetails.remoteIpDetails.ipAddressV6 - - - service.action.portProbeAction.portProbeDetails.remoteIpDetails.organization.asn - - - service.action.portProbeAction.portProbeDetails.remoteIpDetails.organization.asnOrg - - - service.action.portProbeAction.portProbeDetails.remoteIpDetails.organization.isp - - - service.action.portProbeAction.portProbeDetails.remoteIpDetails.organization.org - - - service.action.rdsLoginAttemptAction.loginAttributes.application - - - service.action.rdsLoginAttemptAction.loginAttributes.failedLoginAttempts - - - service.action.rdsLoginAttemptAction.loginAttributes.successfulLoginAttempts - - - service.action.rdsLoginAttemptAction.loginAttributes.user - - - service.action.rdsLoginAttemptAction.remoteIpDetails.city.cityName - - - service.action.rdsLoginAttemptAction.remoteIpDetails.country.countryCode - - - service.action.rdsLoginAttemptAction.remoteIpDetails.country.countryName - - - service.action.rdsLoginAttemptAction.remoteIpDetails.geoLocation.lat - - - service.action.rdsLoginAttemptAction.remoteIpDetails.geoLocation.lon - - - service.action.rdsLoginAttemptAction.remoteIpDetails.ipAddressV4 - - - service.action.rdsLoginAttemptAction.remoteIpDetails.ipAddressV6 - - - service.action.rdsLoginAttemptAction.remoteIpDetails.organization.asn - - - service.action.rdsLoginAttemptAction.remoteIpDetails.organization.asnOrg - - - service.action.rdsLoginAttemptAction.remoteIpDetails.organization.isp - - - service.action.rdsLoginAttemptAction.remoteIpDetails.organization.org - - - service.additionalInfo.agentDetails.agentId - - - service.additionalInfo.agentDetails.agentVersion - - - service.additionalInfo.anomalies.anomalousAPIs - - - service.additionalInfo.authenticationMethod - - - service.additionalInfo.averagePacketSizeIn - - - service.additionalInfo.averagePacketSizeOut - - - service.additionalInfo.context - - - service.additionalInfo.domain - - - service.additionalInfo.inBytes - - - service.additionalInfo.localNetworkInterfaceOwner - - - service.additionalInfo.localPort - - - service.additionalInfo.outBytes - - - service.additionalInfo.packetsIn - - - service.additionalInfo.packetsOut - - - service.additionalInfo.policyArn - - - service.additionalInfo.policyName - - - service.additionalInfo.remotePort - - - service.additionalInfo.sample - - - service.additionalInfo.scannedPort - - - service.additionalInfo.threatFileSha256 - - - service.additionalInfo.threatListName - - - service.additionalInfo.threatName - - - service.additionalInfo.totalBytesIn - - - service.additionalInfo.totalBytesOut - - - service.additionalInfo.type - - - service.additionalInfo.unusual.asnOrg - - - service.additionalInfo.unusual.port - - - service.additionalInfo.unusualProtocol - - - service.additionalInfo.userAgent.fullUserAgent - - - service.additionalInfo.userAgent.userAgentCategory - - - service.additionalInfo.value - - - service.additionalInfo.vpcOwnerAccountId - - - service.archived - - - service.count - - - service.detection.sequence.actors.id - - - service.detection.sequence.actors.process.name - - - service.detection.sequence.actors.process.path - - - service.detection.sequence.actors.process.sha256 - - - service.detection.sequence.actors.session.createdTime - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - service.detection.sequence.actors.session.issuer - - - service.detection.sequence.actors.session.mfaStatus - - - service.detection.sequence.actors.session.uid - - - service.detection.sequence.actors.user.account.account - - - service.detection.sequence.actors.user.account.uid - - - service.detection.sequence.actors.user.credentialUid - - - service.detection.sequence.actors.user.name - - - service.detection.sequence.actors.user.type - - - service.detection.sequence.actors.user.uid - - - service.detection.sequence.additionalSequenceTypes - - - service.detection.sequence.description - - - service.detection.sequence.endpoints.autonomousSystem.name - - - service.detection.sequence.endpoints.autonomousSystem.number - - - service.detection.sequence.endpoints.connection.direction - - - service.detection.sequence.endpoints.domain - - - service.detection.sequence.endpoints.id - - - service.detection.sequence.endpoints.ip - - - service.detection.sequence.endpoints.location.city - - - service.detection.sequence.endpoints.location.country - - - service.detection.sequence.endpoints.location.lat - - - service.detection.sequence.endpoints.location.lon - - - service.detection.sequence.endpoints.port - - - service.detection.sequence.resources.accountId - - - service.detection.sequence.resources.cloudPartition - - - service.detection.sequence.resources.data.accessKey.principalId - - - service.detection.sequence.resources.data.accessKey.userName - - - service.detection.sequence.resources.data.accessKey.userType - - - service.detection.sequence.resources.data.autoscalingAutoScalingGroup.ec2InstanceUids - - - service.detection.sequence.resources.data.cloudformationStack.ec2InstanceUids - - - service.detection.sequence.resources.data.container.image - - - service.detection.sequence.resources.data.container.imageUid - - - service.detection.sequence.resources.data.ec2Image.ec2InstanceUids - - - service.detection.sequence.resources.data.ec2Instance.availabilityZone - - - service.detection.sequence.resources.data.ec2Instance.ec2NetworkInterfaceUids - - - service.detection.sequence.resources.data.ec2Instance.iamInstanceProfile.arn - - - service.detection.sequence.resources.data.ec2Instance.iamInstanceProfile.id - - - service.detection.sequence.resources.data.ec2Instance.imageDescription - - - service.detection.sequence.resources.data.ec2Instance.instanceState - - - service.detection.sequence.resources.data.ec2Instance.instanceType - - - service.detection.sequence.resources.data.ec2Instance.outpostArn - - - service.detection.sequence.resources.data.ec2Instance.platform - - - service.detection.sequence.resources.data.ec2Instance.productCodes.productCodeId - - - service.detection.sequence.resources.data.ec2Instance.productCodes.productCodeType - - - service.detection.sequence.resources.data.ec2LaunchTemplate.ec2InstanceUids - - - service.detection.sequence.resources.data.ec2LaunchTemplate.version - - - service.detection.sequence.resources.data.ec2NetworkInterface.ipv6Addresses - - - service.detection.sequence.resources.data.ec2NetworkInterface.privateIpAddresses.privateDnsName - - - service.detection.sequence.resources.data.ec2NetworkInterface.privateIpAddresses.privateIpAddress - - - service.detection.sequence.resources.data.ec2NetworkInterface.publicIp - - - service.detection.sequence.resources.data.ec2NetworkInterface.securityGroups.groupId - - - service.detection.sequence.resources.data.ec2NetworkInterface.securityGroups.groupName - - - service.detection.sequence.resources.data.ec2NetworkInterface.subNetId - - - service.detection.sequence.resources.data.ec2NetworkInterface.vpcId - - - service.detection.sequence.resources.data.ec2Vpc.ec2InstanceUids - - - service.detection.sequence.resources.data.ecsCluster.ec2InstanceUids - - - service.detection.sequence.resources.data.ecsCluster.status - - - service.detection.sequence.resources.data.ecsTask.containerUids - - - service.detection.sequence.resources.data.ecsTask.createdAt - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - service.detection.sequence.resources.data.ecsTask.launchType - - - service.detection.sequence.resources.data.ecsTask.taskDefinitionArn - - - service.detection.sequence.resources.data.eksCluster.arn - - - service.detection.sequence.resources.data.eksCluster.createdAt - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - service.detection.sequence.resources.data.eksCluster.ec2InstanceUids - - - service.detection.sequence.resources.data.eksCluster.status - - - service.detection.sequence.resources.data.eksCluster.vpcId - - - service.detection.sequence.resources.data.iamInstanceProfile.ec2InstanceUids - - - service.detection.sequence.resources.data.iamInstanceProfile.id - - - service.detection.sequence.resources.data.kubernetesWorkload.containerUids - - - service.detection.sequence.resources.data.kubernetesWorkload.namespace - - - service.detection.sequence.resources.data.kubernetesWorkload.type - - - service.detection.sequence.resources.data.s3Bucket.accountPublicAccess.publicAclAccess - - - service.detection.sequence.resources.data.s3Bucket.accountPublicAccess.publicAclIgnoreBehavior - - - service.detection.sequence.resources.data.s3Bucket.accountPublicAccess.publicBucketRestrictBehavior - - - service.detection.sequence.resources.data.s3Bucket.accountPublicAccess.publicPolicyAccess - - - service.detection.sequence.resources.data.s3Bucket.bucketPublicAccess.publicAclAccess - - - service.detection.sequence.resources.data.s3Bucket.bucketPublicAccess.publicAclIgnoreBehavior - - - service.detection.sequence.resources.data.s3Bucket.bucketPublicAccess.publicBucketRestrictBehavior - - - service.detection.sequence.resources.data.s3Bucket.bucketPublicAccess.publicPolicyAccess - - - service.detection.sequence.resources.data.s3Bucket.createdAt - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - service.detection.sequence.resources.data.s3Bucket.effectivePermission - - - service.detection.sequence.resources.data.s3Bucket.encryptionKeyArn - - - service.detection.sequence.resources.data.s3Bucket.encryptionType - - - service.detection.sequence.resources.data.s3Bucket.ownerId - - - service.detection.sequence.resources.data.s3Bucket.publicReadAccess - - - service.detection.sequence.resources.data.s3Bucket.publicWriteAccess - - - service.detection.sequence.resources.data.s3Bucket.s3ObjectUids - - - service.detection.sequence.resources.data.s3Object.eTag - - - service.detection.sequence.resources.data.s3Object.key - - - service.detection.sequence.resources.data.s3Object.versionId - - - service.detection.sequence.resources.name - - - service.detection.sequence.resources.region - - - service.detection.sequence.resources.resourceType - - - service.detection.sequence.resources.service - - - service.detection.sequence.resources.tags.key - - - service.detection.sequence.resources.tags.value - - - service.detection.sequence.resources.uid - - - service.detection.sequence.sequenceIndicators.key - - - service.detection.sequence.sequenceIndicators.title - - - service.detection.sequence.sequenceIndicators.values - - - service.detection.sequence.signals.actorIds - - - service.detection.sequence.signals.count - - - service.detection.sequence.signals.createdAt - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - service.detection.sequence.signals.description - - - service.detection.sequence.signals.endpointIds - - - service.detection.sequence.signals.firstSeenAt - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - service.detection.sequence.signals.lastSeenAt - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - service.detection.sequence.signals.name - - - service.detection.sequence.signals.resourceUids - - - service.detection.sequence.signals.severity - - - service.detection.sequence.signals.signalIndicators.key - - - service.detection.sequence.signals.signalIndicators.title - - - service.detection.sequence.signals.signalIndicators.values - - - service.detection.sequence.signals.type - - - service.detection.sequence.signals.uid - - - service.detection.sequence.signals.updatedAt - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - service.detection.sequence.uid - - - service.detectorId - - - service.ebsVolumeScanDetails.scanCompletedAt - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - service.ebsVolumeScanDetails.scanDetections.highestSeverityThreatDetails.count - - - service.ebsVolumeScanDetails.scanDetections.highestSeverityThreatDetails.severity - - - service.ebsVolumeScanDetails.scanDetections.highestSeverityThreatDetails.threatName - - - service.ebsVolumeScanDetails.scanDetections.scannedItemCount.files - - - service.ebsVolumeScanDetails.scanDetections.scannedItemCount.totalGb - - - service.ebsVolumeScanDetails.scanDetections.scannedItemCount.volumes - - - service.ebsVolumeScanDetails.scanDetections.threatDetectedByName.itemCount - - - service.ebsVolumeScanDetails.scanDetections.threatDetectedByName.shortened - - - service.ebsVolumeScanDetails.scanDetections.threatDetectedByName.threatNames.filePaths.fileName - - - service.ebsVolumeScanDetails.scanDetections.threatDetectedByName.threatNames.filePaths.filePath - - - service.ebsVolumeScanDetails.scanDetections.threatDetectedByName.threatNames.filePaths.hash - - - service.ebsVolumeScanDetails.scanDetections.threatDetectedByName.threatNames.filePaths.volumeArn - - - service.ebsVolumeScanDetails.scanDetections.threatDetectedByName.threatNames.itemCount - - - service.ebsVolumeScanDetails.scanDetections.threatDetectedByName.threatNames.name - - - service.ebsVolumeScanDetails.scanDetections.threatDetectedByName.threatNames.severity - - - service.ebsVolumeScanDetails.scanDetections.threatDetectedByName.uniqueThreatNameCount - - - service.ebsVolumeScanDetails.scanDetections.threatsDetectedItemCount.files - - - service.ebsVolumeScanDetails.scanId - - - service.ebsVolumeScanDetails.scanStartedAt - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - service.ebsVolumeScanDetails.scanType - - - service.ebsVolumeScanDetails.sources - - - service.ebsVolumeScanDetails.triggerFindingId - - - service.eventFirstSeen - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - service.eventLastSeen - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - service.evidence.threatIntelligenceDetails.threatFileSha256 - - - service.evidence.threatIntelligenceDetails.threatListName - - - service.evidence.threatIntelligenceDetails.threatNames - - - service.featureName - - - service.malwareScanDetails.scanCategory - - - service.malwareScanDetails.scanConfiguration.incrementalScanDetails.baselineResourceArn - - - service.malwareScanDetails.scanConfiguration.triggerType - - - service.malwareScanDetails.scanId - - - service.malwareScanDetails.scanType - - - service.malwareScanDetails.threats.count - - - service.malwareScanDetails.threats.hash - - - service.malwareScanDetails.threats.itemDetails.additionalInfo.deviceName - - - service.malwareScanDetails.threats.itemDetails.additionalInfo.versionId - - - service.malwareScanDetails.threats.itemDetails.hash - - - service.malwareScanDetails.threats.itemDetails.itemPath - - - service.malwareScanDetails.threats.itemDetails.resourceArn - - - service.malwareScanDetails.threats.itemPaths.hash - - - service.malwareScanDetails.threats.itemPaths.nestedItemPath - - - service.malwareScanDetails.threats.name - - - service.malwareScanDetails.threats.source - - - service.malwareScanDetails.uniqueThreatCount - - - service.resourceRole - - - service.runtimeDetails.context.addressFamily - - - service.runtimeDetails.context.commandLineExample - - - service.runtimeDetails.context.fileOperation - - - service.runtimeDetails.context.filePath - - - service.runtimeDetails.context.fileSystemType - - - service.runtimeDetails.context.flags - - - service.runtimeDetails.context.ianaProtocolNumber - - - service.runtimeDetails.context.ldPreloadValue - - - service.runtimeDetails.context.libraryPath - - - service.runtimeDetails.context.memoryRegions - - - service.runtimeDetails.context.modifiedAt - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - service.runtimeDetails.context.modifyingProcess.euid - - - service.runtimeDetails.context.modifyingProcess.executablePath - - - service.runtimeDetails.context.modifyingProcess.executableSha256 - - - service.runtimeDetails.context.modifyingProcess.lineage.euid - - - service.runtimeDetails.context.modifyingProcess.lineage.executablePath - - - service.runtimeDetails.context.modifyingProcess.lineage.name - - - service.runtimeDetails.context.modifyingProcess.lineage.namespacePid - - - service.runtimeDetails.context.modifyingProcess.lineage.parentUuid - - - service.runtimeDetails.context.modifyingProcess.lineage.pid - - - service.runtimeDetails.context.modifyingProcess.lineage.startTime - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - service.runtimeDetails.context.modifyingProcess.lineage.userId - - - service.runtimeDetails.context.modifyingProcess.lineage.uuid - - - service.runtimeDetails.context.modifyingProcess.name - - - service.runtimeDetails.context.modifyingProcess.namespacePid - - - service.runtimeDetails.context.modifyingProcess.parentUuid - - - service.runtimeDetails.context.modifyingProcess.pid - - - service.runtimeDetails.context.modifyingProcess.pwd - - - service.runtimeDetails.context.modifyingProcess.startTime - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - service.runtimeDetails.context.modifyingProcess.user - - - service.runtimeDetails.context.modifyingProcess.userId - - - service.runtimeDetails.context.modifyingProcess.uuid - - - service.runtimeDetails.context.moduleFilePath - - - service.runtimeDetails.context.moduleName - - - service.runtimeDetails.context.moduleSha256 - - - service.runtimeDetails.context.mountSource - - - service.runtimeDetails.context.mountTarget - - - service.runtimeDetails.context.relatedFilePaths - - - service.runtimeDetails.context.releaseAgentPath - - - service.runtimeDetails.context.runcBinaryPath - - - service.runtimeDetails.context.scriptPath - - - service.runtimeDetails.context.serviceName - - - service.runtimeDetails.context.shellHistoryFilePath - - - service.runtimeDetails.context.socketPath - - - service.runtimeDetails.context.targetProcess.euid - - - service.runtimeDetails.context.targetProcess.executablePath - - - service.runtimeDetails.context.targetProcess.executableSha256 - - - service.runtimeDetails.context.targetProcess.lineage.euid - - - service.runtimeDetails.context.targetProcess.lineage.executablePath - - - service.runtimeDetails.context.targetProcess.lineage.name - - - service.runtimeDetails.context.targetProcess.lineage.namespacePid - - - service.runtimeDetails.context.targetProcess.lineage.parentUuid - - - service.runtimeDetails.context.targetProcess.lineage.pid - - - service.runtimeDetails.context.targetProcess.lineage.startTime - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - service.runtimeDetails.context.targetProcess.lineage.userId - - - service.runtimeDetails.context.targetProcess.lineage.uuid - - - service.runtimeDetails.context.targetProcess.name - - - service.runtimeDetails.context.targetProcess.namespacePid - - - service.runtimeDetails.context.targetProcess.parentUuid - - - service.runtimeDetails.context.targetProcess.pid - - - service.runtimeDetails.context.targetProcess.pwd - - - service.runtimeDetails.context.targetProcess.startTime - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - service.runtimeDetails.context.targetProcess.user - - - service.runtimeDetails.context.targetProcess.userId - - - service.runtimeDetails.context.targetProcess.uuid - - - service.runtimeDetails.context.threatFilePath - - - service.runtimeDetails.context.toolCategory - - - service.runtimeDetails.context.toolName - - - service.runtimeDetails.process.euid - - - service.runtimeDetails.process.executablePath - - - service.runtimeDetails.process.executableSha256 - - - service.runtimeDetails.process.lineage.euid - - - service.runtimeDetails.process.lineage.executablePath - - - service.runtimeDetails.process.lineage.name - - - service.runtimeDetails.process.lineage.namespacePid - - - service.runtimeDetails.process.lineage.parentUuid - - - service.runtimeDetails.process.lineage.pid - - - service.runtimeDetails.process.lineage.startTime - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - service.runtimeDetails.process.lineage.userId - - - service.runtimeDetails.process.lineage.uuid - - - service.runtimeDetails.process.name - - - service.runtimeDetails.process.namespacePid - - - service.runtimeDetails.process.parentUuid - - - service.runtimeDetails.process.pid - - - service.runtimeDetails.process.pwd - - - service.runtimeDetails.process.startTime - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - service.runtimeDetails.process.user - - - service.runtimeDetails.process.userId - - - service.runtimeDetails.process.uuid - - - service.serviceName - - - service.userFeedback - - - severity - - To configure severity based filters, use the following for the - [FindingCriteria](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_FindingCriteria.html) - condition: - - - **Low**: `["1", "2", "3"]` - - - **Medium**: `["4", "5", "6"]` - - - **High**: `["7", "8"]` - - - **Critical**: `["9", "10"]` - - For more information, see [Findings severity - levels](https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_findings-severity.html) - in the *Amazon GuardDuty User Guide*. - - - type - - - updatedAt - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - """ - - client_token: str | None = None - """The idempotency token for the create request.""" - - tags: dict[str, str] | None = None - """The tags to be added to a new filter resource.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_FILTER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_CREATE_FILTER_INPUT.members["DetectorId"], self.detector_id - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_FILTER_INPUT.members["Name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_FILTER_INPUT.members["Description"], self.description - ) - - if self.action is not None: - serializer.write_string( - _SCHEMA_CREATE_FILTER_INPUT.members["Action"], self.action - ) - - if self.rank is not None: - serializer.write_integer( - _SCHEMA_CREATE_FILTER_INPUT.members["Rank"], self.rank - ) - - if self.finding_criteria is not None: - serializer.write_struct( - _SCHEMA_CREATE_FILTER_INPUT.members["FindingCriteria"], - self.finding_criteria, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_FILTER_INPUT.members["ClientToken"], self.client_token - ) - - if self.tags is not None: - _serialize_tag_map( - serializer, _SCHEMA_CREATE_FILTER_INPUT.members["Tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_CREATE_FILTER_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_FILTER_INPUT.members["Name"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_FILTER_INPUT.members["Description"] - ) - - case 3: - kwargs["action"] = FilterAction( - de.read_string(_SCHEMA_CREATE_FILTER_INPUT.members["Action"]) - ) - - case 4: - kwargs["rank"] = de.read_integer( - _SCHEMA_CREATE_FILTER_INPUT.members["Rank"] - ) - - case 5: - kwargs["finding_criteria"] = FindingCriteria.deserialize(de) - - case 6: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_FILTER_INPUT.members["ClientToken"] - ) - - case 7: - kwargs["tags"] = _deserialize_tag_map( - de, _SCHEMA_CREATE_FILTER_INPUT.members["Tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_FILTER_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CreateFilterOutput: - """Dataclass for CreateFilterOutput structure.""" - - name: str | None = None - """The name of the successfully created filter.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_FILTER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_FILTER_OUTPUT.members["Name"], self.name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_FILTER_OUTPUT.members["Name"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_FILTER_OUTPUT, consumer=_consumer) - return kwargs - - -CREATE_FILTER = APIOperation( - input=CreateFilterInput, - output=CreateFilterOutput, - schema=_SCHEMA_CREATE_FILTER, - input_schema=_SCHEMA_CREATE_FILTER_INPUT, - output_schema=_SCHEMA_CREATE_FILTER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class CreateInvestigationInput: - """Dataclass for CreateInvestigationInput structure.""" - - detector_id: str | None = None - """ - The unique ID of the GuardDuty detector for the account in which the - investigation is created. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - trigger_prompt: str | None = None - """ - A natural-language description of what to investigate. For example: - - - `"Investigate finding 1ab2c3d4e5f6a7b8c9d0e1f2a3b4c5d6 in account 123456789012"` - - - `"Analyze findings in account with id 123456789012"` - - - `"Analyze findings in my organization"` - """ - - client_token: str | None = None - """The idempotency token for the create request.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_INVESTIGATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_CREATE_INVESTIGATION_INPUT.members["DetectorId"], - self.detector_id, - ) - - if self.trigger_prompt is not None: - serializer.write_string( - _SCHEMA_CREATE_INVESTIGATION_INPUT.members["TriggerPrompt"], - self.trigger_prompt, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_INVESTIGATION_INPUT.members["ClientToken"], - self.client_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_CREATE_INVESTIGATION_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["trigger_prompt"] = de.read_string( - _SCHEMA_CREATE_INVESTIGATION_INPUT.members["TriggerPrompt"] - ) - - case 2: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_INVESTIGATION_INPUT.members["ClientToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_INVESTIGATION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CreateInvestigationOutput: - """Dataclass for CreateInvestigationOutput structure.""" - - investigation_id: str | None = None - """The unique identifier of the newly created investigation.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_INVESTIGATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.investigation_id is not None: - serializer.write_string( - _SCHEMA_CREATE_INVESTIGATION_OUTPUT.members["InvestigationId"], - self.investigation_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["investigation_id"] = de.read_string( - _SCHEMA_CREATE_INVESTIGATION_OUTPUT.members["InvestigationId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_INVESTIGATION_OUTPUT, consumer=_consumer - ) - return kwargs - - -CREATE_INVESTIGATION = APIOperation( - input=CreateInvestigationInput, - output=CreateInvestigationOutput, - schema=_SCHEMA_CREATE_INVESTIGATION, - input_schema=_SCHEMA_CREATE_INVESTIGATION_INPUT, - output_schema=_SCHEMA_CREATE_INVESTIGATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.guardduty#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -class IpSetFormat(UnknownEnumMixin, StrEnum): - TXT = "TXT" - STIX = "STIX" - OTX_CSV = "OTX_CSV" - ALIEN_VAULT = "ALIEN_VAULT" - PROOF_POINT = "PROOF_POINT" - FIRE_EYE = "FIRE_EYE" - - -@dataclass(kw_only=True) -class CreateIPSetInput: - """Dataclass for CreateIPSetInput structure.""" - - detector_id: str | None = None - """ - The unique ID of the detector of the GuardDuty account for which you - want to create an IPSet. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - name: str | None = None - """ - The user-friendly name to identify the IPSet. - - Allowed characters are alphanumeric, whitespace, dash (-), and - underscores (_). - """ - - format: str | None = None - """The format of the file that contains the IPSet.""" - - location: str | None = None - """The URI of the file that contains the IPSet.""" - - activate: bool | None = None - """ - A Boolean value that indicates whether GuardDuty is to start using the - uploaded IPSet. - """ - - client_token: str | None = None - """The idempotency token for the create request.""" - - tags: dict[str, str] | None = None - """The tags to be added to a new IP set resource.""" - - expected_bucket_owner: str | None = None - """ - The Amazon Web Services account ID that owns the Amazon S3 bucket - specified in the **location** parameter. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_IP_SET_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_CREATE_IP_SET_INPUT.members["DetectorId"], self.detector_id - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_IP_SET_INPUT.members["Name"], self.name - ) - - if self.format is not None: - serializer.write_string( - _SCHEMA_CREATE_IP_SET_INPUT.members["Format"], self.format - ) - - if self.location is not None: - serializer.write_string( - _SCHEMA_CREATE_IP_SET_INPUT.members["Location"], self.location - ) - - if self.activate is not None: - serializer.write_boolean( - _SCHEMA_CREATE_IP_SET_INPUT.members["Activate"], self.activate - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_IP_SET_INPUT.members["ClientToken"], self.client_token - ) - - if self.tags is not None: - _serialize_tag_map( - serializer, _SCHEMA_CREATE_IP_SET_INPUT.members["Tags"], self.tags - ) - - if self.expected_bucket_owner is not None: - serializer.write_string( - _SCHEMA_CREATE_IP_SET_INPUT.members["ExpectedBucketOwner"], - self.expected_bucket_owner, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_CREATE_IP_SET_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_IP_SET_INPUT.members["Name"] - ) - - case 2: - kwargs["format"] = IpSetFormat( - de.read_string(_SCHEMA_CREATE_IP_SET_INPUT.members["Format"]) - ) - - case 3: - kwargs["location"] = de.read_string( - _SCHEMA_CREATE_IP_SET_INPUT.members["Location"] - ) - - case 4: - kwargs["activate"] = de.read_boolean( - _SCHEMA_CREATE_IP_SET_INPUT.members["Activate"] - ) - - case 5: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_IP_SET_INPUT.members["ClientToken"] - ) - - case 6: - kwargs["tags"] = _deserialize_tag_map( - de, _SCHEMA_CREATE_IP_SET_INPUT.members["Tags"] - ) - - case 7: - kwargs["expected_bucket_owner"] = de.read_string( - _SCHEMA_CREATE_IP_SET_INPUT.members["ExpectedBucketOwner"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_IP_SET_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CreateIPSetOutput: - """Dataclass for CreateIPSetOutput structure.""" - - ip_set_id: str | None = None - """The ID of the IPSet resource.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_IP_SET_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.ip_set_id is not None: - serializer.write_string( - _SCHEMA_CREATE_IP_SET_OUTPUT.members["IpSetId"], self.ip_set_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["ip_set_id"] = de.read_string( - _SCHEMA_CREATE_IP_SET_OUTPUT.members["IpSetId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_IP_SET_OUTPUT, consumer=_consumer) - return kwargs - - -CREATE_IP_SET = APIOperation( - input=CreateIPSetInput, - output=CreateIPSetOutput, - schema=_SCHEMA_CREATE_IP_SET, - input_schema=_SCHEMA_CREATE_IP_SET_INPUT, - output_schema=_SCHEMA_CREATE_IP_SET_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.guardduty#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -class MalwareProtectionPlanTaggingActionStatus(UnknownEnumMixin, StrEnum): - ENABLED = "ENABLED" - DISABLED = "DISABLED" - - -@dataclass(kw_only=True) -class MalwareProtectionPlanTaggingAction: - """ - Information about adding tags to the scanned S3 object after the scan - result. - """ - - status: str | None = None - """Indicates whether or not the tags will added.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MALWARE_PROTECTION_PLAN_TAGGING_ACTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.status is not None: - serializer.write_string( - _SCHEMA_MALWARE_PROTECTION_PLAN_TAGGING_ACTION.members["Status"], - self.status, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["status"] = MalwareProtectionPlanTaggingActionStatus( - de.read_string( - _SCHEMA_MALWARE_PROTECTION_PLAN_TAGGING_ACTION.members[ - "Status" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MALWARE_PROTECTION_PLAN_TAGGING_ACTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class MalwareProtectionPlanActions: - """ - Information about whether the tags will be added to the S3 object after - scanning. - """ - - tagging: MalwareProtectionPlanTaggingAction | None = None - """ - Indicates whether the scanned S3 object will have tags about the scan - result. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MALWARE_PROTECTION_PLAN_ACTIONS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.tagging is not None: - serializer.write_struct( - _SCHEMA_MALWARE_PROTECTION_PLAN_ACTIONS.members["Tagging"], self.tagging - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["tagging"] = MalwareProtectionPlanTaggingAction.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MALWARE_PROTECTION_PLAN_ACTIONS, consumer=_consumer - ) - return kwargs - - -def _serialize_malware_protection_plan_object_prefixes_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_malware_protection_plan_object_prefixes_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CreateS3BucketResource: - """Information about the protected S3 bucket resource.""" - - bucket_name: str | None = None - """Name of the S3 bucket.""" - - object_prefixes: list[str] | None = None - """ - Information about the specified object prefixes. The S3 object will be - scanned only if it belongs to any of the specified object prefixes. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_S3_BUCKET_RESOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.bucket_name is not None: - serializer.write_string( - _SCHEMA_CREATE_S3_BUCKET_RESOURCE.members["BucketName"], - self.bucket_name, - ) - - if self.object_prefixes is not None: - _serialize_malware_protection_plan_object_prefixes_list( - serializer, - _SCHEMA_CREATE_S3_BUCKET_RESOURCE.members["ObjectPrefixes"], - self.object_prefixes, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bucket_name"] = de.read_string( - _SCHEMA_CREATE_S3_BUCKET_RESOURCE.members["BucketName"] - ) - - case 1: - kwargs["object_prefixes"] = ( - _deserialize_malware_protection_plan_object_prefixes_list( - de, - _SCHEMA_CREATE_S3_BUCKET_RESOURCE.members["ObjectPrefixes"], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_S3_BUCKET_RESOURCE, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CreateProtectedResource: - """ - Information about the protected resource that is associated with the - created Malware Protection plan. Presently, `S3Bucket` is the only - supported protected resource. - """ - - s3_bucket: CreateS3BucketResource | None = None - """Information about the protected S3 bucket resource.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_PROTECTED_RESOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.s3_bucket is not None: - serializer.write_struct( - _SCHEMA_CREATE_PROTECTED_RESOURCE.members["S3Bucket"], self.s3_bucket - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["s3_bucket"] = CreateS3BucketResource.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_PROTECTED_RESOURCE, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CreateMalwareProtectionPlanInput: - """Dataclass for CreateMalwareProtectionPlanInput structure.""" - - client_token: str | None = None - """The idempotency token for the create request.""" - - role: str | None = None - """ - Amazon Resource Name (ARN) of the IAM role that has the permissions to - scan and add tags to the associated protected resource. - """ - - protected_resource: CreateProtectedResource | None = None - """ - Information about the protected resource that is associated with the - created Malware Protection plan. Presently, `S3Bucket` is the only - supported protected resource. - """ - - actions: MalwareProtectionPlanActions | None = None - """ - Information about whether the tags will be added to the S3 object after - scanning. - """ - - tags: dict[str, str] | None = None - """Tags added to the Malware Protection plan resource.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_MALWARE_PROTECTION_PLAN_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_MALWARE_PROTECTION_PLAN_INPUT.members["ClientToken"], - self.client_token, - ) - - if self.role is not None: - serializer.write_string( - _SCHEMA_CREATE_MALWARE_PROTECTION_PLAN_INPUT.members["Role"], self.role - ) - - if self.protected_resource is not None: - serializer.write_struct( - _SCHEMA_CREATE_MALWARE_PROTECTION_PLAN_INPUT.members[ - "ProtectedResource" - ], - self.protected_resource, - ) - - if self.actions is not None: - serializer.write_struct( - _SCHEMA_CREATE_MALWARE_PROTECTION_PLAN_INPUT.members["Actions"], - self.actions, - ) - - if self.tags is not None: - _serialize_tag_map( - serializer, - _SCHEMA_CREATE_MALWARE_PROTECTION_PLAN_INPUT.members["Tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_MALWARE_PROTECTION_PLAN_INPUT.members[ - "ClientToken" - ] - ) - - case 1: - kwargs["role"] = de.read_string( - _SCHEMA_CREATE_MALWARE_PROTECTION_PLAN_INPUT.members["Role"] - ) - - case 2: - kwargs["protected_resource"] = CreateProtectedResource.deserialize( - de - ) - - case 3: - kwargs["actions"] = MalwareProtectionPlanActions.deserialize(de) - - case 4: - kwargs["tags"] = _deserialize_tag_map( - de, _SCHEMA_CREATE_MALWARE_PROTECTION_PLAN_INPUT.members["Tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_MALWARE_PROTECTION_PLAN_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CreateMalwareProtectionPlanOutput: - """Dataclass for CreateMalwareProtectionPlanOutput structure.""" - - malware_protection_plan_id: str | None = None - """ - A unique identifier associated with the Malware Protection plan - resource. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_MALWARE_PROTECTION_PLAN_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.malware_protection_plan_id is not None: - serializer.write_string( - _SCHEMA_CREATE_MALWARE_PROTECTION_PLAN_OUTPUT.members[ - "MalwareProtectionPlanId" - ], - self.malware_protection_plan_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["malware_protection_plan_id"] = de.read_string( - _SCHEMA_CREATE_MALWARE_PROTECTION_PLAN_OUTPUT.members[ - "MalwareProtectionPlanId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_MALWARE_PROTECTION_PLAN_OUTPUT, consumer=_consumer - ) - return kwargs - - -CREATE_MALWARE_PROTECTION_PLAN = APIOperation( - input=CreateMalwareProtectionPlanInput, - output=CreateMalwareProtectionPlanOutput, - schema=_SCHEMA_CREATE_MALWARE_PROTECTION_PLAN, - input_schema=_SCHEMA_CREATE_MALWARE_PROTECTION_PLAN_INPUT, - output_schema=_SCHEMA_CREATE_MALWARE_PROTECTION_PLAN_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.guardduty#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID("com.amazonaws.guardduty#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class CreateMembersInput: - """Dataclass for CreateMembersInput structure.""" - - detector_id: str | None = None - """ - The unique ID of the detector of the GuardDuty account for which you - want to associate member accounts. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - account_details: list[AccountDetail] | None = None - """ - A list of account ID and email address pairs of the accounts that you - want to associate with the GuardDuty administrator account. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_MEMBERS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_CREATE_MEMBERS_INPUT.members["DetectorId"], self.detector_id - ) - - if self.account_details is not None: - _serialize_account_details( - serializer, - _SCHEMA_CREATE_MEMBERS_INPUT.members["AccountDetails"], - self.account_details, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_CREATE_MEMBERS_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["account_details"] = _deserialize_account_details( - de, _SCHEMA_CREATE_MEMBERS_INPUT.members["AccountDetails"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_MEMBERS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UnprocessedAccount: - """Contains information about the accounts that weren't processed.""" - - account_id: str | None = None - """The Amazon Web Services account ID.""" - - result: str | None = None - """A reason why the account hasn't been processed.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNPROCESSED_ACCOUNT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.account_id is not None: - serializer.write_string( - _SCHEMA_UNPROCESSED_ACCOUNT.members["AccountId"], self.account_id - ) - - if self.result is not None: - serializer.write_string( - _SCHEMA_UNPROCESSED_ACCOUNT.members["Result"], self.result - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["account_id"] = de.read_string( - _SCHEMA_UNPROCESSED_ACCOUNT.members["AccountId"] - ) - - case 1: - kwargs["result"] = de.read_string( - _SCHEMA_UNPROCESSED_ACCOUNT.members["Result"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UNPROCESSED_ACCOUNT, consumer=_consumer) - return kwargs - - -def _serialize_unprocessed_accounts( - serializer: ShapeSerializer, schema: Schema, value: list[UnprocessedAccount] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_unprocessed_accounts( - deserializer: ShapeDeserializer, schema: Schema -) -> list[UnprocessedAccount]: - result: list[UnprocessedAccount] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(UnprocessedAccount.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CreateMembersOutput: - """Dataclass for CreateMembersOutput structure.""" - - unprocessed_accounts: list[UnprocessedAccount] | None = None - """ - A list of objects that include the `accountIds` of the unprocessed - accounts and a result string that explains why each was unprocessed. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_MEMBERS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.unprocessed_accounts is not None: - _serialize_unprocessed_accounts( - serializer, - _SCHEMA_CREATE_MEMBERS_OUTPUT.members["UnprocessedAccounts"], - self.unprocessed_accounts, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["unprocessed_accounts"] = _deserialize_unprocessed_accounts( - de, _SCHEMA_CREATE_MEMBERS_OUTPUT.members["UnprocessedAccounts"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_MEMBERS_OUTPUT, consumer=_consumer) - return kwargs - - -CREATE_MEMBERS = APIOperation( - input=CreateMembersInput, - output=CreateMembersOutput, - schema=_SCHEMA_CREATE_MEMBERS, - input_schema=_SCHEMA_CREATE_MEMBERS_INPUT, - output_schema=_SCHEMA_CREATE_MEMBERS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DestinationProperties: - """ - Contains the Amazon Resource Name (ARN) of the resource to publish to, - such as an S3 bucket, and the ARN of the KMS key to use to encrypt - published findings. - """ - - destination_arn: str | None = None - """ - The ARN of the resource to publish to. - - To specify an S3 bucket folder use the following format: - `arn:aws:s3:::DOC-EXAMPLE-BUCKET/myFolder/` - """ - - kms_key_arn: str | None = None - """The ARN of the KMS key to use for encryption.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DESTINATION_PROPERTIES, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.destination_arn is not None: - serializer.write_string( - _SCHEMA_DESTINATION_PROPERTIES.members["DestinationArn"], - self.destination_arn, - ) - - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_DESTINATION_PROPERTIES.members["KmsKeyArn"], self.kms_key_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["destination_arn"] = de.read_string( - _SCHEMA_DESTINATION_PROPERTIES.members["DestinationArn"] - ) - - case 1: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_DESTINATION_PROPERTIES.members["KmsKeyArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DESTINATION_PROPERTIES, consumer=_consumer) - return kwargs - - -class DestinationType(UnknownEnumMixin, StrEnum): - S3 = "S3" - - -@dataclass(kw_only=True) -class CreatePublishingDestinationInput: - """Dataclass for CreatePublishingDestinationInput structure.""" - - detector_id: str | None = None - """ - The ID of the GuardDuty detector associated with the publishing - destination. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - destination_type: str | None = None - """ - The type of resource for the publishing destination. Currently only - Amazon S3 buckets are supported. - """ - - destination_properties: DestinationProperties | None = None - """ - The properties of the publishing destination, including the ARNs for the - destination and the KMS key used for encryption. - """ - - client_token: str | None = None - """The idempotency token for the request.""" - - tags: dict[str, str] | None = None - """The tags to be added to a new publishing destination resource.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_PUBLISHING_DESTINATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_CREATE_PUBLISHING_DESTINATION_INPUT.members["DetectorId"], - self.detector_id, - ) - - if self.destination_type is not None: - serializer.write_string( - _SCHEMA_CREATE_PUBLISHING_DESTINATION_INPUT.members["DestinationType"], - self.destination_type, - ) - - if self.destination_properties is not None: - serializer.write_struct( - _SCHEMA_CREATE_PUBLISHING_DESTINATION_INPUT.members[ - "DestinationProperties" - ], - self.destination_properties, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_PUBLISHING_DESTINATION_INPUT.members["ClientToken"], - self.client_token, - ) - - if self.tags is not None: - _serialize_tag_map( - serializer, - _SCHEMA_CREATE_PUBLISHING_DESTINATION_INPUT.members["Tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_CREATE_PUBLISHING_DESTINATION_INPUT.members[ - "DetectorId" - ] - ) - - case 1: - kwargs["destination_type"] = DestinationType( - de.read_string( - _SCHEMA_CREATE_PUBLISHING_DESTINATION_INPUT.members[ - "DestinationType" - ] - ) - ) - - case 2: - kwargs["destination_properties"] = ( - DestinationProperties.deserialize(de) - ) - - case 3: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_PUBLISHING_DESTINATION_INPUT.members[ - "ClientToken" - ] - ) - - case 4: - kwargs["tags"] = _deserialize_tag_map( - de, _SCHEMA_CREATE_PUBLISHING_DESTINATION_INPUT.members["Tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_PUBLISHING_DESTINATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CreatePublishingDestinationOutput: - """Dataclass for CreatePublishingDestinationOutput structure.""" - - destination_id: str | None = None - """The ID of the publishing destination that is created.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_PUBLISHING_DESTINATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.destination_id is not None: - serializer.write_string( - _SCHEMA_CREATE_PUBLISHING_DESTINATION_OUTPUT.members["DestinationId"], - self.destination_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["destination_id"] = de.read_string( - _SCHEMA_CREATE_PUBLISHING_DESTINATION_OUTPUT.members[ - "DestinationId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_PUBLISHING_DESTINATION_OUTPUT, consumer=_consumer - ) - return kwargs - - -CREATE_PUBLISHING_DESTINATION = APIOperation( - input=CreatePublishingDestinationInput, - output=CreatePublishingDestinationOutput, - schema=_SCHEMA_CREATE_PUBLISHING_DESTINATION, - input_schema=_SCHEMA_CREATE_PUBLISHING_DESTINATION_INPUT, - output_schema=_SCHEMA_CREATE_PUBLISHING_DESTINATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -def _serialize_finding_types( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_finding_types( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CreateSampleFindingsInput: - """Dataclass for CreateSampleFindingsInput structure.""" - - detector_id: str | None = None - """ - The ID of the detector for which you need to create sample findings. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - finding_types: list[str] | None = None - """The types of sample findings to generate.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_SAMPLE_FINDINGS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_CREATE_SAMPLE_FINDINGS_INPUT.members["DetectorId"], - self.detector_id, - ) - - if self.finding_types is not None: - _serialize_finding_types( - serializer, - _SCHEMA_CREATE_SAMPLE_FINDINGS_INPUT.members["FindingTypes"], - self.finding_types, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_CREATE_SAMPLE_FINDINGS_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["finding_types"] = _deserialize_finding_types( - de, _SCHEMA_CREATE_SAMPLE_FINDINGS_INPUT.members["FindingTypes"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_SAMPLE_FINDINGS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CreateSampleFindingsOutput: - """Dataclass for CreateSampleFindingsOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_SAMPLE_FINDINGS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_SAMPLE_FINDINGS_OUTPUT, consumer=_consumer - ) - return kwargs - - -CREATE_SAMPLE_FINDINGS = APIOperation( - input=CreateSampleFindingsInput, - output=CreateSampleFindingsOutput, - schema=_SCHEMA_CREATE_SAMPLE_FINDINGS, - input_schema=_SCHEMA_CREATE_SAMPLE_FINDINGS_INPUT, - output_schema=_SCHEMA_CREATE_SAMPLE_FINDINGS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -class ThreatEntitySetFormat(UnknownEnumMixin, StrEnum): - TXT = "TXT" - STIX = "STIX" - OTX_CSV = "OTX_CSV" - ALIEN_VAULT = "ALIEN_VAULT" - PROOF_POINT = "PROOF_POINT" - FIRE_EYE = "FIRE_EYE" - - -@dataclass(kw_only=True) -class CreateThreatEntitySetInput: - """Dataclass for CreateThreatEntitySetInput structure.""" - - detector_id: str | None = None - """ - The unique ID of the detector of the GuardDuty account for which you - want to create a threat entity set. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - name: str | None = None - """ - A user-friendly name to identify the threat entity set. - - The name of your list can include lowercase letters, uppercase letters, - numbers, dash (-), and underscore (_). - """ - - format: str | None = None - """The format of the file that contains the threat entity set.""" - - location: str | None = None - """ - The URI of the file that contains the threat entity set. The format of - the `Location` URL must be a valid Amazon S3 URL format. Invalid URL - formats will result in an error, regardless of whether you activate the - entity set or not. For more information about format of the location - URLs, see [Format of location URL under Step 2: Adding trusted or threat - intelligence - data](https://docs.aws.amazon.com/guardduty/latest/ug/guardduty-lists-create-activate.html) - in the *Amazon GuardDuty User Guide*. - """ - - expected_bucket_owner: str | None = None - """ - The Amazon Web Services account ID that owns the Amazon S3 bucket - specified in the **location** parameter. - """ - - activate: bool | None = None - """ - A boolean value that indicates whether GuardDuty should start using the - uploaded threat entity set to generate findings. - """ - - client_token: str | None = None - """The idempotency token for the create request.""" - - tags: dict[str, str] | None = None - """The tags to be added to a new threat entity set resource.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_THREAT_ENTITY_SET_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_CREATE_THREAT_ENTITY_SET_INPUT.members["DetectorId"], - self.detector_id, - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_THREAT_ENTITY_SET_INPUT.members["Name"], self.name - ) - - if self.format is not None: - serializer.write_string( - _SCHEMA_CREATE_THREAT_ENTITY_SET_INPUT.members["Format"], self.format - ) - - if self.location is not None: - serializer.write_string( - _SCHEMA_CREATE_THREAT_ENTITY_SET_INPUT.members["Location"], - self.location, - ) - - if self.expected_bucket_owner is not None: - serializer.write_string( - _SCHEMA_CREATE_THREAT_ENTITY_SET_INPUT.members["ExpectedBucketOwner"], - self.expected_bucket_owner, - ) - - if self.activate is not None: - serializer.write_boolean( - _SCHEMA_CREATE_THREAT_ENTITY_SET_INPUT.members["Activate"], - self.activate, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_THREAT_ENTITY_SET_INPUT.members["ClientToken"], - self.client_token, - ) - - if self.tags is not None: - _serialize_tag_map( - serializer, - _SCHEMA_CREATE_THREAT_ENTITY_SET_INPUT.members["Tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_CREATE_THREAT_ENTITY_SET_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_THREAT_ENTITY_SET_INPUT.members["Name"] - ) - - case 2: - kwargs["format"] = ThreatEntitySetFormat( - de.read_string( - _SCHEMA_CREATE_THREAT_ENTITY_SET_INPUT.members["Format"] - ) - ) - - case 3: - kwargs["location"] = de.read_string( - _SCHEMA_CREATE_THREAT_ENTITY_SET_INPUT.members["Location"] - ) - - case 4: - kwargs["expected_bucket_owner"] = de.read_string( - _SCHEMA_CREATE_THREAT_ENTITY_SET_INPUT.members[ - "ExpectedBucketOwner" - ] - ) - - case 5: - kwargs["activate"] = de.read_boolean( - _SCHEMA_CREATE_THREAT_ENTITY_SET_INPUT.members["Activate"] - ) - - case 6: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_THREAT_ENTITY_SET_INPUT.members["ClientToken"] - ) - - case 7: - kwargs["tags"] = _deserialize_tag_map( - de, _SCHEMA_CREATE_THREAT_ENTITY_SET_INPUT.members["Tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_THREAT_ENTITY_SET_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CreateThreatEntitySetOutput: - """Dataclass for CreateThreatEntitySetOutput structure.""" - - threat_entity_set_id: str | None = None - """ - The ID returned by GuardDuty after creation of the threat entity set - resource. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_THREAT_ENTITY_SET_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.threat_entity_set_id is not None: - serializer.write_string( - _SCHEMA_CREATE_THREAT_ENTITY_SET_OUTPUT.members["ThreatEntitySetId"], - self.threat_entity_set_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["threat_entity_set_id"] = de.read_string( - _SCHEMA_CREATE_THREAT_ENTITY_SET_OUTPUT.members[ - "ThreatEntitySetId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_THREAT_ENTITY_SET_OUTPUT, consumer=_consumer - ) - return kwargs - - -CREATE_THREAT_ENTITY_SET = APIOperation( - input=CreateThreatEntitySetInput, - output=CreateThreatEntitySetOutput, - schema=_SCHEMA_CREATE_THREAT_ENTITY_SET, - input_schema=_SCHEMA_CREATE_THREAT_ENTITY_SET_INPUT, - output_schema=_SCHEMA_CREATE_THREAT_ENTITY_SET_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -class ThreatIntelSetFormat(UnknownEnumMixin, StrEnum): - TXT = "TXT" - STIX = "STIX" - OTX_CSV = "OTX_CSV" - ALIEN_VAULT = "ALIEN_VAULT" - PROOF_POINT = "PROOF_POINT" - FIRE_EYE = "FIRE_EYE" - - -@dataclass(kw_only=True) -class CreateThreatIntelSetInput: - """Dataclass for CreateThreatIntelSetInput structure.""" - - detector_id: str | None = None - """ - The unique ID of the detector of the GuardDuty account for which you - want to create a `threatIntelSet`. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - name: str | None = None - """ - A user-friendly ThreatIntelSet name displayed in all findings that are - generated by activity that involves IP addresses included in this - ThreatIntelSet. - """ - - format: str | None = None - """The format of the file that contains the ThreatIntelSet.""" - - location: str | None = None - """The URI of the file that contains the ThreatIntelSet.""" - - activate: bool | None = None - """ - A Boolean value that indicates whether GuardDuty is to start using the - uploaded ThreatIntelSet. - """ - - client_token: str | None = None - """The idempotency token for the create request.""" - - tags: dict[str, str] | None = None - """The tags to be added to a new threat list resource.""" - - expected_bucket_owner: str | None = None - """ - The Amazon Web Services account ID that owns the Amazon S3 bucket - specified in the **location** parameter. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_THREAT_INTEL_SET_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_CREATE_THREAT_INTEL_SET_INPUT.members["DetectorId"], - self.detector_id, - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_THREAT_INTEL_SET_INPUT.members["Name"], self.name - ) - - if self.format is not None: - serializer.write_string( - _SCHEMA_CREATE_THREAT_INTEL_SET_INPUT.members["Format"], self.format - ) - - if self.location is not None: - serializer.write_string( - _SCHEMA_CREATE_THREAT_INTEL_SET_INPUT.members["Location"], self.location - ) - - if self.activate is not None: - serializer.write_boolean( - _SCHEMA_CREATE_THREAT_INTEL_SET_INPUT.members["Activate"], self.activate - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_THREAT_INTEL_SET_INPUT.members["ClientToken"], - self.client_token, - ) - - if self.tags is not None: - _serialize_tag_map( - serializer, - _SCHEMA_CREATE_THREAT_INTEL_SET_INPUT.members["Tags"], - self.tags, - ) - - if self.expected_bucket_owner is not None: - serializer.write_string( - _SCHEMA_CREATE_THREAT_INTEL_SET_INPUT.members["ExpectedBucketOwner"], - self.expected_bucket_owner, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_CREATE_THREAT_INTEL_SET_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_THREAT_INTEL_SET_INPUT.members["Name"] - ) - - case 2: - kwargs["format"] = ThreatIntelSetFormat( - de.read_string( - _SCHEMA_CREATE_THREAT_INTEL_SET_INPUT.members["Format"] - ) - ) - - case 3: - kwargs["location"] = de.read_string( - _SCHEMA_CREATE_THREAT_INTEL_SET_INPUT.members["Location"] - ) - - case 4: - kwargs["activate"] = de.read_boolean( - _SCHEMA_CREATE_THREAT_INTEL_SET_INPUT.members["Activate"] - ) - - case 5: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_THREAT_INTEL_SET_INPUT.members["ClientToken"] - ) - - case 6: - kwargs["tags"] = _deserialize_tag_map( - de, _SCHEMA_CREATE_THREAT_INTEL_SET_INPUT.members["Tags"] - ) - - case 7: - kwargs["expected_bucket_owner"] = de.read_string( - _SCHEMA_CREATE_THREAT_INTEL_SET_INPUT.members[ - "ExpectedBucketOwner" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_THREAT_INTEL_SET_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CreateThreatIntelSetOutput: - """Dataclass for CreateThreatIntelSetOutput structure.""" - - threat_intel_set_id: str | None = None - """The ID of the ThreatIntelSet resource.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_THREAT_INTEL_SET_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.threat_intel_set_id is not None: - serializer.write_string( - _SCHEMA_CREATE_THREAT_INTEL_SET_OUTPUT.members["ThreatIntelSetId"], - self.threat_intel_set_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["threat_intel_set_id"] = de.read_string( - _SCHEMA_CREATE_THREAT_INTEL_SET_OUTPUT.members[ - "ThreatIntelSetId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_THREAT_INTEL_SET_OUTPUT, consumer=_consumer - ) - return kwargs - - -CREATE_THREAT_INTEL_SET = APIOperation( - input=CreateThreatIntelSetInput, - output=CreateThreatIntelSetOutput, - schema=_SCHEMA_CREATE_THREAT_INTEL_SET, - input_schema=_SCHEMA_CREATE_THREAT_INTEL_SET_INPUT, - output_schema=_SCHEMA_CREATE_THREAT_INTEL_SET_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.guardduty#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -class TrustedEntitySetFormat(UnknownEnumMixin, StrEnum): - TXT = "TXT" - STIX = "STIX" - OTX_CSV = "OTX_CSV" - ALIEN_VAULT = "ALIEN_VAULT" - PROOF_POINT = "PROOF_POINT" - FIRE_EYE = "FIRE_EYE" - - -@dataclass(kw_only=True) -class CreateTrustedEntitySetInput: - """Dataclass for CreateTrustedEntitySetInput structure.""" - - detector_id: str | None = None - """ - The unique ID of the detector of the GuardDuty account for which you - want to create a trusted entity set. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - name: str | None = None - """ - A user-friendly name to identify the trusted entity set. - - The name of your list can include lowercase letters, uppercase letters, - numbers, dash (-), and underscore (_). - """ - - format: str | None = None - """The format of the file that contains the trusted entity set.""" - - location: str | None = None - """ - The URI of the file that contains the threat entity set. The format of - the `Location` URL must be a valid Amazon S3 URL format. Invalid URL - formats will result in an error, regardless of whether you activate the - entity set or not. For more information about format of the location - URLs, see [Format of location URL under Step 2: Adding trusted or threat - intelligence - data](https://docs.aws.amazon.com/guardduty/latest/ug/guardduty-lists-create-activate.html) - in the *Amazon GuardDuty User Guide*. - """ - - expected_bucket_owner: str | None = None - """ - The Amazon Web Services account ID that owns the Amazon S3 bucket - specified in the **location** parameter. - """ - - activate: bool | None = None - """ - A boolean value that indicates whether GuardDuty is to start using the - uploaded trusted entity set. - """ - - client_token: str | None = None - """The idempotency token for the create request.""" - - tags: dict[str, str] | None = None - """The tags to be added to a new trusted entity set resource.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_TRUSTED_ENTITY_SET_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_CREATE_TRUSTED_ENTITY_SET_INPUT.members["DetectorId"], - self.detector_id, - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_TRUSTED_ENTITY_SET_INPUT.members["Name"], self.name - ) - - if self.format is not None: - serializer.write_string( - _SCHEMA_CREATE_TRUSTED_ENTITY_SET_INPUT.members["Format"], self.format - ) - - if self.location is not None: - serializer.write_string( - _SCHEMA_CREATE_TRUSTED_ENTITY_SET_INPUT.members["Location"], - self.location, - ) - - if self.expected_bucket_owner is not None: - serializer.write_string( - _SCHEMA_CREATE_TRUSTED_ENTITY_SET_INPUT.members["ExpectedBucketOwner"], - self.expected_bucket_owner, - ) - - if self.activate is not None: - serializer.write_boolean( - _SCHEMA_CREATE_TRUSTED_ENTITY_SET_INPUT.members["Activate"], - self.activate, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_TRUSTED_ENTITY_SET_INPUT.members["ClientToken"], - self.client_token, - ) - - if self.tags is not None: - _serialize_tag_map( - serializer, - _SCHEMA_CREATE_TRUSTED_ENTITY_SET_INPUT.members["Tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_CREATE_TRUSTED_ENTITY_SET_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_TRUSTED_ENTITY_SET_INPUT.members["Name"] - ) - - case 2: - kwargs["format"] = TrustedEntitySetFormat( - de.read_string( - _SCHEMA_CREATE_TRUSTED_ENTITY_SET_INPUT.members["Format"] - ) - ) - - case 3: - kwargs["location"] = de.read_string( - _SCHEMA_CREATE_TRUSTED_ENTITY_SET_INPUT.members["Location"] - ) - - case 4: - kwargs["expected_bucket_owner"] = de.read_string( - _SCHEMA_CREATE_TRUSTED_ENTITY_SET_INPUT.members[ - "ExpectedBucketOwner" - ] - ) - - case 5: - kwargs["activate"] = de.read_boolean( - _SCHEMA_CREATE_TRUSTED_ENTITY_SET_INPUT.members["Activate"] - ) - - case 6: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_TRUSTED_ENTITY_SET_INPUT.members["ClientToken"] - ) - - case 7: - kwargs["tags"] = _deserialize_tag_map( - de, _SCHEMA_CREATE_TRUSTED_ENTITY_SET_INPUT.members["Tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_TRUSTED_ENTITY_SET_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CreateTrustedEntitySetOutput: - """Dataclass for CreateTrustedEntitySetOutput structure.""" - - trusted_entity_set_id: str | None = None - """ - The ID returned by GuardDuty after creation of the trusted entity set - resource. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_TRUSTED_ENTITY_SET_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.trusted_entity_set_id is not None: - serializer.write_string( - _SCHEMA_CREATE_TRUSTED_ENTITY_SET_OUTPUT.members["TrustedEntitySetId"], - self.trusted_entity_set_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["trusted_entity_set_id"] = de.read_string( - _SCHEMA_CREATE_TRUSTED_ENTITY_SET_OUTPUT.members[ - "TrustedEntitySetId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_TRUSTED_ENTITY_SET_OUTPUT, consumer=_consumer - ) - return kwargs - - -CREATE_TRUSTED_ENTITY_SET = APIOperation( - input=CreateTrustedEntitySetInput, - output=CreateTrustedEntitySetOutput, - schema=_SCHEMA_CREATE_TRUSTED_ENTITY_SET, - input_schema=_SCHEMA_CREATE_TRUSTED_ENTITY_SET_INPUT, - output_schema=_SCHEMA_CREATE_TRUSTED_ENTITY_SET_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -class CriterionKey(UnknownEnumMixin, StrEnum): - EC2_INSTANCE_ARN = "EC2_INSTANCE_ARN" - SCAN_ID = "SCAN_ID" - ACCOUNT_ID = "ACCOUNT_ID" - GUARDDUTY_FINDING_ID = "GUARDDUTY_FINDING_ID" - SCAN_START_TIME = "SCAN_START_TIME" - SCAN_STATUS = "SCAN_STATUS" - SCAN_TYPE = "SCAN_TYPE" - - -class DataSource(UnknownEnumMixin, StrEnum): - FLOW_LOGS = "FLOW_LOGS" - CLOUD_TRAIL = "CLOUD_TRAIL" - DNS_LOGS = "DNS_LOGS" - S3_LOGS = "S3_LOGS" - KUBERNETES_AUDIT_LOGS = "KUBERNETES_AUDIT_LOGS" - EC2_MALWARE_SCAN = "EC2_MALWARE_SCAN" - - -@dataclass(kw_only=True) -class DNSLogsConfigurationResult: - """Contains information on the status of DNS logs as a data source.""" - - status: str | None = None - """Denotes whether DNS logs is enabled as a data source.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DNS_LOGS_CONFIGURATION_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.status is not None: - serializer.write_string( - _SCHEMA_DNS_LOGS_CONFIGURATION_RESULT.members["Status"], self.status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["status"] = DataSourceStatus( - de.read_string( - _SCHEMA_DNS_LOGS_CONFIGURATION_RESULT.members["Status"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DNS_LOGS_CONFIGURATION_RESULT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class FlowLogsConfigurationResult: - """Contains information on the status of VPC flow logs as a data source.""" - - status: str | None = None - """Denotes whether VPC flow logs is enabled as a data source.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLOW_LOGS_CONFIGURATION_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.status is not None: - serializer.write_string( - _SCHEMA_FLOW_LOGS_CONFIGURATION_RESULT.members["Status"], self.status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["status"] = DataSourceStatus( - de.read_string( - _SCHEMA_FLOW_LOGS_CONFIGURATION_RESULT.members["Status"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_FLOW_LOGS_CONFIGURATION_RESULT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class KubernetesAuditLogsConfigurationResult: - """Describes whether Kubernetes audit logs are enabled as a data source.""" - - status: str | None = None - """ - A value that describes whether Kubernetes audit logs are enabled as a - data source. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_KUBERNETES_AUDIT_LOGS_CONFIGURATION_RESULT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.status is not None: - serializer.write_string( - _SCHEMA_KUBERNETES_AUDIT_LOGS_CONFIGURATION_RESULT.members["Status"], - self.status, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["status"] = DataSourceStatus( - de.read_string( - _SCHEMA_KUBERNETES_AUDIT_LOGS_CONFIGURATION_RESULT.members[ - "Status" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_KUBERNETES_AUDIT_LOGS_CONFIGURATION_RESULT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class KubernetesConfigurationResult: - """Describes whether any Kubernetes logs will be enabled as a data source.""" - - audit_logs: KubernetesAuditLogsConfigurationResult | None = None - """Describes whether Kubernetes audit logs are enabled as a data source.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KUBERNETES_CONFIGURATION_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.audit_logs is not None: - serializer.write_struct( - _SCHEMA_KUBERNETES_CONFIGURATION_RESULT.members["AuditLogs"], - self.audit_logs, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["audit_logs"] = ( - KubernetesAuditLogsConfigurationResult.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_KUBERNETES_CONFIGURATION_RESULT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class S3LogsConfigurationResult: - """Describes whether S3 data event logs will be enabled as a data source.""" - - status: str | None = None - """ - A value that describes whether S3 data event logs are automatically - enabled for new members of the organization. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_S3_LOGS_CONFIGURATION_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.status is not None: - serializer.write_string( - _SCHEMA_S3_LOGS_CONFIGURATION_RESULT.members["Status"], self.status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["status"] = DataSourceStatus( - de.read_string( - _SCHEMA_S3_LOGS_CONFIGURATION_RESULT.members["Status"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_S3_LOGS_CONFIGURATION_RESULT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DataSourceConfigurationsResult: - """Contains information on the status of data sources for the detector.""" - - cloud_trail: CloudTrailConfigurationResult | None = None - """ - An object that contains information on the status of CloudTrail as a - data source. - """ - - dns_logs: DNSLogsConfigurationResult | None = None - """ - An object that contains information on the status of DNS logs as a data - source. - """ - - flow_logs: FlowLogsConfigurationResult | None = None - """ - An object that contains information on the status of VPC flow logs as a - data source. - """ - - s3_logs: S3LogsConfigurationResult | None = None - """ - An object that contains information on the status of S3 Data event logs - as a data source. - """ - - kubernetes: KubernetesConfigurationResult | None = None - """ - An object that contains information on the status of all Kubernetes data - sources. - """ - - malware_protection: MalwareProtectionConfigurationResult | None = None - """Describes the configuration of Malware Protection data sources.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DATA_SOURCE_CONFIGURATIONS_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.cloud_trail is not None: - serializer.write_struct( - _SCHEMA_DATA_SOURCE_CONFIGURATIONS_RESULT.members["CloudTrail"], - self.cloud_trail, - ) - - if self.dns_logs is not None: - serializer.write_struct( - _SCHEMA_DATA_SOURCE_CONFIGURATIONS_RESULT.members["DNSLogs"], - self.dns_logs, - ) - - if self.flow_logs is not None: - serializer.write_struct( - _SCHEMA_DATA_SOURCE_CONFIGURATIONS_RESULT.members["FlowLogs"], - self.flow_logs, - ) - - if self.s3_logs is not None: - serializer.write_struct( - _SCHEMA_DATA_SOURCE_CONFIGURATIONS_RESULT.members["S3Logs"], - self.s3_logs, - ) - - if self.kubernetes is not None: - serializer.write_struct( - _SCHEMA_DATA_SOURCE_CONFIGURATIONS_RESULT.members["Kubernetes"], - self.kubernetes, - ) - - if self.malware_protection is not None: - serializer.write_struct( - _SCHEMA_DATA_SOURCE_CONFIGURATIONS_RESULT.members["MalwareProtection"], - self.malware_protection, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["cloud_trail"] = CloudTrailConfigurationResult.deserialize( - de - ) - - case 1: - kwargs["dns_logs"] = DNSLogsConfigurationResult.deserialize(de) - - case 2: - kwargs["flow_logs"] = FlowLogsConfigurationResult.deserialize(de) - - case 3: - kwargs["s3_logs"] = S3LogsConfigurationResult.deserialize(de) - - case 4: - kwargs["kubernetes"] = KubernetesConfigurationResult.deserialize(de) - - case 5: - kwargs["malware_protection"] = ( - MalwareProtectionConfigurationResult.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DATA_SOURCE_CONFIGURATIONS_RESULT, consumer=_consumer - ) - return kwargs - - -def _serialize_data_source_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_data_source_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(DataSource(d.read_string(member_schema))) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class DateStatistics: - """ - Represents list a map of dates with a count of total findings generated - on each date. - """ - - date: datetime | None = None - """ - The timestamp when the total findings count is observed. - - For example, `Date` would look like `"2024-09-05T17:00:00-07:00"` - whereas `LastGeneratedAt` would look like 2024-09-05T17:12:29-07:00\". - """ - - last_generated_at: datetime | None = None - """ - The timestamp at which the last finding in the findings count, was - generated. - """ - - severity: float | None = None - """The severity of the findings generated on each date.""" - - total_findings: int | None = None - """ - The total number of findings that were generated per severity level on - each date. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DATE_STATISTICS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.date is not None: - serializer.write_timestamp( - _SCHEMA_DATE_STATISTICS.members["Date"], self.date - ) - - if self.last_generated_at is not None: - serializer.write_timestamp( - _SCHEMA_DATE_STATISTICS.members["LastGeneratedAt"], - self.last_generated_at, - ) - - if self.severity is not None: - serializer.write_double( - _SCHEMA_DATE_STATISTICS.members["Severity"], self.severity - ) - - if self.total_findings is not None: - serializer.write_integer( - _SCHEMA_DATE_STATISTICS.members["TotalFindings"], self.total_findings - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["date"] = de.read_timestamp( - _SCHEMA_DATE_STATISTICS.members["Date"] - ) - - case 1: - kwargs["last_generated_at"] = de.read_timestamp( - _SCHEMA_DATE_STATISTICS.members["LastGeneratedAt"] - ) - - case 2: - kwargs["severity"] = de.read_double( - _SCHEMA_DATE_STATISTICS.members["Severity"] - ) - - case 3: - kwargs["total_findings"] = de.read_integer( - _SCHEMA_DATE_STATISTICS.members["TotalFindings"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DATE_STATISTICS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeclineInvitationsInput: - """Dataclass for DeclineInvitationsInput structure.""" - - account_ids: list[str] | None = None - """ - A list of account IDs of the Amazon Web Services accounts that sent - invitations to the current member account that you want to decline - invitations from. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DECLINE_INVITATIONS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.account_ids is not None: - _serialize_account_ids( - serializer, - _SCHEMA_DECLINE_INVITATIONS_INPUT.members["AccountIds"], - self.account_ids, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["account_ids"] = _deserialize_account_ids( - de, _SCHEMA_DECLINE_INVITATIONS_INPUT.members["AccountIds"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DECLINE_INVITATIONS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeclineInvitationsOutput: - """Dataclass for DeclineInvitationsOutput structure.""" - - unprocessed_accounts: list[UnprocessedAccount] | None = None - """ - A list of objects that contain the unprocessed account and a result - string that explains why it was unprocessed. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DECLINE_INVITATIONS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.unprocessed_accounts is not None: - _serialize_unprocessed_accounts( - serializer, - _SCHEMA_DECLINE_INVITATIONS_OUTPUT.members["UnprocessedAccounts"], - self.unprocessed_accounts, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["unprocessed_accounts"] = _deserialize_unprocessed_accounts( - de, - _SCHEMA_DECLINE_INVITATIONS_OUTPUT.members[ - "UnprocessedAccounts" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DECLINE_INVITATIONS_OUTPUT, consumer=_consumer) - return kwargs - - -DECLINE_INVITATIONS = APIOperation( - input=DeclineInvitationsInput, - output=DeclineInvitationsOutput, - schema=_SCHEMA_DECLINE_INVITATIONS, - input_schema=_SCHEMA_DECLINE_INVITATIONS_INPUT, - output_schema=_SCHEMA_DECLINE_INVITATIONS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DefaultServerSideEncryption: - """ - Contains information on the server side encryption method used in the S3 - bucket. See [S3 Server-Side - Encryption](https://docs.aws.amazon.com/AmazonS3/latest/dev/serv-side-encryption.html) - for more information. - """ - - encryption_type: str | None = None - """The type of encryption used for objects within the S3 bucket.""" - - kms_master_key_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the KMS encryption key. Only available - if the bucket `EncryptionType` is `aws:kms`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DEFAULT_SERVER_SIDE_ENCRYPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.encryption_type is not None: - serializer.write_string( - _SCHEMA_DEFAULT_SERVER_SIDE_ENCRYPTION.members["EncryptionType"], - self.encryption_type, - ) - - if self.kms_master_key_arn is not None: - serializer.write_string( - _SCHEMA_DEFAULT_SERVER_SIDE_ENCRYPTION.members["KmsMasterKeyArn"], - self.kms_master_key_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["encryption_type"] = de.read_string( - _SCHEMA_DEFAULT_SERVER_SIDE_ENCRYPTION.members["EncryptionType"] - ) - - case 1: - kwargs["kms_master_key_arn"] = de.read_string( - _SCHEMA_DEFAULT_SERVER_SIDE_ENCRYPTION.members[ - "KmsMasterKeyArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DEFAULT_SERVER_SIDE_ENCRYPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteCustomDetectionRuleAssociationInput: - """Dataclass for DeleteCustomDetectionRuleAssociationInput structure.""" - - rule_id: str | None = None - """The unique identifier for the custom detection rule.""" - - association_id: str | None = None - """The unique identifier for the association to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DELETE_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rule_id is not None: - serializer.write_string( - _SCHEMA_DELETE_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT.members[ - "RuleId" - ], - self.rule_id, - ) - - if self.association_id is not None: - serializer.write_string( - _SCHEMA_DELETE_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT.members[ - "AssociationId" - ], - self.association_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rule_id"] = de.read_string( - _SCHEMA_DELETE_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT.members[ - "RuleId" - ] - ) - - case 1: - kwargs["association_id"] = de.read_string( - _SCHEMA_DELETE_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT.members[ - "AssociationId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteCustomDetectionRuleAssociationOutput: - """Dataclass for DeleteCustomDetectionRuleAssociationOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DELETE_CUSTOM_DETECTION_RULE_ASSOCIATION_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_CUSTOM_DETECTION_RULE_ASSOCIATION_OUTPUT, consumer=_consumer - ) - return kwargs - - -DELETE_CUSTOM_DETECTION_RULE_ASSOCIATION = APIOperation( - input=DeleteCustomDetectionRuleAssociationInput, - output=DeleteCustomDetectionRuleAssociationOutput, - schema=_SCHEMA_DELETE_CUSTOM_DETECTION_RULE_ASSOCIATION, - input_schema=_SCHEMA_DELETE_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT, - output_schema=_SCHEMA_DELETE_CUSTOM_DETECTION_RULE_ASSOCIATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.guardduty#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - ShapeID( - "com.amazonaws.guardduty#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteCustomDetectionRuleOrgConfigurationInput: - """Dataclass for DeleteCustomDetectionRuleOrgConfigurationInput structure.""" - - rule_id: str | None = None - """The unique identifier for the custom detection rule.""" - - mode: str | None = None - """ - The execution mode of the organization configuration to delete. Valid - values: `LIVE` | `DRY_RUN`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DELETE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rule_id is not None: - serializer.write_string( - _SCHEMA_DELETE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT.members[ - "RuleId" - ], - self.rule_id, - ) - - if self.mode is not None: - serializer.write_string( - _SCHEMA_DELETE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT.members[ - "Mode" - ], - self.mode, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rule_id"] = de.read_string( - _SCHEMA_DELETE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT.members[ - "RuleId" - ] - ) - - case 1: - kwargs["mode"] = AssociationMode( - de.read_string( - _SCHEMA_DELETE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT.members[ - "Mode" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT, - consumer=_consumer, - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteCustomDetectionRuleOrgConfigurationOutput: - """Dataclass for DeleteCustomDetectionRuleOrgConfigurationOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DELETE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_OUTPUT, - consumer=_consumer, - ) - return kwargs - - -DELETE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION = APIOperation( - input=DeleteCustomDetectionRuleOrgConfigurationInput, - output=DeleteCustomDetectionRuleOrgConfigurationOutput, - schema=_SCHEMA_DELETE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION, - input_schema=_SCHEMA_DELETE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT, - output_schema=_SCHEMA_DELETE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.guardduty#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID("com.amazonaws.guardduty#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - ShapeID( - "com.amazonaws.guardduty#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteDetectorInput: - """Dataclass for DeleteDetectorInput structure.""" - - detector_id: str | None = None - """ - The unique ID of the detector that you want to delete. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_DETECTOR_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_DELETE_DETECTOR_INPUT.members["DetectorId"], self.detector_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_DELETE_DETECTOR_INPUT.members["DetectorId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_DETECTOR_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteDetectorOutput: - """Dataclass for DeleteDetectorOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_DETECTOR_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_DETECTOR_OUTPUT, consumer=_consumer) - return kwargs - - -DELETE_DETECTOR = APIOperation( - input=DeleteDetectorInput, - output=DeleteDetectorOutput, - schema=_SCHEMA_DELETE_DETECTOR, - input_schema=_SCHEMA_DELETE_DETECTOR_INPUT, - output_schema=_SCHEMA_DELETE_DETECTOR_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteFilterInput: - """Dataclass for DeleteFilterInput structure.""" - - detector_id: str | None = None - """ - The unique ID of the detector that is associated with the filter. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - filter_name: str | None = None - """The name of the filter that you want to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_FILTER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_DELETE_FILTER_INPUT.members["DetectorId"], self.detector_id - ) - - if self.filter_name is not None: - serializer.write_string( - _SCHEMA_DELETE_FILTER_INPUT.members["FilterName"], self.filter_name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_DELETE_FILTER_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["filter_name"] = de.read_string( - _SCHEMA_DELETE_FILTER_INPUT.members["FilterName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_FILTER_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteFilterOutput: - """Dataclass for DeleteFilterOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_FILTER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_FILTER_OUTPUT, consumer=_consumer) - return kwargs - - -DELETE_FILTER = APIOperation( - input=DeleteFilterInput, - output=DeleteFilterOutput, - schema=_SCHEMA_DELETE_FILTER, - input_schema=_SCHEMA_DELETE_FILTER_INPUT, - output_schema=_SCHEMA_DELETE_FILTER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteInvitationsInput: - """Dataclass for DeleteInvitationsInput structure.""" - - account_ids: list[str] | None = None - """ - A list of account IDs of the Amazon Web Services accounts that sent - invitations to the current member account that you want to delete - invitations from. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_INVITATIONS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.account_ids is not None: - _serialize_account_ids( - serializer, - _SCHEMA_DELETE_INVITATIONS_INPUT.members["AccountIds"], - self.account_ids, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["account_ids"] = _deserialize_account_ids( - de, _SCHEMA_DELETE_INVITATIONS_INPUT.members["AccountIds"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_INVITATIONS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteInvitationsOutput: - """Dataclass for DeleteInvitationsOutput structure.""" - - unprocessed_accounts: list[UnprocessedAccount] | None = None - """ - A list of objects that contain the unprocessed account and a result - string that explains why it was unprocessed. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_INVITATIONS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.unprocessed_accounts is not None: - _serialize_unprocessed_accounts( - serializer, - _SCHEMA_DELETE_INVITATIONS_OUTPUT.members["UnprocessedAccounts"], - self.unprocessed_accounts, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["unprocessed_accounts"] = _deserialize_unprocessed_accounts( - de, - _SCHEMA_DELETE_INVITATIONS_OUTPUT.members[ - "UnprocessedAccounts" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_INVITATIONS_OUTPUT, consumer=_consumer) - return kwargs - - -DELETE_INVITATIONS = APIOperation( - input=DeleteInvitationsInput, - output=DeleteInvitationsOutput, - schema=_SCHEMA_DELETE_INVITATIONS, - input_schema=_SCHEMA_DELETE_INVITATIONS_INPUT, - output_schema=_SCHEMA_DELETE_INVITATIONS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteIPSetInput: - """Dataclass for DeleteIPSetInput structure.""" - - detector_id: str | None = None - """ - The unique ID of the detector associated with the IPSet. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - ip_set_id: str | None = None - """The unique ID of the IPSet to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_IP_SET_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_DELETE_IP_SET_INPUT.members["DetectorId"], self.detector_id - ) - - if self.ip_set_id is not None: - serializer.write_string( - _SCHEMA_DELETE_IP_SET_INPUT.members["IpSetId"], self.ip_set_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_DELETE_IP_SET_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["ip_set_id"] = de.read_string( - _SCHEMA_DELETE_IP_SET_INPUT.members["IpSetId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_IP_SET_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteIPSetOutput: - """Dataclass for DeleteIPSetOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_IP_SET_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_IP_SET_OUTPUT, consumer=_consumer) - return kwargs - - -DELETE_IP_SET = APIOperation( - input=DeleteIPSetInput, - output=DeleteIPSetOutput, - schema=_SCHEMA_DELETE_IP_SET, - input_schema=_SCHEMA_DELETE_IP_SET_INPUT, - output_schema=_SCHEMA_DELETE_IP_SET_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteMalwareProtectionPlanInput: - """Dataclass for DeleteMalwareProtectionPlanInput structure.""" - - malware_protection_plan_id: str | None = None - """A unique identifier associated with Malware Protection plan resource.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_MALWARE_PROTECTION_PLAN_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.malware_protection_plan_id is not None: - serializer.write_string( - _SCHEMA_DELETE_MALWARE_PROTECTION_PLAN_INPUT.members[ - "MalwareProtectionPlanId" - ], - self.malware_protection_plan_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["malware_protection_plan_id"] = de.read_string( - _SCHEMA_DELETE_MALWARE_PROTECTION_PLAN_INPUT.members[ - "MalwareProtectionPlanId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_MALWARE_PROTECTION_PLAN_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteMalwareProtectionPlanOutput: - """Dataclass for DeleteMalwareProtectionPlanOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_MALWARE_PROTECTION_PLAN_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_MALWARE_PROTECTION_PLAN_OUTPUT, consumer=_consumer - ) - return kwargs - - -DELETE_MALWARE_PROTECTION_PLAN = APIOperation( - input=DeleteMalwareProtectionPlanInput, - output=DeleteMalwareProtectionPlanOutput, - schema=_SCHEMA_DELETE_MALWARE_PROTECTION_PLAN, - input_schema=_SCHEMA_DELETE_MALWARE_PROTECTION_PLAN_INPUT, - output_schema=_SCHEMA_DELETE_MALWARE_PROTECTION_PLAN_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.guardduty#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - ShapeID( - "com.amazonaws.guardduty#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteMembersInput: - """Dataclass for DeleteMembersInput structure.""" - - detector_id: str | None = None - """ - The unique ID of the detector of the GuardDuty account whose members you - want to delete. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - account_ids: list[str] | None = None - """ - A list of account IDs of the GuardDuty member accounts that you want to - delete. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_MEMBERS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_DELETE_MEMBERS_INPUT.members["DetectorId"], self.detector_id - ) - - if self.account_ids is not None: - _serialize_account_ids( - serializer, - _SCHEMA_DELETE_MEMBERS_INPUT.members["AccountIds"], - self.account_ids, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_DELETE_MEMBERS_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["account_ids"] = _deserialize_account_ids( - de, _SCHEMA_DELETE_MEMBERS_INPUT.members["AccountIds"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_MEMBERS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteMembersOutput: - """Dataclass for DeleteMembersOutput structure.""" - - unprocessed_accounts: list[UnprocessedAccount] | None = None - """The accounts that could not be processed.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_MEMBERS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.unprocessed_accounts is not None: - _serialize_unprocessed_accounts( - serializer, - _SCHEMA_DELETE_MEMBERS_OUTPUT.members["UnprocessedAccounts"], - self.unprocessed_accounts, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["unprocessed_accounts"] = _deserialize_unprocessed_accounts( - de, _SCHEMA_DELETE_MEMBERS_OUTPUT.members["UnprocessedAccounts"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_MEMBERS_OUTPUT, consumer=_consumer) - return kwargs - - -DELETE_MEMBERS = APIOperation( - input=DeleteMembersInput, - output=DeleteMembersOutput, - schema=_SCHEMA_DELETE_MEMBERS, - input_schema=_SCHEMA_DELETE_MEMBERS_INPUT, - output_schema=_SCHEMA_DELETE_MEMBERS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeletePublishingDestinationInput: - """Dataclass for DeletePublishingDestinationInput structure.""" - - detector_id: str | None = None - """ - The unique ID of the detector associated with the publishing destination - to delete. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - destination_id: str | None = None - """The ID of the publishing destination to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_PUBLISHING_DESTINATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_DELETE_PUBLISHING_DESTINATION_INPUT.members["DetectorId"], - self.detector_id, - ) - - if self.destination_id is not None: - serializer.write_string( - _SCHEMA_DELETE_PUBLISHING_DESTINATION_INPUT.members["DestinationId"], - self.destination_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_DELETE_PUBLISHING_DESTINATION_INPUT.members[ - "DetectorId" - ] - ) - - case 1: - kwargs["destination_id"] = de.read_string( - _SCHEMA_DELETE_PUBLISHING_DESTINATION_INPUT.members[ - "DestinationId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_PUBLISHING_DESTINATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeletePublishingDestinationOutput: - """Dataclass for DeletePublishingDestinationOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_PUBLISHING_DESTINATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_PUBLISHING_DESTINATION_OUTPUT, consumer=_consumer - ) - return kwargs - - -DELETE_PUBLISHING_DESTINATION = APIOperation( - input=DeletePublishingDestinationInput, - output=DeletePublishingDestinationOutput, - schema=_SCHEMA_DELETE_PUBLISHING_DESTINATION, - input_schema=_SCHEMA_DELETE_PUBLISHING_DESTINATION_INPUT, - output_schema=_SCHEMA_DELETE_PUBLISHING_DESTINATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteThreatEntitySetInput: - """Dataclass for DeleteThreatEntitySetInput structure.""" - - detector_id: str | None = None - """ - The unique ID of the detector associated with the threat entity set - resource. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - threat_entity_set_id: str | None = None - """ - The unique ID that helps GuardDuty identify which threat entity set - needs to be deleted. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_THREAT_ENTITY_SET_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_DELETE_THREAT_ENTITY_SET_INPUT.members["DetectorId"], - self.detector_id, - ) - - if self.threat_entity_set_id is not None: - serializer.write_string( - _SCHEMA_DELETE_THREAT_ENTITY_SET_INPUT.members["ThreatEntitySetId"], - self.threat_entity_set_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_DELETE_THREAT_ENTITY_SET_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["threat_entity_set_id"] = de.read_string( - _SCHEMA_DELETE_THREAT_ENTITY_SET_INPUT.members[ - "ThreatEntitySetId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_THREAT_ENTITY_SET_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteThreatEntitySetOutput: - """Dataclass for DeleteThreatEntitySetOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_THREAT_ENTITY_SET_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_THREAT_ENTITY_SET_OUTPUT, consumer=_consumer - ) - return kwargs - - -DELETE_THREAT_ENTITY_SET = APIOperation( - input=DeleteThreatEntitySetInput, - output=DeleteThreatEntitySetOutput, - schema=_SCHEMA_DELETE_THREAT_ENTITY_SET, - input_schema=_SCHEMA_DELETE_THREAT_ENTITY_SET_INPUT, - output_schema=_SCHEMA_DELETE_THREAT_ENTITY_SET_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteThreatIntelSetInput: - """Dataclass for DeleteThreatIntelSetInput structure.""" - - detector_id: str | None = None - """ - The unique ID of the detector that is associated with the - threatIntelSet. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - threat_intel_set_id: str | None = None - """The unique ID of the threatIntelSet that you want to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_THREAT_INTEL_SET_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_DELETE_THREAT_INTEL_SET_INPUT.members["DetectorId"], - self.detector_id, - ) - - if self.threat_intel_set_id is not None: - serializer.write_string( - _SCHEMA_DELETE_THREAT_INTEL_SET_INPUT.members["ThreatIntelSetId"], - self.threat_intel_set_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_DELETE_THREAT_INTEL_SET_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["threat_intel_set_id"] = de.read_string( - _SCHEMA_DELETE_THREAT_INTEL_SET_INPUT.members[ - "ThreatIntelSetId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_THREAT_INTEL_SET_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteThreatIntelSetOutput: - """Dataclass for DeleteThreatIntelSetOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_THREAT_INTEL_SET_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_THREAT_INTEL_SET_OUTPUT, consumer=_consumer - ) - return kwargs - - -DELETE_THREAT_INTEL_SET = APIOperation( - input=DeleteThreatIntelSetInput, - output=DeleteThreatIntelSetOutput, - schema=_SCHEMA_DELETE_THREAT_INTEL_SET, - input_schema=_SCHEMA_DELETE_THREAT_INTEL_SET_INPUT, - output_schema=_SCHEMA_DELETE_THREAT_INTEL_SET_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteTrustedEntitySetInput: - """Dataclass for DeleteTrustedEntitySetInput structure.""" - - detector_id: str | None = None - """ - The unique ID of the detector associated with the trusted entity set - resource. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - trusted_entity_set_id: str | None = None - """ - The unique ID that helps GuardDuty identify which trusted entity set - needs to be deleted. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_TRUSTED_ENTITY_SET_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_DELETE_TRUSTED_ENTITY_SET_INPUT.members["DetectorId"], - self.detector_id, - ) - - if self.trusted_entity_set_id is not None: - serializer.write_string( - _SCHEMA_DELETE_TRUSTED_ENTITY_SET_INPUT.members["TrustedEntitySetId"], - self.trusted_entity_set_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_DELETE_TRUSTED_ENTITY_SET_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["trusted_entity_set_id"] = de.read_string( - _SCHEMA_DELETE_TRUSTED_ENTITY_SET_INPUT.members[ - "TrustedEntitySetId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_TRUSTED_ENTITY_SET_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteTrustedEntitySetOutput: - """Dataclass for DeleteTrustedEntitySetOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_TRUSTED_ENTITY_SET_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_TRUSTED_ENTITY_SET_OUTPUT, consumer=_consumer - ) - return kwargs - - -DELETE_TRUSTED_ENTITY_SET = APIOperation( - input=DeleteTrustedEntitySetInput, - output=DeleteTrustedEntitySetOutput, - schema=_SCHEMA_DELETE_TRUSTED_ENTITY_SET, - input_schema=_SCHEMA_DELETE_TRUSTED_ENTITY_SET_INPUT, - output_schema=_SCHEMA_DELETE_TRUSTED_ENTITY_SET_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class FilterCondition: - """Contains information about the condition.""" - - equals_value: str | None = None - """ - Represents an *equal* condition to be applied to a single field when - querying for scan entries. - """ - - greater_than: int | None = None - """ - Represents a *greater than* condition to be applied to a single field - when querying for scan entries. - """ - - less_than: int | None = None - """ - Represents a *less than* condition to be applied to a single field when - querying for scan entries. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FILTER_CONDITION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.equals_value is not None: - serializer.write_string( - _SCHEMA_FILTER_CONDITION.members["EqualsValue"], self.equals_value - ) - - if self.greater_than is not None: - serializer.write_long( - _SCHEMA_FILTER_CONDITION.members["GreaterThan"], self.greater_than - ) - - if self.less_than is not None: - serializer.write_long( - _SCHEMA_FILTER_CONDITION.members["LessThan"], self.less_than - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["equals_value"] = de.read_string( - _SCHEMA_FILTER_CONDITION.members["EqualsValue"] - ) - - case 1: - kwargs["greater_than"] = de.read_long( - _SCHEMA_FILTER_CONDITION.members["GreaterThan"] - ) - - case 2: - kwargs["less_than"] = de.read_long( - _SCHEMA_FILTER_CONDITION.members["LessThan"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FILTER_CONDITION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class FilterCriterion: - """ - Represents a condition that when matched will be added to the response - of the operation. Irrespective of using any filter criteria, an - administrator account can view the scan entries for all of its member - accounts. However, each member account can view the scan entries only - for their own account. - """ - - criterion_key: str | None = None - """ - An enum value representing possible scan properties to match with given - scan entries. - """ - - filter_condition: FilterCondition | None = None - """Contains information about the condition.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FILTER_CRITERION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.criterion_key is not None: - serializer.write_string( - _SCHEMA_FILTER_CRITERION.members["CriterionKey"], self.criterion_key - ) - - if self.filter_condition is not None: - serializer.write_struct( - _SCHEMA_FILTER_CRITERION.members["FilterCondition"], - self.filter_condition, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["criterion_key"] = CriterionKey( - de.read_string(_SCHEMA_FILTER_CRITERION.members["CriterionKey"]) - ) - - case 1: - kwargs["filter_condition"] = FilterCondition.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FILTER_CRITERION, consumer=_consumer) - return kwargs - - -def _serialize_filter_criterion_list( - serializer: ShapeSerializer, schema: Schema, value: list[FilterCriterion] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_filter_criterion_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[FilterCriterion]: - result: list[FilterCriterion] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(FilterCriterion.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class FilterCriteria: - """ - Represents the criteria to be used in the filter for describing scan - entries. - """ - - filter_criterion: list[FilterCriterion] | None = None - """ - Represents a condition that when matched will be added to the response - of the operation. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FILTER_CRITERIA, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.filter_criterion is not None: - _serialize_filter_criterion_list( - serializer, - _SCHEMA_FILTER_CRITERIA.members["FilterCriterion"], - self.filter_criterion, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["filter_criterion"] = _deserialize_filter_criterion_list( - de, _SCHEMA_FILTER_CRITERIA.members["FilterCriterion"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FILTER_CRITERIA, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class SortCriteria: - """Contains information about the criteria used for sorting findings.""" - - attribute_name: str | None = None - """ - Represents the finding attribute, such as `accountId`, that sorts the - findings. - """ - - order_by: str | None = None - """The order by which the sorted findings are to be displayed.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SORT_CRITERIA, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.attribute_name is not None: - serializer.write_string( - _SCHEMA_SORT_CRITERIA.members["AttributeName"], self.attribute_name - ) - - if self.order_by is not None: - serializer.write_string( - _SCHEMA_SORT_CRITERIA.members["OrderBy"], self.order_by - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["attribute_name"] = de.read_string( - _SCHEMA_SORT_CRITERIA.members["AttributeName"] - ) - - case 1: - kwargs["order_by"] = OrderBy( - de.read_string(_SCHEMA_SORT_CRITERIA.members["OrderBy"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SORT_CRITERIA, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DescribeMalwareScansInput: - """Dataclass for DescribeMalwareScansInput structure.""" - - detector_id: str | None = None - """ - The unique ID of the detector that the request is associated with. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - next_token: str | None = None - """ - You can use this parameter when paginating results. Set the value of - this parameter to null on your first call to the list action. For - subsequent calls to the action, fill nextToken in the request with the - value of NextToken from the previous response to continue listing data. - """ - - max_results: int | None = None - """ - You can use this parameter to indicate the maximum number of items that - you want in the response. The default value is 50. The maximum value is - 50. - """ - - filter_criteria: FilterCriteria | None = None - """ - Represents the criteria to be used in the filter for describing scan - entries. - """ - - sort_criteria: SortCriteria | None = None - """ - Represents the criteria used for sorting scan entries. The - [`attributeName`](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_SortCriteria.html#guardduty-Type-SortCriteria-attributeName) - is required and it must be `scanStartTime`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DESCRIBE_MALWARE_SCANS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_MALWARE_SCANS_INPUT.members["DetectorId"], - self.detector_id, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_MALWARE_SCANS_INPUT.members["NextToken"], - self.next_token, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_DESCRIBE_MALWARE_SCANS_INPUT.members["MaxResults"], - self.max_results, - ) - - if self.filter_criteria is not None: - serializer.write_struct( - _SCHEMA_DESCRIBE_MALWARE_SCANS_INPUT.members["FilterCriteria"], - self.filter_criteria, - ) - - if self.sort_criteria is not None: - serializer.write_struct( - _SCHEMA_DESCRIBE_MALWARE_SCANS_INPUT.members["SortCriteria"], - self.sort_criteria, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_DESCRIBE_MALWARE_SCANS_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_DESCRIBE_MALWARE_SCANS_INPUT.members["NextToken"] - ) - - case 2: - kwargs["max_results"] = de.read_integer( - _SCHEMA_DESCRIBE_MALWARE_SCANS_INPUT.members["MaxResults"] - ) - - case 3: - kwargs["filter_criteria"] = FilterCriteria.deserialize(de) - - case 4: - kwargs["sort_criteria"] = SortCriteria.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DESCRIBE_MALWARE_SCANS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class VolumeDetail: - """Contains EBS volume details.""" - - volume_arn: str | None = None - """EBS volume ARN information.""" - - volume_type: str | None = None - """The EBS volume type.""" - - device_name: str | None = None - """The device name for the EBS volume.""" - - volume_size_in_gb: int | None = None - """EBS volume size in GB.""" - - encryption_type: str | None = None - """EBS volume encryption type.""" - - snapshot_arn: str | None = None - """Snapshot ARN of the EBS volume.""" - - kms_key_arn: str | None = None - """KMS key ARN used to encrypt the EBS volume.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VOLUME_DETAIL, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.volume_arn is not None: - serializer.write_string( - _SCHEMA_VOLUME_DETAIL.members["VolumeArn"], self.volume_arn - ) - - if self.volume_type is not None: - serializer.write_string( - _SCHEMA_VOLUME_DETAIL.members["VolumeType"], self.volume_type - ) - - if self.device_name is not None: - serializer.write_string( - _SCHEMA_VOLUME_DETAIL.members["DeviceName"], self.device_name - ) - - if self.volume_size_in_gb is not None: - serializer.write_integer( - _SCHEMA_VOLUME_DETAIL.members["VolumeSizeInGB"], self.volume_size_in_gb - ) - - if self.encryption_type is not None: - serializer.write_string( - _SCHEMA_VOLUME_DETAIL.members["EncryptionType"], self.encryption_type - ) - - if self.snapshot_arn is not None: - serializer.write_string( - _SCHEMA_VOLUME_DETAIL.members["SnapshotArn"], self.snapshot_arn - ) - - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_VOLUME_DETAIL.members["KmsKeyArn"], self.kms_key_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["volume_arn"] = de.read_string( - _SCHEMA_VOLUME_DETAIL.members["VolumeArn"] - ) - - case 1: - kwargs["volume_type"] = de.read_string( - _SCHEMA_VOLUME_DETAIL.members["VolumeType"] - ) - - case 2: - kwargs["device_name"] = de.read_string( - _SCHEMA_VOLUME_DETAIL.members["DeviceName"] - ) - - case 3: - kwargs["volume_size_in_gb"] = de.read_integer( - _SCHEMA_VOLUME_DETAIL.members["VolumeSizeInGB"] - ) - - case 4: - kwargs["encryption_type"] = de.read_string( - _SCHEMA_VOLUME_DETAIL.members["EncryptionType"] - ) - - case 5: - kwargs["snapshot_arn"] = de.read_string( - _SCHEMA_VOLUME_DETAIL.members["SnapshotArn"] - ) - - case 6: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_VOLUME_DETAIL.members["KmsKeyArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VOLUME_DETAIL, consumer=_consumer) - return kwargs - - -def _serialize_volume_details( - serializer: ShapeSerializer, schema: Schema, value: list[VolumeDetail] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_volume_details( - deserializer: ShapeDeserializer, schema: Schema -) -> list[VolumeDetail]: - result: list[VolumeDetail] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(VolumeDetail.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ResourceDetails: - """Represents the resources that were scanned in the scan entry.""" - - instance_arn: str | None = None - """Instance ARN that was scanned in the scan entry.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESOURCE_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.instance_arn is not None: - serializer.write_string( - _SCHEMA_RESOURCE_DETAILS.members["InstanceArn"], self.instance_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["instance_arn"] = de.read_string( - _SCHEMA_RESOURCE_DETAILS.members["InstanceArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RESOURCE_DETAILS, consumer=_consumer) - return kwargs - - -class ScanResult(UnknownEnumMixin, StrEnum): - CLEAN = "CLEAN" - INFECTED = "INFECTED" - - -@dataclass(kw_only=True) -class ScanResultDetails: - """Represents the result of the scan.""" - - scan_result: str | None = None - """An enum value representing possible scan results.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SCAN_RESULT_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.scan_result is not None: - serializer.write_string( - _SCHEMA_SCAN_RESULT_DETAILS.members["ScanResult"], self.scan_result - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["scan_result"] = ScanResult( - de.read_string( - _SCHEMA_SCAN_RESULT_DETAILS.members["ScanResult"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SCAN_RESULT_DETAILS, consumer=_consumer) - return kwargs - - -class ScanStatus(UnknownEnumMixin, StrEnum): - RUNNING = "RUNNING" - COMPLETED = "COMPLETED" - FAILED = "FAILED" - SKIPPED = "SKIPPED" - - -class ScanType(UnknownEnumMixin, StrEnum): - GUARDDUTY_INITIATED = "GUARDDUTY_INITIATED" - ON_DEMAND = "ON_DEMAND" - - -class TriggerType(UnknownEnumMixin, StrEnum): - BACKUP = "BACKUP" - GUARDDUTY = "GUARDDUTY" - - -@dataclass(kw_only=True) -class TriggerDetails: - """Represents the reason the scan was triggered.""" - - guard_duty_finding_id: str | None = None - """The ID of the GuardDuty finding that triggered the malware scan.""" - - description: str | None = None - """The description of the scan trigger.""" - - trigger_type: str | None = None - """Specifies the trigger type that started the malware scan.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRIGGER_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.guard_duty_finding_id is not None: - serializer.write_string( - _SCHEMA_TRIGGER_DETAILS.members["GuardDutyFindingId"], - self.guard_duty_finding_id, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_TRIGGER_DETAILS.members["Description"], self.description - ) - - if self.trigger_type is not None: - serializer.write_string( - _SCHEMA_TRIGGER_DETAILS.members["TriggerType"], self.trigger_type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["guard_duty_finding_id"] = de.read_string( - _SCHEMA_TRIGGER_DETAILS.members["GuardDutyFindingId"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_TRIGGER_DETAILS.members["Description"] - ) - - case 2: - kwargs["trigger_type"] = TriggerType( - de.read_string(_SCHEMA_TRIGGER_DETAILS.members["TriggerType"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TRIGGER_DETAILS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Scan: - """ - Contains information about malware scans associated with GuardDuty - Malware Protection for EC2. - """ - - detector_id: str | None = None - """ - The unique ID of the detector that is associated with the request. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - admin_detector_id: str | None = None - """ - The unique detector ID of the administrator account that the request is - associated with. If the account is an administrator, the - `AdminDetectorId` will be the same as the one used for `DetectorId`. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - scan_id: str | None = None - """The unique scan ID associated with a scan entry.""" - - scan_status: str | None = None - """An enum value representing possible scan statuses.""" - - failure_reason: str | None = None - """Represents the reason for `FAILED` scan status.""" - - scan_start_time: datetime | None = None - """The timestamp of when the scan was triggered.""" - - scan_end_time: datetime | None = None - """The timestamp of when the scan was finished.""" - - trigger_details: TriggerDetails | None = None - """Specifies the reason why the scan was initiated.""" - - resource_details: ResourceDetails | None = None - """Represents the resources that were scanned in the scan entry.""" - - scan_result_details: ScanResultDetails | None = None - """Represents the result of the scan.""" - - account_id: str | None = None - """The ID for the account that belongs to the scan.""" - - total_bytes: int | None = None - """Represents total bytes that were scanned.""" - - file_count: int | None = None - """Represents the number of files that were scanned.""" - - attached_volumes: list[VolumeDetail] | None = None - """ - List of volumes that were attached to the original instance to be - scanned. - """ - - scan_type: str | None = None - """Specifies the scan type that invoked the malware scan.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SCAN, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_SCAN.members["DetectorId"], self.detector_id - ) - - if self.admin_detector_id is not None: - serializer.write_string( - _SCHEMA_SCAN.members["AdminDetectorId"], self.admin_detector_id - ) - - if self.scan_id is not None: - serializer.write_string(_SCHEMA_SCAN.members["ScanId"], self.scan_id) - - if self.scan_status is not None: - serializer.write_string( - _SCHEMA_SCAN.members["ScanStatus"], self.scan_status - ) - - if self.failure_reason is not None: - serializer.write_string( - _SCHEMA_SCAN.members["FailureReason"], self.failure_reason - ) - - if self.scan_start_time is not None: - serializer.write_timestamp( - _SCHEMA_SCAN.members["ScanStartTime"], self.scan_start_time - ) - - if self.scan_end_time is not None: - serializer.write_timestamp( - _SCHEMA_SCAN.members["ScanEndTime"], self.scan_end_time - ) - - if self.trigger_details is not None: - serializer.write_struct( - _SCHEMA_SCAN.members["TriggerDetails"], self.trigger_details - ) - - if self.resource_details is not None: - serializer.write_struct( - _SCHEMA_SCAN.members["ResourceDetails"], self.resource_details - ) - - if self.scan_result_details is not None: - serializer.write_struct( - _SCHEMA_SCAN.members["ScanResultDetails"], self.scan_result_details - ) - - if self.account_id is not None: - serializer.write_string(_SCHEMA_SCAN.members["AccountId"], self.account_id) - - if self.total_bytes is not None: - serializer.write_long(_SCHEMA_SCAN.members["TotalBytes"], self.total_bytes) - - if self.file_count is not None: - serializer.write_long(_SCHEMA_SCAN.members["FileCount"], self.file_count) - - if self.attached_volumes is not None: - _serialize_volume_details( - serializer, - _SCHEMA_SCAN.members["AttachedVolumes"], - self.attached_volumes, - ) - - if self.scan_type is not None: - serializer.write_string(_SCHEMA_SCAN.members["ScanType"], self.scan_type) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_SCAN.members["DetectorId"] - ) - - case 1: - kwargs["admin_detector_id"] = de.read_string( - _SCHEMA_SCAN.members["AdminDetectorId"] - ) - - case 2: - kwargs["scan_id"] = de.read_string(_SCHEMA_SCAN.members["ScanId"]) - - case 3: - kwargs["scan_status"] = ScanStatus( - de.read_string(_SCHEMA_SCAN.members["ScanStatus"]) - ) - - case 4: - kwargs["failure_reason"] = de.read_string( - _SCHEMA_SCAN.members["FailureReason"] - ) - - case 5: - kwargs["scan_start_time"] = de.read_timestamp( - _SCHEMA_SCAN.members["ScanStartTime"] - ) - - case 6: - kwargs["scan_end_time"] = de.read_timestamp( - _SCHEMA_SCAN.members["ScanEndTime"] - ) - - case 7: - kwargs["trigger_details"] = TriggerDetails.deserialize(de) - - case 8: - kwargs["resource_details"] = ResourceDetails.deserialize(de) - - case 9: - kwargs["scan_result_details"] = ScanResultDetails.deserialize(de) - - case 10: - kwargs["account_id"] = de.read_string( - _SCHEMA_SCAN.members["AccountId"] - ) - - case 11: - kwargs["total_bytes"] = de.read_long( - _SCHEMA_SCAN.members["TotalBytes"] - ) - - case 12: - kwargs["file_count"] = de.read_long( - _SCHEMA_SCAN.members["FileCount"] - ) - - case 13: - kwargs["attached_volumes"] = _deserialize_volume_details( - de, _SCHEMA_SCAN.members["AttachedVolumes"] - ) - - case 14: - kwargs["scan_type"] = ScanType( - de.read_string(_SCHEMA_SCAN.members["ScanType"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SCAN, consumer=_consumer) - return kwargs - - -def _serialize_scans( - serializer: ShapeSerializer, schema: Schema, value: list[Scan] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_scans(deserializer: ShapeDeserializer, schema: Schema) -> list[Scan]: - result: list[Scan] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Scan.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class DescribeMalwareScansOutput: - """Dataclass for DescribeMalwareScansOutput structure.""" - - scans: list[Scan] | None = None - """ - Contains information about malware scans associated with GuardDuty - Malware Protection for EC2. - """ - - next_token: str | None = None - """ - The pagination parameter to be used on the next list operation to - retrieve more items. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DESCRIBE_MALWARE_SCANS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.scans is not None: - _serialize_scans( - serializer, - _SCHEMA_DESCRIBE_MALWARE_SCANS_OUTPUT.members["Scans"], - self.scans, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_MALWARE_SCANS_OUTPUT.members["NextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["scans"] = _deserialize_scans( - de, _SCHEMA_DESCRIBE_MALWARE_SCANS_OUTPUT.members["Scans"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_DESCRIBE_MALWARE_SCANS_OUTPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DESCRIBE_MALWARE_SCANS_OUTPUT, consumer=_consumer - ) - return kwargs - - -DESCRIBE_MALWARE_SCANS = APIOperation( - input=DescribeMalwareScansInput, - output=DescribeMalwareScansOutput, - schema=_SCHEMA_DESCRIBE_MALWARE_SCANS, - input_schema=_SCHEMA_DESCRIBE_MALWARE_SCANS_INPUT, - output_schema=_SCHEMA_DESCRIBE_MALWARE_SCANS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DescribeOrganizationConfigurationInput: - """Dataclass for DescribeOrganizationConfigurationInput structure.""" - - detector_id: str | None = None - """ - The detector ID of the delegated administrator for which you need to - retrieve the information. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - max_results: int | None = None - """ - You can use this parameter to indicate the maximum number of items that - you want in the response. - """ - - next_token: str | None = None - """ - You can use this parameter when paginating results. Set the value of - this parameter to null on your first call to the list action. For - subsequent calls to the action, fill `nextToken` in the request with the - value of `NextToken` from the previous response to continue listing - data. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DESCRIBE_ORGANIZATION_CONFIGURATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_ORGANIZATION_CONFIGURATION_INPUT.members["DetectorId"], - self.detector_id, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_DESCRIBE_ORGANIZATION_CONFIGURATION_INPUT.members["MaxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_ORGANIZATION_CONFIGURATION_INPUT.members["NextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_DESCRIBE_ORGANIZATION_CONFIGURATION_INPUT.members[ - "DetectorId" - ] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_DESCRIBE_ORGANIZATION_CONFIGURATION_INPUT.members[ - "MaxResults" - ] - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_DESCRIBE_ORGANIZATION_CONFIGURATION_INPUT.members[ - "NextToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DESCRIBE_ORGANIZATION_CONFIGURATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class OrganizationKubernetesAuditLogsConfigurationResult: - """ - The current configuration of Kubernetes audit logs as a data source for - the organization. - """ - - auto_enable: bool | None = None - """ - Whether Kubernetes audit logs data source should be auto-enabled for new - members joining the organization. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_ORGANIZATION_KUBERNETES_AUDIT_LOGS_CONFIGURATION_RESULT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.auto_enable is not None: - serializer.write_boolean( - _SCHEMA_ORGANIZATION_KUBERNETES_AUDIT_LOGS_CONFIGURATION_RESULT.members[ - "AutoEnable" - ], - self.auto_enable, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["auto_enable"] = de.read_boolean( - _SCHEMA_ORGANIZATION_KUBERNETES_AUDIT_LOGS_CONFIGURATION_RESULT.members[ - "AutoEnable" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ORGANIZATION_KUBERNETES_AUDIT_LOGS_CONFIGURATION_RESULT, - consumer=_consumer, - ) - return kwargs - - -@dataclass(kw_only=True) -class OrganizationKubernetesConfigurationResult: - """ - The current configuration of all Kubernetes data sources for the - organization. - """ - - audit_logs: OrganizationKubernetesAuditLogsConfigurationResult | None = None - """ - The current configuration of Kubernetes audit logs as a data source for - the organization. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_ORGANIZATION_KUBERNETES_CONFIGURATION_RESULT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.audit_logs is not None: - serializer.write_struct( - _SCHEMA_ORGANIZATION_KUBERNETES_CONFIGURATION_RESULT.members[ - "AuditLogs" - ], - self.audit_logs, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["audit_logs"] = ( - OrganizationKubernetesAuditLogsConfigurationResult.deserialize( - de - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ORGANIZATION_KUBERNETES_CONFIGURATION_RESULT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class OrganizationEbsVolumesResult: - """ - An object that contains information on the status of whether EBS volumes - scanning will be enabled as a data source for an organization. - """ - - auto_enable: bool | None = None - """ - An object that contains the status of whether scanning EBS volumes - should be auto-enabled for new members joining the organization. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ORGANIZATION_EBS_VOLUMES_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.auto_enable is not None: - serializer.write_boolean( - _SCHEMA_ORGANIZATION_EBS_VOLUMES_RESULT.members["AutoEnable"], - self.auto_enable, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["auto_enable"] = de.read_boolean( - _SCHEMA_ORGANIZATION_EBS_VOLUMES_RESULT.members["AutoEnable"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ORGANIZATION_EBS_VOLUMES_RESULT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class OrganizationScanEc2InstanceWithFindingsResult: - """ - An object that contains information on the status of scanning EC2 - instances with findings for an organization. - """ - - ebs_volumes: OrganizationEbsVolumesResult | None = None - """ - Describes the configuration for scanning EBS volumes for an - organization. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_ORGANIZATION_SCAN_EC2_INSTANCE_WITH_FINDINGS_RESULT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.ebs_volumes is not None: - serializer.write_struct( - _SCHEMA_ORGANIZATION_SCAN_EC2_INSTANCE_WITH_FINDINGS_RESULT.members[ - "EbsVolumes" - ], - self.ebs_volumes, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["ebs_volumes"] = OrganizationEbsVolumesResult.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ORGANIZATION_SCAN_EC2_INSTANCE_WITH_FINDINGS_RESULT, - consumer=_consumer, - ) - return kwargs - - -@dataclass(kw_only=True) -class OrganizationMalwareProtectionConfigurationResult: - """ - An object that contains information on the status of all Malware - Protection data source for an organization. - """ - - scan_ec2_instance_with_findings: ( - OrganizationScanEc2InstanceWithFindingsResult | None - ) = None - """ - Describes the configuration for scanning EC2 instances with findings for - an organization. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_ORGANIZATION_MALWARE_PROTECTION_CONFIGURATION_RESULT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.scan_ec2_instance_with_findings is not None: - serializer.write_struct( - _SCHEMA_ORGANIZATION_MALWARE_PROTECTION_CONFIGURATION_RESULT.members[ - "ScanEc2InstanceWithFindings" - ], - self.scan_ec2_instance_with_findings, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["scan_ec2_instance_with_findings"] = ( - OrganizationScanEc2InstanceWithFindingsResult.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ORGANIZATION_MALWARE_PROTECTION_CONFIGURATION_RESULT, - consumer=_consumer, - ) - return kwargs - - -@dataclass(kw_only=True) -class OrganizationS3LogsConfigurationResult: - """ - The current configuration of S3 data event logs as a data source for the - organization. - """ - - auto_enable: bool | None = None - """ - A value that describes whether S3 data event logs are automatically - enabled for new members of the organization. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ORGANIZATION_S3_LOGS_CONFIGURATION_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.auto_enable is not None: - serializer.write_boolean( - _SCHEMA_ORGANIZATION_S3_LOGS_CONFIGURATION_RESULT.members["AutoEnable"], - self.auto_enable, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["auto_enable"] = de.read_boolean( - _SCHEMA_ORGANIZATION_S3_LOGS_CONFIGURATION_RESULT.members[ - "AutoEnable" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ORGANIZATION_S3_LOGS_CONFIGURATION_RESULT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class OrganizationDataSourceConfigurationsResult: - """ - An object that contains information on which data sources are - automatically enabled for new members within the organization. - """ - - s3_logs: OrganizationS3LogsConfigurationResult | None = None - """Describes whether S3 data event logs are enabled as a data source.""" - - kubernetes: OrganizationKubernetesConfigurationResult | None = None - """Describes the configuration of Kubernetes data sources.""" - - malware_protection: OrganizationMalwareProtectionConfigurationResult | None = None - """ - Describes the configuration of Malware Protection data source for an - organization. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_ORGANIZATION_DATA_SOURCE_CONFIGURATIONS_RESULT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.s3_logs is not None: - serializer.write_struct( - _SCHEMA_ORGANIZATION_DATA_SOURCE_CONFIGURATIONS_RESULT.members[ - "S3Logs" - ], - self.s3_logs, - ) - - if self.kubernetes is not None: - serializer.write_struct( - _SCHEMA_ORGANIZATION_DATA_SOURCE_CONFIGURATIONS_RESULT.members[ - "Kubernetes" - ], - self.kubernetes, - ) - - if self.malware_protection is not None: - serializer.write_struct( - _SCHEMA_ORGANIZATION_DATA_SOURCE_CONFIGURATIONS_RESULT.members[ - "MalwareProtection" - ], - self.malware_protection, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["s3_logs"] = ( - OrganizationS3LogsConfigurationResult.deserialize(de) - ) - - case 1: - kwargs["kubernetes"] = ( - OrganizationKubernetesConfigurationResult.deserialize(de) - ) - - case 2: - kwargs["malware_protection"] = ( - OrganizationMalwareProtectionConfigurationResult.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ORGANIZATION_DATA_SOURCE_CONFIGURATIONS_RESULT, consumer=_consumer - ) - return kwargs - - -class OrgFeatureStatus(UnknownEnumMixin, StrEnum): - NEW = "NEW" - NONE = "NONE" - ALL = "ALL" - - -class OrgFeatureAdditionalConfiguration(UnknownEnumMixin, StrEnum): - EKS_ADDON_MANAGEMENT = "EKS_ADDON_MANAGEMENT" - ECS_FARGATE_AGENT_MANAGEMENT = "ECS_FARGATE_AGENT_MANAGEMENT" - EC2_AGENT_MANAGEMENT = "EC2_AGENT_MANAGEMENT" - - -@dataclass(kw_only=True) -class OrganizationAdditionalConfigurationResult: - """ - A list of additional configuration which will be configured for the - organization. - """ - - name: str | None = None - """ - The name of the additional configuration that is configured for the - member accounts within the organization. These values are applicable to - only Runtime Monitoring protection plan. - """ - - auto_enable: str | None = None - """ - Describes the status of the additional configuration that is configured - for the member accounts within the organization. One of the following - values is the status for the entire organization: - - - `NEW`: Indicates that when a new account joins the organization, they - will have the additional configuration enabled automatically. - - - `ALL`: Indicates that all accounts in the organization have the - additional configuration enabled automatically. This includes `NEW` - accounts that join the organization and accounts that may have been - suspended or removed from the organization in GuardDuty. - - It may take up to 24 hours to update the configuration for all the - member accounts. - - - `NONE`: Indicates that the additional configuration will not be - automatically enabled for any account in the organization. The - administrator must manage the additional configuration for each - account individually. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_ORGANIZATION_ADDITIONAL_CONFIGURATION_RESULT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_ORGANIZATION_ADDITIONAL_CONFIGURATION_RESULT.members["Name"], - self.name, - ) - - if self.auto_enable is not None: - serializer.write_string( - _SCHEMA_ORGANIZATION_ADDITIONAL_CONFIGURATION_RESULT.members[ - "AutoEnable" - ], - self.auto_enable, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = OrgFeatureAdditionalConfiguration( - de.read_string( - _SCHEMA_ORGANIZATION_ADDITIONAL_CONFIGURATION_RESULT.members[ - "Name" - ] - ) - ) - - case 1: - kwargs["auto_enable"] = OrgFeatureStatus( - de.read_string( - _SCHEMA_ORGANIZATION_ADDITIONAL_CONFIGURATION_RESULT.members[ - "AutoEnable" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ORGANIZATION_ADDITIONAL_CONFIGURATION_RESULT, consumer=_consumer - ) - return kwargs - - -def _serialize_organization_additional_configuration_results( - serializer: ShapeSerializer, - schema: Schema, - value: list[OrganizationAdditionalConfigurationResult], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_organization_additional_configuration_results( - deserializer: ShapeDeserializer, schema: Schema -) -> list[OrganizationAdditionalConfigurationResult]: - result: list[OrganizationAdditionalConfigurationResult] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(OrganizationAdditionalConfigurationResult.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class OrgFeature(UnknownEnumMixin, StrEnum): - S3_DATA_EVENTS = "S3_DATA_EVENTS" - EKS_AUDIT_LOGS = "EKS_AUDIT_LOGS" - EBS_MALWARE_PROTECTION = "EBS_MALWARE_PROTECTION" - RDS_LOGIN_EVENTS = "RDS_LOGIN_EVENTS" - LAMBDA_NETWORK_LOGS = "LAMBDA_NETWORK_LOGS" - EKS_RUNTIME_MONITORING = "EKS_RUNTIME_MONITORING" - RUNTIME_MONITORING = "RUNTIME_MONITORING" - AI_PROTECTION = "AI_PROTECTION" - - -@dataclass(kw_only=True) -class OrganizationFeatureConfigurationResult: - """A list of features which will be configured for the organization.""" - - name: str | None = None - """ - The name of the feature that is configured for the member accounts - within the organization. - """ - - auto_enable: str | None = None - """ - Describes the status of the feature that is configured for the member - accounts within the organization. - - - `NEW`: Indicates that when a new account joins the organization, they - will have the feature enabled automatically. - - - `ALL`: Indicates that all accounts in the organization have the - feature enabled automatically. This includes `NEW` accounts that join - the organization and accounts that may have been suspended or removed - from the organization in GuardDuty. - - - `NONE`: Indicates that the feature will not be automatically enabled - for any account in the organization. In this case, each account will - be managed individually by the administrator. - """ - - additional_configuration: list[OrganizationAdditionalConfigurationResult] | None = ( - None - ) - """ - The additional configuration that is configured for the member accounts - within the organization. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ORGANIZATION_FEATURE_CONFIGURATION_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_ORGANIZATION_FEATURE_CONFIGURATION_RESULT.members["Name"], - self.name, - ) - - if self.auto_enable is not None: - serializer.write_string( - _SCHEMA_ORGANIZATION_FEATURE_CONFIGURATION_RESULT.members["AutoEnable"], - self.auto_enable, - ) - - if self.additional_configuration is not None: - _serialize_organization_additional_configuration_results( - serializer, - _SCHEMA_ORGANIZATION_FEATURE_CONFIGURATION_RESULT.members[ - "AdditionalConfiguration" - ], - self.additional_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = OrgFeature( - de.read_string( - _SCHEMA_ORGANIZATION_FEATURE_CONFIGURATION_RESULT.members[ - "Name" - ] - ) - ) - - case 1: - kwargs["auto_enable"] = OrgFeatureStatus( - de.read_string( - _SCHEMA_ORGANIZATION_FEATURE_CONFIGURATION_RESULT.members[ - "AutoEnable" - ] - ) - ) - - case 2: - kwargs["additional_configuration"] = ( - _deserialize_organization_additional_configuration_results( - de, - _SCHEMA_ORGANIZATION_FEATURE_CONFIGURATION_RESULT.members[ - "AdditionalConfiguration" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ORGANIZATION_FEATURE_CONFIGURATION_RESULT, consumer=_consumer - ) - return kwargs - - -def _serialize_organization_features_configurations_results( - serializer: ShapeSerializer, - schema: Schema, - value: list[OrganizationFeatureConfigurationResult], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_organization_features_configurations_results( - deserializer: ShapeDeserializer, schema: Schema -) -> list[OrganizationFeatureConfigurationResult]: - result: list[OrganizationFeatureConfigurationResult] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(OrganizationFeatureConfigurationResult.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class DescribeOrganizationConfigurationOutput: - """Dataclass for DescribeOrganizationConfigurationOutput structure.""" - - auto_enable: bool | None = None - """ - Indicates whether GuardDuty is automatically enabled for accounts added - to the organization. - - Even though this is still supported, we recommend using - `AutoEnableOrganizationMembers` to achieve the similar results. - """ - - member_account_limit_reached: bool | None = None - """ - Indicates whether the maximum number of allowed member accounts are - already associated with the delegated administrator account for your - organization. - """ - - data_sources: OrganizationDataSourceConfigurationsResult | None = None - """ - Describes which data sources are enabled automatically for member - accounts. - """ - - features: list[OrganizationFeatureConfigurationResult] | None = None - """A list of features that are configured for this organization.""" - - next_token: str | None = None - """ - The pagination parameter to be used on the next list operation to - retrieve more items. - """ - - auto_enable_organization_members: str | None = None - """ - Indicates the auto-enablement configuration of GuardDuty or any of the - corresponding protection plans for the member accounts in the - organization. - - - `NEW`: Indicates that when a new account joins the organization, they - will have GuardDuty or any of the corresponding protection plans - enabled automatically. - - - `ALL`: Indicates that all accounts in the organization have GuardDuty - and any of the corresponding protection plans enabled automatically. - This includes `NEW` accounts that join the organization and accounts - that may have been suspended or removed from the organization in - GuardDuty. - - - `NONE`: Indicates that GuardDuty or any of the corresponding - protection plans will not be automatically enabled for any account in - the organization. The administrator must manage GuardDuty for each - account in the organization individually. - - When you update the auto-enable setting from `ALL` or `NEW` to `NONE`, - this action doesn't disable the corresponding option for your - existing accounts. This configuration will apply to the new accounts - that join the organization. After you update the auto-enable settings, - no new account will have the corresponding option as enabled. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DESCRIBE_ORGANIZATION_CONFIGURATION_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.auto_enable is not None: - serializer.write_boolean( - _SCHEMA_DESCRIBE_ORGANIZATION_CONFIGURATION_OUTPUT.members[ - "AutoEnable" - ], - self.auto_enable, - ) - - if self.member_account_limit_reached is not None: - serializer.write_boolean( - _SCHEMA_DESCRIBE_ORGANIZATION_CONFIGURATION_OUTPUT.members[ - "MemberAccountLimitReached" - ], - self.member_account_limit_reached, - ) - - if self.data_sources is not None: - serializer.write_struct( - _SCHEMA_DESCRIBE_ORGANIZATION_CONFIGURATION_OUTPUT.members[ - "DataSources" - ], - self.data_sources, - ) - - if self.features is not None: - _serialize_organization_features_configurations_results( - serializer, - _SCHEMA_DESCRIBE_ORGANIZATION_CONFIGURATION_OUTPUT.members["Features"], - self.features, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_ORGANIZATION_CONFIGURATION_OUTPUT.members["NextToken"], - self.next_token, - ) - - if self.auto_enable_organization_members is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_ORGANIZATION_CONFIGURATION_OUTPUT.members[ - "AutoEnableOrganizationMembers" - ], - self.auto_enable_organization_members, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["auto_enable"] = de.read_boolean( - _SCHEMA_DESCRIBE_ORGANIZATION_CONFIGURATION_OUTPUT.members[ - "AutoEnable" - ] - ) - - case 1: - kwargs["member_account_limit_reached"] = de.read_boolean( - _SCHEMA_DESCRIBE_ORGANIZATION_CONFIGURATION_OUTPUT.members[ - "MemberAccountLimitReached" - ] - ) - - case 2: - kwargs["data_sources"] = ( - OrganizationDataSourceConfigurationsResult.deserialize(de) - ) - - case 3: - kwargs["features"] = ( - _deserialize_organization_features_configurations_results( - de, - _SCHEMA_DESCRIBE_ORGANIZATION_CONFIGURATION_OUTPUT.members[ - "Features" - ], - ) - ) - - case 4: - kwargs["next_token"] = de.read_string( - _SCHEMA_DESCRIBE_ORGANIZATION_CONFIGURATION_OUTPUT.members[ - "NextToken" - ] - ) - - case 5: - kwargs["auto_enable_organization_members"] = AutoEnableMembers( - de.read_string( - _SCHEMA_DESCRIBE_ORGANIZATION_CONFIGURATION_OUTPUT.members[ - "AutoEnableOrganizationMembers" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DESCRIBE_ORGANIZATION_CONFIGURATION_OUTPUT, consumer=_consumer - ) - return kwargs - - -DESCRIBE_ORGANIZATION_CONFIGURATION = APIOperation( - input=DescribeOrganizationConfigurationInput, - output=DescribeOrganizationConfigurationOutput, - schema=_SCHEMA_DESCRIBE_ORGANIZATION_CONFIGURATION, - input_schema=_SCHEMA_DESCRIBE_ORGANIZATION_CONFIGURATION_INPUT, - output_schema=_SCHEMA_DESCRIBE_ORGANIZATION_CONFIGURATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DescribePublishingDestinationInput: - """Dataclass for DescribePublishingDestinationInput structure.""" - - detector_id: str | None = None - """ - The unique ID of the detector associated with the publishing destination - to retrieve. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - destination_id: str | None = None - """The ID of the publishing destination to retrieve.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DESCRIBE_PUBLISHING_DESTINATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_PUBLISHING_DESTINATION_INPUT.members["DetectorId"], - self.detector_id, - ) - - if self.destination_id is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_PUBLISHING_DESTINATION_INPUT.members["DestinationId"], - self.destination_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_DESCRIBE_PUBLISHING_DESTINATION_INPUT.members[ - "DetectorId" - ] - ) - - case 1: - kwargs["destination_id"] = de.read_string( - _SCHEMA_DESCRIBE_PUBLISHING_DESTINATION_INPUT.members[ - "DestinationId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DESCRIBE_PUBLISHING_DESTINATION_INPUT, consumer=_consumer - ) - return kwargs - - -class PublishingStatus(UnknownEnumMixin, StrEnum): - PENDING_VERIFICATION = "PENDING_VERIFICATION" - PUBLISHING = "PUBLISHING" - UNABLE_TO_PUBLISH_FIX_DESTINATION_PROPERTY = ( - "UNABLE_TO_PUBLISH_FIX_DESTINATION_PROPERTY" - ) - STOPPED = "STOPPED" - - -@dataclass(kw_only=True) -class DescribePublishingDestinationOutput: - """Dataclass for DescribePublishingDestinationOutput structure.""" - - destination_id: str | None = None - """The ID of the publishing destination.""" - - destination_type: str | None = None - """ - The type of publishing destination. Currently, only Amazon S3 buckets - are supported. - """ - - status: str | None = None - """The status of the publishing destination.""" - - publishing_failure_start_timestamp: int | None = None - """ - The time, in epoch millisecond format, at which GuardDuty was first - unable to publish findings to the destination. - """ - - destination_properties: DestinationProperties | None = None - """ - A `DestinationProperties` object that includes the `DestinationArn` and - `KmsKeyArn` of the publishing destination. - """ - - tags: dict[str, str] | None = None - """The tags of the publishing destination resource.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DESCRIBE_PUBLISHING_DESTINATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.destination_id is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_PUBLISHING_DESTINATION_OUTPUT.members["DestinationId"], - self.destination_id, - ) - - if self.destination_type is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_PUBLISHING_DESTINATION_OUTPUT.members[ - "DestinationType" - ], - self.destination_type, - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_PUBLISHING_DESTINATION_OUTPUT.members["Status"], - self.status, - ) - - if self.publishing_failure_start_timestamp is not None: - serializer.write_long( - _SCHEMA_DESCRIBE_PUBLISHING_DESTINATION_OUTPUT.members[ - "PublishingFailureStartTimestamp" - ], - self.publishing_failure_start_timestamp, - ) - - if self.destination_properties is not None: - serializer.write_struct( - _SCHEMA_DESCRIBE_PUBLISHING_DESTINATION_OUTPUT.members[ - "DestinationProperties" - ], - self.destination_properties, - ) - - if self.tags is not None: - _serialize_tag_map( - serializer, - _SCHEMA_DESCRIBE_PUBLISHING_DESTINATION_OUTPUT.members["Tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["destination_id"] = de.read_string( - _SCHEMA_DESCRIBE_PUBLISHING_DESTINATION_OUTPUT.members[ - "DestinationId" - ] - ) - - case 1: - kwargs["destination_type"] = DestinationType( - de.read_string( - _SCHEMA_DESCRIBE_PUBLISHING_DESTINATION_OUTPUT.members[ - "DestinationType" - ] - ) - ) - - case 2: - kwargs["status"] = PublishingStatus( - de.read_string( - _SCHEMA_DESCRIBE_PUBLISHING_DESTINATION_OUTPUT.members[ - "Status" - ] - ) - ) - - case 3: - kwargs["publishing_failure_start_timestamp"] = de.read_long( - _SCHEMA_DESCRIBE_PUBLISHING_DESTINATION_OUTPUT.members[ - "PublishingFailureStartTimestamp" - ] - ) - - case 4: - kwargs["destination_properties"] = ( - DestinationProperties.deserialize(de) - ) - - case 5: - kwargs["tags"] = _deserialize_tag_map( - de, - _SCHEMA_DESCRIBE_PUBLISHING_DESTINATION_OUTPUT.members["Tags"], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DESCRIBE_PUBLISHING_DESTINATION_OUTPUT, consumer=_consumer - ) - return kwargs - - -DESCRIBE_PUBLISHING_DESTINATION = APIOperation( - input=DescribePublishingDestinationInput, - output=DescribePublishingDestinationOutput, - schema=_SCHEMA_DESCRIBE_PUBLISHING_DESTINATION, - input_schema=_SCHEMA_DESCRIBE_PUBLISHING_DESTINATION_INPUT, - output_schema=_SCHEMA_DESCRIBE_PUBLISHING_DESTINATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class Destination: - """ - Contains information about the publishing destination, including the ID, - type, and status. - """ - - destination_id: str | None = None - """The unique ID of the publishing destination.""" - - destination_type: str | None = None - """ - The type of resource used for the publishing destination. Currently, - only Amazon S3 buckets are supported. - """ - - status: str | None = None - """The status of the publishing destination.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DESTINATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.destination_id is not None: - serializer.write_string( - _SCHEMA_DESTINATION.members["DestinationId"], self.destination_id - ) - - if self.destination_type is not None: - serializer.write_string( - _SCHEMA_DESTINATION.members["DestinationType"], self.destination_type - ) - - if self.status is not None: - serializer.write_string(_SCHEMA_DESTINATION.members["Status"], self.status) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["destination_id"] = de.read_string( - _SCHEMA_DESTINATION.members["DestinationId"] - ) - - case 1: - kwargs["destination_type"] = DestinationType( - de.read_string(_SCHEMA_DESTINATION.members["DestinationType"]) - ) - - case 2: - kwargs["status"] = PublishingStatus( - de.read_string(_SCHEMA_DESTINATION.members["Status"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DESTINATION, consumer=_consumer) - return kwargs - - -def _serialize_destinations( - serializer: ShapeSerializer, schema: Schema, value: list[Destination] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_destinations( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Destination]: - result: list[Destination] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Destination.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class NetworkDirection(UnknownEnumMixin, StrEnum): - INBOUND = "INBOUND" - OUTBOUND = "OUTBOUND" - - -@dataclass(kw_only=True) -class NetworkConnection: - """Contains information about the network connection.""" - - direction: str | None = None - """The direction in which the network traffic is flowing.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_NETWORK_CONNECTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.direction is not None: - serializer.write_string( - _SCHEMA_NETWORK_CONNECTION.members["Direction"], self.direction - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["direction"] = NetworkDirection( - de.read_string(_SCHEMA_NETWORK_CONNECTION.members["Direction"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_NETWORK_CONNECTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class NetworkGeoLocation: - """Contains information about network endpoint location.""" - - city: str | None = None - """The name of the city.""" - - country: str | None = None - """The name of the country.""" - - latitude: float | None = None - """The latitude information of the endpoint location.""" - - longitude: float | None = None - """The longitude information of the endpoint location.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_NETWORK_GEO_LOCATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.city is not None: - serializer.write_string( - _SCHEMA_NETWORK_GEO_LOCATION.members["City"], self.city - ) - - if self.country is not None: - serializer.write_string( - _SCHEMA_NETWORK_GEO_LOCATION.members["Country"], self.country - ) - - if self.latitude is not None: - serializer.write_double( - _SCHEMA_NETWORK_GEO_LOCATION.members["Latitude"], self.latitude - ) - - if self.longitude is not None: - serializer.write_double( - _SCHEMA_NETWORK_GEO_LOCATION.members["Longitude"], self.longitude - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["city"] = de.read_string( - _SCHEMA_NETWORK_GEO_LOCATION.members["City"] - ) - - case 1: - kwargs["country"] = de.read_string( - _SCHEMA_NETWORK_GEO_LOCATION.members["Country"] - ) - - case 2: - kwargs["latitude"] = de.read_double( - _SCHEMA_NETWORK_GEO_LOCATION.members["Latitude"] - ) - - case 3: - kwargs["longitude"] = de.read_double( - _SCHEMA_NETWORK_GEO_LOCATION.members["Longitude"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_NETWORK_GEO_LOCATION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class NetworkEndpoint: - """ - Contains information about network endpoints that were observed in the - attack sequence. - """ - - id: str | None = None - """The ID of the network endpoint.""" - - ip: str | None = None - """The IP address associated with the network endpoint.""" - - domain: str | None = None - """The domain information for the network endpoint.""" - - port: int | None = None - """The port number associated with the network endpoint.""" - - location: NetworkGeoLocation | None = None - """Information about the location of the network endpoint.""" - - autonomous_system: AutonomousSystem | None = None - """The Autonomous System (AS) of the network endpoint.""" - - connection: NetworkConnection | None = None - """Information about the network connection.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_NETWORK_ENDPOINT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string(_SCHEMA_NETWORK_ENDPOINT.members["Id"], self.id) - - if self.ip is not None: - serializer.write_string(_SCHEMA_NETWORK_ENDPOINT.members["Ip"], self.ip) - - if self.domain is not None: - serializer.write_string( - _SCHEMA_NETWORK_ENDPOINT.members["Domain"], self.domain - ) - - if self.port is not None: - serializer.write_integer( - _SCHEMA_NETWORK_ENDPOINT.members["Port"], self.port - ) - - if self.location is not None: - serializer.write_struct( - _SCHEMA_NETWORK_ENDPOINT.members["Location"], self.location - ) - - if self.autonomous_system is not None: - serializer.write_struct( - _SCHEMA_NETWORK_ENDPOINT.members["AutonomousSystem"], - self.autonomous_system, - ) - - if self.connection is not None: - serializer.write_struct( - _SCHEMA_NETWORK_ENDPOINT.members["Connection"], self.connection - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_NETWORK_ENDPOINT.members["Id"] - ) - - case 1: - kwargs["ip"] = de.read_string( - _SCHEMA_NETWORK_ENDPOINT.members["Ip"] - ) - - case 2: - kwargs["domain"] = de.read_string( - _SCHEMA_NETWORK_ENDPOINT.members["Domain"] - ) - - case 3: - kwargs["port"] = de.read_integer( - _SCHEMA_NETWORK_ENDPOINT.members["Port"] - ) - - case 4: - kwargs["location"] = NetworkGeoLocation.deserialize(de) - - case 5: - kwargs["autonomous_system"] = AutonomousSystem.deserialize(de) - - case 6: - kwargs["connection"] = NetworkConnection.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_NETWORK_ENDPOINT, consumer=_consumer) - return kwargs - - -def _serialize_network_endpoints( - serializer: ShapeSerializer, schema: Schema, value: list[NetworkEndpoint] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_network_endpoints( - deserializer: ShapeDeserializer, schema: Schema -) -> list[NetworkEndpoint]: - result: list[NetworkEndpoint] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(NetworkEndpoint.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class Ec2Image: - """ - Contains information about the Amazon EC2 Image involved in a GuardDuty - finding, including unique identifiers of the Amazon EC2 instances. - """ - - ec2_instance_uids: list[str] | None = None - """ - A list of unique identifiers for the compromised Amazon EC2 instances - that were launched with the same Amazon Machine Image (AMI). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EC2_IMAGE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.ec2_instance_uids is not None: - _serialize_ec2_instance_uids( - serializer, - _SCHEMA_EC2_IMAGE.members["Ec2InstanceUids"], - self.ec2_instance_uids, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["ec2_instance_uids"] = _deserialize_ec2_instance_uids( - de, _SCHEMA_EC2_IMAGE.members["Ec2InstanceUids"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EC2_IMAGE, consumer=_consumer) - return kwargs - - -def _serialize_ec2_network_interface_uids( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_ec2_network_interface_uids( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class IamInstanceProfile: - """Contains information about the EC2 instance profile.""" - - arn: str | None = None - """The profile ARN of the EC2 instance.""" - - id: str | None = None - """The profile ID of the EC2 instance.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IAM_INSTANCE_PROFILE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.arn is not None: - serializer.write_string( - _SCHEMA_IAM_INSTANCE_PROFILE.members["Arn"], self.arn - ) - - if self.id is not None: - serializer.write_string(_SCHEMA_IAM_INSTANCE_PROFILE.members["Id"], self.id) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["arn"] = de.read_string( - _SCHEMA_IAM_INSTANCE_PROFILE.members["Arn"] - ) - - case 1: - kwargs["id"] = de.read_string( - _SCHEMA_IAM_INSTANCE_PROFILE.members["Id"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_IAM_INSTANCE_PROFILE, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ProductCode: - """Contains information about the product code for the EC2 instance.""" - - code: str | None = None - """The product code information.""" - - product_type: str | None = None - """The product code type.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PRODUCT_CODE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.code is not None: - serializer.write_string(_SCHEMA_PRODUCT_CODE.members["Code"], self.code) - - if self.product_type is not None: - serializer.write_string( - _SCHEMA_PRODUCT_CODE.members["ProductType"], self.product_type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["code"] = de.read_string( - _SCHEMA_PRODUCT_CODE.members["Code"] - ) - - case 1: - kwargs["product_type"] = de.read_string( - _SCHEMA_PRODUCT_CODE.members["ProductType"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PRODUCT_CODE, consumer=_consumer) - return kwargs - - -def _serialize_product_codes( - serializer: ShapeSerializer, schema: Schema, value: list[ProductCode] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_product_codes( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ProductCode]: - result: list[ProductCode] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ProductCode.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class Ec2Instance: - """Details about the potentially impacted Amazon EC2 instance resource.""" - - availability_zone: str | None = None - """ - The availability zone of the Amazon EC2 instance. For more information, - see [Availability - zones](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html#concepts-availability-zones) - in the *Amazon EC2 User Guide*. - """ - - image_description: str | None = None - """The image description of the Amazon EC2 instance.""" - - instance_state: str | None = None - """ - The state of the Amazon EC2 instance. For more information, see [Amazon - EC2 instance state - changes](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html) - in the *Amazon EC2 User Guide*. - """ - - iam_instance_profile: IamInstanceProfile | None = None - """Contains information about the EC2 instance profile.""" - - instance_type: str | None = None - """Type of the Amazon EC2 instance.""" - - outpost_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the Amazon Web Services Outpost. This - shows applicable Amazon Web Services Outposts instances. - """ - - platform: str | None = None - """The platform of the Amazon EC2 instance.""" - - product_codes: list[ProductCode] | None = None - """The product code of the Amazon EC2 instance.""" - - ec2_network_interface_uids: list[str] | None = None - """The ID of the network interface.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EC2_INSTANCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.availability_zone is not None: - serializer.write_string( - _SCHEMA_EC2_INSTANCE.members["AvailabilityZone"], self.availability_zone - ) - - if self.image_description is not None: - serializer.write_string( - _SCHEMA_EC2_INSTANCE.members["ImageDescription"], self.image_description - ) - - if self.instance_state is not None: - serializer.write_string( - _SCHEMA_EC2_INSTANCE.members["InstanceState"], self.instance_state - ) - - if self.iam_instance_profile is not None: - serializer.write_struct( - _SCHEMA_EC2_INSTANCE.members["IamInstanceProfile"], - self.iam_instance_profile, - ) - - if self.instance_type is not None: - serializer.write_string( - _SCHEMA_EC2_INSTANCE.members["InstanceType"], self.instance_type - ) - - if self.outpost_arn is not None: - serializer.write_string( - _SCHEMA_EC2_INSTANCE.members["OutpostArn"], self.outpost_arn - ) - - if self.platform is not None: - serializer.write_string( - _SCHEMA_EC2_INSTANCE.members["Platform"], self.platform - ) - - if self.product_codes is not None: - _serialize_product_codes( - serializer, - _SCHEMA_EC2_INSTANCE.members["ProductCodes"], - self.product_codes, - ) - - if self.ec2_network_interface_uids is not None: - _serialize_ec2_network_interface_uids( - serializer, - _SCHEMA_EC2_INSTANCE.members["Ec2NetworkInterfaceUids"], - self.ec2_network_interface_uids, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["availability_zone"] = de.read_string( - _SCHEMA_EC2_INSTANCE.members["AvailabilityZone"] - ) - - case 1: - kwargs["image_description"] = de.read_string( - _SCHEMA_EC2_INSTANCE.members["ImageDescription"] - ) - - case 2: - kwargs["instance_state"] = de.read_string( - _SCHEMA_EC2_INSTANCE.members["InstanceState"] - ) - - case 3: - kwargs["iam_instance_profile"] = IamInstanceProfile.deserialize(de) - - case 4: - kwargs["instance_type"] = de.read_string( - _SCHEMA_EC2_INSTANCE.members["InstanceType"] - ) - - case 5: - kwargs["outpost_arn"] = de.read_string( - _SCHEMA_EC2_INSTANCE.members["OutpostArn"] - ) - - case 6: - kwargs["platform"] = de.read_string( - _SCHEMA_EC2_INSTANCE.members["Platform"] - ) - - case 7: - kwargs["product_codes"] = _deserialize_product_codes( - de, _SCHEMA_EC2_INSTANCE.members["ProductCodes"] - ) - - case 8: - kwargs["ec2_network_interface_uids"] = ( - _deserialize_ec2_network_interface_uids( - de, _SCHEMA_EC2_INSTANCE.members["Ec2NetworkInterfaceUids"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EC2_INSTANCE, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Ec2LaunchTemplate: - """ - Contains information about the Amazon EC2 launch template involved in a - GuardDuty finding, including unique identifiers of the Amazon EC2 - instances. - """ - - ec2_instance_uids: list[str] | None = None - """ - A list of unique identifiers for the compromised Amazon EC2 instances - that share the same Amazon EC2 launch template. - """ - - version: str | None = None - """Version of the EC2 launch template.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EC2_LAUNCH_TEMPLATE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.ec2_instance_uids is not None: - _serialize_ec2_instance_uids( - serializer, - _SCHEMA_EC2_LAUNCH_TEMPLATE.members["Ec2InstanceUids"], - self.ec2_instance_uids, - ) - - if self.version is not None: - serializer.write_string( - _SCHEMA_EC2_LAUNCH_TEMPLATE.members["Version"], self.version - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["ec2_instance_uids"] = _deserialize_ec2_instance_uids( - de, _SCHEMA_EC2_LAUNCH_TEMPLATE.members["Ec2InstanceUids"] - ) - - case 1: - kwargs["version"] = de.read_string( - _SCHEMA_EC2_LAUNCH_TEMPLATE.members["Version"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EC2_LAUNCH_TEMPLATE, consumer=_consumer) - return kwargs - - -def _serialize_ipv6_addresses( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_ipv6_addresses( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class PrivateIpAddressDetails: - """Contains other private IP address information of the EC2 instance.""" - - private_dns_name: str | None = None - """The private DNS name of the EC2 instance.""" - - private_ip_address: str | None = field(repr=False, default=None) - """The private IP address of the EC2 instance.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PRIVATE_IP_ADDRESS_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.private_dns_name is not None: - serializer.write_string( - _SCHEMA_PRIVATE_IP_ADDRESS_DETAILS.members["PrivateDnsName"], - self.private_dns_name, - ) - - if self.private_ip_address is not None: - serializer.write_string( - _SCHEMA_PRIVATE_IP_ADDRESS_DETAILS.members["PrivateIpAddress"], - self.private_ip_address, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["private_dns_name"] = de.read_string( - _SCHEMA_PRIVATE_IP_ADDRESS_DETAILS.members["PrivateDnsName"] - ) - - case 1: - kwargs["private_ip_address"] = de.read_string( - _SCHEMA_PRIVATE_IP_ADDRESS_DETAILS.members["PrivateIpAddress"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PRIVATE_IP_ADDRESS_DETAILS, consumer=_consumer) - return kwargs - - -def _serialize_private_ip_addresses( - serializer: ShapeSerializer, schema: Schema, value: list[PrivateIpAddressDetails] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_private_ip_addresses( - deserializer: ShapeDeserializer, schema: Schema -) -> list[PrivateIpAddressDetails]: - result: list[PrivateIpAddressDetails] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(PrivateIpAddressDetails.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class SecurityGroup: - """ - Contains information about the security groups associated with the EC2 - instance. - """ - - group_id: str | None = None - """The security group ID of the EC2 instance.""" - - group_name: str | None = None - """The security group name of the EC2 instance.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SECURITY_GROUP, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.group_id is not None: - serializer.write_string( - _SCHEMA_SECURITY_GROUP.members["GroupId"], self.group_id - ) - - if self.group_name is not None: - serializer.write_string( - _SCHEMA_SECURITY_GROUP.members["GroupName"], self.group_name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["group_id"] = de.read_string( - _SCHEMA_SECURITY_GROUP.members["GroupId"] - ) - - case 1: - kwargs["group_name"] = de.read_string( - _SCHEMA_SECURITY_GROUP.members["GroupName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SECURITY_GROUP, consumer=_consumer) - return kwargs - - -def _serialize_security_groups( - serializer: ShapeSerializer, schema: Schema, value: list[SecurityGroup] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_security_groups( - deserializer: ShapeDeserializer, schema: Schema -) -> list[SecurityGroup]: - result: list[SecurityGroup] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(SecurityGroup.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class Ec2NetworkInterface: - """ - Contains information about the elastic network interface of the Amazon - EC2 instance. - """ - - ipv6_addresses: list[str] | None = None - """A list of IPv6 addresses for the Amazon EC2 instance.""" - - private_ip_addresses: list[PrivateIpAddressDetails] | None = None - """Other private IP address information of the Amazon EC2 instance.""" - - public_ip: str | None = None - """The public IP address of the Amazon EC2 instance.""" - - security_groups: list[SecurityGroup] | None = None - """The security groups associated with the Amazon EC2 instance.""" - - sub_net_id: str | None = None - """The subnet ID of the Amazon EC2 instance.""" - - vpc_id: str | None = None - """The VPC ID of the Amazon EC2 instance.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EC2_NETWORK_INTERFACE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.ipv6_addresses is not None: - _serialize_ipv6_addresses( - serializer, - _SCHEMA_EC2_NETWORK_INTERFACE.members["Ipv6Addresses"], - self.ipv6_addresses, - ) - - if self.private_ip_addresses is not None: - _serialize_private_ip_addresses( - serializer, - _SCHEMA_EC2_NETWORK_INTERFACE.members["PrivateIpAddresses"], - self.private_ip_addresses, - ) - - if self.public_ip is not None: - serializer.write_string( - _SCHEMA_EC2_NETWORK_INTERFACE.members["PublicIp"], self.public_ip - ) - - if self.security_groups is not None: - _serialize_security_groups( - serializer, - _SCHEMA_EC2_NETWORK_INTERFACE.members["SecurityGroups"], - self.security_groups, - ) - - if self.sub_net_id is not None: - serializer.write_string( - _SCHEMA_EC2_NETWORK_INTERFACE.members["SubNetId"], self.sub_net_id - ) - - if self.vpc_id is not None: - serializer.write_string( - _SCHEMA_EC2_NETWORK_INTERFACE.members["VpcId"], self.vpc_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["ipv6_addresses"] = _deserialize_ipv6_addresses( - de, _SCHEMA_EC2_NETWORK_INTERFACE.members["Ipv6Addresses"] - ) - - case 1: - kwargs["private_ip_addresses"] = _deserialize_private_ip_addresses( - de, _SCHEMA_EC2_NETWORK_INTERFACE.members["PrivateIpAddresses"] - ) - - case 2: - kwargs["public_ip"] = de.read_string( - _SCHEMA_EC2_NETWORK_INTERFACE.members["PublicIp"] - ) - - case 3: - kwargs["security_groups"] = _deserialize_security_groups( - de, _SCHEMA_EC2_NETWORK_INTERFACE.members["SecurityGroups"] - ) - - case 4: - kwargs["sub_net_id"] = de.read_string( - _SCHEMA_EC2_NETWORK_INTERFACE.members["SubNetId"] - ) - - case 5: - kwargs["vpc_id"] = de.read_string( - _SCHEMA_EC2_NETWORK_INTERFACE.members["VpcId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EC2_NETWORK_INTERFACE, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Ec2Vpc: - """ - Contains information about the Amazon EC2 VPC involved in a GuardDuty - finding, including unique identifiers of the Amazon EC2 instances. - """ - - ec2_instance_uids: list[str] | None = None - """ - A list of unique identifiers for the compromised Amazon EC2 instances - that were launched within the same Virtual Private Cloud (VPC). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EC2_VPC, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.ec2_instance_uids is not None: - _serialize_ec2_instance_uids( - serializer, - _SCHEMA_EC2_VPC.members["Ec2InstanceUids"], - self.ec2_instance_uids, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["ec2_instance_uids"] = _deserialize_ec2_instance_uids( - de, _SCHEMA_EC2_VPC.members["Ec2InstanceUids"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EC2_VPC, consumer=_consumer) - return kwargs - - -class EcsClusterStatus(UnknownEnumMixin, StrEnum): - ACTIVE = "ACTIVE" - PROVISIONING = "PROVISIONING" - DEPROVISIONING = "DEPROVISIONING" - FAILED = "FAILED" - INACTIVE = "INACTIVE" - - -@dataclass(kw_only=True) -class EcsCluster: - """ - Contains information about the Amazon ECS cluster involved in a - GuardDuty finding, including cluster identification and status. - """ - - status: str | None = None - """The current status of the Amazon ECS cluster.""" - - ec2_instance_uids: list[str] | None = None - """ - A list of unique identifiers for the Amazon EC2 instances that serve as - container instances in the Amazon ECS cluster. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ECS_CLUSTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.status is not None: - serializer.write_string(_SCHEMA_ECS_CLUSTER.members["Status"], self.status) - - if self.ec2_instance_uids is not None: - _serialize_ec2_instance_uids( - serializer, - _SCHEMA_ECS_CLUSTER.members["Ec2InstanceUids"], - self.ec2_instance_uids, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["status"] = EcsClusterStatus( - de.read_string(_SCHEMA_ECS_CLUSTER.members["Status"]) - ) - - case 1: - kwargs["ec2_instance_uids"] = _deserialize_ec2_instance_uids( - de, _SCHEMA_ECS_CLUSTER.members["Ec2InstanceUids"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ECS_CLUSTER, consumer=_consumer) - return kwargs - - -class EcsLaunchType(UnknownEnumMixin, StrEnum): - FARGATE = "FARGATE" - EC2 = "EC2" - - -@dataclass(kw_only=True) -class EcsTask: - """ - Contains information about Amazon ECS task involved in a GuardDuty - finding, including task definition and container identifiers. - """ - - created_at: datetime | None = None - """ - The timestamp indicating when the Amazon ECS task was created, in UTC - format. - """ - - task_definition_arn: str | None = None - """ - The ARN of task definition which describes the container and volume - definitions of the Amazon ECS task. - """ - - launch_type: str | None = None - """The infrastructure type on which the Amazon ECS task runs.""" - - container_uids: list[str] | None = None - """ - A list of unique identifiers for the containers associated with the - Amazon ECS task. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ECS_TASK, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.created_at is not None: - serializer.write_timestamp( - _SCHEMA_ECS_TASK.members["CreatedAt"], self.created_at - ) - - if self.task_definition_arn is not None: - serializer.write_string( - _SCHEMA_ECS_TASK.members["TaskDefinitionArn"], self.task_definition_arn - ) - - if self.launch_type is not None: - serializer.write_string( - _SCHEMA_ECS_TASK.members["LaunchType"], self.launch_type - ) - - if self.container_uids is not None: - _serialize_container_uids( - serializer, - _SCHEMA_ECS_TASK.members["ContainerUids"], - self.container_uids, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_ECS_TASK.members["CreatedAt"] - ) - - case 1: - kwargs["task_definition_arn"] = de.read_string( - _SCHEMA_ECS_TASK.members["TaskDefinitionArn"] - ) - - case 2: - kwargs["launch_type"] = EcsLaunchType( - de.read_string(_SCHEMA_ECS_TASK.members["LaunchType"]) - ) - - case 3: - kwargs["container_uids"] = _deserialize_container_uids( - de, _SCHEMA_ECS_TASK.members["ContainerUids"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ECS_TASK, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class EksCluster: - """ - Contains information about the Amazon EKS cluster involved in a - GuardDuty finding, including cluster identification, status, and network - configuration. - """ - - arn: str | None = None - """ - The Amazon Resource Name (ARN) that uniquely identifies the Amazon EKS - cluster involved in the finding. - """ - - created_at: datetime | None = None - """ - The timestamp indicating when the Amazon EKS cluster was created, in UTC - format. - """ - - status: str | None = None - """The current status of the Amazon EKS cluster.""" - - vpc_id: str | None = None - """ - The ID of the Amazon Virtual Private Cloud (Amazon VPC) associated with - the Amazon EKS cluster. - """ - - ec2_instance_uids: list[str] | None = None - """ - A list of unique identifiers for the Amazon EC2 instances that serve as - worker nodes in the Amazon EKS cluster. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EKS_CLUSTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.arn is not None: - serializer.write_string(_SCHEMA_EKS_CLUSTER.members["Arn"], self.arn) - - if self.created_at is not None: - serializer.write_timestamp( - _SCHEMA_EKS_CLUSTER.members["CreatedAt"], self.created_at - ) - - if self.status is not None: - serializer.write_string(_SCHEMA_EKS_CLUSTER.members["Status"], self.status) - - if self.vpc_id is not None: - serializer.write_string(_SCHEMA_EKS_CLUSTER.members["VpcId"], self.vpc_id) - - if self.ec2_instance_uids is not None: - _serialize_ec2_instance_uids( - serializer, - _SCHEMA_EKS_CLUSTER.members["Ec2InstanceUids"], - self.ec2_instance_uids, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["arn"] = de.read_string(_SCHEMA_EKS_CLUSTER.members["Arn"]) - - case 1: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_EKS_CLUSTER.members["CreatedAt"] - ) - - case 2: - kwargs["status"] = ClusterStatus( - de.read_string(_SCHEMA_EKS_CLUSTER.members["Status"]) - ) - - case 3: - kwargs["vpc_id"] = de.read_string( - _SCHEMA_EKS_CLUSTER.members["VpcId"] - ) - - case 4: - kwargs["ec2_instance_uids"] = _deserialize_ec2_instance_uids( - de, _SCHEMA_EKS_CLUSTER.members["Ec2InstanceUids"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EKS_CLUSTER, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class IamInstanceProfileV2: - """ - Contains information about the IAM instance profile involved in a - GuardDuty finding, including unique identifiers of the Amazon EC2 - instances. - """ - - ec2_instance_uids: list[str] | None = None - """ - A list of unique identifiers for the compromised Amazon EC2 instances - that share the same IAM instance profile. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IAM_INSTANCE_PROFILE_V2, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.ec2_instance_uids is not None: - _serialize_ec2_instance_uids( - serializer, - _SCHEMA_IAM_INSTANCE_PROFILE_V2.members["Ec2InstanceUids"], - self.ec2_instance_uids, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["ec2_instance_uids"] = _deserialize_ec2_instance_uids( - de, _SCHEMA_IAM_INSTANCE_PROFILE_V2.members["Ec2InstanceUids"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_IAM_INSTANCE_PROFILE_V2, consumer=_consumer) - return kwargs - - -class KubernetesResourcesTypes(UnknownEnumMixin, StrEnum): - PODS = "PODS" - JOBS = "JOBS" - CRONJOBS = "CRONJOBS" - DEPLOYMENTS = "DEPLOYMENTS" - DAEMONSETS = "DAEMONSETS" - STATEFULSETS = "STATEFULSETS" - REPLICASETS = "REPLICASETS" - REPLICATIONCONTROLLERS = "REPLICATIONCONTROLLERS" - - -@dataclass(kw_only=True) -class KubernetesWorkload: - """ - Contains information about Kubernetes workloads involved in a GuardDuty - finding, including pods, deployments, and other Kubernetes resources. - """ - - container_uids: list[str] | None = None - """ - A list of unique identifiers for the containers that are part of the - Kubernetes workload. - """ - - namespace: str | None = None - """ - The Kubernetes namespace in which the workload is running, providing - logical isolation within the cluster. - """ - - kubernetes_resources_types: str | None = None - """The types of Kubernetes resources involved in the workload.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KUBERNETES_WORKLOAD, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.container_uids is not None: - _serialize_container_uids( - serializer, - _SCHEMA_KUBERNETES_WORKLOAD.members["ContainerUids"], - self.container_uids, - ) - - if self.namespace is not None: - serializer.write_string( - _SCHEMA_KUBERNETES_WORKLOAD.members["Namespace"], self.namespace - ) - - if self.kubernetes_resources_types is not None: - serializer.write_string( - _SCHEMA_KUBERNETES_WORKLOAD.members["KubernetesResourcesTypes"], - self.kubernetes_resources_types, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["container_uids"] = _deserialize_container_uids( - de, _SCHEMA_KUBERNETES_WORKLOAD.members["ContainerUids"] - ) - - case 1: - kwargs["namespace"] = de.read_string( - _SCHEMA_KUBERNETES_WORKLOAD.members["Namespace"] - ) - - case 2: - kwargs["kubernetes_resources_types"] = KubernetesResourcesTypes( - de.read_string( - _SCHEMA_KUBERNETES_WORKLOAD.members[ - "KubernetesResourcesTypes" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_KUBERNETES_WORKLOAD, consumer=_consumer) - return kwargs - - -class PublicAccessStatus(UnknownEnumMixin, StrEnum): - BLOCKED = "BLOCKED" - ALLOWED = "ALLOWED" - - -class PublicAclIgnoreBehavior(UnknownEnumMixin, StrEnum): - IGNORED = "IGNORED" - NOT_IGNORED = "NOT_IGNORED" - - -class PublicBucketRestrictBehavior(UnknownEnumMixin, StrEnum): - RESTRICTED = "RESTRICTED" - NOT_RESTRICTED = "NOT_RESTRICTED" - - -@dataclass(kw_only=True) -class PublicAccessConfiguration: - """ - Describes public access policies that apply to the Amazon S3 bucket. - - For information about each of the following settings, see [Blocking - public access to your Amazon S3 - storage](https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-control-block-public-access.html) - in the *Amazon S3 User Guide*. - """ - - public_acl_access: str | None = None - """ - Indicates whether or not there is a setting that allows public access to - the Amazon S3 buckets through access control lists (ACLs). - """ - - public_policy_access: str | None = None - """ - Indicates whether or not there is a setting that allows public access to - the Amazon S3 bucket policy. - """ - - public_acl_ignore_behavior: str | None = None - """ - Indicates whether or not there is a setting that ignores all public - access control lists (ACLs) on the Amazon S3 bucket and the objects that - it contains. - """ - - public_bucket_restrict_behavior: str | None = None - """ - Indicates whether or not there is a setting that restricts access to the - bucket with specified policies. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUBLIC_ACCESS_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.public_acl_access is not None: - serializer.write_string( - _SCHEMA_PUBLIC_ACCESS_CONFIGURATION.members["PublicAclAccess"], - self.public_acl_access, - ) - - if self.public_policy_access is not None: - serializer.write_string( - _SCHEMA_PUBLIC_ACCESS_CONFIGURATION.members["PublicPolicyAccess"], - self.public_policy_access, - ) - - if self.public_acl_ignore_behavior is not None: - serializer.write_string( - _SCHEMA_PUBLIC_ACCESS_CONFIGURATION.members["PublicAclIgnoreBehavior"], - self.public_acl_ignore_behavior, - ) - - if self.public_bucket_restrict_behavior is not None: - serializer.write_string( - _SCHEMA_PUBLIC_ACCESS_CONFIGURATION.members[ - "PublicBucketRestrictBehavior" - ], - self.public_bucket_restrict_behavior, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["public_acl_access"] = PublicAccessStatus( - de.read_string( - _SCHEMA_PUBLIC_ACCESS_CONFIGURATION.members[ - "PublicAclAccess" - ] - ) - ) - - case 1: - kwargs["public_policy_access"] = PublicAccessStatus( - de.read_string( - _SCHEMA_PUBLIC_ACCESS_CONFIGURATION.members[ - "PublicPolicyAccess" - ] - ) - ) - - case 2: - kwargs["public_acl_ignore_behavior"] = PublicAclIgnoreBehavior( - de.read_string( - _SCHEMA_PUBLIC_ACCESS_CONFIGURATION.members[ - "PublicAclIgnoreBehavior" - ] - ) - ) - - case 3: - kwargs["public_bucket_restrict_behavior"] = ( - PublicBucketRestrictBehavior( - de.read_string( - _SCHEMA_PUBLIC_ACCESS_CONFIGURATION.members[ - "PublicBucketRestrictBehavior" - ] - ) - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PUBLIC_ACCESS_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -def _serialize_s3_object_uids( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_s3_object_uids( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class S3Bucket: - """Contains information about the Amazon S3 bucket policies and encryption.""" - - owner_id: str | None = None - """The owner ID of the associated S3Amazon S3bucket.""" - - created_at: datetime | None = None - """The timestamp at which the Amazon S3 bucket was created.""" - - encryption_type: str | None = None - """ - The type of encryption used for the Amazon S3 buckets and its objects. - For more information, see [Protecting data with server-side - encryption](https://docs.aws.amazon.com/AmazonS3/latest/userguide/serv-side-encryption.html) - in the *Amazon S3 User Guide*. - """ - - encryption_key_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the encryption key that is used to - encrypt the Amazon S3 bucket and its objects. - """ - - effective_permission: str | None = None - """ - Describes the effective permissions on this S3 bucket, after factoring - all the attached policies. - """ - - public_read_access: str | None = None - """ - Indicates whether or not the public read access is allowed for an Amazon - S3 bucket. - """ - - public_write_access: str | None = None - """ - Indicates whether or not the public write access is allowed for an - Amazon S3 bucket. - """ - - account_public_access: PublicAccessConfiguration | None = None - """ - Contains information about the public access policies that apply to the - Amazon S3 bucket at the account level. - """ - - bucket_public_access: PublicAccessConfiguration | None = None - """ - Contains information about public access policies that apply to the - Amazon S3 bucket. - """ - - s3_object_uids: list[str] | None = None - """Represents a list of Amazon S3 object identifiers.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_S3_BUCKET, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.owner_id is not None: - serializer.write_string(_SCHEMA_S3_BUCKET.members["OwnerId"], self.owner_id) - - if self.created_at is not None: - serializer.write_timestamp( - _SCHEMA_S3_BUCKET.members["CreatedAt"], self.created_at - ) - - if self.encryption_type is not None: - serializer.write_string( - _SCHEMA_S3_BUCKET.members["EncryptionType"], self.encryption_type - ) - - if self.encryption_key_arn is not None: - serializer.write_string( - _SCHEMA_S3_BUCKET.members["EncryptionKeyArn"], self.encryption_key_arn - ) - - if self.effective_permission is not None: - serializer.write_string( - _SCHEMA_S3_BUCKET.members["EffectivePermission"], - self.effective_permission, - ) - - if self.public_read_access is not None: - serializer.write_string( - _SCHEMA_S3_BUCKET.members["PublicReadAccess"], self.public_read_access - ) - - if self.public_write_access is not None: - serializer.write_string( - _SCHEMA_S3_BUCKET.members["PublicWriteAccess"], self.public_write_access - ) - - if self.account_public_access is not None: - serializer.write_struct( - _SCHEMA_S3_BUCKET.members["AccountPublicAccess"], - self.account_public_access, - ) - - if self.bucket_public_access is not None: - serializer.write_struct( - _SCHEMA_S3_BUCKET.members["BucketPublicAccess"], - self.bucket_public_access, - ) - - if self.s3_object_uids is not None: - _serialize_s3_object_uids( - serializer, - _SCHEMA_S3_BUCKET.members["S3ObjectUids"], - self.s3_object_uids, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["owner_id"] = de.read_string( - _SCHEMA_S3_BUCKET.members["OwnerId"] - ) - - case 1: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_S3_BUCKET.members["CreatedAt"] - ) - - case 2: - kwargs["encryption_type"] = de.read_string( - _SCHEMA_S3_BUCKET.members["EncryptionType"] - ) - - case 3: - kwargs["encryption_key_arn"] = de.read_string( - _SCHEMA_S3_BUCKET.members["EncryptionKeyArn"] - ) - - case 4: - kwargs["effective_permission"] = de.read_string( - _SCHEMA_S3_BUCKET.members["EffectivePermission"] - ) - - case 5: - kwargs["public_read_access"] = PublicAccessStatus( - de.read_string(_SCHEMA_S3_BUCKET.members["PublicReadAccess"]) - ) - - case 6: - kwargs["public_write_access"] = PublicAccessStatus( - de.read_string(_SCHEMA_S3_BUCKET.members["PublicWriteAccess"]) - ) - - case 7: - kwargs["account_public_access"] = ( - PublicAccessConfiguration.deserialize(de) - ) - - case 8: - kwargs["bucket_public_access"] = ( - PublicAccessConfiguration.deserialize(de) - ) - - case 9: - kwargs["s3_object_uids"] = _deserialize_s3_object_uids( - de, _SCHEMA_S3_BUCKET.members["S3ObjectUids"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_S3_BUCKET, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class S3Object: - """Contains information about the Amazon S3 object.""" - - e_tag: str | None = None - """ - The entity tag is a hash of the Amazon S3 object. The ETag reflects - changes only to the contents of an object, and not its metadata. - """ - - key: str | None = None - """The key of the Amazon S3 object.""" - - version_id: str | None = None - """The version Id of the Amazon S3 object.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_S3_OBJECT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.e_tag is not None: - serializer.write_string(_SCHEMA_S3_OBJECT.members["ETag"], self.e_tag) - - if self.key is not None: - serializer.write_string(_SCHEMA_S3_OBJECT.members["Key"], self.key) - - if self.version_id is not None: - serializer.write_string( - _SCHEMA_S3_OBJECT.members["VersionId"], self.version_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["e_tag"] = de.read_string(_SCHEMA_S3_OBJECT.members["ETag"]) - - case 1: - kwargs["key"] = de.read_string(_SCHEMA_S3_OBJECT.members["Key"]) - - case 2: - kwargs["version_id"] = de.read_string( - _SCHEMA_S3_OBJECT.members["VersionId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_S3_OBJECT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ResourceData: - """ - Contains information about the Amazon Web Services resource that is - associated with the activity that prompted GuardDuty to generate a - finding. - """ - - s3_bucket: S3Bucket | None = None - """Contains information about the Amazon S3 bucket.""" - - ec2_instance: Ec2Instance | None = None - """Contains information about the Amazon EC2 instance.""" - - access_key: AccessKey | None = None - """ - Contains information about the IAM access key details of a user that - involved in the GuardDuty finding. - """ - - ec2_network_interface: Ec2NetworkInterface | None = None - """ - Contains information about the elastic network interface of the Amazon - EC2 instance. - """ - - s3_object: S3Object | None = None - """Contains information about the Amazon S3 object.""" - - eks_cluster: EksCluster | None = None - """ - Contains detailed information about the Amazon EKS cluster associated - with the activity that prompted GuardDuty to generate a finding. - """ - - kubernetes_workload: KubernetesWorkload | None = None - """ - Contains detailed information about the Kubernetes workload associated - with the activity that prompted GuardDuty to generate a finding. - """ - - container: ContainerFindingResource | None = None - """ - Contains detailed information about the container associated with the - activity that prompted GuardDuty to generate a finding. - """ - - ecs_cluster: EcsCluster | None = None - """ - Contains detailed information about the Amazon ECS cluster associated - with the activity that prompted GuardDuty to generate a finding. - """ - - ecs_task: EcsTask | None = None - """ - Contains detailed information about the Amazon ECS task associated with - the activity that prompted GuardDuty to generate a finding. - """ - - iam_instance_profile: IamInstanceProfileV2 | None = None - """ - Contains detailed information about the IAM instance profile associated - with the activity that prompted GuardDuty to generate a finding. - """ - - autoscaling_auto_scaling_group: AutoscalingAutoScalingGroup | None = None - """ - Contains detailed information about the Auto Scaling Group associated - with the activity that prompted GuardDuty to generate a finding. - """ - - ec2_launch_template: Ec2LaunchTemplate | None = None - """ - Contains detailed information about the EC2 launch template associated - with the activity that prompted GuardDuty to generate a finding. - """ - - ec2_vpc: Ec2Vpc | None = None - """ - Contains detailed information about the EC2 VPC associated with the - activity that prompted GuardDuty to generate a finding. - """ - - ec2_image: Ec2Image | None = None - """ - Contains detailed information about the EC2 Image associated with the - activity that prompted GuardDuty to generate a finding. - """ - - cloudformation_stack: CloudformationStack | None = None - """ - Contains detailed information about the CloudFormation stack associated - with the activity that prompted GuardDuty to generate a finding. - """ - - bedrock_guardrail: BedrockGuardrailResource | None = None - """ - Contains detailed information about the Amazon Bedrock guardrail - associated with the activity that prompted GuardDuty to generate a - finding. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESOURCE_DATA, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.s3_bucket is not None: - serializer.write_struct( - _SCHEMA_RESOURCE_DATA.members["S3Bucket"], self.s3_bucket - ) - - if self.ec2_instance is not None: - serializer.write_struct( - _SCHEMA_RESOURCE_DATA.members["Ec2Instance"], self.ec2_instance - ) - - if self.access_key is not None: - serializer.write_struct( - _SCHEMA_RESOURCE_DATA.members["AccessKey"], self.access_key - ) - - if self.ec2_network_interface is not None: - serializer.write_struct( - _SCHEMA_RESOURCE_DATA.members["Ec2NetworkInterface"], - self.ec2_network_interface, - ) - - if self.s3_object is not None: - serializer.write_struct( - _SCHEMA_RESOURCE_DATA.members["S3Object"], self.s3_object - ) - - if self.eks_cluster is not None: - serializer.write_struct( - _SCHEMA_RESOURCE_DATA.members["EksCluster"], self.eks_cluster - ) - - if self.kubernetes_workload is not None: - serializer.write_struct( - _SCHEMA_RESOURCE_DATA.members["KubernetesWorkload"], - self.kubernetes_workload, - ) - - if self.container is not None: - serializer.write_struct( - _SCHEMA_RESOURCE_DATA.members["Container"], self.container - ) - - if self.ecs_cluster is not None: - serializer.write_struct( - _SCHEMA_RESOURCE_DATA.members["EcsCluster"], self.ecs_cluster - ) - - if self.ecs_task is not None: - serializer.write_struct( - _SCHEMA_RESOURCE_DATA.members["EcsTask"], self.ecs_task - ) - - if self.iam_instance_profile is not None: - serializer.write_struct( - _SCHEMA_RESOURCE_DATA.members["IamInstanceProfile"], - self.iam_instance_profile, - ) - - if self.autoscaling_auto_scaling_group is not None: - serializer.write_struct( - _SCHEMA_RESOURCE_DATA.members["AutoscalingAutoScalingGroup"], - self.autoscaling_auto_scaling_group, - ) - - if self.ec2_launch_template is not None: - serializer.write_struct( - _SCHEMA_RESOURCE_DATA.members["Ec2LaunchTemplate"], - self.ec2_launch_template, - ) - - if self.ec2_vpc is not None: - serializer.write_struct( - _SCHEMA_RESOURCE_DATA.members["Ec2Vpc"], self.ec2_vpc - ) - - if self.ec2_image is not None: - serializer.write_struct( - _SCHEMA_RESOURCE_DATA.members["Ec2Image"], self.ec2_image - ) - - if self.cloudformation_stack is not None: - serializer.write_struct( - _SCHEMA_RESOURCE_DATA.members["CloudformationStack"], - self.cloudformation_stack, - ) - - if self.bedrock_guardrail is not None: - serializer.write_struct( - _SCHEMA_RESOURCE_DATA.members["BedrockGuardrail"], - self.bedrock_guardrail, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["s3_bucket"] = S3Bucket.deserialize(de) - - case 1: - kwargs["ec2_instance"] = Ec2Instance.deserialize(de) - - case 2: - kwargs["access_key"] = AccessKey.deserialize(de) - - case 3: - kwargs["ec2_network_interface"] = Ec2NetworkInterface.deserialize( - de - ) - - case 4: - kwargs["s3_object"] = S3Object.deserialize(de) - - case 5: - kwargs["eks_cluster"] = EksCluster.deserialize(de) - - case 6: - kwargs["kubernetes_workload"] = KubernetesWorkload.deserialize(de) - - case 7: - kwargs["container"] = ContainerFindingResource.deserialize(de) - - case 8: - kwargs["ecs_cluster"] = EcsCluster.deserialize(de) - - case 9: - kwargs["ecs_task"] = EcsTask.deserialize(de) - - case 10: - kwargs["iam_instance_profile"] = IamInstanceProfileV2.deserialize( - de - ) - - case 11: - kwargs["autoscaling_auto_scaling_group"] = ( - AutoscalingAutoScalingGroup.deserialize(de) - ) - - case 12: - kwargs["ec2_launch_template"] = Ec2LaunchTemplate.deserialize(de) - - case 13: - kwargs["ec2_vpc"] = Ec2Vpc.deserialize(de) - - case 14: - kwargs["ec2_image"] = Ec2Image.deserialize(de) - - case 15: - kwargs["cloudformation_stack"] = CloudformationStack.deserialize(de) - - case 16: - kwargs["bedrock_guardrail"] = BedrockGuardrailResource.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RESOURCE_DATA, consumer=_consumer) - return kwargs - - -class FindingResourceType(UnknownEnumMixin, StrEnum): - EC2_INSTANCE = "EC2_INSTANCE" - EC2_NETWORK_INTERFACE = "EC2_NETWORK_INTERFACE" - S3_BUCKET = "S3_BUCKET" - S3_OBJECT = "S3_OBJECT" - ACCESS_KEY = "ACCESS_KEY" - EKS_CLUSTER = "EKS_CLUSTER" - KUBERNETES_WORKLOAD = "KUBERNETES_WORKLOAD" - CONTAINER = "CONTAINER" - ECS_CLUSTER = "ECS_CLUSTER" - ECS_TASK = "ECS_TASK" - AUTOSCALING_AUTO_SCALING_GROUP = "AUTOSCALING_AUTO_SCALING_GROUP" - IAM_INSTANCE_PROFILE = "IAM_INSTANCE_PROFILE" - CLOUDFORMATION_STACK = "CLOUDFORMATION_STACK" - EC2_LAUNCH_TEMPLATE = "EC2_LAUNCH_TEMPLATE" - EC2_VPC = "EC2_VPC" - EC2_IMAGE = "EC2_IMAGE" - BEDROCK_CUSTOM_MODEL = "BEDROCK_CUSTOM_MODEL" - """An Amazon Bedrock custom model fine-tuned by the customer.""" - BEDROCK_IMPORTED_MODEL = "BEDROCK_IMPORTED_MODEL" - """An Amazon Bedrock imported model brought in from an external source.""" - BEDROCK_PROVISIONED_MODEL = "BEDROCK_PROVISIONED_MODEL" - """An Amazon Bedrock model with provisioned throughput.""" - BEDROCK_CUSTOM_MODEL_DEPLOYMENT = "BEDROCK_CUSTOM_MODEL_DEPLOYMENT" - """A deployment of an Amazon Bedrock custom model.""" - BEDROCK_INFERENCE_PROFILE = "BEDROCK_INFERENCE_PROFILE" - """ - An Amazon Bedrock inference profile that routes model invocations across - Regions. - """ - BEDROCK_APPLICATION_INFERENCE_PROFILE = "BEDROCK_APPLICATION_INFERENCE_PROFILE" - """ - An application-scoped Amazon Bedrock inference profile used to track - invocation usage. - """ - BEDROCK_PROMPT = "BEDROCK_PROMPT" - """A managed prompt stored in Amazon Bedrock Prompt Management.""" - BEDROCK_PROMPT_ROUTER = "BEDROCK_PROMPT_ROUTER" - """An Amazon Bedrock prompt router that selects a model per request.""" - BEDROCK_GUARDRAIL = "BEDROCK_GUARDRAIL" - """An Amazon Bedrock guardrail evaluated during a model invocation.""" - SAGEMAKER_ENDPOINT = "SAGEMAKER_ENDPOINT" - """An Amazon SageMaker inference endpoint.""" - - -@dataclass(kw_only=True) -class Tag: - """Contains information about a tag key-value pair.""" - - key: str | None = None - """Describes the key associated with the tag.""" - - value: str | None = None - """Describes the value associated with the tag key.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TAG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.key is not None: - serializer.write_string(_SCHEMA_TAG.members["Key"], self.key) - - if self.value is not None: - serializer.write_string(_SCHEMA_TAG.members["Value"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["key"] = de.read_string(_SCHEMA_TAG.members["Key"]) - - case 1: - kwargs["value"] = de.read_string(_SCHEMA_TAG.members["Value"]) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TAG, consumer=_consumer) - return kwargs - - -def _serialize_tags( - serializer: ShapeSerializer, schema: Schema, value: list[Tag] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_tags(deserializer: ShapeDeserializer, schema: Schema) -> list[Tag]: - result: list[Tag] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Tag.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ResourceV2: - """ - Contains information about the Amazon Web Services resource that is - associated with the GuardDuty finding. - """ - - uid: str | None = None - """The unique identifier of the resource.""" - - name: str | None = None - """The name of the resource.""" - - account_id: str | None = None - """The Amazon Web Services account ID to which the resource belongs.""" - - resource_type: str | None = None - """The type of the Amazon Web Services resource.""" - - region: str | None = None - """The Amazon Web Services Region where the resource belongs.""" - - service: str | None = None - """The Amazon Web Services service of the resource.""" - - cloud_partition: str | None = None - """ - The cloud partition within the Amazon Web Services Region to which the - resource belongs. - """ - - tags: list[Tag] | None = None - """Contains information about the tags associated with the resource.""" - - data: ResourceData | None = None - """ - Contains information about the Amazon Web Services resource associated - with the activity that prompted GuardDuty to generate a finding. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESOURCE_V2, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.uid is not None: - serializer.write_string(_SCHEMA_RESOURCE_V2.members["Uid"], self.uid) - - if self.name is not None: - serializer.write_string(_SCHEMA_RESOURCE_V2.members["Name"], self.name) - - if self.account_id is not None: - serializer.write_string( - _SCHEMA_RESOURCE_V2.members["AccountId"], self.account_id - ) - - if self.resource_type is not None: - serializer.write_string( - _SCHEMA_RESOURCE_V2.members["ResourceType"], self.resource_type - ) - - if self.region is not None: - serializer.write_string(_SCHEMA_RESOURCE_V2.members["Region"], self.region) - - if self.service is not None: - serializer.write_string( - _SCHEMA_RESOURCE_V2.members["Service"], self.service - ) - - if self.cloud_partition is not None: - serializer.write_string( - _SCHEMA_RESOURCE_V2.members["CloudPartition"], self.cloud_partition - ) - - if self.tags is not None: - _serialize_tags(serializer, _SCHEMA_RESOURCE_V2.members["Tags"], self.tags) - - if self.data is not None: - serializer.write_struct(_SCHEMA_RESOURCE_V2.members["Data"], self.data) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["uid"] = de.read_string(_SCHEMA_RESOURCE_V2.members["Uid"]) - - case 1: - kwargs["name"] = de.read_string(_SCHEMA_RESOURCE_V2.members["Name"]) - - case 2: - kwargs["account_id"] = de.read_string( - _SCHEMA_RESOURCE_V2.members["AccountId"] - ) - - case 3: - kwargs["resource_type"] = FindingResourceType( - de.read_string(_SCHEMA_RESOURCE_V2.members["ResourceType"]) - ) - - case 4: - kwargs["region"] = de.read_string( - _SCHEMA_RESOURCE_V2.members["Region"] - ) - - case 5: - kwargs["service"] = de.read_string( - _SCHEMA_RESOURCE_V2.members["Service"] - ) - - case 6: - kwargs["cloud_partition"] = de.read_string( - _SCHEMA_RESOURCE_V2.members["CloudPartition"] - ) - - case 7: - kwargs["tags"] = _deserialize_tags( - de, _SCHEMA_RESOURCE_V2.members["Tags"] - ) - - case 8: - kwargs["data"] = ResourceData.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RESOURCE_V2, consumer=_consumer) - return kwargs - - -def _serialize_resources( - serializer: ShapeSerializer, schema: Schema, value: list[ResourceV2] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_resources( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ResourceV2]: - result: list[ResourceV2] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ResourceV2.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class IndicatorType(UnknownEnumMixin, StrEnum): - SUSPICIOUS_USER_AGENT = "SUSPICIOUS_USER_AGENT" - SUSPICIOUS_NETWORK = "SUSPICIOUS_NETWORK" - MALICIOUS_IP = "MALICIOUS_IP" - TOR_IP = "TOR_IP" - ATTACK_TACTIC = "ATTACK_TACTIC" - HIGH_RISK_API = "HIGH_RISK_API" - ATTACK_TECHNIQUE = "ATTACK_TECHNIQUE" - UNUSUAL_API_FOR_ACCOUNT = "UNUSUAL_API_FOR_ACCOUNT" - UNUSUAL_ASN_FOR_ACCOUNT = "UNUSUAL_ASN_FOR_ACCOUNT" - UNUSUAL_ASN_FOR_USER = "UNUSUAL_ASN_FOR_USER" - SUSPICIOUS_PROCESS = "SUSPICIOUS_PROCESS" - MALICIOUS_DOMAIN = "MALICIOUS_DOMAIN" - MALICIOUS_PROCESS = "MALICIOUS_PROCESS" - CRYPTOMINING_IP = "CRYPTOMINING_IP" - CRYPTOMINING_DOMAIN = "CRYPTOMINING_DOMAIN" - CRYPTOMINING_PROCESS = "CRYPTOMINING_PROCESS" - MALICIOUS_FILE = "MALICIOUS_FILE" - VULNERABILITY = "VULNERABILITY" - MALICIOUS_PACKAGE = "MALICIOUS_PACKAGE" - MISCONFIGURATION = "MISCONFIGURATION" - REACHABILITY = "REACHABILITY" - SENSITIVE_DATA = "SENSITIVE_DATA" - - -def _serialize_indicator_values( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_indicator_values( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class Indicator: - """ - Contains information about the indicators that include a set of signals - observed in an attack sequence. - """ - - key: str | None = None - """ - Specific indicator keys observed in the attack sequence. For description - of the valid values for key, see [Attack sequence finding - details](https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_findings-summary.html#guardduty-extended-threat-detection-attack-sequence-finding-details) - in the *Amazon GuardDuty User Guide*. - """ - - values: list[str] | None = None - """ - Values associated with each indicator key. For example, if the indicator - key is `SUSPICIOUS_NETWORK`, then the value will be the name of the - network. If the indicator key is `ATTACK_TACTIC`, then the value will be - one of the MITRE tactics. - """ - - title: str | None = None - """Title describing the indicator.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INDICATOR, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.key is not None: - serializer.write_string(_SCHEMA_INDICATOR.members["Key"], self.key) - - if self.values is not None: - _serialize_indicator_values( - serializer, _SCHEMA_INDICATOR.members["Values"], self.values - ) - - if self.title is not None: - serializer.write_string(_SCHEMA_INDICATOR.members["Title"], self.title) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["key"] = IndicatorType( - de.read_string(_SCHEMA_INDICATOR.members["Key"]) - ) - - case 1: - kwargs["values"] = _deserialize_indicator_values( - de, _SCHEMA_INDICATOR.members["Values"] - ) - - case 2: - kwargs["title"] = de.read_string(_SCHEMA_INDICATOR.members["Title"]) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INDICATOR, consumer=_consumer) - return kwargs - - -def _serialize_indicators( - serializer: ShapeSerializer, schema: Schema, value: list[Indicator] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_indicators( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Indicator]: - result: list[Indicator] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Indicator.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_endpoint_ids( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_endpoint_ids( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_resource_uids( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_resource_uids( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -class SignalType(UnknownEnumMixin, StrEnum): - FINDING = "FINDING" - CLOUD_TRAIL = "CLOUD_TRAIL" - S3_DATA_EVENTS = "S3_DATA_EVENTS" - EKS_AUDIT_LOGS = "EKS_AUDIT_LOGS" - FLOW_LOGS = "FLOW_LOGS" - DNS_LOGS = "DNS_LOGS" - RUNTIME_MONITORING = "RUNTIME_MONITORING" - - -@dataclass(kw_only=True) -class Signal: - """Contains information about the signals involved in the attack sequence.""" - - uid: str | None = None - """The unique identifier of the signal.""" - - type: str | None = None - """ - The type of the signal used to identify an attack sequence. - - Signals can be GuardDuty findings or activities observed in data sources - that GuardDuty monitors. For more information, see [Foundational data - sources](https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_data-sources.html) - in the *Amazon GuardDuty User Guide*. - - A signal type can be one of the valid values listed in this API. Here - are the related descriptions: - - - `FINDING` - Individually generated GuardDuty finding. - - - `CLOUD_TRAIL` - Activity observed from CloudTrail logs - - - `S3_DATA_EVENTS` - Activity observed from CloudTrail data events for - S3. Activities associated with this type will show up only when you - have enabled GuardDuty S3 Protection feature in your account. For more - information about S3 Protection and steps to enable it, see [S3 - Protection](https://docs.aws.amazon.com/guardduty/latest/ug/s3-protection.html) - in the *Amazon GuardDuty User Guide*. - """ - - description: str | None = None - """The description of the signal.""" - - name: str | None = None - """ - The name of the signal. For example, when signal type is `FINDING`, the - signal name is the name of the finding. - """ - - created_at: datetime | None = None - """ - The timestamp when the first finding or activity related to this signal - was observed. - """ - - updated_at: datetime | None = None - """The timestamp when this signal was last observed.""" - - first_seen_at: datetime | None = None - """ - The timestamp when the first finding or activity related to this signal - was observed. - """ - - last_seen_at: datetime | None = None - """ - The timestamp when the last finding or activity related to this signal - was observed. - """ - - severity: float | None = None - """ - The severity associated with the signal. For more information about - severity, see [Findings severity - levels](https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_findings-severity.html) - in the *Amazon GuardDuty User Guide*. - """ - - count: int | None = None - """The number of times this signal was observed.""" - - resource_uids: list[str] | None = None - """ - Information about the unique identifiers of the resources involved in - the signal. - """ - - actor_ids: list[str] | None = None - """Information about the IDs of the threat actors involved in the signal.""" - - endpoint_ids: list[str] | None = None - """Information about the endpoint IDs associated with this signal.""" - - signal_indicators: list[Indicator] | None = None - """Contains information about the indicators associated with the signals.""" - - activities: list[Activity] | None = None - """ - Contains information about the activities, such as API calls, that were - observed for this signal. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SIGNAL, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.uid is not None: - serializer.write_string(_SCHEMA_SIGNAL.members["Uid"], self.uid) - - if self.type is not None: - serializer.write_string(_SCHEMA_SIGNAL.members["Type"], self.type) - - if self.description is not None: - serializer.write_string( - _SCHEMA_SIGNAL.members["Description"], self.description - ) - - if self.name is not None: - serializer.write_string(_SCHEMA_SIGNAL.members["Name"], self.name) - - if self.created_at is not None: - serializer.write_timestamp( - _SCHEMA_SIGNAL.members["CreatedAt"], self.created_at - ) - - if self.updated_at is not None: - serializer.write_timestamp( - _SCHEMA_SIGNAL.members["UpdatedAt"], self.updated_at - ) - - if self.first_seen_at is not None: - serializer.write_timestamp( - _SCHEMA_SIGNAL.members["FirstSeenAt"], self.first_seen_at - ) - - if self.last_seen_at is not None: - serializer.write_timestamp( - _SCHEMA_SIGNAL.members["LastSeenAt"], self.last_seen_at - ) - - if self.severity is not None: - serializer.write_double(_SCHEMA_SIGNAL.members["Severity"], self.severity) - - if self.count is not None: - serializer.write_integer(_SCHEMA_SIGNAL.members["Count"], self.count) - - if self.resource_uids is not None: - _serialize_resource_uids( - serializer, _SCHEMA_SIGNAL.members["ResourceUids"], self.resource_uids - ) - - if self.actor_ids is not None: - _serialize_actor_ids( - serializer, _SCHEMA_SIGNAL.members["ActorIds"], self.actor_ids - ) - - if self.endpoint_ids is not None: - _serialize_endpoint_ids( - serializer, _SCHEMA_SIGNAL.members["EndpointIds"], self.endpoint_ids - ) - - if self.signal_indicators is not None: - _serialize_indicators( - serializer, - _SCHEMA_SIGNAL.members["SignalIndicators"], - self.signal_indicators, - ) - - if self.activities is not None: - _serialize_activities( - serializer, _SCHEMA_SIGNAL.members["Activities"], self.activities - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["uid"] = de.read_string(_SCHEMA_SIGNAL.members["Uid"]) - - case 1: - kwargs["type"] = SignalType( - de.read_string(_SCHEMA_SIGNAL.members["Type"]) - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_SIGNAL.members["Description"] - ) - - case 3: - kwargs["name"] = de.read_string(_SCHEMA_SIGNAL.members["Name"]) - - case 4: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_SIGNAL.members["CreatedAt"] - ) - - case 5: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_SIGNAL.members["UpdatedAt"] - ) - - case 6: - kwargs["first_seen_at"] = de.read_timestamp( - _SCHEMA_SIGNAL.members["FirstSeenAt"] - ) - - case 7: - kwargs["last_seen_at"] = de.read_timestamp( - _SCHEMA_SIGNAL.members["LastSeenAt"] - ) - - case 8: - kwargs["severity"] = de.read_double( - _SCHEMA_SIGNAL.members["Severity"] - ) - - case 9: - kwargs["count"] = de.read_integer(_SCHEMA_SIGNAL.members["Count"]) - - case 10: - kwargs["resource_uids"] = _deserialize_resource_uids( - de, _SCHEMA_SIGNAL.members["ResourceUids"] - ) - - case 11: - kwargs["actor_ids"] = _deserialize_actor_ids( - de, _SCHEMA_SIGNAL.members["ActorIds"] - ) - - case 12: - kwargs["endpoint_ids"] = _deserialize_endpoint_ids( - de, _SCHEMA_SIGNAL.members["EndpointIds"] - ) - - case 13: - kwargs["signal_indicators"] = _deserialize_indicators( - de, _SCHEMA_SIGNAL.members["SignalIndicators"] - ) - - case 14: - kwargs["activities"] = _deserialize_activities( - de, _SCHEMA_SIGNAL.members["Activities"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SIGNAL, consumer=_consumer) - return kwargs - - -def _serialize_signals( - serializer: ShapeSerializer, schema: Schema, value: list[Signal] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_signals( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Signal]: - result: list[Signal] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Signal.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class Sequence: - """Contains information about the GuardDuty attack sequence finding.""" - - uid: str | None = None - """Unique identifier of the attack sequence.""" - - description: str | None = None - """Description of the attack sequence.""" - - actors: list[Actor] | None = None - """Contains information about the actors involved in the attack sequence.""" - - resources: list[ResourceV2] | None = None - """ - Contains information about the resources involved in the attack - sequence. - """ - - endpoints: list[NetworkEndpoint] | None = None - """ - Contains information about the network endpoints that were used in the - attack sequence. - """ - - signals: list[Signal] | None = None - """Contains information about the signals involved in the attack sequence.""" - - sequence_indicators: list[Indicator] | None = None - """ - Contains information about the indicators observed in the attack - sequence. - """ - - additional_sequence_types: list[str] | None = None - """ - Additional types of sequences that may be associated with the attack - sequence finding, providing further context about the nature of the - detected threat. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SEQUENCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.uid is not None: - serializer.write_string(_SCHEMA_SEQUENCE.members["Uid"], self.uid) - - if self.description is not None: - serializer.write_string( - _SCHEMA_SEQUENCE.members["Description"], self.description - ) - - if self.actors is not None: - _serialize_actors( - serializer, _SCHEMA_SEQUENCE.members["Actors"], self.actors - ) - - if self.resources is not None: - _serialize_resources( - serializer, _SCHEMA_SEQUENCE.members["Resources"], self.resources - ) - - if self.endpoints is not None: - _serialize_network_endpoints( - serializer, _SCHEMA_SEQUENCE.members["Endpoints"], self.endpoints - ) - - if self.signals is not None: - _serialize_signals( - serializer, _SCHEMA_SEQUENCE.members["Signals"], self.signals - ) - - if self.sequence_indicators is not None: - _serialize_indicators( - serializer, - _SCHEMA_SEQUENCE.members["SequenceIndicators"], - self.sequence_indicators, - ) - - if self.additional_sequence_types is not None: - _serialize_additional_sequence_types( - serializer, - _SCHEMA_SEQUENCE.members["AdditionalSequenceTypes"], - self.additional_sequence_types, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["uid"] = de.read_string(_SCHEMA_SEQUENCE.members["Uid"]) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_SEQUENCE.members["Description"] - ) - - case 2: - kwargs["actors"] = _deserialize_actors( - de, _SCHEMA_SEQUENCE.members["Actors"] - ) - - case 3: - kwargs["resources"] = _deserialize_resources( - de, _SCHEMA_SEQUENCE.members["Resources"] - ) - - case 4: - kwargs["endpoints"] = _deserialize_network_endpoints( - de, _SCHEMA_SEQUENCE.members["Endpoints"] - ) - - case 5: - kwargs["signals"] = _deserialize_signals( - de, _SCHEMA_SEQUENCE.members["Signals"] - ) - - case 6: - kwargs["sequence_indicators"] = _deserialize_indicators( - de, _SCHEMA_SEQUENCE.members["SequenceIndicators"] - ) - - case 7: - kwargs["additional_sequence_types"] = ( - _deserialize_additional_sequence_types( - de, _SCHEMA_SEQUENCE.members["AdditionalSequenceTypes"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SEQUENCE, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Detection: - """Contains information about the detected behavior.""" - - anomaly: Anomaly | None = None - """ - The details about the anomalous activity that caused GuardDuty to - generate the finding. - """ - - sequence: Sequence | None = None - """The details about the attack sequence.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DETECTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.anomaly is not None: - serializer.write_struct(_SCHEMA_DETECTION.members["Anomaly"], self.anomaly) - - if self.sequence is not None: - serializer.write_struct( - _SCHEMA_DETECTION.members["Sequence"], self.sequence - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["anomaly"] = Anomaly.deserialize(de) - - case 1: - kwargs["sequence"] = Sequence.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DETECTION, consumer=_consumer) - return kwargs - - -class DetectionRuleConfigurationStatus(UnknownEnumMixin, StrEnum): - ACTIVE = "ACTIVE" - PROCESSING = "PROCESSING" - FAILED = "FAILED" - - -class DetectionRuleDataSource(UnknownEnumMixin, StrEnum): - CLOUDTRAIL_MANAGEMENT_EVENT = "CloudTrailManagementEvent" - - -class DetectionRuleFilterCondition(UnknownEnumMixin, StrEnum): - EQUALS = "EQUALS" - CONTAINS = "CONTAINS" - - -class FilterFieldName(UnknownEnumMixin, StrEnum): - NAME = "name" - DESCRIPTION = "description" - DATA_SOURCE = "dataSource" - SEVERITY = "severity" - TACTIC = "tactic" - TECHNIQUE = "technique" - SERVICE = "service" - - -def _serialize_detection_rule_filter_values( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_detection_rule_filter_values( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class DetectionRuleFilter: - """ - Contains filter criteria for listing custom detection rules or - associations. - """ - - name: str | None = None - """The name of the field to filter by.""" - - values: list[str] | None = None - """The values to match against the specified filter name.""" - - condition: str | None = None - """ - The condition to apply to the filter. For example, `EQUALS` or - `CONTAINS`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DETECTION_RULE_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_DETECTION_RULE_FILTER.members["Name"], self.name - ) - - if self.values is not None: - _serialize_detection_rule_filter_values( - serializer, _SCHEMA_DETECTION_RULE_FILTER.members["Values"], self.values - ) - - if self.condition is not None: - serializer.write_string( - _SCHEMA_DETECTION_RULE_FILTER.members["Condition"], self.condition - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = FilterFieldName( - de.read_string(_SCHEMA_DETECTION_RULE_FILTER.members["Name"]) - ) - - case 1: - kwargs["values"] = _deserialize_detection_rule_filter_values( - de, _SCHEMA_DETECTION_RULE_FILTER.members["Values"] - ) - - case 2: - kwargs["condition"] = DetectionRuleFilterCondition( - de.read_string( - _SCHEMA_DETECTION_RULE_FILTER.members["Condition"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DETECTION_RULE_FILTER, consumer=_consumer) - return kwargs - - -def _serialize_detection_rule_filter_list( - serializer: ShapeSerializer, schema: Schema, value: list[DetectionRuleFilter] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_detection_rule_filter_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[DetectionRuleFilter]: - result: list[DetectionRuleFilter] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(DetectionRuleFilter.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class DetectionRuleOrgConfiguration: - """ - Contains the organization-level configuration for a custom detection - rule. - """ - - rule_id: str | None = None - """The unique identifier for the custom detection rule.""" - - mode: str | None = None - """ - The execution mode of the organization configuration. Valid values: - `LIVE` | `DRY_RUN`. - """ - - status: str | None = None - """ - The configuration status. Valid values: `ACTIVE` | `PROCESSING` | - `FAILED`. - """ - - status_reason: str | None = None - """The reason for the current configuration status.""" - - include_account_ids: list[str] | None = None - """ - A list of member account IDs included in the organization configuration. - Mutually exclusive with `ExcludeAccountIds`. - """ - - exclude_account_ids: list[str] | None = None - """ - A list of member account IDs excluded from the organization - configuration. Mutually exclusive with `IncludeAccountIds`. - """ - - created_at: datetime | None = None - """The timestamp when the organization configuration was created.""" - - updated_at: datetime | None = None - """The timestamp when the organization configuration was last updated.""" - - expires_at: datetime | None = None - """The timestamp when the organization configuration expires.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DETECTION_RULE_ORG_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rule_id is not None: - serializer.write_string( - _SCHEMA_DETECTION_RULE_ORG_CONFIGURATION.members["RuleId"], self.rule_id - ) - - if self.mode is not None: - serializer.write_string( - _SCHEMA_DETECTION_RULE_ORG_CONFIGURATION.members["Mode"], self.mode - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_DETECTION_RULE_ORG_CONFIGURATION.members["Status"], self.status - ) - - if self.status_reason is not None: - serializer.write_string( - _SCHEMA_DETECTION_RULE_ORG_CONFIGURATION.members["StatusReason"], - self.status_reason, - ) - - if self.include_account_ids is not None: - _serialize_detection_rule_account_ids( - serializer, - _SCHEMA_DETECTION_RULE_ORG_CONFIGURATION.members["IncludeAccountIds"], - self.include_account_ids, - ) - - if self.exclude_account_ids is not None: - _serialize_detection_rule_account_ids( - serializer, - _SCHEMA_DETECTION_RULE_ORG_CONFIGURATION.members["ExcludeAccountIds"], - self.exclude_account_ids, - ) - - if self.created_at is not None: - serializer.write_timestamp( - _SCHEMA_DETECTION_RULE_ORG_CONFIGURATION.members["CreatedAt"], - self.created_at, - ) - - if self.updated_at is not None: - serializer.write_timestamp( - _SCHEMA_DETECTION_RULE_ORG_CONFIGURATION.members["UpdatedAt"], - self.updated_at, - ) - - if self.expires_at is not None: - serializer.write_timestamp( - _SCHEMA_DETECTION_RULE_ORG_CONFIGURATION.members["ExpiresAt"], - self.expires_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rule_id"] = de.read_string( - _SCHEMA_DETECTION_RULE_ORG_CONFIGURATION.members["RuleId"] - ) - - case 1: - kwargs["mode"] = AssociationMode( - de.read_string( - _SCHEMA_DETECTION_RULE_ORG_CONFIGURATION.members["Mode"] - ) - ) - - case 2: - kwargs["status"] = DetectionRuleConfigurationStatus( - de.read_string( - _SCHEMA_DETECTION_RULE_ORG_CONFIGURATION.members["Status"] - ) - ) - - case 3: - kwargs["status_reason"] = de.read_string( - _SCHEMA_DETECTION_RULE_ORG_CONFIGURATION.members["StatusReason"] - ) - - case 4: - kwargs["include_account_ids"] = ( - _deserialize_detection_rule_account_ids( - de, - _SCHEMA_DETECTION_RULE_ORG_CONFIGURATION.members[ - "IncludeAccountIds" - ], - ) - ) - - case 5: - kwargs["exclude_account_ids"] = ( - _deserialize_detection_rule_account_ids( - de, - _SCHEMA_DETECTION_RULE_ORG_CONFIGURATION.members[ - "ExcludeAccountIds" - ], - ) - ) - - case 6: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_DETECTION_RULE_ORG_CONFIGURATION.members["CreatedAt"] - ) - - case 7: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_DETECTION_RULE_ORG_CONFIGURATION.members["UpdatedAt"] - ) - - case 8: - kwargs["expires_at"] = de.read_timestamp( - _SCHEMA_DETECTION_RULE_ORG_CONFIGURATION.members["ExpiresAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DETECTION_RULE_ORG_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DetectionRuleOrgConfigurationSummary: - """ - Contains summary information about an organization-level configuration - for a custom detection rule. - """ - - rule_id: str | None = None - """The unique identifier for the custom detection rule.""" - - mode: str | None = None - """The rule execution mode.""" - - status: str | None = None - """The configuration status.""" - - status_reason: str | None = None - """The reason for the current configuration status.""" - - created_at: datetime | None = None - """The timestamp when the organization configuration was created.""" - - updated_at: datetime | None = None - """The timestamp when the organization configuration was last updated.""" - - expires_at: datetime | None = None - """The timestamp when the organization configuration expires.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DETECTION_RULE_ORG_CONFIGURATION_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rule_id is not None: - serializer.write_string( - _SCHEMA_DETECTION_RULE_ORG_CONFIGURATION_SUMMARY.members["RuleId"], - self.rule_id, - ) - - if self.mode is not None: - serializer.write_string( - _SCHEMA_DETECTION_RULE_ORG_CONFIGURATION_SUMMARY.members["Mode"], - self.mode, - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_DETECTION_RULE_ORG_CONFIGURATION_SUMMARY.members["Status"], - self.status, - ) - - if self.status_reason is not None: - serializer.write_string( - _SCHEMA_DETECTION_RULE_ORG_CONFIGURATION_SUMMARY.members[ - "StatusReason" - ], - self.status_reason, - ) - - if self.created_at is not None: - serializer.write_timestamp( - _SCHEMA_DETECTION_RULE_ORG_CONFIGURATION_SUMMARY.members["CreatedAt"], - self.created_at, - ) - - if self.updated_at is not None: - serializer.write_timestamp( - _SCHEMA_DETECTION_RULE_ORG_CONFIGURATION_SUMMARY.members["UpdatedAt"], - self.updated_at, - ) - - if self.expires_at is not None: - serializer.write_timestamp( - _SCHEMA_DETECTION_RULE_ORG_CONFIGURATION_SUMMARY.members["ExpiresAt"], - self.expires_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rule_id"] = de.read_string( - _SCHEMA_DETECTION_RULE_ORG_CONFIGURATION_SUMMARY.members[ - "RuleId" - ] - ) - - case 1: - kwargs["mode"] = AssociationMode( - de.read_string( - _SCHEMA_DETECTION_RULE_ORG_CONFIGURATION_SUMMARY.members[ - "Mode" - ] - ) - ) - - case 2: - kwargs["status"] = DetectionRuleConfigurationStatus( - de.read_string( - _SCHEMA_DETECTION_RULE_ORG_CONFIGURATION_SUMMARY.members[ - "Status" - ] - ) - ) - - case 3: - kwargs["status_reason"] = de.read_string( - _SCHEMA_DETECTION_RULE_ORG_CONFIGURATION_SUMMARY.members[ - "StatusReason" - ] - ) - - case 4: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_DETECTION_RULE_ORG_CONFIGURATION_SUMMARY.members[ - "CreatedAt" - ] - ) - - case 5: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_DETECTION_RULE_ORG_CONFIGURATION_SUMMARY.members[ - "UpdatedAt" - ] - ) - - case 6: - kwargs["expires_at"] = de.read_timestamp( - _SCHEMA_DETECTION_RULE_ORG_CONFIGURATION_SUMMARY.members[ - "ExpiresAt" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DETECTION_RULE_ORG_CONFIGURATION_SUMMARY, consumer=_consumer - ) - return kwargs - - -def _serialize_detection_rule_org_configuration_summary_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[DetectionRuleOrgConfigurationSummary], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_detection_rule_org_configuration_summary_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[DetectionRuleOrgConfigurationSummary]: - result: list[DetectionRuleOrgConfigurationSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(DetectionRuleOrgConfigurationSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class DetectionRuleSeverity(UnknownEnumMixin, StrEnum): - CRITICAL = "CRITICAL" - HIGH = "HIGH" - MEDIUM = "MEDIUM" - LOW = "LOW" - - -class DetectionSource(UnknownEnumMixin, StrEnum): - AMAZON = "AMAZON" - BITDEFENDER = "BITDEFENDER" - - -class ManagedBy(UnknownEnumMixin, StrEnum): - GUARDDUTY_POLICY = "GUARDDUTY_POLICY" - - -@dataclass(kw_only=True) -class DetectorAdditionalConfigurationResult: - """Information about the additional configuration.""" - - name: str | None = None - """Name of the additional configuration.""" - - status: str | None = None - """Status of the additional configuration.""" - - updated_at: datetime | None = None - """ - The timestamp at which the additional configuration was last updated. - This is in UTC format. - """ - - managed_by: str | None = None - """ - Indicates what manages the additional configuration. A value of - `GUARDDUTY_POLICY` means a GuardDuty policy manages the additional - configuration. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DETECTOR_ADDITIONAL_CONFIGURATION_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_DETECTOR_ADDITIONAL_CONFIGURATION_RESULT.members["Name"], - self.name, - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_DETECTOR_ADDITIONAL_CONFIGURATION_RESULT.members["Status"], - self.status, - ) - - if self.updated_at is not None: - serializer.write_timestamp( - _SCHEMA_DETECTOR_ADDITIONAL_CONFIGURATION_RESULT.members["UpdatedAt"], - self.updated_at, - ) - - if self.managed_by is not None: - serializer.write_string( - _SCHEMA_DETECTOR_ADDITIONAL_CONFIGURATION_RESULT.members["ManagedBy"], - self.managed_by, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = FeatureAdditionalConfiguration( - de.read_string( - _SCHEMA_DETECTOR_ADDITIONAL_CONFIGURATION_RESULT.members[ - "Name" - ] - ) - ) - - case 1: - kwargs["status"] = FeatureStatus( - de.read_string( - _SCHEMA_DETECTOR_ADDITIONAL_CONFIGURATION_RESULT.members[ - "Status" - ] - ) - ) - - case 2: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_DETECTOR_ADDITIONAL_CONFIGURATION_RESULT.members[ - "UpdatedAt" - ] - ) - - case 3: - kwargs["managed_by"] = ManagedBy( - de.read_string( - _SCHEMA_DETECTOR_ADDITIONAL_CONFIGURATION_RESULT.members[ - "ManagedBy" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DETECTOR_ADDITIONAL_CONFIGURATION_RESULT, consumer=_consumer - ) - return kwargs - - -def _serialize_detector_additional_configuration_results( - serializer: ShapeSerializer, - schema: Schema, - value: list[DetectorAdditionalConfigurationResult], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_detector_additional_configuration_results( - deserializer: ShapeDeserializer, schema: Schema -) -> list[DetectorAdditionalConfigurationResult]: - result: list[DetectorAdditionalConfigurationResult] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(DetectorAdditionalConfigurationResult.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class DetectorFeatureResult(UnknownEnumMixin, StrEnum): - FLOW_LOGS = "FLOW_LOGS" - CLOUD_TRAIL = "CLOUD_TRAIL" - DNS_LOGS = "DNS_LOGS" - S3_DATA_EVENTS = "S3_DATA_EVENTS" - EKS_AUDIT_LOGS = "EKS_AUDIT_LOGS" - EBS_MALWARE_PROTECTION = "EBS_MALWARE_PROTECTION" - RDS_LOGIN_EVENTS = "RDS_LOGIN_EVENTS" - LAMBDA_NETWORK_LOGS = "LAMBDA_NETWORK_LOGS" - EKS_RUNTIME_MONITORING = "EKS_RUNTIME_MONITORING" - RUNTIME_MONITORING = "RUNTIME_MONITORING" - AI_PROTECTION = "AI_PROTECTION" - AI_ANALYST = "AI_ANALYST" - - -@dataclass(kw_only=True) -class DetectorFeatureConfigurationResult: - """ - Contains information about a GuardDuty feature. - - Specifying both EKS Runtime Monitoring (`EKS_RUNTIME_MONITORING`) and - Runtime Monitoring (`RUNTIME_MONITORING`) will cause an error. You can - add only one of these two features because Runtime Monitoring already - includes the threat detection for Amazon EKS resources. For more - information, see [Runtime - Monitoring](https://docs.aws.amazon.com/guardduty/latest/ug/runtime-monitoring.html). - """ - - name: str | None = None - """Indicates the name of the feature that can be enabled for the detector.""" - - status: str | None = None - """Indicates the status of the feature that is enabled for the detector.""" - - updated_at: datetime | None = None - """The timestamp at which the feature object was updated.""" - - additional_configuration: list[DetectorAdditionalConfigurationResult] | None = None - """Additional configuration for a resource.""" - - managed_by: str | None = None - """ - Indicates what manages the feature. A value of `GUARDDUTY_POLICY` means - a GuardDuty policy manages the feature. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DETECTOR_FEATURE_CONFIGURATION_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_DETECTOR_FEATURE_CONFIGURATION_RESULT.members["Name"], self.name - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_DETECTOR_FEATURE_CONFIGURATION_RESULT.members["Status"], - self.status, - ) - - if self.updated_at is not None: - serializer.write_timestamp( - _SCHEMA_DETECTOR_FEATURE_CONFIGURATION_RESULT.members["UpdatedAt"], - self.updated_at, - ) - - if self.additional_configuration is not None: - _serialize_detector_additional_configuration_results( - serializer, - _SCHEMA_DETECTOR_FEATURE_CONFIGURATION_RESULT.members[ - "AdditionalConfiguration" - ], - self.additional_configuration, - ) - - if self.managed_by is not None: - serializer.write_string( - _SCHEMA_DETECTOR_FEATURE_CONFIGURATION_RESULT.members["ManagedBy"], - self.managed_by, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = DetectorFeatureResult( - de.read_string( - _SCHEMA_DETECTOR_FEATURE_CONFIGURATION_RESULT.members[ - "Name" - ] - ) - ) - - case 1: - kwargs["status"] = FeatureStatus( - de.read_string( - _SCHEMA_DETECTOR_FEATURE_CONFIGURATION_RESULT.members[ - "Status" - ] - ) - ) - - case 2: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_DETECTOR_FEATURE_CONFIGURATION_RESULT.members[ - "UpdatedAt" - ] - ) - - case 3: - kwargs["additional_configuration"] = ( - _deserialize_detector_additional_configuration_results( - de, - _SCHEMA_DETECTOR_FEATURE_CONFIGURATION_RESULT.members[ - "AdditionalConfiguration" - ], - ) - ) - - case 4: - kwargs["managed_by"] = ManagedBy( - de.read_string( - _SCHEMA_DETECTOR_FEATURE_CONFIGURATION_RESULT.members[ - "ManagedBy" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DETECTOR_FEATURE_CONFIGURATION_RESULT, consumer=_consumer - ) - return kwargs - - -def _serialize_detector_feature_configurations_results( - serializer: ShapeSerializer, - schema: Schema, - value: list[DetectorFeatureConfigurationResult], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_detector_feature_configurations_results( - deserializer: ShapeDeserializer, schema: Schema -) -> list[DetectorFeatureConfigurationResult]: - result: list[DetectorFeatureConfigurationResult] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(DetectorFeatureConfigurationResult.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_detector_ids( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_detector_ids( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -class DetectorStatus(UnknownEnumMixin, StrEnum): - ENABLED = "ENABLED" - DISABLED = "DISABLED" - - -@dataclass(kw_only=True) -class DisableOrganizationAdminAccountInput: - """Dataclass for DisableOrganizationAdminAccountInput structure.""" - - admin_account_id: str | None = None - """ - The Amazon Web Services Account ID for the organizations account to be - disabled as a GuardDuty delegated administrator. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DISABLE_ORGANIZATION_ADMIN_ACCOUNT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.admin_account_id is not None: - serializer.write_string( - _SCHEMA_DISABLE_ORGANIZATION_ADMIN_ACCOUNT_INPUT.members[ - "AdminAccountId" - ], - self.admin_account_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["admin_account_id"] = de.read_string( - _SCHEMA_DISABLE_ORGANIZATION_ADMIN_ACCOUNT_INPUT.members[ - "AdminAccountId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DISABLE_ORGANIZATION_ADMIN_ACCOUNT_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DisableOrganizationAdminAccountOutput: - """Dataclass for DisableOrganizationAdminAccountOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DISABLE_ORGANIZATION_ADMIN_ACCOUNT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DISABLE_ORGANIZATION_ADMIN_ACCOUNT_OUTPUT, consumer=_consumer - ) - return kwargs - - -DISABLE_ORGANIZATION_ADMIN_ACCOUNT = APIOperation( - input=DisableOrganizationAdminAccountInput, - output=DisableOrganizationAdminAccountOutput, - schema=_SCHEMA_DISABLE_ORGANIZATION_ADMIN_ACCOUNT, - input_schema=_SCHEMA_DISABLE_ORGANIZATION_ADMIN_ACCOUNT_INPUT, - output_schema=_SCHEMA_DISABLE_ORGANIZATION_ADMIN_ACCOUNT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DisassociateFromAdministratorAccountInput: - """Dataclass for DisassociateFromAdministratorAccountInput structure.""" - - detector_id: str | None = None - """The unique ID of the detector of the GuardDuty member account.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DISASSOCIATE_FROM_ADMINISTRATOR_ACCOUNT_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_DISASSOCIATE_FROM_ADMINISTRATOR_ACCOUNT_INPUT.members[ - "DetectorId" - ], - self.detector_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_DISASSOCIATE_FROM_ADMINISTRATOR_ACCOUNT_INPUT.members[ - "DetectorId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DISASSOCIATE_FROM_ADMINISTRATOR_ACCOUNT_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DisassociateFromAdministratorAccountOutput: - """Dataclass for DisassociateFromAdministratorAccountOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DISASSOCIATE_FROM_ADMINISTRATOR_ACCOUNT_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DISASSOCIATE_FROM_ADMINISTRATOR_ACCOUNT_OUTPUT, consumer=_consumer - ) - return kwargs - - -DISASSOCIATE_FROM_ADMINISTRATOR_ACCOUNT = APIOperation( - input=DisassociateFromAdministratorAccountInput, - output=DisassociateFromAdministratorAccountOutput, - schema=_SCHEMA_DISASSOCIATE_FROM_ADMINISTRATOR_ACCOUNT, - input_schema=_SCHEMA_DISASSOCIATE_FROM_ADMINISTRATOR_ACCOUNT_INPUT, - output_schema=_SCHEMA_DISASSOCIATE_FROM_ADMINISTRATOR_ACCOUNT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DisassociateFromMasterAccountInput: - """Dataclass for DisassociateFromMasterAccountInput structure.""" - - detector_id: str | None = None - """The unique ID of the detector of the GuardDuty member account.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DISASSOCIATE_FROM_MASTER_ACCOUNT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_DISASSOCIATE_FROM_MASTER_ACCOUNT_INPUT.members["DetectorId"], - self.detector_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_DISASSOCIATE_FROM_MASTER_ACCOUNT_INPUT.members[ - "DetectorId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DISASSOCIATE_FROM_MASTER_ACCOUNT_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DisassociateFromMasterAccountOutput: - """Dataclass for DisassociateFromMasterAccountOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DISASSOCIATE_FROM_MASTER_ACCOUNT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DISASSOCIATE_FROM_MASTER_ACCOUNT_OUTPUT, consumer=_consumer - ) - return kwargs - - -DISASSOCIATE_FROM_MASTER_ACCOUNT = APIOperation( - input=DisassociateFromMasterAccountInput, - output=DisassociateFromMasterAccountOutput, - schema=_SCHEMA_DISASSOCIATE_FROM_MASTER_ACCOUNT, - input_schema=_SCHEMA_DISASSOCIATE_FROM_MASTER_ACCOUNT_INPUT, - output_schema=_SCHEMA_DISASSOCIATE_FROM_MASTER_ACCOUNT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DisassociateMembersInput: - """Dataclass for DisassociateMembersInput structure.""" - - detector_id: str | None = None - """ - The unique ID of the detector of the GuardDuty account whose members you - want to disassociate from the administrator account. - """ - - account_ids: list[str] | None = None - """ - A list of account IDs of the GuardDuty member accounts that you want to - disassociate from the administrator account. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DISASSOCIATE_MEMBERS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_DISASSOCIATE_MEMBERS_INPUT.members["DetectorId"], - self.detector_id, - ) - - if self.account_ids is not None: - _serialize_account_ids( - serializer, - _SCHEMA_DISASSOCIATE_MEMBERS_INPUT.members["AccountIds"], - self.account_ids, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_DISASSOCIATE_MEMBERS_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["account_ids"] = _deserialize_account_ids( - de, _SCHEMA_DISASSOCIATE_MEMBERS_INPUT.members["AccountIds"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DISASSOCIATE_MEMBERS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DisassociateMembersOutput: - """Dataclass for DisassociateMembersOutput structure.""" - - unprocessed_accounts: list[UnprocessedAccount] | None = None - """ - A list of objects that contain the unprocessed account and a result - string that explains why it was unprocessed. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DISASSOCIATE_MEMBERS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.unprocessed_accounts is not None: - _serialize_unprocessed_accounts( - serializer, - _SCHEMA_DISASSOCIATE_MEMBERS_OUTPUT.members["UnprocessedAccounts"], - self.unprocessed_accounts, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["unprocessed_accounts"] = _deserialize_unprocessed_accounts( - de, - _SCHEMA_DISASSOCIATE_MEMBERS_OUTPUT.members[ - "UnprocessedAccounts" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DISASSOCIATE_MEMBERS_OUTPUT, consumer=_consumer - ) - return kwargs - - -DISASSOCIATE_MEMBERS = APIOperation( - input=DisassociateMembersInput, - output=DisassociateMembersOutput, - schema=_SCHEMA_DISASSOCIATE_MEMBERS, - input_schema=_SCHEMA_DISASSOCIATE_MEMBERS_INPUT, - output_schema=_SCHEMA_DISASSOCIATE_MEMBERS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class EbsSnapshot: - """Contains information about an EBS snapshot that was scanned for malware.""" - - device_name: str | None = None - """The device name of the EBS snapshot that was scanned.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EBS_SNAPSHOT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.device_name is not None: - serializer.write_string( - _SCHEMA_EBS_SNAPSHOT.members["DeviceName"], self.device_name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["device_name"] = de.read_string( - _SCHEMA_EBS_SNAPSHOT.members["DeviceName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EBS_SNAPSHOT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class EbsSnapshotDetails: - """Contains details about the EBS snapshot that was scanned for malware.""" - - snapshot_arn: str | None = None - """The Amazon Resource Name (ARN) of the EBS snapshot.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EBS_SNAPSHOT_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.snapshot_arn is not None: - serializer.write_string( - _SCHEMA_EBS_SNAPSHOT_DETAILS.members["SnapshotArn"], self.snapshot_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["snapshot_arn"] = de.read_string( - _SCHEMA_EBS_SNAPSHOT_DETAILS.members["SnapshotArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EBS_SNAPSHOT_DETAILS, consumer=_consumer) - return kwargs - - -class EbsSnapshotPreservation(UnknownEnumMixin, StrEnum): - NO_RETENTION = "NO_RETENTION" - RETENTION_WITH_FINDING = "RETENTION_WITH_FINDING" - - -@dataclass(kw_only=True) -class EbsVolumeDetails: - """Contains list of scanned and skipped EBS volumes with details.""" - - scanned_volume_details: list[VolumeDetail] | None = None - """List of EBS volumes that were scanned.""" - - skipped_volume_details: list[VolumeDetail] | None = None - """List of EBS volumes that were skipped from the malware scan.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EBS_VOLUME_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.scanned_volume_details is not None: - _serialize_volume_details( - serializer, - _SCHEMA_EBS_VOLUME_DETAILS.members["ScannedVolumeDetails"], - self.scanned_volume_details, - ) - - if self.skipped_volume_details is not None: - _serialize_volume_details( - serializer, - _SCHEMA_EBS_VOLUME_DETAILS.members["SkippedVolumeDetails"], - self.skipped_volume_details, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["scanned_volume_details"] = _deserialize_volume_details( - de, _SCHEMA_EBS_VOLUME_DETAILS.members["ScannedVolumeDetails"] - ) - - case 1: - kwargs["skipped_volume_details"] = _deserialize_volume_details( - de, _SCHEMA_EBS_VOLUME_DETAILS.members["SkippedVolumeDetails"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EBS_VOLUME_DETAILS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class HighestSeverityThreatDetails: - """ - Contains details of the highest severity threat detected during scan and - number of infected files. - """ - - severity: str | None = None - """Severity level of the highest severity threat detected.""" - - threat_name: str | None = None - """ - Threat name of the highest severity threat detected as part of the - malware scan. - """ - - count: int | None = None - """ - Total number of infected files with the highest severity threat - detected. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HIGHEST_SEVERITY_THREAT_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.severity is not None: - serializer.write_string( - _SCHEMA_HIGHEST_SEVERITY_THREAT_DETAILS.members["Severity"], - self.severity, - ) - - if self.threat_name is not None: - serializer.write_string( - _SCHEMA_HIGHEST_SEVERITY_THREAT_DETAILS.members["ThreatName"], - self.threat_name, - ) - - if self.count is not None: - serializer.write_integer( - _SCHEMA_HIGHEST_SEVERITY_THREAT_DETAILS.members["Count"], self.count - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["severity"] = de.read_string( - _SCHEMA_HIGHEST_SEVERITY_THREAT_DETAILS.members["Severity"] - ) - - case 1: - kwargs["threat_name"] = de.read_string( - _SCHEMA_HIGHEST_SEVERITY_THREAT_DETAILS.members["ThreatName"] - ) - - case 2: - kwargs["count"] = de.read_integer( - _SCHEMA_HIGHEST_SEVERITY_THREAT_DETAILS.members["Count"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_HIGHEST_SEVERITY_THREAT_DETAILS, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ScannedItemCount: - """Total number of scanned files.""" - - total_gb: int | None = None - """Total GB of files scanned for malware.""" - - files: int | None = None - """Number of files scanned.""" - - volumes: int | None = None - """Total number of scanned volumes.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SCANNED_ITEM_COUNT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.total_gb is not None: - serializer.write_integer( - _SCHEMA_SCANNED_ITEM_COUNT.members["TotalGb"], self.total_gb - ) - - if self.files is not None: - serializer.write_integer( - _SCHEMA_SCANNED_ITEM_COUNT.members["Files"], self.files - ) - - if self.volumes is not None: - serializer.write_integer( - _SCHEMA_SCANNED_ITEM_COUNT.members["Volumes"], self.volumes - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["total_gb"] = de.read_integer( - _SCHEMA_SCANNED_ITEM_COUNT.members["TotalGb"] - ) - - case 1: - kwargs["files"] = de.read_integer( - _SCHEMA_SCANNED_ITEM_COUNT.members["Files"] - ) - - case 2: - kwargs["volumes"] = de.read_integer( - _SCHEMA_SCANNED_ITEM_COUNT.members["Volumes"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SCANNED_ITEM_COUNT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ScanFilePath: - """Contains details of infected file including name, file path and hash.""" - - file_path: str | None = None - """The file path of the infected file.""" - - volume_arn: str | None = None - """EBS volume ARN details of the infected file.""" - - hash: str | None = None - """The hash value of the infected file.""" - - file_name: str | None = None - """File name of the infected file.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SCAN_FILE_PATH, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.file_path is not None: - serializer.write_string( - _SCHEMA_SCAN_FILE_PATH.members["FilePath"], self.file_path - ) - - if self.volume_arn is not None: - serializer.write_string( - _SCHEMA_SCAN_FILE_PATH.members["VolumeArn"], self.volume_arn - ) - - if self.hash is not None: - serializer.write_string(_SCHEMA_SCAN_FILE_PATH.members["Hash"], self.hash) - - if self.file_name is not None: - serializer.write_string( - _SCHEMA_SCAN_FILE_PATH.members["FileName"], self.file_name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["file_path"] = de.read_string( - _SCHEMA_SCAN_FILE_PATH.members["FilePath"] - ) - - case 1: - kwargs["volume_arn"] = de.read_string( - _SCHEMA_SCAN_FILE_PATH.members["VolumeArn"] - ) - - case 2: - kwargs["hash"] = de.read_string( - _SCHEMA_SCAN_FILE_PATH.members["Hash"] - ) - - case 3: - kwargs["file_name"] = de.read_string( - _SCHEMA_SCAN_FILE_PATH.members["FileName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SCAN_FILE_PATH, consumer=_consumer) - return kwargs - - -def _serialize_file_paths( - serializer: ShapeSerializer, schema: Schema, value: list[ScanFilePath] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_file_paths( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ScanFilePath]: - result: list[ScanFilePath] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ScanFilePath.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ScanThreatName: - """ - Contains files infected with the given threat providing details of - malware name and severity. - """ - - name: str | None = None - """The name of the identified threat.""" - - severity: str | None = None - """Severity of threat identified as part of the malware scan.""" - - item_count: int | None = None - """Total number of files infected with given threat.""" - - file_paths: list[ScanFilePath] | None = None - """List of infected files in EBS volume with details.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SCAN_THREAT_NAME, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string(_SCHEMA_SCAN_THREAT_NAME.members["Name"], self.name) - - if self.severity is not None: - serializer.write_string( - _SCHEMA_SCAN_THREAT_NAME.members["Severity"], self.severity - ) - - if self.item_count is not None: - serializer.write_integer( - _SCHEMA_SCAN_THREAT_NAME.members["ItemCount"], self.item_count - ) - - if self.file_paths is not None: - _serialize_file_paths( - serializer, - _SCHEMA_SCAN_THREAT_NAME.members["FilePaths"], - self.file_paths, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_SCAN_THREAT_NAME.members["Name"] - ) - - case 1: - kwargs["severity"] = de.read_string( - _SCHEMA_SCAN_THREAT_NAME.members["Severity"] - ) - - case 2: - kwargs["item_count"] = de.read_integer( - _SCHEMA_SCAN_THREAT_NAME.members["ItemCount"] - ) - - case 3: - kwargs["file_paths"] = _deserialize_file_paths( - de, _SCHEMA_SCAN_THREAT_NAME.members["FilePaths"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SCAN_THREAT_NAME, consumer=_consumer) - return kwargs - - -def _serialize_scan_threat_names( - serializer: ShapeSerializer, schema: Schema, value: list[ScanThreatName] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_scan_threat_names( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ScanThreatName]: - result: list[ScanThreatName] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ScanThreatName.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ThreatDetectedByName: - """Contains details about identified threats organized by threat name.""" - - item_count: int | None = None - """Total number of infected files identified.""" - - unique_threat_name_count: int | None = None - """ - Total number of unique threats by name identified, as part of the - malware scan. - """ - - shortened: bool | None = None - """ - Flag to determine if the finding contains every single infected - file-path and/or every threat. - """ - - threat_names: list[ScanThreatName] | None = None - """List of identified threats with details, organized by threat name.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_THREAT_DETECTED_BY_NAME, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.item_count is not None: - serializer.write_integer( - _SCHEMA_THREAT_DETECTED_BY_NAME.members["ItemCount"], self.item_count - ) - - if self.unique_threat_name_count is not None: - serializer.write_integer( - _SCHEMA_THREAT_DETECTED_BY_NAME.members["UniqueThreatNameCount"], - self.unique_threat_name_count, - ) - - if self.shortened is not None: - serializer.write_boolean( - _SCHEMA_THREAT_DETECTED_BY_NAME.members["Shortened"], self.shortened - ) - - if self.threat_names is not None: - _serialize_scan_threat_names( - serializer, - _SCHEMA_THREAT_DETECTED_BY_NAME.members["ThreatNames"], - self.threat_names, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["item_count"] = de.read_integer( - _SCHEMA_THREAT_DETECTED_BY_NAME.members["ItemCount"] - ) - - case 1: - kwargs["unique_threat_name_count"] = de.read_integer( - _SCHEMA_THREAT_DETECTED_BY_NAME.members["UniqueThreatNameCount"] - ) - - case 2: - kwargs["shortened"] = de.read_boolean( - _SCHEMA_THREAT_DETECTED_BY_NAME.members["Shortened"] - ) - - case 3: - kwargs["threat_names"] = _deserialize_scan_threat_names( - de, _SCHEMA_THREAT_DETECTED_BY_NAME.members["ThreatNames"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_THREAT_DETECTED_BY_NAME, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ThreatsDetectedItemCount: - """Contains total number of infected files.""" - - files: int | None = None - """Total number of infected files.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_THREATS_DETECTED_ITEM_COUNT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.files is not None: - serializer.write_integer( - _SCHEMA_THREATS_DETECTED_ITEM_COUNT.members["Files"], self.files - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["files"] = de.read_integer( - _SCHEMA_THREATS_DETECTED_ITEM_COUNT.members["Files"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_THREATS_DETECTED_ITEM_COUNT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ScanDetections: - """Contains a complete view providing malware scan result details.""" - - scanned_item_count: ScannedItemCount | None = None - """Total number of scanned files.""" - - threats_detected_item_count: ThreatsDetectedItemCount | None = None - """Total number of infected files.""" - - highest_severity_threat_details: HighestSeverityThreatDetails | None = None - """ - Details of the highest severity threat detected during malware scan and - number of infected files. - """ - - threat_detected_by_name: ThreatDetectedByName | None = None - """Contains details about identified threats organized by threat name.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SCAN_DETECTIONS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.scanned_item_count is not None: - serializer.write_struct( - _SCHEMA_SCAN_DETECTIONS.members["ScannedItemCount"], - self.scanned_item_count, - ) - - if self.threats_detected_item_count is not None: - serializer.write_struct( - _SCHEMA_SCAN_DETECTIONS.members["ThreatsDetectedItemCount"], - self.threats_detected_item_count, - ) - - if self.highest_severity_threat_details is not None: - serializer.write_struct( - _SCHEMA_SCAN_DETECTIONS.members["HighestSeverityThreatDetails"], - self.highest_severity_threat_details, - ) - - if self.threat_detected_by_name is not None: - serializer.write_struct( - _SCHEMA_SCAN_DETECTIONS.members["ThreatDetectedByName"], - self.threat_detected_by_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["scanned_item_count"] = ScannedItemCount.deserialize(de) - - case 1: - kwargs["threats_detected_item_count"] = ( - ThreatsDetectedItemCount.deserialize(de) - ) - - case 2: - kwargs["highest_severity_threat_details"] = ( - HighestSeverityThreatDetails.deserialize(de) - ) - - case 3: - kwargs["threat_detected_by_name"] = ( - ThreatDetectedByName.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SCAN_DETECTIONS, consumer=_consumer) - return kwargs - - -def _serialize_sources( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_sources(deserializer: ShapeDeserializer, schema: Schema) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class EbsVolumeScanDetails: - """Contains details from the malware scan that created a finding.""" - - scan_id: str | None = None - """Unique Id of the malware scan that generated the finding.""" - - scan_started_at: datetime | None = None - """Returns the start date and time of the malware scan.""" - - scan_completed_at: datetime | None = None - """Returns the completion date and time of the malware scan.""" - - trigger_finding_id: str | None = None - """GuardDuty finding ID that triggered a malware scan.""" - - sources: list[str] | None = None - """Contains list of threat intelligence sources used to detect threats.""" - - scan_detections: ScanDetections | None = None - """Contains a complete view providing malware scan result details.""" - - scan_type: str | None = None - """Specifies the scan type that invoked the malware scan.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EBS_VOLUME_SCAN_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.scan_id is not None: - serializer.write_string( - _SCHEMA_EBS_VOLUME_SCAN_DETAILS.members["ScanId"], self.scan_id - ) - - if self.scan_started_at is not None: - serializer.write_timestamp( - _SCHEMA_EBS_VOLUME_SCAN_DETAILS.members["ScanStartedAt"], - self.scan_started_at, - ) - - if self.scan_completed_at is not None: - serializer.write_timestamp( - _SCHEMA_EBS_VOLUME_SCAN_DETAILS.members["ScanCompletedAt"], - self.scan_completed_at, - ) - - if self.trigger_finding_id is not None: - serializer.write_string( - _SCHEMA_EBS_VOLUME_SCAN_DETAILS.members["TriggerFindingId"], - self.trigger_finding_id, - ) - - if self.sources is not None: - _serialize_sources( - serializer, - _SCHEMA_EBS_VOLUME_SCAN_DETAILS.members["Sources"], - self.sources, - ) - - if self.scan_detections is not None: - serializer.write_struct( - _SCHEMA_EBS_VOLUME_SCAN_DETAILS.members["ScanDetections"], - self.scan_detections, - ) - - if self.scan_type is not None: - serializer.write_string( - _SCHEMA_EBS_VOLUME_SCAN_DETAILS.members["ScanType"], self.scan_type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["scan_id"] = de.read_string( - _SCHEMA_EBS_VOLUME_SCAN_DETAILS.members["ScanId"] - ) - - case 1: - kwargs["scan_started_at"] = de.read_timestamp( - _SCHEMA_EBS_VOLUME_SCAN_DETAILS.members["ScanStartedAt"] - ) - - case 2: - kwargs["scan_completed_at"] = de.read_timestamp( - _SCHEMA_EBS_VOLUME_SCAN_DETAILS.members["ScanCompletedAt"] - ) - - case 3: - kwargs["trigger_finding_id"] = de.read_string( - _SCHEMA_EBS_VOLUME_SCAN_DETAILS.members["TriggerFindingId"] - ) - - case 4: - kwargs["sources"] = _deserialize_sources( - de, _SCHEMA_EBS_VOLUME_SCAN_DETAILS.members["Sources"] - ) - - case 5: - kwargs["scan_detections"] = ScanDetections.deserialize(de) - - case 6: - kwargs["scan_type"] = ScanType( - de.read_string( - _SCHEMA_EBS_VOLUME_SCAN_DETAILS.members["ScanType"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EBS_VOLUME_SCAN_DETAILS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Ec2ImageDetails: - """Contains details about the EC2 AMI that was scanned.""" - - image_arn: str | None = None - """The Amazon Resource Name (ARN) of the EC2 AMI.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EC2_IMAGE_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.image_arn is not None: - serializer.write_string( - _SCHEMA_EC2_IMAGE_DETAILS.members["ImageArn"], self.image_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["image_arn"] = de.read_string( - _SCHEMA_EC2_IMAGE_DETAILS.members["ImageArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EC2_IMAGE_DETAILS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class HostPath: - """ - Represents a pre-existing file or directory on the host machine that the - volume maps to. - """ - - path: str | None = None - """Path of the file or directory on the host that the volume maps to.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HOST_PATH, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.path is not None: - serializer.write_string(_SCHEMA_HOST_PATH.members["Path"], self.path) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["path"] = de.read_string(_SCHEMA_HOST_PATH.members["Path"]) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_HOST_PATH, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Volume: - """Volume used by the Kubernetes workload.""" - - name: str | None = None - """Volume name.""" - - host_path: HostPath | None = None - """ - Represents a pre-existing file or directory on the host machine that the - volume maps to. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VOLUME, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string(_SCHEMA_VOLUME.members["Name"], self.name) - - if self.host_path is not None: - serializer.write_struct(_SCHEMA_VOLUME.members["HostPath"], self.host_path) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string(_SCHEMA_VOLUME.members["Name"]) - - case 1: - kwargs["host_path"] = HostPath.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VOLUME, consumer=_consumer) - return kwargs - - -def _serialize_volumes( - serializer: ShapeSerializer, schema: Schema, value: list[Volume] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_volumes( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Volume]: - result: list[Volume] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Volume.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class EcsTaskDetails: - """Contains information about the task in an ECS cluster.""" - - arn: str | None = None - """The Amazon Resource Name (ARN) of the task.""" - - definition_arn: str | None = None - """The ARN of the task definition that creates the task.""" - - version: str | None = None - """The version counter for the task.""" - - task_created_at: datetime | None = None - """The Unix timestamp for the time when the task was created.""" - - started_at: datetime | None = None - """The Unix timestamp for the time when the task started.""" - - started_by: str | None = None - """Contains the tag specified when a task is started.""" - - tags: list[Tag] | None = None - """The tags of the ECS Task.""" - - volumes: list[Volume] | None = None - """The list of data volume definitions for the task.""" - - containers: list[Container] | None = None - """The containers that's associated with the task.""" - - group: str | None = None - """The name of the task group that's associated with the task.""" - - launch_type: str | None = None - """ - A capacity on which the task is running. For example, `Fargate` and - `EC2`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ECS_TASK_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.arn is not None: - serializer.write_string(_SCHEMA_ECS_TASK_DETAILS.members["Arn"], self.arn) - - if self.definition_arn is not None: - serializer.write_string( - _SCHEMA_ECS_TASK_DETAILS.members["DefinitionArn"], self.definition_arn - ) - - if self.version is not None: - serializer.write_string( - _SCHEMA_ECS_TASK_DETAILS.members["Version"], self.version - ) - - if self.task_created_at is not None: - serializer.write_timestamp( - _SCHEMA_ECS_TASK_DETAILS.members["TaskCreatedAt"], self.task_created_at - ) - - if self.started_at is not None: - serializer.write_timestamp( - _SCHEMA_ECS_TASK_DETAILS.members["StartedAt"], self.started_at - ) - - if self.started_by is not None: - serializer.write_string( - _SCHEMA_ECS_TASK_DETAILS.members["StartedBy"], self.started_by - ) - - if self.tags is not None: - _serialize_tags( - serializer, _SCHEMA_ECS_TASK_DETAILS.members["Tags"], self.tags - ) - - if self.volumes is not None: - _serialize_volumes( - serializer, _SCHEMA_ECS_TASK_DETAILS.members["Volumes"], self.volumes - ) - - if self.containers is not None: - _serialize_containers( - serializer, - _SCHEMA_ECS_TASK_DETAILS.members["Containers"], - self.containers, - ) - - if self.group is not None: - serializer.write_string( - _SCHEMA_ECS_TASK_DETAILS.members["Group"], self.group - ) - - if self.launch_type is not None: - serializer.write_string( - _SCHEMA_ECS_TASK_DETAILS.members["LaunchType"], self.launch_type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["arn"] = de.read_string( - _SCHEMA_ECS_TASK_DETAILS.members["Arn"] - ) - - case 1: - kwargs["definition_arn"] = de.read_string( - _SCHEMA_ECS_TASK_DETAILS.members["DefinitionArn"] - ) - - case 2: - kwargs["version"] = de.read_string( - _SCHEMA_ECS_TASK_DETAILS.members["Version"] - ) - - case 3: - kwargs["task_created_at"] = de.read_timestamp( - _SCHEMA_ECS_TASK_DETAILS.members["TaskCreatedAt"] - ) - - case 4: - kwargs["started_at"] = de.read_timestamp( - _SCHEMA_ECS_TASK_DETAILS.members["StartedAt"] - ) - - case 5: - kwargs["started_by"] = de.read_string( - _SCHEMA_ECS_TASK_DETAILS.members["StartedBy"] - ) - - case 6: - kwargs["tags"] = _deserialize_tags( - de, _SCHEMA_ECS_TASK_DETAILS.members["Tags"] - ) - - case 7: - kwargs["volumes"] = _deserialize_volumes( - de, _SCHEMA_ECS_TASK_DETAILS.members["Volumes"] - ) - - case 8: - kwargs["containers"] = _deserialize_containers( - de, _SCHEMA_ECS_TASK_DETAILS.members["Containers"] - ) - - case 9: - kwargs["group"] = de.read_string( - _SCHEMA_ECS_TASK_DETAILS.members["Group"] - ) - - case 10: - kwargs["launch_type"] = de.read_string( - _SCHEMA_ECS_TASK_DETAILS.members["LaunchType"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ECS_TASK_DETAILS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class EcsClusterDetails: - """Contains information about the details of the ECS Cluster.""" - - name: str | None = None - """The name of the ECS Cluster.""" - - arn: str | None = None - """The Amazon Resource Name (ARN) that identifies the cluster.""" - - status: str | None = None - """The status of the ECS cluster.""" - - active_services_count: int | None = None - """ - The number of services that are running on the cluster in an ACTIVE - state. - """ - - registered_container_instances_count: int | None = None - """The number of container instances registered into the cluster.""" - - running_tasks_count: int | None = None - """The number of tasks in the cluster that are in the RUNNING state.""" - - tags: list[Tag] | None = None - """The tags of the ECS Cluster.""" - - task_details: EcsTaskDetails | None = None - """Contains information about the details of the ECS Task.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ECS_CLUSTER_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_ECS_CLUSTER_DETAILS.members["Name"], self.name - ) - - if self.arn is not None: - serializer.write_string( - _SCHEMA_ECS_CLUSTER_DETAILS.members["Arn"], self.arn - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_ECS_CLUSTER_DETAILS.members["Status"], self.status - ) - - if self.active_services_count is not None: - serializer.write_integer( - _SCHEMA_ECS_CLUSTER_DETAILS.members["ActiveServicesCount"], - self.active_services_count, - ) - - if self.registered_container_instances_count is not None: - serializer.write_integer( - _SCHEMA_ECS_CLUSTER_DETAILS.members[ - "RegisteredContainerInstancesCount" - ], - self.registered_container_instances_count, - ) - - if self.running_tasks_count is not None: - serializer.write_integer( - _SCHEMA_ECS_CLUSTER_DETAILS.members["RunningTasksCount"], - self.running_tasks_count, - ) - - if self.tags is not None: - _serialize_tags( - serializer, _SCHEMA_ECS_CLUSTER_DETAILS.members["Tags"], self.tags - ) - - if self.task_details is not None: - serializer.write_struct( - _SCHEMA_ECS_CLUSTER_DETAILS.members["TaskDetails"], self.task_details - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_ECS_CLUSTER_DETAILS.members["Name"] - ) - - case 1: - kwargs["arn"] = de.read_string( - _SCHEMA_ECS_CLUSTER_DETAILS.members["Arn"] - ) - - case 2: - kwargs["status"] = de.read_string( - _SCHEMA_ECS_CLUSTER_DETAILS.members["Status"] - ) - - case 3: - kwargs["active_services_count"] = de.read_integer( - _SCHEMA_ECS_CLUSTER_DETAILS.members["ActiveServicesCount"] - ) - - case 4: - kwargs["registered_container_instances_count"] = de.read_integer( - _SCHEMA_ECS_CLUSTER_DETAILS.members[ - "RegisteredContainerInstancesCount" - ] - ) - - case 5: - kwargs["running_tasks_count"] = de.read_integer( - _SCHEMA_ECS_CLUSTER_DETAILS.members["RunningTasksCount"] - ) - - case 6: - kwargs["tags"] = _deserialize_tags( - de, _SCHEMA_ECS_CLUSTER_DETAILS.members["Tags"] - ) - - case 7: - kwargs["task_details"] = EcsTaskDetails.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ECS_CLUSTER_DETAILS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class EksClusterDetails: - """Details about the EKS cluster involved in a Kubernetes finding.""" - - name: str | None = None - """EKS cluster name.""" - - arn: str | None = None - """EKS cluster ARN.""" - - vpc_id: str | None = None - """The VPC ID to which the EKS cluster is attached.""" - - status: str | None = None - """The EKS cluster status.""" - - tags: list[Tag] | None = None - """The EKS cluster tags.""" - - created_at: datetime | None = None - """The timestamp when the EKS cluster was created.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EKS_CLUSTER_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_EKS_CLUSTER_DETAILS.members["Name"], self.name - ) - - if self.arn is not None: - serializer.write_string( - _SCHEMA_EKS_CLUSTER_DETAILS.members["Arn"], self.arn - ) - - if self.vpc_id is not None: - serializer.write_string( - _SCHEMA_EKS_CLUSTER_DETAILS.members["VpcId"], self.vpc_id - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_EKS_CLUSTER_DETAILS.members["Status"], self.status - ) - - if self.tags is not None: - _serialize_tags( - serializer, _SCHEMA_EKS_CLUSTER_DETAILS.members["Tags"], self.tags - ) - - if self.created_at is not None: - serializer.write_timestamp( - _SCHEMA_EKS_CLUSTER_DETAILS.members["CreatedAt"], self.created_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_EKS_CLUSTER_DETAILS.members["Name"] - ) - - case 1: - kwargs["arn"] = de.read_string( - _SCHEMA_EKS_CLUSTER_DETAILS.members["Arn"] - ) - - case 2: - kwargs["vpc_id"] = de.read_string( - _SCHEMA_EKS_CLUSTER_DETAILS.members["VpcId"] - ) - - case 3: - kwargs["status"] = de.read_string( - _SCHEMA_EKS_CLUSTER_DETAILS.members["Status"] - ) - - case 4: - kwargs["tags"] = _deserialize_tags( - de, _SCHEMA_EKS_CLUSTER_DETAILS.members["Tags"] - ) - - case 5: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_EKS_CLUSTER_DETAILS.members["CreatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EKS_CLUSTER_DETAILS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class EnableOrganizationAdminAccountInput: - """Dataclass for EnableOrganizationAdminAccountInput structure.""" - - admin_account_id: str | None = None - """ - The Amazon Web Services account ID for the organization account to be - enabled as a GuardDuty delegated administrator. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ENABLE_ORGANIZATION_ADMIN_ACCOUNT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.admin_account_id is not None: - serializer.write_string( - _SCHEMA_ENABLE_ORGANIZATION_ADMIN_ACCOUNT_INPUT.members[ - "AdminAccountId" - ], - self.admin_account_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["admin_account_id"] = de.read_string( - _SCHEMA_ENABLE_ORGANIZATION_ADMIN_ACCOUNT_INPUT.members[ - "AdminAccountId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ENABLE_ORGANIZATION_ADMIN_ACCOUNT_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class EnableOrganizationAdminAccountOutput: - """Dataclass for EnableOrganizationAdminAccountOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ENABLE_ORGANIZATION_ADMIN_ACCOUNT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ENABLE_ORGANIZATION_ADMIN_ACCOUNT_OUTPUT, consumer=_consumer - ) - return kwargs - - -ENABLE_ORGANIZATION_ADMIN_ACCOUNT = APIOperation( - input=EnableOrganizationAdminAccountInput, - output=EnableOrganizationAdminAccountOutput, - schema=_SCHEMA_ENABLE_ORGANIZATION_ADMIN_ACCOUNT, - input_schema=_SCHEMA_ENABLE_ORGANIZATION_ADMIN_ACCOUNT_INPUT, - output_schema=_SCHEMA_ENABLE_ORGANIZATION_ADMIN_ACCOUNT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -def _serialize_threat_names( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_threat_names( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ThreatIntelligenceDetail: - """ - An instance of a threat intelligence detail that constitutes evidence - for the finding. - """ - - threat_list_name: str | None = None - """The name of the threat intelligence list that triggered the finding.""" - - threat_names: list[str] | None = None - """ - A list of names of the threats in the threat intelligence list that - triggered the finding. - """ - - threat_file_sha256: str | None = None - """SHA256 of the file that generated the finding.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_THREAT_INTELLIGENCE_DETAIL, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.threat_list_name is not None: - serializer.write_string( - _SCHEMA_THREAT_INTELLIGENCE_DETAIL.members["ThreatListName"], - self.threat_list_name, - ) - - if self.threat_names is not None: - _serialize_threat_names( - serializer, - _SCHEMA_THREAT_INTELLIGENCE_DETAIL.members["ThreatNames"], - self.threat_names, - ) - - if self.threat_file_sha256 is not None: - serializer.write_string( - _SCHEMA_THREAT_INTELLIGENCE_DETAIL.members["ThreatFileSha256"], - self.threat_file_sha256, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["threat_list_name"] = de.read_string( - _SCHEMA_THREAT_INTELLIGENCE_DETAIL.members["ThreatListName"] - ) - - case 1: - kwargs["threat_names"] = _deserialize_threat_names( - de, _SCHEMA_THREAT_INTELLIGENCE_DETAIL.members["ThreatNames"] - ) - - case 2: - kwargs["threat_file_sha256"] = de.read_string( - _SCHEMA_THREAT_INTELLIGENCE_DETAIL.members["ThreatFileSha256"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_THREAT_INTELLIGENCE_DETAIL, consumer=_consumer) - return kwargs - - -def _serialize_threat_intelligence_details( - serializer: ShapeSerializer, schema: Schema, value: list[ThreatIntelligenceDetail] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_threat_intelligence_details( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ThreatIntelligenceDetail]: - result: list[ThreatIntelligenceDetail] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ThreatIntelligenceDetail.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class Evidence: - """Contains information about the reason that the finding was generated.""" - - threat_intelligence_details: list[ThreatIntelligenceDetail] | None = None - """A list of threat intelligence details related to the evidence.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVIDENCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.threat_intelligence_details is not None: - _serialize_threat_intelligence_details( - serializer, - _SCHEMA_EVIDENCE.members["ThreatIntelligenceDetails"], - self.threat_intelligence_details, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["threat_intelligence_details"] = ( - _deserialize_threat_intelligence_details( - de, _SCHEMA_EVIDENCE.members["ThreatIntelligenceDetails"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EVIDENCE, consumer=_consumer) - return kwargs - - -class Feedback(UnknownEnumMixin, StrEnum): - USEFUL = "USEFUL" - NOT_USEFUL = "NOT_USEFUL" - - -def _serialize_filter_names( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_filter_names( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class NetworkInterface: - """ - Contains information about the elastic network interface of the EC2 - instance. - """ - - ipv6_addresses: list[str] | None = None - """A list of IPv6 addresses for the EC2 instance.""" - - network_interface_id: str | None = None - """The ID of the network interface.""" - - private_dns_name: str | None = None - """The private DNS name of the EC2 instance.""" - - private_ip_address: str | None = field(repr=False, default=None) - """The private IP address of the EC2 instance.""" - - private_ip_addresses: list[PrivateIpAddressDetails] | None = None - """Other private IP address information of the EC2 instance.""" - - public_dns_name: str | None = None - """The public DNS name of the EC2 instance.""" - - public_ip: str | None = None - """The public IP address of the EC2 instance.""" - - security_groups: list[SecurityGroup] | None = None - """The security groups associated with the EC2 instance.""" - - subnet_id: str | None = None - """The subnet ID of the EC2 instance.""" - - vpc_id: str | None = None - """The VPC ID of the EC2 instance.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_NETWORK_INTERFACE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.ipv6_addresses is not None: - _serialize_ipv6_addresses( - serializer, - _SCHEMA_NETWORK_INTERFACE.members["Ipv6Addresses"], - self.ipv6_addresses, - ) - - if self.network_interface_id is not None: - serializer.write_string( - _SCHEMA_NETWORK_INTERFACE.members["NetworkInterfaceId"], - self.network_interface_id, - ) - - if self.private_dns_name is not None: - serializer.write_string( - _SCHEMA_NETWORK_INTERFACE.members["PrivateDnsName"], - self.private_dns_name, - ) - - if self.private_ip_address is not None: - serializer.write_string( - _SCHEMA_NETWORK_INTERFACE.members["PrivateIpAddress"], - self.private_ip_address, - ) - - if self.private_ip_addresses is not None: - _serialize_private_ip_addresses( - serializer, - _SCHEMA_NETWORK_INTERFACE.members["PrivateIpAddresses"], - self.private_ip_addresses, - ) - - if self.public_dns_name is not None: - serializer.write_string( - _SCHEMA_NETWORK_INTERFACE.members["PublicDnsName"], self.public_dns_name - ) - - if self.public_ip is not None: - serializer.write_string( - _SCHEMA_NETWORK_INTERFACE.members["PublicIp"], self.public_ip - ) - - if self.security_groups is not None: - _serialize_security_groups( - serializer, - _SCHEMA_NETWORK_INTERFACE.members["SecurityGroups"], - self.security_groups, - ) - - if self.subnet_id is not None: - serializer.write_string( - _SCHEMA_NETWORK_INTERFACE.members["SubnetId"], self.subnet_id - ) - - if self.vpc_id is not None: - serializer.write_string( - _SCHEMA_NETWORK_INTERFACE.members["VpcId"], self.vpc_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["ipv6_addresses"] = _deserialize_ipv6_addresses( - de, _SCHEMA_NETWORK_INTERFACE.members["Ipv6Addresses"] - ) - - case 1: - kwargs["network_interface_id"] = de.read_string( - _SCHEMA_NETWORK_INTERFACE.members["NetworkInterfaceId"] - ) - - case 2: - kwargs["private_dns_name"] = de.read_string( - _SCHEMA_NETWORK_INTERFACE.members["PrivateDnsName"] - ) - - case 3: - kwargs["private_ip_address"] = de.read_string( - _SCHEMA_NETWORK_INTERFACE.members["PrivateIpAddress"] - ) - - case 4: - kwargs["private_ip_addresses"] = _deserialize_private_ip_addresses( - de, _SCHEMA_NETWORK_INTERFACE.members["PrivateIpAddresses"] - ) - - case 5: - kwargs["public_dns_name"] = de.read_string( - _SCHEMA_NETWORK_INTERFACE.members["PublicDnsName"] - ) - - case 6: - kwargs["public_ip"] = de.read_string( - _SCHEMA_NETWORK_INTERFACE.members["PublicIp"] - ) - - case 7: - kwargs["security_groups"] = _deserialize_security_groups( - de, _SCHEMA_NETWORK_INTERFACE.members["SecurityGroups"] - ) - - case 8: - kwargs["subnet_id"] = de.read_string( - _SCHEMA_NETWORK_INTERFACE.members["SubnetId"] - ) - - case 9: - kwargs["vpc_id"] = de.read_string( - _SCHEMA_NETWORK_INTERFACE.members["VpcId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_NETWORK_INTERFACE, consumer=_consumer) - return kwargs - - -def _serialize_network_interfaces( - serializer: ShapeSerializer, schema: Schema, value: list[NetworkInterface] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_network_interfaces( - deserializer: ShapeDeserializer, schema: Schema -) -> list[NetworkInterface]: - result: list[NetworkInterface] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(NetworkInterface.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class InstanceDetails: - """Contains information about the details of an instance.""" - - availability_zone: str | None = None - """The Availability Zone of the EC2 instance.""" - - iam_instance_profile: IamInstanceProfile | None = None - """The profile information of the EC2 instance.""" - - image_description: str | None = None - """The image description of the EC2 instance.""" - - image_id: str | None = None - """The image ID of the EC2 instance.""" - - instance_id: str | None = None - """The ID of the EC2 instance.""" - - instance_state: str | None = None - """The state of the EC2 instance.""" - - instance_type: str | None = None - """The type of the EC2 instance.""" - - outpost_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the Amazon Web Services Outpost. Only - applicable to Amazon Web Services Outposts instances. - """ - - launch_time: str | None = None - """The launch time of the EC2 instance.""" - - network_interfaces: list[NetworkInterface] | None = None - """The elastic network interface information of the EC2 instance.""" - - platform: str | None = None - """The platform of the EC2 instance.""" - - product_codes: list[ProductCode] | None = None - """The product code of the EC2 instance.""" - - tags: list[Tag] | None = None - """The tags of the EC2 instance.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INSTANCE_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.availability_zone is not None: - serializer.write_string( - _SCHEMA_INSTANCE_DETAILS.members["AvailabilityZone"], - self.availability_zone, - ) - - if self.iam_instance_profile is not None: - serializer.write_struct( - _SCHEMA_INSTANCE_DETAILS.members["IamInstanceProfile"], - self.iam_instance_profile, - ) - - if self.image_description is not None: - serializer.write_string( - _SCHEMA_INSTANCE_DETAILS.members["ImageDescription"], - self.image_description, - ) - - if self.image_id is not None: - serializer.write_string( - _SCHEMA_INSTANCE_DETAILS.members["ImageId"], self.image_id - ) - - if self.instance_id is not None: - serializer.write_string( - _SCHEMA_INSTANCE_DETAILS.members["InstanceId"], self.instance_id - ) - - if self.instance_state is not None: - serializer.write_string( - _SCHEMA_INSTANCE_DETAILS.members["InstanceState"], self.instance_state - ) - - if self.instance_type is not None: - serializer.write_string( - _SCHEMA_INSTANCE_DETAILS.members["InstanceType"], self.instance_type - ) - - if self.outpost_arn is not None: - serializer.write_string( - _SCHEMA_INSTANCE_DETAILS.members["OutpostArn"], self.outpost_arn - ) - - if self.launch_time is not None: - serializer.write_string( - _SCHEMA_INSTANCE_DETAILS.members["LaunchTime"], self.launch_time - ) - - if self.network_interfaces is not None: - _serialize_network_interfaces( - serializer, - _SCHEMA_INSTANCE_DETAILS.members["NetworkInterfaces"], - self.network_interfaces, - ) - - if self.platform is not None: - serializer.write_string( - _SCHEMA_INSTANCE_DETAILS.members["Platform"], self.platform - ) - - if self.product_codes is not None: - _serialize_product_codes( - serializer, - _SCHEMA_INSTANCE_DETAILS.members["ProductCodes"], - self.product_codes, - ) - - if self.tags is not None: - _serialize_tags( - serializer, _SCHEMA_INSTANCE_DETAILS.members["Tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["availability_zone"] = de.read_string( - _SCHEMA_INSTANCE_DETAILS.members["AvailabilityZone"] - ) - - case 1: - kwargs["iam_instance_profile"] = IamInstanceProfile.deserialize(de) - - case 2: - kwargs["image_description"] = de.read_string( - _SCHEMA_INSTANCE_DETAILS.members["ImageDescription"] - ) - - case 3: - kwargs["image_id"] = de.read_string( - _SCHEMA_INSTANCE_DETAILS.members["ImageId"] - ) - - case 4: - kwargs["instance_id"] = de.read_string( - _SCHEMA_INSTANCE_DETAILS.members["InstanceId"] - ) - - case 5: - kwargs["instance_state"] = de.read_string( - _SCHEMA_INSTANCE_DETAILS.members["InstanceState"] - ) - - case 6: - kwargs["instance_type"] = de.read_string( - _SCHEMA_INSTANCE_DETAILS.members["InstanceType"] - ) - - case 7: - kwargs["outpost_arn"] = de.read_string( - _SCHEMA_INSTANCE_DETAILS.members["OutpostArn"] - ) - - case 8: - kwargs["launch_time"] = de.read_string( - _SCHEMA_INSTANCE_DETAILS.members["LaunchTime"] - ) - - case 9: - kwargs["network_interfaces"] = _deserialize_network_interfaces( - de, _SCHEMA_INSTANCE_DETAILS.members["NetworkInterfaces"] - ) - - case 10: - kwargs["platform"] = de.read_string( - _SCHEMA_INSTANCE_DETAILS.members["Platform"] - ) - - case 11: - kwargs["product_codes"] = _deserialize_product_codes( - de, _SCHEMA_INSTANCE_DETAILS.members["ProductCodes"] - ) - - case 12: - kwargs["tags"] = _deserialize_tags( - de, _SCHEMA_INSTANCE_DETAILS.members["Tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INSTANCE_DETAILS, consumer=_consumer) - return kwargs - - -def _serialize_groups( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_groups(deserializer: ShapeDeserializer, schema: Schema) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ImpersonatedUser: - """Contains information about the impersonated user.""" - - username: str | None = None - """Information about the `username` that was being impersonated.""" - - groups: list[str] | None = None - """The `group` to which the user name belongs.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IMPERSONATED_USER, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.username is not None: - serializer.write_string( - _SCHEMA_IMPERSONATED_USER.members["Username"], self.username - ) - - if self.groups is not None: - _serialize_groups( - serializer, _SCHEMA_IMPERSONATED_USER.members["Groups"], self.groups - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["username"] = de.read_string( - _SCHEMA_IMPERSONATED_USER.members["Username"] - ) - - case 1: - kwargs["groups"] = _deserialize_groups( - de, _SCHEMA_IMPERSONATED_USER.members["Groups"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_IMPERSONATED_USER, consumer=_consumer) - return kwargs - - -def _serialize_session_name_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_session_name_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class KubernetesUserDetails: - """Details about the Kubernetes user involved in a Kubernetes finding.""" - - username: str | None = None - """The username of the user who called the Kubernetes API.""" - - uid: str | None = None - """The user ID of the user who called the Kubernetes API.""" - - groups: list[str] | None = None - """The groups that include the user who called the Kubernetes API.""" - - session_name: list[str] | None = None - """ - Entity that assumes the IAM role when Kubernetes RBAC permissions are - assigned to that role. - """ - - impersonated_user: ImpersonatedUser | None = None - """Information about the impersonated user.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KUBERNETES_USER_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.username is not None: - serializer.write_string( - _SCHEMA_KUBERNETES_USER_DETAILS.members["Username"], self.username - ) - - if self.uid is not None: - serializer.write_string( - _SCHEMA_KUBERNETES_USER_DETAILS.members["Uid"], self.uid - ) - - if self.groups is not None: - _serialize_groups( - serializer, - _SCHEMA_KUBERNETES_USER_DETAILS.members["Groups"], - self.groups, - ) - - if self.session_name is not None: - _serialize_session_name_list( - serializer, - _SCHEMA_KUBERNETES_USER_DETAILS.members["SessionName"], - self.session_name, - ) - - if self.impersonated_user is not None: - serializer.write_struct( - _SCHEMA_KUBERNETES_USER_DETAILS.members["ImpersonatedUser"], - self.impersonated_user, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["username"] = de.read_string( - _SCHEMA_KUBERNETES_USER_DETAILS.members["Username"] - ) - - case 1: - kwargs["uid"] = de.read_string( - _SCHEMA_KUBERNETES_USER_DETAILS.members["Uid"] - ) - - case 2: - kwargs["groups"] = _deserialize_groups( - de, _SCHEMA_KUBERNETES_USER_DETAILS.members["Groups"] - ) - - case 3: - kwargs["session_name"] = _deserialize_session_name_list( - de, _SCHEMA_KUBERNETES_USER_DETAILS.members["SessionName"] - ) - - case 4: - kwargs["impersonated_user"] = ImpersonatedUser.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_KUBERNETES_USER_DETAILS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class KubernetesWorkloadDetails: - """Details about the Kubernetes workload involved in a Kubernetes finding.""" - - name: str | None = None - """Kubernetes workload name.""" - - type: str | None = None - """Kubernetes workload type (e.g. Pod, Deployment, etc.).""" - - uid: str | None = None - """Kubernetes workload ID.""" - - namespace: str | None = None - """Kubernetes namespace that the workload is part of.""" - - host_network: bool | None = None - """ - Whether the hostNetwork flag is enabled for the pods included in the - workload. - """ - - service_account_name: str | None = None - """The service account name that is associated with a Kubernetes workload.""" - - containers: list[Container] | None = None - """Containers running as part of the Kubernetes workload.""" - - volumes: list[Volume] | None = None - """Volumes used by the Kubernetes workload.""" - - host_ipc: bool | None = None - """Whether the host IPC flag is enabled for the pods in the workload.""" - - host_pid: bool | None = None - """Whether the host PID flag is enabled for the pods in the workload.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KUBERNETES_WORKLOAD_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_KUBERNETES_WORKLOAD_DETAILS.members["Name"], self.name - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_KUBERNETES_WORKLOAD_DETAILS.members["Type"], self.type - ) - - if self.uid is not None: - serializer.write_string( - _SCHEMA_KUBERNETES_WORKLOAD_DETAILS.members["Uid"], self.uid - ) - - if self.namespace is not None: - serializer.write_string( - _SCHEMA_KUBERNETES_WORKLOAD_DETAILS.members["Namespace"], self.namespace - ) - - if self.host_network is not None: - serializer.write_boolean( - _SCHEMA_KUBERNETES_WORKLOAD_DETAILS.members["HostNetwork"], - self.host_network, - ) - - if self.service_account_name is not None: - serializer.write_string( - _SCHEMA_KUBERNETES_WORKLOAD_DETAILS.members["ServiceAccountName"], - self.service_account_name, - ) - - if self.containers is not None: - _serialize_containers( - serializer, - _SCHEMA_KUBERNETES_WORKLOAD_DETAILS.members["Containers"], - self.containers, - ) - - if self.volumes is not None: - _serialize_volumes( - serializer, - _SCHEMA_KUBERNETES_WORKLOAD_DETAILS.members["Volumes"], - self.volumes, - ) - - if self.host_ipc is not None: - serializer.write_boolean( - _SCHEMA_KUBERNETES_WORKLOAD_DETAILS.members["HostIPC"], self.host_ipc - ) - - if self.host_pid is not None: - serializer.write_boolean( - _SCHEMA_KUBERNETES_WORKLOAD_DETAILS.members["HostPID"], self.host_pid - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_KUBERNETES_WORKLOAD_DETAILS.members["Name"] - ) - - case 1: - kwargs["type"] = de.read_string( - _SCHEMA_KUBERNETES_WORKLOAD_DETAILS.members["Type"] - ) - - case 2: - kwargs["uid"] = de.read_string( - _SCHEMA_KUBERNETES_WORKLOAD_DETAILS.members["Uid"] - ) - - case 3: - kwargs["namespace"] = de.read_string( - _SCHEMA_KUBERNETES_WORKLOAD_DETAILS.members["Namespace"] - ) - - case 4: - kwargs["host_network"] = de.read_boolean( - _SCHEMA_KUBERNETES_WORKLOAD_DETAILS.members["HostNetwork"] - ) - - case 5: - kwargs["service_account_name"] = de.read_string( - _SCHEMA_KUBERNETES_WORKLOAD_DETAILS.members[ - "ServiceAccountName" - ] - ) - - case 6: - kwargs["containers"] = _deserialize_containers( - de, _SCHEMA_KUBERNETES_WORKLOAD_DETAILS.members["Containers"] - ) - - case 7: - kwargs["volumes"] = _deserialize_volumes( - de, _SCHEMA_KUBERNETES_WORKLOAD_DETAILS.members["Volumes"] - ) - - case 8: - kwargs["host_ipc"] = de.read_boolean( - _SCHEMA_KUBERNETES_WORKLOAD_DETAILS.members["HostIPC"] - ) - - case 9: - kwargs["host_pid"] = de.read_boolean( - _SCHEMA_KUBERNETES_WORKLOAD_DETAILS.members["HostPID"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_KUBERNETES_WORKLOAD_DETAILS, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class KubernetesDetails: - """ - Details about Kubernetes resources such as a Kubernetes user or workload - resource involved in a Kubernetes finding. - """ - - kubernetes_user_details: KubernetesUserDetails | None = None - """Details about the Kubernetes user involved in a Kubernetes finding.""" - - kubernetes_workload_details: KubernetesWorkloadDetails | None = None - """Details about the Kubernetes workload involved in a Kubernetes finding.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KUBERNETES_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.kubernetes_user_details is not None: - serializer.write_struct( - _SCHEMA_KUBERNETES_DETAILS.members["KubernetesUserDetails"], - self.kubernetes_user_details, - ) - - if self.kubernetes_workload_details is not None: - serializer.write_struct( - _SCHEMA_KUBERNETES_DETAILS.members["KubernetesWorkloadDetails"], - self.kubernetes_workload_details, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["kubernetes_user_details"] = ( - KubernetesUserDetails.deserialize(de) - ) - - case 1: - kwargs["kubernetes_workload_details"] = ( - KubernetesWorkloadDetails.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_KUBERNETES_DETAILS, consumer=_consumer) - return kwargs - - -def _serialize_subnet_ids( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_subnet_ids( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class VpcConfig: - """ - Amazon Virtual Private Cloud configuration details associated with your - Lambda function. - """ - - subnet_ids: list[str] | None = None - """ - The identifiers of the subnets that are associated with your Lambda - function. - """ - - vpc_id: str | None = None - """The identifier of the Amazon Virtual Private Cloud.""" - - security_groups: list[SecurityGroup] | None = None - """The identifier of the security group attached to the Lambda function.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VPC_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.subnet_ids is not None: - _serialize_subnet_ids( - serializer, _SCHEMA_VPC_CONFIG.members["SubnetIds"], self.subnet_ids - ) - - if self.vpc_id is not None: - serializer.write_string(_SCHEMA_VPC_CONFIG.members["VpcId"], self.vpc_id) - - if self.security_groups is not None: - _serialize_security_groups( - serializer, - _SCHEMA_VPC_CONFIG.members["SecurityGroups"], - self.security_groups, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["subnet_ids"] = _deserialize_subnet_ids( - de, _SCHEMA_VPC_CONFIG.members["SubnetIds"] - ) - - case 1: - kwargs["vpc_id"] = de.read_string( - _SCHEMA_VPC_CONFIG.members["VpcId"] - ) - - case 2: - kwargs["security_groups"] = _deserialize_security_groups( - de, _SCHEMA_VPC_CONFIG.members["SecurityGroups"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VPC_CONFIG, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class LambdaDetails: - """Information about the Lambda function involved in the finding.""" - - function_arn: str | None = None - """Amazon Resource Name (ARN) of the Lambda function.""" - - function_name: str | None = None - """Name of the Lambda function.""" - - description: str | None = None - """Description of the Lambda function.""" - - last_modified_at: datetime | None = None - """ - The timestamp when the Lambda function was last modified. This field is - in the UTC date string format `(2023-03-22T19:37:20.168Z)`. - """ - - revision_id: str | None = None - """The revision ID of the Lambda function version.""" - - function_version: str | None = None - """The version of the Lambda function.""" - - role: str | None = None - """The execution role of the Lambda function.""" - - vpc_config: VpcConfig | None = None - """ - Amazon Virtual Private Cloud configuration details associated with your - Lambda function. - """ - - tags: list[Tag] | None = None - """ - A list of tags attached to this resource, listed in the format of - `key`:`value` pair. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LAMBDA_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_arn is not None: - serializer.write_string( - _SCHEMA_LAMBDA_DETAILS.members["FunctionArn"], self.function_arn - ) - - if self.function_name is not None: - serializer.write_string( - _SCHEMA_LAMBDA_DETAILS.members["FunctionName"], self.function_name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_LAMBDA_DETAILS.members["Description"], self.description - ) - - if self.last_modified_at is not None: - serializer.write_timestamp( - _SCHEMA_LAMBDA_DETAILS.members["LastModifiedAt"], self.last_modified_at - ) - - if self.revision_id is not None: - serializer.write_string( - _SCHEMA_LAMBDA_DETAILS.members["RevisionId"], self.revision_id - ) - - if self.function_version is not None: - serializer.write_string( - _SCHEMA_LAMBDA_DETAILS.members["FunctionVersion"], self.function_version - ) - - if self.role is not None: - serializer.write_string(_SCHEMA_LAMBDA_DETAILS.members["Role"], self.role) - - if self.vpc_config is not None: - serializer.write_struct( - _SCHEMA_LAMBDA_DETAILS.members["VpcConfig"], self.vpc_config - ) - - if self.tags is not None: - _serialize_tags( - serializer, _SCHEMA_LAMBDA_DETAILS.members["Tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_arn"] = de.read_string( - _SCHEMA_LAMBDA_DETAILS.members["FunctionArn"] - ) - - case 1: - kwargs["function_name"] = de.read_string( - _SCHEMA_LAMBDA_DETAILS.members["FunctionName"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_LAMBDA_DETAILS.members["Description"] - ) - - case 3: - kwargs["last_modified_at"] = de.read_timestamp( - _SCHEMA_LAMBDA_DETAILS.members["LastModifiedAt"] - ) - - case 4: - kwargs["revision_id"] = de.read_string( - _SCHEMA_LAMBDA_DETAILS.members["RevisionId"] - ) - - case 5: - kwargs["function_version"] = de.read_string( - _SCHEMA_LAMBDA_DETAILS.members["FunctionVersion"] - ) - - case 6: - kwargs["role"] = de.read_string( - _SCHEMA_LAMBDA_DETAILS.members["Role"] - ) - - case 7: - kwargs["vpc_config"] = VpcConfig.deserialize(de) - - case 8: - kwargs["tags"] = _deserialize_tags( - de, _SCHEMA_LAMBDA_DETAILS.members["Tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LAMBDA_DETAILS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ModelDetail: - """Contains information about the AI model involved in a finding.""" - - model_id: str | None = None - """The identifier of the AI model.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MODEL_DETAIL, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.model_id is not None: - serializer.write_string( - _SCHEMA_MODEL_DETAIL.members["ModelId"], self.model_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["model_id"] = de.read_string( - _SCHEMA_MODEL_DETAIL.members["ModelId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MODEL_DETAIL, consumer=_consumer) - return kwargs - - -def _serialize_model_details( - serializer: ShapeSerializer, schema: Schema, value: list[ModelDetail] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_model_details( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ModelDetail]: - result: list[ModelDetail] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ModelDetail.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class RdsDbInstanceDetails: - """ - Contains information about the resource type `RDSDBInstance` involved in - a GuardDuty finding. - """ - - db_instance_identifier: str | None = None - """ - The identifier associated to the database instance that was involved in - the finding. - """ - - engine: str | None = None - """The database engine of the database instance involved in the finding.""" - - engine_version: str | None = None - """The version of the database engine that was involved in the finding.""" - - db_cluster_identifier: str | None = None - """ - The identifier of the database cluster that contains the database - instance ID involved in the finding. - """ - - db_instance_arn: str | None = None - """ - The Amazon Resource Name (ARN) that identifies the database instance - involved in the finding. - """ - - dbi_resource_id: str | None = None - """ - The unique ID of the database resource involved in the activity that - prompted GuardDuty to generate the finding. - """ - - tags: list[Tag] | None = None - """Information about the tag key-value pairs.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RDS_DB_INSTANCE_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.db_instance_identifier is not None: - serializer.write_string( - _SCHEMA_RDS_DB_INSTANCE_DETAILS.members["DbInstanceIdentifier"], - self.db_instance_identifier, - ) - - if self.engine is not None: - serializer.write_string( - _SCHEMA_RDS_DB_INSTANCE_DETAILS.members["Engine"], self.engine - ) - - if self.engine_version is not None: - serializer.write_string( - _SCHEMA_RDS_DB_INSTANCE_DETAILS.members["EngineVersion"], - self.engine_version, - ) - - if self.db_cluster_identifier is not None: - serializer.write_string( - _SCHEMA_RDS_DB_INSTANCE_DETAILS.members["DbClusterIdentifier"], - self.db_cluster_identifier, - ) - - if self.db_instance_arn is not None: - serializer.write_string( - _SCHEMA_RDS_DB_INSTANCE_DETAILS.members["DbInstanceArn"], - self.db_instance_arn, - ) - - if self.dbi_resource_id is not None: - serializer.write_string( - _SCHEMA_RDS_DB_INSTANCE_DETAILS.members["DbiResourceId"], - self.dbi_resource_id, - ) - - if self.tags is not None: - _serialize_tags( - serializer, _SCHEMA_RDS_DB_INSTANCE_DETAILS.members["Tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["db_instance_identifier"] = de.read_string( - _SCHEMA_RDS_DB_INSTANCE_DETAILS.members["DbInstanceIdentifier"] - ) - - case 1: - kwargs["engine"] = de.read_string( - _SCHEMA_RDS_DB_INSTANCE_DETAILS.members["Engine"] - ) - - case 2: - kwargs["engine_version"] = de.read_string( - _SCHEMA_RDS_DB_INSTANCE_DETAILS.members["EngineVersion"] - ) - - case 3: - kwargs["db_cluster_identifier"] = de.read_string( - _SCHEMA_RDS_DB_INSTANCE_DETAILS.members["DbClusterIdentifier"] - ) - - case 4: - kwargs["db_instance_arn"] = de.read_string( - _SCHEMA_RDS_DB_INSTANCE_DETAILS.members["DbInstanceArn"] - ) - - case 5: - kwargs["dbi_resource_id"] = de.read_string( - _SCHEMA_RDS_DB_INSTANCE_DETAILS.members["DbiResourceId"] - ) - - case 6: - kwargs["tags"] = _deserialize_tags( - de, _SCHEMA_RDS_DB_INSTANCE_DETAILS.members["Tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RDS_DB_INSTANCE_DETAILS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class RdsDbUserDetails: - """ - Contains information about the user and authentication details for a - database instance involved in the finding. - """ - - user: str | None = None - """The user name used in the anomalous login attempt.""" - - application: str | None = None - """The application name used in the anomalous login attempt.""" - - database: str | None = None - """ - The name of the database instance involved in the anomalous login - attempt. - """ - - ssl: str | None = None - """The version of the Secure Socket Layer (SSL) used for the network.""" - - auth_method: str | None = None - """The authentication method used by the user involved in the finding.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RDS_DB_USER_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.user is not None: - serializer.write_string( - _SCHEMA_RDS_DB_USER_DETAILS.members["User"], self.user - ) - - if self.application is not None: - serializer.write_string( - _SCHEMA_RDS_DB_USER_DETAILS.members["Application"], self.application - ) - - if self.database is not None: - serializer.write_string( - _SCHEMA_RDS_DB_USER_DETAILS.members["Database"], self.database - ) - - if self.ssl is not None: - serializer.write_string( - _SCHEMA_RDS_DB_USER_DETAILS.members["Ssl"], self.ssl - ) - - if self.auth_method is not None: - serializer.write_string( - _SCHEMA_RDS_DB_USER_DETAILS.members["AuthMethod"], self.auth_method - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["user"] = de.read_string( - _SCHEMA_RDS_DB_USER_DETAILS.members["User"] - ) - - case 1: - kwargs["application"] = de.read_string( - _SCHEMA_RDS_DB_USER_DETAILS.members["Application"] - ) - - case 2: - kwargs["database"] = de.read_string( - _SCHEMA_RDS_DB_USER_DETAILS.members["Database"] - ) - - case 3: - kwargs["ssl"] = de.read_string( - _SCHEMA_RDS_DB_USER_DETAILS.members["Ssl"] - ) - - case 4: - kwargs["auth_method"] = de.read_string( - _SCHEMA_RDS_DB_USER_DETAILS.members["AuthMethod"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RDS_DB_USER_DETAILS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class RdsLimitlessDbDetails: - """ - Contains information about the resource type `RDSLimitlessDB` that is - involved in a GuardDuty finding. - """ - - db_shard_group_identifier: str | None = None - """The name associated with the Limitless DB shard group.""" - - db_shard_group_resource_id: str | None = None - """ - The resource identifier of the DB shard group within the Limitless - Database. - """ - - db_shard_group_arn: str | None = None - """The Amazon Resource Name (ARN) that identifies the DB shard group.""" - - engine: str | None = None - """The database engine of the database instance involved in the finding.""" - - engine_version: str | None = None - """The version of the database engine.""" - - db_cluster_identifier: str | None = None - """ - The name of the database cluster that is a part of the Limitless - Database. - """ - - tags: list[Tag] | None = None - """Information about the tag key-value pair.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RDS_LIMITLESS_DB_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.db_shard_group_identifier is not None: - serializer.write_string( - _SCHEMA_RDS_LIMITLESS_DB_DETAILS.members["DbShardGroupIdentifier"], - self.db_shard_group_identifier, - ) - - if self.db_shard_group_resource_id is not None: - serializer.write_string( - _SCHEMA_RDS_LIMITLESS_DB_DETAILS.members["DbShardGroupResourceId"], - self.db_shard_group_resource_id, - ) - - if self.db_shard_group_arn is not None: - serializer.write_string( - _SCHEMA_RDS_LIMITLESS_DB_DETAILS.members["DbShardGroupArn"], - self.db_shard_group_arn, - ) - - if self.engine is not None: - serializer.write_string( - _SCHEMA_RDS_LIMITLESS_DB_DETAILS.members["Engine"], self.engine - ) - - if self.engine_version is not None: - serializer.write_string( - _SCHEMA_RDS_LIMITLESS_DB_DETAILS.members["EngineVersion"], - self.engine_version, - ) - - if self.db_cluster_identifier is not None: - serializer.write_string( - _SCHEMA_RDS_LIMITLESS_DB_DETAILS.members["DbClusterIdentifier"], - self.db_cluster_identifier, - ) - - if self.tags is not None: - _serialize_tags( - serializer, _SCHEMA_RDS_LIMITLESS_DB_DETAILS.members["Tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["db_shard_group_identifier"] = de.read_string( - _SCHEMA_RDS_LIMITLESS_DB_DETAILS.members[ - "DbShardGroupIdentifier" - ] - ) - - case 1: - kwargs["db_shard_group_resource_id"] = de.read_string( - _SCHEMA_RDS_LIMITLESS_DB_DETAILS.members[ - "DbShardGroupResourceId" - ] - ) - - case 2: - kwargs["db_shard_group_arn"] = de.read_string( - _SCHEMA_RDS_LIMITLESS_DB_DETAILS.members["DbShardGroupArn"] - ) - - case 3: - kwargs["engine"] = de.read_string( - _SCHEMA_RDS_LIMITLESS_DB_DETAILS.members["Engine"] - ) - - case 4: - kwargs["engine_version"] = de.read_string( - _SCHEMA_RDS_LIMITLESS_DB_DETAILS.members["EngineVersion"] - ) - - case 5: - kwargs["db_cluster_identifier"] = de.read_string( - _SCHEMA_RDS_LIMITLESS_DB_DETAILS.members["DbClusterIdentifier"] - ) - - case 6: - kwargs["tags"] = _deserialize_tags( - de, _SCHEMA_RDS_LIMITLESS_DB_DETAILS.members["Tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RDS_LIMITLESS_DB_DETAILS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ScanConfigurationContinuousScanDetails: - """ - Contains information about the time range within the continuous backup - in Amazon Web Services Backup that was scanned for a point-in-time - recovery resource. - """ - - end_time: datetime - """The timestamp representing the end of the time range that was scanned.""" - - start_time: datetime | None = None - """The timestamp representing the start of the time range that was scanned.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_SCAN_CONFIGURATION_CONTINUOUS_SCAN_DETAILS, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.start_time is not None: - serializer.write_timestamp( - _SCHEMA_SCAN_CONFIGURATION_CONTINUOUS_SCAN_DETAILS.members["StartTime"], - self.start_time, - ) - - serializer.write_timestamp( - _SCHEMA_SCAN_CONFIGURATION_CONTINUOUS_SCAN_DETAILS.members["EndTime"], - self.end_time, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["start_time"] = de.read_timestamp( - _SCHEMA_SCAN_CONFIGURATION_CONTINUOUS_SCAN_DETAILS.members[ - "StartTime" - ] - ) - - case 1: - kwargs["end_time"] = de.read_timestamp( - _SCHEMA_SCAN_CONFIGURATION_CONTINUOUS_SCAN_DETAILS.members[ - "EndTime" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SCAN_CONFIGURATION_CONTINUOUS_SCAN_DETAILS, consumer=_consumer - ) - if "end_time" not in kwargs: - kwargs["end_time"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -@dataclass(kw_only=True) -class RecoveryPointDetails: - """Contains details about the backup recovery point.""" - - recovery_point_arn: str | None = None - """The Amazon Resource Name (ARN) of the recovery point.""" - - backup_vault_name: str | None = None - """The name of the backup vault containing the recovery point.""" - - continuous_scan_details: ScanConfigurationContinuousScanDetails | None = None - """ - Contains information about the time range within the continuous backup - in Amazon Web Services Backup that was scanned for a point-in-time - recovery resource. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RECOVERY_POINT_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.recovery_point_arn is not None: - serializer.write_string( - _SCHEMA_RECOVERY_POINT_DETAILS.members["RecoveryPointArn"], - self.recovery_point_arn, - ) - - if self.backup_vault_name is not None: - serializer.write_string( - _SCHEMA_RECOVERY_POINT_DETAILS.members["BackupVaultName"], - self.backup_vault_name, - ) - - if self.continuous_scan_details is not None: - serializer.write_struct( - _SCHEMA_RECOVERY_POINT_DETAILS.members["ContinuousScanDetails"], - self.continuous_scan_details, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["recovery_point_arn"] = de.read_string( - _SCHEMA_RECOVERY_POINT_DETAILS.members["RecoveryPointArn"] - ) - - case 1: - kwargs["backup_vault_name"] = de.read_string( - _SCHEMA_RECOVERY_POINT_DETAILS.members["BackupVaultName"] - ) - - case 2: - kwargs["continuous_scan_details"] = ( - ScanConfigurationContinuousScanDetails.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RECOVERY_POINT_DETAILS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Owner: - """Contains information on the owner of the bucket.""" - - id: str | None = None - """ - The canonical user ID of the bucket owner. For information about - locating your canonical user ID see [Finding Your Account Canonical User - ID.](https://docs.aws.amazon.com/general/latest/gr/acct-identifiers.html#FindingCanonicalId) - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OWNER, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string(_SCHEMA_OWNER.members["Id"], self.id) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string(_SCHEMA_OWNER.members["Id"]) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_OWNER, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class PermissionConfiguration: - """ - Contains information about how permissions are configured for the S3 - bucket. - """ - - bucket_level_permissions: BucketLevelPermissions | None = None - """ - Contains information about the bucket level permissions for the S3 - bucket. - """ - - account_level_permissions: AccountLevelPermissions | None = None - """ - Contains information about the account level permissions on the S3 - bucket. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PERMISSION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.bucket_level_permissions is not None: - serializer.write_struct( - _SCHEMA_PERMISSION_CONFIGURATION.members["BucketLevelPermissions"], - self.bucket_level_permissions, - ) - - if self.account_level_permissions is not None: - serializer.write_struct( - _SCHEMA_PERMISSION_CONFIGURATION.members["AccountLevelPermissions"], - self.account_level_permissions, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bucket_level_permissions"] = ( - BucketLevelPermissions.deserialize(de) - ) - - case 1: - kwargs["account_level_permissions"] = ( - AccountLevelPermissions.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PERMISSION_CONFIGURATION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class PublicAccess: - """Describes the public access policies that apply to the S3 bucket.""" - - permission_configuration: PermissionConfiguration | None = None - """ - Contains information about how permissions are configured for the S3 - bucket. - """ - - effective_permission: str | None = None - """ - Describes the effective permission on this bucket after factoring all - attached policies. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUBLIC_ACCESS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.permission_configuration is not None: - serializer.write_struct( - _SCHEMA_PUBLIC_ACCESS.members["PermissionConfiguration"], - self.permission_configuration, - ) - - if self.effective_permission is not None: - serializer.write_string( - _SCHEMA_PUBLIC_ACCESS.members["EffectivePermission"], - self.effective_permission, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["permission_configuration"] = ( - PermissionConfiguration.deserialize(de) - ) - - case 1: - kwargs["effective_permission"] = de.read_string( - _SCHEMA_PUBLIC_ACCESS.members["EffectivePermission"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUBLIC_ACCESS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class S3ObjectDetail: - """Information about the S3 object that was scanned""" - - object_arn: str | None = None - """Amazon Resource Name (ARN) of the S3 object.""" - - key: str | None = None - """Key of the S3 object.""" - - e_tag: str | None = None - """ - The entity tag is a hash of the S3 object. The ETag reflects changes - only to the contents of an object, and not its metadata. - """ - - hash: str | None = None - """Hash of the threat detected in this finding.""" - - version_id: str | None = None - """Version ID of the object.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_S3_OBJECT_DETAIL, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.object_arn is not None: - serializer.write_string( - _SCHEMA_S3_OBJECT_DETAIL.members["ObjectArn"], self.object_arn - ) - - if self.key is not None: - serializer.write_string(_SCHEMA_S3_OBJECT_DETAIL.members["Key"], self.key) - - if self.e_tag is not None: - serializer.write_string( - _SCHEMA_S3_OBJECT_DETAIL.members["ETag"], self.e_tag - ) - - if self.hash is not None: - serializer.write_string(_SCHEMA_S3_OBJECT_DETAIL.members["Hash"], self.hash) - - if self.version_id is not None: - serializer.write_string( - _SCHEMA_S3_OBJECT_DETAIL.members["VersionId"], self.version_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["object_arn"] = de.read_string( - _SCHEMA_S3_OBJECT_DETAIL.members["ObjectArn"] - ) - - case 1: - kwargs["key"] = de.read_string( - _SCHEMA_S3_OBJECT_DETAIL.members["Key"] - ) - - case 2: - kwargs["e_tag"] = de.read_string( - _SCHEMA_S3_OBJECT_DETAIL.members["ETag"] - ) - - case 3: - kwargs["hash"] = de.read_string( - _SCHEMA_S3_OBJECT_DETAIL.members["Hash"] - ) - - case 4: - kwargs["version_id"] = de.read_string( - _SCHEMA_S3_OBJECT_DETAIL.members["VersionId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_S3_OBJECT_DETAIL, consumer=_consumer) - return kwargs - - -def _serialize_s3_object_details( - serializer: ShapeSerializer, schema: Schema, value: list[S3ObjectDetail] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_s3_object_details( - deserializer: ShapeDeserializer, schema: Schema -) -> list[S3ObjectDetail]: - result: list[S3ObjectDetail] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(S3ObjectDetail.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class S3BucketDetail: - """Contains information on the S3 bucket.""" - - arn: str | None = None - """The Amazon Resource Name (ARN) of the S3 bucket.""" - - name: str | None = None - """The name of the S3 bucket.""" - - type: str | None = None - """Describes whether the bucket is a source or destination bucket.""" - - created_at: datetime | None = None - """The date and time the bucket was created at.""" - - owner: Owner | None = None - """The owner of the S3 bucket.""" - - tags: list[Tag] | None = None - """All tags attached to the S3 bucket""" - - default_server_side_encryption: DefaultServerSideEncryption | None = None - """Describes the server side encryption method used in the S3 bucket.""" - - public_access: PublicAccess | None = None - """Describes the public access policies that apply to the S3 bucket.""" - - s3_object_details: list[S3ObjectDetail] | None = None - """Information about the S3 object that was scanned.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_S3_BUCKET_DETAIL, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.arn is not None: - serializer.write_string(_SCHEMA_S3_BUCKET_DETAIL.members["Arn"], self.arn) - - if self.name is not None: - serializer.write_string(_SCHEMA_S3_BUCKET_DETAIL.members["Name"], self.name) - - if self.type is not None: - serializer.write_string(_SCHEMA_S3_BUCKET_DETAIL.members["Type"], self.type) - - if self.created_at is not None: - serializer.write_timestamp( - _SCHEMA_S3_BUCKET_DETAIL.members["CreatedAt"], self.created_at - ) - - if self.owner is not None: - serializer.write_struct( - _SCHEMA_S3_BUCKET_DETAIL.members["Owner"], self.owner - ) - - if self.tags is not None: - _serialize_tags( - serializer, _SCHEMA_S3_BUCKET_DETAIL.members["Tags"], self.tags - ) - - if self.default_server_side_encryption is not None: - serializer.write_struct( - _SCHEMA_S3_BUCKET_DETAIL.members["DefaultServerSideEncryption"], - self.default_server_side_encryption, - ) - - if self.public_access is not None: - serializer.write_struct( - _SCHEMA_S3_BUCKET_DETAIL.members["PublicAccess"], self.public_access - ) - - if self.s3_object_details is not None: - _serialize_s3_object_details( - serializer, - _SCHEMA_S3_BUCKET_DETAIL.members["S3ObjectDetails"], - self.s3_object_details, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["arn"] = de.read_string( - _SCHEMA_S3_BUCKET_DETAIL.members["Arn"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_S3_BUCKET_DETAIL.members["Name"] - ) - - case 2: - kwargs["type"] = de.read_string( - _SCHEMA_S3_BUCKET_DETAIL.members["Type"] - ) - - case 3: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_S3_BUCKET_DETAIL.members["CreatedAt"] - ) - - case 4: - kwargs["owner"] = Owner.deserialize(de) - - case 5: - kwargs["tags"] = _deserialize_tags( - de, _SCHEMA_S3_BUCKET_DETAIL.members["Tags"] - ) - - case 6: - kwargs["default_server_side_encryption"] = ( - DefaultServerSideEncryption.deserialize(de) - ) - - case 7: - kwargs["public_access"] = PublicAccess.deserialize(de) - - case 8: - kwargs["s3_object_details"] = _deserialize_s3_object_details( - de, _SCHEMA_S3_BUCKET_DETAIL.members["S3ObjectDetails"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_S3_BUCKET_DETAIL, consumer=_consumer) - return kwargs - - -def _serialize_s3_bucket_details( - serializer: ShapeSerializer, schema: Schema, value: list[S3BucketDetail] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_s3_bucket_details( - deserializer: ShapeDeserializer, schema: Schema -) -> list[S3BucketDetail]: - result: list[S3BucketDetail] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(S3BucketDetail.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class Resource: - """ - Contains information about the Amazon Web Services resource associated - with the activity that prompted GuardDuty to generate a finding. - """ - - access_key_details: AccessKeyDetails | None = None - """ - The IAM access key details (user information) of a user that engaged in - the activity that prompted GuardDuty to generate a finding. - """ - - s3_bucket_details: list[S3BucketDetail] | None = None - """Contains information on the S3 bucket.""" - - instance_details: InstanceDetails | None = None - """ - The information about the EC2 instance associated with the activity that - prompted GuardDuty to generate a finding. - """ - - eks_cluster_details: EksClusterDetails | None = None - """Details about the EKS cluster involved in a Kubernetes finding.""" - - kubernetes_details: KubernetesDetails | None = None - """ - Details about the Kubernetes user and workload involved in a Kubernetes - finding. - """ - - resource_type: str | None = None - """The type of Amazon Web Services resource.""" - - ebs_volume_details: EbsVolumeDetails | None = None - """Contains list of scanned and skipped EBS volumes with details.""" - - ecs_cluster_details: EcsClusterDetails | None = None - """Contains information about the details of the ECS Cluster.""" - - container_details: Container | None = None - """Details of a container.""" - - lambda_details: LambdaDetails | None = None - """ - Contains information about the Lambda function that was involved in a - finding. - """ - - rds_db_instance_details: RdsDbInstanceDetails | None = None - """ - Contains information about the database instance to which an anomalous - login attempt was made. - """ - - rds_limitless_db_details: RdsLimitlessDbDetails | None = None - """ - Contains information about the RDS Limitless database that was involved - in a GuardDuty finding. - """ - - rds_db_user_details: RdsDbUserDetails | None = None - """ - Contains information about the user details through which anomalous - login attempt was made. - """ - - ebs_snapshot_details: EbsSnapshotDetails | None = None - """Contains details about the EBS snapshot that was scanned.""" - - ec2_image_details: Ec2ImageDetails | None = None - """Contains details about the EC2 image that was scanned.""" - - recovery_point_details: RecoveryPointDetails | None = None - """Contains details about the backup recovery point that was scanned.""" - - bedrock_guardrail_details: BedrockGuardrailDetails | None = None - """ - Contains information about the Bedrock guardrail that was involved in a - finding. - """ - - model_details: list[ModelDetail] | None = None - """Contains information about the AI models involved in a finding.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.access_key_details is not None: - serializer.write_struct( - _SCHEMA_RESOURCE.members["AccessKeyDetails"], self.access_key_details - ) - - if self.s3_bucket_details is not None: - _serialize_s3_bucket_details( - serializer, - _SCHEMA_RESOURCE.members["S3BucketDetails"], - self.s3_bucket_details, - ) - - if self.instance_details is not None: - serializer.write_struct( - _SCHEMA_RESOURCE.members["InstanceDetails"], self.instance_details - ) - - if self.eks_cluster_details is not None: - serializer.write_struct( - _SCHEMA_RESOURCE.members["EksClusterDetails"], self.eks_cluster_details - ) - - if self.kubernetes_details is not None: - serializer.write_struct( - _SCHEMA_RESOURCE.members["KubernetesDetails"], self.kubernetes_details - ) - - if self.resource_type is not None: - serializer.write_string( - _SCHEMA_RESOURCE.members["ResourceType"], self.resource_type - ) - - if self.ebs_volume_details is not None: - serializer.write_struct( - _SCHEMA_RESOURCE.members["EbsVolumeDetails"], self.ebs_volume_details - ) - - if self.ecs_cluster_details is not None: - serializer.write_struct( - _SCHEMA_RESOURCE.members["EcsClusterDetails"], self.ecs_cluster_details - ) - - if self.container_details is not None: - serializer.write_struct( - _SCHEMA_RESOURCE.members["ContainerDetails"], self.container_details - ) - - if self.lambda_details is not None: - serializer.write_struct( - _SCHEMA_RESOURCE.members["LambdaDetails"], self.lambda_details - ) - - if self.rds_db_instance_details is not None: - serializer.write_struct( - _SCHEMA_RESOURCE.members["RdsDbInstanceDetails"], - self.rds_db_instance_details, - ) - - if self.rds_limitless_db_details is not None: - serializer.write_struct( - _SCHEMA_RESOURCE.members["RdsLimitlessDbDetails"], - self.rds_limitless_db_details, - ) - - if self.rds_db_user_details is not None: - serializer.write_struct( - _SCHEMA_RESOURCE.members["RdsDbUserDetails"], self.rds_db_user_details - ) - - if self.ebs_snapshot_details is not None: - serializer.write_struct( - _SCHEMA_RESOURCE.members["EbsSnapshotDetails"], - self.ebs_snapshot_details, - ) - - if self.ec2_image_details is not None: - serializer.write_struct( - _SCHEMA_RESOURCE.members["Ec2ImageDetails"], self.ec2_image_details - ) - - if self.recovery_point_details is not None: - serializer.write_struct( - _SCHEMA_RESOURCE.members["RecoveryPointDetails"], - self.recovery_point_details, - ) - - if self.bedrock_guardrail_details is not None: - serializer.write_struct( - _SCHEMA_RESOURCE.members["BedrockGuardrailDetails"], - self.bedrock_guardrail_details, - ) - - if self.model_details is not None: - _serialize_model_details( - serializer, _SCHEMA_RESOURCE.members["ModelDetails"], self.model_details - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["access_key_details"] = AccessKeyDetails.deserialize(de) - - case 1: - kwargs["s3_bucket_details"] = _deserialize_s3_bucket_details( - de, _SCHEMA_RESOURCE.members["S3BucketDetails"] - ) - - case 2: - kwargs["instance_details"] = InstanceDetails.deserialize(de) - - case 3: - kwargs["eks_cluster_details"] = EksClusterDetails.deserialize(de) - - case 4: - kwargs["kubernetes_details"] = KubernetesDetails.deserialize(de) - - case 5: - kwargs["resource_type"] = de.read_string( - _SCHEMA_RESOURCE.members["ResourceType"] - ) - - case 6: - kwargs["ebs_volume_details"] = EbsVolumeDetails.deserialize(de) - - case 7: - kwargs["ecs_cluster_details"] = EcsClusterDetails.deserialize(de) - - case 8: - kwargs["container_details"] = Container.deserialize(de) - - case 9: - kwargs["lambda_details"] = LambdaDetails.deserialize(de) - - case 10: - kwargs["rds_db_instance_details"] = ( - RdsDbInstanceDetails.deserialize(de) - ) - - case 11: - kwargs["rds_limitless_db_details"] = ( - RdsLimitlessDbDetails.deserialize(de) - ) - - case 12: - kwargs["rds_db_user_details"] = RdsDbUserDetails.deserialize(de) - - case 13: - kwargs["ebs_snapshot_details"] = EbsSnapshotDetails.deserialize(de) - - case 14: - kwargs["ec2_image_details"] = Ec2ImageDetails.deserialize(de) - - case 15: - kwargs["recovery_point_details"] = RecoveryPointDetails.deserialize( - de - ) - - case 16: - kwargs["bedrock_guardrail_details"] = ( - BedrockGuardrailDetails.deserialize(de) - ) - - case 17: - kwargs["model_details"] = _deserialize_model_details( - de, _SCHEMA_RESOURCE.members["ModelDetails"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RESOURCE, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ServiceAdditionalInfo: - """Additional information about the generated finding.""" - - value: str | None = None - """This field specifies the value of the additional information.""" - - type: str | None = None - """Describes the type of the additional information.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SERVICE_ADDITIONAL_INFO, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.value is not None: - serializer.write_string( - _SCHEMA_SERVICE_ADDITIONAL_INFO.members["Value"], self.value - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_SERVICE_ADDITIONAL_INFO.members["Type"], self.type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["value"] = de.read_string( - _SCHEMA_SERVICE_ADDITIONAL_INFO.members["Value"] - ) - - case 1: - kwargs["type"] = de.read_string( - _SCHEMA_SERVICE_ADDITIONAL_INFO.members["Type"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SERVICE_ADDITIONAL_INFO, consumer=_consumer) - return kwargs - - -class ScanCategory(UnknownEnumMixin, StrEnum): - FULL_SCAN = "FULL_SCAN" - INCREMENTAL_SCAN = "INCREMENTAL_SCAN" - - -@dataclass(kw_only=True) -class IncrementalScanDetails: - """Contains information about the incremental scan configuration.""" - - baseline_resource_arn: str | None = None - """ - Amazon Resource Name (ARN) of the baseline resource used for incremental - scanning. The scan will only process changes since this baseline - resource was created. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INCREMENTAL_SCAN_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.baseline_resource_arn is not None: - serializer.write_string( - _SCHEMA_INCREMENTAL_SCAN_DETAILS.members["BaselineResourceArn"], - self.baseline_resource_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["baseline_resource_arn"] = de.read_string( - _SCHEMA_INCREMENTAL_SCAN_DETAILS.members["BaselineResourceArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INCREMENTAL_SCAN_DETAILS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class MalwareProtectionFindingsScanConfiguration: - """Contains finding configuration details about the malware scan.""" - - trigger_type: str | None = None - """The event that triggered the malware scan.""" - - incremental_scan_details: IncrementalScanDetails | None = None - """Contains information about the incremental scan configuration.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MALWARE_PROTECTION_FINDINGS_SCAN_CONFIGURATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.trigger_type is not None: - serializer.write_string( - _SCHEMA_MALWARE_PROTECTION_FINDINGS_SCAN_CONFIGURATION.members[ - "TriggerType" - ], - self.trigger_type, - ) - - if self.incremental_scan_details is not None: - serializer.write_struct( - _SCHEMA_MALWARE_PROTECTION_FINDINGS_SCAN_CONFIGURATION.members[ - "IncrementalScanDetails" - ], - self.incremental_scan_details, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["trigger_type"] = TriggerType( - de.read_string( - _SCHEMA_MALWARE_PROTECTION_FINDINGS_SCAN_CONFIGURATION.members[ - "TriggerType" - ] - ) - ) - - case 1: - kwargs["incremental_scan_details"] = ( - IncrementalScanDetails.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MALWARE_PROTECTION_FINDINGS_SCAN_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -class MalwareProtectionScanType(UnknownEnumMixin, StrEnum): - BACKUP_INITIATED = "BACKUP_INITIATED" - ON_DEMAND = "ON_DEMAND" - GUARDDUTY_INITIATED = "GUARDDUTY_INITIATED" - - -@dataclass(kw_only=True) -class ItemDetails: - """Contains detailed information about where a threat was detected.""" - - resource_arn: str | None = None - """ - Amazon Resource Name (ARN) of the resource where the threat was - detected. - """ - - item_path: str | None = None - """The path where the threat was detected.""" - - hash: str | None = None - """The hash value of the infected item.""" - - additional_info: AdditionalInfo | None = None - """Additional information about the detected threat item.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ITEM_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_ITEM_DETAILS.members["ResourceArn"], self.resource_arn - ) - - if self.item_path is not None: - serializer.write_string( - _SCHEMA_ITEM_DETAILS.members["ItemPath"], self.item_path - ) - - if self.hash is not None: - serializer.write_string(_SCHEMA_ITEM_DETAILS.members["Hash"], self.hash) - - if self.additional_info is not None: - serializer.write_struct( - _SCHEMA_ITEM_DETAILS.members["AdditionalInfo"], self.additional_info - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_ITEM_DETAILS.members["ResourceArn"] - ) - - case 1: - kwargs["item_path"] = de.read_string( - _SCHEMA_ITEM_DETAILS.members["ItemPath"] - ) - - case 2: - kwargs["hash"] = de.read_string( - _SCHEMA_ITEM_DETAILS.members["Hash"] - ) - - case 3: - kwargs["additional_info"] = AdditionalInfo.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ITEM_DETAILS, consumer=_consumer) - return kwargs - - -def _serialize_item_details_list( - serializer: ShapeSerializer, schema: Schema, value: list[ItemDetails] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_item_details_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ItemDetails]: - result: list[ItemDetails] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ItemDetails.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ItemPath: - """ - Information about the nested item path and hash of the protected - resource. - """ - - nested_item_path: str | None = None - """The nested item path where the infected file was found.""" - - hash: str | None = None - """The hash value of the infected resource.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ITEM_PATH, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.nested_item_path is not None: - serializer.write_string( - _SCHEMA_ITEM_PATH.members["NestedItemPath"], self.nested_item_path - ) - - if self.hash is not None: - serializer.write_string(_SCHEMA_ITEM_PATH.members["Hash"], self.hash) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["nested_item_path"] = de.read_string( - _SCHEMA_ITEM_PATH.members["NestedItemPath"] - ) - - case 1: - kwargs["hash"] = de.read_string(_SCHEMA_ITEM_PATH.members["Hash"]) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ITEM_PATH, consumer=_consumer) - return kwargs - - -def _serialize_item_paths( - serializer: ShapeSerializer, schema: Schema, value: list[ItemPath] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_item_paths( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ItemPath]: - result: list[ItemPath] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ItemPath.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class Threat: - """ - Information about the detected threats associated with the generated - finding. - """ - - name: str | None = None - """ - Name of the detected threat that caused GuardDuty to generate this - finding. - """ - - source: str | None = None - """Source of the threat that generated this finding.""" - - item_paths: list[ItemPath] | None = None - """ - Information about the nested item path and hash of the protected - resource. - """ - - count: int | None = None - """ - The number of occurrences of this specific threat detected during the - scan. - """ - - hash: str | None = None - """The hash identifier of the detected malware threat.""" - - item_details: list[ItemDetails] | None = None - """Detailed information about the detected malware threat.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_THREAT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string(_SCHEMA_THREAT.members["Name"], self.name) - - if self.source is not None: - serializer.write_string(_SCHEMA_THREAT.members["Source"], self.source) - - if self.item_paths is not None: - _serialize_item_paths( - serializer, _SCHEMA_THREAT.members["ItemPaths"], self.item_paths - ) - - if self.count is not None: - serializer.write_long(_SCHEMA_THREAT.members["Count"], self.count) - - if self.hash is not None: - serializer.write_string(_SCHEMA_THREAT.members["Hash"], self.hash) - - if self.item_details is not None: - _serialize_item_details_list( - serializer, _SCHEMA_THREAT.members["ItemDetails"], self.item_details - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string(_SCHEMA_THREAT.members["Name"]) - - case 1: - kwargs["source"] = de.read_string(_SCHEMA_THREAT.members["Source"]) - - case 2: - kwargs["item_paths"] = _deserialize_item_paths( - de, _SCHEMA_THREAT.members["ItemPaths"] - ) - - case 3: - kwargs["count"] = de.read_long(_SCHEMA_THREAT.members["Count"]) - - case 4: - kwargs["hash"] = de.read_string(_SCHEMA_THREAT.members["Hash"]) - - case 5: - kwargs["item_details"] = _deserialize_item_details_list( - de, _SCHEMA_THREAT.members["ItemDetails"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_THREAT, consumer=_consumer) - return kwargs - - -def _serialize_threats( - serializer: ShapeSerializer, schema: Schema, value: list[Threat] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_threats( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Threat]: - result: list[Threat] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Threat.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class MalwareScanDetails: - """Information about the malware scan that generated a GuardDuty finding.""" - - threats: list[Threat] | None = None - """ - Information about the detected threats associated with the generated - GuardDuty finding. - """ - - scan_id: str | None = None - """The unique identifier for the malware scan.""" - - scan_type: str | None = None - """The type of malware scan performed.""" - - scan_category: str | None = None - """The category of the malware scan.""" - - scan_configuration: MalwareProtectionFindingsScanConfiguration | None = None - """The configuration settings used for the malware scan.""" - - unique_threat_count: int | None = None - """The number of unique malware threats detected during the scan.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MALWARE_SCAN_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.threats is not None: - _serialize_threats( - serializer, - _SCHEMA_MALWARE_SCAN_DETAILS.members["Threats"], - self.threats, - ) - - if self.scan_id is not None: - serializer.write_string( - _SCHEMA_MALWARE_SCAN_DETAILS.members["ScanId"], self.scan_id - ) - - if self.scan_type is not None: - serializer.write_string( - _SCHEMA_MALWARE_SCAN_DETAILS.members["ScanType"], self.scan_type - ) - - if self.scan_category is not None: - serializer.write_string( - _SCHEMA_MALWARE_SCAN_DETAILS.members["ScanCategory"], self.scan_category - ) - - if self.scan_configuration is not None: - serializer.write_struct( - _SCHEMA_MALWARE_SCAN_DETAILS.members["ScanConfiguration"], - self.scan_configuration, - ) - - if self.unique_threat_count is not None: - serializer.write_integer( - _SCHEMA_MALWARE_SCAN_DETAILS.members["UniqueThreatCount"], - self.unique_threat_count, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["threats"] = _deserialize_threats( - de, _SCHEMA_MALWARE_SCAN_DETAILS.members["Threats"] - ) - - case 1: - kwargs["scan_id"] = de.read_string( - _SCHEMA_MALWARE_SCAN_DETAILS.members["ScanId"] - ) - - case 2: - kwargs["scan_type"] = MalwareProtectionScanType( - de.read_string(_SCHEMA_MALWARE_SCAN_DETAILS.members["ScanType"]) - ) - - case 3: - kwargs["scan_category"] = ScanCategory( - de.read_string( - _SCHEMA_MALWARE_SCAN_DETAILS.members["ScanCategory"] - ) - ) - - case 4: - kwargs["scan_configuration"] = ( - MalwareProtectionFindingsScanConfiguration.deserialize(de) - ) - - case 5: - kwargs["unique_threat_count"] = de.read_integer( - _SCHEMA_MALWARE_SCAN_DETAILS.members["UniqueThreatCount"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MALWARE_SCAN_DETAILS, consumer=_consumer) - return kwargs - - -def _serialize_flags_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_flags_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_memory_regions_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_memory_regions_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class LineageObject: - """Information about the runtime process details.""" - - start_time: datetime | None = None - """The time when the process started. This is in UTC format.""" - - namespace_pid: int | None = None - """The process ID of the child process.""" - - user_id: int | None = None - """The user ID of the user that executed the process.""" - - name: str | None = None - """The name of the process.""" - - pid: int | None = None - """The ID of the process.""" - - uuid: str | None = None - """The unique ID assigned to the process by GuardDuty.""" - - executable_path: str | None = None - """The absolute path of the process executable file.""" - - euid: int | None = None - """The effective user ID that was used to execute the process.""" - - parent_uuid: str | None = None - """ - The unique ID of the parent process. This ID is assigned to the parent - process by GuardDuty. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LINEAGE_OBJECT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.start_time is not None: - serializer.write_timestamp( - _SCHEMA_LINEAGE_OBJECT.members["StartTime"], self.start_time - ) - - if self.namespace_pid is not None: - serializer.write_integer( - _SCHEMA_LINEAGE_OBJECT.members["NamespacePid"], self.namespace_pid - ) - - if self.user_id is not None: - serializer.write_integer( - _SCHEMA_LINEAGE_OBJECT.members["UserId"], self.user_id - ) - - if self.name is not None: - serializer.write_string(_SCHEMA_LINEAGE_OBJECT.members["Name"], self.name) - - if self.pid is not None: - serializer.write_integer(_SCHEMA_LINEAGE_OBJECT.members["Pid"], self.pid) - - if self.uuid is not None: - serializer.write_string(_SCHEMA_LINEAGE_OBJECT.members["Uuid"], self.uuid) - - if self.executable_path is not None: - serializer.write_string( - _SCHEMA_LINEAGE_OBJECT.members["ExecutablePath"], self.executable_path - ) - - if self.euid is not None: - serializer.write_integer(_SCHEMA_LINEAGE_OBJECT.members["Euid"], self.euid) - - if self.parent_uuid is not None: - serializer.write_string( - _SCHEMA_LINEAGE_OBJECT.members["ParentUuid"], self.parent_uuid - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["start_time"] = de.read_timestamp( - _SCHEMA_LINEAGE_OBJECT.members["StartTime"] - ) - - case 1: - kwargs["namespace_pid"] = de.read_integer( - _SCHEMA_LINEAGE_OBJECT.members["NamespacePid"] - ) - - case 2: - kwargs["user_id"] = de.read_integer( - _SCHEMA_LINEAGE_OBJECT.members["UserId"] - ) - - case 3: - kwargs["name"] = de.read_string( - _SCHEMA_LINEAGE_OBJECT.members["Name"] - ) - - case 4: - kwargs["pid"] = de.read_integer( - _SCHEMA_LINEAGE_OBJECT.members["Pid"] - ) - - case 5: - kwargs["uuid"] = de.read_string( - _SCHEMA_LINEAGE_OBJECT.members["Uuid"] - ) - - case 6: - kwargs["executable_path"] = de.read_string( - _SCHEMA_LINEAGE_OBJECT.members["ExecutablePath"] - ) - - case 7: - kwargs["euid"] = de.read_integer( - _SCHEMA_LINEAGE_OBJECT.members["Euid"] - ) - - case 8: - kwargs["parent_uuid"] = de.read_string( - _SCHEMA_LINEAGE_OBJECT.members["ParentUuid"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LINEAGE_OBJECT, consumer=_consumer) - return kwargs - - -def _serialize_lineage( - serializer: ShapeSerializer, schema: Schema, value: list[LineageObject] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_lineage( - deserializer: ShapeDeserializer, schema: Schema -) -> list[LineageObject]: - result: list[LineageObject] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(LineageObject.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ProcessDetails: - """Information about the observed process.""" - - name: str | None = None - """The name of the process.""" - - executable_path: str | None = None - """The absolute path of the process executable file.""" - - executable_sha256: str | None = None - """The `SHA256` hash of the process executable.""" - - namespace_pid: int | None = None - """The ID of the child process.""" - - pwd: str | None = None - """The present working directory of the process.""" - - pid: int | None = None - """The ID of the process.""" - - start_time: datetime | None = None - """The time when the process started. This is in UTC format.""" - - uuid: str | None = None - """The unique ID assigned to the process by GuardDuty.""" - - parent_uuid: str | None = None - """ - The unique ID of the parent process. This ID is assigned to the parent - process by GuardDuty. - """ - - user: str | None = None - """The user that executed the process.""" - - user_id: int | None = None - """The unique ID of the user that executed the process.""" - - euid: int | None = None - """The effective user ID of the user that executed the process.""" - - lineage: list[LineageObject] | None = None - """Information about the process's lineage.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PROCESS_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string(_SCHEMA_PROCESS_DETAILS.members["Name"], self.name) - - if self.executable_path is not None: - serializer.write_string( - _SCHEMA_PROCESS_DETAILS.members["ExecutablePath"], self.executable_path - ) - - if self.executable_sha256 is not None: - serializer.write_string( - _SCHEMA_PROCESS_DETAILS.members["ExecutableSha256"], - self.executable_sha256, - ) - - if self.namespace_pid is not None: - serializer.write_integer( - _SCHEMA_PROCESS_DETAILS.members["NamespacePid"], self.namespace_pid - ) - - if self.pwd is not None: - serializer.write_string(_SCHEMA_PROCESS_DETAILS.members["Pwd"], self.pwd) - - if self.pid is not None: - serializer.write_integer(_SCHEMA_PROCESS_DETAILS.members["Pid"], self.pid) - - if self.start_time is not None: - serializer.write_timestamp( - _SCHEMA_PROCESS_DETAILS.members["StartTime"], self.start_time - ) - - if self.uuid is not None: - serializer.write_string(_SCHEMA_PROCESS_DETAILS.members["Uuid"], self.uuid) - - if self.parent_uuid is not None: - serializer.write_string( - _SCHEMA_PROCESS_DETAILS.members["ParentUuid"], self.parent_uuid - ) - - if self.user is not None: - serializer.write_string(_SCHEMA_PROCESS_DETAILS.members["User"], self.user) - - if self.user_id is not None: - serializer.write_integer( - _SCHEMA_PROCESS_DETAILS.members["UserId"], self.user_id - ) - - if self.euid is not None: - serializer.write_integer(_SCHEMA_PROCESS_DETAILS.members["Euid"], self.euid) - - if self.lineage is not None: - _serialize_lineage( - serializer, _SCHEMA_PROCESS_DETAILS.members["Lineage"], self.lineage - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_PROCESS_DETAILS.members["Name"] - ) - - case 1: - kwargs["executable_path"] = de.read_string( - _SCHEMA_PROCESS_DETAILS.members["ExecutablePath"] - ) - - case 2: - kwargs["executable_sha256"] = de.read_string( - _SCHEMA_PROCESS_DETAILS.members["ExecutableSha256"] - ) - - case 3: - kwargs["namespace_pid"] = de.read_integer( - _SCHEMA_PROCESS_DETAILS.members["NamespacePid"] - ) - - case 4: - kwargs["pwd"] = de.read_string( - _SCHEMA_PROCESS_DETAILS.members["Pwd"] - ) - - case 5: - kwargs["pid"] = de.read_integer( - _SCHEMA_PROCESS_DETAILS.members["Pid"] - ) - - case 6: - kwargs["start_time"] = de.read_timestamp( - _SCHEMA_PROCESS_DETAILS.members["StartTime"] - ) - - case 7: - kwargs["uuid"] = de.read_string( - _SCHEMA_PROCESS_DETAILS.members["Uuid"] - ) - - case 8: - kwargs["parent_uuid"] = de.read_string( - _SCHEMA_PROCESS_DETAILS.members["ParentUuid"] - ) - - case 9: - kwargs["user"] = de.read_string( - _SCHEMA_PROCESS_DETAILS.members["User"] - ) - - case 10: - kwargs["user_id"] = de.read_integer( - _SCHEMA_PROCESS_DETAILS.members["UserId"] - ) - - case 11: - kwargs["euid"] = de.read_integer( - _SCHEMA_PROCESS_DETAILS.members["Euid"] - ) - - case 12: - kwargs["lineage"] = _deserialize_lineage( - de, _SCHEMA_PROCESS_DETAILS.members["Lineage"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PROCESS_DETAILS, consumer=_consumer) - return kwargs - - -def _serialize_related_file_paths_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_related_file_paths_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class RuntimeContext: - """Additional information about the suspicious activity.""" - - modifying_process: ProcessDetails | None = None - """ - Information about the process that modified the current process. This is - available for multiple finding types. - """ - - modified_at: datetime | None = None - """ - The timestamp at which the process modified the current process. The - timestamp is in UTC date string format. - """ - - script_path: str | None = None - """The path to the script that was executed.""" - - library_path: str | None = None - """The path to the new library that was loaded.""" - - ld_preload_value: str | None = None - """The value of the LD_PRELOAD environment variable.""" - - socket_path: str | None = None - """The path to the docket socket that was accessed.""" - - runc_binary_path: str | None = None - """The path to the leveraged `runc` implementation.""" - - release_agent_path: str | None = None - """The path in the container that modified the release agent file.""" - - mount_source: str | None = None - """The path on the host that is mounted by the container.""" - - mount_target: str | None = None - """The path in the container that is mapped to the host directory.""" - - file_system_type: str | None = None - """Represents the type of mounted fileSystem.""" - - flags: list[str] | None = None - """ - Represents options that control the behavior of a runtime operation or - action. For example, a filesystem mount operation may contain a - read-only flag. - """ - - module_name: str | None = None - """The name of the module loaded into the kernel.""" - - module_file_path: str | None = None - """The path to the module loaded into the kernel.""" - - module_sha256: str | None = None - """The `SHA256` hash of the module.""" - - shell_history_file_path: str | None = None - """The path to the modified shell history file.""" - - target_process: ProcessDetails | None = None - """ - Information about the process that had its memory overwritten by the - current process. - """ - - address_family: str | None = None - """ - Represents the communication protocol associated with the address. For - example, the address family `AF_INET` is used for IP version of 4 - protocol. - """ - - iana_protocol_number: int | None = None - """ - Specifies a particular protocol within the address family. Usually there - is a single protocol in address families. For example, the address - family `AF_INET` only has the IP protocol. - """ - - memory_regions: list[str] | None = None - """ - Specifies the Region of a process's address space such as stack and - heap. - """ - - tool_name: str | None = None - """Name of the potentially suspicious tool.""" - - tool_category: str | None = None - """ - Category that the tool belongs to. Some of the examples are Backdoor - Tool, Pentest Tool, Network Scanner, and Network Sniffer. - """ - - service_name: str | None = None - """Name of the security service that has been potentially disabled.""" - - command_line_example: str | None = None - """Example of the command line involved in the suspicious activity.""" - - threat_file_path: str | None = None - """ - The suspicious file path for which the threat intelligence details were - found. - """ - - file_operation: str | None = None - """ - Represents the type of file operation that triggered the finding, such - as Write, Delete, Rename, Link, or Symlink. - """ - - file_path: str | None = None - """ - The path of the sensitive file that was modified. Modification includes - write, delete, rename, link, or symlink operations. This field is - indexed for filtering. - """ - - related_file_paths: list[str] | None = None - """ - All file paths modified by the same process that triggered the finding, - up to a maximum of 25 paths. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RUNTIME_CONTEXT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.modifying_process is not None: - serializer.write_struct( - _SCHEMA_RUNTIME_CONTEXT.members["ModifyingProcess"], - self.modifying_process, - ) - - if self.modified_at is not None: - serializer.write_timestamp( - _SCHEMA_RUNTIME_CONTEXT.members["ModifiedAt"], self.modified_at - ) - - if self.script_path is not None: - serializer.write_string( - _SCHEMA_RUNTIME_CONTEXT.members["ScriptPath"], self.script_path - ) - - if self.library_path is not None: - serializer.write_string( - _SCHEMA_RUNTIME_CONTEXT.members["LibraryPath"], self.library_path - ) - - if self.ld_preload_value is not None: - serializer.write_string( - _SCHEMA_RUNTIME_CONTEXT.members["LdPreloadValue"], self.ld_preload_value - ) - - if self.socket_path is not None: - serializer.write_string( - _SCHEMA_RUNTIME_CONTEXT.members["SocketPath"], self.socket_path - ) - - if self.runc_binary_path is not None: - serializer.write_string( - _SCHEMA_RUNTIME_CONTEXT.members["RuncBinaryPath"], self.runc_binary_path - ) - - if self.release_agent_path is not None: - serializer.write_string( - _SCHEMA_RUNTIME_CONTEXT.members["ReleaseAgentPath"], - self.release_agent_path, - ) - - if self.mount_source is not None: - serializer.write_string( - _SCHEMA_RUNTIME_CONTEXT.members["MountSource"], self.mount_source - ) - - if self.mount_target is not None: - serializer.write_string( - _SCHEMA_RUNTIME_CONTEXT.members["MountTarget"], self.mount_target - ) - - if self.file_system_type is not None: - serializer.write_string( - _SCHEMA_RUNTIME_CONTEXT.members["FileSystemType"], self.file_system_type - ) - - if self.flags is not None: - _serialize_flags_list( - serializer, _SCHEMA_RUNTIME_CONTEXT.members["Flags"], self.flags - ) - - if self.module_name is not None: - serializer.write_string( - _SCHEMA_RUNTIME_CONTEXT.members["ModuleName"], self.module_name - ) - - if self.module_file_path is not None: - serializer.write_string( - _SCHEMA_RUNTIME_CONTEXT.members["ModuleFilePath"], self.module_file_path - ) - - if self.module_sha256 is not None: - serializer.write_string( - _SCHEMA_RUNTIME_CONTEXT.members["ModuleSha256"], self.module_sha256 - ) - - if self.shell_history_file_path is not None: - serializer.write_string( - _SCHEMA_RUNTIME_CONTEXT.members["ShellHistoryFilePath"], - self.shell_history_file_path, - ) - - if self.target_process is not None: - serializer.write_struct( - _SCHEMA_RUNTIME_CONTEXT.members["TargetProcess"], self.target_process - ) - - if self.address_family is not None: - serializer.write_string( - _SCHEMA_RUNTIME_CONTEXT.members["AddressFamily"], self.address_family - ) - - if self.iana_protocol_number is not None: - serializer.write_integer( - _SCHEMA_RUNTIME_CONTEXT.members["IanaProtocolNumber"], - self.iana_protocol_number, - ) - - if self.memory_regions is not None: - _serialize_memory_regions_list( - serializer, - _SCHEMA_RUNTIME_CONTEXT.members["MemoryRegions"], - self.memory_regions, - ) - - if self.tool_name is not None: - serializer.write_string( - _SCHEMA_RUNTIME_CONTEXT.members["ToolName"], self.tool_name - ) - - if self.tool_category is not None: - serializer.write_string( - _SCHEMA_RUNTIME_CONTEXT.members["ToolCategory"], self.tool_category - ) - - if self.service_name is not None: - serializer.write_string( - _SCHEMA_RUNTIME_CONTEXT.members["ServiceName"], self.service_name - ) - - if self.command_line_example is not None: - serializer.write_string( - _SCHEMA_RUNTIME_CONTEXT.members["CommandLineExample"], - self.command_line_example, - ) - - if self.threat_file_path is not None: - serializer.write_string( - _SCHEMA_RUNTIME_CONTEXT.members["ThreatFilePath"], self.threat_file_path - ) - - if self.file_operation is not None: - serializer.write_string( - _SCHEMA_RUNTIME_CONTEXT.members["FileOperation"], self.file_operation - ) - - if self.file_path is not None: - serializer.write_string( - _SCHEMA_RUNTIME_CONTEXT.members["FilePath"], self.file_path - ) - - if self.related_file_paths is not None: - _serialize_related_file_paths_list( - serializer, - _SCHEMA_RUNTIME_CONTEXT.members["RelatedFilePaths"], - self.related_file_paths, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["modifying_process"] = ProcessDetails.deserialize(de) - - case 1: - kwargs["modified_at"] = de.read_timestamp( - _SCHEMA_RUNTIME_CONTEXT.members["ModifiedAt"] - ) - - case 2: - kwargs["script_path"] = de.read_string( - _SCHEMA_RUNTIME_CONTEXT.members["ScriptPath"] - ) - - case 3: - kwargs["library_path"] = de.read_string( - _SCHEMA_RUNTIME_CONTEXT.members["LibraryPath"] - ) - - case 4: - kwargs["ld_preload_value"] = de.read_string( - _SCHEMA_RUNTIME_CONTEXT.members["LdPreloadValue"] - ) - - case 5: - kwargs["socket_path"] = de.read_string( - _SCHEMA_RUNTIME_CONTEXT.members["SocketPath"] - ) - - case 6: - kwargs["runc_binary_path"] = de.read_string( - _SCHEMA_RUNTIME_CONTEXT.members["RuncBinaryPath"] - ) - - case 7: - kwargs["release_agent_path"] = de.read_string( - _SCHEMA_RUNTIME_CONTEXT.members["ReleaseAgentPath"] - ) - - case 8: - kwargs["mount_source"] = de.read_string( - _SCHEMA_RUNTIME_CONTEXT.members["MountSource"] - ) - - case 9: - kwargs["mount_target"] = de.read_string( - _SCHEMA_RUNTIME_CONTEXT.members["MountTarget"] - ) - - case 10: - kwargs["file_system_type"] = de.read_string( - _SCHEMA_RUNTIME_CONTEXT.members["FileSystemType"] - ) - - case 11: - kwargs["flags"] = _deserialize_flags_list( - de, _SCHEMA_RUNTIME_CONTEXT.members["Flags"] - ) - - case 12: - kwargs["module_name"] = de.read_string( - _SCHEMA_RUNTIME_CONTEXT.members["ModuleName"] - ) - - case 13: - kwargs["module_file_path"] = de.read_string( - _SCHEMA_RUNTIME_CONTEXT.members["ModuleFilePath"] - ) - - case 14: - kwargs["module_sha256"] = de.read_string( - _SCHEMA_RUNTIME_CONTEXT.members["ModuleSha256"] - ) - - case 15: - kwargs["shell_history_file_path"] = de.read_string( - _SCHEMA_RUNTIME_CONTEXT.members["ShellHistoryFilePath"] - ) - - case 16: - kwargs["target_process"] = ProcessDetails.deserialize(de) - - case 17: - kwargs["address_family"] = de.read_string( - _SCHEMA_RUNTIME_CONTEXT.members["AddressFamily"] - ) - - case 18: - kwargs["iana_protocol_number"] = de.read_integer( - _SCHEMA_RUNTIME_CONTEXT.members["IanaProtocolNumber"] - ) - - case 19: - kwargs["memory_regions"] = _deserialize_memory_regions_list( - de, _SCHEMA_RUNTIME_CONTEXT.members["MemoryRegions"] - ) - - case 20: - kwargs["tool_name"] = de.read_string( - _SCHEMA_RUNTIME_CONTEXT.members["ToolName"] - ) - - case 21: - kwargs["tool_category"] = de.read_string( - _SCHEMA_RUNTIME_CONTEXT.members["ToolCategory"] - ) - - case 22: - kwargs["service_name"] = de.read_string( - _SCHEMA_RUNTIME_CONTEXT.members["ServiceName"] - ) - - case 23: - kwargs["command_line_example"] = de.read_string( - _SCHEMA_RUNTIME_CONTEXT.members["CommandLineExample"] - ) - - case 24: - kwargs["threat_file_path"] = de.read_string( - _SCHEMA_RUNTIME_CONTEXT.members["ThreatFilePath"] - ) - - case 25: - kwargs["file_operation"] = de.read_string( - _SCHEMA_RUNTIME_CONTEXT.members["FileOperation"] - ) - - case 26: - kwargs["file_path"] = de.read_string( - _SCHEMA_RUNTIME_CONTEXT.members["FilePath"] - ) - - case 27: - kwargs["related_file_paths"] = _deserialize_related_file_paths_list( - de, _SCHEMA_RUNTIME_CONTEXT.members["RelatedFilePaths"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RUNTIME_CONTEXT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class RuntimeDetails: - """ - Information about the process and any required context values for a - specific finding. - """ - - process: ProcessDetails | None = None - """Information about the observed process.""" - - context: RuntimeContext | None = None - """Additional information about the suspicious activity.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RUNTIME_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.process is not None: - serializer.write_struct( - _SCHEMA_RUNTIME_DETAILS.members["Process"], self.process - ) - - if self.context is not None: - serializer.write_struct( - _SCHEMA_RUNTIME_DETAILS.members["Context"], self.context - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["process"] = ProcessDetails.deserialize(de) - - case 1: - kwargs["context"] = RuntimeContext.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RUNTIME_DETAILS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Service: - """Contains additional information about the generated finding.""" - - action: Action | None = None - """Information about the activity that is described in a finding.""" - - evidence: Evidence | None = None - """An evidence object associated with the service.""" - - archived: bool | None = None - """Indicates whether this finding is archived.""" - - count: int | None = None - """The total count of the occurrences of this finding type.""" - - detector_id: str | None = None - """The detector ID for the GuardDuty service.""" - - event_first_seen: str | None = None - """ - The first-seen timestamp of the activity that prompted GuardDuty to - generate this finding. - """ - - event_last_seen: str | None = None - """ - The last-seen timestamp of the activity that prompted GuardDuty to - generate this finding. - """ - - resource_role: str | None = None - """The resource role information for this finding.""" - - service_name: str | None = None - """ - The name of the Amazon Web Services service (GuardDuty) that generated a - finding. - """ - - user_feedback: str | None = None - """Feedback that was submitted about the finding.""" - - additional_info: ServiceAdditionalInfo | None = None - """Contains additional information about the generated finding.""" - - feature_name: str | None = None - """The name of the feature that generated a finding.""" - - ebs_volume_scan_details: EbsVolumeScanDetails | None = None - """Returns details from the malware scan that created a finding.""" - - runtime_details: RuntimeDetails | None = None - """ - Information about the process and any required context values for a - specific finding - """ - - detection: Detection | None = None - """Contains information about the detected unusual behavior.""" - - malware_scan_details: MalwareScanDetails | None = None - """ - Returns details from the malware scan that generated a GuardDuty - finding. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SERVICE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.action is not None: - serializer.write_struct(_SCHEMA_SERVICE.members["Action"], self.action) - - if self.evidence is not None: - serializer.write_struct(_SCHEMA_SERVICE.members["Evidence"], self.evidence) - - if self.archived is not None: - serializer.write_boolean(_SCHEMA_SERVICE.members["Archived"], self.archived) - - if self.count is not None: - serializer.write_integer(_SCHEMA_SERVICE.members["Count"], self.count) - - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_SERVICE.members["DetectorId"], self.detector_id - ) - - if self.event_first_seen is not None: - serializer.write_string( - _SCHEMA_SERVICE.members["EventFirstSeen"], self.event_first_seen - ) - - if self.event_last_seen is not None: - serializer.write_string( - _SCHEMA_SERVICE.members["EventLastSeen"], self.event_last_seen - ) - - if self.resource_role is not None: - serializer.write_string( - _SCHEMA_SERVICE.members["ResourceRole"], self.resource_role - ) - - if self.service_name is not None: - serializer.write_string( - _SCHEMA_SERVICE.members["ServiceName"], self.service_name - ) - - if self.user_feedback is not None: - serializer.write_string( - _SCHEMA_SERVICE.members["UserFeedback"], self.user_feedback - ) - - if self.additional_info is not None: - serializer.write_struct( - _SCHEMA_SERVICE.members["AdditionalInfo"], self.additional_info - ) - - if self.feature_name is not None: - serializer.write_string( - _SCHEMA_SERVICE.members["FeatureName"], self.feature_name - ) - - if self.ebs_volume_scan_details is not None: - serializer.write_struct( - _SCHEMA_SERVICE.members["EbsVolumeScanDetails"], - self.ebs_volume_scan_details, - ) - - if self.runtime_details is not None: - serializer.write_struct( - _SCHEMA_SERVICE.members["RuntimeDetails"], self.runtime_details - ) - - if self.detection is not None: - serializer.write_struct( - _SCHEMA_SERVICE.members["Detection"], self.detection - ) - - if self.malware_scan_details is not None: - serializer.write_struct( - _SCHEMA_SERVICE.members["MalwareScanDetails"], self.malware_scan_details - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["action"] = Action.deserialize(de) - - case 1: - kwargs["evidence"] = Evidence.deserialize(de) - - case 2: - kwargs["archived"] = de.read_boolean( - _SCHEMA_SERVICE.members["Archived"] - ) - - case 3: - kwargs["count"] = de.read_integer(_SCHEMA_SERVICE.members["Count"]) - - case 4: - kwargs["detector_id"] = de.read_string( - _SCHEMA_SERVICE.members["DetectorId"] - ) - - case 5: - kwargs["event_first_seen"] = de.read_string( - _SCHEMA_SERVICE.members["EventFirstSeen"] - ) - - case 6: - kwargs["event_last_seen"] = de.read_string( - _SCHEMA_SERVICE.members["EventLastSeen"] - ) - - case 7: - kwargs["resource_role"] = de.read_string( - _SCHEMA_SERVICE.members["ResourceRole"] - ) - - case 8: - kwargs["service_name"] = de.read_string( - _SCHEMA_SERVICE.members["ServiceName"] - ) - - case 9: - kwargs["user_feedback"] = de.read_string( - _SCHEMA_SERVICE.members["UserFeedback"] - ) - - case 10: - kwargs["additional_info"] = ServiceAdditionalInfo.deserialize(de) - - case 11: - kwargs["feature_name"] = de.read_string( - _SCHEMA_SERVICE.members["FeatureName"] - ) - - case 12: - kwargs["ebs_volume_scan_details"] = ( - EbsVolumeScanDetails.deserialize(de) - ) - - case 13: - kwargs["runtime_details"] = RuntimeDetails.deserialize(de) - - case 14: - kwargs["detection"] = Detection.deserialize(de) - - case 15: - kwargs["malware_scan_details"] = MalwareScanDetails.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SERVICE, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Finding: - """ - Contains information about the finding that is generated when abnormal - or suspicious activity is detected. - """ - - account_id: str | None = None - """The ID of the account in which the finding was generated.""" - - arn: str | None = None - """The ARN of the finding.""" - - confidence: float | None = None - """The confidence score for the finding.""" - - created_at: str | None = None - """The time and date when the finding was created.""" - - description: str | None = None - """The description of the finding.""" - - id: str | None = None - """The ID of the finding.""" - - partition: str | None = None - """The partition associated with the finding.""" - - region: str | None = None - """ - The Region where the finding was generated. For findings generated from - [Global Service - Events](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-concepts.html#cloudtrail-concepts-global-service-events), - the Region value in the finding might differ from the Region where - GuardDuty identifies the potential threat. For more information, see - [How GuardDuty handles Amazon Web Services CloudTrail global - events](https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_data-sources.html#cloudtrail_global) - in the *Amazon GuardDuty User Guide*. - """ - - resource: Resource | None = None - """ - Contains information about the Amazon Web Services resource associated - with the activity that prompted GuardDuty to generate a finding. - """ - - schema_version: str | None = None - """The version of the schema used for the finding.""" - - service: Service | None = None - """Contains additional information about the generated finding.""" - - severity: float | None = None - """The severity of the finding.""" - - title: str | None = None - """The title of the finding.""" - - type: str | None = None - """The type of finding.""" - - updated_at: str | None = None - """The time and date when the finding was last updated.""" - - associated_attack_sequence_arn: str | None = None - """Amazon Resource Name (ARN) associated with the attack sequence finding.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FINDING, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.account_id is not None: - serializer.write_string( - _SCHEMA_FINDING.members["AccountId"], self.account_id - ) - - if self.arn is not None: - serializer.write_string(_SCHEMA_FINDING.members["Arn"], self.arn) - - if self.confidence is not None: - serializer.write_double( - _SCHEMA_FINDING.members["Confidence"], self.confidence - ) - - if self.created_at is not None: - serializer.write_string( - _SCHEMA_FINDING.members["CreatedAt"], self.created_at - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_FINDING.members["Description"], self.description - ) - - if self.id is not None: - serializer.write_string(_SCHEMA_FINDING.members["Id"], self.id) - - if self.partition is not None: - serializer.write_string( - _SCHEMA_FINDING.members["Partition"], self.partition - ) - - if self.region is not None: - serializer.write_string(_SCHEMA_FINDING.members["Region"], self.region) - - if self.resource is not None: - serializer.write_struct(_SCHEMA_FINDING.members["Resource"], self.resource) - - if self.schema_version is not None: - serializer.write_string( - _SCHEMA_FINDING.members["SchemaVersion"], self.schema_version - ) - - if self.service is not None: - serializer.write_struct(_SCHEMA_FINDING.members["Service"], self.service) - - if self.severity is not None: - serializer.write_double(_SCHEMA_FINDING.members["Severity"], self.severity) - - if self.title is not None: - serializer.write_string(_SCHEMA_FINDING.members["Title"], self.title) - - if self.type is not None: - serializer.write_string(_SCHEMA_FINDING.members["Type"], self.type) - - if self.updated_at is not None: - serializer.write_string( - _SCHEMA_FINDING.members["UpdatedAt"], self.updated_at - ) - - if self.associated_attack_sequence_arn is not None: - serializer.write_string( - _SCHEMA_FINDING.members["AssociatedAttackSequenceArn"], - self.associated_attack_sequence_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["account_id"] = de.read_string( - _SCHEMA_FINDING.members["AccountId"] - ) - - case 1: - kwargs["arn"] = de.read_string(_SCHEMA_FINDING.members["Arn"]) - - case 2: - kwargs["confidence"] = de.read_double( - _SCHEMA_FINDING.members["Confidence"] - ) - - case 3: - kwargs["created_at"] = de.read_string( - _SCHEMA_FINDING.members["CreatedAt"] - ) - - case 4: - kwargs["description"] = de.read_string( - _SCHEMA_FINDING.members["Description"] - ) - - case 5: - kwargs["id"] = de.read_string(_SCHEMA_FINDING.members["Id"]) - - case 6: - kwargs["partition"] = de.read_string( - _SCHEMA_FINDING.members["Partition"] - ) - - case 7: - kwargs["region"] = de.read_string(_SCHEMA_FINDING.members["Region"]) - - case 8: - kwargs["resource"] = Resource.deserialize(de) - - case 9: - kwargs["schema_version"] = de.read_string( - _SCHEMA_FINDING.members["SchemaVersion"] - ) - - case 10: - kwargs["service"] = Service.deserialize(de) - - case 11: - kwargs["severity"] = de.read_double( - _SCHEMA_FINDING.members["Severity"] - ) - - case 12: - kwargs["title"] = de.read_string(_SCHEMA_FINDING.members["Title"]) - - case 13: - kwargs["type"] = de.read_string(_SCHEMA_FINDING.members["Type"]) - - case 14: - kwargs["updated_at"] = de.read_string( - _SCHEMA_FINDING.members["UpdatedAt"] - ) - - case 15: - kwargs["associated_attack_sequence_arn"] = de.read_string( - _SCHEMA_FINDING.members["AssociatedAttackSequenceArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FINDING, consumer=_consumer) - return kwargs - - -def _serialize_findings( - serializer: ShapeSerializer, schema: Schema, value: list[Finding] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_findings( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Finding]: - result: list[Finding] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Finding.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_grouped_by_account( - serializer: ShapeSerializer, schema: Schema, value: list[AccountStatistics] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_grouped_by_account( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AccountStatistics]: - result: list[AccountStatistics] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AccountStatistics.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_grouped_by_date( - serializer: ShapeSerializer, schema: Schema, value: list[DateStatistics] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_grouped_by_date( - deserializer: ShapeDeserializer, schema: Schema -) -> list[DateStatistics]: - result: list[DateStatistics] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(DateStatistics.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class FindingTypeStatistics: - """ - Information about each finding type associated with the - `groupedByFindingType` statistics. - """ - - finding_type: str | None = None - """Name of the finding type.""" - - last_generated_at: datetime | None = None - """ - The timestamp at which this finding type was last generated in your - environment. - """ - - total_findings: int | None = None - """ - The total number of findings associated with generated for each distinct - finding type. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FINDING_TYPE_STATISTICS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.finding_type is not None: - serializer.write_string( - _SCHEMA_FINDING_TYPE_STATISTICS.members["FindingType"], - self.finding_type, - ) - - if self.last_generated_at is not None: - serializer.write_timestamp( - _SCHEMA_FINDING_TYPE_STATISTICS.members["LastGeneratedAt"], - self.last_generated_at, - ) - - if self.total_findings is not None: - serializer.write_integer( - _SCHEMA_FINDING_TYPE_STATISTICS.members["TotalFindings"], - self.total_findings, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["finding_type"] = de.read_string( - _SCHEMA_FINDING_TYPE_STATISTICS.members["FindingType"] - ) - - case 1: - kwargs["last_generated_at"] = de.read_timestamp( - _SCHEMA_FINDING_TYPE_STATISTICS.members["LastGeneratedAt"] - ) - - case 2: - kwargs["total_findings"] = de.read_integer( - _SCHEMA_FINDING_TYPE_STATISTICS.members["TotalFindings"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FINDING_TYPE_STATISTICS, consumer=_consumer) - return kwargs - - -def _serialize_grouped_by_finding_type( - serializer: ShapeSerializer, schema: Schema, value: list[FindingTypeStatistics] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_grouped_by_finding_type( - deserializer: ShapeDeserializer, schema: Schema -) -> list[FindingTypeStatistics]: - result: list[FindingTypeStatistics] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(FindingTypeStatistics.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ResourceStatistics: - """ - Information about each resource type associated with the - `groupedByResource` statistics. - """ - - account_id: str | None = None - """The ID of the Amazon Web Services account.""" - - last_generated_at: datetime | None = None - """ - The timestamp at which the statistics for this resource was last - generated. - """ - - resource_id: str | None = None - """ - ID associated with each resource. The following list provides the - mapping of the resource type and resource ID. - - **Mapping of resource and resource ID** - - - AccessKey - `resource.accessKeyDetails.accessKeyId` - - - Container - `resource.containerDetails.id` - - - ECSCluster - `resource.ecsClusterDetails.name` - - - EKSCluster - `resource.eksClusterDetails.name` - - - Instance - `resource.instanceDetails.instanceId` - - - KubernetesCluster - - `resource.kubernetesDetails.kubernetesWorkloadDetails.name` - - - Lambda - `resource.lambdaDetails.functionName` - - - RDSDBInstance - `resource.rdsDbInstanceDetails.dbInstanceIdentifier` - - - S3Bucket - `resource.s3BucketDetails.name` - - - S3Object - `resource.s3BucketDetails.name` - """ - - resource_type: str | None = None - """The type of resource.""" - - total_findings: int | None = None - """The total number of findings associated with this resource.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESOURCE_STATISTICS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.account_id is not None: - serializer.write_string( - _SCHEMA_RESOURCE_STATISTICS.members["AccountId"], self.account_id - ) - - if self.last_generated_at is not None: - serializer.write_timestamp( - _SCHEMA_RESOURCE_STATISTICS.members["LastGeneratedAt"], - self.last_generated_at, - ) - - if self.resource_id is not None: - serializer.write_string( - _SCHEMA_RESOURCE_STATISTICS.members["ResourceId"], self.resource_id - ) - - if self.resource_type is not None: - serializer.write_string( - _SCHEMA_RESOURCE_STATISTICS.members["ResourceType"], self.resource_type - ) - - if self.total_findings is not None: - serializer.write_integer( - _SCHEMA_RESOURCE_STATISTICS.members["TotalFindings"], - self.total_findings, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["account_id"] = de.read_string( - _SCHEMA_RESOURCE_STATISTICS.members["AccountId"] - ) - - case 1: - kwargs["last_generated_at"] = de.read_timestamp( - _SCHEMA_RESOURCE_STATISTICS.members["LastGeneratedAt"] - ) - - case 2: - kwargs["resource_id"] = de.read_string( - _SCHEMA_RESOURCE_STATISTICS.members["ResourceId"] - ) - - case 3: - kwargs["resource_type"] = de.read_string( - _SCHEMA_RESOURCE_STATISTICS.members["ResourceType"] - ) - - case 4: - kwargs["total_findings"] = de.read_integer( - _SCHEMA_RESOURCE_STATISTICS.members["TotalFindings"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RESOURCE_STATISTICS, consumer=_consumer) - return kwargs - - -def _serialize_grouped_by_resource( - serializer: ShapeSerializer, schema: Schema, value: list[ResourceStatistics] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_grouped_by_resource( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ResourceStatistics]: - result: list[ResourceStatistics] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ResourceStatistics.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class SeverityStatistics: - """Information about severity level for each finding type.""" - - last_generated_at: datetime | None = None - """ - The timestamp at which a finding type for a specific severity was last - generated. - """ - - severity: float | None = None - """The severity level associated with each finding type.""" - - total_findings: int | None = None - """The total number of findings associated with this severity.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SEVERITY_STATISTICS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.last_generated_at is not None: - serializer.write_timestamp( - _SCHEMA_SEVERITY_STATISTICS.members["LastGeneratedAt"], - self.last_generated_at, - ) - - if self.severity is not None: - serializer.write_double( - _SCHEMA_SEVERITY_STATISTICS.members["Severity"], self.severity - ) - - if self.total_findings is not None: - serializer.write_integer( - _SCHEMA_SEVERITY_STATISTICS.members["TotalFindings"], - self.total_findings, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["last_generated_at"] = de.read_timestamp( - _SCHEMA_SEVERITY_STATISTICS.members["LastGeneratedAt"] - ) - - case 1: - kwargs["severity"] = de.read_double( - _SCHEMA_SEVERITY_STATISTICS.members["Severity"] - ) - - case 2: - kwargs["total_findings"] = de.read_integer( - _SCHEMA_SEVERITY_STATISTICS.members["TotalFindings"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SEVERITY_STATISTICS, consumer=_consumer) - return kwargs - - -def _serialize_grouped_by_severity( - serializer: ShapeSerializer, schema: Schema, value: list[SeverityStatistics] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_grouped_by_severity( - deserializer: ShapeDeserializer, schema: Schema -) -> list[SeverityStatistics]: - result: list[SeverityStatistics] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(SeverityStatistics.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class FindingStatistics: - """Contains information about finding statistics.""" - - count_by_severity: dict[str, int] | None = None - """ - Represents a list of map of severity to count statistics for a set of - findings. - """ - - grouped_by_account: list[AccountStatistics] | None = None - """ - Represents a list of map of accounts with a findings count associated - with each account. - """ - - grouped_by_date: list[DateStatistics] | None = None - """ - Represents a list of map of dates with a count of total findings - generated on each date per severity level. - """ - - grouped_by_finding_type: list[FindingTypeStatistics] | None = None - """ - Represents a list of map of finding types with a count of total findings - generated for each type. - - Based on the `orderBy` parameter, this request returns either the most - occurring finding types or the least occurring finding types. If the - `orderBy` parameter is `ASC`, this will represent the least occurring - finding types in your account; otherwise, this will represent the most - occurring finding types. The default value of `orderBy` is `DESC`. - """ - - grouped_by_resource: list[ResourceStatistics] | None = None - """ - Represents a list of map of top resources with a count of total - findings. - """ - - grouped_by_severity: list[SeverityStatistics] | None = None - """Represents a list of map of total findings for each severity level.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FINDING_STATISTICS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.count_by_severity is not None: - _serialize_count_by_severity( - serializer, - _SCHEMA_FINDING_STATISTICS.members["CountBySeverity"], - self.count_by_severity, - ) - - if self.grouped_by_account is not None: - _serialize_grouped_by_account( - serializer, - _SCHEMA_FINDING_STATISTICS.members["GroupedByAccount"], - self.grouped_by_account, - ) - - if self.grouped_by_date is not None: - _serialize_grouped_by_date( - serializer, - _SCHEMA_FINDING_STATISTICS.members["GroupedByDate"], - self.grouped_by_date, - ) - - if self.grouped_by_finding_type is not None: - _serialize_grouped_by_finding_type( - serializer, - _SCHEMA_FINDING_STATISTICS.members["GroupedByFindingType"], - self.grouped_by_finding_type, - ) - - if self.grouped_by_resource is not None: - _serialize_grouped_by_resource( - serializer, - _SCHEMA_FINDING_STATISTICS.members["GroupedByResource"], - self.grouped_by_resource, - ) - - if self.grouped_by_severity is not None: - _serialize_grouped_by_severity( - serializer, - _SCHEMA_FINDING_STATISTICS.members["GroupedBySeverity"], - self.grouped_by_severity, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["count_by_severity"] = _deserialize_count_by_severity( - de, _SCHEMA_FINDING_STATISTICS.members["CountBySeverity"] - ) - - case 1: - kwargs["grouped_by_account"] = _deserialize_grouped_by_account( - de, _SCHEMA_FINDING_STATISTICS.members["GroupedByAccount"] - ) - - case 2: - kwargs["grouped_by_date"] = _deserialize_grouped_by_date( - de, _SCHEMA_FINDING_STATISTICS.members["GroupedByDate"] - ) - - case 3: - kwargs["grouped_by_finding_type"] = ( - _deserialize_grouped_by_finding_type( - de, - _SCHEMA_FINDING_STATISTICS.members["GroupedByFindingType"], - ) - ) - - case 4: - kwargs["grouped_by_resource"] = _deserialize_grouped_by_resource( - de, _SCHEMA_FINDING_STATISTICS.members["GroupedByResource"] - ) - - case 5: - kwargs["grouped_by_severity"] = _deserialize_grouped_by_severity( - de, _SCHEMA_FINDING_STATISTICS.members["GroupedBySeverity"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FINDING_STATISTICS, consumer=_consumer) - return kwargs - - -class FindingStatisticType(UnknownEnumMixin, StrEnum): - COUNT_BY_SEVERITY = "COUNT_BY_SEVERITY" - - -def _serialize_finding_statistic_types( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_finding_statistic_types( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(FindingStatisticType(d.read_string(member_schema))) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GetAdministratorAccountInput: - """Dataclass for GetAdministratorAccountInput structure.""" - - detector_id: str | None = None - """The unique ID of the detector of the GuardDuty member account.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_ADMINISTRATOR_ACCOUNT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_GET_ADMINISTRATOR_ACCOUNT_INPUT.members["DetectorId"], - self.detector_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_GET_ADMINISTRATOR_ACCOUNT_INPUT.members["DetectorId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_ADMINISTRATOR_ACCOUNT_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetAdministratorAccountOutput: - """Dataclass for GetAdministratorAccountOutput structure.""" - - administrator: Administrator | None = None - """The administrator account details.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_ADMINISTRATOR_ACCOUNT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.administrator is not None: - serializer.write_struct( - _SCHEMA_GET_ADMINISTRATOR_ACCOUNT_OUTPUT.members["Administrator"], - self.administrator, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["administrator"] = Administrator.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_ADMINISTRATOR_ACCOUNT_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_ADMINISTRATOR_ACCOUNT = APIOperation( - input=GetAdministratorAccountInput, - output=GetAdministratorAccountOutput, - schema=_SCHEMA_GET_ADMINISTRATOR_ACCOUNT, - input_schema=_SCHEMA_GET_ADMINISTRATOR_ACCOUNT_INPUT, - output_schema=_SCHEMA_GET_ADMINISTRATOR_ACCOUNT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetCoverageStatisticsInput: - """Dataclass for GetCoverageStatisticsInput structure.""" - - detector_id: str | None = None - """ - The unique ID of the GuardDuty detector. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - filter_criteria: CoverageFilterCriteria | None = None - """Represents the criteria used to filter the coverage statistics.""" - - statistics_type: list[str] | None = None - """Represents the statistics type used to aggregate the coverage details.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_COVERAGE_STATISTICS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_GET_COVERAGE_STATISTICS_INPUT.members["DetectorId"], - self.detector_id, - ) - - if self.filter_criteria is not None: - serializer.write_struct( - _SCHEMA_GET_COVERAGE_STATISTICS_INPUT.members["FilterCriteria"], - self.filter_criteria, - ) - - if self.statistics_type is not None: - _serialize_coverage_statistics_type_list( - serializer, - _SCHEMA_GET_COVERAGE_STATISTICS_INPUT.members["StatisticsType"], - self.statistics_type, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_GET_COVERAGE_STATISTICS_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["filter_criteria"] = CoverageFilterCriteria.deserialize(de) - - case 2: - kwargs["statistics_type"] = ( - _deserialize_coverage_statistics_type_list( - de, - _SCHEMA_GET_COVERAGE_STATISTICS_INPUT.members[ - "StatisticsType" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_COVERAGE_STATISTICS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetCoverageStatisticsOutput: - """Dataclass for GetCoverageStatisticsOutput structure.""" - - coverage_statistics: CoverageStatistics | None = None - """Represents the count aggregated by the `statusCode` and `resourceType`.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_COVERAGE_STATISTICS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.coverage_statistics is not None: - serializer.write_struct( - _SCHEMA_GET_COVERAGE_STATISTICS_OUTPUT.members["CoverageStatistics"], - self.coverage_statistics, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["coverage_statistics"] = CoverageStatistics.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_COVERAGE_STATISTICS_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_COVERAGE_STATISTICS = APIOperation( - input=GetCoverageStatisticsInput, - output=GetCoverageStatisticsOutput, - schema=_SCHEMA_GET_COVERAGE_STATISTICS, - input_schema=_SCHEMA_GET_COVERAGE_STATISTICS_INPUT, - output_schema=_SCHEMA_GET_COVERAGE_STATISTICS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetCustomDetectionRuleInput: - """Dataclass for GetCustomDetectionRuleInput structure.""" - - rule_id: str | None = None - """The unique identifier for the custom detection rule.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_CUSTOM_DETECTION_RULE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rule_id is not None: - serializer.write_string( - _SCHEMA_GET_CUSTOM_DETECTION_RULE_INPUT.members["RuleId"], self.rule_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rule_id"] = de.read_string( - _SCHEMA_GET_CUSTOM_DETECTION_RULE_INPUT.members["RuleId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_CUSTOM_DETECTION_RULE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class RuleDefinition: - """Contains the detection logic for a custom detection rule.""" - - expression: str | None = None - """The detection logic expression for the rule.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RULE_DEFINITION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.expression is not None: - serializer.write_string( - _SCHEMA_RULE_DEFINITION.members["Expression"], self.expression - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["expression"] = de.read_string( - _SCHEMA_RULE_DEFINITION.members["Expression"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RULE_DEFINITION, consumer=_consumer) - return kwargs - - -class RuleLanguage(UnknownEnumMixin, StrEnum): - SQL = "SQL" - - -class RuleSchema(UnknownEnumMixin, StrEnum): - CLOUD_TRAIL = "CloudTrail" - - -@dataclass(kw_only=True) -class RuleDetail: - """ - Contains the full details of a custom detection rule, including its - detection logic. - """ - - rule_id: str | None = None - """The unique identifier for the rule.""" - - arn: str | None = None - """The Amazon Resource Name (ARN) of the rule.""" - - name: str | None = None - """The display name of the rule.""" - - description: str | None = None - """A description of what the rule detects.""" - - severity: str | None = None - """The severity level assigned to findings generated by this rule.""" - - data_source: str | None = None - """The data source that the rule analyzes.""" - - tactic: str | None = None - """The MITRE ATT&CK tactic associated with the rule.""" - - technique: str | None = None - """The MITRE ATT&CK technique associated with the rule.""" - - service: str | None = None - """The Amazon Web Services service associated with the rule.""" - - definition: RuleDefinition | None = None - """The detection logic definition for the rule.""" - - language: str | None = None - """The language used for the detection logic expression.""" - - schema: str | None = None - """The schema version used by the rule definition.""" - - created_at: datetime | None = None - """The timestamp when the rule was created.""" - - updated_at: datetime | None = None - """The timestamp when the rule was last updated.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RULE_DETAIL, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rule_id is not None: - serializer.write_string(_SCHEMA_RULE_DETAIL.members["RuleId"], self.rule_id) - - if self.arn is not None: - serializer.write_string(_SCHEMA_RULE_DETAIL.members["Arn"], self.arn) - - if self.name is not None: - serializer.write_string(_SCHEMA_RULE_DETAIL.members["Name"], self.name) - - if self.description is not None: - serializer.write_string( - _SCHEMA_RULE_DETAIL.members["Description"], self.description - ) - - if self.severity is not None: - serializer.write_string( - _SCHEMA_RULE_DETAIL.members["Severity"], self.severity - ) - - if self.data_source is not None: - serializer.write_string( - _SCHEMA_RULE_DETAIL.members["DataSource"], self.data_source - ) - - if self.tactic is not None: - serializer.write_string(_SCHEMA_RULE_DETAIL.members["Tactic"], self.tactic) - - if self.technique is not None: - serializer.write_string( - _SCHEMA_RULE_DETAIL.members["Technique"], self.technique - ) - - if self.service is not None: - serializer.write_string( - _SCHEMA_RULE_DETAIL.members["Service"], self.service - ) - - if self.definition is not None: - serializer.write_struct( - _SCHEMA_RULE_DETAIL.members["Definition"], self.definition - ) - - if self.language is not None: - serializer.write_string( - _SCHEMA_RULE_DETAIL.members["Language"], self.language - ) - - if self.schema is not None: - serializer.write_string(_SCHEMA_RULE_DETAIL.members["Schema"], self.schema) - - if self.created_at is not None: - serializer.write_timestamp( - _SCHEMA_RULE_DETAIL.members["CreatedAt"], self.created_at - ) - - if self.updated_at is not None: - serializer.write_timestamp( - _SCHEMA_RULE_DETAIL.members["UpdatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rule_id"] = de.read_string( - _SCHEMA_RULE_DETAIL.members["RuleId"] - ) - - case 1: - kwargs["arn"] = de.read_string(_SCHEMA_RULE_DETAIL.members["Arn"]) - - case 2: - kwargs["name"] = de.read_string(_SCHEMA_RULE_DETAIL.members["Name"]) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_RULE_DETAIL.members["Description"] - ) - - case 4: - kwargs["severity"] = DetectionRuleSeverity( - de.read_string(_SCHEMA_RULE_DETAIL.members["Severity"]) - ) - - case 5: - kwargs["data_source"] = DetectionRuleDataSource( - de.read_string(_SCHEMA_RULE_DETAIL.members["DataSource"]) - ) - - case 6: - kwargs["tactic"] = de.read_string( - _SCHEMA_RULE_DETAIL.members["Tactic"] - ) - - case 7: - kwargs["technique"] = de.read_string( - _SCHEMA_RULE_DETAIL.members["Technique"] - ) - - case 8: - kwargs["service"] = de.read_string( - _SCHEMA_RULE_DETAIL.members["Service"] - ) - - case 9: - kwargs["definition"] = RuleDefinition.deserialize(de) - - case 10: - kwargs["language"] = RuleLanguage( - de.read_string(_SCHEMA_RULE_DETAIL.members["Language"]) - ) - - case 11: - kwargs["schema"] = RuleSchema( - de.read_string(_SCHEMA_RULE_DETAIL.members["Schema"]) - ) - - case 12: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_RULE_DETAIL.members["CreatedAt"] - ) - - case 13: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_RULE_DETAIL.members["UpdatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RULE_DETAIL, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetCustomDetectionRuleOutput: - """Dataclass for GetCustomDetectionRuleOutput structure.""" - - rule: RuleDetail | None = None - """The details of the custom detection rule.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_CUSTOM_DETECTION_RULE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rule is not None: - serializer.write_struct( - _SCHEMA_GET_CUSTOM_DETECTION_RULE_OUTPUT.members["Rule"], self.rule - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rule"] = RuleDetail.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_CUSTOM_DETECTION_RULE_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_CUSTOM_DETECTION_RULE = APIOperation( - input=GetCustomDetectionRuleInput, - output=GetCustomDetectionRuleOutput, - schema=_SCHEMA_GET_CUSTOM_DETECTION_RULE, - input_schema=_SCHEMA_GET_CUSTOM_DETECTION_RULE_INPUT, - output_schema=_SCHEMA_GET_CUSTOM_DETECTION_RULE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.guardduty#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - ShapeID( - "com.amazonaws.guardduty#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetCustomDetectionRuleAssociationInput: - """Dataclass for GetCustomDetectionRuleAssociationInput structure.""" - - rule_id: str | None = None - """The unique identifier for the custom detection rule.""" - - association_id: str | None = None - """The unique identifier for the association.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rule_id is not None: - serializer.write_string( - _SCHEMA_GET_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT.members["RuleId"], - self.rule_id, - ) - - if self.association_id is not None: - serializer.write_string( - _SCHEMA_GET_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT.members[ - "AssociationId" - ], - self.association_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rule_id"] = de.read_string( - _SCHEMA_GET_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT.members[ - "RuleId" - ] - ) - - case 1: - kwargs["association_id"] = de.read_string( - _SCHEMA_GET_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT.members[ - "AssociationId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetCustomDetectionRuleAssociationOutput: - """Dataclass for GetCustomDetectionRuleAssociationOutput structure.""" - - rule_association: AssociationDetail | None = None - """The details of the custom detection rule association.""" - - tags: dict[str, str] | None = None - """The tags associated with the custom detection rule association resource.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_CUSTOM_DETECTION_RULE_ASSOCIATION_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rule_association is not None: - serializer.write_struct( - _SCHEMA_GET_CUSTOM_DETECTION_RULE_ASSOCIATION_OUTPUT.members[ - "RuleAssociation" - ], - self.rule_association, - ) - - if self.tags is not None: - _serialize_tag_map( - serializer, - _SCHEMA_GET_CUSTOM_DETECTION_RULE_ASSOCIATION_OUTPUT.members["Tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rule_association"] = AssociationDetail.deserialize(de) - - case 1: - kwargs["tags"] = _deserialize_tag_map( - de, - _SCHEMA_GET_CUSTOM_DETECTION_RULE_ASSOCIATION_OUTPUT.members[ - "Tags" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_CUSTOM_DETECTION_RULE_ASSOCIATION_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_CUSTOM_DETECTION_RULE_ASSOCIATION = APIOperation( - input=GetCustomDetectionRuleAssociationInput, - output=GetCustomDetectionRuleAssociationOutput, - schema=_SCHEMA_GET_CUSTOM_DETECTION_RULE_ASSOCIATION, - input_schema=_SCHEMA_GET_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT, - output_schema=_SCHEMA_GET_CUSTOM_DETECTION_RULE_ASSOCIATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.guardduty#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - ShapeID( - "com.amazonaws.guardduty#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetCustomDetectionRuleOrgConfigurationInput: - """Dataclass for GetCustomDetectionRuleOrgConfigurationInput structure.""" - - rule_id: str | None = None - """The unique identifier for the custom detection rule.""" - - mode: str | None = None - """ - The execution mode of the organization configuration to retrieve. Valid - values: `LIVE` | `DRY_RUN`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rule_id is not None: - serializer.write_string( - _SCHEMA_GET_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT.members[ - "RuleId" - ], - self.rule_id, - ) - - if self.mode is not None: - serializer.write_string( - _SCHEMA_GET_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT.members[ - "Mode" - ], - self.mode, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rule_id"] = de.read_string( - _SCHEMA_GET_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT.members[ - "RuleId" - ] - ) - - case 1: - kwargs["mode"] = AssociationMode( - de.read_string( - _SCHEMA_GET_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT.members[ - "Mode" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT, - consumer=_consumer, - ) - return kwargs - - -@dataclass(kw_only=True) -class GetCustomDetectionRuleOrgConfigurationOutput: - """Dataclass for GetCustomDetectionRuleOrgConfigurationOutput structure.""" - - configuration: DetectionRuleOrgConfiguration | None = None - """The details of the organization configuration.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.configuration is not None: - serializer.write_struct( - _SCHEMA_GET_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_OUTPUT.members[ - "Configuration" - ], - self.configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["configuration"] = DetectionRuleOrgConfiguration.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_OUTPUT, - consumer=_consumer, - ) - return kwargs - - -GET_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION = APIOperation( - input=GetCustomDetectionRuleOrgConfigurationInput, - output=GetCustomDetectionRuleOrgConfigurationOutput, - schema=_SCHEMA_GET_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION, - input_schema=_SCHEMA_GET_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT, - output_schema=_SCHEMA_GET_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.guardduty#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - ShapeID( - "com.amazonaws.guardduty#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetDetectorInput: - """Dataclass for GetDetectorInput structure.""" - - detector_id: str | None = None - """ - The unique ID of the detector that you want to get. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DETECTOR_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_GET_DETECTOR_INPUT.members["DetectorId"], self.detector_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_GET_DETECTOR_INPUT.members["DetectorId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_DETECTOR_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetDetectorOutput: - """Dataclass for GetDetectorOutput structure.""" - - created_at: str | None = None - """The timestamp of when the detector was created.""" - - finding_publishing_frequency: str | None = None - """The publishing frequency of the finding.""" - - service_role: str | None = None - """The GuardDuty service role.""" - - status: str | None = None - """The detector status.""" - - updated_at: str | None = None - """The last-updated timestamp for the detector.""" - - data_sources: DataSourceConfigurationsResult | None = None - """Describes which data sources are enabled for the detector.""" - - tags: dict[str, str] | None = None - """The tags of the detector resource.""" - - features: list[DetectorFeatureConfigurationResult] | None = None - """Describes the features that have been enabled for the detector.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DETECTOR_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.created_at is not None: - serializer.write_string( - _SCHEMA_GET_DETECTOR_OUTPUT.members["CreatedAt"], self.created_at - ) - - if self.finding_publishing_frequency is not None: - serializer.write_string( - _SCHEMA_GET_DETECTOR_OUTPUT.members["FindingPublishingFrequency"], - self.finding_publishing_frequency, - ) - - if self.service_role is not None: - serializer.write_string( - _SCHEMA_GET_DETECTOR_OUTPUT.members["ServiceRole"], self.service_role - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_GET_DETECTOR_OUTPUT.members["Status"], self.status - ) - - if self.updated_at is not None: - serializer.write_string( - _SCHEMA_GET_DETECTOR_OUTPUT.members["UpdatedAt"], self.updated_at - ) - - if self.data_sources is not None: - serializer.write_struct( - _SCHEMA_GET_DETECTOR_OUTPUT.members["DataSources"], self.data_sources - ) - - if self.tags is not None: - _serialize_tag_map( - serializer, _SCHEMA_GET_DETECTOR_OUTPUT.members["Tags"], self.tags - ) - - if self.features is not None: - _serialize_detector_feature_configurations_results( - serializer, - _SCHEMA_GET_DETECTOR_OUTPUT.members["Features"], - self.features, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["created_at"] = de.read_string( - _SCHEMA_GET_DETECTOR_OUTPUT.members["CreatedAt"] - ) - - case 1: - kwargs["finding_publishing_frequency"] = FindingPublishingFrequency( - de.read_string( - _SCHEMA_GET_DETECTOR_OUTPUT.members[ - "FindingPublishingFrequency" - ] - ) - ) - - case 2: - kwargs["service_role"] = de.read_string( - _SCHEMA_GET_DETECTOR_OUTPUT.members["ServiceRole"] - ) - - case 3: - kwargs["status"] = DetectorStatus( - de.read_string(_SCHEMA_GET_DETECTOR_OUTPUT.members["Status"]) - ) - - case 4: - kwargs["updated_at"] = de.read_string( - _SCHEMA_GET_DETECTOR_OUTPUT.members["UpdatedAt"] - ) - - case 5: - kwargs["data_sources"] = DataSourceConfigurationsResult.deserialize( - de - ) - - case 6: - kwargs["tags"] = _deserialize_tag_map( - de, _SCHEMA_GET_DETECTOR_OUTPUT.members["Tags"] - ) - - case 7: - kwargs["features"] = ( - _deserialize_detector_feature_configurations_results( - de, _SCHEMA_GET_DETECTOR_OUTPUT.members["Features"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_DETECTOR_OUTPUT, consumer=_consumer) - return kwargs - - -GET_DETECTOR = APIOperation( - input=GetDetectorInput, - output=GetDetectorOutput, - schema=_SCHEMA_GET_DETECTOR, - input_schema=_SCHEMA_GET_DETECTOR_INPUT, - output_schema=_SCHEMA_GET_DETECTOR_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetFilterInput: - """Dataclass for GetFilterInput structure.""" - - detector_id: str | None = None - """ - The unique ID of the detector that is associated with this filter. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - filter_name: str | None = None - """The name of the filter you want to get.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_FILTER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_GET_FILTER_INPUT.members["DetectorId"], self.detector_id - ) - - if self.filter_name is not None: - serializer.write_string( - _SCHEMA_GET_FILTER_INPUT.members["FilterName"], self.filter_name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_GET_FILTER_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["filter_name"] = de.read_string( - _SCHEMA_GET_FILTER_INPUT.members["FilterName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_FILTER_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetFilterOutput: - """Dataclass for GetFilterOutput structure.""" - - name: str | None = None - """The name of the filter.""" - - description: str | None = None - """The description of the filter.""" - - action: str | None = None - """ - Specifies the action that is to be applied to the findings that match - the filter. - """ - - rank: int | None = None - """ - Specifies the position of the filter in the list of current filters. - Also specifies the order in which this filter is applied to the - findings. - """ - - finding_criteria: FindingCriteria | None = None - """Represents the criteria to be used in the filter for querying findings.""" - - tags: dict[str, str] | None = None - """The tags of the filter resource.""" - - created_at: datetime | None = None - """ - The timestamp when the filter was created. This field is not available - for filters that were created before the lifecycle metadata feature was - enabled (legacy filters). - """ - - updated_at: datetime | None = None - """ - The timestamp when the filter was last updated. For legacy filters, this - field is present only after the filter has been updated at least once - since the lifecycle metadata feature was enabled. - """ - - version: int | None = None - """ - The version of the filter. Every time the filter is updated, the version - increments by 1. This field is not available for legacy filters that - were created before the lifecycle metadata feature was enabled. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_FILTER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_GET_FILTER_OUTPUT.members["Name"], self.name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_FILTER_OUTPUT.members["Description"], self.description - ) - - if self.action is not None: - serializer.write_string( - _SCHEMA_GET_FILTER_OUTPUT.members["Action"], self.action - ) - - if self.rank is not None: - serializer.write_integer( - _SCHEMA_GET_FILTER_OUTPUT.members["Rank"], self.rank - ) - - if self.finding_criteria is not None: - serializer.write_struct( - _SCHEMA_GET_FILTER_OUTPUT.members["FindingCriteria"], - self.finding_criteria, - ) - - if self.tags is not None: - _serialize_tag_map( - serializer, _SCHEMA_GET_FILTER_OUTPUT.members["Tags"], self.tags - ) - - if self.created_at is not None: - serializer.write_timestamp( - _SCHEMA_GET_FILTER_OUTPUT.members["CreatedAt"], self.created_at - ) - - if self.updated_at is not None: - serializer.write_timestamp( - _SCHEMA_GET_FILTER_OUTPUT.members["UpdatedAt"], self.updated_at - ) - - if self.version is not None: - serializer.write_long( - _SCHEMA_GET_FILTER_OUTPUT.members["Version"], self.version - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_GET_FILTER_OUTPUT.members["Name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_GET_FILTER_OUTPUT.members["Description"] - ) - - case 2: - kwargs["action"] = FilterAction( - de.read_string(_SCHEMA_GET_FILTER_OUTPUT.members["Action"]) - ) - - case 3: - kwargs["rank"] = de.read_integer( - _SCHEMA_GET_FILTER_OUTPUT.members["Rank"] - ) - - case 4: - kwargs["finding_criteria"] = FindingCriteria.deserialize(de) - - case 5: - kwargs["tags"] = _deserialize_tag_map( - de, _SCHEMA_GET_FILTER_OUTPUT.members["Tags"] - ) - - case 6: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_FILTER_OUTPUT.members["CreatedAt"] - ) - - case 7: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_GET_FILTER_OUTPUT.members["UpdatedAt"] - ) - - case 8: - kwargs["version"] = de.read_long( - _SCHEMA_GET_FILTER_OUTPUT.members["Version"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_FILTER_OUTPUT, consumer=_consumer) - return kwargs - - -GET_FILTER = APIOperation( - input=GetFilterInput, - output=GetFilterOutput, - schema=_SCHEMA_GET_FILTER, - input_schema=_SCHEMA_GET_FILTER_INPUT, - output_schema=_SCHEMA_GET_FILTER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetFindingsInput: - """Dataclass for GetFindingsInput structure.""" - - detector_id: str | None = None - """ - The ID of the detector that specifies the GuardDuty service whose - findings you want to retrieve. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - finding_ids: list[str] | None = None - """The IDs of the findings that you want to retrieve.""" - - sort_criteria: SortCriteria | None = None - """Represents the criteria used for sorting findings.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_FINDINGS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_GET_FINDINGS_INPUT.members["DetectorId"], self.detector_id - ) - - if self.finding_ids is not None: - _serialize_finding_ids( - serializer, - _SCHEMA_GET_FINDINGS_INPUT.members["FindingIds"], - self.finding_ids, - ) - - if self.sort_criteria is not None: - serializer.write_struct( - _SCHEMA_GET_FINDINGS_INPUT.members["SortCriteria"], self.sort_criteria - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_GET_FINDINGS_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["finding_ids"] = _deserialize_finding_ids( - de, _SCHEMA_GET_FINDINGS_INPUT.members["FindingIds"] - ) - - case 2: - kwargs["sort_criteria"] = SortCriteria.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_FINDINGS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetFindingsOutput: - """Dataclass for GetFindingsOutput structure.""" - - findings: list[Finding] | None = None - """A list of findings.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_FINDINGS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.findings is not None: - _serialize_findings( - serializer, - _SCHEMA_GET_FINDINGS_OUTPUT.members["Findings"], - self.findings, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["findings"] = _deserialize_findings( - de, _SCHEMA_GET_FINDINGS_OUTPUT.members["Findings"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_FINDINGS_OUTPUT, consumer=_consumer) - return kwargs - - -GET_FINDINGS = APIOperation( - input=GetFindingsInput, - output=GetFindingsOutput, - schema=_SCHEMA_GET_FINDINGS, - input_schema=_SCHEMA_GET_FINDINGS_INPUT, - output_schema=_SCHEMA_GET_FINDINGS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -class GroupByType(UnknownEnumMixin, StrEnum): - ACCOUNT = "ACCOUNT" - DATE = "DATE" - FINDING_TYPE = "FINDING_TYPE" - RESOURCE = "RESOURCE" - SEVERITY = "SEVERITY" - - -@dataclass(kw_only=True) -class GetFindingsStatisticsInput: - """Dataclass for GetFindingsStatisticsInput structure.""" - - detector_id: str | None = None - """ - The ID of the detector whose findings statistics you want to retrieve. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - finding_statistic_types: list[str] | None = None - """The types of finding statistics to retrieve.""" - - finding_criteria: FindingCriteria | None = None - """Represents the criteria that is used for querying findings.""" - - group_by: str | None = None - """ - Displays the findings statistics grouped by one of the listed valid - values. - """ - - order_by: str | None = None - """ - Displays the sorted findings in the requested order. The default value - of `orderBy` is `DESC`. - - You can use this parameter only with the `groupBy` parameter. - """ - - max_results: int | None = None - """ - The maximum number of results to be returned in the response. The - default value is 25. - - You can use this parameter only with the `groupBy` parameter. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_FINDINGS_STATISTICS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_GET_FINDINGS_STATISTICS_INPUT.members["DetectorId"], - self.detector_id, - ) - - if self.finding_statistic_types is not None: - _serialize_finding_statistic_types( - serializer, - _SCHEMA_GET_FINDINGS_STATISTICS_INPUT.members["FindingStatisticTypes"], - self.finding_statistic_types, - ) - - if self.finding_criteria is not None: - serializer.write_struct( - _SCHEMA_GET_FINDINGS_STATISTICS_INPUT.members["FindingCriteria"], - self.finding_criteria, - ) - - if self.group_by is not None: - serializer.write_string( - _SCHEMA_GET_FINDINGS_STATISTICS_INPUT.members["GroupBy"], self.group_by - ) - - if self.order_by is not None: - serializer.write_string( - _SCHEMA_GET_FINDINGS_STATISTICS_INPUT.members["OrderBy"], self.order_by - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_GET_FINDINGS_STATISTICS_INPUT.members["MaxResults"], - self.max_results, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_GET_FINDINGS_STATISTICS_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["finding_statistic_types"] = ( - _deserialize_finding_statistic_types( - de, - _SCHEMA_GET_FINDINGS_STATISTICS_INPUT.members[ - "FindingStatisticTypes" - ], - ) - ) - - case 2: - kwargs["finding_criteria"] = FindingCriteria.deserialize(de) - - case 3: - kwargs["group_by"] = GroupByType( - de.read_string( - _SCHEMA_GET_FINDINGS_STATISTICS_INPUT.members["GroupBy"] - ) - ) - - case 4: - kwargs["order_by"] = OrderBy( - de.read_string( - _SCHEMA_GET_FINDINGS_STATISTICS_INPUT.members["OrderBy"] - ) - ) - - case 5: - kwargs["max_results"] = de.read_integer( - _SCHEMA_GET_FINDINGS_STATISTICS_INPUT.members["MaxResults"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_FINDINGS_STATISTICS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetFindingsStatisticsOutput: - """Dataclass for GetFindingsStatisticsOutput structure.""" - - finding_statistics: FindingStatistics | None = None - """The finding statistics object.""" - - next_token: str | None = None - """ - The pagination parameter to be used on the next list operation to - retrieve more items. - - This parameter is currently not supported. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_FINDINGS_STATISTICS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.finding_statistics is not None: - serializer.write_struct( - _SCHEMA_GET_FINDINGS_STATISTICS_OUTPUT.members["FindingStatistics"], - self.finding_statistics, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_GET_FINDINGS_STATISTICS_OUTPUT.members["NextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["finding_statistics"] = FindingStatistics.deserialize(de) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_GET_FINDINGS_STATISTICS_OUTPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_FINDINGS_STATISTICS_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_FINDINGS_STATISTICS = APIOperation( - input=GetFindingsStatisticsInput, - output=GetFindingsStatisticsOutput, - schema=_SCHEMA_GET_FINDINGS_STATISTICS, - input_schema=_SCHEMA_GET_FINDINGS_STATISTICS_INPUT, - output_schema=_SCHEMA_GET_FINDINGS_STATISTICS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetInvestigationInput: - """Dataclass for GetInvestigationInput structure.""" - - detector_id: str | None = None - """ - The unique ID of the GuardDuty detector associated with the - investigation. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - investigation_id: str | None = None - """The unique identifier of the investigation to retrieve.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_INVESTIGATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_GET_INVESTIGATION_INPUT.members["DetectorId"], self.detector_id - ) - - if self.investigation_id is not None: - serializer.write_string( - _SCHEMA_GET_INVESTIGATION_INPUT.members["InvestigationId"], - self.investigation_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_GET_INVESTIGATION_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["investigation_id"] = de.read_string( - _SCHEMA_GET_INVESTIGATION_INPUT.members["InvestigationId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_INVESTIGATION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Product: - """Contains information about the product that produced an investigation.""" - - name: str | None = None - """The name of the product.""" - - feature: str | None = None - """The specific feature within the product that produced the investigation.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PRODUCT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string(_SCHEMA_PRODUCT.members["Name"], self.name) - - if self.feature is not None: - serializer.write_string(_SCHEMA_PRODUCT.members["Feature"], self.feature) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string(_SCHEMA_PRODUCT.members["Name"]) - - case 1: - kwargs["feature"] = de.read_string( - _SCHEMA_PRODUCT.members["Feature"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PRODUCT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class InvestigationMetadata: - """ - Contains metadata about the product and version that produced an - investigation. - """ - - version: str | None = None - """The version of the investigation engine that produced the results.""" - - product: Product | None = None - """Information about the product that produced the investigation.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVESTIGATION_METADATA, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.version is not None: - serializer.write_string( - _SCHEMA_INVESTIGATION_METADATA.members["Version"], self.version - ) - - if self.product is not None: - serializer.write_struct( - _SCHEMA_INVESTIGATION_METADATA.members["Product"], self.product - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["version"] = de.read_string( - _SCHEMA_INVESTIGATION_METADATA.members["Version"] - ) - - case 1: - kwargs["product"] = Product.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INVESTIGATION_METADATA, consumer=_consumer) - return kwargs - - -class RiskLevel(UnknownEnumMixin, StrEnum): - INFO = "Info" - LOW = "Low" - MEDIUM = "Medium" - HIGH = "High" - CRITICAL = "Critical" - - -class InvestigationStatus(UnknownEnumMixin, StrEnum): - RUNNING = "RUNNING" - COMPLETED = "COMPLETED" - FAILED = "FAILED" - - -@dataclass(kw_only=True) -class Investigation: - """Contains the details and results of a GuardDuty investigation.""" - - investigation_id: str | None = None - """The unique identifier of the investigation.""" - - status: str | None = None - """ - The current status of the investigation. Possible values are `RUNNING`, - `COMPLETED`, and `FAILED`. - """ - - trigger_prompt: str | None = None - """The natural-language prompt that initiated this investigation.""" - - triggered_by: str | None = None - """The account that initiated the investigation.""" - - metadata: InvestigationMetadata | None = None - """Metadata about the product and version that produced the investigation.""" - - cloud: CloudDetails | None = None - """ - Details about the cloud environment in which the investigation was - performed, including the provider, region, and account. - """ - - risk_level: str | None = None - """ - The assessed risk level of the investigated threat. Possible values are - `Info`, `Low`, `Medium`, `High`, and `Critical`. - """ - - risk: str | None = None - """A human-readable description of the assessed risk.""" - - confidence: str | None = None - """ - The confidence level of the investigation's assessment. Possible values - are `Unknown`, `Low`, `Medium`, and `High`. - """ - - summary: str | None = None - """ - A structured summary of the investigation findings, including affected - resources, threat assessment, and recommended remediation steps. - """ - - start_time: datetime | None = None - """The timestamp at which the investigation started.""" - - end_time: datetime | None = None - """The timestamp at which the investigation completed.""" - - error: str | None = None - """Details about the error if the investigation status is `FAILED`.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVESTIGATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.investigation_id is not None: - serializer.write_string( - _SCHEMA_INVESTIGATION.members["InvestigationId"], self.investigation_id - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_INVESTIGATION.members["Status"], self.status - ) - - if self.trigger_prompt is not None: - serializer.write_string( - _SCHEMA_INVESTIGATION.members["TriggerPrompt"], self.trigger_prompt - ) - - if self.triggered_by is not None: - serializer.write_string( - _SCHEMA_INVESTIGATION.members["TriggeredBy"], self.triggered_by - ) - - if self.metadata is not None: - serializer.write_struct( - _SCHEMA_INVESTIGATION.members["Metadata"], self.metadata - ) - - if self.cloud is not None: - serializer.write_struct(_SCHEMA_INVESTIGATION.members["Cloud"], self.cloud) - - if self.risk_level is not None: - serializer.write_string( - _SCHEMA_INVESTIGATION.members["RiskLevel"], self.risk_level - ) - - if self.risk is not None: - serializer.write_string(_SCHEMA_INVESTIGATION.members["Risk"], self.risk) - - if self.confidence is not None: - serializer.write_string( - _SCHEMA_INVESTIGATION.members["Confidence"], self.confidence - ) - - if self.summary is not None: - serializer.write_string( - _SCHEMA_INVESTIGATION.members["Summary"], self.summary - ) - - if self.start_time is not None: - serializer.write_timestamp( - _SCHEMA_INVESTIGATION.members["StartTime"], self.start_time - ) - - if self.end_time is not None: - serializer.write_timestamp( - _SCHEMA_INVESTIGATION.members["EndTime"], self.end_time - ) - - if self.error is not None: - serializer.write_string(_SCHEMA_INVESTIGATION.members["Error"], self.error) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["investigation_id"] = de.read_string( - _SCHEMA_INVESTIGATION.members["InvestigationId"] - ) - - case 1: - kwargs["status"] = InvestigationStatus( - de.read_string(_SCHEMA_INVESTIGATION.members["Status"]) - ) - - case 2: - kwargs["trigger_prompt"] = de.read_string( - _SCHEMA_INVESTIGATION.members["TriggerPrompt"] - ) - - case 3: - kwargs["triggered_by"] = de.read_string( - _SCHEMA_INVESTIGATION.members["TriggeredBy"] - ) - - case 4: - kwargs["metadata"] = InvestigationMetadata.deserialize(de) - - case 5: - kwargs["cloud"] = CloudDetails.deserialize(de) - - case 6: - kwargs["risk_level"] = RiskLevel( - de.read_string(_SCHEMA_INVESTIGATION.members["RiskLevel"]) - ) - - case 7: - kwargs["risk"] = de.read_string( - _SCHEMA_INVESTIGATION.members["Risk"] - ) - - case 8: - kwargs["confidence"] = Confidence( - de.read_string(_SCHEMA_INVESTIGATION.members["Confidence"]) - ) - - case 9: - kwargs["summary"] = de.read_string( - _SCHEMA_INVESTIGATION.members["Summary"] - ) - - case 10: - kwargs["start_time"] = de.read_timestamp( - _SCHEMA_INVESTIGATION.members["StartTime"] - ) - - case 11: - kwargs["end_time"] = de.read_timestamp( - _SCHEMA_INVESTIGATION.members["EndTime"] - ) - - case 12: - kwargs["error"] = de.read_string( - _SCHEMA_INVESTIGATION.members["Error"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INVESTIGATION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetInvestigationOutput: - """Dataclass for GetInvestigationOutput structure.""" - - investigation: Investigation | None = None - """The details and results of the requested investigation.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_INVESTIGATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.investigation is not None: - serializer.write_struct( - _SCHEMA_GET_INVESTIGATION_OUTPUT.members["Investigation"], - self.investigation, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["investigation"] = Investigation.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_INVESTIGATION_OUTPUT, consumer=_consumer) - return kwargs - - -GET_INVESTIGATION = APIOperation( - input=GetInvestigationInput, - output=GetInvestigationOutput, - schema=_SCHEMA_GET_INVESTIGATION, - input_schema=_SCHEMA_GET_INVESTIGATION_INPUT, - output_schema=_SCHEMA_GET_INVESTIGATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.guardduty#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - ShapeID( - "com.amazonaws.guardduty#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetInvitationsCountInput: - """Dataclass for GetInvitationsCountInput structure.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_INVITATIONS_COUNT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_INVITATIONS_COUNT_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetInvitationsCountOutput: - """Dataclass for GetInvitationsCountOutput structure.""" - - invitations_count: int | None = None - """The number of received invitations.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_INVITATIONS_COUNT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.invitations_count is not None: - serializer.write_integer( - _SCHEMA_GET_INVITATIONS_COUNT_OUTPUT.members["InvitationsCount"], - self.invitations_count, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["invitations_count"] = de.read_integer( - _SCHEMA_GET_INVITATIONS_COUNT_OUTPUT.members["InvitationsCount"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_INVITATIONS_COUNT_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_INVITATIONS_COUNT = APIOperation( - input=GetInvitationsCountInput, - output=GetInvitationsCountOutput, - schema=_SCHEMA_GET_INVITATIONS_COUNT, - input_schema=_SCHEMA_GET_INVITATIONS_COUNT_INPUT, - output_schema=_SCHEMA_GET_INVITATIONS_COUNT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetIPSetInput: - """Dataclass for GetIPSetInput structure.""" - - detector_id: str | None = None - """ - The unique ID of the detector that is associated with the IPSet. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - ip_set_id: str | None = None - """The unique ID of the IPSet to retrieve.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_IP_SET_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_GET_IP_SET_INPUT.members["DetectorId"], self.detector_id - ) - - if self.ip_set_id is not None: - serializer.write_string( - _SCHEMA_GET_IP_SET_INPUT.members["IpSetId"], self.ip_set_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_GET_IP_SET_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["ip_set_id"] = de.read_string( - _SCHEMA_GET_IP_SET_INPUT.members["IpSetId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_IP_SET_INPUT, consumer=_consumer) - return kwargs - - -class IpSetStatus(UnknownEnumMixin, StrEnum): - INACTIVE = "INACTIVE" - ACTIVATING = "ACTIVATING" - ACTIVE = "ACTIVE" - DEACTIVATING = "DEACTIVATING" - ERROR = "ERROR" - DELETE_PENDING = "DELETE_PENDING" - DELETED = "DELETED" - - -@dataclass(kw_only=True) -class GetIPSetOutput: - """Dataclass for GetIPSetOutput structure.""" - - name: str | None = None - """The user-friendly name for the IPSet.""" - - format: str | None = None - """The format of the file that contains the IPSet.""" - - location: str | None = None - """The URI of the file that contains the IPSet.""" - - status: str | None = None - """The status of IPSet file that was uploaded.""" - - tags: dict[str, str] | None = None - """The tags of the IPSet resource.""" - - expected_bucket_owner: str | None = None - """ - The Amazon Web Services account ID that owns the Amazon S3 bucket - specified in the **location** parameter. This field appears in the - response only if it was provided during IPSet creation or update. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_IP_SET_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_GET_IP_SET_OUTPUT.members["Name"], self.name - ) - - if self.format is not None: - serializer.write_string( - _SCHEMA_GET_IP_SET_OUTPUT.members["Format"], self.format - ) - - if self.location is not None: - serializer.write_string( - _SCHEMA_GET_IP_SET_OUTPUT.members["Location"], self.location - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_GET_IP_SET_OUTPUT.members["Status"], self.status - ) - - if self.tags is not None: - _serialize_tag_map( - serializer, _SCHEMA_GET_IP_SET_OUTPUT.members["Tags"], self.tags - ) - - if self.expected_bucket_owner is not None: - serializer.write_string( - _SCHEMA_GET_IP_SET_OUTPUT.members["ExpectedBucketOwner"], - self.expected_bucket_owner, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_GET_IP_SET_OUTPUT.members["Name"] - ) - - case 1: - kwargs["format"] = IpSetFormat( - de.read_string(_SCHEMA_GET_IP_SET_OUTPUT.members["Format"]) - ) - - case 2: - kwargs["location"] = de.read_string( - _SCHEMA_GET_IP_SET_OUTPUT.members["Location"] - ) - - case 3: - kwargs["status"] = IpSetStatus( - de.read_string(_SCHEMA_GET_IP_SET_OUTPUT.members["Status"]) - ) - - case 4: - kwargs["tags"] = _deserialize_tag_map( - de, _SCHEMA_GET_IP_SET_OUTPUT.members["Tags"] - ) - - case 5: - kwargs["expected_bucket_owner"] = de.read_string( - _SCHEMA_GET_IP_SET_OUTPUT.members["ExpectedBucketOwner"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_IP_SET_OUTPUT, consumer=_consumer) - return kwargs - - -GET_IP_SET = APIOperation( - input=GetIPSetInput, - output=GetIPSetOutput, - schema=_SCHEMA_GET_IP_SET, - input_schema=_SCHEMA_GET_IP_SET_INPUT, - output_schema=_SCHEMA_GET_IP_SET_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetMalwareProtectionPlanInput: - """Dataclass for GetMalwareProtectionPlanInput structure.""" - - malware_protection_plan_id: str | None = None - """A unique identifier associated with Malware Protection plan resource.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_MALWARE_PROTECTION_PLAN_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.malware_protection_plan_id is not None: - serializer.write_string( - _SCHEMA_GET_MALWARE_PROTECTION_PLAN_INPUT.members[ - "MalwareProtectionPlanId" - ], - self.malware_protection_plan_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["malware_protection_plan_id"] = de.read_string( - _SCHEMA_GET_MALWARE_PROTECTION_PLAN_INPUT.members[ - "MalwareProtectionPlanId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_MALWARE_PROTECTION_PLAN_INPUT, consumer=_consumer - ) - return kwargs - - -class MalwareProtectionPlanStatus(UnknownEnumMixin, StrEnum): - ACTIVE = "ACTIVE" - WARNING = "WARNING" - ERROR = "ERROR" - - -@dataclass(kw_only=True) -class MalwareProtectionPlanStatusReason: - """ - Information about the issue code and message associated to the status of - your Malware Protection plan. - """ - - code: str | None = None - """Issue code.""" - - message: str | None = None - """ - Issue message that specifies the reason. For information about potential - troubleshooting steps, see [Troubleshooting Malware Protection for S3 - status - issues](https://docs.aws.amazon.com/guardduty/latest/ug/troubleshoot-s3-malware-protection-status-errors.html) - in the *Amazon GuardDuty User Guide*. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MALWARE_PROTECTION_PLAN_STATUS_REASON, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.code is not None: - serializer.write_string( - _SCHEMA_MALWARE_PROTECTION_PLAN_STATUS_REASON.members["Code"], self.code - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_MALWARE_PROTECTION_PLAN_STATUS_REASON.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["code"] = de.read_string( - _SCHEMA_MALWARE_PROTECTION_PLAN_STATUS_REASON.members["Code"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_MALWARE_PROTECTION_PLAN_STATUS_REASON.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MALWARE_PROTECTION_PLAN_STATUS_REASON, consumer=_consumer - ) - return kwargs - - -def _serialize_malware_protection_plan_status_reasons_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[MalwareProtectionPlanStatusReason], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_malware_protection_plan_status_reasons_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[MalwareProtectionPlanStatusReason]: - result: list[MalwareProtectionPlanStatusReason] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(MalwareProtectionPlanStatusReason.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GetMalwareProtectionPlanOutput: - """Dataclass for GetMalwareProtectionPlanOutput structure.""" - - arn: str | None = None - """Amazon Resource Name (ARN) of the protected resource.""" - - role: str | None = None - """ - Amazon Resource Name (ARN) of the IAM role that includes the permissions - to scan and add tags to the associated protected resource. - """ - - protected_resource: CreateProtectedResource | None = None - """ - Information about the protected resource that is associated with the - created Malware Protection plan. Presently, `S3Bucket` is the only - supported protected resource. - """ - - actions: MalwareProtectionPlanActions | None = None - """ - Information about whether the tags will be added to the S3 object after - scanning. - """ - - created_at: datetime | None = None - """The timestamp when the Malware Protection plan resource was created.""" - - status: str | None = None - """Malware Protection plan status.""" - - status_reasons: list[MalwareProtectionPlanStatusReason] | None = None - """ - Information about the issue code and message associated to the status of - your Malware Protection plan. - """ - - tags: dict[str, str] | None = None - """Tags added to the Malware Protection plan resource.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_MALWARE_PROTECTION_PLAN_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.arn is not None: - serializer.write_string( - _SCHEMA_GET_MALWARE_PROTECTION_PLAN_OUTPUT.members["Arn"], self.arn - ) - - if self.role is not None: - serializer.write_string( - _SCHEMA_GET_MALWARE_PROTECTION_PLAN_OUTPUT.members["Role"], self.role - ) - - if self.protected_resource is not None: - serializer.write_struct( - _SCHEMA_GET_MALWARE_PROTECTION_PLAN_OUTPUT.members["ProtectedResource"], - self.protected_resource, - ) - - if self.actions is not None: - serializer.write_struct( - _SCHEMA_GET_MALWARE_PROTECTION_PLAN_OUTPUT.members["Actions"], - self.actions, - ) - - if self.created_at is not None: - serializer.write_timestamp( - _SCHEMA_GET_MALWARE_PROTECTION_PLAN_OUTPUT.members["CreatedAt"], - self.created_at, - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_GET_MALWARE_PROTECTION_PLAN_OUTPUT.members["Status"], - self.status, - ) - - if self.status_reasons is not None: - _serialize_malware_protection_plan_status_reasons_list( - serializer, - _SCHEMA_GET_MALWARE_PROTECTION_PLAN_OUTPUT.members["StatusReasons"], - self.status_reasons, - ) - - if self.tags is not None: - _serialize_tag_map( - serializer, - _SCHEMA_GET_MALWARE_PROTECTION_PLAN_OUTPUT.members["Tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["arn"] = de.read_string( - _SCHEMA_GET_MALWARE_PROTECTION_PLAN_OUTPUT.members["Arn"] - ) - - case 1: - kwargs["role"] = de.read_string( - _SCHEMA_GET_MALWARE_PROTECTION_PLAN_OUTPUT.members["Role"] - ) - - case 2: - kwargs["protected_resource"] = CreateProtectedResource.deserialize( - de - ) - - case 3: - kwargs["actions"] = MalwareProtectionPlanActions.deserialize(de) - - case 4: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_MALWARE_PROTECTION_PLAN_OUTPUT.members["CreatedAt"] - ) - - case 5: - kwargs["status"] = MalwareProtectionPlanStatus( - de.read_string( - _SCHEMA_GET_MALWARE_PROTECTION_PLAN_OUTPUT.members["Status"] - ) - ) - - case 6: - kwargs["status_reasons"] = ( - _deserialize_malware_protection_plan_status_reasons_list( - de, - _SCHEMA_GET_MALWARE_PROTECTION_PLAN_OUTPUT.members[ - "StatusReasons" - ], - ) - ) - - case 7: - kwargs["tags"] = _deserialize_tag_map( - de, _SCHEMA_GET_MALWARE_PROTECTION_PLAN_OUTPUT.members["Tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_MALWARE_PROTECTION_PLAN_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_MALWARE_PROTECTION_PLAN = APIOperation( - input=GetMalwareProtectionPlanInput, - output=GetMalwareProtectionPlanOutput, - schema=_SCHEMA_GET_MALWARE_PROTECTION_PLAN, - input_schema=_SCHEMA_GET_MALWARE_PROTECTION_PLAN_INPUT, - output_schema=_SCHEMA_GET_MALWARE_PROTECTION_PLAN_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.guardduty#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - ShapeID( - "com.amazonaws.guardduty#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetMalwareScanInput: - """Dataclass for GetMalwareScanInput structure.""" - - scan_id: str | None = None - """ - A unique identifier that gets generated when you invoke the API without - any error. Each malware scan has a corresponding scan ID. Using this - scan ID, you can monitor the status of your malware scan. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_MALWARE_SCAN_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.scan_id is not None: - serializer.write_string( - _SCHEMA_GET_MALWARE_SCAN_INPUT.members["ScanId"], self.scan_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["scan_id"] = de.read_string( - _SCHEMA_GET_MALWARE_SCAN_INPUT.members["ScanId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_MALWARE_SCAN_INPUT, consumer=_consumer) - return kwargs - - -class MalwareProtectionResourceType(UnknownEnumMixin, StrEnum): - EBS_RECOVERY_POINT = "EBS_RECOVERY_POINT" - EBS_SNAPSHOT = "EBS_SNAPSHOT" - EBS_VOLUME = "EBS_VOLUME" - EC2_AMI = "EC2_AMI" - EC2_INSTANCE = "EC2_INSTANCE" - EC2_RECOVERY_POINT = "EC2_RECOVERY_POINT" - S3_RECOVERY_POINT = "S3_RECOVERY_POINT" - S3_BUCKET = "S3_BUCKET" - S3_POINT_IN_TIME_RECOVERY = "S3_POINT_IN_TIME_RECOVERY" - - -@dataclass(kw_only=True) -class ScanConfigurationRecoveryPoint: - """ - Contains information about the recovery point configuration used in the - scan. - """ - - backup_vault_name: str | None = None - """ - The name of the Amazon Web Services Backup vault that contains the - recovery point for the scanned. - """ - - continuous_scan_details: ScanConfigurationContinuousScanDetails | None = None - """ - The time range within the continuous backup in Amazon Web Services - Backup that was scanned for a point-in-time recovery resource. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SCAN_CONFIGURATION_RECOVERY_POINT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.backup_vault_name is not None: - serializer.write_string( - _SCHEMA_SCAN_CONFIGURATION_RECOVERY_POINT.members["BackupVaultName"], - self.backup_vault_name, - ) - - if self.continuous_scan_details is not None: - serializer.write_struct( - _SCHEMA_SCAN_CONFIGURATION_RECOVERY_POINT.members[ - "ContinuousScanDetails" - ], - self.continuous_scan_details, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["backup_vault_name"] = de.read_string( - _SCHEMA_SCAN_CONFIGURATION_RECOVERY_POINT.members[ - "BackupVaultName" - ] - ) - - case 1: - kwargs["continuous_scan_details"] = ( - ScanConfigurationContinuousScanDetails.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SCAN_CONFIGURATION_RECOVERY_POINT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ScanConfiguration: - """Contains information about the configuration used for the malware scan.""" - - role: str | None = None - """ - Amazon Resource Name (ARN) of the IAM role that should contain the - required permissions for the scan. - """ - - trigger_details: TriggerDetails | None = None - """Information about the entity that triggered the malware scan.""" - - incremental_scan_details: IncrementalScanDetails | None = None - """Information about the incremental scan configuration, if applicable.""" - - recovery_point: ScanConfigurationRecoveryPoint | None = None - """ - Information about the recovery point configuration used for the scan, if - applicable. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SCAN_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.role is not None: - serializer.write_string( - _SCHEMA_SCAN_CONFIGURATION.members["Role"], self.role - ) - - if self.trigger_details is not None: - serializer.write_struct( - _SCHEMA_SCAN_CONFIGURATION.members["TriggerDetails"], - self.trigger_details, - ) - - if self.incremental_scan_details is not None: - serializer.write_struct( - _SCHEMA_SCAN_CONFIGURATION.members["IncrementalScanDetails"], - self.incremental_scan_details, - ) - - if self.recovery_point is not None: - serializer.write_struct( - _SCHEMA_SCAN_CONFIGURATION.members["RecoveryPoint"], self.recovery_point - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["role"] = de.read_string( - _SCHEMA_SCAN_CONFIGURATION.members["Role"] - ) - - case 1: - kwargs["trigger_details"] = TriggerDetails.deserialize(de) - - case 2: - kwargs["incremental_scan_details"] = ( - IncrementalScanDetails.deserialize(de) - ) - - case 3: - kwargs["recovery_point"] = ( - ScanConfigurationRecoveryPoint.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SCAN_CONFIGURATION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ScannedResourceDetails: - """Contains additional information about a resource that was scanned.""" - - ebs_volume: VolumeDetail | None = None - """Contains information about the EBS volume that was scanned.""" - - ebs_snapshot: EbsSnapshot | None = None - """Contains information about the EBS snapshot that was scanned.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SCANNED_RESOURCE_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.ebs_volume is not None: - serializer.write_struct( - _SCHEMA_SCANNED_RESOURCE_DETAILS.members["EbsVolume"], self.ebs_volume - ) - - if self.ebs_snapshot is not None: - serializer.write_struct( - _SCHEMA_SCANNED_RESOURCE_DETAILS.members["EbsSnapshot"], - self.ebs_snapshot, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["ebs_volume"] = VolumeDetail.deserialize(de) - - case 1: - kwargs["ebs_snapshot"] = EbsSnapshot.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SCANNED_RESOURCE_DETAILS, consumer=_consumer) - return kwargs - - -class MalwareProtectionScanStatus(UnknownEnumMixin, StrEnum): - RUNNING = "RUNNING" - COMPLETED = "COMPLETED" - COMPLETED_WITH_ISSUES = "COMPLETED_WITH_ISSUES" - FAILED = "FAILED" - SKIPPED = "SKIPPED" - - -class ScanStatusReason(UnknownEnumMixin, StrEnum): - ACCESS_DENIED = "ACCESS_DENIED" - RESOURCE_NOT_FOUND = "RESOURCE_NOT_FOUND" - SNAPSHOT_SIZE_LIMIT_EXCEEDED = "SNAPSHOT_SIZE_LIMIT_EXCEEDED" - RESOURCE_UNAVAILABLE = "RESOURCE_UNAVAILABLE" - INCONSISTENT_SOURCE = "INCONSISTENT_SOURCE" - INCREMENTAL_NO_DIFFERENCE = "INCREMENTAL_NO_DIFFERENCE" - NO_EBS_VOLUMES_FOUND = "NO_EBS_VOLUMES_FOUND" - UNSUPPORTED_PRODUCT_CODE_TYPE = "UNSUPPORTED_PRODUCT_CODE_TYPE" - AMI_SNAPSHOT_LIMIT_EXCEEDED = "AMI_SNAPSHOT_LIMIT_EXCEEDED" - UNRELATED_RESOURCES = "UNRELATED_RESOURCES" - BASE_RESOURCE_NOT_SCANNED = "BASE_RESOURCE_NOT_SCANNED" - BASE_CREATED_AFTER_TARGET = "BASE_CREATED_AFTER_TARGET" - UNSUPPORTED_FOR_INCREMENTAL = "UNSUPPORTED_FOR_INCREMENTAL" - UNSUPPORTED_AMI = "UNSUPPORTED_AMI" - UNSUPPORTED_SNAPSHOT = "UNSUPPORTED_SNAPSHOT" - UNSUPPORTED_COMPOSITE_RECOVERY_POINT = "UNSUPPORTED_COMPOSITE_RECOVERY_POINT" - ALL_FILES_SKIPPED_OR_FAILED = "ALL_FILES_SKIPPED_OR_FAILED" - - -@dataclass(kw_only=True) -class ScannedResource: - """ - Contains information about a resource that was scanned as part of the - malware scan operation. - """ - - scanned_resource_arn: str | None = None - """Amazon Resource Name (ARN) of the scanned resource.""" - - scanned_resource_type: str | None = None - """The resource type of the scanned resource.""" - - scanned_resource_status: str | None = None - """The status of the scanned resource.""" - - scan_status_reason: str | None = None - """ - The reason for the scan status of this particular resource, if - applicable. - """ - - resource_details: ScannedResourceDetails | None = None - """Information about the scanned resource.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SCANNED_RESOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.scanned_resource_arn is not None: - serializer.write_string( - _SCHEMA_SCANNED_RESOURCE.members["ScannedResourceArn"], - self.scanned_resource_arn, - ) - - if self.scanned_resource_type is not None: - serializer.write_string( - _SCHEMA_SCANNED_RESOURCE.members["ScannedResourceType"], - self.scanned_resource_type, - ) - - if self.scanned_resource_status is not None: - serializer.write_string( - _SCHEMA_SCANNED_RESOURCE.members["ScannedResourceStatus"], - self.scanned_resource_status, - ) - - if self.scan_status_reason is not None: - serializer.write_string( - _SCHEMA_SCANNED_RESOURCE.members["ScanStatusReason"], - self.scan_status_reason, - ) - - if self.resource_details is not None: - serializer.write_struct( - _SCHEMA_SCANNED_RESOURCE.members["ResourceDetails"], - self.resource_details, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["scanned_resource_arn"] = de.read_string( - _SCHEMA_SCANNED_RESOURCE.members["ScannedResourceArn"] - ) - - case 1: - kwargs["scanned_resource_type"] = MalwareProtectionResourceType( - de.read_string( - _SCHEMA_SCANNED_RESOURCE.members["ScannedResourceType"] - ) - ) - - case 2: - kwargs["scanned_resource_status"] = MalwareProtectionScanStatus( - de.read_string( - _SCHEMA_SCANNED_RESOURCE.members["ScannedResourceStatus"] - ) - ) - - case 3: - kwargs["scan_status_reason"] = ScanStatusReason( - de.read_string( - _SCHEMA_SCANNED_RESOURCE.members["ScanStatusReason"] - ) - ) - - case 4: - kwargs["resource_details"] = ScannedResourceDetails.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SCANNED_RESOURCE, consumer=_consumer) - return kwargs - - -def _serialize_scanned_resources( - serializer: ShapeSerializer, schema: Schema, value: list[ScannedResource] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_scanned_resources( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ScannedResource]: - result: list[ScannedResource] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ScannedResource.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class ScanResultStatus(UnknownEnumMixin, StrEnum): - NO_THREATS_FOUND = "NO_THREATS_FOUND" - THREATS_FOUND = "THREATS_FOUND" - - -@dataclass(kw_only=True) -class ScanResultThreat: - """ - Contains information about a specific threat that was detected during - the malware scan. - """ - - name: str | None = None - """The name of the detected threat.""" - - source: str | None = None - """The source that detected this threat.""" - - count: int | None = None - """The number of instances of this threat that were detected.""" - - hash: str | None = None - """The hash value associated with the detected threat.""" - - item_details: list[ItemDetails] | None = None - """Additional information about where this threat was detected.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SCAN_RESULT_THREAT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_SCAN_RESULT_THREAT.members["Name"], self.name - ) - - if self.source is not None: - serializer.write_string( - _SCHEMA_SCAN_RESULT_THREAT.members["Source"], self.source - ) - - if self.count is not None: - serializer.write_long( - _SCHEMA_SCAN_RESULT_THREAT.members["Count"], self.count - ) - - if self.hash is not None: - serializer.write_string( - _SCHEMA_SCAN_RESULT_THREAT.members["Hash"], self.hash - ) - - if self.item_details is not None: - _serialize_item_details_list( - serializer, - _SCHEMA_SCAN_RESULT_THREAT.members["ItemDetails"], - self.item_details, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_SCAN_RESULT_THREAT.members["Name"] - ) - - case 1: - kwargs["source"] = DetectionSource( - de.read_string(_SCHEMA_SCAN_RESULT_THREAT.members["Source"]) - ) - - case 2: - kwargs["count"] = de.read_long( - _SCHEMA_SCAN_RESULT_THREAT.members["Count"] - ) - - case 3: - kwargs["hash"] = de.read_string( - _SCHEMA_SCAN_RESULT_THREAT.members["Hash"] - ) - - case 4: - kwargs["item_details"] = _deserialize_item_details_list( - de, _SCHEMA_SCAN_RESULT_THREAT.members["ItemDetails"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SCAN_RESULT_THREAT, consumer=_consumer) - return kwargs - - -def _serialize_scan_result_threats( - serializer: ShapeSerializer, schema: Schema, value: list[ScanResultThreat] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_scan_result_threats( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ScanResultThreat]: - result: list[ScanResultThreat] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ScanResultThreat.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GetMalwareScanResultDetails: - """Contains information about the results of the malware scan.""" - - scan_result_status: str | None = None - """Status indicating whether threats were found for a completed scan.""" - - skipped_file_count: int | None = None - """The total number of files that were skipped during the scan.""" - - failed_file_count: int | None = None - """The total number of files that failed to be scanned.""" - - threat_found_file_count: int | None = None - """The total number of files in which threats were detected.""" - - total_file_count: int | None = None - """The total number of files that were processed during the scan.""" - - total_bytes: int | None = None - """The total number of bytes that were scanned.""" - - unique_threat_count: int | None = None - """The total number of unique threats that were detected during the scan.""" - - threats: list[ScanResultThreat] | None = None - """The threats that were detected during the malware scan.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_MALWARE_SCAN_RESULT_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.scan_result_status is not None: - serializer.write_string( - _SCHEMA_GET_MALWARE_SCAN_RESULT_DETAILS.members["ScanResultStatus"], - self.scan_result_status, - ) - - if self.skipped_file_count is not None: - serializer.write_long( - _SCHEMA_GET_MALWARE_SCAN_RESULT_DETAILS.members["SkippedFileCount"], - self.skipped_file_count, - ) - - if self.failed_file_count is not None: - serializer.write_long( - _SCHEMA_GET_MALWARE_SCAN_RESULT_DETAILS.members["FailedFileCount"], - self.failed_file_count, - ) - - if self.threat_found_file_count is not None: - serializer.write_long( - _SCHEMA_GET_MALWARE_SCAN_RESULT_DETAILS.members["ThreatFoundFileCount"], - self.threat_found_file_count, - ) - - if self.total_file_count is not None: - serializer.write_long( - _SCHEMA_GET_MALWARE_SCAN_RESULT_DETAILS.members["TotalFileCount"], - self.total_file_count, - ) - - if self.total_bytes is not None: - serializer.write_long( - _SCHEMA_GET_MALWARE_SCAN_RESULT_DETAILS.members["TotalBytes"], - self.total_bytes, - ) - - if self.unique_threat_count is not None: - serializer.write_long( - _SCHEMA_GET_MALWARE_SCAN_RESULT_DETAILS.members["UniqueThreatCount"], - self.unique_threat_count, - ) - - if self.threats is not None: - _serialize_scan_result_threats( - serializer, - _SCHEMA_GET_MALWARE_SCAN_RESULT_DETAILS.members["Threats"], - self.threats, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["scan_result_status"] = ScanResultStatus( - de.read_string( - _SCHEMA_GET_MALWARE_SCAN_RESULT_DETAILS.members[ - "ScanResultStatus" - ] - ) - ) - - case 1: - kwargs["skipped_file_count"] = de.read_long( - _SCHEMA_GET_MALWARE_SCAN_RESULT_DETAILS.members[ - "SkippedFileCount" - ] - ) - - case 2: - kwargs["failed_file_count"] = de.read_long( - _SCHEMA_GET_MALWARE_SCAN_RESULT_DETAILS.members[ - "FailedFileCount" - ] - ) - - case 3: - kwargs["threat_found_file_count"] = de.read_long( - _SCHEMA_GET_MALWARE_SCAN_RESULT_DETAILS.members[ - "ThreatFoundFileCount" - ] - ) - - case 4: - kwargs["total_file_count"] = de.read_long( - _SCHEMA_GET_MALWARE_SCAN_RESULT_DETAILS.members[ - "TotalFileCount" - ] - ) - - case 5: - kwargs["total_bytes"] = de.read_long( - _SCHEMA_GET_MALWARE_SCAN_RESULT_DETAILS.members["TotalBytes"] - ) - - case 6: - kwargs["unique_threat_count"] = de.read_long( - _SCHEMA_GET_MALWARE_SCAN_RESULT_DETAILS.members[ - "UniqueThreatCount" - ] - ) - - case 7: - kwargs["threats"] = _deserialize_scan_result_threats( - de, _SCHEMA_GET_MALWARE_SCAN_RESULT_DETAILS.members["Threats"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_MALWARE_SCAN_RESULT_DETAILS, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetMalwareScanOutput: - """Dataclass for GetMalwareScanOutput structure.""" - - scan_id: str | None = None - """ - A unique identifier associated with the malware scan. Each malware scan - has a corresponding scan ID. Using this scan ID, you can monitor the - status of your malware scan. - """ - - detector_id: str | None = None - """ - The unique ID of the detector that is associated with the request, if it - belongs to an account which is a GuardDuty customer. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - admin_detector_id: str | None = None - """ - The unique detector ID of the administrator account that the request is - associated with. If the account is an administrator, the - `AdminDetectorId` will be the same as the one used for - `DetectorId. If the customer is not a GuardDuty customer, this field will not be present.`. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - resource_arn: str | None = None - """ - Amazon Resource Name (ARN) of the resource on which a malware scan was - invoked. - """ - - resource_type: str | None = None - """The type of resource that was scanned for malware.""" - - scanned_resources_count: int | None = None - """ - The total number of resources that were successfully scanned. This is - dependent on the resource type. - """ - - skipped_resources_count: int | None = None - """The total number of resources that were skipped during the scan.""" - - failed_resources_count: int | None = None - """The total number of resources that failed to be scanned.""" - - scanned_resources: list[ScannedResource] | None = None - """ - A list of resources along with their metadata that were scanned as part - of the malware scan operation. - """ - - scan_configuration: ScanConfiguration | None = None - """Information about the scan configuration used for the malware scan.""" - - scan_category: str | None = None - """The category of the malware scan, indicating the type of scan performed.""" - - scan_status: str | None = None - """A value representing the current status of the malware scan.""" - - scan_status_reason: str | None = None - """Represents the reason for the current scan status, if applicable.""" - - scan_type: str | None = None - """A value representing the initiator of the scan.""" - - scan_started_at: datetime | None = None - """The timestamp representing when the malware scan was started.""" - - scan_completed_at: datetime | None = None - """The timestamp representing when the malware scan was completed.""" - - scan_result_details: GetMalwareScanResultDetails | None = None - """ - Detailed information about the results of the malware scan, if the scan - completed. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_MALWARE_SCAN_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.scan_id is not None: - serializer.write_string( - _SCHEMA_GET_MALWARE_SCAN_OUTPUT.members["ScanId"], self.scan_id - ) - - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_GET_MALWARE_SCAN_OUTPUT.members["DetectorId"], self.detector_id - ) - - if self.admin_detector_id is not None: - serializer.write_string( - _SCHEMA_GET_MALWARE_SCAN_OUTPUT.members["AdminDetectorId"], - self.admin_detector_id, - ) - - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_GET_MALWARE_SCAN_OUTPUT.members["ResourceArn"], - self.resource_arn, - ) - - if self.resource_type is not None: - serializer.write_string( - _SCHEMA_GET_MALWARE_SCAN_OUTPUT.members["ResourceType"], - self.resource_type, - ) - - if self.scanned_resources_count is not None: - serializer.write_integer( - _SCHEMA_GET_MALWARE_SCAN_OUTPUT.members["ScannedResourcesCount"], - self.scanned_resources_count, - ) - - if self.skipped_resources_count is not None: - serializer.write_integer( - _SCHEMA_GET_MALWARE_SCAN_OUTPUT.members["SkippedResourcesCount"], - self.skipped_resources_count, - ) - - if self.failed_resources_count is not None: - serializer.write_integer( - _SCHEMA_GET_MALWARE_SCAN_OUTPUT.members["FailedResourcesCount"], - self.failed_resources_count, - ) - - if self.scanned_resources is not None: - _serialize_scanned_resources( - serializer, - _SCHEMA_GET_MALWARE_SCAN_OUTPUT.members["ScannedResources"], - self.scanned_resources, - ) - - if self.scan_configuration is not None: - serializer.write_struct( - _SCHEMA_GET_MALWARE_SCAN_OUTPUT.members["ScanConfiguration"], - self.scan_configuration, - ) - - if self.scan_category is not None: - serializer.write_string( - _SCHEMA_GET_MALWARE_SCAN_OUTPUT.members["ScanCategory"], - self.scan_category, - ) - - if self.scan_status is not None: - serializer.write_string( - _SCHEMA_GET_MALWARE_SCAN_OUTPUT.members["ScanStatus"], self.scan_status - ) - - if self.scan_status_reason is not None: - serializer.write_string( - _SCHEMA_GET_MALWARE_SCAN_OUTPUT.members["ScanStatusReason"], - self.scan_status_reason, - ) - - if self.scan_type is not None: - serializer.write_string( - _SCHEMA_GET_MALWARE_SCAN_OUTPUT.members["ScanType"], self.scan_type - ) - - if self.scan_started_at is not None: - serializer.write_timestamp( - _SCHEMA_GET_MALWARE_SCAN_OUTPUT.members["ScanStartedAt"], - self.scan_started_at, - ) - - if self.scan_completed_at is not None: - serializer.write_timestamp( - _SCHEMA_GET_MALWARE_SCAN_OUTPUT.members["ScanCompletedAt"], - self.scan_completed_at, - ) - - if self.scan_result_details is not None: - serializer.write_struct( - _SCHEMA_GET_MALWARE_SCAN_OUTPUT.members["ScanResultDetails"], - self.scan_result_details, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["scan_id"] = de.read_string( - _SCHEMA_GET_MALWARE_SCAN_OUTPUT.members["ScanId"] - ) - - case 1: - kwargs["detector_id"] = de.read_string( - _SCHEMA_GET_MALWARE_SCAN_OUTPUT.members["DetectorId"] - ) - - case 2: - kwargs["admin_detector_id"] = de.read_string( - _SCHEMA_GET_MALWARE_SCAN_OUTPUT.members["AdminDetectorId"] - ) - - case 3: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_GET_MALWARE_SCAN_OUTPUT.members["ResourceArn"] - ) - - case 4: - kwargs["resource_type"] = MalwareProtectionResourceType( - de.read_string( - _SCHEMA_GET_MALWARE_SCAN_OUTPUT.members["ResourceType"] - ) - ) - - case 5: - kwargs["scanned_resources_count"] = de.read_integer( - _SCHEMA_GET_MALWARE_SCAN_OUTPUT.members["ScannedResourcesCount"] - ) - - case 6: - kwargs["skipped_resources_count"] = de.read_integer( - _SCHEMA_GET_MALWARE_SCAN_OUTPUT.members["SkippedResourcesCount"] - ) - - case 7: - kwargs["failed_resources_count"] = de.read_integer( - _SCHEMA_GET_MALWARE_SCAN_OUTPUT.members["FailedResourcesCount"] - ) - - case 8: - kwargs["scanned_resources"] = _deserialize_scanned_resources( - de, _SCHEMA_GET_MALWARE_SCAN_OUTPUT.members["ScannedResources"] - ) - - case 9: - kwargs["scan_configuration"] = ScanConfiguration.deserialize(de) - - case 10: - kwargs["scan_category"] = ScanCategory( - de.read_string( - _SCHEMA_GET_MALWARE_SCAN_OUTPUT.members["ScanCategory"] - ) - ) - - case 11: - kwargs["scan_status"] = MalwareProtectionScanStatus( - de.read_string( - _SCHEMA_GET_MALWARE_SCAN_OUTPUT.members["ScanStatus"] - ) - ) - - case 12: - kwargs["scan_status_reason"] = ScanStatusReason( - de.read_string( - _SCHEMA_GET_MALWARE_SCAN_OUTPUT.members["ScanStatusReason"] - ) - ) - - case 13: - kwargs["scan_type"] = MalwareProtectionScanType( - de.read_string( - _SCHEMA_GET_MALWARE_SCAN_OUTPUT.members["ScanType"] - ) - ) - - case 14: - kwargs["scan_started_at"] = de.read_timestamp( - _SCHEMA_GET_MALWARE_SCAN_OUTPUT.members["ScanStartedAt"] - ) - - case 15: - kwargs["scan_completed_at"] = de.read_timestamp( - _SCHEMA_GET_MALWARE_SCAN_OUTPUT.members["ScanCompletedAt"] - ) - - case 16: - kwargs["scan_result_details"] = ( - GetMalwareScanResultDetails.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_MALWARE_SCAN_OUTPUT, consumer=_consumer) - return kwargs - - -GET_MALWARE_SCAN = APIOperation( - input=GetMalwareScanInput, - output=GetMalwareScanOutput, - schema=_SCHEMA_GET_MALWARE_SCAN, - input_schema=_SCHEMA_GET_MALWARE_SCAN_INPUT, - output_schema=_SCHEMA_GET_MALWARE_SCAN_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - ShapeID( - "com.amazonaws.guardduty#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetMalwareScanSettingsInput: - """Dataclass for GetMalwareScanSettingsInput structure.""" - - detector_id: str | None = None - """ - The unique ID of the detector that is associated with this scan. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_MALWARE_SCAN_SETTINGS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_GET_MALWARE_SCAN_SETTINGS_INPUT.members["DetectorId"], - self.detector_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_GET_MALWARE_SCAN_SETTINGS_INPUT.members["DetectorId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_MALWARE_SCAN_SETTINGS_INPUT, consumer=_consumer - ) - return kwargs - - -class ScanCriterionKey(UnknownEnumMixin, StrEnum): - """ - An enum value representing possible resource properties to match with - given scan condition. - """ - - EC2_INSTANCE_TAG = "EC2_INSTANCE_TAG" - - -@dataclass(kw_only=True) -class ScanConditionPair: - """ - Represents the `key:value` pair to be matched against given resource - property. - """ - - key: str | None = None - """Represents the **key** in the map condition.""" - - value: str | None = None - """ - Represents optional **value** in the map condition. If not specified, - only the **key** will be matched. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SCAN_CONDITION_PAIR, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.key is not None: - serializer.write_string( - _SCHEMA_SCAN_CONDITION_PAIR.members["Key"], self.key - ) - - if self.value is not None: - serializer.write_string( - _SCHEMA_SCAN_CONDITION_PAIR.members["Value"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["key"] = de.read_string( - _SCHEMA_SCAN_CONDITION_PAIR.members["Key"] - ) - - case 1: - kwargs["value"] = de.read_string( - _SCHEMA_SCAN_CONDITION_PAIR.members["Value"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SCAN_CONDITION_PAIR, consumer=_consumer) - return kwargs - - -def _serialize_map_equals( - serializer: ShapeSerializer, schema: Schema, value: list[ScanConditionPair] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_map_equals( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ScanConditionPair]: - result: list[ScanConditionPair] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ScanConditionPair.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ScanCondition: - """Contains information about the condition.""" - - map_equals: list[ScanConditionPair] | None = None - """ - Represents an *mapEqual* condition to be applied to a single field when - triggering for malware scan. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SCAN_CONDITION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.map_equals is not None: - _serialize_map_equals( - serializer, _SCHEMA_SCAN_CONDITION.members["MapEquals"], self.map_equals - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["map_equals"] = _deserialize_map_equals( - de, _SCHEMA_SCAN_CONDITION.members["MapEquals"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SCAN_CONDITION, consumer=_consumer) - return kwargs - - -def _serialize_scan_criterion( - serializer: ShapeSerializer, schema: Schema, value: dict[str, ScanCondition] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_struct(value_schema, v)) - - -def _deserialize_scan_criterion( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, ScanCondition]: - result: dict[str, ScanCondition] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = ScanCondition.deserialize(d) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ScanResourceCriteria: - """ - Contains information about criteria used to filter resources before - triggering malware scan. - """ - - include: dict[str, ScanCondition] | None = None - """ - Represents condition that when matched will allow a malware scan for a - certain resource. - """ - - exclude: dict[str, ScanCondition] | None = None - """ - Represents condition that when matched will prevent a malware scan for a - certain resource. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SCAN_RESOURCE_CRITERIA, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.include is not None: - _serialize_scan_criterion( - serializer, - _SCHEMA_SCAN_RESOURCE_CRITERIA.members["Include"], - self.include, - ) - - if self.exclude is not None: - _serialize_scan_criterion( - serializer, - _SCHEMA_SCAN_RESOURCE_CRITERIA.members["Exclude"], - self.exclude, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["include"] = _deserialize_scan_criterion( - de, _SCHEMA_SCAN_RESOURCE_CRITERIA.members["Include"] - ) - - case 1: - kwargs["exclude"] = _deserialize_scan_criterion( - de, _SCHEMA_SCAN_RESOURCE_CRITERIA.members["Exclude"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SCAN_RESOURCE_CRITERIA, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetMalwareScanSettingsOutput: - """Dataclass for GetMalwareScanSettingsOutput structure.""" - - scan_resource_criteria: ScanResourceCriteria | None = None - """Represents the criteria to be used in the filter for scanning resources.""" - - ebs_snapshot_preservation: str | None = None - """An enum value representing possible snapshot preservation settings.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_MALWARE_SCAN_SETTINGS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.scan_resource_criteria is not None: - serializer.write_struct( - _SCHEMA_GET_MALWARE_SCAN_SETTINGS_OUTPUT.members[ - "ScanResourceCriteria" - ], - self.scan_resource_criteria, - ) - - if self.ebs_snapshot_preservation is not None: - serializer.write_string( - _SCHEMA_GET_MALWARE_SCAN_SETTINGS_OUTPUT.members[ - "EbsSnapshotPreservation" - ], - self.ebs_snapshot_preservation, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["scan_resource_criteria"] = ScanResourceCriteria.deserialize( - de - ) - - case 1: - kwargs["ebs_snapshot_preservation"] = EbsSnapshotPreservation( - de.read_string( - _SCHEMA_GET_MALWARE_SCAN_SETTINGS_OUTPUT.members[ - "EbsSnapshotPreservation" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_MALWARE_SCAN_SETTINGS_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_MALWARE_SCAN_SETTINGS = APIOperation( - input=GetMalwareScanSettingsInput, - output=GetMalwareScanSettingsOutput, - schema=_SCHEMA_GET_MALWARE_SCAN_SETTINGS, - input_schema=_SCHEMA_GET_MALWARE_SCAN_SETTINGS_INPUT, - output_schema=_SCHEMA_GET_MALWARE_SCAN_SETTINGS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetMasterAccountInput: - """Dataclass for GetMasterAccountInput structure.""" - - detector_id: str | None = None - """ - The unique ID of the detector of the GuardDuty member account. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_MASTER_ACCOUNT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_GET_MASTER_ACCOUNT_INPUT.members["DetectorId"], self.detector_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_GET_MASTER_ACCOUNT_INPUT.members["DetectorId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_MASTER_ACCOUNT_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Master: - """Contains information about the administrator account and invitation.""" - - account_id: str | None = None - """The ID of the account used as the administrator account.""" - - invitation_id: str | None = None - """ - The value used to validate the administrator account to the member - account. - """ - - relationship_status: str | None = None - """ - The status of the relationship between the administrator and member - accounts. - """ - - invited_at: str | None = None - """The timestamp when the invitation was sent.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MASTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.account_id is not None: - serializer.write_string( - _SCHEMA_MASTER.members["AccountId"], self.account_id - ) - - if self.invitation_id is not None: - serializer.write_string( - _SCHEMA_MASTER.members["InvitationId"], self.invitation_id - ) - - if self.relationship_status is not None: - serializer.write_string( - _SCHEMA_MASTER.members["RelationshipStatus"], self.relationship_status - ) - - if self.invited_at is not None: - serializer.write_string( - _SCHEMA_MASTER.members["InvitedAt"], self.invited_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["account_id"] = de.read_string( - _SCHEMA_MASTER.members["AccountId"] - ) - - case 1: - kwargs["invitation_id"] = de.read_string( - _SCHEMA_MASTER.members["InvitationId"] - ) - - case 2: - kwargs["relationship_status"] = de.read_string( - _SCHEMA_MASTER.members["RelationshipStatus"] - ) - - case 3: - kwargs["invited_at"] = de.read_string( - _SCHEMA_MASTER.members["InvitedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MASTER, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetMasterAccountOutput: - """Dataclass for GetMasterAccountOutput structure.""" - - master: Master | None = None - """The administrator account details.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_MASTER_ACCOUNT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.master is not None: - serializer.write_struct( - _SCHEMA_GET_MASTER_ACCOUNT_OUTPUT.members["Master"], self.master - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["master"] = Master.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_MASTER_ACCOUNT_OUTPUT, consumer=_consumer) - return kwargs - - -GET_MASTER_ACCOUNT = APIOperation( - input=GetMasterAccountInput, - output=GetMasterAccountOutput, - schema=_SCHEMA_GET_MASTER_ACCOUNT, - input_schema=_SCHEMA_GET_MASTER_ACCOUNT_INPUT, - output_schema=_SCHEMA_GET_MASTER_ACCOUNT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetMemberDetectorsInput: - """Dataclass for GetMemberDetectorsInput structure.""" - - detector_id: str | None = None - """ - The detector ID for the administrator account. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - account_ids: list[str] | None = None - """A list of member account IDs.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_MEMBER_DETECTORS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_GET_MEMBER_DETECTORS_INPUT.members["DetectorId"], - self.detector_id, - ) - - if self.account_ids is not None: - _serialize_account_ids( - serializer, - _SCHEMA_GET_MEMBER_DETECTORS_INPUT.members["AccountIds"], - self.account_ids, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_GET_MEMBER_DETECTORS_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["account_ids"] = _deserialize_account_ids( - de, _SCHEMA_GET_MEMBER_DETECTORS_INPUT.members["AccountIds"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_MEMBER_DETECTORS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class MemberAdditionalConfigurationResult: - """Information about the additional configuration for the member account.""" - - name: str | None = None - """ - Indicates the name of the additional configuration that is set for the - member account. - """ - - status: str | None = None - """ - Indicates the status of the additional configuration that is set for the - member account. - """ - - updated_at: datetime | None = None - """ - The timestamp at which the additional configuration was set for the - member account. This is in UTC format. - """ - - managed_by: str | None = None - """ - Indicates what manages the additional configuration. A value of - `GUARDDUTY_POLICY` means a GuardDuty policy manages the additional - configuration. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEMBER_ADDITIONAL_CONFIGURATION_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_MEMBER_ADDITIONAL_CONFIGURATION_RESULT.members["Name"], - self.name, - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_MEMBER_ADDITIONAL_CONFIGURATION_RESULT.members["Status"], - self.status, - ) - - if self.updated_at is not None: - serializer.write_timestamp( - _SCHEMA_MEMBER_ADDITIONAL_CONFIGURATION_RESULT.members["UpdatedAt"], - self.updated_at, - ) - - if self.managed_by is not None: - serializer.write_string( - _SCHEMA_MEMBER_ADDITIONAL_CONFIGURATION_RESULT.members["ManagedBy"], - self.managed_by, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = OrgFeatureAdditionalConfiguration( - de.read_string( - _SCHEMA_MEMBER_ADDITIONAL_CONFIGURATION_RESULT.members[ - "Name" - ] - ) - ) - - case 1: - kwargs["status"] = FeatureStatus( - de.read_string( - _SCHEMA_MEMBER_ADDITIONAL_CONFIGURATION_RESULT.members[ - "Status" - ] - ) - ) - - case 2: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_MEMBER_ADDITIONAL_CONFIGURATION_RESULT.members[ - "UpdatedAt" - ] - ) - - case 3: - kwargs["managed_by"] = ManagedBy( - de.read_string( - _SCHEMA_MEMBER_ADDITIONAL_CONFIGURATION_RESULT.members[ - "ManagedBy" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MEMBER_ADDITIONAL_CONFIGURATION_RESULT, consumer=_consumer - ) - return kwargs - - -def _serialize_member_additional_configuration_results( - serializer: ShapeSerializer, - schema: Schema, - value: list[MemberAdditionalConfigurationResult], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_member_additional_configuration_results( - deserializer: ShapeDeserializer, schema: Schema -) -> list[MemberAdditionalConfigurationResult]: - result: list[MemberAdditionalConfigurationResult] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(MemberAdditionalConfigurationResult.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class MemberFeaturesConfigurationResult: - """Contains information about the features for the member account.""" - - name: str | None = None - """Indicates the name of the feature that is enabled for the detector.""" - - status: str | None = None - """Indicates the status of the feature that is enabled for the detector.""" - - updated_at: datetime | None = None - """The timestamp at which the feature object was updated.""" - - additional_configuration: list[MemberAdditionalConfigurationResult] | None = None - """ - Indicates the additional configuration of the feature that is configured - for the member account. - """ - - managed_by: str | None = None - """ - Indicates what manages the feature. A value of `GUARDDUTY_POLICY` means - a GuardDuty policy manages the feature. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEMBER_FEATURES_CONFIGURATION_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_MEMBER_FEATURES_CONFIGURATION_RESULT.members["Name"], self.name - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_MEMBER_FEATURES_CONFIGURATION_RESULT.members["Status"], - self.status, - ) - - if self.updated_at is not None: - serializer.write_timestamp( - _SCHEMA_MEMBER_FEATURES_CONFIGURATION_RESULT.members["UpdatedAt"], - self.updated_at, - ) - - if self.additional_configuration is not None: - _serialize_member_additional_configuration_results( - serializer, - _SCHEMA_MEMBER_FEATURES_CONFIGURATION_RESULT.members[ - "AdditionalConfiguration" - ], - self.additional_configuration, - ) - - if self.managed_by is not None: - serializer.write_string( - _SCHEMA_MEMBER_FEATURES_CONFIGURATION_RESULT.members["ManagedBy"], - self.managed_by, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = OrgFeature( - de.read_string( - _SCHEMA_MEMBER_FEATURES_CONFIGURATION_RESULT.members["Name"] - ) - ) - - case 1: - kwargs["status"] = FeatureStatus( - de.read_string( - _SCHEMA_MEMBER_FEATURES_CONFIGURATION_RESULT.members[ - "Status" - ] - ) - ) - - case 2: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_MEMBER_FEATURES_CONFIGURATION_RESULT.members[ - "UpdatedAt" - ] - ) - - case 3: - kwargs["additional_configuration"] = ( - _deserialize_member_additional_configuration_results( - de, - _SCHEMA_MEMBER_FEATURES_CONFIGURATION_RESULT.members[ - "AdditionalConfiguration" - ], - ) - ) - - case 4: - kwargs["managed_by"] = ManagedBy( - de.read_string( - _SCHEMA_MEMBER_FEATURES_CONFIGURATION_RESULT.members[ - "ManagedBy" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MEMBER_FEATURES_CONFIGURATION_RESULT, consumer=_consumer - ) - return kwargs - - -def _serialize_member_features_configurations_results( - serializer: ShapeSerializer, - schema: Schema, - value: list[MemberFeaturesConfigurationResult], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_member_features_configurations_results( - deserializer: ShapeDeserializer, schema: Schema -) -> list[MemberFeaturesConfigurationResult]: - result: list[MemberFeaturesConfigurationResult] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(MemberFeaturesConfigurationResult.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class MemberDataSourceConfiguration: - """ - Contains information on which data sources are enabled for a member - account. - """ - - account_id: str | None = None - """The account ID for the member account.""" - - data_sources: DataSourceConfigurationsResult | None = None - """Contains information on the status of data sources for the account.""" - - features: list[MemberFeaturesConfigurationResult] | None = None - """ - Contains information about the status of the features for the member - account. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEMBER_DATA_SOURCE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.account_id is not None: - serializer.write_string( - _SCHEMA_MEMBER_DATA_SOURCE_CONFIGURATION.members["AccountId"], - self.account_id, - ) - - if self.data_sources is not None: - serializer.write_struct( - _SCHEMA_MEMBER_DATA_SOURCE_CONFIGURATION.members["DataSources"], - self.data_sources, - ) - - if self.features is not None: - _serialize_member_features_configurations_results( - serializer, - _SCHEMA_MEMBER_DATA_SOURCE_CONFIGURATION.members["Features"], - self.features, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["account_id"] = de.read_string( - _SCHEMA_MEMBER_DATA_SOURCE_CONFIGURATION.members["AccountId"] - ) - - case 1: - kwargs["data_sources"] = DataSourceConfigurationsResult.deserialize( - de - ) - - case 2: - kwargs["features"] = ( - _deserialize_member_features_configurations_results( - de, - _SCHEMA_MEMBER_DATA_SOURCE_CONFIGURATION.members[ - "Features" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MEMBER_DATA_SOURCE_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -def _serialize_member_data_source_configurations( - serializer: ShapeSerializer, - schema: Schema, - value: list[MemberDataSourceConfiguration], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_member_data_source_configurations( - deserializer: ShapeDeserializer, schema: Schema -) -> list[MemberDataSourceConfiguration]: - result: list[MemberDataSourceConfiguration] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(MemberDataSourceConfiguration.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GetMemberDetectorsOutput: - """Dataclass for GetMemberDetectorsOutput structure.""" - - member_data_source_configurations: list[MemberDataSourceConfiguration] | None = None - """ - An object that describes which data sources are enabled for a member - account. - """ - - unprocessed_accounts: list[UnprocessedAccount] | None = None - """ - A list of member account IDs that were unable to be processed along with - an explanation for why they were not processed. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_MEMBER_DETECTORS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.member_data_source_configurations is not None: - _serialize_member_data_source_configurations( - serializer, - _SCHEMA_GET_MEMBER_DETECTORS_OUTPUT.members[ - "MemberDataSourceConfigurations" - ], - self.member_data_source_configurations, - ) - - if self.unprocessed_accounts is not None: - _serialize_unprocessed_accounts( - serializer, - _SCHEMA_GET_MEMBER_DETECTORS_OUTPUT.members["UnprocessedAccounts"], - self.unprocessed_accounts, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["member_data_source_configurations"] = ( - _deserialize_member_data_source_configurations( - de, - _SCHEMA_GET_MEMBER_DETECTORS_OUTPUT.members[ - "MemberDataSourceConfigurations" - ], - ) - ) - - case 1: - kwargs["unprocessed_accounts"] = _deserialize_unprocessed_accounts( - de, - _SCHEMA_GET_MEMBER_DETECTORS_OUTPUT.members[ - "UnprocessedAccounts" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_MEMBER_DETECTORS_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_MEMBER_DETECTORS = APIOperation( - input=GetMemberDetectorsInput, - output=GetMemberDetectorsOutput, - schema=_SCHEMA_GET_MEMBER_DETECTORS, - input_schema=_SCHEMA_GET_MEMBER_DETECTORS_INPUT, - output_schema=_SCHEMA_GET_MEMBER_DETECTORS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetMembersInput: - """Dataclass for GetMembersInput structure.""" - - detector_id: str | None = None - """ - The unique ID of the detector of the GuardDuty account whose members you - want to retrieve. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - account_ids: list[str] | None = None - """ - A list of account IDs of the GuardDuty member accounts that you want to - describe. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_MEMBERS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_GET_MEMBERS_INPUT.members["DetectorId"], self.detector_id - ) - - if self.account_ids is not None: - _serialize_account_ids( - serializer, - _SCHEMA_GET_MEMBERS_INPUT.members["AccountIds"], - self.account_ids, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_GET_MEMBERS_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["account_ids"] = _deserialize_account_ids( - de, _SCHEMA_GET_MEMBERS_INPUT.members["AccountIds"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_MEMBERS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Member: - """Contains information about the member account.""" - - account_id: str | None = None - """The ID of the member account.""" - - detector_id: str | None = None - """The detector ID of the member account.""" - - master_id: str | None = None - """The administrator account ID.""" - - email: str | None = field(repr=False, default=None) - """The email address of the member account.""" - - relationship_status: str | None = None - """The status of the relationship between the member and the administrator.""" - - invited_at: str | None = None - """The timestamp when the invitation was sent.""" - - updated_at: str | None = None - """The last-updated timestamp of the member.""" - - administrator_id: str | None = None - """The administrator account ID.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEMBER, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.account_id is not None: - serializer.write_string( - _SCHEMA_MEMBER.members["AccountId"], self.account_id - ) - - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_MEMBER.members["DetectorId"], self.detector_id - ) - - if self.master_id is not None: - serializer.write_string(_SCHEMA_MEMBER.members["MasterId"], self.master_id) - - if self.email is not None: - serializer.write_string(_SCHEMA_MEMBER.members["Email"], self.email) - - if self.relationship_status is not None: - serializer.write_string( - _SCHEMA_MEMBER.members["RelationshipStatus"], self.relationship_status - ) - - if self.invited_at is not None: - serializer.write_string( - _SCHEMA_MEMBER.members["InvitedAt"], self.invited_at - ) - - if self.updated_at is not None: - serializer.write_string( - _SCHEMA_MEMBER.members["UpdatedAt"], self.updated_at - ) - - if self.administrator_id is not None: - serializer.write_string( - _SCHEMA_MEMBER.members["AdministratorId"], self.administrator_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["account_id"] = de.read_string( - _SCHEMA_MEMBER.members["AccountId"] - ) - - case 1: - kwargs["detector_id"] = de.read_string( - _SCHEMA_MEMBER.members["DetectorId"] - ) - - case 2: - kwargs["master_id"] = de.read_string( - _SCHEMA_MEMBER.members["MasterId"] - ) - - case 3: - kwargs["email"] = de.read_string(_SCHEMA_MEMBER.members["Email"]) - - case 4: - kwargs["relationship_status"] = de.read_string( - _SCHEMA_MEMBER.members["RelationshipStatus"] - ) - - case 5: - kwargs["invited_at"] = de.read_string( - _SCHEMA_MEMBER.members["InvitedAt"] - ) - - case 6: - kwargs["updated_at"] = de.read_string( - _SCHEMA_MEMBER.members["UpdatedAt"] - ) - - case 7: - kwargs["administrator_id"] = de.read_string( - _SCHEMA_MEMBER.members["AdministratorId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MEMBER, consumer=_consumer) - return kwargs - - -def _serialize_members( - serializer: ShapeSerializer, schema: Schema, value: list[Member] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_members( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Member]: - result: list[Member] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Member.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GetMembersOutput: - """Dataclass for GetMembersOutput structure.""" - - members: list[Member] | None = None - """A list of members.""" - - unprocessed_accounts: list[UnprocessedAccount] | None = None - """ - A list of objects that contain the unprocessed account and a result - string that explains why it was unprocessed. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_MEMBERS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.members is not None: - _serialize_members( - serializer, _SCHEMA_GET_MEMBERS_OUTPUT.members["Members"], self.members - ) - - if self.unprocessed_accounts is not None: - _serialize_unprocessed_accounts( - serializer, - _SCHEMA_GET_MEMBERS_OUTPUT.members["UnprocessedAccounts"], - self.unprocessed_accounts, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["members"] = _deserialize_members( - de, _SCHEMA_GET_MEMBERS_OUTPUT.members["Members"] - ) - - case 1: - kwargs["unprocessed_accounts"] = _deserialize_unprocessed_accounts( - de, _SCHEMA_GET_MEMBERS_OUTPUT.members["UnprocessedAccounts"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_MEMBERS_OUTPUT, consumer=_consumer) - return kwargs - - -GET_MEMBERS = APIOperation( - input=GetMembersInput, - output=GetMembersOutput, - schema=_SCHEMA_GET_MEMBERS, - input_schema=_SCHEMA_GET_MEMBERS_INPUT, - output_schema=_SCHEMA_GET_MEMBERS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetOrganizationStatisticsInput: - """Dataclass for GetOrganizationStatisticsInput structure.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_ORGANIZATION_STATISTICS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_ORGANIZATION_STATISTICS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class OrganizationFeatureStatisticsAdditionalConfiguration: - """ - Information about the coverage statistic for the additional - configuration of the feature. - """ - - name: str | None = None - """Name of the additional configuration within a feature.""" - - enabled_accounts_count: int | None = None - """Total number of accounts that have enabled the additional configuration.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_ORGANIZATION_FEATURE_STATISTICS_ADDITIONAL_CONFIGURATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_ORGANIZATION_FEATURE_STATISTICS_ADDITIONAL_CONFIGURATION.members[ - "Name" - ], - self.name, - ) - - if self.enabled_accounts_count is not None: - serializer.write_integer( - _SCHEMA_ORGANIZATION_FEATURE_STATISTICS_ADDITIONAL_CONFIGURATION.members[ - "EnabledAccountsCount" - ], - self.enabled_accounts_count, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = OrgFeatureAdditionalConfiguration( - de.read_string( - _SCHEMA_ORGANIZATION_FEATURE_STATISTICS_ADDITIONAL_CONFIGURATION.members[ - "Name" - ] - ) - ) - - case 1: - kwargs["enabled_accounts_count"] = de.read_integer( - _SCHEMA_ORGANIZATION_FEATURE_STATISTICS_ADDITIONAL_CONFIGURATION.members[ - "EnabledAccountsCount" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ORGANIZATION_FEATURE_STATISTICS_ADDITIONAL_CONFIGURATION, - consumer=_consumer, - ) - return kwargs - - -def _serialize_organization_feature_statistics_additional_configurations( - serializer: ShapeSerializer, - schema: Schema, - value: list[OrganizationFeatureStatisticsAdditionalConfiguration], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_organization_feature_statistics_additional_configurations( - deserializer: ShapeDeserializer, schema: Schema -) -> list[OrganizationFeatureStatisticsAdditionalConfiguration]: - result: list[OrganizationFeatureStatisticsAdditionalConfiguration] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append( - OrganizationFeatureStatisticsAdditionalConfiguration.deserialize(d) - ) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class OrganizationFeatureStatistics: - """ - Information about the number of accounts that have enabled a specific - feature. - """ - - name: str | None = None - """Name of the feature.""" - - enabled_accounts_count: int | None = None - """Total number of accounts that have enabled a specific feature.""" - - additional_configuration: ( - list[OrganizationFeatureStatisticsAdditionalConfiguration] | None - ) = None - """Name of the additional configuration.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ORGANIZATION_FEATURE_STATISTICS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_ORGANIZATION_FEATURE_STATISTICS.members["Name"], self.name - ) - - if self.enabled_accounts_count is not None: - serializer.write_integer( - _SCHEMA_ORGANIZATION_FEATURE_STATISTICS.members["EnabledAccountsCount"], - self.enabled_accounts_count, - ) - - if self.additional_configuration is not None: - _serialize_organization_feature_statistics_additional_configurations( - serializer, - _SCHEMA_ORGANIZATION_FEATURE_STATISTICS.members[ - "AdditionalConfiguration" - ], - self.additional_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = OrgFeature( - de.read_string( - _SCHEMA_ORGANIZATION_FEATURE_STATISTICS.members["Name"] - ) - ) - - case 1: - kwargs["enabled_accounts_count"] = de.read_integer( - _SCHEMA_ORGANIZATION_FEATURE_STATISTICS.members[ - "EnabledAccountsCount" - ] - ) - - case 2: - kwargs["additional_configuration"] = ( - _deserialize_organization_feature_statistics_additional_configurations( - de, - _SCHEMA_ORGANIZATION_FEATURE_STATISTICS.members[ - "AdditionalConfiguration" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ORGANIZATION_FEATURE_STATISTICS, consumer=_consumer - ) - return kwargs - - -def _serialize_organization_feature_statistics_results( - serializer: ShapeSerializer, - schema: Schema, - value: list[OrganizationFeatureStatistics], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_organization_feature_statistics_results( - deserializer: ShapeDeserializer, schema: Schema -) -> list[OrganizationFeatureStatistics]: - result: list[OrganizationFeatureStatistics] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(OrganizationFeatureStatistics.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class OrganizationStatistics: - """ - Information about the coverage statistics of the features for the entire - Amazon Web Services organization. - - When you create a new Amazon Web Services organization, it might take up - to 24 hours to generate the statistics summary for this organization. - """ - - total_accounts_count: int | None = None - """Total number of accounts in your Amazon Web Services organization.""" - - member_accounts_count: int | None = None - """ - Total number of accounts in your Amazon Web Services organization that - are associated with GuardDuty. - """ - - active_accounts_count: int | None = None - """ - Total number of active accounts in your Amazon Web Services organization - that are associated with GuardDuty. - """ - - enabled_accounts_count: int | None = None - """Total number of accounts that have enabled GuardDuty.""" - - count_by_feature: list[OrganizationFeatureStatistics] | None = None - """Retrieves the coverage statistics for each feature.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ORGANIZATION_STATISTICS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.total_accounts_count is not None: - serializer.write_integer( - _SCHEMA_ORGANIZATION_STATISTICS.members["TotalAccountsCount"], - self.total_accounts_count, - ) - - if self.member_accounts_count is not None: - serializer.write_integer( - _SCHEMA_ORGANIZATION_STATISTICS.members["MemberAccountsCount"], - self.member_accounts_count, - ) - - if self.active_accounts_count is not None: - serializer.write_integer( - _SCHEMA_ORGANIZATION_STATISTICS.members["ActiveAccountsCount"], - self.active_accounts_count, - ) - - if self.enabled_accounts_count is not None: - serializer.write_integer( - _SCHEMA_ORGANIZATION_STATISTICS.members["EnabledAccountsCount"], - self.enabled_accounts_count, - ) - - if self.count_by_feature is not None: - _serialize_organization_feature_statistics_results( - serializer, - _SCHEMA_ORGANIZATION_STATISTICS.members["CountByFeature"], - self.count_by_feature, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["total_accounts_count"] = de.read_integer( - _SCHEMA_ORGANIZATION_STATISTICS.members["TotalAccountsCount"] - ) - - case 1: - kwargs["member_accounts_count"] = de.read_integer( - _SCHEMA_ORGANIZATION_STATISTICS.members["MemberAccountsCount"] - ) - - case 2: - kwargs["active_accounts_count"] = de.read_integer( - _SCHEMA_ORGANIZATION_STATISTICS.members["ActiveAccountsCount"] - ) - - case 3: - kwargs["enabled_accounts_count"] = de.read_integer( - _SCHEMA_ORGANIZATION_STATISTICS.members["EnabledAccountsCount"] - ) - - case 4: - kwargs["count_by_feature"] = ( - _deserialize_organization_feature_statistics_results( - de, - _SCHEMA_ORGANIZATION_STATISTICS.members["CountByFeature"], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ORGANIZATION_STATISTICS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class OrganizationDetails: - """ - Information about GuardDuty coverage statistics for members in your - Amazon Web Services organization. - """ - - updated_at: datetime | None = None - """ - The timestamp at which the organization statistics was last updated. - This is in UTC format. - """ - - organization_statistics: OrganizationStatistics | None = None - """ - Information about the GuardDuty coverage statistics for members in your - Amazon Web Services organization. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ORGANIZATION_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.updated_at is not None: - serializer.write_timestamp( - _SCHEMA_ORGANIZATION_DETAILS.members["UpdatedAt"], self.updated_at - ) - - if self.organization_statistics is not None: - serializer.write_struct( - _SCHEMA_ORGANIZATION_DETAILS.members["OrganizationStatistics"], - self.organization_statistics, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_ORGANIZATION_DETAILS.members["UpdatedAt"] - ) - - case 1: - kwargs["organization_statistics"] = ( - OrganizationStatistics.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ORGANIZATION_DETAILS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetOrganizationStatisticsOutput: - """Dataclass for GetOrganizationStatisticsOutput structure.""" - - organization_details: OrganizationDetails | None = None - """Information about the statistics report for your organization.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_ORGANIZATION_STATISTICS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.organization_details is not None: - serializer.write_struct( - _SCHEMA_GET_ORGANIZATION_STATISTICS_OUTPUT.members[ - "OrganizationDetails" - ], - self.organization_details, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["organization_details"] = OrganizationDetails.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_ORGANIZATION_STATISTICS_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_ORGANIZATION_STATISTICS = APIOperation( - input=GetOrganizationStatisticsInput, - output=GetOrganizationStatisticsOutput, - schema=_SCHEMA_GET_ORGANIZATION_STATISTICS, - input_schema=_SCHEMA_GET_ORGANIZATION_STATISTICS_INPUT, - output_schema=_SCHEMA_GET_ORGANIZATION_STATISTICS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetRemainingFreeTrialDaysInput: - """Dataclass for GetRemainingFreeTrialDaysInput structure.""" - - detector_id: str | None = None - """ - The unique ID of the detector of the GuardDuty member account. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - account_ids: list[str] | None = None - """A list of account identifiers of the GuardDuty member account.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_REMAINING_FREE_TRIAL_DAYS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_GET_REMAINING_FREE_TRIAL_DAYS_INPUT.members["DetectorId"], - self.detector_id, - ) - - if self.account_ids is not None: - _serialize_account_ids( - serializer, - _SCHEMA_GET_REMAINING_FREE_TRIAL_DAYS_INPUT.members["AccountIds"], - self.account_ids, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_GET_REMAINING_FREE_TRIAL_DAYS_INPUT.members[ - "DetectorId" - ] - ) - - case 1: - kwargs["account_ids"] = _deserialize_account_ids( - de, - _SCHEMA_GET_REMAINING_FREE_TRIAL_DAYS_INPUT.members[ - "AccountIds" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_REMAINING_FREE_TRIAL_DAYS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetRemainingFreeTrialDaysOutput: - """Dataclass for GetRemainingFreeTrialDaysOutput structure.""" - - accounts: list[AccountFreeTrialInfo] | None = None - """ - The member accounts which were included in a request and were processed - successfully. - """ - - unprocessed_accounts: list[UnprocessedAccount] | None = None - """ - The member account that was included in a request but for which the - request could not be processed. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_REMAINING_FREE_TRIAL_DAYS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.accounts is not None: - _serialize_account_free_trial_infos( - serializer, - _SCHEMA_GET_REMAINING_FREE_TRIAL_DAYS_OUTPUT.members["Accounts"], - self.accounts, - ) - - if self.unprocessed_accounts is not None: - _serialize_unprocessed_accounts( - serializer, - _SCHEMA_GET_REMAINING_FREE_TRIAL_DAYS_OUTPUT.members[ - "UnprocessedAccounts" - ], - self.unprocessed_accounts, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["accounts"] = _deserialize_account_free_trial_infos( - de, - _SCHEMA_GET_REMAINING_FREE_TRIAL_DAYS_OUTPUT.members[ - "Accounts" - ], - ) - - case 1: - kwargs["unprocessed_accounts"] = _deserialize_unprocessed_accounts( - de, - _SCHEMA_GET_REMAINING_FREE_TRIAL_DAYS_OUTPUT.members[ - "UnprocessedAccounts" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_REMAINING_FREE_TRIAL_DAYS_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_REMAINING_FREE_TRIAL_DAYS = APIOperation( - input=GetRemainingFreeTrialDaysInput, - output=GetRemainingFreeTrialDaysOutput, - schema=_SCHEMA_GET_REMAINING_FREE_TRIAL_DAYS, - input_schema=_SCHEMA_GET_REMAINING_FREE_TRIAL_DAYS_INPUT, - output_schema=_SCHEMA_GET_REMAINING_FREE_TRIAL_DAYS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetThreatEntitySetInput: - """Dataclass for GetThreatEntitySetInput structure.""" - - detector_id: str | None = None - """ - The unique ID of the detector associated with the threat entity set - resource. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - threat_entity_set_id: str | None = None - """The unique ID that helps GuardDuty identify the threat entity set.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_THREAT_ENTITY_SET_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_GET_THREAT_ENTITY_SET_INPUT.members["DetectorId"], - self.detector_id, - ) - - if self.threat_entity_set_id is not None: - serializer.write_string( - _SCHEMA_GET_THREAT_ENTITY_SET_INPUT.members["ThreatEntitySetId"], - self.threat_entity_set_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_GET_THREAT_ENTITY_SET_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["threat_entity_set_id"] = de.read_string( - _SCHEMA_GET_THREAT_ENTITY_SET_INPUT.members["ThreatEntitySetId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_THREAT_ENTITY_SET_INPUT, consumer=_consumer - ) - return kwargs - - -class ThreatEntitySetStatus(UnknownEnumMixin, StrEnum): - INACTIVE = "INACTIVE" - ACTIVATING = "ACTIVATING" - ACTIVE = "ACTIVE" - DEACTIVATING = "DEACTIVATING" - ERROR = "ERROR" - DELETE_PENDING = "DELETE_PENDING" - DELETED = "DELETED" - - -@dataclass(kw_only=True) -class GetThreatEntitySetOutput: - """Dataclass for GetThreatEntitySetOutput structure.""" - - name: str | None = None - """ - The name of the threat entity set associated with the specified - `threatEntitySetId`. - """ - - format: str | None = None - """The format of the file that contains the threat entity set.""" - - location: str | None = None - """The URI of the file that contains the threat entity set.""" - - expected_bucket_owner: str | None = None - """ - The Amazon Web Services account ID that owns the Amazon S3 bucket - specified in the **location** parameter. - """ - - status: str | None = None - """The status of the associated threat entity set.""" - - tags: dict[str, str] | None = None - """The tags associated with the threat entity set resource.""" - - created_at: datetime | None = None - """The timestamp when the associated threat entity set was created.""" - - updated_at: datetime | None = None - """The timestamp when the associated threat entity set was updated.""" - - error_details: str | None = None - """The error details when the status is shown as `ERROR`.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_THREAT_ENTITY_SET_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_GET_THREAT_ENTITY_SET_OUTPUT.members["Name"], self.name - ) - - if self.format is not None: - serializer.write_string( - _SCHEMA_GET_THREAT_ENTITY_SET_OUTPUT.members["Format"], self.format - ) - - if self.location is not None: - serializer.write_string( - _SCHEMA_GET_THREAT_ENTITY_SET_OUTPUT.members["Location"], self.location - ) - - if self.expected_bucket_owner is not None: - serializer.write_string( - _SCHEMA_GET_THREAT_ENTITY_SET_OUTPUT.members["ExpectedBucketOwner"], - self.expected_bucket_owner, - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_GET_THREAT_ENTITY_SET_OUTPUT.members["Status"], self.status - ) - - if self.tags is not None: - _serialize_tag_map( - serializer, - _SCHEMA_GET_THREAT_ENTITY_SET_OUTPUT.members["Tags"], - self.tags, - ) - - if self.created_at is not None: - serializer.write_timestamp( - _SCHEMA_GET_THREAT_ENTITY_SET_OUTPUT.members["CreatedAt"], - self.created_at, - ) - - if self.updated_at is not None: - serializer.write_timestamp( - _SCHEMA_GET_THREAT_ENTITY_SET_OUTPUT.members["UpdatedAt"], - self.updated_at, - ) - - if self.error_details is not None: - serializer.write_string( - _SCHEMA_GET_THREAT_ENTITY_SET_OUTPUT.members["ErrorDetails"], - self.error_details, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_GET_THREAT_ENTITY_SET_OUTPUT.members["Name"] - ) - - case 1: - kwargs["format"] = ThreatEntitySetFormat( - de.read_string( - _SCHEMA_GET_THREAT_ENTITY_SET_OUTPUT.members["Format"] - ) - ) - - case 2: - kwargs["location"] = de.read_string( - _SCHEMA_GET_THREAT_ENTITY_SET_OUTPUT.members["Location"] - ) - - case 3: - kwargs["expected_bucket_owner"] = de.read_string( - _SCHEMA_GET_THREAT_ENTITY_SET_OUTPUT.members[ - "ExpectedBucketOwner" - ] - ) - - case 4: - kwargs["status"] = ThreatEntitySetStatus( - de.read_string( - _SCHEMA_GET_THREAT_ENTITY_SET_OUTPUT.members["Status"] - ) - ) - - case 5: - kwargs["tags"] = _deserialize_tag_map( - de, _SCHEMA_GET_THREAT_ENTITY_SET_OUTPUT.members["Tags"] - ) - - case 6: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_THREAT_ENTITY_SET_OUTPUT.members["CreatedAt"] - ) - - case 7: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_GET_THREAT_ENTITY_SET_OUTPUT.members["UpdatedAt"] - ) - - case 8: - kwargs["error_details"] = de.read_string( - _SCHEMA_GET_THREAT_ENTITY_SET_OUTPUT.members["ErrorDetails"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_THREAT_ENTITY_SET_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_THREAT_ENTITY_SET = APIOperation( - input=GetThreatEntitySetInput, - output=GetThreatEntitySetOutput, - schema=_SCHEMA_GET_THREAT_ENTITY_SET, - input_schema=_SCHEMA_GET_THREAT_ENTITY_SET_INPUT, - output_schema=_SCHEMA_GET_THREAT_ENTITY_SET_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetThreatIntelSetInput: - """Dataclass for GetThreatIntelSetInput structure.""" - - detector_id: str | None = None - """ - The unique ID of the detector that is associated with the - threatIntelSet. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - threat_intel_set_id: str | None = None - """The unique ID of the threatIntelSet that you want to get.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_THREAT_INTEL_SET_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_GET_THREAT_INTEL_SET_INPUT.members["DetectorId"], - self.detector_id, - ) - - if self.threat_intel_set_id is not None: - serializer.write_string( - _SCHEMA_GET_THREAT_INTEL_SET_INPUT.members["ThreatIntelSetId"], - self.threat_intel_set_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_GET_THREAT_INTEL_SET_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["threat_intel_set_id"] = de.read_string( - _SCHEMA_GET_THREAT_INTEL_SET_INPUT.members["ThreatIntelSetId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_THREAT_INTEL_SET_INPUT, consumer=_consumer) - return kwargs - - -class ThreatIntelSetStatus(UnknownEnumMixin, StrEnum): - INACTIVE = "INACTIVE" - ACTIVATING = "ACTIVATING" - ACTIVE = "ACTIVE" - DEACTIVATING = "DEACTIVATING" - ERROR = "ERROR" - DELETE_PENDING = "DELETE_PENDING" - DELETED = "DELETED" - - -@dataclass(kw_only=True) -class GetThreatIntelSetOutput: - """Dataclass for GetThreatIntelSetOutput structure.""" - - name: str | None = None - """ - A user-friendly ThreatIntelSet name displayed in all findings that are - generated by activity that involves IP addresses included in this - ThreatIntelSet. - """ - - format: str | None = None - """The format of the threatIntelSet.""" - - location: str | None = None - """The URI of the file that contains the ThreatIntelSet.""" - - status: str | None = None - """The status of threatIntelSet file uploaded.""" - - tags: dict[str, str] | None = None - """The tags of the threat list resource.""" - - expected_bucket_owner: str | None = None - """ - The Amazon Web Services account ID that owns the Amazon S3 bucket - specified in the **location** parameter. This field appears in the - response only if it was provided during ThreatIntelSet creation or - update. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_THREAT_INTEL_SET_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_GET_THREAT_INTEL_SET_OUTPUT.members["Name"], self.name - ) - - if self.format is not None: - serializer.write_string( - _SCHEMA_GET_THREAT_INTEL_SET_OUTPUT.members["Format"], self.format - ) - - if self.location is not None: - serializer.write_string( - _SCHEMA_GET_THREAT_INTEL_SET_OUTPUT.members["Location"], self.location - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_GET_THREAT_INTEL_SET_OUTPUT.members["Status"], self.status - ) - - if self.tags is not None: - _serialize_tag_map( - serializer, - _SCHEMA_GET_THREAT_INTEL_SET_OUTPUT.members["Tags"], - self.tags, - ) - - if self.expected_bucket_owner is not None: - serializer.write_string( - _SCHEMA_GET_THREAT_INTEL_SET_OUTPUT.members["ExpectedBucketOwner"], - self.expected_bucket_owner, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_GET_THREAT_INTEL_SET_OUTPUT.members["Name"] - ) - - case 1: - kwargs["format"] = ThreatIntelSetFormat( - de.read_string( - _SCHEMA_GET_THREAT_INTEL_SET_OUTPUT.members["Format"] - ) - ) - - case 2: - kwargs["location"] = de.read_string( - _SCHEMA_GET_THREAT_INTEL_SET_OUTPUT.members["Location"] - ) - - case 3: - kwargs["status"] = ThreatIntelSetStatus( - de.read_string( - _SCHEMA_GET_THREAT_INTEL_SET_OUTPUT.members["Status"] - ) - ) - - case 4: - kwargs["tags"] = _deserialize_tag_map( - de, _SCHEMA_GET_THREAT_INTEL_SET_OUTPUT.members["Tags"] - ) - - case 5: - kwargs["expected_bucket_owner"] = de.read_string( - _SCHEMA_GET_THREAT_INTEL_SET_OUTPUT.members[ - "ExpectedBucketOwner" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_THREAT_INTEL_SET_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_THREAT_INTEL_SET = APIOperation( - input=GetThreatIntelSetInput, - output=GetThreatIntelSetOutput, - schema=_SCHEMA_GET_THREAT_INTEL_SET, - input_schema=_SCHEMA_GET_THREAT_INTEL_SET_INPUT, - output_schema=_SCHEMA_GET_THREAT_INTEL_SET_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetTrustedEntitySetInput: - """Dataclass for GetTrustedEntitySetInput structure.""" - - detector_id: str | None = None - """ - The unique ID of the GuardDuty detector associated with this trusted - entity set. - """ - - trusted_entity_set_id: str | None = None - """The unique ID that helps GuardDuty identify the trusted entity set.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_TRUSTED_ENTITY_SET_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_GET_TRUSTED_ENTITY_SET_INPUT.members["DetectorId"], - self.detector_id, - ) - - if self.trusted_entity_set_id is not None: - serializer.write_string( - _SCHEMA_GET_TRUSTED_ENTITY_SET_INPUT.members["TrustedEntitySetId"], - self.trusted_entity_set_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_GET_TRUSTED_ENTITY_SET_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["trusted_entity_set_id"] = de.read_string( - _SCHEMA_GET_TRUSTED_ENTITY_SET_INPUT.members[ - "TrustedEntitySetId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_TRUSTED_ENTITY_SET_INPUT, consumer=_consumer - ) - return kwargs - - -class TrustedEntitySetStatus(UnknownEnumMixin, StrEnum): - INACTIVE = "INACTIVE" - ACTIVATING = "ACTIVATING" - ACTIVE = "ACTIVE" - DEACTIVATING = "DEACTIVATING" - ERROR = "ERROR" - DELETE_PENDING = "DELETE_PENDING" - DELETED = "DELETED" - - -@dataclass(kw_only=True) -class GetTrustedEntitySetOutput: - """Dataclass for GetTrustedEntitySetOutput structure.""" - - name: str | None = None - """ - The name of the threat entity set associated with the specified - `trustedEntitySetId`. - """ - - format: str | None = None - """The format of the file that contains the trusted entity set.""" - - location: str | None = None - """The URI of the file that contains the trusted entity set.""" - - expected_bucket_owner: str | None = None - """ - The Amazon Web Services account ID that owns the Amazon S3 bucket - specified in the **location** parameter. - """ - - status: str | None = None - """The status of the associated trusted entity set.""" - - tags: dict[str, str] | None = None - """The tags associated with trusted entity set resource.""" - - created_at: datetime | None = None - """The timestamp when the associated trusted entity set was created.""" - - updated_at: datetime | None = None - """The timestamp when the associated trusted entity set was updated.""" - - error_details: str | None = None - """The error details when the status is shown as `ERROR`.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_TRUSTED_ENTITY_SET_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_GET_TRUSTED_ENTITY_SET_OUTPUT.members["Name"], self.name - ) - - if self.format is not None: - serializer.write_string( - _SCHEMA_GET_TRUSTED_ENTITY_SET_OUTPUT.members["Format"], self.format - ) - - if self.location is not None: - serializer.write_string( - _SCHEMA_GET_TRUSTED_ENTITY_SET_OUTPUT.members["Location"], self.location - ) - - if self.expected_bucket_owner is not None: - serializer.write_string( - _SCHEMA_GET_TRUSTED_ENTITY_SET_OUTPUT.members["ExpectedBucketOwner"], - self.expected_bucket_owner, - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_GET_TRUSTED_ENTITY_SET_OUTPUT.members["Status"], self.status - ) - - if self.tags is not None: - _serialize_tag_map( - serializer, - _SCHEMA_GET_TRUSTED_ENTITY_SET_OUTPUT.members["Tags"], - self.tags, - ) - - if self.created_at is not None: - serializer.write_timestamp( - _SCHEMA_GET_TRUSTED_ENTITY_SET_OUTPUT.members["CreatedAt"], - self.created_at, - ) - - if self.updated_at is not None: - serializer.write_timestamp( - _SCHEMA_GET_TRUSTED_ENTITY_SET_OUTPUT.members["UpdatedAt"], - self.updated_at, - ) - - if self.error_details is not None: - serializer.write_string( - _SCHEMA_GET_TRUSTED_ENTITY_SET_OUTPUT.members["ErrorDetails"], - self.error_details, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_GET_TRUSTED_ENTITY_SET_OUTPUT.members["Name"] - ) - - case 1: - kwargs["format"] = TrustedEntitySetFormat( - de.read_string( - _SCHEMA_GET_TRUSTED_ENTITY_SET_OUTPUT.members["Format"] - ) - ) - - case 2: - kwargs["location"] = de.read_string( - _SCHEMA_GET_TRUSTED_ENTITY_SET_OUTPUT.members["Location"] - ) - - case 3: - kwargs["expected_bucket_owner"] = de.read_string( - _SCHEMA_GET_TRUSTED_ENTITY_SET_OUTPUT.members[ - "ExpectedBucketOwner" - ] - ) - - case 4: - kwargs["status"] = TrustedEntitySetStatus( - de.read_string( - _SCHEMA_GET_TRUSTED_ENTITY_SET_OUTPUT.members["Status"] - ) - ) - - case 5: - kwargs["tags"] = _deserialize_tag_map( - de, _SCHEMA_GET_TRUSTED_ENTITY_SET_OUTPUT.members["Tags"] - ) - - case 6: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_TRUSTED_ENTITY_SET_OUTPUT.members["CreatedAt"] - ) - - case 7: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_GET_TRUSTED_ENTITY_SET_OUTPUT.members["UpdatedAt"] - ) - - case 8: - kwargs["error_details"] = de.read_string( - _SCHEMA_GET_TRUSTED_ENTITY_SET_OUTPUT.members["ErrorDetails"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_TRUSTED_ENTITY_SET_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_TRUSTED_ENTITY_SET = APIOperation( - input=GetTrustedEntitySetInput, - output=GetTrustedEntitySetOutput, - schema=_SCHEMA_GET_TRUSTED_ENTITY_SET, - input_schema=_SCHEMA_GET_TRUSTED_ENTITY_SET_INPUT, - output_schema=_SCHEMA_GET_TRUSTED_ENTITY_SET_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -class UsageFeature(UnknownEnumMixin, StrEnum): - FLOW_LOGS = "FLOW_LOGS" - CLOUD_TRAIL = "CLOUD_TRAIL" - DNS_LOGS = "DNS_LOGS" - S3_DATA_EVENTS = "S3_DATA_EVENTS" - EKS_AUDIT_LOGS = "EKS_AUDIT_LOGS" - EBS_MALWARE_PROTECTION = "EBS_MALWARE_PROTECTION" - RDS_LOGIN_EVENTS = "RDS_LOGIN_EVENTS" - LAMBDA_NETWORK_LOGS = "LAMBDA_NETWORK_LOGS" - EKS_RUNTIME_MONITORING = "EKS_RUNTIME_MONITORING" - EC2_RUNTIME_MONITORING = "EC2_RUNTIME_MONITORING" - FARGATE_RUNTIME_MONITORING = "FARGATE_RUNTIME_MONITORING" - RDS_DBI_PROTECTION_PROVISIONED = "RDS_DBI_PROTECTION_PROVISIONED" - RDS_DBI_PROTECTION_SERVERLESS = "RDS_DBI_PROTECTION_SERVERLESS" - AI_PROTECTION = "AI_PROTECTION" - - -def _serialize_usage_feature_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_usage_feature_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(UsageFeature(d.read_string(member_schema))) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_resource_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_resource_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class UsageCriteria: - """Contains information about the criteria used to query usage statistics.""" - - account_ids: list[str] | None = None - """The account IDs to aggregate usage statistics from.""" - - data_sources: list[str] | None = None - """The data sources to aggregate usage statistics from.""" - - resources: list[str] | None = None - """ - The resources to aggregate usage statistics from. Only accepts exact - resource names. - """ - - features: list[str] | None = None - """The features to aggregate usage statistics from.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_USAGE_CRITERIA, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.account_ids is not None: - _serialize_account_ids( - serializer, - _SCHEMA_USAGE_CRITERIA.members["AccountIds"], - self.account_ids, - ) - - if self.data_sources is not None: - _serialize_data_source_list( - serializer, - _SCHEMA_USAGE_CRITERIA.members["DataSources"], - self.data_sources, - ) - - if self.resources is not None: - _serialize_resource_list( - serializer, _SCHEMA_USAGE_CRITERIA.members["Resources"], self.resources - ) - - if self.features is not None: - _serialize_usage_feature_list( - serializer, _SCHEMA_USAGE_CRITERIA.members["Features"], self.features - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["account_ids"] = _deserialize_account_ids( - de, _SCHEMA_USAGE_CRITERIA.members["AccountIds"] - ) - - case 1: - kwargs["data_sources"] = _deserialize_data_source_list( - de, _SCHEMA_USAGE_CRITERIA.members["DataSources"] - ) - - case 2: - kwargs["resources"] = _deserialize_resource_list( - de, _SCHEMA_USAGE_CRITERIA.members["Resources"] - ) - - case 3: - kwargs["features"] = _deserialize_usage_feature_list( - de, _SCHEMA_USAGE_CRITERIA.members["Features"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_USAGE_CRITERIA, consumer=_consumer) - return kwargs - - -class UsageStatisticType(UnknownEnumMixin, StrEnum): - SUM_BY_ACCOUNT = "SUM_BY_ACCOUNT" - SUM_BY_DATA_SOURCE = "SUM_BY_DATA_SOURCE" - SUM_BY_RESOURCE = "SUM_BY_RESOURCE" - TOP_RESOURCES = "TOP_RESOURCES" - SUM_BY_FEATURES = "SUM_BY_FEATURES" - TOP_ACCOUNTS_BY_FEATURE = "TOP_ACCOUNTS_BY_FEATURE" - - -@dataclass(kw_only=True) -class GetUsageStatisticsInput: - """Dataclass for GetUsageStatisticsInput structure.""" - - detector_id: str | None = None - """ - The ID of the detector that specifies the GuardDuty service whose usage - statistics you want to retrieve. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - usage_statistic_type: str | None = None - """The type of usage statistics to retrieve.""" - - usage_criteria: UsageCriteria | None = None - """Represents the criteria used for querying usage.""" - - unit: str | None = None - """ - The currency unit you would like to view your usage statistics in. - Current valid values are USD. - """ - - max_results: int | None = None - """The maximum number of results to return in the response.""" - - next_token: str | None = None - """ - A token to use for paginating results that are returned in the response. - Set the value of this parameter to null for the first request to a list - action. For subsequent calls, use the NextToken value returned from the - previous request to continue listing results after the first page. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_USAGE_STATISTICS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_GET_USAGE_STATISTICS_INPUT.members["DetectorId"], - self.detector_id, - ) - - if self.usage_statistic_type is not None: - serializer.write_string( - _SCHEMA_GET_USAGE_STATISTICS_INPUT.members["UsageStatisticType"], - self.usage_statistic_type, - ) - - if self.usage_criteria is not None: - serializer.write_struct( - _SCHEMA_GET_USAGE_STATISTICS_INPUT.members["UsageCriteria"], - self.usage_criteria, - ) - - if self.unit is not None: - serializer.write_string( - _SCHEMA_GET_USAGE_STATISTICS_INPUT.members["Unit"], self.unit - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_GET_USAGE_STATISTICS_INPUT.members["MaxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_GET_USAGE_STATISTICS_INPUT.members["NextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_GET_USAGE_STATISTICS_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["usage_statistic_type"] = UsageStatisticType( - de.read_string( - _SCHEMA_GET_USAGE_STATISTICS_INPUT.members[ - "UsageStatisticType" - ] - ) - ) - - case 2: - kwargs["usage_criteria"] = UsageCriteria.deserialize(de) - - case 3: - kwargs["unit"] = de.read_string( - _SCHEMA_GET_USAGE_STATISTICS_INPUT.members["Unit"] - ) - - case 4: - kwargs["max_results"] = de.read_integer( - _SCHEMA_GET_USAGE_STATISTICS_INPUT.members["MaxResults"] - ) - - case 5: - kwargs["next_token"] = de.read_string( - _SCHEMA_GET_USAGE_STATISTICS_INPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_USAGE_STATISTICS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Total: - """ - Contains the total usage with the corresponding currency unit for that - value. - """ - - amount: str | None = None - """The total usage.""" - - unit: str | None = None - """The currency unit that the amount is given in.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOTAL, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.amount is not None: - serializer.write_string(_SCHEMA_TOTAL.members["Amount"], self.amount) - - if self.unit is not None: - serializer.write_string(_SCHEMA_TOTAL.members["Unit"], self.unit) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["amount"] = de.read_string(_SCHEMA_TOTAL.members["Amount"]) - - case 1: - kwargs["unit"] = de.read_string(_SCHEMA_TOTAL.members["Unit"]) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TOTAL, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UsageAccountResult: - """Contains information on the total of usage based on account IDs.""" - - account_id: str | None = None - """The Account ID that generated usage.""" - - total: Total | None = None - """Represents the total of usage for the Account ID.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_USAGE_ACCOUNT_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.account_id is not None: - serializer.write_string( - _SCHEMA_USAGE_ACCOUNT_RESULT.members["AccountId"], self.account_id - ) - - if self.total is not None: - serializer.write_struct( - _SCHEMA_USAGE_ACCOUNT_RESULT.members["Total"], self.total - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["account_id"] = de.read_string( - _SCHEMA_USAGE_ACCOUNT_RESULT.members["AccountId"] - ) - - case 1: - kwargs["total"] = Total.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_USAGE_ACCOUNT_RESULT, consumer=_consumer) - return kwargs - - -def _serialize_usage_account_result_list( - serializer: ShapeSerializer, schema: Schema, value: list[UsageAccountResult] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_usage_account_result_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[UsageAccountResult]: - result: list[UsageAccountResult] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(UsageAccountResult.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class UsageDataSourceResult: - """Contains information on the result of usage based on data source type.""" - - data_source: str | None = None - """The data source type that generated usage.""" - - total: Total | None = None - """Represents the total of usage for the specified data source.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_USAGE_DATA_SOURCE_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.data_source is not None: - serializer.write_string( - _SCHEMA_USAGE_DATA_SOURCE_RESULT.members["DataSource"], self.data_source - ) - - if self.total is not None: - serializer.write_struct( - _SCHEMA_USAGE_DATA_SOURCE_RESULT.members["Total"], self.total - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["data_source"] = DataSource( - de.read_string( - _SCHEMA_USAGE_DATA_SOURCE_RESULT.members["DataSource"] - ) - ) - - case 1: - kwargs["total"] = Total.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_USAGE_DATA_SOURCE_RESULT, consumer=_consumer) - return kwargs - - -def _serialize_usage_data_source_result_list( - serializer: ShapeSerializer, schema: Schema, value: list[UsageDataSourceResult] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_usage_data_source_result_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[UsageDataSourceResult]: - result: list[UsageDataSourceResult] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(UsageDataSourceResult.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class UsageFeatureResult: - """ - Contains information about the result of the total usage based on the - feature. - """ - - feature: str | None = None - """The feature that generated the usage cost.""" - - total: Total | None = None - """ - Contains the total usage with the corresponding currency unit for that - value. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_USAGE_FEATURE_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.feature is not None: - serializer.write_string( - _SCHEMA_USAGE_FEATURE_RESULT.members["Feature"], self.feature - ) - - if self.total is not None: - serializer.write_struct( - _SCHEMA_USAGE_FEATURE_RESULT.members["Total"], self.total - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["feature"] = UsageFeature( - de.read_string(_SCHEMA_USAGE_FEATURE_RESULT.members["Feature"]) - ) - - case 1: - kwargs["total"] = Total.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_USAGE_FEATURE_RESULT, consumer=_consumer) - return kwargs - - -def _serialize_usage_feature_result_list( - serializer: ShapeSerializer, schema: Schema, value: list[UsageFeatureResult] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_usage_feature_result_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[UsageFeatureResult]: - result: list[UsageFeatureResult] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(UsageFeatureResult.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class UsageResourceResult: - """ - Contains information on the sum of usage based on an Amazon Web Services - resource. - """ - - resource: str | None = None - """The Amazon Web Services resource that generated usage.""" - - total: Total | None = None - """Represents the sum total of usage for the specified resource type.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_USAGE_RESOURCE_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource is not None: - serializer.write_string( - _SCHEMA_USAGE_RESOURCE_RESULT.members["Resource"], self.resource - ) - - if self.total is not None: - serializer.write_struct( - _SCHEMA_USAGE_RESOURCE_RESULT.members["Total"], self.total - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource"] = de.read_string( - _SCHEMA_USAGE_RESOURCE_RESULT.members["Resource"] - ) - - case 1: - kwargs["total"] = Total.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_USAGE_RESOURCE_RESULT, consumer=_consumer) - return kwargs - - -def _serialize_usage_resource_result_list( - serializer: ShapeSerializer, schema: Schema, value: list[UsageResourceResult] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_usage_resource_result_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[UsageResourceResult]: - result: list[UsageResourceResult] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(UsageResourceResult.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class UsageTopAccountResult: - """ - Contains information on the total of usage based on the topmost 50 - account IDs. - """ - - account_id: str | None = None - """The unique account ID.""" - - total: Total | None = None - """ - Contains the total usage with the corresponding currency unit for that - value. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_USAGE_TOP_ACCOUNT_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.account_id is not None: - serializer.write_string( - _SCHEMA_USAGE_TOP_ACCOUNT_RESULT.members["AccountId"], self.account_id - ) - - if self.total is not None: - serializer.write_struct( - _SCHEMA_USAGE_TOP_ACCOUNT_RESULT.members["Total"], self.total - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["account_id"] = de.read_string( - _SCHEMA_USAGE_TOP_ACCOUNT_RESULT.members["AccountId"] - ) - - case 1: - kwargs["total"] = Total.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_USAGE_TOP_ACCOUNT_RESULT, consumer=_consumer) - return kwargs - - -def _serialize_usage_top_accounts_by_feature_list( - serializer: ShapeSerializer, schema: Schema, value: list[UsageTopAccountResult] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_usage_top_accounts_by_feature_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[UsageTopAccountResult]: - result: list[UsageTopAccountResult] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(UsageTopAccountResult.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class UsageTopAccountsResult: - """ - Information about the usage statistics, calculated by top accounts by - feature. - """ - - feature: str | None = None - """ - Features by which you can generate the usage statistics. - - `RDS_LOGIN_EVENTS` is currently not supported with - `topAccountsByFeature`. - """ - - accounts: list[UsageTopAccountResult] | None = None - """The accounts that contributed to the total usage cost.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_USAGE_TOP_ACCOUNTS_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.feature is not None: - serializer.write_string( - _SCHEMA_USAGE_TOP_ACCOUNTS_RESULT.members["Feature"], self.feature - ) - - if self.accounts is not None: - _serialize_usage_top_accounts_by_feature_list( - serializer, - _SCHEMA_USAGE_TOP_ACCOUNTS_RESULT.members["Accounts"], - self.accounts, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["feature"] = UsageFeature( - de.read_string( - _SCHEMA_USAGE_TOP_ACCOUNTS_RESULT.members["Feature"] - ) - ) - - case 1: - kwargs["accounts"] = ( - _deserialize_usage_top_accounts_by_feature_list( - de, _SCHEMA_USAGE_TOP_ACCOUNTS_RESULT.members["Accounts"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_USAGE_TOP_ACCOUNTS_RESULT, consumer=_consumer) - return kwargs - - -def _serialize_usage_top_accounts_result_list( - serializer: ShapeSerializer, schema: Schema, value: list[UsageTopAccountsResult] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_usage_top_accounts_result_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[UsageTopAccountsResult]: - result: list[UsageTopAccountsResult] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(UsageTopAccountsResult.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class UsageStatistics: - """ - Contains the result of GuardDuty usage. If a UsageStatisticType is - provided the result for other types will be null. - """ - - sum_by_account: list[UsageAccountResult] | None = None - """The usage statistic sum organized by account ID.""" - - top_accounts_by_feature: list[UsageTopAccountsResult] | None = None - """ - Lists the top 50 accounts by feature that have generated the most - GuardDuty usage, in the order from most to least expensive. - - Currently, this doesn't support `RDS_LOGIN_EVENTS`. - """ - - sum_by_data_source: list[UsageDataSourceResult] | None = None - """The usage statistic sum organized by on data source.""" - - sum_by_resource: list[UsageResourceResult] | None = None - """The usage statistic sum organized by resource.""" - - top_resources: list[UsageResourceResult] | None = None - """ - Lists the top 50 resources that have generated the most GuardDuty usage, - in order from most to least expensive. - """ - - sum_by_feature: list[UsageFeatureResult] | None = None - """The usage statistic sum organized by feature.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_USAGE_STATISTICS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.sum_by_account is not None: - _serialize_usage_account_result_list( - serializer, - _SCHEMA_USAGE_STATISTICS.members["SumByAccount"], - self.sum_by_account, - ) - - if self.top_accounts_by_feature is not None: - _serialize_usage_top_accounts_result_list( - serializer, - _SCHEMA_USAGE_STATISTICS.members["TopAccountsByFeature"], - self.top_accounts_by_feature, - ) - - if self.sum_by_data_source is not None: - _serialize_usage_data_source_result_list( - serializer, - _SCHEMA_USAGE_STATISTICS.members["SumByDataSource"], - self.sum_by_data_source, - ) - - if self.sum_by_resource is not None: - _serialize_usage_resource_result_list( - serializer, - _SCHEMA_USAGE_STATISTICS.members["SumByResource"], - self.sum_by_resource, - ) - - if self.top_resources is not None: - _serialize_usage_resource_result_list( - serializer, - _SCHEMA_USAGE_STATISTICS.members["TopResources"], - self.top_resources, - ) - - if self.sum_by_feature is not None: - _serialize_usage_feature_result_list( - serializer, - _SCHEMA_USAGE_STATISTICS.members["SumByFeature"], - self.sum_by_feature, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["sum_by_account"] = _deserialize_usage_account_result_list( - de, _SCHEMA_USAGE_STATISTICS.members["SumByAccount"] - ) - - case 1: - kwargs["top_accounts_by_feature"] = ( - _deserialize_usage_top_accounts_result_list( - de, _SCHEMA_USAGE_STATISTICS.members["TopAccountsByFeature"] - ) - ) - - case 2: - kwargs["sum_by_data_source"] = ( - _deserialize_usage_data_source_result_list( - de, _SCHEMA_USAGE_STATISTICS.members["SumByDataSource"] - ) - ) - - case 3: - kwargs["sum_by_resource"] = _deserialize_usage_resource_result_list( - de, _SCHEMA_USAGE_STATISTICS.members["SumByResource"] - ) - - case 4: - kwargs["top_resources"] = _deserialize_usage_resource_result_list( - de, _SCHEMA_USAGE_STATISTICS.members["TopResources"] - ) - - case 5: - kwargs["sum_by_feature"] = _deserialize_usage_feature_result_list( - de, _SCHEMA_USAGE_STATISTICS.members["SumByFeature"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_USAGE_STATISTICS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetUsageStatisticsOutput: - """Dataclass for GetUsageStatisticsOutput structure.""" - - usage_statistics: UsageStatistics | None = None - """ - The usage statistics object. If a UsageStatisticType was provided, the - objects representing other types will be null. - """ - - next_token: str | None = None - """ - The pagination parameter to be used on the next list operation to - retrieve more items. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_USAGE_STATISTICS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.usage_statistics is not None: - serializer.write_struct( - _SCHEMA_GET_USAGE_STATISTICS_OUTPUT.members["UsageStatistics"], - self.usage_statistics, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_GET_USAGE_STATISTICS_OUTPUT.members["NextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["usage_statistics"] = UsageStatistics.deserialize(de) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_GET_USAGE_STATISTICS_OUTPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_USAGE_STATISTICS_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_USAGE_STATISTICS = APIOperation( - input=GetUsageStatisticsInput, - output=GetUsageStatisticsOutput, - schema=_SCHEMA_GET_USAGE_STATISTICS, - input_schema=_SCHEMA_GET_USAGE_STATISTICS_INPUT, - output_schema=_SCHEMA_GET_USAGE_STATISTICS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class InviteMembersInput: - """Dataclass for InviteMembersInput structure.""" - - detector_id: str | None = None - """ - The unique ID of the detector of the GuardDuty account with which you - want to invite members. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - account_ids: list[str] | None = None - """ - A list of account IDs of the accounts that you want to invite to - GuardDuty as members. - """ - - disable_email_notification: bool | None = None - """ - A Boolean value that specifies whether you want to disable email - notification to the accounts that you are inviting to GuardDuty as - members. - """ - - message: str | None = None - """ - The invitation message that you want to send to the accounts that - you're inviting to GuardDuty as members. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVITE_MEMBERS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_INVITE_MEMBERS_INPUT.members["DetectorId"], self.detector_id - ) - - if self.account_ids is not None: - _serialize_account_ids( - serializer, - _SCHEMA_INVITE_MEMBERS_INPUT.members["AccountIds"], - self.account_ids, - ) - - if self.disable_email_notification is not None: - serializer.write_boolean( - _SCHEMA_INVITE_MEMBERS_INPUT.members["DisableEmailNotification"], - self.disable_email_notification, - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_INVITE_MEMBERS_INPUT.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_INVITE_MEMBERS_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["account_ids"] = _deserialize_account_ids( - de, _SCHEMA_INVITE_MEMBERS_INPUT.members["AccountIds"] - ) - - case 2: - kwargs["disable_email_notification"] = de.read_boolean( - _SCHEMA_INVITE_MEMBERS_INPUT.members["DisableEmailNotification"] - ) - - case 3: - kwargs["message"] = de.read_string( - _SCHEMA_INVITE_MEMBERS_INPUT.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INVITE_MEMBERS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class InviteMembersOutput: - """Dataclass for InviteMembersOutput structure.""" - - unprocessed_accounts: list[UnprocessedAccount] | None = None - """ - A list of objects that contain the unprocessed account and a result - string that explains why it was unprocessed. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVITE_MEMBERS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.unprocessed_accounts is not None: - _serialize_unprocessed_accounts( - serializer, - _SCHEMA_INVITE_MEMBERS_OUTPUT.members["UnprocessedAccounts"], - self.unprocessed_accounts, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["unprocessed_accounts"] = _deserialize_unprocessed_accounts( - de, _SCHEMA_INVITE_MEMBERS_OUTPUT.members["UnprocessedAccounts"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INVITE_MEMBERS_OUTPUT, consumer=_consumer) - return kwargs - - -INVITE_MEMBERS = APIOperation( - input=InviteMembersInput, - output=InviteMembersOutput, - schema=_SCHEMA_INVITE_MEMBERS, - input_schema=_SCHEMA_INVITE_MEMBERS_INPUT, - output_schema=_SCHEMA_INVITE_MEMBERS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListCoverageInput: - """Dataclass for ListCoverageInput structure.""" - - detector_id: str | None = None - """ - The unique ID of the detector whose coverage details you want to - retrieve. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - next_token: str | None = None - """ - A token to use for paginating results that are returned in the response. - Set the value of this parameter to null for the first request to a list - action. For subsequent calls, use the NextToken value returned from the - previous request to continue listing results after the first page. - """ - - max_results: int | None = None - """The maximum number of results to return in the response.""" - - filter_criteria: CoverageFilterCriteria | None = None - """Represents the criteria used to filter the coverage details.""" - - sort_criteria: CoverageSortCriteria | None = None - """Represents the criteria used to sort the coverage details.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_COVERAGE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_LIST_COVERAGE_INPUT.members["DetectorId"], self.detector_id - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_COVERAGE_INPUT.members["NextToken"], self.next_token - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_COVERAGE_INPUT.members["MaxResults"], self.max_results - ) - - if self.filter_criteria is not None: - serializer.write_struct( - _SCHEMA_LIST_COVERAGE_INPUT.members["FilterCriteria"], - self.filter_criteria, - ) - - if self.sort_criteria is not None: - serializer.write_struct( - _SCHEMA_LIST_COVERAGE_INPUT.members["SortCriteria"], self.sort_criteria - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_LIST_COVERAGE_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_COVERAGE_INPUT.members["NextToken"] - ) - - case 2: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_COVERAGE_INPUT.members["MaxResults"] - ) - - case 3: - kwargs["filter_criteria"] = CoverageFilterCriteria.deserialize(de) - - case 4: - kwargs["sort_criteria"] = CoverageSortCriteria.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_COVERAGE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ListCoverageOutput: - """Dataclass for ListCoverageOutput structure.""" - - resources: list[CoverageResource] | None = None - """A list of resources and their attributes providing cluster details.""" - - next_token: str | None = None - """ - The pagination parameter to be used on the next list operation to - retrieve more items. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_COVERAGE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resources is not None: - _serialize_coverage_resources( - serializer, - _SCHEMA_LIST_COVERAGE_OUTPUT.members["Resources"], - self.resources, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_COVERAGE_OUTPUT.members["NextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resources"] = _deserialize_coverage_resources( - de, _SCHEMA_LIST_COVERAGE_OUTPUT.members["Resources"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_COVERAGE_OUTPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_COVERAGE_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_COVERAGE = APIOperation( - input=ListCoverageInput, - output=ListCoverageOutput, - schema=_SCHEMA_LIST_COVERAGE, - input_schema=_SCHEMA_LIST_COVERAGE_INPUT, - output_schema=_SCHEMA_LIST_COVERAGE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListCustomDetectionRuleAssociationsInput: - """Dataclass for ListCustomDetectionRuleAssociationsInput structure.""" - - max_results: int | None = None - """ - The maximum number of results to return in a single page. Minimum value - of 1, maximum value of 100. - """ - - next_token: str | None = None - """ - A pagination token from a previous response. Use this token to retrieve - the next page of results. - """ - - rule_id: str | None = None - """ - The unique identifier for the custom detection rule to filter - associations by. - """ - - mode: str | None = None - """The rule execution mode to filter associations by.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_LIST_CUSTOM_DETECTION_RULE_ASSOCIATIONS_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_CUSTOM_DETECTION_RULE_ASSOCIATIONS_INPUT.members[ - "MaxResults" - ], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_CUSTOM_DETECTION_RULE_ASSOCIATIONS_INPUT.members[ - "NextToken" - ], - self.next_token, - ) - - if self.rule_id is not None: - serializer.write_string( - _SCHEMA_LIST_CUSTOM_DETECTION_RULE_ASSOCIATIONS_INPUT.members["RuleId"], - self.rule_id, - ) - - if self.mode is not None: - serializer.write_string( - _SCHEMA_LIST_CUSTOM_DETECTION_RULE_ASSOCIATIONS_INPUT.members["Mode"], - self.mode, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_CUSTOM_DETECTION_RULE_ASSOCIATIONS_INPUT.members[ - "MaxResults" - ] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_CUSTOM_DETECTION_RULE_ASSOCIATIONS_INPUT.members[ - "NextToken" - ] - ) - - case 2: - kwargs["rule_id"] = de.read_string( - _SCHEMA_LIST_CUSTOM_DETECTION_RULE_ASSOCIATIONS_INPUT.members[ - "RuleId" - ] - ) - - case 3: - kwargs["mode"] = AssociationMode( - de.read_string( - _SCHEMA_LIST_CUSTOM_DETECTION_RULE_ASSOCIATIONS_INPUT.members[ - "Mode" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_CUSTOM_DETECTION_RULE_ASSOCIATIONS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ListCustomDetectionRuleAssociationsOutput: - """Dataclass for ListCustomDetectionRuleAssociationsOutput structure.""" - - rule_associations: list[AssociationSummary] | None = None - """A list of custom detection rule association summaries.""" - - next_token: str | None = None - """ - A pagination token to retrieve the next page of results. If this field - is empty, there are no additional results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_LIST_CUSTOM_DETECTION_RULE_ASSOCIATIONS_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rule_associations is not None: - _serialize_association_summary_list( - serializer, - _SCHEMA_LIST_CUSTOM_DETECTION_RULE_ASSOCIATIONS_OUTPUT.members[ - "RuleAssociations" - ], - self.rule_associations, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_CUSTOM_DETECTION_RULE_ASSOCIATIONS_OUTPUT.members[ - "NextToken" - ], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rule_associations"] = _deserialize_association_summary_list( - de, - _SCHEMA_LIST_CUSTOM_DETECTION_RULE_ASSOCIATIONS_OUTPUT.members[ - "RuleAssociations" - ], - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_CUSTOM_DETECTION_RULE_ASSOCIATIONS_OUTPUT.members[ - "NextToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_CUSTOM_DETECTION_RULE_ASSOCIATIONS_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_CUSTOM_DETECTION_RULE_ASSOCIATIONS = APIOperation( - input=ListCustomDetectionRuleAssociationsInput, - output=ListCustomDetectionRuleAssociationsOutput, - schema=_SCHEMA_LIST_CUSTOM_DETECTION_RULE_ASSOCIATIONS, - input_schema=_SCHEMA_LIST_CUSTOM_DETECTION_RULE_ASSOCIATIONS_INPUT, - output_schema=_SCHEMA_LIST_CUSTOM_DETECTION_RULE_ASSOCIATIONS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.guardduty#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListCustomDetectionRuleOrgConfigurationsInput: - """Dataclass for ListCustomDetectionRuleOrgConfigurationsInput structure.""" - - max_results: int | None = None - """ - The maximum number of results to return in a single page. Minimum value - of 1, maximum value of 100. - """ - - next_token: str | None = None - """ - A pagination token from a previous response. Use this token to retrieve - the next page of results. - """ - - status: str | None = None - """The configuration status to filter by.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_LIST_CUSTOM_DETECTION_RULE_ORG_CONFIGURATIONS_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_CUSTOM_DETECTION_RULE_ORG_CONFIGURATIONS_INPUT.members[ - "MaxResults" - ], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_CUSTOM_DETECTION_RULE_ORG_CONFIGURATIONS_INPUT.members[ - "NextToken" - ], - self.next_token, - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_LIST_CUSTOM_DETECTION_RULE_ORG_CONFIGURATIONS_INPUT.members[ - "Status" - ], - self.status, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_CUSTOM_DETECTION_RULE_ORG_CONFIGURATIONS_INPUT.members[ - "MaxResults" - ] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_CUSTOM_DETECTION_RULE_ORG_CONFIGURATIONS_INPUT.members[ - "NextToken" - ] - ) - - case 2: - kwargs["status"] = DetectionRuleConfigurationStatus( - de.read_string( - _SCHEMA_LIST_CUSTOM_DETECTION_RULE_ORG_CONFIGURATIONS_INPUT.members[ - "Status" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_CUSTOM_DETECTION_RULE_ORG_CONFIGURATIONS_INPUT, - consumer=_consumer, - ) - return kwargs - - -@dataclass(kw_only=True) -class ListCustomDetectionRuleOrgConfigurationsOutput: - """Dataclass for ListCustomDetectionRuleOrgConfigurationsOutput structure.""" - - configurations: list[DetectionRuleOrgConfigurationSummary] | None = None - """A list of organization configurations for custom detection rules.""" - - next_token: str | None = None - """ - A pagination token to retrieve the next page of results. If this field - is empty, there are no additional results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_LIST_CUSTOM_DETECTION_RULE_ORG_CONFIGURATIONS_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.configurations is not None: - _serialize_detection_rule_org_configuration_summary_list( - serializer, - _SCHEMA_LIST_CUSTOM_DETECTION_RULE_ORG_CONFIGURATIONS_OUTPUT.members[ - "Configurations" - ], - self.configurations, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_CUSTOM_DETECTION_RULE_ORG_CONFIGURATIONS_OUTPUT.members[ - "NextToken" - ], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["configurations"] = ( - _deserialize_detection_rule_org_configuration_summary_list( - de, - _SCHEMA_LIST_CUSTOM_DETECTION_RULE_ORG_CONFIGURATIONS_OUTPUT.members[ - "Configurations" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_CUSTOM_DETECTION_RULE_ORG_CONFIGURATIONS_OUTPUT.members[ - "NextToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_CUSTOM_DETECTION_RULE_ORG_CONFIGURATIONS_OUTPUT, - consumer=_consumer, - ) - return kwargs - - -LIST_CUSTOM_DETECTION_RULE_ORG_CONFIGURATIONS = APIOperation( - input=ListCustomDetectionRuleOrgConfigurationsInput, - output=ListCustomDetectionRuleOrgConfigurationsOutput, - schema=_SCHEMA_LIST_CUSTOM_DETECTION_RULE_ORG_CONFIGURATIONS, - input_schema=_SCHEMA_LIST_CUSTOM_DETECTION_RULE_ORG_CONFIGURATIONS_INPUT, - output_schema=_SCHEMA_LIST_CUSTOM_DETECTION_RULE_ORG_CONFIGURATIONS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.guardduty#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListCustomDetectionRulesInput: - """Dataclass for ListCustomDetectionRulesInput structure.""" - - max_results: int | None = None - """ - The maximum number of results to return in a single page. Minimum value - of 1, maximum value of 100. - """ - - next_token: str | None = None - """ - A pagination token from a previous response. Use this token to retrieve - the next page of results. - """ - - filters: list[DetectionRuleFilter] | None = None - """A list of filter criteria to apply when listing custom detection rules.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_CUSTOM_DETECTION_RULES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_CUSTOM_DETECTION_RULES_INPUT.members["MaxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_CUSTOM_DETECTION_RULES_INPUT.members["NextToken"], - self.next_token, - ) - - if self.filters is not None: - _serialize_detection_rule_filter_list( - serializer, - _SCHEMA_LIST_CUSTOM_DETECTION_RULES_INPUT.members["Filters"], - self.filters, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_CUSTOM_DETECTION_RULES_INPUT.members["MaxResults"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_CUSTOM_DETECTION_RULES_INPUT.members["NextToken"] - ) - - case 2: - kwargs["filters"] = _deserialize_detection_rule_filter_list( - de, _SCHEMA_LIST_CUSTOM_DETECTION_RULES_INPUT.members["Filters"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_CUSTOM_DETECTION_RULES_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class RuleSummary: - """Contains summary information about a custom detection rule.""" - - rule_id: str | None = None - """The unique identifier for the rule.""" - - arn: str | None = None - """The Amazon Resource Name (ARN) of the rule.""" - - name: str | None = None - """The display name of the rule.""" - - description: str | None = None - """A description of what the rule detects.""" - - severity: str | None = None - """The severity level assigned to findings generated by this rule.""" - - data_source: str | None = None - """The data source that the rule analyzes.""" - - tactic: str | None = None - """The MITRE ATT&CK tactic associated with the rule.""" - - technique: str | None = None - """The MITRE ATT&CK technique associated with the rule.""" - - service: str | None = None - """The Amazon Web Services service associated with the rule.""" - - language: str | None = None - """The language used for the detection logic expression.""" - - schema: str | None = None - """The schema version used by the rule definition.""" - - created_at: datetime | None = None - """The timestamp when the rule was created.""" - - updated_at: datetime | None = None - """The timestamp when the rule was last updated.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RULE_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rule_id is not None: - serializer.write_string( - _SCHEMA_RULE_SUMMARY.members["RuleId"], self.rule_id - ) - - if self.arn is not None: - serializer.write_string(_SCHEMA_RULE_SUMMARY.members["Arn"], self.arn) - - if self.name is not None: - serializer.write_string(_SCHEMA_RULE_SUMMARY.members["Name"], self.name) - - if self.description is not None: - serializer.write_string( - _SCHEMA_RULE_SUMMARY.members["Description"], self.description - ) - - if self.severity is not None: - serializer.write_string( - _SCHEMA_RULE_SUMMARY.members["Severity"], self.severity - ) - - if self.data_source is not None: - serializer.write_string( - _SCHEMA_RULE_SUMMARY.members["DataSource"], self.data_source - ) - - if self.tactic is not None: - serializer.write_string(_SCHEMA_RULE_SUMMARY.members["Tactic"], self.tactic) - - if self.technique is not None: - serializer.write_string( - _SCHEMA_RULE_SUMMARY.members["Technique"], self.technique - ) - - if self.service is not None: - serializer.write_string( - _SCHEMA_RULE_SUMMARY.members["Service"], self.service - ) - - if self.language is not None: - serializer.write_string( - _SCHEMA_RULE_SUMMARY.members["Language"], self.language - ) - - if self.schema is not None: - serializer.write_string(_SCHEMA_RULE_SUMMARY.members["Schema"], self.schema) - - if self.created_at is not None: - serializer.write_timestamp( - _SCHEMA_RULE_SUMMARY.members["CreatedAt"], self.created_at - ) - - if self.updated_at is not None: - serializer.write_timestamp( - _SCHEMA_RULE_SUMMARY.members["UpdatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rule_id"] = de.read_string( - _SCHEMA_RULE_SUMMARY.members["RuleId"] - ) - - case 1: - kwargs["arn"] = de.read_string(_SCHEMA_RULE_SUMMARY.members["Arn"]) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_RULE_SUMMARY.members["Name"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_RULE_SUMMARY.members["Description"] - ) - - case 4: - kwargs["severity"] = DetectionRuleSeverity( - de.read_string(_SCHEMA_RULE_SUMMARY.members["Severity"]) - ) - - case 5: - kwargs["data_source"] = DetectionRuleDataSource( - de.read_string(_SCHEMA_RULE_SUMMARY.members["DataSource"]) - ) - - case 6: - kwargs["tactic"] = de.read_string( - _SCHEMA_RULE_SUMMARY.members["Tactic"] - ) - - case 7: - kwargs["technique"] = de.read_string( - _SCHEMA_RULE_SUMMARY.members["Technique"] - ) - - case 8: - kwargs["service"] = de.read_string( - _SCHEMA_RULE_SUMMARY.members["Service"] - ) - - case 9: - kwargs["language"] = RuleLanguage( - de.read_string(_SCHEMA_RULE_SUMMARY.members["Language"]) - ) - - case 10: - kwargs["schema"] = RuleSchema( - de.read_string(_SCHEMA_RULE_SUMMARY.members["Schema"]) - ) - - case 11: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_RULE_SUMMARY.members["CreatedAt"] - ) - - case 12: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_RULE_SUMMARY.members["UpdatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RULE_SUMMARY, consumer=_consumer) - return kwargs - - -def _serialize_rule_summary_list( - serializer: ShapeSerializer, schema: Schema, value: list[RuleSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_rule_summary_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[RuleSummary]: - result: list[RuleSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(RuleSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListCustomDetectionRulesOutput: - """Dataclass for ListCustomDetectionRulesOutput structure.""" - - rules: list[RuleSummary] | None = None - """A list of custom detection rule summaries.""" - - next_token: str | None = None - """ - A pagination token to retrieve the next page of results. If this field - is empty, there are no additional results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_CUSTOM_DETECTION_RULES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rules is not None: - _serialize_rule_summary_list( - serializer, - _SCHEMA_LIST_CUSTOM_DETECTION_RULES_OUTPUT.members["Rules"], - self.rules, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_CUSTOM_DETECTION_RULES_OUTPUT.members["NextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rules"] = _deserialize_rule_summary_list( - de, _SCHEMA_LIST_CUSTOM_DETECTION_RULES_OUTPUT.members["Rules"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_CUSTOM_DETECTION_RULES_OUTPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_CUSTOM_DETECTION_RULES_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_CUSTOM_DETECTION_RULES = APIOperation( - input=ListCustomDetectionRulesInput, - output=ListCustomDetectionRulesOutput, - schema=_SCHEMA_LIST_CUSTOM_DETECTION_RULES, - input_schema=_SCHEMA_LIST_CUSTOM_DETECTION_RULES_INPUT, - output_schema=_SCHEMA_LIST_CUSTOM_DETECTION_RULES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.guardduty#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListDetectorsInput: - """Dataclass for ListDetectorsInput structure.""" - - max_results: int | None = None - """ - You can use this parameter to indicate the maximum number of items that - you want in the response. The default value is 50. The maximum value is - 50. - """ - - next_token: str | None = None - """ - You can use this parameter when paginating results. Set the value of - this parameter to null on your first call to the list action. For - subsequent calls to the action, fill nextToken in the request with the - value of NextToken from the previous response to continue listing data. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_DETECTORS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_DETECTORS_INPUT.members["MaxResults"], self.max_results - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_DETECTORS_INPUT.members["NextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_DETECTORS_INPUT.members["MaxResults"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_DETECTORS_INPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_DETECTORS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ListDetectorsOutput: - """Dataclass for ListDetectorsOutput structure.""" - - detector_ids: list[str] | None = None - """A list of detector IDs.""" - - next_token: str | None = None - """ - The pagination parameter to be used on the next list operation to - retrieve more items. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_DETECTORS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_ids is not None: - _serialize_detector_ids( - serializer, - _SCHEMA_LIST_DETECTORS_OUTPUT.members["DetectorIds"], - self.detector_ids, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_DETECTORS_OUTPUT.members["NextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_ids"] = _deserialize_detector_ids( - de, _SCHEMA_LIST_DETECTORS_OUTPUT.members["DetectorIds"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_DETECTORS_OUTPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_DETECTORS_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_DETECTORS = APIOperation( - input=ListDetectorsInput, - output=ListDetectorsOutput, - schema=_SCHEMA_LIST_DETECTORS, - input_schema=_SCHEMA_LIST_DETECTORS_INPUT, - output_schema=_SCHEMA_LIST_DETECTORS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListFiltersInput: - """Dataclass for ListFiltersInput structure.""" - - detector_id: str | None = None - """ - The unique ID of the detector that is associated with the filter. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - max_results: int | None = None - """ - You can use this parameter to indicate the maximum number of items that - you want in the response. The default value is 50. The maximum value is - 50. - """ - - next_token: str | None = None - """ - You can use this parameter when paginating results. Set the value of - this parameter to null on your first call to the list action. For - subsequent calls to the action, fill nextToken in the request with the - value of NextToken from the previous response to continue listing data. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_FILTERS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_LIST_FILTERS_INPUT.members["DetectorId"], self.detector_id - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_FILTERS_INPUT.members["MaxResults"], self.max_results - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_FILTERS_INPUT.members["NextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_LIST_FILTERS_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_FILTERS_INPUT.members["MaxResults"] - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_FILTERS_INPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_FILTERS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ListFiltersOutput: - """Dataclass for ListFiltersOutput structure.""" - - filter_names: list[str] | None = None - """A list of filter names.""" - - next_token: str | None = None - """ - The pagination parameter to be used on the next list operation to - retrieve more items. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_FILTERS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.filter_names is not None: - _serialize_filter_names( - serializer, - _SCHEMA_LIST_FILTERS_OUTPUT.members["FilterNames"], - self.filter_names, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_FILTERS_OUTPUT.members["NextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["filter_names"] = _deserialize_filter_names( - de, _SCHEMA_LIST_FILTERS_OUTPUT.members["FilterNames"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_FILTERS_OUTPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_FILTERS_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_FILTERS = APIOperation( - input=ListFiltersInput, - output=ListFiltersOutput, - schema=_SCHEMA_LIST_FILTERS, - input_schema=_SCHEMA_LIST_FILTERS_INPUT, - output_schema=_SCHEMA_LIST_FILTERS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListFindingsInput: - """Dataclass for ListFindingsInput structure.""" - - detector_id: str | None = None - """ - The ID of the detector that specifies the GuardDuty service whose - findings you want to list. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - finding_criteria: FindingCriteria | None = None - """ - Represents the criteria used for querying findings. Valid values - include: - - - JSON field name - - - accountId - - - region - - - confidence - - - id - - - resource.accessKeyDetails.accessKeyId - - - resource.accessKeyDetails.principalId - - - resource.accessKeyDetails.userName - - - resource.accessKeyDetails.userType - - - resource.instanceDetails.iamInstanceProfile.id - - - resource.instanceDetails.imageId - - - resource.instanceDetails.instanceId - - - resource.instanceDetails.networkInterfaces.ipv6Addresses - - - resource.instanceDetails.networkInterfaces.privateIpAddresses.privateIpAddress - - - resource.instanceDetails.networkInterfaces.publicDnsName - - - resource.instanceDetails.networkInterfaces.publicIp - - - resource.instanceDetails.networkInterfaces.securityGroups.groupId - - - resource.instanceDetails.networkInterfaces.securityGroups.groupName - - - resource.instanceDetails.networkInterfaces.subnetId - - - resource.instanceDetails.networkInterfaces.vpcId - - - resource.instanceDetails.tags.key - - - resource.instanceDetails.tags.value - - - resource.resourceType - - - service.action.actionType - - - service.action.awsApiCallAction.api - - - service.action.awsApiCallAction.callerType - - - service.action.awsApiCallAction.remoteIpDetails.city.cityName - - - service.action.awsApiCallAction.remoteIpDetails.country.countryName - - - service.action.awsApiCallAction.remoteIpDetails.ipAddressV4 - - - service.action.awsApiCallAction.remoteIpDetails.organization.asn - - - service.action.awsApiCallAction.remoteIpDetails.organization.asnOrg - - - service.action.awsApiCallAction.serviceName - - - service.action.dnsRequestAction.domain - - - service.action.dnsRequestAction.domainWithSuffix - - - service.action.networkConnectionAction.blocked - - - service.action.networkConnectionAction.connectionDirection - - - service.action.networkConnectionAction.localPortDetails.port - - - service.action.networkConnectionAction.protocol - - - service.action.networkConnectionAction.remoteIpDetails.country.countryName - - - service.action.networkConnectionAction.remoteIpDetails.ipAddressV4 - - - service.action.networkConnectionAction.remoteIpDetails.organization.asn - - - service.action.networkConnectionAction.remoteIpDetails.organization.asnOrg - - - service.action.networkConnectionAction.remotePortDetails.port - - - service.additionalInfo.threatListName - - - service.archived - - When this attribute is set to 'true', only archived findings are - listed. When it's set to 'false', only unarchived findings are - listed. When this attribute is not set, all existing findings are - listed. - - - service.ebsVolumeScanDetails.scanId - - - service.resourceRole - - - severity - - - type - - - updatedAt - - Type: Timestamp in Unix Epoch millisecond format: 1486685375000 - """ - - sort_criteria: SortCriteria | None = None - """Represents the criteria used for sorting findings.""" - - max_results: int | None = None - """ - You can use this parameter to indicate the maximum number of items you - want in the response. The default value is 50. The maximum value is 50. - """ - - next_token: str | None = None - """ - You can use this parameter when paginating results. Set the value of - this parameter to null on your first call to the list action. For - subsequent calls to the action, fill nextToken in the request with the - value of NextToken from the previous response to continue listing data. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_FINDINGS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_LIST_FINDINGS_INPUT.members["DetectorId"], self.detector_id - ) - - if self.finding_criteria is not None: - serializer.write_struct( - _SCHEMA_LIST_FINDINGS_INPUT.members["FindingCriteria"], - self.finding_criteria, - ) - - if self.sort_criteria is not None: - serializer.write_struct( - _SCHEMA_LIST_FINDINGS_INPUT.members["SortCriteria"], self.sort_criteria - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_FINDINGS_INPUT.members["MaxResults"], self.max_results - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_FINDINGS_INPUT.members["NextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_LIST_FINDINGS_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["finding_criteria"] = FindingCriteria.deserialize(de) - - case 2: - kwargs["sort_criteria"] = SortCriteria.deserialize(de) - - case 3: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_FINDINGS_INPUT.members["MaxResults"] - ) - - case 4: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_FINDINGS_INPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_FINDINGS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ListFindingsOutput: - """Dataclass for ListFindingsOutput structure.""" - - finding_ids: list[str] | None = None - """The IDs of the findings that you're listing.""" - - next_token: str | None = None - """ - The pagination parameter to be used on the next list operation to - retrieve more items. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_FINDINGS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.finding_ids is not None: - _serialize_finding_ids( - serializer, - _SCHEMA_LIST_FINDINGS_OUTPUT.members["FindingIds"], - self.finding_ids, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_FINDINGS_OUTPUT.members["NextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["finding_ids"] = _deserialize_finding_ids( - de, _SCHEMA_LIST_FINDINGS_OUTPUT.members["FindingIds"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_FINDINGS_OUTPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_FINDINGS_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_FINDINGS = APIOperation( - input=ListFindingsInput, - output=ListFindingsOutput, - schema=_SCHEMA_LIST_FINDINGS, - input_schema=_SCHEMA_LIST_FINDINGS_INPUT, - output_schema=_SCHEMA_LIST_FINDINGS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -class InvestigationSortField(UnknownEnumMixin, StrEnum): - START_TIME = "START_TIME" - END_TIME = "END_TIME" - STATUS = "STATUS" - RISK_LEVEL = "RISK_LEVEL" - CONFIDENCE = "CONFIDENCE" - - -@dataclass(kw_only=True) -class InvestigationSortCriteria: - """Contains information about the criteria used for sorting investigations.""" - - attribute_name: str | None = None - """The attribute by which to sort investigations.""" - - order_by: str | None = None - """The order in which the sorted results are to be displayed.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVESTIGATION_SORT_CRITERIA, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.attribute_name is not None: - serializer.write_string( - _SCHEMA_INVESTIGATION_SORT_CRITERIA.members["AttributeName"], - self.attribute_name, - ) - - if self.order_by is not None: - serializer.write_string( - _SCHEMA_INVESTIGATION_SORT_CRITERIA.members["OrderBy"], self.order_by - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["attribute_name"] = InvestigationSortField( - de.read_string( - _SCHEMA_INVESTIGATION_SORT_CRITERIA.members["AttributeName"] - ) - ) - - case 1: - kwargs["order_by"] = OrderBy( - de.read_string( - _SCHEMA_INVESTIGATION_SORT_CRITERIA.members["OrderBy"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVESTIGATION_SORT_CRITERIA, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ListInvestigationsInput: - """Dataclass for ListInvestigationsInput structure.""" - - detector_id: str | None = None - """ - The unique ID of the GuardDuty detector whose investigations you want to - list. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - sort_criteria: InvestigationSortCriteria | None = None - """Represents the criteria used for sorting investigations.""" - - max_results: int | None = None - """ - You can use this parameter to indicate the maximum number of items you - want in the response. The default value is 50. - """ - - next_token: str | None = None - """ - You can use this parameter when paginating results. Set the value of - this parameter to null on your first call to the list action. For - subsequent calls to the action, fill nextToken in the request with the - value of NextToken from the previous response to continue listing data. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_INVESTIGATIONS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_LIST_INVESTIGATIONS_INPUT.members["DetectorId"], - self.detector_id, - ) - - if self.sort_criteria is not None: - serializer.write_struct( - _SCHEMA_LIST_INVESTIGATIONS_INPUT.members["SortCriteria"], - self.sort_criteria, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_INVESTIGATIONS_INPUT.members["MaxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_INVESTIGATIONS_INPUT.members["NextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_LIST_INVESTIGATIONS_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["sort_criteria"] = InvestigationSortCriteria.deserialize(de) - - case 2: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_INVESTIGATIONS_INPUT.members["MaxResults"] - ) - - case 3: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_INVESTIGATIONS_INPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_INVESTIGATIONS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class InvestigationSummary: - """Contains summary information about a GuardDuty investigation.""" - - investigation_id: str | None = None - """The unique identifier of the investigation.""" - - status: str | None = None - """The current status of the investigation.""" - - trigger_prompt: str | None = None - """The natural-language prompt that initiated this investigation.""" - - risk_level: str | None = None - """The assessed risk level of the investigated threat.""" - - confidence: str | None = None - """The confidence level of the investigation's assessment.""" - - title: str | None = None - """A short title summarizing the investigation.""" - - account_id: str | None = None - """The Amazon Web Services account ID associated with the investigation.""" - - start_time: datetime | None = None - """The timestamp at which the investigation started.""" - - end_time: datetime | None = None - """The timestamp at which the investigation completed.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVESTIGATION_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.investigation_id is not None: - serializer.write_string( - _SCHEMA_INVESTIGATION_SUMMARY.members["InvestigationId"], - self.investigation_id, - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_INVESTIGATION_SUMMARY.members["Status"], self.status - ) - - if self.trigger_prompt is not None: - serializer.write_string( - _SCHEMA_INVESTIGATION_SUMMARY.members["TriggerPrompt"], - self.trigger_prompt, - ) - - if self.risk_level is not None: - serializer.write_string( - _SCHEMA_INVESTIGATION_SUMMARY.members["RiskLevel"], self.risk_level - ) - - if self.confidence is not None: - serializer.write_string( - _SCHEMA_INVESTIGATION_SUMMARY.members["Confidence"], self.confidence - ) - - if self.title is not None: - serializer.write_string( - _SCHEMA_INVESTIGATION_SUMMARY.members["Title"], self.title - ) - - if self.account_id is not None: - serializer.write_string( - _SCHEMA_INVESTIGATION_SUMMARY.members["AccountId"], self.account_id - ) - - if self.start_time is not None: - serializer.write_timestamp( - _SCHEMA_INVESTIGATION_SUMMARY.members["StartTime"], self.start_time - ) - - if self.end_time is not None: - serializer.write_timestamp( - _SCHEMA_INVESTIGATION_SUMMARY.members["EndTime"], self.end_time - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["investigation_id"] = de.read_string( - _SCHEMA_INVESTIGATION_SUMMARY.members["InvestigationId"] - ) - - case 1: - kwargs["status"] = InvestigationStatus( - de.read_string(_SCHEMA_INVESTIGATION_SUMMARY.members["Status"]) - ) - - case 2: - kwargs["trigger_prompt"] = de.read_string( - _SCHEMA_INVESTIGATION_SUMMARY.members["TriggerPrompt"] - ) - - case 3: - kwargs["risk_level"] = RiskLevel( - de.read_string( - _SCHEMA_INVESTIGATION_SUMMARY.members["RiskLevel"] - ) - ) - - case 4: - kwargs["confidence"] = Confidence( - de.read_string( - _SCHEMA_INVESTIGATION_SUMMARY.members["Confidence"] - ) - ) - - case 5: - kwargs["title"] = de.read_string( - _SCHEMA_INVESTIGATION_SUMMARY.members["Title"] - ) - - case 6: - kwargs["account_id"] = de.read_string( - _SCHEMA_INVESTIGATION_SUMMARY.members["AccountId"] - ) - - case 7: - kwargs["start_time"] = de.read_timestamp( - _SCHEMA_INVESTIGATION_SUMMARY.members["StartTime"] - ) - - case 8: - kwargs["end_time"] = de.read_timestamp( - _SCHEMA_INVESTIGATION_SUMMARY.members["EndTime"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INVESTIGATION_SUMMARY, consumer=_consumer) - return kwargs - - -def _serialize_investigation_summaries( - serializer: ShapeSerializer, schema: Schema, value: list[InvestigationSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_investigation_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[InvestigationSummary]: - result: list[InvestigationSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(InvestigationSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListInvestigationsOutput: - """Dataclass for ListInvestigationsOutput structure.""" - - investigations: list[InvestigationSummary] | None = None - """ - A list of investigation summaries associated with the specified - detector. - """ - - next_token: str | None = None - """ - The pagination parameter to be used on the next list operation to - retrieve more items. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_INVESTIGATIONS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.investigations is not None: - _serialize_investigation_summaries( - serializer, - _SCHEMA_LIST_INVESTIGATIONS_OUTPUT.members["Investigations"], - self.investigations, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_INVESTIGATIONS_OUTPUT.members["NextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["investigations"] = _deserialize_investigation_summaries( - de, _SCHEMA_LIST_INVESTIGATIONS_OUTPUT.members["Investigations"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_INVESTIGATIONS_OUTPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_INVESTIGATIONS_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_INVESTIGATIONS = APIOperation( - input=ListInvestigationsInput, - output=ListInvestigationsOutput, - schema=_SCHEMA_LIST_INVESTIGATIONS, - input_schema=_SCHEMA_LIST_INVESTIGATIONS_INPUT, - output_schema=_SCHEMA_LIST_INVESTIGATIONS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.guardduty#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListInvitationsInput: - """Dataclass for ListInvitationsInput structure.""" - - max_results: int | None = None - """ - You can use this parameter to indicate the maximum number of items that - you want in the response. The default value is 50. The maximum value is - 50. - """ - - next_token: str | None = None - """ - You can use this parameter when paginating results. Set the value of - this parameter to null on your first call to the list action. For - subsequent calls to the action, fill nextToken in the request with the - value of NextToken from the previous response to continue listing data. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_INVITATIONS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_INVITATIONS_INPUT.members["MaxResults"], self.max_results - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_INVITATIONS_INPUT.members["NextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_INVITATIONS_INPUT.members["MaxResults"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_INVITATIONS_INPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_INVITATIONS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Invitation: - """Contains information about the invitation to become a member account.""" - - account_id: str | None = None - """The ID of the account that the invitation was sent from.""" - - invitation_id: str | None = None - """ - The ID of the invitation. This value is used to validate the inviter - account to the member account. - """ - - relationship_status: str | None = None - """The status of the relationship between the inviter and invitee accounts.""" - - invited_at: str | None = None - """The timestamp when the invitation was sent.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVITATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.account_id is not None: - serializer.write_string( - _SCHEMA_INVITATION.members["AccountId"], self.account_id - ) - - if self.invitation_id is not None: - serializer.write_string( - _SCHEMA_INVITATION.members["InvitationId"], self.invitation_id - ) - - if self.relationship_status is not None: - serializer.write_string( - _SCHEMA_INVITATION.members["RelationshipStatus"], - self.relationship_status, - ) - - if self.invited_at is not None: - serializer.write_string( - _SCHEMA_INVITATION.members["InvitedAt"], self.invited_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["account_id"] = de.read_string( - _SCHEMA_INVITATION.members["AccountId"] - ) - - case 1: - kwargs["invitation_id"] = de.read_string( - _SCHEMA_INVITATION.members["InvitationId"] - ) - - case 2: - kwargs["relationship_status"] = de.read_string( - _SCHEMA_INVITATION.members["RelationshipStatus"] - ) - - case 3: - kwargs["invited_at"] = de.read_string( - _SCHEMA_INVITATION.members["InvitedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INVITATION, consumer=_consumer) - return kwargs - - -def _serialize_invitations( - serializer: ShapeSerializer, schema: Schema, value: list[Invitation] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_invitations( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Invitation]: - result: list[Invitation] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Invitation.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListInvitationsOutput: - """Dataclass for ListInvitationsOutput structure.""" - - invitations: list[Invitation] | None = None - """A list of invitation descriptions.""" - - next_token: str | None = None - """ - The pagination parameter to be used on the next list operation to - retrieve more items. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_INVITATIONS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.invitations is not None: - _serialize_invitations( - serializer, - _SCHEMA_LIST_INVITATIONS_OUTPUT.members["Invitations"], - self.invitations, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_INVITATIONS_OUTPUT.members["NextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["invitations"] = _deserialize_invitations( - de, _SCHEMA_LIST_INVITATIONS_OUTPUT.members["Invitations"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_INVITATIONS_OUTPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_INVITATIONS_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_INVITATIONS = APIOperation( - input=ListInvitationsInput, - output=ListInvitationsOutput, - schema=_SCHEMA_LIST_INVITATIONS, - input_schema=_SCHEMA_LIST_INVITATIONS_INPUT, - output_schema=_SCHEMA_LIST_INVITATIONS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListIPSetsInput: - """Dataclass for ListIPSetsInput structure.""" - - detector_id: str | None = None - """ - The unique ID of the detector that is associated with IPSet. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - max_results: int | None = None - """ - You can use this parameter to indicate the maximum number of items you - want in the response. The default value is 50. The maximum value is 50. - """ - - next_token: str | None = None - """ - You can use this parameter when paginating results. Set the value of - this parameter to null on your first call to the list action. For - subsequent calls to the action, fill nextToken in the request with the - value of NextToken from the previous response to continue listing data. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_IP_SETS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_LIST_IP_SETS_INPUT.members["DetectorId"], self.detector_id - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_IP_SETS_INPUT.members["MaxResults"], self.max_results - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_IP_SETS_INPUT.members["NextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_LIST_IP_SETS_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_IP_SETS_INPUT.members["MaxResults"] - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_IP_SETS_INPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_IP_SETS_INPUT, consumer=_consumer) - return kwargs - - -def _serialize_ip_set_ids( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_ip_set_ids( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListIPSetsOutput: - """Dataclass for ListIPSetsOutput structure.""" - - ip_set_ids: list[str] | None = None - """The IDs of the IPSet resources.""" - - next_token: str | None = None - """ - The pagination parameter to be used on the next list operation to - retrieve more items. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_IP_SETS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.ip_set_ids is not None: - _serialize_ip_set_ids( - serializer, - _SCHEMA_LIST_IP_SETS_OUTPUT.members["IpSetIds"], - self.ip_set_ids, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_IP_SETS_OUTPUT.members["NextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["ip_set_ids"] = _deserialize_ip_set_ids( - de, _SCHEMA_LIST_IP_SETS_OUTPUT.members["IpSetIds"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_IP_SETS_OUTPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_IP_SETS_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_IP_SETS = APIOperation( - input=ListIPSetsInput, - output=ListIPSetsOutput, - schema=_SCHEMA_LIST_IP_SETS, - input_schema=_SCHEMA_LIST_IP_SETS_INPUT, - output_schema=_SCHEMA_LIST_IP_SETS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListMalwareProtectionPlansInput: - """Dataclass for ListMalwareProtectionPlansInput structure.""" - - next_token: str | None = None - """ - You can use this parameter when paginating results. Set the value of - this parameter to null on your first call to the list action. For - subsequent calls to the action, fill nextToken in the request with the - value of `NextToken` from the previous response to continue listing - data. The default page size is 100 plans. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_MALWARE_PROTECTION_PLANS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_MALWARE_PROTECTION_PLANS_INPUT.members["NextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_MALWARE_PROTECTION_PLANS_INPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_MALWARE_PROTECTION_PLANS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class MalwareProtectionPlanSummary: - """Information about the Malware Protection plan resource.""" - - malware_protection_plan_id: str | None = None - """A unique identifier associated with Malware Protection plan.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MALWARE_PROTECTION_PLAN_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.malware_protection_plan_id is not None: - serializer.write_string( - _SCHEMA_MALWARE_PROTECTION_PLAN_SUMMARY.members[ - "MalwareProtectionPlanId" - ], - self.malware_protection_plan_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["malware_protection_plan_id"] = de.read_string( - _SCHEMA_MALWARE_PROTECTION_PLAN_SUMMARY.members[ - "MalwareProtectionPlanId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MALWARE_PROTECTION_PLAN_SUMMARY, consumer=_consumer - ) - return kwargs - - -def _serialize_malware_protection_plans_summary( - serializer: ShapeSerializer, - schema: Schema, - value: list[MalwareProtectionPlanSummary], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_malware_protection_plans_summary( - deserializer: ShapeDeserializer, schema: Schema -) -> list[MalwareProtectionPlanSummary]: - result: list[MalwareProtectionPlanSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(MalwareProtectionPlanSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListMalwareProtectionPlansOutput: - """Dataclass for ListMalwareProtectionPlansOutput structure.""" - - malware_protection_plans: list[MalwareProtectionPlanSummary] | None = None - """ - A list of unique identifiers associated with each Malware Protection - plan. - """ - - next_token: str | None = None - """ - You can use this parameter when paginating results. Set the value of - this parameter to null on your first call to the list action. For - subsequent calls to the action, fill nextToken in the request with the - value of `NextToken` from the previous response to continue listing - data. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_MALWARE_PROTECTION_PLANS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.malware_protection_plans is not None: - _serialize_malware_protection_plans_summary( - serializer, - _SCHEMA_LIST_MALWARE_PROTECTION_PLANS_OUTPUT.members[ - "MalwareProtectionPlans" - ], - self.malware_protection_plans, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_MALWARE_PROTECTION_PLANS_OUTPUT.members["NextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["malware_protection_plans"] = ( - _deserialize_malware_protection_plans_summary( - de, - _SCHEMA_LIST_MALWARE_PROTECTION_PLANS_OUTPUT.members[ - "MalwareProtectionPlans" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_MALWARE_PROTECTION_PLANS_OUTPUT.members[ - "NextToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_MALWARE_PROTECTION_PLANS_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_MALWARE_PROTECTION_PLANS = APIOperation( - input=ListMalwareProtectionPlansInput, - output=ListMalwareProtectionPlansOutput, - schema=_SCHEMA_LIST_MALWARE_PROTECTION_PLANS, - input_schema=_SCHEMA_LIST_MALWARE_PROTECTION_PLANS_INPUT, - output_schema=_SCHEMA_LIST_MALWARE_PROTECTION_PLANS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.guardduty#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -class ListMalwareScansCriterionKey(UnknownEnumMixin, StrEnum): - RESOURCE_ARN = "RESOURCE_ARN" - SCAN_ID = "SCAN_ID" - ACCOUNT_ID = "ACCOUNT_ID" - GUARDDUTY_FINDING_ID = "GUARDDUTY_FINDING_ID" - RESOURCE_TYPE = "RESOURCE_TYPE" - SCAN_START_TIME = "SCAN_START_TIME" - SCAN_STATUS = "SCAN_STATUS" - SCAN_TYPE = "SCAN_TYPE" - - -@dataclass(kw_only=True) -class ListMalwareScansFilterCriterion: - """ - Represents a condition that when matched will be added to the response - of the operation. Irrespective of using any filter criteria, an - administrator account can view the scan entries for all of its member - accounts. However, each member account can view the scan entries only - for their own account. - """ - - list_malware_scans_criterion_key: str | None = None - """ - An enum value representing possible scan properties to match with given - scan entries. - """ - - filter_condition: FilterCondition | None = None - """Contains information about the condition.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_MALWARE_SCANS_FILTER_CRITERION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.list_malware_scans_criterion_key is not None: - serializer.write_string( - _SCHEMA_LIST_MALWARE_SCANS_FILTER_CRITERION.members[ - "ListMalwareScansCriterionKey" - ], - self.list_malware_scans_criterion_key, - ) - - if self.filter_condition is not None: - serializer.write_struct( - _SCHEMA_LIST_MALWARE_SCANS_FILTER_CRITERION.members["FilterCondition"], - self.filter_condition, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["list_malware_scans_criterion_key"] = ( - ListMalwareScansCriterionKey( - de.read_string( - _SCHEMA_LIST_MALWARE_SCANS_FILTER_CRITERION.members[ - "ListMalwareScansCriterionKey" - ] - ) - ) - ) - - case 1: - kwargs["filter_condition"] = FilterCondition.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_MALWARE_SCANS_FILTER_CRITERION, consumer=_consumer - ) - return kwargs - - -def _serialize_list_malware_scans_filter_criterion_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[ListMalwareScansFilterCriterion], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_list_malware_scans_filter_criterion_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ListMalwareScansFilterCriterion]: - result: list[ListMalwareScansFilterCriterion] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ListMalwareScansFilterCriterion.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListMalwareScansFilterCriteria: - """Represents the criteria used to filter the malware scan entries.""" - - list_malware_scans_filter_criterion: ( - list[ListMalwareScansFilterCriterion] | None - ) = None - """ - Represents a condition that when matched will be added to the response - of the operation. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_MALWARE_SCANS_FILTER_CRITERIA, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.list_malware_scans_filter_criterion is not None: - _serialize_list_malware_scans_filter_criterion_list( - serializer, - _SCHEMA_LIST_MALWARE_SCANS_FILTER_CRITERIA.members[ - "ListMalwareScansFilterCriterion" - ], - self.list_malware_scans_filter_criterion, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["list_malware_scans_filter_criterion"] = ( - _deserialize_list_malware_scans_filter_criterion_list( - de, - _SCHEMA_LIST_MALWARE_SCANS_FILTER_CRITERIA.members[ - "ListMalwareScansFilterCriterion" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_MALWARE_SCANS_FILTER_CRITERIA, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ListMalwareScansInput: - """Dataclass for ListMalwareScansInput structure.""" - - max_results: int | None = None - """ - You can use this parameter to indicate the maximum number of items that - you want in the response. The default value is 50. The maximum value is - 50. - """ - - next_token: str | None = None - """ - You can use this parameter when paginating results. Set the value of - this parameter to null on your first call to the list action. For - subsequent calls to the action, fill nextToken in the request with the - value of NextToken from the previous response to continue listing - results. - """ - - filter_criteria: ListMalwareScansFilterCriteria | None = None - """Represents the criteria used to filter the malware scan entries.""" - - sort_criteria: SortCriteria | None = None - """Represents the criteria used for sorting malware scan entries.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_MALWARE_SCANS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_MALWARE_SCANS_INPUT.members["MaxResults"], self.max_results - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_MALWARE_SCANS_INPUT.members["NextToken"], self.next_token - ) - - if self.filter_criteria is not None: - serializer.write_struct( - _SCHEMA_LIST_MALWARE_SCANS_INPUT.members["FilterCriteria"], - self.filter_criteria, - ) - - if self.sort_criteria is not None: - serializer.write_struct( - _SCHEMA_LIST_MALWARE_SCANS_INPUT.members["SortCriteria"], - self.sort_criteria, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_MALWARE_SCANS_INPUT.members["MaxResults"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_MALWARE_SCANS_INPUT.members["NextToken"] - ) - - case 2: - kwargs["filter_criteria"] = ( - ListMalwareScansFilterCriteria.deserialize(de) - ) - - case 3: - kwargs["sort_criteria"] = SortCriteria.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_MALWARE_SCANS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class MalwareScan: - """Contains information about a particular malware scan.""" - - resource_arn: str | None = None - """Amazon Resource Name (ARN) of the resource for the given malware scan.""" - - resource_type: str | None = None - """The type of resource that was scanned for malware.""" - - scan_id: str | None = None - """ - A unique identifier that gets generated when you invoke the API without - any error. Each malware scan has a corresponding scan ID. Using this - scan ID, you can monitor the status of your malware scan. - """ - - scan_status: str | None = None - """An enum value representing the current status of the malware scan.""" - - scan_result_status: str | None = None - """An enum value representing the result of the malware scan.""" - - scan_type: str | None = None - """An enum value representing the type of scan that was initiated.""" - - scan_started_at: datetime | None = None - """The timestamp representing when the malware scan was started.""" - - scan_completed_at: datetime | None = None - """The timestamp representing when the malware scan was completed.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MALWARE_SCAN, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_MALWARE_SCAN.members["ResourceArn"], self.resource_arn - ) - - if self.resource_type is not None: - serializer.write_string( - _SCHEMA_MALWARE_SCAN.members["ResourceType"], self.resource_type - ) - - if self.scan_id is not None: - serializer.write_string( - _SCHEMA_MALWARE_SCAN.members["ScanId"], self.scan_id - ) - - if self.scan_status is not None: - serializer.write_string( - _SCHEMA_MALWARE_SCAN.members["ScanStatus"], self.scan_status - ) - - if self.scan_result_status is not None: - serializer.write_string( - _SCHEMA_MALWARE_SCAN.members["ScanResultStatus"], - self.scan_result_status, - ) - - if self.scan_type is not None: - serializer.write_string( - _SCHEMA_MALWARE_SCAN.members["ScanType"], self.scan_type - ) - - if self.scan_started_at is not None: - serializer.write_timestamp( - _SCHEMA_MALWARE_SCAN.members["ScanStartedAt"], self.scan_started_at - ) - - if self.scan_completed_at is not None: - serializer.write_timestamp( - _SCHEMA_MALWARE_SCAN.members["ScanCompletedAt"], self.scan_completed_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_MALWARE_SCAN.members["ResourceArn"] - ) - - case 1: - kwargs["resource_type"] = MalwareProtectionResourceType( - de.read_string(_SCHEMA_MALWARE_SCAN.members["ResourceType"]) - ) - - case 2: - kwargs["scan_id"] = de.read_string( - _SCHEMA_MALWARE_SCAN.members["ScanId"] - ) - - case 3: - kwargs["scan_status"] = MalwareProtectionScanStatus( - de.read_string(_SCHEMA_MALWARE_SCAN.members["ScanStatus"]) - ) - - case 4: - kwargs["scan_result_status"] = ScanResultStatus( - de.read_string(_SCHEMA_MALWARE_SCAN.members["ScanResultStatus"]) - ) - - case 5: - kwargs["scan_type"] = MalwareProtectionScanType( - de.read_string(_SCHEMA_MALWARE_SCAN.members["ScanType"]) - ) - - case 6: - kwargs["scan_started_at"] = de.read_timestamp( - _SCHEMA_MALWARE_SCAN.members["ScanStartedAt"] - ) - - case 7: - kwargs["scan_completed_at"] = de.read_timestamp( - _SCHEMA_MALWARE_SCAN.members["ScanCompletedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MALWARE_SCAN, consumer=_consumer) - return kwargs - - -def _serialize_malware_scans( - serializer: ShapeSerializer, schema: Schema, value: list[MalwareScan] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_malware_scans( - deserializer: ShapeDeserializer, schema: Schema -) -> list[MalwareScan]: - result: list[MalwareScan] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(MalwareScan.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListMalwareScansOutput: - """Dataclass for ListMalwareScansOutput structure.""" - - scans: list[MalwareScan] | None = None - """The list of malware scans associated with the provided input parameters.""" - - next_token: str | None = None - """ - The pagination parameter to be used on the next list operation to - retrieve more scans. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_MALWARE_SCANS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.scans is not None: - _serialize_malware_scans( - serializer, - _SCHEMA_LIST_MALWARE_SCANS_OUTPUT.members["Scans"], - self.scans, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_MALWARE_SCANS_OUTPUT.members["NextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["scans"] = _deserialize_malware_scans( - de, _SCHEMA_LIST_MALWARE_SCANS_OUTPUT.members["Scans"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_MALWARE_SCANS_OUTPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_MALWARE_SCANS_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_MALWARE_SCANS = APIOperation( - input=ListMalwareScansInput, - output=ListMalwareScansOutput, - schema=_SCHEMA_LIST_MALWARE_SCANS, - input_schema=_SCHEMA_LIST_MALWARE_SCANS_INPUT, - output_schema=_SCHEMA_LIST_MALWARE_SCANS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListMembersInput: - """Dataclass for ListMembersInput structure.""" - - detector_id: str | None = None - """ - The unique ID of the detector that is associated with the member. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - max_results: int | None = None - """ - You can use this parameter to indicate the maximum number of items you - want in the response. The default value is 50. The maximum value is 50. - """ - - next_token: str | None = None - """ - You can use this parameter when paginating results. Set the value of - this parameter to null on your first call to the list action. For - subsequent calls to the action, fill nextToken in the request with the - value of NextToken from the previous response to continue listing data. - """ - - only_associated: str | None = None - """ - Specifies whether to only return associated members or to return all - members (including members who haven't been invited yet or have been - disassociated). Member accounts must have been previously associated - with the GuardDuty administrator account using - [`Create Members`](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_CreateMembers.html) - . - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_MEMBERS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_LIST_MEMBERS_INPUT.members["DetectorId"], self.detector_id - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_MEMBERS_INPUT.members["MaxResults"], self.max_results - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_MEMBERS_INPUT.members["NextToken"], self.next_token - ) - - if self.only_associated is not None: - serializer.write_string( - _SCHEMA_LIST_MEMBERS_INPUT.members["OnlyAssociated"], - self.only_associated, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_LIST_MEMBERS_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_MEMBERS_INPUT.members["MaxResults"] - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_MEMBERS_INPUT.members["NextToken"] - ) - - case 3: - kwargs["only_associated"] = de.read_string( - _SCHEMA_LIST_MEMBERS_INPUT.members["OnlyAssociated"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_MEMBERS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ListMembersOutput: - """Dataclass for ListMembersOutput structure.""" - - members: list[Member] | None = None - """ - A list of members. - - Note: - The values for `email` and `invitedAt` are available only if the member - accounts are added by invitation. - """ - - next_token: str | None = None - """ - The pagination parameter to be used on the next list operation to - retrieve more items. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_MEMBERS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.members is not None: - _serialize_members( - serializer, _SCHEMA_LIST_MEMBERS_OUTPUT.members["Members"], self.members - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_MEMBERS_OUTPUT.members["NextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["members"] = _deserialize_members( - de, _SCHEMA_LIST_MEMBERS_OUTPUT.members["Members"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_MEMBERS_OUTPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_MEMBERS_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_MEMBERS = APIOperation( - input=ListMembersInput, - output=ListMembersOutput, - schema=_SCHEMA_LIST_MEMBERS, - input_schema=_SCHEMA_LIST_MEMBERS_INPUT, - output_schema=_SCHEMA_LIST_MEMBERS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListOrganizationAdminAccountsInput: - """Dataclass for ListOrganizationAdminAccountsInput structure.""" - - max_results: int | None = None - """The maximum number of results to return in the response.""" - - next_token: str | None = None - """ - A token to use for paginating results that are returned in the response. - Set the value of this parameter to null for the first request to a list - action. For subsequent calls, use the `NextToken` value returned from - the previous request to continue listing results after the first page. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_ORGANIZATION_ADMIN_ACCOUNTS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_ORGANIZATION_ADMIN_ACCOUNTS_INPUT.members["MaxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_ORGANIZATION_ADMIN_ACCOUNTS_INPUT.members["NextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_ORGANIZATION_ADMIN_ACCOUNTS_INPUT.members[ - "MaxResults" - ] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_ORGANIZATION_ADMIN_ACCOUNTS_INPUT.members[ - "NextToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_ORGANIZATION_ADMIN_ACCOUNTS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ListOrganizationAdminAccountsOutput: - """Dataclass for ListOrganizationAdminAccountsOutput structure.""" - - admin_accounts: list[AdminAccount] | None = None - """A list of accounts configured as GuardDuty delegated administrators.""" - - next_token: str | None = None - """ - The pagination parameter to be used on the next list operation to - retrieve more items. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_ORGANIZATION_ADMIN_ACCOUNTS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.admin_accounts is not None: - _serialize_admin_accounts( - serializer, - _SCHEMA_LIST_ORGANIZATION_ADMIN_ACCOUNTS_OUTPUT.members[ - "AdminAccounts" - ], - self.admin_accounts, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_ORGANIZATION_ADMIN_ACCOUNTS_OUTPUT.members["NextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["admin_accounts"] = _deserialize_admin_accounts( - de, - _SCHEMA_LIST_ORGANIZATION_ADMIN_ACCOUNTS_OUTPUT.members[ - "AdminAccounts" - ], - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_ORGANIZATION_ADMIN_ACCOUNTS_OUTPUT.members[ - "NextToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_ORGANIZATION_ADMIN_ACCOUNTS_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_ORGANIZATION_ADMIN_ACCOUNTS = APIOperation( - input=ListOrganizationAdminAccountsInput, - output=ListOrganizationAdminAccountsOutput, - schema=_SCHEMA_LIST_ORGANIZATION_ADMIN_ACCOUNTS, - input_schema=_SCHEMA_LIST_ORGANIZATION_ADMIN_ACCOUNTS_INPUT, - output_schema=_SCHEMA_LIST_ORGANIZATION_ADMIN_ACCOUNTS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListPublishingDestinationsInput: - """Dataclass for ListPublishingDestinationsInput structure.""" - - detector_id: str | None = None - """ - The detector ID for which you want to retrieve the publishing - destination. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - max_results: int | None = None - """The maximum number of results to return in the response.""" - - next_token: str | None = None - """ - A token to use for paginating results that are returned in the response. - Set the value of this parameter to null for the first request to a list - action. For subsequent calls, use the `NextToken` value returned from - the previous request to continue listing results after the first page. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_PUBLISHING_DESTINATIONS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_LIST_PUBLISHING_DESTINATIONS_INPUT.members["DetectorId"], - self.detector_id, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_PUBLISHING_DESTINATIONS_INPUT.members["MaxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_PUBLISHING_DESTINATIONS_INPUT.members["NextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_LIST_PUBLISHING_DESTINATIONS_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_PUBLISHING_DESTINATIONS_INPUT.members["MaxResults"] - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_PUBLISHING_DESTINATIONS_INPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_PUBLISHING_DESTINATIONS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ListPublishingDestinationsOutput: - """Dataclass for ListPublishingDestinationsOutput structure.""" - - destinations: list[Destination] | None = None - """ - A `Destinations` object that includes information about each publishing - destination returned. - """ - - next_token: str | None = None - """ - A token to use for paginating results that are returned in the response. - Set the value of this parameter to null for the first request to a list - action. For subsequent calls, use the `NextToken` value returned from - the previous request to continue listing results after the first page. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_PUBLISHING_DESTINATIONS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.destinations is not None: - _serialize_destinations( - serializer, - _SCHEMA_LIST_PUBLISHING_DESTINATIONS_OUTPUT.members["Destinations"], - self.destinations, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_PUBLISHING_DESTINATIONS_OUTPUT.members["NextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["destinations"] = _deserialize_destinations( - de, - _SCHEMA_LIST_PUBLISHING_DESTINATIONS_OUTPUT.members[ - "Destinations" - ], - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_PUBLISHING_DESTINATIONS_OUTPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_PUBLISHING_DESTINATIONS_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_PUBLISHING_DESTINATIONS = APIOperation( - input=ListPublishingDestinationsInput, - output=ListPublishingDestinationsOutput, - schema=_SCHEMA_LIST_PUBLISHING_DESTINATIONS, - input_schema=_SCHEMA_LIST_PUBLISHING_DESTINATIONS_INPUT, - output_schema=_SCHEMA_LIST_PUBLISHING_DESTINATIONS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListTagsForResourceInput: - """Dataclass for ListTagsForResourceInput structure.""" - - resource_arn: str | None = None - """The Amazon Resource Name (ARN) for the given GuardDuty resource.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT.members["ResourceArn"], - self.resource_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT.members["ResourceArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ListTagsForResourceOutput: - """Dataclass for ListTagsForResourceOutput structure.""" - - tags: dict[str, str] | None = None - """The tags associated with the resource.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.tags is not None: - _serialize_tag_map( - serializer, - _SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT.members["Tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["tags"] = _deserialize_tag_map( - de, _SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT.members["Tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_TAGS_FOR_RESOURCE = APIOperation( - input=ListTagsForResourceInput, - output=ListTagsForResourceOutput, - schema=_SCHEMA_LIST_TAGS_FOR_RESOURCE, - input_schema=_SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT, - output_schema=_SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.guardduty#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListThreatEntitySetsInput: - """Dataclass for ListThreatEntitySetsInput structure.""" - - detector_id: str | None = None - """ - The unique ID of the GuardDuty detector that is associated with this - threat entity set. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - max_results: int | None = None - """ - You can use this parameter to indicate the maximum number of items you - want in the response. The default value is 50. - """ - - next_token: str | None = None - """ - You can use this parameter when paginating results. Set the value of - this parameter to null on your first call to the list action. For - subsequent calls to the action, fill nextToken in the request with the - value of NextToken from the previous response to continue listing data. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_THREAT_ENTITY_SETS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_LIST_THREAT_ENTITY_SETS_INPUT.members["DetectorId"], - self.detector_id, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_THREAT_ENTITY_SETS_INPUT.members["MaxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_THREAT_ENTITY_SETS_INPUT.members["NextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_LIST_THREAT_ENTITY_SETS_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_THREAT_ENTITY_SETS_INPUT.members["MaxResults"] - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_THREAT_ENTITY_SETS_INPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_THREAT_ENTITY_SETS_INPUT, consumer=_consumer - ) - return kwargs - - -def _serialize_threat_entity_set_ids( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_threat_entity_set_ids( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListThreatEntitySetsOutput: - """Dataclass for ListThreatEntitySetsOutput structure.""" - - threat_entity_set_ids: list[str] | None = None - """The IDs of the threat entity set resources.""" - - next_token: str | None = None - """ - The pagination parameter to be used on the next list operation to - retrieve more items. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_THREAT_ENTITY_SETS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.threat_entity_set_ids is not None: - _serialize_threat_entity_set_ids( - serializer, - _SCHEMA_LIST_THREAT_ENTITY_SETS_OUTPUT.members["ThreatEntitySetIds"], - self.threat_entity_set_ids, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_THREAT_ENTITY_SETS_OUTPUT.members["NextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["threat_entity_set_ids"] = ( - _deserialize_threat_entity_set_ids( - de, - _SCHEMA_LIST_THREAT_ENTITY_SETS_OUTPUT.members[ - "ThreatEntitySetIds" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_THREAT_ENTITY_SETS_OUTPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_THREAT_ENTITY_SETS_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_THREAT_ENTITY_SETS = APIOperation( - input=ListThreatEntitySetsInput, - output=ListThreatEntitySetsOutput, - schema=_SCHEMA_LIST_THREAT_ENTITY_SETS, - input_schema=_SCHEMA_LIST_THREAT_ENTITY_SETS_INPUT, - output_schema=_SCHEMA_LIST_THREAT_ENTITY_SETS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListThreatIntelSetsInput: - """Dataclass for ListThreatIntelSetsInput structure.""" - - detector_id: str | None = None - """ - The unique ID of the detector that is associated with the - threatIntelSet. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - max_results: int | None = None - """ - You can use this parameter to indicate the maximum number of items that - you want in the response. The default value is 50. The maximum value is - 50. - """ - - next_token: str | None = None - """ - You can use this parameter to paginate results in the response. Set the - value of this parameter to null on your first call to the list action. - For subsequent calls to the action, fill nextToken in the request with - the value of NextToken from the previous response to continue listing - data. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_THREAT_INTEL_SETS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_LIST_THREAT_INTEL_SETS_INPUT.members["DetectorId"], - self.detector_id, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_THREAT_INTEL_SETS_INPUT.members["MaxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_THREAT_INTEL_SETS_INPUT.members["NextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_LIST_THREAT_INTEL_SETS_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_THREAT_INTEL_SETS_INPUT.members["MaxResults"] - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_THREAT_INTEL_SETS_INPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_THREAT_INTEL_SETS_INPUT, consumer=_consumer - ) - return kwargs - - -def _serialize_threat_intel_set_ids( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_threat_intel_set_ids( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListThreatIntelSetsOutput: - """Dataclass for ListThreatIntelSetsOutput structure.""" - - threat_intel_set_ids: list[str] | None = None - """The IDs of the ThreatIntelSet resources.""" - - next_token: str | None = None - """ - The pagination parameter to be used on the next list operation to - retrieve more items. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_THREAT_INTEL_SETS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.threat_intel_set_ids is not None: - _serialize_threat_intel_set_ids( - serializer, - _SCHEMA_LIST_THREAT_INTEL_SETS_OUTPUT.members["ThreatIntelSetIds"], - self.threat_intel_set_ids, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_THREAT_INTEL_SETS_OUTPUT.members["NextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["threat_intel_set_ids"] = _deserialize_threat_intel_set_ids( - de, - _SCHEMA_LIST_THREAT_INTEL_SETS_OUTPUT.members[ - "ThreatIntelSetIds" - ], - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_THREAT_INTEL_SETS_OUTPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_THREAT_INTEL_SETS_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_THREAT_INTEL_SETS = APIOperation( - input=ListThreatIntelSetsInput, - output=ListThreatIntelSetsOutput, - schema=_SCHEMA_LIST_THREAT_INTEL_SETS, - input_schema=_SCHEMA_LIST_THREAT_INTEL_SETS_INPUT, - output_schema=_SCHEMA_LIST_THREAT_INTEL_SETS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListTrustedEntitySetsInput: - """Dataclass for ListTrustedEntitySetsInput structure.""" - - detector_id: str | None = None - """ - The unique ID of the GuardDuty detector that is associated with this - threat entity set. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - max_results: int | None = None - """ - You can use this parameter to indicate the maximum number of items you - want in the response. The default value is 50. - """ - - next_token: str | None = None - """ - You can use this parameter when paginating results. Set the value of - this parameter to null on your first call to the list action. For - subsequent calls to the action, fill nextToken in the request with the - value of NextToken from the previous response to continue listing data. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_TRUSTED_ENTITY_SETS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_LIST_TRUSTED_ENTITY_SETS_INPUT.members["DetectorId"], - self.detector_id, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_TRUSTED_ENTITY_SETS_INPUT.members["MaxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_TRUSTED_ENTITY_SETS_INPUT.members["NextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_LIST_TRUSTED_ENTITY_SETS_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_TRUSTED_ENTITY_SETS_INPUT.members["MaxResults"] - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_TRUSTED_ENTITY_SETS_INPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_TRUSTED_ENTITY_SETS_INPUT, consumer=_consumer - ) - return kwargs - - -def _serialize_trusted_entity_set_ids( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_trusted_entity_set_ids( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListTrustedEntitySetsOutput: - """Dataclass for ListTrustedEntitySetsOutput structure.""" - - trusted_entity_set_ids: list[str] | None = None - """The IDs of the trusted entity set resources.""" - - next_token: str | None = None - """ - The pagination parameter to be used on the next list operation to - retrieve more items. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_TRUSTED_ENTITY_SETS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.trusted_entity_set_ids is not None: - _serialize_trusted_entity_set_ids( - serializer, - _SCHEMA_LIST_TRUSTED_ENTITY_SETS_OUTPUT.members["TrustedEntitySetIds"], - self.trusted_entity_set_ids, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_TRUSTED_ENTITY_SETS_OUTPUT.members["NextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["trusted_entity_set_ids"] = ( - _deserialize_trusted_entity_set_ids( - de, - _SCHEMA_LIST_TRUSTED_ENTITY_SETS_OUTPUT.members[ - "TrustedEntitySetIds" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_TRUSTED_ENTITY_SETS_OUTPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_TRUSTED_ENTITY_SETS_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_TRUSTED_ENTITY_SETS = APIOperation( - input=ListTrustedEntitySetsInput, - output=ListTrustedEntitySetsOutput, - schema=_SCHEMA_LIST_TRUSTED_ENTITY_SETS, - input_schema=_SCHEMA_LIST_TRUSTED_ENTITY_SETS_INPUT, - output_schema=_SCHEMA_LIST_TRUSTED_ENTITY_SETS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class S3ObjectForSendObjectMalwareScan: - """ - The S3 object path to initiate a scan, including bucket name, object - key, and optional version ID. - """ - - bucket: str | None = None - """ - The name of the S3 bucket containing the object to scan. The bucket must - have GuardDuty Malware Protection enabled. - """ - - key: str | None = None - """ - The key (name) of the S3 object to scan for malware. This must be the - full key path of the object within the bucket. - """ - - version_id: str | None = None - """ - The version ID of the S3 object to scan. If not specified, the latest - version of the object is scanned. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_S3_OBJECT_FOR_SEND_OBJECT_MALWARE_SCAN, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.bucket is not None: - serializer.write_string( - _SCHEMA_S3_OBJECT_FOR_SEND_OBJECT_MALWARE_SCAN.members["Bucket"], - self.bucket, - ) - - if self.key is not None: - serializer.write_string( - _SCHEMA_S3_OBJECT_FOR_SEND_OBJECT_MALWARE_SCAN.members["Key"], self.key - ) - - if self.version_id is not None: - serializer.write_string( - _SCHEMA_S3_OBJECT_FOR_SEND_OBJECT_MALWARE_SCAN.members["VersionId"], - self.version_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bucket"] = de.read_string( - _SCHEMA_S3_OBJECT_FOR_SEND_OBJECT_MALWARE_SCAN.members["Bucket"] - ) - - case 1: - kwargs["key"] = de.read_string( - _SCHEMA_S3_OBJECT_FOR_SEND_OBJECT_MALWARE_SCAN.members["Key"] - ) - - case 2: - kwargs["version_id"] = de.read_string( - _SCHEMA_S3_OBJECT_FOR_SEND_OBJECT_MALWARE_SCAN.members[ - "VersionId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_S3_OBJECT_FOR_SEND_OBJECT_MALWARE_SCAN, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class SendObjectMalwareScanInput: - """Dataclass for SendObjectMalwareScanInput structure.""" - - s3_object: S3ObjectForSendObjectMalwareScan | None = None - """ - The S3 object information for the object you want to scan. The bucket - must have a Malware Protection plan configured to use this API. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SEND_OBJECT_MALWARE_SCAN_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.s3_object is not None: - serializer.write_struct( - _SCHEMA_SEND_OBJECT_MALWARE_SCAN_INPUT.members["S3Object"], - self.s3_object, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["s3_object"] = S3ObjectForSendObjectMalwareScan.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SEND_OBJECT_MALWARE_SCAN_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class SendObjectMalwareScanOutput: - """Dataclass for SendObjectMalwareScanOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SEND_OBJECT_MALWARE_SCAN_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SEND_OBJECT_MALWARE_SCAN_OUTPUT, consumer=_consumer - ) - return kwargs - - -SEND_OBJECT_MALWARE_SCAN = APIOperation( - input=SendObjectMalwareScanInput, - output=SendObjectMalwareScanOutput, - schema=_SCHEMA_SEND_OBJECT_MALWARE_SCAN, - input_schema=_SCHEMA_SEND_OBJECT_MALWARE_SCAN_INPUT, - output_schema=_SCHEMA_SEND_OBJECT_MALWARE_SCAN_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.guardduty#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class RecoveryPoint: - """ - Contains information about the recovery point configuration for scanning - backup data from Amazon Web Services Backup. - """ - - backup_vault_name: str | None = None - """ - The name of the Amazon Web Services Backup vault that contains the name - of the recovery point to be scanned. - """ - - continuous_scan_details: ContinuousScanDetails | None = None - """ - Contains information about the time range within the continuous backup - in Amazon Web Services Backup to scan. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RECOVERY_POINT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.backup_vault_name is not None: - serializer.write_string( - _SCHEMA_RECOVERY_POINT.members["BackupVaultName"], - self.backup_vault_name, - ) - - if self.continuous_scan_details is not None: - serializer.write_struct( - _SCHEMA_RECOVERY_POINT.members["ContinuousScanDetails"], - self.continuous_scan_details, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["backup_vault_name"] = de.read_string( - _SCHEMA_RECOVERY_POINT.members["BackupVaultName"] - ) - - case 1: - kwargs["continuous_scan_details"] = ( - ContinuousScanDetails.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RECOVERY_POINT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class StartMalwareScanConfiguration: - """ - Contains information about the configuration to be used for the malware - scan. - """ - - role: str | None = None - """ - Amazon Resource Name (ARN) of the IAM role that is used for scanning the - resource. - """ - - incremental_scan_details: IncrementalScanDetails | None = None - """ - Contains information about the incremental scan configuration. When - specified, the scan will only process changes since the baseline - resource. - """ - - recovery_point: RecoveryPoint | None = None - """ - Contains information about the recovery point configuration for the - requested scan. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_MALWARE_SCAN_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.role is not None: - serializer.write_string( - _SCHEMA_START_MALWARE_SCAN_CONFIGURATION.members["Role"], self.role - ) - - if self.incremental_scan_details is not None: - serializer.write_struct( - _SCHEMA_START_MALWARE_SCAN_CONFIGURATION.members[ - "IncrementalScanDetails" - ], - self.incremental_scan_details, - ) - - if self.recovery_point is not None: - serializer.write_struct( - _SCHEMA_START_MALWARE_SCAN_CONFIGURATION.members["RecoveryPoint"], - self.recovery_point, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["role"] = de.read_string( - _SCHEMA_START_MALWARE_SCAN_CONFIGURATION.members["Role"] - ) - - case 1: - kwargs["incremental_scan_details"] = ( - IncrementalScanDetails.deserialize(de) - ) - - case 2: - kwargs["recovery_point"] = RecoveryPoint.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_START_MALWARE_SCAN_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class StartMalwareScanInput: - """Dataclass for StartMalwareScanInput structure.""" - - resource_arn: str | None = None - """ - Amazon Resource Name (ARN) of the resource for which you invoked the - API. - """ - - client_token: str | None = None - """The idempotency token for the create request.""" - - scan_configuration: StartMalwareScanConfiguration | None = None - """ - Contains information about the configuration to be used for the malware - scan. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_MALWARE_SCAN_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_START_MALWARE_SCAN_INPUT.members["ResourceArn"], - self.resource_arn, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_START_MALWARE_SCAN_INPUT.members["ClientToken"], - self.client_token, - ) - - if self.scan_configuration is not None: - serializer.write_struct( - _SCHEMA_START_MALWARE_SCAN_INPUT.members["ScanConfiguration"], - self.scan_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_START_MALWARE_SCAN_INPUT.members["ResourceArn"] - ) - - case 1: - kwargs["client_token"] = de.read_string( - _SCHEMA_START_MALWARE_SCAN_INPUT.members["ClientToken"] - ) - - case 2: - kwargs["scan_configuration"] = ( - StartMalwareScanConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_START_MALWARE_SCAN_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class StartMalwareScanOutput: - """Dataclass for StartMalwareScanOutput structure.""" - - scan_id: str | None = None - """ - A unique identifier that gets generated when you invoke the API without - any error. Each malware scan has a corresponding scan ID. Using this - scan ID, you can monitor the status of your malware scan. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_MALWARE_SCAN_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.scan_id is not None: - serializer.write_string( - _SCHEMA_START_MALWARE_SCAN_OUTPUT.members["ScanId"], self.scan_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["scan_id"] = de.read_string( - _SCHEMA_START_MALWARE_SCAN_OUTPUT.members["ScanId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_START_MALWARE_SCAN_OUTPUT, consumer=_consumer) - return kwargs - - -START_MALWARE_SCAN = APIOperation( - input=StartMalwareScanInput, - output=StartMalwareScanOutput, - schema=_SCHEMA_START_MALWARE_SCAN, - input_schema=_SCHEMA_START_MALWARE_SCAN_INPUT, - output_schema=_SCHEMA_START_MALWARE_SCAN_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID("com.amazonaws.guardduty#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class StartMonitoringMembersInput: - """Dataclass for StartMonitoringMembersInput structure.""" - - detector_id: str | None = None - """ - The unique ID of the detector of the GuardDuty administrator account - associated with the member accounts to monitor. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - account_ids: list[str] | None = None - """ - A list of account IDs of the GuardDuty member accounts to start - monitoring. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_MONITORING_MEMBERS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_START_MONITORING_MEMBERS_INPUT.members["DetectorId"], - self.detector_id, - ) - - if self.account_ids is not None: - _serialize_account_ids( - serializer, - _SCHEMA_START_MONITORING_MEMBERS_INPUT.members["AccountIds"], - self.account_ids, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_START_MONITORING_MEMBERS_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["account_ids"] = _deserialize_account_ids( - de, _SCHEMA_START_MONITORING_MEMBERS_INPUT.members["AccountIds"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_START_MONITORING_MEMBERS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class StartMonitoringMembersOutput: - """Dataclass for StartMonitoringMembersOutput structure.""" - - unprocessed_accounts: list[UnprocessedAccount] | None = None - """ - A list of objects that contain the unprocessed account and a result - string that explains why it was unprocessed. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_MONITORING_MEMBERS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.unprocessed_accounts is not None: - _serialize_unprocessed_accounts( - serializer, - _SCHEMA_START_MONITORING_MEMBERS_OUTPUT.members["UnprocessedAccounts"], - self.unprocessed_accounts, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["unprocessed_accounts"] = _deserialize_unprocessed_accounts( - de, - _SCHEMA_START_MONITORING_MEMBERS_OUTPUT.members[ - "UnprocessedAccounts" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_START_MONITORING_MEMBERS_OUTPUT, consumer=_consumer - ) - return kwargs - - -START_MONITORING_MEMBERS = APIOperation( - input=StartMonitoringMembersInput, - output=StartMonitoringMembersOutput, - schema=_SCHEMA_START_MONITORING_MEMBERS, - input_schema=_SCHEMA_START_MONITORING_MEMBERS_INPUT, - output_schema=_SCHEMA_START_MONITORING_MEMBERS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class StopMonitoringMembersInput: - """Dataclass for StopMonitoringMembersInput structure.""" - - detector_id: str | None = None - """ - The unique ID of the detector associated with the GuardDuty - administrator account that is monitoring member accounts. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - account_ids: list[str] | None = None - """A list of account IDs for the member accounts to stop monitoring.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STOP_MONITORING_MEMBERS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_STOP_MONITORING_MEMBERS_INPUT.members["DetectorId"], - self.detector_id, - ) - - if self.account_ids is not None: - _serialize_account_ids( - serializer, - _SCHEMA_STOP_MONITORING_MEMBERS_INPUT.members["AccountIds"], - self.account_ids, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_STOP_MONITORING_MEMBERS_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["account_ids"] = _deserialize_account_ids( - de, _SCHEMA_STOP_MONITORING_MEMBERS_INPUT.members["AccountIds"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_STOP_MONITORING_MEMBERS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class StopMonitoringMembersOutput: - """Dataclass for StopMonitoringMembersOutput structure.""" - - unprocessed_accounts: list[UnprocessedAccount] | None = None - """ - A list of objects that contain an accountId for each account that could - not be processed, and a result string that indicates why the account was - not processed. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STOP_MONITORING_MEMBERS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.unprocessed_accounts is not None: - _serialize_unprocessed_accounts( - serializer, - _SCHEMA_STOP_MONITORING_MEMBERS_OUTPUT.members["UnprocessedAccounts"], - self.unprocessed_accounts, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["unprocessed_accounts"] = _deserialize_unprocessed_accounts( - de, - _SCHEMA_STOP_MONITORING_MEMBERS_OUTPUT.members[ - "UnprocessedAccounts" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_STOP_MONITORING_MEMBERS_OUTPUT, consumer=_consumer - ) - return kwargs - - -STOP_MONITORING_MEMBERS = APIOperation( - input=StopMonitoringMembersInput, - output=StopMonitoringMembersOutput, - schema=_SCHEMA_STOP_MONITORING_MEMBERS, - input_schema=_SCHEMA_STOP_MONITORING_MEMBERS_INPUT, - output_schema=_SCHEMA_STOP_MONITORING_MEMBERS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class TagResourceInput: - """Dataclass for TagResourceInput structure.""" - - resource_arn: str | None = None - """ - The Amazon Resource Name (ARN) for the GuardDuty resource to apply a tag - to. - """ - - tags: dict[str, str] | None = None - """The tags to be added to a resource.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TAG_RESOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_TAG_RESOURCE_INPUT.members["ResourceArn"], self.resource_arn - ) - - if self.tags is not None: - _serialize_tag_map( - serializer, _SCHEMA_TAG_RESOURCE_INPUT.members["Tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_TAG_RESOURCE_INPUT.members["ResourceArn"] - ) - - case 1: - kwargs["tags"] = _deserialize_tag_map( - de, _SCHEMA_TAG_RESOURCE_INPUT.members["Tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TAG_RESOURCE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class TagResourceOutput: - """Dataclass for TagResourceOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TAG_RESOURCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TAG_RESOURCE_OUTPUT, consumer=_consumer) - return kwargs - - -TAG_RESOURCE = APIOperation( - input=TagResourceInput, - output=TagResourceOutput, - schema=_SCHEMA_TAG_RESOURCE, - input_schema=_SCHEMA_TAG_RESOURCE_INPUT, - output_schema=_SCHEMA_TAG_RESOURCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.guardduty#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UnarchiveFindingsInput: - """Dataclass for UnarchiveFindingsInput structure.""" - - detector_id: str | None = None - """ - The ID of the detector associated with the findings to unarchive. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - finding_ids: list[str] | None = None - """The IDs of the findings to unarchive.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNARCHIVE_FINDINGS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_UNARCHIVE_FINDINGS_INPUT.members["DetectorId"], self.detector_id - ) - - if self.finding_ids is not None: - _serialize_finding_ids( - serializer, - _SCHEMA_UNARCHIVE_FINDINGS_INPUT.members["FindingIds"], - self.finding_ids, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_UNARCHIVE_FINDINGS_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["finding_ids"] = _deserialize_finding_ids( - de, _SCHEMA_UNARCHIVE_FINDINGS_INPUT.members["FindingIds"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UNARCHIVE_FINDINGS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UnarchiveFindingsOutput: - """Dataclass for UnarchiveFindingsOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNARCHIVE_FINDINGS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UNARCHIVE_FINDINGS_OUTPUT, consumer=_consumer) - return kwargs - - -UNARCHIVE_FINDINGS = APIOperation( - input=UnarchiveFindingsInput, - output=UnarchiveFindingsOutput, - schema=_SCHEMA_UNARCHIVE_FINDINGS, - input_schema=_SCHEMA_UNARCHIVE_FINDINGS_INPUT, - output_schema=_SCHEMA_UNARCHIVE_FINDINGS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -def _serialize_tag_key_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_tag_key_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class UntagResourceInput: - """Dataclass for UntagResourceInput structure.""" - - resource_arn: str | None = None - """The Amazon Resource Name (ARN) for the resource to remove tags from.""" - - tag_keys: list[str] | None = None - """The tag keys to remove from the resource.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNTAG_RESOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_UNTAG_RESOURCE_INPUT.members["ResourceArn"], self.resource_arn - ) - - if self.tag_keys is not None: - _serialize_tag_key_list( - serializer, - _SCHEMA_UNTAG_RESOURCE_INPUT.members["TagKeys"], - self.tag_keys, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_UNTAG_RESOURCE_INPUT.members["ResourceArn"] - ) - - case 1: - kwargs["tag_keys"] = _deserialize_tag_key_list( - de, _SCHEMA_UNTAG_RESOURCE_INPUT.members["TagKeys"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UNTAG_RESOURCE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UntagResourceOutput: - """Dataclass for UntagResourceOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNTAG_RESOURCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UNTAG_RESOURCE_OUTPUT, consumer=_consumer) - return kwargs - - -UNTAG_RESOURCE = APIOperation( - input=UntagResourceInput, - output=UntagResourceOutput, - schema=_SCHEMA_UNTAG_RESOURCE, - input_schema=_SCHEMA_UNTAG_RESOURCE_INPUT, - output_schema=_SCHEMA_UNTAG_RESOURCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.guardduty#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateCustomDetectionRuleAssociationInput: - """Dataclass for UpdateCustomDetectionRuleAssociationInput structure.""" - - rule_id: str | None = None - """The unique identifier for the custom detection rule.""" - - association_id: str | None = None - """The unique identifier for the association to update.""" - - mode: str | None = None - """The rule execution mode. Valid values: `LIVE` | `DRY_RUN`.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_UPDATE_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rule_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT.members[ - "RuleId" - ], - self.rule_id, - ) - - if self.association_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT.members[ - "AssociationId" - ], - self.association_id, - ) - - if self.mode is not None: - serializer.write_string( - _SCHEMA_UPDATE_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT.members["Mode"], - self.mode, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rule_id"] = de.read_string( - _SCHEMA_UPDATE_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT.members[ - "RuleId" - ] - ) - - case 1: - kwargs["association_id"] = de.read_string( - _SCHEMA_UPDATE_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT.members[ - "AssociationId" - ] - ) - - case 2: - kwargs["mode"] = AssociationMode( - de.read_string( - _SCHEMA_UPDATE_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT.members[ - "Mode" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateCustomDetectionRuleAssociationOutput: - """Dataclass for UpdateCustomDetectionRuleAssociationOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_UPDATE_CUSTOM_DETECTION_RULE_ASSOCIATION_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_CUSTOM_DETECTION_RULE_ASSOCIATION_OUTPUT, consumer=_consumer - ) - return kwargs - - -UPDATE_CUSTOM_DETECTION_RULE_ASSOCIATION = APIOperation( - input=UpdateCustomDetectionRuleAssociationInput, - output=UpdateCustomDetectionRuleAssociationOutput, - schema=_SCHEMA_UPDATE_CUSTOM_DETECTION_RULE_ASSOCIATION, - input_schema=_SCHEMA_UPDATE_CUSTOM_DETECTION_RULE_ASSOCIATION_INPUT, - output_schema=_SCHEMA_UPDATE_CUSTOM_DETECTION_RULE_ASSOCIATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.guardduty#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID("com.amazonaws.guardduty#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - ShapeID( - "com.amazonaws.guardduty#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateCustomDetectionRuleOrgConfigurationInput: - """Dataclass for UpdateCustomDetectionRuleOrgConfigurationInput structure.""" - - rule_id: str | None = None - """The unique identifier for the custom detection rule.""" - - mode: str | None = None - """ - The execution mode of the organization configuration. Valid values: - `LIVE` | `DRY_RUN`. - """ - - include_account_ids: list[str] | None = None - """ - The account IDs to include in the organization configuration. Mutually - exclusive with `ExcludeAccountIds`. - """ - - exclude_account_ids: list[str] | None = None - """ - The account IDs to exclude from the organization configuration. Mutually - exclusive with `IncludeAccountIds`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_UPDATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.rule_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT.members[ - "RuleId" - ], - self.rule_id, - ) - - if self.mode is not None: - serializer.write_string( - _SCHEMA_UPDATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT.members[ - "Mode" - ], - self.mode, - ) - - if self.include_account_ids is not None: - _serialize_detection_rule_account_ids( - serializer, - _SCHEMA_UPDATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT.members[ - "IncludeAccountIds" - ], - self.include_account_ids, - ) - - if self.exclude_account_ids is not None: - _serialize_detection_rule_account_ids( - serializer, - _SCHEMA_UPDATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT.members[ - "ExcludeAccountIds" - ], - self.exclude_account_ids, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["rule_id"] = de.read_string( - _SCHEMA_UPDATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT.members[ - "RuleId" - ] - ) - - case 1: - kwargs["mode"] = AssociationMode( - de.read_string( - _SCHEMA_UPDATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT.members[ - "Mode" - ] - ) - ) - - case 2: - kwargs["include_account_ids"] = ( - _deserialize_detection_rule_account_ids( - de, - _SCHEMA_UPDATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT.members[ - "IncludeAccountIds" - ], - ) - ) - - case 3: - kwargs["exclude_account_ids"] = ( - _deserialize_detection_rule_account_ids( - de, - _SCHEMA_UPDATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT.members[ - "ExcludeAccountIds" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT, - consumer=_consumer, - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateCustomDetectionRuleOrgConfigurationOutput: - """Dataclass for UpdateCustomDetectionRuleOrgConfigurationOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_UPDATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_OUTPUT, - consumer=_consumer, - ) - return kwargs - - -UPDATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION = APIOperation( - input=UpdateCustomDetectionRuleOrgConfigurationInput, - output=UpdateCustomDetectionRuleOrgConfigurationOutput, - schema=_SCHEMA_UPDATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION, - input_schema=_SCHEMA_UPDATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_INPUT, - output_schema=_SCHEMA_UPDATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.guardduty#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID("com.amazonaws.guardduty#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - ShapeID( - "com.amazonaws.guardduty#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateDetectorInput: - """Dataclass for UpdateDetectorInput structure.""" - - detector_id: str | None = None - """ - The unique ID of the detector to update. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - enable: bool | None = None - """Specifies whether the detector is enabled or not enabled.""" - - finding_publishing_frequency: str | None = None - """ - An enum value that specifies how frequently findings are exported, such - as to CloudWatch Events. - """ - - data_sources: DataSourceConfigurations | None = None - """ - Describes which data sources will be updated. - - There might be regional differences because some data sources might not - be available in all the Amazon Web Services Regions where GuardDuty is - presently supported. For more information, see [Regions and - endpoints](https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_regions.html). - """ - - features: list[DetectorFeatureConfiguration] | None = None - """Provides the features that will be updated for the detector.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_DETECTOR_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_DETECTOR_INPUT.members["DetectorId"], self.detector_id - ) - - if self.enable is not None: - serializer.write_boolean( - _SCHEMA_UPDATE_DETECTOR_INPUT.members["Enable"], self.enable - ) - - if self.finding_publishing_frequency is not None: - serializer.write_string( - _SCHEMA_UPDATE_DETECTOR_INPUT.members["FindingPublishingFrequency"], - self.finding_publishing_frequency, - ) - - if self.data_sources is not None: - serializer.write_struct( - _SCHEMA_UPDATE_DETECTOR_INPUT.members["DataSources"], self.data_sources - ) - - if self.features is not None: - _serialize_detector_feature_configurations( - serializer, - _SCHEMA_UPDATE_DETECTOR_INPUT.members["Features"], - self.features, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_UPDATE_DETECTOR_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["enable"] = de.read_boolean( - _SCHEMA_UPDATE_DETECTOR_INPUT.members["Enable"] - ) - - case 2: - kwargs["finding_publishing_frequency"] = FindingPublishingFrequency( - de.read_string( - _SCHEMA_UPDATE_DETECTOR_INPUT.members[ - "FindingPublishingFrequency" - ] - ) - ) - - case 3: - kwargs["data_sources"] = DataSourceConfigurations.deserialize(de) - - case 4: - kwargs["features"] = _deserialize_detector_feature_configurations( - de, _SCHEMA_UPDATE_DETECTOR_INPUT.members["Features"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_DETECTOR_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateDetectorOutput: - """Dataclass for UpdateDetectorOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_DETECTOR_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_DETECTOR_OUTPUT, consumer=_consumer) - return kwargs - - -UPDATE_DETECTOR = APIOperation( - input=UpdateDetectorInput, - output=UpdateDetectorOutput, - schema=_SCHEMA_UPDATE_DETECTOR, - input_schema=_SCHEMA_UPDATE_DETECTOR_INPUT, - output_schema=_SCHEMA_UPDATE_DETECTOR_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateFilterInput: - """Dataclass for UpdateFilterInput structure.""" - - detector_id: str | None = None - """ - The unique ID of the detector that specifies the GuardDuty service where - you want to update a filter. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - filter_name: str | None = None - """The name of the filter.""" - - description: str | None = None - """ - The description of the filter. Valid characters include alphanumeric - characters, and special characters such as hyphen, period, colon, - underscore, parentheses (`{ }`, `[ ]`, and `( )`), forward slash, - horizontal tab, vertical tab, newline, form feed, return, and - whitespace. - """ - - action: str | None = None - """ - Specifies the action that is to be applied to the findings that match - the filter. - - Default: NOOP - """ - - rank: int | None = None - """ - Specifies the position of the filter in the list of current filters. - Also specifies the order in which this filter is applied to the - findings. - """ - - finding_criteria: FindingCriteria | None = None - """ - Represents the criteria to be used in the filter for querying findings. - The following fields are available for filtering: - - - accountId - - - arn - - - associatedAttackSequenceArn - - - confidence - - - createdAt - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - id - - - partition - - - region - - - resource.accessKeyDetails.accessKeyId - - - resource.accessKeyDetails.principalId - - - resource.accessKeyDetails.userIdentity.accessKeyId - - - resource.accessKeyDetails.userIdentity.accountId - - - resource.accessKeyDetails.userIdentity.arn - - - resource.accessKeyDetails.userIdentity.principalId - - - resource.accessKeyDetails.userIdentity.sessionContext.attributes.mfaAuthenticated - - - resource.accessKeyDetails.userIdentity.sessionContext.ec2RoleDelivery - - - resource.accessKeyDetails.userIdentity.sessionContext.invokedBy - - - resource.accessKeyDetails.userIdentity.sessionContext.sessionIssuer.accountId - - - resource.accessKeyDetails.userIdentity.sessionContext.sessionIssuer.arn - - - resource.accessKeyDetails.userIdentity.sessionContext.sessionIssuer.principalId - - - resource.accessKeyDetails.userIdentity.sessionContext.sessionIssuer.type - - - resource.accessKeyDetails.userIdentity.sessionContext.sessionIssuer.userName - - - resource.accessKeyDetails.userIdentity.sessionContext.sourceIdentity - - - resource.accessKeyDetails.userIdentity.sessionContext.webIdFederationData.attributes - - - resource.accessKeyDetails.userIdentity.sessionContext.webIdFederationData.federatedProvider - - - resource.accessKeyDetails.userIdentity.type - - - resource.accessKeyDetails.userIdentity.userName - - - resource.accessKeyDetails.userName - - - resource.accessKeyDetails.userType - - - resource.bedrockGuardrailDetails.guardrailArn - - - resource.bedrockGuardrailDetails.guardrailVersion - - - resource.containerDetails.containerRuntime - - - resource.containerDetails.id - - - resource.containerDetails.image - - - resource.containerDetails.imagePrefix - - - resource.containerDetails.name - - - resource.containerDetails.securityContext.allowPrivilegeEscalation - - - resource.containerDetails.securityContext.privileged - - - resource.containerDetails.volumeMounts.mountPath - - - resource.containerDetails.volumeMounts.name - - - resource.ebsSnapshotDetails.snapshotArn - - - resource.ebsVolumeDetails.scannedVolumeDetails.deviceName - - - resource.ebsVolumeDetails.scannedVolumeDetails.encryptionType - - - resource.ebsVolumeDetails.scannedVolumeDetails.kmsKeyArn - - - resource.ebsVolumeDetails.scannedVolumeDetails.snapshotArn - - - resource.ebsVolumeDetails.scannedVolumeDetails.volumeArn - - - resource.ebsVolumeDetails.scannedVolumeDetails.volumeSizeInGB - - - resource.ebsVolumeDetails.scannedVolumeDetails.volumeType - - - resource.ebsVolumeDetails.skippedVolumeDetails.deviceName - - - resource.ebsVolumeDetails.skippedVolumeDetails.encryptionType - - - resource.ebsVolumeDetails.skippedVolumeDetails.kmsKeyArn - - - resource.ebsVolumeDetails.skippedVolumeDetails.snapshotArn - - - resource.ebsVolumeDetails.skippedVolumeDetails.volumeArn - - - resource.ebsVolumeDetails.skippedVolumeDetails.volumeSizeInGB - - - resource.ebsVolumeDetails.skippedVolumeDetails.volumeType - - - resource.ec2ImageDetails.imageArn - - - resource.ecsClusterDetails.activeServicesCount - - - resource.ecsClusterDetails.arn - - - resource.ecsClusterDetails.name - - - resource.ecsClusterDetails.registeredContainerInstancesCount - - - resource.ecsClusterDetails.runningTasksCount - - - resource.ecsClusterDetails.status - - - resource.ecsClusterDetails.tags.key - - - resource.ecsClusterDetails.tags.value - - - resource.ecsClusterDetails.taskDetails.arn - - - resource.ecsClusterDetails.taskDetails.containers.containerRuntime - - - resource.ecsClusterDetails.taskDetails.containers.id - - - resource.ecsClusterDetails.taskDetails.containers.image - - - resource.ecsClusterDetails.taskDetails.containers.imagePrefix - - - resource.ecsClusterDetails.taskDetails.containers.name - - - resource.ecsClusterDetails.taskDetails.containers.securityContext.allowPrivilegeEscalation - - - resource.ecsClusterDetails.taskDetails.containers.securityContext.privileged - - - resource.ecsClusterDetails.taskDetails.containers.volumeMounts.mountPath - - - resource.ecsClusterDetails.taskDetails.containers.volumeMounts.name - - - resource.ecsClusterDetails.taskDetails.createdAt - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - resource.ecsClusterDetails.taskDetails.definitionArn - - - resource.ecsClusterDetails.taskDetails.group - - - resource.ecsClusterDetails.taskDetails.launchType - - - resource.ecsClusterDetails.taskDetails.startedAt - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - resource.ecsClusterDetails.taskDetails.startedBy - - - resource.ecsClusterDetails.taskDetails.tags.key - - - resource.ecsClusterDetails.taskDetails.tags.value - - - resource.ecsClusterDetails.taskDetails.version - - - resource.ecsClusterDetails.taskDetails.volumes.hostPath.path - - - resource.ecsClusterDetails.taskDetails.volumes.name - - - resource.eksClusterDetails.arn - - - resource.eksClusterDetails.createdAt - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - resource.eksClusterDetails.name - - - resource.eksClusterDetails.status - - - resource.eksClusterDetails.tags.key - - - resource.eksClusterDetails.tags.value - - - resource.eksClusterDetails.vpcId - - - resource.instanceDetails.availabilityZone - - - resource.instanceDetails.iamInstanceProfile.arn - - - resource.instanceDetails.iamInstanceProfile.id - - - resource.instanceDetails.imageDescription - - - resource.instanceDetails.imageId - - - resource.instanceDetails.instanceId - - - resource.instanceDetails.instanceState - - - resource.instanceDetails.instanceType - - - resource.instanceDetails.launchTime - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - resource.instanceDetails.networkInterfaces.ipv6Addresses - - - resource.instanceDetails.networkInterfaces.networkInterfaceId - - - resource.instanceDetails.networkInterfaces.privateDnsName - - - resource.instanceDetails.networkInterfaces.privateIpAddress - - - resource.instanceDetails.networkInterfaces.privateIpAddresses.privateDnsName - - - resource.instanceDetails.networkInterfaces.privateIpAddresses.privateIpAddress - - - resource.instanceDetails.networkInterfaces.publicDnsName - - - resource.instanceDetails.networkInterfaces.publicIp - - - resource.instanceDetails.networkInterfaces.securityGroups.groupId - - - resource.instanceDetails.networkInterfaces.securityGroups.groupName - - - resource.instanceDetails.networkInterfaces.subnetId - - - resource.instanceDetails.networkInterfaces.vpcId - - - resource.instanceDetails.outpostArn - - - resource.instanceDetails.platform - - - resource.instanceDetails.productCodes.productCodeId - - - resource.instanceDetails.productCodes.productCodeType - - - resource.instanceDetails.tags.key - - - resource.instanceDetails.tags.value - - - resource.kubernetesDetails.kubernetesUserDetails.groups - - - resource.kubernetesDetails.kubernetesUserDetails.impersonatedUser.groups - - - resource.kubernetesDetails.kubernetesUserDetails.impersonatedUser.username - - - resource.kubernetesDetails.kubernetesUserDetails.sessionName - - - resource.kubernetesDetails.kubernetesUserDetails.uid - - - resource.kubernetesDetails.kubernetesUserDetails.username - - - resource.kubernetesDetails.kubernetesWorkloadDetails.containers.containerRuntime - - - resource.kubernetesDetails.kubernetesWorkloadDetails.containers.id - - - resource.kubernetesDetails.kubernetesWorkloadDetails.containers.image - - - resource.kubernetesDetails.kubernetesWorkloadDetails.containers.imagePrefix - - - resource.kubernetesDetails.kubernetesWorkloadDetails.containers.name - - - resource.kubernetesDetails.kubernetesWorkloadDetails.containers.securityContext.allowPrivilegeEscalation - - - resource.kubernetesDetails.kubernetesWorkloadDetails.containers.securityContext.privileged - - - resource.kubernetesDetails.kubernetesWorkloadDetails.containers.volumeMounts.mountPath - - - resource.kubernetesDetails.kubernetesWorkloadDetails.containers.volumeMounts.name - - - resource.kubernetesDetails.kubernetesWorkloadDetails.hostIpc - - - resource.kubernetesDetails.kubernetesWorkloadDetails.hostNetwork - - - resource.kubernetesDetails.kubernetesWorkloadDetails.hostPid - - - resource.kubernetesDetails.kubernetesWorkloadDetails.name - - - resource.kubernetesDetails.kubernetesWorkloadDetails.namespace - - - resource.kubernetesDetails.kubernetesWorkloadDetails.serviceAccountName - - - resource.kubernetesDetails.kubernetesWorkloadDetails.type - - - resource.kubernetesDetails.kubernetesWorkloadDetails.uid - - - resource.kubernetesDetails.kubernetesWorkloadDetails.volumes.hostPath.path - - - resource.kubernetesDetails.kubernetesWorkloadDetails.volumes.name - - - resource.lambdaDetails.description - - - resource.lambdaDetails.functionArn - - - resource.lambdaDetails.functionName - - - resource.lambdaDetails.functionVersion - - - resource.lambdaDetails.lastModifiedAt - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - resource.lambdaDetails.revisionId - - - resource.lambdaDetails.role - - - resource.lambdaDetails.tags.key - - - resource.lambdaDetails.tags.value - - - resource.lambdaDetails.vpcConfig.securityGroups.groupId - - - resource.lambdaDetails.vpcConfig.securityGroups.groupName - - - resource.lambdaDetails.vpcConfig.subnetIds - - - resource.lambdaDetails.vpcConfig.vpcId - - - resource.rdsDbInstanceDetails.dbClusterIdentifier - - - resource.rdsDbInstanceDetails.dbInstanceArn - - - resource.rdsDbInstanceDetails.dbInstanceIdentifier - - - resource.rdsDbInstanceDetails.dbSecurityGroups.name - - - resource.rdsDbInstanceDetails.dbSecurityGroups.status - - - resource.rdsDbInstanceDetails.dbiResourceId - - - resource.rdsDbInstanceDetails.engine - - - resource.rdsDbInstanceDetails.engineVersion - - - resource.rdsDbInstanceDetails.iamDatabaseAuthenticationEnabled - - - resource.rdsDbInstanceDetails.publiclyAccessible - - - resource.rdsDbInstanceDetails.vpcId - - - resource.rdsDbInstanceDetails.vpcSecurityGroups.status - - - resource.rdsDbInstanceDetails.vpcSecurityGroups.vpcSecurityGroupId - - - resource.rdsDbUserDetails.application - - - resource.rdsDbUserDetails.authMethod - - - resource.rdsDbUserDetails.database - - - resource.rdsDbUserDetails.ssl - - - resource.rdsDbUserDetails.user - - - resource.rdsLimitlessDbDetails.dbClusterIdentifier - - - resource.rdsLimitlessDbDetails.dbShardGroupArn - - - resource.rdsLimitlessDbDetails.dbShardGroupIdentifier - - - resource.rdsLimitlessDbDetails.dbShardGroupResourceId - - - resource.rdsLimitlessDbDetails.engine - - - resource.rdsLimitlessDbDetails.engineVersion - - - resource.rdsLimitlessDbDetails.tags.key - - - resource.rdsLimitlessDbDetails.tags.value - - - resource.recoveryPointDetails.backupVaultName - - - resource.recoveryPointDetails.recoveryPointArn - - - resource.resourceType - - - resource.s3BucketDetails.arn - - - resource.s3BucketDetails.createdAt - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - resource.s3BucketDetails.defaultServerSideEncryption.encryptionType - - - resource.s3BucketDetails.defaultServerSideEncryption.kmsMasterKeyArn - - - resource.s3BucketDetails.name - - - resource.s3BucketDetails.owner.id - - - resource.s3BucketDetails.publicAccess.effectivePermission - - - resource.s3BucketDetails.publicAccess.permissionConfiguration.accountLevelPermissions.blockPublicAccess.blockPublicAcls - - - resource.s3BucketDetails.publicAccess.permissionConfiguration.accountLevelPermissions.blockPublicAccess.blockPublicPolicy - - - resource.s3BucketDetails.publicAccess.permissionConfiguration.accountLevelPermissions.blockPublicAccess.ignorePublicAcls - - - resource.s3BucketDetails.publicAccess.permissionConfiguration.accountLevelPermissions.blockPublicAccess.restrictPublicBuckets - - - resource.s3BucketDetails.publicAccess.permissionConfiguration.bucketLevelPermissions.accessControlList.allowsPublicReadAccess - - - resource.s3BucketDetails.publicAccess.permissionConfiguration.bucketLevelPermissions.accessControlList.allowsPublicWriteAccess - - - resource.s3BucketDetails.publicAccess.permissionConfiguration.bucketLevelPermissions.blockPublicAccess.blockPublicAcls - - - resource.s3BucketDetails.publicAccess.permissionConfiguration.bucketLevelPermissions.blockPublicAccess.blockPublicPolicy - - - resource.s3BucketDetails.publicAccess.permissionConfiguration.bucketLevelPermissions.blockPublicAccess.ignorePublicAcls - - - resource.s3BucketDetails.publicAccess.permissionConfiguration.bucketLevelPermissions.blockPublicAccess.restrictPublicBuckets - - - resource.s3BucketDetails.publicAccess.permissionConfiguration.bucketLevelPermissions.bucketPolicy.allowsPublicReadAccess - - - resource.s3BucketDetails.publicAccess.permissionConfiguration.bucketLevelPermissions.bucketPolicy.allowsPublicWriteAccess - - - resource.s3BucketDetails.s3ObjectDetails.eTag - - - resource.s3BucketDetails.s3ObjectDetails.hash - - - resource.s3BucketDetails.s3ObjectDetails.key - - - resource.s3BucketDetails.s3ObjectDetails.objectArn - - - resource.s3BucketDetails.s3ObjectDetails.versionId - - - resource.s3BucketDetails.tags.key - - - resource.s3BucketDetails.tags.value - - - resource.s3BucketDetails.type - - - schemaVersion - - - service.action.actionType - - - service.action.awsApiCallAction.api - - - service.action.awsApiCallAction.callerType - - - service.action.awsApiCallAction.domainDetails.domain - - - service.action.awsApiCallAction.errorCode - - - service.action.awsApiCallAction.remoteAccountDetails.accountId - - - service.action.awsApiCallAction.remoteAccountDetails.affiliated - - - service.action.awsApiCallAction.remoteAccountDetails.awsServiceName - - - service.action.awsApiCallAction.remoteIpDetails.city.cityName - - - service.action.awsApiCallAction.remoteIpDetails.country.countryCode - - - service.action.awsApiCallAction.remoteIpDetails.country.countryName - - - service.action.awsApiCallAction.remoteIpDetails.geoLocation.lat - - - service.action.awsApiCallAction.remoteIpDetails.geoLocation.lon - - - service.action.awsApiCallAction.remoteIpDetails.ipAddressV4 - - - service.action.awsApiCallAction.remoteIpDetails.ipAddressV6 - - - service.action.awsApiCallAction.remoteIpDetails.organization.asn - - - service.action.awsApiCallAction.remoteIpDetails.organization.asnOrg - - - service.action.awsApiCallAction.remoteIpDetails.organization.isp - - - service.action.awsApiCallAction.remoteIpDetails.organization.org - - - service.action.awsApiCallAction.serviceName - - - service.action.awsApiCallAction.userAgent - - - service.action.dnsRequestAction.blocked - - - service.action.dnsRequestAction.domain - - - service.action.dnsRequestAction.domainWithSuffix - - - service.action.dnsRequestAction.protocol - - - service.action.dnsRequestAction.vpcOwnerAccountId - - - service.action.kubernetesApiCallAction.namespace - - - service.action.kubernetesApiCallAction.parameters - - - service.action.kubernetesApiCallAction.remoteIpDetails.city.cityName - - - service.action.kubernetesApiCallAction.remoteIpDetails.country.countryCode - - - service.action.kubernetesApiCallAction.remoteIpDetails.country.countryName - - - service.action.kubernetesApiCallAction.remoteIpDetails.geoLocation.lat - - - service.action.kubernetesApiCallAction.remoteIpDetails.geoLocation.lon - - - service.action.kubernetesApiCallAction.remoteIpDetails.ipAddressV4 - - - service.action.kubernetesApiCallAction.remoteIpDetails.ipAddressV6 - - - service.action.kubernetesApiCallAction.remoteIpDetails.organization.asn - - - service.action.kubernetesApiCallAction.remoteIpDetails.organization.asnOrg - - - service.action.kubernetesApiCallAction.remoteIpDetails.organization.isp - - - service.action.kubernetesApiCallAction.remoteIpDetails.organization.org - - - service.action.kubernetesApiCallAction.requestUri - - - service.action.kubernetesApiCallAction.resource - - - service.action.kubernetesApiCallAction.resourceName - - - service.action.kubernetesApiCallAction.sourceIPs - - - service.action.kubernetesApiCallAction.statusCode - - - service.action.kubernetesApiCallAction.subresource - - - service.action.kubernetesApiCallAction.userAgent - - - service.action.kubernetesApiCallAction.verb - - - service.action.kubernetesPermissionCheckedDetails.allowed - - - service.action.kubernetesPermissionCheckedDetails.namespace - - - service.action.kubernetesPermissionCheckedDetails.resource - - - service.action.kubernetesPermissionCheckedDetails.verb - - - service.action.kubernetesRoleBindingDetails.kind - - - service.action.kubernetesRoleBindingDetails.name - - - service.action.kubernetesRoleBindingDetails.roleRefKind - - - service.action.kubernetesRoleBindingDetails.roleRefName - - - service.action.kubernetesRoleBindingDetails.uid - - - service.action.kubernetesRoleDetails.kind - - - service.action.kubernetesRoleDetails.name - - - service.action.kubernetesRoleDetails.uid - - - service.action.networkConnectionAction.blocked - - - service.action.networkConnectionAction.connectionDirection - - - service.action.networkConnectionAction.localIpDetails.ipAddressV4 - - - service.action.networkConnectionAction.localIpDetails.ipAddressV6 - - - service.action.networkConnectionAction.localNetworkInterface - - - service.action.networkConnectionAction.localPortDetails.port - - - service.action.networkConnectionAction.localPortDetails.portName - - - service.action.networkConnectionAction.protocol - - - service.action.networkConnectionAction.remoteIpDetails.city.cityName - - - service.action.networkConnectionAction.remoteIpDetails.country.countryCode - - - service.action.networkConnectionAction.remoteIpDetails.country.countryName - - - service.action.networkConnectionAction.remoteIpDetails.geoLocation.lat - - - service.action.networkConnectionAction.remoteIpDetails.geoLocation.lon - - - service.action.networkConnectionAction.remoteIpDetails.ipAddressV4 - - - service.action.networkConnectionAction.remoteIpDetails.ipAddressV6 - - - service.action.networkConnectionAction.remoteIpDetails.organization.asn - - - service.action.networkConnectionAction.remoteIpDetails.organization.asnOrg - - - service.action.networkConnectionAction.remoteIpDetails.organization.isp - - - service.action.networkConnectionAction.remoteIpDetails.organization.org - - - service.action.networkConnectionAction.remotePortDetails.port - - - service.action.networkConnectionAction.remotePortDetails.portName - - - service.action.portProbeAction.blocked - - - service.action.portProbeAction.portProbeDetails.localIpDetails.ipAddressV4 - - - service.action.portProbeAction.portProbeDetails.localIpDetails.ipAddressV6 - - - service.action.portProbeAction.portProbeDetails.localPortDetails.port - - - service.action.portProbeAction.portProbeDetails.localPortDetails.portName - - - service.action.portProbeAction.portProbeDetails.remoteIpDetails.city.cityName - - - service.action.portProbeAction.portProbeDetails.remoteIpDetails.country.countryCode - - - service.action.portProbeAction.portProbeDetails.remoteIpDetails.country.countryName - - - service.action.portProbeAction.portProbeDetails.remoteIpDetails.geoLocation.lat - - - service.action.portProbeAction.portProbeDetails.remoteIpDetails.geoLocation.lon - - - service.action.portProbeAction.portProbeDetails.remoteIpDetails.ipAddressV4 - - - service.action.portProbeAction.portProbeDetails.remoteIpDetails.ipAddressV6 - - - service.action.portProbeAction.portProbeDetails.remoteIpDetails.organization.asn - - - service.action.portProbeAction.portProbeDetails.remoteIpDetails.organization.asnOrg - - - service.action.portProbeAction.portProbeDetails.remoteIpDetails.organization.isp - - - service.action.portProbeAction.portProbeDetails.remoteIpDetails.organization.org - - - service.action.rdsLoginAttemptAction.loginAttributes.application - - - service.action.rdsLoginAttemptAction.loginAttributes.failedLoginAttempts - - - service.action.rdsLoginAttemptAction.loginAttributes.successfulLoginAttempts - - - service.action.rdsLoginAttemptAction.loginAttributes.user - - - service.action.rdsLoginAttemptAction.remoteIpDetails.city.cityName - - - service.action.rdsLoginAttemptAction.remoteIpDetails.country.countryCode - - - service.action.rdsLoginAttemptAction.remoteIpDetails.country.countryName - - - service.action.rdsLoginAttemptAction.remoteIpDetails.geoLocation.lat - - - service.action.rdsLoginAttemptAction.remoteIpDetails.geoLocation.lon - - - service.action.rdsLoginAttemptAction.remoteIpDetails.ipAddressV4 - - - service.action.rdsLoginAttemptAction.remoteIpDetails.ipAddressV6 - - - service.action.rdsLoginAttemptAction.remoteIpDetails.organization.asn - - - service.action.rdsLoginAttemptAction.remoteIpDetails.organization.asnOrg - - - service.action.rdsLoginAttemptAction.remoteIpDetails.organization.isp - - - service.action.rdsLoginAttemptAction.remoteIpDetails.organization.org - - - service.additionalInfo.agentDetails.agentId - - - service.additionalInfo.agentDetails.agentVersion - - - service.additionalInfo.anomalies.anomalousAPIs - - - service.additionalInfo.authenticationMethod - - - service.additionalInfo.averagePacketSizeIn - - - service.additionalInfo.averagePacketSizeOut - - - service.additionalInfo.context - - - service.additionalInfo.domain - - - service.additionalInfo.inBytes - - - service.additionalInfo.localNetworkInterfaceOwner - - - service.additionalInfo.localPort - - - service.additionalInfo.outBytes - - - service.additionalInfo.packetsIn - - - service.additionalInfo.packetsOut - - - service.additionalInfo.policyArn - - - service.additionalInfo.policyName - - - service.additionalInfo.remotePort - - - service.additionalInfo.sample - - - service.additionalInfo.scannedPort - - - service.additionalInfo.threatFileSha256 - - - service.additionalInfo.threatListName - - - service.additionalInfo.threatName - - - service.additionalInfo.totalBytesIn - - - service.additionalInfo.totalBytesOut - - - service.additionalInfo.type - - - service.additionalInfo.unusual.asnOrg - - - service.additionalInfo.unusual.port - - - service.additionalInfo.unusualProtocol - - - service.additionalInfo.userAgent.fullUserAgent - - - service.additionalInfo.userAgent.userAgentCategory - - - service.additionalInfo.value - - - service.additionalInfo.vpcOwnerAccountId - - - service.archived - - - service.count - - - service.detection.sequence.actors.id - - - service.detection.sequence.actors.process.name - - - service.detection.sequence.actors.process.path - - - service.detection.sequence.actors.process.sha256 - - - service.detection.sequence.actors.session.createdTime - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - service.detection.sequence.actors.session.issuer - - - service.detection.sequence.actors.session.mfaStatus - - - service.detection.sequence.actors.session.uid - - - service.detection.sequence.actors.user.account.account - - - service.detection.sequence.actors.user.account.uid - - - service.detection.sequence.actors.user.credentialUid - - - service.detection.sequence.actors.user.name - - - service.detection.sequence.actors.user.type - - - service.detection.sequence.actors.user.uid - - - service.detection.sequence.additionalSequenceTypes - - - service.detection.sequence.description - - - service.detection.sequence.endpoints.autonomousSystem.name - - - service.detection.sequence.endpoints.autonomousSystem.number - - - service.detection.sequence.endpoints.connection.direction - - - service.detection.sequence.endpoints.domain - - - service.detection.sequence.endpoints.id - - - service.detection.sequence.endpoints.ip - - - service.detection.sequence.endpoints.location.city - - - service.detection.sequence.endpoints.location.country - - - service.detection.sequence.endpoints.location.lat - - - service.detection.sequence.endpoints.location.lon - - - service.detection.sequence.endpoints.port - - - service.detection.sequence.resources.accountId - - - service.detection.sequence.resources.cloudPartition - - - service.detection.sequence.resources.data.accessKey.principalId - - - service.detection.sequence.resources.data.accessKey.userName - - - service.detection.sequence.resources.data.accessKey.userType - - - service.detection.sequence.resources.data.autoscalingAutoScalingGroup.ec2InstanceUids - - - service.detection.sequence.resources.data.cloudformationStack.ec2InstanceUids - - - service.detection.sequence.resources.data.container.image - - - service.detection.sequence.resources.data.container.imageUid - - - service.detection.sequence.resources.data.ec2Image.ec2InstanceUids - - - service.detection.sequence.resources.data.ec2Instance.availabilityZone - - - service.detection.sequence.resources.data.ec2Instance.ec2NetworkInterfaceUids - - - service.detection.sequence.resources.data.ec2Instance.iamInstanceProfile.arn - - - service.detection.sequence.resources.data.ec2Instance.iamInstanceProfile.id - - - service.detection.sequence.resources.data.ec2Instance.imageDescription - - - service.detection.sequence.resources.data.ec2Instance.instanceState - - - service.detection.sequence.resources.data.ec2Instance.instanceType - - - service.detection.sequence.resources.data.ec2Instance.outpostArn - - - service.detection.sequence.resources.data.ec2Instance.platform - - - service.detection.sequence.resources.data.ec2Instance.productCodes.productCodeId - - - service.detection.sequence.resources.data.ec2Instance.productCodes.productCodeType - - - service.detection.sequence.resources.data.ec2LaunchTemplate.ec2InstanceUids - - - service.detection.sequence.resources.data.ec2LaunchTemplate.version - - - service.detection.sequence.resources.data.ec2NetworkInterface.ipv6Addresses - - - service.detection.sequence.resources.data.ec2NetworkInterface.privateIpAddresses.privateDnsName - - - service.detection.sequence.resources.data.ec2NetworkInterface.privateIpAddresses.privateIpAddress - - - service.detection.sequence.resources.data.ec2NetworkInterface.publicIp - - - service.detection.sequence.resources.data.ec2NetworkInterface.securityGroups.groupId - - - service.detection.sequence.resources.data.ec2NetworkInterface.securityGroups.groupName - - - service.detection.sequence.resources.data.ec2NetworkInterface.subNetId - - - service.detection.sequence.resources.data.ec2NetworkInterface.vpcId - - - service.detection.sequence.resources.data.ec2Vpc.ec2InstanceUids - - - service.detection.sequence.resources.data.ecsCluster.ec2InstanceUids - - - service.detection.sequence.resources.data.ecsCluster.status - - - service.detection.sequence.resources.data.ecsTask.containerUids - - - service.detection.sequence.resources.data.ecsTask.createdAt - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - service.detection.sequence.resources.data.ecsTask.launchType - - - service.detection.sequence.resources.data.ecsTask.taskDefinitionArn - - - service.detection.sequence.resources.data.eksCluster.arn - - - service.detection.sequence.resources.data.eksCluster.createdAt - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - service.detection.sequence.resources.data.eksCluster.ec2InstanceUids - - - service.detection.sequence.resources.data.eksCluster.status - - - service.detection.sequence.resources.data.eksCluster.vpcId - - - service.detection.sequence.resources.data.iamInstanceProfile.ec2InstanceUids - - - service.detection.sequence.resources.data.iamInstanceProfile.id - - - service.detection.sequence.resources.data.kubernetesWorkload.containerUids - - - service.detection.sequence.resources.data.kubernetesWorkload.namespace - - - service.detection.sequence.resources.data.kubernetesWorkload.type - - - service.detection.sequence.resources.data.s3Bucket.accountPublicAccess.publicAclAccess - - - service.detection.sequence.resources.data.s3Bucket.accountPublicAccess.publicAclIgnoreBehavior - - - service.detection.sequence.resources.data.s3Bucket.accountPublicAccess.publicBucketRestrictBehavior - - - service.detection.sequence.resources.data.s3Bucket.accountPublicAccess.publicPolicyAccess - - - service.detection.sequence.resources.data.s3Bucket.bucketPublicAccess.publicAclAccess - - - service.detection.sequence.resources.data.s3Bucket.bucketPublicAccess.publicAclIgnoreBehavior - - - service.detection.sequence.resources.data.s3Bucket.bucketPublicAccess.publicBucketRestrictBehavior - - - service.detection.sequence.resources.data.s3Bucket.bucketPublicAccess.publicPolicyAccess - - - service.detection.sequence.resources.data.s3Bucket.createdAt - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - service.detection.sequence.resources.data.s3Bucket.effectivePermission - - - service.detection.sequence.resources.data.s3Bucket.encryptionKeyArn - - - service.detection.sequence.resources.data.s3Bucket.encryptionType - - - service.detection.sequence.resources.data.s3Bucket.ownerId - - - service.detection.sequence.resources.data.s3Bucket.publicReadAccess - - - service.detection.sequence.resources.data.s3Bucket.publicWriteAccess - - - service.detection.sequence.resources.data.s3Bucket.s3ObjectUids - - - service.detection.sequence.resources.data.s3Object.eTag - - - service.detection.sequence.resources.data.s3Object.key - - - service.detection.sequence.resources.data.s3Object.versionId - - - service.detection.sequence.resources.name - - - service.detection.sequence.resources.region - - - service.detection.sequence.resources.resourceType - - - service.detection.sequence.resources.service - - - service.detection.sequence.resources.tags.key - - - service.detection.sequence.resources.tags.value - - - service.detection.sequence.resources.uid - - - service.detection.sequence.sequenceIndicators.key - - - service.detection.sequence.sequenceIndicators.title - - - service.detection.sequence.sequenceIndicators.values - - - service.detection.sequence.signals.actorIds - - - service.detection.sequence.signals.count - - - service.detection.sequence.signals.createdAt - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - service.detection.sequence.signals.description - - - service.detection.sequence.signals.endpointIds - - - service.detection.sequence.signals.firstSeenAt - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - service.detection.sequence.signals.lastSeenAt - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - service.detection.sequence.signals.name - - - service.detection.sequence.signals.resourceUids - - - service.detection.sequence.signals.severity - - - service.detection.sequence.signals.signalIndicators.key - - - service.detection.sequence.signals.signalIndicators.title - - - service.detection.sequence.signals.signalIndicators.values - - - service.detection.sequence.signals.type - - - service.detection.sequence.signals.uid - - - service.detection.sequence.signals.updatedAt - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - service.detection.sequence.uid - - - service.detectorId - - - service.ebsVolumeScanDetails.scanCompletedAt - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - service.ebsVolumeScanDetails.scanDetections.highestSeverityThreatDetails.count - - - service.ebsVolumeScanDetails.scanDetections.highestSeverityThreatDetails.severity - - - service.ebsVolumeScanDetails.scanDetections.highestSeverityThreatDetails.threatName - - - service.ebsVolumeScanDetails.scanDetections.scannedItemCount.files - - - service.ebsVolumeScanDetails.scanDetections.scannedItemCount.totalGb - - - service.ebsVolumeScanDetails.scanDetections.scannedItemCount.volumes - - - service.ebsVolumeScanDetails.scanDetections.threatDetectedByName.itemCount - - - service.ebsVolumeScanDetails.scanDetections.threatDetectedByName.shortened - - - service.ebsVolumeScanDetails.scanDetections.threatDetectedByName.threatNames.filePaths.fileName - - - service.ebsVolumeScanDetails.scanDetections.threatDetectedByName.threatNames.filePaths.filePath - - - service.ebsVolumeScanDetails.scanDetections.threatDetectedByName.threatNames.filePaths.hash - - - service.ebsVolumeScanDetails.scanDetections.threatDetectedByName.threatNames.filePaths.volumeArn - - - service.ebsVolumeScanDetails.scanDetections.threatDetectedByName.threatNames.itemCount - - - service.ebsVolumeScanDetails.scanDetections.threatDetectedByName.threatNames.name - - - service.ebsVolumeScanDetails.scanDetections.threatDetectedByName.threatNames.severity - - - service.ebsVolumeScanDetails.scanDetections.threatDetectedByName.uniqueThreatNameCount - - - service.ebsVolumeScanDetails.scanDetections.threatsDetectedItemCount.files - - - service.ebsVolumeScanDetails.scanId - - - service.ebsVolumeScanDetails.scanStartedAt - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - service.ebsVolumeScanDetails.scanType - - - service.ebsVolumeScanDetails.sources - - - service.ebsVolumeScanDetails.triggerFindingId - - - service.eventFirstSeen - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - service.eventLastSeen - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - service.evidence.threatIntelligenceDetails.threatFileSha256 - - - service.evidence.threatIntelligenceDetails.threatListName - - - service.evidence.threatIntelligenceDetails.threatNames - - - service.featureName - - - service.malwareScanDetails.scanCategory - - - service.malwareScanDetails.scanConfiguration.incrementalScanDetails.baselineResourceArn - - - service.malwareScanDetails.scanConfiguration.triggerType - - - service.malwareScanDetails.scanId - - - service.malwareScanDetails.scanType - - - service.malwareScanDetails.threats.count - - - service.malwareScanDetails.threats.hash - - - service.malwareScanDetails.threats.itemDetails.additionalInfo.deviceName - - - service.malwareScanDetails.threats.itemDetails.additionalInfo.versionId - - - service.malwareScanDetails.threats.itemDetails.hash - - - service.malwareScanDetails.threats.itemDetails.itemPath - - - service.malwareScanDetails.threats.itemDetails.resourceArn - - - service.malwareScanDetails.threats.itemPaths.hash - - - service.malwareScanDetails.threats.itemPaths.nestedItemPath - - - service.malwareScanDetails.threats.name - - - service.malwareScanDetails.threats.source - - - service.malwareScanDetails.uniqueThreatCount - - - service.resourceRole - - - service.runtimeDetails.context.addressFamily - - - service.runtimeDetails.context.commandLineExample - - - service.runtimeDetails.context.fileOperation - - - service.runtimeDetails.context.filePath - - - service.runtimeDetails.context.fileSystemType - - - service.runtimeDetails.context.flags - - - service.runtimeDetails.context.ianaProtocolNumber - - - service.runtimeDetails.context.ldPreloadValue - - - service.runtimeDetails.context.libraryPath - - - service.runtimeDetails.context.memoryRegions - - - service.runtimeDetails.context.modifiedAt - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - service.runtimeDetails.context.modifyingProcess.euid - - - service.runtimeDetails.context.modifyingProcess.executablePath - - - service.runtimeDetails.context.modifyingProcess.executableSha256 - - - service.runtimeDetails.context.modifyingProcess.lineage.euid - - - service.runtimeDetails.context.modifyingProcess.lineage.executablePath - - - service.runtimeDetails.context.modifyingProcess.lineage.name - - - service.runtimeDetails.context.modifyingProcess.lineage.namespacePid - - - service.runtimeDetails.context.modifyingProcess.lineage.parentUuid - - - service.runtimeDetails.context.modifyingProcess.lineage.pid - - - service.runtimeDetails.context.modifyingProcess.lineage.startTime - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - service.runtimeDetails.context.modifyingProcess.lineage.userId - - - service.runtimeDetails.context.modifyingProcess.lineage.uuid - - - service.runtimeDetails.context.modifyingProcess.name - - - service.runtimeDetails.context.modifyingProcess.namespacePid - - - service.runtimeDetails.context.modifyingProcess.parentUuid - - - service.runtimeDetails.context.modifyingProcess.pid - - - service.runtimeDetails.context.modifyingProcess.pwd - - - service.runtimeDetails.context.modifyingProcess.startTime - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - service.runtimeDetails.context.modifyingProcess.user - - - service.runtimeDetails.context.modifyingProcess.userId - - - service.runtimeDetails.context.modifyingProcess.uuid - - - service.runtimeDetails.context.moduleFilePath - - - service.runtimeDetails.context.moduleName - - - service.runtimeDetails.context.moduleSha256 - - - service.runtimeDetails.context.mountSource - - - service.runtimeDetails.context.mountTarget - - - service.runtimeDetails.context.relatedFilePaths - - - service.runtimeDetails.context.releaseAgentPath - - - service.runtimeDetails.context.runcBinaryPath - - - service.runtimeDetails.context.scriptPath - - - service.runtimeDetails.context.serviceName - - - service.runtimeDetails.context.shellHistoryFilePath - - - service.runtimeDetails.context.socketPath - - - service.runtimeDetails.context.targetProcess.euid - - - service.runtimeDetails.context.targetProcess.executablePath - - - service.runtimeDetails.context.targetProcess.executableSha256 - - - service.runtimeDetails.context.targetProcess.lineage.euid - - - service.runtimeDetails.context.targetProcess.lineage.executablePath - - - service.runtimeDetails.context.targetProcess.lineage.name - - - service.runtimeDetails.context.targetProcess.lineage.namespacePid - - - service.runtimeDetails.context.targetProcess.lineage.parentUuid - - - service.runtimeDetails.context.targetProcess.lineage.pid - - - service.runtimeDetails.context.targetProcess.lineage.startTime - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - service.runtimeDetails.context.targetProcess.lineage.userId - - - service.runtimeDetails.context.targetProcess.lineage.uuid - - - service.runtimeDetails.context.targetProcess.name - - - service.runtimeDetails.context.targetProcess.namespacePid - - - service.runtimeDetails.context.targetProcess.parentUuid - - - service.runtimeDetails.context.targetProcess.pid - - - service.runtimeDetails.context.targetProcess.pwd - - - service.runtimeDetails.context.targetProcess.startTime - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - service.runtimeDetails.context.targetProcess.user - - - service.runtimeDetails.context.targetProcess.userId - - - service.runtimeDetails.context.targetProcess.uuid - - - service.runtimeDetails.context.threatFilePath - - - service.runtimeDetails.context.toolCategory - - - service.runtimeDetails.context.toolName - - - service.runtimeDetails.process.euid - - - service.runtimeDetails.process.executablePath - - - service.runtimeDetails.process.executableSha256 - - - service.runtimeDetails.process.lineage.euid - - - service.runtimeDetails.process.lineage.executablePath - - - service.runtimeDetails.process.lineage.name - - - service.runtimeDetails.process.lineage.namespacePid - - - service.runtimeDetails.process.lineage.parentUuid - - - service.runtimeDetails.process.lineage.pid - - - service.runtimeDetails.process.lineage.startTime - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - service.runtimeDetails.process.lineage.userId - - - service.runtimeDetails.process.lineage.uuid - - - service.runtimeDetails.process.name - - - service.runtimeDetails.process.namespacePid - - - service.runtimeDetails.process.parentUuid - - - service.runtimeDetails.process.pid - - - service.runtimeDetails.process.pwd - - - service.runtimeDetails.process.startTime - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - - - service.runtimeDetails.process.user - - - service.runtimeDetails.process.userId - - - service.runtimeDetails.process.uuid - - - service.serviceName - - - service.userFeedback - - - severity - - To configure severity based filters, use the following for the - [FindingCriteria](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_FindingCriteria.html) - condition: - - - **Low**: `["1", "2", "3"]` - - - **Medium**: `["4", "5", "6"]` - - - **High**: `["7", "8"]` - - - **Critical**: `["9", "10"]` - - For more information, see [Findings severity - levels](https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_findings-severity.html) - in the *Amazon GuardDuty User Guide*. - - - type - - - updatedAt - - Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_FILTER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_FILTER_INPUT.members["DetectorId"], self.detector_id - ) - - if self.filter_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_FILTER_INPUT.members["FilterName"], self.filter_name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_FILTER_INPUT.members["Description"], self.description - ) - - if self.action is not None: - serializer.write_string( - _SCHEMA_UPDATE_FILTER_INPUT.members["Action"], self.action - ) - - if self.rank is not None: - serializer.write_integer( - _SCHEMA_UPDATE_FILTER_INPUT.members["Rank"], self.rank - ) - - if self.finding_criteria is not None: - serializer.write_struct( - _SCHEMA_UPDATE_FILTER_INPUT.members["FindingCriteria"], - self.finding_criteria, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_UPDATE_FILTER_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["filter_name"] = de.read_string( - _SCHEMA_UPDATE_FILTER_INPUT.members["FilterName"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_FILTER_INPUT.members["Description"] - ) - - case 3: - kwargs["action"] = FilterAction( - de.read_string(_SCHEMA_UPDATE_FILTER_INPUT.members["Action"]) - ) - - case 4: - kwargs["rank"] = de.read_integer( - _SCHEMA_UPDATE_FILTER_INPUT.members["Rank"] - ) - - case 5: - kwargs["finding_criteria"] = FindingCriteria.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_FILTER_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateFilterOutput: - """Dataclass for UpdateFilterOutput structure.""" - - name: str | None = None - """The name of the filter.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_FILTER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_UPDATE_FILTER_OUTPUT.members["Name"], self.name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_FILTER_OUTPUT.members["Name"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_FILTER_OUTPUT, consumer=_consumer) - return kwargs - - -UPDATE_FILTER = APIOperation( - input=UpdateFilterInput, - output=UpdateFilterOutput, - schema=_SCHEMA_UPDATE_FILTER, - input_schema=_SCHEMA_UPDATE_FILTER_INPUT, - output_schema=_SCHEMA_UPDATE_FILTER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateFindingsFeedbackInput: - """Dataclass for UpdateFindingsFeedbackInput structure.""" - - detector_id: str | None = None - """ - The ID of the detector that is associated with the findings for which - you want to update the feedback. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - finding_ids: list[str] | None = None - """The IDs of the findings that you want to mark as useful or not useful.""" - - feedback: str | None = None - """The feedback for the finding.""" - - comments: str | None = field(repr=False, default=None) - """Additional feedback about the GuardDuty findings.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_FINDINGS_FEEDBACK_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_FINDINGS_FEEDBACK_INPUT.members["DetectorId"], - self.detector_id, - ) - - if self.finding_ids is not None: - _serialize_finding_ids( - serializer, - _SCHEMA_UPDATE_FINDINGS_FEEDBACK_INPUT.members["FindingIds"], - self.finding_ids, - ) - - if self.feedback is not None: - serializer.write_string( - _SCHEMA_UPDATE_FINDINGS_FEEDBACK_INPUT.members["Feedback"], - self.feedback, - ) - - if self.comments is not None: - serializer.write_string( - _SCHEMA_UPDATE_FINDINGS_FEEDBACK_INPUT.members["Comments"], - self.comments, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_UPDATE_FINDINGS_FEEDBACK_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["finding_ids"] = _deserialize_finding_ids( - de, _SCHEMA_UPDATE_FINDINGS_FEEDBACK_INPUT.members["FindingIds"] - ) - - case 2: - kwargs["feedback"] = Feedback( - de.read_string( - _SCHEMA_UPDATE_FINDINGS_FEEDBACK_INPUT.members["Feedback"] - ) - ) - - case 3: - kwargs["comments"] = de.read_string( - _SCHEMA_UPDATE_FINDINGS_FEEDBACK_INPUT.members["Comments"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_FINDINGS_FEEDBACK_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateFindingsFeedbackOutput: - """Dataclass for UpdateFindingsFeedbackOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_FINDINGS_FEEDBACK_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_FINDINGS_FEEDBACK_OUTPUT, consumer=_consumer - ) - return kwargs - - -UPDATE_FINDINGS_FEEDBACK = APIOperation( - input=UpdateFindingsFeedbackInput, - output=UpdateFindingsFeedbackOutput, - schema=_SCHEMA_UPDATE_FINDINGS_FEEDBACK, - input_schema=_SCHEMA_UPDATE_FINDINGS_FEEDBACK_INPUT, - output_schema=_SCHEMA_UPDATE_FINDINGS_FEEDBACK_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateIPSetInput: - """Dataclass for UpdateIPSetInput structure.""" - - detector_id: str | None = None - """ - The detectorID that specifies the GuardDuty service whose IPSet you want - to update. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - ip_set_id: str | None = None - """The unique ID that specifies the IPSet that you want to update.""" - - name: str | None = None - """The unique ID that specifies the IPSet that you want to update.""" - - location: str | None = None - """The updated URI of the file that contains the IPSet.""" - - activate: bool | None = None - """ - The updated Boolean value that specifies whether the IPSet is active or - not. - """ - - expected_bucket_owner: str | None = None - """ - The Amazon Web Services account ID that owns the Amazon S3 bucket - specified in the **location** parameter. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_IP_SET_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_IP_SET_INPUT.members["DetectorId"], self.detector_id - ) - - if self.ip_set_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_IP_SET_INPUT.members["IpSetId"], self.ip_set_id - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_UPDATE_IP_SET_INPUT.members["Name"], self.name - ) - - if self.location is not None: - serializer.write_string( - _SCHEMA_UPDATE_IP_SET_INPUT.members["Location"], self.location - ) - - if self.activate is not None: - serializer.write_boolean( - _SCHEMA_UPDATE_IP_SET_INPUT.members["Activate"], self.activate - ) - - if self.expected_bucket_owner is not None: - serializer.write_string( - _SCHEMA_UPDATE_IP_SET_INPUT.members["ExpectedBucketOwner"], - self.expected_bucket_owner, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_UPDATE_IP_SET_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["ip_set_id"] = de.read_string( - _SCHEMA_UPDATE_IP_SET_INPUT.members["IpSetId"] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_IP_SET_INPUT.members["Name"] - ) - - case 3: - kwargs["location"] = de.read_string( - _SCHEMA_UPDATE_IP_SET_INPUT.members["Location"] - ) - - case 4: - kwargs["activate"] = de.read_boolean( - _SCHEMA_UPDATE_IP_SET_INPUT.members["Activate"] - ) - - case 5: - kwargs["expected_bucket_owner"] = de.read_string( - _SCHEMA_UPDATE_IP_SET_INPUT.members["ExpectedBucketOwner"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_IP_SET_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateIPSetOutput: - """Dataclass for UpdateIPSetOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_IP_SET_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_IP_SET_OUTPUT, consumer=_consumer) - return kwargs - - -UPDATE_IP_SET = APIOperation( - input=UpdateIPSetInput, - output=UpdateIPSetOutput, - schema=_SCHEMA_UPDATE_IP_SET, - input_schema=_SCHEMA_UPDATE_IP_SET_INPUT, - output_schema=_SCHEMA_UPDATE_IP_SET_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.guardduty#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateS3BucketResource: - """Information about the protected S3 bucket resource.""" - - object_prefixes: list[str] | None = None - """ - Information about the specified object prefixes. The S3 object will be - scanned only if it belongs to any of the specified object prefixes. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_S3_BUCKET_RESOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.object_prefixes is not None: - _serialize_malware_protection_plan_object_prefixes_list( - serializer, - _SCHEMA_UPDATE_S3_BUCKET_RESOURCE.members["ObjectPrefixes"], - self.object_prefixes, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["object_prefixes"] = ( - _deserialize_malware_protection_plan_object_prefixes_list( - de, - _SCHEMA_UPDATE_S3_BUCKET_RESOURCE.members["ObjectPrefixes"], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_S3_BUCKET_RESOURCE, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateProtectedResource: - """ - Information about the protected resource that is associated with the - created Malware Protection plan. Presently, `S3Bucket` is the only - supported protected resource. - """ - - s3_bucket: UpdateS3BucketResource | None = None - """Information about the protected S3 bucket resource.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_PROTECTED_RESOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.s3_bucket is not None: - serializer.write_struct( - _SCHEMA_UPDATE_PROTECTED_RESOURCE.members["S3Bucket"], self.s3_bucket - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["s3_bucket"] = UpdateS3BucketResource.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_PROTECTED_RESOURCE, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateMalwareProtectionPlanInput: - """Dataclass for UpdateMalwareProtectionPlanInput structure.""" - - malware_protection_plan_id: str | None = None - """A unique identifier associated with the Malware Protection plan.""" - - role: str | None = None - """ - Amazon Resource Name (ARN) of the IAM role with permissions to scan and - add tags to the associated protected resource. - """ - - actions: MalwareProtectionPlanActions | None = None - """ - Information about whether the tags will be added to the S3 object after - scanning. - """ - - protected_resource: UpdateProtectedResource | None = None - """ - Information about the protected resource that is associated with the - created Malware Protection plan. Presently, `S3Bucket` is the only - supported protected resource. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_MALWARE_PROTECTION_PLAN_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.malware_protection_plan_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_MALWARE_PROTECTION_PLAN_INPUT.members[ - "MalwareProtectionPlanId" - ], - self.malware_protection_plan_id, - ) - - if self.role is not None: - serializer.write_string( - _SCHEMA_UPDATE_MALWARE_PROTECTION_PLAN_INPUT.members["Role"], self.role - ) - - if self.actions is not None: - serializer.write_struct( - _SCHEMA_UPDATE_MALWARE_PROTECTION_PLAN_INPUT.members["Actions"], - self.actions, - ) - - if self.protected_resource is not None: - serializer.write_struct( - _SCHEMA_UPDATE_MALWARE_PROTECTION_PLAN_INPUT.members[ - "ProtectedResource" - ], - self.protected_resource, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["malware_protection_plan_id"] = de.read_string( - _SCHEMA_UPDATE_MALWARE_PROTECTION_PLAN_INPUT.members[ - "MalwareProtectionPlanId" - ] - ) - - case 1: - kwargs["role"] = de.read_string( - _SCHEMA_UPDATE_MALWARE_PROTECTION_PLAN_INPUT.members["Role"] - ) - - case 2: - kwargs["actions"] = MalwareProtectionPlanActions.deserialize(de) - - case 3: - kwargs["protected_resource"] = UpdateProtectedResource.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_MALWARE_PROTECTION_PLAN_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateMalwareProtectionPlanOutput: - """Dataclass for UpdateMalwareProtectionPlanOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_MALWARE_PROTECTION_PLAN_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_MALWARE_PROTECTION_PLAN_OUTPUT, consumer=_consumer - ) - return kwargs - - -UPDATE_MALWARE_PROTECTION_PLAN = APIOperation( - input=UpdateMalwareProtectionPlanInput, - output=UpdateMalwareProtectionPlanOutput, - schema=_SCHEMA_UPDATE_MALWARE_PROTECTION_PLAN, - input_schema=_SCHEMA_UPDATE_MALWARE_PROTECTION_PLAN_INPUT, - output_schema=_SCHEMA_UPDATE_MALWARE_PROTECTION_PLAN_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.guardduty#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - ShapeID( - "com.amazonaws.guardduty#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateMalwareScanSettingsInput: - """Dataclass for UpdateMalwareScanSettingsInput structure.""" - - detector_id: str | None = None - """ - The unique ID of the detector that specifies the GuardDuty service where - you want to update scan settings. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - scan_resource_criteria: ScanResourceCriteria | None = None - """ - Represents the criteria to be used in the filter for selecting resources - to scan. - """ - - ebs_snapshot_preservation: str | None = None - """An enum value representing possible snapshot preservation settings.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_MALWARE_SCAN_SETTINGS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_MALWARE_SCAN_SETTINGS_INPUT.members["DetectorId"], - self.detector_id, - ) - - if self.scan_resource_criteria is not None: - serializer.write_struct( - _SCHEMA_UPDATE_MALWARE_SCAN_SETTINGS_INPUT.members[ - "ScanResourceCriteria" - ], - self.scan_resource_criteria, - ) - - if self.ebs_snapshot_preservation is not None: - serializer.write_string( - _SCHEMA_UPDATE_MALWARE_SCAN_SETTINGS_INPUT.members[ - "EbsSnapshotPreservation" - ], - self.ebs_snapshot_preservation, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_UPDATE_MALWARE_SCAN_SETTINGS_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["scan_resource_criteria"] = ScanResourceCriteria.deserialize( - de - ) - - case 2: - kwargs["ebs_snapshot_preservation"] = EbsSnapshotPreservation( - de.read_string( - _SCHEMA_UPDATE_MALWARE_SCAN_SETTINGS_INPUT.members[ - "EbsSnapshotPreservation" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_MALWARE_SCAN_SETTINGS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateMalwareScanSettingsOutput: - """Dataclass for UpdateMalwareScanSettingsOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_MALWARE_SCAN_SETTINGS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_MALWARE_SCAN_SETTINGS_OUTPUT, consumer=_consumer - ) - return kwargs - - -UPDATE_MALWARE_SCAN_SETTINGS = APIOperation( - input=UpdateMalwareScanSettingsInput, - output=UpdateMalwareScanSettingsOutput, - schema=_SCHEMA_UPDATE_MALWARE_SCAN_SETTINGS, - input_schema=_SCHEMA_UPDATE_MALWARE_SCAN_SETTINGS_INPUT, - output_schema=_SCHEMA_UPDATE_MALWARE_SCAN_SETTINGS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class MemberAdditionalConfiguration: - """Information about the additional configuration for the member account.""" - - name: str | None = None - """Name of the additional configuration.""" - - status: str | None = None - """Status of the additional configuration.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEMBER_ADDITIONAL_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_MEMBER_ADDITIONAL_CONFIGURATION.members["Name"], self.name - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_MEMBER_ADDITIONAL_CONFIGURATION.members["Status"], self.status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = OrgFeatureAdditionalConfiguration( - de.read_string( - _SCHEMA_MEMBER_ADDITIONAL_CONFIGURATION.members["Name"] - ) - ) - - case 1: - kwargs["status"] = FeatureStatus( - de.read_string( - _SCHEMA_MEMBER_ADDITIONAL_CONFIGURATION.members["Status"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MEMBER_ADDITIONAL_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -def _serialize_member_additional_configurations( - serializer: ShapeSerializer, - schema: Schema, - value: list[MemberAdditionalConfiguration], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_member_additional_configurations( - deserializer: ShapeDeserializer, schema: Schema -) -> list[MemberAdditionalConfiguration]: - result: list[MemberAdditionalConfiguration] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(MemberAdditionalConfiguration.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class MemberFeaturesConfiguration: - """Contains information about the features for the member account.""" - - name: str | None = None - """The name of the feature.""" - - status: str | None = None - """The status of the feature.""" - - additional_configuration: list[MemberAdditionalConfiguration] | None = None - """Additional configuration of the feature for the member account.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEMBER_FEATURES_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_MEMBER_FEATURES_CONFIGURATION.members["Name"], self.name - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_MEMBER_FEATURES_CONFIGURATION.members["Status"], self.status - ) - - if self.additional_configuration is not None: - _serialize_member_additional_configurations( - serializer, - _SCHEMA_MEMBER_FEATURES_CONFIGURATION.members[ - "AdditionalConfiguration" - ], - self.additional_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = OrgFeature( - de.read_string( - _SCHEMA_MEMBER_FEATURES_CONFIGURATION.members["Name"] - ) - ) - - case 1: - kwargs["status"] = FeatureStatus( - de.read_string( - _SCHEMA_MEMBER_FEATURES_CONFIGURATION.members["Status"] - ) - ) - - case 2: - kwargs["additional_configuration"] = ( - _deserialize_member_additional_configurations( - de, - _SCHEMA_MEMBER_FEATURES_CONFIGURATION.members[ - "AdditionalConfiguration" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MEMBER_FEATURES_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -def _serialize_member_features_configurations( - serializer: ShapeSerializer, - schema: Schema, - value: list[MemberFeaturesConfiguration], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_member_features_configurations( - deserializer: ShapeDeserializer, schema: Schema -) -> list[MemberFeaturesConfiguration]: - result: list[MemberFeaturesConfiguration] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(MemberFeaturesConfiguration.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class UpdateMemberDetectorsInput: - """Dataclass for UpdateMemberDetectorsInput structure.""" - - detector_id: str | None = None - """ - The detector ID of the administrator account. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - account_ids: list[str] | None = None - """A list of member account IDs to be updated.""" - - data_sources: DataSourceConfigurations | None = None - """Describes which data sources will be updated.""" - - features: list[MemberFeaturesConfiguration] | None = None - """ - A list of features that will be updated for the specified member - accounts. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_MEMBER_DETECTORS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_MEMBER_DETECTORS_INPUT.members["DetectorId"], - self.detector_id, - ) - - if self.account_ids is not None: - _serialize_account_ids( - serializer, - _SCHEMA_UPDATE_MEMBER_DETECTORS_INPUT.members["AccountIds"], - self.account_ids, - ) - - if self.data_sources is not None: - serializer.write_struct( - _SCHEMA_UPDATE_MEMBER_DETECTORS_INPUT.members["DataSources"], - self.data_sources, - ) - - if self.features is not None: - _serialize_member_features_configurations( - serializer, - _SCHEMA_UPDATE_MEMBER_DETECTORS_INPUT.members["Features"], - self.features, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_UPDATE_MEMBER_DETECTORS_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["account_ids"] = _deserialize_account_ids( - de, _SCHEMA_UPDATE_MEMBER_DETECTORS_INPUT.members["AccountIds"] - ) - - case 2: - kwargs["data_sources"] = DataSourceConfigurations.deserialize(de) - - case 3: - kwargs["features"] = _deserialize_member_features_configurations( - de, _SCHEMA_UPDATE_MEMBER_DETECTORS_INPUT.members["Features"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_MEMBER_DETECTORS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateMemberDetectorsOutput: - """Dataclass for UpdateMemberDetectorsOutput structure.""" - - unprocessed_accounts: list[UnprocessedAccount] | None = None - """ - A list of member account IDs that were unable to be processed along with - an explanation for why they were not processed. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_MEMBER_DETECTORS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.unprocessed_accounts is not None: - _serialize_unprocessed_accounts( - serializer, - _SCHEMA_UPDATE_MEMBER_DETECTORS_OUTPUT.members["UnprocessedAccounts"], - self.unprocessed_accounts, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["unprocessed_accounts"] = _deserialize_unprocessed_accounts( - de, - _SCHEMA_UPDATE_MEMBER_DETECTORS_OUTPUT.members[ - "UnprocessedAccounts" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_MEMBER_DETECTORS_OUTPUT, consumer=_consumer - ) - return kwargs - - -UPDATE_MEMBER_DETECTORS = APIOperation( - input=UpdateMemberDetectorsInput, - output=UpdateMemberDetectorsOutput, - schema=_SCHEMA_UPDATE_MEMBER_DETECTORS, - input_schema=_SCHEMA_UPDATE_MEMBER_DETECTORS_INPUT, - output_schema=_SCHEMA_UPDATE_MEMBER_DETECTORS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class OrganizationKubernetesAuditLogsConfiguration: - """Organization-wide Kubernetes audit logs configuration.""" - - auto_enable: bool | None = None - """ - A value that contains information on whether Kubernetes audit logs - should be enabled automatically as a data source for the organization. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_ORGANIZATION_KUBERNETES_AUDIT_LOGS_CONFIGURATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.auto_enable is not None: - serializer.write_boolean( - _SCHEMA_ORGANIZATION_KUBERNETES_AUDIT_LOGS_CONFIGURATION.members[ - "AutoEnable" - ], - self.auto_enable, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["auto_enable"] = de.read_boolean( - _SCHEMA_ORGANIZATION_KUBERNETES_AUDIT_LOGS_CONFIGURATION.members[ - "AutoEnable" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ORGANIZATION_KUBERNETES_AUDIT_LOGS_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class OrganizationKubernetesConfiguration: - """Organization-wide Kubernetes data sources configurations.""" - - audit_logs: OrganizationKubernetesAuditLogsConfiguration | None = None - """ - Whether Kubernetes audit logs data source should be auto-enabled for new - members joining the organization. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ORGANIZATION_KUBERNETES_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.audit_logs is not None: - serializer.write_struct( - _SCHEMA_ORGANIZATION_KUBERNETES_CONFIGURATION.members["AuditLogs"], - self.audit_logs, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["audit_logs"] = ( - OrganizationKubernetesAuditLogsConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ORGANIZATION_KUBERNETES_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class OrganizationEbsVolumes: - """Organization-wide EBS volumes scan configuration.""" - - auto_enable: bool | None = None - """ - Whether scanning EBS volumes should be auto-enabled for new members - joining the organization. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ORGANIZATION_EBS_VOLUMES, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.auto_enable is not None: - serializer.write_boolean( - _SCHEMA_ORGANIZATION_EBS_VOLUMES.members["AutoEnable"], self.auto_enable - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["auto_enable"] = de.read_boolean( - _SCHEMA_ORGANIZATION_EBS_VOLUMES.members["AutoEnable"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ORGANIZATION_EBS_VOLUMES, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class OrganizationScanEc2InstanceWithFindings: - """Organization-wide EC2 instances with findings scan configuration.""" - - ebs_volumes: OrganizationEbsVolumes | None = None - """ - Whether scanning EBS volumes should be auto-enabled for new members - joining the organization. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_ORGANIZATION_SCAN_EC2_INSTANCE_WITH_FINDINGS, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.ebs_volumes is not None: - serializer.write_struct( - _SCHEMA_ORGANIZATION_SCAN_EC2_INSTANCE_WITH_FINDINGS.members[ - "EbsVolumes" - ], - self.ebs_volumes, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["ebs_volumes"] = OrganizationEbsVolumes.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ORGANIZATION_SCAN_EC2_INSTANCE_WITH_FINDINGS, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class OrganizationMalwareProtectionConfiguration: - """Organization-wide Malware Protection configurations.""" - - scan_ec2_instance_with_findings: OrganizationScanEc2InstanceWithFindings | None = ( - None - ) - """ - Whether Malware Protection for EC2 instances with findings should be - auto-enabled for new members joining the organization. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_ORGANIZATION_MALWARE_PROTECTION_CONFIGURATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.scan_ec2_instance_with_findings is not None: - serializer.write_struct( - _SCHEMA_ORGANIZATION_MALWARE_PROTECTION_CONFIGURATION.members[ - "ScanEc2InstanceWithFindings" - ], - self.scan_ec2_instance_with_findings, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["scan_ec2_instance_with_findings"] = ( - OrganizationScanEc2InstanceWithFindings.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ORGANIZATION_MALWARE_PROTECTION_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class OrganizationS3LogsConfiguration: - """ - Describes whether S3 data event logs will be automatically enabled for - new members of the organization. - """ - - auto_enable: bool | None = None - """ - A value that contains information on whether S3 data event logs will be - enabled automatically as a data source for the organization. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ORGANIZATION_S3_LOGS_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.auto_enable is not None: - serializer.write_boolean( - _SCHEMA_ORGANIZATION_S3_LOGS_CONFIGURATION.members["AutoEnable"], - self.auto_enable, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["auto_enable"] = de.read_boolean( - _SCHEMA_ORGANIZATION_S3_LOGS_CONFIGURATION.members["AutoEnable"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ORGANIZATION_S3_LOGS_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class OrganizationDataSourceConfigurations: - """ - An object that contains information on which data sources will be - configured to be automatically enabled for new members within the - organization. - """ - - s3_logs: OrganizationS3LogsConfiguration | None = None - """ - Describes whether S3 data event logs are enabled for new members of the - organization. - """ - - kubernetes: OrganizationKubernetesConfiguration | None = None - """ - Describes the configuration of Kubernetes data sources for new members - of the organization. - """ - - malware_protection: OrganizationMalwareProtectionConfiguration | None = None - """ - Describes the configuration of Malware Protection for new members of the - organization. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ORGANIZATION_DATA_SOURCE_CONFIGURATIONS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.s3_logs is not None: - serializer.write_struct( - _SCHEMA_ORGANIZATION_DATA_SOURCE_CONFIGURATIONS.members["S3Logs"], - self.s3_logs, - ) - - if self.kubernetes is not None: - serializer.write_struct( - _SCHEMA_ORGANIZATION_DATA_SOURCE_CONFIGURATIONS.members["Kubernetes"], - self.kubernetes, - ) - - if self.malware_protection is not None: - serializer.write_struct( - _SCHEMA_ORGANIZATION_DATA_SOURCE_CONFIGURATIONS.members[ - "MalwareProtection" - ], - self.malware_protection, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["s3_logs"] = OrganizationS3LogsConfiguration.deserialize(de) - - case 1: - kwargs["kubernetes"] = ( - OrganizationKubernetesConfiguration.deserialize(de) - ) - - case 2: - kwargs["malware_protection"] = ( - OrganizationMalwareProtectionConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ORGANIZATION_DATA_SOURCE_CONFIGURATIONS, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class OrganizationAdditionalConfiguration: - """ - A list of additional configurations which will be configured for the - organization. - - Additional configuration applies to only GuardDuty Runtime Monitoring - protection plan. - """ - - name: str | None = None - """ - The name of the additional configuration that will be configured for the - organization. These values are applicable to only Runtime Monitoring - protection plan. - """ - - auto_enable: str | None = None - """ - The status of the additional configuration that will be configured for - the organization. Use one of the following values to configure the - feature status for the entire organization: - - - `NEW`: Indicates that when a new account joins the organization, they - will have the additional configuration enabled automatically. - - - `ALL`: Indicates that all accounts in the organization have the - additional configuration enabled automatically. This includes `NEW` - accounts that join the organization and accounts that may have been - suspended or removed from the organization in GuardDuty. - - It may take up to 24 hours to update the configuration for all the - member accounts. - - - `NONE`: Indicates that the additional configuration will not be - automatically enabled for any account in the organization. The - administrator must manage the additional configuration for each - account individually. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ORGANIZATION_ADDITIONAL_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_ORGANIZATION_ADDITIONAL_CONFIGURATION.members["Name"], self.name - ) - - if self.auto_enable is not None: - serializer.write_string( - _SCHEMA_ORGANIZATION_ADDITIONAL_CONFIGURATION.members["AutoEnable"], - self.auto_enable, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = OrgFeatureAdditionalConfiguration( - de.read_string( - _SCHEMA_ORGANIZATION_ADDITIONAL_CONFIGURATION.members[ - "Name" - ] - ) - ) - - case 1: - kwargs["auto_enable"] = OrgFeatureStatus( - de.read_string( - _SCHEMA_ORGANIZATION_ADDITIONAL_CONFIGURATION.members[ - "AutoEnable" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ORGANIZATION_ADDITIONAL_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -def _serialize_organization_additional_configurations( - serializer: ShapeSerializer, - schema: Schema, - value: list[OrganizationAdditionalConfiguration], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_organization_additional_configurations( - deserializer: ShapeDeserializer, schema: Schema -) -> list[OrganizationAdditionalConfiguration]: - result: list[OrganizationAdditionalConfiguration] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(OrganizationAdditionalConfiguration.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class OrganizationFeatureConfiguration: - """A list of features which will be configured for the organization.""" - - name: str | None = None - """The name of the feature that will be configured for the organization.""" - - auto_enable: str | None = None - """ - Describes the status of the feature that is configured for the member - accounts within the organization. One of the following values is the - status for the entire organization: - - - `NEW`: Indicates that when a new account joins the organization, they - will have the feature enabled automatically. - - - `ALL`: Indicates that all accounts in the organization have the - feature enabled automatically. This includes `NEW` accounts that join - the organization and accounts that may have been suspended or removed - from the organization in GuardDuty. - - It may take up to 24 hours to update the configuration for all the - member accounts. - - - `NONE`: Indicates that the feature will not be automatically enabled - for any account in the organization. The administrator must manage the - feature for each account individually. - """ - - additional_configuration: list[OrganizationAdditionalConfiguration] | None = None - """The additional information that will be configured for the organization.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ORGANIZATION_FEATURE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_ORGANIZATION_FEATURE_CONFIGURATION.members["Name"], self.name - ) - - if self.auto_enable is not None: - serializer.write_string( - _SCHEMA_ORGANIZATION_FEATURE_CONFIGURATION.members["AutoEnable"], - self.auto_enable, - ) - - if self.additional_configuration is not None: - _serialize_organization_additional_configurations( - serializer, - _SCHEMA_ORGANIZATION_FEATURE_CONFIGURATION.members[ - "AdditionalConfiguration" - ], - self.additional_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = OrgFeature( - de.read_string( - _SCHEMA_ORGANIZATION_FEATURE_CONFIGURATION.members["Name"] - ) - ) - - case 1: - kwargs["auto_enable"] = OrgFeatureStatus( - de.read_string( - _SCHEMA_ORGANIZATION_FEATURE_CONFIGURATION.members[ - "AutoEnable" - ] - ) - ) - - case 2: - kwargs["additional_configuration"] = ( - _deserialize_organization_additional_configurations( - de, - _SCHEMA_ORGANIZATION_FEATURE_CONFIGURATION.members[ - "AdditionalConfiguration" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ORGANIZATION_FEATURE_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -def _serialize_organization_features_configurations( - serializer: ShapeSerializer, - schema: Schema, - value: list[OrganizationFeatureConfiguration], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_organization_features_configurations( - deserializer: ShapeDeserializer, schema: Schema -) -> list[OrganizationFeatureConfiguration]: - result: list[OrganizationFeatureConfiguration] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(OrganizationFeatureConfiguration.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class UpdateOrganizationConfigurationInput: - """Dataclass for UpdateOrganizationConfigurationInput structure.""" - - detector_id: str | None = None - """ - The ID of the detector that configures the delegated administrator. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - auto_enable: bool | None = None - """ - Represents whether to automatically enable member accounts in the - organization. This applies to only new member accounts, not the existing - member accounts. When a new account joins the organization, the chosen - features will be enabled for them by default. - - Even though this is still supported, we recommend using - `AutoEnableOrganizationMembers` to achieve the similar results. You must - provide a value for either `autoEnableOrganizationMembers` or - `autoEnable`. - """ - - data_sources: OrganizationDataSourceConfigurations | None = None - """Describes which data sources will be updated.""" - - features: list[OrganizationFeatureConfiguration] | None = None - """A list of features that will be configured for the organization.""" - - auto_enable_organization_members: str | None = None - """ - Indicates the auto-enablement configuration of GuardDuty for the member - accounts in the organization. You must provide a value for either - `autoEnableOrganizationMembers` or `autoEnable`. - - Use one of the following configuration values for - `autoEnableOrganizationMembers`: - - - `NEW`: Indicates that when a new account joins the organization, they - will have GuardDuty enabled automatically. - - - `ALL`: Indicates that all accounts in the organization have GuardDuty - enabled automatically. This includes `NEW` accounts that join the - organization and accounts that may have been suspended or removed from - the organization in GuardDuty. - - It may take up to 24 hours to update the configuration for all the - member accounts. - - - `NONE`: Indicates that GuardDuty will not be automatically enabled for - any account in the organization. The administrator must manage - GuardDuty for each account in the organization individually. - - When you update the auto-enable setting from `ALL` or `NEW` to `NONE`, - this action doesn't disable the corresponding option for your - existing accounts. This configuration will apply to the new accounts - that join the organization. After you update the auto-enable settings, - no new account will have the corresponding option as enabled. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_ORGANIZATION_CONFIGURATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_ORGANIZATION_CONFIGURATION_INPUT.members["DetectorId"], - self.detector_id, - ) - - if self.auto_enable is not None: - serializer.write_boolean( - _SCHEMA_UPDATE_ORGANIZATION_CONFIGURATION_INPUT.members["AutoEnable"], - self.auto_enable, - ) - - if self.data_sources is not None: - serializer.write_struct( - _SCHEMA_UPDATE_ORGANIZATION_CONFIGURATION_INPUT.members["DataSources"], - self.data_sources, - ) - - if self.features is not None: - _serialize_organization_features_configurations( - serializer, - _SCHEMA_UPDATE_ORGANIZATION_CONFIGURATION_INPUT.members["Features"], - self.features, - ) - - if self.auto_enable_organization_members is not None: - serializer.write_string( - _SCHEMA_UPDATE_ORGANIZATION_CONFIGURATION_INPUT.members[ - "AutoEnableOrganizationMembers" - ], - self.auto_enable_organization_members, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_UPDATE_ORGANIZATION_CONFIGURATION_INPUT.members[ - "DetectorId" - ] - ) - - case 1: - kwargs["auto_enable"] = de.read_boolean( - _SCHEMA_UPDATE_ORGANIZATION_CONFIGURATION_INPUT.members[ - "AutoEnable" - ] - ) - - case 2: - kwargs["data_sources"] = ( - OrganizationDataSourceConfigurations.deserialize(de) - ) - - case 3: - kwargs["features"] = ( - _deserialize_organization_features_configurations( - de, - _SCHEMA_UPDATE_ORGANIZATION_CONFIGURATION_INPUT.members[ - "Features" - ], - ) - ) - - case 4: - kwargs["auto_enable_organization_members"] = AutoEnableMembers( - de.read_string( - _SCHEMA_UPDATE_ORGANIZATION_CONFIGURATION_INPUT.members[ - "AutoEnableOrganizationMembers" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_ORGANIZATION_CONFIGURATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateOrganizationConfigurationOutput: - """Dataclass for UpdateOrganizationConfigurationOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_ORGANIZATION_CONFIGURATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_ORGANIZATION_CONFIGURATION_OUTPUT, consumer=_consumer - ) - return kwargs - - -UPDATE_ORGANIZATION_CONFIGURATION = APIOperation( - input=UpdateOrganizationConfigurationInput, - output=UpdateOrganizationConfigurationOutput, - schema=_SCHEMA_UPDATE_ORGANIZATION_CONFIGURATION, - input_schema=_SCHEMA_UPDATE_ORGANIZATION_CONFIGURATION_INPUT, - output_schema=_SCHEMA_UPDATE_ORGANIZATION_CONFIGURATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, +STOP_MONITORING_MEMBERS: APIOperation[ + StopMonitoringMembersInput, StopMonitoringMembersOutput +] = APIOperation( + static_schema=_SCHEMA_STOP_MONITORING_MEMBERS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) - -@dataclass(kw_only=True) -class UpdatePublishingDestinationInput: - """Dataclass for UpdatePublishingDestinationInput structure.""" - - detector_id: str | None = None - """ - The ID of the detector associated with the publishing destinations to - update. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - destination_id: str | None = None - """The ID of the publishing destination to update.""" - - destination_properties: DestinationProperties | None = None - """ - A `DestinationProperties` object that includes the `DestinationArn` and - `KmsKeyArn` of the publishing destination. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_PUBLISHING_DESTINATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_PUBLISHING_DESTINATION_INPUT.members["DetectorId"], - self.detector_id, - ) - - if self.destination_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_PUBLISHING_DESTINATION_INPUT.members["DestinationId"], - self.destination_id, - ) - - if self.destination_properties is not None: - serializer.write_struct( - _SCHEMA_UPDATE_PUBLISHING_DESTINATION_INPUT.members[ - "DestinationProperties" - ], - self.destination_properties, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_UPDATE_PUBLISHING_DESTINATION_INPUT.members[ - "DetectorId" - ] - ) - - case 1: - kwargs["destination_id"] = de.read_string( - _SCHEMA_UPDATE_PUBLISHING_DESTINATION_INPUT.members[ - "DestinationId" - ] - ) - - case 2: - kwargs["destination_properties"] = ( - DestinationProperties.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_PUBLISHING_DESTINATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdatePublishingDestinationOutput: - """Dataclass for UpdatePublishingDestinationOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_PUBLISHING_DESTINATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_PUBLISHING_DESTINATION_OUTPUT, consumer=_consumer - ) - return kwargs - - -UPDATE_PUBLISHING_DESTINATION = APIOperation( - input=UpdatePublishingDestinationInput, - output=UpdatePublishingDestinationOutput, - schema=_SCHEMA_UPDATE_PUBLISHING_DESTINATION, - input_schema=_SCHEMA_UPDATE_PUBLISHING_DESTINATION_INPUT, - output_schema=_SCHEMA_UPDATE_PUBLISHING_DESTINATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, +TAG_RESOURCE: APIOperation[TagResourceInput, TagResourceOutput] = APIOperation( + static_schema=_SCHEMA_TAG_RESOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#AccessDeniedException"), + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) - -@dataclass(kw_only=True) -class UpdateThreatEntitySetInput: - """Dataclass for UpdateThreatEntitySetInput structure.""" - - detector_id: str | None = None - """ - The unique ID of the GuardDuty detector associated with the threat - entity set that you want to update. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - threat_entity_set_id: str | None = None - """ - The ID returned by GuardDuty after updating the threat entity set - resource. - """ - - name: str | None = None - """ - A user-friendly name to identify the trusted entity set. - - The name of your list can include lowercase letters, uppercase letters, - numbers, dash (-), and underscore (_). - """ - - location: str | None = None - """The URI of the file that contains the trusted entity set.""" - - expected_bucket_owner: str | None = None - """ - The Amazon Web Services account ID that owns the Amazon S3 bucket - specified in the **location** parameter. - """ - - activate: bool | None = None - """ - A boolean value that indicates whether GuardDuty is to start using this - updated threat entity set. After you update an entity set, you will need - to activate it again. It might take up to 15 minutes for the updated - entity set to be effective. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_THREAT_ENTITY_SET_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_THREAT_ENTITY_SET_INPUT.members["DetectorId"], - self.detector_id, - ) - - if self.threat_entity_set_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_THREAT_ENTITY_SET_INPUT.members["ThreatEntitySetId"], - self.threat_entity_set_id, - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_UPDATE_THREAT_ENTITY_SET_INPUT.members["Name"], self.name - ) - - if self.location is not None: - serializer.write_string( - _SCHEMA_UPDATE_THREAT_ENTITY_SET_INPUT.members["Location"], - self.location, - ) - - if self.expected_bucket_owner is not None: - serializer.write_string( - _SCHEMA_UPDATE_THREAT_ENTITY_SET_INPUT.members["ExpectedBucketOwner"], - self.expected_bucket_owner, - ) - - if self.activate is not None: - serializer.write_boolean( - _SCHEMA_UPDATE_THREAT_ENTITY_SET_INPUT.members["Activate"], - self.activate, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_UPDATE_THREAT_ENTITY_SET_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["threat_entity_set_id"] = de.read_string( - _SCHEMA_UPDATE_THREAT_ENTITY_SET_INPUT.members[ - "ThreatEntitySetId" - ] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_THREAT_ENTITY_SET_INPUT.members["Name"] - ) - - case 3: - kwargs["location"] = de.read_string( - _SCHEMA_UPDATE_THREAT_ENTITY_SET_INPUT.members["Location"] - ) - - case 4: - kwargs["expected_bucket_owner"] = de.read_string( - _SCHEMA_UPDATE_THREAT_ENTITY_SET_INPUT.members[ - "ExpectedBucketOwner" - ] - ) - - case 5: - kwargs["activate"] = de.read_boolean( - _SCHEMA_UPDATE_THREAT_ENTITY_SET_INPUT.members["Activate"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_THREAT_ENTITY_SET_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateThreatEntitySetOutput: - """Dataclass for UpdateThreatEntitySetOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False +UNARCHIVE_FINDINGS: APIOperation[UnarchiveFindingsInput, UnarchiveFindingsOutput] = ( + APIOperation( + static_schema=_SCHEMA_UNARCHIVE_FINDINGS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_THREAT_ENTITY_SET_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_THREAT_ENTITY_SET_OUTPUT, consumer=_consumer - ) - return kwargs - +) -UPDATE_THREAT_ENTITY_SET = APIOperation( - input=UpdateThreatEntitySetInput, - output=UpdateThreatEntitySetOutput, - schema=_SCHEMA_UPDATE_THREAT_ENTITY_SET, - input_schema=_SCHEMA_UPDATE_THREAT_ENTITY_SET_INPUT, - output_schema=_SCHEMA_UPDATE_THREAT_ENTITY_SET_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, +UNTAG_RESOURCE: APIOperation[UntagResourceInput, UntagResourceOutput] = APIOperation( + static_schema=_SCHEMA_UNTAG_RESOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#AccessDeniedException"), + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) - -@dataclass(kw_only=True) -class UpdateThreatIntelSetInput: - """Dataclass for UpdateThreatIntelSetInput structure.""" - - detector_id: str | None = None - """ - The detectorID that specifies the GuardDuty service whose ThreatIntelSet - you want to update. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - threat_intel_set_id: str | None = None - """The unique ID that specifies the ThreatIntelSet that you want to update.""" - - name: str | None = None - """The unique ID that specifies the ThreatIntelSet that you want to update.""" - - location: str | None = None - """The updated URI of the file that contains the ThreateIntelSet.""" - - activate: bool | None = None - """ - The updated Boolean value that specifies whether the ThreateIntelSet is - active or not. - """ - - expected_bucket_owner: str | None = None - """ - The Amazon Web Services account ID that owns the Amazon S3 bucket - specified in the **location** parameter. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_THREAT_INTEL_SET_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_THREAT_INTEL_SET_INPUT.members["DetectorId"], - self.detector_id, - ) - - if self.threat_intel_set_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_THREAT_INTEL_SET_INPUT.members["ThreatIntelSetId"], - self.threat_intel_set_id, - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_UPDATE_THREAT_INTEL_SET_INPUT.members["Name"], self.name - ) - - if self.location is not None: - serializer.write_string( - _SCHEMA_UPDATE_THREAT_INTEL_SET_INPUT.members["Location"], self.location - ) - - if self.activate is not None: - serializer.write_boolean( - _SCHEMA_UPDATE_THREAT_INTEL_SET_INPUT.members["Activate"], self.activate - ) - - if self.expected_bucket_owner is not None: - serializer.write_string( - _SCHEMA_UPDATE_THREAT_INTEL_SET_INPUT.members["ExpectedBucketOwner"], - self.expected_bucket_owner, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_UPDATE_THREAT_INTEL_SET_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["threat_intel_set_id"] = de.read_string( - _SCHEMA_UPDATE_THREAT_INTEL_SET_INPUT.members[ - "ThreatIntelSetId" - ] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_THREAT_INTEL_SET_INPUT.members["Name"] - ) - - case 3: - kwargs["location"] = de.read_string( - _SCHEMA_UPDATE_THREAT_INTEL_SET_INPUT.members["Location"] - ) - - case 4: - kwargs["activate"] = de.read_boolean( - _SCHEMA_UPDATE_THREAT_INTEL_SET_INPUT.members["Activate"] - ) - - case 5: - kwargs["expected_bucket_owner"] = de.read_string( - _SCHEMA_UPDATE_THREAT_INTEL_SET_INPUT.members[ - "ExpectedBucketOwner" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_THREAT_INTEL_SET_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateThreatIntelSetOutput: - """Dataclass for UpdateThreatIntelSetOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_THREAT_INTEL_SET_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_THREAT_INTEL_SET_OUTPUT, consumer=_consumer - ) - return kwargs - - -UPDATE_THREAT_INTEL_SET = APIOperation( - input=UpdateThreatIntelSetInput, - output=UpdateThreatIntelSetOutput, - schema=_SCHEMA_UPDATE_THREAT_INTEL_SET, - input_schema=_SCHEMA_UPDATE_THREAT_INTEL_SET_INPUT, - output_schema=_SCHEMA_UPDATE_THREAT_INTEL_SET_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.guardduty#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, +UPDATE_CUSTOM_DETECTION_RULE_ASSOCIATION: APIOperation[ + UpdateCustomDetectionRuleAssociationInput, + UpdateCustomDetectionRuleAssociationOutput, +] = APIOperation( + static_schema=_SCHEMA_UPDATE_CUSTOM_DETECTION_RULE_ASSOCIATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#AccessDeniedException"), + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#ConflictException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ShapeID("com.amazonaws.guardduty#ResourceNotFoundException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) +UPDATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION: APIOperation[ + UpdateCustomDetectionRuleOrgConfigurationInput, + UpdateCustomDetectionRuleOrgConfigurationOutput, +] = APIOperation( + static_schema=_SCHEMA_UPDATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#AccessDeniedException"), + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#ConflictException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ShapeID("com.amazonaws.guardduty#ResourceNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -@dataclass(kw_only=True) -class UpdateTrustedEntitySetInput: - """Dataclass for UpdateTrustedEntitySetInput structure.""" - - detector_id: str | None = None - """ - The unique ID of the GuardDuty detector associated with the threat - entity set that you want to update. - - To find the `detectorId` in the current Region, see the Settings page in - the GuardDuty console, or run the - [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) - API. - """ - - trusted_entity_set_id: str | None = None - """ - The ID returned by GuardDuty after updating the trusted entity set - resource. - """ - - name: str | None = None - """ - A user-friendly name to identify the trusted entity set. - - The name of your list can include lowercase letters, uppercase letters, - numbers, dash (-), and underscore (_). - """ - - location: str | None = None - """The URI of the file that contains the trusted entity set.""" - - expected_bucket_owner: str | None = None - """ - The Amazon Web Services account ID that owns the Amazon S3 bucket - specified in the **location** parameter. - """ - - activate: bool | None = None - """ - A boolean value that indicates whether GuardDuty is to start using this - updated trusted entity set. After you update an entity set, you will - need to activate it again. It might take up to 15 minutes for the - updated entity set to be effective. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_TRUSTED_ENTITY_SET_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.detector_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_TRUSTED_ENTITY_SET_INPUT.members["DetectorId"], - self.detector_id, - ) - - if self.trusted_entity_set_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_TRUSTED_ENTITY_SET_INPUT.members["TrustedEntitySetId"], - self.trusted_entity_set_id, - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_UPDATE_TRUSTED_ENTITY_SET_INPUT.members["Name"], self.name - ) - - if self.location is not None: - serializer.write_string( - _SCHEMA_UPDATE_TRUSTED_ENTITY_SET_INPUT.members["Location"], - self.location, - ) - - if self.expected_bucket_owner is not None: - serializer.write_string( - _SCHEMA_UPDATE_TRUSTED_ENTITY_SET_INPUT.members["ExpectedBucketOwner"], - self.expected_bucket_owner, - ) - - if self.activate is not None: - serializer.write_boolean( - _SCHEMA_UPDATE_TRUSTED_ENTITY_SET_INPUT.members["Activate"], - self.activate, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["detector_id"] = de.read_string( - _SCHEMA_UPDATE_TRUSTED_ENTITY_SET_INPUT.members["DetectorId"] - ) - - case 1: - kwargs["trusted_entity_set_id"] = de.read_string( - _SCHEMA_UPDATE_TRUSTED_ENTITY_SET_INPUT.members[ - "TrustedEntitySetId" - ] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_TRUSTED_ENTITY_SET_INPUT.members["Name"] - ) - - case 3: - kwargs["location"] = de.read_string( - _SCHEMA_UPDATE_TRUSTED_ENTITY_SET_INPUT.members["Location"] - ) - - case 4: - kwargs["expected_bucket_owner"] = de.read_string( - _SCHEMA_UPDATE_TRUSTED_ENTITY_SET_INPUT.members[ - "ExpectedBucketOwner" - ] - ) - - case 5: - kwargs["activate"] = de.read_boolean( - _SCHEMA_UPDATE_TRUSTED_ENTITY_SET_INPUT.members["Activate"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_TRUSTED_ENTITY_SET_INPUT, consumer=_consumer - ) - return kwargs - +UPDATE_DETECTOR: APIOperation[UpdateDetectorInput, UpdateDetectorOutput] = APIOperation( + static_schema=_SCHEMA_UPDATE_DETECTOR, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -@dataclass(kw_only=True) -class UpdateTrustedEntitySetOutput: - """Dataclass for UpdateTrustedEntitySetOutput structure.""" +UPDATE_FILTER: APIOperation[UpdateFilterInput, UpdateFilterOutput] = APIOperation( + static_schema=_SCHEMA_UPDATE_FILTER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ +UPDATE_FINDINGS_FEEDBACK: APIOperation[ + UpdateFindingsFeedbackInput, UpdateFindingsFeedbackOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_FINDINGS_FEEDBACK, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_TRUSTED_ENTITY_SET_OUTPUT, self) +UPDATE_IP_SET: APIOperation[UpdateIPSetInput, UpdateIPSetOutput] = APIOperation( + static_schema=_SCHEMA_UPDATE_IP_SET, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#AccessDeniedException"), + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize_members(self, serializer: ShapeSerializer): - pass +UPDATE_MALWARE_PROTECTION_PLAN: APIOperation[ + UpdateMalwareProtectionPlanInput, UpdateMalwareProtectionPlanOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_MALWARE_PROTECTION_PLAN, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#AccessDeniedException"), + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ShapeID("com.amazonaws.guardduty#ResourceNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) +UPDATE_MALWARE_SCAN_SETTINGS: APIOperation[ + UpdateMalwareScanSettingsInput, UpdateMalwareScanSettingsOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_MALWARE_SCAN_SETTINGS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +UPDATE_MEMBER_DETECTORS: APIOperation[ + UpdateMemberDetectorsInput, UpdateMemberDetectorsOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_MEMBER_DETECTORS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) +UPDATE_ORGANIZATION_CONFIGURATION: APIOperation[ + UpdateOrganizationConfigurationInput, UpdateOrganizationConfigurationOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_ORGANIZATION_CONFIGURATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - deserializer.read_struct( - _SCHEMA_UPDATE_TRUSTED_ENTITY_SET_OUTPUT, consumer=_consumer - ) - return kwargs +UPDATE_PUBLISHING_DESTINATION: APIOperation[ + UpdatePublishingDestinationInput, UpdatePublishingDestinationOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_PUBLISHING_DESTINATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +UPDATE_THREAT_ENTITY_SET: APIOperation[ + UpdateThreatEntitySetInput, UpdateThreatEntitySetOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_THREAT_ENTITY_SET, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -UPDATE_TRUSTED_ENTITY_SET = APIOperation( - input=UpdateTrustedEntitySetInput, - output=UpdateTrustedEntitySetOutput, - schema=_SCHEMA_UPDATE_TRUSTED_ENTITY_SET, - input_schema=_SCHEMA_UPDATE_TRUSTED_ENTITY_SET_INPUT, - output_schema=_SCHEMA_UPDATE_TRUSTED_ENTITY_SET_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.guardduty#BadRequestException"): BadRequestException, - ShapeID( - "com.amazonaws.guardduty#InternalServerErrorException" - ): InternalServerErrorException, - } - ), +UPDATE_THREAT_INTEL_SET: APIOperation[ + UpdateThreatIntelSetInput, UpdateThreatIntelSetOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_THREAT_INTEL_SET, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#AccessDeniedException"), + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), + ], effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_ERROR_EXCEPTION, +) + +UPDATE_TRUSTED_ENTITY_SET: APIOperation[ + UpdateTrustedEntitySetInput, UpdateTrustedEntitySetOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_TRUSTED_ENTITY_SET, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.guardduty#BadRequestException"), + ShapeID("com.amazonaws.guardduty#InternalServerErrorException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) diff --git a/clients/aws-sdk-guardduty/src/aws_sdk_guardduty/models.pyi b/clients/aws-sdk-guardduty/src/aws_sdk_guardduty/models.pyi new file mode 100644 index 00000000..0d71485d --- /dev/null +++ b/clients/aws-sdk-guardduty/src/aws_sdk_guardduty/models.pyi @@ -0,0 +1,12815 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. + +from dataclasses import dataclass +from datetime import datetime +from enum import StrEnum +from typing import Self + +from smithy_core.deserializers import ShapeDeserializer +from smithy_core.exceptions import ModeledError +from smithy_core.response import ResponseMetadata +from smithy_core.schemas import APIOperation +from smithy_core.serializers import ShapeSerializer +from smithy_core.types import UnknownEnumMixin + +class _SerdeShape: + def serialize(self, serializer: ShapeSerializer) -> None: ... + def serialize_members(self, serializer: ShapeSerializer) -> None: ... + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: ... + +class ServiceError(ModeledError): + """ + Base error for all errors in the service. + + Some exceptions do not extend from this class, including + synthetic, implicit, and shared exception types. + """ + +@dataclass(kw_only=True) +class AcceptAdministratorInvitationInput(_SerdeShape): + """Dataclass for AcceptAdministratorInvitationInput structure.""" + + detector_id: str | None = ... + """The unique ID of the detector of the GuardDuty member account.""" + administrator_id: str | None = ... + """ + The account ID of the GuardDuty administrator account whose invitation + you're accepting. + """ + invitation_id: str | None = ... + """ + The value that is used to validate the administrator account to the + member account. + """ + +@dataclass(kw_only=True) +class AcceptAdministratorInvitationOutput(_SerdeShape): + """Dataclass for AcceptAdministratorInvitationOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class AcceptInvitationInput(_SerdeShape): + """Dataclass for AcceptInvitationInput structure.""" + + detector_id: str | None = ... + """ + The unique ID of the detector of the GuardDuty member account. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + master_id: str | None = ... + """ + The account ID of the GuardDuty administrator account whose invitation + you're accepting. + """ + invitation_id: str | None = ... + """ + The value that is used to validate the administrator account to the + member account. + """ + +@dataclass(kw_only=True) +class AcceptInvitationOutput(_SerdeShape): + """Dataclass for AcceptInvitationOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class AccessControlList(_SerdeShape): + """ + Contains information on the current access control policies for the + bucket. + """ + + allows_public_read_access: bool | None = ... + """ + A value that indicates whether public read access for the bucket is + enabled through an Access Control List (ACL). + """ + allows_public_write_access: bool | None = ... + """ + A value that indicates whether public write access for the bucket is + enabled through an Access Control List (ACL). + """ + +@dataclass(kw_only=True) +class AccessDeniedException(ServiceError, _SerdeShape): + """An access denied exception object.""" + + type: str | None = ... + """The error type.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class AccessKey(_SerdeShape): + """Contains information about the access keys.""" + + principal_id: str | None = ... + """Principal ID of the user.""" + user_name: str | None = ... + """Name of the user.""" + user_type: str | None = ... + """Type of the user.""" + +@dataclass(kw_only=True) +class AccessKeyDetails(_SerdeShape): + """Contains information about the access keys.""" + + access_key_id: str | None = ... + """The access key ID of the user.""" + principal_id: str | None = ... + """The principal ID of the user.""" + user_name: str | None = ... + """The name of the user.""" + user_type: str | None = ... + """The type of the user.""" + +@dataclass(kw_only=True) +class Account(_SerdeShape): + """ + Contains information about the Amazon Web Services account within which + the activity took place. + """ + + uid: str | None = ... + """ + The Amazon Web Services account ID within which the activity took place. + This may differ from the account that owns the user identity. + """ + name: str | None = ... + """Name of the member's Amazon Web Services account.""" + +@dataclass(kw_only=True) +class AccountDetail(_SerdeShape): + """Contains information about the account.""" + + account_id: str | None = ... + """The member account ID.""" + email: str | None = ... + """ + The email address of the member account. The following list includes the + rules for a valid email address: + + - The email address must be a minimum of 6 and a maximum of 64 + characters long. + + - All characters must be 7-bit ASCII characters. + + - There must be one and only one @ symbol, which separates the local + name from the domain name. + + - The local name can't contain any of the following characters: + + whitespace, \" ' ( ) < > [ ] : ' , \\ | % & + + - The local name can't begin with a dot (.). + + - The domain name can consist of only the characters [a-z], [A-Z], + [0-9], hyphen (-), or dot (.). + + - The domain name can't begin or end with a dot (.) or hyphen (-). + + - The domain name must contain at least one dot. + """ + +@dataclass(kw_only=True) +class AccountFreeTrialInfo(_SerdeShape): + """ + Provides details of the GuardDuty member account that uses a free trial + service. + """ + + account_id: str | None = ... + """The account identifier of the GuardDuty member account.""" + data_sources: DataSourcesFreeTrial | None = ... + """Describes the data source enabled for the GuardDuty member account.""" + features: list[FreeTrialFeatureConfigurationResult] | None = ... + """A list of features enabled for the GuardDuty account.""" + +@dataclass(kw_only=True) +class AccountLevelPermissions(_SerdeShape): + """ + Contains information about the account level permissions on the S3 + bucket. + """ + + block_public_access: BlockPublicAccess | None = ... + """ + Describes the S3 Block Public Access settings of the bucket's parent + account. + """ + +@dataclass(kw_only=True) +class AccountStatistics(_SerdeShape): + """ + Represents a list of map of accounts with the number of findings + associated with each account. + """ + + account_id: str | None = ... + """The ID of the Amazon Web Services account.""" + last_generated_at: datetime | None = ... + """The timestamp at which the finding for this account was last generated.""" + total_findings: int | None = ... + """The total number of findings associated with an account.""" + +@dataclass(kw_only=True) +class Action(_SerdeShape): + """Contains information about actions.""" + + action_type: str | None = ... + """The GuardDuty finding activity type.""" + aws_api_call_action: AwsApiCallAction | None = ... + """Information about the AWS_API_CALL action described in this finding.""" + dns_request_action: DnsRequestAction | None = ... + """Information about the DNS_REQUEST action described in this finding.""" + network_connection_action: NetworkConnectionAction | None = ... + """ + Information about the NETWORK_CONNECTION action described in this + finding. + """ + port_probe_action: PortProbeAction | None = ... + """Information about the PORT_PROBE action described in this finding.""" + kubernetes_api_call_action: KubernetesApiCallAction | None = ... + """ + Information about the Kubernetes API call action described in this + finding. + """ + kubernetes_permission_checked_details: ( + KubernetesPermissionCheckedDetails | None + ) = ... + """ + Information whether the user has the permission to use a specific + Kubernetes API. + """ + kubernetes_role_binding_details: KubernetesRoleBindingDetails | None = ... + """ + Information about the role binding that grants the permission defined in + a Kubernetes role. + """ + kubernetes_role_details: KubernetesRoleDetails | None = ... + """Information about the Kubernetes role name and role type.""" + rds_login_attempt_action: RdsLoginAttemptAction | None = ... + """Information about `RDS_LOGIN_ATTEMPT` action described in this finding.""" + +@dataclass(kw_only=True) +class Activity(_SerdeShape): + """ + Contains information about an activity, such as an API call, that was + observed for a signal. + """ + + type: str | None = ... + """The type of the observed activity.""" + api: ApiCall | None = ... + """ + Contains information about the API call that was observed, when the + activity type is `API_CALL`. + """ + +class ActivityType(UnknownEnumMixin, StrEnum): + """The type of an observed activity.""" + + API_CALL = "API_CALL" + """The observed activity is an API call.""" + +@dataclass(kw_only=True) +class Actor(_SerdeShape): + """Information about the actors involved in an attack sequence.""" + + id: str | None = ... + """ID of the threat actor.""" + user: User | None = ... + """ + Contains information about the user credentials used by the threat + actor. + """ + session: Session | None = ... + """ + Contains information about the user session where the activity + initiated. + """ + process: ActorProcess | None = ... + """ + Contains information about the process associated with the threat actor. + This includes details such as process name, path, execution time, and + unique identifiers that help track the actor's activities within the + system. + """ + +@dataclass(kw_only=True) +class ActorProcess(_SerdeShape): + """ + Contains information about a process involved in a GuardDuty finding, + including process identification, execution details, and file + information. + """ + + name: str | None = ... + """The name of the process as it appears in the system.""" + path: str | None = ... + """The full file path to the process executable on the system.""" + sha256: str | None = ... + """ + The SHA256 hash of the process executable file, which can be used for + identification and verification purposes. + """ + +@dataclass(kw_only=True) +class AdditionalInfo(_SerdeShape): + """Contains additional information about the detected threat.""" + + version_id: str | None = ... + """The version ID of the S3 object, if applicable.""" + device_name: str | None = ... + """The device name of the EBS volume, if applicable.""" + +@dataclass(kw_only=True) +class AddonDetails(_SerdeShape): + """Information about the installed EKS add-on (GuardDuty security agent).""" + + addon_version: str | None = ... + """Version of the installed EKS add-on.""" + addon_status: str | None = ... + """Status of the installed EKS add-on.""" + +@dataclass(kw_only=True) +class AdminAccount(_SerdeShape): + """ + The account within the organization specified as the GuardDuty delegated + administrator. + """ + + admin_account_id: str | None = ... + """The Amazon Web Services account ID for the account.""" + admin_status: str | None = ... + """Indicates whether the account is enabled as the delegated administrator.""" + +@dataclass(kw_only=True) +class Administrator(_SerdeShape): + """Contains information about the administrator account and invitation.""" + + account_id: str | None = ... + """The ID of the account used as the administrator account.""" + invitation_id: str | None = ... + """ + The value that is used to validate the administrator account to the + member account. + """ + relationship_status: str | None = ... + """ + The status of the relationship between the administrator and member + accounts. + """ + invited_at: str | None = ... + """The timestamp when the invitation was sent.""" + +class AdminStatus(UnknownEnumMixin, StrEnum): + ENABLED = "ENABLED" + DISABLE_IN_PROGRESS = "DISABLE_IN_PROGRESS" + +@dataclass(kw_only=True) +class AgentDetails(_SerdeShape): + """Information about the installed GuardDuty security agent.""" + + version: str | None = ... + """Version of the installed GuardDuty security agent.""" + +@dataclass(kw_only=True) +class Anomaly(_SerdeShape): + """Contains information about the anomalies.""" + + profiles: dict[str, dict[str, list[AnomalyObject]]] | None = ... + """Information about the types of profiles.""" + unusual: AnomalyUnusual | None = ... + """Information about the behavior of the anomalies.""" + +@dataclass(kw_only=True) +class AnomalyObject(_SerdeShape): + """Contains information about the unusual anomalies.""" + + profile_type: str | None = ... + """The type of behavior of the profile.""" + profile_subtype: str | None = ... + """The frequency of the anomaly.""" + observations: Observations | None = ... + """The recorded value.""" + +@dataclass(kw_only=True) +class AnomalyUnusual(_SerdeShape): + """ + Contains information about the behavior of the anomaly that is new to + GuardDuty. + """ + + behavior: dict[str, dict[str, AnomalyObject]] | None = ... + """ + The behavior of the anomalous activity that caused GuardDuty to generate + the finding. + """ + +@dataclass(kw_only=True) +class ApiCall(_SerdeShape): + """ + Contains information about an API call that was observed as part of an + activity. + """ + + operation: str | None = ... + """The name of the API operation that was invoked.""" + service: str | None = ... + """The service that the API operation was invoked against.""" + error: str | None = ... + """The error code that was returned, if the API call failed.""" + user_agent: str | None = ... + """User agent in the request to the API operation""" + +@dataclass(kw_only=True) +class ArchiveFindingsInput(_SerdeShape): + """Dataclass for ArchiveFindingsInput structure.""" + + detector_id: str | None = ... + """ + The ID of the detector that specifies the GuardDuty service whose + findings you want to archive. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + finding_ids: list[str] | None = ... + """The IDs of the findings that you want to archive.""" + +@dataclass(kw_only=True) +class ArchiveFindingsOutput(_SerdeShape): + """Dataclass for ArchiveFindingsOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class AssociationDetail(_SerdeShape): + """Contains the full details of a custom detection rule association.""" + + association_id: str | None = ... + """The unique identifier for the association.""" + arn: str | None = ... + """The Amazon Resource Name (ARN) of the association.""" + rule_id: str | None = ... + """The unique identifier for the custom detection rule.""" + account_id: str | None = ... + """ + The Amazon Web Services account ID associated with this rule + association. + """ + mode: str | None = ... + """The rule execution mode. Valid values: `LIVE` | `DRY_RUN`.""" + created_at: datetime | None = ... + """The timestamp when the association was created.""" + updated_at: datetime | None = ... + """The timestamp when the association was last updated.""" + expires_at: datetime | None = ... + """The timestamp when the association expires.""" + +class AssociationMode(UnknownEnumMixin, StrEnum): + LIVE = "LIVE" + DRY_RUN = "DRY_RUN" + +@dataclass(kw_only=True) +class AssociationSummary(_SerdeShape): + """Contains summary information about a custom detection rule association.""" + + association_id: str | None = ... + """The unique identifier for the association.""" + arn: str | None = ... + """The Amazon Resource Name (ARN) of the association.""" + rule_id: str | None = ... + """The unique identifier for the custom detection rule.""" + mode: str | None = ... + """The rule execution mode. Valid values: `LIVE` | `DRY_RUN`.""" + created_at: datetime | None = ... + """The timestamp when the association was created.""" + updated_at: datetime | None = ... + """The timestamp when the association was last updated.""" + expires_at: datetime | None = ... + """The timestamp when the association expires.""" + +class AutoEnableMembers(UnknownEnumMixin, StrEnum): + NEW = "NEW" + ALL = "ALL" + NONE = "NONE" + +@dataclass(kw_only=True) +class AutonomousSystem(_SerdeShape): + """ + Contains information about the Autonomous System (AS) associated with + the network endpoints involved in an attack sequence. + """ + + name: str | None = ... + """Name associated with the Autonomous System (AS).""" + number: int | None = ... + """The unique number that identifies the Autonomous System (AS).""" + +@dataclass(kw_only=True) +class AutoscalingAutoScalingGroup(_SerdeShape): + """ + Contains information about the Auto Scaling Group involved in a + GuardDuty finding, including unique identifiers of the Amazon EC2 + instances. + """ + + ec2_instance_uids: list[str] | None = ... + """ + A list of unique identifiers for the compromised Amazon EC2 instances + that are part of the same Auto Scaling Group. + """ + +@dataclass(kw_only=True) +class AwsApiCallAction(_SerdeShape): + """Contains information about the API action.""" + + api: str | None = ... + """The Amazon Web Services API name.""" + caller_type: str | None = ... + """The Amazon Web Services API caller type.""" + domain_details: DomainDetails | None = ... + """The domain information for the Amazon Web Services API call.""" + error_code: str | None = ... + """The error code of the failed Amazon Web Services API action.""" + user_agent: str | None = ... + """The agent through which the API request was made.""" + remote_ip_details: RemoteIpDetails | None = ... + """ + The remote IP information of the connection that initiated the Amazon + Web Services API call. + """ + service_name: str | None = ... + """The Amazon Web Services service name whose API was invoked.""" + remote_account_details: RemoteAccountDetails | None = ... + """ + The details of the Amazon Web Services account that made the API call. + This field appears if the call was made from outside your account. + """ + affected_resources: dict[str, str] | None = ... + """ + The details of the Amazon Web Services account that made the API call. + This field identifies the resources that were affected by this API call. + """ + +@dataclass(kw_only=True) +class BadRequestException(ServiceError, _SerdeShape): + """A bad request exception object.""" + + type: str | None = ... + """The error type.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class BedrockGuardrail(_SerdeShape): + """ + Contains information about a Bedrock guardrail associated with a + finding. + """ + + arn: str | None = ... + """The ARN of the Bedrock guardrail.""" + version: str | None = ... + """The version of the Bedrock guardrail.""" + +@dataclass(kw_only=True) +class BedrockGuardrailDetails(_SerdeShape): + """ + Contains information about the Bedrock guardrail that was involved in a + finding. + """ + + guardrail_arn: str | None = ... + """ + The ARN of the Bedrock guardrail. This field is deprecated. Use the + `guardrails` list instead. + """ + guardrail_version: str | None = ... + """ + The version of the Bedrock guardrail. This field is deprecated. Use the + `guardrails` list instead. + """ + guardrails: list[BedrockGuardrail] | None = ... + """The list of Bedrock guardrails associated with the finding.""" + guardrail_action: str | None = ... + """Indicates whether the guardrail intervened or not.""" + guardrail_source: str | None = ... + """ + Indicates whether the guardrail was applied on the input or output of + the model invocation. + """ + content_policy_filters: list[ContentPolicyFilter] | None = ... + """ + The list of content policy filters that matched during the guardrail + evaluation. + """ + +@dataclass(kw_only=True) +class BedrockGuardrailResource(_SerdeShape): + """ + Contains details about an Amazon Bedrock guardrail evaluated during a + model invocation. + """ + + version: str | None = ... + """ + The version of the Amazon Bedrock guardrail. Valid values are a numeric + version, `DRAFT`, or `ENFORCED`. + """ + guardrail_action: str | None = ... + """Indicates whether the guardrail intervened during the model invocation.""" + guardrail_source: str | None = ... + """ + Indicates whether the guardrail was applied on the input or output of + the model invocation. + """ + +@dataclass(kw_only=True) +class BlockPublicAccess(_SerdeShape): + """ + Contains information on how the bucker owner's S3 Block Public Access + settings are being applied to the S3 bucket. See [S3 Block Public + Access](https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html) + for more information. + """ + + ignore_public_acls: bool | None = ... + """Indicates if S3 Block Public Access is set to `IgnorePublicAcls`.""" + restrict_public_buckets: bool | None = ... + """Indicates if S3 Block Public Access is set to `RestrictPublicBuckets`.""" + block_public_acls: bool | None = ... + """Indicates if S3 Block Public Access is set to `BlockPublicAcls`.""" + block_public_policy: bool | None = ... + """Indicates if S3 Block Public Access is set to `BlockPublicPolicy`.""" + +@dataclass(kw_only=True) +class BucketLevelPermissions(_SerdeShape): + """ + Contains information about the bucket level permissions for the S3 + bucket. + """ + + access_control_list: AccessControlList | None = ... + """ + Contains information on how Access Control Policies are applied to the + bucket. + """ + bucket_policy: BucketPolicy | None = ... + """Contains information on the bucket policies for the S3 bucket.""" + block_public_access: BlockPublicAccess | None = ... + """ + Contains information on which account level S3 Block Public Access + settings are applied to the S3 bucket. + """ + +@dataclass(kw_only=True) +class BucketPolicy(_SerdeShape): + """Contains information on the current bucket policies for the S3 bucket.""" + + allows_public_read_access: bool | None = ... + """ + A value that indicates whether public read access for the bucket is + enabled through a bucket policy. + """ + allows_public_write_access: bool | None = ... + """ + A value that indicates whether public write access for the bucket is + enabled through a bucket policy. + """ + +@dataclass(kw_only=True) +class City(_SerdeShape): + """Contains information about the city associated with the IP address.""" + + city_name: str | None = ... + """The city name of the remote IP address.""" + +@dataclass(kw_only=True) +class CloudDetails(_SerdeShape): + """ + Contains details about the cloud environment associated with an + investigation. + """ + + provider: str | None = ... + """The cloud provider. Currently, only `AWS` is supported.""" + region: str | None = ... + """ + The Amazon Web Services Region in which the investigated resource + resides. + """ + account: str | None = ... + """The Amazon Web Services account ID of the investigated resource.""" + +@dataclass(kw_only=True) +class CloudformationStack(_SerdeShape): + """ + Contains information about the CloudFormation stack involved in a + GuardDuty finding, including unique identifiers of the Amazon EC2 + instances. + """ + + ec2_instance_uids: list[str] | None = ... + """ + A list of unique identifiers for the compromised Amazon EC2 instances + that were created as part of the same CloudFormation stack. + """ + +class CloudProvider(UnknownEnumMixin, StrEnum): + AWS = "AWS" + +@dataclass(kw_only=True) +class CloudTrailConfigurationResult(_SerdeShape): + """ + Contains information on the status of CloudTrail as a data source for + the detector. + """ + + status: str | None = ... + """ + Describes whether CloudTrail is enabled as a data source for the + detector. + """ + +class ClusterStatus(UnknownEnumMixin, StrEnum): + CREATING = "CREATING" + ACTIVE = "ACTIVE" + DELETING = "DELETING" + FAILED = "FAILED" + UPDATING = "UPDATING" + PENDING = "PENDING" + +@dataclass(kw_only=True) +class Condition(_SerdeShape): + """Contains information about the condition.""" + + eq: list[str] | None = ... + """ + Represents the *equal* condition to be applied to a single field when + querying for findings. + + Max values: 50 + """ + neq: list[str] | None = ... + """ + Represents the *not equal* condition to be applied to a single field + when querying for findings. + + Max values: 50 + """ + gt: int | None = ... + """ + Represents a *greater than* condition to be applied to a single field + when querying for findings. + """ + gte: int | None = ... + """ + Represents a *greater than or equal* condition to be applied to a single + field when querying for findings. + """ + lt: int | None = ... + """ + Represents a *less than* condition to be applied to a single field when + querying for findings. + """ + lte: int | None = ... + """ + Represents a *less than or equal* condition to be applied to a single + field when querying for findings. + """ + equals: list[str] | None = ... + """ + Represents an *equal* condition to be applied to a single field when + querying for findings. + + Max values: 50 + """ + not_equals: list[str] | None = ... + """ + Represents a *not equal* condition to be applied to a single field when + querying for findings. + + Max values: 50 + """ + greater_than: int | None = ... + """ + Represents a *greater than* condition to be applied to a single field + when querying for findings. + """ + greater_than_or_equal: int | None = ... + """ + Represents a *greater than or equal* condition to be applied to a single + field when querying for findings. + """ + less_than: int | None = ... + """ + Represents a *less than* condition to be applied to a single field when + querying for findings. + """ + less_than_or_equal: int | None = ... + """ + Represents a *less than or equal* condition to be applied to a single + field when querying for findings. + """ + matches: list[str] | None = ... + """ + Represents the *match* condition to be applied to a single field when + querying for findings. + + Note: + The *matches* condition is available only for create-filter and + update-filter APIs. + """ + not_matches: list[str] | None = ... + """ + Represents the *not match* condition to be applied to a single field + when querying for findings. + + Note: + The *not-matches* condition is available only for create-filter and + update-filter APIs. + """ + +class Confidence(UnknownEnumMixin, StrEnum): + UNKNOWN = "Unknown" + LOW = "Low" + MEDIUM = "Medium" + HIGH = "High" + +class ConfidenceLevel(UnknownEnumMixin, StrEnum): + HIGH = "HIGH" + MEDIUM = "MEDIUM" + LOW = "LOW" + NONE = "NONE" + +@dataclass(kw_only=True) +class ConflictException(ServiceError, _SerdeShape): + """A request conflict exception object.""" + + type: str | None = ... + """The error type.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class Container(_SerdeShape): + """Details of a container.""" + + container_runtime: str | None = ... + """ + The container runtime (such as, Docker or containerd) used to run the + container. + """ + id: str | None = ... + """Container ID.""" + name: str | None = ... + """Container name.""" + image: str | None = ... + """Container image.""" + image_prefix: str | None = ... + """ + Part of the image name before the last slash. For example, imagePrefix + for public.ecr.aws/amazonlinux/amazonlinux:latest would be + public.ecr.aws/amazonlinux. If the image name is relative and does not + have a slash, this field is empty. + """ + volume_mounts: list[VolumeMount] | None = ... + """Container volume mounts.""" + security_context: SecurityContext | None = ... + """Container security context.""" + +@dataclass(kw_only=True) +class ContainerFindingResource(_SerdeShape): + """ + Contains information about container resources involved in a GuardDuty + finding. This structure provides details about containers that were + identified as part of suspicious or malicious activity. + """ + + image: str | None = ... + """ + The container image information, including the image name and tag used + to run the container that was involved in the finding. + """ + image_uid: str | None = ... + """The unique ID associated with the container image.""" + +@dataclass(kw_only=True) +class ContainerInstanceDetails(_SerdeShape): + """ + Contains information about the Amazon EC2 instance that is running the + Amazon ECS container. + """ + + covered_container_instances: int | None = ... + """ + Represents the nodes in the Amazon ECS cluster that has a `HEALTHY` + coverage status. + """ + compatible_container_instances: int | None = ... + """Represents total number of nodes in the Amazon ECS cluster.""" + +@dataclass(kw_only=True) +class ContentPolicyFilter(_SerdeShape): + """ + Contains information about a content policy filter that matched during a + guardrail evaluation. + """ + + type: str | None = ... + """The type of content that was filtered by the guardrail.""" + confidence: str | None = ... + """The confidence level that the content matched the filter.""" + action: str | None = ... + """The action taken by the guardrail filter.""" + +class ContentPolicyFilterAction(UnknownEnumMixin, StrEnum): + BLOCKED = "BLOCKED" + NONE = "NONE" + +class ContentPolicyFilterType(UnknownEnumMixin, StrEnum): + PROMPT_ATTACK = "PROMPT_ATTACK" + JAILBREAK = "JAILBREAK" + HATE = "HATE" + INSULTS = "INSULTS" + SEXUAL = "SEXUAL" + VIOLENCE = "VIOLENCE" + MISCONDUCT = "MISCONDUCT" + +@dataclass(kw_only=True) +class ContinuousScanDetails(_SerdeShape): + """ + Contains information about the time range within the continuous backup + in Amazon Web Services Backup to scan for a point-in-time recovery + resource. + """ + + start_time: datetime | None = ... + """ + The timestamp representing the start of the time range to scan. Reserved + for internal use. + """ + end_time: datetime + """The timestamp representing the end of the time range to scan.""" + +@dataclass(kw_only=True) +class Country(_SerdeShape): + """ + Contains information about the country where the remote IP address is + located. + """ + + country_code: str | None = ... + """The country code of the remote IP address.""" + country_name: str | None = ... + """The country name of the remote IP address.""" + +@dataclass(kw_only=True) +class CoverageEc2InstanceDetails(_SerdeShape): + """ + Contains information about the Amazon EC2 instance runtime coverage + details. + """ + + instance_id: str | None = ... + """The Amazon EC2 instance ID.""" + instance_type: str | None = ... + """The instance type of the Amazon EC2 instance.""" + cluster_arn: str | None = ... + """ + The cluster ARN of the Amazon ECS cluster running on the Amazon EC2 + instance. + """ + agent_details: AgentDetails | None = ... + """Information about the installed security agent.""" + management_type: str | None = ... + """ + Indicates how the GuardDuty security agent is managed for this resource. + + - `AUTO_MANAGED` indicates that GuardDuty deploys and manages updates + for this resource. + + - `MANUAL` indicates that you are responsible to deploy, update, and + manage the GuardDuty security agent updates for this resource. + + Note: + The `DISABLED` status doesn't apply to Amazon EC2 instances and Amazon + EKS clusters. + """ + +@dataclass(kw_only=True) +class CoverageEcsClusterDetails(_SerdeShape): + """Contains information about Amazon ECS cluster runtime coverage details.""" + + cluster_name: str | None = ... + """The name of the Amazon ECS cluster.""" + fargate_details: FargateDetails | None = ... + """ + Information about the Fargate details associated with the Amazon ECS + cluster. + """ + container_instance_details: ContainerInstanceDetails | None = ... + """ + Information about the Amazon ECS container running on Amazon EC2 + instance. + """ + +@dataclass(kw_only=True) +class CoverageEksClusterDetails(_SerdeShape): + """Information about the EKS cluster that has a coverage status.""" + + cluster_name: str | None = ... + """Name of the EKS cluster.""" + covered_nodes: int | None = ... + """ + Represents the nodes within the EKS cluster that have a `HEALTHY` + coverage status. + """ + compatible_nodes: int | None = ... + """Represents all the nodes within the EKS cluster in your account.""" + addon_details: AddonDetails | None = ... + """Information about the installed EKS add-on.""" + management_type: str | None = ... + """ + Indicates how the Amazon EKS add-on GuardDuty agent is managed for this + EKS cluster. + + `AUTO_MANAGED` indicates GuardDuty deploys and manages updates for this + resource. + + `MANUAL` indicates that you are responsible to deploy, update, and + manage the Amazon EKS add-on GuardDuty agent for this resource. + """ + +@dataclass(kw_only=True) +class CoverageFilterCondition(_SerdeShape): + """ + Represents a condition that when matched will be added to the response + of the operation. + """ + + equals: list[str] | None = ... + """ + Represents an equal condition that is applied to a single field while + retrieving the coverage details. + """ + not_equals: list[str] | None = ... + """ + Represents a not equal condition that is applied to a single field while + retrieving the coverage details. + """ + +@dataclass(kw_only=True) +class CoverageFilterCriteria(_SerdeShape): + """Represents the criteria used in the filter.""" + + filter_criterion: list[CoverageFilterCriterion] | None = ... + """ + Represents a condition that when matched will be added to the response + of the operation. + """ + +@dataclass(kw_only=True) +class CoverageFilterCriterion(_SerdeShape): + """ + Represents a condition that when matched will be added to the response + of the operation. + """ + + criterion_key: str | None = ... + """ + An enum value representing possible filter fields. + + Note: + Replace the enum value `CLUSTER_NAME` with `EKS_CLUSTER_NAME`. + `CLUSTER_NAME` has been deprecated. + """ + filter_condition: CoverageFilterCondition | None = ... + """Contains information about the condition.""" + +class CoverageFilterCriterionKey(UnknownEnumMixin, StrEnum): + ACCOUNT_ID = "ACCOUNT_ID" + RESOURCE_TYPE = "RESOURCE_TYPE" + COVERAGE_STATUS = "COVERAGE_STATUS" + ADDON_VERSION = "ADDON_VERSION" + CLUSTER_NAME = "CLUSTER_NAME" + ECS_CLUSTER_NAME = "ECS_CLUSTER_NAME" + MANAGEMENT_TYPE = "MANAGEMENT_TYPE" + EKS_CLUSTER_NAME = "EKS_CLUSTER_NAME" + AGENT_VERSION = "AGENT_VERSION" + INSTANCE_ID = "INSTANCE_ID" + CLUSTER_ARN = "CLUSTER_ARN" + +@dataclass(kw_only=True) +class CoverageResource(_SerdeShape): + """Information about the resource of the GuardDuty account.""" + + resource_id: str | None = ... + """The unique ID of the resource.""" + detector_id: str | None = ... + """The unique ID of the GuardDuty detector associated with the resource.""" + account_id: str | None = ... + """The unique ID of the Amazon Web Services account.""" + resource_details: CoverageResourceDetails | None = ... + """ + Information about the resource for which the coverage statistics are + retrieved. + """ + coverage_status: str | None = ... + """Represents the status of the EKS cluster coverage.""" + issue: str | None = ... + """ + Represents the reason why a coverage status was `UNHEALTHY` for the EKS + cluster. + """ + updated_at: datetime | None = ... + """ + The timestamp at which the coverage details for the resource were last + updated. This is in UTC format. + """ + +@dataclass(kw_only=True) +class CoverageResourceDetails(_SerdeShape): + """Information about the resource for each individual EKS cluster.""" + + eks_cluster_details: CoverageEksClusterDetails | None = ... + """EKS cluster details involved in the coverage statistics.""" + ecs_cluster_details: CoverageEcsClusterDetails | None = ... + """ + Information about the Amazon ECS cluster that is assessed for runtime + coverage. + """ + ec2_instance_details: CoverageEc2InstanceDetails | None = ... + """Information about the Amazon EC2 instance assessed for runtime coverage.""" + resource_type: str | None = ... + """The type of Amazon Web Services resource.""" + +@dataclass(kw_only=True) +class CoverageSortCriteria(_SerdeShape): + """Information about the sorting criteria used in the coverage statistics.""" + + attribute_name: str | None = ... + """ + Represents the field name used to sort the coverage details. + + Note: + Replace the enum value `CLUSTER_NAME` with `EKS_CLUSTER_NAME`. + `CLUSTER_NAME` has been deprecated. + """ + order_by: str | None = ... + """The order in which the sorted findings are to be displayed.""" + +class CoverageSortKey(UnknownEnumMixin, StrEnum): + ACCOUNT_ID = "ACCOUNT_ID" + COVERAGE_STATUS = "COVERAGE_STATUS" + ISSUE = "ISSUE" + ADDON_VERSION = "ADDON_VERSION" + UPDATED_AT = "UPDATED_AT" + CLUSTER_NAME = "CLUSTER_NAME" + EKS_CLUSTER_NAME = "EKS_CLUSTER_NAME" + ECS_CLUSTER_NAME = "ECS_CLUSTER_NAME" + INSTANCE_ID = "INSTANCE_ID" + +@dataclass(kw_only=True) +class CoverageStatistics(_SerdeShape): + """Information about the coverage statistics for a resource.""" + + count_by_resource_type: dict[str, int] | None = ... + """ + Represents coverage statistics for EKS clusters aggregated by resource + type. + """ + count_by_coverage_status: dict[str, int] | None = ... + """ + Represents coverage statistics for EKS clusters aggregated by coverage + status. + """ + +class CoverageStatisticsType(UnknownEnumMixin, StrEnum): + COUNT_BY_RESOURCE_TYPE = "COUNT_BY_RESOURCE_TYPE" + COUNT_BY_COVERAGE_STATUS = "COUNT_BY_COVERAGE_STATUS" + +class CoverageStatus(UnknownEnumMixin, StrEnum): + HEALTHY = "HEALTHY" + UNHEALTHY = "UNHEALTHY" + +@dataclass(kw_only=True) +class CreateCustomDetectionRuleAssociationInput(_SerdeShape): + """Dataclass for CreateCustomDetectionRuleAssociationInput structure.""" + + rule_id: str | None = ... + """The unique identifier for the custom detection rule.""" + mode: str | None = ... + """The rule execution mode. Valid values: `LIVE` | `DRY_RUN`.""" + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the operation + completes no more than one time. Maximum 64 characters. + """ + tags: dict[str, str] | None = ... + """ + The tags to be added to the new custom detection rule association + resource. + """ + +@dataclass(kw_only=True) +class CreateCustomDetectionRuleAssociationOutput(_SerdeShape): + """Dataclass for CreateCustomDetectionRuleAssociationOutput structure.""" + + rule_association: AssociationDetail | None = ... + """The details of the newly created custom detection rule association.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateCustomDetectionRuleOrgConfigurationInput(_SerdeShape): + """Dataclass for CreateCustomDetectionRuleOrgConfigurationInput structure.""" + + rule_id: str | None = ... + """The unique identifier for the custom detection rule.""" + mode: str | None = ... + """ + The execution mode of the organization configuration. Valid values: + `LIVE` | `DRY_RUN`. + """ + include_account_ids: list[str] | None = ... + """ + The account IDs to include in the organization configuration. Mutually + exclusive with `ExcludeAccountIds`. + """ + exclude_account_ids: list[str] | None = ... + """ + The account IDs to exclude from the organization configuration. Mutually + exclusive with `IncludeAccountIds`. + """ + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure that the operation + completes no more than one time. + """ + +@dataclass(kw_only=True) +class CreateCustomDetectionRuleOrgConfigurationOutput(_SerdeShape): + """Dataclass for CreateCustomDetectionRuleOrgConfigurationOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateDetectorInput(_SerdeShape): + """Dataclass for CreateDetectorInput structure.""" + + enable: bool | None = ... + """A Boolean value that specifies whether the detector is to be enabled.""" + client_token: str | None = ... + """The idempotency token for the create request.""" + finding_publishing_frequency: str | None = ... + """A value that specifies how frequently updated findings are exported.""" + data_sources: DataSourceConfigurations | None = ... + """ + Describes which data sources will be enabled for the detector. + + There might be regional differences because some data sources might not + be available in all the Amazon Web Services Regions where GuardDuty is + presently supported. For more information, see [Regions and + endpoints](https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_regions.html). + """ + tags: dict[str, str] | None = ... + """The tags to be added to a new detector resource.""" + features: list[DetectorFeatureConfiguration] | None = ... + """A list of features that will be configured for the detector.""" + +@dataclass(kw_only=True) +class CreateDetectorOutput(_SerdeShape): + """Dataclass for CreateDetectorOutput structure.""" + + detector_id: str | None = ... + """The unique ID of the created detector.""" + unprocessed_data_sources: UnprocessedDataSourcesResult | None = ... + """ + Specifies the data sources that couldn't be enabled when GuardDuty was + enabled for the first time. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateFilterInput(_SerdeShape): + """Dataclass for CreateFilterInput structure.""" + + detector_id: str | None = ... + """ + The detector ID associated with the GuardDuty account for which you want + to create a filter. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + name: str | None = ... + """ + The name of the filter. Valid characters include period (.), underscore + (_), dash (-), and alphanumeric characters. A whitespace is considered + to be an invalid character. + """ + description: str | None = ... + """ + The description of the filter. Valid characters include alphanumeric + characters, and special characters such as hyphen, period, colon, + underscore, parentheses (`{ }`, `[ ]`, and `( )`), forward slash, + horizontal tab, vertical tab, newline, form feed, return, and + whitespace. + """ + action: str | None = ... + """ + Specifies the action that is to be applied to the findings that match + the filter. + + Default: NOOP + """ + rank: int | None = ... + """ + Specifies the position of the filter in the list of current filters. + Also specifies the order in which this filter is applied to the + findings. + """ + finding_criteria: FindingCriteria | None = ... + """ + Represents the criteria to be used in the filter for querying findings. + The following fields are available for filtering: + + - accountId + + - arn + + - associatedAttackSequenceArn + + - confidence + + - createdAt + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - id + + - partition + + - region + + - resource.accessKeyDetails.accessKeyId + + - resource.accessKeyDetails.principalId + + - resource.accessKeyDetails.userIdentity.accessKeyId + + - resource.accessKeyDetails.userIdentity.accountId + + - resource.accessKeyDetails.userIdentity.arn + + - resource.accessKeyDetails.userIdentity.principalId + + - resource.accessKeyDetails.userIdentity.sessionContext.attributes.mfaAuthenticated + + - resource.accessKeyDetails.userIdentity.sessionContext.ec2RoleDelivery + + - resource.accessKeyDetails.userIdentity.sessionContext.invokedBy + + - resource.accessKeyDetails.userIdentity.sessionContext.sessionIssuer.accountId + + - resource.accessKeyDetails.userIdentity.sessionContext.sessionIssuer.arn + + - resource.accessKeyDetails.userIdentity.sessionContext.sessionIssuer.principalId + + - resource.accessKeyDetails.userIdentity.sessionContext.sessionIssuer.type + + - resource.accessKeyDetails.userIdentity.sessionContext.sessionIssuer.userName + + - resource.accessKeyDetails.userIdentity.sessionContext.sourceIdentity + + - resource.accessKeyDetails.userIdentity.sessionContext.webIdFederationData.attributes + + - resource.accessKeyDetails.userIdentity.sessionContext.webIdFederationData.federatedProvider + + - resource.accessKeyDetails.userIdentity.type + + - resource.accessKeyDetails.userIdentity.userName + + - resource.accessKeyDetails.userName + + - resource.accessKeyDetails.userType + + - resource.bedrockGuardrailDetails.guardrailArn + + - resource.bedrockGuardrailDetails.guardrailVersion + + - resource.containerDetails.containerRuntime + + - resource.containerDetails.id + + - resource.containerDetails.image + + - resource.containerDetails.imagePrefix + + - resource.containerDetails.name + + - resource.containerDetails.securityContext.allowPrivilegeEscalation + + - resource.containerDetails.securityContext.privileged + + - resource.containerDetails.volumeMounts.mountPath + + - resource.containerDetails.volumeMounts.name + + - resource.ebsSnapshotDetails.snapshotArn + + - resource.ebsVolumeDetails.scannedVolumeDetails.deviceName + + - resource.ebsVolumeDetails.scannedVolumeDetails.encryptionType + + - resource.ebsVolumeDetails.scannedVolumeDetails.kmsKeyArn + + - resource.ebsVolumeDetails.scannedVolumeDetails.snapshotArn + + - resource.ebsVolumeDetails.scannedVolumeDetails.volumeArn + + - resource.ebsVolumeDetails.scannedVolumeDetails.volumeSizeInGB + + - resource.ebsVolumeDetails.scannedVolumeDetails.volumeType + + - resource.ebsVolumeDetails.skippedVolumeDetails.deviceName + + - resource.ebsVolumeDetails.skippedVolumeDetails.encryptionType + + - resource.ebsVolumeDetails.skippedVolumeDetails.kmsKeyArn + + - resource.ebsVolumeDetails.skippedVolumeDetails.snapshotArn + + - resource.ebsVolumeDetails.skippedVolumeDetails.volumeArn + + - resource.ebsVolumeDetails.skippedVolumeDetails.volumeSizeInGB + + - resource.ebsVolumeDetails.skippedVolumeDetails.volumeType + + - resource.ec2ImageDetails.imageArn + + - resource.ecsClusterDetails.activeServicesCount + + - resource.ecsClusterDetails.arn + + - resource.ecsClusterDetails.name + + - resource.ecsClusterDetails.registeredContainerInstancesCount + + - resource.ecsClusterDetails.runningTasksCount + + - resource.ecsClusterDetails.status + + - resource.ecsClusterDetails.tags.key + + - resource.ecsClusterDetails.tags.value + + - resource.ecsClusterDetails.taskDetails.arn + + - resource.ecsClusterDetails.taskDetails.containers.containerRuntime + + - resource.ecsClusterDetails.taskDetails.containers.id + + - resource.ecsClusterDetails.taskDetails.containers.image + + - resource.ecsClusterDetails.taskDetails.containers.imagePrefix + + - resource.ecsClusterDetails.taskDetails.containers.name + + - resource.ecsClusterDetails.taskDetails.containers.securityContext.allowPrivilegeEscalation + + - resource.ecsClusterDetails.taskDetails.containers.securityContext.privileged + + - resource.ecsClusterDetails.taskDetails.containers.volumeMounts.mountPath + + - resource.ecsClusterDetails.taskDetails.containers.volumeMounts.name + + - resource.ecsClusterDetails.taskDetails.createdAt + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - resource.ecsClusterDetails.taskDetails.definitionArn + + - resource.ecsClusterDetails.taskDetails.group + + - resource.ecsClusterDetails.taskDetails.launchType + + - resource.ecsClusterDetails.taskDetails.startedAt + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - resource.ecsClusterDetails.taskDetails.startedBy + + - resource.ecsClusterDetails.taskDetails.tags.key + + - resource.ecsClusterDetails.taskDetails.tags.value + + - resource.ecsClusterDetails.taskDetails.version + + - resource.ecsClusterDetails.taskDetails.volumes.hostPath.path + + - resource.ecsClusterDetails.taskDetails.volumes.name + + - resource.eksClusterDetails.arn + + - resource.eksClusterDetails.createdAt + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - resource.eksClusterDetails.name + + - resource.eksClusterDetails.status + + - resource.eksClusterDetails.tags.key + + - resource.eksClusterDetails.tags.value + + - resource.eksClusterDetails.vpcId + + - resource.instanceDetails.availabilityZone + + - resource.instanceDetails.iamInstanceProfile.arn + + - resource.instanceDetails.iamInstanceProfile.id + + - resource.instanceDetails.imageDescription + + - resource.instanceDetails.imageId + + - resource.instanceDetails.instanceId + + - resource.instanceDetails.instanceState + + - resource.instanceDetails.instanceType + + - resource.instanceDetails.launchTime + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - resource.instanceDetails.networkInterfaces.ipv6Addresses + + - resource.instanceDetails.networkInterfaces.networkInterfaceId + + - resource.instanceDetails.networkInterfaces.privateDnsName + + - resource.instanceDetails.networkInterfaces.privateIpAddress + + - resource.instanceDetails.networkInterfaces.privateIpAddresses.privateDnsName + + - resource.instanceDetails.networkInterfaces.privateIpAddresses.privateIpAddress + + - resource.instanceDetails.networkInterfaces.publicDnsName + + - resource.instanceDetails.networkInterfaces.publicIp + + - resource.instanceDetails.networkInterfaces.securityGroups.groupId + + - resource.instanceDetails.networkInterfaces.securityGroups.groupName + + - resource.instanceDetails.networkInterfaces.subnetId + + - resource.instanceDetails.networkInterfaces.vpcId + + - resource.instanceDetails.outpostArn + + - resource.instanceDetails.platform + + - resource.instanceDetails.productCodes.productCodeId + + - resource.instanceDetails.productCodes.productCodeType + + - resource.instanceDetails.tags.key + + - resource.instanceDetails.tags.value + + - resource.kubernetesDetails.kubernetesUserDetails.groups + + - resource.kubernetesDetails.kubernetesUserDetails.impersonatedUser.groups + + - resource.kubernetesDetails.kubernetesUserDetails.impersonatedUser.username + + - resource.kubernetesDetails.kubernetesUserDetails.sessionName + + - resource.kubernetesDetails.kubernetesUserDetails.uid + + - resource.kubernetesDetails.kubernetesUserDetails.username + + - resource.kubernetesDetails.kubernetesWorkloadDetails.containers.containerRuntime + + - resource.kubernetesDetails.kubernetesWorkloadDetails.containers.id + + - resource.kubernetesDetails.kubernetesWorkloadDetails.containers.image + + - resource.kubernetesDetails.kubernetesWorkloadDetails.containers.imagePrefix + + - resource.kubernetesDetails.kubernetesWorkloadDetails.containers.name + + - resource.kubernetesDetails.kubernetesWorkloadDetails.containers.securityContext.allowPrivilegeEscalation + + - resource.kubernetesDetails.kubernetesWorkloadDetails.containers.securityContext.privileged + + - resource.kubernetesDetails.kubernetesWorkloadDetails.containers.volumeMounts.mountPath + + - resource.kubernetesDetails.kubernetesWorkloadDetails.containers.volumeMounts.name + + - resource.kubernetesDetails.kubernetesWorkloadDetails.hostIpc + + - resource.kubernetesDetails.kubernetesWorkloadDetails.hostNetwork + + - resource.kubernetesDetails.kubernetesWorkloadDetails.hostPid + + - resource.kubernetesDetails.kubernetesWorkloadDetails.name + + - resource.kubernetesDetails.kubernetesWorkloadDetails.namespace + + - resource.kubernetesDetails.kubernetesWorkloadDetails.serviceAccountName + + - resource.kubernetesDetails.kubernetesWorkloadDetails.type + + - resource.kubernetesDetails.kubernetesWorkloadDetails.uid + + - resource.kubernetesDetails.kubernetesWorkloadDetails.volumes.hostPath.path + + - resource.kubernetesDetails.kubernetesWorkloadDetails.volumes.name + + - resource.lambdaDetails.description + + - resource.lambdaDetails.functionArn + + - resource.lambdaDetails.functionName + + - resource.lambdaDetails.functionVersion + + - resource.lambdaDetails.lastModifiedAt + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - resource.lambdaDetails.revisionId + + - resource.lambdaDetails.role + + - resource.lambdaDetails.tags.key + + - resource.lambdaDetails.tags.value + + - resource.lambdaDetails.vpcConfig.securityGroups.groupId + + - resource.lambdaDetails.vpcConfig.securityGroups.groupName + + - resource.lambdaDetails.vpcConfig.subnetIds + + - resource.lambdaDetails.vpcConfig.vpcId + + - resource.rdsDbInstanceDetails.dbClusterIdentifier + + - resource.rdsDbInstanceDetails.dbInstanceArn + + - resource.rdsDbInstanceDetails.dbInstanceIdentifier + + - resource.rdsDbInstanceDetails.dbSecurityGroups.name + + - resource.rdsDbInstanceDetails.dbSecurityGroups.status + + - resource.rdsDbInstanceDetails.dbiResourceId + + - resource.rdsDbInstanceDetails.engine + + - resource.rdsDbInstanceDetails.engineVersion + + - resource.rdsDbInstanceDetails.iamDatabaseAuthenticationEnabled + + - resource.rdsDbInstanceDetails.publiclyAccessible + + - resource.rdsDbInstanceDetails.vpcId + + - resource.rdsDbInstanceDetails.vpcSecurityGroups.status + + - resource.rdsDbInstanceDetails.vpcSecurityGroups.vpcSecurityGroupId + + - resource.rdsDbUserDetails.application + + - resource.rdsDbUserDetails.authMethod + + - resource.rdsDbUserDetails.database + + - resource.rdsDbUserDetails.ssl + + - resource.rdsDbUserDetails.user + + - resource.rdsLimitlessDbDetails.dbClusterIdentifier + + - resource.rdsLimitlessDbDetails.dbShardGroupArn + + - resource.rdsLimitlessDbDetails.dbShardGroupIdentifier + + - resource.rdsLimitlessDbDetails.dbShardGroupResourceId + + - resource.rdsLimitlessDbDetails.engine + + - resource.rdsLimitlessDbDetails.engineVersion + + - resource.rdsLimitlessDbDetails.tags.key + + - resource.rdsLimitlessDbDetails.tags.value + + - resource.recoveryPointDetails.backupVaultName + + - resource.recoveryPointDetails.recoveryPointArn + + - resource.resourceType + + - resource.s3BucketDetails.arn + + - resource.s3BucketDetails.createdAt + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - resource.s3BucketDetails.defaultServerSideEncryption.encryptionType + + - resource.s3BucketDetails.defaultServerSideEncryption.kmsMasterKeyArn + + - resource.s3BucketDetails.name + + - resource.s3BucketDetails.owner.id + + - resource.s3BucketDetails.publicAccess.effectivePermission + + - resource.s3BucketDetails.publicAccess.permissionConfiguration.accountLevelPermissions.blockPublicAccess.blockPublicAcls + + - resource.s3BucketDetails.publicAccess.permissionConfiguration.accountLevelPermissions.blockPublicAccess.blockPublicPolicy + + - resource.s3BucketDetails.publicAccess.permissionConfiguration.accountLevelPermissions.blockPublicAccess.ignorePublicAcls + + - resource.s3BucketDetails.publicAccess.permissionConfiguration.accountLevelPermissions.blockPublicAccess.restrictPublicBuckets + + - resource.s3BucketDetails.publicAccess.permissionConfiguration.bucketLevelPermissions.accessControlList.allowsPublicReadAccess + + - resource.s3BucketDetails.publicAccess.permissionConfiguration.bucketLevelPermissions.accessControlList.allowsPublicWriteAccess + + - resource.s3BucketDetails.publicAccess.permissionConfiguration.bucketLevelPermissions.blockPublicAccess.blockPublicAcls + + - resource.s3BucketDetails.publicAccess.permissionConfiguration.bucketLevelPermissions.blockPublicAccess.blockPublicPolicy + + - resource.s3BucketDetails.publicAccess.permissionConfiguration.bucketLevelPermissions.blockPublicAccess.ignorePublicAcls + + - resource.s3BucketDetails.publicAccess.permissionConfiguration.bucketLevelPermissions.blockPublicAccess.restrictPublicBuckets + + - resource.s3BucketDetails.publicAccess.permissionConfiguration.bucketLevelPermissions.bucketPolicy.allowsPublicReadAccess + + - resource.s3BucketDetails.publicAccess.permissionConfiguration.bucketLevelPermissions.bucketPolicy.allowsPublicWriteAccess + + - resource.s3BucketDetails.s3ObjectDetails.eTag + + - resource.s3BucketDetails.s3ObjectDetails.hash + + - resource.s3BucketDetails.s3ObjectDetails.key + + - resource.s3BucketDetails.s3ObjectDetails.objectArn + + - resource.s3BucketDetails.s3ObjectDetails.versionId + + - resource.s3BucketDetails.tags.key + + - resource.s3BucketDetails.tags.value + + - resource.s3BucketDetails.type + + - schemaVersion + + - service.action.actionType + + - service.action.awsApiCallAction.api + + - service.action.awsApiCallAction.callerType + + - service.action.awsApiCallAction.domainDetails.domain + + - service.action.awsApiCallAction.errorCode + + - service.action.awsApiCallAction.remoteAccountDetails.accountId + + - service.action.awsApiCallAction.remoteAccountDetails.affiliated + + - service.action.awsApiCallAction.remoteAccountDetails.awsServiceName + + - service.action.awsApiCallAction.remoteIpDetails.city.cityName + + - service.action.awsApiCallAction.remoteIpDetails.country.countryCode + + - service.action.awsApiCallAction.remoteIpDetails.country.countryName + + - service.action.awsApiCallAction.remoteIpDetails.geoLocation.lat + + - service.action.awsApiCallAction.remoteIpDetails.geoLocation.lon + + - service.action.awsApiCallAction.remoteIpDetails.ipAddressV4 + + - service.action.awsApiCallAction.remoteIpDetails.ipAddressV6 + + - service.action.awsApiCallAction.remoteIpDetails.organization.asn + + - service.action.awsApiCallAction.remoteIpDetails.organization.asnOrg + + - service.action.awsApiCallAction.remoteIpDetails.organization.isp + + - service.action.awsApiCallAction.remoteIpDetails.organization.org + + - service.action.awsApiCallAction.serviceName + + - service.action.awsApiCallAction.userAgent + + - service.action.dnsRequestAction.blocked + + - service.action.dnsRequestAction.domain + + - service.action.dnsRequestAction.domainWithSuffix + + - service.action.dnsRequestAction.protocol + + - service.action.dnsRequestAction.vpcOwnerAccountId + + - service.action.kubernetesApiCallAction.namespace + + - service.action.kubernetesApiCallAction.parameters + + - service.action.kubernetesApiCallAction.remoteIpDetails.city.cityName + + - service.action.kubernetesApiCallAction.remoteIpDetails.country.countryCode + + - service.action.kubernetesApiCallAction.remoteIpDetails.country.countryName + + - service.action.kubernetesApiCallAction.remoteIpDetails.geoLocation.lat + + - service.action.kubernetesApiCallAction.remoteIpDetails.geoLocation.lon + + - service.action.kubernetesApiCallAction.remoteIpDetails.ipAddressV4 + + - service.action.kubernetesApiCallAction.remoteIpDetails.ipAddressV6 + + - service.action.kubernetesApiCallAction.remoteIpDetails.organization.asn + + - service.action.kubernetesApiCallAction.remoteIpDetails.organization.asnOrg + + - service.action.kubernetesApiCallAction.remoteIpDetails.organization.isp + + - service.action.kubernetesApiCallAction.remoteIpDetails.organization.org + + - service.action.kubernetesApiCallAction.requestUri + + - service.action.kubernetesApiCallAction.resource + + - service.action.kubernetesApiCallAction.resourceName + + - service.action.kubernetesApiCallAction.sourceIPs + + - service.action.kubernetesApiCallAction.statusCode + + - service.action.kubernetesApiCallAction.subresource + + - service.action.kubernetesApiCallAction.userAgent + + - service.action.kubernetesApiCallAction.verb + + - service.action.kubernetesPermissionCheckedDetails.allowed + + - service.action.kubernetesPermissionCheckedDetails.namespace + + - service.action.kubernetesPermissionCheckedDetails.resource + + - service.action.kubernetesPermissionCheckedDetails.verb + + - service.action.kubernetesRoleBindingDetails.kind + + - service.action.kubernetesRoleBindingDetails.name + + - service.action.kubernetesRoleBindingDetails.roleRefKind + + - service.action.kubernetesRoleBindingDetails.roleRefName + + - service.action.kubernetesRoleBindingDetails.uid + + - service.action.kubernetesRoleDetails.kind + + - service.action.kubernetesRoleDetails.name + + - service.action.kubernetesRoleDetails.uid + + - service.action.networkConnectionAction.blocked + + - service.action.networkConnectionAction.connectionDirection + + - service.action.networkConnectionAction.localIpDetails.ipAddressV4 + + - service.action.networkConnectionAction.localIpDetails.ipAddressV6 + + - service.action.networkConnectionAction.localNetworkInterface + + - service.action.networkConnectionAction.localPortDetails.port + + - service.action.networkConnectionAction.localPortDetails.portName + + - service.action.networkConnectionAction.protocol + + - service.action.networkConnectionAction.remoteIpDetails.city.cityName + + - service.action.networkConnectionAction.remoteIpDetails.country.countryCode + + - service.action.networkConnectionAction.remoteIpDetails.country.countryName + + - service.action.networkConnectionAction.remoteIpDetails.geoLocation.lat + + - service.action.networkConnectionAction.remoteIpDetails.geoLocation.lon + + - service.action.networkConnectionAction.remoteIpDetails.ipAddressV4 + + - service.action.networkConnectionAction.remoteIpDetails.ipAddressV6 + + - service.action.networkConnectionAction.remoteIpDetails.organization.asn + + - service.action.networkConnectionAction.remoteIpDetails.organization.asnOrg + + - service.action.networkConnectionAction.remoteIpDetails.organization.isp + + - service.action.networkConnectionAction.remoteIpDetails.organization.org + + - service.action.networkConnectionAction.remotePortDetails.port + + - service.action.networkConnectionAction.remotePortDetails.portName + + - service.action.portProbeAction.blocked + + - service.action.portProbeAction.portProbeDetails.localIpDetails.ipAddressV4 + + - service.action.portProbeAction.portProbeDetails.localIpDetails.ipAddressV6 + + - service.action.portProbeAction.portProbeDetails.localPortDetails.port + + - service.action.portProbeAction.portProbeDetails.localPortDetails.portName + + - service.action.portProbeAction.portProbeDetails.remoteIpDetails.city.cityName + + - service.action.portProbeAction.portProbeDetails.remoteIpDetails.country.countryCode + + - service.action.portProbeAction.portProbeDetails.remoteIpDetails.country.countryName + + - service.action.portProbeAction.portProbeDetails.remoteIpDetails.geoLocation.lat + + - service.action.portProbeAction.portProbeDetails.remoteIpDetails.geoLocation.lon + + - service.action.portProbeAction.portProbeDetails.remoteIpDetails.ipAddressV4 + + - service.action.portProbeAction.portProbeDetails.remoteIpDetails.ipAddressV6 + + - service.action.portProbeAction.portProbeDetails.remoteIpDetails.organization.asn + + - service.action.portProbeAction.portProbeDetails.remoteIpDetails.organization.asnOrg + + - service.action.portProbeAction.portProbeDetails.remoteIpDetails.organization.isp + + - service.action.portProbeAction.portProbeDetails.remoteIpDetails.organization.org + + - service.action.rdsLoginAttemptAction.loginAttributes.application + + - service.action.rdsLoginAttemptAction.loginAttributes.failedLoginAttempts + + - service.action.rdsLoginAttemptAction.loginAttributes.successfulLoginAttempts + + - service.action.rdsLoginAttemptAction.loginAttributes.user + + - service.action.rdsLoginAttemptAction.remoteIpDetails.city.cityName + + - service.action.rdsLoginAttemptAction.remoteIpDetails.country.countryCode + + - service.action.rdsLoginAttemptAction.remoteIpDetails.country.countryName + + - service.action.rdsLoginAttemptAction.remoteIpDetails.geoLocation.lat + + - service.action.rdsLoginAttemptAction.remoteIpDetails.geoLocation.lon + + - service.action.rdsLoginAttemptAction.remoteIpDetails.ipAddressV4 + + - service.action.rdsLoginAttemptAction.remoteIpDetails.ipAddressV6 + + - service.action.rdsLoginAttemptAction.remoteIpDetails.organization.asn + + - service.action.rdsLoginAttemptAction.remoteIpDetails.organization.asnOrg + + - service.action.rdsLoginAttemptAction.remoteIpDetails.organization.isp + + - service.action.rdsLoginAttemptAction.remoteIpDetails.organization.org + + - service.additionalInfo.agentDetails.agentId + + - service.additionalInfo.agentDetails.agentVersion + + - service.additionalInfo.anomalies.anomalousAPIs + + - service.additionalInfo.authenticationMethod + + - service.additionalInfo.averagePacketSizeIn + + - service.additionalInfo.averagePacketSizeOut + + - service.additionalInfo.context + + - service.additionalInfo.domain + + - service.additionalInfo.inBytes + + - service.additionalInfo.localNetworkInterfaceOwner + + - service.additionalInfo.localPort + + - service.additionalInfo.outBytes + + - service.additionalInfo.packetsIn + + - service.additionalInfo.packetsOut + + - service.additionalInfo.policyArn + + - service.additionalInfo.policyName + + - service.additionalInfo.remotePort + + - service.additionalInfo.sample + + - service.additionalInfo.scannedPort + + - service.additionalInfo.threatFileSha256 + + - service.additionalInfo.threatListName + + - service.additionalInfo.threatName + + - service.additionalInfo.totalBytesIn + + - service.additionalInfo.totalBytesOut + + - service.additionalInfo.type + + - service.additionalInfo.unusual.asnOrg + + - service.additionalInfo.unusual.port + + - service.additionalInfo.unusualProtocol + + - service.additionalInfo.userAgent.fullUserAgent + + - service.additionalInfo.userAgent.userAgentCategory + + - service.additionalInfo.value + + - service.additionalInfo.vpcOwnerAccountId + + - service.archived + + - service.count + + - service.detection.sequence.actors.id + + - service.detection.sequence.actors.process.name + + - service.detection.sequence.actors.process.path + + - service.detection.sequence.actors.process.sha256 + + - service.detection.sequence.actors.session.createdTime + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - service.detection.sequence.actors.session.issuer + + - service.detection.sequence.actors.session.mfaStatus + + - service.detection.sequence.actors.session.uid + + - service.detection.sequence.actors.user.account.account + + - service.detection.sequence.actors.user.account.uid + + - service.detection.sequence.actors.user.credentialUid + + - service.detection.sequence.actors.user.name + + - service.detection.sequence.actors.user.type + + - service.detection.sequence.actors.user.uid + + - service.detection.sequence.additionalSequenceTypes + + - service.detection.sequence.description + + - service.detection.sequence.endpoints.autonomousSystem.name + + - service.detection.sequence.endpoints.autonomousSystem.number + + - service.detection.sequence.endpoints.connection.direction + + - service.detection.sequence.endpoints.domain + + - service.detection.sequence.endpoints.id + + - service.detection.sequence.endpoints.ip + + - service.detection.sequence.endpoints.location.city + + - service.detection.sequence.endpoints.location.country + + - service.detection.sequence.endpoints.location.lat + + - service.detection.sequence.endpoints.location.lon + + - service.detection.sequence.endpoints.port + + - service.detection.sequence.resources.accountId + + - service.detection.sequence.resources.cloudPartition + + - service.detection.sequence.resources.data.accessKey.principalId + + - service.detection.sequence.resources.data.accessKey.userName + + - service.detection.sequence.resources.data.accessKey.userType + + - service.detection.sequence.resources.data.autoscalingAutoScalingGroup.ec2InstanceUids + + - service.detection.sequence.resources.data.cloudformationStack.ec2InstanceUids + + - service.detection.sequence.resources.data.container.image + + - service.detection.sequence.resources.data.container.imageUid + + - service.detection.sequence.resources.data.ec2Image.ec2InstanceUids + + - service.detection.sequence.resources.data.ec2Instance.availabilityZone + + - service.detection.sequence.resources.data.ec2Instance.ec2NetworkInterfaceUids + + - service.detection.sequence.resources.data.ec2Instance.iamInstanceProfile.arn + + - service.detection.sequence.resources.data.ec2Instance.iamInstanceProfile.id + + - service.detection.sequence.resources.data.ec2Instance.imageDescription + + - service.detection.sequence.resources.data.ec2Instance.instanceState + + - service.detection.sequence.resources.data.ec2Instance.instanceType + + - service.detection.sequence.resources.data.ec2Instance.outpostArn + + - service.detection.sequence.resources.data.ec2Instance.platform + + - service.detection.sequence.resources.data.ec2Instance.productCodes.productCodeId + + - service.detection.sequence.resources.data.ec2Instance.productCodes.productCodeType + + - service.detection.sequence.resources.data.ec2LaunchTemplate.ec2InstanceUids + + - service.detection.sequence.resources.data.ec2LaunchTemplate.version + + - service.detection.sequence.resources.data.ec2NetworkInterface.ipv6Addresses + + - service.detection.sequence.resources.data.ec2NetworkInterface.privateIpAddresses.privateDnsName + + - service.detection.sequence.resources.data.ec2NetworkInterface.privateIpAddresses.privateIpAddress + + - service.detection.sequence.resources.data.ec2NetworkInterface.publicIp + + - service.detection.sequence.resources.data.ec2NetworkInterface.securityGroups.groupId + + - service.detection.sequence.resources.data.ec2NetworkInterface.securityGroups.groupName + + - service.detection.sequence.resources.data.ec2NetworkInterface.subNetId + + - service.detection.sequence.resources.data.ec2NetworkInterface.vpcId + + - service.detection.sequence.resources.data.ec2Vpc.ec2InstanceUids + + - service.detection.sequence.resources.data.ecsCluster.ec2InstanceUids + + - service.detection.sequence.resources.data.ecsCluster.status + + - service.detection.sequence.resources.data.ecsTask.containerUids + + - service.detection.sequence.resources.data.ecsTask.createdAt + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - service.detection.sequence.resources.data.ecsTask.launchType + + - service.detection.sequence.resources.data.ecsTask.taskDefinitionArn + + - service.detection.sequence.resources.data.eksCluster.arn + + - service.detection.sequence.resources.data.eksCluster.createdAt + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - service.detection.sequence.resources.data.eksCluster.ec2InstanceUids + + - service.detection.sequence.resources.data.eksCluster.status + + - service.detection.sequence.resources.data.eksCluster.vpcId + + - service.detection.sequence.resources.data.iamInstanceProfile.ec2InstanceUids + + - service.detection.sequence.resources.data.iamInstanceProfile.id + + - service.detection.sequence.resources.data.kubernetesWorkload.containerUids + + - service.detection.sequence.resources.data.kubernetesWorkload.namespace + + - service.detection.sequence.resources.data.kubernetesWorkload.type + + - service.detection.sequence.resources.data.s3Bucket.accountPublicAccess.publicAclAccess + + - service.detection.sequence.resources.data.s3Bucket.accountPublicAccess.publicAclIgnoreBehavior + + - service.detection.sequence.resources.data.s3Bucket.accountPublicAccess.publicBucketRestrictBehavior + + - service.detection.sequence.resources.data.s3Bucket.accountPublicAccess.publicPolicyAccess + + - service.detection.sequence.resources.data.s3Bucket.bucketPublicAccess.publicAclAccess + + - service.detection.sequence.resources.data.s3Bucket.bucketPublicAccess.publicAclIgnoreBehavior + + - service.detection.sequence.resources.data.s3Bucket.bucketPublicAccess.publicBucketRestrictBehavior + + - service.detection.sequence.resources.data.s3Bucket.bucketPublicAccess.publicPolicyAccess + + - service.detection.sequence.resources.data.s3Bucket.createdAt + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - service.detection.sequence.resources.data.s3Bucket.effectivePermission + + - service.detection.sequence.resources.data.s3Bucket.encryptionKeyArn + + - service.detection.sequence.resources.data.s3Bucket.encryptionType + + - service.detection.sequence.resources.data.s3Bucket.ownerId + + - service.detection.sequence.resources.data.s3Bucket.publicReadAccess + + - service.detection.sequence.resources.data.s3Bucket.publicWriteAccess + + - service.detection.sequence.resources.data.s3Bucket.s3ObjectUids + + - service.detection.sequence.resources.data.s3Object.eTag + + - service.detection.sequence.resources.data.s3Object.key + + - service.detection.sequence.resources.data.s3Object.versionId + + - service.detection.sequence.resources.name + + - service.detection.sequence.resources.region + + - service.detection.sequence.resources.resourceType + + - service.detection.sequence.resources.service + + - service.detection.sequence.resources.tags.key + + - service.detection.sequence.resources.tags.value + + - service.detection.sequence.resources.uid + + - service.detection.sequence.sequenceIndicators.key + + - service.detection.sequence.sequenceIndicators.title + + - service.detection.sequence.sequenceIndicators.values + + - service.detection.sequence.signals.actorIds + + - service.detection.sequence.signals.count + + - service.detection.sequence.signals.createdAt + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - service.detection.sequence.signals.description + + - service.detection.sequence.signals.endpointIds + + - service.detection.sequence.signals.firstSeenAt + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - service.detection.sequence.signals.lastSeenAt + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - service.detection.sequence.signals.name + + - service.detection.sequence.signals.resourceUids + + - service.detection.sequence.signals.severity + + - service.detection.sequence.signals.signalIndicators.key + + - service.detection.sequence.signals.signalIndicators.title + + - service.detection.sequence.signals.signalIndicators.values + + - service.detection.sequence.signals.type + + - service.detection.sequence.signals.uid + + - service.detection.sequence.signals.updatedAt + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - service.detection.sequence.uid + + - service.detectorId + + - service.ebsVolumeScanDetails.scanCompletedAt + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - service.ebsVolumeScanDetails.scanDetections.highestSeverityThreatDetails.count + + - service.ebsVolumeScanDetails.scanDetections.highestSeverityThreatDetails.severity + + - service.ebsVolumeScanDetails.scanDetections.highestSeverityThreatDetails.threatName + + - service.ebsVolumeScanDetails.scanDetections.scannedItemCount.files + + - service.ebsVolumeScanDetails.scanDetections.scannedItemCount.totalGb + + - service.ebsVolumeScanDetails.scanDetections.scannedItemCount.volumes + + - service.ebsVolumeScanDetails.scanDetections.threatDetectedByName.itemCount + + - service.ebsVolumeScanDetails.scanDetections.threatDetectedByName.shortened + + - service.ebsVolumeScanDetails.scanDetections.threatDetectedByName.threatNames.filePaths.fileName + + - service.ebsVolumeScanDetails.scanDetections.threatDetectedByName.threatNames.filePaths.filePath + + - service.ebsVolumeScanDetails.scanDetections.threatDetectedByName.threatNames.filePaths.hash + + - service.ebsVolumeScanDetails.scanDetections.threatDetectedByName.threatNames.filePaths.volumeArn + + - service.ebsVolumeScanDetails.scanDetections.threatDetectedByName.threatNames.itemCount + + - service.ebsVolumeScanDetails.scanDetections.threatDetectedByName.threatNames.name + + - service.ebsVolumeScanDetails.scanDetections.threatDetectedByName.threatNames.severity + + - service.ebsVolumeScanDetails.scanDetections.threatDetectedByName.uniqueThreatNameCount + + - service.ebsVolumeScanDetails.scanDetections.threatsDetectedItemCount.files + + - service.ebsVolumeScanDetails.scanId + + - service.ebsVolumeScanDetails.scanStartedAt + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - service.ebsVolumeScanDetails.scanType + + - service.ebsVolumeScanDetails.sources + + - service.ebsVolumeScanDetails.triggerFindingId + + - service.eventFirstSeen + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - service.eventLastSeen + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - service.evidence.threatIntelligenceDetails.threatFileSha256 + + - service.evidence.threatIntelligenceDetails.threatListName + + - service.evidence.threatIntelligenceDetails.threatNames + + - service.featureName + + - service.malwareScanDetails.scanCategory + + - service.malwareScanDetails.scanConfiguration.incrementalScanDetails.baselineResourceArn + + - service.malwareScanDetails.scanConfiguration.triggerType + + - service.malwareScanDetails.scanId + + - service.malwareScanDetails.scanType + + - service.malwareScanDetails.threats.count + + - service.malwareScanDetails.threats.hash + + - service.malwareScanDetails.threats.itemDetails.additionalInfo.deviceName + + - service.malwareScanDetails.threats.itemDetails.additionalInfo.versionId + + - service.malwareScanDetails.threats.itemDetails.hash + + - service.malwareScanDetails.threats.itemDetails.itemPath + + - service.malwareScanDetails.threats.itemDetails.resourceArn + + - service.malwareScanDetails.threats.itemPaths.hash + + - service.malwareScanDetails.threats.itemPaths.nestedItemPath + + - service.malwareScanDetails.threats.name + + - service.malwareScanDetails.threats.source + + - service.malwareScanDetails.uniqueThreatCount + + - service.resourceRole + + - service.runtimeDetails.context.addressFamily + + - service.runtimeDetails.context.commandLineExample + + - service.runtimeDetails.context.fileOperation + + - service.runtimeDetails.context.filePath + + - service.runtimeDetails.context.fileSystemType + + - service.runtimeDetails.context.flags + + - service.runtimeDetails.context.ianaProtocolNumber + + - service.runtimeDetails.context.ldPreloadValue + + - service.runtimeDetails.context.libraryPath + + - service.runtimeDetails.context.memoryRegions + + - service.runtimeDetails.context.modifiedAt + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - service.runtimeDetails.context.modifyingProcess.euid + + - service.runtimeDetails.context.modifyingProcess.executablePath + + - service.runtimeDetails.context.modifyingProcess.executableSha256 + + - service.runtimeDetails.context.modifyingProcess.lineage.euid + + - service.runtimeDetails.context.modifyingProcess.lineage.executablePath + + - service.runtimeDetails.context.modifyingProcess.lineage.name + + - service.runtimeDetails.context.modifyingProcess.lineage.namespacePid + + - service.runtimeDetails.context.modifyingProcess.lineage.parentUuid + + - service.runtimeDetails.context.modifyingProcess.lineage.pid + + - service.runtimeDetails.context.modifyingProcess.lineage.startTime + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - service.runtimeDetails.context.modifyingProcess.lineage.userId + + - service.runtimeDetails.context.modifyingProcess.lineage.uuid + + - service.runtimeDetails.context.modifyingProcess.name + + - service.runtimeDetails.context.modifyingProcess.namespacePid + + - service.runtimeDetails.context.modifyingProcess.parentUuid + + - service.runtimeDetails.context.modifyingProcess.pid + + - service.runtimeDetails.context.modifyingProcess.pwd + + - service.runtimeDetails.context.modifyingProcess.startTime + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - service.runtimeDetails.context.modifyingProcess.user + + - service.runtimeDetails.context.modifyingProcess.userId + + - service.runtimeDetails.context.modifyingProcess.uuid + + - service.runtimeDetails.context.moduleFilePath + + - service.runtimeDetails.context.moduleName + + - service.runtimeDetails.context.moduleSha256 + + - service.runtimeDetails.context.mountSource + + - service.runtimeDetails.context.mountTarget + + - service.runtimeDetails.context.relatedFilePaths + + - service.runtimeDetails.context.releaseAgentPath + + - service.runtimeDetails.context.runcBinaryPath + + - service.runtimeDetails.context.scriptPath + + - service.runtimeDetails.context.serviceName + + - service.runtimeDetails.context.shellHistoryFilePath + + - service.runtimeDetails.context.socketPath + + - service.runtimeDetails.context.targetProcess.euid + + - service.runtimeDetails.context.targetProcess.executablePath + + - service.runtimeDetails.context.targetProcess.executableSha256 + + - service.runtimeDetails.context.targetProcess.lineage.euid + + - service.runtimeDetails.context.targetProcess.lineage.executablePath + + - service.runtimeDetails.context.targetProcess.lineage.name + + - service.runtimeDetails.context.targetProcess.lineage.namespacePid + + - service.runtimeDetails.context.targetProcess.lineage.parentUuid + + - service.runtimeDetails.context.targetProcess.lineage.pid + + - service.runtimeDetails.context.targetProcess.lineage.startTime + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - service.runtimeDetails.context.targetProcess.lineage.userId + + - service.runtimeDetails.context.targetProcess.lineage.uuid + + - service.runtimeDetails.context.targetProcess.name + + - service.runtimeDetails.context.targetProcess.namespacePid + + - service.runtimeDetails.context.targetProcess.parentUuid + + - service.runtimeDetails.context.targetProcess.pid + + - service.runtimeDetails.context.targetProcess.pwd + + - service.runtimeDetails.context.targetProcess.startTime + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - service.runtimeDetails.context.targetProcess.user + + - service.runtimeDetails.context.targetProcess.userId + + - service.runtimeDetails.context.targetProcess.uuid + + - service.runtimeDetails.context.threatFilePath + + - service.runtimeDetails.context.toolCategory + + - service.runtimeDetails.context.toolName + + - service.runtimeDetails.process.euid + + - service.runtimeDetails.process.executablePath + + - service.runtimeDetails.process.executableSha256 + + - service.runtimeDetails.process.lineage.euid + + - service.runtimeDetails.process.lineage.executablePath + + - service.runtimeDetails.process.lineage.name + + - service.runtimeDetails.process.lineage.namespacePid + + - service.runtimeDetails.process.lineage.parentUuid + + - service.runtimeDetails.process.lineage.pid + + - service.runtimeDetails.process.lineage.startTime + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - service.runtimeDetails.process.lineage.userId + + - service.runtimeDetails.process.lineage.uuid + + - service.runtimeDetails.process.name + + - service.runtimeDetails.process.namespacePid + + - service.runtimeDetails.process.parentUuid + + - service.runtimeDetails.process.pid + + - service.runtimeDetails.process.pwd + + - service.runtimeDetails.process.startTime + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - service.runtimeDetails.process.user + + - service.runtimeDetails.process.userId + + - service.runtimeDetails.process.uuid + + - service.serviceName + + - service.userFeedback + + - severity + + To configure severity based filters, use the following for the + [FindingCriteria](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_FindingCriteria.html) + condition: + + - **Low**: `["1", "2", "3"]` + + - **Medium**: `["4", "5", "6"]` + + - **High**: `["7", "8"]` + + - **Critical**: `["9", "10"]` + + For more information, see [Findings severity + levels](https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_findings-severity.html) + in the *Amazon GuardDuty User Guide*. + + - type + + - updatedAt + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + """ + client_token: str | None = ... + """The idempotency token for the create request.""" + tags: dict[str, str] | None = ... + """The tags to be added to a new filter resource.""" + +@dataclass(kw_only=True) +class CreateFilterOutput(_SerdeShape): + """Dataclass for CreateFilterOutput structure.""" + + name: str | None = ... + """The name of the successfully created filter.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateInvestigationInput(_SerdeShape): + """Dataclass for CreateInvestigationInput structure.""" + + detector_id: str | None = ... + """ + The unique ID of the GuardDuty detector for the account in which the + investigation is created. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + trigger_prompt: str | None = ... + """ + A natural-language description of what to investigate. For example: + + - `"Investigate finding 1ab2c3d4e5f6a7b8c9d0e1f2a3b4c5d6 in account 123456789012"` + + - `"Analyze findings in account with id 123456789012"` + + - `"Analyze findings in my organization"` + """ + client_token: str | None = ... + """The idempotency token for the create request.""" + +@dataclass(kw_only=True) +class CreateInvestigationOutput(_SerdeShape): + """Dataclass for CreateInvestigationOutput structure.""" + + investigation_id: str | None = ... + """The unique identifier of the newly created investigation.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateIPSetInput(_SerdeShape): + """Dataclass for CreateIPSetInput structure.""" + + detector_id: str | None = ... + """ + The unique ID of the detector of the GuardDuty account for which you + want to create an IPSet. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + name: str | None = ... + """ + The user-friendly name to identify the IPSet. + + Allowed characters are alphanumeric, whitespace, dash (-), and + underscores (_). + """ + format: str | None = ... + """The format of the file that contains the IPSet.""" + location: str | None = ... + """The URI of the file that contains the IPSet.""" + activate: bool | None = ... + """ + A Boolean value that indicates whether GuardDuty is to start using the + uploaded IPSet. + """ + client_token: str | None = ... + """The idempotency token for the create request.""" + tags: dict[str, str] | None = ... + """The tags to be added to a new IP set resource.""" + expected_bucket_owner: str | None = ... + """ + The Amazon Web Services account ID that owns the Amazon S3 bucket + specified in the **location** parameter. + """ + +@dataclass(kw_only=True) +class CreateIPSetOutput(_SerdeShape): + """Dataclass for CreateIPSetOutput structure.""" + + ip_set_id: str | None = ... + """The ID of the IPSet resource.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateMalwareProtectionPlanInput(_SerdeShape): + """Dataclass for CreateMalwareProtectionPlanInput structure.""" + + client_token: str | None = ... + """The idempotency token for the create request.""" + role: str | None = ... + """ + Amazon Resource Name (ARN) of the IAM role that has the permissions to + scan and add tags to the associated protected resource. + """ + protected_resource: CreateProtectedResource | None = ... + """ + Information about the protected resource that is associated with the + created Malware Protection plan. Presently, `S3Bucket` is the only + supported protected resource. + """ + actions: MalwareProtectionPlanActions | None = ... + """ + Information about whether the tags will be added to the S3 object after + scanning. + """ + tags: dict[str, str] | None = ... + """Tags added to the Malware Protection plan resource.""" + +@dataclass(kw_only=True) +class CreateMalwareProtectionPlanOutput(_SerdeShape): + """Dataclass for CreateMalwareProtectionPlanOutput structure.""" + + malware_protection_plan_id: str | None = ... + """ + A unique identifier associated with the Malware Protection plan + resource. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateMembersInput(_SerdeShape): + """Dataclass for CreateMembersInput structure.""" + + detector_id: str | None = ... + """ + The unique ID of the detector of the GuardDuty account for which you + want to associate member accounts. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + account_details: list[AccountDetail] | None = ... + """ + A list of account ID and email address pairs of the accounts that you + want to associate with the GuardDuty administrator account. + """ + +@dataclass(kw_only=True) +class CreateMembersOutput(_SerdeShape): + """Dataclass for CreateMembersOutput structure.""" + + unprocessed_accounts: list[UnprocessedAccount] | None = ... + """ + A list of objects that include the `accountIds` of the unprocessed + accounts and a result string that explains why each was unprocessed. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateProtectedResource(_SerdeShape): + """ + Information about the protected resource that is associated with the + created Malware Protection plan. Presently, `S3Bucket` is the only + supported protected resource. + """ + + s3_bucket: CreateS3BucketResource | None = ... + """Information about the protected S3 bucket resource.""" + +@dataclass(kw_only=True) +class CreatePublishingDestinationInput(_SerdeShape): + """Dataclass for CreatePublishingDestinationInput structure.""" + + detector_id: str | None = ... + """ + The ID of the GuardDuty detector associated with the publishing + destination. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + destination_type: str | None = ... + """ + The type of resource for the publishing destination. Currently only + Amazon S3 buckets are supported. + """ + destination_properties: DestinationProperties | None = ... + """ + The properties of the publishing destination, including the ARNs for the + destination and the KMS key used for encryption. + """ + client_token: str | None = ... + """The idempotency token for the request.""" + tags: dict[str, str] | None = ... + """The tags to be added to a new publishing destination resource.""" + +@dataclass(kw_only=True) +class CreatePublishingDestinationOutput(_SerdeShape): + """Dataclass for CreatePublishingDestinationOutput structure.""" + + destination_id: str | None = ... + """The ID of the publishing destination that is created.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateS3BucketResource(_SerdeShape): + """Information about the protected S3 bucket resource.""" + + bucket_name: str | None = ... + """Name of the S3 bucket.""" + object_prefixes: list[str] | None = ... + """ + Information about the specified object prefixes. The S3 object will be + scanned only if it belongs to any of the specified object prefixes. + """ + +@dataclass(kw_only=True) +class CreateSampleFindingsInput(_SerdeShape): + """Dataclass for CreateSampleFindingsInput structure.""" + + detector_id: str | None = ... + """ + The ID of the detector for which you need to create sample findings. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + finding_types: list[str] | None = ... + """The types of sample findings to generate.""" + +@dataclass(kw_only=True) +class CreateSampleFindingsOutput(_SerdeShape): + """Dataclass for CreateSampleFindingsOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateThreatEntitySetInput(_SerdeShape): + """Dataclass for CreateThreatEntitySetInput structure.""" + + detector_id: str | None = ... + """ + The unique ID of the detector of the GuardDuty account for which you + want to create a threat entity set. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + name: str | None = ... + """ + A user-friendly name to identify the threat entity set. + + The name of your list can include lowercase letters, uppercase letters, + numbers, dash (-), and underscore (_). + """ + format: str | None = ... + """The format of the file that contains the threat entity set.""" + location: str | None = ... + """ + The URI of the file that contains the threat entity set. The format of + the `Location` URL must be a valid Amazon S3 URL format. Invalid URL + formats will result in an error, regardless of whether you activate the + entity set or not. For more information about format of the location + URLs, see [Format of location URL under Step 2: Adding trusted or threat + intelligence + data](https://docs.aws.amazon.com/guardduty/latest/ug/guardduty-lists-create-activate.html) + in the *Amazon GuardDuty User Guide*. + """ + expected_bucket_owner: str | None = ... + """ + The Amazon Web Services account ID that owns the Amazon S3 bucket + specified in the **location** parameter. + """ + activate: bool | None = ... + """ + A boolean value that indicates whether GuardDuty should start using the + uploaded threat entity set to generate findings. + """ + client_token: str | None = ... + """The idempotency token for the create request.""" + tags: dict[str, str] | None = ... + """The tags to be added to a new threat entity set resource.""" + +@dataclass(kw_only=True) +class CreateThreatEntitySetOutput(_SerdeShape): + """Dataclass for CreateThreatEntitySetOutput structure.""" + + threat_entity_set_id: str | None = ... + """ + The ID returned by GuardDuty after creation of the threat entity set + resource. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateThreatIntelSetInput(_SerdeShape): + """Dataclass for CreateThreatIntelSetInput structure.""" + + detector_id: str | None = ... + """ + The unique ID of the detector of the GuardDuty account for which you + want to create a `threatIntelSet`. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + name: str | None = ... + """ + A user-friendly ThreatIntelSet name displayed in all findings that are + generated by activity that involves IP addresses included in this + ThreatIntelSet. + """ + format: str | None = ... + """The format of the file that contains the ThreatIntelSet.""" + location: str | None = ... + """The URI of the file that contains the ThreatIntelSet.""" + activate: bool | None = ... + """ + A Boolean value that indicates whether GuardDuty is to start using the + uploaded ThreatIntelSet. + """ + client_token: str | None = ... + """The idempotency token for the create request.""" + tags: dict[str, str] | None = ... + """The tags to be added to a new threat list resource.""" + expected_bucket_owner: str | None = ... + """ + The Amazon Web Services account ID that owns the Amazon S3 bucket + specified in the **location** parameter. + """ + +@dataclass(kw_only=True) +class CreateThreatIntelSetOutput(_SerdeShape): + """Dataclass for CreateThreatIntelSetOutput structure.""" + + threat_intel_set_id: str | None = ... + """The ID of the ThreatIntelSet resource.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateTrustedEntitySetInput(_SerdeShape): + """Dataclass for CreateTrustedEntitySetInput structure.""" + + detector_id: str | None = ... + """ + The unique ID of the detector of the GuardDuty account for which you + want to create a trusted entity set. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + name: str | None = ... + """ + A user-friendly name to identify the trusted entity set. + + The name of your list can include lowercase letters, uppercase letters, + numbers, dash (-), and underscore (_). + """ + format: str | None = ... + """The format of the file that contains the trusted entity set.""" + location: str | None = ... + """ + The URI of the file that contains the threat entity set. The format of + the `Location` URL must be a valid Amazon S3 URL format. Invalid URL + formats will result in an error, regardless of whether you activate the + entity set or not. For more information about format of the location + URLs, see [Format of location URL under Step 2: Adding trusted or threat + intelligence + data](https://docs.aws.amazon.com/guardduty/latest/ug/guardduty-lists-create-activate.html) + in the *Amazon GuardDuty User Guide*. + """ + expected_bucket_owner: str | None = ... + """ + The Amazon Web Services account ID that owns the Amazon S3 bucket + specified in the **location** parameter. + """ + activate: bool | None = ... + """ + A boolean value that indicates whether GuardDuty is to start using the + uploaded trusted entity set. + """ + client_token: str | None = ... + """The idempotency token for the create request.""" + tags: dict[str, str] | None = ... + """The tags to be added to a new trusted entity set resource.""" + +@dataclass(kw_only=True) +class CreateTrustedEntitySetOutput(_SerdeShape): + """Dataclass for CreateTrustedEntitySetOutput structure.""" + + trusted_entity_set_id: str | None = ... + """ + The ID returned by GuardDuty after creation of the trusted entity set + resource. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class CriterionKey(UnknownEnumMixin, StrEnum): + EC2_INSTANCE_ARN = "EC2_INSTANCE_ARN" + SCAN_ID = "SCAN_ID" + ACCOUNT_ID = "ACCOUNT_ID" + GUARDDUTY_FINDING_ID = "GUARDDUTY_FINDING_ID" + SCAN_START_TIME = "SCAN_START_TIME" + SCAN_STATUS = "SCAN_STATUS" + SCAN_TYPE = "SCAN_TYPE" + +class DataSource(UnknownEnumMixin, StrEnum): + FLOW_LOGS = "FLOW_LOGS" + CLOUD_TRAIL = "CLOUD_TRAIL" + DNS_LOGS = "DNS_LOGS" + S3_LOGS = "S3_LOGS" + KUBERNETES_AUDIT_LOGS = "KUBERNETES_AUDIT_LOGS" + EC2_MALWARE_SCAN = "EC2_MALWARE_SCAN" + +@dataclass(kw_only=True) +class DataSourceConfigurations(_SerdeShape): + """Contains information about which data sources are enabled.""" + + s3_logs: S3LogsConfiguration | None = ... + """Describes whether S3 data event logs are enabled as a data source.""" + kubernetes: KubernetesConfiguration | None = ... + """Describes whether any Kubernetes logs are enabled as data sources.""" + malware_protection: MalwareProtectionConfiguration | None = ... + """Describes whether Malware Protection is enabled as a data source.""" + +@dataclass(kw_only=True) +class DataSourceConfigurationsResult(_SerdeShape): + """Contains information on the status of data sources for the detector.""" + + cloud_trail: CloudTrailConfigurationResult | None = ... + """ + An object that contains information on the status of CloudTrail as a + data source. + """ + dns_logs: DNSLogsConfigurationResult | None = ... + """ + An object that contains information on the status of DNS logs as a data + source. + """ + flow_logs: FlowLogsConfigurationResult | None = ... + """ + An object that contains information on the status of VPC flow logs as a + data source. + """ + s3_logs: S3LogsConfigurationResult | None = ... + """ + An object that contains information on the status of S3 Data event logs + as a data source. + """ + kubernetes: KubernetesConfigurationResult | None = ... + """ + An object that contains information on the status of all Kubernetes data + sources. + """ + malware_protection: MalwareProtectionConfigurationResult | None = ... + """Describes the configuration of Malware Protection data sources.""" + +@dataclass(kw_only=True) +class DataSourceFreeTrial(_SerdeShape): + """ + Contains information about which data sources are enabled for the + GuardDuty member account. + """ + + free_trial_days_remaining: int | None = ... + """ + A value that specifies the number of days left to use each enabled data + source. + """ + +@dataclass(kw_only=True) +class DataSourcesFreeTrial(_SerdeShape): + """ + Contains information about which data sources are enabled for the + GuardDuty member account. + """ + + cloud_trail: DataSourceFreeTrial | None = ... + """ + Describes whether any Amazon Web Services CloudTrail management event + logs are enabled as data sources. + """ + dns_logs: DataSourceFreeTrial | None = ... + """Describes whether any DNS logs are enabled as data sources.""" + flow_logs: DataSourceFreeTrial | None = ... + """Describes whether any VPC Flow logs are enabled as data sources.""" + s3_logs: DataSourceFreeTrial | None = ... + """Describes whether any S3 data event logs are enabled as data sources.""" + kubernetes: KubernetesDataSourceFreeTrial | None = ... + """Describes whether any Kubernetes logs are enabled as data sources.""" + malware_protection: MalwareProtectionDataSourceFreeTrial | None = ... + """Describes whether Malware Protection is enabled as a data source.""" + +class DataSourceStatus(UnknownEnumMixin, StrEnum): + ENABLED = "ENABLED" + DISABLED = "DISABLED" + +@dataclass(kw_only=True) +class DateStatistics(_SerdeShape): + """ + Represents list a map of dates with a count of total findings generated + on each date. + """ + + date: datetime | None = ... + """ + The timestamp when the total findings count is observed. + + For example, `Date` would look like `"2024-09-05T17:00:00-07:00"` + whereas `LastGeneratedAt` would look like 2024-09-05T17:12:29-07:00\". + """ + last_generated_at: datetime | None = ... + """ + The timestamp at which the last finding in the findings count, was + generated. + """ + severity: float | None = ... + """The severity of the findings generated on each date.""" + total_findings: int | None = ... + """ + The total number of findings that were generated per severity level on + each date. + """ + +@dataclass(kw_only=True) +class DeclineInvitationsInput(_SerdeShape): + """Dataclass for DeclineInvitationsInput structure.""" + + account_ids: list[str] | None = ... + """ + A list of account IDs of the Amazon Web Services accounts that sent + invitations to the current member account that you want to decline + invitations from. + """ + +@dataclass(kw_only=True) +class DeclineInvitationsOutput(_SerdeShape): + """Dataclass for DeclineInvitationsOutput structure.""" + + unprocessed_accounts: list[UnprocessedAccount] | None = ... + """ + A list of objects that contain the unprocessed account and a result + string that explains why it was unprocessed. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DefaultServerSideEncryption(_SerdeShape): + """ + Contains information on the server side encryption method used in the S3 + bucket. See [S3 Server-Side + Encryption](https://docs.aws.amazon.com/AmazonS3/latest/dev/serv-side-encryption.html) + for more information. + """ + + encryption_type: str | None = ... + """The type of encryption used for objects within the S3 bucket.""" + kms_master_key_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the KMS encryption key. Only available + if the bucket `EncryptionType` is `aws:kms`. + """ + +@dataclass(kw_only=True) +class DeleteCustomDetectionRuleAssociationInput(_SerdeShape): + """Dataclass for DeleteCustomDetectionRuleAssociationInput structure.""" + + rule_id: str | None = ... + """The unique identifier for the custom detection rule.""" + association_id: str | None = ... + """The unique identifier for the association to delete.""" + +@dataclass(kw_only=True) +class DeleteCustomDetectionRuleAssociationOutput(_SerdeShape): + """Dataclass for DeleteCustomDetectionRuleAssociationOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteCustomDetectionRuleOrgConfigurationInput(_SerdeShape): + """Dataclass for DeleteCustomDetectionRuleOrgConfigurationInput structure.""" + + rule_id: str | None = ... + """The unique identifier for the custom detection rule.""" + mode: str | None = ... + """ + The execution mode of the organization configuration to delete. Valid + values: `LIVE` | `DRY_RUN`. + """ + +@dataclass(kw_only=True) +class DeleteCustomDetectionRuleOrgConfigurationOutput(_SerdeShape): + """Dataclass for DeleteCustomDetectionRuleOrgConfigurationOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteDetectorInput(_SerdeShape): + """Dataclass for DeleteDetectorInput structure.""" + + detector_id: str | None = ... + """ + The unique ID of the detector that you want to delete. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + +@dataclass(kw_only=True) +class DeleteDetectorOutput(_SerdeShape): + """Dataclass for DeleteDetectorOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteFilterInput(_SerdeShape): + """Dataclass for DeleteFilterInput structure.""" + + detector_id: str | None = ... + """ + The unique ID of the detector that is associated with the filter. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + filter_name: str | None = ... + """The name of the filter that you want to delete.""" + +@dataclass(kw_only=True) +class DeleteFilterOutput(_SerdeShape): + """Dataclass for DeleteFilterOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteInvitationsInput(_SerdeShape): + """Dataclass for DeleteInvitationsInput structure.""" + + account_ids: list[str] | None = ... + """ + A list of account IDs of the Amazon Web Services accounts that sent + invitations to the current member account that you want to delete + invitations from. + """ + +@dataclass(kw_only=True) +class DeleteInvitationsOutput(_SerdeShape): + """Dataclass for DeleteInvitationsOutput structure.""" + + unprocessed_accounts: list[UnprocessedAccount] | None = ... + """ + A list of objects that contain the unprocessed account and a result + string that explains why it was unprocessed. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteIPSetInput(_SerdeShape): + """Dataclass for DeleteIPSetInput structure.""" + + detector_id: str | None = ... + """ + The unique ID of the detector associated with the IPSet. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + ip_set_id: str | None = ... + """The unique ID of the IPSet to delete.""" + +@dataclass(kw_only=True) +class DeleteIPSetOutput(_SerdeShape): + """Dataclass for DeleteIPSetOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteMalwareProtectionPlanInput(_SerdeShape): + """Dataclass for DeleteMalwareProtectionPlanInput structure.""" + + malware_protection_plan_id: str | None = ... + """A unique identifier associated with Malware Protection plan resource.""" + +@dataclass(kw_only=True) +class DeleteMalwareProtectionPlanOutput(_SerdeShape): + """Dataclass for DeleteMalwareProtectionPlanOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteMembersInput(_SerdeShape): + """Dataclass for DeleteMembersInput structure.""" + + detector_id: str | None = ... + """ + The unique ID of the detector of the GuardDuty account whose members you + want to delete. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + account_ids: list[str] | None = ... + """ + A list of account IDs of the GuardDuty member accounts that you want to + delete. + """ + +@dataclass(kw_only=True) +class DeleteMembersOutput(_SerdeShape): + """Dataclass for DeleteMembersOutput structure.""" + + unprocessed_accounts: list[UnprocessedAccount] | None = ... + """The accounts that could not be processed.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeletePublishingDestinationInput(_SerdeShape): + """Dataclass for DeletePublishingDestinationInput structure.""" + + detector_id: str | None = ... + """ + The unique ID of the detector associated with the publishing destination + to delete. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + destination_id: str | None = ... + """The ID of the publishing destination to delete.""" + +@dataclass(kw_only=True) +class DeletePublishingDestinationOutput(_SerdeShape): + """Dataclass for DeletePublishingDestinationOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteThreatEntitySetInput(_SerdeShape): + """Dataclass for DeleteThreatEntitySetInput structure.""" + + detector_id: str | None = ... + """ + The unique ID of the detector associated with the threat entity set + resource. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + threat_entity_set_id: str | None = ... + """ + The unique ID that helps GuardDuty identify which threat entity set + needs to be deleted. + """ + +@dataclass(kw_only=True) +class DeleteThreatEntitySetOutput(_SerdeShape): + """Dataclass for DeleteThreatEntitySetOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteThreatIntelSetInput(_SerdeShape): + """Dataclass for DeleteThreatIntelSetInput structure.""" + + detector_id: str | None = ... + """ + The unique ID of the detector that is associated with the + threatIntelSet. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + threat_intel_set_id: str | None = ... + """The unique ID of the threatIntelSet that you want to delete.""" + +@dataclass(kw_only=True) +class DeleteThreatIntelSetOutput(_SerdeShape): + """Dataclass for DeleteThreatIntelSetOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteTrustedEntitySetInput(_SerdeShape): + """Dataclass for DeleteTrustedEntitySetInput structure.""" + + detector_id: str | None = ... + """ + The unique ID of the detector associated with the trusted entity set + resource. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + trusted_entity_set_id: str | None = ... + """ + The unique ID that helps GuardDuty identify which trusted entity set + needs to be deleted. + """ + +@dataclass(kw_only=True) +class DeleteTrustedEntitySetOutput(_SerdeShape): + """Dataclass for DeleteTrustedEntitySetOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DescribeMalwareScansInput(_SerdeShape): + """Dataclass for DescribeMalwareScansInput structure.""" + + detector_id: str | None = ... + """ + The unique ID of the detector that the request is associated with. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + next_token: str | None = ... + """ + You can use this parameter when paginating results. Set the value of + this parameter to null on your first call to the list action. For + subsequent calls to the action, fill nextToken in the request with the + value of NextToken from the previous response to continue listing data. + """ + max_results: int | None = ... + """ + You can use this parameter to indicate the maximum number of items that + you want in the response. The default value is 50. The maximum value is + 50. + """ + filter_criteria: FilterCriteria | None = ... + """ + Represents the criteria to be used in the filter for describing scan + entries. + """ + sort_criteria: SortCriteria | None = ... + """ + Represents the criteria used for sorting scan entries. The + [`attributeName`](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_SortCriteria.html#guardduty-Type-SortCriteria-attributeName) + is required and it must be `scanStartTime`. + """ + +@dataclass(kw_only=True) +class DescribeMalwareScansOutput(_SerdeShape): + """Dataclass for DescribeMalwareScansOutput structure.""" + + scans: list[Scan] | None = ... + """ + Contains information about malware scans associated with GuardDuty + Malware Protection for EC2. + """ + next_token: str | None = ... + """ + The pagination parameter to be used on the next list operation to + retrieve more items. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DescribeOrganizationConfigurationInput(_SerdeShape): + """Dataclass for DescribeOrganizationConfigurationInput structure.""" + + detector_id: str | None = ... + """ + The detector ID of the delegated administrator for which you need to + retrieve the information. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + max_results: int | None = ... + """ + You can use this parameter to indicate the maximum number of items that + you want in the response. + """ + next_token: str | None = ... + """ + You can use this parameter when paginating results. Set the value of + this parameter to null on your first call to the list action. For + subsequent calls to the action, fill `nextToken` in the request with the + value of `NextToken` from the previous response to continue listing + data. + """ + +@dataclass(kw_only=True) +class DescribeOrganizationConfigurationOutput(_SerdeShape): + """Dataclass for DescribeOrganizationConfigurationOutput structure.""" + + auto_enable: bool | None = ... + """ + Indicates whether GuardDuty is automatically enabled for accounts added + to the organization. + + Even though this is still supported, we recommend using + `AutoEnableOrganizationMembers` to achieve the similar results. + """ + member_account_limit_reached: bool | None = ... + """ + Indicates whether the maximum number of allowed member accounts are + already associated with the delegated administrator account for your + organization. + """ + data_sources: OrganizationDataSourceConfigurationsResult | None = ... + """ + Describes which data sources are enabled automatically for member + accounts. + """ + features: list[OrganizationFeatureConfigurationResult] | None = ... + """A list of features that are configured for this organization.""" + next_token: str | None = ... + """ + The pagination parameter to be used on the next list operation to + retrieve more items. + """ + auto_enable_organization_members: str | None = ... + """ + Indicates the auto-enablement configuration of GuardDuty or any of the + corresponding protection plans for the member accounts in the + organization. + + - `NEW`: Indicates that when a new account joins the organization, they + will have GuardDuty or any of the corresponding protection plans + enabled automatically. + + - `ALL`: Indicates that all accounts in the organization have GuardDuty + and any of the corresponding protection plans enabled automatically. + This includes `NEW` accounts that join the organization and accounts + that may have been suspended or removed from the organization in + GuardDuty. + + - `NONE`: Indicates that GuardDuty or any of the corresponding + protection plans will not be automatically enabled for any account in + the organization. The administrator must manage GuardDuty for each + account in the organization individually. + + When you update the auto-enable setting from `ALL` or `NEW` to `NONE`, + this action doesn't disable the corresponding option for your + existing accounts. This configuration will apply to the new accounts + that join the organization. After you update the auto-enable settings, + no new account will have the corresponding option as enabled. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DescribePublishingDestinationInput(_SerdeShape): + """Dataclass for DescribePublishingDestinationInput structure.""" + + detector_id: str | None = ... + """ + The unique ID of the detector associated with the publishing destination + to retrieve. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + destination_id: str | None = ... + """The ID of the publishing destination to retrieve.""" + +@dataclass(kw_only=True) +class DescribePublishingDestinationOutput(_SerdeShape): + """Dataclass for DescribePublishingDestinationOutput structure.""" + + destination_id: str | None = ... + """The ID of the publishing destination.""" + destination_type: str | None = ... + """ + The type of publishing destination. Currently, only Amazon S3 buckets + are supported. + """ + status: str | None = ... + """The status of the publishing destination.""" + publishing_failure_start_timestamp: int | None = ... + """ + The time, in epoch millisecond format, at which GuardDuty was first + unable to publish findings to the destination. + """ + destination_properties: DestinationProperties | None = ... + """ + A `DestinationProperties` object that includes the `DestinationArn` and + `KmsKeyArn` of the publishing destination. + """ + tags: dict[str, str] | None = ... + """The tags of the publishing destination resource.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class Destination(_SerdeShape): + """ + Contains information about the publishing destination, including the ID, + type, and status. + """ + + destination_id: str | None = ... + """The unique ID of the publishing destination.""" + destination_type: str | None = ... + """ + The type of resource used for the publishing destination. Currently, + only Amazon S3 buckets are supported. + """ + status: str | None = ... + """The status of the publishing destination.""" + +@dataclass(kw_only=True) +class DestinationProperties(_SerdeShape): + """ + Contains the Amazon Resource Name (ARN) of the resource to publish to, + such as an S3 bucket, and the ARN of the KMS key to use to encrypt + published findings. + """ + + destination_arn: str | None = ... + """ + The ARN of the resource to publish to. + + To specify an S3 bucket folder use the following format: + `arn:aws:s3:::DOC-EXAMPLE-BUCKET/myFolder/` + """ + kms_key_arn: str | None = ... + """The ARN of the KMS key to use for encryption.""" + +class DestinationType(UnknownEnumMixin, StrEnum): + S3 = "S3" + +@dataclass(kw_only=True) +class Detection(_SerdeShape): + """Contains information about the detected behavior.""" + + anomaly: Anomaly | None = ... + """ + The details about the anomalous activity that caused GuardDuty to + generate the finding. + """ + sequence: Sequence | None = ... + """The details about the attack sequence.""" + +class DetectionRuleConfigurationStatus(UnknownEnumMixin, StrEnum): + ACTIVE = "ACTIVE" + PROCESSING = "PROCESSING" + FAILED = "FAILED" + +class DetectionRuleDataSource(UnknownEnumMixin, StrEnum): + CLOUDTRAIL_MANAGEMENT_EVENT = "CloudTrailManagementEvent" + +@dataclass(kw_only=True) +class DetectionRuleFilter(_SerdeShape): + """ + Contains filter criteria for listing custom detection rules or + associations. + """ + + name: str | None = ... + """The name of the field to filter by.""" + values: list[str] | None = ... + """The values to match against the specified filter name.""" + condition: str | None = ... + """ + The condition to apply to the filter. For example, `EQUALS` or + `CONTAINS`. + """ + +class DetectionRuleFilterCondition(UnknownEnumMixin, StrEnum): + EQUALS = "EQUALS" + CONTAINS = "CONTAINS" + +@dataclass(kw_only=True) +class DetectionRuleOrgConfiguration(_SerdeShape): + """ + Contains the organization-level configuration for a custom detection + rule. + """ + + rule_id: str | None = ... + """The unique identifier for the custom detection rule.""" + mode: str | None = ... + """ + The execution mode of the organization configuration. Valid values: + `LIVE` | `DRY_RUN`. + """ + status: str | None = ... + """ + The configuration status. Valid values: `ACTIVE` | `PROCESSING` | + `FAILED`. + """ + status_reason: str | None = ... + """The reason for the current configuration status.""" + include_account_ids: list[str] | None = ... + """ + A list of member account IDs included in the organization configuration. + Mutually exclusive with `ExcludeAccountIds`. + """ + exclude_account_ids: list[str] | None = ... + """ + A list of member account IDs excluded from the organization + configuration. Mutually exclusive with `IncludeAccountIds`. + """ + created_at: datetime | None = ... + """The timestamp when the organization configuration was created.""" + updated_at: datetime | None = ... + """The timestamp when the organization configuration was last updated.""" + expires_at: datetime | None = ... + """The timestamp when the organization configuration expires.""" + +@dataclass(kw_only=True) +class DetectionRuleOrgConfigurationSummary(_SerdeShape): + """ + Contains summary information about an organization-level configuration + for a custom detection rule. + """ + + rule_id: str | None = ... + """The unique identifier for the custom detection rule.""" + mode: str | None = ... + """The rule execution mode.""" + status: str | None = ... + """The configuration status.""" + status_reason: str | None = ... + """The reason for the current configuration status.""" + created_at: datetime | None = ... + """The timestamp when the organization configuration was created.""" + updated_at: datetime | None = ... + """The timestamp when the organization configuration was last updated.""" + expires_at: datetime | None = ... + """The timestamp when the organization configuration expires.""" + +class DetectionRuleSeverity(UnknownEnumMixin, StrEnum): + CRITICAL = "CRITICAL" + HIGH = "HIGH" + MEDIUM = "MEDIUM" + LOW = "LOW" + +class DetectionSource(UnknownEnumMixin, StrEnum): + AMAZON = "AMAZON" + BITDEFENDER = "BITDEFENDER" + +@dataclass(kw_only=True) +class DetectorAdditionalConfiguration(_SerdeShape): + """ + Information about the additional configuration for a feature in your + GuardDuty account. + """ + + name: str | None = ... + """Name of the additional configuration.""" + status: str | None = ... + """Status of the additional configuration.""" + +@dataclass(kw_only=True) +class DetectorAdditionalConfigurationResult(_SerdeShape): + """Information about the additional configuration.""" + + name: str | None = ... + """Name of the additional configuration.""" + status: str | None = ... + """Status of the additional configuration.""" + updated_at: datetime | None = ... + """ + The timestamp at which the additional configuration was last updated. + This is in UTC format. + """ + managed_by: str | None = ... + """ + Indicates what manages the additional configuration. A value of + `GUARDDUTY_POLICY` means a GuardDuty policy manages the additional + configuration. + """ + +class DetectorFeature(UnknownEnumMixin, StrEnum): + S3_DATA_EVENTS = "S3_DATA_EVENTS" + EKS_AUDIT_LOGS = "EKS_AUDIT_LOGS" + EBS_MALWARE_PROTECTION = "EBS_MALWARE_PROTECTION" + RDS_LOGIN_EVENTS = "RDS_LOGIN_EVENTS" + LAMBDA_NETWORK_LOGS = "LAMBDA_NETWORK_LOGS" + EKS_RUNTIME_MONITORING = "EKS_RUNTIME_MONITORING" + RUNTIME_MONITORING = "RUNTIME_MONITORING" + AI_PROTECTION = "AI_PROTECTION" + AI_ANALYST = "AI_ANALYST" + +@dataclass(kw_only=True) +class DetectorFeatureConfiguration(_SerdeShape): + """ + Contains information about a GuardDuty feature. + + Specifying both EKS Runtime Monitoring (`EKS_RUNTIME_MONITORING`) and + Runtime Monitoring (`RUNTIME_MONITORING`) will cause an error. You can + add only one of these two features because Runtime Monitoring already + includes the threat detection for Amazon EKS resources. For more + information, see [Runtime + Monitoring](https://docs.aws.amazon.com/guardduty/latest/ug/runtime-monitoring.html). + """ + + name: str | None = ... + """The name of the feature.""" + status: str | None = ... + """The status of the feature.""" + additional_configuration: list[DetectorAdditionalConfiguration] | None = ... + """Additional configuration for a resource.""" + +@dataclass(kw_only=True) +class DetectorFeatureConfigurationResult(_SerdeShape): + """ + Contains information about a GuardDuty feature. + + Specifying both EKS Runtime Monitoring (`EKS_RUNTIME_MONITORING`) and + Runtime Monitoring (`RUNTIME_MONITORING`) will cause an error. You can + add only one of these two features because Runtime Monitoring already + includes the threat detection for Amazon EKS resources. For more + information, see [Runtime + Monitoring](https://docs.aws.amazon.com/guardduty/latest/ug/runtime-monitoring.html). + """ + + name: str | None = ... + """Indicates the name of the feature that can be enabled for the detector.""" + status: str | None = ... + """Indicates the status of the feature that is enabled for the detector.""" + updated_at: datetime | None = ... + """The timestamp at which the feature object was updated.""" + additional_configuration: list[DetectorAdditionalConfigurationResult] | None = ... + """Additional configuration for a resource.""" + managed_by: str | None = ... + """ + Indicates what manages the feature. A value of `GUARDDUTY_POLICY` means + a GuardDuty policy manages the feature. + """ + +class DetectorFeatureResult(UnknownEnumMixin, StrEnum): + FLOW_LOGS = "FLOW_LOGS" + CLOUD_TRAIL = "CLOUD_TRAIL" + DNS_LOGS = "DNS_LOGS" + S3_DATA_EVENTS = "S3_DATA_EVENTS" + EKS_AUDIT_LOGS = "EKS_AUDIT_LOGS" + EBS_MALWARE_PROTECTION = "EBS_MALWARE_PROTECTION" + RDS_LOGIN_EVENTS = "RDS_LOGIN_EVENTS" + LAMBDA_NETWORK_LOGS = "LAMBDA_NETWORK_LOGS" + EKS_RUNTIME_MONITORING = "EKS_RUNTIME_MONITORING" + RUNTIME_MONITORING = "RUNTIME_MONITORING" + AI_PROTECTION = "AI_PROTECTION" + AI_ANALYST = "AI_ANALYST" + +class DetectorStatus(UnknownEnumMixin, StrEnum): + ENABLED = "ENABLED" + DISABLED = "DISABLED" + +@dataclass(kw_only=True) +class DisableOrganizationAdminAccountInput(_SerdeShape): + """Dataclass for DisableOrganizationAdminAccountInput structure.""" + + admin_account_id: str | None = ... + """ + The Amazon Web Services Account ID for the organizations account to be + disabled as a GuardDuty delegated administrator. + """ + +@dataclass(kw_only=True) +class DisableOrganizationAdminAccountOutput(_SerdeShape): + """Dataclass for DisableOrganizationAdminAccountOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DisassociateFromAdministratorAccountInput(_SerdeShape): + """Dataclass for DisassociateFromAdministratorAccountInput structure.""" + + detector_id: str | None = ... + """The unique ID of the detector of the GuardDuty member account.""" + +@dataclass(kw_only=True) +class DisassociateFromAdministratorAccountOutput(_SerdeShape): + """Dataclass for DisassociateFromAdministratorAccountOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DisassociateFromMasterAccountInput(_SerdeShape): + """Dataclass for DisassociateFromMasterAccountInput structure.""" + + detector_id: str | None = ... + """The unique ID of the detector of the GuardDuty member account.""" + +@dataclass(kw_only=True) +class DisassociateFromMasterAccountOutput(_SerdeShape): + """Dataclass for DisassociateFromMasterAccountOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DisassociateMembersInput(_SerdeShape): + """Dataclass for DisassociateMembersInput structure.""" + + detector_id: str | None = ... + """ + The unique ID of the detector of the GuardDuty account whose members you + want to disassociate from the administrator account. + """ + account_ids: list[str] | None = ... + """ + A list of account IDs of the GuardDuty member accounts that you want to + disassociate from the administrator account. + """ + +@dataclass(kw_only=True) +class DisassociateMembersOutput(_SerdeShape): + """Dataclass for DisassociateMembersOutput structure.""" + + unprocessed_accounts: list[UnprocessedAccount] | None = ... + """ + A list of objects that contain the unprocessed account and a result + string that explains why it was unprocessed. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DNSLogsConfigurationResult(_SerdeShape): + """Contains information on the status of DNS logs as a data source.""" + + status: str | None = ... + """Denotes whether DNS logs is enabled as a data source.""" + +@dataclass(kw_only=True) +class DnsRequestAction(_SerdeShape): + """ + Contains information about the DNS_REQUEST action described in this + finding. + """ + + domain: str | None = ... + """The domain information for the DNS query.""" + protocol: str | None = ... + """ + The network connection protocol observed in the activity that prompted + GuardDuty to generate the finding. + """ + blocked: bool | None = ... + """Indicates whether the targeted port is blocked.""" + domain_with_suffix: str | None = ... + """ + The second and top level domain involved in the activity that + potentially prompted GuardDuty to generate this finding. For a list of + top-level and second-level domains, see [public suffix + list](https://publicsuffix.org/). + """ + vpc_owner_account_id: str | None = ... + """ + The Amazon Web Services account ID that owns the VPC through which the + DNS request was made. + """ + +@dataclass(kw_only=True) +class DomainDetails(_SerdeShape): + """Contains information about the domain.""" + + domain: str | None = ... + """The domain information for the Amazon Web Services API call.""" + +@dataclass(kw_only=True) +class EbsSnapshot(_SerdeShape): + """Contains information about an EBS snapshot that was scanned for malware.""" + + device_name: str | None = ... + """The device name of the EBS snapshot that was scanned.""" + +@dataclass(kw_only=True) +class EbsSnapshotDetails(_SerdeShape): + """Contains details about the EBS snapshot that was scanned for malware.""" + + snapshot_arn: str | None = ... + """The Amazon Resource Name (ARN) of the EBS snapshot.""" + +class EbsSnapshotPreservation(UnknownEnumMixin, StrEnum): + NO_RETENTION = "NO_RETENTION" + RETENTION_WITH_FINDING = "RETENTION_WITH_FINDING" + +@dataclass(kw_only=True) +class EbsVolumeDetails(_SerdeShape): + """Contains list of scanned and skipped EBS volumes with details.""" + + scanned_volume_details: list[VolumeDetail] | None = ... + """List of EBS volumes that were scanned.""" + skipped_volume_details: list[VolumeDetail] | None = ... + """List of EBS volumes that were skipped from the malware scan.""" + +@dataclass(kw_only=True) +class EbsVolumeScanDetails(_SerdeShape): + """Contains details from the malware scan that created a finding.""" + + scan_id: str | None = ... + """Unique Id of the malware scan that generated the finding.""" + scan_started_at: datetime | None = ... + """Returns the start date and time of the malware scan.""" + scan_completed_at: datetime | None = ... + """Returns the completion date and time of the malware scan.""" + trigger_finding_id: str | None = ... + """GuardDuty finding ID that triggered a malware scan.""" + sources: list[str] | None = ... + """Contains list of threat intelligence sources used to detect threats.""" + scan_detections: ScanDetections | None = ... + """Contains a complete view providing malware scan result details.""" + scan_type: str | None = ... + """Specifies the scan type that invoked the malware scan.""" + +@dataclass(kw_only=True) +class EbsVolumesResult(_SerdeShape): + """Describes the configuration of scanning EBS volumes as a data source.""" + + status: str | None = ... + """Describes whether scanning EBS volumes is enabled as a data source.""" + reason: str | None = ... + """ + Specifies the reason why scanning EBS volumes (Malware Protection) was + not enabled as a data source. + """ + +@dataclass(kw_only=True) +class Ec2Image(_SerdeShape): + """ + Contains information about the Amazon EC2 Image involved in a GuardDuty + finding, including unique identifiers of the Amazon EC2 instances. + """ + + ec2_instance_uids: list[str] | None = ... + """ + A list of unique identifiers for the compromised Amazon EC2 instances + that were launched with the same Amazon Machine Image (AMI). + """ + +@dataclass(kw_only=True) +class Ec2ImageDetails(_SerdeShape): + """Contains details about the EC2 AMI that was scanned.""" + + image_arn: str | None = ... + """The Amazon Resource Name (ARN) of the EC2 AMI.""" + +@dataclass(kw_only=True) +class Ec2Instance(_SerdeShape): + """Details about the potentially impacted Amazon EC2 instance resource.""" + + availability_zone: str | None = ... + """ + The availability zone of the Amazon EC2 instance. For more information, + see [Availability + zones](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html#concepts-availability-zones) + in the *Amazon EC2 User Guide*. + """ + image_description: str | None = ... + """The image description of the Amazon EC2 instance.""" + instance_state: str | None = ... + """ + The state of the Amazon EC2 instance. For more information, see [Amazon + EC2 instance state + changes](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html) + in the *Amazon EC2 User Guide*. + """ + iam_instance_profile: IamInstanceProfile | None = ... + """Contains information about the EC2 instance profile.""" + instance_type: str | None = ... + """Type of the Amazon EC2 instance.""" + outpost_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the Amazon Web Services Outpost. This + shows applicable Amazon Web Services Outposts instances. + """ + platform: str | None = ... + """The platform of the Amazon EC2 instance.""" + product_codes: list[ProductCode] | None = ... + """The product code of the Amazon EC2 instance.""" + ec2_network_interface_uids: list[str] | None = ... + """The ID of the network interface.""" + +@dataclass(kw_only=True) +class Ec2LaunchTemplate(_SerdeShape): + """ + Contains information about the Amazon EC2 launch template involved in a + GuardDuty finding, including unique identifiers of the Amazon EC2 + instances. + """ + + ec2_instance_uids: list[str] | None = ... + """ + A list of unique identifiers for the compromised Amazon EC2 instances + that share the same Amazon EC2 launch template. + """ + version: str | None = ... + """Version of the EC2 launch template.""" + +@dataclass(kw_only=True) +class Ec2NetworkInterface(_SerdeShape): + """ + Contains information about the elastic network interface of the Amazon + EC2 instance. + """ + + ipv6_addresses: list[str] | None = ... + """A list of IPv6 addresses for the Amazon EC2 instance.""" + private_ip_addresses: list[PrivateIpAddressDetails] | None = ... + """Other private IP address information of the Amazon EC2 instance.""" + public_ip: str | None = ... + """The public IP address of the Amazon EC2 instance.""" + security_groups: list[SecurityGroup] | None = ... + """The security groups associated with the Amazon EC2 instance.""" + sub_net_id: str | None = ... + """The subnet ID of the Amazon EC2 instance.""" + vpc_id: str | None = ... + """The VPC ID of the Amazon EC2 instance.""" + +@dataclass(kw_only=True) +class Ec2Vpc(_SerdeShape): + """ + Contains information about the Amazon EC2 VPC involved in a GuardDuty + finding, including unique identifiers of the Amazon EC2 instances. + """ + + ec2_instance_uids: list[str] | None = ... + """ + A list of unique identifiers for the compromised Amazon EC2 instances + that were launched within the same Virtual Private Cloud (VPC). + """ + +@dataclass(kw_only=True) +class EcsCluster(_SerdeShape): + """ + Contains information about the Amazon ECS cluster involved in a + GuardDuty finding, including cluster identification and status. + """ + + status: str | None = ... + """The current status of the Amazon ECS cluster.""" + ec2_instance_uids: list[str] | None = ... + """ + A list of unique identifiers for the Amazon EC2 instances that serve as + container instances in the Amazon ECS cluster. + """ + +@dataclass(kw_only=True) +class EcsClusterDetails(_SerdeShape): + """Contains information about the details of the ECS Cluster.""" + + name: str | None = ... + """The name of the ECS Cluster.""" + arn: str | None = ... + """The Amazon Resource Name (ARN) that identifies the cluster.""" + status: str | None = ... + """The status of the ECS cluster.""" + active_services_count: int | None = ... + """ + The number of services that are running on the cluster in an ACTIVE + state. + """ + registered_container_instances_count: int | None = ... + """The number of container instances registered into the cluster.""" + running_tasks_count: int | None = ... + """The number of tasks in the cluster that are in the RUNNING state.""" + tags: list[Tag] | None = ... + """The tags of the ECS Cluster.""" + task_details: EcsTaskDetails | None = ... + """Contains information about the details of the ECS Task.""" + +class EcsClusterStatus(UnknownEnumMixin, StrEnum): + ACTIVE = "ACTIVE" + PROVISIONING = "PROVISIONING" + DEPROVISIONING = "DEPROVISIONING" + FAILED = "FAILED" + INACTIVE = "INACTIVE" + +class EcsLaunchType(UnknownEnumMixin, StrEnum): + FARGATE = "FARGATE" + EC2 = "EC2" + +@dataclass(kw_only=True) +class EcsTask(_SerdeShape): + """ + Contains information about Amazon ECS task involved in a GuardDuty + finding, including task definition and container identifiers. + """ + + created_at: datetime | None = ... + """ + The timestamp indicating when the Amazon ECS task was created, in UTC + format. + """ + task_definition_arn: str | None = ... + """ + The ARN of task definition which describes the container and volume + definitions of the Amazon ECS task. + """ + launch_type: str | None = ... + """The infrastructure type on which the Amazon ECS task runs.""" + container_uids: list[str] | None = ... + """ + A list of unique identifiers for the containers associated with the + Amazon ECS task. + """ + +@dataclass(kw_only=True) +class EcsTaskDetails(_SerdeShape): + """Contains information about the task in an ECS cluster.""" + + arn: str | None = ... + """The Amazon Resource Name (ARN) of the task.""" + definition_arn: str | None = ... + """The ARN of the task definition that creates the task.""" + version: str | None = ... + """The version counter for the task.""" + task_created_at: datetime | None = ... + """The Unix timestamp for the time when the task was created.""" + started_at: datetime | None = ... + """The Unix timestamp for the time when the task started.""" + started_by: str | None = ... + """Contains the tag specified when a task is started.""" + tags: list[Tag] | None = ... + """The tags of the ECS Task.""" + volumes: list[Volume] | None = ... + """The list of data volume definitions for the task.""" + containers: list[Container] | None = ... + """The containers that's associated with the task.""" + group: str | None = ... + """The name of the task group that's associated with the task.""" + launch_type: str | None = ... + """ + A capacity on which the task is running. For example, `Fargate` and + `EC2`. + """ + +@dataclass(kw_only=True) +class EksCluster(_SerdeShape): + """ + Contains information about the Amazon EKS cluster involved in a + GuardDuty finding, including cluster identification, status, and network + configuration. + """ + + arn: str | None = ... + """ + The Amazon Resource Name (ARN) that uniquely identifies the Amazon EKS + cluster involved in the finding. + """ + created_at: datetime | None = ... + """ + The timestamp indicating when the Amazon EKS cluster was created, in UTC + format. + """ + status: str | None = ... + """The current status of the Amazon EKS cluster.""" + vpc_id: str | None = ... + """ + The ID of the Amazon Virtual Private Cloud (Amazon VPC) associated with + the Amazon EKS cluster. + """ + ec2_instance_uids: list[str] | None = ... + """ + A list of unique identifiers for the Amazon EC2 instances that serve as + worker nodes in the Amazon EKS cluster. + """ + +@dataclass(kw_only=True) +class EksClusterDetails(_SerdeShape): + """Details about the EKS cluster involved in a Kubernetes finding.""" + + name: str | None = ... + """EKS cluster name.""" + arn: str | None = ... + """EKS cluster ARN.""" + vpc_id: str | None = ... + """The VPC ID to which the EKS cluster is attached.""" + status: str | None = ... + """The EKS cluster status.""" + tags: list[Tag] | None = ... + """The EKS cluster tags.""" + created_at: datetime | None = ... + """The timestamp when the EKS cluster was created.""" + +@dataclass(kw_only=True) +class EnableOrganizationAdminAccountInput(_SerdeShape): + """Dataclass for EnableOrganizationAdminAccountInput structure.""" + + admin_account_id: str | None = ... + """ + The Amazon Web Services account ID for the organization account to be + enabled as a GuardDuty delegated administrator. + """ + +@dataclass(kw_only=True) +class EnableOrganizationAdminAccountOutput(_SerdeShape): + """Dataclass for EnableOrganizationAdminAccountOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class Evidence(_SerdeShape): + """Contains information about the reason that the finding was generated.""" + + threat_intelligence_details: list[ThreatIntelligenceDetail] | None = ... + """A list of threat intelligence details related to the evidence.""" + +@dataclass(kw_only=True) +class FargateDetails(_SerdeShape): + """ + Contains information about Amazon Web Services Fargate details + associated with an Amazon ECS cluster. + """ + + issues: list[str] | None = ... + """ + Runtime coverage issues identified for the resource running on Amazon + Web Services Fargate. + """ + management_type: str | None = ... + """ + Indicates how the GuardDuty security agent is managed for this resource. + + - `AUTO_MANAGED` indicates that GuardDuty deploys and manages updates + for this resource. + + - `DISABLED` indicates that the deployment of the GuardDuty security + agent is disabled for this resource. + + Note: + The `MANUAL` status doesn't apply to the Amazon Web Services Fargate + (Amazon ECS only) woprkloads. + """ + +class FeatureAdditionalConfiguration(UnknownEnumMixin, StrEnum): + EKS_ADDON_MANAGEMENT = "EKS_ADDON_MANAGEMENT" + ECS_FARGATE_AGENT_MANAGEMENT = "ECS_FARGATE_AGENT_MANAGEMENT" + EC2_AGENT_MANAGEMENT = "EC2_AGENT_MANAGEMENT" + +class FeatureStatus(UnknownEnumMixin, StrEnum): + ENABLED = "ENABLED" + DISABLED = "DISABLED" + +class Feedback(UnknownEnumMixin, StrEnum): + USEFUL = "USEFUL" + NOT_USEFUL = "NOT_USEFUL" + +class FilterAction(UnknownEnumMixin, StrEnum): + NOOP = "NOOP" + ARCHIVE = "ARCHIVE" + +@dataclass(kw_only=True) +class FilterCondition(_SerdeShape): + """Contains information about the condition.""" + + equals_value: str | None = ... + """ + Represents an *equal* condition to be applied to a single field when + querying for scan entries. + """ + greater_than: int | None = ... + """ + Represents a *greater than* condition to be applied to a single field + when querying for scan entries. + """ + less_than: int | None = ... + """ + Represents a *less than* condition to be applied to a single field when + querying for scan entries. + """ + +@dataclass(kw_only=True) +class FilterCriteria(_SerdeShape): + """ + Represents the criteria to be used in the filter for describing scan + entries. + """ + + filter_criterion: list[FilterCriterion] | None = ... + """ + Represents a condition that when matched will be added to the response + of the operation. + """ + +@dataclass(kw_only=True) +class FilterCriterion(_SerdeShape): + """ + Represents a condition that when matched will be added to the response + of the operation. Irrespective of using any filter criteria, an + administrator account can view the scan entries for all of its member + accounts. However, each member account can view the scan entries only + for their own account. + """ + + criterion_key: str | None = ... + """ + An enum value representing possible scan properties to match with given + scan entries. + """ + filter_condition: FilterCondition | None = ... + """Contains information about the condition.""" + +class FilterFieldName(UnknownEnumMixin, StrEnum): + NAME = "name" + DESCRIPTION = "description" + DATA_SOURCE = "dataSource" + SEVERITY = "severity" + TACTIC = "tactic" + TECHNIQUE = "technique" + SERVICE = "service" + +@dataclass(kw_only=True) +class Finding(_SerdeShape): + """ + Contains information about the finding that is generated when abnormal + or suspicious activity is detected. + """ + + account_id: str | None = ... + """The ID of the account in which the finding was generated.""" + arn: str | None = ... + """The ARN of the finding.""" + confidence: float | None = ... + """The confidence score for the finding.""" + created_at: str | None = ... + """The time and date when the finding was created.""" + description: str | None = ... + """The description of the finding.""" + id: str | None = ... + """The ID of the finding.""" + partition: str | None = ... + """The partition associated with the finding.""" + region: str | None = ... + """ + The Region where the finding was generated. For findings generated from + [Global Service + Events](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-concepts.html#cloudtrail-concepts-global-service-events), + the Region value in the finding might differ from the Region where + GuardDuty identifies the potential threat. For more information, see + [How GuardDuty handles Amazon Web Services CloudTrail global + events](https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_data-sources.html#cloudtrail_global) + in the *Amazon GuardDuty User Guide*. + """ + resource: Resource | None = ... + """ + Contains information about the Amazon Web Services resource associated + with the activity that prompted GuardDuty to generate a finding. + """ + schema_version: str | None = ... + """The version of the schema used for the finding.""" + service: Service | None = ... + """Contains additional information about the generated finding.""" + severity: float | None = ... + """The severity of the finding.""" + title: str | None = ... + """The title of the finding.""" + type: str | None = ... + """The type of finding.""" + updated_at: str | None = ... + """The time and date when the finding was last updated.""" + associated_attack_sequence_arn: str | None = ... + """Amazon Resource Name (ARN) associated with the attack sequence finding.""" + +@dataclass(kw_only=True) +class FindingCriteria(_SerdeShape): + """Contains information about the criteria used for querying findings.""" + + criterion: dict[str, Condition] | None = ... + """ + Represents a map of finding properties that match specified conditions + and values when querying findings. + """ + +class FindingPublishingFrequency(UnknownEnumMixin, StrEnum): + FIFTEEN_MINUTES = "FIFTEEN_MINUTES" + ONE_HOUR = "ONE_HOUR" + SIX_HOURS = "SIX_HOURS" + +class FindingResourceType(UnknownEnumMixin, StrEnum): + EC2_INSTANCE = "EC2_INSTANCE" + EC2_NETWORK_INTERFACE = "EC2_NETWORK_INTERFACE" + S3_BUCKET = "S3_BUCKET" + S3_OBJECT = "S3_OBJECT" + ACCESS_KEY = "ACCESS_KEY" + EKS_CLUSTER = "EKS_CLUSTER" + KUBERNETES_WORKLOAD = "KUBERNETES_WORKLOAD" + CONTAINER = "CONTAINER" + ECS_CLUSTER = "ECS_CLUSTER" + ECS_TASK = "ECS_TASK" + AUTOSCALING_AUTO_SCALING_GROUP = "AUTOSCALING_AUTO_SCALING_GROUP" + IAM_INSTANCE_PROFILE = "IAM_INSTANCE_PROFILE" + CLOUDFORMATION_STACK = "CLOUDFORMATION_STACK" + EC2_LAUNCH_TEMPLATE = "EC2_LAUNCH_TEMPLATE" + EC2_VPC = "EC2_VPC" + EC2_IMAGE = "EC2_IMAGE" + BEDROCK_CUSTOM_MODEL = "BEDROCK_CUSTOM_MODEL" + """An Amazon Bedrock custom model fine-tuned by the customer.""" + BEDROCK_IMPORTED_MODEL = "BEDROCK_IMPORTED_MODEL" + """An Amazon Bedrock imported model brought in from an external source.""" + BEDROCK_PROVISIONED_MODEL = "BEDROCK_PROVISIONED_MODEL" + """An Amazon Bedrock model with provisioned throughput.""" + BEDROCK_CUSTOM_MODEL_DEPLOYMENT = "BEDROCK_CUSTOM_MODEL_DEPLOYMENT" + """A deployment of an Amazon Bedrock custom model.""" + BEDROCK_INFERENCE_PROFILE = "BEDROCK_INFERENCE_PROFILE" + """ + An Amazon Bedrock inference profile that routes model invocations across + Regions. + """ + BEDROCK_APPLICATION_INFERENCE_PROFILE = "BEDROCK_APPLICATION_INFERENCE_PROFILE" + """ + An application-scoped Amazon Bedrock inference profile used to track + invocation usage. + """ + BEDROCK_PROMPT = "BEDROCK_PROMPT" + """A managed prompt stored in Amazon Bedrock Prompt Management.""" + BEDROCK_PROMPT_ROUTER = "BEDROCK_PROMPT_ROUTER" + """An Amazon Bedrock prompt router that selects a model per request.""" + BEDROCK_GUARDRAIL = "BEDROCK_GUARDRAIL" + """An Amazon Bedrock guardrail evaluated during a model invocation.""" + SAGEMAKER_ENDPOINT = "SAGEMAKER_ENDPOINT" + """An Amazon SageMaker inference endpoint.""" + +@dataclass(kw_only=True) +class FindingStatistics(_SerdeShape): + """Contains information about finding statistics.""" + + count_by_severity: dict[str, int] | None = ... + """ + Represents a list of map of severity to count statistics for a set of + findings. + """ + grouped_by_account: list[AccountStatistics] | None = ... + """ + Represents a list of map of accounts with a findings count associated + with each account. + """ + grouped_by_date: list[DateStatistics] | None = ... + """ + Represents a list of map of dates with a count of total findings + generated on each date per severity level. + """ + grouped_by_finding_type: list[FindingTypeStatistics] | None = ... + """ + Represents a list of map of finding types with a count of total findings + generated for each type. + + Based on the `orderBy` parameter, this request returns either the most + occurring finding types or the least occurring finding types. If the + `orderBy` parameter is `ASC`, this will represent the least occurring + finding types in your account; otherwise, this will represent the most + occurring finding types. The default value of `orderBy` is `DESC`. + """ + grouped_by_resource: list[ResourceStatistics] | None = ... + """ + Represents a list of map of top resources with a count of total + findings. + """ + grouped_by_severity: list[SeverityStatistics] | None = ... + """Represents a list of map of total findings for each severity level.""" + +class FindingStatisticType(UnknownEnumMixin, StrEnum): + COUNT_BY_SEVERITY = "COUNT_BY_SEVERITY" + +@dataclass(kw_only=True) +class FindingTypeStatistics(_SerdeShape): + """ + Information about each finding type associated with the + `groupedByFindingType` statistics. + """ + + finding_type: str | None = ... + """Name of the finding type.""" + last_generated_at: datetime | None = ... + """ + The timestamp at which this finding type was last generated in your + environment. + """ + total_findings: int | None = ... + """ + The total number of findings associated with generated for each distinct + finding type. + """ + +@dataclass(kw_only=True) +class FlowLogsConfigurationResult(_SerdeShape): + """Contains information on the status of VPC flow logs as a data source.""" + + status: str | None = ... + """Denotes whether VPC flow logs is enabled as a data source.""" + +@dataclass(kw_only=True) +class FreeTrialFeatureConfigurationResult(_SerdeShape): + """Contains information about the free trial period for a feature.""" + + name: str | None = ... + """The name of the feature for which the free trial is configured.""" + free_trial_days_remaining: int | None = ... + """The number of the remaining free trial days for the feature.""" + +class FreeTrialFeatureResult(UnknownEnumMixin, StrEnum): + FLOW_LOGS = "FLOW_LOGS" + CLOUD_TRAIL = "CLOUD_TRAIL" + DNS_LOGS = "DNS_LOGS" + S3_DATA_EVENTS = "S3_DATA_EVENTS" + EKS_AUDIT_LOGS = "EKS_AUDIT_LOGS" + EBS_MALWARE_PROTECTION = "EBS_MALWARE_PROTECTION" + RDS_LOGIN_EVENTS = "RDS_LOGIN_EVENTS" + LAMBDA_NETWORK_LOGS = "LAMBDA_NETWORK_LOGS" + EKS_RUNTIME_MONITORING = "EKS_RUNTIME_MONITORING" + EC2_RUNTIME_MONITORING = "EC2_RUNTIME_MONITORING" + FARGATE_RUNTIME_MONITORING = "FARGATE_RUNTIME_MONITORING" + AI_PROTECTION = "AI_PROTECTION" + +@dataclass(kw_only=True) +class GeoLocation(_SerdeShape): + """ + Contains information about the location of the remote IP address. By + default, GuardDuty returns `Geolocation` with `Lat` and `Lon` as `0.0`. + """ + + lat: float | None = ... + """The latitude information of the remote IP address.""" + lon: float | None = ... + """The longitude information of the remote IP address.""" + +@dataclass(kw_only=True) +class GetAdministratorAccountInput(_SerdeShape): + """Dataclass for GetAdministratorAccountInput structure.""" + + detector_id: str | None = ... + """The unique ID of the detector of the GuardDuty member account.""" + +@dataclass(kw_only=True) +class GetAdministratorAccountOutput(_SerdeShape): + """Dataclass for GetAdministratorAccountOutput structure.""" + + administrator: Administrator | None = ... + """The administrator account details.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetCoverageStatisticsInput(_SerdeShape): + """Dataclass for GetCoverageStatisticsInput structure.""" + + detector_id: str | None = ... + """ + The unique ID of the GuardDuty detector. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + filter_criteria: CoverageFilterCriteria | None = ... + """Represents the criteria used to filter the coverage statistics.""" + statistics_type: list[str] | None = ... + """Represents the statistics type used to aggregate the coverage details.""" + +@dataclass(kw_only=True) +class GetCoverageStatisticsOutput(_SerdeShape): + """Dataclass for GetCoverageStatisticsOutput structure.""" + + coverage_statistics: CoverageStatistics | None = ... + """Represents the count aggregated by the `statusCode` and `resourceType`.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetCustomDetectionRuleAssociationInput(_SerdeShape): + """Dataclass for GetCustomDetectionRuleAssociationInput structure.""" + + rule_id: str | None = ... + """The unique identifier for the custom detection rule.""" + association_id: str | None = ... + """The unique identifier for the association.""" + +@dataclass(kw_only=True) +class GetCustomDetectionRuleAssociationOutput(_SerdeShape): + """Dataclass for GetCustomDetectionRuleAssociationOutput structure.""" + + rule_association: AssociationDetail | None = ... + """The details of the custom detection rule association.""" + tags: dict[str, str] | None = ... + """The tags associated with the custom detection rule association resource.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetCustomDetectionRuleInput(_SerdeShape): + """Dataclass for GetCustomDetectionRuleInput structure.""" + + rule_id: str | None = ... + """The unique identifier for the custom detection rule.""" + +@dataclass(kw_only=True) +class GetCustomDetectionRuleOrgConfigurationInput(_SerdeShape): + """Dataclass for GetCustomDetectionRuleOrgConfigurationInput structure.""" + + rule_id: str | None = ... + """The unique identifier for the custom detection rule.""" + mode: str | None = ... + """ + The execution mode of the organization configuration to retrieve. Valid + values: `LIVE` | `DRY_RUN`. + """ + +@dataclass(kw_only=True) +class GetCustomDetectionRuleOrgConfigurationOutput(_SerdeShape): + """Dataclass for GetCustomDetectionRuleOrgConfigurationOutput structure.""" + + configuration: DetectionRuleOrgConfiguration | None = ... + """The details of the organization configuration.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetCustomDetectionRuleOutput(_SerdeShape): + """Dataclass for GetCustomDetectionRuleOutput structure.""" + + rule: RuleDetail | None = ... + """The details of the custom detection rule.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetDetectorInput(_SerdeShape): + """Dataclass for GetDetectorInput structure.""" + + detector_id: str | None = ... + """ + The unique ID of the detector that you want to get. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + +@dataclass(kw_only=True) +class GetDetectorOutput(_SerdeShape): + """Dataclass for GetDetectorOutput structure.""" + + created_at: str | None = ... + """The timestamp of when the detector was created.""" + finding_publishing_frequency: str | None = ... + """The publishing frequency of the finding.""" + service_role: str | None = ... + """The GuardDuty service role.""" + status: str | None = ... + """The detector status.""" + updated_at: str | None = ... + """The last-updated timestamp for the detector.""" + data_sources: DataSourceConfigurationsResult | None = ... + """Describes which data sources are enabled for the detector.""" + tags: dict[str, str] | None = ... + """The tags of the detector resource.""" + features: list[DetectorFeatureConfigurationResult] | None = ... + """Describes the features that have been enabled for the detector.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetFilterInput(_SerdeShape): + """Dataclass for GetFilterInput structure.""" + + detector_id: str | None = ... + """ + The unique ID of the detector that is associated with this filter. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + filter_name: str | None = ... + """The name of the filter you want to get.""" + +@dataclass(kw_only=True) +class GetFilterOutput(_SerdeShape): + """Dataclass for GetFilterOutput structure.""" + + name: str | None = ... + """The name of the filter.""" + description: str | None = ... + """The description of the filter.""" + action: str | None = ... + """ + Specifies the action that is to be applied to the findings that match + the filter. + """ + rank: int | None = ... + """ + Specifies the position of the filter in the list of current filters. + Also specifies the order in which this filter is applied to the + findings. + """ + finding_criteria: FindingCriteria | None = ... + """Represents the criteria to be used in the filter for querying findings.""" + tags: dict[str, str] | None = ... + """The tags of the filter resource.""" + created_at: datetime | None = ... + """ + The timestamp when the filter was created. This field is not available + for filters that were created before the lifecycle metadata feature was + enabled (legacy filters). + """ + updated_at: datetime | None = ... + """ + The timestamp when the filter was last updated. For legacy filters, this + field is present only after the filter has been updated at least once + since the lifecycle metadata feature was enabled. + """ + version: int | None = ... + """ + The version of the filter. Every time the filter is updated, the version + increments by 1. This field is not available for legacy filters that + were created before the lifecycle metadata feature was enabled. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetFindingsInput(_SerdeShape): + """Dataclass for GetFindingsInput structure.""" + + detector_id: str | None = ... + """ + The ID of the detector that specifies the GuardDuty service whose + findings you want to retrieve. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + finding_ids: list[str] | None = ... + """The IDs of the findings that you want to retrieve.""" + sort_criteria: SortCriteria | None = ... + """Represents the criteria used for sorting findings.""" + +@dataclass(kw_only=True) +class GetFindingsOutput(_SerdeShape): + """Dataclass for GetFindingsOutput structure.""" + + findings: list[Finding] | None = ... + """A list of findings.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetFindingsStatisticsInput(_SerdeShape): + """Dataclass for GetFindingsStatisticsInput structure.""" + + detector_id: str | None = ... + """ + The ID of the detector whose findings statistics you want to retrieve. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + finding_statistic_types: list[str] | None = ... + """The types of finding statistics to retrieve.""" + finding_criteria: FindingCriteria | None = ... + """Represents the criteria that is used for querying findings.""" + group_by: str | None = ... + """ + Displays the findings statistics grouped by one of the listed valid + values. + """ + order_by: str | None = ... + """ + Displays the sorted findings in the requested order. The default value + of `orderBy` is `DESC`. + + You can use this parameter only with the `groupBy` parameter. + """ + max_results: int | None = ... + """ + The maximum number of results to be returned in the response. The + default value is 25. + + You can use this parameter only with the `groupBy` parameter. + """ + +@dataclass(kw_only=True) +class GetFindingsStatisticsOutput(_SerdeShape): + """Dataclass for GetFindingsStatisticsOutput structure.""" + + finding_statistics: FindingStatistics | None = ... + """The finding statistics object.""" + next_token: str | None = ... + """ + The pagination parameter to be used on the next list operation to + retrieve more items. + + This parameter is currently not supported. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetInvestigationInput(_SerdeShape): + """Dataclass for GetInvestigationInput structure.""" + + detector_id: str | None = ... + """ + The unique ID of the GuardDuty detector associated with the + investigation. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + investigation_id: str | None = ... + """The unique identifier of the investigation to retrieve.""" + +@dataclass(kw_only=True) +class GetInvestigationOutput(_SerdeShape): + """Dataclass for GetInvestigationOutput structure.""" + + investigation: Investigation | None = ... + """The details and results of the requested investigation.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetInvitationsCountInput(_SerdeShape): + """Dataclass for GetInvitationsCountInput structure.""" + +@dataclass(kw_only=True) +class GetInvitationsCountOutput(_SerdeShape): + """Dataclass for GetInvitationsCountOutput structure.""" + + invitations_count: int | None = ... + """The number of received invitations.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetIPSetInput(_SerdeShape): + """Dataclass for GetIPSetInput structure.""" + + detector_id: str | None = ... + """ + The unique ID of the detector that is associated with the IPSet. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + ip_set_id: str | None = ... + """The unique ID of the IPSet to retrieve.""" + +@dataclass(kw_only=True) +class GetIPSetOutput(_SerdeShape): + """Dataclass for GetIPSetOutput structure.""" + + name: str | None = ... + """The user-friendly name for the IPSet.""" + format: str | None = ... + """The format of the file that contains the IPSet.""" + location: str | None = ... + """The URI of the file that contains the IPSet.""" + status: str | None = ... + """The status of IPSet file that was uploaded.""" + tags: dict[str, str] | None = ... + """The tags of the IPSet resource.""" + expected_bucket_owner: str | None = ... + """ + The Amazon Web Services account ID that owns the Amazon S3 bucket + specified in the **location** parameter. This field appears in the + response only if it was provided during IPSet creation or update. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetMalwareProtectionPlanInput(_SerdeShape): + """Dataclass for GetMalwareProtectionPlanInput structure.""" + + malware_protection_plan_id: str | None = ... + """A unique identifier associated with Malware Protection plan resource.""" + +@dataclass(kw_only=True) +class GetMalwareProtectionPlanOutput(_SerdeShape): + """Dataclass for GetMalwareProtectionPlanOutput structure.""" + + arn: str | None = ... + """Amazon Resource Name (ARN) of the protected resource.""" + role: str | None = ... + """ + Amazon Resource Name (ARN) of the IAM role that includes the permissions + to scan and add tags to the associated protected resource. + """ + protected_resource: CreateProtectedResource | None = ... + """ + Information about the protected resource that is associated with the + created Malware Protection plan. Presently, `S3Bucket` is the only + supported protected resource. + """ + actions: MalwareProtectionPlanActions | None = ... + """ + Information about whether the tags will be added to the S3 object after + scanning. + """ + created_at: datetime | None = ... + """The timestamp when the Malware Protection plan resource was created.""" + status: str | None = ... + """Malware Protection plan status.""" + status_reasons: list[MalwareProtectionPlanStatusReason] | None = ... + """ + Information about the issue code and message associated to the status of + your Malware Protection plan. + """ + tags: dict[str, str] | None = ... + """Tags added to the Malware Protection plan resource.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetMalwareScanInput(_SerdeShape): + """Dataclass for GetMalwareScanInput structure.""" + + scan_id: str | None = ... + """ + A unique identifier that gets generated when you invoke the API without + any error. Each malware scan has a corresponding scan ID. Using this + scan ID, you can monitor the status of your malware scan. + """ + +@dataclass(kw_only=True) +class GetMalwareScanOutput(_SerdeShape): + """Dataclass for GetMalwareScanOutput structure.""" + + scan_id: str | None = ... + """ + A unique identifier associated with the malware scan. Each malware scan + has a corresponding scan ID. Using this scan ID, you can monitor the + status of your malware scan. + """ + detector_id: str | None = ... + """ + The unique ID of the detector that is associated with the request, if it + belongs to an account which is a GuardDuty customer. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + admin_detector_id: str | None = ... + """ + The unique detector ID of the administrator account that the request is + associated with. If the account is an administrator, the + `AdminDetectorId` will be the same as the one used for + `DetectorId. If the customer is not a GuardDuty customer, this field will not be present.`. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + resource_arn: str | None = ... + """ + Amazon Resource Name (ARN) of the resource on which a malware scan was + invoked. + """ + resource_type: str | None = ... + """The type of resource that was scanned for malware.""" + scanned_resources_count: int | None = ... + """ + The total number of resources that were successfully scanned. This is + dependent on the resource type. + """ + skipped_resources_count: int | None = ... + """The total number of resources that were skipped during the scan.""" + failed_resources_count: int | None = ... + """The total number of resources that failed to be scanned.""" + scanned_resources: list[ScannedResource] | None = ... + """ + A list of resources along with their metadata that were scanned as part + of the malware scan operation. + """ + scan_configuration: ScanConfiguration | None = ... + """Information about the scan configuration used for the malware scan.""" + scan_category: str | None = ... + """The category of the malware scan, indicating the type of scan performed.""" + scan_status: str | None = ... + """A value representing the current status of the malware scan.""" + scan_status_reason: str | None = ... + """Represents the reason for the current scan status, if applicable.""" + scan_type: str | None = ... + """A value representing the initiator of the scan.""" + scan_started_at: datetime | None = ... + """The timestamp representing when the malware scan was started.""" + scan_completed_at: datetime | None = ... + """The timestamp representing when the malware scan was completed.""" + scan_result_details: GetMalwareScanResultDetails | None = ... + """ + Detailed information about the results of the malware scan, if the scan + completed. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetMalwareScanResultDetails(_SerdeShape): + """Contains information about the results of the malware scan.""" + + scan_result_status: str | None = ... + """Status indicating whether threats were found for a completed scan.""" + skipped_file_count: int | None = ... + """The total number of files that were skipped during the scan.""" + failed_file_count: int | None = ... + """The total number of files that failed to be scanned.""" + threat_found_file_count: int | None = ... + """The total number of files in which threats were detected.""" + total_file_count: int | None = ... + """The total number of files that were processed during the scan.""" + total_bytes: int | None = ... + """The total number of bytes that were scanned.""" + unique_threat_count: int | None = ... + """The total number of unique threats that were detected during the scan.""" + threats: list[ScanResultThreat] | None = ... + """The threats that were detected during the malware scan.""" + +@dataclass(kw_only=True) +class GetMalwareScanSettingsInput(_SerdeShape): + """Dataclass for GetMalwareScanSettingsInput structure.""" + + detector_id: str | None = ... + """ + The unique ID of the detector that is associated with this scan. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + +@dataclass(kw_only=True) +class GetMalwareScanSettingsOutput(_SerdeShape): + """Dataclass for GetMalwareScanSettingsOutput structure.""" + + scan_resource_criteria: ScanResourceCriteria | None = ... + """Represents the criteria to be used in the filter for scanning resources.""" + ebs_snapshot_preservation: str | None = ... + """An enum value representing possible snapshot preservation settings.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetMasterAccountInput(_SerdeShape): + """Dataclass for GetMasterAccountInput structure.""" + + detector_id: str | None = ... + """ + The unique ID of the detector of the GuardDuty member account. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + +@dataclass(kw_only=True) +class GetMasterAccountOutput(_SerdeShape): + """Dataclass for GetMasterAccountOutput structure.""" + + master: Master | None = ... + """The administrator account details.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetMemberDetectorsInput(_SerdeShape): + """Dataclass for GetMemberDetectorsInput structure.""" + + detector_id: str | None = ... + """ + The detector ID for the administrator account. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + account_ids: list[str] | None = ... + """A list of member account IDs.""" + +@dataclass(kw_only=True) +class GetMemberDetectorsOutput(_SerdeShape): + """Dataclass for GetMemberDetectorsOutput structure.""" + + member_data_source_configurations: list[MemberDataSourceConfiguration] | None = ... + """ + An object that describes which data sources are enabled for a member + account. + """ + unprocessed_accounts: list[UnprocessedAccount] | None = ... + """ + A list of member account IDs that were unable to be processed along with + an explanation for why they were not processed. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetMembersInput(_SerdeShape): + """Dataclass for GetMembersInput structure.""" + + detector_id: str | None = ... + """ + The unique ID of the detector of the GuardDuty account whose members you + want to retrieve. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + account_ids: list[str] | None = ... + """ + A list of account IDs of the GuardDuty member accounts that you want to + describe. + """ + +@dataclass(kw_only=True) +class GetMembersOutput(_SerdeShape): + """Dataclass for GetMembersOutput structure.""" + + members: list[Member] | None = ... + """A list of members.""" + unprocessed_accounts: list[UnprocessedAccount] | None = ... + """ + A list of objects that contain the unprocessed account and a result + string that explains why it was unprocessed. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetOrganizationStatisticsInput(_SerdeShape): + """Dataclass for GetOrganizationStatisticsInput structure.""" + +@dataclass(kw_only=True) +class GetOrganizationStatisticsOutput(_SerdeShape): + """Dataclass for GetOrganizationStatisticsOutput structure.""" + + organization_details: OrganizationDetails | None = ... + """Information about the statistics report for your organization.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetRemainingFreeTrialDaysInput(_SerdeShape): + """Dataclass for GetRemainingFreeTrialDaysInput structure.""" + + detector_id: str | None = ... + """ + The unique ID of the detector of the GuardDuty member account. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + account_ids: list[str] | None = ... + """A list of account identifiers of the GuardDuty member account.""" + +@dataclass(kw_only=True) +class GetRemainingFreeTrialDaysOutput(_SerdeShape): + """Dataclass for GetRemainingFreeTrialDaysOutput structure.""" + + accounts: list[AccountFreeTrialInfo] | None = ... + """ + The member accounts which were included in a request and were processed + successfully. + """ + unprocessed_accounts: list[UnprocessedAccount] | None = ... + """ + The member account that was included in a request but for which the + request could not be processed. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetThreatEntitySetInput(_SerdeShape): + """Dataclass for GetThreatEntitySetInput structure.""" + + detector_id: str | None = ... + """ + The unique ID of the detector associated with the threat entity set + resource. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + threat_entity_set_id: str | None = ... + """The unique ID that helps GuardDuty identify the threat entity set.""" + +@dataclass(kw_only=True) +class GetThreatEntitySetOutput(_SerdeShape): + """Dataclass for GetThreatEntitySetOutput structure.""" + + name: str | None = ... + """ + The name of the threat entity set associated with the specified + `threatEntitySetId`. + """ + format: str | None = ... + """The format of the file that contains the threat entity set.""" + location: str | None = ... + """The URI of the file that contains the threat entity set.""" + expected_bucket_owner: str | None = ... + """ + The Amazon Web Services account ID that owns the Amazon S3 bucket + specified in the **location** parameter. + """ + status: str | None = ... + """The status of the associated threat entity set.""" + tags: dict[str, str] | None = ... + """The tags associated with the threat entity set resource.""" + created_at: datetime | None = ... + """The timestamp when the associated threat entity set was created.""" + updated_at: datetime | None = ... + """The timestamp when the associated threat entity set was updated.""" + error_details: str | None = ... + """The error details when the status is shown as `ERROR`.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetThreatIntelSetInput(_SerdeShape): + """Dataclass for GetThreatIntelSetInput structure.""" + + detector_id: str | None = ... + """ + The unique ID of the detector that is associated with the + threatIntelSet. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + threat_intel_set_id: str | None = ... + """The unique ID of the threatIntelSet that you want to get.""" + +@dataclass(kw_only=True) +class GetThreatIntelSetOutput(_SerdeShape): + """Dataclass for GetThreatIntelSetOutput structure.""" + + name: str | None = ... + """ + A user-friendly ThreatIntelSet name displayed in all findings that are + generated by activity that involves IP addresses included in this + ThreatIntelSet. + """ + format: str | None = ... + """The format of the threatIntelSet.""" + location: str | None = ... + """The URI of the file that contains the ThreatIntelSet.""" + status: str | None = ... + """The status of threatIntelSet file uploaded.""" + tags: dict[str, str] | None = ... + """The tags of the threat list resource.""" + expected_bucket_owner: str | None = ... + """ + The Amazon Web Services account ID that owns the Amazon S3 bucket + specified in the **location** parameter. This field appears in the + response only if it was provided during ThreatIntelSet creation or + update. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetTrustedEntitySetInput(_SerdeShape): + """Dataclass for GetTrustedEntitySetInput structure.""" + + detector_id: str | None = ... + """ + The unique ID of the GuardDuty detector associated with this trusted + entity set. + """ + trusted_entity_set_id: str | None = ... + """The unique ID that helps GuardDuty identify the trusted entity set.""" + +@dataclass(kw_only=True) +class GetTrustedEntitySetOutput(_SerdeShape): + """Dataclass for GetTrustedEntitySetOutput structure.""" + + name: str | None = ... + """ + The name of the threat entity set associated with the specified + `trustedEntitySetId`. + """ + format: str | None = ... + """The format of the file that contains the trusted entity set.""" + location: str | None = ... + """The URI of the file that contains the trusted entity set.""" + expected_bucket_owner: str | None = ... + """ + The Amazon Web Services account ID that owns the Amazon S3 bucket + specified in the **location** parameter. + """ + status: str | None = ... + """The status of the associated trusted entity set.""" + tags: dict[str, str] | None = ... + """The tags associated with trusted entity set resource.""" + created_at: datetime | None = ... + """The timestamp when the associated trusted entity set was created.""" + updated_at: datetime | None = ... + """The timestamp when the associated trusted entity set was updated.""" + error_details: str | None = ... + """The error details when the status is shown as `ERROR`.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetUsageStatisticsInput(_SerdeShape): + """Dataclass for GetUsageStatisticsInput structure.""" + + detector_id: str | None = ... + """ + The ID of the detector that specifies the GuardDuty service whose usage + statistics you want to retrieve. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + usage_statistic_type: str | None = ... + """The type of usage statistics to retrieve.""" + usage_criteria: UsageCriteria | None = ... + """Represents the criteria used for querying usage.""" + unit: str | None = ... + """ + The currency unit you would like to view your usage statistics in. + Current valid values are USD. + """ + max_results: int | None = ... + """The maximum number of results to return in the response.""" + next_token: str | None = ... + """ + A token to use for paginating results that are returned in the response. + Set the value of this parameter to null for the first request to a list + action. For subsequent calls, use the NextToken value returned from the + previous request to continue listing results after the first page. + """ + +@dataclass(kw_only=True) +class GetUsageStatisticsOutput(_SerdeShape): + """Dataclass for GetUsageStatisticsOutput structure.""" + + usage_statistics: UsageStatistics | None = ... + """ + The usage statistics object. If a UsageStatisticType was provided, the + objects representing other types will be null. + """ + next_token: str | None = ... + """ + The pagination parameter to be used on the next list operation to + retrieve more items. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class GroupByType(UnknownEnumMixin, StrEnum): + ACCOUNT = "ACCOUNT" + DATE = "DATE" + FINDING_TYPE = "FINDING_TYPE" + RESOURCE = "RESOURCE" + SEVERITY = "SEVERITY" + +class GuardrailAction(UnknownEnumMixin, StrEnum): + GUARDRAIL_INTERVENED = "GUARDRAIL_INTERVENED" + NONE = "NONE" + +class GuardrailSource(UnknownEnumMixin, StrEnum): + INPUT = "INPUT" + OUTPUT = "OUTPUT" + +@dataclass(kw_only=True) +class HighestSeverityThreatDetails(_SerdeShape): + """ + Contains details of the highest severity threat detected during scan and + number of infected files. + """ + + severity: str | None = ... + """Severity level of the highest severity threat detected.""" + threat_name: str | None = ... + """ + Threat name of the highest severity threat detected as part of the + malware scan. + """ + count: int | None = ... + """ + Total number of infected files with the highest severity threat + detected. + """ + +@dataclass(kw_only=True) +class HostPath(_SerdeShape): + """ + Represents a pre-existing file or directory on the host machine that the + volume maps to. + """ + + path: str | None = ... + """Path of the file or directory on the host that the volume maps to.""" + +@dataclass(kw_only=True) +class IamInstanceProfile(_SerdeShape): + """Contains information about the EC2 instance profile.""" + + arn: str | None = ... + """The profile ARN of the EC2 instance.""" + id: str | None = ... + """The profile ID of the EC2 instance.""" + +@dataclass(kw_only=True) +class IamInstanceProfileV2(_SerdeShape): + """ + Contains information about the IAM instance profile involved in a + GuardDuty finding, including unique identifiers of the Amazon EC2 + instances. + """ + + ec2_instance_uids: list[str] | None = ... + """ + A list of unique identifiers for the compromised Amazon EC2 instances + that share the same IAM instance profile. + """ + +@dataclass(kw_only=True) +class ImpersonatedUser(_SerdeShape): + """Contains information about the impersonated user.""" + + username: str | None = ... + """Information about the `username` that was being impersonated.""" + groups: list[str] | None = ... + """The `group` to which the user name belongs.""" + +@dataclass(kw_only=True) +class IncrementalScanDetails(_SerdeShape): + """Contains information about the incremental scan configuration.""" + + baseline_resource_arn: str | None = ... + """ + Amazon Resource Name (ARN) of the baseline resource used for incremental + scanning. The scan will only process changes since this baseline + resource was created. + """ + +@dataclass(kw_only=True) +class Indicator(_SerdeShape): + """ + Contains information about the indicators that include a set of signals + observed in an attack sequence. + """ + + key: str | None = ... + """ + Specific indicator keys observed in the attack sequence. For description + of the valid values for key, see [Attack sequence finding + details](https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_findings-summary.html#guardduty-extended-threat-detection-attack-sequence-finding-details) + in the *Amazon GuardDuty User Guide*. + """ + values: list[str] | None = ... + """ + Values associated with each indicator key. For example, if the indicator + key is `SUSPICIOUS_NETWORK`, then the value will be the name of the + network. If the indicator key is `ATTACK_TACTIC`, then the value will be + one of the MITRE tactics. + """ + title: str | None = ... + """Title describing the indicator.""" + +class IndicatorType(UnknownEnumMixin, StrEnum): + SUSPICIOUS_USER_AGENT = "SUSPICIOUS_USER_AGENT" + SUSPICIOUS_NETWORK = "SUSPICIOUS_NETWORK" + MALICIOUS_IP = "MALICIOUS_IP" + TOR_IP = "TOR_IP" + ATTACK_TACTIC = "ATTACK_TACTIC" + HIGH_RISK_API = "HIGH_RISK_API" + ATTACK_TECHNIQUE = "ATTACK_TECHNIQUE" + UNUSUAL_API_FOR_ACCOUNT = "UNUSUAL_API_FOR_ACCOUNT" + UNUSUAL_ASN_FOR_ACCOUNT = "UNUSUAL_ASN_FOR_ACCOUNT" + UNUSUAL_ASN_FOR_USER = "UNUSUAL_ASN_FOR_USER" + SUSPICIOUS_PROCESS = "SUSPICIOUS_PROCESS" + MALICIOUS_DOMAIN = "MALICIOUS_DOMAIN" + MALICIOUS_PROCESS = "MALICIOUS_PROCESS" + CRYPTOMINING_IP = "CRYPTOMINING_IP" + CRYPTOMINING_DOMAIN = "CRYPTOMINING_DOMAIN" + CRYPTOMINING_PROCESS = "CRYPTOMINING_PROCESS" + MALICIOUS_FILE = "MALICIOUS_FILE" + VULNERABILITY = "VULNERABILITY" + MALICIOUS_PACKAGE = "MALICIOUS_PACKAGE" + MISCONFIGURATION = "MISCONFIGURATION" + REACHABILITY = "REACHABILITY" + SENSITIVE_DATA = "SENSITIVE_DATA" + +@dataclass(kw_only=True) +class InstanceDetails(_SerdeShape): + """Contains information about the details of an instance.""" + + availability_zone: str | None = ... + """The Availability Zone of the EC2 instance.""" + iam_instance_profile: IamInstanceProfile | None = ... + """The profile information of the EC2 instance.""" + image_description: str | None = ... + """The image description of the EC2 instance.""" + image_id: str | None = ... + """The image ID of the EC2 instance.""" + instance_id: str | None = ... + """The ID of the EC2 instance.""" + instance_state: str | None = ... + """The state of the EC2 instance.""" + instance_type: str | None = ... + """The type of the EC2 instance.""" + outpost_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the Amazon Web Services Outpost. Only + applicable to Amazon Web Services Outposts instances. + """ + launch_time: str | None = ... + """The launch time of the EC2 instance.""" + network_interfaces: list[NetworkInterface] | None = ... + """The elastic network interface information of the EC2 instance.""" + platform: str | None = ... + """The platform of the EC2 instance.""" + product_codes: list[ProductCode] | None = ... + """The product code of the EC2 instance.""" + tags: list[Tag] | None = ... + """The tags of the EC2 instance.""" + +@dataclass(kw_only=True) +class InternalServerErrorException(ServiceError, _SerdeShape): + """An internal server error exception object.""" + + type: str | None = ... + """The error type.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class Investigation(_SerdeShape): + """Contains the details and results of a GuardDuty investigation.""" + + investigation_id: str | None = ... + """The unique identifier of the investigation.""" + status: str | None = ... + """ + The current status of the investigation. Possible values are `RUNNING`, + `COMPLETED`, and `FAILED`. + """ + trigger_prompt: str | None = ... + """The natural-language prompt that initiated this investigation.""" + triggered_by: str | None = ... + """The account that initiated the investigation.""" + metadata: InvestigationMetadata | None = ... + """Metadata about the product and version that produced the investigation.""" + cloud: CloudDetails | None = ... + """ + Details about the cloud environment in which the investigation was + performed, including the provider, region, and account. + """ + risk_level: str | None = ... + """ + The assessed risk level of the investigated threat. Possible values are + `Info`, `Low`, `Medium`, `High`, and `Critical`. + """ + risk: str | None = ... + """A human-readable description of the assessed risk.""" + confidence: str | None = ... + """ + The confidence level of the investigation's assessment. Possible values + are `Unknown`, `Low`, `Medium`, and `High`. + """ + summary: str | None = ... + """ + A structured summary of the investigation findings, including affected + resources, threat assessment, and recommended remediation steps. + """ + start_time: datetime | None = ... + """The timestamp at which the investigation started.""" + end_time: datetime | None = ... + """The timestamp at which the investigation completed.""" + error: str | None = ... + """Details about the error if the investigation status is `FAILED`.""" + +@dataclass(kw_only=True) +class InvestigationMetadata(_SerdeShape): + """ + Contains metadata about the product and version that produced an + investigation. + """ + + version: str | None = ... + """The version of the investigation engine that produced the results.""" + product: Product | None = ... + """Information about the product that produced the investigation.""" + +@dataclass(kw_only=True) +class InvestigationSortCriteria(_SerdeShape): + """Contains information about the criteria used for sorting investigations.""" + + attribute_name: str | None = ... + """The attribute by which to sort investigations.""" + order_by: str | None = ... + """The order in which the sorted results are to be displayed.""" + +class InvestigationSortField(UnknownEnumMixin, StrEnum): + START_TIME = "START_TIME" + END_TIME = "END_TIME" + STATUS = "STATUS" + RISK_LEVEL = "RISK_LEVEL" + CONFIDENCE = "CONFIDENCE" + +class InvestigationStatus(UnknownEnumMixin, StrEnum): + RUNNING = "RUNNING" + COMPLETED = "COMPLETED" + FAILED = "FAILED" + +@dataclass(kw_only=True) +class InvestigationSummary(_SerdeShape): + """Contains summary information about a GuardDuty investigation.""" + + investigation_id: str | None = ... + """The unique identifier of the investigation.""" + status: str | None = ... + """The current status of the investigation.""" + trigger_prompt: str | None = ... + """The natural-language prompt that initiated this investigation.""" + risk_level: str | None = ... + """The assessed risk level of the investigated threat.""" + confidence: str | None = ... + """The confidence level of the investigation's assessment.""" + title: str | None = ... + """A short title summarizing the investigation.""" + account_id: str | None = ... + """The Amazon Web Services account ID associated with the investigation.""" + start_time: datetime | None = ... + """The timestamp at which the investigation started.""" + end_time: datetime | None = ... + """The timestamp at which the investigation completed.""" + +@dataclass(kw_only=True) +class Invitation(_SerdeShape): + """Contains information about the invitation to become a member account.""" + + account_id: str | None = ... + """The ID of the account that the invitation was sent from.""" + invitation_id: str | None = ... + """ + The ID of the invitation. This value is used to validate the inviter + account to the member account. + """ + relationship_status: str | None = ... + """The status of the relationship between the inviter and invitee accounts.""" + invited_at: str | None = ... + """The timestamp when the invitation was sent.""" + +@dataclass(kw_only=True) +class InviteMembersInput(_SerdeShape): + """Dataclass for InviteMembersInput structure.""" + + detector_id: str | None = ... + """ + The unique ID of the detector of the GuardDuty account with which you + want to invite members. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + account_ids: list[str] | None = ... + """ + A list of account IDs of the accounts that you want to invite to + GuardDuty as members. + """ + disable_email_notification: bool | None = ... + """ + A Boolean value that specifies whether you want to disable email + notification to the accounts that you are inviting to GuardDuty as + members. + """ + message: str | None = ... + """ + The invitation message that you want to send to the accounts that + you're inviting to GuardDuty as members. + """ + +@dataclass(kw_only=True) +class InviteMembersOutput(_SerdeShape): + """Dataclass for InviteMembersOutput structure.""" + + unprocessed_accounts: list[UnprocessedAccount] | None = ... + """ + A list of objects that contain the unprocessed account and a result + string that explains why it was unprocessed. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class IpSetFormat(UnknownEnumMixin, StrEnum): + TXT = "TXT" + STIX = "STIX" + OTX_CSV = "OTX_CSV" + ALIEN_VAULT = "ALIEN_VAULT" + PROOF_POINT = "PROOF_POINT" + FIRE_EYE = "FIRE_EYE" + +class IpSetStatus(UnknownEnumMixin, StrEnum): + INACTIVE = "INACTIVE" + ACTIVATING = "ACTIVATING" + ACTIVE = "ACTIVE" + DEACTIVATING = "DEACTIVATING" + ERROR = "ERROR" + DELETE_PENDING = "DELETE_PENDING" + DELETED = "DELETED" + +@dataclass(kw_only=True) +class ItemDetails(_SerdeShape): + """Contains detailed information about where a threat was detected.""" + + resource_arn: str | None = ... + """ + Amazon Resource Name (ARN) of the resource where the threat was + detected. + """ + item_path: str | None = ... + """The path where the threat was detected.""" + hash: str | None = ... + """The hash value of the infected item.""" + additional_info: AdditionalInfo | None = ... + """Additional information about the detected threat item.""" + +@dataclass(kw_only=True) +class ItemPath(_SerdeShape): + """ + Information about the nested item path and hash of the protected + resource. + """ + + nested_item_path: str | None = ... + """The nested item path where the infected file was found.""" + hash: str | None = ... + """The hash value of the infected resource.""" + +@dataclass(kw_only=True) +class KubernetesApiCallAction(_SerdeShape): + """ + Information about the Kubernetes API call action described in this + finding. + """ + + request_uri: str | None = ... + """The Kubernetes API request URI.""" + verb: str | None = ... + """The Kubernetes API request HTTP verb.""" + resource: str | None = ... + """The resource component in the Kubernetes API call action.""" + subresource: str | None = ... + """The name of the sub-resource in the Kubernetes API call action.""" + namespace: str | None = ... + """ + The name of the namespace where the Kubernetes API call action takes + place. + """ + resource_name: str | None = ... + """The name of the resource in the Kubernetes API call action.""" + source_ips: list[str] | None = ... + """ + The IP of the Kubernetes API caller and the IPs of any proxies or load + balancers between the caller and the API endpoint. + """ + user_agent: str | None = ... + """The user agent of the caller of the Kubernetes API.""" + remote_ip_details: RemoteIpDetails | None = ... + """Contains information about the remote IP address of the connection.""" + status_code: int | None = ... + """The resulting HTTP response code of the Kubernetes API call action.""" + parameters: str | None = ... + """Parameters related to the Kubernetes API call action.""" + +@dataclass(kw_only=True) +class KubernetesAuditLogsConfiguration(_SerdeShape): + """Describes whether Kubernetes audit logs are enabled as a data source.""" + + enable: bool | None = ... + """The status of Kubernetes audit logs as a data source.""" + +@dataclass(kw_only=True) +class KubernetesAuditLogsConfigurationResult(_SerdeShape): + """Describes whether Kubernetes audit logs are enabled as a data source.""" + + status: str | None = ... + """ + A value that describes whether Kubernetes audit logs are enabled as a + data source. + """ + +@dataclass(kw_only=True) +class KubernetesConfiguration(_SerdeShape): + """Describes whether any Kubernetes data sources are enabled.""" + + audit_logs: KubernetesAuditLogsConfiguration | None = ... + """The status of Kubernetes audit logs as a data source.""" + +@dataclass(kw_only=True) +class KubernetesConfigurationResult(_SerdeShape): + """Describes whether any Kubernetes logs will be enabled as a data source.""" + + audit_logs: KubernetesAuditLogsConfigurationResult | None = ... + """Describes whether Kubernetes audit logs are enabled as a data source.""" + +@dataclass(kw_only=True) +class KubernetesDataSourceFreeTrial(_SerdeShape): + """ + Provides details about the Kubernetes resources when it is enabled as a + data source. + """ + + audit_logs: DataSourceFreeTrial | None = ... + """Describes whether Kubernetes audit logs are enabled as a data source.""" + +@dataclass(kw_only=True) +class KubernetesDetails(_SerdeShape): + """ + Details about Kubernetes resources such as a Kubernetes user or workload + resource involved in a Kubernetes finding. + """ + + kubernetes_user_details: KubernetesUserDetails | None = ... + """Details about the Kubernetes user involved in a Kubernetes finding.""" + kubernetes_workload_details: KubernetesWorkloadDetails | None = ... + """Details about the Kubernetes workload involved in a Kubernetes finding.""" + +@dataclass(kw_only=True) +class KubernetesPermissionCheckedDetails(_SerdeShape): + """ + Information about the Kubernetes API for which you check if you have + permission to call. + """ + + verb: str | None = ... + """ + The verb component of the Kubernetes API call. For example, when you + check whether or not you have the permission to call the `CreatePod` + API, the verb component will be `Create`. + """ + resource: str | None = ... + """ + The Kubernetes resource with which your Kubernetes API call will + interact. + """ + namespace: str | None = ... + """The namespace where the Kubernetes API action will take place.""" + allowed: bool | None = ... + """ + Information whether the user has the permission to call the Kubernetes + API. + """ + +class KubernetesResourcesTypes(UnknownEnumMixin, StrEnum): + PODS = "PODS" + JOBS = "JOBS" + CRONJOBS = "CRONJOBS" + DEPLOYMENTS = "DEPLOYMENTS" + DAEMONSETS = "DAEMONSETS" + STATEFULSETS = "STATEFULSETS" + REPLICASETS = "REPLICASETS" + REPLICATIONCONTROLLERS = "REPLICATIONCONTROLLERS" + +@dataclass(kw_only=True) +class KubernetesRoleBindingDetails(_SerdeShape): + """ + Contains information about the role binding that grants the permission + defined in a Kubernetes role. + """ + + kind: str | None = ... + """ + The kind of the role. For role binding, this value will be + `RoleBinding`. + """ + name: str | None = ... + """The name of the `RoleBinding`.""" + uid: str | None = ... + """The unique identifier of the role binding.""" + role_ref_name: str | None = ... + """ + The name of the role being referenced. This must match the name of the + `Role` or `ClusterRole` that you want to bind to. + """ + role_ref_kind: str | None = ... + """ + The type of the role being referenced. This could be either `Role` or + `ClusterRole`. + """ + +@dataclass(kw_only=True) +class KubernetesRoleDetails(_SerdeShape): + """Information about the Kubernetes role name and role type.""" + + kind: str | None = ... + """The kind of role. For this API, the value of `kind` will be `Role`.""" + name: str | None = ... + """The name of the Kubernetes role.""" + uid: str | None = ... + """The unique identifier of the Kubernetes role name.""" + +@dataclass(kw_only=True) +class KubernetesUserDetails(_SerdeShape): + """Details about the Kubernetes user involved in a Kubernetes finding.""" + + username: str | None = ... + """The username of the user who called the Kubernetes API.""" + uid: str | None = ... + """The user ID of the user who called the Kubernetes API.""" + groups: list[str] | None = ... + """The groups that include the user who called the Kubernetes API.""" + session_name: list[str] | None = ... + """ + Entity that assumes the IAM role when Kubernetes RBAC permissions are + assigned to that role. + """ + impersonated_user: ImpersonatedUser | None = ... + """Information about the impersonated user.""" + +@dataclass(kw_only=True) +class KubernetesWorkload(_SerdeShape): + """ + Contains information about Kubernetes workloads involved in a GuardDuty + finding, including pods, deployments, and other Kubernetes resources. + """ + + container_uids: list[str] | None = ... + """ + A list of unique identifiers for the containers that are part of the + Kubernetes workload. + """ + namespace: str | None = ... + """ + The Kubernetes namespace in which the workload is running, providing + logical isolation within the cluster. + """ + kubernetes_resources_types: str | None = ... + """The types of Kubernetes resources involved in the workload.""" + +@dataclass(kw_only=True) +class KubernetesWorkloadDetails(_SerdeShape): + """Details about the Kubernetes workload involved in a Kubernetes finding.""" + + name: str | None = ... + """Kubernetes workload name.""" + type: str | None = ... + """Kubernetes workload type (e.g. Pod, Deployment, etc.).""" + uid: str | None = ... + """Kubernetes workload ID.""" + namespace: str | None = ... + """Kubernetes namespace that the workload is part of.""" + host_network: bool | None = ... + """ + Whether the hostNetwork flag is enabled for the pods included in the + workload. + """ + service_account_name: str | None = ... + """The service account name that is associated with a Kubernetes workload.""" + containers: list[Container] | None = ... + """Containers running as part of the Kubernetes workload.""" + volumes: list[Volume] | None = ... + """Volumes used by the Kubernetes workload.""" + host_ipc: bool | None = ... + """Whether the host IPC flag is enabled for the pods in the workload.""" + host_pid: bool | None = ... + """Whether the host PID flag is enabled for the pods in the workload.""" + +@dataclass(kw_only=True) +class LambdaDetails(_SerdeShape): + """Information about the Lambda function involved in the finding.""" + + function_arn: str | None = ... + """Amazon Resource Name (ARN) of the Lambda function.""" + function_name: str | None = ... + """Name of the Lambda function.""" + description: str | None = ... + """Description of the Lambda function.""" + last_modified_at: datetime | None = ... + """ + The timestamp when the Lambda function was last modified. This field is + in the UTC date string format `(2023-03-22T19:37:20.168Z)`. + """ + revision_id: str | None = ... + """The revision ID of the Lambda function version.""" + function_version: str | None = ... + """The version of the Lambda function.""" + role: str | None = ... + """The execution role of the Lambda function.""" + vpc_config: VpcConfig | None = ... + """ + Amazon Virtual Private Cloud configuration details associated with your + Lambda function. + """ + tags: list[Tag] | None = ... + """ + A list of tags attached to this resource, listed in the format of + `key`:`value` pair. + """ + +@dataclass(kw_only=True) +class LineageObject(_SerdeShape): + """Information about the runtime process details.""" + + start_time: datetime | None = ... + """The time when the process started. This is in UTC format.""" + namespace_pid: int | None = ... + """The process ID of the child process.""" + user_id: int | None = ... + """The user ID of the user that executed the process.""" + name: str | None = ... + """The name of the process.""" + pid: int | None = ... + """The ID of the process.""" + uuid: str | None = ... + """The unique ID assigned to the process by GuardDuty.""" + executable_path: str | None = ... + """The absolute path of the process executable file.""" + euid: int | None = ... + """The effective user ID that was used to execute the process.""" + parent_uuid: str | None = ... + """ + The unique ID of the parent process. This ID is assigned to the parent + process by GuardDuty. + """ + +@dataclass(kw_only=True) +class ListCoverageInput(_SerdeShape): + """Dataclass for ListCoverageInput structure.""" + + detector_id: str | None = ... + """ + The unique ID of the detector whose coverage details you want to + retrieve. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + next_token: str | None = ... + """ + A token to use for paginating results that are returned in the response. + Set the value of this parameter to null for the first request to a list + action. For subsequent calls, use the NextToken value returned from the + previous request to continue listing results after the first page. + """ + max_results: int | None = ... + """The maximum number of results to return in the response.""" + filter_criteria: CoverageFilterCriteria | None = ... + """Represents the criteria used to filter the coverage details.""" + sort_criteria: CoverageSortCriteria | None = ... + """Represents the criteria used to sort the coverage details.""" + +@dataclass(kw_only=True) +class ListCoverageOutput(_SerdeShape): + """Dataclass for ListCoverageOutput structure.""" + + resources: list[CoverageResource] | None = ... + """A list of resources and their attributes providing cluster details.""" + next_token: str | None = ... + """ + The pagination parameter to be used on the next list operation to + retrieve more items. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListCustomDetectionRuleAssociationsInput(_SerdeShape): + """Dataclass for ListCustomDetectionRuleAssociationsInput structure.""" + + max_results: int | None = ... + """ + The maximum number of results to return in a single page. Minimum value + of 1, maximum value of 100. + """ + next_token: str | None = ... + """ + A pagination token from a previous response. Use this token to retrieve + the next page of results. + """ + rule_id: str | None = ... + """ + The unique identifier for the custom detection rule to filter + associations by. + """ + mode: str | None = ... + """The rule execution mode to filter associations by.""" + +@dataclass(kw_only=True) +class ListCustomDetectionRuleAssociationsOutput(_SerdeShape): + """Dataclass for ListCustomDetectionRuleAssociationsOutput structure.""" + + rule_associations: list[AssociationSummary] | None = ... + """A list of custom detection rule association summaries.""" + next_token: str | None = ... + """ + A pagination token to retrieve the next page of results. If this field + is empty, there are no additional results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListCustomDetectionRuleOrgConfigurationsInput(_SerdeShape): + """Dataclass for ListCustomDetectionRuleOrgConfigurationsInput structure.""" + + max_results: int | None = ... + """ + The maximum number of results to return in a single page. Minimum value + of 1, maximum value of 100. + """ + next_token: str | None = ... + """ + A pagination token from a previous response. Use this token to retrieve + the next page of results. + """ + status: str | None = ... + """The configuration status to filter by.""" + +@dataclass(kw_only=True) +class ListCustomDetectionRuleOrgConfigurationsOutput(_SerdeShape): + """Dataclass for ListCustomDetectionRuleOrgConfigurationsOutput structure.""" + + configurations: list[DetectionRuleOrgConfigurationSummary] | None = ... + """A list of organization configurations for custom detection rules.""" + next_token: str | None = ... + """ + A pagination token to retrieve the next page of results. If this field + is empty, there are no additional results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListCustomDetectionRulesInput(_SerdeShape): + """Dataclass for ListCustomDetectionRulesInput structure.""" + + max_results: int | None = ... + """ + The maximum number of results to return in a single page. Minimum value + of 1, maximum value of 100. + """ + next_token: str | None = ... + """ + A pagination token from a previous response. Use this token to retrieve + the next page of results. + """ + filters: list[DetectionRuleFilter] | None = ... + """A list of filter criteria to apply when listing custom detection rules.""" + +@dataclass(kw_only=True) +class ListCustomDetectionRulesOutput(_SerdeShape): + """Dataclass for ListCustomDetectionRulesOutput structure.""" + + rules: list[RuleSummary] | None = ... + """A list of custom detection rule summaries.""" + next_token: str | None = ... + """ + A pagination token to retrieve the next page of results. If this field + is empty, there are no additional results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListDetectorsInput(_SerdeShape): + """Dataclass for ListDetectorsInput structure.""" + + max_results: int | None = ... + """ + You can use this parameter to indicate the maximum number of items that + you want in the response. The default value is 50. The maximum value is + 50. + """ + next_token: str | None = ... + """ + You can use this parameter when paginating results. Set the value of + this parameter to null on your first call to the list action. For + subsequent calls to the action, fill nextToken in the request with the + value of NextToken from the previous response to continue listing data. + """ + +@dataclass(kw_only=True) +class ListDetectorsOutput(_SerdeShape): + """Dataclass for ListDetectorsOutput structure.""" + + detector_ids: list[str] | None = ... + """A list of detector IDs.""" + next_token: str | None = ... + """ + The pagination parameter to be used on the next list operation to + retrieve more items. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListFiltersInput(_SerdeShape): + """Dataclass for ListFiltersInput structure.""" + + detector_id: str | None = ... + """ + The unique ID of the detector that is associated with the filter. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + max_results: int | None = ... + """ + You can use this parameter to indicate the maximum number of items that + you want in the response. The default value is 50. The maximum value is + 50. + """ + next_token: str | None = ... + """ + You can use this parameter when paginating results. Set the value of + this parameter to null on your first call to the list action. For + subsequent calls to the action, fill nextToken in the request with the + value of NextToken from the previous response to continue listing data. + """ + +@dataclass(kw_only=True) +class ListFiltersOutput(_SerdeShape): + """Dataclass for ListFiltersOutput structure.""" + + filter_names: list[str] | None = ... + """A list of filter names.""" + next_token: str | None = ... + """ + The pagination parameter to be used on the next list operation to + retrieve more items. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListFindingsInput(_SerdeShape): + """Dataclass for ListFindingsInput structure.""" + + detector_id: str | None = ... + """ + The ID of the detector that specifies the GuardDuty service whose + findings you want to list. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + finding_criteria: FindingCriteria | None = ... + """ + Represents the criteria used for querying findings. Valid values + include: + + - JSON field name + + - accountId + + - region + + - confidence + + - id + + - resource.accessKeyDetails.accessKeyId + + - resource.accessKeyDetails.principalId + + - resource.accessKeyDetails.userName + + - resource.accessKeyDetails.userType + + - resource.instanceDetails.iamInstanceProfile.id + + - resource.instanceDetails.imageId + + - resource.instanceDetails.instanceId + + - resource.instanceDetails.networkInterfaces.ipv6Addresses + + - resource.instanceDetails.networkInterfaces.privateIpAddresses.privateIpAddress + + - resource.instanceDetails.networkInterfaces.publicDnsName + + - resource.instanceDetails.networkInterfaces.publicIp + + - resource.instanceDetails.networkInterfaces.securityGroups.groupId + + - resource.instanceDetails.networkInterfaces.securityGroups.groupName + + - resource.instanceDetails.networkInterfaces.subnetId + + - resource.instanceDetails.networkInterfaces.vpcId + + - resource.instanceDetails.tags.key + + - resource.instanceDetails.tags.value + + - resource.resourceType + + - service.action.actionType + + - service.action.awsApiCallAction.api + + - service.action.awsApiCallAction.callerType + + - service.action.awsApiCallAction.remoteIpDetails.city.cityName + + - service.action.awsApiCallAction.remoteIpDetails.country.countryName + + - service.action.awsApiCallAction.remoteIpDetails.ipAddressV4 + + - service.action.awsApiCallAction.remoteIpDetails.organization.asn + + - service.action.awsApiCallAction.remoteIpDetails.organization.asnOrg + + - service.action.awsApiCallAction.serviceName + + - service.action.dnsRequestAction.domain + + - service.action.dnsRequestAction.domainWithSuffix + + - service.action.networkConnectionAction.blocked + + - service.action.networkConnectionAction.connectionDirection + + - service.action.networkConnectionAction.localPortDetails.port + + - service.action.networkConnectionAction.protocol + + - service.action.networkConnectionAction.remoteIpDetails.country.countryName + + - service.action.networkConnectionAction.remoteIpDetails.ipAddressV4 + + - service.action.networkConnectionAction.remoteIpDetails.organization.asn + + - service.action.networkConnectionAction.remoteIpDetails.organization.asnOrg + + - service.action.networkConnectionAction.remotePortDetails.port + + - service.additionalInfo.threatListName + + - service.archived + + When this attribute is set to 'true', only archived findings are + listed. When it's set to 'false', only unarchived findings are + listed. When this attribute is not set, all existing findings are + listed. + + - service.ebsVolumeScanDetails.scanId + + - service.resourceRole + + - severity + + - type + + - updatedAt + + Type: Timestamp in Unix Epoch millisecond format: 1486685375000 + """ + sort_criteria: SortCriteria | None = ... + """Represents the criteria used for sorting findings.""" + max_results: int | None = ... + """ + You can use this parameter to indicate the maximum number of items you + want in the response. The default value is 50. The maximum value is 50. + """ + next_token: str | None = ... + """ + You can use this parameter when paginating results. Set the value of + this parameter to null on your first call to the list action. For + subsequent calls to the action, fill nextToken in the request with the + value of NextToken from the previous response to continue listing data. + """ + +@dataclass(kw_only=True) +class ListFindingsOutput(_SerdeShape): + """Dataclass for ListFindingsOutput structure.""" + + finding_ids: list[str] | None = ... + """The IDs of the findings that you're listing.""" + next_token: str | None = ... + """ + The pagination parameter to be used on the next list operation to + retrieve more items. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListInvestigationsInput(_SerdeShape): + """Dataclass for ListInvestigationsInput structure.""" + + detector_id: str | None = ... + """ + The unique ID of the GuardDuty detector whose investigations you want to + list. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + sort_criteria: InvestigationSortCriteria | None = ... + """Represents the criteria used for sorting investigations.""" + max_results: int | None = ... + """ + You can use this parameter to indicate the maximum number of items you + want in the response. The default value is 50. + """ + next_token: str | None = ... + """ + You can use this parameter when paginating results. Set the value of + this parameter to null on your first call to the list action. For + subsequent calls to the action, fill nextToken in the request with the + value of NextToken from the previous response to continue listing data. + """ + +@dataclass(kw_only=True) +class ListInvestigationsOutput(_SerdeShape): + """Dataclass for ListInvestigationsOutput structure.""" + + investigations: list[InvestigationSummary] | None = ... + """ + A list of investigation summaries associated with the specified + detector. + """ + next_token: str | None = ... + """ + The pagination parameter to be used on the next list operation to + retrieve more items. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListInvitationsInput(_SerdeShape): + """Dataclass for ListInvitationsInput structure.""" + + max_results: int | None = ... + """ + You can use this parameter to indicate the maximum number of items that + you want in the response. The default value is 50. The maximum value is + 50. + """ + next_token: str | None = ... + """ + You can use this parameter when paginating results. Set the value of + this parameter to null on your first call to the list action. For + subsequent calls to the action, fill nextToken in the request with the + value of NextToken from the previous response to continue listing data. + """ + +@dataclass(kw_only=True) +class ListInvitationsOutput(_SerdeShape): + """Dataclass for ListInvitationsOutput structure.""" + + invitations: list[Invitation] | None = ... + """A list of invitation descriptions.""" + next_token: str | None = ... + """ + The pagination parameter to be used on the next list operation to + retrieve more items. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListIPSetsInput(_SerdeShape): + """Dataclass for ListIPSetsInput structure.""" + + detector_id: str | None = ... + """ + The unique ID of the detector that is associated with IPSet. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + max_results: int | None = ... + """ + You can use this parameter to indicate the maximum number of items you + want in the response. The default value is 50. The maximum value is 50. + """ + next_token: str | None = ... + """ + You can use this parameter when paginating results. Set the value of + this parameter to null on your first call to the list action. For + subsequent calls to the action, fill nextToken in the request with the + value of NextToken from the previous response to continue listing data. + """ + +@dataclass(kw_only=True) +class ListIPSetsOutput(_SerdeShape): + """Dataclass for ListIPSetsOutput structure.""" + + ip_set_ids: list[str] | None = ... + """The IDs of the IPSet resources.""" + next_token: str | None = ... + """ + The pagination parameter to be used on the next list operation to + retrieve more items. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListMalwareProtectionPlansInput(_SerdeShape): + """Dataclass for ListMalwareProtectionPlansInput structure.""" + + next_token: str | None = ... + """ + You can use this parameter when paginating results. Set the value of + this parameter to null on your first call to the list action. For + subsequent calls to the action, fill nextToken in the request with the + value of `NextToken` from the previous response to continue listing + data. The default page size is 100 plans. + """ + +@dataclass(kw_only=True) +class ListMalwareProtectionPlansOutput(_SerdeShape): + """Dataclass for ListMalwareProtectionPlansOutput structure.""" + + malware_protection_plans: list[MalwareProtectionPlanSummary] | None = ... + """ + A list of unique identifiers associated with each Malware Protection + plan. + """ + next_token: str | None = ... + """ + You can use this parameter when paginating results. Set the value of + this parameter to null on your first call to the list action. For + subsequent calls to the action, fill nextToken in the request with the + value of `NextToken` from the previous response to continue listing + data. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class ListMalwareScansCriterionKey(UnknownEnumMixin, StrEnum): + RESOURCE_ARN = "RESOURCE_ARN" + SCAN_ID = "SCAN_ID" + ACCOUNT_ID = "ACCOUNT_ID" + GUARDDUTY_FINDING_ID = "GUARDDUTY_FINDING_ID" + RESOURCE_TYPE = "RESOURCE_TYPE" + SCAN_START_TIME = "SCAN_START_TIME" + SCAN_STATUS = "SCAN_STATUS" + SCAN_TYPE = "SCAN_TYPE" + +@dataclass(kw_only=True) +class ListMalwareScansFilterCriteria(_SerdeShape): + """Represents the criteria used to filter the malware scan entries.""" + + list_malware_scans_filter_criterion: ( + list[ListMalwareScansFilterCriterion] | None + ) = ... + """ + Represents a condition that when matched will be added to the response + of the operation. + """ + +@dataclass(kw_only=True) +class ListMalwareScansFilterCriterion(_SerdeShape): + """ + Represents a condition that when matched will be added to the response + of the operation. Irrespective of using any filter criteria, an + administrator account can view the scan entries for all of its member + accounts. However, each member account can view the scan entries only + for their own account. + """ + + list_malware_scans_criterion_key: str | None = ... + """ + An enum value representing possible scan properties to match with given + scan entries. + """ + filter_condition: FilterCondition | None = ... + """Contains information about the condition.""" + +@dataclass(kw_only=True) +class ListMalwareScansInput(_SerdeShape): + """Dataclass for ListMalwareScansInput structure.""" + + max_results: int | None = ... + """ + You can use this parameter to indicate the maximum number of items that + you want in the response. The default value is 50. The maximum value is + 50. + """ + next_token: str | None = ... + """ + You can use this parameter when paginating results. Set the value of + this parameter to null on your first call to the list action. For + subsequent calls to the action, fill nextToken in the request with the + value of NextToken from the previous response to continue listing + results. + """ + filter_criteria: ListMalwareScansFilterCriteria | None = ... + """Represents the criteria used to filter the malware scan entries.""" + sort_criteria: SortCriteria | None = ... + """Represents the criteria used for sorting malware scan entries.""" + +@dataclass(kw_only=True) +class ListMalwareScansOutput(_SerdeShape): + """Dataclass for ListMalwareScansOutput structure.""" + + scans: list[MalwareScan] | None = ... + """The list of malware scans associated with the provided input parameters.""" + next_token: str | None = ... + """ + The pagination parameter to be used on the next list operation to + retrieve more scans. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListMembersInput(_SerdeShape): + """Dataclass for ListMembersInput structure.""" + + detector_id: str | None = ... + """ + The unique ID of the detector that is associated with the member. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + max_results: int | None = ... + """ + You can use this parameter to indicate the maximum number of items you + want in the response. The default value is 50. The maximum value is 50. + """ + next_token: str | None = ... + """ + You can use this parameter when paginating results. Set the value of + this parameter to null on your first call to the list action. For + subsequent calls to the action, fill nextToken in the request with the + value of NextToken from the previous response to continue listing data. + """ + only_associated: str | None = ... + """ + Specifies whether to only return associated members or to return all + members (including members who haven't been invited yet or have been + disassociated). Member accounts must have been previously associated + with the GuardDuty administrator account using + [`Create Members`](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_CreateMembers.html) + . + """ + +@dataclass(kw_only=True) +class ListMembersOutput(_SerdeShape): + """Dataclass for ListMembersOutput structure.""" + + members: list[Member] | None = ... + """ + A list of members. + + Note: + The values for `email` and `invitedAt` are available only if the member + accounts are added by invitation. + """ + next_token: str | None = ... + """ + The pagination parameter to be used on the next list operation to + retrieve more items. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListOrganizationAdminAccountsInput(_SerdeShape): + """Dataclass for ListOrganizationAdminAccountsInput structure.""" + + max_results: int | None = ... + """The maximum number of results to return in the response.""" + next_token: str | None = ... + """ + A token to use for paginating results that are returned in the response. + Set the value of this parameter to null for the first request to a list + action. For subsequent calls, use the `NextToken` value returned from + the previous request to continue listing results after the first page. + """ + +@dataclass(kw_only=True) +class ListOrganizationAdminAccountsOutput(_SerdeShape): + """Dataclass for ListOrganizationAdminAccountsOutput structure.""" + + admin_accounts: list[AdminAccount] | None = ... + """A list of accounts configured as GuardDuty delegated administrators.""" + next_token: str | None = ... + """ + The pagination parameter to be used on the next list operation to + retrieve more items. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListPublishingDestinationsInput(_SerdeShape): + """Dataclass for ListPublishingDestinationsInput structure.""" + + detector_id: str | None = ... + """ + The detector ID for which you want to retrieve the publishing + destination. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + max_results: int | None = ... + """The maximum number of results to return in the response.""" + next_token: str | None = ... + """ + A token to use for paginating results that are returned in the response. + Set the value of this parameter to null for the first request to a list + action. For subsequent calls, use the `NextToken` value returned from + the previous request to continue listing results after the first page. + """ + +@dataclass(kw_only=True) +class ListPublishingDestinationsOutput(_SerdeShape): + """Dataclass for ListPublishingDestinationsOutput structure.""" + + destinations: list[Destination] | None = ... + """ + A `Destinations` object that includes information about each publishing + destination returned. + """ + next_token: str | None = ... + """ + A token to use for paginating results that are returned in the response. + Set the value of this parameter to null for the first request to a list + action. For subsequent calls, use the `NextToken` value returned from + the previous request to continue listing results after the first page. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListTagsForResourceInput(_SerdeShape): + """Dataclass for ListTagsForResourceInput structure.""" + + resource_arn: str | None = ... + """The Amazon Resource Name (ARN) for the given GuardDuty resource.""" + +@dataclass(kw_only=True) +class ListTagsForResourceOutput(_SerdeShape): + """Dataclass for ListTagsForResourceOutput structure.""" + + tags: dict[str, str] | None = ... + """The tags associated with the resource.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListThreatEntitySetsInput(_SerdeShape): + """Dataclass for ListThreatEntitySetsInput structure.""" + + detector_id: str | None = ... + """ + The unique ID of the GuardDuty detector that is associated with this + threat entity set. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + max_results: int | None = ... + """ + You can use this parameter to indicate the maximum number of items you + want in the response. The default value is 50. + """ + next_token: str | None = ... + """ + You can use this parameter when paginating results. Set the value of + this parameter to null on your first call to the list action. For + subsequent calls to the action, fill nextToken in the request with the + value of NextToken from the previous response to continue listing data. + """ + +@dataclass(kw_only=True) +class ListThreatEntitySetsOutput(_SerdeShape): + """Dataclass for ListThreatEntitySetsOutput structure.""" + + threat_entity_set_ids: list[str] | None = ... + """The IDs of the threat entity set resources.""" + next_token: str | None = ... + """ + The pagination parameter to be used on the next list operation to + retrieve more items. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListThreatIntelSetsInput(_SerdeShape): + """Dataclass for ListThreatIntelSetsInput structure.""" + + detector_id: str | None = ... + """ + The unique ID of the detector that is associated with the + threatIntelSet. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + max_results: int | None = ... + """ + You can use this parameter to indicate the maximum number of items that + you want in the response. The default value is 50. The maximum value is + 50. + """ + next_token: str | None = ... + """ + You can use this parameter to paginate results in the response. Set the + value of this parameter to null on your first call to the list action. + For subsequent calls to the action, fill nextToken in the request with + the value of NextToken from the previous response to continue listing + data. + """ + +@dataclass(kw_only=True) +class ListThreatIntelSetsOutput(_SerdeShape): + """Dataclass for ListThreatIntelSetsOutput structure.""" + + threat_intel_set_ids: list[str] | None = ... + """The IDs of the ThreatIntelSet resources.""" + next_token: str | None = ... + """ + The pagination parameter to be used on the next list operation to + retrieve more items. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListTrustedEntitySetsInput(_SerdeShape): + """Dataclass for ListTrustedEntitySetsInput structure.""" + + detector_id: str | None = ... + """ + The unique ID of the GuardDuty detector that is associated with this + threat entity set. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + max_results: int | None = ... + """ + You can use this parameter to indicate the maximum number of items you + want in the response. The default value is 50. + """ + next_token: str | None = ... + """ + You can use this parameter when paginating results. Set the value of + this parameter to null on your first call to the list action. For + subsequent calls to the action, fill nextToken in the request with the + value of NextToken from the previous response to continue listing data. + """ + +@dataclass(kw_only=True) +class ListTrustedEntitySetsOutput(_SerdeShape): + """Dataclass for ListTrustedEntitySetsOutput structure.""" + + trusted_entity_set_ids: list[str] | None = ... + """The IDs of the trusted entity set resources.""" + next_token: str | None = ... + """ + The pagination parameter to be used on the next list operation to + retrieve more items. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class LocalIpDetails(_SerdeShape): + """Contains information about the local IP address of the connection.""" + + ip_address_v4: str | None = ... + """The IPv4 local address of the connection.""" + ip_address_v6: str | None = ... + """The IPv6 local address of the connection.""" + +@dataclass(kw_only=True) +class LocalPortDetails(_SerdeShape): + """Contains information about the port for the local connection.""" + + port: int | None = ... + """The port number of the local connection.""" + port_name: str | None = ... + """The port name of the local connection.""" + +@dataclass(kw_only=True) +class LoginAttribute(_SerdeShape): + """Information about the login attempts.""" + + user: str | None = ... + """Indicates the user name which attempted to log in.""" + application: str | None = ... + """Indicates the application name used to attempt log in.""" + failed_login_attempts: int | None = ... + """ + Represents the sum of failed (unsuccessful) login attempts made to + establish a connection to the database instance. + """ + successful_login_attempts: int | None = ... + """ + Represents the sum of successful connections (a correct combination of + login attributes) made to the database instance by the actor. + """ + +@dataclass(kw_only=True) +class MalwareProtectionConfiguration(_SerdeShape): + """Describes whether Malware Protection will be enabled as a data source.""" + + scan_ec2_instance_with_findings: ScanEc2InstanceWithFindings | None = ... + """ + Describes the configuration of Malware Protection for EC2 instances with + findings. + """ + +@dataclass(kw_only=True) +class MalwareProtectionConfigurationResult(_SerdeShape): + """ + An object that contains information on the status of all Malware + Protection data sources. + """ + + scan_ec2_instance_with_findings: ScanEc2InstanceWithFindingsResult | None = ... + """ + Describes the configuration of Malware Protection for EC2 instances with + findings. + """ + service_role: str | None = ... + """The GuardDuty Malware Protection service role.""" + +@dataclass(kw_only=True) +class MalwareProtectionDataSourceFreeTrial(_SerdeShape): + """ + Provides details about Malware Protection when it is enabled as a data + source. + """ + + scan_ec2_instance_with_findings: DataSourceFreeTrial | None = ... + """ + Describes whether Malware Protection for EC2 instances with findings is + enabled as a data source. + """ + +@dataclass(kw_only=True) +class MalwareProtectionFindingsScanConfiguration(_SerdeShape): + """Contains finding configuration details about the malware scan.""" + + trigger_type: str | None = ... + """The event that triggered the malware scan.""" + incremental_scan_details: IncrementalScanDetails | None = ... + """Contains information about the incremental scan configuration.""" + +@dataclass(kw_only=True) +class MalwareProtectionPlanActions(_SerdeShape): + """ + Information about whether the tags will be added to the S3 object after + scanning. + """ + + tagging: MalwareProtectionPlanTaggingAction | None = ... + """ + Indicates whether the scanned S3 object will have tags about the scan + result. + """ + +class MalwareProtectionPlanStatus(UnknownEnumMixin, StrEnum): + ACTIVE = "ACTIVE" + WARNING = "WARNING" + ERROR = "ERROR" + +@dataclass(kw_only=True) +class MalwareProtectionPlanStatusReason(_SerdeShape): + """ + Information about the issue code and message associated to the status of + your Malware Protection plan. + """ + + code: str | None = ... + """Issue code.""" + message: str | None = ... + """ + Issue message that specifies the reason. For information about potential + troubleshooting steps, see [Troubleshooting Malware Protection for S3 + status + issues](https://docs.aws.amazon.com/guardduty/latest/ug/troubleshoot-s3-malware-protection-status-errors.html) + in the *Amazon GuardDuty User Guide*. + """ + +@dataclass(kw_only=True) +class MalwareProtectionPlanSummary(_SerdeShape): + """Information about the Malware Protection plan resource.""" + + malware_protection_plan_id: str | None = ... + """A unique identifier associated with Malware Protection plan.""" + +@dataclass(kw_only=True) +class MalwareProtectionPlanTaggingAction(_SerdeShape): + """ + Information about adding tags to the scanned S3 object after the scan + result. + """ + + status: str | None = ... + """Indicates whether or not the tags will added.""" + +class MalwareProtectionPlanTaggingActionStatus(UnknownEnumMixin, StrEnum): + ENABLED = "ENABLED" + DISABLED = "DISABLED" + +class MalwareProtectionResourceType(UnknownEnumMixin, StrEnum): + EBS_RECOVERY_POINT = "EBS_RECOVERY_POINT" + EBS_SNAPSHOT = "EBS_SNAPSHOT" + EBS_VOLUME = "EBS_VOLUME" + EC2_AMI = "EC2_AMI" + EC2_INSTANCE = "EC2_INSTANCE" + EC2_RECOVERY_POINT = "EC2_RECOVERY_POINT" + S3_RECOVERY_POINT = "S3_RECOVERY_POINT" + S3_BUCKET = "S3_BUCKET" + S3_POINT_IN_TIME_RECOVERY = "S3_POINT_IN_TIME_RECOVERY" + +class MalwareProtectionScanStatus(UnknownEnumMixin, StrEnum): + RUNNING = "RUNNING" + COMPLETED = "COMPLETED" + COMPLETED_WITH_ISSUES = "COMPLETED_WITH_ISSUES" + FAILED = "FAILED" + SKIPPED = "SKIPPED" + +class MalwareProtectionScanType(UnknownEnumMixin, StrEnum): + BACKUP_INITIATED = "BACKUP_INITIATED" + ON_DEMAND = "ON_DEMAND" + GUARDDUTY_INITIATED = "GUARDDUTY_INITIATED" + +@dataclass(kw_only=True) +class MalwareScan(_SerdeShape): + """Contains information about a particular malware scan.""" + + resource_arn: str | None = ... + """Amazon Resource Name (ARN) of the resource for the given malware scan.""" + resource_type: str | None = ... + """The type of resource that was scanned for malware.""" + scan_id: str | None = ... + """ + A unique identifier that gets generated when you invoke the API without + any error. Each malware scan has a corresponding scan ID. Using this + scan ID, you can monitor the status of your malware scan. + """ + scan_status: str | None = ... + """An enum value representing the current status of the malware scan.""" + scan_result_status: str | None = ... + """An enum value representing the result of the malware scan.""" + scan_type: str | None = ... + """An enum value representing the type of scan that was initiated.""" + scan_started_at: datetime | None = ... + """The timestamp representing when the malware scan was started.""" + scan_completed_at: datetime | None = ... + """The timestamp representing when the malware scan was completed.""" + +@dataclass(kw_only=True) +class MalwareScanDetails(_SerdeShape): + """Information about the malware scan that generated a GuardDuty finding.""" + + threats: list[Threat] | None = ... + """ + Information about the detected threats associated with the generated + GuardDuty finding. + """ + scan_id: str | None = ... + """The unique identifier for the malware scan.""" + scan_type: str | None = ... + """The type of malware scan performed.""" + scan_category: str | None = ... + """The category of the malware scan.""" + scan_configuration: MalwareProtectionFindingsScanConfiguration | None = ... + """The configuration settings used for the malware scan.""" + unique_threat_count: int | None = ... + """The number of unique malware threats detected during the scan.""" + +class ManagedBy(UnknownEnumMixin, StrEnum): + GUARDDUTY_POLICY = "GUARDDUTY_POLICY" + +class ManagementType(UnknownEnumMixin, StrEnum): + AUTO_MANAGED = "AUTO_MANAGED" + MANUAL = "MANUAL" + DISABLED = "DISABLED" + +@dataclass(kw_only=True) +class Master(_SerdeShape): + """Contains information about the administrator account and invitation.""" + + account_id: str | None = ... + """The ID of the account used as the administrator account.""" + invitation_id: str | None = ... + """ + The value used to validate the administrator account to the member + account. + """ + relationship_status: str | None = ... + """ + The status of the relationship between the administrator and member + accounts. + """ + invited_at: str | None = ... + """The timestamp when the invitation was sent.""" + +@dataclass(kw_only=True) +class Member(_SerdeShape): + """Contains information about the member account.""" + + account_id: str | None = ... + """The ID of the member account.""" + detector_id: str | None = ... + """The detector ID of the member account.""" + master_id: str | None = ... + """The administrator account ID.""" + email: str | None = ... + """The email address of the member account.""" + relationship_status: str | None = ... + """The status of the relationship between the member and the administrator.""" + invited_at: str | None = ... + """The timestamp when the invitation was sent.""" + updated_at: str | None = ... + """The last-updated timestamp of the member.""" + administrator_id: str | None = ... + """The administrator account ID.""" + +@dataclass(kw_only=True) +class MemberAdditionalConfiguration(_SerdeShape): + """Information about the additional configuration for the member account.""" + + name: str | None = ... + """Name of the additional configuration.""" + status: str | None = ... + """Status of the additional configuration.""" + +@dataclass(kw_only=True) +class MemberAdditionalConfigurationResult(_SerdeShape): + """Information about the additional configuration for the member account.""" + + name: str | None = ... + """ + Indicates the name of the additional configuration that is set for the + member account. + """ + status: str | None = ... + """ + Indicates the status of the additional configuration that is set for the + member account. + """ + updated_at: datetime | None = ... + """ + The timestamp at which the additional configuration was set for the + member account. This is in UTC format. + """ + managed_by: str | None = ... + """ + Indicates what manages the additional configuration. A value of + `GUARDDUTY_POLICY` means a GuardDuty policy manages the additional + configuration. + """ + +@dataclass(kw_only=True) +class MemberDataSourceConfiguration(_SerdeShape): + """ + Contains information on which data sources are enabled for a member + account. + """ + + account_id: str | None = ... + """The account ID for the member account.""" + data_sources: DataSourceConfigurationsResult | None = ... + """Contains information on the status of data sources for the account.""" + features: list[MemberFeaturesConfigurationResult] | None = ... + """ + Contains information about the status of the features for the member + account. + """ + +@dataclass(kw_only=True) +class MemberFeaturesConfiguration(_SerdeShape): + """Contains information about the features for the member account.""" + + name: str | None = ... + """The name of the feature.""" + status: str | None = ... + """The status of the feature.""" + additional_configuration: list[MemberAdditionalConfiguration] | None = ... + """Additional configuration of the feature for the member account.""" + +@dataclass(kw_only=True) +class MemberFeaturesConfigurationResult(_SerdeShape): + """Contains information about the features for the member account.""" + + name: str | None = ... + """Indicates the name of the feature that is enabled for the detector.""" + status: str | None = ... + """Indicates the status of the feature that is enabled for the detector.""" + updated_at: datetime | None = ... + """The timestamp at which the feature object was updated.""" + additional_configuration: list[MemberAdditionalConfigurationResult] | None = ... + """ + Indicates the additional configuration of the feature that is configured + for the member account. + """ + managed_by: str | None = ... + """ + Indicates what manages the feature. A value of `GUARDDUTY_POLICY` means + a GuardDuty policy manages the feature. + """ + +class MfaStatus(UnknownEnumMixin, StrEnum): + ENABLED = "ENABLED" + DISABLED = "DISABLED" + +@dataclass(kw_only=True) +class ModelDetail(_SerdeShape): + """Contains information about the AI model involved in a finding.""" + + model_id: str | None = ... + """The identifier of the AI model.""" + +@dataclass(kw_only=True) +class NetworkConnection(_SerdeShape): + """Contains information about the network connection.""" + + direction: str | None = ... + """The direction in which the network traffic is flowing.""" + +@dataclass(kw_only=True) +class NetworkConnectionAction(_SerdeShape): + """ + Contains information about the NETWORK_CONNECTION action described in + the finding. + """ + + blocked: bool | None = ... + """Indicates whether EC2 blocked the network connection to your instance.""" + connection_direction: str | None = ... + """The network connection direction.""" + local_port_details: LocalPortDetails | None = ... + """The local port information of the connection.""" + protocol: str | None = ... + """The network connection protocol.""" + local_ip_details: LocalIpDetails | None = ... + """The local IP information of the connection.""" + local_network_interface: str | None = ... + """ + The EC2 instance's local elastic network interface utilized for the + connection. + """ + remote_ip_details: RemoteIpDetails | None = ... + """The remote IP information of the connection.""" + remote_port_details: RemotePortDetails | None = ... + """The remote port information of the connection.""" + +class NetworkDirection(UnknownEnumMixin, StrEnum): + INBOUND = "INBOUND" + OUTBOUND = "OUTBOUND" + +@dataclass(kw_only=True) +class NetworkEndpoint(_SerdeShape): + """ + Contains information about network endpoints that were observed in the + attack sequence. + """ + + id: str | None = ... + """The ID of the network endpoint.""" + ip: str | None = ... + """The IP address associated with the network endpoint.""" + domain: str | None = ... + """The domain information for the network endpoint.""" + port: int | None = ... + """The port number associated with the network endpoint.""" + location: NetworkGeoLocation | None = ... + """Information about the location of the network endpoint.""" + autonomous_system: AutonomousSystem | None = ... + """The Autonomous System (AS) of the network endpoint.""" + connection: NetworkConnection | None = ... + """Information about the network connection.""" + +@dataclass(kw_only=True) +class NetworkGeoLocation(_SerdeShape): + """Contains information about network endpoint location.""" + + city: str | None = ... + """The name of the city.""" + country: str | None = ... + """The name of the country.""" + latitude: float | None = ... + """The latitude information of the endpoint location.""" + longitude: float | None = ... + """The longitude information of the endpoint location.""" + +@dataclass(kw_only=True) +class NetworkInterface(_SerdeShape): + """ + Contains information about the elastic network interface of the EC2 + instance. + """ + + ipv6_addresses: list[str] | None = ... + """A list of IPv6 addresses for the EC2 instance.""" + network_interface_id: str | None = ... + """The ID of the network interface.""" + private_dns_name: str | None = ... + """The private DNS name of the EC2 instance.""" + private_ip_address: str | None = ... + """The private IP address of the EC2 instance.""" + private_ip_addresses: list[PrivateIpAddressDetails] | None = ... + """Other private IP address information of the EC2 instance.""" + public_dns_name: str | None = ... + """The public DNS name of the EC2 instance.""" + public_ip: str | None = ... + """The public IP address of the EC2 instance.""" + security_groups: list[SecurityGroup] | None = ... + """The security groups associated with the EC2 instance.""" + subnet_id: str | None = ... + """The subnet ID of the EC2 instance.""" + vpc_id: str | None = ... + """The VPC ID of the EC2 instance.""" + +@dataclass(kw_only=True) +class Observations(_SerdeShape): + """Contains information about the observed behavior.""" + + text: list[str] | None = ... + """The text that was unusual.""" + number: list[int] | None = ... + """The numeric values that were unusual.""" + +class OrderBy(UnknownEnumMixin, StrEnum): + ASC = "ASC" + DESC = "DESC" + +@dataclass(kw_only=True) +class Organization(_SerdeShape): + """ + Contains information about the ISP organization of the remote IP + address. + """ + + asn: str | None = ... + """ + The Autonomous System Number (ASN) of the internet provider of the + remote IP address. + """ + asn_org: str | None = ... + """The organization that registered this ASN.""" + isp: str | None = ... + """The ISP information for the internet provider.""" + org: str | None = ... + """The name of the internet provider.""" + +@dataclass(kw_only=True) +class OrganizationAdditionalConfiguration(_SerdeShape): + """ + A list of additional configurations which will be configured for the + organization. + + Additional configuration applies to only GuardDuty Runtime Monitoring + protection plan. + """ + + name: str | None = ... + """ + The name of the additional configuration that will be configured for the + organization. These values are applicable to only Runtime Monitoring + protection plan. + """ + auto_enable: str | None = ... + """ + The status of the additional configuration that will be configured for + the organization. Use one of the following values to configure the + feature status for the entire organization: + + - `NEW`: Indicates that when a new account joins the organization, they + will have the additional configuration enabled automatically. + + - `ALL`: Indicates that all accounts in the organization have the + additional configuration enabled automatically. This includes `NEW` + accounts that join the organization and accounts that may have been + suspended or removed from the organization in GuardDuty. + + It may take up to 24 hours to update the configuration for all the + member accounts. + + - `NONE`: Indicates that the additional configuration will not be + automatically enabled for any account in the organization. The + administrator must manage the additional configuration for each + account individually. + """ + +@dataclass(kw_only=True) +class OrganizationAdditionalConfigurationResult(_SerdeShape): + """ + A list of additional configuration which will be configured for the + organization. + """ + + name: str | None = ... + """ + The name of the additional configuration that is configured for the + member accounts within the organization. These values are applicable to + only Runtime Monitoring protection plan. + """ + auto_enable: str | None = ... + """ + Describes the status of the additional configuration that is configured + for the member accounts within the organization. One of the following + values is the status for the entire organization: + + - `NEW`: Indicates that when a new account joins the organization, they + will have the additional configuration enabled automatically. + + - `ALL`: Indicates that all accounts in the organization have the + additional configuration enabled automatically. This includes `NEW` + accounts that join the organization and accounts that may have been + suspended or removed from the organization in GuardDuty. + + It may take up to 24 hours to update the configuration for all the + member accounts. + + - `NONE`: Indicates that the additional configuration will not be + automatically enabled for any account in the organization. The + administrator must manage the additional configuration for each + account individually. + """ + +@dataclass(kw_only=True) +class OrganizationDataSourceConfigurations(_SerdeShape): + """ + An object that contains information on which data sources will be + configured to be automatically enabled for new members within the + organization. + """ + + s3_logs: OrganizationS3LogsConfiguration | None = ... + """ + Describes whether S3 data event logs are enabled for new members of the + organization. + """ + kubernetes: OrganizationKubernetesConfiguration | None = ... + """ + Describes the configuration of Kubernetes data sources for new members + of the organization. + """ + malware_protection: OrganizationMalwareProtectionConfiguration | None = ... + """ + Describes the configuration of Malware Protection for new members of the + organization. + """ + +@dataclass(kw_only=True) +class OrganizationDataSourceConfigurationsResult(_SerdeShape): + """ + An object that contains information on which data sources are + automatically enabled for new members within the organization. + """ + + s3_logs: OrganizationS3LogsConfigurationResult | None = ... + """Describes whether S3 data event logs are enabled as a data source.""" + kubernetes: OrganizationKubernetesConfigurationResult | None = ... + """Describes the configuration of Kubernetes data sources.""" + malware_protection: OrganizationMalwareProtectionConfigurationResult | None = ... + """ + Describes the configuration of Malware Protection data source for an + organization. + """ + +@dataclass(kw_only=True) +class OrganizationDetails(_SerdeShape): + """ + Information about GuardDuty coverage statistics for members in your + Amazon Web Services organization. + """ + + updated_at: datetime | None = ... + """ + The timestamp at which the organization statistics was last updated. + This is in UTC format. + """ + organization_statistics: OrganizationStatistics | None = ... + """ + Information about the GuardDuty coverage statistics for members in your + Amazon Web Services organization. + """ + +@dataclass(kw_only=True) +class OrganizationEbsVolumes(_SerdeShape): + """Organization-wide EBS volumes scan configuration.""" + + auto_enable: bool | None = ... + """ + Whether scanning EBS volumes should be auto-enabled for new members + joining the organization. + """ + +@dataclass(kw_only=True) +class OrganizationEbsVolumesResult(_SerdeShape): + """ + An object that contains information on the status of whether EBS volumes + scanning will be enabled as a data source for an organization. + """ + + auto_enable: bool | None = ... + """ + An object that contains the status of whether scanning EBS volumes + should be auto-enabled for new members joining the organization. + """ + +@dataclass(kw_only=True) +class OrganizationFeatureConfiguration(_SerdeShape): + """A list of features which will be configured for the organization.""" + + name: str | None = ... + """The name of the feature that will be configured for the organization.""" + auto_enable: str | None = ... + """ + Describes the status of the feature that is configured for the member + accounts within the organization. One of the following values is the + status for the entire organization: + + - `NEW`: Indicates that when a new account joins the organization, they + will have the feature enabled automatically. + + - `ALL`: Indicates that all accounts in the organization have the + feature enabled automatically. This includes `NEW` accounts that join + the organization and accounts that may have been suspended or removed + from the organization in GuardDuty. + + It may take up to 24 hours to update the configuration for all the + member accounts. + + - `NONE`: Indicates that the feature will not be automatically enabled + for any account in the organization. The administrator must manage the + feature for each account individually. + """ + additional_configuration: list[OrganizationAdditionalConfiguration] | None = ... + """The additional information that will be configured for the organization.""" + +@dataclass(kw_only=True) +class OrganizationFeatureConfigurationResult(_SerdeShape): + """A list of features which will be configured for the organization.""" + + name: str | None = ... + """ + The name of the feature that is configured for the member accounts + within the organization. + """ + auto_enable: str | None = ... + """ + Describes the status of the feature that is configured for the member + accounts within the organization. + + - `NEW`: Indicates that when a new account joins the organization, they + will have the feature enabled automatically. + + - `ALL`: Indicates that all accounts in the organization have the + feature enabled automatically. This includes `NEW` accounts that join + the organization and accounts that may have been suspended or removed + from the organization in GuardDuty. + + - `NONE`: Indicates that the feature will not be automatically enabled + for any account in the organization. In this case, each account will + be managed individually by the administrator. + """ + additional_configuration: ( + list[OrganizationAdditionalConfigurationResult] | None + ) = ... + """ + The additional configuration that is configured for the member accounts + within the organization. + """ + +@dataclass(kw_only=True) +class OrganizationFeatureStatistics(_SerdeShape): + """ + Information about the number of accounts that have enabled a specific + feature. + """ + + name: str | None = ... + """Name of the feature.""" + enabled_accounts_count: int | None = ... + """Total number of accounts that have enabled a specific feature.""" + additional_configuration: ( + list[OrganizationFeatureStatisticsAdditionalConfiguration] | None + ) = ... + """Name of the additional configuration.""" + +@dataclass(kw_only=True) +class OrganizationFeatureStatisticsAdditionalConfiguration(_SerdeShape): + """ + Information about the coverage statistic for the additional + configuration of the feature. + """ + + name: str | None = ... + """Name of the additional configuration within a feature.""" + enabled_accounts_count: int | None = ... + """Total number of accounts that have enabled the additional configuration.""" + +@dataclass(kw_only=True) +class OrganizationKubernetesAuditLogsConfiguration(_SerdeShape): + """Organization-wide Kubernetes audit logs configuration.""" + + auto_enable: bool | None = ... + """ + A value that contains information on whether Kubernetes audit logs + should be enabled automatically as a data source for the organization. + """ + +@dataclass(kw_only=True) +class OrganizationKubernetesAuditLogsConfigurationResult(_SerdeShape): + """ + The current configuration of Kubernetes audit logs as a data source for + the organization. + """ + + auto_enable: bool | None = ... + """ + Whether Kubernetes audit logs data source should be auto-enabled for new + members joining the organization. + """ + +@dataclass(kw_only=True) +class OrganizationKubernetesConfiguration(_SerdeShape): + """Organization-wide Kubernetes data sources configurations.""" + + audit_logs: OrganizationKubernetesAuditLogsConfiguration | None = ... + """ + Whether Kubernetes audit logs data source should be auto-enabled for new + members joining the organization. + """ + +@dataclass(kw_only=True) +class OrganizationKubernetesConfigurationResult(_SerdeShape): + """ + The current configuration of all Kubernetes data sources for the + organization. + """ + + audit_logs: OrganizationKubernetesAuditLogsConfigurationResult | None = ... + """ + The current configuration of Kubernetes audit logs as a data source for + the organization. + """ + +@dataclass(kw_only=True) +class OrganizationMalwareProtectionConfiguration(_SerdeShape): + """Organization-wide Malware Protection configurations.""" + + scan_ec2_instance_with_findings: ( + OrganizationScanEc2InstanceWithFindings | None + ) = ... + """ + Whether Malware Protection for EC2 instances with findings should be + auto-enabled for new members joining the organization. + """ + +@dataclass(kw_only=True) +class OrganizationMalwareProtectionConfigurationResult(_SerdeShape): + """ + An object that contains information on the status of all Malware + Protection data source for an organization. + """ + + scan_ec2_instance_with_findings: ( + OrganizationScanEc2InstanceWithFindingsResult | None + ) = ... + """ + Describes the configuration for scanning EC2 instances with findings for + an organization. + """ + +@dataclass(kw_only=True) +class OrganizationS3LogsConfiguration(_SerdeShape): + """ + Describes whether S3 data event logs will be automatically enabled for + new members of the organization. + """ + + auto_enable: bool | None = ... + """ + A value that contains information on whether S3 data event logs will be + enabled automatically as a data source for the organization. + """ + +@dataclass(kw_only=True) +class OrganizationS3LogsConfigurationResult(_SerdeShape): + """ + The current configuration of S3 data event logs as a data source for the + organization. + """ + + auto_enable: bool | None = ... + """ + A value that describes whether S3 data event logs are automatically + enabled for new members of the organization. + """ + +@dataclass(kw_only=True) +class OrganizationScanEc2InstanceWithFindings(_SerdeShape): + """Organization-wide EC2 instances with findings scan configuration.""" + + ebs_volumes: OrganizationEbsVolumes | None = ... + """ + Whether scanning EBS volumes should be auto-enabled for new members + joining the organization. + """ + +@dataclass(kw_only=True) +class OrganizationScanEc2InstanceWithFindingsResult(_SerdeShape): + """ + An object that contains information on the status of scanning EC2 + instances with findings for an organization. + """ + + ebs_volumes: OrganizationEbsVolumesResult | None = ... + """ + Describes the configuration for scanning EBS volumes for an + organization. + """ + +@dataclass(kw_only=True) +class OrganizationStatistics(_SerdeShape): + """ + Information about the coverage statistics of the features for the entire + Amazon Web Services organization. + + When you create a new Amazon Web Services organization, it might take up + to 24 hours to generate the statistics summary for this organization. + """ + + total_accounts_count: int | None = ... + """Total number of accounts in your Amazon Web Services organization.""" + member_accounts_count: int | None = ... + """ + Total number of accounts in your Amazon Web Services organization that + are associated with GuardDuty. + """ + active_accounts_count: int | None = ... + """ + Total number of active accounts in your Amazon Web Services organization + that are associated with GuardDuty. + """ + enabled_accounts_count: int | None = ... + """Total number of accounts that have enabled GuardDuty.""" + count_by_feature: list[OrganizationFeatureStatistics] | None = ... + """Retrieves the coverage statistics for each feature.""" + +class OrgFeature(UnknownEnumMixin, StrEnum): + S3_DATA_EVENTS = "S3_DATA_EVENTS" + EKS_AUDIT_LOGS = "EKS_AUDIT_LOGS" + EBS_MALWARE_PROTECTION = "EBS_MALWARE_PROTECTION" + RDS_LOGIN_EVENTS = "RDS_LOGIN_EVENTS" + LAMBDA_NETWORK_LOGS = "LAMBDA_NETWORK_LOGS" + EKS_RUNTIME_MONITORING = "EKS_RUNTIME_MONITORING" + RUNTIME_MONITORING = "RUNTIME_MONITORING" + AI_PROTECTION = "AI_PROTECTION" + +class OrgFeatureAdditionalConfiguration(UnknownEnumMixin, StrEnum): + EKS_ADDON_MANAGEMENT = "EKS_ADDON_MANAGEMENT" + ECS_FARGATE_AGENT_MANAGEMENT = "ECS_FARGATE_AGENT_MANAGEMENT" + EC2_AGENT_MANAGEMENT = "EC2_AGENT_MANAGEMENT" + +class OrgFeatureStatus(UnknownEnumMixin, StrEnum): + NEW = "NEW" + NONE = "NONE" + ALL = "ALL" + +@dataclass(kw_only=True) +class Owner(_SerdeShape): + """Contains information on the owner of the bucket.""" + + id: str | None = ... + """ + The canonical user ID of the bucket owner. For information about + locating your canonical user ID see [Finding Your Account Canonical User + ID.](https://docs.aws.amazon.com/general/latest/gr/acct-identifiers.html#FindingCanonicalId) + """ + +@dataclass(kw_only=True) +class PermissionConfiguration(_SerdeShape): + """ + Contains information about how permissions are configured for the S3 + bucket. + """ + + bucket_level_permissions: BucketLevelPermissions | None = ... + """ + Contains information about the bucket level permissions for the S3 + bucket. + """ + account_level_permissions: AccountLevelPermissions | None = ... + """ + Contains information about the account level permissions on the S3 + bucket. + """ + +@dataclass(kw_only=True) +class PortProbeAction(_SerdeShape): + """ + Contains information about the PORT_PROBE action described in the + finding. + """ + + blocked: bool | None = ... + """ + Indicates whether EC2 blocked the port probe to the instance, such as + with an ACL. + """ + port_probe_details: list[PortProbeDetail] | None = ... + """A list of objects related to port probe details.""" + +@dataclass(kw_only=True) +class PortProbeDetail(_SerdeShape): + """Contains information about the port probe details.""" + + local_port_details: LocalPortDetails | None = ... + """The local port information of the connection.""" + local_ip_details: LocalIpDetails | None = ... + """The local IP information of the connection.""" + remote_ip_details: RemoteIpDetails | None = ... + """The remote IP information of the connection.""" + +@dataclass(kw_only=True) +class PrivateIpAddressDetails(_SerdeShape): + """Contains other private IP address information of the EC2 instance.""" + + private_dns_name: str | None = ... + """The private DNS name of the EC2 instance.""" + private_ip_address: str | None = ... + """The private IP address of the EC2 instance.""" + +@dataclass(kw_only=True) +class ProcessDetails(_SerdeShape): + """Information about the observed process.""" + + name: str | None = ... + """The name of the process.""" + executable_path: str | None = ... + """The absolute path of the process executable file.""" + executable_sha256: str | None = ... + """The `SHA256` hash of the process executable.""" + namespace_pid: int | None = ... + """The ID of the child process.""" + pwd: str | None = ... + """The present working directory of the process.""" + pid: int | None = ... + """The ID of the process.""" + start_time: datetime | None = ... + """The time when the process started. This is in UTC format.""" + uuid: str | None = ... + """The unique ID assigned to the process by GuardDuty.""" + parent_uuid: str | None = ... + """ + The unique ID of the parent process. This ID is assigned to the parent + process by GuardDuty. + """ + user: str | None = ... + """The user that executed the process.""" + user_id: int | None = ... + """The unique ID of the user that executed the process.""" + euid: int | None = ... + """The effective user ID of the user that executed the process.""" + lineage: list[LineageObject] | None = ... + """Information about the process's lineage.""" + +@dataclass(kw_only=True) +class Product(_SerdeShape): + """Contains information about the product that produced an investigation.""" + + name: str | None = ... + """The name of the product.""" + feature: str | None = ... + """The specific feature within the product that produced the investigation.""" + +@dataclass(kw_only=True) +class ProductCode(_SerdeShape): + """Contains information about the product code for the EC2 instance.""" + + code: str | None = ... + """The product code information.""" + product_type: str | None = ... + """The product code type.""" + +class ProfileSubtype(UnknownEnumMixin, StrEnum): + FREQUENT = "FREQUENT" + INFREQUENT = "INFREQUENT" + UNSEEN = "UNSEEN" + RARE = "RARE" + COUNT = "COUNT" + AVERAGE = "AVERAGE" + +class ProfileType(UnknownEnumMixin, StrEnum): + FREQUENCY = "FREQUENCY" + VOLUME = "VOLUME" + +@dataclass(kw_only=True) +class PublicAccess(_SerdeShape): + """Describes the public access policies that apply to the S3 bucket.""" + + permission_configuration: PermissionConfiguration | None = ... + """ + Contains information about how permissions are configured for the S3 + bucket. + """ + effective_permission: str | None = ... + """ + Describes the effective permission on this bucket after factoring all + attached policies. + """ + +@dataclass(kw_only=True) +class PublicAccessConfiguration(_SerdeShape): + """ + Describes public access policies that apply to the Amazon S3 bucket. + + For information about each of the following settings, see [Blocking + public access to your Amazon S3 + storage](https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-control-block-public-access.html) + in the *Amazon S3 User Guide*. + """ + + public_acl_access: str | None = ... + """ + Indicates whether or not there is a setting that allows public access to + the Amazon S3 buckets through access control lists (ACLs). + """ + public_policy_access: str | None = ... + """ + Indicates whether or not there is a setting that allows public access to + the Amazon S3 bucket policy. + """ + public_acl_ignore_behavior: str | None = ... + """ + Indicates whether or not there is a setting that ignores all public + access control lists (ACLs) on the Amazon S3 bucket and the objects that + it contains. + """ + public_bucket_restrict_behavior: str | None = ... + """ + Indicates whether or not there is a setting that restricts access to the + bucket with specified policies. + """ + +class PublicAccessStatus(UnknownEnumMixin, StrEnum): + BLOCKED = "BLOCKED" + ALLOWED = "ALLOWED" + +class PublicAclIgnoreBehavior(UnknownEnumMixin, StrEnum): + IGNORED = "IGNORED" + NOT_IGNORED = "NOT_IGNORED" + +class PublicBucketRestrictBehavior(UnknownEnumMixin, StrEnum): + RESTRICTED = "RESTRICTED" + NOT_RESTRICTED = "NOT_RESTRICTED" + +class PublishingStatus(UnknownEnumMixin, StrEnum): + PENDING_VERIFICATION = "PENDING_VERIFICATION" + PUBLISHING = "PUBLISHING" + UNABLE_TO_PUBLISH_FIX_DESTINATION_PROPERTY = ( + "UNABLE_TO_PUBLISH_FIX_DESTINATION_PROPERTY" + ) + STOPPED = "STOPPED" + +@dataclass(kw_only=True) +class RdsDbInstanceDetails(_SerdeShape): + """ + Contains information about the resource type `RDSDBInstance` involved in + a GuardDuty finding. + """ + + db_instance_identifier: str | None = ... + """ + The identifier associated to the database instance that was involved in + the finding. + """ + engine: str | None = ... + """The database engine of the database instance involved in the finding.""" + engine_version: str | None = ... + """The version of the database engine that was involved in the finding.""" + db_cluster_identifier: str | None = ... + """ + The identifier of the database cluster that contains the database + instance ID involved in the finding. + """ + db_instance_arn: str | None = ... + """ + The Amazon Resource Name (ARN) that identifies the database instance + involved in the finding. + """ + dbi_resource_id: str | None = ... + """ + The unique ID of the database resource involved in the activity that + prompted GuardDuty to generate the finding. + """ + tags: list[Tag] | None = ... + """Information about the tag key-value pairs.""" + +@dataclass(kw_only=True) +class RdsDbUserDetails(_SerdeShape): + """ + Contains information about the user and authentication details for a + database instance involved in the finding. + """ + + user: str | None = ... + """The user name used in the anomalous login attempt.""" + application: str | None = ... + """The application name used in the anomalous login attempt.""" + database: str | None = ... + """ + The name of the database instance involved in the anomalous login + attempt. + """ + ssl: str | None = ... + """The version of the Secure Socket Layer (SSL) used for the network.""" + auth_method: str | None = ... + """The authentication method used by the user involved in the finding.""" + +@dataclass(kw_only=True) +class RdsLimitlessDbDetails(_SerdeShape): + """ + Contains information about the resource type `RDSLimitlessDB` that is + involved in a GuardDuty finding. + """ + + db_shard_group_identifier: str | None = ... + """The name associated with the Limitless DB shard group.""" + db_shard_group_resource_id: str | None = ... + """ + The resource identifier of the DB shard group within the Limitless + Database. + """ + db_shard_group_arn: str | None = ... + """The Amazon Resource Name (ARN) that identifies the DB shard group.""" + engine: str | None = ... + """The database engine of the database instance involved in the finding.""" + engine_version: str | None = ... + """The version of the database engine.""" + db_cluster_identifier: str | None = ... + """ + The name of the database cluster that is a part of the Limitless + Database. + """ + tags: list[Tag] | None = ... + """Information about the tag key-value pair.""" + +@dataclass(kw_only=True) +class RdsLoginAttemptAction(_SerdeShape): + """ + Indicates that a login attempt was made to the potentially compromised + database from a remote IP address. + """ + + remote_ip_details: RemoteIpDetails | None = ... + """Contains information about the remote IP address of the connection.""" + login_attributes: list[LoginAttribute] | None = ... + """Indicates the login attributes used in the login attempt.""" + +@dataclass(kw_only=True) +class RecoveryPoint(_SerdeShape): + """ + Contains information about the recovery point configuration for scanning + backup data from Amazon Web Services Backup. + """ + + backup_vault_name: str | None = ... + """ + The name of the Amazon Web Services Backup vault that contains the name + of the recovery point to be scanned. + """ + continuous_scan_details: ContinuousScanDetails | None = ... + """ + Contains information about the time range within the continuous backup + in Amazon Web Services Backup to scan. + """ + +@dataclass(kw_only=True) +class RecoveryPointDetails(_SerdeShape): + """Contains details about the backup recovery point.""" + + recovery_point_arn: str | None = ... + """The Amazon Resource Name (ARN) of the recovery point.""" + backup_vault_name: str | None = ... + """The name of the backup vault containing the recovery point.""" + continuous_scan_details: ScanConfigurationContinuousScanDetails | None = ... + """ + Contains information about the time range within the continuous backup + in Amazon Web Services Backup that was scanned for a point-in-time + recovery resource. + """ + +@dataclass(kw_only=True) +class RemoteAccountDetails(_SerdeShape): + """ + Contains details about the remote Amazon Web Services account that made + the API call. + """ + + account_id: str | None = ... + """The Amazon Web Services account ID of the remote API caller.""" + affiliated: bool | None = ... + """ + Details on whether the Amazon Web Services account of the remote API + caller is related to your GuardDuty environment. If this value is `True` + the API caller is affiliated to your account in some way. If it is + `False` the API caller is from outside your environment. + """ + aws_service_name: str | None = ... + """ + If the remote account belongs to an Amazon Web Services service, this + field indicates which service the remote account belongs to. + """ + +@dataclass(kw_only=True) +class RemoteIpDetails(_SerdeShape): + """Contains information about the remote IP address of the connection.""" + + city: City | None = ... + """The city information of the remote IP address.""" + country: Country | None = ... + """The country code of the remote IP address.""" + geo_location: GeoLocation | None = ... + """The location information of the remote IP address.""" + ip_address_v4: str | None = ... + """The IPv4 remote address of the connection.""" + ip_address_v6: str | None = ... + """The IPv6 remote address of the connection.""" + organization: Organization | None = ... + """The ISP organization information of the remote IP address.""" + +@dataclass(kw_only=True) +class RemotePortDetails(_SerdeShape): + """Contains information about the remote port.""" + + port: int | None = ... + """The port number of the remote connection.""" + port_name: str | None = ... + """The port name of the remote connection.""" + +@dataclass(kw_only=True) +class Resource(_SerdeShape): + """ + Contains information about the Amazon Web Services resource associated + with the activity that prompted GuardDuty to generate a finding. + """ + + access_key_details: AccessKeyDetails | None = ... + """ + The IAM access key details (user information) of a user that engaged in + the activity that prompted GuardDuty to generate a finding. + """ + s3_bucket_details: list[S3BucketDetail] | None = ... + """Contains information on the S3 bucket.""" + instance_details: InstanceDetails | None = ... + """ + The information about the EC2 instance associated with the activity that + prompted GuardDuty to generate a finding. + """ + eks_cluster_details: EksClusterDetails | None = ... + """Details about the EKS cluster involved in a Kubernetes finding.""" + kubernetes_details: KubernetesDetails | None = ... + """ + Details about the Kubernetes user and workload involved in a Kubernetes + finding. + """ + resource_type: str | None = ... + """The type of Amazon Web Services resource.""" + ebs_volume_details: EbsVolumeDetails | None = ... + """Contains list of scanned and skipped EBS volumes with details.""" + ecs_cluster_details: EcsClusterDetails | None = ... + """Contains information about the details of the ECS Cluster.""" + container_details: Container | None = ... + """Details of a container.""" + lambda_details: LambdaDetails | None = ... + """ + Contains information about the Lambda function that was involved in a + finding. + """ + rds_db_instance_details: RdsDbInstanceDetails | None = ... + """ + Contains information about the database instance to which an anomalous + login attempt was made. + """ + rds_limitless_db_details: RdsLimitlessDbDetails | None = ... + """ + Contains information about the RDS Limitless database that was involved + in a GuardDuty finding. + """ + rds_db_user_details: RdsDbUserDetails | None = ... + """ + Contains information about the user details through which anomalous + login attempt was made. + """ + ebs_snapshot_details: EbsSnapshotDetails | None = ... + """Contains details about the EBS snapshot that was scanned.""" + ec2_image_details: Ec2ImageDetails | None = ... + """Contains details about the EC2 image that was scanned.""" + recovery_point_details: RecoveryPointDetails | None = ... + """Contains details about the backup recovery point that was scanned.""" + bedrock_guardrail_details: BedrockGuardrailDetails | None = ... + """ + Contains information about the Bedrock guardrail that was involved in a + finding. + """ + model_details: list[ModelDetail] | None = ... + """Contains information about the AI models involved in a finding.""" + +@dataclass(kw_only=True) +class ResourceData(_SerdeShape): + """ + Contains information about the Amazon Web Services resource that is + associated with the activity that prompted GuardDuty to generate a + finding. + """ + + s3_bucket: S3Bucket | None = ... + """Contains information about the Amazon S3 bucket.""" + ec2_instance: Ec2Instance | None = ... + """Contains information about the Amazon EC2 instance.""" + access_key: AccessKey | None = ... + """ + Contains information about the IAM access key details of a user that + involved in the GuardDuty finding. + """ + ec2_network_interface: Ec2NetworkInterface | None = ... + """ + Contains information about the elastic network interface of the Amazon + EC2 instance. + """ + s3_object: S3Object | None = ... + """Contains information about the Amazon S3 object.""" + eks_cluster: EksCluster | None = ... + """ + Contains detailed information about the Amazon EKS cluster associated + with the activity that prompted GuardDuty to generate a finding. + """ + kubernetes_workload: KubernetesWorkload | None = ... + """ + Contains detailed information about the Kubernetes workload associated + with the activity that prompted GuardDuty to generate a finding. + """ + container: ContainerFindingResource | None = ... + """ + Contains detailed information about the container associated with the + activity that prompted GuardDuty to generate a finding. + """ + ecs_cluster: EcsCluster | None = ... + """ + Contains detailed information about the Amazon ECS cluster associated + with the activity that prompted GuardDuty to generate a finding. + """ + ecs_task: EcsTask | None = ... + """ + Contains detailed information about the Amazon ECS task associated with + the activity that prompted GuardDuty to generate a finding. + """ + iam_instance_profile: IamInstanceProfileV2 | None = ... + """ + Contains detailed information about the IAM instance profile associated + with the activity that prompted GuardDuty to generate a finding. + """ + autoscaling_auto_scaling_group: AutoscalingAutoScalingGroup | None = ... + """ + Contains detailed information about the Auto Scaling Group associated + with the activity that prompted GuardDuty to generate a finding. + """ + ec2_launch_template: Ec2LaunchTemplate | None = ... + """ + Contains detailed information about the EC2 launch template associated + with the activity that prompted GuardDuty to generate a finding. + """ + ec2_vpc: Ec2Vpc | None = ... + """ + Contains detailed information about the EC2 VPC associated with the + activity that prompted GuardDuty to generate a finding. + """ + ec2_image: Ec2Image | None = ... + """ + Contains detailed information about the EC2 Image associated with the + activity that prompted GuardDuty to generate a finding. + """ + cloudformation_stack: CloudformationStack | None = ... + """ + Contains detailed information about the CloudFormation stack associated + with the activity that prompted GuardDuty to generate a finding. + """ + bedrock_guardrail: BedrockGuardrailResource | None = ... + """ + Contains detailed information about the Amazon Bedrock guardrail + associated with the activity that prompted GuardDuty to generate a + finding. + """ + +@dataclass(kw_only=True) +class ResourceDetails(_SerdeShape): + """Represents the resources that were scanned in the scan entry.""" + + instance_arn: str | None = ... + """Instance ARN that was scanned in the scan entry.""" + +@dataclass(kw_only=True) +class ResourceNotFoundException(ServiceError, _SerdeShape): + """The requested resource can't be found.""" + + type: str | None = ... + """The error type.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ResourceStatistics(_SerdeShape): + """ + Information about each resource type associated with the + `groupedByResource` statistics. + """ + + account_id: str | None = ... + """The ID of the Amazon Web Services account.""" + last_generated_at: datetime | None = ... + """ + The timestamp at which the statistics for this resource was last + generated. + """ + resource_id: str | None = ... + """ + ID associated with each resource. The following list provides the + mapping of the resource type and resource ID. + + **Mapping of resource and resource ID** + + - AccessKey - `resource.accessKeyDetails.accessKeyId` + + - Container - `resource.containerDetails.id` + + - ECSCluster - `resource.ecsClusterDetails.name` + + - EKSCluster - `resource.eksClusterDetails.name` + + - Instance - `resource.instanceDetails.instanceId` + + - KubernetesCluster - + `resource.kubernetesDetails.kubernetesWorkloadDetails.name` + + - Lambda - `resource.lambdaDetails.functionName` + + - RDSDBInstance - `resource.rdsDbInstanceDetails.dbInstanceIdentifier` + + - S3Bucket - `resource.s3BucketDetails.name` + + - S3Object - `resource.s3BucketDetails.name` + """ + resource_type: str | None = ... + """The type of resource.""" + total_findings: int | None = ... + """The total number of findings associated with this resource.""" + +class ResourceType(UnknownEnumMixin, StrEnum): + EKS = "EKS" + ECS = "ECS" + EC2 = "EC2" + +@dataclass(kw_only=True) +class ResourceV2(_SerdeShape): + """ + Contains information about the Amazon Web Services resource that is + associated with the GuardDuty finding. + """ + + uid: str | None = ... + """The unique identifier of the resource.""" + name: str | None = ... + """The name of the resource.""" + account_id: str | None = ... + """The Amazon Web Services account ID to which the resource belongs.""" + resource_type: str | None = ... + """The type of the Amazon Web Services resource.""" + region: str | None = ... + """The Amazon Web Services Region where the resource belongs.""" + service: str | None = ... + """The Amazon Web Services service of the resource.""" + cloud_partition: str | None = ... + """ + The cloud partition within the Amazon Web Services Region to which the + resource belongs. + """ + tags: list[Tag] | None = ... + """Contains information about the tags associated with the resource.""" + data: ResourceData | None = ... + """ + Contains information about the Amazon Web Services resource associated + with the activity that prompted GuardDuty to generate a finding. + """ + +class RiskLevel(UnknownEnumMixin, StrEnum): + INFO = "Info" + LOW = "Low" + MEDIUM = "Medium" + HIGH = "High" + CRITICAL = "Critical" + +@dataclass(kw_only=True) +class RuleDefinition(_SerdeShape): + """Contains the detection logic for a custom detection rule.""" + + expression: str | None = ... + """The detection logic expression for the rule.""" + +@dataclass(kw_only=True) +class RuleDetail(_SerdeShape): + """ + Contains the full details of a custom detection rule, including its + detection logic. + """ + + rule_id: str | None = ... + """The unique identifier for the rule.""" + arn: str | None = ... + """The Amazon Resource Name (ARN) of the rule.""" + name: str | None = ... + """The display name of the rule.""" + description: str | None = ... + """A description of what the rule detects.""" + severity: str | None = ... + """The severity level assigned to findings generated by this rule.""" + data_source: str | None = ... + """The data source that the rule analyzes.""" + tactic: str | None = ... + """The MITRE ATT&CK tactic associated with the rule.""" + technique: str | None = ... + """The MITRE ATT&CK technique associated with the rule.""" + service: str | None = ... + """The Amazon Web Services service associated with the rule.""" + definition: RuleDefinition | None = ... + """The detection logic definition for the rule.""" + language: str | None = ... + """The language used for the detection logic expression.""" + schema: str | None = ... + """The schema version used by the rule definition.""" + created_at: datetime | None = ... + """The timestamp when the rule was created.""" + updated_at: datetime | None = ... + """The timestamp when the rule was last updated.""" + +class RuleLanguage(UnknownEnumMixin, StrEnum): + SQL = "SQL" + +class RuleSchema(UnknownEnumMixin, StrEnum): + CLOUD_TRAIL = "CloudTrail" + +@dataclass(kw_only=True) +class RuleSummary(_SerdeShape): + """Contains summary information about a custom detection rule.""" + + rule_id: str | None = ... + """The unique identifier for the rule.""" + arn: str | None = ... + """The Amazon Resource Name (ARN) of the rule.""" + name: str | None = ... + """The display name of the rule.""" + description: str | None = ... + """A description of what the rule detects.""" + severity: str | None = ... + """The severity level assigned to findings generated by this rule.""" + data_source: str | None = ... + """The data source that the rule analyzes.""" + tactic: str | None = ... + """The MITRE ATT&CK tactic associated with the rule.""" + technique: str | None = ... + """The MITRE ATT&CK technique associated with the rule.""" + service: str | None = ... + """The Amazon Web Services service associated with the rule.""" + language: str | None = ... + """The language used for the detection logic expression.""" + schema: str | None = ... + """The schema version used by the rule definition.""" + created_at: datetime | None = ... + """The timestamp when the rule was created.""" + updated_at: datetime | None = ... + """The timestamp when the rule was last updated.""" + +@dataclass(kw_only=True) +class RuntimeContext(_SerdeShape): + """Additional information about the suspicious activity.""" + + modifying_process: ProcessDetails | None = ... + """ + Information about the process that modified the current process. This is + available for multiple finding types. + """ + modified_at: datetime | None = ... + """ + The timestamp at which the process modified the current process. The + timestamp is in UTC date string format. + """ + script_path: str | None = ... + """The path to the script that was executed.""" + library_path: str | None = ... + """The path to the new library that was loaded.""" + ld_preload_value: str | None = ... + """The value of the LD_PRELOAD environment variable.""" + socket_path: str | None = ... + """The path to the docket socket that was accessed.""" + runc_binary_path: str | None = ... + """The path to the leveraged `runc` implementation.""" + release_agent_path: str | None = ... + """The path in the container that modified the release agent file.""" + mount_source: str | None = ... + """The path on the host that is mounted by the container.""" + mount_target: str | None = ... + """The path in the container that is mapped to the host directory.""" + file_system_type: str | None = ... + """Represents the type of mounted fileSystem.""" + flags: list[str] | None = ... + """ + Represents options that control the behavior of a runtime operation or + action. For example, a filesystem mount operation may contain a + read-only flag. + """ + module_name: str | None = ... + """The name of the module loaded into the kernel.""" + module_file_path: str | None = ... + """The path to the module loaded into the kernel.""" + module_sha256: str | None = ... + """The `SHA256` hash of the module.""" + shell_history_file_path: str | None = ... + """The path to the modified shell history file.""" + target_process: ProcessDetails | None = ... + """ + Information about the process that had its memory overwritten by the + current process. + """ + address_family: str | None = ... + """ + Represents the communication protocol associated with the address. For + example, the address family `AF_INET` is used for IP version of 4 + protocol. + """ + iana_protocol_number: int | None = ... + """ + Specifies a particular protocol within the address family. Usually there + is a single protocol in address families. For example, the address + family `AF_INET` only has the IP protocol. + """ + memory_regions: list[str] | None = ... + """ + Specifies the Region of a process's address space such as stack and + heap. + """ + tool_name: str | None = ... + """Name of the potentially suspicious tool.""" + tool_category: str | None = ... + """ + Category that the tool belongs to. Some of the examples are Backdoor + Tool, Pentest Tool, Network Scanner, and Network Sniffer. + """ + service_name: str | None = ... + """Name of the security service that has been potentially disabled.""" + command_line_example: str | None = ... + """Example of the command line involved in the suspicious activity.""" + threat_file_path: str | None = ... + """ + The suspicious file path for which the threat intelligence details were + found. + """ + file_operation: str | None = ... + """ + Represents the type of file operation that triggered the finding, such + as Write, Delete, Rename, Link, or Symlink. + """ + file_path: str | None = ... + """ + The path of the sensitive file that was modified. Modification includes + write, delete, rename, link, or symlink operations. This field is + indexed for filtering. + """ + related_file_paths: list[str] | None = ... + """ + All file paths modified by the same process that triggered the finding, + up to a maximum of 25 paths. + """ + +@dataclass(kw_only=True) +class RuntimeDetails(_SerdeShape): + """ + Information about the process and any required context values for a + specific finding. + """ + + process: ProcessDetails | None = ... + """Information about the observed process.""" + context: RuntimeContext | None = ... + """Additional information about the suspicious activity.""" + +@dataclass(kw_only=True) +class S3Bucket(_SerdeShape): + """Contains information about the Amazon S3 bucket policies and encryption.""" + + owner_id: str | None = ... + """The owner ID of the associated S3Amazon S3bucket.""" + created_at: datetime | None = ... + """The timestamp at which the Amazon S3 bucket was created.""" + encryption_type: str | None = ... + """ + The type of encryption used for the Amazon S3 buckets and its objects. + For more information, see [Protecting data with server-side + encryption](https://docs.aws.amazon.com/AmazonS3/latest/userguide/serv-side-encryption.html) + in the *Amazon S3 User Guide*. + """ + encryption_key_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the encryption key that is used to + encrypt the Amazon S3 bucket and its objects. + """ + effective_permission: str | None = ... + """ + Describes the effective permissions on this S3 bucket, after factoring + all the attached policies. + """ + public_read_access: str | None = ... + """ + Indicates whether or not the public read access is allowed for an Amazon + S3 bucket. + """ + public_write_access: str | None = ... + """ + Indicates whether or not the public write access is allowed for an + Amazon S3 bucket. + """ + account_public_access: PublicAccessConfiguration | None = ... + """ + Contains information about the public access policies that apply to the + Amazon S3 bucket at the account level. + """ + bucket_public_access: PublicAccessConfiguration | None = ... + """ + Contains information about public access policies that apply to the + Amazon S3 bucket. + """ + s3_object_uids: list[str] | None = ... + """Represents a list of Amazon S3 object identifiers.""" + +@dataclass(kw_only=True) +class S3BucketDetail(_SerdeShape): + """Contains information on the S3 bucket.""" + + arn: str | None = ... + """The Amazon Resource Name (ARN) of the S3 bucket.""" + name: str | None = ... + """The name of the S3 bucket.""" + type: str | None = ... + """Describes whether the bucket is a source or destination bucket.""" + created_at: datetime | None = ... + """The date and time the bucket was created at.""" + owner: Owner | None = ... + """The owner of the S3 bucket.""" + tags: list[Tag] | None = ... + """All tags attached to the S3 bucket""" + default_server_side_encryption: DefaultServerSideEncryption | None = ... + """Describes the server side encryption method used in the S3 bucket.""" + public_access: PublicAccess | None = ... + """Describes the public access policies that apply to the S3 bucket.""" + s3_object_details: list[S3ObjectDetail] | None = ... + """Information about the S3 object that was scanned.""" + +@dataclass(kw_only=True) +class S3LogsConfiguration(_SerdeShape): + """Describes whether S3 data event logs will be enabled as a data source.""" + + enable: bool | None = ... + """The status of S3 data event logs as a data source.""" + +@dataclass(kw_only=True) +class S3LogsConfigurationResult(_SerdeShape): + """Describes whether S3 data event logs will be enabled as a data source.""" + + status: str | None = ... + """ + A value that describes whether S3 data event logs are automatically + enabled for new members of the organization. + """ + +@dataclass(kw_only=True) +class S3Object(_SerdeShape): + """Contains information about the Amazon S3 object.""" + + e_tag: str | None = ... + """ + The entity tag is a hash of the Amazon S3 object. The ETag reflects + changes only to the contents of an object, and not its metadata. + """ + key: str | None = ... + """The key of the Amazon S3 object.""" + version_id: str | None = ... + """The version Id of the Amazon S3 object.""" + +@dataclass(kw_only=True) +class S3ObjectDetail(_SerdeShape): + """Information about the S3 object that was scanned""" + + object_arn: str | None = ... + """Amazon Resource Name (ARN) of the S3 object.""" + key: str | None = ... + """Key of the S3 object.""" + e_tag: str | None = ... + """ + The entity tag is a hash of the S3 object. The ETag reflects changes + only to the contents of an object, and not its metadata. + """ + hash: str | None = ... + """Hash of the threat detected in this finding.""" + version_id: str | None = ... + """Version ID of the object.""" + +@dataclass(kw_only=True) +class S3ObjectForSendObjectMalwareScan(_SerdeShape): + """ + The S3 object path to initiate a scan, including bucket name, object + key, and optional version ID. + """ + + bucket: str | None = ... + """ + The name of the S3 bucket containing the object to scan. The bucket must + have GuardDuty Malware Protection enabled. + """ + key: str | None = ... + """ + The key (name) of the S3 object to scan for malware. This must be the + full key path of the object within the bucket. + """ + version_id: str | None = ... + """ + The version ID of the S3 object to scan. If not specified, the latest + version of the object is scanned. + """ + +@dataclass(kw_only=True) +class Scan(_SerdeShape): + """ + Contains information about malware scans associated with GuardDuty + Malware Protection for EC2. + """ + + detector_id: str | None = ... + """ + The unique ID of the detector that is associated with the request. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + admin_detector_id: str | None = ... + """ + The unique detector ID of the administrator account that the request is + associated with. If the account is an administrator, the + `AdminDetectorId` will be the same as the one used for `DetectorId`. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + scan_id: str | None = ... + """The unique scan ID associated with a scan entry.""" + scan_status: str | None = ... + """An enum value representing possible scan statuses.""" + failure_reason: str | None = ... + """Represents the reason for `FAILED` scan status.""" + scan_start_time: datetime | None = ... + """The timestamp of when the scan was triggered.""" + scan_end_time: datetime | None = ... + """The timestamp of when the scan was finished.""" + trigger_details: TriggerDetails | None = ... + """Specifies the reason why the scan was initiated.""" + resource_details: ResourceDetails | None = ... + """Represents the resources that were scanned in the scan entry.""" + scan_result_details: ScanResultDetails | None = ... + """Represents the result of the scan.""" + account_id: str | None = ... + """The ID for the account that belongs to the scan.""" + total_bytes: int | None = ... + """Represents total bytes that were scanned.""" + file_count: int | None = ... + """Represents the number of files that were scanned.""" + attached_volumes: list[VolumeDetail] | None = ... + """ + List of volumes that were attached to the original instance to be + scanned. + """ + scan_type: str | None = ... + """Specifies the scan type that invoked the malware scan.""" + +class ScanCategory(UnknownEnumMixin, StrEnum): + FULL_SCAN = "FULL_SCAN" + INCREMENTAL_SCAN = "INCREMENTAL_SCAN" + +@dataclass(kw_only=True) +class ScanCondition(_SerdeShape): + """Contains information about the condition.""" + + map_equals: list[ScanConditionPair] | None = ... + """ + Represents an *mapEqual* condition to be applied to a single field when + triggering for malware scan. + """ + +@dataclass(kw_only=True) +class ScanConditionPair(_SerdeShape): + """ + Represents the `key:value` pair to be matched against given resource + property. + """ + + key: str | None = ... + """Represents the **key** in the map condition.""" + value: str | None = ... + """ + Represents optional **value** in the map condition. If not specified, + only the **key** will be matched. + """ + +@dataclass(kw_only=True) +class ScanConfiguration(_SerdeShape): + """Contains information about the configuration used for the malware scan.""" + + role: str | None = ... + """ + Amazon Resource Name (ARN) of the IAM role that should contain the + required permissions for the scan. + """ + trigger_details: TriggerDetails | None = ... + """Information about the entity that triggered the malware scan.""" + incremental_scan_details: IncrementalScanDetails | None = ... + """Information about the incremental scan configuration, if applicable.""" + recovery_point: ScanConfigurationRecoveryPoint | None = ... + """ + Information about the recovery point configuration used for the scan, if + applicable. + """ + +@dataclass(kw_only=True) +class ScanConfigurationContinuousScanDetails(_SerdeShape): + """ + Contains information about the time range within the continuous backup + in Amazon Web Services Backup that was scanned for a point-in-time + recovery resource. + """ + + start_time: datetime | None = ... + """The timestamp representing the start of the time range that was scanned.""" + end_time: datetime + """The timestamp representing the end of the time range that was scanned.""" + +@dataclass(kw_only=True) +class ScanConfigurationRecoveryPoint(_SerdeShape): + """ + Contains information about the recovery point configuration used in the + scan. + """ + + backup_vault_name: str | None = ... + """ + The name of the Amazon Web Services Backup vault that contains the + recovery point for the scanned. + """ + continuous_scan_details: ScanConfigurationContinuousScanDetails | None = ... + """ + The time range within the continuous backup in Amazon Web Services + Backup that was scanned for a point-in-time recovery resource. + """ + +class ScanCriterionKey(UnknownEnumMixin, StrEnum): + """ + An enum value representing possible resource properties to match with + given scan condition. + """ + + EC2_INSTANCE_TAG = "EC2_INSTANCE_TAG" + +@dataclass(kw_only=True) +class ScanDetections(_SerdeShape): + """Contains a complete view providing malware scan result details.""" + + scanned_item_count: ScannedItemCount | None = ... + """Total number of scanned files.""" + threats_detected_item_count: ThreatsDetectedItemCount | None = ... + """Total number of infected files.""" + highest_severity_threat_details: HighestSeverityThreatDetails | None = ... + """ + Details of the highest severity threat detected during malware scan and + number of infected files. + """ + threat_detected_by_name: ThreatDetectedByName | None = ... + """Contains details about identified threats organized by threat name.""" + +@dataclass(kw_only=True) +class ScanEc2InstanceWithFindings(_SerdeShape): + """ + Describes whether Malware Protection for EC2 instances with findings + will be enabled as a data source. + """ + + ebs_volumes: bool | None = ... + """Describes the configuration for scanning EBS volumes as data source.""" + +@dataclass(kw_only=True) +class ScanEc2InstanceWithFindingsResult(_SerdeShape): + """ + An object that contains information on the status of whether Malware + Protection for EC2 instances with findings will be enabled as a data + source. + """ + + ebs_volumes: EbsVolumesResult | None = ... + """Describes the configuration of scanning EBS volumes as a data source.""" + +@dataclass(kw_only=True) +class ScanFilePath(_SerdeShape): + """Contains details of infected file including name, file path and hash.""" + + file_path: str | None = ... + """The file path of the infected file.""" + volume_arn: str | None = ... + """EBS volume ARN details of the infected file.""" + hash: str | None = ... + """The hash value of the infected file.""" + file_name: str | None = ... + """File name of the infected file.""" + +@dataclass(kw_only=True) +class ScannedItemCount(_SerdeShape): + """Total number of scanned files.""" + + total_gb: int | None = ... + """Total GB of files scanned for malware.""" + files: int | None = ... + """Number of files scanned.""" + volumes: int | None = ... + """Total number of scanned volumes.""" + +@dataclass(kw_only=True) +class ScannedResource(_SerdeShape): + """ + Contains information about a resource that was scanned as part of the + malware scan operation. + """ + + scanned_resource_arn: str | None = ... + """Amazon Resource Name (ARN) of the scanned resource.""" + scanned_resource_type: str | None = ... + """The resource type of the scanned resource.""" + scanned_resource_status: str | None = ... + """The status of the scanned resource.""" + scan_status_reason: str | None = ... + """ + The reason for the scan status of this particular resource, if + applicable. + """ + resource_details: ScannedResourceDetails | None = ... + """Information about the scanned resource.""" + +@dataclass(kw_only=True) +class ScannedResourceDetails(_SerdeShape): + """Contains additional information about a resource that was scanned.""" + + ebs_volume: VolumeDetail | None = ... + """Contains information about the EBS volume that was scanned.""" + ebs_snapshot: EbsSnapshot | None = ... + """Contains information about the EBS snapshot that was scanned.""" + +@dataclass(kw_only=True) +class ScanResourceCriteria(_SerdeShape): + """ + Contains information about criteria used to filter resources before + triggering malware scan. + """ + + include: dict[str, ScanCondition] | None = ... + """ + Represents condition that when matched will allow a malware scan for a + certain resource. + """ + exclude: dict[str, ScanCondition] | None = ... + """ + Represents condition that when matched will prevent a malware scan for a + certain resource. + """ + +class ScanResult(UnknownEnumMixin, StrEnum): + CLEAN = "CLEAN" + INFECTED = "INFECTED" + +@dataclass(kw_only=True) +class ScanResultDetails(_SerdeShape): + """Represents the result of the scan.""" + + scan_result: str | None = ... + """An enum value representing possible scan results.""" + +class ScanResultStatus(UnknownEnumMixin, StrEnum): + NO_THREATS_FOUND = "NO_THREATS_FOUND" + THREATS_FOUND = "THREATS_FOUND" + +@dataclass(kw_only=True) +class ScanResultThreat(_SerdeShape): + """ + Contains information about a specific threat that was detected during + the malware scan. + """ + + name: str | None = ... + """The name of the detected threat.""" + source: str | None = ... + """The source that detected this threat.""" + count: int | None = ... + """The number of instances of this threat that were detected.""" + hash: str | None = ... + """The hash value associated with the detected threat.""" + item_details: list[ItemDetails] | None = ... + """Additional information about where this threat was detected.""" + +class ScanStatus(UnknownEnumMixin, StrEnum): + RUNNING = "RUNNING" + COMPLETED = "COMPLETED" + FAILED = "FAILED" + SKIPPED = "SKIPPED" + +class ScanStatusReason(UnknownEnumMixin, StrEnum): + ACCESS_DENIED = "ACCESS_DENIED" + RESOURCE_NOT_FOUND = "RESOURCE_NOT_FOUND" + SNAPSHOT_SIZE_LIMIT_EXCEEDED = "SNAPSHOT_SIZE_LIMIT_EXCEEDED" + RESOURCE_UNAVAILABLE = "RESOURCE_UNAVAILABLE" + INCONSISTENT_SOURCE = "INCONSISTENT_SOURCE" + INCREMENTAL_NO_DIFFERENCE = "INCREMENTAL_NO_DIFFERENCE" + NO_EBS_VOLUMES_FOUND = "NO_EBS_VOLUMES_FOUND" + UNSUPPORTED_PRODUCT_CODE_TYPE = "UNSUPPORTED_PRODUCT_CODE_TYPE" + AMI_SNAPSHOT_LIMIT_EXCEEDED = "AMI_SNAPSHOT_LIMIT_EXCEEDED" + UNRELATED_RESOURCES = "UNRELATED_RESOURCES" + BASE_RESOURCE_NOT_SCANNED = "BASE_RESOURCE_NOT_SCANNED" + BASE_CREATED_AFTER_TARGET = "BASE_CREATED_AFTER_TARGET" + UNSUPPORTED_FOR_INCREMENTAL = "UNSUPPORTED_FOR_INCREMENTAL" + UNSUPPORTED_AMI = "UNSUPPORTED_AMI" + UNSUPPORTED_SNAPSHOT = "UNSUPPORTED_SNAPSHOT" + UNSUPPORTED_COMPOSITE_RECOVERY_POINT = "UNSUPPORTED_COMPOSITE_RECOVERY_POINT" + ALL_FILES_SKIPPED_OR_FAILED = "ALL_FILES_SKIPPED_OR_FAILED" + +@dataclass(kw_only=True) +class ScanThreatName(_SerdeShape): + """ + Contains files infected with the given threat providing details of + malware name and severity. + """ + + name: str | None = ... + """The name of the identified threat.""" + severity: str | None = ... + """Severity of threat identified as part of the malware scan.""" + item_count: int | None = ... + """Total number of files infected with given threat.""" + file_paths: list[ScanFilePath] | None = ... + """List of infected files in EBS volume with details.""" + +class ScanType(UnknownEnumMixin, StrEnum): + GUARDDUTY_INITIATED = "GUARDDUTY_INITIATED" + ON_DEMAND = "ON_DEMAND" + +@dataclass(kw_only=True) +class SecurityContext(_SerdeShape): + """Container security context.""" + + privileged: bool | None = ... + """Whether the container is privileged.""" + allow_privilege_escalation: bool | None = ... + """ + Whether or not a container or a Kubernetes pod is allowed to gain more + privileges than its parent process. + """ + +@dataclass(kw_only=True) +class SecurityGroup(_SerdeShape): + """ + Contains information about the security groups associated with the EC2 + instance. + """ + + group_id: str | None = ... + """The security group ID of the EC2 instance.""" + group_name: str | None = ... + """The security group name of the EC2 instance.""" + +@dataclass(kw_only=True) +class SendObjectMalwareScanInput(_SerdeShape): + """Dataclass for SendObjectMalwareScanInput structure.""" + + s3_object: S3ObjectForSendObjectMalwareScan | None = ... + """ + The S3 object information for the object you want to scan. The bucket + must have a Malware Protection plan configured to use this API. + """ + +@dataclass(kw_only=True) +class SendObjectMalwareScanOutput(_SerdeShape): + """Dataclass for SendObjectMalwareScanOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class Sequence(_SerdeShape): + """Contains information about the GuardDuty attack sequence finding.""" + + uid: str | None = ... + """Unique identifier of the attack sequence.""" + description: str | None = ... + """Description of the attack sequence.""" + actors: list[Actor] | None = ... + """Contains information about the actors involved in the attack sequence.""" + resources: list[ResourceV2] | None = ... + """ + Contains information about the resources involved in the attack + sequence. + """ + endpoints: list[NetworkEndpoint] | None = ... + """ + Contains information about the network endpoints that were used in the + attack sequence. + """ + signals: list[Signal] | None = ... + """Contains information about the signals involved in the attack sequence.""" + sequence_indicators: list[Indicator] | None = ... + """ + Contains information about the indicators observed in the attack + sequence. + """ + additional_sequence_types: list[str] | None = ... + """ + Additional types of sequences that may be associated with the attack + sequence finding, providing further context about the nature of the + detected threat. + """ + +@dataclass(kw_only=True) +class Service(_SerdeShape): + """Contains additional information about the generated finding.""" + + action: Action | None = ... + """Information about the activity that is described in a finding.""" + evidence: Evidence | None = ... + """An evidence object associated with the service.""" + archived: bool | None = ... + """Indicates whether this finding is archived.""" + count: int | None = ... + """The total count of the occurrences of this finding type.""" + detector_id: str | None = ... + """The detector ID for the GuardDuty service.""" + event_first_seen: str | None = ... + """ + The first-seen timestamp of the activity that prompted GuardDuty to + generate this finding. + """ + event_last_seen: str | None = ... + """ + The last-seen timestamp of the activity that prompted GuardDuty to + generate this finding. + """ + resource_role: str | None = ... + """The resource role information for this finding.""" + service_name: str | None = ... + """ + The name of the Amazon Web Services service (GuardDuty) that generated a + finding. + """ + user_feedback: str | None = ... + """Feedback that was submitted about the finding.""" + additional_info: ServiceAdditionalInfo | None = ... + """Contains additional information about the generated finding.""" + feature_name: str | None = ... + """The name of the feature that generated a finding.""" + ebs_volume_scan_details: EbsVolumeScanDetails | None = ... + """Returns details from the malware scan that created a finding.""" + runtime_details: RuntimeDetails | None = ... + """ + Information about the process and any required context values for a + specific finding + """ + detection: Detection | None = ... + """Contains information about the detected unusual behavior.""" + malware_scan_details: MalwareScanDetails | None = ... + """ + Returns details from the malware scan that generated a GuardDuty + finding. + """ + +@dataclass(kw_only=True) +class ServiceAdditionalInfo(_SerdeShape): + """Additional information about the generated finding.""" + + value: str | None = ... + """This field specifies the value of the additional information.""" + type: str | None = ... + """Describes the type of the additional information.""" + +@dataclass(kw_only=True) +class Session(_SerdeShape): + """Contains information about the authenticated session.""" + + uid: str | None = ... + """The unique identifier of the session.""" + mfa_status: str | None = ... + """ + Indicates whether or not multi-factor authencation (MFA) was used during + authentication. + + In Amazon Web Services CloudTrail, you can find this value as + `userIdentity.sessionContext.attributes.mfaAuthenticated`. + """ + created_time: datetime | None = ... + """ + The timestamp for when the session was created. + + In Amazon Web Services CloudTrail, you can find this value as + `userIdentity.sessionContext.attributes.creationDate`. + """ + issuer: str | None = ... + """ + Identifier of the session issuer. + + In Amazon Web Services CloudTrail, you can find this value as + `userIdentity.sessionContext.sessionIssuer.arn`. + """ + +@dataclass(kw_only=True) +class SeverityStatistics(_SerdeShape): + """Information about severity level for each finding type.""" + + last_generated_at: datetime | None = ... + """ + The timestamp at which a finding type for a specific severity was last + generated. + """ + severity: float | None = ... + """The severity level associated with each finding type.""" + total_findings: int | None = ... + """The total number of findings associated with this severity.""" + +@dataclass(kw_only=True) +class Signal(_SerdeShape): + """Contains information about the signals involved in the attack sequence.""" + + uid: str | None = ... + """The unique identifier of the signal.""" + type: str | None = ... + """ + The type of the signal used to identify an attack sequence. + + Signals can be GuardDuty findings or activities observed in data sources + that GuardDuty monitors. For more information, see [Foundational data + sources](https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_data-sources.html) + in the *Amazon GuardDuty User Guide*. + + A signal type can be one of the valid values listed in this API. Here + are the related descriptions: + + - `FINDING` - Individually generated GuardDuty finding. + + - `CLOUD_TRAIL` - Activity observed from CloudTrail logs + + - `S3_DATA_EVENTS` - Activity observed from CloudTrail data events for + S3. Activities associated with this type will show up only when you + have enabled GuardDuty S3 Protection feature in your account. For more + information about S3 Protection and steps to enable it, see [S3 + Protection](https://docs.aws.amazon.com/guardduty/latest/ug/s3-protection.html) + in the *Amazon GuardDuty User Guide*. + """ + description: str | None = ... + """The description of the signal.""" + name: str | None = ... + """ + The name of the signal. For example, when signal type is `FINDING`, the + signal name is the name of the finding. + """ + created_at: datetime | None = ... + """ + The timestamp when the first finding or activity related to this signal + was observed. + """ + updated_at: datetime | None = ... + """The timestamp when this signal was last observed.""" + first_seen_at: datetime | None = ... + """ + The timestamp when the first finding or activity related to this signal + was observed. + """ + last_seen_at: datetime | None = ... + """ + The timestamp when the last finding or activity related to this signal + was observed. + """ + severity: float | None = ... + """ + The severity associated with the signal. For more information about + severity, see [Findings severity + levels](https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_findings-severity.html) + in the *Amazon GuardDuty User Guide*. + """ + count: int | None = ... + """The number of times this signal was observed.""" + resource_uids: list[str] | None = ... + """ + Information about the unique identifiers of the resources involved in + the signal. + """ + actor_ids: list[str] | None = ... + """Information about the IDs of the threat actors involved in the signal.""" + endpoint_ids: list[str] | None = ... + """Information about the endpoint IDs associated with this signal.""" + signal_indicators: list[Indicator] | None = ... + """Contains information about the indicators associated with the signals.""" + activities: list[Activity] | None = ... + """ + Contains information about the activities, such as API calls, that were + observed for this signal. + """ + +class SignalType(UnknownEnumMixin, StrEnum): + FINDING = "FINDING" + CLOUD_TRAIL = "CLOUD_TRAIL" + S3_DATA_EVENTS = "S3_DATA_EVENTS" + EKS_AUDIT_LOGS = "EKS_AUDIT_LOGS" + FLOW_LOGS = "FLOW_LOGS" + DNS_LOGS = "DNS_LOGS" + RUNTIME_MONITORING = "RUNTIME_MONITORING" + +@dataclass(kw_only=True) +class SortCriteria(_SerdeShape): + """Contains information about the criteria used for sorting findings.""" + + attribute_name: str | None = ... + """ + Represents the finding attribute, such as `accountId`, that sorts the + findings. + """ + order_by: str | None = ... + """The order by which the sorted findings are to be displayed.""" + +@dataclass(kw_only=True) +class StartMalwareScanConfiguration(_SerdeShape): + """ + Contains information about the configuration to be used for the malware + scan. + """ + + role: str | None = ... + """ + Amazon Resource Name (ARN) of the IAM role that is used for scanning the + resource. + """ + incremental_scan_details: IncrementalScanDetails | None = ... + """ + Contains information about the incremental scan configuration. When + specified, the scan will only process changes since the baseline + resource. + """ + recovery_point: RecoveryPoint | None = ... + """ + Contains information about the recovery point configuration for the + requested scan. + """ + +@dataclass(kw_only=True) +class StartMalwareScanInput(_SerdeShape): + """Dataclass for StartMalwareScanInput structure.""" + + resource_arn: str | None = ... + """ + Amazon Resource Name (ARN) of the resource for which you invoked the + API. + """ + client_token: str | None = ... + """The idempotency token for the create request.""" + scan_configuration: StartMalwareScanConfiguration | None = ... + """ + Contains information about the configuration to be used for the malware + scan. + """ + +@dataclass(kw_only=True) +class StartMalwareScanOutput(_SerdeShape): + """Dataclass for StartMalwareScanOutput structure.""" + + scan_id: str | None = ... + """ + A unique identifier that gets generated when you invoke the API without + any error. Each malware scan has a corresponding scan ID. Using this + scan ID, you can monitor the status of your malware scan. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class StartMonitoringMembersInput(_SerdeShape): + """Dataclass for StartMonitoringMembersInput structure.""" + + detector_id: str | None = ... + """ + The unique ID of the detector of the GuardDuty administrator account + associated with the member accounts to monitor. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + account_ids: list[str] | None = ... + """ + A list of account IDs of the GuardDuty member accounts to start + monitoring. + """ + +@dataclass(kw_only=True) +class StartMonitoringMembersOutput(_SerdeShape): + """Dataclass for StartMonitoringMembersOutput structure.""" + + unprocessed_accounts: list[UnprocessedAccount] | None = ... + """ + A list of objects that contain the unprocessed account and a result + string that explains why it was unprocessed. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class StopMonitoringMembersInput(_SerdeShape): + """Dataclass for StopMonitoringMembersInput structure.""" + + detector_id: str | None = ... + """ + The unique ID of the detector associated with the GuardDuty + administrator account that is monitoring member accounts. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + account_ids: list[str] | None = ... + """A list of account IDs for the member accounts to stop monitoring.""" + +@dataclass(kw_only=True) +class StopMonitoringMembersOutput(_SerdeShape): + """Dataclass for StopMonitoringMembersOutput structure.""" + + unprocessed_accounts: list[UnprocessedAccount] | None = ... + """ + A list of objects that contain an accountId for each account that could + not be processed, and a result string that indicates why the account was + not processed. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class Tag(_SerdeShape): + """Contains information about a tag key-value pair.""" + + key: str | None = ... + """Describes the key associated with the tag.""" + value: str | None = ... + """Describes the value associated with the tag key.""" + +@dataclass(kw_only=True) +class TagResourceInput(_SerdeShape): + """Dataclass for TagResourceInput structure.""" + + resource_arn: str | None = ... + """ + The Amazon Resource Name (ARN) for the GuardDuty resource to apply a tag + to. + """ + tags: dict[str, str] | None = ... + """The tags to be added to a resource.""" + +@dataclass(kw_only=True) +class TagResourceOutput(_SerdeShape): + """Dataclass for TagResourceOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class Threat(_SerdeShape): + """ + Information about the detected threats associated with the generated + finding. + """ + + name: str | None = ... + """ + Name of the detected threat that caused GuardDuty to generate this + finding. + """ + source: str | None = ... + """Source of the threat that generated this finding.""" + item_paths: list[ItemPath] | None = ... + """ + Information about the nested item path and hash of the protected + resource. + """ + count: int | None = ... + """ + The number of occurrences of this specific threat detected during the + scan. + """ + hash: str | None = ... + """The hash identifier of the detected malware threat.""" + item_details: list[ItemDetails] | None = ... + """Detailed information about the detected malware threat.""" + +@dataclass(kw_only=True) +class ThreatDetectedByName(_SerdeShape): + """Contains details about identified threats organized by threat name.""" + + item_count: int | None = ... + """Total number of infected files identified.""" + unique_threat_name_count: int | None = ... + """ + Total number of unique threats by name identified, as part of the + malware scan. + """ + shortened: bool | None = ... + """ + Flag to determine if the finding contains every single infected + file-path and/or every threat. + """ + threat_names: list[ScanThreatName] | None = ... + """List of identified threats with details, organized by threat name.""" + +class ThreatEntitySetFormat(UnknownEnumMixin, StrEnum): + TXT = "TXT" + STIX = "STIX" + OTX_CSV = "OTX_CSV" + ALIEN_VAULT = "ALIEN_VAULT" + PROOF_POINT = "PROOF_POINT" + FIRE_EYE = "FIRE_EYE" + +class ThreatEntitySetStatus(UnknownEnumMixin, StrEnum): + INACTIVE = "INACTIVE" + ACTIVATING = "ACTIVATING" + ACTIVE = "ACTIVE" + DEACTIVATING = "DEACTIVATING" + ERROR = "ERROR" + DELETE_PENDING = "DELETE_PENDING" + DELETED = "DELETED" + +@dataclass(kw_only=True) +class ThreatIntelligenceDetail(_SerdeShape): + """ + An instance of a threat intelligence detail that constitutes evidence + for the finding. + """ + + threat_list_name: str | None = ... + """The name of the threat intelligence list that triggered the finding.""" + threat_names: list[str] | None = ... + """ + A list of names of the threats in the threat intelligence list that + triggered the finding. + """ + threat_file_sha256: str | None = ... + """SHA256 of the file that generated the finding.""" + +class ThreatIntelSetFormat(UnknownEnumMixin, StrEnum): + TXT = "TXT" + STIX = "STIX" + OTX_CSV = "OTX_CSV" + ALIEN_VAULT = "ALIEN_VAULT" + PROOF_POINT = "PROOF_POINT" + FIRE_EYE = "FIRE_EYE" + +class ThreatIntelSetStatus(UnknownEnumMixin, StrEnum): + INACTIVE = "INACTIVE" + ACTIVATING = "ACTIVATING" + ACTIVE = "ACTIVE" + DEACTIVATING = "DEACTIVATING" + ERROR = "ERROR" + DELETE_PENDING = "DELETE_PENDING" + DELETED = "DELETED" + +@dataclass(kw_only=True) +class ThreatsDetectedItemCount(_SerdeShape): + """Contains total number of infected files.""" + + files: int | None = ... + """Total number of infected files.""" + +@dataclass(kw_only=True) +class Total(_SerdeShape): + """ + Contains the total usage with the corresponding currency unit for that + value. + """ + + amount: str | None = ... + """The total usage.""" + unit: str | None = ... + """The currency unit that the amount is given in.""" + +@dataclass(kw_only=True) +class TriggerDetails(_SerdeShape): + """Represents the reason the scan was triggered.""" + + guard_duty_finding_id: str | None = ... + """The ID of the GuardDuty finding that triggered the malware scan.""" + description: str | None = ... + """The description of the scan trigger.""" + trigger_type: str | None = ... + """Specifies the trigger type that started the malware scan.""" + +class TriggerType(UnknownEnumMixin, StrEnum): + BACKUP = "BACKUP" + GUARDDUTY = "GUARDDUTY" + +class TrustedEntitySetFormat(UnknownEnumMixin, StrEnum): + TXT = "TXT" + STIX = "STIX" + OTX_CSV = "OTX_CSV" + ALIEN_VAULT = "ALIEN_VAULT" + PROOF_POINT = "PROOF_POINT" + FIRE_EYE = "FIRE_EYE" + +class TrustedEntitySetStatus(UnknownEnumMixin, StrEnum): + INACTIVE = "INACTIVE" + ACTIVATING = "ACTIVATING" + ACTIVE = "ACTIVE" + DEACTIVATING = "DEACTIVATING" + ERROR = "ERROR" + DELETE_PENDING = "DELETE_PENDING" + DELETED = "DELETED" + +@dataclass(kw_only=True) +class UnarchiveFindingsInput(_SerdeShape): + """Dataclass for UnarchiveFindingsInput structure.""" + + detector_id: str | None = ... + """ + The ID of the detector associated with the findings to unarchive. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + finding_ids: list[str] | None = ... + """The IDs of the findings to unarchive.""" + +@dataclass(kw_only=True) +class UnarchiveFindingsOutput(_SerdeShape): + """Dataclass for UnarchiveFindingsOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UnprocessedAccount(_SerdeShape): + """Contains information about the accounts that weren't processed.""" + + account_id: str | None = ... + """The Amazon Web Services account ID.""" + result: str | None = ... + """A reason why the account hasn't been processed.""" + +@dataclass(kw_only=True) +class UnprocessedDataSourcesResult(_SerdeShape): + """Specifies the names of the data sources that couldn't be enabled.""" + + malware_protection: MalwareProtectionConfigurationResult | None = ... + """ + An object that contains information on the status of all Malware + Protection data sources. + """ + +@dataclass(kw_only=True) +class UntagResourceInput(_SerdeShape): + """Dataclass for UntagResourceInput structure.""" + + resource_arn: str | None = ... + """The Amazon Resource Name (ARN) for the resource to remove tags from.""" + tag_keys: list[str] | None = ... + """The tag keys to remove from the resource.""" + +@dataclass(kw_only=True) +class UntagResourceOutput(_SerdeShape): + """Dataclass for UntagResourceOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateCustomDetectionRuleAssociationInput(_SerdeShape): + """Dataclass for UpdateCustomDetectionRuleAssociationInput structure.""" + + rule_id: str | None = ... + """The unique identifier for the custom detection rule.""" + association_id: str | None = ... + """The unique identifier for the association to update.""" + mode: str | None = ... + """The rule execution mode. Valid values: `LIVE` | `DRY_RUN`.""" + +@dataclass(kw_only=True) +class UpdateCustomDetectionRuleAssociationOutput(_SerdeShape): + """Dataclass for UpdateCustomDetectionRuleAssociationOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateCustomDetectionRuleOrgConfigurationInput(_SerdeShape): + """Dataclass for UpdateCustomDetectionRuleOrgConfigurationInput structure.""" + + rule_id: str | None = ... + """The unique identifier for the custom detection rule.""" + mode: str | None = ... + """ + The execution mode of the organization configuration. Valid values: + `LIVE` | `DRY_RUN`. + """ + include_account_ids: list[str] | None = ... + """ + The account IDs to include in the organization configuration. Mutually + exclusive with `ExcludeAccountIds`. + """ + exclude_account_ids: list[str] | None = ... + """ + The account IDs to exclude from the organization configuration. Mutually + exclusive with `IncludeAccountIds`. + """ + +@dataclass(kw_only=True) +class UpdateCustomDetectionRuleOrgConfigurationOutput(_SerdeShape): + """Dataclass for UpdateCustomDetectionRuleOrgConfigurationOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateDetectorInput(_SerdeShape): + """Dataclass for UpdateDetectorInput structure.""" + + detector_id: str | None = ... + """ + The unique ID of the detector to update. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + enable: bool | None = ... + """Specifies whether the detector is enabled or not enabled.""" + finding_publishing_frequency: str | None = ... + """ + An enum value that specifies how frequently findings are exported, such + as to CloudWatch Events. + """ + data_sources: DataSourceConfigurations | None = ... + """ + Describes which data sources will be updated. + + There might be regional differences because some data sources might not + be available in all the Amazon Web Services Regions where GuardDuty is + presently supported. For more information, see [Regions and + endpoints](https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_regions.html). + """ + features: list[DetectorFeatureConfiguration] | None = ... + """Provides the features that will be updated for the detector.""" + +@dataclass(kw_only=True) +class UpdateDetectorOutput(_SerdeShape): + """Dataclass for UpdateDetectorOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateFilterInput(_SerdeShape): + """Dataclass for UpdateFilterInput structure.""" + + detector_id: str | None = ... + """ + The unique ID of the detector that specifies the GuardDuty service where + you want to update a filter. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + filter_name: str | None = ... + """The name of the filter.""" + description: str | None = ... + """ + The description of the filter. Valid characters include alphanumeric + characters, and special characters such as hyphen, period, colon, + underscore, parentheses (`{ }`, `[ ]`, and `( )`), forward slash, + horizontal tab, vertical tab, newline, form feed, return, and + whitespace. + """ + action: str | None = ... + """ + Specifies the action that is to be applied to the findings that match + the filter. + + Default: NOOP + """ + rank: int | None = ... + """ + Specifies the position of the filter in the list of current filters. + Also specifies the order in which this filter is applied to the + findings. + """ + finding_criteria: FindingCriteria | None = ... + """ + Represents the criteria to be used in the filter for querying findings. + The following fields are available for filtering: + + - accountId + + - arn + + - associatedAttackSequenceArn + + - confidence + + - createdAt + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - id + + - partition + + - region + + - resource.accessKeyDetails.accessKeyId + + - resource.accessKeyDetails.principalId + + - resource.accessKeyDetails.userIdentity.accessKeyId + + - resource.accessKeyDetails.userIdentity.accountId + + - resource.accessKeyDetails.userIdentity.arn + + - resource.accessKeyDetails.userIdentity.principalId + + - resource.accessKeyDetails.userIdentity.sessionContext.attributes.mfaAuthenticated + + - resource.accessKeyDetails.userIdentity.sessionContext.ec2RoleDelivery + + - resource.accessKeyDetails.userIdentity.sessionContext.invokedBy + + - resource.accessKeyDetails.userIdentity.sessionContext.sessionIssuer.accountId + + - resource.accessKeyDetails.userIdentity.sessionContext.sessionIssuer.arn + + - resource.accessKeyDetails.userIdentity.sessionContext.sessionIssuer.principalId + + - resource.accessKeyDetails.userIdentity.sessionContext.sessionIssuer.type + + - resource.accessKeyDetails.userIdentity.sessionContext.sessionIssuer.userName + + - resource.accessKeyDetails.userIdentity.sessionContext.sourceIdentity + + - resource.accessKeyDetails.userIdentity.sessionContext.webIdFederationData.attributes + + - resource.accessKeyDetails.userIdentity.sessionContext.webIdFederationData.federatedProvider + + - resource.accessKeyDetails.userIdentity.type + + - resource.accessKeyDetails.userIdentity.userName + + - resource.accessKeyDetails.userName + + - resource.accessKeyDetails.userType + + - resource.bedrockGuardrailDetails.guardrailArn + + - resource.bedrockGuardrailDetails.guardrailVersion + + - resource.containerDetails.containerRuntime + + - resource.containerDetails.id + + - resource.containerDetails.image + + - resource.containerDetails.imagePrefix + + - resource.containerDetails.name + + - resource.containerDetails.securityContext.allowPrivilegeEscalation + + - resource.containerDetails.securityContext.privileged + + - resource.containerDetails.volumeMounts.mountPath + + - resource.containerDetails.volumeMounts.name + + - resource.ebsSnapshotDetails.snapshotArn + + - resource.ebsVolumeDetails.scannedVolumeDetails.deviceName + + - resource.ebsVolumeDetails.scannedVolumeDetails.encryptionType + + - resource.ebsVolumeDetails.scannedVolumeDetails.kmsKeyArn + + - resource.ebsVolumeDetails.scannedVolumeDetails.snapshotArn + + - resource.ebsVolumeDetails.scannedVolumeDetails.volumeArn + + - resource.ebsVolumeDetails.scannedVolumeDetails.volumeSizeInGB + + - resource.ebsVolumeDetails.scannedVolumeDetails.volumeType + + - resource.ebsVolumeDetails.skippedVolumeDetails.deviceName + + - resource.ebsVolumeDetails.skippedVolumeDetails.encryptionType + + - resource.ebsVolumeDetails.skippedVolumeDetails.kmsKeyArn + + - resource.ebsVolumeDetails.skippedVolumeDetails.snapshotArn + + - resource.ebsVolumeDetails.skippedVolumeDetails.volumeArn + + - resource.ebsVolumeDetails.skippedVolumeDetails.volumeSizeInGB + + - resource.ebsVolumeDetails.skippedVolumeDetails.volumeType + + - resource.ec2ImageDetails.imageArn + + - resource.ecsClusterDetails.activeServicesCount + + - resource.ecsClusterDetails.arn + + - resource.ecsClusterDetails.name + + - resource.ecsClusterDetails.registeredContainerInstancesCount + + - resource.ecsClusterDetails.runningTasksCount + + - resource.ecsClusterDetails.status + + - resource.ecsClusterDetails.tags.key + + - resource.ecsClusterDetails.tags.value + + - resource.ecsClusterDetails.taskDetails.arn + + - resource.ecsClusterDetails.taskDetails.containers.containerRuntime + + - resource.ecsClusterDetails.taskDetails.containers.id + + - resource.ecsClusterDetails.taskDetails.containers.image + + - resource.ecsClusterDetails.taskDetails.containers.imagePrefix + + - resource.ecsClusterDetails.taskDetails.containers.name + + - resource.ecsClusterDetails.taskDetails.containers.securityContext.allowPrivilegeEscalation + + - resource.ecsClusterDetails.taskDetails.containers.securityContext.privileged + + - resource.ecsClusterDetails.taskDetails.containers.volumeMounts.mountPath + + - resource.ecsClusterDetails.taskDetails.containers.volumeMounts.name + + - resource.ecsClusterDetails.taskDetails.createdAt + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - resource.ecsClusterDetails.taskDetails.definitionArn + + - resource.ecsClusterDetails.taskDetails.group + + - resource.ecsClusterDetails.taskDetails.launchType + + - resource.ecsClusterDetails.taskDetails.startedAt + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - resource.ecsClusterDetails.taskDetails.startedBy + + - resource.ecsClusterDetails.taskDetails.tags.key + + - resource.ecsClusterDetails.taskDetails.tags.value + + - resource.ecsClusterDetails.taskDetails.version + + - resource.ecsClusterDetails.taskDetails.volumes.hostPath.path + + - resource.ecsClusterDetails.taskDetails.volumes.name + + - resource.eksClusterDetails.arn + + - resource.eksClusterDetails.createdAt + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - resource.eksClusterDetails.name + + - resource.eksClusterDetails.status + + - resource.eksClusterDetails.tags.key + + - resource.eksClusterDetails.tags.value + + - resource.eksClusterDetails.vpcId + + - resource.instanceDetails.availabilityZone + + - resource.instanceDetails.iamInstanceProfile.arn + + - resource.instanceDetails.iamInstanceProfile.id + + - resource.instanceDetails.imageDescription + + - resource.instanceDetails.imageId + + - resource.instanceDetails.instanceId + + - resource.instanceDetails.instanceState + + - resource.instanceDetails.instanceType + + - resource.instanceDetails.launchTime + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - resource.instanceDetails.networkInterfaces.ipv6Addresses + + - resource.instanceDetails.networkInterfaces.networkInterfaceId + + - resource.instanceDetails.networkInterfaces.privateDnsName + + - resource.instanceDetails.networkInterfaces.privateIpAddress + + - resource.instanceDetails.networkInterfaces.privateIpAddresses.privateDnsName + + - resource.instanceDetails.networkInterfaces.privateIpAddresses.privateIpAddress + + - resource.instanceDetails.networkInterfaces.publicDnsName + + - resource.instanceDetails.networkInterfaces.publicIp + + - resource.instanceDetails.networkInterfaces.securityGroups.groupId + + - resource.instanceDetails.networkInterfaces.securityGroups.groupName + + - resource.instanceDetails.networkInterfaces.subnetId + + - resource.instanceDetails.networkInterfaces.vpcId + + - resource.instanceDetails.outpostArn + + - resource.instanceDetails.platform + + - resource.instanceDetails.productCodes.productCodeId + + - resource.instanceDetails.productCodes.productCodeType + + - resource.instanceDetails.tags.key + + - resource.instanceDetails.tags.value + + - resource.kubernetesDetails.kubernetesUserDetails.groups + + - resource.kubernetesDetails.kubernetesUserDetails.impersonatedUser.groups + + - resource.kubernetesDetails.kubernetesUserDetails.impersonatedUser.username + + - resource.kubernetesDetails.kubernetesUserDetails.sessionName + + - resource.kubernetesDetails.kubernetesUserDetails.uid + + - resource.kubernetesDetails.kubernetesUserDetails.username + + - resource.kubernetesDetails.kubernetesWorkloadDetails.containers.containerRuntime + + - resource.kubernetesDetails.kubernetesWorkloadDetails.containers.id + + - resource.kubernetesDetails.kubernetesWorkloadDetails.containers.image + + - resource.kubernetesDetails.kubernetesWorkloadDetails.containers.imagePrefix + + - resource.kubernetesDetails.kubernetesWorkloadDetails.containers.name + + - resource.kubernetesDetails.kubernetesWorkloadDetails.containers.securityContext.allowPrivilegeEscalation + + - resource.kubernetesDetails.kubernetesWorkloadDetails.containers.securityContext.privileged + + - resource.kubernetesDetails.kubernetesWorkloadDetails.containers.volumeMounts.mountPath + + - resource.kubernetesDetails.kubernetesWorkloadDetails.containers.volumeMounts.name + + - resource.kubernetesDetails.kubernetesWorkloadDetails.hostIpc + + - resource.kubernetesDetails.kubernetesWorkloadDetails.hostNetwork + + - resource.kubernetesDetails.kubernetesWorkloadDetails.hostPid + + - resource.kubernetesDetails.kubernetesWorkloadDetails.name + + - resource.kubernetesDetails.kubernetesWorkloadDetails.namespace + + - resource.kubernetesDetails.kubernetesWorkloadDetails.serviceAccountName + + - resource.kubernetesDetails.kubernetesWorkloadDetails.type + + - resource.kubernetesDetails.kubernetesWorkloadDetails.uid + + - resource.kubernetesDetails.kubernetesWorkloadDetails.volumes.hostPath.path + + - resource.kubernetesDetails.kubernetesWorkloadDetails.volumes.name + + - resource.lambdaDetails.description + + - resource.lambdaDetails.functionArn + + - resource.lambdaDetails.functionName + + - resource.lambdaDetails.functionVersion + + - resource.lambdaDetails.lastModifiedAt + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - resource.lambdaDetails.revisionId + + - resource.lambdaDetails.role + + - resource.lambdaDetails.tags.key + + - resource.lambdaDetails.tags.value + + - resource.lambdaDetails.vpcConfig.securityGroups.groupId + + - resource.lambdaDetails.vpcConfig.securityGroups.groupName + + - resource.lambdaDetails.vpcConfig.subnetIds + + - resource.lambdaDetails.vpcConfig.vpcId + + - resource.rdsDbInstanceDetails.dbClusterIdentifier + + - resource.rdsDbInstanceDetails.dbInstanceArn + + - resource.rdsDbInstanceDetails.dbInstanceIdentifier + + - resource.rdsDbInstanceDetails.dbSecurityGroups.name + + - resource.rdsDbInstanceDetails.dbSecurityGroups.status + + - resource.rdsDbInstanceDetails.dbiResourceId + + - resource.rdsDbInstanceDetails.engine + + - resource.rdsDbInstanceDetails.engineVersion + + - resource.rdsDbInstanceDetails.iamDatabaseAuthenticationEnabled + + - resource.rdsDbInstanceDetails.publiclyAccessible + + - resource.rdsDbInstanceDetails.vpcId + + - resource.rdsDbInstanceDetails.vpcSecurityGroups.status + + - resource.rdsDbInstanceDetails.vpcSecurityGroups.vpcSecurityGroupId + + - resource.rdsDbUserDetails.application + + - resource.rdsDbUserDetails.authMethod + + - resource.rdsDbUserDetails.database + + - resource.rdsDbUserDetails.ssl + + - resource.rdsDbUserDetails.user + + - resource.rdsLimitlessDbDetails.dbClusterIdentifier + + - resource.rdsLimitlessDbDetails.dbShardGroupArn + + - resource.rdsLimitlessDbDetails.dbShardGroupIdentifier + + - resource.rdsLimitlessDbDetails.dbShardGroupResourceId + + - resource.rdsLimitlessDbDetails.engine + + - resource.rdsLimitlessDbDetails.engineVersion + + - resource.rdsLimitlessDbDetails.tags.key + + - resource.rdsLimitlessDbDetails.tags.value + + - resource.recoveryPointDetails.backupVaultName + + - resource.recoveryPointDetails.recoveryPointArn + + - resource.resourceType + + - resource.s3BucketDetails.arn + + - resource.s3BucketDetails.createdAt + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - resource.s3BucketDetails.defaultServerSideEncryption.encryptionType + + - resource.s3BucketDetails.defaultServerSideEncryption.kmsMasterKeyArn + + - resource.s3BucketDetails.name + + - resource.s3BucketDetails.owner.id + + - resource.s3BucketDetails.publicAccess.effectivePermission + + - resource.s3BucketDetails.publicAccess.permissionConfiguration.accountLevelPermissions.blockPublicAccess.blockPublicAcls + + - resource.s3BucketDetails.publicAccess.permissionConfiguration.accountLevelPermissions.blockPublicAccess.blockPublicPolicy + + - resource.s3BucketDetails.publicAccess.permissionConfiguration.accountLevelPermissions.blockPublicAccess.ignorePublicAcls + + - resource.s3BucketDetails.publicAccess.permissionConfiguration.accountLevelPermissions.blockPublicAccess.restrictPublicBuckets + + - resource.s3BucketDetails.publicAccess.permissionConfiguration.bucketLevelPermissions.accessControlList.allowsPublicReadAccess + + - resource.s3BucketDetails.publicAccess.permissionConfiguration.bucketLevelPermissions.accessControlList.allowsPublicWriteAccess + + - resource.s3BucketDetails.publicAccess.permissionConfiguration.bucketLevelPermissions.blockPublicAccess.blockPublicAcls + + - resource.s3BucketDetails.publicAccess.permissionConfiguration.bucketLevelPermissions.blockPublicAccess.blockPublicPolicy + + - resource.s3BucketDetails.publicAccess.permissionConfiguration.bucketLevelPermissions.blockPublicAccess.ignorePublicAcls + + - resource.s3BucketDetails.publicAccess.permissionConfiguration.bucketLevelPermissions.blockPublicAccess.restrictPublicBuckets + + - resource.s3BucketDetails.publicAccess.permissionConfiguration.bucketLevelPermissions.bucketPolicy.allowsPublicReadAccess + + - resource.s3BucketDetails.publicAccess.permissionConfiguration.bucketLevelPermissions.bucketPolicy.allowsPublicWriteAccess + + - resource.s3BucketDetails.s3ObjectDetails.eTag + + - resource.s3BucketDetails.s3ObjectDetails.hash + + - resource.s3BucketDetails.s3ObjectDetails.key + + - resource.s3BucketDetails.s3ObjectDetails.objectArn + + - resource.s3BucketDetails.s3ObjectDetails.versionId + + - resource.s3BucketDetails.tags.key + + - resource.s3BucketDetails.tags.value + + - resource.s3BucketDetails.type + + - schemaVersion + + - service.action.actionType + + - service.action.awsApiCallAction.api + + - service.action.awsApiCallAction.callerType + + - service.action.awsApiCallAction.domainDetails.domain + + - service.action.awsApiCallAction.errorCode + + - service.action.awsApiCallAction.remoteAccountDetails.accountId + + - service.action.awsApiCallAction.remoteAccountDetails.affiliated + + - service.action.awsApiCallAction.remoteAccountDetails.awsServiceName + + - service.action.awsApiCallAction.remoteIpDetails.city.cityName + + - service.action.awsApiCallAction.remoteIpDetails.country.countryCode + + - service.action.awsApiCallAction.remoteIpDetails.country.countryName + + - service.action.awsApiCallAction.remoteIpDetails.geoLocation.lat + + - service.action.awsApiCallAction.remoteIpDetails.geoLocation.lon + + - service.action.awsApiCallAction.remoteIpDetails.ipAddressV4 + + - service.action.awsApiCallAction.remoteIpDetails.ipAddressV6 + + - service.action.awsApiCallAction.remoteIpDetails.organization.asn + + - service.action.awsApiCallAction.remoteIpDetails.organization.asnOrg + + - service.action.awsApiCallAction.remoteIpDetails.organization.isp + + - service.action.awsApiCallAction.remoteIpDetails.organization.org + + - service.action.awsApiCallAction.serviceName + + - service.action.awsApiCallAction.userAgent + + - service.action.dnsRequestAction.blocked + + - service.action.dnsRequestAction.domain + + - service.action.dnsRequestAction.domainWithSuffix + + - service.action.dnsRequestAction.protocol + + - service.action.dnsRequestAction.vpcOwnerAccountId + + - service.action.kubernetesApiCallAction.namespace + + - service.action.kubernetesApiCallAction.parameters + + - service.action.kubernetesApiCallAction.remoteIpDetails.city.cityName + + - service.action.kubernetesApiCallAction.remoteIpDetails.country.countryCode + + - service.action.kubernetesApiCallAction.remoteIpDetails.country.countryName + + - service.action.kubernetesApiCallAction.remoteIpDetails.geoLocation.lat + + - service.action.kubernetesApiCallAction.remoteIpDetails.geoLocation.lon + + - service.action.kubernetesApiCallAction.remoteIpDetails.ipAddressV4 + + - service.action.kubernetesApiCallAction.remoteIpDetails.ipAddressV6 + + - service.action.kubernetesApiCallAction.remoteIpDetails.organization.asn + + - service.action.kubernetesApiCallAction.remoteIpDetails.organization.asnOrg + + - service.action.kubernetesApiCallAction.remoteIpDetails.organization.isp + + - service.action.kubernetesApiCallAction.remoteIpDetails.organization.org + + - service.action.kubernetesApiCallAction.requestUri + + - service.action.kubernetesApiCallAction.resource + + - service.action.kubernetesApiCallAction.resourceName + + - service.action.kubernetesApiCallAction.sourceIPs + + - service.action.kubernetesApiCallAction.statusCode + + - service.action.kubernetesApiCallAction.subresource + + - service.action.kubernetesApiCallAction.userAgent + + - service.action.kubernetesApiCallAction.verb + + - service.action.kubernetesPermissionCheckedDetails.allowed + + - service.action.kubernetesPermissionCheckedDetails.namespace + + - service.action.kubernetesPermissionCheckedDetails.resource + + - service.action.kubernetesPermissionCheckedDetails.verb + + - service.action.kubernetesRoleBindingDetails.kind + + - service.action.kubernetesRoleBindingDetails.name + + - service.action.kubernetesRoleBindingDetails.roleRefKind + + - service.action.kubernetesRoleBindingDetails.roleRefName + + - service.action.kubernetesRoleBindingDetails.uid + + - service.action.kubernetesRoleDetails.kind + + - service.action.kubernetesRoleDetails.name + + - service.action.kubernetesRoleDetails.uid + + - service.action.networkConnectionAction.blocked + + - service.action.networkConnectionAction.connectionDirection + + - service.action.networkConnectionAction.localIpDetails.ipAddressV4 + + - service.action.networkConnectionAction.localIpDetails.ipAddressV6 + + - service.action.networkConnectionAction.localNetworkInterface + + - service.action.networkConnectionAction.localPortDetails.port + + - service.action.networkConnectionAction.localPortDetails.portName + + - service.action.networkConnectionAction.protocol + + - service.action.networkConnectionAction.remoteIpDetails.city.cityName + + - service.action.networkConnectionAction.remoteIpDetails.country.countryCode + + - service.action.networkConnectionAction.remoteIpDetails.country.countryName + + - service.action.networkConnectionAction.remoteIpDetails.geoLocation.lat + + - service.action.networkConnectionAction.remoteIpDetails.geoLocation.lon + + - service.action.networkConnectionAction.remoteIpDetails.ipAddressV4 + + - service.action.networkConnectionAction.remoteIpDetails.ipAddressV6 + + - service.action.networkConnectionAction.remoteIpDetails.organization.asn + + - service.action.networkConnectionAction.remoteIpDetails.organization.asnOrg + + - service.action.networkConnectionAction.remoteIpDetails.organization.isp + + - service.action.networkConnectionAction.remoteIpDetails.organization.org + + - service.action.networkConnectionAction.remotePortDetails.port + + - service.action.networkConnectionAction.remotePortDetails.portName + + - service.action.portProbeAction.blocked + + - service.action.portProbeAction.portProbeDetails.localIpDetails.ipAddressV4 + + - service.action.portProbeAction.portProbeDetails.localIpDetails.ipAddressV6 + + - service.action.portProbeAction.portProbeDetails.localPortDetails.port + + - service.action.portProbeAction.portProbeDetails.localPortDetails.portName + + - service.action.portProbeAction.portProbeDetails.remoteIpDetails.city.cityName + + - service.action.portProbeAction.portProbeDetails.remoteIpDetails.country.countryCode + + - service.action.portProbeAction.portProbeDetails.remoteIpDetails.country.countryName + + - service.action.portProbeAction.portProbeDetails.remoteIpDetails.geoLocation.lat + + - service.action.portProbeAction.portProbeDetails.remoteIpDetails.geoLocation.lon + + - service.action.portProbeAction.portProbeDetails.remoteIpDetails.ipAddressV4 + + - service.action.portProbeAction.portProbeDetails.remoteIpDetails.ipAddressV6 + + - service.action.portProbeAction.portProbeDetails.remoteIpDetails.organization.asn + + - service.action.portProbeAction.portProbeDetails.remoteIpDetails.organization.asnOrg + + - service.action.portProbeAction.portProbeDetails.remoteIpDetails.organization.isp + + - service.action.portProbeAction.portProbeDetails.remoteIpDetails.organization.org + + - service.action.rdsLoginAttemptAction.loginAttributes.application + + - service.action.rdsLoginAttemptAction.loginAttributes.failedLoginAttempts + + - service.action.rdsLoginAttemptAction.loginAttributes.successfulLoginAttempts + + - service.action.rdsLoginAttemptAction.loginAttributes.user + + - service.action.rdsLoginAttemptAction.remoteIpDetails.city.cityName + + - service.action.rdsLoginAttemptAction.remoteIpDetails.country.countryCode + + - service.action.rdsLoginAttemptAction.remoteIpDetails.country.countryName + + - service.action.rdsLoginAttemptAction.remoteIpDetails.geoLocation.lat + + - service.action.rdsLoginAttemptAction.remoteIpDetails.geoLocation.lon + + - service.action.rdsLoginAttemptAction.remoteIpDetails.ipAddressV4 + + - service.action.rdsLoginAttemptAction.remoteIpDetails.ipAddressV6 + + - service.action.rdsLoginAttemptAction.remoteIpDetails.organization.asn + + - service.action.rdsLoginAttemptAction.remoteIpDetails.organization.asnOrg + + - service.action.rdsLoginAttemptAction.remoteIpDetails.organization.isp + + - service.action.rdsLoginAttemptAction.remoteIpDetails.organization.org + + - service.additionalInfo.agentDetails.agentId + + - service.additionalInfo.agentDetails.agentVersion + + - service.additionalInfo.anomalies.anomalousAPIs + + - service.additionalInfo.authenticationMethod + + - service.additionalInfo.averagePacketSizeIn + + - service.additionalInfo.averagePacketSizeOut + + - service.additionalInfo.context + + - service.additionalInfo.domain + + - service.additionalInfo.inBytes + + - service.additionalInfo.localNetworkInterfaceOwner + + - service.additionalInfo.localPort + + - service.additionalInfo.outBytes + + - service.additionalInfo.packetsIn + + - service.additionalInfo.packetsOut + + - service.additionalInfo.policyArn + + - service.additionalInfo.policyName + + - service.additionalInfo.remotePort + + - service.additionalInfo.sample + + - service.additionalInfo.scannedPort + + - service.additionalInfo.threatFileSha256 + + - service.additionalInfo.threatListName + + - service.additionalInfo.threatName + + - service.additionalInfo.totalBytesIn + + - service.additionalInfo.totalBytesOut + + - service.additionalInfo.type + + - service.additionalInfo.unusual.asnOrg + + - service.additionalInfo.unusual.port + + - service.additionalInfo.unusualProtocol + + - service.additionalInfo.userAgent.fullUserAgent + + - service.additionalInfo.userAgent.userAgentCategory + + - service.additionalInfo.value + + - service.additionalInfo.vpcOwnerAccountId + + - service.archived + + - service.count + + - service.detection.sequence.actors.id + + - service.detection.sequence.actors.process.name + + - service.detection.sequence.actors.process.path + + - service.detection.sequence.actors.process.sha256 + + - service.detection.sequence.actors.session.createdTime + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - service.detection.sequence.actors.session.issuer + + - service.detection.sequence.actors.session.mfaStatus + + - service.detection.sequence.actors.session.uid + + - service.detection.sequence.actors.user.account.account + + - service.detection.sequence.actors.user.account.uid + + - service.detection.sequence.actors.user.credentialUid + + - service.detection.sequence.actors.user.name + + - service.detection.sequence.actors.user.type + + - service.detection.sequence.actors.user.uid + + - service.detection.sequence.additionalSequenceTypes + + - service.detection.sequence.description + + - service.detection.sequence.endpoints.autonomousSystem.name + + - service.detection.sequence.endpoints.autonomousSystem.number + + - service.detection.sequence.endpoints.connection.direction + + - service.detection.sequence.endpoints.domain + + - service.detection.sequence.endpoints.id + + - service.detection.sequence.endpoints.ip + + - service.detection.sequence.endpoints.location.city + + - service.detection.sequence.endpoints.location.country + + - service.detection.sequence.endpoints.location.lat + + - service.detection.sequence.endpoints.location.lon + + - service.detection.sequence.endpoints.port + + - service.detection.sequence.resources.accountId + + - service.detection.sequence.resources.cloudPartition + + - service.detection.sequence.resources.data.accessKey.principalId + + - service.detection.sequence.resources.data.accessKey.userName + + - service.detection.sequence.resources.data.accessKey.userType + + - service.detection.sequence.resources.data.autoscalingAutoScalingGroup.ec2InstanceUids + + - service.detection.sequence.resources.data.cloudformationStack.ec2InstanceUids + + - service.detection.sequence.resources.data.container.image + + - service.detection.sequence.resources.data.container.imageUid + + - service.detection.sequence.resources.data.ec2Image.ec2InstanceUids + + - service.detection.sequence.resources.data.ec2Instance.availabilityZone + + - service.detection.sequence.resources.data.ec2Instance.ec2NetworkInterfaceUids + + - service.detection.sequence.resources.data.ec2Instance.iamInstanceProfile.arn + + - service.detection.sequence.resources.data.ec2Instance.iamInstanceProfile.id + + - service.detection.sequence.resources.data.ec2Instance.imageDescription + + - service.detection.sequence.resources.data.ec2Instance.instanceState + + - service.detection.sequence.resources.data.ec2Instance.instanceType + + - service.detection.sequence.resources.data.ec2Instance.outpostArn + + - service.detection.sequence.resources.data.ec2Instance.platform + + - service.detection.sequence.resources.data.ec2Instance.productCodes.productCodeId + + - service.detection.sequence.resources.data.ec2Instance.productCodes.productCodeType + + - service.detection.sequence.resources.data.ec2LaunchTemplate.ec2InstanceUids + + - service.detection.sequence.resources.data.ec2LaunchTemplate.version + + - service.detection.sequence.resources.data.ec2NetworkInterface.ipv6Addresses + + - service.detection.sequence.resources.data.ec2NetworkInterface.privateIpAddresses.privateDnsName + + - service.detection.sequence.resources.data.ec2NetworkInterface.privateIpAddresses.privateIpAddress + + - service.detection.sequence.resources.data.ec2NetworkInterface.publicIp + + - service.detection.sequence.resources.data.ec2NetworkInterface.securityGroups.groupId + + - service.detection.sequence.resources.data.ec2NetworkInterface.securityGroups.groupName + + - service.detection.sequence.resources.data.ec2NetworkInterface.subNetId + + - service.detection.sequence.resources.data.ec2NetworkInterface.vpcId + + - service.detection.sequence.resources.data.ec2Vpc.ec2InstanceUids + + - service.detection.sequence.resources.data.ecsCluster.ec2InstanceUids + + - service.detection.sequence.resources.data.ecsCluster.status + + - service.detection.sequence.resources.data.ecsTask.containerUids + + - service.detection.sequence.resources.data.ecsTask.createdAt + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - service.detection.sequence.resources.data.ecsTask.launchType + + - service.detection.sequence.resources.data.ecsTask.taskDefinitionArn + + - service.detection.sequence.resources.data.eksCluster.arn + + - service.detection.sequence.resources.data.eksCluster.createdAt + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - service.detection.sequence.resources.data.eksCluster.ec2InstanceUids + + - service.detection.sequence.resources.data.eksCluster.status + + - service.detection.sequence.resources.data.eksCluster.vpcId + + - service.detection.sequence.resources.data.iamInstanceProfile.ec2InstanceUids + + - service.detection.sequence.resources.data.iamInstanceProfile.id + + - service.detection.sequence.resources.data.kubernetesWorkload.containerUids + + - service.detection.sequence.resources.data.kubernetesWorkload.namespace + + - service.detection.sequence.resources.data.kubernetesWorkload.type + + - service.detection.sequence.resources.data.s3Bucket.accountPublicAccess.publicAclAccess + + - service.detection.sequence.resources.data.s3Bucket.accountPublicAccess.publicAclIgnoreBehavior + + - service.detection.sequence.resources.data.s3Bucket.accountPublicAccess.publicBucketRestrictBehavior + + - service.detection.sequence.resources.data.s3Bucket.accountPublicAccess.publicPolicyAccess + + - service.detection.sequence.resources.data.s3Bucket.bucketPublicAccess.publicAclAccess + + - service.detection.sequence.resources.data.s3Bucket.bucketPublicAccess.publicAclIgnoreBehavior + + - service.detection.sequence.resources.data.s3Bucket.bucketPublicAccess.publicBucketRestrictBehavior + + - service.detection.sequence.resources.data.s3Bucket.bucketPublicAccess.publicPolicyAccess + + - service.detection.sequence.resources.data.s3Bucket.createdAt + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - service.detection.sequence.resources.data.s3Bucket.effectivePermission + + - service.detection.sequence.resources.data.s3Bucket.encryptionKeyArn + + - service.detection.sequence.resources.data.s3Bucket.encryptionType + + - service.detection.sequence.resources.data.s3Bucket.ownerId + + - service.detection.sequence.resources.data.s3Bucket.publicReadAccess + + - service.detection.sequence.resources.data.s3Bucket.publicWriteAccess + + - service.detection.sequence.resources.data.s3Bucket.s3ObjectUids + + - service.detection.sequence.resources.data.s3Object.eTag + + - service.detection.sequence.resources.data.s3Object.key + + - service.detection.sequence.resources.data.s3Object.versionId + + - service.detection.sequence.resources.name + + - service.detection.sequence.resources.region + + - service.detection.sequence.resources.resourceType + + - service.detection.sequence.resources.service + + - service.detection.sequence.resources.tags.key + + - service.detection.sequence.resources.tags.value + + - service.detection.sequence.resources.uid + + - service.detection.sequence.sequenceIndicators.key + + - service.detection.sequence.sequenceIndicators.title + + - service.detection.sequence.sequenceIndicators.values + + - service.detection.sequence.signals.actorIds + + - service.detection.sequence.signals.count + + - service.detection.sequence.signals.createdAt + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - service.detection.sequence.signals.description + + - service.detection.sequence.signals.endpointIds + + - service.detection.sequence.signals.firstSeenAt + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - service.detection.sequence.signals.lastSeenAt + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - service.detection.sequence.signals.name + + - service.detection.sequence.signals.resourceUids + + - service.detection.sequence.signals.severity + + - service.detection.sequence.signals.signalIndicators.key + + - service.detection.sequence.signals.signalIndicators.title + + - service.detection.sequence.signals.signalIndicators.values + + - service.detection.sequence.signals.type + + - service.detection.sequence.signals.uid + + - service.detection.sequence.signals.updatedAt + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - service.detection.sequence.uid + + - service.detectorId + + - service.ebsVolumeScanDetails.scanCompletedAt + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - service.ebsVolumeScanDetails.scanDetections.highestSeverityThreatDetails.count + + - service.ebsVolumeScanDetails.scanDetections.highestSeverityThreatDetails.severity + + - service.ebsVolumeScanDetails.scanDetections.highestSeverityThreatDetails.threatName + + - service.ebsVolumeScanDetails.scanDetections.scannedItemCount.files + + - service.ebsVolumeScanDetails.scanDetections.scannedItemCount.totalGb + + - service.ebsVolumeScanDetails.scanDetections.scannedItemCount.volumes + + - service.ebsVolumeScanDetails.scanDetections.threatDetectedByName.itemCount + + - service.ebsVolumeScanDetails.scanDetections.threatDetectedByName.shortened + + - service.ebsVolumeScanDetails.scanDetections.threatDetectedByName.threatNames.filePaths.fileName + + - service.ebsVolumeScanDetails.scanDetections.threatDetectedByName.threatNames.filePaths.filePath + + - service.ebsVolumeScanDetails.scanDetections.threatDetectedByName.threatNames.filePaths.hash + + - service.ebsVolumeScanDetails.scanDetections.threatDetectedByName.threatNames.filePaths.volumeArn + + - service.ebsVolumeScanDetails.scanDetections.threatDetectedByName.threatNames.itemCount + + - service.ebsVolumeScanDetails.scanDetections.threatDetectedByName.threatNames.name + + - service.ebsVolumeScanDetails.scanDetections.threatDetectedByName.threatNames.severity + + - service.ebsVolumeScanDetails.scanDetections.threatDetectedByName.uniqueThreatNameCount + + - service.ebsVolumeScanDetails.scanDetections.threatsDetectedItemCount.files + + - service.ebsVolumeScanDetails.scanId + + - service.ebsVolumeScanDetails.scanStartedAt + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - service.ebsVolumeScanDetails.scanType + + - service.ebsVolumeScanDetails.sources + + - service.ebsVolumeScanDetails.triggerFindingId + + - service.eventFirstSeen + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - service.eventLastSeen + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - service.evidence.threatIntelligenceDetails.threatFileSha256 + + - service.evidence.threatIntelligenceDetails.threatListName + + - service.evidence.threatIntelligenceDetails.threatNames + + - service.featureName + + - service.malwareScanDetails.scanCategory + + - service.malwareScanDetails.scanConfiguration.incrementalScanDetails.baselineResourceArn + + - service.malwareScanDetails.scanConfiguration.triggerType + + - service.malwareScanDetails.scanId + + - service.malwareScanDetails.scanType + + - service.malwareScanDetails.threats.count + + - service.malwareScanDetails.threats.hash + + - service.malwareScanDetails.threats.itemDetails.additionalInfo.deviceName + + - service.malwareScanDetails.threats.itemDetails.additionalInfo.versionId + + - service.malwareScanDetails.threats.itemDetails.hash + + - service.malwareScanDetails.threats.itemDetails.itemPath + + - service.malwareScanDetails.threats.itemDetails.resourceArn + + - service.malwareScanDetails.threats.itemPaths.hash + + - service.malwareScanDetails.threats.itemPaths.nestedItemPath + + - service.malwareScanDetails.threats.name + + - service.malwareScanDetails.threats.source + + - service.malwareScanDetails.uniqueThreatCount + + - service.resourceRole + + - service.runtimeDetails.context.addressFamily + + - service.runtimeDetails.context.commandLineExample + + - service.runtimeDetails.context.fileOperation + + - service.runtimeDetails.context.filePath + + - service.runtimeDetails.context.fileSystemType + + - service.runtimeDetails.context.flags + + - service.runtimeDetails.context.ianaProtocolNumber + + - service.runtimeDetails.context.ldPreloadValue + + - service.runtimeDetails.context.libraryPath + + - service.runtimeDetails.context.memoryRegions + + - service.runtimeDetails.context.modifiedAt + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - service.runtimeDetails.context.modifyingProcess.euid + + - service.runtimeDetails.context.modifyingProcess.executablePath + + - service.runtimeDetails.context.modifyingProcess.executableSha256 + + - service.runtimeDetails.context.modifyingProcess.lineage.euid + + - service.runtimeDetails.context.modifyingProcess.lineage.executablePath + + - service.runtimeDetails.context.modifyingProcess.lineage.name + + - service.runtimeDetails.context.modifyingProcess.lineage.namespacePid + + - service.runtimeDetails.context.modifyingProcess.lineage.parentUuid + + - service.runtimeDetails.context.modifyingProcess.lineage.pid + + - service.runtimeDetails.context.modifyingProcess.lineage.startTime + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - service.runtimeDetails.context.modifyingProcess.lineage.userId + + - service.runtimeDetails.context.modifyingProcess.lineage.uuid + + - service.runtimeDetails.context.modifyingProcess.name + + - service.runtimeDetails.context.modifyingProcess.namespacePid + + - service.runtimeDetails.context.modifyingProcess.parentUuid + + - service.runtimeDetails.context.modifyingProcess.pid + + - service.runtimeDetails.context.modifyingProcess.pwd + + - service.runtimeDetails.context.modifyingProcess.startTime + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - service.runtimeDetails.context.modifyingProcess.user + + - service.runtimeDetails.context.modifyingProcess.userId + + - service.runtimeDetails.context.modifyingProcess.uuid + + - service.runtimeDetails.context.moduleFilePath + + - service.runtimeDetails.context.moduleName + + - service.runtimeDetails.context.moduleSha256 + + - service.runtimeDetails.context.mountSource + + - service.runtimeDetails.context.mountTarget + + - service.runtimeDetails.context.relatedFilePaths + + - service.runtimeDetails.context.releaseAgentPath + + - service.runtimeDetails.context.runcBinaryPath + + - service.runtimeDetails.context.scriptPath + + - service.runtimeDetails.context.serviceName + + - service.runtimeDetails.context.shellHistoryFilePath + + - service.runtimeDetails.context.socketPath + + - service.runtimeDetails.context.targetProcess.euid + + - service.runtimeDetails.context.targetProcess.executablePath + + - service.runtimeDetails.context.targetProcess.executableSha256 + + - service.runtimeDetails.context.targetProcess.lineage.euid + + - service.runtimeDetails.context.targetProcess.lineage.executablePath + + - service.runtimeDetails.context.targetProcess.lineage.name + + - service.runtimeDetails.context.targetProcess.lineage.namespacePid + + - service.runtimeDetails.context.targetProcess.lineage.parentUuid + + - service.runtimeDetails.context.targetProcess.lineage.pid + + - service.runtimeDetails.context.targetProcess.lineage.startTime + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - service.runtimeDetails.context.targetProcess.lineage.userId + + - service.runtimeDetails.context.targetProcess.lineage.uuid + + - service.runtimeDetails.context.targetProcess.name + + - service.runtimeDetails.context.targetProcess.namespacePid + + - service.runtimeDetails.context.targetProcess.parentUuid + + - service.runtimeDetails.context.targetProcess.pid + + - service.runtimeDetails.context.targetProcess.pwd + + - service.runtimeDetails.context.targetProcess.startTime + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - service.runtimeDetails.context.targetProcess.user + + - service.runtimeDetails.context.targetProcess.userId + + - service.runtimeDetails.context.targetProcess.uuid + + - service.runtimeDetails.context.threatFilePath + + - service.runtimeDetails.context.toolCategory + + - service.runtimeDetails.context.toolName + + - service.runtimeDetails.process.euid + + - service.runtimeDetails.process.executablePath + + - service.runtimeDetails.process.executableSha256 + + - service.runtimeDetails.process.lineage.euid + + - service.runtimeDetails.process.lineage.executablePath + + - service.runtimeDetails.process.lineage.name + + - service.runtimeDetails.process.lineage.namespacePid + + - service.runtimeDetails.process.lineage.parentUuid + + - service.runtimeDetails.process.lineage.pid + + - service.runtimeDetails.process.lineage.startTime + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - service.runtimeDetails.process.lineage.userId + + - service.runtimeDetails.process.lineage.uuid + + - service.runtimeDetails.process.name + + - service.runtimeDetails.process.namespacePid + + - service.runtimeDetails.process.parentUuid + + - service.runtimeDetails.process.pid + + - service.runtimeDetails.process.pwd + + - service.runtimeDetails.process.startTime + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + + - service.runtimeDetails.process.user + + - service.runtimeDetails.process.userId + + - service.runtimeDetails.process.uuid + + - service.serviceName + + - service.userFeedback + + - severity + + To configure severity based filters, use the following for the + [FindingCriteria](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_FindingCriteria.html) + condition: + + - **Low**: `["1", "2", "3"]` + + - **Medium**: `["4", "5", "6"]` + + - **High**: `["7", "8"]` + + - **Critical**: `["9", "10"]` + + For more information, see [Findings severity + levels](https://docs.aws.amazon.com/guardduty/latest/ug/guardduty_findings-severity.html) + in the *Amazon GuardDuty User Guide*. + + - type + + - updatedAt + + Type: Timestamp in Unix Epoch millisecond format. Ex: 1486685375000 + """ + +@dataclass(kw_only=True) +class UpdateFilterOutput(_SerdeShape): + """Dataclass for UpdateFilterOutput structure.""" + + name: str | None = ... + """The name of the filter.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateFindingsFeedbackInput(_SerdeShape): + """Dataclass for UpdateFindingsFeedbackInput structure.""" + + detector_id: str | None = ... + """ + The ID of the detector that is associated with the findings for which + you want to update the feedback. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + finding_ids: list[str] | None = ... + """The IDs of the findings that you want to mark as useful or not useful.""" + feedback: str | None = ... + """The feedback for the finding.""" + comments: str | None = ... + """Additional feedback about the GuardDuty findings.""" + +@dataclass(kw_only=True) +class UpdateFindingsFeedbackOutput(_SerdeShape): + """Dataclass for UpdateFindingsFeedbackOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateIPSetInput(_SerdeShape): + """Dataclass for UpdateIPSetInput structure.""" + + detector_id: str | None = ... + """ + The detectorID that specifies the GuardDuty service whose IPSet you want + to update. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + ip_set_id: str | None = ... + """The unique ID that specifies the IPSet that you want to update.""" + name: str | None = ... + """The unique ID that specifies the IPSet that you want to update.""" + location: str | None = ... + """The updated URI of the file that contains the IPSet.""" + activate: bool | None = ... + """ + The updated Boolean value that specifies whether the IPSet is active or + not. + """ + expected_bucket_owner: str | None = ... + """ + The Amazon Web Services account ID that owns the Amazon S3 bucket + specified in the **location** parameter. + """ + +@dataclass(kw_only=True) +class UpdateIPSetOutput(_SerdeShape): + """Dataclass for UpdateIPSetOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateMalwareProtectionPlanInput(_SerdeShape): + """Dataclass for UpdateMalwareProtectionPlanInput structure.""" + + malware_protection_plan_id: str | None = ... + """A unique identifier associated with the Malware Protection plan.""" + role: str | None = ... + """ + Amazon Resource Name (ARN) of the IAM role with permissions to scan and + add tags to the associated protected resource. + """ + actions: MalwareProtectionPlanActions | None = ... + """ + Information about whether the tags will be added to the S3 object after + scanning. + """ + protected_resource: UpdateProtectedResource | None = ... + """ + Information about the protected resource that is associated with the + created Malware Protection plan. Presently, `S3Bucket` is the only + supported protected resource. + """ + +@dataclass(kw_only=True) +class UpdateMalwareProtectionPlanOutput(_SerdeShape): + """Dataclass for UpdateMalwareProtectionPlanOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateMalwareScanSettingsInput(_SerdeShape): + """Dataclass for UpdateMalwareScanSettingsInput structure.""" + + detector_id: str | None = ... + """ + The unique ID of the detector that specifies the GuardDuty service where + you want to update scan settings. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + scan_resource_criteria: ScanResourceCriteria | None = ... + """ + Represents the criteria to be used in the filter for selecting resources + to scan. + """ + ebs_snapshot_preservation: str | None = ... + """An enum value representing possible snapshot preservation settings.""" + +@dataclass(kw_only=True) +class UpdateMalwareScanSettingsOutput(_SerdeShape): + """Dataclass for UpdateMalwareScanSettingsOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateMemberDetectorsInput(_SerdeShape): + """Dataclass for UpdateMemberDetectorsInput structure.""" + + detector_id: str | None = ... + """ + The detector ID of the administrator account. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + account_ids: list[str] | None = ... + """A list of member account IDs to be updated.""" + data_sources: DataSourceConfigurations | None = ... + """Describes which data sources will be updated.""" + features: list[MemberFeaturesConfiguration] | None = ... + """ + A list of features that will be updated for the specified member + accounts. + """ + +@dataclass(kw_only=True) +class UpdateMemberDetectorsOutput(_SerdeShape): + """Dataclass for UpdateMemberDetectorsOutput structure.""" + + unprocessed_accounts: list[UnprocessedAccount] | None = ... + """ + A list of member account IDs that were unable to be processed along with + an explanation for why they were not processed. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateOrganizationConfigurationInput(_SerdeShape): + """Dataclass for UpdateOrganizationConfigurationInput structure.""" + + detector_id: str | None = ... + """ + The ID of the detector that configures the delegated administrator. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + auto_enable: bool | None = ... + """ + Represents whether to automatically enable member accounts in the + organization. This applies to only new member accounts, not the existing + member accounts. When a new account joins the organization, the chosen + features will be enabled for them by default. + + Even though this is still supported, we recommend using + `AutoEnableOrganizationMembers` to achieve the similar results. You must + provide a value for either `autoEnableOrganizationMembers` or + `autoEnable`. + """ + data_sources: OrganizationDataSourceConfigurations | None = ... + """Describes which data sources will be updated.""" + features: list[OrganizationFeatureConfiguration] | None = ... + """A list of features that will be configured for the organization.""" + auto_enable_organization_members: str | None = ... + """ + Indicates the auto-enablement configuration of GuardDuty for the member + accounts in the organization. You must provide a value for either + `autoEnableOrganizationMembers` or `autoEnable`. + + Use one of the following configuration values for + `autoEnableOrganizationMembers`: + + - `NEW`: Indicates that when a new account joins the organization, they + will have GuardDuty enabled automatically. + + - `ALL`: Indicates that all accounts in the organization have GuardDuty + enabled automatically. This includes `NEW` accounts that join the + organization and accounts that may have been suspended or removed from + the organization in GuardDuty. + + It may take up to 24 hours to update the configuration for all the + member accounts. + + - `NONE`: Indicates that GuardDuty will not be automatically enabled for + any account in the organization. The administrator must manage + GuardDuty for each account in the organization individually. + + When you update the auto-enable setting from `ALL` or `NEW` to `NONE`, + this action doesn't disable the corresponding option for your + existing accounts. This configuration will apply to the new accounts + that join the organization. After you update the auto-enable settings, + no new account will have the corresponding option as enabled. + """ + +@dataclass(kw_only=True) +class UpdateOrganizationConfigurationOutput(_SerdeShape): + """Dataclass for UpdateOrganizationConfigurationOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateProtectedResource(_SerdeShape): + """ + Information about the protected resource that is associated with the + created Malware Protection plan. Presently, `S3Bucket` is the only + supported protected resource. + """ + + s3_bucket: UpdateS3BucketResource | None = ... + """Information about the protected S3 bucket resource.""" + +@dataclass(kw_only=True) +class UpdatePublishingDestinationInput(_SerdeShape): + """Dataclass for UpdatePublishingDestinationInput structure.""" + + detector_id: str | None = ... + """ + The ID of the detector associated with the publishing destinations to + update. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + destination_id: str | None = ... + """The ID of the publishing destination to update.""" + destination_properties: DestinationProperties | None = ... + """ + A `DestinationProperties` object that includes the `DestinationArn` and + `KmsKeyArn` of the publishing destination. + """ + +@dataclass(kw_only=True) +class UpdatePublishingDestinationOutput(_SerdeShape): + """Dataclass for UpdatePublishingDestinationOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateS3BucketResource(_SerdeShape): + """Information about the protected S3 bucket resource.""" + + object_prefixes: list[str] | None = ... + """ + Information about the specified object prefixes. The S3 object will be + scanned only if it belongs to any of the specified object prefixes. + """ + +@dataclass(kw_only=True) +class UpdateThreatEntitySetInput(_SerdeShape): + """Dataclass for UpdateThreatEntitySetInput structure.""" + + detector_id: str | None = ... + """ + The unique ID of the GuardDuty detector associated with the threat + entity set that you want to update. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + threat_entity_set_id: str | None = ... + """ + The ID returned by GuardDuty after updating the threat entity set + resource. + """ + name: str | None = ... + """ + A user-friendly name to identify the trusted entity set. + + The name of your list can include lowercase letters, uppercase letters, + numbers, dash (-), and underscore (_). + """ + location: str | None = ... + """The URI of the file that contains the trusted entity set.""" + expected_bucket_owner: str | None = ... + """ + The Amazon Web Services account ID that owns the Amazon S3 bucket + specified in the **location** parameter. + """ + activate: bool | None = ... + """ + A boolean value that indicates whether GuardDuty is to start using this + updated threat entity set. After you update an entity set, you will need + to activate it again. It might take up to 15 minutes for the updated + entity set to be effective. + """ + +@dataclass(kw_only=True) +class UpdateThreatEntitySetOutput(_SerdeShape): + """Dataclass for UpdateThreatEntitySetOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateThreatIntelSetInput(_SerdeShape): + """Dataclass for UpdateThreatIntelSetInput structure.""" + + detector_id: str | None = ... + """ + The detectorID that specifies the GuardDuty service whose ThreatIntelSet + you want to update. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + threat_intel_set_id: str | None = ... + """The unique ID that specifies the ThreatIntelSet that you want to update.""" + name: str | None = ... + """The unique ID that specifies the ThreatIntelSet that you want to update.""" + location: str | None = ... + """The updated URI of the file that contains the ThreateIntelSet.""" + activate: bool | None = ... + """ + The updated Boolean value that specifies whether the ThreateIntelSet is + active or not. + """ + expected_bucket_owner: str | None = ... + """ + The Amazon Web Services account ID that owns the Amazon S3 bucket + specified in the **location** parameter. + """ + +@dataclass(kw_only=True) +class UpdateThreatIntelSetOutput(_SerdeShape): + """Dataclass for UpdateThreatIntelSetOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateTrustedEntitySetInput(_SerdeShape): + """Dataclass for UpdateTrustedEntitySetInput structure.""" + + detector_id: str | None = ... + """ + The unique ID of the GuardDuty detector associated with the threat + entity set that you want to update. + + To find the `detectorId` in the current Region, see the Settings page in + the GuardDuty console, or run the + [ListDetectors](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListDetectors.html) + API. + """ + trusted_entity_set_id: str | None = ... + """ + The ID returned by GuardDuty after updating the trusted entity set + resource. + """ + name: str | None = ... + """ + A user-friendly name to identify the trusted entity set. + + The name of your list can include lowercase letters, uppercase letters, + numbers, dash (-), and underscore (_). + """ + location: str | None = ... + """The URI of the file that contains the trusted entity set.""" + expected_bucket_owner: str | None = ... + """ + The Amazon Web Services account ID that owns the Amazon S3 bucket + specified in the **location** parameter. + """ + activate: bool | None = ... + """ + A boolean value that indicates whether GuardDuty is to start using this + updated trusted entity set. After you update an entity set, you will + need to activate it again. It might take up to 15 minutes for the + updated entity set to be effective. + """ + +@dataclass(kw_only=True) +class UpdateTrustedEntitySetOutput(_SerdeShape): + """Dataclass for UpdateTrustedEntitySetOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UsageAccountResult(_SerdeShape): + """Contains information on the total of usage based on account IDs.""" + + account_id: str | None = ... + """The Account ID that generated usage.""" + total: Total | None = ... + """Represents the total of usage for the Account ID.""" + +@dataclass(kw_only=True) +class UsageCriteria(_SerdeShape): + """Contains information about the criteria used to query usage statistics.""" + + account_ids: list[str] | None = ... + """The account IDs to aggregate usage statistics from.""" + data_sources: list[str] | None = ... + """The data sources to aggregate usage statistics from.""" + resources: list[str] | None = ... + """ + The resources to aggregate usage statistics from. Only accepts exact + resource names. + """ + features: list[str] | None = ... + """The features to aggregate usage statistics from.""" + +@dataclass(kw_only=True) +class UsageDataSourceResult(_SerdeShape): + """Contains information on the result of usage based on data source type.""" + + data_source: str | None = ... + """The data source type that generated usage.""" + total: Total | None = ... + """Represents the total of usage for the specified data source.""" + +class UsageFeature(UnknownEnumMixin, StrEnum): + FLOW_LOGS = "FLOW_LOGS" + CLOUD_TRAIL = "CLOUD_TRAIL" + DNS_LOGS = "DNS_LOGS" + S3_DATA_EVENTS = "S3_DATA_EVENTS" + EKS_AUDIT_LOGS = "EKS_AUDIT_LOGS" + EBS_MALWARE_PROTECTION = "EBS_MALWARE_PROTECTION" + RDS_LOGIN_EVENTS = "RDS_LOGIN_EVENTS" + LAMBDA_NETWORK_LOGS = "LAMBDA_NETWORK_LOGS" + EKS_RUNTIME_MONITORING = "EKS_RUNTIME_MONITORING" + EC2_RUNTIME_MONITORING = "EC2_RUNTIME_MONITORING" + FARGATE_RUNTIME_MONITORING = "FARGATE_RUNTIME_MONITORING" + RDS_DBI_PROTECTION_PROVISIONED = "RDS_DBI_PROTECTION_PROVISIONED" + RDS_DBI_PROTECTION_SERVERLESS = "RDS_DBI_PROTECTION_SERVERLESS" + AI_PROTECTION = "AI_PROTECTION" + +@dataclass(kw_only=True) +class UsageFeatureResult(_SerdeShape): + """ + Contains information about the result of the total usage based on the + feature. + """ + + feature: str | None = ... + """The feature that generated the usage cost.""" + total: Total | None = ... + """ + Contains the total usage with the corresponding currency unit for that + value. + """ + +@dataclass(kw_only=True) +class UsageResourceResult(_SerdeShape): + """ + Contains information on the sum of usage based on an Amazon Web Services + resource. + """ + + resource: str | None = ... + """The Amazon Web Services resource that generated usage.""" + total: Total | None = ... + """Represents the sum total of usage for the specified resource type.""" + +@dataclass(kw_only=True) +class UsageStatistics(_SerdeShape): + """ + Contains the result of GuardDuty usage. If a UsageStatisticType is + provided the result for other types will be null. + """ + + sum_by_account: list[UsageAccountResult] | None = ... + """The usage statistic sum organized by account ID.""" + top_accounts_by_feature: list[UsageTopAccountsResult] | None = ... + """ + Lists the top 50 accounts by feature that have generated the most + GuardDuty usage, in the order from most to least expensive. + + Currently, this doesn't support `RDS_LOGIN_EVENTS`. + """ + sum_by_data_source: list[UsageDataSourceResult] | None = ... + """The usage statistic sum organized by on data source.""" + sum_by_resource: list[UsageResourceResult] | None = ... + """The usage statistic sum organized by resource.""" + top_resources: list[UsageResourceResult] | None = ... + """ + Lists the top 50 resources that have generated the most GuardDuty usage, + in order from most to least expensive. + """ + sum_by_feature: list[UsageFeatureResult] | None = ... + """The usage statistic sum organized by feature.""" + +class UsageStatisticType(UnknownEnumMixin, StrEnum): + SUM_BY_ACCOUNT = "SUM_BY_ACCOUNT" + SUM_BY_DATA_SOURCE = "SUM_BY_DATA_SOURCE" + SUM_BY_RESOURCE = "SUM_BY_RESOURCE" + TOP_RESOURCES = "TOP_RESOURCES" + SUM_BY_FEATURES = "SUM_BY_FEATURES" + TOP_ACCOUNTS_BY_FEATURE = "TOP_ACCOUNTS_BY_FEATURE" + +@dataclass(kw_only=True) +class UsageTopAccountResult(_SerdeShape): + """ + Contains information on the total of usage based on the topmost 50 + account IDs. + """ + + account_id: str | None = ... + """The unique account ID.""" + total: Total | None = ... + """ + Contains the total usage with the corresponding currency unit for that + value. + """ + +@dataclass(kw_only=True) +class UsageTopAccountsResult(_SerdeShape): + """ + Information about the usage statistics, calculated by top accounts by + feature. + """ + + feature: str | None = ... + """ + Features by which you can generate the usage statistics. + + `RDS_LOGIN_EVENTS` is currently not supported with + `topAccountsByFeature`. + """ + accounts: list[UsageTopAccountResult] | None = ... + """The accounts that contributed to the total usage cost.""" + +@dataclass(kw_only=True) +class User(_SerdeShape): + """Contains information about the user involved in the attack sequence.""" + + name: str | None = ... + """The name of the user.""" + uid: str | None = ... + """The unique identifier of the user.""" + type: str | None = ... + """The type of the user.""" + credential_uid: str | None = ... + """The credentials of the user ID.""" + account: Account | None = ... + """ + Contains information about the Amazon Web Services account within which + the activity took place. This is not necessarily the account that owns + the user identity. + """ + +@dataclass(kw_only=True) +class Volume(_SerdeShape): + """Volume used by the Kubernetes workload.""" + + name: str | None = ... + """Volume name.""" + host_path: HostPath | None = ... + """ + Represents a pre-existing file or directory on the host machine that the + volume maps to. + """ + +@dataclass(kw_only=True) +class VolumeDetail(_SerdeShape): + """Contains EBS volume details.""" + + volume_arn: str | None = ... + """EBS volume ARN information.""" + volume_type: str | None = ... + """The EBS volume type.""" + device_name: str | None = ... + """The device name for the EBS volume.""" + volume_size_in_gb: int | None = ... + """EBS volume size in GB.""" + encryption_type: str | None = ... + """EBS volume encryption type.""" + snapshot_arn: str | None = ... + """Snapshot ARN of the EBS volume.""" + kms_key_arn: str | None = ... + """KMS key ARN used to encrypt the EBS volume.""" + +@dataclass(kw_only=True) +class VolumeMount(_SerdeShape): + """Container volume mount.""" + + name: str | None = ... + """Volume mount name.""" + mount_path: str | None = ... + """Volume mount path.""" + +@dataclass(kw_only=True) +class VpcConfig(_SerdeShape): + """ + Amazon Virtual Private Cloud configuration details associated with your + Lambda function. + """ + + subnet_ids: list[str] | None = ... + """ + The identifiers of the subnets that are associated with your Lambda + function. + """ + vpc_id: str | None = ... + """The identifier of the Amazon Virtual Private Cloud.""" + security_groups: list[SecurityGroup] | None = ... + """The identifier of the security group attached to the Lambda function.""" + +ACCEPT_ADMINISTRATOR_INVITATION: APIOperation[ + AcceptAdministratorInvitationInput, AcceptAdministratorInvitationOutput +] +ACCEPT_INVITATION: APIOperation[AcceptInvitationInput, AcceptInvitationOutput] +ARCHIVE_FINDINGS: APIOperation[ArchiveFindingsInput, ArchiveFindingsOutput] +CREATE_CUSTOM_DETECTION_RULE_ASSOCIATION: APIOperation[ + CreateCustomDetectionRuleAssociationInput, + CreateCustomDetectionRuleAssociationOutput, +] +CREATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION: APIOperation[ + CreateCustomDetectionRuleOrgConfigurationInput, + CreateCustomDetectionRuleOrgConfigurationOutput, +] +CREATE_DETECTOR: APIOperation[CreateDetectorInput, CreateDetectorOutput] +CREATE_FILTER: APIOperation[CreateFilterInput, CreateFilterOutput] +CREATE_INVESTIGATION: APIOperation[CreateInvestigationInput, CreateInvestigationOutput] +CREATE_IP_SET: APIOperation[CreateIPSetInput, CreateIPSetOutput] +CREATE_MALWARE_PROTECTION_PLAN: APIOperation[ + CreateMalwareProtectionPlanInput, CreateMalwareProtectionPlanOutput +] +CREATE_MEMBERS: APIOperation[CreateMembersInput, CreateMembersOutput] +CREATE_PUBLISHING_DESTINATION: APIOperation[ + CreatePublishingDestinationInput, CreatePublishingDestinationOutput +] +CREATE_SAMPLE_FINDINGS: APIOperation[ + CreateSampleFindingsInput, CreateSampleFindingsOutput +] +CREATE_THREAT_ENTITY_SET: APIOperation[ + CreateThreatEntitySetInput, CreateThreatEntitySetOutput +] +CREATE_THREAT_INTEL_SET: APIOperation[ + CreateThreatIntelSetInput, CreateThreatIntelSetOutput +] +CREATE_TRUSTED_ENTITY_SET: APIOperation[ + CreateTrustedEntitySetInput, CreateTrustedEntitySetOutput +] +DECLINE_INVITATIONS: APIOperation[DeclineInvitationsInput, DeclineInvitationsOutput] +DELETE_CUSTOM_DETECTION_RULE_ASSOCIATION: APIOperation[ + DeleteCustomDetectionRuleAssociationInput, + DeleteCustomDetectionRuleAssociationOutput, +] +DELETE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION: APIOperation[ + DeleteCustomDetectionRuleOrgConfigurationInput, + DeleteCustomDetectionRuleOrgConfigurationOutput, +] +DELETE_DETECTOR: APIOperation[DeleteDetectorInput, DeleteDetectorOutput] +DELETE_FILTER: APIOperation[DeleteFilterInput, DeleteFilterOutput] +DELETE_INVITATIONS: APIOperation[DeleteInvitationsInput, DeleteInvitationsOutput] +DELETE_IP_SET: APIOperation[DeleteIPSetInput, DeleteIPSetOutput] +DELETE_MALWARE_PROTECTION_PLAN: APIOperation[ + DeleteMalwareProtectionPlanInput, DeleteMalwareProtectionPlanOutput +] +DELETE_MEMBERS: APIOperation[DeleteMembersInput, DeleteMembersOutput] +DELETE_PUBLISHING_DESTINATION: APIOperation[ + DeletePublishingDestinationInput, DeletePublishingDestinationOutput +] +DELETE_THREAT_ENTITY_SET: APIOperation[ + DeleteThreatEntitySetInput, DeleteThreatEntitySetOutput +] +DELETE_THREAT_INTEL_SET: APIOperation[ + DeleteThreatIntelSetInput, DeleteThreatIntelSetOutput +] +DELETE_TRUSTED_ENTITY_SET: APIOperation[ + DeleteTrustedEntitySetInput, DeleteTrustedEntitySetOutput +] +DESCRIBE_MALWARE_SCANS: APIOperation[ + DescribeMalwareScansInput, DescribeMalwareScansOutput +] +DESCRIBE_ORGANIZATION_CONFIGURATION: APIOperation[ + DescribeOrganizationConfigurationInput, DescribeOrganizationConfigurationOutput +] +DESCRIBE_PUBLISHING_DESTINATION: APIOperation[ + DescribePublishingDestinationInput, DescribePublishingDestinationOutput +] +DISABLE_ORGANIZATION_ADMIN_ACCOUNT: APIOperation[ + DisableOrganizationAdminAccountInput, DisableOrganizationAdminAccountOutput +] +DISASSOCIATE_FROM_ADMINISTRATOR_ACCOUNT: APIOperation[ + DisassociateFromAdministratorAccountInput, + DisassociateFromAdministratorAccountOutput, +] +DISASSOCIATE_FROM_MASTER_ACCOUNT: APIOperation[ + DisassociateFromMasterAccountInput, DisassociateFromMasterAccountOutput +] +DISASSOCIATE_MEMBERS: APIOperation[DisassociateMembersInput, DisassociateMembersOutput] +ENABLE_ORGANIZATION_ADMIN_ACCOUNT: APIOperation[ + EnableOrganizationAdminAccountInput, EnableOrganizationAdminAccountOutput +] +GET_ADMINISTRATOR_ACCOUNT: APIOperation[ + GetAdministratorAccountInput, GetAdministratorAccountOutput +] +GET_COVERAGE_STATISTICS: APIOperation[ + GetCoverageStatisticsInput, GetCoverageStatisticsOutput +] +GET_CUSTOM_DETECTION_RULE: APIOperation[ + GetCustomDetectionRuleInput, GetCustomDetectionRuleOutput +] +GET_CUSTOM_DETECTION_RULE_ASSOCIATION: APIOperation[ + GetCustomDetectionRuleAssociationInput, GetCustomDetectionRuleAssociationOutput +] +GET_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION: APIOperation[ + GetCustomDetectionRuleOrgConfigurationInput, + GetCustomDetectionRuleOrgConfigurationOutput, +] +GET_DETECTOR: APIOperation[GetDetectorInput, GetDetectorOutput] +GET_FILTER: APIOperation[GetFilterInput, GetFilterOutput] +GET_FINDINGS: APIOperation[GetFindingsInput, GetFindingsOutput] +GET_FINDINGS_STATISTICS: APIOperation[ + GetFindingsStatisticsInput, GetFindingsStatisticsOutput +] +GET_INVESTIGATION: APIOperation[GetInvestigationInput, GetInvestigationOutput] +GET_INVITATIONS_COUNT: APIOperation[GetInvitationsCountInput, GetInvitationsCountOutput] +GET_IP_SET: APIOperation[GetIPSetInput, GetIPSetOutput] +GET_MALWARE_PROTECTION_PLAN: APIOperation[ + GetMalwareProtectionPlanInput, GetMalwareProtectionPlanOutput +] +GET_MALWARE_SCAN: APIOperation[GetMalwareScanInput, GetMalwareScanOutput] +GET_MALWARE_SCAN_SETTINGS: APIOperation[ + GetMalwareScanSettingsInput, GetMalwareScanSettingsOutput +] +GET_MASTER_ACCOUNT: APIOperation[GetMasterAccountInput, GetMasterAccountOutput] +GET_MEMBER_DETECTORS: APIOperation[GetMemberDetectorsInput, GetMemberDetectorsOutput] +GET_MEMBERS: APIOperation[GetMembersInput, GetMembersOutput] +GET_ORGANIZATION_STATISTICS: APIOperation[ + GetOrganizationStatisticsInput, GetOrganizationStatisticsOutput +] +GET_REMAINING_FREE_TRIAL_DAYS: APIOperation[ + GetRemainingFreeTrialDaysInput, GetRemainingFreeTrialDaysOutput +] +GET_THREAT_ENTITY_SET: APIOperation[GetThreatEntitySetInput, GetThreatEntitySetOutput] +GET_THREAT_INTEL_SET: APIOperation[GetThreatIntelSetInput, GetThreatIntelSetOutput] +GET_TRUSTED_ENTITY_SET: APIOperation[ + GetTrustedEntitySetInput, GetTrustedEntitySetOutput +] +GET_USAGE_STATISTICS: APIOperation[GetUsageStatisticsInput, GetUsageStatisticsOutput] +INVITE_MEMBERS: APIOperation[InviteMembersInput, InviteMembersOutput] +LIST_COVERAGE: APIOperation[ListCoverageInput, ListCoverageOutput] +LIST_CUSTOM_DETECTION_RULE_ASSOCIATIONS: APIOperation[ + ListCustomDetectionRuleAssociationsInput, ListCustomDetectionRuleAssociationsOutput +] +LIST_CUSTOM_DETECTION_RULE_ORG_CONFIGURATIONS: APIOperation[ + ListCustomDetectionRuleOrgConfigurationsInput, + ListCustomDetectionRuleOrgConfigurationsOutput, +] +LIST_CUSTOM_DETECTION_RULES: APIOperation[ + ListCustomDetectionRulesInput, ListCustomDetectionRulesOutput +] +LIST_DETECTORS: APIOperation[ListDetectorsInput, ListDetectorsOutput] +LIST_FILTERS: APIOperation[ListFiltersInput, ListFiltersOutput] +LIST_FINDINGS: APIOperation[ListFindingsInput, ListFindingsOutput] +LIST_INVESTIGATIONS: APIOperation[ListInvestigationsInput, ListInvestigationsOutput] +LIST_INVITATIONS: APIOperation[ListInvitationsInput, ListInvitationsOutput] +LIST_IP_SETS: APIOperation[ListIPSetsInput, ListIPSetsOutput] +LIST_MALWARE_PROTECTION_PLANS: APIOperation[ + ListMalwareProtectionPlansInput, ListMalwareProtectionPlansOutput +] +LIST_MALWARE_SCANS: APIOperation[ListMalwareScansInput, ListMalwareScansOutput] +LIST_MEMBERS: APIOperation[ListMembersInput, ListMembersOutput] +LIST_ORGANIZATION_ADMIN_ACCOUNTS: APIOperation[ + ListOrganizationAdminAccountsInput, ListOrganizationAdminAccountsOutput +] +LIST_PUBLISHING_DESTINATIONS: APIOperation[ + ListPublishingDestinationsInput, ListPublishingDestinationsOutput +] +LIST_TAGS_FOR_RESOURCE: APIOperation[ + ListTagsForResourceInput, ListTagsForResourceOutput +] +LIST_THREAT_ENTITY_SETS: APIOperation[ + ListThreatEntitySetsInput, ListThreatEntitySetsOutput +] +LIST_THREAT_INTEL_SETS: APIOperation[ + ListThreatIntelSetsInput, ListThreatIntelSetsOutput +] +LIST_TRUSTED_ENTITY_SETS: APIOperation[ + ListTrustedEntitySetsInput, ListTrustedEntitySetsOutput +] +SEND_OBJECT_MALWARE_SCAN: APIOperation[ + SendObjectMalwareScanInput, SendObjectMalwareScanOutput +] +START_MALWARE_SCAN: APIOperation[StartMalwareScanInput, StartMalwareScanOutput] +START_MONITORING_MEMBERS: APIOperation[ + StartMonitoringMembersInput, StartMonitoringMembersOutput +] +STOP_MONITORING_MEMBERS: APIOperation[ + StopMonitoringMembersInput, StopMonitoringMembersOutput +] +TAG_RESOURCE: APIOperation[TagResourceInput, TagResourceOutput] +UNARCHIVE_FINDINGS: APIOperation[UnarchiveFindingsInput, UnarchiveFindingsOutput] +UNTAG_RESOURCE: APIOperation[UntagResourceInput, UntagResourceOutput] +UPDATE_CUSTOM_DETECTION_RULE_ASSOCIATION: APIOperation[ + UpdateCustomDetectionRuleAssociationInput, + UpdateCustomDetectionRuleAssociationOutput, +] +UPDATE_CUSTOM_DETECTION_RULE_ORG_CONFIGURATION: APIOperation[ + UpdateCustomDetectionRuleOrgConfigurationInput, + UpdateCustomDetectionRuleOrgConfigurationOutput, +] +UPDATE_DETECTOR: APIOperation[UpdateDetectorInput, UpdateDetectorOutput] +UPDATE_FILTER: APIOperation[UpdateFilterInput, UpdateFilterOutput] +UPDATE_FINDINGS_FEEDBACK: APIOperation[ + UpdateFindingsFeedbackInput, UpdateFindingsFeedbackOutput +] +UPDATE_IP_SET: APIOperation[UpdateIPSetInput, UpdateIPSetOutput] +UPDATE_MALWARE_PROTECTION_PLAN: APIOperation[ + UpdateMalwareProtectionPlanInput, UpdateMalwareProtectionPlanOutput +] +UPDATE_MALWARE_SCAN_SETTINGS: APIOperation[ + UpdateMalwareScanSettingsInput, UpdateMalwareScanSettingsOutput +] +UPDATE_MEMBER_DETECTORS: APIOperation[ + UpdateMemberDetectorsInput, UpdateMemberDetectorsOutput +] +UPDATE_ORGANIZATION_CONFIGURATION: APIOperation[ + UpdateOrganizationConfigurationInput, UpdateOrganizationConfigurationOutput +] +UPDATE_PUBLISHING_DESTINATION: APIOperation[ + UpdatePublishingDestinationInput, UpdatePublishingDestinationOutput +] +UPDATE_THREAT_ENTITY_SET: APIOperation[ + UpdateThreatEntitySetInput, UpdateThreatEntitySetOutput +] +UPDATE_THREAT_INTEL_SET: APIOperation[ + UpdateThreatIntelSetInput, UpdateThreatIntelSetOutput +] +UPDATE_TRUSTED_ENTITY_SET: APIOperation[ + UpdateTrustedEntitySetInput, UpdateTrustedEntitySetOutput +] diff --git a/clients/aws-sdk-lambda/scripts/docs/generate_doc_stubs.py b/clients/aws-sdk-lambda/scripts/docs/generate_doc_stubs.py index 52d470bc..795f2e4b 100644 --- a/clients/aws-sdk-lambda/scripts/docs/generate_doc_stubs.py +++ b/clients/aws-sdk-lambda/scripts/docs/generate_doc_stubs.py @@ -126,7 +126,9 @@ class ClientInfo: class DocStubGenerator: """Generate markdown API Reference stubs for AWS SDK for Python v4 clients.""" - def __init__(self, client_dir: Path, output_dir: Path, service_name: str | None = None) -> None: + def __init__( + self, client_dir: Path, output_dir: Path, service_name: str | None = None + ) -> None: """ Initialize the documentation generator. @@ -190,7 +192,9 @@ def _analyze_client_package(self, package_name: str) -> ClientInfo: required = ("client", "config", "models") missing = [name for name in required if not package.modules.get(name)] if missing: - raise ValueError(f"Missing required modules in {package_name}: {', '.join(missing)}") + raise ValueError( + f"Missing required modules in {package_name}: {', '.join(missing)}" + ) # Parse submodules client_module = package.modules["client"] @@ -199,11 +203,15 @@ def _analyze_client_package(self, package_name: str) -> ClientInfo: client_class = self._find_class_with_suffix(client_module, "Client") if not client_class: - raise ValueError(f"No class ending with 'Client' found in {package_name}.client") + raise ValueError( + f"No class ending with 'Client' found in {package_name}.client" + ) config_class = self._find_class_with_suffix(config_module, "Config") if not config_class: - raise ValueError(f"No class ending with 'Config' found in {package_name}.config") + raise ValueError( + f"No class ending with 'Config' found in {package_name}.config" + ) plugin_alias = config_module.members.get("Plugin") if not plugin_alias: @@ -288,7 +296,9 @@ def _analyze_operation(self, operation: Function) -> OperationInfo: if output_type in stream_type_map: stream_type = stream_type_map[output_type] - stream_args = self._get_subscript_elements(returns, f"'{operation.name}' stream type") + stream_args = self._get_subscript_elements( + returns, f"'{operation.name}' stream type" + ) if stream_type in (StreamType.INPUT, StreamType.DUPLEX): event_input_type = stream_args[0].canonical_name @@ -316,7 +326,9 @@ def _analyze_operation(self, operation: Function) -> OperationInfo: def _get_expr(self, annotation: str | Expr | None, context: str) -> Expr: """Extract and validate an Expr from an annotation.""" if not isinstance(annotation, Expr): - raise TypeError(f"{context}: expected Expr, got {type(annotation).__name__}") + raise TypeError( + f"{context}: expected Expr, got {type(annotation).__name__}" + ) return annotation def _get_subscript_elements(self, expr: Expr, context: str) -> list[Expr]: @@ -330,7 +342,9 @@ def _get_subscript_elements(self, expr: Expr, context: str) -> list[Expr]: return [el for el in slice_expr.elements if isinstance(el, Expr)] return [slice_expr] - def _extract_models(self, models_module: Module, operations: list[OperationInfo]) -> ModelsInfo: + def _extract_models( + self, models_module: Module, operations: list[OperationInfo] + ) -> ModelsInfo: """Extract structures, unions, enums, and errors from models module.""" structures, unions, enums, errors = [], [], [], [] @@ -356,14 +370,16 @@ def _extract_models(self, models_module: Module, operations: list[OperationInfo] duplicates = [] for structure in structures: - if self._is_operation_io_type(structure.name, operations) or self._is_union_member( - structure.name, unions - ): + if self._is_operation_io_type( + structure.name, operations + ) or self._is_union_member(structure.name, unions): duplicates.append(structure) structures = [struct for struct in structures if struct not in duplicates] - return ModelsInfo(structures=structures, unions=unions, enums=enums, errors=errors) + return ModelsInfo( + structures=structures, unions=unions, enums=enums, errors=errors + ) def _is_union(self, member: Object | Alias) -> TypeGuard[Attribute]: """Check if a module member is a union type.""" @@ -399,7 +415,9 @@ def _extract_union_members( for name in member_names: if not (member_object := models_module.members.get(name)): raise ValueError(f"Union member '{name}' not found in models module") - members.append(TypeInfo(name=member_object.name, module_path=member_object.path)) + members.append( + TypeInfo(name=member_object.name, module_path=member_object.path) + ) return members @@ -408,7 +426,8 @@ def _is_enum(self, member: Object | Alias) -> TypeGuard[Class]: if not isinstance(member, Class): return False return any( - isinstance(base, ExprName) and base.name in ENUM_BASE_CLASSES for base in member.bases + isinstance(base, ExprName) and base.name in ENUM_BASE_CLASSES + for base in member.bases ) def _is_error(self, member: Object | Alias) -> TypeGuard[Class]: @@ -416,10 +435,13 @@ def _is_error(self, member: Object | Alias) -> TypeGuard[Class]: if not isinstance(member, Class): return False return any( - isinstance(base, ExprName) and base.name in ERROR_BASE_CLASSES for base in member.bases + isinstance(base, ExprName) and base.name in ERROR_BASE_CLASSES + for base in member.bases ) - def _is_operation_io_type(self, type_name: str, operations: list[OperationInfo]) -> bool: + def _is_operation_io_type( + self, type_name: str, operations: list[OperationInfo] + ) -> bool: """Check if a type is used as operation input/output.""" return any(type_name in (op.input.name, op.output.name) for op in operations) @@ -437,8 +459,12 @@ def _generate_client_docs(self, client_info: ClientInfo) -> bool: self._generate_type_stubs( client_info.models.structures, "structures", "Structure Class" ) - self._generate_type_stubs(client_info.models.errors, "errors", "Error Class") - self._generate_type_stubs(client_info.models.enums, "enums", "Enum Class", members=True) + self._generate_type_stubs( + client_info.models.errors, "errors", "Error Class" + ) + self._generate_type_stubs( + client_info.models.enums, "enums", "Enum Class", members=True + ) self._generate_union_stubs(client_info.models.unions) except OSError as e: logger.error(f"Failed to write documentation files: {e}") @@ -470,7 +496,9 @@ def _generate_index(self, client_info: ClientInfo) -> None: ] for method in sorted(client_info.client_methods, key=lambda x: x.name): - lines.extend([*self._mkdocs_directive(method.module_path, heading_level=4), ""]) + lines.extend( + [*self._mkdocs_directive(method.module_path, heading_level=4), ""] + ) # Operations section if client_info.operations: @@ -578,7 +606,9 @@ def _generate_operation_stubs(self, operations: list[OperationInfo]) -> None: output_path = self.output_dir / "operations" / f"{op.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb("Operations", op.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb("Operations", op.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(operations)} operation file(s)") @@ -600,7 +630,9 @@ def _generate_type_stubs( output_path = self.output_dir / category / f"{item.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb(category.title(), item.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb(category.title(), item.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(items)} {category} file(s)") @@ -624,7 +656,9 @@ def _generate_union_stubs(self, unions: list[UnionInfo]) -> None: output_path = self.output_dir / "unions" / f"{union.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb("Unions", union.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb("Unions", union.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(unions)} union file(s)") diff --git a/clients/aws-sdk-lambda/src/aws_sdk_lambda/_private/schemas.py b/clients/aws-sdk-lambda/src/aws_sdk_lambda/_private/schemas.py index e7653b6a..c2e63437 100644 --- a/clients/aws-sdk-lambda/src/aws_sdk_lambda/_private/schemas.py +++ b/clients/aws-sdk-lambda/src/aws_sdk_lambda/_private/schemas.py @@ -2,9363 +2,9679 @@ from types import MappingProxyType -from smithy_core.prelude import UNIT -from smithy_core.schemas import Schema -from smithy_core.shapes import ShapeID, ShapeType -from smithy_core.traits import Trait - - -LONG = Schema( - id=ShapeID("com.amazonaws.lambda#Long"), - shape_type=ShapeType.LONG, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=0)], -) - -INTEGER = Schema( - id=ShapeID("com.amazonaws.lambda#Integer"), - shape_type=ShapeType.INTEGER, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=0)], -) - -UNRESERVED_CONCURRENT_EXECUTIONS = Schema( - id=ShapeID("com.amazonaws.lambda#UnreservedConcurrentExecutions"), - shape_type=ShapeType.INTEGER, -) - -ACCOUNT_LIMIT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#AccountLimit"), - members={ - "TotalCodeSize": { - "target": LONG, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "CodeSizeUnzipped": { - "target": LONG, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "CodeSizeZipped": { - "target": LONG, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "ConcurrentExecutions": { - "target": INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "UnreservedConcurrentExecutions": {"target": UNRESERVED_CONCURRENT_EXECUTIONS}, - }, +from smithy_core._schema_compact import StaticOperationSchema, StaticSchema + + +n0 = "com.amazonaws.lambda" +_L = "Long" +_s = "smithy.api#default" +_I = "Integer" +_UCE = "UnreservedConcurrentExecutions" +_AL = "AccountLimit" +_TCS = "TotalCodeSize" +_CSU = "CodeSizeUnzipped" +_CSZ = "CodeSizeZipped" +_CE = "ConcurrentExecutions" +_AU = "AccountUsage" +_FC = "FunctionCount" +_A = "Action" +_AV = "AdditionalVersion" +_W = "Weight" +_AVW = "AdditionalVersionWeights" +_k = "key" +_v = "value" +_LPAA = "LayerPermissionAllowedAction" +_LN = "LayerName" +_OI = "OrganizationId" +_LPAP = "LayerPermissionAllowedPrincipal" +_S = "String" +_SI = "StatementId" +_LVN = "LayerVersionNumber" +_ALVPI = "AddLayerVersionPermissionInput" +_sSI = "smithy.synthetic#originalShapeId" +_cALVPR = "com.amazonaws.lambda#AddLayerVersionPermissionRequest" +_sm = "smithy.api#input" +_smi = "smithy.api#required" +_sL = "smithy.api#httpLabel" +_VN = "VersionNumber" +_P = "Principal" +_RI = "RevisionId" +_sQ = "smithy.api#httpQuery" +_ALVPO = "AddLayerVersionPermissionOutput" +_cALVPRo = "com.amazonaws.lambda#AddLayerVersionPermissionResponse" +_smit = "smithy.api#output" +_St = "Statement" +_IPVE = "InvalidParameterValueException" +_smith = "smithy.api#error" +_c = "client" +_sE = "smithy.api#httpError" +_T = "Type" +_m = "message" +_PLEE = "PolicyLengthExceededException" +_PFE = "PreconditionFailedException" +_RCE = "ResourceConflictException" +_RNFE = "ResourceNotFoundException" +_M = "Message" +_SE = "ServiceException" +_se = "server" +_TR = "ThrottleReason" +_CILE = "ConcurrentInvocationLimitExceeded" +_sV = "smithy.api#enumValue" +_FIRLE = "FunctionInvocationRateLimitExceeded" +_RFCILE = "ReservedFunctionConcurrentInvocationLimitExceeded" +_RFIRLE = "ReservedFunctionInvocationRateLimitExceeded" +_CRLE = "CallerRateLimitExceeded" +_CSCLE = "ConcurrentSnapshotCreateLimitExceeded" +_TMRE = "TooManyRequestsException" +_rAS = "retryAfterSeconds" +_sH = "smithy.api#httpHeader" +_RA = "Retry-After" +_R = "Reason" +_ALVP = "AddLayerVersionPermission" +_smithy = "smithy.api#http" +_EST = "EventSourceToken" +_NFN = "NamespacedFunctionName" +_FUAT = "FunctionUrlAuthType" +_NONE = "NONE" +_AI = "AWS_IAM" +_IVFU = "InvokedViaFunctionUrl" +_POID = "PrincipalOrgID" +_NLPOAQ = "NumericLatestPublishedOrAliasQualifier" +_SO = "SourceOwner" +_Ar = "Arn" +_API = "AddPermissionInput" +_cAPR = "com.amazonaws.lambda#AddPermissionRequest" +_FN = "FunctionName" +_SA = "SourceArn" +_SAo = "SourceAccount" +_Q = "Qualifier" +_APO = "AddPermissionOutput" +_cAPRo = "com.amazonaws.lambda#AddPermissionResponse" +_PPE = "PublicPolicyException" +_AP = "AddPermission" +_Al = "Alias" +_FA = "FunctionArn" +_D = "Description" +_V = "Version" +_ARC = "AliasRoutingConfiguration" +_AC = "AliasConfiguration" +_AA = "AliasArn" +_N = "Name" +_FV = "FunctionVersion" +_RC = "RoutingConfig" +_ALEE = "AliasLimitExceededException" +_ALl = "AliasList" +_me = "member" +_ACl = "AllowCredentials" +_SPVA = "SigningProfileVersionArns" +_APl = "AllowedPublishers" +_Me = "Method" +_AML = "AllowMethodsList" +_O = "Origin" +_AOL = "AllowOriginsList" +_URI = "URI" +_KSRAT = "KafkaSchemaRegistryAuthType" +_BA = "BASIC_AUTH" +_CCTA = "CLIENT_CERTIFICATE_TLS_AUTH" +_SRCC = "SERVER_ROOT_CA_CERTIFICATE" +_KSRAC = "KafkaSchemaRegistryAccessConfig" +_KSRACL = "KafkaSchemaRegistryAccessConfigList" +_SRERF = "SchemaRegistryEventRecordFormat" +_JSON = "JSON" +_SOURCE = "SOURCE" +_SRU = "SchemaRegistryUri" +_KSVA = "KafkaSchemaValidationAttribute" +_KEY = "KEY" +_VALUE = "VALUE" +_KSVC = "KafkaSchemaValidationConfig" +_At = "Attribute" +_KSVCL = "KafkaSchemaValidationConfigList" +_KSRC = "KafkaSchemaRegistryConfig" +_SRURI = "SchemaRegistryURI" +_ERF = "EventRecordFormat" +_ACc = "AccessConfigs" +_SVC = "SchemaValidationConfigs" +_AMKESC = "AmazonManagedKafkaEventSourceConfig" +_CGI = "ConsumerGroupId" +_SRC = "SchemaRegistryConfig" +_ALL = "ApplicationLogLevel" +_Tr = "Trace" +_TRACE = "TRACE" +_De = "Debug" +_DEBUG = "DEBUG" +_In = "Info" +_INFO = "INFO" +_Wa = "Warn" +_WARN = "WARN" +_E = "Error" +_ERROR = "ERROR" +_F = "Fatal" +_FATAL = "FATAL" +_Arc = "Architecture" +_x = "x86_64" +_a = "arm64" +_ALr = "ArchitecturesList" +_ACt = "AttemptCount" +_CPN = "CapacityProviderName" +_CPLEE = "CapacityProviderLimitExceededException" +_CPMVCC = "CapacityProviderMaxVCpuCount" +_CPSM = "CapacityProviderScalingMode" +_Au = "Auto" +_Ma = "Manual" +_CPPMT = "CapacityProviderPredefinedMetricType" +_LCPACPUU = "LambdaCapacityProviderAverageCPUUtilization" +_MTV = "MetricTargetValue" +_TTSP = "TargetTrackingScalingPolicy" +_PMT = "PredefinedMetricType" +_TV = "TargetValue" +_CPSPL = "CapacityProviderScalingPoliciesList" +_CPSC = "CapacityProviderScalingConfig" +_MVCC = "MaxVCpuCount" +_SM = "ScalingMode" +_SP = "ScalingPolicies" +_IT = "InstanceType" +_ITS = "InstanceTypeSet" +_IR = "InstanceRequirements" +_Arch = "Architectures" +_AIT = "AllowedInstanceTypes" +_EIT = "ExcludedInstanceTypes" +_KMSKANE = "KMSKeyArnNonEmpty" +_RAo = "RoleArn" +_CPPC = "CapacityProviderPermissionsConfig" +_CPORA = "CapacityProviderOperatorRoleArn" +_TK = "TagKey" +_TVa = "TagValue" +_Ta = "Tags" +_PTM = "PropagateTagsMode" +_No = "None" +_Ex = "Explicit" +_PT = "PropagateTags" +_Mo = "Mode" +_ET = "ExplicitTags" +_LG = "LogGroup" +_SLL = "SystemLogLevel" +_CPLC = "CapacityProviderLoggingConfig" +_CPTC = "CapacityProviderTelemetryConfig" +_LC = "LoggingConfig" +_SGI = "SecurityGroupId" +_CPSGI = "CapacityProviderSecurityGroupIds" +_SIu = "SubnetId" +_CPSI = "CapacityProviderSubnetIds" +_CPVC = "CapacityProviderVpcConfig" +_SIub = "SubnetIds" +_SGIe = "SecurityGroupIds" +_CCPI = "CreateCapacityProviderInput" +_cCCPR = "com.amazonaws.lambda#CreateCapacityProviderRequest" +_VC = "VpcConfig" +_PC = "PermissionsConfig" +_KKA = "KmsKeyArn" +_TC = "TelemetryConfig" +_CPA = "CapacityProviderArn" +_KMSKA = "KMSKeyArn" +_Ti = "Timestamp" +_CPS = "CapacityProviderState" +_Pe = "Pending" +_Ac = "Active" +_Fa = "Failed" +_Del = "Deleting" +_CP = "CapacityProvider" +_Sta = "State" +_LM = "LastModified" +_CCPO = "CreateCapacityProviderOutput" +_cCCPRo = "com.amazonaws.lambda#CreateCapacityProviderResponse" +_CCP = "CreateCapacityProvider" +_DCPI = "DeleteCapacityProviderInput" +_cDCPR = "com.amazonaws.lambda#DeleteCapacityProviderRequest" +_DCPO = "DeleteCapacityProviderOutput" +_cDCPRo = "com.amazonaws.lambda#DeleteCapacityProviderResponse" +_DCP = "DeleteCapacityProvider" +_GCPI = "GetCapacityProviderInput" +_cGCPR = "com.amazonaws.lambda#GetCapacityProviderRequest" +_GCPO = "GetCapacityProviderOutput" +_cGCPRo = "com.amazonaws.lambda#GetCapacityProviderResponse" +_GCP = "GetCapacityProvider" +_MFLI = "MaxFiftyListItems" +_LCPI = "ListCapacityProvidersInput" +_cLCPR = "com.amazonaws.lambda#ListCapacityProvidersRequest" +_Mar = "Marker" +_MI = "MaxItems" +_CPL = "CapacityProvidersList" +_LCPO = "ListCapacityProvidersOutput" +_cLCPRo = "com.amazonaws.lambda#ListCapacityProvidersResponse" +_CPa = "CapacityProviders" +_NM = "NextMarker" +_LCP = "ListCapacityProviders" +_LFVBCPI = "ListFunctionVersionsByCapacityProviderInput" +_cLFVBCPR = "com.amazonaws.lambda#ListFunctionVersionsByCapacityProviderRequest" +_NSFA = "NameSpacedFunctionArn" +_Ina = "Inactive" +_Dea = "Deactivating" +_Deac = "Deactivated" +_ANI = "ActiveNonInvocable" +_FVBCPLI = "FunctionVersionsByCapacityProviderListItem" +_FVBCPL = "FunctionVersionsByCapacityProviderList" +_LFVBCPO = "ListFunctionVersionsByCapacityProviderOutput" +_cLFVBCPRo = "com.amazonaws.lambda#ListFunctionVersionsByCapacityProviderResponse" +_FVu = "FunctionVersions" +_LFVBCP = "ListFunctionVersionsByCapacityProvider" +_UCPI = "UpdateCapacityProviderInput" +_cUCPR = "com.amazonaws.lambda#UpdateCapacityProviderRequest" +_UCPO = "UpdateCapacityProviderOutput" +_cUCPRo = "com.amazonaws.lambda#UpdateCapacityProviderResponse" +_UCP = "UpdateCapacityProvider" +_CSCI = "CodeSigningConfigId" +_CSP = "CodeSigningPolicy" +_En = "Enforce" +_CSPo = "CodeSigningPolicies" +_UAOD = "UntrustedArtifactOnDeployment" +_CCSCI = "CreateCodeSigningConfigInput" +_cCCSCR = "com.amazonaws.lambda#CreateCodeSigningConfigRequest" +_CSCA = "CodeSigningConfigArn" +_CSC = "CodeSigningConfig" +_CCSCO = "CreateCodeSigningConfigOutput" +_cCCSCRo = "com.amazonaws.lambda#CreateCodeSigningConfigResponse" +_CCSC = "CreateCodeSigningConfig" +_DCSCI = "DeleteCodeSigningConfigInput" +_cDCSCR = "com.amazonaws.lambda#DeleteCodeSigningConfigRequest" +_DCSCO = "DeleteCodeSigningConfigOutput" +_cDCSCRo = "com.amazonaws.lambda#DeleteCodeSigningConfigResponse" +_DCSC = "DeleteCodeSigningConfig" +_GCSCI = "GetCodeSigningConfigInput" +_cGCSCR = "com.amazonaws.lambda#GetCodeSigningConfigRequest" +_GCSCO = "GetCodeSigningConfigOutput" +_cGCSCRo = "com.amazonaws.lambda#GetCodeSigningConfigResponse" +_GCSC = "GetCodeSigningConfig" +_MLI = "MaxListItems" +_LCSCI = "ListCodeSigningConfigsInput" +_cLCSCR = "com.amazonaws.lambda#ListCodeSigningConfigsRequest" +_CSCL = "CodeSigningConfigList" +_LCSCO = "ListCodeSigningConfigsOutput" +_cLCSCRo = "com.amazonaws.lambda#ListCodeSigningConfigsResponse" +_CSCo = "CodeSigningConfigs" +_LCSC = "ListCodeSigningConfigs" +_LFBCSCI = "ListFunctionsByCodeSigningConfigInput" +_cLFBCSCR = "com.amazonaws.lambda#ListFunctionsByCodeSigningConfigRequest" +_FAL = "FunctionArnList" +_LFBCSCO = "ListFunctionsByCodeSigningConfigOutput" +_cLFBCSCRo = "com.amazonaws.lambda#ListFunctionsByCodeSigningConfigResponse" +_FAu = "FunctionArns" +_LFBCSC = "ListFunctionsByCodeSigningConfig" +_UCSCI = "UpdateCodeSigningConfigInput" +_cUCSCR = "com.amazonaws.lambda#UpdateCodeSigningConfigRequest" +_UCSCO = "UpdateCodeSigningConfigOutput" +_cUCSCRo = "com.amazonaws.lambda#UpdateCodeSigningConfigResponse" +_UCSC = "UpdateCodeSigningConfig" +_DFI = "DeleteFunctionInput" +_cDFR = "com.amazonaws.lambda#DeleteFunctionRequest" +_DFO = "DeleteFunctionOutput" +_cDFRo = "com.amazonaws.lambda#DeleteFunctionResponse" +_SC = "StatusCode" +_sRC = "smithy.api#httpResponseCode" +_DF = "DeleteFunction" +_DFEICI = "DeleteFunctionEventInvokeConfigInput" +_cDFEICR = "com.amazonaws.lambda#DeleteFunctionEventInvokeConfigRequest" +_DFEICO = "DeleteFunctionEventInvokeConfigOutput" +_sU = "smithy.api#Unit" +_DFEIC = "DeleteFunctionEventInvokeConfig" +_PRA = "PolicyResourceArn" +_DRPI = "DeleteResourcePolicyInput" +_cDRPR = "com.amazonaws.lambda#DeleteResourcePolicyRequest" +_RAe = "ResourceArn" +_DRPO = "DeleteResourcePolicyOutput" +_DRP = "DeleteResourcePolicy" +_CT = "CheckpointToken" +_CTl = "ClientToken" +_DEA = "DurableExecutionArn" +_OA = "OperationAction" +_START = "START" +_SUCCEED = "SUCCEED" +_FAIL = "FAIL" +_RETRY = "RETRY" +_CANCEL = "CANCEL" +_DS = "DurationSeconds" +_CO = "CallbackOptions" +_TS = "TimeoutSeconds" +_HTS = "HeartbeatTimeoutSeconds" +_TI = "TenantId" +_CIO = "ChainedInvokeOptions" +_RCe = "ReplayChildren" +_COo = "ContextOptions" +_ED = "ErrorData" +_smithya = "smithy.api#sensitive" +_EM = "ErrorMessage" +_ETr = "ErrorType" +_STE = "StackTraceEntry" +_STEt = "StackTraceEntries" +_EO = "ErrorObject" +_ST = "StackTrace" +_OIp = "OperationId" +_ON = "OperationName" +_OP = "OperationPayload" +_SOt = "StepOptions" +_NADS = "NextAttemptDelaySeconds" +_OST = "OperationSubType" +_OT = "OperationType" +_EXECUTION = "EXECUTION" +_CONTEXT = "CONTEXT" +_STEP = "STEP" +_WAIT = "WAIT" +_CALLBACK = "CALLBACK" +_CI = "CHAINED_INVOKE" +_WO = "WaitOptions" +_WS = "WaitSeconds" +_OU = "OperationUpdate" +_Id = "Id" +_PI = "ParentId" +_STu = "SubType" +_Pa = "Payload" +_OUp = "OperationUpdates" +_CDEI = "CheckpointDurableExecutionInput" +_cCDER = "com.amazonaws.lambda#CheckpointDurableExecutionRequest" +_U = "Updates" +_sT = "smithy.api#idempotencyToken" +_CIa = "CallbackId" +_CD = "CallbackDetails" +_Re = "Result" +_CID = "ChainedInvokeDetails" +_CDo = "ContextDetails" +_ETx = "ExecutionTimestamp" +_IP = "InputPayload" +_EDx = "ExecutionDetails" +_OS = "OperationStatus" +_STARTED = "STARTED" +_PENDING = "PENDING" +_READY = "READY" +_SUCCEEDED = "SUCCEEDED" +_FAILED = "FAILED" +_CANCELLED = "CANCELLED" +_TO = "TIMED_OUT" +_STOPPED = "STOPPED" +_SD = "StepDetails" +_Att = "Attempt" +_NAT = "NextAttemptTimestamp" +_WD = "WaitDetails" +_SET = "ScheduledEndTimestamp" +_Op = "Operation" +_STt = "StartTimestamp" +_ETn = "EndTimestamp" +_Stat = "Status" +_Ope = "Operations" +_CUES = "CheckpointUpdatedExecutionState" +_CDEO = "CheckpointDurableExecutionOutput" +_cCDERo = "com.amazonaws.lambda#CheckpointDurableExecutionResponse" +_NES = "NewExecutionState" +_KMSADE = "KMSAccessDeniedException" +_KMSDE = "KMSDisabledException" +_KMSISE = "KMSInvalidStateException" +_KMSNFE = "KMSNotFoundException" +_CDE = "CheckpointDurableExecution" +_IED = "IncludeExecutionData" +_GDEI = "GetDurableExecutionInput" +_cGDER = "com.amazonaws.lambda#GetDurableExecutionRequest" +_ETxe = "ExecutionTimeout" +_RPID = "RetentionPeriodInDays" +_DC = "DurableConfig" +_DEN = "DurableExecutionName" +_EDI = "ExecutionDataIncluded" +_OPu = "OutputPayload" +_ES = "ExecutionStatus" +_RUNNING = "RUNNING" +_XATI = "XAmznTraceId" +_TH = "TraceHeader" +_VWLP = "VersionWithLatestPublished" +_GDEO = "GetDurableExecutionOutput" +_cGDERo = "com.amazonaws.lambda#GetDurableExecutionResponse" +_GDE = "GetDurableExecution" +_IC = "ItemCount" +_RO = "ReverseOrder" +_GDEHI = "GetDurableExecutionHistoryInput" +_cGDEHR = "com.amazonaws.lambda#GetDurableExecutionHistoryRequest" +_Tru = "Truncated" +_EE = "EventError" +_CFD = "CallbackFailedDetails" +_CSD = "CallbackStartedDetails" +_HT = "HeartbeatTimeout" +_Tim = "Timeout" +_ER = "EventResult" +_CSDa = "CallbackSucceededDetails" +_CTOD = "CallbackTimedOutDetails" +_CIFD = "ChainedInvokeFailedDetails" +_EI = "EventInput" +_CISD = "ChainedInvokeStartedDetails" +_Inp = "Input" +_EV = "ExecutedVersion" +_CISDh = "ChainedInvokeStoppedDetails" +_CISDha = "ChainedInvokeSucceededDetails" +_CITOD = "ChainedInvokeTimedOutDetails" +_CFDo = "ContextFailedDetails" +_CSDo = "ContextStartedDetails" +_CSDon = "ContextSucceededDetails" +_EIv = "EventId" +_ETv = "EventType" +_ESx = "ExecutionStarted" +_ESxe = "ExecutionSucceeded" +_EF = "ExecutionFailed" +_ETO = "ExecutionTimedOut" +_ESxec = "ExecutionStopped" +_CS = "ContextStarted" +_CSo = "ContextSucceeded" +_CF = "ContextFailed" +_WSa = "WaitStarted" +_WSai = "WaitSucceeded" +_WC = "WaitCancelled" +_SS = "StepStarted" +_SSt = "StepSucceeded" +_SF = "StepFailed" +_CIS = "ChainedInvokeStarted" +_CISh = "ChainedInvokeSucceeded" +_CIF = "ChainedInvokeFailed" +_CITO = "ChainedInvokeTimedOut" +_CISha = "ChainedInvokeStopped" +_CSa = "CallbackStarted" +_CSal = "CallbackSucceeded" +_CFa = "CallbackFailed" +_CTO = "CallbackTimedOut" +_ICn = "InvocationCompleted" +_EFD = "ExecutionFailedDetails" +_ESD = "ExecutionStartedDetails" +_ESDx = "ExecutionStoppedDetails" +_ESDxe = "ExecutionSucceededDetails" +_ETOD = "ExecutionTimedOutDetails" +_ICD = "InvocationCompletedDetails" +_RIe = "RequestId" +_RD = "RetryDetails" +_CA = "CurrentAttempt" +_SFD = "StepFailedDetails" +_SSD = "StepStartedDetails" +_SSDt = "StepSucceededDetails" +_WCD = "WaitCancelledDetails" +_WSD = "WaitStartedDetails" +_Du = "Duration" +_WSDa = "WaitSucceededDetails" +_Ev = "Event" +_ETve = "EventTimestamp" +_Eve = "Events" +_GDEHO = "GetDurableExecutionHistoryOutput" +_cGDEHRo = "com.amazonaws.lambda#GetDurableExecutionHistoryResponse" +_GDEH = "GetDurableExecutionHistory" +_GDESI = "GetDurableExecutionStateInput" +_cGDESR = "com.amazonaws.lambda#GetDurableExecutionStateRequest" +_GDESO = "GetDurableExecutionStateOutput" +_cGDESRo = "com.amazonaws.lambda#GetDurableExecutionStateResponse" +_GDES = "GetDurableExecutionState" +_SDEI = "StopDurableExecutionInput" +_cSDER = "com.amazonaws.lambda#StopDurableExecutionRequest" +_sP = "smithy.api#httpPayload" +_SDEO = "StopDurableExecutionOutput" +_cSDERo = "com.amazonaws.lambda#StopDurableExecutionResponse" +_STto = "StopTimestamp" +_SDE = "StopDurableExecution" +_BS = "BatchSize" +_BBOFE = "BisectBatchOnFunctionError" +_DA = "DestinationArn" +_OF = "OnFailure" +_Des = "Destination" +_OSn = "OnSuccess" +_DCe = "DestinationConfig" +_CN = "CollectionName" +_DN = "DatabaseName" +_FD = "FullDocument" +_UL = "UpdateLookup" +_Def = "Default" +_DDBESC = "DocumentDBEventSourceConfig" +_Ena = "Enabled" +_Pat = "Pattern" +_Fi = "Filter" +_FL = "FilterList" +_FCi = "FilterCriteria" +_Fil = "Filters" +_FRT = "FunctionResponseType" +_RBIF = "ReportBatchItemFailures" +_FRTL = "FunctionResponseTypeList" +_ESMSLL = "EventSourceMappingSystemLogLevel" +_ESMLC = "EventSourceMappingLoggingConfig" +_MBWIS = "MaximumBatchingWindowInSeconds" +_MRAIS = "MaximumRecordAgeInSeconds" +_MRAESM = "MaximumRetryAttemptsEventSourceMapping" +_ESMM = "EventSourceMappingMetric" +_EC = "EventCount" +_ECr = "ErrorCount" +_KM = "KafkaMetrics" +_ESMML = "EventSourceMappingMetricList" +_ESMMC = "EventSourceMappingMetricsConfig" +_Met = "Metrics" +_PF = "ParallelizationFactor" +_MNOP = "MaximumNumberOfPollers" +_MNOPi = "MinimumNumberOfPollers" +_PPGN = "ProvisionedPollerGroupName" +_PPC = "ProvisionedPollerConfig" +_MP = "MinimumPollers" +_MPa = "MaximumPollers" +_PGN = "PollerGroupName" +_Qu = "Queue" +_Que = "Queues" +_MC = "MaximumConcurrency" +_SCc = "ScalingConfig" +_EPT = "EndPointType" +_KBS = "KAFKA_BOOTSTRAP_SERVERS" +_End = "Endpoint" +_EL = "EndpointLists" +_Endp = "Endpoints" +_SMES = "SelfManagedEventSource" +_SMKESC = "SelfManagedKafkaEventSourceConfig" +_SAT = "SourceAccessType" +_VS = "VPC_SUBNET" +_VSG = "VPC_SECURITY_GROUP" +_SSA = "SASL_SCRAM_512_AUTH" +_SSA_ = "SASL_SCRAM_256_AUTH" +_VH = "VIRTUAL_HOST" +_SAC = "SourceAccessConfiguration" +_SACo = "SourceAccessConfigurations" +_ESP = "EventSourcePosition" +_TH_ = "TRIM_HORIZON" +_LATEST = "LATEST" +_AT = "AT_TIMESTAMP" +_Da = "Date" +_To = "Topic" +_Top = "Topics" +_TWIS = "TumblingWindowInSeconds" +_CESMI = "CreateEventSourceMappingInput" +_cCESMR = "com.amazonaws.lambda#CreateEventSourceMappingRequest" +_ESA = "EventSourceArn" +_MCe = "MetricsConfig" +_SPt = "StartingPosition" +_SPT = "StartingPositionTimestamp" +_MRA = "MaximumRetryAttempts" +_FRTu = "FunctionResponseTypes" +_ESMA = "EventSourceMappingArn" +_FCEC = "FilterCriteriaErrorCode" +_FCEM = "FilterCriteriaErrorMessage" +_FCE = "FilterCriteriaError" +_ECrr = "ErrorCode" +_UUIDS = "UUIDString" +_CESMO = "CreateEventSourceMappingOutput" +_cESMC = "com.amazonaws.lambda#EventSourceMappingConfiguration" +_UUID = "UUID" +_LPR = "LastProcessingResult" +_STR = "StateTransitionReason" +_CESM = "CreateEventSourceMapping" +_DESMI = "DeleteEventSourceMappingInput" +_cDESMR = "com.amazonaws.lambda#DeleteEventSourceMappingRequest" +_DESMO = "DeleteEventSourceMappingOutput" +_RIUE = "ResourceInUseException" +_DESM = "DeleteEventSourceMapping" +_GESMI = "GetEventSourceMappingInput" +_cGESMR = "com.amazonaws.lambda#GetEventSourceMappingRequest" +_GESMO = "GetEventSourceMappingOutput" +_GESM = "GetEventSourceMapping" +_LESMI = "ListEventSourceMappingsInput" +_cLESMR = "com.amazonaws.lambda#ListEventSourceMappingsRequest" +_ESMC = "EventSourceMappingConfiguration" +_ESML = "EventSourceMappingsList" +_LESMO = "ListEventSourceMappingsOutput" +_cLESMRo = "com.amazonaws.lambda#ListEventSourceMappingsResponse" +_ESM = "EventSourceMappings" +_LESM = "ListEventSourceMappings" +_UESMI = "UpdateEventSourceMappingInput" +_cUESMR = "com.amazonaws.lambda#UpdateEventSourceMappingRequest" +_UESMO = "UpdateEventSourceMappingOutput" +_UESM = "UpdateEventSourceMapping" +_CSCNFE = "CodeSigningConfigNotFoundException" +_CSEE = "CodeStorageExceededException" +_CVFE = "CodeVerificationFailedException" +_EEMGBPVC = "ExecutionEnvironmentMemoryGiBPerVCpu" +_PEEMC = "PerExecutionEnvironmentMaxConcurrency" +_LMICPC = "LambdaManagedInstancesCapacityProviderConfig" +_CPC = "CapacityProviderConfig" +_SB = "S3Bucket" +_SK = "S3Key" +_SOSM = "S3ObjectStorageMode" +_C = "Copy" +_COPY = "COPY" +_Ref = "Reference" +_REFERENCE = "REFERENCE" +_SOV = "S3ObjectVersion" +_B = "Blob" +_FCu = "FunctionCode" +_ZF = "ZipFile" +_IU = "ImageUri" +_SKMSKA = "SourceKMSKeyArn" +_DLC = "DeadLetterConfig" +_TA = "TargetArn" +_EVN = "EnvironmentVariableName" +_EVV = "EnvironmentVariableValue" +_EVn = "EnvironmentVariables" +_Env = "Environment" +_Va = "Variables" +_ESS = "EphemeralStorageSize" +_ESp = "EphemeralStorage" +_Si = "Size" +_FSA = "FileSystemArn" +_LMP = "LocalMountPath" +_DSR = "DirectS3Read" +_ENABLED = "ENABLED" +_DISABLED = "DISABLED" +_AUTO = "AUTO" +_SFC = "S3FilesConfig" +_FSC = "FileSystemConfig" +_FSCL = "FileSystemConfigList" +_H = "Handler" +_SL = "StringList" +_WDo = "WorkingDirectory" +_ICm = "ImageConfig" +_EP = "EntryPoint" +_Co = "Command" +_LVA = "LayerVersionArn" +_LL = "LayerList" +_LF = "LogFormat" +_J = "Json" +_Te = "Text" +_MS = "MemorySize" +_PTa = "PackageType" +_Z = "Zip" +_Im = "Image" +_Bo = "Boolean" +_FVLP = "FunctionVersionLatestPublished" +_LP = "LATEST_PUBLISHED" +_Ru = "Runtime" +_n = "nodejs" +_no = "nodejs43" +_nod = "nodejs4.3" +_node = "nodejs610" +_nodej = "nodejs6.10" +_nodejs = "nodejs810" +_nodejs_ = "nodejs8.10" +_nodejsx = "nodejs10x" +_nodejsx_ = "nodejs10.x" +_nodejsx__ = "nodejs12x" +_nodejsx___ = "nodejs12.x" +_nodejsx____ = "nodejs14x" +_nodejsx_____ = "nodejs14.x" +_nodejsx______ = "nodejs16x" +_nodejsx_______ = "nodejs16.x" +_nodejsx________ = "nodejs18x" +_nodejsx_________ = "nodejs18.x" +_nodejsx__________ = "nodejs20x" +_nodejsx___________ = "nodejs20.x" +_nodejsx____________ = "nodejs22x" +_nodejsx_____________ = "nodejs22.x" +_nodejsx______________ = "nodejs24x" +_nodejsx_______________ = "nodejs24.x" +_j = "java8" +_ja = "java8al2" +_jav = "java8.al2" +_java = "java11" +_java_ = "java17" +_java__ = "java21" +_java___ = "java25" +_p = "python27" +_py = "python2.7" +_pyt = "python36" +_pyth = "python3.6" +_pytho = "python37" +_python = "python3.7" +_python_ = "python38" +_python__ = "python3.8" +_python___ = "python39" +_python____ = "python3.9" +_python_____ = "python310" +_python______ = "python3.10" +_python_______ = "python311" +_python________ = "python3.11" +_python_________ = "python312" +_python__________ = "python3.12" +_python___________ = "python313" +_python____________ = "python3.13" +_python_____________ = "python314" +_python______________ = "python3.14" +_d = "dotnetcore10" +_do = "dotnetcore1.0" +_dot = "dotnetcore20" +_dotn = "dotnetcore2.0" +_dotne = "dotnetcore21" +_dotnet = "dotnetcore2.1" +_dotnetc = "dotnetcore31" +_dotnetco = "dotnetcore3.1" +_dotnet_ = "dotnet6" +_dotnet__ = "dotnet8" +_dotnet___ = "dotnet10" +_nodejse = "nodejs43edge" +_ne = "nodejs4.3-edge" +_g = "go1x" +_go = "go1.x" +_r = "ruby25" +_ru = "ruby2.5" +_rub = "ruby27" +_ruby = "ruby2.7" +_ruby_ = "ruby32" +_ruby__ = "ruby3.2" +_ruby___ = "ruby33" +_ruby____ = "ruby3.3" +_ruby_____ = "ruby34" +_ruby______ = "ruby3.4" +_ruby_______ = "ruby40" +_ruby________ = "ruby4.0" +_pr = "provided" +_pro = "providedal2" +_prov = "provided.al2" +_provi = "providedal2023" +_provid = "provided.al2023" +_nodejsx________________ = "nodejs26x" +_nodejsx_________________ = "nodejs26.x" +_python_______________ = "python315" +_python________________ = "python3.15" +_javaa = "java8al2023" +_javaal = "java8.al2023" +_javaal_ = "java11al2023" +_javaal__ = "java11.al2023" +_javaal___ = "java17al2023" +_javaal____ = "java17.al2023" +_SSAO = "SnapStartApplyOn" +_PV = "PublishedVersions" +_SSn = "SnapStart" +_AO = "ApplyOn" +_TIM = "TenantIsolationMode" +_PT_ = "PER_TENANT" +_TCe = "TenancyConfig" +_TM = "TracingMode" +_PTas = "PassThrough" +_TCr = "TracingConfig" +_NB = "NullableBoolean" +_IAFDS = "Ipv6AllowedForDualStack" +_CFI = "CreateFunctionInput" +_cCFR = "com.amazonaws.lambda#CreateFunctionRequest" +_Ro = "Role" +_Cod = "Code" +_Pu = "Publish" +_PTu = "PublishTo" +_La = "Layers" +_FSCi = "FileSystemConfigs" +_SSe = "SensitiveString" +_EEn = "EnvironmentError" +_ERn = "EnvironmentResponse" +_ICE = "ImageConfigError" +_ICR = "ImageConfigResponse" +_LUS = "LastUpdateStatus" +_Su = "Successful" +_IPn = "InProgress" +_LUSR = "LastUpdateStatusReason" +_LUSRC = "LastUpdateStatusReasonCode" +_ELE = "EniLimitExceeded" +_IRP = "InsufficientRolePermissions" +_ICnv = "InvalidConfiguration" +_IE = "InternalError" +_SOOIPA = "SubnetOutOfIPAddresses" +_IS = "InvalidSubnet" +_ISG = "InvalidSecurityGroup" +_ID = "ImageDeleted" +_IAD = "ImageAccessDenied" +_II = "InvalidImage" +_KMSKAD = "KMSKeyAccessDenied" +_KMSKNF = "KMSKeyNotFound" +_ISKMSK = "InvalidStateKMSKey" +_DKMSK = "DisabledKMSKey" +_EFSIOE = "EFSIOError" +_EFSMCE = "EFSMountConnectivityError" +_EFSMF = "EFSMountFailure" +_EFSMT = "EFSMountTimeout" +_IRn = "InvalidRuntime" +_IZFE = "InvalidZipFileException" +_FE = "FunctionError" +_SQEE = "ServiceQuotaExceededException" +_VLE = "VcpuLimitExceeded" +_CPSLE = "CapacityProviderScalingLimitExceeded" +_ICns = "InsufficientCapacity" +_ECRLE = "EC2RequestLimitExceeded" +_FEIT = "FunctionErrorInitTimeout" +_FEITu = "FunctionError.InitTimeout" +_FERIE = "FunctionErrorRuntimeInitError" +_FERIEu = "FunctionError.RuntimeInitError" +_FEEIE = "FunctionErrorExtensionInitError" +_FEEIEu = "FunctionError.ExtensionInitError" +_FEIEP = "FunctionErrorInvalidEntryPoint" +_FEIEPu = "FunctionError.InvalidEntryPoint" +_FEIWD = "FunctionErrorInvalidWorkingDirectory" +_FEIWDu = "FunctionError.InvalidWorkingDirectory" +_FEPD = "FunctionErrorPermissionDenied" +_FEPDu = "FunctionError.PermissionDenied" +_FETME = "FunctionErrorTooManyExtensions" +_FETMEu = "FunctionError.TooManyExtensions" +_FEIRE = "FunctionErrorInitResourceExhausted" +_FEIREu = "FunctionError.InitResourceExhausted" +_DBVEC = "DisallowedByVpcEncryptionControl" +_DE = "DependencyError" +_Lay = "Layer" +_CSod = "CodeSize" +_SPVAi = "SigningProfileVersionArn" +_SJA = "SigningJobArn" +_LRL = "LayersReferenceList" +_RVE = "RuntimeVersionError" +_RVA = "RuntimeVersionArn" +_RVC = "RuntimeVersionConfig" +_SSOS = "SnapStartOptimizationStatus" +_On = "On" +_Of = "Off" +_SSR = "SnapStartResponse" +_OSp = "OptimizationStatus" +_SR = "StateReason" +_SRCt = "StateReasonCode" +_Idl = "Idle" +_Cr = "Creating" +_Res = "Restoring" +_DDE = "DrainingDurableExecutions" +_TCR = "TracingConfigResponse" +_VI = "VpcId" +_VCR = "VpcConfigResponse" +_CFO = "CreateFunctionOutput" +_cFC = "com.amazonaws.lambda#FunctionConfiguration" +_CSode = "CodeSha256" +_MA = "MasterArn" +_CSon = "ConfigSha256" +_FVPCPLEE = "FunctionVersionsPerCapacityProviderLimitExceededException" +_ICSE = "InvalidCodeSignatureException" +_CFr = "CreateFunction" +_He = "Header" +_HL = "HeadersList" +_MAa = "MaxAge" +_Cor = "Cors" +_AH = "AllowHeaders" +_AM = "AllowMethods" +_AOl = "AllowOrigins" +_EH = "ExposeHeaders" +_FUFN = "FunctionUrlFunctionName" +_IM = "InvokeMode" +_BUFFERED = "BUFFERED" +_RS = "RESPONSE_STREAM" +_FUQ = "FunctionUrlQualifier" +_CFUCI = "CreateFunctionUrlConfigInput" +_cCFUCR = "com.amazonaws.lambda#CreateFunctionUrlConfigRequest" +_ATu = "AuthType" +_FU = "FunctionUrl" +_CFUCO = "CreateFunctionUrlConfigOutput" +_cCFUCRo = "com.amazonaws.lambda#CreateFunctionUrlConfigResponse" +_CTr = "CreationTime" +_CFUC = "CreateFunctionUrlConfig" +_DFCSCI = "DeleteFunctionCodeSigningConfigInput" +_cDFCSCR = "com.amazonaws.lambda#DeleteFunctionCodeSigningConfigRequest" +_DFCSCO = "DeleteFunctionCodeSigningConfigOutput" +_DFCSC = "DeleteFunctionCodeSigningConfig" +_DFCI = "DeleteFunctionConcurrencyInput" +_cDFCR = "com.amazonaws.lambda#DeleteFunctionConcurrencyRequest" +_DFCO = "DeleteFunctionConcurrencyOutput" +_DFC = "DeleteFunctionConcurrency" +_DFUCI = "DeleteFunctionUrlConfigInput" +_cDFUCR = "com.amazonaws.lambda#DeleteFunctionUrlConfigRequest" +_DFUCO = "DeleteFunctionUrlConfigOutput" +_DFUC = "DeleteFunctionUrlConfig" +_GFI = "GetFunctionInput" +_cGFR = "com.amazonaws.lambda#GetFunctionRequest" +_FCLE = "FunctionCodeLocationError" +_SSOSO = "SensitiveStringOnServerOnly" +_RSO = "ResolvedS3Object" +_FCL = "FunctionCodeLocation" +_RT = "RepositoryType" +_Lo = "Location" +_RIU = "ResolvedImageUri" +_RCEe = "ReservedConcurrentExecutions" +_Con = "Concurrency" +_FCun = "FunctionConfiguration" +_TEC = "TagsErrorCode" +_TEM = "TagsErrorMessage" +_TE = "TagsError" +_GFO = "GetFunctionOutput" +_cGFRo = "com.amazonaws.lambda#GetFunctionResponse" +_Conf = "Configuration" +_GF = "GetFunction" +_GFCSCI = "GetFunctionCodeSigningConfigInput" +_cGFCSCR = "com.amazonaws.lambda#GetFunctionCodeSigningConfigRequest" +_GFCSCO = "GetFunctionCodeSigningConfigOutput" +_cGFCSCRo = "com.amazonaws.lambda#GetFunctionCodeSigningConfigResponse" +_GFCSC = "GetFunctionCodeSigningConfig" +_GFCI = "GetFunctionConcurrencyInput" +_cGFCR = "com.amazonaws.lambda#GetFunctionConcurrencyRequest" +_GFCO = "GetFunctionConcurrencyOutput" +_cGFCRo = "com.amazonaws.lambda#GetFunctionConcurrencyResponse" +_GFC = "GetFunctionConcurrency" +_GFCIe = "GetFunctionConfigurationInput" +_cGFCRom = "com.amazonaws.lambda#GetFunctionConfigurationRequest" +_GFCOe = "GetFunctionConfigurationOutput" +_GFCe = "GetFunctionConfiguration" +_UFN = "UnqualifiedFunctionName" +_GFRCI = "GetFunctionRecursionConfigInput" +_cGFRCR = "com.amazonaws.lambda#GetFunctionRecursionConfigRequest" +_RL = "RecursiveLoop" +_All = "Allow" +_Ter = "Terminate" +_GFRCO = "GetFunctionRecursionConfigOutput" +_cGFRCRo = "com.amazonaws.lambda#GetFunctionRecursionConfigResponse" +_GFRC = "GetFunctionRecursionConfig" +_PFQ = "PublishedFunctionQualifier" +_GFSCI = "GetFunctionScalingConfigInput" +_cGFSCR = "com.amazonaws.lambda#GetFunctionScalingConfigRequest" +_FSCEE = "FunctionScalingConfigExecutionEnvironments" +_FSCu = "FunctionScalingConfig" +_MEE = "MinExecutionEnvironments" +_MEEa = "MaxExecutionEnvironments" +_GFSCO = "GetFunctionScalingConfigOutput" +_cGFSCRo = "com.amazonaws.lambda#GetFunctionScalingConfigResponse" +_AFSC = "AppliedFunctionScalingConfig" +_RFSC = "RequestedFunctionScalingConfig" +_GFSC = "GetFunctionScalingConfig" +_GFUCI = "GetFunctionUrlConfigInput" +_cGFUCR = "com.amazonaws.lambda#GetFunctionUrlConfigRequest" +_GFUCO = "GetFunctionUrlConfigOutput" +_cGFUCRo = "com.amazonaws.lambda#GetFunctionUrlConfigResponse" +_LMT = "LastModifiedTime" +_GFUC = "GetFunctionUrlConfig" +_GPI = "GetPolicyInput" +_cGPR = "com.amazonaws.lambda#GetPolicyRequest" +_GPO = "GetPolicyOutput" +_cGPRo = "com.amazonaws.lambda#GetPolicyResponse" +_Po = "Policy" +_GP = "GetPolicy" +_GRMCI = "GetRuntimeManagementConfigInput" +_cGRMCR = "com.amazonaws.lambda#GetRuntimeManagementConfigRequest" +_URO = "UpdateRuntimeOn" +_FUu = "FunctionUpdate" +_GRMCO = "GetRuntimeManagementConfigOutput" +_cGRMCRo = "com.amazonaws.lambda#GetRuntimeManagementConfigResponse" +_GRMC = "GetRuntimeManagementConfig" +_CAUDE = "CodeArtifactUserDeletedException" +_CAUFE = "CodeArtifactUserFailedException" +_CAUPE = "CodeArtifactUserPendingException" +_DEASE = "DurableExecutionAlreadyStartedException" +_ECADE = "EC2AccessDeniedException" +_ECTE = "EC2ThrottledException" +_ECUE = "EC2UnexpectedException" +_ECEC = "EC2ErrorCode" +_EFSIOEx = "EFSIOException" +_EFSMCEo = "EFSMountConnectivityException" +_EFSMFE = "EFSMountFailureException" +_EFSMTE = "EFSMountTimeoutException" +_ENILRE = "ENILimitReachedException" +_ENINRE = "ENINotReadyException" +_IRCE = "InvalidRequestContentException" +_IRE = "InvalidRuntimeException" +_ISGIDE = "InvalidSecurityGroupIDException" +_ISIDE = "InvalidSubnetIDException" +_ITn = "InvocationType" +_RR = "RequestResponse" +_DR = "DryRun" +_LT = "LogType" +_Tai = "Tail" +_IIn = "InvokeInput" +_cIR = "com.amazonaws.lambda#InvocationRequest" +_XAIT = "X-Amz-Invocation-Type" +_XALT = "X-Amz-Log-Type" +_CC = "ClientContext" +_XACC = "X-Amz-Client-Context" +_XADEN = "X-Amz-Durable-Execution-Name" +_XATI_ = "X-Amz-Tenant-Id" +_IO = "InvokeOutput" +_cIRo = "com.amazonaws.lambda#InvocationResponse" +_XAFE = "X-Amz-Function-Error" +_LR = "LogResult" +_XALR = "X-Amz-Log-Result" +_XAEV = "X-Amz-Executed-Version" +_XADEA = "X-Amz-Durable-Execution-Arn" +_MNSE = "ModeNotSupportedException" +_NPVE = "NoPublishedVersionException" +_RIE = "RecursiveInvocationException" +_RTLE = "RequestTooLargeException" +_RNRE = "ResourceNotReadyException" +_SFMCE = "S3FilesMountConnectivityException" +_SFMFE = "S3FilesMountFailureException" +_SFMTE = "S3FilesMountTimeoutException" +_SRETLE = "SerializedRequestEntityTooLargeException" +_SSE = "SnapStartException" +_SSNRE = "SnapStartNotReadyException" +_SSRFE = "SnapStartRegenerationFailureException" +_SSTE = "SnapStartTimeoutException" +_SIPALRE = "SubnetIPAddressLimitReachedException" +_UMTE = "UnsupportedMediaTypeException" +_Inv = "Invoke" +_BSl = "BlobStream" +_smithyap = "smithy.api#streaming" +_IAI = "InvokeAsyncInput" +_cIAR = "com.amazonaws.lambda#InvokeAsyncRequest" +_IA = "InvokeArgs" +_HS = "HttpStatus" +_IAO = "InvokeAsyncOutput" +_cIARo = "com.amazonaws.lambda#InvokeAsyncResponse" +_IAn = "InvokeAsync" +_RSIT = "ResponseStreamingInvocationType" +_IWRSI = "InvokeWithResponseStreamInput" +_cIWRSR = "com.amazonaws.lambda#InvokeWithResponseStreamRequest" +_IWRSCE = "InvokeWithResponseStreamCompleteEvent" +_EDr = "ErrorDetails" +_IRSU = "InvokeResponseStreamUpdate" +_sPm = "smithy.api#eventPayload" +_IWRSRE = "InvokeWithResponseStreamResponseEvent" +_PCa = "PayloadChunk" +_ICnvo = "InvokeComplete" +_IWRSO = "InvokeWithResponseStreamOutput" +_cIWRSRo = "com.amazonaws.lambda#InvokeWithResponseStreamResponse" +_ESv = "EventStream" +_RSCT = "ResponseStreamContentType" +_CT_ = "Content-Type" +_IWRS = "InvokeWithResponseStream" +_ESL = "ExecutionStatusList" +_LDEBFI = "ListDurableExecutionsByFunctionInput" +_cLDEBFR = "com.amazonaws.lambda#ListDurableExecutionsByFunctionRequest" +_Statu = "Statuses" +_SAt = "StartedAfter" +_SBt = "StartedBefore" +_Exe = "Execution" +_DEu = "DurableExecutions" +_LDEBFO = "ListDurableExecutionsByFunctionOutput" +_cLDEBFRo = "com.amazonaws.lambda#ListDurableExecutionsByFunctionResponse" +_LDEBF = "ListDurableExecutionsByFunction" +_ALL_ = "ALL" +_MR = "MasterRegion" +_LFI = "ListFunctionsInput" +_cLFR = "com.amazonaws.lambda#ListFunctionsRequest" +_FLu = "FunctionList" +_LFO = "ListFunctionsOutput" +_cLFRo = "com.amazonaws.lambda#ListFunctionsResponse" +_Fu = "Functions" +_LFi = "ListFunctions" +_LFUCI = "ListFunctionUrlConfigsInput" +_cLFUCR = "com.amazonaws.lambda#ListFunctionUrlConfigsRequest" +_FUC = "FunctionUrlConfig" +_FUCL = "FunctionUrlConfigList" +_LFUCO = "ListFunctionUrlConfigsOutput" +_cLFUCRo = "com.amazonaws.lambda#ListFunctionUrlConfigsResponse" +_FUCu = "FunctionUrlConfigs" +_LFUC = "ListFunctionUrlConfigs" +_MPCCLI = "MaxProvisionedConcurrencyConfigListItems" +_LPCCI = "ListProvisionedConcurrencyConfigsInput" +_cLPCCR = "com.amazonaws.lambda#ListProvisionedConcurrencyConfigsRequest" +_NNI = "NonNegativeInteger" +_PIo = "PositiveInteger" +_PCSE = "ProvisionedConcurrencyStatusEnum" +_IP_ = "IN_PROGRESS" +_PCCLI = "ProvisionedConcurrencyConfigListItem" +_RPCE = "RequestedProvisionedConcurrentExecutions" +_APCE = "AvailableProvisionedConcurrentExecutions" +_APCEl = "AllocatedProvisionedConcurrentExecutions" +_SRt = "StatusReason" +_PCCL = "ProvisionedConcurrencyConfigList" +_LPCCO = "ListProvisionedConcurrencyConfigsOutput" +_cLPCCRo = "com.amazonaws.lambda#ListProvisionedConcurrencyConfigsResponse" +_PCC = "ProvisionedConcurrencyConfigs" +_LPCC = "ListProvisionedConcurrencyConfigs" +_PFCSCI = "PutFunctionCodeSigningConfigInput" +_cPFCSCR = "com.amazonaws.lambda#PutFunctionCodeSigningConfigRequest" +_PFCSCO = "PutFunctionCodeSigningConfigOutput" +_cPFCSCRo = "com.amazonaws.lambda#PutFunctionCodeSigningConfigResponse" +_PFCSC = "PutFunctionCodeSigningConfig" +_PFCI = "PutFunctionConcurrencyInput" +_cPFCR = "com.amazonaws.lambda#PutFunctionConcurrencyRequest" +_PFCO = "PutFunctionConcurrencyOutput" +_cC = "com.amazonaws.lambda#Concurrency" +_PFC = "PutFunctionConcurrency" +_PFRCI = "PutFunctionRecursionConfigInput" +_cPFRCR = "com.amazonaws.lambda#PutFunctionRecursionConfigRequest" +_PFRCO = "PutFunctionRecursionConfigOutput" +_cPFRCRo = "com.amazonaws.lambda#PutFunctionRecursionConfigResponse" +_PFRC = "PutFunctionRecursionConfig" +_PFSCI = "PutFunctionScalingConfigInput" +_cPFSCR = "com.amazonaws.lambda#PutFunctionScalingConfigRequest" +_PFSCO = "PutFunctionScalingConfigOutput" +_cPFSCRo = "com.amazonaws.lambda#PutFunctionScalingConfigResponse" +_FS = "FunctionState" +_PFSC = "PutFunctionScalingConfig" +_PRMCI = "PutRuntimeManagementConfigInput" +_cPRMCR = "com.amazonaws.lambda#PutRuntimeManagementConfigRequest" +_PRMCO = "PutRuntimeManagementConfigOutput" +_cPRMCRo = "com.amazonaws.lambda#PutRuntimeManagementConfigResponse" +_PRMC = "PutRuntimeManagementConfig" +_UFCI = "UpdateFunctionCodeInput" +_cUFCR = "com.amazonaws.lambda#UpdateFunctionCodeRequest" +_UFCO = "UpdateFunctionCodeOutput" +_UFC = "UpdateFunctionCode" +_UFCIp = "UpdateFunctionConfigurationInput" +_cUFCRo = "com.amazonaws.lambda#UpdateFunctionConfigurationRequest" +_UFCOp = "UpdateFunctionConfigurationOutput" +_UFCp = "UpdateFunctionConfiguration" +_UFUCI = "UpdateFunctionUrlConfigInput" +_cUFUCR = "com.amazonaws.lambda#UpdateFunctionUrlConfigRequest" +_UFUCO = "UpdateFunctionUrlConfigOutput" +_cUFUCRo = "com.amazonaws.lambda#UpdateFunctionUrlConfigResponse" +_UFUC = "UpdateFunctionUrlConfig" +_CAI = "CreateAliasInput" +_cCAR = "com.amazonaws.lambda#CreateAliasRequest" +_CAO = "CreateAliasOutput" +_cAC = "com.amazonaws.lambda#AliasConfiguration" +_CAr = "CreateAlias" +_DAI = "DeleteAliasInput" +_cDAR = "com.amazonaws.lambda#DeleteAliasRequest" +_DAO = "DeleteAliasOutput" +_DAe = "DeleteAlias" +_GAI = "GetAliasInput" +_cGAR = "com.amazonaws.lambda#GetAliasRequest" +_GAO = "GetAliasOutput" +_GA = "GetAlias" +_LAI = "ListAliasesInput" +_cLAR = "com.amazonaws.lambda#ListAliasesRequest" +_LAO = "ListAliasesOutput" +_cLARo = "com.amazonaws.lambda#ListAliasesResponse" +_Ali = "Aliases" +_LA = "ListAliases" +_UAI = "UpdateAliasInput" +_cUAR = "com.amazonaws.lambda#UpdateAliasRequest" +_UAO = "UpdateAliasOutput" +_UA = "UpdateAlias" +_LVBFI = "ListVersionsByFunctionInput" +_cLVBFR = "com.amazonaws.lambda#ListVersionsByFunctionRequest" +_LVBFO = "ListVersionsByFunctionOutput" +_cLVBFRo = "com.amazonaws.lambda#ListVersionsByFunctionResponse" +_Ve = "Versions" +_LVBF = "ListVersionsByFunction" +_PVI = "PublishVersionInput" +_cPVR = "com.amazonaws.lambda#PublishVersionRequest" +_PVO = "PublishVersionOutput" +_PVu = "PublishVersion" +_GASI = "GetAccountSettingsInput" +_cGASR = "com.amazonaws.lambda#GetAccountSettingsRequest" +_GASO = "GetAccountSettingsOutput" +_cGASRo = "com.amazonaws.lambda#GetAccountSettingsResponse" +_GAS = "GetAccountSettings" +_GFEICI = "GetFunctionEventInvokeConfigInput" +_cGFEICR = "com.amazonaws.lambda#GetFunctionEventInvokeConfigRequest" +_MEAIS = "MaximumEventAgeInSeconds" +_GFEICO = "GetFunctionEventInvokeConfigOutput" +_cFEIC = "com.amazonaws.lambda#FunctionEventInvokeConfig" +_GFEIC = "GetFunctionEventInvokeConfig" +_GRPI = "GetResourcePolicyInput" +_cGRPR = "com.amazonaws.lambda#GetResourcePolicyRequest" +_RP = "ResourcePolicy" +_GRPO = "GetResourcePolicyOutput" +_cGRPRo = "com.amazonaws.lambda#GetResourcePolicyResponse" +_GRP = "GetResourcePolicy" +_MLLI = "MaxLayerListItems" +_LLI = "ListLayersInput" +_cLLR = "com.amazonaws.lambda#ListLayersRequest" +_CAo = "CompatibleArchitecture" +_CR = "CompatibleRuntime" +_CAom = "CompatibleArchitectures" +_CRo = "CompatibleRuntimes" +_LI = "LicenseInfo" +_LVLI = "LayerVersionsListItem" +_CDr = "CreatedDate" +_LAa = "LayerArn" +_LLIa = "LayersListItem" +_LMV = "LatestMatchingVersion" +_LLa = "LayersList" +_LLO = "ListLayersOutput" +_cLLRo = "com.amazonaws.lambda#ListLayersResponse" +_LLi = "ListLayers" +_DLVI = "DeleteLayerVersionInput" +_cDLVR = "com.amazonaws.lambda#DeleteLayerVersionRequest" +_DLVO = "DeleteLayerVersionOutput" +_DLV = "DeleteLayerVersion" +_GLVI = "GetLayerVersionInput" +_cGLVR = "com.amazonaws.lambda#GetLayerVersionRequest" +_LVCO = "LayerVersionContentOutput" +_GLVO = "GetLayerVersionOutput" +_cGLVRo = "com.amazonaws.lambda#GetLayerVersionResponse" +_Cont = "Content" +_GLV = "GetLayerVersion" +_GLVBAI = "GetLayerVersionByArnInput" +_cGLVBAR = "com.amazonaws.lambda#GetLayerVersionByArnRequest" +_GLVBAO = "GetLayerVersionByArnOutput" +_GLVBA = "GetLayerVersionByArn" +_GLVPI = "GetLayerVersionPolicyInput" +_cGLVPR = "com.amazonaws.lambda#GetLayerVersionPolicyRequest" +_GLVPO = "GetLayerVersionPolicyOutput" +_cGLVPRo = "com.amazonaws.lambda#GetLayerVersionPolicyResponse" +_GLVP = "GetLayerVersionPolicy" +_LLVI = "ListLayerVersionsInput" +_cLLVR = "com.amazonaws.lambda#ListLayerVersionsRequest" +_LVL = "LayerVersionsList" +_LLVO = "ListLayerVersionsOutput" +_cLLVRo = "com.amazonaws.lambda#ListLayerVersionsResponse" +_LV = "LayerVersions" +_LLV = "ListLayerVersions" +_LVCI = "LayerVersionContentInput" +_PLVI = "PublishLayerVersionInput" +_cPLVR = "com.amazonaws.lambda#PublishLayerVersionRequest" +_PLVO = "PublishLayerVersionOutput" +_cPLVRo = "com.amazonaws.lambda#PublishLayerVersionResponse" +_PLV = "PublishLayerVersion" +_RLVPI = "RemoveLayerVersionPermissionInput" +_cRLVPR = "com.amazonaws.lambda#RemoveLayerVersionPermissionRequest" +_RLVPO = "RemoveLayerVersionPermissionOutput" +_RLVP = "RemoveLayerVersionPermission" +_MFEICLI = "MaxFunctionEventInvokeConfigListItems" +_LFEICI = "ListFunctionEventInvokeConfigsInput" +_cLFEICR = "com.amazonaws.lambda#ListFunctionEventInvokeConfigsRequest" +_FEIC = "FunctionEventInvokeConfig" +_FEICL = "FunctionEventInvokeConfigList" +_LFEICO = "ListFunctionEventInvokeConfigsOutput" +_cLFEICRo = "com.amazonaws.lambda#ListFunctionEventInvokeConfigsResponse" +_FEICu = "FunctionEventInvokeConfigs" +_LFEIC = "ListFunctionEventInvokeConfigs" +_TRa = "TaggableResource" +_LTI = "ListTagsInput" +_cLTR = "com.amazonaws.lambda#ListTagsRequest" +_Reso = "Resource" +_LTO = "ListTagsOutput" +_cLTRo = "com.amazonaws.lambda#ListTagsResponse" +_LTi = "ListTags" +_NSI = "NamespacedStatementId" +_RPI = "RemovePermissionInput" +_cRPR = "com.amazonaws.lambda#RemovePermissionRequest" +_RPO = "RemovePermissionOutput" +_RPe = "RemovePermission" +_DPCCI = "DeleteProvisionedConcurrencyConfigInput" +_cDPCCR = "com.amazonaws.lambda#DeleteProvisionedConcurrencyConfigRequest" +_DPCCO = "DeleteProvisionedConcurrencyConfigOutput" +_DPCC = "DeleteProvisionedConcurrencyConfig" +_GPCCI = "GetProvisionedConcurrencyConfigInput" +_cGPCCR = "com.amazonaws.lambda#GetProvisionedConcurrencyConfigRequest" +_GPCCO = "GetProvisionedConcurrencyConfigOutput" +_cGPCCRo = "com.amazonaws.lambda#GetProvisionedConcurrencyConfigResponse" +_PCCNFE = "ProvisionedConcurrencyConfigNotFoundException" +_GPCC = "GetProvisionedConcurrencyConfig" +_PPCCI = "PutProvisionedConcurrencyConfigInput" +_cPPCCR = "com.amazonaws.lambda#PutProvisionedConcurrencyConfigRequest" +_PCE = "ProvisionedConcurrentExecutions" +_PPCCO = "PutProvisionedConcurrencyConfigOutput" +_cPPCCRo = "com.amazonaws.lambda#PutProvisionedConcurrencyConfigResponse" +_PPCC = "PutProvisionedConcurrencyConfig" +_PFEICI = "PutFunctionEventInvokeConfigInput" +_cPFEICR = "com.amazonaws.lambda#PutFunctionEventInvokeConfigRequest" +_PFEICO = "PutFunctionEventInvokeConfigOutput" +_PFEIC = "PutFunctionEventInvokeConfig" +_PRPI = "PutResourcePolicyInput" +_cPRPR = "com.amazonaws.lambda#PutResourcePolicyRequest" +_PRPO = "PutResourcePolicyOutput" +_cPRPRo = "com.amazonaws.lambda#PutResourcePolicyResponse" +_PRP = "PutResourcePolicy" +_CTE = "CallbackTimeoutException" +_SDECFI = "SendDurableExecutionCallbackFailureInput" +_cSDECFR = "com.amazonaws.lambda#SendDurableExecutionCallbackFailureRequest" +_SDECFO = "SendDurableExecutionCallbackFailureOutput" +_cSDECFRo = "com.amazonaws.lambda#SendDurableExecutionCallbackFailureResponse" +_SDECF = "SendDurableExecutionCallbackFailure" +_SDECHI = "SendDurableExecutionCallbackHeartbeatInput" +_cSDECHR = "com.amazonaws.lambda#SendDurableExecutionCallbackHeartbeatRequest" +_SDECHO = "SendDurableExecutionCallbackHeartbeatOutput" +_cSDECHRo = "com.amazonaws.lambda#SendDurableExecutionCallbackHeartbeatResponse" +_SDECH = "SendDurableExecutionCallbackHeartbeat" +_BOP = "BinaryOperationPayload" +_SDECSI = "SendDurableExecutionCallbackSuccessInput" +_cSDECSR = "com.amazonaws.lambda#SendDurableExecutionCallbackSuccessRequest" +_SDECSO = "SendDurableExecutionCallbackSuccessOutput" +_cSDECSRo = "com.amazonaws.lambda#SendDurableExecutionCallbackSuccessResponse" +_SDECS = "SendDurableExecutionCallbackSuccess" +_TRI = "TagResourceInput" +_cTRR = "com.amazonaws.lambda#TagResourceRequest" +_TRO = "TagResourceOutput" +_TRag = "TagResource" +_TKL = "TagKeyList" +_sN = "smithy.api#xmlName" +_K = "Key" +_URIn = "UntagResourceInput" +_cURR = "com.amazonaws.lambda#UntagResourceRequest" +_TKa = "TagKeys" +_tK = "tagKeys" +_UROn = "UntagResourceOutput" +_UR = "UntagResource" +_UFEICI = "UpdateFunctionEventInvokeConfigInput" +_cUFEICR = "com.amazonaws.lambda#UpdateFunctionEventInvokeConfigRequest" +_UFEICO = "UpdateFunctionEventInvokeConfigOutput" +_UFEIC = "UpdateFunctionEventInvokeConfig" +_AWSGAS = "AWSGirApiService" +_aw = "aws.api#service" +_aws = "aws.auth#sigv4" +_sB = "smithy.rules#endpointBdd" +_aJ = "aws.protocols#restJson1" + +LONG: StaticSchema = (8, n0, _L, {_s: 0}) + +INTEGER: StaticSchema = (7, n0, _I, {_s: 0}) + +UNRESERVED_CONCURRENT_EXECUTIONS: StaticSchema = (7, n0, _UCE, 0) + +ACCOUNT_LIMIT: StaticSchema = ( + 18, + n0, + _AL, + 0, + (_TCS, _CSU, _CSZ, _CE, _UCE), + ( + (LONG, {_s: 0}), + (LONG, {_s: 0}), + (LONG, {_s: 0}), + (INTEGER, {_s: 0}), + (UNRESERVED_CONCURRENT_EXECUTIONS, 0), + ), ) -ACCOUNT_USAGE = Schema.collection( - id=ShapeID("com.amazonaws.lambda#AccountUsage"), - members={ - "TotalCodeSize": { - "target": LONG, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "FunctionCount": { - "target": LONG, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - }, +ACCOUNT_USAGE: StaticSchema = ( + 18, + n0, + _AU, + 0, + (_TCS, _FC), + ((LONG, {_s: 0}), (LONG, {_s: 0})), ) -ACTION = Schema(id=ShapeID("com.amazonaws.lambda#Action"), shape_type=ShapeType.STRING) - -ADDITIONAL_VERSION = Schema( - id=ShapeID("com.amazonaws.lambda#AdditionalVersion"), shape_type=ShapeType.STRING -) +ACTION: StaticSchema = (3, n0, _A, 0) -WEIGHT = Schema( - id=ShapeID("com.amazonaws.lambda#Weight"), - shape_type=ShapeType.DOUBLE, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=0)], -) +ADDITIONAL_VERSION: StaticSchema = (3, n0, _AV, 0) -ADDITIONAL_VERSION_WEIGHTS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#AdditionalVersionWeights"), - shape_type=ShapeType.MAP, - members={"key": {"target": ADDITIONAL_VERSION}, "value": {"target": WEIGHT}}, -) +WEIGHT: StaticSchema = (10, n0, _W, {_s: 0}) -LAYER_PERMISSION_ALLOWED_ACTION = Schema( - id=ShapeID("com.amazonaws.lambda#LayerPermissionAllowedAction"), - shape_type=ShapeType.STRING, +ADDITIONAL_VERSION_WEIGHTS: StaticSchema = ( + 17, + n0, + _AVW, + 0, + (_k, _v), + ((ADDITIONAL_VERSION, 0), (WEIGHT, 0)), ) -LAYER_NAME = Schema( - id=ShapeID("com.amazonaws.lambda#LayerName"), shape_type=ShapeType.STRING -) +LAYER_PERMISSION_ALLOWED_ACTION: StaticSchema = (3, n0, _LPAA, 0) -ORGANIZATION_ID = Schema( - id=ShapeID("com.amazonaws.lambda#OrganizationId"), shape_type=ShapeType.STRING -) +LAYER_NAME: StaticSchema = (3, n0, _LN, 0) -LAYER_PERMISSION_ALLOWED_PRINCIPAL = Schema( - id=ShapeID("com.amazonaws.lambda#LayerPermissionAllowedPrincipal"), - shape_type=ShapeType.STRING, -) +ORGANIZATION_ID: StaticSchema = (3, n0, _OI, 0) -STRING = Schema(id=ShapeID("com.amazonaws.lambda#String"), shape_type=ShapeType.STRING) +LAYER_PERMISSION_ALLOWED_PRINCIPAL: StaticSchema = (3, n0, _LPAP, 0) -STATEMENT_ID = Schema( - id=ShapeID("com.amazonaws.lambda#StatementId"), shape_type=ShapeType.STRING -) +STRING: StaticSchema = (3, n0, _S, 0) -LAYER_VERSION_NUMBER = Schema( - id=ShapeID("com.amazonaws.lambda#LayerVersionNumber"), - shape_type=ShapeType.LONG, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=0)], -) +STATEMENT_ID: StaticSchema = (3, n0, _SI, 0) -ADD_LAYER_VERSION_PERMISSION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#AddLayerVersionPermissionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#AddLayerVersionPermissionRequest", - ) - ], - members={ - "LayerName": { - "target": LAYER_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "VersionNumber": { - "target": LAYER_VERSION_NUMBER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=None), - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "StatementId": { - "target": STATEMENT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Action": { - "target": LAYER_PERMISSION_ALLOWED_ACTION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Principal": { - "target": LAYER_PERMISSION_ALLOWED_PRINCIPAL, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "OrganizationId": {"target": ORGANIZATION_ID}, - "RevisionId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="RevisionId") - ], - }, - }, -) +LAYER_VERSION_NUMBER: StaticSchema = (8, n0, _LVN, {_s: 0}) -ADD_LAYER_VERSION_PERMISSION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#AddLayerVersionPermissionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#AddLayerVersionPermissionResponse", - ) - ], - members={"Statement": {"target": STRING}, "RevisionId": {"target": STRING}}, -) - -INVALID_PARAMETER_VALUE_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"Type": {"target": STRING}, "message": {"target": STRING}}, -) - -POLICY_LENGTH_EXCEEDED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#PolicyLengthExceededException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"Type": {"target": STRING}, "message": {"target": STRING}}, -) - -PRECONDITION_FAILED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#PreconditionFailedException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=412), - ], - members={"Type": {"target": STRING}, "message": {"target": STRING}}, -) - -RESOURCE_CONFLICT_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ResourceConflictException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=409), - ], - members={"Type": {"target": STRING}, "message": {"target": STRING}}, -) - -RESOURCE_NOT_FOUND_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=404), - ], - members={"Type": {"target": STRING}, "Message": {"target": STRING}}, -) - -SERVICE_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ServiceException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="server"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=500), - ], - members={"Type": {"target": STRING}, "Message": {"target": STRING}}, -) - -THROTTLE_REASON = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ThrottleReason"), - shape_type=ShapeType.ENUM, - members={ - "ConcurrentInvocationLimitExceeded": {"target": UNIT}, - "FunctionInvocationRateLimitExceeded": {"target": UNIT}, - "ReservedFunctionConcurrentInvocationLimitExceeded": {"target": UNIT}, - "ReservedFunctionInvocationRateLimitExceeded": {"target": UNIT}, - "CallerRateLimitExceeded": {"target": UNIT}, - "ConcurrentSnapshotCreateLimitExceeded": {"target": UNIT}, - }, +ADD_LAYER_VERSION_PERMISSION_INPUT: StaticSchema = ( + 18, + n0, + _ALVPI, + {_sSI: _cALVPR, _sm: None}, + (_LN, _VN, _SI, _A, _P, _OI, _RI), + ( + (LAYER_NAME, 9), + (LAYER_VERSION_NUMBER, {_s: None, _smi: None, _sL: None}), + (STATEMENT_ID, 1), + (LAYER_PERMISSION_ALLOWED_ACTION, 1), + (LAYER_PERMISSION_ALLOWED_PRINCIPAL, 1), + (ORGANIZATION_ID, 0), + (STRING, {_sQ: _RI}), + ), ) -TOO_MANY_REQUESTS_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#TooManyRequestsException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=429), - ], - members={ - "retryAfterSeconds": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="Retry-After") - ], - }, - "Type": {"target": STRING}, - "message": {"target": STRING}, - "Reason": {"target": THROTTLE_REASON}, - }, +ADD_LAYER_VERSION_PERMISSION_OUTPUT: StaticSchema = ( + 18, + n0, + _ALVPO, + {_sSI: _cALVPRo, _smit: None}, + (_St, _RI), + ((STRING, 0), (STRING, 0)), +) + +INVALID_PARAMETER_VALUE_EXCEPTION: StaticSchema = ( + 18, + n0, + _IPVE, + {_smith: _c, _sE: 400}, + (_T, _m), + ((STRING, 0), (STRING, 0)), +) + +POLICY_LENGTH_EXCEEDED_EXCEPTION: StaticSchema = ( + 18, + n0, + _PLEE, + {_smith: _c, _sE: 400}, + (_T, _m), + ((STRING, 0), (STRING, 0)), +) + +PRECONDITION_FAILED_EXCEPTION: StaticSchema = ( + 18, + n0, + _PFE, + {_smith: _c, _sE: 412}, + (_T, _m), + ((STRING, 0), (STRING, 0)), +) + +RESOURCE_CONFLICT_EXCEPTION: StaticSchema = ( + 18, + n0, + _RCE, + {_smith: _c, _sE: 409}, + (_T, _m), + ((STRING, 0), (STRING, 0)), +) + +RESOURCE_NOT_FOUND_EXCEPTION: StaticSchema = ( + 18, + n0, + _RNFE, + {_smith: _c, _sE: 404}, + (_T, _M), + ((STRING, 0), (STRING, 0)), +) + +SERVICE_EXCEPTION: StaticSchema = ( + 18, + n0, + _SE, + {_smith: _se, _sE: 500}, + (_T, _M), + ((STRING, 0), (STRING, 0)), +) + +THROTTLE_REASON: StaticSchema = ( + 14, + n0, + _TR, + 0, + (_CILE, _FIRLE, _RFCILE, _RFIRLE, _CRLE, _CSCLE), + ( + (-1, {_sV: _CILE}), + (-1, {_sV: _FIRLE}), + (-1, {_sV: _RFCILE}), + (-1, {_sV: _RFIRLE}), + (-1, {_sV: _CRLE}), + (-1, {_sV: _CSCLE}), + ), ) -ADD_LAYER_VERSION_PERMISSION = Schema( - id=ShapeID("com.amazonaws.lambda#AddLayerVersionPermission"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/2018-10-31/layers/{LayerName}/versions/{VersionNumber}/policy", - "code": 201, - } - ), - ) - ], +TOO_MANY_REQUESTS_EXCEPTION: StaticSchema = ( + 18, + n0, + _TMRE, + {_smith: _c, _sE: 429}, + (_rAS, _T, _m, _R), + ((STRING, {_sH: _RA}), (STRING, 0), (STRING, 0), (THROTTLE_REASON, 0)), +) + +ADD_LAYER_VERSION_PERMISSION: StaticOperationSchema = ( + 23, + n0, + _ALVP, + { + _smithy: MappingProxyType( + { + "method": "POST", + "uri": "/2018-10-31/layers/{LayerName}/versions/{VersionNumber}/policy", + "code": 201, + } + ) + }, + ADD_LAYER_VERSION_PERMISSION_INPUT, + ADD_LAYER_VERSION_PERMISSION_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + POLICY_LENGTH_EXCEEDED_EXCEPTION, + PRECONDITION_FAILED_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -EVENT_SOURCE_TOKEN = Schema( - id=ShapeID("com.amazonaws.lambda#EventSourceToken"), shape_type=ShapeType.STRING -) +EVENT_SOURCE_TOKEN: StaticSchema = (3, n0, _EST, 0) -NAMESPACED_FUNCTION_NAME = Schema( - id=ShapeID("com.amazonaws.lambda#NamespacedFunctionName"), - shape_type=ShapeType.STRING, -) +NAMESPACED_FUNCTION_NAME: StaticSchema = (3, n0, _NFN, 0) -FUNCTION_URL_AUTH_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.lambda#FunctionUrlAuthType"), - shape_type=ShapeType.ENUM, - members={"NONE": {"target": UNIT}, "AWS_IAM": {"target": UNIT}}, +FUNCTION_URL_AUTH_TYPE: StaticSchema = ( + 14, + n0, + _FUAT, + 0, + (_NONE, _AI), + ((-1, {_sV: _NONE}), (-1, {_sV: _AI})), ) -INVOKED_VIA_FUNCTION_URL = Schema( - id=ShapeID("com.amazonaws.lambda#InvokedViaFunctionUrl"), - shape_type=ShapeType.BOOLEAN, -) +INVOKED_VIA_FUNCTION_URL: StaticSchema = (2, n0, _IVFU, 0) -PRINCIPAL = Schema( - id=ShapeID("com.amazonaws.lambda#Principal"), shape_type=ShapeType.STRING -) +PRINCIPAL: StaticSchema = (3, n0, _P, 0) -PRINCIPAL_ORG_ID = Schema( - id=ShapeID("com.amazonaws.lambda#PrincipalOrgID"), shape_type=ShapeType.STRING -) +PRINCIPAL_ORG_ID: StaticSchema = (3, n0, _POID, 0) -NUMERIC_LATEST_PUBLISHED_OR_ALIAS_QUALIFIER = Schema( - id=ShapeID("com.amazonaws.lambda#NumericLatestPublishedOrAliasQualifier"), - shape_type=ShapeType.STRING, -) +NUMERIC_LATEST_PUBLISHED_OR_ALIAS_QUALIFIER: StaticSchema = (3, n0, _NLPOAQ, 0) -SOURCE_OWNER = Schema( - id=ShapeID("com.amazonaws.lambda#SourceOwner"), shape_type=ShapeType.STRING -) +SOURCE_OWNER: StaticSchema = (3, n0, _SO, 0) -ARN = Schema(id=ShapeID("com.amazonaws.lambda#Arn"), shape_type=ShapeType.STRING) +ARN: StaticSchema = (3, n0, _Ar, 0) -ADD_PERMISSION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#AddPermissionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#AddPermissionRequest", - ) - ], - members={ - "FunctionName": { - "target": NAMESPACED_FUNCTION_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "StatementId": { - "target": STATEMENT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Action": { - "target": ACTION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Principal": { - "target": PRINCIPAL, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "SourceArn": {"target": ARN}, - "FunctionUrlAuthType": {"target": FUNCTION_URL_AUTH_TYPE}, - "InvokedViaFunctionUrl": {"target": INVOKED_VIA_FUNCTION_URL}, - "SourceAccount": {"target": SOURCE_OWNER}, - "EventSourceToken": {"target": EVENT_SOURCE_TOKEN}, - "Qualifier": { - "target": NUMERIC_LATEST_PUBLISHED_OR_ALIAS_QUALIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="Qualifier") - ], - }, - "RevisionId": {"target": STRING}, - "PrincipalOrgID": {"target": PRINCIPAL_ORG_ID}, - }, +ADD_PERMISSION_INPUT: StaticSchema = ( + 18, + n0, + _API, + {_sSI: _cAPR, _sm: None}, + (_FN, _SI, _A, _P, _SA, _FUAT, _IVFU, _SAo, _EST, _Q, _RI, _POID), + ( + (NAMESPACED_FUNCTION_NAME, 9), + (STATEMENT_ID, 1), + (ACTION, 1), + (PRINCIPAL, 1), + (ARN, 0), + (FUNCTION_URL_AUTH_TYPE, 0), + (INVOKED_VIA_FUNCTION_URL, 0), + (SOURCE_OWNER, 0), + (EVENT_SOURCE_TOKEN, 0), + (NUMERIC_LATEST_PUBLISHED_OR_ALIAS_QUALIFIER, {_sQ: _Q}), + (STRING, 0), + (PRINCIPAL_ORG_ID, 0), + ), ) -ADD_PERMISSION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#AddPermissionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#AddPermissionResponse", - ) - ], - members={"Statement": {"target": STRING}}, -) - -PUBLIC_POLICY_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#PublicPolicyException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"Type": {"target": STRING}, "Message": {"target": STRING}}, -) - -ADD_PERMISSION = Schema( - id=ShapeID("com.amazonaws.lambda#AddPermission"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/2015-03-31/functions/{FunctionName}/policy", - "code": 201, - } - ), - ) - ], +ADD_PERMISSION_OUTPUT: StaticSchema = ( + 18, + n0, + _APO, + {_sSI: _cAPRo, _smit: None}, + (_St,), + ((STRING, 0),), +) + +PUBLIC_POLICY_EXCEPTION: StaticSchema = ( + 18, + n0, + _PPE, + {_smith: _c, _sE: 400}, + (_T, _M), + ((STRING, 0), (STRING, 0)), +) + +ADD_PERMISSION: StaticOperationSchema = ( + 23, + n0, + _AP, + { + _smithy: MappingProxyType( + { + "method": "POST", + "uri": "/2015-03-31/functions/{FunctionName}/policy", + "code": 201, + } + ) + }, + ADD_PERMISSION_INPUT, + ADD_PERMISSION_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + POLICY_LENGTH_EXCEEDED_EXCEPTION, + PRECONDITION_FAILED_EXCEPTION, + PUBLIC_POLICY_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -ALIAS = Schema(id=ShapeID("com.amazonaws.lambda#Alias"), shape_type=ShapeType.STRING) +ALIAS: StaticSchema = (3, n0, _Al, 0) -FUNCTION_ARN = Schema( - id=ShapeID("com.amazonaws.lambda#FunctionArn"), shape_type=ShapeType.STRING -) +FUNCTION_ARN: StaticSchema = (3, n0, _FA, 0) -DESCRIPTION = Schema( - id=ShapeID("com.amazonaws.lambda#Description"), shape_type=ShapeType.STRING -) +DESCRIPTION: StaticSchema = (3, n0, _D, 0) -VERSION = Schema( - id=ShapeID("com.amazonaws.lambda#Version"), shape_type=ShapeType.STRING -) +VERSION: StaticSchema = (3, n0, _V, 0) -ALIAS_ROUTING_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#AliasRoutingConfiguration"), - members={"AdditionalVersionWeights": {"target": ADDITIONAL_VERSION_WEIGHTS}}, +ALIAS_ROUTING_CONFIGURATION: StaticSchema = ( + 18, + n0, + _ARC, + 0, + (_AVW,), + ((ADDITIONAL_VERSION_WEIGHTS, 0),), ) -ALIAS_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#AliasConfiguration"), - members={ - "AliasArn": {"target": FUNCTION_ARN}, - "Name": {"target": ALIAS}, - "FunctionVersion": {"target": VERSION}, - "Description": {"target": DESCRIPTION}, - "RoutingConfig": {"target": ALIAS_ROUTING_CONFIGURATION}, - "RevisionId": {"target": STRING}, - }, +ALIAS_CONFIGURATION: StaticSchema = ( + 18, + n0, + _AC, + 0, + (_AA, _N, _FV, _D, _RC, _RI), + ( + (FUNCTION_ARN, 0), + (ALIAS, 0), + (VERSION, 0), + (DESCRIPTION, 0), + (ALIAS_ROUTING_CONFIGURATION, 0), + (STRING, 0), + ), ) -ALIAS_LIMIT_EXCEEDED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#AliasLimitExceededException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"Type": {"target": STRING}, "message": {"target": STRING}}, +ALIAS_LIMIT_EXCEEDED_EXCEPTION: StaticSchema = ( + 18, + n0, + _ALEE, + {_smith: _c, _sE: 400}, + (_T, _m), + ((STRING, 0), (STRING, 0)), ) -ALIAS_LIST = Schema.collection( - id=ShapeID("com.amazonaws.lambda#AliasList"), - shape_type=ShapeType.LIST, - members={"member": {"target": ALIAS_CONFIGURATION}}, -) +ALIAS_LIST: StaticSchema = (16, n0, _ALl, 0, (_me,), ((ALIAS_CONFIGURATION, 0),)) -ALLOW_CREDENTIALS = Schema( - id=ShapeID("com.amazonaws.lambda#AllowCredentials"), shape_type=ShapeType.BOOLEAN -) +ALLOW_CREDENTIALS: StaticSchema = (2, n0, _ACl, 0) -SIGNING_PROFILE_VERSION_ARNS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#SigningProfileVersionArns"), - shape_type=ShapeType.LIST, - members={"member": {"target": ARN}}, -) +SIGNING_PROFILE_VERSION_ARNS: StaticSchema = (16, n0, _SPVA, 0, (_me,), ((ARN, 0),)) -ALLOWED_PUBLISHERS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#AllowedPublishers"), - members={ - "SigningProfileVersionArns": { - "target": SIGNING_PROFILE_VERSION_ARNS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +ALLOWED_PUBLISHERS: StaticSchema = ( + 18, + n0, + _APl, + 0, + (_SPVA,), + ((SIGNING_PROFILE_VERSION_ARNS, 1),), ) -METHOD = Schema(id=ShapeID("com.amazonaws.lambda#Method"), shape_type=ShapeType.STRING) +METHOD: StaticSchema = (3, n0, _Me, 0) -ALLOW_METHODS_LIST = Schema.collection( - id=ShapeID("com.amazonaws.lambda#AllowMethodsList"), - shape_type=ShapeType.LIST, - members={"member": {"target": METHOD}}, -) +ALLOW_METHODS_LIST: StaticSchema = (16, n0, _AML, 0, (_me,), ((METHOD, 0),)) -ORIGIN = Schema(id=ShapeID("com.amazonaws.lambda#Origin"), shape_type=ShapeType.STRING) +ORIGIN: StaticSchema = (3, n0, _O, 0) -ALLOW_ORIGINS_LIST = Schema.collection( - id=ShapeID("com.amazonaws.lambda#AllowOriginsList"), - shape_type=ShapeType.LIST, - members={"member": {"target": ORIGIN}}, -) +ALLOW_ORIGINS_LIST: StaticSchema = (16, n0, _AOL, 0, (_me,), ((ORIGIN, 0),)) -URI = Schema(id=ShapeID("com.amazonaws.lambda#URI"), shape_type=ShapeType.STRING) +URI: StaticSchema = (3, n0, _URI, 0) -KAFKA_SCHEMA_REGISTRY_AUTH_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.lambda#KafkaSchemaRegistryAuthType"), - shape_type=ShapeType.ENUM, - members={ - "BASIC_AUTH": {"target": UNIT}, - "CLIENT_CERTIFICATE_TLS_AUTH": {"target": UNIT}, - "SERVER_ROOT_CA_CERTIFICATE": {"target": UNIT}, - }, +KAFKA_SCHEMA_REGISTRY_AUTH_TYPE: StaticSchema = ( + 14, + n0, + _KSRAT, + 0, + (_BA, _CCTA, _SRCC), + ((-1, {_sV: _BA}), (-1, {_sV: _CCTA}), (-1, {_sV: _SRCC})), ) -KAFKA_SCHEMA_REGISTRY_ACCESS_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.lambda#KafkaSchemaRegistryAccessConfig"), - members={ - "Type": {"target": KAFKA_SCHEMA_REGISTRY_AUTH_TYPE}, - "URI": {"target": ARN}, - }, +KAFKA_SCHEMA_REGISTRY_ACCESS_CONFIG: StaticSchema = ( + 18, + n0, + _KSRAC, + 0, + (_T, _URI), + ((KAFKA_SCHEMA_REGISTRY_AUTH_TYPE, 0), (ARN, 0)), ) -KAFKA_SCHEMA_REGISTRY_ACCESS_CONFIG_LIST = Schema.collection( - id=ShapeID("com.amazonaws.lambda#KafkaSchemaRegistryAccessConfigList"), - shape_type=ShapeType.LIST, - members={"member": {"target": KAFKA_SCHEMA_REGISTRY_ACCESS_CONFIG}}, +KAFKA_SCHEMA_REGISTRY_ACCESS_CONFIG_LIST: StaticSchema = ( + 16, + n0, + _KSRACL, + 0, + (_me,), + ((KAFKA_SCHEMA_REGISTRY_ACCESS_CONFIG, 0),), ) -SCHEMA_REGISTRY_EVENT_RECORD_FORMAT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#SchemaRegistryEventRecordFormat"), - shape_type=ShapeType.ENUM, - members={"JSON": {"target": UNIT}, "SOURCE": {"target": UNIT}}, +SCHEMA_REGISTRY_EVENT_RECORD_FORMAT: StaticSchema = ( + 14, + n0, + _SRERF, + 0, + (_JSON, _SOURCE), + ((-1, {_sV: _JSON}), (-1, {_sV: _SOURCE})), ) -SCHEMA_REGISTRY_URI = Schema( - id=ShapeID("com.amazonaws.lambda#SchemaRegistryUri"), shape_type=ShapeType.STRING -) +SCHEMA_REGISTRY_URI: StaticSchema = (3, n0, _SRU, 0) -KAFKA_SCHEMA_VALIDATION_ATTRIBUTE = Schema.collection( - id=ShapeID("com.amazonaws.lambda#KafkaSchemaValidationAttribute"), - shape_type=ShapeType.ENUM, - members={"KEY": {"target": UNIT}, "VALUE": {"target": UNIT}}, +KAFKA_SCHEMA_VALIDATION_ATTRIBUTE: StaticSchema = ( + 14, + n0, + _KSVA, + 0, + (_KEY, _VALUE), + ((-1, {_sV: _KEY}), (-1, {_sV: _VALUE})), ) -KAFKA_SCHEMA_VALIDATION_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.lambda#KafkaSchemaValidationConfig"), - members={"Attribute": {"target": KAFKA_SCHEMA_VALIDATION_ATTRIBUTE}}, +KAFKA_SCHEMA_VALIDATION_CONFIG: StaticSchema = ( + 18, + n0, + _KSVC, + 0, + (_At,), + ((KAFKA_SCHEMA_VALIDATION_ATTRIBUTE, 0),), ) -KAFKA_SCHEMA_VALIDATION_CONFIG_LIST = Schema.collection( - id=ShapeID("com.amazonaws.lambda#KafkaSchemaValidationConfigList"), - shape_type=ShapeType.LIST, - members={"member": {"target": KAFKA_SCHEMA_VALIDATION_CONFIG}}, +KAFKA_SCHEMA_VALIDATION_CONFIG_LIST: StaticSchema = ( + 16, + n0, + _KSVCL, + 0, + (_me,), + ((KAFKA_SCHEMA_VALIDATION_CONFIG, 0),), ) -KAFKA_SCHEMA_REGISTRY_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.lambda#KafkaSchemaRegistryConfig"), - members={ - "SchemaRegistryURI": {"target": SCHEMA_REGISTRY_URI}, - "EventRecordFormat": {"target": SCHEMA_REGISTRY_EVENT_RECORD_FORMAT}, - "AccessConfigs": {"target": KAFKA_SCHEMA_REGISTRY_ACCESS_CONFIG_LIST}, - "SchemaValidationConfigs": {"target": KAFKA_SCHEMA_VALIDATION_CONFIG_LIST}, - }, +KAFKA_SCHEMA_REGISTRY_CONFIG: StaticSchema = ( + 18, + n0, + _KSRC, + 0, + (_SRURI, _ERF, _ACc, _SVC), + ( + (SCHEMA_REGISTRY_URI, 0), + (SCHEMA_REGISTRY_EVENT_RECORD_FORMAT, 0), + (KAFKA_SCHEMA_REGISTRY_ACCESS_CONFIG_LIST, 0), + (KAFKA_SCHEMA_VALIDATION_CONFIG_LIST, 0), + ), ) -AMAZON_MANAGED_KAFKA_EVENT_SOURCE_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.lambda#AmazonManagedKafkaEventSourceConfig"), - members={ - "ConsumerGroupId": {"target": URI}, - "SchemaRegistryConfig": {"target": KAFKA_SCHEMA_REGISTRY_CONFIG}, - }, +AMAZON_MANAGED_KAFKA_EVENT_SOURCE_CONFIG: StaticSchema = ( + 18, + n0, + _AMKESC, + 0, + (_CGI, _SRC), + ((URI, 0), (KAFKA_SCHEMA_REGISTRY_CONFIG, 0)), +) + +APPLICATION_LOG_LEVEL: StaticSchema = ( + 14, + n0, + _ALL, + 0, + (_Tr, _De, _In, _Wa, _E, _F), + ( + (-1, {_sV: _TRACE}), + (-1, {_sV: _DEBUG}), + (-1, {_sV: _INFO}), + (-1, {_sV: _WARN}), + (-1, {_sV: _ERROR}), + (-1, {_sV: _FATAL}), + ), ) -APPLICATION_LOG_LEVEL = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ApplicationLogLevel"), - shape_type=ShapeType.ENUM, - members={ - "Trace": {"target": UNIT}, - "Debug": {"target": UNIT}, - "Info": {"target": UNIT}, - "Warn": {"target": UNIT}, - "Error": {"target": UNIT}, - "Fatal": {"target": UNIT}, - }, +ARCHITECTURE: StaticSchema = ( + 14, + n0, + _Arc, + 0, + (_x, _a), + ((-1, {_sV: _x}), (-1, {_sV: _a})), ) -ARCHITECTURE = Schema.collection( - id=ShapeID("com.amazonaws.lambda#Architecture"), - shape_type=ShapeType.ENUM, - members={"x86_64": {"target": UNIT}, "arm64": {"target": UNIT}}, -) +ARCHITECTURES_LIST: StaticSchema = (16, n0, _ALr, 0, (_me,), ((ARCHITECTURE, 0),)) -ARCHITECTURES_LIST = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ArchitecturesList"), - shape_type=ShapeType.LIST, - members={"member": {"target": ARCHITECTURE}}, -) +ATTEMPT_COUNT: StaticSchema = (7, n0, _ACt, {_s: 0}) -ATTEMPT_COUNT = Schema( - id=ShapeID("com.amazonaws.lambda#AttemptCount"), - shape_type=ShapeType.INTEGER, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=0)], -) +CAPACITY_PROVIDER_NAME: StaticSchema = (3, n0, _CPN, 0) -CAPACITY_PROVIDER_NAME = Schema( - id=ShapeID("com.amazonaws.lambda#CapacityProviderName"), shape_type=ShapeType.STRING +CAPACITY_PROVIDER_LIMIT_EXCEEDED_EXCEPTION: StaticSchema = ( + 18, + n0, + _CPLEE, + {_smith: _c, _sE: 400}, + (_T, _m), + ((STRING, 0), (STRING, 0)), ) -CAPACITY_PROVIDER_LIMIT_EXCEEDED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#CapacityProviderLimitExceededException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"Type": {"target": STRING}, "message": {"target": STRING}}, -) +CAPACITY_PROVIDER_MAX_V_CPU_COUNT: StaticSchema = (7, n0, _CPMVCC, 0) -CAPACITY_PROVIDER_MAX_V_CPU_COUNT = Schema( - id=ShapeID("com.amazonaws.lambda#CapacityProviderMaxVCpuCount"), - shape_type=ShapeType.INTEGER, +CAPACITY_PROVIDER_SCALING_MODE: StaticSchema = ( + 14, + n0, + _CPSM, + 0, + (_Au, _Ma), + ((-1, {_sV: _Au}), (-1, {_sV: _Ma})), ) -CAPACITY_PROVIDER_SCALING_MODE = Schema.collection( - id=ShapeID("com.amazonaws.lambda#CapacityProviderScalingMode"), - shape_type=ShapeType.ENUM, - members={"Auto": {"target": UNIT}, "Manual": {"target": UNIT}}, +CAPACITY_PROVIDER_PREDEFINED_METRIC_TYPE: StaticSchema = ( + 14, + n0, + _CPPMT, + 0, + (_LCPACPUU,), + ((-1, {_sV: _LCPACPUU}),), ) -CAPACITY_PROVIDER_PREDEFINED_METRIC_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.lambda#CapacityProviderPredefinedMetricType"), - shape_type=ShapeType.ENUM, - members={"LambdaCapacityProviderAverageCPUUtilization": {"target": UNIT}}, -) +METRIC_TARGET_VALUE: StaticSchema = (10, n0, _MTV, 0) -METRIC_TARGET_VALUE = Schema( - id=ShapeID("com.amazonaws.lambda#MetricTargetValue"), shape_type=ShapeType.DOUBLE +TARGET_TRACKING_SCALING_POLICY: StaticSchema = ( + 18, + n0, + _TTSP, + 0, + (_PMT, _TV), + ((CAPACITY_PROVIDER_PREDEFINED_METRIC_TYPE, 1), (METRIC_TARGET_VALUE, 1)), ) -TARGET_TRACKING_SCALING_POLICY = Schema.collection( - id=ShapeID("com.amazonaws.lambda#TargetTrackingScalingPolicy"), - members={ - "PredefinedMetricType": { - "target": CAPACITY_PROVIDER_PREDEFINED_METRIC_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "TargetValue": { - "target": METRIC_TARGET_VALUE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +CAPACITY_PROVIDER_SCALING_POLICIES_LIST: StaticSchema = ( + 16, + n0, + _CPSPL, + 0, + (_me,), + ((TARGET_TRACKING_SCALING_POLICY, 0),), ) -CAPACITY_PROVIDER_SCALING_POLICIES_LIST = Schema.collection( - id=ShapeID("com.amazonaws.lambda#CapacityProviderScalingPoliciesList"), - shape_type=ShapeType.LIST, - members={"member": {"target": TARGET_TRACKING_SCALING_POLICY}}, +CAPACITY_PROVIDER_SCALING_CONFIG: StaticSchema = ( + 18, + n0, + _CPSC, + 0, + (_MVCC, _SM, _SP), + ( + (CAPACITY_PROVIDER_MAX_V_CPU_COUNT, 0), + (CAPACITY_PROVIDER_SCALING_MODE, 0), + (CAPACITY_PROVIDER_SCALING_POLICIES_LIST, 0), + ), ) -CAPACITY_PROVIDER_SCALING_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.lambda#CapacityProviderScalingConfig"), - members={ - "MaxVCpuCount": {"target": CAPACITY_PROVIDER_MAX_V_CPU_COUNT}, - "ScalingMode": {"target": CAPACITY_PROVIDER_SCALING_MODE}, - "ScalingPolicies": {"target": CAPACITY_PROVIDER_SCALING_POLICIES_LIST}, - }, -) +INSTANCE_TYPE: StaticSchema = (3, n0, _IT, 0) -INSTANCE_TYPE = Schema( - id=ShapeID("com.amazonaws.lambda#InstanceType"), shape_type=ShapeType.STRING -) +INSTANCE_TYPE_SET: StaticSchema = (16, n0, _ITS, 0, (_me,), ((INSTANCE_TYPE, 0),)) -INSTANCE_TYPE_SET = Schema.collection( - id=ShapeID("com.amazonaws.lambda#InstanceTypeSet"), - shape_type=ShapeType.LIST, - members={"member": {"target": INSTANCE_TYPE}}, +INSTANCE_REQUIREMENTS: StaticSchema = ( + 18, + n0, + _IR, + 0, + (_Arch, _AIT, _EIT), + ((ARCHITECTURES_LIST, 0), (INSTANCE_TYPE_SET, 0), (INSTANCE_TYPE_SET, 0)), ) -INSTANCE_REQUIREMENTS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#InstanceRequirements"), - members={ - "Architectures": {"target": ARCHITECTURES_LIST}, - "AllowedInstanceTypes": {"target": INSTANCE_TYPE_SET}, - "ExcludedInstanceTypes": {"target": INSTANCE_TYPE_SET}, - }, -) +KMS_KEY_ARN_NON_EMPTY: StaticSchema = (3, n0, _KMSKANE, 0) -KMS_KEY_ARN_NON_EMPTY = Schema( - id=ShapeID("com.amazonaws.lambda#KMSKeyArnNonEmpty"), shape_type=ShapeType.STRING -) +ROLE_ARN: StaticSchema = (3, n0, _RAo, 0) -ROLE_ARN = Schema( - id=ShapeID("com.amazonaws.lambda#RoleArn"), shape_type=ShapeType.STRING +CAPACITY_PROVIDER_PERMISSIONS_CONFIG: StaticSchema = ( + 18, + n0, + _CPPC, + 0, + (_CPORA,), + ((ROLE_ARN, 1),), ) -CAPACITY_PROVIDER_PERMISSIONS_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.lambda#CapacityProviderPermissionsConfig"), - members={ - "CapacityProviderOperatorRoleArn": { - "target": ROLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +TAG_KEY: StaticSchema = (3, n0, _TK, 0) -TAG_KEY = Schema(id=ShapeID("com.amazonaws.lambda#TagKey"), shape_type=ShapeType.STRING) +TAG_VALUE: StaticSchema = (3, n0, _TVa, 0) -TAG_VALUE = Schema( - id=ShapeID("com.amazonaws.lambda#TagValue"), shape_type=ShapeType.STRING -) +TAGS: StaticSchema = (17, n0, _Ta, 0, (_k, _v), ((TAG_KEY, 0), (TAG_VALUE, 0))) -TAGS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#Tags"), - shape_type=ShapeType.MAP, - members={"key": {"target": TAG_KEY}, "value": {"target": TAG_VALUE}}, +PROPAGATE_TAGS_MODE: StaticSchema = ( + 14, + n0, + _PTM, + 0, + (_No, _Ex), + ((-1, {_sV: _No}), (-1, {_sV: _Ex})), ) -PROPAGATE_TAGS_MODE = Schema.collection( - id=ShapeID("com.amazonaws.lambda#PropagateTagsMode"), - shape_type=ShapeType.ENUM, - members={"None": {"target": UNIT}, "Explicit": {"target": UNIT}}, +PROPAGATE_TAGS: StaticSchema = ( + 18, + n0, + _PT, + 0, + (_Mo, _ET), + ((PROPAGATE_TAGS_MODE, 0), (TAGS, 0)), ) -PROPAGATE_TAGS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#PropagateTags"), - members={"Mode": {"target": PROPAGATE_TAGS_MODE}, "ExplicitTags": {"target": TAGS}}, -) +LOG_GROUP: StaticSchema = (3, n0, _LG, 0) -LOG_GROUP = Schema( - id=ShapeID("com.amazonaws.lambda#LogGroup"), shape_type=ShapeType.STRING +SYSTEM_LOG_LEVEL: StaticSchema = ( + 14, + n0, + _SLL, + 0, + (_De, _In, _Wa), + ((-1, {_sV: _DEBUG}), (-1, {_sV: _INFO}), (-1, {_sV: _WARN})), ) -SYSTEM_LOG_LEVEL = Schema.collection( - id=ShapeID("com.amazonaws.lambda#SystemLogLevel"), - shape_type=ShapeType.ENUM, - members={ - "Debug": {"target": UNIT}, - "Info": {"target": UNIT}, - "Warn": {"target": UNIT}, - }, +CAPACITY_PROVIDER_LOGGING_CONFIG: StaticSchema = ( + 18, + n0, + _CPLC, + 0, + (_SLL, _LG), + ((SYSTEM_LOG_LEVEL, 0), (LOG_GROUP, 0)), ) -CAPACITY_PROVIDER_LOGGING_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.lambda#CapacityProviderLoggingConfig"), - members={ - "SystemLogLevel": {"target": SYSTEM_LOG_LEVEL}, - "LogGroup": {"target": LOG_GROUP}, - }, +CAPACITY_PROVIDER_TELEMETRY_CONFIG: StaticSchema = ( + 18, + n0, + _CPTC, + 0, + (_LC,), + ((CAPACITY_PROVIDER_LOGGING_CONFIG, 0),), ) -CAPACITY_PROVIDER_TELEMETRY_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.lambda#CapacityProviderTelemetryConfig"), - members={"LoggingConfig": {"target": CAPACITY_PROVIDER_LOGGING_CONFIG}}, -) +SECURITY_GROUP_ID: StaticSchema = (3, n0, _SGI, 0) -SECURITY_GROUP_ID = Schema( - id=ShapeID("com.amazonaws.lambda#SecurityGroupId"), shape_type=ShapeType.STRING +CAPACITY_PROVIDER_SECURITY_GROUP_IDS: StaticSchema = ( + 16, + n0, + _CPSGI, + 0, + (_me,), + ((SECURITY_GROUP_ID, 0),), ) -CAPACITY_PROVIDER_SECURITY_GROUP_IDS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#CapacityProviderSecurityGroupIds"), - shape_type=ShapeType.LIST, - members={"member": {"target": SECURITY_GROUP_ID}}, -) +SUBNET_ID: StaticSchema = (3, n0, _SIu, 0) -SUBNET_ID = Schema( - id=ShapeID("com.amazonaws.lambda#SubnetId"), shape_type=ShapeType.STRING +CAPACITY_PROVIDER_SUBNET_IDS: StaticSchema = ( + 16, + n0, + _CPSI, + 0, + (_me,), + ((SUBNET_ID, 0),), ) - -CAPACITY_PROVIDER_SUBNET_IDS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#CapacityProviderSubnetIds"), - shape_type=ShapeType.LIST, - members={"member": {"target": SUBNET_ID}}, + +CAPACITY_PROVIDER_VPC_CONFIG: StaticSchema = ( + 18, + n0, + _CPVC, + 0, + (_SIub, _SGIe), + ((CAPACITY_PROVIDER_SUBNET_IDS, 1), (CAPACITY_PROVIDER_SECURITY_GROUP_IDS, 1)), +) + +CREATE_CAPACITY_PROVIDER_INPUT: StaticSchema = ( + 18, + n0, + _CCPI, + {_sSI: _cCCPR, _sm: None}, + (_CPN, _VC, _PC, _IR, _CPSC, _KKA, _Ta, _PT, _TC), + ( + (CAPACITY_PROVIDER_NAME, 1), + (CAPACITY_PROVIDER_VPC_CONFIG, 1), + (CAPACITY_PROVIDER_PERMISSIONS_CONFIG, 1), + (INSTANCE_REQUIREMENTS, 0), + (CAPACITY_PROVIDER_SCALING_CONFIG, 0), + (KMS_KEY_ARN_NON_EMPTY, 0), + (TAGS, 0), + (PROPAGATE_TAGS, 0), + (CAPACITY_PROVIDER_TELEMETRY_CONFIG, 0), + ), ) -CAPACITY_PROVIDER_VPC_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.lambda#CapacityProviderVpcConfig"), - members={ - "SubnetIds": { - "target": CAPACITY_PROVIDER_SUBNET_IDS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "SecurityGroupIds": { - "target": CAPACITY_PROVIDER_SECURITY_GROUP_IDS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +CAPACITY_PROVIDER_ARN: StaticSchema = (3, n0, _CPA, 0) + +KMS_KEY_ARN: StaticSchema = (3, n0, _KMSKA, 0) + +TIMESTAMP: StaticSchema = (3, n0, _Ti, 0) + +CAPACITY_PROVIDER_STATE: StaticSchema = ( + 14, + n0, + _CPS, + 0, + (_Pe, _Ac, _Fa, _Del), + ((-1, {_sV: _Pe}), (-1, {_sV: _Ac}), (-1, {_sV: _Fa}), (-1, {_sV: _Del})), +) + +CAPACITY_PROVIDER: StaticSchema = ( + 18, + n0, + _CP, + 0, + (_CPA, _Sta, _VC, _PC, _IR, _CPSC, _KKA, _LM, _PT, _TC), + ( + (CAPACITY_PROVIDER_ARN, 1), + (CAPACITY_PROVIDER_STATE, 1), + (CAPACITY_PROVIDER_VPC_CONFIG, 1), + (CAPACITY_PROVIDER_PERMISSIONS_CONFIG, 1), + (INSTANCE_REQUIREMENTS, 0), + (CAPACITY_PROVIDER_SCALING_CONFIG, 0), + (KMS_KEY_ARN, 0), + (TIMESTAMP, 0), + (PROPAGATE_TAGS, 0), + (CAPACITY_PROVIDER_TELEMETRY_CONFIG, 0), + ), ) -CREATE_CAPACITY_PROVIDER_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#CreateCapacityProviderInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#CreateCapacityProviderRequest", - ) - ], - members={ - "CapacityProviderName": { - "target": CAPACITY_PROVIDER_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "VpcConfig": { - "target": CAPACITY_PROVIDER_VPC_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "PermissionsConfig": { - "target": CAPACITY_PROVIDER_PERMISSIONS_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "InstanceRequirements": {"target": INSTANCE_REQUIREMENTS}, - "CapacityProviderScalingConfig": {"target": CAPACITY_PROVIDER_SCALING_CONFIG}, - "KmsKeyArn": {"target": KMS_KEY_ARN_NON_EMPTY}, - "Tags": {"target": TAGS}, - "PropagateTags": {"target": PROPAGATE_TAGS}, - "TelemetryConfig": {"target": CAPACITY_PROVIDER_TELEMETRY_CONFIG}, - }, +CREATE_CAPACITY_PROVIDER_OUTPUT: StaticSchema = ( + 18, + n0, + _CCPO, + {_sSI: _cCCPRo, _smit: None}, + (_CP,), + ((CAPACITY_PROVIDER, 1),), +) + +CREATE_CAPACITY_PROVIDER: StaticOperationSchema = ( + 23, + n0, + _CCP, + { + _smithy: MappingProxyType( + {"method": "POST", "uri": "/2025-11-30/capacity-providers", "code": 202} + ) + }, + CREATE_CAPACITY_PROVIDER_INPUT, + CREATE_CAPACITY_PROVIDER_OUTPUT, + ( + CAPACITY_PROVIDER_LIMIT_EXCEEDED_EXCEPTION, + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -CAPACITY_PROVIDER_ARN = Schema( - id=ShapeID("com.amazonaws.lambda#CapacityProviderArn"), shape_type=ShapeType.STRING +DELETE_CAPACITY_PROVIDER_INPUT: StaticSchema = ( + 18, + n0, + _DCPI, + {_sSI: _cDCPR, _sm: None}, + (_CPN,), + ((CAPACITY_PROVIDER_NAME, 9),), +) + +DELETE_CAPACITY_PROVIDER_OUTPUT: StaticSchema = ( + 18, + n0, + _DCPO, + {_sSI: _cDCPRo, _smit: None}, + (_CP,), + ((CAPACITY_PROVIDER, 1),), +) + +DELETE_CAPACITY_PROVIDER: StaticOperationSchema = ( + 23, + n0, + _DCP, + { + _smithy: MappingProxyType( + { + "method": "DELETE", + "uri": "/2025-11-30/capacity-providers/{CapacityProviderName}", + "code": 202, + } + ) + }, + DELETE_CAPACITY_PROVIDER_INPUT, + DELETE_CAPACITY_PROVIDER_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -KMS_KEY_ARN = Schema( - id=ShapeID("com.amazonaws.lambda#KMSKeyArn"), shape_type=ShapeType.STRING +GET_CAPACITY_PROVIDER_INPUT: StaticSchema = ( + 18, + n0, + _GCPI, + {_sSI: _cGCPR, _sm: None}, + (_CPN,), + ((CAPACITY_PROVIDER_NAME, 9),), +) + +GET_CAPACITY_PROVIDER_OUTPUT: StaticSchema = ( + 18, + n0, + _GCPO, + {_sSI: _cGCPRo, _smit: None}, + (_CP,), + ((CAPACITY_PROVIDER, 1),), +) + +GET_CAPACITY_PROVIDER: StaticOperationSchema = ( + 23, + n0, + _GCP, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/2025-11-30/capacity-providers/{CapacityProviderName}", + "code": 200, + } + ) + }, + GET_CAPACITY_PROVIDER_INPUT, + GET_CAPACITY_PROVIDER_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -TIMESTAMP = Schema( - id=ShapeID("com.amazonaws.lambda#Timestamp"), shape_type=ShapeType.STRING -) +MAX_FIFTY_LIST_ITEMS: StaticSchema = (7, n0, _MFLI, 0) -CAPACITY_PROVIDER_STATE = Schema.collection( - id=ShapeID("com.amazonaws.lambda#CapacityProviderState"), - shape_type=ShapeType.ENUM, - members={ - "Pending": {"target": UNIT}, - "Active": {"target": UNIT}, - "Failed": {"target": UNIT}, - "Deleting": {"target": UNIT}, - }, +LIST_CAPACITY_PROVIDERS_INPUT: StaticSchema = ( + 18, + n0, + _LCPI, + {_sSI: _cLCPR, _sm: None}, + (_Sta, _Mar, _MI), + ( + (CAPACITY_PROVIDER_STATE, {_sQ: _Sta}), + (STRING, {_sQ: _Mar}), + (MAX_FIFTY_LIST_ITEMS, {_sQ: _MI}), + ), ) -CAPACITY_PROVIDER = Schema.collection( - id=ShapeID("com.amazonaws.lambda#CapacityProvider"), - members={ - "CapacityProviderArn": { - "target": CAPACITY_PROVIDER_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "State": { - "target": CAPACITY_PROVIDER_STATE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "VpcConfig": { - "target": CAPACITY_PROVIDER_VPC_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "PermissionsConfig": { - "target": CAPACITY_PROVIDER_PERMISSIONS_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "InstanceRequirements": {"target": INSTANCE_REQUIREMENTS}, - "CapacityProviderScalingConfig": {"target": CAPACITY_PROVIDER_SCALING_CONFIG}, - "KmsKeyArn": {"target": KMS_KEY_ARN}, - "LastModified": {"target": TIMESTAMP}, - "PropagateTags": {"target": PROPAGATE_TAGS}, - "TelemetryConfig": {"target": CAPACITY_PROVIDER_TELEMETRY_CONFIG}, - }, +CAPACITY_PROVIDERS_LIST: StaticSchema = ( + 16, + n0, + _CPL, + 0, + (_me,), + ((CAPACITY_PROVIDER, 0),), +) + +LIST_CAPACITY_PROVIDERS_OUTPUT: StaticSchema = ( + 18, + n0, + _LCPO, + {_sSI: _cLCPRo, _smit: None}, + (_CPa, _NM), + ((CAPACITY_PROVIDERS_LIST, 1), (STRING, 0)), +) + +LIST_CAPACITY_PROVIDERS: StaticOperationSchema = ( + 23, + n0, + _LCP, + { + _smithy: MappingProxyType( + {"method": "GET", "uri": "/2025-11-30/capacity-providers", "code": 200} + ) + }, + LIST_CAPACITY_PROVIDERS_INPUT, + LIST_CAPACITY_PROVIDERS_OUTPUT, + (INVALID_PARAMETER_VALUE_EXCEPTION, SERVICE_EXCEPTION, TOO_MANY_REQUESTS_EXCEPTION), +) + +LIST_FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER_INPUT: StaticSchema = ( + 18, + n0, + _LFVBCPI, + {_sSI: _cLFVBCPR, _sm: None}, + (_CPN, _Mar, _MI), + ( + (CAPACITY_PROVIDER_NAME, 9), + (STRING, {_sQ: _Mar}), + (MAX_FIFTY_LIST_ITEMS, {_sQ: _MI}), + ), ) -CREATE_CAPACITY_PROVIDER_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#CreateCapacityProviderOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#CreateCapacityProviderResponse", - ) - ], - members={ - "CapacityProvider": { - "target": CAPACITY_PROVIDER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +NAME_SPACED_FUNCTION_ARN: StaticSchema = (3, n0, _NSFA, 0) + +STATE: StaticSchema = ( + 14, + n0, + _Sta, + 0, + (_Pe, _Ac, _Ina, _Fa, _Dea, _Deac, _ANI, _Del), + ( + (-1, {_sV: _Pe}), + (-1, {_sV: _Ac}), + (-1, {_sV: _Ina}), + (-1, {_sV: _Fa}), + (-1, {_sV: _Dea}), + (-1, {_sV: _Deac}), + (-1, {_sV: _ANI}), + (-1, {_sV: _Del}), + ), ) -CREATE_CAPACITY_PROVIDER = Schema( - id=ShapeID("com.amazonaws.lambda#CreateCapacityProvider"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/2025-11-30/capacity-providers", "code": 202} - ), - ) - ], +FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER_LIST_ITEM: StaticSchema = ( + 18, + n0, + _FVBCPLI, + 0, + (_FA, _Sta), + ((NAME_SPACED_FUNCTION_ARN, 1), (STATE, 1)), +) + +FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER_LIST: StaticSchema = ( + 16, + n0, + _FVBCPL, + 0, + (_me,), + ((FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER_LIST_ITEM, 0),), +) + +LIST_FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER_OUTPUT: StaticSchema = ( + 18, + n0, + _LFVBCPO, + {_sSI: _cLFVBCPRo, _smit: None}, + (_CPA, _FVu, _NM), + ( + (CAPACITY_PROVIDER_ARN, 1), + (FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER_LIST, 1), + (STRING, 0), + ), ) -DELETE_CAPACITY_PROVIDER_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#DeleteCapacityProviderInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#DeleteCapacityProviderRequest", - ) - ], - members={ - "CapacityProviderName": { - "target": CAPACITY_PROVIDER_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, +LIST_FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER: StaticOperationSchema = ( + 23, + n0, + _LFVBCP, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/2025-11-30/capacity-providers/{CapacityProviderName}/function-versions", + "code": 200, + } + ) + }, + LIST_FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER_INPUT, + LIST_FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -DELETE_CAPACITY_PROVIDER_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#DeleteCapacityProviderOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#DeleteCapacityProviderResponse", - ) - ], - members={ - "CapacityProvider": { - "target": CAPACITY_PROVIDER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +UPDATE_CAPACITY_PROVIDER_INPUT: StaticSchema = ( + 18, + n0, + _UCPI, + {_sSI: _cUCPR, _sm: None}, + (_CPN, _CPSC, _PT, _TC), + ( + (CAPACITY_PROVIDER_NAME, 9), + (CAPACITY_PROVIDER_SCALING_CONFIG, 0), + (PROPAGATE_TAGS, 0), + (CAPACITY_PROVIDER_TELEMETRY_CONFIG, 0), + ), ) -DELETE_CAPACITY_PROVIDER = Schema( - id=ShapeID("com.amazonaws.lambda#DeleteCapacityProvider"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/2025-11-30/capacity-providers/{CapacityProviderName}", - "code": 202, - } - ), - ) - ], +UPDATE_CAPACITY_PROVIDER_OUTPUT: StaticSchema = ( + 18, + n0, + _UCPO, + {_sSI: _cUCPRo, _smit: None}, + (_CP,), + ((CAPACITY_PROVIDER, 1),), +) + +UPDATE_CAPACITY_PROVIDER: StaticOperationSchema = ( + 23, + n0, + _UCP, + { + _smithy: MappingProxyType( + { + "method": "PUT", + "uri": "/2025-11-30/capacity-providers/{CapacityProviderName}", + "code": 202, + } + ) + }, + UPDATE_CAPACITY_PROVIDER_INPUT, + UPDATE_CAPACITY_PROVIDER_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -GET_CAPACITY_PROVIDER_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#GetCapacityProviderInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#GetCapacityProviderRequest", - ) - ], - members={ - "CapacityProviderName": { - "target": CAPACITY_PROVIDER_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, +CODE_SIGNING_CONFIG_ID: StaticSchema = (3, n0, _CSCI, 0) + +CODE_SIGNING_POLICY: StaticSchema = ( + 14, + n0, + _CSP, + 0, + (_Wa, _En), + ((-1, {_sV: _Wa}), (-1, {_sV: _En})), +) + +CODE_SIGNING_POLICIES: StaticSchema = ( + 18, + n0, + _CSPo, + 0, + (_UAOD,), + ((CODE_SIGNING_POLICY, 0),), +) + +CREATE_CODE_SIGNING_CONFIG_INPUT: StaticSchema = ( + 18, + n0, + _CCSCI, + {_sSI: _cCCSCR, _sm: None}, + (_D, _APl, _CSPo, _Ta), + ((DESCRIPTION, 0), (ALLOWED_PUBLISHERS, 1), (CODE_SIGNING_POLICIES, 0), (TAGS, 0)), +) + +CODE_SIGNING_CONFIG_ARN: StaticSchema = (3, n0, _CSCA, 0) + +CODE_SIGNING_CONFIG: StaticSchema = ( + 18, + n0, + _CSC, + 0, + (_CSCI, _CSCA, _D, _APl, _CSPo, _LM), + ( + (CODE_SIGNING_CONFIG_ID, 1), + (CODE_SIGNING_CONFIG_ARN, 1), + (DESCRIPTION, 0), + (ALLOWED_PUBLISHERS, 1), + (CODE_SIGNING_POLICIES, 1), + (TIMESTAMP, 1), + ), ) -GET_CAPACITY_PROVIDER_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#GetCapacityProviderOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#GetCapacityProviderResponse", - ) - ], - members={ - "CapacityProvider": { - "target": CAPACITY_PROVIDER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +CREATE_CODE_SIGNING_CONFIG_OUTPUT: StaticSchema = ( + 18, + n0, + _CCSCO, + {_sSI: _cCCSCRo, _smit: None}, + (_CSC,), + ((CODE_SIGNING_CONFIG, 1),), +) + +CREATE_CODE_SIGNING_CONFIG: StaticOperationSchema = ( + 23, + n0, + _CCSC, + { + _smithy: MappingProxyType( + {"method": "POST", "uri": "/2020-04-22/code-signing-configs", "code": 201} + ) + }, + CREATE_CODE_SIGNING_CONFIG_INPUT, + CREATE_CODE_SIGNING_CONFIG_OUTPUT, + (INVALID_PARAMETER_VALUE_EXCEPTION, SERVICE_EXCEPTION), +) + +DELETE_CODE_SIGNING_CONFIG_INPUT: StaticSchema = ( + 18, + n0, + _DCSCI, + {_sSI: _cDCSCR, _sm: None}, + (_CSCA,), + ((CODE_SIGNING_CONFIG_ARN, 9),), +) + +DELETE_CODE_SIGNING_CONFIG_OUTPUT: StaticSchema = ( + 18, + n0, + _DCSCO, + {_sSI: _cDCSCRo, _smit: None}, +) + +DELETE_CODE_SIGNING_CONFIG: StaticOperationSchema = ( + 23, + n0, + _DCSC, + { + _smithy: MappingProxyType( + { + "method": "DELETE", + "uri": "/2020-04-22/code-signing-configs/{CodeSigningConfigArn}", + "code": 204, + } + ) + }, + DELETE_CODE_SIGNING_CONFIG_INPUT, + DELETE_CODE_SIGNING_CONFIG_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + ), ) -GET_CAPACITY_PROVIDER = Schema( - id=ShapeID("com.amazonaws.lambda#GetCapacityProvider"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/2025-11-30/capacity-providers/{CapacityProviderName}", - "code": 200, - } - ), - ) - ], +GET_CODE_SIGNING_CONFIG_INPUT: StaticSchema = ( + 18, + n0, + _GCSCI, + {_sSI: _cGCSCR, _sm: None}, + (_CSCA,), + ((CODE_SIGNING_CONFIG_ARN, 9),), +) + +GET_CODE_SIGNING_CONFIG_OUTPUT: StaticSchema = ( + 18, + n0, + _GCSCO, + {_sSI: _cGCSCRo, _smit: None}, + (_CSC,), + ((CODE_SIGNING_CONFIG, 1),), +) + +GET_CODE_SIGNING_CONFIG: StaticOperationSchema = ( + 23, + n0, + _GCSC, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/2020-04-22/code-signing-configs/{CodeSigningConfigArn}", + "code": 200, + } + ) + }, + GET_CODE_SIGNING_CONFIG_INPUT, + GET_CODE_SIGNING_CONFIG_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + ), ) -MAX_FIFTY_LIST_ITEMS = Schema( - id=ShapeID("com.amazonaws.lambda#MaxFiftyListItems"), shape_type=ShapeType.INTEGER +MAX_LIST_ITEMS: StaticSchema = (7, n0, _MLI, 0) + +LIST_CODE_SIGNING_CONFIGS_INPUT: StaticSchema = ( + 18, + n0, + _LCSCI, + {_sSI: _cLCSCR, _sm: None}, + (_Mar, _MI), + ((STRING, {_sQ: _Mar}), (MAX_LIST_ITEMS, {_sQ: _MI})), +) + +CODE_SIGNING_CONFIG_LIST: StaticSchema = ( + 16, + n0, + _CSCL, + 0, + (_me,), + ((CODE_SIGNING_CONFIG, 0),), +) + +LIST_CODE_SIGNING_CONFIGS_OUTPUT: StaticSchema = ( + 18, + n0, + _LCSCO, + {_sSI: _cLCSCRo, _smit: None}, + (_NM, _CSCo), + ((STRING, 0), (CODE_SIGNING_CONFIG_LIST, 0)), +) + +LIST_CODE_SIGNING_CONFIGS: StaticOperationSchema = ( + 23, + n0, + _LCSC, + { + _smithy: MappingProxyType( + {"method": "GET", "uri": "/2020-04-22/code-signing-configs", "code": 200} + ) + }, + LIST_CODE_SIGNING_CONFIGS_INPUT, + LIST_CODE_SIGNING_CONFIGS_OUTPUT, + (INVALID_PARAMETER_VALUE_EXCEPTION, SERVICE_EXCEPTION), +) + +LIST_FUNCTIONS_BY_CODE_SIGNING_CONFIG_INPUT: StaticSchema = ( + 18, + n0, + _LFBCSCI, + {_sSI: _cLFBCSCR, _sm: None}, + (_CSCA, _Mar, _MI), + ((CODE_SIGNING_CONFIG_ARN, 9), (STRING, {_sQ: _Mar}), (MAX_LIST_ITEMS, {_sQ: _MI})), +) + +FUNCTION_ARN_LIST: StaticSchema = (16, n0, _FAL, 0, (_me,), ((FUNCTION_ARN, 0),)) + +LIST_FUNCTIONS_BY_CODE_SIGNING_CONFIG_OUTPUT: StaticSchema = ( + 18, + n0, + _LFBCSCO, + {_sSI: _cLFBCSCRo, _smit: None}, + (_NM, _FAu), + ((STRING, 0), (FUNCTION_ARN_LIST, 0)), +) + +LIST_FUNCTIONS_BY_CODE_SIGNING_CONFIG: StaticOperationSchema = ( + 23, + n0, + _LFBCSC, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/2020-04-22/code-signing-configs/{CodeSigningConfigArn}/functions", + "code": 200, + } + ) + }, + LIST_FUNCTIONS_BY_CODE_SIGNING_CONFIG_INPUT, + LIST_FUNCTIONS_BY_CODE_SIGNING_CONFIG_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + ), ) -LIST_CAPACITY_PROVIDERS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ListCapacityProvidersInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#ListCapacityProvidersRequest", - ) - ], - members={ - "State": { - "target": CAPACITY_PROVIDER_STATE, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="State")], - }, - "Marker": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="Marker")], - }, - "MaxItems": { - "target": MAX_FIFTY_LIST_ITEMS, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="MaxItems")], - }, - }, +UPDATE_CODE_SIGNING_CONFIG_INPUT: StaticSchema = ( + 18, + n0, + _UCSCI, + {_sSI: _cUCSCR, _sm: None}, + (_CSCA, _D, _APl, _CSPo), + ( + (CODE_SIGNING_CONFIG_ARN, 9), + (DESCRIPTION, 0), + (ALLOWED_PUBLISHERS, 0), + (CODE_SIGNING_POLICIES, 0), + ), ) -CAPACITY_PROVIDERS_LIST = Schema.collection( - id=ShapeID("com.amazonaws.lambda#CapacityProvidersList"), - shape_type=ShapeType.LIST, - members={"member": {"target": CAPACITY_PROVIDER}}, +UPDATE_CODE_SIGNING_CONFIG_OUTPUT: StaticSchema = ( + 18, + n0, + _UCSCO, + {_sSI: _cUCSCRo, _smit: None}, + (_CSC,), + ((CODE_SIGNING_CONFIG, 1),), +) + +UPDATE_CODE_SIGNING_CONFIG: StaticOperationSchema = ( + 23, + n0, + _UCSC, + { + _smithy: MappingProxyType( + { + "method": "PUT", + "uri": "/2020-04-22/code-signing-configs/{CodeSigningConfigArn}", + "code": 200, + } + ) + }, + UPDATE_CODE_SIGNING_CONFIG_INPUT, + UPDATE_CODE_SIGNING_CONFIG_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + ), ) -LIST_CAPACITY_PROVIDERS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ListCapacityProvidersOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#ListCapacityProvidersResponse", - ) - ], - members={ - "CapacityProviders": { - "target": CAPACITY_PROVIDERS_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "NextMarker": {"target": STRING}, - }, +DELETE_FUNCTION_INPUT: StaticSchema = ( + 18, + n0, + _DFI, + {_sSI: _cDFR, _sm: None}, + (_FN, _Q), + ( + (NAMESPACED_FUNCTION_NAME, 9), + (NUMERIC_LATEST_PUBLISHED_OR_ALIAS_QUALIFIER, {_sQ: _Q}), + ), ) -LIST_CAPACITY_PROVIDERS = Schema( - id=ShapeID("com.amazonaws.lambda#ListCapacityProviders"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/2025-11-30/capacity-providers", "code": 200} - ), - ) - ], +DELETE_FUNCTION_OUTPUT: StaticSchema = ( + 18, + n0, + _DFO, + {_sSI: _cDFRo, _smit: None}, + (_SC,), + ((INTEGER, {_s: 0, _sRC: None}),), +) + +DELETE_FUNCTION: StaticOperationSchema = ( + 23, + n0, + _DF, + { + _smithy: MappingProxyType( + {"method": "DELETE", "uri": "/2015-03-31/functions/{FunctionName}"} + ) + }, + DELETE_FUNCTION_INPUT, + DELETE_FUNCTION_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -LIST_FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ListFunctionVersionsByCapacityProviderInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#ListFunctionVersionsByCapacityProviderRequest", - ) - ], - members={ - "CapacityProviderName": { - "target": CAPACITY_PROVIDER_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Marker": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="Marker")], - }, - "MaxItems": { - "target": MAX_FIFTY_LIST_ITEMS, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="MaxItems")], - }, - }, +DELETE_FUNCTION_EVENT_INVOKE_CONFIG_INPUT: StaticSchema = ( + 18, + n0, + _DFEICI, + {_sSI: _cDFEICR, _sm: None}, + (_FN, _Q), + ( + (NAMESPACED_FUNCTION_NAME, 9), + (NUMERIC_LATEST_PUBLISHED_OR_ALIAS_QUALIFIER, {_sQ: _Q}), + ), ) -NAME_SPACED_FUNCTION_ARN = Schema( - id=ShapeID("com.amazonaws.lambda#NameSpacedFunctionArn"), - shape_type=ShapeType.STRING, +DELETE_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT: StaticSchema = ( + 18, + n0, + _DFEICO, + {_sSI: _sU, _smit: None}, +) + +DELETE_FUNCTION_EVENT_INVOKE_CONFIG: StaticOperationSchema = ( + 23, + n0, + _DFEIC, + { + _smithy: MappingProxyType( + { + "method": "DELETE", + "uri": "/2019-09-25/functions/{FunctionName}/event-invoke-config", + "code": 204, + } + ) + }, + DELETE_FUNCTION_EVENT_INVOKE_CONFIG_INPUT, + DELETE_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -STATE = Schema.collection( - id=ShapeID("com.amazonaws.lambda#State"), - shape_type=ShapeType.ENUM, - members={ - "Pending": {"target": UNIT}, - "Active": {"target": UNIT}, - "Inactive": {"target": UNIT}, - "Failed": {"target": UNIT}, - "Deactivating": {"target": UNIT}, - "Deactivated": {"target": UNIT}, - "ActiveNonInvocable": {"target": UNIT}, - "Deleting": {"target": UNIT}, - }, -) +POLICY_RESOURCE_ARN: StaticSchema = (3, n0, _PRA, 0) -FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER_LIST_ITEM = Schema.collection( - id=ShapeID("com.amazonaws.lambda#FunctionVersionsByCapacityProviderListItem"), - members={ - "FunctionArn": { - "target": NAME_SPACED_FUNCTION_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "State": { - "target": STATE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +REVISION_ID: StaticSchema = (3, n0, _RI, 0) -FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER_LIST = Schema.collection( - id=ShapeID("com.amazonaws.lambda#FunctionVersionsByCapacityProviderList"), - shape_type=ShapeType.LIST, - members={"member": {"target": FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER_LIST_ITEM}}, +DELETE_RESOURCE_POLICY_INPUT: StaticSchema = ( + 18, + n0, + _DRPI, + {_sSI: _cDRPR, _sm: None}, + (_RAe, _RI), + ((POLICY_RESOURCE_ARN, 9), (REVISION_ID, {_sQ: _RI})), ) -LIST_FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ListFunctionVersionsByCapacityProviderOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#ListFunctionVersionsByCapacityProviderResponse", +DELETE_RESOURCE_POLICY_OUTPUT: StaticSchema = (18, n0, _DRPO, {_sSI: _sU, _smit: None}) + +DELETE_RESOURCE_POLICY: StaticOperationSchema = ( + 23, + n0, + _DRP, + { + _smithy: MappingProxyType( + { + "method": "DELETE", + "uri": "/2026-07-09/resource-policy/{ResourceArn}", + "code": 204, + } ) - ], - members={ - "CapacityProviderArn": { - "target": CAPACITY_PROVIDER_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "FunctionVersions": { - "target": FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "NextMarker": {"target": STRING}, }, + DELETE_RESOURCE_POLICY_INPUT, + DELETE_RESOURCE_POLICY_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + PRECONDITION_FAILED_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -LIST_FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER = Schema( - id=ShapeID("com.amazonaws.lambda#ListFunctionVersionsByCapacityProvider"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/2025-11-30/capacity-providers/{CapacityProviderName}/function-versions", - "code": 200, - } - ), - ) - ], -) +CHECKPOINT_TOKEN: StaticSchema = (3, n0, _CT, 0) -UPDATE_CAPACITY_PROVIDER_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#UpdateCapacityProviderInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#UpdateCapacityProviderRequest", - ) - ], - members={ - "CapacityProviderName": { - "target": CAPACITY_PROVIDER_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "CapacityProviderScalingConfig": {"target": CAPACITY_PROVIDER_SCALING_CONFIG}, - "PropagateTags": {"target": PROPAGATE_TAGS}, - "TelemetryConfig": {"target": CAPACITY_PROVIDER_TELEMETRY_CONFIG}, - }, -) +CLIENT_TOKEN: StaticSchema = (3, n0, _CTl, 0) -UPDATE_CAPACITY_PROVIDER_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#UpdateCapacityProviderOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#UpdateCapacityProviderResponse", - ) - ], - members={ - "CapacityProvider": { - "target": CAPACITY_PROVIDER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +DURABLE_EXECUTION_ARN: StaticSchema = (3, n0, _DEA, 0) -UPDATE_CAPACITY_PROVIDER = Schema( - id=ShapeID("com.amazonaws.lambda#UpdateCapacityProvider"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PUT", - "uri": "/2025-11-30/capacity-providers/{CapacityProviderName}", - "code": 202, - } - ), - ) - ], +OPERATION_ACTION: StaticSchema = ( + 14, + n0, + _OA, + 0, + (_START, _SUCCEED, _FAIL, _RETRY, _CANCEL), + ( + (-1, {_sV: _START}), + (-1, {_sV: _SUCCEED}), + (-1, {_sV: _FAIL}), + (-1, {_sV: _RETRY}), + (-1, {_sV: _CANCEL}), + ), ) -CODE_SIGNING_CONFIG_ID = Schema( - id=ShapeID("com.amazonaws.lambda#CodeSigningConfigId"), shape_type=ShapeType.STRING -) +DURATION_SECONDS: StaticSchema = (7, n0, _DS, 0) -CODE_SIGNING_POLICY = Schema.collection( - id=ShapeID("com.amazonaws.lambda#CodeSigningPolicy"), - shape_type=ShapeType.ENUM, - members={"Warn": {"target": UNIT}, "Enforce": {"target": UNIT}}, +CALLBACK_OPTIONS: StaticSchema = ( + 18, + n0, + _CO, + 0, + (_TS, _HTS), + ((DURATION_SECONDS, {_s: 0}), (DURATION_SECONDS, {_s: 0})), ) -CODE_SIGNING_POLICIES = Schema.collection( - id=ShapeID("com.amazonaws.lambda#CodeSigningPolicies"), - members={"UntrustedArtifactOnDeployment": {"target": CODE_SIGNING_POLICY}}, -) +TENANT_ID: StaticSchema = (3, n0, _TI, 0) -CREATE_CODE_SIGNING_CONFIG_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#CreateCodeSigningConfigInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#CreateCodeSigningConfigRequest", - ) - ], - members={ - "Description": {"target": DESCRIPTION}, - "AllowedPublishers": { - "target": ALLOWED_PUBLISHERS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "CodeSigningPolicies": {"target": CODE_SIGNING_POLICIES}, - "Tags": {"target": TAGS}, - }, +CHAINED_INVOKE_OPTIONS: StaticSchema = ( + 18, + n0, + _CIO, + 0, + (_FN, _TI), + ((NAMESPACED_FUNCTION_NAME, 1), (TENANT_ID, 0)), ) -CODE_SIGNING_CONFIG_ARN = Schema( - id=ShapeID("com.amazonaws.lambda#CodeSigningConfigArn"), shape_type=ShapeType.STRING -) - -CODE_SIGNING_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.lambda#CodeSigningConfig"), - members={ - "CodeSigningConfigId": { - "target": CODE_SIGNING_CONFIG_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "CodeSigningConfigArn": { - "target": CODE_SIGNING_CONFIG_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Description": {"target": DESCRIPTION}, - "AllowedPublishers": { - "target": ALLOWED_PUBLISHERS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "CodeSigningPolicies": { - "target": CODE_SIGNING_POLICIES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "LastModified": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +REPLAY_CHILDREN: StaticSchema = (2, n0, _RCe, 0) -CREATE_CODE_SIGNING_CONFIG_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#CreateCodeSigningConfigOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#CreateCodeSigningConfigResponse", - ) - ], - members={ - "CodeSigningConfig": { - "target": CODE_SIGNING_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +CONTEXT_OPTIONS: StaticSchema = (18, n0, _COo, 0, (_RCe,), ((REPLAY_CHILDREN, 0),)) -CREATE_CODE_SIGNING_CONFIG = Schema( - id=ShapeID("com.amazonaws.lambda#CreateCodeSigningConfig"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/2020-04-22/code-signing-configs", - "code": 201, - } - ), - ) - ], -) +ERROR_DATA: StaticSchema = (3, n0, _ED, 4) -DELETE_CODE_SIGNING_CONFIG_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#DeleteCodeSigningConfigInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#DeleteCodeSigningConfigRequest", - ) - ], - members={ - "CodeSigningConfigArn": { - "target": CODE_SIGNING_CONFIG_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) +ERROR_MESSAGE: StaticSchema = (3, n0, _EM, 4) -DELETE_CODE_SIGNING_CONFIG_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#DeleteCodeSigningConfigOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#DeleteCodeSigningConfigResponse", - ) - ], -) - -DELETE_CODE_SIGNING_CONFIG = Schema( - id=ShapeID("com.amazonaws.lambda#DeleteCodeSigningConfig"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/2020-04-22/code-signing-configs/{CodeSigningConfigArn}", - "code": 204, - } - ), - ) - ], -) +ERROR_TYPE: StaticSchema = (3, n0, _ETr, 4) -GET_CODE_SIGNING_CONFIG_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#GetCodeSigningConfigInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#GetCodeSigningConfigRequest", - ) - ], - members={ - "CodeSigningConfigArn": { - "target": CODE_SIGNING_CONFIG_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) +STACK_TRACE_ENTRY: StaticSchema = (3, n0, _STE, 4) -GET_CODE_SIGNING_CONFIG_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#GetCodeSigningConfigOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#GetCodeSigningConfigResponse", - ) - ], - members={ - "CodeSigningConfig": { - "target": CODE_SIGNING_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +STACK_TRACE_ENTRIES: StaticSchema = ( + 16, + n0, + _STEt, + 0, + (_me,), + ((STACK_TRACE_ENTRY, 0),), ) -GET_CODE_SIGNING_CONFIG = Schema( - id=ShapeID("com.amazonaws.lambda#GetCodeSigningConfig"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/2020-04-22/code-signing-configs/{CodeSigningConfigArn}", - "code": 200, - } - ), - ) - ], +ERROR_OBJECT: StaticSchema = ( + 18, + n0, + _EO, + 0, + (_EM, _ETr, _ED, _ST), + ((ERROR_MESSAGE, 0), (ERROR_TYPE, 0), (ERROR_DATA, 0), (STACK_TRACE_ENTRIES, 0)), ) -MAX_LIST_ITEMS = Schema( - id=ShapeID("com.amazonaws.lambda#MaxListItems"), shape_type=ShapeType.INTEGER -) +OPERATION_ID: StaticSchema = (3, n0, _OIp, 0) -LIST_CODE_SIGNING_CONFIGS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ListCodeSigningConfigsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#ListCodeSigningConfigsRequest", - ) - ], - members={ - "Marker": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="Marker")], - }, - "MaxItems": { - "target": MAX_LIST_ITEMS, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="MaxItems")], - }, - }, -) +OPERATION_NAME: StaticSchema = (3, n0, _ON, 0) -CODE_SIGNING_CONFIG_LIST = Schema.collection( - id=ShapeID("com.amazonaws.lambda#CodeSigningConfigList"), - shape_type=ShapeType.LIST, - members={"member": {"target": CODE_SIGNING_CONFIG}}, -) +OPERATION_PAYLOAD: StaticSchema = (3, n0, _OP, 4) -LIST_CODE_SIGNING_CONFIGS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ListCodeSigningConfigsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#ListCodeSigningConfigsResponse", - ) - ], - members={ - "NextMarker": {"target": STRING}, - "CodeSigningConfigs": {"target": CODE_SIGNING_CONFIG_LIST}, - }, -) +STEP_OPTIONS: StaticSchema = (18, n0, _SOt, 0, (_NADS,), ((DURATION_SECONDS, 0),)) -LIST_CODE_SIGNING_CONFIGS = Schema( - id=ShapeID("com.amazonaws.lambda#ListCodeSigningConfigs"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/2020-04-22/code-signing-configs", - "code": 200, - } - ), - ) - ], -) +OPERATION_SUB_TYPE: StaticSchema = (3, n0, _OST, 0) -LIST_FUNCTIONS_BY_CODE_SIGNING_CONFIG_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ListFunctionsByCodeSigningConfigInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#ListFunctionsByCodeSigningConfigRequest", - ) - ], - members={ - "CodeSigningConfigArn": { - "target": CODE_SIGNING_CONFIG_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Marker": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="Marker")], - }, - "MaxItems": { - "target": MAX_LIST_ITEMS, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="MaxItems")], - }, - }, +OPERATION_TYPE: StaticSchema = ( + 14, + n0, + _OT, + 0, + (_EXECUTION, _CONTEXT, _STEP, _WAIT, _CALLBACK, _CI), + ( + (-1, {_sV: _EXECUTION}), + (-1, {_sV: _CONTEXT}), + (-1, {_sV: _STEP}), + (-1, {_sV: _WAIT}), + (-1, {_sV: _CALLBACK}), + (-1, {_sV: _CI}), + ), ) -FUNCTION_ARN_LIST = Schema.collection( - id=ShapeID("com.amazonaws.lambda#FunctionArnList"), - shape_type=ShapeType.LIST, - members={"member": {"target": FUNCTION_ARN}}, +WAIT_OPTIONS: StaticSchema = (18, n0, _WO, 0, (_WS,), ((DURATION_SECONDS, 0),)) + +OPERATION_UPDATE: StaticSchema = ( + 18, + n0, + _OU, + 0, + (_Id, _PI, _N, _T, _STu, _A, _Pa, _E, _COo, _SOt, _WO, _CO, _CIO), + ( + (OPERATION_ID, 1), + (OPERATION_ID, 0), + (OPERATION_NAME, 0), + (OPERATION_TYPE, 1), + (OPERATION_SUB_TYPE, 0), + (OPERATION_ACTION, 1), + (OPERATION_PAYLOAD, 0), + (ERROR_OBJECT, 0), + (CONTEXT_OPTIONS, 0), + (STEP_OPTIONS, 0), + (WAIT_OPTIONS, 0), + (CALLBACK_OPTIONS, 0), + (CHAINED_INVOKE_OPTIONS, 0), + ), ) -LIST_FUNCTIONS_BY_CODE_SIGNING_CONFIG_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ListFunctionsByCodeSigningConfigOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#ListFunctionsByCodeSigningConfigResponse", - ) - ], - members={ - "NextMarker": {"target": STRING}, - "FunctionArns": {"target": FUNCTION_ARN_LIST}, - }, -) +OPERATION_UPDATES: StaticSchema = (16, n0, _OUp, 0, (_me,), ((OPERATION_UPDATE, 0),)) -LIST_FUNCTIONS_BY_CODE_SIGNING_CONFIG = Schema( - id=ShapeID("com.amazonaws.lambda#ListFunctionsByCodeSigningConfig"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/2020-04-22/code-signing-configs/{CodeSigningConfigArn}/functions", - "code": 200, - } - ), - ) - ], +CHECKPOINT_DURABLE_EXECUTION_INPUT: StaticSchema = ( + 18, + n0, + _CDEI, + {_sSI: _cCDER, _sm: None}, + (_DEA, _CT, _U, _CTl), + ( + (DURABLE_EXECUTION_ARN, 9), + (CHECKPOINT_TOKEN, 1), + (OPERATION_UPDATES, 0), + (CLIENT_TOKEN, 2), + ), ) -UPDATE_CODE_SIGNING_CONFIG_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#UpdateCodeSigningConfigInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#UpdateCodeSigningConfigRequest", - ) - ], - members={ - "CodeSigningConfigArn": { - "target": CODE_SIGNING_CONFIG_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Description": {"target": DESCRIPTION}, - "AllowedPublishers": {"target": ALLOWED_PUBLISHERS}, - "CodeSigningPolicies": {"target": CODE_SIGNING_POLICIES}, - }, +CALLBACK_ID: StaticSchema = (3, n0, _CIa, 0) + +CALLBACK_DETAILS: StaticSchema = ( + 18, + n0, + _CD, + 0, + (_CIa, _Re, _E), + ((CALLBACK_ID, 0), (OPERATION_PAYLOAD, 0), (ERROR_OBJECT, 0)), +) + +CHAINED_INVOKE_DETAILS: StaticSchema = ( + 18, + n0, + _CID, + 0, + (_Re, _E), + ((OPERATION_PAYLOAD, 0), (ERROR_OBJECT, 0)), +) + +CONTEXT_DETAILS: StaticSchema = ( + 18, + n0, + _CDo, + 0, + (_RCe, _Re, _E), + ((REPLAY_CHILDREN, 0), (OPERATION_PAYLOAD, 0), (ERROR_OBJECT, 0)), +) + +EXECUTION_TIMESTAMP: StaticSchema = (4, n0, _ETx, 0) + +INPUT_PAYLOAD: StaticSchema = (3, n0, _IP, 4) + +EXECUTION_DETAILS: StaticSchema = (18, n0, _EDx, 0, (_IP,), ((INPUT_PAYLOAD, 0),)) + +OPERATION_STATUS: StaticSchema = ( + 14, + n0, + _OS, + 0, + (_STARTED, _PENDING, _READY, _SUCCEEDED, _FAILED, _CANCELLED, _TO, _STOPPED), + ( + (-1, {_sV: _STARTED}), + (-1, {_sV: _PENDING}), + (-1, {_sV: _READY}), + (-1, {_sV: _SUCCEEDED}), + (-1, {_sV: _FAILED}), + (-1, {_sV: _CANCELLED}), + (-1, {_sV: _TO}), + (-1, {_sV: _STOPPED}), + ), ) -UPDATE_CODE_SIGNING_CONFIG_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#UpdateCodeSigningConfigOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#UpdateCodeSigningConfigResponse", - ) - ], - members={ - "CodeSigningConfig": { - "target": CODE_SIGNING_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +STEP_DETAILS: StaticSchema = ( + 18, + n0, + _SD, + 0, + (_Att, _NAT, _Re, _E), + ( + (ATTEMPT_COUNT, {_s: 0}), + (EXECUTION_TIMESTAMP, 0), + (OPERATION_PAYLOAD, 0), + (ERROR_OBJECT, 0), + ), ) -UPDATE_CODE_SIGNING_CONFIG = Schema( - id=ShapeID("com.amazonaws.lambda#UpdateCodeSigningConfig"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PUT", - "uri": "/2020-04-22/code-signing-configs/{CodeSigningConfigArn}", - "code": 200, - } - ), - ) - ], +WAIT_DETAILS: StaticSchema = (18, n0, _WD, 0, (_SET,), ((EXECUTION_TIMESTAMP, 0),)) + +OPERATION: StaticSchema = ( + 18, + n0, + _Op, + 0, + (_Id, _PI, _N, _T, _STu, _STt, _ETn, _Stat, _EDx, _CDo, _SD, _WD, _CD, _CID), + ( + (OPERATION_ID, 1), + (OPERATION_ID, 0), + (OPERATION_NAME, 0), + (OPERATION_TYPE, 1), + (OPERATION_SUB_TYPE, 0), + (EXECUTION_TIMESTAMP, 1), + (EXECUTION_TIMESTAMP, 0), + (OPERATION_STATUS, 1), + (EXECUTION_DETAILS, 0), + (CONTEXT_DETAILS, 0), + (STEP_DETAILS, 0), + (WAIT_DETAILS, 0), + (CALLBACK_DETAILS, 0), + (CHAINED_INVOKE_DETAILS, 0), + ), ) -DELETE_FUNCTION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#DeleteFunctionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#DeleteFunctionRequest", - ) - ], - members={ - "FunctionName": { - "target": NAMESPACED_FUNCTION_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Qualifier": { - "target": NUMERIC_LATEST_PUBLISHED_OR_ALIAS_QUALIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="Qualifier") - ], - }, - }, +OPERATIONS: StaticSchema = (16, n0, _Ope, 0, (_me,), ((OPERATION, 0),)) + +CHECKPOINT_UPDATED_EXECUTION_STATE: StaticSchema = ( + 18, + n0, + _CUES, + 0, + (_Ope, _NM), + ((OPERATIONS, 0), (STRING, 0)), +) + +CHECKPOINT_DURABLE_EXECUTION_OUTPUT: StaticSchema = ( + 18, + n0, + _CDEO, + {_sSI: _cCDERo, _smit: None}, + (_CT, _NES), + ((CHECKPOINT_TOKEN, 0), (CHECKPOINT_UPDATED_EXECUTION_STATE, 1)), +) + +KMS_ACCESS_DENIED_EXCEPTION: StaticSchema = ( + 18, + n0, + _KMSADE, + {_smith: _se, _sE: 502}, + (_T, _M), + ((STRING, 0), (STRING, 0)), +) + +KMS_DISABLED_EXCEPTION: StaticSchema = ( + 18, + n0, + _KMSDE, + {_smith: _se, _sE: 502}, + (_T, _M), + ((STRING, 0), (STRING, 0)), +) + +KMS_INVALID_STATE_EXCEPTION: StaticSchema = ( + 18, + n0, + _KMSISE, + {_smith: _se, _sE: 502}, + (_T, _M), + ((STRING, 0), (STRING, 0)), +) + +KMS_NOT_FOUND_EXCEPTION: StaticSchema = ( + 18, + n0, + _KMSNFE, + {_smith: _se, _sE: 502}, + (_T, _M), + ((STRING, 0), (STRING, 0)), +) + +CHECKPOINT_DURABLE_EXECUTION: StaticOperationSchema = ( + 23, + n0, + _CDE, + { + _smithy: MappingProxyType( + { + "method": "POST", + "uri": "/2025-12-01/durable-executions/{DurableExecutionArn}/checkpoint", + "code": 200, + } + ) + }, + CHECKPOINT_DURABLE_EXECUTION_INPUT, + CHECKPOINT_DURABLE_EXECUTION_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + KMS_ACCESS_DENIED_EXCEPTION, + KMS_DISABLED_EXCEPTION, + KMS_INVALID_STATE_EXCEPTION, + KMS_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -DELETE_FUNCTION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#DeleteFunctionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#DeleteFunctionResponse", - ) - ], - members={ - "StatusCode": { - "target": INTEGER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=0), - Trait.new(id=ShapeID("smithy.api#httpResponseCode")), - ], - } - }, -) +INCLUDE_EXECUTION_DATA: StaticSchema = (2, n0, _IED, 0) -DELETE_FUNCTION = Schema( - id=ShapeID("com.amazonaws.lambda#DeleteFunction"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "DELETE", "uri": "/2015-03-31/functions/{FunctionName}"} - ), - ) - ], +GET_DURABLE_EXECUTION_INPUT: StaticSchema = ( + 18, + n0, + _GDEI, + {_sSI: _cGDER, _sm: None}, + (_DEA, _IED), + ((DURABLE_EXECUTION_ARN, 9), (INCLUDE_EXECUTION_DATA, {_s: True, _sQ: _IED})), ) -DELETE_FUNCTION_EVENT_INVOKE_CONFIG_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#DeleteFunctionEventInvokeConfigInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#DeleteFunctionEventInvokeConfigRequest", - ) - ], - members={ - "FunctionName": { - "target": NAMESPACED_FUNCTION_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Qualifier": { - "target": NUMERIC_LATEST_PUBLISHED_OR_ALIAS_QUALIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="Qualifier") - ], - }, - }, -) +EXECUTION_TIMEOUT: StaticSchema = (7, n0, _ETxe, 0) -DELETE_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#DeleteFunctionEventInvokeConfigOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -DELETE_FUNCTION_EVENT_INVOKE_CONFIG = Schema( - id=ShapeID("com.amazonaws.lambda#DeleteFunctionEventInvokeConfig"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/2019-09-25/functions/{FunctionName}/event-invoke-config", - "code": 204, - } - ), - ) - ], -) +RETENTION_PERIOD_IN_DAYS: StaticSchema = (7, n0, _RPID, 0) -POLICY_RESOURCE_ARN = Schema( - id=ShapeID("com.amazonaws.lambda#PolicyResourceArn"), shape_type=ShapeType.STRING +DURABLE_CONFIG: StaticSchema = ( + 18, + n0, + _DC, + 0, + (_KMSKA, _RPID, _ETxe), + ((KMS_KEY_ARN, 0), (RETENTION_PERIOD_IN_DAYS, 0), (EXECUTION_TIMEOUT, 0)), ) -REVISION_ID = Schema( - id=ShapeID("com.amazonaws.lambda#RevisionId"), shape_type=ShapeType.STRING -) +DURABLE_EXECUTION_NAME: StaticSchema = (3, n0, _DEN, 0) -DELETE_RESOURCE_POLICY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#DeleteResourcePolicyInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#DeleteResourcePolicyRequest", - ) - ], - members={ - "ResourceArn": { - "target": POLICY_RESOURCE_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "RevisionId": { - "target": REVISION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="RevisionId") - ], - }, - }, -) +EXECUTION_DATA_INCLUDED: StaticSchema = (2, n0, _EDI, 0) -DELETE_RESOURCE_POLICY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#DeleteResourcePolicyOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -DELETE_RESOURCE_POLICY = Schema( - id=ShapeID("com.amazonaws.lambda#DeleteResourcePolicy"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/2026-07-09/resource-policy/{ResourceArn}", - "code": 204, - } - ), - ) - ], -) +OUTPUT_PAYLOAD: StaticSchema = (3, n0, _OPu, 4) -CHECKPOINT_TOKEN = Schema( - id=ShapeID("com.amazonaws.lambda#CheckpointToken"), shape_type=ShapeType.STRING +EXECUTION_STATUS: StaticSchema = ( + 14, + n0, + _ES, + 0, + (_RUNNING, _SUCCEEDED, _FAILED, _TO, _STOPPED), + ( + (-1, {_sV: _RUNNING}), + (-1, {_sV: _SUCCEEDED}), + (-1, {_sV: _FAILED}), + (-1, {_sV: _TO}), + (-1, {_sV: _STOPPED}), + ), ) -CLIENT_TOKEN = Schema( - id=ShapeID("com.amazonaws.lambda#ClientToken"), shape_type=ShapeType.STRING +X_AMZN_TRACE_ID: StaticSchema = (3, n0, _XATI, 0) + +TRACE_HEADER: StaticSchema = (18, n0, _TH, 0, (_XATI,), ((X_AMZN_TRACE_ID, 0),)) + +VERSION_WITH_LATEST_PUBLISHED: StaticSchema = (3, n0, _VWLP, 0) + +GET_DURABLE_EXECUTION_OUTPUT: StaticSchema = ( + 18, + n0, + _GDEO, + {_sSI: _cGDERo, _smit: None}, + (_DEA, _DEN, _FA, _IP, _Re, _E, _STt, _Stat, _ETn, _V, _TH, _EDI, _DC), + ( + (DURABLE_EXECUTION_ARN, 1), + (DURABLE_EXECUTION_NAME, 1), + (NAME_SPACED_FUNCTION_ARN, 1), + (INPUT_PAYLOAD, 0), + (OUTPUT_PAYLOAD, 0), + (ERROR_OBJECT, 0), + (EXECUTION_TIMESTAMP, 1), + (EXECUTION_STATUS, 1), + (EXECUTION_TIMESTAMP, 0), + (VERSION_WITH_LATEST_PUBLISHED, 0), + (TRACE_HEADER, 0), + (EXECUTION_DATA_INCLUDED, 0), + (DURABLE_CONFIG, 0), + ), ) -DURABLE_EXECUTION_ARN = Schema( - id=ShapeID("com.amazonaws.lambda#DurableExecutionArn"), shape_type=ShapeType.STRING +GET_DURABLE_EXECUTION: StaticOperationSchema = ( + 23, + n0, + _GDE, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/2025-12-01/durable-executions/{DurableExecutionArn}", + "code": 200, + } + ) + }, + GET_DURABLE_EXECUTION_INPUT, + GET_DURABLE_EXECUTION_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + KMS_ACCESS_DENIED_EXCEPTION, + KMS_DISABLED_EXCEPTION, + KMS_INVALID_STATE_EXCEPTION, + KMS_NOT_FOUND_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -OPERATION_ACTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#OperationAction"), - shape_type=ShapeType.ENUM, - members={ - "START": {"target": UNIT}, - "SUCCEED": {"target": UNIT}, - "FAIL": {"target": UNIT}, - "RETRY": {"target": UNIT}, - "CANCEL": {"target": UNIT}, - }, -) +ITEM_COUNT: StaticSchema = (7, n0, _IC, {_s: 0}) -DURATION_SECONDS = Schema( - id=ShapeID("com.amazonaws.lambda#DurationSeconds"), shape_type=ShapeType.INTEGER -) +REVERSE_ORDER: StaticSchema = (2, n0, _RO, 0) -CALLBACK_OPTIONS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#CallbackOptions"), - members={ - "TimeoutSeconds": { - "target": DURATION_SECONDS, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "HeartbeatTimeoutSeconds": { - "target": DURATION_SECONDS, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - }, +GET_DURABLE_EXECUTION_HISTORY_INPUT: StaticSchema = ( + 18, + n0, + _GDEHI, + {_sSI: _cGDEHR, _sm: None}, + (_DEA, _IED, _MI, _Mar, _RO), + ( + (DURABLE_EXECUTION_ARN, 9), + (INCLUDE_EXECUTION_DATA, {_sQ: _IED}), + (ITEM_COUNT, {_s: 0, _sQ: _MI}), + (STRING, {_sQ: _Mar}), + (REVERSE_ORDER, {_sQ: _RO}), + ), ) -TENANT_ID = Schema( - id=ShapeID("com.amazonaws.lambda#TenantId"), shape_type=ShapeType.STRING +TRUNCATED: StaticSchema = (2, n0, _Tru, 0) + +EVENT_ERROR: StaticSchema = ( + 18, + n0, + _EE, + 0, + (_Pa, _Tru), + ((ERROR_OBJECT, 0), (TRUNCATED, 0)), +) + +CALLBACK_FAILED_DETAILS: StaticSchema = (18, n0, _CFD, 0, (_E,), ((EVENT_ERROR, 1),)) + +CALLBACK_STARTED_DETAILS: StaticSchema = ( + 18, + n0, + _CSD, + 0, + (_CIa, _HT, _Tim), + ((CALLBACK_ID, 1), (DURATION_SECONDS, 0), (DURATION_SECONDS, 0)), +) + +EVENT_RESULT: StaticSchema = ( + 18, + n0, + _ER, + 0, + (_Pa, _Tru), + ((OPERATION_PAYLOAD, 0), (TRUNCATED, 0)), +) + +CALLBACK_SUCCEEDED_DETAILS: StaticSchema = ( + 18, + n0, + _CSDa, + 0, + (_Re,), + ((EVENT_RESULT, 1),), +) + +CALLBACK_TIMED_OUT_DETAILS: StaticSchema = ( + 18, + n0, + _CTOD, + 0, + (_E,), + ((EVENT_ERROR, 1),), +) + +CHAINED_INVOKE_FAILED_DETAILS: StaticSchema = ( + 18, + n0, + _CIFD, + 0, + (_E,), + ((EVENT_ERROR, 1),), +) + +EVENT_INPUT: StaticSchema = ( + 18, + n0, + _EI, + 0, + (_Pa, _Tru), + ((INPUT_PAYLOAD, 0), (TRUNCATED, 0)), +) + +CHAINED_INVOKE_STARTED_DETAILS: StaticSchema = ( + 18, + n0, + _CISD, + 0, + (_FN, _TI, _Inp, _EV, _DEA), + ( + (NAMESPACED_FUNCTION_NAME, 1), + (TENANT_ID, 0), + (EVENT_INPUT, 0), + (VERSION_WITH_LATEST_PUBLISHED, 0), + (DURABLE_EXECUTION_ARN, 0), + ), ) -CHAINED_INVOKE_OPTIONS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ChainedInvokeOptions"), - members={ - "FunctionName": { - "target": NAMESPACED_FUNCTION_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "TenantId": {"target": TENANT_ID}, - }, +CHAINED_INVOKE_STOPPED_DETAILS: StaticSchema = ( + 18, + n0, + _CISDh, + 0, + (_E,), + ((EVENT_ERROR, 1),), +) + +CHAINED_INVOKE_SUCCEEDED_DETAILS: StaticSchema = ( + 18, + n0, + _CISDha, + 0, + (_Re,), + ((EVENT_RESULT, 1),), +) + +CHAINED_INVOKE_TIMED_OUT_DETAILS: StaticSchema = ( + 18, + n0, + _CITOD, + 0, + (_E,), + ((EVENT_ERROR, 1),), +) + +CONTEXT_FAILED_DETAILS: StaticSchema = (18, n0, _CFDo, 0, (_E,), ((EVENT_ERROR, 1),)) + +CONTEXT_STARTED_DETAILS: StaticSchema = (18, n0, _CSDo, 0) + +CONTEXT_SUCCEEDED_DETAILS: StaticSchema = ( + 18, + n0, + _CSDon, + 0, + (_Re,), + ((EVENT_RESULT, 1),), +) + +EVENT_ID: StaticSchema = (7, n0, _EIv, {_s: 1}) + +EVENT_TYPE: StaticSchema = ( + 14, + n0, + _ETv, + 0, + ( + _ESx, + _ESxe, + _EF, + _ETO, + _ESxec, + _CS, + _CSo, + _CF, + _WSa, + _WSai, + _WC, + _SS, + _SSt, + _SF, + _CIS, + _CISh, + _CIF, + _CITO, + _CISha, + _CSa, + _CSal, + _CFa, + _CTO, + _ICn, + ), + ( + (-1, {_sV: _ESx}), + (-1, {_sV: _ESxe}), + (-1, {_sV: _EF}), + (-1, {_sV: _ETO}), + (-1, {_sV: _ESxec}), + (-1, {_sV: _CS}), + (-1, {_sV: _CSo}), + (-1, {_sV: _CF}), + (-1, {_sV: _WSa}), + (-1, {_sV: _WSai}), + (-1, {_sV: _WC}), + (-1, {_sV: _SS}), + (-1, {_sV: _SSt}), + (-1, {_sV: _SF}), + (-1, {_sV: _CIS}), + (-1, {_sV: _CISh}), + (-1, {_sV: _CIF}), + (-1, {_sV: _CITO}), + (-1, {_sV: _CISha}), + (-1, {_sV: _CSa}), + (-1, {_sV: _CSal}), + (-1, {_sV: _CFa}), + (-1, {_sV: _CTO}), + (-1, {_sV: _ICn}), + ), ) -REPLAY_CHILDREN = Schema( - id=ShapeID("com.amazonaws.lambda#ReplayChildren"), shape_type=ShapeType.BOOLEAN +EXECUTION_FAILED_DETAILS: StaticSchema = (18, n0, _EFD, 0, (_E,), ((EVENT_ERROR, 1),)) + +EXECUTION_STARTED_DETAILS: StaticSchema = ( + 18, + n0, + _ESD, + 0, + (_Inp, _ETxe), + ((EVENT_INPUT, 1), (DURATION_SECONDS, 1)), +) + +EXECUTION_STOPPED_DETAILS: StaticSchema = (18, n0, _ESDx, 0, (_E,), ((EVENT_ERROR, 1),)) + +EXECUTION_SUCCEEDED_DETAILS: StaticSchema = ( + 18, + n0, + _ESDxe, + 0, + (_Re,), + ((EVENT_RESULT, 1),), +) + +EXECUTION_TIMED_OUT_DETAILS: StaticSchema = ( + 18, + n0, + _ETOD, + 0, + (_E,), + ((EVENT_ERROR, 0),), +) + +INVOCATION_COMPLETED_DETAILS: StaticSchema = ( + 18, + n0, + _ICD, + 0, + (_STt, _ETn, _RIe, _E), + ((EXECUTION_TIMESTAMP, 1), (EXECUTION_TIMESTAMP, 1), (STRING, 1), (EVENT_ERROR, 0)), +) + +RETRY_DETAILS: StaticSchema = ( + 18, + n0, + _RD, + 0, + (_CA, _NADS), + ((ATTEMPT_COUNT, {_s: 0}), (DURATION_SECONDS, 0)), +) + +STEP_FAILED_DETAILS: StaticSchema = ( + 18, + n0, + _SFD, + 0, + (_E, _RD), + ((EVENT_ERROR, 1), (RETRY_DETAILS, 1)), +) + +STEP_STARTED_DETAILS: StaticSchema = (18, n0, _SSD, 0) + +STEP_SUCCEEDED_DETAILS: StaticSchema = ( + 18, + n0, + _SSDt, + 0, + (_Re, _RD), + ((EVENT_RESULT, 1), (RETRY_DETAILS, 1)), +) + +WAIT_CANCELLED_DETAILS: StaticSchema = (18, n0, _WCD, 0, (_E,), ((EVENT_ERROR, 0),)) + +WAIT_STARTED_DETAILS: StaticSchema = ( + 18, + n0, + _WSD, + 0, + (_Du, _SET), + ((DURATION_SECONDS, 1), (EXECUTION_TIMESTAMP, 1)), +) + +WAIT_SUCCEEDED_DETAILS: StaticSchema = ( + 18, + n0, + _WSDa, + 0, + (_Du,), + ((DURATION_SECONDS, 0),), +) + +EVENT: StaticSchema = ( + 18, + n0, + _Ev, + 0, + ( + _ETv, + _STu, + _EIv, + _Id, + _N, + _ETve, + _PI, + _ESD, + _ESDxe, + _EFD, + _ETOD, + _ESDx, + _CSDo, + _CSDon, + _CFDo, + _WSD, + _WSDa, + _WCD, + _SSD, + _SSDt, + _SFD, + _CISD, + _CISDha, + _CIFD, + _CITOD, + _CISDh, + _CSD, + _CSDa, + _CFD, + _CTOD, + _ICD, + ), + ( + (EVENT_TYPE, 0), + (OPERATION_SUB_TYPE, 0), + (EVENT_ID, {_s: 1}), + (OPERATION_ID, 0), + (OPERATION_NAME, 0), + (EXECUTION_TIMESTAMP, 0), + (OPERATION_ID, 0), + (EXECUTION_STARTED_DETAILS, 0), + (EXECUTION_SUCCEEDED_DETAILS, 0), + (EXECUTION_FAILED_DETAILS, 0), + (EXECUTION_TIMED_OUT_DETAILS, 0), + (EXECUTION_STOPPED_DETAILS, 0), + (CONTEXT_STARTED_DETAILS, 0), + (CONTEXT_SUCCEEDED_DETAILS, 0), + (CONTEXT_FAILED_DETAILS, 0), + (WAIT_STARTED_DETAILS, 0), + (WAIT_SUCCEEDED_DETAILS, 0), + (WAIT_CANCELLED_DETAILS, 0), + (STEP_STARTED_DETAILS, 0), + (STEP_SUCCEEDED_DETAILS, 0), + (STEP_FAILED_DETAILS, 0), + (CHAINED_INVOKE_STARTED_DETAILS, 0), + (CHAINED_INVOKE_SUCCEEDED_DETAILS, 0), + (CHAINED_INVOKE_FAILED_DETAILS, 0), + (CHAINED_INVOKE_TIMED_OUT_DETAILS, 0), + (CHAINED_INVOKE_STOPPED_DETAILS, 0), + (CALLBACK_STARTED_DETAILS, 0), + (CALLBACK_SUCCEEDED_DETAILS, 0), + (CALLBACK_FAILED_DETAILS, 0), + (CALLBACK_TIMED_OUT_DETAILS, 0), + (INVOCATION_COMPLETED_DETAILS, 0), + ), ) -CONTEXT_OPTIONS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ContextOptions"), - members={"ReplayChildren": {"target": REPLAY_CHILDREN}}, +EVENTS: StaticSchema = (16, n0, _Eve, 0, (_me,), ((EVENT, 0),)) + +GET_DURABLE_EXECUTION_HISTORY_OUTPUT: StaticSchema = ( + 18, + n0, + _GDEHO, + {_sSI: _cGDEHRo, _smit: None}, + (_Eve, _NM), + ((EVENTS, 1), (STRING, 0)), +) + +GET_DURABLE_EXECUTION_HISTORY: StaticOperationSchema = ( + 23, + n0, + _GDEH, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/2025-12-01/durable-executions/{DurableExecutionArn}/history", + "code": 200, + } + ) + }, + GET_DURABLE_EXECUTION_HISTORY_INPUT, + GET_DURABLE_EXECUTION_HISTORY_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + KMS_ACCESS_DENIED_EXCEPTION, + KMS_DISABLED_EXCEPTION, + KMS_INVALID_STATE_EXCEPTION, + KMS_NOT_FOUND_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -ERROR_DATA = Schema( - id=ShapeID("com.amazonaws.lambda#ErrorData"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +GET_DURABLE_EXECUTION_STATE_INPUT: StaticSchema = ( + 18, + n0, + _GDESI, + {_sSI: _cGDESR, _sm: None}, + (_DEA, _CT, _Mar, _MI), + ( + (DURABLE_EXECUTION_ARN, 9), + (CHECKPOINT_TOKEN, {_sQ: _CT, _smi: None}), + (STRING, {_sQ: _Mar}), + (ITEM_COUNT, {_s: 0, _sQ: _MI}), + ), ) -ERROR_MESSAGE = Schema( - id=ShapeID("com.amazonaws.lambda#ErrorMessage"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +GET_DURABLE_EXECUTION_STATE_OUTPUT: StaticSchema = ( + 18, + n0, + _GDESO, + {_sSI: _cGDESRo, _smit: None}, + (_Ope, _NM), + ((OPERATIONS, 1), (STRING, 0)), +) + +GET_DURABLE_EXECUTION_STATE: StaticOperationSchema = ( + 23, + n0, + _GDES, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/2025-12-01/durable-executions/{DurableExecutionArn}/state", + "code": 200, + } + ) + }, + GET_DURABLE_EXECUTION_STATE_INPUT, + GET_DURABLE_EXECUTION_STATE_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + KMS_ACCESS_DENIED_EXCEPTION, + KMS_DISABLED_EXCEPTION, + KMS_INVALID_STATE_EXCEPTION, + KMS_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -ERROR_TYPE = Schema( - id=ShapeID("com.amazonaws.lambda#ErrorType"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +STOP_DURABLE_EXECUTION_INPUT: StaticSchema = ( + 18, + n0, + _SDEI, + {_sSI: _cSDER, _sm: None}, + (_DEA, _E), + ((DURABLE_EXECUTION_ARN, 9), (ERROR_OBJECT, 16)), +) + +STOP_DURABLE_EXECUTION_OUTPUT: StaticSchema = ( + 18, + n0, + _SDEO, + {_sSI: _cSDERo, _smit: None}, + (_STto,), + ((EXECUTION_TIMESTAMP, 1),), +) + +STOP_DURABLE_EXECUTION: StaticOperationSchema = ( + 23, + n0, + _SDE, + { + _smithy: MappingProxyType( + { + "method": "POST", + "uri": "/2025-12-01/durable-executions/{DurableExecutionArn}/stop", + "code": 200, + } + ) + }, + STOP_DURABLE_EXECUTION_INPUT, + STOP_DURABLE_EXECUTION_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + KMS_ACCESS_DENIED_EXCEPTION, + KMS_DISABLED_EXCEPTION, + KMS_INVALID_STATE_EXCEPTION, + KMS_NOT_FOUND_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -STACK_TRACE_ENTRY = Schema( - id=ShapeID("com.amazonaws.lambda#StackTraceEntry"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) +BATCH_SIZE: StaticSchema = (7, n0, _BS, 0) -STACK_TRACE_ENTRIES = Schema.collection( - id=ShapeID("com.amazonaws.lambda#StackTraceEntries"), - shape_type=ShapeType.LIST, - members={"member": {"target": STACK_TRACE_ENTRY}}, -) +BISECT_BATCH_ON_FUNCTION_ERROR: StaticSchema = (2, n0, _BBOFE, 0) -ERROR_OBJECT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ErrorObject"), - members={ - "ErrorMessage": {"target": ERROR_MESSAGE}, - "ErrorType": {"target": ERROR_TYPE}, - "ErrorData": {"target": ERROR_DATA}, - "StackTrace": {"target": STACK_TRACE_ENTRIES}, - }, -) +DESTINATION_ARN: StaticSchema = (3, n0, _DA, 0) -OPERATION_ID = Schema( - id=ShapeID("com.amazonaws.lambda#OperationId"), shape_type=ShapeType.STRING -) +ON_FAILURE: StaticSchema = (18, n0, _OF, 0, (_Des,), ((DESTINATION_ARN, 0),)) -OPERATION_NAME = Schema( - id=ShapeID("com.amazonaws.lambda#OperationName"), shape_type=ShapeType.STRING -) +ON_SUCCESS: StaticSchema = (18, n0, _OSn, 0, (_Des,), ((DESTINATION_ARN, 0),)) -OPERATION_PAYLOAD = Schema( - id=ShapeID("com.amazonaws.lambda#OperationPayload"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +DESTINATION_CONFIG: StaticSchema = ( + 18, + n0, + _DCe, + 0, + (_OSn, _OF), + ((ON_SUCCESS, 0), (ON_FAILURE, 0)), ) -STEP_OPTIONS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#StepOptions"), - members={"NextAttemptDelaySeconds": {"target": DURATION_SECONDS}}, -) +COLLECTION_NAME: StaticSchema = (3, n0, _CN, 0) -OPERATION_SUB_TYPE = Schema( - id=ShapeID("com.amazonaws.lambda#OperationSubType"), shape_type=ShapeType.STRING -) +DATABASE_NAME: StaticSchema = (3, n0, _DN, 0) -OPERATION_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.lambda#OperationType"), - shape_type=ShapeType.ENUM, - members={ - "EXECUTION": {"target": UNIT}, - "CONTEXT": {"target": UNIT}, - "STEP": {"target": UNIT}, - "WAIT": {"target": UNIT}, - "CALLBACK": {"target": UNIT}, - "CHAINED_INVOKE": {"target": UNIT}, - }, +FULL_DOCUMENT: StaticSchema = ( + 14, + n0, + _FD, + 0, + (_UL, _Def), + ((-1, {_sV: _UL}), (-1, {_sV: _Def})), ) -WAIT_OPTIONS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#WaitOptions"), - members={"WaitSeconds": {"target": DURATION_SECONDS}}, -) - -OPERATION_UPDATE = Schema.collection( - id=ShapeID("com.amazonaws.lambda#OperationUpdate"), - members={ - "Id": { - "target": OPERATION_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ParentId": {"target": OPERATION_ID}, - "Name": {"target": OPERATION_NAME}, - "Type": { - "target": OPERATION_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "SubType": {"target": OPERATION_SUB_TYPE}, - "Action": { - "target": OPERATION_ACTION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Payload": {"target": OPERATION_PAYLOAD}, - "Error": {"target": ERROR_OBJECT}, - "ContextOptions": {"target": CONTEXT_OPTIONS}, - "StepOptions": {"target": STEP_OPTIONS}, - "WaitOptions": {"target": WAIT_OPTIONS}, - "CallbackOptions": {"target": CALLBACK_OPTIONS}, - "ChainedInvokeOptions": {"target": CHAINED_INVOKE_OPTIONS}, - }, +DOCUMENT_DB_EVENT_SOURCE_CONFIG: StaticSchema = ( + 18, + n0, + _DDBESC, + 0, + (_DN, _CN, _FD), + ((DATABASE_NAME, 0), (COLLECTION_NAME, 0), (FULL_DOCUMENT, 0)), ) -OPERATION_UPDATES = Schema.collection( - id=ShapeID("com.amazonaws.lambda#OperationUpdates"), - shape_type=ShapeType.LIST, - members={"member": {"target": OPERATION_UPDATE}}, -) +ENABLED: StaticSchema = (2, n0, _Ena, 0) -CHECKPOINT_DURABLE_EXECUTION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#CheckpointDurableExecutionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#CheckpointDurableExecutionRequest", - ) - ], - members={ - "DurableExecutionArn": { - "target": DURABLE_EXECUTION_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "CheckpointToken": { - "target": CHECKPOINT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Updates": {"target": OPERATION_UPDATES}, - "ClientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - }, -) +PATTERN: StaticSchema = (3, n0, _Pat, 0) -CALLBACK_ID = Schema( - id=ShapeID("com.amazonaws.lambda#CallbackId"), shape_type=ShapeType.STRING -) +FILTER: StaticSchema = (18, n0, _Fi, 0, (_Pat,), ((PATTERN, 0),)) -CALLBACK_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#CallbackDetails"), - members={ - "CallbackId": {"target": CALLBACK_ID}, - "Result": {"target": OPERATION_PAYLOAD}, - "Error": {"target": ERROR_OBJECT}, - }, -) +FILTER_LIST: StaticSchema = (16, n0, _FL, 0, (_me,), ((FILTER, 0),)) -CHAINED_INVOKE_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ChainedInvokeDetails"), - members={ - "Result": {"target": OPERATION_PAYLOAD}, - "Error": {"target": ERROR_OBJECT}, - }, -) +FILTER_CRITERIA: StaticSchema = (18, n0, _FCi, 0, (_Fil,), ((FILTER_LIST, 0),)) -CONTEXT_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ContextDetails"), - members={ - "ReplayChildren": {"target": REPLAY_CHILDREN}, - "Result": {"target": OPERATION_PAYLOAD}, - "Error": {"target": ERROR_OBJECT}, - }, +FUNCTION_RESPONSE_TYPE: StaticSchema = ( + 14, + n0, + _FRT, + 0, + (_RBIF,), + ((-1, {_sV: _RBIF}),), ) -EXECUTION_TIMESTAMP = Schema( - id=ShapeID("com.amazonaws.lambda#ExecutionTimestamp"), - shape_type=ShapeType.TIMESTAMP, +FUNCTION_RESPONSE_TYPE_LIST: StaticSchema = ( + 16, + n0, + _FRTL, + 0, + (_me,), + ((FUNCTION_RESPONSE_TYPE, 0),), ) -INPUT_PAYLOAD = Schema( - id=ShapeID("com.amazonaws.lambda#InputPayload"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +EVENT_SOURCE_MAPPING_SYSTEM_LOG_LEVEL: StaticSchema = ( + 14, + n0, + _ESMSLL, + 0, + (_De, _In, _Wa), + ((-1, {_sV: _DEBUG}), (-1, {_sV: _INFO}), (-1, {_sV: _WARN})), ) -EXECUTION_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ExecutionDetails"), - members={"InputPayload": {"target": INPUT_PAYLOAD}}, +EVENT_SOURCE_MAPPING_LOGGING_CONFIG: StaticSchema = ( + 18, + n0, + _ESMLC, + 0, + (_SLL,), + ((EVENT_SOURCE_MAPPING_SYSTEM_LOG_LEVEL, 0),), ) -OPERATION_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#OperationStatus"), - shape_type=ShapeType.ENUM, - members={ - "STARTED": {"target": UNIT}, - "PENDING": {"target": UNIT}, - "READY": {"target": UNIT}, - "SUCCEEDED": {"target": UNIT}, - "FAILED": {"target": UNIT}, - "CANCELLED": {"target": UNIT}, - "TIMED_OUT": {"target": UNIT}, - "STOPPED": {"target": UNIT}, - }, -) +MAXIMUM_BATCHING_WINDOW_IN_SECONDS: StaticSchema = (7, n0, _MBWIS, 0) -STEP_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#StepDetails"), - members={ - "Attempt": { - "target": ATTEMPT_COUNT, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "NextAttemptTimestamp": {"target": EXECUTION_TIMESTAMP}, - "Result": {"target": OPERATION_PAYLOAD}, - "Error": {"target": ERROR_OBJECT}, - }, -) +MAXIMUM_RECORD_AGE_IN_SECONDS: StaticSchema = (7, n0, _MRAIS, 0) -WAIT_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#WaitDetails"), - members={"ScheduledEndTimestamp": {"target": EXECUTION_TIMESTAMP}}, -) - -OPERATION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#Operation"), - members={ - "Id": { - "target": OPERATION_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ParentId": {"target": OPERATION_ID}, - "Name": {"target": OPERATION_NAME}, - "Type": { - "target": OPERATION_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "SubType": {"target": OPERATION_SUB_TYPE}, - "StartTimestamp": { - "target": EXECUTION_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "EndTimestamp": {"target": EXECUTION_TIMESTAMP}, - "Status": { - "target": OPERATION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ExecutionDetails": {"target": EXECUTION_DETAILS}, - "ContextDetails": {"target": CONTEXT_DETAILS}, - "StepDetails": {"target": STEP_DETAILS}, - "WaitDetails": {"target": WAIT_DETAILS}, - "CallbackDetails": {"target": CALLBACK_DETAILS}, - "ChainedInvokeDetails": {"target": CHAINED_INVOKE_DETAILS}, - }, -) +MAXIMUM_RETRY_ATTEMPTS_EVENT_SOURCE_MAPPING: StaticSchema = (7, n0, _MRAESM, 0) -OPERATIONS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#Operations"), - shape_type=ShapeType.LIST, - members={"member": {"target": OPERATION}}, +EVENT_SOURCE_MAPPING_METRIC: StaticSchema = ( + 14, + n0, + _ESMM, + 0, + (_EC, _ECr, _KM), + ((-1, {_sV: _EC}), (-1, {_sV: _ECr}), (-1, {_sV: _KM})), ) -CHECKPOINT_UPDATED_EXECUTION_STATE = Schema.collection( - id=ShapeID("com.amazonaws.lambda#CheckpointUpdatedExecutionState"), - members={"Operations": {"target": OPERATIONS}, "NextMarker": {"target": STRING}}, +EVENT_SOURCE_MAPPING_METRIC_LIST: StaticSchema = ( + 16, + n0, + _ESMML, + 0, + (_me,), + ((EVENT_SOURCE_MAPPING_METRIC, 0),), ) -CHECKPOINT_DURABLE_EXECUTION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#CheckpointDurableExecutionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#CheckpointDurableExecutionResponse", - ) - ], - members={ - "CheckpointToken": {"target": CHECKPOINT_TOKEN}, - "NewExecutionState": { - "target": CHECKPOINT_UPDATED_EXECUTION_STATE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +EVENT_SOURCE_MAPPING_METRICS_CONFIG: StaticSchema = ( + 18, + n0, + _ESMMC, + 0, + (_Met,), + ((EVENT_SOURCE_MAPPING_METRIC_LIST, 0),), ) -KMS_ACCESS_DENIED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#KMSAccessDeniedException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="server"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=502), - ], - members={"Type": {"target": STRING}, "Message": {"target": STRING}}, -) - -KMS_DISABLED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#KMSDisabledException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="server"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=502), - ], - members={"Type": {"target": STRING}, "Message": {"target": STRING}}, -) - -KMS_INVALID_STATE_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#KMSInvalidStateException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="server"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=502), - ], - members={"Type": {"target": STRING}, "Message": {"target": STRING}}, -) - -KMS_NOT_FOUND_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#KMSNotFoundException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="server"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=502), - ], - members={"Type": {"target": STRING}, "Message": {"target": STRING}}, -) - -CHECKPOINT_DURABLE_EXECUTION = Schema( - id=ShapeID("com.amazonaws.lambda#CheckpointDurableExecution"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/2025-12-01/durable-executions/{DurableExecutionArn}/checkpoint", - "code": 200, - } - ), - ) - ], -) +PARALLELIZATION_FACTOR: StaticSchema = (7, n0, _PF, 0) -INCLUDE_EXECUTION_DATA = Schema( - id=ShapeID("com.amazonaws.lambda#IncludeExecutionData"), - shape_type=ShapeType.BOOLEAN, -) +MAXIMUM_NUMBER_OF_POLLERS: StaticSchema = (7, n0, _MNOP, 0) -GET_DURABLE_EXECUTION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#GetDurableExecutionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#GetDurableExecutionRequest", - ) - ], - members={ - "DurableExecutionArn": { - "target": DURABLE_EXECUTION_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "IncludeExecutionData": { - "target": INCLUDE_EXECUTION_DATA, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=True), - Trait.new( - id=ShapeID("smithy.api#httpQuery"), value="IncludeExecutionData" - ), - ], - }, - }, -) +MINIMUM_NUMBER_OF_POLLERS: StaticSchema = (7, n0, _MNOPi, 0) -EXECUTION_TIMEOUT = Schema( - id=ShapeID("com.amazonaws.lambda#ExecutionTimeout"), shape_type=ShapeType.INTEGER -) +PROVISIONED_POLLER_GROUP_NAME: StaticSchema = (3, n0, _PPGN, 0) -RETENTION_PERIOD_IN_DAYS = Schema( - id=ShapeID("com.amazonaws.lambda#RetentionPeriodInDays"), - shape_type=ShapeType.INTEGER, +PROVISIONED_POLLER_CONFIG: StaticSchema = ( + 18, + n0, + _PPC, + 0, + (_MP, _MPa, _PGN), + ( + (MINIMUM_NUMBER_OF_POLLERS, 0), + (MAXIMUM_NUMBER_OF_POLLERS, 0), + (PROVISIONED_POLLER_GROUP_NAME, 0), + ), ) -DURABLE_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.lambda#DurableConfig"), - members={ - "KMSKeyArn": {"target": KMS_KEY_ARN}, - "RetentionPeriodInDays": {"target": RETENTION_PERIOD_IN_DAYS}, - "ExecutionTimeout": {"target": EXECUTION_TIMEOUT}, - }, -) +QUEUE: StaticSchema = (3, n0, _Qu, 0) -DURABLE_EXECUTION_NAME = Schema( - id=ShapeID("com.amazonaws.lambda#DurableExecutionName"), shape_type=ShapeType.STRING -) +QUEUES: StaticSchema = (16, n0, _Que, 0, (_me,), ((QUEUE, 0),)) -EXECUTION_DATA_INCLUDED = Schema( - id=ShapeID("com.amazonaws.lambda#ExecutionDataIncluded"), - shape_type=ShapeType.BOOLEAN, -) +MAXIMUM_CONCURRENCY: StaticSchema = (7, n0, _MC, 0) -OUTPUT_PAYLOAD = Schema( - id=ShapeID("com.amazonaws.lambda#OutputPayload"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) +SCALING_CONFIG: StaticSchema = (18, n0, _SCc, 0, (_MC,), ((MAXIMUM_CONCURRENCY, 0),)) -EXECUTION_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ExecutionStatus"), - shape_type=ShapeType.ENUM, - members={ - "RUNNING": {"target": UNIT}, - "SUCCEEDED": {"target": UNIT}, - "FAILED": {"target": UNIT}, - "TIMED_OUT": {"target": UNIT}, - "STOPPED": {"target": UNIT}, - }, -) +END_POINT_TYPE: StaticSchema = (14, n0, _EPT, 0, (_KBS,), ((-1, {_sV: _KBS}),)) -X_AMZN_TRACE_ID = Schema( - id=ShapeID("com.amazonaws.lambda#XAmznTraceId"), shape_type=ShapeType.STRING -) +ENDPOINT: StaticSchema = (3, n0, _End, 0) + +ENDPOINT_LISTS: StaticSchema = (16, n0, _EL, 0, (_me,), ((ENDPOINT, 0),)) -TRACE_HEADER = Schema.collection( - id=ShapeID("com.amazonaws.lambda#TraceHeader"), - members={"XAmznTraceId": {"target": X_AMZN_TRACE_ID}}, +ENDPOINTS: StaticSchema = ( + 17, + n0, + _Endp, + 0, + (_k, _v), + ((END_POINT_TYPE, 0), (ENDPOINT_LISTS, 0)), ) -VERSION_WITH_LATEST_PUBLISHED = Schema( - id=ShapeID("com.amazonaws.lambda#VersionWithLatestPublished"), - shape_type=ShapeType.STRING, +SELF_MANAGED_EVENT_SOURCE: StaticSchema = ( + 18, + n0, + _SMES, + 0, + (_Endp,), + ((ENDPOINTS, 0),), ) -GET_DURABLE_EXECUTION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#GetDurableExecutionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#GetDurableExecutionResponse", - ) - ], - members={ - "DurableExecutionArn": { - "target": DURABLE_EXECUTION_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "DurableExecutionName": { - "target": DURABLE_EXECUTION_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "FunctionArn": { - "target": NAME_SPACED_FUNCTION_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "InputPayload": {"target": INPUT_PAYLOAD}, - "Result": {"target": OUTPUT_PAYLOAD}, - "Error": {"target": ERROR_OBJECT}, - "StartTimestamp": { - "target": EXECUTION_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Status": { - "target": EXECUTION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "EndTimestamp": {"target": EXECUTION_TIMESTAMP}, - "Version": {"target": VERSION_WITH_LATEST_PUBLISHED}, - "TraceHeader": {"target": TRACE_HEADER}, - "ExecutionDataIncluded": {"target": EXECUTION_DATA_INCLUDED}, - "DurableConfig": {"target": DURABLE_CONFIG}, - }, +SELF_MANAGED_KAFKA_EVENT_SOURCE_CONFIG: StaticSchema = ( + 18, + n0, + _SMKESC, + 0, + (_CGI, _SRC), + ((URI, 0), (KAFKA_SCHEMA_REGISTRY_CONFIG, 0)), ) -GET_DURABLE_EXECUTION = Schema( - id=ShapeID("com.amazonaws.lambda#GetDurableExecution"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/2025-12-01/durable-executions/{DurableExecutionArn}", - "code": 200, - } - ), - ) - ], +SOURCE_ACCESS_TYPE: StaticSchema = ( + 14, + n0, + _SAT, + 0, + (_BA, _VS, _VSG, _SSA, _SSA_, _VH, _CCTA, _SRCC), + ( + (-1, {_sV: _BA}), + (-1, {_sV: _VS}), + (-1, {_sV: _VSG}), + (-1, {_sV: _SSA}), + (-1, {_sV: _SSA_}), + (-1, {_sV: _VH}), + (-1, {_sV: _CCTA}), + (-1, {_sV: _SRCC}), + ), ) -ITEM_COUNT = Schema( - id=ShapeID("com.amazonaws.lambda#ItemCount"), - shape_type=ShapeType.INTEGER, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=0)], +SOURCE_ACCESS_CONFIGURATION: StaticSchema = ( + 18, + n0, + _SAC, + 0, + (_T, _URI), + ((SOURCE_ACCESS_TYPE, 0), (URI, 0)), +) + +SOURCE_ACCESS_CONFIGURATIONS: StaticSchema = ( + 16, + n0, + _SACo, + 0, + (_me,), + ((SOURCE_ACCESS_CONFIGURATION, 0),), +) + +EVENT_SOURCE_POSITION: StaticSchema = ( + 14, + n0, + _ESP, + 0, + (_TH_, _LATEST, _AT), + ((-1, {_sV: _TH_}), (-1, {_sV: _LATEST}), (-1, {_sV: _AT})), +) + +DATE: StaticSchema = (4, n0, _Da, 0) + +TOPIC: StaticSchema = (3, n0, _To, 0) + +TOPICS: StaticSchema = (16, n0, _Top, 0, (_me,), ((TOPIC, 0),)) + +TUMBLING_WINDOW_IN_SECONDS: StaticSchema = (7, n0, _TWIS, 0) + +CREATE_EVENT_SOURCE_MAPPING_INPUT: StaticSchema = ( + 18, + n0, + _CESMI, + {_sSI: _cCESMR, _sm: None}, + ( + _ESA, + _FN, + _Ena, + _BS, + _FCi, + _KMSKA, + _MCe, + _LC, + _SCc, + _MBWIS, + _PF, + _SPt, + _SPT, + _DCe, + _MRAIS, + _BBOFE, + _MRA, + _Ta, + _TWIS, + _Top, + _Que, + _SACo, + _SMES, + _FRTu, + _AMKESC, + _SMKESC, + _DDBESC, + _PPC, + ), + ( + (ARN, 0), + (NAMESPACED_FUNCTION_NAME, 1), + (ENABLED, 0), + (BATCH_SIZE, 0), + (FILTER_CRITERIA, 0), + (KMS_KEY_ARN, 0), + (EVENT_SOURCE_MAPPING_METRICS_CONFIG, 0), + (EVENT_SOURCE_MAPPING_LOGGING_CONFIG, 0), + (SCALING_CONFIG, 0), + (MAXIMUM_BATCHING_WINDOW_IN_SECONDS, 0), + (PARALLELIZATION_FACTOR, 0), + (EVENT_SOURCE_POSITION, 0), + (DATE, 0), + (DESTINATION_CONFIG, 0), + (MAXIMUM_RECORD_AGE_IN_SECONDS, 0), + (BISECT_BATCH_ON_FUNCTION_ERROR, 0), + (MAXIMUM_RETRY_ATTEMPTS_EVENT_SOURCE_MAPPING, 0), + (TAGS, 0), + (TUMBLING_WINDOW_IN_SECONDS, 0), + (TOPICS, 0), + (QUEUES, 0), + (SOURCE_ACCESS_CONFIGURATIONS, 0), + (SELF_MANAGED_EVENT_SOURCE, 0), + (FUNCTION_RESPONSE_TYPE_LIST, 0), + (AMAZON_MANAGED_KAFKA_EVENT_SOURCE_CONFIG, 0), + (SELF_MANAGED_KAFKA_EVENT_SOURCE_CONFIG, 0), + (DOCUMENT_DB_EVENT_SOURCE_CONFIG, 0), + (PROVISIONED_POLLER_CONFIG, 0), + ), ) -REVERSE_ORDER = Schema( - id=ShapeID("com.amazonaws.lambda#ReverseOrder"), shape_type=ShapeType.BOOLEAN +EVENT_SOURCE_MAPPING_ARN: StaticSchema = (3, n0, _ESMA, 0) + +FILTER_CRITERIA_ERROR_CODE: StaticSchema = (3, n0, _FCEC, 0) + +FILTER_CRITERIA_ERROR_MESSAGE: StaticSchema = (3, n0, _FCEM, 0) + +FILTER_CRITERIA_ERROR: StaticSchema = ( + 18, + n0, + _FCE, + 0, + (_ECrr, _M), + ((FILTER_CRITERIA_ERROR_CODE, 0), (FILTER_CRITERIA_ERROR_MESSAGE, 0)), +) + +UUID_STRING: StaticSchema = (3, n0, _UUIDS, 0) + +CREATE_EVENT_SOURCE_MAPPING_OUTPUT: StaticSchema = ( + 18, + n0, + _CESMO, + {_sSI: _cESMC, _smit: None}, + ( + _UUID, + _SPt, + _SPT, + _BS, + _MBWIS, + _PF, + _ESA, + _FCi, + _FCE, + _KMSKA, + _MCe, + _LC, + _SCc, + _FA, + _LM, + _LPR, + _Sta, + _STR, + _DCe, + _Top, + _Que, + _SACo, + _SMES, + _MRAIS, + _BBOFE, + _MRA, + _TWIS, + _FRTu, + _AMKESC, + _SMKESC, + _DDBESC, + _ESMA, + _PPC, + ), + ( + (UUID_STRING, 0), + (EVENT_SOURCE_POSITION, 0), + (DATE, 0), + (BATCH_SIZE, 0), + (MAXIMUM_BATCHING_WINDOW_IN_SECONDS, 0), + (PARALLELIZATION_FACTOR, 0), + (ARN, 0), + (FILTER_CRITERIA, 0), + (FILTER_CRITERIA_ERROR, 0), + (KMS_KEY_ARN, 0), + (EVENT_SOURCE_MAPPING_METRICS_CONFIG, 0), + (EVENT_SOURCE_MAPPING_LOGGING_CONFIG, 0), + (SCALING_CONFIG, 0), + (FUNCTION_ARN, 0), + (DATE, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (DESTINATION_CONFIG, 0), + (TOPICS, 0), + (QUEUES, 0), + (SOURCE_ACCESS_CONFIGURATIONS, 0), + (SELF_MANAGED_EVENT_SOURCE, 0), + (MAXIMUM_RECORD_AGE_IN_SECONDS, 0), + (BISECT_BATCH_ON_FUNCTION_ERROR, 0), + (MAXIMUM_RETRY_ATTEMPTS_EVENT_SOURCE_MAPPING, 0), + (TUMBLING_WINDOW_IN_SECONDS, 0), + (FUNCTION_RESPONSE_TYPE_LIST, 0), + (AMAZON_MANAGED_KAFKA_EVENT_SOURCE_CONFIG, 0), + (SELF_MANAGED_KAFKA_EVENT_SOURCE_CONFIG, 0), + (DOCUMENT_DB_EVENT_SOURCE_CONFIG, 0), + (EVENT_SOURCE_MAPPING_ARN, 0), + (PROVISIONED_POLLER_CONFIG, 0), + ), ) -GET_DURABLE_EXECUTION_HISTORY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#GetDurableExecutionHistoryInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#GetDurableExecutionHistoryRequest", +CREATE_EVENT_SOURCE_MAPPING: StaticOperationSchema = ( + 23, + n0, + _CESM, + { + _smithy: MappingProxyType( + {"method": "POST", "uri": "/2015-03-31/event-source-mappings", "code": 202} ) - ], - members={ - "DurableExecutionArn": { - "target": DURABLE_EXECUTION_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "IncludeExecutionData": { - "target": INCLUDE_EXECUTION_DATA, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpQuery"), value="IncludeExecutionData" - ) - ], - }, - "MaxItems": { - "target": ITEM_COUNT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=0), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="MaxItems"), - ], - }, - "Marker": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="Marker")], - }, - "ReverseOrder": { - "target": REVERSE_ORDER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="ReverseOrder") - ], - }, }, + CREATE_EVENT_SOURCE_MAPPING_INPUT, + CREATE_EVENT_SOURCE_MAPPING_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -TRUNCATED = Schema( - id=ShapeID("com.amazonaws.lambda#Truncated"), shape_type=ShapeType.BOOLEAN +DELETE_EVENT_SOURCE_MAPPING_INPUT: StaticSchema = ( + 18, + n0, + _DESMI, + {_sSI: _cDESMR, _sm: None}, + (_UUID,), + ((UUID_STRING, 9),), +) + +DELETE_EVENT_SOURCE_MAPPING_OUTPUT: StaticSchema = ( + 18, + n0, + _DESMO, + {_sSI: _cESMC, _smit: None}, + ( + _UUID, + _SPt, + _SPT, + _BS, + _MBWIS, + _PF, + _ESA, + _FCi, + _FCE, + _KMSKA, + _MCe, + _LC, + _SCc, + _FA, + _LM, + _LPR, + _Sta, + _STR, + _DCe, + _Top, + _Que, + _SACo, + _SMES, + _MRAIS, + _BBOFE, + _MRA, + _TWIS, + _FRTu, + _AMKESC, + _SMKESC, + _DDBESC, + _ESMA, + _PPC, + ), + ( + (UUID_STRING, 0), + (EVENT_SOURCE_POSITION, 0), + (DATE, 0), + (BATCH_SIZE, 0), + (MAXIMUM_BATCHING_WINDOW_IN_SECONDS, 0), + (PARALLELIZATION_FACTOR, 0), + (ARN, 0), + (FILTER_CRITERIA, 0), + (FILTER_CRITERIA_ERROR, 0), + (KMS_KEY_ARN, 0), + (EVENT_SOURCE_MAPPING_METRICS_CONFIG, 0), + (EVENT_SOURCE_MAPPING_LOGGING_CONFIG, 0), + (SCALING_CONFIG, 0), + (FUNCTION_ARN, 0), + (DATE, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (DESTINATION_CONFIG, 0), + (TOPICS, 0), + (QUEUES, 0), + (SOURCE_ACCESS_CONFIGURATIONS, 0), + (SELF_MANAGED_EVENT_SOURCE, 0), + (MAXIMUM_RECORD_AGE_IN_SECONDS, 0), + (BISECT_BATCH_ON_FUNCTION_ERROR, 0), + (MAXIMUM_RETRY_ATTEMPTS_EVENT_SOURCE_MAPPING, 0), + (TUMBLING_WINDOW_IN_SECONDS, 0), + (FUNCTION_RESPONSE_TYPE_LIST, 0), + (AMAZON_MANAGED_KAFKA_EVENT_SOURCE_CONFIG, 0), + (SELF_MANAGED_KAFKA_EVENT_SOURCE_CONFIG, 0), + (DOCUMENT_DB_EVENT_SOURCE_CONFIG, 0), + (EVENT_SOURCE_MAPPING_ARN, 0), + (PROVISIONED_POLLER_CONFIG, 0), + ), ) -EVENT_ERROR = Schema.collection( - id=ShapeID("com.amazonaws.lambda#EventError"), - members={"Payload": {"target": ERROR_OBJECT}, "Truncated": {"target": TRUNCATED}}, +RESOURCE_IN_USE_EXCEPTION: StaticSchema = ( + 18, + n0, + _RIUE, + {_smith: _c, _sE: 400}, + (_T, _M), + ((STRING, 0), (STRING, 0)), +) + +DELETE_EVENT_SOURCE_MAPPING: StaticOperationSchema = ( + 23, + n0, + _DESM, + { + _smithy: MappingProxyType( + { + "method": "DELETE", + "uri": "/2015-03-31/event-source-mappings/{UUID}", + "code": 202, + } + ) + }, + DELETE_EVENT_SOURCE_MAPPING_INPUT, + DELETE_EVENT_SOURCE_MAPPING_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + RESOURCE_IN_USE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -CALLBACK_FAILED_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#CallbackFailedDetails"), - members={ - "Error": { - "target": EVENT_ERROR, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +GET_EVENT_SOURCE_MAPPING_INPUT: StaticSchema = ( + 18, + n0, + _GESMI, + {_sSI: _cGESMR, _sm: None}, + (_UUID,), + ((UUID_STRING, 9),), +) + +GET_EVENT_SOURCE_MAPPING_OUTPUT: StaticSchema = ( + 18, + n0, + _GESMO, + {_sSI: _cESMC, _smit: None}, + ( + _UUID, + _SPt, + _SPT, + _BS, + _MBWIS, + _PF, + _ESA, + _FCi, + _FCE, + _KMSKA, + _MCe, + _LC, + _SCc, + _FA, + _LM, + _LPR, + _Sta, + _STR, + _DCe, + _Top, + _Que, + _SACo, + _SMES, + _MRAIS, + _BBOFE, + _MRA, + _TWIS, + _FRTu, + _AMKESC, + _SMKESC, + _DDBESC, + _ESMA, + _PPC, + ), + ( + (UUID_STRING, 0), + (EVENT_SOURCE_POSITION, 0), + (DATE, 0), + (BATCH_SIZE, 0), + (MAXIMUM_BATCHING_WINDOW_IN_SECONDS, 0), + (PARALLELIZATION_FACTOR, 0), + (ARN, 0), + (FILTER_CRITERIA, 0), + (FILTER_CRITERIA_ERROR, 0), + (KMS_KEY_ARN, 0), + (EVENT_SOURCE_MAPPING_METRICS_CONFIG, 0), + (EVENT_SOURCE_MAPPING_LOGGING_CONFIG, 0), + (SCALING_CONFIG, 0), + (FUNCTION_ARN, 0), + (DATE, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (DESTINATION_CONFIG, 0), + (TOPICS, 0), + (QUEUES, 0), + (SOURCE_ACCESS_CONFIGURATIONS, 0), + (SELF_MANAGED_EVENT_SOURCE, 0), + (MAXIMUM_RECORD_AGE_IN_SECONDS, 0), + (BISECT_BATCH_ON_FUNCTION_ERROR, 0), + (MAXIMUM_RETRY_ATTEMPTS_EVENT_SOURCE_MAPPING, 0), + (TUMBLING_WINDOW_IN_SECONDS, 0), + (FUNCTION_RESPONSE_TYPE_LIST, 0), + (AMAZON_MANAGED_KAFKA_EVENT_SOURCE_CONFIG, 0), + (SELF_MANAGED_KAFKA_EVENT_SOURCE_CONFIG, 0), + (DOCUMENT_DB_EVENT_SOURCE_CONFIG, 0), + (EVENT_SOURCE_MAPPING_ARN, 0), + (PROVISIONED_POLLER_CONFIG, 0), + ), ) -CALLBACK_STARTED_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#CallbackStartedDetails"), - members={ - "CallbackId": { - "target": CALLBACK_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "HeartbeatTimeout": {"target": DURATION_SECONDS}, - "Timeout": {"target": DURATION_SECONDS}, - }, +GET_EVENT_SOURCE_MAPPING: StaticOperationSchema = ( + 23, + n0, + _GESM, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/2015-03-31/event-source-mappings/{UUID}", + "code": 200, + } + ) + }, + GET_EVENT_SOURCE_MAPPING_INPUT, + GET_EVENT_SOURCE_MAPPING_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -EVENT_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#EventResult"), - members={ - "Payload": {"target": OPERATION_PAYLOAD}, - "Truncated": {"target": TRUNCATED}, - }, +LIST_EVENT_SOURCE_MAPPINGS_INPUT: StaticSchema = ( + 18, + n0, + _LESMI, + {_sSI: _cLESMR, _sm: None}, + (_ESA, _FN, _Mar, _MI), + ( + (ARN, {_sQ: _ESA}), + (NAMESPACED_FUNCTION_NAME, {_sQ: _FN}), + (STRING, {_sQ: _Mar}), + (MAX_LIST_ITEMS, {_sQ: _MI}), + ), ) -CALLBACK_SUCCEEDED_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#CallbackSucceededDetails"), - members={ - "Result": { - "target": EVENT_RESULT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +EVENT_SOURCE_MAPPING_CONFIGURATION: StaticSchema = ( + 18, + n0, + _ESMC, + 0, + ( + _UUID, + _SPt, + _SPT, + _BS, + _MBWIS, + _PF, + _ESA, + _FCi, + _FCE, + _KMSKA, + _MCe, + _LC, + _SCc, + _FA, + _LM, + _LPR, + _Sta, + _STR, + _DCe, + _Top, + _Que, + _SACo, + _SMES, + _MRAIS, + _BBOFE, + _MRA, + _TWIS, + _FRTu, + _AMKESC, + _SMKESC, + _DDBESC, + _ESMA, + _PPC, + ), + ( + (UUID_STRING, 0), + (EVENT_SOURCE_POSITION, 0), + (DATE, 0), + (BATCH_SIZE, 0), + (MAXIMUM_BATCHING_WINDOW_IN_SECONDS, 0), + (PARALLELIZATION_FACTOR, 0), + (ARN, 0), + (FILTER_CRITERIA, 0), + (FILTER_CRITERIA_ERROR, 0), + (KMS_KEY_ARN, 0), + (EVENT_SOURCE_MAPPING_METRICS_CONFIG, 0), + (EVENT_SOURCE_MAPPING_LOGGING_CONFIG, 0), + (SCALING_CONFIG, 0), + (FUNCTION_ARN, 0), + (DATE, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (DESTINATION_CONFIG, 0), + (TOPICS, 0), + (QUEUES, 0), + (SOURCE_ACCESS_CONFIGURATIONS, 0), + (SELF_MANAGED_EVENT_SOURCE, 0), + (MAXIMUM_RECORD_AGE_IN_SECONDS, 0), + (BISECT_BATCH_ON_FUNCTION_ERROR, 0), + (MAXIMUM_RETRY_ATTEMPTS_EVENT_SOURCE_MAPPING, 0), + (TUMBLING_WINDOW_IN_SECONDS, 0), + (FUNCTION_RESPONSE_TYPE_LIST, 0), + (AMAZON_MANAGED_KAFKA_EVENT_SOURCE_CONFIG, 0), + (SELF_MANAGED_KAFKA_EVENT_SOURCE_CONFIG, 0), + (DOCUMENT_DB_EVENT_SOURCE_CONFIG, 0), + (EVENT_SOURCE_MAPPING_ARN, 0), + (PROVISIONED_POLLER_CONFIG, 0), + ), ) -CALLBACK_TIMED_OUT_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#CallbackTimedOutDetails"), - members={ - "Error": { - "target": EVENT_ERROR, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +EVENT_SOURCE_MAPPINGS_LIST: StaticSchema = ( + 16, + n0, + _ESML, + 0, + (_me,), + ((EVENT_SOURCE_MAPPING_CONFIGURATION, 0),), +) + +LIST_EVENT_SOURCE_MAPPINGS_OUTPUT: StaticSchema = ( + 18, + n0, + _LESMO, + {_sSI: _cLESMRo, _smit: None}, + (_NM, _ESM), + ((STRING, 0), (EVENT_SOURCE_MAPPINGS_LIST, 0)), +) + +LIST_EVENT_SOURCE_MAPPINGS: StaticOperationSchema = ( + 23, + n0, + _LESM, + { + _smithy: MappingProxyType( + {"method": "GET", "uri": "/2015-03-31/event-source-mappings", "code": 200} + ) + }, + LIST_EVENT_SOURCE_MAPPINGS_INPUT, + LIST_EVENT_SOURCE_MAPPINGS_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -CHAINED_INVOKE_FAILED_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ChainedInvokeFailedDetails"), - members={ - "Error": { - "target": EVENT_ERROR, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +UPDATE_EVENT_SOURCE_MAPPING_INPUT: StaticSchema = ( + 18, + n0, + _UESMI, + {_sSI: _cUESMR, _sm: None}, + ( + _UUID, + _FN, + _Ena, + _BS, + _FCi, + _KMSKA, + _MCe, + _LC, + _SCc, + _MBWIS, + _PF, + _DCe, + _MRAIS, + _BBOFE, + _MRA, + _TWIS, + _SACo, + _FRTu, + _AMKESC, + _SMKESC, + _DDBESC, + _PPC, + ), + ( + (UUID_STRING, 9), + (NAMESPACED_FUNCTION_NAME, 0), + (ENABLED, 0), + (BATCH_SIZE, 0), + (FILTER_CRITERIA, 0), + (KMS_KEY_ARN, 0), + (EVENT_SOURCE_MAPPING_METRICS_CONFIG, 0), + (EVENT_SOURCE_MAPPING_LOGGING_CONFIG, 0), + (SCALING_CONFIG, 0), + (MAXIMUM_BATCHING_WINDOW_IN_SECONDS, 0), + (PARALLELIZATION_FACTOR, 0), + (DESTINATION_CONFIG, 0), + (MAXIMUM_RECORD_AGE_IN_SECONDS, 0), + (BISECT_BATCH_ON_FUNCTION_ERROR, 0), + (MAXIMUM_RETRY_ATTEMPTS_EVENT_SOURCE_MAPPING, 0), + (TUMBLING_WINDOW_IN_SECONDS, 0), + (SOURCE_ACCESS_CONFIGURATIONS, 0), + (FUNCTION_RESPONSE_TYPE_LIST, 0), + (AMAZON_MANAGED_KAFKA_EVENT_SOURCE_CONFIG, 0), + (SELF_MANAGED_KAFKA_EVENT_SOURCE_CONFIG, 0), + (DOCUMENT_DB_EVENT_SOURCE_CONFIG, 0), + (PROVISIONED_POLLER_CONFIG, 0), + ), ) -EVENT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#EventInput"), - members={"Payload": {"target": INPUT_PAYLOAD}, "Truncated": {"target": TRUNCATED}}, +UPDATE_EVENT_SOURCE_MAPPING_OUTPUT: StaticSchema = ( + 18, + n0, + _UESMO, + {_sSI: _cESMC, _smit: None}, + ( + _UUID, + _SPt, + _SPT, + _BS, + _MBWIS, + _PF, + _ESA, + _FCi, + _FCE, + _KMSKA, + _MCe, + _LC, + _SCc, + _FA, + _LM, + _LPR, + _Sta, + _STR, + _DCe, + _Top, + _Que, + _SACo, + _SMES, + _MRAIS, + _BBOFE, + _MRA, + _TWIS, + _FRTu, + _AMKESC, + _SMKESC, + _DDBESC, + _ESMA, + _PPC, + ), + ( + (UUID_STRING, 0), + (EVENT_SOURCE_POSITION, 0), + (DATE, 0), + (BATCH_SIZE, 0), + (MAXIMUM_BATCHING_WINDOW_IN_SECONDS, 0), + (PARALLELIZATION_FACTOR, 0), + (ARN, 0), + (FILTER_CRITERIA, 0), + (FILTER_CRITERIA_ERROR, 0), + (KMS_KEY_ARN, 0), + (EVENT_SOURCE_MAPPING_METRICS_CONFIG, 0), + (EVENT_SOURCE_MAPPING_LOGGING_CONFIG, 0), + (SCALING_CONFIG, 0), + (FUNCTION_ARN, 0), + (DATE, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (DESTINATION_CONFIG, 0), + (TOPICS, 0), + (QUEUES, 0), + (SOURCE_ACCESS_CONFIGURATIONS, 0), + (SELF_MANAGED_EVENT_SOURCE, 0), + (MAXIMUM_RECORD_AGE_IN_SECONDS, 0), + (BISECT_BATCH_ON_FUNCTION_ERROR, 0), + (MAXIMUM_RETRY_ATTEMPTS_EVENT_SOURCE_MAPPING, 0), + (TUMBLING_WINDOW_IN_SECONDS, 0), + (FUNCTION_RESPONSE_TYPE_LIST, 0), + (AMAZON_MANAGED_KAFKA_EVENT_SOURCE_CONFIG, 0), + (SELF_MANAGED_KAFKA_EVENT_SOURCE_CONFIG, 0), + (DOCUMENT_DB_EVENT_SOURCE_CONFIG, 0), + (EVENT_SOURCE_MAPPING_ARN, 0), + (PROVISIONED_POLLER_CONFIG, 0), + ), ) -CHAINED_INVOKE_STARTED_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ChainedInvokeStartedDetails"), - members={ - "FunctionName": { - "target": NAMESPACED_FUNCTION_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "TenantId": {"target": TENANT_ID}, - "Input": {"target": EVENT_INPUT}, - "ExecutedVersion": {"target": VERSION_WITH_LATEST_PUBLISHED}, - "DurableExecutionArn": {"target": DURABLE_EXECUTION_ARN}, - }, +UPDATE_EVENT_SOURCE_MAPPING: StaticOperationSchema = ( + 23, + n0, + _UESM, + { + _smithy: MappingProxyType( + { + "method": "PUT", + "uri": "/2015-03-31/event-source-mappings/{UUID}", + "code": 202, + } + ) + }, + UPDATE_EVENT_SOURCE_MAPPING_INPUT, + UPDATE_EVENT_SOURCE_MAPPING_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + RESOURCE_IN_USE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -CHAINED_INVOKE_STOPPED_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ChainedInvokeStoppedDetails"), - members={ - "Error": { - "target": EVENT_ERROR, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +CODE_SIGNING_CONFIG_NOT_FOUND_EXCEPTION: StaticSchema = ( + 18, + n0, + _CSCNFE, + {_smith: _c, _sE: 404}, + (_T, _M), + ((STRING, 0), (STRING, 0)), ) -CHAINED_INVOKE_SUCCEEDED_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ChainedInvokeSucceededDetails"), - members={ - "Result": { - "target": EVENT_RESULT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +CODE_STORAGE_EXCEEDED_EXCEPTION: StaticSchema = ( + 18, + n0, + _CSEE, + {_smith: _c, _sE: 400}, + (_T, _m), + ((STRING, 0), (STRING, 0)), ) -CHAINED_INVOKE_TIMED_OUT_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ChainedInvokeTimedOutDetails"), - members={ - "Error": { - "target": EVENT_ERROR, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +CODE_VERIFICATION_FAILED_EXCEPTION: StaticSchema = ( + 18, + n0, + _CVFE, + {_smith: _c, _sE: 400}, + (_T, _M), + ((STRING, 0), (STRING, 0)), ) -CONTEXT_FAILED_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ContextFailedDetails"), - members={ - "Error": { - "target": EVENT_ERROR, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +EXECUTION_ENVIRONMENT_MEMORY_GI_B_PER_V_CPU: StaticSchema = (10, n0, _EEMGBPVC, 0) -CONTEXT_STARTED_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ContextStartedDetails") -) +PER_EXECUTION_ENVIRONMENT_MAX_CONCURRENCY: StaticSchema = (7, n0, _PEEMC, 0) -CONTEXT_SUCCEEDED_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ContextSucceededDetails"), - members={ - "Result": { - "target": EVENT_RESULT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +LAMBDA_MANAGED_INSTANCES_CAPACITY_PROVIDER_CONFIG: StaticSchema = ( + 18, + n0, + _LMICPC, + 0, + (_CPA, _PEEMC, _EEMGBPVC), + ( + (CAPACITY_PROVIDER_ARN, 1), + (PER_EXECUTION_ENVIRONMENT_MAX_CONCURRENCY, 0), + (EXECUTION_ENVIRONMENT_MEMORY_GI_B_PER_V_CPU, 0), + ), ) -EVENT_ID = Schema( - id=ShapeID("com.amazonaws.lambda#EventId"), - shape_type=ShapeType.INTEGER, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=1)], -) - -EVENT_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.lambda#EventType"), - shape_type=ShapeType.ENUM, - members={ - "ExecutionStarted": {"target": UNIT}, - "ExecutionSucceeded": {"target": UNIT}, - "ExecutionFailed": {"target": UNIT}, - "ExecutionTimedOut": {"target": UNIT}, - "ExecutionStopped": {"target": UNIT}, - "ContextStarted": {"target": UNIT}, - "ContextSucceeded": {"target": UNIT}, - "ContextFailed": {"target": UNIT}, - "WaitStarted": {"target": UNIT}, - "WaitSucceeded": {"target": UNIT}, - "WaitCancelled": {"target": UNIT}, - "StepStarted": {"target": UNIT}, - "StepSucceeded": {"target": UNIT}, - "StepFailed": {"target": UNIT}, - "ChainedInvokeStarted": {"target": UNIT}, - "ChainedInvokeSucceeded": {"target": UNIT}, - "ChainedInvokeFailed": {"target": UNIT}, - "ChainedInvokeTimedOut": {"target": UNIT}, - "ChainedInvokeStopped": {"target": UNIT}, - "CallbackStarted": {"target": UNIT}, - "CallbackSucceeded": {"target": UNIT}, - "CallbackFailed": {"target": UNIT}, - "CallbackTimedOut": {"target": UNIT}, - "InvocationCompleted": {"target": UNIT}, - }, +CAPACITY_PROVIDER_CONFIG: StaticSchema = ( + 18, + n0, + _CPC, + 0, + (_LMICPC,), + ((LAMBDA_MANAGED_INSTANCES_CAPACITY_PROVIDER_CONFIG, 1),), ) -EXECUTION_FAILED_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ExecutionFailedDetails"), - members={ - "Error": { - "target": EVENT_ERROR, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +S3_BUCKET: StaticSchema = (3, n0, _SB, 0) -EXECUTION_STARTED_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ExecutionStartedDetails"), - members={ - "Input": { - "target": EVENT_INPUT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ExecutionTimeout": { - "target": DURATION_SECONDS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +S3_KEY: StaticSchema = (3, n0, _SK, 0) -EXECUTION_STOPPED_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ExecutionStoppedDetails"), - members={ - "Error": { - "target": EVENT_ERROR, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +S3_OBJECT_STORAGE_MODE: StaticSchema = ( + 14, + n0, + _SOSM, + 0, + (_C, _Ref), + ((-1, {_sV: _COPY}), (-1, {_sV: _REFERENCE})), ) -EXECUTION_SUCCEEDED_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ExecutionSucceededDetails"), - members={ - "Result": { - "target": EVENT_RESULT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +S3_OBJECT_VERSION: StaticSchema = (3, n0, _SOV, 0) -EXECUTION_TIMED_OUT_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ExecutionTimedOutDetails"), - members={"Error": {"target": EVENT_ERROR}}, -) - -INVOCATION_COMPLETED_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#InvocationCompletedDetails"), - members={ - "StartTimestamp": { - "target": EXECUTION_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "EndTimestamp": { - "target": EXECUTION_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "RequestId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Error": {"target": EVENT_ERROR}, - }, -) +BLOB: StaticSchema = (1, n0, _B, 4) -RETRY_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#RetryDetails"), - members={ - "CurrentAttempt": { - "target": ATTEMPT_COUNT, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "NextAttemptDelaySeconds": {"target": DURATION_SECONDS}, - }, +FUNCTION_CODE: StaticSchema = ( + 18, + n0, + _FCu, + 0, + (_ZF, _SB, _SK, _SOV, _SOSM, _IU, _SKMSKA), + ( + (BLOB, 0), + (S3_BUCKET, 0), + (S3_KEY, 0), + (S3_OBJECT_VERSION, 0), + (S3_OBJECT_STORAGE_MODE, 0), + (STRING, 0), + (KMS_KEY_ARN, 0), + ), ) -STEP_FAILED_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#StepFailedDetails"), - members={ - "Error": { - "target": EVENT_ERROR, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "RetryDetails": { - "target": RETRY_DETAILS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +RESOURCE_ARN: StaticSchema = (3, n0, _RAe, 0) -STEP_STARTED_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#StepStartedDetails") -) +DEAD_LETTER_CONFIG: StaticSchema = (18, n0, _DLC, 0, (_TA,), ((RESOURCE_ARN, 0),)) -STEP_SUCCEEDED_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#StepSucceededDetails"), - members={ - "Result": { - "target": EVENT_RESULT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "RetryDetails": { - "target": RETRY_DETAILS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +ENVIRONMENT_VARIABLE_NAME: StaticSchema = (3, n0, _EVN, 4) -WAIT_CANCELLED_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#WaitCancelledDetails"), - members={"Error": {"target": EVENT_ERROR}}, -) +ENVIRONMENT_VARIABLE_VALUE: StaticSchema = (3, n0, _EVV, 4) -WAIT_STARTED_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#WaitStartedDetails"), - members={ - "Duration": { - "target": DURATION_SECONDS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ScheduledEndTimestamp": { - "target": EXECUTION_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +ENVIRONMENT_VARIABLES: StaticSchema = ( + 17, + n0, + _EVn, + 4, + (_k, _v), + ((ENVIRONMENT_VARIABLE_NAME, 0), (ENVIRONMENT_VARIABLE_VALUE, 0)), ) -WAIT_SUCCEEDED_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#WaitSucceededDetails"), - members={"Duration": {"target": DURATION_SECONDS}}, -) - -EVENT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#Event"), - members={ - "EventType": {"target": EVENT_TYPE}, - "SubType": {"target": OPERATION_SUB_TYPE}, - "EventId": { - "target": EVENT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=1)], - }, - "Id": {"target": OPERATION_ID}, - "Name": {"target": OPERATION_NAME}, - "EventTimestamp": {"target": EXECUTION_TIMESTAMP}, - "ParentId": {"target": OPERATION_ID}, - "ExecutionStartedDetails": {"target": EXECUTION_STARTED_DETAILS}, - "ExecutionSucceededDetails": {"target": EXECUTION_SUCCEEDED_DETAILS}, - "ExecutionFailedDetails": {"target": EXECUTION_FAILED_DETAILS}, - "ExecutionTimedOutDetails": {"target": EXECUTION_TIMED_OUT_DETAILS}, - "ExecutionStoppedDetails": {"target": EXECUTION_STOPPED_DETAILS}, - "ContextStartedDetails": {"target": CONTEXT_STARTED_DETAILS}, - "ContextSucceededDetails": {"target": CONTEXT_SUCCEEDED_DETAILS}, - "ContextFailedDetails": {"target": CONTEXT_FAILED_DETAILS}, - "WaitStartedDetails": {"target": WAIT_STARTED_DETAILS}, - "WaitSucceededDetails": {"target": WAIT_SUCCEEDED_DETAILS}, - "WaitCancelledDetails": {"target": WAIT_CANCELLED_DETAILS}, - "StepStartedDetails": {"target": STEP_STARTED_DETAILS}, - "StepSucceededDetails": {"target": STEP_SUCCEEDED_DETAILS}, - "StepFailedDetails": {"target": STEP_FAILED_DETAILS}, - "ChainedInvokeStartedDetails": {"target": CHAINED_INVOKE_STARTED_DETAILS}, - "ChainedInvokeSucceededDetails": {"target": CHAINED_INVOKE_SUCCEEDED_DETAILS}, - "ChainedInvokeFailedDetails": {"target": CHAINED_INVOKE_FAILED_DETAILS}, - "ChainedInvokeTimedOutDetails": {"target": CHAINED_INVOKE_TIMED_OUT_DETAILS}, - "ChainedInvokeStoppedDetails": {"target": CHAINED_INVOKE_STOPPED_DETAILS}, - "CallbackStartedDetails": {"target": CALLBACK_STARTED_DETAILS}, - "CallbackSucceededDetails": {"target": CALLBACK_SUCCEEDED_DETAILS}, - "CallbackFailedDetails": {"target": CALLBACK_FAILED_DETAILS}, - "CallbackTimedOutDetails": {"target": CALLBACK_TIMED_OUT_DETAILS}, - "InvocationCompletedDetails": {"target": INVOCATION_COMPLETED_DETAILS}, - }, -) +ENVIRONMENT: StaticSchema = (18, n0, _Env, 0, (_Va,), ((ENVIRONMENT_VARIABLES, 0),)) -EVENTS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#Events"), - shape_type=ShapeType.LIST, - members={"member": {"target": EVENT}}, -) +EPHEMERAL_STORAGE_SIZE: StaticSchema = (7, n0, _ESS, 0) -GET_DURABLE_EXECUTION_HISTORY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#GetDurableExecutionHistoryOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#GetDurableExecutionHistoryResponse", - ) - ], - members={ - "Events": { - "target": EVENTS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "NextMarker": {"target": STRING}, - }, +EPHEMERAL_STORAGE: StaticSchema = ( + 18, + n0, + _ESp, + 0, + (_Si,), + ((EPHEMERAL_STORAGE_SIZE, 1),), ) -GET_DURABLE_EXECUTION_HISTORY = Schema( - id=ShapeID("com.amazonaws.lambda#GetDurableExecutionHistory"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/2025-12-01/durable-executions/{DurableExecutionArn}/history", - "code": 200, - } - ), - ) - ], -) +FILE_SYSTEM_ARN: StaticSchema = (3, n0, _FSA, 0) -GET_DURABLE_EXECUTION_STATE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#GetDurableExecutionStateInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#GetDurableExecutionStateRequest", - ) - ], - members={ - "DurableExecutionArn": { - "target": DURABLE_EXECUTION_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "CheckpointToken": { - "target": CHECKPOINT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="CheckpointToken"), - ], - }, - "Marker": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="Marker")], - }, - "MaxItems": { - "target": ITEM_COUNT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=0), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="MaxItems"), - ], - }, - }, -) +LOCAL_MOUNT_PATH: StaticSchema = (3, n0, _LMP, 0) -GET_DURABLE_EXECUTION_STATE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#GetDurableExecutionStateOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#GetDurableExecutionStateResponse", - ) - ], - members={ - "Operations": { - "target": OPERATIONS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "NextMarker": {"target": STRING}, - }, +DIRECT_S3_READ: StaticSchema = ( + 14, + n0, + _DSR, + 0, + (_ENABLED, _DISABLED, _AUTO), + ((-1, {_sV: _ENABLED}), (-1, {_sV: _DISABLED}), (-1, {_sV: _AUTO})), ) -GET_DURABLE_EXECUTION_STATE = Schema( - id=ShapeID("com.amazonaws.lambda#GetDurableExecutionState"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/2025-12-01/durable-executions/{DurableExecutionArn}/state", - "code": 200, - } - ), - ) - ], -) +S3_FILES_CONFIG: StaticSchema = (18, n0, _SFC, 0, (_DSR,), ((DIRECT_S3_READ, 0),)) -STOP_DURABLE_EXECUTION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#StopDurableExecutionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#StopDurableExecutionRequest", - ) - ], - members={ - "DurableExecutionArn": { - "target": DURABLE_EXECUTION_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Error": { - "target": ERROR_OBJECT, - "traits": [Trait.new(id=ShapeID("smithy.api#httpPayload"))], - }, - }, +FILE_SYSTEM_CONFIG: StaticSchema = ( + 18, + n0, + _FSC, + 0, + (_Ar, _LMP, _SFC), + ((FILE_SYSTEM_ARN, 1), (LOCAL_MOUNT_PATH, 1), (S3_FILES_CONFIG, 0)), ) -STOP_DURABLE_EXECUTION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#StopDurableExecutionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#StopDurableExecutionResponse", - ) - ], - members={ - "StopTimestamp": { - "target": EXECUTION_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +FILE_SYSTEM_CONFIG_LIST: StaticSchema = ( + 16, + n0, + _FSCL, + 0, + (_me,), + ((FILE_SYSTEM_CONFIG, 0),), ) -STOP_DURABLE_EXECUTION = Schema( - id=ShapeID("com.amazonaws.lambda#StopDurableExecution"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/2025-12-01/durable-executions/{DurableExecutionArn}/stop", - "code": 200, - } - ), - ) - ], -) +FUNCTION_NAME: StaticSchema = (3, n0, _FN, 0) -BATCH_SIZE = Schema( - id=ShapeID("com.amazonaws.lambda#BatchSize"), shape_type=ShapeType.INTEGER -) +HANDLER: StaticSchema = (3, n0, _H, 0) -BISECT_BATCH_ON_FUNCTION_ERROR = Schema( - id=ShapeID("com.amazonaws.lambda#BisectBatchOnFunctionError"), - shape_type=ShapeType.BOOLEAN, -) +STRING_LIST: StaticSchema = (16, n0, _SL, 0, (_me,), ((STRING, 0),)) -DESTINATION_ARN = Schema( - id=ShapeID("com.amazonaws.lambda#DestinationArn"), shape_type=ShapeType.STRING -) +WORKING_DIRECTORY: StaticSchema = (3, n0, _WDo, 0) -ON_FAILURE = Schema.collection( - id=ShapeID("com.amazonaws.lambda#OnFailure"), - members={"Destination": {"target": DESTINATION_ARN}}, +IMAGE_CONFIG: StaticSchema = ( + 18, + n0, + _ICm, + 0, + (_EP, _Co, _WDo), + ((STRING_LIST, 0), (STRING_LIST, 0), (WORKING_DIRECTORY, 0)), ) -ON_SUCCESS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#OnSuccess"), - members={"Destination": {"target": DESTINATION_ARN}}, -) +LAYER_VERSION_ARN: StaticSchema = (3, n0, _LVA, 0) -DESTINATION_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.lambda#DestinationConfig"), - members={"OnSuccess": {"target": ON_SUCCESS}, "OnFailure": {"target": ON_FAILURE}}, -) +LAYER_LIST: StaticSchema = (16, n0, _LL, 0, (_me,), ((LAYER_VERSION_ARN, 0),)) -COLLECTION_NAME = Schema( - id=ShapeID("com.amazonaws.lambda#CollectionName"), shape_type=ShapeType.STRING +LOG_FORMAT: StaticSchema = ( + 14, + n0, + _LF, + 0, + (_J, _Te), + ((-1, {_sV: _JSON}), (-1, {_sV: _Te})), ) -DATABASE_NAME = Schema( - id=ShapeID("com.amazonaws.lambda#DatabaseName"), shape_type=ShapeType.STRING +LOGGING_CONFIG: StaticSchema = ( + 18, + n0, + _LC, + 0, + (_LF, _ALL, _SLL, _LG), + ( + (LOG_FORMAT, 0), + (APPLICATION_LOG_LEVEL, 0), + (SYSTEM_LOG_LEVEL, 0), + (LOG_GROUP, 0), + ), ) -FULL_DOCUMENT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#FullDocument"), - shape_type=ShapeType.ENUM, - members={"UpdateLookup": {"target": UNIT}, "Default": {"target": UNIT}}, +MEMORY_SIZE: StaticSchema = (7, n0, _MS, 0) + +PACKAGE_TYPE: StaticSchema = ( + 14, + n0, + _PTa, + 0, + (_Z, _Im), + ((-1, {_sV: _Z}), (-1, {_sV: _Im})), +) + +BOOLEAN: StaticSchema = (2, n0, _Bo, {_s: False}) + +FUNCTION_VERSION_LATEST_PUBLISHED: StaticSchema = ( + 14, + n0, + _FVLP, + 0, + (_LP,), + ((-1, {_sV: _LP}),), +) + +RUNTIME: StaticSchema = ( + 14, + n0, + _Ru, + 0, + ( + _n, + _no, + _node, + _nodejs, + _nodejsx, + _nodejsx__, + _nodejsx____, + _nodejsx______, + _nodejsx________, + _nodejsx__________, + _nodejsx____________, + _nodejsx______________, + _j, + _ja, + _java, + _java_, + _java__, + _java___, + _p, + _pyt, + _pytho, + _python_, + _python___, + _python_____, + _python_______, + _python_________, + _python___________, + _python_____________, + _d, + _dot, + _dotne, + _dotnetc, + _dotnet_, + _dotnet__, + _dotnet___, + _nodejse, + _g, + _r, + _rub, + _ruby_, + _ruby___, + _ruby_____, + _ruby_______, + _pr, + _pro, + _provi, + _nodejsx________________, + _python_______________, + _javaa, + _javaal_, + _javaal___, + ), + ( + (-1, {_sV: _n}), + (-1, {_sV: _nod}), + (-1, {_sV: _nodej}), + (-1, {_sV: _nodejs_}), + (-1, {_sV: _nodejsx_}), + (-1, {_sV: _nodejsx___}), + (-1, {_sV: _nodejsx_____}), + (-1, {_sV: _nodejsx_______}), + (-1, {_sV: _nodejsx_________}), + (-1, {_sV: _nodejsx___________}), + (-1, {_sV: _nodejsx_____________}), + (-1, {_sV: _nodejsx_______________}), + (-1, {_sV: _j}), + (-1, {_sV: _jav}), + (-1, {_sV: _java}), + (-1, {_sV: _java_}), + (-1, {_sV: _java__}), + (-1, {_sV: _java___}), + (-1, {_sV: _py}), + (-1, {_sV: _pyth}), + (-1, {_sV: _python}), + (-1, {_sV: _python__}), + (-1, {_sV: _python____}), + (-1, {_sV: _python______}), + (-1, {_sV: _python________}), + (-1, {_sV: _python__________}), + (-1, {_sV: _python____________}), + (-1, {_sV: _python______________}), + (-1, {_sV: _do}), + (-1, {_sV: _dotn}), + (-1, {_sV: _dotnet}), + (-1, {_sV: _dotnetco}), + (-1, {_sV: _dotnet_}), + (-1, {_sV: _dotnet__}), + (-1, {_sV: _dotnet___}), + (-1, {_sV: _ne}), + (-1, {_sV: _go}), + (-1, {_sV: _ru}), + (-1, {_sV: _ruby}), + (-1, {_sV: _ruby__}), + (-1, {_sV: _ruby____}), + (-1, {_sV: _ruby______}), + (-1, {_sV: _ruby________}), + (-1, {_sV: _pr}), + (-1, {_sV: _prov}), + (-1, {_sV: _provid}), + (-1, {_sV: _nodejsx_________________}), + (-1, {_sV: _python________________}), + (-1, {_sV: _javaal}), + (-1, {_sV: _javaal__}), + (-1, {_sV: _javaal____}), + ), ) -DOCUMENT_DB_EVENT_SOURCE_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.lambda#DocumentDBEventSourceConfig"), - members={ - "DatabaseName": {"target": DATABASE_NAME}, - "CollectionName": {"target": COLLECTION_NAME}, - "FullDocument": {"target": FULL_DOCUMENT}, - }, +SNAP_START_APPLY_ON: StaticSchema = ( + 14, + n0, + _SSAO, + 0, + (_PV, _No), + ((-1, {_sV: _PV}), (-1, {_sV: _No})), +) + +SNAP_START: StaticSchema = (18, n0, _SSn, 0, (_AO,), ((SNAP_START_APPLY_ON, 0),)) + +TENANT_ISOLATION_MODE: StaticSchema = (14, n0, _TIM, 0, (_PT_,), ((-1, {_sV: _PT_}),)) + +TENANCY_CONFIG: StaticSchema = (18, n0, _TCe, 0, (_TIM,), ((TENANT_ISOLATION_MODE, 1),)) + +TIMEOUT: StaticSchema = (7, n0, _Tim, 0) + +TRACING_MODE: StaticSchema = ( + 14, + n0, + _TM, + 0, + (_Ac, _PTas), + ((-1, {_sV: _Ac}), (-1, {_sV: _PTas})), +) + +TRACING_CONFIG: StaticSchema = (18, n0, _TCr, 0, (_Mo,), ((TRACING_MODE, 0),)) + +NULLABLE_BOOLEAN: StaticSchema = (2, n0, _NB, 0) + +SECURITY_GROUP_IDS: StaticSchema = (16, n0, _SGIe, 0, (_me,), ((SECURITY_GROUP_ID, 0),)) + +SUBNET_IDS: StaticSchema = (16, n0, _SIub, 0, (_me,), ((SUBNET_ID, 0),)) + +VPC_CONFIG: StaticSchema = ( + 18, + n0, + _VC, + 0, + (_SIub, _SGIe, _IAFDS), + ((SUBNET_IDS, 0), (SECURITY_GROUP_IDS, 0), (NULLABLE_BOOLEAN, 0)), +) + +CREATE_FUNCTION_INPUT: StaticSchema = ( + 18, + n0, + _CFI, + {_sSI: _cCFR, _sm: None}, + ( + _FN, + _Ru, + _Ro, + _H, + _Cod, + _D, + _Tim, + _MS, + _Pu, + _PTu, + _VC, + _PTa, + _DLC, + _Env, + _KMSKA, + _TCr, + _Ta, + _La, + _FSCi, + _CSCA, + _ICm, + _Arch, + _ESp, + _SSn, + _LC, + _TCe, + _CPC, + _DC, + ), + ( + (FUNCTION_NAME, 1), + (RUNTIME, 0), + (ROLE_ARN, 1), + (HANDLER, 0), + (FUNCTION_CODE, 1), + (DESCRIPTION, 0), + (TIMEOUT, 0), + (MEMORY_SIZE, 0), + (BOOLEAN, {_s: False}), + (FUNCTION_VERSION_LATEST_PUBLISHED, 0), + (VPC_CONFIG, 0), + (PACKAGE_TYPE, 0), + (DEAD_LETTER_CONFIG, 0), + (ENVIRONMENT, 0), + (KMS_KEY_ARN, 0), + (TRACING_CONFIG, 0), + (TAGS, 0), + (LAYER_LIST, 0), + (FILE_SYSTEM_CONFIG_LIST, 0), + (CODE_SIGNING_CONFIG_ARN, 0), + (IMAGE_CONFIG, 0), + (ARCHITECTURES_LIST, 0), + (EPHEMERAL_STORAGE, 0), + (SNAP_START, 0), + (LOGGING_CONFIG, 0), + (TENANCY_CONFIG, 0), + (CAPACITY_PROVIDER_CONFIG, 0), + (DURABLE_CONFIG, 0), + ), ) -ENABLED = Schema( - id=ShapeID("com.amazonaws.lambda#Enabled"), shape_type=ShapeType.BOOLEAN +SENSITIVE_STRING: StaticSchema = (3, n0, _SSe, 4) + +ENVIRONMENT_ERROR: StaticSchema = ( + 18, + n0, + _EEn, + 0, + (_ECrr, _M), + ((STRING, 0), (SENSITIVE_STRING, 0)), +) + +ENVIRONMENT_RESPONSE: StaticSchema = ( + 18, + n0, + _ERn, + 0, + (_Va, _E), + ((ENVIRONMENT_VARIABLES, 0), (ENVIRONMENT_ERROR, 0)), +) + +IMAGE_CONFIG_ERROR: StaticSchema = ( + 18, + n0, + _ICE, + 0, + (_ECrr, _M), + ((STRING, 0), (SENSITIVE_STRING, 0)), +) + +IMAGE_CONFIG_RESPONSE: StaticSchema = ( + 18, + n0, + _ICR, + 0, + (_ICm, _E), + ((IMAGE_CONFIG, 0), (IMAGE_CONFIG_ERROR, 0)), +) + +LAST_UPDATE_STATUS: StaticSchema = ( + 14, + n0, + _LUS, + 0, + (_Su, _Fa, _IPn), + ((-1, {_sV: _Su}), (-1, {_sV: _Fa}), (-1, {_sV: _IPn})), +) + +LAST_UPDATE_STATUS_REASON: StaticSchema = (3, n0, _LUSR, 0) + +LAST_UPDATE_STATUS_REASON_CODE: StaticSchema = ( + 14, + n0, + _LUSRC, + 0, + ( + _ELE, + _IRP, + _ICnv, + _IE, + _SOOIPA, + _IS, + _ISG, + _ID, + _IAD, + _II, + _KMSKAD, + _KMSKNF, + _ISKMSK, + _DKMSK, + _EFSIOE, + _EFSMCE, + _EFSMF, + _EFSMT, + _IRn, + _IZFE, + _FE, + _SQEE, + _VLE, + _CPSLE, + _ICns, + _ECRLE, + _FEIT, + _FERIE, + _FEEIE, + _FEIEP, + _FEIWD, + _FEPD, + _FETME, + _FEIRE, + _DBVEC, + _DE, + ), + ( + (-1, {_sV: _ELE}), + (-1, {_sV: _IRP}), + (-1, {_sV: _ICnv}), + (-1, {_sV: _IE}), + (-1, {_sV: _SOOIPA}), + (-1, {_sV: _IS}), + (-1, {_sV: _ISG}), + (-1, {_sV: _ID}), + (-1, {_sV: _IAD}), + (-1, {_sV: _II}), + (-1, {_sV: _KMSKAD}), + (-1, {_sV: _KMSKNF}), + (-1, {_sV: _ISKMSK}), + (-1, {_sV: _DKMSK}), + (-1, {_sV: _EFSIOE}), + (-1, {_sV: _EFSMCE}), + (-1, {_sV: _EFSMF}), + (-1, {_sV: _EFSMT}), + (-1, {_sV: _IRn}), + (-1, {_sV: _IZFE}), + (-1, {_sV: _FE}), + (-1, {_sV: _SQEE}), + (-1, {_sV: _VLE}), + (-1, {_sV: _CPSLE}), + (-1, {_sV: _ICns}), + (-1, {_sV: _ECRLE}), + (-1, {_sV: _FEITu}), + (-1, {_sV: _FERIEu}), + (-1, {_sV: _FEEIEu}), + (-1, {_sV: _FEIEPu}), + (-1, {_sV: _FEIWDu}), + (-1, {_sV: _FEPDu}), + (-1, {_sV: _FETMEu}), + (-1, {_sV: _FEIREu}), + (-1, {_sV: _DBVEC}), + (-1, {_sV: _DE}), + ), ) -PATTERN = Schema( - id=ShapeID("com.amazonaws.lambda#Pattern"), shape_type=ShapeType.STRING +LAYER: StaticSchema = ( + 18, + n0, + _Lay, + 0, + (_Ar, _CSod, _SPVAi, _SJA), + ((LAYER_VERSION_ARN, 0), (LONG, {_s: 0}), (ARN, 0), (ARN, 0)), +) + +LAYERS_REFERENCE_LIST: StaticSchema = (16, n0, _LRL, 0, (_me,), ((LAYER, 0),)) + +RUNTIME_VERSION_ERROR: StaticSchema = ( + 18, + n0, + _RVE, + 0, + (_ECrr, _M), + ((STRING, 0), (SENSITIVE_STRING, 0)), +) + +RUNTIME_VERSION_ARN: StaticSchema = (3, n0, _RVA, 0) + +RUNTIME_VERSION_CONFIG: StaticSchema = ( + 18, + n0, + _RVC, + 0, + (_RVA, _E), + ((RUNTIME_VERSION_ARN, 0), (RUNTIME_VERSION_ERROR, 0)), +) + +SNAP_START_OPTIMIZATION_STATUS: StaticSchema = ( + 14, + n0, + _SSOS, + 0, + (_On, _Of), + ((-1, {_sV: _On}), (-1, {_sV: _Of})), +) + +SNAP_START_RESPONSE: StaticSchema = ( + 18, + n0, + _SSR, + 0, + (_AO, _OSp), + ((SNAP_START_APPLY_ON, 0), (SNAP_START_OPTIMIZATION_STATUS, 0)), +) + +STATE_REASON: StaticSchema = (3, n0, _SR, 0) + +STATE_REASON_CODE: StaticSchema = ( + 14, + n0, + _SRCt, + 0, + ( + _Idl, + _Cr, + _Res, + _ELE, + _IRP, + _ICnv, + _IE, + _SOOIPA, + _IS, + _ISG, + _ID, + _IAD, + _II, + _KMSKAD, + _KMSKNF, + _ISKMSK, + _DKMSK, + _EFSIOE, + _EFSMCE, + _EFSMF, + _EFSMT, + _IRn, + _IZFE, + _FE, + _SQEE, + _VLE, + _CPSLE, + _ICns, + _ECRLE, + _FEIT, + _FERIE, + _FEEIE, + _FEIEP, + _FEIWD, + _FEPD, + _FETME, + _FEIRE, + _DBVEC, + _DDE, + _DE, + ), + ( + (-1, {_sV: _Idl}), + (-1, {_sV: _Cr}), + (-1, {_sV: _Res}), + (-1, {_sV: _ELE}), + (-1, {_sV: _IRP}), + (-1, {_sV: _ICnv}), + (-1, {_sV: _IE}), + (-1, {_sV: _SOOIPA}), + (-1, {_sV: _IS}), + (-1, {_sV: _ISG}), + (-1, {_sV: _ID}), + (-1, {_sV: _IAD}), + (-1, {_sV: _II}), + (-1, {_sV: _KMSKAD}), + (-1, {_sV: _KMSKNF}), + (-1, {_sV: _ISKMSK}), + (-1, {_sV: _DKMSK}), + (-1, {_sV: _EFSIOE}), + (-1, {_sV: _EFSMCE}), + (-1, {_sV: _EFSMF}), + (-1, {_sV: _EFSMT}), + (-1, {_sV: _IRn}), + (-1, {_sV: _IZFE}), + (-1, {_sV: _FE}), + (-1, {_sV: _SQEE}), + (-1, {_sV: _VLE}), + (-1, {_sV: _CPSLE}), + (-1, {_sV: _ICns}), + (-1, {_sV: _ECRLE}), + (-1, {_sV: _FEITu}), + (-1, {_sV: _FERIEu}), + (-1, {_sV: _FEEIEu}), + (-1, {_sV: _FEIEPu}), + (-1, {_sV: _FEIWDu}), + (-1, {_sV: _FEPDu}), + (-1, {_sV: _FETMEu}), + (-1, {_sV: _FEIREu}), + (-1, {_sV: _DBVEC}), + (-1, {_sV: _DDE}), + (-1, {_sV: _DE}), + ), ) -FILTER = Schema.collection( - id=ShapeID("com.amazonaws.lambda#Filter"), members={"Pattern": {"target": PATTERN}} +TRACING_CONFIG_RESPONSE: StaticSchema = (18, n0, _TCR, 0, (_Mo,), ((TRACING_MODE, 0),)) + +VPC_ID: StaticSchema = (3, n0, _VI, 0) + +VPC_CONFIG_RESPONSE: StaticSchema = ( + 18, + n0, + _VCR, + 0, + (_SIub, _SGIe, _VI, _IAFDS), + ((SUBNET_IDS, 0), (SECURITY_GROUP_IDS, 0), (VPC_ID, 0), (NULLABLE_BOOLEAN, 0)), +) + +CREATE_FUNCTION_OUTPUT: StaticSchema = ( + 18, + n0, + _CFO, + {_sSI: _cFC, _smit: None}, + ( + _FN, + _FA, + _Ru, + _Ro, + _H, + _CSod, + _D, + _Tim, + _MS, + _LM, + _CSode, + _V, + _VC, + _DLC, + _Env, + _KMSKA, + _TCr, + _MA, + _RI, + _La, + _Sta, + _SR, + _SRCt, + _LUS, + _LUSR, + _LUSRC, + _FSCi, + _SPVAi, + _SJA, + _PTa, + _ICR, + _Arch, + _ESp, + _SSn, + _RVC, + _LC, + _TCe, + _CPC, + _CSon, + _DC, + ), + ( + (NAMESPACED_FUNCTION_NAME, 0), + (NAME_SPACED_FUNCTION_ARN, 0), + (RUNTIME, 0), + (ROLE_ARN, 0), + (HANDLER, 0), + (LONG, {_s: 0}), + (DESCRIPTION, 0), + (TIMEOUT, 0), + (MEMORY_SIZE, 0), + (TIMESTAMP, 0), + (STRING, 0), + (VERSION, 0), + (VPC_CONFIG_RESPONSE, 0), + (DEAD_LETTER_CONFIG, 0), + (ENVIRONMENT_RESPONSE, 0), + (KMS_KEY_ARN, 0), + (TRACING_CONFIG_RESPONSE, 0), + (FUNCTION_ARN, 0), + (STRING, 0), + (LAYERS_REFERENCE_LIST, 0), + (STATE, 0), + (STATE_REASON, 0), + (STATE_REASON_CODE, 0), + (LAST_UPDATE_STATUS, 0), + (LAST_UPDATE_STATUS_REASON, 0), + (LAST_UPDATE_STATUS_REASON_CODE, 0), + (FILE_SYSTEM_CONFIG_LIST, 0), + (ARN, 0), + (ARN, 0), + (PACKAGE_TYPE, 0), + (IMAGE_CONFIG_RESPONSE, 0), + (ARCHITECTURES_LIST, 0), + (EPHEMERAL_STORAGE, 0), + (SNAP_START_RESPONSE, 0), + (RUNTIME_VERSION_CONFIG, 0), + (LOGGING_CONFIG, 0), + (TENANCY_CONFIG, 0), + (CAPACITY_PROVIDER_CONFIG, 0), + (STRING, 0), + (DURABLE_CONFIG, 0), + ), ) -FILTER_LIST = Schema.collection( - id=ShapeID("com.amazonaws.lambda#FilterList"), - shape_type=ShapeType.LIST, - members={"member": {"target": FILTER}}, +FUNCTION_VERSIONS_PER_CAPACITY_PROVIDER_LIMIT_EXCEEDED_EXCEPTION: StaticSchema = ( + 18, + n0, + _FVPCPLEE, + {_smith: _c, _sE: 400}, + (_T, _m), + ((STRING, 0), (STRING, 0)), +) + +INVALID_CODE_SIGNATURE_EXCEPTION: StaticSchema = ( + 18, + n0, + _ICSE, + {_smith: _c, _sE: 400}, + (_T, _M), + ((STRING, 0), (STRING, 0)), +) + +CREATE_FUNCTION: StaticOperationSchema = ( + 23, + n0, + _CFr, + { + _smithy: MappingProxyType( + {"method": "POST", "uri": "/2015-03-31/functions", "code": 201} + ) + }, + CREATE_FUNCTION_INPUT, + CREATE_FUNCTION_OUTPUT, + ( + CODE_SIGNING_CONFIG_NOT_FOUND_EXCEPTION, + CODE_STORAGE_EXCEEDED_EXCEPTION, + CODE_VERIFICATION_FAILED_EXCEPTION, + FUNCTION_VERSIONS_PER_CAPACITY_PROVIDER_LIMIT_EXCEEDED_EXCEPTION, + INVALID_CODE_SIGNATURE_EXCEPTION, + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -FILTER_CRITERIA = Schema.collection( - id=ShapeID("com.amazonaws.lambda#FilterCriteria"), - members={"Filters": {"target": FILTER_LIST}}, -) +HEADER: StaticSchema = (3, n0, _He, 0) -FUNCTION_RESPONSE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.lambda#FunctionResponseType"), - shape_type=ShapeType.ENUM, - members={"ReportBatchItemFailures": {"target": UNIT}}, -) +HEADERS_LIST: StaticSchema = (16, n0, _HL, 0, (_me,), ((HEADER, 0),)) -FUNCTION_RESPONSE_TYPE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.lambda#FunctionResponseTypeList"), - shape_type=ShapeType.LIST, - members={"member": {"target": FUNCTION_RESPONSE_TYPE}}, -) +MAX_AGE: StaticSchema = (7, n0, _MAa, 0) -EVENT_SOURCE_MAPPING_SYSTEM_LOG_LEVEL = Schema.collection( - id=ShapeID("com.amazonaws.lambda#EventSourceMappingSystemLogLevel"), - shape_type=ShapeType.ENUM, - members={ - "Debug": {"target": UNIT}, - "Info": {"target": UNIT}, - "Warn": {"target": UNIT}, - }, +CORS: StaticSchema = ( + 18, + n0, + _Cor, + 0, + (_ACl, _AH, _AM, _AOl, _EH, _MAa), + ( + (ALLOW_CREDENTIALS, 0), + (HEADERS_LIST, 0), + (ALLOW_METHODS_LIST, 0), + (ALLOW_ORIGINS_LIST, 0), + (HEADERS_LIST, 0), + (MAX_AGE, 0), + ), ) -EVENT_SOURCE_MAPPING_LOGGING_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.lambda#EventSourceMappingLoggingConfig"), - members={"SystemLogLevel": {"target": EVENT_SOURCE_MAPPING_SYSTEM_LOG_LEVEL}}, -) +FUNCTION_URL_FUNCTION_NAME: StaticSchema = (3, n0, _FUFN, 0) -MAXIMUM_BATCHING_WINDOW_IN_SECONDS = Schema( - id=ShapeID("com.amazonaws.lambda#MaximumBatchingWindowInSeconds"), - shape_type=ShapeType.INTEGER, +INVOKE_MODE: StaticSchema = ( + 14, + n0, + _IM, + 0, + (_BUFFERED, _RS), + ((-1, {_sV: _BUFFERED}), (-1, {_sV: _RS})), ) -MAXIMUM_RECORD_AGE_IN_SECONDS = Schema( - id=ShapeID("com.amazonaws.lambda#MaximumRecordAgeInSeconds"), - shape_type=ShapeType.INTEGER, -) +FUNCTION_URL_QUALIFIER: StaticSchema = (3, n0, _FUQ, 0) -MAXIMUM_RETRY_ATTEMPTS_EVENT_SOURCE_MAPPING = Schema( - id=ShapeID("com.amazonaws.lambda#MaximumRetryAttemptsEventSourceMapping"), - shape_type=ShapeType.INTEGER, +CREATE_FUNCTION_URL_CONFIG_INPUT: StaticSchema = ( + 18, + n0, + _CFUCI, + {_sSI: _cCFUCR, _sm: None}, + (_FN, _Q, _ATu, _Cor, _IM), + ( + (FUNCTION_URL_FUNCTION_NAME, 9), + (FUNCTION_URL_QUALIFIER, {_sQ: _Q}), + (FUNCTION_URL_AUTH_TYPE, 1), + (CORS, 0), + (INVOKE_MODE, 0), + ), ) -EVENT_SOURCE_MAPPING_METRIC = Schema.collection( - id=ShapeID("com.amazonaws.lambda#EventSourceMappingMetric"), - shape_type=ShapeType.ENUM, - members={ - "EventCount": {"target": UNIT}, - "ErrorCount": {"target": UNIT}, - "KafkaMetrics": {"target": UNIT}, - }, +FUNCTION_URL: StaticSchema = (3, n0, _FU, 0) + +CREATE_FUNCTION_URL_CONFIG_OUTPUT: StaticSchema = ( + 18, + n0, + _CFUCO, + {_sSI: _cCFUCRo, _smit: None}, + (_FU, _FA, _ATu, _Cor, _CTr, _IM), + ( + (FUNCTION_URL, 1), + (FUNCTION_ARN, 1), + (FUNCTION_URL_AUTH_TYPE, 1), + (CORS, 0), + (TIMESTAMP, 1), + (INVOKE_MODE, 0), + ), ) -EVENT_SOURCE_MAPPING_METRIC_LIST = Schema.collection( - id=ShapeID("com.amazonaws.lambda#EventSourceMappingMetricList"), - shape_type=ShapeType.LIST, - members={"member": {"target": EVENT_SOURCE_MAPPING_METRIC}}, +CREATE_FUNCTION_URL_CONFIG: StaticOperationSchema = ( + 23, + n0, + _CFUC, + { + _smithy: MappingProxyType( + { + "method": "POST", + "uri": "/2021-10-31/functions/{FunctionName}/url", + "code": 201, + } + ) + }, + CREATE_FUNCTION_URL_CONFIG_INPUT, + CREATE_FUNCTION_URL_CONFIG_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -EVENT_SOURCE_MAPPING_METRICS_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.lambda#EventSourceMappingMetricsConfig"), - members={"Metrics": {"target": EVENT_SOURCE_MAPPING_METRIC_LIST}}, +DELETE_FUNCTION_CODE_SIGNING_CONFIG_INPUT: StaticSchema = ( + 18, + n0, + _DFCSCI, + {_sSI: _cDFCSCR, _sm: None}, + (_FN,), + ((NAMESPACED_FUNCTION_NAME, 9),), +) + +DELETE_FUNCTION_CODE_SIGNING_CONFIG_OUTPUT: StaticSchema = ( + 18, + n0, + _DFCSCO, + {_sSI: _sU, _smit: None}, +) + +DELETE_FUNCTION_CODE_SIGNING_CONFIG: StaticOperationSchema = ( + 23, + n0, + _DFCSC, + { + _smithy: MappingProxyType( + { + "method": "DELETE", + "uri": "/2020-06-30/functions/{FunctionName}/code-signing-config", + "code": 204, + } + ) + }, + DELETE_FUNCTION_CODE_SIGNING_CONFIG_INPUT, + DELETE_FUNCTION_CODE_SIGNING_CONFIG_OUTPUT, + ( + CODE_SIGNING_CONFIG_NOT_FOUND_EXCEPTION, + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -PARALLELIZATION_FACTOR = Schema( - id=ShapeID("com.amazonaws.lambda#ParallelizationFactor"), - shape_type=ShapeType.INTEGER, +DELETE_FUNCTION_CONCURRENCY_INPUT: StaticSchema = ( + 18, + n0, + _DFCI, + {_sSI: _cDFCR, _sm: None}, + (_FN,), + ((FUNCTION_NAME, 9),), +) + +DELETE_FUNCTION_CONCURRENCY_OUTPUT: StaticSchema = ( + 18, + n0, + _DFCO, + {_sSI: _sU, _smit: None}, +) + +DELETE_FUNCTION_CONCURRENCY: StaticOperationSchema = ( + 23, + n0, + _DFC, + { + _smithy: MappingProxyType( + { + "method": "DELETE", + "uri": "/2017-10-31/functions/{FunctionName}/concurrency", + "code": 204, + } + ) + }, + DELETE_FUNCTION_CONCURRENCY_INPUT, + DELETE_FUNCTION_CONCURRENCY_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -MAXIMUM_NUMBER_OF_POLLERS = Schema( - id=ShapeID("com.amazonaws.lambda#MaximumNumberOfPollers"), - shape_type=ShapeType.INTEGER, +DELETE_FUNCTION_URL_CONFIG_INPUT: StaticSchema = ( + 18, + n0, + _DFUCI, + {_sSI: _cDFUCR, _sm: None}, + (_FN, _Q), + ((FUNCTION_URL_FUNCTION_NAME, 9), (FUNCTION_URL_QUALIFIER, {_sQ: _Q})), +) + +DELETE_FUNCTION_URL_CONFIG_OUTPUT: StaticSchema = ( + 18, + n0, + _DFUCO, + {_sSI: _sU, _smit: None}, +) + +DELETE_FUNCTION_URL_CONFIG: StaticOperationSchema = ( + 23, + n0, + _DFUC, + { + _smithy: MappingProxyType( + { + "method": "DELETE", + "uri": "/2021-10-31/functions/{FunctionName}/url", + "code": 204, + } + ) + }, + DELETE_FUNCTION_URL_CONFIG_INPUT, + DELETE_FUNCTION_URL_CONFIG_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -MINIMUM_NUMBER_OF_POLLERS = Schema( - id=ShapeID("com.amazonaws.lambda#MinimumNumberOfPollers"), - shape_type=ShapeType.INTEGER, +GET_FUNCTION_INPUT: StaticSchema = ( + 18, + n0, + _GFI, + {_sSI: _cGFR, _sm: None}, + (_FN, _Q), + ( + (NAMESPACED_FUNCTION_NAME, 9), + (NUMERIC_LATEST_PUBLISHED_OR_ALIAS_QUALIFIER, {_sQ: _Q}), + ), ) -PROVISIONED_POLLER_GROUP_NAME = Schema( - id=ShapeID("com.amazonaws.lambda#ProvisionedPollerGroupName"), - shape_type=ShapeType.STRING, +FUNCTION_CODE_LOCATION_ERROR: StaticSchema = ( + 18, + n0, + _FCLE, + 0, + (_ECrr, _M), + ((STRING, 0), (SENSITIVE_STRING, 0)), +) + +SENSITIVE_STRING_ON_SERVER_ONLY: StaticSchema = (3, n0, _SSOSO, 0) + +RESOLVED_S3_OBJECT: StaticSchema = ( + 18, + n0, + _RSO, + 0, + (_SB, _SK, _SOV), + ((S3_BUCKET, 0), (S3_KEY, 0), (S3_OBJECT_VERSION, 0)), +) + +FUNCTION_CODE_LOCATION: StaticSchema = ( + 18, + n0, + _FCL, + 0, + (_RT, _Lo, _IU, _RIU, _RSO, _SKMSKA, _E), + ( + (STRING, 0), + (SENSITIVE_STRING_ON_SERVER_ONLY, 0), + (STRING, 0), + (STRING, 0), + (RESOLVED_S3_OBJECT, 0), + (KMS_KEY_ARN, 0), + (FUNCTION_CODE_LOCATION_ERROR, 0), + ), ) -PROVISIONED_POLLER_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ProvisionedPollerConfig"), - members={ - "MinimumPollers": {"target": MINIMUM_NUMBER_OF_POLLERS}, - "MaximumPollers": {"target": MAXIMUM_NUMBER_OF_POLLERS}, - "PollerGroupName": {"target": PROVISIONED_POLLER_GROUP_NAME}, - }, +RESERVED_CONCURRENT_EXECUTIONS: StaticSchema = (7, n0, _RCEe, 0) + +CONCURRENCY: StaticSchema = ( + 18, + n0, + _Con, + 0, + (_RCEe,), + ((RESERVED_CONCURRENT_EXECUTIONS, 0),), +) + +FUNCTION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _FCun, + 0, + ( + _FN, + _FA, + _Ru, + _Ro, + _H, + _CSod, + _D, + _Tim, + _MS, + _LM, + _CSode, + _V, + _VC, + _DLC, + _Env, + _KMSKA, + _TCr, + _MA, + _RI, + _La, + _Sta, + _SR, + _SRCt, + _LUS, + _LUSR, + _LUSRC, + _FSCi, + _SPVAi, + _SJA, + _PTa, + _ICR, + _Arch, + _ESp, + _SSn, + _RVC, + _LC, + _TCe, + _CPC, + _CSon, + _DC, + ), + ( + (NAMESPACED_FUNCTION_NAME, 0), + (NAME_SPACED_FUNCTION_ARN, 0), + (RUNTIME, 0), + (ROLE_ARN, 0), + (HANDLER, 0), + (LONG, {_s: 0}), + (DESCRIPTION, 0), + (TIMEOUT, 0), + (MEMORY_SIZE, 0), + (TIMESTAMP, 0), + (STRING, 0), + (VERSION, 0), + (VPC_CONFIG_RESPONSE, 0), + (DEAD_LETTER_CONFIG, 0), + (ENVIRONMENT_RESPONSE, 0), + (KMS_KEY_ARN, 0), + (TRACING_CONFIG_RESPONSE, 0), + (FUNCTION_ARN, 0), + (STRING, 0), + (LAYERS_REFERENCE_LIST, 0), + (STATE, 0), + (STATE_REASON, 0), + (STATE_REASON_CODE, 0), + (LAST_UPDATE_STATUS, 0), + (LAST_UPDATE_STATUS_REASON, 0), + (LAST_UPDATE_STATUS_REASON_CODE, 0), + (FILE_SYSTEM_CONFIG_LIST, 0), + (ARN, 0), + (ARN, 0), + (PACKAGE_TYPE, 0), + (IMAGE_CONFIG_RESPONSE, 0), + (ARCHITECTURES_LIST, 0), + (EPHEMERAL_STORAGE, 0), + (SNAP_START_RESPONSE, 0), + (RUNTIME_VERSION_CONFIG, 0), + (LOGGING_CONFIG, 0), + (TENANCY_CONFIG, 0), + (CAPACITY_PROVIDER_CONFIG, 0), + (STRING, 0), + (DURABLE_CONFIG, 0), + ), ) -QUEUE = Schema(id=ShapeID("com.amazonaws.lambda#Queue"), shape_type=ShapeType.STRING) - -QUEUES = Schema.collection( - id=ShapeID("com.amazonaws.lambda#Queues"), - shape_type=ShapeType.LIST, - members={"member": {"target": QUEUE}}, -) +TAGS_ERROR_CODE: StaticSchema = (3, n0, _TEC, 0) -MAXIMUM_CONCURRENCY = Schema( - id=ShapeID("com.amazonaws.lambda#MaximumConcurrency"), shape_type=ShapeType.INTEGER -) +TAGS_ERROR_MESSAGE: StaticSchema = (3, n0, _TEM, 0) -SCALING_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ScalingConfig"), - members={"MaximumConcurrency": {"target": MAXIMUM_CONCURRENCY}}, +TAGS_ERROR: StaticSchema = ( + 18, + n0, + _TE, + 0, + (_ECrr, _M), + ((TAGS_ERROR_CODE, 1), (TAGS_ERROR_MESSAGE, 1)), ) -END_POINT_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.lambda#EndPointType"), - shape_type=ShapeType.ENUM, - members={"KAFKA_BOOTSTRAP_SERVERS": {"target": UNIT}}, +GET_FUNCTION_OUTPUT: StaticSchema = ( + 18, + n0, + _GFO, + {_sSI: _cGFRo, _smit: None}, + (_Conf, _Cod, _Ta, _TE, _Con), + ( + (FUNCTION_CONFIGURATION, 0), + (FUNCTION_CODE_LOCATION, 0), + (TAGS, 0), + (TAGS_ERROR, 0), + (CONCURRENCY, 0), + ), ) -ENDPOINT = Schema( - id=ShapeID("com.amazonaws.lambda#Endpoint"), shape_type=ShapeType.STRING +GET_FUNCTION: StaticOperationSchema = ( + 23, + n0, + _GF, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/2015-03-31/functions/{FunctionName}", + "code": 200, + } + ) + }, + GET_FUNCTION_INPUT, + GET_FUNCTION_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -ENDPOINT_LISTS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#EndpointLists"), - shape_type=ShapeType.LIST, - members={"member": {"target": ENDPOINT}}, +GET_FUNCTION_CODE_SIGNING_CONFIG_INPUT: StaticSchema = ( + 18, + n0, + _GFCSCI, + {_sSI: _cGFCSCR, _sm: None}, + (_FN,), + ((NAMESPACED_FUNCTION_NAME, 9),), +) + +GET_FUNCTION_CODE_SIGNING_CONFIG_OUTPUT: StaticSchema = ( + 18, + n0, + _GFCSCO, + {_sSI: _cGFCSCRo, _smit: None}, + (_CSCA, _FN), + ((CODE_SIGNING_CONFIG_ARN, 1), (FUNCTION_NAME, 1)), +) + +GET_FUNCTION_CODE_SIGNING_CONFIG: StaticOperationSchema = ( + 23, + n0, + _GFCSC, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/2020-06-30/functions/{FunctionName}/code-signing-config", + "code": 200, + } + ) + }, + GET_FUNCTION_CODE_SIGNING_CONFIG_INPUT, + GET_FUNCTION_CODE_SIGNING_CONFIG_OUTPUT, + ( + CODE_SIGNING_CONFIG_NOT_FOUND_EXCEPTION, + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -ENDPOINTS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#Endpoints"), - shape_type=ShapeType.MAP, - members={"key": {"target": END_POINT_TYPE}, "value": {"target": ENDPOINT_LISTS}}, +GET_FUNCTION_CONCURRENCY_INPUT: StaticSchema = ( + 18, + n0, + _GFCI, + {_sSI: _cGFCR, _sm: None}, + (_FN,), + ((FUNCTION_NAME, 9),), +) + +GET_FUNCTION_CONCURRENCY_OUTPUT: StaticSchema = ( + 18, + n0, + _GFCO, + {_sSI: _cGFCRo, _smit: None}, + (_RCEe,), + ((RESERVED_CONCURRENT_EXECUTIONS, 0),), +) + +GET_FUNCTION_CONCURRENCY: StaticOperationSchema = ( + 23, + n0, + _GFC, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/2019-09-30/functions/{FunctionName}/concurrency", + "code": 200, + } + ) + }, + GET_FUNCTION_CONCURRENCY_INPUT, + GET_FUNCTION_CONCURRENCY_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -SELF_MANAGED_EVENT_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.lambda#SelfManagedEventSource"), - members={"Endpoints": {"target": ENDPOINTS}}, +GET_FUNCTION_CONFIGURATION_INPUT: StaticSchema = ( + 18, + n0, + _GFCIe, + {_sSI: _cGFCRom, _sm: None}, + (_FN, _Q), + ( + (NAMESPACED_FUNCTION_NAME, 9), + (NUMERIC_LATEST_PUBLISHED_OR_ALIAS_QUALIFIER, {_sQ: _Q}), + ), ) -SELF_MANAGED_KAFKA_EVENT_SOURCE_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.lambda#SelfManagedKafkaEventSourceConfig"), - members={ - "ConsumerGroupId": {"target": URI}, - "SchemaRegistryConfig": {"target": KAFKA_SCHEMA_REGISTRY_CONFIG}, - }, +GET_FUNCTION_CONFIGURATION_OUTPUT: StaticSchema = ( + 18, + n0, + _GFCOe, + {_sSI: _cFC, _smit: None}, + ( + _FN, + _FA, + _Ru, + _Ro, + _H, + _CSod, + _D, + _Tim, + _MS, + _LM, + _CSode, + _V, + _VC, + _DLC, + _Env, + _KMSKA, + _TCr, + _MA, + _RI, + _La, + _Sta, + _SR, + _SRCt, + _LUS, + _LUSR, + _LUSRC, + _FSCi, + _SPVAi, + _SJA, + _PTa, + _ICR, + _Arch, + _ESp, + _SSn, + _RVC, + _LC, + _TCe, + _CPC, + _CSon, + _DC, + ), + ( + (NAMESPACED_FUNCTION_NAME, 0), + (NAME_SPACED_FUNCTION_ARN, 0), + (RUNTIME, 0), + (ROLE_ARN, 0), + (HANDLER, 0), + (LONG, {_s: 0}), + (DESCRIPTION, 0), + (TIMEOUT, 0), + (MEMORY_SIZE, 0), + (TIMESTAMP, 0), + (STRING, 0), + (VERSION, 0), + (VPC_CONFIG_RESPONSE, 0), + (DEAD_LETTER_CONFIG, 0), + (ENVIRONMENT_RESPONSE, 0), + (KMS_KEY_ARN, 0), + (TRACING_CONFIG_RESPONSE, 0), + (FUNCTION_ARN, 0), + (STRING, 0), + (LAYERS_REFERENCE_LIST, 0), + (STATE, 0), + (STATE_REASON, 0), + (STATE_REASON_CODE, 0), + (LAST_UPDATE_STATUS, 0), + (LAST_UPDATE_STATUS_REASON, 0), + (LAST_UPDATE_STATUS_REASON_CODE, 0), + (FILE_SYSTEM_CONFIG_LIST, 0), + (ARN, 0), + (ARN, 0), + (PACKAGE_TYPE, 0), + (IMAGE_CONFIG_RESPONSE, 0), + (ARCHITECTURES_LIST, 0), + (EPHEMERAL_STORAGE, 0), + (SNAP_START_RESPONSE, 0), + (RUNTIME_VERSION_CONFIG, 0), + (LOGGING_CONFIG, 0), + (TENANCY_CONFIG, 0), + (CAPACITY_PROVIDER_CONFIG, 0), + (STRING, 0), + (DURABLE_CONFIG, 0), + ), ) -SOURCE_ACCESS_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.lambda#SourceAccessType"), - shape_type=ShapeType.ENUM, - members={ - "BASIC_AUTH": {"target": UNIT}, - "VPC_SUBNET": {"target": UNIT}, - "VPC_SECURITY_GROUP": {"target": UNIT}, - "SASL_SCRAM_512_AUTH": {"target": UNIT}, - "SASL_SCRAM_256_AUTH": {"target": UNIT}, - "VIRTUAL_HOST": {"target": UNIT}, - "CLIENT_CERTIFICATE_TLS_AUTH": {"target": UNIT}, - "SERVER_ROOT_CA_CERTIFICATE": {"target": UNIT}, - }, +GET_FUNCTION_CONFIGURATION: StaticOperationSchema = ( + 23, + n0, + _GFCe, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/2015-03-31/functions/{FunctionName}/configuration", + "code": 200, + } + ) + }, + GET_FUNCTION_CONFIGURATION_INPUT, + GET_FUNCTION_CONFIGURATION_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -SOURCE_ACCESS_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#SourceAccessConfiguration"), - members={"Type": {"target": SOURCE_ACCESS_TYPE}, "URI": {"target": URI}}, +UNQUALIFIED_FUNCTION_NAME: StaticSchema = (3, n0, _UFN, 0) + +GET_FUNCTION_RECURSION_CONFIG_INPUT: StaticSchema = ( + 18, + n0, + _GFRCI, + {_sSI: _cGFRCR, _sm: None}, + (_FN,), + ((UNQUALIFIED_FUNCTION_NAME, 9),), +) + +RECURSIVE_LOOP: StaticSchema = ( + 14, + n0, + _RL, + 0, + (_All, _Ter), + ((-1, {_sV: _All}), (-1, {_sV: _Ter})), +) + +GET_FUNCTION_RECURSION_CONFIG_OUTPUT: StaticSchema = ( + 18, + n0, + _GFRCO, + {_sSI: _cGFRCRo, _smit: None}, + (_RL,), + ((RECURSIVE_LOOP, 0),), +) + +GET_FUNCTION_RECURSION_CONFIG: StaticOperationSchema = ( + 23, + n0, + _GFRC, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/2024-08-31/functions/{FunctionName}/recursion-config", + "code": 200, + } + ) + }, + GET_FUNCTION_RECURSION_CONFIG_INPUT, + GET_FUNCTION_RECURSION_CONFIG_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -SOURCE_ACCESS_CONFIGURATIONS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#SourceAccessConfigurations"), - shape_type=ShapeType.LIST, - members={"member": {"target": SOURCE_ACCESS_CONFIGURATION}}, -) +PUBLISHED_FUNCTION_QUALIFIER: StaticSchema = (3, n0, _PFQ, 0) -EVENT_SOURCE_POSITION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#EventSourcePosition"), - shape_type=ShapeType.ENUM, - members={ - "TRIM_HORIZON": {"target": UNIT}, - "LATEST": {"target": UNIT}, - "AT_TIMESTAMP": {"target": UNIT}, - }, +GET_FUNCTION_SCALING_CONFIG_INPUT: StaticSchema = ( + 18, + n0, + _GFSCI, + {_sSI: _cGFSCR, _sm: None}, + (_FN, _Q), + ( + (UNQUALIFIED_FUNCTION_NAME, 9), + (PUBLISHED_FUNCTION_QUALIFIER, {_sQ: _Q, _smi: None}), + ), ) -DATE = Schema(id=ShapeID("com.amazonaws.lambda#Date"), shape_type=ShapeType.TIMESTAMP) +FUNCTION_SCALING_CONFIG_EXECUTION_ENVIRONMENTS: StaticSchema = (7, n0, _FSCEE, 0) -TOPIC = Schema(id=ShapeID("com.amazonaws.lambda#Topic"), shape_type=ShapeType.STRING) - -TOPICS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#Topics"), - shape_type=ShapeType.LIST, - members={"member": {"target": TOPIC}}, +FUNCTION_SCALING_CONFIG: StaticSchema = ( + 18, + n0, + _FSCu, + 0, + (_MEE, _MEEa), + ( + (FUNCTION_SCALING_CONFIG_EXECUTION_ENVIRONMENTS, 0), + (FUNCTION_SCALING_CONFIG_EXECUTION_ENVIRONMENTS, 0), + ), ) -TUMBLING_WINDOW_IN_SECONDS = Schema( - id=ShapeID("com.amazonaws.lambda#TumblingWindowInSeconds"), - shape_type=ShapeType.INTEGER, +GET_FUNCTION_SCALING_CONFIG_OUTPUT: StaticSchema = ( + 18, + n0, + _GFSCO, + {_sSI: _cGFSCRo, _smit: None}, + (_FA, _AFSC, _RFSC), + ((FUNCTION_ARN, 0), (FUNCTION_SCALING_CONFIG, 0), (FUNCTION_SCALING_CONFIG, 0)), +) + +GET_FUNCTION_SCALING_CONFIG: StaticOperationSchema = ( + 23, + n0, + _GFSC, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/2025-11-30/functions/{FunctionName}/function-scaling-config", + "code": 200, + } + ) + }, + GET_FUNCTION_SCALING_CONFIG_INPUT, + GET_FUNCTION_SCALING_CONFIG_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -CREATE_EVENT_SOURCE_MAPPING_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#CreateEventSourceMappingInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#CreateEventSourceMappingRequest", - ) - ], - members={ - "EventSourceArn": {"target": ARN}, - "FunctionName": { - "target": NAMESPACED_FUNCTION_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Enabled": {"target": ENABLED}, - "BatchSize": {"target": BATCH_SIZE}, - "FilterCriteria": {"target": FILTER_CRITERIA}, - "KMSKeyArn": {"target": KMS_KEY_ARN}, - "MetricsConfig": {"target": EVENT_SOURCE_MAPPING_METRICS_CONFIG}, - "LoggingConfig": {"target": EVENT_SOURCE_MAPPING_LOGGING_CONFIG}, - "ScalingConfig": {"target": SCALING_CONFIG}, - "MaximumBatchingWindowInSeconds": { - "target": MAXIMUM_BATCHING_WINDOW_IN_SECONDS - }, - "ParallelizationFactor": {"target": PARALLELIZATION_FACTOR}, - "StartingPosition": {"target": EVENT_SOURCE_POSITION}, - "StartingPositionTimestamp": {"target": DATE}, - "DestinationConfig": {"target": DESTINATION_CONFIG}, - "MaximumRecordAgeInSeconds": {"target": MAXIMUM_RECORD_AGE_IN_SECONDS}, - "BisectBatchOnFunctionError": {"target": BISECT_BATCH_ON_FUNCTION_ERROR}, - "MaximumRetryAttempts": {"target": MAXIMUM_RETRY_ATTEMPTS_EVENT_SOURCE_MAPPING}, - "Tags": {"target": TAGS}, - "TumblingWindowInSeconds": {"target": TUMBLING_WINDOW_IN_SECONDS}, - "Topics": {"target": TOPICS}, - "Queues": {"target": QUEUES}, - "SourceAccessConfigurations": {"target": SOURCE_ACCESS_CONFIGURATIONS}, - "SelfManagedEventSource": {"target": SELF_MANAGED_EVENT_SOURCE}, - "FunctionResponseTypes": {"target": FUNCTION_RESPONSE_TYPE_LIST}, - "AmazonManagedKafkaEventSourceConfig": { - "target": AMAZON_MANAGED_KAFKA_EVENT_SOURCE_CONFIG - }, - "SelfManagedKafkaEventSourceConfig": { - "target": SELF_MANAGED_KAFKA_EVENT_SOURCE_CONFIG - }, - "DocumentDBEventSourceConfig": {"target": DOCUMENT_DB_EVENT_SOURCE_CONFIG}, - "ProvisionedPollerConfig": {"target": PROVISIONED_POLLER_CONFIG}, - }, +GET_FUNCTION_URL_CONFIG_INPUT: StaticSchema = ( + 18, + n0, + _GFUCI, + {_sSI: _cGFUCR, _sm: None}, + (_FN, _Q), + ((FUNCTION_URL_FUNCTION_NAME, 9), (FUNCTION_URL_QUALIFIER, {_sQ: _Q})), +) + +GET_FUNCTION_URL_CONFIG_OUTPUT: StaticSchema = ( + 18, + n0, + _GFUCO, + {_sSI: _cGFUCRo, _smit: None}, + (_FU, _FA, _ATu, _Cor, _CTr, _LMT, _IM), + ( + (FUNCTION_URL, 1), + (FUNCTION_ARN, 1), + (FUNCTION_URL_AUTH_TYPE, 1), + (CORS, 0), + (TIMESTAMP, 1), + (TIMESTAMP, 1), + (INVOKE_MODE, 0), + ), ) -EVENT_SOURCE_MAPPING_ARN = Schema( - id=ShapeID("com.amazonaws.lambda#EventSourceMappingArn"), - shape_type=ShapeType.STRING, +GET_FUNCTION_URL_CONFIG: StaticOperationSchema = ( + 23, + n0, + _GFUC, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/2021-10-31/functions/{FunctionName}/url", + "code": 200, + } + ) + }, + GET_FUNCTION_URL_CONFIG_INPUT, + GET_FUNCTION_URL_CONFIG_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -FILTER_CRITERIA_ERROR_CODE = Schema( - id=ShapeID("com.amazonaws.lambda#FilterCriteriaErrorCode"), - shape_type=ShapeType.STRING, +GET_POLICY_INPUT: StaticSchema = ( + 18, + n0, + _GPI, + {_sSI: _cGPR, _sm: None}, + (_FN, _Q), + ( + (NAMESPACED_FUNCTION_NAME, 9), + (NUMERIC_LATEST_PUBLISHED_OR_ALIAS_QUALIFIER, {_sQ: _Q}), + ), ) -FILTER_CRITERIA_ERROR_MESSAGE = Schema( - id=ShapeID("com.amazonaws.lambda#FilterCriteriaErrorMessage"), - shape_type=ShapeType.STRING, +GET_POLICY_OUTPUT: StaticSchema = ( + 18, + n0, + _GPO, + {_sSI: _cGPRo, _smit: None}, + (_Po, _RI), + ((STRING, 0), (STRING, 0)), +) + +GET_POLICY: StaticOperationSchema = ( + 23, + n0, + _GP, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/2015-03-31/functions/{FunctionName}/policy", + "code": 200, + } + ) + }, + GET_POLICY_INPUT, + GET_POLICY_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -FILTER_CRITERIA_ERROR = Schema.collection( - id=ShapeID("com.amazonaws.lambda#FilterCriteriaError"), - members={ - "ErrorCode": {"target": FILTER_CRITERIA_ERROR_CODE}, - "Message": {"target": FILTER_CRITERIA_ERROR_MESSAGE}, - }, +GET_RUNTIME_MANAGEMENT_CONFIG_INPUT: StaticSchema = ( + 18, + n0, + _GRMCI, + {_sSI: _cGRMCR, _sm: None}, + (_FN, _Q), + ( + (NAMESPACED_FUNCTION_NAME, 9), + (NUMERIC_LATEST_PUBLISHED_OR_ALIAS_QUALIFIER, {_sQ: _Q}), + ), ) -UUID_STRING = Schema( - id=ShapeID("com.amazonaws.lambda#UUIDString"), shape_type=ShapeType.STRING +UPDATE_RUNTIME_ON: StaticSchema = ( + 14, + n0, + _URO, + 0, + (_Au, _Ma, _FUu), + ((-1, {_sV: _Au}), (-1, {_sV: _Ma}), (-1, {_sV: _FUu})), +) + +GET_RUNTIME_MANAGEMENT_CONFIG_OUTPUT: StaticSchema = ( + 18, + n0, + _GRMCO, + {_sSI: _cGRMCRo, _smit: None}, + (_URO, _FA, _RVA), + ((UPDATE_RUNTIME_ON, 0), (NAME_SPACED_FUNCTION_ARN, 0), (RUNTIME_VERSION_ARN, 0)), +) + +GET_RUNTIME_MANAGEMENT_CONFIG: StaticOperationSchema = ( + 23, + n0, + _GRMC, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/2021-07-20/functions/{FunctionName}/runtime-management-config", + "code": 200, + } + ) + }, + GET_RUNTIME_MANAGEMENT_CONFIG_INPUT, + GET_RUNTIME_MANAGEMENT_CONFIG_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -CREATE_EVENT_SOURCE_MAPPING_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#CreateEventSourceMappingOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#EventSourceMappingConfiguration", - ) - ], - members={ - "UUID": {"target": UUID_STRING}, - "StartingPosition": {"target": EVENT_SOURCE_POSITION}, - "StartingPositionTimestamp": {"target": DATE}, - "BatchSize": {"target": BATCH_SIZE}, - "MaximumBatchingWindowInSeconds": { - "target": MAXIMUM_BATCHING_WINDOW_IN_SECONDS - }, - "ParallelizationFactor": {"target": PARALLELIZATION_FACTOR}, - "EventSourceArn": {"target": ARN}, - "FilterCriteria": {"target": FILTER_CRITERIA}, - "FilterCriteriaError": {"target": FILTER_CRITERIA_ERROR}, - "KMSKeyArn": {"target": KMS_KEY_ARN}, - "MetricsConfig": {"target": EVENT_SOURCE_MAPPING_METRICS_CONFIG}, - "LoggingConfig": {"target": EVENT_SOURCE_MAPPING_LOGGING_CONFIG}, - "ScalingConfig": {"target": SCALING_CONFIG}, - "FunctionArn": {"target": FUNCTION_ARN}, - "LastModified": {"target": DATE}, - "LastProcessingResult": {"target": STRING}, - "State": {"target": STRING}, - "StateTransitionReason": {"target": STRING}, - "DestinationConfig": {"target": DESTINATION_CONFIG}, - "Topics": {"target": TOPICS}, - "Queues": {"target": QUEUES}, - "SourceAccessConfigurations": {"target": SOURCE_ACCESS_CONFIGURATIONS}, - "SelfManagedEventSource": {"target": SELF_MANAGED_EVENT_SOURCE}, - "MaximumRecordAgeInSeconds": {"target": MAXIMUM_RECORD_AGE_IN_SECONDS}, - "BisectBatchOnFunctionError": {"target": BISECT_BATCH_ON_FUNCTION_ERROR}, - "MaximumRetryAttempts": {"target": MAXIMUM_RETRY_ATTEMPTS_EVENT_SOURCE_MAPPING}, - "TumblingWindowInSeconds": {"target": TUMBLING_WINDOW_IN_SECONDS}, - "FunctionResponseTypes": {"target": FUNCTION_RESPONSE_TYPE_LIST}, - "AmazonManagedKafkaEventSourceConfig": { - "target": AMAZON_MANAGED_KAFKA_EVENT_SOURCE_CONFIG - }, - "SelfManagedKafkaEventSourceConfig": { - "target": SELF_MANAGED_KAFKA_EVENT_SOURCE_CONFIG - }, - "DocumentDBEventSourceConfig": {"target": DOCUMENT_DB_EVENT_SOURCE_CONFIG}, - "EventSourceMappingArn": {"target": EVENT_SOURCE_MAPPING_ARN}, - "ProvisionedPollerConfig": {"target": PROVISIONED_POLLER_CONFIG}, - }, +CODE_ARTIFACT_USER_DELETED_EXCEPTION: StaticSchema = ( + 18, + n0, + _CAUDE, + {_smith: _c, _sE: 409}, + (_T, _m), + ((STRING, 0), (STRING, 0)), +) + +CODE_ARTIFACT_USER_FAILED_EXCEPTION: StaticSchema = ( + 18, + n0, + _CAUFE, + {_smith: _c, _sE: 409}, + (_T, _m), + ((STRING, 0), (STRING, 0)), +) + +CODE_ARTIFACT_USER_PENDING_EXCEPTION: StaticSchema = ( + 18, + n0, + _CAUPE, + {_smith: _c, _sE: 409}, + (_T, _m), + ((STRING, 0), (STRING, 0)), +) + +DURABLE_EXECUTION_ALREADY_STARTED_EXCEPTION: StaticSchema = ( + 18, + n0, + _DEASE, + {_smith: _c, _sE: 409}, + (_T, _M), + ((STRING, 0), (STRING, 0)), +) + +EC2_ACCESS_DENIED_EXCEPTION: StaticSchema = ( + 18, + n0, + _ECADE, + {_smith: _se, _sE: 502}, + (_T, _M), + ((STRING, 0), (STRING, 0)), +) + +EC2_THROTTLED_EXCEPTION: StaticSchema = ( + 18, + n0, + _ECTE, + {_smith: _se, _sE: 502}, + (_T, _M), + ((STRING, 0), (STRING, 0)), +) + +EC2_UNEXPECTED_EXCEPTION: StaticSchema = ( + 18, + n0, + _ECUE, + {_smith: _se, _sE: 502}, + (_T, _M, _ECEC), + ((STRING, 0), (STRING, 0), (STRING, 0)), +) + +EFSIO_EXCEPTION: StaticSchema = ( + 18, + n0, + _EFSIOEx, + {_smith: _c, _sE: 410}, + (_T, _M), + ((STRING, 0), (STRING, 0)), +) + +EFS_MOUNT_CONNECTIVITY_EXCEPTION: StaticSchema = ( + 18, + n0, + _EFSMCEo, + {_smith: _c, _sE: 408}, + (_T, _M), + ((STRING, 0), (STRING, 0)), +) + +EFS_MOUNT_FAILURE_EXCEPTION: StaticSchema = ( + 18, + n0, + _EFSMFE, + {_smith: _c, _sE: 403}, + (_T, _M), + ((STRING, 0), (STRING, 0)), +) + +EFS_MOUNT_TIMEOUT_EXCEPTION: StaticSchema = ( + 18, + n0, + _EFSMTE, + {_smith: _c, _sE: 408}, + (_T, _M), + ((STRING, 0), (STRING, 0)), +) + +ENI_LIMIT_REACHED_EXCEPTION: StaticSchema = ( + 18, + n0, + _ENILRE, + {_smith: _se, _sE: 502}, + (_T, _M), + ((STRING, 0), (STRING, 0)), +) + +ENI_NOT_READY_EXCEPTION: StaticSchema = ( + 18, + n0, + _ENINRE, + {_smith: _se, _sE: 502}, + (_T, _M), + ((STRING, 0), (STRING, 0)), +) + +INVALID_REQUEST_CONTENT_EXCEPTION: StaticSchema = ( + 18, + n0, + _IRCE, + {_smith: _c, _sE: 400}, + (_T, _m), + ((STRING, 0), (STRING, 0)), +) + +INVALID_RUNTIME_EXCEPTION: StaticSchema = ( + 18, + n0, + _IRE, + {_smith: _se, _sE: 502}, + (_T, _M), + ((STRING, 0), (STRING, 0)), +) + +INVALID_SECURITY_GROUP_ID_EXCEPTION: StaticSchema = ( + 18, + n0, + _ISGIDE, + {_smith: _se, _sE: 502}, + (_T, _M), + ((STRING, 0), (STRING, 0)), +) + +INVALID_SUBNET_ID_EXCEPTION: StaticSchema = ( + 18, + n0, + _ISIDE, + {_smith: _se, _sE: 502}, + (_T, _M), + ((STRING, 0), (STRING, 0)), +) + +INVALID_ZIP_FILE_EXCEPTION: StaticSchema = ( + 18, + n0, + _IZFE, + {_smith: _se, _sE: 502}, + (_T, _M), + ((STRING, 0), (STRING, 0)), +) + +INVOCATION_TYPE: StaticSchema = ( + 14, + n0, + _ITn, + 0, + (_Ev, _RR, _DR), + ((-1, {_sV: _Ev}), (-1, {_sV: _RR}), (-1, {_sV: _DR})), +) + +LOG_TYPE: StaticSchema = ( + 14, + n0, + _LT, + 0, + (_No, _Tai), + ((-1, {_sV: _No}), (-1, {_sV: _Tai})), +) + +INVOKE_INPUT: StaticSchema = ( + 18, + n0, + _IIn, + {_sSI: _cIR, _sm: None}, + (_FN, _ITn, _LT, _CC, _DEN, _Pa, _Q, _TI), + ( + (NAMESPACED_FUNCTION_NAME, 9), + (INVOCATION_TYPE, {_sH: _XAIT}), + (LOG_TYPE, {_sH: _XALT}), + (STRING, {_sH: _XACC}), + (DURABLE_EXECUTION_NAME, {_sH: _XADEN}), + (BLOB, 16), + (NUMERIC_LATEST_PUBLISHED_OR_ALIAS_QUALIFIER, {_sQ: _Q}), + (TENANT_ID, {_sH: _XATI_}), + ), ) -CREATE_EVENT_SOURCE_MAPPING = Schema( - id=ShapeID("com.amazonaws.lambda#CreateEventSourceMapping"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/2015-03-31/event-source-mappings", - "code": 202, - } - ), - ) - ], +INVOKE_OUTPUT: StaticSchema = ( + 18, + n0, + _IO, + {_sSI: _cIRo, _smit: None}, + (_SC, _FE, _LR, _Pa, _EV, _DEA), + ( + (INTEGER, {_s: 0, _sRC: None}), + (STRING, {_sH: _XAFE}), + (STRING, {_sH: _XALR}), + (BLOB, 16), + (VERSION, {_sH: _XAEV}), + (DURABLE_EXECUTION_ARN, {_sH: _XADEA}), + ), ) -DELETE_EVENT_SOURCE_MAPPING_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#DeleteEventSourceMappingInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#DeleteEventSourceMappingRequest", - ) - ], - members={ - "UUID": { - "target": UUID_STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, +MODE_NOT_SUPPORTED_EXCEPTION: StaticSchema = ( + 18, + n0, + _MNSE, + {_smith: _c, _sE: 400}, + (_T, _m), + ((STRING, 0), (STRING, 0)), +) + +NO_PUBLISHED_VERSION_EXCEPTION: StaticSchema = ( + 18, + n0, + _NPVE, + {_smith: _c, _sE: 400}, + (_T, _M), + ((STRING, 0), (STRING, 0)), +) + +RECURSIVE_INVOCATION_EXCEPTION: StaticSchema = ( + 18, + n0, + _RIE, + {_smith: _c, _sE: 400}, + (_T, _M), + ((STRING, 0), (STRING, 0)), +) + +REQUEST_TOO_LARGE_EXCEPTION: StaticSchema = ( + 18, + n0, + _RTLE, + {_smith: _c, _sE: 413}, + (_T, _m), + ((STRING, 0), (STRING, 0)), +) + +RESOURCE_NOT_READY_EXCEPTION: StaticSchema = ( + 18, + n0, + _RNRE, + {_smith: _se, _sE: 502}, + (_T, _m), + ((STRING, 0), (STRING, 0)), +) + +S3_FILES_MOUNT_CONNECTIVITY_EXCEPTION: StaticSchema = ( + 18, + n0, + _SFMCE, + {_smith: _c, _sE: 408}, + (_T, _M), + ((STRING, 0), (STRING, 0)), +) + +S3_FILES_MOUNT_FAILURE_EXCEPTION: StaticSchema = ( + 18, + n0, + _SFMFE, + {_smith: _c, _sE: 403}, + (_T, _M), + ((STRING, 0), (STRING, 0)), +) + +S3_FILES_MOUNT_TIMEOUT_EXCEPTION: StaticSchema = ( + 18, + n0, + _SFMTE, + {_smith: _c, _sE: 408}, + (_T, _M), + ((STRING, 0), (STRING, 0)), +) + +SERIALIZED_REQUEST_ENTITY_TOO_LARGE_EXCEPTION: StaticSchema = ( + 18, + n0, + _SRETLE, + {_smith: _c, _sE: 413}, + (_T, _m), + ((STRING, 0), (STRING, 0)), +) + +SERVICE_QUOTA_EXCEEDED_EXCEPTION: StaticSchema = ( + 18, + n0, + _SQEE, + {_smith: _c, _sE: 402}, + (_T, _M), + ((STRING, 0), (STRING, 0)), +) + +SNAP_START_EXCEPTION: StaticSchema = ( + 18, + n0, + _SSE, + {_smith: _c, _sE: 400}, + (_T, _M), + ((STRING, 0), (STRING, 0)), +) + +SNAP_START_NOT_READY_EXCEPTION: StaticSchema = ( + 18, + n0, + _SSNRE, + {_smith: _c, _sE: 409}, + (_T, _M), + ((STRING, 0), (STRING, 0)), +) + +SNAP_START_REGENERATION_FAILURE_EXCEPTION: StaticSchema = ( + 18, + n0, + _SSRFE, + {_smith: _c, _sE: 409}, + (_T, _M), + ((STRING, 0), (STRING, 0)), +) + +SNAP_START_TIMEOUT_EXCEPTION: StaticSchema = ( + 18, + n0, + _SSTE, + {_smith: _c, _sE: 408}, + (_T, _M), + ((STRING, 0), (STRING, 0)), +) + +SUBNET_IP_ADDRESS_LIMIT_REACHED_EXCEPTION: StaticSchema = ( + 18, + n0, + _SIPALRE, + {_smith: _se, _sE: 502}, + (_T, _M), + ((STRING, 0), (STRING, 0)), +) + +UNSUPPORTED_MEDIA_TYPE_EXCEPTION: StaticSchema = ( + 18, + n0, + _UMTE, + {_smith: _c, _sE: 415}, + (_T, _m), + ((STRING, 0), (STRING, 0)), +) + +INVOKE: StaticOperationSchema = ( + 23, + n0, + _Inv, + { + _smithy: MappingProxyType( + { + "method": "POST", + "uri": "/2015-03-31/functions/{FunctionName}/invocations", + "code": 200, + } + ) + }, + INVOKE_INPUT, + INVOKE_OUTPUT, + ( + CODE_ARTIFACT_USER_DELETED_EXCEPTION, + CODE_ARTIFACT_USER_FAILED_EXCEPTION, + CODE_ARTIFACT_USER_PENDING_EXCEPTION, + DURABLE_EXECUTION_ALREADY_STARTED_EXCEPTION, + EC2_ACCESS_DENIED_EXCEPTION, + EC2_THROTTLED_EXCEPTION, + EC2_UNEXPECTED_EXCEPTION, + EFSIO_EXCEPTION, + EFS_MOUNT_CONNECTIVITY_EXCEPTION, + EFS_MOUNT_FAILURE_EXCEPTION, + EFS_MOUNT_TIMEOUT_EXCEPTION, + ENI_LIMIT_REACHED_EXCEPTION, + ENI_NOT_READY_EXCEPTION, + INVALID_PARAMETER_VALUE_EXCEPTION, + INVALID_REQUEST_CONTENT_EXCEPTION, + INVALID_RUNTIME_EXCEPTION, + INVALID_SECURITY_GROUP_ID_EXCEPTION, + INVALID_SUBNET_ID_EXCEPTION, + INVALID_ZIP_FILE_EXCEPTION, + KMS_ACCESS_DENIED_EXCEPTION, + KMS_DISABLED_EXCEPTION, + KMS_INVALID_STATE_EXCEPTION, + KMS_NOT_FOUND_EXCEPTION, + MODE_NOT_SUPPORTED_EXCEPTION, + NO_PUBLISHED_VERSION_EXCEPTION, + RECURSIVE_INVOCATION_EXCEPTION, + REQUEST_TOO_LARGE_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + RESOURCE_NOT_READY_EXCEPTION, + S3_FILES_MOUNT_CONNECTIVITY_EXCEPTION, + S3_FILES_MOUNT_FAILURE_EXCEPTION, + S3_FILES_MOUNT_TIMEOUT_EXCEPTION, + SERIALIZED_REQUEST_ENTITY_TOO_LARGE_EXCEPTION, + SERVICE_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + SNAP_START_EXCEPTION, + SNAP_START_NOT_READY_EXCEPTION, + SNAP_START_REGENERATION_FAILURE_EXCEPTION, + SNAP_START_TIMEOUT_EXCEPTION, + SUBNET_IP_ADDRESS_LIMIT_REACHED_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNSUPPORTED_MEDIA_TYPE_EXCEPTION, + ), ) -DELETE_EVENT_SOURCE_MAPPING_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#DeleteEventSourceMappingOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#EventSourceMappingConfiguration", - ) - ], - members={ - "UUID": {"target": UUID_STRING}, - "StartingPosition": {"target": EVENT_SOURCE_POSITION}, - "StartingPositionTimestamp": {"target": DATE}, - "BatchSize": {"target": BATCH_SIZE}, - "MaximumBatchingWindowInSeconds": { - "target": MAXIMUM_BATCHING_WINDOW_IN_SECONDS - }, - "ParallelizationFactor": {"target": PARALLELIZATION_FACTOR}, - "EventSourceArn": {"target": ARN}, - "FilterCriteria": {"target": FILTER_CRITERIA}, - "FilterCriteriaError": {"target": FILTER_CRITERIA_ERROR}, - "KMSKeyArn": {"target": KMS_KEY_ARN}, - "MetricsConfig": {"target": EVENT_SOURCE_MAPPING_METRICS_CONFIG}, - "LoggingConfig": {"target": EVENT_SOURCE_MAPPING_LOGGING_CONFIG}, - "ScalingConfig": {"target": SCALING_CONFIG}, - "FunctionArn": {"target": FUNCTION_ARN}, - "LastModified": {"target": DATE}, - "LastProcessingResult": {"target": STRING}, - "State": {"target": STRING}, - "StateTransitionReason": {"target": STRING}, - "DestinationConfig": {"target": DESTINATION_CONFIG}, - "Topics": {"target": TOPICS}, - "Queues": {"target": QUEUES}, - "SourceAccessConfigurations": {"target": SOURCE_ACCESS_CONFIGURATIONS}, - "SelfManagedEventSource": {"target": SELF_MANAGED_EVENT_SOURCE}, - "MaximumRecordAgeInSeconds": {"target": MAXIMUM_RECORD_AGE_IN_SECONDS}, - "BisectBatchOnFunctionError": {"target": BISECT_BATCH_ON_FUNCTION_ERROR}, - "MaximumRetryAttempts": {"target": MAXIMUM_RETRY_ATTEMPTS_EVENT_SOURCE_MAPPING}, - "TumblingWindowInSeconds": {"target": TUMBLING_WINDOW_IN_SECONDS}, - "FunctionResponseTypes": {"target": FUNCTION_RESPONSE_TYPE_LIST}, - "AmazonManagedKafkaEventSourceConfig": { - "target": AMAZON_MANAGED_KAFKA_EVENT_SOURCE_CONFIG - }, - "SelfManagedKafkaEventSourceConfig": { - "target": SELF_MANAGED_KAFKA_EVENT_SOURCE_CONFIG - }, - "DocumentDBEventSourceConfig": {"target": DOCUMENT_DB_EVENT_SOURCE_CONFIG}, - "EventSourceMappingArn": {"target": EVENT_SOURCE_MAPPING_ARN}, - "ProvisionedPollerConfig": {"target": PROVISIONED_POLLER_CONFIG}, - }, +BLOB_STREAM: StaticSchema = (1, n0, _BSl, {_smithyap: None}) + +INVOKE_ASYNC_INPUT: StaticSchema = ( + 18, + n0, + _IAI, + {_sSI: _cIAR, _sm: None}, + (_FN, _IA), + ((NAMESPACED_FUNCTION_NAME, 9), (BLOB_STREAM, 17)), +) + +HTTP_STATUS: StaticSchema = (7, n0, _HS, {_s: 0}) + +INVOKE_ASYNC_OUTPUT: StaticSchema = ( + 18, + n0, + _IAO, + {_sSI: _cIARo, _smit: None}, + (_Stat,), + ((HTTP_STATUS, {_s: 0, _sRC: None}),), +) + +INVOKE_ASYNC: StaticOperationSchema = ( + 23, + n0, + _IAn, + { + _smithy: MappingProxyType( + { + "method": "POST", + "uri": "/2014-11-13/functions/{FunctionName}/invoke-async", + "code": 202, + } + ) + }, + INVOKE_ASYNC_INPUT, + INVOKE_ASYNC_OUTPUT, + ( + EC2_ACCESS_DENIED_EXCEPTION, + EC2_THROTTLED_EXCEPTION, + EC2_UNEXPECTED_EXCEPTION, + EFSIO_EXCEPTION, + EFS_MOUNT_CONNECTIVITY_EXCEPTION, + EFS_MOUNT_FAILURE_EXCEPTION, + EFS_MOUNT_TIMEOUT_EXCEPTION, + ENI_LIMIT_REACHED_EXCEPTION, + INVALID_REQUEST_CONTENT_EXCEPTION, + INVALID_RUNTIME_EXCEPTION, + INVALID_SECURITY_GROUP_ID_EXCEPTION, + INVALID_SUBNET_ID_EXCEPTION, + KMS_ACCESS_DENIED_EXCEPTION, + KMS_DISABLED_EXCEPTION, + KMS_INVALID_STATE_EXCEPTION, + KMS_NOT_FOUND_EXCEPTION, + MODE_NOT_SUPPORTED_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + S3_FILES_MOUNT_CONNECTIVITY_EXCEPTION, + S3_FILES_MOUNT_FAILURE_EXCEPTION, + S3_FILES_MOUNT_TIMEOUT_EXCEPTION, + SERVICE_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + SNAP_START_EXCEPTION, + SNAP_START_NOT_READY_EXCEPTION, + SNAP_START_REGENERATION_FAILURE_EXCEPTION, + SNAP_START_TIMEOUT_EXCEPTION, + SUBNET_IP_ADDRESS_LIMIT_REACHED_EXCEPTION, + ), ) -RESOURCE_IN_USE_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ResourceInUseException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"Type": {"target": STRING}, "Message": {"target": STRING}}, -) - -DELETE_EVENT_SOURCE_MAPPING = Schema( - id=ShapeID("com.amazonaws.lambda#DeleteEventSourceMapping"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/2015-03-31/event-source-mappings/{UUID}", - "code": 202, - } - ), - ) - ], +RESPONSE_STREAMING_INVOCATION_TYPE: StaticSchema = ( + 14, + n0, + _RSIT, + 0, + (_RR, _DR), + ((-1, {_sV: _RR}), (-1, {_sV: _DR})), +) + +INVOKE_WITH_RESPONSE_STREAM_INPUT: StaticSchema = ( + 18, + n0, + _IWRSI, + {_sSI: _cIWRSR, _sm: None}, + (_FN, _LT, _CC, _Q, _Pa, _TI, _ITn), + ( + (NAMESPACED_FUNCTION_NAME, 9), + (LOG_TYPE, {_sH: _XALT}), + (STRING, {_sH: _XACC}), + (NUMERIC_LATEST_PUBLISHED_OR_ALIAS_QUALIFIER, {_sQ: _Q}), + (BLOB, 16), + (TENANT_ID, {_sH: _XATI_}), + (RESPONSE_STREAMING_INVOCATION_TYPE, {_sH: _XAIT}), + ), ) -GET_EVENT_SOURCE_MAPPING_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#GetEventSourceMappingInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#GetEventSourceMappingRequest", - ) - ], - members={ - "UUID": { - "target": UUID_STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, +INVOKE_WITH_RESPONSE_STREAM_COMPLETE_EVENT: StaticSchema = ( + 18, + n0, + _IWRSCE, + 0, + (_ECrr, _EDr, _LR), + ((STRING, 0), (STRING, 0), (STRING, 0)), +) + +INVOKE_RESPONSE_STREAM_UPDATE: StaticSchema = ( + 18, + n0, + _IRSU, + 0, + (_Pa,), + ((BLOB, {_sPm: None}),), +) + +INVOKE_WITH_RESPONSE_STREAM_RESPONSE_EVENT: StaticSchema = ( + 19, + n0, + _IWRSRE, + {_smithyap: None}, + (_PCa, _ICnvo), + ( + (INVOKE_RESPONSE_STREAM_UPDATE, 0), + (INVOKE_WITH_RESPONSE_STREAM_COMPLETE_EVENT, 0), + ), ) -GET_EVENT_SOURCE_MAPPING_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#GetEventSourceMappingOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#EventSourceMappingConfiguration", - ) - ], - members={ - "UUID": {"target": UUID_STRING}, - "StartingPosition": {"target": EVENT_SOURCE_POSITION}, - "StartingPositionTimestamp": {"target": DATE}, - "BatchSize": {"target": BATCH_SIZE}, - "MaximumBatchingWindowInSeconds": { - "target": MAXIMUM_BATCHING_WINDOW_IN_SECONDS - }, - "ParallelizationFactor": {"target": PARALLELIZATION_FACTOR}, - "EventSourceArn": {"target": ARN}, - "FilterCriteria": {"target": FILTER_CRITERIA}, - "FilterCriteriaError": {"target": FILTER_CRITERIA_ERROR}, - "KMSKeyArn": {"target": KMS_KEY_ARN}, - "MetricsConfig": {"target": EVENT_SOURCE_MAPPING_METRICS_CONFIG}, - "LoggingConfig": {"target": EVENT_SOURCE_MAPPING_LOGGING_CONFIG}, - "ScalingConfig": {"target": SCALING_CONFIG}, - "FunctionArn": {"target": FUNCTION_ARN}, - "LastModified": {"target": DATE}, - "LastProcessingResult": {"target": STRING}, - "State": {"target": STRING}, - "StateTransitionReason": {"target": STRING}, - "DestinationConfig": {"target": DESTINATION_CONFIG}, - "Topics": {"target": TOPICS}, - "Queues": {"target": QUEUES}, - "SourceAccessConfigurations": {"target": SOURCE_ACCESS_CONFIGURATIONS}, - "SelfManagedEventSource": {"target": SELF_MANAGED_EVENT_SOURCE}, - "MaximumRecordAgeInSeconds": {"target": MAXIMUM_RECORD_AGE_IN_SECONDS}, - "BisectBatchOnFunctionError": {"target": BISECT_BATCH_ON_FUNCTION_ERROR}, - "MaximumRetryAttempts": {"target": MAXIMUM_RETRY_ATTEMPTS_EVENT_SOURCE_MAPPING}, - "TumblingWindowInSeconds": {"target": TUMBLING_WINDOW_IN_SECONDS}, - "FunctionResponseTypes": {"target": FUNCTION_RESPONSE_TYPE_LIST}, - "AmazonManagedKafkaEventSourceConfig": { - "target": AMAZON_MANAGED_KAFKA_EVENT_SOURCE_CONFIG - }, - "SelfManagedKafkaEventSourceConfig": { - "target": SELF_MANAGED_KAFKA_EVENT_SOURCE_CONFIG - }, - "DocumentDBEventSourceConfig": {"target": DOCUMENT_DB_EVENT_SOURCE_CONFIG}, - "EventSourceMappingArn": {"target": EVENT_SOURCE_MAPPING_ARN}, - "ProvisionedPollerConfig": {"target": PROVISIONED_POLLER_CONFIG}, - }, +INVOKE_WITH_RESPONSE_STREAM_OUTPUT: StaticSchema = ( + 18, + n0, + _IWRSO, + {_sSI: _cIWRSRo, _smit: None}, + (_SC, _EV, _ESv, _RSCT), + ( + (INTEGER, {_s: 0, _sRC: None}), + (VERSION, {_sH: _XAEV}), + (INVOKE_WITH_RESPONSE_STREAM_RESPONSE_EVENT, 16), + (STRING, {_sH: _CT_}), + ), ) -GET_EVENT_SOURCE_MAPPING = Schema( - id=ShapeID("com.amazonaws.lambda#GetEventSourceMapping"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/2015-03-31/event-source-mappings/{UUID}", - "code": 200, - } - ), - ) - ], +INVOKE_WITH_RESPONSE_STREAM: StaticOperationSchema = ( + 23, + n0, + _IWRS, + { + _smithy: MappingProxyType( + { + "method": "POST", + "uri": "/2021-11-15/functions/{FunctionName}/response-streaming-invocations", + "code": 200, + } + ) + }, + INVOKE_WITH_RESPONSE_STREAM_INPUT, + INVOKE_WITH_RESPONSE_STREAM_OUTPUT, + ( + EC2_ACCESS_DENIED_EXCEPTION, + EC2_THROTTLED_EXCEPTION, + EC2_UNEXPECTED_EXCEPTION, + EFSIO_EXCEPTION, + EFS_MOUNT_CONNECTIVITY_EXCEPTION, + EFS_MOUNT_FAILURE_EXCEPTION, + EFS_MOUNT_TIMEOUT_EXCEPTION, + ENI_LIMIT_REACHED_EXCEPTION, + INVALID_PARAMETER_VALUE_EXCEPTION, + INVALID_REQUEST_CONTENT_EXCEPTION, + INVALID_RUNTIME_EXCEPTION, + INVALID_SECURITY_GROUP_ID_EXCEPTION, + INVALID_SUBNET_ID_EXCEPTION, + INVALID_ZIP_FILE_EXCEPTION, + KMS_ACCESS_DENIED_EXCEPTION, + KMS_DISABLED_EXCEPTION, + KMS_INVALID_STATE_EXCEPTION, + KMS_NOT_FOUND_EXCEPTION, + NO_PUBLISHED_VERSION_EXCEPTION, + RECURSIVE_INVOCATION_EXCEPTION, + REQUEST_TOO_LARGE_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + RESOURCE_NOT_READY_EXCEPTION, + S3_FILES_MOUNT_CONNECTIVITY_EXCEPTION, + S3_FILES_MOUNT_FAILURE_EXCEPTION, + S3_FILES_MOUNT_TIMEOUT_EXCEPTION, + SERIALIZED_REQUEST_ENTITY_TOO_LARGE_EXCEPTION, + SERVICE_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + SNAP_START_EXCEPTION, + SNAP_START_NOT_READY_EXCEPTION, + SNAP_START_REGENERATION_FAILURE_EXCEPTION, + SNAP_START_TIMEOUT_EXCEPTION, + SUBNET_IP_ADDRESS_LIMIT_REACHED_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + UNSUPPORTED_MEDIA_TYPE_EXCEPTION, + ), ) -LIST_EVENT_SOURCE_MAPPINGS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ListEventSourceMappingsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#ListEventSourceMappingsRequest", - ) - ], - members={ - "EventSourceArn": { - "target": ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="EventSourceArn") - ], - }, - "FunctionName": { - "target": NAMESPACED_FUNCTION_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="FunctionName") - ], - }, - "Marker": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="Marker")], - }, - "MaxItems": { - "target": MAX_LIST_ITEMS, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="MaxItems")], - }, - }, +EXECUTION_STATUS_LIST: StaticSchema = ( + 16, + n0, + _ESL, + 0, + (_me,), + ((EXECUTION_STATUS, 0),), +) + +LIST_DURABLE_EXECUTIONS_BY_FUNCTION_INPUT: StaticSchema = ( + 18, + n0, + _LDEBFI, + {_sSI: _cLDEBFR, _sm: None}, + (_FN, _Q, _DEN, _Statu, _SAt, _SBt, _RO, _Mar, _MI), + ( + (NAMESPACED_FUNCTION_NAME, 9), + (NUMERIC_LATEST_PUBLISHED_OR_ALIAS_QUALIFIER, {_sQ: _Q}), + (DURABLE_EXECUTION_NAME, {_sQ: _DEN}), + (EXECUTION_STATUS_LIST, {_sQ: _Statu}), + (EXECUTION_TIMESTAMP, {_sQ: _SAt}), + (EXECUTION_TIMESTAMP, {_sQ: _SBt}), + (REVERSE_ORDER, {_sQ: _RO}), + (STRING, {_sQ: _Mar}), + (ITEM_COUNT, {_s: 0, _sQ: _MI}), + ), ) -EVENT_SOURCE_MAPPING_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#EventSourceMappingConfiguration"), - members={ - "UUID": {"target": UUID_STRING}, - "StartingPosition": {"target": EVENT_SOURCE_POSITION}, - "StartingPositionTimestamp": {"target": DATE}, - "BatchSize": {"target": BATCH_SIZE}, - "MaximumBatchingWindowInSeconds": { - "target": MAXIMUM_BATCHING_WINDOW_IN_SECONDS - }, - "ParallelizationFactor": {"target": PARALLELIZATION_FACTOR}, - "EventSourceArn": {"target": ARN}, - "FilterCriteria": {"target": FILTER_CRITERIA}, - "FilterCriteriaError": {"target": FILTER_CRITERIA_ERROR}, - "KMSKeyArn": {"target": KMS_KEY_ARN}, - "MetricsConfig": {"target": EVENT_SOURCE_MAPPING_METRICS_CONFIG}, - "LoggingConfig": {"target": EVENT_SOURCE_MAPPING_LOGGING_CONFIG}, - "ScalingConfig": {"target": SCALING_CONFIG}, - "FunctionArn": {"target": FUNCTION_ARN}, - "LastModified": {"target": DATE}, - "LastProcessingResult": {"target": STRING}, - "State": {"target": STRING}, - "StateTransitionReason": {"target": STRING}, - "DestinationConfig": {"target": DESTINATION_CONFIG}, - "Topics": {"target": TOPICS}, - "Queues": {"target": QUEUES}, - "SourceAccessConfigurations": {"target": SOURCE_ACCESS_CONFIGURATIONS}, - "SelfManagedEventSource": {"target": SELF_MANAGED_EVENT_SOURCE}, - "MaximumRecordAgeInSeconds": {"target": MAXIMUM_RECORD_AGE_IN_SECONDS}, - "BisectBatchOnFunctionError": {"target": BISECT_BATCH_ON_FUNCTION_ERROR}, - "MaximumRetryAttempts": {"target": MAXIMUM_RETRY_ATTEMPTS_EVENT_SOURCE_MAPPING}, - "TumblingWindowInSeconds": {"target": TUMBLING_WINDOW_IN_SECONDS}, - "FunctionResponseTypes": {"target": FUNCTION_RESPONSE_TYPE_LIST}, - "AmazonManagedKafkaEventSourceConfig": { - "target": AMAZON_MANAGED_KAFKA_EVENT_SOURCE_CONFIG - }, - "SelfManagedKafkaEventSourceConfig": { - "target": SELF_MANAGED_KAFKA_EVENT_SOURCE_CONFIG - }, - "DocumentDBEventSourceConfig": {"target": DOCUMENT_DB_EVENT_SOURCE_CONFIG}, - "EventSourceMappingArn": {"target": EVENT_SOURCE_MAPPING_ARN}, - "ProvisionedPollerConfig": {"target": PROVISIONED_POLLER_CONFIG}, - }, +EXECUTION: StaticSchema = ( + 18, + n0, + _Exe, + 0, + (_DEA, _DEN, _FA, _Stat, _STt, _ETn, _KMSKA), + ( + (DURABLE_EXECUTION_ARN, 1), + (DURABLE_EXECUTION_NAME, 1), + (NAME_SPACED_FUNCTION_ARN, 1), + (EXECUTION_STATUS, 1), + (EXECUTION_TIMESTAMP, 1), + (EXECUTION_TIMESTAMP, 0), + (KMS_KEY_ARN, 0), + ), ) -EVENT_SOURCE_MAPPINGS_LIST = Schema.collection( - id=ShapeID("com.amazonaws.lambda#EventSourceMappingsList"), - shape_type=ShapeType.LIST, - members={"member": {"target": EVENT_SOURCE_MAPPING_CONFIGURATION}}, +DURABLE_EXECUTIONS: StaticSchema = (16, n0, _DEu, 0, (_me,), ((EXECUTION, 0),)) + +LIST_DURABLE_EXECUTIONS_BY_FUNCTION_OUTPUT: StaticSchema = ( + 18, + n0, + _LDEBFO, + {_sSI: _cLDEBFRo, _smit: None}, + (_DEu, _NM), + ((DURABLE_EXECUTIONS, 0), (STRING, 0)), +) + +LIST_DURABLE_EXECUTIONS_BY_FUNCTION: StaticOperationSchema = ( + 23, + n0, + _LDEBF, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/2025-12-01/functions/{FunctionName}/durable-executions", + "code": 200, + } + ) + }, + LIST_DURABLE_EXECUTIONS_BY_FUNCTION_INPUT, + LIST_DURABLE_EXECUTIONS_BY_FUNCTION_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -LIST_EVENT_SOURCE_MAPPINGS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ListEventSourceMappingsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#ListEventSourceMappingsResponse", - ) - ], - members={ - "NextMarker": {"target": STRING}, - "EventSourceMappings": {"target": EVENT_SOURCE_MAPPINGS_LIST}, - }, -) +FUNCTION_VERSION: StaticSchema = (14, n0, _FV, 0, (_ALL_,), ((-1, {_sV: _ALL_}),)) -LIST_EVENT_SOURCE_MAPPINGS = Schema( - id=ShapeID("com.amazonaws.lambda#ListEventSourceMappings"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/2015-03-31/event-source-mappings", - "code": 200, - } - ), - ) - ], -) +MASTER_REGION: StaticSchema = (3, n0, _MR, 0) -UPDATE_EVENT_SOURCE_MAPPING_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#UpdateEventSourceMappingInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#UpdateEventSourceMappingRequest", - ) - ], - members={ - "UUID": { - "target": UUID_STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "FunctionName": {"target": NAMESPACED_FUNCTION_NAME}, - "Enabled": {"target": ENABLED}, - "BatchSize": {"target": BATCH_SIZE}, - "FilterCriteria": {"target": FILTER_CRITERIA}, - "KMSKeyArn": {"target": KMS_KEY_ARN}, - "MetricsConfig": {"target": EVENT_SOURCE_MAPPING_METRICS_CONFIG}, - "LoggingConfig": {"target": EVENT_SOURCE_MAPPING_LOGGING_CONFIG}, - "ScalingConfig": {"target": SCALING_CONFIG}, - "MaximumBatchingWindowInSeconds": { - "target": MAXIMUM_BATCHING_WINDOW_IN_SECONDS - }, - "ParallelizationFactor": {"target": PARALLELIZATION_FACTOR}, - "DestinationConfig": {"target": DESTINATION_CONFIG}, - "MaximumRecordAgeInSeconds": {"target": MAXIMUM_RECORD_AGE_IN_SECONDS}, - "BisectBatchOnFunctionError": {"target": BISECT_BATCH_ON_FUNCTION_ERROR}, - "MaximumRetryAttempts": {"target": MAXIMUM_RETRY_ATTEMPTS_EVENT_SOURCE_MAPPING}, - "TumblingWindowInSeconds": {"target": TUMBLING_WINDOW_IN_SECONDS}, - "SourceAccessConfigurations": {"target": SOURCE_ACCESS_CONFIGURATIONS}, - "FunctionResponseTypes": {"target": FUNCTION_RESPONSE_TYPE_LIST}, - "AmazonManagedKafkaEventSourceConfig": { - "target": AMAZON_MANAGED_KAFKA_EVENT_SOURCE_CONFIG - }, - "SelfManagedKafkaEventSourceConfig": { - "target": SELF_MANAGED_KAFKA_EVENT_SOURCE_CONFIG - }, - "DocumentDBEventSourceConfig": {"target": DOCUMENT_DB_EVENT_SOURCE_CONFIG}, - "ProvisionedPollerConfig": {"target": PROVISIONED_POLLER_CONFIG}, - }, +LIST_FUNCTIONS_INPUT: StaticSchema = ( + 18, + n0, + _LFI, + {_sSI: _cLFR, _sm: None}, + (_MR, _FV, _Mar, _MI), + ( + (MASTER_REGION, {_sQ: _MR}), + (FUNCTION_VERSION, {_sQ: _FV}), + (STRING, {_sQ: _Mar}), + (MAX_LIST_ITEMS, {_sQ: _MI}), + ), ) -UPDATE_EVENT_SOURCE_MAPPING_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#UpdateEventSourceMappingOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#EventSourceMappingConfiguration", - ) - ], - members={ - "UUID": {"target": UUID_STRING}, - "StartingPosition": {"target": EVENT_SOURCE_POSITION}, - "StartingPositionTimestamp": {"target": DATE}, - "BatchSize": {"target": BATCH_SIZE}, - "MaximumBatchingWindowInSeconds": { - "target": MAXIMUM_BATCHING_WINDOW_IN_SECONDS - }, - "ParallelizationFactor": {"target": PARALLELIZATION_FACTOR}, - "EventSourceArn": {"target": ARN}, - "FilterCriteria": {"target": FILTER_CRITERIA}, - "FilterCriteriaError": {"target": FILTER_CRITERIA_ERROR}, - "KMSKeyArn": {"target": KMS_KEY_ARN}, - "MetricsConfig": {"target": EVENT_SOURCE_MAPPING_METRICS_CONFIG}, - "LoggingConfig": {"target": EVENT_SOURCE_MAPPING_LOGGING_CONFIG}, - "ScalingConfig": {"target": SCALING_CONFIG}, - "FunctionArn": {"target": FUNCTION_ARN}, - "LastModified": {"target": DATE}, - "LastProcessingResult": {"target": STRING}, - "State": {"target": STRING}, - "StateTransitionReason": {"target": STRING}, - "DestinationConfig": {"target": DESTINATION_CONFIG}, - "Topics": {"target": TOPICS}, - "Queues": {"target": QUEUES}, - "SourceAccessConfigurations": {"target": SOURCE_ACCESS_CONFIGURATIONS}, - "SelfManagedEventSource": {"target": SELF_MANAGED_EVENT_SOURCE}, - "MaximumRecordAgeInSeconds": {"target": MAXIMUM_RECORD_AGE_IN_SECONDS}, - "BisectBatchOnFunctionError": {"target": BISECT_BATCH_ON_FUNCTION_ERROR}, - "MaximumRetryAttempts": {"target": MAXIMUM_RETRY_ATTEMPTS_EVENT_SOURCE_MAPPING}, - "TumblingWindowInSeconds": {"target": TUMBLING_WINDOW_IN_SECONDS}, - "FunctionResponseTypes": {"target": FUNCTION_RESPONSE_TYPE_LIST}, - "AmazonManagedKafkaEventSourceConfig": { - "target": AMAZON_MANAGED_KAFKA_EVENT_SOURCE_CONFIG - }, - "SelfManagedKafkaEventSourceConfig": { - "target": SELF_MANAGED_KAFKA_EVENT_SOURCE_CONFIG - }, - "DocumentDBEventSourceConfig": {"target": DOCUMENT_DB_EVENT_SOURCE_CONFIG}, - "EventSourceMappingArn": {"target": EVENT_SOURCE_MAPPING_ARN}, - "ProvisionedPollerConfig": {"target": PROVISIONED_POLLER_CONFIG}, - }, +FUNCTION_LIST: StaticSchema = (16, n0, _FLu, 0, (_me,), ((FUNCTION_CONFIGURATION, 0),)) + +LIST_FUNCTIONS_OUTPUT: StaticSchema = ( + 18, + n0, + _LFO, + {_sSI: _cLFRo, _smit: None}, + (_NM, _Fu), + ((STRING, 0), (FUNCTION_LIST, 0)), +) + +LIST_FUNCTIONS: StaticOperationSchema = ( + 23, + n0, + _LFi, + { + _smithy: MappingProxyType( + {"method": "GET", "uri": "/2015-03-31/functions", "code": 200} + ) + }, + LIST_FUNCTIONS_INPUT, + LIST_FUNCTIONS_OUTPUT, + (INVALID_PARAMETER_VALUE_EXCEPTION, SERVICE_EXCEPTION, TOO_MANY_REQUESTS_EXCEPTION), +) + +MAX_ITEMS: StaticSchema = (7, n0, _MI, 0) + +LIST_FUNCTION_URL_CONFIGS_INPUT: StaticSchema = ( + 18, + n0, + _LFUCI, + {_sSI: _cLFUCR, _sm: None}, + (_FN, _Mar, _MI), + ((FUNCTION_URL_FUNCTION_NAME, 9), (STRING, {_sQ: _Mar}), (MAX_ITEMS, {_sQ: _MI})), +) + +FUNCTION_URL_CONFIG: StaticSchema = ( + 18, + n0, + _FUC, + 0, + (_FU, _FA, _CTr, _LMT, _Cor, _ATu, _IM), + ( + (FUNCTION_URL, 1), + (FUNCTION_ARN, 1), + (TIMESTAMP, 1), + (TIMESTAMP, 1), + (CORS, 0), + (FUNCTION_URL_AUTH_TYPE, 1), + (INVOKE_MODE, 0), + ), ) -UPDATE_EVENT_SOURCE_MAPPING = Schema( - id=ShapeID("com.amazonaws.lambda#UpdateEventSourceMapping"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PUT", - "uri": "/2015-03-31/event-source-mappings/{UUID}", - "code": 202, - } - ), - ) - ], -) - -CODE_SIGNING_CONFIG_NOT_FOUND_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#CodeSigningConfigNotFoundException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=404), - ], - members={"Type": {"target": STRING}, "Message": {"target": STRING}}, -) - -CODE_STORAGE_EXCEEDED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#CodeStorageExceededException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"Type": {"target": STRING}, "message": {"target": STRING}}, -) - -CODE_VERIFICATION_FAILED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#CodeVerificationFailedException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"Type": {"target": STRING}, "Message": {"target": STRING}}, -) - -EXECUTION_ENVIRONMENT_MEMORY_GI_B_PER_V_CPU = Schema( - id=ShapeID("com.amazonaws.lambda#ExecutionEnvironmentMemoryGiBPerVCpu"), - shape_type=ShapeType.DOUBLE, -) - -PER_EXECUTION_ENVIRONMENT_MAX_CONCURRENCY = Schema( - id=ShapeID("com.amazonaws.lambda#PerExecutionEnvironmentMaxConcurrency"), - shape_type=ShapeType.INTEGER, -) - -LAMBDA_MANAGED_INSTANCES_CAPACITY_PROVIDER_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.lambda#LambdaManagedInstancesCapacityProviderConfig"), - members={ - "CapacityProviderArn": { - "target": CAPACITY_PROVIDER_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "PerExecutionEnvironmentMaxConcurrency": { - "target": PER_EXECUTION_ENVIRONMENT_MAX_CONCURRENCY - }, - "ExecutionEnvironmentMemoryGiBPerVCpu": { - "target": EXECUTION_ENVIRONMENT_MEMORY_GI_B_PER_V_CPU - }, - }, +FUNCTION_URL_CONFIG_LIST: StaticSchema = ( + 16, + n0, + _FUCL, + 0, + (_me,), + ((FUNCTION_URL_CONFIG, 0),), +) + +LIST_FUNCTION_URL_CONFIGS_OUTPUT: StaticSchema = ( + 18, + n0, + _LFUCO, + {_sSI: _cLFUCRo, _smit: None}, + (_FUCu, _NM), + ((FUNCTION_URL_CONFIG_LIST, 1), (STRING, 0)), +) + +LIST_FUNCTION_URL_CONFIGS: StaticOperationSchema = ( + 23, + n0, + _LFUC, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/2021-10-31/functions/{FunctionName}/urls", + "code": 200, + } + ) + }, + LIST_FUNCTION_URL_CONFIGS_INPUT, + LIST_FUNCTION_URL_CONFIGS_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -CAPACITY_PROVIDER_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.lambda#CapacityProviderConfig"), - members={ - "LambdaManagedInstancesCapacityProviderConfig": { - "target": LAMBDA_MANAGED_INSTANCES_CAPACITY_PROVIDER_CONFIG, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +MAX_PROVISIONED_CONCURRENCY_CONFIG_LIST_ITEMS: StaticSchema = (7, n0, _MPCCLI, 0) -S3_BUCKET = Schema( - id=ShapeID("com.amazonaws.lambda#S3Bucket"), shape_type=ShapeType.STRING +LIST_PROVISIONED_CONCURRENCY_CONFIGS_INPUT: StaticSchema = ( + 18, + n0, + _LPCCI, + {_sSI: _cLPCCR, _sm: None}, + (_FN, _Mar, _MI), + ( + (FUNCTION_NAME, 9), + (STRING, {_sQ: _Mar}), + (MAX_PROVISIONED_CONCURRENCY_CONFIG_LIST_ITEMS, {_sQ: _MI}), + ), ) -S3_KEY = Schema(id=ShapeID("com.amazonaws.lambda#S3Key"), shape_type=ShapeType.STRING) - -S3_OBJECT_STORAGE_MODE = Schema.collection( - id=ShapeID("com.amazonaws.lambda#S3ObjectStorageMode"), - shape_type=ShapeType.ENUM, - members={"Copy": {"target": UNIT}, "Reference": {"target": UNIT}}, +NON_NEGATIVE_INTEGER: StaticSchema = (7, n0, _NNI, 0) + +POSITIVE_INTEGER: StaticSchema = (7, n0, _PIo, 0) + +PROVISIONED_CONCURRENCY_STATUS_ENUM: StaticSchema = ( + 14, + n0, + _PCSE, + 0, + (_IP_, _READY, _FAILED), + ((-1, {_sV: _IP_}), (-1, {_sV: _READY}), (-1, {_sV: _FAILED})), +) + +PROVISIONED_CONCURRENCY_CONFIG_LIST_ITEM: StaticSchema = ( + 18, + n0, + _PCCLI, + 0, + (_FA, _RPCE, _APCE, _APCEl, _Stat, _SRt, _LM), + ( + (FUNCTION_ARN, 0), + (POSITIVE_INTEGER, 0), + (NON_NEGATIVE_INTEGER, 0), + (NON_NEGATIVE_INTEGER, 0), + (PROVISIONED_CONCURRENCY_STATUS_ENUM, 0), + (STRING, 0), + (TIMESTAMP, 0), + ), ) -S3_OBJECT_VERSION = Schema( - id=ShapeID("com.amazonaws.lambda#S3ObjectVersion"), shape_type=ShapeType.STRING +PROVISIONED_CONCURRENCY_CONFIG_LIST: StaticSchema = ( + 16, + n0, + _PCCL, + 0, + (_me,), + ((PROVISIONED_CONCURRENCY_CONFIG_LIST_ITEM, 0),), +) + +LIST_PROVISIONED_CONCURRENCY_CONFIGS_OUTPUT: StaticSchema = ( + 18, + n0, + _LPCCO, + {_sSI: _cLPCCRo, _smit: None}, + (_PCC, _NM), + ((PROVISIONED_CONCURRENCY_CONFIG_LIST, 0), (STRING, 0)), +) + +LIST_PROVISIONED_CONCURRENCY_CONFIGS: StaticOperationSchema = ( + 23, + n0, + _LPCC, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/2019-09-30/functions/{FunctionName}/provisioned-concurrency?List=ALL", + "code": 200, + } + ) + }, + LIST_PROVISIONED_CONCURRENCY_CONFIGS_INPUT, + LIST_PROVISIONED_CONCURRENCY_CONFIGS_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -BLOB = Schema( - id=ShapeID("com.amazonaws.lambda#Blob"), - shape_type=ShapeType.BLOB, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +PUT_FUNCTION_CODE_SIGNING_CONFIG_INPUT: StaticSchema = ( + 18, + n0, + _PFCSCI, + {_sSI: _cPFCSCR, _sm: None}, + (_CSCA, _FN), + ((CODE_SIGNING_CONFIG_ARN, 1), (NAMESPACED_FUNCTION_NAME, 9)), +) + +PUT_FUNCTION_CODE_SIGNING_CONFIG_OUTPUT: StaticSchema = ( + 18, + n0, + _PFCSCO, + {_sSI: _cPFCSCRo, _smit: None}, + (_CSCA, _FN), + ((CODE_SIGNING_CONFIG_ARN, 1), (FUNCTION_NAME, 1)), +) + +PUT_FUNCTION_CODE_SIGNING_CONFIG: StaticOperationSchema = ( + 23, + n0, + _PFCSC, + { + _smithy: MappingProxyType( + { + "method": "PUT", + "uri": "/2020-06-30/functions/{FunctionName}/code-signing-config", + "code": 200, + } + ) + }, + PUT_FUNCTION_CODE_SIGNING_CONFIG_INPUT, + PUT_FUNCTION_CODE_SIGNING_CONFIG_OUTPUT, + ( + CODE_SIGNING_CONFIG_NOT_FOUND_EXCEPTION, + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -FUNCTION_CODE = Schema.collection( - id=ShapeID("com.amazonaws.lambda#FunctionCode"), - members={ - "ZipFile": {"target": BLOB}, - "S3Bucket": {"target": S3_BUCKET}, - "S3Key": {"target": S3_KEY}, - "S3ObjectVersion": {"target": S3_OBJECT_VERSION}, - "S3ObjectStorageMode": {"target": S3_OBJECT_STORAGE_MODE}, - "ImageUri": {"target": STRING}, - "SourceKMSKeyArn": {"target": KMS_KEY_ARN}, - }, +PUT_FUNCTION_CONCURRENCY_INPUT: StaticSchema = ( + 18, + n0, + _PFCI, + {_sSI: _cPFCR, _sm: None}, + (_FN, _RCEe), + ((FUNCTION_NAME, 9), (RESERVED_CONCURRENT_EXECUTIONS, 1)), +) + +PUT_FUNCTION_CONCURRENCY_OUTPUT: StaticSchema = ( + 18, + n0, + _PFCO, + {_sSI: _cC, _smit: None}, + (_RCEe,), + ((RESERVED_CONCURRENT_EXECUTIONS, 0),), +) + +PUT_FUNCTION_CONCURRENCY: StaticOperationSchema = ( + 23, + n0, + _PFC, + { + _smithy: MappingProxyType( + { + "method": "PUT", + "uri": "/2017-10-31/functions/{FunctionName}/concurrency", + "code": 200, + } + ) + }, + PUT_FUNCTION_CONCURRENCY_INPUT, + PUT_FUNCTION_CONCURRENCY_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -RESOURCE_ARN = Schema( - id=ShapeID("com.amazonaws.lambda#ResourceArn"), shape_type=ShapeType.STRING +PUT_FUNCTION_RECURSION_CONFIG_INPUT: StaticSchema = ( + 18, + n0, + _PFRCI, + {_sSI: _cPFRCR, _sm: None}, + (_FN, _RL), + ((UNQUALIFIED_FUNCTION_NAME, 9), (RECURSIVE_LOOP, 1)), +) + +PUT_FUNCTION_RECURSION_CONFIG_OUTPUT: StaticSchema = ( + 18, + n0, + _PFRCO, + {_sSI: _cPFRCRo, _smit: None}, + (_RL,), + ((RECURSIVE_LOOP, 0),), +) + +PUT_FUNCTION_RECURSION_CONFIG: StaticOperationSchema = ( + 23, + n0, + _PFRC, + { + _smithy: MappingProxyType( + { + "method": "PUT", + "uri": "/2024-08-31/functions/{FunctionName}/recursion-config", + "code": 200, + } + ) + }, + PUT_FUNCTION_RECURSION_CONFIG_INPUT, + PUT_FUNCTION_RECURSION_CONFIG_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -DEAD_LETTER_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.lambda#DeadLetterConfig"), - members={"TargetArn": {"target": RESOURCE_ARN}}, +PUT_FUNCTION_SCALING_CONFIG_INPUT: StaticSchema = ( + 18, + n0, + _PFSCI, + {_sSI: _cPFSCR, _sm: None}, + (_FN, _Q, _FSCu), + ( + (UNQUALIFIED_FUNCTION_NAME, 9), + (PUBLISHED_FUNCTION_QUALIFIER, {_sQ: _Q, _smi: None}), + (FUNCTION_SCALING_CONFIG, 0), + ), ) -ENVIRONMENT_VARIABLE_NAME = Schema( - id=ShapeID("com.amazonaws.lambda#EnvironmentVariableName"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +PUT_FUNCTION_SCALING_CONFIG_OUTPUT: StaticSchema = ( + 18, + n0, + _PFSCO, + {_sSI: _cPFSCRo, _smit: None}, + (_FS,), + ((STATE, 0),), +) + +PUT_FUNCTION_SCALING_CONFIG: StaticOperationSchema = ( + 23, + n0, + _PFSC, + { + _smithy: MappingProxyType( + { + "method": "PUT", + "uri": "/2025-11-30/functions/{FunctionName}/function-scaling-config", + "code": 202, + } + ) + }, + PUT_FUNCTION_SCALING_CONFIG_INPUT, + PUT_FUNCTION_SCALING_CONFIG_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -ENVIRONMENT_VARIABLE_VALUE = Schema( - id=ShapeID("com.amazonaws.lambda#EnvironmentVariableValue"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +PUT_RUNTIME_MANAGEMENT_CONFIG_INPUT: StaticSchema = ( + 18, + n0, + _PRMCI, + {_sSI: _cPRMCR, _sm: None}, + (_FN, _Q, _URO, _RVA), + ( + (NAMESPACED_FUNCTION_NAME, 9), + (NUMERIC_LATEST_PUBLISHED_OR_ALIAS_QUALIFIER, {_sQ: _Q}), + (UPDATE_RUNTIME_ON, 1), + (RUNTIME_VERSION_ARN, 0), + ), ) -ENVIRONMENT_VARIABLES = Schema.collection( - id=ShapeID("com.amazonaws.lambda#EnvironmentVariables"), - shape_type=ShapeType.MAP, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "key": {"target": ENVIRONMENT_VARIABLE_NAME}, - "value": {"target": ENVIRONMENT_VARIABLE_VALUE}, - }, +PUT_RUNTIME_MANAGEMENT_CONFIG_OUTPUT: StaticSchema = ( + 18, + n0, + _PRMCO, + {_sSI: _cPRMCRo, _smit: None}, + (_URO, _FA, _RVA), + ((UPDATE_RUNTIME_ON, 1), (FUNCTION_ARN, 1), (RUNTIME_VERSION_ARN, 0)), +) + +PUT_RUNTIME_MANAGEMENT_CONFIG: StaticOperationSchema = ( + 23, + n0, + _PRMC, + { + _smithy: MappingProxyType( + { + "method": "PUT", + "uri": "/2021-07-20/functions/{FunctionName}/runtime-management-config", + "code": 200, + } + ) + }, + PUT_RUNTIME_MANAGEMENT_CONFIG_INPUT, + PUT_RUNTIME_MANAGEMENT_CONFIG_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -ENVIRONMENT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#Environment"), - members={"Variables": {"target": ENVIRONMENT_VARIABLES}}, +UPDATE_FUNCTION_CODE_INPUT: StaticSchema = ( + 18, + n0, + _UFCI, + {_sSI: _cUFCR, _sm: None}, + (_FN, _ZF, _SB, _SK, _SOV, _SOSM, _IU, _Arch, _Pu, _PTu, _DR, _RI, _SKMSKA), + ( + (FUNCTION_NAME, 9), + (BLOB, 0), + (S3_BUCKET, 0), + (S3_KEY, 0), + (S3_OBJECT_VERSION, 0), + (S3_OBJECT_STORAGE_MODE, 0), + (STRING, 0), + (ARCHITECTURES_LIST, 0), + (BOOLEAN, {_s: False}), + (FUNCTION_VERSION_LATEST_PUBLISHED, 0), + (BOOLEAN, {_s: False}), + (STRING, 0), + (KMS_KEY_ARN, 0), + ), ) -EPHEMERAL_STORAGE_SIZE = Schema( - id=ShapeID("com.amazonaws.lambda#EphemeralStorageSize"), - shape_type=ShapeType.INTEGER, +UPDATE_FUNCTION_CODE_OUTPUT: StaticSchema = ( + 18, + n0, + _UFCO, + {_sSI: _cFC, _smit: None}, + ( + _FN, + _FA, + _Ru, + _Ro, + _H, + _CSod, + _D, + _Tim, + _MS, + _LM, + _CSode, + _V, + _VC, + _DLC, + _Env, + _KMSKA, + _TCr, + _MA, + _RI, + _La, + _Sta, + _SR, + _SRCt, + _LUS, + _LUSR, + _LUSRC, + _FSCi, + _SPVAi, + _SJA, + _PTa, + _ICR, + _Arch, + _ESp, + _SSn, + _RVC, + _LC, + _TCe, + _CPC, + _CSon, + _DC, + ), + ( + (NAMESPACED_FUNCTION_NAME, 0), + (NAME_SPACED_FUNCTION_ARN, 0), + (RUNTIME, 0), + (ROLE_ARN, 0), + (HANDLER, 0), + (LONG, {_s: 0}), + (DESCRIPTION, 0), + (TIMEOUT, 0), + (MEMORY_SIZE, 0), + (TIMESTAMP, 0), + (STRING, 0), + (VERSION, 0), + (VPC_CONFIG_RESPONSE, 0), + (DEAD_LETTER_CONFIG, 0), + (ENVIRONMENT_RESPONSE, 0), + (KMS_KEY_ARN, 0), + (TRACING_CONFIG_RESPONSE, 0), + (FUNCTION_ARN, 0), + (STRING, 0), + (LAYERS_REFERENCE_LIST, 0), + (STATE, 0), + (STATE_REASON, 0), + (STATE_REASON_CODE, 0), + (LAST_UPDATE_STATUS, 0), + (LAST_UPDATE_STATUS_REASON, 0), + (LAST_UPDATE_STATUS_REASON_CODE, 0), + (FILE_SYSTEM_CONFIG_LIST, 0), + (ARN, 0), + (ARN, 0), + (PACKAGE_TYPE, 0), + (IMAGE_CONFIG_RESPONSE, 0), + (ARCHITECTURES_LIST, 0), + (EPHEMERAL_STORAGE, 0), + (SNAP_START_RESPONSE, 0), + (RUNTIME_VERSION_CONFIG, 0), + (LOGGING_CONFIG, 0), + (TENANCY_CONFIG, 0), + (CAPACITY_PROVIDER_CONFIG, 0), + (STRING, 0), + (DURABLE_CONFIG, 0), + ), ) -EPHEMERAL_STORAGE = Schema.collection( - id=ShapeID("com.amazonaws.lambda#EphemeralStorage"), - members={ - "Size": { - "target": EPHEMERAL_STORAGE_SIZE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +UPDATE_FUNCTION_CODE: StaticOperationSchema = ( + 23, + n0, + _UFC, + { + _smithy: MappingProxyType( + { + "method": "PUT", + "uri": "/2015-03-31/functions/{FunctionName}/code", + "code": 200, + } + ) + }, + UPDATE_FUNCTION_CODE_INPUT, + UPDATE_FUNCTION_CODE_OUTPUT, + ( + CODE_SIGNING_CONFIG_NOT_FOUND_EXCEPTION, + CODE_STORAGE_EXCEEDED_EXCEPTION, + CODE_VERIFICATION_FAILED_EXCEPTION, + INVALID_CODE_SIGNATURE_EXCEPTION, + INVALID_PARAMETER_VALUE_EXCEPTION, + PRECONDITION_FAILED_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -FILE_SYSTEM_ARN = Schema( - id=ShapeID("com.amazonaws.lambda#FileSystemArn"), shape_type=ShapeType.STRING +UPDATE_FUNCTION_CONFIGURATION_INPUT: StaticSchema = ( + 18, + n0, + _UFCIp, + {_sSI: _cUFCRo, _sm: None}, + ( + _FN, + _Ro, + _H, + _D, + _Tim, + _MS, + _VC, + _Env, + _Ru, + _DLC, + _KMSKA, + _TCr, + _RI, + _La, + _FSCi, + _ICm, + _ESp, + _SSn, + _LC, + _CPC, + _DC, + ), + ( + (FUNCTION_NAME, 9), + (ROLE_ARN, 0), + (HANDLER, 0), + (DESCRIPTION, 0), + (TIMEOUT, 0), + (MEMORY_SIZE, 0), + (VPC_CONFIG, 0), + (ENVIRONMENT, 0), + (RUNTIME, 0), + (DEAD_LETTER_CONFIG, 0), + (KMS_KEY_ARN, 0), + (TRACING_CONFIG, 0), + (STRING, 0), + (LAYER_LIST, 0), + (FILE_SYSTEM_CONFIG_LIST, 0), + (IMAGE_CONFIG, 0), + (EPHEMERAL_STORAGE, 0), + (SNAP_START, 0), + (LOGGING_CONFIG, 0), + (CAPACITY_PROVIDER_CONFIG, 0), + (DURABLE_CONFIG, 0), + ), ) -LOCAL_MOUNT_PATH = Schema( - id=ShapeID("com.amazonaws.lambda#LocalMountPath"), shape_type=ShapeType.STRING +UPDATE_FUNCTION_CONFIGURATION_OUTPUT: StaticSchema = ( + 18, + n0, + _UFCOp, + {_sSI: _cFC, _smit: None}, + ( + _FN, + _FA, + _Ru, + _Ro, + _H, + _CSod, + _D, + _Tim, + _MS, + _LM, + _CSode, + _V, + _VC, + _DLC, + _Env, + _KMSKA, + _TCr, + _MA, + _RI, + _La, + _Sta, + _SR, + _SRCt, + _LUS, + _LUSR, + _LUSRC, + _FSCi, + _SPVAi, + _SJA, + _PTa, + _ICR, + _Arch, + _ESp, + _SSn, + _RVC, + _LC, + _TCe, + _CPC, + _CSon, + _DC, + ), + ( + (NAMESPACED_FUNCTION_NAME, 0), + (NAME_SPACED_FUNCTION_ARN, 0), + (RUNTIME, 0), + (ROLE_ARN, 0), + (HANDLER, 0), + (LONG, {_s: 0}), + (DESCRIPTION, 0), + (TIMEOUT, 0), + (MEMORY_SIZE, 0), + (TIMESTAMP, 0), + (STRING, 0), + (VERSION, 0), + (VPC_CONFIG_RESPONSE, 0), + (DEAD_LETTER_CONFIG, 0), + (ENVIRONMENT_RESPONSE, 0), + (KMS_KEY_ARN, 0), + (TRACING_CONFIG_RESPONSE, 0), + (FUNCTION_ARN, 0), + (STRING, 0), + (LAYERS_REFERENCE_LIST, 0), + (STATE, 0), + (STATE_REASON, 0), + (STATE_REASON_CODE, 0), + (LAST_UPDATE_STATUS, 0), + (LAST_UPDATE_STATUS_REASON, 0), + (LAST_UPDATE_STATUS_REASON_CODE, 0), + (FILE_SYSTEM_CONFIG_LIST, 0), + (ARN, 0), + (ARN, 0), + (PACKAGE_TYPE, 0), + (IMAGE_CONFIG_RESPONSE, 0), + (ARCHITECTURES_LIST, 0), + (EPHEMERAL_STORAGE, 0), + (SNAP_START_RESPONSE, 0), + (RUNTIME_VERSION_CONFIG, 0), + (LOGGING_CONFIG, 0), + (TENANCY_CONFIG, 0), + (CAPACITY_PROVIDER_CONFIG, 0), + (STRING, 0), + (DURABLE_CONFIG, 0), + ), ) -DIRECT_S3_READ = Schema.collection( - id=ShapeID("com.amazonaws.lambda#DirectS3Read"), - shape_type=ShapeType.ENUM, - members={ - "ENABLED": {"target": UNIT}, - "DISABLED": {"target": UNIT}, - "AUTO": {"target": UNIT}, - }, +UPDATE_FUNCTION_CONFIGURATION: StaticOperationSchema = ( + 23, + n0, + _UFCp, + { + _smithy: MappingProxyType( + { + "method": "PUT", + "uri": "/2015-03-31/functions/{FunctionName}/configuration", + "code": 200, + } + ) + }, + UPDATE_FUNCTION_CONFIGURATION_INPUT, + UPDATE_FUNCTION_CONFIGURATION_OUTPUT, + ( + CODE_SIGNING_CONFIG_NOT_FOUND_EXCEPTION, + CODE_VERIFICATION_FAILED_EXCEPTION, + INVALID_CODE_SIGNATURE_EXCEPTION, + INVALID_PARAMETER_VALUE_EXCEPTION, + PRECONDITION_FAILED_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -S3_FILES_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.lambda#S3FilesConfig"), - members={"DirectS3Read": {"target": DIRECT_S3_READ}}, +UPDATE_FUNCTION_URL_CONFIG_INPUT: StaticSchema = ( + 18, + n0, + _UFUCI, + {_sSI: _cUFUCR, _sm: None}, + (_FN, _Q, _ATu, _Cor, _IM), + ( + (FUNCTION_URL_FUNCTION_NAME, 9), + (FUNCTION_URL_QUALIFIER, {_sQ: _Q}), + (FUNCTION_URL_AUTH_TYPE, 0), + (CORS, 0), + (INVOKE_MODE, 0), + ), ) -FILE_SYSTEM_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.lambda#FileSystemConfig"), - members={ - "Arn": { - "target": FILE_SYSTEM_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "LocalMountPath": { - "target": LOCAL_MOUNT_PATH, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "S3FilesConfig": {"target": S3_FILES_CONFIG}, - }, +UPDATE_FUNCTION_URL_CONFIG_OUTPUT: StaticSchema = ( + 18, + n0, + _UFUCO, + {_sSI: _cUFUCRo, _smit: None}, + (_FU, _FA, _ATu, _Cor, _CTr, _LMT, _IM), + ( + (FUNCTION_URL, 1), + (FUNCTION_ARN, 1), + (FUNCTION_URL_AUTH_TYPE, 1), + (CORS, 0), + (TIMESTAMP, 1), + (TIMESTAMP, 1), + (INVOKE_MODE, 0), + ), ) -FILE_SYSTEM_CONFIG_LIST = Schema.collection( - id=ShapeID("com.amazonaws.lambda#FileSystemConfigList"), - shape_type=ShapeType.LIST, - members={"member": {"target": FILE_SYSTEM_CONFIG}}, +UPDATE_FUNCTION_URL_CONFIG: StaticOperationSchema = ( + 23, + n0, + _UFUC, + { + _smithy: MappingProxyType( + { + "method": "PUT", + "uri": "/2021-10-31/functions/{FunctionName}/url", + "code": 200, + } + ) + }, + UPDATE_FUNCTION_URL_CONFIG_INPUT, + UPDATE_FUNCTION_URL_CONFIG_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -FUNCTION_NAME = Schema( - id=ShapeID("com.amazonaws.lambda#FunctionName"), shape_type=ShapeType.STRING +CREATE_ALIAS_INPUT: StaticSchema = ( + 18, + n0, + _CAI, + {_sSI: _cCAR, _sm: None}, + (_FN, _N, _FV, _D, _RC), + ( + (FUNCTION_NAME, 9), + (ALIAS, 1), + (VERSION_WITH_LATEST_PUBLISHED, 1), + (DESCRIPTION, 0), + (ALIAS_ROUTING_CONFIGURATION, 0), + ), ) -HANDLER = Schema( - id=ShapeID("com.amazonaws.lambda#Handler"), shape_type=ShapeType.STRING +CREATE_ALIAS_OUTPUT: StaticSchema = ( + 18, + n0, + _CAO, + {_sSI: _cAC, _smit: None}, + (_AA, _N, _FV, _D, _RC, _RI), + ( + (FUNCTION_ARN, 0), + (ALIAS, 0), + (VERSION, 0), + (DESCRIPTION, 0), + (ALIAS_ROUTING_CONFIGURATION, 0), + (STRING, 0), + ), ) -STRING_LIST = Schema.collection( - id=ShapeID("com.amazonaws.lambda#StringList"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, +CREATE_ALIAS: StaticOperationSchema = ( + 23, + n0, + _CAr, + { + _smithy: MappingProxyType( + { + "method": "POST", + "uri": "/2015-03-31/functions/{FunctionName}/aliases", + "code": 201, + } + ) + }, + CREATE_ALIAS_INPUT, + CREATE_ALIAS_OUTPUT, + ( + ALIAS_LIMIT_EXCEEDED_EXCEPTION, + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -WORKING_DIRECTORY = Schema( - id=ShapeID("com.amazonaws.lambda#WorkingDirectory"), shape_type=ShapeType.STRING +DELETE_ALIAS_INPUT: StaticSchema = ( + 18, + n0, + _DAI, + {_sSI: _cDAR, _sm: None}, + (_FN, _N), + ((FUNCTION_NAME, 9), (ALIAS, 9)), +) + +DELETE_ALIAS_OUTPUT: StaticSchema = (18, n0, _DAO, {_sSI: _sU, _smit: None}) + +DELETE_ALIAS: StaticOperationSchema = ( + 23, + n0, + _DAe, + { + _smithy: MappingProxyType( + { + "method": "DELETE", + "uri": "/2015-03-31/functions/{FunctionName}/aliases/{Name}", + "code": 204, + } + ) + }, + DELETE_ALIAS_INPUT, + DELETE_ALIAS_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -IMAGE_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ImageConfig"), - members={ - "EntryPoint": {"target": STRING_LIST}, - "Command": {"target": STRING_LIST}, - "WorkingDirectory": {"target": WORKING_DIRECTORY}, - }, +GET_ALIAS_INPUT: StaticSchema = ( + 18, + n0, + _GAI, + {_sSI: _cGAR, _sm: None}, + (_FN, _N), + ((FUNCTION_NAME, 9), (ALIAS, 9)), +) + +GET_ALIAS_OUTPUT: StaticSchema = ( + 18, + n0, + _GAO, + {_sSI: _cAC, _smit: None}, + (_AA, _N, _FV, _D, _RC, _RI), + ( + (FUNCTION_ARN, 0), + (ALIAS, 0), + (VERSION, 0), + (DESCRIPTION, 0), + (ALIAS_ROUTING_CONFIGURATION, 0), + (STRING, 0), + ), ) -LAYER_VERSION_ARN = Schema( - id=ShapeID("com.amazonaws.lambda#LayerVersionArn"), shape_type=ShapeType.STRING +GET_ALIAS: StaticOperationSchema = ( + 23, + n0, + _GA, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/2015-03-31/functions/{FunctionName}/aliases/{Name}", + "code": 200, + } + ) + }, + GET_ALIAS_INPUT, + GET_ALIAS_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -LAYER_LIST = Schema.collection( - id=ShapeID("com.amazonaws.lambda#LayerList"), - shape_type=ShapeType.LIST, - members={"member": {"target": LAYER_VERSION_ARN}}, +LIST_ALIASES_INPUT: StaticSchema = ( + 18, + n0, + _LAI, + {_sSI: _cLAR, _sm: None}, + (_FN, _FV, _Mar, _MI), + ( + (FUNCTION_NAME, 9), + (VERSION_WITH_LATEST_PUBLISHED, {_sQ: _FV}), + (STRING, {_sQ: _Mar}), + (MAX_LIST_ITEMS, {_sQ: _MI}), + ), ) -LOG_FORMAT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#LogFormat"), - shape_type=ShapeType.ENUM, - members={"Json": {"target": UNIT}, "Text": {"target": UNIT}}, +LIST_ALIASES_OUTPUT: StaticSchema = ( + 18, + n0, + _LAO, + {_sSI: _cLARo, _smit: None}, + (_NM, _Ali), + ((STRING, 0), (ALIAS_LIST, 0)), +) + +LIST_ALIASES: StaticOperationSchema = ( + 23, + n0, + _LA, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/2015-03-31/functions/{FunctionName}/aliases", + "code": 200, + } + ) + }, + LIST_ALIASES_INPUT, + LIST_ALIASES_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -LOGGING_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.lambda#LoggingConfig"), - members={ - "LogFormat": {"target": LOG_FORMAT}, - "ApplicationLogLevel": {"target": APPLICATION_LOG_LEVEL}, - "SystemLogLevel": {"target": SYSTEM_LOG_LEVEL}, - "LogGroup": {"target": LOG_GROUP}, - }, +UPDATE_ALIAS_INPUT: StaticSchema = ( + 18, + n0, + _UAI, + {_sSI: _cUAR, _sm: None}, + (_FN, _N, _FV, _D, _RC, _RI), + ( + (FUNCTION_NAME, 9), + (ALIAS, 9), + (VERSION_WITH_LATEST_PUBLISHED, 0), + (DESCRIPTION, 0), + (ALIAS_ROUTING_CONFIGURATION, 0), + (STRING, 0), + ), ) -MEMORY_SIZE = Schema( - id=ShapeID("com.amazonaws.lambda#MemorySize"), shape_type=ShapeType.INTEGER -) - -PACKAGE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.lambda#PackageType"), - shape_type=ShapeType.ENUM, - members={"Zip": {"target": UNIT}, "Image": {"target": UNIT}}, -) - -BOOLEAN = Schema( - id=ShapeID("com.amazonaws.lambda#Boolean"), - shape_type=ShapeType.BOOLEAN, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=False)], -) - -FUNCTION_VERSION_LATEST_PUBLISHED = Schema.collection( - id=ShapeID("com.amazonaws.lambda#FunctionVersionLatestPublished"), - shape_type=ShapeType.ENUM, - members={"LATEST_PUBLISHED": {"target": UNIT}}, -) - -RUNTIME = Schema.collection( - id=ShapeID("com.amazonaws.lambda#Runtime"), - shape_type=ShapeType.ENUM, - members={ - "nodejs": {"target": UNIT}, - "nodejs43": {"target": UNIT}, - "nodejs610": {"target": UNIT}, - "nodejs810": {"target": UNIT}, - "nodejs10x": {"target": UNIT}, - "nodejs12x": {"target": UNIT}, - "nodejs14x": {"target": UNIT}, - "nodejs16x": {"target": UNIT}, - "nodejs18x": {"target": UNIT}, - "nodejs20x": {"target": UNIT}, - "nodejs22x": {"target": UNIT}, - "nodejs24x": {"target": UNIT}, - "java8": {"target": UNIT}, - "java8al2": {"target": UNIT}, - "java11": {"target": UNIT}, - "java17": {"target": UNIT}, - "java21": {"target": UNIT}, - "java25": {"target": UNIT}, - "python27": {"target": UNIT}, - "python36": {"target": UNIT}, - "python37": {"target": UNIT}, - "python38": {"target": UNIT}, - "python39": {"target": UNIT}, - "python310": {"target": UNIT}, - "python311": {"target": UNIT}, - "python312": {"target": UNIT}, - "python313": {"target": UNIT}, - "python314": {"target": UNIT}, - "dotnetcore10": {"target": UNIT}, - "dotnetcore20": {"target": UNIT}, - "dotnetcore21": {"target": UNIT}, - "dotnetcore31": {"target": UNIT}, - "dotnet6": {"target": UNIT}, - "dotnet8": {"target": UNIT}, - "dotnet10": {"target": UNIT}, - "nodejs43edge": {"target": UNIT}, - "go1x": {"target": UNIT}, - "ruby25": {"target": UNIT}, - "ruby27": {"target": UNIT}, - "ruby32": {"target": UNIT}, - "ruby33": {"target": UNIT}, - "ruby34": {"target": UNIT}, - "ruby40": {"target": UNIT}, - "provided": {"target": UNIT}, - "providedal2": {"target": UNIT}, - "providedal2023": {"target": UNIT}, - "nodejs26x": {"target": UNIT}, - "python315": {"target": UNIT}, - "java8al2023": {"target": UNIT}, - "java11al2023": {"target": UNIT}, - "java17al2023": {"target": UNIT}, - }, +UPDATE_ALIAS_OUTPUT: StaticSchema = ( + 18, + n0, + _UAO, + {_sSI: _cAC, _smit: None}, + (_AA, _N, _FV, _D, _RC, _RI), + ( + (FUNCTION_ARN, 0), + (ALIAS, 0), + (VERSION, 0), + (DESCRIPTION, 0), + (ALIAS_ROUTING_CONFIGURATION, 0), + (STRING, 0), + ), ) -SNAP_START_APPLY_ON = Schema.collection( - id=ShapeID("com.amazonaws.lambda#SnapStartApplyOn"), - shape_type=ShapeType.ENUM, - members={"PublishedVersions": {"target": UNIT}, "None": {"target": UNIT}}, +UPDATE_ALIAS: StaticOperationSchema = ( + 23, + n0, + _UA, + { + _smithy: MappingProxyType( + { + "method": "PUT", + "uri": "/2015-03-31/functions/{FunctionName}/aliases/{Name}", + "code": 200, + } + ) + }, + UPDATE_ALIAS_INPUT, + UPDATE_ALIAS_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + PRECONDITION_FAILED_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -SNAP_START = Schema.collection( - id=ShapeID("com.amazonaws.lambda#SnapStart"), - members={"ApplyOn": {"target": SNAP_START_APPLY_ON}}, +LIST_VERSIONS_BY_FUNCTION_INPUT: StaticSchema = ( + 18, + n0, + _LVBFI, + {_sSI: _cLVBFR, _sm: None}, + (_FN, _Mar, _MI), + ( + (NAMESPACED_FUNCTION_NAME, 9), + (STRING, {_sQ: _Mar}), + (MAX_LIST_ITEMS, {_sQ: _MI}), + ), ) -TENANT_ISOLATION_MODE = Schema.collection( - id=ShapeID("com.amazonaws.lambda#TenantIsolationMode"), - shape_type=ShapeType.ENUM, - members={"PER_TENANT": {"target": UNIT}}, +LIST_VERSIONS_BY_FUNCTION_OUTPUT: StaticSchema = ( + 18, + n0, + _LVBFO, + {_sSI: _cLVBFRo, _smit: None}, + (_NM, _Ve), + ((STRING, 0), (FUNCTION_LIST, 0)), +) + +LIST_VERSIONS_BY_FUNCTION: StaticOperationSchema = ( + 23, + n0, + _LVBF, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/2015-03-31/functions/{FunctionName}/versions", + "code": 200, + } + ) + }, + LIST_VERSIONS_BY_FUNCTION_INPUT, + LIST_VERSIONS_BY_FUNCTION_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -TENANCY_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.lambda#TenancyConfig"), - members={ - "TenantIsolationMode": { - "target": TENANT_ISOLATION_MODE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +PUBLISH_VERSION_INPUT: StaticSchema = ( + 18, + n0, + _PVI, + {_sSI: _cPVR, _sm: None}, + (_FN, _CSode, _D, _RI, _PTu), + ( + (FUNCTION_NAME, 9), + (STRING, 0), + (DESCRIPTION, 0), + (STRING, 0), + (FUNCTION_VERSION_LATEST_PUBLISHED, 0), + ), ) -TIMEOUT = Schema( - id=ShapeID("com.amazonaws.lambda#Timeout"), shape_type=ShapeType.INTEGER +PUBLISH_VERSION_OUTPUT: StaticSchema = ( + 18, + n0, + _PVO, + {_sSI: _cFC, _smit: None}, + ( + _FN, + _FA, + _Ru, + _Ro, + _H, + _CSod, + _D, + _Tim, + _MS, + _LM, + _CSode, + _V, + _VC, + _DLC, + _Env, + _KMSKA, + _TCr, + _MA, + _RI, + _La, + _Sta, + _SR, + _SRCt, + _LUS, + _LUSR, + _LUSRC, + _FSCi, + _SPVAi, + _SJA, + _PTa, + _ICR, + _Arch, + _ESp, + _SSn, + _RVC, + _LC, + _TCe, + _CPC, + _CSon, + _DC, + ), + ( + (NAMESPACED_FUNCTION_NAME, 0), + (NAME_SPACED_FUNCTION_ARN, 0), + (RUNTIME, 0), + (ROLE_ARN, 0), + (HANDLER, 0), + (LONG, {_s: 0}), + (DESCRIPTION, 0), + (TIMEOUT, 0), + (MEMORY_SIZE, 0), + (TIMESTAMP, 0), + (STRING, 0), + (VERSION, 0), + (VPC_CONFIG_RESPONSE, 0), + (DEAD_LETTER_CONFIG, 0), + (ENVIRONMENT_RESPONSE, 0), + (KMS_KEY_ARN, 0), + (TRACING_CONFIG_RESPONSE, 0), + (FUNCTION_ARN, 0), + (STRING, 0), + (LAYERS_REFERENCE_LIST, 0), + (STATE, 0), + (STATE_REASON, 0), + (STATE_REASON_CODE, 0), + (LAST_UPDATE_STATUS, 0), + (LAST_UPDATE_STATUS_REASON, 0), + (LAST_UPDATE_STATUS_REASON_CODE, 0), + (FILE_SYSTEM_CONFIG_LIST, 0), + (ARN, 0), + (ARN, 0), + (PACKAGE_TYPE, 0), + (IMAGE_CONFIG_RESPONSE, 0), + (ARCHITECTURES_LIST, 0), + (EPHEMERAL_STORAGE, 0), + (SNAP_START_RESPONSE, 0), + (RUNTIME_VERSION_CONFIG, 0), + (LOGGING_CONFIG, 0), + (TENANCY_CONFIG, 0), + (CAPACITY_PROVIDER_CONFIG, 0), + (STRING, 0), + (DURABLE_CONFIG, 0), + ), ) -TRACING_MODE = Schema.collection( - id=ShapeID("com.amazonaws.lambda#TracingMode"), - shape_type=ShapeType.ENUM, - members={"Active": {"target": UNIT}, "PassThrough": {"target": UNIT}}, +PUBLISH_VERSION: StaticOperationSchema = ( + 23, + n0, + _PVu, + { + _smithy: MappingProxyType( + { + "method": "POST", + "uri": "/2015-03-31/functions/{FunctionName}/versions", + "code": 201, + } + ) + }, + PUBLISH_VERSION_INPUT, + PUBLISH_VERSION_OUTPUT, + ( + CODE_STORAGE_EXCEEDED_EXCEPTION, + FUNCTION_VERSIONS_PER_CAPACITY_PROVIDER_LIMIT_EXCEEDED_EXCEPTION, + INVALID_PARAMETER_VALUE_EXCEPTION, + PRECONDITION_FAILED_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -TRACING_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.lambda#TracingConfig"), - members={"Mode": {"target": TRACING_MODE}}, -) +GET_ACCOUNT_SETTINGS_INPUT: StaticSchema = (18, n0, _GASI, {_sSI: _cGASR, _sm: None}) -NULLABLE_BOOLEAN = Schema( - id=ShapeID("com.amazonaws.lambda#NullableBoolean"), shape_type=ShapeType.BOOLEAN +GET_ACCOUNT_SETTINGS_OUTPUT: StaticSchema = ( + 18, + n0, + _GASO, + {_sSI: _cGASRo, _smit: None}, + (_AL, _AU), + ((ACCOUNT_LIMIT, 0), (ACCOUNT_USAGE, 0)), ) -SECURITY_GROUP_IDS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#SecurityGroupIds"), - shape_type=ShapeType.LIST, - members={"member": {"target": SECURITY_GROUP_ID}}, -) - -SUBNET_IDS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#SubnetIds"), - shape_type=ShapeType.LIST, - members={"member": {"target": SUBNET_ID}}, -) - -VPC_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.lambda#VpcConfig"), - members={ - "SubnetIds": {"target": SUBNET_IDS}, - "SecurityGroupIds": {"target": SECURITY_GROUP_IDS}, - "Ipv6AllowedForDualStack": {"target": NULLABLE_BOOLEAN}, - }, -) - -CREATE_FUNCTION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#CreateFunctionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#CreateFunctionRequest", - ) - ], - members={ - "FunctionName": { - "target": FUNCTION_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Runtime": {"target": RUNTIME}, - "Role": { - "target": ROLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Handler": {"target": HANDLER}, - "Code": { - "target": FUNCTION_CODE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Description": {"target": DESCRIPTION}, - "Timeout": {"target": TIMEOUT}, - "MemorySize": {"target": MEMORY_SIZE}, - "Publish": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "PublishTo": {"target": FUNCTION_VERSION_LATEST_PUBLISHED}, - "VpcConfig": {"target": VPC_CONFIG}, - "PackageType": {"target": PACKAGE_TYPE}, - "DeadLetterConfig": {"target": DEAD_LETTER_CONFIG}, - "Environment": {"target": ENVIRONMENT}, - "KMSKeyArn": {"target": KMS_KEY_ARN}, - "TracingConfig": {"target": TRACING_CONFIG}, - "Tags": {"target": TAGS}, - "Layers": {"target": LAYER_LIST}, - "FileSystemConfigs": {"target": FILE_SYSTEM_CONFIG_LIST}, - "CodeSigningConfigArn": {"target": CODE_SIGNING_CONFIG_ARN}, - "ImageConfig": {"target": IMAGE_CONFIG}, - "Architectures": {"target": ARCHITECTURES_LIST}, - "EphemeralStorage": {"target": EPHEMERAL_STORAGE}, - "SnapStart": {"target": SNAP_START}, - "LoggingConfig": {"target": LOGGING_CONFIG}, - "TenancyConfig": {"target": TENANCY_CONFIG}, - "CapacityProviderConfig": {"target": CAPACITY_PROVIDER_CONFIG}, - "DurableConfig": {"target": DURABLE_CONFIG}, - }, -) - -SENSITIVE_STRING = Schema( - id=ShapeID("com.amazonaws.lambda#SensitiveString"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -ENVIRONMENT_ERROR = Schema.collection( - id=ShapeID("com.amazonaws.lambda#EnvironmentError"), - members={"ErrorCode": {"target": STRING}, "Message": {"target": SENSITIVE_STRING}}, -) - -ENVIRONMENT_RESPONSE = Schema.collection( - id=ShapeID("com.amazonaws.lambda#EnvironmentResponse"), - members={ - "Variables": {"target": ENVIRONMENT_VARIABLES}, - "Error": {"target": ENVIRONMENT_ERROR}, - }, -) - -IMAGE_CONFIG_ERROR = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ImageConfigError"), - members={"ErrorCode": {"target": STRING}, "Message": {"target": SENSITIVE_STRING}}, -) - -IMAGE_CONFIG_RESPONSE = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ImageConfigResponse"), - members={ - "ImageConfig": {"target": IMAGE_CONFIG}, - "Error": {"target": IMAGE_CONFIG_ERROR}, - }, -) - -LAST_UPDATE_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#LastUpdateStatus"), - shape_type=ShapeType.ENUM, - members={ - "Successful": {"target": UNIT}, - "Failed": {"target": UNIT}, - "InProgress": {"target": UNIT}, - }, -) - -LAST_UPDATE_STATUS_REASON = Schema( - id=ShapeID("com.amazonaws.lambda#LastUpdateStatusReason"), - shape_type=ShapeType.STRING, -) - -LAST_UPDATE_STATUS_REASON_CODE = Schema.collection( - id=ShapeID("com.amazonaws.lambda#LastUpdateStatusReasonCode"), - shape_type=ShapeType.ENUM, - members={ - "EniLimitExceeded": {"target": UNIT}, - "InsufficientRolePermissions": {"target": UNIT}, - "InvalidConfiguration": {"target": UNIT}, - "InternalError": {"target": UNIT}, - "SubnetOutOfIPAddresses": {"target": UNIT}, - "InvalidSubnet": {"target": UNIT}, - "InvalidSecurityGroup": {"target": UNIT}, - "ImageDeleted": {"target": UNIT}, - "ImageAccessDenied": {"target": UNIT}, - "InvalidImage": {"target": UNIT}, - "KMSKeyAccessDenied": {"target": UNIT}, - "KMSKeyNotFound": {"target": UNIT}, - "InvalidStateKMSKey": {"target": UNIT}, - "DisabledKMSKey": {"target": UNIT}, - "EFSIOError": {"target": UNIT}, - "EFSMountConnectivityError": {"target": UNIT}, - "EFSMountFailure": {"target": UNIT}, - "EFSMountTimeout": {"target": UNIT}, - "InvalidRuntime": {"target": UNIT}, - "InvalidZipFileException": {"target": UNIT}, - "FunctionError": {"target": UNIT}, - "ServiceQuotaExceededException": {"target": UNIT}, - "VcpuLimitExceeded": {"target": UNIT}, - "CapacityProviderScalingLimitExceeded": {"target": UNIT}, - "InsufficientCapacity": {"target": UNIT}, - "EC2RequestLimitExceeded": {"target": UNIT}, - "FunctionErrorInitTimeout": {"target": UNIT}, - "FunctionErrorRuntimeInitError": {"target": UNIT}, - "FunctionErrorExtensionInitError": {"target": UNIT}, - "FunctionErrorInvalidEntryPoint": {"target": UNIT}, - "FunctionErrorInvalidWorkingDirectory": {"target": UNIT}, - "FunctionErrorPermissionDenied": {"target": UNIT}, - "FunctionErrorTooManyExtensions": {"target": UNIT}, - "FunctionErrorInitResourceExhausted": {"target": UNIT}, - "DisallowedByVpcEncryptionControl": {"target": UNIT}, - "DependencyError": {"target": UNIT}, - }, -) - -LAYER = Schema.collection( - id=ShapeID("com.amazonaws.lambda#Layer"), - members={ - "Arn": {"target": LAYER_VERSION_ARN}, - "CodeSize": { - "target": LONG, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "SigningProfileVersionArn": {"target": ARN}, - "SigningJobArn": {"target": ARN}, - }, -) - -LAYERS_REFERENCE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.lambda#LayersReferenceList"), - shape_type=ShapeType.LIST, - members={"member": {"target": LAYER}}, -) - -RUNTIME_VERSION_ERROR = Schema.collection( - id=ShapeID("com.amazonaws.lambda#RuntimeVersionError"), - members={"ErrorCode": {"target": STRING}, "Message": {"target": SENSITIVE_STRING}}, -) - -RUNTIME_VERSION_ARN = Schema( - id=ShapeID("com.amazonaws.lambda#RuntimeVersionArn"), shape_type=ShapeType.STRING -) - -RUNTIME_VERSION_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.lambda#RuntimeVersionConfig"), - members={ - "RuntimeVersionArn": {"target": RUNTIME_VERSION_ARN}, - "Error": {"target": RUNTIME_VERSION_ERROR}, - }, -) - -SNAP_START_OPTIMIZATION_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#SnapStartOptimizationStatus"), - shape_type=ShapeType.ENUM, - members={"On": {"target": UNIT}, "Off": {"target": UNIT}}, -) - -SNAP_START_RESPONSE = Schema.collection( - id=ShapeID("com.amazonaws.lambda#SnapStartResponse"), - members={ - "ApplyOn": {"target": SNAP_START_APPLY_ON}, - "OptimizationStatus": {"target": SNAP_START_OPTIMIZATION_STATUS}, - }, -) - -STATE_REASON = Schema( - id=ShapeID("com.amazonaws.lambda#StateReason"), shape_type=ShapeType.STRING -) - -STATE_REASON_CODE = Schema.collection( - id=ShapeID("com.amazonaws.lambda#StateReasonCode"), - shape_type=ShapeType.ENUM, - members={ - "Idle": {"target": UNIT}, - "Creating": {"target": UNIT}, - "Restoring": {"target": UNIT}, - "EniLimitExceeded": {"target": UNIT}, - "InsufficientRolePermissions": {"target": UNIT}, - "InvalidConfiguration": {"target": UNIT}, - "InternalError": {"target": UNIT}, - "SubnetOutOfIPAddresses": {"target": UNIT}, - "InvalidSubnet": {"target": UNIT}, - "InvalidSecurityGroup": {"target": UNIT}, - "ImageDeleted": {"target": UNIT}, - "ImageAccessDenied": {"target": UNIT}, - "InvalidImage": {"target": UNIT}, - "KMSKeyAccessDenied": {"target": UNIT}, - "KMSKeyNotFound": {"target": UNIT}, - "InvalidStateKMSKey": {"target": UNIT}, - "DisabledKMSKey": {"target": UNIT}, - "EFSIOError": {"target": UNIT}, - "EFSMountConnectivityError": {"target": UNIT}, - "EFSMountFailure": {"target": UNIT}, - "EFSMountTimeout": {"target": UNIT}, - "InvalidRuntime": {"target": UNIT}, - "InvalidZipFileException": {"target": UNIT}, - "FunctionError": {"target": UNIT}, - "ServiceQuotaExceededException": {"target": UNIT}, - "VcpuLimitExceeded": {"target": UNIT}, - "CapacityProviderScalingLimitExceeded": {"target": UNIT}, - "InsufficientCapacity": {"target": UNIT}, - "EC2RequestLimitExceeded": {"target": UNIT}, - "FunctionErrorInitTimeout": {"target": UNIT}, - "FunctionErrorRuntimeInitError": {"target": UNIT}, - "FunctionErrorExtensionInitError": {"target": UNIT}, - "FunctionErrorInvalidEntryPoint": {"target": UNIT}, - "FunctionErrorInvalidWorkingDirectory": {"target": UNIT}, - "FunctionErrorPermissionDenied": {"target": UNIT}, - "FunctionErrorTooManyExtensions": {"target": UNIT}, - "FunctionErrorInitResourceExhausted": {"target": UNIT}, - "DisallowedByVpcEncryptionControl": {"target": UNIT}, - "DrainingDurableExecutions": {"target": UNIT}, - "DependencyError": {"target": UNIT}, - }, -) - -TRACING_CONFIG_RESPONSE = Schema.collection( - id=ShapeID("com.amazonaws.lambda#TracingConfigResponse"), - members={"Mode": {"target": TRACING_MODE}}, -) - -VPC_ID = Schema(id=ShapeID("com.amazonaws.lambda#VpcId"), shape_type=ShapeType.STRING) - -VPC_CONFIG_RESPONSE = Schema.collection( - id=ShapeID("com.amazonaws.lambda#VpcConfigResponse"), - members={ - "SubnetIds": {"target": SUBNET_IDS}, - "SecurityGroupIds": {"target": SECURITY_GROUP_IDS}, - "VpcId": {"target": VPC_ID}, - "Ipv6AllowedForDualStack": {"target": NULLABLE_BOOLEAN}, - }, -) - -CREATE_FUNCTION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#CreateFunctionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#FunctionConfiguration", +GET_ACCOUNT_SETTINGS: StaticOperationSchema = ( + 23, + n0, + _GAS, + { + _smithy: MappingProxyType( + {"method": "GET", "uri": "/2016-08-19/account-settings", "code": 200} ) - ], - members={ - "FunctionName": {"target": NAMESPACED_FUNCTION_NAME}, - "FunctionArn": {"target": NAME_SPACED_FUNCTION_ARN}, - "Runtime": {"target": RUNTIME}, - "Role": {"target": ROLE_ARN}, - "Handler": {"target": HANDLER}, - "CodeSize": { - "target": LONG, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "Description": {"target": DESCRIPTION}, - "Timeout": {"target": TIMEOUT}, - "MemorySize": {"target": MEMORY_SIZE}, - "LastModified": {"target": TIMESTAMP}, - "CodeSha256": {"target": STRING}, - "Version": {"target": VERSION}, - "VpcConfig": {"target": VPC_CONFIG_RESPONSE}, - "DeadLetterConfig": {"target": DEAD_LETTER_CONFIG}, - "Environment": {"target": ENVIRONMENT_RESPONSE}, - "KMSKeyArn": {"target": KMS_KEY_ARN}, - "TracingConfig": {"target": TRACING_CONFIG_RESPONSE}, - "MasterArn": {"target": FUNCTION_ARN}, - "RevisionId": {"target": STRING}, - "Layers": {"target": LAYERS_REFERENCE_LIST}, - "State": {"target": STATE}, - "StateReason": {"target": STATE_REASON}, - "StateReasonCode": {"target": STATE_REASON_CODE}, - "LastUpdateStatus": {"target": LAST_UPDATE_STATUS}, - "LastUpdateStatusReason": {"target": LAST_UPDATE_STATUS_REASON}, - "LastUpdateStatusReasonCode": {"target": LAST_UPDATE_STATUS_REASON_CODE}, - "FileSystemConfigs": {"target": FILE_SYSTEM_CONFIG_LIST}, - "SigningProfileVersionArn": {"target": ARN}, - "SigningJobArn": {"target": ARN}, - "PackageType": {"target": PACKAGE_TYPE}, - "ImageConfigResponse": {"target": IMAGE_CONFIG_RESPONSE}, - "Architectures": {"target": ARCHITECTURES_LIST}, - "EphemeralStorage": {"target": EPHEMERAL_STORAGE}, - "SnapStart": {"target": SNAP_START_RESPONSE}, - "RuntimeVersionConfig": {"target": RUNTIME_VERSION_CONFIG}, - "LoggingConfig": {"target": LOGGING_CONFIG}, - "TenancyConfig": {"target": TENANCY_CONFIG}, - "CapacityProviderConfig": {"target": CAPACITY_PROVIDER_CONFIG}, - "ConfigSha256": {"target": STRING}, - "DurableConfig": {"target": DURABLE_CONFIG}, }, + GET_ACCOUNT_SETTINGS_INPUT, + GET_ACCOUNT_SETTINGS_OUTPUT, + (SERVICE_EXCEPTION, TOO_MANY_REQUESTS_EXCEPTION), ) -FUNCTION_VERSIONS_PER_CAPACITY_PROVIDER_LIMIT_EXCEEDED_EXCEPTION = Schema.collection( - id=ShapeID( - "com.amazonaws.lambda#FunctionVersionsPerCapacityProviderLimitExceededException" +GET_FUNCTION_EVENT_INVOKE_CONFIG_INPUT: StaticSchema = ( + 18, + n0, + _GFEICI, + {_sSI: _cGFEICR, _sm: None}, + (_FN, _Q), + ( + (NAMESPACED_FUNCTION_NAME, 9), + (NUMERIC_LATEST_PUBLISHED_OR_ALIAS_QUALIFIER, {_sQ: _Q}), ), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"Type": {"target": STRING}, "message": {"target": STRING}}, -) - -INVALID_CODE_SIGNATURE_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#InvalidCodeSignatureException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"Type": {"target": STRING}, "Message": {"target": STRING}}, -) - -CREATE_FUNCTION = Schema( - id=ShapeID("com.amazonaws.lambda#CreateFunction"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/2015-03-31/functions", "code": 201} - ), - ) - ], -) - -HEADER = Schema(id=ShapeID("com.amazonaws.lambda#Header"), shape_type=ShapeType.STRING) - -HEADERS_LIST = Schema.collection( - id=ShapeID("com.amazonaws.lambda#HeadersList"), - shape_type=ShapeType.LIST, - members={"member": {"target": HEADER}}, -) - -MAX_AGE = Schema( - id=ShapeID("com.amazonaws.lambda#MaxAge"), shape_type=ShapeType.INTEGER ) -CORS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#Cors"), - members={ - "AllowCredentials": {"target": ALLOW_CREDENTIALS}, - "AllowHeaders": {"target": HEADERS_LIST}, - "AllowMethods": {"target": ALLOW_METHODS_LIST}, - "AllowOrigins": {"target": ALLOW_ORIGINS_LIST}, - "ExposeHeaders": {"target": HEADERS_LIST}, - "MaxAge": {"target": MAX_AGE}, - }, -) - -FUNCTION_URL_FUNCTION_NAME = Schema( - id=ShapeID("com.amazonaws.lambda#FunctionUrlFunctionName"), - shape_type=ShapeType.STRING, -) - -INVOKE_MODE = Schema.collection( - id=ShapeID("com.amazonaws.lambda#InvokeMode"), - shape_type=ShapeType.ENUM, - members={"BUFFERED": {"target": UNIT}, "RESPONSE_STREAM": {"target": UNIT}}, -) - -FUNCTION_URL_QUALIFIER = Schema( - id=ShapeID("com.amazonaws.lambda#FunctionUrlQualifier"), shape_type=ShapeType.STRING -) - -CREATE_FUNCTION_URL_CONFIG_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#CreateFunctionUrlConfigInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#CreateFunctionUrlConfigRequest", - ) - ], - members={ - "FunctionName": { - "target": FUNCTION_URL_FUNCTION_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Qualifier": { - "target": FUNCTION_URL_QUALIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="Qualifier") - ], - }, - "AuthType": { - "target": FUNCTION_URL_AUTH_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Cors": {"target": CORS}, - "InvokeMode": {"target": INVOKE_MODE}, - }, -) - -FUNCTION_URL = Schema( - id=ShapeID("com.amazonaws.lambda#FunctionUrl"), shape_type=ShapeType.STRING -) - -CREATE_FUNCTION_URL_CONFIG_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#CreateFunctionUrlConfigOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#CreateFunctionUrlConfigResponse", - ) - ], - members={ - "FunctionUrl": { - "target": FUNCTION_URL, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "FunctionArn": { - "target": FUNCTION_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "AuthType": { - "target": FUNCTION_URL_AUTH_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Cors": {"target": CORS}, - "CreationTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "InvokeMode": {"target": INVOKE_MODE}, - }, -) - -CREATE_FUNCTION_URL_CONFIG = Schema( - id=ShapeID("com.amazonaws.lambda#CreateFunctionUrlConfig"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/2021-10-31/functions/{FunctionName}/url", - "code": 201, - } - ), - ) - ], -) - -DELETE_FUNCTION_CODE_SIGNING_CONFIG_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#DeleteFunctionCodeSigningConfigInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#DeleteFunctionCodeSigningConfigRequest", - ) - ], - members={ - "FunctionName": { - "target": NAMESPACED_FUNCTION_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -DELETE_FUNCTION_CODE_SIGNING_CONFIG_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#DeleteFunctionCodeSigningConfigOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -DELETE_FUNCTION_CODE_SIGNING_CONFIG = Schema( - id=ShapeID("com.amazonaws.lambda#DeleteFunctionCodeSigningConfig"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/2020-06-30/functions/{FunctionName}/code-signing-config", - "code": 204, - } - ), - ) - ], -) - -DELETE_FUNCTION_CONCURRENCY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#DeleteFunctionConcurrencyInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#DeleteFunctionConcurrencyRequest", - ) - ], - members={ - "FunctionName": { - "target": FUNCTION_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -DELETE_FUNCTION_CONCURRENCY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#DeleteFunctionConcurrencyOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -DELETE_FUNCTION_CONCURRENCY = Schema( - id=ShapeID("com.amazonaws.lambda#DeleteFunctionConcurrency"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/2017-10-31/functions/{FunctionName}/concurrency", - "code": 204, - } - ), - ) - ], -) - -DELETE_FUNCTION_URL_CONFIG_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#DeleteFunctionUrlConfigInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#DeleteFunctionUrlConfigRequest", - ) - ], - members={ - "FunctionName": { - "target": FUNCTION_URL_FUNCTION_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Qualifier": { - "target": FUNCTION_URL_QUALIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="Qualifier") - ], - }, - }, -) - -DELETE_FUNCTION_URL_CONFIG_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#DeleteFunctionUrlConfigOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -DELETE_FUNCTION_URL_CONFIG = Schema( - id=ShapeID("com.amazonaws.lambda#DeleteFunctionUrlConfig"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/2021-10-31/functions/{FunctionName}/url", - "code": 204, - } - ), - ) - ], -) - -GET_FUNCTION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#GetFunctionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#GetFunctionRequest", - ) - ], - members={ - "FunctionName": { - "target": NAMESPACED_FUNCTION_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Qualifier": { - "target": NUMERIC_LATEST_PUBLISHED_OR_ALIAS_QUALIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="Qualifier") - ], - }, - }, -) - -FUNCTION_CODE_LOCATION_ERROR = Schema.collection( - id=ShapeID("com.amazonaws.lambda#FunctionCodeLocationError"), - members={"ErrorCode": {"target": STRING}, "Message": {"target": SENSITIVE_STRING}}, -) - -SENSITIVE_STRING_ON_SERVER_ONLY = Schema( - id=ShapeID("com.amazonaws.lambda#SensitiveStringOnServerOnly"), - shape_type=ShapeType.STRING, -) - -RESOLVED_S3_OBJECT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ResolvedS3Object"), - members={ - "S3Bucket": {"target": S3_BUCKET}, - "S3Key": {"target": S3_KEY}, - "S3ObjectVersion": {"target": S3_OBJECT_VERSION}, - }, -) +MAXIMUM_EVENT_AGE_IN_SECONDS: StaticSchema = (7, n0, _MEAIS, 0) -FUNCTION_CODE_LOCATION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#FunctionCodeLocation"), - members={ - "RepositoryType": {"target": STRING}, - "Location": {"target": SENSITIVE_STRING_ON_SERVER_ONLY}, - "ImageUri": {"target": STRING}, - "ResolvedImageUri": {"target": STRING}, - "ResolvedS3Object": {"target": RESOLVED_S3_OBJECT}, - "SourceKMSKeyArn": {"target": KMS_KEY_ARN}, - "Error": {"target": FUNCTION_CODE_LOCATION_ERROR}, - }, -) - -RESERVED_CONCURRENT_EXECUTIONS = Schema( - id=ShapeID("com.amazonaws.lambda#ReservedConcurrentExecutions"), - shape_type=ShapeType.INTEGER, -) +MAXIMUM_RETRY_ATTEMPTS: StaticSchema = (7, n0, _MRA, 0) -CONCURRENCY = Schema.collection( - id=ShapeID("com.amazonaws.lambda#Concurrency"), - members={ - "ReservedConcurrentExecutions": {"target": RESERVED_CONCURRENT_EXECUTIONS} - }, -) - -FUNCTION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#FunctionConfiguration"), - members={ - "FunctionName": {"target": NAMESPACED_FUNCTION_NAME}, - "FunctionArn": {"target": NAME_SPACED_FUNCTION_ARN}, - "Runtime": {"target": RUNTIME}, - "Role": {"target": ROLE_ARN}, - "Handler": {"target": HANDLER}, - "CodeSize": { - "target": LONG, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "Description": {"target": DESCRIPTION}, - "Timeout": {"target": TIMEOUT}, - "MemorySize": {"target": MEMORY_SIZE}, - "LastModified": {"target": TIMESTAMP}, - "CodeSha256": {"target": STRING}, - "Version": {"target": VERSION}, - "VpcConfig": {"target": VPC_CONFIG_RESPONSE}, - "DeadLetterConfig": {"target": DEAD_LETTER_CONFIG}, - "Environment": {"target": ENVIRONMENT_RESPONSE}, - "KMSKeyArn": {"target": KMS_KEY_ARN}, - "TracingConfig": {"target": TRACING_CONFIG_RESPONSE}, - "MasterArn": {"target": FUNCTION_ARN}, - "RevisionId": {"target": STRING}, - "Layers": {"target": LAYERS_REFERENCE_LIST}, - "State": {"target": STATE}, - "StateReason": {"target": STATE_REASON}, - "StateReasonCode": {"target": STATE_REASON_CODE}, - "LastUpdateStatus": {"target": LAST_UPDATE_STATUS}, - "LastUpdateStatusReason": {"target": LAST_UPDATE_STATUS_REASON}, - "LastUpdateStatusReasonCode": {"target": LAST_UPDATE_STATUS_REASON_CODE}, - "FileSystemConfigs": {"target": FILE_SYSTEM_CONFIG_LIST}, - "SigningProfileVersionArn": {"target": ARN}, - "SigningJobArn": {"target": ARN}, - "PackageType": {"target": PACKAGE_TYPE}, - "ImageConfigResponse": {"target": IMAGE_CONFIG_RESPONSE}, - "Architectures": {"target": ARCHITECTURES_LIST}, - "EphemeralStorage": {"target": EPHEMERAL_STORAGE}, - "SnapStart": {"target": SNAP_START_RESPONSE}, - "RuntimeVersionConfig": {"target": RUNTIME_VERSION_CONFIG}, - "LoggingConfig": {"target": LOGGING_CONFIG}, - "TenancyConfig": {"target": TENANCY_CONFIG}, - "CapacityProviderConfig": {"target": CAPACITY_PROVIDER_CONFIG}, - "ConfigSha256": {"target": STRING}, - "DurableConfig": {"target": DURABLE_CONFIG}, - }, +GET_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT: StaticSchema = ( + 18, + n0, + _GFEICO, + {_sSI: _cFEIC, _smit: None}, + (_LM, _FA, _MRA, _MEAIS, _DCe), + ( + (DATE, 0), + (FUNCTION_ARN, 0), + (MAXIMUM_RETRY_ATTEMPTS, 0), + (MAXIMUM_EVENT_AGE_IN_SECONDS, 0), + (DESTINATION_CONFIG, 0), + ), ) -TAGS_ERROR_CODE = Schema( - id=ShapeID("com.amazonaws.lambda#TagsErrorCode"), shape_type=ShapeType.STRING +GET_FUNCTION_EVENT_INVOKE_CONFIG: StaticOperationSchema = ( + 23, + n0, + _GFEIC, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/2019-09-25/functions/{FunctionName}/event-invoke-config", + "code": 200, + } + ) + }, + GET_FUNCTION_EVENT_INVOKE_CONFIG_INPUT, + GET_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -TAGS_ERROR_MESSAGE = Schema( - id=ShapeID("com.amazonaws.lambda#TagsErrorMessage"), shape_type=ShapeType.STRING +GET_RESOURCE_POLICY_INPUT: StaticSchema = ( + 18, + n0, + _GRPI, + {_sSI: _cGRPR, _sm: None}, + (_RAe,), + ((POLICY_RESOURCE_ARN, 9),), +) + +RESOURCE_POLICY: StaticSchema = (3, n0, _RP, 0) + +GET_RESOURCE_POLICY_OUTPUT: StaticSchema = ( + 18, + n0, + _GRPO, + {_sSI: _cGRPRo, _smit: None}, + (_Po, _RI), + ((RESOURCE_POLICY, 0), (REVISION_ID, 0)), +) + +GET_RESOURCE_POLICY: StaticOperationSchema = ( + 23, + n0, + _GRP, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/2026-07-09/resource-policy/{ResourceArn}", + "code": 200, + } + ) + }, + GET_RESOURCE_POLICY_INPUT, + GET_RESOURCE_POLICY_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -TAGS_ERROR = Schema.collection( - id=ShapeID("com.amazonaws.lambda#TagsError"), - members={ - "ErrorCode": { - "target": TAGS_ERROR_CODE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Message": { - "target": TAGS_ERROR_MESSAGE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +MAX_LAYER_LIST_ITEMS: StaticSchema = (7, n0, _MLLI, 0) -GET_FUNCTION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#GetFunctionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#GetFunctionResponse", - ) - ], - members={ - "Configuration": {"target": FUNCTION_CONFIGURATION}, - "Code": {"target": FUNCTION_CODE_LOCATION}, - "Tags": {"target": TAGS}, - "TagsError": {"target": TAGS_ERROR}, - "Concurrency": {"target": CONCURRENCY}, - }, +LIST_LAYERS_INPUT: StaticSchema = ( + 18, + n0, + _LLI, + {_sSI: _cLLR, _sm: None}, + (_CAo, _CR, _Mar, _MI), + ( + (ARCHITECTURE, {_sQ: _CAo}), + (RUNTIME, {_sQ: _CR}), + (STRING, {_sQ: _Mar}), + (MAX_LAYER_LIST_ITEMS, {_sQ: _MI}), + ), ) -GET_FUNCTION = Schema( - id=ShapeID("com.amazonaws.lambda#GetFunction"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/2015-03-31/functions/{FunctionName}", - "code": 200, - } - ), - ) - ], +COMPATIBLE_ARCHITECTURES: StaticSchema = ( + 16, + n0, + _CAom, + 0, + (_me,), + ((ARCHITECTURE, 0),), +) + +COMPATIBLE_RUNTIMES: StaticSchema = (16, n0, _CRo, 0, (_me,), ((RUNTIME, 0),)) + +LICENSE_INFO: StaticSchema = (3, n0, _LI, 0) + +LAYER_VERSIONS_LIST_ITEM: StaticSchema = ( + 18, + n0, + _LVLI, + 0, + (_LVA, _V, _D, _CDr, _CAom, _CRo, _LI), + ( + (LAYER_VERSION_ARN, 0), + (LAYER_VERSION_NUMBER, {_s: 0}), + (DESCRIPTION, 0), + (TIMESTAMP, 0), + (COMPATIBLE_ARCHITECTURES, 0), + (COMPATIBLE_RUNTIMES, 0), + (LICENSE_INFO, 0), + ), ) -GET_FUNCTION_CODE_SIGNING_CONFIG_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#GetFunctionCodeSigningConfigInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#GetFunctionCodeSigningConfigRequest", - ) - ], - members={ - "FunctionName": { - "target": NAMESPACED_FUNCTION_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) +LAYER_ARN: StaticSchema = (3, n0, _LAa, 0) -GET_FUNCTION_CODE_SIGNING_CONFIG_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#GetFunctionCodeSigningConfigOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#GetFunctionCodeSigningConfigResponse", - ) - ], - members={ - "CodeSigningConfigArn": { - "target": CODE_SIGNING_CONFIG_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "FunctionName": { - "target": FUNCTION_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +LAYERS_LIST_ITEM: StaticSchema = ( + 18, + n0, + _LLIa, + 0, + (_LN, _LAa, _LMV), + ((LAYER_NAME, 0), (LAYER_ARN, 0), (LAYER_VERSIONS_LIST_ITEM, 0)), ) -GET_FUNCTION_CODE_SIGNING_CONFIG = Schema( - id=ShapeID("com.amazonaws.lambda#GetFunctionCodeSigningConfig"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/2020-06-30/functions/{FunctionName}/code-signing-config", - "code": 200, - } - ), - ) - ], -) +LAYERS_LIST: StaticSchema = (16, n0, _LLa, 0, (_me,), ((LAYERS_LIST_ITEM, 0),)) -GET_FUNCTION_CONCURRENCY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#GetFunctionConcurrencyInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#GetFunctionConcurrencyRequest", - ) - ], - members={ - "FunctionName": { - "target": FUNCTION_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, +LIST_LAYERS_OUTPUT: StaticSchema = ( + 18, + n0, + _LLO, + {_sSI: _cLLRo, _smit: None}, + (_NM, _La), + ((STRING, 0), (LAYERS_LIST, 0)), ) -GET_FUNCTION_CONCURRENCY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#GetFunctionConcurrencyOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#GetFunctionConcurrencyResponse", +LIST_LAYERS: StaticOperationSchema = ( + 23, + n0, + _LLi, + { + _smithy: MappingProxyType( + {"method": "GET", "uri": "/2018-10-31/layers", "code": 200} ) - ], - members={ - "ReservedConcurrentExecutions": {"target": RESERVED_CONCURRENT_EXECUTIONS} }, + LIST_LAYERS_INPUT, + LIST_LAYERS_OUTPUT, + (INVALID_PARAMETER_VALUE_EXCEPTION, SERVICE_EXCEPTION, TOO_MANY_REQUESTS_EXCEPTION), ) -GET_FUNCTION_CONCURRENCY = Schema( - id=ShapeID("com.amazonaws.lambda#GetFunctionConcurrency"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/2019-09-30/functions/{FunctionName}/concurrency", - "code": 200, - } - ), - ) - ], +DELETE_LAYER_VERSION_INPUT: StaticSchema = ( + 18, + n0, + _DLVI, + {_sSI: _cDLVR, _sm: None}, + (_LN, _VN), + ((LAYER_NAME, 9), (LAYER_VERSION_NUMBER, {_s: None, _smi: None, _sL: None})), ) -GET_FUNCTION_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#GetFunctionConfigurationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#GetFunctionConfigurationRequest", - ) - ], - members={ - "FunctionName": { - "target": NAMESPACED_FUNCTION_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Qualifier": { - "target": NUMERIC_LATEST_PUBLISHED_OR_ALIAS_QUALIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="Qualifier") - ], - }, - }, -) +DELETE_LAYER_VERSION_OUTPUT: StaticSchema = (18, n0, _DLVO, {_sSI: _sU, _smit: None}) -GET_FUNCTION_CONFIGURATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#GetFunctionConfigurationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#FunctionConfiguration", +DELETE_LAYER_VERSION: StaticOperationSchema = ( + 23, + n0, + _DLV, + { + _smithy: MappingProxyType( + { + "method": "DELETE", + "uri": "/2018-10-31/layers/{LayerName}/versions/{VersionNumber}", + "code": 204, + } ) - ], - members={ - "FunctionName": {"target": NAMESPACED_FUNCTION_NAME}, - "FunctionArn": {"target": NAME_SPACED_FUNCTION_ARN}, - "Runtime": {"target": RUNTIME}, - "Role": {"target": ROLE_ARN}, - "Handler": {"target": HANDLER}, - "CodeSize": { - "target": LONG, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "Description": {"target": DESCRIPTION}, - "Timeout": {"target": TIMEOUT}, - "MemorySize": {"target": MEMORY_SIZE}, - "LastModified": {"target": TIMESTAMP}, - "CodeSha256": {"target": STRING}, - "Version": {"target": VERSION}, - "VpcConfig": {"target": VPC_CONFIG_RESPONSE}, - "DeadLetterConfig": {"target": DEAD_LETTER_CONFIG}, - "Environment": {"target": ENVIRONMENT_RESPONSE}, - "KMSKeyArn": {"target": KMS_KEY_ARN}, - "TracingConfig": {"target": TRACING_CONFIG_RESPONSE}, - "MasterArn": {"target": FUNCTION_ARN}, - "RevisionId": {"target": STRING}, - "Layers": {"target": LAYERS_REFERENCE_LIST}, - "State": {"target": STATE}, - "StateReason": {"target": STATE_REASON}, - "StateReasonCode": {"target": STATE_REASON_CODE}, - "LastUpdateStatus": {"target": LAST_UPDATE_STATUS}, - "LastUpdateStatusReason": {"target": LAST_UPDATE_STATUS_REASON}, - "LastUpdateStatusReasonCode": {"target": LAST_UPDATE_STATUS_REASON_CODE}, - "FileSystemConfigs": {"target": FILE_SYSTEM_CONFIG_LIST}, - "SigningProfileVersionArn": {"target": ARN}, - "SigningJobArn": {"target": ARN}, - "PackageType": {"target": PACKAGE_TYPE}, - "ImageConfigResponse": {"target": IMAGE_CONFIG_RESPONSE}, - "Architectures": {"target": ARCHITECTURES_LIST}, - "EphemeralStorage": {"target": EPHEMERAL_STORAGE}, - "SnapStart": {"target": SNAP_START_RESPONSE}, - "RuntimeVersionConfig": {"target": RUNTIME_VERSION_CONFIG}, - "LoggingConfig": {"target": LOGGING_CONFIG}, - "TenancyConfig": {"target": TENANCY_CONFIG}, - "CapacityProviderConfig": {"target": CAPACITY_PROVIDER_CONFIG}, - "ConfigSha256": {"target": STRING}, - "DurableConfig": {"target": DURABLE_CONFIG}, }, + DELETE_LAYER_VERSION_INPUT, + DELETE_LAYER_VERSION_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -GET_FUNCTION_CONFIGURATION = Schema( - id=ShapeID("com.amazonaws.lambda#GetFunctionConfiguration"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/2015-03-31/functions/{FunctionName}/configuration", - "code": 200, - } - ), - ) - ], -) - -UNQUALIFIED_FUNCTION_NAME = Schema( - id=ShapeID("com.amazonaws.lambda#UnqualifiedFunctionName"), - shape_type=ShapeType.STRING, -) - -GET_FUNCTION_RECURSION_CONFIG_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#GetFunctionRecursionConfigInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#GetFunctionRecursionConfigRequest", - ) - ], - members={ - "FunctionName": { - "target": UNQUALIFIED_FUNCTION_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, +GET_LAYER_VERSION_INPUT: StaticSchema = ( + 18, + n0, + _GLVI, + {_sSI: _cGLVR, _sm: None}, + (_LN, _VN), + ((LAYER_NAME, 9), (LAYER_VERSION_NUMBER, {_s: None, _smi: None, _sL: None})), +) + +LAYER_VERSION_CONTENT_OUTPUT: StaticSchema = ( + 18, + n0, + _LVCO, + 0, + (_Lo, _CSode, _CSod, _SPVAi, _SJA, _RSO), + ( + (SENSITIVE_STRING_ON_SERVER_ONLY, 0), + (STRING, 0), + (LONG, {_s: 0}), + (ARN, 0), + (ARN, 0), + (RESOLVED_S3_OBJECT, 0), + ), ) -RECURSIVE_LOOP = Schema.collection( - id=ShapeID("com.amazonaws.lambda#RecursiveLoop"), - shape_type=ShapeType.ENUM, - members={"Allow": {"target": UNIT}, "Terminate": {"target": UNIT}}, +GET_LAYER_VERSION_OUTPUT: StaticSchema = ( + 18, + n0, + _GLVO, + {_sSI: _cGLVRo, _smit: None}, + (_Cont, _LAa, _LVA, _D, _CDr, _V, _CAom, _CRo, _LI), + ( + (LAYER_VERSION_CONTENT_OUTPUT, 0), + (LAYER_ARN, 0), + (LAYER_VERSION_ARN, 0), + (DESCRIPTION, 0), + (TIMESTAMP, 0), + (LAYER_VERSION_NUMBER, {_s: 0}), + (COMPATIBLE_ARCHITECTURES, 0), + (COMPATIBLE_RUNTIMES, 0), + (LICENSE_INFO, 0), + ), ) -GET_FUNCTION_RECURSION_CONFIG_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#GetFunctionRecursionConfigOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#GetFunctionRecursionConfigResponse", - ) - ], - members={"RecursiveLoop": {"target": RECURSIVE_LOOP}}, -) - -GET_FUNCTION_RECURSION_CONFIG = Schema( - id=ShapeID("com.amazonaws.lambda#GetFunctionRecursionConfig"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/2024-08-31/functions/{FunctionName}/recursion-config", - "code": 200, - } - ), - ) - ], +GET_LAYER_VERSION: StaticOperationSchema = ( + 23, + n0, + _GLV, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/2018-10-31/layers/{LayerName}/versions/{VersionNumber}", + "code": 200, + } + ) + }, + GET_LAYER_VERSION_INPUT, + GET_LAYER_VERSION_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -PUBLISHED_FUNCTION_QUALIFIER = Schema( - id=ShapeID("com.amazonaws.lambda#PublishedFunctionQualifier"), - shape_type=ShapeType.STRING, +GET_LAYER_VERSION_BY_ARN_INPUT: StaticSchema = ( + 18, + n0, + _GLVBAI, + {_sSI: _cGLVBAR, _sm: None}, + (_Ar,), + ((LAYER_VERSION_ARN, {_sQ: _Ar, _smi: None}),), +) + +GET_LAYER_VERSION_BY_ARN_OUTPUT: StaticSchema = ( + 18, + n0, + _GLVBAO, + {_sSI: _cGLVRo, _smit: None}, + (_Cont, _LAa, _LVA, _D, _CDr, _V, _CAom, _CRo, _LI), + ( + (LAYER_VERSION_CONTENT_OUTPUT, 0), + (LAYER_ARN, 0), + (LAYER_VERSION_ARN, 0), + (DESCRIPTION, 0), + (TIMESTAMP, 0), + (LAYER_VERSION_NUMBER, {_s: 0}), + (COMPATIBLE_ARCHITECTURES, 0), + (COMPATIBLE_RUNTIMES, 0), + (LICENSE_INFO, 0), + ), ) -GET_FUNCTION_SCALING_CONFIG_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#GetFunctionScalingConfigInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#GetFunctionScalingConfigRequest", - ) - ], - members={ - "FunctionName": { - "target": UNQUALIFIED_FUNCTION_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Qualifier": { - "target": PUBLISHED_FUNCTION_QUALIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="Qualifier"), - ], - }, - }, +GET_LAYER_VERSION_BY_ARN: StaticOperationSchema = ( + 23, + n0, + _GLVBA, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/2018-10-31/layers?find=LayerVersion", + "code": 200, + } + ) + }, + GET_LAYER_VERSION_BY_ARN_INPUT, + GET_LAYER_VERSION_BY_ARN_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -FUNCTION_SCALING_CONFIG_EXECUTION_ENVIRONMENTS = Schema( - id=ShapeID("com.amazonaws.lambda#FunctionScalingConfigExecutionEnvironments"), - shape_type=ShapeType.INTEGER, +GET_LAYER_VERSION_POLICY_INPUT: StaticSchema = ( + 18, + n0, + _GLVPI, + {_sSI: _cGLVPR, _sm: None}, + (_LN, _VN), + ((LAYER_NAME, 9), (LAYER_VERSION_NUMBER, {_s: None, _smi: None, _sL: None})), +) + +GET_LAYER_VERSION_POLICY_OUTPUT: StaticSchema = ( + 18, + n0, + _GLVPO, + {_sSI: _cGLVPRo, _smit: None}, + (_Po, _RI), + ((STRING, 0), (STRING, 0)), +) + +GET_LAYER_VERSION_POLICY: StaticOperationSchema = ( + 23, + n0, + _GLVP, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/2018-10-31/layers/{LayerName}/versions/{VersionNumber}/policy", + "code": 200, + } + ) + }, + GET_LAYER_VERSION_POLICY_INPUT, + GET_LAYER_VERSION_POLICY_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -FUNCTION_SCALING_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.lambda#FunctionScalingConfig"), - members={ - "MinExecutionEnvironments": { - "target": FUNCTION_SCALING_CONFIG_EXECUTION_ENVIRONMENTS - }, - "MaxExecutionEnvironments": { - "target": FUNCTION_SCALING_CONFIG_EXECUTION_ENVIRONMENTS - }, - }, +LIST_LAYER_VERSIONS_INPUT: StaticSchema = ( + 18, + n0, + _LLVI, + {_sSI: _cLLVR, _sm: None}, + (_CAo, _CR, _LN, _Mar, _MI), + ( + (ARCHITECTURE, {_sQ: _CAo}), + (RUNTIME, {_sQ: _CR}), + (LAYER_NAME, 9), + (STRING, {_sQ: _Mar}), + (MAX_LAYER_LIST_ITEMS, {_sQ: _MI}), + ), ) -GET_FUNCTION_SCALING_CONFIG_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#GetFunctionScalingConfigOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#GetFunctionScalingConfigResponse", - ) - ], - members={ - "FunctionArn": {"target": FUNCTION_ARN}, - "AppliedFunctionScalingConfig": {"target": FUNCTION_SCALING_CONFIG}, - "RequestedFunctionScalingConfig": {"target": FUNCTION_SCALING_CONFIG}, - }, +LAYER_VERSIONS_LIST: StaticSchema = ( + 16, + n0, + _LVL, + 0, + (_me,), + ((LAYER_VERSIONS_LIST_ITEM, 0),), +) + +LIST_LAYER_VERSIONS_OUTPUT: StaticSchema = ( + 18, + n0, + _LLVO, + {_sSI: _cLLVRo, _smit: None}, + (_NM, _LV), + ((STRING, 0), (LAYER_VERSIONS_LIST, 0)), +) + +LIST_LAYER_VERSIONS: StaticOperationSchema = ( + 23, + n0, + _LLV, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/2018-10-31/layers/{LayerName}/versions", + "code": 200, + } + ) + }, + LIST_LAYER_VERSIONS_INPUT, + LIST_LAYER_VERSIONS_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -GET_FUNCTION_SCALING_CONFIG = Schema( - id=ShapeID("com.amazonaws.lambda#GetFunctionScalingConfig"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/2025-11-30/functions/{FunctionName}/function-scaling-config", - "code": 200, - } - ), - ) - ], +LAYER_VERSION_CONTENT_INPUT: StaticSchema = ( + 18, + n0, + _LVCI, + 0, + (_SB, _SK, _SOV, _SOSM, _ZF), + ( + (S3_BUCKET, 0), + (S3_KEY, 0), + (S3_OBJECT_VERSION, 0), + (S3_OBJECT_STORAGE_MODE, 0), + (BLOB, 0), + ), ) -GET_FUNCTION_URL_CONFIG_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#GetFunctionUrlConfigInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#GetFunctionUrlConfigRequest", - ) - ], - members={ - "FunctionName": { - "target": FUNCTION_URL_FUNCTION_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Qualifier": { - "target": FUNCTION_URL_QUALIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="Qualifier") - ], - }, - }, +PUBLISH_LAYER_VERSION_INPUT: StaticSchema = ( + 18, + n0, + _PLVI, + {_sSI: _cPLVR, _sm: None}, + (_LN, _D, _Cont, _CAom, _CRo, _LI), + ( + (LAYER_NAME, 9), + (DESCRIPTION, 0), + (LAYER_VERSION_CONTENT_INPUT, 1), + (COMPATIBLE_ARCHITECTURES, 0), + (COMPATIBLE_RUNTIMES, 0), + (LICENSE_INFO, 0), + ), ) -GET_FUNCTION_URL_CONFIG_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#GetFunctionUrlConfigOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#GetFunctionUrlConfigResponse", - ) - ], - members={ - "FunctionUrl": { - "target": FUNCTION_URL, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "FunctionArn": { - "target": FUNCTION_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "AuthType": { - "target": FUNCTION_URL_AUTH_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Cors": {"target": CORS}, - "CreationTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "LastModifiedTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "InvokeMode": {"target": INVOKE_MODE}, - }, +PUBLISH_LAYER_VERSION_OUTPUT: StaticSchema = ( + 18, + n0, + _PLVO, + {_sSI: _cPLVRo, _smit: None}, + (_Cont, _LAa, _LVA, _D, _CDr, _V, _CAom, _CRo, _LI), + ( + (LAYER_VERSION_CONTENT_OUTPUT, 0), + (LAYER_ARN, 0), + (LAYER_VERSION_ARN, 0), + (DESCRIPTION, 0), + (TIMESTAMP, 0), + (LAYER_VERSION_NUMBER, {_s: 0}), + (COMPATIBLE_ARCHITECTURES, 0), + (COMPATIBLE_RUNTIMES, 0), + (LICENSE_INFO, 0), + ), ) -GET_FUNCTION_URL_CONFIG = Schema( - id=ShapeID("com.amazonaws.lambda#GetFunctionUrlConfig"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/2021-10-31/functions/{FunctionName}/url", - "code": 200, - } - ), - ) - ], +PUBLISH_LAYER_VERSION: StaticOperationSchema = ( + 23, + n0, + _PLV, + { + _smithy: MappingProxyType( + { + "method": "POST", + "uri": "/2018-10-31/layers/{LayerName}/versions", + "code": 201, + } + ) + }, + PUBLISH_LAYER_VERSION_INPUT, + PUBLISH_LAYER_VERSION_OUTPUT, + ( + CODE_STORAGE_EXCEEDED_EXCEPTION, + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -GET_POLICY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#GetPolicyInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#GetPolicyRequest", - ) - ], - members={ - "FunctionName": { - "target": NAMESPACED_FUNCTION_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Qualifier": { - "target": NUMERIC_LATEST_PUBLISHED_OR_ALIAS_QUALIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="Qualifier") - ], - }, - }, +REMOVE_LAYER_VERSION_PERMISSION_INPUT: StaticSchema = ( + 18, + n0, + _RLVPI, + {_sSI: _cRLVPR, _sm: None}, + (_LN, _VN, _SI, _RI), + ( + (LAYER_NAME, 9), + (LAYER_VERSION_NUMBER, {_s: None, _smi: None, _sL: None}), + (STATEMENT_ID, 9), + (STRING, {_sQ: _RI}), + ), ) -GET_POLICY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#GetPolicyOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#GetPolicyResponse", - ) - ], - members={"Policy": {"target": STRING}, "RevisionId": {"target": STRING}}, -) - -GET_POLICY = Schema( - id=ShapeID("com.amazonaws.lambda#GetPolicy"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/2015-03-31/functions/{FunctionName}/policy", - "code": 200, - } - ), - ) - ], +REMOVE_LAYER_VERSION_PERMISSION_OUTPUT: StaticSchema = ( + 18, + n0, + _RLVPO, + {_sSI: _sU, _smit: None}, +) + +REMOVE_LAYER_VERSION_PERMISSION: StaticOperationSchema = ( + 23, + n0, + _RLVP, + { + _smithy: MappingProxyType( + { + "method": "DELETE", + "uri": "/2018-10-31/layers/{LayerName}/versions/{VersionNumber}/policy/{StatementId}", + "code": 204, + } + ) + }, + REMOVE_LAYER_VERSION_PERMISSION_INPUT, + REMOVE_LAYER_VERSION_PERMISSION_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + PRECONDITION_FAILED_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -GET_RUNTIME_MANAGEMENT_CONFIG_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#GetRuntimeManagementConfigInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#GetRuntimeManagementConfigRequest", - ) - ], - members={ - "FunctionName": { - "target": NAMESPACED_FUNCTION_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Qualifier": { - "target": NUMERIC_LATEST_PUBLISHED_OR_ALIAS_QUALIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="Qualifier") - ], - }, - }, -) +MAX_FUNCTION_EVENT_INVOKE_CONFIG_LIST_ITEMS: StaticSchema = (7, n0, _MFEICLI, 0) -UPDATE_RUNTIME_ON = Schema.collection( - id=ShapeID("com.amazonaws.lambda#UpdateRuntimeOn"), - shape_type=ShapeType.ENUM, - members={ - "Auto": {"target": UNIT}, - "Manual": {"target": UNIT}, - "FunctionUpdate": {"target": UNIT}, - }, +LIST_FUNCTION_EVENT_INVOKE_CONFIGS_INPUT: StaticSchema = ( + 18, + n0, + _LFEICI, + {_sSI: _cLFEICR, _sm: None}, + (_FN, _Mar, _MI), + ( + (NAMESPACED_FUNCTION_NAME, 9), + (STRING, {_sQ: _Mar}), + (MAX_FUNCTION_EVENT_INVOKE_CONFIG_LIST_ITEMS, {_sQ: _MI}), + ), ) -GET_RUNTIME_MANAGEMENT_CONFIG_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#GetRuntimeManagementConfigOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#GetRuntimeManagementConfigResponse", - ) - ], - members={ - "UpdateRuntimeOn": {"target": UPDATE_RUNTIME_ON}, - "FunctionArn": {"target": NAME_SPACED_FUNCTION_ARN}, - "RuntimeVersionArn": {"target": RUNTIME_VERSION_ARN}, - }, +FUNCTION_EVENT_INVOKE_CONFIG: StaticSchema = ( + 18, + n0, + _FEIC, + 0, + (_LM, _FA, _MRA, _MEAIS, _DCe), + ( + (DATE, 0), + (FUNCTION_ARN, 0), + (MAXIMUM_RETRY_ATTEMPTS, 0), + (MAXIMUM_EVENT_AGE_IN_SECONDS, 0), + (DESTINATION_CONFIG, 0), + ), ) -GET_RUNTIME_MANAGEMENT_CONFIG = Schema( - id=ShapeID("com.amazonaws.lambda#GetRuntimeManagementConfig"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/2021-07-20/functions/{FunctionName}/runtime-management-config", - "code": 200, - } - ), - ) - ], -) - -CODE_ARTIFACT_USER_DELETED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#CodeArtifactUserDeletedException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=409), - ], - members={"Type": {"target": STRING}, "message": {"target": STRING}}, -) - -CODE_ARTIFACT_USER_FAILED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#CodeArtifactUserFailedException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=409), - ], - members={"Type": {"target": STRING}, "message": {"target": STRING}}, -) - -CODE_ARTIFACT_USER_PENDING_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#CodeArtifactUserPendingException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=409), - ], - members={"Type": {"target": STRING}, "message": {"target": STRING}}, -) - -DURABLE_EXECUTION_ALREADY_STARTED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#DurableExecutionAlreadyStartedException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=409), - ], - members={"Type": {"target": STRING}, "Message": {"target": STRING}}, -) - -EC2_ACCESS_DENIED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#EC2AccessDeniedException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="server"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=502), - ], - members={"Type": {"target": STRING}, "Message": {"target": STRING}}, -) - -EC2_THROTTLED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#EC2ThrottledException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="server"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=502), - ], - members={"Type": {"target": STRING}, "Message": {"target": STRING}}, -) - -EC2_UNEXPECTED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#EC2UnexpectedException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="server"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=502), - ], - members={ - "Type": {"target": STRING}, - "Message": {"target": STRING}, - "EC2ErrorCode": {"target": STRING}, - }, +FUNCTION_EVENT_INVOKE_CONFIG_LIST: StaticSchema = ( + 16, + n0, + _FEICL, + 0, + (_me,), + ((FUNCTION_EVENT_INVOKE_CONFIG, 0),), +) + +LIST_FUNCTION_EVENT_INVOKE_CONFIGS_OUTPUT: StaticSchema = ( + 18, + n0, + _LFEICO, + {_sSI: _cLFEICRo, _smit: None}, + (_FEICu, _NM), + ((FUNCTION_EVENT_INVOKE_CONFIG_LIST, 0), (STRING, 0)), +) + +LIST_FUNCTION_EVENT_INVOKE_CONFIGS: StaticOperationSchema = ( + 23, + n0, + _LFEIC, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/2019-09-25/functions/{FunctionName}/event-invoke-config/list", + "code": 200, + } + ) + }, + LIST_FUNCTION_EVENT_INVOKE_CONFIGS_INPUT, + LIST_FUNCTION_EVENT_INVOKE_CONFIGS_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -EFSIO_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#EFSIOException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=410), - ], - members={"Type": {"target": STRING}, "Message": {"target": STRING}}, -) - -EFS_MOUNT_CONNECTIVITY_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#EFSMountConnectivityException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=408), - ], - members={"Type": {"target": STRING}, "Message": {"target": STRING}}, -) - -EFS_MOUNT_FAILURE_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#EFSMountFailureException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=403), - ], - members={"Type": {"target": STRING}, "Message": {"target": STRING}}, -) - -EFS_MOUNT_TIMEOUT_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#EFSMountTimeoutException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=408), - ], - members={"Type": {"target": STRING}, "Message": {"target": STRING}}, -) - -ENI_LIMIT_REACHED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ENILimitReachedException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="server"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=502), - ], - members={"Type": {"target": STRING}, "Message": {"target": STRING}}, -) - -ENI_NOT_READY_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ENINotReadyException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="server"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=502), - ], - members={"Type": {"target": STRING}, "Message": {"target": STRING}}, -) - -INVALID_REQUEST_CONTENT_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#InvalidRequestContentException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"Type": {"target": STRING}, "message": {"target": STRING}}, -) - -INVALID_RUNTIME_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#InvalidRuntimeException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="server"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=502), - ], - members={"Type": {"target": STRING}, "Message": {"target": STRING}}, -) - -INVALID_SECURITY_GROUP_ID_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#InvalidSecurityGroupIDException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="server"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=502), - ], - members={"Type": {"target": STRING}, "Message": {"target": STRING}}, -) - -INVALID_SUBNET_ID_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#InvalidSubnetIDException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="server"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=502), - ], - members={"Type": {"target": STRING}, "Message": {"target": STRING}}, -) - -INVALID_ZIP_FILE_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#InvalidZipFileException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="server"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=502), - ], - members={"Type": {"target": STRING}, "Message": {"target": STRING}}, -) - -INVOCATION_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.lambda#InvocationType"), - shape_type=ShapeType.ENUM, - members={ - "Event": {"target": UNIT}, - "RequestResponse": {"target": UNIT}, - "DryRun": {"target": UNIT}, - }, -) +TAGGABLE_RESOURCE: StaticSchema = (3, n0, _TRa, 0) -LOG_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.lambda#LogType"), - shape_type=ShapeType.ENUM, - members={"None": {"target": UNIT}, "Tail": {"target": UNIT}}, +LIST_TAGS_INPUT: StaticSchema = ( + 18, + n0, + _LTI, + {_sSI: _cLTR, _sm: None}, + (_Reso,), + ((TAGGABLE_RESOURCE, 9),), ) -INVOKE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#InvokeInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#InvocationRequest", - ) - ], - members={ - "FunctionName": { - "target": NAMESPACED_FUNCTION_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "InvocationType": { - "target": INVOCATION_TYPE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), value="X-Amz-Invocation-Type" - ) - ], - }, - "LogType": { - "target": LOG_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="X-Amz-Log-Type") - ], - }, - "ClientContext": { - "target": STRING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), value="X-Amz-Client-Context" - ) - ], - }, - "DurableExecutionName": { - "target": DURABLE_EXECUTION_NAME, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="X-Amz-Durable-Execution-Name", - ) - ], - }, - "Payload": { - "target": BLOB, - "traits": [Trait.new(id=ShapeID("smithy.api#httpPayload"))], - }, - "Qualifier": { - "target": NUMERIC_LATEST_PUBLISHED_OR_ALIAS_QUALIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="Qualifier") - ], - }, - "TenantId": { - "target": TENANT_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="X-Amz-Tenant-Id") - ], - }, - }, +LIST_TAGS_OUTPUT: StaticSchema = ( + 18, + n0, + _LTO, + {_sSI: _cLTRo, _smit: None}, + (_Ta,), + ((TAGS, 0),), ) -INVOKE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#InvokeOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#InvocationResponse", +LIST_TAGS: StaticOperationSchema = ( + 23, + n0, + _LTi, + { + _smithy: MappingProxyType( + {"method": "GET", "uri": "/2017-03-31/tags/{Resource}", "code": 200} ) - ], - members={ - "StatusCode": { - "target": INTEGER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=0), - Trait.new(id=ShapeID("smithy.api#httpResponseCode")), - ], - }, - "FunctionError": { - "target": STRING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), value="X-Amz-Function-Error" - ) - ], - }, - "LogResult": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="X-Amz-Log-Result") - ], - }, - "Payload": { - "target": BLOB, - "traits": [Trait.new(id=ShapeID("smithy.api#httpPayload"))], - }, - "ExecutedVersion": { - "target": VERSION, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), value="X-Amz-Executed-Version" - ) - ], - }, - "DurableExecutionArn": { - "target": DURABLE_EXECUTION_ARN, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="X-Amz-Durable-Execution-Arn", - ) - ], - }, }, + LIST_TAGS_INPUT, + LIST_TAGS_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -MODE_NOT_SUPPORTED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ModeNotSupportedException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"Type": {"target": STRING}, "message": {"target": STRING}}, -) - -NO_PUBLISHED_VERSION_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#NoPublishedVersionException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"Type": {"target": STRING}, "Message": {"target": STRING}}, -) - -RECURSIVE_INVOCATION_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#RecursiveInvocationException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"Type": {"target": STRING}, "Message": {"target": STRING}}, -) - -REQUEST_TOO_LARGE_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#RequestTooLargeException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=413), - ], - members={"Type": {"target": STRING}, "message": {"target": STRING}}, -) - -RESOURCE_NOT_READY_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ResourceNotReadyException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="server"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=502), - ], - members={"Type": {"target": STRING}, "message": {"target": STRING}}, -) - -S3_FILES_MOUNT_CONNECTIVITY_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#S3FilesMountConnectivityException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=408), - ], - members={"Type": {"target": STRING}, "Message": {"target": STRING}}, -) - -S3_FILES_MOUNT_FAILURE_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#S3FilesMountFailureException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=403), - ], - members={"Type": {"target": STRING}, "Message": {"target": STRING}}, -) - -S3_FILES_MOUNT_TIMEOUT_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#S3FilesMountTimeoutException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=408), - ], - members={"Type": {"target": STRING}, "Message": {"target": STRING}}, -) - -SERIALIZED_REQUEST_ENTITY_TOO_LARGE_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#SerializedRequestEntityTooLargeException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=413), - ], - members={"Type": {"target": STRING}, "message": {"target": STRING}}, -) - -SERVICE_QUOTA_EXCEEDED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ServiceQuotaExceededException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=402), - ], - members={"Type": {"target": STRING}, "Message": {"target": STRING}}, -) - -SNAP_START_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#SnapStartException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"Type": {"target": STRING}, "Message": {"target": STRING}}, -) - -SNAP_START_NOT_READY_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#SnapStartNotReadyException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=409), - ], - members={"Type": {"target": STRING}, "Message": {"target": STRING}}, -) - -SNAP_START_REGENERATION_FAILURE_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#SnapStartRegenerationFailureException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=409), - ], - members={"Type": {"target": STRING}, "Message": {"target": STRING}}, -) - -SNAP_START_TIMEOUT_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#SnapStartTimeoutException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=408), - ], - members={"Type": {"target": STRING}, "Message": {"target": STRING}}, -) - -SUBNET_IP_ADDRESS_LIMIT_REACHED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#SubnetIPAddressLimitReachedException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="server"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=502), - ], - members={"Type": {"target": STRING}, "Message": {"target": STRING}}, -) - -UNSUPPORTED_MEDIA_TYPE_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#UnsupportedMediaTypeException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=415), - ], - members={"Type": {"target": STRING}, "message": {"target": STRING}}, -) - -INVOKE = Schema( - id=ShapeID("com.amazonaws.lambda#Invoke"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/2015-03-31/functions/{FunctionName}/invocations", - "code": 200, - } - ), - ) - ], -) +NAMESPACED_STATEMENT_ID: StaticSchema = (3, n0, _NSI, 0) -BLOB_STREAM = Schema( - id=ShapeID("com.amazonaws.lambda#BlobStream"), - shape_type=ShapeType.BLOB, - traits=[Trait.new(id=ShapeID("smithy.api#streaming"))], +REMOVE_PERMISSION_INPUT: StaticSchema = ( + 18, + n0, + _RPI, + {_sSI: _cRPR, _sm: None}, + (_FN, _SI, _Q, _RI), + ( + (NAMESPACED_FUNCTION_NAME, 9), + (NAMESPACED_STATEMENT_ID, 9), + (NUMERIC_LATEST_PUBLISHED_OR_ALIAS_QUALIFIER, {_sQ: _Q}), + (STRING, {_sQ: _RI}), + ), ) -INVOKE_ASYNC_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#InvokeAsyncInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#InvokeAsyncRequest", - ) - ], - members={ - "FunctionName": { - "target": NAMESPACED_FUNCTION_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "InvokeArgs": { - "target": BLOB_STREAM, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpPayload")), - ], - }, - }, +REMOVE_PERMISSION_OUTPUT: StaticSchema = (18, n0, _RPO, {_sSI: _sU, _smit: None}) + +REMOVE_PERMISSION: StaticOperationSchema = ( + 23, + n0, + _RPe, + { + _smithy: MappingProxyType( + { + "method": "DELETE", + "uri": "/2015-03-31/functions/{FunctionName}/policy/{StatementId}", + "code": 204, + } + ) + }, + REMOVE_PERMISSION_INPUT, + REMOVE_PERMISSION_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + PRECONDITION_FAILED_EXCEPTION, + PUBLIC_POLICY_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -HTTP_STATUS = Schema( - id=ShapeID("com.amazonaws.lambda#HttpStatus"), - shape_type=ShapeType.INTEGER, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=0)], +QUALIFIER: StaticSchema = (3, n0, _Q, 0) + +DELETE_PROVISIONED_CONCURRENCY_CONFIG_INPUT: StaticSchema = ( + 18, + n0, + _DPCCI, + {_sSI: _cDPCCR, _sm: None}, + (_FN, _Q), + ((FUNCTION_NAME, 9), (QUALIFIER, {_sQ: _Q, _smi: None})), +) + +DELETE_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT: StaticSchema = ( + 18, + n0, + _DPCCO, + {_sSI: _sU, _smit: None}, +) + +DELETE_PROVISIONED_CONCURRENCY_CONFIG: StaticOperationSchema = ( + 23, + n0, + _DPCC, + { + _smithy: MappingProxyType( + { + "method": "DELETE", + "uri": "/2019-09-30/functions/{FunctionName}/provisioned-concurrency", + "code": 204, + } + ) + }, + DELETE_PROVISIONED_CONCURRENCY_CONFIG_INPUT, + DELETE_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -INVOKE_ASYNC_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#InvokeAsyncOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#InvokeAsyncResponse", - ) - ], - members={ - "Status": { - "target": HTTP_STATUS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=0), - Trait.new(id=ShapeID("smithy.api#httpResponseCode")), - ], - } - }, +GET_PROVISIONED_CONCURRENCY_CONFIG_INPUT: StaticSchema = ( + 18, + n0, + _GPCCI, + {_sSI: _cGPCCR, _sm: None}, + (_FN, _Q), + ((FUNCTION_NAME, 9), (QUALIFIER, {_sQ: _Q, _smi: None})), +) + +GET_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT: StaticSchema = ( + 18, + n0, + _GPCCO, + {_sSI: _cGPCCRo, _smit: None}, + (_RPCE, _APCE, _APCEl, _Stat, _SRt, _LM), + ( + (POSITIVE_INTEGER, 0), + (NON_NEGATIVE_INTEGER, 0), + (NON_NEGATIVE_INTEGER, 0), + (PROVISIONED_CONCURRENCY_STATUS_ENUM, 0), + (STRING, 0), + (TIMESTAMP, 0), + ), ) -INVOKE_ASYNC = Schema( - id=ShapeID("com.amazonaws.lambda#InvokeAsync"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/2014-11-13/functions/{FunctionName}/invoke-async", - "code": 202, - } - ), - ) - ], +PROVISIONED_CONCURRENCY_CONFIG_NOT_FOUND_EXCEPTION: StaticSchema = ( + 18, + n0, + _PCCNFE, + {_smith: _c, _sE: 404}, + (_T, _m), + ((STRING, 0), (STRING, 0)), +) + +GET_PROVISIONED_CONCURRENCY_CONFIG: StaticOperationSchema = ( + 23, + n0, + _GPCC, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/2019-09-30/functions/{FunctionName}/provisioned-concurrency", + "code": 200, + } + ) + }, + GET_PROVISIONED_CONCURRENCY_CONFIG_INPUT, + GET_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + PROVISIONED_CONCURRENCY_CONFIG_NOT_FOUND_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -RESPONSE_STREAMING_INVOCATION_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ResponseStreamingInvocationType"), - shape_type=ShapeType.ENUM, - members={"RequestResponse": {"target": UNIT}, "DryRun": {"target": UNIT}}, +PUT_PROVISIONED_CONCURRENCY_CONFIG_INPUT: StaticSchema = ( + 18, + n0, + _PPCCI, + {_sSI: _cPPCCR, _sm: None}, + (_FN, _Q, _PCE), + ((FUNCTION_NAME, 9), (QUALIFIER, {_sQ: _Q, _smi: None}), (POSITIVE_INTEGER, 1)), +) + +PUT_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT: StaticSchema = ( + 18, + n0, + _PPCCO, + {_sSI: _cPPCCRo, _smit: None}, + (_RPCE, _APCEl, _APCE, _Stat, _SRt, _LM), + ( + (POSITIVE_INTEGER, 0), + (NON_NEGATIVE_INTEGER, 0), + (NON_NEGATIVE_INTEGER, 0), + (PROVISIONED_CONCURRENCY_STATUS_ENUM, 0), + (STRING, 0), + (TIMESTAMP, 0), + ), ) -INVOKE_WITH_RESPONSE_STREAM_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#InvokeWithResponseStreamInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#InvokeWithResponseStreamRequest", - ) - ], - members={ - "FunctionName": { - "target": NAMESPACED_FUNCTION_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "LogType": { - "target": LOG_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="X-Amz-Log-Type") - ], - }, - "ClientContext": { - "target": STRING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), value="X-Amz-Client-Context" - ) - ], - }, - "Qualifier": { - "target": NUMERIC_LATEST_PUBLISHED_OR_ALIAS_QUALIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="Qualifier") - ], - }, - "Payload": { - "target": BLOB, - "traits": [Trait.new(id=ShapeID("smithy.api#httpPayload"))], - }, - "TenantId": { - "target": TENANT_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="X-Amz-Tenant-Id") - ], - }, - "InvocationType": { - "target": RESPONSE_STREAMING_INVOCATION_TYPE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), value="X-Amz-Invocation-Type" - ) - ], - }, - }, +PUT_PROVISIONED_CONCURRENCY_CONFIG: StaticOperationSchema = ( + 23, + n0, + _PPCC, + { + _smithy: MappingProxyType( + { + "method": "PUT", + "uri": "/2019-09-30/functions/{FunctionName}/provisioned-concurrency", + "code": 202, + } + ) + }, + PUT_PROVISIONED_CONCURRENCY_CONFIG_INPUT, + PUT_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -INVOKE_WITH_RESPONSE_STREAM_COMPLETE_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#InvokeWithResponseStreamCompleteEvent"), - members={ - "ErrorCode": {"target": STRING}, - "ErrorDetails": {"target": STRING}, - "LogResult": {"target": STRING}, - }, +PUT_FUNCTION_EVENT_INVOKE_CONFIG_INPUT: StaticSchema = ( + 18, + n0, + _PFEICI, + {_sSI: _cPFEICR, _sm: None}, + (_FN, _Q, _MRA, _MEAIS, _DCe), + ( + (NAMESPACED_FUNCTION_NAME, 9), + (NUMERIC_LATEST_PUBLISHED_OR_ALIAS_QUALIFIER, {_sQ: _Q}), + (MAXIMUM_RETRY_ATTEMPTS, 0), + (MAXIMUM_EVENT_AGE_IN_SECONDS, 0), + (DESTINATION_CONFIG, 0), + ), ) -INVOKE_RESPONSE_STREAM_UPDATE = Schema.collection( - id=ShapeID("com.amazonaws.lambda#InvokeResponseStreamUpdate"), - members={ - "Payload": { - "target": BLOB, - "traits": [Trait.new(id=ShapeID("smithy.api#eventPayload"))], - } - }, +PUT_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT: StaticSchema = ( + 18, + n0, + _PFEICO, + {_sSI: _cFEIC, _smit: None}, + (_LM, _FA, _MRA, _MEAIS, _DCe), + ( + (DATE, 0), + (FUNCTION_ARN, 0), + (MAXIMUM_RETRY_ATTEMPTS, 0), + (MAXIMUM_EVENT_AGE_IN_SECONDS, 0), + (DESTINATION_CONFIG, 0), + ), ) -INVOKE_WITH_RESPONSE_STREAM_RESPONSE_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#InvokeWithResponseStreamResponseEvent"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#streaming"))], - members={ - "PayloadChunk": {"target": INVOKE_RESPONSE_STREAM_UPDATE}, - "InvokeComplete": {"target": INVOKE_WITH_RESPONSE_STREAM_COMPLETE_EVENT}, - }, +PUT_FUNCTION_EVENT_INVOKE_CONFIG: StaticOperationSchema = ( + 23, + n0, + _PFEIC, + { + _smithy: MappingProxyType( + { + "method": "PUT", + "uri": "/2019-09-25/functions/{FunctionName}/event-invoke-config", + "code": 200, + } + ) + }, + PUT_FUNCTION_EVENT_INVOKE_CONFIG_INPUT, + PUT_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -INVOKE_WITH_RESPONSE_STREAM_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#InvokeWithResponseStreamOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#InvokeWithResponseStreamResponse", - ) - ], - members={ - "StatusCode": { - "target": INTEGER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=0), - Trait.new(id=ShapeID("smithy.api#httpResponseCode")), - ], - }, - "ExecutedVersion": { - "target": VERSION, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), value="X-Amz-Executed-Version" - ) - ], - }, - "EventStream": { - "target": INVOKE_WITH_RESPONSE_STREAM_RESPONSE_EVENT, - "traits": [Trait.new(id=ShapeID("smithy.api#httpPayload"))], - }, - "ResponseStreamContentType": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="Content-Type") - ], - }, - }, +PUT_RESOURCE_POLICY_INPUT: StaticSchema = ( + 18, + n0, + _PRPI, + {_sSI: _cPRPR, _sm: None}, + (_RAe, _Po, _RI), + ((POLICY_RESOURCE_ARN, 9), (RESOURCE_POLICY, 1), (REVISION_ID, 0)), +) + +PUT_RESOURCE_POLICY_OUTPUT: StaticSchema = ( + 18, + n0, + _PRPO, + {_sSI: _cPRPRo, _smit: None}, + (_Po, _RI), + ((RESOURCE_POLICY, 0), (REVISION_ID, 0)), +) + +PUT_RESOURCE_POLICY: StaticOperationSchema = ( + 23, + n0, + _PRP, + { + _smithy: MappingProxyType( + { + "method": "PUT", + "uri": "/2026-07-09/resource-policy/{ResourceArn}", + "code": 200, + } + ) + }, + PUT_RESOURCE_POLICY_INPUT, + PUT_RESOURCE_POLICY_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + POLICY_LENGTH_EXCEEDED_EXCEPTION, + PRECONDITION_FAILED_EXCEPTION, + PUBLIC_POLICY_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -INVOKE_WITH_RESPONSE_STREAM = Schema( - id=ShapeID("com.amazonaws.lambda#InvokeWithResponseStream"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/2021-11-15/functions/{FunctionName}/response-streaming-invocations", - "code": 200, - } - ), - ) - ], +CALLBACK_TIMEOUT_EXCEPTION: StaticSchema = ( + 18, + n0, + _CTE, + {_smith: _c, _sE: 400}, + (_T, _M), + ((STRING, 0), (STRING, 0)), +) + +SEND_DURABLE_EXECUTION_CALLBACK_FAILURE_INPUT: StaticSchema = ( + 18, + n0, + _SDECFI, + {_sSI: _cSDECFR, _sm: None}, + (_CIa, _E), + ((CALLBACK_ID, 9), (ERROR_OBJECT, 16)), +) + +SEND_DURABLE_EXECUTION_CALLBACK_FAILURE_OUTPUT: StaticSchema = ( + 18, + n0, + _SDECFO, + {_sSI: _cSDECFRo, _smit: None}, +) + +SEND_DURABLE_EXECUTION_CALLBACK_FAILURE: StaticOperationSchema = ( + 23, + n0, + _SDECF, + { + _smithy: MappingProxyType( + { + "method": "POST", + "uri": "/2025-12-01/durable-execution-callbacks/{CallbackId}/fail", + } + ) + }, + SEND_DURABLE_EXECUTION_CALLBACK_FAILURE_INPUT, + SEND_DURABLE_EXECUTION_CALLBACK_FAILURE_OUTPUT, + ( + CALLBACK_TIMEOUT_EXCEPTION, + INVALID_PARAMETER_VALUE_EXCEPTION, + KMS_ACCESS_DENIED_EXCEPTION, + KMS_DISABLED_EXCEPTION, + KMS_INVALID_STATE_EXCEPTION, + KMS_NOT_FOUND_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -EXECUTION_STATUS_LIST = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ExecutionStatusList"), - shape_type=ShapeType.LIST, - members={"member": {"target": EXECUTION_STATUS}}, +SEND_DURABLE_EXECUTION_CALLBACK_HEARTBEAT_INPUT: StaticSchema = ( + 18, + n0, + _SDECHI, + {_sSI: _cSDECHR, _sm: None}, + (_CIa,), + ((CALLBACK_ID, 9),), +) + +SEND_DURABLE_EXECUTION_CALLBACK_HEARTBEAT_OUTPUT: StaticSchema = ( + 18, + n0, + _SDECHO, + {_sSI: _cSDECHRo, _smit: None}, +) + +SEND_DURABLE_EXECUTION_CALLBACK_HEARTBEAT: StaticOperationSchema = ( + 23, + n0, + _SDECH, + { + _smithy: MappingProxyType( + { + "method": "POST", + "uri": "/2025-12-01/durable-execution-callbacks/{CallbackId}/heartbeat", + } + ) + }, + SEND_DURABLE_EXECUTION_CALLBACK_HEARTBEAT_INPUT, + SEND_DURABLE_EXECUTION_CALLBACK_HEARTBEAT_OUTPUT, + ( + CALLBACK_TIMEOUT_EXCEPTION, + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -LIST_DURABLE_EXECUTIONS_BY_FUNCTION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ListDurableExecutionsByFunctionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#ListDurableExecutionsByFunctionRequest", - ) - ], - members={ - "FunctionName": { - "target": NAMESPACED_FUNCTION_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Qualifier": { - "target": NUMERIC_LATEST_PUBLISHED_OR_ALIAS_QUALIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="Qualifier") - ], - }, - "DurableExecutionName": { - "target": DURABLE_EXECUTION_NAME, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpQuery"), value="DurableExecutionName" - ) - ], - }, - "Statuses": { - "target": EXECUTION_STATUS_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="Statuses")], - }, - "StartedAfter": { - "target": EXECUTION_TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="StartedAfter") - ], - }, - "StartedBefore": { - "target": EXECUTION_TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="StartedBefore") - ], - }, - "ReverseOrder": { - "target": REVERSE_ORDER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="ReverseOrder") - ], - }, - "Marker": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="Marker")], - }, - "MaxItems": { - "target": ITEM_COUNT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=0), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="MaxItems"), - ], - }, - }, +BINARY_OPERATION_PAYLOAD: StaticSchema = (1, n0, _BOP, 4) + +SEND_DURABLE_EXECUTION_CALLBACK_SUCCESS_INPUT: StaticSchema = ( + 18, + n0, + _SDECSI, + {_sSI: _cSDECSR, _sm: None}, + (_CIa, _Re), + ((CALLBACK_ID, 9), (BINARY_OPERATION_PAYLOAD, 16)), +) + +SEND_DURABLE_EXECUTION_CALLBACK_SUCCESS_OUTPUT: StaticSchema = ( + 18, + n0, + _SDECSO, + {_sSI: _cSDECSRo, _smit: None}, +) + +SEND_DURABLE_EXECUTION_CALLBACK_SUCCESS: StaticOperationSchema = ( + 23, + n0, + _SDECS, + { + _smithy: MappingProxyType( + { + "method": "POST", + "uri": "/2025-12-01/durable-execution-callbacks/{CallbackId}/succeed", + } + ) + }, + SEND_DURABLE_EXECUTION_CALLBACK_SUCCESS_INPUT, + SEND_DURABLE_EXECUTION_CALLBACK_SUCCESS_OUTPUT, + ( + CALLBACK_TIMEOUT_EXCEPTION, + INVALID_PARAMETER_VALUE_EXCEPTION, + KMS_ACCESS_DENIED_EXCEPTION, + KMS_DISABLED_EXCEPTION, + KMS_INVALID_STATE_EXCEPTION, + KMS_NOT_FOUND_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -EXECUTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#Execution"), - members={ - "DurableExecutionArn": { - "target": DURABLE_EXECUTION_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "DurableExecutionName": { - "target": DURABLE_EXECUTION_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "FunctionArn": { - "target": NAME_SPACED_FUNCTION_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Status": { - "target": EXECUTION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "StartTimestamp": { - "target": EXECUTION_TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "EndTimestamp": {"target": EXECUTION_TIMESTAMP}, - "KMSKeyArn": {"target": KMS_KEY_ARN}, - }, +TAG_RESOURCE_INPUT: StaticSchema = ( + 18, + n0, + _TRI, + {_sSI: _cTRR, _sm: None}, + (_Reso, _Ta), + ((TAGGABLE_RESOURCE, 9), (TAGS, 1)), ) -DURABLE_EXECUTIONS = Schema.collection( - id=ShapeID("com.amazonaws.lambda#DurableExecutions"), - shape_type=ShapeType.LIST, - members={"member": {"target": EXECUTION}}, -) +TAG_RESOURCE_OUTPUT: StaticSchema = (18, n0, _TRO, {_sSI: _sU, _smit: None}) -LIST_DURABLE_EXECUTIONS_BY_FUNCTION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ListDurableExecutionsByFunctionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#ListDurableExecutionsByFunctionResponse", +TAG_RESOURCE: StaticOperationSchema = ( + 23, + n0, + _TRag, + { + _smithy: MappingProxyType( + {"method": "POST", "uri": "/2017-03-31/tags/{Resource}", "code": 204} ) - ], - members={ - "DurableExecutions": {"target": DURABLE_EXECUTIONS}, - "NextMarker": {"target": STRING}, }, + TAG_RESOURCE_INPUT, + TAG_RESOURCE_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -LIST_DURABLE_EXECUTIONS_BY_FUNCTION = Schema( - id=ShapeID("com.amazonaws.lambda#ListDurableExecutionsByFunction"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/2025-12-01/functions/{FunctionName}/durable-executions", - "code": 200, - } - ), - ) - ], -) +TAG_KEY_LIST: StaticSchema = (16, n0, _TKL, 0, (_me,), ((TAG_KEY, {_sN: _K}),)) -FUNCTION_VERSION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#FunctionVersion"), - shape_type=ShapeType.ENUM, - members={"ALL": {"target": UNIT}}, +UNTAG_RESOURCE_INPUT: StaticSchema = ( + 18, + n0, + _URIn, + {_sSI: _cURR, _sm: None}, + (_Reso, _TKa), + ((TAGGABLE_RESOURCE, 9), (TAG_KEY_LIST, {_sQ: _tK, _smi: None})), ) -MASTER_REGION = Schema( - id=ShapeID("com.amazonaws.lambda#MasterRegion"), shape_type=ShapeType.STRING -) +UNTAG_RESOURCE_OUTPUT: StaticSchema = (18, n0, _UROn, {_sSI: _sU, _smit: None}) -LIST_FUNCTIONS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ListFunctionsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#ListFunctionsRequest", +UNTAG_RESOURCE: StaticOperationSchema = ( + 23, + n0, + _UR, + { + _smithy: MappingProxyType( + {"method": "DELETE", "uri": "/2017-03-31/tags/{Resource}", "code": 204} ) - ], - members={ - "MasterRegion": { - "target": MASTER_REGION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="MasterRegion") - ], - }, - "FunctionVersion": { - "target": FUNCTION_VERSION, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="FunctionVersion") - ], - }, - "Marker": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="Marker")], - }, - "MaxItems": { - "target": MAX_LIST_ITEMS, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="MaxItems")], - }, }, + UNTAG_RESOURCE_INPUT, + UNTAG_RESOURCE_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -FUNCTION_LIST = Schema.collection( - id=ShapeID("com.amazonaws.lambda#FunctionList"), - shape_type=ShapeType.LIST, - members={"member": {"target": FUNCTION_CONFIGURATION}}, -) - -LIST_FUNCTIONS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ListFunctionsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#ListFunctionsResponse", - ) - ], - members={"NextMarker": {"target": STRING}, "Functions": {"target": FUNCTION_LIST}}, -) - -LIST_FUNCTIONS = Schema( - id=ShapeID("com.amazonaws.lambda#ListFunctions"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/2015-03-31/functions", "code": 200} - ), - ) - ], -) - -MAX_ITEMS = Schema( - id=ShapeID("com.amazonaws.lambda#MaxItems"), shape_type=ShapeType.INTEGER +UPDATE_FUNCTION_EVENT_INVOKE_CONFIG_INPUT: StaticSchema = ( + 18, + n0, + _UFEICI, + {_sSI: _cUFEICR, _sm: None}, + (_FN, _Q, _MRA, _MEAIS, _DCe), + ( + (NAMESPACED_FUNCTION_NAME, 9), + (NUMERIC_LATEST_PUBLISHED_OR_ALIAS_QUALIFIER, {_sQ: _Q}), + (MAXIMUM_RETRY_ATTEMPTS, 0), + (MAXIMUM_EVENT_AGE_IN_SECONDS, 0), + (DESTINATION_CONFIG, 0), + ), ) -LIST_FUNCTION_URL_CONFIGS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ListFunctionUrlConfigsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#ListFunctionUrlConfigsRequest", - ) - ], - members={ - "FunctionName": { - "target": FUNCTION_URL_FUNCTION_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Marker": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="Marker")], - }, - "MaxItems": { - "target": MAX_ITEMS, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="MaxItems")], - }, - }, +UPDATE_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT: StaticSchema = ( + 18, + n0, + _UFEICO, + {_sSI: _cFEIC, _smit: None}, + (_LM, _FA, _MRA, _MEAIS, _DCe), + ( + (DATE, 0), + (FUNCTION_ARN, 0), + (MAXIMUM_RETRY_ATTEMPTS, 0), + (MAXIMUM_EVENT_AGE_IN_SECONDS, 0), + (DESTINATION_CONFIG, 0), + ), ) -FUNCTION_URL_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.lambda#FunctionUrlConfig"), - members={ - "FunctionUrl": { - "target": FUNCTION_URL, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "FunctionArn": { - "target": FUNCTION_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "CreationTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "LastModifiedTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Cors": {"target": CORS}, - "AuthType": { - "target": FUNCTION_URL_AUTH_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "InvokeMode": {"target": INVOKE_MODE}, - }, +UPDATE_FUNCTION_EVENT_INVOKE_CONFIG: StaticOperationSchema = ( + 23, + n0, + _UFEIC, + { + _smithy: MappingProxyType( + { + "method": "POST", + "uri": "/2019-09-25/functions/{FunctionName}/event-invoke-config", + "code": 200, + } + ) + }, + UPDATE_FUNCTION_EVENT_INVOKE_CONFIG_INPUT, + UPDATE_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT, + ( + INVALID_PARAMETER_VALUE_EXCEPTION, + RESOURCE_CONFLICT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_EXCEPTION, + TOO_MANY_REQUESTS_EXCEPTION, + ), ) -FUNCTION_URL_CONFIG_LIST = Schema.collection( - id=ShapeID("com.amazonaws.lambda#FunctionUrlConfigList"), - shape_type=ShapeType.LIST, - members={"member": {"target": FUNCTION_URL_CONFIG}}, -) - -LIST_FUNCTION_URL_CONFIGS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ListFunctionUrlConfigsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#ListFunctionUrlConfigsResponse", - ) - ], - members={ - "FunctionUrlConfigs": { - "target": FUNCTION_URL_CONFIG_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "NextMarker": {"target": STRING}, - }, -) - -LIST_FUNCTION_URL_CONFIGS = Schema( - id=ShapeID("com.amazonaws.lambda#ListFunctionUrlConfigs"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/2021-10-31/functions/{FunctionName}/urls", - "code": 200, - } - ), - ) - ], -) - -MAX_PROVISIONED_CONCURRENCY_CONFIG_LIST_ITEMS = Schema( - id=ShapeID("com.amazonaws.lambda#MaxProvisionedConcurrencyConfigListItems"), - shape_type=ShapeType.INTEGER, -) - -LIST_PROVISIONED_CONCURRENCY_CONFIGS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ListProvisionedConcurrencyConfigsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#ListProvisionedConcurrencyConfigsRequest", - ) - ], - members={ - "FunctionName": { - "target": FUNCTION_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Marker": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="Marker")], - }, - "MaxItems": { - "target": MAX_PROVISIONED_CONCURRENCY_CONFIG_LIST_ITEMS, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="MaxItems")], - }, - }, -) - -NON_NEGATIVE_INTEGER = Schema( - id=ShapeID("com.amazonaws.lambda#NonNegativeInteger"), shape_type=ShapeType.INTEGER -) - -POSITIVE_INTEGER = Schema( - id=ShapeID("com.amazonaws.lambda#PositiveInteger"), shape_type=ShapeType.INTEGER -) - -PROVISIONED_CONCURRENCY_STATUS_ENUM = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ProvisionedConcurrencyStatusEnum"), - shape_type=ShapeType.ENUM, - members={ - "IN_PROGRESS": {"target": UNIT}, - "READY": {"target": UNIT}, - "FAILED": {"target": UNIT}, - }, -) - -PROVISIONED_CONCURRENCY_CONFIG_LIST_ITEM = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ProvisionedConcurrencyConfigListItem"), - members={ - "FunctionArn": {"target": FUNCTION_ARN}, - "RequestedProvisionedConcurrentExecutions": {"target": POSITIVE_INTEGER}, - "AvailableProvisionedConcurrentExecutions": {"target": NON_NEGATIVE_INTEGER}, - "AllocatedProvisionedConcurrentExecutions": {"target": NON_NEGATIVE_INTEGER}, - "Status": {"target": PROVISIONED_CONCURRENCY_STATUS_ENUM}, - "StatusReason": {"target": STRING}, - "LastModified": {"target": TIMESTAMP}, - }, -) - -PROVISIONED_CONCURRENCY_CONFIG_LIST = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ProvisionedConcurrencyConfigList"), - shape_type=ShapeType.LIST, - members={"member": {"target": PROVISIONED_CONCURRENCY_CONFIG_LIST_ITEM}}, -) - -LIST_PROVISIONED_CONCURRENCY_CONFIGS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ListProvisionedConcurrencyConfigsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#ListProvisionedConcurrencyConfigsResponse", - ) - ], - members={ - "ProvisionedConcurrencyConfigs": { - "target": PROVISIONED_CONCURRENCY_CONFIG_LIST - }, - "NextMarker": {"target": STRING}, - }, -) - -LIST_PROVISIONED_CONCURRENCY_CONFIGS = Schema( - id=ShapeID("com.amazonaws.lambda#ListProvisionedConcurrencyConfigs"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/2019-09-30/functions/{FunctionName}/provisioned-concurrency?List=ALL", - "code": 200, - } - ), - ) - ], -) - -PUT_FUNCTION_CODE_SIGNING_CONFIG_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#PutFunctionCodeSigningConfigInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#PutFunctionCodeSigningConfigRequest", - ) - ], - members={ - "CodeSigningConfigArn": { - "target": CODE_SIGNING_CONFIG_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "FunctionName": { - "target": NAMESPACED_FUNCTION_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -PUT_FUNCTION_CODE_SIGNING_CONFIG_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#PutFunctionCodeSigningConfigOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#PutFunctionCodeSigningConfigResponse", - ) - ], - members={ - "CodeSigningConfigArn": { - "target": CODE_SIGNING_CONFIG_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "FunctionName": { - "target": FUNCTION_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -PUT_FUNCTION_CODE_SIGNING_CONFIG = Schema( - id=ShapeID("com.amazonaws.lambda#PutFunctionCodeSigningConfig"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PUT", - "uri": "/2020-06-30/functions/{FunctionName}/code-signing-config", - "code": 200, - } - ), - ) - ], -) - -PUT_FUNCTION_CONCURRENCY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#PutFunctionConcurrencyInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#PutFunctionConcurrencyRequest", - ) - ], - members={ - "FunctionName": { - "target": FUNCTION_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "ReservedConcurrentExecutions": { - "target": RESERVED_CONCURRENT_EXECUTIONS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -PUT_FUNCTION_CONCURRENCY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#PutFunctionConcurrencyOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#Concurrency", - ) - ], - members={ - "ReservedConcurrentExecutions": {"target": RESERVED_CONCURRENT_EXECUTIONS} - }, -) - -PUT_FUNCTION_CONCURRENCY = Schema( - id=ShapeID("com.amazonaws.lambda#PutFunctionConcurrency"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PUT", - "uri": "/2017-10-31/functions/{FunctionName}/concurrency", - "code": 200, - } - ), - ) - ], -) - -PUT_FUNCTION_RECURSION_CONFIG_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#PutFunctionRecursionConfigInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#PutFunctionRecursionConfigRequest", - ) - ], - members={ - "FunctionName": { - "target": UNQUALIFIED_FUNCTION_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "RecursiveLoop": { - "target": RECURSIVE_LOOP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -PUT_FUNCTION_RECURSION_CONFIG_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#PutFunctionRecursionConfigOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#PutFunctionRecursionConfigResponse", - ) - ], - members={"RecursiveLoop": {"target": RECURSIVE_LOOP}}, -) - -PUT_FUNCTION_RECURSION_CONFIG = Schema( - id=ShapeID("com.amazonaws.lambda#PutFunctionRecursionConfig"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PUT", - "uri": "/2024-08-31/functions/{FunctionName}/recursion-config", - "code": 200, - } - ), - ) - ], -) - -PUT_FUNCTION_SCALING_CONFIG_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#PutFunctionScalingConfigInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#PutFunctionScalingConfigRequest", - ) - ], - members={ - "FunctionName": { - "target": UNQUALIFIED_FUNCTION_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Qualifier": { - "target": PUBLISHED_FUNCTION_QUALIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="Qualifier"), - ], - }, - "FunctionScalingConfig": {"target": FUNCTION_SCALING_CONFIG}, - }, -) - -PUT_FUNCTION_SCALING_CONFIG_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#PutFunctionScalingConfigOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#PutFunctionScalingConfigResponse", - ) - ], - members={"FunctionState": {"target": STATE}}, -) - -PUT_FUNCTION_SCALING_CONFIG = Schema( - id=ShapeID("com.amazonaws.lambda#PutFunctionScalingConfig"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PUT", - "uri": "/2025-11-30/functions/{FunctionName}/function-scaling-config", - "code": 202, - } - ), - ) - ], -) - -PUT_RUNTIME_MANAGEMENT_CONFIG_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#PutRuntimeManagementConfigInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#PutRuntimeManagementConfigRequest", - ) - ], - members={ - "FunctionName": { - "target": NAMESPACED_FUNCTION_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Qualifier": { - "target": NUMERIC_LATEST_PUBLISHED_OR_ALIAS_QUALIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="Qualifier") - ], - }, - "UpdateRuntimeOn": { - "target": UPDATE_RUNTIME_ON, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "RuntimeVersionArn": {"target": RUNTIME_VERSION_ARN}, - }, -) - -PUT_RUNTIME_MANAGEMENT_CONFIG_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#PutRuntimeManagementConfigOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#PutRuntimeManagementConfigResponse", - ) - ], - members={ - "UpdateRuntimeOn": { - "target": UPDATE_RUNTIME_ON, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "FunctionArn": { - "target": FUNCTION_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "RuntimeVersionArn": {"target": RUNTIME_VERSION_ARN}, - }, -) - -PUT_RUNTIME_MANAGEMENT_CONFIG = Schema( - id=ShapeID("com.amazonaws.lambda#PutRuntimeManagementConfig"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PUT", - "uri": "/2021-07-20/functions/{FunctionName}/runtime-management-config", - "code": 200, - } - ), - ) - ], -) - -UPDATE_FUNCTION_CODE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#UpdateFunctionCodeInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#UpdateFunctionCodeRequest", - ) - ], - members={ - "FunctionName": { - "target": FUNCTION_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "ZipFile": {"target": BLOB}, - "S3Bucket": {"target": S3_BUCKET}, - "S3Key": {"target": S3_KEY}, - "S3ObjectVersion": {"target": S3_OBJECT_VERSION}, - "S3ObjectStorageMode": {"target": S3_OBJECT_STORAGE_MODE}, - "ImageUri": {"target": STRING}, - "Architectures": {"target": ARCHITECTURES_LIST}, - "Publish": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "PublishTo": {"target": FUNCTION_VERSION_LATEST_PUBLISHED}, - "DryRun": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "RevisionId": {"target": STRING}, - "SourceKMSKeyArn": {"target": KMS_KEY_ARN}, - }, -) - -UPDATE_FUNCTION_CODE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#UpdateFunctionCodeOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#FunctionConfiguration", - ) - ], - members={ - "FunctionName": {"target": NAMESPACED_FUNCTION_NAME}, - "FunctionArn": {"target": NAME_SPACED_FUNCTION_ARN}, - "Runtime": {"target": RUNTIME}, - "Role": {"target": ROLE_ARN}, - "Handler": {"target": HANDLER}, - "CodeSize": { - "target": LONG, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "Description": {"target": DESCRIPTION}, - "Timeout": {"target": TIMEOUT}, - "MemorySize": {"target": MEMORY_SIZE}, - "LastModified": {"target": TIMESTAMP}, - "CodeSha256": {"target": STRING}, - "Version": {"target": VERSION}, - "VpcConfig": {"target": VPC_CONFIG_RESPONSE}, - "DeadLetterConfig": {"target": DEAD_LETTER_CONFIG}, - "Environment": {"target": ENVIRONMENT_RESPONSE}, - "KMSKeyArn": {"target": KMS_KEY_ARN}, - "TracingConfig": {"target": TRACING_CONFIG_RESPONSE}, - "MasterArn": {"target": FUNCTION_ARN}, - "RevisionId": {"target": STRING}, - "Layers": {"target": LAYERS_REFERENCE_LIST}, - "State": {"target": STATE}, - "StateReason": {"target": STATE_REASON}, - "StateReasonCode": {"target": STATE_REASON_CODE}, - "LastUpdateStatus": {"target": LAST_UPDATE_STATUS}, - "LastUpdateStatusReason": {"target": LAST_UPDATE_STATUS_REASON}, - "LastUpdateStatusReasonCode": {"target": LAST_UPDATE_STATUS_REASON_CODE}, - "FileSystemConfigs": {"target": FILE_SYSTEM_CONFIG_LIST}, - "SigningProfileVersionArn": {"target": ARN}, - "SigningJobArn": {"target": ARN}, - "PackageType": {"target": PACKAGE_TYPE}, - "ImageConfigResponse": {"target": IMAGE_CONFIG_RESPONSE}, - "Architectures": {"target": ARCHITECTURES_LIST}, - "EphemeralStorage": {"target": EPHEMERAL_STORAGE}, - "SnapStart": {"target": SNAP_START_RESPONSE}, - "RuntimeVersionConfig": {"target": RUNTIME_VERSION_CONFIG}, - "LoggingConfig": {"target": LOGGING_CONFIG}, - "TenancyConfig": {"target": TENANCY_CONFIG}, - "CapacityProviderConfig": {"target": CAPACITY_PROVIDER_CONFIG}, - "ConfigSha256": {"target": STRING}, - "DurableConfig": {"target": DURABLE_CONFIG}, - }, -) - -UPDATE_FUNCTION_CODE = Schema( - id=ShapeID("com.amazonaws.lambda#UpdateFunctionCode"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PUT", - "uri": "/2015-03-31/functions/{FunctionName}/code", - "code": 200, - } - ), - ) - ], -) - -UPDATE_FUNCTION_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#UpdateFunctionConfigurationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#UpdateFunctionConfigurationRequest", - ) - ], - members={ - "FunctionName": { - "target": FUNCTION_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Role": {"target": ROLE_ARN}, - "Handler": {"target": HANDLER}, - "Description": {"target": DESCRIPTION}, - "Timeout": {"target": TIMEOUT}, - "MemorySize": {"target": MEMORY_SIZE}, - "VpcConfig": {"target": VPC_CONFIG}, - "Environment": {"target": ENVIRONMENT}, - "Runtime": {"target": RUNTIME}, - "DeadLetterConfig": {"target": DEAD_LETTER_CONFIG}, - "KMSKeyArn": {"target": KMS_KEY_ARN}, - "TracingConfig": {"target": TRACING_CONFIG}, - "RevisionId": {"target": STRING}, - "Layers": {"target": LAYER_LIST}, - "FileSystemConfigs": {"target": FILE_SYSTEM_CONFIG_LIST}, - "ImageConfig": {"target": IMAGE_CONFIG}, - "EphemeralStorage": {"target": EPHEMERAL_STORAGE}, - "SnapStart": {"target": SNAP_START}, - "LoggingConfig": {"target": LOGGING_CONFIG}, - "CapacityProviderConfig": {"target": CAPACITY_PROVIDER_CONFIG}, - "DurableConfig": {"target": DURABLE_CONFIG}, - }, -) - -UPDATE_FUNCTION_CONFIGURATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#UpdateFunctionConfigurationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#FunctionConfiguration", - ) - ], - members={ - "FunctionName": {"target": NAMESPACED_FUNCTION_NAME}, - "FunctionArn": {"target": NAME_SPACED_FUNCTION_ARN}, - "Runtime": {"target": RUNTIME}, - "Role": {"target": ROLE_ARN}, - "Handler": {"target": HANDLER}, - "CodeSize": { - "target": LONG, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "Description": {"target": DESCRIPTION}, - "Timeout": {"target": TIMEOUT}, - "MemorySize": {"target": MEMORY_SIZE}, - "LastModified": {"target": TIMESTAMP}, - "CodeSha256": {"target": STRING}, - "Version": {"target": VERSION}, - "VpcConfig": {"target": VPC_CONFIG_RESPONSE}, - "DeadLetterConfig": {"target": DEAD_LETTER_CONFIG}, - "Environment": {"target": ENVIRONMENT_RESPONSE}, - "KMSKeyArn": {"target": KMS_KEY_ARN}, - "TracingConfig": {"target": TRACING_CONFIG_RESPONSE}, - "MasterArn": {"target": FUNCTION_ARN}, - "RevisionId": {"target": STRING}, - "Layers": {"target": LAYERS_REFERENCE_LIST}, - "State": {"target": STATE}, - "StateReason": {"target": STATE_REASON}, - "StateReasonCode": {"target": STATE_REASON_CODE}, - "LastUpdateStatus": {"target": LAST_UPDATE_STATUS}, - "LastUpdateStatusReason": {"target": LAST_UPDATE_STATUS_REASON}, - "LastUpdateStatusReasonCode": {"target": LAST_UPDATE_STATUS_REASON_CODE}, - "FileSystemConfigs": {"target": FILE_SYSTEM_CONFIG_LIST}, - "SigningProfileVersionArn": {"target": ARN}, - "SigningJobArn": {"target": ARN}, - "PackageType": {"target": PACKAGE_TYPE}, - "ImageConfigResponse": {"target": IMAGE_CONFIG_RESPONSE}, - "Architectures": {"target": ARCHITECTURES_LIST}, - "EphemeralStorage": {"target": EPHEMERAL_STORAGE}, - "SnapStart": {"target": SNAP_START_RESPONSE}, - "RuntimeVersionConfig": {"target": RUNTIME_VERSION_CONFIG}, - "LoggingConfig": {"target": LOGGING_CONFIG}, - "TenancyConfig": {"target": TENANCY_CONFIG}, - "CapacityProviderConfig": {"target": CAPACITY_PROVIDER_CONFIG}, - "ConfigSha256": {"target": STRING}, - "DurableConfig": {"target": DURABLE_CONFIG}, - }, -) - -UPDATE_FUNCTION_CONFIGURATION = Schema( - id=ShapeID("com.amazonaws.lambda#UpdateFunctionConfiguration"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PUT", - "uri": "/2015-03-31/functions/{FunctionName}/configuration", - "code": 200, - } - ), - ) - ], -) - -UPDATE_FUNCTION_URL_CONFIG_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#UpdateFunctionUrlConfigInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#UpdateFunctionUrlConfigRequest", - ) - ], - members={ - "FunctionName": { - "target": FUNCTION_URL_FUNCTION_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Qualifier": { - "target": FUNCTION_URL_QUALIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="Qualifier") - ], - }, - "AuthType": {"target": FUNCTION_URL_AUTH_TYPE}, - "Cors": {"target": CORS}, - "InvokeMode": {"target": INVOKE_MODE}, - }, -) - -UPDATE_FUNCTION_URL_CONFIG_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#UpdateFunctionUrlConfigOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#UpdateFunctionUrlConfigResponse", - ) - ], - members={ - "FunctionUrl": { - "target": FUNCTION_URL, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "FunctionArn": { - "target": FUNCTION_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "AuthType": { - "target": FUNCTION_URL_AUTH_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Cors": {"target": CORS}, - "CreationTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "LastModifiedTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "InvokeMode": {"target": INVOKE_MODE}, - }, -) - -UPDATE_FUNCTION_URL_CONFIG = Schema( - id=ShapeID("com.amazonaws.lambda#UpdateFunctionUrlConfig"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PUT", - "uri": "/2021-10-31/functions/{FunctionName}/url", - "code": 200, - } - ), - ) - ], -) - -CREATE_ALIAS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#CreateAliasInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#CreateAliasRequest", - ) - ], - members={ - "FunctionName": { - "target": FUNCTION_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Name": { - "target": ALIAS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "FunctionVersion": { - "target": VERSION_WITH_LATEST_PUBLISHED, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Description": {"target": DESCRIPTION}, - "RoutingConfig": {"target": ALIAS_ROUTING_CONFIGURATION}, - }, -) - -CREATE_ALIAS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#CreateAliasOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#AliasConfiguration", - ) - ], - members={ - "AliasArn": {"target": FUNCTION_ARN}, - "Name": {"target": ALIAS}, - "FunctionVersion": {"target": VERSION}, - "Description": {"target": DESCRIPTION}, - "RoutingConfig": {"target": ALIAS_ROUTING_CONFIGURATION}, - "RevisionId": {"target": STRING}, - }, -) - -CREATE_ALIAS = Schema( - id=ShapeID("com.amazonaws.lambda#CreateAlias"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/2015-03-31/functions/{FunctionName}/aliases", - "code": 201, - } - ), - ) - ], -) - -DELETE_ALIAS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#DeleteAliasInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#DeleteAliasRequest", - ) - ], - members={ - "FunctionName": { - "target": FUNCTION_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Name": { - "target": ALIAS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -DELETE_ALIAS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#DeleteAliasOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -DELETE_ALIAS = Schema( - id=ShapeID("com.amazonaws.lambda#DeleteAlias"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/2015-03-31/functions/{FunctionName}/aliases/{Name}", - "code": 204, - } - ), - ) - ], -) - -GET_ALIAS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#GetAliasInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#GetAliasRequest", - ) - ], - members={ - "FunctionName": { - "target": FUNCTION_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Name": { - "target": ALIAS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -GET_ALIAS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#GetAliasOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#AliasConfiguration", - ) - ], - members={ - "AliasArn": {"target": FUNCTION_ARN}, - "Name": {"target": ALIAS}, - "FunctionVersion": {"target": VERSION}, - "Description": {"target": DESCRIPTION}, - "RoutingConfig": {"target": ALIAS_ROUTING_CONFIGURATION}, - "RevisionId": {"target": STRING}, - }, -) - -GET_ALIAS = Schema( - id=ShapeID("com.amazonaws.lambda#GetAlias"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/2015-03-31/functions/{FunctionName}/aliases/{Name}", - "code": 200, - } - ), - ) - ], -) - -LIST_ALIASES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ListAliasesInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#ListAliasesRequest", - ) - ], - members={ - "FunctionName": { - "target": FUNCTION_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "FunctionVersion": { - "target": VERSION_WITH_LATEST_PUBLISHED, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="FunctionVersion") - ], - }, - "Marker": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="Marker")], - }, - "MaxItems": { - "target": MAX_LIST_ITEMS, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="MaxItems")], - }, - }, -) - -LIST_ALIASES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ListAliasesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#ListAliasesResponse", - ) - ], - members={"NextMarker": {"target": STRING}, "Aliases": {"target": ALIAS_LIST}}, -) - -LIST_ALIASES = Schema( - id=ShapeID("com.amazonaws.lambda#ListAliases"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/2015-03-31/functions/{FunctionName}/aliases", - "code": 200, - } - ), - ) - ], -) - -UPDATE_ALIAS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#UpdateAliasInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#UpdateAliasRequest", - ) - ], - members={ - "FunctionName": { - "target": FUNCTION_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Name": { - "target": ALIAS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "FunctionVersion": {"target": VERSION_WITH_LATEST_PUBLISHED}, - "Description": {"target": DESCRIPTION}, - "RoutingConfig": {"target": ALIAS_ROUTING_CONFIGURATION}, - "RevisionId": {"target": STRING}, - }, -) - -UPDATE_ALIAS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#UpdateAliasOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#AliasConfiguration", - ) - ], - members={ - "AliasArn": {"target": FUNCTION_ARN}, - "Name": {"target": ALIAS}, - "FunctionVersion": {"target": VERSION}, - "Description": {"target": DESCRIPTION}, - "RoutingConfig": {"target": ALIAS_ROUTING_CONFIGURATION}, - "RevisionId": {"target": STRING}, - }, -) - -UPDATE_ALIAS = Schema( - id=ShapeID("com.amazonaws.lambda#UpdateAlias"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PUT", - "uri": "/2015-03-31/functions/{FunctionName}/aliases/{Name}", - "code": 200, - } - ), - ) - ], -) - -LIST_VERSIONS_BY_FUNCTION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ListVersionsByFunctionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#ListVersionsByFunctionRequest", - ) - ], - members={ - "FunctionName": { - "target": NAMESPACED_FUNCTION_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Marker": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="Marker")], - }, - "MaxItems": { - "target": MAX_LIST_ITEMS, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="MaxItems")], - }, - }, -) - -LIST_VERSIONS_BY_FUNCTION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ListVersionsByFunctionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#ListVersionsByFunctionResponse", - ) - ], - members={"NextMarker": {"target": STRING}, "Versions": {"target": FUNCTION_LIST}}, -) - -LIST_VERSIONS_BY_FUNCTION = Schema( - id=ShapeID("com.amazonaws.lambda#ListVersionsByFunction"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/2015-03-31/functions/{FunctionName}/versions", - "code": 200, - } - ), - ) - ], -) - -PUBLISH_VERSION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#PublishVersionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#PublishVersionRequest", - ) - ], - members={ - "FunctionName": { - "target": FUNCTION_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "CodeSha256": {"target": STRING}, - "Description": {"target": DESCRIPTION}, - "RevisionId": {"target": STRING}, - "PublishTo": {"target": FUNCTION_VERSION_LATEST_PUBLISHED}, - }, -) - -PUBLISH_VERSION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#PublishVersionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#FunctionConfiguration", - ) - ], - members={ - "FunctionName": {"target": NAMESPACED_FUNCTION_NAME}, - "FunctionArn": {"target": NAME_SPACED_FUNCTION_ARN}, - "Runtime": {"target": RUNTIME}, - "Role": {"target": ROLE_ARN}, - "Handler": {"target": HANDLER}, - "CodeSize": { - "target": LONG, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "Description": {"target": DESCRIPTION}, - "Timeout": {"target": TIMEOUT}, - "MemorySize": {"target": MEMORY_SIZE}, - "LastModified": {"target": TIMESTAMP}, - "CodeSha256": {"target": STRING}, - "Version": {"target": VERSION}, - "VpcConfig": {"target": VPC_CONFIG_RESPONSE}, - "DeadLetterConfig": {"target": DEAD_LETTER_CONFIG}, - "Environment": {"target": ENVIRONMENT_RESPONSE}, - "KMSKeyArn": {"target": KMS_KEY_ARN}, - "TracingConfig": {"target": TRACING_CONFIG_RESPONSE}, - "MasterArn": {"target": FUNCTION_ARN}, - "RevisionId": {"target": STRING}, - "Layers": {"target": LAYERS_REFERENCE_LIST}, - "State": {"target": STATE}, - "StateReason": {"target": STATE_REASON}, - "StateReasonCode": {"target": STATE_REASON_CODE}, - "LastUpdateStatus": {"target": LAST_UPDATE_STATUS}, - "LastUpdateStatusReason": {"target": LAST_UPDATE_STATUS_REASON}, - "LastUpdateStatusReasonCode": {"target": LAST_UPDATE_STATUS_REASON_CODE}, - "FileSystemConfigs": {"target": FILE_SYSTEM_CONFIG_LIST}, - "SigningProfileVersionArn": {"target": ARN}, - "SigningJobArn": {"target": ARN}, - "PackageType": {"target": PACKAGE_TYPE}, - "ImageConfigResponse": {"target": IMAGE_CONFIG_RESPONSE}, - "Architectures": {"target": ARCHITECTURES_LIST}, - "EphemeralStorage": {"target": EPHEMERAL_STORAGE}, - "SnapStart": {"target": SNAP_START_RESPONSE}, - "RuntimeVersionConfig": {"target": RUNTIME_VERSION_CONFIG}, - "LoggingConfig": {"target": LOGGING_CONFIG}, - "TenancyConfig": {"target": TENANCY_CONFIG}, - "CapacityProviderConfig": {"target": CAPACITY_PROVIDER_CONFIG}, - "ConfigSha256": {"target": STRING}, - "DurableConfig": {"target": DURABLE_CONFIG}, - }, -) - -PUBLISH_VERSION = Schema( - id=ShapeID("com.amazonaws.lambda#PublishVersion"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/2015-03-31/functions/{FunctionName}/versions", - "code": 201, - } - ), - ) - ], -) - -GET_ACCOUNT_SETTINGS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#GetAccountSettingsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#GetAccountSettingsRequest", - ) - ], -) - -GET_ACCOUNT_SETTINGS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#GetAccountSettingsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#GetAccountSettingsResponse", - ) - ], - members={ - "AccountLimit": {"target": ACCOUNT_LIMIT}, - "AccountUsage": {"target": ACCOUNT_USAGE}, - }, -) - -GET_ACCOUNT_SETTINGS = Schema( - id=ShapeID("com.amazonaws.lambda#GetAccountSettings"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/2016-08-19/account-settings", "code": 200} - ), - ) - ], -) - -GET_FUNCTION_EVENT_INVOKE_CONFIG_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#GetFunctionEventInvokeConfigInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#GetFunctionEventInvokeConfigRequest", - ) - ], - members={ - "FunctionName": { - "target": NAMESPACED_FUNCTION_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Qualifier": { - "target": NUMERIC_LATEST_PUBLISHED_OR_ALIAS_QUALIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="Qualifier") - ], - }, - }, -) - -MAXIMUM_EVENT_AGE_IN_SECONDS = Schema( - id=ShapeID("com.amazonaws.lambda#MaximumEventAgeInSeconds"), - shape_type=ShapeType.INTEGER, -) - -MAXIMUM_RETRY_ATTEMPTS = Schema( - id=ShapeID("com.amazonaws.lambda#MaximumRetryAttempts"), - shape_type=ShapeType.INTEGER, -) - -GET_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#GetFunctionEventInvokeConfigOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#FunctionEventInvokeConfig", - ) - ], - members={ - "LastModified": {"target": DATE}, - "FunctionArn": {"target": FUNCTION_ARN}, - "MaximumRetryAttempts": {"target": MAXIMUM_RETRY_ATTEMPTS}, - "MaximumEventAgeInSeconds": {"target": MAXIMUM_EVENT_AGE_IN_SECONDS}, - "DestinationConfig": {"target": DESTINATION_CONFIG}, - }, -) - -GET_FUNCTION_EVENT_INVOKE_CONFIG = Schema( - id=ShapeID("com.amazonaws.lambda#GetFunctionEventInvokeConfig"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/2019-09-25/functions/{FunctionName}/event-invoke-config", - "code": 200, - } - ), - ) - ], -) - -GET_RESOURCE_POLICY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#GetResourcePolicyInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#GetResourcePolicyRequest", - ) - ], - members={ - "ResourceArn": { - "target": POLICY_RESOURCE_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -RESOURCE_POLICY = Schema( - id=ShapeID("com.amazonaws.lambda#ResourcePolicy"), shape_type=ShapeType.STRING -) - -GET_RESOURCE_POLICY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#GetResourcePolicyOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#GetResourcePolicyResponse", - ) - ], - members={ - "Policy": {"target": RESOURCE_POLICY}, - "RevisionId": {"target": REVISION_ID}, - }, -) - -GET_RESOURCE_POLICY = Schema( - id=ShapeID("com.amazonaws.lambda#GetResourcePolicy"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/2026-07-09/resource-policy/{ResourceArn}", - "code": 200, - } - ), - ) - ], -) - -MAX_LAYER_LIST_ITEMS = Schema( - id=ShapeID("com.amazonaws.lambda#MaxLayerListItems"), shape_type=ShapeType.INTEGER -) - -LIST_LAYERS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ListLayersInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#ListLayersRequest", - ) - ], - members={ - "CompatibleArchitecture": { - "target": ARCHITECTURE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpQuery"), value="CompatibleArchitecture" - ) - ], - }, - "CompatibleRuntime": { - "target": RUNTIME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="CompatibleRuntime") - ], - }, - "Marker": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="Marker")], - }, - "MaxItems": { - "target": MAX_LAYER_LIST_ITEMS, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="MaxItems")], - }, - }, -) - -COMPATIBLE_ARCHITECTURES = Schema.collection( - id=ShapeID("com.amazonaws.lambda#CompatibleArchitectures"), - shape_type=ShapeType.LIST, - members={"member": {"target": ARCHITECTURE}}, -) - -COMPATIBLE_RUNTIMES = Schema.collection( - id=ShapeID("com.amazonaws.lambda#CompatibleRuntimes"), - shape_type=ShapeType.LIST, - members={"member": {"target": RUNTIME}}, -) - -LICENSE_INFO = Schema( - id=ShapeID("com.amazonaws.lambda#LicenseInfo"), shape_type=ShapeType.STRING -) - -LAYER_VERSIONS_LIST_ITEM = Schema.collection( - id=ShapeID("com.amazonaws.lambda#LayerVersionsListItem"), - members={ - "LayerVersionArn": {"target": LAYER_VERSION_ARN}, - "Version": { - "target": LAYER_VERSION_NUMBER, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "Description": {"target": DESCRIPTION}, - "CreatedDate": {"target": TIMESTAMP}, - "CompatibleArchitectures": {"target": COMPATIBLE_ARCHITECTURES}, - "CompatibleRuntimes": {"target": COMPATIBLE_RUNTIMES}, - "LicenseInfo": {"target": LICENSE_INFO}, - }, -) - -LAYER_ARN = Schema( - id=ShapeID("com.amazonaws.lambda#LayerArn"), shape_type=ShapeType.STRING -) - -LAYERS_LIST_ITEM = Schema.collection( - id=ShapeID("com.amazonaws.lambda#LayersListItem"), - members={ - "LayerName": {"target": LAYER_NAME}, - "LayerArn": {"target": LAYER_ARN}, - "LatestMatchingVersion": {"target": LAYER_VERSIONS_LIST_ITEM}, - }, -) - -LAYERS_LIST = Schema.collection( - id=ShapeID("com.amazonaws.lambda#LayersList"), - shape_type=ShapeType.LIST, - members={"member": {"target": LAYERS_LIST_ITEM}}, -) - -LIST_LAYERS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ListLayersOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#ListLayersResponse", - ) - ], - members={"NextMarker": {"target": STRING}, "Layers": {"target": LAYERS_LIST}}, -) - -LIST_LAYERS = Schema( - id=ShapeID("com.amazonaws.lambda#ListLayers"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/2018-10-31/layers", "code": 200} - ), - ) - ], -) - -DELETE_LAYER_VERSION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#DeleteLayerVersionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#DeleteLayerVersionRequest", - ) - ], - members={ - "LayerName": { - "target": LAYER_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "VersionNumber": { - "target": LAYER_VERSION_NUMBER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=None), - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -DELETE_LAYER_VERSION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#DeleteLayerVersionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -DELETE_LAYER_VERSION = Schema( - id=ShapeID("com.amazonaws.lambda#DeleteLayerVersion"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/2018-10-31/layers/{LayerName}/versions/{VersionNumber}", - "code": 204, - } - ), - ) - ], -) - -GET_LAYER_VERSION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#GetLayerVersionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#GetLayerVersionRequest", - ) - ], - members={ - "LayerName": { - "target": LAYER_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "VersionNumber": { - "target": LAYER_VERSION_NUMBER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=None), - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -LAYER_VERSION_CONTENT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#LayerVersionContentOutput"), - members={ - "Location": {"target": SENSITIVE_STRING_ON_SERVER_ONLY}, - "CodeSha256": {"target": STRING}, - "CodeSize": { - "target": LONG, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "SigningProfileVersionArn": {"target": ARN}, - "SigningJobArn": {"target": ARN}, - "ResolvedS3Object": {"target": RESOLVED_S3_OBJECT}, - }, -) - -GET_LAYER_VERSION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#GetLayerVersionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#GetLayerVersionResponse", - ) - ], - members={ - "Content": {"target": LAYER_VERSION_CONTENT_OUTPUT}, - "LayerArn": {"target": LAYER_ARN}, - "LayerVersionArn": {"target": LAYER_VERSION_ARN}, - "Description": {"target": DESCRIPTION}, - "CreatedDate": {"target": TIMESTAMP}, - "Version": { - "target": LAYER_VERSION_NUMBER, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "CompatibleArchitectures": {"target": COMPATIBLE_ARCHITECTURES}, - "CompatibleRuntimes": {"target": COMPATIBLE_RUNTIMES}, - "LicenseInfo": {"target": LICENSE_INFO}, - }, -) - -GET_LAYER_VERSION = Schema( - id=ShapeID("com.amazonaws.lambda#GetLayerVersion"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/2018-10-31/layers/{LayerName}/versions/{VersionNumber}", - "code": 200, - } - ), - ) - ], -) - -GET_LAYER_VERSION_BY_ARN_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#GetLayerVersionByArnInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#GetLayerVersionByArnRequest", - ) - ], - members={ - "Arn": { - "target": LAYER_VERSION_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="Arn"), - ], - } - }, -) - -GET_LAYER_VERSION_BY_ARN_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#GetLayerVersionByArnOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#GetLayerVersionResponse", - ) - ], - members={ - "Content": {"target": LAYER_VERSION_CONTENT_OUTPUT}, - "LayerArn": {"target": LAYER_ARN}, - "LayerVersionArn": {"target": LAYER_VERSION_ARN}, - "Description": {"target": DESCRIPTION}, - "CreatedDate": {"target": TIMESTAMP}, - "Version": { - "target": LAYER_VERSION_NUMBER, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "CompatibleArchitectures": {"target": COMPATIBLE_ARCHITECTURES}, - "CompatibleRuntimes": {"target": COMPATIBLE_RUNTIMES}, - "LicenseInfo": {"target": LICENSE_INFO}, - }, -) - -GET_LAYER_VERSION_BY_ARN = Schema( - id=ShapeID("com.amazonaws.lambda#GetLayerVersionByArn"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/2018-10-31/layers?find=LayerVersion", - "code": 200, - } - ), - ) - ], -) - -GET_LAYER_VERSION_POLICY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#GetLayerVersionPolicyInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#GetLayerVersionPolicyRequest", - ) - ], - members={ - "LayerName": { - "target": LAYER_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "VersionNumber": { - "target": LAYER_VERSION_NUMBER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=None), - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -GET_LAYER_VERSION_POLICY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#GetLayerVersionPolicyOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#GetLayerVersionPolicyResponse", - ) - ], - members={"Policy": {"target": STRING}, "RevisionId": {"target": STRING}}, -) - -GET_LAYER_VERSION_POLICY = Schema( - id=ShapeID("com.amazonaws.lambda#GetLayerVersionPolicy"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/2018-10-31/layers/{LayerName}/versions/{VersionNumber}/policy", - "code": 200, - } - ), - ) - ], -) - -LIST_LAYER_VERSIONS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ListLayerVersionsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#ListLayerVersionsRequest", - ) - ], - members={ - "CompatibleArchitecture": { - "target": ARCHITECTURE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpQuery"), value="CompatibleArchitecture" - ) - ], - }, - "CompatibleRuntime": { - "target": RUNTIME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="CompatibleRuntime") - ], - }, - "LayerName": { - "target": LAYER_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Marker": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="Marker")], - }, - "MaxItems": { - "target": MAX_LAYER_LIST_ITEMS, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="MaxItems")], - }, - }, -) - -LAYER_VERSIONS_LIST = Schema.collection( - id=ShapeID("com.amazonaws.lambda#LayerVersionsList"), - shape_type=ShapeType.LIST, - members={"member": {"target": LAYER_VERSIONS_LIST_ITEM}}, -) - -LIST_LAYER_VERSIONS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ListLayerVersionsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#ListLayerVersionsResponse", - ) - ], - members={ - "NextMarker": {"target": STRING}, - "LayerVersions": {"target": LAYER_VERSIONS_LIST}, - }, -) - -LIST_LAYER_VERSIONS = Schema( - id=ShapeID("com.amazonaws.lambda#ListLayerVersions"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/2018-10-31/layers/{LayerName}/versions", - "code": 200, - } - ), - ) - ], -) - -LAYER_VERSION_CONTENT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#LayerVersionContentInput"), - members={ - "S3Bucket": {"target": S3_BUCKET}, - "S3Key": {"target": S3_KEY}, - "S3ObjectVersion": {"target": S3_OBJECT_VERSION}, - "S3ObjectStorageMode": {"target": S3_OBJECT_STORAGE_MODE}, - "ZipFile": {"target": BLOB}, - }, -) - -PUBLISH_LAYER_VERSION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#PublishLayerVersionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#PublishLayerVersionRequest", - ) - ], - members={ - "LayerName": { - "target": LAYER_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Description": {"target": DESCRIPTION}, - "Content": { - "target": LAYER_VERSION_CONTENT_INPUT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "CompatibleArchitectures": {"target": COMPATIBLE_ARCHITECTURES}, - "CompatibleRuntimes": {"target": COMPATIBLE_RUNTIMES}, - "LicenseInfo": {"target": LICENSE_INFO}, - }, -) - -PUBLISH_LAYER_VERSION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#PublishLayerVersionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#PublishLayerVersionResponse", - ) - ], - members={ - "Content": {"target": LAYER_VERSION_CONTENT_OUTPUT}, - "LayerArn": {"target": LAYER_ARN}, - "LayerVersionArn": {"target": LAYER_VERSION_ARN}, - "Description": {"target": DESCRIPTION}, - "CreatedDate": {"target": TIMESTAMP}, - "Version": { - "target": LAYER_VERSION_NUMBER, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "CompatibleArchitectures": {"target": COMPATIBLE_ARCHITECTURES}, - "CompatibleRuntimes": {"target": COMPATIBLE_RUNTIMES}, - "LicenseInfo": {"target": LICENSE_INFO}, - }, -) - -PUBLISH_LAYER_VERSION = Schema( - id=ShapeID("com.amazonaws.lambda#PublishLayerVersion"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/2018-10-31/layers/{LayerName}/versions", - "code": 201, - } - ), - ) - ], -) - -REMOVE_LAYER_VERSION_PERMISSION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#RemoveLayerVersionPermissionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#RemoveLayerVersionPermissionRequest", - ) - ], - members={ - "LayerName": { - "target": LAYER_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "VersionNumber": { - "target": LAYER_VERSION_NUMBER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=None), - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "StatementId": { - "target": STATEMENT_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "RevisionId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="RevisionId") - ], - }, - }, -) - -REMOVE_LAYER_VERSION_PERMISSION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#RemoveLayerVersionPermissionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -REMOVE_LAYER_VERSION_PERMISSION = Schema( - id=ShapeID("com.amazonaws.lambda#RemoveLayerVersionPermission"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/2018-10-31/layers/{LayerName}/versions/{VersionNumber}/policy/{StatementId}", - "code": 204, - } - ), - ) - ], -) - -MAX_FUNCTION_EVENT_INVOKE_CONFIG_LIST_ITEMS = Schema( - id=ShapeID("com.amazonaws.lambda#MaxFunctionEventInvokeConfigListItems"), - shape_type=ShapeType.INTEGER, -) - -LIST_FUNCTION_EVENT_INVOKE_CONFIGS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ListFunctionEventInvokeConfigsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#ListFunctionEventInvokeConfigsRequest", - ) - ], - members={ - "FunctionName": { - "target": NAMESPACED_FUNCTION_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Marker": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="Marker")], - }, - "MaxItems": { - "target": MAX_FUNCTION_EVENT_INVOKE_CONFIG_LIST_ITEMS, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="MaxItems")], - }, - }, -) - -FUNCTION_EVENT_INVOKE_CONFIG = Schema.collection( - id=ShapeID("com.amazonaws.lambda#FunctionEventInvokeConfig"), - members={ - "LastModified": {"target": DATE}, - "FunctionArn": {"target": FUNCTION_ARN}, - "MaximumRetryAttempts": {"target": MAXIMUM_RETRY_ATTEMPTS}, - "MaximumEventAgeInSeconds": {"target": MAXIMUM_EVENT_AGE_IN_SECONDS}, - "DestinationConfig": {"target": DESTINATION_CONFIG}, - }, -) - -FUNCTION_EVENT_INVOKE_CONFIG_LIST = Schema.collection( - id=ShapeID("com.amazonaws.lambda#FunctionEventInvokeConfigList"), - shape_type=ShapeType.LIST, - members={"member": {"target": FUNCTION_EVENT_INVOKE_CONFIG}}, -) - -LIST_FUNCTION_EVENT_INVOKE_CONFIGS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ListFunctionEventInvokeConfigsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#ListFunctionEventInvokeConfigsResponse", - ) - ], - members={ - "FunctionEventInvokeConfigs": {"target": FUNCTION_EVENT_INVOKE_CONFIG_LIST}, - "NextMarker": {"target": STRING}, - }, -) - -LIST_FUNCTION_EVENT_INVOKE_CONFIGS = Schema( - id=ShapeID("com.amazonaws.lambda#ListFunctionEventInvokeConfigs"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/2019-09-25/functions/{FunctionName}/event-invoke-config/list", - "code": 200, - } - ), - ) - ], -) - -TAGGABLE_RESOURCE = Schema( - id=ShapeID("com.amazonaws.lambda#TaggableResource"), shape_type=ShapeType.STRING -) - -LIST_TAGS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ListTagsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#ListTagsRequest", - ) - ], - members={ - "Resource": { - "target": TAGGABLE_RESOURCE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -LIST_TAGS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ListTagsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#ListTagsResponse", - ) - ], - members={"Tags": {"target": TAGS}}, -) - -LIST_TAGS = Schema( - id=ShapeID("com.amazonaws.lambda#ListTags"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/2017-03-31/tags/{Resource}", "code": 200} - ), - ) - ], -) - -NAMESPACED_STATEMENT_ID = Schema( - id=ShapeID("com.amazonaws.lambda#NamespacedStatementId"), - shape_type=ShapeType.STRING, -) - -REMOVE_PERMISSION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#RemovePermissionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#RemovePermissionRequest", - ) - ], - members={ - "FunctionName": { - "target": NAMESPACED_FUNCTION_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "StatementId": { - "target": NAMESPACED_STATEMENT_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Qualifier": { - "target": NUMERIC_LATEST_PUBLISHED_OR_ALIAS_QUALIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="Qualifier") - ], - }, - "RevisionId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="RevisionId") - ], - }, - }, -) - -REMOVE_PERMISSION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#RemovePermissionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -REMOVE_PERMISSION = Schema( - id=ShapeID("com.amazonaws.lambda#RemovePermission"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/2015-03-31/functions/{FunctionName}/policy/{StatementId}", - "code": 204, - } - ), - ) - ], -) - -QUALIFIER = Schema( - id=ShapeID("com.amazonaws.lambda#Qualifier"), shape_type=ShapeType.STRING -) - -DELETE_PROVISIONED_CONCURRENCY_CONFIG_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#DeleteProvisionedConcurrencyConfigInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#DeleteProvisionedConcurrencyConfigRequest", - ) - ], - members={ - "FunctionName": { - "target": FUNCTION_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Qualifier": { - "target": QUALIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="Qualifier"), - ], - }, - }, -) - -DELETE_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#DeleteProvisionedConcurrencyConfigOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -DELETE_PROVISIONED_CONCURRENCY_CONFIG = Schema( - id=ShapeID("com.amazonaws.lambda#DeleteProvisionedConcurrencyConfig"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/2019-09-30/functions/{FunctionName}/provisioned-concurrency", - "code": 204, - } - ), - ) - ], -) - -GET_PROVISIONED_CONCURRENCY_CONFIG_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#GetProvisionedConcurrencyConfigInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#GetProvisionedConcurrencyConfigRequest", - ) - ], - members={ - "FunctionName": { - "target": FUNCTION_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Qualifier": { - "target": QUALIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="Qualifier"), - ], - }, - }, -) - -GET_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#GetProvisionedConcurrencyConfigOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#GetProvisionedConcurrencyConfigResponse", - ) - ], - members={ - "RequestedProvisionedConcurrentExecutions": {"target": POSITIVE_INTEGER}, - "AvailableProvisionedConcurrentExecutions": {"target": NON_NEGATIVE_INTEGER}, - "AllocatedProvisionedConcurrentExecutions": {"target": NON_NEGATIVE_INTEGER}, - "Status": {"target": PROVISIONED_CONCURRENCY_STATUS_ENUM}, - "StatusReason": {"target": STRING}, - "LastModified": {"target": TIMESTAMP}, - }, -) - -PROVISIONED_CONCURRENCY_CONFIG_NOT_FOUND_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#ProvisionedConcurrencyConfigNotFoundException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=404), - ], - members={"Type": {"target": STRING}, "message": {"target": STRING}}, -) - -GET_PROVISIONED_CONCURRENCY_CONFIG = Schema( - id=ShapeID("com.amazonaws.lambda#GetProvisionedConcurrencyConfig"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/2019-09-30/functions/{FunctionName}/provisioned-concurrency", - "code": 200, - } - ), - ) - ], -) - -PUT_PROVISIONED_CONCURRENCY_CONFIG_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#PutProvisionedConcurrencyConfigInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#PutProvisionedConcurrencyConfigRequest", - ) - ], - members={ - "FunctionName": { - "target": FUNCTION_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Qualifier": { - "target": QUALIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="Qualifier"), - ], - }, - "ProvisionedConcurrentExecutions": { - "target": POSITIVE_INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -PUT_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#PutProvisionedConcurrencyConfigOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#PutProvisionedConcurrencyConfigResponse", - ) - ], - members={ - "RequestedProvisionedConcurrentExecutions": {"target": POSITIVE_INTEGER}, - "AllocatedProvisionedConcurrentExecutions": {"target": NON_NEGATIVE_INTEGER}, - "AvailableProvisionedConcurrentExecutions": {"target": NON_NEGATIVE_INTEGER}, - "Status": {"target": PROVISIONED_CONCURRENCY_STATUS_ENUM}, - "StatusReason": {"target": STRING}, - "LastModified": {"target": TIMESTAMP}, - }, -) - -PUT_PROVISIONED_CONCURRENCY_CONFIG = Schema( - id=ShapeID("com.amazonaws.lambda#PutProvisionedConcurrencyConfig"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PUT", - "uri": "/2019-09-30/functions/{FunctionName}/provisioned-concurrency", - "code": 202, - } - ), - ) - ], -) - -PUT_FUNCTION_EVENT_INVOKE_CONFIG_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#PutFunctionEventInvokeConfigInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#PutFunctionEventInvokeConfigRequest", - ) - ], - members={ - "FunctionName": { - "target": NAMESPACED_FUNCTION_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Qualifier": { - "target": NUMERIC_LATEST_PUBLISHED_OR_ALIAS_QUALIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="Qualifier") - ], - }, - "MaximumRetryAttempts": {"target": MAXIMUM_RETRY_ATTEMPTS}, - "MaximumEventAgeInSeconds": {"target": MAXIMUM_EVENT_AGE_IN_SECONDS}, - "DestinationConfig": {"target": DESTINATION_CONFIG}, - }, -) - -PUT_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#PutFunctionEventInvokeConfigOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#FunctionEventInvokeConfig", - ) - ], - members={ - "LastModified": {"target": DATE}, - "FunctionArn": {"target": FUNCTION_ARN}, - "MaximumRetryAttempts": {"target": MAXIMUM_RETRY_ATTEMPTS}, - "MaximumEventAgeInSeconds": {"target": MAXIMUM_EVENT_AGE_IN_SECONDS}, - "DestinationConfig": {"target": DESTINATION_CONFIG}, - }, -) - -PUT_FUNCTION_EVENT_INVOKE_CONFIG = Schema( - id=ShapeID("com.amazonaws.lambda#PutFunctionEventInvokeConfig"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PUT", - "uri": "/2019-09-25/functions/{FunctionName}/event-invoke-config", - "code": 200, - } - ), - ) - ], -) - -PUT_RESOURCE_POLICY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#PutResourcePolicyInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#PutResourcePolicyRequest", - ) - ], - members={ - "ResourceArn": { - "target": POLICY_RESOURCE_ARN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Policy": { - "target": RESOURCE_POLICY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "RevisionId": {"target": REVISION_ID}, - }, -) - -PUT_RESOURCE_POLICY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#PutResourcePolicyOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#PutResourcePolicyResponse", - ) - ], - members={ - "Policy": {"target": RESOURCE_POLICY}, - "RevisionId": {"target": REVISION_ID}, - }, -) - -PUT_RESOURCE_POLICY = Schema( - id=ShapeID("com.amazonaws.lambda#PutResourcePolicy"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PUT", - "uri": "/2026-07-09/resource-policy/{ResourceArn}", - "code": 200, - } - ), - ) - ], -) - -CALLBACK_TIMEOUT_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lambda#CallbackTimeoutException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"Type": {"target": STRING}, "Message": {"target": STRING}}, -) - -SEND_DURABLE_EXECUTION_CALLBACK_FAILURE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#SendDurableExecutionCallbackFailureInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#SendDurableExecutionCallbackFailureRequest", - ) - ], - members={ - "CallbackId": { - "target": CALLBACK_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Error": { - "target": ERROR_OBJECT, - "traits": [Trait.new(id=ShapeID("smithy.api#httpPayload"))], - }, - }, -) - -SEND_DURABLE_EXECUTION_CALLBACK_FAILURE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#SendDurableExecutionCallbackFailureOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#SendDurableExecutionCallbackFailureResponse", - ) - ], -) - -SEND_DURABLE_EXECUTION_CALLBACK_FAILURE = Schema( - id=ShapeID("com.amazonaws.lambda#SendDurableExecutionCallbackFailure"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/2025-12-01/durable-execution-callbacks/{CallbackId}/fail", - } - ), - ) - ], -) - -SEND_DURABLE_EXECUTION_CALLBACK_HEARTBEAT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#SendDurableExecutionCallbackHeartbeatInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#SendDurableExecutionCallbackHeartbeatRequest", - ) - ], - members={ - "CallbackId": { - "target": CALLBACK_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -SEND_DURABLE_EXECUTION_CALLBACK_HEARTBEAT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#SendDurableExecutionCallbackHeartbeatOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#SendDurableExecutionCallbackHeartbeatResponse", - ) - ], -) - -SEND_DURABLE_EXECUTION_CALLBACK_HEARTBEAT = Schema( - id=ShapeID("com.amazonaws.lambda#SendDurableExecutionCallbackHeartbeat"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/2025-12-01/durable-execution-callbacks/{CallbackId}/heartbeat", - } - ), - ) - ], -) - -BINARY_OPERATION_PAYLOAD = Schema( - id=ShapeID("com.amazonaws.lambda#BinaryOperationPayload"), - shape_type=ShapeType.BLOB, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -SEND_DURABLE_EXECUTION_CALLBACK_SUCCESS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#SendDurableExecutionCallbackSuccessInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#SendDurableExecutionCallbackSuccessRequest", - ) - ], - members={ - "CallbackId": { - "target": CALLBACK_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Result": { - "target": BINARY_OPERATION_PAYLOAD, - "traits": [Trait.new(id=ShapeID("smithy.api#httpPayload"))], - }, - }, -) - -SEND_DURABLE_EXECUTION_CALLBACK_SUCCESS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#SendDurableExecutionCallbackSuccessOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#SendDurableExecutionCallbackSuccessResponse", - ) - ], -) - -SEND_DURABLE_EXECUTION_CALLBACK_SUCCESS = Schema( - id=ShapeID("com.amazonaws.lambda#SendDurableExecutionCallbackSuccess"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/2025-12-01/durable-execution-callbacks/{CallbackId}/succeed", - } - ), - ) - ], -) - -TAG_RESOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#TagResourceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#TagResourceRequest", - ) - ], - members={ - "Resource": { - "target": TAGGABLE_RESOURCE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Tags": { - "target": TAGS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -TAG_RESOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#TagResourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -TAG_RESOURCE = Schema( - id=ShapeID("com.amazonaws.lambda#TagResource"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/2017-03-31/tags/{Resource}", "code": 204} - ), - ) - ], -) - -TAG_KEY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.lambda#TagKeyList"), - shape_type=ShapeType.LIST, - members={ - "member": { - "target": TAG_KEY, - "traits": [Trait.new(id=ShapeID("smithy.api#xmlName"), value="Key")], - } - }, -) - -UNTAG_RESOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#UntagResourceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#UntagResourceRequest", - ) - ], - members={ - "Resource": { - "target": TAGGABLE_RESOURCE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "TagKeys": { - "target": TAG_KEY_LIST, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="tagKeys"), - ], - }, - }, -) - -UNTAG_RESOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#UntagResourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -UNTAG_RESOURCE = Schema( - id=ShapeID("com.amazonaws.lambda#UntagResource"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "DELETE", "uri": "/2017-03-31/tags/{Resource}", "code": 204} - ), - ) - ], -) - -UPDATE_FUNCTION_EVENT_INVOKE_CONFIG_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#UpdateFunctionEventInvokeConfigInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#UpdateFunctionEventInvokeConfigRequest", - ) - ], - members={ - "FunctionName": { - "target": NAMESPACED_FUNCTION_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Qualifier": { - "target": NUMERIC_LATEST_PUBLISHED_OR_ALIAS_QUALIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="Qualifier") - ], - }, - "MaximumRetryAttempts": {"target": MAXIMUM_RETRY_ATTEMPTS}, - "MaximumEventAgeInSeconds": {"target": MAXIMUM_EVENT_AGE_IN_SECONDS}, - "DestinationConfig": {"target": DESTINATION_CONFIG}, - }, -) - -UPDATE_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lambda#UpdateFunctionEventInvokeConfigOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lambda#FunctionEventInvokeConfig", - ) - ], - members={ - "LastModified": {"target": DATE}, - "FunctionArn": {"target": FUNCTION_ARN}, - "MaximumRetryAttempts": {"target": MAXIMUM_RETRY_ATTEMPTS}, - "MaximumEventAgeInSeconds": {"target": MAXIMUM_EVENT_AGE_IN_SECONDS}, - "DestinationConfig": {"target": DESTINATION_CONFIG}, - }, -) - -UPDATE_FUNCTION_EVENT_INVOKE_CONFIG = Schema( - id=ShapeID("com.amazonaws.lambda#UpdateFunctionEventInvokeConfig"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/2019-09-25/functions/{FunctionName}/event-invoke-config", - "code": 200, - } - ), - ) - ], -) - -AWS_GIR_API_SERVICE = Schema( - id=ShapeID("com.amazonaws.lambda#AWSGirApiService"), - shape_type=ShapeType.SERVICE, - traits=[ - Trait.new( - id=ShapeID("aws.auth#sigv4"), value=MappingProxyType({"name": "lambda"}) +AWS_GIR_API_SERVICE: StaticSchema = ( + 21, + n0, + _AWSGAS, + { + _aw: MappingProxyType( + { + "sdkId": "Lambda", + "arnNamespace": "lambda", + "cloudFormationName": "Lambda", + "cloudTrailEventSource": "lambda.amazonaws.com", + "endpointPrefix": "lambda", + } ), - Trait.new( - id=ShapeID("smithy.rules#endpointBdd"), - value=MappingProxyType( - { - "version": "1.1", - "parameters": MappingProxyType( - { - "Region": MappingProxyType( - { - "builtIn": "AWS::Region", - "required": False, - "documentation": "The AWS region used to dispatch the request.", - "type": "string", - } - ), - "UseDualStack": MappingProxyType( - { - "builtIn": "AWS::UseDualStack", - "required": True, - "default": False, - "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", - "type": "boolean", - } - ), - "UseFIPS": MappingProxyType( - { - "builtIn": "AWS::UseFIPS", - "required": True, - "default": False, - "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", - "type": "boolean", - } - ), - "Endpoint": MappingProxyType( - { - "builtIn": "SDK::Endpoint", - "required": False, - "documentation": "Override the endpoint used to send this request", - "type": "string", - } - ), - } - ), - "conditions": ( - MappingProxyType( - { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "Endpoint"}),), - } - ), - MappingProxyType( - { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "Region"}),), - } - ), - MappingProxyType( + _aws: MappingProxyType({"name": "lambda"}), + _sB: MappingProxyType( + { + "version": "1.1", + "parameters": MappingProxyType( + { + "Region": MappingProxyType( { - "fn": "aws.partition", - "argv": (MappingProxyType({"ref": "Region"}),), - "assign": "PartitionResult", + "builtIn": "AWS::Region", + "required": False, + "documentation": "The AWS region used to dispatch the request.", + "type": "string", } ), - MappingProxyType( + "UseDualStack": MappingProxyType( { - "fn": "booleanEquals", - "argv": (MappingProxyType({"ref": "UseFIPS"}), True), - } - ), - MappingProxyType( - { - "fn": "booleanEquals", - "argv": ( - MappingProxyType({"ref": "UseDualStack"}), - True, - ), + "builtIn": "AWS::UseDualStack", + "required": True, + "default": False, + "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", + "type": "boolean", } ), - MappingProxyType( + "UseFIPS": MappingProxyType( { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "supportsDualStack", - ), - } - ), - True, - ), + "builtIn": "AWS::UseFIPS", + "required": True, + "default": False, + "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", + "type": "boolean", } ), - MappingProxyType( + "Endpoint": MappingProxyType( { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "supportsFIPS", - ), - } - ), - True, - ), + "builtIn": "SDK::Endpoint", + "required": False, + "documentation": "Override the endpoint used to send this request", + "type": "string", } ), + } + ), + "conditions": ( + MappingProxyType( + { + "fn": "isSet", + "argv": (MappingProxyType({"ref": "Endpoint"}),), + } ), - "results": ( - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: FIPS and custom endpoint are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": MappingProxyType({"ref": "Endpoint"}), - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://lambda-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "FIPS and DualStack are enabled, but this partition does not support one or both", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://lambda-fips.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "FIPS is enabled but this partition does not support FIPS", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + MappingProxyType( + {"fn": "isSet", "argv": (MappingProxyType({"ref": "Region"}),)} + ), + MappingProxyType( + { + "fn": "aws.partition", + "argv": (MappingProxyType({"ref": "Region"}),), + "assign": "PartitionResult", + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": (MappingProxyType({"ref": "UseFIPS"}), True), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": (MappingProxyType({"ref": "UseDualStack"}), True), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( { - "url": "https://lambda.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "supportsDualStack", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "DualStack is enabled but this partition does not support DualStack", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + True, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( { - "url": "https://lambda.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "supportsFIPS", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: Missing Region", - "type": "error", - } - ), + True, + ), + } ), - "root": 2, - "nodeCount": 13, - "nodes": "/////wAAAAH/////AAAAAAAAAAwAAAADAAAAAQAAAAQF9eELAAAAAgAAAAUF9eELAAAAAwAAAAgAAAAGAAAABAAAAAcF9eEKAAAABQX14QgF9eEJAAAABAAAAAoAAAAJAAAABgX14QYF9eEHAAAABQAAAAsF9eEFAAAABgX14QQF9eEFAAAAAwX14QEAAAANAAAABAX14QIF9eED", - } - ), - ), - Trait.new( - id=ShapeID("aws.api#service"), - value=MappingProxyType( - { - "sdkId": "Lambda", - "arnNamespace": "lambda", - "cloudFormationName": "Lambda", - "cloudTrailEventSource": "lambda.amazonaws.com", - "endpointPrefix": "lambda", - } - ), + ), + "results": ( + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: FIPS and custom endpoint are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": MappingProxyType({"ref": "Endpoint"}), + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://lambda-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS and DualStack are enabled, but this partition does not support one or both", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://lambda-fips.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS is enabled but this partition does not support FIPS", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://lambda.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "DualStack is enabled but this partition does not support DualStack", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://lambda.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Missing Region", + "type": "error", + } + ), + ), + "root": 2, + "nodeCount": 13, + "nodes": "/////wAAAAH/////AAAAAAAAAAwAAAADAAAAAQAAAAQF9eELAAAAAgAAAAUF9eELAAAAAwAAAAgAAAAGAAAABAAAAAcF9eEKAAAABQX14QgF9eEJAAAABAAAAAoAAAAJAAAABgX14QYF9eEHAAAABQAAAAsF9eEFAAAABgX14QQF9eEFAAAAAwX14QEAAAANAAAABAX14QIF9eED", + } ), - Trait.new(id=ShapeID("aws.protocols#restJson1")), - ], + _aJ: None, + }, ) diff --git a/clients/aws-sdk-lambda/src/aws_sdk_lambda/client.py b/clients/aws-sdk-lambda/src/aws_sdk_lambda/client.py index b73897f7..12c1220b 100644 --- a/clients/aws-sdk-lambda/src/aws_sdk_lambda/client.py +++ b/clients/aws-sdk-lambda/src/aws_sdk_lambda/client.py @@ -1,29 +1,27 @@ # Code generated by smithy-python-codegen DO NOT EDIT. +from __future__ import annotations + from copy import deepcopy import logging from typing import Any, cast +from smithy_aws_core.aio.identity.chain import AsyncIdentityChain from smithy_aws_core.config import ConfigSource from smithy_aws_core.identity import AWSCredentialsIdentity -from smithy_aws_core.identity.chain import IdentityChain -from smithy_core.aio.client import AsyncClient, ClientCall, RequestPipeline -from smithy_core.aio.eventstream import OutputEventStream +from smithy_core.aio.client import AsyncClient, AsyncClientCall, AsyncRequestPipeline +from smithy_core.aio.eventstream import AsyncOutputEventStream from smithy_core.deserializers import DeserializeableShape from smithy_core.exceptions import ExpectationNotMetError from smithy_core.schemas import APIOperation from smithy_core.serializers import SerializeableShape -from smithy_http.aio.interfaces import HTTPClient +from smithy_http.aio.interfaces import AsyncHTTPClient from smithy_http.plugins import user_agent_plugin from .config import AsyncLambdaConfig, Plugin from .models import ( ADD_LAYER_VERSION_PERMISSION, ADD_PERMISSION, - AddLayerVersionPermissionInput, - AddLayerVersionPermissionOutput, - AddPermissionInput, - AddPermissionOutput, CHECKPOINT_DURABLE_EXECUTION, CREATE_ALIAS, CREATE_CAPACITY_PROVIDER, @@ -31,20 +29,6 @@ CREATE_EVENT_SOURCE_MAPPING, CREATE_FUNCTION, CREATE_FUNCTION_URL_CONFIG, - CheckpointDurableExecutionInput, - CheckpointDurableExecutionOutput, - CreateAliasInput, - CreateAliasOutput, - CreateCapacityProviderInput, - CreateCapacityProviderOutput, - CreateCodeSigningConfigInput, - CreateCodeSigningConfigOutput, - CreateEventSourceMappingInput, - CreateEventSourceMappingOutput, - CreateFunctionInput, - CreateFunctionOutput, - CreateFunctionUrlConfigInput, - CreateFunctionUrlConfigOutput, DELETE_ALIAS, DELETE_CAPACITY_PROVIDER, DELETE_CODE_SIGNING_CONFIG, @@ -57,30 +41,6 @@ DELETE_LAYER_VERSION, DELETE_PROVISIONED_CONCURRENCY_CONFIG, DELETE_RESOURCE_POLICY, - DeleteAliasInput, - DeleteAliasOutput, - DeleteCapacityProviderInput, - DeleteCapacityProviderOutput, - DeleteCodeSigningConfigInput, - DeleteCodeSigningConfigOutput, - DeleteEventSourceMappingInput, - DeleteEventSourceMappingOutput, - DeleteFunctionCodeSigningConfigInput, - DeleteFunctionCodeSigningConfigOutput, - DeleteFunctionConcurrencyInput, - DeleteFunctionConcurrencyOutput, - DeleteFunctionEventInvokeConfigInput, - DeleteFunctionEventInvokeConfigOutput, - DeleteFunctionInput, - DeleteFunctionOutput, - DeleteFunctionUrlConfigInput, - DeleteFunctionUrlConfigOutput, - DeleteLayerVersionInput, - DeleteLayerVersionOutput, - DeleteProvisionedConcurrencyConfigInput, - DeleteProvisionedConcurrencyConfigOutput, - DeleteResourcePolicyInput, - DeleteResourcePolicyOutput, GET_ACCOUNT_SETTINGS, GET_ALIAS, GET_CAPACITY_PROVIDER, @@ -104,59 +64,9 @@ GET_PROVISIONED_CONCURRENCY_CONFIG, GET_RESOURCE_POLICY, GET_RUNTIME_MANAGEMENT_CONFIG, - GetAccountSettingsInput, - GetAccountSettingsOutput, - GetAliasInput, - GetAliasOutput, - GetCapacityProviderInput, - GetCapacityProviderOutput, - GetCodeSigningConfigInput, - GetCodeSigningConfigOutput, - GetDurableExecutionHistoryInput, - GetDurableExecutionHistoryOutput, - GetDurableExecutionInput, - GetDurableExecutionOutput, - GetDurableExecutionStateInput, - GetDurableExecutionStateOutput, - GetEventSourceMappingInput, - GetEventSourceMappingOutput, - GetFunctionCodeSigningConfigInput, - GetFunctionCodeSigningConfigOutput, - GetFunctionConcurrencyInput, - GetFunctionConcurrencyOutput, - GetFunctionConfigurationInput, - GetFunctionConfigurationOutput, - GetFunctionEventInvokeConfigInput, - GetFunctionEventInvokeConfigOutput, - GetFunctionInput, - GetFunctionOutput, - GetFunctionRecursionConfigInput, - GetFunctionRecursionConfigOutput, - GetFunctionScalingConfigInput, - GetFunctionScalingConfigOutput, - GetFunctionUrlConfigInput, - GetFunctionUrlConfigOutput, - GetLayerVersionByArnInput, - GetLayerVersionByArnOutput, - GetLayerVersionInput, - GetLayerVersionOutput, - GetLayerVersionPolicyInput, - GetLayerVersionPolicyOutput, - GetPolicyInput, - GetPolicyOutput, - GetProvisionedConcurrencyConfigInput, - GetProvisionedConcurrencyConfigOutput, - GetResourcePolicyInput, - GetResourcePolicyOutput, - GetRuntimeManagementConfigInput, - GetRuntimeManagementConfigOutput, INVOKE, INVOKE_ASYNC, INVOKE_WITH_RESPONSE_STREAM, - InvokeAsyncInput, - InvokeAsyncOutput, - InvokeInput, - InvokeOutput, InvokeWithResponseStreamInput, InvokeWithResponseStreamOutput, InvokeWithResponseStreamResponseEvent, @@ -175,36 +85,6 @@ LIST_PROVISIONED_CONCURRENCY_CONFIGS, LIST_TAGS, LIST_VERSIONS_BY_FUNCTION, - ListAliasesInput, - ListAliasesOutput, - ListCapacityProvidersInput, - ListCapacityProvidersOutput, - ListCodeSigningConfigsInput, - ListCodeSigningConfigsOutput, - ListDurableExecutionsByFunctionInput, - ListDurableExecutionsByFunctionOutput, - ListEventSourceMappingsInput, - ListEventSourceMappingsOutput, - ListFunctionEventInvokeConfigsInput, - ListFunctionEventInvokeConfigsOutput, - ListFunctionUrlConfigsInput, - ListFunctionUrlConfigsOutput, - ListFunctionVersionsByCapacityProviderInput, - ListFunctionVersionsByCapacityProviderOutput, - ListFunctionsByCodeSigningConfigInput, - ListFunctionsByCodeSigningConfigOutput, - ListFunctionsInput, - ListFunctionsOutput, - ListLayerVersionsInput, - ListLayerVersionsOutput, - ListLayersInput, - ListLayersOutput, - ListProvisionedConcurrencyConfigsInput, - ListProvisionedConcurrencyConfigsOutput, - ListTagsInput, - ListTagsOutput, - ListVersionsByFunctionInput, - ListVersionsByFunctionOutput, PUBLISH_LAYER_VERSION, PUBLISH_VERSION, PUT_FUNCTION_CODE_SIGNING_CONFIG, @@ -215,47 +95,13 @@ PUT_PROVISIONED_CONCURRENCY_CONFIG, PUT_RESOURCE_POLICY, PUT_RUNTIME_MANAGEMENT_CONFIG, - PublishLayerVersionInput, - PublishLayerVersionOutput, - PublishVersionInput, - PublishVersionOutput, - PutFunctionCodeSigningConfigInput, - PutFunctionCodeSigningConfigOutput, - PutFunctionConcurrencyInput, - PutFunctionConcurrencyOutput, - PutFunctionEventInvokeConfigInput, - PutFunctionEventInvokeConfigOutput, - PutFunctionRecursionConfigInput, - PutFunctionRecursionConfigOutput, - PutFunctionScalingConfigInput, - PutFunctionScalingConfigOutput, - PutProvisionedConcurrencyConfigInput, - PutProvisionedConcurrencyConfigOutput, - PutResourcePolicyInput, - PutResourcePolicyOutput, - PutRuntimeManagementConfigInput, - PutRuntimeManagementConfigOutput, REMOVE_LAYER_VERSION_PERMISSION, REMOVE_PERMISSION, - RemoveLayerVersionPermissionInput, - RemoveLayerVersionPermissionOutput, - RemovePermissionInput, - RemovePermissionOutput, SEND_DURABLE_EXECUTION_CALLBACK_FAILURE, SEND_DURABLE_EXECUTION_CALLBACK_HEARTBEAT, SEND_DURABLE_EXECUTION_CALLBACK_SUCCESS, STOP_DURABLE_EXECUTION, - SendDurableExecutionCallbackFailureInput, - SendDurableExecutionCallbackFailureOutput, - SendDurableExecutionCallbackHeartbeatInput, - SendDurableExecutionCallbackHeartbeatOutput, - SendDurableExecutionCallbackSuccessInput, - SendDurableExecutionCallbackSuccessOutput, - StopDurableExecutionInput, - StopDurableExecutionOutput, TAG_RESOURCE, - TagResourceInput, - TagResourceOutput, UNTAG_RESOURCE, UPDATE_ALIAS, UPDATE_CAPACITY_PROVIDER, @@ -265,28 +111,190 @@ UPDATE_FUNCTION_CONFIGURATION, UPDATE_FUNCTION_EVENT_INVOKE_CONFIG, UPDATE_FUNCTION_URL_CONFIG, - UntagResourceInput, - UntagResourceOutput, - UpdateAliasInput, - UpdateAliasOutput, - UpdateCapacityProviderInput, - UpdateCapacityProviderOutput, - UpdateCodeSigningConfigInput, - UpdateCodeSigningConfigOutput, - UpdateEventSourceMappingInput, - UpdateEventSourceMappingOutput, - UpdateFunctionCodeInput, - UpdateFunctionCodeOutput, - UpdateFunctionConfigurationInput, - UpdateFunctionConfigurationOutput, - UpdateFunctionEventInvokeConfigInput, - UpdateFunctionEventInvokeConfigOutput, - UpdateFunctionUrlConfigInput, - UpdateFunctionUrlConfigOutput, _InvokeWithResponseStreamResponseEventDeserializer, ) from .user_agent import aws_user_agent_plugin +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .models import ( + AddLayerVersionPermissionInput, + AddLayerVersionPermissionOutput, + AddPermissionInput, + AddPermissionOutput, + CheckpointDurableExecutionInput, + CheckpointDurableExecutionOutput, + CreateAliasInput, + CreateAliasOutput, + CreateCapacityProviderInput, + CreateCapacityProviderOutput, + CreateCodeSigningConfigInput, + CreateCodeSigningConfigOutput, + CreateEventSourceMappingInput, + CreateEventSourceMappingOutput, + CreateFunctionInput, + CreateFunctionOutput, + CreateFunctionUrlConfigInput, + CreateFunctionUrlConfigOutput, + DeleteAliasInput, + DeleteAliasOutput, + DeleteCapacityProviderInput, + DeleteCapacityProviderOutput, + DeleteCodeSigningConfigInput, + DeleteCodeSigningConfigOutput, + DeleteEventSourceMappingInput, + DeleteEventSourceMappingOutput, + DeleteFunctionCodeSigningConfigInput, + DeleteFunctionCodeSigningConfigOutput, + DeleteFunctionConcurrencyInput, + DeleteFunctionConcurrencyOutput, + DeleteFunctionEventInvokeConfigInput, + DeleteFunctionEventInvokeConfigOutput, + DeleteFunctionInput, + DeleteFunctionOutput, + DeleteFunctionUrlConfigInput, + DeleteFunctionUrlConfigOutput, + DeleteLayerVersionInput, + DeleteLayerVersionOutput, + DeleteProvisionedConcurrencyConfigInput, + DeleteProvisionedConcurrencyConfigOutput, + DeleteResourcePolicyInput, + DeleteResourcePolicyOutput, + GetAccountSettingsInput, + GetAccountSettingsOutput, + GetAliasInput, + GetAliasOutput, + GetCapacityProviderInput, + GetCapacityProviderOutput, + GetCodeSigningConfigInput, + GetCodeSigningConfigOutput, + GetDurableExecutionHistoryInput, + GetDurableExecutionHistoryOutput, + GetDurableExecutionInput, + GetDurableExecutionOutput, + GetDurableExecutionStateInput, + GetDurableExecutionStateOutput, + GetEventSourceMappingInput, + GetEventSourceMappingOutput, + GetFunctionCodeSigningConfigInput, + GetFunctionCodeSigningConfigOutput, + GetFunctionConcurrencyInput, + GetFunctionConcurrencyOutput, + GetFunctionConfigurationInput, + GetFunctionConfigurationOutput, + GetFunctionEventInvokeConfigInput, + GetFunctionEventInvokeConfigOutput, + GetFunctionInput, + GetFunctionOutput, + GetFunctionRecursionConfigInput, + GetFunctionRecursionConfigOutput, + GetFunctionScalingConfigInput, + GetFunctionScalingConfigOutput, + GetFunctionUrlConfigInput, + GetFunctionUrlConfigOutput, + GetLayerVersionByArnInput, + GetLayerVersionByArnOutput, + GetLayerVersionInput, + GetLayerVersionOutput, + GetLayerVersionPolicyInput, + GetLayerVersionPolicyOutput, + GetPolicyInput, + GetPolicyOutput, + GetProvisionedConcurrencyConfigInput, + GetProvisionedConcurrencyConfigOutput, + GetResourcePolicyInput, + GetResourcePolicyOutput, + GetRuntimeManagementConfigInput, + GetRuntimeManagementConfigOutput, + InvokeAsyncInput, + InvokeAsyncOutput, + InvokeInput, + InvokeOutput, + ListAliasesInput, + ListAliasesOutput, + ListCapacityProvidersInput, + ListCapacityProvidersOutput, + ListCodeSigningConfigsInput, + ListCodeSigningConfigsOutput, + ListDurableExecutionsByFunctionInput, + ListDurableExecutionsByFunctionOutput, + ListEventSourceMappingsInput, + ListEventSourceMappingsOutput, + ListFunctionEventInvokeConfigsInput, + ListFunctionEventInvokeConfigsOutput, + ListFunctionUrlConfigsInput, + ListFunctionUrlConfigsOutput, + ListFunctionVersionsByCapacityProviderInput, + ListFunctionVersionsByCapacityProviderOutput, + ListFunctionsByCodeSigningConfigInput, + ListFunctionsByCodeSigningConfigOutput, + ListFunctionsInput, + ListFunctionsOutput, + ListLayerVersionsInput, + ListLayerVersionsOutput, + ListLayersInput, + ListLayersOutput, + ListProvisionedConcurrencyConfigsInput, + ListProvisionedConcurrencyConfigsOutput, + ListTagsInput, + ListTagsOutput, + ListVersionsByFunctionInput, + ListVersionsByFunctionOutput, + PublishLayerVersionInput, + PublishLayerVersionOutput, + PublishVersionInput, + PublishVersionOutput, + PutFunctionCodeSigningConfigInput, + PutFunctionCodeSigningConfigOutput, + PutFunctionConcurrencyInput, + PutFunctionConcurrencyOutput, + PutFunctionEventInvokeConfigInput, + PutFunctionEventInvokeConfigOutput, + PutFunctionRecursionConfigInput, + PutFunctionRecursionConfigOutput, + PutFunctionScalingConfigInput, + PutFunctionScalingConfigOutput, + PutProvisionedConcurrencyConfigInput, + PutProvisionedConcurrencyConfigOutput, + PutResourcePolicyInput, + PutResourcePolicyOutput, + PutRuntimeManagementConfigInput, + PutRuntimeManagementConfigOutput, + RemoveLayerVersionPermissionInput, + RemoveLayerVersionPermissionOutput, + RemovePermissionInput, + RemovePermissionOutput, + SendDurableExecutionCallbackFailureInput, + SendDurableExecutionCallbackFailureOutput, + SendDurableExecutionCallbackHeartbeatInput, + SendDurableExecutionCallbackHeartbeatOutput, + SendDurableExecutionCallbackSuccessInput, + SendDurableExecutionCallbackSuccessOutput, + StopDurableExecutionInput, + StopDurableExecutionOutput, + TagResourceInput, + TagResourceOutput, + UntagResourceInput, + UntagResourceOutput, + UpdateAliasInput, + UpdateAliasOutput, + UpdateCapacityProviderInput, + UpdateCapacityProviderOutput, + UpdateCodeSigningConfigInput, + UpdateCodeSigningConfigOutput, + UpdateEventSourceMappingInput, + UpdateEventSourceMappingOutput, + UpdateFunctionCodeInput, + UpdateFunctionCodeOutput, + UpdateFunctionConfigurationInput, + UpdateFunctionConfigurationOutput, + UpdateFunctionEventInvokeConfigInput, + UpdateFunctionEventInvokeConfigOutput, + UpdateFunctionUrlConfigInput, + UpdateFunctionUrlConfigOutput, + ) + logger = logging.getLogger(__name__) @@ -429,12 +437,12 @@ async def _post_setup(self, config: AsyncLambdaConfig) -> None: config_file = await config_context.parsed_profiles() if config_context.profile_source is ConfigSource.OVERRIDE: profile_name = config_context.profile_name - config.aws_credentials_identity_resolver = await IdentityChain.create( + config.aws_credentials_identity_resolver = await AsyncIdentityChain.create( AWSCredentialsIdentity, config_file=config_file, profile_name=profile_name, region_override=config.region, - http_client=cast(HTTPClient | None, config.transport), + http_client=cast(AsyncHTTPClient | None, config.transport), ) async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( @@ -443,7 +451,7 @@ async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( operation: APIOperation[I, O], default_plugins: list[Plugin], plugins: list[Plugin] | None, - ) -> tuple[RequestPipeline[Any, Any], ClientCall[I, O]]: + ) -> tuple[AsyncRequestPipeline[Any, Any], AsyncClientCall[I, O]]: if self._closed: raise RuntimeError( "Cannot invoke an operation on a client that has been closed." @@ -1887,7 +1895,7 @@ async def invoke_async( async def invoke_with_response_stream( self, input: InvokeWithResponseStreamInput, plugins: list[Plugin] | None = None - ) -> OutputEventStream[ + ) -> AsyncOutputEventStream[ InvokeWithResponseStreamResponseEvent, InvokeWithResponseStreamOutput ]: """ @@ -1912,7 +1920,7 @@ async def invoke_with_response_stream( invocations. Returns: - An `OutputEventStream` for server-to-client streaming. + An `AsyncOutputEventStream` for server-to-client streaming. """ pipeline, call = await self._prepare_call( input, INVOKE_WITH_RESPONSE_STREAM, [], plugins diff --git a/clients/aws-sdk-lambda/src/aws_sdk_lambda/config.py b/clients/aws-sdk-lambda/src/aws_sdk_lambda/config.py index 31c4b07a..3c55778e 100644 --- a/clients/aws-sdk-lambda/src/aws_sdk_lambda/config.py +++ b/clients/aws-sdk-lambda/src/aws_sdk_lambda/config.py @@ -1,427 +1,490 @@ # Code generated by smithy-python-codegen DO NOT EDIT. from dataclasses import dataclass, field -from typing import Any, Callable, ClassVar, Self, TypeAlias, Union, Unpack +from typing import ( + Any, + Callable, + ClassVar, + Self, + TYPE_CHECKING, + TypeAlias, + Union, + Unpack, +) -from smithy_aws_core.aio.protocols import RestJsonClientProtocol -from smithy_aws_core.auth import SigV4AuthScheme -from smithy_aws_core.config import AwsConfigOverrides, FileSystem -from smithy_aws_core.config.aws_config import AsyncAwsConfig -from smithy_aws_core.config.resolvers import EndpointUriResolver -from smithy_aws_core.config.types import FieldSpec -from smithy_aws_core.endpoints.standard_regional import ( - StandardRegionalEndpointsResolver, +from smithy_aws_core.aio.auth.sigv4 import AsyncSigV4AuthScheme +from smithy_aws_core.aio.config import AsyncFileSystem +from smithy_aws_core.aio.config.aws_config import AsyncAwsConfig, AwsConfigOverrides +from smithy_aws_core.aio.config.resolvers import EndpointUriResolver +from smithy_aws_core.aio.endpoints.standard_regional import ( + AsyncStandardRegionalEndpointsResolver, ) +from smithy_aws_core.aio.protocols import AsyncRestJsonClientProtocol +from smithy_aws_core.config.types import FieldSpec from smithy_aws_core.identity import AWSCredentialsIdentity, AWSIdentityProperties -from smithy_core.aio.interfaces import ( - ClientProtocol, - EndpointResolver, - ProtocolConstructor, - ProtocolSettings, -) -from smithy_core.aio.interfaces.auth import AuthScheme -from smithy_core.aio.interfaces.identity import IdentityResolver -from smithy_core.interceptors import Interceptor +from smithy_core.aio.interfaces import AsyncClientProtocol, AsyncEndpointResolver +from smithy_core.aio.interfaces.auth import AsyncAuthScheme +from smithy_core.aio.interfaces.identity import AsyncIdentityResolver +from smithy_core.interfaces import ProtocolConstructor, ProtocolSettings from smithy_core.interfaces.auth import AuthSchemeResolver from smithy_core.shapes import ShapeID from smithy_http.aio.aiohttp import AIOHTTPClient +from ._private.schemas import AWS_GIR_API_SERVICE from .auth import HTTPAuthSchemeResolver -from .models import ( - AddLayerVersionPermissionInput, - AddLayerVersionPermissionOutput, - AddPermissionInput, - AddPermissionOutput, - CheckpointDurableExecutionInput, - CheckpointDurableExecutionOutput, - CreateAliasInput, - CreateAliasOutput, - CreateCapacityProviderInput, - CreateCapacityProviderOutput, - CreateCodeSigningConfigInput, - CreateCodeSigningConfigOutput, - CreateEventSourceMappingInput, - CreateEventSourceMappingOutput, - CreateFunctionInput, - CreateFunctionOutput, - CreateFunctionUrlConfigInput, - CreateFunctionUrlConfigOutput, - DeleteAliasInput, - DeleteAliasOutput, - DeleteCapacityProviderInput, - DeleteCapacityProviderOutput, - DeleteCodeSigningConfigInput, - DeleteCodeSigningConfigOutput, - DeleteEventSourceMappingInput, - DeleteEventSourceMappingOutput, - DeleteFunctionCodeSigningConfigInput, - DeleteFunctionCodeSigningConfigOutput, - DeleteFunctionConcurrencyInput, - DeleteFunctionConcurrencyOutput, - DeleteFunctionEventInvokeConfigInput, - DeleteFunctionEventInvokeConfigOutput, - DeleteFunctionInput, - DeleteFunctionOutput, - DeleteFunctionUrlConfigInput, - DeleteFunctionUrlConfigOutput, - DeleteLayerVersionInput, - DeleteLayerVersionOutput, - DeleteProvisionedConcurrencyConfigInput, - DeleteProvisionedConcurrencyConfigOutput, - DeleteResourcePolicyInput, - DeleteResourcePolicyOutput, - GetAccountSettingsInput, - GetAccountSettingsOutput, - GetAliasInput, - GetAliasOutput, - GetCapacityProviderInput, - GetCapacityProviderOutput, - GetCodeSigningConfigInput, - GetCodeSigningConfigOutput, - GetDurableExecutionHistoryInput, - GetDurableExecutionHistoryOutput, - GetDurableExecutionInput, - GetDurableExecutionOutput, - GetDurableExecutionStateInput, - GetDurableExecutionStateOutput, - GetEventSourceMappingInput, - GetEventSourceMappingOutput, - GetFunctionCodeSigningConfigInput, - GetFunctionCodeSigningConfigOutput, - GetFunctionConcurrencyInput, - GetFunctionConcurrencyOutput, - GetFunctionConfigurationInput, - GetFunctionConfigurationOutput, - GetFunctionEventInvokeConfigInput, - GetFunctionEventInvokeConfigOutput, - GetFunctionInput, - GetFunctionOutput, - GetFunctionRecursionConfigInput, - GetFunctionRecursionConfigOutput, - GetFunctionScalingConfigInput, - GetFunctionScalingConfigOutput, - GetFunctionUrlConfigInput, - GetFunctionUrlConfigOutput, - GetLayerVersionByArnInput, - GetLayerVersionByArnOutput, - GetLayerVersionInput, - GetLayerVersionOutput, - GetLayerVersionPolicyInput, - GetLayerVersionPolicyOutput, - GetPolicyInput, - GetPolicyOutput, - GetProvisionedConcurrencyConfigInput, - GetProvisionedConcurrencyConfigOutput, - GetResourcePolicyInput, - GetResourcePolicyOutput, - GetRuntimeManagementConfigInput, - GetRuntimeManagementConfigOutput, - InvokeAsyncInput, - InvokeAsyncOutput, - InvokeInput, - InvokeOutput, - InvokeWithResponseStreamInput, - InvokeWithResponseStreamOutput, - ListAliasesInput, - ListAliasesOutput, - ListCapacityProvidersInput, - ListCapacityProvidersOutput, - ListCodeSigningConfigsInput, - ListCodeSigningConfigsOutput, - ListDurableExecutionsByFunctionInput, - ListDurableExecutionsByFunctionOutput, - ListEventSourceMappingsInput, - ListEventSourceMappingsOutput, - ListFunctionEventInvokeConfigsInput, - ListFunctionEventInvokeConfigsOutput, - ListFunctionUrlConfigsInput, - ListFunctionUrlConfigsOutput, - ListFunctionVersionsByCapacityProviderInput, - ListFunctionVersionsByCapacityProviderOutput, - ListFunctionsByCodeSigningConfigInput, - ListFunctionsByCodeSigningConfigOutput, - ListFunctionsInput, - ListFunctionsOutput, - ListLayerVersionsInput, - ListLayerVersionsOutput, - ListLayersInput, - ListLayersOutput, - ListProvisionedConcurrencyConfigsInput, - ListProvisionedConcurrencyConfigsOutput, - ListTagsInput, - ListTagsOutput, - ListVersionsByFunctionInput, - ListVersionsByFunctionOutput, - PublishLayerVersionInput, - PublishLayerVersionOutput, - PublishVersionInput, - PublishVersionOutput, - PutFunctionCodeSigningConfigInput, - PutFunctionCodeSigningConfigOutput, - PutFunctionConcurrencyInput, - PutFunctionConcurrencyOutput, - PutFunctionEventInvokeConfigInput, - PutFunctionEventInvokeConfigOutput, - PutFunctionRecursionConfigInput, - PutFunctionRecursionConfigOutput, - PutFunctionScalingConfigInput, - PutFunctionScalingConfigOutput, - PutProvisionedConcurrencyConfigInput, - PutProvisionedConcurrencyConfigOutput, - PutResourcePolicyInput, - PutResourcePolicyOutput, - PutRuntimeManagementConfigInput, - PutRuntimeManagementConfigOutput, - RemoveLayerVersionPermissionInput, - RemoveLayerVersionPermissionOutput, - RemovePermissionInput, - RemovePermissionOutput, - SendDurableExecutionCallbackFailureInput, - SendDurableExecutionCallbackFailureOutput, - SendDurableExecutionCallbackHeartbeatInput, - SendDurableExecutionCallbackHeartbeatOutput, - SendDurableExecutionCallbackSuccessInput, - SendDurableExecutionCallbackSuccessOutput, - StopDurableExecutionInput, - StopDurableExecutionOutput, - TagResourceInput, - TagResourceOutput, - UntagResourceInput, - UntagResourceOutput, - UpdateAliasInput, - UpdateAliasOutput, - UpdateCapacityProviderInput, - UpdateCapacityProviderOutput, - UpdateCodeSigningConfigInput, - UpdateCodeSigningConfigOutput, - UpdateEventSourceMappingInput, - UpdateEventSourceMappingOutput, - UpdateFunctionCodeInput, - UpdateFunctionCodeOutput, - UpdateFunctionConfigurationInput, - UpdateFunctionConfigurationOutput, - UpdateFunctionEventInvokeConfigInput, - UpdateFunctionEventInvokeConfigOutput, - UpdateFunctionUrlConfigInput, - UpdateFunctionUrlConfigOutput, -) -_ServiceInterceptor = Union[ - Interceptor[ - AddLayerVersionPermissionInput, AddLayerVersionPermissionOutput, Any, Any - ], - Interceptor[AddPermissionInput, AddPermissionOutput, Any, Any], - Interceptor[ - CheckpointDurableExecutionInput, CheckpointDurableExecutionOutput, Any, Any - ], - Interceptor[CreateAliasInput, CreateAliasOutput, Any, Any], - Interceptor[CreateCapacityProviderInput, CreateCapacityProviderOutput, Any, Any], - Interceptor[CreateCodeSigningConfigInput, CreateCodeSigningConfigOutput, Any, Any], - Interceptor[ - CreateEventSourceMappingInput, CreateEventSourceMappingOutput, Any, Any - ], - Interceptor[CreateFunctionInput, CreateFunctionOutput, Any, Any], - Interceptor[CreateFunctionUrlConfigInput, CreateFunctionUrlConfigOutput, Any, Any], - Interceptor[DeleteAliasInput, DeleteAliasOutput, Any, Any], - Interceptor[DeleteCapacityProviderInput, DeleteCapacityProviderOutput, Any, Any], - Interceptor[DeleteCodeSigningConfigInput, DeleteCodeSigningConfigOutput, Any, Any], - Interceptor[ - DeleteEventSourceMappingInput, DeleteEventSourceMappingOutput, Any, Any - ], - Interceptor[DeleteFunctionInput, DeleteFunctionOutput, Any, Any], - Interceptor[ +if TYPE_CHECKING: + from smithy_core.interceptors import Interceptor + from .models import ( + AddLayerVersionPermissionInput, + AddLayerVersionPermissionOutput, + AddPermissionInput, + AddPermissionOutput, + CheckpointDurableExecutionInput, + CheckpointDurableExecutionOutput, + CreateAliasInput, + CreateAliasOutput, + CreateCapacityProviderInput, + CreateCapacityProviderOutput, + CreateCodeSigningConfigInput, + CreateCodeSigningConfigOutput, + CreateEventSourceMappingInput, + CreateEventSourceMappingOutput, + CreateFunctionInput, + CreateFunctionOutput, + CreateFunctionUrlConfigInput, + CreateFunctionUrlConfigOutput, + DeleteAliasInput, + DeleteAliasOutput, + DeleteCapacityProviderInput, + DeleteCapacityProviderOutput, + DeleteCodeSigningConfigInput, + DeleteCodeSigningConfigOutput, + DeleteEventSourceMappingInput, + DeleteEventSourceMappingOutput, DeleteFunctionCodeSigningConfigInput, DeleteFunctionCodeSigningConfigOutput, - Any, - Any, - ], - Interceptor[ - DeleteFunctionConcurrencyInput, DeleteFunctionConcurrencyOutput, Any, Any - ], - Interceptor[ + DeleteFunctionConcurrencyInput, + DeleteFunctionConcurrencyOutput, DeleteFunctionEventInvokeConfigInput, DeleteFunctionEventInvokeConfigOutput, - Any, - Any, - ], - Interceptor[DeleteFunctionUrlConfigInput, DeleteFunctionUrlConfigOutput, Any, Any], - Interceptor[DeleteLayerVersionInput, DeleteLayerVersionOutput, Any, Any], - Interceptor[ + DeleteFunctionInput, + DeleteFunctionOutput, + DeleteFunctionUrlConfigInput, + DeleteFunctionUrlConfigOutput, + DeleteLayerVersionInput, + DeleteLayerVersionOutput, DeleteProvisionedConcurrencyConfigInput, DeleteProvisionedConcurrencyConfigOutput, - Any, - Any, - ], - Interceptor[DeleteResourcePolicyInput, DeleteResourcePolicyOutput, Any, Any], - Interceptor[GetAccountSettingsInput, GetAccountSettingsOutput, Any, Any], - Interceptor[GetAliasInput, GetAliasOutput, Any, Any], - Interceptor[GetCapacityProviderInput, GetCapacityProviderOutput, Any, Any], - Interceptor[GetCodeSigningConfigInput, GetCodeSigningConfigOutput, Any, Any], - Interceptor[GetDurableExecutionInput, GetDurableExecutionOutput, Any, Any], - Interceptor[ - GetDurableExecutionHistoryInput, GetDurableExecutionHistoryOutput, Any, Any - ], - Interceptor[ - GetDurableExecutionStateInput, GetDurableExecutionStateOutput, Any, Any - ], - Interceptor[GetEventSourceMappingInput, GetEventSourceMappingOutput, Any, Any], - Interceptor[GetFunctionInput, GetFunctionOutput, Any, Any], - Interceptor[ - GetFunctionCodeSigningConfigInput, GetFunctionCodeSigningConfigOutput, Any, Any - ], - Interceptor[GetFunctionConcurrencyInput, GetFunctionConcurrencyOutput, Any, Any], - Interceptor[ - GetFunctionConfigurationInput, GetFunctionConfigurationOutput, Any, Any - ], - Interceptor[ - GetFunctionEventInvokeConfigInput, GetFunctionEventInvokeConfigOutput, Any, Any - ], - Interceptor[ - GetFunctionRecursionConfigInput, GetFunctionRecursionConfigOutput, Any, Any - ], - Interceptor[ - GetFunctionScalingConfigInput, GetFunctionScalingConfigOutput, Any, Any - ], - Interceptor[GetFunctionUrlConfigInput, GetFunctionUrlConfigOutput, Any, Any], - Interceptor[GetLayerVersionInput, GetLayerVersionOutput, Any, Any], - Interceptor[GetLayerVersionByArnInput, GetLayerVersionByArnOutput, Any, Any], - Interceptor[GetLayerVersionPolicyInput, GetLayerVersionPolicyOutput, Any, Any], - Interceptor[GetPolicyInput, GetPolicyOutput, Any, Any], - Interceptor[ + DeleteResourcePolicyInput, + DeleteResourcePolicyOutput, + GetAccountSettingsInput, + GetAccountSettingsOutput, + GetAliasInput, + GetAliasOutput, + GetCapacityProviderInput, + GetCapacityProviderOutput, + GetCodeSigningConfigInput, + GetCodeSigningConfigOutput, + GetDurableExecutionHistoryInput, + GetDurableExecutionHistoryOutput, + GetDurableExecutionInput, + GetDurableExecutionOutput, + GetDurableExecutionStateInput, + GetDurableExecutionStateOutput, + GetEventSourceMappingInput, + GetEventSourceMappingOutput, + GetFunctionCodeSigningConfigInput, + GetFunctionCodeSigningConfigOutput, + GetFunctionConcurrencyInput, + GetFunctionConcurrencyOutput, + GetFunctionConfigurationInput, + GetFunctionConfigurationOutput, + GetFunctionEventInvokeConfigInput, + GetFunctionEventInvokeConfigOutput, + GetFunctionInput, + GetFunctionOutput, + GetFunctionRecursionConfigInput, + GetFunctionRecursionConfigOutput, + GetFunctionScalingConfigInput, + GetFunctionScalingConfigOutput, + GetFunctionUrlConfigInput, + GetFunctionUrlConfigOutput, + GetLayerVersionByArnInput, + GetLayerVersionByArnOutput, + GetLayerVersionInput, + GetLayerVersionOutput, + GetLayerVersionPolicyInput, + GetLayerVersionPolicyOutput, + GetPolicyInput, + GetPolicyOutput, GetProvisionedConcurrencyConfigInput, GetProvisionedConcurrencyConfigOutput, - Any, - Any, - ], - Interceptor[GetResourcePolicyInput, GetResourcePolicyOutput, Any, Any], - Interceptor[ - GetRuntimeManagementConfigInput, GetRuntimeManagementConfigOutput, Any, Any - ], - Interceptor[InvokeInput, InvokeOutput, Any, Any], - Interceptor[InvokeAsyncInput, InvokeAsyncOutput, Any, Any], - Interceptor[ - InvokeWithResponseStreamInput, InvokeWithResponseStreamOutput, Any, Any - ], - Interceptor[ListAliasesInput, ListAliasesOutput, Any, Any], - Interceptor[ListCapacityProvidersInput, ListCapacityProvidersOutput, Any, Any], - Interceptor[ListCodeSigningConfigsInput, ListCodeSigningConfigsOutput, Any, Any], - Interceptor[ + GetResourcePolicyInput, + GetResourcePolicyOutput, + GetRuntimeManagementConfigInput, + GetRuntimeManagementConfigOutput, + InvokeAsyncInput, + InvokeAsyncOutput, + InvokeInput, + InvokeOutput, + InvokeWithResponseStreamInput, + InvokeWithResponseStreamOutput, + ListAliasesInput, + ListAliasesOutput, + ListCapacityProvidersInput, + ListCapacityProvidersOutput, + ListCodeSigningConfigsInput, + ListCodeSigningConfigsOutput, ListDurableExecutionsByFunctionInput, ListDurableExecutionsByFunctionOutput, - Any, - Any, - ], - Interceptor[ListEventSourceMappingsInput, ListEventSourceMappingsOutput, Any, Any], - Interceptor[ + ListEventSourceMappingsInput, + ListEventSourceMappingsOutput, ListFunctionEventInvokeConfigsInput, ListFunctionEventInvokeConfigsOutput, - Any, - Any, - ], - Interceptor[ListFunctionsInput, ListFunctionsOutput, Any, Any], - Interceptor[ - ListFunctionsByCodeSigningConfigInput, - ListFunctionsByCodeSigningConfigOutput, - Any, - Any, - ], - Interceptor[ListFunctionUrlConfigsInput, ListFunctionUrlConfigsOutput, Any, Any], - Interceptor[ + ListFunctionUrlConfigsInput, + ListFunctionUrlConfigsOutput, ListFunctionVersionsByCapacityProviderInput, ListFunctionVersionsByCapacityProviderOutput, - Any, - Any, - ], - Interceptor[ListLayersInput, ListLayersOutput, Any, Any], - Interceptor[ListLayerVersionsInput, ListLayerVersionsOutput, Any, Any], - Interceptor[ + ListFunctionsByCodeSigningConfigInput, + ListFunctionsByCodeSigningConfigOutput, + ListFunctionsInput, + ListFunctionsOutput, + ListLayerVersionsInput, + ListLayerVersionsOutput, + ListLayersInput, + ListLayersOutput, ListProvisionedConcurrencyConfigsInput, ListProvisionedConcurrencyConfigsOutput, - Any, - Any, - ], - Interceptor[ListTagsInput, ListTagsOutput, Any, Any], - Interceptor[ListVersionsByFunctionInput, ListVersionsByFunctionOutput, Any, Any], - Interceptor[PublishLayerVersionInput, PublishLayerVersionOutput, Any, Any], - Interceptor[PublishVersionInput, PublishVersionOutput, Any, Any], - Interceptor[ - PutFunctionCodeSigningConfigInput, PutFunctionCodeSigningConfigOutput, Any, Any - ], - Interceptor[PutFunctionConcurrencyInput, PutFunctionConcurrencyOutput, Any, Any], - Interceptor[ - PutFunctionEventInvokeConfigInput, PutFunctionEventInvokeConfigOutput, Any, Any - ], - Interceptor[ - PutFunctionRecursionConfigInput, PutFunctionRecursionConfigOutput, Any, Any - ], - Interceptor[ - PutFunctionScalingConfigInput, PutFunctionScalingConfigOutput, Any, Any - ], - Interceptor[ + ListTagsInput, + ListTagsOutput, + ListVersionsByFunctionInput, + ListVersionsByFunctionOutput, + PublishLayerVersionInput, + PublishLayerVersionOutput, + PublishVersionInput, + PublishVersionOutput, + PutFunctionCodeSigningConfigInput, + PutFunctionCodeSigningConfigOutput, + PutFunctionConcurrencyInput, + PutFunctionConcurrencyOutput, + PutFunctionEventInvokeConfigInput, + PutFunctionEventInvokeConfigOutput, + PutFunctionRecursionConfigInput, + PutFunctionRecursionConfigOutput, + PutFunctionScalingConfigInput, + PutFunctionScalingConfigOutput, PutProvisionedConcurrencyConfigInput, PutProvisionedConcurrencyConfigOutput, - Any, - Any, - ], - Interceptor[PutResourcePolicyInput, PutResourcePolicyOutput, Any, Any], - Interceptor[ - PutRuntimeManagementConfigInput, PutRuntimeManagementConfigOutput, Any, Any - ], - Interceptor[ - RemoveLayerVersionPermissionInput, RemoveLayerVersionPermissionOutput, Any, Any - ], - Interceptor[RemovePermissionInput, RemovePermissionOutput, Any, Any], - Interceptor[ + PutResourcePolicyInput, + PutResourcePolicyOutput, + PutRuntimeManagementConfigInput, + PutRuntimeManagementConfigOutput, + RemoveLayerVersionPermissionInput, + RemoveLayerVersionPermissionOutput, + RemovePermissionInput, + RemovePermissionOutput, SendDurableExecutionCallbackFailureInput, SendDurableExecutionCallbackFailureOutput, - Any, - Any, - ], - Interceptor[ SendDurableExecutionCallbackHeartbeatInput, SendDurableExecutionCallbackHeartbeatOutput, - Any, - Any, - ], - Interceptor[ SendDurableExecutionCallbackSuccessInput, SendDurableExecutionCallbackSuccessOutput, - Any, - Any, - ], - Interceptor[StopDurableExecutionInput, StopDurableExecutionOutput, Any, Any], - Interceptor[TagResourceInput, TagResourceOutput, Any, Any], - Interceptor[UntagResourceInput, UntagResourceOutput, Any, Any], - Interceptor[UpdateAliasInput, UpdateAliasOutput, Any, Any], - Interceptor[UpdateCapacityProviderInput, UpdateCapacityProviderOutput, Any, Any], - Interceptor[UpdateCodeSigningConfigInput, UpdateCodeSigningConfigOutput, Any, Any], - Interceptor[ - UpdateEventSourceMappingInput, UpdateEventSourceMappingOutput, Any, Any - ], - Interceptor[UpdateFunctionCodeInput, UpdateFunctionCodeOutput, Any, Any], - Interceptor[ - UpdateFunctionConfigurationInput, UpdateFunctionConfigurationOutput, Any, Any - ], - Interceptor[ + StopDurableExecutionInput, + StopDurableExecutionOutput, + TagResourceInput, + TagResourceOutput, + UntagResourceInput, + UntagResourceOutput, + UpdateAliasInput, + UpdateAliasOutput, + UpdateCapacityProviderInput, + UpdateCapacityProviderOutput, + UpdateCodeSigningConfigInput, + UpdateCodeSigningConfigOutput, + UpdateEventSourceMappingInput, + UpdateEventSourceMappingOutput, + UpdateFunctionCodeInput, + UpdateFunctionCodeOutput, + UpdateFunctionConfigurationInput, + UpdateFunctionConfigurationOutput, UpdateFunctionEventInvokeConfigInput, UpdateFunctionEventInvokeConfigOutput, - Any, - Any, - ], - Interceptor[UpdateFunctionUrlConfigInput, UpdateFunctionUrlConfigOutput, Any, Any], -] + UpdateFunctionUrlConfigInput, + UpdateFunctionUrlConfigOutput, + ) + + _ServiceInterceptor = Union[ + Interceptor[ + AddLayerVersionPermissionInput, AddLayerVersionPermissionOutput, Any, Any + ], + Interceptor[AddPermissionInput, AddPermissionOutput, Any, Any], + Interceptor[ + CheckpointDurableExecutionInput, CheckpointDurableExecutionOutput, Any, Any + ], + Interceptor[CreateAliasInput, CreateAliasOutput, Any, Any], + Interceptor[ + CreateCapacityProviderInput, CreateCapacityProviderOutput, Any, Any + ], + Interceptor[ + CreateCodeSigningConfigInput, CreateCodeSigningConfigOutput, Any, Any + ], + Interceptor[ + CreateEventSourceMappingInput, CreateEventSourceMappingOutput, Any, Any + ], + Interceptor[CreateFunctionInput, CreateFunctionOutput, Any, Any], + Interceptor[ + CreateFunctionUrlConfigInput, CreateFunctionUrlConfigOutput, Any, Any + ], + Interceptor[DeleteAliasInput, DeleteAliasOutput, Any, Any], + Interceptor[ + DeleteCapacityProviderInput, DeleteCapacityProviderOutput, Any, Any + ], + Interceptor[ + DeleteCodeSigningConfigInput, DeleteCodeSigningConfigOutput, Any, Any + ], + Interceptor[ + DeleteEventSourceMappingInput, DeleteEventSourceMappingOutput, Any, Any + ], + Interceptor[DeleteFunctionInput, DeleteFunctionOutput, Any, Any], + Interceptor[ + DeleteFunctionCodeSigningConfigInput, + DeleteFunctionCodeSigningConfigOutput, + Any, + Any, + ], + Interceptor[ + DeleteFunctionConcurrencyInput, DeleteFunctionConcurrencyOutput, Any, Any + ], + Interceptor[ + DeleteFunctionEventInvokeConfigInput, + DeleteFunctionEventInvokeConfigOutput, + Any, + Any, + ], + Interceptor[ + DeleteFunctionUrlConfigInput, DeleteFunctionUrlConfigOutput, Any, Any + ], + Interceptor[DeleteLayerVersionInput, DeleteLayerVersionOutput, Any, Any], + Interceptor[ + DeleteProvisionedConcurrencyConfigInput, + DeleteProvisionedConcurrencyConfigOutput, + Any, + Any, + ], + Interceptor[DeleteResourcePolicyInput, DeleteResourcePolicyOutput, Any, Any], + Interceptor[GetAccountSettingsInput, GetAccountSettingsOutput, Any, Any], + Interceptor[GetAliasInput, GetAliasOutput, Any, Any], + Interceptor[GetCapacityProviderInput, GetCapacityProviderOutput, Any, Any], + Interceptor[GetCodeSigningConfigInput, GetCodeSigningConfigOutput, Any, Any], + Interceptor[GetDurableExecutionInput, GetDurableExecutionOutput, Any, Any], + Interceptor[ + GetDurableExecutionHistoryInput, GetDurableExecutionHistoryOutput, Any, Any + ], + Interceptor[ + GetDurableExecutionStateInput, GetDurableExecutionStateOutput, Any, Any + ], + Interceptor[GetEventSourceMappingInput, GetEventSourceMappingOutput, Any, Any], + Interceptor[GetFunctionInput, GetFunctionOutput, Any, Any], + Interceptor[ + GetFunctionCodeSigningConfigInput, + GetFunctionCodeSigningConfigOutput, + Any, + Any, + ], + Interceptor[ + GetFunctionConcurrencyInput, GetFunctionConcurrencyOutput, Any, Any + ], + Interceptor[ + GetFunctionConfigurationInput, GetFunctionConfigurationOutput, Any, Any + ], + Interceptor[ + GetFunctionEventInvokeConfigInput, + GetFunctionEventInvokeConfigOutput, + Any, + Any, + ], + Interceptor[ + GetFunctionRecursionConfigInput, GetFunctionRecursionConfigOutput, Any, Any + ], + Interceptor[ + GetFunctionScalingConfigInput, GetFunctionScalingConfigOutput, Any, Any + ], + Interceptor[GetFunctionUrlConfigInput, GetFunctionUrlConfigOutput, Any, Any], + Interceptor[GetLayerVersionInput, GetLayerVersionOutput, Any, Any], + Interceptor[GetLayerVersionByArnInput, GetLayerVersionByArnOutput, Any, Any], + Interceptor[GetLayerVersionPolicyInput, GetLayerVersionPolicyOutput, Any, Any], + Interceptor[GetPolicyInput, GetPolicyOutput, Any, Any], + Interceptor[ + GetProvisionedConcurrencyConfigInput, + GetProvisionedConcurrencyConfigOutput, + Any, + Any, + ], + Interceptor[GetResourcePolicyInput, GetResourcePolicyOutput, Any, Any], + Interceptor[ + GetRuntimeManagementConfigInput, GetRuntimeManagementConfigOutput, Any, Any + ], + Interceptor[InvokeInput, InvokeOutput, Any, Any], + Interceptor[InvokeAsyncInput, InvokeAsyncOutput, Any, Any], + Interceptor[ + InvokeWithResponseStreamInput, InvokeWithResponseStreamOutput, Any, Any + ], + Interceptor[ListAliasesInput, ListAliasesOutput, Any, Any], + Interceptor[ListCapacityProvidersInput, ListCapacityProvidersOutput, Any, Any], + Interceptor[ + ListCodeSigningConfigsInput, ListCodeSigningConfigsOutput, Any, Any + ], + Interceptor[ + ListDurableExecutionsByFunctionInput, + ListDurableExecutionsByFunctionOutput, + Any, + Any, + ], + Interceptor[ + ListEventSourceMappingsInput, ListEventSourceMappingsOutput, Any, Any + ], + Interceptor[ + ListFunctionEventInvokeConfigsInput, + ListFunctionEventInvokeConfigsOutput, + Any, + Any, + ], + Interceptor[ListFunctionsInput, ListFunctionsOutput, Any, Any], + Interceptor[ + ListFunctionsByCodeSigningConfigInput, + ListFunctionsByCodeSigningConfigOutput, + Any, + Any, + ], + Interceptor[ + ListFunctionUrlConfigsInput, ListFunctionUrlConfigsOutput, Any, Any + ], + Interceptor[ + ListFunctionVersionsByCapacityProviderInput, + ListFunctionVersionsByCapacityProviderOutput, + Any, + Any, + ], + Interceptor[ListLayersInput, ListLayersOutput, Any, Any], + Interceptor[ListLayerVersionsInput, ListLayerVersionsOutput, Any, Any], + Interceptor[ + ListProvisionedConcurrencyConfigsInput, + ListProvisionedConcurrencyConfigsOutput, + Any, + Any, + ], + Interceptor[ListTagsInput, ListTagsOutput, Any, Any], + Interceptor[ + ListVersionsByFunctionInput, ListVersionsByFunctionOutput, Any, Any + ], + Interceptor[PublishLayerVersionInput, PublishLayerVersionOutput, Any, Any], + Interceptor[PublishVersionInput, PublishVersionOutput, Any, Any], + Interceptor[ + PutFunctionCodeSigningConfigInput, + PutFunctionCodeSigningConfigOutput, + Any, + Any, + ], + Interceptor[ + PutFunctionConcurrencyInput, PutFunctionConcurrencyOutput, Any, Any + ], + Interceptor[ + PutFunctionEventInvokeConfigInput, + PutFunctionEventInvokeConfigOutput, + Any, + Any, + ], + Interceptor[ + PutFunctionRecursionConfigInput, PutFunctionRecursionConfigOutput, Any, Any + ], + Interceptor[ + PutFunctionScalingConfigInput, PutFunctionScalingConfigOutput, Any, Any + ], + Interceptor[ + PutProvisionedConcurrencyConfigInput, + PutProvisionedConcurrencyConfigOutput, + Any, + Any, + ], + Interceptor[PutResourcePolicyInput, PutResourcePolicyOutput, Any, Any], + Interceptor[ + PutRuntimeManagementConfigInput, PutRuntimeManagementConfigOutput, Any, Any + ], + Interceptor[ + RemoveLayerVersionPermissionInput, + RemoveLayerVersionPermissionOutput, + Any, + Any, + ], + Interceptor[RemovePermissionInput, RemovePermissionOutput, Any, Any], + Interceptor[ + SendDurableExecutionCallbackFailureInput, + SendDurableExecutionCallbackFailureOutput, + Any, + Any, + ], + Interceptor[ + SendDurableExecutionCallbackHeartbeatInput, + SendDurableExecutionCallbackHeartbeatOutput, + Any, + Any, + ], + Interceptor[ + SendDurableExecutionCallbackSuccessInput, + SendDurableExecutionCallbackSuccessOutput, + Any, + Any, + ], + Interceptor[StopDurableExecutionInput, StopDurableExecutionOutput, Any, Any], + Interceptor[TagResourceInput, TagResourceOutput, Any, Any], + Interceptor[UntagResourceInput, UntagResourceOutput, Any, Any], + Interceptor[UpdateAliasInput, UpdateAliasOutput, Any, Any], + Interceptor[ + UpdateCapacityProviderInput, UpdateCapacityProviderOutput, Any, Any + ], + Interceptor[ + UpdateCodeSigningConfigInput, UpdateCodeSigningConfigOutput, Any, Any + ], + Interceptor[ + UpdateEventSourceMappingInput, UpdateEventSourceMappingOutput, Any, Any + ], + Interceptor[UpdateFunctionCodeInput, UpdateFunctionCodeOutput, Any, Any], + Interceptor[ + UpdateFunctionConfigurationInput, + UpdateFunctionConfigurationOutput, + Any, + Any, + ], + Interceptor[ + UpdateFunctionEventInvokeConfigInput, + UpdateFunctionEventInvokeConfigOutput, + Any, + Any, + ], + Interceptor[ + UpdateFunctionUrlConfigInput, UpdateFunctionUrlConfigOutput, Any, Any + ], + ] +else: + _ServiceInterceptor = Any + _PROTOCOL_SETTINGS = ProtocolSettings( - namespace="com.amazonaws.lambda", service_target="AWSGirApiService" + namespace="com.amazonaws.lambda", + service_target="AWSGirApiService", + service_schema=AWS_GIR_API_SERVICE, ) class _AsyncLambdaConfigOverrides(AwsConfigOverrides, total=False): - endpoint_resolver: EndpointResolver | None + endpoint_resolver: AsyncEndpointResolver | None protocol: ( - ClientProtocol[Any, Any] | ProtocolConstructor[ClientProtocol[Any, Any]] | None + AsyncClientProtocol[Any, Any] + | ProtocolConstructor[AsyncClientProtocol[Any, Any]] + | None ) - auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None + auth_schemes: dict[ShapeID, AsyncAuthScheme[Any, Any, Any, Any]] | None auth_scheme_resolver: AuthSchemeResolver | None @@ -429,17 +492,17 @@ class _AsyncLambdaConfigOverrides(AwsConfigOverrides, total=False): class AsyncLambdaConfig(AsyncAwsConfig): """Lambda configuration (async-resolved).""" - endpoint_resolver: EndpointResolver | None = None + endpoint_resolver: AsyncEndpointResolver | None = None """ The endpoint resolver used to resolve the final endpoint per-operation based on the configuration. """ - protocol: ClientProtocol[Any, Any] | None = None + protocol: AsyncClientProtocol[Any, Any] | None = None """ Pass a protocol class reference from smithy_aws_core.aio.protocols to - select the protocol, e.g. protocol=AwsJson10ClientProtocol. For custom - protocols a protocol instance may also be passed. + select the protocol, e.g. protocol=AsyncAwsJson10ClientProtocol. For + custom protocols a protocol instance may also be passed. """ interceptors: list[_ServiceInterceptor] = field(default_factory=lambda: []) @@ -448,7 +511,7 @@ class AsyncLambdaConfig(AsyncAwsConfig): execution of a request. """ - auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None = None + auth_schemes: dict[ShapeID, AsyncAuthScheme[Any, Any, Any, Any]] | None = None """A map of auth scheme ids to auth schemes.""" auth_scheme_resolver: AuthSchemeResolver | None = None @@ -458,7 +521,7 @@ class AsyncLambdaConfig(AsyncAwsConfig): """ aws_credentials_identity_resolver: ( - IdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None + AsyncIdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None ) = None """Resolves AWS Credentials. Required for operations that use Sigv4 Auth.""" @@ -497,24 +560,24 @@ class AsyncLambdaConfig(AsyncAwsConfig): **AsyncAwsConfig._FIELDS, "endpoint_uri": FieldSpec(default=None, resolver=EndpointUriResolver("lambda")), "endpoint_resolver": FieldSpec( - default_factory=lambda: StandardRegionalEndpointsResolver( + default_factory=lambda: AsyncStandardRegionalEndpointsResolver( endpoint_prefix="lambda" ) ), "protocol": FieldSpec( - default_factory=lambda: RestJsonClientProtocol(_PROTOCOL_SETTINGS), + default_factory=lambda: AsyncRestJsonClientProtocol(_PROTOCOL_SETTINGS), converter=lambda p: p(_PROTOCOL_SETTINGS) if isinstance(p, type) else p, ), "auth_schemes": FieldSpec( default_factory=lambda: { - ShapeID("aws.auth#sigv4"): SigV4AuthScheme(service="lambda") + ShapeID("aws.auth#sigv4"): AsyncSigV4AuthScheme(service="lambda") } ), "auth_scheme_resolver": FieldSpec(default_factory=HTTPAuthSchemeResolver), "transport": FieldSpec(default_factory=lambda: AIOHTTPClient()), } - def set_auth_scheme(self, scheme: AuthScheme[Any, Any, Any, Any]) -> None: + def set_auth_scheme(self, scheme: AsyncAuthScheme[Any, Any, Any, Any]) -> None: """ Set an auth scheme implementation using its scheme ID. :param scheme: The auth scheme to add or replace. @@ -528,7 +591,7 @@ async def resolve( # pyright: ignore[reportIncompatibleMethodOverride] cls, *, profile: str | None = None, - fs: FileSystem | None = None, + fs: AsyncFileSystem | None = None, config_file_path: str | None = None, credentials_file_path: str | None = None, **overrides: Unpack[_AsyncLambdaConfigOverrides], diff --git a/clients/aws-sdk-lambda/src/aws_sdk_lambda/models.py b/clients/aws-sdk-lambda/src/aws_sdk_lambda/models.py index be7a1e9a..6d253679 100644 --- a/clients/aws-sdk-lambda/src/aws_sdk_lambda/models.py +++ b/clients/aws-sdk-lambda/src/aws_sdk_lambda/models.py @@ -1,41166 +1,2509 @@ # Code generated by smithy-python-codegen DO NOT EDIT. -from dataclasses import dataclass, field -from datetime import datetime, timezone -from enum import StrEnum -import logging -from typing import Any, Literal, Self, Union +from __future__ import annotations -from smithy_core.aio.interfaces import StreamingBlob -from smithy_core.deserializers import ShapeDeserializer -from smithy_core.documents import TypeRegistry -from smithy_core.exceptions import ModeledError, SerializationError -from smithy_core.response import EMPTY_RESPONSE_METADATA, ResponseMetadata -from smithy_core.schemas import APIOperation, Schema -from smithy_core.serializers import ShapeSerializer +from ._private import schemas as _schemas +from smithy_core._dynamic_models import ModelRegistry +from smithy_core.exceptions import ModeledError +from smithy_core.schemas import APIOperation from smithy_core.shapes import ShapeID -from smithy_core.types import UnknownEnumMixin from ._private.schemas import ( - ACCOUNT_LIMIT as _SCHEMA_ACCOUNT_LIMIT, - ACCOUNT_USAGE as _SCHEMA_ACCOUNT_USAGE, ADD_LAYER_VERSION_PERMISSION as _SCHEMA_ADD_LAYER_VERSION_PERMISSION, - ADD_LAYER_VERSION_PERMISSION_INPUT as _SCHEMA_ADD_LAYER_VERSION_PERMISSION_INPUT, - ADD_LAYER_VERSION_PERMISSION_OUTPUT as _SCHEMA_ADD_LAYER_VERSION_PERMISSION_OUTPUT, ADD_PERMISSION as _SCHEMA_ADD_PERMISSION, - ADD_PERMISSION_INPUT as _SCHEMA_ADD_PERMISSION_INPUT, - ADD_PERMISSION_OUTPUT as _SCHEMA_ADD_PERMISSION_OUTPUT, - ALIAS_CONFIGURATION as _SCHEMA_ALIAS_CONFIGURATION, - ALIAS_LIMIT_EXCEEDED_EXCEPTION as _SCHEMA_ALIAS_LIMIT_EXCEEDED_EXCEPTION, - ALIAS_ROUTING_CONFIGURATION as _SCHEMA_ALIAS_ROUTING_CONFIGURATION, - ALLOWED_PUBLISHERS as _SCHEMA_ALLOWED_PUBLISHERS, - AMAZON_MANAGED_KAFKA_EVENT_SOURCE_CONFIG as _SCHEMA_AMAZON_MANAGED_KAFKA_EVENT_SOURCE_CONFIG, - CALLBACK_DETAILS as _SCHEMA_CALLBACK_DETAILS, - CALLBACK_FAILED_DETAILS as _SCHEMA_CALLBACK_FAILED_DETAILS, - CALLBACK_OPTIONS as _SCHEMA_CALLBACK_OPTIONS, - CALLBACK_STARTED_DETAILS as _SCHEMA_CALLBACK_STARTED_DETAILS, - CALLBACK_SUCCEEDED_DETAILS as _SCHEMA_CALLBACK_SUCCEEDED_DETAILS, - CALLBACK_TIMED_OUT_DETAILS as _SCHEMA_CALLBACK_TIMED_OUT_DETAILS, - CALLBACK_TIMEOUT_EXCEPTION as _SCHEMA_CALLBACK_TIMEOUT_EXCEPTION, - CAPACITY_PROVIDER as _SCHEMA_CAPACITY_PROVIDER, - CAPACITY_PROVIDER_CONFIG as _SCHEMA_CAPACITY_PROVIDER_CONFIG, - CAPACITY_PROVIDER_LIMIT_EXCEEDED_EXCEPTION as _SCHEMA_CAPACITY_PROVIDER_LIMIT_EXCEEDED_EXCEPTION, - CAPACITY_PROVIDER_LOGGING_CONFIG as _SCHEMA_CAPACITY_PROVIDER_LOGGING_CONFIG, - CAPACITY_PROVIDER_PERMISSIONS_CONFIG as _SCHEMA_CAPACITY_PROVIDER_PERMISSIONS_CONFIG, - CAPACITY_PROVIDER_SCALING_CONFIG as _SCHEMA_CAPACITY_PROVIDER_SCALING_CONFIG, - CAPACITY_PROVIDER_TELEMETRY_CONFIG as _SCHEMA_CAPACITY_PROVIDER_TELEMETRY_CONFIG, - CAPACITY_PROVIDER_VPC_CONFIG as _SCHEMA_CAPACITY_PROVIDER_VPC_CONFIG, - CHAINED_INVOKE_DETAILS as _SCHEMA_CHAINED_INVOKE_DETAILS, - CHAINED_INVOKE_FAILED_DETAILS as _SCHEMA_CHAINED_INVOKE_FAILED_DETAILS, - CHAINED_INVOKE_OPTIONS as _SCHEMA_CHAINED_INVOKE_OPTIONS, - CHAINED_INVOKE_STARTED_DETAILS as _SCHEMA_CHAINED_INVOKE_STARTED_DETAILS, - CHAINED_INVOKE_STOPPED_DETAILS as _SCHEMA_CHAINED_INVOKE_STOPPED_DETAILS, - CHAINED_INVOKE_SUCCEEDED_DETAILS as _SCHEMA_CHAINED_INVOKE_SUCCEEDED_DETAILS, - CHAINED_INVOKE_TIMED_OUT_DETAILS as _SCHEMA_CHAINED_INVOKE_TIMED_OUT_DETAILS, CHECKPOINT_DURABLE_EXECUTION as _SCHEMA_CHECKPOINT_DURABLE_EXECUTION, - CHECKPOINT_DURABLE_EXECUTION_INPUT as _SCHEMA_CHECKPOINT_DURABLE_EXECUTION_INPUT, - CHECKPOINT_DURABLE_EXECUTION_OUTPUT as _SCHEMA_CHECKPOINT_DURABLE_EXECUTION_OUTPUT, - CHECKPOINT_UPDATED_EXECUTION_STATE as _SCHEMA_CHECKPOINT_UPDATED_EXECUTION_STATE, - CODE_ARTIFACT_USER_DELETED_EXCEPTION as _SCHEMA_CODE_ARTIFACT_USER_DELETED_EXCEPTION, - CODE_ARTIFACT_USER_FAILED_EXCEPTION as _SCHEMA_CODE_ARTIFACT_USER_FAILED_EXCEPTION, - CODE_ARTIFACT_USER_PENDING_EXCEPTION as _SCHEMA_CODE_ARTIFACT_USER_PENDING_EXCEPTION, - CODE_SIGNING_CONFIG as _SCHEMA_CODE_SIGNING_CONFIG, - CODE_SIGNING_CONFIG_NOT_FOUND_EXCEPTION as _SCHEMA_CODE_SIGNING_CONFIG_NOT_FOUND_EXCEPTION, - CODE_SIGNING_POLICIES as _SCHEMA_CODE_SIGNING_POLICIES, - CODE_STORAGE_EXCEEDED_EXCEPTION as _SCHEMA_CODE_STORAGE_EXCEEDED_EXCEPTION, - CODE_VERIFICATION_FAILED_EXCEPTION as _SCHEMA_CODE_VERIFICATION_FAILED_EXCEPTION, - CONCURRENCY as _SCHEMA_CONCURRENCY, - CONTEXT_DETAILS as _SCHEMA_CONTEXT_DETAILS, - CONTEXT_FAILED_DETAILS as _SCHEMA_CONTEXT_FAILED_DETAILS, - CONTEXT_OPTIONS as _SCHEMA_CONTEXT_OPTIONS, - CONTEXT_STARTED_DETAILS as _SCHEMA_CONTEXT_STARTED_DETAILS, - CONTEXT_SUCCEEDED_DETAILS as _SCHEMA_CONTEXT_SUCCEEDED_DETAILS, - CORS as _SCHEMA_CORS, CREATE_ALIAS as _SCHEMA_CREATE_ALIAS, - CREATE_ALIAS_INPUT as _SCHEMA_CREATE_ALIAS_INPUT, - CREATE_ALIAS_OUTPUT as _SCHEMA_CREATE_ALIAS_OUTPUT, CREATE_CAPACITY_PROVIDER as _SCHEMA_CREATE_CAPACITY_PROVIDER, - CREATE_CAPACITY_PROVIDER_INPUT as _SCHEMA_CREATE_CAPACITY_PROVIDER_INPUT, - CREATE_CAPACITY_PROVIDER_OUTPUT as _SCHEMA_CREATE_CAPACITY_PROVIDER_OUTPUT, CREATE_CODE_SIGNING_CONFIG as _SCHEMA_CREATE_CODE_SIGNING_CONFIG, - CREATE_CODE_SIGNING_CONFIG_INPUT as _SCHEMA_CREATE_CODE_SIGNING_CONFIG_INPUT, - CREATE_CODE_SIGNING_CONFIG_OUTPUT as _SCHEMA_CREATE_CODE_SIGNING_CONFIG_OUTPUT, CREATE_EVENT_SOURCE_MAPPING as _SCHEMA_CREATE_EVENT_SOURCE_MAPPING, - CREATE_EVENT_SOURCE_MAPPING_INPUT as _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_INPUT, - CREATE_EVENT_SOURCE_MAPPING_OUTPUT as _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT, CREATE_FUNCTION as _SCHEMA_CREATE_FUNCTION, - CREATE_FUNCTION_INPUT as _SCHEMA_CREATE_FUNCTION_INPUT, - CREATE_FUNCTION_OUTPUT as _SCHEMA_CREATE_FUNCTION_OUTPUT, CREATE_FUNCTION_URL_CONFIG as _SCHEMA_CREATE_FUNCTION_URL_CONFIG, - CREATE_FUNCTION_URL_CONFIG_INPUT as _SCHEMA_CREATE_FUNCTION_URL_CONFIG_INPUT, - CREATE_FUNCTION_URL_CONFIG_OUTPUT as _SCHEMA_CREATE_FUNCTION_URL_CONFIG_OUTPUT, - DEAD_LETTER_CONFIG as _SCHEMA_DEAD_LETTER_CONFIG, DELETE_ALIAS as _SCHEMA_DELETE_ALIAS, - DELETE_ALIAS_INPUT as _SCHEMA_DELETE_ALIAS_INPUT, - DELETE_ALIAS_OUTPUT as _SCHEMA_DELETE_ALIAS_OUTPUT, DELETE_CAPACITY_PROVIDER as _SCHEMA_DELETE_CAPACITY_PROVIDER, - DELETE_CAPACITY_PROVIDER_INPUT as _SCHEMA_DELETE_CAPACITY_PROVIDER_INPUT, - DELETE_CAPACITY_PROVIDER_OUTPUT as _SCHEMA_DELETE_CAPACITY_PROVIDER_OUTPUT, DELETE_CODE_SIGNING_CONFIG as _SCHEMA_DELETE_CODE_SIGNING_CONFIG, - DELETE_CODE_SIGNING_CONFIG_INPUT as _SCHEMA_DELETE_CODE_SIGNING_CONFIG_INPUT, - DELETE_CODE_SIGNING_CONFIG_OUTPUT as _SCHEMA_DELETE_CODE_SIGNING_CONFIG_OUTPUT, DELETE_EVENT_SOURCE_MAPPING as _SCHEMA_DELETE_EVENT_SOURCE_MAPPING, - DELETE_EVENT_SOURCE_MAPPING_INPUT as _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_INPUT, - DELETE_EVENT_SOURCE_MAPPING_OUTPUT as _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT, DELETE_FUNCTION as _SCHEMA_DELETE_FUNCTION, DELETE_FUNCTION_CODE_SIGNING_CONFIG as _SCHEMA_DELETE_FUNCTION_CODE_SIGNING_CONFIG, - DELETE_FUNCTION_CODE_SIGNING_CONFIG_INPUT as _SCHEMA_DELETE_FUNCTION_CODE_SIGNING_CONFIG_INPUT, - DELETE_FUNCTION_CODE_SIGNING_CONFIG_OUTPUT as _SCHEMA_DELETE_FUNCTION_CODE_SIGNING_CONFIG_OUTPUT, DELETE_FUNCTION_CONCURRENCY as _SCHEMA_DELETE_FUNCTION_CONCURRENCY, - DELETE_FUNCTION_CONCURRENCY_INPUT as _SCHEMA_DELETE_FUNCTION_CONCURRENCY_INPUT, - DELETE_FUNCTION_CONCURRENCY_OUTPUT as _SCHEMA_DELETE_FUNCTION_CONCURRENCY_OUTPUT, DELETE_FUNCTION_EVENT_INVOKE_CONFIG as _SCHEMA_DELETE_FUNCTION_EVENT_INVOKE_CONFIG, - DELETE_FUNCTION_EVENT_INVOKE_CONFIG_INPUT as _SCHEMA_DELETE_FUNCTION_EVENT_INVOKE_CONFIG_INPUT, - DELETE_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT as _SCHEMA_DELETE_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT, - DELETE_FUNCTION_INPUT as _SCHEMA_DELETE_FUNCTION_INPUT, - DELETE_FUNCTION_OUTPUT as _SCHEMA_DELETE_FUNCTION_OUTPUT, DELETE_FUNCTION_URL_CONFIG as _SCHEMA_DELETE_FUNCTION_URL_CONFIG, - DELETE_FUNCTION_URL_CONFIG_INPUT as _SCHEMA_DELETE_FUNCTION_URL_CONFIG_INPUT, - DELETE_FUNCTION_URL_CONFIG_OUTPUT as _SCHEMA_DELETE_FUNCTION_URL_CONFIG_OUTPUT, DELETE_LAYER_VERSION as _SCHEMA_DELETE_LAYER_VERSION, - DELETE_LAYER_VERSION_INPUT as _SCHEMA_DELETE_LAYER_VERSION_INPUT, - DELETE_LAYER_VERSION_OUTPUT as _SCHEMA_DELETE_LAYER_VERSION_OUTPUT, DELETE_PROVISIONED_CONCURRENCY_CONFIG as _SCHEMA_DELETE_PROVISIONED_CONCURRENCY_CONFIG, - DELETE_PROVISIONED_CONCURRENCY_CONFIG_INPUT as _SCHEMA_DELETE_PROVISIONED_CONCURRENCY_CONFIG_INPUT, - DELETE_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT as _SCHEMA_DELETE_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT, DELETE_RESOURCE_POLICY as _SCHEMA_DELETE_RESOURCE_POLICY, - DELETE_RESOURCE_POLICY_INPUT as _SCHEMA_DELETE_RESOURCE_POLICY_INPUT, - DELETE_RESOURCE_POLICY_OUTPUT as _SCHEMA_DELETE_RESOURCE_POLICY_OUTPUT, - DESTINATION_CONFIG as _SCHEMA_DESTINATION_CONFIG, - DOCUMENT_DB_EVENT_SOURCE_CONFIG as _SCHEMA_DOCUMENT_DB_EVENT_SOURCE_CONFIG, - DURABLE_CONFIG as _SCHEMA_DURABLE_CONFIG, - DURABLE_EXECUTION_ALREADY_STARTED_EXCEPTION as _SCHEMA_DURABLE_EXECUTION_ALREADY_STARTED_EXCEPTION, - EC2_ACCESS_DENIED_EXCEPTION as _SCHEMA_EC2_ACCESS_DENIED_EXCEPTION, - EC2_THROTTLED_EXCEPTION as _SCHEMA_EC2_THROTTLED_EXCEPTION, - EC2_UNEXPECTED_EXCEPTION as _SCHEMA_EC2_UNEXPECTED_EXCEPTION, - EFSIO_EXCEPTION as _SCHEMA_EFSIO_EXCEPTION, - EFS_MOUNT_CONNECTIVITY_EXCEPTION as _SCHEMA_EFS_MOUNT_CONNECTIVITY_EXCEPTION, - EFS_MOUNT_FAILURE_EXCEPTION as _SCHEMA_EFS_MOUNT_FAILURE_EXCEPTION, - EFS_MOUNT_TIMEOUT_EXCEPTION as _SCHEMA_EFS_MOUNT_TIMEOUT_EXCEPTION, - ENI_LIMIT_REACHED_EXCEPTION as _SCHEMA_ENI_LIMIT_REACHED_EXCEPTION, - ENI_NOT_READY_EXCEPTION as _SCHEMA_ENI_NOT_READY_EXCEPTION, - ENVIRONMENT as _SCHEMA_ENVIRONMENT, - ENVIRONMENT_ERROR as _SCHEMA_ENVIRONMENT_ERROR, - ENVIRONMENT_RESPONSE as _SCHEMA_ENVIRONMENT_RESPONSE, - EPHEMERAL_STORAGE as _SCHEMA_EPHEMERAL_STORAGE, - ERROR_OBJECT as _SCHEMA_ERROR_OBJECT, - EVENT as _SCHEMA_EVENT, - EVENT_ERROR as _SCHEMA_EVENT_ERROR, - EVENT_INPUT as _SCHEMA_EVENT_INPUT, - EVENT_RESULT as _SCHEMA_EVENT_RESULT, - EVENT_SOURCE_MAPPING_CONFIGURATION as _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION, - EVENT_SOURCE_MAPPING_LOGGING_CONFIG as _SCHEMA_EVENT_SOURCE_MAPPING_LOGGING_CONFIG, - EVENT_SOURCE_MAPPING_METRICS_CONFIG as _SCHEMA_EVENT_SOURCE_MAPPING_METRICS_CONFIG, - EXECUTION as _SCHEMA_EXECUTION, - EXECUTION_DETAILS as _SCHEMA_EXECUTION_DETAILS, - EXECUTION_FAILED_DETAILS as _SCHEMA_EXECUTION_FAILED_DETAILS, - EXECUTION_STARTED_DETAILS as _SCHEMA_EXECUTION_STARTED_DETAILS, - EXECUTION_STOPPED_DETAILS as _SCHEMA_EXECUTION_STOPPED_DETAILS, - EXECUTION_SUCCEEDED_DETAILS as _SCHEMA_EXECUTION_SUCCEEDED_DETAILS, - EXECUTION_TIMED_OUT_DETAILS as _SCHEMA_EXECUTION_TIMED_OUT_DETAILS, - FILE_SYSTEM_CONFIG as _SCHEMA_FILE_SYSTEM_CONFIG, - FILTER as _SCHEMA_FILTER, - FILTER_CRITERIA as _SCHEMA_FILTER_CRITERIA, - FILTER_CRITERIA_ERROR as _SCHEMA_FILTER_CRITERIA_ERROR, - FUNCTION_CODE as _SCHEMA_FUNCTION_CODE, - FUNCTION_CODE_LOCATION as _SCHEMA_FUNCTION_CODE_LOCATION, - FUNCTION_CODE_LOCATION_ERROR as _SCHEMA_FUNCTION_CODE_LOCATION_ERROR, - FUNCTION_CONFIGURATION as _SCHEMA_FUNCTION_CONFIGURATION, - FUNCTION_EVENT_INVOKE_CONFIG as _SCHEMA_FUNCTION_EVENT_INVOKE_CONFIG, - FUNCTION_SCALING_CONFIG as _SCHEMA_FUNCTION_SCALING_CONFIG, - FUNCTION_URL_CONFIG as _SCHEMA_FUNCTION_URL_CONFIG, - FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER_LIST_ITEM as _SCHEMA_FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER_LIST_ITEM, - FUNCTION_VERSIONS_PER_CAPACITY_PROVIDER_LIMIT_EXCEEDED_EXCEPTION as _SCHEMA_FUNCTION_VERSIONS_PER_CAPACITY_PROVIDER_LIMIT_EXCEEDED_EXCEPTION, GET_ACCOUNT_SETTINGS as _SCHEMA_GET_ACCOUNT_SETTINGS, - GET_ACCOUNT_SETTINGS_INPUT as _SCHEMA_GET_ACCOUNT_SETTINGS_INPUT, - GET_ACCOUNT_SETTINGS_OUTPUT as _SCHEMA_GET_ACCOUNT_SETTINGS_OUTPUT, GET_ALIAS as _SCHEMA_GET_ALIAS, - GET_ALIAS_INPUT as _SCHEMA_GET_ALIAS_INPUT, - GET_ALIAS_OUTPUT as _SCHEMA_GET_ALIAS_OUTPUT, GET_CAPACITY_PROVIDER as _SCHEMA_GET_CAPACITY_PROVIDER, - GET_CAPACITY_PROVIDER_INPUT as _SCHEMA_GET_CAPACITY_PROVIDER_INPUT, - GET_CAPACITY_PROVIDER_OUTPUT as _SCHEMA_GET_CAPACITY_PROVIDER_OUTPUT, GET_CODE_SIGNING_CONFIG as _SCHEMA_GET_CODE_SIGNING_CONFIG, - GET_CODE_SIGNING_CONFIG_INPUT as _SCHEMA_GET_CODE_SIGNING_CONFIG_INPUT, - GET_CODE_SIGNING_CONFIG_OUTPUT as _SCHEMA_GET_CODE_SIGNING_CONFIG_OUTPUT, GET_DURABLE_EXECUTION as _SCHEMA_GET_DURABLE_EXECUTION, GET_DURABLE_EXECUTION_HISTORY as _SCHEMA_GET_DURABLE_EXECUTION_HISTORY, - GET_DURABLE_EXECUTION_HISTORY_INPUT as _SCHEMA_GET_DURABLE_EXECUTION_HISTORY_INPUT, - GET_DURABLE_EXECUTION_HISTORY_OUTPUT as _SCHEMA_GET_DURABLE_EXECUTION_HISTORY_OUTPUT, - GET_DURABLE_EXECUTION_INPUT as _SCHEMA_GET_DURABLE_EXECUTION_INPUT, - GET_DURABLE_EXECUTION_OUTPUT as _SCHEMA_GET_DURABLE_EXECUTION_OUTPUT, GET_DURABLE_EXECUTION_STATE as _SCHEMA_GET_DURABLE_EXECUTION_STATE, - GET_DURABLE_EXECUTION_STATE_INPUT as _SCHEMA_GET_DURABLE_EXECUTION_STATE_INPUT, - GET_DURABLE_EXECUTION_STATE_OUTPUT as _SCHEMA_GET_DURABLE_EXECUTION_STATE_OUTPUT, GET_EVENT_SOURCE_MAPPING as _SCHEMA_GET_EVENT_SOURCE_MAPPING, - GET_EVENT_SOURCE_MAPPING_INPUT as _SCHEMA_GET_EVENT_SOURCE_MAPPING_INPUT, - GET_EVENT_SOURCE_MAPPING_OUTPUT as _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT, GET_FUNCTION as _SCHEMA_GET_FUNCTION, GET_FUNCTION_CODE_SIGNING_CONFIG as _SCHEMA_GET_FUNCTION_CODE_SIGNING_CONFIG, - GET_FUNCTION_CODE_SIGNING_CONFIG_INPUT as _SCHEMA_GET_FUNCTION_CODE_SIGNING_CONFIG_INPUT, - GET_FUNCTION_CODE_SIGNING_CONFIG_OUTPUT as _SCHEMA_GET_FUNCTION_CODE_SIGNING_CONFIG_OUTPUT, GET_FUNCTION_CONCURRENCY as _SCHEMA_GET_FUNCTION_CONCURRENCY, - GET_FUNCTION_CONCURRENCY_INPUT as _SCHEMA_GET_FUNCTION_CONCURRENCY_INPUT, - GET_FUNCTION_CONCURRENCY_OUTPUT as _SCHEMA_GET_FUNCTION_CONCURRENCY_OUTPUT, GET_FUNCTION_CONFIGURATION as _SCHEMA_GET_FUNCTION_CONFIGURATION, - GET_FUNCTION_CONFIGURATION_INPUT as _SCHEMA_GET_FUNCTION_CONFIGURATION_INPUT, - GET_FUNCTION_CONFIGURATION_OUTPUT as _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT, GET_FUNCTION_EVENT_INVOKE_CONFIG as _SCHEMA_GET_FUNCTION_EVENT_INVOKE_CONFIG, - GET_FUNCTION_EVENT_INVOKE_CONFIG_INPUT as _SCHEMA_GET_FUNCTION_EVENT_INVOKE_CONFIG_INPUT, - GET_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT as _SCHEMA_GET_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT, - GET_FUNCTION_INPUT as _SCHEMA_GET_FUNCTION_INPUT, - GET_FUNCTION_OUTPUT as _SCHEMA_GET_FUNCTION_OUTPUT, GET_FUNCTION_RECURSION_CONFIG as _SCHEMA_GET_FUNCTION_RECURSION_CONFIG, - GET_FUNCTION_RECURSION_CONFIG_INPUT as _SCHEMA_GET_FUNCTION_RECURSION_CONFIG_INPUT, - GET_FUNCTION_RECURSION_CONFIG_OUTPUT as _SCHEMA_GET_FUNCTION_RECURSION_CONFIG_OUTPUT, GET_FUNCTION_SCALING_CONFIG as _SCHEMA_GET_FUNCTION_SCALING_CONFIG, - GET_FUNCTION_SCALING_CONFIG_INPUT as _SCHEMA_GET_FUNCTION_SCALING_CONFIG_INPUT, - GET_FUNCTION_SCALING_CONFIG_OUTPUT as _SCHEMA_GET_FUNCTION_SCALING_CONFIG_OUTPUT, GET_FUNCTION_URL_CONFIG as _SCHEMA_GET_FUNCTION_URL_CONFIG, - GET_FUNCTION_URL_CONFIG_INPUT as _SCHEMA_GET_FUNCTION_URL_CONFIG_INPUT, - GET_FUNCTION_URL_CONFIG_OUTPUT as _SCHEMA_GET_FUNCTION_URL_CONFIG_OUTPUT, GET_LAYER_VERSION as _SCHEMA_GET_LAYER_VERSION, GET_LAYER_VERSION_BY_ARN as _SCHEMA_GET_LAYER_VERSION_BY_ARN, - GET_LAYER_VERSION_BY_ARN_INPUT as _SCHEMA_GET_LAYER_VERSION_BY_ARN_INPUT, - GET_LAYER_VERSION_BY_ARN_OUTPUT as _SCHEMA_GET_LAYER_VERSION_BY_ARN_OUTPUT, - GET_LAYER_VERSION_INPUT as _SCHEMA_GET_LAYER_VERSION_INPUT, - GET_LAYER_VERSION_OUTPUT as _SCHEMA_GET_LAYER_VERSION_OUTPUT, GET_LAYER_VERSION_POLICY as _SCHEMA_GET_LAYER_VERSION_POLICY, - GET_LAYER_VERSION_POLICY_INPUT as _SCHEMA_GET_LAYER_VERSION_POLICY_INPUT, - GET_LAYER_VERSION_POLICY_OUTPUT as _SCHEMA_GET_LAYER_VERSION_POLICY_OUTPUT, GET_POLICY as _SCHEMA_GET_POLICY, - GET_POLICY_INPUT as _SCHEMA_GET_POLICY_INPUT, - GET_POLICY_OUTPUT as _SCHEMA_GET_POLICY_OUTPUT, GET_PROVISIONED_CONCURRENCY_CONFIG as _SCHEMA_GET_PROVISIONED_CONCURRENCY_CONFIG, - GET_PROVISIONED_CONCURRENCY_CONFIG_INPUT as _SCHEMA_GET_PROVISIONED_CONCURRENCY_CONFIG_INPUT, - GET_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT as _SCHEMA_GET_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT, GET_RESOURCE_POLICY as _SCHEMA_GET_RESOURCE_POLICY, - GET_RESOURCE_POLICY_INPUT as _SCHEMA_GET_RESOURCE_POLICY_INPUT, - GET_RESOURCE_POLICY_OUTPUT as _SCHEMA_GET_RESOURCE_POLICY_OUTPUT, GET_RUNTIME_MANAGEMENT_CONFIG as _SCHEMA_GET_RUNTIME_MANAGEMENT_CONFIG, - GET_RUNTIME_MANAGEMENT_CONFIG_INPUT as _SCHEMA_GET_RUNTIME_MANAGEMENT_CONFIG_INPUT, - GET_RUNTIME_MANAGEMENT_CONFIG_OUTPUT as _SCHEMA_GET_RUNTIME_MANAGEMENT_CONFIG_OUTPUT, - IMAGE_CONFIG as _SCHEMA_IMAGE_CONFIG, - IMAGE_CONFIG_ERROR as _SCHEMA_IMAGE_CONFIG_ERROR, - IMAGE_CONFIG_RESPONSE as _SCHEMA_IMAGE_CONFIG_RESPONSE, - INSTANCE_REQUIREMENTS as _SCHEMA_INSTANCE_REQUIREMENTS, - INVALID_CODE_SIGNATURE_EXCEPTION as _SCHEMA_INVALID_CODE_SIGNATURE_EXCEPTION, - INVALID_PARAMETER_VALUE_EXCEPTION as _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - INVALID_REQUEST_CONTENT_EXCEPTION as _SCHEMA_INVALID_REQUEST_CONTENT_EXCEPTION, - INVALID_RUNTIME_EXCEPTION as _SCHEMA_INVALID_RUNTIME_EXCEPTION, - INVALID_SECURITY_GROUP_ID_EXCEPTION as _SCHEMA_INVALID_SECURITY_GROUP_ID_EXCEPTION, - INVALID_SUBNET_ID_EXCEPTION as _SCHEMA_INVALID_SUBNET_ID_EXCEPTION, - INVALID_ZIP_FILE_EXCEPTION as _SCHEMA_INVALID_ZIP_FILE_EXCEPTION, - INVOCATION_COMPLETED_DETAILS as _SCHEMA_INVOCATION_COMPLETED_DETAILS, INVOKE as _SCHEMA_INVOKE, INVOKE_ASYNC as _SCHEMA_INVOKE_ASYNC, - INVOKE_ASYNC_INPUT as _SCHEMA_INVOKE_ASYNC_INPUT, - INVOKE_ASYNC_OUTPUT as _SCHEMA_INVOKE_ASYNC_OUTPUT, - INVOKE_INPUT as _SCHEMA_INVOKE_INPUT, - INVOKE_OUTPUT as _SCHEMA_INVOKE_OUTPUT, - INVOKE_RESPONSE_STREAM_UPDATE as _SCHEMA_INVOKE_RESPONSE_STREAM_UPDATE, INVOKE_WITH_RESPONSE_STREAM as _SCHEMA_INVOKE_WITH_RESPONSE_STREAM, - INVOKE_WITH_RESPONSE_STREAM_COMPLETE_EVENT as _SCHEMA_INVOKE_WITH_RESPONSE_STREAM_COMPLETE_EVENT, - INVOKE_WITH_RESPONSE_STREAM_INPUT as _SCHEMA_INVOKE_WITH_RESPONSE_STREAM_INPUT, - INVOKE_WITH_RESPONSE_STREAM_OUTPUT as _SCHEMA_INVOKE_WITH_RESPONSE_STREAM_OUTPUT, - INVOKE_WITH_RESPONSE_STREAM_RESPONSE_EVENT as _SCHEMA_INVOKE_WITH_RESPONSE_STREAM_RESPONSE_EVENT, - KAFKA_SCHEMA_REGISTRY_ACCESS_CONFIG as _SCHEMA_KAFKA_SCHEMA_REGISTRY_ACCESS_CONFIG, - KAFKA_SCHEMA_REGISTRY_CONFIG as _SCHEMA_KAFKA_SCHEMA_REGISTRY_CONFIG, - KAFKA_SCHEMA_VALIDATION_CONFIG as _SCHEMA_KAFKA_SCHEMA_VALIDATION_CONFIG, - KMS_ACCESS_DENIED_EXCEPTION as _SCHEMA_KMS_ACCESS_DENIED_EXCEPTION, - KMS_DISABLED_EXCEPTION as _SCHEMA_KMS_DISABLED_EXCEPTION, - KMS_INVALID_STATE_EXCEPTION as _SCHEMA_KMS_INVALID_STATE_EXCEPTION, - KMS_NOT_FOUND_EXCEPTION as _SCHEMA_KMS_NOT_FOUND_EXCEPTION, - LAMBDA_MANAGED_INSTANCES_CAPACITY_PROVIDER_CONFIG as _SCHEMA_LAMBDA_MANAGED_INSTANCES_CAPACITY_PROVIDER_CONFIG, - LAYER as _SCHEMA_LAYER, - LAYERS_LIST_ITEM as _SCHEMA_LAYERS_LIST_ITEM, - LAYER_VERSIONS_LIST_ITEM as _SCHEMA_LAYER_VERSIONS_LIST_ITEM, - LAYER_VERSION_CONTENT_INPUT as _SCHEMA_LAYER_VERSION_CONTENT_INPUT, - LAYER_VERSION_CONTENT_OUTPUT as _SCHEMA_LAYER_VERSION_CONTENT_OUTPUT, LIST_ALIASES as _SCHEMA_LIST_ALIASES, - LIST_ALIASES_INPUT as _SCHEMA_LIST_ALIASES_INPUT, - LIST_ALIASES_OUTPUT as _SCHEMA_LIST_ALIASES_OUTPUT, LIST_CAPACITY_PROVIDERS as _SCHEMA_LIST_CAPACITY_PROVIDERS, - LIST_CAPACITY_PROVIDERS_INPUT as _SCHEMA_LIST_CAPACITY_PROVIDERS_INPUT, - LIST_CAPACITY_PROVIDERS_OUTPUT as _SCHEMA_LIST_CAPACITY_PROVIDERS_OUTPUT, LIST_CODE_SIGNING_CONFIGS as _SCHEMA_LIST_CODE_SIGNING_CONFIGS, - LIST_CODE_SIGNING_CONFIGS_INPUT as _SCHEMA_LIST_CODE_SIGNING_CONFIGS_INPUT, - LIST_CODE_SIGNING_CONFIGS_OUTPUT as _SCHEMA_LIST_CODE_SIGNING_CONFIGS_OUTPUT, LIST_DURABLE_EXECUTIONS_BY_FUNCTION as _SCHEMA_LIST_DURABLE_EXECUTIONS_BY_FUNCTION, - LIST_DURABLE_EXECUTIONS_BY_FUNCTION_INPUT as _SCHEMA_LIST_DURABLE_EXECUTIONS_BY_FUNCTION_INPUT, - LIST_DURABLE_EXECUTIONS_BY_FUNCTION_OUTPUT as _SCHEMA_LIST_DURABLE_EXECUTIONS_BY_FUNCTION_OUTPUT, LIST_EVENT_SOURCE_MAPPINGS as _SCHEMA_LIST_EVENT_SOURCE_MAPPINGS, - LIST_EVENT_SOURCE_MAPPINGS_INPUT as _SCHEMA_LIST_EVENT_SOURCE_MAPPINGS_INPUT, - LIST_EVENT_SOURCE_MAPPINGS_OUTPUT as _SCHEMA_LIST_EVENT_SOURCE_MAPPINGS_OUTPUT, LIST_FUNCTIONS as _SCHEMA_LIST_FUNCTIONS, LIST_FUNCTIONS_BY_CODE_SIGNING_CONFIG as _SCHEMA_LIST_FUNCTIONS_BY_CODE_SIGNING_CONFIG, - LIST_FUNCTIONS_BY_CODE_SIGNING_CONFIG_INPUT as _SCHEMA_LIST_FUNCTIONS_BY_CODE_SIGNING_CONFIG_INPUT, - LIST_FUNCTIONS_BY_CODE_SIGNING_CONFIG_OUTPUT as _SCHEMA_LIST_FUNCTIONS_BY_CODE_SIGNING_CONFIG_OUTPUT, - LIST_FUNCTIONS_INPUT as _SCHEMA_LIST_FUNCTIONS_INPUT, - LIST_FUNCTIONS_OUTPUT as _SCHEMA_LIST_FUNCTIONS_OUTPUT, LIST_FUNCTION_EVENT_INVOKE_CONFIGS as _SCHEMA_LIST_FUNCTION_EVENT_INVOKE_CONFIGS, - LIST_FUNCTION_EVENT_INVOKE_CONFIGS_INPUT as _SCHEMA_LIST_FUNCTION_EVENT_INVOKE_CONFIGS_INPUT, - LIST_FUNCTION_EVENT_INVOKE_CONFIGS_OUTPUT as _SCHEMA_LIST_FUNCTION_EVENT_INVOKE_CONFIGS_OUTPUT, LIST_FUNCTION_URL_CONFIGS as _SCHEMA_LIST_FUNCTION_URL_CONFIGS, - LIST_FUNCTION_URL_CONFIGS_INPUT as _SCHEMA_LIST_FUNCTION_URL_CONFIGS_INPUT, - LIST_FUNCTION_URL_CONFIGS_OUTPUT as _SCHEMA_LIST_FUNCTION_URL_CONFIGS_OUTPUT, LIST_FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER as _SCHEMA_LIST_FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER, - LIST_FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER_INPUT as _SCHEMA_LIST_FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER_INPUT, - LIST_FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER_OUTPUT as _SCHEMA_LIST_FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER_OUTPUT, LIST_LAYERS as _SCHEMA_LIST_LAYERS, - LIST_LAYERS_INPUT as _SCHEMA_LIST_LAYERS_INPUT, - LIST_LAYERS_OUTPUT as _SCHEMA_LIST_LAYERS_OUTPUT, LIST_LAYER_VERSIONS as _SCHEMA_LIST_LAYER_VERSIONS, - LIST_LAYER_VERSIONS_INPUT as _SCHEMA_LIST_LAYER_VERSIONS_INPUT, - LIST_LAYER_VERSIONS_OUTPUT as _SCHEMA_LIST_LAYER_VERSIONS_OUTPUT, LIST_PROVISIONED_CONCURRENCY_CONFIGS as _SCHEMA_LIST_PROVISIONED_CONCURRENCY_CONFIGS, - LIST_PROVISIONED_CONCURRENCY_CONFIGS_INPUT as _SCHEMA_LIST_PROVISIONED_CONCURRENCY_CONFIGS_INPUT, - LIST_PROVISIONED_CONCURRENCY_CONFIGS_OUTPUT as _SCHEMA_LIST_PROVISIONED_CONCURRENCY_CONFIGS_OUTPUT, LIST_TAGS as _SCHEMA_LIST_TAGS, - LIST_TAGS_INPUT as _SCHEMA_LIST_TAGS_INPUT, - LIST_TAGS_OUTPUT as _SCHEMA_LIST_TAGS_OUTPUT, LIST_VERSIONS_BY_FUNCTION as _SCHEMA_LIST_VERSIONS_BY_FUNCTION, - LIST_VERSIONS_BY_FUNCTION_INPUT as _SCHEMA_LIST_VERSIONS_BY_FUNCTION_INPUT, - LIST_VERSIONS_BY_FUNCTION_OUTPUT as _SCHEMA_LIST_VERSIONS_BY_FUNCTION_OUTPUT, - LOGGING_CONFIG as _SCHEMA_LOGGING_CONFIG, - MODE_NOT_SUPPORTED_EXCEPTION as _SCHEMA_MODE_NOT_SUPPORTED_EXCEPTION, - NO_PUBLISHED_VERSION_EXCEPTION as _SCHEMA_NO_PUBLISHED_VERSION_EXCEPTION, - ON_FAILURE as _SCHEMA_ON_FAILURE, - ON_SUCCESS as _SCHEMA_ON_SUCCESS, - OPERATION as _SCHEMA_OPERATION, - OPERATION_UPDATE as _SCHEMA_OPERATION_UPDATE, - POLICY_LENGTH_EXCEEDED_EXCEPTION as _SCHEMA_POLICY_LENGTH_EXCEEDED_EXCEPTION, - PRECONDITION_FAILED_EXCEPTION as _SCHEMA_PRECONDITION_FAILED_EXCEPTION, - PROPAGATE_TAGS as _SCHEMA_PROPAGATE_TAGS, - PROVISIONED_CONCURRENCY_CONFIG_LIST_ITEM as _SCHEMA_PROVISIONED_CONCURRENCY_CONFIG_LIST_ITEM, - PROVISIONED_CONCURRENCY_CONFIG_NOT_FOUND_EXCEPTION as _SCHEMA_PROVISIONED_CONCURRENCY_CONFIG_NOT_FOUND_EXCEPTION, - PROVISIONED_POLLER_CONFIG as _SCHEMA_PROVISIONED_POLLER_CONFIG, - PUBLIC_POLICY_EXCEPTION as _SCHEMA_PUBLIC_POLICY_EXCEPTION, PUBLISH_LAYER_VERSION as _SCHEMA_PUBLISH_LAYER_VERSION, - PUBLISH_LAYER_VERSION_INPUT as _SCHEMA_PUBLISH_LAYER_VERSION_INPUT, - PUBLISH_LAYER_VERSION_OUTPUT as _SCHEMA_PUBLISH_LAYER_VERSION_OUTPUT, PUBLISH_VERSION as _SCHEMA_PUBLISH_VERSION, - PUBLISH_VERSION_INPUT as _SCHEMA_PUBLISH_VERSION_INPUT, - PUBLISH_VERSION_OUTPUT as _SCHEMA_PUBLISH_VERSION_OUTPUT, PUT_FUNCTION_CODE_SIGNING_CONFIG as _SCHEMA_PUT_FUNCTION_CODE_SIGNING_CONFIG, - PUT_FUNCTION_CODE_SIGNING_CONFIG_INPUT as _SCHEMA_PUT_FUNCTION_CODE_SIGNING_CONFIG_INPUT, - PUT_FUNCTION_CODE_SIGNING_CONFIG_OUTPUT as _SCHEMA_PUT_FUNCTION_CODE_SIGNING_CONFIG_OUTPUT, PUT_FUNCTION_CONCURRENCY as _SCHEMA_PUT_FUNCTION_CONCURRENCY, - PUT_FUNCTION_CONCURRENCY_INPUT as _SCHEMA_PUT_FUNCTION_CONCURRENCY_INPUT, - PUT_FUNCTION_CONCURRENCY_OUTPUT as _SCHEMA_PUT_FUNCTION_CONCURRENCY_OUTPUT, PUT_FUNCTION_EVENT_INVOKE_CONFIG as _SCHEMA_PUT_FUNCTION_EVENT_INVOKE_CONFIG, - PUT_FUNCTION_EVENT_INVOKE_CONFIG_INPUT as _SCHEMA_PUT_FUNCTION_EVENT_INVOKE_CONFIG_INPUT, - PUT_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT as _SCHEMA_PUT_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT, PUT_FUNCTION_RECURSION_CONFIG as _SCHEMA_PUT_FUNCTION_RECURSION_CONFIG, - PUT_FUNCTION_RECURSION_CONFIG_INPUT as _SCHEMA_PUT_FUNCTION_RECURSION_CONFIG_INPUT, - PUT_FUNCTION_RECURSION_CONFIG_OUTPUT as _SCHEMA_PUT_FUNCTION_RECURSION_CONFIG_OUTPUT, PUT_FUNCTION_SCALING_CONFIG as _SCHEMA_PUT_FUNCTION_SCALING_CONFIG, - PUT_FUNCTION_SCALING_CONFIG_INPUT as _SCHEMA_PUT_FUNCTION_SCALING_CONFIG_INPUT, - PUT_FUNCTION_SCALING_CONFIG_OUTPUT as _SCHEMA_PUT_FUNCTION_SCALING_CONFIG_OUTPUT, PUT_PROVISIONED_CONCURRENCY_CONFIG as _SCHEMA_PUT_PROVISIONED_CONCURRENCY_CONFIG, - PUT_PROVISIONED_CONCURRENCY_CONFIG_INPUT as _SCHEMA_PUT_PROVISIONED_CONCURRENCY_CONFIG_INPUT, - PUT_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT as _SCHEMA_PUT_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT, PUT_RESOURCE_POLICY as _SCHEMA_PUT_RESOURCE_POLICY, - PUT_RESOURCE_POLICY_INPUT as _SCHEMA_PUT_RESOURCE_POLICY_INPUT, - PUT_RESOURCE_POLICY_OUTPUT as _SCHEMA_PUT_RESOURCE_POLICY_OUTPUT, PUT_RUNTIME_MANAGEMENT_CONFIG as _SCHEMA_PUT_RUNTIME_MANAGEMENT_CONFIG, - PUT_RUNTIME_MANAGEMENT_CONFIG_INPUT as _SCHEMA_PUT_RUNTIME_MANAGEMENT_CONFIG_INPUT, - PUT_RUNTIME_MANAGEMENT_CONFIG_OUTPUT as _SCHEMA_PUT_RUNTIME_MANAGEMENT_CONFIG_OUTPUT, - RECURSIVE_INVOCATION_EXCEPTION as _SCHEMA_RECURSIVE_INVOCATION_EXCEPTION, REMOVE_LAYER_VERSION_PERMISSION as _SCHEMA_REMOVE_LAYER_VERSION_PERMISSION, - REMOVE_LAYER_VERSION_PERMISSION_INPUT as _SCHEMA_REMOVE_LAYER_VERSION_PERMISSION_INPUT, - REMOVE_LAYER_VERSION_PERMISSION_OUTPUT as _SCHEMA_REMOVE_LAYER_VERSION_PERMISSION_OUTPUT, REMOVE_PERMISSION as _SCHEMA_REMOVE_PERMISSION, - REMOVE_PERMISSION_INPUT as _SCHEMA_REMOVE_PERMISSION_INPUT, - REMOVE_PERMISSION_OUTPUT as _SCHEMA_REMOVE_PERMISSION_OUTPUT, - REQUEST_TOO_LARGE_EXCEPTION as _SCHEMA_REQUEST_TOO_LARGE_EXCEPTION, - RESOLVED_S3_OBJECT as _SCHEMA_RESOLVED_S3_OBJECT, - RESOURCE_CONFLICT_EXCEPTION as _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - RESOURCE_IN_USE_EXCEPTION as _SCHEMA_RESOURCE_IN_USE_EXCEPTION, - RESOURCE_NOT_FOUND_EXCEPTION as _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - RESOURCE_NOT_READY_EXCEPTION as _SCHEMA_RESOURCE_NOT_READY_EXCEPTION, - RETRY_DETAILS as _SCHEMA_RETRY_DETAILS, - RUNTIME_VERSION_CONFIG as _SCHEMA_RUNTIME_VERSION_CONFIG, - RUNTIME_VERSION_ERROR as _SCHEMA_RUNTIME_VERSION_ERROR, - S3_FILES_CONFIG as _SCHEMA_S3_FILES_CONFIG, - S3_FILES_MOUNT_CONNECTIVITY_EXCEPTION as _SCHEMA_S3_FILES_MOUNT_CONNECTIVITY_EXCEPTION, - S3_FILES_MOUNT_FAILURE_EXCEPTION as _SCHEMA_S3_FILES_MOUNT_FAILURE_EXCEPTION, - S3_FILES_MOUNT_TIMEOUT_EXCEPTION as _SCHEMA_S3_FILES_MOUNT_TIMEOUT_EXCEPTION, - SCALING_CONFIG as _SCHEMA_SCALING_CONFIG, - SELF_MANAGED_EVENT_SOURCE as _SCHEMA_SELF_MANAGED_EVENT_SOURCE, - SELF_MANAGED_KAFKA_EVENT_SOURCE_CONFIG as _SCHEMA_SELF_MANAGED_KAFKA_EVENT_SOURCE_CONFIG, SEND_DURABLE_EXECUTION_CALLBACK_FAILURE as _SCHEMA_SEND_DURABLE_EXECUTION_CALLBACK_FAILURE, - SEND_DURABLE_EXECUTION_CALLBACK_FAILURE_INPUT as _SCHEMA_SEND_DURABLE_EXECUTION_CALLBACK_FAILURE_INPUT, - SEND_DURABLE_EXECUTION_CALLBACK_FAILURE_OUTPUT as _SCHEMA_SEND_DURABLE_EXECUTION_CALLBACK_FAILURE_OUTPUT, SEND_DURABLE_EXECUTION_CALLBACK_HEARTBEAT as _SCHEMA_SEND_DURABLE_EXECUTION_CALLBACK_HEARTBEAT, - SEND_DURABLE_EXECUTION_CALLBACK_HEARTBEAT_INPUT as _SCHEMA_SEND_DURABLE_EXECUTION_CALLBACK_HEARTBEAT_INPUT, - SEND_DURABLE_EXECUTION_CALLBACK_HEARTBEAT_OUTPUT as _SCHEMA_SEND_DURABLE_EXECUTION_CALLBACK_HEARTBEAT_OUTPUT, SEND_DURABLE_EXECUTION_CALLBACK_SUCCESS as _SCHEMA_SEND_DURABLE_EXECUTION_CALLBACK_SUCCESS, - SEND_DURABLE_EXECUTION_CALLBACK_SUCCESS_INPUT as _SCHEMA_SEND_DURABLE_EXECUTION_CALLBACK_SUCCESS_INPUT, - SEND_DURABLE_EXECUTION_CALLBACK_SUCCESS_OUTPUT as _SCHEMA_SEND_DURABLE_EXECUTION_CALLBACK_SUCCESS_OUTPUT, - SERIALIZED_REQUEST_ENTITY_TOO_LARGE_EXCEPTION as _SCHEMA_SERIALIZED_REQUEST_ENTITY_TOO_LARGE_EXCEPTION, - SERVICE_EXCEPTION as _SCHEMA_SERVICE_EXCEPTION, - SERVICE_QUOTA_EXCEEDED_EXCEPTION as _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - SNAP_START as _SCHEMA_SNAP_START, - SNAP_START_EXCEPTION as _SCHEMA_SNAP_START_EXCEPTION, - SNAP_START_NOT_READY_EXCEPTION as _SCHEMA_SNAP_START_NOT_READY_EXCEPTION, - SNAP_START_REGENERATION_FAILURE_EXCEPTION as _SCHEMA_SNAP_START_REGENERATION_FAILURE_EXCEPTION, - SNAP_START_RESPONSE as _SCHEMA_SNAP_START_RESPONSE, - SNAP_START_TIMEOUT_EXCEPTION as _SCHEMA_SNAP_START_TIMEOUT_EXCEPTION, - SOURCE_ACCESS_CONFIGURATION as _SCHEMA_SOURCE_ACCESS_CONFIGURATION, - STEP_DETAILS as _SCHEMA_STEP_DETAILS, - STEP_FAILED_DETAILS as _SCHEMA_STEP_FAILED_DETAILS, - STEP_OPTIONS as _SCHEMA_STEP_OPTIONS, - STEP_STARTED_DETAILS as _SCHEMA_STEP_STARTED_DETAILS, - STEP_SUCCEEDED_DETAILS as _SCHEMA_STEP_SUCCEEDED_DETAILS, STOP_DURABLE_EXECUTION as _SCHEMA_STOP_DURABLE_EXECUTION, - STOP_DURABLE_EXECUTION_INPUT as _SCHEMA_STOP_DURABLE_EXECUTION_INPUT, - STOP_DURABLE_EXECUTION_OUTPUT as _SCHEMA_STOP_DURABLE_EXECUTION_OUTPUT, - SUBNET_IP_ADDRESS_LIMIT_REACHED_EXCEPTION as _SCHEMA_SUBNET_IP_ADDRESS_LIMIT_REACHED_EXCEPTION, - TAGS_ERROR as _SCHEMA_TAGS_ERROR, TAG_RESOURCE as _SCHEMA_TAG_RESOURCE, - TAG_RESOURCE_INPUT as _SCHEMA_TAG_RESOURCE_INPUT, - TAG_RESOURCE_OUTPUT as _SCHEMA_TAG_RESOURCE_OUTPUT, - TARGET_TRACKING_SCALING_POLICY as _SCHEMA_TARGET_TRACKING_SCALING_POLICY, - TENANCY_CONFIG as _SCHEMA_TENANCY_CONFIG, - TOO_MANY_REQUESTS_EXCEPTION as _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - TRACE_HEADER as _SCHEMA_TRACE_HEADER, - TRACING_CONFIG as _SCHEMA_TRACING_CONFIG, - TRACING_CONFIG_RESPONSE as _SCHEMA_TRACING_CONFIG_RESPONSE, - UNSUPPORTED_MEDIA_TYPE_EXCEPTION as _SCHEMA_UNSUPPORTED_MEDIA_TYPE_EXCEPTION, UNTAG_RESOURCE as _SCHEMA_UNTAG_RESOURCE, - UNTAG_RESOURCE_INPUT as _SCHEMA_UNTAG_RESOURCE_INPUT, - UNTAG_RESOURCE_OUTPUT as _SCHEMA_UNTAG_RESOURCE_OUTPUT, UPDATE_ALIAS as _SCHEMA_UPDATE_ALIAS, - UPDATE_ALIAS_INPUT as _SCHEMA_UPDATE_ALIAS_INPUT, - UPDATE_ALIAS_OUTPUT as _SCHEMA_UPDATE_ALIAS_OUTPUT, UPDATE_CAPACITY_PROVIDER as _SCHEMA_UPDATE_CAPACITY_PROVIDER, - UPDATE_CAPACITY_PROVIDER_INPUT as _SCHEMA_UPDATE_CAPACITY_PROVIDER_INPUT, - UPDATE_CAPACITY_PROVIDER_OUTPUT as _SCHEMA_UPDATE_CAPACITY_PROVIDER_OUTPUT, UPDATE_CODE_SIGNING_CONFIG as _SCHEMA_UPDATE_CODE_SIGNING_CONFIG, - UPDATE_CODE_SIGNING_CONFIG_INPUT as _SCHEMA_UPDATE_CODE_SIGNING_CONFIG_INPUT, - UPDATE_CODE_SIGNING_CONFIG_OUTPUT as _SCHEMA_UPDATE_CODE_SIGNING_CONFIG_OUTPUT, UPDATE_EVENT_SOURCE_MAPPING as _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING, - UPDATE_EVENT_SOURCE_MAPPING_INPUT as _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_INPUT, - UPDATE_EVENT_SOURCE_MAPPING_OUTPUT as _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT, UPDATE_FUNCTION_CODE as _SCHEMA_UPDATE_FUNCTION_CODE, - UPDATE_FUNCTION_CODE_INPUT as _SCHEMA_UPDATE_FUNCTION_CODE_INPUT, - UPDATE_FUNCTION_CODE_OUTPUT as _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT, UPDATE_FUNCTION_CONFIGURATION as _SCHEMA_UPDATE_FUNCTION_CONFIGURATION, - UPDATE_FUNCTION_CONFIGURATION_INPUT as _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_INPUT, - UPDATE_FUNCTION_CONFIGURATION_OUTPUT as _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT, UPDATE_FUNCTION_EVENT_INVOKE_CONFIG as _SCHEMA_UPDATE_FUNCTION_EVENT_INVOKE_CONFIG, - UPDATE_FUNCTION_EVENT_INVOKE_CONFIG_INPUT as _SCHEMA_UPDATE_FUNCTION_EVENT_INVOKE_CONFIG_INPUT, - UPDATE_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT as _SCHEMA_UPDATE_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT, UPDATE_FUNCTION_URL_CONFIG as _SCHEMA_UPDATE_FUNCTION_URL_CONFIG, - UPDATE_FUNCTION_URL_CONFIG_INPUT as _SCHEMA_UPDATE_FUNCTION_URL_CONFIG_INPUT, - UPDATE_FUNCTION_URL_CONFIG_OUTPUT as _SCHEMA_UPDATE_FUNCTION_URL_CONFIG_OUTPUT, - VPC_CONFIG as _SCHEMA_VPC_CONFIG, - VPC_CONFIG_RESPONSE as _SCHEMA_VPC_CONFIG_RESPONSE, - WAIT_CANCELLED_DETAILS as _SCHEMA_WAIT_CANCELLED_DETAILS, - WAIT_DETAILS as _SCHEMA_WAIT_DETAILS, - WAIT_OPTIONS as _SCHEMA_WAIT_OPTIONS, - WAIT_STARTED_DETAILS as _SCHEMA_WAIT_STARTED_DETAILS, - WAIT_SUCCEEDED_DETAILS as _SCHEMA_WAIT_SUCCEEDED_DETAILS, ) - -logger = logging.getLogger(__name__) - - -class ServiceError(ModeledError): - """ - Base error for all errors in the service. - - Some exceptions do not extend from this class, including - synthetic, implicit, and shared exception types. - """ - - -@dataclass(kw_only=True) -class AccountLimit: - """ - Limits that are related to concurrency and storage. All file and storage - sizes are in bytes. - """ - - total_code_size: int = 0 - """ - The amount of storage space that you can use for all deployment packages - and layer archives. - """ - - code_size_unzipped: int = 0 - """ - The maximum size of a function's deployment package and layers when - they're extracted. - """ - - code_size_zipped: int = 0 - """ - The maximum size of a deployment package when it's uploaded directly to - Lambda. Use Amazon S3 for larger files. - """ - - concurrent_executions: int = 0 - """The maximum number of simultaneous function executions.""" - - unreserved_concurrent_executions: int | None = None - """ - The maximum number of simultaneous function executions, minus the - capacity that's reserved for individual functions with - PutFunctionConcurrency. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACCOUNT_LIMIT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_long( - _SCHEMA_ACCOUNT_LIMIT.members["TotalCodeSize"], self.total_code_size - ) - serializer.write_long( - _SCHEMA_ACCOUNT_LIMIT.members["CodeSizeUnzipped"], self.code_size_unzipped - ) - serializer.write_long( - _SCHEMA_ACCOUNT_LIMIT.members["CodeSizeZipped"], self.code_size_zipped - ) - serializer.write_integer( - _SCHEMA_ACCOUNT_LIMIT.members["ConcurrentExecutions"], - self.concurrent_executions, - ) - if self.unreserved_concurrent_executions is not None: - serializer.write_integer( - _SCHEMA_ACCOUNT_LIMIT.members["UnreservedConcurrentExecutions"], - self.unreserved_concurrent_executions, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["total_code_size"] = de.read_long( - _SCHEMA_ACCOUNT_LIMIT.members["TotalCodeSize"] - ) - - case 1: - kwargs["code_size_unzipped"] = de.read_long( - _SCHEMA_ACCOUNT_LIMIT.members["CodeSizeUnzipped"] - ) - - case 2: - kwargs["code_size_zipped"] = de.read_long( - _SCHEMA_ACCOUNT_LIMIT.members["CodeSizeZipped"] - ) - - case 3: - kwargs["concurrent_executions"] = de.read_integer( - _SCHEMA_ACCOUNT_LIMIT.members["ConcurrentExecutions"] - ) - - case 4: - kwargs["unreserved_concurrent_executions"] = de.read_integer( - _SCHEMA_ACCOUNT_LIMIT.members["UnreservedConcurrentExecutions"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ACCOUNT_LIMIT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class AccountUsage: - """The number of functions and amount of storage in use.""" - - total_code_size: int = 0 - """ - The amount of storage space, in bytes, that's being used by deployment - packages and layer archives. - """ - - function_count: int = 0 - """The number of Lambda functions.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACCOUNT_USAGE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_long( - _SCHEMA_ACCOUNT_USAGE.members["TotalCodeSize"], self.total_code_size - ) - serializer.write_long( - _SCHEMA_ACCOUNT_USAGE.members["FunctionCount"], self.function_count - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["total_code_size"] = de.read_long( - _SCHEMA_ACCOUNT_USAGE.members["TotalCodeSize"] - ) - - case 1: - kwargs["function_count"] = de.read_long( - _SCHEMA_ACCOUNT_USAGE.members["FunctionCount"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ACCOUNT_USAGE, consumer=_consumer) - return kwargs - - -def _serialize_additional_version_weights( - serializer: ShapeSerializer, schema: Schema, value: dict[str, float] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_double(value_schema, v)) - - -def _deserialize_additional_version_weights( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, float]: - result: dict[str, float] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_double(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AddLayerVersionPermissionInput: - """Dataclass for AddLayerVersionPermissionInput structure.""" - - layer_name: str | None = None - """The name or Amazon Resource Name (ARN) of the layer.""" - - version_number: int | None = None - """The version number.""" - - statement_id: str | None = None - """ - An identifier that distinguishes the policy from others on the same - layer version. - """ - - action: str | None = None - """ - The API action that grants access to the layer. For example, - `lambda:GetLayerVersion`. - """ - - principal: str | None = None - """ - An account ID, or `*` to grant layer usage permission to all accounts in - an organization, or all Amazon Web Services accounts (if - `organizationId` is not specified). For the last case, make sure that - you really do want all Amazon Web Services accounts to have usage - permission to this layer. - """ - - organization_id: str | None = None - """ - With the principal set to `*`, grant permission to all accounts in the - specified organization. - """ - - revision_id: str | None = None - """ - Only update the policy if the revision ID matches the ID specified. Use - this option to avoid modifying a policy that has changed since you last - read it. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ADD_LAYER_VERSION_PERMISSION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.layer_name is not None: - serializer.write_string( - _SCHEMA_ADD_LAYER_VERSION_PERMISSION_INPUT.members["LayerName"], - self.layer_name, - ) - - if self.version_number is not None: - serializer.write_long( - _SCHEMA_ADD_LAYER_VERSION_PERMISSION_INPUT.members["VersionNumber"], - self.version_number, - ) - - if self.statement_id is not None: - serializer.write_string( - _SCHEMA_ADD_LAYER_VERSION_PERMISSION_INPUT.members["StatementId"], - self.statement_id, - ) - - if self.action is not None: - serializer.write_string( - _SCHEMA_ADD_LAYER_VERSION_PERMISSION_INPUT.members["Action"], - self.action, - ) - - if self.principal is not None: - serializer.write_string( - _SCHEMA_ADD_LAYER_VERSION_PERMISSION_INPUT.members["Principal"], - self.principal, - ) - - if self.organization_id is not None: - serializer.write_string( - _SCHEMA_ADD_LAYER_VERSION_PERMISSION_INPUT.members["OrganizationId"], - self.organization_id, - ) - - if self.revision_id is not None: - serializer.write_string( - _SCHEMA_ADD_LAYER_VERSION_PERMISSION_INPUT.members["RevisionId"], - self.revision_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["layer_name"] = de.read_string( - _SCHEMA_ADD_LAYER_VERSION_PERMISSION_INPUT.members["LayerName"] - ) - - case 1: - kwargs["version_number"] = de.read_long( - _SCHEMA_ADD_LAYER_VERSION_PERMISSION_INPUT.members[ - "VersionNumber" - ] - ) - - case 2: - kwargs["statement_id"] = de.read_string( - _SCHEMA_ADD_LAYER_VERSION_PERMISSION_INPUT.members[ - "StatementId" - ] - ) - - case 3: - kwargs["action"] = de.read_string( - _SCHEMA_ADD_LAYER_VERSION_PERMISSION_INPUT.members["Action"] - ) - - case 4: - kwargs["principal"] = de.read_string( - _SCHEMA_ADD_LAYER_VERSION_PERMISSION_INPUT.members["Principal"] - ) - - case 5: - kwargs["organization_id"] = de.read_string( - _SCHEMA_ADD_LAYER_VERSION_PERMISSION_INPUT.members[ - "OrganizationId" - ] - ) - - case 6: - kwargs["revision_id"] = de.read_string( - _SCHEMA_ADD_LAYER_VERSION_PERMISSION_INPUT.members["RevisionId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ADD_LAYER_VERSION_PERMISSION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class AddLayerVersionPermissionOutput: - """Dataclass for AddLayerVersionPermissionOutput structure.""" - - statement: str | None = None - """The permission statement.""" - - revision_id: str | None = None - """A unique identifier for the current revision of the policy.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ADD_LAYER_VERSION_PERMISSION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.statement is not None: - serializer.write_string( - _SCHEMA_ADD_LAYER_VERSION_PERMISSION_OUTPUT.members["Statement"], - self.statement, - ) - - if self.revision_id is not None: - serializer.write_string( - _SCHEMA_ADD_LAYER_VERSION_PERMISSION_OUTPUT.members["RevisionId"], - self.revision_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["statement"] = de.read_string( - _SCHEMA_ADD_LAYER_VERSION_PERMISSION_OUTPUT.members["Statement"] - ) - - case 1: - kwargs["revision_id"] = de.read_string( - _SCHEMA_ADD_LAYER_VERSION_PERMISSION_OUTPUT.members[ - "RevisionId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ADD_LAYER_VERSION_PERMISSION_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InvalidParameterValueException(ServiceError): - """One of the parameters in the request is not valid.""" - - fault: Literal["client", "server"] | None = "client" - - type: str | None = None - """The exception type.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION.members["Type"], self.type - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION.members["Type"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class PolicyLengthExceededException(ServiceError): - """ - The permissions policy for the resource is too large. For more - information, see [Lambda - quotas](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html). - """ - - fault: Literal["client", "server"] | None = "client" - - type: str | None = None - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_POLICY_LENGTH_EXCEEDED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_POLICY_LENGTH_EXCEEDED_EXCEPTION.members["Type"], self.type - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_POLICY_LENGTH_EXCEEDED_EXCEPTION.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_POLICY_LENGTH_EXCEEDED_EXCEPTION.members["Type"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_POLICY_LENGTH_EXCEEDED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_POLICY_LENGTH_EXCEEDED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class PreconditionFailedException(ServiceError): - """ - The RevisionId provided does not match the latest RevisionId for the - Lambda function or alias. - - - **For AddPermission and RemovePermission API operations:** Call - `GetPolicy` to retrieve the latest RevisionId for your resource. - - - **For all other API operations:** Call `GetFunction` or `GetAlias` to - retrieve the latest RevisionId for your resource. - """ - - fault: Literal["client", "server"] | None = "client" - - type: str | None = None - """The exception type.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PRECONDITION_FAILED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_PRECONDITION_FAILED_EXCEPTION.members["Type"], self.type - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_PRECONDITION_FAILED_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_PRECONDITION_FAILED_EXCEPTION.members["Type"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_PRECONDITION_FAILED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PRECONDITION_FAILED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ResourceConflictException(ServiceError): - """The resource already exists, or another operation is in progress.""" - - fault: Literal["client", "server"] | None = "client" - - type: str | None = None - """The exception type.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESOURCE_CONFLICT_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION.members["Type"], self.type - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION.members["Type"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ResourceNotFoundException(ServiceError): - """The resource specified in the request does not exist.""" - - fault: Literal["client", "server"] | None = "client" - - type: str | None = None - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["Type"], self.type - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["Type"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ServiceException(ServiceError): - """The Lambda service encountered an internal error.""" - - fault: Literal["client", "server"] | None = "server" - - type: str | None = None - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SERVICE_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_SERVICE_EXCEPTION.members["Type"], self.type - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_SERVICE_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_SERVICE_EXCEPTION.members["Type"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_SERVICE_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SERVICE_EXCEPTION, consumer=_consumer) - return kwargs - - -class ThrottleReason(UnknownEnumMixin, StrEnum): - CONCURRENT_INVOCATION_LIMIT_EXCEEDED = "ConcurrentInvocationLimitExceeded" - FUNCTION_INVOCATION_RATE_LIMIT_EXCEEDED = "FunctionInvocationRateLimitExceeded" - RESERVED_FUNCTION_CONCURRENT_INVOCATION_LIMIT_EXCEEDED = ( - "ReservedFunctionConcurrentInvocationLimitExceeded" - ) - RESERVED_FUNCTION_INVOCATION_RATE_LIMIT_EXCEEDED = ( - "ReservedFunctionInvocationRateLimitExceeded" - ) - CALLER_RATE_LIMIT_EXCEEDED = "CallerRateLimitExceeded" - CONCURRENT_SNAPSHOT_CREATE_LIMIT_EXCEEDED = "ConcurrentSnapshotCreateLimitExceeded" - - -@dataclass(kw_only=True) -class TooManyRequestsException(ServiceError): - """ - The request throughput limit was exceeded. For more information, see - [Lambda - quotas](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html#api-requests). - """ - - fault: Literal["client", "server"] | None = "client" - - retry_after_seconds: str | None = None - """The number of seconds the caller should wait before retrying.""" - - type: str | None = None - - reason: str | None = None - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.retry_after_seconds is not None: - serializer.write_string( - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION.members["retryAfterSeconds"], - self.retry_after_seconds, - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION.members["Type"], self.type - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION.members["message"], self.message - ) - - if self.reason is not None: - serializer.write_string( - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION.members["Reason"], self.reason - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["retry_after_seconds"] = de.read_string( - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION.members["retryAfterSeconds"] - ) - - case 1: - kwargs["type"] = de.read_string( - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION.members["Type"] - ) - - case 2: - kwargs["message"] = de.read_string( - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION.members["message"] - ) - - case 3: - kwargs["reason"] = ThrottleReason( - de.read_string( - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION.members["Reason"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, consumer=_consumer - ) - return kwargs - - -ADD_LAYER_VERSION_PERMISSION = APIOperation( - input=AddLayerVersionPermissionInput, - output=AddLayerVersionPermissionOutput, - schema=_SCHEMA_ADD_LAYER_VERSION_PERMISSION, - input_schema=_SCHEMA_ADD_LAYER_VERSION_PERMISSION_INPUT, - output_schema=_SCHEMA_ADD_LAYER_VERSION_PERMISSION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#PolicyLengthExceededException" - ): PolicyLengthExceededException, - ShapeID( - "com.amazonaws.lambda#PreconditionFailedException" - ): PreconditionFailedException, - ShapeID( - "com.amazonaws.lambda#ResourceConflictException" - ): ResourceConflictException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_POLICY_LENGTH_EXCEEDED_EXCEPTION, - _SCHEMA_PRECONDITION_FAILED_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -class FunctionUrlAuthType(UnknownEnumMixin, StrEnum): - NONE = "NONE" - AWS_IAM = "AWS_IAM" - - -@dataclass(kw_only=True) -class AddPermissionInput: - """Dataclass for AddPermissionInput structure.""" - - function_name: str | None = None - """ - The name or ARN of the Lambda function, version, or alias. - - **Name formats** - - - **Function name** -- `my-function` (name-only), `my-function:v1` (with - alias). - - - **Function ARN** -- - `arn:aws:lambda:us-west-2:123456789012:function:my-function`. - - - **Partial ARN** -- `123456789012:function:my-function`. - - You can append a version number or alias to any of the formats. The - length constraint applies only to the full ARN. If you specify only the - function name, it is limited to 64 characters in length. - """ - - statement_id: str | None = None - """ - A statement identifier that differentiates the statement from others in - the same policy. - """ - - action: str | None = None - """ - The action that the principal can use on the function. For example, - `lambda:InvokeFunction` or `lambda:GetFunction`. - """ - - principal: str | None = None - """ - The Amazon Web Services service, Amazon Web Services account, IAM user, - or IAM role that invokes the function. If you specify a service, use - `SourceArn` or `SourceAccount` to limit who can invoke the function - through that service. - """ - - source_arn: str | None = None - """ - For Amazon Web Services services, the ARN of the Amazon Web Services - resource that invokes the function. For example, an Amazon S3 bucket or - Amazon SNS topic. - - Note that Lambda configures the comparison using the `StringLike` - operator. - """ - - function_url_auth_type: str | None = None - """ - The type of authentication that your function URL uses. Set to `AWS_IAM` - if you want to restrict access to authenticated users only. Set to - `NONE` if you want to bypass IAM authentication to create a public - endpoint. For more information, see [Control access to Lambda function - URLs](https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html). - """ - - invoked_via_function_url: bool | None = None - """ - Indicates whether the permission applies when the function is invoked - through a function URL. - """ - - source_account: str | None = None - """ - For Amazon Web Services service, the ID of the Amazon Web Services - account that owns the resource. Use this together with `SourceArn` to - ensure that the specified account owns the resource. It is possible for - an Amazon S3 bucket to be deleted by its owner and recreated by another - account. - """ - - event_source_token: str | None = None - """For Alexa Smart Home functions, a token that the invoker must supply.""" - - qualifier: str | None = None - """ - Specify a version or alias to add permissions to a published version of - the function. - """ - - revision_id: str | None = None - """ - Update the policy only if the revision ID matches the ID that's - specified. Use this option to avoid modifying a policy that has changed - since you last read it. - """ - - principal_org_id: str | None = None - """ - The identifier for your organization in Organizations. Use this to grant - permissions to all the Amazon Web Services accounts under this - organization. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ADD_PERMISSION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_ADD_PERMISSION_INPUT.members["FunctionName"], self.function_name - ) - - if self.statement_id is not None: - serializer.write_string( - _SCHEMA_ADD_PERMISSION_INPUT.members["StatementId"], self.statement_id - ) - - if self.action is not None: - serializer.write_string( - _SCHEMA_ADD_PERMISSION_INPUT.members["Action"], self.action - ) - - if self.principal is not None: - serializer.write_string( - _SCHEMA_ADD_PERMISSION_INPUT.members["Principal"], self.principal - ) - - if self.source_arn is not None: - serializer.write_string( - _SCHEMA_ADD_PERMISSION_INPUT.members["SourceArn"], self.source_arn - ) - - if self.function_url_auth_type is not None: - serializer.write_string( - _SCHEMA_ADD_PERMISSION_INPUT.members["FunctionUrlAuthType"], - self.function_url_auth_type, - ) - - if self.invoked_via_function_url is not None: - serializer.write_boolean( - _SCHEMA_ADD_PERMISSION_INPUT.members["InvokedViaFunctionUrl"], - self.invoked_via_function_url, - ) - - if self.source_account is not None: - serializer.write_string( - _SCHEMA_ADD_PERMISSION_INPUT.members["SourceAccount"], - self.source_account, - ) - - if self.event_source_token is not None: - serializer.write_string( - _SCHEMA_ADD_PERMISSION_INPUT.members["EventSourceToken"], - self.event_source_token, - ) - - if self.qualifier is not None: - serializer.write_string( - _SCHEMA_ADD_PERMISSION_INPUT.members["Qualifier"], self.qualifier - ) - - if self.revision_id is not None: - serializer.write_string( - _SCHEMA_ADD_PERMISSION_INPUT.members["RevisionId"], self.revision_id - ) - - if self.principal_org_id is not None: - serializer.write_string( - _SCHEMA_ADD_PERMISSION_INPUT.members["PrincipalOrgID"], - self.principal_org_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_ADD_PERMISSION_INPUT.members["FunctionName"] - ) - - case 1: - kwargs["statement_id"] = de.read_string( - _SCHEMA_ADD_PERMISSION_INPUT.members["StatementId"] - ) - - case 2: - kwargs["action"] = de.read_string( - _SCHEMA_ADD_PERMISSION_INPUT.members["Action"] - ) - - case 3: - kwargs["principal"] = de.read_string( - _SCHEMA_ADD_PERMISSION_INPUT.members["Principal"] - ) - - case 4: - kwargs["source_arn"] = de.read_string( - _SCHEMA_ADD_PERMISSION_INPUT.members["SourceArn"] - ) - - case 5: - kwargs["function_url_auth_type"] = FunctionUrlAuthType( - de.read_string( - _SCHEMA_ADD_PERMISSION_INPUT.members["FunctionUrlAuthType"] - ) - ) - - case 6: - kwargs["invoked_via_function_url"] = de.read_boolean( - _SCHEMA_ADD_PERMISSION_INPUT.members["InvokedViaFunctionUrl"] - ) - - case 7: - kwargs["source_account"] = de.read_string( - _SCHEMA_ADD_PERMISSION_INPUT.members["SourceAccount"] - ) - - case 8: - kwargs["event_source_token"] = de.read_string( - _SCHEMA_ADD_PERMISSION_INPUT.members["EventSourceToken"] - ) - - case 9: - kwargs["qualifier"] = de.read_string( - _SCHEMA_ADD_PERMISSION_INPUT.members["Qualifier"] - ) - - case 10: - kwargs["revision_id"] = de.read_string( - _SCHEMA_ADD_PERMISSION_INPUT.members["RevisionId"] - ) - - case 11: - kwargs["principal_org_id"] = de.read_string( - _SCHEMA_ADD_PERMISSION_INPUT.members["PrincipalOrgID"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ADD_PERMISSION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class AddPermissionOutput: - """Dataclass for AddPermissionOutput structure.""" - - statement: str | None = None - """The permission statement that's added to the function policy.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ADD_PERMISSION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.statement is not None: - serializer.write_string( - _SCHEMA_ADD_PERMISSION_OUTPUT.members["Statement"], self.statement - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["statement"] = de.read_string( - _SCHEMA_ADD_PERMISSION_OUTPUT.members["Statement"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ADD_PERMISSION_OUTPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class PublicPolicyException(ServiceError): - """ - The resource-based policy you tried to add to the Lambda resource would - grant public access to it, which isn't allowed. - """ - - fault: Literal["client", "server"] | None = "client" - - type: str | None = None - """The exception type.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUBLIC_POLICY_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_PUBLIC_POLICY_EXCEPTION.members["Type"], self.type - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_PUBLIC_POLICY_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_PUBLIC_POLICY_EXCEPTION.members["Type"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_PUBLIC_POLICY_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUBLIC_POLICY_EXCEPTION, consumer=_consumer) - return kwargs - - -ADD_PERMISSION = APIOperation( - input=AddPermissionInput, - output=AddPermissionOutput, - schema=_SCHEMA_ADD_PERMISSION, - input_schema=_SCHEMA_ADD_PERMISSION_INPUT, - output_schema=_SCHEMA_ADD_PERMISSION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#PolicyLengthExceededException" - ): PolicyLengthExceededException, - ShapeID( - "com.amazonaws.lambda#PreconditionFailedException" - ): PreconditionFailedException, - ShapeID( - "com.amazonaws.lambda#PublicPolicyException" - ): PublicPolicyException, - ShapeID( - "com.amazonaws.lambda#ResourceConflictException" - ): ResourceConflictException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_POLICY_LENGTH_EXCEEDED_EXCEPTION, - _SCHEMA_PRECONDITION_FAILED_EXCEPTION, - _SCHEMA_PUBLIC_POLICY_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class AliasRoutingConfiguration: - """ - The - [traffic-shifting](https://docs.aws.amazon.com/lambda/latest/dg/lambda-traffic-shifting-using-aliases.html) - configuration of a Lambda function alias. - """ - - additional_version_weights: dict[str, float] | None = None - """The second version, and the percentage of traffic that's routed to it.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ALIAS_ROUTING_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.additional_version_weights is not None: - _serialize_additional_version_weights( - serializer, - _SCHEMA_ALIAS_ROUTING_CONFIGURATION.members["AdditionalVersionWeights"], - self.additional_version_weights, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["additional_version_weights"] = ( - _deserialize_additional_version_weights( - de, - _SCHEMA_ALIAS_ROUTING_CONFIGURATION.members[ - "AdditionalVersionWeights" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ALIAS_ROUTING_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class AliasConfiguration: - """ - Provides configuration information about a Lambda function - [alias](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html). - """ - - alias_arn: str | None = None - """The Amazon Resource Name (ARN) of the alias.""" - - name: str | None = None - """The name of the alias.""" - - function_version: str | None = None - """The function version that the alias invokes.""" - - description: str | None = None - """A description of the alias.""" - - routing_config: AliasRoutingConfiguration | None = None - """ - The [routing - configuration](https://docs.aws.amazon.com/lambda/latest/dg/lambda-traffic-shifting-using-aliases.html) - of the alias. - """ - - revision_id: str | None = None - """A unique identifier that changes when you update the alias.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ALIAS_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.alias_arn is not None: - serializer.write_string( - _SCHEMA_ALIAS_CONFIGURATION.members["AliasArn"], self.alias_arn - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_ALIAS_CONFIGURATION.members["Name"], self.name - ) - - if self.function_version is not None: - serializer.write_string( - _SCHEMA_ALIAS_CONFIGURATION.members["FunctionVersion"], - self.function_version, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_ALIAS_CONFIGURATION.members["Description"], self.description - ) - - if self.routing_config is not None: - serializer.write_struct( - _SCHEMA_ALIAS_CONFIGURATION.members["RoutingConfig"], - self.routing_config, - ) - - if self.revision_id is not None: - serializer.write_string( - _SCHEMA_ALIAS_CONFIGURATION.members["RevisionId"], self.revision_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["alias_arn"] = de.read_string( - _SCHEMA_ALIAS_CONFIGURATION.members["AliasArn"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_ALIAS_CONFIGURATION.members["Name"] - ) - - case 2: - kwargs["function_version"] = de.read_string( - _SCHEMA_ALIAS_CONFIGURATION.members["FunctionVersion"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_ALIAS_CONFIGURATION.members["Description"] - ) - - case 4: - kwargs["routing_config"] = AliasRoutingConfiguration.deserialize(de) - - case 5: - kwargs["revision_id"] = de.read_string( - _SCHEMA_ALIAS_CONFIGURATION.members["RevisionId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ALIAS_CONFIGURATION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class AliasLimitExceededException(ServiceError): - """ - Lambda couldn't create the alias because your Amazon Web Services - account has exceeded the maximum number of aliases allowed per Lambda - function. For more information, see [Lambda - quotas](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html). - """ - - fault: Literal["client", "server"] | None = "client" - - type: str | None = None - """The exception type.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ALIAS_LIMIT_EXCEEDED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_ALIAS_LIMIT_EXCEEDED_EXCEPTION.members["Type"], self.type - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_ALIAS_LIMIT_EXCEEDED_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_ALIAS_LIMIT_EXCEEDED_EXCEPTION.members["Type"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_ALIAS_LIMIT_EXCEEDED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ALIAS_LIMIT_EXCEEDED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -def _serialize_alias_list( - serializer: ShapeSerializer, schema: Schema, value: list[AliasConfiguration] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_alias_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AliasConfiguration]: - result: list[AliasConfiguration] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AliasConfiguration.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_signing_profile_version_arns( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_signing_profile_version_arns( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AllowedPublishers: - """List of signing profiles that can sign a code package.""" - - signing_profile_version_arns: list[str] - """ - The Amazon Resource Name (ARN) for each of the signing profiles. A - signing profile defines a trusted user who can sign a code package. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ALLOWED_PUBLISHERS, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_signing_profile_version_arns( - serializer, - _SCHEMA_ALLOWED_PUBLISHERS.members["SigningProfileVersionArns"], - self.signing_profile_version_arns, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["signing_profile_version_arns"] = ( - _deserialize_signing_profile_version_arns( - de, - _SCHEMA_ALLOWED_PUBLISHERS.members[ - "SigningProfileVersionArns" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ALLOWED_PUBLISHERS, consumer=_consumer) - if "signing_profile_version_arns" not in kwargs: - kwargs["signing_profile_version_arns"] = [] - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(signing_profile_version_arns=[]) - - -def _serialize_allow_methods_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_allow_methods_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_allow_origins_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_allow_origins_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -class KafkaSchemaRegistryAuthType(UnknownEnumMixin, StrEnum): - BASIC_AUTH = "BASIC_AUTH" - CLIENT_CERTIFICATE_TLS_AUTH = "CLIENT_CERTIFICATE_TLS_AUTH" - SERVER_ROOT_CA_CERTIFICATE = "SERVER_ROOT_CA_CERTIFICATE" - - -@dataclass(kw_only=True) -class KafkaSchemaRegistryAccessConfig: - """ - Specific access configuration settings that tell Lambda how to - authenticate with your schema registry. - - If you're working with an Glue schema registry, don't provide - authentication details in this object. Instead, ensure that your - execution role has the required permissions for Lambda to access your - cluster. - - If you're working with a Confluent schema registry, choose the - authentication method in the `Type` field, and provide the Secrets - Manager secret ARN in the `URI` field. - """ - - type: str | None = None - """The type of authentication Lambda uses to access your schema registry.""" - - uri: str | None = None - """ - The URI of the secret (Secrets Manager secret ARN) to authenticate with - your schema registry. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KAFKA_SCHEMA_REGISTRY_ACCESS_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_KAFKA_SCHEMA_REGISTRY_ACCESS_CONFIG.members["Type"], self.type - ) - - if self.uri is not None: - serializer.write_string( - _SCHEMA_KAFKA_SCHEMA_REGISTRY_ACCESS_CONFIG.members["URI"], self.uri - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = KafkaSchemaRegistryAuthType( - de.read_string( - _SCHEMA_KAFKA_SCHEMA_REGISTRY_ACCESS_CONFIG.members["Type"] - ) - ) - - case 1: - kwargs["uri"] = de.read_string( - _SCHEMA_KAFKA_SCHEMA_REGISTRY_ACCESS_CONFIG.members["URI"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_KAFKA_SCHEMA_REGISTRY_ACCESS_CONFIG, consumer=_consumer - ) - return kwargs - - -def _serialize_kafka_schema_registry_access_config_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[KafkaSchemaRegistryAccessConfig], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_kafka_schema_registry_access_config_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[KafkaSchemaRegistryAccessConfig]: - result: list[KafkaSchemaRegistryAccessConfig] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(KafkaSchemaRegistryAccessConfig.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class SchemaRegistryEventRecordFormat(UnknownEnumMixin, StrEnum): - JSON = "JSON" - SOURCE = "SOURCE" - - -class KafkaSchemaValidationAttribute(UnknownEnumMixin, StrEnum): - KEY = "KEY" - VALUE = "VALUE" - - -@dataclass(kw_only=True) -class KafkaSchemaValidationConfig: - """ - Specific schema validation configuration settings that tell Lambda the - message attributes you want to validate and filter using your schema - registry. - """ - - attribute: str | None = None - """ - The attributes you want your schema registry to validate and filter for. - If you selected `JSON` as the `EventRecordFormat`, Lambda also - deserializes the selected message attributes. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KAFKA_SCHEMA_VALIDATION_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.attribute is not None: - serializer.write_string( - _SCHEMA_KAFKA_SCHEMA_VALIDATION_CONFIG.members["Attribute"], - self.attribute, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["attribute"] = KafkaSchemaValidationAttribute( - de.read_string( - _SCHEMA_KAFKA_SCHEMA_VALIDATION_CONFIG.members["Attribute"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_KAFKA_SCHEMA_VALIDATION_CONFIG, consumer=_consumer - ) - return kwargs - - -def _serialize_kafka_schema_validation_config_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[KafkaSchemaValidationConfig], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_kafka_schema_validation_config_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[KafkaSchemaValidationConfig]: - result: list[KafkaSchemaValidationConfig] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(KafkaSchemaValidationConfig.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class KafkaSchemaRegistryConfig: - """Specific configuration settings for a Kafka schema registry.""" - - schema_registry_uri: str | None = None - """ - The URI for your schema registry. The correct URI format depends on the - type of schema registry you're using. - - - For Glue schema registries, use the ARN of the registry. - - - For Confluent schema registries, use the URL of the registry. - """ - - event_record_format: str | None = None - """ - The record format that Lambda delivers to your function after schema - validation. - - - Choose `JSON` to have Lambda deliver the record to your function as a - standard JSON object. - - - Choose `SOURCE` to have Lambda deliver the record to your function in - its original source format. Lambda removes all schema metadata, such - as the schema ID, before sending the record to your function. - """ - - access_configs: list[KafkaSchemaRegistryAccessConfig] | None = None - """ - An array of access configuration objects that tell Lambda how to - authenticate with your schema registry. - """ - - schema_validation_configs: list[KafkaSchemaValidationConfig] | None = None - """ - An array of schema validation configuration objects, which tell Lambda - the message attributes you want to validate and filter using your schema - registry. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KAFKA_SCHEMA_REGISTRY_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.schema_registry_uri is not None: - serializer.write_string( - _SCHEMA_KAFKA_SCHEMA_REGISTRY_CONFIG.members["SchemaRegistryURI"], - self.schema_registry_uri, - ) - - if self.event_record_format is not None: - serializer.write_string( - _SCHEMA_KAFKA_SCHEMA_REGISTRY_CONFIG.members["EventRecordFormat"], - self.event_record_format, - ) - - if self.access_configs is not None: - _serialize_kafka_schema_registry_access_config_list( - serializer, - _SCHEMA_KAFKA_SCHEMA_REGISTRY_CONFIG.members["AccessConfigs"], - self.access_configs, - ) - - if self.schema_validation_configs is not None: - _serialize_kafka_schema_validation_config_list( - serializer, - _SCHEMA_KAFKA_SCHEMA_REGISTRY_CONFIG.members["SchemaValidationConfigs"], - self.schema_validation_configs, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["schema_registry_uri"] = de.read_string( - _SCHEMA_KAFKA_SCHEMA_REGISTRY_CONFIG.members[ - "SchemaRegistryURI" - ] - ) - - case 1: - kwargs["event_record_format"] = SchemaRegistryEventRecordFormat( - de.read_string( - _SCHEMA_KAFKA_SCHEMA_REGISTRY_CONFIG.members[ - "EventRecordFormat" - ] - ) - ) - - case 2: - kwargs["access_configs"] = ( - _deserialize_kafka_schema_registry_access_config_list( - de, - _SCHEMA_KAFKA_SCHEMA_REGISTRY_CONFIG.members[ - "AccessConfigs" - ], - ) - ) - - case 3: - kwargs["schema_validation_configs"] = ( - _deserialize_kafka_schema_validation_config_list( - de, - _SCHEMA_KAFKA_SCHEMA_REGISTRY_CONFIG.members[ - "SchemaValidationConfigs" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_KAFKA_SCHEMA_REGISTRY_CONFIG, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class AmazonManagedKafkaEventSourceConfig: - """ - Specific configuration settings for an Amazon Managed Streaming for - Apache Kafka (Amazon MSK) event source. - """ - - consumer_group_id: str | None = None - """ - The identifier for the Kafka consumer group to join. The consumer group - ID must be unique among all your Kafka event sources. After creating a - Kafka event source mapping with the consumer group ID specified, you - cannot update this value. For more information, see [Customizable - consumer group - ID](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#services-msk-consumer-group-id). - """ - - schema_registry_config: KafkaSchemaRegistryConfig | None = None - """Specific configuration settings for a Kafka schema registry.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AMAZON_MANAGED_KAFKA_EVENT_SOURCE_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.consumer_group_id is not None: - serializer.write_string( - _SCHEMA_AMAZON_MANAGED_KAFKA_EVENT_SOURCE_CONFIG.members[ - "ConsumerGroupId" - ], - self.consumer_group_id, - ) - - if self.schema_registry_config is not None: - serializer.write_struct( - _SCHEMA_AMAZON_MANAGED_KAFKA_EVENT_SOURCE_CONFIG.members[ - "SchemaRegistryConfig" - ], - self.schema_registry_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["consumer_group_id"] = de.read_string( - _SCHEMA_AMAZON_MANAGED_KAFKA_EVENT_SOURCE_CONFIG.members[ - "ConsumerGroupId" - ] - ) - - case 1: - kwargs["schema_registry_config"] = ( - KafkaSchemaRegistryConfig.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AMAZON_MANAGED_KAFKA_EVENT_SOURCE_CONFIG, consumer=_consumer - ) - return kwargs - - -class ApplicationLogLevel(UnknownEnumMixin, StrEnum): - TRACE = "TRACE" - DEBUG = "DEBUG" - INFO = "INFO" - WARN = "WARN" - ERROR = "ERROR" - FATAL = "FATAL" - - -class Architecture(UnknownEnumMixin, StrEnum): - X86_64 = "x86_64" - ARM64 = "arm64" - - -def _serialize_architectures_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_architectures_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Architecture(d.read_string(member_schema))) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CapacityProviderLimitExceededException(ServiceError): - """ - The maximum number of capacity providers for your account has been - exceeded. For more information, see [Lambda - quotas](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html) - """ - - fault: Literal["client", "server"] | None = "client" - - type: str | None = None - """The exception type.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CAPACITY_PROVIDER_LIMIT_EXCEEDED_EXCEPTION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_CAPACITY_PROVIDER_LIMIT_EXCEEDED_EXCEPTION.members["Type"], - self.type, - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_CAPACITY_PROVIDER_LIMIT_EXCEEDED_EXCEPTION.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_CAPACITY_PROVIDER_LIMIT_EXCEEDED_EXCEPTION.members[ - "Type" - ] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_CAPACITY_PROVIDER_LIMIT_EXCEEDED_EXCEPTION.members[ - "message" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CAPACITY_PROVIDER_LIMIT_EXCEEDED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -class CapacityProviderScalingMode(UnknownEnumMixin, StrEnum): - AUTO = "Auto" - MANUAL = "Manual" - - -class CapacityProviderPredefinedMetricType(UnknownEnumMixin, StrEnum): - LAMBDA_CAPACITY_PROVIDER_AVERAGE_CPU_UTILIZATION = ( - "LambdaCapacityProviderAverageCPUUtilization" - ) - - -@dataclass(kw_only=True) -class TargetTrackingScalingPolicy: - """ - A scaling policy for the capacity provider that automatically adjusts - capacity to maintain a target value for a specific metric. - """ - - predefined_metric_type: str - """The predefined metric type to track for scaling decisions.""" - - target_value: float - """ - The target value for the metric that the scaling policy attempts to - maintain through scaling actions. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TARGET_TRACKING_SCALING_POLICY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_TARGET_TRACKING_SCALING_POLICY.members["PredefinedMetricType"], - self.predefined_metric_type, - ) - serializer.write_double( - _SCHEMA_TARGET_TRACKING_SCALING_POLICY.members["TargetValue"], - self.target_value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["predefined_metric_type"] = ( - CapacityProviderPredefinedMetricType( - de.read_string( - _SCHEMA_TARGET_TRACKING_SCALING_POLICY.members[ - "PredefinedMetricType" - ] - ) - ) - ) - - case 1: - kwargs["target_value"] = de.read_double( - _SCHEMA_TARGET_TRACKING_SCALING_POLICY.members["TargetValue"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_TARGET_TRACKING_SCALING_POLICY, consumer=_consumer - ) - if "predefined_metric_type" not in kwargs: - kwargs["predefined_metric_type"] = ( - CapacityProviderPredefinedMetricType._corrected("") - ) - if "target_value" not in kwargs: - kwargs["target_value"] = 0.0 - return kwargs - - -def _serialize_capacity_provider_scaling_policies_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[TargetTrackingScalingPolicy], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_capacity_provider_scaling_policies_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[TargetTrackingScalingPolicy]: - result: list[TargetTrackingScalingPolicy] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(TargetTrackingScalingPolicy.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CapacityProviderScalingConfig: - """ - Configuration that defines how the capacity provider scales compute - instances based on demand and policies. - """ - - max_v_cpu_count: int | None = None - """ - The maximum number of vCPUs that the capacity provider can provision - across all compute instances. - """ - - scaling_mode: str | None = None - """ - The scaling mode that determines how the capacity provider responds to - changes in demand. - """ - - scaling_policies: list[TargetTrackingScalingPolicy] | None = None - """ - A list of scaling policies that define how the capacity provider scales - compute instances based on metrics and thresholds. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CAPACITY_PROVIDER_SCALING_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.max_v_cpu_count is not None: - serializer.write_integer( - _SCHEMA_CAPACITY_PROVIDER_SCALING_CONFIG.members["MaxVCpuCount"], - self.max_v_cpu_count, - ) - - if self.scaling_mode is not None: - serializer.write_string( - _SCHEMA_CAPACITY_PROVIDER_SCALING_CONFIG.members["ScalingMode"], - self.scaling_mode, - ) - - if self.scaling_policies is not None: - _serialize_capacity_provider_scaling_policies_list( - serializer, - _SCHEMA_CAPACITY_PROVIDER_SCALING_CONFIG.members["ScalingPolicies"], - self.scaling_policies, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["max_v_cpu_count"] = de.read_integer( - _SCHEMA_CAPACITY_PROVIDER_SCALING_CONFIG.members["MaxVCpuCount"] - ) - - case 1: - kwargs["scaling_mode"] = CapacityProviderScalingMode( - de.read_string( - _SCHEMA_CAPACITY_PROVIDER_SCALING_CONFIG.members[ - "ScalingMode" - ] - ) - ) - - case 2: - kwargs["scaling_policies"] = ( - _deserialize_capacity_provider_scaling_policies_list( - de, - _SCHEMA_CAPACITY_PROVIDER_SCALING_CONFIG.members[ - "ScalingPolicies" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CAPACITY_PROVIDER_SCALING_CONFIG, consumer=_consumer - ) - return kwargs - - -def _serialize_instance_type_set( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_instance_type_set( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class InstanceRequirements: - """ - Specifications that define the characteristics and constraints for - compute instances used by the capacity provider. - """ - - architectures: list[str] | None = None - """ - A list of supported CPU architectures for compute instances. Valid - values include `x86_64` and `arm64`. - """ - - allowed_instance_types: list[str] | None = None - """ - A list of EC2 instance types that the capacity provider is allowed to - use. If not specified, all compatible instance types are allowed. - """ - - excluded_instance_types: list[str] | None = None - """ - A list of EC2 instance types that the capacity provider should not use, - even if they meet other requirements. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INSTANCE_REQUIREMENTS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.architectures is not None: - _serialize_architectures_list( - serializer, - _SCHEMA_INSTANCE_REQUIREMENTS.members["Architectures"], - self.architectures, - ) - - if self.allowed_instance_types is not None: - _serialize_instance_type_set( - serializer, - _SCHEMA_INSTANCE_REQUIREMENTS.members["AllowedInstanceTypes"], - self.allowed_instance_types, - ) - - if self.excluded_instance_types is not None: - _serialize_instance_type_set( - serializer, - _SCHEMA_INSTANCE_REQUIREMENTS.members["ExcludedInstanceTypes"], - self.excluded_instance_types, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["architectures"] = _deserialize_architectures_list( - de, _SCHEMA_INSTANCE_REQUIREMENTS.members["Architectures"] - ) - - case 1: - kwargs["allowed_instance_types"] = _deserialize_instance_type_set( - de, - _SCHEMA_INSTANCE_REQUIREMENTS.members["AllowedInstanceTypes"], - ) - - case 2: - kwargs["excluded_instance_types"] = _deserialize_instance_type_set( - de, - _SCHEMA_INSTANCE_REQUIREMENTS.members["ExcludedInstanceTypes"], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INSTANCE_REQUIREMENTS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CapacityProviderPermissionsConfig: - """ - Configuration that specifies the permissions required for the capacity - provider to manage compute resources. - """ - - capacity_provider_operator_role_arn: str - """ - The ARN of the IAM role that the capacity provider uses to manage - compute instances and other Amazon Web Services resources. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CAPACITY_PROVIDER_PERMISSIONS_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CAPACITY_PROVIDER_PERMISSIONS_CONFIG.members[ - "CapacityProviderOperatorRoleArn" - ], - self.capacity_provider_operator_role_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["capacity_provider_operator_role_arn"] = de.read_string( - _SCHEMA_CAPACITY_PROVIDER_PERMISSIONS_CONFIG.members[ - "CapacityProviderOperatorRoleArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CAPACITY_PROVIDER_PERMISSIONS_CONFIG, consumer=_consumer - ) - if "capacity_provider_operator_role_arn" not in kwargs: - kwargs["capacity_provider_operator_role_arn"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(capacity_provider_operator_role_arn="") - - -def _serialize_tags( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_tags( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -class PropagateTagsMode(UnknownEnumMixin, StrEnum): - NONE = "None" - """Tag propagation is disabled. No tags are applied to managed resources.""" - EXPLICIT = "Explicit" - """ - Tags specified in `ExplicitTags` are applied to managed resources at - launch. - """ - - -@dataclass(kw_only=True) -class PropagateTags: - """ - Configuration for tag propagation to managed resources launched by the - capacity provider. - """ - - mode: str | None = None - """ - The tag propagation mode. Set to `Explicit` to propagate the tags - specified in `ExplicitTags` to managed resources. Set to `None` to - disable tag propagation. - """ - - explicit_tags: dict[str, str] | None = None - """ - A list of tags to apply to managed resources when `Mode` is set to - `Explicit`. You can specify up to 40 tags. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PROPAGATE_TAGS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.mode is not None: - serializer.write_string(_SCHEMA_PROPAGATE_TAGS.members["Mode"], self.mode) - - if self.explicit_tags is not None: - _serialize_tags( - serializer, - _SCHEMA_PROPAGATE_TAGS.members["ExplicitTags"], - self.explicit_tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["mode"] = PropagateTagsMode( - de.read_string(_SCHEMA_PROPAGATE_TAGS.members["Mode"]) - ) - - case 1: - kwargs["explicit_tags"] = _deserialize_tags( - de, _SCHEMA_PROPAGATE_TAGS.members["ExplicitTags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PROPAGATE_TAGS, consumer=_consumer) - return kwargs - - -class SystemLogLevel(UnknownEnumMixin, StrEnum): - DEBUG = "DEBUG" - INFO = "INFO" - WARN = "WARN" - - -@dataclass(kw_only=True) -class CapacityProviderLoggingConfig: - """The capacity provider's Amazon CloudWatch Logs configuration settings.""" - - system_log_level: str | None = None - """ - Set this property to filter the system logs for your capacity provider - that Lambda sends to CloudWatch. Lambda only sends system logs at the - selected level of detail and lower, where `DEBUG` is the highest level - and `WARN` is the lowest. - """ - - log_group: str | None = None - """ - The name of the Amazon CloudWatch log group the capacity provider sends - logs to. By default, Lambda capacity providers send logs to a default - log group named - `/aws/lambda/capacity-provider/`. To use a - different log group, enter an existing log group or enter a new log - group name. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CAPACITY_PROVIDER_LOGGING_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.system_log_level is not None: - serializer.write_string( - _SCHEMA_CAPACITY_PROVIDER_LOGGING_CONFIG.members["SystemLogLevel"], - self.system_log_level, - ) - - if self.log_group is not None: - serializer.write_string( - _SCHEMA_CAPACITY_PROVIDER_LOGGING_CONFIG.members["LogGroup"], - self.log_group, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["system_log_level"] = SystemLogLevel( - de.read_string( - _SCHEMA_CAPACITY_PROVIDER_LOGGING_CONFIG.members[ - "SystemLogLevel" - ] - ) - ) - - case 1: - kwargs["log_group"] = de.read_string( - _SCHEMA_CAPACITY_PROVIDER_LOGGING_CONFIG.members["LogGroup"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CAPACITY_PROVIDER_LOGGING_CONFIG, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CapacityProviderTelemetryConfig: - """ - Configuration that specifies the telemetry collection for the capacity - provider. - """ - - logging_config: CapacityProviderLoggingConfig | None = None - """The capacity provider's Amazon CloudWatch Logs configuration settings.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CAPACITY_PROVIDER_TELEMETRY_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.logging_config is not None: - serializer.write_struct( - _SCHEMA_CAPACITY_PROVIDER_TELEMETRY_CONFIG.members["LoggingConfig"], - self.logging_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["logging_config"] = ( - CapacityProviderLoggingConfig.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CAPACITY_PROVIDER_TELEMETRY_CONFIG, consumer=_consumer - ) - return kwargs - - -def _serialize_capacity_provider_security_group_ids( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_capacity_provider_security_group_ids( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_capacity_provider_subnet_ids( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_capacity_provider_subnet_ids( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CapacityProviderVpcConfig: - """ - VPC configuration that specifies the network settings for compute - instances managed by the capacity provider. - """ - - subnet_ids: list[str] - """ - A list of subnet IDs where the capacity provider launches compute - instances. - """ - - security_group_ids: list[str] - """ - A list of security group IDs that control network access for compute - instances managed by the capacity provider. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CAPACITY_PROVIDER_VPC_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_capacity_provider_subnet_ids( - serializer, - _SCHEMA_CAPACITY_PROVIDER_VPC_CONFIG.members["SubnetIds"], - self.subnet_ids, - ) - _serialize_capacity_provider_security_group_ids( - serializer, - _SCHEMA_CAPACITY_PROVIDER_VPC_CONFIG.members["SecurityGroupIds"], - self.security_group_ids, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["subnet_ids"] = _deserialize_capacity_provider_subnet_ids( - de, _SCHEMA_CAPACITY_PROVIDER_VPC_CONFIG.members["SubnetIds"] - ) - - case 1: - kwargs["security_group_ids"] = ( - _deserialize_capacity_provider_security_group_ids( - de, - _SCHEMA_CAPACITY_PROVIDER_VPC_CONFIG.members[ - "SecurityGroupIds" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CAPACITY_PROVIDER_VPC_CONFIG, consumer=_consumer - ) - if "subnet_ids" not in kwargs: - kwargs["subnet_ids"] = [] - if "security_group_ids" not in kwargs: - kwargs["security_group_ids"] = [] - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(subnet_ids=[], security_group_ids=[]) - - -@dataclass(kw_only=True) -class CreateCapacityProviderInput: - """Dataclass for CreateCapacityProviderInput structure.""" - - capacity_provider_name: str | None = None - """The name of the capacity provider.""" - - vpc_config: CapacityProviderVpcConfig | None = None - """ - The VPC configuration for the capacity provider, including subnet IDs - and security group IDs where compute instances will be launched. - """ - - permissions_config: CapacityProviderPermissionsConfig | None = None - """ - The permissions configuration that specifies the IAM role ARN used by - the capacity provider to manage compute resources. - """ - - instance_requirements: InstanceRequirements | None = None - """ - The instance requirements that specify the compute instance - characteristics, including architectures and allowed or excluded - instance types. - """ - - capacity_provider_scaling_config: CapacityProviderScalingConfig | None = None - """ - The scaling configuration that defines how the capacity provider scales - compute instances, including maximum vCPU count and scaling policies. - """ - - kms_key_arn: str | None = None - """ - The ARN of the KMS key used to encrypt data associated with the capacity - provider. - """ - - tags: dict[str, str] | None = None - """A list of tags to associate with the capacity provider.""" - - propagate_tags: PropagateTags | None = None - """ - The tag propagation configuration for the capacity provider. Specifies - tags to apply to managed resources at launch. - """ - - telemetry_config: CapacityProviderTelemetryConfig | None = None - """ - The telemetry configuration for the capacity provider. Specifies logging - settings for managed resources. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_CAPACITY_PROVIDER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.capacity_provider_name is not None: - serializer.write_string( - _SCHEMA_CREATE_CAPACITY_PROVIDER_INPUT.members["CapacityProviderName"], - self.capacity_provider_name, - ) - - if self.vpc_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_CAPACITY_PROVIDER_INPUT.members["VpcConfig"], - self.vpc_config, - ) - - if self.permissions_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_CAPACITY_PROVIDER_INPUT.members["PermissionsConfig"], - self.permissions_config, - ) - - if self.instance_requirements is not None: - serializer.write_struct( - _SCHEMA_CREATE_CAPACITY_PROVIDER_INPUT.members["InstanceRequirements"], - self.instance_requirements, - ) - - if self.capacity_provider_scaling_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_CAPACITY_PROVIDER_INPUT.members[ - "CapacityProviderScalingConfig" - ], - self.capacity_provider_scaling_config, - ) - - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_CAPACITY_PROVIDER_INPUT.members["KmsKeyArn"], - self.kms_key_arn, - ) - - if self.tags is not None: - _serialize_tags( - serializer, - _SCHEMA_CREATE_CAPACITY_PROVIDER_INPUT.members["Tags"], - self.tags, - ) - - if self.propagate_tags is not None: - serializer.write_struct( - _SCHEMA_CREATE_CAPACITY_PROVIDER_INPUT.members["PropagateTags"], - self.propagate_tags, - ) - - if self.telemetry_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_CAPACITY_PROVIDER_INPUT.members["TelemetryConfig"], - self.telemetry_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["capacity_provider_name"] = de.read_string( - _SCHEMA_CREATE_CAPACITY_PROVIDER_INPUT.members[ - "CapacityProviderName" - ] - ) - - case 1: - kwargs["vpc_config"] = CapacityProviderVpcConfig.deserialize(de) - - case 2: - kwargs["permissions_config"] = ( - CapacityProviderPermissionsConfig.deserialize(de) - ) - - case 3: - kwargs["instance_requirements"] = InstanceRequirements.deserialize( - de - ) - - case 4: - kwargs["capacity_provider_scaling_config"] = ( - CapacityProviderScalingConfig.deserialize(de) - ) - - case 5: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_CREATE_CAPACITY_PROVIDER_INPUT.members["KmsKeyArn"] - ) - - case 6: - kwargs["tags"] = _deserialize_tags( - de, _SCHEMA_CREATE_CAPACITY_PROVIDER_INPUT.members["Tags"] - ) - - case 7: - kwargs["propagate_tags"] = PropagateTags.deserialize(de) - - case 8: - kwargs["telemetry_config"] = ( - CapacityProviderTelemetryConfig.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_CAPACITY_PROVIDER_INPUT, consumer=_consumer - ) - return kwargs - - -class CapacityProviderState(UnknownEnumMixin, StrEnum): - PENDING = "Pending" - ACTIVE = "Active" - FAILED = "Failed" - DELETING = "Deleting" - - -@dataclass(kw_only=True) -class CapacityProvider: - """A capacity provider manages compute resources for Lambda functions.""" - - capacity_provider_arn: str - """The Amazon Resource Name (ARN) of the capacity provider.""" - - state: str - """The current state of the capacity provider.""" - - vpc_config: CapacityProviderVpcConfig - """The VPC configuration for the capacity provider.""" - - permissions_config: CapacityProviderPermissionsConfig - """The permissions configuration for the capacity provider.""" - - instance_requirements: InstanceRequirements | None = None - """ - The instance requirements for compute resources managed by the capacity - provider. - """ - - capacity_provider_scaling_config: CapacityProviderScalingConfig | None = None - """The scaling configuration for the capacity provider.""" - - kms_key_arn: str | None = None - """ - The ARN of the KMS key used to encrypt the capacity provider's - resources. - """ - - last_modified: str | None = None - """The date and time when the capacity provider was last modified.""" - - propagate_tags: PropagateTags | None = None - """ - Configuration for tag propagation to managed resources launched by the - capacity provider. - """ - - telemetry_config: CapacityProviderTelemetryConfig | None = None - """ - The telemetry configuration for the capacity provider, including logging - settings. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CAPACITY_PROVIDER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CAPACITY_PROVIDER.members["CapacityProviderArn"], - self.capacity_provider_arn, - ) - serializer.write_string(_SCHEMA_CAPACITY_PROVIDER.members["State"], self.state) - serializer.write_struct( - _SCHEMA_CAPACITY_PROVIDER.members["VpcConfig"], self.vpc_config - ) - serializer.write_struct( - _SCHEMA_CAPACITY_PROVIDER.members["PermissionsConfig"], - self.permissions_config, - ) - if self.instance_requirements is not None: - serializer.write_struct( - _SCHEMA_CAPACITY_PROVIDER.members["InstanceRequirements"], - self.instance_requirements, - ) - - if self.capacity_provider_scaling_config is not None: - serializer.write_struct( - _SCHEMA_CAPACITY_PROVIDER.members["CapacityProviderScalingConfig"], - self.capacity_provider_scaling_config, - ) - - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_CAPACITY_PROVIDER.members["KmsKeyArn"], self.kms_key_arn - ) - - if self.last_modified is not None: - serializer.write_string( - _SCHEMA_CAPACITY_PROVIDER.members["LastModified"], self.last_modified - ) - - if self.propagate_tags is not None: - serializer.write_struct( - _SCHEMA_CAPACITY_PROVIDER.members["PropagateTags"], self.propagate_tags - ) - - if self.telemetry_config is not None: - serializer.write_struct( - _SCHEMA_CAPACITY_PROVIDER.members["TelemetryConfig"], - self.telemetry_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["capacity_provider_arn"] = de.read_string( - _SCHEMA_CAPACITY_PROVIDER.members["CapacityProviderArn"] - ) - - case 1: - kwargs["state"] = CapacityProviderState( - de.read_string(_SCHEMA_CAPACITY_PROVIDER.members["State"]) - ) - - case 2: - kwargs["vpc_config"] = CapacityProviderVpcConfig.deserialize(de) - - case 3: - kwargs["permissions_config"] = ( - CapacityProviderPermissionsConfig.deserialize(de) - ) - - case 4: - kwargs["instance_requirements"] = InstanceRequirements.deserialize( - de - ) - - case 5: - kwargs["capacity_provider_scaling_config"] = ( - CapacityProviderScalingConfig.deserialize(de) - ) - - case 6: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_CAPACITY_PROVIDER.members["KmsKeyArn"] - ) - - case 7: - kwargs["last_modified"] = de.read_string( - _SCHEMA_CAPACITY_PROVIDER.members["LastModified"] - ) - - case 8: - kwargs["propagate_tags"] = PropagateTags.deserialize(de) - - case 9: - kwargs["telemetry_config"] = ( - CapacityProviderTelemetryConfig.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CAPACITY_PROVIDER, consumer=_consumer) - if "capacity_provider_arn" not in kwargs: - kwargs["capacity_provider_arn"] = "" - if "state" not in kwargs: - kwargs["state"] = CapacityProviderState._corrected("") - if "vpc_config" not in kwargs: - kwargs["vpc_config"] = CapacityProviderVpcConfig._smithy_default() - if "permissions_config" not in kwargs: - kwargs["permissions_config"] = ( - CapacityProviderPermissionsConfig._smithy_default() - ) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls( - capacity_provider_arn="", - state=CapacityProviderState._corrected(""), - vpc_config=CapacityProviderVpcConfig._smithy_default(), - permissions_config=CapacityProviderPermissionsConfig._smithy_default(), - ) - - -@dataclass(kw_only=True) -class CreateCapacityProviderOutput: - """Dataclass for CreateCapacityProviderOutput structure.""" - - capacity_provider: CapacityProvider - """Information about the capacity provider that was created.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_CAPACITY_PROVIDER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CREATE_CAPACITY_PROVIDER_OUTPUT.members["CapacityProvider"], - self.capacity_provider, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["capacity_provider"] = CapacityProvider.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_CAPACITY_PROVIDER_OUTPUT, consumer=_consumer - ) - if "capacity_provider" not in kwargs: - kwargs["capacity_provider"] = CapacityProvider._smithy_default() - return kwargs - - -CREATE_CAPACITY_PROVIDER = APIOperation( - input=CreateCapacityProviderInput, - output=CreateCapacityProviderOutput, - schema=_SCHEMA_CREATE_CAPACITY_PROVIDER, - input_schema=_SCHEMA_CREATE_CAPACITY_PROVIDER_INPUT, - output_schema=_SCHEMA_CREATE_CAPACITY_PROVIDER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#CapacityProviderLimitExceededException" - ): CapacityProviderLimitExceededException, - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceConflictException" - ): ResourceConflictException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CAPACITY_PROVIDER_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteCapacityProviderInput: - """Dataclass for DeleteCapacityProviderInput structure.""" - - capacity_provider_name: str | None = None - """The name of the capacity provider to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_CAPACITY_PROVIDER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.capacity_provider_name is not None: - serializer.write_string( - _SCHEMA_DELETE_CAPACITY_PROVIDER_INPUT.members["CapacityProviderName"], - self.capacity_provider_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["capacity_provider_name"] = de.read_string( - _SCHEMA_DELETE_CAPACITY_PROVIDER_INPUT.members[ - "CapacityProviderName" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_CAPACITY_PROVIDER_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteCapacityProviderOutput: - """Dataclass for DeleteCapacityProviderOutput structure.""" - - capacity_provider: CapacityProvider - """Information about the deleted capacity provider.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_CAPACITY_PROVIDER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DELETE_CAPACITY_PROVIDER_OUTPUT.members["CapacityProvider"], - self.capacity_provider, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["capacity_provider"] = CapacityProvider.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_CAPACITY_PROVIDER_OUTPUT, consumer=_consumer - ) - if "capacity_provider" not in kwargs: - kwargs["capacity_provider"] = CapacityProvider._smithy_default() - return kwargs - - -DELETE_CAPACITY_PROVIDER = APIOperation( - input=DeleteCapacityProviderInput, - output=DeleteCapacityProviderOutput, - schema=_SCHEMA_DELETE_CAPACITY_PROVIDER, - input_schema=_SCHEMA_DELETE_CAPACITY_PROVIDER_INPUT, - output_schema=_SCHEMA_DELETE_CAPACITY_PROVIDER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceConflictException" - ): ResourceConflictException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetCapacityProviderInput: - """Dataclass for GetCapacityProviderInput structure.""" - - capacity_provider_name: str | None = None - """The name of the capacity provider to retrieve.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_CAPACITY_PROVIDER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.capacity_provider_name is not None: - serializer.write_string( - _SCHEMA_GET_CAPACITY_PROVIDER_INPUT.members["CapacityProviderName"], - self.capacity_provider_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["capacity_provider_name"] = de.read_string( - _SCHEMA_GET_CAPACITY_PROVIDER_INPUT.members[ - "CapacityProviderName" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_CAPACITY_PROVIDER_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetCapacityProviderOutput: - """Dataclass for GetCapacityProviderOutput structure.""" - - capacity_provider: CapacityProvider - """ - Information about the capacity provider, including its configuration and - current state. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_CAPACITY_PROVIDER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_CAPACITY_PROVIDER_OUTPUT.members["CapacityProvider"], - self.capacity_provider, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["capacity_provider"] = CapacityProvider.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_CAPACITY_PROVIDER_OUTPUT, consumer=_consumer - ) - if "capacity_provider" not in kwargs: - kwargs["capacity_provider"] = CapacityProvider._smithy_default() - return kwargs - - -GET_CAPACITY_PROVIDER = APIOperation( - input=GetCapacityProviderInput, - output=GetCapacityProviderOutput, - schema=_SCHEMA_GET_CAPACITY_PROVIDER, - input_schema=_SCHEMA_GET_CAPACITY_PROVIDER_INPUT, - output_schema=_SCHEMA_GET_CAPACITY_PROVIDER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListCapacityProvidersInput: - """Dataclass for ListCapacityProvidersInput structure.""" - - state: str | None = None - """Filter capacity providers by their current state.""" - - marker: str | None = None - """ - Specify the pagination token that's returned by a previous request to - retrieve the next page of results. - """ - - max_items: int | None = None - """The maximum number of capacity providers to return.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_CAPACITY_PROVIDERS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.state is not None: - serializer.write_string( - _SCHEMA_LIST_CAPACITY_PROVIDERS_INPUT.members["State"], self.state - ) - - if self.marker is not None: - serializer.write_string( - _SCHEMA_LIST_CAPACITY_PROVIDERS_INPUT.members["Marker"], self.marker - ) - - if self.max_items is not None: - serializer.write_integer( - _SCHEMA_LIST_CAPACITY_PROVIDERS_INPUT.members["MaxItems"], - self.max_items, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["state"] = CapacityProviderState( - de.read_string( - _SCHEMA_LIST_CAPACITY_PROVIDERS_INPUT.members["State"] - ) - ) - - case 1: - kwargs["marker"] = de.read_string( - _SCHEMA_LIST_CAPACITY_PROVIDERS_INPUT.members["Marker"] - ) - - case 2: - kwargs["max_items"] = de.read_integer( - _SCHEMA_LIST_CAPACITY_PROVIDERS_INPUT.members["MaxItems"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_CAPACITY_PROVIDERS_INPUT, consumer=_consumer - ) - return kwargs - - -def _serialize_capacity_providers_list( - serializer: ShapeSerializer, schema: Schema, value: list[CapacityProvider] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_capacity_providers_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[CapacityProvider]: - result: list[CapacityProvider] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(CapacityProvider.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListCapacityProvidersOutput: - """Dataclass for ListCapacityProvidersOutput structure.""" - - capacity_providers: list[CapacityProvider] - """A list of capacity providers in your account.""" - - next_marker: str | None = None - """The pagination token that's included if more results are available.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_CAPACITY_PROVIDERS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_capacity_providers_list( - serializer, - _SCHEMA_LIST_CAPACITY_PROVIDERS_OUTPUT.members["CapacityProviders"], - self.capacity_providers, - ) - if self.next_marker is not None: - serializer.write_string( - _SCHEMA_LIST_CAPACITY_PROVIDERS_OUTPUT.members["NextMarker"], - self.next_marker, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["capacity_providers"] = _deserialize_capacity_providers_list( - de, - _SCHEMA_LIST_CAPACITY_PROVIDERS_OUTPUT.members[ - "CapacityProviders" - ], - ) - - case 1: - kwargs["next_marker"] = de.read_string( - _SCHEMA_LIST_CAPACITY_PROVIDERS_OUTPUT.members["NextMarker"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_CAPACITY_PROVIDERS_OUTPUT, consumer=_consumer - ) - if "capacity_providers" not in kwargs: - kwargs["capacity_providers"] = [] - return kwargs - - -LIST_CAPACITY_PROVIDERS = APIOperation( - input=ListCapacityProvidersInput, - output=ListCapacityProvidersOutput, - schema=_SCHEMA_LIST_CAPACITY_PROVIDERS, - input_schema=_SCHEMA_LIST_CAPACITY_PROVIDERS_INPUT, - output_schema=_SCHEMA_LIST_CAPACITY_PROVIDERS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListFunctionVersionsByCapacityProviderInput: - """Dataclass for ListFunctionVersionsByCapacityProviderInput structure.""" - - capacity_provider_name: str | None = None - """The name of the capacity provider to list function versions for.""" - - marker: str | None = None - """ - Specify the pagination token that's returned by a previous request to - retrieve the next page of results. - """ - - max_items: int | None = None - """The maximum number of function versions to return in the response.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_LIST_FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.capacity_provider_name is not None: - serializer.write_string( - _SCHEMA_LIST_FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER_INPUT.members[ - "CapacityProviderName" - ], - self.capacity_provider_name, - ) - - if self.marker is not None: - serializer.write_string( - _SCHEMA_LIST_FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER_INPUT.members[ - "Marker" - ], - self.marker, - ) - - if self.max_items is not None: - serializer.write_integer( - _SCHEMA_LIST_FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER_INPUT.members[ - "MaxItems" - ], - self.max_items, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["capacity_provider_name"] = de.read_string( - _SCHEMA_LIST_FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER_INPUT.members[ - "CapacityProviderName" - ] - ) - - case 1: - kwargs["marker"] = de.read_string( - _SCHEMA_LIST_FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER_INPUT.members[ - "Marker" - ] - ) - - case 2: - kwargs["max_items"] = de.read_integer( - _SCHEMA_LIST_FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER_INPUT.members[ - "MaxItems" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER_INPUT, - consumer=_consumer, - ) - return kwargs - - -class State(UnknownEnumMixin, StrEnum): - PENDING = "Pending" - ACTIVE = "Active" - INACTIVE = "Inactive" - FAILED = "Failed" - DEACTIVATING = "Deactivating" - DEACTIVATED = "Deactivated" - ACTIVE_NON_INVOCABLE = "ActiveNonInvocable" - DELETING = "Deleting" - - -@dataclass(kw_only=True) -class FunctionVersionsByCapacityProviderListItem: - """ - Information about a function version that uses a specific capacity - provider, including its ARN and current state. - """ - - function_arn: str - """The Amazon Resource Name (ARN) of the function version.""" - - state: str - """The current state of the function version.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER_LIST_ITEM, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER_LIST_ITEM.members[ - "FunctionArn" - ], - self.function_arn, - ) - serializer.write_string( - _SCHEMA_FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER_LIST_ITEM.members["State"], - self.state, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_arn"] = de.read_string( - _SCHEMA_FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER_LIST_ITEM.members[ - "FunctionArn" - ] - ) - - case 1: - kwargs["state"] = State( - de.read_string( - _SCHEMA_FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER_LIST_ITEM.members[ - "State" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER_LIST_ITEM, consumer=_consumer - ) - if "function_arn" not in kwargs: - kwargs["function_arn"] = "" - if "state" not in kwargs: - kwargs["state"] = State._corrected("") - return kwargs - - -def _serialize_function_versions_by_capacity_provider_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[FunctionVersionsByCapacityProviderListItem], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_function_versions_by_capacity_provider_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[FunctionVersionsByCapacityProviderListItem]: - result: list[FunctionVersionsByCapacityProviderListItem] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(FunctionVersionsByCapacityProviderListItem.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListFunctionVersionsByCapacityProviderOutput: - """Dataclass for ListFunctionVersionsByCapacityProviderOutput structure.""" - - capacity_provider_arn: str - """The Amazon Resource Name (ARN) of the capacity provider.""" - - function_versions: list[FunctionVersionsByCapacityProviderListItem] - """A list of function versions that use the specified capacity provider.""" - - next_marker: str | None = None - """The pagination token that's included if more results are available.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_LIST_FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_LIST_FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER_OUTPUT.members[ - "CapacityProviderArn" - ], - self.capacity_provider_arn, - ) - _serialize_function_versions_by_capacity_provider_list( - serializer, - _SCHEMA_LIST_FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER_OUTPUT.members[ - "FunctionVersions" - ], - self.function_versions, - ) - if self.next_marker is not None: - serializer.write_string( - _SCHEMA_LIST_FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER_OUTPUT.members[ - "NextMarker" - ], - self.next_marker, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["capacity_provider_arn"] = de.read_string( - _SCHEMA_LIST_FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER_OUTPUT.members[ - "CapacityProviderArn" - ] - ) - - case 1: - kwargs["function_versions"] = ( - _deserialize_function_versions_by_capacity_provider_list( - de, - _SCHEMA_LIST_FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER_OUTPUT.members[ - "FunctionVersions" - ], - ) - ) - - case 2: - kwargs["next_marker"] = de.read_string( - _SCHEMA_LIST_FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER_OUTPUT.members[ - "NextMarker" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER_OUTPUT, - consumer=_consumer, - ) - if "capacity_provider_arn" not in kwargs: - kwargs["capacity_provider_arn"] = "" - if "function_versions" not in kwargs: - kwargs["function_versions"] = [] - return kwargs - - -LIST_FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER = APIOperation( - input=ListFunctionVersionsByCapacityProviderInput, - output=ListFunctionVersionsByCapacityProviderOutput, - schema=_SCHEMA_LIST_FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER, - input_schema=_SCHEMA_LIST_FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER_INPUT, - output_schema=_SCHEMA_LIST_FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateCapacityProviderInput: - """Dataclass for UpdateCapacityProviderInput structure.""" - - capacity_provider_name: str | None = None - """The name of the capacity provider to update.""" - - capacity_provider_scaling_config: CapacityProviderScalingConfig | None = None - """The updated scaling configuration for the capacity provider.""" - - propagate_tags: PropagateTags | None = None - """ - Configuration for tag propagation to managed resources launched by the - capacity provider. - """ - - telemetry_config: CapacityProviderTelemetryConfig | None = None - """The updated telemetry configuration for the capacity provider.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_CAPACITY_PROVIDER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.capacity_provider_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_CAPACITY_PROVIDER_INPUT.members["CapacityProviderName"], - self.capacity_provider_name, - ) - - if self.capacity_provider_scaling_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_CAPACITY_PROVIDER_INPUT.members[ - "CapacityProviderScalingConfig" - ], - self.capacity_provider_scaling_config, - ) - - if self.propagate_tags is not None: - serializer.write_struct( - _SCHEMA_UPDATE_CAPACITY_PROVIDER_INPUT.members["PropagateTags"], - self.propagate_tags, - ) - - if self.telemetry_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_CAPACITY_PROVIDER_INPUT.members["TelemetryConfig"], - self.telemetry_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["capacity_provider_name"] = de.read_string( - _SCHEMA_UPDATE_CAPACITY_PROVIDER_INPUT.members[ - "CapacityProviderName" - ] - ) - - case 1: - kwargs["capacity_provider_scaling_config"] = ( - CapacityProviderScalingConfig.deserialize(de) - ) - - case 2: - kwargs["propagate_tags"] = PropagateTags.deserialize(de) - - case 3: - kwargs["telemetry_config"] = ( - CapacityProviderTelemetryConfig.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_CAPACITY_PROVIDER_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateCapacityProviderOutput: - """Dataclass for UpdateCapacityProviderOutput structure.""" - - capacity_provider: CapacityProvider - """Information about the updated capacity provider.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_CAPACITY_PROVIDER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_UPDATE_CAPACITY_PROVIDER_OUTPUT.members["CapacityProvider"], - self.capacity_provider, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["capacity_provider"] = CapacityProvider.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_CAPACITY_PROVIDER_OUTPUT, consumer=_consumer - ) - if "capacity_provider" not in kwargs: - kwargs["capacity_provider"] = CapacityProvider._smithy_default() - return kwargs - - -UPDATE_CAPACITY_PROVIDER = APIOperation( - input=UpdateCapacityProviderInput, - output=UpdateCapacityProviderOutput, - schema=_SCHEMA_UPDATE_CAPACITY_PROVIDER, - input_schema=_SCHEMA_UPDATE_CAPACITY_PROVIDER_INPUT, - output_schema=_SCHEMA_UPDATE_CAPACITY_PROVIDER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceConflictException" - ): ResourceConflictException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -class CodeSigningPolicy(UnknownEnumMixin, StrEnum): - WARN = "Warn" - ENFORCE = "Enforce" - - -@dataclass(kw_only=True) -class CodeSigningPolicies: - """ - Code signing configuration - [policies](https://docs.aws.amazon.com/lambda/latest/dg/configuration-codesigning.html#config-codesigning-policies) - specify the validation failure action for signature mismatch or expiry. - """ - - untrusted_artifact_on_deployment: str | None = None - """ - Code signing configuration policy for deployment validation failure. If - you set the policy to `Enforce`, Lambda blocks the deployment request if - signature validation checks fail. If you set the policy to `Warn`, - Lambda allows the deployment and issues a new Amazon CloudWatch metric - (`SignatureValidationErrors`) and also stores the warning in the - CloudTrail log. - - Default value: `Warn` - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CODE_SIGNING_POLICIES, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.untrusted_artifact_on_deployment is not None: - serializer.write_string( - _SCHEMA_CODE_SIGNING_POLICIES.members["UntrustedArtifactOnDeployment"], - self.untrusted_artifact_on_deployment, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["untrusted_artifact_on_deployment"] = CodeSigningPolicy( - de.read_string( - _SCHEMA_CODE_SIGNING_POLICIES.members[ - "UntrustedArtifactOnDeployment" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CODE_SIGNING_POLICIES, consumer=_consumer) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls() - - -@dataclass(kw_only=True) -class CreateCodeSigningConfigInput: - """Dataclass for CreateCodeSigningConfigInput structure.""" - - description: str | None = None - """Descriptive name for this code signing configuration.""" - - allowed_publishers: AllowedPublishers | None = None - """Signing profiles for this code signing configuration.""" - - code_signing_policies: CodeSigningPolicies | None = None - """ - The code signing policies define the actions to take if the validation - checks fail. - """ - - tags: dict[str, str] | None = None - """A list of tags to add to the code signing configuration.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_CODE_SIGNING_CONFIG_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_CODE_SIGNING_CONFIG_INPUT.members["Description"], - self.description, - ) - - if self.allowed_publishers is not None: - serializer.write_struct( - _SCHEMA_CREATE_CODE_SIGNING_CONFIG_INPUT.members["AllowedPublishers"], - self.allowed_publishers, - ) - - if self.code_signing_policies is not None: - serializer.write_struct( - _SCHEMA_CREATE_CODE_SIGNING_CONFIG_INPUT.members["CodeSigningPolicies"], - self.code_signing_policies, - ) - - if self.tags is not None: - _serialize_tags( - serializer, - _SCHEMA_CREATE_CODE_SIGNING_CONFIG_INPUT.members["Tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_CODE_SIGNING_CONFIG_INPUT.members["Description"] - ) - - case 1: - kwargs["allowed_publishers"] = AllowedPublishers.deserialize(de) - - case 2: - kwargs["code_signing_policies"] = CodeSigningPolicies.deserialize( - de - ) - - case 3: - kwargs["tags"] = _deserialize_tags( - de, _SCHEMA_CREATE_CODE_SIGNING_CONFIG_INPUT.members["Tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_CODE_SIGNING_CONFIG_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CodeSigningConfig: - """ - Details about a [Code signing - configuration](https://docs.aws.amazon.com/lambda/latest/dg/configuration-codesigning.html). - """ - - code_signing_config_id: str - """Unique identifer for the Code signing configuration.""" - - code_signing_config_arn: str - """The Amazon Resource Name (ARN) of the Code signing configuration.""" - - allowed_publishers: AllowedPublishers - """List of allowed publishers.""" - - code_signing_policies: CodeSigningPolicies - """ - The code signing policy controls the validation failure action for - signature mismatch or expiry. - """ - - last_modified: str - """ - The date and time that the Code signing configuration was last modified, - in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD). - """ - - description: str | None = None - """Code signing configuration description.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CODE_SIGNING_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CODE_SIGNING_CONFIG.members["CodeSigningConfigId"], - self.code_signing_config_id, - ) - serializer.write_string( - _SCHEMA_CODE_SIGNING_CONFIG.members["CodeSigningConfigArn"], - self.code_signing_config_arn, - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_CODE_SIGNING_CONFIG.members["Description"], self.description - ) - - serializer.write_struct( - _SCHEMA_CODE_SIGNING_CONFIG.members["AllowedPublishers"], - self.allowed_publishers, - ) - serializer.write_struct( - _SCHEMA_CODE_SIGNING_CONFIG.members["CodeSigningPolicies"], - self.code_signing_policies, - ) - serializer.write_string( - _SCHEMA_CODE_SIGNING_CONFIG.members["LastModified"], self.last_modified - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["code_signing_config_id"] = de.read_string( - _SCHEMA_CODE_SIGNING_CONFIG.members["CodeSigningConfigId"] - ) - - case 1: - kwargs["code_signing_config_arn"] = de.read_string( - _SCHEMA_CODE_SIGNING_CONFIG.members["CodeSigningConfigArn"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_CODE_SIGNING_CONFIG.members["Description"] - ) - - case 3: - kwargs["allowed_publishers"] = AllowedPublishers.deserialize(de) - - case 4: - kwargs["code_signing_policies"] = CodeSigningPolicies.deserialize( - de - ) - - case 5: - kwargs["last_modified"] = de.read_string( - _SCHEMA_CODE_SIGNING_CONFIG.members["LastModified"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CODE_SIGNING_CONFIG, consumer=_consumer) - if "code_signing_config_id" not in kwargs: - kwargs["code_signing_config_id"] = "" - if "code_signing_config_arn" not in kwargs: - kwargs["code_signing_config_arn"] = "" - if "allowed_publishers" not in kwargs: - kwargs["allowed_publishers"] = AllowedPublishers._smithy_default() - if "code_signing_policies" not in kwargs: - kwargs["code_signing_policies"] = CodeSigningPolicies._smithy_default() - if "last_modified" not in kwargs: - kwargs["last_modified"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls( - code_signing_config_id="", - code_signing_config_arn="", - allowed_publishers=AllowedPublishers._smithy_default(), - code_signing_policies=CodeSigningPolicies._smithy_default(), - last_modified="", - ) - - -@dataclass(kw_only=True) -class CreateCodeSigningConfigOutput: - """Dataclass for CreateCodeSigningConfigOutput structure.""" - - code_signing_config: CodeSigningConfig - """The code signing configuration.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_CODE_SIGNING_CONFIG_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CREATE_CODE_SIGNING_CONFIG_OUTPUT.members["CodeSigningConfig"], - self.code_signing_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["code_signing_config"] = CodeSigningConfig.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_CODE_SIGNING_CONFIG_OUTPUT, consumer=_consumer - ) - if "code_signing_config" not in kwargs: - kwargs["code_signing_config"] = CodeSigningConfig._smithy_default() - return kwargs - - -CREATE_CODE_SIGNING_CONFIG = APIOperation( - input=CreateCodeSigningConfigInput, - output=CreateCodeSigningConfigOutput, - schema=_SCHEMA_CREATE_CODE_SIGNING_CONFIG, - input_schema=_SCHEMA_CREATE_CODE_SIGNING_CONFIG_INPUT, - output_schema=_SCHEMA_CREATE_CODE_SIGNING_CONFIG_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteCodeSigningConfigInput: - """Dataclass for DeleteCodeSigningConfigInput structure.""" - - code_signing_config_arn: str | None = None - """The The Amazon Resource Name (ARN) of the code signing configuration.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_CODE_SIGNING_CONFIG_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.code_signing_config_arn is not None: - serializer.write_string( - _SCHEMA_DELETE_CODE_SIGNING_CONFIG_INPUT.members[ - "CodeSigningConfigArn" - ], - self.code_signing_config_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["code_signing_config_arn"] = de.read_string( - _SCHEMA_DELETE_CODE_SIGNING_CONFIG_INPUT.members[ - "CodeSigningConfigArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_CODE_SIGNING_CONFIG_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteCodeSigningConfigOutput: - """Dataclass for DeleteCodeSigningConfigOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_CODE_SIGNING_CONFIG_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_CODE_SIGNING_CONFIG_OUTPUT, consumer=_consumer - ) - return kwargs - - -DELETE_CODE_SIGNING_CONFIG = APIOperation( - input=DeleteCodeSigningConfigInput, - output=DeleteCodeSigningConfigOutput, - schema=_SCHEMA_DELETE_CODE_SIGNING_CONFIG, - input_schema=_SCHEMA_DELETE_CODE_SIGNING_CONFIG_INPUT, - output_schema=_SCHEMA_DELETE_CODE_SIGNING_CONFIG_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceConflictException" - ): ResourceConflictException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetCodeSigningConfigInput: - """Dataclass for GetCodeSigningConfigInput structure.""" - - code_signing_config_arn: str | None = None - """The The Amazon Resource Name (ARN) of the code signing configuration.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_CODE_SIGNING_CONFIG_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.code_signing_config_arn is not None: - serializer.write_string( - _SCHEMA_GET_CODE_SIGNING_CONFIG_INPUT.members["CodeSigningConfigArn"], - self.code_signing_config_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["code_signing_config_arn"] = de.read_string( - _SCHEMA_GET_CODE_SIGNING_CONFIG_INPUT.members[ - "CodeSigningConfigArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_CODE_SIGNING_CONFIG_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetCodeSigningConfigOutput: - """Dataclass for GetCodeSigningConfigOutput structure.""" - - code_signing_config: CodeSigningConfig - """The code signing configuration""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_CODE_SIGNING_CONFIG_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_CODE_SIGNING_CONFIG_OUTPUT.members["CodeSigningConfig"], - self.code_signing_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["code_signing_config"] = CodeSigningConfig.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_CODE_SIGNING_CONFIG_OUTPUT, consumer=_consumer - ) - if "code_signing_config" not in kwargs: - kwargs["code_signing_config"] = CodeSigningConfig._smithy_default() - return kwargs - - -GET_CODE_SIGNING_CONFIG = APIOperation( - input=GetCodeSigningConfigInput, - output=GetCodeSigningConfigOutput, - schema=_SCHEMA_GET_CODE_SIGNING_CONFIG, - input_schema=_SCHEMA_GET_CODE_SIGNING_CONFIG_INPUT, - output_schema=_SCHEMA_GET_CODE_SIGNING_CONFIG_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListCodeSigningConfigsInput: - """Dataclass for ListCodeSigningConfigsInput structure.""" - - marker: str | None = None - """ - Specify the pagination token that's returned by a previous request to - retrieve the next page of results. - """ - - max_items: int | None = None - """Maximum number of items to return.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_CODE_SIGNING_CONFIGS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.marker is not None: - serializer.write_string( - _SCHEMA_LIST_CODE_SIGNING_CONFIGS_INPUT.members["Marker"], self.marker - ) - - if self.max_items is not None: - serializer.write_integer( - _SCHEMA_LIST_CODE_SIGNING_CONFIGS_INPUT.members["MaxItems"], - self.max_items, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["marker"] = de.read_string( - _SCHEMA_LIST_CODE_SIGNING_CONFIGS_INPUT.members["Marker"] - ) - - case 1: - kwargs["max_items"] = de.read_integer( - _SCHEMA_LIST_CODE_SIGNING_CONFIGS_INPUT.members["MaxItems"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_CODE_SIGNING_CONFIGS_INPUT, consumer=_consumer - ) - return kwargs - - -def _serialize_code_signing_config_list( - serializer: ShapeSerializer, schema: Schema, value: list[CodeSigningConfig] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_code_signing_config_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[CodeSigningConfig]: - result: list[CodeSigningConfig] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(CodeSigningConfig.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListCodeSigningConfigsOutput: - """Dataclass for ListCodeSigningConfigsOutput structure.""" - - next_marker: str | None = None - """The pagination token that's included if more results are available.""" - - code_signing_configs: list[CodeSigningConfig] | None = None - """The code signing configurations""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_CODE_SIGNING_CONFIGS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_marker is not None: - serializer.write_string( - _SCHEMA_LIST_CODE_SIGNING_CONFIGS_OUTPUT.members["NextMarker"], - self.next_marker, - ) - - if self.code_signing_configs is not None: - _serialize_code_signing_config_list( - serializer, - _SCHEMA_LIST_CODE_SIGNING_CONFIGS_OUTPUT.members["CodeSigningConfigs"], - self.code_signing_configs, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_marker"] = de.read_string( - _SCHEMA_LIST_CODE_SIGNING_CONFIGS_OUTPUT.members["NextMarker"] - ) - - case 1: - kwargs["code_signing_configs"] = ( - _deserialize_code_signing_config_list( - de, - _SCHEMA_LIST_CODE_SIGNING_CONFIGS_OUTPUT.members[ - "CodeSigningConfigs" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_CODE_SIGNING_CONFIGS_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_CODE_SIGNING_CONFIGS = APIOperation( - input=ListCodeSigningConfigsInput, - output=ListCodeSigningConfigsOutput, - schema=_SCHEMA_LIST_CODE_SIGNING_CONFIGS, - input_schema=_SCHEMA_LIST_CODE_SIGNING_CONFIGS_INPUT, - output_schema=_SCHEMA_LIST_CODE_SIGNING_CONFIGS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListFunctionsByCodeSigningConfigInput: - """Dataclass for ListFunctionsByCodeSigningConfigInput structure.""" - - code_signing_config_arn: str | None = None - """The The Amazon Resource Name (ARN) of the code signing configuration.""" - - marker: str | None = None - """ - Specify the pagination token that's returned by a previous request to - retrieve the next page of results. - """ - - max_items: int | None = None - """Maximum number of items to return.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_LIST_FUNCTIONS_BY_CODE_SIGNING_CONFIG_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.code_signing_config_arn is not None: - serializer.write_string( - _SCHEMA_LIST_FUNCTIONS_BY_CODE_SIGNING_CONFIG_INPUT.members[ - "CodeSigningConfigArn" - ], - self.code_signing_config_arn, - ) - - if self.marker is not None: - serializer.write_string( - _SCHEMA_LIST_FUNCTIONS_BY_CODE_SIGNING_CONFIG_INPUT.members["Marker"], - self.marker, - ) - - if self.max_items is not None: - serializer.write_integer( - _SCHEMA_LIST_FUNCTIONS_BY_CODE_SIGNING_CONFIG_INPUT.members["MaxItems"], - self.max_items, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["code_signing_config_arn"] = de.read_string( - _SCHEMA_LIST_FUNCTIONS_BY_CODE_SIGNING_CONFIG_INPUT.members[ - "CodeSigningConfigArn" - ] - ) - - case 1: - kwargs["marker"] = de.read_string( - _SCHEMA_LIST_FUNCTIONS_BY_CODE_SIGNING_CONFIG_INPUT.members[ - "Marker" - ] - ) - - case 2: - kwargs["max_items"] = de.read_integer( - _SCHEMA_LIST_FUNCTIONS_BY_CODE_SIGNING_CONFIG_INPUT.members[ - "MaxItems" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_FUNCTIONS_BY_CODE_SIGNING_CONFIG_INPUT, consumer=_consumer - ) - return kwargs - - -def _serialize_function_arn_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_function_arn_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListFunctionsByCodeSigningConfigOutput: - """Dataclass for ListFunctionsByCodeSigningConfigOutput structure.""" - - next_marker: str | None = None - """The pagination token that's included if more results are available.""" - - function_arns: list[str] | None = None - """The function ARNs.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_LIST_FUNCTIONS_BY_CODE_SIGNING_CONFIG_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_marker is not None: - serializer.write_string( - _SCHEMA_LIST_FUNCTIONS_BY_CODE_SIGNING_CONFIG_OUTPUT.members[ - "NextMarker" - ], - self.next_marker, - ) - - if self.function_arns is not None: - _serialize_function_arn_list( - serializer, - _SCHEMA_LIST_FUNCTIONS_BY_CODE_SIGNING_CONFIG_OUTPUT.members[ - "FunctionArns" - ], - self.function_arns, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_marker"] = de.read_string( - _SCHEMA_LIST_FUNCTIONS_BY_CODE_SIGNING_CONFIG_OUTPUT.members[ - "NextMarker" - ] - ) - - case 1: - kwargs["function_arns"] = _deserialize_function_arn_list( - de, - _SCHEMA_LIST_FUNCTIONS_BY_CODE_SIGNING_CONFIG_OUTPUT.members[ - "FunctionArns" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_FUNCTIONS_BY_CODE_SIGNING_CONFIG_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_FUNCTIONS_BY_CODE_SIGNING_CONFIG = APIOperation( - input=ListFunctionsByCodeSigningConfigInput, - output=ListFunctionsByCodeSigningConfigOutput, - schema=_SCHEMA_LIST_FUNCTIONS_BY_CODE_SIGNING_CONFIG, - input_schema=_SCHEMA_LIST_FUNCTIONS_BY_CODE_SIGNING_CONFIG_INPUT, - output_schema=_SCHEMA_LIST_FUNCTIONS_BY_CODE_SIGNING_CONFIG_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateCodeSigningConfigInput: - """Dataclass for UpdateCodeSigningConfigInput structure.""" - - code_signing_config_arn: str | None = None - """The The Amazon Resource Name (ARN) of the code signing configuration.""" - - description: str | None = None - """Descriptive name for this code signing configuration.""" - - allowed_publishers: AllowedPublishers | None = None - """Signing profiles for this code signing configuration.""" - - code_signing_policies: CodeSigningPolicies | None = None - """The code signing policy.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_CODE_SIGNING_CONFIG_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.code_signing_config_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_CODE_SIGNING_CONFIG_INPUT.members[ - "CodeSigningConfigArn" - ], - self.code_signing_config_arn, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_CODE_SIGNING_CONFIG_INPUT.members["Description"], - self.description, - ) - - if self.allowed_publishers is not None: - serializer.write_struct( - _SCHEMA_UPDATE_CODE_SIGNING_CONFIG_INPUT.members["AllowedPublishers"], - self.allowed_publishers, - ) - - if self.code_signing_policies is not None: - serializer.write_struct( - _SCHEMA_UPDATE_CODE_SIGNING_CONFIG_INPUT.members["CodeSigningPolicies"], - self.code_signing_policies, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["code_signing_config_arn"] = de.read_string( - _SCHEMA_UPDATE_CODE_SIGNING_CONFIG_INPUT.members[ - "CodeSigningConfigArn" - ] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_CODE_SIGNING_CONFIG_INPUT.members["Description"] - ) - - case 2: - kwargs["allowed_publishers"] = AllowedPublishers.deserialize(de) - - case 3: - kwargs["code_signing_policies"] = CodeSigningPolicies.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_CODE_SIGNING_CONFIG_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateCodeSigningConfigOutput: - """Dataclass for UpdateCodeSigningConfigOutput structure.""" - - code_signing_config: CodeSigningConfig - """The code signing configuration""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_CODE_SIGNING_CONFIG_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_UPDATE_CODE_SIGNING_CONFIG_OUTPUT.members["CodeSigningConfig"], - self.code_signing_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["code_signing_config"] = CodeSigningConfig.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_CODE_SIGNING_CONFIG_OUTPUT, consumer=_consumer - ) - if "code_signing_config" not in kwargs: - kwargs["code_signing_config"] = CodeSigningConfig._smithy_default() - return kwargs - - -UPDATE_CODE_SIGNING_CONFIG = APIOperation( - input=UpdateCodeSigningConfigInput, - output=UpdateCodeSigningConfigOutput, - schema=_SCHEMA_UPDATE_CODE_SIGNING_CONFIG, - input_schema=_SCHEMA_UPDATE_CODE_SIGNING_CONFIG_INPUT, - output_schema=_SCHEMA_UPDATE_CODE_SIGNING_CONFIG_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteFunctionInput: - """Dataclass for DeleteFunctionInput structure.""" - - function_name: str | None = None - """ - The name or ARN of the Lambda function or version. - - **Name formats** - - - **Function name** -- `my-function` (name-only), `my-function:1` (with - version). - - - **Function ARN** -- - `arn:aws:lambda:us-west-2:123456789012:function:my-function`. - - - **Partial ARN** -- `123456789012:function:my-function`. - - You can append a version number or alias to any of the formats. The - length constraint applies only to the full ARN. If you specify only the - function name, it is limited to 64 characters in length. - """ - - qualifier: str | None = None - """ - Specify a version to delete. You can't delete a version that an alias - references. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_FUNCTION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_DELETE_FUNCTION_INPUT.members["FunctionName"], - self.function_name, - ) - - if self.qualifier is not None: - serializer.write_string( - _SCHEMA_DELETE_FUNCTION_INPUT.members["Qualifier"], self.qualifier - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_DELETE_FUNCTION_INPUT.members["FunctionName"] - ) - - case 1: - kwargs["qualifier"] = de.read_string( - _SCHEMA_DELETE_FUNCTION_INPUT.members["Qualifier"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_FUNCTION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteFunctionOutput: - """Dataclass for DeleteFunctionOutput structure.""" - - status_code: int = 0 - """The HTTP status code returned by the operation.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_FUNCTION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer( - _SCHEMA_DELETE_FUNCTION_OUTPUT.members["StatusCode"], self.status_code - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["status_code"] = de.read_integer( - _SCHEMA_DELETE_FUNCTION_OUTPUT.members["StatusCode"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_FUNCTION_OUTPUT, consumer=_consumer) - return kwargs - - -DELETE_FUNCTION = APIOperation( - input=DeleteFunctionInput, - output=DeleteFunctionOutput, - schema=_SCHEMA_DELETE_FUNCTION, - input_schema=_SCHEMA_DELETE_FUNCTION_INPUT, - output_schema=_SCHEMA_DELETE_FUNCTION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceConflictException" - ): ResourceConflictException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteFunctionEventInvokeConfigInput: - """Dataclass for DeleteFunctionEventInvokeConfigInput structure.""" - - function_name: str | None = None - """ - The name or ARN of the Lambda function, version, or alias. - - **Name formats** - - - **Function name** - `my-function` (name-only), `my-function:v1` (with - alias). - - - **Function ARN** - - `arn:aws:lambda:us-west-2:123456789012:function:my-function`. - - - **Partial ARN** - `123456789012:function:my-function`. - - You can append a version number or alias to any of the formats. The - length constraint applies only to the full ARN. If you specify only the - function name, it is limited to 64 characters in length. - """ - - qualifier: str | None = None - """A version number or alias name.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_FUNCTION_EVENT_INVOKE_CONFIG_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_DELETE_FUNCTION_EVENT_INVOKE_CONFIG_INPUT.members[ - "FunctionName" - ], - self.function_name, - ) - - if self.qualifier is not None: - serializer.write_string( - _SCHEMA_DELETE_FUNCTION_EVENT_INVOKE_CONFIG_INPUT.members["Qualifier"], - self.qualifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_DELETE_FUNCTION_EVENT_INVOKE_CONFIG_INPUT.members[ - "FunctionName" - ] - ) - - case 1: - kwargs["qualifier"] = de.read_string( - _SCHEMA_DELETE_FUNCTION_EVENT_INVOKE_CONFIG_INPUT.members[ - "Qualifier" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_FUNCTION_EVENT_INVOKE_CONFIG_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteFunctionEventInvokeConfigOutput: - """Dataclass for DeleteFunctionEventInvokeConfigOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DELETE_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT, consumer=_consumer - ) - return kwargs - - -DELETE_FUNCTION_EVENT_INVOKE_CONFIG = APIOperation( - input=DeleteFunctionEventInvokeConfigInput, - output=DeleteFunctionEventInvokeConfigOutput, - schema=_SCHEMA_DELETE_FUNCTION_EVENT_INVOKE_CONFIG, - input_schema=_SCHEMA_DELETE_FUNCTION_EVENT_INVOKE_CONFIG_INPUT, - output_schema=_SCHEMA_DELETE_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceConflictException" - ): ResourceConflictException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteResourcePolicyInput: - """Dataclass for DeleteResourcePolicyInput structure.""" - - resource_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the Lambda resource you want to delete - the policy from. You can use a qualified or an unqualified ARN. The - value must be a complete ARN, and the operation does not accept wildcard - characters. - """ - - revision_id: str | None = None - """ - The revision ID that the existing policy must match for the deletion to - proceed. If the revision ID doesn't match, the operation fails with a - `PreconditionFailedException` error. To retrieve the current revision - ID, use the GetResourcePolicy operation. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_RESOURCE_POLICY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_DELETE_RESOURCE_POLICY_INPUT.members["ResourceArn"], - self.resource_arn, - ) - - if self.revision_id is not None: - serializer.write_string( - _SCHEMA_DELETE_RESOURCE_POLICY_INPUT.members["RevisionId"], - self.revision_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_DELETE_RESOURCE_POLICY_INPUT.members["ResourceArn"] - ) - - case 1: - kwargs["revision_id"] = de.read_string( - _SCHEMA_DELETE_RESOURCE_POLICY_INPUT.members["RevisionId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_RESOURCE_POLICY_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteResourcePolicyOutput: - """Dataclass for DeleteResourcePolicyOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_RESOURCE_POLICY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_RESOURCE_POLICY_OUTPUT, consumer=_consumer - ) - return kwargs - - -DELETE_RESOURCE_POLICY = APIOperation( - input=DeleteResourcePolicyInput, - output=DeleteResourcePolicyOutput, - schema=_SCHEMA_DELETE_RESOURCE_POLICY, - input_schema=_SCHEMA_DELETE_RESOURCE_POLICY_INPUT, - output_schema=_SCHEMA_DELETE_RESOURCE_POLICY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#PreconditionFailedException" - ): PreconditionFailedException, - ShapeID( - "com.amazonaws.lambda#ResourceConflictException" - ): ResourceConflictException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_PRECONDITION_FAILED_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -class OperationAction(UnknownEnumMixin, StrEnum): - START = "START" - SUCCEED = "SUCCEED" - FAIL = "FAIL" - RETRY = "RETRY" - CANCEL = "CANCEL" - - -@dataclass(kw_only=True) -class CallbackOptions: - """ - Configuration options for callback operations in durable executions, - including timeout settings and retry behavior. - """ - - timeout_seconds: int = 0 - """ - The timeout for the callback operation in seconds. If not specified or - set to 0, the callback has no timeout. - """ - - heartbeat_timeout_seconds: int = 0 - """ - The heartbeat timeout for the callback operation, in seconds. If not - specified or set to 0, heartbeat timeout is disabled. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CALLBACK_OPTIONS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer( - _SCHEMA_CALLBACK_OPTIONS.members["TimeoutSeconds"], self.timeout_seconds - ) - serializer.write_integer( - _SCHEMA_CALLBACK_OPTIONS.members["HeartbeatTimeoutSeconds"], - self.heartbeat_timeout_seconds, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["timeout_seconds"] = de.read_integer( - _SCHEMA_CALLBACK_OPTIONS.members["TimeoutSeconds"] - ) - - case 1: - kwargs["heartbeat_timeout_seconds"] = de.read_integer( - _SCHEMA_CALLBACK_OPTIONS.members["HeartbeatTimeoutSeconds"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CALLBACK_OPTIONS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ChainedInvokeOptions: - """ - Configuration options for chained function invocations in durable - executions, including retry settings and timeout configuration. - """ - - function_name: str - """The name or ARN of the Lambda function to invoke.""" - - tenant_id: str | None = None - """The tenant identifier for the chained invocation.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CHAINED_INVOKE_OPTIONS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CHAINED_INVOKE_OPTIONS.members["FunctionName"], self.function_name - ) - if self.tenant_id is not None: - serializer.write_string( - _SCHEMA_CHAINED_INVOKE_OPTIONS.members["TenantId"], self.tenant_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_CHAINED_INVOKE_OPTIONS.members["FunctionName"] - ) - - case 1: - kwargs["tenant_id"] = de.read_string( - _SCHEMA_CHAINED_INVOKE_OPTIONS.members["TenantId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CHAINED_INVOKE_OPTIONS, consumer=_consumer) - if "function_name" not in kwargs: - kwargs["function_name"] = "" - return kwargs - - -@dataclass(kw_only=True) -class ContextOptions: - """Configuration options for a durable execution context.""" - - replay_children: bool | None = None - """ - Whether the state data of children of the completed context should be - included in the invoke payload and `GetDurableExecutionState` response. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTEXT_OPTIONS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.replay_children is not None: - serializer.write_boolean( - _SCHEMA_CONTEXT_OPTIONS.members["ReplayChildren"], self.replay_children - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["replay_children"] = de.read_boolean( - _SCHEMA_CONTEXT_OPTIONS.members["ReplayChildren"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONTEXT_OPTIONS, consumer=_consumer) - return kwargs - - -def _serialize_stack_trace_entries( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_stack_trace_entries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ErrorObject: - """An object that contains error information.""" - - error_message: str | None = field(repr=False, default=None) - """A human-readable error message.""" - - error_type: str | None = field(repr=False, default=None) - """The error type.""" - - error_data: str | None = field(repr=False, default=None) - """Machine-readable error data.""" - - stack_trace: list[str] | None = None - """Stack trace information for the error.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ERROR_OBJECT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.error_message is not None: - serializer.write_string( - _SCHEMA_ERROR_OBJECT.members["ErrorMessage"], self.error_message - ) - - if self.error_type is not None: - serializer.write_string( - _SCHEMA_ERROR_OBJECT.members["ErrorType"], self.error_type - ) - - if self.error_data is not None: - serializer.write_string( - _SCHEMA_ERROR_OBJECT.members["ErrorData"], self.error_data - ) - - if self.stack_trace is not None: - _serialize_stack_trace_entries( - serializer, _SCHEMA_ERROR_OBJECT.members["StackTrace"], self.stack_trace - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["error_message"] = de.read_string( - _SCHEMA_ERROR_OBJECT.members["ErrorMessage"] - ) - - case 1: - kwargs["error_type"] = de.read_string( - _SCHEMA_ERROR_OBJECT.members["ErrorType"] - ) - - case 2: - kwargs["error_data"] = de.read_string( - _SCHEMA_ERROR_OBJECT.members["ErrorData"] - ) - - case 3: - kwargs["stack_trace"] = _deserialize_stack_trace_entries( - de, _SCHEMA_ERROR_OBJECT.members["StackTrace"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ERROR_OBJECT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class StepOptions: - """Configuration options for a step operation.""" - - next_attempt_delay_seconds: int | None = None - """The delay in seconds before the next retry attempt.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STEP_OPTIONS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_attempt_delay_seconds is not None: - serializer.write_integer( - _SCHEMA_STEP_OPTIONS.members["NextAttemptDelaySeconds"], - self.next_attempt_delay_seconds, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_attempt_delay_seconds"] = de.read_integer( - _SCHEMA_STEP_OPTIONS.members["NextAttemptDelaySeconds"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_STEP_OPTIONS, consumer=_consumer) - return kwargs - - -class OperationType(UnknownEnumMixin, StrEnum): - EXECUTION = "EXECUTION" - CONTEXT = "CONTEXT" - STEP = "STEP" - WAIT = "WAIT" - CALLBACK = "CALLBACK" - CHAINED_INVOKE = "CHAINED_INVOKE" - - -@dataclass(kw_only=True) -class WaitOptions: - """Specifies how long to pause the durable execution.""" - - wait_seconds: int | None = None - """The duration to wait, in seconds.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_WAIT_OPTIONS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.wait_seconds is not None: - serializer.write_integer( - _SCHEMA_WAIT_OPTIONS.members["WaitSeconds"], self.wait_seconds - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["wait_seconds"] = de.read_integer( - _SCHEMA_WAIT_OPTIONS.members["WaitSeconds"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_WAIT_OPTIONS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class OperationUpdate: - """An update to be applied to an operation during checkpointing.""" - - id: str - """The unique identifier for this operation.""" - - type: str - """The type of operation to update.""" - - action: str - """The action to take on the operation.""" - - parent_id: str | None = None - """ - The unique identifier of the parent operation, if this operation is - running within a child context. - """ - - name: str | None = None - """The customer-provided name for this operation.""" - - sub_type: str | None = None - """The subtype of the operation, providing additional categorization.""" - - payload: str | None = field(repr=False, default=None) - """ - The payload for successful operations. The maximum payload size is 6 MB - for synchronous `EXECUTION` operations (RequestResponse invocationType), - 1 MB for asynchronous `EXECUTION` (Event invocationType) and - `CHAINED_INVOKE` operations, and 256 KB for `CONTEXT`, `STEP`, `WAIT`, - and `CALLBACK` operations. - """ - - error: ErrorObject | None = None - """The error information for failed operations.""" - - context_options: ContextOptions | None = None - """Options for context operations.""" - - step_options: StepOptions | None = None - """Options for step operations.""" - - wait_options: WaitOptions | None = None - """Options for wait operations.""" - - callback_options: CallbackOptions | None = None - """ - Configuration options for callback operations in durable executions, - including timeout settings and retry behavior. - """ - - chained_invoke_options: ChainedInvokeOptions | None = None - """ - Configuration options for chained function invocations in durable - executions, including retry settings and timeout configuration. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OPERATION_UPDATE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_OPERATION_UPDATE.members["Id"], self.id) - if self.parent_id is not None: - serializer.write_string( - _SCHEMA_OPERATION_UPDATE.members["ParentId"], self.parent_id - ) - - if self.name is not None: - serializer.write_string(_SCHEMA_OPERATION_UPDATE.members["Name"], self.name) - - serializer.write_string(_SCHEMA_OPERATION_UPDATE.members["Type"], self.type) - if self.sub_type is not None: - serializer.write_string( - _SCHEMA_OPERATION_UPDATE.members["SubType"], self.sub_type - ) - - serializer.write_string(_SCHEMA_OPERATION_UPDATE.members["Action"], self.action) - if self.payload is not None: - serializer.write_string( - _SCHEMA_OPERATION_UPDATE.members["Payload"], self.payload - ) - - if self.error is not None: - serializer.write_struct( - _SCHEMA_OPERATION_UPDATE.members["Error"], self.error - ) - - if self.context_options is not None: - serializer.write_struct( - _SCHEMA_OPERATION_UPDATE.members["ContextOptions"], self.context_options - ) - - if self.step_options is not None: - serializer.write_struct( - _SCHEMA_OPERATION_UPDATE.members["StepOptions"], self.step_options - ) - - if self.wait_options is not None: - serializer.write_struct( - _SCHEMA_OPERATION_UPDATE.members["WaitOptions"], self.wait_options - ) - - if self.callback_options is not None: - serializer.write_struct( - _SCHEMA_OPERATION_UPDATE.members["CallbackOptions"], - self.callback_options, - ) - - if self.chained_invoke_options is not None: - serializer.write_struct( - _SCHEMA_OPERATION_UPDATE.members["ChainedInvokeOptions"], - self.chained_invoke_options, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_OPERATION_UPDATE.members["Id"] - ) - - case 1: - kwargs["parent_id"] = de.read_string( - _SCHEMA_OPERATION_UPDATE.members["ParentId"] - ) - - case 2: - kwargs["name"] = de.read_string( - _SCHEMA_OPERATION_UPDATE.members["Name"] - ) - - case 3: - kwargs["type"] = OperationType( - de.read_string(_SCHEMA_OPERATION_UPDATE.members["Type"]) - ) - - case 4: - kwargs["sub_type"] = de.read_string( - _SCHEMA_OPERATION_UPDATE.members["SubType"] - ) - - case 5: - kwargs["action"] = OperationAction( - de.read_string(_SCHEMA_OPERATION_UPDATE.members["Action"]) - ) - - case 6: - kwargs["payload"] = de.read_string( - _SCHEMA_OPERATION_UPDATE.members["Payload"] - ) - - case 7: - kwargs["error"] = ErrorObject.deserialize(de) - - case 8: - kwargs["context_options"] = ContextOptions.deserialize(de) - - case 9: - kwargs["step_options"] = StepOptions.deserialize(de) - - case 10: - kwargs["wait_options"] = WaitOptions.deserialize(de) - - case 11: - kwargs["callback_options"] = CallbackOptions.deserialize(de) - - case 12: - kwargs["chained_invoke_options"] = ChainedInvokeOptions.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_OPERATION_UPDATE, consumer=_consumer) - if "id" not in kwargs: - kwargs["id"] = "" - if "type" not in kwargs: - kwargs["type"] = OperationType._corrected("") - if "action" not in kwargs: - kwargs["action"] = OperationAction._corrected("") - return kwargs - - -def _serialize_operation_updates( - serializer: ShapeSerializer, schema: Schema, value: list[OperationUpdate] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_operation_updates( - deserializer: ShapeDeserializer, schema: Schema -) -> list[OperationUpdate]: - result: list[OperationUpdate] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(OperationUpdate.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CheckpointDurableExecutionInput: - """Dataclass for CheckpointDurableExecutionInput structure.""" - - durable_execution_arn: str | None = None - """The Amazon Resource Name (ARN) of the durable execution.""" - - checkpoint_token: str | None = None - """ - A unique token that identifies the current checkpoint state. This token - is provided by the Lambda runtime and must be used to ensure checkpoints - are applied in the correct order. Each checkpoint operation consumes - this token and returns a new one. - """ - - updates: list[OperationUpdate] | None = None - """ - An array of state updates to apply during this checkpoint. Each update - represents a change to the execution state, such as completing a step, - starting a callback, or scheduling a timer. Updates are applied - atomically as part of the checkpoint operation. - """ - - client_token: str | None = None - """ - An optional idempotency token to ensure that duplicate checkpoint - requests are handled correctly. If provided, Lambda uses this token to - detect and handle duplicate requests within a 15-minute window. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CHECKPOINT_DURABLE_EXECUTION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.durable_execution_arn is not None: - serializer.write_string( - _SCHEMA_CHECKPOINT_DURABLE_EXECUTION_INPUT.members[ - "DurableExecutionArn" - ], - self.durable_execution_arn, - ) - - if self.checkpoint_token is not None: - serializer.write_string( - _SCHEMA_CHECKPOINT_DURABLE_EXECUTION_INPUT.members["CheckpointToken"], - self.checkpoint_token, - ) - - if self.updates is not None: - _serialize_operation_updates( - serializer, - _SCHEMA_CHECKPOINT_DURABLE_EXECUTION_INPUT.members["Updates"], - self.updates, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CHECKPOINT_DURABLE_EXECUTION_INPUT.members["ClientToken"], - self.client_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["durable_execution_arn"] = de.read_string( - _SCHEMA_CHECKPOINT_DURABLE_EXECUTION_INPUT.members[ - "DurableExecutionArn" - ] - ) - - case 1: - kwargs["checkpoint_token"] = de.read_string( - _SCHEMA_CHECKPOINT_DURABLE_EXECUTION_INPUT.members[ - "CheckpointToken" - ] - ) - - case 2: - kwargs["updates"] = _deserialize_operation_updates( - de, - _SCHEMA_CHECKPOINT_DURABLE_EXECUTION_INPUT.members["Updates"], - ) - - case 3: - kwargs["client_token"] = de.read_string( - _SCHEMA_CHECKPOINT_DURABLE_EXECUTION_INPUT.members[ - "ClientToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CHECKPOINT_DURABLE_EXECUTION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CallbackDetails: - """ - Contains details about a callback operation in a durable execution, - including the callback token and timeout configuration. - """ - - callback_id: str | None = None - """ - The callback ID. Callback IDs are generated by the `DurableContext` when - a durable function calls `ctx.waitForCallback`. - """ - - result: str | None = field(repr=False, default=None) - """The response payload from the callback operation as a string.""" - - error: ErrorObject | None = None - """An error object that contains details about the failure.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CALLBACK_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.callback_id is not None: - serializer.write_string( - _SCHEMA_CALLBACK_DETAILS.members["CallbackId"], self.callback_id - ) - - if self.result is not None: - serializer.write_string( - _SCHEMA_CALLBACK_DETAILS.members["Result"], self.result - ) - - if self.error is not None: - serializer.write_struct( - _SCHEMA_CALLBACK_DETAILS.members["Error"], self.error - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["callback_id"] = de.read_string( - _SCHEMA_CALLBACK_DETAILS.members["CallbackId"] - ) - - case 1: - kwargs["result"] = de.read_string( - _SCHEMA_CALLBACK_DETAILS.members["Result"] - ) - - case 2: - kwargs["error"] = ErrorObject.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CALLBACK_DETAILS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ChainedInvokeDetails: - """ - Contains details about a chained function invocation in a durable - execution, including the target function and invocation parameters. - """ - - result: str | None = field(repr=False, default=None) - """The response payload from the chained invocation.""" - - error: ErrorObject | None = None - """Details about the chained invocation failure.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CHAINED_INVOKE_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.result is not None: - serializer.write_string( - _SCHEMA_CHAINED_INVOKE_DETAILS.members["Result"], self.result - ) - - if self.error is not None: - serializer.write_struct( - _SCHEMA_CHAINED_INVOKE_DETAILS.members["Error"], self.error - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["result"] = de.read_string( - _SCHEMA_CHAINED_INVOKE_DETAILS.members["Result"] - ) - - case 1: - kwargs["error"] = ErrorObject.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CHAINED_INVOKE_DETAILS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ContextDetails: - """Details about a durable execution context.""" - - replay_children: bool | None = None - """ - Whether the state data of child operations of this completed context - should be included in the invoke payload and `GetDurableExecutionState` - response. - """ - - result: str | None = field(repr=False, default=None) - """The response payload from the context.""" - - error: ErrorObject | None = None - """Details about the context failure.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTEXT_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.replay_children is not None: - serializer.write_boolean( - _SCHEMA_CONTEXT_DETAILS.members["ReplayChildren"], self.replay_children - ) - - if self.result is not None: - serializer.write_string( - _SCHEMA_CONTEXT_DETAILS.members["Result"], self.result - ) - - if self.error is not None: - serializer.write_struct( - _SCHEMA_CONTEXT_DETAILS.members["Error"], self.error - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["replay_children"] = de.read_boolean( - _SCHEMA_CONTEXT_DETAILS.members["ReplayChildren"] - ) - - case 1: - kwargs["result"] = de.read_string( - _SCHEMA_CONTEXT_DETAILS.members["Result"] - ) - - case 2: - kwargs["error"] = ErrorObject.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONTEXT_DETAILS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ExecutionDetails: - """ - Details about a [durable - execution](https://docs.aws.amazon.com/lambda/latest/dg/durable-functions.html). - """ - - input_payload: str | None = field(repr=False, default=None) - """The original input payload provided for the durable execution.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EXECUTION_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.input_payload is not None: - serializer.write_string( - _SCHEMA_EXECUTION_DETAILS.members["InputPayload"], self.input_payload - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["input_payload"] = de.read_string( - _SCHEMA_EXECUTION_DETAILS.members["InputPayload"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EXECUTION_DETAILS, consumer=_consumer) - return kwargs - - -class OperationStatus(UnknownEnumMixin, StrEnum): - STARTED = "STARTED" - PENDING = "PENDING" - READY = "READY" - SUCCEEDED = "SUCCEEDED" - FAILED = "FAILED" - CANCELLED = "CANCELLED" - TIMED_OUT = "TIMED_OUT" - STOPPED = "STOPPED" - - -@dataclass(kw_only=True) -class StepDetails: - """Details about a step operation.""" - - attempt: int = 0 - """The current attempt number for this step.""" - - next_attempt_timestamp: datetime | None = None - """ - The date and time when the next attempt is scheduled, in [ISO-8601 - format](https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). - Only populated when the step is in a pending state. - """ - - result: str | None = field(repr=False, default=None) - """The JSON response payload from the step operation.""" - - error: ErrorObject | None = None - """Details about the step failure.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STEP_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer(_SCHEMA_STEP_DETAILS.members["Attempt"], self.attempt) - if self.next_attempt_timestamp is not None: - serializer.write_timestamp( - _SCHEMA_STEP_DETAILS.members["NextAttemptTimestamp"], - self.next_attempt_timestamp, - ) - - if self.result is not None: - serializer.write_string(_SCHEMA_STEP_DETAILS.members["Result"], self.result) - - if self.error is not None: - serializer.write_struct(_SCHEMA_STEP_DETAILS.members["Error"], self.error) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["attempt"] = de.read_integer( - _SCHEMA_STEP_DETAILS.members["Attempt"] - ) - - case 1: - kwargs["next_attempt_timestamp"] = de.read_timestamp( - _SCHEMA_STEP_DETAILS.members["NextAttemptTimestamp"] - ) - - case 2: - kwargs["result"] = de.read_string( - _SCHEMA_STEP_DETAILS.members["Result"] - ) - - case 3: - kwargs["error"] = ErrorObject.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_STEP_DETAILS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class WaitDetails: - """Details about a wait operation.""" - - scheduled_end_timestamp: datetime | None = None - """ - The date and time when the wait operation is scheduled to complete, in - [ISO-8601 format](https://www.w3.org/TR/NOTE-datetime) - (YYYY-MM-DDThh:mm:ss.sTZD). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_WAIT_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.scheduled_end_timestamp is not None: - serializer.write_timestamp( - _SCHEMA_WAIT_DETAILS.members["ScheduledEndTimestamp"], - self.scheduled_end_timestamp, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["scheduled_end_timestamp"] = de.read_timestamp( - _SCHEMA_WAIT_DETAILS.members["ScheduledEndTimestamp"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_WAIT_DETAILS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Operation: - """Information about an operation within a durable execution.""" - - id: str - """The unique identifier for this operation.""" - - type: str - """The type of operation.""" - - start_timestamp: datetime - """ - The date and time when the operation started, in [ISO-8601 - format](https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). - """ - - status: str - """The current status of the operation.""" - - parent_id: str | None = None - """ - The unique identifier of the parent operation, if this operation is - running within a child context. - """ - - name: str | None = None - """The customer-provided name for this operation.""" - - sub_type: str | None = None - """The subtype of the operation, providing additional categorization.""" - - end_timestamp: datetime | None = None - """ - The date and time when the operation ended, in [ISO-8601 - format](https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). - """ - - execution_details: ExecutionDetails | None = None - """Details about the execution, if this operation represents an execution.""" - - context_details: ContextDetails | None = None - """Details about the context, if this operation represents a context.""" - - step_details: StepDetails | None = None - """Details about the step, if this operation represents a step.""" - - wait_details: WaitDetails | None = None - """Details about the wait operation, if this operation represents a wait.""" - - callback_details: CallbackDetails | None = None - """ - Contains details about a callback operation in a durable execution, - including the callback token and timeout configuration. - """ - - chained_invoke_details: ChainedInvokeDetails | None = None - """ - Contains details about a chained function invocation in a durable - execution, including the target function and invocation parameters. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OPERATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_OPERATION.members["Id"], self.id) - if self.parent_id is not None: - serializer.write_string( - _SCHEMA_OPERATION.members["ParentId"], self.parent_id - ) - - if self.name is not None: - serializer.write_string(_SCHEMA_OPERATION.members["Name"], self.name) - - serializer.write_string(_SCHEMA_OPERATION.members["Type"], self.type) - if self.sub_type is not None: - serializer.write_string(_SCHEMA_OPERATION.members["SubType"], self.sub_type) - - serializer.write_timestamp( - _SCHEMA_OPERATION.members["StartTimestamp"], self.start_timestamp - ) - if self.end_timestamp is not None: - serializer.write_timestamp( - _SCHEMA_OPERATION.members["EndTimestamp"], self.end_timestamp - ) - - serializer.write_string(_SCHEMA_OPERATION.members["Status"], self.status) - if self.execution_details is not None: - serializer.write_struct( - _SCHEMA_OPERATION.members["ExecutionDetails"], self.execution_details - ) - - if self.context_details is not None: - serializer.write_struct( - _SCHEMA_OPERATION.members["ContextDetails"], self.context_details - ) - - if self.step_details is not None: - serializer.write_struct( - _SCHEMA_OPERATION.members["StepDetails"], self.step_details - ) - - if self.wait_details is not None: - serializer.write_struct( - _SCHEMA_OPERATION.members["WaitDetails"], self.wait_details - ) - - if self.callback_details is not None: - serializer.write_struct( - _SCHEMA_OPERATION.members["CallbackDetails"], self.callback_details - ) - - if self.chained_invoke_details is not None: - serializer.write_struct( - _SCHEMA_OPERATION.members["ChainedInvokeDetails"], - self.chained_invoke_details, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string(_SCHEMA_OPERATION.members["Id"]) - - case 1: - kwargs["parent_id"] = de.read_string( - _SCHEMA_OPERATION.members["ParentId"] - ) - - case 2: - kwargs["name"] = de.read_string(_SCHEMA_OPERATION.members["Name"]) - - case 3: - kwargs["type"] = OperationType( - de.read_string(_SCHEMA_OPERATION.members["Type"]) - ) - - case 4: - kwargs["sub_type"] = de.read_string( - _SCHEMA_OPERATION.members["SubType"] - ) - - case 5: - kwargs["start_timestamp"] = de.read_timestamp( - _SCHEMA_OPERATION.members["StartTimestamp"] - ) - - case 6: - kwargs["end_timestamp"] = de.read_timestamp( - _SCHEMA_OPERATION.members["EndTimestamp"] - ) - - case 7: - kwargs["status"] = OperationStatus( - de.read_string(_SCHEMA_OPERATION.members["Status"]) - ) - - case 8: - kwargs["execution_details"] = ExecutionDetails.deserialize(de) - - case 9: - kwargs["context_details"] = ContextDetails.deserialize(de) - - case 10: - kwargs["step_details"] = StepDetails.deserialize(de) - - case 11: - kwargs["wait_details"] = WaitDetails.deserialize(de) - - case 12: - kwargs["callback_details"] = CallbackDetails.deserialize(de) - - case 13: - kwargs["chained_invoke_details"] = ChainedInvokeDetails.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_OPERATION, consumer=_consumer) - if "id" not in kwargs: - kwargs["id"] = "" - if "type" not in kwargs: - kwargs["type"] = OperationType._corrected("") - if "start_timestamp" not in kwargs: - kwargs["start_timestamp"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "status" not in kwargs: - kwargs["status"] = OperationStatus._corrected("") - return kwargs - - -def _serialize_operations( - serializer: ShapeSerializer, schema: Schema, value: list[Operation] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_operations( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Operation]: - result: list[Operation] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Operation.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CheckpointUpdatedExecutionState: - """ - Contains operations that have been updated since the last checkpoint, - such as completed asynchronous work like timers or callbacks. - """ - - operations: list[Operation] | None = None - """A list of operations that have been updated since the last checkpoint.""" - - next_marker: str | None = None - """ - Indicates that more results are available. Use this value in a - subsequent call to retrieve the next page of results. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CHECKPOINT_UPDATED_EXECUTION_STATE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.operations is not None: - _serialize_operations( - serializer, - _SCHEMA_CHECKPOINT_UPDATED_EXECUTION_STATE.members["Operations"], - self.operations, - ) - - if self.next_marker is not None: - serializer.write_string( - _SCHEMA_CHECKPOINT_UPDATED_EXECUTION_STATE.members["NextMarker"], - self.next_marker, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["operations"] = _deserialize_operations( - de, - _SCHEMA_CHECKPOINT_UPDATED_EXECUTION_STATE.members[ - "Operations" - ], - ) - - case 1: - kwargs["next_marker"] = de.read_string( - _SCHEMA_CHECKPOINT_UPDATED_EXECUTION_STATE.members["NextMarker"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CHECKPOINT_UPDATED_EXECUTION_STATE, consumer=_consumer - ) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls() - - -@dataclass(kw_only=True) -class CheckpointDurableExecutionOutput: - """The response from the CheckpointDurableExecution operation.""" - - new_execution_state: CheckpointUpdatedExecutionState - """ - Updated execution state information that includes any changes that - occurred since the last checkpoint, such as completed callbacks or - expired timers. This allows the SDK to update its internal state during - replay. - """ - - checkpoint_token: str | None = None - """ - A new checkpoint token to use for the next checkpoint operation. This - token replaces the one provided in the request and must be used for - subsequent checkpoints to maintain proper ordering. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CHECKPOINT_DURABLE_EXECUTION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.checkpoint_token is not None: - serializer.write_string( - _SCHEMA_CHECKPOINT_DURABLE_EXECUTION_OUTPUT.members["CheckpointToken"], - self.checkpoint_token, - ) - - serializer.write_struct( - _SCHEMA_CHECKPOINT_DURABLE_EXECUTION_OUTPUT.members["NewExecutionState"], - self.new_execution_state, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["checkpoint_token"] = de.read_string( - _SCHEMA_CHECKPOINT_DURABLE_EXECUTION_OUTPUT.members[ - "CheckpointToken" - ] - ) - - case 1: - kwargs["new_execution_state"] = ( - CheckpointUpdatedExecutionState.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CHECKPOINT_DURABLE_EXECUTION_OUTPUT, consumer=_consumer - ) - if "new_execution_state" not in kwargs: - kwargs["new_execution_state"] = ( - CheckpointUpdatedExecutionState._smithy_default() - ) - return kwargs - - -@dataclass(kw_only=True) -class KMSAccessDeniedException(ServiceError): - """ - Lambda couldn't decrypt the environment variables because KMS access - was denied. Check the Lambda function's KMS permissions. - """ - - fault: Literal["client", "server"] | None = "server" - - type: str | None = None - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KMS_ACCESS_DENIED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_KMS_ACCESS_DENIED_EXCEPTION.members["Type"], self.type - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_KMS_ACCESS_DENIED_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_KMS_ACCESS_DENIED_EXCEPTION.members["Type"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_KMS_ACCESS_DENIED_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_KMS_ACCESS_DENIED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class KMSDisabledException(ServiceError): - """ - Lambda couldn't decrypt the environment variables because the KMS key - used is disabled. Check the Lambda function's KMS key settings. - """ - - fault: Literal["client", "server"] | None = "server" - - type: str | None = None - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KMS_DISABLED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_KMS_DISABLED_EXCEPTION.members["Type"], self.type - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_KMS_DISABLED_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_KMS_DISABLED_EXCEPTION.members["Type"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_KMS_DISABLED_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_KMS_DISABLED_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class KMSInvalidStateException(ServiceError): - """ - Lambda couldn't decrypt the environment variables because the state of - the KMS key used is not valid for Decrypt. Check the function's KMS key - settings. - """ - - fault: Literal["client", "server"] | None = "server" - - type: str | None = None - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KMS_INVALID_STATE_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_KMS_INVALID_STATE_EXCEPTION.members["Type"], self.type - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_KMS_INVALID_STATE_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_KMS_INVALID_STATE_EXCEPTION.members["Type"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_KMS_INVALID_STATE_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_KMS_INVALID_STATE_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class KMSNotFoundException(ServiceError): - """ - Lambda couldn't decrypt the environment variables because the KMS key - was not found. Check the function's KMS key settings. - """ - - fault: Literal["client", "server"] | None = "server" - - type: str | None = None - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KMS_NOT_FOUND_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_KMS_NOT_FOUND_EXCEPTION.members["Type"], self.type - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_KMS_NOT_FOUND_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_KMS_NOT_FOUND_EXCEPTION.members["Type"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_KMS_NOT_FOUND_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_KMS_NOT_FOUND_EXCEPTION, consumer=_consumer) - return kwargs - - -CHECKPOINT_DURABLE_EXECUTION = APIOperation( - input=CheckpointDurableExecutionInput, - output=CheckpointDurableExecutionOutput, - schema=_SCHEMA_CHECKPOINT_DURABLE_EXECUTION, - input_schema=_SCHEMA_CHECKPOINT_DURABLE_EXECUTION_INPUT, - output_schema=_SCHEMA_CHECKPOINT_DURABLE_EXECUTION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#KMSAccessDeniedException" - ): KMSAccessDeniedException, - ShapeID("com.amazonaws.lambda#KMSDisabledException"): KMSDisabledException, - ShapeID( - "com.amazonaws.lambda#KMSInvalidStateException" - ): KMSInvalidStateException, - ShapeID("com.amazonaws.lambda#KMSNotFoundException"): KMSNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_KMS_ACCESS_DENIED_EXCEPTION, - _SCHEMA_KMS_DISABLED_EXCEPTION, - _SCHEMA_KMS_INVALID_STATE_EXCEPTION, - _SCHEMA_KMS_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetDurableExecutionInput: - """Dataclass for GetDurableExecutionInput structure.""" - - durable_execution_arn: str | None = None - """The Amazon Resource Name (ARN) of the durable execution.""" - - include_execution_data: bool = True - """ - Specifies whether to include execution data such as input payload, - result, and error information in the response. Set to `false` for a more - compact response that includes only execution metadata. The default - value is set to `true`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DURABLE_EXECUTION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.durable_execution_arn is not None: - serializer.write_string( - _SCHEMA_GET_DURABLE_EXECUTION_INPUT.members["DurableExecutionArn"], - self.durable_execution_arn, - ) - - if self.include_execution_data is not None: - serializer.write_boolean( - _SCHEMA_GET_DURABLE_EXECUTION_INPUT.members["IncludeExecutionData"], - self.include_execution_data, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["durable_execution_arn"] = de.read_string( - _SCHEMA_GET_DURABLE_EXECUTION_INPUT.members[ - "DurableExecutionArn" - ] - ) - - case 1: - kwargs["include_execution_data"] = de.read_boolean( - _SCHEMA_GET_DURABLE_EXECUTION_INPUT.members[ - "IncludeExecutionData" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_DURABLE_EXECUTION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DurableConfig: - """ - Configuration settings for [durable - functions](https://docs.aws.amazon.com/lambda/latest/dg/durable-functions.html), - including execution timeout, retention period for execution history, and - an optional ARN of the Key Management Service (KMS) customer managed key - that is used to encrypt your durable execution's payload data, - including input, output, and error payloads. - """ - - kms_key_arn: str | None = None - """ - The ARN of the Key Management Service (KMS) customer managed key that is - used to encrypt your durable execution's payload data, including input, - output, and error payloads. - """ - - retention_period_in_days: int | None = None - """ - The number of days to retain execution history after a durable execution - completes. After this period, execution history is no longer available - through the GetDurableExecutionHistory API. - """ - - execution_timeout: int | None = None - """ - The maximum time (in seconds) that a durable execution can run before - timing out. This timeout applies to the entire durable execution, not - individual function invocations. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DURABLE_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_DURABLE_CONFIG.members["KMSKeyArn"], self.kms_key_arn - ) - - if self.retention_period_in_days is not None: - serializer.write_integer( - _SCHEMA_DURABLE_CONFIG.members["RetentionPeriodInDays"], - self.retention_period_in_days, - ) - - if self.execution_timeout is not None: - serializer.write_integer( - _SCHEMA_DURABLE_CONFIG.members["ExecutionTimeout"], - self.execution_timeout, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_DURABLE_CONFIG.members["KMSKeyArn"] - ) - - case 1: - kwargs["retention_period_in_days"] = de.read_integer( - _SCHEMA_DURABLE_CONFIG.members["RetentionPeriodInDays"] - ) - - case 2: - kwargs["execution_timeout"] = de.read_integer( - _SCHEMA_DURABLE_CONFIG.members["ExecutionTimeout"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DURABLE_CONFIG, consumer=_consumer) - return kwargs - - -class ExecutionStatus(UnknownEnumMixin, StrEnum): - RUNNING = "RUNNING" - SUCCEEDED = "SUCCEEDED" - FAILED = "FAILED" - TIMED_OUT = "TIMED_OUT" - STOPPED = "STOPPED" - - -@dataclass(kw_only=True) -class TraceHeader: - """Contains trace headers for the Lambda durable execution.""" - - x_amzn_trace_id: str | None = None - """The X-Ray trace header associated with the durable execution.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRACE_HEADER, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.x_amzn_trace_id is not None: - serializer.write_string( - _SCHEMA_TRACE_HEADER.members["XAmznTraceId"], self.x_amzn_trace_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["x_amzn_trace_id"] = de.read_string( - _SCHEMA_TRACE_HEADER.members["XAmznTraceId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TRACE_HEADER, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetDurableExecutionOutput: - """ - The response from the GetDurableExecution operation, containing detailed - information about the durable execution. - """ - - durable_execution_arn: str - """The Amazon Resource Name (ARN) of the durable execution.""" - - durable_execution_name: str - """ - The name of the durable execution. This is either the name you provided - when invoking the function, or a system-generated unique identifier if - no name was provided. - """ - - function_arn: str - """ - The Amazon Resource Name (ARN) of the Lambda function that was invoked - to start this durable execution. - """ - - start_timestamp: datetime - """ - The date and time when the durable execution started, in Unix timestamp - format. - """ - - status: str - """ - The current status of the durable execution. Valid values are `RUNNING`, - `SUCCEEDED`, `FAILED`, `TIMED_OUT`, and `STOPPED`. - """ - - input_payload: str | None = field(repr=False, default=None) - """ - The JSON input payload that was provided when the durable execution was - started. For asynchronous invocations, this is limited to 256 KB. For - synchronous invocations, this can be up to 6 MB. - """ - - result: str | None = field(repr=False, default=None) - """ - The JSON result returned by the durable execution if it completed - successfully. This field is only present when the execution status is - `SUCCEEDED`. The result is limited to 256 KB. - """ - - error: ErrorObject | None = None - """ - Error information if the durable execution failed. This field is only - present when the execution status is `FAILED`, `TIMED_OUT`, or - `STOPPED`. The combined size of all error fields is limited to 256 KB. - """ - - end_timestamp: datetime | None = None - """ - The date and time when the durable execution ended, in Unix timestamp - format. This field is only present if the execution has completed - (status is `SUCCEEDED`, `FAILED`, `TIMED_OUT`, or `STOPPED`). - """ - - version: str | None = None - """ - The version of the Lambda function that was invoked for this durable - execution. This ensures that all replays during the execution use the - same function version. - """ - - trace_header: TraceHeader | None = None - """The trace headers associated with the durable execution.""" - - execution_data_included: bool | None = None - """ - Indicates whether execution data is included in this response. Returns - `false` when `IncludeExecutionData` is set to `false` in the request. - """ - - durable_config: DurableConfig | None = None - """ - Configuration settings for the durable execution, including execution - timeout, retention period for execution history, and an optional ARN of - the Key Management Service (KMS) customer managed key that is used to - encrypt your durable execution's payload data, including input, output, - and error payloads. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DURABLE_EXECUTION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_DURABLE_EXECUTION_OUTPUT.members["DurableExecutionArn"], - self.durable_execution_arn, - ) - serializer.write_string( - _SCHEMA_GET_DURABLE_EXECUTION_OUTPUT.members["DurableExecutionName"], - self.durable_execution_name, - ) - serializer.write_string( - _SCHEMA_GET_DURABLE_EXECUTION_OUTPUT.members["FunctionArn"], - self.function_arn, - ) - if self.input_payload is not None: - serializer.write_string( - _SCHEMA_GET_DURABLE_EXECUTION_OUTPUT.members["InputPayload"], - self.input_payload, - ) - - if self.result is not None: - serializer.write_string( - _SCHEMA_GET_DURABLE_EXECUTION_OUTPUT.members["Result"], self.result - ) - - if self.error is not None: - serializer.write_struct( - _SCHEMA_GET_DURABLE_EXECUTION_OUTPUT.members["Error"], self.error - ) - - serializer.write_timestamp( - _SCHEMA_GET_DURABLE_EXECUTION_OUTPUT.members["StartTimestamp"], - self.start_timestamp, - ) - serializer.write_string( - _SCHEMA_GET_DURABLE_EXECUTION_OUTPUT.members["Status"], self.status - ) - if self.end_timestamp is not None: - serializer.write_timestamp( - _SCHEMA_GET_DURABLE_EXECUTION_OUTPUT.members["EndTimestamp"], - self.end_timestamp, - ) - - if self.version is not None: - serializer.write_string( - _SCHEMA_GET_DURABLE_EXECUTION_OUTPUT.members["Version"], self.version - ) - - if self.trace_header is not None: - serializer.write_struct( - _SCHEMA_GET_DURABLE_EXECUTION_OUTPUT.members["TraceHeader"], - self.trace_header, - ) - - if self.execution_data_included is not None: - serializer.write_boolean( - _SCHEMA_GET_DURABLE_EXECUTION_OUTPUT.members["ExecutionDataIncluded"], - self.execution_data_included, - ) - - if self.durable_config is not None: - serializer.write_struct( - _SCHEMA_GET_DURABLE_EXECUTION_OUTPUT.members["DurableConfig"], - self.durable_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["durable_execution_arn"] = de.read_string( - _SCHEMA_GET_DURABLE_EXECUTION_OUTPUT.members[ - "DurableExecutionArn" - ] - ) - - case 1: - kwargs["durable_execution_name"] = de.read_string( - _SCHEMA_GET_DURABLE_EXECUTION_OUTPUT.members[ - "DurableExecutionName" - ] - ) - - case 2: - kwargs["function_arn"] = de.read_string( - _SCHEMA_GET_DURABLE_EXECUTION_OUTPUT.members["FunctionArn"] - ) - - case 3: - kwargs["input_payload"] = de.read_string( - _SCHEMA_GET_DURABLE_EXECUTION_OUTPUT.members["InputPayload"] - ) - - case 4: - kwargs["result"] = de.read_string( - _SCHEMA_GET_DURABLE_EXECUTION_OUTPUT.members["Result"] - ) - - case 5: - kwargs["error"] = ErrorObject.deserialize(de) - - case 6: - kwargs["start_timestamp"] = de.read_timestamp( - _SCHEMA_GET_DURABLE_EXECUTION_OUTPUT.members["StartTimestamp"] - ) - - case 7: - kwargs["status"] = ExecutionStatus( - de.read_string( - _SCHEMA_GET_DURABLE_EXECUTION_OUTPUT.members["Status"] - ) - ) - - case 8: - kwargs["end_timestamp"] = de.read_timestamp( - _SCHEMA_GET_DURABLE_EXECUTION_OUTPUT.members["EndTimestamp"] - ) - - case 9: - kwargs["version"] = de.read_string( - _SCHEMA_GET_DURABLE_EXECUTION_OUTPUT.members["Version"] - ) - - case 10: - kwargs["trace_header"] = TraceHeader.deserialize(de) - - case 11: - kwargs["execution_data_included"] = de.read_boolean( - _SCHEMA_GET_DURABLE_EXECUTION_OUTPUT.members[ - "ExecutionDataIncluded" - ] - ) - - case 12: - kwargs["durable_config"] = DurableConfig.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_DURABLE_EXECUTION_OUTPUT, consumer=_consumer - ) - if "durable_execution_arn" not in kwargs: - kwargs["durable_execution_arn"] = "" - if "durable_execution_name" not in kwargs: - kwargs["durable_execution_name"] = "" - if "function_arn" not in kwargs: - kwargs["function_arn"] = "" - if "start_timestamp" not in kwargs: - kwargs["start_timestamp"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "status" not in kwargs: - kwargs["status"] = ExecutionStatus._corrected("") - return kwargs - - -GET_DURABLE_EXECUTION = APIOperation( - input=GetDurableExecutionInput, - output=GetDurableExecutionOutput, - schema=_SCHEMA_GET_DURABLE_EXECUTION, - input_schema=_SCHEMA_GET_DURABLE_EXECUTION_INPUT, - output_schema=_SCHEMA_GET_DURABLE_EXECUTION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#KMSAccessDeniedException" - ): KMSAccessDeniedException, - ShapeID("com.amazonaws.lambda#KMSDisabledException"): KMSDisabledException, - ShapeID( - "com.amazonaws.lambda#KMSInvalidStateException" - ): KMSInvalidStateException, - ShapeID("com.amazonaws.lambda#KMSNotFoundException"): KMSNotFoundException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_KMS_ACCESS_DENIED_EXCEPTION, - _SCHEMA_KMS_DISABLED_EXCEPTION, - _SCHEMA_KMS_INVALID_STATE_EXCEPTION, - _SCHEMA_KMS_NOT_FOUND_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetDurableExecutionHistoryInput: - """Dataclass for GetDurableExecutionHistoryInput structure.""" - - durable_execution_arn: str | None = None - """The Amazon Resource Name (ARN) of the durable execution.""" - - include_execution_data: bool | None = None - """ - Specifies whether to include execution data such as step results and - callback payloads in the history events. Set to `true` to include data, - or `false` to exclude it for a more compact response. The default is - `true`. - """ - - max_items: int = 0 - """ - The maximum number of history events to return per call. You can use - `Marker` to retrieve additional pages of results. The default is 100 and - the maximum allowed is 1000. A value of 0 uses the default. - """ - - marker: str | None = None - """ - If `NextMarker` was returned from a previous request, use this value to - retrieve the next page of results. Each pagination token expires after - 24 hours. - """ - - reverse_order: bool | None = None - """ - When set to `true`, returns the history events in reverse chronological - order (newest first). By default, events are returned in chronological - order (oldest first). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DURABLE_EXECUTION_HISTORY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.durable_execution_arn is not None: - serializer.write_string( - _SCHEMA_GET_DURABLE_EXECUTION_HISTORY_INPUT.members[ - "DurableExecutionArn" - ], - self.durable_execution_arn, - ) - - if self.include_execution_data is not None: - serializer.write_boolean( - _SCHEMA_GET_DURABLE_EXECUTION_HISTORY_INPUT.members[ - "IncludeExecutionData" - ], - self.include_execution_data, - ) - - if self.max_items is not None: - serializer.write_integer( - _SCHEMA_GET_DURABLE_EXECUTION_HISTORY_INPUT.members["MaxItems"], - self.max_items, - ) - - if self.marker is not None: - serializer.write_string( - _SCHEMA_GET_DURABLE_EXECUTION_HISTORY_INPUT.members["Marker"], - self.marker, - ) - - if self.reverse_order is not None: - serializer.write_boolean( - _SCHEMA_GET_DURABLE_EXECUTION_HISTORY_INPUT.members["ReverseOrder"], - self.reverse_order, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["durable_execution_arn"] = de.read_string( - _SCHEMA_GET_DURABLE_EXECUTION_HISTORY_INPUT.members[ - "DurableExecutionArn" - ] - ) - - case 1: - kwargs["include_execution_data"] = de.read_boolean( - _SCHEMA_GET_DURABLE_EXECUTION_HISTORY_INPUT.members[ - "IncludeExecutionData" - ] - ) - - case 2: - kwargs["max_items"] = de.read_integer( - _SCHEMA_GET_DURABLE_EXECUTION_HISTORY_INPUT.members["MaxItems"] - ) - - case 3: - kwargs["marker"] = de.read_string( - _SCHEMA_GET_DURABLE_EXECUTION_HISTORY_INPUT.members["Marker"] - ) - - case 4: - kwargs["reverse_order"] = de.read_boolean( - _SCHEMA_GET_DURABLE_EXECUTION_HISTORY_INPUT.members[ - "ReverseOrder" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_DURABLE_EXECUTION_HISTORY_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class EventError: - """Error information for an event.""" - - payload: ErrorObject | None = None - """The error payload.""" - - truncated: bool | None = None - """Indicates if the error payload was truncated due to size limits.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVENT_ERROR, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.payload is not None: - serializer.write_struct( - _SCHEMA_EVENT_ERROR.members["Payload"], self.payload - ) - - if self.truncated is not None: - serializer.write_boolean( - _SCHEMA_EVENT_ERROR.members["Truncated"], self.truncated - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["payload"] = ErrorObject.deserialize(de) - - case 1: - kwargs["truncated"] = de.read_boolean( - _SCHEMA_EVENT_ERROR.members["Truncated"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EVENT_ERROR, consumer=_consumer) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls() - - -@dataclass(kw_only=True) -class CallbackFailedDetails: - """ - Contains details about a failed callback operation, including error - information and the reason for failure. - """ - - error: EventError - """An error object that contains details about the failure.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CALLBACK_FAILED_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CALLBACK_FAILED_DETAILS.members["Error"], self.error - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["error"] = EventError.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CALLBACK_FAILED_DETAILS, consumer=_consumer) - if "error" not in kwargs: - kwargs["error"] = EventError._smithy_default() - return kwargs - - -@dataclass(kw_only=True) -class CallbackStartedDetails: - """ - Contains details about a callback operation that has started, including - timing information and callback metadata. - """ - - callback_id: str - """ - The callback ID. Callback IDs are generated by the `DurableContext` when - a durable function calls `ctx.waitForCallback`. - """ - - heartbeat_timeout: int | None = None - """The heartbeat timeout value, in seconds.""" - - timeout: int | None = None - """The timeout value, in seconds.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CALLBACK_STARTED_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CALLBACK_STARTED_DETAILS.members["CallbackId"], self.callback_id - ) - if self.heartbeat_timeout is not None: - serializer.write_integer( - _SCHEMA_CALLBACK_STARTED_DETAILS.members["HeartbeatTimeout"], - self.heartbeat_timeout, - ) - - if self.timeout is not None: - serializer.write_integer( - _SCHEMA_CALLBACK_STARTED_DETAILS.members["Timeout"], self.timeout - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["callback_id"] = de.read_string( - _SCHEMA_CALLBACK_STARTED_DETAILS.members["CallbackId"] - ) - - case 1: - kwargs["heartbeat_timeout"] = de.read_integer( - _SCHEMA_CALLBACK_STARTED_DETAILS.members["HeartbeatTimeout"] - ) - - case 2: - kwargs["timeout"] = de.read_integer( - _SCHEMA_CALLBACK_STARTED_DETAILS.members["Timeout"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CALLBACK_STARTED_DETAILS, consumer=_consumer) - if "callback_id" not in kwargs: - kwargs["callback_id"] = "" - return kwargs - - -@dataclass(kw_only=True) -class EventResult: - """Result information for an event.""" - - payload: str | None = field(repr=False, default=None) - """The result payload.""" - - truncated: bool | None = None - """Indicates if the error payload was truncated due to size limits.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVENT_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.payload is not None: - serializer.write_string( - _SCHEMA_EVENT_RESULT.members["Payload"], self.payload - ) - - if self.truncated is not None: - serializer.write_boolean( - _SCHEMA_EVENT_RESULT.members["Truncated"], self.truncated - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["payload"] = de.read_string( - _SCHEMA_EVENT_RESULT.members["Payload"] - ) - - case 1: - kwargs["truncated"] = de.read_boolean( - _SCHEMA_EVENT_RESULT.members["Truncated"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EVENT_RESULT, consumer=_consumer) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls() - - -@dataclass(kw_only=True) -class CallbackSucceededDetails: - """ - Contains details about a successfully completed callback operation, - including the result data and completion timestamp. - """ - - result: EventResult - """The response payload from the successful operation.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CALLBACK_SUCCEEDED_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CALLBACK_SUCCEEDED_DETAILS.members["Result"], self.result - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["result"] = EventResult.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CALLBACK_SUCCEEDED_DETAILS, consumer=_consumer) - if "result" not in kwargs: - kwargs["result"] = EventResult._smithy_default() - return kwargs - - -@dataclass(kw_only=True) -class CallbackTimedOutDetails: - """ - Contains details about a callback operation that timed out, including - timeout duration and any partial results. - """ - - error: EventError - """Details about the callback timeout.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CALLBACK_TIMED_OUT_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CALLBACK_TIMED_OUT_DETAILS.members["Error"], self.error - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["error"] = EventError.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CALLBACK_TIMED_OUT_DETAILS, consumer=_consumer) - if "error" not in kwargs: - kwargs["error"] = EventError._smithy_default() - return kwargs - - -@dataclass(kw_only=True) -class ChainedInvokeFailedDetails: - """ - Contains details about a failed chained function invocation, including - error information and failure reason. - """ - - error: EventError - """Details about the chained invocation failure.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CHAINED_INVOKE_FAILED_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CHAINED_INVOKE_FAILED_DETAILS.members["Error"], self.error - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["error"] = EventError.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CHAINED_INVOKE_FAILED_DETAILS, consumer=_consumer - ) - if "error" not in kwargs: - kwargs["error"] = EventError._smithy_default() - return kwargs - - -@dataclass(kw_only=True) -class EventInput: - """Input information for an event.""" - - payload: str | None = field(repr=False, default=None) - """The input payload.""" - - truncated: bool | None = None - """Indicates if the error payload was truncated due to size limits.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVENT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.payload is not None: - serializer.write_string( - _SCHEMA_EVENT_INPUT.members["Payload"], self.payload - ) - - if self.truncated is not None: - serializer.write_boolean( - _SCHEMA_EVENT_INPUT.members["Truncated"], self.truncated - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["payload"] = de.read_string( - _SCHEMA_EVENT_INPUT.members["Payload"] - ) - - case 1: - kwargs["truncated"] = de.read_boolean( - _SCHEMA_EVENT_INPUT.members["Truncated"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EVENT_INPUT, consumer=_consumer) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls() - - -@dataclass(kw_only=True) -class ChainedInvokeStartedDetails: - """ - Contains details about a chained function invocation that has started - execution, including start time and execution context. - """ - - function_name: str - """The name or ARN of the Lambda function being invoked.""" - - tenant_id: str | None = None - """The tenant identifier for the chained invocation.""" - - input: EventInput | None = None - """The JSON input payload provided to the chained invocation.""" - - executed_version: str | None = None - """The version of the function that was executed.""" - - durable_execution_arn: str | None = None - """The Amazon Resource Name (ARN) that identifies the durable execution.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CHAINED_INVOKE_STARTED_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CHAINED_INVOKE_STARTED_DETAILS.members["FunctionName"], - self.function_name, - ) - if self.tenant_id is not None: - serializer.write_string( - _SCHEMA_CHAINED_INVOKE_STARTED_DETAILS.members["TenantId"], - self.tenant_id, - ) - - if self.input is not None: - serializer.write_struct( - _SCHEMA_CHAINED_INVOKE_STARTED_DETAILS.members["Input"], self.input - ) - - if self.executed_version is not None: - serializer.write_string( - _SCHEMA_CHAINED_INVOKE_STARTED_DETAILS.members["ExecutedVersion"], - self.executed_version, - ) - - if self.durable_execution_arn is not None: - serializer.write_string( - _SCHEMA_CHAINED_INVOKE_STARTED_DETAILS.members["DurableExecutionArn"], - self.durable_execution_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_CHAINED_INVOKE_STARTED_DETAILS.members["FunctionName"] - ) - - case 1: - kwargs["tenant_id"] = de.read_string( - _SCHEMA_CHAINED_INVOKE_STARTED_DETAILS.members["TenantId"] - ) - - case 2: - kwargs["input"] = EventInput.deserialize(de) - - case 3: - kwargs["executed_version"] = de.read_string( - _SCHEMA_CHAINED_INVOKE_STARTED_DETAILS.members[ - "ExecutedVersion" - ] - ) - - case 4: - kwargs["durable_execution_arn"] = de.read_string( - _SCHEMA_CHAINED_INVOKE_STARTED_DETAILS.members[ - "DurableExecutionArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CHAINED_INVOKE_STARTED_DETAILS, consumer=_consumer - ) - if "function_name" not in kwargs: - kwargs["function_name"] = "" - return kwargs - - -@dataclass(kw_only=True) -class ChainedInvokeStoppedDetails: - """Details about a chained invocation that was stopped.""" - - error: EventError - """Details about why the chained invocation stopped.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CHAINED_INVOKE_STOPPED_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CHAINED_INVOKE_STOPPED_DETAILS.members["Error"], self.error - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["error"] = EventError.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CHAINED_INVOKE_STOPPED_DETAILS, consumer=_consumer - ) - if "error" not in kwargs: - kwargs["error"] = EventError._smithy_default() - return kwargs - - -@dataclass(kw_only=True) -class ChainedInvokeSucceededDetails: - """Details about a chained invocation that succeeded.""" - - result: EventResult - """The response payload from the successful operation.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CHAINED_INVOKE_SUCCEEDED_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CHAINED_INVOKE_SUCCEEDED_DETAILS.members["Result"], self.result - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["result"] = EventResult.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CHAINED_INVOKE_SUCCEEDED_DETAILS, consumer=_consumer - ) - if "result" not in kwargs: - kwargs["result"] = EventResult._smithy_default() - return kwargs - - -@dataclass(kw_only=True) -class ChainedInvokeTimedOutDetails: - """Details about a chained invocation that timed out.""" - - error: EventError - """Details about the chained invocation timeout.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CHAINED_INVOKE_TIMED_OUT_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CHAINED_INVOKE_TIMED_OUT_DETAILS.members["Error"], self.error - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["error"] = EventError.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CHAINED_INVOKE_TIMED_OUT_DETAILS, consumer=_consumer - ) - if "error" not in kwargs: - kwargs["error"] = EventError._smithy_default() - return kwargs - - -@dataclass(kw_only=True) -class ContextFailedDetails: - """Details about a context that failed.""" - - error: EventError - """Details about the context failure.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTEXT_FAILED_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CONTEXT_FAILED_DETAILS.members["Error"], self.error - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["error"] = EventError.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONTEXT_FAILED_DETAILS, consumer=_consumer) - if "error" not in kwargs: - kwargs["error"] = EventError._smithy_default() - return kwargs - - -@dataclass(kw_only=True) -class ContextStartedDetails: - """Details about a context that has started.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTEXT_STARTED_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONTEXT_STARTED_DETAILS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ContextSucceededDetails: - """Details about a context that succeeded.""" - - result: EventResult - """The JSON response payload from the successful context.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTEXT_SUCCEEDED_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CONTEXT_SUCCEEDED_DETAILS.members["Result"], self.result - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["result"] = EventResult.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONTEXT_SUCCEEDED_DETAILS, consumer=_consumer) - if "result" not in kwargs: - kwargs["result"] = EventResult._smithy_default() - return kwargs - - -class EventType(UnknownEnumMixin, StrEnum): - EXECUTION_STARTED = "ExecutionStarted" - EXECUTION_SUCCEEDED = "ExecutionSucceeded" - EXECUTION_FAILED = "ExecutionFailed" - EXECUTION_TIMED_OUT = "ExecutionTimedOut" - EXECUTION_STOPPED = "ExecutionStopped" - CONTEXT_STARTED = "ContextStarted" - CONTEXT_SUCCEEDED = "ContextSucceeded" - CONTEXT_FAILED = "ContextFailed" - WAIT_STARTED = "WaitStarted" - WAIT_SUCCEEDED = "WaitSucceeded" - WAIT_CANCELLED = "WaitCancelled" - STEP_STARTED = "StepStarted" - STEP_SUCCEEDED = "StepSucceeded" - STEP_FAILED = "StepFailed" - CHAINED_INVOKE_STARTED = "ChainedInvokeStarted" - CHAINED_INVOKE_SUCCEEDED = "ChainedInvokeSucceeded" - CHAINED_INVOKE_FAILED = "ChainedInvokeFailed" - CHAINED_INVOKE_TIMED_OUT = "ChainedInvokeTimedOut" - CHAINED_INVOKE_STOPPED = "ChainedInvokeStopped" - CALLBACK_STARTED = "CallbackStarted" - CALLBACK_SUCCEEDED = "CallbackSucceeded" - CALLBACK_FAILED = "CallbackFailed" - CALLBACK_TIMED_OUT = "CallbackTimedOut" - INVOCATION_COMPLETED = "InvocationCompleted" - - -@dataclass(kw_only=True) -class ExecutionFailedDetails: - """ - Details about a failed [durable - execution](https://docs.aws.amazon.com/lambda/latest/dg/durable-functions.html). - """ - - error: EventError - """Details about the execution failure.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EXECUTION_FAILED_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_EXECUTION_FAILED_DETAILS.members["Error"], self.error - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["error"] = EventError.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EXECUTION_FAILED_DETAILS, consumer=_consumer) - if "error" not in kwargs: - kwargs["error"] = EventError._smithy_default() - return kwargs - - -@dataclass(kw_only=True) -class ExecutionStartedDetails: - """Details about a durable execution that started.""" - - input: EventInput - """The input payload provided for the durable execution.""" - - execution_timeout: int - """ - The maximum amount of time that the durable execution is allowed to run, - in seconds. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EXECUTION_STARTED_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_EXECUTION_STARTED_DETAILS.members["Input"], self.input - ) - serializer.write_integer( - _SCHEMA_EXECUTION_STARTED_DETAILS.members["ExecutionTimeout"], - self.execution_timeout, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["input"] = EventInput.deserialize(de) - - case 1: - kwargs["execution_timeout"] = de.read_integer( - _SCHEMA_EXECUTION_STARTED_DETAILS.members["ExecutionTimeout"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EXECUTION_STARTED_DETAILS, consumer=_consumer) - if "input" not in kwargs: - kwargs["input"] = EventInput._smithy_default() - if "execution_timeout" not in kwargs: - kwargs["execution_timeout"] = 0 - return kwargs - - -@dataclass(kw_only=True) -class ExecutionStoppedDetails: - """ - Details about a [durable - execution](https://docs.aws.amazon.com/lambda/latest/dg/durable-functions.html) - that stopped. - """ - - error: EventError - """Details about why the execution stopped.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EXECUTION_STOPPED_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_EXECUTION_STOPPED_DETAILS.members["Error"], self.error - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["error"] = EventError.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EXECUTION_STOPPED_DETAILS, consumer=_consumer) - if "error" not in kwargs: - kwargs["error"] = EventError._smithy_default() - return kwargs - - -@dataclass(kw_only=True) -class ExecutionSucceededDetails: - """ - Details about a [durable - execution](https://docs.aws.amazon.com/lambda/latest/dg/durable-functions.html) - that succeeded. - """ - - result: EventResult - """The response payload from the successful operation.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EXECUTION_SUCCEEDED_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_EXECUTION_SUCCEEDED_DETAILS.members["Result"], self.result - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["result"] = EventResult.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EXECUTION_SUCCEEDED_DETAILS, consumer=_consumer - ) - if "result" not in kwargs: - kwargs["result"] = EventResult._smithy_default() - return kwargs - - -@dataclass(kw_only=True) -class ExecutionTimedOutDetails: - """ - Details about a [durable - execution](https://docs.aws.amazon.com/lambda/latest/dg/durable-functions.html) - that timed out. - """ - - error: EventError | None = None - """Details about the execution timeout.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EXECUTION_TIMED_OUT_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.error is not None: - serializer.write_struct( - _SCHEMA_EXECUTION_TIMED_OUT_DETAILS.members["Error"], self.error - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["error"] = EventError.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EXECUTION_TIMED_OUT_DETAILS, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InvocationCompletedDetails: - """Details about a function invocation that completed.""" - - start_timestamp: datetime - """ - The date and time when the invocation started, in [ISO-8601 - format](https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). - """ - - end_timestamp: datetime - """ - The date and time when the invocation ended, in [ISO-8601 - format](https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). - """ - - request_id: str - """The request ID for the invocation.""" - - error: EventError | None = None - """Details about the invocation failure.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOCATION_COMPLETED_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_timestamp( - _SCHEMA_INVOCATION_COMPLETED_DETAILS.members["StartTimestamp"], - self.start_timestamp, - ) - serializer.write_timestamp( - _SCHEMA_INVOCATION_COMPLETED_DETAILS.members["EndTimestamp"], - self.end_timestamp, - ) - serializer.write_string( - _SCHEMA_INVOCATION_COMPLETED_DETAILS.members["RequestId"], self.request_id - ) - if self.error is not None: - serializer.write_struct( - _SCHEMA_INVOCATION_COMPLETED_DETAILS.members["Error"], self.error - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["start_timestamp"] = de.read_timestamp( - _SCHEMA_INVOCATION_COMPLETED_DETAILS.members["StartTimestamp"] - ) - - case 1: - kwargs["end_timestamp"] = de.read_timestamp( - _SCHEMA_INVOCATION_COMPLETED_DETAILS.members["EndTimestamp"] - ) - - case 2: - kwargs["request_id"] = de.read_string( - _SCHEMA_INVOCATION_COMPLETED_DETAILS.members["RequestId"] - ) - - case 3: - kwargs["error"] = EventError.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVOCATION_COMPLETED_DETAILS, consumer=_consumer - ) - if "start_timestamp" not in kwargs: - kwargs["start_timestamp"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "end_timestamp" not in kwargs: - kwargs["end_timestamp"] = datetime.fromtimestamp(0, tz=timezone.utc) - if "request_id" not in kwargs: - kwargs["request_id"] = "" - return kwargs - - -@dataclass(kw_only=True) -class RetryDetails: - """Information about retry attempts for an operation.""" - - current_attempt: int = 0 - """The current attempt number for this operation.""" - - next_attempt_delay_seconds: int | None = None - """The delay before the next retry attempt, in seconds.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRY_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer( - _SCHEMA_RETRY_DETAILS.members["CurrentAttempt"], self.current_attempt - ) - if self.next_attempt_delay_seconds is not None: - serializer.write_integer( - _SCHEMA_RETRY_DETAILS.members["NextAttemptDelaySeconds"], - self.next_attempt_delay_seconds, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["current_attempt"] = de.read_integer( - _SCHEMA_RETRY_DETAILS.members["CurrentAttempt"] - ) - - case 1: - kwargs["next_attempt_delay_seconds"] = de.read_integer( - _SCHEMA_RETRY_DETAILS.members["NextAttemptDelaySeconds"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RETRY_DETAILS, consumer=_consumer) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls() - - -@dataclass(kw_only=True) -class StepFailedDetails: - """Details about a step that failed.""" - - error: EventError - """Details about the step failure.""" - - retry_details: RetryDetails - """Information about retry attempts for this step operation.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STEP_FAILED_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_STEP_FAILED_DETAILS.members["Error"], self.error - ) - serializer.write_struct( - _SCHEMA_STEP_FAILED_DETAILS.members["RetryDetails"], self.retry_details - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["error"] = EventError.deserialize(de) - - case 1: - kwargs["retry_details"] = RetryDetails.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_STEP_FAILED_DETAILS, consumer=_consumer) - if "error" not in kwargs: - kwargs["error"] = EventError._smithy_default() - if "retry_details" not in kwargs: - kwargs["retry_details"] = RetryDetails._smithy_default() - return kwargs - - -@dataclass(kw_only=True) -class StepStartedDetails: - """Details about a step that has started.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STEP_STARTED_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_STEP_STARTED_DETAILS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class StepSucceededDetails: - """Details about a step that succeeded.""" - - result: EventResult - """The response payload from the successful operation.""" - - retry_details: RetryDetails - """Information about retry attempts for this step operation.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STEP_SUCCEEDED_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_STEP_SUCCEEDED_DETAILS.members["Result"], self.result - ) - serializer.write_struct( - _SCHEMA_STEP_SUCCEEDED_DETAILS.members["RetryDetails"], self.retry_details - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["result"] = EventResult.deserialize(de) - - case 1: - kwargs["retry_details"] = RetryDetails.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_STEP_SUCCEEDED_DETAILS, consumer=_consumer) - if "result" not in kwargs: - kwargs["result"] = EventResult._smithy_default() - if "retry_details" not in kwargs: - kwargs["retry_details"] = RetryDetails._smithy_default() - return kwargs - - -@dataclass(kw_only=True) -class WaitCancelledDetails: - """Details about a wait operation that was cancelled.""" - - error: EventError | None = None - """Details about why the wait operation was cancelled.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_WAIT_CANCELLED_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.error is not None: - serializer.write_struct( - _SCHEMA_WAIT_CANCELLED_DETAILS.members["Error"], self.error - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["error"] = EventError.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_WAIT_CANCELLED_DETAILS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class WaitStartedDetails: - """Details about a wait operation that has started.""" - - duration: int - """The duration to wait, in seconds.""" - - scheduled_end_timestamp: datetime - """ - The date and time when the wait operation is scheduled to complete, in - [ISO-8601 format](https://www.w3.org/TR/NOTE-datetime) - (YYYY-MM-DDThh:mm:ss.sTZD). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_WAIT_STARTED_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer( - _SCHEMA_WAIT_STARTED_DETAILS.members["Duration"], self.duration - ) - serializer.write_timestamp( - _SCHEMA_WAIT_STARTED_DETAILS.members["ScheduledEndTimestamp"], - self.scheduled_end_timestamp, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["duration"] = de.read_integer( - _SCHEMA_WAIT_STARTED_DETAILS.members["Duration"] - ) - - case 1: - kwargs["scheduled_end_timestamp"] = de.read_timestamp( - _SCHEMA_WAIT_STARTED_DETAILS.members["ScheduledEndTimestamp"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_WAIT_STARTED_DETAILS, consumer=_consumer) - if "duration" not in kwargs: - kwargs["duration"] = 0 - if "scheduled_end_timestamp" not in kwargs: - kwargs["scheduled_end_timestamp"] = datetime.fromtimestamp( - 0, tz=timezone.utc - ) - return kwargs - - -@dataclass(kw_only=True) -class WaitSucceededDetails: - """Details about a wait operation that succeeded.""" - - duration: int | None = None - """The wait duration, in seconds.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_WAIT_SUCCEEDED_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.duration is not None: - serializer.write_integer( - _SCHEMA_WAIT_SUCCEEDED_DETAILS.members["Duration"], self.duration - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["duration"] = de.read_integer( - _SCHEMA_WAIT_SUCCEEDED_DETAILS.members["Duration"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_WAIT_SUCCEEDED_DETAILS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Event: - """An event that occurred during the execution of a durable function.""" - - event_type: str | None = None - """The type of event that occurred.""" - - sub_type: str | None = None - """The subtype of the event, providing additional categorization.""" - - event_id: int = 1 - """The unique identifier for this event. Event IDs increment sequentially.""" - - id: str | None = None - """The unique identifier for this operation.""" - - name: str | None = None - """The customer-provided name for this operation.""" - - event_timestamp: datetime | None = None - """ - The date and time when this event occurred, in [ISO-8601 - format](https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). - """ - - parent_id: str | None = None - """ - The unique identifier of the parent operation, if this operation is - running within a child context. - """ - - execution_started_details: ExecutionStartedDetails | None = None - """Details about an execution that started.""" - - execution_succeeded_details: ExecutionSucceededDetails | None = None - """Details about an execution that succeeded.""" - - execution_failed_details: ExecutionFailedDetails | None = None - """Details about an execution that failed.""" - - execution_timed_out_details: ExecutionTimedOutDetails | None = None - """Details about an execution that timed out.""" - - execution_stopped_details: ExecutionStoppedDetails | None = None - """Details about an execution that was stopped.""" - - context_started_details: ContextStartedDetails | None = None - """Details about a context that started.""" - - context_succeeded_details: ContextSucceededDetails | None = None - """Details about a context that succeeded.""" - - context_failed_details: ContextFailedDetails | None = None - """Details about a context that failed.""" - - wait_started_details: WaitStartedDetails | None = None - """Details about a wait operation that started.""" - - wait_succeeded_details: WaitSucceededDetails | None = None - """Details about a wait operation that succeeded.""" - - wait_cancelled_details: WaitCancelledDetails | None = None - """Details about a wait operation that was cancelled.""" - - step_started_details: StepStartedDetails | None = None - """Details about a step that started.""" - - step_succeeded_details: StepSucceededDetails | None = None - """Details about a step that succeeded.""" - - step_failed_details: StepFailedDetails | None = None - """Details about a step that failed.""" - - chained_invoke_started_details: ChainedInvokeStartedDetails | None = None - """ - Contains details about a chained function invocation that has started - execution, including start time and execution context. - """ - - chained_invoke_succeeded_details: ChainedInvokeSucceededDetails | None = None - """Details about a chained invocation that succeeded.""" - - chained_invoke_failed_details: ChainedInvokeFailedDetails | None = None - """ - Contains details about a failed chained function invocation, including - error information and failure reason. - """ - - chained_invoke_timed_out_details: ChainedInvokeTimedOutDetails | None = None - """Details about a chained invocation that timed out.""" - - chained_invoke_stopped_details: ChainedInvokeStoppedDetails | None = None - """Details about a chained invocation that was stopped.""" - - callback_started_details: CallbackStartedDetails | None = None - """ - Contains details about a callback operation that has started, including - timing information and callback metadata. - """ - - callback_succeeded_details: CallbackSucceededDetails | None = None - """ - Contains details about a successfully completed callback operation, - including the result data and completion timestamp. - """ - - callback_failed_details: CallbackFailedDetails | None = None - """ - Contains details about a failed callback operation, including error - information and the reason for failure. - """ - - callback_timed_out_details: CallbackTimedOutDetails | None = None - """ - Contains details about a callback operation that timed out, including - timeout duration and any partial results. - """ - - invocation_completed_details: InvocationCompletedDetails | None = None - """Details about a function invocation that completed.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.event_type is not None: - serializer.write_string(_SCHEMA_EVENT.members["EventType"], self.event_type) - - if self.sub_type is not None: - serializer.write_string(_SCHEMA_EVENT.members["SubType"], self.sub_type) - - serializer.write_integer(_SCHEMA_EVENT.members["EventId"], self.event_id) - if self.id is not None: - serializer.write_string(_SCHEMA_EVENT.members["Id"], self.id) - - if self.name is not None: - serializer.write_string(_SCHEMA_EVENT.members["Name"], self.name) - - if self.event_timestamp is not None: - serializer.write_timestamp( - _SCHEMA_EVENT.members["EventTimestamp"], self.event_timestamp - ) - - if self.parent_id is not None: - serializer.write_string(_SCHEMA_EVENT.members["ParentId"], self.parent_id) - - if self.execution_started_details is not None: - serializer.write_struct( - _SCHEMA_EVENT.members["ExecutionStartedDetails"], - self.execution_started_details, - ) - - if self.execution_succeeded_details is not None: - serializer.write_struct( - _SCHEMA_EVENT.members["ExecutionSucceededDetails"], - self.execution_succeeded_details, - ) - - if self.execution_failed_details is not None: - serializer.write_struct( - _SCHEMA_EVENT.members["ExecutionFailedDetails"], - self.execution_failed_details, - ) - - if self.execution_timed_out_details is not None: - serializer.write_struct( - _SCHEMA_EVENT.members["ExecutionTimedOutDetails"], - self.execution_timed_out_details, - ) - - if self.execution_stopped_details is not None: - serializer.write_struct( - _SCHEMA_EVENT.members["ExecutionStoppedDetails"], - self.execution_stopped_details, - ) - - if self.context_started_details is not None: - serializer.write_struct( - _SCHEMA_EVENT.members["ContextStartedDetails"], - self.context_started_details, - ) - - if self.context_succeeded_details is not None: - serializer.write_struct( - _SCHEMA_EVENT.members["ContextSucceededDetails"], - self.context_succeeded_details, - ) - - if self.context_failed_details is not None: - serializer.write_struct( - _SCHEMA_EVENT.members["ContextFailedDetails"], - self.context_failed_details, - ) - - if self.wait_started_details is not None: - serializer.write_struct( - _SCHEMA_EVENT.members["WaitStartedDetails"], self.wait_started_details - ) - - if self.wait_succeeded_details is not None: - serializer.write_struct( - _SCHEMA_EVENT.members["WaitSucceededDetails"], - self.wait_succeeded_details, - ) - - if self.wait_cancelled_details is not None: - serializer.write_struct( - _SCHEMA_EVENT.members["WaitCancelledDetails"], - self.wait_cancelled_details, - ) - - if self.step_started_details is not None: - serializer.write_struct( - _SCHEMA_EVENT.members["StepStartedDetails"], self.step_started_details - ) - - if self.step_succeeded_details is not None: - serializer.write_struct( - _SCHEMA_EVENT.members["StepSucceededDetails"], - self.step_succeeded_details, - ) - - if self.step_failed_details is not None: - serializer.write_struct( - _SCHEMA_EVENT.members["StepFailedDetails"], self.step_failed_details - ) - - if self.chained_invoke_started_details is not None: - serializer.write_struct( - _SCHEMA_EVENT.members["ChainedInvokeStartedDetails"], - self.chained_invoke_started_details, - ) - - if self.chained_invoke_succeeded_details is not None: - serializer.write_struct( - _SCHEMA_EVENT.members["ChainedInvokeSucceededDetails"], - self.chained_invoke_succeeded_details, - ) - - if self.chained_invoke_failed_details is not None: - serializer.write_struct( - _SCHEMA_EVENT.members["ChainedInvokeFailedDetails"], - self.chained_invoke_failed_details, - ) - - if self.chained_invoke_timed_out_details is not None: - serializer.write_struct( - _SCHEMA_EVENT.members["ChainedInvokeTimedOutDetails"], - self.chained_invoke_timed_out_details, - ) - - if self.chained_invoke_stopped_details is not None: - serializer.write_struct( - _SCHEMA_EVENT.members["ChainedInvokeStoppedDetails"], - self.chained_invoke_stopped_details, - ) - - if self.callback_started_details is not None: - serializer.write_struct( - _SCHEMA_EVENT.members["CallbackStartedDetails"], - self.callback_started_details, - ) - - if self.callback_succeeded_details is not None: - serializer.write_struct( - _SCHEMA_EVENT.members["CallbackSucceededDetails"], - self.callback_succeeded_details, - ) - - if self.callback_failed_details is not None: - serializer.write_struct( - _SCHEMA_EVENT.members["CallbackFailedDetails"], - self.callback_failed_details, - ) - - if self.callback_timed_out_details is not None: - serializer.write_struct( - _SCHEMA_EVENT.members["CallbackTimedOutDetails"], - self.callback_timed_out_details, - ) - - if self.invocation_completed_details is not None: - serializer.write_struct( - _SCHEMA_EVENT.members["InvocationCompletedDetails"], - self.invocation_completed_details, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["event_type"] = EventType( - de.read_string(_SCHEMA_EVENT.members["EventType"]) - ) - - case 1: - kwargs["sub_type"] = de.read_string( - _SCHEMA_EVENT.members["SubType"] - ) - - case 2: - kwargs["event_id"] = de.read_integer( - _SCHEMA_EVENT.members["EventId"] - ) - - case 3: - kwargs["id"] = de.read_string(_SCHEMA_EVENT.members["Id"]) - - case 4: - kwargs["name"] = de.read_string(_SCHEMA_EVENT.members["Name"]) - - case 5: - kwargs["event_timestamp"] = de.read_timestamp( - _SCHEMA_EVENT.members["EventTimestamp"] - ) - - case 6: - kwargs["parent_id"] = de.read_string( - _SCHEMA_EVENT.members["ParentId"] - ) - - case 7: - kwargs["execution_started_details"] = ( - ExecutionStartedDetails.deserialize(de) - ) - - case 8: - kwargs["execution_succeeded_details"] = ( - ExecutionSucceededDetails.deserialize(de) - ) - - case 9: - kwargs["execution_failed_details"] = ( - ExecutionFailedDetails.deserialize(de) - ) - - case 10: - kwargs["execution_timed_out_details"] = ( - ExecutionTimedOutDetails.deserialize(de) - ) - - case 11: - kwargs["execution_stopped_details"] = ( - ExecutionStoppedDetails.deserialize(de) - ) - - case 12: - kwargs["context_started_details"] = ( - ContextStartedDetails.deserialize(de) - ) - - case 13: - kwargs["context_succeeded_details"] = ( - ContextSucceededDetails.deserialize(de) - ) - - case 14: - kwargs["context_failed_details"] = ContextFailedDetails.deserialize( - de - ) - - case 15: - kwargs["wait_started_details"] = WaitStartedDetails.deserialize(de) - - case 16: - kwargs["wait_succeeded_details"] = WaitSucceededDetails.deserialize( - de - ) - - case 17: - kwargs["wait_cancelled_details"] = WaitCancelledDetails.deserialize( - de - ) - - case 18: - kwargs["step_started_details"] = StepStartedDetails.deserialize(de) - - case 19: - kwargs["step_succeeded_details"] = StepSucceededDetails.deserialize( - de - ) - - case 20: - kwargs["step_failed_details"] = StepFailedDetails.deserialize(de) - - case 21: - kwargs["chained_invoke_started_details"] = ( - ChainedInvokeStartedDetails.deserialize(de) - ) - - case 22: - kwargs["chained_invoke_succeeded_details"] = ( - ChainedInvokeSucceededDetails.deserialize(de) - ) - - case 23: - kwargs["chained_invoke_failed_details"] = ( - ChainedInvokeFailedDetails.deserialize(de) - ) - - case 24: - kwargs["chained_invoke_timed_out_details"] = ( - ChainedInvokeTimedOutDetails.deserialize(de) - ) - - case 25: - kwargs["chained_invoke_stopped_details"] = ( - ChainedInvokeStoppedDetails.deserialize(de) - ) - - case 26: - kwargs["callback_started_details"] = ( - CallbackStartedDetails.deserialize(de) - ) - - case 27: - kwargs["callback_succeeded_details"] = ( - CallbackSucceededDetails.deserialize(de) - ) - - case 28: - kwargs["callback_failed_details"] = ( - CallbackFailedDetails.deserialize(de) - ) - - case 29: - kwargs["callback_timed_out_details"] = ( - CallbackTimedOutDetails.deserialize(de) - ) - - case 30: - kwargs["invocation_completed_details"] = ( - InvocationCompletedDetails.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EVENT, consumer=_consumer) - return kwargs - - -def _serialize_events( - serializer: ShapeSerializer, schema: Schema, value: list[Event] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_events(deserializer: ShapeDeserializer, schema: Schema) -> list[Event]: - result: list[Event] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Event.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GetDurableExecutionHistoryOutput: - """ - The response from the GetDurableExecutionHistory operation, containing - the execution history and events. - """ - - events: list[Event] - """ - An array of execution history events, ordered chronologically unless - `ReverseOrder` is set to `true`. Each event represents a significant - occurrence during the execution, such as step completion or callback - resolution. - """ - - next_marker: str | None = None - """ - If present, indicates that more history events are available. Use this - value as the `Marker` parameter in a subsequent request to retrieve the - next page of results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DURABLE_EXECUTION_HISTORY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_events( - serializer, - _SCHEMA_GET_DURABLE_EXECUTION_HISTORY_OUTPUT.members["Events"], - self.events, - ) - if self.next_marker is not None: - serializer.write_string( - _SCHEMA_GET_DURABLE_EXECUTION_HISTORY_OUTPUT.members["NextMarker"], - self.next_marker, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["events"] = _deserialize_events( - de, - _SCHEMA_GET_DURABLE_EXECUTION_HISTORY_OUTPUT.members["Events"], - ) - - case 1: - kwargs["next_marker"] = de.read_string( - _SCHEMA_GET_DURABLE_EXECUTION_HISTORY_OUTPUT.members[ - "NextMarker" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_DURABLE_EXECUTION_HISTORY_OUTPUT, consumer=_consumer - ) - if "events" not in kwargs: - kwargs["events"] = [] - return kwargs - - -GET_DURABLE_EXECUTION_HISTORY = APIOperation( - input=GetDurableExecutionHistoryInput, - output=GetDurableExecutionHistoryOutput, - schema=_SCHEMA_GET_DURABLE_EXECUTION_HISTORY, - input_schema=_SCHEMA_GET_DURABLE_EXECUTION_HISTORY_INPUT, - output_schema=_SCHEMA_GET_DURABLE_EXECUTION_HISTORY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#KMSAccessDeniedException" - ): KMSAccessDeniedException, - ShapeID("com.amazonaws.lambda#KMSDisabledException"): KMSDisabledException, - ShapeID( - "com.amazonaws.lambda#KMSInvalidStateException" - ): KMSInvalidStateException, - ShapeID("com.amazonaws.lambda#KMSNotFoundException"): KMSNotFoundException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_KMS_ACCESS_DENIED_EXCEPTION, - _SCHEMA_KMS_DISABLED_EXCEPTION, - _SCHEMA_KMS_INVALID_STATE_EXCEPTION, - _SCHEMA_KMS_NOT_FOUND_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetDurableExecutionStateInput: - """Dataclass for GetDurableExecutionStateInput structure.""" - - durable_execution_arn: str | None = None - """The Amazon Resource Name (ARN) of the durable execution.""" - - checkpoint_token: str | None = None - """ - A checkpoint token that identifies the current state of the execution. - This token is provided by the Lambda runtime and ensures that state - retrieval is consistent with the current execution context. - """ - - marker: str | None = None - """ - If `NextMarker` was returned from a previous request, use this value to - retrieve the next page of operations. Each pagination token expires - after 24 hours. - """ - - max_items: int = 0 - """ - The maximum number of operations to return per call. You can use - `Marker` to retrieve additional pages of results. The default is 100 and - the maximum allowed is 1000. A value of 0 uses the default. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DURABLE_EXECUTION_STATE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.durable_execution_arn is not None: - serializer.write_string( - _SCHEMA_GET_DURABLE_EXECUTION_STATE_INPUT.members[ - "DurableExecutionArn" - ], - self.durable_execution_arn, - ) - - if self.checkpoint_token is not None: - serializer.write_string( - _SCHEMA_GET_DURABLE_EXECUTION_STATE_INPUT.members["CheckpointToken"], - self.checkpoint_token, - ) - - if self.marker is not None: - serializer.write_string( - _SCHEMA_GET_DURABLE_EXECUTION_STATE_INPUT.members["Marker"], self.marker - ) - - if self.max_items is not None: - serializer.write_integer( - _SCHEMA_GET_DURABLE_EXECUTION_STATE_INPUT.members["MaxItems"], - self.max_items, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["durable_execution_arn"] = de.read_string( - _SCHEMA_GET_DURABLE_EXECUTION_STATE_INPUT.members[ - "DurableExecutionArn" - ] - ) - - case 1: - kwargs["checkpoint_token"] = de.read_string( - _SCHEMA_GET_DURABLE_EXECUTION_STATE_INPUT.members[ - "CheckpointToken" - ] - ) - - case 2: - kwargs["marker"] = de.read_string( - _SCHEMA_GET_DURABLE_EXECUTION_STATE_INPUT.members["Marker"] - ) - - case 3: - kwargs["max_items"] = de.read_integer( - _SCHEMA_GET_DURABLE_EXECUTION_STATE_INPUT.members["MaxItems"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_DURABLE_EXECUTION_STATE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetDurableExecutionStateOutput: - """ - The response from the GetDurableExecutionState operation, containing the - current execution state for replay. - """ - - operations: list[Operation] - """ - An array of operations that represent the current state of the durable - execution. Operations are ordered by their start sequence number in - ascending order and include information needed for replay processing. - """ - - next_marker: str | None = None - """ - If present, indicates that more operations are available. Use this value - as the `Marker` parameter in a subsequent request to retrieve the next - page of results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DURABLE_EXECUTION_STATE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_operations( - serializer, - _SCHEMA_GET_DURABLE_EXECUTION_STATE_OUTPUT.members["Operations"], - self.operations, - ) - if self.next_marker is not None: - serializer.write_string( - _SCHEMA_GET_DURABLE_EXECUTION_STATE_OUTPUT.members["NextMarker"], - self.next_marker, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["operations"] = _deserialize_operations( - de, - _SCHEMA_GET_DURABLE_EXECUTION_STATE_OUTPUT.members[ - "Operations" - ], - ) - - case 1: - kwargs["next_marker"] = de.read_string( - _SCHEMA_GET_DURABLE_EXECUTION_STATE_OUTPUT.members["NextMarker"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_DURABLE_EXECUTION_STATE_OUTPUT, consumer=_consumer - ) - if "operations" not in kwargs: - kwargs["operations"] = [] - return kwargs - - -GET_DURABLE_EXECUTION_STATE = APIOperation( - input=GetDurableExecutionStateInput, - output=GetDurableExecutionStateOutput, - schema=_SCHEMA_GET_DURABLE_EXECUTION_STATE, - input_schema=_SCHEMA_GET_DURABLE_EXECUTION_STATE_INPUT, - output_schema=_SCHEMA_GET_DURABLE_EXECUTION_STATE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#KMSAccessDeniedException" - ): KMSAccessDeniedException, - ShapeID("com.amazonaws.lambda#KMSDisabledException"): KMSDisabledException, - ShapeID( - "com.amazonaws.lambda#KMSInvalidStateException" - ): KMSInvalidStateException, - ShapeID("com.amazonaws.lambda#KMSNotFoundException"): KMSNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_KMS_ACCESS_DENIED_EXCEPTION, - _SCHEMA_KMS_DISABLED_EXCEPTION, - _SCHEMA_KMS_INVALID_STATE_EXCEPTION, - _SCHEMA_KMS_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class StopDurableExecutionInput: - """Dataclass for StopDurableExecutionInput structure.""" - - durable_execution_arn: str | None = None - """The Amazon Resource Name (ARN) of the durable execution.""" - - error: ErrorObject | None = None - """Optional error details explaining why the execution is being stopped.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STOP_DURABLE_EXECUTION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.durable_execution_arn is not None: - serializer.write_string( - _SCHEMA_STOP_DURABLE_EXECUTION_INPUT.members["DurableExecutionArn"], - self.durable_execution_arn, - ) - - if self.error is not None: - serializer.write_struct( - _SCHEMA_STOP_DURABLE_EXECUTION_INPUT.members["Error"], self.error - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["durable_execution_arn"] = de.read_string( - _SCHEMA_STOP_DURABLE_EXECUTION_INPUT.members[ - "DurableExecutionArn" - ] - ) - - case 1: - kwargs["error"] = ErrorObject.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_STOP_DURABLE_EXECUTION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class StopDurableExecutionOutput: - """Dataclass for StopDurableExecutionOutput structure.""" - - stop_timestamp: datetime - """The timestamp when the execution was stopped (ISO 8601 format).""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STOP_DURABLE_EXECUTION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_timestamp( - _SCHEMA_STOP_DURABLE_EXECUTION_OUTPUT.members["StopTimestamp"], - self.stop_timestamp, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["stop_timestamp"] = de.read_timestamp( - _SCHEMA_STOP_DURABLE_EXECUTION_OUTPUT.members["StopTimestamp"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_STOP_DURABLE_EXECUTION_OUTPUT, consumer=_consumer - ) - if "stop_timestamp" not in kwargs: - kwargs["stop_timestamp"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -STOP_DURABLE_EXECUTION = APIOperation( - input=StopDurableExecutionInput, - output=StopDurableExecutionOutput, - schema=_SCHEMA_STOP_DURABLE_EXECUTION, - input_schema=_SCHEMA_STOP_DURABLE_EXECUTION_INPUT, - output_schema=_SCHEMA_STOP_DURABLE_EXECUTION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#KMSAccessDeniedException" - ): KMSAccessDeniedException, - ShapeID("com.amazonaws.lambda#KMSDisabledException"): KMSDisabledException, - ShapeID( - "com.amazonaws.lambda#KMSInvalidStateException" - ): KMSInvalidStateException, - ShapeID("com.amazonaws.lambda#KMSNotFoundException"): KMSNotFoundException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_KMS_ACCESS_DENIED_EXCEPTION, - _SCHEMA_KMS_DISABLED_EXCEPTION, - _SCHEMA_KMS_INVALID_STATE_EXCEPTION, - _SCHEMA_KMS_NOT_FOUND_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class OnFailure: - """ - A destination for events that failed processing. For more information, - see [Adding a - destination](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async-retain-records.html#invocation-async-destinations). - """ - - destination: str | None = None - """ - The Amazon Resource Name (ARN) of the destination resource. - - To retain records of failed invocations from - [Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html), - [DynamoDB](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html), - [self-managed Apache - Kafka](https://docs.aws.amazon.com/lambda/latest/dg/kafka-on-failure.html), - or [Amazon - MSK](https://docs.aws.amazon.com/lambda/latest/dg/kafka-on-failure.html), - you can configure an Amazon SNS topic, Amazon SQS queue, Amazon S3 - bucket, or Kafka topic as the destination. - - Note: - Amazon SNS destinations have a message size limit of 256 KB. If the - combined size of the function request and response payload exceeds the - limit, Lambda will drop the payload when sending `OnFailure` event to - the destination. For details on this behavior, refer to [Retaining - records of asynchronous - invocations](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async-retain-records.html). - - To retain records of failed invocations from - [Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html), - [DynamoDB](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html), - [self-managed - Kafka](https://docs.aws.amazon.com/lambda/latest/dg/with-kafka.html#services-smaa-onfailure-destination) - or [Amazon - MSK](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#services-msk-onfailure-destination), - you can configure an Amazon SNS topic, Amazon SQS queue, or Amazon S3 - bucket as the destination. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ON_FAILURE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.destination is not None: - serializer.write_string( - _SCHEMA_ON_FAILURE.members["Destination"], self.destination - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["destination"] = de.read_string( - _SCHEMA_ON_FAILURE.members["Destination"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ON_FAILURE, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class OnSuccess: - """ - A destination for events that were processed successfully. - - To retain records of successful [asynchronous - invocations](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-async-destinations), - you can configure an Amazon SNS topic, Amazon SQS queue, Lambda - function, or Amazon EventBridge event bus as the destination. - - Note: - `OnSuccess` is not supported in `CreateEventSourceMapping` or - `UpdateEventSourceMapping` requests. - """ - - destination: str | None = None - """ - The Amazon Resource Name (ARN) of the destination resource. - - Note: - Amazon SNS destinations have a message size limit of 256 KB. If the - combined size of the function request and response payload exceeds the - limit, Lambda will drop the payload when sending `OnFailure` event to - the destination. For details on this behavior, refer to [Retaining - records of asynchronous - invocations](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async-retain-records.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ON_SUCCESS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.destination is not None: - serializer.write_string( - _SCHEMA_ON_SUCCESS.members["Destination"], self.destination - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["destination"] = de.read_string( - _SCHEMA_ON_SUCCESS.members["Destination"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ON_SUCCESS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DestinationConfig: - """ - A configuration object that specifies the destination of an event after - Lambda processes it. For more information, see [Adding a - destination](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async-retain-records.html#invocation-async-destinations). - """ - - on_success: OnSuccess | None = None - """ - The destination configuration for successful invocations. Not supported - in `CreateEventSourceMapping` or `UpdateEventSourceMapping`. - """ - - on_failure: OnFailure | None = None - """The destination configuration for failed invocations.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DESTINATION_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.on_success is not None: - serializer.write_struct( - _SCHEMA_DESTINATION_CONFIG.members["OnSuccess"], self.on_success - ) - - if self.on_failure is not None: - serializer.write_struct( - _SCHEMA_DESTINATION_CONFIG.members["OnFailure"], self.on_failure - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["on_success"] = OnSuccess.deserialize(de) - - case 1: - kwargs["on_failure"] = OnFailure.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DESTINATION_CONFIG, consumer=_consumer) - return kwargs - - -class FullDocument(UnknownEnumMixin, StrEnum): - UPDATE_LOOKUP = "UpdateLookup" - DEFAULT = "Default" - - -@dataclass(kw_only=True) -class DocumentDBEventSourceConfig: - """Specific configuration settings for a DocumentDB event source.""" - - database_name: str | None = None - """The name of the database to consume within the DocumentDB cluster.""" - - collection_name: str | None = None - """ - The name of the collection to consume within the database. If you do not - specify a collection, Lambda consumes all collections. - """ - - full_document: str | None = None - """ - Determines what DocumentDB sends to your event stream during document - update operations. If set to UpdateLookup, DocumentDB sends a delta - describing the changes, along with a copy of the entire document. - Otherwise, DocumentDB sends only a partial document that contains the - changes. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_DB_EVENT_SOURCE_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.database_name is not None: - serializer.write_string( - _SCHEMA_DOCUMENT_DB_EVENT_SOURCE_CONFIG.members["DatabaseName"], - self.database_name, - ) - - if self.collection_name is not None: - serializer.write_string( - _SCHEMA_DOCUMENT_DB_EVENT_SOURCE_CONFIG.members["CollectionName"], - self.collection_name, - ) - - if self.full_document is not None: - serializer.write_string( - _SCHEMA_DOCUMENT_DB_EVENT_SOURCE_CONFIG.members["FullDocument"], - self.full_document, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["database_name"] = de.read_string( - _SCHEMA_DOCUMENT_DB_EVENT_SOURCE_CONFIG.members["DatabaseName"] - ) - - case 1: - kwargs["collection_name"] = de.read_string( - _SCHEMA_DOCUMENT_DB_EVENT_SOURCE_CONFIG.members[ - "CollectionName" - ] - ) - - case 2: - kwargs["full_document"] = FullDocument( - de.read_string( - _SCHEMA_DOCUMENT_DB_EVENT_SOURCE_CONFIG.members[ - "FullDocument" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DOCUMENT_DB_EVENT_SOURCE_CONFIG, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class Filter: - """ - A structure within a `FilterCriteria` object that defines an event - filtering pattern. - """ - - pattern: str | None = None - """ - A filter pattern. For more information on the syntax of a filter - pattern, see [Filter rule - syntax](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html#filtering-syntax). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.pattern is not None: - serializer.write_string(_SCHEMA_FILTER.members["Pattern"], self.pattern) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["pattern"] = de.read_string( - _SCHEMA_FILTER.members["Pattern"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FILTER, consumer=_consumer) - return kwargs - - -def _serialize_filter_list( - serializer: ShapeSerializer, schema: Schema, value: list[Filter] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_filter_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Filter]: - result: list[Filter] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Filter.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class FilterCriteria: - """An object that contains the filters for an event source.""" - - filters: list[Filter] | None = None - """A list of filters.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FILTER_CRITERIA, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.filters is not None: - _serialize_filter_list( - serializer, _SCHEMA_FILTER_CRITERIA.members["Filters"], self.filters - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["filters"] = _deserialize_filter_list( - de, _SCHEMA_FILTER_CRITERIA.members["Filters"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FILTER_CRITERIA, consumer=_consumer) - return kwargs - - -class FunctionResponseType(UnknownEnumMixin, StrEnum): - REPORT_BATCH_ITEM_FAILURES = "ReportBatchItemFailures" - - -def _serialize_function_response_type_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_function_response_type_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(FunctionResponseType(d.read_string(member_schema))) - - deserializer.read_list(schema, _read_value) - return result - - -class EventSourceMappingSystemLogLevel(UnknownEnumMixin, StrEnum): - DEBUG = "DEBUG" - INFO = "INFO" - WARN = "WARN" - - -@dataclass(kw_only=True) -class EventSourceMappingLoggingConfig: - """ - (Amazon MSK, and self-managed Apache Kafka only) The logging - configuration for your event source. Use this configuration object to - define the level of logs for your event source mapping. - """ - - system_log_level: str | None = None - """ - The log level you want your event source mapping to use. Lambda event - poller only sends system logs at the selected level of detail and lower, - where `DEBUG` is the highest level and `WARN` is the lowest. For more - information about these metrics, see [Event source mapping - logging](https://docs.aws.amazon.com/lambda/latest/dg/esm-logging.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVENT_SOURCE_MAPPING_LOGGING_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.system_log_level is not None: - serializer.write_string( - _SCHEMA_EVENT_SOURCE_MAPPING_LOGGING_CONFIG.members["SystemLogLevel"], - self.system_log_level, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["system_log_level"] = EventSourceMappingSystemLogLevel( - de.read_string( - _SCHEMA_EVENT_SOURCE_MAPPING_LOGGING_CONFIG.members[ - "SystemLogLevel" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EVENT_SOURCE_MAPPING_LOGGING_CONFIG, consumer=_consumer - ) - return kwargs - - -class EventSourceMappingMetric(UnknownEnumMixin, StrEnum): - EVENT_COUNT = "EventCount" - ERROR_COUNT = "ErrorCount" - KAFKA_METRICS = "KafkaMetrics" - - -def _serialize_event_source_mapping_metric_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_event_source_mapping_metric_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(EventSourceMappingMetric(d.read_string(member_schema))) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class EventSourceMappingMetricsConfig: - """ - The metrics configuration for your event source. Use this configuration - object to define which metrics you want your event source mapping to - produce. - """ - - metrics: list[str] | None = None - """ - The metrics you want your event source mapping to produce, including - `EventCount`, `ErrorCount`, `KafkaMetrics`. - - - `EventCount` to receive metrics related to the number of events - processed by your event source mapping. - - - `ErrorCount` (Amazon MSK and self-managed Apache Kafka) to receive - metrics related to the number of errors in your event source mapping - processing. - - - `KafkaMetrics` (Amazon MSK and self-managed Apache Kafka) to receive - metrics related to the Kafka consumers from your event source mapping. - - For more information about these metrics, see [Event source mapping - metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics-types.html#event-source-mapping-metrics). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVENT_SOURCE_MAPPING_METRICS_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.metrics is not None: - _serialize_event_source_mapping_metric_list( - serializer, - _SCHEMA_EVENT_SOURCE_MAPPING_METRICS_CONFIG.members["Metrics"], - self.metrics, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["metrics"] = _deserialize_event_source_mapping_metric_list( - de, - _SCHEMA_EVENT_SOURCE_MAPPING_METRICS_CONFIG.members["Metrics"], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EVENT_SOURCE_MAPPING_METRICS_CONFIG, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ProvisionedPollerConfig: - """ - The [provisioned - mode](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html#invocation-eventsourcemapping-provisioned-mode) - configuration for the event source. Use Provisioned Mode to customize - the minimum and maximum number of event pollers for your event source. - """ - - minimum_pollers: int | None = None - """ - The minimum number of event pollers this event source can scale down to. - For Amazon SQS events source mappings, default is 2, and minimum 2 - required. For Amazon MSK and self-managed Apache Kafka event source - mappings, default is 1. - """ - - maximum_pollers: int | None = None - """ - The maximum number of event pollers this event source can scale up to. - For Amazon SQS event source mappings, the accepted range is between 2 - and 10,000, with a default of 200. For Amazon MSK and self-managed - Apache Kafka event source mappings, the accepted range is between 1 and - 2,000, with a default of 200. - """ - - poller_group_name: str | None = None - """ - (Amazon MSK and self-managed Apache Kafka) The name of the provisioned - poller group. Use this option to group multiple ESMs within the event - source's VPC to share Event Poller Unit (EPU) capacity. You can use - this option to optimize Provisioned mode costs for your ESMs. You can - group up to 100 ESMs per poller group and aggregate maximum pollers - across all ESMs in a group cannot exceed 2000. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PROVISIONED_POLLER_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.minimum_pollers is not None: - serializer.write_integer( - _SCHEMA_PROVISIONED_POLLER_CONFIG.members["MinimumPollers"], - self.minimum_pollers, - ) - - if self.maximum_pollers is not None: - serializer.write_integer( - _SCHEMA_PROVISIONED_POLLER_CONFIG.members["MaximumPollers"], - self.maximum_pollers, - ) - - if self.poller_group_name is not None: - serializer.write_string( - _SCHEMA_PROVISIONED_POLLER_CONFIG.members["PollerGroupName"], - self.poller_group_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["minimum_pollers"] = de.read_integer( - _SCHEMA_PROVISIONED_POLLER_CONFIG.members["MinimumPollers"] - ) - - case 1: - kwargs["maximum_pollers"] = de.read_integer( - _SCHEMA_PROVISIONED_POLLER_CONFIG.members["MaximumPollers"] - ) - - case 2: - kwargs["poller_group_name"] = de.read_string( - _SCHEMA_PROVISIONED_POLLER_CONFIG.members["PollerGroupName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PROVISIONED_POLLER_CONFIG, consumer=_consumer) - return kwargs - - -def _serialize_queues( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_queues(deserializer: ShapeDeserializer, schema: Schema) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ScalingConfig: - """ - (Amazon SQS only) The scaling configuration for the event source. To - remove the configuration, pass an empty value. - """ - - maximum_concurrency: int | None = None - """ - Limits the number of concurrent instances that the Amazon SQS event - source can invoke. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SCALING_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.maximum_concurrency is not None: - serializer.write_integer( - _SCHEMA_SCALING_CONFIG.members["MaximumConcurrency"], - self.maximum_concurrency, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["maximum_concurrency"] = de.read_integer( - _SCHEMA_SCALING_CONFIG.members["MaximumConcurrency"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SCALING_CONFIG, consumer=_consumer) - return kwargs - - -class EndPointType(UnknownEnumMixin, StrEnum): - KAFKA_BOOTSTRAP_SERVERS = "KAFKA_BOOTSTRAP_SERVERS" - - -def _serialize_endpoint_lists( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_endpoint_lists( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_endpoints( - serializer: ShapeSerializer, schema: Schema, value: dict[str, list[str]] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: _serialize_endpoint_lists(vs, value_schema, v)) - - -def _deserialize_endpoints( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, list[str]]: - result: dict[str, list[str]] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = _deserialize_endpoint_lists(d, value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class SelfManagedEventSource: - """The self-managed Apache Kafka cluster for your event source.""" - - endpoints: dict[str, list[str]] | None = None - """ - The list of bootstrap servers for your Kafka brokers in the following - format: - `"KAFKA_BOOTSTRAP_SERVERS": ["abc.xyz.com:xxxx","abc2.xyz.com:xxxx"]`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SELF_MANAGED_EVENT_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.endpoints is not None: - _serialize_endpoints( - serializer, - _SCHEMA_SELF_MANAGED_EVENT_SOURCE.members["Endpoints"], - self.endpoints, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["endpoints"] = _deserialize_endpoints( - de, _SCHEMA_SELF_MANAGED_EVENT_SOURCE.members["Endpoints"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SELF_MANAGED_EVENT_SOURCE, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class SelfManagedKafkaEventSourceConfig: - """ - Specific configuration settings for a self-managed Apache Kafka event - source. - """ - - consumer_group_id: str | None = None - """ - The identifier for the Kafka consumer group to join. The consumer group - ID must be unique among all your Kafka event sources. After creating a - Kafka event source mapping with the consumer group ID specified, you - cannot update this value. For more information, see [Customizable - consumer group - ID](https://docs.aws.amazon.com/lambda/latest/dg/with-kafka-process.html#services-smaa-topic-add). - """ - - schema_registry_config: KafkaSchemaRegistryConfig | None = None - """Specific configuration settings for a Kafka schema registry.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SELF_MANAGED_KAFKA_EVENT_SOURCE_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.consumer_group_id is not None: - serializer.write_string( - _SCHEMA_SELF_MANAGED_KAFKA_EVENT_SOURCE_CONFIG.members[ - "ConsumerGroupId" - ], - self.consumer_group_id, - ) - - if self.schema_registry_config is not None: - serializer.write_struct( - _SCHEMA_SELF_MANAGED_KAFKA_EVENT_SOURCE_CONFIG.members[ - "SchemaRegistryConfig" - ], - self.schema_registry_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["consumer_group_id"] = de.read_string( - _SCHEMA_SELF_MANAGED_KAFKA_EVENT_SOURCE_CONFIG.members[ - "ConsumerGroupId" - ] - ) - - case 1: - kwargs["schema_registry_config"] = ( - KafkaSchemaRegistryConfig.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SELF_MANAGED_KAFKA_EVENT_SOURCE_CONFIG, consumer=_consumer - ) - return kwargs - - -class SourceAccessType(UnknownEnumMixin, StrEnum): - BASIC_AUTH = "BASIC_AUTH" - VPC_SUBNET = "VPC_SUBNET" - VPC_SECURITY_GROUP = "VPC_SECURITY_GROUP" - SASL_SCRAM_512_AUTH = "SASL_SCRAM_512_AUTH" - SASL_SCRAM_256_AUTH = "SASL_SCRAM_256_AUTH" - VIRTUAL_HOST = "VIRTUAL_HOST" - CLIENT_CERTIFICATE_TLS_AUTH = "CLIENT_CERTIFICATE_TLS_AUTH" - SERVER_ROOT_CA_CERTIFICATE = "SERVER_ROOT_CA_CERTIFICATE" - - -@dataclass(kw_only=True) -class SourceAccessConfiguration: - """ - To secure and define access to your event source, you can specify the - authentication protocol, VPC components, or virtual host. - """ - - type: str | None = None - """ - The type of authentication protocol, VPC components, or virtual host for - your event source. For example: `"Type":"SASL_SCRAM_512_AUTH"`. - - - `BASIC_AUTH` -- (Amazon MQ) The Secrets Manager secret that stores - your broker credentials. - - - `BASIC_AUTH` -- (Self-managed Apache Kafka) The Secrets Manager ARN of - your secret key used for SASL/PLAIN authentication of your Apache - Kafka brokers. - - - `VPC_SUBNET` -- (Self-managed Apache Kafka) The subnets associated - with your VPC. Lambda connects to these subnets to fetch data from - your self-managed Apache Kafka cluster. - - - `VPC_SECURITY_GROUP` -- (Self-managed Apache Kafka) The VPC security - group used to manage access to your self-managed Apache Kafka brokers. - - - `SASL_SCRAM_256_AUTH` -- (Self-managed Apache Kafka) The Secrets - Manager ARN of your secret key used for SASL SCRAM-256 authentication - of your self-managed Apache Kafka brokers. - - - `SASL_SCRAM_512_AUTH` -- (Amazon MSK, Self-managed Apache Kafka) The - Secrets Manager ARN of your secret key used for SASL SCRAM-512 - authentication of your self-managed Apache Kafka brokers. - - - `VIRTUAL_HOST` --- (RabbitMQ) The name of the virtual host in your - RabbitMQ broker. Lambda uses this RabbitMQ host as the event source. - This property cannot be specified in an UpdateEventSourceMapping API - call. - - - `CLIENT_CERTIFICATE_TLS_AUTH` -- (Amazon MSK, self-managed Apache - Kafka) The Secrets Manager ARN of your secret key containing the - certificate chain (X.509 PEM), private key (PKCS#8 PEM), and private - key password (optional) used for mutual TLS authentication of your - MSK/Apache Kafka brokers. - - - `SERVER_ROOT_CA_CERTIFICATE` -- (Self-managed Apache Kafka) The - Secrets Manager ARN of your secret key containing the root CA - certificate (X.509 PEM) used for TLS encryption of your Apache Kafka - brokers. - """ - - uri: str | None = None - """ - The value for your chosen configuration in `Type`. For example: - `"URI": "arn:aws:secretsmanager:us-east-1:01234567890:secret:MyBrokerSecretName"`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SOURCE_ACCESS_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_SOURCE_ACCESS_CONFIGURATION.members["Type"], self.type - ) - - if self.uri is not None: - serializer.write_string( - _SCHEMA_SOURCE_ACCESS_CONFIGURATION.members["URI"], self.uri - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = SourceAccessType( - de.read_string( - _SCHEMA_SOURCE_ACCESS_CONFIGURATION.members["Type"] - ) - ) - - case 1: - kwargs["uri"] = de.read_string( - _SCHEMA_SOURCE_ACCESS_CONFIGURATION.members["URI"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SOURCE_ACCESS_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -def _serialize_source_access_configurations( - serializer: ShapeSerializer, schema: Schema, value: list[SourceAccessConfiguration] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_source_access_configurations( - deserializer: ShapeDeserializer, schema: Schema -) -> list[SourceAccessConfiguration]: - result: list[SourceAccessConfiguration] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(SourceAccessConfiguration.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class EventSourcePosition(UnknownEnumMixin, StrEnum): - TRIM_HORIZON = "TRIM_HORIZON" - LATEST = "LATEST" - AT_TIMESTAMP = "AT_TIMESTAMP" - - -def _serialize_topics( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_topics(deserializer: ShapeDeserializer, schema: Schema) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CreateEventSourceMappingInput: - """Dataclass for CreateEventSourceMappingInput structure.""" - - event_source_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the event source. - - - **Amazon Kinesis** -- The ARN of the data stream or a stream consumer. - - - **Amazon DynamoDB Streams** -- The ARN of the stream. - - - **Amazon Simple Queue Service** -- The ARN of the queue. - - - **Amazon Managed Streaming for Apache Kafka** -- The ARN of the - cluster or the ARN of the VPC connection (for [cross-account event - source - mappings](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#msk-multi-vpc)). - - - **Amazon MQ** -- The ARN of the broker. - - - **Amazon DocumentDB** -- The ARN of the DocumentDB change stream. - """ - - function_name: str | None = None - """ - The name or ARN of the Lambda function. - - **Name formats** - - - **Function name** -- `MyFunction`. - - - **Function ARN** -- - `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`. - - - **Version or Alias ARN** -- - `arn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD`. - - - **Partial ARN** -- `123456789012:function:MyFunction`. - - The length constraint applies only to the full ARN. If you specify only - the function name, it's limited to 64 characters in length. - """ - - enabled: bool | None = None - """ - When true, the event source mapping is active. When false, Lambda pauses - polling and invocation. - - Default: True - """ - - batch_size: int | None = None - """ - The maximum number of records in each batch that Lambda pulls from your - stream or queue and sends to your function. Lambda passes all of the - records in the batch to the function in a single call, up to the payload - limit for synchronous invocation (6 MB). - - - **Amazon Kinesis** -- Default 100. Max 10,000. - - - **Amazon DynamoDB Streams** -- Default 100. Max 10,000. - - - **Amazon Simple Queue Service** -- Default 10. For standard queues the - max is 10,000. For FIFO queues the max is 10. - - - **Amazon Managed Streaming for Apache Kafka** -- Default 100. Max - 10,000. - - - **Self-managed Apache Kafka** -- Default 100. Max 10,000. - - - **Amazon MQ (ActiveMQ and RabbitMQ)** -- Default 100. Max 10,000. - - - **DocumentDB** -- Default 100. Max 10,000. - """ - - filter_criteria: FilterCriteria | None = None - """ - An object that defines the filter criteria that determine whether Lambda - should process an event. For more information, see [Lambda event - filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html). - """ - - kms_key_arn: str | None = None - """ - The ARN of the Key Management Service (KMS) customer managed key that - Lambda uses to encrypt your function's [filter - criteria](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html#filtering-basics). - By default, Lambda does not encrypt your filter criteria object. Specify - this property to encrypt data using your own customer managed key. - """ - - metrics_config: EventSourceMappingMetricsConfig | None = None - """ - The metrics configuration for your event source. For more information, - see [Event source mapping - metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics-types.html#event-source-mapping-metrics). - """ - - logging_config: EventSourceMappingLoggingConfig | None = None - """ - (Amazon MSK, and self-managed Apache Kafka only) The logging - configuration for your event source. For more information, see [Event - source mapping - logging](https://docs.aws.amazon.com/lambda/latest/dg/esm-logging.html). - """ - - scaling_config: ScalingConfig | None = None - """ - (Amazon SQS only) The scaling configuration for the event source. For - more information, see [Configuring maximum concurrency for Amazon SQS - event - sources](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-max-concurrency). - """ - - maximum_batching_window_in_seconds: int | None = None - """ - The maximum amount of time, in seconds, that Lambda spends gathering - records before invoking the function. You can configure - `MaximumBatchingWindowInSeconds` to any value from 0 seconds to 300 - seconds in increments of seconds. - - For Kinesis, DynamoDB, and Amazon SQS event sources, the default - batching window is 0 seconds. For Amazon MSK, Self-managed Apache Kafka, - Amazon MQ, and DocumentDB event sources, the default batching window is - 500 ms. Note that because you can only change - `MaximumBatchingWindowInSeconds` in increments of seconds, you cannot - revert back to the 500 ms default batching window after you have changed - it. To restore the default batching window, you must create a new event - source mapping. - - Related setting: For Kinesis, DynamoDB, and Amazon SQS event sources, - when you set `BatchSize` to a value greater than 10, you must set - `MaximumBatchingWindowInSeconds` to at least 1. - """ - - parallelization_factor: int | None = None - """ - (Kinesis and DynamoDB Streams only) The number of batches to process - from each shard concurrently. - """ - - starting_position: str | None = None - """ - The position in a stream from which to start reading. Required for - Amazon Kinesis and Amazon DynamoDB Stream event sources. `AT_TIMESTAMP` - is supported only for Amazon Kinesis streams, Amazon DocumentDB, Amazon - MSK, and self-managed Apache Kafka. - """ - - starting_position_timestamp: datetime | None = None - """ - With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to - start reading. `StartingPositionTimestamp` cannot be in the future. - """ - - destination_config: DestinationConfig | None = None - """ - (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) A - configuration object that specifies the destination of an event after - Lambda processes it. - """ - - maximum_record_age_in_seconds: int | None = None - """ - (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) - Discard records older than the specified age. The default value is - infinite (-1). - """ - - bisect_batch_on_function_error: bool | None = None - """ - (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) - If the function returns an error, split the batch in two and retry. - """ - - maximum_retry_attempts: int | None = None - """ - (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) - Discard records after the specified number of retries. The default value - is infinite (-1). When set to infinite (-1), failed records are retried - until the record expires. - """ - - tags: dict[str, str] | None = None - """A list of tags to apply to the event source mapping.""" - - tumbling_window_in_seconds: int | None = None - """ - (Kinesis and DynamoDB Streams only) The duration in seconds of a - processing window for DynamoDB and Kinesis Streams event sources. A - value of 0 seconds indicates no tumbling window. - """ - - topics: list[str] | None = None - """The name of the Kafka topic.""" - - queues: list[str] | None = None - """(MQ) The name of the Amazon MQ broker destination queue to consume.""" - - source_access_configurations: list[SourceAccessConfiguration] | None = None - """ - An array of authentication protocols or VPC components required to - secure your event source. - """ - - self_managed_event_source: SelfManagedEventSource | None = None - """The self-managed Apache Kafka cluster to receive records from.""" - - function_response_types: list[str] | None = None - """ - (Kinesis, DynamoDB Streams, Amazon MSK, self-managed Apache Kafka, and - Amazon SQS) A list of current response type enums applied to the event - source mapping. - """ - - amazon_managed_kafka_event_source_config: ( - AmazonManagedKafkaEventSourceConfig | None - ) = None - """ - Specific configuration settings for an Amazon Managed Streaming for - Apache Kafka (Amazon MSK) event source. - """ - - self_managed_kafka_event_source_config: SelfManagedKafkaEventSourceConfig | None = ( - None - ) - """ - Specific configuration settings for a self-managed Apache Kafka event - source. - """ - - document_db_event_source_config: DocumentDBEventSourceConfig | None = None - """Specific configuration settings for a DocumentDB event source.""" - - provisioned_poller_config: ProvisionedPollerConfig | None = None - """ - (Amazon SQS, Amazon MSK, and self-managed Apache Kafka only) The - provisioned mode configuration for the event source. For more - information, see [provisioned - mode](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html#invocation-eventsourcemapping-provisioned-mode). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_EVENT_SOURCE_MAPPING_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.event_source_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_INPUT.members["EventSourceArn"], - self.event_source_arn, - ) - - if self.function_name is not None: - serializer.write_string( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_INPUT.members["FunctionName"], - self.function_name, - ) - - if self.enabled is not None: - serializer.write_boolean( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_INPUT.members["Enabled"], - self.enabled, - ) - - if self.batch_size is not None: - serializer.write_integer( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_INPUT.members["BatchSize"], - self.batch_size, - ) - - if self.filter_criteria is not None: - serializer.write_struct( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_INPUT.members["FilterCriteria"], - self.filter_criteria, - ) - - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_INPUT.members["KMSKeyArn"], - self.kms_key_arn, - ) - - if self.metrics_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_INPUT.members["MetricsConfig"], - self.metrics_config, - ) - - if self.logging_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_INPUT.members["LoggingConfig"], - self.logging_config, - ) - - if self.scaling_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_INPUT.members["ScalingConfig"], - self.scaling_config, - ) - - if self.maximum_batching_window_in_seconds is not None: - serializer.write_integer( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_INPUT.members[ - "MaximumBatchingWindowInSeconds" - ], - self.maximum_batching_window_in_seconds, - ) - - if self.parallelization_factor is not None: - serializer.write_integer( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_INPUT.members[ - "ParallelizationFactor" - ], - self.parallelization_factor, - ) - - if self.starting_position is not None: - serializer.write_string( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_INPUT.members["StartingPosition"], - self.starting_position, - ) - - if self.starting_position_timestamp is not None: - serializer.write_timestamp( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_INPUT.members[ - "StartingPositionTimestamp" - ], - self.starting_position_timestamp, - ) - - if self.destination_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_INPUT.members["DestinationConfig"], - self.destination_config, - ) - - if self.maximum_record_age_in_seconds is not None: - serializer.write_integer( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_INPUT.members[ - "MaximumRecordAgeInSeconds" - ], - self.maximum_record_age_in_seconds, - ) - - if self.bisect_batch_on_function_error is not None: - serializer.write_boolean( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_INPUT.members[ - "BisectBatchOnFunctionError" - ], - self.bisect_batch_on_function_error, - ) - - if self.maximum_retry_attempts is not None: - serializer.write_integer( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_INPUT.members[ - "MaximumRetryAttempts" - ], - self.maximum_retry_attempts, - ) - - if self.tags is not None: - _serialize_tags( - serializer, - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_INPUT.members["Tags"], - self.tags, - ) - - if self.tumbling_window_in_seconds is not None: - serializer.write_integer( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_INPUT.members[ - "TumblingWindowInSeconds" - ], - self.tumbling_window_in_seconds, - ) - - if self.topics is not None: - _serialize_topics( - serializer, - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_INPUT.members["Topics"], - self.topics, - ) - - if self.queues is not None: - _serialize_queues( - serializer, - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_INPUT.members["Queues"], - self.queues, - ) - - if self.source_access_configurations is not None: - _serialize_source_access_configurations( - serializer, - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_INPUT.members[ - "SourceAccessConfigurations" - ], - self.source_access_configurations, - ) - - if self.self_managed_event_source is not None: - serializer.write_struct( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_INPUT.members[ - "SelfManagedEventSource" - ], - self.self_managed_event_source, - ) - - if self.function_response_types is not None: - _serialize_function_response_type_list( - serializer, - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_INPUT.members[ - "FunctionResponseTypes" - ], - self.function_response_types, - ) - - if self.amazon_managed_kafka_event_source_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_INPUT.members[ - "AmazonManagedKafkaEventSourceConfig" - ], - self.amazon_managed_kafka_event_source_config, - ) - - if self.self_managed_kafka_event_source_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_INPUT.members[ - "SelfManagedKafkaEventSourceConfig" - ], - self.self_managed_kafka_event_source_config, - ) - - if self.document_db_event_source_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_INPUT.members[ - "DocumentDBEventSourceConfig" - ], - self.document_db_event_source_config, - ) - - if self.provisioned_poller_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_INPUT.members[ - "ProvisionedPollerConfig" - ], - self.provisioned_poller_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["event_source_arn"] = de.read_string( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_INPUT.members[ - "EventSourceArn" - ] - ) - - case 1: - kwargs["function_name"] = de.read_string( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_INPUT.members[ - "FunctionName" - ] - ) - - case 2: - kwargs["enabled"] = de.read_boolean( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_INPUT.members["Enabled"] - ) - - case 3: - kwargs["batch_size"] = de.read_integer( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_INPUT.members["BatchSize"] - ) - - case 4: - kwargs["filter_criteria"] = FilterCriteria.deserialize(de) - - case 5: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_INPUT.members["KMSKeyArn"] - ) - - case 6: - kwargs["metrics_config"] = ( - EventSourceMappingMetricsConfig.deserialize(de) - ) - - case 7: - kwargs["logging_config"] = ( - EventSourceMappingLoggingConfig.deserialize(de) - ) - - case 8: - kwargs["scaling_config"] = ScalingConfig.deserialize(de) - - case 9: - kwargs["maximum_batching_window_in_seconds"] = de.read_integer( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_INPUT.members[ - "MaximumBatchingWindowInSeconds" - ] - ) - - case 10: - kwargs["parallelization_factor"] = de.read_integer( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_INPUT.members[ - "ParallelizationFactor" - ] - ) - - case 11: - kwargs["starting_position"] = EventSourcePosition( - de.read_string( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_INPUT.members[ - "StartingPosition" - ] - ) - ) - - case 12: - kwargs["starting_position_timestamp"] = de.read_timestamp( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_INPUT.members[ - "StartingPositionTimestamp" - ] - ) - - case 13: - kwargs["destination_config"] = DestinationConfig.deserialize(de) - - case 14: - kwargs["maximum_record_age_in_seconds"] = de.read_integer( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_INPUT.members[ - "MaximumRecordAgeInSeconds" - ] - ) - - case 15: - kwargs["bisect_batch_on_function_error"] = de.read_boolean( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_INPUT.members[ - "BisectBatchOnFunctionError" - ] - ) - - case 16: - kwargs["maximum_retry_attempts"] = de.read_integer( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_INPUT.members[ - "MaximumRetryAttempts" - ] - ) - - case 17: - kwargs["tags"] = _deserialize_tags( - de, _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_INPUT.members["Tags"] - ) - - case 18: - kwargs["tumbling_window_in_seconds"] = de.read_integer( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_INPUT.members[ - "TumblingWindowInSeconds" - ] - ) - - case 19: - kwargs["topics"] = _deserialize_topics( - de, _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_INPUT.members["Topics"] - ) - - case 20: - kwargs["queues"] = _deserialize_queues( - de, _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_INPUT.members["Queues"] - ) - - case 21: - kwargs["source_access_configurations"] = ( - _deserialize_source_access_configurations( - de, - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_INPUT.members[ - "SourceAccessConfigurations" - ], - ) - ) - - case 22: - kwargs["self_managed_event_source"] = ( - SelfManagedEventSource.deserialize(de) - ) - - case 23: - kwargs["function_response_types"] = ( - _deserialize_function_response_type_list( - de, - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_INPUT.members[ - "FunctionResponseTypes" - ], - ) - ) - - case 24: - kwargs["amazon_managed_kafka_event_source_config"] = ( - AmazonManagedKafkaEventSourceConfig.deserialize(de) - ) - - case 25: - kwargs["self_managed_kafka_event_source_config"] = ( - SelfManagedKafkaEventSourceConfig.deserialize(de) - ) - - case 26: - kwargs["document_db_event_source_config"] = ( - DocumentDBEventSourceConfig.deserialize(de) - ) - - case 27: - kwargs["provisioned_poller_config"] = ( - ProvisionedPollerConfig.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class FilterCriteriaError: - """ - An object that contains details about an error related to filter - criteria encryption. - """ - - error_code: str | None = None - """ - The KMS exception that resulted from filter criteria encryption or - decryption. - """ - - message: str | None = None - """The error message.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FILTER_CRITERIA_ERROR, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.error_code is not None: - serializer.write_string( - _SCHEMA_FILTER_CRITERIA_ERROR.members["ErrorCode"], self.error_code - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_FILTER_CRITERIA_ERROR.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["error_code"] = de.read_string( - _SCHEMA_FILTER_CRITERIA_ERROR.members["ErrorCode"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_FILTER_CRITERIA_ERROR.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FILTER_CRITERIA_ERROR, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CreateEventSourceMappingOutput: - """ - A mapping between an Amazon Web Services resource and a Lambda function. - For details, see CreateEventSourceMapping. - """ - - uuid: str | None = None - """The identifier of the event source mapping.""" - - starting_position: str | None = None - """ - The position in a stream from which to start reading. Required for - Amazon Kinesis and Amazon DynamoDB Stream event sources. `AT_TIMESTAMP` - is supported only for Amazon Kinesis streams, Amazon DocumentDB, Amazon - MSK, and self-managed Apache Kafka. - """ - - starting_position_timestamp: datetime | None = None - """ - With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to - start reading. `StartingPositionTimestamp` cannot be in the future. - """ - - batch_size: int | None = None - """ - The maximum number of records in each batch that Lambda pulls from your - stream or queue and sends to your function. Lambda passes all of the - records in the batch to the function in a single call, up to the payload - limit for synchronous invocation (6 MB). - - Default value: Varies by service. For Amazon SQS, the default is 10. For - all other services, the default is 100. - - Related setting: When you set `BatchSize` to a value greater than 10, - you must set `MaximumBatchingWindowInSeconds` to at least 1. - """ - - maximum_batching_window_in_seconds: int | None = None - """ - The maximum amount of time, in seconds, that Lambda spends gathering - records before invoking the function. You can configure - `MaximumBatchingWindowInSeconds` to any value from 0 seconds to 300 - seconds in increments of seconds. - - For streams and Amazon SQS event sources, the default batching window is - 0 seconds. For Amazon MSK, Self-managed Apache Kafka, Amazon MQ, and - DocumentDB event sources, the default batching window is 500 ms. Note - that because you can only change `MaximumBatchingWindowInSeconds` in - increments of seconds, you cannot revert back to the 500 ms default - batching window after you have changed it. To restore the default - batching window, you must create a new event source mapping. - - Related setting: For streams and Amazon SQS event sources, when you set - `BatchSize` to a value greater than 10, you must set - `MaximumBatchingWindowInSeconds` to at least 1. - """ - - parallelization_factor: int | None = None - """ - (Kinesis and DynamoDB Streams only) The number of batches to process - concurrently from each shard. The default value is 1. - """ - - event_source_arn: str | None = None - """The Amazon Resource Name (ARN) of the event source.""" - - filter_criteria: FilterCriteria | None = None - """ - An object that defines the filter criteria that determine whether Lambda - should process an event. For more information, see [Lambda event - filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html). - - If filter criteria is encrypted, this field shows up as `null` in the - response of ListEventSourceMapping API calls. You can view this field in - plaintext in the response of GetEventSourceMapping and - DeleteEventSourceMapping calls if you have `kms:Decrypt` permissions for - the correct KMS key. - """ - - filter_criteria_error: FilterCriteriaError | None = None - """ - An object that contains details about an error related to filter - criteria encryption. - """ - - kms_key_arn: str | None = None - """ - The ARN of the Key Management Service (KMS) customer managed key that - Lambda uses to encrypt your function's [filter - criteria](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html#filtering-basics). - """ - - metrics_config: EventSourceMappingMetricsConfig | None = None - """ - The metrics configuration for your event source. For more information, - see [Event source mapping - metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics-types.html#event-source-mapping-metrics). - """ - - logging_config: EventSourceMappingLoggingConfig | None = None - """ - (Amazon MSK, and self-managed Apache Kafka only) The logging - configuration for your event source. For more information, see [Event - source mapping - logging](https://docs.aws.amazon.com/lambda/latest/dg/esm-logging.html). - """ - - scaling_config: ScalingConfig | None = None - """ - (Amazon SQS only) The scaling configuration for the event source. For - more information, see [Configuring maximum concurrency for Amazon SQS - event - sources](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-max-concurrency). - """ - - function_arn: str | None = None - """The ARN of the Lambda function.""" - - last_modified: datetime | None = None - """ - The date that the event source mapping was last updated or that its - state changed. - """ - - last_processing_result: str | None = None - """The result of the event source mapping's last processing attempt.""" - - state: str | None = None - """ - The state of the event source mapping. It can be one of the following: - `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, - or `Deleting`. - """ - - state_transition_reason: str | None = None - """ - Indicates whether a user or Lambda made the last change to the event - source mapping. - """ - - destination_config: DestinationConfig | None = None - """ - (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) A - configuration object that specifies the destination of an event after - Lambda processes it. - """ - - topics: list[str] | None = None - """The name of the Kafka topic.""" - - queues: list[str] | None = None - """ - (Amazon MQ) The name of the Amazon MQ broker destination queue to - consume. - """ - - source_access_configurations: list[SourceAccessConfiguration] | None = None - """ - An array of the authentication protocol, VPC components, or virtual host - to secure and define your event source. - """ - - self_managed_event_source: SelfManagedEventSource | None = None - """The self-managed Apache Kafka cluster for your event source.""" - - maximum_record_age_in_seconds: int | None = None - """ - (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) - Discard records older than the specified age. The default value is -1, - which sets the maximum age to infinite. When the value is set to - infinite, Lambda never discards old records. - - Note: - The minimum valid value for maximum record age is 60s. Although values - less than 60 and greater than -1 fall within the parameter's absolute - range, they are not allowed - """ - - bisect_batch_on_function_error: bool | None = None - """ - (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) - If the function returns an error, split the batch in two and retry. The - default value is false. - """ - - maximum_retry_attempts: int | None = None - """ - (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) - Discard records after the specified number of retries. The default value - is -1, which sets the maximum number of retries to infinite. When - MaximumRetryAttempts is infinite, Lambda retries failed records until - the record expires in the event source. - """ - - tumbling_window_in_seconds: int | None = None - """ - (Kinesis and DynamoDB Streams only) The duration in seconds of a - processing window for DynamoDB and Kinesis Streams event sources. A - value of 0 seconds indicates no tumbling window. - """ - - function_response_types: list[str] | None = None - """ - (Kinesis, DynamoDB Streams, Amazon MSK, self-managed Apache Kafka, and - Amazon SQS) A list of current response type enums applied to the event - source mapping. - """ - - amazon_managed_kafka_event_source_config: ( - AmazonManagedKafkaEventSourceConfig | None - ) = None - """ - Specific configuration settings for an Amazon Managed Streaming for - Apache Kafka (Amazon MSK) event source. - """ - - self_managed_kafka_event_source_config: SelfManagedKafkaEventSourceConfig | None = ( - None - ) - """ - Specific configuration settings for a self-managed Apache Kafka event - source. - """ - - document_db_event_source_config: DocumentDBEventSourceConfig | None = None - """Specific configuration settings for a DocumentDB event source.""" - - event_source_mapping_arn: str | None = None - """The Amazon Resource Name (ARN) of the event source mapping.""" - - provisioned_poller_config: ProvisionedPollerConfig | None = None - """ - (Amazon SQS, Amazon MSK, and self-managed Apache Kafka only) The - provisioned mode configuration for the event source. For more - information, see [provisioned - mode](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html#invocation-eventsourcemapping-provisioned-mode). - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.uuid is not None: - serializer.write_string( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members["UUID"], self.uuid - ) - - if self.starting_position is not None: - serializer.write_string( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members["StartingPosition"], - self.starting_position, - ) - - if self.starting_position_timestamp is not None: - serializer.write_timestamp( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "StartingPositionTimestamp" - ], - self.starting_position_timestamp, - ) - - if self.batch_size is not None: - serializer.write_integer( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members["BatchSize"], - self.batch_size, - ) - - if self.maximum_batching_window_in_seconds is not None: - serializer.write_integer( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "MaximumBatchingWindowInSeconds" - ], - self.maximum_batching_window_in_seconds, - ) - - if self.parallelization_factor is not None: - serializer.write_integer( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "ParallelizationFactor" - ], - self.parallelization_factor, - ) - - if self.event_source_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members["EventSourceArn"], - self.event_source_arn, - ) - - if self.filter_criteria is not None: - serializer.write_struct( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members["FilterCriteria"], - self.filter_criteria, - ) - - if self.filter_criteria_error is not None: - serializer.write_struct( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "FilterCriteriaError" - ], - self.filter_criteria_error, - ) - - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members["KMSKeyArn"], - self.kms_key_arn, - ) - - if self.metrics_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members["MetricsConfig"], - self.metrics_config, - ) - - if self.logging_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members["LoggingConfig"], - self.logging_config, - ) - - if self.scaling_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members["ScalingConfig"], - self.scaling_config, - ) - - if self.function_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members["FunctionArn"], - self.function_arn, - ) - - if self.last_modified is not None: - serializer.write_timestamp( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members["LastModified"], - self.last_modified, - ) - - if self.last_processing_result is not None: - serializer.write_string( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "LastProcessingResult" - ], - self.last_processing_result, - ) - - if self.state is not None: - serializer.write_string( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members["State"], self.state - ) - - if self.state_transition_reason is not None: - serializer.write_string( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "StateTransitionReason" - ], - self.state_transition_reason, - ) - - if self.destination_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members["DestinationConfig"], - self.destination_config, - ) - - if self.topics is not None: - _serialize_topics( - serializer, - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members["Topics"], - self.topics, - ) - - if self.queues is not None: - _serialize_queues( - serializer, - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members["Queues"], - self.queues, - ) - - if self.source_access_configurations is not None: - _serialize_source_access_configurations( - serializer, - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "SourceAccessConfigurations" - ], - self.source_access_configurations, - ) - - if self.self_managed_event_source is not None: - serializer.write_struct( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "SelfManagedEventSource" - ], - self.self_managed_event_source, - ) - - if self.maximum_record_age_in_seconds is not None: - serializer.write_integer( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "MaximumRecordAgeInSeconds" - ], - self.maximum_record_age_in_seconds, - ) - - if self.bisect_batch_on_function_error is not None: - serializer.write_boolean( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "BisectBatchOnFunctionError" - ], - self.bisect_batch_on_function_error, - ) - - if self.maximum_retry_attempts is not None: - serializer.write_integer( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "MaximumRetryAttempts" - ], - self.maximum_retry_attempts, - ) - - if self.tumbling_window_in_seconds is not None: - serializer.write_integer( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "TumblingWindowInSeconds" - ], - self.tumbling_window_in_seconds, - ) - - if self.function_response_types is not None: - _serialize_function_response_type_list( - serializer, - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "FunctionResponseTypes" - ], - self.function_response_types, - ) - - if self.amazon_managed_kafka_event_source_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "AmazonManagedKafkaEventSourceConfig" - ], - self.amazon_managed_kafka_event_source_config, - ) - - if self.self_managed_kafka_event_source_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "SelfManagedKafkaEventSourceConfig" - ], - self.self_managed_kafka_event_source_config, - ) - - if self.document_db_event_source_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "DocumentDBEventSourceConfig" - ], - self.document_db_event_source_config, - ) - - if self.event_source_mapping_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "EventSourceMappingArn" - ], - self.event_source_mapping_arn, - ) - - if self.provisioned_poller_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "ProvisionedPollerConfig" - ], - self.provisioned_poller_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["uuid"] = de.read_string( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members["UUID"] - ) - - case 1: - kwargs["starting_position"] = EventSourcePosition( - de.read_string( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "StartingPosition" - ] - ) - ) - - case 2: - kwargs["starting_position_timestamp"] = de.read_timestamp( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "StartingPositionTimestamp" - ] - ) - - case 3: - kwargs["batch_size"] = de.read_integer( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members["BatchSize"] - ) - - case 4: - kwargs["maximum_batching_window_in_seconds"] = de.read_integer( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "MaximumBatchingWindowInSeconds" - ] - ) - - case 5: - kwargs["parallelization_factor"] = de.read_integer( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "ParallelizationFactor" - ] - ) - - case 6: - kwargs["event_source_arn"] = de.read_string( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "EventSourceArn" - ] - ) - - case 7: - kwargs["filter_criteria"] = FilterCriteria.deserialize(de) - - case 8: - kwargs["filter_criteria_error"] = FilterCriteriaError.deserialize( - de - ) - - case 9: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members["KMSKeyArn"] - ) - - case 10: - kwargs["metrics_config"] = ( - EventSourceMappingMetricsConfig.deserialize(de) - ) - - case 11: - kwargs["logging_config"] = ( - EventSourceMappingLoggingConfig.deserialize(de) - ) - - case 12: - kwargs["scaling_config"] = ScalingConfig.deserialize(de) - - case 13: - kwargs["function_arn"] = de.read_string( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "FunctionArn" - ] - ) - - case 14: - kwargs["last_modified"] = de.read_timestamp( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "LastModified" - ] - ) - - case 15: - kwargs["last_processing_result"] = de.read_string( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "LastProcessingResult" - ] - ) - - case 16: - kwargs["state"] = de.read_string( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members["State"] - ) - - case 17: - kwargs["state_transition_reason"] = de.read_string( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "StateTransitionReason" - ] - ) - - case 18: - kwargs["destination_config"] = DestinationConfig.deserialize(de) - - case 19: - kwargs["topics"] = _deserialize_topics( - de, _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members["Topics"] - ) - - case 20: - kwargs["queues"] = _deserialize_queues( - de, _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members["Queues"] - ) - - case 21: - kwargs["source_access_configurations"] = ( - _deserialize_source_access_configurations( - de, - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "SourceAccessConfigurations" - ], - ) - ) - - case 22: - kwargs["self_managed_event_source"] = ( - SelfManagedEventSource.deserialize(de) - ) - - case 23: - kwargs["maximum_record_age_in_seconds"] = de.read_integer( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "MaximumRecordAgeInSeconds" - ] - ) - - case 24: - kwargs["bisect_batch_on_function_error"] = de.read_boolean( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "BisectBatchOnFunctionError" - ] - ) - - case 25: - kwargs["maximum_retry_attempts"] = de.read_integer( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "MaximumRetryAttempts" - ] - ) - - case 26: - kwargs["tumbling_window_in_seconds"] = de.read_integer( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "TumblingWindowInSeconds" - ] - ) - - case 27: - kwargs["function_response_types"] = ( - _deserialize_function_response_type_list( - de, - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "FunctionResponseTypes" - ], - ) - ) - - case 28: - kwargs["amazon_managed_kafka_event_source_config"] = ( - AmazonManagedKafkaEventSourceConfig.deserialize(de) - ) - - case 29: - kwargs["self_managed_kafka_event_source_config"] = ( - SelfManagedKafkaEventSourceConfig.deserialize(de) - ) - - case 30: - kwargs["document_db_event_source_config"] = ( - DocumentDBEventSourceConfig.deserialize(de) - ) - - case 31: - kwargs["event_source_mapping_arn"] = de.read_string( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "EventSourceMappingArn" - ] - ) - - case 32: - kwargs["provisioned_poller_config"] = ( - ProvisionedPollerConfig.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT, consumer=_consumer - ) - return kwargs - - -CREATE_EVENT_SOURCE_MAPPING = APIOperation( - input=CreateEventSourceMappingInput, - output=CreateEventSourceMappingOutput, - schema=_SCHEMA_CREATE_EVENT_SOURCE_MAPPING, - input_schema=_SCHEMA_CREATE_EVENT_SOURCE_MAPPING_INPUT, - output_schema=_SCHEMA_CREATE_EVENT_SOURCE_MAPPING_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceConflictException" - ): ResourceConflictException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteEventSourceMappingInput: - """Dataclass for DeleteEventSourceMappingInput structure.""" - - uuid: str | None = None - """The identifier of the event source mapping.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_EVENT_SOURCE_MAPPING_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.uuid is not None: - serializer.write_string( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_INPUT.members["UUID"], self.uuid - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["uuid"] = de.read_string( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_INPUT.members["UUID"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteEventSourceMappingOutput: - """ - A mapping between an Amazon Web Services resource and a Lambda function. - For details, see CreateEventSourceMapping. - """ - - uuid: str | None = None - """The identifier of the event source mapping.""" - - starting_position: str | None = None - """ - The position in a stream from which to start reading. Required for - Amazon Kinesis and Amazon DynamoDB Stream event sources. `AT_TIMESTAMP` - is supported only for Amazon Kinesis streams, Amazon DocumentDB, Amazon - MSK, and self-managed Apache Kafka. - """ - - starting_position_timestamp: datetime | None = None - """ - With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to - start reading. `StartingPositionTimestamp` cannot be in the future. - """ - - batch_size: int | None = None - """ - The maximum number of records in each batch that Lambda pulls from your - stream or queue and sends to your function. Lambda passes all of the - records in the batch to the function in a single call, up to the payload - limit for synchronous invocation (6 MB). - - Default value: Varies by service. For Amazon SQS, the default is 10. For - all other services, the default is 100. - - Related setting: When you set `BatchSize` to a value greater than 10, - you must set `MaximumBatchingWindowInSeconds` to at least 1. - """ - - maximum_batching_window_in_seconds: int | None = None - """ - The maximum amount of time, in seconds, that Lambda spends gathering - records before invoking the function. You can configure - `MaximumBatchingWindowInSeconds` to any value from 0 seconds to 300 - seconds in increments of seconds. - - For streams and Amazon SQS event sources, the default batching window is - 0 seconds. For Amazon MSK, Self-managed Apache Kafka, Amazon MQ, and - DocumentDB event sources, the default batching window is 500 ms. Note - that because you can only change `MaximumBatchingWindowInSeconds` in - increments of seconds, you cannot revert back to the 500 ms default - batching window after you have changed it. To restore the default - batching window, you must create a new event source mapping. - - Related setting: For streams and Amazon SQS event sources, when you set - `BatchSize` to a value greater than 10, you must set - `MaximumBatchingWindowInSeconds` to at least 1. - """ - - parallelization_factor: int | None = None - """ - (Kinesis and DynamoDB Streams only) The number of batches to process - concurrently from each shard. The default value is 1. - """ - - event_source_arn: str | None = None - """The Amazon Resource Name (ARN) of the event source.""" - - filter_criteria: FilterCriteria | None = None - """ - An object that defines the filter criteria that determine whether Lambda - should process an event. For more information, see [Lambda event - filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html). - - If filter criteria is encrypted, this field shows up as `null` in the - response of ListEventSourceMapping API calls. You can view this field in - plaintext in the response of GetEventSourceMapping and - DeleteEventSourceMapping calls if you have `kms:Decrypt` permissions for - the correct KMS key. - """ - - filter_criteria_error: FilterCriteriaError | None = None - """ - An object that contains details about an error related to filter - criteria encryption. - """ - - kms_key_arn: str | None = None - """ - The ARN of the Key Management Service (KMS) customer managed key that - Lambda uses to encrypt your function's [filter - criteria](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html#filtering-basics). - """ - - metrics_config: EventSourceMappingMetricsConfig | None = None - """ - The metrics configuration for your event source. For more information, - see [Event source mapping - metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics-types.html#event-source-mapping-metrics). - """ - - logging_config: EventSourceMappingLoggingConfig | None = None - """ - (Amazon MSK, and self-managed Apache Kafka only) The logging - configuration for your event source. For more information, see [Event - source mapping - logging](https://docs.aws.amazon.com/lambda/latest/dg/esm-logging.html). - """ - - scaling_config: ScalingConfig | None = None - """ - (Amazon SQS only) The scaling configuration for the event source. For - more information, see [Configuring maximum concurrency for Amazon SQS - event - sources](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-max-concurrency). - """ - - function_arn: str | None = None - """The ARN of the Lambda function.""" - - last_modified: datetime | None = None - """ - The date that the event source mapping was last updated or that its - state changed. - """ - - last_processing_result: str | None = None - """The result of the event source mapping's last processing attempt.""" - - state: str | None = None - """ - The state of the event source mapping. It can be one of the following: - `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, - or `Deleting`. - """ - - state_transition_reason: str | None = None - """ - Indicates whether a user or Lambda made the last change to the event - source mapping. - """ - - destination_config: DestinationConfig | None = None - """ - (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) A - configuration object that specifies the destination of an event after - Lambda processes it. - """ - - topics: list[str] | None = None - """The name of the Kafka topic.""" - - queues: list[str] | None = None - """ - (Amazon MQ) The name of the Amazon MQ broker destination queue to - consume. - """ - - source_access_configurations: list[SourceAccessConfiguration] | None = None - """ - An array of the authentication protocol, VPC components, or virtual host - to secure and define your event source. - """ - - self_managed_event_source: SelfManagedEventSource | None = None - """The self-managed Apache Kafka cluster for your event source.""" - - maximum_record_age_in_seconds: int | None = None - """ - (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) - Discard records older than the specified age. The default value is -1, - which sets the maximum age to infinite. When the value is set to - infinite, Lambda never discards old records. - - Note: - The minimum valid value for maximum record age is 60s. Although values - less than 60 and greater than -1 fall within the parameter's absolute - range, they are not allowed - """ - - bisect_batch_on_function_error: bool | None = None - """ - (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) - If the function returns an error, split the batch in two and retry. The - default value is false. - """ - - maximum_retry_attempts: int | None = None - """ - (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) - Discard records after the specified number of retries. The default value - is -1, which sets the maximum number of retries to infinite. When - MaximumRetryAttempts is infinite, Lambda retries failed records until - the record expires in the event source. - """ - - tumbling_window_in_seconds: int | None = None - """ - (Kinesis and DynamoDB Streams only) The duration in seconds of a - processing window for DynamoDB and Kinesis Streams event sources. A - value of 0 seconds indicates no tumbling window. - """ - - function_response_types: list[str] | None = None - """ - (Kinesis, DynamoDB Streams, Amazon MSK, self-managed Apache Kafka, and - Amazon SQS) A list of current response type enums applied to the event - source mapping. - """ - - amazon_managed_kafka_event_source_config: ( - AmazonManagedKafkaEventSourceConfig | None - ) = None - """ - Specific configuration settings for an Amazon Managed Streaming for - Apache Kafka (Amazon MSK) event source. - """ - - self_managed_kafka_event_source_config: SelfManagedKafkaEventSourceConfig | None = ( - None - ) - """ - Specific configuration settings for a self-managed Apache Kafka event - source. - """ - - document_db_event_source_config: DocumentDBEventSourceConfig | None = None - """Specific configuration settings for a DocumentDB event source.""" - - event_source_mapping_arn: str | None = None - """The Amazon Resource Name (ARN) of the event source mapping.""" - - provisioned_poller_config: ProvisionedPollerConfig | None = None - """ - (Amazon SQS, Amazon MSK, and self-managed Apache Kafka only) The - provisioned mode configuration for the event source. For more - information, see [provisioned - mode](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html#invocation-eventsourcemapping-provisioned-mode). - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.uuid is not None: - serializer.write_string( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members["UUID"], self.uuid - ) - - if self.starting_position is not None: - serializer.write_string( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members["StartingPosition"], - self.starting_position, - ) - - if self.starting_position_timestamp is not None: - serializer.write_timestamp( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "StartingPositionTimestamp" - ], - self.starting_position_timestamp, - ) - - if self.batch_size is not None: - serializer.write_integer( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members["BatchSize"], - self.batch_size, - ) - - if self.maximum_batching_window_in_seconds is not None: - serializer.write_integer( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "MaximumBatchingWindowInSeconds" - ], - self.maximum_batching_window_in_seconds, - ) - - if self.parallelization_factor is not None: - serializer.write_integer( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "ParallelizationFactor" - ], - self.parallelization_factor, - ) - - if self.event_source_arn is not None: - serializer.write_string( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members["EventSourceArn"], - self.event_source_arn, - ) - - if self.filter_criteria is not None: - serializer.write_struct( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members["FilterCriteria"], - self.filter_criteria, - ) - - if self.filter_criteria_error is not None: - serializer.write_struct( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "FilterCriteriaError" - ], - self.filter_criteria_error, - ) - - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members["KMSKeyArn"], - self.kms_key_arn, - ) - - if self.metrics_config is not None: - serializer.write_struct( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members["MetricsConfig"], - self.metrics_config, - ) - - if self.logging_config is not None: - serializer.write_struct( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members["LoggingConfig"], - self.logging_config, - ) - - if self.scaling_config is not None: - serializer.write_struct( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members["ScalingConfig"], - self.scaling_config, - ) - - if self.function_arn is not None: - serializer.write_string( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members["FunctionArn"], - self.function_arn, - ) - - if self.last_modified is not None: - serializer.write_timestamp( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members["LastModified"], - self.last_modified, - ) - - if self.last_processing_result is not None: - serializer.write_string( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "LastProcessingResult" - ], - self.last_processing_result, - ) - - if self.state is not None: - serializer.write_string( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members["State"], self.state - ) - - if self.state_transition_reason is not None: - serializer.write_string( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "StateTransitionReason" - ], - self.state_transition_reason, - ) - - if self.destination_config is not None: - serializer.write_struct( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members["DestinationConfig"], - self.destination_config, - ) - - if self.topics is not None: - _serialize_topics( - serializer, - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members["Topics"], - self.topics, - ) - - if self.queues is not None: - _serialize_queues( - serializer, - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members["Queues"], - self.queues, - ) - - if self.source_access_configurations is not None: - _serialize_source_access_configurations( - serializer, - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "SourceAccessConfigurations" - ], - self.source_access_configurations, - ) - - if self.self_managed_event_source is not None: - serializer.write_struct( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "SelfManagedEventSource" - ], - self.self_managed_event_source, - ) - - if self.maximum_record_age_in_seconds is not None: - serializer.write_integer( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "MaximumRecordAgeInSeconds" - ], - self.maximum_record_age_in_seconds, - ) - - if self.bisect_batch_on_function_error is not None: - serializer.write_boolean( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "BisectBatchOnFunctionError" - ], - self.bisect_batch_on_function_error, - ) - - if self.maximum_retry_attempts is not None: - serializer.write_integer( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "MaximumRetryAttempts" - ], - self.maximum_retry_attempts, - ) - - if self.tumbling_window_in_seconds is not None: - serializer.write_integer( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "TumblingWindowInSeconds" - ], - self.tumbling_window_in_seconds, - ) - - if self.function_response_types is not None: - _serialize_function_response_type_list( - serializer, - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "FunctionResponseTypes" - ], - self.function_response_types, - ) - - if self.amazon_managed_kafka_event_source_config is not None: - serializer.write_struct( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "AmazonManagedKafkaEventSourceConfig" - ], - self.amazon_managed_kafka_event_source_config, - ) - - if self.self_managed_kafka_event_source_config is not None: - serializer.write_struct( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "SelfManagedKafkaEventSourceConfig" - ], - self.self_managed_kafka_event_source_config, - ) - - if self.document_db_event_source_config is not None: - serializer.write_struct( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "DocumentDBEventSourceConfig" - ], - self.document_db_event_source_config, - ) - - if self.event_source_mapping_arn is not None: - serializer.write_string( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "EventSourceMappingArn" - ], - self.event_source_mapping_arn, - ) - - if self.provisioned_poller_config is not None: - serializer.write_struct( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "ProvisionedPollerConfig" - ], - self.provisioned_poller_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["uuid"] = de.read_string( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members["UUID"] - ) - - case 1: - kwargs["starting_position"] = EventSourcePosition( - de.read_string( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "StartingPosition" - ] - ) - ) - - case 2: - kwargs["starting_position_timestamp"] = de.read_timestamp( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "StartingPositionTimestamp" - ] - ) - - case 3: - kwargs["batch_size"] = de.read_integer( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members["BatchSize"] - ) - - case 4: - kwargs["maximum_batching_window_in_seconds"] = de.read_integer( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "MaximumBatchingWindowInSeconds" - ] - ) - - case 5: - kwargs["parallelization_factor"] = de.read_integer( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "ParallelizationFactor" - ] - ) - - case 6: - kwargs["event_source_arn"] = de.read_string( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "EventSourceArn" - ] - ) - - case 7: - kwargs["filter_criteria"] = FilterCriteria.deserialize(de) - - case 8: - kwargs["filter_criteria_error"] = FilterCriteriaError.deserialize( - de - ) - - case 9: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members["KMSKeyArn"] - ) - - case 10: - kwargs["metrics_config"] = ( - EventSourceMappingMetricsConfig.deserialize(de) - ) - - case 11: - kwargs["logging_config"] = ( - EventSourceMappingLoggingConfig.deserialize(de) - ) - - case 12: - kwargs["scaling_config"] = ScalingConfig.deserialize(de) - - case 13: - kwargs["function_arn"] = de.read_string( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "FunctionArn" - ] - ) - - case 14: - kwargs["last_modified"] = de.read_timestamp( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "LastModified" - ] - ) - - case 15: - kwargs["last_processing_result"] = de.read_string( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "LastProcessingResult" - ] - ) - - case 16: - kwargs["state"] = de.read_string( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members["State"] - ) - - case 17: - kwargs["state_transition_reason"] = de.read_string( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "StateTransitionReason" - ] - ) - - case 18: - kwargs["destination_config"] = DestinationConfig.deserialize(de) - - case 19: - kwargs["topics"] = _deserialize_topics( - de, _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members["Topics"] - ) - - case 20: - kwargs["queues"] = _deserialize_queues( - de, _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members["Queues"] - ) - - case 21: - kwargs["source_access_configurations"] = ( - _deserialize_source_access_configurations( - de, - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "SourceAccessConfigurations" - ], - ) - ) - - case 22: - kwargs["self_managed_event_source"] = ( - SelfManagedEventSource.deserialize(de) - ) - - case 23: - kwargs["maximum_record_age_in_seconds"] = de.read_integer( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "MaximumRecordAgeInSeconds" - ] - ) - - case 24: - kwargs["bisect_batch_on_function_error"] = de.read_boolean( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "BisectBatchOnFunctionError" - ] - ) - - case 25: - kwargs["maximum_retry_attempts"] = de.read_integer( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "MaximumRetryAttempts" - ] - ) - - case 26: - kwargs["tumbling_window_in_seconds"] = de.read_integer( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "TumblingWindowInSeconds" - ] - ) - - case 27: - kwargs["function_response_types"] = ( - _deserialize_function_response_type_list( - de, - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "FunctionResponseTypes" - ], - ) - ) - - case 28: - kwargs["amazon_managed_kafka_event_source_config"] = ( - AmazonManagedKafkaEventSourceConfig.deserialize(de) - ) - - case 29: - kwargs["self_managed_kafka_event_source_config"] = ( - SelfManagedKafkaEventSourceConfig.deserialize(de) - ) - - case 30: - kwargs["document_db_event_source_config"] = ( - DocumentDBEventSourceConfig.deserialize(de) - ) - - case 31: - kwargs["event_source_mapping_arn"] = de.read_string( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "EventSourceMappingArn" - ] - ) - - case 32: - kwargs["provisioned_poller_config"] = ( - ProvisionedPollerConfig.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ResourceInUseException(ServiceError): - """ - The operation conflicts with the resource's availability. For example, - you tried to update an event source mapping in the CREATING state, or - you tried to delete an event source mapping currently UPDATING. - """ - - fault: Literal["client", "server"] | None = "client" - - type: str | None = None - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESOURCE_IN_USE_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_RESOURCE_IN_USE_EXCEPTION.members["Type"], self.type - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_RESOURCE_IN_USE_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_RESOURCE_IN_USE_EXCEPTION.members["Type"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_RESOURCE_IN_USE_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RESOURCE_IN_USE_EXCEPTION, consumer=_consumer) - return kwargs - - -DELETE_EVENT_SOURCE_MAPPING = APIOperation( - input=DeleteEventSourceMappingInput, - output=DeleteEventSourceMappingOutput, - schema=_SCHEMA_DELETE_EVENT_SOURCE_MAPPING, - input_schema=_SCHEMA_DELETE_EVENT_SOURCE_MAPPING_INPUT, - output_schema=_SCHEMA_DELETE_EVENT_SOURCE_MAPPING_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceConflictException" - ): ResourceConflictException, - ShapeID( - "com.amazonaws.lambda#ResourceInUseException" - ): ResourceInUseException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_IN_USE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetEventSourceMappingInput: - """Dataclass for GetEventSourceMappingInput structure.""" - - uuid: str | None = None - """The identifier of the event source mapping.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_EVENT_SOURCE_MAPPING_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.uuid is not None: - serializer.write_string( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_INPUT.members["UUID"], self.uuid - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["uuid"] = de.read_string( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_INPUT.members["UUID"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetEventSourceMappingOutput: - """ - A mapping between an Amazon Web Services resource and a Lambda function. - For details, see CreateEventSourceMapping. - """ - - uuid: str | None = None - """The identifier of the event source mapping.""" - - starting_position: str | None = None - """ - The position in a stream from which to start reading. Required for - Amazon Kinesis and Amazon DynamoDB Stream event sources. `AT_TIMESTAMP` - is supported only for Amazon Kinesis streams, Amazon DocumentDB, Amazon - MSK, and self-managed Apache Kafka. - """ - - starting_position_timestamp: datetime | None = None - """ - With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to - start reading. `StartingPositionTimestamp` cannot be in the future. - """ - - batch_size: int | None = None - """ - The maximum number of records in each batch that Lambda pulls from your - stream or queue and sends to your function. Lambda passes all of the - records in the batch to the function in a single call, up to the payload - limit for synchronous invocation (6 MB). - - Default value: Varies by service. For Amazon SQS, the default is 10. For - all other services, the default is 100. - - Related setting: When you set `BatchSize` to a value greater than 10, - you must set `MaximumBatchingWindowInSeconds` to at least 1. - """ - - maximum_batching_window_in_seconds: int | None = None - """ - The maximum amount of time, in seconds, that Lambda spends gathering - records before invoking the function. You can configure - `MaximumBatchingWindowInSeconds` to any value from 0 seconds to 300 - seconds in increments of seconds. - - For streams and Amazon SQS event sources, the default batching window is - 0 seconds. For Amazon MSK, Self-managed Apache Kafka, Amazon MQ, and - DocumentDB event sources, the default batching window is 500 ms. Note - that because you can only change `MaximumBatchingWindowInSeconds` in - increments of seconds, you cannot revert back to the 500 ms default - batching window after you have changed it. To restore the default - batching window, you must create a new event source mapping. - - Related setting: For streams and Amazon SQS event sources, when you set - `BatchSize` to a value greater than 10, you must set - `MaximumBatchingWindowInSeconds` to at least 1. - """ - - parallelization_factor: int | None = None - """ - (Kinesis and DynamoDB Streams only) The number of batches to process - concurrently from each shard. The default value is 1. - """ - - event_source_arn: str | None = None - """The Amazon Resource Name (ARN) of the event source.""" - - filter_criteria: FilterCriteria | None = None - """ - An object that defines the filter criteria that determine whether Lambda - should process an event. For more information, see [Lambda event - filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html). - - If filter criteria is encrypted, this field shows up as `null` in the - response of ListEventSourceMapping API calls. You can view this field in - plaintext in the response of GetEventSourceMapping and - DeleteEventSourceMapping calls if you have `kms:Decrypt` permissions for - the correct KMS key. - """ - - filter_criteria_error: FilterCriteriaError | None = None - """ - An object that contains details about an error related to filter - criteria encryption. - """ - - kms_key_arn: str | None = None - """ - The ARN of the Key Management Service (KMS) customer managed key that - Lambda uses to encrypt your function's [filter - criteria](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html#filtering-basics). - """ - - metrics_config: EventSourceMappingMetricsConfig | None = None - """ - The metrics configuration for your event source. For more information, - see [Event source mapping - metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics-types.html#event-source-mapping-metrics). - """ - - logging_config: EventSourceMappingLoggingConfig | None = None - """ - (Amazon MSK, and self-managed Apache Kafka only) The logging - configuration for your event source. For more information, see [Event - source mapping - logging](https://docs.aws.amazon.com/lambda/latest/dg/esm-logging.html). - """ - - scaling_config: ScalingConfig | None = None - """ - (Amazon SQS only) The scaling configuration for the event source. For - more information, see [Configuring maximum concurrency for Amazon SQS - event - sources](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-max-concurrency). - """ - - function_arn: str | None = None - """The ARN of the Lambda function.""" - - last_modified: datetime | None = None - """ - The date that the event source mapping was last updated or that its - state changed. - """ - - last_processing_result: str | None = None - """The result of the event source mapping's last processing attempt.""" - - state: str | None = None - """ - The state of the event source mapping. It can be one of the following: - `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, - or `Deleting`. - """ - - state_transition_reason: str | None = None - """ - Indicates whether a user or Lambda made the last change to the event - source mapping. - """ - - destination_config: DestinationConfig | None = None - """ - (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) A - configuration object that specifies the destination of an event after - Lambda processes it. - """ - - topics: list[str] | None = None - """The name of the Kafka topic.""" - - queues: list[str] | None = None - """ - (Amazon MQ) The name of the Amazon MQ broker destination queue to - consume. - """ - - source_access_configurations: list[SourceAccessConfiguration] | None = None - """ - An array of the authentication protocol, VPC components, or virtual host - to secure and define your event source. - """ - - self_managed_event_source: SelfManagedEventSource | None = None - """The self-managed Apache Kafka cluster for your event source.""" - - maximum_record_age_in_seconds: int | None = None - """ - (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) - Discard records older than the specified age. The default value is -1, - which sets the maximum age to infinite. When the value is set to - infinite, Lambda never discards old records. - - Note: - The minimum valid value for maximum record age is 60s. Although values - less than 60 and greater than -1 fall within the parameter's absolute - range, they are not allowed - """ - - bisect_batch_on_function_error: bool | None = None - """ - (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) - If the function returns an error, split the batch in two and retry. The - default value is false. - """ - - maximum_retry_attempts: int | None = None - """ - (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) - Discard records after the specified number of retries. The default value - is -1, which sets the maximum number of retries to infinite. When - MaximumRetryAttempts is infinite, Lambda retries failed records until - the record expires in the event source. - """ - - tumbling_window_in_seconds: int | None = None - """ - (Kinesis and DynamoDB Streams only) The duration in seconds of a - processing window for DynamoDB and Kinesis Streams event sources. A - value of 0 seconds indicates no tumbling window. - """ - - function_response_types: list[str] | None = None - """ - (Kinesis, DynamoDB Streams, Amazon MSK, self-managed Apache Kafka, and - Amazon SQS) A list of current response type enums applied to the event - source mapping. - """ - - amazon_managed_kafka_event_source_config: ( - AmazonManagedKafkaEventSourceConfig | None - ) = None - """ - Specific configuration settings for an Amazon Managed Streaming for - Apache Kafka (Amazon MSK) event source. - """ - - self_managed_kafka_event_source_config: SelfManagedKafkaEventSourceConfig | None = ( - None - ) - """ - Specific configuration settings for a self-managed Apache Kafka event - source. - """ - - document_db_event_source_config: DocumentDBEventSourceConfig | None = None - """Specific configuration settings for a DocumentDB event source.""" - - event_source_mapping_arn: str | None = None - """The Amazon Resource Name (ARN) of the event source mapping.""" - - provisioned_poller_config: ProvisionedPollerConfig | None = None - """ - (Amazon SQS, Amazon MSK, and self-managed Apache Kafka only) The - provisioned mode configuration for the event source. For more - information, see [provisioned - mode](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html#invocation-eventsourcemapping-provisioned-mode). - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.uuid is not None: - serializer.write_string( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members["UUID"], self.uuid - ) - - if self.starting_position is not None: - serializer.write_string( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members["StartingPosition"], - self.starting_position, - ) - - if self.starting_position_timestamp is not None: - serializer.write_timestamp( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "StartingPositionTimestamp" - ], - self.starting_position_timestamp, - ) - - if self.batch_size is not None: - serializer.write_integer( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members["BatchSize"], - self.batch_size, - ) - - if self.maximum_batching_window_in_seconds is not None: - serializer.write_integer( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "MaximumBatchingWindowInSeconds" - ], - self.maximum_batching_window_in_seconds, - ) - - if self.parallelization_factor is not None: - serializer.write_integer( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "ParallelizationFactor" - ], - self.parallelization_factor, - ) - - if self.event_source_arn is not None: - serializer.write_string( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members["EventSourceArn"], - self.event_source_arn, - ) - - if self.filter_criteria is not None: - serializer.write_struct( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members["FilterCriteria"], - self.filter_criteria, - ) - - if self.filter_criteria_error is not None: - serializer.write_struct( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members["FilterCriteriaError"], - self.filter_criteria_error, - ) - - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members["KMSKeyArn"], - self.kms_key_arn, - ) - - if self.metrics_config is not None: - serializer.write_struct( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members["MetricsConfig"], - self.metrics_config, - ) - - if self.logging_config is not None: - serializer.write_struct( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members["LoggingConfig"], - self.logging_config, - ) - - if self.scaling_config is not None: - serializer.write_struct( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members["ScalingConfig"], - self.scaling_config, - ) - - if self.function_arn is not None: - serializer.write_string( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members["FunctionArn"], - self.function_arn, - ) - - if self.last_modified is not None: - serializer.write_timestamp( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members["LastModified"], - self.last_modified, - ) - - if self.last_processing_result is not None: - serializer.write_string( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members["LastProcessingResult"], - self.last_processing_result, - ) - - if self.state is not None: - serializer.write_string( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members["State"], self.state - ) - - if self.state_transition_reason is not None: - serializer.write_string( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "StateTransitionReason" - ], - self.state_transition_reason, - ) - - if self.destination_config is not None: - serializer.write_struct( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members["DestinationConfig"], - self.destination_config, - ) - - if self.topics is not None: - _serialize_topics( - serializer, - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members["Topics"], - self.topics, - ) - - if self.queues is not None: - _serialize_queues( - serializer, - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members["Queues"], - self.queues, - ) - - if self.source_access_configurations is not None: - _serialize_source_access_configurations( - serializer, - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "SourceAccessConfigurations" - ], - self.source_access_configurations, - ) - - if self.self_managed_event_source is not None: - serializer.write_struct( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "SelfManagedEventSource" - ], - self.self_managed_event_source, - ) - - if self.maximum_record_age_in_seconds is not None: - serializer.write_integer( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "MaximumRecordAgeInSeconds" - ], - self.maximum_record_age_in_seconds, - ) - - if self.bisect_batch_on_function_error is not None: - serializer.write_boolean( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "BisectBatchOnFunctionError" - ], - self.bisect_batch_on_function_error, - ) - - if self.maximum_retry_attempts is not None: - serializer.write_integer( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members["MaximumRetryAttempts"], - self.maximum_retry_attempts, - ) - - if self.tumbling_window_in_seconds is not None: - serializer.write_integer( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "TumblingWindowInSeconds" - ], - self.tumbling_window_in_seconds, - ) - - if self.function_response_types is not None: - _serialize_function_response_type_list( - serializer, - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "FunctionResponseTypes" - ], - self.function_response_types, - ) - - if self.amazon_managed_kafka_event_source_config is not None: - serializer.write_struct( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "AmazonManagedKafkaEventSourceConfig" - ], - self.amazon_managed_kafka_event_source_config, - ) - - if self.self_managed_kafka_event_source_config is not None: - serializer.write_struct( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "SelfManagedKafkaEventSourceConfig" - ], - self.self_managed_kafka_event_source_config, - ) - - if self.document_db_event_source_config is not None: - serializer.write_struct( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "DocumentDBEventSourceConfig" - ], - self.document_db_event_source_config, - ) - - if self.event_source_mapping_arn is not None: - serializer.write_string( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "EventSourceMappingArn" - ], - self.event_source_mapping_arn, - ) - - if self.provisioned_poller_config is not None: - serializer.write_struct( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "ProvisionedPollerConfig" - ], - self.provisioned_poller_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["uuid"] = de.read_string( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members["UUID"] - ) - - case 1: - kwargs["starting_position"] = EventSourcePosition( - de.read_string( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "StartingPosition" - ] - ) - ) - - case 2: - kwargs["starting_position_timestamp"] = de.read_timestamp( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "StartingPositionTimestamp" - ] - ) - - case 3: - kwargs["batch_size"] = de.read_integer( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members["BatchSize"] - ) - - case 4: - kwargs["maximum_batching_window_in_seconds"] = de.read_integer( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "MaximumBatchingWindowInSeconds" - ] - ) - - case 5: - kwargs["parallelization_factor"] = de.read_integer( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "ParallelizationFactor" - ] - ) - - case 6: - kwargs["event_source_arn"] = de.read_string( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "EventSourceArn" - ] - ) - - case 7: - kwargs["filter_criteria"] = FilterCriteria.deserialize(de) - - case 8: - kwargs["filter_criteria_error"] = FilterCriteriaError.deserialize( - de - ) - - case 9: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members["KMSKeyArn"] - ) - - case 10: - kwargs["metrics_config"] = ( - EventSourceMappingMetricsConfig.deserialize(de) - ) - - case 11: - kwargs["logging_config"] = ( - EventSourceMappingLoggingConfig.deserialize(de) - ) - - case 12: - kwargs["scaling_config"] = ScalingConfig.deserialize(de) - - case 13: - kwargs["function_arn"] = de.read_string( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members["FunctionArn"] - ) - - case 14: - kwargs["last_modified"] = de.read_timestamp( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members["LastModified"] - ) - - case 15: - kwargs["last_processing_result"] = de.read_string( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "LastProcessingResult" - ] - ) - - case 16: - kwargs["state"] = de.read_string( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members["State"] - ) - - case 17: - kwargs["state_transition_reason"] = de.read_string( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "StateTransitionReason" - ] - ) - - case 18: - kwargs["destination_config"] = DestinationConfig.deserialize(de) - - case 19: - kwargs["topics"] = _deserialize_topics( - de, _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members["Topics"] - ) - - case 20: - kwargs["queues"] = _deserialize_queues( - de, _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members["Queues"] - ) - - case 21: - kwargs["source_access_configurations"] = ( - _deserialize_source_access_configurations( - de, - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "SourceAccessConfigurations" - ], - ) - ) - - case 22: - kwargs["self_managed_event_source"] = ( - SelfManagedEventSource.deserialize(de) - ) - - case 23: - kwargs["maximum_record_age_in_seconds"] = de.read_integer( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "MaximumRecordAgeInSeconds" - ] - ) - - case 24: - kwargs["bisect_batch_on_function_error"] = de.read_boolean( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "BisectBatchOnFunctionError" - ] - ) - - case 25: - kwargs["maximum_retry_attempts"] = de.read_integer( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "MaximumRetryAttempts" - ] - ) - - case 26: - kwargs["tumbling_window_in_seconds"] = de.read_integer( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "TumblingWindowInSeconds" - ] - ) - - case 27: - kwargs["function_response_types"] = ( - _deserialize_function_response_type_list( - de, - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "FunctionResponseTypes" - ], - ) - ) - - case 28: - kwargs["amazon_managed_kafka_event_source_config"] = ( - AmazonManagedKafkaEventSourceConfig.deserialize(de) - ) - - case 29: - kwargs["self_managed_kafka_event_source_config"] = ( - SelfManagedKafkaEventSourceConfig.deserialize(de) - ) - - case 30: - kwargs["document_db_event_source_config"] = ( - DocumentDBEventSourceConfig.deserialize(de) - ) - - case 31: - kwargs["event_source_mapping_arn"] = de.read_string( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "EventSourceMappingArn" - ] - ) - - case 32: - kwargs["provisioned_poller_config"] = ( - ProvisionedPollerConfig.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_EVENT_SOURCE_MAPPING = APIOperation( - input=GetEventSourceMappingInput, - output=GetEventSourceMappingOutput, - schema=_SCHEMA_GET_EVENT_SOURCE_MAPPING, - input_schema=_SCHEMA_GET_EVENT_SOURCE_MAPPING_INPUT, - output_schema=_SCHEMA_GET_EVENT_SOURCE_MAPPING_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListEventSourceMappingsInput: - """Dataclass for ListEventSourceMappingsInput structure.""" - - event_source_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the event source. - - - **Amazon Kinesis** -- The ARN of the data stream or a stream consumer. - - - **Amazon DynamoDB Streams** -- The ARN of the stream. - - - **Amazon Simple Queue Service** -- The ARN of the queue. - - - **Amazon Managed Streaming for Apache Kafka** -- The ARN of the - cluster or the ARN of the VPC connection (for [cross-account event - source - mappings](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#msk-multi-vpc)). - - - **Amazon MQ** -- The ARN of the broker. - - - **Amazon DocumentDB** -- The ARN of the DocumentDB change stream. - """ - - function_name: str | None = None - """ - The name or ARN of the Lambda function. - - **Name formats** - - - **Function name** -- `MyFunction`. - - - **Function ARN** -- - `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`. - - - **Version or Alias ARN** -- - `arn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD`. - - - **Partial ARN** -- `123456789012:function:MyFunction`. - - The length constraint applies only to the full ARN. If you specify only - the function name, it's limited to 64 characters in length. - """ - - marker: str | None = None - """A pagination token returned by a previous call.""" - - max_items: int | None = None - """ - The maximum number of event source mappings to return. Note that - ListEventSourceMappings returns a maximum of 100 items in each response, - even if you set the number higher. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_EVENT_SOURCE_MAPPINGS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.event_source_arn is not None: - serializer.write_string( - _SCHEMA_LIST_EVENT_SOURCE_MAPPINGS_INPUT.members["EventSourceArn"], - self.event_source_arn, - ) - - if self.function_name is not None: - serializer.write_string( - _SCHEMA_LIST_EVENT_SOURCE_MAPPINGS_INPUT.members["FunctionName"], - self.function_name, - ) - - if self.marker is not None: - serializer.write_string( - _SCHEMA_LIST_EVENT_SOURCE_MAPPINGS_INPUT.members["Marker"], self.marker - ) - - if self.max_items is not None: - serializer.write_integer( - _SCHEMA_LIST_EVENT_SOURCE_MAPPINGS_INPUT.members["MaxItems"], - self.max_items, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["event_source_arn"] = de.read_string( - _SCHEMA_LIST_EVENT_SOURCE_MAPPINGS_INPUT.members[ - "EventSourceArn" - ] - ) - - case 1: - kwargs["function_name"] = de.read_string( - _SCHEMA_LIST_EVENT_SOURCE_MAPPINGS_INPUT.members["FunctionName"] - ) - - case 2: - kwargs["marker"] = de.read_string( - _SCHEMA_LIST_EVENT_SOURCE_MAPPINGS_INPUT.members["Marker"] - ) - - case 3: - kwargs["max_items"] = de.read_integer( - _SCHEMA_LIST_EVENT_SOURCE_MAPPINGS_INPUT.members["MaxItems"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_EVENT_SOURCE_MAPPINGS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class EventSourceMappingConfiguration: - """ - A mapping between an Amazon Web Services resource and a Lambda function. - For details, see CreateEventSourceMapping. - """ - - uuid: str | None = None - """The identifier of the event source mapping.""" - - starting_position: str | None = None - """ - The position in a stream from which to start reading. Required for - Amazon Kinesis and Amazon DynamoDB Stream event sources. `AT_TIMESTAMP` - is supported only for Amazon Kinesis streams, Amazon DocumentDB, Amazon - MSK, and self-managed Apache Kafka. - """ - - starting_position_timestamp: datetime | None = None - """ - With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to - start reading. `StartingPositionTimestamp` cannot be in the future. - """ - - batch_size: int | None = None - """ - The maximum number of records in each batch that Lambda pulls from your - stream or queue and sends to your function. Lambda passes all of the - records in the batch to the function in a single call, up to the payload - limit for synchronous invocation (6 MB). - - Default value: Varies by service. For Amazon SQS, the default is 10. For - all other services, the default is 100. - - Related setting: When you set `BatchSize` to a value greater than 10, - you must set `MaximumBatchingWindowInSeconds` to at least 1. - """ - - maximum_batching_window_in_seconds: int | None = None - """ - The maximum amount of time, in seconds, that Lambda spends gathering - records before invoking the function. You can configure - `MaximumBatchingWindowInSeconds` to any value from 0 seconds to 300 - seconds in increments of seconds. - - For streams and Amazon SQS event sources, the default batching window is - 0 seconds. For Amazon MSK, Self-managed Apache Kafka, Amazon MQ, and - DocumentDB event sources, the default batching window is 500 ms. Note - that because you can only change `MaximumBatchingWindowInSeconds` in - increments of seconds, you cannot revert back to the 500 ms default - batching window after you have changed it. To restore the default - batching window, you must create a new event source mapping. - - Related setting: For streams and Amazon SQS event sources, when you set - `BatchSize` to a value greater than 10, you must set - `MaximumBatchingWindowInSeconds` to at least 1. - """ - - parallelization_factor: int | None = None - """ - (Kinesis and DynamoDB Streams only) The number of batches to process - concurrently from each shard. The default value is 1. - """ - - event_source_arn: str | None = None - """The Amazon Resource Name (ARN) of the event source.""" - - filter_criteria: FilterCriteria | None = None - """ - An object that defines the filter criteria that determine whether Lambda - should process an event. For more information, see [Lambda event - filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html). - - If filter criteria is encrypted, this field shows up as `null` in the - response of ListEventSourceMapping API calls. You can view this field in - plaintext in the response of GetEventSourceMapping and - DeleteEventSourceMapping calls if you have `kms:Decrypt` permissions for - the correct KMS key. - """ - - filter_criteria_error: FilterCriteriaError | None = None - """ - An object that contains details about an error related to filter - criteria encryption. - """ - - kms_key_arn: str | None = None - """ - The ARN of the Key Management Service (KMS) customer managed key that - Lambda uses to encrypt your function's [filter - criteria](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html#filtering-basics). - """ - - metrics_config: EventSourceMappingMetricsConfig | None = None - """ - The metrics configuration for your event source. For more information, - see [Event source mapping - metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics-types.html#event-source-mapping-metrics). - """ - - logging_config: EventSourceMappingLoggingConfig | None = None - """ - (Amazon MSK, and self-managed Apache Kafka only) The logging - configuration for your event source. For more information, see [Event - source mapping - logging](https://docs.aws.amazon.com/lambda/latest/dg/esm-logging.html). - """ - - scaling_config: ScalingConfig | None = None - """ - (Amazon SQS only) The scaling configuration for the event source. For - more information, see [Configuring maximum concurrency for Amazon SQS - event - sources](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-max-concurrency). - """ - - function_arn: str | None = None - """The ARN of the Lambda function.""" - - last_modified: datetime | None = None - """ - The date that the event source mapping was last updated or that its - state changed. - """ - - last_processing_result: str | None = None - """The result of the event source mapping's last processing attempt.""" - - state: str | None = None - """ - The state of the event source mapping. It can be one of the following: - `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, - or `Deleting`. - """ - - state_transition_reason: str | None = None - """ - Indicates whether a user or Lambda made the last change to the event - source mapping. - """ - - destination_config: DestinationConfig | None = None - """ - (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) A - configuration object that specifies the destination of an event after - Lambda processes it. - """ - - topics: list[str] | None = None - """The name of the Kafka topic.""" - - queues: list[str] | None = None - """ - (Amazon MQ) The name of the Amazon MQ broker destination queue to - consume. - """ - - source_access_configurations: list[SourceAccessConfiguration] | None = None - """ - An array of the authentication protocol, VPC components, or virtual host - to secure and define your event source. - """ - - self_managed_event_source: SelfManagedEventSource | None = None - """The self-managed Apache Kafka cluster for your event source.""" - - maximum_record_age_in_seconds: int | None = None - """ - (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) - Discard records older than the specified age. The default value is -1, - which sets the maximum age to infinite. When the value is set to - infinite, Lambda never discards old records. - - Note: - The minimum valid value for maximum record age is 60s. Although values - less than 60 and greater than -1 fall within the parameter's absolute - range, they are not allowed - """ - - bisect_batch_on_function_error: bool | None = None - """ - (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) - If the function returns an error, split the batch in two and retry. The - default value is false. - """ - - maximum_retry_attempts: int | None = None - """ - (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) - Discard records after the specified number of retries. The default value - is -1, which sets the maximum number of retries to infinite. When - MaximumRetryAttempts is infinite, Lambda retries failed records until - the record expires in the event source. - """ - - tumbling_window_in_seconds: int | None = None - """ - (Kinesis and DynamoDB Streams only) The duration in seconds of a - processing window for DynamoDB and Kinesis Streams event sources. A - value of 0 seconds indicates no tumbling window. - """ - - function_response_types: list[str] | None = None - """ - (Kinesis, DynamoDB Streams, Amazon MSK, self-managed Apache Kafka, and - Amazon SQS) A list of current response type enums applied to the event - source mapping. - """ - - amazon_managed_kafka_event_source_config: ( - AmazonManagedKafkaEventSourceConfig | None - ) = None - """ - Specific configuration settings for an Amazon Managed Streaming for - Apache Kafka (Amazon MSK) event source. - """ - - self_managed_kafka_event_source_config: SelfManagedKafkaEventSourceConfig | None = ( - None - ) - """ - Specific configuration settings for a self-managed Apache Kafka event - source. - """ - - document_db_event_source_config: DocumentDBEventSourceConfig | None = None - """Specific configuration settings for a DocumentDB event source.""" - - event_source_mapping_arn: str | None = None - """The Amazon Resource Name (ARN) of the event source mapping.""" - - provisioned_poller_config: ProvisionedPollerConfig | None = None - """ - (Amazon SQS, Amazon MSK, and self-managed Apache Kafka only) The - provisioned mode configuration for the event source. For more - information, see [provisioned - mode](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html#invocation-eventsourcemapping-provisioned-mode). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.uuid is not None: - serializer.write_string( - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members["UUID"], self.uuid - ) - - if self.starting_position is not None: - serializer.write_string( - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members["StartingPosition"], - self.starting_position, - ) - - if self.starting_position_timestamp is not None: - serializer.write_timestamp( - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members[ - "StartingPositionTimestamp" - ], - self.starting_position_timestamp, - ) - - if self.batch_size is not None: - serializer.write_integer( - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members["BatchSize"], - self.batch_size, - ) - - if self.maximum_batching_window_in_seconds is not None: - serializer.write_integer( - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members[ - "MaximumBatchingWindowInSeconds" - ], - self.maximum_batching_window_in_seconds, - ) - - if self.parallelization_factor is not None: - serializer.write_integer( - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members[ - "ParallelizationFactor" - ], - self.parallelization_factor, - ) - - if self.event_source_arn is not None: - serializer.write_string( - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members["EventSourceArn"], - self.event_source_arn, - ) - - if self.filter_criteria is not None: - serializer.write_struct( - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members["FilterCriteria"], - self.filter_criteria, - ) - - if self.filter_criteria_error is not None: - serializer.write_struct( - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members[ - "FilterCriteriaError" - ], - self.filter_criteria_error, - ) - - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members["KMSKeyArn"], - self.kms_key_arn, - ) - - if self.metrics_config is not None: - serializer.write_struct( - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members["MetricsConfig"], - self.metrics_config, - ) - - if self.logging_config is not None: - serializer.write_struct( - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members["LoggingConfig"], - self.logging_config, - ) - - if self.scaling_config is not None: - serializer.write_struct( - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members["ScalingConfig"], - self.scaling_config, - ) - - if self.function_arn is not None: - serializer.write_string( - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members["FunctionArn"], - self.function_arn, - ) - - if self.last_modified is not None: - serializer.write_timestamp( - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members["LastModified"], - self.last_modified, - ) - - if self.last_processing_result is not None: - serializer.write_string( - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members[ - "LastProcessingResult" - ], - self.last_processing_result, - ) - - if self.state is not None: - serializer.write_string( - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members["State"], self.state - ) - - if self.state_transition_reason is not None: - serializer.write_string( - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members[ - "StateTransitionReason" - ], - self.state_transition_reason, - ) - - if self.destination_config is not None: - serializer.write_struct( - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members["DestinationConfig"], - self.destination_config, - ) - - if self.topics is not None: - _serialize_topics( - serializer, - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members["Topics"], - self.topics, - ) - - if self.queues is not None: - _serialize_queues( - serializer, - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members["Queues"], - self.queues, - ) - - if self.source_access_configurations is not None: - _serialize_source_access_configurations( - serializer, - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members[ - "SourceAccessConfigurations" - ], - self.source_access_configurations, - ) - - if self.self_managed_event_source is not None: - serializer.write_struct( - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members[ - "SelfManagedEventSource" - ], - self.self_managed_event_source, - ) - - if self.maximum_record_age_in_seconds is not None: - serializer.write_integer( - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members[ - "MaximumRecordAgeInSeconds" - ], - self.maximum_record_age_in_seconds, - ) - - if self.bisect_batch_on_function_error is not None: - serializer.write_boolean( - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members[ - "BisectBatchOnFunctionError" - ], - self.bisect_batch_on_function_error, - ) - - if self.maximum_retry_attempts is not None: - serializer.write_integer( - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members[ - "MaximumRetryAttempts" - ], - self.maximum_retry_attempts, - ) - - if self.tumbling_window_in_seconds is not None: - serializer.write_integer( - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members[ - "TumblingWindowInSeconds" - ], - self.tumbling_window_in_seconds, - ) - - if self.function_response_types is not None: - _serialize_function_response_type_list( - serializer, - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members[ - "FunctionResponseTypes" - ], - self.function_response_types, - ) - - if self.amazon_managed_kafka_event_source_config is not None: - serializer.write_struct( - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members[ - "AmazonManagedKafkaEventSourceConfig" - ], - self.amazon_managed_kafka_event_source_config, - ) - - if self.self_managed_kafka_event_source_config is not None: - serializer.write_struct( - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members[ - "SelfManagedKafkaEventSourceConfig" - ], - self.self_managed_kafka_event_source_config, - ) - - if self.document_db_event_source_config is not None: - serializer.write_struct( - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members[ - "DocumentDBEventSourceConfig" - ], - self.document_db_event_source_config, - ) - - if self.event_source_mapping_arn is not None: - serializer.write_string( - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members[ - "EventSourceMappingArn" - ], - self.event_source_mapping_arn, - ) - - if self.provisioned_poller_config is not None: - serializer.write_struct( - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members[ - "ProvisionedPollerConfig" - ], - self.provisioned_poller_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["uuid"] = de.read_string( - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members["UUID"] - ) - - case 1: - kwargs["starting_position"] = EventSourcePosition( - de.read_string( - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members[ - "StartingPosition" - ] - ) - ) - - case 2: - kwargs["starting_position_timestamp"] = de.read_timestamp( - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members[ - "StartingPositionTimestamp" - ] - ) - - case 3: - kwargs["batch_size"] = de.read_integer( - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members["BatchSize"] - ) - - case 4: - kwargs["maximum_batching_window_in_seconds"] = de.read_integer( - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members[ - "MaximumBatchingWindowInSeconds" - ] - ) - - case 5: - kwargs["parallelization_factor"] = de.read_integer( - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members[ - "ParallelizationFactor" - ] - ) - - case 6: - kwargs["event_source_arn"] = de.read_string( - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members[ - "EventSourceArn" - ] - ) - - case 7: - kwargs["filter_criteria"] = FilterCriteria.deserialize(de) - - case 8: - kwargs["filter_criteria_error"] = FilterCriteriaError.deserialize( - de - ) - - case 9: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members["KMSKeyArn"] - ) - - case 10: - kwargs["metrics_config"] = ( - EventSourceMappingMetricsConfig.deserialize(de) - ) - - case 11: - kwargs["logging_config"] = ( - EventSourceMappingLoggingConfig.deserialize(de) - ) - - case 12: - kwargs["scaling_config"] = ScalingConfig.deserialize(de) - - case 13: - kwargs["function_arn"] = de.read_string( - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members[ - "FunctionArn" - ] - ) - - case 14: - kwargs["last_modified"] = de.read_timestamp( - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members[ - "LastModified" - ] - ) - - case 15: - kwargs["last_processing_result"] = de.read_string( - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members[ - "LastProcessingResult" - ] - ) - - case 16: - kwargs["state"] = de.read_string( - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members["State"] - ) - - case 17: - kwargs["state_transition_reason"] = de.read_string( - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members[ - "StateTransitionReason" - ] - ) - - case 18: - kwargs["destination_config"] = DestinationConfig.deserialize(de) - - case 19: - kwargs["topics"] = _deserialize_topics( - de, _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members["Topics"] - ) - - case 20: - kwargs["queues"] = _deserialize_queues( - de, _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members["Queues"] - ) - - case 21: - kwargs["source_access_configurations"] = ( - _deserialize_source_access_configurations( - de, - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members[ - "SourceAccessConfigurations" - ], - ) - ) - - case 22: - kwargs["self_managed_event_source"] = ( - SelfManagedEventSource.deserialize(de) - ) - - case 23: - kwargs["maximum_record_age_in_seconds"] = de.read_integer( - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members[ - "MaximumRecordAgeInSeconds" - ] - ) - - case 24: - kwargs["bisect_batch_on_function_error"] = de.read_boolean( - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members[ - "BisectBatchOnFunctionError" - ] - ) - - case 25: - kwargs["maximum_retry_attempts"] = de.read_integer( - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members[ - "MaximumRetryAttempts" - ] - ) - - case 26: - kwargs["tumbling_window_in_seconds"] = de.read_integer( - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members[ - "TumblingWindowInSeconds" - ] - ) - - case 27: - kwargs["function_response_types"] = ( - _deserialize_function_response_type_list( - de, - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members[ - "FunctionResponseTypes" - ], - ) - ) - - case 28: - kwargs["amazon_managed_kafka_event_source_config"] = ( - AmazonManagedKafkaEventSourceConfig.deserialize(de) - ) - - case 29: - kwargs["self_managed_kafka_event_source_config"] = ( - SelfManagedKafkaEventSourceConfig.deserialize(de) - ) - - case 30: - kwargs["document_db_event_source_config"] = ( - DocumentDBEventSourceConfig.deserialize(de) - ) - - case 31: - kwargs["event_source_mapping_arn"] = de.read_string( - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION.members[ - "EventSourceMappingArn" - ] - ) - - case 32: - kwargs["provisioned_poller_config"] = ( - ProvisionedPollerConfig.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EVENT_SOURCE_MAPPING_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -def _serialize_event_source_mappings_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[EventSourceMappingConfiguration], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_event_source_mappings_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[EventSourceMappingConfiguration]: - result: list[EventSourceMappingConfiguration] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(EventSourceMappingConfiguration.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListEventSourceMappingsOutput: - """Dataclass for ListEventSourceMappingsOutput structure.""" - - next_marker: str | None = None - """ - A pagination token that's returned when the response doesn't contain - all event source mappings. - """ - - event_source_mappings: list[EventSourceMappingConfiguration] | None = None - """A list of event source mappings.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_EVENT_SOURCE_MAPPINGS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_marker is not None: - serializer.write_string( - _SCHEMA_LIST_EVENT_SOURCE_MAPPINGS_OUTPUT.members["NextMarker"], - self.next_marker, - ) - - if self.event_source_mappings is not None: - _serialize_event_source_mappings_list( - serializer, - _SCHEMA_LIST_EVENT_SOURCE_MAPPINGS_OUTPUT.members[ - "EventSourceMappings" - ], - self.event_source_mappings, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_marker"] = de.read_string( - _SCHEMA_LIST_EVENT_SOURCE_MAPPINGS_OUTPUT.members["NextMarker"] - ) - - case 1: - kwargs["event_source_mappings"] = ( - _deserialize_event_source_mappings_list( - de, - _SCHEMA_LIST_EVENT_SOURCE_MAPPINGS_OUTPUT.members[ - "EventSourceMappings" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_EVENT_SOURCE_MAPPINGS_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_EVENT_SOURCE_MAPPINGS = APIOperation( - input=ListEventSourceMappingsInput, - output=ListEventSourceMappingsOutput, - schema=_SCHEMA_LIST_EVENT_SOURCE_MAPPINGS, - input_schema=_SCHEMA_LIST_EVENT_SOURCE_MAPPINGS_INPUT, - output_schema=_SCHEMA_LIST_EVENT_SOURCE_MAPPINGS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateEventSourceMappingInput: - """Dataclass for UpdateEventSourceMappingInput structure.""" - - uuid: str | None = None - """The identifier of the event source mapping.""" - - function_name: str | None = None - """ - The name or ARN of the Lambda function. - - **Name formats** - - - **Function name** -- `MyFunction`. - - - **Function ARN** -- - `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`. - - - **Version or Alias ARN** -- - `arn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD`. - - - **Partial ARN** -- `123456789012:function:MyFunction`. - - The length constraint applies only to the full ARN. If you specify only - the function name, it's limited to 64 characters in length. - """ - - enabled: bool | None = None - """ - When true, the event source mapping is active. When false, Lambda pauses - polling and invocation. - - Default: True - """ - - batch_size: int | None = None - """ - The maximum number of records in each batch that Lambda pulls from your - stream or queue and sends to your function. Lambda passes all of the - records in the batch to the function in a single call, up to the payload - limit for synchronous invocation (6 MB). - - - **Amazon Kinesis** -- Default 100. Max 10,000. - - - **Amazon DynamoDB Streams** -- Default 100. Max 10,000. - - - **Amazon Simple Queue Service** -- Default 10. For standard queues the - max is 10,000. For FIFO queues the max is 10. - - - **Amazon Managed Streaming for Apache Kafka** -- Default 100. Max - 10,000. - - - **Self-managed Apache Kafka** -- Default 100. Max 10,000. - - - **Amazon MQ (ActiveMQ and RabbitMQ)** -- Default 100. Max 10,000. - - - **DocumentDB** -- Default 100. Max 10,000. - """ - - filter_criteria: FilterCriteria | None = None - """ - An object that defines the filter criteria that determine whether Lambda - should process an event. For more information, see [Lambda event - filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html). - """ - - kms_key_arn: str | None = None - """ - The ARN of the Key Management Service (KMS) customer managed key that - Lambda uses to encrypt your function's [filter - criteria](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html#filtering-basics). - By default, Lambda does not encrypt your filter criteria object. Specify - this property to encrypt data using your own customer managed key. - """ - - metrics_config: EventSourceMappingMetricsConfig | None = None - """ - The metrics configuration for your event source. For more information, - see [Event source mapping - metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics-types.html#event-source-mapping-metrics). - """ - - logging_config: EventSourceMappingLoggingConfig | None = None - """ - (Amazon MSK, and self-managed Apache Kafka only) The logging - configuration for your event source. Use this configuration object to - define the level of logs for your event source mapping. - """ - - scaling_config: ScalingConfig | None = None - """ - (Amazon SQS only) The scaling configuration for the event source. For - more information, see [Configuring maximum concurrency for Amazon SQS - event - sources](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-max-concurrency). - """ - - maximum_batching_window_in_seconds: int | None = None - """ - The maximum amount of time, in seconds, that Lambda spends gathering - records before invoking the function. You can configure - `MaximumBatchingWindowInSeconds` to any value from 0 seconds to 300 - seconds in increments of seconds. - - For Kinesis, DynamoDB, and Amazon SQS event sources, the default - batching window is 0 seconds. For Amazon MSK, Self-managed Apache Kafka, - Amazon MQ, and DocumentDB event sources, the default batching window is - 500 ms. Note that because you can only change - `MaximumBatchingWindowInSeconds` in increments of seconds, you cannot - revert back to the 500 ms default batching window after you have changed - it. To restore the default batching window, you must create a new event - source mapping. - - Related setting: For Kinesis, DynamoDB, and Amazon SQS event sources, - when you set `BatchSize` to a value greater than 10, you must set - `MaximumBatchingWindowInSeconds` to at least 1. - """ - - parallelization_factor: int | None = None - """ - (Kinesis and DynamoDB Streams only) The number of batches to process - from each shard concurrently. - """ - - destination_config: DestinationConfig | None = None - """ - (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) A - configuration object that specifies the destination of an event after - Lambda processes it. - """ - - maximum_record_age_in_seconds: int | None = None - """ - (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) - Discard records older than the specified age. The default value is - infinite (-1). - """ - - bisect_batch_on_function_error: bool | None = None - """ - (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) - If the function returns an error, split the batch in two and retry. - """ - - maximum_retry_attempts: int | None = None - """ - (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) - Discard records after the specified number of retries. The default value - is infinite (-1). When set to infinite (-1), failed records are retried - until the record expires. - """ - - tumbling_window_in_seconds: int | None = None - """ - (Kinesis and DynamoDB Streams only) The duration in seconds of a - processing window for DynamoDB and Kinesis Streams event sources. A - value of 0 seconds indicates no tumbling window. - """ - - source_access_configurations: list[SourceAccessConfiguration] | None = None - """ - An array of authentication protocols or VPC components required to - secure your event source. - """ - - function_response_types: list[str] | None = None - """ - (Kinesis, DynamoDB Streams, Amazon MSK, self-managed Apache Kafka, and - Amazon SQS) A list of current response type enums applied to the event - source mapping. - """ - - amazon_managed_kafka_event_source_config: ( - AmazonManagedKafkaEventSourceConfig | None - ) = None - """ - Specific configuration settings for an Amazon Managed Streaming for - Apache Kafka (Amazon MSK) event source. - """ - - self_managed_kafka_event_source_config: SelfManagedKafkaEventSourceConfig | None = ( - None - ) - """ - Specific configuration settings for a self-managed Apache Kafka event - source. - """ - - document_db_event_source_config: DocumentDBEventSourceConfig | None = None - """Specific configuration settings for a DocumentDB event source.""" - - provisioned_poller_config: ProvisionedPollerConfig | None = None - """ - (Amazon SQS, Amazon MSK, and self-managed Apache Kafka only) The - provisioned mode configuration for the event source. For more - information, see [provisioned - mode](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html#invocation-eventsourcemapping-provisioned-mode). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.uuid is not None: - serializer.write_string( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_INPUT.members["UUID"], self.uuid - ) - - if self.function_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_INPUT.members["FunctionName"], - self.function_name, - ) - - if self.enabled is not None: - serializer.write_boolean( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_INPUT.members["Enabled"], - self.enabled, - ) - - if self.batch_size is not None: - serializer.write_integer( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_INPUT.members["BatchSize"], - self.batch_size, - ) - - if self.filter_criteria is not None: - serializer.write_struct( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_INPUT.members["FilterCriteria"], - self.filter_criteria, - ) - - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_INPUT.members["KMSKeyArn"], - self.kms_key_arn, - ) - - if self.metrics_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_INPUT.members["MetricsConfig"], - self.metrics_config, - ) - - if self.logging_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_INPUT.members["LoggingConfig"], - self.logging_config, - ) - - if self.scaling_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_INPUT.members["ScalingConfig"], - self.scaling_config, - ) - - if self.maximum_batching_window_in_seconds is not None: - serializer.write_integer( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_INPUT.members[ - "MaximumBatchingWindowInSeconds" - ], - self.maximum_batching_window_in_seconds, - ) - - if self.parallelization_factor is not None: - serializer.write_integer( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_INPUT.members[ - "ParallelizationFactor" - ], - self.parallelization_factor, - ) - - if self.destination_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_INPUT.members["DestinationConfig"], - self.destination_config, - ) - - if self.maximum_record_age_in_seconds is not None: - serializer.write_integer( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_INPUT.members[ - "MaximumRecordAgeInSeconds" - ], - self.maximum_record_age_in_seconds, - ) - - if self.bisect_batch_on_function_error is not None: - serializer.write_boolean( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_INPUT.members[ - "BisectBatchOnFunctionError" - ], - self.bisect_batch_on_function_error, - ) - - if self.maximum_retry_attempts is not None: - serializer.write_integer( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_INPUT.members[ - "MaximumRetryAttempts" - ], - self.maximum_retry_attempts, - ) - - if self.tumbling_window_in_seconds is not None: - serializer.write_integer( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_INPUT.members[ - "TumblingWindowInSeconds" - ], - self.tumbling_window_in_seconds, - ) - - if self.source_access_configurations is not None: - _serialize_source_access_configurations( - serializer, - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_INPUT.members[ - "SourceAccessConfigurations" - ], - self.source_access_configurations, - ) - - if self.function_response_types is not None: - _serialize_function_response_type_list( - serializer, - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_INPUT.members[ - "FunctionResponseTypes" - ], - self.function_response_types, - ) - - if self.amazon_managed_kafka_event_source_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_INPUT.members[ - "AmazonManagedKafkaEventSourceConfig" - ], - self.amazon_managed_kafka_event_source_config, - ) - - if self.self_managed_kafka_event_source_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_INPUT.members[ - "SelfManagedKafkaEventSourceConfig" - ], - self.self_managed_kafka_event_source_config, - ) - - if self.document_db_event_source_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_INPUT.members[ - "DocumentDBEventSourceConfig" - ], - self.document_db_event_source_config, - ) - - if self.provisioned_poller_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_INPUT.members[ - "ProvisionedPollerConfig" - ], - self.provisioned_poller_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["uuid"] = de.read_string( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_INPUT.members["UUID"] - ) - - case 1: - kwargs["function_name"] = de.read_string( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_INPUT.members[ - "FunctionName" - ] - ) - - case 2: - kwargs["enabled"] = de.read_boolean( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_INPUT.members["Enabled"] - ) - - case 3: - kwargs["batch_size"] = de.read_integer( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_INPUT.members["BatchSize"] - ) - - case 4: - kwargs["filter_criteria"] = FilterCriteria.deserialize(de) - - case 5: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_INPUT.members["KMSKeyArn"] - ) - - case 6: - kwargs["metrics_config"] = ( - EventSourceMappingMetricsConfig.deserialize(de) - ) - - case 7: - kwargs["logging_config"] = ( - EventSourceMappingLoggingConfig.deserialize(de) - ) - - case 8: - kwargs["scaling_config"] = ScalingConfig.deserialize(de) - - case 9: - kwargs["maximum_batching_window_in_seconds"] = de.read_integer( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_INPUT.members[ - "MaximumBatchingWindowInSeconds" - ] - ) - - case 10: - kwargs["parallelization_factor"] = de.read_integer( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_INPUT.members[ - "ParallelizationFactor" - ] - ) - - case 11: - kwargs["destination_config"] = DestinationConfig.deserialize(de) - - case 12: - kwargs["maximum_record_age_in_seconds"] = de.read_integer( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_INPUT.members[ - "MaximumRecordAgeInSeconds" - ] - ) - - case 13: - kwargs["bisect_batch_on_function_error"] = de.read_boolean( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_INPUT.members[ - "BisectBatchOnFunctionError" - ] - ) - - case 14: - kwargs["maximum_retry_attempts"] = de.read_integer( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_INPUT.members[ - "MaximumRetryAttempts" - ] - ) - - case 15: - kwargs["tumbling_window_in_seconds"] = de.read_integer( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_INPUT.members[ - "TumblingWindowInSeconds" - ] - ) - - case 16: - kwargs["source_access_configurations"] = ( - _deserialize_source_access_configurations( - de, - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_INPUT.members[ - "SourceAccessConfigurations" - ], - ) - ) - - case 17: - kwargs["function_response_types"] = ( - _deserialize_function_response_type_list( - de, - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_INPUT.members[ - "FunctionResponseTypes" - ], - ) - ) - - case 18: - kwargs["amazon_managed_kafka_event_source_config"] = ( - AmazonManagedKafkaEventSourceConfig.deserialize(de) - ) - - case 19: - kwargs["self_managed_kafka_event_source_config"] = ( - SelfManagedKafkaEventSourceConfig.deserialize(de) - ) - - case 20: - kwargs["document_db_event_source_config"] = ( - DocumentDBEventSourceConfig.deserialize(de) - ) - - case 21: - kwargs["provisioned_poller_config"] = ( - ProvisionedPollerConfig.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateEventSourceMappingOutput: - """ - A mapping between an Amazon Web Services resource and a Lambda function. - For details, see CreateEventSourceMapping. - """ - - uuid: str | None = None - """The identifier of the event source mapping.""" - - starting_position: str | None = None - """ - The position in a stream from which to start reading. Required for - Amazon Kinesis and Amazon DynamoDB Stream event sources. `AT_TIMESTAMP` - is supported only for Amazon Kinesis streams, Amazon DocumentDB, Amazon - MSK, and self-managed Apache Kafka. - """ - - starting_position_timestamp: datetime | None = None - """ - With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to - start reading. `StartingPositionTimestamp` cannot be in the future. - """ - - batch_size: int | None = None - """ - The maximum number of records in each batch that Lambda pulls from your - stream or queue and sends to your function. Lambda passes all of the - records in the batch to the function in a single call, up to the payload - limit for synchronous invocation (6 MB). - - Default value: Varies by service. For Amazon SQS, the default is 10. For - all other services, the default is 100. - - Related setting: When you set `BatchSize` to a value greater than 10, - you must set `MaximumBatchingWindowInSeconds` to at least 1. - """ - - maximum_batching_window_in_seconds: int | None = None - """ - The maximum amount of time, in seconds, that Lambda spends gathering - records before invoking the function. You can configure - `MaximumBatchingWindowInSeconds` to any value from 0 seconds to 300 - seconds in increments of seconds. - - For streams and Amazon SQS event sources, the default batching window is - 0 seconds. For Amazon MSK, Self-managed Apache Kafka, Amazon MQ, and - DocumentDB event sources, the default batching window is 500 ms. Note - that because you can only change `MaximumBatchingWindowInSeconds` in - increments of seconds, you cannot revert back to the 500 ms default - batching window after you have changed it. To restore the default - batching window, you must create a new event source mapping. - - Related setting: For streams and Amazon SQS event sources, when you set - `BatchSize` to a value greater than 10, you must set - `MaximumBatchingWindowInSeconds` to at least 1. - """ - - parallelization_factor: int | None = None - """ - (Kinesis and DynamoDB Streams only) The number of batches to process - concurrently from each shard. The default value is 1. - """ - - event_source_arn: str | None = None - """The Amazon Resource Name (ARN) of the event source.""" - - filter_criteria: FilterCriteria | None = None - """ - An object that defines the filter criteria that determine whether Lambda - should process an event. For more information, see [Lambda event - filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html). - - If filter criteria is encrypted, this field shows up as `null` in the - response of ListEventSourceMapping API calls. You can view this field in - plaintext in the response of GetEventSourceMapping and - DeleteEventSourceMapping calls if you have `kms:Decrypt` permissions for - the correct KMS key. - """ - - filter_criteria_error: FilterCriteriaError | None = None - """ - An object that contains details about an error related to filter - criteria encryption. - """ - - kms_key_arn: str | None = None - """ - The ARN of the Key Management Service (KMS) customer managed key that - Lambda uses to encrypt your function's [filter - criteria](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html#filtering-basics). - """ - - metrics_config: EventSourceMappingMetricsConfig | None = None - """ - The metrics configuration for your event source. For more information, - see [Event source mapping - metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics-types.html#event-source-mapping-metrics). - """ - - logging_config: EventSourceMappingLoggingConfig | None = None - """ - (Amazon MSK, and self-managed Apache Kafka only) The logging - configuration for your event source. For more information, see [Event - source mapping - logging](https://docs.aws.amazon.com/lambda/latest/dg/esm-logging.html). - """ - - scaling_config: ScalingConfig | None = None - """ - (Amazon SQS only) The scaling configuration for the event source. For - more information, see [Configuring maximum concurrency for Amazon SQS - event - sources](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-max-concurrency). - """ - - function_arn: str | None = None - """The ARN of the Lambda function.""" - - last_modified: datetime | None = None - """ - The date that the event source mapping was last updated or that its - state changed. - """ - - last_processing_result: str | None = None - """The result of the event source mapping's last processing attempt.""" - - state: str | None = None - """ - The state of the event source mapping. It can be one of the following: - `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, - or `Deleting`. - """ - - state_transition_reason: str | None = None - """ - Indicates whether a user or Lambda made the last change to the event - source mapping. - """ - - destination_config: DestinationConfig | None = None - """ - (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) A - configuration object that specifies the destination of an event after - Lambda processes it. - """ - - topics: list[str] | None = None - """The name of the Kafka topic.""" - - queues: list[str] | None = None - """ - (Amazon MQ) The name of the Amazon MQ broker destination queue to - consume. - """ - - source_access_configurations: list[SourceAccessConfiguration] | None = None - """ - An array of the authentication protocol, VPC components, or virtual host - to secure and define your event source. - """ - - self_managed_event_source: SelfManagedEventSource | None = None - """The self-managed Apache Kafka cluster for your event source.""" - - maximum_record_age_in_seconds: int | None = None - """ - (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) - Discard records older than the specified age. The default value is -1, - which sets the maximum age to infinite. When the value is set to - infinite, Lambda never discards old records. - - Note: - The minimum valid value for maximum record age is 60s. Although values - less than 60 and greater than -1 fall within the parameter's absolute - range, they are not allowed - """ - - bisect_batch_on_function_error: bool | None = None - """ - (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) - If the function returns an error, split the batch in two and retry. The - default value is false. - """ - - maximum_retry_attempts: int | None = None - """ - (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) - Discard records after the specified number of retries. The default value - is -1, which sets the maximum number of retries to infinite. When - MaximumRetryAttempts is infinite, Lambda retries failed records until - the record expires in the event source. - """ - - tumbling_window_in_seconds: int | None = None - """ - (Kinesis and DynamoDB Streams only) The duration in seconds of a - processing window for DynamoDB and Kinesis Streams event sources. A - value of 0 seconds indicates no tumbling window. - """ - - function_response_types: list[str] | None = None - """ - (Kinesis, DynamoDB Streams, Amazon MSK, self-managed Apache Kafka, and - Amazon SQS) A list of current response type enums applied to the event - source mapping. - """ - - amazon_managed_kafka_event_source_config: ( - AmazonManagedKafkaEventSourceConfig | None - ) = None - """ - Specific configuration settings for an Amazon Managed Streaming for - Apache Kafka (Amazon MSK) event source. - """ - - self_managed_kafka_event_source_config: SelfManagedKafkaEventSourceConfig | None = ( - None - ) - """ - Specific configuration settings for a self-managed Apache Kafka event - source. - """ - - document_db_event_source_config: DocumentDBEventSourceConfig | None = None - """Specific configuration settings for a DocumentDB event source.""" - - event_source_mapping_arn: str | None = None - """The Amazon Resource Name (ARN) of the event source mapping.""" - - provisioned_poller_config: ProvisionedPollerConfig | None = None - """ - (Amazon SQS, Amazon MSK, and self-managed Apache Kafka only) The - provisioned mode configuration for the event source. For more - information, see [provisioned - mode](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html#invocation-eventsourcemapping-provisioned-mode). - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.uuid is not None: - serializer.write_string( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members["UUID"], self.uuid - ) - - if self.starting_position is not None: - serializer.write_string( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members["StartingPosition"], - self.starting_position, - ) - - if self.starting_position_timestamp is not None: - serializer.write_timestamp( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "StartingPositionTimestamp" - ], - self.starting_position_timestamp, - ) - - if self.batch_size is not None: - serializer.write_integer( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members["BatchSize"], - self.batch_size, - ) - - if self.maximum_batching_window_in_seconds is not None: - serializer.write_integer( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "MaximumBatchingWindowInSeconds" - ], - self.maximum_batching_window_in_seconds, - ) - - if self.parallelization_factor is not None: - serializer.write_integer( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "ParallelizationFactor" - ], - self.parallelization_factor, - ) - - if self.event_source_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members["EventSourceArn"], - self.event_source_arn, - ) - - if self.filter_criteria is not None: - serializer.write_struct( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members["FilterCriteria"], - self.filter_criteria, - ) - - if self.filter_criteria_error is not None: - serializer.write_struct( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "FilterCriteriaError" - ], - self.filter_criteria_error, - ) - - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members["KMSKeyArn"], - self.kms_key_arn, - ) - - if self.metrics_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members["MetricsConfig"], - self.metrics_config, - ) - - if self.logging_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members["LoggingConfig"], - self.logging_config, - ) - - if self.scaling_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members["ScalingConfig"], - self.scaling_config, - ) - - if self.function_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members["FunctionArn"], - self.function_arn, - ) - - if self.last_modified is not None: - serializer.write_timestamp( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members["LastModified"], - self.last_modified, - ) - - if self.last_processing_result is not None: - serializer.write_string( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "LastProcessingResult" - ], - self.last_processing_result, - ) - - if self.state is not None: - serializer.write_string( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members["State"], self.state - ) - - if self.state_transition_reason is not None: - serializer.write_string( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "StateTransitionReason" - ], - self.state_transition_reason, - ) - - if self.destination_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members["DestinationConfig"], - self.destination_config, - ) - - if self.topics is not None: - _serialize_topics( - serializer, - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members["Topics"], - self.topics, - ) - - if self.queues is not None: - _serialize_queues( - serializer, - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members["Queues"], - self.queues, - ) - - if self.source_access_configurations is not None: - _serialize_source_access_configurations( - serializer, - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "SourceAccessConfigurations" - ], - self.source_access_configurations, - ) - - if self.self_managed_event_source is not None: - serializer.write_struct( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "SelfManagedEventSource" - ], - self.self_managed_event_source, - ) - - if self.maximum_record_age_in_seconds is not None: - serializer.write_integer( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "MaximumRecordAgeInSeconds" - ], - self.maximum_record_age_in_seconds, - ) - - if self.bisect_batch_on_function_error is not None: - serializer.write_boolean( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "BisectBatchOnFunctionError" - ], - self.bisect_batch_on_function_error, - ) - - if self.maximum_retry_attempts is not None: - serializer.write_integer( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "MaximumRetryAttempts" - ], - self.maximum_retry_attempts, - ) - - if self.tumbling_window_in_seconds is not None: - serializer.write_integer( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "TumblingWindowInSeconds" - ], - self.tumbling_window_in_seconds, - ) - - if self.function_response_types is not None: - _serialize_function_response_type_list( - serializer, - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "FunctionResponseTypes" - ], - self.function_response_types, - ) - - if self.amazon_managed_kafka_event_source_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "AmazonManagedKafkaEventSourceConfig" - ], - self.amazon_managed_kafka_event_source_config, - ) - - if self.self_managed_kafka_event_source_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "SelfManagedKafkaEventSourceConfig" - ], - self.self_managed_kafka_event_source_config, - ) - - if self.document_db_event_source_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "DocumentDBEventSourceConfig" - ], - self.document_db_event_source_config, - ) - - if self.event_source_mapping_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "EventSourceMappingArn" - ], - self.event_source_mapping_arn, - ) - - if self.provisioned_poller_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "ProvisionedPollerConfig" - ], - self.provisioned_poller_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["uuid"] = de.read_string( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members["UUID"] - ) - - case 1: - kwargs["starting_position"] = EventSourcePosition( - de.read_string( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "StartingPosition" - ] - ) - ) - - case 2: - kwargs["starting_position_timestamp"] = de.read_timestamp( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "StartingPositionTimestamp" - ] - ) - - case 3: - kwargs["batch_size"] = de.read_integer( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members["BatchSize"] - ) - - case 4: - kwargs["maximum_batching_window_in_seconds"] = de.read_integer( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "MaximumBatchingWindowInSeconds" - ] - ) - - case 5: - kwargs["parallelization_factor"] = de.read_integer( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "ParallelizationFactor" - ] - ) - - case 6: - kwargs["event_source_arn"] = de.read_string( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "EventSourceArn" - ] - ) - - case 7: - kwargs["filter_criteria"] = FilterCriteria.deserialize(de) - - case 8: - kwargs["filter_criteria_error"] = FilterCriteriaError.deserialize( - de - ) - - case 9: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members["KMSKeyArn"] - ) - - case 10: - kwargs["metrics_config"] = ( - EventSourceMappingMetricsConfig.deserialize(de) - ) - - case 11: - kwargs["logging_config"] = ( - EventSourceMappingLoggingConfig.deserialize(de) - ) - - case 12: - kwargs["scaling_config"] = ScalingConfig.deserialize(de) - - case 13: - kwargs["function_arn"] = de.read_string( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "FunctionArn" - ] - ) - - case 14: - kwargs["last_modified"] = de.read_timestamp( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "LastModified" - ] - ) - - case 15: - kwargs["last_processing_result"] = de.read_string( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "LastProcessingResult" - ] - ) - - case 16: - kwargs["state"] = de.read_string( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members["State"] - ) - - case 17: - kwargs["state_transition_reason"] = de.read_string( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "StateTransitionReason" - ] - ) - - case 18: - kwargs["destination_config"] = DestinationConfig.deserialize(de) - - case 19: - kwargs["topics"] = _deserialize_topics( - de, _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members["Topics"] - ) - - case 20: - kwargs["queues"] = _deserialize_queues( - de, _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members["Queues"] - ) - - case 21: - kwargs["source_access_configurations"] = ( - _deserialize_source_access_configurations( - de, - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "SourceAccessConfigurations" - ], - ) - ) - - case 22: - kwargs["self_managed_event_source"] = ( - SelfManagedEventSource.deserialize(de) - ) - - case 23: - kwargs["maximum_record_age_in_seconds"] = de.read_integer( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "MaximumRecordAgeInSeconds" - ] - ) - - case 24: - kwargs["bisect_batch_on_function_error"] = de.read_boolean( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "BisectBatchOnFunctionError" - ] - ) - - case 25: - kwargs["maximum_retry_attempts"] = de.read_integer( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "MaximumRetryAttempts" - ] - ) - - case 26: - kwargs["tumbling_window_in_seconds"] = de.read_integer( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "TumblingWindowInSeconds" - ] - ) - - case 27: - kwargs["function_response_types"] = ( - _deserialize_function_response_type_list( - de, - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "FunctionResponseTypes" - ], - ) - ) - - case 28: - kwargs["amazon_managed_kafka_event_source_config"] = ( - AmazonManagedKafkaEventSourceConfig.deserialize(de) - ) - - case 29: - kwargs["self_managed_kafka_event_source_config"] = ( - SelfManagedKafkaEventSourceConfig.deserialize(de) - ) - - case 30: - kwargs["document_db_event_source_config"] = ( - DocumentDBEventSourceConfig.deserialize(de) - ) - - case 31: - kwargs["event_source_mapping_arn"] = de.read_string( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT.members[ - "EventSourceMappingArn" - ] - ) - - case 32: - kwargs["provisioned_poller_config"] = ( - ProvisionedPollerConfig.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT, consumer=_consumer - ) - return kwargs - - -UPDATE_EVENT_SOURCE_MAPPING = APIOperation( - input=UpdateEventSourceMappingInput, - output=UpdateEventSourceMappingOutput, - schema=_SCHEMA_UPDATE_EVENT_SOURCE_MAPPING, - input_schema=_SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_INPUT, - output_schema=_SCHEMA_UPDATE_EVENT_SOURCE_MAPPING_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceConflictException" - ): ResourceConflictException, - ShapeID( - "com.amazonaws.lambda#ResourceInUseException" - ): ResourceInUseException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_IN_USE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class CodeSigningConfigNotFoundException(ServiceError): - """The specified code signing configuration does not exist.""" - - fault: Literal["client", "server"] | None = "client" - - type: str | None = None - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CODE_SIGNING_CONFIG_NOT_FOUND_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_CODE_SIGNING_CONFIG_NOT_FOUND_EXCEPTION.members["Type"], - self.type, - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_CODE_SIGNING_CONFIG_NOT_FOUND_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_CODE_SIGNING_CONFIG_NOT_FOUND_EXCEPTION.members["Type"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_CODE_SIGNING_CONFIG_NOT_FOUND_EXCEPTION.members[ - "Message" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CODE_SIGNING_CONFIG_NOT_FOUND_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CodeStorageExceededException(ServiceError): - """ - Your Amazon Web Services account has exceeded its maximum total code - size. For more information, see [Lambda - quotas](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html). - """ - - fault: Literal["client", "server"] | None = "client" - - type: str | None = None - """The exception type.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CODE_STORAGE_EXCEEDED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_CODE_STORAGE_EXCEEDED_EXCEPTION.members["Type"], self.type - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_CODE_STORAGE_EXCEEDED_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_CODE_STORAGE_EXCEEDED_EXCEPTION.members["Type"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_CODE_STORAGE_EXCEEDED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CODE_STORAGE_EXCEEDED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CodeVerificationFailedException(ServiceError): - """ - The code signature failed one or more of the validation checks for - signature mismatch or expiry, and the code signing policy is set to - ENFORCE. Lambda blocks the deployment. - """ - - fault: Literal["client", "server"] | None = "client" - - type: str | None = None - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CODE_VERIFICATION_FAILED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_CODE_VERIFICATION_FAILED_EXCEPTION.members["Type"], self.type - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_CODE_VERIFICATION_FAILED_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_CODE_VERIFICATION_FAILED_EXCEPTION.members["Type"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_CODE_VERIFICATION_FAILED_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CODE_VERIFICATION_FAILED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class LambdaManagedInstancesCapacityProviderConfig: - """ - Configuration for Lambda-managed instances used by the capacity - provider. - """ - - capacity_provider_arn: str - """The Amazon Resource Name (ARN) of the capacity provider.""" - - per_execution_environment_max_concurrency: int | None = None - """ - The maximum number of concurrent execution environments that can run on - each compute instance. - """ - - execution_environment_memory_gi_b_per_v_cpu: float | None = None - """ - The amount of memory in GiB allocated per vCPU for execution - environments. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_LAMBDA_MANAGED_INSTANCES_CAPACITY_PROVIDER_CONFIG, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_LAMBDA_MANAGED_INSTANCES_CAPACITY_PROVIDER_CONFIG.members[ - "CapacityProviderArn" - ], - self.capacity_provider_arn, - ) - if self.per_execution_environment_max_concurrency is not None: - serializer.write_integer( - _SCHEMA_LAMBDA_MANAGED_INSTANCES_CAPACITY_PROVIDER_CONFIG.members[ - "PerExecutionEnvironmentMaxConcurrency" - ], - self.per_execution_environment_max_concurrency, - ) - - if self.execution_environment_memory_gi_b_per_v_cpu is not None: - serializer.write_double( - _SCHEMA_LAMBDA_MANAGED_INSTANCES_CAPACITY_PROVIDER_CONFIG.members[ - "ExecutionEnvironmentMemoryGiBPerVCpu" - ], - self.execution_environment_memory_gi_b_per_v_cpu, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["capacity_provider_arn"] = de.read_string( - _SCHEMA_LAMBDA_MANAGED_INSTANCES_CAPACITY_PROVIDER_CONFIG.members[ - "CapacityProviderArn" - ] - ) - - case 1: - kwargs["per_execution_environment_max_concurrency"] = ( - de.read_integer( - _SCHEMA_LAMBDA_MANAGED_INSTANCES_CAPACITY_PROVIDER_CONFIG.members[ - "PerExecutionEnvironmentMaxConcurrency" - ] - ) - ) - - case 2: - kwargs["execution_environment_memory_gi_b_per_v_cpu"] = ( - de.read_double( - _SCHEMA_LAMBDA_MANAGED_INSTANCES_CAPACITY_PROVIDER_CONFIG.members[ - "ExecutionEnvironmentMemoryGiBPerVCpu" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LAMBDA_MANAGED_INSTANCES_CAPACITY_PROVIDER_CONFIG, - consumer=_consumer, - ) - if "capacity_provider_arn" not in kwargs: - kwargs["capacity_provider_arn"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(capacity_provider_arn="") - - -@dataclass(kw_only=True) -class CapacityProviderConfig: - """ - Configuration for the capacity provider that manages compute resources - for Lambda functions. - """ - - lambda_managed_instances_capacity_provider_config: ( - LambdaManagedInstancesCapacityProviderConfig - ) - """ - Configuration for Lambda-managed instances used by the capacity - provider. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CAPACITY_PROVIDER_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CAPACITY_PROVIDER_CONFIG.members[ - "LambdaManagedInstancesCapacityProviderConfig" - ], - self.lambda_managed_instances_capacity_provider_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["lambda_managed_instances_capacity_provider_config"] = ( - LambdaManagedInstancesCapacityProviderConfig.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CAPACITY_PROVIDER_CONFIG, consumer=_consumer) - if "lambda_managed_instances_capacity_provider_config" not in kwargs: - kwargs["lambda_managed_instances_capacity_provider_config"] = ( - LambdaManagedInstancesCapacityProviderConfig._smithy_default() - ) - return kwargs - - -class S3ObjectStorageMode(UnknownEnumMixin, StrEnum): - """ - The method Lambda uses to store a function's deployment package --- - either by copying the package into Lambda-managed storage (`COPY`) or by - referencing it directly from the source Amazon S3 bucket (`REFERENCE`). - """ - - COPY = "COPY" - """ - The default storage mode. Uploads a copy of your deployment package to - Lambda. - """ - REFERENCE = "REFERENCE" - """ - The reference storage mode. Lambda references the deployment package - from the specified Amazon S3 bucket without uploading a copy. - """ - - -@dataclass(kw_only=True) -class FunctionCode: - """ - The code for the Lambda function. You can either specify an object in - Amazon S3, upload a .zip file archive deployment package directly, or - specify the URI of a container image. - """ - - zip_file: bytes | None = field(repr=False, default=None) - """ - The base64-encoded contents of the deployment package. Amazon Web - Services SDK and CLI clients handle the encoding for you. - """ - - s3_bucket: str | None = None - """ - An Amazon S3 bucket in the same Amazon Web Services Region as your - function. The bucket can be in a different Amazon Web Services account. - """ - - s3_key: str | None = None - """The Amazon S3 key of the deployment package.""" - - s3_object_version: str | None = None - """ - For versioned objects, the version of the deployment package object to - use. - """ - - s3_object_storage_mode: str | None = None - """ - Specifies how the deployment package is stored. Valid values: - - - `COPY` (default) -- Uploads a copy of your deployment package to - Lambda. - - - `REFERENCE` -- Lambda references the deployment package from the - specified Amazon S3 bucket. - """ - - image_uri: str | None = None - """ - URI of a [container - image](https://docs.aws.amazon.com/lambda/latest/dg/lambda-images.html) - in the Amazon ECR registry. - """ - - source_kms_key_arn: str | None = None - """ - The ARN of the Key Management Service (KMS) customer managed key that's - used to encrypt your function's .zip deployment package. If you don't - provide a customer managed key, Lambda uses an [Amazon Web Services - owned - key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FUNCTION_CODE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.zip_file is not None: - serializer.write_blob( - _SCHEMA_FUNCTION_CODE.members["ZipFile"], self.zip_file - ) - - if self.s3_bucket is not None: - serializer.write_string( - _SCHEMA_FUNCTION_CODE.members["S3Bucket"], self.s3_bucket - ) - - if self.s3_key is not None: - serializer.write_string(_SCHEMA_FUNCTION_CODE.members["S3Key"], self.s3_key) - - if self.s3_object_version is not None: - serializer.write_string( - _SCHEMA_FUNCTION_CODE.members["S3ObjectVersion"], self.s3_object_version - ) - - if self.s3_object_storage_mode is not None: - serializer.write_string( - _SCHEMA_FUNCTION_CODE.members["S3ObjectStorageMode"], - self.s3_object_storage_mode, - ) - - if self.image_uri is not None: - serializer.write_string( - _SCHEMA_FUNCTION_CODE.members["ImageUri"], self.image_uri - ) - - if self.source_kms_key_arn is not None: - serializer.write_string( - _SCHEMA_FUNCTION_CODE.members["SourceKMSKeyArn"], - self.source_kms_key_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["zip_file"] = de.read_blob( - _SCHEMA_FUNCTION_CODE.members["ZipFile"] - ) - - case 1: - kwargs["s3_bucket"] = de.read_string( - _SCHEMA_FUNCTION_CODE.members["S3Bucket"] - ) - - case 2: - kwargs["s3_key"] = de.read_string( - _SCHEMA_FUNCTION_CODE.members["S3Key"] - ) - - case 3: - kwargs["s3_object_version"] = de.read_string( - _SCHEMA_FUNCTION_CODE.members["S3ObjectVersion"] - ) - - case 4: - kwargs["s3_object_storage_mode"] = S3ObjectStorageMode( - de.read_string( - _SCHEMA_FUNCTION_CODE.members["S3ObjectStorageMode"] - ) - ) - - case 5: - kwargs["image_uri"] = de.read_string( - _SCHEMA_FUNCTION_CODE.members["ImageUri"] - ) - - case 6: - kwargs["source_kms_key_arn"] = de.read_string( - _SCHEMA_FUNCTION_CODE.members["SourceKMSKeyArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FUNCTION_CODE, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeadLetterConfig: - """ - The [dead-letter - queue](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async-retain-records.html#invocation-dlq) - for failed asynchronous invocations. - """ - - target_arn: str | None = None - """ - The Amazon Resource Name (ARN) of an Amazon SQS queue or Amazon SNS - topic. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DEAD_LETTER_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.target_arn is not None: - serializer.write_string( - _SCHEMA_DEAD_LETTER_CONFIG.members["TargetArn"], self.target_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["target_arn"] = de.read_string( - _SCHEMA_DEAD_LETTER_CONFIG.members["TargetArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DEAD_LETTER_CONFIG, consumer=_consumer) - return kwargs - - -def _serialize_environment_variables( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_environment_variables( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class Environment: - """ - A function's environment variable settings. You can use environment - variables to adjust your function's behavior without updating code. An - environment variable is a pair of strings that are stored in a - function's version-specific configuration. - """ - - variables: dict[str, str] | None = field(repr=False, default=None) - """ - Environment variable key-value pairs. For more information, see [Using - Lambda environment - variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ENVIRONMENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.variables is not None: - _serialize_environment_variables( - serializer, _SCHEMA_ENVIRONMENT.members["Variables"], self.variables - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["variables"] = _deserialize_environment_variables( - de, _SCHEMA_ENVIRONMENT.members["Variables"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ENVIRONMENT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class EphemeralStorage: - """ - The size of the function's `/tmp` directory in MB. The default value is - 512, but can be any whole number between 512 and 10,240 MB. For more - information, see [Configuring ephemeral storage - (console)](https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-ephemeral-storage). - """ - - size: int - """The size of the function's `/tmp` directory.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EPHEMERAL_STORAGE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer(_SCHEMA_EPHEMERAL_STORAGE.members["Size"], self.size) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["size"] = de.read_integer( - _SCHEMA_EPHEMERAL_STORAGE.members["Size"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EPHEMERAL_STORAGE, consumer=_consumer) - if "size" not in kwargs: - kwargs["size"] = 0 - return kwargs - - -class DirectS3Read(UnknownEnumMixin, StrEnum): - ENABLED = "ENABLED" - DISABLED = "DISABLED" - AUTO = "AUTO" - - -@dataclass(kw_only=True) -class S3FilesConfig: - """ - Setting controls how your function accesses data from an Amazon S3 file - system. - """ - - direct_s3_read: str | None = None - """ - Specifies if a function reads from the file system for the lowest - latency, or through Amazon S3 Files feature \"direct Amazon S3 bucket - reads\" for the highest throughput. Valid values: - - - `AUTO` (default) -- Direct reads are active for functions you - configure with 512 MB or more of memory. - - - `ENABLED` -- Enforces all reads are directly from the Amazon S3 - bucket, regardless of available memory (less than 512 MB). - - - `DISABLED` -- Routes all reads through the file system, regardless of - memory configuration. - - To use direct reads, you must grant the execution role the - `s3:GetObject` and `s3:GetObjectVersion` permissions. If a direct read - fails, Lambda automatically falls back to reading through the file - system. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_S3_FILES_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.direct_s3_read is not None: - serializer.write_string( - _SCHEMA_S3_FILES_CONFIG.members["DirectS3Read"], self.direct_s3_read - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["direct_s3_read"] = DirectS3Read( - de.read_string(_SCHEMA_S3_FILES_CONFIG.members["DirectS3Read"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_S3_FILES_CONFIG, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class FileSystemConfig: - """ - Details about the connection between a Lambda function and an [Amazon - EFS file - system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html) - or an [Amazon S3 file - system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html). - """ - - arn: str - """ - The Amazon Resource Name (ARN) of the Amazon EFS or Amazon S3 Files - access point that provides access to the file system. - """ - - local_mount_path: str - """ - The path where the function can access the file system, starting with - `/mnt/`. - """ - - s3_files_config: S3FilesConfig | None = None - """ - The configuration for how your function accesses data on an Amazon S3 - file system. Valid only when the file system access point ARN is an - Amazon S3 Files access point. If you specify a different access point - type (for example, Amazon Elastic File System), the operation returns an - `InvalidParameterException`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FILE_SYSTEM_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_FILE_SYSTEM_CONFIG.members["Arn"], self.arn) - serializer.write_string( - _SCHEMA_FILE_SYSTEM_CONFIG.members["LocalMountPath"], self.local_mount_path - ) - if self.s3_files_config is not None: - serializer.write_struct( - _SCHEMA_FILE_SYSTEM_CONFIG.members["S3FilesConfig"], - self.s3_files_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["arn"] = de.read_string( - _SCHEMA_FILE_SYSTEM_CONFIG.members["Arn"] - ) - - case 1: - kwargs["local_mount_path"] = de.read_string( - _SCHEMA_FILE_SYSTEM_CONFIG.members["LocalMountPath"] - ) - - case 2: - kwargs["s3_files_config"] = S3FilesConfig.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FILE_SYSTEM_CONFIG, consumer=_consumer) - if "arn" not in kwargs: - kwargs["arn"] = "" - if "local_mount_path" not in kwargs: - kwargs["local_mount_path"] = "" - return kwargs - - -def _serialize_file_system_config_list( - serializer: ShapeSerializer, schema: Schema, value: list[FileSystemConfig] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_file_system_config_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[FileSystemConfig]: - result: list[FileSystemConfig] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(FileSystemConfig.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_string_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_string_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ImageConfig: - """ - Configuration values that override the container image Dockerfile - settings. For more information, see [Container image - settings](https://docs.aws.amazon.com/lambda/latest/dg/images-create.html#images-parms). - """ - - entry_point: list[str] | None = None - """ - Specifies the entry point to their application, which is typically the - location of the runtime executable. - """ - - command: list[str] | None = None - """Specifies parameters that you want to pass in with ENTRYPOINT.""" - - working_directory: str | None = None - """Specifies the working directory.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IMAGE_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.entry_point is not None: - _serialize_string_list( - serializer, _SCHEMA_IMAGE_CONFIG.members["EntryPoint"], self.entry_point - ) - - if self.command is not None: - _serialize_string_list( - serializer, _SCHEMA_IMAGE_CONFIG.members["Command"], self.command - ) - - if self.working_directory is not None: - serializer.write_string( - _SCHEMA_IMAGE_CONFIG.members["WorkingDirectory"], self.working_directory - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["entry_point"] = _deserialize_string_list( - de, _SCHEMA_IMAGE_CONFIG.members["EntryPoint"] - ) - - case 1: - kwargs["command"] = _deserialize_string_list( - de, _SCHEMA_IMAGE_CONFIG.members["Command"] - ) - - case 2: - kwargs["working_directory"] = de.read_string( - _SCHEMA_IMAGE_CONFIG.members["WorkingDirectory"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_IMAGE_CONFIG, consumer=_consumer) - return kwargs - - -def _serialize_layer_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_layer_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -class LogFormat(UnknownEnumMixin, StrEnum): - JSON = "JSON" - TEXT = "Text" - - -@dataclass(kw_only=True) -class LoggingConfig: - """The function's Amazon CloudWatch Logs configuration settings.""" - - log_format: str | None = None - """ - The format in which Lambda sends your function's application and system - logs to CloudWatch. Select between plain text and structured JSON. - """ - - application_log_level: str | None = None - """ - Set this property to filter the application logs for your function that - Lambda sends to CloudWatch. Lambda only sends application logs at the - selected level of detail and lower, where `TRACE` is the highest level - and `FATAL` is the lowest. - """ - - system_log_level: str | None = None - """ - Set this property to filter the system logs for your function that - Lambda sends to CloudWatch. Lambda only sends system logs at the - selected level of detail and lower, where `DEBUG` is the highest level - and `WARN` is the lowest. - """ - - log_group: str | None = None - """ - The name of the Amazon CloudWatch log group the function sends logs to. - By default, Lambda functions send logs to a default log group named - `/aws/lambda/`. To use a different log group, enter an - existing log group or enter a new log group name. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LOGGING_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.log_format is not None: - serializer.write_string( - _SCHEMA_LOGGING_CONFIG.members["LogFormat"], self.log_format - ) - - if self.application_log_level is not None: - serializer.write_string( - _SCHEMA_LOGGING_CONFIG.members["ApplicationLogLevel"], - self.application_log_level, - ) - - if self.system_log_level is not None: - serializer.write_string( - _SCHEMA_LOGGING_CONFIG.members["SystemLogLevel"], self.system_log_level - ) - - if self.log_group is not None: - serializer.write_string( - _SCHEMA_LOGGING_CONFIG.members["LogGroup"], self.log_group - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["log_format"] = LogFormat( - de.read_string(_SCHEMA_LOGGING_CONFIG.members["LogFormat"]) - ) - - case 1: - kwargs["application_log_level"] = ApplicationLogLevel( - de.read_string( - _SCHEMA_LOGGING_CONFIG.members["ApplicationLogLevel"] - ) - ) - - case 2: - kwargs["system_log_level"] = SystemLogLevel( - de.read_string(_SCHEMA_LOGGING_CONFIG.members["SystemLogLevel"]) - ) - - case 3: - kwargs["log_group"] = de.read_string( - _SCHEMA_LOGGING_CONFIG.members["LogGroup"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LOGGING_CONFIG, consumer=_consumer) - return kwargs - - -class PackageType(UnknownEnumMixin, StrEnum): - ZIP = "Zip" - IMAGE = "Image" - - -class FunctionVersionLatestPublished(UnknownEnumMixin, StrEnum): - LATEST_PUBLISHED = "LATEST_PUBLISHED" - - -class Runtime(UnknownEnumMixin, StrEnum): - NODEJS = "nodejs" - NODEJS43 = "nodejs4.3" - NODEJS610 = "nodejs6.10" - NODEJS810 = "nodejs8.10" - NODEJS10X = "nodejs10.x" - NODEJS12X = "nodejs12.x" - NODEJS14X = "nodejs14.x" - NODEJS16X = "nodejs16.x" - NODEJS18X = "nodejs18.x" - NODEJS20X = "nodejs20.x" - NODEJS22X = "nodejs22.x" - NODEJS24X = "nodejs24.x" - JAVA8 = "java8" - JAVA8AL2 = "java8.al2" - JAVA11 = "java11" - JAVA17 = "java17" - JAVA21 = "java21" - JAVA25 = "java25" - PYTHON27 = "python2.7" - PYTHON36 = "python3.6" - PYTHON37 = "python3.7" - PYTHON38 = "python3.8" - PYTHON39 = "python3.9" - PYTHON310 = "python3.10" - PYTHON311 = "python3.11" - PYTHON312 = "python3.12" - PYTHON313 = "python3.13" - PYTHON314 = "python3.14" - DOTNETCORE10 = "dotnetcore1.0" - DOTNETCORE20 = "dotnetcore2.0" - DOTNETCORE21 = "dotnetcore2.1" - DOTNETCORE31 = "dotnetcore3.1" - DOTNET6 = "dotnet6" - DOTNET8 = "dotnet8" - DOTNET10 = "dotnet10" - NODEJS43EDGE = "nodejs4.3-edge" - GO1X = "go1.x" - RUBY25 = "ruby2.5" - RUBY27 = "ruby2.7" - RUBY32 = "ruby3.2" - RUBY33 = "ruby3.3" - RUBY34 = "ruby3.4" - RUBY40 = "ruby4.0" - PROVIDED = "provided" - PROVIDEDAL2 = "provided.al2" - PROVIDEDAL2023 = "provided.al2023" - NODEJS26X = "nodejs26.x" - PYTHON315 = "python3.15" - JAVA8AL2023 = "java8.al2023" - JAVA11AL2023 = "java11.al2023" - JAVA17AL2023 = "java17.al2023" - - -class SnapStartApplyOn(UnknownEnumMixin, StrEnum): - PUBLISHED_VERSIONS = "PublishedVersions" - NONE = "None" - - -@dataclass(kw_only=True) -class SnapStart: - """ - The function's [Lambda - SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html) - setting. Set `ApplyOn` to `PublishedVersions` to create a snapshot of - the initialized execution environment when you publish a function - version. - """ - - apply_on: str | None = None - """ - Set to `PublishedVersions` to create a snapshot of the initialized - execution environment when you publish a function version. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SNAP_START, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.apply_on is not None: - serializer.write_string( - _SCHEMA_SNAP_START.members["ApplyOn"], self.apply_on - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["apply_on"] = SnapStartApplyOn( - de.read_string(_SCHEMA_SNAP_START.members["ApplyOn"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SNAP_START, consumer=_consumer) - return kwargs - - -class TenantIsolationMode(UnknownEnumMixin, StrEnum): - PER_TENANT = "PER_TENANT" - - -@dataclass(kw_only=True) -class TenancyConfig: - """ - Specifies the tenant isolation mode configuration for a Lambda function. - This allows you to configure specific tenant isolation strategies for - your function invocations. Tenant isolation configuration cannot be - modified after function creation. - """ - - tenant_isolation_mode: str - """ - Tenant isolation mode allows for invocation to be sent to a - corresponding execution environment dedicated to a specific tenant ID. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TENANCY_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_TENANCY_CONFIG.members["TenantIsolationMode"], - self.tenant_isolation_mode, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["tenant_isolation_mode"] = TenantIsolationMode( - de.read_string( - _SCHEMA_TENANCY_CONFIG.members["TenantIsolationMode"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TENANCY_CONFIG, consumer=_consumer) - if "tenant_isolation_mode" not in kwargs: - kwargs["tenant_isolation_mode"] = TenantIsolationMode._corrected("") - return kwargs - - -class TracingMode(UnknownEnumMixin, StrEnum): - ACTIVE = "Active" - PASS_THROUGH = "PassThrough" - - -@dataclass(kw_only=True) -class TracingConfig: - """ - The function's - [X-Ray](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html) - tracing configuration. To sample and record incoming requests, set - `Mode` to `Active`. - """ - - mode: str | None = None - """The tracing mode.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRACING_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.mode is not None: - serializer.write_string(_SCHEMA_TRACING_CONFIG.members["Mode"], self.mode) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["mode"] = TracingMode( - de.read_string(_SCHEMA_TRACING_CONFIG.members["Mode"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TRACING_CONFIG, consumer=_consumer) - return kwargs - - -def _serialize_security_group_ids( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_security_group_ids( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_subnet_ids( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_subnet_ids( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class VpcConfig: - """ - The VPC security groups and subnets that are attached to a Lambda - function. For more information, see [Configuring a Lambda function to - access resources in a - VPC](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html). - """ - - subnet_ids: list[str] | None = None - """A list of VPC subnet IDs.""" - - security_group_ids: list[str] | None = None - """A list of VPC security group IDs.""" - - ipv6_allowed_for_dual_stack: bool | None = None - """ - Allows outbound IPv6 traffic on VPC functions that are connected to - dual-stack subnets. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VPC_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.subnet_ids is not None: - _serialize_subnet_ids( - serializer, _SCHEMA_VPC_CONFIG.members["SubnetIds"], self.subnet_ids - ) - - if self.security_group_ids is not None: - _serialize_security_group_ids( - serializer, - _SCHEMA_VPC_CONFIG.members["SecurityGroupIds"], - self.security_group_ids, - ) - - if self.ipv6_allowed_for_dual_stack is not None: - serializer.write_boolean( - _SCHEMA_VPC_CONFIG.members["Ipv6AllowedForDualStack"], - self.ipv6_allowed_for_dual_stack, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["subnet_ids"] = _deserialize_subnet_ids( - de, _SCHEMA_VPC_CONFIG.members["SubnetIds"] - ) - - case 1: - kwargs["security_group_ids"] = _deserialize_security_group_ids( - de, _SCHEMA_VPC_CONFIG.members["SecurityGroupIds"] - ) - - case 2: - kwargs["ipv6_allowed_for_dual_stack"] = de.read_boolean( - _SCHEMA_VPC_CONFIG.members["Ipv6AllowedForDualStack"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VPC_CONFIG, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CreateFunctionInput: - """Dataclass for CreateFunctionInput structure.""" - - function_name: str | None = None - """ - The name or ARN of the Lambda function. - - **Name formats** - - - **Function name** -- `my-function`. - - - **Function ARN** -- - `arn:aws:lambda:us-west-2:123456789012:function:my-function`. - - - **Partial ARN** -- `123456789012:function:my-function`. - - The length constraint applies only to the full ARN. If you specify only - the function name, it is limited to 64 characters in length. - """ - - runtime: str | None = None - """ - The identifier of the function's - [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html). - Runtime is required if the deployment package is a .zip file archive. - Specifying a runtime results in an error if you're deploying a function - using a container image. - - The following list includes deprecated runtimes. Lambda blocks creating - new functions and updating existing functions shortly after each runtime - is deprecated. For more information, see [Runtime use after - deprecation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-deprecation-levels). - - For a list of all currently supported runtimes, see [Supported - runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtimes-supported). - """ - - role: str | None = None - """The Amazon Resource Name (ARN) of the function's execution role.""" - - handler: str | None = None - """ - The name of the method within your code that Lambda calls to run your - function. Handler is required if the deployment package is a .zip file - archive. The format includes the file name. It can also include - namespaces and other qualifiers, depending on the runtime. For more - information, see [Lambda programming - model](https://docs.aws.amazon.com/lambda/latest/dg/foundation-progmodel.html). - """ - - code: FunctionCode | None = None - """The code for the function.""" - - description: str | None = None - """A description of the function.""" - - timeout: int | None = None - """ - The amount of time (in seconds) that Lambda allows a function to run - before stopping it. The default is 3 seconds, and the maximum allowed - value is 900 seconds. For functions using Lambda Managed Instances, - asynchronous invocations and event source mapping invocations (except - Amazon MQ and Amazon DocumentDB) support a maximum allowed value of - 5,400 seconds (90 minutes). For more information, see [Lambda execution - environment](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-context.html). - """ - - memory_size: int | None = None - """ - The amount of [memory available to the - function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-memory-console) - at runtime. Increasing the function memory also increases its CPU - allocation. The default value is 128 MB. The value can be any multiple - of 1 MB. - """ - - publish: bool = False - """ - Set to true to publish the first version of the function during - creation. - """ - - publish_to: str | None = None - """Specifies where to publish the function version or configuration.""" - - vpc_config: VpcConfig | None = None - """ - For network connectivity to Amazon Web Services resources in a VPC, - specify a list of security groups and subnets in the VPC. When you - connect a function to a VPC, it can access resources and the internet - only through that VPC. For more information, see [Configuring a Lambda - function to access resources in a - VPC](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html). - """ - - package_type: str | None = None - """ - The type of deployment package. Set to `Image` for container image and - set to `Zip` for .zip file archive. - """ - - dead_letter_config: DeadLetterConfig | None = None - """ - A dead-letter queue configuration that specifies the queue or topic - where Lambda sends asynchronous events when they fail processing. For - more information, see [Dead-letter - queues](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-dlq). - """ - - environment: Environment | None = None - """ - Environment variables that are accessible from function code during - execution. - """ - - kms_key_arn: str | None = None - """ - The ARN of the Key Management Service (KMS) customer managed key that's - used to encrypt the following resources: - - - The function's [environment - variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-encryption). - - - The function's [Lambda - SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart-security.html) - snapshots. - - - When used with `SourceKMSKeyArn`, the unzipped version of the .zip - deployment package that's used for function invocations. For more - information, see [Specifying a customer managed key for - Lambda](https://docs.aws.amazon.com/lambda/latest/dg/encrypt-zip-package.html#enable-zip-custom-encryption). - - - The optimized version of the container image that's used for function - invocations. Note that this is not the same key that's used to - protect your container image in the Amazon Elastic Container Registry - (Amazon ECR). For more information, see [Function - lifecycle](https://docs.aws.amazon.com/lambda/latest/dg/images-create.html#images-lifecycle). - - If you don't provide a customer managed key, Lambda uses an [Amazon Web - Services owned - key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk) - or an [Amazon Web Services managed - key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk). - """ - - tracing_config: TracingConfig | None = None - """ - Set `Mode` to `Active` to sample and trace a subset of incoming requests - with - [X-Ray](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html). - """ - - tags: dict[str, str] | None = None - """ - A list of - [tags](https://docs.aws.amazon.com/lambda/latest/dg/tagging.html) to - apply to the function. - """ - - layers: list[str] | None = None - """ - A list of [function - layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) - to add to the function's execution environment. Specify each layer by - its ARN, including the version. - """ - - file_system_configs: list[FileSystemConfig] | None = None - """ - Connection settings for an Amazon EFS file system or an Amazon S3 Files - file system. - """ - - code_signing_config_arn: str | None = None - """ - To enable code signing for this function, specify the ARN of a - code-signing configuration. A code-signing configuration includes a set - of signing profiles, which define the trusted publishers for this - function. - """ - - image_config: ImageConfig | None = None - """ - Container image [configuration - values](https://docs.aws.amazon.com/lambda/latest/dg/images-create.html#images-parms) - that override the values in the container image Dockerfile. - """ - - architectures: list[str] | None = None - """ - The instruction set architecture that the function supports. Enter a - string array with one of the valid values (arm64 or x86_64). The default - value is `x86_64`. - """ - - ephemeral_storage: EphemeralStorage | None = None - """ - The size of the function's `/tmp` directory in MB. The default value is - 512, but can be any whole number between 512 and 10,240 MB. For more - information, see [Configuring ephemeral storage - (console)](https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-ephemeral-storage). - """ - - snap_start: SnapStart | None = None - """ - The function's - [SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html) - setting. - """ - - logging_config: LoggingConfig | None = None - """The function's Amazon CloudWatch Logs configuration settings.""" - - tenancy_config: TenancyConfig | None = None - """ - Configuration for multi-tenant applications that use Lambda functions. - Defines tenant isolation settings and resource allocations. Required for - functions supporting multiple tenants. - """ - - capacity_provider_config: CapacityProviderConfig | None = None - """ - Configuration for the capacity provider that manages compute resources - for Lambda functions. - """ - - durable_config: DurableConfig | None = None - """ - Configuration settings for durable functions. Enables creating functions - with durability that can remember their state and continue execution - even after interruptions. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_FUNCTION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_CREATE_FUNCTION_INPUT.members["FunctionName"], - self.function_name, - ) - - if self.runtime is not None: - serializer.write_string( - _SCHEMA_CREATE_FUNCTION_INPUT.members["Runtime"], self.runtime - ) - - if self.role is not None: - serializer.write_string( - _SCHEMA_CREATE_FUNCTION_INPUT.members["Role"], self.role - ) - - if self.handler is not None: - serializer.write_string( - _SCHEMA_CREATE_FUNCTION_INPUT.members["Handler"], self.handler - ) - - if self.code is not None: - serializer.write_struct( - _SCHEMA_CREATE_FUNCTION_INPUT.members["Code"], self.code - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_FUNCTION_INPUT.members["Description"], self.description - ) - - if self.timeout is not None: - serializer.write_integer( - _SCHEMA_CREATE_FUNCTION_INPUT.members["Timeout"], self.timeout - ) - - if self.memory_size is not None: - serializer.write_integer( - _SCHEMA_CREATE_FUNCTION_INPUT.members["MemorySize"], self.memory_size - ) - - if self.publish is not None: - serializer.write_boolean( - _SCHEMA_CREATE_FUNCTION_INPUT.members["Publish"], self.publish - ) - - if self.publish_to is not None: - serializer.write_string( - _SCHEMA_CREATE_FUNCTION_INPUT.members["PublishTo"], self.publish_to - ) - - if self.vpc_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_FUNCTION_INPUT.members["VpcConfig"], self.vpc_config - ) - - if self.package_type is not None: - serializer.write_string( - _SCHEMA_CREATE_FUNCTION_INPUT.members["PackageType"], self.package_type - ) - - if self.dead_letter_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_FUNCTION_INPUT.members["DeadLetterConfig"], - self.dead_letter_config, - ) - - if self.environment is not None: - serializer.write_struct( - _SCHEMA_CREATE_FUNCTION_INPUT.members["Environment"], self.environment - ) - - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_FUNCTION_INPUT.members["KMSKeyArn"], self.kms_key_arn - ) - - if self.tracing_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_FUNCTION_INPUT.members["TracingConfig"], - self.tracing_config, - ) - - if self.tags is not None: - _serialize_tags( - serializer, _SCHEMA_CREATE_FUNCTION_INPUT.members["Tags"], self.tags - ) - - if self.layers is not None: - _serialize_layer_list( - serializer, _SCHEMA_CREATE_FUNCTION_INPUT.members["Layers"], self.layers - ) - - if self.file_system_configs is not None: - _serialize_file_system_config_list( - serializer, - _SCHEMA_CREATE_FUNCTION_INPUT.members["FileSystemConfigs"], - self.file_system_configs, - ) - - if self.code_signing_config_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_FUNCTION_INPUT.members["CodeSigningConfigArn"], - self.code_signing_config_arn, - ) - - if self.image_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_FUNCTION_INPUT.members["ImageConfig"], self.image_config - ) - - if self.architectures is not None: - _serialize_architectures_list( - serializer, - _SCHEMA_CREATE_FUNCTION_INPUT.members["Architectures"], - self.architectures, - ) - - if self.ephemeral_storage is not None: - serializer.write_struct( - _SCHEMA_CREATE_FUNCTION_INPUT.members["EphemeralStorage"], - self.ephemeral_storage, - ) - - if self.snap_start is not None: - serializer.write_struct( - _SCHEMA_CREATE_FUNCTION_INPUT.members["SnapStart"], self.snap_start - ) - - if self.logging_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_FUNCTION_INPUT.members["LoggingConfig"], - self.logging_config, - ) - - if self.tenancy_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_FUNCTION_INPUT.members["TenancyConfig"], - self.tenancy_config, - ) - - if self.capacity_provider_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_FUNCTION_INPUT.members["CapacityProviderConfig"], - self.capacity_provider_config, - ) - - if self.durable_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_FUNCTION_INPUT.members["DurableConfig"], - self.durable_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_CREATE_FUNCTION_INPUT.members["FunctionName"] - ) - - case 1: - kwargs["runtime"] = Runtime( - de.read_string(_SCHEMA_CREATE_FUNCTION_INPUT.members["Runtime"]) - ) - - case 2: - kwargs["role"] = de.read_string( - _SCHEMA_CREATE_FUNCTION_INPUT.members["Role"] - ) - - case 3: - kwargs["handler"] = de.read_string( - _SCHEMA_CREATE_FUNCTION_INPUT.members["Handler"] - ) - - case 4: - kwargs["code"] = FunctionCode.deserialize(de) - - case 5: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_FUNCTION_INPUT.members["Description"] - ) - - case 6: - kwargs["timeout"] = de.read_integer( - _SCHEMA_CREATE_FUNCTION_INPUT.members["Timeout"] - ) - - case 7: - kwargs["memory_size"] = de.read_integer( - _SCHEMA_CREATE_FUNCTION_INPUT.members["MemorySize"] - ) - - case 8: - kwargs["publish"] = de.read_boolean( - _SCHEMA_CREATE_FUNCTION_INPUT.members["Publish"] - ) - - case 9: - kwargs["publish_to"] = FunctionVersionLatestPublished( - de.read_string( - _SCHEMA_CREATE_FUNCTION_INPUT.members["PublishTo"] - ) - ) - - case 10: - kwargs["vpc_config"] = VpcConfig.deserialize(de) - - case 11: - kwargs["package_type"] = PackageType( - de.read_string( - _SCHEMA_CREATE_FUNCTION_INPUT.members["PackageType"] - ) - ) - - case 12: - kwargs["dead_letter_config"] = DeadLetterConfig.deserialize(de) - - case 13: - kwargs["environment"] = Environment.deserialize(de) - - case 14: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_CREATE_FUNCTION_INPUT.members["KMSKeyArn"] - ) - - case 15: - kwargs["tracing_config"] = TracingConfig.deserialize(de) - - case 16: - kwargs["tags"] = _deserialize_tags( - de, _SCHEMA_CREATE_FUNCTION_INPUT.members["Tags"] - ) - - case 17: - kwargs["layers"] = _deserialize_layer_list( - de, _SCHEMA_CREATE_FUNCTION_INPUT.members["Layers"] - ) - - case 18: - kwargs["file_system_configs"] = ( - _deserialize_file_system_config_list( - de, - _SCHEMA_CREATE_FUNCTION_INPUT.members["FileSystemConfigs"], - ) - ) - - case 19: - kwargs["code_signing_config_arn"] = de.read_string( - _SCHEMA_CREATE_FUNCTION_INPUT.members["CodeSigningConfigArn"] - ) - - case 20: - kwargs["image_config"] = ImageConfig.deserialize(de) - - case 21: - kwargs["architectures"] = _deserialize_architectures_list( - de, _SCHEMA_CREATE_FUNCTION_INPUT.members["Architectures"] - ) - - case 22: - kwargs["ephemeral_storage"] = EphemeralStorage.deserialize(de) - - case 23: - kwargs["snap_start"] = SnapStart.deserialize(de) - - case 24: - kwargs["logging_config"] = LoggingConfig.deserialize(de) - - case 25: - kwargs["tenancy_config"] = TenancyConfig.deserialize(de) - - case 26: - kwargs["capacity_provider_config"] = ( - CapacityProviderConfig.deserialize(de) - ) - - case 27: - kwargs["durable_config"] = DurableConfig.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_FUNCTION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class EnvironmentError: - """Error messages for environment variables that couldn't be applied.""" - - error_code: str | None = None - """The error code.""" - - message: str | None = field(repr=False, default=None) - """The error message.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ENVIRONMENT_ERROR, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.error_code is not None: - serializer.write_string( - _SCHEMA_ENVIRONMENT_ERROR.members["ErrorCode"], self.error_code - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_ENVIRONMENT_ERROR.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["error_code"] = de.read_string( - _SCHEMA_ENVIRONMENT_ERROR.members["ErrorCode"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_ENVIRONMENT_ERROR.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ENVIRONMENT_ERROR, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class EnvironmentResponse: - """ - The results of an operation to update or read environment variables. If - the operation succeeds, the response contains the environment variables. - If it fails, the response contains details about the error. - """ - - variables: dict[str, str] | None = field(repr=False, default=None) - """Environment variable key-value pairs. Omitted from CloudTrail logs.""" - - error: EnvironmentError | None = None - """Error messages for environment variables that couldn't be applied.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ENVIRONMENT_RESPONSE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.variables is not None: - _serialize_environment_variables( - serializer, - _SCHEMA_ENVIRONMENT_RESPONSE.members["Variables"], - self.variables, - ) - - if self.error is not None: - serializer.write_struct( - _SCHEMA_ENVIRONMENT_RESPONSE.members["Error"], self.error - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["variables"] = _deserialize_environment_variables( - de, _SCHEMA_ENVIRONMENT_RESPONSE.members["Variables"] - ) - - case 1: - kwargs["error"] = EnvironmentError.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ENVIRONMENT_RESPONSE, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ImageConfigError: - """Error response to `GetFunctionConfiguration`.""" - - error_code: str | None = None - """Error code.""" - - message: str | None = field(repr=False, default=None) - """Error message.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IMAGE_CONFIG_ERROR, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.error_code is not None: - serializer.write_string( - _SCHEMA_IMAGE_CONFIG_ERROR.members["ErrorCode"], self.error_code - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_IMAGE_CONFIG_ERROR.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["error_code"] = de.read_string( - _SCHEMA_IMAGE_CONFIG_ERROR.members["ErrorCode"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_IMAGE_CONFIG_ERROR.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_IMAGE_CONFIG_ERROR, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ImageConfigResponse: - """Response to a `GetFunctionConfiguration` request.""" - - image_config: ImageConfig | None = None - """Configuration values that override the container image Dockerfile.""" - - error: ImageConfigError | None = None - """Error response to `GetFunctionConfiguration`.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IMAGE_CONFIG_RESPONSE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.image_config is not None: - serializer.write_struct( - _SCHEMA_IMAGE_CONFIG_RESPONSE.members["ImageConfig"], self.image_config - ) - - if self.error is not None: - serializer.write_struct( - _SCHEMA_IMAGE_CONFIG_RESPONSE.members["Error"], self.error - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["image_config"] = ImageConfig.deserialize(de) - - case 1: - kwargs["error"] = ImageConfigError.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_IMAGE_CONFIG_RESPONSE, consumer=_consumer) - return kwargs - - -class LastUpdateStatus(UnknownEnumMixin, StrEnum): - SUCCESSFUL = "Successful" - FAILED = "Failed" - IN_PROGRESS = "InProgress" - - -class LastUpdateStatusReasonCode(UnknownEnumMixin, StrEnum): - ENI_LIMIT_EXCEEDED = "EniLimitExceeded" - INSUFFICIENT_ROLE_PERMISSIONS = "InsufficientRolePermissions" - INVALID_CONFIGURATION = "InvalidConfiguration" - INTERNAL_ERROR = "InternalError" - SUBNET_OUT_OF_IP_ADDRESSES = "SubnetOutOfIPAddresses" - INVALID_SUBNET = "InvalidSubnet" - INVALID_SECURITY_GROUP = "InvalidSecurityGroup" - IMAGE_DELETED = "ImageDeleted" - IMAGE_ACCESS_DENIED = "ImageAccessDenied" - INVALID_IMAGE = "InvalidImage" - KMS_KEY_ACCESS_DENIED = "KMSKeyAccessDenied" - KMS_KEY_NOT_FOUND = "KMSKeyNotFound" - INVALID_STATE_KMS_KEY = "InvalidStateKMSKey" - DISABLED_KMS_KEY = "DisabledKMSKey" - EFSIO_ERROR = "EFSIOError" - EFS_MOUNT_CONNECTIVITY_ERROR = "EFSMountConnectivityError" - EFS_MOUNT_FAILURE = "EFSMountFailure" - EFS_MOUNT_TIMEOUT = "EFSMountTimeout" - INVALID_RUNTIME = "InvalidRuntime" - INVALID_ZIP_FILE_EXCEPTION = "InvalidZipFileException" - FUNCTION_ERROR = "FunctionError" - SERVICE_QUOTA_EXCEEDED_EXCEPTION = "ServiceQuotaExceededException" - VCPU_LIMIT_EXCEEDED = "VcpuLimitExceeded" - CAPACITY_PROVIDER_SCALING_LIMIT_EXCEEDED = "CapacityProviderScalingLimitExceeded" - INSUFFICIENT_CAPACITY = "InsufficientCapacity" - EC2_REQUEST_LIMIT_EXCEEDED = "EC2RequestLimitExceeded" - FUNCTION_ERROR_INIT_TIMEOUT = "FunctionError.InitTimeout" - FUNCTION_ERROR_RUNTIME_INIT_ERROR = "FunctionError.RuntimeInitError" - FUNCTION_ERROR_EXTENSION_INIT_ERROR = "FunctionError.ExtensionInitError" - FUNCTION_ERROR_INVALID_ENTRY_POINT = "FunctionError.InvalidEntryPoint" - FUNCTION_ERROR_INVALID_WORKING_DIRECTORY = "FunctionError.InvalidWorkingDirectory" - FUNCTION_ERROR_PERMISSION_DENIED = "FunctionError.PermissionDenied" - FUNCTION_ERROR_TOO_MANY_EXTENSIONS = "FunctionError.TooManyExtensions" - FUNCTION_ERROR_INIT_RESOURCE_EXHAUSTED = "FunctionError.InitResourceExhausted" - DISALLOWED_BY_VPC_ENCRYPTION_CONTROL = "DisallowedByVpcEncryptionControl" - DEPENDENCY_ERROR = "DependencyError" - - -@dataclass(kw_only=True) -class Layer: - """ - An [Lambda - layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html). - """ - - arn: str | None = None - """The Amazon Resource Name (ARN) of the function layer.""" - - code_size: int = 0 - """The size of the layer archive in bytes.""" - - signing_profile_version_arn: str | None = None - """The Amazon Resource Name (ARN) for a signing profile version.""" - - signing_job_arn: str | None = None - """The Amazon Resource Name (ARN) of a signing job.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LAYER, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.arn is not None: - serializer.write_string(_SCHEMA_LAYER.members["Arn"], self.arn) - - serializer.write_long(_SCHEMA_LAYER.members["CodeSize"], self.code_size) - if self.signing_profile_version_arn is not None: - serializer.write_string( - _SCHEMA_LAYER.members["SigningProfileVersionArn"], - self.signing_profile_version_arn, - ) - - if self.signing_job_arn is not None: - serializer.write_string( - _SCHEMA_LAYER.members["SigningJobArn"], self.signing_job_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["arn"] = de.read_string(_SCHEMA_LAYER.members["Arn"]) - - case 1: - kwargs["code_size"] = de.read_long( - _SCHEMA_LAYER.members["CodeSize"] - ) - - case 2: - kwargs["signing_profile_version_arn"] = de.read_string( - _SCHEMA_LAYER.members["SigningProfileVersionArn"] - ) - - case 3: - kwargs["signing_job_arn"] = de.read_string( - _SCHEMA_LAYER.members["SigningJobArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LAYER, consumer=_consumer) - return kwargs - - -def _serialize_layers_reference_list( - serializer: ShapeSerializer, schema: Schema, value: list[Layer] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_layers_reference_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Layer]: - result: list[Layer] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Layer.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class RuntimeVersionError: - """ - Any error returned when the runtime version information for the function - could not be retrieved. - """ - - error_code: str | None = None - """The error code.""" - - message: str | None = field(repr=False, default=None) - """The error message.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RUNTIME_VERSION_ERROR, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.error_code is not None: - serializer.write_string( - _SCHEMA_RUNTIME_VERSION_ERROR.members["ErrorCode"], self.error_code - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_RUNTIME_VERSION_ERROR.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["error_code"] = de.read_string( - _SCHEMA_RUNTIME_VERSION_ERROR.members["ErrorCode"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_RUNTIME_VERSION_ERROR.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RUNTIME_VERSION_ERROR, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class RuntimeVersionConfig: - """The ARN of the runtime and any errors that occured.""" - - runtime_version_arn: str | None = None - """The ARN of the runtime version you want the function to use.""" - - error: RuntimeVersionError | None = None - """ - Error response when Lambda is unable to retrieve the runtime version for - a function. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RUNTIME_VERSION_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.runtime_version_arn is not None: - serializer.write_string( - _SCHEMA_RUNTIME_VERSION_CONFIG.members["RuntimeVersionArn"], - self.runtime_version_arn, - ) - - if self.error is not None: - serializer.write_struct( - _SCHEMA_RUNTIME_VERSION_CONFIG.members["Error"], self.error - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["runtime_version_arn"] = de.read_string( - _SCHEMA_RUNTIME_VERSION_CONFIG.members["RuntimeVersionArn"] - ) - - case 1: - kwargs["error"] = RuntimeVersionError.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RUNTIME_VERSION_CONFIG, consumer=_consumer) - return kwargs - - -class SnapStartOptimizationStatus(UnknownEnumMixin, StrEnum): - ON = "On" - OFF = "Off" - - -@dataclass(kw_only=True) -class SnapStartResponse: - """ - The function's - [SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html) - setting. - """ - - apply_on: str | None = None - """ - When set to `PublishedVersions`, Lambda creates a snapshot of the - execution environment when you publish a function version. - """ - - optimization_status: str | None = None - """ - When you provide a [qualified Amazon Resource Name - (ARN)](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html#versioning-versions-using), - this response element indicates whether SnapStart is activated for the - specified function version. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SNAP_START_RESPONSE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.apply_on is not None: - serializer.write_string( - _SCHEMA_SNAP_START_RESPONSE.members["ApplyOn"], self.apply_on - ) - - if self.optimization_status is not None: - serializer.write_string( - _SCHEMA_SNAP_START_RESPONSE.members["OptimizationStatus"], - self.optimization_status, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["apply_on"] = SnapStartApplyOn( - de.read_string(_SCHEMA_SNAP_START_RESPONSE.members["ApplyOn"]) - ) - - case 1: - kwargs["optimization_status"] = SnapStartOptimizationStatus( - de.read_string( - _SCHEMA_SNAP_START_RESPONSE.members["OptimizationStatus"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SNAP_START_RESPONSE, consumer=_consumer) - return kwargs - - -class StateReasonCode(UnknownEnumMixin, StrEnum): - IDLE = "Idle" - CREATING = "Creating" - RESTORING = "Restoring" - ENI_LIMIT_EXCEEDED = "EniLimitExceeded" - INSUFFICIENT_ROLE_PERMISSIONS = "InsufficientRolePermissions" - INVALID_CONFIGURATION = "InvalidConfiguration" - INTERNAL_ERROR = "InternalError" - SUBNET_OUT_OF_IP_ADDRESSES = "SubnetOutOfIPAddresses" - INVALID_SUBNET = "InvalidSubnet" - INVALID_SECURITY_GROUP = "InvalidSecurityGroup" - IMAGE_DELETED = "ImageDeleted" - IMAGE_ACCESS_DENIED = "ImageAccessDenied" - INVALID_IMAGE = "InvalidImage" - KMS_KEY_ACCESS_DENIED = "KMSKeyAccessDenied" - KMS_KEY_NOT_FOUND = "KMSKeyNotFound" - INVALID_STATE_KMS_KEY = "InvalidStateKMSKey" - DISABLED_KMS_KEY = "DisabledKMSKey" - EFSIO_ERROR = "EFSIOError" - EFS_MOUNT_CONNECTIVITY_ERROR = "EFSMountConnectivityError" - EFS_MOUNT_FAILURE = "EFSMountFailure" - EFS_MOUNT_TIMEOUT = "EFSMountTimeout" - INVALID_RUNTIME = "InvalidRuntime" - INVALID_ZIP_FILE_EXCEPTION = "InvalidZipFileException" - FUNCTION_ERROR = "FunctionError" - SERVICE_QUOTA_EXCEEDED_EXCEPTION = "ServiceQuotaExceededException" - VCPU_LIMIT_EXCEEDED = "VcpuLimitExceeded" - CAPACITY_PROVIDER_SCALING_LIMIT_EXCEEDED = "CapacityProviderScalingLimitExceeded" - INSUFFICIENT_CAPACITY = "InsufficientCapacity" - EC2_REQUEST_LIMIT_EXCEEDED = "EC2RequestLimitExceeded" - FUNCTION_ERROR_INIT_TIMEOUT = "FunctionError.InitTimeout" - FUNCTION_ERROR_RUNTIME_INIT_ERROR = "FunctionError.RuntimeInitError" - FUNCTION_ERROR_EXTENSION_INIT_ERROR = "FunctionError.ExtensionInitError" - FUNCTION_ERROR_INVALID_ENTRY_POINT = "FunctionError.InvalidEntryPoint" - FUNCTION_ERROR_INVALID_WORKING_DIRECTORY = "FunctionError.InvalidWorkingDirectory" - FUNCTION_ERROR_PERMISSION_DENIED = "FunctionError.PermissionDenied" - FUNCTION_ERROR_TOO_MANY_EXTENSIONS = "FunctionError.TooManyExtensions" - FUNCTION_ERROR_INIT_RESOURCE_EXHAUSTED = "FunctionError.InitResourceExhausted" - DISALLOWED_BY_VPC_ENCRYPTION_CONTROL = "DisallowedByVpcEncryptionControl" - DRAINING_DURABLE_EXECUTIONS = "DrainingDurableExecutions" - DEPENDENCY_ERROR = "DependencyError" - - -@dataclass(kw_only=True) -class TracingConfigResponse: - """The function's X-Ray tracing configuration.""" - - mode: str | None = None - """The tracing mode.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRACING_CONFIG_RESPONSE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.mode is not None: - serializer.write_string( - _SCHEMA_TRACING_CONFIG_RESPONSE.members["Mode"], self.mode - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["mode"] = TracingMode( - de.read_string(_SCHEMA_TRACING_CONFIG_RESPONSE.members["Mode"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TRACING_CONFIG_RESPONSE, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class VpcConfigResponse: - """ - The VPC security groups and subnets that are attached to a Lambda - function. - """ - - subnet_ids: list[str] | None = None - """A list of VPC subnet IDs.""" - - security_group_ids: list[str] | None = None - """A list of VPC security group IDs.""" - - vpc_id: str | None = None - """The ID of the VPC.""" - - ipv6_allowed_for_dual_stack: bool | None = None - """ - Allows outbound IPv6 traffic on VPC functions that are connected to - dual-stack subnets. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VPC_CONFIG_RESPONSE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.subnet_ids is not None: - _serialize_subnet_ids( - serializer, - _SCHEMA_VPC_CONFIG_RESPONSE.members["SubnetIds"], - self.subnet_ids, - ) - - if self.security_group_ids is not None: - _serialize_security_group_ids( - serializer, - _SCHEMA_VPC_CONFIG_RESPONSE.members["SecurityGroupIds"], - self.security_group_ids, - ) - - if self.vpc_id is not None: - serializer.write_string( - _SCHEMA_VPC_CONFIG_RESPONSE.members["VpcId"], self.vpc_id - ) - - if self.ipv6_allowed_for_dual_stack is not None: - serializer.write_boolean( - _SCHEMA_VPC_CONFIG_RESPONSE.members["Ipv6AllowedForDualStack"], - self.ipv6_allowed_for_dual_stack, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["subnet_ids"] = _deserialize_subnet_ids( - de, _SCHEMA_VPC_CONFIG_RESPONSE.members["SubnetIds"] - ) - - case 1: - kwargs["security_group_ids"] = _deserialize_security_group_ids( - de, _SCHEMA_VPC_CONFIG_RESPONSE.members["SecurityGroupIds"] - ) - - case 2: - kwargs["vpc_id"] = de.read_string( - _SCHEMA_VPC_CONFIG_RESPONSE.members["VpcId"] - ) - - case 3: - kwargs["ipv6_allowed_for_dual_stack"] = de.read_boolean( - _SCHEMA_VPC_CONFIG_RESPONSE.members["Ipv6AllowedForDualStack"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VPC_CONFIG_RESPONSE, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CreateFunctionOutput: - """Details about a function's configuration.""" - - function_name: str | None = None - """The name of the function.""" - - function_arn: str | None = None - """The function's Amazon Resource Name (ARN).""" - - runtime: str | None = None - """ - The identifier of the function's - [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html). - Runtime is required if the deployment package is a .zip file archive. - Specifying a runtime results in an error if you're deploying a function - using a container image. - - The following list includes deprecated runtimes. Lambda blocks creating - new functions and updating existing functions shortly after each runtime - is deprecated. For more information, see [Runtime use after - deprecation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-deprecation-levels). - - For a list of all currently supported runtimes, see [Supported - runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtimes-supported). - """ - - role: str | None = None - """The function's execution role.""" - - handler: str | None = None - """The function that Lambda calls to begin running your function.""" - - code_size: int = 0 - """The size of the function's deployment package, in bytes.""" - - description: str | None = None - """The function's description.""" - - timeout: int | None = None - """ - The amount of time in seconds that Lambda allows a function to run - before stopping it. - """ - - memory_size: int | None = None - """The amount of memory available to the function at runtime.""" - - last_modified: str | None = None - """ - The date and time that the function was last updated, in [ISO-8601 - format](https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). - """ - - code_sha256: str | None = None - """The SHA256 hash of the function's deployment package.""" - - version: str | None = None - """The version of the Lambda function.""" - - vpc_config: VpcConfigResponse | None = None - """The function's networking configuration.""" - - dead_letter_config: DeadLetterConfig | None = None - """The function's dead letter queue.""" - - environment: EnvironmentResponse | None = None - """ - The function's [environment - variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html). - Omitted from CloudTrail logs. - """ - - kms_key_arn: str | None = None - """ - The ARN of the Key Management Service (KMS) customer managed key that's - used to encrypt the following resources: - - - The function's [environment - variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-encryption). - - - The function's [Lambda - SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart-security.html) - snapshots. - - - When used with `SourceKMSKeyArn`, the unzipped version of the .zip - deployment package that's used for function invocations. For more - information, see [Specifying a customer managed key for - Lambda](https://docs.aws.amazon.com/lambda/latest/dg/encrypt-zip-package.html#enable-zip-custom-encryption). - - - The optimized version of the container image that's used for function - invocations. Note that this is not the same key that's used to - protect your container image in the Amazon Elastic Container Registry - (Amazon ECR). For more information, see [Function - lifecycle](https://docs.aws.amazon.com/lambda/latest/dg/images-create.html#images-lifecycle). - - If you don't provide a customer managed key, Lambda uses an [Amazon Web - Services owned - key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk) - or an [Amazon Web Services managed - key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk). - """ - - tracing_config: TracingConfigResponse | None = None - """The function's X-Ray tracing configuration.""" - - master_arn: str | None = None - """For Lambda@Edge functions, the ARN of the main function.""" - - revision_id: str | None = None - """The latest updated revision of the function or alias.""" - - layers: list[Layer] | None = None - """ - The function's - [layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html). - """ - - state: str | None = None - """ - The current state of the function. When the state is `Inactive`, you can - reactivate the function by invoking it. - """ - - state_reason: str | None = None - """The reason for the function's current state.""" - - state_reason_code: str | None = None - """ - The reason code for the function's current state. When the code is - `Creating`, you can't invoke or modify the function. - """ - - last_update_status: str | None = None - """ - The status of the last update that was performed on the function. This - is first set to `Successful` after function creation completes. - """ - - last_update_status_reason: str | None = None - """The reason for the last update that was performed on the function.""" - - last_update_status_reason_code: str | None = None - """The reason code for the last update that was performed on the function.""" - - file_system_configs: list[FileSystemConfig] | None = None - """ - Connection settings for an [Amazon EFS file - system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html) - or an [Amazon S3 file - system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html). - """ - - signing_profile_version_arn: str | None = None - """The ARN of the signing profile version.""" - - signing_job_arn: str | None = None - """The ARN of the signing job.""" - - package_type: str | None = None - """ - The type of deployment package. Set to `Image` for container image and - set `Zip` for .zip file archive. - """ - - image_config_response: ImageConfigResponse | None = None - """The function's image configuration values.""" - - architectures: list[str] | None = None - """ - The instruction set architecture that the function supports. - Architecture is a string array with one of the valid values. The default - architecture value is `x86_64`. - """ - - ephemeral_storage: EphemeralStorage | None = None - """ - The size of the function's `/tmp` directory in MB. The default value is - 512, but can be any whole number between 512 and 10,240 MB. For more - information, see [Configuring ephemeral storage - (console)](https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-ephemeral-storage). - """ - - snap_start: SnapStartResponse | None = None - """ - Set `ApplyOn` to `PublishedVersions` to create a snapshot of the - initialized execution environment when you publish a function version. - For more information, see [Improving startup performance with Lambda - SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html). - """ - - runtime_version_config: RuntimeVersionConfig | None = None - """The ARN of the runtime and any errors that occured.""" - - logging_config: LoggingConfig | None = None - """The function's Amazon CloudWatch Logs configuration settings.""" - - tenancy_config: TenancyConfig | None = None - """ - The function's tenant isolation configuration settings. Determines - whether the Lambda function runs on a shared or dedicated infrastructure - per unique tenant. - """ - - capacity_provider_config: CapacityProviderConfig | None = None - """ - Configuration for the capacity provider that manages compute resources - for Lambda functions. - """ - - config_sha256: str | None = None - """The SHA256 hash of the function configuration.""" - - durable_config: DurableConfig | None = None - """ - The function's durable execution configuration settings, if the - function is configured for durability. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_FUNCTION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["FunctionName"], - self.function_name, - ) - - if self.function_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["FunctionArn"], self.function_arn - ) - - if self.runtime is not None: - serializer.write_string( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["Runtime"], self.runtime - ) - - if self.role is not None: - serializer.write_string( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["Role"], self.role - ) - - if self.handler is not None: - serializer.write_string( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["Handler"], self.handler - ) - - serializer.write_long( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["CodeSize"], self.code_size - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["Description"], self.description - ) - - if self.timeout is not None: - serializer.write_integer( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["Timeout"], self.timeout - ) - - if self.memory_size is not None: - serializer.write_integer( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["MemorySize"], self.memory_size - ) - - if self.last_modified is not None: - serializer.write_string( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["LastModified"], - self.last_modified, - ) - - if self.code_sha256 is not None: - serializer.write_string( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["CodeSha256"], self.code_sha256 - ) - - if self.version is not None: - serializer.write_string( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["Version"], self.version - ) - - if self.vpc_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["VpcConfig"], self.vpc_config - ) - - if self.dead_letter_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["DeadLetterConfig"], - self.dead_letter_config, - ) - - if self.environment is not None: - serializer.write_struct( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["Environment"], self.environment - ) - - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["KMSKeyArn"], self.kms_key_arn - ) - - if self.tracing_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["TracingConfig"], - self.tracing_config, - ) - - if self.master_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["MasterArn"], self.master_arn - ) - - if self.revision_id is not None: - serializer.write_string( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["RevisionId"], self.revision_id - ) - - if self.layers is not None: - _serialize_layers_reference_list( - serializer, - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["Layers"], - self.layers, - ) - - if self.state is not None: - serializer.write_string( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["State"], self.state - ) - - if self.state_reason is not None: - serializer.write_string( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["StateReason"], self.state_reason - ) - - if self.state_reason_code is not None: - serializer.write_string( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["StateReasonCode"], - self.state_reason_code, - ) - - if self.last_update_status is not None: - serializer.write_string( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["LastUpdateStatus"], - self.last_update_status, - ) - - if self.last_update_status_reason is not None: - serializer.write_string( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["LastUpdateStatusReason"], - self.last_update_status_reason, - ) - - if self.last_update_status_reason_code is not None: - serializer.write_string( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["LastUpdateStatusReasonCode"], - self.last_update_status_reason_code, - ) - - if self.file_system_configs is not None: - _serialize_file_system_config_list( - serializer, - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["FileSystemConfigs"], - self.file_system_configs, - ) - - if self.signing_profile_version_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["SigningProfileVersionArn"], - self.signing_profile_version_arn, - ) - - if self.signing_job_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["SigningJobArn"], - self.signing_job_arn, - ) - - if self.package_type is not None: - serializer.write_string( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["PackageType"], self.package_type - ) - - if self.image_config_response is not None: - serializer.write_struct( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["ImageConfigResponse"], - self.image_config_response, - ) - - if self.architectures is not None: - _serialize_architectures_list( - serializer, - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["Architectures"], - self.architectures, - ) - - if self.ephemeral_storage is not None: - serializer.write_struct( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["EphemeralStorage"], - self.ephemeral_storage, - ) - - if self.snap_start is not None: - serializer.write_struct( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["SnapStart"], self.snap_start - ) - - if self.runtime_version_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["RuntimeVersionConfig"], - self.runtime_version_config, - ) - - if self.logging_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["LoggingConfig"], - self.logging_config, - ) - - if self.tenancy_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["TenancyConfig"], - self.tenancy_config, - ) - - if self.capacity_provider_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["CapacityProviderConfig"], - self.capacity_provider_config, - ) - - if self.config_sha256 is not None: - serializer.write_string( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["ConfigSha256"], - self.config_sha256, - ) - - if self.durable_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["DurableConfig"], - self.durable_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["FunctionName"] - ) - - case 1: - kwargs["function_arn"] = de.read_string( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["FunctionArn"] - ) - - case 2: - kwargs["runtime"] = Runtime( - de.read_string( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["Runtime"] - ) - ) - - case 3: - kwargs["role"] = de.read_string( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["Role"] - ) - - case 4: - kwargs["handler"] = de.read_string( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["Handler"] - ) - - case 5: - kwargs["code_size"] = de.read_long( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["CodeSize"] - ) - - case 6: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["Description"] - ) - - case 7: - kwargs["timeout"] = de.read_integer( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["Timeout"] - ) - - case 8: - kwargs["memory_size"] = de.read_integer( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["MemorySize"] - ) - - case 9: - kwargs["last_modified"] = de.read_string( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["LastModified"] - ) - - case 10: - kwargs["code_sha256"] = de.read_string( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["CodeSha256"] - ) - - case 11: - kwargs["version"] = de.read_string( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["Version"] - ) - - case 12: - kwargs["vpc_config"] = VpcConfigResponse.deserialize(de) - - case 13: - kwargs["dead_letter_config"] = DeadLetterConfig.deserialize(de) - - case 14: - kwargs["environment"] = EnvironmentResponse.deserialize(de) - - case 15: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["KMSKeyArn"] - ) - - case 16: - kwargs["tracing_config"] = TracingConfigResponse.deserialize(de) - - case 17: - kwargs["master_arn"] = de.read_string( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["MasterArn"] - ) - - case 18: - kwargs["revision_id"] = de.read_string( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["RevisionId"] - ) - - case 19: - kwargs["layers"] = _deserialize_layers_reference_list( - de, _SCHEMA_CREATE_FUNCTION_OUTPUT.members["Layers"] - ) - - case 20: - kwargs["state"] = State( - de.read_string(_SCHEMA_CREATE_FUNCTION_OUTPUT.members["State"]) - ) - - case 21: - kwargs["state_reason"] = de.read_string( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["StateReason"] - ) - - case 22: - kwargs["state_reason_code"] = StateReasonCode( - de.read_string( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["StateReasonCode"] - ) - ) - - case 23: - kwargs["last_update_status"] = LastUpdateStatus( - de.read_string( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["LastUpdateStatus"] - ) - ) - - case 24: - kwargs["last_update_status_reason"] = de.read_string( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["LastUpdateStatusReason"] - ) - - case 25: - kwargs["last_update_status_reason_code"] = ( - LastUpdateStatusReasonCode( - de.read_string( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members[ - "LastUpdateStatusReasonCode" - ] - ) - ) - ) - - case 26: - kwargs["file_system_configs"] = ( - _deserialize_file_system_config_list( - de, - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["FileSystemConfigs"], - ) - ) - - case 27: - kwargs["signing_profile_version_arn"] = de.read_string( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members[ - "SigningProfileVersionArn" - ] - ) - - case 28: - kwargs["signing_job_arn"] = de.read_string( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["SigningJobArn"] - ) - - case 29: - kwargs["package_type"] = PackageType( - de.read_string( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["PackageType"] - ) - ) - - case 30: - kwargs["image_config_response"] = ImageConfigResponse.deserialize( - de - ) - - case 31: - kwargs["architectures"] = _deserialize_architectures_list( - de, _SCHEMA_CREATE_FUNCTION_OUTPUT.members["Architectures"] - ) - - case 32: - kwargs["ephemeral_storage"] = EphemeralStorage.deserialize(de) - - case 33: - kwargs["snap_start"] = SnapStartResponse.deserialize(de) - - case 34: - kwargs["runtime_version_config"] = RuntimeVersionConfig.deserialize( - de - ) - - case 35: - kwargs["logging_config"] = LoggingConfig.deserialize(de) - - case 36: - kwargs["tenancy_config"] = TenancyConfig.deserialize(de) - - case 37: - kwargs["capacity_provider_config"] = ( - CapacityProviderConfig.deserialize(de) - ) - - case 38: - kwargs["config_sha256"] = de.read_string( - _SCHEMA_CREATE_FUNCTION_OUTPUT.members["ConfigSha256"] - ) - - case 39: - kwargs["durable_config"] = DurableConfig.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_FUNCTION_OUTPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class FunctionVersionsPerCapacityProviderLimitExceededException(ServiceError): - """ - The maximum number of function versions that can be associated with a - single capacity provider has been exceeded. For more information, see - [Lambda - quotas](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html). - """ - - fault: Literal["client", "server"] | None = "client" - - type: str | None = None - """The exception type.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_FUNCTION_VERSIONS_PER_CAPACITY_PROVIDER_LIMIT_EXCEEDED_EXCEPTION, - self, - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_FUNCTION_VERSIONS_PER_CAPACITY_PROVIDER_LIMIT_EXCEEDED_EXCEPTION.members[ - "Type" - ], - self.type, - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_FUNCTION_VERSIONS_PER_CAPACITY_PROVIDER_LIMIT_EXCEEDED_EXCEPTION.members[ - "message" - ], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_FUNCTION_VERSIONS_PER_CAPACITY_PROVIDER_LIMIT_EXCEEDED_EXCEPTION.members[ - "Type" - ] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_FUNCTION_VERSIONS_PER_CAPACITY_PROVIDER_LIMIT_EXCEEDED_EXCEPTION.members[ - "message" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_FUNCTION_VERSIONS_PER_CAPACITY_PROVIDER_LIMIT_EXCEEDED_EXCEPTION, - consumer=_consumer, - ) - return kwargs - - -@dataclass(kw_only=True) -class InvalidCodeSignatureException(ServiceError): - """ - The code signature failed the integrity check. If the integrity check - fails, then Lambda blocks deployment, even if the code signing policy is - set to WARN. - """ - - fault: Literal["client", "server"] | None = "client" - - type: str | None = None - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_CODE_SIGNATURE_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_INVALID_CODE_SIGNATURE_EXCEPTION.members["Type"], self.type - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_CODE_SIGNATURE_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_INVALID_CODE_SIGNATURE_EXCEPTION.members["Type"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_CODE_SIGNATURE_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVALID_CODE_SIGNATURE_EXCEPTION, consumer=_consumer - ) - return kwargs - - -CREATE_FUNCTION = APIOperation( - input=CreateFunctionInput, - output=CreateFunctionOutput, - schema=_SCHEMA_CREATE_FUNCTION, - input_schema=_SCHEMA_CREATE_FUNCTION_INPUT, - output_schema=_SCHEMA_CREATE_FUNCTION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#CodeSigningConfigNotFoundException" - ): CodeSigningConfigNotFoundException, - ShapeID( - "com.amazonaws.lambda#CodeStorageExceededException" - ): CodeStorageExceededException, - ShapeID( - "com.amazonaws.lambda#CodeVerificationFailedException" - ): CodeVerificationFailedException, - ShapeID( - "com.amazonaws.lambda#FunctionVersionsPerCapacityProviderLimitExceededException" - ): FunctionVersionsPerCapacityProviderLimitExceededException, - ShapeID( - "com.amazonaws.lambda#InvalidCodeSignatureException" - ): InvalidCodeSignatureException, - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceConflictException" - ): ResourceConflictException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CODE_SIGNING_CONFIG_NOT_FOUND_EXCEPTION, - _SCHEMA_CODE_STORAGE_EXCEEDED_EXCEPTION, - _SCHEMA_CODE_VERIFICATION_FAILED_EXCEPTION, - _SCHEMA_FUNCTION_VERSIONS_PER_CAPACITY_PROVIDER_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_INVALID_CODE_SIGNATURE_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -def _serialize_headers_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_headers_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class Cors: - """ - The [cross-origin resource sharing - (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) settings - for your Lambda function URL. Use CORS to grant access to your function - URL from any origin. You can also use CORS to control access for - specific HTTP headers and methods in requests to your function URL. - """ - - allow_credentials: bool | None = None - """ - Whether to allow cookies or other credentials in requests to your - function URL. The default is `false`. - """ - - allow_headers: list[str] | None = None - """ - The HTTP headers that origins can include in requests to your function - URL. For example: `Date`, `Keep-Alive`, `X-Custom-Header`. - """ - - allow_methods: list[str] | None = None - """ - The HTTP methods that are allowed when calling your function URL. For - example: `GET`, `POST`, `DELETE`, or the wildcard character (`*`). - """ - - allow_origins: list[str] | None = None - """ - The origins that can access your function URL. You can list any number - of specific origins, separated by a comma. For example: - `https://www.example.com`, `http://localhost:60905`. - - Alternatively, you can grant access to all origins using the wildcard - character (`*`). - """ - - expose_headers: list[str] | None = None - """ - The HTTP headers in your function response that you want to expose to - origins that call your function URL. For example: `Date`, `Keep-Alive`, - `X-Custom-Header`. - """ - - max_age: int | None = None - """ - The maximum amount of time, in seconds, that web browsers can cache - results of a preflight request. By default, this is set to `0`, which - means that the browser doesn't cache results. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CORS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.allow_credentials is not None: - serializer.write_boolean( - _SCHEMA_CORS.members["AllowCredentials"], self.allow_credentials - ) - - if self.allow_headers is not None: - _serialize_headers_list( - serializer, _SCHEMA_CORS.members["AllowHeaders"], self.allow_headers - ) - - if self.allow_methods is not None: - _serialize_allow_methods_list( - serializer, _SCHEMA_CORS.members["AllowMethods"], self.allow_methods - ) - - if self.allow_origins is not None: - _serialize_allow_origins_list( - serializer, _SCHEMA_CORS.members["AllowOrigins"], self.allow_origins - ) - - if self.expose_headers is not None: - _serialize_headers_list( - serializer, _SCHEMA_CORS.members["ExposeHeaders"], self.expose_headers - ) - - if self.max_age is not None: - serializer.write_integer(_SCHEMA_CORS.members["MaxAge"], self.max_age) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["allow_credentials"] = de.read_boolean( - _SCHEMA_CORS.members["AllowCredentials"] - ) - - case 1: - kwargs["allow_headers"] = _deserialize_headers_list( - de, _SCHEMA_CORS.members["AllowHeaders"] - ) - - case 2: - kwargs["allow_methods"] = _deserialize_allow_methods_list( - de, _SCHEMA_CORS.members["AllowMethods"] - ) - - case 3: - kwargs["allow_origins"] = _deserialize_allow_origins_list( - de, _SCHEMA_CORS.members["AllowOrigins"] - ) - - case 4: - kwargs["expose_headers"] = _deserialize_headers_list( - de, _SCHEMA_CORS.members["ExposeHeaders"] - ) - - case 5: - kwargs["max_age"] = de.read_integer(_SCHEMA_CORS.members["MaxAge"]) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CORS, consumer=_consumer) - return kwargs - - -class InvokeMode(UnknownEnumMixin, StrEnum): - BUFFERED = "BUFFERED" - RESPONSE_STREAM = "RESPONSE_STREAM" - - -@dataclass(kw_only=True) -class CreateFunctionUrlConfigInput: - """Dataclass for CreateFunctionUrlConfigInput structure.""" - - function_name: str | None = None - """ - The name or ARN of the Lambda function. - - **Name formats** - - - **Function name** -- `my-function`. - - - **Function ARN** -- - `arn:aws:lambda:us-west-2:123456789012:function:my-function`. - - - **Partial ARN** -- `123456789012:function:my-function`. - - The length constraint applies only to the full ARN. If you specify only - the function name, it is limited to 64 characters in length. - """ - - qualifier: str | None = None - """The alias name.""" - - auth_type: str | None = None - """ - The type of authentication that your function URL uses. Set to `AWS_IAM` - if you want to restrict access to authenticated users only. Set to - `NONE` if you want to bypass IAM authentication to create a public - endpoint. For more information, see [Control access to Lambda function - URLs](https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html). - """ - - cors: Cors | None = None - """ - The [cross-origin resource sharing - (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) settings - for your function URL. - """ - - invoke_mode: str | None = None - """ - Use one of the following options: - - - `BUFFERED` -- This is the default option. Lambda invokes your function - using the `Invoke` API operation. Invocation results are available - when the payload is complete. The maximum payload size is 6 MB. - - - `RESPONSE_STREAM` -- Your function streams payload results as they - become available. Lambda invokes your function using the - `InvokeWithResponseStream` API operation. The maximum response payload - size is 200 MB. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_FUNCTION_URL_CONFIG_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_CREATE_FUNCTION_URL_CONFIG_INPUT.members["FunctionName"], - self.function_name, - ) - - if self.qualifier is not None: - serializer.write_string( - _SCHEMA_CREATE_FUNCTION_URL_CONFIG_INPUT.members["Qualifier"], - self.qualifier, - ) - - if self.auth_type is not None: - serializer.write_string( - _SCHEMA_CREATE_FUNCTION_URL_CONFIG_INPUT.members["AuthType"], - self.auth_type, - ) - - if self.cors is not None: - serializer.write_struct( - _SCHEMA_CREATE_FUNCTION_URL_CONFIG_INPUT.members["Cors"], self.cors - ) - - if self.invoke_mode is not None: - serializer.write_string( - _SCHEMA_CREATE_FUNCTION_URL_CONFIG_INPUT.members["InvokeMode"], - self.invoke_mode, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_CREATE_FUNCTION_URL_CONFIG_INPUT.members["FunctionName"] - ) - - case 1: - kwargs["qualifier"] = de.read_string( - _SCHEMA_CREATE_FUNCTION_URL_CONFIG_INPUT.members["Qualifier"] - ) - - case 2: - kwargs["auth_type"] = FunctionUrlAuthType( - de.read_string( - _SCHEMA_CREATE_FUNCTION_URL_CONFIG_INPUT.members["AuthType"] - ) - ) - - case 3: - kwargs["cors"] = Cors.deserialize(de) - - case 4: - kwargs["invoke_mode"] = InvokeMode( - de.read_string( - _SCHEMA_CREATE_FUNCTION_URL_CONFIG_INPUT.members[ - "InvokeMode" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_FUNCTION_URL_CONFIG_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CreateFunctionUrlConfigOutput: - """Dataclass for CreateFunctionUrlConfigOutput structure.""" - - function_url: str - """The HTTP URL endpoint for your function.""" - - function_arn: str - """The Amazon Resource Name (ARN) of your function.""" - - auth_type: str - """ - The type of authentication that your function URL uses. Set to `AWS_IAM` - if you want to restrict access to authenticated users only. Set to - `NONE` if you want to bypass IAM authentication to create a public - endpoint. For more information, see [Control access to Lambda function - URLs](https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html). - """ - - creation_time: str - """ - When the function URL was created, in [ISO-8601 - format](https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). - """ - - cors: Cors | None = None - """ - The [cross-origin resource sharing - (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) settings - for your function URL. - """ - - invoke_mode: str | None = None - """ - Use one of the following options: - - - `BUFFERED` -- This is the default option. Lambda invokes your function - using the `Invoke` API operation. Invocation results are available - when the payload is complete. The maximum payload size is 6 MB. - - - `RESPONSE_STREAM` -- Your function streams payload results as they - become available. Lambda invokes your function using the - `InvokeWithResponseStream` API operation. The maximum response payload - size is 200 MB. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_FUNCTION_URL_CONFIG_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_FUNCTION_URL_CONFIG_OUTPUT.members["FunctionUrl"], - self.function_url, - ) - serializer.write_string( - _SCHEMA_CREATE_FUNCTION_URL_CONFIG_OUTPUT.members["FunctionArn"], - self.function_arn, - ) - serializer.write_string( - _SCHEMA_CREATE_FUNCTION_URL_CONFIG_OUTPUT.members["AuthType"], - self.auth_type, - ) - if self.cors is not None: - serializer.write_struct( - _SCHEMA_CREATE_FUNCTION_URL_CONFIG_OUTPUT.members["Cors"], self.cors - ) - - serializer.write_string( - _SCHEMA_CREATE_FUNCTION_URL_CONFIG_OUTPUT.members["CreationTime"], - self.creation_time, - ) - if self.invoke_mode is not None: - serializer.write_string( - _SCHEMA_CREATE_FUNCTION_URL_CONFIG_OUTPUT.members["InvokeMode"], - self.invoke_mode, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_url"] = de.read_string( - _SCHEMA_CREATE_FUNCTION_URL_CONFIG_OUTPUT.members["FunctionUrl"] - ) - - case 1: - kwargs["function_arn"] = de.read_string( - _SCHEMA_CREATE_FUNCTION_URL_CONFIG_OUTPUT.members["FunctionArn"] - ) - - case 2: - kwargs["auth_type"] = FunctionUrlAuthType( - de.read_string( - _SCHEMA_CREATE_FUNCTION_URL_CONFIG_OUTPUT.members[ - "AuthType" - ] - ) - ) - - case 3: - kwargs["cors"] = Cors.deserialize(de) - - case 4: - kwargs["creation_time"] = de.read_string( - _SCHEMA_CREATE_FUNCTION_URL_CONFIG_OUTPUT.members[ - "CreationTime" - ] - ) - - case 5: - kwargs["invoke_mode"] = InvokeMode( - de.read_string( - _SCHEMA_CREATE_FUNCTION_URL_CONFIG_OUTPUT.members[ - "InvokeMode" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_FUNCTION_URL_CONFIG_OUTPUT, consumer=_consumer - ) - if "function_url" not in kwargs: - kwargs["function_url"] = "" - if "function_arn" not in kwargs: - kwargs["function_arn"] = "" - if "auth_type" not in kwargs: - kwargs["auth_type"] = FunctionUrlAuthType._corrected("") - if "creation_time" not in kwargs: - kwargs["creation_time"] = "" - return kwargs - - -CREATE_FUNCTION_URL_CONFIG = APIOperation( - input=CreateFunctionUrlConfigInput, - output=CreateFunctionUrlConfigOutput, - schema=_SCHEMA_CREATE_FUNCTION_URL_CONFIG, - input_schema=_SCHEMA_CREATE_FUNCTION_URL_CONFIG_INPUT, - output_schema=_SCHEMA_CREATE_FUNCTION_URL_CONFIG_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceConflictException" - ): ResourceConflictException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteFunctionCodeSigningConfigInput: - """Dataclass for DeleteFunctionCodeSigningConfigInput structure.""" - - function_name: str | None = None - """ - The name or ARN of the Lambda function. - - **Name formats** - - - **Function name** - `MyFunction`. - - - **Function ARN** - - `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`. - - - **Partial ARN** - `123456789012:function:MyFunction`. - - The length constraint applies only to the full ARN. If you specify only - the function name, it is limited to 64 characters in length. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_FUNCTION_CODE_SIGNING_CONFIG_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_DELETE_FUNCTION_CODE_SIGNING_CONFIG_INPUT.members[ - "FunctionName" - ], - self.function_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_DELETE_FUNCTION_CODE_SIGNING_CONFIG_INPUT.members[ - "FunctionName" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_FUNCTION_CODE_SIGNING_CONFIG_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteFunctionCodeSigningConfigOutput: - """Dataclass for DeleteFunctionCodeSigningConfigOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DELETE_FUNCTION_CODE_SIGNING_CONFIG_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_FUNCTION_CODE_SIGNING_CONFIG_OUTPUT, consumer=_consumer - ) - return kwargs - - -DELETE_FUNCTION_CODE_SIGNING_CONFIG = APIOperation( - input=DeleteFunctionCodeSigningConfigInput, - output=DeleteFunctionCodeSigningConfigOutput, - schema=_SCHEMA_DELETE_FUNCTION_CODE_SIGNING_CONFIG, - input_schema=_SCHEMA_DELETE_FUNCTION_CODE_SIGNING_CONFIG_INPUT, - output_schema=_SCHEMA_DELETE_FUNCTION_CODE_SIGNING_CONFIG_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#CodeSigningConfigNotFoundException" - ): CodeSigningConfigNotFoundException, - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceConflictException" - ): ResourceConflictException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CODE_SIGNING_CONFIG_NOT_FOUND_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteFunctionConcurrencyInput: - """Dataclass for DeleteFunctionConcurrencyInput structure.""" - - function_name: str | None = None - """ - The name or ARN of the Lambda function. - - **Name formats** - - - **Function name** -- `my-function`. - - - **Function ARN** -- - `arn:aws:lambda:us-west-2:123456789012:function:my-function`. - - - **Partial ARN** -- `123456789012:function:my-function`. - - The length constraint applies only to the full ARN. If you specify only - the function name, it is limited to 64 characters in length. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_FUNCTION_CONCURRENCY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_DELETE_FUNCTION_CONCURRENCY_INPUT.members["FunctionName"], - self.function_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_DELETE_FUNCTION_CONCURRENCY_INPUT.members[ - "FunctionName" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_FUNCTION_CONCURRENCY_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteFunctionConcurrencyOutput: - """Dataclass for DeleteFunctionConcurrencyOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_FUNCTION_CONCURRENCY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_FUNCTION_CONCURRENCY_OUTPUT, consumer=_consumer - ) - return kwargs - - -DELETE_FUNCTION_CONCURRENCY = APIOperation( - input=DeleteFunctionConcurrencyInput, - output=DeleteFunctionConcurrencyOutput, - schema=_SCHEMA_DELETE_FUNCTION_CONCURRENCY, - input_schema=_SCHEMA_DELETE_FUNCTION_CONCURRENCY_INPUT, - output_schema=_SCHEMA_DELETE_FUNCTION_CONCURRENCY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceConflictException" - ): ResourceConflictException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteFunctionUrlConfigInput: - """Dataclass for DeleteFunctionUrlConfigInput structure.""" - - function_name: str | None = None - """ - The name or ARN of the Lambda function. - - **Name formats** - - - **Function name** -- `my-function`. - - - **Function ARN** -- - `arn:aws:lambda:us-west-2:123456789012:function:my-function`. - - - **Partial ARN** -- `123456789012:function:my-function`. - - The length constraint applies only to the full ARN. If you specify only - the function name, it is limited to 64 characters in length. - """ - - qualifier: str | None = None - """The alias name.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_FUNCTION_URL_CONFIG_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_DELETE_FUNCTION_URL_CONFIG_INPUT.members["FunctionName"], - self.function_name, - ) - - if self.qualifier is not None: - serializer.write_string( - _SCHEMA_DELETE_FUNCTION_URL_CONFIG_INPUT.members["Qualifier"], - self.qualifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_DELETE_FUNCTION_URL_CONFIG_INPUT.members["FunctionName"] - ) - - case 1: - kwargs["qualifier"] = de.read_string( - _SCHEMA_DELETE_FUNCTION_URL_CONFIG_INPUT.members["Qualifier"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_FUNCTION_URL_CONFIG_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteFunctionUrlConfigOutput: - """Dataclass for DeleteFunctionUrlConfigOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_FUNCTION_URL_CONFIG_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_FUNCTION_URL_CONFIG_OUTPUT, consumer=_consumer - ) - return kwargs - - -DELETE_FUNCTION_URL_CONFIG = APIOperation( - input=DeleteFunctionUrlConfigInput, - output=DeleteFunctionUrlConfigOutput, - schema=_SCHEMA_DELETE_FUNCTION_URL_CONFIG, - input_schema=_SCHEMA_DELETE_FUNCTION_URL_CONFIG_INPUT, - output_schema=_SCHEMA_DELETE_FUNCTION_URL_CONFIG_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceConflictException" - ): ResourceConflictException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetFunctionInput: - """Dataclass for GetFunctionInput structure.""" - - function_name: str | None = None - """ - The name or ARN of the Lambda function, version, or alias. - - **Name formats** - - - **Function name** -- `my-function` (name-only), `my-function:v1` (with - alias). - - - **Function ARN** -- - `arn:aws:lambda:us-west-2:123456789012:function:my-function`. - - - **Partial ARN** -- `123456789012:function:my-function`. - - You can append a version number or alias to any of the formats. The - length constraint applies only to the full ARN. If you specify only the - function name, it is limited to 64 characters in length. - """ - - qualifier: str | None = None - """ - Specify a version or alias to get details about a published version of - the function. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_FUNCTION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_GET_FUNCTION_INPUT.members["FunctionName"], self.function_name - ) - - if self.qualifier is not None: - serializer.write_string( - _SCHEMA_GET_FUNCTION_INPUT.members["Qualifier"], self.qualifier - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_GET_FUNCTION_INPUT.members["FunctionName"] - ) - - case 1: - kwargs["qualifier"] = de.read_string( - _SCHEMA_GET_FUNCTION_INPUT.members["Qualifier"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_FUNCTION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class FunctionCodeLocationError: - """ - Contains details about an error that occurred when Lambda attempted to - retrieve a function's deployment package. - """ - - error_code: str | None = None - """ - The error code that identifies why Lambda failed to retrieve the - deployment package. - """ - - message: str | None = field(repr=False, default=None) - """ - The human-readable message that describes why Lambda failed to retrieve - the deployment package. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FUNCTION_CODE_LOCATION_ERROR, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.error_code is not None: - serializer.write_string( - _SCHEMA_FUNCTION_CODE_LOCATION_ERROR.members["ErrorCode"], - self.error_code, - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_FUNCTION_CODE_LOCATION_ERROR.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["error_code"] = de.read_string( - _SCHEMA_FUNCTION_CODE_LOCATION_ERROR.members["ErrorCode"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_FUNCTION_CODE_LOCATION_ERROR.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_FUNCTION_CODE_LOCATION_ERROR, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ResolvedS3Object: - """ - Details about the resolved Amazon S3 object that contains a function's - deployment package. - """ - - s3_bucket: str | None = None - """The Amazon S3 bucket that contains the deployment package.""" - - s3_key: str | None = None - """The Amazon S3 key of the deployment package.""" - - s3_object_version: str | None = None - """The version of the deployment package object.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESOLVED_S3_OBJECT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.s3_bucket is not None: - serializer.write_string( - _SCHEMA_RESOLVED_S3_OBJECT.members["S3Bucket"], self.s3_bucket - ) - - if self.s3_key is not None: - serializer.write_string( - _SCHEMA_RESOLVED_S3_OBJECT.members["S3Key"], self.s3_key - ) - - if self.s3_object_version is not None: - serializer.write_string( - _SCHEMA_RESOLVED_S3_OBJECT.members["S3ObjectVersion"], - self.s3_object_version, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["s3_bucket"] = de.read_string( - _SCHEMA_RESOLVED_S3_OBJECT.members["S3Bucket"] - ) - - case 1: - kwargs["s3_key"] = de.read_string( - _SCHEMA_RESOLVED_S3_OBJECT.members["S3Key"] - ) - - case 2: - kwargs["s3_object_version"] = de.read_string( - _SCHEMA_RESOLVED_S3_OBJECT.members["S3ObjectVersion"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RESOLVED_S3_OBJECT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class FunctionCodeLocation: - """Details about a function's deployment package.""" - - repository_type: str | None = None - """The service that's hosting the file.""" - - location: str | None = None - """A presigned URL that you can use to download the deployment package.""" - - image_uri: str | None = None - """URI of a container image in the Amazon ECR registry.""" - - resolved_image_uri: str | None = None - """The resolved URI for the image.""" - - resolved_s3_object: ResolvedS3Object | None = None - """The resolved Amazon S3 object that contains the deployment package.""" - - source_kms_key_arn: str | None = None - """ - The ARN of the Key Management Service (KMS) customer managed key that's - used to encrypt your function's .zip deployment package. If you don't - provide a customer managed key, Lambda uses an [Amazon Web Services - owned - key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk). - """ - - error: FunctionCodeLocationError | None = None - """ - An object that contains details about an error related to function - deployment package retrieval. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FUNCTION_CODE_LOCATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.repository_type is not None: - serializer.write_string( - _SCHEMA_FUNCTION_CODE_LOCATION.members["RepositoryType"], - self.repository_type, - ) - - if self.location is not None: - serializer.write_string( - _SCHEMA_FUNCTION_CODE_LOCATION.members["Location"], self.location - ) - - if self.image_uri is not None: - serializer.write_string( - _SCHEMA_FUNCTION_CODE_LOCATION.members["ImageUri"], self.image_uri - ) - - if self.resolved_image_uri is not None: - serializer.write_string( - _SCHEMA_FUNCTION_CODE_LOCATION.members["ResolvedImageUri"], - self.resolved_image_uri, - ) - - if self.resolved_s3_object is not None: - serializer.write_struct( - _SCHEMA_FUNCTION_CODE_LOCATION.members["ResolvedS3Object"], - self.resolved_s3_object, - ) - - if self.source_kms_key_arn is not None: - serializer.write_string( - _SCHEMA_FUNCTION_CODE_LOCATION.members["SourceKMSKeyArn"], - self.source_kms_key_arn, - ) - - if self.error is not None: - serializer.write_struct( - _SCHEMA_FUNCTION_CODE_LOCATION.members["Error"], self.error - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["repository_type"] = de.read_string( - _SCHEMA_FUNCTION_CODE_LOCATION.members["RepositoryType"] - ) - - case 1: - kwargs["location"] = de.read_string( - _SCHEMA_FUNCTION_CODE_LOCATION.members["Location"] - ) - - case 2: - kwargs["image_uri"] = de.read_string( - _SCHEMA_FUNCTION_CODE_LOCATION.members["ImageUri"] - ) - - case 3: - kwargs["resolved_image_uri"] = de.read_string( - _SCHEMA_FUNCTION_CODE_LOCATION.members["ResolvedImageUri"] - ) - - case 4: - kwargs["resolved_s3_object"] = ResolvedS3Object.deserialize(de) - - case 5: - kwargs["source_kms_key_arn"] = de.read_string( - _SCHEMA_FUNCTION_CODE_LOCATION.members["SourceKMSKeyArn"] - ) - - case 6: - kwargs["error"] = FunctionCodeLocationError.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FUNCTION_CODE_LOCATION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Concurrency: - """Dataclass for Concurrency structure.""" - - reserved_concurrent_executions: int | None = None - """ - The number of concurrent executions that are reserved for this function. - For more information, see [Managing Lambda reserved - concurrency](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONCURRENCY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.reserved_concurrent_executions is not None: - serializer.write_integer( - _SCHEMA_CONCURRENCY.members["ReservedConcurrentExecutions"], - self.reserved_concurrent_executions, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["reserved_concurrent_executions"] = de.read_integer( - _SCHEMA_CONCURRENCY.members["ReservedConcurrentExecutions"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONCURRENCY, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class FunctionConfiguration: - """Details about a function's configuration.""" - - function_name: str | None = None - """The name of the function.""" - - function_arn: str | None = None - """The function's Amazon Resource Name (ARN).""" - - runtime: str | None = None - """ - The identifier of the function's - [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html). - Runtime is required if the deployment package is a .zip file archive. - Specifying a runtime results in an error if you're deploying a function - using a container image. - - The following list includes deprecated runtimes. Lambda blocks creating - new functions and updating existing functions shortly after each runtime - is deprecated. For more information, see [Runtime use after - deprecation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-deprecation-levels). - - For a list of all currently supported runtimes, see [Supported - runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtimes-supported). - """ - - role: str | None = None - """The function's execution role.""" - - handler: str | None = None - """The function that Lambda calls to begin running your function.""" - - code_size: int = 0 - """The size of the function's deployment package, in bytes.""" - - description: str | None = None - """The function's description.""" - - timeout: int | None = None - """ - The amount of time in seconds that Lambda allows a function to run - before stopping it. - """ - - memory_size: int | None = None - """The amount of memory available to the function at runtime.""" - - last_modified: str | None = None - """ - The date and time that the function was last updated, in [ISO-8601 - format](https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). - """ - - code_sha256: str | None = None - """The SHA256 hash of the function's deployment package.""" - - version: str | None = None - """The version of the Lambda function.""" - - vpc_config: VpcConfigResponse | None = None - """The function's networking configuration.""" - - dead_letter_config: DeadLetterConfig | None = None - """The function's dead letter queue.""" - - environment: EnvironmentResponse | None = None - """ - The function's [environment - variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html). - Omitted from CloudTrail logs. - """ - - kms_key_arn: str | None = None - """ - The ARN of the Key Management Service (KMS) customer managed key that's - used to encrypt the following resources: - - - The function's [environment - variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-encryption). - - - The function's [Lambda - SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart-security.html) - snapshots. - - - When used with `SourceKMSKeyArn`, the unzipped version of the .zip - deployment package that's used for function invocations. For more - information, see [Specifying a customer managed key for - Lambda](https://docs.aws.amazon.com/lambda/latest/dg/encrypt-zip-package.html#enable-zip-custom-encryption). - - - The optimized version of the container image that's used for function - invocations. Note that this is not the same key that's used to - protect your container image in the Amazon Elastic Container Registry - (Amazon ECR). For more information, see [Function - lifecycle](https://docs.aws.amazon.com/lambda/latest/dg/images-create.html#images-lifecycle). - - If you don't provide a customer managed key, Lambda uses an [Amazon Web - Services owned - key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk) - or an [Amazon Web Services managed - key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk). - """ - - tracing_config: TracingConfigResponse | None = None - """The function's X-Ray tracing configuration.""" - - master_arn: str | None = None - """For Lambda@Edge functions, the ARN of the main function.""" - - revision_id: str | None = None - """The latest updated revision of the function or alias.""" - - layers: list[Layer] | None = None - """ - The function's - [layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html). - """ - - state: str | None = None - """ - The current state of the function. When the state is `Inactive`, you can - reactivate the function by invoking it. - """ - - state_reason: str | None = None - """The reason for the function's current state.""" - - state_reason_code: str | None = None - """ - The reason code for the function's current state. When the code is - `Creating`, you can't invoke or modify the function. - """ - - last_update_status: str | None = None - """ - The status of the last update that was performed on the function. This - is first set to `Successful` after function creation completes. - """ - - last_update_status_reason: str | None = None - """The reason for the last update that was performed on the function.""" - - last_update_status_reason_code: str | None = None - """The reason code for the last update that was performed on the function.""" - - file_system_configs: list[FileSystemConfig] | None = None - """ - Connection settings for an [Amazon EFS file - system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html) - or an [Amazon S3 file - system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html). - """ - - signing_profile_version_arn: str | None = None - """The ARN of the signing profile version.""" - - signing_job_arn: str | None = None - """The ARN of the signing job.""" - - package_type: str | None = None - """ - The type of deployment package. Set to `Image` for container image and - set `Zip` for .zip file archive. - """ - - image_config_response: ImageConfigResponse | None = None - """The function's image configuration values.""" - - architectures: list[str] | None = None - """ - The instruction set architecture that the function supports. - Architecture is a string array with one of the valid values. The default - architecture value is `x86_64`. - """ - - ephemeral_storage: EphemeralStorage | None = None - """ - The size of the function's `/tmp` directory in MB. The default value is - 512, but can be any whole number between 512 and 10,240 MB. For more - information, see [Configuring ephemeral storage - (console)](https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-ephemeral-storage). - """ - - snap_start: SnapStartResponse | None = None - """ - Set `ApplyOn` to `PublishedVersions` to create a snapshot of the - initialized execution environment when you publish a function version. - For more information, see [Improving startup performance with Lambda - SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html). - """ - - runtime_version_config: RuntimeVersionConfig | None = None - """The ARN of the runtime and any errors that occured.""" - - logging_config: LoggingConfig | None = None - """The function's Amazon CloudWatch Logs configuration settings.""" - - tenancy_config: TenancyConfig | None = None - """ - The function's tenant isolation configuration settings. Determines - whether the Lambda function runs on a shared or dedicated infrastructure - per unique tenant. - """ - - capacity_provider_config: CapacityProviderConfig | None = None - """ - Configuration for the capacity provider that manages compute resources - for Lambda functions. - """ - - config_sha256: str | None = None - """The SHA256 hash of the function configuration.""" - - durable_config: DurableConfig | None = None - """ - The function's durable execution configuration settings, if the - function is configured for durability. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FUNCTION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_FUNCTION_CONFIGURATION.members["FunctionName"], - self.function_name, - ) - - if self.function_arn is not None: - serializer.write_string( - _SCHEMA_FUNCTION_CONFIGURATION.members["FunctionArn"], self.function_arn - ) - - if self.runtime is not None: - serializer.write_string( - _SCHEMA_FUNCTION_CONFIGURATION.members["Runtime"], self.runtime - ) - - if self.role is not None: - serializer.write_string( - _SCHEMA_FUNCTION_CONFIGURATION.members["Role"], self.role - ) - - if self.handler is not None: - serializer.write_string( - _SCHEMA_FUNCTION_CONFIGURATION.members["Handler"], self.handler - ) - - serializer.write_long( - _SCHEMA_FUNCTION_CONFIGURATION.members["CodeSize"], self.code_size - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_FUNCTION_CONFIGURATION.members["Description"], self.description - ) - - if self.timeout is not None: - serializer.write_integer( - _SCHEMA_FUNCTION_CONFIGURATION.members["Timeout"], self.timeout - ) - - if self.memory_size is not None: - serializer.write_integer( - _SCHEMA_FUNCTION_CONFIGURATION.members["MemorySize"], self.memory_size - ) - - if self.last_modified is not None: - serializer.write_string( - _SCHEMA_FUNCTION_CONFIGURATION.members["LastModified"], - self.last_modified, - ) - - if self.code_sha256 is not None: - serializer.write_string( - _SCHEMA_FUNCTION_CONFIGURATION.members["CodeSha256"], self.code_sha256 - ) - - if self.version is not None: - serializer.write_string( - _SCHEMA_FUNCTION_CONFIGURATION.members["Version"], self.version - ) - - if self.vpc_config is not None: - serializer.write_struct( - _SCHEMA_FUNCTION_CONFIGURATION.members["VpcConfig"], self.vpc_config - ) - - if self.dead_letter_config is not None: - serializer.write_struct( - _SCHEMA_FUNCTION_CONFIGURATION.members["DeadLetterConfig"], - self.dead_letter_config, - ) - - if self.environment is not None: - serializer.write_struct( - _SCHEMA_FUNCTION_CONFIGURATION.members["Environment"], self.environment - ) - - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_FUNCTION_CONFIGURATION.members["KMSKeyArn"], self.kms_key_arn - ) - - if self.tracing_config is not None: - serializer.write_struct( - _SCHEMA_FUNCTION_CONFIGURATION.members["TracingConfig"], - self.tracing_config, - ) - - if self.master_arn is not None: - serializer.write_string( - _SCHEMA_FUNCTION_CONFIGURATION.members["MasterArn"], self.master_arn - ) - - if self.revision_id is not None: - serializer.write_string( - _SCHEMA_FUNCTION_CONFIGURATION.members["RevisionId"], self.revision_id - ) - - if self.layers is not None: - _serialize_layers_reference_list( - serializer, - _SCHEMA_FUNCTION_CONFIGURATION.members["Layers"], - self.layers, - ) - - if self.state is not None: - serializer.write_string( - _SCHEMA_FUNCTION_CONFIGURATION.members["State"], self.state - ) - - if self.state_reason is not None: - serializer.write_string( - _SCHEMA_FUNCTION_CONFIGURATION.members["StateReason"], self.state_reason - ) - - if self.state_reason_code is not None: - serializer.write_string( - _SCHEMA_FUNCTION_CONFIGURATION.members["StateReasonCode"], - self.state_reason_code, - ) - - if self.last_update_status is not None: - serializer.write_string( - _SCHEMA_FUNCTION_CONFIGURATION.members["LastUpdateStatus"], - self.last_update_status, - ) - - if self.last_update_status_reason is not None: - serializer.write_string( - _SCHEMA_FUNCTION_CONFIGURATION.members["LastUpdateStatusReason"], - self.last_update_status_reason, - ) - - if self.last_update_status_reason_code is not None: - serializer.write_string( - _SCHEMA_FUNCTION_CONFIGURATION.members["LastUpdateStatusReasonCode"], - self.last_update_status_reason_code, - ) - - if self.file_system_configs is not None: - _serialize_file_system_config_list( - serializer, - _SCHEMA_FUNCTION_CONFIGURATION.members["FileSystemConfigs"], - self.file_system_configs, - ) - - if self.signing_profile_version_arn is not None: - serializer.write_string( - _SCHEMA_FUNCTION_CONFIGURATION.members["SigningProfileVersionArn"], - self.signing_profile_version_arn, - ) - - if self.signing_job_arn is not None: - serializer.write_string( - _SCHEMA_FUNCTION_CONFIGURATION.members["SigningJobArn"], - self.signing_job_arn, - ) - - if self.package_type is not None: - serializer.write_string( - _SCHEMA_FUNCTION_CONFIGURATION.members["PackageType"], self.package_type - ) - - if self.image_config_response is not None: - serializer.write_struct( - _SCHEMA_FUNCTION_CONFIGURATION.members["ImageConfigResponse"], - self.image_config_response, - ) - - if self.architectures is not None: - _serialize_architectures_list( - serializer, - _SCHEMA_FUNCTION_CONFIGURATION.members["Architectures"], - self.architectures, - ) - - if self.ephemeral_storage is not None: - serializer.write_struct( - _SCHEMA_FUNCTION_CONFIGURATION.members["EphemeralStorage"], - self.ephemeral_storage, - ) - - if self.snap_start is not None: - serializer.write_struct( - _SCHEMA_FUNCTION_CONFIGURATION.members["SnapStart"], self.snap_start - ) - - if self.runtime_version_config is not None: - serializer.write_struct( - _SCHEMA_FUNCTION_CONFIGURATION.members["RuntimeVersionConfig"], - self.runtime_version_config, - ) - - if self.logging_config is not None: - serializer.write_struct( - _SCHEMA_FUNCTION_CONFIGURATION.members["LoggingConfig"], - self.logging_config, - ) - - if self.tenancy_config is not None: - serializer.write_struct( - _SCHEMA_FUNCTION_CONFIGURATION.members["TenancyConfig"], - self.tenancy_config, - ) - - if self.capacity_provider_config is not None: - serializer.write_struct( - _SCHEMA_FUNCTION_CONFIGURATION.members["CapacityProviderConfig"], - self.capacity_provider_config, - ) - - if self.config_sha256 is not None: - serializer.write_string( - _SCHEMA_FUNCTION_CONFIGURATION.members["ConfigSha256"], - self.config_sha256, - ) - - if self.durable_config is not None: - serializer.write_struct( - _SCHEMA_FUNCTION_CONFIGURATION.members["DurableConfig"], - self.durable_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_FUNCTION_CONFIGURATION.members["FunctionName"] - ) - - case 1: - kwargs["function_arn"] = de.read_string( - _SCHEMA_FUNCTION_CONFIGURATION.members["FunctionArn"] - ) - - case 2: - kwargs["runtime"] = Runtime( - de.read_string( - _SCHEMA_FUNCTION_CONFIGURATION.members["Runtime"] - ) - ) - - case 3: - kwargs["role"] = de.read_string( - _SCHEMA_FUNCTION_CONFIGURATION.members["Role"] - ) - - case 4: - kwargs["handler"] = de.read_string( - _SCHEMA_FUNCTION_CONFIGURATION.members["Handler"] - ) - - case 5: - kwargs["code_size"] = de.read_long( - _SCHEMA_FUNCTION_CONFIGURATION.members["CodeSize"] - ) - - case 6: - kwargs["description"] = de.read_string( - _SCHEMA_FUNCTION_CONFIGURATION.members["Description"] - ) - - case 7: - kwargs["timeout"] = de.read_integer( - _SCHEMA_FUNCTION_CONFIGURATION.members["Timeout"] - ) - - case 8: - kwargs["memory_size"] = de.read_integer( - _SCHEMA_FUNCTION_CONFIGURATION.members["MemorySize"] - ) - - case 9: - kwargs["last_modified"] = de.read_string( - _SCHEMA_FUNCTION_CONFIGURATION.members["LastModified"] - ) - - case 10: - kwargs["code_sha256"] = de.read_string( - _SCHEMA_FUNCTION_CONFIGURATION.members["CodeSha256"] - ) - - case 11: - kwargs["version"] = de.read_string( - _SCHEMA_FUNCTION_CONFIGURATION.members["Version"] - ) - - case 12: - kwargs["vpc_config"] = VpcConfigResponse.deserialize(de) - - case 13: - kwargs["dead_letter_config"] = DeadLetterConfig.deserialize(de) - - case 14: - kwargs["environment"] = EnvironmentResponse.deserialize(de) - - case 15: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_FUNCTION_CONFIGURATION.members["KMSKeyArn"] - ) - - case 16: - kwargs["tracing_config"] = TracingConfigResponse.deserialize(de) - - case 17: - kwargs["master_arn"] = de.read_string( - _SCHEMA_FUNCTION_CONFIGURATION.members["MasterArn"] - ) - - case 18: - kwargs["revision_id"] = de.read_string( - _SCHEMA_FUNCTION_CONFIGURATION.members["RevisionId"] - ) - - case 19: - kwargs["layers"] = _deserialize_layers_reference_list( - de, _SCHEMA_FUNCTION_CONFIGURATION.members["Layers"] - ) - - case 20: - kwargs["state"] = State( - de.read_string(_SCHEMA_FUNCTION_CONFIGURATION.members["State"]) - ) - - case 21: - kwargs["state_reason"] = de.read_string( - _SCHEMA_FUNCTION_CONFIGURATION.members["StateReason"] - ) - - case 22: - kwargs["state_reason_code"] = StateReasonCode( - de.read_string( - _SCHEMA_FUNCTION_CONFIGURATION.members["StateReasonCode"] - ) - ) - - case 23: - kwargs["last_update_status"] = LastUpdateStatus( - de.read_string( - _SCHEMA_FUNCTION_CONFIGURATION.members["LastUpdateStatus"] - ) - ) - - case 24: - kwargs["last_update_status_reason"] = de.read_string( - _SCHEMA_FUNCTION_CONFIGURATION.members["LastUpdateStatusReason"] - ) - - case 25: - kwargs["last_update_status_reason_code"] = ( - LastUpdateStatusReasonCode( - de.read_string( - _SCHEMA_FUNCTION_CONFIGURATION.members[ - "LastUpdateStatusReasonCode" - ] - ) - ) - ) - - case 26: - kwargs["file_system_configs"] = ( - _deserialize_file_system_config_list( - de, - _SCHEMA_FUNCTION_CONFIGURATION.members["FileSystemConfigs"], - ) - ) - - case 27: - kwargs["signing_profile_version_arn"] = de.read_string( - _SCHEMA_FUNCTION_CONFIGURATION.members[ - "SigningProfileVersionArn" - ] - ) - - case 28: - kwargs["signing_job_arn"] = de.read_string( - _SCHEMA_FUNCTION_CONFIGURATION.members["SigningJobArn"] - ) - - case 29: - kwargs["package_type"] = PackageType( - de.read_string( - _SCHEMA_FUNCTION_CONFIGURATION.members["PackageType"] - ) - ) - - case 30: - kwargs["image_config_response"] = ImageConfigResponse.deserialize( - de - ) - - case 31: - kwargs["architectures"] = _deserialize_architectures_list( - de, _SCHEMA_FUNCTION_CONFIGURATION.members["Architectures"] - ) - - case 32: - kwargs["ephemeral_storage"] = EphemeralStorage.deserialize(de) - - case 33: - kwargs["snap_start"] = SnapStartResponse.deserialize(de) - - case 34: - kwargs["runtime_version_config"] = RuntimeVersionConfig.deserialize( - de - ) - - case 35: - kwargs["logging_config"] = LoggingConfig.deserialize(de) - - case 36: - kwargs["tenancy_config"] = TenancyConfig.deserialize(de) - - case 37: - kwargs["capacity_provider_config"] = ( - CapacityProviderConfig.deserialize(de) - ) - - case 38: - kwargs["config_sha256"] = de.read_string( - _SCHEMA_FUNCTION_CONFIGURATION.members["ConfigSha256"] - ) - - case 39: - kwargs["durable_config"] = DurableConfig.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FUNCTION_CONFIGURATION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class TagsError: - """ - An object that contains details about an error related to retrieving - tags. - """ - - error_code: str - """The error code.""" - - message: str - """The error message.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TAGS_ERROR, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_TAGS_ERROR.members["ErrorCode"], self.error_code - ) - serializer.write_string(_SCHEMA_TAGS_ERROR.members["Message"], self.message) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["error_code"] = de.read_string( - _SCHEMA_TAGS_ERROR.members["ErrorCode"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_TAGS_ERROR.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TAGS_ERROR, consumer=_consumer) - if "error_code" not in kwargs: - kwargs["error_code"] = "" - if "message" not in kwargs: - kwargs["message"] = "" - return kwargs - - -@dataclass(kw_only=True) -class GetFunctionOutput: - """Dataclass for GetFunctionOutput structure.""" - - configuration: FunctionConfiguration | None = None - """The configuration of the function or version.""" - - code: FunctionCodeLocation | None = None - """The deployment package of the function or version.""" - - tags: dict[str, str] | None = None - """ - The function's - [tags](https://docs.aws.amazon.com/lambda/latest/dg/tagging.html). - Lambda returns tag data only if you have explicit allow permissions for - [lambda:ListTags](https://docs.aws.amazon.com/lambda/latest/api/API_ListTags.html). - """ - - tags_error: TagsError | None = None - """ - An object that contains details about an error related to retrieving - tags. - """ - - concurrency: Concurrency | None = None - """ - The function's [reserved - concurrency](https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html). - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_FUNCTION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.configuration is not None: - serializer.write_struct( - _SCHEMA_GET_FUNCTION_OUTPUT.members["Configuration"], self.configuration - ) - - if self.code is not None: - serializer.write_struct( - _SCHEMA_GET_FUNCTION_OUTPUT.members["Code"], self.code - ) - - if self.tags is not None: - _serialize_tags( - serializer, _SCHEMA_GET_FUNCTION_OUTPUT.members["Tags"], self.tags - ) - - if self.tags_error is not None: - serializer.write_struct( - _SCHEMA_GET_FUNCTION_OUTPUT.members["TagsError"], self.tags_error - ) - - if self.concurrency is not None: - serializer.write_struct( - _SCHEMA_GET_FUNCTION_OUTPUT.members["Concurrency"], self.concurrency - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["configuration"] = FunctionConfiguration.deserialize(de) - - case 1: - kwargs["code"] = FunctionCodeLocation.deserialize(de) - - case 2: - kwargs["tags"] = _deserialize_tags( - de, _SCHEMA_GET_FUNCTION_OUTPUT.members["Tags"] - ) - - case 3: - kwargs["tags_error"] = TagsError.deserialize(de) - - case 4: - kwargs["concurrency"] = Concurrency.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_FUNCTION_OUTPUT, consumer=_consumer) - return kwargs - - -GET_FUNCTION = APIOperation( - input=GetFunctionInput, - output=GetFunctionOutput, - schema=_SCHEMA_GET_FUNCTION, - input_schema=_SCHEMA_GET_FUNCTION_INPUT, - output_schema=_SCHEMA_GET_FUNCTION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetFunctionCodeSigningConfigInput: - """Dataclass for GetFunctionCodeSigningConfigInput structure.""" - - function_name: str | None = None - """ - The name or ARN of the Lambda function. - - **Name formats** - - - **Function name** - `MyFunction`. - - - **Function ARN** - - `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`. - - - **Partial ARN** - `123456789012:function:MyFunction`. - - The length constraint applies only to the full ARN. If you specify only - the function name, it is limited to 64 characters in length. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_FUNCTION_CODE_SIGNING_CONFIG_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_GET_FUNCTION_CODE_SIGNING_CONFIG_INPUT.members["FunctionName"], - self.function_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_GET_FUNCTION_CODE_SIGNING_CONFIG_INPUT.members[ - "FunctionName" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_FUNCTION_CODE_SIGNING_CONFIG_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetFunctionCodeSigningConfigOutput: - """Dataclass for GetFunctionCodeSigningConfigOutput structure.""" - - code_signing_config_arn: str - """The The Amazon Resource Name (ARN) of the code signing configuration.""" - - function_name: str - """ - The name or ARN of the Lambda function. - - **Name formats** - - - **Function name** - `MyFunction`. - - - **Function ARN** - - `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`. - - - **Partial ARN** - `123456789012:function:MyFunction`. - - The length constraint applies only to the full ARN. If you specify only - the function name, it is limited to 64 characters in length. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_FUNCTION_CODE_SIGNING_CONFIG_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_FUNCTION_CODE_SIGNING_CONFIG_OUTPUT.members[ - "CodeSigningConfigArn" - ], - self.code_signing_config_arn, - ) - serializer.write_string( - _SCHEMA_GET_FUNCTION_CODE_SIGNING_CONFIG_OUTPUT.members["FunctionName"], - self.function_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["code_signing_config_arn"] = de.read_string( - _SCHEMA_GET_FUNCTION_CODE_SIGNING_CONFIG_OUTPUT.members[ - "CodeSigningConfigArn" - ] - ) - - case 1: - kwargs["function_name"] = de.read_string( - _SCHEMA_GET_FUNCTION_CODE_SIGNING_CONFIG_OUTPUT.members[ - "FunctionName" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_FUNCTION_CODE_SIGNING_CONFIG_OUTPUT, consumer=_consumer - ) - if "code_signing_config_arn" not in kwargs: - kwargs["code_signing_config_arn"] = "" - if "function_name" not in kwargs: - kwargs["function_name"] = "" - return kwargs - - -GET_FUNCTION_CODE_SIGNING_CONFIG = APIOperation( - input=GetFunctionCodeSigningConfigInput, - output=GetFunctionCodeSigningConfigOutput, - schema=_SCHEMA_GET_FUNCTION_CODE_SIGNING_CONFIG, - input_schema=_SCHEMA_GET_FUNCTION_CODE_SIGNING_CONFIG_INPUT, - output_schema=_SCHEMA_GET_FUNCTION_CODE_SIGNING_CONFIG_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#CodeSigningConfigNotFoundException" - ): CodeSigningConfigNotFoundException, - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CODE_SIGNING_CONFIG_NOT_FOUND_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetFunctionConcurrencyInput: - """Dataclass for GetFunctionConcurrencyInput structure.""" - - function_name: str | None = None - """ - The name or ARN of the Lambda function. - - **Name formats** - - - **Function name** -- `my-function`. - - - **Function ARN** -- - `arn:aws:lambda:us-west-2:123456789012:function:my-function`. - - - **Partial ARN** -- `123456789012:function:my-function`. - - The length constraint applies only to the full ARN. If you specify only - the function name, it is limited to 64 characters in length. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_FUNCTION_CONCURRENCY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_GET_FUNCTION_CONCURRENCY_INPUT.members["FunctionName"], - self.function_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_GET_FUNCTION_CONCURRENCY_INPUT.members["FunctionName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_FUNCTION_CONCURRENCY_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetFunctionConcurrencyOutput: - """Dataclass for GetFunctionConcurrencyOutput structure.""" - - reserved_concurrent_executions: int | None = None - """ - The number of simultaneous executions that are reserved for the - function. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_FUNCTION_CONCURRENCY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.reserved_concurrent_executions is not None: - serializer.write_integer( - _SCHEMA_GET_FUNCTION_CONCURRENCY_OUTPUT.members[ - "ReservedConcurrentExecutions" - ], - self.reserved_concurrent_executions, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["reserved_concurrent_executions"] = de.read_integer( - _SCHEMA_GET_FUNCTION_CONCURRENCY_OUTPUT.members[ - "ReservedConcurrentExecutions" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_FUNCTION_CONCURRENCY_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_FUNCTION_CONCURRENCY = APIOperation( - input=GetFunctionConcurrencyInput, - output=GetFunctionConcurrencyOutput, - schema=_SCHEMA_GET_FUNCTION_CONCURRENCY, - input_schema=_SCHEMA_GET_FUNCTION_CONCURRENCY_INPUT, - output_schema=_SCHEMA_GET_FUNCTION_CONCURRENCY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetFunctionConfigurationInput: - """Dataclass for GetFunctionConfigurationInput structure.""" - - function_name: str | None = None - """ - The name or ARN of the Lambda function, version, or alias. - - **Name formats** - - - **Function name** -- `my-function` (name-only), `my-function:v1` (with - alias). - - - **Function ARN** -- - `arn:aws:lambda:us-west-2:123456789012:function:my-function`. - - - **Partial ARN** -- `123456789012:function:my-function`. - - You can append a version number or alias to any of the formats. The - length constraint applies only to the full ARN. If you specify only the - function name, it is limited to 64 characters in length. - """ - - qualifier: str | None = None - """ - Specify a version or alias to get details about a published version of - the function. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_FUNCTION_CONFIGURATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_GET_FUNCTION_CONFIGURATION_INPUT.members["FunctionName"], - self.function_name, - ) - - if self.qualifier is not None: - serializer.write_string( - _SCHEMA_GET_FUNCTION_CONFIGURATION_INPUT.members["Qualifier"], - self.qualifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_GET_FUNCTION_CONFIGURATION_INPUT.members["FunctionName"] - ) - - case 1: - kwargs["qualifier"] = de.read_string( - _SCHEMA_GET_FUNCTION_CONFIGURATION_INPUT.members["Qualifier"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_FUNCTION_CONFIGURATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetFunctionConfigurationOutput: - """Details about a function's configuration.""" - - function_name: str | None = None - """The name of the function.""" - - function_arn: str | None = None - """The function's Amazon Resource Name (ARN).""" - - runtime: str | None = None - """ - The identifier of the function's - [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html). - Runtime is required if the deployment package is a .zip file archive. - Specifying a runtime results in an error if you're deploying a function - using a container image. - - The following list includes deprecated runtimes. Lambda blocks creating - new functions and updating existing functions shortly after each runtime - is deprecated. For more information, see [Runtime use after - deprecation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-deprecation-levels). - - For a list of all currently supported runtimes, see [Supported - runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtimes-supported). - """ - - role: str | None = None - """The function's execution role.""" - - handler: str | None = None - """The function that Lambda calls to begin running your function.""" - - code_size: int = 0 - """The size of the function's deployment package, in bytes.""" - - description: str | None = None - """The function's description.""" - - timeout: int | None = None - """ - The amount of time in seconds that Lambda allows a function to run - before stopping it. - """ - - memory_size: int | None = None - """The amount of memory available to the function at runtime.""" - - last_modified: str | None = None - """ - The date and time that the function was last updated, in [ISO-8601 - format](https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). - """ - - code_sha256: str | None = None - """The SHA256 hash of the function's deployment package.""" - - version: str | None = None - """The version of the Lambda function.""" - - vpc_config: VpcConfigResponse | None = None - """The function's networking configuration.""" - - dead_letter_config: DeadLetterConfig | None = None - """The function's dead letter queue.""" - - environment: EnvironmentResponse | None = None - """ - The function's [environment - variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html). - Omitted from CloudTrail logs. - """ - - kms_key_arn: str | None = None - """ - The ARN of the Key Management Service (KMS) customer managed key that's - used to encrypt the following resources: - - - The function's [environment - variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-encryption). - - - The function's [Lambda - SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart-security.html) - snapshots. - - - When used with `SourceKMSKeyArn`, the unzipped version of the .zip - deployment package that's used for function invocations. For more - information, see [Specifying a customer managed key for - Lambda](https://docs.aws.amazon.com/lambda/latest/dg/encrypt-zip-package.html#enable-zip-custom-encryption). - - - The optimized version of the container image that's used for function - invocations. Note that this is not the same key that's used to - protect your container image in the Amazon Elastic Container Registry - (Amazon ECR). For more information, see [Function - lifecycle](https://docs.aws.amazon.com/lambda/latest/dg/images-create.html#images-lifecycle). - - If you don't provide a customer managed key, Lambda uses an [Amazon Web - Services owned - key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk) - or an [Amazon Web Services managed - key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk). - """ - - tracing_config: TracingConfigResponse | None = None - """The function's X-Ray tracing configuration.""" - - master_arn: str | None = None - """For Lambda@Edge functions, the ARN of the main function.""" - - revision_id: str | None = None - """The latest updated revision of the function or alias.""" - - layers: list[Layer] | None = None - """ - The function's - [layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html). - """ - - state: str | None = None - """ - The current state of the function. When the state is `Inactive`, you can - reactivate the function by invoking it. - """ - - state_reason: str | None = None - """The reason for the function's current state.""" - - state_reason_code: str | None = None - """ - The reason code for the function's current state. When the code is - `Creating`, you can't invoke or modify the function. - """ - - last_update_status: str | None = None - """ - The status of the last update that was performed on the function. This - is first set to `Successful` after function creation completes. - """ - - last_update_status_reason: str | None = None - """The reason for the last update that was performed on the function.""" - - last_update_status_reason_code: str | None = None - """The reason code for the last update that was performed on the function.""" - - file_system_configs: list[FileSystemConfig] | None = None - """ - Connection settings for an [Amazon EFS file - system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html) - or an [Amazon S3 file - system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html). - """ - - signing_profile_version_arn: str | None = None - """The ARN of the signing profile version.""" - - signing_job_arn: str | None = None - """The ARN of the signing job.""" - - package_type: str | None = None - """ - The type of deployment package. Set to `Image` for container image and - set `Zip` for .zip file archive. - """ - - image_config_response: ImageConfigResponse | None = None - """The function's image configuration values.""" - - architectures: list[str] | None = None - """ - The instruction set architecture that the function supports. - Architecture is a string array with one of the valid values. The default - architecture value is `x86_64`. - """ - - ephemeral_storage: EphemeralStorage | None = None - """ - The size of the function's `/tmp` directory in MB. The default value is - 512, but can be any whole number between 512 and 10,240 MB. For more - information, see [Configuring ephemeral storage - (console)](https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-ephemeral-storage). - """ - - snap_start: SnapStartResponse | None = None - """ - Set `ApplyOn` to `PublishedVersions` to create a snapshot of the - initialized execution environment when you publish a function version. - For more information, see [Improving startup performance with Lambda - SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html). - """ - - runtime_version_config: RuntimeVersionConfig | None = None - """The ARN of the runtime and any errors that occured.""" - - logging_config: LoggingConfig | None = None - """The function's Amazon CloudWatch Logs configuration settings.""" - - tenancy_config: TenancyConfig | None = None - """ - The function's tenant isolation configuration settings. Determines - whether the Lambda function runs on a shared or dedicated infrastructure - per unique tenant. - """ - - capacity_provider_config: CapacityProviderConfig | None = None - """ - Configuration for the capacity provider that manages compute resources - for Lambda functions. - """ - - config_sha256: str | None = None - """The SHA256 hash of the function configuration.""" - - durable_config: DurableConfig | None = None - """ - The function's durable execution configuration settings, if the - function is configured for durability. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members["FunctionName"], - self.function_name, - ) - - if self.function_arn is not None: - serializer.write_string( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members["FunctionArn"], - self.function_arn, - ) - - if self.runtime is not None: - serializer.write_string( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members["Runtime"], - self.runtime, - ) - - if self.role is not None: - serializer.write_string( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members["Role"], self.role - ) - - if self.handler is not None: - serializer.write_string( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members["Handler"], - self.handler, - ) - - serializer.write_long( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members["CodeSize"], - self.code_size, - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members["Description"], - self.description, - ) - - if self.timeout is not None: - serializer.write_integer( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members["Timeout"], - self.timeout, - ) - - if self.memory_size is not None: - serializer.write_integer( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members["MemorySize"], - self.memory_size, - ) - - if self.last_modified is not None: - serializer.write_string( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members["LastModified"], - self.last_modified, - ) - - if self.code_sha256 is not None: - serializer.write_string( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members["CodeSha256"], - self.code_sha256, - ) - - if self.version is not None: - serializer.write_string( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members["Version"], - self.version, - ) - - if self.vpc_config is not None: - serializer.write_struct( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members["VpcConfig"], - self.vpc_config, - ) - - if self.dead_letter_config is not None: - serializer.write_struct( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members["DeadLetterConfig"], - self.dead_letter_config, - ) - - if self.environment is not None: - serializer.write_struct( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members["Environment"], - self.environment, - ) - - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members["KMSKeyArn"], - self.kms_key_arn, - ) - - if self.tracing_config is not None: - serializer.write_struct( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members["TracingConfig"], - self.tracing_config, - ) - - if self.master_arn is not None: - serializer.write_string( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members["MasterArn"], - self.master_arn, - ) - - if self.revision_id is not None: - serializer.write_string( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members["RevisionId"], - self.revision_id, - ) - - if self.layers is not None: - _serialize_layers_reference_list( - serializer, - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members["Layers"], - self.layers, - ) - - if self.state is not None: - serializer.write_string( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members["State"], self.state - ) - - if self.state_reason is not None: - serializer.write_string( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members["StateReason"], - self.state_reason, - ) - - if self.state_reason_code is not None: - serializer.write_string( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members["StateReasonCode"], - self.state_reason_code, - ) - - if self.last_update_status is not None: - serializer.write_string( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members["LastUpdateStatus"], - self.last_update_status, - ) - - if self.last_update_status_reason is not None: - serializer.write_string( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members[ - "LastUpdateStatusReason" - ], - self.last_update_status_reason, - ) - - if self.last_update_status_reason_code is not None: - serializer.write_string( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members[ - "LastUpdateStatusReasonCode" - ], - self.last_update_status_reason_code, - ) - - if self.file_system_configs is not None: - _serialize_file_system_config_list( - serializer, - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members["FileSystemConfigs"], - self.file_system_configs, - ) - - if self.signing_profile_version_arn is not None: - serializer.write_string( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members[ - "SigningProfileVersionArn" - ], - self.signing_profile_version_arn, - ) - - if self.signing_job_arn is not None: - serializer.write_string( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members["SigningJobArn"], - self.signing_job_arn, - ) - - if self.package_type is not None: - serializer.write_string( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members["PackageType"], - self.package_type, - ) - - if self.image_config_response is not None: - serializer.write_struct( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members[ - "ImageConfigResponse" - ], - self.image_config_response, - ) - - if self.architectures is not None: - _serialize_architectures_list( - serializer, - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members["Architectures"], - self.architectures, - ) - - if self.ephemeral_storage is not None: - serializer.write_struct( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members["EphemeralStorage"], - self.ephemeral_storage, - ) - - if self.snap_start is not None: - serializer.write_struct( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members["SnapStart"], - self.snap_start, - ) - - if self.runtime_version_config is not None: - serializer.write_struct( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members[ - "RuntimeVersionConfig" - ], - self.runtime_version_config, - ) - - if self.logging_config is not None: - serializer.write_struct( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members["LoggingConfig"], - self.logging_config, - ) - - if self.tenancy_config is not None: - serializer.write_struct( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members["TenancyConfig"], - self.tenancy_config, - ) - - if self.capacity_provider_config is not None: - serializer.write_struct( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members[ - "CapacityProviderConfig" - ], - self.capacity_provider_config, - ) - - if self.config_sha256 is not None: - serializer.write_string( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members["ConfigSha256"], - self.config_sha256, - ) - - if self.durable_config is not None: - serializer.write_struct( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members["DurableConfig"], - self.durable_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members[ - "FunctionName" - ] - ) - - case 1: - kwargs["function_arn"] = de.read_string( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members["FunctionArn"] - ) - - case 2: - kwargs["runtime"] = Runtime( - de.read_string( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members["Runtime"] - ) - ) - - case 3: - kwargs["role"] = de.read_string( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members["Role"] - ) - - case 4: - kwargs["handler"] = de.read_string( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members["Handler"] - ) - - case 5: - kwargs["code_size"] = de.read_long( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members["CodeSize"] - ) - - case 6: - kwargs["description"] = de.read_string( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members["Description"] - ) - - case 7: - kwargs["timeout"] = de.read_integer( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members["Timeout"] - ) - - case 8: - kwargs["memory_size"] = de.read_integer( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members["MemorySize"] - ) - - case 9: - kwargs["last_modified"] = de.read_string( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members[ - "LastModified" - ] - ) - - case 10: - kwargs["code_sha256"] = de.read_string( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members["CodeSha256"] - ) - - case 11: - kwargs["version"] = de.read_string( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members["Version"] - ) - - case 12: - kwargs["vpc_config"] = VpcConfigResponse.deserialize(de) - - case 13: - kwargs["dead_letter_config"] = DeadLetterConfig.deserialize(de) - - case 14: - kwargs["environment"] = EnvironmentResponse.deserialize(de) - - case 15: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members["KMSKeyArn"] - ) - - case 16: - kwargs["tracing_config"] = TracingConfigResponse.deserialize(de) - - case 17: - kwargs["master_arn"] = de.read_string( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members["MasterArn"] - ) - - case 18: - kwargs["revision_id"] = de.read_string( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members["RevisionId"] - ) - - case 19: - kwargs["layers"] = _deserialize_layers_reference_list( - de, _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members["Layers"] - ) - - case 20: - kwargs["state"] = State( - de.read_string( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members["State"] - ) - ) - - case 21: - kwargs["state_reason"] = de.read_string( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members["StateReason"] - ) - - case 22: - kwargs["state_reason_code"] = StateReasonCode( - de.read_string( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members[ - "StateReasonCode" - ] - ) - ) - - case 23: - kwargs["last_update_status"] = LastUpdateStatus( - de.read_string( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members[ - "LastUpdateStatus" - ] - ) - ) - - case 24: - kwargs["last_update_status_reason"] = de.read_string( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members[ - "LastUpdateStatusReason" - ] - ) - - case 25: - kwargs["last_update_status_reason_code"] = ( - LastUpdateStatusReasonCode( - de.read_string( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members[ - "LastUpdateStatusReasonCode" - ] - ) - ) - ) - - case 26: - kwargs["file_system_configs"] = ( - _deserialize_file_system_config_list( - de, - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members[ - "FileSystemConfigs" - ], - ) - ) - - case 27: - kwargs["signing_profile_version_arn"] = de.read_string( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members[ - "SigningProfileVersionArn" - ] - ) - - case 28: - kwargs["signing_job_arn"] = de.read_string( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members[ - "SigningJobArn" - ] - ) - - case 29: - kwargs["package_type"] = PackageType( - de.read_string( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members[ - "PackageType" - ] - ) - ) - - case 30: - kwargs["image_config_response"] = ImageConfigResponse.deserialize( - de - ) - - case 31: - kwargs["architectures"] = _deserialize_architectures_list( - de, - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members[ - "Architectures" - ], - ) - - case 32: - kwargs["ephemeral_storage"] = EphemeralStorage.deserialize(de) - - case 33: - kwargs["snap_start"] = SnapStartResponse.deserialize(de) - - case 34: - kwargs["runtime_version_config"] = RuntimeVersionConfig.deserialize( - de - ) - - case 35: - kwargs["logging_config"] = LoggingConfig.deserialize(de) - - case 36: - kwargs["tenancy_config"] = TenancyConfig.deserialize(de) - - case 37: - kwargs["capacity_provider_config"] = ( - CapacityProviderConfig.deserialize(de) - ) - - case 38: - kwargs["config_sha256"] = de.read_string( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT.members[ - "ConfigSha256" - ] - ) - - case 39: - kwargs["durable_config"] = DurableConfig.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_FUNCTION_CONFIGURATION = APIOperation( - input=GetFunctionConfigurationInput, - output=GetFunctionConfigurationOutput, - schema=_SCHEMA_GET_FUNCTION_CONFIGURATION, - input_schema=_SCHEMA_GET_FUNCTION_CONFIGURATION_INPUT, - output_schema=_SCHEMA_GET_FUNCTION_CONFIGURATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetFunctionRecursionConfigInput: - """Dataclass for GetFunctionRecursionConfigInput structure.""" - - function_name: str | None = None - """The name of the function.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_FUNCTION_RECURSION_CONFIG_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_GET_FUNCTION_RECURSION_CONFIG_INPUT.members["FunctionName"], - self.function_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_GET_FUNCTION_RECURSION_CONFIG_INPUT.members[ - "FunctionName" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_FUNCTION_RECURSION_CONFIG_INPUT, consumer=_consumer - ) - return kwargs - - -class RecursiveLoop(UnknownEnumMixin, StrEnum): - ALLOW = "Allow" - TERMINATE = "Terminate" - - -@dataclass(kw_only=True) -class GetFunctionRecursionConfigOutput: - """Dataclass for GetFunctionRecursionConfigOutput structure.""" - - recursive_loop: str | None = None - """ - If your function's recursive loop detection configuration is `Allow`, - Lambda doesn't take any action when it detects your function being - invoked as part of a recursive loop. - - If your function's recursive loop detection configuration is - `Terminate`, Lambda stops your function being invoked and notifies you - when it detects your function being invoked as part of a recursive loop. - - By default, Lambda sets your function's configuration to `Terminate`. - You can update this configuration using the PutFunctionRecursionConfig - action. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_FUNCTION_RECURSION_CONFIG_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.recursive_loop is not None: - serializer.write_string( - _SCHEMA_GET_FUNCTION_RECURSION_CONFIG_OUTPUT.members["RecursiveLoop"], - self.recursive_loop, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["recursive_loop"] = RecursiveLoop( - de.read_string( - _SCHEMA_GET_FUNCTION_RECURSION_CONFIG_OUTPUT.members[ - "RecursiveLoop" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_FUNCTION_RECURSION_CONFIG_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_FUNCTION_RECURSION_CONFIG = APIOperation( - input=GetFunctionRecursionConfigInput, - output=GetFunctionRecursionConfigOutput, - schema=_SCHEMA_GET_FUNCTION_RECURSION_CONFIG, - input_schema=_SCHEMA_GET_FUNCTION_RECURSION_CONFIG_INPUT, - output_schema=_SCHEMA_GET_FUNCTION_RECURSION_CONFIG_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetFunctionScalingConfigInput: - """Dataclass for GetFunctionScalingConfigInput structure.""" - - function_name: str | None = None - """The name or ARN of the Lambda function.""" - - qualifier: str | None = None - """ - Specify a version or alias to get the scaling configuration for a - published version of the function. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_FUNCTION_SCALING_CONFIG_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_GET_FUNCTION_SCALING_CONFIG_INPUT.members["FunctionName"], - self.function_name, - ) - - if self.qualifier is not None: - serializer.write_string( - _SCHEMA_GET_FUNCTION_SCALING_CONFIG_INPUT.members["Qualifier"], - self.qualifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_GET_FUNCTION_SCALING_CONFIG_INPUT.members[ - "FunctionName" - ] - ) - - case 1: - kwargs["qualifier"] = de.read_string( - _SCHEMA_GET_FUNCTION_SCALING_CONFIG_INPUT.members["Qualifier"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_FUNCTION_SCALING_CONFIG_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class FunctionScalingConfig: - """ - Configuration that defines the scaling behavior for a Lambda Managed - Instances function, including the minimum and maximum number of - execution environments that can be provisioned. - """ - - min_execution_environments: int | None = None - """ - The minimum number of execution environments to maintain for the - function. - """ - - max_execution_environments: int | None = None - """ - The maximum number of execution environments that can be provisioned for - the function. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FUNCTION_SCALING_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.min_execution_environments is not None: - serializer.write_integer( - _SCHEMA_FUNCTION_SCALING_CONFIG.members["MinExecutionEnvironments"], - self.min_execution_environments, - ) - - if self.max_execution_environments is not None: - serializer.write_integer( - _SCHEMA_FUNCTION_SCALING_CONFIG.members["MaxExecutionEnvironments"], - self.max_execution_environments, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["min_execution_environments"] = de.read_integer( - _SCHEMA_FUNCTION_SCALING_CONFIG.members[ - "MinExecutionEnvironments" - ] - ) - - case 1: - kwargs["max_execution_environments"] = de.read_integer( - _SCHEMA_FUNCTION_SCALING_CONFIG.members[ - "MaxExecutionEnvironments" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FUNCTION_SCALING_CONFIG, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetFunctionScalingConfigOutput: - """Dataclass for GetFunctionScalingConfigOutput structure.""" - - function_arn: str | None = None - """The Amazon Resource Name (ARN) of the function.""" - - applied_function_scaling_config: FunctionScalingConfig | None = None - """ - The scaling configuration that is currently applied to the function. - This represents the actual scaling settings in effect. - """ - - requested_function_scaling_config: FunctionScalingConfig | None = None - """The scaling configuration that was requested for the function.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_FUNCTION_SCALING_CONFIG_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_arn is not None: - serializer.write_string( - _SCHEMA_GET_FUNCTION_SCALING_CONFIG_OUTPUT.members["FunctionArn"], - self.function_arn, - ) - - if self.applied_function_scaling_config is not None: - serializer.write_struct( - _SCHEMA_GET_FUNCTION_SCALING_CONFIG_OUTPUT.members[ - "AppliedFunctionScalingConfig" - ], - self.applied_function_scaling_config, - ) - - if self.requested_function_scaling_config is not None: - serializer.write_struct( - _SCHEMA_GET_FUNCTION_SCALING_CONFIG_OUTPUT.members[ - "RequestedFunctionScalingConfig" - ], - self.requested_function_scaling_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_arn"] = de.read_string( - _SCHEMA_GET_FUNCTION_SCALING_CONFIG_OUTPUT.members[ - "FunctionArn" - ] - ) - - case 1: - kwargs["applied_function_scaling_config"] = ( - FunctionScalingConfig.deserialize(de) - ) - - case 2: - kwargs["requested_function_scaling_config"] = ( - FunctionScalingConfig.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_FUNCTION_SCALING_CONFIG_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_FUNCTION_SCALING_CONFIG = APIOperation( - input=GetFunctionScalingConfigInput, - output=GetFunctionScalingConfigOutput, - schema=_SCHEMA_GET_FUNCTION_SCALING_CONFIG, - input_schema=_SCHEMA_GET_FUNCTION_SCALING_CONFIG_INPUT, - output_schema=_SCHEMA_GET_FUNCTION_SCALING_CONFIG_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetFunctionUrlConfigInput: - """Dataclass for GetFunctionUrlConfigInput structure.""" - - function_name: str | None = None - """ - The name or ARN of the Lambda function. - - **Name formats** - - - **Function name** -- `my-function`. - - - **Function ARN** -- - `arn:aws:lambda:us-west-2:123456789012:function:my-function`. - - - **Partial ARN** -- `123456789012:function:my-function`. - - The length constraint applies only to the full ARN. If you specify only - the function name, it is limited to 64 characters in length. - """ - - qualifier: str | None = None - """The alias name.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_FUNCTION_URL_CONFIG_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_GET_FUNCTION_URL_CONFIG_INPUT.members["FunctionName"], - self.function_name, - ) - - if self.qualifier is not None: - serializer.write_string( - _SCHEMA_GET_FUNCTION_URL_CONFIG_INPUT.members["Qualifier"], - self.qualifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_GET_FUNCTION_URL_CONFIG_INPUT.members["FunctionName"] - ) - - case 1: - kwargs["qualifier"] = de.read_string( - _SCHEMA_GET_FUNCTION_URL_CONFIG_INPUT.members["Qualifier"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_FUNCTION_URL_CONFIG_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetFunctionUrlConfigOutput: - """Dataclass for GetFunctionUrlConfigOutput structure.""" - - function_url: str - """The HTTP URL endpoint for your function.""" - - function_arn: str - """The Amazon Resource Name (ARN) of your function.""" - - auth_type: str - """ - The type of authentication that your function URL uses. Set to `AWS_IAM` - if you want to restrict access to authenticated users only. Set to - `NONE` if you want to bypass IAM authentication to create a public - endpoint. For more information, see [Control access to Lambda function - URLs](https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html). - """ - - creation_time: str - """ - When the function URL was created, in [ISO-8601 - format](https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). - """ - - last_modified_time: str - """ - When the function URL configuration was last updated, in [ISO-8601 - format](https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). - """ - - cors: Cors | None = None - """ - The [cross-origin resource sharing - (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) settings - for your function URL. - """ - - invoke_mode: str | None = None - """ - Use one of the following options: - - - `BUFFERED` -- This is the default option. Lambda invokes your function - using the `Invoke` API operation. Invocation results are available - when the payload is complete. The maximum payload size is 6 MB. - - - `RESPONSE_STREAM` -- Your function streams payload results as they - become available. Lambda invokes your function using the - `InvokeWithResponseStream` API operation. The maximum response payload - size is 200 MB. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_FUNCTION_URL_CONFIG_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_FUNCTION_URL_CONFIG_OUTPUT.members["FunctionUrl"], - self.function_url, - ) - serializer.write_string( - _SCHEMA_GET_FUNCTION_URL_CONFIG_OUTPUT.members["FunctionArn"], - self.function_arn, - ) - serializer.write_string( - _SCHEMA_GET_FUNCTION_URL_CONFIG_OUTPUT.members["AuthType"], self.auth_type - ) - if self.cors is not None: - serializer.write_struct( - _SCHEMA_GET_FUNCTION_URL_CONFIG_OUTPUT.members["Cors"], self.cors - ) - - serializer.write_string( - _SCHEMA_GET_FUNCTION_URL_CONFIG_OUTPUT.members["CreationTime"], - self.creation_time, - ) - serializer.write_string( - _SCHEMA_GET_FUNCTION_URL_CONFIG_OUTPUT.members["LastModifiedTime"], - self.last_modified_time, - ) - if self.invoke_mode is not None: - serializer.write_string( - _SCHEMA_GET_FUNCTION_URL_CONFIG_OUTPUT.members["InvokeMode"], - self.invoke_mode, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_url"] = de.read_string( - _SCHEMA_GET_FUNCTION_URL_CONFIG_OUTPUT.members["FunctionUrl"] - ) - - case 1: - kwargs["function_arn"] = de.read_string( - _SCHEMA_GET_FUNCTION_URL_CONFIG_OUTPUT.members["FunctionArn"] - ) - - case 2: - kwargs["auth_type"] = FunctionUrlAuthType( - de.read_string( - _SCHEMA_GET_FUNCTION_URL_CONFIG_OUTPUT.members["AuthType"] - ) - ) - - case 3: - kwargs["cors"] = Cors.deserialize(de) - - case 4: - kwargs["creation_time"] = de.read_string( - _SCHEMA_GET_FUNCTION_URL_CONFIG_OUTPUT.members["CreationTime"] - ) - - case 5: - kwargs["last_modified_time"] = de.read_string( - _SCHEMA_GET_FUNCTION_URL_CONFIG_OUTPUT.members[ - "LastModifiedTime" - ] - ) - - case 6: - kwargs["invoke_mode"] = InvokeMode( - de.read_string( - _SCHEMA_GET_FUNCTION_URL_CONFIG_OUTPUT.members["InvokeMode"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_FUNCTION_URL_CONFIG_OUTPUT, consumer=_consumer - ) - if "function_url" not in kwargs: - kwargs["function_url"] = "" - if "function_arn" not in kwargs: - kwargs["function_arn"] = "" - if "auth_type" not in kwargs: - kwargs["auth_type"] = FunctionUrlAuthType._corrected("") - if "creation_time" not in kwargs: - kwargs["creation_time"] = "" - if "last_modified_time" not in kwargs: - kwargs["last_modified_time"] = "" - return kwargs - - -GET_FUNCTION_URL_CONFIG = APIOperation( - input=GetFunctionUrlConfigInput, - output=GetFunctionUrlConfigOutput, - schema=_SCHEMA_GET_FUNCTION_URL_CONFIG, - input_schema=_SCHEMA_GET_FUNCTION_URL_CONFIG_INPUT, - output_schema=_SCHEMA_GET_FUNCTION_URL_CONFIG_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetPolicyInput: - """Dataclass for GetPolicyInput structure.""" - - function_name: str | None = None - """ - The name or ARN of the Lambda function, version, or alias. - - **Name formats** - - - **Function name** -- `my-function` (name-only), `my-function:v1` (with - alias). - - - **Function ARN** -- - `arn:aws:lambda:us-west-2:123456789012:function:my-function`. - - - **Partial ARN** -- `123456789012:function:my-function`. - - You can append a version number or alias to any of the formats. The - length constraint applies only to the full ARN. If you specify only the - function name, it is limited to 64 characters in length. - """ - - qualifier: str | None = None - """Specify a version or alias to get the policy for that resource.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_POLICY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_GET_POLICY_INPUT.members["FunctionName"], self.function_name - ) - - if self.qualifier is not None: - serializer.write_string( - _SCHEMA_GET_POLICY_INPUT.members["Qualifier"], self.qualifier - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_GET_POLICY_INPUT.members["FunctionName"] - ) - - case 1: - kwargs["qualifier"] = de.read_string( - _SCHEMA_GET_POLICY_INPUT.members["Qualifier"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_POLICY_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetPolicyOutput: - """Dataclass for GetPolicyOutput structure.""" - - policy: str | None = None - """The resource-based policy.""" - - revision_id: str | None = None - """A unique identifier for the current revision of the policy.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_POLICY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.policy is not None: - serializer.write_string( - _SCHEMA_GET_POLICY_OUTPUT.members["Policy"], self.policy - ) - - if self.revision_id is not None: - serializer.write_string( - _SCHEMA_GET_POLICY_OUTPUT.members["RevisionId"], self.revision_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy"] = de.read_string( - _SCHEMA_GET_POLICY_OUTPUT.members["Policy"] - ) - - case 1: - kwargs["revision_id"] = de.read_string( - _SCHEMA_GET_POLICY_OUTPUT.members["RevisionId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_POLICY_OUTPUT, consumer=_consumer) - return kwargs - - -GET_POLICY = APIOperation( - input=GetPolicyInput, - output=GetPolicyOutput, - schema=_SCHEMA_GET_POLICY, - input_schema=_SCHEMA_GET_POLICY_INPUT, - output_schema=_SCHEMA_GET_POLICY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetRuntimeManagementConfigInput: - """Dataclass for GetRuntimeManagementConfigInput structure.""" - - function_name: str | None = None - """ - The name or ARN of the Lambda function. - - **Name formats** - - - **Function name** -- `my-function`. - - - **Function ARN** -- - `arn:aws:lambda:us-west-2:123456789012:function:my-function`. - - - **Partial ARN** -- `123456789012:function:my-function`. - - The length constraint applies only to the full ARN. If you specify only - the function name, it is limited to 64 characters in length. - """ - - qualifier: str | None = None - """ - Specify a version of the function. This can be `$LATEST` or a published - version number. If no value is specified, the configuration for the - `$LATEST` version is returned. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_RUNTIME_MANAGEMENT_CONFIG_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_GET_RUNTIME_MANAGEMENT_CONFIG_INPUT.members["FunctionName"], - self.function_name, - ) - - if self.qualifier is not None: - serializer.write_string( - _SCHEMA_GET_RUNTIME_MANAGEMENT_CONFIG_INPUT.members["Qualifier"], - self.qualifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_GET_RUNTIME_MANAGEMENT_CONFIG_INPUT.members[ - "FunctionName" - ] - ) - - case 1: - kwargs["qualifier"] = de.read_string( - _SCHEMA_GET_RUNTIME_MANAGEMENT_CONFIG_INPUT.members["Qualifier"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_RUNTIME_MANAGEMENT_CONFIG_INPUT, consumer=_consumer - ) - return kwargs - - -class UpdateRuntimeOn(UnknownEnumMixin, StrEnum): - AUTO = "Auto" - MANUAL = "Manual" - FUNCTION_UPDATE = "FunctionUpdate" - - -@dataclass(kw_only=True) -class GetRuntimeManagementConfigOutput: - """Dataclass for GetRuntimeManagementConfigOutput structure.""" - - update_runtime_on: str | None = None - """The current runtime update mode of the function.""" - - function_arn: str | None = None - """The Amazon Resource Name (ARN) of your function.""" - - runtime_version_arn: str | None = None - """ - The ARN of the runtime the function is configured to use. If the runtime - update mode is **Manual**, the ARN is returned, otherwise `null` is - returned. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_RUNTIME_MANAGEMENT_CONFIG_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.update_runtime_on is not None: - serializer.write_string( - _SCHEMA_GET_RUNTIME_MANAGEMENT_CONFIG_OUTPUT.members["UpdateRuntimeOn"], - self.update_runtime_on, - ) - - if self.function_arn is not None: - serializer.write_string( - _SCHEMA_GET_RUNTIME_MANAGEMENT_CONFIG_OUTPUT.members["FunctionArn"], - self.function_arn, - ) - - if self.runtime_version_arn is not None: - serializer.write_string( - _SCHEMA_GET_RUNTIME_MANAGEMENT_CONFIG_OUTPUT.members[ - "RuntimeVersionArn" - ], - self.runtime_version_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["update_runtime_on"] = UpdateRuntimeOn( - de.read_string( - _SCHEMA_GET_RUNTIME_MANAGEMENT_CONFIG_OUTPUT.members[ - "UpdateRuntimeOn" - ] - ) - ) - - case 1: - kwargs["function_arn"] = de.read_string( - _SCHEMA_GET_RUNTIME_MANAGEMENT_CONFIG_OUTPUT.members[ - "FunctionArn" - ] - ) - - case 2: - kwargs["runtime_version_arn"] = de.read_string( - _SCHEMA_GET_RUNTIME_MANAGEMENT_CONFIG_OUTPUT.members[ - "RuntimeVersionArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_RUNTIME_MANAGEMENT_CONFIG_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_RUNTIME_MANAGEMENT_CONFIG = APIOperation( - input=GetRuntimeManagementConfigInput, - output=GetRuntimeManagementConfigOutput, - schema=_SCHEMA_GET_RUNTIME_MANAGEMENT_CONFIG, - input_schema=_SCHEMA_GET_RUNTIME_MANAGEMENT_CONFIG_INPUT, - output_schema=_SCHEMA_GET_RUNTIME_MANAGEMENT_CONFIG_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class CodeArtifactUserDeletedException(ServiceError): - """ - The Lambda function couldn't be invoked because its code artifact user - has been deleted. Wait for Lambda to provision a new code artifact user, - or update the function's code package to recreate it. - """ - - fault: Literal["client", "server"] | None = "client" - - type: str | None = None - """The exception type.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CODE_ARTIFACT_USER_DELETED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_CODE_ARTIFACT_USER_DELETED_EXCEPTION.members["Type"], self.type - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_CODE_ARTIFACT_USER_DELETED_EXCEPTION.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_CODE_ARTIFACT_USER_DELETED_EXCEPTION.members["Type"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_CODE_ARTIFACT_USER_DELETED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CODE_ARTIFACT_USER_DELETED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CodeArtifactUserFailedException(ServiceError): - """ - The Lambda function couldn't be invoked because provisioning of its - code artifact user failed. Update the function's code package or check - the Lambda function's `State` and `StateReasonCode` for additional - context. - """ - - fault: Literal["client", "server"] | None = "client" - - type: str | None = None - """The exception type.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CODE_ARTIFACT_USER_FAILED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_CODE_ARTIFACT_USER_FAILED_EXCEPTION.members["Type"], self.type - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_CODE_ARTIFACT_USER_FAILED_EXCEPTION.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_CODE_ARTIFACT_USER_FAILED_EXCEPTION.members["Type"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_CODE_ARTIFACT_USER_FAILED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CODE_ARTIFACT_USER_FAILED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CodeArtifactUserPendingException(ServiceError): - """ - The Lambda function couldn't be invoked because its code artifact user - is still being provisioned. Wait for the function's `State` to become - `Active` and try the request again. - """ - - fault: Literal["client", "server"] | None = "client" - - type: str | None = None - """The exception type.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CODE_ARTIFACT_USER_PENDING_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_CODE_ARTIFACT_USER_PENDING_EXCEPTION.members["Type"], self.type - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_CODE_ARTIFACT_USER_PENDING_EXCEPTION.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_CODE_ARTIFACT_USER_PENDING_EXCEPTION.members["Type"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_CODE_ARTIFACT_USER_PENDING_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CODE_ARTIFACT_USER_PENDING_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DurableExecutionAlreadyStartedException(ServiceError): - """ - The durable execution with the specified name has already been started. - Each durable execution name must be unique within the function. Use a - different name or check the status of the existing execution. - """ - - fault: Literal["client", "server"] | None = "client" - - type: str | None = None - """The exception type.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DURABLE_EXECUTION_ALREADY_STARTED_EXCEPTION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_DURABLE_EXECUTION_ALREADY_STARTED_EXCEPTION.members["Type"], - self.type, - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_DURABLE_EXECUTION_ALREADY_STARTED_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_DURABLE_EXECUTION_ALREADY_STARTED_EXCEPTION.members[ - "Type" - ] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_DURABLE_EXECUTION_ALREADY_STARTED_EXCEPTION.members[ - "Message" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DURABLE_EXECUTION_ALREADY_STARTED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class EC2AccessDeniedException(ServiceError): - """Need additional permissions to configure VPC settings.""" - - fault: Literal["client", "server"] | None = "server" - - type: str | None = None - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EC2_ACCESS_DENIED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_EC2_ACCESS_DENIED_EXCEPTION.members["Type"], self.type - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_EC2_ACCESS_DENIED_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_EC2_ACCESS_DENIED_EXCEPTION.members["Type"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_EC2_ACCESS_DENIED_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EC2_ACCESS_DENIED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class EC2ThrottledException(ServiceError): - """ - Amazon EC2 throttled Lambda during Lambda function initialization using - the execution role provided for the function. - """ - - fault: Literal["client", "server"] | None = "server" - - type: str | None = None - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EC2_THROTTLED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_EC2_THROTTLED_EXCEPTION.members["Type"], self.type - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_EC2_THROTTLED_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_EC2_THROTTLED_EXCEPTION.members["Type"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_EC2_THROTTLED_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EC2_THROTTLED_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class EC2UnexpectedException(ServiceError): - """ - Lambda received an unexpected Amazon EC2 client exception while setting - up for the Lambda function. - """ - - fault: Literal["client", "server"] | None = "server" - - type: str | None = None - - ec2_error_code: str | None = None - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EC2_UNEXPECTED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_EC2_UNEXPECTED_EXCEPTION.members["Type"], self.type - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_EC2_UNEXPECTED_EXCEPTION.members["Message"], self.message - ) - - if self.ec2_error_code is not None: - serializer.write_string( - _SCHEMA_EC2_UNEXPECTED_EXCEPTION.members["EC2ErrorCode"], - self.ec2_error_code, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_EC2_UNEXPECTED_EXCEPTION.members["Type"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_EC2_UNEXPECTED_EXCEPTION.members["Message"] - ) - - case 2: - kwargs["ec2_error_code"] = de.read_string( - _SCHEMA_EC2_UNEXPECTED_EXCEPTION.members["EC2ErrorCode"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EC2_UNEXPECTED_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class EFSIOException(ServiceError): - """ - An error occurred when reading from or writing to a connected file - system. - """ - - fault: Literal["client", "server"] | None = "client" - - type: str | None = None - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EFSIO_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string(_SCHEMA_EFSIO_EXCEPTION.members["Type"], self.type) - - if self.message is not None: - serializer.write_string( - _SCHEMA_EFSIO_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_EFSIO_EXCEPTION.members["Type"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_EFSIO_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EFSIO_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class EFSMountConnectivityException(ServiceError): - """ - The Lambda function couldn't make a network connection to the - configured file system. - """ - - fault: Literal["client", "server"] | None = "client" - - type: str | None = None - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EFS_MOUNT_CONNECTIVITY_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_EFS_MOUNT_CONNECTIVITY_EXCEPTION.members["Type"], self.type - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_EFS_MOUNT_CONNECTIVITY_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_EFS_MOUNT_CONNECTIVITY_EXCEPTION.members["Type"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_EFS_MOUNT_CONNECTIVITY_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EFS_MOUNT_CONNECTIVITY_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class EFSMountFailureException(ServiceError): - """ - The Lambda function couldn't mount the configured file system due to a - permission or configuration issue. - """ - - fault: Literal["client", "server"] | None = "client" - - type: str | None = None - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EFS_MOUNT_FAILURE_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_EFS_MOUNT_FAILURE_EXCEPTION.members["Type"], self.type - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_EFS_MOUNT_FAILURE_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_EFS_MOUNT_FAILURE_EXCEPTION.members["Type"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_EFS_MOUNT_FAILURE_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EFS_MOUNT_FAILURE_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class EFSMountTimeoutException(ServiceError): - """ - The Lambda function made a network connection to the configured file - system, but the mount operation timed out. - """ - - fault: Literal["client", "server"] | None = "client" - - type: str | None = None - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EFS_MOUNT_TIMEOUT_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_EFS_MOUNT_TIMEOUT_EXCEPTION.members["Type"], self.type - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_EFS_MOUNT_TIMEOUT_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_EFS_MOUNT_TIMEOUT_EXCEPTION.members["Type"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_EFS_MOUNT_TIMEOUT_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EFS_MOUNT_TIMEOUT_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ENILimitReachedException(ServiceError): - """ - Lambda couldn't create an elastic network interface in the VPC, - specified as part of Lambda function configuration, because the limit - for network interfaces has been reached. For more information, see - [Lambda - quotas](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html). - """ - - fault: Literal["client", "server"] | None = "server" - - type: str | None = None - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ENI_LIMIT_REACHED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_ENI_LIMIT_REACHED_EXCEPTION.members["Type"], self.type - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_ENI_LIMIT_REACHED_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_ENI_LIMIT_REACHED_EXCEPTION.members["Type"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_ENI_LIMIT_REACHED_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ENI_LIMIT_REACHED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ENINotReadyException(ServiceError): - """ - Lambda couldn't invoke the Lambda function because the elastic network - interface (ENI) configured for its VPC connection isn't ready yet. Wait - a few moments and try the request again. For more information about VPC - configuration, see [Configuring a Lambda function to access resources in - a - VPC](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html). - """ - - fault: Literal["client", "server"] | None = "server" - - type: str | None = None - """The exception type.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ENI_NOT_READY_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_ENI_NOT_READY_EXCEPTION.members["Type"], self.type - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_ENI_NOT_READY_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_ENI_NOT_READY_EXCEPTION.members["Type"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_ENI_NOT_READY_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ENI_NOT_READY_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class InvalidRequestContentException(ServiceError): - """ - The request body could not be parsed as JSON, or a request header is - invalid. For example, the 'x-amzn-RequestId' header is not a valid - UUID string. - """ - - fault: Literal["client", "server"] | None = "client" - - type: str | None = None - """The exception type.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_REQUEST_CONTENT_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_INVALID_REQUEST_CONTENT_EXCEPTION.members["Type"], self.type - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_REQUEST_CONTENT_EXCEPTION.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_INVALID_REQUEST_CONTENT_EXCEPTION.members["Type"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_REQUEST_CONTENT_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVALID_REQUEST_CONTENT_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InvalidRuntimeException(ServiceError): - """The runtime or runtime version specified is not supported.""" - - fault: Literal["client", "server"] | None = "server" - - type: str | None = None - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_RUNTIME_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_INVALID_RUNTIME_EXCEPTION.members["Type"], self.type - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_RUNTIME_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_INVALID_RUNTIME_EXCEPTION.members["Type"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_RUNTIME_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INVALID_RUNTIME_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class InvalidSecurityGroupIDException(ServiceError): - """ - The security group ID provided in the Lambda function VPC configuration - is not valid. - """ - - fault: Literal["client", "server"] | None = "server" - - type: str | None = None - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_SECURITY_GROUP_ID_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_INVALID_SECURITY_GROUP_ID_EXCEPTION.members["Type"], self.type - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_SECURITY_GROUP_ID_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_INVALID_SECURITY_GROUP_ID_EXCEPTION.members["Type"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_SECURITY_GROUP_ID_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVALID_SECURITY_GROUP_ID_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InvalidSubnetIDException(ServiceError): - """ - The subnet ID provided in the Lambda function VPC configuration is not - valid. - """ - - fault: Literal["client", "server"] | None = "server" - - type: str | None = None - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_SUBNET_ID_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_INVALID_SUBNET_ID_EXCEPTION.members["Type"], self.type - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_SUBNET_ID_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_INVALID_SUBNET_ID_EXCEPTION.members["Type"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_SUBNET_ID_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVALID_SUBNET_ID_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InvalidZipFileException(ServiceError): - """Lambda could not unzip the deployment package.""" - - fault: Literal["client", "server"] | None = "server" - - type: str | None = None - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_ZIP_FILE_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_INVALID_ZIP_FILE_EXCEPTION.members["Type"], self.type - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_ZIP_FILE_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_INVALID_ZIP_FILE_EXCEPTION.members["Type"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_ZIP_FILE_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INVALID_ZIP_FILE_EXCEPTION, consumer=_consumer) - return kwargs - - -class InvocationType(UnknownEnumMixin, StrEnum): - EVENT = "Event" - REQUEST_RESPONSE = "RequestResponse" - DRY_RUN = "DryRun" - - -class LogType(UnknownEnumMixin, StrEnum): - NONE = "None" - TAIL = "Tail" - - -@dataclass(kw_only=True) -class InvokeInput: - """Dataclass for InvokeInput structure.""" - - function_name: str | None = None - """ - The name or ARN of the Lambda function, version, or alias. - - **Name formats** - - - **Function name** -- `my-function` (name-only), `my-function:v1` (with - alias). - - - **Function ARN** -- - `arn:aws:lambda:us-west-2:123456789012:function:my-function`. - - - **Partial ARN** -- `123456789012:function:my-function`. - - You can append a version number or alias to any of the formats. The - length constraint applies only to the full ARN. If you specify only the - function name, it is limited to 64 characters in length. - """ - - invocation_type: str | None = None - """ - Choose from the following options. - - - `RequestResponse` (default) -- Invoke the function synchronously. Keep - the connection open until the function returns a response or times - out. The API response includes the function response and additional - data. - - - `Event` -- Invoke the function asynchronously. Send events that fail - multiple times to the function's dead-letter queue (if one is - configured). The API response only includes a status code. - - - `DryRun` -- Validate parameter values and verify that the user or role - has permission to invoke the function. - """ - - log_type: str | None = None - """ - Set to `Tail` to include the execution log in the response. Applies to - synchronously invoked functions only. - """ - - client_context: str | None = None - """ - Up to 3,583 bytes of base64-encoded data about the invoking client to - pass to the function in the context object. Lambda passes the - `ClientContext` object to your function for synchronous invocations - only. - """ - - durable_execution_name: str | None = None - """ - A unique name for the durable execution. If you invoke a durable - function using a name that already exists with the same payload, Lambda - returns the existing execution instead of creating a duplicate. If the - payload differs, Lambda returns a - `DurableExecutionAlreadyStartedException` error. - - If not specified, Lambda generates a unique identifier automatically. - For more information, see [Execution - names](https://docs.aws.amazon.com/lambda/latest/dg/durable-execution-idempotency.html#durable-idempotency-execution-names). - """ - - payload: bytes | None = field(repr=False, default=None) - """ - The JSON that you want to provide to your Lambda function as input. The - maximum payload size is 6 MB for synchronous invocations and 1 MB for - asynchronous invocations. - - You can enter the JSON directly. For example, - `--payload '{ "key": "value" }'`. You can also specify a file path. For - example, `--payload file://payload.json`. - """ - - qualifier: str | None = None - """ - Specify a version or alias to invoke a published version of the - function. - """ - - tenant_id: str | None = None - """The identifier of the tenant in a multi-tenant Lambda function.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOKE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_INVOKE_INPUT.members["FunctionName"], self.function_name - ) - - if self.invocation_type is not None: - serializer.write_string( - _SCHEMA_INVOKE_INPUT.members["InvocationType"], self.invocation_type - ) - - if self.log_type is not None: - serializer.write_string( - _SCHEMA_INVOKE_INPUT.members["LogType"], self.log_type - ) - - if self.client_context is not None: - serializer.write_string( - _SCHEMA_INVOKE_INPUT.members["ClientContext"], self.client_context - ) - - if self.durable_execution_name is not None: - serializer.write_string( - _SCHEMA_INVOKE_INPUT.members["DurableExecutionName"], - self.durable_execution_name, - ) - - if self.payload is not None: - serializer.write_blob(_SCHEMA_INVOKE_INPUT.members["Payload"], self.payload) - - if self.qualifier is not None: - serializer.write_string( - _SCHEMA_INVOKE_INPUT.members["Qualifier"], self.qualifier - ) - - if self.tenant_id is not None: - serializer.write_string( - _SCHEMA_INVOKE_INPUT.members["TenantId"], self.tenant_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_INVOKE_INPUT.members["FunctionName"] - ) - - case 1: - kwargs["invocation_type"] = InvocationType( - de.read_string(_SCHEMA_INVOKE_INPUT.members["InvocationType"]) - ) - - case 2: - kwargs["log_type"] = LogType( - de.read_string(_SCHEMA_INVOKE_INPUT.members["LogType"]) - ) - - case 3: - kwargs["client_context"] = de.read_string( - _SCHEMA_INVOKE_INPUT.members["ClientContext"] - ) - - case 4: - kwargs["durable_execution_name"] = de.read_string( - _SCHEMA_INVOKE_INPUT.members["DurableExecutionName"] - ) - - case 5: - kwargs["payload"] = de.read_blob( - _SCHEMA_INVOKE_INPUT.members["Payload"] - ) - - case 6: - kwargs["qualifier"] = de.read_string( - _SCHEMA_INVOKE_INPUT.members["Qualifier"] - ) - - case 7: - kwargs["tenant_id"] = de.read_string( - _SCHEMA_INVOKE_INPUT.members["TenantId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INVOKE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class InvokeOutput: - """Dataclass for InvokeOutput structure.""" - - status_code: int = 0 - """ - The HTTP status code is in the 200 range for a successful request. For - the `RequestResponse` invocation type, this status code is 200. For the - `Event` invocation type, this status code is 202. For the `DryRun` - invocation type, the status code is 204. - """ - - function_error: str | None = None - """ - If present, indicates that an error occurred during function execution. - Details about the error are included in the response payload. - """ - - log_result: str | None = None - """The last 4 KB of the execution log, which is base64-encoded.""" - - payload: bytes | None = field(repr=False, default=None) - """The response from the function, or an error object.""" - - executed_version: str | None = None - """ - The version of the function that executed. When you invoke a function - with an alias, this indicates which version the alias resolved to. - """ - - durable_execution_arn: str | None = None - """ - The ARN of the durable execution that was started. This is returned when - invoking a durable function and provides a unique identifier for - tracking the execution. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOKE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer( - _SCHEMA_INVOKE_OUTPUT.members["StatusCode"], self.status_code - ) - if self.function_error is not None: - serializer.write_string( - _SCHEMA_INVOKE_OUTPUT.members["FunctionError"], self.function_error - ) - - if self.log_result is not None: - serializer.write_string( - _SCHEMA_INVOKE_OUTPUT.members["LogResult"], self.log_result - ) - - if self.payload is not None: - serializer.write_blob( - _SCHEMA_INVOKE_OUTPUT.members["Payload"], self.payload - ) - - if self.executed_version is not None: - serializer.write_string( - _SCHEMA_INVOKE_OUTPUT.members["ExecutedVersion"], self.executed_version - ) - - if self.durable_execution_arn is not None: - serializer.write_string( - _SCHEMA_INVOKE_OUTPUT.members["DurableExecutionArn"], - self.durable_execution_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["status_code"] = de.read_integer( - _SCHEMA_INVOKE_OUTPUT.members["StatusCode"] - ) - - case 1: - kwargs["function_error"] = de.read_string( - _SCHEMA_INVOKE_OUTPUT.members["FunctionError"] - ) - - case 2: - kwargs["log_result"] = de.read_string( - _SCHEMA_INVOKE_OUTPUT.members["LogResult"] - ) - - case 3: - kwargs["payload"] = de.read_blob( - _SCHEMA_INVOKE_OUTPUT.members["Payload"] - ) - - case 4: - kwargs["executed_version"] = de.read_string( - _SCHEMA_INVOKE_OUTPUT.members["ExecutedVersion"] - ) - - case 5: - kwargs["durable_execution_arn"] = de.read_string( - _SCHEMA_INVOKE_OUTPUT.members["DurableExecutionArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INVOKE_OUTPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ModeNotSupportedException(ServiceError): - """ - The Lambda function doesn't support the invocation mode requested. For - example, calling `Invoke` with `InvocationType=RequestResponse` on a - function configured for asynchronous-only invocation, or vice versa. For - more information about invocation types, see [Invoking Lambda - functions](https://docs.aws.amazon.com/lambda/latest/dg/invocation-options.html). - """ - - fault: Literal["client", "server"] | None = "client" - - type: str | None = None - """The exception type.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MODE_NOT_SUPPORTED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_MODE_NOT_SUPPORTED_EXCEPTION.members["Type"], self.type - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_MODE_NOT_SUPPORTED_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_MODE_NOT_SUPPORTED_EXCEPTION.members["Type"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_MODE_NOT_SUPPORTED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MODE_NOT_SUPPORTED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class NoPublishedVersionException(ServiceError): - """The function has no published versions available.""" - - fault: Literal["client", "server"] | None = "client" - - type: str | None = None - """The exception type.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_NO_PUBLISHED_VERSION_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_NO_PUBLISHED_VERSION_EXCEPTION.members["Type"], self.type - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_NO_PUBLISHED_VERSION_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_NO_PUBLISHED_VERSION_EXCEPTION.members["Type"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_NO_PUBLISHED_VERSION_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_NO_PUBLISHED_VERSION_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class RecursiveInvocationException(ServiceError): - """ - Lambda has detected your function being invoked in a recursive loop with - other Amazon Web Services resources and stopped your function's - invocation. - """ - - fault: Literal["client", "server"] | None = "client" - - type: str | None = None - """The exception type.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RECURSIVE_INVOCATION_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_RECURSIVE_INVOCATION_EXCEPTION.members["Type"], self.type - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_RECURSIVE_INVOCATION_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_RECURSIVE_INVOCATION_EXCEPTION.members["Type"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_RECURSIVE_INVOCATION_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RECURSIVE_INVOCATION_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class RequestTooLargeException(ServiceError): - """ - The request payload exceeded the `Invoke` request body JSON input quota. - For more information, see [Lambda - quotas](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html). - """ - - fault: Literal["client", "server"] | None = "client" - - type: str | None = None - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REQUEST_TOO_LARGE_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_REQUEST_TOO_LARGE_EXCEPTION.members["Type"], self.type - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_REQUEST_TOO_LARGE_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_REQUEST_TOO_LARGE_EXCEPTION.members["Type"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_REQUEST_TOO_LARGE_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_REQUEST_TOO_LARGE_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ResourceNotReadyException(ServiceError): - """ - The function is inactive and its VPC connection is no longer available. - Wait for the VPC connection to reestablish and try again. - """ - - fault: Literal["client", "server"] | None = "server" - - type: str | None = None - """The exception type.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESOURCE_NOT_READY_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_RESOURCE_NOT_READY_EXCEPTION.members["Type"], self.type - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_RESOURCE_NOT_READY_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_RESOURCE_NOT_READY_EXCEPTION.members["Type"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_RESOURCE_NOT_READY_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RESOURCE_NOT_READY_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class S3FilesMountConnectivityException(ServiceError): - """ - The Lambda function couldn't make a network connection to the - configured S3 Files access point. - """ - - fault: Literal["client", "server"] | None = "client" - - type: str | None = None - """The exception type.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_S3_FILES_MOUNT_CONNECTIVITY_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_S3_FILES_MOUNT_CONNECTIVITY_EXCEPTION.members["Type"], self.type - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_S3_FILES_MOUNT_CONNECTIVITY_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_S3_FILES_MOUNT_CONNECTIVITY_EXCEPTION.members["Type"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_S3_FILES_MOUNT_CONNECTIVITY_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_S3_FILES_MOUNT_CONNECTIVITY_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class S3FilesMountFailureException(ServiceError): - """ - The Lambda function couldn't mount the configured S3 Files access point - due to a permission or configuration issue. - """ - - fault: Literal["client", "server"] | None = "client" - - type: str | None = None - """The exception type.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_S3_FILES_MOUNT_FAILURE_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_S3_FILES_MOUNT_FAILURE_EXCEPTION.members["Type"], self.type - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_S3_FILES_MOUNT_FAILURE_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_S3_FILES_MOUNT_FAILURE_EXCEPTION.members["Type"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_S3_FILES_MOUNT_FAILURE_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_S3_FILES_MOUNT_FAILURE_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class S3FilesMountTimeoutException(ServiceError): - """ - The Lambda function made a network connection to the configured S3 Files - access point, but the mount operation timed out. - """ - - fault: Literal["client", "server"] | None = "client" - - type: str | None = None - """The exception type.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_S3_FILES_MOUNT_TIMEOUT_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_S3_FILES_MOUNT_TIMEOUT_EXCEPTION.members["Type"], self.type - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_S3_FILES_MOUNT_TIMEOUT_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_S3_FILES_MOUNT_TIMEOUT_EXCEPTION.members["Type"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_S3_FILES_MOUNT_TIMEOUT_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_S3_FILES_MOUNT_TIMEOUT_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class SerializedRequestEntityTooLargeException(ServiceError): - """ - The request payload exceeded the maximum allowed size for serialized - request entities. - """ - - fault: Literal["client", "server"] | None = "client" - - type: str | None = None - """The error type.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_SERIALIZED_REQUEST_ENTITY_TOO_LARGE_EXCEPTION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_SERIALIZED_REQUEST_ENTITY_TOO_LARGE_EXCEPTION.members["Type"], - self.type, - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_SERIALIZED_REQUEST_ENTITY_TOO_LARGE_EXCEPTION.members[ - "message" - ], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_SERIALIZED_REQUEST_ENTITY_TOO_LARGE_EXCEPTION.members[ - "Type" - ] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_SERIALIZED_REQUEST_ENTITY_TOO_LARGE_EXCEPTION.members[ - "message" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SERIALIZED_REQUEST_ENTITY_TOO_LARGE_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ServiceQuotaExceededException(ServiceError): - """ - The request would exceed a service quota. For more information about - Lambda service quotas, see [Lambda - quotas](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html). - To request a quota increase, see [Requesting a quota - increase](https://docs.aws.amazon.com/servicequotas/latest/userguide/request-quota-increase.html) - in the *Service Quotas User Guide*. - """ - - fault: Literal["client", "server"] | None = "client" - - type: str | None = None - """The exception type.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION.members["Type"], self.type - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION.members["Type"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class SnapStartException(ServiceError): - """ - The `afterRestore()` [runtime - hook](https://docs.aws.amazon.com/lambda/latest/dg/snapstart-runtime-hooks.html) - encountered an error. For more information, check the Amazon CloudWatch - logs. - """ - - fault: Literal["client", "server"] | None = "client" - - type: str | None = None - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SNAP_START_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_SNAP_START_EXCEPTION.members["Type"], self.type - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_SNAP_START_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_SNAP_START_EXCEPTION.members["Type"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_SNAP_START_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SNAP_START_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class SnapStartNotReadyException(ServiceError): - """ - Lambda is initializing your function. You can invoke the function when - the [function - state](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html) - becomes `Active`. - """ - - fault: Literal["client", "server"] | None = "client" - - type: str | None = None - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SNAP_START_NOT_READY_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_SNAP_START_NOT_READY_EXCEPTION.members["Type"], self.type - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_SNAP_START_NOT_READY_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_SNAP_START_NOT_READY_EXCEPTION.members["Type"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_SNAP_START_NOT_READY_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SNAP_START_NOT_READY_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class SnapStartRegenerationFailureException(ServiceError): - """ - Lambda couldn't regenerate the SnapStart snapshot for the function. - SnapStart-enabled functions periodically regenerate snapshots when their - underlying runtime or dependencies change; this regeneration failed. - Wait for Lambda to retry, or update the function's configuration to - trigger a new snapshot. For more information, see [Lambda - SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html). - """ - - fault: Literal["client", "server"] | None = "client" - - type: str | None = None - """The exception type.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SNAP_START_REGENERATION_FAILURE_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_SNAP_START_REGENERATION_FAILURE_EXCEPTION.members["Type"], - self.type, - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_SNAP_START_REGENERATION_FAILURE_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_SNAP_START_REGENERATION_FAILURE_EXCEPTION.members[ - "Type" - ] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_SNAP_START_REGENERATION_FAILURE_EXCEPTION.members[ - "Message" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SNAP_START_REGENERATION_FAILURE_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class SnapStartTimeoutException(ServiceError): - """Lambda couldn't restore the snapshot within the timeout limit.""" - - fault: Literal["client", "server"] | None = "client" - - type: str | None = None - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SNAP_START_TIMEOUT_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_SNAP_START_TIMEOUT_EXCEPTION.members["Type"], self.type - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_SNAP_START_TIMEOUT_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_SNAP_START_TIMEOUT_EXCEPTION.members["Type"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_SNAP_START_TIMEOUT_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SNAP_START_TIMEOUT_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class SubnetIPAddressLimitReachedException(ServiceError): - """ - Lambda couldn't set up VPC access for the Lambda function because one - or more configured subnets has no available IP addresses. - """ - - fault: Literal["client", "server"] | None = "server" - - type: str | None = None - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SUBNET_IP_ADDRESS_LIMIT_REACHED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_SUBNET_IP_ADDRESS_LIMIT_REACHED_EXCEPTION.members["Type"], - self.type, - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_SUBNET_IP_ADDRESS_LIMIT_REACHED_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_SUBNET_IP_ADDRESS_LIMIT_REACHED_EXCEPTION.members[ - "Type" - ] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_SUBNET_IP_ADDRESS_LIMIT_REACHED_EXCEPTION.members[ - "Message" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SUBNET_IP_ADDRESS_LIMIT_REACHED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UnsupportedMediaTypeException(ServiceError): - """The content type of the `Invoke` request body is not JSON.""" - - fault: Literal["client", "server"] | None = "client" - - type: str | None = None - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNSUPPORTED_MEDIA_TYPE_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_UNSUPPORTED_MEDIA_TYPE_EXCEPTION.members["Type"], self.type - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_UNSUPPORTED_MEDIA_TYPE_EXCEPTION.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_UNSUPPORTED_MEDIA_TYPE_EXCEPTION.members["Type"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_UNSUPPORTED_MEDIA_TYPE_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UNSUPPORTED_MEDIA_TYPE_EXCEPTION, consumer=_consumer - ) - return kwargs - - -INVOKE = APIOperation( - input=InvokeInput, - output=InvokeOutput, - schema=_SCHEMA_INVOKE, - input_schema=_SCHEMA_INVOKE_INPUT, - output_schema=_SCHEMA_INVOKE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#CodeArtifactUserDeletedException" - ): CodeArtifactUserDeletedException, - ShapeID( - "com.amazonaws.lambda#CodeArtifactUserFailedException" - ): CodeArtifactUserFailedException, - ShapeID( - "com.amazonaws.lambda#CodeArtifactUserPendingException" - ): CodeArtifactUserPendingException, - ShapeID( - "com.amazonaws.lambda#DurableExecutionAlreadyStartedException" - ): DurableExecutionAlreadyStartedException, - ShapeID( - "com.amazonaws.lambda#EC2AccessDeniedException" - ): EC2AccessDeniedException, - ShapeID( - "com.amazonaws.lambda#EC2ThrottledException" - ): EC2ThrottledException, - ShapeID( - "com.amazonaws.lambda#EC2UnexpectedException" - ): EC2UnexpectedException, - ShapeID("com.amazonaws.lambda#EFSIOException"): EFSIOException, - ShapeID( - "com.amazonaws.lambda#EFSMountConnectivityException" - ): EFSMountConnectivityException, - ShapeID( - "com.amazonaws.lambda#EFSMountFailureException" - ): EFSMountFailureException, - ShapeID( - "com.amazonaws.lambda#EFSMountTimeoutException" - ): EFSMountTimeoutException, - ShapeID( - "com.amazonaws.lambda#ENILimitReachedException" - ): ENILimitReachedException, - ShapeID("com.amazonaws.lambda#ENINotReadyException"): ENINotReadyException, - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#InvalidRequestContentException" - ): InvalidRequestContentException, - ShapeID( - "com.amazonaws.lambda#InvalidRuntimeException" - ): InvalidRuntimeException, - ShapeID( - "com.amazonaws.lambda#InvalidSecurityGroupIDException" - ): InvalidSecurityGroupIDException, - ShapeID( - "com.amazonaws.lambda#InvalidSubnetIDException" - ): InvalidSubnetIDException, - ShapeID( - "com.amazonaws.lambda#InvalidZipFileException" - ): InvalidZipFileException, - ShapeID( - "com.amazonaws.lambda#KMSAccessDeniedException" - ): KMSAccessDeniedException, - ShapeID("com.amazonaws.lambda#KMSDisabledException"): KMSDisabledException, - ShapeID( - "com.amazonaws.lambda#KMSInvalidStateException" - ): KMSInvalidStateException, - ShapeID("com.amazonaws.lambda#KMSNotFoundException"): KMSNotFoundException, - ShapeID( - "com.amazonaws.lambda#ModeNotSupportedException" - ): ModeNotSupportedException, - ShapeID( - "com.amazonaws.lambda#NoPublishedVersionException" - ): NoPublishedVersionException, - ShapeID( - "com.amazonaws.lambda#RecursiveInvocationException" - ): RecursiveInvocationException, - ShapeID( - "com.amazonaws.lambda#RequestTooLargeException" - ): RequestTooLargeException, - ShapeID( - "com.amazonaws.lambda#ResourceConflictException" - ): ResourceConflictException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.lambda#ResourceNotReadyException" - ): ResourceNotReadyException, - ShapeID( - "com.amazonaws.lambda#S3FilesMountConnectivityException" - ): S3FilesMountConnectivityException, - ShapeID( - "com.amazonaws.lambda#S3FilesMountFailureException" - ): S3FilesMountFailureException, - ShapeID( - "com.amazonaws.lambda#S3FilesMountTimeoutException" - ): S3FilesMountTimeoutException, - ShapeID( - "com.amazonaws.lambda#SerializedRequestEntityTooLargeException" - ): SerializedRequestEntityTooLargeException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID("com.amazonaws.lambda#SnapStartException"): SnapStartException, - ShapeID( - "com.amazonaws.lambda#SnapStartNotReadyException" - ): SnapStartNotReadyException, - ShapeID( - "com.amazonaws.lambda#SnapStartRegenerationFailureException" - ): SnapStartRegenerationFailureException, - ShapeID( - "com.amazonaws.lambda#SnapStartTimeoutException" - ): SnapStartTimeoutException, - ShapeID( - "com.amazonaws.lambda#SubnetIPAddressLimitReachedException" - ): SubnetIPAddressLimitReachedException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.lambda#UnsupportedMediaTypeException" - ): UnsupportedMediaTypeException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CODE_ARTIFACT_USER_DELETED_EXCEPTION, - _SCHEMA_CODE_ARTIFACT_USER_FAILED_EXCEPTION, - _SCHEMA_CODE_ARTIFACT_USER_PENDING_EXCEPTION, - _SCHEMA_DURABLE_EXECUTION_ALREADY_STARTED_EXCEPTION, - _SCHEMA_EC2_ACCESS_DENIED_EXCEPTION, - _SCHEMA_EC2_THROTTLED_EXCEPTION, - _SCHEMA_EC2_UNEXPECTED_EXCEPTION, - _SCHEMA_EFSIO_EXCEPTION, - _SCHEMA_EFS_MOUNT_CONNECTIVITY_EXCEPTION, - _SCHEMA_EFS_MOUNT_FAILURE_EXCEPTION, - _SCHEMA_EFS_MOUNT_TIMEOUT_EXCEPTION, - _SCHEMA_ENI_LIMIT_REACHED_EXCEPTION, - _SCHEMA_ENI_NOT_READY_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_INVALID_REQUEST_CONTENT_EXCEPTION, - _SCHEMA_INVALID_RUNTIME_EXCEPTION, - _SCHEMA_INVALID_SECURITY_GROUP_ID_EXCEPTION, - _SCHEMA_INVALID_SUBNET_ID_EXCEPTION, - _SCHEMA_INVALID_ZIP_FILE_EXCEPTION, - _SCHEMA_KMS_ACCESS_DENIED_EXCEPTION, - _SCHEMA_KMS_DISABLED_EXCEPTION, - _SCHEMA_KMS_INVALID_STATE_EXCEPTION, - _SCHEMA_KMS_NOT_FOUND_EXCEPTION, - _SCHEMA_MODE_NOT_SUPPORTED_EXCEPTION, - _SCHEMA_NO_PUBLISHED_VERSION_EXCEPTION, - _SCHEMA_RECURSIVE_INVOCATION_EXCEPTION, - _SCHEMA_REQUEST_TOO_LARGE_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_RESOURCE_NOT_READY_EXCEPTION, - _SCHEMA_S3_FILES_MOUNT_CONNECTIVITY_EXCEPTION, - _SCHEMA_S3_FILES_MOUNT_FAILURE_EXCEPTION, - _SCHEMA_S3_FILES_MOUNT_TIMEOUT_EXCEPTION, - _SCHEMA_SERIALIZED_REQUEST_ENTITY_TOO_LARGE_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_SNAP_START_EXCEPTION, - _SCHEMA_SNAP_START_NOT_READY_EXCEPTION, - _SCHEMA_SNAP_START_REGENERATION_FAILURE_EXCEPTION, - _SCHEMA_SNAP_START_TIMEOUT_EXCEPTION, - _SCHEMA_SUBNET_IP_ADDRESS_LIMIT_REACHED_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNSUPPORTED_MEDIA_TYPE_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class InvokeAsyncInput: - """Dataclass for InvokeAsyncInput structure.""" - - function_name: str | None = None - """ - The name or ARN of the Lambda function. - - **Name formats** - - - **Function name** -- `my-function`. - - - **Function ARN** -- - `arn:aws:lambda:us-west-2:123456789012:function:my-function`. - - - **Partial ARN** -- `123456789012:function:my-function`. - - The length constraint applies only to the full ARN. If you specify only - the function name, it is limited to 64 characters in length. - """ - - invoke_args: StreamingBlob | None = None - """The JSON that you want to provide to your Lambda function as input.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOKE_ASYNC_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_INVOKE_ASYNC_INPUT.members["FunctionName"], self.function_name - ) - - if self.invoke_args is not None: - serializer.write_data_stream( - _SCHEMA_INVOKE_ASYNC_INPUT.members["InvokeArgs"], self.invoke_args - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_INVOKE_ASYNC_INPUT.members["FunctionName"] - ) - - case 1: - kwargs["invoke_args"] = de.read_data_stream( - _SCHEMA_INVOKE_ASYNC_INPUT.members["InvokeArgs"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INVOKE_ASYNC_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class InvokeAsyncOutput: - """ - A success response (`202 Accepted`) indicates that the request is queued - for invocation. - """ - - status: int = 0 - """The status code.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOKE_ASYNC_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer( - _SCHEMA_INVOKE_ASYNC_OUTPUT.members["Status"], self.status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["status"] = de.read_integer( - _SCHEMA_INVOKE_ASYNC_OUTPUT.members["Status"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INVOKE_ASYNC_OUTPUT, consumer=_consumer) - return kwargs - - -INVOKE_ASYNC = APIOperation( - input=InvokeAsyncInput, - output=InvokeAsyncOutput, - schema=_SCHEMA_INVOKE_ASYNC, - input_schema=_SCHEMA_INVOKE_ASYNC_INPUT, - output_schema=_SCHEMA_INVOKE_ASYNC_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#EC2AccessDeniedException" - ): EC2AccessDeniedException, - ShapeID( - "com.amazonaws.lambda#EC2ThrottledException" - ): EC2ThrottledException, - ShapeID( - "com.amazonaws.lambda#EC2UnexpectedException" - ): EC2UnexpectedException, - ShapeID("com.amazonaws.lambda#EFSIOException"): EFSIOException, - ShapeID( - "com.amazonaws.lambda#EFSMountConnectivityException" - ): EFSMountConnectivityException, - ShapeID( - "com.amazonaws.lambda#EFSMountFailureException" - ): EFSMountFailureException, - ShapeID( - "com.amazonaws.lambda#EFSMountTimeoutException" - ): EFSMountTimeoutException, - ShapeID( - "com.amazonaws.lambda#ENILimitReachedException" - ): ENILimitReachedException, - ShapeID( - "com.amazonaws.lambda#InvalidRequestContentException" - ): InvalidRequestContentException, - ShapeID( - "com.amazonaws.lambda#InvalidRuntimeException" - ): InvalidRuntimeException, - ShapeID( - "com.amazonaws.lambda#InvalidSecurityGroupIDException" - ): InvalidSecurityGroupIDException, - ShapeID( - "com.amazonaws.lambda#InvalidSubnetIDException" - ): InvalidSubnetIDException, - ShapeID( - "com.amazonaws.lambda#KMSAccessDeniedException" - ): KMSAccessDeniedException, - ShapeID("com.amazonaws.lambda#KMSDisabledException"): KMSDisabledException, - ShapeID( - "com.amazonaws.lambda#KMSInvalidStateException" - ): KMSInvalidStateException, - ShapeID("com.amazonaws.lambda#KMSNotFoundException"): KMSNotFoundException, - ShapeID( - "com.amazonaws.lambda#ModeNotSupportedException" - ): ModeNotSupportedException, - ShapeID( - "com.amazonaws.lambda#ResourceConflictException" - ): ResourceConflictException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.lambda#S3FilesMountConnectivityException" - ): S3FilesMountConnectivityException, - ShapeID( - "com.amazonaws.lambda#S3FilesMountFailureException" - ): S3FilesMountFailureException, - ShapeID( - "com.amazonaws.lambda#S3FilesMountTimeoutException" - ): S3FilesMountTimeoutException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID("com.amazonaws.lambda#SnapStartException"): SnapStartException, - ShapeID( - "com.amazonaws.lambda#SnapStartNotReadyException" - ): SnapStartNotReadyException, - ShapeID( - "com.amazonaws.lambda#SnapStartRegenerationFailureException" - ): SnapStartRegenerationFailureException, - ShapeID( - "com.amazonaws.lambda#SnapStartTimeoutException" - ): SnapStartTimeoutException, - ShapeID( - "com.amazonaws.lambda#SubnetIPAddressLimitReachedException" - ): SubnetIPAddressLimitReachedException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_EC2_ACCESS_DENIED_EXCEPTION, - _SCHEMA_EC2_THROTTLED_EXCEPTION, - _SCHEMA_EC2_UNEXPECTED_EXCEPTION, - _SCHEMA_EFSIO_EXCEPTION, - _SCHEMA_EFS_MOUNT_CONNECTIVITY_EXCEPTION, - _SCHEMA_EFS_MOUNT_FAILURE_EXCEPTION, - _SCHEMA_EFS_MOUNT_TIMEOUT_EXCEPTION, - _SCHEMA_ENI_LIMIT_REACHED_EXCEPTION, - _SCHEMA_INVALID_REQUEST_CONTENT_EXCEPTION, - _SCHEMA_INVALID_RUNTIME_EXCEPTION, - _SCHEMA_INVALID_SECURITY_GROUP_ID_EXCEPTION, - _SCHEMA_INVALID_SUBNET_ID_EXCEPTION, - _SCHEMA_KMS_ACCESS_DENIED_EXCEPTION, - _SCHEMA_KMS_DISABLED_EXCEPTION, - _SCHEMA_KMS_INVALID_STATE_EXCEPTION, - _SCHEMA_KMS_NOT_FOUND_EXCEPTION, - _SCHEMA_MODE_NOT_SUPPORTED_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_S3_FILES_MOUNT_CONNECTIVITY_EXCEPTION, - _SCHEMA_S3_FILES_MOUNT_FAILURE_EXCEPTION, - _SCHEMA_S3_FILES_MOUNT_TIMEOUT_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_SNAP_START_EXCEPTION, - _SCHEMA_SNAP_START_NOT_READY_EXCEPTION, - _SCHEMA_SNAP_START_REGENERATION_FAILURE_EXCEPTION, - _SCHEMA_SNAP_START_TIMEOUT_EXCEPTION, - _SCHEMA_SUBNET_IP_ADDRESS_LIMIT_REACHED_EXCEPTION, - ], -) - - -class ResponseStreamingInvocationType(UnknownEnumMixin, StrEnum): - REQUEST_RESPONSE = "RequestResponse" - DRY_RUN = "DryRun" - - -@dataclass(kw_only=True) -class InvokeWithResponseStreamInput: - """Dataclass for InvokeWithResponseStreamInput structure.""" - - function_name: str | None = None - """ - The name or ARN of the Lambda function. - - **Name formats** - - - **Function name** -- `my-function`. - - - **Function ARN** -- - `arn:aws:lambda:us-west-2:123456789012:function:my-function`. - - - **Partial ARN** -- `123456789012:function:my-function`. - - The length constraint applies only to the full ARN. If you specify only - the function name, it is limited to 64 characters in length. - """ - - log_type: str | None = None - """ - Set to `Tail` to include the execution log in the response. Applies to - synchronously invoked functions only. - """ - - client_context: str | None = None - """ - Up to 3,583 bytes of base64-encoded data about the invoking client to - pass to the function in the context object. - """ - - qualifier: str | None = None - """The alias name.""" - - payload: bytes | None = field(repr=False, default=None) - """ - The JSON that you want to provide to your Lambda function as input. - - You can enter the JSON directly. For example, - `--payload '{ "key": "value" }'`. You can also specify a file path. For - example, `--payload file://payload.json`. - """ - - tenant_id: str | None = None - """The identifier of the tenant in a multi-tenant Lambda function.""" - - invocation_type: str | None = None - """ - Use one of the following options: - - - `RequestResponse` (default) -- Invoke the function synchronously. Keep - the connection open until the function returns a response or times - out. The API operation response includes the function response and - additional data. - - - `DryRun` -- Validate parameter values and verify that the IAM user or - role has permission to invoke the function. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOKE_WITH_RESPONSE_STREAM_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_INVOKE_WITH_RESPONSE_STREAM_INPUT.members["FunctionName"], - self.function_name, - ) - - if self.log_type is not None: - serializer.write_string( - _SCHEMA_INVOKE_WITH_RESPONSE_STREAM_INPUT.members["LogType"], - self.log_type, - ) - - if self.client_context is not None: - serializer.write_string( - _SCHEMA_INVOKE_WITH_RESPONSE_STREAM_INPUT.members["ClientContext"], - self.client_context, - ) - - if self.qualifier is not None: - serializer.write_string( - _SCHEMA_INVOKE_WITH_RESPONSE_STREAM_INPUT.members["Qualifier"], - self.qualifier, - ) - - if self.payload is not None: - serializer.write_blob( - _SCHEMA_INVOKE_WITH_RESPONSE_STREAM_INPUT.members["Payload"], - self.payload, - ) - - if self.tenant_id is not None: - serializer.write_string( - _SCHEMA_INVOKE_WITH_RESPONSE_STREAM_INPUT.members["TenantId"], - self.tenant_id, - ) - - if self.invocation_type is not None: - serializer.write_string( - _SCHEMA_INVOKE_WITH_RESPONSE_STREAM_INPUT.members["InvocationType"], - self.invocation_type, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_INVOKE_WITH_RESPONSE_STREAM_INPUT.members[ - "FunctionName" - ] - ) - - case 1: - kwargs["log_type"] = LogType( - de.read_string( - _SCHEMA_INVOKE_WITH_RESPONSE_STREAM_INPUT.members["LogType"] - ) - ) - - case 2: - kwargs["client_context"] = de.read_string( - _SCHEMA_INVOKE_WITH_RESPONSE_STREAM_INPUT.members[ - "ClientContext" - ] - ) - - case 3: - kwargs["qualifier"] = de.read_string( - _SCHEMA_INVOKE_WITH_RESPONSE_STREAM_INPUT.members["Qualifier"] - ) - - case 4: - kwargs["payload"] = de.read_blob( - _SCHEMA_INVOKE_WITH_RESPONSE_STREAM_INPUT.members["Payload"] - ) - - case 5: - kwargs["tenant_id"] = de.read_string( - _SCHEMA_INVOKE_WITH_RESPONSE_STREAM_INPUT.members["TenantId"] - ) - - case 6: - kwargs["invocation_type"] = ResponseStreamingInvocationType( - de.read_string( - _SCHEMA_INVOKE_WITH_RESPONSE_STREAM_INPUT.members[ - "InvocationType" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVOKE_WITH_RESPONSE_STREAM_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InvokeWithResponseStreamCompleteEvent: - """A response confirming that the event stream is complete.""" - - error_code: str | None = None - """An error code.""" - - error_details: str | None = None - """The details of any returned error.""" - - log_result: str | None = None - """The last 4 KB of the execution log, which is base64-encoded.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_WITH_RESPONSE_STREAM_COMPLETE_EVENT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.error_code is not None: - serializer.write_string( - _SCHEMA_INVOKE_WITH_RESPONSE_STREAM_COMPLETE_EVENT.members["ErrorCode"], - self.error_code, - ) - - if self.error_details is not None: - serializer.write_string( - _SCHEMA_INVOKE_WITH_RESPONSE_STREAM_COMPLETE_EVENT.members[ - "ErrorDetails" - ], - self.error_details, - ) - - if self.log_result is not None: - serializer.write_string( - _SCHEMA_INVOKE_WITH_RESPONSE_STREAM_COMPLETE_EVENT.members["LogResult"], - self.log_result, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["error_code"] = de.read_string( - _SCHEMA_INVOKE_WITH_RESPONSE_STREAM_COMPLETE_EVENT.members[ - "ErrorCode" - ] - ) - - case 1: - kwargs["error_details"] = de.read_string( - _SCHEMA_INVOKE_WITH_RESPONSE_STREAM_COMPLETE_EVENT.members[ - "ErrorDetails" - ] - ) - - case 2: - kwargs["log_result"] = de.read_string( - _SCHEMA_INVOKE_WITH_RESPONSE_STREAM_COMPLETE_EVENT.members[ - "LogResult" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVOKE_WITH_RESPONSE_STREAM_COMPLETE_EVENT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InvokeResponseStreamUpdate: - """A chunk of the streamed response payload.""" - - payload: bytes | None = field(repr=False, default=None) - """Data returned by your Lambda function.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOKE_RESPONSE_STREAM_UPDATE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.payload is not None: - serializer.write_blob( - _SCHEMA_INVOKE_RESPONSE_STREAM_UPDATE.members["Payload"], self.payload - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["payload"] = de.read_blob( - _SCHEMA_INVOKE_RESPONSE_STREAM_UPDATE.members["Payload"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVOKE_RESPONSE_STREAM_UPDATE, consumer=_consumer - ) - return kwargs - - -@dataclass -class InvokeWithResponseStreamResponseEventPayloadChunk: - """A chunk of the streamed response payload.""" - - value: InvokeResponseStreamUpdate - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_WITH_RESPONSE_STREAM_RESPONSE_EVENT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_WITH_RESPONSE_STREAM_RESPONSE_EVENT.members["PayloadChunk"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=InvokeResponseStreamUpdate.deserialize(deserializer)) - - -@dataclass -class InvokeWithResponseStreamResponseEventInvokeComplete: - """ - An object that's returned when the stream has ended and all the payload - chunks have been returned. - """ - - value: InvokeWithResponseStreamCompleteEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_WITH_RESPONSE_STREAM_RESPONSE_EVENT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_WITH_RESPONSE_STREAM_RESPONSE_EVENT.members[ - "InvokeComplete" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=InvokeWithResponseStreamCompleteEvent.deserialize(deserializer) - ) - - -@dataclass -class InvokeWithResponseStreamResponseEventUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -InvokeWithResponseStreamResponseEvent = Union[ - InvokeWithResponseStreamResponseEventPayloadChunk - | InvokeWithResponseStreamResponseEventInvokeComplete - | InvokeWithResponseStreamResponseEventUnknown -] -""" -An object that includes a chunk of the response payload. When the stream -has ended, Lambda includes a `InvokeComplete` object. -""" - - -class _InvokeWithResponseStreamResponseEventDeserializer: - _result: InvokeWithResponseStreamResponseEvent | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> InvokeWithResponseStreamResponseEvent: - self._result = None - deserializer.read_struct( - _SCHEMA_INVOKE_WITH_RESPONSE_STREAM_RESPONSE_EVENT, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - InvokeWithResponseStreamResponseEventPayloadChunk.deserialize(de) - ) - - case 1: - self._set_result( - InvokeWithResponseStreamResponseEventInvokeComplete.deserialize(de) - ) - - case _: - self._set_result( - InvokeWithResponseStreamResponseEventUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: InvokeWithResponseStreamResponseEvent) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class InvokeWithResponseStreamOutput: - """Dataclass for InvokeWithResponseStreamOutput structure.""" - - status_code: int = 0 - """ - For a successful request, the HTTP status code is in the 200 range. For - the `RequestResponse` invocation type, this status code is 200. For the - `DryRun` invocation type, this status code is 204. - """ - - executed_version: str | None = None - """ - The version of the function that executed. When you invoke a function - with an alias, this indicates which version the alias resolved to. - """ - - response_stream_content_type: str | None = None - """The type of data the stream is returning.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVOKE_WITH_RESPONSE_STREAM_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer( - _SCHEMA_INVOKE_WITH_RESPONSE_STREAM_OUTPUT.members["StatusCode"], - self.status_code, - ) - if self.executed_version is not None: - serializer.write_string( - _SCHEMA_INVOKE_WITH_RESPONSE_STREAM_OUTPUT.members["ExecutedVersion"], - self.executed_version, - ) - - if self.response_stream_content_type is not None: - serializer.write_string( - _SCHEMA_INVOKE_WITH_RESPONSE_STREAM_OUTPUT.members[ - "ResponseStreamContentType" - ], - self.response_stream_content_type, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["status_code"] = de.read_integer( - _SCHEMA_INVOKE_WITH_RESPONSE_STREAM_OUTPUT.members["StatusCode"] - ) - - case 1: - kwargs["executed_version"] = de.read_string( - _SCHEMA_INVOKE_WITH_RESPONSE_STREAM_OUTPUT.members[ - "ExecutedVersion" - ] - ) - - case 3: - kwargs["response_stream_content_type"] = de.read_string( - _SCHEMA_INVOKE_WITH_RESPONSE_STREAM_OUTPUT.members[ - "ResponseStreamContentType" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVOKE_WITH_RESPONSE_STREAM_OUTPUT, consumer=_consumer - ) - return kwargs - - -INVOKE_WITH_RESPONSE_STREAM = APIOperation( - input=InvokeWithResponseStreamInput, - output=InvokeWithResponseStreamOutput, - schema=_SCHEMA_INVOKE_WITH_RESPONSE_STREAM, - input_schema=_SCHEMA_INVOKE_WITH_RESPONSE_STREAM_INPUT, - output_schema=_SCHEMA_INVOKE_WITH_RESPONSE_STREAM_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#EC2AccessDeniedException" - ): EC2AccessDeniedException, - ShapeID( - "com.amazonaws.lambda#EC2ThrottledException" - ): EC2ThrottledException, - ShapeID( - "com.amazonaws.lambda#EC2UnexpectedException" - ): EC2UnexpectedException, - ShapeID("com.amazonaws.lambda#EFSIOException"): EFSIOException, - ShapeID( - "com.amazonaws.lambda#EFSMountConnectivityException" - ): EFSMountConnectivityException, - ShapeID( - "com.amazonaws.lambda#EFSMountFailureException" - ): EFSMountFailureException, - ShapeID( - "com.amazonaws.lambda#EFSMountTimeoutException" - ): EFSMountTimeoutException, - ShapeID( - "com.amazonaws.lambda#ENILimitReachedException" - ): ENILimitReachedException, - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#InvalidRequestContentException" - ): InvalidRequestContentException, - ShapeID( - "com.amazonaws.lambda#InvalidRuntimeException" - ): InvalidRuntimeException, - ShapeID( - "com.amazonaws.lambda#InvalidSecurityGroupIDException" - ): InvalidSecurityGroupIDException, - ShapeID( - "com.amazonaws.lambda#InvalidSubnetIDException" - ): InvalidSubnetIDException, - ShapeID( - "com.amazonaws.lambda#InvalidZipFileException" - ): InvalidZipFileException, - ShapeID( - "com.amazonaws.lambda#KMSAccessDeniedException" - ): KMSAccessDeniedException, - ShapeID("com.amazonaws.lambda#KMSDisabledException"): KMSDisabledException, - ShapeID( - "com.amazonaws.lambda#KMSInvalidStateException" - ): KMSInvalidStateException, - ShapeID("com.amazonaws.lambda#KMSNotFoundException"): KMSNotFoundException, - ShapeID( - "com.amazonaws.lambda#NoPublishedVersionException" - ): NoPublishedVersionException, - ShapeID( - "com.amazonaws.lambda#RecursiveInvocationException" - ): RecursiveInvocationException, - ShapeID( - "com.amazonaws.lambda#RequestTooLargeException" - ): RequestTooLargeException, - ShapeID( - "com.amazonaws.lambda#ResourceConflictException" - ): ResourceConflictException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.lambda#ResourceNotReadyException" - ): ResourceNotReadyException, - ShapeID( - "com.amazonaws.lambda#S3FilesMountConnectivityException" - ): S3FilesMountConnectivityException, - ShapeID( - "com.amazonaws.lambda#S3FilesMountFailureException" - ): S3FilesMountFailureException, - ShapeID( - "com.amazonaws.lambda#S3FilesMountTimeoutException" - ): S3FilesMountTimeoutException, - ShapeID( - "com.amazonaws.lambda#SerializedRequestEntityTooLargeException" - ): SerializedRequestEntityTooLargeException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID("com.amazonaws.lambda#SnapStartException"): SnapStartException, - ShapeID( - "com.amazonaws.lambda#SnapStartNotReadyException" - ): SnapStartNotReadyException, - ShapeID( - "com.amazonaws.lambda#SnapStartRegenerationFailureException" - ): SnapStartRegenerationFailureException, - ShapeID( - "com.amazonaws.lambda#SnapStartTimeoutException" - ): SnapStartTimeoutException, - ShapeID( - "com.amazonaws.lambda#SubnetIPAddressLimitReachedException" - ): SubnetIPAddressLimitReachedException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - ShapeID( - "com.amazonaws.lambda#UnsupportedMediaTypeException" - ): UnsupportedMediaTypeException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_EC2_ACCESS_DENIED_EXCEPTION, - _SCHEMA_EC2_THROTTLED_EXCEPTION, - _SCHEMA_EC2_UNEXPECTED_EXCEPTION, - _SCHEMA_EFSIO_EXCEPTION, - _SCHEMA_EFS_MOUNT_CONNECTIVITY_EXCEPTION, - _SCHEMA_EFS_MOUNT_FAILURE_EXCEPTION, - _SCHEMA_EFS_MOUNT_TIMEOUT_EXCEPTION, - _SCHEMA_ENI_LIMIT_REACHED_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_INVALID_REQUEST_CONTENT_EXCEPTION, - _SCHEMA_INVALID_RUNTIME_EXCEPTION, - _SCHEMA_INVALID_SECURITY_GROUP_ID_EXCEPTION, - _SCHEMA_INVALID_SUBNET_ID_EXCEPTION, - _SCHEMA_INVALID_ZIP_FILE_EXCEPTION, - _SCHEMA_KMS_ACCESS_DENIED_EXCEPTION, - _SCHEMA_KMS_DISABLED_EXCEPTION, - _SCHEMA_KMS_INVALID_STATE_EXCEPTION, - _SCHEMA_KMS_NOT_FOUND_EXCEPTION, - _SCHEMA_NO_PUBLISHED_VERSION_EXCEPTION, - _SCHEMA_RECURSIVE_INVOCATION_EXCEPTION, - _SCHEMA_REQUEST_TOO_LARGE_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_RESOURCE_NOT_READY_EXCEPTION, - _SCHEMA_S3_FILES_MOUNT_CONNECTIVITY_EXCEPTION, - _SCHEMA_S3_FILES_MOUNT_FAILURE_EXCEPTION, - _SCHEMA_S3_FILES_MOUNT_TIMEOUT_EXCEPTION, - _SCHEMA_SERIALIZED_REQUEST_ENTITY_TOO_LARGE_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_SNAP_START_EXCEPTION, - _SCHEMA_SNAP_START_NOT_READY_EXCEPTION, - _SCHEMA_SNAP_START_REGENERATION_FAILURE_EXCEPTION, - _SCHEMA_SNAP_START_TIMEOUT_EXCEPTION, - _SCHEMA_SUBNET_IP_ADDRESS_LIMIT_REACHED_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - _SCHEMA_UNSUPPORTED_MEDIA_TYPE_EXCEPTION, - ], -) - - -def _serialize_execution_status_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_execution_status_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ExecutionStatus(d.read_string(member_schema))) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListDurableExecutionsByFunctionInput: - """Dataclass for ListDurableExecutionsByFunctionInput structure.""" - - function_name: str | None = None - """ - The name or ARN of the Lambda function. You can specify a function name, - a partial ARN, or a full ARN. - """ - - qualifier: str | None = None - """ - The function version or alias. If not specified, lists executions for - the $LATEST version. - """ - - durable_execution_name: str | None = None - """ - Filter executions by name. Only executions with names that matches this - string are returned. - """ - - statuses: list[str] | None = None - """ - Filter executions by status. Valid values: RUNNING, SUCCEEDED, FAILED, - TIMED_OUT, STOPPED. - """ - - started_after: datetime | None = None - """Filter executions that started after this timestamp (ISO 8601 format).""" - - started_before: datetime | None = None - """Filter executions that started before this timestamp (ISO 8601 format).""" - - reverse_order: bool | None = None - """ - Set to true to return results in chronological order (oldest first). - Default is false. - """ - - marker: str | None = None - """Pagination token from a previous request to continue retrieving results.""" - - max_items: int = 0 - """Maximum number of executions to return (1-1000). Default is 100.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_DURABLE_EXECUTIONS_BY_FUNCTION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_LIST_DURABLE_EXECUTIONS_BY_FUNCTION_INPUT.members[ - "FunctionName" - ], - self.function_name, - ) - - if self.qualifier is not None: - serializer.write_string( - _SCHEMA_LIST_DURABLE_EXECUTIONS_BY_FUNCTION_INPUT.members["Qualifier"], - self.qualifier, - ) - - if self.durable_execution_name is not None: - serializer.write_string( - _SCHEMA_LIST_DURABLE_EXECUTIONS_BY_FUNCTION_INPUT.members[ - "DurableExecutionName" - ], - self.durable_execution_name, - ) - - if self.statuses is not None: - _serialize_execution_status_list( - serializer, - _SCHEMA_LIST_DURABLE_EXECUTIONS_BY_FUNCTION_INPUT.members["Statuses"], - self.statuses, - ) - - if self.started_after is not None: - serializer.write_timestamp( - _SCHEMA_LIST_DURABLE_EXECUTIONS_BY_FUNCTION_INPUT.members[ - "StartedAfter" - ], - self.started_after, - ) - - if self.started_before is not None: - serializer.write_timestamp( - _SCHEMA_LIST_DURABLE_EXECUTIONS_BY_FUNCTION_INPUT.members[ - "StartedBefore" - ], - self.started_before, - ) - - if self.reverse_order is not None: - serializer.write_boolean( - _SCHEMA_LIST_DURABLE_EXECUTIONS_BY_FUNCTION_INPUT.members[ - "ReverseOrder" - ], - self.reverse_order, - ) - - if self.marker is not None: - serializer.write_string( - _SCHEMA_LIST_DURABLE_EXECUTIONS_BY_FUNCTION_INPUT.members["Marker"], - self.marker, - ) - - if self.max_items is not None: - serializer.write_integer( - _SCHEMA_LIST_DURABLE_EXECUTIONS_BY_FUNCTION_INPUT.members["MaxItems"], - self.max_items, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_LIST_DURABLE_EXECUTIONS_BY_FUNCTION_INPUT.members[ - "FunctionName" - ] - ) - - case 1: - kwargs["qualifier"] = de.read_string( - _SCHEMA_LIST_DURABLE_EXECUTIONS_BY_FUNCTION_INPUT.members[ - "Qualifier" - ] - ) - - case 2: - kwargs["durable_execution_name"] = de.read_string( - _SCHEMA_LIST_DURABLE_EXECUTIONS_BY_FUNCTION_INPUT.members[ - "DurableExecutionName" - ] - ) - - case 3: - kwargs["statuses"] = _deserialize_execution_status_list( - de, - _SCHEMA_LIST_DURABLE_EXECUTIONS_BY_FUNCTION_INPUT.members[ - "Statuses" - ], - ) - - case 4: - kwargs["started_after"] = de.read_timestamp( - _SCHEMA_LIST_DURABLE_EXECUTIONS_BY_FUNCTION_INPUT.members[ - "StartedAfter" - ] - ) - - case 5: - kwargs["started_before"] = de.read_timestamp( - _SCHEMA_LIST_DURABLE_EXECUTIONS_BY_FUNCTION_INPUT.members[ - "StartedBefore" - ] - ) - - case 6: - kwargs["reverse_order"] = de.read_boolean( - _SCHEMA_LIST_DURABLE_EXECUTIONS_BY_FUNCTION_INPUT.members[ - "ReverseOrder" - ] - ) - - case 7: - kwargs["marker"] = de.read_string( - _SCHEMA_LIST_DURABLE_EXECUTIONS_BY_FUNCTION_INPUT.members[ - "Marker" - ] - ) - - case 8: - kwargs["max_items"] = de.read_integer( - _SCHEMA_LIST_DURABLE_EXECUTIONS_BY_FUNCTION_INPUT.members[ - "MaxItems" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_DURABLE_EXECUTIONS_BY_FUNCTION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class Execution: - """ - Information about a [durable - execution](https://docs.aws.amazon.com/lambda/latest/dg/durable-functions.html). - """ - - durable_execution_arn: str - """ - The Amazon Resource Name (ARN) of the durable execution, if this - execution is a durable execution. - """ - - durable_execution_name: str - """ - The unique name of the durable execution, if one was provided when the - execution was started. - """ - - function_arn: str - """The Amazon Resource Name (ARN) of the Lambda function.""" - - status: str - """The current status of the durable execution.""" - - start_timestamp: datetime - """ - The date and time when the durable execution started, in [ISO-8601 - format](https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). - """ - - end_timestamp: datetime | None = None - """ - The date and time when the durable execution ended, in [ISO-8601 - format](https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). - """ - - kms_key_arn: str | None = None - """ - The ARN of the Key Management Service (KMS) customer managed key that is - used to encrypt your durable execution's payload data, including input, - output, and error payloads. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EXECUTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_EXECUTION.members["DurableExecutionArn"], self.durable_execution_arn - ) - serializer.write_string( - _SCHEMA_EXECUTION.members["DurableExecutionName"], - self.durable_execution_name, - ) - serializer.write_string( - _SCHEMA_EXECUTION.members["FunctionArn"], self.function_arn - ) - serializer.write_string(_SCHEMA_EXECUTION.members["Status"], self.status) - serializer.write_timestamp( - _SCHEMA_EXECUTION.members["StartTimestamp"], self.start_timestamp - ) - if self.end_timestamp is not None: - serializer.write_timestamp( - _SCHEMA_EXECUTION.members["EndTimestamp"], self.end_timestamp - ) - - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_EXECUTION.members["KMSKeyArn"], self.kms_key_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["durable_execution_arn"] = de.read_string( - _SCHEMA_EXECUTION.members["DurableExecutionArn"] - ) - - case 1: - kwargs["durable_execution_name"] = de.read_string( - _SCHEMA_EXECUTION.members["DurableExecutionName"] - ) - - case 2: - kwargs["function_arn"] = de.read_string( - _SCHEMA_EXECUTION.members["FunctionArn"] - ) - - case 3: - kwargs["status"] = ExecutionStatus( - de.read_string(_SCHEMA_EXECUTION.members["Status"]) - ) - - case 4: - kwargs["start_timestamp"] = de.read_timestamp( - _SCHEMA_EXECUTION.members["StartTimestamp"] - ) - - case 5: - kwargs["end_timestamp"] = de.read_timestamp( - _SCHEMA_EXECUTION.members["EndTimestamp"] - ) - - case 6: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_EXECUTION.members["KMSKeyArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EXECUTION, consumer=_consumer) - if "durable_execution_arn" not in kwargs: - kwargs["durable_execution_arn"] = "" - if "durable_execution_name" not in kwargs: - kwargs["durable_execution_name"] = "" - if "function_arn" not in kwargs: - kwargs["function_arn"] = "" - if "status" not in kwargs: - kwargs["status"] = ExecutionStatus._corrected("") - if "start_timestamp" not in kwargs: - kwargs["start_timestamp"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -def _serialize_durable_executions( - serializer: ShapeSerializer, schema: Schema, value: list[Execution] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_durable_executions( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Execution]: - result: list[Execution] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Execution.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListDurableExecutionsByFunctionOutput: - """ - The response from the ListDurableExecutionsByFunction operation, - containing a list of durable executions and pagination information. - """ - - durable_executions: list[Execution] | None = None - """List of durable execution summaries matching the filter criteria.""" - - next_marker: str | None = None - """ - Pagination token for retrieving additional results. Present only if - there are more results available. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_LIST_DURABLE_EXECUTIONS_BY_FUNCTION_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.durable_executions is not None: - _serialize_durable_executions( - serializer, - _SCHEMA_LIST_DURABLE_EXECUTIONS_BY_FUNCTION_OUTPUT.members[ - "DurableExecutions" - ], - self.durable_executions, - ) - - if self.next_marker is not None: - serializer.write_string( - _SCHEMA_LIST_DURABLE_EXECUTIONS_BY_FUNCTION_OUTPUT.members[ - "NextMarker" - ], - self.next_marker, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["durable_executions"] = _deserialize_durable_executions( - de, - _SCHEMA_LIST_DURABLE_EXECUTIONS_BY_FUNCTION_OUTPUT.members[ - "DurableExecutions" - ], - ) - - case 1: - kwargs["next_marker"] = de.read_string( - _SCHEMA_LIST_DURABLE_EXECUTIONS_BY_FUNCTION_OUTPUT.members[ - "NextMarker" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_DURABLE_EXECUTIONS_BY_FUNCTION_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_DURABLE_EXECUTIONS_BY_FUNCTION = APIOperation( - input=ListDurableExecutionsByFunctionInput, - output=ListDurableExecutionsByFunctionOutput, - schema=_SCHEMA_LIST_DURABLE_EXECUTIONS_BY_FUNCTION, - input_schema=_SCHEMA_LIST_DURABLE_EXECUTIONS_BY_FUNCTION_INPUT, - output_schema=_SCHEMA_LIST_DURABLE_EXECUTIONS_BY_FUNCTION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -class FunctionVersion(UnknownEnumMixin, StrEnum): - ALL = "ALL" - - -@dataclass(kw_only=True) -class ListFunctionsInput: - """Dataclass for ListFunctionsInput structure.""" - - master_region: str | None = None - """ - For Lambda@Edge functions, the Amazon Web Services Region of the master - function. For example, `us-east-1` filters the list of functions to - include only Lambda@Edge functions replicated from a master function in - US East (N. Virginia). If specified, you must set `FunctionVersion` to - `ALL`. - """ - - function_version: str | None = None - """ - Set to `ALL` to include entries for all published versions of each - function. - """ - - marker: str | None = None - """ - Specify the pagination token that's returned by a previous request to - retrieve the next page of results. - """ - - max_items: int | None = None - """ - The maximum number of functions to return in the response. Note that - `ListFunctions` returns a maximum of 50 items in each response, even if - you set the number higher. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_FUNCTIONS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.master_region is not None: - serializer.write_string( - _SCHEMA_LIST_FUNCTIONS_INPUT.members["MasterRegion"], self.master_region - ) - - if self.function_version is not None: - serializer.write_string( - _SCHEMA_LIST_FUNCTIONS_INPUT.members["FunctionVersion"], - self.function_version, - ) - - if self.marker is not None: - serializer.write_string( - _SCHEMA_LIST_FUNCTIONS_INPUT.members["Marker"], self.marker - ) - - if self.max_items is not None: - serializer.write_integer( - _SCHEMA_LIST_FUNCTIONS_INPUT.members["MaxItems"], self.max_items - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["master_region"] = de.read_string( - _SCHEMA_LIST_FUNCTIONS_INPUT.members["MasterRegion"] - ) - - case 1: - kwargs["function_version"] = FunctionVersion( - de.read_string( - _SCHEMA_LIST_FUNCTIONS_INPUT.members["FunctionVersion"] - ) - ) - - case 2: - kwargs["marker"] = de.read_string( - _SCHEMA_LIST_FUNCTIONS_INPUT.members["Marker"] - ) - - case 3: - kwargs["max_items"] = de.read_integer( - _SCHEMA_LIST_FUNCTIONS_INPUT.members["MaxItems"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_FUNCTIONS_INPUT, consumer=_consumer) - return kwargs - - -def _serialize_function_list( - serializer: ShapeSerializer, schema: Schema, value: list[FunctionConfiguration] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_function_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[FunctionConfiguration]: - result: list[FunctionConfiguration] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(FunctionConfiguration.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListFunctionsOutput: - """A list of Lambda functions.""" - - next_marker: str | None = None - """The pagination token that's included if more results are available.""" - - functions: list[FunctionConfiguration] | None = None - """A list of Lambda functions.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_FUNCTIONS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_marker is not None: - serializer.write_string( - _SCHEMA_LIST_FUNCTIONS_OUTPUT.members["NextMarker"], self.next_marker - ) - - if self.functions is not None: - _serialize_function_list( - serializer, - _SCHEMA_LIST_FUNCTIONS_OUTPUT.members["Functions"], - self.functions, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_marker"] = de.read_string( - _SCHEMA_LIST_FUNCTIONS_OUTPUT.members["NextMarker"] - ) - - case 1: - kwargs["functions"] = _deserialize_function_list( - de, _SCHEMA_LIST_FUNCTIONS_OUTPUT.members["Functions"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_FUNCTIONS_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_FUNCTIONS = APIOperation( - input=ListFunctionsInput, - output=ListFunctionsOutput, - schema=_SCHEMA_LIST_FUNCTIONS, - input_schema=_SCHEMA_LIST_FUNCTIONS_INPUT, - output_schema=_SCHEMA_LIST_FUNCTIONS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListFunctionUrlConfigsInput: - """Dataclass for ListFunctionUrlConfigsInput structure.""" - - function_name: str | None = None - """ - The name or ARN of the Lambda function. - - **Name formats** - - - **Function name** -- `my-function`. - - - **Function ARN** -- - `arn:aws:lambda:us-west-2:123456789012:function:my-function`. - - - **Partial ARN** -- `123456789012:function:my-function`. - - The length constraint applies only to the full ARN. If you specify only - the function name, it is limited to 64 characters in length. - """ - - marker: str | None = None - """ - Specify the pagination token that's returned by a previous request to - retrieve the next page of results. - """ - - max_items: int | None = None - """ - The maximum number of function URLs to return in the response. Note that - `ListFunctionUrlConfigs` returns a maximum of 50 items in each response, - even if you set the number higher. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_FUNCTION_URL_CONFIGS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_LIST_FUNCTION_URL_CONFIGS_INPUT.members["FunctionName"], - self.function_name, - ) - - if self.marker is not None: - serializer.write_string( - _SCHEMA_LIST_FUNCTION_URL_CONFIGS_INPUT.members["Marker"], self.marker - ) - - if self.max_items is not None: - serializer.write_integer( - _SCHEMA_LIST_FUNCTION_URL_CONFIGS_INPUT.members["MaxItems"], - self.max_items, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_LIST_FUNCTION_URL_CONFIGS_INPUT.members["FunctionName"] - ) - - case 1: - kwargs["marker"] = de.read_string( - _SCHEMA_LIST_FUNCTION_URL_CONFIGS_INPUT.members["Marker"] - ) - - case 2: - kwargs["max_items"] = de.read_integer( - _SCHEMA_LIST_FUNCTION_URL_CONFIGS_INPUT.members["MaxItems"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_FUNCTION_URL_CONFIGS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class FunctionUrlConfig: - """Details about a Lambda function URL.""" - - function_url: str - """The HTTP URL endpoint for your function.""" - - function_arn: str - """The Amazon Resource Name (ARN) of your function.""" - - creation_time: str - """ - When the function URL was created, in [ISO-8601 - format](https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). - """ - - last_modified_time: str - """ - When the function URL configuration was last updated, in [ISO-8601 - format](https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). - """ - - auth_type: str - """ - The type of authentication that your function URL uses. Set to `AWS_IAM` - if you want to restrict access to authenticated users only. Set to - `NONE` if you want to bypass IAM authentication to create a public - endpoint. For more information, see [Security and auth model for Lambda - function - URLs](https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html). - """ - - cors: Cors | None = None - """ - The [cross-origin resource sharing - (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) settings - for your function URL. - """ - - invoke_mode: str | None = None - """ - Use one of the following options: - - - `BUFFERED` -- This is the default option. Lambda invokes your function - using the `Invoke` API operation. Invocation results are available - when the payload is complete. The maximum payload size is 6 MB. - - - `RESPONSE_STREAM` -- Your function streams payload results as they - become available. Lambda invokes your function using the - `InvokeWithResponseStream` API operation. The maximum response payload - size is 200 MB. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FUNCTION_URL_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_FUNCTION_URL_CONFIG.members["FunctionUrl"], self.function_url - ) - serializer.write_string( - _SCHEMA_FUNCTION_URL_CONFIG.members["FunctionArn"], self.function_arn - ) - serializer.write_string( - _SCHEMA_FUNCTION_URL_CONFIG.members["CreationTime"], self.creation_time - ) - serializer.write_string( - _SCHEMA_FUNCTION_URL_CONFIG.members["LastModifiedTime"], - self.last_modified_time, - ) - if self.cors is not None: - serializer.write_struct( - _SCHEMA_FUNCTION_URL_CONFIG.members["Cors"], self.cors - ) - - serializer.write_string( - _SCHEMA_FUNCTION_URL_CONFIG.members["AuthType"], self.auth_type - ) - if self.invoke_mode is not None: - serializer.write_string( - _SCHEMA_FUNCTION_URL_CONFIG.members["InvokeMode"], self.invoke_mode - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_url"] = de.read_string( - _SCHEMA_FUNCTION_URL_CONFIG.members["FunctionUrl"] - ) - - case 1: - kwargs["function_arn"] = de.read_string( - _SCHEMA_FUNCTION_URL_CONFIG.members["FunctionArn"] - ) - - case 2: - kwargs["creation_time"] = de.read_string( - _SCHEMA_FUNCTION_URL_CONFIG.members["CreationTime"] - ) - - case 3: - kwargs["last_modified_time"] = de.read_string( - _SCHEMA_FUNCTION_URL_CONFIG.members["LastModifiedTime"] - ) - - case 4: - kwargs["cors"] = Cors.deserialize(de) - - case 5: - kwargs["auth_type"] = FunctionUrlAuthType( - de.read_string(_SCHEMA_FUNCTION_URL_CONFIG.members["AuthType"]) - ) - - case 6: - kwargs["invoke_mode"] = InvokeMode( - de.read_string( - _SCHEMA_FUNCTION_URL_CONFIG.members["InvokeMode"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FUNCTION_URL_CONFIG, consumer=_consumer) - if "function_url" not in kwargs: - kwargs["function_url"] = "" - if "function_arn" not in kwargs: - kwargs["function_arn"] = "" - if "creation_time" not in kwargs: - kwargs["creation_time"] = "" - if "last_modified_time" not in kwargs: - kwargs["last_modified_time"] = "" - if "auth_type" not in kwargs: - kwargs["auth_type"] = FunctionUrlAuthType._corrected("") - return kwargs - - -def _serialize_function_url_config_list( - serializer: ShapeSerializer, schema: Schema, value: list[FunctionUrlConfig] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_function_url_config_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[FunctionUrlConfig]: - result: list[FunctionUrlConfig] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(FunctionUrlConfig.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListFunctionUrlConfigsOutput: - """Dataclass for ListFunctionUrlConfigsOutput structure.""" - - function_url_configs: list[FunctionUrlConfig] - """A list of function URL configurations.""" - - next_marker: str | None = None - """The pagination token that's included if more results are available.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_FUNCTION_URL_CONFIGS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_function_url_config_list( - serializer, - _SCHEMA_LIST_FUNCTION_URL_CONFIGS_OUTPUT.members["FunctionUrlConfigs"], - self.function_url_configs, - ) - if self.next_marker is not None: - serializer.write_string( - _SCHEMA_LIST_FUNCTION_URL_CONFIGS_OUTPUT.members["NextMarker"], - self.next_marker, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_url_configs"] = ( - _deserialize_function_url_config_list( - de, - _SCHEMA_LIST_FUNCTION_URL_CONFIGS_OUTPUT.members[ - "FunctionUrlConfigs" - ], - ) - ) - - case 1: - kwargs["next_marker"] = de.read_string( - _SCHEMA_LIST_FUNCTION_URL_CONFIGS_OUTPUT.members["NextMarker"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_FUNCTION_URL_CONFIGS_OUTPUT, consumer=_consumer - ) - if "function_url_configs" not in kwargs: - kwargs["function_url_configs"] = [] - return kwargs - - -LIST_FUNCTION_URL_CONFIGS = APIOperation( - input=ListFunctionUrlConfigsInput, - output=ListFunctionUrlConfigsOutput, - schema=_SCHEMA_LIST_FUNCTION_URL_CONFIGS, - input_schema=_SCHEMA_LIST_FUNCTION_URL_CONFIGS_INPUT, - output_schema=_SCHEMA_LIST_FUNCTION_URL_CONFIGS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListProvisionedConcurrencyConfigsInput: - """Dataclass for ListProvisionedConcurrencyConfigsInput structure.""" - - function_name: str | None = None - """ - The name or ARN of the Lambda function. - - **Name formats** - - - **Function name** -- `my-function`. - - - **Function ARN** -- - `arn:aws:lambda:us-west-2:123456789012:function:my-function`. - - - **Partial ARN** -- `123456789012:function:my-function`. - - The length constraint applies only to the full ARN. If you specify only - the function name, it is limited to 64 characters in length. - """ - - marker: str | None = None - """ - Specify the pagination token that's returned by a previous request to - retrieve the next page of results. - """ - - max_items: int | None = None - """Specify a number to limit the number of configurations returned.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_LIST_PROVISIONED_CONCURRENCY_CONFIGS_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_LIST_PROVISIONED_CONCURRENCY_CONFIGS_INPUT.members[ - "FunctionName" - ], - self.function_name, - ) - - if self.marker is not None: - serializer.write_string( - _SCHEMA_LIST_PROVISIONED_CONCURRENCY_CONFIGS_INPUT.members["Marker"], - self.marker, - ) - - if self.max_items is not None: - serializer.write_integer( - _SCHEMA_LIST_PROVISIONED_CONCURRENCY_CONFIGS_INPUT.members["MaxItems"], - self.max_items, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_LIST_PROVISIONED_CONCURRENCY_CONFIGS_INPUT.members[ - "FunctionName" - ] - ) - - case 1: - kwargs["marker"] = de.read_string( - _SCHEMA_LIST_PROVISIONED_CONCURRENCY_CONFIGS_INPUT.members[ - "Marker" - ] - ) - - case 2: - kwargs["max_items"] = de.read_integer( - _SCHEMA_LIST_PROVISIONED_CONCURRENCY_CONFIGS_INPUT.members[ - "MaxItems" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_PROVISIONED_CONCURRENCY_CONFIGS_INPUT, consumer=_consumer - ) - return kwargs - - -class ProvisionedConcurrencyStatusEnum(UnknownEnumMixin, StrEnum): - IN_PROGRESS = "IN_PROGRESS" - READY = "READY" - FAILED = "FAILED" - - -@dataclass(kw_only=True) -class ProvisionedConcurrencyConfigListItem: - """ - Details about the provisioned concurrency configuration for a function - alias or version. - """ - - function_arn: str | None = None - """The Amazon Resource Name (ARN) of the alias or version.""" - - requested_provisioned_concurrent_executions: int | None = None - """The amount of provisioned concurrency requested.""" - - available_provisioned_concurrent_executions: int | None = None - """The amount of provisioned concurrency available.""" - - allocated_provisioned_concurrent_executions: int | None = None - """ - The amount of provisioned concurrency allocated. When a weighted alias - is used during linear and canary deployments, this value fluctuates - depending on the amount of concurrency that is provisioned for the - function versions. - """ - - status: str | None = None - """The status of the allocation process.""" - - status_reason: str | None = None - """ - For failed allocations, the reason that provisioned concurrency could - not be allocated. - """ - - last_modified: str | None = None - """ - The date and time that a user last updated the configuration, in [ISO - 8601 format](https://www.iso.org/iso-8601-date-and-time-format.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PROVISIONED_CONCURRENCY_CONFIG_LIST_ITEM, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_arn is not None: - serializer.write_string( - _SCHEMA_PROVISIONED_CONCURRENCY_CONFIG_LIST_ITEM.members["FunctionArn"], - self.function_arn, - ) - - if self.requested_provisioned_concurrent_executions is not None: - serializer.write_integer( - _SCHEMA_PROVISIONED_CONCURRENCY_CONFIG_LIST_ITEM.members[ - "RequestedProvisionedConcurrentExecutions" - ], - self.requested_provisioned_concurrent_executions, - ) - - if self.available_provisioned_concurrent_executions is not None: - serializer.write_integer( - _SCHEMA_PROVISIONED_CONCURRENCY_CONFIG_LIST_ITEM.members[ - "AvailableProvisionedConcurrentExecutions" - ], - self.available_provisioned_concurrent_executions, - ) - - if self.allocated_provisioned_concurrent_executions is not None: - serializer.write_integer( - _SCHEMA_PROVISIONED_CONCURRENCY_CONFIG_LIST_ITEM.members[ - "AllocatedProvisionedConcurrentExecutions" - ], - self.allocated_provisioned_concurrent_executions, - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_PROVISIONED_CONCURRENCY_CONFIG_LIST_ITEM.members["Status"], - self.status, - ) - - if self.status_reason is not None: - serializer.write_string( - _SCHEMA_PROVISIONED_CONCURRENCY_CONFIG_LIST_ITEM.members[ - "StatusReason" - ], - self.status_reason, - ) - - if self.last_modified is not None: - serializer.write_string( - _SCHEMA_PROVISIONED_CONCURRENCY_CONFIG_LIST_ITEM.members[ - "LastModified" - ], - self.last_modified, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_arn"] = de.read_string( - _SCHEMA_PROVISIONED_CONCURRENCY_CONFIG_LIST_ITEM.members[ - "FunctionArn" - ] - ) - - case 1: - kwargs["requested_provisioned_concurrent_executions"] = ( - de.read_integer( - _SCHEMA_PROVISIONED_CONCURRENCY_CONFIG_LIST_ITEM.members[ - "RequestedProvisionedConcurrentExecutions" - ] - ) - ) - - case 2: - kwargs["available_provisioned_concurrent_executions"] = ( - de.read_integer( - _SCHEMA_PROVISIONED_CONCURRENCY_CONFIG_LIST_ITEM.members[ - "AvailableProvisionedConcurrentExecutions" - ] - ) - ) - - case 3: - kwargs["allocated_provisioned_concurrent_executions"] = ( - de.read_integer( - _SCHEMA_PROVISIONED_CONCURRENCY_CONFIG_LIST_ITEM.members[ - "AllocatedProvisionedConcurrentExecutions" - ] - ) - ) - - case 4: - kwargs["status"] = ProvisionedConcurrencyStatusEnum( - de.read_string( - _SCHEMA_PROVISIONED_CONCURRENCY_CONFIG_LIST_ITEM.members[ - "Status" - ] - ) - ) - - case 5: - kwargs["status_reason"] = de.read_string( - _SCHEMA_PROVISIONED_CONCURRENCY_CONFIG_LIST_ITEM.members[ - "StatusReason" - ] - ) - - case 6: - kwargs["last_modified"] = de.read_string( - _SCHEMA_PROVISIONED_CONCURRENCY_CONFIG_LIST_ITEM.members[ - "LastModified" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PROVISIONED_CONCURRENCY_CONFIG_LIST_ITEM, consumer=_consumer - ) - return kwargs - - -def _serialize_provisioned_concurrency_config_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[ProvisionedConcurrencyConfigListItem], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_provisioned_concurrency_config_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ProvisionedConcurrencyConfigListItem]: - result: list[ProvisionedConcurrencyConfigListItem] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ProvisionedConcurrencyConfigListItem.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListProvisionedConcurrencyConfigsOutput: - """Dataclass for ListProvisionedConcurrencyConfigsOutput structure.""" - - provisioned_concurrency_configs: ( - list[ProvisionedConcurrencyConfigListItem] | None - ) = None - """A list of provisioned concurrency configurations.""" - - next_marker: str | None = None - """The pagination token that's included if more results are available.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_LIST_PROVISIONED_CONCURRENCY_CONFIGS_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.provisioned_concurrency_configs is not None: - _serialize_provisioned_concurrency_config_list( - serializer, - _SCHEMA_LIST_PROVISIONED_CONCURRENCY_CONFIGS_OUTPUT.members[ - "ProvisionedConcurrencyConfigs" - ], - self.provisioned_concurrency_configs, - ) - - if self.next_marker is not None: - serializer.write_string( - _SCHEMA_LIST_PROVISIONED_CONCURRENCY_CONFIGS_OUTPUT.members[ - "NextMarker" - ], - self.next_marker, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["provisioned_concurrency_configs"] = ( - _deserialize_provisioned_concurrency_config_list( - de, - _SCHEMA_LIST_PROVISIONED_CONCURRENCY_CONFIGS_OUTPUT.members[ - "ProvisionedConcurrencyConfigs" - ], - ) - ) - - case 1: - kwargs["next_marker"] = de.read_string( - _SCHEMA_LIST_PROVISIONED_CONCURRENCY_CONFIGS_OUTPUT.members[ - "NextMarker" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_PROVISIONED_CONCURRENCY_CONFIGS_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_PROVISIONED_CONCURRENCY_CONFIGS = APIOperation( - input=ListProvisionedConcurrencyConfigsInput, - output=ListProvisionedConcurrencyConfigsOutput, - schema=_SCHEMA_LIST_PROVISIONED_CONCURRENCY_CONFIGS, - input_schema=_SCHEMA_LIST_PROVISIONED_CONCURRENCY_CONFIGS_INPUT, - output_schema=_SCHEMA_LIST_PROVISIONED_CONCURRENCY_CONFIGS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class PutFunctionCodeSigningConfigInput: - """Dataclass for PutFunctionCodeSigningConfigInput structure.""" - - code_signing_config_arn: str | None = None - """The The Amazon Resource Name (ARN) of the code signing configuration.""" - - function_name: str | None = None - """ - The name or ARN of the Lambda function. - - **Name formats** - - - **Function name** - `MyFunction`. - - - **Function ARN** - - `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`. - - - **Partial ARN** - `123456789012:function:MyFunction`. - - The length constraint applies only to the full ARN. If you specify only - the function name, it is limited to 64 characters in length. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_FUNCTION_CODE_SIGNING_CONFIG_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.code_signing_config_arn is not None: - serializer.write_string( - _SCHEMA_PUT_FUNCTION_CODE_SIGNING_CONFIG_INPUT.members[ - "CodeSigningConfigArn" - ], - self.code_signing_config_arn, - ) - - if self.function_name is not None: - serializer.write_string( - _SCHEMA_PUT_FUNCTION_CODE_SIGNING_CONFIG_INPUT.members["FunctionName"], - self.function_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["code_signing_config_arn"] = de.read_string( - _SCHEMA_PUT_FUNCTION_CODE_SIGNING_CONFIG_INPUT.members[ - "CodeSigningConfigArn" - ] - ) - - case 1: - kwargs["function_name"] = de.read_string( - _SCHEMA_PUT_FUNCTION_CODE_SIGNING_CONFIG_INPUT.members[ - "FunctionName" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PUT_FUNCTION_CODE_SIGNING_CONFIG_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class PutFunctionCodeSigningConfigOutput: - """Dataclass for PutFunctionCodeSigningConfigOutput structure.""" - - code_signing_config_arn: str - """The The Amazon Resource Name (ARN) of the code signing configuration.""" - - function_name: str - """ - The name or ARN of the Lambda function. - - **Name formats** - - - **Function name** - `MyFunction`. - - - **Function ARN** - - `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`. - - - **Partial ARN** - `123456789012:function:MyFunction`. - - The length constraint applies only to the full ARN. If you specify only - the function name, it is limited to 64 characters in length. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_FUNCTION_CODE_SIGNING_CONFIG_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_PUT_FUNCTION_CODE_SIGNING_CONFIG_OUTPUT.members[ - "CodeSigningConfigArn" - ], - self.code_signing_config_arn, - ) - serializer.write_string( - _SCHEMA_PUT_FUNCTION_CODE_SIGNING_CONFIG_OUTPUT.members["FunctionName"], - self.function_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["code_signing_config_arn"] = de.read_string( - _SCHEMA_PUT_FUNCTION_CODE_SIGNING_CONFIG_OUTPUT.members[ - "CodeSigningConfigArn" - ] - ) - - case 1: - kwargs["function_name"] = de.read_string( - _SCHEMA_PUT_FUNCTION_CODE_SIGNING_CONFIG_OUTPUT.members[ - "FunctionName" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PUT_FUNCTION_CODE_SIGNING_CONFIG_OUTPUT, consumer=_consumer - ) - if "code_signing_config_arn" not in kwargs: - kwargs["code_signing_config_arn"] = "" - if "function_name" not in kwargs: - kwargs["function_name"] = "" - return kwargs - - -PUT_FUNCTION_CODE_SIGNING_CONFIG = APIOperation( - input=PutFunctionCodeSigningConfigInput, - output=PutFunctionCodeSigningConfigOutput, - schema=_SCHEMA_PUT_FUNCTION_CODE_SIGNING_CONFIG, - input_schema=_SCHEMA_PUT_FUNCTION_CODE_SIGNING_CONFIG_INPUT, - output_schema=_SCHEMA_PUT_FUNCTION_CODE_SIGNING_CONFIG_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#CodeSigningConfigNotFoundException" - ): CodeSigningConfigNotFoundException, - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceConflictException" - ): ResourceConflictException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CODE_SIGNING_CONFIG_NOT_FOUND_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class PutFunctionConcurrencyInput: - """Dataclass for PutFunctionConcurrencyInput structure.""" - - function_name: str | None = None - """ - The name or ARN of the Lambda function. - - **Name formats** - - - **Function name** -- `my-function`. - - - **Function ARN** -- - `arn:aws:lambda:us-west-2:123456789012:function:my-function`. - - - **Partial ARN** -- `123456789012:function:my-function`. - - The length constraint applies only to the full ARN. If you specify only - the function name, it is limited to 64 characters in length. - """ - - reserved_concurrent_executions: int | None = None - """The number of simultaneous executions to reserve for the function.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_FUNCTION_CONCURRENCY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_PUT_FUNCTION_CONCURRENCY_INPUT.members["FunctionName"], - self.function_name, - ) - - if self.reserved_concurrent_executions is not None: - serializer.write_integer( - _SCHEMA_PUT_FUNCTION_CONCURRENCY_INPUT.members[ - "ReservedConcurrentExecutions" - ], - self.reserved_concurrent_executions, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_PUT_FUNCTION_CONCURRENCY_INPUT.members["FunctionName"] - ) - - case 1: - kwargs["reserved_concurrent_executions"] = de.read_integer( - _SCHEMA_PUT_FUNCTION_CONCURRENCY_INPUT.members[ - "ReservedConcurrentExecutions" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PUT_FUNCTION_CONCURRENCY_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class PutFunctionConcurrencyOutput: - """Dataclass for PutFunctionConcurrencyOutput structure.""" - - reserved_concurrent_executions: int | None = None - """ - The number of concurrent executions that are reserved for this function. - For more information, see [Managing Lambda reserved - concurrency](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html). - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_FUNCTION_CONCURRENCY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.reserved_concurrent_executions is not None: - serializer.write_integer( - _SCHEMA_PUT_FUNCTION_CONCURRENCY_OUTPUT.members[ - "ReservedConcurrentExecutions" - ], - self.reserved_concurrent_executions, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["reserved_concurrent_executions"] = de.read_integer( - _SCHEMA_PUT_FUNCTION_CONCURRENCY_OUTPUT.members[ - "ReservedConcurrentExecutions" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PUT_FUNCTION_CONCURRENCY_OUTPUT, consumer=_consumer - ) - return kwargs - - -PUT_FUNCTION_CONCURRENCY = APIOperation( - input=PutFunctionConcurrencyInput, - output=PutFunctionConcurrencyOutput, - schema=_SCHEMA_PUT_FUNCTION_CONCURRENCY, - input_schema=_SCHEMA_PUT_FUNCTION_CONCURRENCY_INPUT, - output_schema=_SCHEMA_PUT_FUNCTION_CONCURRENCY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceConflictException" - ): ResourceConflictException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class PutFunctionRecursionConfigInput: - """Dataclass for PutFunctionRecursionConfigInput structure.""" - - function_name: str | None = None - """ - The name or ARN of the Lambda function. - - **Name formats** - - - **Function name** -- `my-function`. - - - **Function ARN** -- - `arn:aws:lambda:us-west-2:123456789012:function:my-function`. - - - **Partial ARN** -- `123456789012:function:my-function`. - - The length constraint applies only to the full ARN. If you specify only - the function name, it is limited to 64 characters in length. - """ - - recursive_loop: str | None = None - """ - If you set your function's recursive loop detection configuration to - `Allow`, Lambda doesn't take any action when it detects your function - being invoked as part of a recursive loop. We recommend that you only - use this setting if your design intentionally uses a Lambda function to - write data back to the same Amazon Web Services resource that invokes - it. - - If you set your function's recursive loop detection configuration to - `Terminate`, Lambda stops your function being invoked and notifies you - when it detects your function being invoked as part of a recursive loop. - - By default, Lambda sets your function's configuration to `Terminate`. - - Warning: - If your design intentionally uses a Lambda function to write data back - to the same Amazon Web Services resource that invokes the function, then - use caution and implement suitable guard rails to prevent unexpected - charges being billed to your Amazon Web Services account. To learn more - about best practices for using recursive invocation patterns, see - [Recursive patterns that cause run-away Lambda - functions](https://serverlessland.com/content/service/lambda/guides/aws-lambda-operator-guide/recursive-runaway) - in Serverless Land. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_FUNCTION_RECURSION_CONFIG_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_PUT_FUNCTION_RECURSION_CONFIG_INPUT.members["FunctionName"], - self.function_name, - ) - - if self.recursive_loop is not None: - serializer.write_string( - _SCHEMA_PUT_FUNCTION_RECURSION_CONFIG_INPUT.members["RecursiveLoop"], - self.recursive_loop, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_PUT_FUNCTION_RECURSION_CONFIG_INPUT.members[ - "FunctionName" - ] - ) - - case 1: - kwargs["recursive_loop"] = RecursiveLoop( - de.read_string( - _SCHEMA_PUT_FUNCTION_RECURSION_CONFIG_INPUT.members[ - "RecursiveLoop" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PUT_FUNCTION_RECURSION_CONFIG_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class PutFunctionRecursionConfigOutput: - """Dataclass for PutFunctionRecursionConfigOutput structure.""" - - recursive_loop: str | None = None - """ - The status of your function's recursive loop detection configuration. - - When this value is set to `Allow`and Lambda detects your function being - invoked as part of a recursive loop, it doesn't take any action. - - When this value is set to `Terminate` and Lambda detects your function - being invoked as part of a recursive loop, it stops your function being - invoked and notifies you. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_FUNCTION_RECURSION_CONFIG_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.recursive_loop is not None: - serializer.write_string( - _SCHEMA_PUT_FUNCTION_RECURSION_CONFIG_OUTPUT.members["RecursiveLoop"], - self.recursive_loop, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["recursive_loop"] = RecursiveLoop( - de.read_string( - _SCHEMA_PUT_FUNCTION_RECURSION_CONFIG_OUTPUT.members[ - "RecursiveLoop" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PUT_FUNCTION_RECURSION_CONFIG_OUTPUT, consumer=_consumer - ) - return kwargs - - -PUT_FUNCTION_RECURSION_CONFIG = APIOperation( - input=PutFunctionRecursionConfigInput, - output=PutFunctionRecursionConfigOutput, - schema=_SCHEMA_PUT_FUNCTION_RECURSION_CONFIG, - input_schema=_SCHEMA_PUT_FUNCTION_RECURSION_CONFIG_INPUT, - output_schema=_SCHEMA_PUT_FUNCTION_RECURSION_CONFIG_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceConflictException" - ): ResourceConflictException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class PutFunctionScalingConfigInput: - """Dataclass for PutFunctionScalingConfigInput structure.""" - - function_name: str | None = None - """The name or ARN of the Lambda function.""" - - qualifier: str | None = None - """ - Specify a version or alias to set the scaling configuration for a - published version of the function. - """ - - function_scaling_config: FunctionScalingConfig | None = None - """ - The scaling configuration to apply to the function, including minimum - and maximum execution environment limits. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_FUNCTION_SCALING_CONFIG_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_PUT_FUNCTION_SCALING_CONFIG_INPUT.members["FunctionName"], - self.function_name, - ) - - if self.qualifier is not None: - serializer.write_string( - _SCHEMA_PUT_FUNCTION_SCALING_CONFIG_INPUT.members["Qualifier"], - self.qualifier, - ) - - if self.function_scaling_config is not None: - serializer.write_struct( - _SCHEMA_PUT_FUNCTION_SCALING_CONFIG_INPUT.members[ - "FunctionScalingConfig" - ], - self.function_scaling_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_PUT_FUNCTION_SCALING_CONFIG_INPUT.members[ - "FunctionName" - ] - ) - - case 1: - kwargs["qualifier"] = de.read_string( - _SCHEMA_PUT_FUNCTION_SCALING_CONFIG_INPUT.members["Qualifier"] - ) - - case 2: - kwargs["function_scaling_config"] = ( - FunctionScalingConfig.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PUT_FUNCTION_SCALING_CONFIG_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class PutFunctionScalingConfigOutput: - """Dataclass for PutFunctionScalingConfigOutput structure.""" - - function_state: str | None = None - """ - The current state of the function after applying the scaling - configuration. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_FUNCTION_SCALING_CONFIG_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_state is not None: - serializer.write_string( - _SCHEMA_PUT_FUNCTION_SCALING_CONFIG_OUTPUT.members["FunctionState"], - self.function_state, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_state"] = State( - de.read_string( - _SCHEMA_PUT_FUNCTION_SCALING_CONFIG_OUTPUT.members[ - "FunctionState" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PUT_FUNCTION_SCALING_CONFIG_OUTPUT, consumer=_consumer - ) - return kwargs - - -PUT_FUNCTION_SCALING_CONFIG = APIOperation( - input=PutFunctionScalingConfigInput, - output=PutFunctionScalingConfigOutput, - schema=_SCHEMA_PUT_FUNCTION_SCALING_CONFIG, - input_schema=_SCHEMA_PUT_FUNCTION_SCALING_CONFIG_INPUT, - output_schema=_SCHEMA_PUT_FUNCTION_SCALING_CONFIG_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceConflictException" - ): ResourceConflictException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class PutRuntimeManagementConfigInput: - """Dataclass for PutRuntimeManagementConfigInput structure.""" - - function_name: str | None = None - """ - The name or ARN of the Lambda function. - - **Name formats** - - - **Function name** -- `my-function`. - - - **Function ARN** -- - `arn:aws:lambda:us-west-2:123456789012:function:my-function`. - - - **Partial ARN** -- `123456789012:function:my-function`. - - The length constraint applies only to the full ARN. If you specify only - the function name, it is limited to 64 characters in length. - """ - - qualifier: str | None = None - """ - Specify a version of the function. This can be `$LATEST` or a published - version number. If no value is specified, the configuration for the - `$LATEST` version is returned. - """ - - update_runtime_on: str | None = None - """ - Specify the runtime update mode. - - - **Auto (default)** - Automatically update to the most recent and - secure runtime version using a [Two-phase runtime version - rollout](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-update.html#runtime-management-two-phase). - This is the best choice for most customers to ensure they always - benefit from runtime updates. - - - **Function update** - Lambda updates the runtime of your function to - the most recent and secure runtime version when you update your - function. This approach synchronizes runtime updates with function - deployments, giving you control over when runtime updates are applied - and allowing you to detect and mitigate rare runtime update - incompatibilities early. When using this setting, you need to - regularly update your functions to keep their runtime up-to-date. - - - **Manual** - You specify a runtime version in your function - configuration. The function will use this runtime version - indefinitely. In the rare case where a new runtime version is - incompatible with an existing function, this allows you to roll back - your function to an earlier runtime version. For more information, see - [Roll back a runtime - version](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-update.html#runtime-management-rollback). - """ - - runtime_version_arn: str | None = None - """ - The ARN of the runtime version you want the function to use. - - Note: - This is only required if you're using the **Manual** runtime update - mode. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_RUNTIME_MANAGEMENT_CONFIG_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_PUT_RUNTIME_MANAGEMENT_CONFIG_INPUT.members["FunctionName"], - self.function_name, - ) - - if self.qualifier is not None: - serializer.write_string( - _SCHEMA_PUT_RUNTIME_MANAGEMENT_CONFIG_INPUT.members["Qualifier"], - self.qualifier, - ) - - if self.update_runtime_on is not None: - serializer.write_string( - _SCHEMA_PUT_RUNTIME_MANAGEMENT_CONFIG_INPUT.members["UpdateRuntimeOn"], - self.update_runtime_on, - ) - - if self.runtime_version_arn is not None: - serializer.write_string( - _SCHEMA_PUT_RUNTIME_MANAGEMENT_CONFIG_INPUT.members[ - "RuntimeVersionArn" - ], - self.runtime_version_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_PUT_RUNTIME_MANAGEMENT_CONFIG_INPUT.members[ - "FunctionName" - ] - ) - - case 1: - kwargs["qualifier"] = de.read_string( - _SCHEMA_PUT_RUNTIME_MANAGEMENT_CONFIG_INPUT.members["Qualifier"] - ) - - case 2: - kwargs["update_runtime_on"] = UpdateRuntimeOn( - de.read_string( - _SCHEMA_PUT_RUNTIME_MANAGEMENT_CONFIG_INPUT.members[ - "UpdateRuntimeOn" - ] - ) - ) - - case 3: - kwargs["runtime_version_arn"] = de.read_string( - _SCHEMA_PUT_RUNTIME_MANAGEMENT_CONFIG_INPUT.members[ - "RuntimeVersionArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PUT_RUNTIME_MANAGEMENT_CONFIG_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class PutRuntimeManagementConfigOutput: - """Dataclass for PutRuntimeManagementConfigOutput structure.""" - - update_runtime_on: str - """The runtime update mode.""" - - function_arn: str - """The ARN of the function""" - - runtime_version_arn: str | None = None - """ - The ARN of the runtime the function is configured to use. If the runtime - update mode is **manual**, the ARN is returned, otherwise `null` is - returned. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_RUNTIME_MANAGEMENT_CONFIG_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_PUT_RUNTIME_MANAGEMENT_CONFIG_OUTPUT.members["UpdateRuntimeOn"], - self.update_runtime_on, - ) - serializer.write_string( - _SCHEMA_PUT_RUNTIME_MANAGEMENT_CONFIG_OUTPUT.members["FunctionArn"], - self.function_arn, - ) - if self.runtime_version_arn is not None: - serializer.write_string( - _SCHEMA_PUT_RUNTIME_MANAGEMENT_CONFIG_OUTPUT.members[ - "RuntimeVersionArn" - ], - self.runtime_version_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["update_runtime_on"] = UpdateRuntimeOn( - de.read_string( - _SCHEMA_PUT_RUNTIME_MANAGEMENT_CONFIG_OUTPUT.members[ - "UpdateRuntimeOn" - ] - ) - ) - - case 1: - kwargs["function_arn"] = de.read_string( - _SCHEMA_PUT_RUNTIME_MANAGEMENT_CONFIG_OUTPUT.members[ - "FunctionArn" - ] - ) - - case 2: - kwargs["runtime_version_arn"] = de.read_string( - _SCHEMA_PUT_RUNTIME_MANAGEMENT_CONFIG_OUTPUT.members[ - "RuntimeVersionArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PUT_RUNTIME_MANAGEMENT_CONFIG_OUTPUT, consumer=_consumer - ) - if "update_runtime_on" not in kwargs: - kwargs["update_runtime_on"] = UpdateRuntimeOn._corrected("") - if "function_arn" not in kwargs: - kwargs["function_arn"] = "" - return kwargs - - -PUT_RUNTIME_MANAGEMENT_CONFIG = APIOperation( - input=PutRuntimeManagementConfigInput, - output=PutRuntimeManagementConfigOutput, - schema=_SCHEMA_PUT_RUNTIME_MANAGEMENT_CONFIG, - input_schema=_SCHEMA_PUT_RUNTIME_MANAGEMENT_CONFIG_INPUT, - output_schema=_SCHEMA_PUT_RUNTIME_MANAGEMENT_CONFIG_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceConflictException" - ): ResourceConflictException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateFunctionCodeInput: - """Dataclass for UpdateFunctionCodeInput structure.""" - - function_name: str | None = None - """ - The name or ARN of the Lambda function. - - **Name formats** - - - **Function name** -- `my-function`. - - - **Function ARN** -- - `arn:aws:lambda:us-west-2:123456789012:function:my-function`. - - - **Partial ARN** -- `123456789012:function:my-function`. - - The length constraint applies only to the full ARN. If you specify only - the function name, it is limited to 64 characters in length. - """ - - zip_file: bytes | None = field(repr=False, default=None) - """ - The base64-encoded contents of the deployment package. Amazon Web - Services SDK and CLI clients handle the encoding for you. Use only with - a function defined with a .zip file archive deployment package. - """ - - s3_bucket: str | None = None - """ - An Amazon S3 bucket in the same Amazon Web Services Region as your - function. The bucket can be in a different Amazon Web Services account. - Use only with a function defined with a .zip file archive deployment - package. - """ - - s3_key: str | None = None - """ - The Amazon S3 key of the deployment package. Use only with a function - defined with a .zip file archive deployment package. - """ - - s3_object_version: str | None = None - """ - For versioned objects, the version of the deployment package object to - use. - """ - - s3_object_storage_mode: str | None = None - """ - Specifies how the deployment package is stored. Valid values: - - - `COPY` (default) -- Uploads a copy of your deployment package to - Lambda. - - - `REFERENCE` -- Lambda references the deployment package from the - specified Amazon S3 bucket. - """ - - image_uri: str | None = None - """ - URI of a container image in the Amazon ECR registry. Do not use for a - function defined with a .zip file archive. - """ - - architectures: list[str] | None = None - """ - The instruction set architecture that the function supports. Enter a - string array with one of the valid values (arm64 or x86_64). The default - value is `x86_64`. - """ - - publish: bool = False - """ - Set to true to publish a new version of the function after updating the - code. This has the same effect as calling PublishVersion separately. - """ - - publish_to: str | None = None - """Specifies where to publish the function version or configuration.""" - - dry_run: bool = False - """ - Set to true to validate the request parameters and access permissions - without modifying the function code. - """ - - revision_id: str | None = None - """ - Update the function only if the revision ID matches the ID that's - specified. Use this option to avoid modifying a function that has - changed since you last read it. - """ - - source_kms_key_arn: str | None = None - """ - The ARN of the Key Management Service (KMS) customer managed key that's - used to encrypt your function's .zip deployment package. If you don't - provide a customer managed key, Lambda uses an Amazon Web Services - managed key. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_FUNCTION_CODE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CODE_INPUT.members["FunctionName"], - self.function_name, - ) - - if self.zip_file is not None: - serializer.write_blob( - _SCHEMA_UPDATE_FUNCTION_CODE_INPUT.members["ZipFile"], self.zip_file - ) - - if self.s3_bucket is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CODE_INPUT.members["S3Bucket"], self.s3_bucket - ) - - if self.s3_key is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CODE_INPUT.members["S3Key"], self.s3_key - ) - - if self.s3_object_version is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CODE_INPUT.members["S3ObjectVersion"], - self.s3_object_version, - ) - - if self.s3_object_storage_mode is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CODE_INPUT.members["S3ObjectStorageMode"], - self.s3_object_storage_mode, - ) - - if self.image_uri is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CODE_INPUT.members["ImageUri"], self.image_uri - ) - - if self.architectures is not None: - _serialize_architectures_list( - serializer, - _SCHEMA_UPDATE_FUNCTION_CODE_INPUT.members["Architectures"], - self.architectures, - ) - - if self.publish is not None: - serializer.write_boolean( - _SCHEMA_UPDATE_FUNCTION_CODE_INPUT.members["Publish"], self.publish - ) - - if self.publish_to is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CODE_INPUT.members["PublishTo"], self.publish_to - ) - - if self.dry_run is not None: - serializer.write_boolean( - _SCHEMA_UPDATE_FUNCTION_CODE_INPUT.members["DryRun"], self.dry_run - ) - - if self.revision_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CODE_INPUT.members["RevisionId"], - self.revision_id, - ) - - if self.source_kms_key_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CODE_INPUT.members["SourceKMSKeyArn"], - self.source_kms_key_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_CODE_INPUT.members["FunctionName"] - ) - - case 1: - kwargs["zip_file"] = de.read_blob( - _SCHEMA_UPDATE_FUNCTION_CODE_INPUT.members["ZipFile"] - ) - - case 2: - kwargs["s3_bucket"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_CODE_INPUT.members["S3Bucket"] - ) - - case 3: - kwargs["s3_key"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_CODE_INPUT.members["S3Key"] - ) - - case 4: - kwargs["s3_object_version"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_CODE_INPUT.members["S3ObjectVersion"] - ) - - case 5: - kwargs["s3_object_storage_mode"] = S3ObjectStorageMode( - de.read_string( - _SCHEMA_UPDATE_FUNCTION_CODE_INPUT.members[ - "S3ObjectStorageMode" - ] - ) - ) - - case 6: - kwargs["image_uri"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_CODE_INPUT.members["ImageUri"] - ) - - case 7: - kwargs["architectures"] = _deserialize_architectures_list( - de, _SCHEMA_UPDATE_FUNCTION_CODE_INPUT.members["Architectures"] - ) - - case 8: - kwargs["publish"] = de.read_boolean( - _SCHEMA_UPDATE_FUNCTION_CODE_INPUT.members["Publish"] - ) - - case 9: - kwargs["publish_to"] = FunctionVersionLatestPublished( - de.read_string( - _SCHEMA_UPDATE_FUNCTION_CODE_INPUT.members["PublishTo"] - ) - ) - - case 10: - kwargs["dry_run"] = de.read_boolean( - _SCHEMA_UPDATE_FUNCTION_CODE_INPUT.members["DryRun"] - ) - - case 11: - kwargs["revision_id"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_CODE_INPUT.members["RevisionId"] - ) - - case 12: - kwargs["source_kms_key_arn"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_CODE_INPUT.members["SourceKMSKeyArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_FUNCTION_CODE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateFunctionCodeOutput: - """Details about a function's configuration.""" - - function_name: str | None = None - """The name of the function.""" - - function_arn: str | None = None - """The function's Amazon Resource Name (ARN).""" - - runtime: str | None = None - """ - The identifier of the function's - [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html). - Runtime is required if the deployment package is a .zip file archive. - Specifying a runtime results in an error if you're deploying a function - using a container image. - - The following list includes deprecated runtimes. Lambda blocks creating - new functions and updating existing functions shortly after each runtime - is deprecated. For more information, see [Runtime use after - deprecation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-deprecation-levels). - - For a list of all currently supported runtimes, see [Supported - runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtimes-supported). - """ - - role: str | None = None - """The function's execution role.""" - - handler: str | None = None - """The function that Lambda calls to begin running your function.""" - - code_size: int = 0 - """The size of the function's deployment package, in bytes.""" - - description: str | None = None - """The function's description.""" - - timeout: int | None = None - """ - The amount of time in seconds that Lambda allows a function to run - before stopping it. - """ - - memory_size: int | None = None - """The amount of memory available to the function at runtime.""" - - last_modified: str | None = None - """ - The date and time that the function was last updated, in [ISO-8601 - format](https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). - """ - - code_sha256: str | None = None - """The SHA256 hash of the function's deployment package.""" - - version: str | None = None - """The version of the Lambda function.""" - - vpc_config: VpcConfigResponse | None = None - """The function's networking configuration.""" - - dead_letter_config: DeadLetterConfig | None = None - """The function's dead letter queue.""" - - environment: EnvironmentResponse | None = None - """ - The function's [environment - variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html). - Omitted from CloudTrail logs. - """ - - kms_key_arn: str | None = None - """ - The ARN of the Key Management Service (KMS) customer managed key that's - used to encrypt the following resources: - - - The function's [environment - variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-encryption). - - - The function's [Lambda - SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart-security.html) - snapshots. - - - When used with `SourceKMSKeyArn`, the unzipped version of the .zip - deployment package that's used for function invocations. For more - information, see [Specifying a customer managed key for - Lambda](https://docs.aws.amazon.com/lambda/latest/dg/encrypt-zip-package.html#enable-zip-custom-encryption). - - - The optimized version of the container image that's used for function - invocations. Note that this is not the same key that's used to - protect your container image in the Amazon Elastic Container Registry - (Amazon ECR). For more information, see [Function - lifecycle](https://docs.aws.amazon.com/lambda/latest/dg/images-create.html#images-lifecycle). - - If you don't provide a customer managed key, Lambda uses an [Amazon Web - Services owned - key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk) - or an [Amazon Web Services managed - key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk). - """ - - tracing_config: TracingConfigResponse | None = None - """The function's X-Ray tracing configuration.""" - - master_arn: str | None = None - """For Lambda@Edge functions, the ARN of the main function.""" - - revision_id: str | None = None - """The latest updated revision of the function or alias.""" - - layers: list[Layer] | None = None - """ - The function's - [layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html). - """ - - state: str | None = None - """ - The current state of the function. When the state is `Inactive`, you can - reactivate the function by invoking it. - """ - - state_reason: str | None = None - """The reason for the function's current state.""" - - state_reason_code: str | None = None - """ - The reason code for the function's current state. When the code is - `Creating`, you can't invoke or modify the function. - """ - - last_update_status: str | None = None - """ - The status of the last update that was performed on the function. This - is first set to `Successful` after function creation completes. - """ - - last_update_status_reason: str | None = None - """The reason for the last update that was performed on the function.""" - - last_update_status_reason_code: str | None = None - """The reason code for the last update that was performed on the function.""" - - file_system_configs: list[FileSystemConfig] | None = None - """ - Connection settings for an [Amazon EFS file - system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html) - or an [Amazon S3 file - system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html). - """ - - signing_profile_version_arn: str | None = None - """The ARN of the signing profile version.""" - - signing_job_arn: str | None = None - """The ARN of the signing job.""" - - package_type: str | None = None - """ - The type of deployment package. Set to `Image` for container image and - set `Zip` for .zip file archive. - """ - - image_config_response: ImageConfigResponse | None = None - """The function's image configuration values.""" - - architectures: list[str] | None = None - """ - The instruction set architecture that the function supports. - Architecture is a string array with one of the valid values. The default - architecture value is `x86_64`. - """ - - ephemeral_storage: EphemeralStorage | None = None - """ - The size of the function's `/tmp` directory in MB. The default value is - 512, but can be any whole number between 512 and 10,240 MB. For more - information, see [Configuring ephemeral storage - (console)](https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-ephemeral-storage). - """ - - snap_start: SnapStartResponse | None = None - """ - Set `ApplyOn` to `PublishedVersions` to create a snapshot of the - initialized execution environment when you publish a function version. - For more information, see [Improving startup performance with Lambda - SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html). - """ - - runtime_version_config: RuntimeVersionConfig | None = None - """The ARN of the runtime and any errors that occured.""" - - logging_config: LoggingConfig | None = None - """The function's Amazon CloudWatch Logs configuration settings.""" - - tenancy_config: TenancyConfig | None = None - """ - The function's tenant isolation configuration settings. Determines - whether the Lambda function runs on a shared or dedicated infrastructure - per unique tenant. - """ - - capacity_provider_config: CapacityProviderConfig | None = None - """ - Configuration for the capacity provider that manages compute resources - for Lambda functions. - """ - - config_sha256: str | None = None - """The SHA256 hash of the function configuration.""" - - durable_config: DurableConfig | None = None - """ - The function's durable execution configuration settings, if the - function is configured for durability. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["FunctionName"], - self.function_name, - ) - - if self.function_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["FunctionArn"], - self.function_arn, - ) - - if self.runtime is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["Runtime"], self.runtime - ) - - if self.role is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["Role"], self.role - ) - - if self.handler is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["Handler"], self.handler - ) - - serializer.write_long( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["CodeSize"], self.code_size - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["Description"], - self.description, - ) - - if self.timeout is not None: - serializer.write_integer( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["Timeout"], self.timeout - ) - - if self.memory_size is not None: - serializer.write_integer( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["MemorySize"], - self.memory_size, - ) - - if self.last_modified is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["LastModified"], - self.last_modified, - ) - - if self.code_sha256 is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["CodeSha256"], - self.code_sha256, - ) - - if self.version is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["Version"], self.version - ) - - if self.vpc_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["VpcConfig"], - self.vpc_config, - ) - - if self.dead_letter_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["DeadLetterConfig"], - self.dead_letter_config, - ) - - if self.environment is not None: - serializer.write_struct( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["Environment"], - self.environment, - ) - - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["KMSKeyArn"], - self.kms_key_arn, - ) - - if self.tracing_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["TracingConfig"], - self.tracing_config, - ) - - if self.master_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["MasterArn"], - self.master_arn, - ) - - if self.revision_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["RevisionId"], - self.revision_id, - ) - - if self.layers is not None: - _serialize_layers_reference_list( - serializer, - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["Layers"], - self.layers, - ) - - if self.state is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["State"], self.state - ) - - if self.state_reason is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["StateReason"], - self.state_reason, - ) - - if self.state_reason_code is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["StateReasonCode"], - self.state_reason_code, - ) - - if self.last_update_status is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["LastUpdateStatus"], - self.last_update_status, - ) - - if self.last_update_status_reason is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["LastUpdateStatusReason"], - self.last_update_status_reason, - ) - - if self.last_update_status_reason_code is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members[ - "LastUpdateStatusReasonCode" - ], - self.last_update_status_reason_code, - ) - - if self.file_system_configs is not None: - _serialize_file_system_config_list( - serializer, - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["FileSystemConfigs"], - self.file_system_configs, - ) - - if self.signing_profile_version_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["SigningProfileVersionArn"], - self.signing_profile_version_arn, - ) - - if self.signing_job_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["SigningJobArn"], - self.signing_job_arn, - ) - - if self.package_type is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["PackageType"], - self.package_type, - ) - - if self.image_config_response is not None: - serializer.write_struct( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["ImageConfigResponse"], - self.image_config_response, - ) - - if self.architectures is not None: - _serialize_architectures_list( - serializer, - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["Architectures"], - self.architectures, - ) - - if self.ephemeral_storage is not None: - serializer.write_struct( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["EphemeralStorage"], - self.ephemeral_storage, - ) - - if self.snap_start is not None: - serializer.write_struct( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["SnapStart"], - self.snap_start, - ) - - if self.runtime_version_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["RuntimeVersionConfig"], - self.runtime_version_config, - ) - - if self.logging_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["LoggingConfig"], - self.logging_config, - ) - - if self.tenancy_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["TenancyConfig"], - self.tenancy_config, - ) - - if self.capacity_provider_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["CapacityProviderConfig"], - self.capacity_provider_config, - ) - - if self.config_sha256 is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["ConfigSha256"], - self.config_sha256, - ) - - if self.durable_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["DurableConfig"], - self.durable_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["FunctionName"] - ) - - case 1: - kwargs["function_arn"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["FunctionArn"] - ) - - case 2: - kwargs["runtime"] = Runtime( - de.read_string( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["Runtime"] - ) - ) - - case 3: - kwargs["role"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["Role"] - ) - - case 4: - kwargs["handler"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["Handler"] - ) - - case 5: - kwargs["code_size"] = de.read_long( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["CodeSize"] - ) - - case 6: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["Description"] - ) - - case 7: - kwargs["timeout"] = de.read_integer( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["Timeout"] - ) - - case 8: - kwargs["memory_size"] = de.read_integer( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["MemorySize"] - ) - - case 9: - kwargs["last_modified"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["LastModified"] - ) - - case 10: - kwargs["code_sha256"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["CodeSha256"] - ) - - case 11: - kwargs["version"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["Version"] - ) - - case 12: - kwargs["vpc_config"] = VpcConfigResponse.deserialize(de) - - case 13: - kwargs["dead_letter_config"] = DeadLetterConfig.deserialize(de) - - case 14: - kwargs["environment"] = EnvironmentResponse.deserialize(de) - - case 15: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["KMSKeyArn"] - ) - - case 16: - kwargs["tracing_config"] = TracingConfigResponse.deserialize(de) - - case 17: - kwargs["master_arn"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["MasterArn"] - ) - - case 18: - kwargs["revision_id"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["RevisionId"] - ) - - case 19: - kwargs["layers"] = _deserialize_layers_reference_list( - de, _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["Layers"] - ) - - case 20: - kwargs["state"] = State( - de.read_string( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["State"] - ) - ) - - case 21: - kwargs["state_reason"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["StateReason"] - ) - - case 22: - kwargs["state_reason_code"] = StateReasonCode( - de.read_string( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members[ - "StateReasonCode" - ] - ) - ) - - case 23: - kwargs["last_update_status"] = LastUpdateStatus( - de.read_string( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members[ - "LastUpdateStatus" - ] - ) - ) - - case 24: - kwargs["last_update_status_reason"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members[ - "LastUpdateStatusReason" - ] - ) - - case 25: - kwargs["last_update_status_reason_code"] = ( - LastUpdateStatusReasonCode( - de.read_string( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members[ - "LastUpdateStatusReasonCode" - ] - ) - ) - ) - - case 26: - kwargs["file_system_configs"] = ( - _deserialize_file_system_config_list( - de, - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members[ - "FileSystemConfigs" - ], - ) - ) - - case 27: - kwargs["signing_profile_version_arn"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members[ - "SigningProfileVersionArn" - ] - ) - - case 28: - kwargs["signing_job_arn"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["SigningJobArn"] - ) - - case 29: - kwargs["package_type"] = PackageType( - de.read_string( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["PackageType"] - ) - ) - - case 30: - kwargs["image_config_response"] = ImageConfigResponse.deserialize( - de - ) - - case 31: - kwargs["architectures"] = _deserialize_architectures_list( - de, _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["Architectures"] - ) - - case 32: - kwargs["ephemeral_storage"] = EphemeralStorage.deserialize(de) - - case 33: - kwargs["snap_start"] = SnapStartResponse.deserialize(de) - - case 34: - kwargs["runtime_version_config"] = RuntimeVersionConfig.deserialize( - de - ) - - case 35: - kwargs["logging_config"] = LoggingConfig.deserialize(de) - - case 36: - kwargs["tenancy_config"] = TenancyConfig.deserialize(de) - - case 37: - kwargs["capacity_provider_config"] = ( - CapacityProviderConfig.deserialize(de) - ) - - case 38: - kwargs["config_sha256"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT.members["ConfigSha256"] - ) - - case 39: - kwargs["durable_config"] = DurableConfig.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT, consumer=_consumer - ) - return kwargs - - -UPDATE_FUNCTION_CODE = APIOperation( - input=UpdateFunctionCodeInput, - output=UpdateFunctionCodeOutput, - schema=_SCHEMA_UPDATE_FUNCTION_CODE, - input_schema=_SCHEMA_UPDATE_FUNCTION_CODE_INPUT, - output_schema=_SCHEMA_UPDATE_FUNCTION_CODE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#CodeSigningConfigNotFoundException" - ): CodeSigningConfigNotFoundException, - ShapeID( - "com.amazonaws.lambda#CodeStorageExceededException" - ): CodeStorageExceededException, - ShapeID( - "com.amazonaws.lambda#CodeVerificationFailedException" - ): CodeVerificationFailedException, - ShapeID( - "com.amazonaws.lambda#InvalidCodeSignatureException" - ): InvalidCodeSignatureException, - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#PreconditionFailedException" - ): PreconditionFailedException, - ShapeID( - "com.amazonaws.lambda#ResourceConflictException" - ): ResourceConflictException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CODE_SIGNING_CONFIG_NOT_FOUND_EXCEPTION, - _SCHEMA_CODE_STORAGE_EXCEEDED_EXCEPTION, - _SCHEMA_CODE_VERIFICATION_FAILED_EXCEPTION, - _SCHEMA_INVALID_CODE_SIGNATURE_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_PRECONDITION_FAILED_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateFunctionConfigurationInput: - """Dataclass for UpdateFunctionConfigurationInput structure.""" - - function_name: str | None = None - """ - The name or ARN of the Lambda function. - - **Name formats** - - - **Function name** -- `my-function`. - - - **Function ARN** -- - `arn:aws:lambda:us-west-2:123456789012:function:my-function`. - - - **Partial ARN** -- `123456789012:function:my-function`. - - The length constraint applies only to the full ARN. If you specify only - the function name, it is limited to 64 characters in length. - """ - - role: str | None = None - """The Amazon Resource Name (ARN) of the function's execution role.""" - - handler: str | None = None - """ - The name of the method within your code that Lambda calls to run your - function. Handler is required if the deployment package is a .zip file - archive. The format includes the file name. It can also include - namespaces and other qualifiers, depending on the runtime. For more - information, see [Lambda programming - model](https://docs.aws.amazon.com/lambda/latest/dg/foundation-progmodel.html). - """ - - description: str | None = None - """A description of the function.""" - - timeout: int | None = None - """ - The amount of time (in seconds) that Lambda allows a function to run - before stopping it. The default is 3 seconds, and the maximum allowed - value is 900 seconds. For functions using Lambda Managed Instances, - asynchronous invocations and event source mapping invocations (except - Amazon MQ and Amazon DocumentDB) support a maximum allowed value of - 5,400 seconds (90 minutes). For more information, see [Lambda execution - environment](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-context.html). - """ - - memory_size: int | None = None - """ - The amount of [memory available to the - function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-memory-console) - at runtime. Increasing the function memory also increases its CPU - allocation. The default value is 128 MB. The value can be any multiple - of 1 MB. - """ - - vpc_config: VpcConfig | None = None - """ - For network connectivity to Amazon Web Services resources in a VPC, - specify a list of security groups and subnets in the VPC. When you - connect a function to a VPC, it can access resources and the internet - only through that VPC. For more information, see [Configuring a Lambda - function to access resources in a - VPC](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html). - """ - - environment: Environment | None = None - """ - Environment variables that are accessible from function code during - execution. - """ - - runtime: str | None = None - """ - The identifier of the function's - [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html). - Runtime is required if the deployment package is a .zip file archive. - Specifying a runtime results in an error if you're deploying a function - using a container image. - - The following list includes deprecated runtimes. Lambda blocks creating - new functions and updating existing functions shortly after each runtime - is deprecated. For more information, see [Runtime use after - deprecation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-deprecation-levels). - - For a list of all currently supported runtimes, see [Supported - runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtimes-supported). - """ - - dead_letter_config: DeadLetterConfig | None = None - """ - A dead-letter queue configuration that specifies the queue or topic - where Lambda sends asynchronous events when they fail processing. For - more information, see [Dead-letter - queues](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-dlq). - """ - - kms_key_arn: str | None = None - """ - The ARN of the Key Management Service (KMS) customer managed key that's - used to encrypt the following resources: - - - The function's [environment - variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-encryption). - - - The function's [Lambda - SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart-security.html) - snapshots. - - - When used with `SourceKMSKeyArn`, the unzipped version of the .zip - deployment package that's used for function invocations. For more - information, see [Specifying a customer managed key for - Lambda](https://docs.aws.amazon.com/lambda/latest/dg/encrypt-zip-package.html#enable-zip-custom-encryption). - - - The optimized version of the container image that's used for function - invocations. Note that this is not the same key that's used to - protect your container image in the Amazon Elastic Container Registry - (Amazon ECR). For more information, see [Function - lifecycle](https://docs.aws.amazon.com/lambda/latest/dg/images-create.html#images-lifecycle). - - If you don't provide a customer managed key, Lambda uses an [Amazon Web - Services owned - key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk) - or an [Amazon Web Services managed - key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk). - """ - - tracing_config: TracingConfig | None = None - """ - Set `Mode` to `Active` to sample and trace a subset of incoming requests - with - [X-Ray](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html). - """ - - revision_id: str | None = None - """ - Update the function only if the revision ID matches the ID that's - specified. Use this option to avoid modifying a function that has - changed since you last read it. - """ - - layers: list[str] | None = None - """ - A list of [function - layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) - to add to the function's execution environment. Specify each layer by - its ARN, including the version. - """ - - file_system_configs: list[FileSystemConfig] | None = None - """ - Connection settings for an Amazon EFS file system or an Amazon S3 Files - file system. - """ - - image_config: ImageConfig | None = None - """ - [Container image configuration - values](https://docs.aws.amazon.com/lambda/latest/dg/images-create.html#images-parms) - that override the values in the container image Docker file. - """ - - ephemeral_storage: EphemeralStorage | None = None - """ - The size of the function's `/tmp` directory in MB. The default value is - 512, but can be any whole number between 512 and 10,240 MB. For more - information, see [Configuring ephemeral storage - (console)](https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-ephemeral-storage). - """ - - snap_start: SnapStart | None = None - """ - The function's - [SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html) - setting. - """ - - logging_config: LoggingConfig | None = None - """The function's Amazon CloudWatch Logs configuration settings.""" - - capacity_provider_config: CapacityProviderConfig | None = None - """ - Configuration for the capacity provider that manages compute resources - for Lambda functions. - """ - - durable_config: DurableConfig | None = None - """ - Configuration settings for [durable - functions](https://docs.aws.amazon.com/lambda/latest/dg/durable-functions.html), - including execution timeout, retention period for execution history, and - an optional ARN of the Key Management Service (KMS) customer managed key - that is used to encrypt your durable execution's payload data, - including input, output, and error payloads. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_FUNCTION_CONFIGURATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_INPUT.members["FunctionName"], - self.function_name, - ) - - if self.role is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_INPUT.members["Role"], self.role - ) - - if self.handler is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_INPUT.members["Handler"], - self.handler, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_INPUT.members["Description"], - self.description, - ) - - if self.timeout is not None: - serializer.write_integer( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_INPUT.members["Timeout"], - self.timeout, - ) - - if self.memory_size is not None: - serializer.write_integer( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_INPUT.members["MemorySize"], - self.memory_size, - ) - - if self.vpc_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_INPUT.members["VpcConfig"], - self.vpc_config, - ) - - if self.environment is not None: - serializer.write_struct( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_INPUT.members["Environment"], - self.environment, - ) - - if self.runtime is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_INPUT.members["Runtime"], - self.runtime, - ) - - if self.dead_letter_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_INPUT.members["DeadLetterConfig"], - self.dead_letter_config, - ) - - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_INPUT.members["KMSKeyArn"], - self.kms_key_arn, - ) - - if self.tracing_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_INPUT.members["TracingConfig"], - self.tracing_config, - ) - - if self.revision_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_INPUT.members["RevisionId"], - self.revision_id, - ) - - if self.layers is not None: - _serialize_layer_list( - serializer, - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_INPUT.members["Layers"], - self.layers, - ) - - if self.file_system_configs is not None: - _serialize_file_system_config_list( - serializer, - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_INPUT.members[ - "FileSystemConfigs" - ], - self.file_system_configs, - ) - - if self.image_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_INPUT.members["ImageConfig"], - self.image_config, - ) - - if self.ephemeral_storage is not None: - serializer.write_struct( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_INPUT.members["EphemeralStorage"], - self.ephemeral_storage, - ) - - if self.snap_start is not None: - serializer.write_struct( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_INPUT.members["SnapStart"], - self.snap_start, - ) - - if self.logging_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_INPUT.members["LoggingConfig"], - self.logging_config, - ) - - if self.capacity_provider_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_INPUT.members[ - "CapacityProviderConfig" - ], - self.capacity_provider_config, - ) - - if self.durable_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_INPUT.members["DurableConfig"], - self.durable_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_INPUT.members[ - "FunctionName" - ] - ) - - case 1: - kwargs["role"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_INPUT.members["Role"] - ) - - case 2: - kwargs["handler"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_INPUT.members["Handler"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_INPUT.members[ - "Description" - ] - ) - - case 4: - kwargs["timeout"] = de.read_integer( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_INPUT.members["Timeout"] - ) - - case 5: - kwargs["memory_size"] = de.read_integer( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_INPUT.members[ - "MemorySize" - ] - ) - - case 6: - kwargs["vpc_config"] = VpcConfig.deserialize(de) - - case 7: - kwargs["environment"] = Environment.deserialize(de) - - case 8: - kwargs["runtime"] = Runtime( - de.read_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_INPUT.members[ - "Runtime" - ] - ) - ) - - case 9: - kwargs["dead_letter_config"] = DeadLetterConfig.deserialize(de) - - case 10: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_INPUT.members["KMSKeyArn"] - ) - - case 11: - kwargs["tracing_config"] = TracingConfig.deserialize(de) - - case 12: - kwargs["revision_id"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_INPUT.members[ - "RevisionId" - ] - ) - - case 13: - kwargs["layers"] = _deserialize_layer_list( - de, - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_INPUT.members["Layers"], - ) - - case 14: - kwargs["file_system_configs"] = ( - _deserialize_file_system_config_list( - de, - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_INPUT.members[ - "FileSystemConfigs" - ], - ) - ) - - case 15: - kwargs["image_config"] = ImageConfig.deserialize(de) - - case 16: - kwargs["ephemeral_storage"] = EphemeralStorage.deserialize(de) - - case 17: - kwargs["snap_start"] = SnapStart.deserialize(de) - - case 18: - kwargs["logging_config"] = LoggingConfig.deserialize(de) - - case 19: - kwargs["capacity_provider_config"] = ( - CapacityProviderConfig.deserialize(de) - ) - - case 20: - kwargs["durable_config"] = DurableConfig.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateFunctionConfigurationOutput: - """Details about a function's configuration.""" - - function_name: str | None = None - """The name of the function.""" - - function_arn: str | None = None - """The function's Amazon Resource Name (ARN).""" - - runtime: str | None = None - """ - The identifier of the function's - [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html). - Runtime is required if the deployment package is a .zip file archive. - Specifying a runtime results in an error if you're deploying a function - using a container image. - - The following list includes deprecated runtimes. Lambda blocks creating - new functions and updating existing functions shortly after each runtime - is deprecated. For more information, see [Runtime use after - deprecation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-deprecation-levels). - - For a list of all currently supported runtimes, see [Supported - runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtimes-supported). - """ - - role: str | None = None - """The function's execution role.""" - - handler: str | None = None - """The function that Lambda calls to begin running your function.""" - - code_size: int = 0 - """The size of the function's deployment package, in bytes.""" - - description: str | None = None - """The function's description.""" - - timeout: int | None = None - """ - The amount of time in seconds that Lambda allows a function to run - before stopping it. - """ - - memory_size: int | None = None - """The amount of memory available to the function at runtime.""" - - last_modified: str | None = None - """ - The date and time that the function was last updated, in [ISO-8601 - format](https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). - """ - - code_sha256: str | None = None - """The SHA256 hash of the function's deployment package.""" - - version: str | None = None - """The version of the Lambda function.""" - - vpc_config: VpcConfigResponse | None = None - """The function's networking configuration.""" - - dead_letter_config: DeadLetterConfig | None = None - """The function's dead letter queue.""" - - environment: EnvironmentResponse | None = None - """ - The function's [environment - variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html). - Omitted from CloudTrail logs. - """ - - kms_key_arn: str | None = None - """ - The ARN of the Key Management Service (KMS) customer managed key that's - used to encrypt the following resources: - - - The function's [environment - variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-encryption). - - - The function's [Lambda - SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart-security.html) - snapshots. - - - When used with `SourceKMSKeyArn`, the unzipped version of the .zip - deployment package that's used for function invocations. For more - information, see [Specifying a customer managed key for - Lambda](https://docs.aws.amazon.com/lambda/latest/dg/encrypt-zip-package.html#enable-zip-custom-encryption). - - - The optimized version of the container image that's used for function - invocations. Note that this is not the same key that's used to - protect your container image in the Amazon Elastic Container Registry - (Amazon ECR). For more information, see [Function - lifecycle](https://docs.aws.amazon.com/lambda/latest/dg/images-create.html#images-lifecycle). - - If you don't provide a customer managed key, Lambda uses an [Amazon Web - Services owned - key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk) - or an [Amazon Web Services managed - key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk). - """ - - tracing_config: TracingConfigResponse | None = None - """The function's X-Ray tracing configuration.""" - - master_arn: str | None = None - """For Lambda@Edge functions, the ARN of the main function.""" - - revision_id: str | None = None - """The latest updated revision of the function or alias.""" - - layers: list[Layer] | None = None - """ - The function's - [layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html). - """ - - state: str | None = None - """ - The current state of the function. When the state is `Inactive`, you can - reactivate the function by invoking it. - """ - - state_reason: str | None = None - """The reason for the function's current state.""" - - state_reason_code: str | None = None - """ - The reason code for the function's current state. When the code is - `Creating`, you can't invoke or modify the function. - """ - - last_update_status: str | None = None - """ - The status of the last update that was performed on the function. This - is first set to `Successful` after function creation completes. - """ - - last_update_status_reason: str | None = None - """The reason for the last update that was performed on the function.""" - - last_update_status_reason_code: str | None = None - """The reason code for the last update that was performed on the function.""" - - file_system_configs: list[FileSystemConfig] | None = None - """ - Connection settings for an [Amazon EFS file - system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html) - or an [Amazon S3 file - system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html). - """ - - signing_profile_version_arn: str | None = None - """The ARN of the signing profile version.""" - - signing_job_arn: str | None = None - """The ARN of the signing job.""" - - package_type: str | None = None - """ - The type of deployment package. Set to `Image` for container image and - set `Zip` for .zip file archive. - """ - - image_config_response: ImageConfigResponse | None = None - """The function's image configuration values.""" - - architectures: list[str] | None = None - """ - The instruction set architecture that the function supports. - Architecture is a string array with one of the valid values. The default - architecture value is `x86_64`. - """ - - ephemeral_storage: EphemeralStorage | None = None - """ - The size of the function's `/tmp` directory in MB. The default value is - 512, but can be any whole number between 512 and 10,240 MB. For more - information, see [Configuring ephemeral storage - (console)](https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-ephemeral-storage). - """ - - snap_start: SnapStartResponse | None = None - """ - Set `ApplyOn` to `PublishedVersions` to create a snapshot of the - initialized execution environment when you publish a function version. - For more information, see [Improving startup performance with Lambda - SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html). - """ - - runtime_version_config: RuntimeVersionConfig | None = None - """The ARN of the runtime and any errors that occured.""" - - logging_config: LoggingConfig | None = None - """The function's Amazon CloudWatch Logs configuration settings.""" - - tenancy_config: TenancyConfig | None = None - """ - The function's tenant isolation configuration settings. Determines - whether the Lambda function runs on a shared or dedicated infrastructure - per unique tenant. - """ - - capacity_provider_config: CapacityProviderConfig | None = None - """ - Configuration for the capacity provider that manages compute resources - for Lambda functions. - """ - - config_sha256: str | None = None - """The SHA256 hash of the function configuration.""" - - durable_config: DurableConfig | None = None - """ - The function's durable execution configuration settings, if the - function is configured for durability. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members["FunctionName"], - self.function_name, - ) - - if self.function_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members["FunctionArn"], - self.function_arn, - ) - - if self.runtime is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members["Runtime"], - self.runtime, - ) - - if self.role is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members["Role"], self.role - ) - - if self.handler is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members["Handler"], - self.handler, - ) - - serializer.write_long( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members["CodeSize"], - self.code_size, - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members["Description"], - self.description, - ) - - if self.timeout is not None: - serializer.write_integer( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members["Timeout"], - self.timeout, - ) - - if self.memory_size is not None: - serializer.write_integer( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members["MemorySize"], - self.memory_size, - ) - - if self.last_modified is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members["LastModified"], - self.last_modified, - ) - - if self.code_sha256 is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members["CodeSha256"], - self.code_sha256, - ) - - if self.version is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members["Version"], - self.version, - ) - - if self.vpc_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members["VpcConfig"], - self.vpc_config, - ) - - if self.dead_letter_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members[ - "DeadLetterConfig" - ], - self.dead_letter_config, - ) - - if self.environment is not None: - serializer.write_struct( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members["Environment"], - self.environment, - ) - - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members["KMSKeyArn"], - self.kms_key_arn, - ) - - if self.tracing_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members["TracingConfig"], - self.tracing_config, - ) - - if self.master_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members["MasterArn"], - self.master_arn, - ) - - if self.revision_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members["RevisionId"], - self.revision_id, - ) - - if self.layers is not None: - _serialize_layers_reference_list( - serializer, - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members["Layers"], - self.layers, - ) - - if self.state is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members["State"], - self.state, - ) - - if self.state_reason is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members["StateReason"], - self.state_reason, - ) - - if self.state_reason_code is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members["StateReasonCode"], - self.state_reason_code, - ) - - if self.last_update_status is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members[ - "LastUpdateStatus" - ], - self.last_update_status, - ) - - if self.last_update_status_reason is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members[ - "LastUpdateStatusReason" - ], - self.last_update_status_reason, - ) - - if self.last_update_status_reason_code is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members[ - "LastUpdateStatusReasonCode" - ], - self.last_update_status_reason_code, - ) - - if self.file_system_configs is not None: - _serialize_file_system_config_list( - serializer, - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members[ - "FileSystemConfigs" - ], - self.file_system_configs, - ) - - if self.signing_profile_version_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members[ - "SigningProfileVersionArn" - ], - self.signing_profile_version_arn, - ) - - if self.signing_job_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members["SigningJobArn"], - self.signing_job_arn, - ) - - if self.package_type is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members["PackageType"], - self.package_type, - ) - - if self.image_config_response is not None: - serializer.write_struct( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members[ - "ImageConfigResponse" - ], - self.image_config_response, - ) - - if self.architectures is not None: - _serialize_architectures_list( - serializer, - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members["Architectures"], - self.architectures, - ) - - if self.ephemeral_storage is not None: - serializer.write_struct( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members[ - "EphemeralStorage" - ], - self.ephemeral_storage, - ) - - if self.snap_start is not None: - serializer.write_struct( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members["SnapStart"], - self.snap_start, - ) - - if self.runtime_version_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members[ - "RuntimeVersionConfig" - ], - self.runtime_version_config, - ) - - if self.logging_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members["LoggingConfig"], - self.logging_config, - ) - - if self.tenancy_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members["TenancyConfig"], - self.tenancy_config, - ) - - if self.capacity_provider_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members[ - "CapacityProviderConfig" - ], - self.capacity_provider_config, - ) - - if self.config_sha256 is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members["ConfigSha256"], - self.config_sha256, - ) - - if self.durable_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members["DurableConfig"], - self.durable_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members[ - "FunctionName" - ] - ) - - case 1: - kwargs["function_arn"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members[ - "FunctionArn" - ] - ) - - case 2: - kwargs["runtime"] = Runtime( - de.read_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members[ - "Runtime" - ] - ) - ) - - case 3: - kwargs["role"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members["Role"] - ) - - case 4: - kwargs["handler"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members["Handler"] - ) - - case 5: - kwargs["code_size"] = de.read_long( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members["CodeSize"] - ) - - case 6: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members[ - "Description" - ] - ) - - case 7: - kwargs["timeout"] = de.read_integer( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members["Timeout"] - ) - - case 8: - kwargs["memory_size"] = de.read_integer( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members[ - "MemorySize" - ] - ) - - case 9: - kwargs["last_modified"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members[ - "LastModified" - ] - ) - - case 10: - kwargs["code_sha256"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members[ - "CodeSha256" - ] - ) - - case 11: - kwargs["version"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members["Version"] - ) - - case 12: - kwargs["vpc_config"] = VpcConfigResponse.deserialize(de) - - case 13: - kwargs["dead_letter_config"] = DeadLetterConfig.deserialize(de) - - case 14: - kwargs["environment"] = EnvironmentResponse.deserialize(de) - - case 15: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members[ - "KMSKeyArn" - ] - ) - - case 16: - kwargs["tracing_config"] = TracingConfigResponse.deserialize(de) - - case 17: - kwargs["master_arn"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members[ - "MasterArn" - ] - ) - - case 18: - kwargs["revision_id"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members[ - "RevisionId" - ] - ) - - case 19: - kwargs["layers"] = _deserialize_layers_reference_list( - de, - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members["Layers"], - ) - - case 20: - kwargs["state"] = State( - de.read_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members[ - "State" - ] - ) - ) - - case 21: - kwargs["state_reason"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members[ - "StateReason" - ] - ) - - case 22: - kwargs["state_reason_code"] = StateReasonCode( - de.read_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members[ - "StateReasonCode" - ] - ) - ) - - case 23: - kwargs["last_update_status"] = LastUpdateStatus( - de.read_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members[ - "LastUpdateStatus" - ] - ) - ) - - case 24: - kwargs["last_update_status_reason"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members[ - "LastUpdateStatusReason" - ] - ) - - case 25: - kwargs["last_update_status_reason_code"] = ( - LastUpdateStatusReasonCode( - de.read_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members[ - "LastUpdateStatusReasonCode" - ] - ) - ) - ) - - case 26: - kwargs["file_system_configs"] = ( - _deserialize_file_system_config_list( - de, - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members[ - "FileSystemConfigs" - ], - ) - ) - - case 27: - kwargs["signing_profile_version_arn"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members[ - "SigningProfileVersionArn" - ] - ) - - case 28: - kwargs["signing_job_arn"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members[ - "SigningJobArn" - ] - ) - - case 29: - kwargs["package_type"] = PackageType( - de.read_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members[ - "PackageType" - ] - ) - ) - - case 30: - kwargs["image_config_response"] = ImageConfigResponse.deserialize( - de - ) - - case 31: - kwargs["architectures"] = _deserialize_architectures_list( - de, - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members[ - "Architectures" - ], - ) - - case 32: - kwargs["ephemeral_storage"] = EphemeralStorage.deserialize(de) - - case 33: - kwargs["snap_start"] = SnapStartResponse.deserialize(de) - - case 34: - kwargs["runtime_version_config"] = RuntimeVersionConfig.deserialize( - de - ) - - case 35: - kwargs["logging_config"] = LoggingConfig.deserialize(de) - - case 36: - kwargs["tenancy_config"] = TenancyConfig.deserialize(de) - - case 37: - kwargs["capacity_provider_config"] = ( - CapacityProviderConfig.deserialize(de) - ) - - case 38: - kwargs["config_sha256"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT.members[ - "ConfigSha256" - ] - ) - - case 39: - kwargs["durable_config"] = DurableConfig.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT, consumer=_consumer - ) - return kwargs - - -UPDATE_FUNCTION_CONFIGURATION = APIOperation( - input=UpdateFunctionConfigurationInput, - output=UpdateFunctionConfigurationOutput, - schema=_SCHEMA_UPDATE_FUNCTION_CONFIGURATION, - input_schema=_SCHEMA_UPDATE_FUNCTION_CONFIGURATION_INPUT, - output_schema=_SCHEMA_UPDATE_FUNCTION_CONFIGURATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#CodeSigningConfigNotFoundException" - ): CodeSigningConfigNotFoundException, - ShapeID( - "com.amazonaws.lambda#CodeVerificationFailedException" - ): CodeVerificationFailedException, - ShapeID( - "com.amazonaws.lambda#InvalidCodeSignatureException" - ): InvalidCodeSignatureException, - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#PreconditionFailedException" - ): PreconditionFailedException, - ShapeID( - "com.amazonaws.lambda#ResourceConflictException" - ): ResourceConflictException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CODE_SIGNING_CONFIG_NOT_FOUND_EXCEPTION, - _SCHEMA_CODE_VERIFICATION_FAILED_EXCEPTION, - _SCHEMA_INVALID_CODE_SIGNATURE_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_PRECONDITION_FAILED_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateFunctionUrlConfigInput: - """Dataclass for UpdateFunctionUrlConfigInput structure.""" - - function_name: str | None = None - """ - The name or ARN of the Lambda function. - - **Name formats** - - - **Function name** -- `my-function`. - - - **Function ARN** -- - `arn:aws:lambda:us-west-2:123456789012:function:my-function`. - - - **Partial ARN** -- `123456789012:function:my-function`. - - The length constraint applies only to the full ARN. If you specify only - the function name, it is limited to 64 characters in length. - """ - - qualifier: str | None = None - """The alias name.""" - - auth_type: str | None = None - """ - The type of authentication that your function URL uses. Set to `AWS_IAM` - if you want to restrict access to authenticated users only. Set to - `NONE` if you want to bypass IAM authentication to create a public - endpoint. For more information, see [Control access to Lambda function - URLs](https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html). - """ - - cors: Cors | None = None - """ - The [cross-origin resource sharing - (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) settings - for your function URL. - """ - - invoke_mode: str | None = None - """ - Use one of the following options: - - - `BUFFERED` -- This is the default option. Lambda invokes your function - using the `Invoke` API operation. Invocation results are available - when the payload is complete. The maximum payload size is 6 MB. - - - `RESPONSE_STREAM` -- Your function streams payload results as they - become available. Lambda invokes your function using the - `InvokeWithResponseStream` API operation. The maximum response payload - size is 200 MB. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_FUNCTION_URL_CONFIG_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_URL_CONFIG_INPUT.members["FunctionName"], - self.function_name, - ) - - if self.qualifier is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_URL_CONFIG_INPUT.members["Qualifier"], - self.qualifier, - ) - - if self.auth_type is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_URL_CONFIG_INPUT.members["AuthType"], - self.auth_type, - ) - - if self.cors is not None: - serializer.write_struct( - _SCHEMA_UPDATE_FUNCTION_URL_CONFIG_INPUT.members["Cors"], self.cors - ) - - if self.invoke_mode is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_URL_CONFIG_INPUT.members["InvokeMode"], - self.invoke_mode, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_URL_CONFIG_INPUT.members["FunctionName"] - ) - - case 1: - kwargs["qualifier"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_URL_CONFIG_INPUT.members["Qualifier"] - ) - - case 2: - kwargs["auth_type"] = FunctionUrlAuthType( - de.read_string( - _SCHEMA_UPDATE_FUNCTION_URL_CONFIG_INPUT.members["AuthType"] - ) - ) - - case 3: - kwargs["cors"] = Cors.deserialize(de) - - case 4: - kwargs["invoke_mode"] = InvokeMode( - de.read_string( - _SCHEMA_UPDATE_FUNCTION_URL_CONFIG_INPUT.members[ - "InvokeMode" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_FUNCTION_URL_CONFIG_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateFunctionUrlConfigOutput: - """Dataclass for UpdateFunctionUrlConfigOutput structure.""" - - function_url: str - """The HTTP URL endpoint for your function.""" - - function_arn: str - """The Amazon Resource Name (ARN) of your function.""" - - auth_type: str - """ - The type of authentication that your function URL uses. Set to `AWS_IAM` - if you want to restrict access to authenticated users only. Set to - `NONE` if you want to bypass IAM authentication to create a public - endpoint. For more information, see [Control access to Lambda function - URLs](https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html). - """ - - creation_time: str - """ - When the function URL was created, in [ISO-8601 - format](https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). - """ - - last_modified_time: str - """ - When the function URL configuration was last updated, in [ISO-8601 - format](https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). - """ - - cors: Cors | None = None - """ - The [cross-origin resource sharing - (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) settings - for your function URL. - """ - - invoke_mode: str | None = None - """ - Use one of the following options: - - - `BUFFERED` -- This is the default option. Lambda invokes your function - using the `Invoke` API operation. Invocation results are available - when the payload is complete. The maximum payload size is 6 MB. - - - `RESPONSE_STREAM` -- Your function streams payload results as they - become available. Lambda invokes your function using the - `InvokeWithResponseStream` API operation. The maximum response payload - size is 200 MB. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_FUNCTION_URL_CONFIG_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_URL_CONFIG_OUTPUT.members["FunctionUrl"], - self.function_url, - ) - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_URL_CONFIG_OUTPUT.members["FunctionArn"], - self.function_arn, - ) - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_URL_CONFIG_OUTPUT.members["AuthType"], - self.auth_type, - ) - if self.cors is not None: - serializer.write_struct( - _SCHEMA_UPDATE_FUNCTION_URL_CONFIG_OUTPUT.members["Cors"], self.cors - ) - - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_URL_CONFIG_OUTPUT.members["CreationTime"], - self.creation_time, - ) - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_URL_CONFIG_OUTPUT.members["LastModifiedTime"], - self.last_modified_time, - ) - if self.invoke_mode is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_URL_CONFIG_OUTPUT.members["InvokeMode"], - self.invoke_mode, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_url"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_URL_CONFIG_OUTPUT.members["FunctionUrl"] - ) - - case 1: - kwargs["function_arn"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_URL_CONFIG_OUTPUT.members["FunctionArn"] - ) - - case 2: - kwargs["auth_type"] = FunctionUrlAuthType( - de.read_string( - _SCHEMA_UPDATE_FUNCTION_URL_CONFIG_OUTPUT.members[ - "AuthType" - ] - ) - ) - - case 3: - kwargs["cors"] = Cors.deserialize(de) - - case 4: - kwargs["creation_time"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_URL_CONFIG_OUTPUT.members[ - "CreationTime" - ] - ) - - case 5: - kwargs["last_modified_time"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_URL_CONFIG_OUTPUT.members[ - "LastModifiedTime" - ] - ) - - case 6: - kwargs["invoke_mode"] = InvokeMode( - de.read_string( - _SCHEMA_UPDATE_FUNCTION_URL_CONFIG_OUTPUT.members[ - "InvokeMode" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_FUNCTION_URL_CONFIG_OUTPUT, consumer=_consumer - ) - if "function_url" not in kwargs: - kwargs["function_url"] = "" - if "function_arn" not in kwargs: - kwargs["function_arn"] = "" - if "auth_type" not in kwargs: - kwargs["auth_type"] = FunctionUrlAuthType._corrected("") - if "creation_time" not in kwargs: - kwargs["creation_time"] = "" - if "last_modified_time" not in kwargs: - kwargs["last_modified_time"] = "" - return kwargs - - -UPDATE_FUNCTION_URL_CONFIG = APIOperation( - input=UpdateFunctionUrlConfigInput, - output=UpdateFunctionUrlConfigOutput, - schema=_SCHEMA_UPDATE_FUNCTION_URL_CONFIG, - input_schema=_SCHEMA_UPDATE_FUNCTION_URL_CONFIG_INPUT, - output_schema=_SCHEMA_UPDATE_FUNCTION_URL_CONFIG_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceConflictException" - ): ResourceConflictException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class CreateAliasInput: - """Dataclass for CreateAliasInput structure.""" - - function_name: str | None = None - """ - The name or ARN of the Lambda function. - - **Name formats** - - - **Function name** - `MyFunction`. - - - **Function ARN** - - `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`. - - - **Partial ARN** - `123456789012:function:MyFunction`. - - The length constraint applies only to the full ARN. If you specify only - the function name, it is limited to 64 characters in length. - """ - - name: str | None = None - """The name of the alias.""" - - function_version: str | None = None - """The function version that the alias invokes.""" - - description: str | None = None - """A description of the alias.""" - - routing_config: AliasRoutingConfiguration | None = None - """ - The [routing - configuration](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html#configuring-alias-routing) - of the alias. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_ALIAS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_CREATE_ALIAS_INPUT.members["FunctionName"], self.function_name - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_ALIAS_INPUT.members["Name"], self.name - ) - - if self.function_version is not None: - serializer.write_string( - _SCHEMA_CREATE_ALIAS_INPUT.members["FunctionVersion"], - self.function_version, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_ALIAS_INPUT.members["Description"], self.description - ) - - if self.routing_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_ALIAS_INPUT.members["RoutingConfig"], self.routing_config - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_CREATE_ALIAS_INPUT.members["FunctionName"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_ALIAS_INPUT.members["Name"] - ) - - case 2: - kwargs["function_version"] = de.read_string( - _SCHEMA_CREATE_ALIAS_INPUT.members["FunctionVersion"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_ALIAS_INPUT.members["Description"] - ) - - case 4: - kwargs["routing_config"] = AliasRoutingConfiguration.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_ALIAS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CreateAliasOutput: - """ - Provides configuration information about a Lambda function - [alias](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html). - """ - - alias_arn: str | None = None - """The Amazon Resource Name (ARN) of the alias.""" - - name: str | None = None - """The name of the alias.""" - - function_version: str | None = None - """The function version that the alias invokes.""" - - description: str | None = None - """A description of the alias.""" - - routing_config: AliasRoutingConfiguration | None = None - """ - The [routing - configuration](https://docs.aws.amazon.com/lambda/latest/dg/lambda-traffic-shifting-using-aliases.html) - of the alias. - """ - - revision_id: str | None = None - """A unique identifier that changes when you update the alias.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_ALIAS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.alias_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_ALIAS_OUTPUT.members["AliasArn"], self.alias_arn - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_ALIAS_OUTPUT.members["Name"], self.name - ) - - if self.function_version is not None: - serializer.write_string( - _SCHEMA_CREATE_ALIAS_OUTPUT.members["FunctionVersion"], - self.function_version, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_ALIAS_OUTPUT.members["Description"], self.description - ) - - if self.routing_config is not None: - serializer.write_struct( - _SCHEMA_CREATE_ALIAS_OUTPUT.members["RoutingConfig"], - self.routing_config, - ) - - if self.revision_id is not None: - serializer.write_string( - _SCHEMA_CREATE_ALIAS_OUTPUT.members["RevisionId"], self.revision_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["alias_arn"] = de.read_string( - _SCHEMA_CREATE_ALIAS_OUTPUT.members["AliasArn"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_ALIAS_OUTPUT.members["Name"] - ) - - case 2: - kwargs["function_version"] = de.read_string( - _SCHEMA_CREATE_ALIAS_OUTPUT.members["FunctionVersion"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_ALIAS_OUTPUT.members["Description"] - ) - - case 4: - kwargs["routing_config"] = AliasRoutingConfiguration.deserialize(de) - - case 5: - kwargs["revision_id"] = de.read_string( - _SCHEMA_CREATE_ALIAS_OUTPUT.members["RevisionId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_ALIAS_OUTPUT, consumer=_consumer) - return kwargs - - -CREATE_ALIAS = APIOperation( - input=CreateAliasInput, - output=CreateAliasOutput, - schema=_SCHEMA_CREATE_ALIAS, - input_schema=_SCHEMA_CREATE_ALIAS_INPUT, - output_schema=_SCHEMA_CREATE_ALIAS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#AliasLimitExceededException" - ): AliasLimitExceededException, - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceConflictException" - ): ResourceConflictException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ALIAS_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteAliasInput: - """Dataclass for DeleteAliasInput structure.""" - - function_name: str | None = None - """ - The name or ARN of the Lambda function. - - **Name formats** - - - **Function name** - `MyFunction`. - - - **Function ARN** - - `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`. - - - **Partial ARN** - `123456789012:function:MyFunction`. - - The length constraint applies only to the full ARN. If you specify only - the function name, it is limited to 64 characters in length. - """ - - name: str | None = None - """The name of the alias.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_ALIAS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_DELETE_ALIAS_INPUT.members["FunctionName"], self.function_name - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_DELETE_ALIAS_INPUT.members["Name"], self.name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_DELETE_ALIAS_INPUT.members["FunctionName"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_DELETE_ALIAS_INPUT.members["Name"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_ALIAS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteAliasOutput: - """Dataclass for DeleteAliasOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_ALIAS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_ALIAS_OUTPUT, consumer=_consumer) - return kwargs - - -DELETE_ALIAS = APIOperation( - input=DeleteAliasInput, - output=DeleteAliasOutput, - schema=_SCHEMA_DELETE_ALIAS, - input_schema=_SCHEMA_DELETE_ALIAS_INPUT, - output_schema=_SCHEMA_DELETE_ALIAS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceConflictException" - ): ResourceConflictException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetAliasInput: - """Dataclass for GetAliasInput structure.""" - - function_name: str | None = None - """ - The name or ARN of the Lambda function. - - **Name formats** - - - **Function name** - `MyFunction`. - - - **Function ARN** - - `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`. - - - **Partial ARN** - `123456789012:function:MyFunction`. - - The length constraint applies only to the full ARN. If you specify only - the function name, it is limited to 64 characters in length. - """ - - name: str | None = None - """The name of the alias.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_ALIAS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_GET_ALIAS_INPUT.members["FunctionName"], self.function_name - ) - - if self.name is not None: - serializer.write_string(_SCHEMA_GET_ALIAS_INPUT.members["Name"], self.name) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_GET_ALIAS_INPUT.members["FunctionName"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_GET_ALIAS_INPUT.members["Name"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_ALIAS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetAliasOutput: - """ - Provides configuration information about a Lambda function - [alias](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html). - """ - - alias_arn: str | None = None - """The Amazon Resource Name (ARN) of the alias.""" - - name: str | None = None - """The name of the alias.""" - - function_version: str | None = None - """The function version that the alias invokes.""" - - description: str | None = None - """A description of the alias.""" - - routing_config: AliasRoutingConfiguration | None = None - """ - The [routing - configuration](https://docs.aws.amazon.com/lambda/latest/dg/lambda-traffic-shifting-using-aliases.html) - of the alias. - """ - - revision_id: str | None = None - """A unique identifier that changes when you update the alias.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_ALIAS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.alias_arn is not None: - serializer.write_string( - _SCHEMA_GET_ALIAS_OUTPUT.members["AliasArn"], self.alias_arn - ) - - if self.name is not None: - serializer.write_string(_SCHEMA_GET_ALIAS_OUTPUT.members["Name"], self.name) - - if self.function_version is not None: - serializer.write_string( - _SCHEMA_GET_ALIAS_OUTPUT.members["FunctionVersion"], - self.function_version, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_ALIAS_OUTPUT.members["Description"], self.description - ) - - if self.routing_config is not None: - serializer.write_struct( - _SCHEMA_GET_ALIAS_OUTPUT.members["RoutingConfig"], self.routing_config - ) - - if self.revision_id is not None: - serializer.write_string( - _SCHEMA_GET_ALIAS_OUTPUT.members["RevisionId"], self.revision_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["alias_arn"] = de.read_string( - _SCHEMA_GET_ALIAS_OUTPUT.members["AliasArn"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_GET_ALIAS_OUTPUT.members["Name"] - ) - - case 2: - kwargs["function_version"] = de.read_string( - _SCHEMA_GET_ALIAS_OUTPUT.members["FunctionVersion"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_GET_ALIAS_OUTPUT.members["Description"] - ) - - case 4: - kwargs["routing_config"] = AliasRoutingConfiguration.deserialize(de) - - case 5: - kwargs["revision_id"] = de.read_string( - _SCHEMA_GET_ALIAS_OUTPUT.members["RevisionId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_ALIAS_OUTPUT, consumer=_consumer) - return kwargs - - -GET_ALIAS = APIOperation( - input=GetAliasInput, - output=GetAliasOutput, - schema=_SCHEMA_GET_ALIAS, - input_schema=_SCHEMA_GET_ALIAS_INPUT, - output_schema=_SCHEMA_GET_ALIAS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListAliasesInput: - """Dataclass for ListAliasesInput structure.""" - - function_name: str | None = None - """ - The name or ARN of the Lambda function. - - **Name formats** - - - **Function name** - `MyFunction`. - - - **Function ARN** - - `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`. - - - **Partial ARN** - `123456789012:function:MyFunction`. - - The length constraint applies only to the full ARN. If you specify only - the function name, it is limited to 64 characters in length. - """ - - function_version: str | None = None - """ - Specify a function version to only list aliases that invoke that - version. - """ - - marker: str | None = None - """ - Specify the pagination token that's returned by a previous request to - retrieve the next page of results. - """ - - max_items: int | None = None - """Limit the number of aliases returned.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_ALIASES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_LIST_ALIASES_INPUT.members["FunctionName"], self.function_name - ) - - if self.function_version is not None: - serializer.write_string( - _SCHEMA_LIST_ALIASES_INPUT.members["FunctionVersion"], - self.function_version, - ) - - if self.marker is not None: - serializer.write_string( - _SCHEMA_LIST_ALIASES_INPUT.members["Marker"], self.marker - ) - - if self.max_items is not None: - serializer.write_integer( - _SCHEMA_LIST_ALIASES_INPUT.members["MaxItems"], self.max_items - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_LIST_ALIASES_INPUT.members["FunctionName"] - ) - - case 1: - kwargs["function_version"] = de.read_string( - _SCHEMA_LIST_ALIASES_INPUT.members["FunctionVersion"] - ) - - case 2: - kwargs["marker"] = de.read_string( - _SCHEMA_LIST_ALIASES_INPUT.members["Marker"] - ) - - case 3: - kwargs["max_items"] = de.read_integer( - _SCHEMA_LIST_ALIASES_INPUT.members["MaxItems"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_ALIASES_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ListAliasesOutput: - """Dataclass for ListAliasesOutput structure.""" - - next_marker: str | None = None - """The pagination token that's included if more results are available.""" - - aliases: list[AliasConfiguration] | None = None - """A list of aliases.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_ALIASES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_marker is not None: - serializer.write_string( - _SCHEMA_LIST_ALIASES_OUTPUT.members["NextMarker"], self.next_marker - ) - - if self.aliases is not None: - _serialize_alias_list( - serializer, _SCHEMA_LIST_ALIASES_OUTPUT.members["Aliases"], self.aliases - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_marker"] = de.read_string( - _SCHEMA_LIST_ALIASES_OUTPUT.members["NextMarker"] - ) - - case 1: - kwargs["aliases"] = _deserialize_alias_list( - de, _SCHEMA_LIST_ALIASES_OUTPUT.members["Aliases"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_ALIASES_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_ALIASES = APIOperation( - input=ListAliasesInput, - output=ListAliasesOutput, - schema=_SCHEMA_LIST_ALIASES, - input_schema=_SCHEMA_LIST_ALIASES_INPUT, - output_schema=_SCHEMA_LIST_ALIASES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateAliasInput: - """Dataclass for UpdateAliasInput structure.""" - - function_name: str | None = None - """ - The name or ARN of the Lambda function. - - **Name formats** - - - **Function name** - `MyFunction`. - - - **Function ARN** - - `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`. - - - **Partial ARN** - `123456789012:function:MyFunction`. - - The length constraint applies only to the full ARN. If you specify only - the function name, it is limited to 64 characters in length. - """ - - name: str | None = None - """The name of the alias.""" - - function_version: str | None = None - """The function version that the alias invokes.""" - - description: str | None = None - """A description of the alias.""" - - routing_config: AliasRoutingConfiguration | None = None - """ - The [routing - configuration](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html#configuring-alias-routing) - of the alias. - """ - - revision_id: str | None = None - """ - Only update the alias if the revision ID matches the ID that's - specified. Use this option to avoid modifying an alias that has changed - since you last read it. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_ALIAS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_ALIAS_INPUT.members["FunctionName"], self.function_name - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_UPDATE_ALIAS_INPUT.members["Name"], self.name - ) - - if self.function_version is not None: - serializer.write_string( - _SCHEMA_UPDATE_ALIAS_INPUT.members["FunctionVersion"], - self.function_version, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_ALIAS_INPUT.members["Description"], self.description - ) - - if self.routing_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_ALIAS_INPUT.members["RoutingConfig"], self.routing_config - ) - - if self.revision_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_ALIAS_INPUT.members["RevisionId"], self.revision_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_UPDATE_ALIAS_INPUT.members["FunctionName"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_ALIAS_INPUT.members["Name"] - ) - - case 2: - kwargs["function_version"] = de.read_string( - _SCHEMA_UPDATE_ALIAS_INPUT.members["FunctionVersion"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_ALIAS_INPUT.members["Description"] - ) - - case 4: - kwargs["routing_config"] = AliasRoutingConfiguration.deserialize(de) - - case 5: - kwargs["revision_id"] = de.read_string( - _SCHEMA_UPDATE_ALIAS_INPUT.members["RevisionId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_ALIAS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateAliasOutput: - """ - Provides configuration information about a Lambda function - [alias](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html). - """ - - alias_arn: str | None = None - """The Amazon Resource Name (ARN) of the alias.""" - - name: str | None = None - """The name of the alias.""" - - function_version: str | None = None - """The function version that the alias invokes.""" - - description: str | None = None - """A description of the alias.""" - - routing_config: AliasRoutingConfiguration | None = None - """ - The [routing - configuration](https://docs.aws.amazon.com/lambda/latest/dg/lambda-traffic-shifting-using-aliases.html) - of the alias. - """ - - revision_id: str | None = None - """A unique identifier that changes when you update the alias.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_ALIAS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.alias_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_ALIAS_OUTPUT.members["AliasArn"], self.alias_arn - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_UPDATE_ALIAS_OUTPUT.members["Name"], self.name - ) - - if self.function_version is not None: - serializer.write_string( - _SCHEMA_UPDATE_ALIAS_OUTPUT.members["FunctionVersion"], - self.function_version, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_ALIAS_OUTPUT.members["Description"], self.description - ) - - if self.routing_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_ALIAS_OUTPUT.members["RoutingConfig"], - self.routing_config, - ) - - if self.revision_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_ALIAS_OUTPUT.members["RevisionId"], self.revision_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["alias_arn"] = de.read_string( - _SCHEMA_UPDATE_ALIAS_OUTPUT.members["AliasArn"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_ALIAS_OUTPUT.members["Name"] - ) - - case 2: - kwargs["function_version"] = de.read_string( - _SCHEMA_UPDATE_ALIAS_OUTPUT.members["FunctionVersion"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_ALIAS_OUTPUT.members["Description"] - ) - - case 4: - kwargs["routing_config"] = AliasRoutingConfiguration.deserialize(de) - - case 5: - kwargs["revision_id"] = de.read_string( - _SCHEMA_UPDATE_ALIAS_OUTPUT.members["RevisionId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_ALIAS_OUTPUT, consumer=_consumer) - return kwargs - - -UPDATE_ALIAS = APIOperation( - input=UpdateAliasInput, - output=UpdateAliasOutput, - schema=_SCHEMA_UPDATE_ALIAS, - input_schema=_SCHEMA_UPDATE_ALIAS_INPUT, - output_schema=_SCHEMA_UPDATE_ALIAS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#PreconditionFailedException" - ): PreconditionFailedException, - ShapeID( - "com.amazonaws.lambda#ResourceConflictException" - ): ResourceConflictException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_PRECONDITION_FAILED_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListVersionsByFunctionInput: - """Dataclass for ListVersionsByFunctionInput structure.""" - - function_name: str | None = None - """ - The name or ARN of the Lambda function. - - **Name formats** - - - **Function name** - `MyFunction`. - - - **Function ARN** - - `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`. - - - **Partial ARN** - `123456789012:function:MyFunction`. - - The length constraint applies only to the full ARN. If you specify only - the function name, it is limited to 64 characters in length. - """ - - marker: str | None = None - """ - Specify the pagination token that's returned by a previous request to - retrieve the next page of results. - """ - - max_items: int | None = None - """ - The maximum number of versions to return. Note that - `ListVersionsByFunction` returns a maximum of 50 items in each response, - even if you set the number higher. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_VERSIONS_BY_FUNCTION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_LIST_VERSIONS_BY_FUNCTION_INPUT.members["FunctionName"], - self.function_name, - ) - - if self.marker is not None: - serializer.write_string( - _SCHEMA_LIST_VERSIONS_BY_FUNCTION_INPUT.members["Marker"], self.marker - ) - - if self.max_items is not None: - serializer.write_integer( - _SCHEMA_LIST_VERSIONS_BY_FUNCTION_INPUT.members["MaxItems"], - self.max_items, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_LIST_VERSIONS_BY_FUNCTION_INPUT.members["FunctionName"] - ) - - case 1: - kwargs["marker"] = de.read_string( - _SCHEMA_LIST_VERSIONS_BY_FUNCTION_INPUT.members["Marker"] - ) - - case 2: - kwargs["max_items"] = de.read_integer( - _SCHEMA_LIST_VERSIONS_BY_FUNCTION_INPUT.members["MaxItems"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_VERSIONS_BY_FUNCTION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ListVersionsByFunctionOutput: - """Dataclass for ListVersionsByFunctionOutput structure.""" - - next_marker: str | None = None - """The pagination token that's included if more results are available.""" - - versions: list[FunctionConfiguration] | None = None - """A list of Lambda function versions.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_VERSIONS_BY_FUNCTION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_marker is not None: - serializer.write_string( - _SCHEMA_LIST_VERSIONS_BY_FUNCTION_OUTPUT.members["NextMarker"], - self.next_marker, - ) - - if self.versions is not None: - _serialize_function_list( - serializer, - _SCHEMA_LIST_VERSIONS_BY_FUNCTION_OUTPUT.members["Versions"], - self.versions, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_marker"] = de.read_string( - _SCHEMA_LIST_VERSIONS_BY_FUNCTION_OUTPUT.members["NextMarker"] - ) - - case 1: - kwargs["versions"] = _deserialize_function_list( - de, _SCHEMA_LIST_VERSIONS_BY_FUNCTION_OUTPUT.members["Versions"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_VERSIONS_BY_FUNCTION_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_VERSIONS_BY_FUNCTION = APIOperation( - input=ListVersionsByFunctionInput, - output=ListVersionsByFunctionOutput, - schema=_SCHEMA_LIST_VERSIONS_BY_FUNCTION, - input_schema=_SCHEMA_LIST_VERSIONS_BY_FUNCTION_INPUT, - output_schema=_SCHEMA_LIST_VERSIONS_BY_FUNCTION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class PublishVersionInput: - """Dataclass for PublishVersionInput structure.""" - - function_name: str | None = None - """ - The name or ARN of the Lambda function. - - **Name formats** - - - **Function name** - `MyFunction`. - - - **Function ARN** - - `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`. - - - **Partial ARN** - `123456789012:function:MyFunction`. - - The length constraint applies only to the full ARN. If you specify only - the function name, it is limited to 64 characters in length. - """ - - code_sha256: str | None = None - """ - Only publish a version if the hash value matches the value that's - specified. Use this option to avoid publishing a version if the function - code has changed since you last updated it. You can get the hash for the - version that you uploaded from the output of UpdateFunctionCode. - """ - - description: str | None = None - """ - A description for the version to override the description in the - function configuration. - """ - - revision_id: str | None = None - """ - Only update the function if the revision ID matches the ID that's - specified. Use this option to avoid publishing a version if the function - configuration has changed since you last updated it. - """ - - publish_to: str | None = None - """Specifies where to publish the function version or configuration.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUBLISH_VERSION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_PUBLISH_VERSION_INPUT.members["FunctionName"], - self.function_name, - ) - - if self.code_sha256 is not None: - serializer.write_string( - _SCHEMA_PUBLISH_VERSION_INPUT.members["CodeSha256"], self.code_sha256 - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_PUBLISH_VERSION_INPUT.members["Description"], self.description - ) - - if self.revision_id is not None: - serializer.write_string( - _SCHEMA_PUBLISH_VERSION_INPUT.members["RevisionId"], self.revision_id - ) - - if self.publish_to is not None: - serializer.write_string( - _SCHEMA_PUBLISH_VERSION_INPUT.members["PublishTo"], self.publish_to - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_PUBLISH_VERSION_INPUT.members["FunctionName"] - ) - - case 1: - kwargs["code_sha256"] = de.read_string( - _SCHEMA_PUBLISH_VERSION_INPUT.members["CodeSha256"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_PUBLISH_VERSION_INPUT.members["Description"] - ) - - case 3: - kwargs["revision_id"] = de.read_string( - _SCHEMA_PUBLISH_VERSION_INPUT.members["RevisionId"] - ) - - case 4: - kwargs["publish_to"] = FunctionVersionLatestPublished( - de.read_string( - _SCHEMA_PUBLISH_VERSION_INPUT.members["PublishTo"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUBLISH_VERSION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class PublishVersionOutput: - """Details about a function's configuration.""" - - function_name: str | None = None - """The name of the function.""" - - function_arn: str | None = None - """The function's Amazon Resource Name (ARN).""" - - runtime: str | None = None - """ - The identifier of the function's - [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html). - Runtime is required if the deployment package is a .zip file archive. - Specifying a runtime results in an error if you're deploying a function - using a container image. - - The following list includes deprecated runtimes. Lambda blocks creating - new functions and updating existing functions shortly after each runtime - is deprecated. For more information, see [Runtime use after - deprecation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-deprecation-levels). - - For a list of all currently supported runtimes, see [Supported - runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtimes-supported). - """ - - role: str | None = None - """The function's execution role.""" - - handler: str | None = None - """The function that Lambda calls to begin running your function.""" - - code_size: int = 0 - """The size of the function's deployment package, in bytes.""" - - description: str | None = None - """The function's description.""" - - timeout: int | None = None - """ - The amount of time in seconds that Lambda allows a function to run - before stopping it. - """ - - memory_size: int | None = None - """The amount of memory available to the function at runtime.""" - - last_modified: str | None = None - """ - The date and time that the function was last updated, in [ISO-8601 - format](https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). - """ - - code_sha256: str | None = None - """The SHA256 hash of the function's deployment package.""" - - version: str | None = None - """The version of the Lambda function.""" - - vpc_config: VpcConfigResponse | None = None - """The function's networking configuration.""" - - dead_letter_config: DeadLetterConfig | None = None - """The function's dead letter queue.""" - - environment: EnvironmentResponse | None = None - """ - The function's [environment - variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html). - Omitted from CloudTrail logs. - """ - - kms_key_arn: str | None = None - """ - The ARN of the Key Management Service (KMS) customer managed key that's - used to encrypt the following resources: - - - The function's [environment - variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-encryption). - - - The function's [Lambda - SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart-security.html) - snapshots. - - - When used with `SourceKMSKeyArn`, the unzipped version of the .zip - deployment package that's used for function invocations. For more - information, see [Specifying a customer managed key for - Lambda](https://docs.aws.amazon.com/lambda/latest/dg/encrypt-zip-package.html#enable-zip-custom-encryption). - - - The optimized version of the container image that's used for function - invocations. Note that this is not the same key that's used to - protect your container image in the Amazon Elastic Container Registry - (Amazon ECR). For more information, see [Function - lifecycle](https://docs.aws.amazon.com/lambda/latest/dg/images-create.html#images-lifecycle). - - If you don't provide a customer managed key, Lambda uses an [Amazon Web - Services owned - key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk) - or an [Amazon Web Services managed - key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk). - """ - - tracing_config: TracingConfigResponse | None = None - """The function's X-Ray tracing configuration.""" - - master_arn: str | None = None - """For Lambda@Edge functions, the ARN of the main function.""" - - revision_id: str | None = None - """The latest updated revision of the function or alias.""" - - layers: list[Layer] | None = None - """ - The function's - [layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html). - """ - - state: str | None = None - """ - The current state of the function. When the state is `Inactive`, you can - reactivate the function by invoking it. - """ - - state_reason: str | None = None - """The reason for the function's current state.""" - - state_reason_code: str | None = None - """ - The reason code for the function's current state. When the code is - `Creating`, you can't invoke or modify the function. - """ - - last_update_status: str | None = None - """ - The status of the last update that was performed on the function. This - is first set to `Successful` after function creation completes. - """ - - last_update_status_reason: str | None = None - """The reason for the last update that was performed on the function.""" - - last_update_status_reason_code: str | None = None - """The reason code for the last update that was performed on the function.""" - - file_system_configs: list[FileSystemConfig] | None = None - """ - Connection settings for an [Amazon EFS file - system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html) - or an [Amazon S3 file - system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html). - """ - - signing_profile_version_arn: str | None = None - """The ARN of the signing profile version.""" - - signing_job_arn: str | None = None - """The ARN of the signing job.""" - - package_type: str | None = None - """ - The type of deployment package. Set to `Image` for container image and - set `Zip` for .zip file archive. - """ - - image_config_response: ImageConfigResponse | None = None - """The function's image configuration values.""" - - architectures: list[str] | None = None - """ - The instruction set architecture that the function supports. - Architecture is a string array with one of the valid values. The default - architecture value is `x86_64`. - """ - - ephemeral_storage: EphemeralStorage | None = None - """ - The size of the function's `/tmp` directory in MB. The default value is - 512, but can be any whole number between 512 and 10,240 MB. For more - information, see [Configuring ephemeral storage - (console)](https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-ephemeral-storage). - """ - - snap_start: SnapStartResponse | None = None - """ - Set `ApplyOn` to `PublishedVersions` to create a snapshot of the - initialized execution environment when you publish a function version. - For more information, see [Improving startup performance with Lambda - SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html). - """ - - runtime_version_config: RuntimeVersionConfig | None = None - """The ARN of the runtime and any errors that occured.""" - - logging_config: LoggingConfig | None = None - """The function's Amazon CloudWatch Logs configuration settings.""" - - tenancy_config: TenancyConfig | None = None - """ - The function's tenant isolation configuration settings. Determines - whether the Lambda function runs on a shared or dedicated infrastructure - per unique tenant. - """ - - capacity_provider_config: CapacityProviderConfig | None = None - """ - Configuration for the capacity provider that manages compute resources - for Lambda functions. - """ - - config_sha256: str | None = None - """The SHA256 hash of the function configuration.""" - - durable_config: DurableConfig | None = None - """ - The function's durable execution configuration settings, if the - function is configured for durability. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUBLISH_VERSION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["FunctionName"], - self.function_name, - ) - - if self.function_arn is not None: - serializer.write_string( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["FunctionArn"], self.function_arn - ) - - if self.runtime is not None: - serializer.write_string( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["Runtime"], self.runtime - ) - - if self.role is not None: - serializer.write_string( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["Role"], self.role - ) - - if self.handler is not None: - serializer.write_string( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["Handler"], self.handler - ) - - serializer.write_long( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["CodeSize"], self.code_size - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["Description"], self.description - ) - - if self.timeout is not None: - serializer.write_integer( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["Timeout"], self.timeout - ) - - if self.memory_size is not None: - serializer.write_integer( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["MemorySize"], self.memory_size - ) - - if self.last_modified is not None: - serializer.write_string( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["LastModified"], - self.last_modified, - ) - - if self.code_sha256 is not None: - serializer.write_string( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["CodeSha256"], self.code_sha256 - ) - - if self.version is not None: - serializer.write_string( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["Version"], self.version - ) - - if self.vpc_config is not None: - serializer.write_struct( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["VpcConfig"], self.vpc_config - ) - - if self.dead_letter_config is not None: - serializer.write_struct( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["DeadLetterConfig"], - self.dead_letter_config, - ) - - if self.environment is not None: - serializer.write_struct( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["Environment"], self.environment - ) - - if self.kms_key_arn is not None: - serializer.write_string( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["KMSKeyArn"], self.kms_key_arn - ) - - if self.tracing_config is not None: - serializer.write_struct( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["TracingConfig"], - self.tracing_config, - ) - - if self.master_arn is not None: - serializer.write_string( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["MasterArn"], self.master_arn - ) - - if self.revision_id is not None: - serializer.write_string( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["RevisionId"], self.revision_id - ) - - if self.layers is not None: - _serialize_layers_reference_list( - serializer, - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["Layers"], - self.layers, - ) - - if self.state is not None: - serializer.write_string( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["State"], self.state - ) - - if self.state_reason is not None: - serializer.write_string( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["StateReason"], self.state_reason - ) - - if self.state_reason_code is not None: - serializer.write_string( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["StateReasonCode"], - self.state_reason_code, - ) - - if self.last_update_status is not None: - serializer.write_string( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["LastUpdateStatus"], - self.last_update_status, - ) - - if self.last_update_status_reason is not None: - serializer.write_string( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["LastUpdateStatusReason"], - self.last_update_status_reason, - ) - - if self.last_update_status_reason_code is not None: - serializer.write_string( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["LastUpdateStatusReasonCode"], - self.last_update_status_reason_code, - ) - - if self.file_system_configs is not None: - _serialize_file_system_config_list( - serializer, - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["FileSystemConfigs"], - self.file_system_configs, - ) - - if self.signing_profile_version_arn is not None: - serializer.write_string( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["SigningProfileVersionArn"], - self.signing_profile_version_arn, - ) - - if self.signing_job_arn is not None: - serializer.write_string( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["SigningJobArn"], - self.signing_job_arn, - ) - - if self.package_type is not None: - serializer.write_string( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["PackageType"], self.package_type - ) - - if self.image_config_response is not None: - serializer.write_struct( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["ImageConfigResponse"], - self.image_config_response, - ) - - if self.architectures is not None: - _serialize_architectures_list( - serializer, - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["Architectures"], - self.architectures, - ) - - if self.ephemeral_storage is not None: - serializer.write_struct( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["EphemeralStorage"], - self.ephemeral_storage, - ) - - if self.snap_start is not None: - serializer.write_struct( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["SnapStart"], self.snap_start - ) - - if self.runtime_version_config is not None: - serializer.write_struct( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["RuntimeVersionConfig"], - self.runtime_version_config, - ) - - if self.logging_config is not None: - serializer.write_struct( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["LoggingConfig"], - self.logging_config, - ) - - if self.tenancy_config is not None: - serializer.write_struct( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["TenancyConfig"], - self.tenancy_config, - ) - - if self.capacity_provider_config is not None: - serializer.write_struct( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["CapacityProviderConfig"], - self.capacity_provider_config, - ) - - if self.config_sha256 is not None: - serializer.write_string( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["ConfigSha256"], - self.config_sha256, - ) - - if self.durable_config is not None: - serializer.write_struct( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["DurableConfig"], - self.durable_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["FunctionName"] - ) - - case 1: - kwargs["function_arn"] = de.read_string( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["FunctionArn"] - ) - - case 2: - kwargs["runtime"] = Runtime( - de.read_string( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["Runtime"] - ) - ) - - case 3: - kwargs["role"] = de.read_string( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["Role"] - ) - - case 4: - kwargs["handler"] = de.read_string( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["Handler"] - ) - - case 5: - kwargs["code_size"] = de.read_long( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["CodeSize"] - ) - - case 6: - kwargs["description"] = de.read_string( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["Description"] - ) - - case 7: - kwargs["timeout"] = de.read_integer( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["Timeout"] - ) - - case 8: - kwargs["memory_size"] = de.read_integer( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["MemorySize"] - ) - - case 9: - kwargs["last_modified"] = de.read_string( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["LastModified"] - ) - - case 10: - kwargs["code_sha256"] = de.read_string( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["CodeSha256"] - ) - - case 11: - kwargs["version"] = de.read_string( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["Version"] - ) - - case 12: - kwargs["vpc_config"] = VpcConfigResponse.deserialize(de) - - case 13: - kwargs["dead_letter_config"] = DeadLetterConfig.deserialize(de) - - case 14: - kwargs["environment"] = EnvironmentResponse.deserialize(de) - - case 15: - kwargs["kms_key_arn"] = de.read_string( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["KMSKeyArn"] - ) - - case 16: - kwargs["tracing_config"] = TracingConfigResponse.deserialize(de) - - case 17: - kwargs["master_arn"] = de.read_string( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["MasterArn"] - ) - - case 18: - kwargs["revision_id"] = de.read_string( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["RevisionId"] - ) - - case 19: - kwargs["layers"] = _deserialize_layers_reference_list( - de, _SCHEMA_PUBLISH_VERSION_OUTPUT.members["Layers"] - ) - - case 20: - kwargs["state"] = State( - de.read_string(_SCHEMA_PUBLISH_VERSION_OUTPUT.members["State"]) - ) - - case 21: - kwargs["state_reason"] = de.read_string( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["StateReason"] - ) - - case 22: - kwargs["state_reason_code"] = StateReasonCode( - de.read_string( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["StateReasonCode"] - ) - ) - - case 23: - kwargs["last_update_status"] = LastUpdateStatus( - de.read_string( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["LastUpdateStatus"] - ) - ) - - case 24: - kwargs["last_update_status_reason"] = de.read_string( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["LastUpdateStatusReason"] - ) - - case 25: - kwargs["last_update_status_reason_code"] = ( - LastUpdateStatusReasonCode( - de.read_string( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members[ - "LastUpdateStatusReasonCode" - ] - ) - ) - ) - - case 26: - kwargs["file_system_configs"] = ( - _deserialize_file_system_config_list( - de, - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["FileSystemConfigs"], - ) - ) - - case 27: - kwargs["signing_profile_version_arn"] = de.read_string( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members[ - "SigningProfileVersionArn" - ] - ) - - case 28: - kwargs["signing_job_arn"] = de.read_string( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["SigningJobArn"] - ) - - case 29: - kwargs["package_type"] = PackageType( - de.read_string( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["PackageType"] - ) - ) - - case 30: - kwargs["image_config_response"] = ImageConfigResponse.deserialize( - de - ) - - case 31: - kwargs["architectures"] = _deserialize_architectures_list( - de, _SCHEMA_PUBLISH_VERSION_OUTPUT.members["Architectures"] - ) - - case 32: - kwargs["ephemeral_storage"] = EphemeralStorage.deserialize(de) - - case 33: - kwargs["snap_start"] = SnapStartResponse.deserialize(de) - - case 34: - kwargs["runtime_version_config"] = RuntimeVersionConfig.deserialize( - de - ) - - case 35: - kwargs["logging_config"] = LoggingConfig.deserialize(de) - - case 36: - kwargs["tenancy_config"] = TenancyConfig.deserialize(de) - - case 37: - kwargs["capacity_provider_config"] = ( - CapacityProviderConfig.deserialize(de) - ) - - case 38: - kwargs["config_sha256"] = de.read_string( - _SCHEMA_PUBLISH_VERSION_OUTPUT.members["ConfigSha256"] - ) - - case 39: - kwargs["durable_config"] = DurableConfig.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUBLISH_VERSION_OUTPUT, consumer=_consumer) - return kwargs - - -PUBLISH_VERSION = APIOperation( - input=PublishVersionInput, - output=PublishVersionOutput, - schema=_SCHEMA_PUBLISH_VERSION, - input_schema=_SCHEMA_PUBLISH_VERSION_INPUT, - output_schema=_SCHEMA_PUBLISH_VERSION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#CodeStorageExceededException" - ): CodeStorageExceededException, - ShapeID( - "com.amazonaws.lambda#FunctionVersionsPerCapacityProviderLimitExceededException" - ): FunctionVersionsPerCapacityProviderLimitExceededException, - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#PreconditionFailedException" - ): PreconditionFailedException, - ShapeID( - "com.amazonaws.lambda#ResourceConflictException" - ): ResourceConflictException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CODE_STORAGE_EXCEEDED_EXCEPTION, - _SCHEMA_FUNCTION_VERSIONS_PER_CAPACITY_PROVIDER_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_PRECONDITION_FAILED_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetAccountSettingsInput: - """Dataclass for GetAccountSettingsInput structure.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_ACCOUNT_SETTINGS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_ACCOUNT_SETTINGS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetAccountSettingsOutput: - """Dataclass for GetAccountSettingsOutput structure.""" - - account_limit: AccountLimit | None = None - """Limits that are related to concurrency and code storage.""" - - account_usage: AccountUsage | None = None - """The number of functions and amount of storage in use.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_ACCOUNT_SETTINGS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.account_limit is not None: - serializer.write_struct( - _SCHEMA_GET_ACCOUNT_SETTINGS_OUTPUT.members["AccountLimit"], - self.account_limit, - ) - - if self.account_usage is not None: - serializer.write_struct( - _SCHEMA_GET_ACCOUNT_SETTINGS_OUTPUT.members["AccountUsage"], - self.account_usage, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["account_limit"] = AccountLimit.deserialize(de) - - case 1: - kwargs["account_usage"] = AccountUsage.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_ACCOUNT_SETTINGS_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_ACCOUNT_SETTINGS = APIOperation( - input=GetAccountSettingsInput, - output=GetAccountSettingsOutput, - schema=_SCHEMA_GET_ACCOUNT_SETTINGS, - input_schema=_SCHEMA_GET_ACCOUNT_SETTINGS_INPUT, - output_schema=_SCHEMA_GET_ACCOUNT_SETTINGS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[_SCHEMA_SERVICE_EXCEPTION, _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION], -) - - -@dataclass(kw_only=True) -class GetFunctionEventInvokeConfigInput: - """Dataclass for GetFunctionEventInvokeConfigInput structure.""" - - function_name: str | None = None - """ - The name or ARN of the Lambda function, version, or alias. - - **Name formats** - - - **Function name** - `my-function` (name-only), `my-function:v1` (with - alias). - - - **Function ARN** - - `arn:aws:lambda:us-west-2:123456789012:function:my-function`. - - - **Partial ARN** - `123456789012:function:my-function`. - - You can append a version number or alias to any of the formats. The - length constraint applies only to the full ARN. If you specify only the - function name, it is limited to 64 characters in length. - """ - - qualifier: str | None = None - """A version number or alias name.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_FUNCTION_EVENT_INVOKE_CONFIG_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_GET_FUNCTION_EVENT_INVOKE_CONFIG_INPUT.members["FunctionName"], - self.function_name, - ) - - if self.qualifier is not None: - serializer.write_string( - _SCHEMA_GET_FUNCTION_EVENT_INVOKE_CONFIG_INPUT.members["Qualifier"], - self.qualifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_GET_FUNCTION_EVENT_INVOKE_CONFIG_INPUT.members[ - "FunctionName" - ] - ) - - case 1: - kwargs["qualifier"] = de.read_string( - _SCHEMA_GET_FUNCTION_EVENT_INVOKE_CONFIG_INPUT.members[ - "Qualifier" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_FUNCTION_EVENT_INVOKE_CONFIG_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetFunctionEventInvokeConfigOutput: - """Dataclass for GetFunctionEventInvokeConfigOutput structure.""" - - last_modified: datetime | None = None - """The date and time that the configuration was last updated.""" - - function_arn: str | None = None - """The Amazon Resource Name (ARN) of the function.""" - - maximum_retry_attempts: int | None = None - """The maximum number of times to retry when the function returns an error.""" - - maximum_event_age_in_seconds: int | None = None - """ - The maximum age of a request that Lambda sends to a function for - processing. - """ - - destination_config: DestinationConfig | None = None - """ - A destination for events after they have been sent to a function for - processing. - - **Destinations** - - - **Function** - The Amazon Resource Name (ARN) of a Lambda function. - - - **Queue** - The ARN of a standard SQS queue. - - - **Bucket** - The ARN of an Amazon S3 bucket. - - - **Topic** - The ARN of a standard SNS topic. - - - **Event Bus** - The ARN of an Amazon EventBridge event bus. - - Note: - S3 buckets are supported only for on-failure destinations. To retain - records of successful invocations, use another destination type. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.last_modified is not None: - serializer.write_timestamp( - _SCHEMA_GET_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT.members["LastModified"], - self.last_modified, - ) - - if self.function_arn is not None: - serializer.write_string( - _SCHEMA_GET_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT.members["FunctionArn"], - self.function_arn, - ) - - if self.maximum_retry_attempts is not None: - serializer.write_integer( - _SCHEMA_GET_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT.members[ - "MaximumRetryAttempts" - ], - self.maximum_retry_attempts, - ) - - if self.maximum_event_age_in_seconds is not None: - serializer.write_integer( - _SCHEMA_GET_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT.members[ - "MaximumEventAgeInSeconds" - ], - self.maximum_event_age_in_seconds, - ) - - if self.destination_config is not None: - serializer.write_struct( - _SCHEMA_GET_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT.members[ - "DestinationConfig" - ], - self.destination_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["last_modified"] = de.read_timestamp( - _SCHEMA_GET_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT.members[ - "LastModified" - ] - ) - - case 1: - kwargs["function_arn"] = de.read_string( - _SCHEMA_GET_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT.members[ - "FunctionArn" - ] - ) - - case 2: - kwargs["maximum_retry_attempts"] = de.read_integer( - _SCHEMA_GET_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT.members[ - "MaximumRetryAttempts" - ] - ) - - case 3: - kwargs["maximum_event_age_in_seconds"] = de.read_integer( - _SCHEMA_GET_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT.members[ - "MaximumEventAgeInSeconds" - ] - ) - - case 4: - kwargs["destination_config"] = DestinationConfig.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_FUNCTION_EVENT_INVOKE_CONFIG = APIOperation( - input=GetFunctionEventInvokeConfigInput, - output=GetFunctionEventInvokeConfigOutput, - schema=_SCHEMA_GET_FUNCTION_EVENT_INVOKE_CONFIG, - input_schema=_SCHEMA_GET_FUNCTION_EVENT_INVOKE_CONFIG_INPUT, - output_schema=_SCHEMA_GET_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetResourcePolicyInput: - """Dataclass for GetResourcePolicyInput structure.""" - - resource_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the Lambda resource you want to - retrieve the policy for. You can use a qualified or an unqualified ARN. - The value must be a complete ARN, and the operation does not accept - wildcard characters. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_RESOURCE_POLICY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_GET_RESOURCE_POLICY_INPUT.members["ResourceArn"], - self.resource_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_GET_RESOURCE_POLICY_INPUT.members["ResourceArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_RESOURCE_POLICY_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetResourcePolicyOutput: - """Dataclass for GetResourcePolicyOutput structure.""" - - policy: str | None = None - """The resource-based policy attached to the Lambda resource you specified.""" - - revision_id: str | None = None - """ - The revision ID of the policy. Pass this value as the `RevisionId` in a - PutResourcePolicy or DeleteResourcePolicy request. Doing so ensures the - operation acts on the expected version of the policy. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_RESOURCE_POLICY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.policy is not None: - serializer.write_string( - _SCHEMA_GET_RESOURCE_POLICY_OUTPUT.members["Policy"], self.policy - ) - - if self.revision_id is not None: - serializer.write_string( - _SCHEMA_GET_RESOURCE_POLICY_OUTPUT.members["RevisionId"], - self.revision_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy"] = de.read_string( - _SCHEMA_GET_RESOURCE_POLICY_OUTPUT.members["Policy"] - ) - - case 1: - kwargs["revision_id"] = de.read_string( - _SCHEMA_GET_RESOURCE_POLICY_OUTPUT.members["RevisionId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_RESOURCE_POLICY_OUTPUT, consumer=_consumer) - return kwargs - - -GET_RESOURCE_POLICY = APIOperation( - input=GetResourcePolicyInput, - output=GetResourcePolicyOutput, - schema=_SCHEMA_GET_RESOURCE_POLICY, - input_schema=_SCHEMA_GET_RESOURCE_POLICY_INPUT, - output_schema=_SCHEMA_GET_RESOURCE_POLICY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListLayersInput: - """Dataclass for ListLayersInput structure.""" - - compatible_architecture: str | None = None - """ - The compatible [instruction set - architecture](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html). - """ - - compatible_runtime: str | None = None - """ - A runtime identifier. - - The following list includes deprecated runtimes. For more information, - see [Runtime use after - deprecation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-deprecation-levels). - - For a list of all currently supported runtimes, see [Supported - runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtimes-supported). - """ - - marker: str | None = None - """A pagination token returned by a previous call.""" - - max_items: int | None = None - """The maximum number of layers to return.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_LAYERS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.compatible_architecture is not None: - serializer.write_string( - _SCHEMA_LIST_LAYERS_INPUT.members["CompatibleArchitecture"], - self.compatible_architecture, - ) - - if self.compatible_runtime is not None: - serializer.write_string( - _SCHEMA_LIST_LAYERS_INPUT.members["CompatibleRuntime"], - self.compatible_runtime, - ) - - if self.marker is not None: - serializer.write_string( - _SCHEMA_LIST_LAYERS_INPUT.members["Marker"], self.marker - ) - - if self.max_items is not None: - serializer.write_integer( - _SCHEMA_LIST_LAYERS_INPUT.members["MaxItems"], self.max_items - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["compatible_architecture"] = Architecture( - de.read_string( - _SCHEMA_LIST_LAYERS_INPUT.members["CompatibleArchitecture"] - ) - ) - - case 1: - kwargs["compatible_runtime"] = Runtime( - de.read_string( - _SCHEMA_LIST_LAYERS_INPUT.members["CompatibleRuntime"] - ) - ) - - case 2: - kwargs["marker"] = de.read_string( - _SCHEMA_LIST_LAYERS_INPUT.members["Marker"] - ) - - case 3: - kwargs["max_items"] = de.read_integer( - _SCHEMA_LIST_LAYERS_INPUT.members["MaxItems"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_LAYERS_INPUT, consumer=_consumer) - return kwargs - - -def _serialize_compatible_architectures( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_compatible_architectures( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Architecture(d.read_string(member_schema))) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_compatible_runtimes( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_compatible_runtimes( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Runtime(d.read_string(member_schema))) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class LayerVersionsListItem: - """ - Details about a version of an [Lambda - layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html). - """ - - layer_version_arn: str | None = None - """The ARN of the layer version.""" - - version: int = 0 - """The version number.""" - - description: str | None = None - """The description of the version.""" - - created_date: str | None = None - """ - The date that the version was created, in ISO 8601 format. For example, - `2018-11-27T15:10:45.123+0000`. - """ - - compatible_architectures: list[str] | None = None - """ - A list of compatible [instruction set - architectures](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html). - """ - - compatible_runtimes: list[str] | None = None - """ - The layer's compatible runtimes. - - The following list includes deprecated runtimes. For more information, - see [Runtime use after - deprecation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-deprecation-levels). - - For a list of all currently supported runtimes, see [Supported - runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtimes-supported). - """ - - license_info: str | None = None - """The layer's open-source license.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LAYER_VERSIONS_LIST_ITEM, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.layer_version_arn is not None: - serializer.write_string( - _SCHEMA_LAYER_VERSIONS_LIST_ITEM.members["LayerVersionArn"], - self.layer_version_arn, - ) - - serializer.write_long( - _SCHEMA_LAYER_VERSIONS_LIST_ITEM.members["Version"], self.version - ) - if self.description is not None: - serializer.write_string( - _SCHEMA_LAYER_VERSIONS_LIST_ITEM.members["Description"], - self.description, - ) - - if self.created_date is not None: - serializer.write_string( - _SCHEMA_LAYER_VERSIONS_LIST_ITEM.members["CreatedDate"], - self.created_date, - ) - - if self.compatible_architectures is not None: - _serialize_compatible_architectures( - serializer, - _SCHEMA_LAYER_VERSIONS_LIST_ITEM.members["CompatibleArchitectures"], - self.compatible_architectures, - ) - - if self.compatible_runtimes is not None: - _serialize_compatible_runtimes( - serializer, - _SCHEMA_LAYER_VERSIONS_LIST_ITEM.members["CompatibleRuntimes"], - self.compatible_runtimes, - ) - - if self.license_info is not None: - serializer.write_string( - _SCHEMA_LAYER_VERSIONS_LIST_ITEM.members["LicenseInfo"], - self.license_info, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["layer_version_arn"] = de.read_string( - _SCHEMA_LAYER_VERSIONS_LIST_ITEM.members["LayerVersionArn"] - ) - - case 1: - kwargs["version"] = de.read_long( - _SCHEMA_LAYER_VERSIONS_LIST_ITEM.members["Version"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_LAYER_VERSIONS_LIST_ITEM.members["Description"] - ) - - case 3: - kwargs["created_date"] = de.read_string( - _SCHEMA_LAYER_VERSIONS_LIST_ITEM.members["CreatedDate"] - ) - - case 4: - kwargs["compatible_architectures"] = ( - _deserialize_compatible_architectures( - de, - _SCHEMA_LAYER_VERSIONS_LIST_ITEM.members[ - "CompatibleArchitectures" - ], - ) - ) - - case 5: - kwargs["compatible_runtimes"] = _deserialize_compatible_runtimes( - de, - _SCHEMA_LAYER_VERSIONS_LIST_ITEM.members["CompatibleRuntimes"], - ) - - case 6: - kwargs["license_info"] = de.read_string( - _SCHEMA_LAYER_VERSIONS_LIST_ITEM.members["LicenseInfo"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LAYER_VERSIONS_LIST_ITEM, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class LayersListItem: - """ - Details about an [Lambda - layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html). - """ - - layer_name: str | None = None - """The name of the layer.""" - - layer_arn: str | None = None - """The Amazon Resource Name (ARN) of the function layer.""" - - latest_matching_version: LayerVersionsListItem | None = None - """The newest version of the layer.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LAYERS_LIST_ITEM, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.layer_name is not None: - serializer.write_string( - _SCHEMA_LAYERS_LIST_ITEM.members["LayerName"], self.layer_name - ) - - if self.layer_arn is not None: - serializer.write_string( - _SCHEMA_LAYERS_LIST_ITEM.members["LayerArn"], self.layer_arn - ) - - if self.latest_matching_version is not None: - serializer.write_struct( - _SCHEMA_LAYERS_LIST_ITEM.members["LatestMatchingVersion"], - self.latest_matching_version, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["layer_name"] = de.read_string( - _SCHEMA_LAYERS_LIST_ITEM.members["LayerName"] - ) - - case 1: - kwargs["layer_arn"] = de.read_string( - _SCHEMA_LAYERS_LIST_ITEM.members["LayerArn"] - ) - - case 2: - kwargs["latest_matching_version"] = ( - LayerVersionsListItem.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LAYERS_LIST_ITEM, consumer=_consumer) - return kwargs - - -def _serialize_layers_list( - serializer: ShapeSerializer, schema: Schema, value: list[LayersListItem] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_layers_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[LayersListItem]: - result: list[LayersListItem] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(LayersListItem.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListLayersOutput: - """Dataclass for ListLayersOutput structure.""" - - next_marker: str | None = None - """ - A pagination token returned when the response doesn't contain all - layers. - """ - - layers: list[LayersListItem] | None = None - """A list of function layers.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_LAYERS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_marker is not None: - serializer.write_string( - _SCHEMA_LIST_LAYERS_OUTPUT.members["NextMarker"], self.next_marker - ) - - if self.layers is not None: - _serialize_layers_list( - serializer, _SCHEMA_LIST_LAYERS_OUTPUT.members["Layers"], self.layers - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_marker"] = de.read_string( - _SCHEMA_LIST_LAYERS_OUTPUT.members["NextMarker"] - ) - - case 1: - kwargs["layers"] = _deserialize_layers_list( - de, _SCHEMA_LIST_LAYERS_OUTPUT.members["Layers"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_LAYERS_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_LAYERS = APIOperation( - input=ListLayersInput, - output=ListLayersOutput, - schema=_SCHEMA_LIST_LAYERS, - input_schema=_SCHEMA_LIST_LAYERS_INPUT, - output_schema=_SCHEMA_LIST_LAYERS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteLayerVersionInput: - """Dataclass for DeleteLayerVersionInput structure.""" - - layer_name: str | None = None - """The name or Amazon Resource Name (ARN) of the layer.""" - - version_number: int | None = None - """The version number.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_LAYER_VERSION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.layer_name is not None: - serializer.write_string( - _SCHEMA_DELETE_LAYER_VERSION_INPUT.members["LayerName"], self.layer_name - ) - - if self.version_number is not None: - serializer.write_long( - _SCHEMA_DELETE_LAYER_VERSION_INPUT.members["VersionNumber"], - self.version_number, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["layer_name"] = de.read_string( - _SCHEMA_DELETE_LAYER_VERSION_INPUT.members["LayerName"] - ) - - case 1: - kwargs["version_number"] = de.read_long( - _SCHEMA_DELETE_LAYER_VERSION_INPUT.members["VersionNumber"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_LAYER_VERSION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteLayerVersionOutput: - """Dataclass for DeleteLayerVersionOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_LAYER_VERSION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_LAYER_VERSION_OUTPUT, consumer=_consumer - ) - return kwargs - - -DELETE_LAYER_VERSION = APIOperation( - input=DeleteLayerVersionInput, - output=DeleteLayerVersionOutput, - schema=_SCHEMA_DELETE_LAYER_VERSION, - input_schema=_SCHEMA_DELETE_LAYER_VERSION_INPUT, - output_schema=_SCHEMA_DELETE_LAYER_VERSION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetLayerVersionInput: - """Dataclass for GetLayerVersionInput structure.""" - - layer_name: str | None = None - """The name or Amazon Resource Name (ARN) of the layer.""" - - version_number: int | None = None - """The version number.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_LAYER_VERSION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.layer_name is not None: - serializer.write_string( - _SCHEMA_GET_LAYER_VERSION_INPUT.members["LayerName"], self.layer_name - ) - - if self.version_number is not None: - serializer.write_long( - _SCHEMA_GET_LAYER_VERSION_INPUT.members["VersionNumber"], - self.version_number, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["layer_name"] = de.read_string( - _SCHEMA_GET_LAYER_VERSION_INPUT.members["LayerName"] - ) - - case 1: - kwargs["version_number"] = de.read_long( - _SCHEMA_GET_LAYER_VERSION_INPUT.members["VersionNumber"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_LAYER_VERSION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class LayerVersionContentOutput: - """ - Details about a version of an [Lambda - layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html). - """ - - location: str | None = None - """A link to the layer archive in Amazon S3 that is valid for 10 minutes.""" - - code_sha256: str | None = None - """The SHA-256 hash of the layer archive.""" - - code_size: int = 0 - """The size of the layer archive in bytes.""" - - signing_profile_version_arn: str | None = None - """The Amazon Resource Name (ARN) for a signing profile version.""" - - signing_job_arn: str | None = None - """The Amazon Resource Name (ARN) of a signing job.""" - - resolved_s3_object: ResolvedS3Object | None = None - """The resolved Amazon S3 object that contains the layer archive.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LAYER_VERSION_CONTENT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.location is not None: - serializer.write_string( - _SCHEMA_LAYER_VERSION_CONTENT_OUTPUT.members["Location"], self.location - ) - - if self.code_sha256 is not None: - serializer.write_string( - _SCHEMA_LAYER_VERSION_CONTENT_OUTPUT.members["CodeSha256"], - self.code_sha256, - ) - - serializer.write_long( - _SCHEMA_LAYER_VERSION_CONTENT_OUTPUT.members["CodeSize"], self.code_size - ) - if self.signing_profile_version_arn is not None: - serializer.write_string( - _SCHEMA_LAYER_VERSION_CONTENT_OUTPUT.members[ - "SigningProfileVersionArn" - ], - self.signing_profile_version_arn, - ) - - if self.signing_job_arn is not None: - serializer.write_string( - _SCHEMA_LAYER_VERSION_CONTENT_OUTPUT.members["SigningJobArn"], - self.signing_job_arn, - ) - - if self.resolved_s3_object is not None: - serializer.write_struct( - _SCHEMA_LAYER_VERSION_CONTENT_OUTPUT.members["ResolvedS3Object"], - self.resolved_s3_object, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["location"] = de.read_string( - _SCHEMA_LAYER_VERSION_CONTENT_OUTPUT.members["Location"] - ) - - case 1: - kwargs["code_sha256"] = de.read_string( - _SCHEMA_LAYER_VERSION_CONTENT_OUTPUT.members["CodeSha256"] - ) - - case 2: - kwargs["code_size"] = de.read_long( - _SCHEMA_LAYER_VERSION_CONTENT_OUTPUT.members["CodeSize"] - ) - - case 3: - kwargs["signing_profile_version_arn"] = de.read_string( - _SCHEMA_LAYER_VERSION_CONTENT_OUTPUT.members[ - "SigningProfileVersionArn" - ] - ) - - case 4: - kwargs["signing_job_arn"] = de.read_string( - _SCHEMA_LAYER_VERSION_CONTENT_OUTPUT.members["SigningJobArn"] - ) - - case 5: - kwargs["resolved_s3_object"] = ResolvedS3Object.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LAYER_VERSION_CONTENT_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetLayerVersionOutput: - """Dataclass for GetLayerVersionOutput structure.""" - - content: LayerVersionContentOutput | None = None - """Details about the layer version.""" - - layer_arn: str | None = None - """The ARN of the layer.""" - - layer_version_arn: str | None = None - """The ARN of the layer version.""" - - description: str | None = None - """The description of the version.""" - - created_date: str | None = None - """ - The date that the layer version was created, in [ISO-8601 - format](https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). - """ - - version: int = 0 - """The version number.""" - - compatible_architectures: list[str] | None = None - """ - A list of compatible [instruction set - architectures](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html). - """ - - compatible_runtimes: list[str] | None = None - """ - The layer's compatible runtimes. - - The following list includes deprecated runtimes. For more information, - see [Runtime use after - deprecation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-deprecation-levels). - - For a list of all currently supported runtimes, see [Supported - runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtimes-supported). - """ - - license_info: str | None = None - """The layer's software license.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_LAYER_VERSION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.content is not None: - serializer.write_struct( - _SCHEMA_GET_LAYER_VERSION_OUTPUT.members["Content"], self.content - ) - - if self.layer_arn is not None: - serializer.write_string( - _SCHEMA_GET_LAYER_VERSION_OUTPUT.members["LayerArn"], self.layer_arn - ) - - if self.layer_version_arn is not None: - serializer.write_string( - _SCHEMA_GET_LAYER_VERSION_OUTPUT.members["LayerVersionArn"], - self.layer_version_arn, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_LAYER_VERSION_OUTPUT.members["Description"], - self.description, - ) - - if self.created_date is not None: - serializer.write_string( - _SCHEMA_GET_LAYER_VERSION_OUTPUT.members["CreatedDate"], - self.created_date, - ) - - serializer.write_long( - _SCHEMA_GET_LAYER_VERSION_OUTPUT.members["Version"], self.version - ) - if self.compatible_architectures is not None: - _serialize_compatible_architectures( - serializer, - _SCHEMA_GET_LAYER_VERSION_OUTPUT.members["CompatibleArchitectures"], - self.compatible_architectures, - ) - - if self.compatible_runtimes is not None: - _serialize_compatible_runtimes( - serializer, - _SCHEMA_GET_LAYER_VERSION_OUTPUT.members["CompatibleRuntimes"], - self.compatible_runtimes, - ) - - if self.license_info is not None: - serializer.write_string( - _SCHEMA_GET_LAYER_VERSION_OUTPUT.members["LicenseInfo"], - self.license_info, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["content"] = LayerVersionContentOutput.deserialize(de) - - case 1: - kwargs["layer_arn"] = de.read_string( - _SCHEMA_GET_LAYER_VERSION_OUTPUT.members["LayerArn"] - ) - - case 2: - kwargs["layer_version_arn"] = de.read_string( - _SCHEMA_GET_LAYER_VERSION_OUTPUT.members["LayerVersionArn"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_GET_LAYER_VERSION_OUTPUT.members["Description"] - ) - - case 4: - kwargs["created_date"] = de.read_string( - _SCHEMA_GET_LAYER_VERSION_OUTPUT.members["CreatedDate"] - ) - - case 5: - kwargs["version"] = de.read_long( - _SCHEMA_GET_LAYER_VERSION_OUTPUT.members["Version"] - ) - - case 6: - kwargs["compatible_architectures"] = ( - _deserialize_compatible_architectures( - de, - _SCHEMA_GET_LAYER_VERSION_OUTPUT.members[ - "CompatibleArchitectures" - ], - ) - ) - - case 7: - kwargs["compatible_runtimes"] = _deserialize_compatible_runtimes( - de, - _SCHEMA_GET_LAYER_VERSION_OUTPUT.members["CompatibleRuntimes"], - ) - - case 8: - kwargs["license_info"] = de.read_string( - _SCHEMA_GET_LAYER_VERSION_OUTPUT.members["LicenseInfo"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_LAYER_VERSION_OUTPUT, consumer=_consumer) - return kwargs - - -GET_LAYER_VERSION = APIOperation( - input=GetLayerVersionInput, - output=GetLayerVersionOutput, - schema=_SCHEMA_GET_LAYER_VERSION, - input_schema=_SCHEMA_GET_LAYER_VERSION_INPUT, - output_schema=_SCHEMA_GET_LAYER_VERSION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetLayerVersionByArnInput: - """Dataclass for GetLayerVersionByArnInput structure.""" - - arn: str | None = None - """The ARN of the layer version.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_LAYER_VERSION_BY_ARN_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.arn is not None: - serializer.write_string( - _SCHEMA_GET_LAYER_VERSION_BY_ARN_INPUT.members["Arn"], self.arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["arn"] = de.read_string( - _SCHEMA_GET_LAYER_VERSION_BY_ARN_INPUT.members["Arn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_LAYER_VERSION_BY_ARN_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetLayerVersionByArnOutput: - """Dataclass for GetLayerVersionByArnOutput structure.""" - - content: LayerVersionContentOutput | None = None - """Details about the layer version.""" - - layer_arn: str | None = None - """The ARN of the layer.""" - - layer_version_arn: str | None = None - """The ARN of the layer version.""" - - description: str | None = None - """The description of the version.""" - - created_date: str | None = None - """ - The date that the layer version was created, in [ISO-8601 - format](https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). - """ - - version: int = 0 - """The version number.""" - - compatible_architectures: list[str] | None = None - """ - A list of compatible [instruction set - architectures](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html). - """ - - compatible_runtimes: list[str] | None = None - """ - The layer's compatible runtimes. - - The following list includes deprecated runtimes. For more information, - see [Runtime use after - deprecation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-deprecation-levels). - - For a list of all currently supported runtimes, see [Supported - runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtimes-supported). - """ - - license_info: str | None = None - """The layer's software license.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_LAYER_VERSION_BY_ARN_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.content is not None: - serializer.write_struct( - _SCHEMA_GET_LAYER_VERSION_BY_ARN_OUTPUT.members["Content"], self.content - ) - - if self.layer_arn is not None: - serializer.write_string( - _SCHEMA_GET_LAYER_VERSION_BY_ARN_OUTPUT.members["LayerArn"], - self.layer_arn, - ) - - if self.layer_version_arn is not None: - serializer.write_string( - _SCHEMA_GET_LAYER_VERSION_BY_ARN_OUTPUT.members["LayerVersionArn"], - self.layer_version_arn, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_LAYER_VERSION_BY_ARN_OUTPUT.members["Description"], - self.description, - ) - - if self.created_date is not None: - serializer.write_string( - _SCHEMA_GET_LAYER_VERSION_BY_ARN_OUTPUT.members["CreatedDate"], - self.created_date, - ) - - serializer.write_long( - _SCHEMA_GET_LAYER_VERSION_BY_ARN_OUTPUT.members["Version"], self.version - ) - if self.compatible_architectures is not None: - _serialize_compatible_architectures( - serializer, - _SCHEMA_GET_LAYER_VERSION_BY_ARN_OUTPUT.members[ - "CompatibleArchitectures" - ], - self.compatible_architectures, - ) - - if self.compatible_runtimes is not None: - _serialize_compatible_runtimes( - serializer, - _SCHEMA_GET_LAYER_VERSION_BY_ARN_OUTPUT.members["CompatibleRuntimes"], - self.compatible_runtimes, - ) - - if self.license_info is not None: - serializer.write_string( - _SCHEMA_GET_LAYER_VERSION_BY_ARN_OUTPUT.members["LicenseInfo"], - self.license_info, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["content"] = LayerVersionContentOutput.deserialize(de) - - case 1: - kwargs["layer_arn"] = de.read_string( - _SCHEMA_GET_LAYER_VERSION_BY_ARN_OUTPUT.members["LayerArn"] - ) - - case 2: - kwargs["layer_version_arn"] = de.read_string( - _SCHEMA_GET_LAYER_VERSION_BY_ARN_OUTPUT.members[ - "LayerVersionArn" - ] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_GET_LAYER_VERSION_BY_ARN_OUTPUT.members["Description"] - ) - - case 4: - kwargs["created_date"] = de.read_string( - _SCHEMA_GET_LAYER_VERSION_BY_ARN_OUTPUT.members["CreatedDate"] - ) - - case 5: - kwargs["version"] = de.read_long( - _SCHEMA_GET_LAYER_VERSION_BY_ARN_OUTPUT.members["Version"] - ) - - case 6: - kwargs["compatible_architectures"] = ( - _deserialize_compatible_architectures( - de, - _SCHEMA_GET_LAYER_VERSION_BY_ARN_OUTPUT.members[ - "CompatibleArchitectures" - ], - ) - ) - - case 7: - kwargs["compatible_runtimes"] = _deserialize_compatible_runtimes( - de, - _SCHEMA_GET_LAYER_VERSION_BY_ARN_OUTPUT.members[ - "CompatibleRuntimes" - ], - ) - - case 8: - kwargs["license_info"] = de.read_string( - _SCHEMA_GET_LAYER_VERSION_BY_ARN_OUTPUT.members["LicenseInfo"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_LAYER_VERSION_BY_ARN_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_LAYER_VERSION_BY_ARN = APIOperation( - input=GetLayerVersionByArnInput, - output=GetLayerVersionByArnOutput, - schema=_SCHEMA_GET_LAYER_VERSION_BY_ARN, - input_schema=_SCHEMA_GET_LAYER_VERSION_BY_ARN_INPUT, - output_schema=_SCHEMA_GET_LAYER_VERSION_BY_ARN_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetLayerVersionPolicyInput: - """Dataclass for GetLayerVersionPolicyInput structure.""" - - layer_name: str | None = None - """The name or Amazon Resource Name (ARN) of the layer.""" - - version_number: int | None = None - """The version number.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_LAYER_VERSION_POLICY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.layer_name is not None: - serializer.write_string( - _SCHEMA_GET_LAYER_VERSION_POLICY_INPUT.members["LayerName"], - self.layer_name, - ) - - if self.version_number is not None: - serializer.write_long( - _SCHEMA_GET_LAYER_VERSION_POLICY_INPUT.members["VersionNumber"], - self.version_number, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["layer_name"] = de.read_string( - _SCHEMA_GET_LAYER_VERSION_POLICY_INPUT.members["LayerName"] - ) - - case 1: - kwargs["version_number"] = de.read_long( - _SCHEMA_GET_LAYER_VERSION_POLICY_INPUT.members["VersionNumber"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_LAYER_VERSION_POLICY_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetLayerVersionPolicyOutput: - """Dataclass for GetLayerVersionPolicyOutput structure.""" - - policy: str | None = None - """The policy document.""" - - revision_id: str | None = None - """A unique identifier for the current revision of the policy.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_LAYER_VERSION_POLICY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.policy is not None: - serializer.write_string( - _SCHEMA_GET_LAYER_VERSION_POLICY_OUTPUT.members["Policy"], self.policy - ) - - if self.revision_id is not None: - serializer.write_string( - _SCHEMA_GET_LAYER_VERSION_POLICY_OUTPUT.members["RevisionId"], - self.revision_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy"] = de.read_string( - _SCHEMA_GET_LAYER_VERSION_POLICY_OUTPUT.members["Policy"] - ) - - case 1: - kwargs["revision_id"] = de.read_string( - _SCHEMA_GET_LAYER_VERSION_POLICY_OUTPUT.members["RevisionId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_LAYER_VERSION_POLICY_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_LAYER_VERSION_POLICY = APIOperation( - input=GetLayerVersionPolicyInput, - output=GetLayerVersionPolicyOutput, - schema=_SCHEMA_GET_LAYER_VERSION_POLICY, - input_schema=_SCHEMA_GET_LAYER_VERSION_POLICY_INPUT, - output_schema=_SCHEMA_GET_LAYER_VERSION_POLICY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListLayerVersionsInput: - """Dataclass for ListLayerVersionsInput structure.""" - - compatible_architecture: str | None = None - """ - The compatible [instruction set - architecture](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html). - """ - - compatible_runtime: str | None = None - """ - A runtime identifier. - - The following list includes deprecated runtimes. For more information, - see [Runtime use after - deprecation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-deprecation-levels). - - For a list of all currently supported runtimes, see [Supported - runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtimes-supported). - """ - - layer_name: str | None = None - """The name or Amazon Resource Name (ARN) of the layer.""" - - marker: str | None = None - """A pagination token returned by a previous call.""" - - max_items: int | None = None - """The maximum number of versions to return.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_LAYER_VERSIONS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.compatible_architecture is not None: - serializer.write_string( - _SCHEMA_LIST_LAYER_VERSIONS_INPUT.members["CompatibleArchitecture"], - self.compatible_architecture, - ) - - if self.compatible_runtime is not None: - serializer.write_string( - _SCHEMA_LIST_LAYER_VERSIONS_INPUT.members["CompatibleRuntime"], - self.compatible_runtime, - ) - - if self.layer_name is not None: - serializer.write_string( - _SCHEMA_LIST_LAYER_VERSIONS_INPUT.members["LayerName"], self.layer_name - ) - - if self.marker is not None: - serializer.write_string( - _SCHEMA_LIST_LAYER_VERSIONS_INPUT.members["Marker"], self.marker - ) - - if self.max_items is not None: - serializer.write_integer( - _SCHEMA_LIST_LAYER_VERSIONS_INPUT.members["MaxItems"], self.max_items - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["compatible_architecture"] = Architecture( - de.read_string( - _SCHEMA_LIST_LAYER_VERSIONS_INPUT.members[ - "CompatibleArchitecture" - ] - ) - ) - - case 1: - kwargs["compatible_runtime"] = Runtime( - de.read_string( - _SCHEMA_LIST_LAYER_VERSIONS_INPUT.members[ - "CompatibleRuntime" - ] - ) - ) - - case 2: - kwargs["layer_name"] = de.read_string( - _SCHEMA_LIST_LAYER_VERSIONS_INPUT.members["LayerName"] - ) - - case 3: - kwargs["marker"] = de.read_string( - _SCHEMA_LIST_LAYER_VERSIONS_INPUT.members["Marker"] - ) - - case 4: - kwargs["max_items"] = de.read_integer( - _SCHEMA_LIST_LAYER_VERSIONS_INPUT.members["MaxItems"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_LAYER_VERSIONS_INPUT, consumer=_consumer) - return kwargs - - -def _serialize_layer_versions_list( - serializer: ShapeSerializer, schema: Schema, value: list[LayerVersionsListItem] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_layer_versions_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[LayerVersionsListItem]: - result: list[LayerVersionsListItem] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(LayerVersionsListItem.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListLayerVersionsOutput: - """Dataclass for ListLayerVersionsOutput structure.""" - - next_marker: str | None = None - """ - A pagination token returned when the response doesn't contain all - versions. - """ - - layer_versions: list[LayerVersionsListItem] | None = None - """A list of versions.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_LAYER_VERSIONS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_marker is not None: - serializer.write_string( - _SCHEMA_LIST_LAYER_VERSIONS_OUTPUT.members["NextMarker"], - self.next_marker, - ) - - if self.layer_versions is not None: - _serialize_layer_versions_list( - serializer, - _SCHEMA_LIST_LAYER_VERSIONS_OUTPUT.members["LayerVersions"], - self.layer_versions, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_marker"] = de.read_string( - _SCHEMA_LIST_LAYER_VERSIONS_OUTPUT.members["NextMarker"] - ) - - case 1: - kwargs["layer_versions"] = _deserialize_layer_versions_list( - de, _SCHEMA_LIST_LAYER_VERSIONS_OUTPUT.members["LayerVersions"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_LAYER_VERSIONS_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_LAYER_VERSIONS = APIOperation( - input=ListLayerVersionsInput, - output=ListLayerVersionsOutput, - schema=_SCHEMA_LIST_LAYER_VERSIONS, - input_schema=_SCHEMA_LIST_LAYER_VERSIONS_INPUT, - output_schema=_SCHEMA_LIST_LAYER_VERSIONS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class LayerVersionContentInput: - """ - A ZIP archive that contains the contents of an [Lambda - layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html). - You can specify either an Amazon S3 location, or upload a layer archive - directly. - """ - - s3_bucket: str | None = None - """The Amazon S3 bucket of the layer archive.""" - - s3_key: str | None = None - """The Amazon S3 key of the layer archive.""" - - s3_object_version: str | None = None - """For versioned objects, the version of the layer archive object to use.""" - - s3_object_storage_mode: str | None = None - """ - Specifies how the layer archive is stored. Valid values: - - - `COPY` (default) -- Uploads a copy of your layer archive to Lambda. - - - `REFERENCE` -- Lambda references the layer archive from the specified - Amazon S3 bucket. - """ - - zip_file: bytes | None = field(repr=False, default=None) - """ - The base64-encoded contents of the layer archive. Amazon Web Services - SDK and Amazon Web Services CLI clients handle the encoding for you. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LAYER_VERSION_CONTENT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.s3_bucket is not None: - serializer.write_string( - _SCHEMA_LAYER_VERSION_CONTENT_INPUT.members["S3Bucket"], self.s3_bucket - ) - - if self.s3_key is not None: - serializer.write_string( - _SCHEMA_LAYER_VERSION_CONTENT_INPUT.members["S3Key"], self.s3_key - ) - - if self.s3_object_version is not None: - serializer.write_string( - _SCHEMA_LAYER_VERSION_CONTENT_INPUT.members["S3ObjectVersion"], - self.s3_object_version, - ) - - if self.s3_object_storage_mode is not None: - serializer.write_string( - _SCHEMA_LAYER_VERSION_CONTENT_INPUT.members["S3ObjectStorageMode"], - self.s3_object_storage_mode, - ) - - if self.zip_file is not None: - serializer.write_blob( - _SCHEMA_LAYER_VERSION_CONTENT_INPUT.members["ZipFile"], self.zip_file - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["s3_bucket"] = de.read_string( - _SCHEMA_LAYER_VERSION_CONTENT_INPUT.members["S3Bucket"] - ) - - case 1: - kwargs["s3_key"] = de.read_string( - _SCHEMA_LAYER_VERSION_CONTENT_INPUT.members["S3Key"] - ) - - case 2: - kwargs["s3_object_version"] = de.read_string( - _SCHEMA_LAYER_VERSION_CONTENT_INPUT.members["S3ObjectVersion"] - ) - - case 3: - kwargs["s3_object_storage_mode"] = S3ObjectStorageMode( - de.read_string( - _SCHEMA_LAYER_VERSION_CONTENT_INPUT.members[ - "S3ObjectStorageMode" - ] - ) - ) - - case 4: - kwargs["zip_file"] = de.read_blob( - _SCHEMA_LAYER_VERSION_CONTENT_INPUT.members["ZipFile"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LAYER_VERSION_CONTENT_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class PublishLayerVersionInput: - """Dataclass for PublishLayerVersionInput structure.""" - - layer_name: str | None = None - """The name or Amazon Resource Name (ARN) of the layer.""" - - description: str | None = None - """The description of the version.""" - - content: LayerVersionContentInput | None = None - """The function layer archive.""" - - compatible_architectures: list[str] | None = None - """ - A list of compatible [instruction set - architectures](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html). - """ - - compatible_runtimes: list[str] | None = None - """ - A list of compatible [function - runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html). - Used for filtering with ListLayers and ListLayerVersions. - - The following list includes deprecated runtimes. For more information, - see [Runtime deprecation - policy](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-support-policy). - """ - - license_info: str | None = None - """ - The layer's software license. It can be any of the following: - - - An [SPDX license identifier](https://spdx.org/licenses/). For example, - `MIT`. - - - The URL of a license hosted on the internet. For example, - `https://opensource.org/licenses/MIT`. - - - The full text of the license. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUBLISH_LAYER_VERSION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.layer_name is not None: - serializer.write_string( - _SCHEMA_PUBLISH_LAYER_VERSION_INPUT.members["LayerName"], - self.layer_name, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_PUBLISH_LAYER_VERSION_INPUT.members["Description"], - self.description, - ) - - if self.content is not None: - serializer.write_struct( - _SCHEMA_PUBLISH_LAYER_VERSION_INPUT.members["Content"], self.content - ) - - if self.compatible_architectures is not None: - _serialize_compatible_architectures( - serializer, - _SCHEMA_PUBLISH_LAYER_VERSION_INPUT.members["CompatibleArchitectures"], - self.compatible_architectures, - ) - - if self.compatible_runtimes is not None: - _serialize_compatible_runtimes( - serializer, - _SCHEMA_PUBLISH_LAYER_VERSION_INPUT.members["CompatibleRuntimes"], - self.compatible_runtimes, - ) - - if self.license_info is not None: - serializer.write_string( - _SCHEMA_PUBLISH_LAYER_VERSION_INPUT.members["LicenseInfo"], - self.license_info, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["layer_name"] = de.read_string( - _SCHEMA_PUBLISH_LAYER_VERSION_INPUT.members["LayerName"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_PUBLISH_LAYER_VERSION_INPUT.members["Description"] - ) - - case 2: - kwargs["content"] = LayerVersionContentInput.deserialize(de) - - case 3: - kwargs["compatible_architectures"] = ( - _deserialize_compatible_architectures( - de, - _SCHEMA_PUBLISH_LAYER_VERSION_INPUT.members[ - "CompatibleArchitectures" - ], - ) - ) - - case 4: - kwargs["compatible_runtimes"] = _deserialize_compatible_runtimes( - de, - _SCHEMA_PUBLISH_LAYER_VERSION_INPUT.members[ - "CompatibleRuntimes" - ], - ) - - case 5: - kwargs["license_info"] = de.read_string( - _SCHEMA_PUBLISH_LAYER_VERSION_INPUT.members["LicenseInfo"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PUBLISH_LAYER_VERSION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class PublishLayerVersionOutput: - """Dataclass for PublishLayerVersionOutput structure.""" - - content: LayerVersionContentOutput | None = None - """Details about the layer version.""" - - layer_arn: str | None = None - """The ARN of the layer.""" - - layer_version_arn: str | None = None - """The ARN of the layer version.""" - - description: str | None = None - """The description of the version.""" - - created_date: str | None = None - """ - The date that the layer version was created, in [ISO-8601 - format](https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). - """ - - version: int = 0 - """The version number.""" - - compatible_architectures: list[str] | None = None - """ - A list of compatible [instruction set - architectures](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html). - """ - - compatible_runtimes: list[str] | None = None - """ - The layer's compatible runtimes. - - The following list includes deprecated runtimes. For more information, - see [Runtime use after - deprecation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-deprecation-levels). - - For a list of all currently supported runtimes, see [Supported - runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtimes-supported). - """ - - license_info: str | None = None - """The layer's software license.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUBLISH_LAYER_VERSION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.content is not None: - serializer.write_struct( - _SCHEMA_PUBLISH_LAYER_VERSION_OUTPUT.members["Content"], self.content - ) - - if self.layer_arn is not None: - serializer.write_string( - _SCHEMA_PUBLISH_LAYER_VERSION_OUTPUT.members["LayerArn"], self.layer_arn - ) - - if self.layer_version_arn is not None: - serializer.write_string( - _SCHEMA_PUBLISH_LAYER_VERSION_OUTPUT.members["LayerVersionArn"], - self.layer_version_arn, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_PUBLISH_LAYER_VERSION_OUTPUT.members["Description"], - self.description, - ) - - if self.created_date is not None: - serializer.write_string( - _SCHEMA_PUBLISH_LAYER_VERSION_OUTPUT.members["CreatedDate"], - self.created_date, - ) - - serializer.write_long( - _SCHEMA_PUBLISH_LAYER_VERSION_OUTPUT.members["Version"], self.version - ) - if self.compatible_architectures is not None: - _serialize_compatible_architectures( - serializer, - _SCHEMA_PUBLISH_LAYER_VERSION_OUTPUT.members["CompatibleArchitectures"], - self.compatible_architectures, - ) - - if self.compatible_runtimes is not None: - _serialize_compatible_runtimes( - serializer, - _SCHEMA_PUBLISH_LAYER_VERSION_OUTPUT.members["CompatibleRuntimes"], - self.compatible_runtimes, - ) - - if self.license_info is not None: - serializer.write_string( - _SCHEMA_PUBLISH_LAYER_VERSION_OUTPUT.members["LicenseInfo"], - self.license_info, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["content"] = LayerVersionContentOutput.deserialize(de) - - case 1: - kwargs["layer_arn"] = de.read_string( - _SCHEMA_PUBLISH_LAYER_VERSION_OUTPUT.members["LayerArn"] - ) - - case 2: - kwargs["layer_version_arn"] = de.read_string( - _SCHEMA_PUBLISH_LAYER_VERSION_OUTPUT.members["LayerVersionArn"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_PUBLISH_LAYER_VERSION_OUTPUT.members["Description"] - ) - - case 4: - kwargs["created_date"] = de.read_string( - _SCHEMA_PUBLISH_LAYER_VERSION_OUTPUT.members["CreatedDate"] - ) - - case 5: - kwargs["version"] = de.read_long( - _SCHEMA_PUBLISH_LAYER_VERSION_OUTPUT.members["Version"] - ) - - case 6: - kwargs["compatible_architectures"] = ( - _deserialize_compatible_architectures( - de, - _SCHEMA_PUBLISH_LAYER_VERSION_OUTPUT.members[ - "CompatibleArchitectures" - ], - ) - ) - - case 7: - kwargs["compatible_runtimes"] = _deserialize_compatible_runtimes( - de, - _SCHEMA_PUBLISH_LAYER_VERSION_OUTPUT.members[ - "CompatibleRuntimes" - ], - ) - - case 8: - kwargs["license_info"] = de.read_string( - _SCHEMA_PUBLISH_LAYER_VERSION_OUTPUT.members["LicenseInfo"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PUBLISH_LAYER_VERSION_OUTPUT, consumer=_consumer - ) - return kwargs - - -PUBLISH_LAYER_VERSION = APIOperation( - input=PublishLayerVersionInput, - output=PublishLayerVersionOutput, - schema=_SCHEMA_PUBLISH_LAYER_VERSION, - input_schema=_SCHEMA_PUBLISH_LAYER_VERSION_INPUT, - output_schema=_SCHEMA_PUBLISH_LAYER_VERSION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#CodeStorageExceededException" - ): CodeStorageExceededException, - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CODE_STORAGE_EXCEEDED_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class RemoveLayerVersionPermissionInput: - """Dataclass for RemoveLayerVersionPermissionInput structure.""" - - layer_name: str | None = None - """The name or Amazon Resource Name (ARN) of the layer.""" - - version_number: int | None = None - """The version number.""" - - statement_id: str | None = None - """The identifier that was specified when the statement was added.""" - - revision_id: str | None = None - """ - Only update the policy if the revision ID matches the ID specified. Use - this option to avoid modifying a policy that has changed since you last - read it. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REMOVE_LAYER_VERSION_PERMISSION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.layer_name is not None: - serializer.write_string( - _SCHEMA_REMOVE_LAYER_VERSION_PERMISSION_INPUT.members["LayerName"], - self.layer_name, - ) - - if self.version_number is not None: - serializer.write_long( - _SCHEMA_REMOVE_LAYER_VERSION_PERMISSION_INPUT.members["VersionNumber"], - self.version_number, - ) - - if self.statement_id is not None: - serializer.write_string( - _SCHEMA_REMOVE_LAYER_VERSION_PERMISSION_INPUT.members["StatementId"], - self.statement_id, - ) - - if self.revision_id is not None: - serializer.write_string( - _SCHEMA_REMOVE_LAYER_VERSION_PERMISSION_INPUT.members["RevisionId"], - self.revision_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["layer_name"] = de.read_string( - _SCHEMA_REMOVE_LAYER_VERSION_PERMISSION_INPUT.members[ - "LayerName" - ] - ) - - case 1: - kwargs["version_number"] = de.read_long( - _SCHEMA_REMOVE_LAYER_VERSION_PERMISSION_INPUT.members[ - "VersionNumber" - ] - ) - - case 2: - kwargs["statement_id"] = de.read_string( - _SCHEMA_REMOVE_LAYER_VERSION_PERMISSION_INPUT.members[ - "StatementId" - ] - ) - - case 3: - kwargs["revision_id"] = de.read_string( - _SCHEMA_REMOVE_LAYER_VERSION_PERMISSION_INPUT.members[ - "RevisionId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_REMOVE_LAYER_VERSION_PERMISSION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class RemoveLayerVersionPermissionOutput: - """Dataclass for RemoveLayerVersionPermissionOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REMOVE_LAYER_VERSION_PERMISSION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_REMOVE_LAYER_VERSION_PERMISSION_OUTPUT, consumer=_consumer - ) - return kwargs - - -REMOVE_LAYER_VERSION_PERMISSION = APIOperation( - input=RemoveLayerVersionPermissionInput, - output=RemoveLayerVersionPermissionOutput, - schema=_SCHEMA_REMOVE_LAYER_VERSION_PERMISSION, - input_schema=_SCHEMA_REMOVE_LAYER_VERSION_PERMISSION_INPUT, - output_schema=_SCHEMA_REMOVE_LAYER_VERSION_PERMISSION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#PreconditionFailedException" - ): PreconditionFailedException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_PRECONDITION_FAILED_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListFunctionEventInvokeConfigsInput: - """Dataclass for ListFunctionEventInvokeConfigsInput structure.""" - - function_name: str | None = None - """ - The name or ARN of the Lambda function. - - **Name formats** - - - **Function name** - `my-function`. - - - **Function ARN** - - `arn:aws:lambda:us-west-2:123456789012:function:my-function`. - - - **Partial ARN** - `123456789012:function:my-function`. - - The length constraint applies only to the full ARN. If you specify only - the function name, it is limited to 64 characters in length. - """ - - marker: str | None = None - """ - Specify the pagination token that's returned by a previous request to - retrieve the next page of results. - """ - - max_items: int | None = None - """The maximum number of configurations to return.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_FUNCTION_EVENT_INVOKE_CONFIGS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_LIST_FUNCTION_EVENT_INVOKE_CONFIGS_INPUT.members[ - "FunctionName" - ], - self.function_name, - ) - - if self.marker is not None: - serializer.write_string( - _SCHEMA_LIST_FUNCTION_EVENT_INVOKE_CONFIGS_INPUT.members["Marker"], - self.marker, - ) - - if self.max_items is not None: - serializer.write_integer( - _SCHEMA_LIST_FUNCTION_EVENT_INVOKE_CONFIGS_INPUT.members["MaxItems"], - self.max_items, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_LIST_FUNCTION_EVENT_INVOKE_CONFIGS_INPUT.members[ - "FunctionName" - ] - ) - - case 1: - kwargs["marker"] = de.read_string( - _SCHEMA_LIST_FUNCTION_EVENT_INVOKE_CONFIGS_INPUT.members[ - "Marker" - ] - ) - - case 2: - kwargs["max_items"] = de.read_integer( - _SCHEMA_LIST_FUNCTION_EVENT_INVOKE_CONFIGS_INPUT.members[ - "MaxItems" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_FUNCTION_EVENT_INVOKE_CONFIGS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class FunctionEventInvokeConfig: - """Dataclass for FunctionEventInvokeConfig structure.""" - - last_modified: datetime | None = None - """The date and time that the configuration was last updated.""" - - function_arn: str | None = None - """The Amazon Resource Name (ARN) of the function.""" - - maximum_retry_attempts: int | None = None - """The maximum number of times to retry when the function returns an error.""" - - maximum_event_age_in_seconds: int | None = None - """ - The maximum age of a request that Lambda sends to a function for - processing. - """ - - destination_config: DestinationConfig | None = None - """ - A destination for events after they have been sent to a function for - processing. - - **Destinations** - - - **Function** - The Amazon Resource Name (ARN) of a Lambda function. - - - **Queue** - The ARN of a standard SQS queue. - - - **Bucket** - The ARN of an Amazon S3 bucket. - - - **Topic** - The ARN of a standard SNS topic. - - - **Event Bus** - The ARN of an Amazon EventBridge event bus. - - Note: - S3 buckets are supported only for on-failure destinations. To retain - records of successful invocations, use another destination type. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FUNCTION_EVENT_INVOKE_CONFIG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.last_modified is not None: - serializer.write_timestamp( - _SCHEMA_FUNCTION_EVENT_INVOKE_CONFIG.members["LastModified"], - self.last_modified, - ) - - if self.function_arn is not None: - serializer.write_string( - _SCHEMA_FUNCTION_EVENT_INVOKE_CONFIG.members["FunctionArn"], - self.function_arn, - ) - - if self.maximum_retry_attempts is not None: - serializer.write_integer( - _SCHEMA_FUNCTION_EVENT_INVOKE_CONFIG.members["MaximumRetryAttempts"], - self.maximum_retry_attempts, - ) - - if self.maximum_event_age_in_seconds is not None: - serializer.write_integer( - _SCHEMA_FUNCTION_EVENT_INVOKE_CONFIG.members[ - "MaximumEventAgeInSeconds" - ], - self.maximum_event_age_in_seconds, - ) - - if self.destination_config is not None: - serializer.write_struct( - _SCHEMA_FUNCTION_EVENT_INVOKE_CONFIG.members["DestinationConfig"], - self.destination_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["last_modified"] = de.read_timestamp( - _SCHEMA_FUNCTION_EVENT_INVOKE_CONFIG.members["LastModified"] - ) - - case 1: - kwargs["function_arn"] = de.read_string( - _SCHEMA_FUNCTION_EVENT_INVOKE_CONFIG.members["FunctionArn"] - ) - - case 2: - kwargs["maximum_retry_attempts"] = de.read_integer( - _SCHEMA_FUNCTION_EVENT_INVOKE_CONFIG.members[ - "MaximumRetryAttempts" - ] - ) - - case 3: - kwargs["maximum_event_age_in_seconds"] = de.read_integer( - _SCHEMA_FUNCTION_EVENT_INVOKE_CONFIG.members[ - "MaximumEventAgeInSeconds" - ] - ) - - case 4: - kwargs["destination_config"] = DestinationConfig.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_FUNCTION_EVENT_INVOKE_CONFIG, consumer=_consumer - ) - return kwargs - - -def _serialize_function_event_invoke_config_list( - serializer: ShapeSerializer, schema: Schema, value: list[FunctionEventInvokeConfig] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_function_event_invoke_config_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[FunctionEventInvokeConfig]: - result: list[FunctionEventInvokeConfig] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(FunctionEventInvokeConfig.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListFunctionEventInvokeConfigsOutput: - """Dataclass for ListFunctionEventInvokeConfigsOutput structure.""" - - function_event_invoke_configs: list[FunctionEventInvokeConfig] | None = None - """A list of configurations.""" - - next_marker: str | None = None - """The pagination token that's included if more results are available.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_FUNCTION_EVENT_INVOKE_CONFIGS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_event_invoke_configs is not None: - _serialize_function_event_invoke_config_list( - serializer, - _SCHEMA_LIST_FUNCTION_EVENT_INVOKE_CONFIGS_OUTPUT.members[ - "FunctionEventInvokeConfigs" - ], - self.function_event_invoke_configs, - ) - - if self.next_marker is not None: - serializer.write_string( - _SCHEMA_LIST_FUNCTION_EVENT_INVOKE_CONFIGS_OUTPUT.members["NextMarker"], - self.next_marker, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_event_invoke_configs"] = ( - _deserialize_function_event_invoke_config_list( - de, - _SCHEMA_LIST_FUNCTION_EVENT_INVOKE_CONFIGS_OUTPUT.members[ - "FunctionEventInvokeConfigs" - ], - ) - ) - - case 1: - kwargs["next_marker"] = de.read_string( - _SCHEMA_LIST_FUNCTION_EVENT_INVOKE_CONFIGS_OUTPUT.members[ - "NextMarker" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_FUNCTION_EVENT_INVOKE_CONFIGS_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_FUNCTION_EVENT_INVOKE_CONFIGS = APIOperation( - input=ListFunctionEventInvokeConfigsInput, - output=ListFunctionEventInvokeConfigsOutput, - schema=_SCHEMA_LIST_FUNCTION_EVENT_INVOKE_CONFIGS, - input_schema=_SCHEMA_LIST_FUNCTION_EVENT_INVOKE_CONFIGS_INPUT, - output_schema=_SCHEMA_LIST_FUNCTION_EVENT_INVOKE_CONFIGS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListTagsInput: - """Dataclass for ListTagsInput structure.""" - - resource: str | None = None - """ - The resource's Amazon Resource Name (ARN). Note: Lambda does not - support adding tags to function aliases or versions. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_TAGS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource is not None: - serializer.write_string( - _SCHEMA_LIST_TAGS_INPUT.members["Resource"], self.resource - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource"] = de.read_string( - _SCHEMA_LIST_TAGS_INPUT.members["Resource"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_TAGS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ListTagsOutput: - """Dataclass for ListTagsOutput structure.""" - - tags: dict[str, str] | None = None - """The function's tags.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_TAGS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.tags is not None: - _serialize_tags( - serializer, _SCHEMA_LIST_TAGS_OUTPUT.members["Tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["tags"] = _deserialize_tags( - de, _SCHEMA_LIST_TAGS_OUTPUT.members["Tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_TAGS_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_TAGS = APIOperation( - input=ListTagsInput, - output=ListTagsOutput, - schema=_SCHEMA_LIST_TAGS, - input_schema=_SCHEMA_LIST_TAGS_INPUT, - output_schema=_SCHEMA_LIST_TAGS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class RemovePermissionInput: - """Dataclass for RemovePermissionInput structure.""" - - function_name: str | None = None - """ - The name or ARN of the Lambda function, version, or alias. - - **Name formats** - - - **Function name** -- `my-function` (name-only), `my-function:v1` (with - alias). - - - **Function ARN** -- - `arn:aws:lambda:us-west-2:123456789012:function:my-function`. - - - **Partial ARN** -- `123456789012:function:my-function`. - - You can append a version number or alias to any of the formats. The - length constraint applies only to the full ARN. If you specify only the - function name, it is limited to 64 characters in length. - """ - - statement_id: str | None = None - """Statement ID of the permission to remove.""" - - qualifier: str | None = None - """ - Specify a version or alias to remove permissions from a published - version of the function. - """ - - revision_id: str | None = None - """ - Update the policy only if the revision ID matches the ID that's - specified. Use this option to avoid modifying a policy that has changed - since you last read it. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REMOVE_PERMISSION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_REMOVE_PERMISSION_INPUT.members["FunctionName"], - self.function_name, - ) - - if self.statement_id is not None: - serializer.write_string( - _SCHEMA_REMOVE_PERMISSION_INPUT.members["StatementId"], - self.statement_id, - ) - - if self.qualifier is not None: - serializer.write_string( - _SCHEMA_REMOVE_PERMISSION_INPUT.members["Qualifier"], self.qualifier - ) - - if self.revision_id is not None: - serializer.write_string( - _SCHEMA_REMOVE_PERMISSION_INPUT.members["RevisionId"], self.revision_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_REMOVE_PERMISSION_INPUT.members["FunctionName"] - ) - - case 1: - kwargs["statement_id"] = de.read_string( - _SCHEMA_REMOVE_PERMISSION_INPUT.members["StatementId"] - ) - - case 2: - kwargs["qualifier"] = de.read_string( - _SCHEMA_REMOVE_PERMISSION_INPUT.members["Qualifier"] - ) - - case 3: - kwargs["revision_id"] = de.read_string( - _SCHEMA_REMOVE_PERMISSION_INPUT.members["RevisionId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_REMOVE_PERMISSION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class RemovePermissionOutput: - """Dataclass for RemovePermissionOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REMOVE_PERMISSION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_REMOVE_PERMISSION_OUTPUT, consumer=_consumer) - return kwargs - - -REMOVE_PERMISSION = APIOperation( - input=RemovePermissionInput, - output=RemovePermissionOutput, - schema=_SCHEMA_REMOVE_PERMISSION, - input_schema=_SCHEMA_REMOVE_PERMISSION_INPUT, - output_schema=_SCHEMA_REMOVE_PERMISSION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#PreconditionFailedException" - ): PreconditionFailedException, - ShapeID( - "com.amazonaws.lambda#PublicPolicyException" - ): PublicPolicyException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_PRECONDITION_FAILED_EXCEPTION, - _SCHEMA_PUBLIC_POLICY_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteProvisionedConcurrencyConfigInput: - """Dataclass for DeleteProvisionedConcurrencyConfigInput structure.""" - - function_name: str | None = None - """ - The name or ARN of the Lambda function. - - **Name formats** - - - **Function name** -- `my-function`. - - - **Function ARN** -- - `arn:aws:lambda:us-west-2:123456789012:function:my-function`. - - - **Partial ARN** -- `123456789012:function:my-function`. - - The length constraint applies only to the full ARN. If you specify only - the function name, it is limited to 64 characters in length. - """ - - qualifier: str | None = None - """The version number or alias name.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DELETE_PROVISIONED_CONCURRENCY_CONFIG_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_DELETE_PROVISIONED_CONCURRENCY_CONFIG_INPUT.members[ - "FunctionName" - ], - self.function_name, - ) - - if self.qualifier is not None: - serializer.write_string( - _SCHEMA_DELETE_PROVISIONED_CONCURRENCY_CONFIG_INPUT.members[ - "Qualifier" - ], - self.qualifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_DELETE_PROVISIONED_CONCURRENCY_CONFIG_INPUT.members[ - "FunctionName" - ] - ) - - case 1: - kwargs["qualifier"] = de.read_string( - _SCHEMA_DELETE_PROVISIONED_CONCURRENCY_CONFIG_INPUT.members[ - "Qualifier" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_PROVISIONED_CONCURRENCY_CONFIG_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteProvisionedConcurrencyConfigOutput: - """Dataclass for DeleteProvisionedConcurrencyConfigOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DELETE_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT, consumer=_consumer - ) - return kwargs - - -DELETE_PROVISIONED_CONCURRENCY_CONFIG = APIOperation( - input=DeleteProvisionedConcurrencyConfigInput, - output=DeleteProvisionedConcurrencyConfigOutput, - schema=_SCHEMA_DELETE_PROVISIONED_CONCURRENCY_CONFIG, - input_schema=_SCHEMA_DELETE_PROVISIONED_CONCURRENCY_CONFIG_INPUT, - output_schema=_SCHEMA_DELETE_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceConflictException" - ): ResourceConflictException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetProvisionedConcurrencyConfigInput: - """Dataclass for GetProvisionedConcurrencyConfigInput structure.""" - - function_name: str | None = None - """ - The name or ARN of the Lambda function. - - **Name formats** - - - **Function name** -- `my-function`. - - - **Function ARN** -- - `arn:aws:lambda:us-west-2:123456789012:function:my-function`. - - - **Partial ARN** -- `123456789012:function:my-function`. - - The length constraint applies only to the full ARN. If you specify only - the function name, it is limited to 64 characters in length. - """ - - qualifier: str | None = None - """The version number or alias name.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_PROVISIONED_CONCURRENCY_CONFIG_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_GET_PROVISIONED_CONCURRENCY_CONFIG_INPUT.members[ - "FunctionName" - ], - self.function_name, - ) - - if self.qualifier is not None: - serializer.write_string( - _SCHEMA_GET_PROVISIONED_CONCURRENCY_CONFIG_INPUT.members["Qualifier"], - self.qualifier, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_GET_PROVISIONED_CONCURRENCY_CONFIG_INPUT.members[ - "FunctionName" - ] - ) - - case 1: - kwargs["qualifier"] = de.read_string( - _SCHEMA_GET_PROVISIONED_CONCURRENCY_CONFIG_INPUT.members[ - "Qualifier" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_PROVISIONED_CONCURRENCY_CONFIG_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetProvisionedConcurrencyConfigOutput: - """Dataclass for GetProvisionedConcurrencyConfigOutput structure.""" - - requested_provisioned_concurrent_executions: int | None = None - """The amount of provisioned concurrency requested.""" - - available_provisioned_concurrent_executions: int | None = None - """The amount of provisioned concurrency available.""" - - allocated_provisioned_concurrent_executions: int | None = None - """ - The amount of provisioned concurrency allocated. When a weighted alias - is used during linear and canary deployments, this value fluctuates - depending on the amount of concurrency that is provisioned for the - function versions. - """ - - status: str | None = None - """The status of the allocation process.""" - - status_reason: str | None = None - """ - For failed allocations, the reason that provisioned concurrency could - not be allocated. - """ - - last_modified: str | None = None - """ - The date and time that a user last updated the configuration, in [ISO - 8601 format](https://www.iso.org/iso-8601-date-and-time-format.html). - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.requested_provisioned_concurrent_executions is not None: - serializer.write_integer( - _SCHEMA_GET_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT.members[ - "RequestedProvisionedConcurrentExecutions" - ], - self.requested_provisioned_concurrent_executions, - ) - - if self.available_provisioned_concurrent_executions is not None: - serializer.write_integer( - _SCHEMA_GET_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT.members[ - "AvailableProvisionedConcurrentExecutions" - ], - self.available_provisioned_concurrent_executions, - ) - - if self.allocated_provisioned_concurrent_executions is not None: - serializer.write_integer( - _SCHEMA_GET_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT.members[ - "AllocatedProvisionedConcurrentExecutions" - ], - self.allocated_provisioned_concurrent_executions, - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_GET_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT.members["Status"], - self.status, - ) - - if self.status_reason is not None: - serializer.write_string( - _SCHEMA_GET_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT.members[ - "StatusReason" - ], - self.status_reason, - ) - - if self.last_modified is not None: - serializer.write_string( - _SCHEMA_GET_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT.members[ - "LastModified" - ], - self.last_modified, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["requested_provisioned_concurrent_executions"] = ( - de.read_integer( - _SCHEMA_GET_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT.members[ - "RequestedProvisionedConcurrentExecutions" - ] - ) - ) - - case 1: - kwargs["available_provisioned_concurrent_executions"] = ( - de.read_integer( - _SCHEMA_GET_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT.members[ - "AvailableProvisionedConcurrentExecutions" - ] - ) - ) - - case 2: - kwargs["allocated_provisioned_concurrent_executions"] = ( - de.read_integer( - _SCHEMA_GET_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT.members[ - "AllocatedProvisionedConcurrentExecutions" - ] - ) - ) - - case 3: - kwargs["status"] = ProvisionedConcurrencyStatusEnum( - de.read_string( - _SCHEMA_GET_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT.members[ - "Status" - ] - ) - ) - - case 4: - kwargs["status_reason"] = de.read_string( - _SCHEMA_GET_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT.members[ - "StatusReason" - ] - ) - - case 5: - kwargs["last_modified"] = de.read_string( - _SCHEMA_GET_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT.members[ - "LastModified" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ProvisionedConcurrencyConfigNotFoundException(ServiceError): - """The specified configuration does not exist.""" - - fault: Literal["client", "server"] | None = "client" - - type: str | None = None - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_PROVISIONED_CONCURRENCY_CONFIG_NOT_FOUND_EXCEPTION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_PROVISIONED_CONCURRENCY_CONFIG_NOT_FOUND_EXCEPTION.members[ - "Type" - ], - self.type, - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_PROVISIONED_CONCURRENCY_CONFIG_NOT_FOUND_EXCEPTION.members[ - "message" - ], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_PROVISIONED_CONCURRENCY_CONFIG_NOT_FOUND_EXCEPTION.members[ - "Type" - ] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_PROVISIONED_CONCURRENCY_CONFIG_NOT_FOUND_EXCEPTION.members[ - "message" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PROVISIONED_CONCURRENCY_CONFIG_NOT_FOUND_EXCEPTION, - consumer=_consumer, - ) - return kwargs - - -GET_PROVISIONED_CONCURRENCY_CONFIG = APIOperation( - input=GetProvisionedConcurrencyConfigInput, - output=GetProvisionedConcurrencyConfigOutput, - schema=_SCHEMA_GET_PROVISIONED_CONCURRENCY_CONFIG, - input_schema=_SCHEMA_GET_PROVISIONED_CONCURRENCY_CONFIG_INPUT, - output_schema=_SCHEMA_GET_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ProvisionedConcurrencyConfigNotFoundException" - ): ProvisionedConcurrencyConfigNotFoundException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_PROVISIONED_CONCURRENCY_CONFIG_NOT_FOUND_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class PutProvisionedConcurrencyConfigInput: - """Dataclass for PutProvisionedConcurrencyConfigInput structure.""" - - function_name: str | None = None - """ - The name or ARN of the Lambda function. - - **Name formats** - - - **Function name** -- `my-function`. - - - **Function ARN** -- - `arn:aws:lambda:us-west-2:123456789012:function:my-function`. - - - **Partial ARN** -- `123456789012:function:my-function`. - - The length constraint applies only to the full ARN. If you specify only - the function name, it is limited to 64 characters in length. - """ - - qualifier: str | None = None - """The version number or alias name.""" - - provisioned_concurrent_executions: int | None = None - """ - The amount of provisioned concurrency to allocate for the version or - alias. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_PROVISIONED_CONCURRENCY_CONFIG_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_PUT_PROVISIONED_CONCURRENCY_CONFIG_INPUT.members[ - "FunctionName" - ], - self.function_name, - ) - - if self.qualifier is not None: - serializer.write_string( - _SCHEMA_PUT_PROVISIONED_CONCURRENCY_CONFIG_INPUT.members["Qualifier"], - self.qualifier, - ) - - if self.provisioned_concurrent_executions is not None: - serializer.write_integer( - _SCHEMA_PUT_PROVISIONED_CONCURRENCY_CONFIG_INPUT.members[ - "ProvisionedConcurrentExecutions" - ], - self.provisioned_concurrent_executions, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_PUT_PROVISIONED_CONCURRENCY_CONFIG_INPUT.members[ - "FunctionName" - ] - ) - - case 1: - kwargs["qualifier"] = de.read_string( - _SCHEMA_PUT_PROVISIONED_CONCURRENCY_CONFIG_INPUT.members[ - "Qualifier" - ] - ) - - case 2: - kwargs["provisioned_concurrent_executions"] = de.read_integer( - _SCHEMA_PUT_PROVISIONED_CONCURRENCY_CONFIG_INPUT.members[ - "ProvisionedConcurrentExecutions" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PUT_PROVISIONED_CONCURRENCY_CONFIG_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class PutProvisionedConcurrencyConfigOutput: - """Dataclass for PutProvisionedConcurrencyConfigOutput structure.""" - - requested_provisioned_concurrent_executions: int | None = None - """The amount of provisioned concurrency requested.""" - - allocated_provisioned_concurrent_executions: int | None = None - """ - The amount of provisioned concurrency allocated. When a weighted alias - is used during linear and canary deployments, this value fluctuates - depending on the amount of concurrency that is provisioned for the - function versions. - """ - - available_provisioned_concurrent_executions: int | None = None - """The amount of provisioned concurrency available.""" - - status: str | None = None - """The status of the allocation process.""" - - status_reason: str | None = None - """ - For failed allocations, the reason that provisioned concurrency could - not be allocated. - """ - - last_modified: str | None = None - """ - The date and time that a user last updated the configuration, in [ISO - 8601 format](https://www.iso.org/iso-8601-date-and-time-format.html). - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.requested_provisioned_concurrent_executions is not None: - serializer.write_integer( - _SCHEMA_PUT_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT.members[ - "RequestedProvisionedConcurrentExecutions" - ], - self.requested_provisioned_concurrent_executions, - ) - - if self.allocated_provisioned_concurrent_executions is not None: - serializer.write_integer( - _SCHEMA_PUT_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT.members[ - "AllocatedProvisionedConcurrentExecutions" - ], - self.allocated_provisioned_concurrent_executions, - ) - - if self.available_provisioned_concurrent_executions is not None: - serializer.write_integer( - _SCHEMA_PUT_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT.members[ - "AvailableProvisionedConcurrentExecutions" - ], - self.available_provisioned_concurrent_executions, - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_PUT_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT.members["Status"], - self.status, - ) - - if self.status_reason is not None: - serializer.write_string( - _SCHEMA_PUT_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT.members[ - "StatusReason" - ], - self.status_reason, - ) - - if self.last_modified is not None: - serializer.write_string( - _SCHEMA_PUT_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT.members[ - "LastModified" - ], - self.last_modified, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["requested_provisioned_concurrent_executions"] = ( - de.read_integer( - _SCHEMA_PUT_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT.members[ - "RequestedProvisionedConcurrentExecutions" - ] - ) - ) - - case 1: - kwargs["allocated_provisioned_concurrent_executions"] = ( - de.read_integer( - _SCHEMA_PUT_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT.members[ - "AllocatedProvisionedConcurrentExecutions" - ] - ) - ) - - case 2: - kwargs["available_provisioned_concurrent_executions"] = ( - de.read_integer( - _SCHEMA_PUT_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT.members[ - "AvailableProvisionedConcurrentExecutions" - ] - ) - ) - - case 3: - kwargs["status"] = ProvisionedConcurrencyStatusEnum( - de.read_string( - _SCHEMA_PUT_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT.members[ - "Status" - ] - ) - ) - - case 4: - kwargs["status_reason"] = de.read_string( - _SCHEMA_PUT_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT.members[ - "StatusReason" - ] - ) - - case 5: - kwargs["last_modified"] = de.read_string( - _SCHEMA_PUT_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT.members[ - "LastModified" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PUT_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT, consumer=_consumer - ) - return kwargs - - -PUT_PROVISIONED_CONCURRENCY_CONFIG = APIOperation( - input=PutProvisionedConcurrencyConfigInput, - output=PutProvisionedConcurrencyConfigOutput, - schema=_SCHEMA_PUT_PROVISIONED_CONCURRENCY_CONFIG, - input_schema=_SCHEMA_PUT_PROVISIONED_CONCURRENCY_CONFIG_INPUT, - output_schema=_SCHEMA_PUT_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceConflictException" - ): ResourceConflictException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class PutFunctionEventInvokeConfigInput: - """Dataclass for PutFunctionEventInvokeConfigInput structure.""" - - function_name: str | None = None - """ - The name or ARN of the Lambda function, version, or alias. - - **Name formats** - - - **Function name** - `my-function` (name-only), `my-function:v1` (with - alias). - - - **Function ARN** - - `arn:aws:lambda:us-west-2:123456789012:function:my-function`. - - - **Partial ARN** - `123456789012:function:my-function`. - - You can append a version number or alias to any of the formats. The - length constraint applies only to the full ARN. If you specify only the - function name, it is limited to 64 characters in length. - """ - - qualifier: str | None = None - """A version number or alias name.""" - - maximum_retry_attempts: int | None = None - """The maximum number of times to retry when the function returns an error.""" - - maximum_event_age_in_seconds: int | None = None - """ - The maximum age of a request that Lambda sends to a function for - processing. - """ - - destination_config: DestinationConfig | None = None - """ - A destination for events after they have been sent to a function for - processing. - - **Destinations** - - - **Function** - The Amazon Resource Name (ARN) of a Lambda function. - - - **Queue** - The ARN of a standard SQS queue. - - - **Bucket** - The ARN of an Amazon S3 bucket. - - - **Topic** - The ARN of a standard SNS topic. - - - **Event Bus** - The ARN of an Amazon EventBridge event bus. - - Note: - S3 buckets are supported only for on-failure destinations. To retain - records of successful invocations, use another destination type. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_FUNCTION_EVENT_INVOKE_CONFIG_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_PUT_FUNCTION_EVENT_INVOKE_CONFIG_INPUT.members["FunctionName"], - self.function_name, - ) - - if self.qualifier is not None: - serializer.write_string( - _SCHEMA_PUT_FUNCTION_EVENT_INVOKE_CONFIG_INPUT.members["Qualifier"], - self.qualifier, - ) - - if self.maximum_retry_attempts is not None: - serializer.write_integer( - _SCHEMA_PUT_FUNCTION_EVENT_INVOKE_CONFIG_INPUT.members[ - "MaximumRetryAttempts" - ], - self.maximum_retry_attempts, - ) - - if self.maximum_event_age_in_seconds is not None: - serializer.write_integer( - _SCHEMA_PUT_FUNCTION_EVENT_INVOKE_CONFIG_INPUT.members[ - "MaximumEventAgeInSeconds" - ], - self.maximum_event_age_in_seconds, - ) - - if self.destination_config is not None: - serializer.write_struct( - _SCHEMA_PUT_FUNCTION_EVENT_INVOKE_CONFIG_INPUT.members[ - "DestinationConfig" - ], - self.destination_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_PUT_FUNCTION_EVENT_INVOKE_CONFIG_INPUT.members[ - "FunctionName" - ] - ) - - case 1: - kwargs["qualifier"] = de.read_string( - _SCHEMA_PUT_FUNCTION_EVENT_INVOKE_CONFIG_INPUT.members[ - "Qualifier" - ] - ) - - case 2: - kwargs["maximum_retry_attempts"] = de.read_integer( - _SCHEMA_PUT_FUNCTION_EVENT_INVOKE_CONFIG_INPUT.members[ - "MaximumRetryAttempts" - ] - ) - - case 3: - kwargs["maximum_event_age_in_seconds"] = de.read_integer( - _SCHEMA_PUT_FUNCTION_EVENT_INVOKE_CONFIG_INPUT.members[ - "MaximumEventAgeInSeconds" - ] - ) - - case 4: - kwargs["destination_config"] = DestinationConfig.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PUT_FUNCTION_EVENT_INVOKE_CONFIG_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class PutFunctionEventInvokeConfigOutput: - """Dataclass for PutFunctionEventInvokeConfigOutput structure.""" - - last_modified: datetime | None = None - """The date and time that the configuration was last updated.""" - - function_arn: str | None = None - """The Amazon Resource Name (ARN) of the function.""" - - maximum_retry_attempts: int | None = None - """The maximum number of times to retry when the function returns an error.""" - - maximum_event_age_in_seconds: int | None = None - """ - The maximum age of a request that Lambda sends to a function for - processing. - """ - - destination_config: DestinationConfig | None = None - """ - A destination for events after they have been sent to a function for - processing. - - **Destinations** - - - **Function** - The Amazon Resource Name (ARN) of a Lambda function. - - - **Queue** - The ARN of a standard SQS queue. - - - **Bucket** - The ARN of an Amazon S3 bucket. - - - **Topic** - The ARN of a standard SNS topic. - - - **Event Bus** - The ARN of an Amazon EventBridge event bus. - - Note: - S3 buckets are supported only for on-failure destinations. To retain - records of successful invocations, use another destination type. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.last_modified is not None: - serializer.write_timestamp( - _SCHEMA_PUT_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT.members["LastModified"], - self.last_modified, - ) - - if self.function_arn is not None: - serializer.write_string( - _SCHEMA_PUT_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT.members["FunctionArn"], - self.function_arn, - ) - - if self.maximum_retry_attempts is not None: - serializer.write_integer( - _SCHEMA_PUT_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT.members[ - "MaximumRetryAttempts" - ], - self.maximum_retry_attempts, - ) - - if self.maximum_event_age_in_seconds is not None: - serializer.write_integer( - _SCHEMA_PUT_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT.members[ - "MaximumEventAgeInSeconds" - ], - self.maximum_event_age_in_seconds, - ) - - if self.destination_config is not None: - serializer.write_struct( - _SCHEMA_PUT_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT.members[ - "DestinationConfig" - ], - self.destination_config, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["last_modified"] = de.read_timestamp( - _SCHEMA_PUT_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT.members[ - "LastModified" - ] - ) - - case 1: - kwargs["function_arn"] = de.read_string( - _SCHEMA_PUT_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT.members[ - "FunctionArn" - ] - ) - - case 2: - kwargs["maximum_retry_attempts"] = de.read_integer( - _SCHEMA_PUT_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT.members[ - "MaximumRetryAttempts" - ] - ) - - case 3: - kwargs["maximum_event_age_in_seconds"] = de.read_integer( - _SCHEMA_PUT_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT.members[ - "MaximumEventAgeInSeconds" - ] - ) - - case 4: - kwargs["destination_config"] = DestinationConfig.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PUT_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT, consumer=_consumer - ) - return kwargs - - -PUT_FUNCTION_EVENT_INVOKE_CONFIG = APIOperation( - input=PutFunctionEventInvokeConfigInput, - output=PutFunctionEventInvokeConfigOutput, - schema=_SCHEMA_PUT_FUNCTION_EVENT_INVOKE_CONFIG, - input_schema=_SCHEMA_PUT_FUNCTION_EVENT_INVOKE_CONFIG_INPUT, - output_schema=_SCHEMA_PUT_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceConflictException" - ): ResourceConflictException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class PutResourcePolicyInput: - """Dataclass for PutResourcePolicyInput structure.""" - - resource_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the Lambda resource you want to add - the policy to. You can use a qualified or an unqualified ARN. The value - must be a complete ARN, and the operation does not accept wildcard - characters. - """ - - policy: str | None = None - """ - The policy document you want to add to your Lambda resource. This is - formatted as a JSON string. - - For more information, see [Working with resource-based policies in - Lambda](https://docs.aws.amazon.com/lambda/latest/dg/access-control-resource-based.html) - in the *Lambda Developer Guide*. - """ - - revision_id: str | None = None - """ - The revision ID that the existing policy must match for the replacement - to proceed. If the revision ID doesn't match, the operation fails with - a `PreconditionFailedException` error. To retrieve the current revision - ID, use the GetResourcePolicy operation. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_RESOURCE_POLICY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_PUT_RESOURCE_POLICY_INPUT.members["ResourceArn"], - self.resource_arn, - ) - - if self.policy is not None: - serializer.write_string( - _SCHEMA_PUT_RESOURCE_POLICY_INPUT.members["Policy"], self.policy - ) - - if self.revision_id is not None: - serializer.write_string( - _SCHEMA_PUT_RESOURCE_POLICY_INPUT.members["RevisionId"], - self.revision_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_PUT_RESOURCE_POLICY_INPUT.members["ResourceArn"] - ) - - case 1: - kwargs["policy"] = de.read_string( - _SCHEMA_PUT_RESOURCE_POLICY_INPUT.members["Policy"] - ) - - case 2: - kwargs["revision_id"] = de.read_string( - _SCHEMA_PUT_RESOURCE_POLICY_INPUT.members["RevisionId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUT_RESOURCE_POLICY_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class PutResourcePolicyOutput: - """Dataclass for PutResourcePolicyOutput structure.""" - - policy: str | None = None - """The resource-based policy that Lambda adds to the resource.""" - - revision_id: str | None = None - """The revision ID of the policy that Lambda adds to your Lambda resource.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_RESOURCE_POLICY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.policy is not None: - serializer.write_string( - _SCHEMA_PUT_RESOURCE_POLICY_OUTPUT.members["Policy"], self.policy - ) - - if self.revision_id is not None: - serializer.write_string( - _SCHEMA_PUT_RESOURCE_POLICY_OUTPUT.members["RevisionId"], - self.revision_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy"] = de.read_string( - _SCHEMA_PUT_RESOURCE_POLICY_OUTPUT.members["Policy"] - ) - - case 1: - kwargs["revision_id"] = de.read_string( - _SCHEMA_PUT_RESOURCE_POLICY_OUTPUT.members["RevisionId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUT_RESOURCE_POLICY_OUTPUT, consumer=_consumer) - return kwargs - - -PUT_RESOURCE_POLICY = APIOperation( - input=PutResourcePolicyInput, - output=PutResourcePolicyOutput, - schema=_SCHEMA_PUT_RESOURCE_POLICY, - input_schema=_SCHEMA_PUT_RESOURCE_POLICY_INPUT, - output_schema=_SCHEMA_PUT_RESOURCE_POLICY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#PolicyLengthExceededException" - ): PolicyLengthExceededException, - ShapeID( - "com.amazonaws.lambda#PreconditionFailedException" - ): PreconditionFailedException, - ShapeID( - "com.amazonaws.lambda#PublicPolicyException" - ): PublicPolicyException, - ShapeID( - "com.amazonaws.lambda#ResourceConflictException" - ): ResourceConflictException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_POLICY_LENGTH_EXCEEDED_EXCEPTION, - _SCHEMA_PRECONDITION_FAILED_EXCEPTION, - _SCHEMA_PUBLIC_POLICY_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class CallbackTimeoutException(ServiceError): - """ - The callback ID token has either expired or the callback associated with - the token has already been closed. - """ - - fault: Literal["client", "server"] | None = "client" - - type: str | None = None - """The exception type.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CALLBACK_TIMEOUT_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_CALLBACK_TIMEOUT_EXCEPTION.members["Type"], self.type - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_CALLBACK_TIMEOUT_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = de.read_string( - _SCHEMA_CALLBACK_TIMEOUT_EXCEPTION.members["Type"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_CALLBACK_TIMEOUT_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CALLBACK_TIMEOUT_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class SendDurableExecutionCallbackFailureInput: - """Dataclass for SendDurableExecutionCallbackFailureInput structure.""" - - callback_id: str | None = None - """The unique identifier for the callback operation.""" - - error: ErrorObject | None = None - """Error details describing why the callback operation failed.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_SEND_DURABLE_EXECUTION_CALLBACK_FAILURE_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.callback_id is not None: - serializer.write_string( - _SCHEMA_SEND_DURABLE_EXECUTION_CALLBACK_FAILURE_INPUT.members[ - "CallbackId" - ], - self.callback_id, - ) - - if self.error is not None: - serializer.write_struct( - _SCHEMA_SEND_DURABLE_EXECUTION_CALLBACK_FAILURE_INPUT.members["Error"], - self.error, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["callback_id"] = de.read_string( - _SCHEMA_SEND_DURABLE_EXECUTION_CALLBACK_FAILURE_INPUT.members[ - "CallbackId" - ] - ) - - case 1: - kwargs["error"] = ErrorObject.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SEND_DURABLE_EXECUTION_CALLBACK_FAILURE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class SendDurableExecutionCallbackFailureOutput: - """Dataclass for SendDurableExecutionCallbackFailureOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_SEND_DURABLE_EXECUTION_CALLBACK_FAILURE_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SEND_DURABLE_EXECUTION_CALLBACK_FAILURE_OUTPUT, consumer=_consumer - ) - return kwargs - - -SEND_DURABLE_EXECUTION_CALLBACK_FAILURE = APIOperation( - input=SendDurableExecutionCallbackFailureInput, - output=SendDurableExecutionCallbackFailureOutput, - schema=_SCHEMA_SEND_DURABLE_EXECUTION_CALLBACK_FAILURE, - input_schema=_SCHEMA_SEND_DURABLE_EXECUTION_CALLBACK_FAILURE_INPUT, - output_schema=_SCHEMA_SEND_DURABLE_EXECUTION_CALLBACK_FAILURE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#CallbackTimeoutException" - ): CallbackTimeoutException, - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#KMSAccessDeniedException" - ): KMSAccessDeniedException, - ShapeID("com.amazonaws.lambda#KMSDisabledException"): KMSDisabledException, - ShapeID( - "com.amazonaws.lambda#KMSInvalidStateException" - ): KMSInvalidStateException, - ShapeID("com.amazonaws.lambda#KMSNotFoundException"): KMSNotFoundException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CALLBACK_TIMEOUT_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_KMS_ACCESS_DENIED_EXCEPTION, - _SCHEMA_KMS_DISABLED_EXCEPTION, - _SCHEMA_KMS_INVALID_STATE_EXCEPTION, - _SCHEMA_KMS_NOT_FOUND_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class SendDurableExecutionCallbackHeartbeatInput: - """Dataclass for SendDurableExecutionCallbackHeartbeatInput structure.""" - - callback_id: str | None = None - """The unique identifier for the callback operation.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_SEND_DURABLE_EXECUTION_CALLBACK_HEARTBEAT_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.callback_id is not None: - serializer.write_string( - _SCHEMA_SEND_DURABLE_EXECUTION_CALLBACK_HEARTBEAT_INPUT.members[ - "CallbackId" - ], - self.callback_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["callback_id"] = de.read_string( - _SCHEMA_SEND_DURABLE_EXECUTION_CALLBACK_HEARTBEAT_INPUT.members[ - "CallbackId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SEND_DURABLE_EXECUTION_CALLBACK_HEARTBEAT_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class SendDurableExecutionCallbackHeartbeatOutput: - """Dataclass for SendDurableExecutionCallbackHeartbeatOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_SEND_DURABLE_EXECUTION_CALLBACK_HEARTBEAT_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SEND_DURABLE_EXECUTION_CALLBACK_HEARTBEAT_OUTPUT, consumer=_consumer - ) - return kwargs - - -SEND_DURABLE_EXECUTION_CALLBACK_HEARTBEAT = APIOperation( - input=SendDurableExecutionCallbackHeartbeatInput, - output=SendDurableExecutionCallbackHeartbeatOutput, - schema=_SCHEMA_SEND_DURABLE_EXECUTION_CALLBACK_HEARTBEAT, - input_schema=_SCHEMA_SEND_DURABLE_EXECUTION_CALLBACK_HEARTBEAT_INPUT, - output_schema=_SCHEMA_SEND_DURABLE_EXECUTION_CALLBACK_HEARTBEAT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#CallbackTimeoutException" - ): CallbackTimeoutException, - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CALLBACK_TIMEOUT_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class SendDurableExecutionCallbackSuccessInput: - """Dataclass for SendDurableExecutionCallbackSuccessInput structure.""" - - callback_id: str | None = None - """The unique identifier for the callback operation.""" - - result: bytes | None = field(repr=False, default=None) - """ - The result data from the successful callback operation. Maximum size is - 256 KB. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_SEND_DURABLE_EXECUTION_CALLBACK_SUCCESS_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.callback_id is not None: - serializer.write_string( - _SCHEMA_SEND_DURABLE_EXECUTION_CALLBACK_SUCCESS_INPUT.members[ - "CallbackId" - ], - self.callback_id, - ) - - if self.result is not None: - serializer.write_blob( - _SCHEMA_SEND_DURABLE_EXECUTION_CALLBACK_SUCCESS_INPUT.members["Result"], - self.result, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["callback_id"] = de.read_string( - _SCHEMA_SEND_DURABLE_EXECUTION_CALLBACK_SUCCESS_INPUT.members[ - "CallbackId" - ] - ) - - case 1: - kwargs["result"] = de.read_blob( - _SCHEMA_SEND_DURABLE_EXECUTION_CALLBACK_SUCCESS_INPUT.members[ - "Result" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SEND_DURABLE_EXECUTION_CALLBACK_SUCCESS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class SendDurableExecutionCallbackSuccessOutput: - """Dataclass for SendDurableExecutionCallbackSuccessOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_SEND_DURABLE_EXECUTION_CALLBACK_SUCCESS_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SEND_DURABLE_EXECUTION_CALLBACK_SUCCESS_OUTPUT, consumer=_consumer - ) - return kwargs - - -SEND_DURABLE_EXECUTION_CALLBACK_SUCCESS = APIOperation( - input=SendDurableExecutionCallbackSuccessInput, - output=SendDurableExecutionCallbackSuccessOutput, - schema=_SCHEMA_SEND_DURABLE_EXECUTION_CALLBACK_SUCCESS, - input_schema=_SCHEMA_SEND_DURABLE_EXECUTION_CALLBACK_SUCCESS_INPUT, - output_schema=_SCHEMA_SEND_DURABLE_EXECUTION_CALLBACK_SUCCESS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#CallbackTimeoutException" - ): CallbackTimeoutException, - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#KMSAccessDeniedException" - ): KMSAccessDeniedException, - ShapeID("com.amazonaws.lambda#KMSDisabledException"): KMSDisabledException, - ShapeID( - "com.amazonaws.lambda#KMSInvalidStateException" - ): KMSInvalidStateException, - ShapeID("com.amazonaws.lambda#KMSNotFoundException"): KMSNotFoundException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_CALLBACK_TIMEOUT_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_KMS_ACCESS_DENIED_EXCEPTION, - _SCHEMA_KMS_DISABLED_EXCEPTION, - _SCHEMA_KMS_INVALID_STATE_EXCEPTION, - _SCHEMA_KMS_NOT_FOUND_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class TagResourceInput: - """Dataclass for TagResourceInput structure.""" - - resource: str | None = None - """The resource's Amazon Resource Name (ARN).""" - - tags: dict[str, str] | None = None - """A list of tags to apply to the resource.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TAG_RESOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource is not None: - serializer.write_string( - _SCHEMA_TAG_RESOURCE_INPUT.members["Resource"], self.resource - ) - - if self.tags is not None: - _serialize_tags( - serializer, _SCHEMA_TAG_RESOURCE_INPUT.members["Tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource"] = de.read_string( - _SCHEMA_TAG_RESOURCE_INPUT.members["Resource"] - ) - - case 1: - kwargs["tags"] = _deserialize_tags( - de, _SCHEMA_TAG_RESOURCE_INPUT.members["Tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TAG_RESOURCE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class TagResourceOutput: - """Dataclass for TagResourceOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .models import ( + AddLayerVersionPermissionInput, + AddLayerVersionPermissionOutput, + AddPermissionInput, + AddPermissionOutput, + CheckpointDurableExecutionInput, + CheckpointDurableExecutionOutput, + CreateAliasInput, + CreateAliasOutput, + CreateCapacityProviderInput, + CreateCapacityProviderOutput, + CreateCodeSigningConfigInput, + CreateCodeSigningConfigOutput, + CreateEventSourceMappingInput, + CreateEventSourceMappingOutput, + CreateFunctionInput, + CreateFunctionOutput, + CreateFunctionUrlConfigInput, + CreateFunctionUrlConfigOutput, + DeleteAliasInput, + DeleteAliasOutput, + DeleteCapacityProviderInput, + DeleteCapacityProviderOutput, + DeleteCodeSigningConfigInput, + DeleteCodeSigningConfigOutput, + DeleteEventSourceMappingInput, + DeleteEventSourceMappingOutput, + DeleteFunctionCodeSigningConfigInput, + DeleteFunctionCodeSigningConfigOutput, + DeleteFunctionConcurrencyInput, + DeleteFunctionConcurrencyOutput, + DeleteFunctionEventInvokeConfigInput, + DeleteFunctionEventInvokeConfigOutput, + DeleteFunctionInput, + DeleteFunctionOutput, + DeleteFunctionUrlConfigInput, + DeleteFunctionUrlConfigOutput, + DeleteLayerVersionInput, + DeleteLayerVersionOutput, + DeleteProvisionedConcurrencyConfigInput, + DeleteProvisionedConcurrencyConfigOutput, + DeleteResourcePolicyInput, + DeleteResourcePolicyOutput, + GetAccountSettingsInput, + GetAccountSettingsOutput, + GetAliasInput, + GetAliasOutput, + GetCapacityProviderInput, + GetCapacityProviderOutput, + GetCodeSigningConfigInput, + GetCodeSigningConfigOutput, + GetDurableExecutionHistoryInput, + GetDurableExecutionHistoryOutput, + GetDurableExecutionInput, + GetDurableExecutionOutput, + GetDurableExecutionStateInput, + GetDurableExecutionStateOutput, + GetEventSourceMappingInput, + GetEventSourceMappingOutput, + GetFunctionCodeSigningConfigInput, + GetFunctionCodeSigningConfigOutput, + GetFunctionConcurrencyInput, + GetFunctionConcurrencyOutput, + GetFunctionConfigurationInput, + GetFunctionConfigurationOutput, + GetFunctionEventInvokeConfigInput, + GetFunctionEventInvokeConfigOutput, + GetFunctionInput, + GetFunctionOutput, + GetFunctionRecursionConfigInput, + GetFunctionRecursionConfigOutput, + GetFunctionScalingConfigInput, + GetFunctionScalingConfigOutput, + GetFunctionUrlConfigInput, + GetFunctionUrlConfigOutput, + GetLayerVersionByArnInput, + GetLayerVersionByArnOutput, + GetLayerVersionInput, + GetLayerVersionOutput, + GetLayerVersionPolicyInput, + GetLayerVersionPolicyOutput, + GetPolicyInput, + GetPolicyOutput, + GetProvisionedConcurrencyConfigInput, + GetProvisionedConcurrencyConfigOutput, + GetResourcePolicyInput, + GetResourcePolicyOutput, + GetRuntimeManagementConfigInput, + GetRuntimeManagementConfigOutput, + InvokeAsyncInput, + InvokeAsyncOutput, + InvokeInput, + InvokeOutput, + InvokeWithResponseStreamInput, + InvokeWithResponseStreamOutput, + ListAliasesInput, + ListAliasesOutput, + ListCapacityProvidersInput, + ListCapacityProvidersOutput, + ListCodeSigningConfigsInput, + ListCodeSigningConfigsOutput, + ListDurableExecutionsByFunctionInput, + ListDurableExecutionsByFunctionOutput, + ListEventSourceMappingsInput, + ListEventSourceMappingsOutput, + ListFunctionEventInvokeConfigsInput, + ListFunctionEventInvokeConfigsOutput, + ListFunctionUrlConfigsInput, + ListFunctionUrlConfigsOutput, + ListFunctionVersionsByCapacityProviderInput, + ListFunctionVersionsByCapacityProviderOutput, + ListFunctionsByCodeSigningConfigInput, + ListFunctionsByCodeSigningConfigOutput, + ListFunctionsInput, + ListFunctionsOutput, + ListLayerVersionsInput, + ListLayerVersionsOutput, + ListLayersInput, + ListLayersOutput, + ListProvisionedConcurrencyConfigsInput, + ListProvisionedConcurrencyConfigsOutput, + ListTagsInput, + ListTagsOutput, + ListVersionsByFunctionInput, + ListVersionsByFunctionOutput, + PublishLayerVersionInput, + PublishLayerVersionOutput, + PublishVersionInput, + PublishVersionOutput, + PutFunctionCodeSigningConfigInput, + PutFunctionCodeSigningConfigOutput, + PutFunctionConcurrencyInput, + PutFunctionConcurrencyOutput, + PutFunctionEventInvokeConfigInput, + PutFunctionEventInvokeConfigOutput, + PutFunctionRecursionConfigInput, + PutFunctionRecursionConfigOutput, + PutFunctionScalingConfigInput, + PutFunctionScalingConfigOutput, + PutProvisionedConcurrencyConfigInput, + PutProvisionedConcurrencyConfigOutput, + PutResourcePolicyInput, + PutResourcePolicyOutput, + PutRuntimeManagementConfigInput, + PutRuntimeManagementConfigOutput, + RemoveLayerVersionPermissionInput, + RemoveLayerVersionPermissionOutput, + RemovePermissionInput, + RemovePermissionOutput, + SendDurableExecutionCallbackFailureInput, + SendDurableExecutionCallbackFailureOutput, + SendDurableExecutionCallbackHeartbeatInput, + SendDurableExecutionCallbackHeartbeatOutput, + SendDurableExecutionCallbackSuccessInput, + SendDurableExecutionCallbackSuccessOutput, + StopDurableExecutionInput, + StopDurableExecutionOutput, + TagResourceInput, + TagResourceOutput, + UntagResourceInput, + UntagResourceOutput, + UpdateAliasInput, + UpdateAliasOutput, + UpdateCapacityProviderInput, + UpdateCapacityProviderOutput, + UpdateCodeSigningConfigInput, + UpdateCodeSigningConfigOutput, + UpdateEventSourceMappingInput, + UpdateEventSourceMappingOutput, + UpdateFunctionCodeInput, + UpdateFunctionCodeOutput, + UpdateFunctionConfigurationInput, + UpdateFunctionConfigurationOutput, + UpdateFunctionEventInvokeConfigInput, + UpdateFunctionEventInvokeConfigOutput, + UpdateFunctionUrlConfigInput, + UpdateFunctionUrlConfigOutput, ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TAG_RESOURCE_OUTPUT, self) - def serialize_members(self, serializer: ShapeSerializer): - pass - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) +class ServiceError(ModeledError): + """ + Base error for all errors in the service. - deserializer.read_struct(_SCHEMA_TAG_RESOURCE_OUTPUT, consumer=_consumer) - return kwargs + Some exceptions do not extend from this class, including + synthetic, implicit, and shared exception types. + """ -TAG_RESOURCE = APIOperation( - input=TagResourceInput, - output=TagResourceOutput, - schema=_SCHEMA_TAG_RESOURCE, - input_schema=_SCHEMA_TAG_RESOURCE_INPUT, - output_schema=_SCHEMA_TAG_RESOURCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceConflictException" - ): ResourceConflictException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, +_registry = ModelRegistry( + _schemas, + renames={}, + index={ + "AccountLimit": "ACCOUNT_LIMIT", + "AccountUsage": "ACCOUNT_USAGE", + "AddLayerVersionPermissionInput": "ADD_LAYER_VERSION_PERMISSION_INPUT", + "AddLayerVersionPermissionOutput": "ADD_LAYER_VERSION_PERMISSION_OUTPUT", + "AddPermissionInput": "ADD_PERMISSION_INPUT", + "AddPermissionOutput": "ADD_PERMISSION_OUTPUT", + "AliasConfiguration": "ALIAS_CONFIGURATION", + "AliasLimitExceededException": "ALIAS_LIMIT_EXCEEDED_EXCEPTION", + "AliasRoutingConfiguration": "ALIAS_ROUTING_CONFIGURATION", + "AllowedPublishers": "ALLOWED_PUBLISHERS", + "AmazonManagedKafkaEventSourceConfig": "AMAZON_MANAGED_KAFKA_EVENT_SOURCE_CONFIG", + "ApplicationLogLevel": "APPLICATION_LOG_LEVEL", + "Architecture": "ARCHITECTURE", + "CallbackDetails": "CALLBACK_DETAILS", + "CallbackFailedDetails": "CALLBACK_FAILED_DETAILS", + "CallbackOptions": "CALLBACK_OPTIONS", + "CallbackStartedDetails": "CALLBACK_STARTED_DETAILS", + "CallbackSucceededDetails": "CALLBACK_SUCCEEDED_DETAILS", + "CallbackTimedOutDetails": "CALLBACK_TIMED_OUT_DETAILS", + "CallbackTimeoutException": "CALLBACK_TIMEOUT_EXCEPTION", + "CapacityProvider": "CAPACITY_PROVIDER", + "CapacityProviderConfig": "CAPACITY_PROVIDER_CONFIG", + "CapacityProviderLimitExceededException": "CAPACITY_PROVIDER_LIMIT_EXCEEDED_EXCEPTION", + "CapacityProviderLoggingConfig": "CAPACITY_PROVIDER_LOGGING_CONFIG", + "CapacityProviderPermissionsConfig": "CAPACITY_PROVIDER_PERMISSIONS_CONFIG", + "CapacityProviderPredefinedMetricType": "CAPACITY_PROVIDER_PREDEFINED_METRIC_TYPE", + "CapacityProviderScalingConfig": "CAPACITY_PROVIDER_SCALING_CONFIG", + "CapacityProviderScalingMode": "CAPACITY_PROVIDER_SCALING_MODE", + "CapacityProviderState": "CAPACITY_PROVIDER_STATE", + "CapacityProviderTelemetryConfig": "CAPACITY_PROVIDER_TELEMETRY_CONFIG", + "CapacityProviderVpcConfig": "CAPACITY_PROVIDER_VPC_CONFIG", + "ChainedInvokeDetails": "CHAINED_INVOKE_DETAILS", + "ChainedInvokeFailedDetails": "CHAINED_INVOKE_FAILED_DETAILS", + "ChainedInvokeOptions": "CHAINED_INVOKE_OPTIONS", + "ChainedInvokeStartedDetails": "CHAINED_INVOKE_STARTED_DETAILS", + "ChainedInvokeStoppedDetails": "CHAINED_INVOKE_STOPPED_DETAILS", + "ChainedInvokeSucceededDetails": "CHAINED_INVOKE_SUCCEEDED_DETAILS", + "ChainedInvokeTimedOutDetails": "CHAINED_INVOKE_TIMED_OUT_DETAILS", + "CheckpointDurableExecutionInput": "CHECKPOINT_DURABLE_EXECUTION_INPUT", + "CheckpointDurableExecutionOutput": "CHECKPOINT_DURABLE_EXECUTION_OUTPUT", + "CheckpointUpdatedExecutionState": "CHECKPOINT_UPDATED_EXECUTION_STATE", + "CodeArtifactUserDeletedException": "CODE_ARTIFACT_USER_DELETED_EXCEPTION", + "CodeArtifactUserFailedException": "CODE_ARTIFACT_USER_FAILED_EXCEPTION", + "CodeArtifactUserPendingException": "CODE_ARTIFACT_USER_PENDING_EXCEPTION", + "CodeSigningConfig": "CODE_SIGNING_CONFIG", + "CodeSigningConfigNotFoundException": "CODE_SIGNING_CONFIG_NOT_FOUND_EXCEPTION", + "CodeSigningPolicies": "CODE_SIGNING_POLICIES", + "CodeSigningPolicy": "CODE_SIGNING_POLICY", + "CodeStorageExceededException": "CODE_STORAGE_EXCEEDED_EXCEPTION", + "CodeVerificationFailedException": "CODE_VERIFICATION_FAILED_EXCEPTION", + "Concurrency": "CONCURRENCY", + "ContextDetails": "CONTEXT_DETAILS", + "ContextFailedDetails": "CONTEXT_FAILED_DETAILS", + "ContextOptions": "CONTEXT_OPTIONS", + "ContextStartedDetails": "CONTEXT_STARTED_DETAILS", + "ContextSucceededDetails": "CONTEXT_SUCCEEDED_DETAILS", + "Cors": "CORS", + "CreateAliasInput": "CREATE_ALIAS_INPUT", + "CreateAliasOutput": "CREATE_ALIAS_OUTPUT", + "CreateCapacityProviderInput": "CREATE_CAPACITY_PROVIDER_INPUT", + "CreateCapacityProviderOutput": "CREATE_CAPACITY_PROVIDER_OUTPUT", + "CreateCodeSigningConfigInput": "CREATE_CODE_SIGNING_CONFIG_INPUT", + "CreateCodeSigningConfigOutput": "CREATE_CODE_SIGNING_CONFIG_OUTPUT", + "CreateEventSourceMappingInput": "CREATE_EVENT_SOURCE_MAPPING_INPUT", + "CreateEventSourceMappingOutput": "CREATE_EVENT_SOURCE_MAPPING_OUTPUT", + "CreateFunctionInput": "CREATE_FUNCTION_INPUT", + "CreateFunctionOutput": "CREATE_FUNCTION_OUTPUT", + "CreateFunctionUrlConfigInput": "CREATE_FUNCTION_URL_CONFIG_INPUT", + "CreateFunctionUrlConfigOutput": "CREATE_FUNCTION_URL_CONFIG_OUTPUT", + "DeadLetterConfig": "DEAD_LETTER_CONFIG", + "DeleteAliasInput": "DELETE_ALIAS_INPUT", + "DeleteAliasOutput": "DELETE_ALIAS_OUTPUT", + "DeleteCapacityProviderInput": "DELETE_CAPACITY_PROVIDER_INPUT", + "DeleteCapacityProviderOutput": "DELETE_CAPACITY_PROVIDER_OUTPUT", + "DeleteCodeSigningConfigInput": "DELETE_CODE_SIGNING_CONFIG_INPUT", + "DeleteCodeSigningConfigOutput": "DELETE_CODE_SIGNING_CONFIG_OUTPUT", + "DeleteEventSourceMappingInput": "DELETE_EVENT_SOURCE_MAPPING_INPUT", + "DeleteEventSourceMappingOutput": "DELETE_EVENT_SOURCE_MAPPING_OUTPUT", + "DeleteFunctionCodeSigningConfigInput": "DELETE_FUNCTION_CODE_SIGNING_CONFIG_INPUT", + "DeleteFunctionCodeSigningConfigOutput": "DELETE_FUNCTION_CODE_SIGNING_CONFIG_OUTPUT", + "DeleteFunctionConcurrencyInput": "DELETE_FUNCTION_CONCURRENCY_INPUT", + "DeleteFunctionConcurrencyOutput": "DELETE_FUNCTION_CONCURRENCY_OUTPUT", + "DeleteFunctionEventInvokeConfigInput": "DELETE_FUNCTION_EVENT_INVOKE_CONFIG_INPUT", + "DeleteFunctionEventInvokeConfigOutput": "DELETE_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT", + "DeleteFunctionInput": "DELETE_FUNCTION_INPUT", + "DeleteFunctionOutput": "DELETE_FUNCTION_OUTPUT", + "DeleteFunctionUrlConfigInput": "DELETE_FUNCTION_URL_CONFIG_INPUT", + "DeleteFunctionUrlConfigOutput": "DELETE_FUNCTION_URL_CONFIG_OUTPUT", + "DeleteLayerVersionInput": "DELETE_LAYER_VERSION_INPUT", + "DeleteLayerVersionOutput": "DELETE_LAYER_VERSION_OUTPUT", + "DeleteProvisionedConcurrencyConfigInput": "DELETE_PROVISIONED_CONCURRENCY_CONFIG_INPUT", + "DeleteProvisionedConcurrencyConfigOutput": "DELETE_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT", + "DeleteResourcePolicyInput": "DELETE_RESOURCE_POLICY_INPUT", + "DeleteResourcePolicyOutput": "DELETE_RESOURCE_POLICY_OUTPUT", + "DestinationConfig": "DESTINATION_CONFIG", + "DirectS3Read": "DIRECT_S3_READ", + "DocumentDBEventSourceConfig": "DOCUMENT_DB_EVENT_SOURCE_CONFIG", + "DurableConfig": "DURABLE_CONFIG", + "DurableExecutionAlreadyStartedException": "DURABLE_EXECUTION_ALREADY_STARTED_EXCEPTION", + "EC2AccessDeniedException": "EC2_ACCESS_DENIED_EXCEPTION", + "EC2ThrottledException": "EC2_THROTTLED_EXCEPTION", + "EC2UnexpectedException": "EC2_UNEXPECTED_EXCEPTION", + "EFSIOException": "EFSIO_EXCEPTION", + "EFSMountConnectivityException": "EFS_MOUNT_CONNECTIVITY_EXCEPTION", + "EFSMountFailureException": "EFS_MOUNT_FAILURE_EXCEPTION", + "EFSMountTimeoutException": "EFS_MOUNT_TIMEOUT_EXCEPTION", + "EndPointType": "END_POINT_TYPE", + "ENILimitReachedException": "ENI_LIMIT_REACHED_EXCEPTION", + "ENINotReadyException": "ENI_NOT_READY_EXCEPTION", + "Environment": "ENVIRONMENT", + "EnvironmentError": "ENVIRONMENT_ERROR", + "EnvironmentResponse": "ENVIRONMENT_RESPONSE", + "EphemeralStorage": "EPHEMERAL_STORAGE", + "ErrorObject": "ERROR_OBJECT", + "Event": "EVENT", + "EventError": "EVENT_ERROR", + "EventInput": "EVENT_INPUT", + "EventResult": "EVENT_RESULT", + "EventSourceMappingConfiguration": "EVENT_SOURCE_MAPPING_CONFIGURATION", + "EventSourceMappingLoggingConfig": "EVENT_SOURCE_MAPPING_LOGGING_CONFIG", + "EventSourceMappingMetric": "EVENT_SOURCE_MAPPING_METRIC", + "EventSourceMappingMetricsConfig": "EVENT_SOURCE_MAPPING_METRICS_CONFIG", + "EventSourceMappingSystemLogLevel": "EVENT_SOURCE_MAPPING_SYSTEM_LOG_LEVEL", + "EventSourcePosition": "EVENT_SOURCE_POSITION", + "EventType": "EVENT_TYPE", + "Execution": "EXECUTION", + "ExecutionDetails": "EXECUTION_DETAILS", + "ExecutionFailedDetails": "EXECUTION_FAILED_DETAILS", + "ExecutionStartedDetails": "EXECUTION_STARTED_DETAILS", + "ExecutionStatus": "EXECUTION_STATUS", + "ExecutionStoppedDetails": "EXECUTION_STOPPED_DETAILS", + "ExecutionSucceededDetails": "EXECUTION_SUCCEEDED_DETAILS", + "ExecutionTimedOutDetails": "EXECUTION_TIMED_OUT_DETAILS", + "FileSystemConfig": "FILE_SYSTEM_CONFIG", + "Filter": "FILTER", + "FilterCriteria": "FILTER_CRITERIA", + "FilterCriteriaError": "FILTER_CRITERIA_ERROR", + "FullDocument": "FULL_DOCUMENT", + "FunctionCode": "FUNCTION_CODE", + "FunctionCodeLocation": "FUNCTION_CODE_LOCATION", + "FunctionCodeLocationError": "FUNCTION_CODE_LOCATION_ERROR", + "FunctionConfiguration": "FUNCTION_CONFIGURATION", + "FunctionEventInvokeConfig": "FUNCTION_EVENT_INVOKE_CONFIG", + "FunctionResponseType": "FUNCTION_RESPONSE_TYPE", + "FunctionScalingConfig": "FUNCTION_SCALING_CONFIG", + "FunctionUrlAuthType": "FUNCTION_URL_AUTH_TYPE", + "FunctionUrlConfig": "FUNCTION_URL_CONFIG", + "FunctionVersion": "FUNCTION_VERSION", + "FunctionVersionLatestPublished": "FUNCTION_VERSION_LATEST_PUBLISHED", + "FunctionVersionsByCapacityProviderListItem": "FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER_LIST_ITEM", + "FunctionVersionsPerCapacityProviderLimitExceededException": "FUNCTION_VERSIONS_PER_CAPACITY_PROVIDER_LIMIT_EXCEEDED_EXCEPTION", + "GetAccountSettingsInput": "GET_ACCOUNT_SETTINGS_INPUT", + "GetAccountSettingsOutput": "GET_ACCOUNT_SETTINGS_OUTPUT", + "GetAliasInput": "GET_ALIAS_INPUT", + "GetAliasOutput": "GET_ALIAS_OUTPUT", + "GetCapacityProviderInput": "GET_CAPACITY_PROVIDER_INPUT", + "GetCapacityProviderOutput": "GET_CAPACITY_PROVIDER_OUTPUT", + "GetCodeSigningConfigInput": "GET_CODE_SIGNING_CONFIG_INPUT", + "GetCodeSigningConfigOutput": "GET_CODE_SIGNING_CONFIG_OUTPUT", + "GetDurableExecutionHistoryInput": "GET_DURABLE_EXECUTION_HISTORY_INPUT", + "GetDurableExecutionHistoryOutput": "GET_DURABLE_EXECUTION_HISTORY_OUTPUT", + "GetDurableExecutionInput": "GET_DURABLE_EXECUTION_INPUT", + "GetDurableExecutionOutput": "GET_DURABLE_EXECUTION_OUTPUT", + "GetDurableExecutionStateInput": "GET_DURABLE_EXECUTION_STATE_INPUT", + "GetDurableExecutionStateOutput": "GET_DURABLE_EXECUTION_STATE_OUTPUT", + "GetEventSourceMappingInput": "GET_EVENT_SOURCE_MAPPING_INPUT", + "GetEventSourceMappingOutput": "GET_EVENT_SOURCE_MAPPING_OUTPUT", + "GetFunctionCodeSigningConfigInput": "GET_FUNCTION_CODE_SIGNING_CONFIG_INPUT", + "GetFunctionCodeSigningConfigOutput": "GET_FUNCTION_CODE_SIGNING_CONFIG_OUTPUT", + "GetFunctionConcurrencyInput": "GET_FUNCTION_CONCURRENCY_INPUT", + "GetFunctionConcurrencyOutput": "GET_FUNCTION_CONCURRENCY_OUTPUT", + "GetFunctionConfigurationInput": "GET_FUNCTION_CONFIGURATION_INPUT", + "GetFunctionConfigurationOutput": "GET_FUNCTION_CONFIGURATION_OUTPUT", + "GetFunctionEventInvokeConfigInput": "GET_FUNCTION_EVENT_INVOKE_CONFIG_INPUT", + "GetFunctionEventInvokeConfigOutput": "GET_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT", + "GetFunctionInput": "GET_FUNCTION_INPUT", + "GetFunctionOutput": "GET_FUNCTION_OUTPUT", + "GetFunctionRecursionConfigInput": "GET_FUNCTION_RECURSION_CONFIG_INPUT", + "GetFunctionRecursionConfigOutput": "GET_FUNCTION_RECURSION_CONFIG_OUTPUT", + "GetFunctionScalingConfigInput": "GET_FUNCTION_SCALING_CONFIG_INPUT", + "GetFunctionScalingConfigOutput": "GET_FUNCTION_SCALING_CONFIG_OUTPUT", + "GetFunctionUrlConfigInput": "GET_FUNCTION_URL_CONFIG_INPUT", + "GetFunctionUrlConfigOutput": "GET_FUNCTION_URL_CONFIG_OUTPUT", + "GetLayerVersionByArnInput": "GET_LAYER_VERSION_BY_ARN_INPUT", + "GetLayerVersionByArnOutput": "GET_LAYER_VERSION_BY_ARN_OUTPUT", + "GetLayerVersionInput": "GET_LAYER_VERSION_INPUT", + "GetLayerVersionOutput": "GET_LAYER_VERSION_OUTPUT", + "GetLayerVersionPolicyInput": "GET_LAYER_VERSION_POLICY_INPUT", + "GetLayerVersionPolicyOutput": "GET_LAYER_VERSION_POLICY_OUTPUT", + "GetPolicyInput": "GET_POLICY_INPUT", + "GetPolicyOutput": "GET_POLICY_OUTPUT", + "GetProvisionedConcurrencyConfigInput": "GET_PROVISIONED_CONCURRENCY_CONFIG_INPUT", + "GetProvisionedConcurrencyConfigOutput": "GET_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT", + "GetResourcePolicyInput": "GET_RESOURCE_POLICY_INPUT", + "GetResourcePolicyOutput": "GET_RESOURCE_POLICY_OUTPUT", + "GetRuntimeManagementConfigInput": "GET_RUNTIME_MANAGEMENT_CONFIG_INPUT", + "GetRuntimeManagementConfigOutput": "GET_RUNTIME_MANAGEMENT_CONFIG_OUTPUT", + "ImageConfig": "IMAGE_CONFIG", + "ImageConfigError": "IMAGE_CONFIG_ERROR", + "ImageConfigResponse": "IMAGE_CONFIG_RESPONSE", + "InstanceRequirements": "INSTANCE_REQUIREMENTS", + "InvalidCodeSignatureException": "INVALID_CODE_SIGNATURE_EXCEPTION", + "InvalidParameterValueException": "INVALID_PARAMETER_VALUE_EXCEPTION", + "InvalidRequestContentException": "INVALID_REQUEST_CONTENT_EXCEPTION", + "InvalidRuntimeException": "INVALID_RUNTIME_EXCEPTION", + "InvalidSecurityGroupIDException": "INVALID_SECURITY_GROUP_ID_EXCEPTION", + "InvalidSubnetIDException": "INVALID_SUBNET_ID_EXCEPTION", + "InvalidZipFileException": "INVALID_ZIP_FILE_EXCEPTION", + "InvocationCompletedDetails": "INVOCATION_COMPLETED_DETAILS", + "InvocationType": "INVOCATION_TYPE", + "InvokeAsyncInput": "INVOKE_ASYNC_INPUT", + "InvokeAsyncOutput": "INVOKE_ASYNC_OUTPUT", + "InvokeInput": "INVOKE_INPUT", + "InvokeMode": "INVOKE_MODE", + "InvokeOutput": "INVOKE_OUTPUT", + "InvokeResponseStreamUpdate": "INVOKE_RESPONSE_STREAM_UPDATE", + "InvokeWithResponseStreamCompleteEvent": "INVOKE_WITH_RESPONSE_STREAM_COMPLETE_EVENT", + "InvokeWithResponseStreamInput": "INVOKE_WITH_RESPONSE_STREAM_INPUT", + "InvokeWithResponseStreamOutput": "INVOKE_WITH_RESPONSE_STREAM_OUTPUT", + "InvokeWithResponseStreamResponseEvent": "INVOKE_WITH_RESPONSE_STREAM_RESPONSE_EVENT", + "InvokeWithResponseStreamResponseEventPayloadChunk": "INVOKE_WITH_RESPONSE_STREAM_RESPONSE_EVENT", + "InvokeWithResponseStreamResponseEventInvokeComplete": "INVOKE_WITH_RESPONSE_STREAM_RESPONSE_EVENT", + "InvokeWithResponseStreamResponseEventUnknown": "INVOKE_WITH_RESPONSE_STREAM_RESPONSE_EVENT", + "KafkaSchemaRegistryAccessConfig": "KAFKA_SCHEMA_REGISTRY_ACCESS_CONFIG", + "KafkaSchemaRegistryAuthType": "KAFKA_SCHEMA_REGISTRY_AUTH_TYPE", + "KafkaSchemaRegistryConfig": "KAFKA_SCHEMA_REGISTRY_CONFIG", + "KafkaSchemaValidationAttribute": "KAFKA_SCHEMA_VALIDATION_ATTRIBUTE", + "KafkaSchemaValidationConfig": "KAFKA_SCHEMA_VALIDATION_CONFIG", + "KMSAccessDeniedException": "KMS_ACCESS_DENIED_EXCEPTION", + "KMSDisabledException": "KMS_DISABLED_EXCEPTION", + "KMSInvalidStateException": "KMS_INVALID_STATE_EXCEPTION", + "KMSNotFoundException": "KMS_NOT_FOUND_EXCEPTION", + "LambdaManagedInstancesCapacityProviderConfig": "LAMBDA_MANAGED_INSTANCES_CAPACITY_PROVIDER_CONFIG", + "LastUpdateStatus": "LAST_UPDATE_STATUS", + "LastUpdateStatusReasonCode": "LAST_UPDATE_STATUS_REASON_CODE", + "Layer": "LAYER", + "LayersListItem": "LAYERS_LIST_ITEM", + "LayerVersionContentInput": "LAYER_VERSION_CONTENT_INPUT", + "LayerVersionContentOutput": "LAYER_VERSION_CONTENT_OUTPUT", + "LayerVersionsListItem": "LAYER_VERSIONS_LIST_ITEM", + "ListAliasesInput": "LIST_ALIASES_INPUT", + "ListAliasesOutput": "LIST_ALIASES_OUTPUT", + "ListCapacityProvidersInput": "LIST_CAPACITY_PROVIDERS_INPUT", + "ListCapacityProvidersOutput": "LIST_CAPACITY_PROVIDERS_OUTPUT", + "ListCodeSigningConfigsInput": "LIST_CODE_SIGNING_CONFIGS_INPUT", + "ListCodeSigningConfigsOutput": "LIST_CODE_SIGNING_CONFIGS_OUTPUT", + "ListDurableExecutionsByFunctionInput": "LIST_DURABLE_EXECUTIONS_BY_FUNCTION_INPUT", + "ListDurableExecutionsByFunctionOutput": "LIST_DURABLE_EXECUTIONS_BY_FUNCTION_OUTPUT", + "ListEventSourceMappingsInput": "LIST_EVENT_SOURCE_MAPPINGS_INPUT", + "ListEventSourceMappingsOutput": "LIST_EVENT_SOURCE_MAPPINGS_OUTPUT", + "ListFunctionEventInvokeConfigsInput": "LIST_FUNCTION_EVENT_INVOKE_CONFIGS_INPUT", + "ListFunctionEventInvokeConfigsOutput": "LIST_FUNCTION_EVENT_INVOKE_CONFIGS_OUTPUT", + "ListFunctionsByCodeSigningConfigInput": "LIST_FUNCTIONS_BY_CODE_SIGNING_CONFIG_INPUT", + "ListFunctionsByCodeSigningConfigOutput": "LIST_FUNCTIONS_BY_CODE_SIGNING_CONFIG_OUTPUT", + "ListFunctionsInput": "LIST_FUNCTIONS_INPUT", + "ListFunctionsOutput": "LIST_FUNCTIONS_OUTPUT", + "ListFunctionUrlConfigsInput": "LIST_FUNCTION_URL_CONFIGS_INPUT", + "ListFunctionUrlConfigsOutput": "LIST_FUNCTION_URL_CONFIGS_OUTPUT", + "ListFunctionVersionsByCapacityProviderInput": "LIST_FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER_INPUT", + "ListFunctionVersionsByCapacityProviderOutput": "LIST_FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER_OUTPUT", + "ListLayersInput": "LIST_LAYERS_INPUT", + "ListLayersOutput": "LIST_LAYERS_OUTPUT", + "ListLayerVersionsInput": "LIST_LAYER_VERSIONS_INPUT", + "ListLayerVersionsOutput": "LIST_LAYER_VERSIONS_OUTPUT", + "ListProvisionedConcurrencyConfigsInput": "LIST_PROVISIONED_CONCURRENCY_CONFIGS_INPUT", + "ListProvisionedConcurrencyConfigsOutput": "LIST_PROVISIONED_CONCURRENCY_CONFIGS_OUTPUT", + "ListTagsInput": "LIST_TAGS_INPUT", + "ListTagsOutput": "LIST_TAGS_OUTPUT", + "ListVersionsByFunctionInput": "LIST_VERSIONS_BY_FUNCTION_INPUT", + "ListVersionsByFunctionOutput": "LIST_VERSIONS_BY_FUNCTION_OUTPUT", + "LogFormat": "LOG_FORMAT", + "LoggingConfig": "LOGGING_CONFIG", + "LogType": "LOG_TYPE", + "ModeNotSupportedException": "MODE_NOT_SUPPORTED_EXCEPTION", + "NoPublishedVersionException": "NO_PUBLISHED_VERSION_EXCEPTION", + "OnFailure": "ON_FAILURE", + "OnSuccess": "ON_SUCCESS", + "Operation": "OPERATION", + "OperationAction": "OPERATION_ACTION", + "OperationStatus": "OPERATION_STATUS", + "OperationType": "OPERATION_TYPE", + "OperationUpdate": "OPERATION_UPDATE", + "PackageType": "PACKAGE_TYPE", + "PolicyLengthExceededException": "POLICY_LENGTH_EXCEEDED_EXCEPTION", + "PreconditionFailedException": "PRECONDITION_FAILED_EXCEPTION", + "PropagateTags": "PROPAGATE_TAGS", + "PropagateTagsMode": "PROPAGATE_TAGS_MODE", + "ProvisionedConcurrencyConfigListItem": "PROVISIONED_CONCURRENCY_CONFIG_LIST_ITEM", + "ProvisionedConcurrencyConfigNotFoundException": "PROVISIONED_CONCURRENCY_CONFIG_NOT_FOUND_EXCEPTION", + "ProvisionedConcurrencyStatusEnum": "PROVISIONED_CONCURRENCY_STATUS_ENUM", + "ProvisionedPollerConfig": "PROVISIONED_POLLER_CONFIG", + "PublicPolicyException": "PUBLIC_POLICY_EXCEPTION", + "PublishLayerVersionInput": "PUBLISH_LAYER_VERSION_INPUT", + "PublishLayerVersionOutput": "PUBLISH_LAYER_VERSION_OUTPUT", + "PublishVersionInput": "PUBLISH_VERSION_INPUT", + "PublishVersionOutput": "PUBLISH_VERSION_OUTPUT", + "PutFunctionCodeSigningConfigInput": "PUT_FUNCTION_CODE_SIGNING_CONFIG_INPUT", + "PutFunctionCodeSigningConfigOutput": "PUT_FUNCTION_CODE_SIGNING_CONFIG_OUTPUT", + "PutFunctionConcurrencyInput": "PUT_FUNCTION_CONCURRENCY_INPUT", + "PutFunctionConcurrencyOutput": "PUT_FUNCTION_CONCURRENCY_OUTPUT", + "PutFunctionEventInvokeConfigInput": "PUT_FUNCTION_EVENT_INVOKE_CONFIG_INPUT", + "PutFunctionEventInvokeConfigOutput": "PUT_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT", + "PutFunctionRecursionConfigInput": "PUT_FUNCTION_RECURSION_CONFIG_INPUT", + "PutFunctionRecursionConfigOutput": "PUT_FUNCTION_RECURSION_CONFIG_OUTPUT", + "PutFunctionScalingConfigInput": "PUT_FUNCTION_SCALING_CONFIG_INPUT", + "PutFunctionScalingConfigOutput": "PUT_FUNCTION_SCALING_CONFIG_OUTPUT", + "PutProvisionedConcurrencyConfigInput": "PUT_PROVISIONED_CONCURRENCY_CONFIG_INPUT", + "PutProvisionedConcurrencyConfigOutput": "PUT_PROVISIONED_CONCURRENCY_CONFIG_OUTPUT", + "PutResourcePolicyInput": "PUT_RESOURCE_POLICY_INPUT", + "PutResourcePolicyOutput": "PUT_RESOURCE_POLICY_OUTPUT", + "PutRuntimeManagementConfigInput": "PUT_RUNTIME_MANAGEMENT_CONFIG_INPUT", + "PutRuntimeManagementConfigOutput": "PUT_RUNTIME_MANAGEMENT_CONFIG_OUTPUT", + "RecursiveInvocationException": "RECURSIVE_INVOCATION_EXCEPTION", + "RecursiveLoop": "RECURSIVE_LOOP", + "RemoveLayerVersionPermissionInput": "REMOVE_LAYER_VERSION_PERMISSION_INPUT", + "RemoveLayerVersionPermissionOutput": "REMOVE_LAYER_VERSION_PERMISSION_OUTPUT", + "RemovePermissionInput": "REMOVE_PERMISSION_INPUT", + "RemovePermissionOutput": "REMOVE_PERMISSION_OUTPUT", + "RequestTooLargeException": "REQUEST_TOO_LARGE_EXCEPTION", + "ResolvedS3Object": "RESOLVED_S3_OBJECT", + "ResourceConflictException": "RESOURCE_CONFLICT_EXCEPTION", + "ResourceInUseException": "RESOURCE_IN_USE_EXCEPTION", + "ResourceNotFoundException": "RESOURCE_NOT_FOUND_EXCEPTION", + "ResourceNotReadyException": "RESOURCE_NOT_READY_EXCEPTION", + "ResponseStreamingInvocationType": "RESPONSE_STREAMING_INVOCATION_TYPE", + "RetryDetails": "RETRY_DETAILS", + "Runtime": "RUNTIME", + "RuntimeVersionConfig": "RUNTIME_VERSION_CONFIG", + "RuntimeVersionError": "RUNTIME_VERSION_ERROR", + "S3FilesConfig": "S3_FILES_CONFIG", + "S3FilesMountConnectivityException": "S3_FILES_MOUNT_CONNECTIVITY_EXCEPTION", + "S3FilesMountFailureException": "S3_FILES_MOUNT_FAILURE_EXCEPTION", + "S3FilesMountTimeoutException": "S3_FILES_MOUNT_TIMEOUT_EXCEPTION", + "S3ObjectStorageMode": "S3_OBJECT_STORAGE_MODE", + "ScalingConfig": "SCALING_CONFIG", + "SchemaRegistryEventRecordFormat": "SCHEMA_REGISTRY_EVENT_RECORD_FORMAT", + "SelfManagedEventSource": "SELF_MANAGED_EVENT_SOURCE", + "SelfManagedKafkaEventSourceConfig": "SELF_MANAGED_KAFKA_EVENT_SOURCE_CONFIG", + "SendDurableExecutionCallbackFailureInput": "SEND_DURABLE_EXECUTION_CALLBACK_FAILURE_INPUT", + "SendDurableExecutionCallbackFailureOutput": "SEND_DURABLE_EXECUTION_CALLBACK_FAILURE_OUTPUT", + "SendDurableExecutionCallbackHeartbeatInput": "SEND_DURABLE_EXECUTION_CALLBACK_HEARTBEAT_INPUT", + "SendDurableExecutionCallbackHeartbeatOutput": "SEND_DURABLE_EXECUTION_CALLBACK_HEARTBEAT_OUTPUT", + "SendDurableExecutionCallbackSuccessInput": "SEND_DURABLE_EXECUTION_CALLBACK_SUCCESS_INPUT", + "SendDurableExecutionCallbackSuccessOutput": "SEND_DURABLE_EXECUTION_CALLBACK_SUCCESS_OUTPUT", + "SerializedRequestEntityTooLargeException": "SERIALIZED_REQUEST_ENTITY_TOO_LARGE_EXCEPTION", + "ServiceException": "SERVICE_EXCEPTION", + "ServiceQuotaExceededException": "SERVICE_QUOTA_EXCEEDED_EXCEPTION", + "SnapStart": "SNAP_START", + "SnapStartApplyOn": "SNAP_START_APPLY_ON", + "SnapStartException": "SNAP_START_EXCEPTION", + "SnapStartNotReadyException": "SNAP_START_NOT_READY_EXCEPTION", + "SnapStartOptimizationStatus": "SNAP_START_OPTIMIZATION_STATUS", + "SnapStartRegenerationFailureException": "SNAP_START_REGENERATION_FAILURE_EXCEPTION", + "SnapStartResponse": "SNAP_START_RESPONSE", + "SnapStartTimeoutException": "SNAP_START_TIMEOUT_EXCEPTION", + "SourceAccessConfiguration": "SOURCE_ACCESS_CONFIGURATION", + "SourceAccessType": "SOURCE_ACCESS_TYPE", + "State": "STATE", + "StateReasonCode": "STATE_REASON_CODE", + "StepDetails": "STEP_DETAILS", + "StepFailedDetails": "STEP_FAILED_DETAILS", + "StepOptions": "STEP_OPTIONS", + "StepStartedDetails": "STEP_STARTED_DETAILS", + "StepSucceededDetails": "STEP_SUCCEEDED_DETAILS", + "StopDurableExecutionInput": "STOP_DURABLE_EXECUTION_INPUT", + "StopDurableExecutionOutput": "STOP_DURABLE_EXECUTION_OUTPUT", + "SubnetIPAddressLimitReachedException": "SUBNET_IP_ADDRESS_LIMIT_REACHED_EXCEPTION", + "SystemLogLevel": "SYSTEM_LOG_LEVEL", + "TagResourceInput": "TAG_RESOURCE_INPUT", + "TagResourceOutput": "TAG_RESOURCE_OUTPUT", + "TagsError": "TAGS_ERROR", + "TargetTrackingScalingPolicy": "TARGET_TRACKING_SCALING_POLICY", + "TenancyConfig": "TENANCY_CONFIG", + "TenantIsolationMode": "TENANT_ISOLATION_MODE", + "ThrottleReason": "THROTTLE_REASON", + "TooManyRequestsException": "TOO_MANY_REQUESTS_EXCEPTION", + "TraceHeader": "TRACE_HEADER", + "TracingConfig": "TRACING_CONFIG", + "TracingConfigResponse": "TRACING_CONFIG_RESPONSE", + "TracingMode": "TRACING_MODE", + "UnsupportedMediaTypeException": "UNSUPPORTED_MEDIA_TYPE_EXCEPTION", + "UntagResourceInput": "UNTAG_RESOURCE_INPUT", + "UntagResourceOutput": "UNTAG_RESOURCE_OUTPUT", + "UpdateAliasInput": "UPDATE_ALIAS_INPUT", + "UpdateAliasOutput": "UPDATE_ALIAS_OUTPUT", + "UpdateCapacityProviderInput": "UPDATE_CAPACITY_PROVIDER_INPUT", + "UpdateCapacityProviderOutput": "UPDATE_CAPACITY_PROVIDER_OUTPUT", + "UpdateCodeSigningConfigInput": "UPDATE_CODE_SIGNING_CONFIG_INPUT", + "UpdateCodeSigningConfigOutput": "UPDATE_CODE_SIGNING_CONFIG_OUTPUT", + "UpdateEventSourceMappingInput": "UPDATE_EVENT_SOURCE_MAPPING_INPUT", + "UpdateEventSourceMappingOutput": "UPDATE_EVENT_SOURCE_MAPPING_OUTPUT", + "UpdateFunctionCodeInput": "UPDATE_FUNCTION_CODE_INPUT", + "UpdateFunctionCodeOutput": "UPDATE_FUNCTION_CODE_OUTPUT", + "UpdateFunctionConfigurationInput": "UPDATE_FUNCTION_CONFIGURATION_INPUT", + "UpdateFunctionConfigurationOutput": "UPDATE_FUNCTION_CONFIGURATION_OUTPUT", + "UpdateFunctionEventInvokeConfigInput": "UPDATE_FUNCTION_EVENT_INVOKE_CONFIG_INPUT", + "UpdateFunctionEventInvokeConfigOutput": "UPDATE_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT", + "UpdateFunctionUrlConfigInput": "UPDATE_FUNCTION_URL_CONFIG_INPUT", + "UpdateFunctionUrlConfigOutput": "UPDATE_FUNCTION_URL_CONFIG_OUTPUT", + "UpdateRuntimeOn": "UPDATE_RUNTIME_ON", + "VpcConfig": "VPC_CONFIG", + "VpcConfigResponse": "VPC_CONFIG_RESPONSE", + "WaitCancelledDetails": "WAIT_CANCELLED_DETAILS", + "WaitDetails": "WAIT_DETAILS", + "WaitOptions": "WAIT_OPTIONS", + "WaitStartedDetails": "WAIT_STARTED_DETAILS", + "WaitSucceededDetails": "WAIT_SUCCEEDED_DETAILS", + }, + shape_names=frozenset( + { + "AccountLimit", + "AccountUsage", + "AddLayerVersionPermissionInput", + "AddLayerVersionPermissionOutput", + "AddPermissionInput", + "AddPermissionOutput", + "AliasConfiguration", + "AliasLimitExceededException", + "AliasRoutingConfiguration", + "AllowedPublishers", + "AmazonManagedKafkaEventSourceConfig", + "ApplicationLogLevel", + "Architecture", + "CallbackDetails", + "CallbackFailedDetails", + "CallbackOptions", + "CallbackStartedDetails", + "CallbackSucceededDetails", + "CallbackTimedOutDetails", + "CallbackTimeoutException", + "CapacityProvider", + "CapacityProviderConfig", + "CapacityProviderLimitExceededException", + "CapacityProviderLoggingConfig", + "CapacityProviderPermissionsConfig", + "CapacityProviderPredefinedMetricType", + "CapacityProviderScalingConfig", + "CapacityProviderScalingMode", + "CapacityProviderState", + "CapacityProviderTelemetryConfig", + "CapacityProviderVpcConfig", + "ChainedInvokeDetails", + "ChainedInvokeFailedDetails", + "ChainedInvokeOptions", + "ChainedInvokeStartedDetails", + "ChainedInvokeStoppedDetails", + "ChainedInvokeSucceededDetails", + "ChainedInvokeTimedOutDetails", + "CheckpointDurableExecutionInput", + "CheckpointDurableExecutionOutput", + "CheckpointUpdatedExecutionState", + "CodeArtifactUserDeletedException", + "CodeArtifactUserFailedException", + "CodeArtifactUserPendingException", + "CodeSigningConfig", + "CodeSigningConfigNotFoundException", + "CodeSigningPolicies", + "CodeSigningPolicy", + "CodeStorageExceededException", + "CodeVerificationFailedException", + "Concurrency", + "ContextDetails", + "ContextFailedDetails", + "ContextOptions", + "ContextStartedDetails", + "ContextSucceededDetails", + "Cors", + "CreateAliasInput", + "CreateAliasOutput", + "CreateCapacityProviderInput", + "CreateCapacityProviderOutput", + "CreateCodeSigningConfigInput", + "CreateCodeSigningConfigOutput", + "CreateEventSourceMappingInput", + "CreateEventSourceMappingOutput", + "CreateFunctionInput", + "CreateFunctionOutput", + "CreateFunctionUrlConfigInput", + "CreateFunctionUrlConfigOutput", + "DeadLetterConfig", + "DeleteAliasInput", + "DeleteAliasOutput", + "DeleteCapacityProviderInput", + "DeleteCapacityProviderOutput", + "DeleteCodeSigningConfigInput", + "DeleteCodeSigningConfigOutput", + "DeleteEventSourceMappingInput", + "DeleteEventSourceMappingOutput", + "DeleteFunctionCodeSigningConfigInput", + "DeleteFunctionCodeSigningConfigOutput", + "DeleteFunctionConcurrencyInput", + "DeleteFunctionConcurrencyOutput", + "DeleteFunctionEventInvokeConfigInput", + "DeleteFunctionEventInvokeConfigOutput", + "DeleteFunctionInput", + "DeleteFunctionOutput", + "DeleteFunctionUrlConfigInput", + "DeleteFunctionUrlConfigOutput", + "DeleteLayerVersionInput", + "DeleteLayerVersionOutput", + "DeleteProvisionedConcurrencyConfigInput", + "DeleteProvisionedConcurrencyConfigOutput", + "DeleteResourcePolicyInput", + "DeleteResourcePolicyOutput", + "DestinationConfig", + "DirectS3Read", + "DocumentDBEventSourceConfig", + "DurableConfig", + "DurableExecutionAlreadyStartedException", + "EC2AccessDeniedException", + "EC2ThrottledException", + "EC2UnexpectedException", + "EFSIOException", + "EFSMountConnectivityException", + "EFSMountFailureException", + "EFSMountTimeoutException", + "ENILimitReachedException", + "ENINotReadyException", + "EndPointType", + "Environment", + "EnvironmentError", + "EnvironmentResponse", + "EphemeralStorage", + "ErrorObject", + "Event", + "EventError", + "EventInput", + "EventResult", + "EventSourceMappingConfiguration", + "EventSourceMappingLoggingConfig", + "EventSourceMappingMetric", + "EventSourceMappingMetricsConfig", + "EventSourceMappingSystemLogLevel", + "EventSourcePosition", + "EventType", + "Execution", + "ExecutionDetails", + "ExecutionFailedDetails", + "ExecutionStartedDetails", + "ExecutionStatus", + "ExecutionStoppedDetails", + "ExecutionSucceededDetails", + "ExecutionTimedOutDetails", + "FileSystemConfig", + "Filter", + "FilterCriteria", + "FilterCriteriaError", + "FullDocument", + "FunctionCode", + "FunctionCodeLocation", + "FunctionCodeLocationError", + "FunctionConfiguration", + "FunctionEventInvokeConfig", + "FunctionResponseType", + "FunctionScalingConfig", + "FunctionUrlAuthType", + "FunctionUrlConfig", + "FunctionVersion", + "FunctionVersionLatestPublished", + "FunctionVersionsByCapacityProviderListItem", + "FunctionVersionsPerCapacityProviderLimitExceededException", + "GetAccountSettingsInput", + "GetAccountSettingsOutput", + "GetAliasInput", + "GetAliasOutput", + "GetCapacityProviderInput", + "GetCapacityProviderOutput", + "GetCodeSigningConfigInput", + "GetCodeSigningConfigOutput", + "GetDurableExecutionHistoryInput", + "GetDurableExecutionHistoryOutput", + "GetDurableExecutionInput", + "GetDurableExecutionOutput", + "GetDurableExecutionStateInput", + "GetDurableExecutionStateOutput", + "GetEventSourceMappingInput", + "GetEventSourceMappingOutput", + "GetFunctionCodeSigningConfigInput", + "GetFunctionCodeSigningConfigOutput", + "GetFunctionConcurrencyInput", + "GetFunctionConcurrencyOutput", + "GetFunctionConfigurationInput", + "GetFunctionConfigurationOutput", + "GetFunctionEventInvokeConfigInput", + "GetFunctionEventInvokeConfigOutput", + "GetFunctionInput", + "GetFunctionOutput", + "GetFunctionRecursionConfigInput", + "GetFunctionRecursionConfigOutput", + "GetFunctionScalingConfigInput", + "GetFunctionScalingConfigOutput", + "GetFunctionUrlConfigInput", + "GetFunctionUrlConfigOutput", + "GetLayerVersionByArnInput", + "GetLayerVersionByArnOutput", + "GetLayerVersionInput", + "GetLayerVersionOutput", + "GetLayerVersionPolicyInput", + "GetLayerVersionPolicyOutput", + "GetPolicyInput", + "GetPolicyOutput", + "GetProvisionedConcurrencyConfigInput", + "GetProvisionedConcurrencyConfigOutput", + "GetResourcePolicyInput", + "GetResourcePolicyOutput", + "GetRuntimeManagementConfigInput", + "GetRuntimeManagementConfigOutput", + "ImageConfig", + "ImageConfigError", + "ImageConfigResponse", + "InstanceRequirements", + "InvalidCodeSignatureException", + "InvalidParameterValueException", + "InvalidRequestContentException", + "InvalidRuntimeException", + "InvalidSecurityGroupIDException", + "InvalidSubnetIDException", + "InvalidZipFileException", + "InvocationCompletedDetails", + "InvocationType", + "InvokeAsyncInput", + "InvokeAsyncOutput", + "InvokeInput", + "InvokeMode", + "InvokeOutput", + "InvokeResponseStreamUpdate", + "InvokeWithResponseStreamCompleteEvent", + "InvokeWithResponseStreamInput", + "InvokeWithResponseStreamOutput", + "InvokeWithResponseStreamResponseEvent", + "KMSAccessDeniedException", + "KMSDisabledException", + "KMSInvalidStateException", + "KMSNotFoundException", + "KafkaSchemaRegistryAccessConfig", + "KafkaSchemaRegistryAuthType", + "KafkaSchemaRegistryConfig", + "KafkaSchemaValidationAttribute", + "KafkaSchemaValidationConfig", + "LambdaManagedInstancesCapacityProviderConfig", + "LastUpdateStatus", + "LastUpdateStatusReasonCode", + "Layer", + "LayerVersionContentInput", + "LayerVersionContentOutput", + "LayerVersionsListItem", + "LayersListItem", + "ListAliasesInput", + "ListAliasesOutput", + "ListCapacityProvidersInput", + "ListCapacityProvidersOutput", + "ListCodeSigningConfigsInput", + "ListCodeSigningConfigsOutput", + "ListDurableExecutionsByFunctionInput", + "ListDurableExecutionsByFunctionOutput", + "ListEventSourceMappingsInput", + "ListEventSourceMappingsOutput", + "ListFunctionEventInvokeConfigsInput", + "ListFunctionEventInvokeConfigsOutput", + "ListFunctionUrlConfigsInput", + "ListFunctionUrlConfigsOutput", + "ListFunctionVersionsByCapacityProviderInput", + "ListFunctionVersionsByCapacityProviderOutput", + "ListFunctionsByCodeSigningConfigInput", + "ListFunctionsByCodeSigningConfigOutput", + "ListFunctionsInput", + "ListFunctionsOutput", + "ListLayerVersionsInput", + "ListLayerVersionsOutput", + "ListLayersInput", + "ListLayersOutput", + "ListProvisionedConcurrencyConfigsInput", + "ListProvisionedConcurrencyConfigsOutput", + "ListTagsInput", + "ListTagsOutput", + "ListVersionsByFunctionInput", + "ListVersionsByFunctionOutput", + "LogFormat", + "LogType", + "LoggingConfig", + "ModeNotSupportedException", + "NoPublishedVersionException", + "OnFailure", + "OnSuccess", + "Operation", + "OperationAction", + "OperationStatus", + "OperationType", + "OperationUpdate", + "PackageType", + "PolicyLengthExceededException", + "PreconditionFailedException", + "PropagateTags", + "PropagateTagsMode", + "ProvisionedConcurrencyConfigListItem", + "ProvisionedConcurrencyConfigNotFoundException", + "ProvisionedConcurrencyStatusEnum", + "ProvisionedPollerConfig", + "PublicPolicyException", + "PublishLayerVersionInput", + "PublishLayerVersionOutput", + "PublishVersionInput", + "PublishVersionOutput", + "PutFunctionCodeSigningConfigInput", + "PutFunctionCodeSigningConfigOutput", + "PutFunctionConcurrencyInput", + "PutFunctionConcurrencyOutput", + "PutFunctionEventInvokeConfigInput", + "PutFunctionEventInvokeConfigOutput", + "PutFunctionRecursionConfigInput", + "PutFunctionRecursionConfigOutput", + "PutFunctionScalingConfigInput", + "PutFunctionScalingConfigOutput", + "PutProvisionedConcurrencyConfigInput", + "PutProvisionedConcurrencyConfigOutput", + "PutResourcePolicyInput", + "PutResourcePolicyOutput", + "PutRuntimeManagementConfigInput", + "PutRuntimeManagementConfigOutput", + "RecursiveInvocationException", + "RecursiveLoop", + "RemoveLayerVersionPermissionInput", + "RemoveLayerVersionPermissionOutput", + "RemovePermissionInput", + "RemovePermissionOutput", + "RequestTooLargeException", + "ResolvedS3Object", + "ResourceConflictException", + "ResourceInUseException", + "ResourceNotFoundException", + "ResourceNotReadyException", + "ResponseStreamingInvocationType", + "RetryDetails", + "Runtime", + "RuntimeVersionConfig", + "RuntimeVersionError", + "S3FilesConfig", + "S3FilesMountConnectivityException", + "S3FilesMountFailureException", + "S3FilesMountTimeoutException", + "S3ObjectStorageMode", + "ScalingConfig", + "SchemaRegistryEventRecordFormat", + "SelfManagedEventSource", + "SelfManagedKafkaEventSourceConfig", + "SendDurableExecutionCallbackFailureInput", + "SendDurableExecutionCallbackFailureOutput", + "SendDurableExecutionCallbackHeartbeatInput", + "SendDurableExecutionCallbackHeartbeatOutput", + "SendDurableExecutionCallbackSuccessInput", + "SendDurableExecutionCallbackSuccessOutput", + "SerializedRequestEntityTooLargeException", + "ServiceException", + "ServiceQuotaExceededException", + "SnapStart", + "SnapStartApplyOn", + "SnapStartException", + "SnapStartNotReadyException", + "SnapStartOptimizationStatus", + "SnapStartRegenerationFailureException", + "SnapStartResponse", + "SnapStartTimeoutException", + "SourceAccessConfiguration", + "SourceAccessType", + "State", + "StateReasonCode", + "StepDetails", + "StepFailedDetails", + "StepOptions", + "StepStartedDetails", + "StepSucceededDetails", + "StopDurableExecutionInput", + "StopDurableExecutionOutput", + "SubnetIPAddressLimitReachedException", + "SystemLogLevel", + "TagResourceInput", + "TagResourceOutput", + "TagsError", + "TargetTrackingScalingPolicy", + "TenancyConfig", + "TenantIsolationMode", + "ThrottleReason", + "TooManyRequestsException", + "TraceHeader", + "TracingConfig", + "TracingConfigResponse", + "TracingMode", + "UnsupportedMediaTypeException", + "UntagResourceInput", + "UntagResourceOutput", + "UpdateAliasInput", + "UpdateAliasOutput", + "UpdateCapacityProviderInput", + "UpdateCapacityProviderOutput", + "UpdateCodeSigningConfigInput", + "UpdateCodeSigningConfigOutput", + "UpdateEventSourceMappingInput", + "UpdateEventSourceMappingOutput", + "UpdateFunctionCodeInput", + "UpdateFunctionCodeOutput", + "UpdateFunctionConfigurationInput", + "UpdateFunctionConfigurationOutput", + "UpdateFunctionEventInvokeConfigInput", + "UpdateFunctionEventInvokeConfigOutput", + "UpdateFunctionUrlConfigInput", + "UpdateFunctionUrlConfigOutput", + "UpdateRuntimeOn", + "VpcConfig", + "VpcConfigResponse", + "WaitCancelledDetails", + "WaitDetails", + "WaitOptions", + "WaitStartedDetails", + "WaitSucceededDetails", + } + ), + service_error="ServiceError", +) + + +def __getattr__(name: str): + return _registry.build(name) + + +ADD_LAYER_VERSION_PERMISSION: APIOperation[ + AddLayerVersionPermissionInput, AddLayerVersionPermissionOutput +] = APIOperation( + static_schema=_SCHEMA_ADD_LAYER_VERSION_PERMISSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#PolicyLengthExceededException"), + ShapeID("com.amazonaws.lambda#PreconditionFailedException"), + ShapeID("com.amazonaws.lambda#ResourceConflictException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +ADD_PERMISSION: APIOperation[AddPermissionInput, AddPermissionOutput] = APIOperation( + static_schema=_SCHEMA_ADD_PERMISSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#PolicyLengthExceededException"), + ShapeID("com.amazonaws.lambda#PreconditionFailedException"), + ShapeID("com.amazonaws.lambda#PublicPolicyException"), + ShapeID("com.amazonaws.lambda#ResourceConflictException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +CREATE_CAPACITY_PROVIDER: APIOperation[ + CreateCapacityProviderInput, CreateCapacityProviderOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_CAPACITY_PROVIDER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#CapacityProviderLimitExceededException"), + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceConflictException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +DELETE_CAPACITY_PROVIDER: APIOperation[ + DeleteCapacityProviderInput, DeleteCapacityProviderOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_CAPACITY_PROVIDER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceConflictException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) +GET_CAPACITY_PROVIDER: APIOperation[ + GetCapacityProviderInput, GetCapacityProviderOutput +] = APIOperation( + static_schema=_SCHEMA_GET_CAPACITY_PROVIDER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -def _serialize_tag_key_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_tag_key_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class UntagResourceInput: - """Dataclass for UntagResourceInput structure.""" - - resource: str | None = None - """The resource's Amazon Resource Name (ARN).""" - - tag_keys: list[str] | None = None - """A list of tag keys to remove from the resource.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNTAG_RESOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource is not None: - serializer.write_string( - _SCHEMA_UNTAG_RESOURCE_INPUT.members["Resource"], self.resource - ) - - if self.tag_keys is not None: - _serialize_tag_key_list( - serializer, - _SCHEMA_UNTAG_RESOURCE_INPUT.members["TagKeys"], - self.tag_keys, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +LIST_CAPACITY_PROVIDERS: APIOperation[ + ListCapacityProvidersInput, ListCapacityProvidersOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_CAPACITY_PROVIDERS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource"] = de.read_string( - _SCHEMA_UNTAG_RESOURCE_INPUT.members["Resource"] - ) +LIST_FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER: APIOperation[ + ListFunctionVersionsByCapacityProviderInput, + ListFunctionVersionsByCapacityProviderOutput, +] = APIOperation( + static_schema=_SCHEMA_LIST_FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 1: - kwargs["tag_keys"] = _deserialize_tag_key_list( - de, _SCHEMA_UNTAG_RESOURCE_INPUT.members["TagKeys"] - ) +UPDATE_CAPACITY_PROVIDER: APIOperation[ + UpdateCapacityProviderInput, UpdateCapacityProviderOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_CAPACITY_PROVIDER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceConflictException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case _: - logger.debug("Unexpected member schema: %s", schema) +CREATE_CODE_SIGNING_CONFIG: APIOperation[ + CreateCodeSigningConfigInput, CreateCodeSigningConfigOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_CODE_SIGNING_CONFIG, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - deserializer.read_struct(_SCHEMA_UNTAG_RESOURCE_INPUT, consumer=_consumer) - return kwargs +DELETE_CODE_SIGNING_CONFIG: APIOperation[ + DeleteCodeSigningConfigInput, DeleteCodeSigningConfigOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_CODE_SIGNING_CONFIG, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceConflictException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +GET_CODE_SIGNING_CONFIG: APIOperation[ + GetCodeSigningConfigInput, GetCodeSigningConfigOutput +] = APIOperation( + static_schema=_SCHEMA_GET_CODE_SIGNING_CONFIG, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -@dataclass(kw_only=True) -class UntagResourceOutput: - """Dataclass for UntagResourceOutput structure.""" +LIST_CODE_SIGNING_CONFIGS: APIOperation[ + ListCodeSigningConfigsInput, ListCodeSigningConfigsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_CODE_SIGNING_CONFIGS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ +LIST_FUNCTIONS_BY_CODE_SIGNING_CONFIG: APIOperation[ + ListFunctionsByCodeSigningConfigInput, ListFunctionsByCodeSigningConfigOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_FUNCTIONS_BY_CODE_SIGNING_CONFIG, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNTAG_RESOURCE_OUTPUT, self) +UPDATE_CODE_SIGNING_CONFIG: APIOperation[ + UpdateCodeSigningConfigInput, UpdateCodeSigningConfigOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_CODE_SIGNING_CONFIG, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize_members(self, serializer: ShapeSerializer): - pass +DELETE_FUNCTION: APIOperation[DeleteFunctionInput, DeleteFunctionOutput] = APIOperation( + static_schema=_SCHEMA_DELETE_FUNCTION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceConflictException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) +DELETE_FUNCTION_EVENT_INVOKE_CONFIG: APIOperation[ + DeleteFunctionEventInvokeConfigInput, DeleteFunctionEventInvokeConfigOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_FUNCTION_EVENT_INVOKE_CONFIG, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceConflictException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +DELETE_RESOURCE_POLICY: APIOperation[ + DeleteResourcePolicyInput, DeleteResourcePolicyOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_RESOURCE_POLICY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#PreconditionFailedException"), + ShapeID("com.amazonaws.lambda#ResourceConflictException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) +CHECKPOINT_DURABLE_EXECUTION: APIOperation[ + CheckpointDurableExecutionInput, CheckpointDurableExecutionOutput +] = APIOperation( + static_schema=_SCHEMA_CHECKPOINT_DURABLE_EXECUTION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#KMSAccessDeniedException"), + ShapeID("com.amazonaws.lambda#KMSDisabledException"), + ShapeID("com.amazonaws.lambda#KMSInvalidStateException"), + ShapeID("com.amazonaws.lambda#KMSNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - deserializer.read_struct(_SCHEMA_UNTAG_RESOURCE_OUTPUT, consumer=_consumer) - return kwargs +GET_DURABLE_EXECUTION: APIOperation[ + GetDurableExecutionInput, GetDurableExecutionOutput +] = APIOperation( + static_schema=_SCHEMA_GET_DURABLE_EXECUTION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#KMSAccessDeniedException"), + ShapeID("com.amazonaws.lambda#KMSDisabledException"), + ShapeID("com.amazonaws.lambda#KMSInvalidStateException"), + ShapeID("com.amazonaws.lambda#KMSNotFoundException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +GET_DURABLE_EXECUTION_HISTORY: APIOperation[ + GetDurableExecutionHistoryInput, GetDurableExecutionHistoryOutput +] = APIOperation( + static_schema=_SCHEMA_GET_DURABLE_EXECUTION_HISTORY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#KMSAccessDeniedException"), + ShapeID("com.amazonaws.lambda#KMSDisabledException"), + ShapeID("com.amazonaws.lambda#KMSInvalidStateException"), + ShapeID("com.amazonaws.lambda#KMSNotFoundException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -UNTAG_RESOURCE = APIOperation( - input=UntagResourceInput, - output=UntagResourceOutput, - schema=_SCHEMA_UNTAG_RESOURCE, - input_schema=_SCHEMA_UNTAG_RESOURCE_INPUT, - output_schema=_SCHEMA_UNTAG_RESOURCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceConflictException" - ): ResourceConflictException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), +GET_DURABLE_EXECUTION_STATE: APIOperation[ + GetDurableExecutionStateInput, GetDurableExecutionStateOutput +] = APIOperation( + static_schema=_SCHEMA_GET_DURABLE_EXECUTION_STATE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#KMSAccessDeniedException"), + ShapeID("com.amazonaws.lambda#KMSDisabledException"), + ShapeID("com.amazonaws.lambda#KMSInvalidStateException"), + ShapeID("com.amazonaws.lambda#KMSNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, +) + +STOP_DURABLE_EXECUTION: APIOperation[ + StopDurableExecutionInput, StopDurableExecutionOutput +] = APIOperation( + static_schema=_SCHEMA_STOP_DURABLE_EXECUTION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#KMSAccessDeniedException"), + ShapeID("com.amazonaws.lambda#KMSDisabledException"), + ShapeID("com.amazonaws.lambda#KMSInvalidStateException"), + ShapeID("com.amazonaws.lambda#KMSNotFoundException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +CREATE_EVENT_SOURCE_MAPPING: APIOperation[ + CreateEventSourceMappingInput, CreateEventSourceMappingOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_EVENT_SOURCE_MAPPING, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceConflictException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +DELETE_EVENT_SOURCE_MAPPING: APIOperation[ + DeleteEventSourceMappingInput, DeleteEventSourceMappingOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_EVENT_SOURCE_MAPPING, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceConflictException"), + ShapeID("com.amazonaws.lambda#ResourceInUseException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +GET_EVENT_SOURCE_MAPPING: APIOperation[ + GetEventSourceMappingInput, GetEventSourceMappingOutput +] = APIOperation( + static_schema=_SCHEMA_GET_EVENT_SOURCE_MAPPING, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) +LIST_EVENT_SOURCE_MAPPINGS: APIOperation[ + ListEventSourceMappingsInput, ListEventSourceMappingsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_EVENT_SOURCE_MAPPINGS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -@dataclass(kw_only=True) -class UpdateFunctionEventInvokeConfigInput: - """Dataclass for UpdateFunctionEventInvokeConfigInput structure.""" - - function_name: str | None = None - """ - The name or ARN of the Lambda function, version, or alias. - - **Name formats** - - - **Function name** - `my-function` (name-only), `my-function:v1` (with - alias). - - - **Function ARN** - - `arn:aws:lambda:us-west-2:123456789012:function:my-function`. - - - **Partial ARN** - `123456789012:function:my-function`. - - You can append a version number or alias to any of the formats. The - length constraint applies only to the full ARN. If you specify only the - function name, it is limited to 64 characters in length. - """ - - qualifier: str | None = None - """A version number or alias name.""" - - maximum_retry_attempts: int | None = None - """The maximum number of times to retry when the function returns an error.""" - - maximum_event_age_in_seconds: int | None = None - """ - The maximum age of a request that Lambda sends to a function for - processing. - """ - - destination_config: DestinationConfig | None = None - """ - A destination for events after they have been sent to a function for - processing. - - **Destinations** - - - **Function** - The Amazon Resource Name (ARN) of a Lambda function. - - - **Queue** - The ARN of a standard SQS queue. - - - **Bucket** - The ARN of an Amazon S3 bucket. - - - **Topic** - The ARN of a standard SNS topic. - - - **Event Bus** - The ARN of an Amazon EventBridge event bus. - - Note: - S3 buckets are supported only for on-failure destinations. To retain - records of successful invocations, use another destination type. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_FUNCTION_EVENT_INVOKE_CONFIG_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.function_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_EVENT_INVOKE_CONFIG_INPUT.members[ - "FunctionName" - ], - self.function_name, - ) - - if self.qualifier is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_EVENT_INVOKE_CONFIG_INPUT.members["Qualifier"], - self.qualifier, - ) - - if self.maximum_retry_attempts is not None: - serializer.write_integer( - _SCHEMA_UPDATE_FUNCTION_EVENT_INVOKE_CONFIG_INPUT.members[ - "MaximumRetryAttempts" - ], - self.maximum_retry_attempts, - ) - - if self.maximum_event_age_in_seconds is not None: - serializer.write_integer( - _SCHEMA_UPDATE_FUNCTION_EVENT_INVOKE_CONFIG_INPUT.members[ - "MaximumEventAgeInSeconds" - ], - self.maximum_event_age_in_seconds, - ) +UPDATE_EVENT_SOURCE_MAPPING: APIOperation[ + UpdateEventSourceMappingInput, UpdateEventSourceMappingOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_EVENT_SOURCE_MAPPING, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceConflictException"), + ShapeID("com.amazonaws.lambda#ResourceInUseException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - if self.destination_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_FUNCTION_EVENT_INVOKE_CONFIG_INPUT.members[ - "DestinationConfig" - ], - self.destination_config, - ) +CREATE_FUNCTION: APIOperation[CreateFunctionInput, CreateFunctionOutput] = APIOperation( + static_schema=_SCHEMA_CREATE_FUNCTION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#CodeSigningConfigNotFoundException"), + ShapeID("com.amazonaws.lambda#CodeStorageExceededException"), + ShapeID("com.amazonaws.lambda#CodeVerificationFailedException"), + ShapeID( + "com.amazonaws.lambda#FunctionVersionsPerCapacityProviderLimitExceededException" + ), + ShapeID("com.amazonaws.lambda#InvalidCodeSignatureException"), + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceConflictException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) +CREATE_FUNCTION_URL_CONFIG: APIOperation[ + CreateFunctionUrlConfigInput, CreateFunctionUrlConfigOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_FUNCTION_URL_CONFIG, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceConflictException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +DELETE_FUNCTION_CODE_SIGNING_CONFIG: APIOperation[ + DeleteFunctionCodeSigningConfigInput, DeleteFunctionCodeSigningConfigOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_FUNCTION_CODE_SIGNING_CONFIG, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#CodeSigningConfigNotFoundException"), + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceConflictException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["function_name"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_EVENT_INVOKE_CONFIG_INPUT.members[ - "FunctionName" - ] - ) +DELETE_FUNCTION_CONCURRENCY: APIOperation[ + DeleteFunctionConcurrencyInput, DeleteFunctionConcurrencyOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_FUNCTION_CONCURRENCY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceConflictException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 1: - kwargs["qualifier"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_EVENT_INVOKE_CONFIG_INPUT.members[ - "Qualifier" - ] - ) +DELETE_FUNCTION_URL_CONFIG: APIOperation[ + DeleteFunctionUrlConfigInput, DeleteFunctionUrlConfigOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_FUNCTION_URL_CONFIG, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceConflictException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 2: - kwargs["maximum_retry_attempts"] = de.read_integer( - _SCHEMA_UPDATE_FUNCTION_EVENT_INVOKE_CONFIG_INPUT.members[ - "MaximumRetryAttempts" - ] - ) +GET_FUNCTION: APIOperation[GetFunctionInput, GetFunctionOutput] = APIOperation( + static_schema=_SCHEMA_GET_FUNCTION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 3: - kwargs["maximum_event_age_in_seconds"] = de.read_integer( - _SCHEMA_UPDATE_FUNCTION_EVENT_INVOKE_CONFIG_INPUT.members[ - "MaximumEventAgeInSeconds" - ] - ) +GET_FUNCTION_CODE_SIGNING_CONFIG: APIOperation[ + GetFunctionCodeSigningConfigInput, GetFunctionCodeSigningConfigOutput +] = APIOperation( + static_schema=_SCHEMA_GET_FUNCTION_CODE_SIGNING_CONFIG, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#CodeSigningConfigNotFoundException"), + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 4: - kwargs["destination_config"] = DestinationConfig.deserialize(de) +GET_FUNCTION_CONCURRENCY: APIOperation[ + GetFunctionConcurrencyInput, GetFunctionConcurrencyOutput +] = APIOperation( + static_schema=_SCHEMA_GET_FUNCTION_CONCURRENCY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case _: - logger.debug("Unexpected member schema: %s", schema) +GET_FUNCTION_CONFIGURATION: APIOperation[ + GetFunctionConfigurationInput, GetFunctionConfigurationOutput +] = APIOperation( + static_schema=_SCHEMA_GET_FUNCTION_CONFIGURATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +GET_FUNCTION_RECURSION_CONFIG: APIOperation[ + GetFunctionRecursionConfigInput, GetFunctionRecursionConfigOutput +] = APIOperation( + static_schema=_SCHEMA_GET_FUNCTION_RECURSION_CONFIG, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +GET_FUNCTION_SCALING_CONFIG: APIOperation[ + GetFunctionScalingConfigInput, GetFunctionScalingConfigOutput +] = APIOperation( + static_schema=_SCHEMA_GET_FUNCTION_SCALING_CONFIG, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +GET_FUNCTION_URL_CONFIG: APIOperation[ + GetFunctionUrlConfigInput, GetFunctionUrlConfigOutput +] = APIOperation( + static_schema=_SCHEMA_GET_FUNCTION_URL_CONFIG, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +GET_POLICY: APIOperation[GetPolicyInput, GetPolicyOutput] = APIOperation( + static_schema=_SCHEMA_GET_POLICY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +GET_RUNTIME_MANAGEMENT_CONFIG: APIOperation[ + GetRuntimeManagementConfigInput, GetRuntimeManagementConfigOutput +] = APIOperation( + static_schema=_SCHEMA_GET_RUNTIME_MANAGEMENT_CONFIG, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +INVOKE: APIOperation[InvokeInput, InvokeOutput] = APIOperation( + static_schema=_SCHEMA_INVOKE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#CodeArtifactUserDeletedException"), + ShapeID("com.amazonaws.lambda#CodeArtifactUserFailedException"), + ShapeID("com.amazonaws.lambda#CodeArtifactUserPendingException"), + ShapeID("com.amazonaws.lambda#DurableExecutionAlreadyStartedException"), + ShapeID("com.amazonaws.lambda#EC2AccessDeniedException"), + ShapeID("com.amazonaws.lambda#EC2ThrottledException"), + ShapeID("com.amazonaws.lambda#EC2UnexpectedException"), + ShapeID("com.amazonaws.lambda#EFSIOException"), + ShapeID("com.amazonaws.lambda#EFSMountConnectivityException"), + ShapeID("com.amazonaws.lambda#EFSMountFailureException"), + ShapeID("com.amazonaws.lambda#EFSMountTimeoutException"), + ShapeID("com.amazonaws.lambda#ENILimitReachedException"), + ShapeID("com.amazonaws.lambda#ENINotReadyException"), + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#InvalidRequestContentException"), + ShapeID("com.amazonaws.lambda#InvalidRuntimeException"), + ShapeID("com.amazonaws.lambda#InvalidSecurityGroupIDException"), + ShapeID("com.amazonaws.lambda#InvalidSubnetIDException"), + ShapeID("com.amazonaws.lambda#InvalidZipFileException"), + ShapeID("com.amazonaws.lambda#KMSAccessDeniedException"), + ShapeID("com.amazonaws.lambda#KMSDisabledException"), + ShapeID("com.amazonaws.lambda#KMSInvalidStateException"), + ShapeID("com.amazonaws.lambda#KMSNotFoundException"), + ShapeID("com.amazonaws.lambda#ModeNotSupportedException"), + ShapeID("com.amazonaws.lambda#NoPublishedVersionException"), + ShapeID("com.amazonaws.lambda#RecursiveInvocationException"), + ShapeID("com.amazonaws.lambda#RequestTooLargeException"), + ShapeID("com.amazonaws.lambda#ResourceConflictException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ResourceNotReadyException"), + ShapeID("com.amazonaws.lambda#S3FilesMountConnectivityException"), + ShapeID("com.amazonaws.lambda#S3FilesMountFailureException"), + ShapeID("com.amazonaws.lambda#S3FilesMountTimeoutException"), + ShapeID("com.amazonaws.lambda#SerializedRequestEntityTooLargeException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.lambda#SnapStartException"), + ShapeID("com.amazonaws.lambda#SnapStartNotReadyException"), + ShapeID("com.amazonaws.lambda#SnapStartRegenerationFailureException"), + ShapeID("com.amazonaws.lambda#SnapStartTimeoutException"), + ShapeID("com.amazonaws.lambda#SubnetIPAddressLimitReachedException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ShapeID("com.amazonaws.lambda#UnsupportedMediaTypeException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +INVOKE_ASYNC: APIOperation[InvokeAsyncInput, InvokeAsyncOutput] = APIOperation( + static_schema=_SCHEMA_INVOKE_ASYNC, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#EC2AccessDeniedException"), + ShapeID("com.amazonaws.lambda#EC2ThrottledException"), + ShapeID("com.amazonaws.lambda#EC2UnexpectedException"), + ShapeID("com.amazonaws.lambda#EFSIOException"), + ShapeID("com.amazonaws.lambda#EFSMountConnectivityException"), + ShapeID("com.amazonaws.lambda#EFSMountFailureException"), + ShapeID("com.amazonaws.lambda#EFSMountTimeoutException"), + ShapeID("com.amazonaws.lambda#ENILimitReachedException"), + ShapeID("com.amazonaws.lambda#InvalidRequestContentException"), + ShapeID("com.amazonaws.lambda#InvalidRuntimeException"), + ShapeID("com.amazonaws.lambda#InvalidSecurityGroupIDException"), + ShapeID("com.amazonaws.lambda#InvalidSubnetIDException"), + ShapeID("com.amazonaws.lambda#KMSAccessDeniedException"), + ShapeID("com.amazonaws.lambda#KMSDisabledException"), + ShapeID("com.amazonaws.lambda#KMSInvalidStateException"), + ShapeID("com.amazonaws.lambda#KMSNotFoundException"), + ShapeID("com.amazonaws.lambda#ModeNotSupportedException"), + ShapeID("com.amazonaws.lambda#ResourceConflictException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#S3FilesMountConnectivityException"), + ShapeID("com.amazonaws.lambda#S3FilesMountFailureException"), + ShapeID("com.amazonaws.lambda#S3FilesMountTimeoutException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.lambda#SnapStartException"), + ShapeID("com.amazonaws.lambda#SnapStartNotReadyException"), + ShapeID("com.amazonaws.lambda#SnapStartRegenerationFailureException"), + ShapeID("com.amazonaws.lambda#SnapStartTimeoutException"), + ShapeID("com.amazonaws.lambda#SubnetIPAddressLimitReachedException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +INVOKE_WITH_RESPONSE_STREAM: APIOperation[ + InvokeWithResponseStreamInput, InvokeWithResponseStreamOutput +] = APIOperation( + static_schema=_SCHEMA_INVOKE_WITH_RESPONSE_STREAM, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#EC2AccessDeniedException"), + ShapeID("com.amazonaws.lambda#EC2ThrottledException"), + ShapeID("com.amazonaws.lambda#EC2UnexpectedException"), + ShapeID("com.amazonaws.lambda#EFSIOException"), + ShapeID("com.amazonaws.lambda#EFSMountConnectivityException"), + ShapeID("com.amazonaws.lambda#EFSMountFailureException"), + ShapeID("com.amazonaws.lambda#EFSMountTimeoutException"), + ShapeID("com.amazonaws.lambda#ENILimitReachedException"), + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#InvalidRequestContentException"), + ShapeID("com.amazonaws.lambda#InvalidRuntimeException"), + ShapeID("com.amazonaws.lambda#InvalidSecurityGroupIDException"), + ShapeID("com.amazonaws.lambda#InvalidSubnetIDException"), + ShapeID("com.amazonaws.lambda#InvalidZipFileException"), + ShapeID("com.amazonaws.lambda#KMSAccessDeniedException"), + ShapeID("com.amazonaws.lambda#KMSDisabledException"), + ShapeID("com.amazonaws.lambda#KMSInvalidStateException"), + ShapeID("com.amazonaws.lambda#KMSNotFoundException"), + ShapeID("com.amazonaws.lambda#NoPublishedVersionException"), + ShapeID("com.amazonaws.lambda#RecursiveInvocationException"), + ShapeID("com.amazonaws.lambda#RequestTooLargeException"), + ShapeID("com.amazonaws.lambda#ResourceConflictException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ResourceNotReadyException"), + ShapeID("com.amazonaws.lambda#S3FilesMountConnectivityException"), + ShapeID("com.amazonaws.lambda#S3FilesMountFailureException"), + ShapeID("com.amazonaws.lambda#S3FilesMountTimeoutException"), + ShapeID("com.amazonaws.lambda#SerializedRequestEntityTooLargeException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.lambda#SnapStartException"), + ShapeID("com.amazonaws.lambda#SnapStartNotReadyException"), + ShapeID("com.amazonaws.lambda#SnapStartRegenerationFailureException"), + ShapeID("com.amazonaws.lambda#SnapStartTimeoutException"), + ShapeID("com.amazonaws.lambda#SubnetIPAddressLimitReachedException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ShapeID("com.amazonaws.lambda#UnsupportedMediaTypeException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +LIST_DURABLE_EXECUTIONS_BY_FUNCTION: APIOperation[ + ListDurableExecutionsByFunctionInput, ListDurableExecutionsByFunctionOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_DURABLE_EXECUTIONS_BY_FUNCTION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +LIST_FUNCTIONS: APIOperation[ListFunctionsInput, ListFunctionsOutput] = APIOperation( + static_schema=_SCHEMA_LIST_FUNCTIONS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +LIST_FUNCTION_URL_CONFIGS: APIOperation[ + ListFunctionUrlConfigsInput, ListFunctionUrlConfigsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_FUNCTION_URL_CONFIGS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +LIST_PROVISIONED_CONCURRENCY_CONFIGS: APIOperation[ + ListProvisionedConcurrencyConfigsInput, ListProvisionedConcurrencyConfigsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_PROVISIONED_CONCURRENCY_CONFIGS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +PUT_FUNCTION_CODE_SIGNING_CONFIG: APIOperation[ + PutFunctionCodeSigningConfigInput, PutFunctionCodeSigningConfigOutput +] = APIOperation( + static_schema=_SCHEMA_PUT_FUNCTION_CODE_SIGNING_CONFIG, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#CodeSigningConfigNotFoundException"), + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceConflictException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +PUT_FUNCTION_CONCURRENCY: APIOperation[ + PutFunctionConcurrencyInput, PutFunctionConcurrencyOutput +] = APIOperation( + static_schema=_SCHEMA_PUT_FUNCTION_CONCURRENCY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceConflictException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - deserializer.read_struct( - _SCHEMA_UPDATE_FUNCTION_EVENT_INVOKE_CONFIG_INPUT, consumer=_consumer - ) - return kwargs +PUT_FUNCTION_RECURSION_CONFIG: APIOperation[ + PutFunctionRecursionConfigInput, PutFunctionRecursionConfigOutput +] = APIOperation( + static_schema=_SCHEMA_PUT_FUNCTION_RECURSION_CONFIG, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceConflictException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +PUT_FUNCTION_SCALING_CONFIG: APIOperation[ + PutFunctionScalingConfigInput, PutFunctionScalingConfigOutput +] = APIOperation( + static_schema=_SCHEMA_PUT_FUNCTION_SCALING_CONFIG, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceConflictException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -@dataclass(kw_only=True) -class UpdateFunctionEventInvokeConfigOutput: - """Dataclass for UpdateFunctionEventInvokeConfigOutput structure.""" +PUT_RUNTIME_MANAGEMENT_CONFIG: APIOperation[ + PutRuntimeManagementConfigInput, PutRuntimeManagementConfigOutput +] = APIOperation( + static_schema=_SCHEMA_PUT_RUNTIME_MANAGEMENT_CONFIG, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceConflictException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - last_modified: datetime | None = None - """The date and time that the configuration was last updated.""" +UPDATE_FUNCTION_CODE: APIOperation[ + UpdateFunctionCodeInput, UpdateFunctionCodeOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_FUNCTION_CODE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#CodeSigningConfigNotFoundException"), + ShapeID("com.amazonaws.lambda#CodeStorageExceededException"), + ShapeID("com.amazonaws.lambda#CodeVerificationFailedException"), + ShapeID("com.amazonaws.lambda#InvalidCodeSignatureException"), + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#PreconditionFailedException"), + ShapeID("com.amazonaws.lambda#ResourceConflictException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - function_arn: str | None = None - """The Amazon Resource Name (ARN) of the function.""" +UPDATE_FUNCTION_CONFIGURATION: APIOperation[ + UpdateFunctionConfigurationInput, UpdateFunctionConfigurationOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_FUNCTION_CONFIGURATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#CodeSigningConfigNotFoundException"), + ShapeID("com.amazonaws.lambda#CodeVerificationFailedException"), + ShapeID("com.amazonaws.lambda#InvalidCodeSignatureException"), + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#PreconditionFailedException"), + ShapeID("com.amazonaws.lambda#ResourceConflictException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - maximum_retry_attempts: int | None = None - """The maximum number of times to retry when the function returns an error.""" +UPDATE_FUNCTION_URL_CONFIG: APIOperation[ + UpdateFunctionUrlConfigInput, UpdateFunctionUrlConfigOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_FUNCTION_URL_CONFIG, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceConflictException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - maximum_event_age_in_seconds: int | None = None - """ - The maximum age of a request that Lambda sends to a function for - processing. - """ +CREATE_ALIAS: APIOperation[CreateAliasInput, CreateAliasOutput] = APIOperation( + static_schema=_SCHEMA_CREATE_ALIAS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#AliasLimitExceededException"), + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceConflictException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - destination_config: DestinationConfig | None = None - """ - A destination for events after they have been sent to a function for - processing. +DELETE_ALIAS: APIOperation[DeleteAliasInput, DeleteAliasOutput] = APIOperation( + static_schema=_SCHEMA_DELETE_ALIAS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceConflictException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - **Destinations** +GET_ALIAS: APIOperation[GetAliasInput, GetAliasOutput] = APIOperation( + static_schema=_SCHEMA_GET_ALIAS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - - **Function** - The Amazon Resource Name (ARN) of a Lambda function. +LIST_ALIASES: APIOperation[ListAliasesInput, ListAliasesOutput] = APIOperation( + static_schema=_SCHEMA_LIST_ALIASES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - - **Queue** - The ARN of a standard SQS queue. +UPDATE_ALIAS: APIOperation[UpdateAliasInput, UpdateAliasOutput] = APIOperation( + static_schema=_SCHEMA_UPDATE_ALIAS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#PreconditionFailedException"), + ShapeID("com.amazonaws.lambda#ResourceConflictException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - - **Bucket** - The ARN of an Amazon S3 bucket. +LIST_VERSIONS_BY_FUNCTION: APIOperation[ + ListVersionsByFunctionInput, ListVersionsByFunctionOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_VERSIONS_BY_FUNCTION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - - **Topic** - The ARN of a standard SNS topic. +PUBLISH_VERSION: APIOperation[PublishVersionInput, PublishVersionOutput] = APIOperation( + static_schema=_SCHEMA_PUBLISH_VERSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#CodeStorageExceededException"), + ShapeID( + "com.amazonaws.lambda#FunctionVersionsPerCapacityProviderLimitExceededException" + ), + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#PreconditionFailedException"), + ShapeID("com.amazonaws.lambda#ResourceConflictException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - - **Event Bus** - The ARN of an Amazon EventBridge event bus. +GET_ACCOUNT_SETTINGS: APIOperation[ + GetAccountSettingsInput, GetAccountSettingsOutput +] = APIOperation( + static_schema=_SCHEMA_GET_ACCOUNT_SETTINGS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - Note: - S3 buckets are supported only for on-failure destinations. To retain - records of successful invocations, use another destination type. - """ +GET_FUNCTION_EVENT_INVOKE_CONFIG: APIOperation[ + GetFunctionEventInvokeConfigInput, GetFunctionEventInvokeConfigOutput +] = APIOperation( + static_schema=_SCHEMA_GET_FUNCTION_EVENT_INVOKE_CONFIG, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False +GET_RESOURCE_POLICY: APIOperation[GetResourcePolicyInput, GetResourcePolicyOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_RESOURCE_POLICY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ +) - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_UPDATE_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT, self - ) +LIST_LAYERS: APIOperation[ListLayersInput, ListLayersOutput] = APIOperation( + static_schema=_SCHEMA_LIST_LAYERS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize_members(self, serializer: ShapeSerializer): - if self.last_modified is not None: - serializer.write_timestamp( - _SCHEMA_UPDATE_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT.members[ - "LastModified" - ], - self.last_modified, - ) +DELETE_LAYER_VERSION: APIOperation[ + DeleteLayerVersionInput, DeleteLayerVersionOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_LAYER_VERSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - if self.function_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT.members[ - "FunctionArn" - ], - self.function_arn, - ) +GET_LAYER_VERSION: APIOperation[GetLayerVersionInput, GetLayerVersionOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_LAYER_VERSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - if self.maximum_retry_attempts is not None: - serializer.write_integer( - _SCHEMA_UPDATE_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT.members[ - "MaximumRetryAttempts" - ], - self.maximum_retry_attempts, - ) +GET_LAYER_VERSION_BY_ARN: APIOperation[ + GetLayerVersionByArnInput, GetLayerVersionByArnOutput +] = APIOperation( + static_schema=_SCHEMA_GET_LAYER_VERSION_BY_ARN, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - if self.maximum_event_age_in_seconds is not None: - serializer.write_integer( - _SCHEMA_UPDATE_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT.members[ - "MaximumEventAgeInSeconds" - ], - self.maximum_event_age_in_seconds, - ) +GET_LAYER_VERSION_POLICY: APIOperation[ + GetLayerVersionPolicyInput, GetLayerVersionPolicyOutput +] = APIOperation( + static_schema=_SCHEMA_GET_LAYER_VERSION_POLICY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - if self.destination_config is not None: - serializer.write_struct( - _SCHEMA_UPDATE_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT.members[ - "DestinationConfig" - ], - self.destination_config, - ) +LIST_LAYER_VERSIONS: APIOperation[ListLayerVersionsInput, ListLayerVersionsOutput] = ( + APIOperation( + static_schema=_SCHEMA_LIST_LAYER_VERSIONS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) +PUBLISH_LAYER_VERSION: APIOperation[ + PublishLayerVersionInput, PublishLayerVersionOutput +] = APIOperation( + static_schema=_SCHEMA_PUBLISH_LAYER_VERSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#CodeStorageExceededException"), + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +REMOVE_LAYER_VERSION_PERMISSION: APIOperation[ + RemoveLayerVersionPermissionInput, RemoveLayerVersionPermissionOutput +] = APIOperation( + static_schema=_SCHEMA_REMOVE_LAYER_VERSION_PERMISSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#PreconditionFailedException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["last_modified"] = de.read_timestamp( - _SCHEMA_UPDATE_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT.members[ - "LastModified" - ] - ) +LIST_FUNCTION_EVENT_INVOKE_CONFIGS: APIOperation[ + ListFunctionEventInvokeConfigsInput, ListFunctionEventInvokeConfigsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_FUNCTION_EVENT_INVOKE_CONFIGS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 1: - kwargs["function_arn"] = de.read_string( - _SCHEMA_UPDATE_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT.members[ - "FunctionArn" - ] - ) +LIST_TAGS: APIOperation[ListTagsInput, ListTagsOutput] = APIOperation( + static_schema=_SCHEMA_LIST_TAGS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 2: - kwargs["maximum_retry_attempts"] = de.read_integer( - _SCHEMA_UPDATE_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT.members[ - "MaximumRetryAttempts" - ] - ) +REMOVE_PERMISSION: APIOperation[RemovePermissionInput, RemovePermissionOutput] = ( + APIOperation( + static_schema=_SCHEMA_REMOVE_PERMISSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#PreconditionFailedException"), + ShapeID("com.amazonaws.lambda#PublicPolicyException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - case 3: - kwargs["maximum_event_age_in_seconds"] = de.read_integer( - _SCHEMA_UPDATE_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT.members[ - "MaximumEventAgeInSeconds" - ] - ) +DELETE_PROVISIONED_CONCURRENCY_CONFIG: APIOperation[ + DeleteProvisionedConcurrencyConfigInput, DeleteProvisionedConcurrencyConfigOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_PROVISIONED_CONCURRENCY_CONFIG, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceConflictException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +GET_PROVISIONED_CONCURRENCY_CONFIG: APIOperation[ + GetProvisionedConcurrencyConfigInput, GetProvisionedConcurrencyConfigOutput +] = APIOperation( + static_schema=_SCHEMA_GET_PROVISIONED_CONCURRENCY_CONFIG, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ProvisionedConcurrencyConfigNotFoundException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +PUT_PROVISIONED_CONCURRENCY_CONFIG: APIOperation[ + PutProvisionedConcurrencyConfigInput, PutProvisionedConcurrencyConfigOutput +] = APIOperation( + static_schema=_SCHEMA_PUT_PROVISIONED_CONCURRENCY_CONFIG, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceConflictException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 4: - kwargs["destination_config"] = DestinationConfig.deserialize(de) +PUT_FUNCTION_EVENT_INVOKE_CONFIG: APIOperation[ + PutFunctionEventInvokeConfigInput, PutFunctionEventInvokeConfigOutput +] = APIOperation( + static_schema=_SCHEMA_PUT_FUNCTION_EVENT_INVOKE_CONFIG, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceConflictException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case _: - logger.debug("Unexpected member schema: %s", schema) +PUT_RESOURCE_POLICY: APIOperation[PutResourcePolicyInput, PutResourcePolicyOutput] = ( + APIOperation( + static_schema=_SCHEMA_PUT_RESOURCE_POLICY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#PolicyLengthExceededException"), + ShapeID("com.amazonaws.lambda#PreconditionFailedException"), + ShapeID("com.amazonaws.lambda#PublicPolicyException"), + ShapeID("com.amazonaws.lambda#ResourceConflictException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - deserializer.read_struct( - _SCHEMA_UPDATE_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT, consumer=_consumer - ) - return kwargs +SEND_DURABLE_EXECUTION_CALLBACK_FAILURE: APIOperation[ + SendDurableExecutionCallbackFailureInput, SendDurableExecutionCallbackFailureOutput +] = APIOperation( + static_schema=_SCHEMA_SEND_DURABLE_EXECUTION_CALLBACK_FAILURE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#CallbackTimeoutException"), + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#KMSAccessDeniedException"), + ShapeID("com.amazonaws.lambda#KMSDisabledException"), + ShapeID("com.amazonaws.lambda#KMSInvalidStateException"), + ShapeID("com.amazonaws.lambda#KMSNotFoundException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +SEND_DURABLE_EXECUTION_CALLBACK_HEARTBEAT: APIOperation[ + SendDurableExecutionCallbackHeartbeatInput, + SendDurableExecutionCallbackHeartbeatOutput, +] = APIOperation( + static_schema=_SCHEMA_SEND_DURABLE_EXECUTION_CALLBACK_HEARTBEAT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#CallbackTimeoutException"), + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -UPDATE_FUNCTION_EVENT_INVOKE_CONFIG = APIOperation( - input=UpdateFunctionEventInvokeConfigInput, - output=UpdateFunctionEventInvokeConfigOutput, - schema=_SCHEMA_UPDATE_FUNCTION_EVENT_INVOKE_CONFIG, - input_schema=_SCHEMA_UPDATE_FUNCTION_EVENT_INVOKE_CONFIG_INPUT, - output_schema=_SCHEMA_UPDATE_FUNCTION_EVENT_INVOKE_CONFIG_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lambda#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.lambda#ResourceConflictException" - ): ResourceConflictException, - ShapeID( - "com.amazonaws.lambda#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.lambda#ServiceException"): ServiceException, - ShapeID( - "com.amazonaws.lambda#TooManyRequestsException" - ): TooManyRequestsException, - } - ), +SEND_DURABLE_EXECUTION_CALLBACK_SUCCESS: APIOperation[ + SendDurableExecutionCallbackSuccessInput, SendDurableExecutionCallbackSuccessOutput +] = APIOperation( + static_schema=_SCHEMA_SEND_DURABLE_EXECUTION_CALLBACK_SUCCESS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#CallbackTimeoutException"), + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#KMSAccessDeniedException"), + ShapeID("com.amazonaws.lambda#KMSDisabledException"), + ShapeID("com.amazonaws.lambda#KMSInvalidStateException"), + ShapeID("com.amazonaws.lambda#KMSNotFoundException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +TAG_RESOURCE: APIOperation[TagResourceInput, TagResourceOutput] = APIOperation( + static_schema=_SCHEMA_TAG_RESOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceConflictException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +UNTAG_RESOURCE: APIOperation[UntagResourceInput, UntagResourceOutput] = APIOperation( + static_schema=_SCHEMA_UNTAG_RESOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceConflictException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), + ], effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_RESOURCE_CONFLICT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_EXCEPTION, +) + +UPDATE_FUNCTION_EVENT_INVOKE_CONFIG: APIOperation[ + UpdateFunctionEventInvokeConfigInput, UpdateFunctionEventInvokeConfigOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_FUNCTION_EVENT_INVOKE_CONFIG, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lambda#InvalidParameterValueException"), + ShapeID("com.amazonaws.lambda#ResourceConflictException"), + ShapeID("com.amazonaws.lambda#ResourceNotFoundException"), + ShapeID("com.amazonaws.lambda#ServiceException"), + ShapeID("com.amazonaws.lambda#TooManyRequestsException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) diff --git a/clients/aws-sdk-lambda/src/aws_sdk_lambda/models.pyi b/clients/aws-sdk-lambda/src/aws_sdk_lambda/models.pyi new file mode 100644 index 00000000..38385226 --- /dev/null +++ b/clients/aws-sdk-lambda/src/aws_sdk_lambda/models.pyi @@ -0,0 +1,10770 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. + +from dataclasses import dataclass +from datetime import datetime +from enum import StrEnum +from typing import Self, Union + +from smithy_core.aio.interfaces import StreamingBlob +from smithy_core.deserializers import ShapeDeserializer +from smithy_core.exceptions import ModeledError +from smithy_core.response import ResponseMetadata +from smithy_core.schemas import APIOperation +from smithy_core.serializers import ShapeSerializer +from smithy_core.types import UnknownEnumMixin + +class _SerdeShape: + def serialize(self, serializer: ShapeSerializer) -> None: ... + def serialize_members(self, serializer: ShapeSerializer) -> None: ... + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: ... + +class ServiceError(ModeledError): + """ + Base error for all errors in the service. + + Some exceptions do not extend from this class, including + synthetic, implicit, and shared exception types. + """ + +@dataclass(kw_only=True) +class AccountLimit(_SerdeShape): + """ + Limits that are related to concurrency and storage. All file and storage + sizes are in bytes. + """ + + total_code_size: int = ... + """ + The amount of storage space that you can use for all deployment packages + and layer archives. + """ + code_size_unzipped: int = ... + """ + The maximum size of a function's deployment package and layers when + they're extracted. + """ + code_size_zipped: int = ... + """ + The maximum size of a deployment package when it's uploaded directly to + Lambda. Use Amazon S3 for larger files. + """ + concurrent_executions: int = ... + """The maximum number of simultaneous function executions.""" + unreserved_concurrent_executions: int | None = ... + """ + The maximum number of simultaneous function executions, minus the + capacity that's reserved for individual functions with + PutFunctionConcurrency. + """ + +@dataclass(kw_only=True) +class AccountUsage(_SerdeShape): + """The number of functions and amount of storage in use.""" + + total_code_size: int = ... + """ + The amount of storage space, in bytes, that's being used by deployment + packages and layer archives. + """ + function_count: int = ... + """The number of Lambda functions.""" + +@dataclass(kw_only=True) +class AddLayerVersionPermissionInput(_SerdeShape): + """Dataclass for AddLayerVersionPermissionInput structure.""" + + layer_name: str | None = ... + """The name or Amazon Resource Name (ARN) of the layer.""" + version_number: int | None = ... + """The version number.""" + statement_id: str | None = ... + """ + An identifier that distinguishes the policy from others on the same + layer version. + """ + action: str | None = ... + """ + The API action that grants access to the layer. For example, + `lambda:GetLayerVersion`. + """ + principal: str | None = ... + """ + An account ID, or `*` to grant layer usage permission to all accounts in + an organization, or all Amazon Web Services accounts (if + `organizationId` is not specified). For the last case, make sure that + you really do want all Amazon Web Services accounts to have usage + permission to this layer. + """ + organization_id: str | None = ... + """ + With the principal set to `*`, grant permission to all accounts in the + specified organization. + """ + revision_id: str | None = ... + """ + Only update the policy if the revision ID matches the ID specified. Use + this option to avoid modifying a policy that has changed since you last + read it. + """ + +@dataclass(kw_only=True) +class AddLayerVersionPermissionOutput(_SerdeShape): + """Dataclass for AddLayerVersionPermissionOutput structure.""" + + statement: str | None = ... + """The permission statement.""" + revision_id: str | None = ... + """A unique identifier for the current revision of the policy.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class AddPermissionInput(_SerdeShape): + """Dataclass for AddPermissionInput structure.""" + + function_name: str | None = ... + """ + The name or ARN of the Lambda function, version, or alias. + + **Name formats** + + - **Function name** -- `my-function` (name-only), `my-function:v1` (with + alias). + + - **Function ARN** -- + `arn:aws:lambda:us-west-2:123456789012:function:my-function`. + + - **Partial ARN** -- `123456789012:function:my-function`. + + You can append a version number or alias to any of the formats. The + length constraint applies only to the full ARN. If you specify only the + function name, it is limited to 64 characters in length. + """ + statement_id: str | None = ... + """ + A statement identifier that differentiates the statement from others in + the same policy. + """ + action: str | None = ... + """ + The action that the principal can use on the function. For example, + `lambda:InvokeFunction` or `lambda:GetFunction`. + """ + principal: str | None = ... + """ + The Amazon Web Services service, Amazon Web Services account, IAM user, + or IAM role that invokes the function. If you specify a service, use + `SourceArn` or `SourceAccount` to limit who can invoke the function + through that service. + """ + source_arn: str | None = ... + """ + For Amazon Web Services services, the ARN of the Amazon Web Services + resource that invokes the function. For example, an Amazon S3 bucket or + Amazon SNS topic. + + Note that Lambda configures the comparison using the `StringLike` + operator. + """ + function_url_auth_type: str | None = ... + """ + The type of authentication that your function URL uses. Set to `AWS_IAM` + if you want to restrict access to authenticated users only. Set to + `NONE` if you want to bypass IAM authentication to create a public + endpoint. For more information, see [Control access to Lambda function + URLs](https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html). + """ + invoked_via_function_url: bool | None = ... + """ + Indicates whether the permission applies when the function is invoked + through a function URL. + """ + source_account: str | None = ... + """ + For Amazon Web Services service, the ID of the Amazon Web Services + account that owns the resource. Use this together with `SourceArn` to + ensure that the specified account owns the resource. It is possible for + an Amazon S3 bucket to be deleted by its owner and recreated by another + account. + """ + event_source_token: str | None = ... + """For Alexa Smart Home functions, a token that the invoker must supply.""" + qualifier: str | None = ... + """ + Specify a version or alias to add permissions to a published version of + the function. + """ + revision_id: str | None = ... + """ + Update the policy only if the revision ID matches the ID that's + specified. Use this option to avoid modifying a policy that has changed + since you last read it. + """ + principal_org_id: str | None = ... + """ + The identifier for your organization in Organizations. Use this to grant + permissions to all the Amazon Web Services accounts under this + organization. + """ + +@dataclass(kw_only=True) +class AddPermissionOutput(_SerdeShape): + """Dataclass for AddPermissionOutput structure.""" + + statement: str | None = ... + """The permission statement that's added to the function policy.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class AliasConfiguration(_SerdeShape): + """ + Provides configuration information about a Lambda function + [alias](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html). + """ + + alias_arn: str | None = ... + """The Amazon Resource Name (ARN) of the alias.""" + name: str | None = ... + """The name of the alias.""" + function_version: str | None = ... + """The function version that the alias invokes.""" + description: str | None = ... + """A description of the alias.""" + routing_config: AliasRoutingConfiguration | None = ... + """ + The [routing + configuration](https://docs.aws.amazon.com/lambda/latest/dg/lambda-traffic-shifting-using-aliases.html) + of the alias. + """ + revision_id: str | None = ... + """A unique identifier that changes when you update the alias.""" + +@dataclass(kw_only=True) +class AliasLimitExceededException(ServiceError, _SerdeShape): + """ + Lambda couldn't create the alias because your Amazon Web Services + account has exceeded the maximum number of aliases allowed per Lambda + function. For more information, see [Lambda + quotas](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html). + """ + + type: str | None = ... + """The exception type.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class AliasRoutingConfiguration(_SerdeShape): + """ + The + [traffic-shifting](https://docs.aws.amazon.com/lambda/latest/dg/lambda-traffic-shifting-using-aliases.html) + configuration of a Lambda function alias. + """ + + additional_version_weights: dict[str, float] | None = ... + """The second version, and the percentage of traffic that's routed to it.""" + +@dataclass(kw_only=True) +class AllowedPublishers(_SerdeShape): + """List of signing profiles that can sign a code package.""" + + signing_profile_version_arns: list[str] + """ + The Amazon Resource Name (ARN) for each of the signing profiles. A + signing profile defines a trusted user who can sign a code package. + """ + +@dataclass(kw_only=True) +class AmazonManagedKafkaEventSourceConfig(_SerdeShape): + """ + Specific configuration settings for an Amazon Managed Streaming for + Apache Kafka (Amazon MSK) event source. + """ + + consumer_group_id: str | None = ... + """ + The identifier for the Kafka consumer group to join. The consumer group + ID must be unique among all your Kafka event sources. After creating a + Kafka event source mapping with the consumer group ID specified, you + cannot update this value. For more information, see [Customizable + consumer group + ID](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#services-msk-consumer-group-id). + """ + schema_registry_config: KafkaSchemaRegistryConfig | None = ... + """Specific configuration settings for a Kafka schema registry.""" + +class ApplicationLogLevel(UnknownEnumMixin, StrEnum): + TRACE = "TRACE" + DEBUG = "DEBUG" + INFO = "INFO" + WARN = "WARN" + ERROR = "ERROR" + FATAL = "FATAL" + +class Architecture(UnknownEnumMixin, StrEnum): + X86_64 = "x86_64" + ARM64 = "arm64" + +@dataclass(kw_only=True) +class CallbackDetails(_SerdeShape): + """ + Contains details about a callback operation in a durable execution, + including the callback token and timeout configuration. + """ + + callback_id: str | None = ... + """ + The callback ID. Callback IDs are generated by the `DurableContext` when + a durable function calls `ctx.waitForCallback`. + """ + result: str | None = ... + """The response payload from the callback operation as a string.""" + error: ErrorObject | None = ... + """An error object that contains details about the failure.""" + +@dataclass(kw_only=True) +class CallbackFailedDetails(_SerdeShape): + """ + Contains details about a failed callback operation, including error + information and the reason for failure. + """ + + error: EventError + """An error object that contains details about the failure.""" + +@dataclass(kw_only=True) +class CallbackOptions(_SerdeShape): + """ + Configuration options for callback operations in durable executions, + including timeout settings and retry behavior. + """ + + timeout_seconds: int = ... + """ + The timeout for the callback operation in seconds. If not specified or + set to 0, the callback has no timeout. + """ + heartbeat_timeout_seconds: int = ... + """ + The heartbeat timeout for the callback operation, in seconds. If not + specified or set to 0, heartbeat timeout is disabled. + """ + +@dataclass(kw_only=True) +class CallbackStartedDetails(_SerdeShape): + """ + Contains details about a callback operation that has started, including + timing information and callback metadata. + """ + + callback_id: str + """ + The callback ID. Callback IDs are generated by the `DurableContext` when + a durable function calls `ctx.waitForCallback`. + """ + heartbeat_timeout: int | None = ... + """The heartbeat timeout value, in seconds.""" + timeout: int | None = ... + """The timeout value, in seconds.""" + +@dataclass(kw_only=True) +class CallbackSucceededDetails(_SerdeShape): + """ + Contains details about a successfully completed callback operation, + including the result data and completion timestamp. + """ + + result: EventResult + """The response payload from the successful operation.""" + +@dataclass(kw_only=True) +class CallbackTimedOutDetails(_SerdeShape): + """ + Contains details about a callback operation that timed out, including + timeout duration and any partial results. + """ + + error: EventError + """Details about the callback timeout.""" + +@dataclass(kw_only=True) +class CallbackTimeoutException(ServiceError, _SerdeShape): + """ + The callback ID token has either expired or the callback associated with + the token has already been closed. + """ + + type: str | None = ... + """The exception type.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CapacityProvider(_SerdeShape): + """A capacity provider manages compute resources for Lambda functions.""" + + capacity_provider_arn: str + """The Amazon Resource Name (ARN) of the capacity provider.""" + state: str + """The current state of the capacity provider.""" + vpc_config: CapacityProviderVpcConfig + """The VPC configuration for the capacity provider.""" + permissions_config: CapacityProviderPermissionsConfig + """The permissions configuration for the capacity provider.""" + instance_requirements: InstanceRequirements | None = ... + """ + The instance requirements for compute resources managed by the capacity + provider. + """ + capacity_provider_scaling_config: CapacityProviderScalingConfig | None = ... + """The scaling configuration for the capacity provider.""" + kms_key_arn: str | None = ... + """ + The ARN of the KMS key used to encrypt the capacity provider's + resources. + """ + last_modified: str | None = ... + """The date and time when the capacity provider was last modified.""" + propagate_tags: PropagateTags | None = ... + """ + Configuration for tag propagation to managed resources launched by the + capacity provider. + """ + telemetry_config: CapacityProviderTelemetryConfig | None = ... + """ + The telemetry configuration for the capacity provider, including logging + settings. + """ + +@dataclass(kw_only=True) +class CapacityProviderConfig(_SerdeShape): + """ + Configuration for the capacity provider that manages compute resources + for Lambda functions. + """ + + lambda_managed_instances_capacity_provider_config: ( + LambdaManagedInstancesCapacityProviderConfig + ) + """ + Configuration for Lambda-managed instances used by the capacity + provider. + """ + +@dataclass(kw_only=True) +class CapacityProviderLimitExceededException(ServiceError, _SerdeShape): + """ + The maximum number of capacity providers for your account has been + exceeded. For more information, see [Lambda + quotas](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html) + """ + + type: str | None = ... + """The exception type.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CapacityProviderLoggingConfig(_SerdeShape): + """The capacity provider's Amazon CloudWatch Logs configuration settings.""" + + system_log_level: str | None = ... + """ + Set this property to filter the system logs for your capacity provider + that Lambda sends to CloudWatch. Lambda only sends system logs at the + selected level of detail and lower, where `DEBUG` is the highest level + and `WARN` is the lowest. + """ + log_group: str | None = ... + """ + The name of the Amazon CloudWatch log group the capacity provider sends + logs to. By default, Lambda capacity providers send logs to a default + log group named + `/aws/lambda/capacity-provider/`. To use a + different log group, enter an existing log group or enter a new log + group name. + """ + +@dataclass(kw_only=True) +class CapacityProviderPermissionsConfig(_SerdeShape): + """ + Configuration that specifies the permissions required for the capacity + provider to manage compute resources. + """ + + capacity_provider_operator_role_arn: str + """ + The ARN of the IAM role that the capacity provider uses to manage + compute instances and other Amazon Web Services resources. + """ + +class CapacityProviderPredefinedMetricType(UnknownEnumMixin, StrEnum): + LAMBDA_CAPACITY_PROVIDER_AVERAGE_CPU_UTILIZATION = ( + "LambdaCapacityProviderAverageCPUUtilization" + ) + +@dataclass(kw_only=True) +class CapacityProviderScalingConfig(_SerdeShape): + """ + Configuration that defines how the capacity provider scales compute + instances based on demand and policies. + """ + + max_v_cpu_count: int | None = ... + """ + The maximum number of vCPUs that the capacity provider can provision + across all compute instances. + """ + scaling_mode: str | None = ... + """ + The scaling mode that determines how the capacity provider responds to + changes in demand. + """ + scaling_policies: list[TargetTrackingScalingPolicy] | None = ... + """ + A list of scaling policies that define how the capacity provider scales + compute instances based on metrics and thresholds. + """ + +class CapacityProviderScalingMode(UnknownEnumMixin, StrEnum): + AUTO = "Auto" + MANUAL = "Manual" + +class CapacityProviderState(UnknownEnumMixin, StrEnum): + PENDING = "Pending" + ACTIVE = "Active" + FAILED = "Failed" + DELETING = "Deleting" + +@dataclass(kw_only=True) +class CapacityProviderTelemetryConfig(_SerdeShape): + """ + Configuration that specifies the telemetry collection for the capacity + provider. + """ + + logging_config: CapacityProviderLoggingConfig | None = ... + """The capacity provider's Amazon CloudWatch Logs configuration settings.""" + +@dataclass(kw_only=True) +class CapacityProviderVpcConfig(_SerdeShape): + """ + VPC configuration that specifies the network settings for compute + instances managed by the capacity provider. + """ + + subnet_ids: list[str] + """ + A list of subnet IDs where the capacity provider launches compute + instances. + """ + security_group_ids: list[str] + """ + A list of security group IDs that control network access for compute + instances managed by the capacity provider. + """ + +@dataclass(kw_only=True) +class ChainedInvokeDetails(_SerdeShape): + """ + Contains details about a chained function invocation in a durable + execution, including the target function and invocation parameters. + """ + + result: str | None = ... + """The response payload from the chained invocation.""" + error: ErrorObject | None = ... + """Details about the chained invocation failure.""" + +@dataclass(kw_only=True) +class ChainedInvokeFailedDetails(_SerdeShape): + """ + Contains details about a failed chained function invocation, including + error information and failure reason. + """ + + error: EventError + """Details about the chained invocation failure.""" + +@dataclass(kw_only=True) +class ChainedInvokeOptions(_SerdeShape): + """ + Configuration options for chained function invocations in durable + executions, including retry settings and timeout configuration. + """ + + function_name: str + """The name or ARN of the Lambda function to invoke.""" + tenant_id: str | None = ... + """The tenant identifier for the chained invocation.""" + +@dataclass(kw_only=True) +class ChainedInvokeStartedDetails(_SerdeShape): + """ + Contains details about a chained function invocation that has started + execution, including start time and execution context. + """ + + function_name: str + """The name or ARN of the Lambda function being invoked.""" + tenant_id: str | None = ... + """The tenant identifier for the chained invocation.""" + input: EventInput | None = ... + """The JSON input payload provided to the chained invocation.""" + executed_version: str | None = ... + """The version of the function that was executed.""" + durable_execution_arn: str | None = ... + """The Amazon Resource Name (ARN) that identifies the durable execution.""" + +@dataclass(kw_only=True) +class ChainedInvokeStoppedDetails(_SerdeShape): + """Details about a chained invocation that was stopped.""" + + error: EventError + """Details about why the chained invocation stopped.""" + +@dataclass(kw_only=True) +class ChainedInvokeSucceededDetails(_SerdeShape): + """Details about a chained invocation that succeeded.""" + + result: EventResult + """The response payload from the successful operation.""" + +@dataclass(kw_only=True) +class ChainedInvokeTimedOutDetails(_SerdeShape): + """Details about a chained invocation that timed out.""" + + error: EventError + """Details about the chained invocation timeout.""" + +@dataclass(kw_only=True) +class CheckpointDurableExecutionInput(_SerdeShape): + """Dataclass for CheckpointDurableExecutionInput structure.""" + + durable_execution_arn: str | None = ... + """The Amazon Resource Name (ARN) of the durable execution.""" + checkpoint_token: str | None = ... + """ + A unique token that identifies the current checkpoint state. This token + is provided by the Lambda runtime and must be used to ensure checkpoints + are applied in the correct order. Each checkpoint operation consumes + this token and returns a new one. + """ + updates: list[OperationUpdate] | None = ... + """ + An array of state updates to apply during this checkpoint. Each update + represents a change to the execution state, such as completing a step, + starting a callback, or scheduling a timer. Updates are applied + atomically as part of the checkpoint operation. + """ + client_token: str | None = ... + """ + An optional idempotency token to ensure that duplicate checkpoint + requests are handled correctly. If provided, Lambda uses this token to + detect and handle duplicate requests within a 15-minute window. + """ + +@dataclass(kw_only=True) +class CheckpointDurableExecutionOutput(_SerdeShape): + """The response from the CheckpointDurableExecution operation.""" + + checkpoint_token: str | None = ... + """ + A new checkpoint token to use for the next checkpoint operation. This + token replaces the one provided in the request and must be used for + subsequent checkpoints to maintain proper ordering. + """ + new_execution_state: CheckpointUpdatedExecutionState + """ + Updated execution state information that includes any changes that + occurred since the last checkpoint, such as completed callbacks or + expired timers. This allows the SDK to update its internal state during + replay. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CheckpointUpdatedExecutionState(_SerdeShape): + """ + Contains operations that have been updated since the last checkpoint, + such as completed asynchronous work like timers or callbacks. + """ + + operations: list[Operation] | None = ... + """A list of operations that have been updated since the last checkpoint.""" + next_marker: str | None = ... + """ + Indicates that more results are available. Use this value in a + subsequent call to retrieve the next page of results. + """ + +@dataclass(kw_only=True) +class CodeArtifactUserDeletedException(ServiceError, _SerdeShape): + """ + The Lambda function couldn't be invoked because its code artifact user + has been deleted. Wait for Lambda to provision a new code artifact user, + or update the function's code package to recreate it. + """ + + type: str | None = ... + """The exception type.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CodeArtifactUserFailedException(ServiceError, _SerdeShape): + """ + The Lambda function couldn't be invoked because provisioning of its + code artifact user failed. Update the function's code package or check + the Lambda function's `State` and `StateReasonCode` for additional + context. + """ + + type: str | None = ... + """The exception type.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CodeArtifactUserPendingException(ServiceError, _SerdeShape): + """ + The Lambda function couldn't be invoked because its code artifact user + is still being provisioned. Wait for the function's `State` to become + `Active` and try the request again. + """ + + type: str | None = ... + """The exception type.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CodeSigningConfig(_SerdeShape): + """ + Details about a [Code signing + configuration](https://docs.aws.amazon.com/lambda/latest/dg/configuration-codesigning.html). + """ + + code_signing_config_id: str + """Unique identifer for the Code signing configuration.""" + code_signing_config_arn: str + """The Amazon Resource Name (ARN) of the Code signing configuration.""" + description: str | None = ... + """Code signing configuration description.""" + allowed_publishers: AllowedPublishers + """List of allowed publishers.""" + code_signing_policies: CodeSigningPolicies + """ + The code signing policy controls the validation failure action for + signature mismatch or expiry. + """ + last_modified: str + """ + The date and time that the Code signing configuration was last modified, + in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD). + """ + +@dataclass(kw_only=True) +class CodeSigningConfigNotFoundException(ServiceError, _SerdeShape): + """The specified code signing configuration does not exist.""" + + type: str | None = ... + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CodeSigningPolicies(_SerdeShape): + """ + Code signing configuration + [policies](https://docs.aws.amazon.com/lambda/latest/dg/configuration-codesigning.html#config-codesigning-policies) + specify the validation failure action for signature mismatch or expiry. + """ + + untrusted_artifact_on_deployment: str | None = ... + """ + Code signing configuration policy for deployment validation failure. If + you set the policy to `Enforce`, Lambda blocks the deployment request if + signature validation checks fail. If you set the policy to `Warn`, + Lambda allows the deployment and issues a new Amazon CloudWatch metric + (`SignatureValidationErrors`) and also stores the warning in the + CloudTrail log. + + Default value: `Warn` + """ + +class CodeSigningPolicy(UnknownEnumMixin, StrEnum): + WARN = "Warn" + ENFORCE = "Enforce" + +@dataclass(kw_only=True) +class CodeStorageExceededException(ServiceError, _SerdeShape): + """ + Your Amazon Web Services account has exceeded its maximum total code + size. For more information, see [Lambda + quotas](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html). + """ + + type: str | None = ... + """The exception type.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CodeVerificationFailedException(ServiceError, _SerdeShape): + """ + The code signature failed one or more of the validation checks for + signature mismatch or expiry, and the code signing policy is set to + ENFORCE. Lambda blocks the deployment. + """ + + type: str | None = ... + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class Concurrency(_SerdeShape): + """Dataclass for Concurrency structure.""" + + reserved_concurrent_executions: int | None = ... + """ + The number of concurrent executions that are reserved for this function. + For more information, see [Managing Lambda reserved + concurrency](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html). + """ + +@dataclass(kw_only=True) +class ContextDetails(_SerdeShape): + """Details about a durable execution context.""" + + replay_children: bool | None = ... + """ + Whether the state data of child operations of this completed context + should be included in the invoke payload and `GetDurableExecutionState` + response. + """ + result: str | None = ... + """The response payload from the context.""" + error: ErrorObject | None = ... + """Details about the context failure.""" + +@dataclass(kw_only=True) +class ContextFailedDetails(_SerdeShape): + """Details about a context that failed.""" + + error: EventError + """Details about the context failure.""" + +@dataclass(kw_only=True) +class ContextOptions(_SerdeShape): + """Configuration options for a durable execution context.""" + + replay_children: bool | None = ... + """ + Whether the state data of children of the completed context should be + included in the invoke payload and `GetDurableExecutionState` response. + """ + +@dataclass(kw_only=True) +class ContextStartedDetails(_SerdeShape): + """Details about a context that has started.""" + +@dataclass(kw_only=True) +class ContextSucceededDetails(_SerdeShape): + """Details about a context that succeeded.""" + + result: EventResult + """The JSON response payload from the successful context.""" + +@dataclass(kw_only=True) +class Cors(_SerdeShape): + """ + The [cross-origin resource sharing + (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) settings + for your Lambda function URL. Use CORS to grant access to your function + URL from any origin. You can also use CORS to control access for + specific HTTP headers and methods in requests to your function URL. + """ + + allow_credentials: bool | None = ... + """ + Whether to allow cookies or other credentials in requests to your + function URL. The default is `false`. + """ + allow_headers: list[str] | None = ... + """ + The HTTP headers that origins can include in requests to your function + URL. For example: `Date`, `Keep-Alive`, `X-Custom-Header`. + """ + allow_methods: list[str] | None = ... + """ + The HTTP methods that are allowed when calling your function URL. For + example: `GET`, `POST`, `DELETE`, or the wildcard character (`*`). + """ + allow_origins: list[str] | None = ... + """ + The origins that can access your function URL. You can list any number + of specific origins, separated by a comma. For example: + `https://www.example.com`, `http://localhost:60905`. + + Alternatively, you can grant access to all origins using the wildcard + character (`*`). + """ + expose_headers: list[str] | None = ... + """ + The HTTP headers in your function response that you want to expose to + origins that call your function URL. For example: `Date`, `Keep-Alive`, + `X-Custom-Header`. + """ + max_age: int | None = ... + """ + The maximum amount of time, in seconds, that web browsers can cache + results of a preflight request. By default, this is set to `0`, which + means that the browser doesn't cache results. + """ + +@dataclass(kw_only=True) +class CreateAliasInput(_SerdeShape): + """Dataclass for CreateAliasInput structure.""" + + function_name: str | None = ... + """ + The name or ARN of the Lambda function. + + **Name formats** + + - **Function name** - `MyFunction`. + + - **Function ARN** - + `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`. + + - **Partial ARN** - `123456789012:function:MyFunction`. + + The length constraint applies only to the full ARN. If you specify only + the function name, it is limited to 64 characters in length. + """ + name: str | None = ... + """The name of the alias.""" + function_version: str | None = ... + """The function version that the alias invokes.""" + description: str | None = ... + """A description of the alias.""" + routing_config: AliasRoutingConfiguration | None = ... + """ + The [routing + configuration](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html#configuring-alias-routing) + of the alias. + """ + +@dataclass(kw_only=True) +class CreateAliasOutput(_SerdeShape): + """ + Provides configuration information about a Lambda function + [alias](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html). + """ + + alias_arn: str | None = ... + """The Amazon Resource Name (ARN) of the alias.""" + name: str | None = ... + """The name of the alias.""" + function_version: str | None = ... + """The function version that the alias invokes.""" + description: str | None = ... + """A description of the alias.""" + routing_config: AliasRoutingConfiguration | None = ... + """ + The [routing + configuration](https://docs.aws.amazon.com/lambda/latest/dg/lambda-traffic-shifting-using-aliases.html) + of the alias. + """ + revision_id: str | None = ... + """A unique identifier that changes when you update the alias.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateCapacityProviderInput(_SerdeShape): + """Dataclass for CreateCapacityProviderInput structure.""" + + capacity_provider_name: str | None = ... + """The name of the capacity provider.""" + vpc_config: CapacityProviderVpcConfig | None = ... + """ + The VPC configuration for the capacity provider, including subnet IDs + and security group IDs where compute instances will be launched. + """ + permissions_config: CapacityProviderPermissionsConfig | None = ... + """ + The permissions configuration that specifies the IAM role ARN used by + the capacity provider to manage compute resources. + """ + instance_requirements: InstanceRequirements | None = ... + """ + The instance requirements that specify the compute instance + characteristics, including architectures and allowed or excluded + instance types. + """ + capacity_provider_scaling_config: CapacityProviderScalingConfig | None = ... + """ + The scaling configuration that defines how the capacity provider scales + compute instances, including maximum vCPU count and scaling policies. + """ + kms_key_arn: str | None = ... + """ + The ARN of the KMS key used to encrypt data associated with the capacity + provider. + """ + tags: dict[str, str] | None = ... + """A list of tags to associate with the capacity provider.""" + propagate_tags: PropagateTags | None = ... + """ + The tag propagation configuration for the capacity provider. Specifies + tags to apply to managed resources at launch. + """ + telemetry_config: CapacityProviderTelemetryConfig | None = ... + """ + The telemetry configuration for the capacity provider. Specifies logging + settings for managed resources. + """ + +@dataclass(kw_only=True) +class CreateCapacityProviderOutput(_SerdeShape): + """Dataclass for CreateCapacityProviderOutput structure.""" + + capacity_provider: CapacityProvider + """Information about the capacity provider that was created.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateCodeSigningConfigInput(_SerdeShape): + """Dataclass for CreateCodeSigningConfigInput structure.""" + + description: str | None = ... + """Descriptive name for this code signing configuration.""" + allowed_publishers: AllowedPublishers | None = ... + """Signing profiles for this code signing configuration.""" + code_signing_policies: CodeSigningPolicies | None = ... + """ + The code signing policies define the actions to take if the validation + checks fail. + """ + tags: dict[str, str] | None = ... + """A list of tags to add to the code signing configuration.""" + +@dataclass(kw_only=True) +class CreateCodeSigningConfigOutput(_SerdeShape): + """Dataclass for CreateCodeSigningConfigOutput structure.""" + + code_signing_config: CodeSigningConfig + """The code signing configuration.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateEventSourceMappingInput(_SerdeShape): + """Dataclass for CreateEventSourceMappingInput structure.""" + + event_source_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the event source. + + - **Amazon Kinesis** -- The ARN of the data stream or a stream consumer. + + - **Amazon DynamoDB Streams** -- The ARN of the stream. + + - **Amazon Simple Queue Service** -- The ARN of the queue. + + - **Amazon Managed Streaming for Apache Kafka** -- The ARN of the + cluster or the ARN of the VPC connection (for [cross-account event + source + mappings](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#msk-multi-vpc)). + + - **Amazon MQ** -- The ARN of the broker. + + - **Amazon DocumentDB** -- The ARN of the DocumentDB change stream. + """ + function_name: str | None = ... + """ + The name or ARN of the Lambda function. + + **Name formats** + + - **Function name** -- `MyFunction`. + + - **Function ARN** -- + `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`. + + - **Version or Alias ARN** -- + `arn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD`. + + - **Partial ARN** -- `123456789012:function:MyFunction`. + + The length constraint applies only to the full ARN. If you specify only + the function name, it's limited to 64 characters in length. + """ + enabled: bool | None = ... + """ + When true, the event source mapping is active. When false, Lambda pauses + polling and invocation. + + Default: True + """ + batch_size: int | None = ... + """ + The maximum number of records in each batch that Lambda pulls from your + stream or queue and sends to your function. Lambda passes all of the + records in the batch to the function in a single call, up to the payload + limit for synchronous invocation (6 MB). + + - **Amazon Kinesis** -- Default 100. Max 10,000. + + - **Amazon DynamoDB Streams** -- Default 100. Max 10,000. + + - **Amazon Simple Queue Service** -- Default 10. For standard queues the + max is 10,000. For FIFO queues the max is 10. + + - **Amazon Managed Streaming for Apache Kafka** -- Default 100. Max + 10,000. + + - **Self-managed Apache Kafka** -- Default 100. Max 10,000. + + - **Amazon MQ (ActiveMQ and RabbitMQ)** -- Default 100. Max 10,000. + + - **DocumentDB** -- Default 100. Max 10,000. + """ + filter_criteria: FilterCriteria | None = ... + """ + An object that defines the filter criteria that determine whether Lambda + should process an event. For more information, see [Lambda event + filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html). + """ + kms_key_arn: str | None = ... + """ + The ARN of the Key Management Service (KMS) customer managed key that + Lambda uses to encrypt your function's [filter + criteria](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html#filtering-basics). + By default, Lambda does not encrypt your filter criteria object. Specify + this property to encrypt data using your own customer managed key. + """ + metrics_config: EventSourceMappingMetricsConfig | None = ... + """ + The metrics configuration for your event source. For more information, + see [Event source mapping + metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics-types.html#event-source-mapping-metrics). + """ + logging_config: EventSourceMappingLoggingConfig | None = ... + """ + (Amazon MSK, and self-managed Apache Kafka only) The logging + configuration for your event source. For more information, see [Event + source mapping + logging](https://docs.aws.amazon.com/lambda/latest/dg/esm-logging.html). + """ + scaling_config: ScalingConfig | None = ... + """ + (Amazon SQS only) The scaling configuration for the event source. For + more information, see [Configuring maximum concurrency for Amazon SQS + event + sources](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-max-concurrency). + """ + maximum_batching_window_in_seconds: int | None = ... + """ + The maximum amount of time, in seconds, that Lambda spends gathering + records before invoking the function. You can configure + `MaximumBatchingWindowInSeconds` to any value from 0 seconds to 300 + seconds in increments of seconds. + + For Kinesis, DynamoDB, and Amazon SQS event sources, the default + batching window is 0 seconds. For Amazon MSK, Self-managed Apache Kafka, + Amazon MQ, and DocumentDB event sources, the default batching window is + 500 ms. Note that because you can only change + `MaximumBatchingWindowInSeconds` in increments of seconds, you cannot + revert back to the 500 ms default batching window after you have changed + it. To restore the default batching window, you must create a new event + source mapping. + + Related setting: For Kinesis, DynamoDB, and Amazon SQS event sources, + when you set `BatchSize` to a value greater than 10, you must set + `MaximumBatchingWindowInSeconds` to at least 1. + """ + parallelization_factor: int | None = ... + """ + (Kinesis and DynamoDB Streams only) The number of batches to process + from each shard concurrently. + """ + starting_position: str | None = ... + """ + The position in a stream from which to start reading. Required for + Amazon Kinesis and Amazon DynamoDB Stream event sources. `AT_TIMESTAMP` + is supported only for Amazon Kinesis streams, Amazon DocumentDB, Amazon + MSK, and self-managed Apache Kafka. + """ + starting_position_timestamp: datetime | None = ... + """ + With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to + start reading. `StartingPositionTimestamp` cannot be in the future. + """ + destination_config: DestinationConfig | None = ... + """ + (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) A + configuration object that specifies the destination of an event after + Lambda processes it. + """ + maximum_record_age_in_seconds: int | None = ... + """ + (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) + Discard records older than the specified age. The default value is + infinite (-1). + """ + bisect_batch_on_function_error: bool | None = ... + """ + (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) + If the function returns an error, split the batch in two and retry. + """ + maximum_retry_attempts: int | None = ... + """ + (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) + Discard records after the specified number of retries. The default value + is infinite (-1). When set to infinite (-1), failed records are retried + until the record expires. + """ + tags: dict[str, str] | None = ... + """A list of tags to apply to the event source mapping.""" + tumbling_window_in_seconds: int | None = ... + """ + (Kinesis and DynamoDB Streams only) The duration in seconds of a + processing window for DynamoDB and Kinesis Streams event sources. A + value of 0 seconds indicates no tumbling window. + """ + topics: list[str] | None = ... + """The name of the Kafka topic.""" + queues: list[str] | None = ... + """(MQ) The name of the Amazon MQ broker destination queue to consume.""" + source_access_configurations: list[SourceAccessConfiguration] | None = ... + """ + An array of authentication protocols or VPC components required to + secure your event source. + """ + self_managed_event_source: SelfManagedEventSource | None = ... + """The self-managed Apache Kafka cluster to receive records from.""" + function_response_types: list[str] | None = ... + """ + (Kinesis, DynamoDB Streams, Amazon MSK, self-managed Apache Kafka, and + Amazon SQS) A list of current response type enums applied to the event + source mapping. + """ + amazon_managed_kafka_event_source_config: ( + AmazonManagedKafkaEventSourceConfig | None + ) = ... + """ + Specific configuration settings for an Amazon Managed Streaming for + Apache Kafka (Amazon MSK) event source. + """ + self_managed_kafka_event_source_config: ( + SelfManagedKafkaEventSourceConfig | None + ) = ... + """ + Specific configuration settings for a self-managed Apache Kafka event + source. + """ + document_db_event_source_config: DocumentDBEventSourceConfig | None = ... + """Specific configuration settings for a DocumentDB event source.""" + provisioned_poller_config: ProvisionedPollerConfig | None = ... + """ + (Amazon SQS, Amazon MSK, and self-managed Apache Kafka only) The + provisioned mode configuration for the event source. For more + information, see [provisioned + mode](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html#invocation-eventsourcemapping-provisioned-mode). + """ + +@dataclass(kw_only=True) +class CreateEventSourceMappingOutput(_SerdeShape): + """ + A mapping between an Amazon Web Services resource and a Lambda function. + For details, see CreateEventSourceMapping. + """ + + uuid: str | None = ... + """The identifier of the event source mapping.""" + starting_position: str | None = ... + """ + The position in a stream from which to start reading. Required for + Amazon Kinesis and Amazon DynamoDB Stream event sources. `AT_TIMESTAMP` + is supported only for Amazon Kinesis streams, Amazon DocumentDB, Amazon + MSK, and self-managed Apache Kafka. + """ + starting_position_timestamp: datetime | None = ... + """ + With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to + start reading. `StartingPositionTimestamp` cannot be in the future. + """ + batch_size: int | None = ... + """ + The maximum number of records in each batch that Lambda pulls from your + stream or queue and sends to your function. Lambda passes all of the + records in the batch to the function in a single call, up to the payload + limit for synchronous invocation (6 MB). + + Default value: Varies by service. For Amazon SQS, the default is 10. For + all other services, the default is 100. + + Related setting: When you set `BatchSize` to a value greater than 10, + you must set `MaximumBatchingWindowInSeconds` to at least 1. + """ + maximum_batching_window_in_seconds: int | None = ... + """ + The maximum amount of time, in seconds, that Lambda spends gathering + records before invoking the function. You can configure + `MaximumBatchingWindowInSeconds` to any value from 0 seconds to 300 + seconds in increments of seconds. + + For streams and Amazon SQS event sources, the default batching window is + 0 seconds. For Amazon MSK, Self-managed Apache Kafka, Amazon MQ, and + DocumentDB event sources, the default batching window is 500 ms. Note + that because you can only change `MaximumBatchingWindowInSeconds` in + increments of seconds, you cannot revert back to the 500 ms default + batching window after you have changed it. To restore the default + batching window, you must create a new event source mapping. + + Related setting: For streams and Amazon SQS event sources, when you set + `BatchSize` to a value greater than 10, you must set + `MaximumBatchingWindowInSeconds` to at least 1. + """ + parallelization_factor: int | None = ... + """ + (Kinesis and DynamoDB Streams only) The number of batches to process + concurrently from each shard. The default value is 1. + """ + event_source_arn: str | None = ... + """The Amazon Resource Name (ARN) of the event source.""" + filter_criteria: FilterCriteria | None = ... + """ + An object that defines the filter criteria that determine whether Lambda + should process an event. For more information, see [Lambda event + filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html). + + If filter criteria is encrypted, this field shows up as `null` in the + response of ListEventSourceMapping API calls. You can view this field in + plaintext in the response of GetEventSourceMapping and + DeleteEventSourceMapping calls if you have `kms:Decrypt` permissions for + the correct KMS key. + """ + filter_criteria_error: FilterCriteriaError | None = ... + """ + An object that contains details about an error related to filter + criteria encryption. + """ + kms_key_arn: str | None = ... + """ + The ARN of the Key Management Service (KMS) customer managed key that + Lambda uses to encrypt your function's [filter + criteria](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html#filtering-basics). + """ + metrics_config: EventSourceMappingMetricsConfig | None = ... + """ + The metrics configuration for your event source. For more information, + see [Event source mapping + metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics-types.html#event-source-mapping-metrics). + """ + logging_config: EventSourceMappingLoggingConfig | None = ... + """ + (Amazon MSK, and self-managed Apache Kafka only) The logging + configuration for your event source. For more information, see [Event + source mapping + logging](https://docs.aws.amazon.com/lambda/latest/dg/esm-logging.html). + """ + scaling_config: ScalingConfig | None = ... + """ + (Amazon SQS only) The scaling configuration for the event source. For + more information, see [Configuring maximum concurrency for Amazon SQS + event + sources](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-max-concurrency). + """ + function_arn: str | None = ... + """The ARN of the Lambda function.""" + last_modified: datetime | None = ... + """ + The date that the event source mapping was last updated or that its + state changed. + """ + last_processing_result: str | None = ... + """The result of the event source mapping's last processing attempt.""" + state: str | None = ... + """ + The state of the event source mapping. It can be one of the following: + `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, + or `Deleting`. + """ + state_transition_reason: str | None = ... + """ + Indicates whether a user or Lambda made the last change to the event + source mapping. + """ + destination_config: DestinationConfig | None = ... + """ + (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) A + configuration object that specifies the destination of an event after + Lambda processes it. + """ + topics: list[str] | None = ... + """The name of the Kafka topic.""" + queues: list[str] | None = ... + """ + (Amazon MQ) The name of the Amazon MQ broker destination queue to + consume. + """ + source_access_configurations: list[SourceAccessConfiguration] | None = ... + """ + An array of the authentication protocol, VPC components, or virtual host + to secure and define your event source. + """ + self_managed_event_source: SelfManagedEventSource | None = ... + """The self-managed Apache Kafka cluster for your event source.""" + maximum_record_age_in_seconds: int | None = ... + """ + (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) + Discard records older than the specified age. The default value is -1, + which sets the maximum age to infinite. When the value is set to + infinite, Lambda never discards old records. + + Note: + The minimum valid value for maximum record age is 60s. Although values + less than 60 and greater than -1 fall within the parameter's absolute + range, they are not allowed + """ + bisect_batch_on_function_error: bool | None = ... + """ + (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) + If the function returns an error, split the batch in two and retry. The + default value is false. + """ + maximum_retry_attempts: int | None = ... + """ + (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) + Discard records after the specified number of retries. The default value + is -1, which sets the maximum number of retries to infinite. When + MaximumRetryAttempts is infinite, Lambda retries failed records until + the record expires in the event source. + """ + tumbling_window_in_seconds: int | None = ... + """ + (Kinesis and DynamoDB Streams only) The duration in seconds of a + processing window for DynamoDB and Kinesis Streams event sources. A + value of 0 seconds indicates no tumbling window. + """ + function_response_types: list[str] | None = ... + """ + (Kinesis, DynamoDB Streams, Amazon MSK, self-managed Apache Kafka, and + Amazon SQS) A list of current response type enums applied to the event + source mapping. + """ + amazon_managed_kafka_event_source_config: ( + AmazonManagedKafkaEventSourceConfig | None + ) = ... + """ + Specific configuration settings for an Amazon Managed Streaming for + Apache Kafka (Amazon MSK) event source. + """ + self_managed_kafka_event_source_config: ( + SelfManagedKafkaEventSourceConfig | None + ) = ... + """ + Specific configuration settings for a self-managed Apache Kafka event + source. + """ + document_db_event_source_config: DocumentDBEventSourceConfig | None = ... + """Specific configuration settings for a DocumentDB event source.""" + event_source_mapping_arn: str | None = ... + """The Amazon Resource Name (ARN) of the event source mapping.""" + provisioned_poller_config: ProvisionedPollerConfig | None = ... + """ + (Amazon SQS, Amazon MSK, and self-managed Apache Kafka only) The + provisioned mode configuration for the event source. For more + information, see [provisioned + mode](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html#invocation-eventsourcemapping-provisioned-mode). + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateFunctionInput(_SerdeShape): + """Dataclass for CreateFunctionInput structure.""" + + function_name: str | None = ... + """ + The name or ARN of the Lambda function. + + **Name formats** + + - **Function name** -- `my-function`. + + - **Function ARN** -- + `arn:aws:lambda:us-west-2:123456789012:function:my-function`. + + - **Partial ARN** -- `123456789012:function:my-function`. + + The length constraint applies only to the full ARN. If you specify only + the function name, it is limited to 64 characters in length. + """ + runtime: str | None = ... + """ + The identifier of the function's + [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html). + Runtime is required if the deployment package is a .zip file archive. + Specifying a runtime results in an error if you're deploying a function + using a container image. + + The following list includes deprecated runtimes. Lambda blocks creating + new functions and updating existing functions shortly after each runtime + is deprecated. For more information, see [Runtime use after + deprecation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-deprecation-levels). + + For a list of all currently supported runtimes, see [Supported + runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtimes-supported). + """ + role: str | None = ... + """The Amazon Resource Name (ARN) of the function's execution role.""" + handler: str | None = ... + """ + The name of the method within your code that Lambda calls to run your + function. Handler is required if the deployment package is a .zip file + archive. The format includes the file name. It can also include + namespaces and other qualifiers, depending on the runtime. For more + information, see [Lambda programming + model](https://docs.aws.amazon.com/lambda/latest/dg/foundation-progmodel.html). + """ + code: FunctionCode | None = ... + """The code for the function.""" + description: str | None = ... + """A description of the function.""" + timeout: int | None = ... + """ + The amount of time (in seconds) that Lambda allows a function to run + before stopping it. The default is 3 seconds, and the maximum allowed + value is 900 seconds. For functions using Lambda Managed Instances, + asynchronous invocations and event source mapping invocations (except + Amazon MQ and Amazon DocumentDB) support a maximum allowed value of + 5,400 seconds (90 minutes). For more information, see [Lambda execution + environment](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-context.html). + """ + memory_size: int | None = ... + """ + The amount of [memory available to the + function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-memory-console) + at runtime. Increasing the function memory also increases its CPU + allocation. The default value is 128 MB. The value can be any multiple + of 1 MB. + """ + publish: bool = ... + """ + Set to true to publish the first version of the function during + creation. + """ + publish_to: str | None = ... + """Specifies where to publish the function version or configuration.""" + vpc_config: VpcConfig | None = ... + """ + For network connectivity to Amazon Web Services resources in a VPC, + specify a list of security groups and subnets in the VPC. When you + connect a function to a VPC, it can access resources and the internet + only through that VPC. For more information, see [Configuring a Lambda + function to access resources in a + VPC](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html). + """ + package_type: str | None = ... + """ + The type of deployment package. Set to `Image` for container image and + set to `Zip` for .zip file archive. + """ + dead_letter_config: DeadLetterConfig | None = ... + """ + A dead-letter queue configuration that specifies the queue or topic + where Lambda sends asynchronous events when they fail processing. For + more information, see [Dead-letter + queues](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-dlq). + """ + environment: Environment | None = ... + """ + Environment variables that are accessible from function code during + execution. + """ + kms_key_arn: str | None = ... + """ + The ARN of the Key Management Service (KMS) customer managed key that's + used to encrypt the following resources: + + - The function's [environment + variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-encryption). + + - The function's [Lambda + SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart-security.html) + snapshots. + + - When used with `SourceKMSKeyArn`, the unzipped version of the .zip + deployment package that's used for function invocations. For more + information, see [Specifying a customer managed key for + Lambda](https://docs.aws.amazon.com/lambda/latest/dg/encrypt-zip-package.html#enable-zip-custom-encryption). + + - The optimized version of the container image that's used for function + invocations. Note that this is not the same key that's used to + protect your container image in the Amazon Elastic Container Registry + (Amazon ECR). For more information, see [Function + lifecycle](https://docs.aws.amazon.com/lambda/latest/dg/images-create.html#images-lifecycle). + + If you don't provide a customer managed key, Lambda uses an [Amazon Web + Services owned + key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk) + or an [Amazon Web Services managed + key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk). + """ + tracing_config: TracingConfig | None = ... + """ + Set `Mode` to `Active` to sample and trace a subset of incoming requests + with + [X-Ray](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html). + """ + tags: dict[str, str] | None = ... + """ + A list of + [tags](https://docs.aws.amazon.com/lambda/latest/dg/tagging.html) to + apply to the function. + """ + layers: list[str] | None = ... + """ + A list of [function + layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) + to add to the function's execution environment. Specify each layer by + its ARN, including the version. + """ + file_system_configs: list[FileSystemConfig] | None = ... + """ + Connection settings for an Amazon EFS file system or an Amazon S3 Files + file system. + """ + code_signing_config_arn: str | None = ... + """ + To enable code signing for this function, specify the ARN of a + code-signing configuration. A code-signing configuration includes a set + of signing profiles, which define the trusted publishers for this + function. + """ + image_config: ImageConfig | None = ... + """ + Container image [configuration + values](https://docs.aws.amazon.com/lambda/latest/dg/images-create.html#images-parms) + that override the values in the container image Dockerfile. + """ + architectures: list[str] | None = ... + """ + The instruction set architecture that the function supports. Enter a + string array with one of the valid values (arm64 or x86_64). The default + value is `x86_64`. + """ + ephemeral_storage: EphemeralStorage | None = ... + """ + The size of the function's `/tmp` directory in MB. The default value is + 512, but can be any whole number between 512 and 10,240 MB. For more + information, see [Configuring ephemeral storage + (console)](https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-ephemeral-storage). + """ + snap_start: SnapStart | None = ... + """ + The function's + [SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html) + setting. + """ + logging_config: LoggingConfig | None = ... + """The function's Amazon CloudWatch Logs configuration settings.""" + tenancy_config: TenancyConfig | None = ... + """ + Configuration for multi-tenant applications that use Lambda functions. + Defines tenant isolation settings and resource allocations. Required for + functions supporting multiple tenants. + """ + capacity_provider_config: CapacityProviderConfig | None = ... + """ + Configuration for the capacity provider that manages compute resources + for Lambda functions. + """ + durable_config: DurableConfig | None = ... + """ + Configuration settings for durable functions. Enables creating functions + with durability that can remember their state and continue execution + even after interruptions. + """ + +@dataclass(kw_only=True) +class CreateFunctionOutput(_SerdeShape): + """Details about a function's configuration.""" + + function_name: str | None = ... + """The name of the function.""" + function_arn: str | None = ... + """The function's Amazon Resource Name (ARN).""" + runtime: str | None = ... + """ + The identifier of the function's + [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html). + Runtime is required if the deployment package is a .zip file archive. + Specifying a runtime results in an error if you're deploying a function + using a container image. + + The following list includes deprecated runtimes. Lambda blocks creating + new functions and updating existing functions shortly after each runtime + is deprecated. For more information, see [Runtime use after + deprecation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-deprecation-levels). + + For a list of all currently supported runtimes, see [Supported + runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtimes-supported). + """ + role: str | None = ... + """The function's execution role.""" + handler: str | None = ... + """The function that Lambda calls to begin running your function.""" + code_size: int = ... + """The size of the function's deployment package, in bytes.""" + description: str | None = ... + """The function's description.""" + timeout: int | None = ... + """ + The amount of time in seconds that Lambda allows a function to run + before stopping it. + """ + memory_size: int | None = ... + """The amount of memory available to the function at runtime.""" + last_modified: str | None = ... + """ + The date and time that the function was last updated, in [ISO-8601 + format](https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). + """ + code_sha256: str | None = ... + """The SHA256 hash of the function's deployment package.""" + version: str | None = ... + """The version of the Lambda function.""" + vpc_config: VpcConfigResponse | None = ... + """The function's networking configuration.""" + dead_letter_config: DeadLetterConfig | None = ... + """The function's dead letter queue.""" + environment: EnvironmentResponse | None = ... + """ + The function's [environment + variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html). + Omitted from CloudTrail logs. + """ + kms_key_arn: str | None = ... + """ + The ARN of the Key Management Service (KMS) customer managed key that's + used to encrypt the following resources: + + - The function's [environment + variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-encryption). + + - The function's [Lambda + SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart-security.html) + snapshots. + + - When used with `SourceKMSKeyArn`, the unzipped version of the .zip + deployment package that's used for function invocations. For more + information, see [Specifying a customer managed key for + Lambda](https://docs.aws.amazon.com/lambda/latest/dg/encrypt-zip-package.html#enable-zip-custom-encryption). + + - The optimized version of the container image that's used for function + invocations. Note that this is not the same key that's used to + protect your container image in the Amazon Elastic Container Registry + (Amazon ECR). For more information, see [Function + lifecycle](https://docs.aws.amazon.com/lambda/latest/dg/images-create.html#images-lifecycle). + + If you don't provide a customer managed key, Lambda uses an [Amazon Web + Services owned + key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk) + or an [Amazon Web Services managed + key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk). + """ + tracing_config: TracingConfigResponse | None = ... + """The function's X-Ray tracing configuration.""" + master_arn: str | None = ... + """For Lambda@Edge functions, the ARN of the main function.""" + revision_id: str | None = ... + """The latest updated revision of the function or alias.""" + layers: list[Layer] | None = ... + """ + The function's + [layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html). + """ + state: str | None = ... + """ + The current state of the function. When the state is `Inactive`, you can + reactivate the function by invoking it. + """ + state_reason: str | None = ... + """The reason for the function's current state.""" + state_reason_code: str | None = ... + """ + The reason code for the function's current state. When the code is + `Creating`, you can't invoke or modify the function. + """ + last_update_status: str | None = ... + """ + The status of the last update that was performed on the function. This + is first set to `Successful` after function creation completes. + """ + last_update_status_reason: str | None = ... + """The reason for the last update that was performed on the function.""" + last_update_status_reason_code: str | None = ... + """The reason code for the last update that was performed on the function.""" + file_system_configs: list[FileSystemConfig] | None = ... + """ + Connection settings for an [Amazon EFS file + system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html) + or an [Amazon S3 file + system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html). + """ + signing_profile_version_arn: str | None = ... + """The ARN of the signing profile version.""" + signing_job_arn: str | None = ... + """The ARN of the signing job.""" + package_type: str | None = ... + """ + The type of deployment package. Set to `Image` for container image and + set `Zip` for .zip file archive. + """ + image_config_response: ImageConfigResponse | None = ... + """The function's image configuration values.""" + architectures: list[str] | None = ... + """ + The instruction set architecture that the function supports. + Architecture is a string array with one of the valid values. The default + architecture value is `x86_64`. + """ + ephemeral_storage: EphemeralStorage | None = ... + """ + The size of the function's `/tmp` directory in MB. The default value is + 512, but can be any whole number between 512 and 10,240 MB. For more + information, see [Configuring ephemeral storage + (console)](https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-ephemeral-storage). + """ + snap_start: SnapStartResponse | None = ... + """ + Set `ApplyOn` to `PublishedVersions` to create a snapshot of the + initialized execution environment when you publish a function version. + For more information, see [Improving startup performance with Lambda + SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html). + """ + runtime_version_config: RuntimeVersionConfig | None = ... + """The ARN of the runtime and any errors that occured.""" + logging_config: LoggingConfig | None = ... + """The function's Amazon CloudWatch Logs configuration settings.""" + tenancy_config: TenancyConfig | None = ... + """ + The function's tenant isolation configuration settings. Determines + whether the Lambda function runs on a shared or dedicated infrastructure + per unique tenant. + """ + capacity_provider_config: CapacityProviderConfig | None = ... + """ + Configuration for the capacity provider that manages compute resources + for Lambda functions. + """ + config_sha256: str | None = ... + """The SHA256 hash of the function configuration.""" + durable_config: DurableConfig | None = ... + """ + The function's durable execution configuration settings, if the + function is configured for durability. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateFunctionUrlConfigInput(_SerdeShape): + """Dataclass for CreateFunctionUrlConfigInput structure.""" + + function_name: str | None = ... + """ + The name or ARN of the Lambda function. + + **Name formats** + + - **Function name** -- `my-function`. + + - **Function ARN** -- + `arn:aws:lambda:us-west-2:123456789012:function:my-function`. + + - **Partial ARN** -- `123456789012:function:my-function`. + + The length constraint applies only to the full ARN. If you specify only + the function name, it is limited to 64 characters in length. + """ + qualifier: str | None = ... + """The alias name.""" + auth_type: str | None = ... + """ + The type of authentication that your function URL uses. Set to `AWS_IAM` + if you want to restrict access to authenticated users only. Set to + `NONE` if you want to bypass IAM authentication to create a public + endpoint. For more information, see [Control access to Lambda function + URLs](https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html). + """ + cors: Cors | None = ... + """ + The [cross-origin resource sharing + (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) settings + for your function URL. + """ + invoke_mode: str | None = ... + """ + Use one of the following options: + + - `BUFFERED` -- This is the default option. Lambda invokes your function + using the `Invoke` API operation. Invocation results are available + when the payload is complete. The maximum payload size is 6 MB. + + - `RESPONSE_STREAM` -- Your function streams payload results as they + become available. Lambda invokes your function using the + `InvokeWithResponseStream` API operation. The maximum response payload + size is 200 MB. + """ + +@dataclass(kw_only=True) +class CreateFunctionUrlConfigOutput(_SerdeShape): + """Dataclass for CreateFunctionUrlConfigOutput structure.""" + + function_url: str + """The HTTP URL endpoint for your function.""" + function_arn: str + """The Amazon Resource Name (ARN) of your function.""" + auth_type: str + """ + The type of authentication that your function URL uses. Set to `AWS_IAM` + if you want to restrict access to authenticated users only. Set to + `NONE` if you want to bypass IAM authentication to create a public + endpoint. For more information, see [Control access to Lambda function + URLs](https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html). + """ + cors: Cors | None = ... + """ + The [cross-origin resource sharing + (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) settings + for your function URL. + """ + creation_time: str + """ + When the function URL was created, in [ISO-8601 + format](https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). + """ + invoke_mode: str | None = ... + """ + Use one of the following options: + + - `BUFFERED` -- This is the default option. Lambda invokes your function + using the `Invoke` API operation. Invocation results are available + when the payload is complete. The maximum payload size is 6 MB. + + - `RESPONSE_STREAM` -- Your function streams payload results as they + become available. Lambda invokes your function using the + `InvokeWithResponseStream` API operation. The maximum response payload + size is 200 MB. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeadLetterConfig(_SerdeShape): + """ + The [dead-letter + queue](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async-retain-records.html#invocation-dlq) + for failed asynchronous invocations. + """ + + target_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of an Amazon SQS queue or Amazon SNS + topic. + """ + +@dataclass(kw_only=True) +class DeleteAliasInput(_SerdeShape): + """Dataclass for DeleteAliasInput structure.""" + + function_name: str | None = ... + """ + The name or ARN of the Lambda function. + + **Name formats** + + - **Function name** - `MyFunction`. + + - **Function ARN** - + `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`. + + - **Partial ARN** - `123456789012:function:MyFunction`. + + The length constraint applies only to the full ARN. If you specify only + the function name, it is limited to 64 characters in length. + """ + name: str | None = ... + """The name of the alias.""" + +@dataclass(kw_only=True) +class DeleteAliasOutput(_SerdeShape): + """Dataclass for DeleteAliasOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteCapacityProviderInput(_SerdeShape): + """Dataclass for DeleteCapacityProviderInput structure.""" + + capacity_provider_name: str | None = ... + """The name of the capacity provider to delete.""" + +@dataclass(kw_only=True) +class DeleteCapacityProviderOutput(_SerdeShape): + """Dataclass for DeleteCapacityProviderOutput structure.""" + + capacity_provider: CapacityProvider + """Information about the deleted capacity provider.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteCodeSigningConfigInput(_SerdeShape): + """Dataclass for DeleteCodeSigningConfigInput structure.""" + + code_signing_config_arn: str | None = ... + """The The Amazon Resource Name (ARN) of the code signing configuration.""" + +@dataclass(kw_only=True) +class DeleteCodeSigningConfigOutput(_SerdeShape): + """Dataclass for DeleteCodeSigningConfigOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteEventSourceMappingInput(_SerdeShape): + """Dataclass for DeleteEventSourceMappingInput structure.""" + + uuid: str | None = ... + """The identifier of the event source mapping.""" + +@dataclass(kw_only=True) +class DeleteEventSourceMappingOutput(_SerdeShape): + """ + A mapping between an Amazon Web Services resource and a Lambda function. + For details, see CreateEventSourceMapping. + """ + + uuid: str | None = ... + """The identifier of the event source mapping.""" + starting_position: str | None = ... + """ + The position in a stream from which to start reading. Required for + Amazon Kinesis and Amazon DynamoDB Stream event sources. `AT_TIMESTAMP` + is supported only for Amazon Kinesis streams, Amazon DocumentDB, Amazon + MSK, and self-managed Apache Kafka. + """ + starting_position_timestamp: datetime | None = ... + """ + With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to + start reading. `StartingPositionTimestamp` cannot be in the future. + """ + batch_size: int | None = ... + """ + The maximum number of records in each batch that Lambda pulls from your + stream or queue and sends to your function. Lambda passes all of the + records in the batch to the function in a single call, up to the payload + limit for synchronous invocation (6 MB). + + Default value: Varies by service. For Amazon SQS, the default is 10. For + all other services, the default is 100. + + Related setting: When you set `BatchSize` to a value greater than 10, + you must set `MaximumBatchingWindowInSeconds` to at least 1. + """ + maximum_batching_window_in_seconds: int | None = ... + """ + The maximum amount of time, in seconds, that Lambda spends gathering + records before invoking the function. You can configure + `MaximumBatchingWindowInSeconds` to any value from 0 seconds to 300 + seconds in increments of seconds. + + For streams and Amazon SQS event sources, the default batching window is + 0 seconds. For Amazon MSK, Self-managed Apache Kafka, Amazon MQ, and + DocumentDB event sources, the default batching window is 500 ms. Note + that because you can only change `MaximumBatchingWindowInSeconds` in + increments of seconds, you cannot revert back to the 500 ms default + batching window after you have changed it. To restore the default + batching window, you must create a new event source mapping. + + Related setting: For streams and Amazon SQS event sources, when you set + `BatchSize` to a value greater than 10, you must set + `MaximumBatchingWindowInSeconds` to at least 1. + """ + parallelization_factor: int | None = ... + """ + (Kinesis and DynamoDB Streams only) The number of batches to process + concurrently from each shard. The default value is 1. + """ + event_source_arn: str | None = ... + """The Amazon Resource Name (ARN) of the event source.""" + filter_criteria: FilterCriteria | None = ... + """ + An object that defines the filter criteria that determine whether Lambda + should process an event. For more information, see [Lambda event + filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html). + + If filter criteria is encrypted, this field shows up as `null` in the + response of ListEventSourceMapping API calls. You can view this field in + plaintext in the response of GetEventSourceMapping and + DeleteEventSourceMapping calls if you have `kms:Decrypt` permissions for + the correct KMS key. + """ + filter_criteria_error: FilterCriteriaError | None = ... + """ + An object that contains details about an error related to filter + criteria encryption. + """ + kms_key_arn: str | None = ... + """ + The ARN of the Key Management Service (KMS) customer managed key that + Lambda uses to encrypt your function's [filter + criteria](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html#filtering-basics). + """ + metrics_config: EventSourceMappingMetricsConfig | None = ... + """ + The metrics configuration for your event source. For more information, + see [Event source mapping + metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics-types.html#event-source-mapping-metrics). + """ + logging_config: EventSourceMappingLoggingConfig | None = ... + """ + (Amazon MSK, and self-managed Apache Kafka only) The logging + configuration for your event source. For more information, see [Event + source mapping + logging](https://docs.aws.amazon.com/lambda/latest/dg/esm-logging.html). + """ + scaling_config: ScalingConfig | None = ... + """ + (Amazon SQS only) The scaling configuration for the event source. For + more information, see [Configuring maximum concurrency for Amazon SQS + event + sources](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-max-concurrency). + """ + function_arn: str | None = ... + """The ARN of the Lambda function.""" + last_modified: datetime | None = ... + """ + The date that the event source mapping was last updated or that its + state changed. + """ + last_processing_result: str | None = ... + """The result of the event source mapping's last processing attempt.""" + state: str | None = ... + """ + The state of the event source mapping. It can be one of the following: + `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, + or `Deleting`. + """ + state_transition_reason: str | None = ... + """ + Indicates whether a user or Lambda made the last change to the event + source mapping. + """ + destination_config: DestinationConfig | None = ... + """ + (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) A + configuration object that specifies the destination of an event after + Lambda processes it. + """ + topics: list[str] | None = ... + """The name of the Kafka topic.""" + queues: list[str] | None = ... + """ + (Amazon MQ) The name of the Amazon MQ broker destination queue to + consume. + """ + source_access_configurations: list[SourceAccessConfiguration] | None = ... + """ + An array of the authentication protocol, VPC components, or virtual host + to secure and define your event source. + """ + self_managed_event_source: SelfManagedEventSource | None = ... + """The self-managed Apache Kafka cluster for your event source.""" + maximum_record_age_in_seconds: int | None = ... + """ + (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) + Discard records older than the specified age. The default value is -1, + which sets the maximum age to infinite. When the value is set to + infinite, Lambda never discards old records. + + Note: + The minimum valid value for maximum record age is 60s. Although values + less than 60 and greater than -1 fall within the parameter's absolute + range, they are not allowed + """ + bisect_batch_on_function_error: bool | None = ... + """ + (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) + If the function returns an error, split the batch in two and retry. The + default value is false. + """ + maximum_retry_attempts: int | None = ... + """ + (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) + Discard records after the specified number of retries. The default value + is -1, which sets the maximum number of retries to infinite. When + MaximumRetryAttempts is infinite, Lambda retries failed records until + the record expires in the event source. + """ + tumbling_window_in_seconds: int | None = ... + """ + (Kinesis and DynamoDB Streams only) The duration in seconds of a + processing window for DynamoDB and Kinesis Streams event sources. A + value of 0 seconds indicates no tumbling window. + """ + function_response_types: list[str] | None = ... + """ + (Kinesis, DynamoDB Streams, Amazon MSK, self-managed Apache Kafka, and + Amazon SQS) A list of current response type enums applied to the event + source mapping. + """ + amazon_managed_kafka_event_source_config: ( + AmazonManagedKafkaEventSourceConfig | None + ) = ... + """ + Specific configuration settings for an Amazon Managed Streaming for + Apache Kafka (Amazon MSK) event source. + """ + self_managed_kafka_event_source_config: ( + SelfManagedKafkaEventSourceConfig | None + ) = ... + """ + Specific configuration settings for a self-managed Apache Kafka event + source. + """ + document_db_event_source_config: DocumentDBEventSourceConfig | None = ... + """Specific configuration settings for a DocumentDB event source.""" + event_source_mapping_arn: str | None = ... + """The Amazon Resource Name (ARN) of the event source mapping.""" + provisioned_poller_config: ProvisionedPollerConfig | None = ... + """ + (Amazon SQS, Amazon MSK, and self-managed Apache Kafka only) The + provisioned mode configuration for the event source. For more + information, see [provisioned + mode](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html#invocation-eventsourcemapping-provisioned-mode). + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteFunctionCodeSigningConfigInput(_SerdeShape): + """Dataclass for DeleteFunctionCodeSigningConfigInput structure.""" + + function_name: str | None = ... + """ + The name or ARN of the Lambda function. + + **Name formats** + + - **Function name** - `MyFunction`. + + - **Function ARN** - + `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`. + + - **Partial ARN** - `123456789012:function:MyFunction`. + + The length constraint applies only to the full ARN. If you specify only + the function name, it is limited to 64 characters in length. + """ + +@dataclass(kw_only=True) +class DeleteFunctionCodeSigningConfigOutput(_SerdeShape): + """Dataclass for DeleteFunctionCodeSigningConfigOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteFunctionConcurrencyInput(_SerdeShape): + """Dataclass for DeleteFunctionConcurrencyInput structure.""" + + function_name: str | None = ... + """ + The name or ARN of the Lambda function. + + **Name formats** + + - **Function name** -- `my-function`. + + - **Function ARN** -- + `arn:aws:lambda:us-west-2:123456789012:function:my-function`. + + - **Partial ARN** -- `123456789012:function:my-function`. + + The length constraint applies only to the full ARN. If you specify only + the function name, it is limited to 64 characters in length. + """ + +@dataclass(kw_only=True) +class DeleteFunctionConcurrencyOutput(_SerdeShape): + """Dataclass for DeleteFunctionConcurrencyOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteFunctionEventInvokeConfigInput(_SerdeShape): + """Dataclass for DeleteFunctionEventInvokeConfigInput structure.""" + + function_name: str | None = ... + """ + The name or ARN of the Lambda function, version, or alias. + + **Name formats** + + - **Function name** - `my-function` (name-only), `my-function:v1` (with + alias). + + - **Function ARN** - + `arn:aws:lambda:us-west-2:123456789012:function:my-function`. + + - **Partial ARN** - `123456789012:function:my-function`. + + You can append a version number or alias to any of the formats. The + length constraint applies only to the full ARN. If you specify only the + function name, it is limited to 64 characters in length. + """ + qualifier: str | None = ... + """A version number or alias name.""" + +@dataclass(kw_only=True) +class DeleteFunctionEventInvokeConfigOutput(_SerdeShape): + """Dataclass for DeleteFunctionEventInvokeConfigOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteFunctionInput(_SerdeShape): + """Dataclass for DeleteFunctionInput structure.""" + + function_name: str | None = ... + """ + The name or ARN of the Lambda function or version. + + **Name formats** + + - **Function name** -- `my-function` (name-only), `my-function:1` (with + version). + + - **Function ARN** -- + `arn:aws:lambda:us-west-2:123456789012:function:my-function`. + + - **Partial ARN** -- `123456789012:function:my-function`. + + You can append a version number or alias to any of the formats. The + length constraint applies only to the full ARN. If you specify only the + function name, it is limited to 64 characters in length. + """ + qualifier: str | None = ... + """ + Specify a version to delete. You can't delete a version that an alias + references. + """ + +@dataclass(kw_only=True) +class DeleteFunctionOutput(_SerdeShape): + """Dataclass for DeleteFunctionOutput structure.""" + + status_code: int = ... + """The HTTP status code returned by the operation.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteFunctionUrlConfigInput(_SerdeShape): + """Dataclass for DeleteFunctionUrlConfigInput structure.""" + + function_name: str | None = ... + """ + The name or ARN of the Lambda function. + + **Name formats** + + - **Function name** -- `my-function`. + + - **Function ARN** -- + `arn:aws:lambda:us-west-2:123456789012:function:my-function`. + + - **Partial ARN** -- `123456789012:function:my-function`. + + The length constraint applies only to the full ARN. If you specify only + the function name, it is limited to 64 characters in length. + """ + qualifier: str | None = ... + """The alias name.""" + +@dataclass(kw_only=True) +class DeleteFunctionUrlConfigOutput(_SerdeShape): + """Dataclass for DeleteFunctionUrlConfigOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteLayerVersionInput(_SerdeShape): + """Dataclass for DeleteLayerVersionInput structure.""" + + layer_name: str | None = ... + """The name or Amazon Resource Name (ARN) of the layer.""" + version_number: int | None = ... + """The version number.""" + +@dataclass(kw_only=True) +class DeleteLayerVersionOutput(_SerdeShape): + """Dataclass for DeleteLayerVersionOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteProvisionedConcurrencyConfigInput(_SerdeShape): + """Dataclass for DeleteProvisionedConcurrencyConfigInput structure.""" + + function_name: str | None = ... + """ + The name or ARN of the Lambda function. + + **Name formats** + + - **Function name** -- `my-function`. + + - **Function ARN** -- + `arn:aws:lambda:us-west-2:123456789012:function:my-function`. + + - **Partial ARN** -- `123456789012:function:my-function`. + + The length constraint applies only to the full ARN. If you specify only + the function name, it is limited to 64 characters in length. + """ + qualifier: str | None = ... + """The version number or alias name.""" + +@dataclass(kw_only=True) +class DeleteProvisionedConcurrencyConfigOutput(_SerdeShape): + """Dataclass for DeleteProvisionedConcurrencyConfigOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteResourcePolicyInput(_SerdeShape): + """Dataclass for DeleteResourcePolicyInput structure.""" + + resource_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the Lambda resource you want to delete + the policy from. You can use a qualified or an unqualified ARN. The + value must be a complete ARN, and the operation does not accept wildcard + characters. + """ + revision_id: str | None = ... + """ + The revision ID that the existing policy must match for the deletion to + proceed. If the revision ID doesn't match, the operation fails with a + `PreconditionFailedException` error. To retrieve the current revision + ID, use the GetResourcePolicy operation. + """ + +@dataclass(kw_only=True) +class DeleteResourcePolicyOutput(_SerdeShape): + """Dataclass for DeleteResourcePolicyOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DestinationConfig(_SerdeShape): + """ + A configuration object that specifies the destination of an event after + Lambda processes it. For more information, see [Adding a + destination](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async-retain-records.html#invocation-async-destinations). + """ + + on_success: OnSuccess | None = ... + """ + The destination configuration for successful invocations. Not supported + in `CreateEventSourceMapping` or `UpdateEventSourceMapping`. + """ + on_failure: OnFailure | None = ... + """The destination configuration for failed invocations.""" + +class DirectS3Read(UnknownEnumMixin, StrEnum): + ENABLED = "ENABLED" + DISABLED = "DISABLED" + AUTO = "AUTO" + +@dataclass(kw_only=True) +class DocumentDBEventSourceConfig(_SerdeShape): + """Specific configuration settings for a DocumentDB event source.""" + + database_name: str | None = ... + """The name of the database to consume within the DocumentDB cluster.""" + collection_name: str | None = ... + """ + The name of the collection to consume within the database. If you do not + specify a collection, Lambda consumes all collections. + """ + full_document: str | None = ... + """ + Determines what DocumentDB sends to your event stream during document + update operations. If set to UpdateLookup, DocumentDB sends a delta + describing the changes, along with a copy of the entire document. + Otherwise, DocumentDB sends only a partial document that contains the + changes. + """ + +@dataclass(kw_only=True) +class DurableConfig(_SerdeShape): + """ + Configuration settings for [durable + functions](https://docs.aws.amazon.com/lambda/latest/dg/durable-functions.html), + including execution timeout, retention period for execution history, and + an optional ARN of the Key Management Service (KMS) customer managed key + that is used to encrypt your durable execution's payload data, + including input, output, and error payloads. + """ + + kms_key_arn: str | None = ... + """ + The ARN of the Key Management Service (KMS) customer managed key that is + used to encrypt your durable execution's payload data, including input, + output, and error payloads. + """ + retention_period_in_days: int | None = ... + """ + The number of days to retain execution history after a durable execution + completes. After this period, execution history is no longer available + through the GetDurableExecutionHistory API. + """ + execution_timeout: int | None = ... + """ + The maximum time (in seconds) that a durable execution can run before + timing out. This timeout applies to the entire durable execution, not + individual function invocations. + """ + +@dataclass(kw_only=True) +class DurableExecutionAlreadyStartedException(ServiceError, _SerdeShape): + """ + The durable execution with the specified name has already been started. + Each durable execution name must be unique within the function. Use a + different name or check the status of the existing execution. + """ + + type: str | None = ... + """The exception type.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class EC2AccessDeniedException(ServiceError, _SerdeShape): + """Need additional permissions to configure VPC settings.""" + + type: str | None = ... + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class EC2ThrottledException(ServiceError, _SerdeShape): + """ + Amazon EC2 throttled Lambda during Lambda function initialization using + the execution role provided for the function. + """ + + type: str | None = ... + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class EC2UnexpectedException(ServiceError, _SerdeShape): + """ + Lambda received an unexpected Amazon EC2 client exception while setting + up for the Lambda function. + """ + + type: str | None = ... + ec2_error_code: str | None = ... + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class EFSIOException(ServiceError, _SerdeShape): + """ + An error occurred when reading from or writing to a connected file + system. + """ + + type: str | None = ... + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class EFSMountConnectivityException(ServiceError, _SerdeShape): + """ + The Lambda function couldn't make a network connection to the + configured file system. + """ + + type: str | None = ... + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class EFSMountFailureException(ServiceError, _SerdeShape): + """ + The Lambda function couldn't mount the configured file system due to a + permission or configuration issue. + """ + + type: str | None = ... + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class EFSMountTimeoutException(ServiceError, _SerdeShape): + """ + The Lambda function made a network connection to the configured file + system, but the mount operation timed out. + """ + + type: str | None = ... + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class EndPointType(UnknownEnumMixin, StrEnum): + KAFKA_BOOTSTRAP_SERVERS = "KAFKA_BOOTSTRAP_SERVERS" + +@dataclass(kw_only=True) +class ENILimitReachedException(ServiceError, _SerdeShape): + """ + Lambda couldn't create an elastic network interface in the VPC, + specified as part of Lambda function configuration, because the limit + for network interfaces has been reached. For more information, see + [Lambda + quotas](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html). + """ + + type: str | None = ... + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ENINotReadyException(ServiceError, _SerdeShape): + """ + Lambda couldn't invoke the Lambda function because the elastic network + interface (ENI) configured for its VPC connection isn't ready yet. Wait + a few moments and try the request again. For more information about VPC + configuration, see [Configuring a Lambda function to access resources in + a + VPC](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html). + """ + + type: str | None = ... + """The exception type.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class Environment(_SerdeShape): + """ + A function's environment variable settings. You can use environment + variables to adjust your function's behavior without updating code. An + environment variable is a pair of strings that are stored in a + function's version-specific configuration. + """ + + variables: dict[str, str] | None = ... + """ + Environment variable key-value pairs. For more information, see [Using + Lambda environment + variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html). + """ + +@dataclass(kw_only=True) +class EnvironmentError(_SerdeShape): + """Error messages for environment variables that couldn't be applied.""" + + error_code: str | None = ... + """The error code.""" + message: str | None = ... + """The error message.""" + +@dataclass(kw_only=True) +class EnvironmentResponse(_SerdeShape): + """ + The results of an operation to update or read environment variables. If + the operation succeeds, the response contains the environment variables. + If it fails, the response contains details about the error. + """ + + variables: dict[str, str] | None = ... + """Environment variable key-value pairs. Omitted from CloudTrail logs.""" + error: EnvironmentError | None = ... + """Error messages for environment variables that couldn't be applied.""" + +@dataclass(kw_only=True) +class EphemeralStorage(_SerdeShape): + """ + The size of the function's `/tmp` directory in MB. The default value is + 512, but can be any whole number between 512 and 10,240 MB. For more + information, see [Configuring ephemeral storage + (console)](https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-ephemeral-storage). + """ + + size: int + """The size of the function's `/tmp` directory.""" + +@dataclass(kw_only=True) +class ErrorObject(_SerdeShape): + """An object that contains error information.""" + + error_message: str | None = ... + """A human-readable error message.""" + error_type: str | None = ... + """The error type.""" + error_data: str | None = ... + """Machine-readable error data.""" + stack_trace: list[str] | None = ... + """Stack trace information for the error.""" + +@dataclass(kw_only=True) +class Event(_SerdeShape): + """An event that occurred during the execution of a durable function.""" + + event_type: str | None = ... + """The type of event that occurred.""" + sub_type: str | None = ... + """The subtype of the event, providing additional categorization.""" + event_id: int = ... + """The unique identifier for this event. Event IDs increment sequentially.""" + id: str | None = ... + """The unique identifier for this operation.""" + name: str | None = ... + """The customer-provided name for this operation.""" + event_timestamp: datetime | None = ... + """ + The date and time when this event occurred, in [ISO-8601 + format](https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). + """ + parent_id: str | None = ... + """ + The unique identifier of the parent operation, if this operation is + running within a child context. + """ + execution_started_details: ExecutionStartedDetails | None = ... + """Details about an execution that started.""" + execution_succeeded_details: ExecutionSucceededDetails | None = ... + """Details about an execution that succeeded.""" + execution_failed_details: ExecutionFailedDetails | None = ... + """Details about an execution that failed.""" + execution_timed_out_details: ExecutionTimedOutDetails | None = ... + """Details about an execution that timed out.""" + execution_stopped_details: ExecutionStoppedDetails | None = ... + """Details about an execution that was stopped.""" + context_started_details: ContextStartedDetails | None = ... + """Details about a context that started.""" + context_succeeded_details: ContextSucceededDetails | None = ... + """Details about a context that succeeded.""" + context_failed_details: ContextFailedDetails | None = ... + """Details about a context that failed.""" + wait_started_details: WaitStartedDetails | None = ... + """Details about a wait operation that started.""" + wait_succeeded_details: WaitSucceededDetails | None = ... + """Details about a wait operation that succeeded.""" + wait_cancelled_details: WaitCancelledDetails | None = ... + """Details about a wait operation that was cancelled.""" + step_started_details: StepStartedDetails | None = ... + """Details about a step that started.""" + step_succeeded_details: StepSucceededDetails | None = ... + """Details about a step that succeeded.""" + step_failed_details: StepFailedDetails | None = ... + """Details about a step that failed.""" + chained_invoke_started_details: ChainedInvokeStartedDetails | None = ... + """ + Contains details about a chained function invocation that has started + execution, including start time and execution context. + """ + chained_invoke_succeeded_details: ChainedInvokeSucceededDetails | None = ... + """Details about a chained invocation that succeeded.""" + chained_invoke_failed_details: ChainedInvokeFailedDetails | None = ... + """ + Contains details about a failed chained function invocation, including + error information and failure reason. + """ + chained_invoke_timed_out_details: ChainedInvokeTimedOutDetails | None = ... + """Details about a chained invocation that timed out.""" + chained_invoke_stopped_details: ChainedInvokeStoppedDetails | None = ... + """Details about a chained invocation that was stopped.""" + callback_started_details: CallbackStartedDetails | None = ... + """ + Contains details about a callback operation that has started, including + timing information and callback metadata. + """ + callback_succeeded_details: CallbackSucceededDetails | None = ... + """ + Contains details about a successfully completed callback operation, + including the result data and completion timestamp. + """ + callback_failed_details: CallbackFailedDetails | None = ... + """ + Contains details about a failed callback operation, including error + information and the reason for failure. + """ + callback_timed_out_details: CallbackTimedOutDetails | None = ... + """ + Contains details about a callback operation that timed out, including + timeout duration and any partial results. + """ + invocation_completed_details: InvocationCompletedDetails | None = ... + """Details about a function invocation that completed.""" + +@dataclass(kw_only=True) +class EventError(_SerdeShape): + """Error information for an event.""" + + payload: ErrorObject | None = ... + """The error payload.""" + truncated: bool | None = ... + """Indicates if the error payload was truncated due to size limits.""" + +@dataclass(kw_only=True) +class EventInput(_SerdeShape): + """Input information for an event.""" + + payload: str | None = ... + """The input payload.""" + truncated: bool | None = ... + """Indicates if the error payload was truncated due to size limits.""" + +@dataclass(kw_only=True) +class EventResult(_SerdeShape): + """Result information for an event.""" + + payload: str | None = ... + """The result payload.""" + truncated: bool | None = ... + """Indicates if the error payload was truncated due to size limits.""" + +@dataclass(kw_only=True) +class EventSourceMappingConfiguration(_SerdeShape): + """ + A mapping between an Amazon Web Services resource and a Lambda function. + For details, see CreateEventSourceMapping. + """ + + uuid: str | None = ... + """The identifier of the event source mapping.""" + starting_position: str | None = ... + """ + The position in a stream from which to start reading. Required for + Amazon Kinesis and Amazon DynamoDB Stream event sources. `AT_TIMESTAMP` + is supported only for Amazon Kinesis streams, Amazon DocumentDB, Amazon + MSK, and self-managed Apache Kafka. + """ + starting_position_timestamp: datetime | None = ... + """ + With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to + start reading. `StartingPositionTimestamp` cannot be in the future. + """ + batch_size: int | None = ... + """ + The maximum number of records in each batch that Lambda pulls from your + stream or queue and sends to your function. Lambda passes all of the + records in the batch to the function in a single call, up to the payload + limit for synchronous invocation (6 MB). + + Default value: Varies by service. For Amazon SQS, the default is 10. For + all other services, the default is 100. + + Related setting: When you set `BatchSize` to a value greater than 10, + you must set `MaximumBatchingWindowInSeconds` to at least 1. + """ + maximum_batching_window_in_seconds: int | None = ... + """ + The maximum amount of time, in seconds, that Lambda spends gathering + records before invoking the function. You can configure + `MaximumBatchingWindowInSeconds` to any value from 0 seconds to 300 + seconds in increments of seconds. + + For streams and Amazon SQS event sources, the default batching window is + 0 seconds. For Amazon MSK, Self-managed Apache Kafka, Amazon MQ, and + DocumentDB event sources, the default batching window is 500 ms. Note + that because you can only change `MaximumBatchingWindowInSeconds` in + increments of seconds, you cannot revert back to the 500 ms default + batching window after you have changed it. To restore the default + batching window, you must create a new event source mapping. + + Related setting: For streams and Amazon SQS event sources, when you set + `BatchSize` to a value greater than 10, you must set + `MaximumBatchingWindowInSeconds` to at least 1. + """ + parallelization_factor: int | None = ... + """ + (Kinesis and DynamoDB Streams only) The number of batches to process + concurrently from each shard. The default value is 1. + """ + event_source_arn: str | None = ... + """The Amazon Resource Name (ARN) of the event source.""" + filter_criteria: FilterCriteria | None = ... + """ + An object that defines the filter criteria that determine whether Lambda + should process an event. For more information, see [Lambda event + filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html). + + If filter criteria is encrypted, this field shows up as `null` in the + response of ListEventSourceMapping API calls. You can view this field in + plaintext in the response of GetEventSourceMapping and + DeleteEventSourceMapping calls if you have `kms:Decrypt` permissions for + the correct KMS key. + """ + filter_criteria_error: FilterCriteriaError | None = ... + """ + An object that contains details about an error related to filter + criteria encryption. + """ + kms_key_arn: str | None = ... + """ + The ARN of the Key Management Service (KMS) customer managed key that + Lambda uses to encrypt your function's [filter + criteria](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html#filtering-basics). + """ + metrics_config: EventSourceMappingMetricsConfig | None = ... + """ + The metrics configuration for your event source. For more information, + see [Event source mapping + metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics-types.html#event-source-mapping-metrics). + """ + logging_config: EventSourceMappingLoggingConfig | None = ... + """ + (Amazon MSK, and self-managed Apache Kafka only) The logging + configuration for your event source. For more information, see [Event + source mapping + logging](https://docs.aws.amazon.com/lambda/latest/dg/esm-logging.html). + """ + scaling_config: ScalingConfig | None = ... + """ + (Amazon SQS only) The scaling configuration for the event source. For + more information, see [Configuring maximum concurrency for Amazon SQS + event + sources](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-max-concurrency). + """ + function_arn: str | None = ... + """The ARN of the Lambda function.""" + last_modified: datetime | None = ... + """ + The date that the event source mapping was last updated or that its + state changed. + """ + last_processing_result: str | None = ... + """The result of the event source mapping's last processing attempt.""" + state: str | None = ... + """ + The state of the event source mapping. It can be one of the following: + `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, + or `Deleting`. + """ + state_transition_reason: str | None = ... + """ + Indicates whether a user or Lambda made the last change to the event + source mapping. + """ + destination_config: DestinationConfig | None = ... + """ + (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) A + configuration object that specifies the destination of an event after + Lambda processes it. + """ + topics: list[str] | None = ... + """The name of the Kafka topic.""" + queues: list[str] | None = ... + """ + (Amazon MQ) The name of the Amazon MQ broker destination queue to + consume. + """ + source_access_configurations: list[SourceAccessConfiguration] | None = ... + """ + An array of the authentication protocol, VPC components, or virtual host + to secure and define your event source. + """ + self_managed_event_source: SelfManagedEventSource | None = ... + """The self-managed Apache Kafka cluster for your event source.""" + maximum_record_age_in_seconds: int | None = ... + """ + (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) + Discard records older than the specified age. The default value is -1, + which sets the maximum age to infinite. When the value is set to + infinite, Lambda never discards old records. + + Note: + The minimum valid value for maximum record age is 60s. Although values + less than 60 and greater than -1 fall within the parameter's absolute + range, they are not allowed + """ + bisect_batch_on_function_error: bool | None = ... + """ + (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) + If the function returns an error, split the batch in two and retry. The + default value is false. + """ + maximum_retry_attempts: int | None = ... + """ + (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) + Discard records after the specified number of retries. The default value + is -1, which sets the maximum number of retries to infinite. When + MaximumRetryAttempts is infinite, Lambda retries failed records until + the record expires in the event source. + """ + tumbling_window_in_seconds: int | None = ... + """ + (Kinesis and DynamoDB Streams only) The duration in seconds of a + processing window for DynamoDB and Kinesis Streams event sources. A + value of 0 seconds indicates no tumbling window. + """ + function_response_types: list[str] | None = ... + """ + (Kinesis, DynamoDB Streams, Amazon MSK, self-managed Apache Kafka, and + Amazon SQS) A list of current response type enums applied to the event + source mapping. + """ + amazon_managed_kafka_event_source_config: ( + AmazonManagedKafkaEventSourceConfig | None + ) = ... + """ + Specific configuration settings for an Amazon Managed Streaming for + Apache Kafka (Amazon MSK) event source. + """ + self_managed_kafka_event_source_config: ( + SelfManagedKafkaEventSourceConfig | None + ) = ... + """ + Specific configuration settings for a self-managed Apache Kafka event + source. + """ + document_db_event_source_config: DocumentDBEventSourceConfig | None = ... + """Specific configuration settings for a DocumentDB event source.""" + event_source_mapping_arn: str | None = ... + """The Amazon Resource Name (ARN) of the event source mapping.""" + provisioned_poller_config: ProvisionedPollerConfig | None = ... + """ + (Amazon SQS, Amazon MSK, and self-managed Apache Kafka only) The + provisioned mode configuration for the event source. For more + information, see [provisioned + mode](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html#invocation-eventsourcemapping-provisioned-mode). + """ + +@dataclass(kw_only=True) +class EventSourceMappingLoggingConfig(_SerdeShape): + """ + (Amazon MSK, and self-managed Apache Kafka only) The logging + configuration for your event source. Use this configuration object to + define the level of logs for your event source mapping. + """ + + system_log_level: str | None = ... + """ + The log level you want your event source mapping to use. Lambda event + poller only sends system logs at the selected level of detail and lower, + where `DEBUG` is the highest level and `WARN` is the lowest. For more + information about these metrics, see [Event source mapping + logging](https://docs.aws.amazon.com/lambda/latest/dg/esm-logging.html). + """ + +class EventSourceMappingMetric(UnknownEnumMixin, StrEnum): + EVENT_COUNT = "EventCount" + ERROR_COUNT = "ErrorCount" + KAFKA_METRICS = "KafkaMetrics" + +@dataclass(kw_only=True) +class EventSourceMappingMetricsConfig(_SerdeShape): + """ + The metrics configuration for your event source. Use this configuration + object to define which metrics you want your event source mapping to + produce. + """ + + metrics: list[str] | None = ... + """ + The metrics you want your event source mapping to produce, including + `EventCount`, `ErrorCount`, `KafkaMetrics`. + + - `EventCount` to receive metrics related to the number of events + processed by your event source mapping. + + - `ErrorCount` (Amazon MSK and self-managed Apache Kafka) to receive + metrics related to the number of errors in your event source mapping + processing. + + - `KafkaMetrics` (Amazon MSK and self-managed Apache Kafka) to receive + metrics related to the Kafka consumers from your event source mapping. + + For more information about these metrics, see [Event source mapping + metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics-types.html#event-source-mapping-metrics). + """ + +class EventSourceMappingSystemLogLevel(UnknownEnumMixin, StrEnum): + DEBUG = "DEBUG" + INFO = "INFO" + WARN = "WARN" + +class EventSourcePosition(UnknownEnumMixin, StrEnum): + TRIM_HORIZON = "TRIM_HORIZON" + LATEST = "LATEST" + AT_TIMESTAMP = "AT_TIMESTAMP" + +class EventType(UnknownEnumMixin, StrEnum): + EXECUTION_STARTED = "ExecutionStarted" + EXECUTION_SUCCEEDED = "ExecutionSucceeded" + EXECUTION_FAILED = "ExecutionFailed" + EXECUTION_TIMED_OUT = "ExecutionTimedOut" + EXECUTION_STOPPED = "ExecutionStopped" + CONTEXT_STARTED = "ContextStarted" + CONTEXT_SUCCEEDED = "ContextSucceeded" + CONTEXT_FAILED = "ContextFailed" + WAIT_STARTED = "WaitStarted" + WAIT_SUCCEEDED = "WaitSucceeded" + WAIT_CANCELLED = "WaitCancelled" + STEP_STARTED = "StepStarted" + STEP_SUCCEEDED = "StepSucceeded" + STEP_FAILED = "StepFailed" + CHAINED_INVOKE_STARTED = "ChainedInvokeStarted" + CHAINED_INVOKE_SUCCEEDED = "ChainedInvokeSucceeded" + CHAINED_INVOKE_FAILED = "ChainedInvokeFailed" + CHAINED_INVOKE_TIMED_OUT = "ChainedInvokeTimedOut" + CHAINED_INVOKE_STOPPED = "ChainedInvokeStopped" + CALLBACK_STARTED = "CallbackStarted" + CALLBACK_SUCCEEDED = "CallbackSucceeded" + CALLBACK_FAILED = "CallbackFailed" + CALLBACK_TIMED_OUT = "CallbackTimedOut" + INVOCATION_COMPLETED = "InvocationCompleted" + +@dataclass(kw_only=True) +class Execution(_SerdeShape): + """ + Information about a [durable + execution](https://docs.aws.amazon.com/lambda/latest/dg/durable-functions.html). + """ + + durable_execution_arn: str + """ + The Amazon Resource Name (ARN) of the durable execution, if this + execution is a durable execution. + """ + durable_execution_name: str + """ + The unique name of the durable execution, if one was provided when the + execution was started. + """ + function_arn: str + """The Amazon Resource Name (ARN) of the Lambda function.""" + status: str + """The current status of the durable execution.""" + start_timestamp: datetime + """ + The date and time when the durable execution started, in [ISO-8601 + format](https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). + """ + end_timestamp: datetime | None = ... + """ + The date and time when the durable execution ended, in [ISO-8601 + format](https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). + """ + kms_key_arn: str | None = ... + """ + The ARN of the Key Management Service (KMS) customer managed key that is + used to encrypt your durable execution's payload data, including input, + output, and error payloads. + """ + +@dataclass(kw_only=True) +class ExecutionDetails(_SerdeShape): + """ + Details about a [durable + execution](https://docs.aws.amazon.com/lambda/latest/dg/durable-functions.html). + """ + + input_payload: str | None = ... + """The original input payload provided for the durable execution.""" + +@dataclass(kw_only=True) +class ExecutionFailedDetails(_SerdeShape): + """ + Details about a failed [durable + execution](https://docs.aws.amazon.com/lambda/latest/dg/durable-functions.html). + """ + + error: EventError + """Details about the execution failure.""" + +@dataclass(kw_only=True) +class ExecutionStartedDetails(_SerdeShape): + """Details about a durable execution that started.""" + + input: EventInput + """The input payload provided for the durable execution.""" + execution_timeout: int + """ + The maximum amount of time that the durable execution is allowed to run, + in seconds. + """ + +class ExecutionStatus(UnknownEnumMixin, StrEnum): + RUNNING = "RUNNING" + SUCCEEDED = "SUCCEEDED" + FAILED = "FAILED" + TIMED_OUT = "TIMED_OUT" + STOPPED = "STOPPED" + +@dataclass(kw_only=True) +class ExecutionStoppedDetails(_SerdeShape): + """ + Details about a [durable + execution](https://docs.aws.amazon.com/lambda/latest/dg/durable-functions.html) + that stopped. + """ + + error: EventError + """Details about why the execution stopped.""" + +@dataclass(kw_only=True) +class ExecutionSucceededDetails(_SerdeShape): + """ + Details about a [durable + execution](https://docs.aws.amazon.com/lambda/latest/dg/durable-functions.html) + that succeeded. + """ + + result: EventResult + """The response payload from the successful operation.""" + +@dataclass(kw_only=True) +class ExecutionTimedOutDetails(_SerdeShape): + """ + Details about a [durable + execution](https://docs.aws.amazon.com/lambda/latest/dg/durable-functions.html) + that timed out. + """ + + error: EventError | None = ... + """Details about the execution timeout.""" + +@dataclass(kw_only=True) +class FileSystemConfig(_SerdeShape): + """ + Details about the connection between a Lambda function and an [Amazon + EFS file + system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html) + or an [Amazon S3 file + system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html). + """ + + arn: str + """ + The Amazon Resource Name (ARN) of the Amazon EFS or Amazon S3 Files + access point that provides access to the file system. + """ + local_mount_path: str + """ + The path where the function can access the file system, starting with + `/mnt/`. + """ + s3_files_config: S3FilesConfig | None = ... + """ + The configuration for how your function accesses data on an Amazon S3 + file system. Valid only when the file system access point ARN is an + Amazon S3 Files access point. If you specify a different access point + type (for example, Amazon Elastic File System), the operation returns an + `InvalidParameterException`. + """ + +@dataclass(kw_only=True) +class Filter(_SerdeShape): + """ + A structure within a `FilterCriteria` object that defines an event + filtering pattern. + """ + + pattern: str | None = ... + """ + A filter pattern. For more information on the syntax of a filter + pattern, see [Filter rule + syntax](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html#filtering-syntax). + """ + +@dataclass(kw_only=True) +class FilterCriteria(_SerdeShape): + """An object that contains the filters for an event source.""" + + filters: list[Filter] | None = ... + """A list of filters.""" + +@dataclass(kw_only=True) +class FilterCriteriaError(_SerdeShape): + """ + An object that contains details about an error related to filter + criteria encryption. + """ + + error_code: str | None = ... + """ + The KMS exception that resulted from filter criteria encryption or + decryption. + """ + message: str | None = ... + """The error message.""" + +class FullDocument(UnknownEnumMixin, StrEnum): + UPDATE_LOOKUP = "UpdateLookup" + DEFAULT = "Default" + +@dataclass(kw_only=True) +class FunctionCode(_SerdeShape): + """ + The code for the Lambda function. You can either specify an object in + Amazon S3, upload a .zip file archive deployment package directly, or + specify the URI of a container image. + """ + + zip_file: bytes | None = ... + """ + The base64-encoded contents of the deployment package. Amazon Web + Services SDK and CLI clients handle the encoding for you. + """ + s3_bucket: str | None = ... + """ + An Amazon S3 bucket in the same Amazon Web Services Region as your + function. The bucket can be in a different Amazon Web Services account. + """ + s3_key: str | None = ... + """The Amazon S3 key of the deployment package.""" + s3_object_version: str | None = ... + """ + For versioned objects, the version of the deployment package object to + use. + """ + s3_object_storage_mode: str | None = ... + """ + Specifies how the deployment package is stored. Valid values: + + - `COPY` (default) -- Uploads a copy of your deployment package to + Lambda. + + - `REFERENCE` -- Lambda references the deployment package from the + specified Amazon S3 bucket. + """ + image_uri: str | None = ... + """ + URI of a [container + image](https://docs.aws.amazon.com/lambda/latest/dg/lambda-images.html) + in the Amazon ECR registry. + """ + source_kms_key_arn: str | None = ... + """ + The ARN of the Key Management Service (KMS) customer managed key that's + used to encrypt your function's .zip deployment package. If you don't + provide a customer managed key, Lambda uses an [Amazon Web Services + owned + key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk). + """ + +@dataclass(kw_only=True) +class FunctionCodeLocation(_SerdeShape): + """Details about a function's deployment package.""" + + repository_type: str | None = ... + """The service that's hosting the file.""" + location: str | None = ... + """A presigned URL that you can use to download the deployment package.""" + image_uri: str | None = ... + """URI of a container image in the Amazon ECR registry.""" + resolved_image_uri: str | None = ... + """The resolved URI for the image.""" + resolved_s3_object: ResolvedS3Object | None = ... + """The resolved Amazon S3 object that contains the deployment package.""" + source_kms_key_arn: str | None = ... + """ + The ARN of the Key Management Service (KMS) customer managed key that's + used to encrypt your function's .zip deployment package. If you don't + provide a customer managed key, Lambda uses an [Amazon Web Services + owned + key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk). + """ + error: FunctionCodeLocationError | None = ... + """ + An object that contains details about an error related to function + deployment package retrieval. + """ + +@dataclass(kw_only=True) +class FunctionCodeLocationError(_SerdeShape): + """ + Contains details about an error that occurred when Lambda attempted to + retrieve a function's deployment package. + """ + + error_code: str | None = ... + """ + The error code that identifies why Lambda failed to retrieve the + deployment package. + """ + message: str | None = ... + """ + The human-readable message that describes why Lambda failed to retrieve + the deployment package. + """ + +@dataclass(kw_only=True) +class FunctionConfiguration(_SerdeShape): + """Details about a function's configuration.""" + + function_name: str | None = ... + """The name of the function.""" + function_arn: str | None = ... + """The function's Amazon Resource Name (ARN).""" + runtime: str | None = ... + """ + The identifier of the function's + [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html). + Runtime is required if the deployment package is a .zip file archive. + Specifying a runtime results in an error if you're deploying a function + using a container image. + + The following list includes deprecated runtimes. Lambda blocks creating + new functions and updating existing functions shortly after each runtime + is deprecated. For more information, see [Runtime use after + deprecation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-deprecation-levels). + + For a list of all currently supported runtimes, see [Supported + runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtimes-supported). + """ + role: str | None = ... + """The function's execution role.""" + handler: str | None = ... + """The function that Lambda calls to begin running your function.""" + code_size: int = ... + """The size of the function's deployment package, in bytes.""" + description: str | None = ... + """The function's description.""" + timeout: int | None = ... + """ + The amount of time in seconds that Lambda allows a function to run + before stopping it. + """ + memory_size: int | None = ... + """The amount of memory available to the function at runtime.""" + last_modified: str | None = ... + """ + The date and time that the function was last updated, in [ISO-8601 + format](https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). + """ + code_sha256: str | None = ... + """The SHA256 hash of the function's deployment package.""" + version: str | None = ... + """The version of the Lambda function.""" + vpc_config: VpcConfigResponse | None = ... + """The function's networking configuration.""" + dead_letter_config: DeadLetterConfig | None = ... + """The function's dead letter queue.""" + environment: EnvironmentResponse | None = ... + """ + The function's [environment + variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html). + Omitted from CloudTrail logs. + """ + kms_key_arn: str | None = ... + """ + The ARN of the Key Management Service (KMS) customer managed key that's + used to encrypt the following resources: + + - The function's [environment + variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-encryption). + + - The function's [Lambda + SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart-security.html) + snapshots. + + - When used with `SourceKMSKeyArn`, the unzipped version of the .zip + deployment package that's used for function invocations. For more + information, see [Specifying a customer managed key for + Lambda](https://docs.aws.amazon.com/lambda/latest/dg/encrypt-zip-package.html#enable-zip-custom-encryption). + + - The optimized version of the container image that's used for function + invocations. Note that this is not the same key that's used to + protect your container image in the Amazon Elastic Container Registry + (Amazon ECR). For more information, see [Function + lifecycle](https://docs.aws.amazon.com/lambda/latest/dg/images-create.html#images-lifecycle). + + If you don't provide a customer managed key, Lambda uses an [Amazon Web + Services owned + key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk) + or an [Amazon Web Services managed + key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk). + """ + tracing_config: TracingConfigResponse | None = ... + """The function's X-Ray tracing configuration.""" + master_arn: str | None = ... + """For Lambda@Edge functions, the ARN of the main function.""" + revision_id: str | None = ... + """The latest updated revision of the function or alias.""" + layers: list[Layer] | None = ... + """ + The function's + [layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html). + """ + state: str | None = ... + """ + The current state of the function. When the state is `Inactive`, you can + reactivate the function by invoking it. + """ + state_reason: str | None = ... + """The reason for the function's current state.""" + state_reason_code: str | None = ... + """ + The reason code for the function's current state. When the code is + `Creating`, you can't invoke or modify the function. + """ + last_update_status: str | None = ... + """ + The status of the last update that was performed on the function. This + is first set to `Successful` after function creation completes. + """ + last_update_status_reason: str | None = ... + """The reason for the last update that was performed on the function.""" + last_update_status_reason_code: str | None = ... + """The reason code for the last update that was performed on the function.""" + file_system_configs: list[FileSystemConfig] | None = ... + """ + Connection settings for an [Amazon EFS file + system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html) + or an [Amazon S3 file + system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html). + """ + signing_profile_version_arn: str | None = ... + """The ARN of the signing profile version.""" + signing_job_arn: str | None = ... + """The ARN of the signing job.""" + package_type: str | None = ... + """ + The type of deployment package. Set to `Image` for container image and + set `Zip` for .zip file archive. + """ + image_config_response: ImageConfigResponse | None = ... + """The function's image configuration values.""" + architectures: list[str] | None = ... + """ + The instruction set architecture that the function supports. + Architecture is a string array with one of the valid values. The default + architecture value is `x86_64`. + """ + ephemeral_storage: EphemeralStorage | None = ... + """ + The size of the function's `/tmp` directory in MB. The default value is + 512, but can be any whole number between 512 and 10,240 MB. For more + information, see [Configuring ephemeral storage + (console)](https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-ephemeral-storage). + """ + snap_start: SnapStartResponse | None = ... + """ + Set `ApplyOn` to `PublishedVersions` to create a snapshot of the + initialized execution environment when you publish a function version. + For more information, see [Improving startup performance with Lambda + SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html). + """ + runtime_version_config: RuntimeVersionConfig | None = ... + """The ARN of the runtime and any errors that occured.""" + logging_config: LoggingConfig | None = ... + """The function's Amazon CloudWatch Logs configuration settings.""" + tenancy_config: TenancyConfig | None = ... + """ + The function's tenant isolation configuration settings. Determines + whether the Lambda function runs on a shared or dedicated infrastructure + per unique tenant. + """ + capacity_provider_config: CapacityProviderConfig | None = ... + """ + Configuration for the capacity provider that manages compute resources + for Lambda functions. + """ + config_sha256: str | None = ... + """The SHA256 hash of the function configuration.""" + durable_config: DurableConfig | None = ... + """ + The function's durable execution configuration settings, if the + function is configured for durability. + """ + +@dataclass(kw_only=True) +class FunctionEventInvokeConfig(_SerdeShape): + """Dataclass for FunctionEventInvokeConfig structure.""" + + last_modified: datetime | None = ... + """The date and time that the configuration was last updated.""" + function_arn: str | None = ... + """The Amazon Resource Name (ARN) of the function.""" + maximum_retry_attempts: int | None = ... + """The maximum number of times to retry when the function returns an error.""" + maximum_event_age_in_seconds: int | None = ... + """ + The maximum age of a request that Lambda sends to a function for + processing. + """ + destination_config: DestinationConfig | None = ... + """ + A destination for events after they have been sent to a function for + processing. + + **Destinations** + + - **Function** - The Amazon Resource Name (ARN) of a Lambda function. + + - **Queue** - The ARN of a standard SQS queue. + + - **Bucket** - The ARN of an Amazon S3 bucket. + + - **Topic** - The ARN of a standard SNS topic. + + - **Event Bus** - The ARN of an Amazon EventBridge event bus. + + Note: + S3 buckets are supported only for on-failure destinations. To retain + records of successful invocations, use another destination type. + """ + +class FunctionResponseType(UnknownEnumMixin, StrEnum): + REPORT_BATCH_ITEM_FAILURES = "ReportBatchItemFailures" + +@dataclass(kw_only=True) +class FunctionScalingConfig(_SerdeShape): + """ + Configuration that defines the scaling behavior for a Lambda Managed + Instances function, including the minimum and maximum number of + execution environments that can be provisioned. + """ + + min_execution_environments: int | None = ... + """ + The minimum number of execution environments to maintain for the + function. + """ + max_execution_environments: int | None = ... + """ + The maximum number of execution environments that can be provisioned for + the function. + """ + +class FunctionUrlAuthType(UnknownEnumMixin, StrEnum): + NONE = "NONE" + AWS_IAM = "AWS_IAM" + +@dataclass(kw_only=True) +class FunctionUrlConfig(_SerdeShape): + """Details about a Lambda function URL.""" + + function_url: str + """The HTTP URL endpoint for your function.""" + function_arn: str + """The Amazon Resource Name (ARN) of your function.""" + creation_time: str + """ + When the function URL was created, in [ISO-8601 + format](https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). + """ + last_modified_time: str + """ + When the function URL configuration was last updated, in [ISO-8601 + format](https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). + """ + cors: Cors | None = ... + """ + The [cross-origin resource sharing + (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) settings + for your function URL. + """ + auth_type: str + """ + The type of authentication that your function URL uses. Set to `AWS_IAM` + if you want to restrict access to authenticated users only. Set to + `NONE` if you want to bypass IAM authentication to create a public + endpoint. For more information, see [Security and auth model for Lambda + function + URLs](https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html). + """ + invoke_mode: str | None = ... + """ + Use one of the following options: + + - `BUFFERED` -- This is the default option. Lambda invokes your function + using the `Invoke` API operation. Invocation results are available + when the payload is complete. The maximum payload size is 6 MB. + + - `RESPONSE_STREAM` -- Your function streams payload results as they + become available. Lambda invokes your function using the + `InvokeWithResponseStream` API operation. The maximum response payload + size is 200 MB. + """ + +class FunctionVersion(UnknownEnumMixin, StrEnum): + ALL = "ALL" + +class FunctionVersionLatestPublished(UnknownEnumMixin, StrEnum): + LATEST_PUBLISHED = "LATEST_PUBLISHED" + +@dataclass(kw_only=True) +class FunctionVersionsByCapacityProviderListItem(_SerdeShape): + """ + Information about a function version that uses a specific capacity + provider, including its ARN and current state. + """ + + function_arn: str + """The Amazon Resource Name (ARN) of the function version.""" + state: str + """The current state of the function version.""" + +@dataclass(kw_only=True) +class FunctionVersionsPerCapacityProviderLimitExceededException( + ServiceError, _SerdeShape +): + """ + The maximum number of function versions that can be associated with a + single capacity provider has been exceeded. For more information, see + [Lambda + quotas](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html). + """ + + type: str | None = ... + """The exception type.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetAccountSettingsInput(_SerdeShape): + """Dataclass for GetAccountSettingsInput structure.""" + +@dataclass(kw_only=True) +class GetAccountSettingsOutput(_SerdeShape): + """Dataclass for GetAccountSettingsOutput structure.""" + + account_limit: AccountLimit | None = ... + """Limits that are related to concurrency and code storage.""" + account_usage: AccountUsage | None = ... + """The number of functions and amount of storage in use.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetAliasInput(_SerdeShape): + """Dataclass for GetAliasInput structure.""" + + function_name: str | None = ... + """ + The name or ARN of the Lambda function. + + **Name formats** + + - **Function name** - `MyFunction`. + + - **Function ARN** - + `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`. + + - **Partial ARN** - `123456789012:function:MyFunction`. + + The length constraint applies only to the full ARN. If you specify only + the function name, it is limited to 64 characters in length. + """ + name: str | None = ... + """The name of the alias.""" + +@dataclass(kw_only=True) +class GetAliasOutput(_SerdeShape): + """ + Provides configuration information about a Lambda function + [alias](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html). + """ + + alias_arn: str | None = ... + """The Amazon Resource Name (ARN) of the alias.""" + name: str | None = ... + """The name of the alias.""" + function_version: str | None = ... + """The function version that the alias invokes.""" + description: str | None = ... + """A description of the alias.""" + routing_config: AliasRoutingConfiguration | None = ... + """ + The [routing + configuration](https://docs.aws.amazon.com/lambda/latest/dg/lambda-traffic-shifting-using-aliases.html) + of the alias. + """ + revision_id: str | None = ... + """A unique identifier that changes when you update the alias.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetCapacityProviderInput(_SerdeShape): + """Dataclass for GetCapacityProviderInput structure.""" + + capacity_provider_name: str | None = ... + """The name of the capacity provider to retrieve.""" + +@dataclass(kw_only=True) +class GetCapacityProviderOutput(_SerdeShape): + """Dataclass for GetCapacityProviderOutput structure.""" + + capacity_provider: CapacityProvider + """ + Information about the capacity provider, including its configuration and + current state. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetCodeSigningConfigInput(_SerdeShape): + """Dataclass for GetCodeSigningConfigInput structure.""" + + code_signing_config_arn: str | None = ... + """The The Amazon Resource Name (ARN) of the code signing configuration.""" + +@dataclass(kw_only=True) +class GetCodeSigningConfigOutput(_SerdeShape): + """Dataclass for GetCodeSigningConfigOutput structure.""" + + code_signing_config: CodeSigningConfig + """The code signing configuration""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetDurableExecutionHistoryInput(_SerdeShape): + """Dataclass for GetDurableExecutionHistoryInput structure.""" + + durable_execution_arn: str | None = ... + """The Amazon Resource Name (ARN) of the durable execution.""" + include_execution_data: bool | None = ... + """ + Specifies whether to include execution data such as step results and + callback payloads in the history events. Set to `true` to include data, + or `false` to exclude it for a more compact response. The default is + `true`. + """ + max_items: int = ... + """ + The maximum number of history events to return per call. You can use + `Marker` to retrieve additional pages of results. The default is 100 and + the maximum allowed is 1000. A value of 0 uses the default. + """ + marker: str | None = ... + """ + If `NextMarker` was returned from a previous request, use this value to + retrieve the next page of results. Each pagination token expires after + 24 hours. + """ + reverse_order: bool | None = ... + """ + When set to `true`, returns the history events in reverse chronological + order (newest first). By default, events are returned in chronological + order (oldest first). + """ + +@dataclass(kw_only=True) +class GetDurableExecutionHistoryOutput(_SerdeShape): + """ + The response from the GetDurableExecutionHistory operation, containing + the execution history and events. + """ + + events: list[Event] + """ + An array of execution history events, ordered chronologically unless + `ReverseOrder` is set to `true`. Each event represents a significant + occurrence during the execution, such as step completion or callback + resolution. + """ + next_marker: str | None = ... + """ + If present, indicates that more history events are available. Use this + value as the `Marker` parameter in a subsequent request to retrieve the + next page of results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetDurableExecutionInput(_SerdeShape): + """Dataclass for GetDurableExecutionInput structure.""" + + durable_execution_arn: str | None = ... + """The Amazon Resource Name (ARN) of the durable execution.""" + include_execution_data: bool = ... + """ + Specifies whether to include execution data such as input payload, + result, and error information in the response. Set to `false` for a more + compact response that includes only execution metadata. The default + value is set to `true`. + """ + +@dataclass(kw_only=True) +class GetDurableExecutionOutput(_SerdeShape): + """ + The response from the GetDurableExecution operation, containing detailed + information about the durable execution. + """ + + durable_execution_arn: str + """The Amazon Resource Name (ARN) of the durable execution.""" + durable_execution_name: str + """ + The name of the durable execution. This is either the name you provided + when invoking the function, or a system-generated unique identifier if + no name was provided. + """ + function_arn: str + """ + The Amazon Resource Name (ARN) of the Lambda function that was invoked + to start this durable execution. + """ + input_payload: str | None = ... + """ + The JSON input payload that was provided when the durable execution was + started. For asynchronous invocations, this is limited to 256 KB. For + synchronous invocations, this can be up to 6 MB. + """ + result: str | None = ... + """ + The JSON result returned by the durable execution if it completed + successfully. This field is only present when the execution status is + `SUCCEEDED`. The result is limited to 256 KB. + """ + error: ErrorObject | None = ... + """ + Error information if the durable execution failed. This field is only + present when the execution status is `FAILED`, `TIMED_OUT`, or + `STOPPED`. The combined size of all error fields is limited to 256 KB. + """ + start_timestamp: datetime + """ + The date and time when the durable execution started, in Unix timestamp + format. + """ + status: str + """ + The current status of the durable execution. Valid values are `RUNNING`, + `SUCCEEDED`, `FAILED`, `TIMED_OUT`, and `STOPPED`. + """ + end_timestamp: datetime | None = ... + """ + The date and time when the durable execution ended, in Unix timestamp + format. This field is only present if the execution has completed + (status is `SUCCEEDED`, `FAILED`, `TIMED_OUT`, or `STOPPED`). + """ + version: str | None = ... + """ + The version of the Lambda function that was invoked for this durable + execution. This ensures that all replays during the execution use the + same function version. + """ + trace_header: TraceHeader | None = ... + """The trace headers associated with the durable execution.""" + execution_data_included: bool | None = ... + """ + Indicates whether execution data is included in this response. Returns + `false` when `IncludeExecutionData` is set to `false` in the request. + """ + durable_config: DurableConfig | None = ... + """ + Configuration settings for the durable execution, including execution + timeout, retention period for execution history, and an optional ARN of + the Key Management Service (KMS) customer managed key that is used to + encrypt your durable execution's payload data, including input, output, + and error payloads. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetDurableExecutionStateInput(_SerdeShape): + """Dataclass for GetDurableExecutionStateInput structure.""" + + durable_execution_arn: str | None = ... + """The Amazon Resource Name (ARN) of the durable execution.""" + checkpoint_token: str | None = ... + """ + A checkpoint token that identifies the current state of the execution. + This token is provided by the Lambda runtime and ensures that state + retrieval is consistent with the current execution context. + """ + marker: str | None = ... + """ + If `NextMarker` was returned from a previous request, use this value to + retrieve the next page of operations. Each pagination token expires + after 24 hours. + """ + max_items: int = ... + """ + The maximum number of operations to return per call. You can use + `Marker` to retrieve additional pages of results. The default is 100 and + the maximum allowed is 1000. A value of 0 uses the default. + """ + +@dataclass(kw_only=True) +class GetDurableExecutionStateOutput(_SerdeShape): + """ + The response from the GetDurableExecutionState operation, containing the + current execution state for replay. + """ + + operations: list[Operation] + """ + An array of operations that represent the current state of the durable + execution. Operations are ordered by their start sequence number in + ascending order and include information needed for replay processing. + """ + next_marker: str | None = ... + """ + If present, indicates that more operations are available. Use this value + as the `Marker` parameter in a subsequent request to retrieve the next + page of results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetEventSourceMappingInput(_SerdeShape): + """Dataclass for GetEventSourceMappingInput structure.""" + + uuid: str | None = ... + """The identifier of the event source mapping.""" + +@dataclass(kw_only=True) +class GetEventSourceMappingOutput(_SerdeShape): + """ + A mapping between an Amazon Web Services resource and a Lambda function. + For details, see CreateEventSourceMapping. + """ + + uuid: str | None = ... + """The identifier of the event source mapping.""" + starting_position: str | None = ... + """ + The position in a stream from which to start reading. Required for + Amazon Kinesis and Amazon DynamoDB Stream event sources. `AT_TIMESTAMP` + is supported only for Amazon Kinesis streams, Amazon DocumentDB, Amazon + MSK, and self-managed Apache Kafka. + """ + starting_position_timestamp: datetime | None = ... + """ + With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to + start reading. `StartingPositionTimestamp` cannot be in the future. + """ + batch_size: int | None = ... + """ + The maximum number of records in each batch that Lambda pulls from your + stream or queue and sends to your function. Lambda passes all of the + records in the batch to the function in a single call, up to the payload + limit for synchronous invocation (6 MB). + + Default value: Varies by service. For Amazon SQS, the default is 10. For + all other services, the default is 100. + + Related setting: When you set `BatchSize` to a value greater than 10, + you must set `MaximumBatchingWindowInSeconds` to at least 1. + """ + maximum_batching_window_in_seconds: int | None = ... + """ + The maximum amount of time, in seconds, that Lambda spends gathering + records before invoking the function. You can configure + `MaximumBatchingWindowInSeconds` to any value from 0 seconds to 300 + seconds in increments of seconds. + + For streams and Amazon SQS event sources, the default batching window is + 0 seconds. For Amazon MSK, Self-managed Apache Kafka, Amazon MQ, and + DocumentDB event sources, the default batching window is 500 ms. Note + that because you can only change `MaximumBatchingWindowInSeconds` in + increments of seconds, you cannot revert back to the 500 ms default + batching window after you have changed it. To restore the default + batching window, you must create a new event source mapping. + + Related setting: For streams and Amazon SQS event sources, when you set + `BatchSize` to a value greater than 10, you must set + `MaximumBatchingWindowInSeconds` to at least 1. + """ + parallelization_factor: int | None = ... + """ + (Kinesis and DynamoDB Streams only) The number of batches to process + concurrently from each shard. The default value is 1. + """ + event_source_arn: str | None = ... + """The Amazon Resource Name (ARN) of the event source.""" + filter_criteria: FilterCriteria | None = ... + """ + An object that defines the filter criteria that determine whether Lambda + should process an event. For more information, see [Lambda event + filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html). + + If filter criteria is encrypted, this field shows up as `null` in the + response of ListEventSourceMapping API calls. You can view this field in + plaintext in the response of GetEventSourceMapping and + DeleteEventSourceMapping calls if you have `kms:Decrypt` permissions for + the correct KMS key. + """ + filter_criteria_error: FilterCriteriaError | None = ... + """ + An object that contains details about an error related to filter + criteria encryption. + """ + kms_key_arn: str | None = ... + """ + The ARN of the Key Management Service (KMS) customer managed key that + Lambda uses to encrypt your function's [filter + criteria](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html#filtering-basics). + """ + metrics_config: EventSourceMappingMetricsConfig | None = ... + """ + The metrics configuration for your event source. For more information, + see [Event source mapping + metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics-types.html#event-source-mapping-metrics). + """ + logging_config: EventSourceMappingLoggingConfig | None = ... + """ + (Amazon MSK, and self-managed Apache Kafka only) The logging + configuration for your event source. For more information, see [Event + source mapping + logging](https://docs.aws.amazon.com/lambda/latest/dg/esm-logging.html). + """ + scaling_config: ScalingConfig | None = ... + """ + (Amazon SQS only) The scaling configuration for the event source. For + more information, see [Configuring maximum concurrency for Amazon SQS + event + sources](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-max-concurrency). + """ + function_arn: str | None = ... + """The ARN of the Lambda function.""" + last_modified: datetime | None = ... + """ + The date that the event source mapping was last updated or that its + state changed. + """ + last_processing_result: str | None = ... + """The result of the event source mapping's last processing attempt.""" + state: str | None = ... + """ + The state of the event source mapping. It can be one of the following: + `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, + or `Deleting`. + """ + state_transition_reason: str | None = ... + """ + Indicates whether a user or Lambda made the last change to the event + source mapping. + """ + destination_config: DestinationConfig | None = ... + """ + (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) A + configuration object that specifies the destination of an event after + Lambda processes it. + """ + topics: list[str] | None = ... + """The name of the Kafka topic.""" + queues: list[str] | None = ... + """ + (Amazon MQ) The name of the Amazon MQ broker destination queue to + consume. + """ + source_access_configurations: list[SourceAccessConfiguration] | None = ... + """ + An array of the authentication protocol, VPC components, or virtual host + to secure and define your event source. + """ + self_managed_event_source: SelfManagedEventSource | None = ... + """The self-managed Apache Kafka cluster for your event source.""" + maximum_record_age_in_seconds: int | None = ... + """ + (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) + Discard records older than the specified age. The default value is -1, + which sets the maximum age to infinite. When the value is set to + infinite, Lambda never discards old records. + + Note: + The minimum valid value for maximum record age is 60s. Although values + less than 60 and greater than -1 fall within the parameter's absolute + range, they are not allowed + """ + bisect_batch_on_function_error: bool | None = ... + """ + (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) + If the function returns an error, split the batch in two and retry. The + default value is false. + """ + maximum_retry_attempts: int | None = ... + """ + (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) + Discard records after the specified number of retries. The default value + is -1, which sets the maximum number of retries to infinite. When + MaximumRetryAttempts is infinite, Lambda retries failed records until + the record expires in the event source. + """ + tumbling_window_in_seconds: int | None = ... + """ + (Kinesis and DynamoDB Streams only) The duration in seconds of a + processing window for DynamoDB and Kinesis Streams event sources. A + value of 0 seconds indicates no tumbling window. + """ + function_response_types: list[str] | None = ... + """ + (Kinesis, DynamoDB Streams, Amazon MSK, self-managed Apache Kafka, and + Amazon SQS) A list of current response type enums applied to the event + source mapping. + """ + amazon_managed_kafka_event_source_config: ( + AmazonManagedKafkaEventSourceConfig | None + ) = ... + """ + Specific configuration settings for an Amazon Managed Streaming for + Apache Kafka (Amazon MSK) event source. + """ + self_managed_kafka_event_source_config: ( + SelfManagedKafkaEventSourceConfig | None + ) = ... + """ + Specific configuration settings for a self-managed Apache Kafka event + source. + """ + document_db_event_source_config: DocumentDBEventSourceConfig | None = ... + """Specific configuration settings for a DocumentDB event source.""" + event_source_mapping_arn: str | None = ... + """The Amazon Resource Name (ARN) of the event source mapping.""" + provisioned_poller_config: ProvisionedPollerConfig | None = ... + """ + (Amazon SQS, Amazon MSK, and self-managed Apache Kafka only) The + provisioned mode configuration for the event source. For more + information, see [provisioned + mode](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html#invocation-eventsourcemapping-provisioned-mode). + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetFunctionCodeSigningConfigInput(_SerdeShape): + """Dataclass for GetFunctionCodeSigningConfigInput structure.""" + + function_name: str | None = ... + """ + The name or ARN of the Lambda function. + + **Name formats** + + - **Function name** - `MyFunction`. + + - **Function ARN** - + `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`. + + - **Partial ARN** - `123456789012:function:MyFunction`. + + The length constraint applies only to the full ARN. If you specify only + the function name, it is limited to 64 characters in length. + """ + +@dataclass(kw_only=True) +class GetFunctionCodeSigningConfigOutput(_SerdeShape): + """Dataclass for GetFunctionCodeSigningConfigOutput structure.""" + + code_signing_config_arn: str + """The The Amazon Resource Name (ARN) of the code signing configuration.""" + function_name: str + """ + The name or ARN of the Lambda function. + + **Name formats** + + - **Function name** - `MyFunction`. + + - **Function ARN** - + `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`. + + - **Partial ARN** - `123456789012:function:MyFunction`. + + The length constraint applies only to the full ARN. If you specify only + the function name, it is limited to 64 characters in length. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetFunctionConcurrencyInput(_SerdeShape): + """Dataclass for GetFunctionConcurrencyInput structure.""" + + function_name: str | None = ... + """ + The name or ARN of the Lambda function. + + **Name formats** + + - **Function name** -- `my-function`. + + - **Function ARN** -- + `arn:aws:lambda:us-west-2:123456789012:function:my-function`. + + - **Partial ARN** -- `123456789012:function:my-function`. + + The length constraint applies only to the full ARN. If you specify only + the function name, it is limited to 64 characters in length. + """ + +@dataclass(kw_only=True) +class GetFunctionConcurrencyOutput(_SerdeShape): + """Dataclass for GetFunctionConcurrencyOutput structure.""" + + reserved_concurrent_executions: int | None = ... + """ + The number of simultaneous executions that are reserved for the + function. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetFunctionConfigurationInput(_SerdeShape): + """Dataclass for GetFunctionConfigurationInput structure.""" + + function_name: str | None = ... + """ + The name or ARN of the Lambda function, version, or alias. + + **Name formats** + + - **Function name** -- `my-function` (name-only), `my-function:v1` (with + alias). + + - **Function ARN** -- + `arn:aws:lambda:us-west-2:123456789012:function:my-function`. + + - **Partial ARN** -- `123456789012:function:my-function`. + + You can append a version number or alias to any of the formats. The + length constraint applies only to the full ARN. If you specify only the + function name, it is limited to 64 characters in length. + """ + qualifier: str | None = ... + """ + Specify a version or alias to get details about a published version of + the function. + """ + +@dataclass(kw_only=True) +class GetFunctionConfigurationOutput(_SerdeShape): + """Details about a function's configuration.""" + + function_name: str | None = ... + """The name of the function.""" + function_arn: str | None = ... + """The function's Amazon Resource Name (ARN).""" + runtime: str | None = ... + """ + The identifier of the function's + [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html). + Runtime is required if the deployment package is a .zip file archive. + Specifying a runtime results in an error if you're deploying a function + using a container image. + + The following list includes deprecated runtimes. Lambda blocks creating + new functions and updating existing functions shortly after each runtime + is deprecated. For more information, see [Runtime use after + deprecation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-deprecation-levels). + + For a list of all currently supported runtimes, see [Supported + runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtimes-supported). + """ + role: str | None = ... + """The function's execution role.""" + handler: str | None = ... + """The function that Lambda calls to begin running your function.""" + code_size: int = ... + """The size of the function's deployment package, in bytes.""" + description: str | None = ... + """The function's description.""" + timeout: int | None = ... + """ + The amount of time in seconds that Lambda allows a function to run + before stopping it. + """ + memory_size: int | None = ... + """The amount of memory available to the function at runtime.""" + last_modified: str | None = ... + """ + The date and time that the function was last updated, in [ISO-8601 + format](https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). + """ + code_sha256: str | None = ... + """The SHA256 hash of the function's deployment package.""" + version: str | None = ... + """The version of the Lambda function.""" + vpc_config: VpcConfigResponse | None = ... + """The function's networking configuration.""" + dead_letter_config: DeadLetterConfig | None = ... + """The function's dead letter queue.""" + environment: EnvironmentResponse | None = ... + """ + The function's [environment + variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html). + Omitted from CloudTrail logs. + """ + kms_key_arn: str | None = ... + """ + The ARN of the Key Management Service (KMS) customer managed key that's + used to encrypt the following resources: + + - The function's [environment + variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-encryption). + + - The function's [Lambda + SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart-security.html) + snapshots. + + - When used with `SourceKMSKeyArn`, the unzipped version of the .zip + deployment package that's used for function invocations. For more + information, see [Specifying a customer managed key for + Lambda](https://docs.aws.amazon.com/lambda/latest/dg/encrypt-zip-package.html#enable-zip-custom-encryption). + + - The optimized version of the container image that's used for function + invocations. Note that this is not the same key that's used to + protect your container image in the Amazon Elastic Container Registry + (Amazon ECR). For more information, see [Function + lifecycle](https://docs.aws.amazon.com/lambda/latest/dg/images-create.html#images-lifecycle). + + If you don't provide a customer managed key, Lambda uses an [Amazon Web + Services owned + key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk) + or an [Amazon Web Services managed + key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk). + """ + tracing_config: TracingConfigResponse | None = ... + """The function's X-Ray tracing configuration.""" + master_arn: str | None = ... + """For Lambda@Edge functions, the ARN of the main function.""" + revision_id: str | None = ... + """The latest updated revision of the function or alias.""" + layers: list[Layer] | None = ... + """ + The function's + [layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html). + """ + state: str | None = ... + """ + The current state of the function. When the state is `Inactive`, you can + reactivate the function by invoking it. + """ + state_reason: str | None = ... + """The reason for the function's current state.""" + state_reason_code: str | None = ... + """ + The reason code for the function's current state. When the code is + `Creating`, you can't invoke or modify the function. + """ + last_update_status: str | None = ... + """ + The status of the last update that was performed on the function. This + is first set to `Successful` after function creation completes. + """ + last_update_status_reason: str | None = ... + """The reason for the last update that was performed on the function.""" + last_update_status_reason_code: str | None = ... + """The reason code for the last update that was performed on the function.""" + file_system_configs: list[FileSystemConfig] | None = ... + """ + Connection settings for an [Amazon EFS file + system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html) + or an [Amazon S3 file + system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html). + """ + signing_profile_version_arn: str | None = ... + """The ARN of the signing profile version.""" + signing_job_arn: str | None = ... + """The ARN of the signing job.""" + package_type: str | None = ... + """ + The type of deployment package. Set to `Image` for container image and + set `Zip` for .zip file archive. + """ + image_config_response: ImageConfigResponse | None = ... + """The function's image configuration values.""" + architectures: list[str] | None = ... + """ + The instruction set architecture that the function supports. + Architecture is a string array with one of the valid values. The default + architecture value is `x86_64`. + """ + ephemeral_storage: EphemeralStorage | None = ... + """ + The size of the function's `/tmp` directory in MB. The default value is + 512, but can be any whole number between 512 and 10,240 MB. For more + information, see [Configuring ephemeral storage + (console)](https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-ephemeral-storage). + """ + snap_start: SnapStartResponse | None = ... + """ + Set `ApplyOn` to `PublishedVersions` to create a snapshot of the + initialized execution environment when you publish a function version. + For more information, see [Improving startup performance with Lambda + SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html). + """ + runtime_version_config: RuntimeVersionConfig | None = ... + """The ARN of the runtime and any errors that occured.""" + logging_config: LoggingConfig | None = ... + """The function's Amazon CloudWatch Logs configuration settings.""" + tenancy_config: TenancyConfig | None = ... + """ + The function's tenant isolation configuration settings. Determines + whether the Lambda function runs on a shared or dedicated infrastructure + per unique tenant. + """ + capacity_provider_config: CapacityProviderConfig | None = ... + """ + Configuration for the capacity provider that manages compute resources + for Lambda functions. + """ + config_sha256: str | None = ... + """The SHA256 hash of the function configuration.""" + durable_config: DurableConfig | None = ... + """ + The function's durable execution configuration settings, if the + function is configured for durability. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetFunctionEventInvokeConfigInput(_SerdeShape): + """Dataclass for GetFunctionEventInvokeConfigInput structure.""" + + function_name: str | None = ... + """ + The name or ARN of the Lambda function, version, or alias. + + **Name formats** + + - **Function name** - `my-function` (name-only), `my-function:v1` (with + alias). + + - **Function ARN** - + `arn:aws:lambda:us-west-2:123456789012:function:my-function`. + + - **Partial ARN** - `123456789012:function:my-function`. + + You can append a version number or alias to any of the formats. The + length constraint applies only to the full ARN. If you specify only the + function name, it is limited to 64 characters in length. + """ + qualifier: str | None = ... + """A version number or alias name.""" + +@dataclass(kw_only=True) +class GetFunctionEventInvokeConfigOutput(_SerdeShape): + """Dataclass for GetFunctionEventInvokeConfigOutput structure.""" + + last_modified: datetime | None = ... + """The date and time that the configuration was last updated.""" + function_arn: str | None = ... + """The Amazon Resource Name (ARN) of the function.""" + maximum_retry_attempts: int | None = ... + """The maximum number of times to retry when the function returns an error.""" + maximum_event_age_in_seconds: int | None = ... + """ + The maximum age of a request that Lambda sends to a function for + processing. + """ + destination_config: DestinationConfig | None = ... + """ + A destination for events after they have been sent to a function for + processing. + + **Destinations** + + - **Function** - The Amazon Resource Name (ARN) of a Lambda function. + + - **Queue** - The ARN of a standard SQS queue. + + - **Bucket** - The ARN of an Amazon S3 bucket. + + - **Topic** - The ARN of a standard SNS topic. + + - **Event Bus** - The ARN of an Amazon EventBridge event bus. + + Note: + S3 buckets are supported only for on-failure destinations. To retain + records of successful invocations, use another destination type. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetFunctionInput(_SerdeShape): + """Dataclass for GetFunctionInput structure.""" + + function_name: str | None = ... + """ + The name or ARN of the Lambda function, version, or alias. + + **Name formats** + + - **Function name** -- `my-function` (name-only), `my-function:v1` (with + alias). + + - **Function ARN** -- + `arn:aws:lambda:us-west-2:123456789012:function:my-function`. + + - **Partial ARN** -- `123456789012:function:my-function`. + + You can append a version number or alias to any of the formats. The + length constraint applies only to the full ARN. If you specify only the + function name, it is limited to 64 characters in length. + """ + qualifier: str | None = ... + """ + Specify a version or alias to get details about a published version of + the function. + """ + +@dataclass(kw_only=True) +class GetFunctionOutput(_SerdeShape): + """Dataclass for GetFunctionOutput structure.""" + + configuration: FunctionConfiguration | None = ... + """The configuration of the function or version.""" + code: FunctionCodeLocation | None = ... + """The deployment package of the function or version.""" + tags: dict[str, str] | None = ... + """ + The function's + [tags](https://docs.aws.amazon.com/lambda/latest/dg/tagging.html). + Lambda returns tag data only if you have explicit allow permissions for + [lambda:ListTags](https://docs.aws.amazon.com/lambda/latest/api/API_ListTags.html). + """ + tags_error: TagsError | None = ... + """ + An object that contains details about an error related to retrieving + tags. + """ + concurrency: Concurrency | None = ... + """ + The function's [reserved + concurrency](https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html). + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetFunctionRecursionConfigInput(_SerdeShape): + """Dataclass for GetFunctionRecursionConfigInput structure.""" + + function_name: str | None = ... + """The name of the function.""" + +@dataclass(kw_only=True) +class GetFunctionRecursionConfigOutput(_SerdeShape): + """Dataclass for GetFunctionRecursionConfigOutput structure.""" + + recursive_loop: str | None = ... + """ + If your function's recursive loop detection configuration is `Allow`, + Lambda doesn't take any action when it detects your function being + invoked as part of a recursive loop. + + If your function's recursive loop detection configuration is + `Terminate`, Lambda stops your function being invoked and notifies you + when it detects your function being invoked as part of a recursive loop. + + By default, Lambda sets your function's configuration to `Terminate`. + You can update this configuration using the PutFunctionRecursionConfig + action. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetFunctionScalingConfigInput(_SerdeShape): + """Dataclass for GetFunctionScalingConfigInput structure.""" + + function_name: str | None = ... + """The name or ARN of the Lambda function.""" + qualifier: str | None = ... + """ + Specify a version or alias to get the scaling configuration for a + published version of the function. + """ + +@dataclass(kw_only=True) +class GetFunctionScalingConfigOutput(_SerdeShape): + """Dataclass for GetFunctionScalingConfigOutput structure.""" + + function_arn: str | None = ... + """The Amazon Resource Name (ARN) of the function.""" + applied_function_scaling_config: FunctionScalingConfig | None = ... + """ + The scaling configuration that is currently applied to the function. + This represents the actual scaling settings in effect. + """ + requested_function_scaling_config: FunctionScalingConfig | None = ... + """The scaling configuration that was requested for the function.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetFunctionUrlConfigInput(_SerdeShape): + """Dataclass for GetFunctionUrlConfigInput structure.""" + + function_name: str | None = ... + """ + The name or ARN of the Lambda function. + + **Name formats** + + - **Function name** -- `my-function`. + + - **Function ARN** -- + `arn:aws:lambda:us-west-2:123456789012:function:my-function`. + + - **Partial ARN** -- `123456789012:function:my-function`. + + The length constraint applies only to the full ARN. If you specify only + the function name, it is limited to 64 characters in length. + """ + qualifier: str | None = ... + """The alias name.""" + +@dataclass(kw_only=True) +class GetFunctionUrlConfigOutput(_SerdeShape): + """Dataclass for GetFunctionUrlConfigOutput structure.""" + + function_url: str + """The HTTP URL endpoint for your function.""" + function_arn: str + """The Amazon Resource Name (ARN) of your function.""" + auth_type: str + """ + The type of authentication that your function URL uses. Set to `AWS_IAM` + if you want to restrict access to authenticated users only. Set to + `NONE` if you want to bypass IAM authentication to create a public + endpoint. For more information, see [Control access to Lambda function + URLs](https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html). + """ + cors: Cors | None = ... + """ + The [cross-origin resource sharing + (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) settings + for your function URL. + """ + creation_time: str + """ + When the function URL was created, in [ISO-8601 + format](https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). + """ + last_modified_time: str + """ + When the function URL configuration was last updated, in [ISO-8601 + format](https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). + """ + invoke_mode: str | None = ... + """ + Use one of the following options: + + - `BUFFERED` -- This is the default option. Lambda invokes your function + using the `Invoke` API operation. Invocation results are available + when the payload is complete. The maximum payload size is 6 MB. + + - `RESPONSE_STREAM` -- Your function streams payload results as they + become available. Lambda invokes your function using the + `InvokeWithResponseStream` API operation. The maximum response payload + size is 200 MB. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetLayerVersionByArnInput(_SerdeShape): + """Dataclass for GetLayerVersionByArnInput structure.""" + + arn: str | None = ... + """The ARN of the layer version.""" + +@dataclass(kw_only=True) +class GetLayerVersionByArnOutput(_SerdeShape): + """Dataclass for GetLayerVersionByArnOutput structure.""" + + content: LayerVersionContentOutput | None = ... + """Details about the layer version.""" + layer_arn: str | None = ... + """The ARN of the layer.""" + layer_version_arn: str | None = ... + """The ARN of the layer version.""" + description: str | None = ... + """The description of the version.""" + created_date: str | None = ... + """ + The date that the layer version was created, in [ISO-8601 + format](https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). + """ + version: int = ... + """The version number.""" + compatible_architectures: list[str] | None = ... + """ + A list of compatible [instruction set + architectures](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html). + """ + compatible_runtimes: list[str] | None = ... + """ + The layer's compatible runtimes. + + The following list includes deprecated runtimes. For more information, + see [Runtime use after + deprecation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-deprecation-levels). + + For a list of all currently supported runtimes, see [Supported + runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtimes-supported). + """ + license_info: str | None = ... + """The layer's software license.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetLayerVersionInput(_SerdeShape): + """Dataclass for GetLayerVersionInput structure.""" + + layer_name: str | None = ... + """The name or Amazon Resource Name (ARN) of the layer.""" + version_number: int | None = ... + """The version number.""" + +@dataclass(kw_only=True) +class GetLayerVersionOutput(_SerdeShape): + """Dataclass for GetLayerVersionOutput structure.""" + + content: LayerVersionContentOutput | None = ... + """Details about the layer version.""" + layer_arn: str | None = ... + """The ARN of the layer.""" + layer_version_arn: str | None = ... + """The ARN of the layer version.""" + description: str | None = ... + """The description of the version.""" + created_date: str | None = ... + """ + The date that the layer version was created, in [ISO-8601 + format](https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). + """ + version: int = ... + """The version number.""" + compatible_architectures: list[str] | None = ... + """ + A list of compatible [instruction set + architectures](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html). + """ + compatible_runtimes: list[str] | None = ... + """ + The layer's compatible runtimes. + + The following list includes deprecated runtimes. For more information, + see [Runtime use after + deprecation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-deprecation-levels). + + For a list of all currently supported runtimes, see [Supported + runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtimes-supported). + """ + license_info: str | None = ... + """The layer's software license.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetLayerVersionPolicyInput(_SerdeShape): + """Dataclass for GetLayerVersionPolicyInput structure.""" + + layer_name: str | None = ... + """The name or Amazon Resource Name (ARN) of the layer.""" + version_number: int | None = ... + """The version number.""" + +@dataclass(kw_only=True) +class GetLayerVersionPolicyOutput(_SerdeShape): + """Dataclass for GetLayerVersionPolicyOutput structure.""" + + policy: str | None = ... + """The policy document.""" + revision_id: str | None = ... + """A unique identifier for the current revision of the policy.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetPolicyInput(_SerdeShape): + """Dataclass for GetPolicyInput structure.""" + + function_name: str | None = ... + """ + The name or ARN of the Lambda function, version, or alias. + + **Name formats** + + - **Function name** -- `my-function` (name-only), `my-function:v1` (with + alias). + + - **Function ARN** -- + `arn:aws:lambda:us-west-2:123456789012:function:my-function`. + + - **Partial ARN** -- `123456789012:function:my-function`. + + You can append a version number or alias to any of the formats. The + length constraint applies only to the full ARN. If you specify only the + function name, it is limited to 64 characters in length. + """ + qualifier: str | None = ... + """Specify a version or alias to get the policy for that resource.""" + +@dataclass(kw_only=True) +class GetPolicyOutput(_SerdeShape): + """Dataclass for GetPolicyOutput structure.""" + + policy: str | None = ... + """The resource-based policy.""" + revision_id: str | None = ... + """A unique identifier for the current revision of the policy.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetProvisionedConcurrencyConfigInput(_SerdeShape): + """Dataclass for GetProvisionedConcurrencyConfigInput structure.""" + + function_name: str | None = ... + """ + The name or ARN of the Lambda function. + + **Name formats** + + - **Function name** -- `my-function`. + + - **Function ARN** -- + `arn:aws:lambda:us-west-2:123456789012:function:my-function`. + + - **Partial ARN** -- `123456789012:function:my-function`. + + The length constraint applies only to the full ARN. If you specify only + the function name, it is limited to 64 characters in length. + """ + qualifier: str | None = ... + """The version number or alias name.""" + +@dataclass(kw_only=True) +class GetProvisionedConcurrencyConfigOutput(_SerdeShape): + """Dataclass for GetProvisionedConcurrencyConfigOutput structure.""" + + requested_provisioned_concurrent_executions: int | None = ... + """The amount of provisioned concurrency requested.""" + available_provisioned_concurrent_executions: int | None = ... + """The amount of provisioned concurrency available.""" + allocated_provisioned_concurrent_executions: int | None = ... + """ + The amount of provisioned concurrency allocated. When a weighted alias + is used during linear and canary deployments, this value fluctuates + depending on the amount of concurrency that is provisioned for the + function versions. + """ + status: str | None = ... + """The status of the allocation process.""" + status_reason: str | None = ... + """ + For failed allocations, the reason that provisioned concurrency could + not be allocated. + """ + last_modified: str | None = ... + """ + The date and time that a user last updated the configuration, in [ISO + 8601 format](https://www.iso.org/iso-8601-date-and-time-format.html). + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetResourcePolicyInput(_SerdeShape): + """Dataclass for GetResourcePolicyInput structure.""" + + resource_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the Lambda resource you want to + retrieve the policy for. You can use a qualified or an unqualified ARN. + The value must be a complete ARN, and the operation does not accept + wildcard characters. + """ + +@dataclass(kw_only=True) +class GetResourcePolicyOutput(_SerdeShape): + """Dataclass for GetResourcePolicyOutput structure.""" + + policy: str | None = ... + """The resource-based policy attached to the Lambda resource you specified.""" + revision_id: str | None = ... + """ + The revision ID of the policy. Pass this value as the `RevisionId` in a + PutResourcePolicy or DeleteResourcePolicy request. Doing so ensures the + operation acts on the expected version of the policy. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetRuntimeManagementConfigInput(_SerdeShape): + """Dataclass for GetRuntimeManagementConfigInput structure.""" + + function_name: str | None = ... + """ + The name or ARN of the Lambda function. + + **Name formats** + + - **Function name** -- `my-function`. + + - **Function ARN** -- + `arn:aws:lambda:us-west-2:123456789012:function:my-function`. + + - **Partial ARN** -- `123456789012:function:my-function`. + + The length constraint applies only to the full ARN. If you specify only + the function name, it is limited to 64 characters in length. + """ + qualifier: str | None = ... + """ + Specify a version of the function. This can be `$LATEST` or a published + version number. If no value is specified, the configuration for the + `$LATEST` version is returned. + """ + +@dataclass(kw_only=True) +class GetRuntimeManagementConfigOutput(_SerdeShape): + """Dataclass for GetRuntimeManagementConfigOutput structure.""" + + update_runtime_on: str | None = ... + """The current runtime update mode of the function.""" + function_arn: str | None = ... + """The Amazon Resource Name (ARN) of your function.""" + runtime_version_arn: str | None = ... + """ + The ARN of the runtime the function is configured to use. If the runtime + update mode is **Manual**, the ARN is returned, otherwise `null` is + returned. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ImageConfig(_SerdeShape): + """ + Configuration values that override the container image Dockerfile + settings. For more information, see [Container image + settings](https://docs.aws.amazon.com/lambda/latest/dg/images-create.html#images-parms). + """ + + entry_point: list[str] | None = ... + """ + Specifies the entry point to their application, which is typically the + location of the runtime executable. + """ + command: list[str] | None = ... + """Specifies parameters that you want to pass in with ENTRYPOINT.""" + working_directory: str | None = ... + """Specifies the working directory.""" + +@dataclass(kw_only=True) +class ImageConfigError(_SerdeShape): + """Error response to `GetFunctionConfiguration`.""" + + error_code: str | None = ... + """Error code.""" + message: str | None = ... + """Error message.""" + +@dataclass(kw_only=True) +class ImageConfigResponse(_SerdeShape): + """Response to a `GetFunctionConfiguration` request.""" + + image_config: ImageConfig | None = ... + """Configuration values that override the container image Dockerfile.""" + error: ImageConfigError | None = ... + """Error response to `GetFunctionConfiguration`.""" + +@dataclass(kw_only=True) +class InstanceRequirements(_SerdeShape): + """ + Specifications that define the characteristics and constraints for + compute instances used by the capacity provider. + """ + + architectures: list[str] | None = ... + """ + A list of supported CPU architectures for compute instances. Valid + values include `x86_64` and `arm64`. + """ + allowed_instance_types: list[str] | None = ... + """ + A list of EC2 instance types that the capacity provider is allowed to + use. If not specified, all compatible instance types are allowed. + """ + excluded_instance_types: list[str] | None = ... + """ + A list of EC2 instance types that the capacity provider should not use, + even if they meet other requirements. + """ + +@dataclass(kw_only=True) +class InvalidCodeSignatureException(ServiceError, _SerdeShape): + """ + The code signature failed the integrity check. If the integrity check + fails, then Lambda blocks deployment, even if the code signing policy is + set to WARN. + """ + + type: str | None = ... + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidParameterValueException(ServiceError, _SerdeShape): + """One of the parameters in the request is not valid.""" + + type: str | None = ... + """The exception type.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidRequestContentException(ServiceError, _SerdeShape): + """ + The request body could not be parsed as JSON, or a request header is + invalid. For example, the 'x-amzn-RequestId' header is not a valid + UUID string. + """ + + type: str | None = ... + """The exception type.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidRuntimeException(ServiceError, _SerdeShape): + """The runtime or runtime version specified is not supported.""" + + type: str | None = ... + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidSecurityGroupIDException(ServiceError, _SerdeShape): + """ + The security group ID provided in the Lambda function VPC configuration + is not valid. + """ + + type: str | None = ... + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidSubnetIDException(ServiceError, _SerdeShape): + """ + The subnet ID provided in the Lambda function VPC configuration is not + valid. + """ + + type: str | None = ... + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidZipFileException(ServiceError, _SerdeShape): + """Lambda could not unzip the deployment package.""" + + type: str | None = ... + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvocationCompletedDetails(_SerdeShape): + """Details about a function invocation that completed.""" + + start_timestamp: datetime + """ + The date and time when the invocation started, in [ISO-8601 + format](https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). + """ + end_timestamp: datetime + """ + The date and time when the invocation ended, in [ISO-8601 + format](https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). + """ + request_id: str + """The request ID for the invocation.""" + error: EventError | None = ... + """Details about the invocation failure.""" + +class InvocationType(UnknownEnumMixin, StrEnum): + EVENT = "Event" + REQUEST_RESPONSE = "RequestResponse" + DRY_RUN = "DryRun" + +@dataclass(kw_only=True) +class InvokeAsyncInput(_SerdeShape): + """Dataclass for InvokeAsyncInput structure.""" + + function_name: str | None = ... + """ + The name or ARN of the Lambda function. + + **Name formats** + + - **Function name** -- `my-function`. + + - **Function ARN** -- + `arn:aws:lambda:us-west-2:123456789012:function:my-function`. + + - **Partial ARN** -- `123456789012:function:my-function`. + + The length constraint applies only to the full ARN. If you specify only + the function name, it is limited to 64 characters in length. + """ + invoke_args: StreamingBlob | None = ... + """The JSON that you want to provide to your Lambda function as input.""" + +@dataclass(kw_only=True) +class InvokeAsyncOutput(_SerdeShape): + """ + A success response (`202 Accepted`) indicates that the request is queued + for invocation. + """ + + status: int = ... + """The status code.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvokeInput(_SerdeShape): + """Dataclass for InvokeInput structure.""" + + function_name: str | None = ... + """ + The name or ARN of the Lambda function, version, or alias. + + **Name formats** + + - **Function name** -- `my-function` (name-only), `my-function:v1` (with + alias). + + - **Function ARN** -- + `arn:aws:lambda:us-west-2:123456789012:function:my-function`. + + - **Partial ARN** -- `123456789012:function:my-function`. + + You can append a version number or alias to any of the formats. The + length constraint applies only to the full ARN. If you specify only the + function name, it is limited to 64 characters in length. + """ + invocation_type: str | None = ... + """ + Choose from the following options. + + - `RequestResponse` (default) -- Invoke the function synchronously. Keep + the connection open until the function returns a response or times + out. The API response includes the function response and additional + data. + + - `Event` -- Invoke the function asynchronously. Send events that fail + multiple times to the function's dead-letter queue (if one is + configured). The API response only includes a status code. + + - `DryRun` -- Validate parameter values and verify that the user or role + has permission to invoke the function. + """ + log_type: str | None = ... + """ + Set to `Tail` to include the execution log in the response. Applies to + synchronously invoked functions only. + """ + client_context: str | None = ... + """ + Up to 3,583 bytes of base64-encoded data about the invoking client to + pass to the function in the context object. Lambda passes the + `ClientContext` object to your function for synchronous invocations + only. + """ + durable_execution_name: str | None = ... + """ + A unique name for the durable execution. If you invoke a durable + function using a name that already exists with the same payload, Lambda + returns the existing execution instead of creating a duplicate. If the + payload differs, Lambda returns a + `DurableExecutionAlreadyStartedException` error. + + If not specified, Lambda generates a unique identifier automatically. + For more information, see [Execution + names](https://docs.aws.amazon.com/lambda/latest/dg/durable-execution-idempotency.html#durable-idempotency-execution-names). + """ + payload: bytes | None = ... + """ + The JSON that you want to provide to your Lambda function as input. The + maximum payload size is 6 MB for synchronous invocations and 1 MB for + asynchronous invocations. + + You can enter the JSON directly. For example, + `--payload '{ "key": "value" }'`. You can also specify a file path. For + example, `--payload file://payload.json`. + """ + qualifier: str | None = ... + """ + Specify a version or alias to invoke a published version of the + function. + """ + tenant_id: str | None = ... + """The identifier of the tenant in a multi-tenant Lambda function.""" + +class InvokeMode(UnknownEnumMixin, StrEnum): + BUFFERED = "BUFFERED" + RESPONSE_STREAM = "RESPONSE_STREAM" + +@dataclass(kw_only=True) +class InvokeOutput(_SerdeShape): + """Dataclass for InvokeOutput structure.""" + + status_code: int = ... + """ + The HTTP status code is in the 200 range for a successful request. For + the `RequestResponse` invocation type, this status code is 200. For the + `Event` invocation type, this status code is 202. For the `DryRun` + invocation type, the status code is 204. + """ + function_error: str | None = ... + """ + If present, indicates that an error occurred during function execution. + Details about the error are included in the response payload. + """ + log_result: str | None = ... + """The last 4 KB of the execution log, which is base64-encoded.""" + payload: bytes | None = ... + """The response from the function, or an error object.""" + executed_version: str | None = ... + """ + The version of the function that executed. When you invoke a function + with an alias, this indicates which version the alias resolved to. + """ + durable_execution_arn: str | None = ... + """ + The ARN of the durable execution that was started. This is returned when + invoking a durable function and provides a unique identifier for + tracking the execution. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvokeResponseStreamUpdate(_SerdeShape): + """A chunk of the streamed response payload.""" + + payload: bytes | None = ... + """Data returned by your Lambda function.""" + +@dataclass(kw_only=True) +class InvokeWithResponseStreamCompleteEvent(_SerdeShape): + """A response confirming that the event stream is complete.""" + + error_code: str | None = ... + """An error code.""" + error_details: str | None = ... + """The details of any returned error.""" + log_result: str | None = ... + """The last 4 KB of the execution log, which is base64-encoded.""" + +@dataclass(kw_only=True) +class InvokeWithResponseStreamInput(_SerdeShape): + """Dataclass for InvokeWithResponseStreamInput structure.""" + + function_name: str | None = ... + """ + The name or ARN of the Lambda function. + + **Name formats** + + - **Function name** -- `my-function`. + + - **Function ARN** -- + `arn:aws:lambda:us-west-2:123456789012:function:my-function`. + + - **Partial ARN** -- `123456789012:function:my-function`. + + The length constraint applies only to the full ARN. If you specify only + the function name, it is limited to 64 characters in length. + """ + log_type: str | None = ... + """ + Set to `Tail` to include the execution log in the response. Applies to + synchronously invoked functions only. + """ + client_context: str | None = ... + """ + Up to 3,583 bytes of base64-encoded data about the invoking client to + pass to the function in the context object. + """ + qualifier: str | None = ... + """The alias name.""" + payload: bytes | None = ... + """ + The JSON that you want to provide to your Lambda function as input. + + You can enter the JSON directly. For example, + `--payload '{ "key": "value" }'`. You can also specify a file path. For + example, `--payload file://payload.json`. + """ + tenant_id: str | None = ... + """The identifier of the tenant in a multi-tenant Lambda function.""" + invocation_type: str | None = ... + """ + Use one of the following options: + + - `RequestResponse` (default) -- Invoke the function synchronously. Keep + the connection open until the function returns a response or times + out. The API operation response includes the function response and + additional data. + + - `DryRun` -- Validate parameter values and verify that the IAM user or + role has permission to invoke the function. + """ + +@dataclass(kw_only=True) +class InvokeWithResponseStreamOutput(_SerdeShape): + """Dataclass for InvokeWithResponseStreamOutput structure.""" + + status_code: int = ... + """ + For a successful request, the HTTP status code is in the 200 range. For + the `RequestResponse` invocation type, this status code is 200. For the + `DryRun` invocation type, this status code is 204. + """ + executed_version: str | None = ... + """ + The version of the function that executed. When you invoke a function + with an alias, this indicates which version the alias resolved to. + """ + response_stream_content_type: str | None = ... + """The type of data the stream is returning.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass +class InvokeWithResponseStreamResponseEventPayloadChunk(_SerdeShape): + """A chunk of the streamed response payload.""" + + value: InvokeResponseStreamUpdate + +@dataclass +class InvokeWithResponseStreamResponseEventInvokeComplete(_SerdeShape): + """ + An object that's returned when the stream has ended and all the payload + chunks have been returned. + """ + + value: InvokeWithResponseStreamCompleteEvent + +@dataclass +class InvokeWithResponseStreamResponseEventUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +InvokeWithResponseStreamResponseEvent = Union[ + InvokeWithResponseStreamResponseEventPayloadChunk + | InvokeWithResponseStreamResponseEventInvokeComplete + | InvokeWithResponseStreamResponseEventUnknown +] +""" +An object that includes a chunk of the response payload. When the stream +has ended, Lambda includes a `InvokeComplete` object. +""" + +class _InvokeWithResponseStreamResponseEventDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> InvokeWithResponseStreamResponseEvent: ... + +@dataclass(kw_only=True) +class KafkaSchemaRegistryAccessConfig(_SerdeShape): + """ + Specific access configuration settings that tell Lambda how to + authenticate with your schema registry. + + If you're working with an Glue schema registry, don't provide + authentication details in this object. Instead, ensure that your + execution role has the required permissions for Lambda to access your + cluster. + + If you're working with a Confluent schema registry, choose the + authentication method in the `Type` field, and provide the Secrets + Manager secret ARN in the `URI` field. + """ + + type: str | None = ... + """The type of authentication Lambda uses to access your schema registry.""" + uri: str | None = ... + """ + The URI of the secret (Secrets Manager secret ARN) to authenticate with + your schema registry. + """ + +class KafkaSchemaRegistryAuthType(UnknownEnumMixin, StrEnum): + BASIC_AUTH = "BASIC_AUTH" + CLIENT_CERTIFICATE_TLS_AUTH = "CLIENT_CERTIFICATE_TLS_AUTH" + SERVER_ROOT_CA_CERTIFICATE = "SERVER_ROOT_CA_CERTIFICATE" + +@dataclass(kw_only=True) +class KafkaSchemaRegistryConfig(_SerdeShape): + """Specific configuration settings for a Kafka schema registry.""" + + schema_registry_uri: str | None = ... + """ + The URI for your schema registry. The correct URI format depends on the + type of schema registry you're using. + + - For Glue schema registries, use the ARN of the registry. + + - For Confluent schema registries, use the URL of the registry. + """ + event_record_format: str | None = ... + """ + The record format that Lambda delivers to your function after schema + validation. + + - Choose `JSON` to have Lambda deliver the record to your function as a + standard JSON object. + + - Choose `SOURCE` to have Lambda deliver the record to your function in + its original source format. Lambda removes all schema metadata, such + as the schema ID, before sending the record to your function. + """ + access_configs: list[KafkaSchemaRegistryAccessConfig] | None = ... + """ + An array of access configuration objects that tell Lambda how to + authenticate with your schema registry. + """ + schema_validation_configs: list[KafkaSchemaValidationConfig] | None = ... + """ + An array of schema validation configuration objects, which tell Lambda + the message attributes you want to validate and filter using your schema + registry. + """ + +class KafkaSchemaValidationAttribute(UnknownEnumMixin, StrEnum): + KEY = "KEY" + VALUE = "VALUE" + +@dataclass(kw_only=True) +class KafkaSchemaValidationConfig(_SerdeShape): + """ + Specific schema validation configuration settings that tell Lambda the + message attributes you want to validate and filter using your schema + registry. + """ + + attribute: str | None = ... + """ + The attributes you want your schema registry to validate and filter for. + If you selected `JSON` as the `EventRecordFormat`, Lambda also + deserializes the selected message attributes. + """ + +@dataclass(kw_only=True) +class KMSAccessDeniedException(ServiceError, _SerdeShape): + """ + Lambda couldn't decrypt the environment variables because KMS access + was denied. Check the Lambda function's KMS permissions. + """ + + type: str | None = ... + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class KMSDisabledException(ServiceError, _SerdeShape): + """ + Lambda couldn't decrypt the environment variables because the KMS key + used is disabled. Check the Lambda function's KMS key settings. + """ + + type: str | None = ... + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class KMSInvalidStateException(ServiceError, _SerdeShape): + """ + Lambda couldn't decrypt the environment variables because the state of + the KMS key used is not valid for Decrypt. Check the function's KMS key + settings. + """ + + type: str | None = ... + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class KMSNotFoundException(ServiceError, _SerdeShape): + """ + Lambda couldn't decrypt the environment variables because the KMS key + was not found. Check the function's KMS key settings. + """ + + type: str | None = ... + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class LambdaManagedInstancesCapacityProviderConfig(_SerdeShape): + """ + Configuration for Lambda-managed instances used by the capacity + provider. + """ + + capacity_provider_arn: str + """The Amazon Resource Name (ARN) of the capacity provider.""" + per_execution_environment_max_concurrency: int | None = ... + """ + The maximum number of concurrent execution environments that can run on + each compute instance. + """ + execution_environment_memory_gi_b_per_v_cpu: float | None = ... + """ + The amount of memory in GiB allocated per vCPU for execution + environments. + """ + +class LastUpdateStatus(UnknownEnumMixin, StrEnum): + SUCCESSFUL = "Successful" + FAILED = "Failed" + IN_PROGRESS = "InProgress" + +class LastUpdateStatusReasonCode(UnknownEnumMixin, StrEnum): + ENI_LIMIT_EXCEEDED = "EniLimitExceeded" + INSUFFICIENT_ROLE_PERMISSIONS = "InsufficientRolePermissions" + INVALID_CONFIGURATION = "InvalidConfiguration" + INTERNAL_ERROR = "InternalError" + SUBNET_OUT_OF_IP_ADDRESSES = "SubnetOutOfIPAddresses" + INVALID_SUBNET = "InvalidSubnet" + INVALID_SECURITY_GROUP = "InvalidSecurityGroup" + IMAGE_DELETED = "ImageDeleted" + IMAGE_ACCESS_DENIED = "ImageAccessDenied" + INVALID_IMAGE = "InvalidImage" + KMS_KEY_ACCESS_DENIED = "KMSKeyAccessDenied" + KMS_KEY_NOT_FOUND = "KMSKeyNotFound" + INVALID_STATE_KMS_KEY = "InvalidStateKMSKey" + DISABLED_KMS_KEY = "DisabledKMSKey" + EFSIO_ERROR = "EFSIOError" + EFS_MOUNT_CONNECTIVITY_ERROR = "EFSMountConnectivityError" + EFS_MOUNT_FAILURE = "EFSMountFailure" + EFS_MOUNT_TIMEOUT = "EFSMountTimeout" + INVALID_RUNTIME = "InvalidRuntime" + INVALID_ZIP_FILE_EXCEPTION = "InvalidZipFileException" + FUNCTION_ERROR = "FunctionError" + SERVICE_QUOTA_EXCEEDED_EXCEPTION = "ServiceQuotaExceededException" + VCPU_LIMIT_EXCEEDED = "VcpuLimitExceeded" + CAPACITY_PROVIDER_SCALING_LIMIT_EXCEEDED = "CapacityProviderScalingLimitExceeded" + INSUFFICIENT_CAPACITY = "InsufficientCapacity" + EC2_REQUEST_LIMIT_EXCEEDED = "EC2RequestLimitExceeded" + FUNCTION_ERROR_INIT_TIMEOUT = "FunctionError.InitTimeout" + FUNCTION_ERROR_RUNTIME_INIT_ERROR = "FunctionError.RuntimeInitError" + FUNCTION_ERROR_EXTENSION_INIT_ERROR = "FunctionError.ExtensionInitError" + FUNCTION_ERROR_INVALID_ENTRY_POINT = "FunctionError.InvalidEntryPoint" + FUNCTION_ERROR_INVALID_WORKING_DIRECTORY = "FunctionError.InvalidWorkingDirectory" + FUNCTION_ERROR_PERMISSION_DENIED = "FunctionError.PermissionDenied" + FUNCTION_ERROR_TOO_MANY_EXTENSIONS = "FunctionError.TooManyExtensions" + FUNCTION_ERROR_INIT_RESOURCE_EXHAUSTED = "FunctionError.InitResourceExhausted" + DISALLOWED_BY_VPC_ENCRYPTION_CONTROL = "DisallowedByVpcEncryptionControl" + DEPENDENCY_ERROR = "DependencyError" + +@dataclass(kw_only=True) +class Layer(_SerdeShape): + """ + An [Lambda + layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html). + """ + + arn: str | None = ... + """The Amazon Resource Name (ARN) of the function layer.""" + code_size: int = ... + """The size of the layer archive in bytes.""" + signing_profile_version_arn: str | None = ... + """The Amazon Resource Name (ARN) for a signing profile version.""" + signing_job_arn: str | None = ... + """The Amazon Resource Name (ARN) of a signing job.""" + +@dataclass(kw_only=True) +class LayersListItem(_SerdeShape): + """ + Details about an [Lambda + layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html). + """ + + layer_name: str | None = ... + """The name of the layer.""" + layer_arn: str | None = ... + """The Amazon Resource Name (ARN) of the function layer.""" + latest_matching_version: LayerVersionsListItem | None = ... + """The newest version of the layer.""" + +@dataclass(kw_only=True) +class LayerVersionContentInput(_SerdeShape): + """ + A ZIP archive that contains the contents of an [Lambda + layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html). + You can specify either an Amazon S3 location, or upload a layer archive + directly. + """ + + s3_bucket: str | None = ... + """The Amazon S3 bucket of the layer archive.""" + s3_key: str | None = ... + """The Amazon S3 key of the layer archive.""" + s3_object_version: str | None = ... + """For versioned objects, the version of the layer archive object to use.""" + s3_object_storage_mode: str | None = ... + """ + Specifies how the layer archive is stored. Valid values: + + - `COPY` (default) -- Uploads a copy of your layer archive to Lambda. + + - `REFERENCE` -- Lambda references the layer archive from the specified + Amazon S3 bucket. + """ + zip_file: bytes | None = ... + """ + The base64-encoded contents of the layer archive. Amazon Web Services + SDK and Amazon Web Services CLI clients handle the encoding for you. + """ + +@dataclass(kw_only=True) +class LayerVersionContentOutput(_SerdeShape): + """ + Details about a version of an [Lambda + layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html). + """ + + location: str | None = ... + """A link to the layer archive in Amazon S3 that is valid for 10 minutes.""" + code_sha256: str | None = ... + """The SHA-256 hash of the layer archive.""" + code_size: int = ... + """The size of the layer archive in bytes.""" + signing_profile_version_arn: str | None = ... + """The Amazon Resource Name (ARN) for a signing profile version.""" + signing_job_arn: str | None = ... + """The Amazon Resource Name (ARN) of a signing job.""" + resolved_s3_object: ResolvedS3Object | None = ... + """The resolved Amazon S3 object that contains the layer archive.""" + +@dataclass(kw_only=True) +class LayerVersionsListItem(_SerdeShape): + """ + Details about a version of an [Lambda + layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html). + """ + + layer_version_arn: str | None = ... + """The ARN of the layer version.""" + version: int = ... + """The version number.""" + description: str | None = ... + """The description of the version.""" + created_date: str | None = ... + """ + The date that the version was created, in ISO 8601 format. For example, + `2018-11-27T15:10:45.123+0000`. + """ + compatible_architectures: list[str] | None = ... + """ + A list of compatible [instruction set + architectures](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html). + """ + compatible_runtimes: list[str] | None = ... + """ + The layer's compatible runtimes. + + The following list includes deprecated runtimes. For more information, + see [Runtime use after + deprecation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-deprecation-levels). + + For a list of all currently supported runtimes, see [Supported + runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtimes-supported). + """ + license_info: str | None = ... + """The layer's open-source license.""" + +@dataclass(kw_only=True) +class ListAliasesInput(_SerdeShape): + """Dataclass for ListAliasesInput structure.""" + + function_name: str | None = ... + """ + The name or ARN of the Lambda function. + + **Name formats** + + - **Function name** - `MyFunction`. + + - **Function ARN** - + `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`. + + - **Partial ARN** - `123456789012:function:MyFunction`. + + The length constraint applies only to the full ARN. If you specify only + the function name, it is limited to 64 characters in length. + """ + function_version: str | None = ... + """ + Specify a function version to only list aliases that invoke that + version. + """ + marker: str | None = ... + """ + Specify the pagination token that's returned by a previous request to + retrieve the next page of results. + """ + max_items: int | None = ... + """Limit the number of aliases returned.""" + +@dataclass(kw_only=True) +class ListAliasesOutput(_SerdeShape): + """Dataclass for ListAliasesOutput structure.""" + + next_marker: str | None = ... + """The pagination token that's included if more results are available.""" + aliases: list[AliasConfiguration] | None = ... + """A list of aliases.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListCapacityProvidersInput(_SerdeShape): + """Dataclass for ListCapacityProvidersInput structure.""" + + state: str | None = ... + """Filter capacity providers by their current state.""" + marker: str | None = ... + """ + Specify the pagination token that's returned by a previous request to + retrieve the next page of results. + """ + max_items: int | None = ... + """The maximum number of capacity providers to return.""" + +@dataclass(kw_only=True) +class ListCapacityProvidersOutput(_SerdeShape): + """Dataclass for ListCapacityProvidersOutput structure.""" + + capacity_providers: list[CapacityProvider] + """A list of capacity providers in your account.""" + next_marker: str | None = ... + """The pagination token that's included if more results are available.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListCodeSigningConfigsInput(_SerdeShape): + """Dataclass for ListCodeSigningConfigsInput structure.""" + + marker: str | None = ... + """ + Specify the pagination token that's returned by a previous request to + retrieve the next page of results. + """ + max_items: int | None = ... + """Maximum number of items to return.""" + +@dataclass(kw_only=True) +class ListCodeSigningConfigsOutput(_SerdeShape): + """Dataclass for ListCodeSigningConfigsOutput structure.""" + + next_marker: str | None = ... + """The pagination token that's included if more results are available.""" + code_signing_configs: list[CodeSigningConfig] | None = ... + """The code signing configurations""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListDurableExecutionsByFunctionInput(_SerdeShape): + """Dataclass for ListDurableExecutionsByFunctionInput structure.""" + + function_name: str | None = ... + """ + The name or ARN of the Lambda function. You can specify a function name, + a partial ARN, or a full ARN. + """ + qualifier: str | None = ... + """ + The function version or alias. If not specified, lists executions for + the $LATEST version. + """ + durable_execution_name: str | None = ... + """ + Filter executions by name. Only executions with names that matches this + string are returned. + """ + statuses: list[str] | None = ... + """ + Filter executions by status. Valid values: RUNNING, SUCCEEDED, FAILED, + TIMED_OUT, STOPPED. + """ + started_after: datetime | None = ... + """Filter executions that started after this timestamp (ISO 8601 format).""" + started_before: datetime | None = ... + """Filter executions that started before this timestamp (ISO 8601 format).""" + reverse_order: bool | None = ... + """ + Set to true to return results in chronological order (oldest first). + Default is false. + """ + marker: str | None = ... + """Pagination token from a previous request to continue retrieving results.""" + max_items: int = ... + """Maximum number of executions to return (1-1000). Default is 100.""" + +@dataclass(kw_only=True) +class ListDurableExecutionsByFunctionOutput(_SerdeShape): + """ + The response from the ListDurableExecutionsByFunction operation, + containing a list of durable executions and pagination information. + """ + + durable_executions: list[Execution] | None = ... + """List of durable execution summaries matching the filter criteria.""" + next_marker: str | None = ... + """ + Pagination token for retrieving additional results. Present only if + there are more results available. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListEventSourceMappingsInput(_SerdeShape): + """Dataclass for ListEventSourceMappingsInput structure.""" + + event_source_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the event source. + + - **Amazon Kinesis** -- The ARN of the data stream or a stream consumer. + + - **Amazon DynamoDB Streams** -- The ARN of the stream. + + - **Amazon Simple Queue Service** -- The ARN of the queue. + + - **Amazon Managed Streaming for Apache Kafka** -- The ARN of the + cluster or the ARN of the VPC connection (for [cross-account event + source + mappings](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#msk-multi-vpc)). + + - **Amazon MQ** -- The ARN of the broker. + + - **Amazon DocumentDB** -- The ARN of the DocumentDB change stream. + """ + function_name: str | None = ... + """ + The name or ARN of the Lambda function. + + **Name formats** + + - **Function name** -- `MyFunction`. + + - **Function ARN** -- + `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`. + + - **Version or Alias ARN** -- + `arn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD`. + + - **Partial ARN** -- `123456789012:function:MyFunction`. + + The length constraint applies only to the full ARN. If you specify only + the function name, it's limited to 64 characters in length. + """ + marker: str | None = ... + """A pagination token returned by a previous call.""" + max_items: int | None = ... + """ + The maximum number of event source mappings to return. Note that + ListEventSourceMappings returns a maximum of 100 items in each response, + even if you set the number higher. + """ + +@dataclass(kw_only=True) +class ListEventSourceMappingsOutput(_SerdeShape): + """Dataclass for ListEventSourceMappingsOutput structure.""" + + next_marker: str | None = ... + """ + A pagination token that's returned when the response doesn't contain + all event source mappings. + """ + event_source_mappings: list[EventSourceMappingConfiguration] | None = ... + """A list of event source mappings.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListFunctionEventInvokeConfigsInput(_SerdeShape): + """Dataclass for ListFunctionEventInvokeConfigsInput structure.""" + + function_name: str | None = ... + """ + The name or ARN of the Lambda function. + + **Name formats** + + - **Function name** - `my-function`. + + - **Function ARN** - + `arn:aws:lambda:us-west-2:123456789012:function:my-function`. + + - **Partial ARN** - `123456789012:function:my-function`. + + The length constraint applies only to the full ARN. If you specify only + the function name, it is limited to 64 characters in length. + """ + marker: str | None = ... + """ + Specify the pagination token that's returned by a previous request to + retrieve the next page of results. + """ + max_items: int | None = ... + """The maximum number of configurations to return.""" + +@dataclass(kw_only=True) +class ListFunctionEventInvokeConfigsOutput(_SerdeShape): + """Dataclass for ListFunctionEventInvokeConfigsOutput structure.""" + + function_event_invoke_configs: list[FunctionEventInvokeConfig] | None = ... + """A list of configurations.""" + next_marker: str | None = ... + """The pagination token that's included if more results are available.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListFunctionsByCodeSigningConfigInput(_SerdeShape): + """Dataclass for ListFunctionsByCodeSigningConfigInput structure.""" + + code_signing_config_arn: str | None = ... + """The The Amazon Resource Name (ARN) of the code signing configuration.""" + marker: str | None = ... + """ + Specify the pagination token that's returned by a previous request to + retrieve the next page of results. + """ + max_items: int | None = ... + """Maximum number of items to return.""" + +@dataclass(kw_only=True) +class ListFunctionsByCodeSigningConfigOutput(_SerdeShape): + """Dataclass for ListFunctionsByCodeSigningConfigOutput structure.""" + + next_marker: str | None = ... + """The pagination token that's included if more results are available.""" + function_arns: list[str] | None = ... + """The function ARNs.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListFunctionsInput(_SerdeShape): + """Dataclass for ListFunctionsInput structure.""" + + master_region: str | None = ... + """ + For Lambda@Edge functions, the Amazon Web Services Region of the master + function. For example, `us-east-1` filters the list of functions to + include only Lambda@Edge functions replicated from a master function in + US East (N. Virginia). If specified, you must set `FunctionVersion` to + `ALL`. + """ + function_version: str | None = ... + """ + Set to `ALL` to include entries for all published versions of each + function. + """ + marker: str | None = ... + """ + Specify the pagination token that's returned by a previous request to + retrieve the next page of results. + """ + max_items: int | None = ... + """ + The maximum number of functions to return in the response. Note that + `ListFunctions` returns a maximum of 50 items in each response, even if + you set the number higher. + """ + +@dataclass(kw_only=True) +class ListFunctionsOutput(_SerdeShape): + """A list of Lambda functions.""" + + next_marker: str | None = ... + """The pagination token that's included if more results are available.""" + functions: list[FunctionConfiguration] | None = ... + """A list of Lambda functions.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListFunctionUrlConfigsInput(_SerdeShape): + """Dataclass for ListFunctionUrlConfigsInput structure.""" + + function_name: str | None = ... + """ + The name or ARN of the Lambda function. + + **Name formats** + + - **Function name** -- `my-function`. + + - **Function ARN** -- + `arn:aws:lambda:us-west-2:123456789012:function:my-function`. + + - **Partial ARN** -- `123456789012:function:my-function`. + + The length constraint applies only to the full ARN. If you specify only + the function name, it is limited to 64 characters in length. + """ + marker: str | None = ... + """ + Specify the pagination token that's returned by a previous request to + retrieve the next page of results. + """ + max_items: int | None = ... + """ + The maximum number of function URLs to return in the response. Note that + `ListFunctionUrlConfigs` returns a maximum of 50 items in each response, + even if you set the number higher. + """ + +@dataclass(kw_only=True) +class ListFunctionUrlConfigsOutput(_SerdeShape): + """Dataclass for ListFunctionUrlConfigsOutput structure.""" + + function_url_configs: list[FunctionUrlConfig] + """A list of function URL configurations.""" + next_marker: str | None = ... + """The pagination token that's included if more results are available.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListFunctionVersionsByCapacityProviderInput(_SerdeShape): + """Dataclass for ListFunctionVersionsByCapacityProviderInput structure.""" + + capacity_provider_name: str | None = ... + """The name of the capacity provider to list function versions for.""" + marker: str | None = ... + """ + Specify the pagination token that's returned by a previous request to + retrieve the next page of results. + """ + max_items: int | None = ... + """The maximum number of function versions to return in the response.""" + +@dataclass(kw_only=True) +class ListFunctionVersionsByCapacityProviderOutput(_SerdeShape): + """Dataclass for ListFunctionVersionsByCapacityProviderOutput structure.""" + + capacity_provider_arn: str + """The Amazon Resource Name (ARN) of the capacity provider.""" + function_versions: list[FunctionVersionsByCapacityProviderListItem] + """A list of function versions that use the specified capacity provider.""" + next_marker: str | None = ... + """The pagination token that's included if more results are available.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListLayersInput(_SerdeShape): + """Dataclass for ListLayersInput structure.""" + + compatible_architecture: str | None = ... + """ + The compatible [instruction set + architecture](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html). + """ + compatible_runtime: str | None = ... + """ + A runtime identifier. + + The following list includes deprecated runtimes. For more information, + see [Runtime use after + deprecation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-deprecation-levels). + + For a list of all currently supported runtimes, see [Supported + runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtimes-supported). + """ + marker: str | None = ... + """A pagination token returned by a previous call.""" + max_items: int | None = ... + """The maximum number of layers to return.""" + +@dataclass(kw_only=True) +class ListLayersOutput(_SerdeShape): + """Dataclass for ListLayersOutput structure.""" + + next_marker: str | None = ... + """ + A pagination token returned when the response doesn't contain all + layers. + """ + layers: list[LayersListItem] | None = ... + """A list of function layers.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListLayerVersionsInput(_SerdeShape): + """Dataclass for ListLayerVersionsInput structure.""" + + compatible_architecture: str | None = ... + """ + The compatible [instruction set + architecture](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html). + """ + compatible_runtime: str | None = ... + """ + A runtime identifier. + + The following list includes deprecated runtimes. For more information, + see [Runtime use after + deprecation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-deprecation-levels). + + For a list of all currently supported runtimes, see [Supported + runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtimes-supported). + """ + layer_name: str | None = ... + """The name or Amazon Resource Name (ARN) of the layer.""" + marker: str | None = ... + """A pagination token returned by a previous call.""" + max_items: int | None = ... + """The maximum number of versions to return.""" + +@dataclass(kw_only=True) +class ListLayerVersionsOutput(_SerdeShape): + """Dataclass for ListLayerVersionsOutput structure.""" + + next_marker: str | None = ... + """ + A pagination token returned when the response doesn't contain all + versions. + """ + layer_versions: list[LayerVersionsListItem] | None = ... + """A list of versions.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListProvisionedConcurrencyConfigsInput(_SerdeShape): + """Dataclass for ListProvisionedConcurrencyConfigsInput structure.""" + + function_name: str | None = ... + """ + The name or ARN of the Lambda function. + + **Name formats** + + - **Function name** -- `my-function`. + + - **Function ARN** -- + `arn:aws:lambda:us-west-2:123456789012:function:my-function`. + + - **Partial ARN** -- `123456789012:function:my-function`. + + The length constraint applies only to the full ARN. If you specify only + the function name, it is limited to 64 characters in length. + """ + marker: str | None = ... + """ + Specify the pagination token that's returned by a previous request to + retrieve the next page of results. + """ + max_items: int | None = ... + """Specify a number to limit the number of configurations returned.""" + +@dataclass(kw_only=True) +class ListProvisionedConcurrencyConfigsOutput(_SerdeShape): + """Dataclass for ListProvisionedConcurrencyConfigsOutput structure.""" + + provisioned_concurrency_configs: ( + list[ProvisionedConcurrencyConfigListItem] | None + ) = ... + """A list of provisioned concurrency configurations.""" + next_marker: str | None = ... + """The pagination token that's included if more results are available.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListTagsInput(_SerdeShape): + """Dataclass for ListTagsInput structure.""" + + resource: str | None = ... + """ + The resource's Amazon Resource Name (ARN). Note: Lambda does not + support adding tags to function aliases or versions. + """ + +@dataclass(kw_only=True) +class ListTagsOutput(_SerdeShape): + """Dataclass for ListTagsOutput structure.""" + + tags: dict[str, str] | None = ... + """The function's tags.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListVersionsByFunctionInput(_SerdeShape): + """Dataclass for ListVersionsByFunctionInput structure.""" + + function_name: str | None = ... + """ + The name or ARN of the Lambda function. + + **Name formats** + + - **Function name** - `MyFunction`. + + - **Function ARN** - + `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`. + + - **Partial ARN** - `123456789012:function:MyFunction`. + + The length constraint applies only to the full ARN. If you specify only + the function name, it is limited to 64 characters in length. + """ + marker: str | None = ... + """ + Specify the pagination token that's returned by a previous request to + retrieve the next page of results. + """ + max_items: int | None = ... + """ + The maximum number of versions to return. Note that + `ListVersionsByFunction` returns a maximum of 50 items in each response, + even if you set the number higher. + """ + +@dataclass(kw_only=True) +class ListVersionsByFunctionOutput(_SerdeShape): + """Dataclass for ListVersionsByFunctionOutput structure.""" + + next_marker: str | None = ... + """The pagination token that's included if more results are available.""" + versions: list[FunctionConfiguration] | None = ... + """A list of Lambda function versions.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class LogFormat(UnknownEnumMixin, StrEnum): + JSON = "JSON" + TEXT = "Text" + +@dataclass(kw_only=True) +class LoggingConfig(_SerdeShape): + """The function's Amazon CloudWatch Logs configuration settings.""" + + log_format: str | None = ... + """ + The format in which Lambda sends your function's application and system + logs to CloudWatch. Select between plain text and structured JSON. + """ + application_log_level: str | None = ... + """ + Set this property to filter the application logs for your function that + Lambda sends to CloudWatch. Lambda only sends application logs at the + selected level of detail and lower, where `TRACE` is the highest level + and `FATAL` is the lowest. + """ + system_log_level: str | None = ... + """ + Set this property to filter the system logs for your function that + Lambda sends to CloudWatch. Lambda only sends system logs at the + selected level of detail and lower, where `DEBUG` is the highest level + and `WARN` is the lowest. + """ + log_group: str | None = ... + """ + The name of the Amazon CloudWatch log group the function sends logs to. + By default, Lambda functions send logs to a default log group named + `/aws/lambda/`. To use a different log group, enter an + existing log group or enter a new log group name. + """ + +class LogType(UnknownEnumMixin, StrEnum): + NONE = "None" + TAIL = "Tail" + +@dataclass(kw_only=True) +class ModeNotSupportedException(ServiceError, _SerdeShape): + """ + The Lambda function doesn't support the invocation mode requested. For + example, calling `Invoke` with `InvocationType=RequestResponse` on a + function configured for asynchronous-only invocation, or vice versa. For + more information about invocation types, see [Invoking Lambda + functions](https://docs.aws.amazon.com/lambda/latest/dg/invocation-options.html). + """ + + type: str | None = ... + """The exception type.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class NoPublishedVersionException(ServiceError, _SerdeShape): + """The function has no published versions available.""" + + type: str | None = ... + """The exception type.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class OnFailure(_SerdeShape): + """ + A destination for events that failed processing. For more information, + see [Adding a + destination](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async-retain-records.html#invocation-async-destinations). + """ + + destination: str | None = ... + """ + The Amazon Resource Name (ARN) of the destination resource. + + To retain records of failed invocations from + [Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html), + [DynamoDB](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html), + [self-managed Apache + Kafka](https://docs.aws.amazon.com/lambda/latest/dg/kafka-on-failure.html), + or [Amazon + MSK](https://docs.aws.amazon.com/lambda/latest/dg/kafka-on-failure.html), + you can configure an Amazon SNS topic, Amazon SQS queue, Amazon S3 + bucket, or Kafka topic as the destination. + + Note: + Amazon SNS destinations have a message size limit of 256 KB. If the + combined size of the function request and response payload exceeds the + limit, Lambda will drop the payload when sending `OnFailure` event to + the destination. For details on this behavior, refer to [Retaining + records of asynchronous + invocations](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async-retain-records.html). + + To retain records of failed invocations from + [Kinesis](https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html), + [DynamoDB](https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html), + [self-managed + Kafka](https://docs.aws.amazon.com/lambda/latest/dg/with-kafka.html#services-smaa-onfailure-destination) + or [Amazon + MSK](https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#services-msk-onfailure-destination), + you can configure an Amazon SNS topic, Amazon SQS queue, or Amazon S3 + bucket as the destination. + """ + +@dataclass(kw_only=True) +class OnSuccess(_SerdeShape): + """ + A destination for events that were processed successfully. + + To retain records of successful [asynchronous + invocations](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-async-destinations), + you can configure an Amazon SNS topic, Amazon SQS queue, Lambda + function, or Amazon EventBridge event bus as the destination. + + Note: + `OnSuccess` is not supported in `CreateEventSourceMapping` or + `UpdateEventSourceMapping` requests. + """ + + destination: str | None = ... + """ + The Amazon Resource Name (ARN) of the destination resource. + + Note: + Amazon SNS destinations have a message size limit of 256 KB. If the + combined size of the function request and response payload exceeds the + limit, Lambda will drop the payload when sending `OnFailure` event to + the destination. For details on this behavior, refer to [Retaining + records of asynchronous + invocations](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async-retain-records.html). + """ + +@dataclass(kw_only=True) +class Operation(_SerdeShape): + """Information about an operation within a durable execution.""" + + id: str + """The unique identifier for this operation.""" + parent_id: str | None = ... + """ + The unique identifier of the parent operation, if this operation is + running within a child context. + """ + name: str | None = ... + """The customer-provided name for this operation.""" + type: str + """The type of operation.""" + sub_type: str | None = ... + """The subtype of the operation, providing additional categorization.""" + start_timestamp: datetime + """ + The date and time when the operation started, in [ISO-8601 + format](https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). + """ + end_timestamp: datetime | None = ... + """ + The date and time when the operation ended, in [ISO-8601 + format](https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). + """ + status: str + """The current status of the operation.""" + execution_details: ExecutionDetails | None = ... + """Details about the execution, if this operation represents an execution.""" + context_details: ContextDetails | None = ... + """Details about the context, if this operation represents a context.""" + step_details: StepDetails | None = ... + """Details about the step, if this operation represents a step.""" + wait_details: WaitDetails | None = ... + """Details about the wait operation, if this operation represents a wait.""" + callback_details: CallbackDetails | None = ... + """ + Contains details about a callback operation in a durable execution, + including the callback token and timeout configuration. + """ + chained_invoke_details: ChainedInvokeDetails | None = ... + """ + Contains details about a chained function invocation in a durable + execution, including the target function and invocation parameters. + """ + +class OperationAction(UnknownEnumMixin, StrEnum): + START = "START" + SUCCEED = "SUCCEED" + FAIL = "FAIL" + RETRY = "RETRY" + CANCEL = "CANCEL" + +class OperationStatus(UnknownEnumMixin, StrEnum): + STARTED = "STARTED" + PENDING = "PENDING" + READY = "READY" + SUCCEEDED = "SUCCEEDED" + FAILED = "FAILED" + CANCELLED = "CANCELLED" + TIMED_OUT = "TIMED_OUT" + STOPPED = "STOPPED" + +class OperationType(UnknownEnumMixin, StrEnum): + EXECUTION = "EXECUTION" + CONTEXT = "CONTEXT" + STEP = "STEP" + WAIT = "WAIT" + CALLBACK = "CALLBACK" + CHAINED_INVOKE = "CHAINED_INVOKE" + +@dataclass(kw_only=True) +class OperationUpdate(_SerdeShape): + """An update to be applied to an operation during checkpointing.""" + + id: str + """The unique identifier for this operation.""" + parent_id: str | None = ... + """ + The unique identifier of the parent operation, if this operation is + running within a child context. + """ + name: str | None = ... + """The customer-provided name for this operation.""" + type: str + """The type of operation to update.""" + sub_type: str | None = ... + """The subtype of the operation, providing additional categorization.""" + action: str + """The action to take on the operation.""" + payload: str | None = ... + """ + The payload for successful operations. The maximum payload size is 6 MB + for synchronous `EXECUTION` operations (RequestResponse invocationType), + 1 MB for asynchronous `EXECUTION` (Event invocationType) and + `CHAINED_INVOKE` operations, and 256 KB for `CONTEXT`, `STEP`, `WAIT`, + and `CALLBACK` operations. + """ + error: ErrorObject | None = ... + """The error information for failed operations.""" + context_options: ContextOptions | None = ... + """Options for context operations.""" + step_options: StepOptions | None = ... + """Options for step operations.""" + wait_options: WaitOptions | None = ... + """Options for wait operations.""" + callback_options: CallbackOptions | None = ... + """ + Configuration options for callback operations in durable executions, + including timeout settings and retry behavior. + """ + chained_invoke_options: ChainedInvokeOptions | None = ... + """ + Configuration options for chained function invocations in durable + executions, including retry settings and timeout configuration. + """ + +class PackageType(UnknownEnumMixin, StrEnum): + ZIP = "Zip" + IMAGE = "Image" + +@dataclass(kw_only=True) +class PolicyLengthExceededException(ServiceError, _SerdeShape): + """ + The permissions policy for the resource is too large. For more + information, see [Lambda + quotas](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html). + """ + + type: str | None = ... + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class PreconditionFailedException(ServiceError, _SerdeShape): + """ + The RevisionId provided does not match the latest RevisionId for the + Lambda function or alias. + + - **For AddPermission and RemovePermission API operations:** Call + `GetPolicy` to retrieve the latest RevisionId for your resource. + + - **For all other API operations:** Call `GetFunction` or `GetAlias` to + retrieve the latest RevisionId for your resource. + """ + + type: str | None = ... + """The exception type.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class PropagateTags(_SerdeShape): + """ + Configuration for tag propagation to managed resources launched by the + capacity provider. + """ + + mode: str | None = ... + """ + The tag propagation mode. Set to `Explicit` to propagate the tags + specified in `ExplicitTags` to managed resources. Set to `None` to + disable tag propagation. + """ + explicit_tags: dict[str, str] | None = ... + """ + A list of tags to apply to managed resources when `Mode` is set to + `Explicit`. You can specify up to 40 tags. + """ + +class PropagateTagsMode(UnknownEnumMixin, StrEnum): + NONE = "None" + """Tag propagation is disabled. No tags are applied to managed resources.""" + EXPLICIT = "Explicit" + """ + Tags specified in `ExplicitTags` are applied to managed resources at + launch. + """ + +@dataclass(kw_only=True) +class ProvisionedConcurrencyConfigListItem(_SerdeShape): + """ + Details about the provisioned concurrency configuration for a function + alias or version. + """ + + function_arn: str | None = ... + """The Amazon Resource Name (ARN) of the alias or version.""" + requested_provisioned_concurrent_executions: int | None = ... + """The amount of provisioned concurrency requested.""" + available_provisioned_concurrent_executions: int | None = ... + """The amount of provisioned concurrency available.""" + allocated_provisioned_concurrent_executions: int | None = ... + """ + The amount of provisioned concurrency allocated. When a weighted alias + is used during linear and canary deployments, this value fluctuates + depending on the amount of concurrency that is provisioned for the + function versions. + """ + status: str | None = ... + """The status of the allocation process.""" + status_reason: str | None = ... + """ + For failed allocations, the reason that provisioned concurrency could + not be allocated. + """ + last_modified: str | None = ... + """ + The date and time that a user last updated the configuration, in [ISO + 8601 format](https://www.iso.org/iso-8601-date-and-time-format.html). + """ + +@dataclass(kw_only=True) +class ProvisionedConcurrencyConfigNotFoundException(ServiceError, _SerdeShape): + """The specified configuration does not exist.""" + + type: str | None = ... + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class ProvisionedConcurrencyStatusEnum(UnknownEnumMixin, StrEnum): + IN_PROGRESS = "IN_PROGRESS" + READY = "READY" + FAILED = "FAILED" + +@dataclass(kw_only=True) +class ProvisionedPollerConfig(_SerdeShape): + """ + The [provisioned + mode](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html#invocation-eventsourcemapping-provisioned-mode) + configuration for the event source. Use Provisioned Mode to customize + the minimum and maximum number of event pollers for your event source. + """ + + minimum_pollers: int | None = ... + """ + The minimum number of event pollers this event source can scale down to. + For Amazon SQS events source mappings, default is 2, and minimum 2 + required. For Amazon MSK and self-managed Apache Kafka event source + mappings, default is 1. + """ + maximum_pollers: int | None = ... + """ + The maximum number of event pollers this event source can scale up to. + For Amazon SQS event source mappings, the accepted range is between 2 + and 10,000, with a default of 200. For Amazon MSK and self-managed + Apache Kafka event source mappings, the accepted range is between 1 and + 2,000, with a default of 200. + """ + poller_group_name: str | None = ... + """ + (Amazon MSK and self-managed Apache Kafka) The name of the provisioned + poller group. Use this option to group multiple ESMs within the event + source's VPC to share Event Poller Unit (EPU) capacity. You can use + this option to optimize Provisioned mode costs for your ESMs. You can + group up to 100 ESMs per poller group and aggregate maximum pollers + across all ESMs in a group cannot exceed 2000. + """ + +@dataclass(kw_only=True) +class PublicPolicyException(ServiceError, _SerdeShape): + """ + The resource-based policy you tried to add to the Lambda resource would + grant public access to it, which isn't allowed. + """ + + type: str | None = ... + """The exception type.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class PublishLayerVersionInput(_SerdeShape): + """Dataclass for PublishLayerVersionInput structure.""" + + layer_name: str | None = ... + """The name or Amazon Resource Name (ARN) of the layer.""" + description: str | None = ... + """The description of the version.""" + content: LayerVersionContentInput | None = ... + """The function layer archive.""" + compatible_architectures: list[str] | None = ... + """ + A list of compatible [instruction set + architectures](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html). + """ + compatible_runtimes: list[str] | None = ... + """ + A list of compatible [function + runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html). + Used for filtering with ListLayers and ListLayerVersions. + + The following list includes deprecated runtimes. For more information, + see [Runtime deprecation + policy](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-support-policy). + """ + license_info: str | None = ... + """ + The layer's software license. It can be any of the following: + + - An [SPDX license identifier](https://spdx.org/licenses/). For example, + `MIT`. + + - The URL of a license hosted on the internet. For example, + `https://opensource.org/licenses/MIT`. + + - The full text of the license. + """ + +@dataclass(kw_only=True) +class PublishLayerVersionOutput(_SerdeShape): + """Dataclass for PublishLayerVersionOutput structure.""" + + content: LayerVersionContentOutput | None = ... + """Details about the layer version.""" + layer_arn: str | None = ... + """The ARN of the layer.""" + layer_version_arn: str | None = ... + """The ARN of the layer version.""" + description: str | None = ... + """The description of the version.""" + created_date: str | None = ... + """ + The date that the layer version was created, in [ISO-8601 + format](https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). + """ + version: int = ... + """The version number.""" + compatible_architectures: list[str] | None = ... + """ + A list of compatible [instruction set + architectures](https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html). + """ + compatible_runtimes: list[str] | None = ... + """ + The layer's compatible runtimes. + + The following list includes deprecated runtimes. For more information, + see [Runtime use after + deprecation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-deprecation-levels). + + For a list of all currently supported runtimes, see [Supported + runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtimes-supported). + """ + license_info: str | None = ... + """The layer's software license.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class PublishVersionInput(_SerdeShape): + """Dataclass for PublishVersionInput structure.""" + + function_name: str | None = ... + """ + The name or ARN of the Lambda function. + + **Name formats** + + - **Function name** - `MyFunction`. + + - **Function ARN** - + `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`. + + - **Partial ARN** - `123456789012:function:MyFunction`. + + The length constraint applies only to the full ARN. If you specify only + the function name, it is limited to 64 characters in length. + """ + code_sha256: str | None = ... + """ + Only publish a version if the hash value matches the value that's + specified. Use this option to avoid publishing a version if the function + code has changed since you last updated it. You can get the hash for the + version that you uploaded from the output of UpdateFunctionCode. + """ + description: str | None = ... + """ + A description for the version to override the description in the + function configuration. + """ + revision_id: str | None = ... + """ + Only update the function if the revision ID matches the ID that's + specified. Use this option to avoid publishing a version if the function + configuration has changed since you last updated it. + """ + publish_to: str | None = ... + """Specifies where to publish the function version or configuration.""" + +@dataclass(kw_only=True) +class PublishVersionOutput(_SerdeShape): + """Details about a function's configuration.""" + + function_name: str | None = ... + """The name of the function.""" + function_arn: str | None = ... + """The function's Amazon Resource Name (ARN).""" + runtime: str | None = ... + """ + The identifier of the function's + [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html). + Runtime is required if the deployment package is a .zip file archive. + Specifying a runtime results in an error if you're deploying a function + using a container image. + + The following list includes deprecated runtimes. Lambda blocks creating + new functions and updating existing functions shortly after each runtime + is deprecated. For more information, see [Runtime use after + deprecation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-deprecation-levels). + + For a list of all currently supported runtimes, see [Supported + runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtimes-supported). + """ + role: str | None = ... + """The function's execution role.""" + handler: str | None = ... + """The function that Lambda calls to begin running your function.""" + code_size: int = ... + """The size of the function's deployment package, in bytes.""" + description: str | None = ... + """The function's description.""" + timeout: int | None = ... + """ + The amount of time in seconds that Lambda allows a function to run + before stopping it. + """ + memory_size: int | None = ... + """The amount of memory available to the function at runtime.""" + last_modified: str | None = ... + """ + The date and time that the function was last updated, in [ISO-8601 + format](https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). + """ + code_sha256: str | None = ... + """The SHA256 hash of the function's deployment package.""" + version: str | None = ... + """The version of the Lambda function.""" + vpc_config: VpcConfigResponse | None = ... + """The function's networking configuration.""" + dead_letter_config: DeadLetterConfig | None = ... + """The function's dead letter queue.""" + environment: EnvironmentResponse | None = ... + """ + The function's [environment + variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html). + Omitted from CloudTrail logs. + """ + kms_key_arn: str | None = ... + """ + The ARN of the Key Management Service (KMS) customer managed key that's + used to encrypt the following resources: + + - The function's [environment + variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-encryption). + + - The function's [Lambda + SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart-security.html) + snapshots. + + - When used with `SourceKMSKeyArn`, the unzipped version of the .zip + deployment package that's used for function invocations. For more + information, see [Specifying a customer managed key for + Lambda](https://docs.aws.amazon.com/lambda/latest/dg/encrypt-zip-package.html#enable-zip-custom-encryption). + + - The optimized version of the container image that's used for function + invocations. Note that this is not the same key that's used to + protect your container image in the Amazon Elastic Container Registry + (Amazon ECR). For more information, see [Function + lifecycle](https://docs.aws.amazon.com/lambda/latest/dg/images-create.html#images-lifecycle). + + If you don't provide a customer managed key, Lambda uses an [Amazon Web + Services owned + key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk) + or an [Amazon Web Services managed + key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk). + """ + tracing_config: TracingConfigResponse | None = ... + """The function's X-Ray tracing configuration.""" + master_arn: str | None = ... + """For Lambda@Edge functions, the ARN of the main function.""" + revision_id: str | None = ... + """The latest updated revision of the function or alias.""" + layers: list[Layer] | None = ... + """ + The function's + [layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html). + """ + state: str | None = ... + """ + The current state of the function. When the state is `Inactive`, you can + reactivate the function by invoking it. + """ + state_reason: str | None = ... + """The reason for the function's current state.""" + state_reason_code: str | None = ... + """ + The reason code for the function's current state. When the code is + `Creating`, you can't invoke or modify the function. + """ + last_update_status: str | None = ... + """ + The status of the last update that was performed on the function. This + is first set to `Successful` after function creation completes. + """ + last_update_status_reason: str | None = ... + """The reason for the last update that was performed on the function.""" + last_update_status_reason_code: str | None = ... + """The reason code for the last update that was performed on the function.""" + file_system_configs: list[FileSystemConfig] | None = ... + """ + Connection settings for an [Amazon EFS file + system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html) + or an [Amazon S3 file + system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html). + """ + signing_profile_version_arn: str | None = ... + """The ARN of the signing profile version.""" + signing_job_arn: str | None = ... + """The ARN of the signing job.""" + package_type: str | None = ... + """ + The type of deployment package. Set to `Image` for container image and + set `Zip` for .zip file archive. + """ + image_config_response: ImageConfigResponse | None = ... + """The function's image configuration values.""" + architectures: list[str] | None = ... + """ + The instruction set architecture that the function supports. + Architecture is a string array with one of the valid values. The default + architecture value is `x86_64`. + """ + ephemeral_storage: EphemeralStorage | None = ... + """ + The size of the function's `/tmp` directory in MB. The default value is + 512, but can be any whole number between 512 and 10,240 MB. For more + information, see [Configuring ephemeral storage + (console)](https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-ephemeral-storage). + """ + snap_start: SnapStartResponse | None = ... + """ + Set `ApplyOn` to `PublishedVersions` to create a snapshot of the + initialized execution environment when you publish a function version. + For more information, see [Improving startup performance with Lambda + SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html). + """ + runtime_version_config: RuntimeVersionConfig | None = ... + """The ARN of the runtime and any errors that occured.""" + logging_config: LoggingConfig | None = ... + """The function's Amazon CloudWatch Logs configuration settings.""" + tenancy_config: TenancyConfig | None = ... + """ + The function's tenant isolation configuration settings. Determines + whether the Lambda function runs on a shared or dedicated infrastructure + per unique tenant. + """ + capacity_provider_config: CapacityProviderConfig | None = ... + """ + Configuration for the capacity provider that manages compute resources + for Lambda functions. + """ + config_sha256: str | None = ... + """The SHA256 hash of the function configuration.""" + durable_config: DurableConfig | None = ... + """ + The function's durable execution configuration settings, if the + function is configured for durability. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class PutFunctionCodeSigningConfigInput(_SerdeShape): + """Dataclass for PutFunctionCodeSigningConfigInput structure.""" + + code_signing_config_arn: str | None = ... + """The The Amazon Resource Name (ARN) of the code signing configuration.""" + function_name: str | None = ... + """ + The name or ARN of the Lambda function. + + **Name formats** + + - **Function name** - `MyFunction`. + + - **Function ARN** - + `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`. + + - **Partial ARN** - `123456789012:function:MyFunction`. + + The length constraint applies only to the full ARN. If you specify only + the function name, it is limited to 64 characters in length. + """ + +@dataclass(kw_only=True) +class PutFunctionCodeSigningConfigOutput(_SerdeShape): + """Dataclass for PutFunctionCodeSigningConfigOutput structure.""" + + code_signing_config_arn: str + """The The Amazon Resource Name (ARN) of the code signing configuration.""" + function_name: str + """ + The name or ARN of the Lambda function. + + **Name formats** + + - **Function name** - `MyFunction`. + + - **Function ARN** - + `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`. + + - **Partial ARN** - `123456789012:function:MyFunction`. + + The length constraint applies only to the full ARN. If you specify only + the function name, it is limited to 64 characters in length. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class PutFunctionConcurrencyInput(_SerdeShape): + """Dataclass for PutFunctionConcurrencyInput structure.""" + + function_name: str | None = ... + """ + The name or ARN of the Lambda function. + + **Name formats** + + - **Function name** -- `my-function`. + + - **Function ARN** -- + `arn:aws:lambda:us-west-2:123456789012:function:my-function`. + + - **Partial ARN** -- `123456789012:function:my-function`. + + The length constraint applies only to the full ARN. If you specify only + the function name, it is limited to 64 characters in length. + """ + reserved_concurrent_executions: int | None = ... + """The number of simultaneous executions to reserve for the function.""" + +@dataclass(kw_only=True) +class PutFunctionConcurrencyOutput(_SerdeShape): + """Dataclass for PutFunctionConcurrencyOutput structure.""" + + reserved_concurrent_executions: int | None = ... + """ + The number of concurrent executions that are reserved for this function. + For more information, see [Managing Lambda reserved + concurrency](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html). + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class PutFunctionEventInvokeConfigInput(_SerdeShape): + """Dataclass for PutFunctionEventInvokeConfigInput structure.""" + + function_name: str | None = ... + """ + The name or ARN of the Lambda function, version, or alias. + + **Name formats** + + - **Function name** - `my-function` (name-only), `my-function:v1` (with + alias). + + - **Function ARN** - + `arn:aws:lambda:us-west-2:123456789012:function:my-function`. + + - **Partial ARN** - `123456789012:function:my-function`. + + You can append a version number or alias to any of the formats. The + length constraint applies only to the full ARN. If you specify only the + function name, it is limited to 64 characters in length. + """ + qualifier: str | None = ... + """A version number or alias name.""" + maximum_retry_attempts: int | None = ... + """The maximum number of times to retry when the function returns an error.""" + maximum_event_age_in_seconds: int | None = ... + """ + The maximum age of a request that Lambda sends to a function for + processing. + """ + destination_config: DestinationConfig | None = ... + """ + A destination for events after they have been sent to a function for + processing. + + **Destinations** + + - **Function** - The Amazon Resource Name (ARN) of a Lambda function. + + - **Queue** - The ARN of a standard SQS queue. + + - **Bucket** - The ARN of an Amazon S3 bucket. + + - **Topic** - The ARN of a standard SNS topic. + + - **Event Bus** - The ARN of an Amazon EventBridge event bus. + + Note: + S3 buckets are supported only for on-failure destinations. To retain + records of successful invocations, use another destination type. + """ + +@dataclass(kw_only=True) +class PutFunctionEventInvokeConfigOutput(_SerdeShape): + """Dataclass for PutFunctionEventInvokeConfigOutput structure.""" + + last_modified: datetime | None = ... + """The date and time that the configuration was last updated.""" + function_arn: str | None = ... + """The Amazon Resource Name (ARN) of the function.""" + maximum_retry_attempts: int | None = ... + """The maximum number of times to retry when the function returns an error.""" + maximum_event_age_in_seconds: int | None = ... + """ + The maximum age of a request that Lambda sends to a function for + processing. + """ + destination_config: DestinationConfig | None = ... + """ + A destination for events after they have been sent to a function for + processing. + + **Destinations** + + - **Function** - The Amazon Resource Name (ARN) of a Lambda function. + + - **Queue** - The ARN of a standard SQS queue. + + - **Bucket** - The ARN of an Amazon S3 bucket. + + - **Topic** - The ARN of a standard SNS topic. + + - **Event Bus** - The ARN of an Amazon EventBridge event bus. + + Note: + S3 buckets are supported only for on-failure destinations. To retain + records of successful invocations, use another destination type. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class PutFunctionRecursionConfigInput(_SerdeShape): + """Dataclass for PutFunctionRecursionConfigInput structure.""" + + function_name: str | None = ... + """ + The name or ARN of the Lambda function. + + **Name formats** + + - **Function name** -- `my-function`. + + - **Function ARN** -- + `arn:aws:lambda:us-west-2:123456789012:function:my-function`. + + - **Partial ARN** -- `123456789012:function:my-function`. + + The length constraint applies only to the full ARN. If you specify only + the function name, it is limited to 64 characters in length. + """ + recursive_loop: str | None = ... + """ + If you set your function's recursive loop detection configuration to + `Allow`, Lambda doesn't take any action when it detects your function + being invoked as part of a recursive loop. We recommend that you only + use this setting if your design intentionally uses a Lambda function to + write data back to the same Amazon Web Services resource that invokes + it. + + If you set your function's recursive loop detection configuration to + `Terminate`, Lambda stops your function being invoked and notifies you + when it detects your function being invoked as part of a recursive loop. + + By default, Lambda sets your function's configuration to `Terminate`. + + Warning: + If your design intentionally uses a Lambda function to write data back + to the same Amazon Web Services resource that invokes the function, then + use caution and implement suitable guard rails to prevent unexpected + charges being billed to your Amazon Web Services account. To learn more + about best practices for using recursive invocation patterns, see + [Recursive patterns that cause run-away Lambda + functions](https://serverlessland.com/content/service/lambda/guides/aws-lambda-operator-guide/recursive-runaway) + in Serverless Land. + """ + +@dataclass(kw_only=True) +class PutFunctionRecursionConfigOutput(_SerdeShape): + """Dataclass for PutFunctionRecursionConfigOutput structure.""" + + recursive_loop: str | None = ... + """ + The status of your function's recursive loop detection configuration. + + When this value is set to `Allow`and Lambda detects your function being + invoked as part of a recursive loop, it doesn't take any action. + + When this value is set to `Terminate` and Lambda detects your function + being invoked as part of a recursive loop, it stops your function being + invoked and notifies you. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class PutFunctionScalingConfigInput(_SerdeShape): + """Dataclass for PutFunctionScalingConfigInput structure.""" + + function_name: str | None = ... + """The name or ARN of the Lambda function.""" + qualifier: str | None = ... + """ + Specify a version or alias to set the scaling configuration for a + published version of the function. + """ + function_scaling_config: FunctionScalingConfig | None = ... + """ + The scaling configuration to apply to the function, including minimum + and maximum execution environment limits. + """ + +@dataclass(kw_only=True) +class PutFunctionScalingConfigOutput(_SerdeShape): + """Dataclass for PutFunctionScalingConfigOutput structure.""" + + function_state: str | None = ... + """ + The current state of the function after applying the scaling + configuration. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class PutProvisionedConcurrencyConfigInput(_SerdeShape): + """Dataclass for PutProvisionedConcurrencyConfigInput structure.""" + + function_name: str | None = ... + """ + The name or ARN of the Lambda function. + + **Name formats** + + - **Function name** -- `my-function`. + + - **Function ARN** -- + `arn:aws:lambda:us-west-2:123456789012:function:my-function`. + + - **Partial ARN** -- `123456789012:function:my-function`. + + The length constraint applies only to the full ARN. If you specify only + the function name, it is limited to 64 characters in length. + """ + qualifier: str | None = ... + """The version number or alias name.""" + provisioned_concurrent_executions: int | None = ... + """ + The amount of provisioned concurrency to allocate for the version or + alias. + """ + +@dataclass(kw_only=True) +class PutProvisionedConcurrencyConfigOutput(_SerdeShape): + """Dataclass for PutProvisionedConcurrencyConfigOutput structure.""" + + requested_provisioned_concurrent_executions: int | None = ... + """The amount of provisioned concurrency requested.""" + allocated_provisioned_concurrent_executions: int | None = ... + """ + The amount of provisioned concurrency allocated. When a weighted alias + is used during linear and canary deployments, this value fluctuates + depending on the amount of concurrency that is provisioned for the + function versions. + """ + available_provisioned_concurrent_executions: int | None = ... + """The amount of provisioned concurrency available.""" + status: str | None = ... + """The status of the allocation process.""" + status_reason: str | None = ... + """ + For failed allocations, the reason that provisioned concurrency could + not be allocated. + """ + last_modified: str | None = ... + """ + The date and time that a user last updated the configuration, in [ISO + 8601 format](https://www.iso.org/iso-8601-date-and-time-format.html). + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class PutResourcePolicyInput(_SerdeShape): + """Dataclass for PutResourcePolicyInput structure.""" + + resource_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the Lambda resource you want to add + the policy to. You can use a qualified or an unqualified ARN. The value + must be a complete ARN, and the operation does not accept wildcard + characters. + """ + policy: str | None = ... + """ + The policy document you want to add to your Lambda resource. This is + formatted as a JSON string. + + For more information, see [Working with resource-based policies in + Lambda](https://docs.aws.amazon.com/lambda/latest/dg/access-control-resource-based.html) + in the *Lambda Developer Guide*. + """ + revision_id: str | None = ... + """ + The revision ID that the existing policy must match for the replacement + to proceed. If the revision ID doesn't match, the operation fails with + a `PreconditionFailedException` error. To retrieve the current revision + ID, use the GetResourcePolicy operation. + """ + +@dataclass(kw_only=True) +class PutResourcePolicyOutput(_SerdeShape): + """Dataclass for PutResourcePolicyOutput structure.""" + + policy: str | None = ... + """The resource-based policy that Lambda adds to the resource.""" + revision_id: str | None = ... + """The revision ID of the policy that Lambda adds to your Lambda resource.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class PutRuntimeManagementConfigInput(_SerdeShape): + """Dataclass for PutRuntimeManagementConfigInput structure.""" + + function_name: str | None = ... + """ + The name or ARN of the Lambda function. + + **Name formats** + + - **Function name** -- `my-function`. + + - **Function ARN** -- + `arn:aws:lambda:us-west-2:123456789012:function:my-function`. + + - **Partial ARN** -- `123456789012:function:my-function`. + + The length constraint applies only to the full ARN. If you specify only + the function name, it is limited to 64 characters in length. + """ + qualifier: str | None = ... + """ + Specify a version of the function. This can be `$LATEST` or a published + version number. If no value is specified, the configuration for the + `$LATEST` version is returned. + """ + update_runtime_on: str | None = ... + """ + Specify the runtime update mode. + + - **Auto (default)** - Automatically update to the most recent and + secure runtime version using a [Two-phase runtime version + rollout](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-update.html#runtime-management-two-phase). + This is the best choice for most customers to ensure they always + benefit from runtime updates. + + - **Function update** - Lambda updates the runtime of your function to + the most recent and secure runtime version when you update your + function. This approach synchronizes runtime updates with function + deployments, giving you control over when runtime updates are applied + and allowing you to detect and mitigate rare runtime update + incompatibilities early. When using this setting, you need to + regularly update your functions to keep their runtime up-to-date. + + - **Manual** - You specify a runtime version in your function + configuration. The function will use this runtime version + indefinitely. In the rare case where a new runtime version is + incompatible with an existing function, this allows you to roll back + your function to an earlier runtime version. For more information, see + [Roll back a runtime + version](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-update.html#runtime-management-rollback). + """ + runtime_version_arn: str | None = ... + """ + The ARN of the runtime version you want the function to use. + + Note: + This is only required if you're using the **Manual** runtime update + mode. + """ + +@dataclass(kw_only=True) +class PutRuntimeManagementConfigOutput(_SerdeShape): + """Dataclass for PutRuntimeManagementConfigOutput structure.""" + + update_runtime_on: str + """The runtime update mode.""" + function_arn: str + """The ARN of the function""" + runtime_version_arn: str | None = ... + """ + The ARN of the runtime the function is configured to use. If the runtime + update mode is **manual**, the ARN is returned, otherwise `null` is + returned. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class RecursiveInvocationException(ServiceError, _SerdeShape): + """ + Lambda has detected your function being invoked in a recursive loop with + other Amazon Web Services resources and stopped your function's + invocation. + """ + + type: str | None = ... + """The exception type.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class RecursiveLoop(UnknownEnumMixin, StrEnum): + ALLOW = "Allow" + TERMINATE = "Terminate" + +@dataclass(kw_only=True) +class RemoveLayerVersionPermissionInput(_SerdeShape): + """Dataclass for RemoveLayerVersionPermissionInput structure.""" + + layer_name: str | None = ... + """The name or Amazon Resource Name (ARN) of the layer.""" + version_number: int | None = ... + """The version number.""" + statement_id: str | None = ... + """The identifier that was specified when the statement was added.""" + revision_id: str | None = ... + """ + Only update the policy if the revision ID matches the ID specified. Use + this option to avoid modifying a policy that has changed since you last + read it. + """ + +@dataclass(kw_only=True) +class RemoveLayerVersionPermissionOutput(_SerdeShape): + """Dataclass for RemoveLayerVersionPermissionOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class RemovePermissionInput(_SerdeShape): + """Dataclass for RemovePermissionInput structure.""" + + function_name: str | None = ... + """ + The name or ARN of the Lambda function, version, or alias. + + **Name formats** + + - **Function name** -- `my-function` (name-only), `my-function:v1` (with + alias). + + - **Function ARN** -- + `arn:aws:lambda:us-west-2:123456789012:function:my-function`. + + - **Partial ARN** -- `123456789012:function:my-function`. + + You can append a version number or alias to any of the formats. The + length constraint applies only to the full ARN. If you specify only the + function name, it is limited to 64 characters in length. + """ + statement_id: str | None = ... + """Statement ID of the permission to remove.""" + qualifier: str | None = ... + """ + Specify a version or alias to remove permissions from a published + version of the function. + """ + revision_id: str | None = ... + """ + Update the policy only if the revision ID matches the ID that's + specified. Use this option to avoid modifying a policy that has changed + since you last read it. + """ + +@dataclass(kw_only=True) +class RemovePermissionOutput(_SerdeShape): + """Dataclass for RemovePermissionOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class RequestTooLargeException(ServiceError, _SerdeShape): + """ + The request payload exceeded the `Invoke` request body JSON input quota. + For more information, see [Lambda + quotas](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html). + """ + + type: str | None = ... + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ResolvedS3Object(_SerdeShape): + """ + Details about the resolved Amazon S3 object that contains a function's + deployment package. + """ + + s3_bucket: str | None = ... + """The Amazon S3 bucket that contains the deployment package.""" + s3_key: str | None = ... + """The Amazon S3 key of the deployment package.""" + s3_object_version: str | None = ... + """The version of the deployment package object.""" + +@dataclass(kw_only=True) +class ResourceConflictException(ServiceError, _SerdeShape): + """The resource already exists, or another operation is in progress.""" + + type: str | None = ... + """The exception type.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ResourceInUseException(ServiceError, _SerdeShape): + """ + The operation conflicts with the resource's availability. For example, + you tried to update an event source mapping in the CREATING state, or + you tried to delete an event source mapping currently UPDATING. + """ + + type: str | None = ... + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ResourceNotFoundException(ServiceError, _SerdeShape): + """The resource specified in the request does not exist.""" + + type: str | None = ... + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ResourceNotReadyException(ServiceError, _SerdeShape): + """ + The function is inactive and its VPC connection is no longer available. + Wait for the VPC connection to reestablish and try again. + """ + + type: str | None = ... + """The exception type.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class ResponseStreamingInvocationType(UnknownEnumMixin, StrEnum): + REQUEST_RESPONSE = "RequestResponse" + DRY_RUN = "DryRun" + +@dataclass(kw_only=True) +class RetryDetails(_SerdeShape): + """Information about retry attempts for an operation.""" + + current_attempt: int = ... + """The current attempt number for this operation.""" + next_attempt_delay_seconds: int | None = ... + """The delay before the next retry attempt, in seconds.""" + +class Runtime(UnknownEnumMixin, StrEnum): + NODEJS = "nodejs" + NODEJS43 = "nodejs4.3" + NODEJS610 = "nodejs6.10" + NODEJS810 = "nodejs8.10" + NODEJS10X = "nodejs10.x" + NODEJS12X = "nodejs12.x" + NODEJS14X = "nodejs14.x" + NODEJS16X = "nodejs16.x" + NODEJS18X = "nodejs18.x" + NODEJS20X = "nodejs20.x" + NODEJS22X = "nodejs22.x" + NODEJS24X = "nodejs24.x" + JAVA8 = "java8" + JAVA8AL2 = "java8.al2" + JAVA11 = "java11" + JAVA17 = "java17" + JAVA21 = "java21" + JAVA25 = "java25" + PYTHON27 = "python2.7" + PYTHON36 = "python3.6" + PYTHON37 = "python3.7" + PYTHON38 = "python3.8" + PYTHON39 = "python3.9" + PYTHON310 = "python3.10" + PYTHON311 = "python3.11" + PYTHON312 = "python3.12" + PYTHON313 = "python3.13" + PYTHON314 = "python3.14" + DOTNETCORE10 = "dotnetcore1.0" + DOTNETCORE20 = "dotnetcore2.0" + DOTNETCORE21 = "dotnetcore2.1" + DOTNETCORE31 = "dotnetcore3.1" + DOTNET6 = "dotnet6" + DOTNET8 = "dotnet8" + DOTNET10 = "dotnet10" + NODEJS43EDGE = "nodejs4.3-edge" + GO1X = "go1.x" + RUBY25 = "ruby2.5" + RUBY27 = "ruby2.7" + RUBY32 = "ruby3.2" + RUBY33 = "ruby3.3" + RUBY34 = "ruby3.4" + RUBY40 = "ruby4.0" + PROVIDED = "provided" + PROVIDEDAL2 = "provided.al2" + PROVIDEDAL2023 = "provided.al2023" + NODEJS26X = "nodejs26.x" + PYTHON315 = "python3.15" + JAVA8AL2023 = "java8.al2023" + JAVA11AL2023 = "java11.al2023" + JAVA17AL2023 = "java17.al2023" + +@dataclass(kw_only=True) +class RuntimeVersionConfig(_SerdeShape): + """The ARN of the runtime and any errors that occured.""" + + runtime_version_arn: str | None = ... + """The ARN of the runtime version you want the function to use.""" + error: RuntimeVersionError | None = ... + """ + Error response when Lambda is unable to retrieve the runtime version for + a function. + """ + +@dataclass(kw_only=True) +class RuntimeVersionError(_SerdeShape): + """ + Any error returned when the runtime version information for the function + could not be retrieved. + """ + + error_code: str | None = ... + """The error code.""" + message: str | None = ... + """The error message.""" + +@dataclass(kw_only=True) +class S3FilesConfig(_SerdeShape): + """ + Setting controls how your function accesses data from an Amazon S3 file + system. + """ + + direct_s3_read: str | None = ... + """ + Specifies if a function reads from the file system for the lowest + latency, or through Amazon S3 Files feature \"direct Amazon S3 bucket + reads\" for the highest throughput. Valid values: + + - `AUTO` (default) -- Direct reads are active for functions you + configure with 512 MB or more of memory. + + - `ENABLED` -- Enforces all reads are directly from the Amazon S3 + bucket, regardless of available memory (less than 512 MB). + + - `DISABLED` -- Routes all reads through the file system, regardless of + memory configuration. + + To use direct reads, you must grant the execution role the + `s3:GetObject` and `s3:GetObjectVersion` permissions. If a direct read + fails, Lambda automatically falls back to reading through the file + system. + """ + +@dataclass(kw_only=True) +class S3FilesMountConnectivityException(ServiceError, _SerdeShape): + """ + The Lambda function couldn't make a network connection to the + configured S3 Files access point. + """ + + type: str | None = ... + """The exception type.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class S3FilesMountFailureException(ServiceError, _SerdeShape): + """ + The Lambda function couldn't mount the configured S3 Files access point + due to a permission or configuration issue. + """ + + type: str | None = ... + """The exception type.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class S3FilesMountTimeoutException(ServiceError, _SerdeShape): + """ + The Lambda function made a network connection to the configured S3 Files + access point, but the mount operation timed out. + """ + + type: str | None = ... + """The exception type.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class S3ObjectStorageMode(UnknownEnumMixin, StrEnum): + """ + The method Lambda uses to store a function's deployment package --- + either by copying the package into Lambda-managed storage (`COPY`) or by + referencing it directly from the source Amazon S3 bucket (`REFERENCE`). + """ + + COPY = "COPY" + """ + The default storage mode. Uploads a copy of your deployment package to + Lambda. + """ + REFERENCE = "REFERENCE" + """ + The reference storage mode. Lambda references the deployment package + from the specified Amazon S3 bucket without uploading a copy. + """ + +@dataclass(kw_only=True) +class ScalingConfig(_SerdeShape): + """ + (Amazon SQS only) The scaling configuration for the event source. To + remove the configuration, pass an empty value. + """ + + maximum_concurrency: int | None = ... + """ + Limits the number of concurrent instances that the Amazon SQS event + source can invoke. + """ + +class SchemaRegistryEventRecordFormat(UnknownEnumMixin, StrEnum): + JSON = "JSON" + SOURCE = "SOURCE" + +@dataclass(kw_only=True) +class SelfManagedEventSource(_SerdeShape): + """The self-managed Apache Kafka cluster for your event source.""" + + endpoints: dict[str, list[str]] | None = ... + """ + The list of bootstrap servers for your Kafka brokers in the following + format: + `"KAFKA_BOOTSTRAP_SERVERS": ["abc.xyz.com:xxxx","abc2.xyz.com:xxxx"]`. + """ + +@dataclass(kw_only=True) +class SelfManagedKafkaEventSourceConfig(_SerdeShape): + """ + Specific configuration settings for a self-managed Apache Kafka event + source. + """ + + consumer_group_id: str | None = ... + """ + The identifier for the Kafka consumer group to join. The consumer group + ID must be unique among all your Kafka event sources. After creating a + Kafka event source mapping with the consumer group ID specified, you + cannot update this value. For more information, see [Customizable + consumer group + ID](https://docs.aws.amazon.com/lambda/latest/dg/with-kafka-process.html#services-smaa-topic-add). + """ + schema_registry_config: KafkaSchemaRegistryConfig | None = ... + """Specific configuration settings for a Kafka schema registry.""" + +@dataclass(kw_only=True) +class SendDurableExecutionCallbackFailureInput(_SerdeShape): + """Dataclass for SendDurableExecutionCallbackFailureInput structure.""" + + callback_id: str | None = ... + """The unique identifier for the callback operation.""" + error: ErrorObject | None = ... + """Error details describing why the callback operation failed.""" + +@dataclass(kw_only=True) +class SendDurableExecutionCallbackFailureOutput(_SerdeShape): + """Dataclass for SendDurableExecutionCallbackFailureOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class SendDurableExecutionCallbackHeartbeatInput(_SerdeShape): + """Dataclass for SendDurableExecutionCallbackHeartbeatInput structure.""" + + callback_id: str | None = ... + """The unique identifier for the callback operation.""" + +@dataclass(kw_only=True) +class SendDurableExecutionCallbackHeartbeatOutput(_SerdeShape): + """Dataclass for SendDurableExecutionCallbackHeartbeatOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class SendDurableExecutionCallbackSuccessInput(_SerdeShape): + """Dataclass for SendDurableExecutionCallbackSuccessInput structure.""" + + callback_id: str | None = ... + """The unique identifier for the callback operation.""" + result: bytes | None = ... + """ + The result data from the successful callback operation. Maximum size is + 256 KB. + """ + +@dataclass(kw_only=True) +class SendDurableExecutionCallbackSuccessOutput(_SerdeShape): + """Dataclass for SendDurableExecutionCallbackSuccessOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class SerializedRequestEntityTooLargeException(ServiceError, _SerdeShape): + """ + The request payload exceeded the maximum allowed size for serialized + request entities. + """ + + type: str | None = ... + """The error type.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ServiceException(ServiceError, _SerdeShape): + """The Lambda service encountered an internal error.""" + + type: str | None = ... + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ServiceQuotaExceededException(ServiceError, _SerdeShape): + """ + The request would exceed a service quota. For more information about + Lambda service quotas, see [Lambda + quotas](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html). + To request a quota increase, see [Requesting a quota + increase](https://docs.aws.amazon.com/servicequotas/latest/userguide/request-quota-increase.html) + in the *Service Quotas User Guide*. + """ + + type: str | None = ... + """The exception type.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class SnapStart(_SerdeShape): + """ + The function's [Lambda + SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html) + setting. Set `ApplyOn` to `PublishedVersions` to create a snapshot of + the initialized execution environment when you publish a function + version. + """ + + apply_on: str | None = ... + """ + Set to `PublishedVersions` to create a snapshot of the initialized + execution environment when you publish a function version. + """ + +class SnapStartApplyOn(UnknownEnumMixin, StrEnum): + PUBLISHED_VERSIONS = "PublishedVersions" + NONE = "None" + +@dataclass(kw_only=True) +class SnapStartException(ServiceError, _SerdeShape): + """ + The `afterRestore()` [runtime + hook](https://docs.aws.amazon.com/lambda/latest/dg/snapstart-runtime-hooks.html) + encountered an error. For more information, check the Amazon CloudWatch + logs. + """ + + type: str | None = ... + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class SnapStartNotReadyException(ServiceError, _SerdeShape): + """ + Lambda is initializing your function. You can invoke the function when + the [function + state](https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html) + becomes `Active`. + """ + + type: str | None = ... + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class SnapStartOptimizationStatus(UnknownEnumMixin, StrEnum): + ON = "On" + OFF = "Off" + +@dataclass(kw_only=True) +class SnapStartRegenerationFailureException(ServiceError, _SerdeShape): + """ + Lambda couldn't regenerate the SnapStart snapshot for the function. + SnapStart-enabled functions periodically regenerate snapshots when their + underlying runtime or dependencies change; this regeneration failed. + Wait for Lambda to retry, or update the function's configuration to + trigger a new snapshot. For more information, see [Lambda + SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html). + """ + + type: str | None = ... + """The exception type.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class SnapStartResponse(_SerdeShape): + """ + The function's + [SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html) + setting. + """ + + apply_on: str | None = ... + """ + When set to `PublishedVersions`, Lambda creates a snapshot of the + execution environment when you publish a function version. + """ + optimization_status: str | None = ... + """ + When you provide a [qualified Amazon Resource Name + (ARN)](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html#versioning-versions-using), + this response element indicates whether SnapStart is activated for the + specified function version. + """ + +@dataclass(kw_only=True) +class SnapStartTimeoutException(ServiceError, _SerdeShape): + """Lambda couldn't restore the snapshot within the timeout limit.""" + + type: str | None = ... + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class SourceAccessConfiguration(_SerdeShape): + """ + To secure and define access to your event source, you can specify the + authentication protocol, VPC components, or virtual host. + """ + + type: str | None = ... + """ + The type of authentication protocol, VPC components, or virtual host for + your event source. For example: `"Type":"SASL_SCRAM_512_AUTH"`. + + - `BASIC_AUTH` -- (Amazon MQ) The Secrets Manager secret that stores + your broker credentials. + + - `BASIC_AUTH` -- (Self-managed Apache Kafka) The Secrets Manager ARN of + your secret key used for SASL/PLAIN authentication of your Apache + Kafka brokers. + + - `VPC_SUBNET` -- (Self-managed Apache Kafka) The subnets associated + with your VPC. Lambda connects to these subnets to fetch data from + your self-managed Apache Kafka cluster. + + - `VPC_SECURITY_GROUP` -- (Self-managed Apache Kafka) The VPC security + group used to manage access to your self-managed Apache Kafka brokers. + + - `SASL_SCRAM_256_AUTH` -- (Self-managed Apache Kafka) The Secrets + Manager ARN of your secret key used for SASL SCRAM-256 authentication + of your self-managed Apache Kafka brokers. + + - `SASL_SCRAM_512_AUTH` -- (Amazon MSK, Self-managed Apache Kafka) The + Secrets Manager ARN of your secret key used for SASL SCRAM-512 + authentication of your self-managed Apache Kafka brokers. + + - `VIRTUAL_HOST` --- (RabbitMQ) The name of the virtual host in your + RabbitMQ broker. Lambda uses this RabbitMQ host as the event source. + This property cannot be specified in an UpdateEventSourceMapping API + call. + + - `CLIENT_CERTIFICATE_TLS_AUTH` -- (Amazon MSK, self-managed Apache + Kafka) The Secrets Manager ARN of your secret key containing the + certificate chain (X.509 PEM), private key (PKCS#8 PEM), and private + key password (optional) used for mutual TLS authentication of your + MSK/Apache Kafka brokers. + + - `SERVER_ROOT_CA_CERTIFICATE` -- (Self-managed Apache Kafka) The + Secrets Manager ARN of your secret key containing the root CA + certificate (X.509 PEM) used for TLS encryption of your Apache Kafka + brokers. + """ + uri: str | None = ... + """ + The value for your chosen configuration in `Type`. For example: + `"URI": "arn:aws:secretsmanager:us-east-1:01234567890:secret:MyBrokerSecretName"`. + """ + +class SourceAccessType(UnknownEnumMixin, StrEnum): + BASIC_AUTH = "BASIC_AUTH" + VPC_SUBNET = "VPC_SUBNET" + VPC_SECURITY_GROUP = "VPC_SECURITY_GROUP" + SASL_SCRAM_512_AUTH = "SASL_SCRAM_512_AUTH" + SASL_SCRAM_256_AUTH = "SASL_SCRAM_256_AUTH" + VIRTUAL_HOST = "VIRTUAL_HOST" + CLIENT_CERTIFICATE_TLS_AUTH = "CLIENT_CERTIFICATE_TLS_AUTH" + SERVER_ROOT_CA_CERTIFICATE = "SERVER_ROOT_CA_CERTIFICATE" + +class State(UnknownEnumMixin, StrEnum): + PENDING = "Pending" + ACTIVE = "Active" + INACTIVE = "Inactive" + FAILED = "Failed" + DEACTIVATING = "Deactivating" + DEACTIVATED = "Deactivated" + ACTIVE_NON_INVOCABLE = "ActiveNonInvocable" + DELETING = "Deleting" + +class StateReasonCode(UnknownEnumMixin, StrEnum): + IDLE = "Idle" + CREATING = "Creating" + RESTORING = "Restoring" + ENI_LIMIT_EXCEEDED = "EniLimitExceeded" + INSUFFICIENT_ROLE_PERMISSIONS = "InsufficientRolePermissions" + INVALID_CONFIGURATION = "InvalidConfiguration" + INTERNAL_ERROR = "InternalError" + SUBNET_OUT_OF_IP_ADDRESSES = "SubnetOutOfIPAddresses" + INVALID_SUBNET = "InvalidSubnet" + INVALID_SECURITY_GROUP = "InvalidSecurityGroup" + IMAGE_DELETED = "ImageDeleted" + IMAGE_ACCESS_DENIED = "ImageAccessDenied" + INVALID_IMAGE = "InvalidImage" + KMS_KEY_ACCESS_DENIED = "KMSKeyAccessDenied" + KMS_KEY_NOT_FOUND = "KMSKeyNotFound" + INVALID_STATE_KMS_KEY = "InvalidStateKMSKey" + DISABLED_KMS_KEY = "DisabledKMSKey" + EFSIO_ERROR = "EFSIOError" + EFS_MOUNT_CONNECTIVITY_ERROR = "EFSMountConnectivityError" + EFS_MOUNT_FAILURE = "EFSMountFailure" + EFS_MOUNT_TIMEOUT = "EFSMountTimeout" + INVALID_RUNTIME = "InvalidRuntime" + INVALID_ZIP_FILE_EXCEPTION = "InvalidZipFileException" + FUNCTION_ERROR = "FunctionError" + SERVICE_QUOTA_EXCEEDED_EXCEPTION = "ServiceQuotaExceededException" + VCPU_LIMIT_EXCEEDED = "VcpuLimitExceeded" + CAPACITY_PROVIDER_SCALING_LIMIT_EXCEEDED = "CapacityProviderScalingLimitExceeded" + INSUFFICIENT_CAPACITY = "InsufficientCapacity" + EC2_REQUEST_LIMIT_EXCEEDED = "EC2RequestLimitExceeded" + FUNCTION_ERROR_INIT_TIMEOUT = "FunctionError.InitTimeout" + FUNCTION_ERROR_RUNTIME_INIT_ERROR = "FunctionError.RuntimeInitError" + FUNCTION_ERROR_EXTENSION_INIT_ERROR = "FunctionError.ExtensionInitError" + FUNCTION_ERROR_INVALID_ENTRY_POINT = "FunctionError.InvalidEntryPoint" + FUNCTION_ERROR_INVALID_WORKING_DIRECTORY = "FunctionError.InvalidWorkingDirectory" + FUNCTION_ERROR_PERMISSION_DENIED = "FunctionError.PermissionDenied" + FUNCTION_ERROR_TOO_MANY_EXTENSIONS = "FunctionError.TooManyExtensions" + FUNCTION_ERROR_INIT_RESOURCE_EXHAUSTED = "FunctionError.InitResourceExhausted" + DISALLOWED_BY_VPC_ENCRYPTION_CONTROL = "DisallowedByVpcEncryptionControl" + DRAINING_DURABLE_EXECUTIONS = "DrainingDurableExecutions" + DEPENDENCY_ERROR = "DependencyError" + +@dataclass(kw_only=True) +class StepDetails(_SerdeShape): + """Details about a step operation.""" + + attempt: int = ... + """The current attempt number for this step.""" + next_attempt_timestamp: datetime | None = ... + """ + The date and time when the next attempt is scheduled, in [ISO-8601 + format](https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). + Only populated when the step is in a pending state. + """ + result: str | None = ... + """The JSON response payload from the step operation.""" + error: ErrorObject | None = ... + """Details about the step failure.""" + +@dataclass(kw_only=True) +class StepFailedDetails(_SerdeShape): + """Details about a step that failed.""" + + error: EventError + """Details about the step failure.""" + retry_details: RetryDetails + """Information about retry attempts for this step operation.""" + +@dataclass(kw_only=True) +class StepOptions(_SerdeShape): + """Configuration options for a step operation.""" + + next_attempt_delay_seconds: int | None = ... + """The delay in seconds before the next retry attempt.""" + +@dataclass(kw_only=True) +class StepStartedDetails(_SerdeShape): + """Details about a step that has started.""" + +@dataclass(kw_only=True) +class StepSucceededDetails(_SerdeShape): + """Details about a step that succeeded.""" + + result: EventResult + """The response payload from the successful operation.""" + retry_details: RetryDetails + """Information about retry attempts for this step operation.""" + +@dataclass(kw_only=True) +class StopDurableExecutionInput(_SerdeShape): + """Dataclass for StopDurableExecutionInput structure.""" + + durable_execution_arn: str | None = ... + """The Amazon Resource Name (ARN) of the durable execution.""" + error: ErrorObject | None = ... + """Optional error details explaining why the execution is being stopped.""" + +@dataclass(kw_only=True) +class StopDurableExecutionOutput(_SerdeShape): + """Dataclass for StopDurableExecutionOutput structure.""" + + stop_timestamp: datetime + """The timestamp when the execution was stopped (ISO 8601 format).""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class SubnetIPAddressLimitReachedException(ServiceError, _SerdeShape): + """ + Lambda couldn't set up VPC access for the Lambda function because one + or more configured subnets has no available IP addresses. + """ + + type: str | None = ... + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class SystemLogLevel(UnknownEnumMixin, StrEnum): + DEBUG = "DEBUG" + INFO = "INFO" + WARN = "WARN" + +@dataclass(kw_only=True) +class TagResourceInput(_SerdeShape): + """Dataclass for TagResourceInput structure.""" + + resource: str | None = ... + """The resource's Amazon Resource Name (ARN).""" + tags: dict[str, str] | None = ... + """A list of tags to apply to the resource.""" + +@dataclass(kw_only=True) +class TagResourceOutput(_SerdeShape): + """Dataclass for TagResourceOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class TagsError(_SerdeShape): + """ + An object that contains details about an error related to retrieving + tags. + """ + + error_code: str + """The error code.""" + message: str + """The error message.""" + +@dataclass(kw_only=True) +class TargetTrackingScalingPolicy(_SerdeShape): + """ + A scaling policy for the capacity provider that automatically adjusts + capacity to maintain a target value for a specific metric. + """ + + predefined_metric_type: str + """The predefined metric type to track for scaling decisions.""" + target_value: float + """ + The target value for the metric that the scaling policy attempts to + maintain through scaling actions. + """ + +@dataclass(kw_only=True) +class TenancyConfig(_SerdeShape): + """ + Specifies the tenant isolation mode configuration for a Lambda function. + This allows you to configure specific tenant isolation strategies for + your function invocations. Tenant isolation configuration cannot be + modified after function creation. + """ + + tenant_isolation_mode: str + """ + Tenant isolation mode allows for invocation to be sent to a + corresponding execution environment dedicated to a specific tenant ID. + """ + +class TenantIsolationMode(UnknownEnumMixin, StrEnum): + PER_TENANT = "PER_TENANT" + +class ThrottleReason(UnknownEnumMixin, StrEnum): + CONCURRENT_INVOCATION_LIMIT_EXCEEDED = "ConcurrentInvocationLimitExceeded" + FUNCTION_INVOCATION_RATE_LIMIT_EXCEEDED = "FunctionInvocationRateLimitExceeded" + RESERVED_FUNCTION_CONCURRENT_INVOCATION_LIMIT_EXCEEDED = ( + "ReservedFunctionConcurrentInvocationLimitExceeded" + ) + RESERVED_FUNCTION_INVOCATION_RATE_LIMIT_EXCEEDED = ( + "ReservedFunctionInvocationRateLimitExceeded" + ) + CALLER_RATE_LIMIT_EXCEEDED = "CallerRateLimitExceeded" + CONCURRENT_SNAPSHOT_CREATE_LIMIT_EXCEEDED = "ConcurrentSnapshotCreateLimitExceeded" + +@dataclass(kw_only=True) +class TooManyRequestsException(ServiceError, _SerdeShape): + """ + The request throughput limit was exceeded. For more information, see + [Lambda + quotas](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html#api-requests). + """ + + retry_after_seconds: str | None = ... + """The number of seconds the caller should wait before retrying.""" + type: str | None = ... + reason: str | None = ... + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class TraceHeader(_SerdeShape): + """Contains trace headers for the Lambda durable execution.""" + + x_amzn_trace_id: str | None = ... + """The X-Ray trace header associated with the durable execution.""" + +@dataclass(kw_only=True) +class TracingConfig(_SerdeShape): + """ + The function's + [X-Ray](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html) + tracing configuration. To sample and record incoming requests, set + `Mode` to `Active`. + """ + + mode: str | None = ... + """The tracing mode.""" + +@dataclass(kw_only=True) +class TracingConfigResponse(_SerdeShape): + """The function's X-Ray tracing configuration.""" + + mode: str | None = ... + """The tracing mode.""" + +class TracingMode(UnknownEnumMixin, StrEnum): + ACTIVE = "Active" + PASS_THROUGH = "PassThrough" + +@dataclass(kw_only=True) +class UnsupportedMediaTypeException(ServiceError, _SerdeShape): + """The content type of the `Invoke` request body is not JSON.""" + + type: str | None = ... + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UntagResourceInput(_SerdeShape): + """Dataclass for UntagResourceInput structure.""" + + resource: str | None = ... + """The resource's Amazon Resource Name (ARN).""" + tag_keys: list[str] | None = ... + """A list of tag keys to remove from the resource.""" + +@dataclass(kw_only=True) +class UntagResourceOutput(_SerdeShape): + """Dataclass for UntagResourceOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateAliasInput(_SerdeShape): + """Dataclass for UpdateAliasInput structure.""" + + function_name: str | None = ... + """ + The name or ARN of the Lambda function. + + **Name formats** + + - **Function name** - `MyFunction`. + + - **Function ARN** - + `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`. + + - **Partial ARN** - `123456789012:function:MyFunction`. + + The length constraint applies only to the full ARN. If you specify only + the function name, it is limited to 64 characters in length. + """ + name: str | None = ... + """The name of the alias.""" + function_version: str | None = ... + """The function version that the alias invokes.""" + description: str | None = ... + """A description of the alias.""" + routing_config: AliasRoutingConfiguration | None = ... + """ + The [routing + configuration](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html#configuring-alias-routing) + of the alias. + """ + revision_id: str | None = ... + """ + Only update the alias if the revision ID matches the ID that's + specified. Use this option to avoid modifying an alias that has changed + since you last read it. + """ + +@dataclass(kw_only=True) +class UpdateAliasOutput(_SerdeShape): + """ + Provides configuration information about a Lambda function + [alias](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html). + """ + + alias_arn: str | None = ... + """The Amazon Resource Name (ARN) of the alias.""" + name: str | None = ... + """The name of the alias.""" + function_version: str | None = ... + """The function version that the alias invokes.""" + description: str | None = ... + """A description of the alias.""" + routing_config: AliasRoutingConfiguration | None = ... + """ + The [routing + configuration](https://docs.aws.amazon.com/lambda/latest/dg/lambda-traffic-shifting-using-aliases.html) + of the alias. + """ + revision_id: str | None = ... + """A unique identifier that changes when you update the alias.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateCapacityProviderInput(_SerdeShape): + """Dataclass for UpdateCapacityProviderInput structure.""" + + capacity_provider_name: str | None = ... + """The name of the capacity provider to update.""" + capacity_provider_scaling_config: CapacityProviderScalingConfig | None = ... + """The updated scaling configuration for the capacity provider.""" + propagate_tags: PropagateTags | None = ... + """ + Configuration for tag propagation to managed resources launched by the + capacity provider. + """ + telemetry_config: CapacityProviderTelemetryConfig | None = ... + """The updated telemetry configuration for the capacity provider.""" + +@dataclass(kw_only=True) +class UpdateCapacityProviderOutput(_SerdeShape): + """Dataclass for UpdateCapacityProviderOutput structure.""" + + capacity_provider: CapacityProvider + """Information about the updated capacity provider.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateCodeSigningConfigInput(_SerdeShape): + """Dataclass for UpdateCodeSigningConfigInput structure.""" + + code_signing_config_arn: str | None = ... + """The The Amazon Resource Name (ARN) of the code signing configuration.""" + description: str | None = ... + """Descriptive name for this code signing configuration.""" + allowed_publishers: AllowedPublishers | None = ... + """Signing profiles for this code signing configuration.""" + code_signing_policies: CodeSigningPolicies | None = ... + """The code signing policy.""" + +@dataclass(kw_only=True) +class UpdateCodeSigningConfigOutput(_SerdeShape): + """Dataclass for UpdateCodeSigningConfigOutput structure.""" + + code_signing_config: CodeSigningConfig + """The code signing configuration""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateEventSourceMappingInput(_SerdeShape): + """Dataclass for UpdateEventSourceMappingInput structure.""" + + uuid: str | None = ... + """The identifier of the event source mapping.""" + function_name: str | None = ... + """ + The name or ARN of the Lambda function. + + **Name formats** + + - **Function name** -- `MyFunction`. + + - **Function ARN** -- + `arn:aws:lambda:us-west-2:123456789012:function:MyFunction`. + + - **Version or Alias ARN** -- + `arn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD`. + + - **Partial ARN** -- `123456789012:function:MyFunction`. + + The length constraint applies only to the full ARN. If you specify only + the function name, it's limited to 64 characters in length. + """ + enabled: bool | None = ... + """ + When true, the event source mapping is active. When false, Lambda pauses + polling and invocation. + + Default: True + """ + batch_size: int | None = ... + """ + The maximum number of records in each batch that Lambda pulls from your + stream or queue and sends to your function. Lambda passes all of the + records in the batch to the function in a single call, up to the payload + limit for synchronous invocation (6 MB). + + - **Amazon Kinesis** -- Default 100. Max 10,000. + + - **Amazon DynamoDB Streams** -- Default 100. Max 10,000. + + - **Amazon Simple Queue Service** -- Default 10. For standard queues the + max is 10,000. For FIFO queues the max is 10. + + - **Amazon Managed Streaming for Apache Kafka** -- Default 100. Max + 10,000. + + - **Self-managed Apache Kafka** -- Default 100. Max 10,000. + + - **Amazon MQ (ActiveMQ and RabbitMQ)** -- Default 100. Max 10,000. + + - **DocumentDB** -- Default 100. Max 10,000. + """ + filter_criteria: FilterCriteria | None = ... + """ + An object that defines the filter criteria that determine whether Lambda + should process an event. For more information, see [Lambda event + filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html). + """ + kms_key_arn: str | None = ... + """ + The ARN of the Key Management Service (KMS) customer managed key that + Lambda uses to encrypt your function's [filter + criteria](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html#filtering-basics). + By default, Lambda does not encrypt your filter criteria object. Specify + this property to encrypt data using your own customer managed key. + """ + metrics_config: EventSourceMappingMetricsConfig | None = ... + """ + The metrics configuration for your event source. For more information, + see [Event source mapping + metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics-types.html#event-source-mapping-metrics). + """ + logging_config: EventSourceMappingLoggingConfig | None = ... + """ + (Amazon MSK, and self-managed Apache Kafka only) The logging + configuration for your event source. Use this configuration object to + define the level of logs for your event source mapping. + """ + scaling_config: ScalingConfig | None = ... + """ + (Amazon SQS only) The scaling configuration for the event source. For + more information, see [Configuring maximum concurrency for Amazon SQS + event + sources](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-max-concurrency). + """ + maximum_batching_window_in_seconds: int | None = ... + """ + The maximum amount of time, in seconds, that Lambda spends gathering + records before invoking the function. You can configure + `MaximumBatchingWindowInSeconds` to any value from 0 seconds to 300 + seconds in increments of seconds. + + For Kinesis, DynamoDB, and Amazon SQS event sources, the default + batching window is 0 seconds. For Amazon MSK, Self-managed Apache Kafka, + Amazon MQ, and DocumentDB event sources, the default batching window is + 500 ms. Note that because you can only change + `MaximumBatchingWindowInSeconds` in increments of seconds, you cannot + revert back to the 500 ms default batching window after you have changed + it. To restore the default batching window, you must create a new event + source mapping. + + Related setting: For Kinesis, DynamoDB, and Amazon SQS event sources, + when you set `BatchSize` to a value greater than 10, you must set + `MaximumBatchingWindowInSeconds` to at least 1. + """ + parallelization_factor: int | None = ... + """ + (Kinesis and DynamoDB Streams only) The number of batches to process + from each shard concurrently. + """ + destination_config: DestinationConfig | None = ... + """ + (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) A + configuration object that specifies the destination of an event after + Lambda processes it. + """ + maximum_record_age_in_seconds: int | None = ... + """ + (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) + Discard records older than the specified age. The default value is + infinite (-1). + """ + bisect_batch_on_function_error: bool | None = ... + """ + (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) + If the function returns an error, split the batch in two and retry. + """ + maximum_retry_attempts: int | None = ... + """ + (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) + Discard records after the specified number of retries. The default value + is infinite (-1). When set to infinite (-1), failed records are retried + until the record expires. + """ + tumbling_window_in_seconds: int | None = ... + """ + (Kinesis and DynamoDB Streams only) The duration in seconds of a + processing window for DynamoDB and Kinesis Streams event sources. A + value of 0 seconds indicates no tumbling window. + """ + source_access_configurations: list[SourceAccessConfiguration] | None = ... + """ + An array of authentication protocols or VPC components required to + secure your event source. + """ + function_response_types: list[str] | None = ... + """ + (Kinesis, DynamoDB Streams, Amazon MSK, self-managed Apache Kafka, and + Amazon SQS) A list of current response type enums applied to the event + source mapping. + """ + amazon_managed_kafka_event_source_config: ( + AmazonManagedKafkaEventSourceConfig | None + ) = ... + """ + Specific configuration settings for an Amazon Managed Streaming for + Apache Kafka (Amazon MSK) event source. + """ + self_managed_kafka_event_source_config: ( + SelfManagedKafkaEventSourceConfig | None + ) = ... + """ + Specific configuration settings for a self-managed Apache Kafka event + source. + """ + document_db_event_source_config: DocumentDBEventSourceConfig | None = ... + """Specific configuration settings for a DocumentDB event source.""" + provisioned_poller_config: ProvisionedPollerConfig | None = ... + """ + (Amazon SQS, Amazon MSK, and self-managed Apache Kafka only) The + provisioned mode configuration for the event source. For more + information, see [provisioned + mode](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html#invocation-eventsourcemapping-provisioned-mode). + """ + +@dataclass(kw_only=True) +class UpdateEventSourceMappingOutput(_SerdeShape): + """ + A mapping between an Amazon Web Services resource and a Lambda function. + For details, see CreateEventSourceMapping. + """ + + uuid: str | None = ... + """The identifier of the event source mapping.""" + starting_position: str | None = ... + """ + The position in a stream from which to start reading. Required for + Amazon Kinesis and Amazon DynamoDB Stream event sources. `AT_TIMESTAMP` + is supported only for Amazon Kinesis streams, Amazon DocumentDB, Amazon + MSK, and self-managed Apache Kafka. + """ + starting_position_timestamp: datetime | None = ... + """ + With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to + start reading. `StartingPositionTimestamp` cannot be in the future. + """ + batch_size: int | None = ... + """ + The maximum number of records in each batch that Lambda pulls from your + stream or queue and sends to your function. Lambda passes all of the + records in the batch to the function in a single call, up to the payload + limit for synchronous invocation (6 MB). + + Default value: Varies by service. For Amazon SQS, the default is 10. For + all other services, the default is 100. + + Related setting: When you set `BatchSize` to a value greater than 10, + you must set `MaximumBatchingWindowInSeconds` to at least 1. + """ + maximum_batching_window_in_seconds: int | None = ... + """ + The maximum amount of time, in seconds, that Lambda spends gathering + records before invoking the function. You can configure + `MaximumBatchingWindowInSeconds` to any value from 0 seconds to 300 + seconds in increments of seconds. + + For streams and Amazon SQS event sources, the default batching window is + 0 seconds. For Amazon MSK, Self-managed Apache Kafka, Amazon MQ, and + DocumentDB event sources, the default batching window is 500 ms. Note + that because you can only change `MaximumBatchingWindowInSeconds` in + increments of seconds, you cannot revert back to the 500 ms default + batching window after you have changed it. To restore the default + batching window, you must create a new event source mapping. + + Related setting: For streams and Amazon SQS event sources, when you set + `BatchSize` to a value greater than 10, you must set + `MaximumBatchingWindowInSeconds` to at least 1. + """ + parallelization_factor: int | None = ... + """ + (Kinesis and DynamoDB Streams only) The number of batches to process + concurrently from each shard. The default value is 1. + """ + event_source_arn: str | None = ... + """The Amazon Resource Name (ARN) of the event source.""" + filter_criteria: FilterCriteria | None = ... + """ + An object that defines the filter criteria that determine whether Lambda + should process an event. For more information, see [Lambda event + filtering](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html). + + If filter criteria is encrypted, this field shows up as `null` in the + response of ListEventSourceMapping API calls. You can view this field in + plaintext in the response of GetEventSourceMapping and + DeleteEventSourceMapping calls if you have `kms:Decrypt` permissions for + the correct KMS key. + """ + filter_criteria_error: FilterCriteriaError | None = ... + """ + An object that contains details about an error related to filter + criteria encryption. + """ + kms_key_arn: str | None = ... + """ + The ARN of the Key Management Service (KMS) customer managed key that + Lambda uses to encrypt your function's [filter + criteria](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html#filtering-basics). + """ + metrics_config: EventSourceMappingMetricsConfig | None = ... + """ + The metrics configuration for your event source. For more information, + see [Event source mapping + metrics](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics-types.html#event-source-mapping-metrics). + """ + logging_config: EventSourceMappingLoggingConfig | None = ... + """ + (Amazon MSK, and self-managed Apache Kafka only) The logging + configuration for your event source. For more information, see [Event + source mapping + logging](https://docs.aws.amazon.com/lambda/latest/dg/esm-logging.html). + """ + scaling_config: ScalingConfig | None = ... + """ + (Amazon SQS only) The scaling configuration for the event source. For + more information, see [Configuring maximum concurrency for Amazon SQS + event + sources](https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-max-concurrency). + """ + function_arn: str | None = ... + """The ARN of the Lambda function.""" + last_modified: datetime | None = ... + """ + The date that the event source mapping was last updated or that its + state changed. + """ + last_processing_result: str | None = ... + """The result of the event source mapping's last processing attempt.""" + state: str | None = ... + """ + The state of the event source mapping. It can be one of the following: + `Creating`, `Enabling`, `Enabled`, `Disabling`, `Disabled`, `Updating`, + or `Deleting`. + """ + state_transition_reason: str | None = ... + """ + Indicates whether a user or Lambda made the last change to the event + source mapping. + """ + destination_config: DestinationConfig | None = ... + """ + (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) A + configuration object that specifies the destination of an event after + Lambda processes it. + """ + topics: list[str] | None = ... + """The name of the Kafka topic.""" + queues: list[str] | None = ... + """ + (Amazon MQ) The name of the Amazon MQ broker destination queue to + consume. + """ + source_access_configurations: list[SourceAccessConfiguration] | None = ... + """ + An array of the authentication protocol, VPC components, or virtual host + to secure and define your event source. + """ + self_managed_event_source: SelfManagedEventSource | None = ... + """The self-managed Apache Kafka cluster for your event source.""" + maximum_record_age_in_seconds: int | None = ... + """ + (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) + Discard records older than the specified age. The default value is -1, + which sets the maximum age to infinite. When the value is set to + infinite, Lambda never discards old records. + + Note: + The minimum valid value for maximum record age is 60s. Although values + less than 60 and greater than -1 fall within the parameter's absolute + range, they are not allowed + """ + bisect_batch_on_function_error: bool | None = ... + """ + (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) + If the function returns an error, split the batch in two and retry. The + default value is false. + """ + maximum_retry_attempts: int | None = ... + """ + (Kinesis, DynamoDB Streams, Amazon MSK, and self-managed Apache Kafka) + Discard records after the specified number of retries. The default value + is -1, which sets the maximum number of retries to infinite. When + MaximumRetryAttempts is infinite, Lambda retries failed records until + the record expires in the event source. + """ + tumbling_window_in_seconds: int | None = ... + """ + (Kinesis and DynamoDB Streams only) The duration in seconds of a + processing window for DynamoDB and Kinesis Streams event sources. A + value of 0 seconds indicates no tumbling window. + """ + function_response_types: list[str] | None = ... + """ + (Kinesis, DynamoDB Streams, Amazon MSK, self-managed Apache Kafka, and + Amazon SQS) A list of current response type enums applied to the event + source mapping. + """ + amazon_managed_kafka_event_source_config: ( + AmazonManagedKafkaEventSourceConfig | None + ) = ... + """ + Specific configuration settings for an Amazon Managed Streaming for + Apache Kafka (Amazon MSK) event source. + """ + self_managed_kafka_event_source_config: ( + SelfManagedKafkaEventSourceConfig | None + ) = ... + """ + Specific configuration settings for a self-managed Apache Kafka event + source. + """ + document_db_event_source_config: DocumentDBEventSourceConfig | None = ... + """Specific configuration settings for a DocumentDB event source.""" + event_source_mapping_arn: str | None = ... + """The Amazon Resource Name (ARN) of the event source mapping.""" + provisioned_poller_config: ProvisionedPollerConfig | None = ... + """ + (Amazon SQS, Amazon MSK, and self-managed Apache Kafka only) The + provisioned mode configuration for the event source. For more + information, see [provisioned + mode](https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html#invocation-eventsourcemapping-provisioned-mode). + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateFunctionCodeInput(_SerdeShape): + """Dataclass for UpdateFunctionCodeInput structure.""" + + function_name: str | None = ... + """ + The name or ARN of the Lambda function. + + **Name formats** + + - **Function name** -- `my-function`. + + - **Function ARN** -- + `arn:aws:lambda:us-west-2:123456789012:function:my-function`. + + - **Partial ARN** -- `123456789012:function:my-function`. + + The length constraint applies only to the full ARN. If you specify only + the function name, it is limited to 64 characters in length. + """ + zip_file: bytes | None = ... + """ + The base64-encoded contents of the deployment package. Amazon Web + Services SDK and CLI clients handle the encoding for you. Use only with + a function defined with a .zip file archive deployment package. + """ + s3_bucket: str | None = ... + """ + An Amazon S3 bucket in the same Amazon Web Services Region as your + function. The bucket can be in a different Amazon Web Services account. + Use only with a function defined with a .zip file archive deployment + package. + """ + s3_key: str | None = ... + """ + The Amazon S3 key of the deployment package. Use only with a function + defined with a .zip file archive deployment package. + """ + s3_object_version: str | None = ... + """ + For versioned objects, the version of the deployment package object to + use. + """ + s3_object_storage_mode: str | None = ... + """ + Specifies how the deployment package is stored. Valid values: + + - `COPY` (default) -- Uploads a copy of your deployment package to + Lambda. + + - `REFERENCE` -- Lambda references the deployment package from the + specified Amazon S3 bucket. + """ + image_uri: str | None = ... + """ + URI of a container image in the Amazon ECR registry. Do not use for a + function defined with a .zip file archive. + """ + architectures: list[str] | None = ... + """ + The instruction set architecture that the function supports. Enter a + string array with one of the valid values (arm64 or x86_64). The default + value is `x86_64`. + """ + publish: bool = ... + """ + Set to true to publish a new version of the function after updating the + code. This has the same effect as calling PublishVersion separately. + """ + publish_to: str | None = ... + """Specifies where to publish the function version or configuration.""" + dry_run: bool = ... + """ + Set to true to validate the request parameters and access permissions + without modifying the function code. + """ + revision_id: str | None = ... + """ + Update the function only if the revision ID matches the ID that's + specified. Use this option to avoid modifying a function that has + changed since you last read it. + """ + source_kms_key_arn: str | None = ... + """ + The ARN of the Key Management Service (KMS) customer managed key that's + used to encrypt your function's .zip deployment package. If you don't + provide a customer managed key, Lambda uses an Amazon Web Services + managed key. + """ + +@dataclass(kw_only=True) +class UpdateFunctionCodeOutput(_SerdeShape): + """Details about a function's configuration.""" + + function_name: str | None = ... + """The name of the function.""" + function_arn: str | None = ... + """The function's Amazon Resource Name (ARN).""" + runtime: str | None = ... + """ + The identifier of the function's + [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html). + Runtime is required if the deployment package is a .zip file archive. + Specifying a runtime results in an error if you're deploying a function + using a container image. + + The following list includes deprecated runtimes. Lambda blocks creating + new functions and updating existing functions shortly after each runtime + is deprecated. For more information, see [Runtime use after + deprecation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-deprecation-levels). + + For a list of all currently supported runtimes, see [Supported + runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtimes-supported). + """ + role: str | None = ... + """The function's execution role.""" + handler: str | None = ... + """The function that Lambda calls to begin running your function.""" + code_size: int = ... + """The size of the function's deployment package, in bytes.""" + description: str | None = ... + """The function's description.""" + timeout: int | None = ... + """ + The amount of time in seconds that Lambda allows a function to run + before stopping it. + """ + memory_size: int | None = ... + """The amount of memory available to the function at runtime.""" + last_modified: str | None = ... + """ + The date and time that the function was last updated, in [ISO-8601 + format](https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). + """ + code_sha256: str | None = ... + """The SHA256 hash of the function's deployment package.""" + version: str | None = ... + """The version of the Lambda function.""" + vpc_config: VpcConfigResponse | None = ... + """The function's networking configuration.""" + dead_letter_config: DeadLetterConfig | None = ... + """The function's dead letter queue.""" + environment: EnvironmentResponse | None = ... + """ + The function's [environment + variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html). + Omitted from CloudTrail logs. + """ + kms_key_arn: str | None = ... + """ + The ARN of the Key Management Service (KMS) customer managed key that's + used to encrypt the following resources: + + - The function's [environment + variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-encryption). + + - The function's [Lambda + SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart-security.html) + snapshots. + + - When used with `SourceKMSKeyArn`, the unzipped version of the .zip + deployment package that's used for function invocations. For more + information, see [Specifying a customer managed key for + Lambda](https://docs.aws.amazon.com/lambda/latest/dg/encrypt-zip-package.html#enable-zip-custom-encryption). + + - The optimized version of the container image that's used for function + invocations. Note that this is not the same key that's used to + protect your container image in the Amazon Elastic Container Registry + (Amazon ECR). For more information, see [Function + lifecycle](https://docs.aws.amazon.com/lambda/latest/dg/images-create.html#images-lifecycle). + + If you don't provide a customer managed key, Lambda uses an [Amazon Web + Services owned + key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk) + or an [Amazon Web Services managed + key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk). + """ + tracing_config: TracingConfigResponse | None = ... + """The function's X-Ray tracing configuration.""" + master_arn: str | None = ... + """For Lambda@Edge functions, the ARN of the main function.""" + revision_id: str | None = ... + """The latest updated revision of the function or alias.""" + layers: list[Layer] | None = ... + """ + The function's + [layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html). + """ + state: str | None = ... + """ + The current state of the function. When the state is `Inactive`, you can + reactivate the function by invoking it. + """ + state_reason: str | None = ... + """The reason for the function's current state.""" + state_reason_code: str | None = ... + """ + The reason code for the function's current state. When the code is + `Creating`, you can't invoke or modify the function. + """ + last_update_status: str | None = ... + """ + The status of the last update that was performed on the function. This + is first set to `Successful` after function creation completes. + """ + last_update_status_reason: str | None = ... + """The reason for the last update that was performed on the function.""" + last_update_status_reason_code: str | None = ... + """The reason code for the last update that was performed on the function.""" + file_system_configs: list[FileSystemConfig] | None = ... + """ + Connection settings for an [Amazon EFS file + system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html) + or an [Amazon S3 file + system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html). + """ + signing_profile_version_arn: str | None = ... + """The ARN of the signing profile version.""" + signing_job_arn: str | None = ... + """The ARN of the signing job.""" + package_type: str | None = ... + """ + The type of deployment package. Set to `Image` for container image and + set `Zip` for .zip file archive. + """ + image_config_response: ImageConfigResponse | None = ... + """The function's image configuration values.""" + architectures: list[str] | None = ... + """ + The instruction set architecture that the function supports. + Architecture is a string array with one of the valid values. The default + architecture value is `x86_64`. + """ + ephemeral_storage: EphemeralStorage | None = ... + """ + The size of the function's `/tmp` directory in MB. The default value is + 512, but can be any whole number between 512 and 10,240 MB. For more + information, see [Configuring ephemeral storage + (console)](https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-ephemeral-storage). + """ + snap_start: SnapStartResponse | None = ... + """ + Set `ApplyOn` to `PublishedVersions` to create a snapshot of the + initialized execution environment when you publish a function version. + For more information, see [Improving startup performance with Lambda + SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html). + """ + runtime_version_config: RuntimeVersionConfig | None = ... + """The ARN of the runtime and any errors that occured.""" + logging_config: LoggingConfig | None = ... + """The function's Amazon CloudWatch Logs configuration settings.""" + tenancy_config: TenancyConfig | None = ... + """ + The function's tenant isolation configuration settings. Determines + whether the Lambda function runs on a shared or dedicated infrastructure + per unique tenant. + """ + capacity_provider_config: CapacityProviderConfig | None = ... + """ + Configuration for the capacity provider that manages compute resources + for Lambda functions. + """ + config_sha256: str | None = ... + """The SHA256 hash of the function configuration.""" + durable_config: DurableConfig | None = ... + """ + The function's durable execution configuration settings, if the + function is configured for durability. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateFunctionConfigurationInput(_SerdeShape): + """Dataclass for UpdateFunctionConfigurationInput structure.""" + + function_name: str | None = ... + """ + The name or ARN of the Lambda function. + + **Name formats** + + - **Function name** -- `my-function`. + + - **Function ARN** -- + `arn:aws:lambda:us-west-2:123456789012:function:my-function`. + + - **Partial ARN** -- `123456789012:function:my-function`. + + The length constraint applies only to the full ARN. If you specify only + the function name, it is limited to 64 characters in length. + """ + role: str | None = ... + """The Amazon Resource Name (ARN) of the function's execution role.""" + handler: str | None = ... + """ + The name of the method within your code that Lambda calls to run your + function. Handler is required if the deployment package is a .zip file + archive. The format includes the file name. It can also include + namespaces and other qualifiers, depending on the runtime. For more + information, see [Lambda programming + model](https://docs.aws.amazon.com/lambda/latest/dg/foundation-progmodel.html). + """ + description: str | None = ... + """A description of the function.""" + timeout: int | None = ... + """ + The amount of time (in seconds) that Lambda allows a function to run + before stopping it. The default is 3 seconds, and the maximum allowed + value is 900 seconds. For functions using Lambda Managed Instances, + asynchronous invocations and event source mapping invocations (except + Amazon MQ and Amazon DocumentDB) support a maximum allowed value of + 5,400 seconds (90 minutes). For more information, see [Lambda execution + environment](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-context.html). + """ + memory_size: int | None = ... + """ + The amount of [memory available to the + function](https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-memory-console) + at runtime. Increasing the function memory also increases its CPU + allocation. The default value is 128 MB. The value can be any multiple + of 1 MB. + """ + vpc_config: VpcConfig | None = ... + """ + For network connectivity to Amazon Web Services resources in a VPC, + specify a list of security groups and subnets in the VPC. When you + connect a function to a VPC, it can access resources and the internet + only through that VPC. For more information, see [Configuring a Lambda + function to access resources in a + VPC](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html). + """ + environment: Environment | None = ... + """ + Environment variables that are accessible from function code during + execution. + """ + runtime: str | None = ... + """ + The identifier of the function's + [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html). + Runtime is required if the deployment package is a .zip file archive. + Specifying a runtime results in an error if you're deploying a function + using a container image. + + The following list includes deprecated runtimes. Lambda blocks creating + new functions and updating existing functions shortly after each runtime + is deprecated. For more information, see [Runtime use after + deprecation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-deprecation-levels). + + For a list of all currently supported runtimes, see [Supported + runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtimes-supported). + """ + dead_letter_config: DeadLetterConfig | None = ... + """ + A dead-letter queue configuration that specifies the queue or topic + where Lambda sends asynchronous events when they fail processing. For + more information, see [Dead-letter + queues](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-dlq). + """ + kms_key_arn: str | None = ... + """ + The ARN of the Key Management Service (KMS) customer managed key that's + used to encrypt the following resources: + + - The function's [environment + variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-encryption). + + - The function's [Lambda + SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart-security.html) + snapshots. + + - When used with `SourceKMSKeyArn`, the unzipped version of the .zip + deployment package that's used for function invocations. For more + information, see [Specifying a customer managed key for + Lambda](https://docs.aws.amazon.com/lambda/latest/dg/encrypt-zip-package.html#enable-zip-custom-encryption). + + - The optimized version of the container image that's used for function + invocations. Note that this is not the same key that's used to + protect your container image in the Amazon Elastic Container Registry + (Amazon ECR). For more information, see [Function + lifecycle](https://docs.aws.amazon.com/lambda/latest/dg/images-create.html#images-lifecycle). + + If you don't provide a customer managed key, Lambda uses an [Amazon Web + Services owned + key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk) + or an [Amazon Web Services managed + key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk). + """ + tracing_config: TracingConfig | None = ... + """ + Set `Mode` to `Active` to sample and trace a subset of incoming requests + with + [X-Ray](https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html). + """ + revision_id: str | None = ... + """ + Update the function only if the revision ID matches the ID that's + specified. Use this option to avoid modifying a function that has + changed since you last read it. + """ + layers: list[str] | None = ... + """ + A list of [function + layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) + to add to the function's execution environment. Specify each layer by + its ARN, including the version. + """ + file_system_configs: list[FileSystemConfig] | None = ... + """ + Connection settings for an Amazon EFS file system or an Amazon S3 Files + file system. + """ + image_config: ImageConfig | None = ... + """ + [Container image configuration + values](https://docs.aws.amazon.com/lambda/latest/dg/images-create.html#images-parms) + that override the values in the container image Docker file. + """ + ephemeral_storage: EphemeralStorage | None = ... + """ + The size of the function's `/tmp` directory in MB. The default value is + 512, but can be any whole number between 512 and 10,240 MB. For more + information, see [Configuring ephemeral storage + (console)](https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-ephemeral-storage). + """ + snap_start: SnapStart | None = ... + """ + The function's + [SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html) + setting. + """ + logging_config: LoggingConfig | None = ... + """The function's Amazon CloudWatch Logs configuration settings.""" + capacity_provider_config: CapacityProviderConfig | None = ... + """ + Configuration for the capacity provider that manages compute resources + for Lambda functions. + """ + durable_config: DurableConfig | None = ... + """ + Configuration settings for [durable + functions](https://docs.aws.amazon.com/lambda/latest/dg/durable-functions.html), + including execution timeout, retention period for execution history, and + an optional ARN of the Key Management Service (KMS) customer managed key + that is used to encrypt your durable execution's payload data, + including input, output, and error payloads. + """ + +@dataclass(kw_only=True) +class UpdateFunctionConfigurationOutput(_SerdeShape): + """Details about a function's configuration.""" + + function_name: str | None = ... + """The name of the function.""" + function_arn: str | None = ... + """The function's Amazon Resource Name (ARN).""" + runtime: str | None = ... + """ + The identifier of the function's + [runtime](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html). + Runtime is required if the deployment package is a .zip file archive. + Specifying a runtime results in an error if you're deploying a function + using a container image. + + The following list includes deprecated runtimes. Lambda blocks creating + new functions and updating existing functions shortly after each runtime + is deprecated. For more information, see [Runtime use after + deprecation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-deprecation-levels). + + For a list of all currently supported runtimes, see [Supported + runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtimes-supported). + """ + role: str | None = ... + """The function's execution role.""" + handler: str | None = ... + """The function that Lambda calls to begin running your function.""" + code_size: int = ... + """The size of the function's deployment package, in bytes.""" + description: str | None = ... + """The function's description.""" + timeout: int | None = ... + """ + The amount of time in seconds that Lambda allows a function to run + before stopping it. + """ + memory_size: int | None = ... + """The amount of memory available to the function at runtime.""" + last_modified: str | None = ... + """ + The date and time that the function was last updated, in [ISO-8601 + format](https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). + """ + code_sha256: str | None = ... + """The SHA256 hash of the function's deployment package.""" + version: str | None = ... + """The version of the Lambda function.""" + vpc_config: VpcConfigResponse | None = ... + """The function's networking configuration.""" + dead_letter_config: DeadLetterConfig | None = ... + """The function's dead letter queue.""" + environment: EnvironmentResponse | None = ... + """ + The function's [environment + variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html). + Omitted from CloudTrail logs. + """ + kms_key_arn: str | None = ... + """ + The ARN of the Key Management Service (KMS) customer managed key that's + used to encrypt the following resources: + + - The function's [environment + variables](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-encryption). + + - The function's [Lambda + SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart-security.html) + snapshots. + + - When used with `SourceKMSKeyArn`, the unzipped version of the .zip + deployment package that's used for function invocations. For more + information, see [Specifying a customer managed key for + Lambda](https://docs.aws.amazon.com/lambda/latest/dg/encrypt-zip-package.html#enable-zip-custom-encryption). + + - The optimized version of the container image that's used for function + invocations. Note that this is not the same key that's used to + protect your container image in the Amazon Elastic Container Registry + (Amazon ECR). For more information, see [Function + lifecycle](https://docs.aws.amazon.com/lambda/latest/dg/images-create.html#images-lifecycle). + + If you don't provide a customer managed key, Lambda uses an [Amazon Web + Services owned + key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk) + or an [Amazon Web Services managed + key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk). + """ + tracing_config: TracingConfigResponse | None = ... + """The function's X-Ray tracing configuration.""" + master_arn: str | None = ... + """For Lambda@Edge functions, the ARN of the main function.""" + revision_id: str | None = ... + """The latest updated revision of the function or alias.""" + layers: list[Layer] | None = ... + """ + The function's + [layers](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html). + """ + state: str | None = ... + """ + The current state of the function. When the state is `Inactive`, you can + reactivate the function by invoking it. + """ + state_reason: str | None = ... + """The reason for the function's current state.""" + state_reason_code: str | None = ... + """ + The reason code for the function's current state. When the code is + `Creating`, you can't invoke or modify the function. + """ + last_update_status: str | None = ... + """ + The status of the last update that was performed on the function. This + is first set to `Successful` after function creation completes. + """ + last_update_status_reason: str | None = ... + """The reason for the last update that was performed on the function.""" + last_update_status_reason_code: str | None = ... + """The reason code for the last update that was performed on the function.""" + file_system_configs: list[FileSystemConfig] | None = ... + """ + Connection settings for an [Amazon EFS file + system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html) + or an [Amazon S3 file + system](https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html). + """ + signing_profile_version_arn: str | None = ... + """The ARN of the signing profile version.""" + signing_job_arn: str | None = ... + """The ARN of the signing job.""" + package_type: str | None = ... + """ + The type of deployment package. Set to `Image` for container image and + set `Zip` for .zip file archive. + """ + image_config_response: ImageConfigResponse | None = ... + """The function's image configuration values.""" + architectures: list[str] | None = ... + """ + The instruction set architecture that the function supports. + Architecture is a string array with one of the valid values. The default + architecture value is `x86_64`. + """ + ephemeral_storage: EphemeralStorage | None = ... + """ + The size of the function's `/tmp` directory in MB. The default value is + 512, but can be any whole number between 512 and 10,240 MB. For more + information, see [Configuring ephemeral storage + (console)](https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-ephemeral-storage). + """ + snap_start: SnapStartResponse | None = ... + """ + Set `ApplyOn` to `PublishedVersions` to create a snapshot of the + initialized execution environment when you publish a function version. + For more information, see [Improving startup performance with Lambda + SnapStart](https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html). + """ + runtime_version_config: RuntimeVersionConfig | None = ... + """The ARN of the runtime and any errors that occured.""" + logging_config: LoggingConfig | None = ... + """The function's Amazon CloudWatch Logs configuration settings.""" + tenancy_config: TenancyConfig | None = ... + """ + The function's tenant isolation configuration settings. Determines + whether the Lambda function runs on a shared or dedicated infrastructure + per unique tenant. + """ + capacity_provider_config: CapacityProviderConfig | None = ... + """ + Configuration for the capacity provider that manages compute resources + for Lambda functions. + """ + config_sha256: str | None = ... + """The SHA256 hash of the function configuration.""" + durable_config: DurableConfig | None = ... + """ + The function's durable execution configuration settings, if the + function is configured for durability. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateFunctionEventInvokeConfigInput(_SerdeShape): + """Dataclass for UpdateFunctionEventInvokeConfigInput structure.""" + + function_name: str | None = ... + """ + The name or ARN of the Lambda function, version, or alias. + + **Name formats** + + - **Function name** - `my-function` (name-only), `my-function:v1` (with + alias). + + - **Function ARN** - + `arn:aws:lambda:us-west-2:123456789012:function:my-function`. + + - **Partial ARN** - `123456789012:function:my-function`. + + You can append a version number or alias to any of the formats. The + length constraint applies only to the full ARN. If you specify only the + function name, it is limited to 64 characters in length. + """ + qualifier: str | None = ... + """A version number or alias name.""" + maximum_retry_attempts: int | None = ... + """The maximum number of times to retry when the function returns an error.""" + maximum_event_age_in_seconds: int | None = ... + """ + The maximum age of a request that Lambda sends to a function for + processing. + """ + destination_config: DestinationConfig | None = ... + """ + A destination for events after they have been sent to a function for + processing. + + **Destinations** + + - **Function** - The Amazon Resource Name (ARN) of a Lambda function. + + - **Queue** - The ARN of a standard SQS queue. + + - **Bucket** - The ARN of an Amazon S3 bucket. + + - **Topic** - The ARN of a standard SNS topic. + + - **Event Bus** - The ARN of an Amazon EventBridge event bus. + + Note: + S3 buckets are supported only for on-failure destinations. To retain + records of successful invocations, use another destination type. + """ + +@dataclass(kw_only=True) +class UpdateFunctionEventInvokeConfigOutput(_SerdeShape): + """Dataclass for UpdateFunctionEventInvokeConfigOutput structure.""" + + last_modified: datetime | None = ... + """The date and time that the configuration was last updated.""" + function_arn: str | None = ... + """The Amazon Resource Name (ARN) of the function.""" + maximum_retry_attempts: int | None = ... + """The maximum number of times to retry when the function returns an error.""" + maximum_event_age_in_seconds: int | None = ... + """ + The maximum age of a request that Lambda sends to a function for + processing. + """ + destination_config: DestinationConfig | None = ... + """ + A destination for events after they have been sent to a function for + processing. + + **Destinations** + + - **Function** - The Amazon Resource Name (ARN) of a Lambda function. + + - **Queue** - The ARN of a standard SQS queue. + + - **Bucket** - The ARN of an Amazon S3 bucket. + + - **Topic** - The ARN of a standard SNS topic. + + - **Event Bus** - The ARN of an Amazon EventBridge event bus. + + Note: + S3 buckets are supported only for on-failure destinations. To retain + records of successful invocations, use another destination type. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateFunctionUrlConfigInput(_SerdeShape): + """Dataclass for UpdateFunctionUrlConfigInput structure.""" + + function_name: str | None = ... + """ + The name or ARN of the Lambda function. + + **Name formats** + + - **Function name** -- `my-function`. + + - **Function ARN** -- + `arn:aws:lambda:us-west-2:123456789012:function:my-function`. + + - **Partial ARN** -- `123456789012:function:my-function`. + + The length constraint applies only to the full ARN. If you specify only + the function name, it is limited to 64 characters in length. + """ + qualifier: str | None = ... + """The alias name.""" + auth_type: str | None = ... + """ + The type of authentication that your function URL uses. Set to `AWS_IAM` + if you want to restrict access to authenticated users only. Set to + `NONE` if you want to bypass IAM authentication to create a public + endpoint. For more information, see [Control access to Lambda function + URLs](https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html). + """ + cors: Cors | None = ... + """ + The [cross-origin resource sharing + (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) settings + for your function URL. + """ + invoke_mode: str | None = ... + """ + Use one of the following options: + + - `BUFFERED` -- This is the default option. Lambda invokes your function + using the `Invoke` API operation. Invocation results are available + when the payload is complete. The maximum payload size is 6 MB. + + - `RESPONSE_STREAM` -- Your function streams payload results as they + become available. Lambda invokes your function using the + `InvokeWithResponseStream` API operation. The maximum response payload + size is 200 MB. + """ + +@dataclass(kw_only=True) +class UpdateFunctionUrlConfigOutput(_SerdeShape): + """Dataclass for UpdateFunctionUrlConfigOutput structure.""" + + function_url: str + """The HTTP URL endpoint for your function.""" + function_arn: str + """The Amazon Resource Name (ARN) of your function.""" + auth_type: str + """ + The type of authentication that your function URL uses. Set to `AWS_IAM` + if you want to restrict access to authenticated users only. Set to + `NONE` if you want to bypass IAM authentication to create a public + endpoint. For more information, see [Control access to Lambda function + URLs](https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html). + """ + cors: Cors | None = ... + """ + The [cross-origin resource sharing + (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) settings + for your function URL. + """ + creation_time: str + """ + When the function URL was created, in [ISO-8601 + format](https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). + """ + last_modified_time: str + """ + When the function URL configuration was last updated, in [ISO-8601 + format](https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). + """ + invoke_mode: str | None = ... + """ + Use one of the following options: + + - `BUFFERED` -- This is the default option. Lambda invokes your function + using the `Invoke` API operation. Invocation results are available + when the payload is complete. The maximum payload size is 6 MB. + + - `RESPONSE_STREAM` -- Your function streams payload results as they + become available. Lambda invokes your function using the + `InvokeWithResponseStream` API operation. The maximum response payload + size is 200 MB. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class UpdateRuntimeOn(UnknownEnumMixin, StrEnum): + AUTO = "Auto" + MANUAL = "Manual" + FUNCTION_UPDATE = "FunctionUpdate" + +@dataclass(kw_only=True) +class VpcConfig(_SerdeShape): + """ + The VPC security groups and subnets that are attached to a Lambda + function. For more information, see [Configuring a Lambda function to + access resources in a + VPC](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html). + """ + + subnet_ids: list[str] | None = ... + """A list of VPC subnet IDs.""" + security_group_ids: list[str] | None = ... + """A list of VPC security group IDs.""" + ipv6_allowed_for_dual_stack: bool | None = ... + """ + Allows outbound IPv6 traffic on VPC functions that are connected to + dual-stack subnets. + """ + +@dataclass(kw_only=True) +class VpcConfigResponse(_SerdeShape): + """ + The VPC security groups and subnets that are attached to a Lambda + function. + """ + + subnet_ids: list[str] | None = ... + """A list of VPC subnet IDs.""" + security_group_ids: list[str] | None = ... + """A list of VPC security group IDs.""" + vpc_id: str | None = ... + """The ID of the VPC.""" + ipv6_allowed_for_dual_stack: bool | None = ... + """ + Allows outbound IPv6 traffic on VPC functions that are connected to + dual-stack subnets. + """ + +@dataclass(kw_only=True) +class WaitCancelledDetails(_SerdeShape): + """Details about a wait operation that was cancelled.""" + + error: EventError | None = ... + """Details about why the wait operation was cancelled.""" + +@dataclass(kw_only=True) +class WaitDetails(_SerdeShape): + """Details about a wait operation.""" + + scheduled_end_timestamp: datetime | None = ... + """ + The date and time when the wait operation is scheduled to complete, in + [ISO-8601 format](https://www.w3.org/TR/NOTE-datetime) + (YYYY-MM-DDThh:mm:ss.sTZD). + """ + +@dataclass(kw_only=True) +class WaitOptions(_SerdeShape): + """Specifies how long to pause the durable execution.""" + + wait_seconds: int | None = ... + """The duration to wait, in seconds.""" + +@dataclass(kw_only=True) +class WaitStartedDetails(_SerdeShape): + """Details about a wait operation that has started.""" + + duration: int + """The duration to wait, in seconds.""" + scheduled_end_timestamp: datetime + """ + The date and time when the wait operation is scheduled to complete, in + [ISO-8601 format](https://www.w3.org/TR/NOTE-datetime) + (YYYY-MM-DDThh:mm:ss.sTZD). + """ + +@dataclass(kw_only=True) +class WaitSucceededDetails(_SerdeShape): + """Details about a wait operation that succeeded.""" + + duration: int | None = ... + """The wait duration, in seconds.""" + +ADD_LAYER_VERSION_PERMISSION: APIOperation[ + AddLayerVersionPermissionInput, AddLayerVersionPermissionOutput +] +ADD_PERMISSION: APIOperation[AddPermissionInput, AddPermissionOutput] +CHECKPOINT_DURABLE_EXECUTION: APIOperation[ + CheckpointDurableExecutionInput, CheckpointDurableExecutionOutput +] +CREATE_ALIAS: APIOperation[CreateAliasInput, CreateAliasOutput] +CREATE_CAPACITY_PROVIDER: APIOperation[ + CreateCapacityProviderInput, CreateCapacityProviderOutput +] +CREATE_CODE_SIGNING_CONFIG: APIOperation[ + CreateCodeSigningConfigInput, CreateCodeSigningConfigOutput +] +CREATE_EVENT_SOURCE_MAPPING: APIOperation[ + CreateEventSourceMappingInput, CreateEventSourceMappingOutput +] +CREATE_FUNCTION: APIOperation[CreateFunctionInput, CreateFunctionOutput] +CREATE_FUNCTION_URL_CONFIG: APIOperation[ + CreateFunctionUrlConfigInput, CreateFunctionUrlConfigOutput +] +DELETE_ALIAS: APIOperation[DeleteAliasInput, DeleteAliasOutput] +DELETE_CAPACITY_PROVIDER: APIOperation[ + DeleteCapacityProviderInput, DeleteCapacityProviderOutput +] +DELETE_CODE_SIGNING_CONFIG: APIOperation[ + DeleteCodeSigningConfigInput, DeleteCodeSigningConfigOutput +] +DELETE_EVENT_SOURCE_MAPPING: APIOperation[ + DeleteEventSourceMappingInput, DeleteEventSourceMappingOutput +] +DELETE_FUNCTION: APIOperation[DeleteFunctionInput, DeleteFunctionOutput] +DELETE_FUNCTION_CODE_SIGNING_CONFIG: APIOperation[ + DeleteFunctionCodeSigningConfigInput, DeleteFunctionCodeSigningConfigOutput +] +DELETE_FUNCTION_CONCURRENCY: APIOperation[ + DeleteFunctionConcurrencyInput, DeleteFunctionConcurrencyOutput +] +DELETE_FUNCTION_EVENT_INVOKE_CONFIG: APIOperation[ + DeleteFunctionEventInvokeConfigInput, DeleteFunctionEventInvokeConfigOutput +] +DELETE_FUNCTION_URL_CONFIG: APIOperation[ + DeleteFunctionUrlConfigInput, DeleteFunctionUrlConfigOutput +] +DELETE_LAYER_VERSION: APIOperation[DeleteLayerVersionInput, DeleteLayerVersionOutput] +DELETE_PROVISIONED_CONCURRENCY_CONFIG: APIOperation[ + DeleteProvisionedConcurrencyConfigInput, DeleteProvisionedConcurrencyConfigOutput +] +DELETE_RESOURCE_POLICY: APIOperation[ + DeleteResourcePolicyInput, DeleteResourcePolicyOutput +] +GET_ACCOUNT_SETTINGS: APIOperation[GetAccountSettingsInput, GetAccountSettingsOutput] +GET_ALIAS: APIOperation[GetAliasInput, GetAliasOutput] +GET_CAPACITY_PROVIDER: APIOperation[GetCapacityProviderInput, GetCapacityProviderOutput] +GET_CODE_SIGNING_CONFIG: APIOperation[ + GetCodeSigningConfigInput, GetCodeSigningConfigOutput +] +GET_DURABLE_EXECUTION: APIOperation[GetDurableExecutionInput, GetDurableExecutionOutput] +GET_DURABLE_EXECUTION_HISTORY: APIOperation[ + GetDurableExecutionHistoryInput, GetDurableExecutionHistoryOutput +] +GET_DURABLE_EXECUTION_STATE: APIOperation[ + GetDurableExecutionStateInput, GetDurableExecutionStateOutput +] +GET_EVENT_SOURCE_MAPPING: APIOperation[ + GetEventSourceMappingInput, GetEventSourceMappingOutput +] +GET_FUNCTION: APIOperation[GetFunctionInput, GetFunctionOutput] +GET_FUNCTION_CODE_SIGNING_CONFIG: APIOperation[ + GetFunctionCodeSigningConfigInput, GetFunctionCodeSigningConfigOutput +] +GET_FUNCTION_CONCURRENCY: APIOperation[ + GetFunctionConcurrencyInput, GetFunctionConcurrencyOutput +] +GET_FUNCTION_CONFIGURATION: APIOperation[ + GetFunctionConfigurationInput, GetFunctionConfigurationOutput +] +GET_FUNCTION_EVENT_INVOKE_CONFIG: APIOperation[ + GetFunctionEventInvokeConfigInput, GetFunctionEventInvokeConfigOutput +] +GET_FUNCTION_RECURSION_CONFIG: APIOperation[ + GetFunctionRecursionConfigInput, GetFunctionRecursionConfigOutput +] +GET_FUNCTION_SCALING_CONFIG: APIOperation[ + GetFunctionScalingConfigInput, GetFunctionScalingConfigOutput +] +GET_FUNCTION_URL_CONFIG: APIOperation[ + GetFunctionUrlConfigInput, GetFunctionUrlConfigOutput +] +GET_LAYER_VERSION: APIOperation[GetLayerVersionInput, GetLayerVersionOutput] +GET_LAYER_VERSION_BY_ARN: APIOperation[ + GetLayerVersionByArnInput, GetLayerVersionByArnOutput +] +GET_LAYER_VERSION_POLICY: APIOperation[ + GetLayerVersionPolicyInput, GetLayerVersionPolicyOutput +] +GET_POLICY: APIOperation[GetPolicyInput, GetPolicyOutput] +GET_PROVISIONED_CONCURRENCY_CONFIG: APIOperation[ + GetProvisionedConcurrencyConfigInput, GetProvisionedConcurrencyConfigOutput +] +GET_RESOURCE_POLICY: APIOperation[GetResourcePolicyInput, GetResourcePolicyOutput] +GET_RUNTIME_MANAGEMENT_CONFIG: APIOperation[ + GetRuntimeManagementConfigInput, GetRuntimeManagementConfigOutput +] +INVOKE: APIOperation[InvokeInput, InvokeOutput] +INVOKE_ASYNC: APIOperation[InvokeAsyncInput, InvokeAsyncOutput] +INVOKE_WITH_RESPONSE_STREAM: APIOperation[ + InvokeWithResponseStreamInput, InvokeWithResponseStreamOutput +] +LIST_ALIASES: APIOperation[ListAliasesInput, ListAliasesOutput] +LIST_CAPACITY_PROVIDERS: APIOperation[ + ListCapacityProvidersInput, ListCapacityProvidersOutput +] +LIST_CODE_SIGNING_CONFIGS: APIOperation[ + ListCodeSigningConfigsInput, ListCodeSigningConfigsOutput +] +LIST_DURABLE_EXECUTIONS_BY_FUNCTION: APIOperation[ + ListDurableExecutionsByFunctionInput, ListDurableExecutionsByFunctionOutput +] +LIST_EVENT_SOURCE_MAPPINGS: APIOperation[ + ListEventSourceMappingsInput, ListEventSourceMappingsOutput +] +LIST_FUNCTION_EVENT_INVOKE_CONFIGS: APIOperation[ + ListFunctionEventInvokeConfigsInput, ListFunctionEventInvokeConfigsOutput +] +LIST_FUNCTIONS: APIOperation[ListFunctionsInput, ListFunctionsOutput] +LIST_FUNCTIONS_BY_CODE_SIGNING_CONFIG: APIOperation[ + ListFunctionsByCodeSigningConfigInput, ListFunctionsByCodeSigningConfigOutput +] +LIST_FUNCTION_URL_CONFIGS: APIOperation[ + ListFunctionUrlConfigsInput, ListFunctionUrlConfigsOutput +] +LIST_FUNCTION_VERSIONS_BY_CAPACITY_PROVIDER: APIOperation[ + ListFunctionVersionsByCapacityProviderInput, + ListFunctionVersionsByCapacityProviderOutput, +] +LIST_LAYERS: APIOperation[ListLayersInput, ListLayersOutput] +LIST_LAYER_VERSIONS: APIOperation[ListLayerVersionsInput, ListLayerVersionsOutput] +LIST_PROVISIONED_CONCURRENCY_CONFIGS: APIOperation[ + ListProvisionedConcurrencyConfigsInput, ListProvisionedConcurrencyConfigsOutput +] +LIST_TAGS: APIOperation[ListTagsInput, ListTagsOutput] +LIST_VERSIONS_BY_FUNCTION: APIOperation[ + ListVersionsByFunctionInput, ListVersionsByFunctionOutput +] +PUBLISH_LAYER_VERSION: APIOperation[PublishLayerVersionInput, PublishLayerVersionOutput] +PUBLISH_VERSION: APIOperation[PublishVersionInput, PublishVersionOutput] +PUT_FUNCTION_CODE_SIGNING_CONFIG: APIOperation[ + PutFunctionCodeSigningConfigInput, PutFunctionCodeSigningConfigOutput +] +PUT_FUNCTION_CONCURRENCY: APIOperation[ + PutFunctionConcurrencyInput, PutFunctionConcurrencyOutput +] +PUT_FUNCTION_EVENT_INVOKE_CONFIG: APIOperation[ + PutFunctionEventInvokeConfigInput, PutFunctionEventInvokeConfigOutput +] +PUT_FUNCTION_RECURSION_CONFIG: APIOperation[ + PutFunctionRecursionConfigInput, PutFunctionRecursionConfigOutput +] +PUT_FUNCTION_SCALING_CONFIG: APIOperation[ + PutFunctionScalingConfigInput, PutFunctionScalingConfigOutput +] +PUT_PROVISIONED_CONCURRENCY_CONFIG: APIOperation[ + PutProvisionedConcurrencyConfigInput, PutProvisionedConcurrencyConfigOutput +] +PUT_RESOURCE_POLICY: APIOperation[PutResourcePolicyInput, PutResourcePolicyOutput] +PUT_RUNTIME_MANAGEMENT_CONFIG: APIOperation[ + PutRuntimeManagementConfigInput, PutRuntimeManagementConfigOutput +] +REMOVE_LAYER_VERSION_PERMISSION: APIOperation[ + RemoveLayerVersionPermissionInput, RemoveLayerVersionPermissionOutput +] +REMOVE_PERMISSION: APIOperation[RemovePermissionInput, RemovePermissionOutput] +SEND_DURABLE_EXECUTION_CALLBACK_FAILURE: APIOperation[ + SendDurableExecutionCallbackFailureInput, SendDurableExecutionCallbackFailureOutput +] +SEND_DURABLE_EXECUTION_CALLBACK_HEARTBEAT: APIOperation[ + SendDurableExecutionCallbackHeartbeatInput, + SendDurableExecutionCallbackHeartbeatOutput, +] +SEND_DURABLE_EXECUTION_CALLBACK_SUCCESS: APIOperation[ + SendDurableExecutionCallbackSuccessInput, SendDurableExecutionCallbackSuccessOutput +] +STOP_DURABLE_EXECUTION: APIOperation[ + StopDurableExecutionInput, StopDurableExecutionOutput +] +TAG_RESOURCE: APIOperation[TagResourceInput, TagResourceOutput] +UNTAG_RESOURCE: APIOperation[UntagResourceInput, UntagResourceOutput] +UPDATE_ALIAS: APIOperation[UpdateAliasInput, UpdateAliasOutput] +UPDATE_CAPACITY_PROVIDER: APIOperation[ + UpdateCapacityProviderInput, UpdateCapacityProviderOutput +] +UPDATE_CODE_SIGNING_CONFIG: APIOperation[ + UpdateCodeSigningConfigInput, UpdateCodeSigningConfigOutput +] +UPDATE_EVENT_SOURCE_MAPPING: APIOperation[ + UpdateEventSourceMappingInput, UpdateEventSourceMappingOutput +] +UPDATE_FUNCTION_CODE: APIOperation[UpdateFunctionCodeInput, UpdateFunctionCodeOutput] +UPDATE_FUNCTION_CONFIGURATION: APIOperation[ + UpdateFunctionConfigurationInput, UpdateFunctionConfigurationOutput +] +UPDATE_FUNCTION_EVENT_INVOKE_CONFIG: APIOperation[ + UpdateFunctionEventInvokeConfigInput, UpdateFunctionEventInvokeConfigOutput +] +UPDATE_FUNCTION_URL_CONFIG: APIOperation[ + UpdateFunctionUrlConfigInput, UpdateFunctionUrlConfigOutput +] diff --git a/clients/aws-sdk-lex-runtime-v2/scripts/docs/generate_doc_stubs.py b/clients/aws-sdk-lex-runtime-v2/scripts/docs/generate_doc_stubs.py index 52d470bc..795f2e4b 100644 --- a/clients/aws-sdk-lex-runtime-v2/scripts/docs/generate_doc_stubs.py +++ b/clients/aws-sdk-lex-runtime-v2/scripts/docs/generate_doc_stubs.py @@ -126,7 +126,9 @@ class ClientInfo: class DocStubGenerator: """Generate markdown API Reference stubs for AWS SDK for Python v4 clients.""" - def __init__(self, client_dir: Path, output_dir: Path, service_name: str | None = None) -> None: + def __init__( + self, client_dir: Path, output_dir: Path, service_name: str | None = None + ) -> None: """ Initialize the documentation generator. @@ -190,7 +192,9 @@ def _analyze_client_package(self, package_name: str) -> ClientInfo: required = ("client", "config", "models") missing = [name for name in required if not package.modules.get(name)] if missing: - raise ValueError(f"Missing required modules in {package_name}: {', '.join(missing)}") + raise ValueError( + f"Missing required modules in {package_name}: {', '.join(missing)}" + ) # Parse submodules client_module = package.modules["client"] @@ -199,11 +203,15 @@ def _analyze_client_package(self, package_name: str) -> ClientInfo: client_class = self._find_class_with_suffix(client_module, "Client") if not client_class: - raise ValueError(f"No class ending with 'Client' found in {package_name}.client") + raise ValueError( + f"No class ending with 'Client' found in {package_name}.client" + ) config_class = self._find_class_with_suffix(config_module, "Config") if not config_class: - raise ValueError(f"No class ending with 'Config' found in {package_name}.config") + raise ValueError( + f"No class ending with 'Config' found in {package_name}.config" + ) plugin_alias = config_module.members.get("Plugin") if not plugin_alias: @@ -288,7 +296,9 @@ def _analyze_operation(self, operation: Function) -> OperationInfo: if output_type in stream_type_map: stream_type = stream_type_map[output_type] - stream_args = self._get_subscript_elements(returns, f"'{operation.name}' stream type") + stream_args = self._get_subscript_elements( + returns, f"'{operation.name}' stream type" + ) if stream_type in (StreamType.INPUT, StreamType.DUPLEX): event_input_type = stream_args[0].canonical_name @@ -316,7 +326,9 @@ def _analyze_operation(self, operation: Function) -> OperationInfo: def _get_expr(self, annotation: str | Expr | None, context: str) -> Expr: """Extract and validate an Expr from an annotation.""" if not isinstance(annotation, Expr): - raise TypeError(f"{context}: expected Expr, got {type(annotation).__name__}") + raise TypeError( + f"{context}: expected Expr, got {type(annotation).__name__}" + ) return annotation def _get_subscript_elements(self, expr: Expr, context: str) -> list[Expr]: @@ -330,7 +342,9 @@ def _get_subscript_elements(self, expr: Expr, context: str) -> list[Expr]: return [el for el in slice_expr.elements if isinstance(el, Expr)] return [slice_expr] - def _extract_models(self, models_module: Module, operations: list[OperationInfo]) -> ModelsInfo: + def _extract_models( + self, models_module: Module, operations: list[OperationInfo] + ) -> ModelsInfo: """Extract structures, unions, enums, and errors from models module.""" structures, unions, enums, errors = [], [], [], [] @@ -356,14 +370,16 @@ def _extract_models(self, models_module: Module, operations: list[OperationInfo] duplicates = [] for structure in structures: - if self._is_operation_io_type(structure.name, operations) or self._is_union_member( - structure.name, unions - ): + if self._is_operation_io_type( + structure.name, operations + ) or self._is_union_member(structure.name, unions): duplicates.append(structure) structures = [struct for struct in structures if struct not in duplicates] - return ModelsInfo(structures=structures, unions=unions, enums=enums, errors=errors) + return ModelsInfo( + structures=structures, unions=unions, enums=enums, errors=errors + ) def _is_union(self, member: Object | Alias) -> TypeGuard[Attribute]: """Check if a module member is a union type.""" @@ -399,7 +415,9 @@ def _extract_union_members( for name in member_names: if not (member_object := models_module.members.get(name)): raise ValueError(f"Union member '{name}' not found in models module") - members.append(TypeInfo(name=member_object.name, module_path=member_object.path)) + members.append( + TypeInfo(name=member_object.name, module_path=member_object.path) + ) return members @@ -408,7 +426,8 @@ def _is_enum(self, member: Object | Alias) -> TypeGuard[Class]: if not isinstance(member, Class): return False return any( - isinstance(base, ExprName) and base.name in ENUM_BASE_CLASSES for base in member.bases + isinstance(base, ExprName) and base.name in ENUM_BASE_CLASSES + for base in member.bases ) def _is_error(self, member: Object | Alias) -> TypeGuard[Class]: @@ -416,10 +435,13 @@ def _is_error(self, member: Object | Alias) -> TypeGuard[Class]: if not isinstance(member, Class): return False return any( - isinstance(base, ExprName) and base.name in ERROR_BASE_CLASSES for base in member.bases + isinstance(base, ExprName) and base.name in ERROR_BASE_CLASSES + for base in member.bases ) - def _is_operation_io_type(self, type_name: str, operations: list[OperationInfo]) -> bool: + def _is_operation_io_type( + self, type_name: str, operations: list[OperationInfo] + ) -> bool: """Check if a type is used as operation input/output.""" return any(type_name in (op.input.name, op.output.name) for op in operations) @@ -437,8 +459,12 @@ def _generate_client_docs(self, client_info: ClientInfo) -> bool: self._generate_type_stubs( client_info.models.structures, "structures", "Structure Class" ) - self._generate_type_stubs(client_info.models.errors, "errors", "Error Class") - self._generate_type_stubs(client_info.models.enums, "enums", "Enum Class", members=True) + self._generate_type_stubs( + client_info.models.errors, "errors", "Error Class" + ) + self._generate_type_stubs( + client_info.models.enums, "enums", "Enum Class", members=True + ) self._generate_union_stubs(client_info.models.unions) except OSError as e: logger.error(f"Failed to write documentation files: {e}") @@ -470,7 +496,9 @@ def _generate_index(self, client_info: ClientInfo) -> None: ] for method in sorted(client_info.client_methods, key=lambda x: x.name): - lines.extend([*self._mkdocs_directive(method.module_path, heading_level=4), ""]) + lines.extend( + [*self._mkdocs_directive(method.module_path, heading_level=4), ""] + ) # Operations section if client_info.operations: @@ -578,7 +606,9 @@ def _generate_operation_stubs(self, operations: list[OperationInfo]) -> None: output_path = self.output_dir / "operations" / f"{op.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb("Operations", op.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb("Operations", op.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(operations)} operation file(s)") @@ -600,7 +630,9 @@ def _generate_type_stubs( output_path = self.output_dir / category / f"{item.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb(category.title(), item.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb(category.title(), item.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(items)} {category} file(s)") @@ -624,7 +656,9 @@ def _generate_union_stubs(self, unions: list[UnionInfo]) -> None: output_path = self.output_dir / "unions" / f"{union.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb("Unions", union.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb("Unions", union.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(unions)} union file(s)") diff --git a/clients/aws-sdk-lex-runtime-v2/src/aws_sdk_lex_runtime_v2/_private/schemas.py b/clients/aws-sdk-lex-runtime-v2/src/aws_sdk_lex_runtime_v2/_private/schemas.py index f7302ed9..a35c38e9 100644 --- a/clients/aws-sdk-lex-runtime-v2/src/aws_sdk_lex_runtime_v2/_private/schemas.py +++ b/clients/aws-sdk-lex-runtime-v2/src/aws_sdk_lex_runtime_v2/_private/schemas.py @@ -2,1744 +2,1507 @@ from types import MappingProxyType -from smithy_core.prelude import UNIT -from smithy_core.schemas import Schema -from smithy_core.shapes import ShapeID, ShapeType -from smithy_core.traits import Trait - - -STRING = Schema( - id=ShapeID("com.amazonaws.lexruntimev2#String"), shape_type=ShapeType.STRING -) - -ACCESS_DENIED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#AccessDeniedException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=403), - ], - members={ - "message": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -PARAMETER_NAME = Schema( - id=ShapeID("com.amazonaws.lexruntimev2#ParameterName"), shape_type=ShapeType.STRING -) - -TEXT = Schema( - id=ShapeID("com.amazonaws.lexruntimev2#Text"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -ACTIVE_CONTEXT_PARAMETERS_MAP = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#ActiveContextParametersMap"), - shape_type=ShapeType.MAP, - members={"key": {"target": PARAMETER_NAME}, "value": {"target": TEXT}}, -) - -ACTIVE_CONTEXT_NAME = Schema( - id=ShapeID("com.amazonaws.lexruntimev2#ActiveContextName"), - shape_type=ShapeType.STRING, -) - -ACTIVE_CONTEXT_TIME_TO_LIVE_IN_SECONDS = Schema( - id=ShapeID("com.amazonaws.lexruntimev2#ActiveContextTimeToLiveInSeconds"), - shape_type=ShapeType.INTEGER, -) - -ACTIVE_CONTEXT_TURNS_TO_LIVE = Schema( - id=ShapeID("com.amazonaws.lexruntimev2#ActiveContextTurnsToLive"), - shape_type=ShapeType.INTEGER, -) - -ACTIVE_CONTEXT_TIME_TO_LIVE = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#ActiveContextTimeToLive"), - members={ - "timeToLiveInSeconds": { - "target": ACTIVE_CONTEXT_TIME_TO_LIVE_IN_SECONDS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "turnsToLive": { - "target": ACTIVE_CONTEXT_TURNS_TO_LIVE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -ACTIVE_CONTEXT = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#ActiveContext"), - members={ - "name": { - "target": ACTIVE_CONTEXT_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "timeToLive": { - "target": ACTIVE_CONTEXT_TIME_TO_LIVE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "contextAttributes": { - "target": ACTIVE_CONTEXT_PARAMETERS_MAP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -ACTIVE_CONTEXTS_LIST = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#ActiveContextsList"), - shape_type=ShapeType.LIST, - members={"member": {"target": ACTIVE_CONTEXT}}, -) - -ATTACHMENT_TITLE = Schema( - id=ShapeID("com.amazonaws.lexruntimev2#AttachmentTitle"), - shape_type=ShapeType.STRING, -) - -ATTACHMENT_URL = Schema( - id=ShapeID("com.amazonaws.lexruntimev2#AttachmentUrl"), shape_type=ShapeType.STRING -) - -AUDIO_CHUNK = Schema( - id=ShapeID("com.amazonaws.lexruntimev2#AudioChunk"), shape_type=ShapeType.BLOB -) - -EPOCH_MILLIS = Schema( - id=ShapeID("com.amazonaws.lexruntimev2#EpochMillis"), - shape_type=ShapeType.LONG, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=0)], -) - -NON_EMPTY_STRING = Schema( - id=ShapeID("com.amazonaws.lexruntimev2#NonEmptyString"), shape_type=ShapeType.STRING -) - -EVENT_ID = Schema( - id=ShapeID("com.amazonaws.lexruntimev2#EventId"), shape_type=ShapeType.STRING -) - -AUDIO_INPUT_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#AudioInputEvent"), - members={ - "audioChunk": {"target": AUDIO_CHUNK}, - "contentType": { - "target": NON_EMPTY_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "eventId": {"target": EVENT_ID}, - "clientTimestampMillis": { - "target": EPOCH_MILLIS, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - }, -) - -AUDIO_RESPONSE_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#AudioResponseEvent"), - members={ - "audioChunk": {"target": AUDIO_CHUNK}, - "contentType": {"target": NON_EMPTY_STRING}, - "eventId": {"target": EVENT_ID}, - }, -) - -CONFLICT_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#ConflictException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=409), - ], - members={ - "message": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -BOT_ALIAS_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.lexruntimev2#BotAliasIdentifier"), - shape_type=ShapeType.STRING, -) - -BOT_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.lexruntimev2#BotIdentifier"), shape_type=ShapeType.STRING -) - -LOCALE_ID = Schema( - id=ShapeID("com.amazonaws.lexruntimev2#LocaleId"), shape_type=ShapeType.STRING -) - -SESSION_ID = Schema( - id=ShapeID("com.amazonaws.lexruntimev2#SessionId"), shape_type=ShapeType.STRING -) - -DELETE_SESSION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#DeleteSessionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lexruntimev2#DeleteSessionRequest", - ) - ], - members={ - "botId": { - "target": BOT_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "botAliasId": { - "target": BOT_ALIAS_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "localeId": { - "target": LOCALE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "sessionId": { - "target": SESSION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -DELETE_SESSION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#DeleteSessionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lexruntimev2#DeleteSessionResponse", - ) - ], - members={ - "botId": {"target": BOT_IDENTIFIER}, - "botAliasId": {"target": BOT_ALIAS_IDENTIFIER}, - "localeId": {"target": LOCALE_ID}, - "sessionId": {"target": SESSION_ID}, - }, -) - -INTERNAL_SERVER_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#InternalServerException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="server"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=500), - ], - members={ - "message": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -RESOURCE_NOT_FOUND_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#ResourceNotFoundException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=404), - ], - members={ - "message": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -THROTTLING_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#ThrottlingException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=429), - ], - members={ - "message": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -VALIDATION_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#ValidationException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={ - "message": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -DELETE_SESSION = Schema( - id=ShapeID("com.amazonaws.lexruntimev2#DeleteSession"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/bots/{botId}/botAliases/{botAliasId}/botLocales/{localeId}/sessions/{sessionId}", - "code": 200, - } - ), - ) - ], -) - -GET_SESSION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#GetSessionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lexruntimev2#GetSessionRequest", - ) - ], - members={ - "botId": { - "target": BOT_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "botAliasId": { - "target": BOT_ALIAS_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "localeId": { - "target": LOCALE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "sessionId": { - "target": SESSION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -CONFIRMATION_STATE = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#ConfirmationState"), - shape_type=ShapeType.ENUM, - members={ - "CONFIRMED": {"target": UNIT}, - "DENIED": {"target": UNIT}, - "NONE": {"target": UNIT}, - }, -) - -SHAPE = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#Shape"), - shape_type=ShapeType.ENUM, - members={ - "SCALAR": {"target": UNIT}, - "LIST": {"target": UNIT}, - "COMPOSITE": {"target": UNIT}, - }, -) - -STRING_LIST = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#StringList"), - shape_type=ShapeType.LIST, - members={"member": {"target": NON_EMPTY_STRING}}, -) - -VALUE = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#Value"), - members={ - "originalValue": {"target": NON_EMPTY_STRING}, - "interpretedValue": { - "target": NON_EMPTY_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "resolvedValues": {"target": STRING_LIST}, - }, -) - -INTENT_STATE = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#IntentState"), - shape_type=ShapeType.ENUM, - members={ - "FAILED": {"target": UNIT}, - "FULFILLED": {"target": UNIT}, - "IN_PROGRESS": {"target": UNIT}, - "READY_FOR_FULFILLMENT": {"target": UNIT}, - "WAITING": {"target": UNIT}, - "FULFILLMENT_IN_PROGRESS": {"target": UNIT}, - }, -) - -INTERPRETATION_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#InterpretationSource"), - shape_type=ShapeType.ENUM, - members={"BEDROCK": {"target": UNIT}, "LEX": {"target": UNIT}}, -) - -DOUBLE = Schema( - id=ShapeID("com.amazonaws.lexruntimev2#Double"), - shape_type=ShapeType.DOUBLE, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=0)], -) - -CONFIDENCE_SCORE = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#ConfidenceScore"), - members={ - "score": { - "target": DOUBLE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - } - }, -) - -SENTIMENT_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#SentimentType"), - shape_type=ShapeType.ENUM, - members={ - "MIXED": {"target": UNIT}, - "NEGATIVE": {"target": UNIT}, - "NEUTRAL": {"target": UNIT}, - "POSITIVE": {"target": UNIT}, - }, -) - -SENTIMENT_SCORE = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#SentimentScore"), - members={ - "positive": { - "target": DOUBLE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "negative": { - "target": DOUBLE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "neutral": { - "target": DOUBLE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "mixed": { - "target": DOUBLE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - }, -) - -SENTIMENT_RESPONSE = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#SentimentResponse"), - members={ - "sentiment": {"target": SENTIMENT_TYPE}, - "sentimentScore": {"target": SENTIMENT_SCORE}, - }, -) - -MESSAGE_CONTENT_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#MessageContentType"), - shape_type=ShapeType.ENUM, - members={ - "CUSTOM_PAYLOAD": {"target": UNIT}, - "IMAGE_RESPONSE_CARD": {"target": UNIT}, - "PLAIN_TEXT": {"target": UNIT}, - "SSML": {"target": UNIT}, - }, -) - -BUTTON_TEXT = Schema( - id=ShapeID("com.amazonaws.lexruntimev2#ButtonText"), shape_type=ShapeType.STRING -) - -BUTTON_VALUE = Schema( - id=ShapeID("com.amazonaws.lexruntimev2#ButtonValue"), shape_type=ShapeType.STRING -) - -BUTTON = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#Button"), - members={ - "text": { - "target": BUTTON_TEXT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "value": { - "target": BUTTON_VALUE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +from smithy_core._schema_compact import StaticOperationSchema, StaticSchema + + +n0 = "com.amazonaws.lexruntimev2" +_S = "String" +_ADE = "AccessDeniedException" +_s = "smithy.api#error" +_c = "client" +_sE = "smithy.api#httpError" +_m = "message" +_sm = "smithy.api#required" +_PN = "ParameterName" +_T = "Text" +_smi = "smithy.api#sensitive" +_ACPM = "ActiveContextParametersMap" +_k = "key" +_v = "value" +_ACN = "ActiveContextName" +_ACTTLIS = "ActiveContextTimeToLiveInSeconds" +_ACTTL = "ActiveContextTurnsToLive" +_ACTTLc = "ActiveContextTimeToLive" +_tTLIS = "timeToLiveInSeconds" +_tTL = "turnsToLive" +_AC = "ActiveContext" +_n = "name" +_tTLi = "timeToLive" +_cA = "contextAttributes" +_ACL = "ActiveContextsList" +_me = "member" +_AT = "AttachmentTitle" +_AU = "AttachmentUrl" +_ACu = "AudioChunk" +_EM = "EpochMillis" +_smit = "smithy.api#default" +_NES = "NonEmptyString" +_EI = "EventId" +_AIE = "AudioInputEvent" +_aC = "audioChunk" +_cT = "contentType" +_eI = "eventId" +_cTM = "clientTimestampMillis" +_ARE = "AudioResponseEvent" +_CE = "ConflictException" +_BAI = "BotAliasIdentifier" +_BI = "BotIdentifier" +_LI = "LocaleId" +_SI = "SessionId" +_DSI = "DeleteSessionInput" +_sSI = "smithy.synthetic#originalShapeId" +_cDSR = "com.amazonaws.lexruntimev2#DeleteSessionRequest" +_smith = "smithy.api#input" +_bI = "botId" +_sL = "smithy.api#httpLabel" +_bAI = "botAliasId" +_lI = "localeId" +_sI = "sessionId" +_DSO = "DeleteSessionOutput" +_cDSRo = "com.amazonaws.lexruntimev2#DeleteSessionResponse" +_smithy = "smithy.api#output" +_ISE = "InternalServerException" +_se = "server" +_RNFE = "ResourceNotFoundException" +_TE = "ThrottlingException" +_VE = "ValidationException" +_DS = "DeleteSession" +_smithya = "smithy.api#http" +_GSI = "GetSessionInput" +_cGSR = "com.amazonaws.lexruntimev2#GetSessionRequest" +_CS = "ConfirmationState" +_CONFIRMED = "CONFIRMED" +_sV = "smithy.api#enumValue" +_C = "Confirmed" +_DENIED = "DENIED" +_D = "Denied" +_NONE = "NONE" +_N = "None" +_Sh = "Shape" +_SCALAR = "SCALAR" +_Sc = "Scalar" +_LIST = "LIST" +_L = "List" +_COMPOSITE = "COMPOSITE" +_Co = "Composite" +_SL = "StringList" +_V = "Value" +_oV = "originalValue" +_iV = "interpretedValue" +_rV = "resolvedValues" +_IS = "IntentState" +_FAILED = "FAILED" +_F = "Failed" +_FULFILLED = "FULFILLED" +_Fu = "Fulfilled" +_IP = "IN_PROGRESS" +_IPn = "InProgress" +_RFF = "READY_FOR_FULFILLMENT" +_RFFe = "ReadyForFulfillment" +_WAITING = "WAITING" +_W = "Waiting" +_FIP = "FULFILLMENT_IN_PROGRESS" +_FIPu = "FulfillmentInProgress" +_ISn = "InterpretationSource" +_BEDROCK = "BEDROCK" +_B = "Bedrock" +_LEX = "LEX" +_Le = "Lex" +_Do = "Double" +_CSo = "ConfidenceScore" +_sc = "score" +_ST = "SentimentType" +_MIXED = "MIXED" +_NEGATIVE = "NEGATIVE" +_NEUTRAL = "NEUTRAL" +_POSITIVE = "POSITIVE" +_SS = "SentimentScore" +_p = "positive" +_ne = "negative" +_neu = "neutral" +_mi = "mixed" +_SR = "SentimentResponse" +_sen = "sentiment" +_sS = "sentimentScore" +_MCT = "MessageContentType" +_CP = "CUSTOM_PAYLOAD" +_CPu = "CustomPayload" +_IRC = "IMAGE_RESPONSE_CARD" +_IRCm = "ImageResponseCard" +_PT = "PLAIN_TEXT" +_PTl = "PlainText" +_SSML = "SSML" +_BT = "ButtonText" +_BV = "ButtonValue" +_Bu = "Button" +_t = "text" +_BL = "ButtonsList" +_ti = "title" +_su = "subtitle" +_iU = "imageUrl" +_b = "buttons" +_M = "Message" +_co = "content" +_iRC = "imageResponseCard" +_Me = "Messages" +_STt = "StyleType" +_DEFAULT = "DEFAULT" +_De = "Default" +_SBL = "SPELL_BY_LETTER" +_SBLp = "SpellByLetter" +_SBW = "SPELL_BY_WORD" +_SBWp = "SpellByWord" +_DAT = "DialogActionType" +_CLOSE = "CLOSE" +_Cl = "Close" +_CI = "CONFIRM_INTENT" +_CIo = "ConfirmIntent" +_DELEGATE = "DELEGATE" +_Del = "Delegate" +_EI_ = "ELICIT_INTENT" +_EIl = "ElicitIntent" +_ES = "ELICIT_SLOT" +_ESl = "ElicitSlot" +_Na = "Name" +_RHP = "RuntimeHintPhrase" +_RHV = "RuntimeHintValue" +_ph = "phrase" +_RHVL = "RuntimeHintValuesList" +_SM = "StringMap" +_BGE = "BadGatewayException" +_DFE = "DependencyFailedException" +_BS = "BlobStream" +_smithyap = "smithy.api#streaming" +_PSO = "PutSessionOutput" +_cPSR = "com.amazonaws.lexruntimev2#PutSessionResponse" +_sH = "smithy.api#httpHeader" +_CT = "Content-Type" +_mes = "messages" +_xalm = "x-amz-lex-messages" +_sSe = "sessionState" +_xalss = "x-amz-lex-session-state" +_rA = "requestAttributes" +_xalra = "x-amz-lex-request-attributes" +_xalsi = "x-amz-lex-session-id" +_aS = "audioStream" +_v_ = "" +_sP = "smithy.api#httpPayload" +_RBM = "RecognizedBotMember" +_bN = "botName" +_SNES = "SensitiveNonEmptyString" +_RUI = "RecognizeUtteranceInput" +_cRUR = "com.amazonaws.lexruntimev2#RecognizeUtteranceRequest" +_rCT = "requestContentType" +_rCTe = "responseContentType" +_RCT = "Response-Content-Type" +_iS = "inputStream" +_RUO = "RecognizeUtteranceOutput" +_cRURo = "com.amazonaws.lexruntimev2#RecognizeUtteranceResponse" +_iM = "inputMode" +_xalim = "x-amz-lex-input-mode" +_i = "interpretations" +_xali = "x-amz-lex-interpretations" +_iT = "inputTranscript" +_xalit = "x-amz-lex-input-transcript" +_rBM = "recognizedBotMember" +_xalrbm = "x-amz-lex-recognized-bot-member" +_RU = "RecognizeUtterance" +_aP = "aws.auth#unsignedPayload" +_CM = "ConversationMode" +_AUDIO = "AUDIO" +_TEXT = "TEXT" +_Bo = "Boolean" +_DE = "DisconnectionEvent" +_DTMFR = "DTMFRegex" +_DTMFIE = "DTMFInputEvent" +_iC = "inputCharacter" +_PCE = "PlaybackCompletionEvent" +_TIE = "TextInputEvent" +_HE = "HeartbeatEvent" +_IM = "InputMode" +_SPEECH = "SPEECH" +_Sp = "Speech" +_DTMF = "DTMF" +_PIR = "PlaybackInterruptionReason" +_DSD = "DTMF_START_DETECTED" +_TD = "TEXT_DETECTED" +_VSD = "VOICE_START_DETECTED" +_PIE = "PlaybackInterruptionEvent" +_eR = "eventReason" +_cBEI = "causedByEventId" +_TRE = "TextResponseEvent" +_TEr = "TranscriptEvent" +_tr = "transcript" +_ESS = "ElicitSubSlot" +_sSTE = "subSlotToElicit" +_DA = "DialogAction" +_ty = "type" +_sTE = "slotToElicit" +_sES = "slotElicitationStyle" +_RHD = "RuntimeHintDetails" +_rHV = "runtimeHintValues" +_sSH = "subSlotHints" +_SHSM = "SlotHintsSlotMap" +_SHIM = "SlotHintsIntentMap" +_RH = "RuntimeHints" +_sHl = "slotHints" +_Sl = "Slot" +_sh = "shape" +_va = "values" +_sSu = "subSlots" +_Slo = "Slots" +_Va = "Values" +_I = "Intent" +_sl = "slots" +_st = "state" +_cS = "confirmationState" +_In = "Interpretation" +_nC = "nluConfidence" +_sR = "sentimentResponse" +_in = "intent" +_iSn = "interpretationSource" +_Int = "Interpretations" +_SSe = "SessionState" +_dA = "dialogAction" +_aCc = "activeContexts" +_sA = "sessionAttributes" +_oRI = "originatingRequestId" +_rH = "runtimeHints" +_CEo = "ConfigurationEvent" +_wM = "welcomeMessages" +_dP = "disablePlayback" +_PSI = "PutSessionInput" +_cPSRo = "com.amazonaws.lexruntimev2#PutSessionRequest" +_RCTe = "ResponseContentType" +_RTI = "RecognizeTextInput" +_cRTR = "com.amazonaws.lexruntimev2#RecognizeTextRequest" +_PS = "PutSession" +_SCRES = "StartConversationRequestEventStream" +_SCI = "StartConversationInput" +_cSCR = "com.amazonaws.lexruntimev2#StartConversationRequest" +_cM = "conversationMode" +_xalcm = "x-amz-lex-conversation-mode" +_rES = "requestEventStream" +_GSO = "GetSessionOutput" +_cGSRo = "com.amazonaws.lexruntimev2#GetSessionResponse" +_IRE = "IntentResultEvent" +_RTO = "RecognizeTextOutput" +_cRTRo = "com.amazonaws.lexruntimev2#RecognizeTextResponse" +_GS = "GetSession" +_SCRESt = "StartConversationResponseEventStream" +_SCO = "StartConversationOutput" +_cSCRo = "com.amazonaws.lexruntimev2#StartConversationResponse" +_rESe = "responseEventStream" +_RT = "RecognizeText" +_SC = "StartConversation" +_A = "AWSDeepSenseRunTimeServiceApi2_0" +_a = "aws.auth#sigv4" +_sB = "smithy.rules#endpointBdd" +_aw = "aws.api#service" +_aJ = "aws.protocols#restJson1" + +STRING: StaticSchema = (3, n0, _S, 0) + +ACCESS_DENIED_EXCEPTION: StaticSchema = ( + 18, + n0, + _ADE, + {_s: _c, _sE: 403}, + (_m,), + ((STRING, 1),), +) + +PARAMETER_NAME: StaticSchema = (3, n0, _PN, 0) + +TEXT: StaticSchema = (3, n0, _T, 4) + +ACTIVE_CONTEXT_PARAMETERS_MAP: StaticSchema = ( + 17, + n0, + _ACPM, + 0, + (_k, _v), + ((PARAMETER_NAME, 0), (TEXT, 0)), +) + +ACTIVE_CONTEXT_NAME: StaticSchema = (3, n0, _ACN, 0) + +ACTIVE_CONTEXT_TIME_TO_LIVE_IN_SECONDS: StaticSchema = (7, n0, _ACTTLIS, 0) + +ACTIVE_CONTEXT_TURNS_TO_LIVE: StaticSchema = (7, n0, _ACTTL, 0) + +ACTIVE_CONTEXT_TIME_TO_LIVE: StaticSchema = ( + 18, + n0, + _ACTTLc, + 0, + (_tTLIS, _tTL), + ((ACTIVE_CONTEXT_TIME_TO_LIVE_IN_SECONDS, 1), (ACTIVE_CONTEXT_TURNS_TO_LIVE, 1)), +) + +ACTIVE_CONTEXT: StaticSchema = ( + 18, + n0, + _AC, + 0, + (_n, _tTLi, _cA), + ( + (ACTIVE_CONTEXT_NAME, 1), + (ACTIVE_CONTEXT_TIME_TO_LIVE, 1), + (ACTIVE_CONTEXT_PARAMETERS_MAP, 1), + ), +) + +ACTIVE_CONTEXTS_LIST: StaticSchema = (16, n0, _ACL, 0, (_me,), ((ACTIVE_CONTEXT, 0),)) + +ATTACHMENT_TITLE: StaticSchema = (3, n0, _AT, 0) + +ATTACHMENT_URL: StaticSchema = (3, n0, _AU, 0) + +AUDIO_CHUNK: StaticSchema = (1, n0, _ACu, 0) + +EPOCH_MILLIS: StaticSchema = (8, n0, _EM, {_smit: 0}) + +NON_EMPTY_STRING: StaticSchema = (3, n0, _NES, 0) + +EVENT_ID: StaticSchema = (3, n0, _EI, 0) + +AUDIO_INPUT_EVENT: StaticSchema = ( + 18, + n0, + _AIE, + 0, + (_aC, _cT, _eI, _cTM), + ( + (AUDIO_CHUNK, 0), + (NON_EMPTY_STRING, 1), + (EVENT_ID, 0), + (EPOCH_MILLIS, {_smit: 0}), + ), +) + +AUDIO_RESPONSE_EVENT: StaticSchema = ( + 18, + n0, + _ARE, + 0, + (_aC, _cT, _eI), + ((AUDIO_CHUNK, 0), (NON_EMPTY_STRING, 0), (EVENT_ID, 0)), +) + +CONFLICT_EXCEPTION: StaticSchema = ( + 18, + n0, + _CE, + {_s: _c, _sE: 409}, + (_m,), + ((STRING, 1),), ) -BUTTONS_LIST = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#ButtonsList"), - shape_type=ShapeType.LIST, - members={"member": {"target": BUTTON}}, -) +BOT_ALIAS_IDENTIFIER: StaticSchema = (3, n0, _BAI, 0) -IMAGE_RESPONSE_CARD = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#ImageResponseCard"), - members={ - "title": { - "target": ATTACHMENT_TITLE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "subtitle": {"target": ATTACHMENT_TITLE}, - "imageUrl": {"target": ATTACHMENT_URL}, - "buttons": {"target": BUTTONS_LIST}, - }, -) +BOT_IDENTIFIER: StaticSchema = (3, n0, _BI, 0) -MESSAGE = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#Message"), - members={ - "content": {"target": TEXT}, - "contentType": { - "target": MESSAGE_CONTENT_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "imageResponseCard": {"target": IMAGE_RESPONSE_CARD}, - }, -) +LOCALE_ID: StaticSchema = (3, n0, _LI, 0) -MESSAGES = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#Messages"), - shape_type=ShapeType.LIST, - members={"member": {"target": MESSAGE}}, -) - -STYLE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#StyleType"), - shape_type=ShapeType.ENUM, - members={ - "DEFAULT": {"target": UNIT}, - "SPELL_BY_LETTER": {"target": UNIT}, - "SPELL_BY_WORD": {"target": UNIT}, - }, -) +SESSION_ID: StaticSchema = (3, n0, _SI, 0) -DIALOG_ACTION_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#DialogActionType"), - shape_type=ShapeType.ENUM, - members={ - "CLOSE": {"target": UNIT}, - "CONFIRM_INTENT": {"target": UNIT}, - "DELEGATE": {"target": UNIT}, - "ELICIT_INTENT": {"target": UNIT}, - "ELICIT_SLOT": {"target": UNIT}, - "NONE": {"target": UNIT}, - }, -) - -NAME = Schema( - id=ShapeID("com.amazonaws.lexruntimev2#Name"), shape_type=ShapeType.STRING -) - -RUNTIME_HINT_PHRASE = Schema( - id=ShapeID("com.amazonaws.lexruntimev2#RuntimeHintPhrase"), - shape_type=ShapeType.STRING, -) - -RUNTIME_HINT_VALUE = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#RuntimeHintValue"), - members={ - "phrase": { - "target": RUNTIME_HINT_PHRASE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -RUNTIME_HINT_VALUES_LIST = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#RuntimeHintValuesList"), - shape_type=ShapeType.LIST, - members={"member": {"target": RUNTIME_HINT_VALUE}}, -) - -STRING_MAP = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#StringMap"), - shape_type=ShapeType.MAP, - members={"key": {"target": NON_EMPTY_STRING}, "value": {"target": STRING}}, -) - -BAD_GATEWAY_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#BadGatewayException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="server"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=502), - ], - members={ - "message": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -DEPENDENCY_FAILED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#DependencyFailedException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=424), - ], - members={ - "message": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -BLOB_STREAM = Schema( - id=ShapeID("com.amazonaws.lexruntimev2#BlobStream"), - shape_type=ShapeType.BLOB, - traits=[Trait.new(id=ShapeID("smithy.api#streaming"))], -) - -PUT_SESSION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#PutSessionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lexruntimev2#PutSessionResponse", - ) - ], - members={ - "contentType": { - "target": NON_EMPTY_STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="Content-Type") - ], - }, - "messages": { - "target": NON_EMPTY_STRING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), value="x-amz-lex-messages" - ) - ], - }, - "sessionState": { - "target": NON_EMPTY_STRING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), value="x-amz-lex-session-state" - ) - ], - }, - "requestAttributes": { - "target": NON_EMPTY_STRING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amz-lex-request-attributes", - ) - ], - }, - "sessionId": { - "target": SESSION_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), value="x-amz-lex-session-id" - ) - ], - }, - "audioStream": { - "target": BLOB_STREAM, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=""), - Trait.new(id=ShapeID("smithy.api#httpPayload")), - ], - }, - }, -) - -RECOGNIZED_BOT_MEMBER = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#RecognizedBotMember"), - members={ - "botId": { - "target": BOT_IDENTIFIER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "botName": {"target": NAME}, - }, +DELETE_SESSION_INPUT: StaticSchema = ( + 18, + n0, + _DSI, + {_sSI: _cDSR, _smith: None}, + (_bI, _bAI, _lI, _sI), + ((BOT_IDENTIFIER, 9), (BOT_ALIAS_IDENTIFIER, 9), (LOCALE_ID, 9), (SESSION_ID, 9)), ) -SENSITIVE_NON_EMPTY_STRING = Schema( - id=ShapeID("com.amazonaws.lexruntimev2#SensitiveNonEmptyString"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +DELETE_SESSION_OUTPUT: StaticSchema = ( + 18, + n0, + _DSO, + {_sSI: _cDSRo, _smithy: None}, + (_bI, _bAI, _lI, _sI), + ((BOT_IDENTIFIER, 0), (BOT_ALIAS_IDENTIFIER, 0), (LOCALE_ID, 0), (SESSION_ID, 0)), ) -RECOGNIZE_UTTERANCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#RecognizeUtteranceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lexruntimev2#RecognizeUtteranceRequest", - ) - ], - members={ - "botId": { - "target": BOT_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "botAliasId": { - "target": BOT_ALIAS_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "localeId": { - "target": LOCALE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "sessionId": { - "target": SESSION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "sessionState": { - "target": SENSITIVE_NON_EMPTY_STRING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), value="x-amz-lex-session-state" - ) - ], - }, - "requestAttributes": { - "target": SENSITIVE_NON_EMPTY_STRING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amz-lex-request-attributes", - ) - ], - }, - "requestContentType": { - "target": NON_EMPTY_STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="Content-Type"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "responseContentType": { - "target": NON_EMPTY_STRING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), value="Response-Content-Type" - ) - ], - }, - "inputStream": { - "target": BLOB_STREAM, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=""), - Trait.new(id=ShapeID("smithy.api#httpPayload")), - ], - }, - }, +INTERNAL_SERVER_EXCEPTION: StaticSchema = ( + 18, + n0, + _ISE, + {_s: _se, _sE: 500}, + (_m,), + ((STRING, 1),), +) + +RESOURCE_NOT_FOUND_EXCEPTION: StaticSchema = ( + 18, + n0, + _RNFE, + {_s: _c, _sE: 404}, + (_m,), + ((STRING, 1),), +) + +THROTTLING_EXCEPTION: StaticSchema = ( + 18, + n0, + _TE, + {_s: _c, _sE: 429}, + (_m,), + ((STRING, 1),), ) -RECOGNIZE_UTTERANCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#RecognizeUtteranceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lexruntimev2#RecognizeUtteranceResponse", +VALIDATION_EXCEPTION: StaticSchema = ( + 18, + n0, + _VE, + {_s: _c, _sE: 400}, + (_m,), + ((STRING, 1),), +) + +DELETE_SESSION: StaticOperationSchema = ( + 23, + n0, + _DS, + { + _smithya: MappingProxyType( + { + "method": "DELETE", + "uri": "/bots/{botId}/botAliases/{botAliasId}/botLocales/{localeId}/sessions/{sessionId}", + "code": 200, + } ) - ], - members={ - "inputMode": { - "target": NON_EMPTY_STRING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), value="x-amz-lex-input-mode" - ) - ], - }, - "contentType": { - "target": NON_EMPTY_STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="Content-Type") - ], - }, - "messages": { - "target": NON_EMPTY_STRING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), value="x-amz-lex-messages" - ) - ], - }, - "interpretations": { - "target": NON_EMPTY_STRING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amz-lex-interpretations", - ) - ], - }, - "sessionState": { - "target": NON_EMPTY_STRING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), value="x-amz-lex-session-state" - ) - ], - }, - "requestAttributes": { - "target": NON_EMPTY_STRING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amz-lex-request-attributes", - ) - ], - }, - "sessionId": { - "target": SESSION_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), value="x-amz-lex-session-id" - ) - ], - }, - "inputTranscript": { - "target": NON_EMPTY_STRING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amz-lex-input-transcript", - ) - ], - }, - "audioStream": { - "target": BLOB_STREAM, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=""), - Trait.new(id=ShapeID("smithy.api#httpPayload")), - ], - }, - "recognizedBotMember": { - "target": NON_EMPTY_STRING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amz-lex-recognized-bot-member", - ) - ], - }, }, -) - -RECOGNIZE_UTTERANCE = Schema( - id=ShapeID("com.amazonaws.lexruntimev2#RecognizeUtterance"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new(id=ShapeID("aws.auth#unsignedPayload")), - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/bots/{botId}/botAliases/{botAliasId}/botLocales/{localeId}/sessions/{sessionId}/utterance", - "code": 200, - } - ), + DELETE_SESSION_INPUT, + DELETE_SESSION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), +) + +GET_SESSION_INPUT: StaticSchema = ( + 18, + n0, + _GSI, + {_sSI: _cGSR, _smith: None}, + (_bI, _bAI, _lI, _sI), + ((BOT_IDENTIFIER, 9), (BOT_ALIAS_IDENTIFIER, 9), (LOCALE_ID, 9), (SESSION_ID, 9)), +) + +CONFIRMATION_STATE: StaticSchema = ( + 14, + n0, + _CS, + 0, + (_CONFIRMED, _DENIED, _NONE), + ((-1, {_sV: _C}), (-1, {_sV: _D}), (-1, {_sV: _N})), +) + +SHAPE: StaticSchema = ( + 14, + n0, + _Sh, + 0, + (_SCALAR, _LIST, _COMPOSITE), + ((-1, {_sV: _Sc}), (-1, {_sV: _L}), (-1, {_sV: _Co})), +) + +STRING_LIST: StaticSchema = (16, n0, _SL, 0, (_me,), ((NON_EMPTY_STRING, 0),)) + +VALUE: StaticSchema = ( + 18, + n0, + _V, + 0, + (_oV, _iV, _rV), + ((NON_EMPTY_STRING, 0), (NON_EMPTY_STRING, 1), (STRING_LIST, 0)), +) + +INTENT_STATE: StaticSchema = ( + 14, + n0, + _IS, + 0, + (_FAILED, _FULFILLED, _IP, _RFF, _WAITING, _FIP), + ( + (-1, {_sV: _F}), + (-1, {_sV: _Fu}), + (-1, {_sV: _IPn}), + (-1, {_sV: _RFFe}), + (-1, {_sV: _W}), + (-1, {_sV: _FIPu}), + ), +) + +INTERPRETATION_SOURCE: StaticSchema = ( + 14, + n0, + _ISn, + 0, + (_BEDROCK, _LEX), + ((-1, {_sV: _B}), (-1, {_sV: _Le})), +) + +DOUBLE: StaticSchema = (10, n0, _Do, {_smit: 0}) + +CONFIDENCE_SCORE: StaticSchema = (18, n0, _CSo, 0, (_sc,), ((DOUBLE, {_smit: 0}),)) + +SENTIMENT_TYPE: StaticSchema = ( + 14, + n0, + _ST, + 0, + (_MIXED, _NEGATIVE, _NEUTRAL, _POSITIVE), + ( + (-1, {_sV: _MIXED}), + (-1, {_sV: _NEGATIVE}), + (-1, {_sV: _NEUTRAL}), + (-1, {_sV: _POSITIVE}), + ), +) + +SENTIMENT_SCORE: StaticSchema = ( + 18, + n0, + _SS, + 0, + (_p, _ne, _neu, _mi), + ( + (DOUBLE, {_smit: 0}), + (DOUBLE, {_smit: 0}), + (DOUBLE, {_smit: 0}), + (DOUBLE, {_smit: 0}), + ), +) + +SENTIMENT_RESPONSE: StaticSchema = ( + 18, + n0, + _SR, + 0, + (_sen, _sS), + ((SENTIMENT_TYPE, 0), (SENTIMENT_SCORE, 0)), +) + +MESSAGE_CONTENT_TYPE: StaticSchema = ( + 14, + n0, + _MCT, + 0, + (_CP, _IRC, _PT, _SSML), + ((-1, {_sV: _CPu}), (-1, {_sV: _IRCm}), (-1, {_sV: _PTl}), (-1, {_sV: _SSML})), +) + +BUTTON_TEXT: StaticSchema = (3, n0, _BT, 0) + +BUTTON_VALUE: StaticSchema = (3, n0, _BV, 0) + +BUTTON: StaticSchema = (18, n0, _Bu, 0, (_t, _v), ((BUTTON_TEXT, 1), (BUTTON_VALUE, 1))) + +BUTTONS_LIST: StaticSchema = (16, n0, _BL, 0, (_me,), ((BUTTON, 0),)) + +IMAGE_RESPONSE_CARD: StaticSchema = ( + 18, + n0, + _IRCm, + 0, + (_ti, _su, _iU, _b), + ( + (ATTACHMENT_TITLE, 1), + (ATTACHMENT_TITLE, 0), + (ATTACHMENT_URL, 0), + (BUTTONS_LIST, 0), + ), +) + +MESSAGE: StaticSchema = ( + 18, + n0, + _M, + 0, + (_co, _cT, _iRC), + ((TEXT, 0), (MESSAGE_CONTENT_TYPE, 1), (IMAGE_RESPONSE_CARD, 0)), +) + +MESSAGES: StaticSchema = (16, n0, _Me, 0, (_me,), ((MESSAGE, 0),)) + +STYLE_TYPE: StaticSchema = ( + 14, + n0, + _STt, + 0, + (_DEFAULT, _SBL, _SBW), + ((-1, {_sV: _De}), (-1, {_sV: _SBLp}), (-1, {_sV: _SBWp})), +) + +DIALOG_ACTION_TYPE: StaticSchema = ( + 14, + n0, + _DAT, + 0, + (_CLOSE, _CI, _DELEGATE, _EI_, _ES, _NONE), + ( + (-1, {_sV: _Cl}), + (-1, {_sV: _CIo}), + (-1, {_sV: _Del}), + (-1, {_sV: _EIl}), + (-1, {_sV: _ESl}), + (-1, {_sV: _N}), + ), +) + +NAME: StaticSchema = (3, n0, _Na, 0) + +RUNTIME_HINT_PHRASE: StaticSchema = (3, n0, _RHP, 0) + +RUNTIME_HINT_VALUE: StaticSchema = ( + 18, + n0, + _RHV, + 0, + (_ph,), + ((RUNTIME_HINT_PHRASE, 1),), +) + +RUNTIME_HINT_VALUES_LIST: StaticSchema = ( + 16, + n0, + _RHVL, + 0, + (_me,), + ((RUNTIME_HINT_VALUE, 0),), +) + +STRING_MAP: StaticSchema = ( + 17, + n0, + _SM, + 0, + (_k, _v), + ((NON_EMPTY_STRING, 0), (STRING, 0)), +) + +BAD_GATEWAY_EXCEPTION: StaticSchema = ( + 18, + n0, + _BGE, + {_s: _se, _sE: 502}, + (_m,), + ((STRING, 1),), +) + +DEPENDENCY_FAILED_EXCEPTION: StaticSchema = ( + 18, + n0, + _DFE, + {_s: _c, _sE: 424}, + (_m,), + ((STRING, 1),), +) + +BLOB_STREAM: StaticSchema = (1, n0, _BS, {_smithyap: None}) + +PUT_SESSION_OUTPUT: StaticSchema = ( + 18, + n0, + _PSO, + {_sSI: _cPSR, _smithy: None}, + (_cT, _mes, _sSe, _rA, _sI, _aS), + ( + (NON_EMPTY_STRING, {_sH: _CT}), + (NON_EMPTY_STRING, {_sH: _xalm}), + (NON_EMPTY_STRING, {_sH: _xalss}), + (NON_EMPTY_STRING, {_sH: _xalra}), + (SESSION_ID, {_sH: _xalsi}), + (BLOB_STREAM, {_smit: _v_, _sP: None}), + ), +) + +RECOGNIZED_BOT_MEMBER: StaticSchema = ( + 18, + n0, + _RBM, + 0, + (_bI, _bN), + ((BOT_IDENTIFIER, 1), (NAME, 0)), +) + +SENSITIVE_NON_EMPTY_STRING: StaticSchema = (3, n0, _SNES, 4) + +RECOGNIZE_UTTERANCE_INPUT: StaticSchema = ( + 18, + n0, + _RUI, + {_sSI: _cRUR, _smith: None}, + (_bI, _bAI, _lI, _sI, _sSe, _rA, _rCT, _rCTe, _iS), + ( + (BOT_IDENTIFIER, 9), + (BOT_ALIAS_IDENTIFIER, 9), + (LOCALE_ID, 9), + (SESSION_ID, 9), + (SENSITIVE_NON_EMPTY_STRING, {_sH: _xalss}), + (SENSITIVE_NON_EMPTY_STRING, {_sH: _xalra}), + (NON_EMPTY_STRING, {_sH: _CT, _sm: None}), + (NON_EMPTY_STRING, {_sH: _RCT}), + (BLOB_STREAM, {_smit: _v_, _sP: None}), + ), +) + +RECOGNIZE_UTTERANCE_OUTPUT: StaticSchema = ( + 18, + n0, + _RUO, + {_sSI: _cRURo, _smithy: None}, + (_iM, _cT, _mes, _i, _sSe, _rA, _sI, _iT, _aS, _rBM), + ( + (NON_EMPTY_STRING, {_sH: _xalim}), + (NON_EMPTY_STRING, {_sH: _CT}), + (NON_EMPTY_STRING, {_sH: _xalm}), + (NON_EMPTY_STRING, {_sH: _xali}), + (NON_EMPTY_STRING, {_sH: _xalss}), + (NON_EMPTY_STRING, {_sH: _xalra}), + (SESSION_ID, {_sH: _xalsi}), + (NON_EMPTY_STRING, {_sH: _xalit}), + (BLOB_STREAM, {_smit: _v_, _sP: None}), + (NON_EMPTY_STRING, {_sH: _xalrbm}), + ), +) + +RECOGNIZE_UTTERANCE: StaticOperationSchema = ( + 23, + n0, + _RU, + { + _aP: None, + _smithya: MappingProxyType( + { + "method": "POST", + "uri": "/bots/{botId}/botAliases/{botAliasId}/botLocales/{localeId}/sessions/{sessionId}/utterance", + "code": 200, + } ), - ], -) - -CONVERSATION_MODE = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#ConversationMode"), - shape_type=ShapeType.ENUM, - members={"AUDIO": {"target": UNIT}, "TEXT": {"target": UNIT}}, -) - -BOOLEAN = Schema( - id=ShapeID("com.amazonaws.lexruntimev2#Boolean"), - shape_type=ShapeType.BOOLEAN, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=False)], -) - -DISCONNECTION_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#DisconnectionEvent"), - members={ - "eventId": {"target": EVENT_ID}, - "clientTimestampMillis": { - "target": EPOCH_MILLIS, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - }, -) - -DTMF_REGEX = Schema( - id=ShapeID("com.amazonaws.lexruntimev2#DTMFRegex"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -DTMF_INPUT_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#DTMFInputEvent"), - members={ - "inputCharacter": { - "target": DTMF_REGEX, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "eventId": {"target": EVENT_ID}, - "clientTimestampMillis": { - "target": EPOCH_MILLIS, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, }, -) - -PLAYBACK_COMPLETION_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#PlaybackCompletionEvent"), - members={ - "eventId": {"target": EVENT_ID}, - "clientTimestampMillis": { - "target": EPOCH_MILLIS, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - }, -) - -TEXT_INPUT_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#TextInputEvent"), - members={ - "text": { - "target": TEXT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "eventId": {"target": EVENT_ID}, - "clientTimestampMillis": { - "target": EPOCH_MILLIS, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - }, -) - -HEARTBEAT_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#HeartbeatEvent"), - members={"eventId": {"target": EVENT_ID}}, -) - -INPUT_MODE = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#InputMode"), - shape_type=ShapeType.ENUM, - members={ - "TEXT": {"target": UNIT}, - "SPEECH": {"target": UNIT}, - "DTMF": {"target": UNIT}, - }, -) - -PLAYBACK_INTERRUPTION_REASON = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#PlaybackInterruptionReason"), - shape_type=ShapeType.ENUM, - members={ - "DTMF_START_DETECTED": {"target": UNIT}, - "TEXT_DETECTED": {"target": UNIT}, - "VOICE_START_DETECTED": {"target": UNIT}, - }, -) - -PLAYBACK_INTERRUPTION_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#PlaybackInterruptionEvent"), - members={ - "eventReason": {"target": PLAYBACK_INTERRUPTION_REASON}, - "causedByEventId": {"target": EVENT_ID}, - "eventId": {"target": EVENT_ID}, - }, -) - -TEXT_RESPONSE_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#TextResponseEvent"), - members={"messages": {"target": MESSAGES}, "eventId": {"target": EVENT_ID}}, -) - -TRANSCRIPT_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#TranscriptEvent"), - members={"transcript": {"target": STRING}, "eventId": {"target": EVENT_ID}}, -) - -ELICIT_SUB_SLOT = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#ElicitSubSlot"), - members={ - "name": { - "target": NON_EMPTY_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - # This needs to reference a schema that isn't defined yet. - # It will be populated with a non-null value at the end of the file. - "subSlotToElicit": None, - }, -) - -DIALOG_ACTION = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#DialogAction"), - members={ - "type": { - "target": DIALOG_ACTION_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "slotToElicit": {"target": NON_EMPTY_STRING}, - "slotElicitationStyle": {"target": STYLE_TYPE}, - "subSlotToElicit": {"target": ELICIT_SUB_SLOT}, - }, -) - -RUNTIME_HINT_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#RuntimeHintDetails"), - members={ - "runtimeHintValues": {"target": RUNTIME_HINT_VALUES_LIST}, - # This needs to reference a schema that isn't defined yet. - # It will be populated with a non-null value at the end of the file. - "subSlotHints": None, - }, -) - -SLOT_HINTS_SLOT_MAP = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#SlotHintsSlotMap"), - shape_type=ShapeType.MAP, - members={"key": {"target": NAME}, "value": {"target": RUNTIME_HINT_DETAILS}}, -) - -SLOT_HINTS_INTENT_MAP = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#SlotHintsIntentMap"), - shape_type=ShapeType.MAP, - members={"key": {"target": NAME}, "value": {"target": SLOT_HINTS_SLOT_MAP}}, -) - -RUNTIME_HINTS = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#RuntimeHints"), - members={"slotHints": {"target": SLOT_HINTS_INTENT_MAP}}, -) - -SLOT = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#Slot"), - members={ - "value": {"target": VALUE}, - "shape": {"target": SHAPE}, - # This needs to reference a schema that isn't defined yet. - # It will be populated with a non-null value at the end of the file. - "values": None, - # This needs to reference a schema that isn't defined yet. - # It will be populated with a non-null value at the end of the file. - "subSlots": None, - }, -) - -SLOTS = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#Slots"), - shape_type=ShapeType.MAP, - members={"key": {"target": NON_EMPTY_STRING}, "value": {"target": SLOT}}, -) - -VALUES = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#Values"), - shape_type=ShapeType.LIST, - members={"member": {"target": SLOT}}, -) - -INTENT = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#Intent"), - members={ - "name": { - "target": NON_EMPTY_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "slots": {"target": SLOTS}, - "state": {"target": INTENT_STATE}, - "confirmationState": {"target": CONFIRMATION_STATE}, - }, -) - -INTERPRETATION = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#Interpretation"), - members={ - "nluConfidence": {"target": CONFIDENCE_SCORE}, - "sentimentResponse": {"target": SENTIMENT_RESPONSE}, - "intent": {"target": INTENT}, - "interpretationSource": {"target": INTERPRETATION_SOURCE}, - }, -) - -INTERPRETATIONS = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#Interpretations"), - shape_type=ShapeType.LIST, - members={"member": {"target": INTERPRETATION}}, -) - -SESSION_STATE = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#SessionState"), - members={ - "dialogAction": {"target": DIALOG_ACTION}, - "intent": {"target": INTENT}, - "activeContexts": {"target": ACTIVE_CONTEXTS_LIST}, - "sessionAttributes": {"target": STRING_MAP}, - "originatingRequestId": {"target": NON_EMPTY_STRING}, - "runtimeHints": {"target": RUNTIME_HINTS}, - }, -) - -CONFIGURATION_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#ConfigurationEvent"), - members={ - "requestAttributes": {"target": STRING_MAP}, - "responseContentType": { - "target": NON_EMPTY_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "sessionState": {"target": SESSION_STATE}, - "welcomeMessages": {"target": MESSAGES}, - "disablePlayback": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "eventId": {"target": EVENT_ID}, - "clientTimestampMillis": { - "target": EPOCH_MILLIS, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - }, -) - -PUT_SESSION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#PutSessionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lexruntimev2#PutSessionRequest", + RECOGNIZE_UTTERANCE_INPUT, + RECOGNIZE_UTTERANCE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + BAD_GATEWAY_EXCEPTION, + CONFLICT_EXCEPTION, + DEPENDENCY_FAILED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), +) + +CONVERSATION_MODE: StaticSchema = ( + 14, + n0, + _CM, + 0, + (_AUDIO, _TEXT), + ((-1, {_sV: _AUDIO}), (-1, {_sV: _TEXT})), +) + +BOOLEAN: StaticSchema = (2, n0, _Bo, {_smit: False}) + +DISCONNECTION_EVENT: StaticSchema = ( + 18, + n0, + _DE, + 0, + (_eI, _cTM), + ((EVENT_ID, 0), (EPOCH_MILLIS, {_smit: 0})), +) + +DTMF_REGEX: StaticSchema = (3, n0, _DTMFR, 4) + +DTMF_INPUT_EVENT: StaticSchema = ( + 18, + n0, + _DTMFIE, + 0, + (_iC, _eI, _cTM), + ((DTMF_REGEX, 1), (EVENT_ID, 0), (EPOCH_MILLIS, {_smit: 0})), +) + +PLAYBACK_COMPLETION_EVENT: StaticSchema = ( + 18, + n0, + _PCE, + 0, + (_eI, _cTM), + ((EVENT_ID, 0), (EPOCH_MILLIS, {_smit: 0})), +) + +TEXT_INPUT_EVENT: StaticSchema = ( + 18, + n0, + _TIE, + 0, + (_t, _eI, _cTM), + ((TEXT, 1), (EVENT_ID, 0), (EPOCH_MILLIS, {_smit: 0})), +) + +HEARTBEAT_EVENT: StaticSchema = (18, n0, _HE, 0, (_eI,), ((EVENT_ID, 0),)) + +INPUT_MODE: StaticSchema = ( + 14, + n0, + _IM, + 0, + (_TEXT, _SPEECH, _DTMF), + ((-1, {_sV: _T}), (-1, {_sV: _Sp}), (-1, {_sV: _DTMF})), +) + +PLAYBACK_INTERRUPTION_REASON: StaticSchema = ( + 14, + n0, + _PIR, + 0, + (_DSD, _TD, _VSD), + ((-1, {_sV: _DSD}), (-1, {_sV: _TD}), (-1, {_sV: _VSD})), +) + +PLAYBACK_INTERRUPTION_EVENT: StaticSchema = ( + 18, + n0, + _PIE, + 0, + (_eR, _cBEI, _eI), + ((PLAYBACK_INTERRUPTION_REASON, 0), (EVENT_ID, 0), (EVENT_ID, 0)), +) + +TEXT_RESPONSE_EVENT: StaticSchema = ( + 18, + n0, + _TRE, + 0, + (_mes, _eI), + ((MESSAGES, 0), (EVENT_ID, 0)), +) + +TRANSCRIPT_EVENT: StaticSchema = ( + 18, + n0, + _TEr, + 0, + (_tr, _eI), + ((STRING, 0), (EVENT_ID, 0)), +) + +ELICIT_SUB_SLOT: StaticSchema = ( + 18, + n0, + _ESS, + 0, + (_n, _sSTE), + ((NON_EMPTY_STRING, 1), (lambda: ELICIT_SUB_SLOT, 0)), +) + +DIALOG_ACTION: StaticSchema = ( + 18, + n0, + _DA, + 0, + (_ty, _sTE, _sES, _sSTE), + ( + (DIALOG_ACTION_TYPE, 1), + (NON_EMPTY_STRING, 0), + (STYLE_TYPE, 0), + (ELICIT_SUB_SLOT, 0), + ), +) + +RUNTIME_HINT_DETAILS: StaticSchema = ( + 18, + n0, + _RHD, + 0, + (_rHV, _sSH), + ((RUNTIME_HINT_VALUES_LIST, 0), (lambda: SLOT_HINTS_SLOT_MAP, 0)), +) + +SLOT_HINTS_SLOT_MAP: StaticSchema = ( + 17, + n0, + _SHSM, + 0, + (_k, _v), + ((NAME, 0), (RUNTIME_HINT_DETAILS, 0)), +) + +SLOT_HINTS_INTENT_MAP: StaticSchema = ( + 17, + n0, + _SHIM, + 0, + (_k, _v), + ((NAME, 0), (SLOT_HINTS_SLOT_MAP, 0)), +) + +RUNTIME_HINTS: StaticSchema = (18, n0, _RH, 0, (_sHl,), ((SLOT_HINTS_INTENT_MAP, 0),)) + +SLOT: StaticSchema = ( + 18, + n0, + _Sl, + 0, + (_v, _sh, _va, _sSu), + ((VALUE, 0), (SHAPE, 0), (lambda: VALUES, 0), (lambda: SLOTS, 0)), +) + +SLOTS: StaticSchema = (17, n0, _Slo, 0, (_k, _v), ((NON_EMPTY_STRING, 0), (SLOT, 0))) + +VALUES: StaticSchema = (16, n0, _Va, 0, (_me,), ((SLOT, 0),)) + +INTENT: StaticSchema = ( + 18, + n0, + _I, + 0, + (_n, _sl, _st, _cS), + ((NON_EMPTY_STRING, 1), (SLOTS, 0), (INTENT_STATE, 0), (CONFIRMATION_STATE, 0)), +) + +INTERPRETATION: StaticSchema = ( + 18, + n0, + _In, + 0, + (_nC, _sR, _in, _iSn), + ( + (CONFIDENCE_SCORE, 0), + (SENTIMENT_RESPONSE, 0), + (INTENT, 0), + (INTERPRETATION_SOURCE, 0), + ), +) + +INTERPRETATIONS: StaticSchema = (16, n0, _Int, 0, (_me,), ((INTERPRETATION, 0),)) + +SESSION_STATE: StaticSchema = ( + 18, + n0, + _SSe, + 0, + (_dA, _in, _aCc, _sA, _oRI, _rH), + ( + (DIALOG_ACTION, 0), + (INTENT, 0), + (ACTIVE_CONTEXTS_LIST, 0), + (STRING_MAP, 0), + (NON_EMPTY_STRING, 0), + (RUNTIME_HINTS, 0), + ), +) + +CONFIGURATION_EVENT: StaticSchema = ( + 18, + n0, + _CEo, + 0, + (_rA, _rCTe, _sSe, _wM, _dP, _eI, _cTM), + ( + (STRING_MAP, 0), + (NON_EMPTY_STRING, 1), + (SESSION_STATE, 0), + (MESSAGES, 0), + (BOOLEAN, {_smit: False}), + (EVENT_ID, 0), + (EPOCH_MILLIS, {_smit: 0}), + ), +) + +PUT_SESSION_INPUT: StaticSchema = ( + 18, + n0, + _PSI, + {_sSI: _cPSRo, _smith: None}, + (_bI, _bAI, _lI, _sI, _mes, _sSe, _rA, _rCTe), + ( + (BOT_IDENTIFIER, 9), + (BOT_ALIAS_IDENTIFIER, 9), + (LOCALE_ID, 9), + (SESSION_ID, 9), + (MESSAGES, 0), + (SESSION_STATE, 1), + (STRING_MAP, 0), + (NON_EMPTY_STRING, {_sH: _RCTe}), + ), +) + +RECOGNIZE_TEXT_INPUT: StaticSchema = ( + 18, + n0, + _RTI, + {_sSI: _cRTR, _smith: None}, + (_bI, _bAI, _lI, _sI, _t, _sSe, _rA), + ( + (BOT_IDENTIFIER, 9), + (BOT_ALIAS_IDENTIFIER, 9), + (LOCALE_ID, 9), + (SESSION_ID, 9), + (TEXT, 1), + (SESSION_STATE, 0), + (STRING_MAP, 0), + ), +) + +PUT_SESSION: StaticOperationSchema = ( + 23, + n0, + _PS, + { + _smithya: MappingProxyType( + { + "method": "POST", + "uri": "/bots/{botId}/botAliases/{botAliasId}/botLocales/{localeId}/sessions/{sessionId}", + "code": 200, + } ) - ], - members={ - "botId": { - "target": BOT_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "botAliasId": { - "target": BOT_ALIAS_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "localeId": { - "target": LOCALE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "sessionId": { - "target": SESSION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "messages": {"target": MESSAGES}, - "sessionState": { - "target": SESSION_STATE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "requestAttributes": {"target": STRING_MAP}, - "responseContentType": { - "target": NON_EMPTY_STRING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), value="ResponseContentType" - ) - ], - }, }, -) - -RECOGNIZE_TEXT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#RecognizeTextInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lexruntimev2#RecognizeTextRequest", + PUT_SESSION_INPUT, + PUT_SESSION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + BAD_GATEWAY_EXCEPTION, + CONFLICT_EXCEPTION, + DEPENDENCY_FAILED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), +) + +START_CONVERSATION_REQUEST_EVENT_STREAM: StaticSchema = ( + 19, + n0, + _SCRES, + {_smithyap: None}, + (_CEo, _AIE, _DTMFIE, _TIE, _PCE, _DE), + ( + (CONFIGURATION_EVENT, 0), + (AUDIO_INPUT_EVENT, 0), + (DTMF_INPUT_EVENT, 0), + (TEXT_INPUT_EVENT, 0), + (PLAYBACK_COMPLETION_EVENT, 0), + (DISCONNECTION_EVENT, 0), + ), +) + +START_CONVERSATION_INPUT: StaticSchema = ( + 18, + n0, + _SCI, + {_sSI: _cSCR, _smith: None}, + (_bI, _bAI, _lI, _sI, _cM, _rES), + ( + (BOT_IDENTIFIER, 9), + (BOT_ALIAS_IDENTIFIER, 9), + (LOCALE_ID, 9), + (SESSION_ID, 9), + (CONVERSATION_MODE, {_sH: _xalcm}), + (START_CONVERSATION_REQUEST_EVENT_STREAM, 17), + ), +) + +GET_SESSION_OUTPUT: StaticSchema = ( + 18, + n0, + _GSO, + {_sSI: _cGSRo, _smithy: None}, + (_sI, _mes, _i, _sSe), + ((NON_EMPTY_STRING, 0), (MESSAGES, 0), (INTERPRETATIONS, 0), (SESSION_STATE, 0)), +) + +INTENT_RESULT_EVENT: StaticSchema = ( + 18, + n0, + _IRE, + 0, + (_iM, _i, _sSe, _rA, _sI, _eI, _rBM), + ( + (INPUT_MODE, 0), + (INTERPRETATIONS, 0), + (SESSION_STATE, 0), + (STRING_MAP, 0), + (SESSION_ID, 0), + (EVENT_ID, 0), + (RECOGNIZED_BOT_MEMBER, 0), + ), +) + +RECOGNIZE_TEXT_OUTPUT: StaticSchema = ( + 18, + n0, + _RTO, + {_sSI: _cRTRo, _smithy: None}, + (_mes, _sSe, _i, _rA, _sI, _rBM), + ( + (MESSAGES, 0), + (SESSION_STATE, 0), + (INTERPRETATIONS, 0), + (STRING_MAP, 0), + (SESSION_ID, 0), + (RECOGNIZED_BOT_MEMBER, 0), + ), +) + +GET_SESSION: StaticOperationSchema = ( + 23, + n0, + _GS, + { + _smithya: MappingProxyType( + { + "method": "GET", + "uri": "/bots/{botId}/botAliases/{botAliasId}/botLocales/{localeId}/sessions/{sessionId}", + "code": 200, + } ) - ], - members={ - "botId": { - "target": BOT_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "botAliasId": { - "target": BOT_ALIAS_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "localeId": { - "target": LOCALE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "sessionId": { - "target": SESSION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "text": { - "target": TEXT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "sessionState": {"target": SESSION_STATE}, - "requestAttributes": {"target": STRING_MAP}, }, -) - -PUT_SESSION = Schema( - id=ShapeID("com.amazonaws.lexruntimev2#PutSession"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/bots/{botId}/botAliases/{botAliasId}/botLocales/{localeId}/sessions/{sessionId}", - "code": 200, - } - ), + GET_SESSION_INPUT, + GET_SESSION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), +) + +START_CONVERSATION_RESPONSE_EVENT_STREAM: StaticSchema = ( + 19, + n0, + _SCRESt, + {_smithyap: None}, + (_PIE, _TEr, _IRE, _TRE, _ARE, _HE, _ADE, _RNFE, _VE, _TE, _ISE, _CE, _DFE, _BGE), + ( + (PLAYBACK_INTERRUPTION_EVENT, 0), + (TRANSCRIPT_EVENT, 0), + (INTENT_RESULT_EVENT, 0), + (TEXT_RESPONSE_EVENT, 0), + (AUDIO_RESPONSE_EVENT, 0), + (HEARTBEAT_EVENT, 0), + (ACCESS_DENIED_EXCEPTION, 0), + (RESOURCE_NOT_FOUND_EXCEPTION, 0), + (VALIDATION_EXCEPTION, 0), + (THROTTLING_EXCEPTION, 0), + (INTERNAL_SERVER_EXCEPTION, 0), + (CONFLICT_EXCEPTION, 0), + (DEPENDENCY_FAILED_EXCEPTION, 0), + (BAD_GATEWAY_EXCEPTION, 0), + ), +) + +START_CONVERSATION_OUTPUT: StaticSchema = ( + 18, + n0, + _SCO, + {_sSI: _cSCRo, _smithy: None}, + (_rESe,), + ((START_CONVERSATION_RESPONSE_EVENT_STREAM, 16),), +) + +RECOGNIZE_TEXT: StaticOperationSchema = ( + 23, + n0, + _RT, + { + _smithya: MappingProxyType( + { + "method": "POST", + "uri": "/bots/{botId}/botAliases/{botAliasId}/botLocales/{localeId}/sessions/{sessionId}/text", + "code": 200, + } ) - ], -) - -START_CONVERSATION_REQUEST_EVENT_STREAM = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#StartConversationRequestEventStream"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#streaming"))], - members={ - "ConfigurationEvent": {"target": CONFIGURATION_EVENT}, - "AudioInputEvent": {"target": AUDIO_INPUT_EVENT}, - "DTMFInputEvent": {"target": DTMF_INPUT_EVENT}, - "TextInputEvent": {"target": TEXT_INPUT_EVENT}, - "PlaybackCompletionEvent": {"target": PLAYBACK_COMPLETION_EVENT}, - "DisconnectionEvent": {"target": DISCONNECTION_EVENT}, }, -) - -START_CONVERSATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#StartConversationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lexruntimev2#StartConversationRequest", + RECOGNIZE_TEXT_INPUT, + RECOGNIZE_TEXT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + BAD_GATEWAY_EXCEPTION, + CONFLICT_EXCEPTION, + DEPENDENCY_FAILED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), +) + +START_CONVERSATION: StaticOperationSchema = ( + 23, + n0, + _SC, + { + _smithya: MappingProxyType( + { + "method": "POST", + "uri": "/bots/{botId}/botAliases/{botAliasId}/botLocales/{localeId}/sessions/{sessionId}/conversation", + "code": 200, + } ) - ], - members={ - "botId": { - "target": BOT_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "botAliasId": { - "target": BOT_ALIAS_IDENTIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "localeId": { - "target": LOCALE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "sessionId": { - "target": SESSION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "conversationMode": { - "target": CONVERSATION_MODE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amz-lex-conversation-mode", - ) - ], - }, - "requestEventStream": { - "target": START_CONVERSATION_REQUEST_EVENT_STREAM, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpPayload")), - ], - }, }, -) - -GET_SESSION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#GetSessionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lexruntimev2#GetSessionResponse", - ) - ], - members={ - "sessionId": {"target": NON_EMPTY_STRING}, - "messages": {"target": MESSAGES}, - "interpretations": {"target": INTERPRETATIONS}, - "sessionState": {"target": SESSION_STATE}, - }, -) - -INTENT_RESULT_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#IntentResultEvent"), - members={ - "inputMode": {"target": INPUT_MODE}, - "interpretations": {"target": INTERPRETATIONS}, - "sessionState": {"target": SESSION_STATE}, - "requestAttributes": {"target": STRING_MAP}, - "sessionId": {"target": SESSION_ID}, - "eventId": {"target": EVENT_ID}, - "recognizedBotMember": {"target": RECOGNIZED_BOT_MEMBER}, - }, -) - -RECOGNIZE_TEXT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#RecognizeTextOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lexruntimev2#RecognizeTextResponse", - ) - ], - members={ - "messages": {"target": MESSAGES}, - "sessionState": {"target": SESSION_STATE}, - "interpretations": {"target": INTERPRETATIONS}, - "requestAttributes": {"target": STRING_MAP}, - "sessionId": {"target": SESSION_ID}, - "recognizedBotMember": {"target": RECOGNIZED_BOT_MEMBER}, - }, -) - -GET_SESSION = Schema( - id=ShapeID("com.amazonaws.lexruntimev2#GetSession"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/bots/{botId}/botAliases/{botAliasId}/botLocales/{localeId}/sessions/{sessionId}", - "code": 200, - } - ), - ) - ], -) - -START_CONVERSATION_RESPONSE_EVENT_STREAM = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#StartConversationResponseEventStream"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#streaming"))], - members={ - "PlaybackInterruptionEvent": {"target": PLAYBACK_INTERRUPTION_EVENT}, - "TranscriptEvent": {"target": TRANSCRIPT_EVENT}, - "IntentResultEvent": {"target": INTENT_RESULT_EVENT}, - "TextResponseEvent": {"target": TEXT_RESPONSE_EVENT}, - "AudioResponseEvent": {"target": AUDIO_RESPONSE_EVENT}, - "HeartbeatEvent": {"target": HEARTBEAT_EVENT}, - "AccessDeniedException": {"target": ACCESS_DENIED_EXCEPTION}, - "ResourceNotFoundException": {"target": RESOURCE_NOT_FOUND_EXCEPTION}, - "ValidationException": {"target": VALIDATION_EXCEPTION}, - "ThrottlingException": {"target": THROTTLING_EXCEPTION}, - "InternalServerException": {"target": INTERNAL_SERVER_EXCEPTION}, - "ConflictException": {"target": CONFLICT_EXCEPTION}, - "DependencyFailedException": {"target": DEPENDENCY_FAILED_EXCEPTION}, - "BadGatewayException": {"target": BAD_GATEWAY_EXCEPTION}, - }, -) - -START_CONVERSATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.lexruntimev2#StartConversationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.lexruntimev2#StartConversationResponse", - ) - ], - members={ - "responseEventStream": { - "target": START_CONVERSATION_RESPONSE_EVENT_STREAM, - "traits": [Trait.new(id=ShapeID("smithy.api#httpPayload"))], - } - }, -) - -RECOGNIZE_TEXT = Schema( - id=ShapeID("com.amazonaws.lexruntimev2#RecognizeText"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/bots/{botId}/botAliases/{botAliasId}/botLocales/{localeId}/sessions/{sessionId}/text", - "code": 200, - } - ), - ) - ], -) - -START_CONVERSATION = Schema( - id=ShapeID("com.amazonaws.lexruntimev2#StartConversation"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/bots/{botId}/botAliases/{botAliasId}/botLocales/{localeId}/sessions/{sessionId}/conversation", - "code": 200, - } - ), - ) - ], -) - -AWS_DEEP_SENSE_RUN_TIME_SERVICE_API2_0 = Schema( - id=ShapeID("com.amazonaws.lexruntimev2#AWSDeepSenseRunTimeServiceApi2_0"), - shape_type=ShapeType.SERVICE, - traits=[ - Trait.new( - id=ShapeID("aws.auth#sigv4"), value=MappingProxyType({"name": "lex"}) - ), - Trait.new( - id=ShapeID("smithy.rules#endpointBdd"), - value=MappingProxyType( - { - "version": "1.1", - "parameters": MappingProxyType( - { - "Region": MappingProxyType( - { - "builtIn": "AWS::Region", - "required": False, - "documentation": "The AWS region used to dispatch the request.", - "type": "string", - } - ), - "UseDualStack": MappingProxyType( - { - "builtIn": "AWS::UseDualStack", - "required": True, - "default": False, - "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", - "type": "boolean", - } - ), - "UseFIPS": MappingProxyType( - { - "builtIn": "AWS::UseFIPS", - "required": True, - "default": False, - "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", - "type": "boolean", - } - ), - "Endpoint": MappingProxyType( - { - "builtIn": "SDK::Endpoint", - "required": False, - "documentation": "Override the endpoint used to send this request", - "type": "string", - } - ), - } - ), - "conditions": ( - MappingProxyType( - { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "Endpoint"}),), - } - ), - MappingProxyType( + START_CONVERSATION_INPUT, + START_CONVERSATION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), +) + +AWS_DEEP_SENSE_RUN_TIME_SERVICE_API2_0: StaticSchema = ( + 21, + n0, + _A, + { + _a: MappingProxyType({"name": "lex"}), + _sB: MappingProxyType( + { + "version": "1.1", + "parameters": MappingProxyType( + { + "Region": MappingProxyType( { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "Region"}),), + "builtIn": "AWS::Region", + "required": False, + "documentation": "The AWS region used to dispatch the request.", + "type": "string", } ), - MappingProxyType( + "UseDualStack": MappingProxyType( { - "fn": "aws.partition", - "argv": (MappingProxyType({"ref": "Region"}),), - "assign": "PartitionResult", + "builtIn": "AWS::UseDualStack", + "required": True, + "default": False, + "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", + "type": "boolean", } ), - MappingProxyType( + "UseFIPS": MappingProxyType( { - "fn": "booleanEquals", - "argv": (MappingProxyType({"ref": "UseFIPS"}), True), + "builtIn": "AWS::UseFIPS", + "required": True, + "default": False, + "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", + "type": "boolean", } ), - MappingProxyType( + "Endpoint": MappingProxyType( { - "fn": "booleanEquals", - "argv": ( - MappingProxyType({"ref": "UseDualStack"}), - True, - ), - } - ), - MappingProxyType( - { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "supportsDualStack", - ), - } - ), - True, - ), - } - ), - MappingProxyType( - { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "supportsFIPS", - ), - } - ), - True, - ), + "builtIn": "SDK::Endpoint", + "required": False, + "documentation": "Override the endpoint used to send this request", + "type": "string", } ), + } + ), + "conditions": ( + MappingProxyType( + { + "fn": "isSet", + "argv": (MappingProxyType({"ref": "Endpoint"}),), + } ), - "results": ( - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: FIPS and custom endpoint are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": MappingProxyType({"ref": "Endpoint"}), - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://runtime-v2-lex-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "FIPS and DualStack are enabled, but this partition does not support one or both", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://runtime-v2-lex-fips.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "FIPS is enabled but this partition does not support FIPS", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + MappingProxyType( + {"fn": "isSet", "argv": (MappingProxyType({"ref": "Region"}),)} + ), + MappingProxyType( + { + "fn": "aws.partition", + "argv": (MappingProxyType({"ref": "Region"}),), + "assign": "PartitionResult", + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": (MappingProxyType({"ref": "UseFIPS"}), True), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": (MappingProxyType({"ref": "UseDualStack"}), True), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( { - "url": "https://runtime-v2-lex.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "supportsDualStack", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "DualStack is enabled but this partition does not support DualStack", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + True, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( { - "url": "https://runtime-v2-lex.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "supportsFIPS", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: Missing Region", - "type": "error", - } - ), + True, + ), + } ), - "root": 2, - "nodeCount": 13, - "nodes": "/////wAAAAH/////AAAAAAAAAAwAAAADAAAAAQAAAAQF9eELAAAAAgAAAAUF9eELAAAAAwAAAAgAAAAGAAAABAAAAAcF9eEKAAAABQX14QgF9eEJAAAABAAAAAoAAAAJAAAABgX14QYF9eEHAAAABQAAAAsF9eEFAAAABgX14QQF9eEFAAAAAwX14QEAAAANAAAABAX14QIF9eED", - } - ), - ), - Trait.new( - id=ShapeID("aws.api#service"), - value=MappingProxyType( - { - "sdkId": "Lex Runtime V2", - "arnNamespace": "lex", - "cloudFormationName": "LexRuntimeV2", - "cloudTrailEventSource": "lexruntimev2.amazonaws.com", - "docId": "runtime.lex.v2-2020-08-07", - "endpointPrefix": "runtime-v2-lex", - } - ), + ), + "results": ( + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: FIPS and custom endpoint are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": MappingProxyType({"ref": "Endpoint"}), + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://runtime-v2-lex-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS and DualStack are enabled, but this partition does not support one or both", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://runtime-v2-lex-fips.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS is enabled but this partition does not support FIPS", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://runtime-v2-lex.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "DualStack is enabled but this partition does not support DualStack", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://runtime-v2-lex.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Missing Region", + "type": "error", + } + ), + ), + "root": 2, + "nodeCount": 13, + "nodes": "/////wAAAAH/////AAAAAAAAAAwAAAADAAAAAQAAAAQF9eELAAAAAgAAAAUF9eELAAAAAwAAAAgAAAAGAAAABAAAAAcF9eEKAAAABQX14QgF9eEJAAAABAAAAAoAAAAJAAAABgX14QYF9eEHAAAABQAAAAsF9eEFAAAABgX14QQF9eEFAAAAAwX14QEAAAANAAAABAX14QIF9eED", + } ), - Trait.new( - id=ShapeID("aws.protocols#restJson1"), - value=MappingProxyType( - {"http": ("http/1.1", "h2"), "eventStreamHttp": ("h2",)} - ), + _aw: MappingProxyType( + { + "sdkId": "Lex Runtime V2", + "arnNamespace": "lex", + "cloudFormationName": "LexRuntimeV2", + "cloudTrailEventSource": "lexruntimev2.amazonaws.com", + "docId": "runtime.lex.v2-2020-08-07", + "endpointPrefix": "runtime-v2-lex", + } ), - ], -) - -ELICIT_SUB_SLOT.members["subSlotToElicit"] = Schema.member( - id=ELICIT_SUB_SLOT.id.with_member("subSlotToElicit"), - target=ELICIT_SUB_SLOT, - index=1, -) - -RUNTIME_HINT_DETAILS.members["subSlotHints"] = Schema.member( - id=RUNTIME_HINT_DETAILS.id.with_member("subSlotHints"), - target=SLOT_HINTS_SLOT_MAP, - index=1, -) - -SLOT.members["subSlots"] = Schema.member( - id=SLOT.id.with_member("subSlots"), target=SLOTS, index=3 -) - -SLOT.members["values"] = Schema.member( - id=SLOT.id.with_member("values"), target=VALUES, index=2 + _aJ: MappingProxyType({"http": ("http/1.1", "h2"), "eventStreamHttp": ("h2",)}), + }, ) diff --git a/clients/aws-sdk-lex-runtime-v2/src/aws_sdk_lex_runtime_v2/client.py b/clients/aws-sdk-lex-runtime-v2/src/aws_sdk_lex_runtime_v2/client.py index 38d0e830..91f0d9e7 100644 --- a/clients/aws-sdk-lex-runtime-v2/src/aws_sdk_lex_runtime_v2/client.py +++ b/clients/aws-sdk-lex-runtime-v2/src/aws_sdk_lex_runtime_v2/client.py @@ -1,38 +1,30 @@ # Code generated by smithy-python-codegen DO NOT EDIT. +from __future__ import annotations + from copy import deepcopy import logging from typing import Any, cast +from smithy_aws_core.aio.identity.chain import AsyncIdentityChain from smithy_aws_core.config import ConfigSource from smithy_aws_core.identity import AWSCredentialsIdentity -from smithy_aws_core.identity.chain import IdentityChain -from smithy_core.aio.client import AsyncClient, ClientCall, RequestPipeline -from smithy_core.aio.eventstream import DuplexEventStream +from smithy_core.aio.client import AsyncClient, AsyncClientCall, AsyncRequestPipeline +from smithy_core.aio.eventstream import AsyncDuplexEventStream from smithy_core.deserializers import DeserializeableShape from smithy_core.exceptions import ExpectationNotMetError from smithy_core.schemas import APIOperation from smithy_core.serializers import SerializeableShape -from smithy_http.aio.interfaces import HTTPClient +from smithy_http.aio.interfaces import AsyncHTTPClient from smithy_http.plugins import user_agent_plugin from .config import AsyncLexRuntimeV2Config, Plugin from .models import ( DELETE_SESSION, - DeleteSessionInput, - DeleteSessionOutput, GET_SESSION, - GetSessionInput, - GetSessionOutput, PUT_SESSION, - PutSessionInput, - PutSessionOutput, RECOGNIZE_TEXT, RECOGNIZE_UTTERANCE, - RecognizeTextInput, - RecognizeTextOutput, - RecognizeUtteranceInput, - RecognizeUtteranceOutput, START_CONVERSATION, StartConversationInput, StartConversationOutput, @@ -42,6 +34,22 @@ ) from .user_agent import aws_user_agent_plugin +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .models import ( + DeleteSessionInput, + DeleteSessionOutput, + GetSessionInput, + GetSessionOutput, + PutSessionInput, + PutSessionOutput, + RecognizeTextInput, + RecognizeTextOutput, + RecognizeUtteranceInput, + RecognizeUtteranceOutput, + ) + logger = logging.getLogger(__name__) @@ -110,12 +118,12 @@ async def _post_setup(self, config: AsyncLexRuntimeV2Config) -> None: config_file = await config_context.parsed_profiles() if config_context.profile_source is ConfigSource.OVERRIDE: profile_name = config_context.profile_name - config.aws_credentials_identity_resolver = await IdentityChain.create( + config.aws_credentials_identity_resolver = await AsyncIdentityChain.create( AWSCredentialsIdentity, config_file=config_file, profile_name=profile_name, region_override=config.region, - http_client=cast(HTTPClient | None, config.transport), + http_client=cast(AsyncHTTPClient | None, config.transport), ) async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( @@ -124,7 +132,7 @@ async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( operation: APIOperation[I, O], default_plugins: list[Plugin], plugins: list[Plugin] | None, - ) -> tuple[RequestPipeline[Any, Any], ClientCall[I, O]]: + ) -> tuple[AsyncRequestPipeline[Any, Any], AsyncClientCall[I, O]]: if self._closed: raise RuntimeError( "Cannot invoke an operation on a client that has been closed." @@ -365,7 +373,7 @@ async def recognize_utterance( async def start_conversation( self, input: StartConversationInput, plugins: list[Plugin] | None = None - ) -> DuplexEventStream[ + ) -> AsyncDuplexEventStream[ StartConversationRequestEventStream, StartConversationResponseEventStream, StartConversationOutput, @@ -430,7 +438,7 @@ async def start_conversation( invocations. Returns: - A `DuplexEventStream` for bidirectional streaming. + An `AsyncDuplexEventStream` for bidirectional streaming. """ pipeline, call = await self._prepare_call( input, START_CONVERSATION, [], plugins diff --git a/clients/aws-sdk-lex-runtime-v2/src/aws_sdk_lex_runtime_v2/config.py b/clients/aws-sdk-lex-runtime-v2/src/aws_sdk_lex_runtime_v2/config.py index 6dddf03f..ec1eef03 100644 --- a/clients/aws-sdk-lex-runtime-v2/src/aws_sdk_lex_runtime_v2/config.py +++ b/clients/aws-sdk-lex-runtime-v2/src/aws_sdk_lex_runtime_v2/config.py @@ -1,68 +1,82 @@ # Code generated by smithy-python-codegen DO NOT EDIT. from dataclasses import dataclass, field -from typing import Any, Callable, ClassVar, Self, TypeAlias, Union, Unpack +from typing import ( + Any, + Callable, + ClassVar, + Self, + TYPE_CHECKING, + TypeAlias, + Union, + Unpack, +) -from smithy_aws_core.aio.protocols import RestJsonClientProtocol -from smithy_aws_core.auth import SigV4AuthScheme -from smithy_aws_core.config import AwsConfigOverrides, FileSystem -from smithy_aws_core.config.aws_config import AsyncAwsConfig -from smithy_aws_core.config.resolvers import EndpointUriResolver -from smithy_aws_core.config.types import FieldSpec -from smithy_aws_core.endpoints.standard_regional import ( - StandardRegionalEndpointsResolver, +from smithy_aws_core.aio.auth.sigv4 import AsyncSigV4AuthScheme +from smithy_aws_core.aio.config import AsyncFileSystem +from smithy_aws_core.aio.config.aws_config import AsyncAwsConfig, AwsConfigOverrides +from smithy_aws_core.aio.config.resolvers import EndpointUriResolver +from smithy_aws_core.aio.endpoints.standard_regional import ( + AsyncStandardRegionalEndpointsResolver, ) +from smithy_aws_core.aio.protocols import AsyncRestJsonClientProtocol +from smithy_aws_core.config.types import FieldSpec from smithy_aws_core.identity import AWSCredentialsIdentity, AWSIdentityProperties -from smithy_core.aio.interfaces import ( - ClientProtocol, - EndpointResolver, - ProtocolConstructor, - ProtocolSettings, -) -from smithy_core.aio.interfaces.auth import AuthScheme -from smithy_core.aio.interfaces.identity import IdentityResolver -from smithy_core.interceptors import Interceptor +from smithy_core.aio.interfaces import AsyncClientProtocol, AsyncEndpointResolver +from smithy_core.aio.interfaces.auth import AsyncAuthScheme +from smithy_core.aio.interfaces.identity import AsyncIdentityResolver +from smithy_core.interfaces import ProtocolConstructor, ProtocolSettings from smithy_core.interfaces.auth import AuthSchemeResolver from smithy_core.shapes import ShapeID from smithy_http.aio.aiohttp import AIOHTTPClient +from ._private.schemas import AWS_DEEP_SENSE_RUN_TIME_SERVICE_API2_0 from .auth import HTTPAuthSchemeResolver -from .models import ( - DeleteSessionInput, - DeleteSessionOutput, - GetSessionInput, - GetSessionOutput, - PutSessionInput, - PutSessionOutput, - RecognizeTextInput, - RecognizeTextOutput, - RecognizeUtteranceInput, - RecognizeUtteranceOutput, - StartConversationInput, - StartConversationOutput, -) -_ServiceInterceptor = Union[ - Interceptor[DeleteSessionInput, DeleteSessionOutput, Any, Any], - Interceptor[GetSessionInput, GetSessionOutput, Any, Any], - Interceptor[PutSessionInput, PutSessionOutput, Any, Any], - Interceptor[RecognizeTextInput, RecognizeTextOutput, Any, Any], - Interceptor[RecognizeUtteranceInput, RecognizeUtteranceOutput, Any, Any], - Interceptor[StartConversationInput, StartConversationOutput, Any, Any], -] +if TYPE_CHECKING: + from smithy_core.interceptors import Interceptor + from .models import ( + DeleteSessionInput, + DeleteSessionOutput, + GetSessionInput, + GetSessionOutput, + PutSessionInput, + PutSessionOutput, + RecognizeTextInput, + RecognizeTextOutput, + RecognizeUtteranceInput, + RecognizeUtteranceOutput, + StartConversationInput, + StartConversationOutput, + ) + + _ServiceInterceptor = Union[ + Interceptor[DeleteSessionInput, DeleteSessionOutput, Any, Any], + Interceptor[GetSessionInput, GetSessionOutput, Any, Any], + Interceptor[PutSessionInput, PutSessionOutput, Any, Any], + Interceptor[RecognizeTextInput, RecognizeTextOutput, Any, Any], + Interceptor[RecognizeUtteranceInput, RecognizeUtteranceOutput, Any, Any], + Interceptor[StartConversationInput, StartConversationOutput, Any, Any], + ] +else: + _ServiceInterceptor = Any + _PROTOCOL_SETTINGS = ProtocolSettings( namespace="com.amazonaws.lexruntimev2", service_target="AWSDeepSenseRunTimeServiceApi2_0", + service_schema=AWS_DEEP_SENSE_RUN_TIME_SERVICE_API2_0, ) class _AsyncLexRuntimeV2ConfigOverrides(AwsConfigOverrides, total=False): - endpoint_resolver: EndpointResolver | None + endpoint_resolver: AsyncEndpointResolver | None protocol: ( - ClientProtocol[Any, Any] | ProtocolConstructor[ClientProtocol[Any, Any]] | None + AsyncClientProtocol[Any, Any] + | ProtocolConstructor[AsyncClientProtocol[Any, Any]] + | None ) - auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None + auth_schemes: dict[ShapeID, AsyncAuthScheme[Any, Any, Any, Any]] | None auth_scheme_resolver: AuthSchemeResolver | None @@ -70,17 +84,17 @@ class _AsyncLexRuntimeV2ConfigOverrides(AwsConfigOverrides, total=False): class AsyncLexRuntimeV2Config(AsyncAwsConfig): """Lex Runtime V2 configuration (async-resolved).""" - endpoint_resolver: EndpointResolver | None = None + endpoint_resolver: AsyncEndpointResolver | None = None """ The endpoint resolver used to resolve the final endpoint per-operation based on the configuration. """ - protocol: ClientProtocol[Any, Any] | None = None + protocol: AsyncClientProtocol[Any, Any] | None = None """ Pass a protocol class reference from smithy_aws_core.aio.protocols to - select the protocol, e.g. protocol=AwsJson10ClientProtocol. For custom - protocols a protocol instance may also be passed. + select the protocol, e.g. protocol=AsyncAwsJson10ClientProtocol. For + custom protocols a protocol instance may also be passed. """ interceptors: list[_ServiceInterceptor] = field(default_factory=lambda: []) @@ -89,7 +103,7 @@ class AsyncLexRuntimeV2Config(AsyncAwsConfig): execution of a request. """ - auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None = None + auth_schemes: dict[ShapeID, AsyncAuthScheme[Any, Any, Any, Any]] | None = None """A map of auth scheme ids to auth schemes.""" auth_scheme_resolver: AuthSchemeResolver | None = None @@ -99,7 +113,7 @@ class AsyncLexRuntimeV2Config(AsyncAwsConfig): """ aws_credentials_identity_resolver: ( - IdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None + AsyncIdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None ) = None """Resolves AWS Credentials. Required for operations that use Sigv4 Auth.""" @@ -140,24 +154,24 @@ class AsyncLexRuntimeV2Config(AsyncAwsConfig): default=None, resolver=EndpointUriResolver("lex_runtime_v2") ), "endpoint_resolver": FieldSpec( - default_factory=lambda: StandardRegionalEndpointsResolver( + default_factory=lambda: AsyncStandardRegionalEndpointsResolver( endpoint_prefix="runtime-v2-lex" ) ), "protocol": FieldSpec( - default_factory=lambda: RestJsonClientProtocol(_PROTOCOL_SETTINGS), + default_factory=lambda: AsyncRestJsonClientProtocol(_PROTOCOL_SETTINGS), converter=lambda p: p(_PROTOCOL_SETTINGS) if isinstance(p, type) else p, ), "auth_schemes": FieldSpec( default_factory=lambda: { - ShapeID("aws.auth#sigv4"): SigV4AuthScheme(service="lex") + ShapeID("aws.auth#sigv4"): AsyncSigV4AuthScheme(service="lex") } ), "auth_scheme_resolver": FieldSpec(default_factory=HTTPAuthSchemeResolver), "transport": FieldSpec(default_factory=lambda: AIOHTTPClient()), } - def set_auth_scheme(self, scheme: AuthScheme[Any, Any, Any, Any]) -> None: + def set_auth_scheme(self, scheme: AsyncAuthScheme[Any, Any, Any, Any]) -> None: """ Set an auth scheme implementation using its scheme ID. :param scheme: The auth scheme to add or replace. @@ -171,7 +185,7 @@ async def resolve( # pyright: ignore[reportIncompatibleMethodOverride] cls, *, profile: str | None = None, - fs: FileSystem | None = None, + fs: AsyncFileSystem | None = None, config_file_path: str | None = None, credentials_file_path: str | None = None, **overrides: Unpack[_AsyncLexRuntimeV2ConfigOverrides], diff --git a/clients/aws-sdk-lex-runtime-v2/src/aws_sdk_lex_runtime_v2/models.py b/clients/aws-sdk-lex-runtime-v2/src/aws_sdk_lex_runtime_v2/models.py index bb319591..43b323cb 100644 --- a/clients/aws-sdk-lex-runtime-v2/src/aws_sdk_lex_runtime_v2/models.py +++ b/clients/aws-sdk-lex-runtime-v2/src/aws_sdk_lex_runtime_v2/models.py @@ -1,5668 +1,304 @@ # Code generated by smithy-python-codegen DO NOT EDIT. -from base64 import b64decode -from dataclasses import dataclass, field -from enum import StrEnum -import logging -from typing import Any, Literal, Self, Union +from __future__ import annotations -from smithy_core.aio.interfaces import StreamingBlob -from smithy_core.deserializers import ShapeDeserializer -from smithy_core.documents import TypeRegistry -from smithy_core.exceptions import ModeledError, SerializationError -from smithy_core.response import EMPTY_RESPONSE_METADATA, ResponseMetadata -from smithy_core.schemas import APIOperation, Schema -from smithy_core.serializers import ShapeSerializer +from ._private import schemas as _schemas +from smithy_core._dynamic_models import ModelRegistry +from smithy_core.exceptions import ModeledError +from smithy_core.schemas import APIOperation from smithy_core.shapes import ShapeID -from smithy_core.types import UnknownEnumMixin from ._private.schemas import ( - ACCESS_DENIED_EXCEPTION as _SCHEMA_ACCESS_DENIED_EXCEPTION, - ACTIVE_CONTEXT as _SCHEMA_ACTIVE_CONTEXT, - ACTIVE_CONTEXT_TIME_TO_LIVE as _SCHEMA_ACTIVE_CONTEXT_TIME_TO_LIVE, - AUDIO_INPUT_EVENT as _SCHEMA_AUDIO_INPUT_EVENT, - AUDIO_RESPONSE_EVENT as _SCHEMA_AUDIO_RESPONSE_EVENT, - BAD_GATEWAY_EXCEPTION as _SCHEMA_BAD_GATEWAY_EXCEPTION, - BUTTON as _SCHEMA_BUTTON, - CONFIDENCE_SCORE as _SCHEMA_CONFIDENCE_SCORE, - CONFIGURATION_EVENT as _SCHEMA_CONFIGURATION_EVENT, - CONFLICT_EXCEPTION as _SCHEMA_CONFLICT_EXCEPTION, DELETE_SESSION as _SCHEMA_DELETE_SESSION, - DELETE_SESSION_INPUT as _SCHEMA_DELETE_SESSION_INPUT, - DELETE_SESSION_OUTPUT as _SCHEMA_DELETE_SESSION_OUTPUT, - DEPENDENCY_FAILED_EXCEPTION as _SCHEMA_DEPENDENCY_FAILED_EXCEPTION, - DIALOG_ACTION as _SCHEMA_DIALOG_ACTION, - DISCONNECTION_EVENT as _SCHEMA_DISCONNECTION_EVENT, - DTMF_INPUT_EVENT as _SCHEMA_DTMF_INPUT_EVENT, - ELICIT_SUB_SLOT as _SCHEMA_ELICIT_SUB_SLOT, GET_SESSION as _SCHEMA_GET_SESSION, - GET_SESSION_INPUT as _SCHEMA_GET_SESSION_INPUT, - GET_SESSION_OUTPUT as _SCHEMA_GET_SESSION_OUTPUT, - HEARTBEAT_EVENT as _SCHEMA_HEARTBEAT_EVENT, - IMAGE_RESPONSE_CARD as _SCHEMA_IMAGE_RESPONSE_CARD, - INTENT as _SCHEMA_INTENT, - INTENT_RESULT_EVENT as _SCHEMA_INTENT_RESULT_EVENT, - INTERNAL_SERVER_EXCEPTION as _SCHEMA_INTERNAL_SERVER_EXCEPTION, - INTERPRETATION as _SCHEMA_INTERPRETATION, - MESSAGE as _SCHEMA_MESSAGE, - PLAYBACK_COMPLETION_EVENT as _SCHEMA_PLAYBACK_COMPLETION_EVENT, - PLAYBACK_INTERRUPTION_EVENT as _SCHEMA_PLAYBACK_INTERRUPTION_EVENT, PUT_SESSION as _SCHEMA_PUT_SESSION, - PUT_SESSION_INPUT as _SCHEMA_PUT_SESSION_INPUT, - PUT_SESSION_OUTPUT as _SCHEMA_PUT_SESSION_OUTPUT, - RECOGNIZED_BOT_MEMBER as _SCHEMA_RECOGNIZED_BOT_MEMBER, RECOGNIZE_TEXT as _SCHEMA_RECOGNIZE_TEXT, - RECOGNIZE_TEXT_INPUT as _SCHEMA_RECOGNIZE_TEXT_INPUT, - RECOGNIZE_TEXT_OUTPUT as _SCHEMA_RECOGNIZE_TEXT_OUTPUT, RECOGNIZE_UTTERANCE as _SCHEMA_RECOGNIZE_UTTERANCE, - RECOGNIZE_UTTERANCE_INPUT as _SCHEMA_RECOGNIZE_UTTERANCE_INPUT, - RECOGNIZE_UTTERANCE_OUTPUT as _SCHEMA_RECOGNIZE_UTTERANCE_OUTPUT, - RESOURCE_NOT_FOUND_EXCEPTION as _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - RUNTIME_HINTS as _SCHEMA_RUNTIME_HINTS, - RUNTIME_HINT_DETAILS as _SCHEMA_RUNTIME_HINT_DETAILS, - RUNTIME_HINT_VALUE as _SCHEMA_RUNTIME_HINT_VALUE, - SENTIMENT_RESPONSE as _SCHEMA_SENTIMENT_RESPONSE, - SENTIMENT_SCORE as _SCHEMA_SENTIMENT_SCORE, - SESSION_STATE as _SCHEMA_SESSION_STATE, - SLOT as _SCHEMA_SLOT, START_CONVERSATION as _SCHEMA_START_CONVERSATION, - START_CONVERSATION_INPUT as _SCHEMA_START_CONVERSATION_INPUT, - START_CONVERSATION_OUTPUT as _SCHEMA_START_CONVERSATION_OUTPUT, - START_CONVERSATION_REQUEST_EVENT_STREAM as _SCHEMA_START_CONVERSATION_REQUEST_EVENT_STREAM, - START_CONVERSATION_RESPONSE_EVENT_STREAM as _SCHEMA_START_CONVERSATION_RESPONSE_EVENT_STREAM, - TEXT_INPUT_EVENT as _SCHEMA_TEXT_INPUT_EVENT, - TEXT_RESPONSE_EVENT as _SCHEMA_TEXT_RESPONSE_EVENT, - THROTTLING_EXCEPTION as _SCHEMA_THROTTLING_EXCEPTION, - TRANSCRIPT_EVENT as _SCHEMA_TRANSCRIPT_EVENT, - VALIDATION_EXCEPTION as _SCHEMA_VALIDATION_EXCEPTION, - VALUE as _SCHEMA_VALUE, ) - -logger = logging.getLogger(__name__) - - -class ServiceError(ModeledError): - """ - Base error for all errors in the service. - - Some exceptions do not extend from this class, including - synthetic, implicit, and shared exception types. - """ - - -@dataclass(kw_only=True) -class AccessDeniedException(ServiceError): - """""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACCESS_DENIED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_ACCESS_DENIED_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_ACCESS_DENIED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ACCESS_DENIED_EXCEPTION, consumer=_consumer) - return kwargs - - -def _serialize_active_context_parameters_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_active_context_parameters_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ActiveContextTimeToLive: - """ - The time that a context is active. You can specify the time to live in - seconds or in conversation turns. - """ - - time_to_live_in_seconds: int - """ - The number of seconds that the context is active. You can specify - between 5 and 86400 seconds (24 hours). - """ - - turns_to_live: int - """ - The number of turns that the context is active. You can specify up to 20 - turns. Each request and response from the bot is a turn. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACTIVE_CONTEXT_TIME_TO_LIVE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer( - _SCHEMA_ACTIVE_CONTEXT_TIME_TO_LIVE.members["timeToLiveInSeconds"], - self.time_to_live_in_seconds, - ) - serializer.write_integer( - _SCHEMA_ACTIVE_CONTEXT_TIME_TO_LIVE.members["turnsToLive"], - self.turns_to_live, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["time_to_live_in_seconds"] = de.read_integer( - _SCHEMA_ACTIVE_CONTEXT_TIME_TO_LIVE.members[ - "timeToLiveInSeconds" - ] - ) - - case 1: - kwargs["turns_to_live"] = de.read_integer( - _SCHEMA_ACTIVE_CONTEXT_TIME_TO_LIVE.members["turnsToLive"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ACTIVE_CONTEXT_TIME_TO_LIVE, consumer=_consumer - ) - if "time_to_live_in_seconds" not in kwargs: - kwargs["time_to_live_in_seconds"] = 0 - if "turns_to_live" not in kwargs: - kwargs["turns_to_live"] = 0 - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(time_to_live_in_seconds=0, turns_to_live=0) - - -@dataclass(kw_only=True) -class ActiveContext: - """ - Contains information about the contexts that a user is using in a - session. You can configure Amazon Lex V2 to set a context when an intent - is fulfilled, or you can set a context using the , , or operations. - - Use a context to indicate to Amazon Lex V2 intents that should be used - as follow-up intents. For example, if the active context is - `order-fulfilled`, only intents that have `order-fulfilled` configured - as a trigger are considered for follow up. - """ - - name: str - """The name of the context.""" - - time_to_live: ActiveContextTimeToLive - """ - Indicates the number of turns or seconds that the context is active. - Once the time to live expires, the context is no longer returned in a - response. - """ - - context_attributes: dict[str, str] - """ - A list of contexts active for the request. A context can be activated - when a previous intent is fulfilled, or by including the context in the - request. - - If you don't specify a list of contexts, Amazon Lex V2 will use the - current list of contexts for the session. If you specify an empty list, - all contexts for the session are cleared. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACTIVE_CONTEXT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_ACTIVE_CONTEXT.members["name"], self.name) - serializer.write_struct( - _SCHEMA_ACTIVE_CONTEXT.members["timeToLive"], self.time_to_live - ) - _serialize_active_context_parameters_map( - serializer, - _SCHEMA_ACTIVE_CONTEXT.members["contextAttributes"], - self.context_attributes, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_ACTIVE_CONTEXT.members["name"] - ) - - case 1: - kwargs["time_to_live"] = ActiveContextTimeToLive.deserialize(de) - - case 2: - kwargs["context_attributes"] = ( - _deserialize_active_context_parameters_map( - de, _SCHEMA_ACTIVE_CONTEXT.members["contextAttributes"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ACTIVE_CONTEXT, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "time_to_live" not in kwargs: - kwargs["time_to_live"] = ActiveContextTimeToLive._smithy_default() - if "context_attributes" not in kwargs: - kwargs["context_attributes"] = {} - return kwargs - - -def _serialize_active_contexts_list( - serializer: ShapeSerializer, schema: Schema, value: list[ActiveContext] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_active_contexts_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ActiveContext]: - result: list[ActiveContext] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ActiveContext.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AudioInputEvent: - """ - Represents a chunk of audio sent from the client application to Amazon - Lex V2. The audio is all or part of an utterance from the user. - - Amazon Lex V2 accumulates audio chunks until it recognizes a natural - pause in speech before processing the input. - """ - - content_type: str - """ - The encoding used for the audio chunk. You must use 8 KHz PCM 16-bit - mono-channel little-endian format. The value of the field should be: - - `audio/lpcm; sample-rate=8000; sample-size-bits=16; channel-count=1; is-big-endian=false` - """ - - audio_chunk: bytes | None = None - """An encoded stream of audio.""" - - event_id: str | None = None - """ - A unique identifier that your application assigns to the event. You can - use this to identify events in logs. - """ - - client_timestamp_millis: int = 0 - """ - A timestamp set by the client of the date and time that the event was - sent to Amazon Lex V2. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUDIO_INPUT_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.audio_chunk is not None: - serializer.write_blob( - _SCHEMA_AUDIO_INPUT_EVENT.members["audioChunk"], self.audio_chunk - ) - - serializer.write_string( - _SCHEMA_AUDIO_INPUT_EVENT.members["contentType"], self.content_type - ) - if self.event_id is not None: - serializer.write_string( - _SCHEMA_AUDIO_INPUT_EVENT.members["eventId"], self.event_id - ) - - serializer.write_long( - _SCHEMA_AUDIO_INPUT_EVENT.members["clientTimestampMillis"], - self.client_timestamp_millis, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["audio_chunk"] = de.read_blob( - _SCHEMA_AUDIO_INPUT_EVENT.members["audioChunk"] - ) - - case 1: - kwargs["content_type"] = de.read_string( - _SCHEMA_AUDIO_INPUT_EVENT.members["contentType"] - ) - - case 2: - kwargs["event_id"] = de.read_string( - _SCHEMA_AUDIO_INPUT_EVENT.members["eventId"] - ) - - case 3: - kwargs["client_timestamp_millis"] = de.read_long( - _SCHEMA_AUDIO_INPUT_EVENT.members["clientTimestampMillis"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AUDIO_INPUT_EVENT, consumer=_consumer) - if "content_type" not in kwargs: - kwargs["content_type"] = "" - return kwargs - - -@dataclass(kw_only=True) -class AudioResponseEvent: - """ - An event sent from Amazon Lex V2 to your client application containing - audio to play to the user. - """ - - audio_chunk: bytes | None = None - """A chunk of the audio to play.""" - - content_type: str | None = None - """ - The encoding of the audio chunk. This is the same as the encoding - configure in the `contentType` field of the `ConfigurationEvent`. - """ - - event_id: str | None = None - """ - A unique identifier of the event sent by Amazon Lex V2. The identifier - is in the form `RESPONSE-N`, where N is a number starting with one and - incremented for each event sent by Amazon Lex V2 in the current session. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUDIO_RESPONSE_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.audio_chunk is not None: - serializer.write_blob( - _SCHEMA_AUDIO_RESPONSE_EVENT.members["audioChunk"], self.audio_chunk - ) - - if self.content_type is not None: - serializer.write_string( - _SCHEMA_AUDIO_RESPONSE_EVENT.members["contentType"], self.content_type - ) - - if self.event_id is not None: - serializer.write_string( - _SCHEMA_AUDIO_RESPONSE_EVENT.members["eventId"], self.event_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["audio_chunk"] = de.read_blob( - _SCHEMA_AUDIO_RESPONSE_EVENT.members["audioChunk"] - ) - - case 1: - kwargs["content_type"] = de.read_string( - _SCHEMA_AUDIO_RESPONSE_EVENT.members["contentType"] - ) - - case 2: - kwargs["event_id"] = de.read_string( - _SCHEMA_AUDIO_RESPONSE_EVENT.members["eventId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AUDIO_RESPONSE_EVENT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ConflictException(ServiceError): - """""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONFLICT_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CONFLICT_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_CONFLICT_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONFLICT_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteSessionInput: - """Dataclass for DeleteSessionInput structure.""" - - bot_id: str | None = None - """The identifier of the bot that contains the session data.""" - - bot_alias_id: str | None = None - """The alias identifier in use for the bot that contains the session data.""" - - locale_id: str | None = None - """The locale where the session is in use.""" - - session_id: str | None = None - """The identifier of the session to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_SESSION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.bot_id is not None: - serializer.write_string( - _SCHEMA_DELETE_SESSION_INPUT.members["botId"], self.bot_id - ) - - if self.bot_alias_id is not None: - serializer.write_string( - _SCHEMA_DELETE_SESSION_INPUT.members["botAliasId"], self.bot_alias_id - ) - - if self.locale_id is not None: - serializer.write_string( - _SCHEMA_DELETE_SESSION_INPUT.members["localeId"], self.locale_id - ) - - if self.session_id is not None: - serializer.write_string( - _SCHEMA_DELETE_SESSION_INPUT.members["sessionId"], self.session_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bot_id"] = de.read_string( - _SCHEMA_DELETE_SESSION_INPUT.members["botId"] - ) - - case 1: - kwargs["bot_alias_id"] = de.read_string( - _SCHEMA_DELETE_SESSION_INPUT.members["botAliasId"] - ) - - case 2: - kwargs["locale_id"] = de.read_string( - _SCHEMA_DELETE_SESSION_INPUT.members["localeId"] - ) - - case 3: - kwargs["session_id"] = de.read_string( - _SCHEMA_DELETE_SESSION_INPUT.members["sessionId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_SESSION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteSessionOutput: - """Dataclass for DeleteSessionOutput structure.""" - - bot_id: str | None = None - """The identifier of the bot that contained the session data.""" - - bot_alias_id: str | None = None - """The alias identifier in use for the bot that contained the session data.""" - - locale_id: str | None = None - """The locale where the session was used.""" - - session_id: str | None = None - """The identifier of the deleted session.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_SESSION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.bot_id is not None: - serializer.write_string( - _SCHEMA_DELETE_SESSION_OUTPUT.members["botId"], self.bot_id - ) - - if self.bot_alias_id is not None: - serializer.write_string( - _SCHEMA_DELETE_SESSION_OUTPUT.members["botAliasId"], self.bot_alias_id - ) - - if self.locale_id is not None: - serializer.write_string( - _SCHEMA_DELETE_SESSION_OUTPUT.members["localeId"], self.locale_id - ) - - if self.session_id is not None: - serializer.write_string( - _SCHEMA_DELETE_SESSION_OUTPUT.members["sessionId"], self.session_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bot_id"] = de.read_string( - _SCHEMA_DELETE_SESSION_OUTPUT.members["botId"] - ) - - case 1: - kwargs["bot_alias_id"] = de.read_string( - _SCHEMA_DELETE_SESSION_OUTPUT.members["botAliasId"] - ) - - case 2: - kwargs["locale_id"] = de.read_string( - _SCHEMA_DELETE_SESSION_OUTPUT.members["localeId"] - ) - - case 3: - kwargs["session_id"] = de.read_string( - _SCHEMA_DELETE_SESSION_OUTPUT.members["sessionId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_SESSION_OUTPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class InternalServerException(ServiceError): - """""" - - fault: Literal["client", "server"] | None = "server" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INTERNAL_SERVER_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_INTERNAL_SERVER_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INTERNAL_SERVER_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INTERNAL_SERVER_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ResourceNotFoundException(ServiceError): - """""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ThrottlingException(ServiceError): - """""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_THROTTLING_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_THROTTLING_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_THROTTLING_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_THROTTLING_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ValidationException(ServiceError): - """""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VALIDATION_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_VALIDATION_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_VALIDATION_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VALIDATION_EXCEPTION, consumer=_consumer) - return kwargs - - -DELETE_SESSION = APIOperation( - input=DeleteSessionInput, - output=DeleteSessionOutput, - schema=_SCHEMA_DELETE_SESSION, - input_schema=_SCHEMA_DELETE_SESSION_INPUT, - output_schema=_SCHEMA_DELETE_SESSION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lexruntimev2#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.lexruntimev2#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.lexruntimev2#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.lexruntimev2#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.lexruntimev2#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.lexruntimev2#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetSessionInput: - """Dataclass for GetSessionInput structure.""" - - bot_id: str | None = None - """The identifier of the bot that contains the session data.""" - - bot_alias_id: str | None = None - """The alias identifier in use for the bot that contains the session data.""" - - locale_id: str | None = None - """The locale where the session is in use.""" - - session_id: str | None = None - """The identifier of the session to return.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_SESSION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.bot_id is not None: - serializer.write_string( - _SCHEMA_GET_SESSION_INPUT.members["botId"], self.bot_id - ) - - if self.bot_alias_id is not None: - serializer.write_string( - _SCHEMA_GET_SESSION_INPUT.members["botAliasId"], self.bot_alias_id - ) - - if self.locale_id is not None: - serializer.write_string( - _SCHEMA_GET_SESSION_INPUT.members["localeId"], self.locale_id - ) - - if self.session_id is not None: - serializer.write_string( - _SCHEMA_GET_SESSION_INPUT.members["sessionId"], self.session_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bot_id"] = de.read_string( - _SCHEMA_GET_SESSION_INPUT.members["botId"] - ) - - case 1: - kwargs["bot_alias_id"] = de.read_string( - _SCHEMA_GET_SESSION_INPUT.members["botAliasId"] - ) - - case 2: - kwargs["locale_id"] = de.read_string( - _SCHEMA_GET_SESSION_INPUT.members["localeId"] - ) - - case 3: - kwargs["session_id"] = de.read_string( - _SCHEMA_GET_SESSION_INPUT.members["sessionId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_SESSION_INPUT, consumer=_consumer) - return kwargs - - -class ConfirmationState(UnknownEnumMixin, StrEnum): - CONFIRMED = "Confirmed" - DENIED = "Denied" - NONE = "None" - - -class Shape(UnknownEnumMixin, StrEnum): - SCALAR = "Scalar" - LIST_ = "List" - COMPOSITE = "Composite" - - -def _serialize_string_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_string_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class Value: - """ - Information about the value provided for a slot and Amazon Lex V2's - interpretation. - """ - - interpreted_value: str - """ - The value that Amazon Lex V2 determines for the slot, given the user - input. The actual value depends on the setting of the value selection - strategy for the bot. You can choose to use the value entered by the - user, or you can have Amazon Lex V2 choose the first value in the - `resolvedValues` list. - """ - - original_value: str | None = None - """ - The part of the user's response to the slot elicitation that Amazon Lex - V2 determines is relevant to the slot value. - """ - - resolved_values: list[str] | None = None - """ - A list of values that Amazon Lex V2 determines are possible resolutions - for the user input. The first value matches the `interpretedValue`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VALUE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.original_value is not None: - serializer.write_string( - _SCHEMA_VALUE.members["originalValue"], self.original_value - ) - - serializer.write_string( - _SCHEMA_VALUE.members["interpretedValue"], self.interpreted_value - ) - if self.resolved_values is not None: - _serialize_string_list( - serializer, - _SCHEMA_VALUE.members["resolvedValues"], - self.resolved_values, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["original_value"] = de.read_string( - _SCHEMA_VALUE.members["originalValue"] - ) - - case 1: - kwargs["interpreted_value"] = de.read_string( - _SCHEMA_VALUE.members["interpretedValue"] - ) - - case 2: - kwargs["resolved_values"] = _deserialize_string_list( - de, _SCHEMA_VALUE.members["resolvedValues"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VALUE, consumer=_consumer) - if "interpreted_value" not in kwargs: - kwargs["interpreted_value"] = "" - return kwargs - - -class IntentState(UnknownEnumMixin, StrEnum): - FAILED = "Failed" - FULFILLED = "Fulfilled" - IN_PROGRESS = "InProgress" - READY_FOR_FULFILLMENT = "ReadyForFulfillment" - WAITING = "Waiting" - FULFILLMENT_IN_PROGRESS = "FulfillmentInProgress" - - -class InterpretationSource(UnknownEnumMixin, StrEnum): - BEDROCK = "Bedrock" - LEX = "Lex" - - -@dataclass(kw_only=True) -class ConfidenceScore: - """ - Provides a score that indicates the confidence that Amazon Lex V2 has - that an intent is the one that satisfies the user's intent. - """ - - score: float = 0 - """ - A score that indicates how confident Amazon Lex V2 is that an intent - satisfies the user's intent. Ranges between 0.00 and 1.00. Higher - scores indicate higher confidence. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONFIDENCE_SCORE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_double(_SCHEMA_CONFIDENCE_SCORE.members["score"], self.score) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["score"] = de.read_double( - _SCHEMA_CONFIDENCE_SCORE.members["score"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONFIDENCE_SCORE, consumer=_consumer) - return kwargs - - -class SentimentType(UnknownEnumMixin, StrEnum): - MIXED = "MIXED" - NEGATIVE = "NEGATIVE" - NEUTRAL = "NEUTRAL" - POSITIVE = "POSITIVE" - - -@dataclass(kw_only=True) -class SentimentScore: - """The individual sentiment responses for the utterance.""" - - positive: float = 0 - """ - The level of confidence that Amazon Comprehend has in the accuracy of - its detection of the `POSITIVE` sentiment. - """ - - negative: float = 0 - """ - The level of confidence that Amazon Comprehend has in the accuracy of - its detection of the `NEGATIVE` sentiment. - """ - - neutral: float = 0 - """ - The level of confidence that Amazon Comprehend has in the accuracy of - its detection of the `NEUTRAL` sentiment. - """ - - mixed: float = 0 - """ - The level of confidence that Amazon Comprehend has in the accuracy of - its detection of the `MIXED` sentiment. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SENTIMENT_SCORE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_double( - _SCHEMA_SENTIMENT_SCORE.members["positive"], self.positive - ) - serializer.write_double( - _SCHEMA_SENTIMENT_SCORE.members["negative"], self.negative - ) - serializer.write_double( - _SCHEMA_SENTIMENT_SCORE.members["neutral"], self.neutral - ) - serializer.write_double(_SCHEMA_SENTIMENT_SCORE.members["mixed"], self.mixed) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["positive"] = de.read_double( - _SCHEMA_SENTIMENT_SCORE.members["positive"] - ) - - case 1: - kwargs["negative"] = de.read_double( - _SCHEMA_SENTIMENT_SCORE.members["negative"] - ) - - case 2: - kwargs["neutral"] = de.read_double( - _SCHEMA_SENTIMENT_SCORE.members["neutral"] - ) - - case 3: - kwargs["mixed"] = de.read_double( - _SCHEMA_SENTIMENT_SCORE.members["mixed"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SENTIMENT_SCORE, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class SentimentResponse: - """ - Provides information about the sentiment expressed in a user's response - in a conversation. Sentiments are determined using Amazon Comprehend. - Sentiments are only returned if they are enabled for the bot. - - For more information, see [Determine - Sentiment](https://docs.aws.amazon.com/comprehend/latest/dg/how-sentiment.html) - in the *Amazon Comprehend developer guide*. - """ - - sentiment: str | None = None - """ - The overall sentiment expressed in the user's response. This is the - sentiment most likely expressed by the user based on the analysis by - Amazon Comprehend. - """ - - sentiment_score: SentimentScore | None = None - """The individual sentiment responses for the utterance.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SENTIMENT_RESPONSE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.sentiment is not None: - serializer.write_string( - _SCHEMA_SENTIMENT_RESPONSE.members["sentiment"], self.sentiment - ) - - if self.sentiment_score is not None: - serializer.write_struct( - _SCHEMA_SENTIMENT_RESPONSE.members["sentimentScore"], - self.sentiment_score, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["sentiment"] = SentimentType( - de.read_string(_SCHEMA_SENTIMENT_RESPONSE.members["sentiment"]) - ) - - case 1: - kwargs["sentiment_score"] = SentimentScore.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SENTIMENT_RESPONSE, consumer=_consumer) - return kwargs - - -class MessageContentType(UnknownEnumMixin, StrEnum): - CUSTOM_PAYLOAD = "CustomPayload" - IMAGE_RESPONSE_CARD = "ImageResponseCard" - PLAIN_TEXT = "PlainText" - SSML = "SSML" - - -@dataclass(kw_only=True) -class Button: - """A button that appears on a response card show to the user.""" - - text: str - """The text that is displayed on the button.""" - - value: str - """The value returned to Amazon Lex V2 when a user chooses the button.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BUTTON, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_BUTTON.members["text"], self.text) - serializer.write_string(_SCHEMA_BUTTON.members["value"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["text"] = de.read_string(_SCHEMA_BUTTON.members["text"]) - - case 1: - kwargs["value"] = de.read_string(_SCHEMA_BUTTON.members["value"]) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BUTTON, consumer=_consumer) - if "text" not in kwargs: - kwargs["text"] = "" - if "value" not in kwargs: - kwargs["value"] = "" - return kwargs - - -def _serialize_buttons_list( - serializer: ShapeSerializer, schema: Schema, value: list[Button] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_buttons_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Button]: - result: list[Button] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Button.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ImageResponseCard: - """ - A card that is shown to the user by a messaging platform. You define the - contents of the card, the card is displayed by the platform. - - When you use a response card, the response from the user is constrained - to the text associated with a button on the card. - """ - - title: str - """ - The title to display on the response card. The format of the title is - determined by the platform displaying the response card. - """ - - subtitle: str | None = None - """ - The subtitle to display on the response card. The format of the subtitle - is determined by the platform displaying the response card. - """ - - image_url: str | None = None - """ - The URL of an image to display on the response card. The image URL must - be publicly available so that the platform displaying the response card - has access to the image. - """ - - buttons: list[Button] | None = None - """ - A list of buttons that should be displayed on the response card. The - arrangement of the buttons is determined by the platform that displays - the button. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IMAGE_RESPONSE_CARD, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_IMAGE_RESPONSE_CARD.members["title"], self.title - ) - if self.subtitle is not None: - serializer.write_string( - _SCHEMA_IMAGE_RESPONSE_CARD.members["subtitle"], self.subtitle - ) - - if self.image_url is not None: - serializer.write_string( - _SCHEMA_IMAGE_RESPONSE_CARD.members["imageUrl"], self.image_url - ) - - if self.buttons is not None: - _serialize_buttons_list( - serializer, _SCHEMA_IMAGE_RESPONSE_CARD.members["buttons"], self.buttons - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["title"] = de.read_string( - _SCHEMA_IMAGE_RESPONSE_CARD.members["title"] - ) - - case 1: - kwargs["subtitle"] = de.read_string( - _SCHEMA_IMAGE_RESPONSE_CARD.members["subtitle"] - ) - - case 2: - kwargs["image_url"] = de.read_string( - _SCHEMA_IMAGE_RESPONSE_CARD.members["imageUrl"] - ) - - case 3: - kwargs["buttons"] = _deserialize_buttons_list( - de, _SCHEMA_IMAGE_RESPONSE_CARD.members["buttons"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_IMAGE_RESPONSE_CARD, consumer=_consumer) - if "title" not in kwargs: - kwargs["title"] = "" - return kwargs - - -@dataclass(kw_only=True) -class Message: - """Container for text that is returned to the customer..""" - - content_type: str - """Indicates the type of response.""" - - content: str | None = field(repr=False, default=None) - """The text of the message.""" - - image_response_card: ImageResponseCard | None = None - """ - A card that is shown to the user by a messaging platform. You define the - contents of the card, the card is displayed by the platform. - - When you use a response card, the response from the user is constrained - to the text associated with a button on the card. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MESSAGE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.content is not None: - serializer.write_string(_SCHEMA_MESSAGE.members["content"], self.content) - - serializer.write_string( - _SCHEMA_MESSAGE.members["contentType"], self.content_type - ) - if self.image_response_card is not None: - serializer.write_struct( - _SCHEMA_MESSAGE.members["imageResponseCard"], self.image_response_card - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["content"] = de.read_string( - _SCHEMA_MESSAGE.members["content"] - ) - - case 1: - kwargs["content_type"] = MessageContentType( - de.read_string(_SCHEMA_MESSAGE.members["contentType"]) - ) - - case 2: - kwargs["image_response_card"] = ImageResponseCard.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MESSAGE, consumer=_consumer) - if "content_type" not in kwargs: - kwargs["content_type"] = MessageContentType._corrected("") - return kwargs - - -def _serialize_messages( - serializer: ShapeSerializer, schema: Schema, value: list[Message] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_messages( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Message]: - result: list[Message] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Message.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class StyleType(UnknownEnumMixin, StrEnum): - DEFAULT = "Default" - SPELL_BY_LETTER = "SpellByLetter" - SPELL_BY_WORD = "SpellByWord" - - -class DialogActionType(UnknownEnumMixin, StrEnum): - CLOSE = "Close" - CONFIRM_INTENT = "ConfirmIntent" - DELEGATE = "Delegate" - ELICIT_INTENT = "ElicitIntent" - ELICIT_SLOT = "ElicitSlot" - NONE = "None" - - -@dataclass(kw_only=True) -class RuntimeHintValue: - """ - Provides the phrase that Amazon Lex V2 should look for in the user's - input to the bot. - """ - - phrase: str - """ - The phrase that Amazon Lex V2 should look for in the user's input to - the bot. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RUNTIME_HINT_VALUE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_RUNTIME_HINT_VALUE.members["phrase"], self.phrase - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["phrase"] = de.read_string( - _SCHEMA_RUNTIME_HINT_VALUE.members["phrase"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RUNTIME_HINT_VALUE, consumer=_consumer) - if "phrase" not in kwargs: - kwargs["phrase"] = "" - return kwargs - - -def _serialize_runtime_hint_values_list( - serializer: ShapeSerializer, schema: Schema, value: list[RuntimeHintValue] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_runtime_hint_values_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[RuntimeHintValue]: - result: list[RuntimeHintValue] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(RuntimeHintValue.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_string_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_string_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class BadGatewayException(ServiceError): - """""" - - fault: Literal["client", "server"] | None = "server" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BAD_GATEWAY_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_BAD_GATEWAY_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_BAD_GATEWAY_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BAD_GATEWAY_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DependencyFailedException(ServiceError): - """""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DEPENDENCY_FAILED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DEPENDENCY_FAILED_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_DEPENDENCY_FAILED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DEPENDENCY_FAILED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class PutSessionOutput: - """Dataclass for PutSessionOutput structure.""" - - content_type: str | None = None - """ - The type of response. Same as the type specified in the - `responseContentType` field in the request. - """ - - messages: str | None = None - """ - A list of messages that were last sent to the user. The messages are - ordered based on how you return the messages from you Lambda function or - the order that the messages are defined in the bot. - """ - - session_state: str | None = None - """ - A base-64-encoded gzipped field that represents the current state of the - dialog between the user and the bot. Use this to determine the progress - of the conversation and what the next action may be. - """ - - request_attributes: str | None = None - """ - A base-64-encoded gzipped field that provides request-specific - information passed between the client application and Amazon Lex V2. - These are the same as the `requestAttribute` parameter in the call to - the `PutSession` operation. - """ - - session_id: str | None = None - """The identifier of the session that received the data.""" - - audio_stream: StreamingBlob = b64decode("") - """ - If the requested content type was audio, the audio version of the - message to convey to the user. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_SESSION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.content_type is not None: - serializer.write_string( - _SCHEMA_PUT_SESSION_OUTPUT.members["contentType"], self.content_type - ) - - if self.messages is not None: - serializer.write_string( - _SCHEMA_PUT_SESSION_OUTPUT.members["messages"], self.messages - ) - - if self.session_state is not None: - serializer.write_string( - _SCHEMA_PUT_SESSION_OUTPUT.members["sessionState"], self.session_state - ) - - if self.request_attributes is not None: - serializer.write_string( - _SCHEMA_PUT_SESSION_OUTPUT.members["requestAttributes"], - self.request_attributes, - ) - - if self.session_id is not None: - serializer.write_string( - _SCHEMA_PUT_SESSION_OUTPUT.members["sessionId"], self.session_id - ) - - serializer.write_data_stream( - _SCHEMA_PUT_SESSION_OUTPUT.members["audioStream"], self.audio_stream - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["content_type"] = de.read_string( - _SCHEMA_PUT_SESSION_OUTPUT.members["contentType"] - ) - - case 1: - kwargs["messages"] = de.read_string( - _SCHEMA_PUT_SESSION_OUTPUT.members["messages"] - ) - - case 2: - kwargs["session_state"] = de.read_string( - _SCHEMA_PUT_SESSION_OUTPUT.members["sessionState"] - ) - - case 3: - kwargs["request_attributes"] = de.read_string( - _SCHEMA_PUT_SESSION_OUTPUT.members["requestAttributes"] - ) - - case 4: - kwargs["session_id"] = de.read_string( - _SCHEMA_PUT_SESSION_OUTPUT.members["sessionId"] - ) - - case 5: - kwargs["audio_stream"] = de.read_data_stream( - _SCHEMA_PUT_SESSION_OUTPUT.members["audioStream"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUT_SESSION_OUTPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class RecognizedBotMember: - """The bot member that processes the request.""" - - bot_id: str - """The identifier of the bot member that processes the request.""" - - bot_name: str | None = None - """The name of the bot member that processes the request.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RECOGNIZED_BOT_MEMBER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_RECOGNIZED_BOT_MEMBER.members["botId"], self.bot_id - ) - if self.bot_name is not None: - serializer.write_string( - _SCHEMA_RECOGNIZED_BOT_MEMBER.members["botName"], self.bot_name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bot_id"] = de.read_string( - _SCHEMA_RECOGNIZED_BOT_MEMBER.members["botId"] - ) - - case 1: - kwargs["bot_name"] = de.read_string( - _SCHEMA_RECOGNIZED_BOT_MEMBER.members["botName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RECOGNIZED_BOT_MEMBER, consumer=_consumer) - if "bot_id" not in kwargs: - kwargs["bot_id"] = "" - return kwargs - - -@dataclass(kw_only=True) -class RecognizeUtteranceInput: - """Dataclass for RecognizeUtteranceInput structure.""" - - bot_id: str | None = None - """The identifier of the bot that should receive the request.""" - - bot_alias_id: str | None = None - """The alias identifier in use for the bot that should receive the request.""" - - locale_id: str | None = None - """The locale where the session is in use.""" - - session_id: str | None = None - """The identifier of the session in use.""" - - session_state: str | None = field(repr=False, default=None) - """ - Sets the state of the session with the user. You can use this to set the - current intent, attributes, context, and dialog action. Use the dialog - action to determine the next step that Amazon Lex V2 should use in the - conversation with the user. - - The `sessionState` field must be compressed using gzip and then base64 - encoded before sending to Amazon Lex V2. - """ - - request_attributes: str | None = field(repr=False, default=None) - """ - Request-specific information passed between the client application and - Amazon Lex V2 - - The namespace `x-amz-lex:` is reserved for special attributes. Don't - create any request attributes for prefix `x-amz-lex:`. - - The `requestAttributes` field must be compressed using gzip and then - base64 encoded before sending to Amazon Lex V2. - """ - - request_content_type: str | None = None - """ - Indicates the format for audio input or that the content is text. The - header must start with one of the following prefixes: - - - PCM format, audio data must be in little-endian byte order. - - - audio/l16; rate=16000; channels=1 - - - audio/x-l16; sample-rate=16000; channel-count=1 - - - audio/lpcm; sample-rate=8000; sample-size-bits=16; channel-count=1; - is-big-endian=false - - - Opus format - - - audio/x-cbr-opus-with-preamble;preamble-size=0;bit-rate=256000;frame-size-milliseconds=4 - - - Text format - - - text/plain; charset=utf-8 - """ - - response_content_type: str | None = None - """ - The message that Amazon Lex V2 returns in the response can be either - text or speech based on the `responseContentType` value. - - - If the value is `text/plain;charset=utf-8`, Amazon Lex V2 returns text - in the response. - - - If the value begins with `audio/`, Amazon Lex V2 returns speech in the - response. Amazon Lex V2 uses Amazon Polly to generate the speech using - the configuration that you specified in the `responseContentType` - parameter. For example, if you specify `audio/mpeg` as the value, - Amazon Lex V2 returns speech in the MPEG format. - - - If the value is `audio/pcm`, the speech returned is `audio/pcm` at 16 - KHz in 16-bit, little-endian format. - - - The following are the accepted values: - - - audio/mpeg - - - audio/ogg - - - audio/pcm (16 KHz) - - - audio/* (defaults to mpeg) - - - text/plain; charset=utf-8 - """ - - input_stream: StreamingBlob = b64decode("") - """ - User input in PCM or Opus audio format or text format as described in - the `requestContentType` parameter. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RECOGNIZE_UTTERANCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.bot_id is not None: - serializer.write_string( - _SCHEMA_RECOGNIZE_UTTERANCE_INPUT.members["botId"], self.bot_id - ) - - if self.bot_alias_id is not None: - serializer.write_string( - _SCHEMA_RECOGNIZE_UTTERANCE_INPUT.members["botAliasId"], - self.bot_alias_id, - ) - - if self.locale_id is not None: - serializer.write_string( - _SCHEMA_RECOGNIZE_UTTERANCE_INPUT.members["localeId"], self.locale_id - ) - - if self.session_id is not None: - serializer.write_string( - _SCHEMA_RECOGNIZE_UTTERANCE_INPUT.members["sessionId"], self.session_id - ) - - if self.session_state is not None: - serializer.write_string( - _SCHEMA_RECOGNIZE_UTTERANCE_INPUT.members["sessionState"], - self.session_state, - ) - - if self.request_attributes is not None: - serializer.write_string( - _SCHEMA_RECOGNIZE_UTTERANCE_INPUT.members["requestAttributes"], - self.request_attributes, - ) - - if self.request_content_type is not None: - serializer.write_string( - _SCHEMA_RECOGNIZE_UTTERANCE_INPUT.members["requestContentType"], - self.request_content_type, - ) - - if self.response_content_type is not None: - serializer.write_string( - _SCHEMA_RECOGNIZE_UTTERANCE_INPUT.members["responseContentType"], - self.response_content_type, - ) - - if self.input_stream is not None: - serializer.write_data_stream( - _SCHEMA_RECOGNIZE_UTTERANCE_INPUT.members["inputStream"], - self.input_stream, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bot_id"] = de.read_string( - _SCHEMA_RECOGNIZE_UTTERANCE_INPUT.members["botId"] - ) - - case 1: - kwargs["bot_alias_id"] = de.read_string( - _SCHEMA_RECOGNIZE_UTTERANCE_INPUT.members["botAliasId"] - ) - - case 2: - kwargs["locale_id"] = de.read_string( - _SCHEMA_RECOGNIZE_UTTERANCE_INPUT.members["localeId"] - ) - - case 3: - kwargs["session_id"] = de.read_string( - _SCHEMA_RECOGNIZE_UTTERANCE_INPUT.members["sessionId"] - ) - - case 4: - kwargs["session_state"] = de.read_string( - _SCHEMA_RECOGNIZE_UTTERANCE_INPUT.members["sessionState"] - ) - - case 5: - kwargs["request_attributes"] = de.read_string( - _SCHEMA_RECOGNIZE_UTTERANCE_INPUT.members["requestAttributes"] - ) - - case 6: - kwargs["request_content_type"] = de.read_string( - _SCHEMA_RECOGNIZE_UTTERANCE_INPUT.members["requestContentType"] - ) - - case 7: - kwargs["response_content_type"] = de.read_string( - _SCHEMA_RECOGNIZE_UTTERANCE_INPUT.members["responseContentType"] - ) - - case 8: - kwargs["input_stream"] = de.read_data_stream( - _SCHEMA_RECOGNIZE_UTTERANCE_INPUT.members["inputStream"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RECOGNIZE_UTTERANCE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class RecognizeUtteranceOutput: - """Dataclass for RecognizeUtteranceOutput structure.""" - - input_mode: str | None = None - """ - Indicates whether the input mode to the operation was text, speech, or - from a touch-tone keypad. - """ - - content_type: str | None = None - """Content type as specified in the `responseContentType` in the request.""" - - messages: str | None = None - """ - A list of messages that were last sent to the user. The messages are - ordered based on the order that you returned the messages from your - Lambda function or the order that the messages are defined in the bot. - - The `messages` field is compressed with gzip and then base64 encoded. - Before you can use the contents of the field, you must decode and - decompress the contents. See the example for a simple function to decode - and decompress the contents. - """ - - interpretations: str | None = None - """ - A list of intents that Amazon Lex V2 determined might satisfy the - user's utterance. - - Each interpretation includes the intent, a score that indicates how - confident Amazon Lex V2 is that the interpretation is the correct one, - and an optional sentiment response that indicates the sentiment - expressed in the utterance. - - The `interpretations` field is compressed with gzip and then base64 - encoded. Before you can use the contents of the field, you must decode - and decompress the contents. See the example for a simple function to - decode and decompress the contents. - """ - - session_state: str | None = None - """ - Represents the current state of the dialog between the user and the bot. - - Use this to determine the progress of the conversation and what the next - action might be. - - The `sessionState` field is compressed with gzip and then base64 - encoded. Before you can use the contents of the field, you must decode - and decompress the contents. See the example for a simple function to - decode and decompress the contents. - """ - - request_attributes: str | None = None - """ - The attributes sent in the request. - - The `requestAttributes` field is compressed with gzip and then base64 - encoded. Before you can use the contents of the field, you must decode - and decompress the contents. - """ - - session_id: str | None = None - """The identifier of the session in use.""" - - input_transcript: str | None = None - """ - The text used to process the request. - - If the input was an audio stream, the `inputTranscript` field contains - the text extracted from the audio stream. This is the text that is - actually processed to recognize intents and slot values. You can use - this information to determine if Amazon Lex V2 is correctly processing - the audio that you send. - - The `inputTranscript` field is compressed with gzip and then base64 - encoded. Before you can use the contents of the field, you must decode - and decompress the contents. See the example for a simple function to - decode and decompress the contents. - """ - - audio_stream: StreamingBlob = b64decode("") - """ - The prompt or statement to send to the user. This is based on the bot - configuration and context. For example, if Amazon Lex V2 did not - understand the user intent, it sends the `clarificationPrompt` - configured for the bot. If the intent requires confirmation before - taking the fulfillment action, it sends the `confirmationPrompt`. - Another example: Suppose that the Lambda function successfully fulfilled - the intent, and sent a message to convey to the user. Then Amazon Lex V2 - sends that message in the response. - """ - - recognized_bot_member: str | None = None - """The bot member that recognized the utterance.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RECOGNIZE_UTTERANCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.input_mode is not None: - serializer.write_string( - _SCHEMA_RECOGNIZE_UTTERANCE_OUTPUT.members["inputMode"], self.input_mode - ) - - if self.content_type is not None: - serializer.write_string( - _SCHEMA_RECOGNIZE_UTTERANCE_OUTPUT.members["contentType"], - self.content_type, - ) - - if self.messages is not None: - serializer.write_string( - _SCHEMA_RECOGNIZE_UTTERANCE_OUTPUT.members["messages"], self.messages - ) - - if self.interpretations is not None: - serializer.write_string( - _SCHEMA_RECOGNIZE_UTTERANCE_OUTPUT.members["interpretations"], - self.interpretations, - ) - - if self.session_state is not None: - serializer.write_string( - _SCHEMA_RECOGNIZE_UTTERANCE_OUTPUT.members["sessionState"], - self.session_state, - ) - - if self.request_attributes is not None: - serializer.write_string( - _SCHEMA_RECOGNIZE_UTTERANCE_OUTPUT.members["requestAttributes"], - self.request_attributes, - ) - - if self.session_id is not None: - serializer.write_string( - _SCHEMA_RECOGNIZE_UTTERANCE_OUTPUT.members["sessionId"], self.session_id - ) - - if self.input_transcript is not None: - serializer.write_string( - _SCHEMA_RECOGNIZE_UTTERANCE_OUTPUT.members["inputTranscript"], - self.input_transcript, - ) - - serializer.write_data_stream( - _SCHEMA_RECOGNIZE_UTTERANCE_OUTPUT.members["audioStream"], self.audio_stream - ) - if self.recognized_bot_member is not None: - serializer.write_string( - _SCHEMA_RECOGNIZE_UTTERANCE_OUTPUT.members["recognizedBotMember"], - self.recognized_bot_member, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["input_mode"] = de.read_string( - _SCHEMA_RECOGNIZE_UTTERANCE_OUTPUT.members["inputMode"] - ) - - case 1: - kwargs["content_type"] = de.read_string( - _SCHEMA_RECOGNIZE_UTTERANCE_OUTPUT.members["contentType"] - ) - - case 2: - kwargs["messages"] = de.read_string( - _SCHEMA_RECOGNIZE_UTTERANCE_OUTPUT.members["messages"] - ) - - case 3: - kwargs["interpretations"] = de.read_string( - _SCHEMA_RECOGNIZE_UTTERANCE_OUTPUT.members["interpretations"] - ) - - case 4: - kwargs["session_state"] = de.read_string( - _SCHEMA_RECOGNIZE_UTTERANCE_OUTPUT.members["sessionState"] - ) - - case 5: - kwargs["request_attributes"] = de.read_string( - _SCHEMA_RECOGNIZE_UTTERANCE_OUTPUT.members["requestAttributes"] - ) - - case 6: - kwargs["session_id"] = de.read_string( - _SCHEMA_RECOGNIZE_UTTERANCE_OUTPUT.members["sessionId"] - ) - - case 7: - kwargs["input_transcript"] = de.read_string( - _SCHEMA_RECOGNIZE_UTTERANCE_OUTPUT.members["inputTranscript"] - ) - - case 8: - kwargs["audio_stream"] = de.read_data_stream( - _SCHEMA_RECOGNIZE_UTTERANCE_OUTPUT.members["audioStream"] - ) - - case 9: - kwargs["recognized_bot_member"] = de.read_string( - _SCHEMA_RECOGNIZE_UTTERANCE_OUTPUT.members[ - "recognizedBotMember" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RECOGNIZE_UTTERANCE_OUTPUT, consumer=_consumer) - return kwargs - - -RECOGNIZE_UTTERANCE = APIOperation( - input=RecognizeUtteranceInput, - output=RecognizeUtteranceOutput, - schema=_SCHEMA_RECOGNIZE_UTTERANCE, - input_schema=_SCHEMA_RECOGNIZE_UTTERANCE_INPUT, - output_schema=_SCHEMA_RECOGNIZE_UTTERANCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lexruntimev2#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.lexruntimev2#BadGatewayException" - ): BadGatewayException, - ShapeID("com.amazonaws.lexruntimev2#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.lexruntimev2#DependencyFailedException" - ): DependencyFailedException, - ShapeID( - "com.amazonaws.lexruntimev2#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.lexruntimev2#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.lexruntimev2#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.lexruntimev2#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_BAD_GATEWAY_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_DEPENDENCY_FAILED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class ConversationMode(UnknownEnumMixin, StrEnum): - AUDIO = "AUDIO" - TEXT = "TEXT" - - -@dataclass(kw_only=True) -class DisconnectionEvent: - """ - A notification from the client that it is disconnecting from Amazon Lex - V2. Sending a `DisconnectionEvent` event is optional, but can help - identify a conversation in logs. - """ - - event_id: str | None = None - """ - A unique identifier that your application assigns to the event. You can - use this to identify events in logs. - """ - - client_timestamp_millis: int = 0 - """ - A timestamp set by the client of the date and time that the event was - sent to Amazon Lex V2. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DISCONNECTION_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.event_id is not None: - serializer.write_string( - _SCHEMA_DISCONNECTION_EVENT.members["eventId"], self.event_id - ) - - serializer.write_long( - _SCHEMA_DISCONNECTION_EVENT.members["clientTimestampMillis"], - self.client_timestamp_millis, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["event_id"] = de.read_string( - _SCHEMA_DISCONNECTION_EVENT.members["eventId"] - ) - - case 1: - kwargs["client_timestamp_millis"] = de.read_long( - _SCHEMA_DISCONNECTION_EVENT.members["clientTimestampMillis"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DISCONNECTION_EVENT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DTMFInputEvent: - """ - A DTMF character sent from the client application. DTMF characters are - typically sent from a phone keypad to represent numbers. For example, - you can have Amazon Lex V2 process a credit card number input from a - phone. - """ - - input_character: str = field(repr=False) - """ - The DTMF character that the user pressed. The allowed characters are A - - D, 0 - 9, # and *. - """ - - event_id: str | None = None - """ - A unique identifier that your application assigns to the event. You can - use this to identify events in logs. - """ - - client_timestamp_millis: int = 0 - """ - A timestamp set by the client of the date and time that the event was - sent to Amazon Lex V2. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DTMF_INPUT_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DTMF_INPUT_EVENT.members["inputCharacter"], self.input_character - ) - if self.event_id is not None: - serializer.write_string( - _SCHEMA_DTMF_INPUT_EVENT.members["eventId"], self.event_id - ) - - serializer.write_long( - _SCHEMA_DTMF_INPUT_EVENT.members["clientTimestampMillis"], - self.client_timestamp_millis, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["input_character"] = de.read_string( - _SCHEMA_DTMF_INPUT_EVENT.members["inputCharacter"] - ) - - case 1: - kwargs["event_id"] = de.read_string( - _SCHEMA_DTMF_INPUT_EVENT.members["eventId"] - ) - - case 2: - kwargs["client_timestamp_millis"] = de.read_long( - _SCHEMA_DTMF_INPUT_EVENT.members["clientTimestampMillis"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DTMF_INPUT_EVENT, consumer=_consumer) - if "input_character" not in kwargs: - kwargs["input_character"] = "" - return kwargs - - -@dataclass(kw_only=True) -class PlaybackCompletionEvent: - """ - Event sent from the client application to Amazon Lex V2 to indicate that - playback of audio is complete and that Amazon Lex V2 should start - processing the user's input. - """ - - event_id: str | None = None - """ - A unique identifier that your application assigns to the event. You can - use this to identify events in logs. - """ - - client_timestamp_millis: int = 0 - """ - A timestamp set by the client of the date and time that the event was - sent to Amazon Lex V2. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PLAYBACK_COMPLETION_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.event_id is not None: - serializer.write_string( - _SCHEMA_PLAYBACK_COMPLETION_EVENT.members["eventId"], self.event_id - ) - - serializer.write_long( - _SCHEMA_PLAYBACK_COMPLETION_EVENT.members["clientTimestampMillis"], - self.client_timestamp_millis, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["event_id"] = de.read_string( - _SCHEMA_PLAYBACK_COMPLETION_EVENT.members["eventId"] - ) - - case 1: - kwargs["client_timestamp_millis"] = de.read_long( - _SCHEMA_PLAYBACK_COMPLETION_EVENT.members[ - "clientTimestampMillis" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PLAYBACK_COMPLETION_EVENT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class TextInputEvent: - """ - The event sent from your client application to Amazon Lex V2 with text - input from the user. - """ - - text: str = field(repr=False) - """ - The text from the user. Amazon Lex V2 processes this as a complete - statement. - """ - - event_id: str | None = None - """ - A unique identifier that your application assigns to the event. You can - use this to identify events in logs. - """ - - client_timestamp_millis: int = 0 - """ - A timestamp set by the client of the date and time that the event was - sent to Amazon Lex V2. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TEXT_INPUT_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_TEXT_INPUT_EVENT.members["text"], self.text) - if self.event_id is not None: - serializer.write_string( - _SCHEMA_TEXT_INPUT_EVENT.members["eventId"], self.event_id - ) - - serializer.write_long( - _SCHEMA_TEXT_INPUT_EVENT.members["clientTimestampMillis"], - self.client_timestamp_millis, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["text"] = de.read_string( - _SCHEMA_TEXT_INPUT_EVENT.members["text"] - ) - - case 1: - kwargs["event_id"] = de.read_string( - _SCHEMA_TEXT_INPUT_EVENT.members["eventId"] - ) - - case 2: - kwargs["client_timestamp_millis"] = de.read_long( - _SCHEMA_TEXT_INPUT_EVENT.members["clientTimestampMillis"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TEXT_INPUT_EVENT, consumer=_consumer) - if "text" not in kwargs: - kwargs["text"] = "" - return kwargs - - -@dataclass(kw_only=True) -class HeartbeatEvent: - """ - Event that Amazon Lex V2 sends to indicate that the stream is still open - between the client application and Amazon Lex V2 - """ - - event_id: str | None = None - """ - A unique identifier of the event sent by Amazon Lex V2. The identifier - is in the form `RESPONSE-N`, where N is a number starting with one and - incremented for each event sent by Amazon Lex V2 in the current session. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HEARTBEAT_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.event_id is not None: - serializer.write_string( - _SCHEMA_HEARTBEAT_EVENT.members["eventId"], self.event_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["event_id"] = de.read_string( - _SCHEMA_HEARTBEAT_EVENT.members["eventId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_HEARTBEAT_EVENT, consumer=_consumer) - return kwargs - - -class InputMode(UnknownEnumMixin, StrEnum): - TEXT = "Text" - SPEECH = "Speech" - DTMF = "DTMF" - - -class PlaybackInterruptionReason(UnknownEnumMixin, StrEnum): - DTMF_START_DETECTED = "DTMF_START_DETECTED" - TEXT_DETECTED = "TEXT_DETECTED" - VOICE_START_DETECTED = "VOICE_START_DETECTED" - - -@dataclass(kw_only=True) -class PlaybackInterruptionEvent: - """ - Event sent from Amazon Lex V2 to indicate to the client application - should stop playback of audio. For example, if the client is playing a - prompt that asks for the user's telephone number, the user might start - to say the phone number before the prompt is complete. Amazon Lex V2 - sends this event to the client application to indicate that the user is - responding and that Amazon Lex V2 is processing their input. - """ - - event_reason: str | None = None - """Indicates the type of user input that Amazon Lex V2 detected.""" - - caused_by_event_id: str | None = None - """ - The identifier of the event that contained the audio, DTMF, or text that - caused the interruption. - """ - - event_id: str | None = None - """ - A unique identifier of the event sent by Amazon Lex V2. The identifier - is in the form `RESPONSE-N`, where N is a number starting with one and - incremented for each event sent by Amazon Lex V2 in the current session. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PLAYBACK_INTERRUPTION_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.event_reason is not None: - serializer.write_string( - _SCHEMA_PLAYBACK_INTERRUPTION_EVENT.members["eventReason"], - self.event_reason, - ) - - if self.caused_by_event_id is not None: - serializer.write_string( - _SCHEMA_PLAYBACK_INTERRUPTION_EVENT.members["causedByEventId"], - self.caused_by_event_id, - ) - - if self.event_id is not None: - serializer.write_string( - _SCHEMA_PLAYBACK_INTERRUPTION_EVENT.members["eventId"], self.event_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["event_reason"] = PlaybackInterruptionReason( - de.read_string( - _SCHEMA_PLAYBACK_INTERRUPTION_EVENT.members["eventReason"] - ) - ) - - case 1: - kwargs["caused_by_event_id"] = de.read_string( - _SCHEMA_PLAYBACK_INTERRUPTION_EVENT.members["causedByEventId"] - ) - - case 2: - kwargs["event_id"] = de.read_string( - _SCHEMA_PLAYBACK_INTERRUPTION_EVENT.members["eventId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PLAYBACK_INTERRUPTION_EVENT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class TextResponseEvent: - """ - The event sent from Amazon Lex V2 to your application with text to - present to the user. - """ - - messages: list[Message] | None = None - """ - A list of messages to send to the user. Messages are ordered based on - the order that you returned the messages from your Lambda function or - the order that the messages are defined in the bot. - """ - - event_id: str | None = None - """ - A unique identifier of the event sent by Amazon Lex V2. The identifier - is in the form `RESPONSE-N`, where N is a number starting with one and - incremented for each event sent by Amazon Lex V2 in the current session. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TEXT_RESPONSE_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.messages is not None: - _serialize_messages( - serializer, - _SCHEMA_TEXT_RESPONSE_EVENT.members["messages"], - self.messages, - ) - - if self.event_id is not None: - serializer.write_string( - _SCHEMA_TEXT_RESPONSE_EVENT.members["eventId"], self.event_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["messages"] = _deserialize_messages( - de, _SCHEMA_TEXT_RESPONSE_EVENT.members["messages"] - ) - - case 1: - kwargs["event_id"] = de.read_string( - _SCHEMA_TEXT_RESPONSE_EVENT.members["eventId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TEXT_RESPONSE_EVENT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class TranscriptEvent: - """ - Event sent from Amazon Lex V2 to your client application that contains a - transcript of voice audio. - """ - - transcript: str | None = None - """The transcript of the voice audio from the user.""" - - event_id: str | None = None - """ - A unique identifier of the event sent by Amazon Lex V2. The identifier - is in the form `RESPONSE-N`, where N is a number starting with one and - incremented for each event sent by Amazon Lex V2 in the current session. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRANSCRIPT_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.transcript is not None: - serializer.write_string( - _SCHEMA_TRANSCRIPT_EVENT.members["transcript"], self.transcript - ) - - if self.event_id is not None: - serializer.write_string( - _SCHEMA_TRANSCRIPT_EVENT.members["eventId"], self.event_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["transcript"] = de.read_string( - _SCHEMA_TRANSCRIPT_EVENT.members["transcript"] - ) - - case 1: - kwargs["event_id"] = de.read_string( - _SCHEMA_TRANSCRIPT_EVENT.members["eventId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TRANSCRIPT_EVENT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ElicitSubSlot: - """ - The specific constituent sub slot of the composite slot to elicit in - dialog action. - """ - - name: str - """The name of the slot that should be elicited from the user.""" - - sub_slot_to_elicit: "ElicitSubSlot | None" = None - """The field is not supported.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ELICIT_SUB_SLOT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_ELICIT_SUB_SLOT.members["name"], self.name) - if self.sub_slot_to_elicit is not None: - serializer.write_struct( - _SCHEMA_ELICIT_SUB_SLOT.members["subSlotToElicit"], - self.sub_slot_to_elicit, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_ELICIT_SUB_SLOT.members["name"] - ) - - case 1: - kwargs["sub_slot_to_elicit"] = ElicitSubSlot.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ELICIT_SUB_SLOT, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - return kwargs - - -@dataclass(kw_only=True) -class DialogAction: - """The next action that Amazon Lex V2 should take.""" - - type: str - """ - The next action that the bot should take in its interaction with the - user. The following values are possible: - - - `Close` -- Indicates that there will not be a response from the user. - For example, the statement \"Your order has been placed\" does not - require a response. - - - `ConfirmIntent` -- The next action is asking the user if the intent is - complete and ready to be fulfilled. This is a yes/no question such as - \"Place the order?\" - - - `Delegate` -- The next action is determined by Amazon Lex V2. - - - `ElicitIntent` -- The next action is to elicit an intent from the - user. - - - `ElicitSlot` -- The next action is to elicit a slot value from the - user. - """ - - slot_to_elicit: str | None = None - """The name of the slot that should be elicited from the user.""" - - slot_elicitation_style: str | None = None - """ - Configures the slot to use spell-by-letter or spell-by-word style. When - you use a style on a slot, users can spell out their input to make it - clear to your bot. - - - Spell by letter - \"b\" \"o\" \"b\" - - - Spell by word - \"b as in boy\" \"o as in oscar\" \"b as in boy\" - - For more information, see [Using spelling to enter slot - values](https://docs.aws.amazon.com/lexv2/latest/dg/spelling-styles.html) - . - """ - - sub_slot_to_elicit: "ElicitSubSlot | None" = None - """ - The name of the constituent sub slot of the composite slot specified in - slotToElicit that should be elicited from the user. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DIALOG_ACTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_DIALOG_ACTION.members["type"], self.type) - if self.slot_to_elicit is not None: - serializer.write_string( - _SCHEMA_DIALOG_ACTION.members["slotToElicit"], self.slot_to_elicit - ) - - if self.slot_elicitation_style is not None: - serializer.write_string( - _SCHEMA_DIALOG_ACTION.members["slotElicitationStyle"], - self.slot_elicitation_style, - ) - - if self.sub_slot_to_elicit is not None: - serializer.write_struct( - _SCHEMA_DIALOG_ACTION.members["subSlotToElicit"], - self.sub_slot_to_elicit, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = DialogActionType( - de.read_string(_SCHEMA_DIALOG_ACTION.members["type"]) - ) - - case 1: - kwargs["slot_to_elicit"] = de.read_string( - _SCHEMA_DIALOG_ACTION.members["slotToElicit"] - ) - - case 2: - kwargs["slot_elicitation_style"] = StyleType( - de.read_string( - _SCHEMA_DIALOG_ACTION.members["slotElicitationStyle"] - ) - ) - - case 3: - kwargs["sub_slot_to_elicit"] = ElicitSubSlot.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DIALOG_ACTION, consumer=_consumer) - if "type" not in kwargs: - kwargs["type"] = DialogActionType._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class RuntimeHintDetails: - """ - Provides an array of phrases that should be given preference when - resolving values for a slot. - """ - - runtime_hint_values: list[RuntimeHintValue] | None = None - """ - One or more strings that Amazon Lex V2 should look for in the input to - the bot. Each phrase is given preference when deciding on slot values. - """ - - sub_slot_hints: "dict[str, RuntimeHintDetails] | None" = None - """ - A map of constituent sub slot names inside a composite slot in the - intent and the phrases that should be added for each sub slot. Inside - each composite slot hints, this structure provides a mechanism to add - granular sub slot phrases. Only sub slot hints are supported for - composite slots. The intent name, composite slot name and the - constituent sub slot names must exist. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RUNTIME_HINT_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.runtime_hint_values is not None: - _serialize_runtime_hint_values_list( - serializer, - _SCHEMA_RUNTIME_HINT_DETAILS.members["runtimeHintValues"], - self.runtime_hint_values, - ) - - if self.sub_slot_hints is not None: - _serialize_slot_hints_slot_map( - serializer, - _SCHEMA_RUNTIME_HINT_DETAILS.members["subSlotHints"], - self.sub_slot_hints, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["runtime_hint_values"] = ( - _deserialize_runtime_hint_values_list( - de, - _SCHEMA_RUNTIME_HINT_DETAILS.members["runtimeHintValues"], - ) - ) - - case 1: - kwargs["sub_slot_hints"] = _deserialize_slot_hints_slot_map( - de, _SCHEMA_RUNTIME_HINT_DETAILS.members["subSlotHints"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RUNTIME_HINT_DETAILS, consumer=_consumer) - return kwargs - - -def _serialize_slot_hints_slot_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, RuntimeHintDetails] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_struct(value_schema, v)) - - -def _deserialize_slot_hints_slot_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, RuntimeHintDetails]: - result: dict[str, RuntimeHintDetails] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = RuntimeHintDetails.deserialize(d) - - deserializer.read_map(schema, _read_value) - return result - - -def _serialize_slot_hints_intent_map( - serializer: ShapeSerializer, - schema: Schema, - value: dict[str, dict[str, RuntimeHintDetails]], -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: _serialize_slot_hints_slot_map(vs, value_schema, v)) - - -def _deserialize_slot_hints_intent_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, dict[str, RuntimeHintDetails]]: - result: dict[str, dict[str, RuntimeHintDetails]] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = _deserialize_slot_hints_slot_map(d, value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class RuntimeHints: - """ - You can provide Amazon Lex V2 with hints to the phrases that a customer - is likely to use for a slot. When a slot with hints is resolved, the - phrases in the runtime hints are preferred in the resolution. You can - provide hints for a maximum of 100 intents. You can provide a maximum of - 100 slots. - - Before you can use runtime hints with an existing bot, you must first - rebuild the bot. - - For more information, see [Using runtime hints to improve recognition of - slot - values](https://docs.aws.amazon.com/lexv2/latest/dg/using-hints.html). - """ - - slot_hints: "dict[str, dict[str, RuntimeHintDetails]] | None" = None - """ - A list of the slots in the intent that should have runtime hints added, - and the phrases that should be added for each slot. - - The first level of the `slotHints` map is the name of the intent. The - second level is the name of the slot within the intent. For more - information, see [Using hints to improve - accuracy](https://docs.aws.amazon.com/lexv2/latest/dg/using-hints.html). - - The intent name and slot name must exist. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RUNTIME_HINTS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.slot_hints is not None: - _serialize_slot_hints_intent_map( - serializer, _SCHEMA_RUNTIME_HINTS.members["slotHints"], self.slot_hints - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["slot_hints"] = _deserialize_slot_hints_intent_map( - de, _SCHEMA_RUNTIME_HINTS.members["slotHints"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RUNTIME_HINTS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Slot: - """A value that Amazon Lex V2 uses to fulfill an intent.""" - - value: Value | None = None - """The current value of the slot.""" - - shape: str | None = None - """ - When the `shape` value is `List`, it indicates that the `values` field - contains a list of slot values. When the value is `Scalar`, it indicates - that the `value` field contains a single value. - """ - - values: "list[Slot] | None" = None - """ - A list of one or more values that the user provided for the slot. For - example, if a for a slot that elicits pizza toppings, the values might - be \"pepperoni\" and \"pineapple.\" - """ - - sub_slots: "dict[str, Slot] | None" = None - """The constituent sub slots of a composite slot.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SLOT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.value is not None: - serializer.write_struct(_SCHEMA_SLOT.members["value"], self.value) - - if self.shape is not None: - serializer.write_string(_SCHEMA_SLOT.members["shape"], self.shape) - - if self.values is not None: - _serialize_values(serializer, _SCHEMA_SLOT.members["values"], self.values) - - if self.sub_slots is not None: - _serialize_slots( - serializer, _SCHEMA_SLOT.members["subSlots"], self.sub_slots - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["value"] = Value.deserialize(de) - - case 1: - kwargs["shape"] = Shape( - de.read_string(_SCHEMA_SLOT.members["shape"]) - ) - - case 2: - kwargs["values"] = _deserialize_values( - de, _SCHEMA_SLOT.members["values"] - ) - - case 3: - kwargs["sub_slots"] = _deserialize_slots( - de, _SCHEMA_SLOT.members["subSlots"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SLOT, consumer=_consumer) - return kwargs - - -def _serialize_slots( - serializer: ShapeSerializer, schema: Schema, value: dict[str, Slot] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_struct(value_schema, v)) - - -def _deserialize_slots( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, Slot]: - result: dict[str, Slot] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = Slot.deserialize(d) - - deserializer.read_map(schema, _read_value) - return result - - -def _serialize_values( - serializer: ShapeSerializer, schema: Schema, value: list[Slot] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_values(deserializer: ShapeDeserializer, schema: Schema) -> list[Slot]: - result: list[Slot] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Slot.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class Intent: - """The current intent that Amazon Lex V2 is attempting to fulfill.""" - - name: str - """The name of the intent.""" - - slots: "dict[str, Slot] | None" = None - """ - A map of all of the slots for the intent. The name of the slot maps to - the value of the slot. If a slot has not been filled, the value is null. - """ - - state: str | None = None - """ - Indicates the fulfillment state for the intent. The meanings of each - value are as follows: - - - `Failed` -- The bot failed to fulfill the intent. - - - `Fulfilled` -- The bot has completed fulfillment of the intent. - - - `FulfillmentInProgress` -- The bot is in the middle of fulfilling the - intent. - - - `InProgress` -- The bot is in the middle of eliciting the slot values - that are necessary to fulfill the intent. - - - `ReadyForFulfillment` -- The bot has elicited all the slot values for - the intent and is ready to fulfill the intent. - - - `Waiting` -- The bot is waiting for a response from the user (limited - to streaming conversations). - """ - - confirmation_state: str | None = None - """ - Indicates whether the intent has been `Confirmed`, `Denied`, or `None` - if the confirmation stage has not yet been reached. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INTENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_INTENT.members["name"], self.name) - if self.slots is not None: - _serialize_slots(serializer, _SCHEMA_INTENT.members["slots"], self.slots) - - if self.state is not None: - serializer.write_string(_SCHEMA_INTENT.members["state"], self.state) - - if self.confirmation_state is not None: - serializer.write_string( - _SCHEMA_INTENT.members["confirmationState"], self.confirmation_state - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string(_SCHEMA_INTENT.members["name"]) - - case 1: - kwargs["slots"] = _deserialize_slots( - de, _SCHEMA_INTENT.members["slots"] - ) - - case 2: - kwargs["state"] = IntentState( - de.read_string(_SCHEMA_INTENT.members["state"]) - ) - - case 3: - kwargs["confirmation_state"] = ConfirmationState( - de.read_string(_SCHEMA_INTENT.members["confirmationState"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INTENT, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - return kwargs - - -@dataclass(kw_only=True) -class Interpretation: - """ - An object containing information about an intent that Amazon Lex V2 - determined might satisfy the user's utterance. The intents are ordered - by the confidence score. - """ - - nlu_confidence: ConfidenceScore | None = None - """ - Determines the threshold where Amazon Lex V2 will insert the - `AMAZON.FallbackIntent`, `AMAZON.KendraSearchIntent`, or both when - returning alternative intents in a response. `AMAZON.FallbackIntent` and - `AMAZON.KendraSearchIntent` are only inserted if they are configured for - the bot. - """ - - sentiment_response: SentimentResponse | None = None - """ - The sentiment expressed in an utterance. - - When the bot is configured to send utterances to Amazon Comprehend for - sentiment analysis, this field contains the result of the analysis. - """ - - intent: "Intent | None" = None - """ - A list of intents that might satisfy the user's utterance. The intents - are ordered by the confidence score. - """ - - interpretation_source: str | None = None - """Specifies the service that interpreted the input.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INTERPRETATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.nlu_confidence is not None: - serializer.write_struct( - _SCHEMA_INTERPRETATION.members["nluConfidence"], self.nlu_confidence - ) - - if self.sentiment_response is not None: - serializer.write_struct( - _SCHEMA_INTERPRETATION.members["sentimentResponse"], - self.sentiment_response, - ) - - if self.intent is not None: - serializer.write_struct( - _SCHEMA_INTERPRETATION.members["intent"], self.intent - ) - - if self.interpretation_source is not None: - serializer.write_string( - _SCHEMA_INTERPRETATION.members["interpretationSource"], - self.interpretation_source, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["nlu_confidence"] = ConfidenceScore.deserialize(de) - - case 1: - kwargs["sentiment_response"] = SentimentResponse.deserialize(de) - - case 2: - kwargs["intent"] = Intent.deserialize(de) - - case 3: - kwargs["interpretation_source"] = InterpretationSource( - de.read_string( - _SCHEMA_INTERPRETATION.members["interpretationSource"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INTERPRETATION, consumer=_consumer) - return kwargs - - -def _serialize_interpretations( - serializer: ShapeSerializer, schema: Schema, value: list[Interpretation] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_interpretations( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Interpretation]: - result: list[Interpretation] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Interpretation.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class SessionState: - """The state of the user's session with Amazon Lex V2.""" - - dialog_action: "DialogAction | None" = None - """ - The next step that Amazon Lex V2 should take in the conversation with a - user. - """ - - intent: "Intent | None" = None - """The active intent that Amazon Lex V2 is processing.""" - - active_contexts: list[ActiveContext] | None = None - """ - One or more contexts that indicate to Amazon Lex V2 the context of a - request. When a context is active, Amazon Lex V2 considers intents with - the matching context as a trigger as the next intent in a session. - """ - - session_attributes: dict[str, str] | None = None - """ - Map of key/value pairs representing session-specific context - information. It contains application information passed between Amazon - Lex V2 and a client application. - """ - - originating_request_id: str | None = None - """A unique identifier for a specific request.""" - - runtime_hints: "RuntimeHints | None" = None - """ - Hints for phrases that a customer is likely to use for a slot. Amazon - Lex V2 uses the hints to help determine the correct value of a slot. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SESSION_STATE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.dialog_action is not None: - serializer.write_struct( - _SCHEMA_SESSION_STATE.members["dialogAction"], self.dialog_action - ) - - if self.intent is not None: - serializer.write_struct( - _SCHEMA_SESSION_STATE.members["intent"], self.intent - ) - - if self.active_contexts is not None: - _serialize_active_contexts_list( - serializer, - _SCHEMA_SESSION_STATE.members["activeContexts"], - self.active_contexts, - ) - - if self.session_attributes is not None: - _serialize_string_map( - serializer, - _SCHEMA_SESSION_STATE.members["sessionAttributes"], - self.session_attributes, - ) - - if self.originating_request_id is not None: - serializer.write_string( - _SCHEMA_SESSION_STATE.members["originatingRequestId"], - self.originating_request_id, - ) - - if self.runtime_hints is not None: - serializer.write_struct( - _SCHEMA_SESSION_STATE.members["runtimeHints"], self.runtime_hints - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["dialog_action"] = DialogAction.deserialize(de) - - case 1: - kwargs["intent"] = Intent.deserialize(de) - - case 2: - kwargs["active_contexts"] = _deserialize_active_contexts_list( - de, _SCHEMA_SESSION_STATE.members["activeContexts"] - ) - - case 3: - kwargs["session_attributes"] = _deserialize_string_map( - de, _SCHEMA_SESSION_STATE.members["sessionAttributes"] - ) - - case 4: - kwargs["originating_request_id"] = de.read_string( - _SCHEMA_SESSION_STATE.members["originatingRequestId"] - ) - - case 5: - kwargs["runtime_hints"] = RuntimeHints.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SESSION_STATE, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ConfigurationEvent: - """ - The initial event sent from the application to Amazon Lex V2 to - configure the conversation, including session and request attributes and - the response content type. - """ - - response_content_type: str - """ - The message that Amazon Lex V2 returns in the response can be either - text or speech based on the `responseContentType` value. - - - If the value is `text/plain;charset=utf-8`, Amazon Lex V2 returns text - in the response. - - - If the value begins with `audio/`, Amazon Lex V2 returns speech in the - response. Amazon Lex V2 uses Amazon Polly to generate the speech using - the configuration that you specified in the `requestContentType` - parameter. For example, if you specify `audio/mpeg` as the value, - Amazon Lex V2 returns speech in the MPEG format. - - - If the value is `audio/pcm`, the speech returned is audio/pcm in - 16-bit, little-endian format. - - - The following are the accepted values: - - - audio/mpeg - - - audio/ogg - - - audio/pcm - - - audio/* (defaults to mpeg) - - - text/plain; charset=utf-8 - """ - - request_attributes: dict[str, str] | None = None - """ - Request-specific information passed between the client application and - Amazon Lex V2. - - The namespace `x-amz-lex:` is reserved for special attributes. Don't - create any request attributes for prefix `x-amz-lex:`. - """ - - session_state: "SessionState | None" = None - """The state of the user's session with Amazon Lex V2.""" - - welcome_messages: list[Message] | None = None - """ - A list of messages to send to the user. - - If you set the `welcomeMessage` field, you must also set the - [`DialogAction`](https://docs.aws.amazon.com/lexv2/latest/dg/API_runtime_DialogAction.html) - structure's - [`type`](https://docs.aws.amazon.com/lexv2/latest/dg/API_runtime_DialogAction.html#lexv2-Type-runtime_DialogAction-type) - field. - """ - - disable_playback: bool = False - """ - Determines whether Amazon Lex V2 should send audio responses to the - client application. - - Set this field to false when the client is operating in a playback mode - where audio responses are played to the user. If the client isn't - operating in playback mode, such as a text chat application, set this to - true so that Amazon Lex V2 doesn't wait for the prompt to finish - playing on the client. - """ - - event_id: str | None = None - """ - A unique identifier that your application assigns to the event. You can - use this to identify events in logs. - """ - - client_timestamp_millis: int = 0 - """ - A timestamp set by the client of the date and time that the event was - sent to Amazon Lex V2. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONFIGURATION_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.request_attributes is not None: - _serialize_string_map( - serializer, - _SCHEMA_CONFIGURATION_EVENT.members["requestAttributes"], - self.request_attributes, - ) - - serializer.write_string( - _SCHEMA_CONFIGURATION_EVENT.members["responseContentType"], - self.response_content_type, - ) - if self.session_state is not None: - serializer.write_struct( - _SCHEMA_CONFIGURATION_EVENT.members["sessionState"], self.session_state - ) - - if self.welcome_messages is not None: - _serialize_messages( - serializer, - _SCHEMA_CONFIGURATION_EVENT.members["welcomeMessages"], - self.welcome_messages, - ) - - serializer.write_boolean( - _SCHEMA_CONFIGURATION_EVENT.members["disablePlayback"], - self.disable_playback, - ) - if self.event_id is not None: - serializer.write_string( - _SCHEMA_CONFIGURATION_EVENT.members["eventId"], self.event_id - ) - - serializer.write_long( - _SCHEMA_CONFIGURATION_EVENT.members["clientTimestampMillis"], - self.client_timestamp_millis, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["request_attributes"] = _deserialize_string_map( - de, _SCHEMA_CONFIGURATION_EVENT.members["requestAttributes"] - ) - - case 1: - kwargs["response_content_type"] = de.read_string( - _SCHEMA_CONFIGURATION_EVENT.members["responseContentType"] - ) - - case 2: - kwargs["session_state"] = SessionState.deserialize(de) - - case 3: - kwargs["welcome_messages"] = _deserialize_messages( - de, _SCHEMA_CONFIGURATION_EVENT.members["welcomeMessages"] - ) - - case 4: - kwargs["disable_playback"] = de.read_boolean( - _SCHEMA_CONFIGURATION_EVENT.members["disablePlayback"] - ) - - case 5: - kwargs["event_id"] = de.read_string( - _SCHEMA_CONFIGURATION_EVENT.members["eventId"] - ) - - case 6: - kwargs["client_timestamp_millis"] = de.read_long( - _SCHEMA_CONFIGURATION_EVENT.members["clientTimestampMillis"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONFIGURATION_EVENT, consumer=_consumer) - if "response_content_type" not in kwargs: - kwargs["response_content_type"] = "" - return kwargs - - -@dataclass(kw_only=True) -class PutSessionInput: - """Dataclass for PutSessionInput structure.""" - - bot_id: str | None = None - """The identifier of the bot that receives the session data.""" - - bot_alias_id: str | None = None - """The alias identifier of the bot that receives the session data.""" - - locale_id: str | None = None - """The locale where the session is in use.""" - - session_id: str | None = None - """The identifier of the session that receives the session data.""" - - messages: list[Message] | None = None - """ - A list of messages to send to the user. Messages are sent in the order - that they are defined in the list. - """ - - session_state: "SessionState | None" = None - """ - Sets the state of the session with the user. You can use this to set the - current intent, attributes, context, and dialog action. Use the dialog - action to determine the next step that Amazon Lex V2 should use in the - conversation with the user. - """ - - request_attributes: dict[str, str] | None = None - """ - Request-specific information passed between Amazon Lex V2 and the client - application. - - The namespace `x-amz-lex:` is reserved for special attributes. Don't - create any request attributes with the prefix `x-amz-lex:`. - """ - - response_content_type: str | None = None - """ - The message that Amazon Lex V2 returns in the response can be either - text or speech depending on the value of this parameter. - - - If the value is `text/plain; charset=utf-8`, Amazon Lex V2 returns - text in the response. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_SESSION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.bot_id is not None: - serializer.write_string( - _SCHEMA_PUT_SESSION_INPUT.members["botId"], self.bot_id - ) - - if self.bot_alias_id is not None: - serializer.write_string( - _SCHEMA_PUT_SESSION_INPUT.members["botAliasId"], self.bot_alias_id - ) - - if self.locale_id is not None: - serializer.write_string( - _SCHEMA_PUT_SESSION_INPUT.members["localeId"], self.locale_id - ) - - if self.session_id is not None: - serializer.write_string( - _SCHEMA_PUT_SESSION_INPUT.members["sessionId"], self.session_id - ) - - if self.messages is not None: - _serialize_messages( - serializer, _SCHEMA_PUT_SESSION_INPUT.members["messages"], self.messages - ) - - if self.session_state is not None: - serializer.write_struct( - _SCHEMA_PUT_SESSION_INPUT.members["sessionState"], self.session_state - ) - - if self.request_attributes is not None: - _serialize_string_map( - serializer, - _SCHEMA_PUT_SESSION_INPUT.members["requestAttributes"], - self.request_attributes, - ) - - if self.response_content_type is not None: - serializer.write_string( - _SCHEMA_PUT_SESSION_INPUT.members["responseContentType"], - self.response_content_type, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bot_id"] = de.read_string( - _SCHEMA_PUT_SESSION_INPUT.members["botId"] - ) - - case 1: - kwargs["bot_alias_id"] = de.read_string( - _SCHEMA_PUT_SESSION_INPUT.members["botAliasId"] - ) - - case 2: - kwargs["locale_id"] = de.read_string( - _SCHEMA_PUT_SESSION_INPUT.members["localeId"] - ) - - case 3: - kwargs["session_id"] = de.read_string( - _SCHEMA_PUT_SESSION_INPUT.members["sessionId"] - ) - - case 4: - kwargs["messages"] = _deserialize_messages( - de, _SCHEMA_PUT_SESSION_INPUT.members["messages"] - ) - - case 5: - kwargs["session_state"] = SessionState.deserialize(de) - - case 6: - kwargs["request_attributes"] = _deserialize_string_map( - de, _SCHEMA_PUT_SESSION_INPUT.members["requestAttributes"] - ) - - case 7: - kwargs["response_content_type"] = de.read_string( - _SCHEMA_PUT_SESSION_INPUT.members["responseContentType"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUT_SESSION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class RecognizeTextInput: - """Dataclass for RecognizeTextInput structure.""" - - bot_id: str | None = None - """The identifier of the bot that processes the request.""" - - bot_alias_id: str | None = None - """The alias identifier in use for the bot that processes the request.""" - - locale_id: str | None = None - """The locale where the session is in use.""" - - session_id: str | None = None - """The identifier of the user session that is having the conversation.""" - - text: str | None = field(repr=False, default=None) - """The text that the user entered. Amazon Lex V2 interprets this text.""" - - session_state: "SessionState | None" = None - """The current state of the dialog between the user and the bot.""" - - request_attributes: dict[str, str] | None = None - """ - Request-specific information passed between the client application and - Amazon Lex V2 - - The namespace `x-amz-lex:` is reserved for special attributes. Don't - create any request attributes with the prefix `x-amz-lex:`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RECOGNIZE_TEXT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.bot_id is not None: - serializer.write_string( - _SCHEMA_RECOGNIZE_TEXT_INPUT.members["botId"], self.bot_id - ) - - if self.bot_alias_id is not None: - serializer.write_string( - _SCHEMA_RECOGNIZE_TEXT_INPUT.members["botAliasId"], self.bot_alias_id - ) - - if self.locale_id is not None: - serializer.write_string( - _SCHEMA_RECOGNIZE_TEXT_INPUT.members["localeId"], self.locale_id - ) - - if self.session_id is not None: - serializer.write_string( - _SCHEMA_RECOGNIZE_TEXT_INPUT.members["sessionId"], self.session_id - ) - - if self.text is not None: - serializer.write_string( - _SCHEMA_RECOGNIZE_TEXT_INPUT.members["text"], self.text - ) - - if self.session_state is not None: - serializer.write_struct( - _SCHEMA_RECOGNIZE_TEXT_INPUT.members["sessionState"], self.session_state - ) - - if self.request_attributes is not None: - _serialize_string_map( - serializer, - _SCHEMA_RECOGNIZE_TEXT_INPUT.members["requestAttributes"], - self.request_attributes, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bot_id"] = de.read_string( - _SCHEMA_RECOGNIZE_TEXT_INPUT.members["botId"] - ) - - case 1: - kwargs["bot_alias_id"] = de.read_string( - _SCHEMA_RECOGNIZE_TEXT_INPUT.members["botAliasId"] - ) - - case 2: - kwargs["locale_id"] = de.read_string( - _SCHEMA_RECOGNIZE_TEXT_INPUT.members["localeId"] - ) - - case 3: - kwargs["session_id"] = de.read_string( - _SCHEMA_RECOGNIZE_TEXT_INPUT.members["sessionId"] - ) - - case 4: - kwargs["text"] = de.read_string( - _SCHEMA_RECOGNIZE_TEXT_INPUT.members["text"] - ) - - case 5: - kwargs["session_state"] = SessionState.deserialize(de) - - case 6: - kwargs["request_attributes"] = _deserialize_string_map( - de, _SCHEMA_RECOGNIZE_TEXT_INPUT.members["requestAttributes"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RECOGNIZE_TEXT_INPUT, consumer=_consumer) - return kwargs - - -PUT_SESSION = APIOperation( - input=PutSessionInput, - output=PutSessionOutput, - schema=_SCHEMA_PUT_SESSION, - input_schema=_SCHEMA_PUT_SESSION_INPUT, - output_schema=_SCHEMA_PUT_SESSION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lexruntimev2#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.lexruntimev2#BadGatewayException" - ): BadGatewayException, - ShapeID("com.amazonaws.lexruntimev2#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.lexruntimev2#DependencyFailedException" - ): DependencyFailedException, - ShapeID( - "com.amazonaws.lexruntimev2#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.lexruntimev2#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.lexruntimev2#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.lexruntimev2#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_BAD_GATEWAY_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_DEPENDENCY_FAILED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass -class StartConversationRequestEventStreamConfigurationEvent: - """ - Configuration information sent from your client application to Amazon - Lex V2 - """ - - value: "ConfigurationEvent" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_CONVERSATION_REQUEST_EVENT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_START_CONVERSATION_REQUEST_EVENT_STREAM.members[ - "ConfigurationEvent" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ConfigurationEvent.deserialize(deserializer)) - - -@dataclass -class StartConversationRequestEventStreamAudioInputEvent: - """ - Speech audio sent from your client application to Amazon Lex V2. Audio - starts accumulating when Amazon Lex V2 identifies a voice and continues - until a natural pause in the speech is found before processing. - """ - - value: AudioInputEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_CONVERSATION_REQUEST_EVENT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_START_CONVERSATION_REQUEST_EVENT_STREAM.members["AudioInputEvent"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=AudioInputEvent.deserialize(deserializer)) - - -@dataclass -class StartConversationRequestEventStreamDTMFInputEvent: - """ - DTMF information sent to Amazon Lex V2 by your application. Amazon Lex - V2 accumulates the DMTF information from when the user sends the first - character and ends - - - when there's a pause longer that the value configured for the end - timeout. - - - when there's a digit that is the configured end character. - - - when Amazon Lex V2 accumulates characters equal to the maximum DTMF - character configuration. - """ - - value: DTMFInputEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_CONVERSATION_REQUEST_EVENT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_START_CONVERSATION_REQUEST_EVENT_STREAM.members["DTMFInputEvent"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=DTMFInputEvent.deserialize(deserializer)) - - -@dataclass -class StartConversationRequestEventStreamTextInputEvent: - """ - Text sent from your client application to Amazon Lex V2. Each - `TextInputEvent` is processed individually. - """ - - value: TextInputEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_CONVERSATION_REQUEST_EVENT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_START_CONVERSATION_REQUEST_EVENT_STREAM.members["TextInputEvent"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=TextInputEvent.deserialize(deserializer)) - - -@dataclass -class StartConversationRequestEventStreamPlaybackCompletionEvent: - """ - Event sent from the client application to Amazon Lex V2 to indicate that - it has finished playing audio and that Amazon Lex V2 should start - listening for user input. - """ - - value: PlaybackCompletionEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_CONVERSATION_REQUEST_EVENT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_START_CONVERSATION_REQUEST_EVENT_STREAM.members[ - "PlaybackCompletionEvent" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=PlaybackCompletionEvent.deserialize(deserializer)) - - -@dataclass -class StartConversationRequestEventStreamDisconnectionEvent: - """ - Event sent from the client application to indicate to Amazon Lex V2 that - the conversation is over. - """ - - value: DisconnectionEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_CONVERSATION_REQUEST_EVENT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_START_CONVERSATION_REQUEST_EVENT_STREAM.members[ - "DisconnectionEvent" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=DisconnectionEvent.deserialize(deserializer)) - - -@dataclass -class StartConversationRequestEventStreamUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -StartConversationRequestEventStream = Union[ - StartConversationRequestEventStreamConfigurationEvent - | StartConversationRequestEventStreamAudioInputEvent - | StartConversationRequestEventStreamDTMFInputEvent - | StartConversationRequestEventStreamTextInputEvent - | StartConversationRequestEventStreamPlaybackCompletionEvent - | StartConversationRequestEventStreamDisconnectionEvent - | StartConversationRequestEventStreamUnknown -] -""" -Represents a stream of events between your application and Amazon Lex -V2. -""" - - -class _StartConversationRequestEventStreamDeserializer: - _result: StartConversationRequestEventStream | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> StartConversationRequestEventStream: - self._result = None - deserializer.read_struct( - _SCHEMA_START_CONVERSATION_REQUEST_EVENT_STREAM, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - StartConversationRequestEventStreamConfigurationEvent.deserialize( - de - ) - ) - - case 1: - self._set_result( - StartConversationRequestEventStreamAudioInputEvent.deserialize(de) - ) - - case 2: - self._set_result( - StartConversationRequestEventStreamDTMFInputEvent.deserialize(de) - ) - - case 3: - self._set_result( - StartConversationRequestEventStreamTextInputEvent.deserialize(de) - ) - - case 4: - self._set_result( - StartConversationRequestEventStreamPlaybackCompletionEvent.deserialize( - de - ) - ) - - case 5: - self._set_result( - StartConversationRequestEventStreamDisconnectionEvent.deserialize( - de - ) - ) - - case _: - self._set_result( - StartConversationRequestEventStreamUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: StartConversationRequestEventStream) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class StartConversationInput: - """Dataclass for StartConversationInput structure.""" - - bot_id: str | None = None - """The identifier of the bot to process the request.""" - - bot_alias_id: str | None = None - """The alias identifier in use for the bot that processes the request.""" - - locale_id: str | None = None - """The locale where the session is in use.""" - - session_id: str | None = None - """The identifier of the user session that is having the conversation.""" - - conversation_mode: str | None = None - """ - The conversation type that you are using the Amazon Lex V2. If the - conversation mode is `AUDIO` you can send both audio and DTMF - information. If the mode is `TEXT` you can only send text. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_CONVERSATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.bot_id is not None: - serializer.write_string( - _SCHEMA_START_CONVERSATION_INPUT.members["botId"], self.bot_id - ) - - if self.bot_alias_id is not None: - serializer.write_string( - _SCHEMA_START_CONVERSATION_INPUT.members["botAliasId"], - self.bot_alias_id, - ) - - if self.locale_id is not None: - serializer.write_string( - _SCHEMA_START_CONVERSATION_INPUT.members["localeId"], self.locale_id - ) - - if self.session_id is not None: - serializer.write_string( - _SCHEMA_START_CONVERSATION_INPUT.members["sessionId"], self.session_id - ) - - if self.conversation_mode is not None: - serializer.write_string( - _SCHEMA_START_CONVERSATION_INPUT.members["conversationMode"], - self.conversation_mode, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bot_id"] = de.read_string( - _SCHEMA_START_CONVERSATION_INPUT.members["botId"] - ) - - case 1: - kwargs["bot_alias_id"] = de.read_string( - _SCHEMA_START_CONVERSATION_INPUT.members["botAliasId"] - ) - - case 2: - kwargs["locale_id"] = de.read_string( - _SCHEMA_START_CONVERSATION_INPUT.members["localeId"] - ) - - case 3: - kwargs["session_id"] = de.read_string( - _SCHEMA_START_CONVERSATION_INPUT.members["sessionId"] - ) - - case 4: - kwargs["conversation_mode"] = ConversationMode( - de.read_string( - _SCHEMA_START_CONVERSATION_INPUT.members["conversationMode"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_START_CONVERSATION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetSessionOutput: - """Dataclass for GetSessionOutput structure.""" - - session_id: str | None = None - """The identifier of the returned session.""" - - messages: list[Message] | None = None - """ - A list of messages that were last sent to the user. The messages are - ordered based on the order that your returned the messages from your - Lambda function or the order that messages are defined in the bot. - """ - - interpretations: "list[Interpretation] | None" = None - """ - A list of intents that Amazon Lex V2 determined might satisfy the - user's utterance. - - Each interpretation includes the intent, a score that indicates how - confident Amazon Lex V2 is that the interpretation is the correct one, - and an optional sentiment response that indicates the sentiment - expressed in the utterance. - """ - - session_state: "SessionState | None" = None - """ - Represents the current state of the dialog between the user and the bot. - - You can use this to determine the progress of the conversation and what - the next action might be. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .models import ( + DeleteSessionInput, + DeleteSessionOutput, + GetSessionInput, + GetSessionOutput, + PutSessionInput, + PutSessionOutput, + RecognizeTextInput, + RecognizeTextOutput, + RecognizeUtteranceInput, + RecognizeUtteranceOutput, + StartConversationInput, + StartConversationOutput, ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_SESSION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.session_id is not None: - serializer.write_string( - _SCHEMA_GET_SESSION_OUTPUT.members["sessionId"], self.session_id - ) - - if self.messages is not None: - _serialize_messages( - serializer, - _SCHEMA_GET_SESSION_OUTPUT.members["messages"], - self.messages, - ) - - if self.interpretations is not None: - _serialize_interpretations( - serializer, - _SCHEMA_GET_SESSION_OUTPUT.members["interpretations"], - self.interpretations, - ) - - if self.session_state is not None: - serializer.write_struct( - _SCHEMA_GET_SESSION_OUTPUT.members["sessionState"], self.session_state - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["session_id"] = de.read_string( - _SCHEMA_GET_SESSION_OUTPUT.members["sessionId"] - ) - - case 1: - kwargs["messages"] = _deserialize_messages( - de, _SCHEMA_GET_SESSION_OUTPUT.members["messages"] - ) - - case 2: - kwargs["interpretations"] = _deserialize_interpretations( - de, _SCHEMA_GET_SESSION_OUTPUT.members["interpretations"] - ) - - case 3: - kwargs["session_state"] = SessionState.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_SESSION_OUTPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class IntentResultEvent: - """ - Contains the current state of the conversation between the client - application and Amazon Lex V2. - """ - - input_mode: str | None = None - """ - Indicates whether the input to the operation was text, speech, or from a - touch-tone keypad. - """ - - interpretations: "list[Interpretation] | None" = None - """ - A list of intents that Amazon Lex V2 determined might satisfy the - user's utterance. - - Each interpretation includes the intent, a score that indicates how - confident Amazon Lex V2 is that the interpretation is the correct one, - and an optional sentiment response that indicates the sentiment - expressed in the utterance. - """ - - session_state: "SessionState | None" = None - """The state of the user's session with Amazon Lex V2.""" - - request_attributes: dict[str, str] | None = None - """The attributes sent in the request.""" - - session_id: str | None = None - """The identifier of the session in use.""" - - event_id: str | None = None - """ - A unique identifier of the event sent by Amazon Lex V2. The identifier - is in the form `RESPONSE-N`, where N is a number starting with one and - incremented for each event sent by Amazon Lex V2 in the current session. - """ - - recognized_bot_member: RecognizedBotMember | None = None - """The bot member that is processing the intent.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INTENT_RESULT_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.input_mode is not None: - serializer.write_string( - _SCHEMA_INTENT_RESULT_EVENT.members["inputMode"], self.input_mode - ) - - if self.interpretations is not None: - _serialize_interpretations( - serializer, - _SCHEMA_INTENT_RESULT_EVENT.members["interpretations"], - self.interpretations, - ) - - if self.session_state is not None: - serializer.write_struct( - _SCHEMA_INTENT_RESULT_EVENT.members["sessionState"], self.session_state - ) - - if self.request_attributes is not None: - _serialize_string_map( - serializer, - _SCHEMA_INTENT_RESULT_EVENT.members["requestAttributes"], - self.request_attributes, - ) - - if self.session_id is not None: - serializer.write_string( - _SCHEMA_INTENT_RESULT_EVENT.members["sessionId"], self.session_id - ) - - if self.event_id is not None: - serializer.write_string( - _SCHEMA_INTENT_RESULT_EVENT.members["eventId"], self.event_id - ) - - if self.recognized_bot_member is not None: - serializer.write_struct( - _SCHEMA_INTENT_RESULT_EVENT.members["recognizedBotMember"], - self.recognized_bot_member, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["input_mode"] = InputMode( - de.read_string(_SCHEMA_INTENT_RESULT_EVENT.members["inputMode"]) - ) - - case 1: - kwargs["interpretations"] = _deserialize_interpretations( - de, _SCHEMA_INTENT_RESULT_EVENT.members["interpretations"] - ) - - case 2: - kwargs["session_state"] = SessionState.deserialize(de) - - case 3: - kwargs["request_attributes"] = _deserialize_string_map( - de, _SCHEMA_INTENT_RESULT_EVENT.members["requestAttributes"] - ) - case 4: - kwargs["session_id"] = de.read_string( - _SCHEMA_INTENT_RESULT_EVENT.members["sessionId"] - ) - case 5: - kwargs["event_id"] = de.read_string( - _SCHEMA_INTENT_RESULT_EVENT.members["eventId"] - ) - - case 6: - kwargs["recognized_bot_member"] = RecognizedBotMember.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INTENT_RESULT_EVENT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class RecognizeTextOutput: - """Dataclass for RecognizeTextOutput structure.""" - - messages: list[Message] | None = None - """ - A list of messages last sent to the user. The messages are ordered based - on the order that you returned the messages from your Lambda function or - the order that the messages are defined in the bot. - """ - - session_state: "SessionState | None" = None - """ - Represents the current state of the dialog between the user and the bot. - - Use this to determine the progress of the conversation and what the next - action may be. - """ - - interpretations: "list[Interpretation] | None" = None - """ - A list of intents that Amazon Lex V2 determined might satisfy the - user's utterance. - - Each interpretation includes the intent, a score that indicates now - confident Amazon Lex V2 is that the interpretation is the correct one, - and an optional sentiment response that indicates the sentiment - expressed in the utterance. +class ServiceError(ModeledError): """ + Base error for all errors in the service. - request_attributes: dict[str, str] | None = None - """The attributes sent in the request.""" - - session_id: str | None = None - """The identifier of the session in use.""" - - recognized_bot_member: RecognizedBotMember | None = None - """The bot member that recognized the text.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. + Some exceptions do not extend from this class, including + synthetic, implicit, and shared exception types. """ - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RECOGNIZE_TEXT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.messages is not None: - _serialize_messages( - serializer, - _SCHEMA_RECOGNIZE_TEXT_OUTPUT.members["messages"], - self.messages, - ) - - if self.session_state is not None: - serializer.write_struct( - _SCHEMA_RECOGNIZE_TEXT_OUTPUT.members["sessionState"], - self.session_state, - ) - - if self.interpretations is not None: - _serialize_interpretations( - serializer, - _SCHEMA_RECOGNIZE_TEXT_OUTPUT.members["interpretations"], - self.interpretations, - ) - - if self.request_attributes is not None: - _serialize_string_map( - serializer, - _SCHEMA_RECOGNIZE_TEXT_OUTPUT.members["requestAttributes"], - self.request_attributes, - ) - - if self.session_id is not None: - serializer.write_string( - _SCHEMA_RECOGNIZE_TEXT_OUTPUT.members["sessionId"], self.session_id - ) - - if self.recognized_bot_member is not None: - serializer.write_struct( - _SCHEMA_RECOGNIZE_TEXT_OUTPUT.members["recognizedBotMember"], - self.recognized_bot_member, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["messages"] = _deserialize_messages( - de, _SCHEMA_RECOGNIZE_TEXT_OUTPUT.members["messages"] - ) - - case 1: - kwargs["session_state"] = SessionState.deserialize(de) - - case 2: - kwargs["interpretations"] = _deserialize_interpretations( - de, _SCHEMA_RECOGNIZE_TEXT_OUTPUT.members["interpretations"] - ) - - case 3: - kwargs["request_attributes"] = _deserialize_string_map( - de, _SCHEMA_RECOGNIZE_TEXT_OUTPUT.members["requestAttributes"] - ) - - case 4: - kwargs["session_id"] = de.read_string( - _SCHEMA_RECOGNIZE_TEXT_OUTPUT.members["sessionId"] - ) - - case 5: - kwargs["recognized_bot_member"] = RecognizedBotMember.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RECOGNIZE_TEXT_OUTPUT, consumer=_consumer) - return kwargs - - -GET_SESSION = APIOperation( - input=GetSessionInput, - output=GetSessionOutput, - schema=_SCHEMA_GET_SESSION, - input_schema=_SCHEMA_GET_SESSION_INPUT, - output_schema=_SCHEMA_GET_SESSION_OUTPUT, - error_registry=TypeRegistry( +_registry = ModelRegistry( + _schemas, + renames={}, + index={ + "AccessDeniedException": "ACCESS_DENIED_EXCEPTION", + "ActiveContext": "ACTIVE_CONTEXT", + "ActiveContextTimeToLive": "ACTIVE_CONTEXT_TIME_TO_LIVE", + "AudioInputEvent": "AUDIO_INPUT_EVENT", + "AudioResponseEvent": "AUDIO_RESPONSE_EVENT", + "BadGatewayException": "BAD_GATEWAY_EXCEPTION", + "Button": "BUTTON", + "ConfidenceScore": "CONFIDENCE_SCORE", + "ConfigurationEvent": "CONFIGURATION_EVENT", + "ConfirmationState": "CONFIRMATION_STATE", + "ConflictException": "CONFLICT_EXCEPTION", + "ConversationMode": "CONVERSATION_MODE", + "DeleteSessionInput": "DELETE_SESSION_INPUT", + "DeleteSessionOutput": "DELETE_SESSION_OUTPUT", + "DependencyFailedException": "DEPENDENCY_FAILED_EXCEPTION", + "DialogAction": "DIALOG_ACTION", + "DialogActionType": "DIALOG_ACTION_TYPE", + "DisconnectionEvent": "DISCONNECTION_EVENT", + "DTMFInputEvent": "DTMF_INPUT_EVENT", + "ElicitSubSlot": "ELICIT_SUB_SLOT", + "GetSessionInput": "GET_SESSION_INPUT", + "GetSessionOutput": "GET_SESSION_OUTPUT", + "HeartbeatEvent": "HEARTBEAT_EVENT", + "ImageResponseCard": "IMAGE_RESPONSE_CARD", + "InputMode": "INPUT_MODE", + "Intent": "INTENT", + "IntentResultEvent": "INTENT_RESULT_EVENT", + "IntentState": "INTENT_STATE", + "InternalServerException": "INTERNAL_SERVER_EXCEPTION", + "Interpretation": "INTERPRETATION", + "InterpretationSource": "INTERPRETATION_SOURCE", + "Message": "MESSAGE", + "MessageContentType": "MESSAGE_CONTENT_TYPE", + "PlaybackCompletionEvent": "PLAYBACK_COMPLETION_EVENT", + "PlaybackInterruptionEvent": "PLAYBACK_INTERRUPTION_EVENT", + "PlaybackInterruptionReason": "PLAYBACK_INTERRUPTION_REASON", + "PutSessionInput": "PUT_SESSION_INPUT", + "PutSessionOutput": "PUT_SESSION_OUTPUT", + "RecognizedBotMember": "RECOGNIZED_BOT_MEMBER", + "RecognizeTextInput": "RECOGNIZE_TEXT_INPUT", + "RecognizeTextOutput": "RECOGNIZE_TEXT_OUTPUT", + "RecognizeUtteranceInput": "RECOGNIZE_UTTERANCE_INPUT", + "RecognizeUtteranceOutput": "RECOGNIZE_UTTERANCE_OUTPUT", + "ResourceNotFoundException": "RESOURCE_NOT_FOUND_EXCEPTION", + "RuntimeHintDetails": "RUNTIME_HINT_DETAILS", + "RuntimeHints": "RUNTIME_HINTS", + "RuntimeHintValue": "RUNTIME_HINT_VALUE", + "SentimentResponse": "SENTIMENT_RESPONSE", + "SentimentScore": "SENTIMENT_SCORE", + "SentimentType": "SENTIMENT_TYPE", + "SessionState": "SESSION_STATE", + "Shape": "SHAPE", + "Slot": "SLOT", + "StartConversationInput": "START_CONVERSATION_INPUT", + "StartConversationOutput": "START_CONVERSATION_OUTPUT", + "StartConversationRequestEventStream": "START_CONVERSATION_REQUEST_EVENT_STREAM", + "StartConversationRequestEventStreamConfigurationEvent": "START_CONVERSATION_REQUEST_EVENT_STREAM", + "StartConversationRequestEventStreamAudioInputEvent": "START_CONVERSATION_REQUEST_EVENT_STREAM", + "StartConversationRequestEventStreamDTMFInputEvent": "START_CONVERSATION_REQUEST_EVENT_STREAM", + "StartConversationRequestEventStreamTextInputEvent": "START_CONVERSATION_REQUEST_EVENT_STREAM", + "StartConversationRequestEventStreamPlaybackCompletionEvent": "START_CONVERSATION_REQUEST_EVENT_STREAM", + "StartConversationRequestEventStreamDisconnectionEvent": "START_CONVERSATION_REQUEST_EVENT_STREAM", + "StartConversationRequestEventStreamUnknown": "START_CONVERSATION_REQUEST_EVENT_STREAM", + "StartConversationResponseEventStream": "START_CONVERSATION_RESPONSE_EVENT_STREAM", + "StartConversationResponseEventStreamPlaybackInterruptionEvent": "START_CONVERSATION_RESPONSE_EVENT_STREAM", + "StartConversationResponseEventStreamTranscriptEvent": "START_CONVERSATION_RESPONSE_EVENT_STREAM", + "StartConversationResponseEventStreamIntentResultEvent": "START_CONVERSATION_RESPONSE_EVENT_STREAM", + "StartConversationResponseEventStreamTextResponseEvent": "START_CONVERSATION_RESPONSE_EVENT_STREAM", + "StartConversationResponseEventStreamAudioResponseEvent": "START_CONVERSATION_RESPONSE_EVENT_STREAM", + "StartConversationResponseEventStreamHeartbeatEvent": "START_CONVERSATION_RESPONSE_EVENT_STREAM", + "StartConversationResponseEventStreamAccessDeniedException": "START_CONVERSATION_RESPONSE_EVENT_STREAM", + "StartConversationResponseEventStreamResourceNotFoundException": "START_CONVERSATION_RESPONSE_EVENT_STREAM", + "StartConversationResponseEventStreamValidationException": "START_CONVERSATION_RESPONSE_EVENT_STREAM", + "StartConversationResponseEventStreamThrottlingException": "START_CONVERSATION_RESPONSE_EVENT_STREAM", + "StartConversationResponseEventStreamInternalServerException": "START_CONVERSATION_RESPONSE_EVENT_STREAM", + "StartConversationResponseEventStreamConflictException": "START_CONVERSATION_RESPONSE_EVENT_STREAM", + "StartConversationResponseEventStreamDependencyFailedException": "START_CONVERSATION_RESPONSE_EVENT_STREAM", + "StartConversationResponseEventStreamBadGatewayException": "START_CONVERSATION_RESPONSE_EVENT_STREAM", + "StartConversationResponseEventStreamUnknown": "START_CONVERSATION_RESPONSE_EVENT_STREAM", + "StyleType": "STYLE_TYPE", + "TextInputEvent": "TEXT_INPUT_EVENT", + "TextResponseEvent": "TEXT_RESPONSE_EVENT", + "ThrottlingException": "THROTTLING_EXCEPTION", + "TranscriptEvent": "TRANSCRIPT_EVENT", + "ValidationException": "VALIDATION_EXCEPTION", + "Value": "VALUE", + }, + shape_names=frozenset( { - ShapeID( - "com.amazonaws.lexruntimev2#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.lexruntimev2#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.lexruntimev2#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.lexruntimev2#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.lexruntimev2#ValidationException" - ): ValidationException, + "AccessDeniedException", + "ActiveContext", + "ActiveContextTimeToLive", + "AudioInputEvent", + "AudioResponseEvent", + "BadGatewayException", + "Button", + "ConfidenceScore", + "ConfigurationEvent", + "ConfirmationState", + "ConflictException", + "ConversationMode", + "DTMFInputEvent", + "DeleteSessionInput", + "DeleteSessionOutput", + "DependencyFailedException", + "DialogAction", + "DialogActionType", + "DisconnectionEvent", + "ElicitSubSlot", + "GetSessionInput", + "GetSessionOutput", + "HeartbeatEvent", + "ImageResponseCard", + "InputMode", + "Intent", + "IntentResultEvent", + "IntentState", + "InternalServerException", + "Interpretation", + "InterpretationSource", + "Message", + "MessageContentType", + "PlaybackCompletionEvent", + "PlaybackInterruptionEvent", + "PlaybackInterruptionReason", + "PutSessionInput", + "PutSessionOutput", + "RecognizeTextInput", + "RecognizeTextOutput", + "RecognizeUtteranceInput", + "RecognizeUtteranceOutput", + "RecognizedBotMember", + "ResourceNotFoundException", + "RuntimeHintDetails", + "RuntimeHintValue", + "RuntimeHints", + "SentimentResponse", + "SentimentScore", + "SentimentType", + "SessionState", + "Shape", + "Slot", + "StartConversationInput", + "StartConversationOutput", + "StartConversationRequestEventStream", + "StartConversationResponseEventStream", + "StyleType", + "TextInputEvent", + "TextResponseEvent", + "ThrottlingException", + "TranscriptEvent", + "ValidationException", + "Value", } ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], + service_error="ServiceError", ) -@dataclass -class StartConversationResponseEventStreamPlaybackInterruptionEvent: - """ - Event sent from Amazon Lex V2 to indicate to the client application - should stop playback of audio. For example, if the client is playing a - prompt that asks for the user's telephone number, the user might start - to say the phone number before the prompt is complete. Amazon Lex V2 - sends this event to the client application to indicate that the user is - responding and that Amazon Lex V2 is processing their input. - """ - - value: PlaybackInterruptionEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_CONVERSATION_RESPONSE_EVENT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_START_CONVERSATION_RESPONSE_EVENT_STREAM.members[ - "PlaybackInterruptionEvent" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=PlaybackInterruptionEvent.deserialize(deserializer)) - - -@dataclass -class StartConversationResponseEventStreamTranscriptEvent: - """ - Event sent from Amazon Lex V2 to your client application that contains a - transcript of voice audio. - """ - - value: TranscriptEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_CONVERSATION_RESPONSE_EVENT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_START_CONVERSATION_RESPONSE_EVENT_STREAM.members["TranscriptEvent"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=TranscriptEvent.deserialize(deserializer)) - - -@dataclass -class StartConversationResponseEventStreamIntentResultEvent: - """ - Event sent from Amazon Lex V2 to the client application containing the - current state of the conversation between the user and Amazon Lex V2. - """ - - value: "IntentResultEvent" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_CONVERSATION_RESPONSE_EVENT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_START_CONVERSATION_RESPONSE_EVENT_STREAM.members[ - "IntentResultEvent" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=IntentResultEvent.deserialize(deserializer)) - - -@dataclass -class StartConversationResponseEventStreamTextResponseEvent: - """ - The event sent from Amazon Lex V2 to your application with text to - present to the user. - """ - - value: TextResponseEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_CONVERSATION_RESPONSE_EVENT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_START_CONVERSATION_RESPONSE_EVENT_STREAM.members[ - "TextResponseEvent" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=TextResponseEvent.deserialize(deserializer)) - - -@dataclass -class StartConversationResponseEventStreamAudioResponseEvent: - """ - An event sent from Amazon Lex V2 to your client application containing - audio to play to the user. - """ - - value: AudioResponseEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_CONVERSATION_RESPONSE_EVENT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_START_CONVERSATION_RESPONSE_EVENT_STREAM.members[ - "AudioResponseEvent" - ], - self.value, - ) +def __getattr__(name: str): + return _registry.build(name) - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=AudioResponseEvent.deserialize(deserializer)) +DELETE_SESSION: APIOperation[DeleteSessionInput, DeleteSessionOutput] = APIOperation( + static_schema=_SCHEMA_DELETE_SESSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lexruntimev2#AccessDeniedException"), + ShapeID("com.amazonaws.lexruntimev2#ConflictException"), + ShapeID("com.amazonaws.lexruntimev2#InternalServerException"), + ShapeID("com.amazonaws.lexruntimev2#ResourceNotFoundException"), + ShapeID("com.amazonaws.lexruntimev2#ThrottlingException"), + ShapeID("com.amazonaws.lexruntimev2#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -@dataclass -class StartConversationResponseEventStreamHeartbeatEvent: - """ - Event that Amazon Lex V2 sends to indicate that the stream is still open - between the client application and Amazon Lex V2 - """ - - value: HeartbeatEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_CONVERSATION_RESPONSE_EVENT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_START_CONVERSATION_RESPONSE_EVENT_STREAM.members["HeartbeatEvent"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=HeartbeatEvent.deserialize(deserializer)) - - -@dataclass -class StartConversationResponseEventStreamAccessDeniedException: - """ - Exception thrown when the credentials passed with the request are - invalid or expired. Also thrown when the credentials in the request do - not have permission to access the `StartConversation` operation. - """ - - value: AccessDeniedException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_CONVERSATION_RESPONSE_EVENT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_START_CONVERSATION_RESPONSE_EVENT_STREAM.members[ - "AccessDeniedException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=AccessDeniedException.deserialize(deserializer)) - - -@dataclass -class StartConversationResponseEventStreamResourceNotFoundException: - """ - Exception thrown if one of the input parameters points to a resource - that does not exist. For example, if the bot ID specified does not - exist. - """ - - value: ResourceNotFoundException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_CONVERSATION_RESPONSE_EVENT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_START_CONVERSATION_RESPONSE_EVENT_STREAM.members[ - "ResourceNotFoundException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ResourceNotFoundException.deserialize(deserializer)) - - -@dataclass -class StartConversationResponseEventStreamValidationException: - """ - Exception thrown when one or more parameters could not be validated. The - `message` contains the name of the field that isn't valid. - """ - - value: ValidationException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_CONVERSATION_RESPONSE_EVENT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_START_CONVERSATION_RESPONSE_EVENT_STREAM.members[ - "ValidationException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ValidationException.deserialize(deserializer)) - - -@dataclass -class StartConversationResponseEventStreamThrottlingException: - """ - Exception thrown when your application exceeds the maximum number of - concurrent requests. - """ - - value: ThrottlingException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_CONVERSATION_RESPONSE_EVENT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_START_CONVERSATION_RESPONSE_EVENT_STREAM.members[ - "ThrottlingException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ThrottlingException.deserialize(deserializer)) - - -@dataclass -class StartConversationResponseEventStreamInternalServerException: - """An error occurred with Amazon Lex V2.""" - - value: InternalServerException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_CONVERSATION_RESPONSE_EVENT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_START_CONVERSATION_RESPONSE_EVENT_STREAM.members[ - "InternalServerException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=InternalServerException.deserialize(deserializer)) - - -@dataclass -class StartConversationResponseEventStreamConflictException: - """ - Exception thrown when two clients are using the same AWS account, Amazon - Lex V2 bot, and session ID. - """ - - value: ConflictException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_CONVERSATION_RESPONSE_EVENT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_START_CONVERSATION_RESPONSE_EVENT_STREAM.members[ - "ConflictException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ConflictException.deserialize(deserializer)) - - -@dataclass -class StartConversationResponseEventStreamDependencyFailedException: - """""" - - value: DependencyFailedException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_CONVERSATION_RESPONSE_EVENT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_START_CONVERSATION_RESPONSE_EVENT_STREAM.members[ - "DependencyFailedException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=DependencyFailedException.deserialize(deserializer)) - - -@dataclass -class StartConversationResponseEventStreamBadGatewayException: - """""" - - value: BadGatewayException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_CONVERSATION_RESPONSE_EVENT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_START_CONVERSATION_RESPONSE_EVENT_STREAM.members[ - "BadGatewayException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=BadGatewayException.deserialize(deserializer)) - - -@dataclass -class StartConversationResponseEventStreamUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -StartConversationResponseEventStream = Union[ - StartConversationResponseEventStreamPlaybackInterruptionEvent - | StartConversationResponseEventStreamTranscriptEvent - | StartConversationResponseEventStreamIntentResultEvent - | StartConversationResponseEventStreamTextResponseEvent - | StartConversationResponseEventStreamAudioResponseEvent - | StartConversationResponseEventStreamHeartbeatEvent - | StartConversationResponseEventStreamAccessDeniedException - | StartConversationResponseEventStreamResourceNotFoundException - | StartConversationResponseEventStreamValidationException - | StartConversationResponseEventStreamThrottlingException - | StartConversationResponseEventStreamInternalServerException - | StartConversationResponseEventStreamConflictException - | StartConversationResponseEventStreamDependencyFailedException - | StartConversationResponseEventStreamBadGatewayException - | StartConversationResponseEventStreamUnknown -] -""" -Represents a stream of events between Amazon Lex V2 and your -application. -""" - - -class _StartConversationResponseEventStreamDeserializer: - _result: StartConversationResponseEventStream | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> StartConversationResponseEventStream: - self._result = None - deserializer.read_struct( - _SCHEMA_START_CONVERSATION_RESPONSE_EVENT_STREAM, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - StartConversationResponseEventStreamPlaybackInterruptionEvent.deserialize( - de - ) - ) - - case 1: - self._set_result( - StartConversationResponseEventStreamTranscriptEvent.deserialize(de) - ) - - case 2: - self._set_result( - StartConversationResponseEventStreamIntentResultEvent.deserialize( - de - ) - ) - - case 3: - self._set_result( - StartConversationResponseEventStreamTextResponseEvent.deserialize( - de - ) - ) - - case 4: - self._set_result( - StartConversationResponseEventStreamAudioResponseEvent.deserialize( - de - ) - ) - - case 5: - self._set_result( - StartConversationResponseEventStreamHeartbeatEvent.deserialize(de) - ) - - case 6: - self._set_result( - StartConversationResponseEventStreamAccessDeniedException.deserialize( - de - ) - ) - - case 7: - self._set_result( - StartConversationResponseEventStreamResourceNotFoundException.deserialize( - de - ) - ) - - case 8: - self._set_result( - StartConversationResponseEventStreamValidationException.deserialize( - de - ) - ) - - case 9: - self._set_result( - StartConversationResponseEventStreamThrottlingException.deserialize( - de - ) - ) - - case 10: - self._set_result( - StartConversationResponseEventStreamInternalServerException.deserialize( - de - ) - ) - - case 11: - self._set_result( - StartConversationResponseEventStreamConflictException.deserialize( - de - ) - ) - - case 12: - self._set_result( - StartConversationResponseEventStreamDependencyFailedException.deserialize( - de - ) - ) - - case 13: - self._set_result( - StartConversationResponseEventStreamBadGatewayException.deserialize( - de - ) - ) - - case _: - self._set_result( - StartConversationResponseEventStreamUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: StartConversationResponseEventStream) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class StartConversationOutput: - """Dataclass for StartConversationOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False +RECOGNIZE_UTTERANCE: APIOperation[RecognizeUtteranceInput, RecognizeUtteranceOutput] = ( + APIOperation( + static_schema=_SCHEMA_RECOGNIZE_UTTERANCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lexruntimev2#AccessDeniedException"), + ShapeID("com.amazonaws.lexruntimev2#BadGatewayException"), + ShapeID("com.amazonaws.lexruntimev2#ConflictException"), + ShapeID("com.amazonaws.lexruntimev2#DependencyFailedException"), + ShapeID("com.amazonaws.lexruntimev2#InternalServerException"), + ShapeID("com.amazonaws.lexruntimev2#ResourceNotFoundException"), + ShapeID("com.amazonaws.lexruntimev2#ThrottlingException"), + ShapeID("com.amazonaws.lexruntimev2#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_CONVERSATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_START_CONVERSATION_OUTPUT, consumer=_consumer) - return kwargs - +) -RECOGNIZE_TEXT = APIOperation( - input=RecognizeTextInput, - output=RecognizeTextOutput, - schema=_SCHEMA_RECOGNIZE_TEXT, - input_schema=_SCHEMA_RECOGNIZE_TEXT_INPUT, - output_schema=_SCHEMA_RECOGNIZE_TEXT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lexruntimev2#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.lexruntimev2#BadGatewayException" - ): BadGatewayException, - ShapeID("com.amazonaws.lexruntimev2#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.lexruntimev2#DependencyFailedException" - ): DependencyFailedException, - ShapeID( - "com.amazonaws.lexruntimev2#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.lexruntimev2#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.lexruntimev2#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.lexruntimev2#ValidationException" - ): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_BAD_GATEWAY_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_DEPENDENCY_FAILED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, +PUT_SESSION: APIOperation[PutSessionInput, PutSessionOutput] = APIOperation( + static_schema=_SCHEMA_PUT_SESSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lexruntimev2#AccessDeniedException"), + ShapeID("com.amazonaws.lexruntimev2#BadGatewayException"), + ShapeID("com.amazonaws.lexruntimev2#ConflictException"), + ShapeID("com.amazonaws.lexruntimev2#DependencyFailedException"), + ShapeID("com.amazonaws.lexruntimev2#InternalServerException"), + ShapeID("com.amazonaws.lexruntimev2#ResourceNotFoundException"), + ShapeID("com.amazonaws.lexruntimev2#ThrottlingException"), + ShapeID("com.amazonaws.lexruntimev2#ValidationException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) -START_CONVERSATION = APIOperation( - input=StartConversationInput, - output=StartConversationOutput, - schema=_SCHEMA_START_CONVERSATION, - input_schema=_SCHEMA_START_CONVERSATION_INPUT, - output_schema=_SCHEMA_START_CONVERSATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.lexruntimev2#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.lexruntimev2#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.lexruntimev2#ThrottlingException" - ): ThrottlingException, - ShapeID( - "com.amazonaws.lexruntimev2#ValidationException" - ): ValidationException, - } - ), +GET_SESSION: APIOperation[GetSessionInput, GetSessionOutput] = APIOperation( + static_schema=_SCHEMA_GET_SESSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lexruntimev2#AccessDeniedException"), + ShapeID("com.amazonaws.lexruntimev2#InternalServerException"), + ShapeID("com.amazonaws.lexruntimev2#ResourceNotFoundException"), + ShapeID("com.amazonaws.lexruntimev2#ThrottlingException"), + ShapeID("com.amazonaws.lexruntimev2#ValidationException"), + ], effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, +) + +RECOGNIZE_TEXT: APIOperation[RecognizeTextInput, RecognizeTextOutput] = APIOperation( + static_schema=_SCHEMA_RECOGNIZE_TEXT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lexruntimev2#AccessDeniedException"), + ShapeID("com.amazonaws.lexruntimev2#BadGatewayException"), + ShapeID("com.amazonaws.lexruntimev2#ConflictException"), + ShapeID("com.amazonaws.lexruntimev2#DependencyFailedException"), + ShapeID("com.amazonaws.lexruntimev2#InternalServerException"), + ShapeID("com.amazonaws.lexruntimev2#ResourceNotFoundException"), + ShapeID("com.amazonaws.lexruntimev2#ThrottlingException"), + ShapeID("com.amazonaws.lexruntimev2#ValidationException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +START_CONVERSATION: APIOperation[StartConversationInput, StartConversationOutput] = ( + APIOperation( + static_schema=_SCHEMA_START_CONVERSATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.lexruntimev2#AccessDeniedException"), + ShapeID("com.amazonaws.lexruntimev2#InternalServerException"), + ShapeID("com.amazonaws.lexruntimev2#ThrottlingException"), + ShapeID("com.amazonaws.lexruntimev2#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) ) diff --git a/clients/aws-sdk-lex-runtime-v2/src/aws_sdk_lex_runtime_v2/models.pyi b/clients/aws-sdk-lex-runtime-v2/src/aws_sdk_lex_runtime_v2/models.pyi new file mode 100644 index 00000000..904847b9 --- /dev/null +++ b/clients/aws-sdk-lex-runtime-v2/src/aws_sdk_lex_runtime_v2/models.pyi @@ -0,0 +1,1671 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. + +from dataclasses import dataclass +from enum import StrEnum +from typing import Self, Union + +from smithy_core.aio.interfaces import StreamingBlob +from smithy_core.deserializers import ShapeDeserializer +from smithy_core.exceptions import ModeledError +from smithy_core.response import ResponseMetadata +from smithy_core.schemas import APIOperation +from smithy_core.serializers import ShapeSerializer +from smithy_core.types import UnknownEnumMixin + +class _SerdeShape: + def serialize(self, serializer: ShapeSerializer) -> None: ... + def serialize_members(self, serializer: ShapeSerializer) -> None: ... + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: ... + +class ServiceError(ModeledError): + """ + Base error for all errors in the service. + + Some exceptions do not extend from this class, including + synthetic, implicit, and shared exception types. + """ + +@dataclass(kw_only=True) +class AccessDeniedException(ServiceError, _SerdeShape): + """""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ActiveContext(_SerdeShape): + """ + Contains information about the contexts that a user is using in a + session. You can configure Amazon Lex V2 to set a context when an intent + is fulfilled, or you can set a context using the , , or operations. + + Use a context to indicate to Amazon Lex V2 intents that should be used + as follow-up intents. For example, if the active context is + `order-fulfilled`, only intents that have `order-fulfilled` configured + as a trigger are considered for follow up. + """ + + name: str + """The name of the context.""" + time_to_live: ActiveContextTimeToLive + """ + Indicates the number of turns or seconds that the context is active. + Once the time to live expires, the context is no longer returned in a + response. + """ + context_attributes: dict[str, str] + """ + A list of contexts active for the request. A context can be activated + when a previous intent is fulfilled, or by including the context in the + request. + + If you don't specify a list of contexts, Amazon Lex V2 will use the + current list of contexts for the session. If you specify an empty list, + all contexts for the session are cleared. + """ + +@dataclass(kw_only=True) +class ActiveContextTimeToLive(_SerdeShape): + """ + The time that a context is active. You can specify the time to live in + seconds or in conversation turns. + """ + + time_to_live_in_seconds: int + """ + The number of seconds that the context is active. You can specify + between 5 and 86400 seconds (24 hours). + """ + turns_to_live: int + """ + The number of turns that the context is active. You can specify up to 20 + turns. Each request and response from the bot is a turn. + """ + +@dataclass(kw_only=True) +class AudioInputEvent(_SerdeShape): + """ + Represents a chunk of audio sent from the client application to Amazon + Lex V2. The audio is all or part of an utterance from the user. + + Amazon Lex V2 accumulates audio chunks until it recognizes a natural + pause in speech before processing the input. + """ + + audio_chunk: bytes | None = ... + """An encoded stream of audio.""" + content_type: str + """ + The encoding used for the audio chunk. You must use 8 KHz PCM 16-bit + mono-channel little-endian format. The value of the field should be: + + `audio/lpcm; sample-rate=8000; sample-size-bits=16; channel-count=1; is-big-endian=false` + """ + event_id: str | None = ... + """ + A unique identifier that your application assigns to the event. You can + use this to identify events in logs. + """ + client_timestamp_millis: int = ... + """ + A timestamp set by the client of the date and time that the event was + sent to Amazon Lex V2. + """ + +@dataclass(kw_only=True) +class AudioResponseEvent(_SerdeShape): + """ + An event sent from Amazon Lex V2 to your client application containing + audio to play to the user. + """ + + audio_chunk: bytes | None = ... + """A chunk of the audio to play.""" + content_type: str | None = ... + """ + The encoding of the audio chunk. This is the same as the encoding + configure in the `contentType` field of the `ConfigurationEvent`. + """ + event_id: str | None = ... + """ + A unique identifier of the event sent by Amazon Lex V2. The identifier + is in the form `RESPONSE-N`, where N is a number starting with one and + incremented for each event sent by Amazon Lex V2 in the current session. + """ + +@dataclass(kw_only=True) +class BadGatewayException(ServiceError, _SerdeShape): + """""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class Button(_SerdeShape): + """A button that appears on a response card show to the user.""" + + text: str + """The text that is displayed on the button.""" + value: str + """The value returned to Amazon Lex V2 when a user chooses the button.""" + +@dataclass(kw_only=True) +class ConfidenceScore(_SerdeShape): + """ + Provides a score that indicates the confidence that Amazon Lex V2 has + that an intent is the one that satisfies the user's intent. + """ + + score: float = ... + """ + A score that indicates how confident Amazon Lex V2 is that an intent + satisfies the user's intent. Ranges between 0.00 and 1.00. Higher + scores indicate higher confidence. + """ + +@dataclass(kw_only=True) +class ConfigurationEvent(_SerdeShape): + """ + The initial event sent from the application to Amazon Lex V2 to + configure the conversation, including session and request attributes and + the response content type. + """ + + request_attributes: dict[str, str] | None = ... + """ + Request-specific information passed between the client application and + Amazon Lex V2. + + The namespace `x-amz-lex:` is reserved for special attributes. Don't + create any request attributes for prefix `x-amz-lex:`. + """ + response_content_type: str + """ + The message that Amazon Lex V2 returns in the response can be either + text or speech based on the `responseContentType` value. + + - If the value is `text/plain;charset=utf-8`, Amazon Lex V2 returns text + in the response. + + - If the value begins with `audio/`, Amazon Lex V2 returns speech in the + response. Amazon Lex V2 uses Amazon Polly to generate the speech using + the configuration that you specified in the `requestContentType` + parameter. For example, if you specify `audio/mpeg` as the value, + Amazon Lex V2 returns speech in the MPEG format. + + - If the value is `audio/pcm`, the speech returned is audio/pcm in + 16-bit, little-endian format. + + - The following are the accepted values: + + - audio/mpeg + + - audio/ogg + + - audio/pcm + + - audio/* (defaults to mpeg) + + - text/plain; charset=utf-8 + """ + session_state: SessionState | None = ... + """The state of the user's session with Amazon Lex V2.""" + welcome_messages: list[Message] | None = ... + """ + A list of messages to send to the user. + + If you set the `welcomeMessage` field, you must also set the + [`DialogAction`](https://docs.aws.amazon.com/lexv2/latest/dg/API_runtime_DialogAction.html) + structure's + [`type`](https://docs.aws.amazon.com/lexv2/latest/dg/API_runtime_DialogAction.html#lexv2-Type-runtime_DialogAction-type) + field. + """ + disable_playback: bool = ... + """ + Determines whether Amazon Lex V2 should send audio responses to the + client application. + + Set this field to false when the client is operating in a playback mode + where audio responses are played to the user. If the client isn't + operating in playback mode, such as a text chat application, set this to + true so that Amazon Lex V2 doesn't wait for the prompt to finish + playing on the client. + """ + event_id: str | None = ... + """ + A unique identifier that your application assigns to the event. You can + use this to identify events in logs. + """ + client_timestamp_millis: int = ... + """ + A timestamp set by the client of the date and time that the event was + sent to Amazon Lex V2. + """ + +class ConfirmationState(UnknownEnumMixin, StrEnum): + CONFIRMED = "Confirmed" + DENIED = "Denied" + NONE = "None" + +@dataclass(kw_only=True) +class ConflictException(ServiceError, _SerdeShape): + """""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class ConversationMode(UnknownEnumMixin, StrEnum): + AUDIO = "AUDIO" + TEXT = "TEXT" + +@dataclass(kw_only=True) +class DeleteSessionInput(_SerdeShape): + """Dataclass for DeleteSessionInput structure.""" + + bot_id: str | None = ... + """The identifier of the bot that contains the session data.""" + bot_alias_id: str | None = ... + """The alias identifier in use for the bot that contains the session data.""" + locale_id: str | None = ... + """The locale where the session is in use.""" + session_id: str | None = ... + """The identifier of the session to delete.""" + +@dataclass(kw_only=True) +class DeleteSessionOutput(_SerdeShape): + """Dataclass for DeleteSessionOutput structure.""" + + bot_id: str | None = ... + """The identifier of the bot that contained the session data.""" + bot_alias_id: str | None = ... + """The alias identifier in use for the bot that contained the session data.""" + locale_id: str | None = ... + """The locale where the session was used.""" + session_id: str | None = ... + """The identifier of the deleted session.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DependencyFailedException(ServiceError, _SerdeShape): + """""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DialogAction(_SerdeShape): + """The next action that Amazon Lex V2 should take.""" + + type: str + """ + The next action that the bot should take in its interaction with the + user. The following values are possible: + + - `Close` -- Indicates that there will not be a response from the user. + For example, the statement \"Your order has been placed\" does not + require a response. + + - `ConfirmIntent` -- The next action is asking the user if the intent is + complete and ready to be fulfilled. This is a yes/no question such as + \"Place the order?\" + + - `Delegate` -- The next action is determined by Amazon Lex V2. + + - `ElicitIntent` -- The next action is to elicit an intent from the + user. + + - `ElicitSlot` -- The next action is to elicit a slot value from the + user. + """ + slot_to_elicit: str | None = ... + """The name of the slot that should be elicited from the user.""" + slot_elicitation_style: str | None = ... + """ + Configures the slot to use spell-by-letter or spell-by-word style. When + you use a style on a slot, users can spell out their input to make it + clear to your bot. + + - Spell by letter - \"b\" \"o\" \"b\" + + - Spell by word - \"b as in boy\" \"o as in oscar\" \"b as in boy\" + + For more information, see [Using spelling to enter slot + values](https://docs.aws.amazon.com/lexv2/latest/dg/spelling-styles.html) + . + """ + sub_slot_to_elicit: ElicitSubSlot | None = ... + """ + The name of the constituent sub slot of the composite slot specified in + slotToElicit that should be elicited from the user. + """ + +class DialogActionType(UnknownEnumMixin, StrEnum): + CLOSE = "Close" + CONFIRM_INTENT = "ConfirmIntent" + DELEGATE = "Delegate" + ELICIT_INTENT = "ElicitIntent" + ELICIT_SLOT = "ElicitSlot" + NONE = "None" + +@dataclass(kw_only=True) +class DisconnectionEvent(_SerdeShape): + """ + A notification from the client that it is disconnecting from Amazon Lex + V2. Sending a `DisconnectionEvent` event is optional, but can help + identify a conversation in logs. + """ + + event_id: str | None = ... + """ + A unique identifier that your application assigns to the event. You can + use this to identify events in logs. + """ + client_timestamp_millis: int = ... + """ + A timestamp set by the client of the date and time that the event was + sent to Amazon Lex V2. + """ + +@dataclass(kw_only=True) +class DTMFInputEvent(_SerdeShape): + """ + A DTMF character sent from the client application. DTMF characters are + typically sent from a phone keypad to represent numbers. For example, + you can have Amazon Lex V2 process a credit card number input from a + phone. + """ + + input_character: str + """ + The DTMF character that the user pressed. The allowed characters are A - + D, 0 - 9, # and *. + """ + event_id: str | None = ... + """ + A unique identifier that your application assigns to the event. You can + use this to identify events in logs. + """ + client_timestamp_millis: int = ... + """ + A timestamp set by the client of the date and time that the event was + sent to Amazon Lex V2. + """ + +@dataclass(kw_only=True) +class ElicitSubSlot(_SerdeShape): + """ + The specific constituent sub slot of the composite slot to elicit in + dialog action. + """ + + name: str + """The name of the slot that should be elicited from the user.""" + sub_slot_to_elicit: ElicitSubSlot | None = ... + """The field is not supported.""" + +@dataclass(kw_only=True) +class GetSessionInput(_SerdeShape): + """Dataclass for GetSessionInput structure.""" + + bot_id: str | None = ... + """The identifier of the bot that contains the session data.""" + bot_alias_id: str | None = ... + """The alias identifier in use for the bot that contains the session data.""" + locale_id: str | None = ... + """The locale where the session is in use.""" + session_id: str | None = ... + """The identifier of the session to return.""" + +@dataclass(kw_only=True) +class GetSessionOutput(_SerdeShape): + """Dataclass for GetSessionOutput structure.""" + + session_id: str | None = ... + """The identifier of the returned session.""" + messages: list[Message] | None = ... + """ + A list of messages that were last sent to the user. The messages are + ordered based on the order that your returned the messages from your + Lambda function or the order that messages are defined in the bot. + """ + interpretations: list[Interpretation] | None = ... + """ + A list of intents that Amazon Lex V2 determined might satisfy the + user's utterance. + + Each interpretation includes the intent, a score that indicates how + confident Amazon Lex V2 is that the interpretation is the correct one, + and an optional sentiment response that indicates the sentiment + expressed in the utterance. + """ + session_state: SessionState | None = ... + """ + Represents the current state of the dialog between the user and the bot. + + You can use this to determine the progress of the conversation and what + the next action might be. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class HeartbeatEvent(_SerdeShape): + """ + Event that Amazon Lex V2 sends to indicate that the stream is still open + between the client application and Amazon Lex V2 + """ + + event_id: str | None = ... + """ + A unique identifier of the event sent by Amazon Lex V2. The identifier + is in the form `RESPONSE-N`, where N is a number starting with one and + incremented for each event sent by Amazon Lex V2 in the current session. + """ + +@dataclass(kw_only=True) +class ImageResponseCard(_SerdeShape): + """ + A card that is shown to the user by a messaging platform. You define the + contents of the card, the card is displayed by the platform. + + When you use a response card, the response from the user is constrained + to the text associated with a button on the card. + """ + + title: str + """ + The title to display on the response card. The format of the title is + determined by the platform displaying the response card. + """ + subtitle: str | None = ... + """ + The subtitle to display on the response card. The format of the subtitle + is determined by the platform displaying the response card. + """ + image_url: str | None = ... + """ + The URL of an image to display on the response card. The image URL must + be publicly available so that the platform displaying the response card + has access to the image. + """ + buttons: list[Button] | None = ... + """ + A list of buttons that should be displayed on the response card. The + arrangement of the buttons is determined by the platform that displays + the button. + """ + +class InputMode(UnknownEnumMixin, StrEnum): + TEXT = "Text" + SPEECH = "Speech" + DTMF = "DTMF" + +@dataclass(kw_only=True) +class Intent(_SerdeShape): + """The current intent that Amazon Lex V2 is attempting to fulfill.""" + + name: str + """The name of the intent.""" + slots: dict[str, Slot] | None = ... + """ + A map of all of the slots for the intent. The name of the slot maps to + the value of the slot. If a slot has not been filled, the value is null. + """ + state: str | None = ... + """ + Indicates the fulfillment state for the intent. The meanings of each + value are as follows: + + - `Failed` -- The bot failed to fulfill the intent. + + - `Fulfilled` -- The bot has completed fulfillment of the intent. + + - `FulfillmentInProgress` -- The bot is in the middle of fulfilling the + intent. + + - `InProgress` -- The bot is in the middle of eliciting the slot values + that are necessary to fulfill the intent. + + - `ReadyForFulfillment` -- The bot has elicited all the slot values for + the intent and is ready to fulfill the intent. + + - `Waiting` -- The bot is waiting for a response from the user (limited + to streaming conversations). + """ + confirmation_state: str | None = ... + """ + Indicates whether the intent has been `Confirmed`, `Denied`, or `None` + if the confirmation stage has not yet been reached. + """ + +@dataclass(kw_only=True) +class IntentResultEvent(_SerdeShape): + """ + Contains the current state of the conversation between the client + application and Amazon Lex V2. + """ + + input_mode: str | None = ... + """ + Indicates whether the input to the operation was text, speech, or from a + touch-tone keypad. + """ + interpretations: list[Interpretation] | None = ... + """ + A list of intents that Amazon Lex V2 determined might satisfy the + user's utterance. + + Each interpretation includes the intent, a score that indicates how + confident Amazon Lex V2 is that the interpretation is the correct one, + and an optional sentiment response that indicates the sentiment + expressed in the utterance. + """ + session_state: SessionState | None = ... + """The state of the user's session with Amazon Lex V2.""" + request_attributes: dict[str, str] | None = ... + """The attributes sent in the request.""" + session_id: str | None = ... + """The identifier of the session in use.""" + event_id: str | None = ... + """ + A unique identifier of the event sent by Amazon Lex V2. The identifier + is in the form `RESPONSE-N`, where N is a number starting with one and + incremented for each event sent by Amazon Lex V2 in the current session. + """ + recognized_bot_member: RecognizedBotMember | None = ... + """The bot member that is processing the intent.""" + +class IntentState(UnknownEnumMixin, StrEnum): + FAILED = "Failed" + FULFILLED = "Fulfilled" + IN_PROGRESS = "InProgress" + READY_FOR_FULFILLMENT = "ReadyForFulfillment" + WAITING = "Waiting" + FULFILLMENT_IN_PROGRESS = "FulfillmentInProgress" + +@dataclass(kw_only=True) +class InternalServerException(ServiceError, _SerdeShape): + """""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class Interpretation(_SerdeShape): + """ + An object containing information about an intent that Amazon Lex V2 + determined might satisfy the user's utterance. The intents are ordered + by the confidence score. + """ + + nlu_confidence: ConfidenceScore | None = ... + """ + Determines the threshold where Amazon Lex V2 will insert the + `AMAZON.FallbackIntent`, `AMAZON.KendraSearchIntent`, or both when + returning alternative intents in a response. `AMAZON.FallbackIntent` and + `AMAZON.KendraSearchIntent` are only inserted if they are configured for + the bot. + """ + sentiment_response: SentimentResponse | None = ... + """ + The sentiment expressed in an utterance. + + When the bot is configured to send utterances to Amazon Comprehend for + sentiment analysis, this field contains the result of the analysis. + """ + intent: Intent | None = ... + """ + A list of intents that might satisfy the user's utterance. The intents + are ordered by the confidence score. + """ + interpretation_source: str | None = ... + """Specifies the service that interpreted the input.""" + +class InterpretationSource(UnknownEnumMixin, StrEnum): + BEDROCK = "Bedrock" + LEX = "Lex" + +@dataclass(kw_only=True) +class Message(_SerdeShape): + """Container for text that is returned to the customer..""" + + content: str | None = ... + """The text of the message.""" + content_type: str + """Indicates the type of response.""" + image_response_card: ImageResponseCard | None = ... + """ + A card that is shown to the user by a messaging platform. You define the + contents of the card, the card is displayed by the platform. + + When you use a response card, the response from the user is constrained + to the text associated with a button on the card. + """ + +class MessageContentType(UnknownEnumMixin, StrEnum): + CUSTOM_PAYLOAD = "CustomPayload" + IMAGE_RESPONSE_CARD = "ImageResponseCard" + PLAIN_TEXT = "PlainText" + SSML = "SSML" + +@dataclass(kw_only=True) +class PlaybackCompletionEvent(_SerdeShape): + """ + Event sent from the client application to Amazon Lex V2 to indicate that + playback of audio is complete and that Amazon Lex V2 should start + processing the user's input. + """ + + event_id: str | None = ... + """ + A unique identifier that your application assigns to the event. You can + use this to identify events in logs. + """ + client_timestamp_millis: int = ... + """ + A timestamp set by the client of the date and time that the event was + sent to Amazon Lex V2. + """ + +@dataclass(kw_only=True) +class PlaybackInterruptionEvent(_SerdeShape): + """ + Event sent from Amazon Lex V2 to indicate to the client application + should stop playback of audio. For example, if the client is playing a + prompt that asks for the user's telephone number, the user might start + to say the phone number before the prompt is complete. Amazon Lex V2 + sends this event to the client application to indicate that the user is + responding and that Amazon Lex V2 is processing their input. + """ + + event_reason: str | None = ... + """Indicates the type of user input that Amazon Lex V2 detected.""" + caused_by_event_id: str | None = ... + """ + The identifier of the event that contained the audio, DTMF, or text that + caused the interruption. + """ + event_id: str | None = ... + """ + A unique identifier of the event sent by Amazon Lex V2. The identifier + is in the form `RESPONSE-N`, where N is a number starting with one and + incremented for each event sent by Amazon Lex V2 in the current session. + """ + +class PlaybackInterruptionReason(UnknownEnumMixin, StrEnum): + DTMF_START_DETECTED = "DTMF_START_DETECTED" + TEXT_DETECTED = "TEXT_DETECTED" + VOICE_START_DETECTED = "VOICE_START_DETECTED" + +@dataclass(kw_only=True) +class PutSessionInput(_SerdeShape): + """Dataclass for PutSessionInput structure.""" + + bot_id: str | None = ... + """The identifier of the bot that receives the session data.""" + bot_alias_id: str | None = ... + """The alias identifier of the bot that receives the session data.""" + locale_id: str | None = ... + """The locale where the session is in use.""" + session_id: str | None = ... + """The identifier of the session that receives the session data.""" + messages: list[Message] | None = ... + """ + A list of messages to send to the user. Messages are sent in the order + that they are defined in the list. + """ + session_state: SessionState | None = ... + """ + Sets the state of the session with the user. You can use this to set the + current intent, attributes, context, and dialog action. Use the dialog + action to determine the next step that Amazon Lex V2 should use in the + conversation with the user. + """ + request_attributes: dict[str, str] | None = ... + """ + Request-specific information passed between Amazon Lex V2 and the client + application. + + The namespace `x-amz-lex:` is reserved for special attributes. Don't + create any request attributes with the prefix `x-amz-lex:`. + """ + response_content_type: str | None = ... + """ + The message that Amazon Lex V2 returns in the response can be either + text or speech depending on the value of this parameter. + + - If the value is `text/plain; charset=utf-8`, Amazon Lex V2 returns + text in the response. + """ + +@dataclass(kw_only=True) +class PutSessionOutput(_SerdeShape): + """Dataclass for PutSessionOutput structure.""" + + content_type: str | None = ... + """ + The type of response. Same as the type specified in the + `responseContentType` field in the request. + """ + messages: str | None = ... + """ + A list of messages that were last sent to the user. The messages are + ordered based on how you return the messages from you Lambda function or + the order that the messages are defined in the bot. + """ + session_state: str | None = ... + """ + A base-64-encoded gzipped field that represents the current state of the + dialog between the user and the bot. Use this to determine the progress + of the conversation and what the next action may be. + """ + request_attributes: str | None = ... + """ + A base-64-encoded gzipped field that provides request-specific + information passed between the client application and Amazon Lex V2. + These are the same as the `requestAttribute` parameter in the call to + the `PutSession` operation. + """ + session_id: str | None = ... + """The identifier of the session that received the data.""" + audio_stream: StreamingBlob = ... + """ + If the requested content type was audio, the audio version of the + message to convey to the user. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class RecognizedBotMember(_SerdeShape): + """The bot member that processes the request.""" + + bot_id: str + """The identifier of the bot member that processes the request.""" + bot_name: str | None = ... + """The name of the bot member that processes the request.""" + +@dataclass(kw_only=True) +class RecognizeTextInput(_SerdeShape): + """Dataclass for RecognizeTextInput structure.""" + + bot_id: str | None = ... + """The identifier of the bot that processes the request.""" + bot_alias_id: str | None = ... + """The alias identifier in use for the bot that processes the request.""" + locale_id: str | None = ... + """The locale where the session is in use.""" + session_id: str | None = ... + """The identifier of the user session that is having the conversation.""" + text: str | None = ... + """The text that the user entered. Amazon Lex V2 interprets this text.""" + session_state: SessionState | None = ... + """The current state of the dialog between the user and the bot.""" + request_attributes: dict[str, str] | None = ... + """ + Request-specific information passed between the client application and + Amazon Lex V2 + + The namespace `x-amz-lex:` is reserved for special attributes. Don't + create any request attributes with the prefix `x-amz-lex:`. + """ + +@dataclass(kw_only=True) +class RecognizeTextOutput(_SerdeShape): + """Dataclass for RecognizeTextOutput structure.""" + + messages: list[Message] | None = ... + """ + A list of messages last sent to the user. The messages are ordered based + on the order that you returned the messages from your Lambda function or + the order that the messages are defined in the bot. + """ + session_state: SessionState | None = ... + """ + Represents the current state of the dialog between the user and the bot. + + Use this to determine the progress of the conversation and what the next + action may be. + """ + interpretations: list[Interpretation] | None = ... + """ + A list of intents that Amazon Lex V2 determined might satisfy the + user's utterance. + + Each interpretation includes the intent, a score that indicates now + confident Amazon Lex V2 is that the interpretation is the correct one, + and an optional sentiment response that indicates the sentiment + expressed in the utterance. + """ + request_attributes: dict[str, str] | None = ... + """The attributes sent in the request.""" + session_id: str | None = ... + """The identifier of the session in use.""" + recognized_bot_member: RecognizedBotMember | None = ... + """The bot member that recognized the text.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class RecognizeUtteranceInput(_SerdeShape): + """Dataclass for RecognizeUtteranceInput structure.""" + + bot_id: str | None = ... + """The identifier of the bot that should receive the request.""" + bot_alias_id: str | None = ... + """The alias identifier in use for the bot that should receive the request.""" + locale_id: str | None = ... + """The locale where the session is in use.""" + session_id: str | None = ... + """The identifier of the session in use.""" + session_state: str | None = ... + """ + Sets the state of the session with the user. You can use this to set the + current intent, attributes, context, and dialog action. Use the dialog + action to determine the next step that Amazon Lex V2 should use in the + conversation with the user. + + The `sessionState` field must be compressed using gzip and then base64 + encoded before sending to Amazon Lex V2. + """ + request_attributes: str | None = ... + """ + Request-specific information passed between the client application and + Amazon Lex V2 + + The namespace `x-amz-lex:` is reserved for special attributes. Don't + create any request attributes for prefix `x-amz-lex:`. + + The `requestAttributes` field must be compressed using gzip and then + base64 encoded before sending to Amazon Lex V2. + """ + request_content_type: str | None = ... + """ + Indicates the format for audio input or that the content is text. The + header must start with one of the following prefixes: + + - PCM format, audio data must be in little-endian byte order. + + - audio/l16; rate=16000; channels=1 + + - audio/x-l16; sample-rate=16000; channel-count=1 + + - audio/lpcm; sample-rate=8000; sample-size-bits=16; channel-count=1; + is-big-endian=false + + - Opus format + + - audio/x-cbr-opus-with-preamble;preamble-size=0;bit-rate=256000;frame-size-milliseconds=4 + + - Text format + + - text/plain; charset=utf-8 + """ + response_content_type: str | None = ... + """ + The message that Amazon Lex V2 returns in the response can be either + text or speech based on the `responseContentType` value. + + - If the value is `text/plain;charset=utf-8`, Amazon Lex V2 returns text + in the response. + + - If the value begins with `audio/`, Amazon Lex V2 returns speech in the + response. Amazon Lex V2 uses Amazon Polly to generate the speech using + the configuration that you specified in the `responseContentType` + parameter. For example, if you specify `audio/mpeg` as the value, + Amazon Lex V2 returns speech in the MPEG format. + + - If the value is `audio/pcm`, the speech returned is `audio/pcm` at 16 + KHz in 16-bit, little-endian format. + + - The following are the accepted values: + + - audio/mpeg + + - audio/ogg + + - audio/pcm (16 KHz) + + - audio/* (defaults to mpeg) + + - text/plain; charset=utf-8 + """ + input_stream: StreamingBlob = ... + """ + User input in PCM or Opus audio format or text format as described in + the `requestContentType` parameter. + """ + +@dataclass(kw_only=True) +class RecognizeUtteranceOutput(_SerdeShape): + """Dataclass for RecognizeUtteranceOutput structure.""" + + input_mode: str | None = ... + """ + Indicates whether the input mode to the operation was text, speech, or + from a touch-tone keypad. + """ + content_type: str | None = ... + """Content type as specified in the `responseContentType` in the request.""" + messages: str | None = ... + """ + A list of messages that were last sent to the user. The messages are + ordered based on the order that you returned the messages from your + Lambda function or the order that the messages are defined in the bot. + + The `messages` field is compressed with gzip and then base64 encoded. + Before you can use the contents of the field, you must decode and + decompress the contents. See the example for a simple function to decode + and decompress the contents. + """ + interpretations: str | None = ... + """ + A list of intents that Amazon Lex V2 determined might satisfy the + user's utterance. + + Each interpretation includes the intent, a score that indicates how + confident Amazon Lex V2 is that the interpretation is the correct one, + and an optional sentiment response that indicates the sentiment + expressed in the utterance. + + The `interpretations` field is compressed with gzip and then base64 + encoded. Before you can use the contents of the field, you must decode + and decompress the contents. See the example for a simple function to + decode and decompress the contents. + """ + session_state: str | None = ... + """ + Represents the current state of the dialog between the user and the bot. + + Use this to determine the progress of the conversation and what the next + action might be. + + The `sessionState` field is compressed with gzip and then base64 + encoded. Before you can use the contents of the field, you must decode + and decompress the contents. See the example for a simple function to + decode and decompress the contents. + """ + request_attributes: str | None = ... + """ + The attributes sent in the request. + + The `requestAttributes` field is compressed with gzip and then base64 + encoded. Before you can use the contents of the field, you must decode + and decompress the contents. + """ + session_id: str | None = ... + """The identifier of the session in use.""" + input_transcript: str | None = ... + """ + The text used to process the request. + + If the input was an audio stream, the `inputTranscript` field contains + the text extracted from the audio stream. This is the text that is + actually processed to recognize intents and slot values. You can use + this information to determine if Amazon Lex V2 is correctly processing + the audio that you send. + + The `inputTranscript` field is compressed with gzip and then base64 + encoded. Before you can use the contents of the field, you must decode + and decompress the contents. See the example for a simple function to + decode and decompress the contents. + """ + audio_stream: StreamingBlob = ... + """ + The prompt or statement to send to the user. This is based on the bot + configuration and context. For example, if Amazon Lex V2 did not + understand the user intent, it sends the `clarificationPrompt` + configured for the bot. If the intent requires confirmation before + taking the fulfillment action, it sends the `confirmationPrompt`. + Another example: Suppose that the Lambda function successfully fulfilled + the intent, and sent a message to convey to the user. Then Amazon Lex V2 + sends that message in the response. + """ + recognized_bot_member: str | None = ... + """The bot member that recognized the utterance.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ResourceNotFoundException(ServiceError, _SerdeShape): + """""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class RuntimeHintDetails(_SerdeShape): + """ + Provides an array of phrases that should be given preference when + resolving values for a slot. + """ + + runtime_hint_values: list[RuntimeHintValue] | None = ... + """ + One or more strings that Amazon Lex V2 should look for in the input to + the bot. Each phrase is given preference when deciding on slot values. + """ + sub_slot_hints: dict[str, RuntimeHintDetails] | None = ... + """ + A map of constituent sub slot names inside a composite slot in the + intent and the phrases that should be added for each sub slot. Inside + each composite slot hints, this structure provides a mechanism to add + granular sub slot phrases. Only sub slot hints are supported for + composite slots. The intent name, composite slot name and the + constituent sub slot names must exist. + """ + +@dataclass(kw_only=True) +class RuntimeHints(_SerdeShape): + """ + You can provide Amazon Lex V2 with hints to the phrases that a customer + is likely to use for a slot. When a slot with hints is resolved, the + phrases in the runtime hints are preferred in the resolution. You can + provide hints for a maximum of 100 intents. You can provide a maximum of + 100 slots. + + Before you can use runtime hints with an existing bot, you must first + rebuild the bot. + + For more information, see [Using runtime hints to improve recognition of + slot + values](https://docs.aws.amazon.com/lexv2/latest/dg/using-hints.html). + """ + + slot_hints: dict[str, dict[str, RuntimeHintDetails]] | None = ... + """ + A list of the slots in the intent that should have runtime hints added, + and the phrases that should be added for each slot. + + The first level of the `slotHints` map is the name of the intent. The + second level is the name of the slot within the intent. For more + information, see [Using hints to improve + accuracy](https://docs.aws.amazon.com/lexv2/latest/dg/using-hints.html). + + The intent name and slot name must exist. + """ + +@dataclass(kw_only=True) +class RuntimeHintValue(_SerdeShape): + """ + Provides the phrase that Amazon Lex V2 should look for in the user's + input to the bot. + """ + + phrase: str + """ + The phrase that Amazon Lex V2 should look for in the user's input to + the bot. + """ + +@dataclass(kw_only=True) +class SentimentResponse(_SerdeShape): + """ + Provides information about the sentiment expressed in a user's response + in a conversation. Sentiments are determined using Amazon Comprehend. + Sentiments are only returned if they are enabled for the bot. + + For more information, see [Determine + Sentiment](https://docs.aws.amazon.com/comprehend/latest/dg/how-sentiment.html) + in the *Amazon Comprehend developer guide*. + """ + + sentiment: str | None = ... + """ + The overall sentiment expressed in the user's response. This is the + sentiment most likely expressed by the user based on the analysis by + Amazon Comprehend. + """ + sentiment_score: SentimentScore | None = ... + """The individual sentiment responses for the utterance.""" + +@dataclass(kw_only=True) +class SentimentScore(_SerdeShape): + """The individual sentiment responses for the utterance.""" + + positive: float = ... + """ + The level of confidence that Amazon Comprehend has in the accuracy of + its detection of the `POSITIVE` sentiment. + """ + negative: float = ... + """ + The level of confidence that Amazon Comprehend has in the accuracy of + its detection of the `NEGATIVE` sentiment. + """ + neutral: float = ... + """ + The level of confidence that Amazon Comprehend has in the accuracy of + its detection of the `NEUTRAL` sentiment. + """ + mixed: float = ... + """ + The level of confidence that Amazon Comprehend has in the accuracy of + its detection of the `MIXED` sentiment. + """ + +class SentimentType(UnknownEnumMixin, StrEnum): + MIXED = "MIXED" + NEGATIVE = "NEGATIVE" + NEUTRAL = "NEUTRAL" + POSITIVE = "POSITIVE" + +@dataclass(kw_only=True) +class SessionState(_SerdeShape): + """The state of the user's session with Amazon Lex V2.""" + + dialog_action: DialogAction | None = ... + """ + The next step that Amazon Lex V2 should take in the conversation with a + user. + """ + intent: Intent | None = ... + """The active intent that Amazon Lex V2 is processing.""" + active_contexts: list[ActiveContext] | None = ... + """ + One or more contexts that indicate to Amazon Lex V2 the context of a + request. When a context is active, Amazon Lex V2 considers intents with + the matching context as a trigger as the next intent in a session. + """ + session_attributes: dict[str, str] | None = ... + """ + Map of key/value pairs representing session-specific context + information. It contains application information passed between Amazon + Lex V2 and a client application. + """ + originating_request_id: str | None = ... + """A unique identifier for a specific request.""" + runtime_hints: RuntimeHints | None = ... + """ + Hints for phrases that a customer is likely to use for a slot. Amazon + Lex V2 uses the hints to help determine the correct value of a slot. + """ + +class Shape(UnknownEnumMixin, StrEnum): + SCALAR = "Scalar" + LIST_ = "List" + COMPOSITE = "Composite" + +@dataclass(kw_only=True) +class Slot(_SerdeShape): + """A value that Amazon Lex V2 uses to fulfill an intent.""" + + value: Value | None = ... + """The current value of the slot.""" + shape: str | None = ... + """ + When the `shape` value is `List`, it indicates that the `values` field + contains a list of slot values. When the value is `Scalar`, it indicates + that the `value` field contains a single value. + """ + values: list[Slot] | None = ... + """ + A list of one or more values that the user provided for the slot. For + example, if a for a slot that elicits pizza toppings, the values might + be \"pepperoni\" and \"pineapple.\" + """ + sub_slots: dict[str, Slot] | None = ... + """The constituent sub slots of a composite slot.""" + +@dataclass(kw_only=True) +class StartConversationInput(_SerdeShape): + """Dataclass for StartConversationInput structure.""" + + bot_id: str | None = ... + """The identifier of the bot to process the request.""" + bot_alias_id: str | None = ... + """The alias identifier in use for the bot that processes the request.""" + locale_id: str | None = ... + """The locale where the session is in use.""" + session_id: str | None = ... + """The identifier of the user session that is having the conversation.""" + conversation_mode: str | None = ... + """ + The conversation type that you are using the Amazon Lex V2. If the + conversation mode is `AUDIO` you can send both audio and DTMF + information. If the mode is `TEXT` you can only send text. + """ + +@dataclass(kw_only=True) +class StartConversationOutput(_SerdeShape): + """Dataclass for StartConversationOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass +class StartConversationRequestEventStreamConfigurationEvent(_SerdeShape): + """ + Configuration information sent from your client application to Amazon + Lex V2 + """ + + value: ConfigurationEvent + +@dataclass +class StartConversationRequestEventStreamAudioInputEvent(_SerdeShape): + """ + Speech audio sent from your client application to Amazon Lex V2. Audio + starts accumulating when Amazon Lex V2 identifies a voice and continues + until a natural pause in the speech is found before processing. + """ + + value: AudioInputEvent + +@dataclass +class StartConversationRequestEventStreamDTMFInputEvent(_SerdeShape): + """ + DTMF information sent to Amazon Lex V2 by your application. Amazon Lex + V2 accumulates the DMTF information from when the user sends the first + character and ends + + - when there's a pause longer that the value configured for the end + timeout. + + - when there's a digit that is the configured end character. + + - when Amazon Lex V2 accumulates characters equal to the maximum DTMF + character configuration. + """ + + value: DTMFInputEvent + +@dataclass +class StartConversationRequestEventStreamTextInputEvent(_SerdeShape): + """ + Text sent from your client application to Amazon Lex V2. Each + `TextInputEvent` is processed individually. + """ + + value: TextInputEvent + +@dataclass +class StartConversationRequestEventStreamPlaybackCompletionEvent(_SerdeShape): + """ + Event sent from the client application to Amazon Lex V2 to indicate that + it has finished playing audio and that Amazon Lex V2 should start + listening for user input. + """ + + value: PlaybackCompletionEvent + +@dataclass +class StartConversationRequestEventStreamDisconnectionEvent(_SerdeShape): + """ + Event sent from the client application to indicate to Amazon Lex V2 that + the conversation is over. + """ + + value: DisconnectionEvent + +@dataclass +class StartConversationRequestEventStreamUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +StartConversationRequestEventStream = Union[ + StartConversationRequestEventStreamConfigurationEvent + | StartConversationRequestEventStreamAudioInputEvent + | StartConversationRequestEventStreamDTMFInputEvent + | StartConversationRequestEventStreamTextInputEvent + | StartConversationRequestEventStreamPlaybackCompletionEvent + | StartConversationRequestEventStreamDisconnectionEvent + | StartConversationRequestEventStreamUnknown +] +""" +Represents a stream of events between your application and Amazon Lex +V2. +""" + +class _StartConversationRequestEventStreamDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> StartConversationRequestEventStream: ... + +@dataclass +class StartConversationResponseEventStreamPlaybackInterruptionEvent(_SerdeShape): + """ + Event sent from Amazon Lex V2 to indicate to the client application + should stop playback of audio. For example, if the client is playing a + prompt that asks for the user's telephone number, the user might start + to say the phone number before the prompt is complete. Amazon Lex V2 + sends this event to the client application to indicate that the user is + responding and that Amazon Lex V2 is processing their input. + """ + + value: PlaybackInterruptionEvent + +@dataclass +class StartConversationResponseEventStreamTranscriptEvent(_SerdeShape): + """ + Event sent from Amazon Lex V2 to your client application that contains a + transcript of voice audio. + """ + + value: TranscriptEvent + +@dataclass +class StartConversationResponseEventStreamIntentResultEvent(_SerdeShape): + """ + Event sent from Amazon Lex V2 to the client application containing the + current state of the conversation between the user and Amazon Lex V2. + """ + + value: IntentResultEvent + +@dataclass +class StartConversationResponseEventStreamTextResponseEvent(_SerdeShape): + """ + The event sent from Amazon Lex V2 to your application with text to + present to the user. + """ + + value: TextResponseEvent + +@dataclass +class StartConversationResponseEventStreamAudioResponseEvent(_SerdeShape): + """ + An event sent from Amazon Lex V2 to your client application containing + audio to play to the user. + """ + + value: AudioResponseEvent + +@dataclass +class StartConversationResponseEventStreamHeartbeatEvent(_SerdeShape): + """ + Event that Amazon Lex V2 sends to indicate that the stream is still open + between the client application and Amazon Lex V2 + """ + + value: HeartbeatEvent + +@dataclass +class StartConversationResponseEventStreamAccessDeniedException(_SerdeShape): + """ + Exception thrown when the credentials passed with the request are + invalid or expired. Also thrown when the credentials in the request do + not have permission to access the `StartConversation` operation. + """ + + value: AccessDeniedException + +@dataclass +class StartConversationResponseEventStreamResourceNotFoundException(_SerdeShape): + """ + Exception thrown if one of the input parameters points to a resource + that does not exist. For example, if the bot ID specified does not + exist. + """ + + value: ResourceNotFoundException + +@dataclass +class StartConversationResponseEventStreamValidationException(_SerdeShape): + """ + Exception thrown when one or more parameters could not be validated. The + `message` contains the name of the field that isn't valid. + """ + + value: ValidationException + +@dataclass +class StartConversationResponseEventStreamThrottlingException(_SerdeShape): + """ + Exception thrown when your application exceeds the maximum number of + concurrent requests. + """ + + value: ThrottlingException + +@dataclass +class StartConversationResponseEventStreamInternalServerException(_SerdeShape): + """An error occurred with Amazon Lex V2.""" + + value: InternalServerException + +@dataclass +class StartConversationResponseEventStreamConflictException(_SerdeShape): + """ + Exception thrown when two clients are using the same AWS account, Amazon + Lex V2 bot, and session ID. + """ + + value: ConflictException + +@dataclass +class StartConversationResponseEventStreamDependencyFailedException(_SerdeShape): + """""" + + value: DependencyFailedException + +@dataclass +class StartConversationResponseEventStreamBadGatewayException(_SerdeShape): + """""" + + value: BadGatewayException + +@dataclass +class StartConversationResponseEventStreamUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +StartConversationResponseEventStream = Union[ + StartConversationResponseEventStreamPlaybackInterruptionEvent + | StartConversationResponseEventStreamTranscriptEvent + | StartConversationResponseEventStreamIntentResultEvent + | StartConversationResponseEventStreamTextResponseEvent + | StartConversationResponseEventStreamAudioResponseEvent + | StartConversationResponseEventStreamHeartbeatEvent + | StartConversationResponseEventStreamAccessDeniedException + | StartConversationResponseEventStreamResourceNotFoundException + | StartConversationResponseEventStreamValidationException + | StartConversationResponseEventStreamThrottlingException + | StartConversationResponseEventStreamInternalServerException + | StartConversationResponseEventStreamConflictException + | StartConversationResponseEventStreamDependencyFailedException + | StartConversationResponseEventStreamBadGatewayException + | StartConversationResponseEventStreamUnknown +] +""" +Represents a stream of events between Amazon Lex V2 and your +application. +""" + +class _StartConversationResponseEventStreamDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> StartConversationResponseEventStream: ... + +class StyleType(UnknownEnumMixin, StrEnum): + DEFAULT = "Default" + SPELL_BY_LETTER = "SpellByLetter" + SPELL_BY_WORD = "SpellByWord" + +@dataclass(kw_only=True) +class TextInputEvent(_SerdeShape): + """ + The event sent from your client application to Amazon Lex V2 with text + input from the user. + """ + + text: str + """ + The text from the user. Amazon Lex V2 processes this as a complete + statement. + """ + event_id: str | None = ... + """ + A unique identifier that your application assigns to the event. You can + use this to identify events in logs. + """ + client_timestamp_millis: int = ... + """ + A timestamp set by the client of the date and time that the event was + sent to Amazon Lex V2. + """ + +@dataclass(kw_only=True) +class TextResponseEvent(_SerdeShape): + """ + The event sent from Amazon Lex V2 to your application with text to + present to the user. + """ + + messages: list[Message] | None = ... + """ + A list of messages to send to the user. Messages are ordered based on + the order that you returned the messages from your Lambda function or + the order that the messages are defined in the bot. + """ + event_id: str | None = ... + """ + A unique identifier of the event sent by Amazon Lex V2. The identifier + is in the form `RESPONSE-N`, where N is a number starting with one and + incremented for each event sent by Amazon Lex V2 in the current session. + """ + +@dataclass(kw_only=True) +class ThrottlingException(ServiceError, _SerdeShape): + """""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class TranscriptEvent(_SerdeShape): + """ + Event sent from Amazon Lex V2 to your client application that contains a + transcript of voice audio. + """ + + transcript: str | None = ... + """The transcript of the voice audio from the user.""" + event_id: str | None = ... + """ + A unique identifier of the event sent by Amazon Lex V2. The identifier + is in the form `RESPONSE-N`, where N is a number starting with one and + incremented for each event sent by Amazon Lex V2 in the current session. + """ + +@dataclass(kw_only=True) +class ValidationException(ServiceError, _SerdeShape): + """""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class Value(_SerdeShape): + """ + Information about the value provided for a slot and Amazon Lex V2's + interpretation. + """ + + original_value: str | None = ... + """ + The part of the user's response to the slot elicitation that Amazon Lex + V2 determines is relevant to the slot value. + """ + interpreted_value: str + """ + The value that Amazon Lex V2 determines for the slot, given the user + input. The actual value depends on the setting of the value selection + strategy for the bot. You can choose to use the value entered by the + user, or you can have Amazon Lex V2 choose the first value in the + `resolvedValues` list. + """ + resolved_values: list[str] | None = ... + """ + A list of values that Amazon Lex V2 determines are possible resolutions + for the user input. The first value matches the `interpretedValue`. + """ + +DELETE_SESSION: APIOperation[DeleteSessionInput, DeleteSessionOutput] +GET_SESSION: APIOperation[GetSessionInput, GetSessionOutput] +PUT_SESSION: APIOperation[PutSessionInput, PutSessionOutput] +RECOGNIZE_TEXT: APIOperation[RecognizeTextInput, RecognizeTextOutput] +RECOGNIZE_UTTERANCE: APIOperation[RecognizeUtteranceInput, RecognizeUtteranceOutput] +START_CONVERSATION: APIOperation[StartConversationInput, StartConversationOutput] diff --git a/clients/aws-sdk-lex-runtime-v2/tests/integration/__init__.py b/clients/aws-sdk-lex-runtime-v2/tests/integration/__init__.py index b85116da..8f37f8aa 100644 --- a/clients/aws-sdk-lex-runtime-v2/tests/integration/__init__.py +++ b/clients/aws-sdk-lex-runtime-v2/tests/integration/__init__.py @@ -1,9 +1,9 @@ # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 -from smithy_aws_core.config import AwsConfigOverrides -from smithy_aws_core.identity import EnvironmentCredentialsResolver -from smithy_http.aio.interfaces import HTTPClient +from smithy_aws_core.aio.config import AwsConfigOverrides +from smithy_aws_core.aio.identity import AsyncEnvironmentCredentialsResolver +from smithy_http.aio.interfaces import AsyncHTTPClient from aws_sdk_lex_runtime_v2.client import AsyncLexRuntimeV2Client from aws_sdk_lex_runtime_v2.config import AsyncLexRuntimeV2Config @@ -14,12 +14,12 @@ async def create_lex_client( - region: str, *, transport: HTTPClient | None = None + region: str, *, transport: AsyncHTTPClient | None = None ) -> AsyncLexRuntimeV2Client: overrides: AwsConfigOverrides = { "endpoint_uri": f"https://runtime-v2-lex.{region}.amazonaws.com", "region": region, - "aws_credentials_identity_resolver": EnvironmentCredentialsResolver(), + "aws_credentials_identity_resolver": AsyncEnvironmentCredentialsResolver(), } if transport is not None: overrides["transport"] = transport diff --git a/clients/aws-sdk-lex-runtime-v2/tests/integration/conftest.py b/clients/aws-sdk-lex-runtime-v2/tests/integration/conftest.py index d7475875..a772be37 100644 --- a/clients/aws-sdk-lex-runtime-v2/tests/integration/conftest.py +++ b/clients/aws-sdk-lex-runtime-v2/tests/integration/conftest.py @@ -144,9 +144,9 @@ def lex_bot(): role_name = f"integ-test-lex-runtime-v2-role-{unique_suffix}" bot_name = f"integ-test-lex-runtime-v2-bot-{unique_suffix}" - iam_client = boto3.client("iam") - lex_client = boto3.client("lexv2-models", region_name=REGION) - sts_client = boto3.client("sts") + iam_client = boto3.client("iam") # pyright: ignore[reportUnknownMemberType] + lex_client = boto3.client("lexv2-models", region_name=REGION) # pyright: ignore[reportUnknownMemberType] + sts_client = boto3.client("sts") # pyright: ignore[reportUnknownMemberType] bot_id = None try: diff --git a/clients/aws-sdk-lex-runtime-v2/tests/integration/test_bidirectional_streaming.py b/clients/aws-sdk-lex-runtime-v2/tests/integration/test_bidirectional_streaming.py index cc1147c2..709aa67f 100644 --- a/clients/aws-sdk-lex-runtime-v2/tests/integration/test_bidirectional_streaming.py +++ b/clients/aws-sdk-lex-runtime-v2/tests/integration/test_bidirectional_streaming.py @@ -6,7 +6,7 @@ import asyncio import uuid -from smithy_core.aio.eventstream import DuplexEventStream +from smithy_core.aio.eventstream import AsyncDuplexEventStream from smithy_http.aio.crt import AWSCRTHTTPClient from aws_sdk_lex_runtime_v2.models import ( @@ -30,7 +30,7 @@ async def _send_events( - stream: DuplexEventStream[ + stream: AsyncDuplexEventStream[ StartConversationRequestEventStream, StartConversationResponseEventStream, StartConversationOutput, @@ -63,7 +63,7 @@ async def _send_events( async def _receive_events( - stream: DuplexEventStream[ + stream: AsyncDuplexEventStream[ StartConversationRequestEventStream, StartConversationResponseEventStream, StartConversationOutput, diff --git a/clients/aws-sdk-polly/examples/stream_speech_to_file.py b/clients/aws-sdk-polly/examples/stream_speech_to_file.py index 3536ddbf..9f75d935 100644 --- a/clients/aws-sdk-polly/examples/stream_speech_to_file.py +++ b/clients/aws-sdk-polly/examples/stream_speech_to_file.py @@ -35,8 +35,11 @@ import textwrap from pathlib import Path -from smithy_aws_core.identity import EnvironmentCredentialsResolver -from smithy_core.aio.interfaces.eventstream import EventPublisher, EventReceiver +from smithy_aws_core.aio.identity import AsyncEnvironmentCredentialsResolver +from smithy_core.aio.interfaces.eventstream import ( + AsyncEventPublisher, + AsyncEventReceiver, +) from smithy_http.aio.crt import AWSCRTHTTPClient from aws_sdk_polly.client import AsyncPollyClient @@ -102,7 +105,7 @@ def get_text_chunks(text_arg: str | None) -> list[str]: async def send_text( - input_stream: EventPublisher[StartSpeechSynthesisStreamActionStream], + input_stream: AsyncEventPublisher[StartSpeechSynthesisStreamActionStream], text_chunks: list[str], ): for chunk in text_chunks: @@ -118,7 +121,7 @@ async def send_text( async def write_audio( - output_stream: EventReceiver[StartSpeechSynthesisStreamEventStream], + output_stream: AsyncEventReceiver[StartSpeechSynthesisStreamEventStream], output_path: Path, ): bytes_written = 0 @@ -140,7 +143,7 @@ async def main(): config=await AsyncPollyConfig.resolve( endpoint_uri=f"https://polly.{args.region}.amazonaws.com", region=args.region, - aws_credentials_identity_resolver=EnvironmentCredentialsResolver(), + aws_credentials_identity_resolver=AsyncEnvironmentCredentialsResolver(), transport=AWSCRTHTTPClient(), ) ) as client: diff --git a/clients/aws-sdk-polly/examples/stream_speech_to_speakers.py b/clients/aws-sdk-polly/examples/stream_speech_to_speakers.py index 4717df20..4cea9a15 100644 --- a/clients/aws-sdk-polly/examples/stream_speech_to_speakers.py +++ b/clients/aws-sdk-polly/examples/stream_speech_to_speakers.py @@ -39,8 +39,11 @@ from collections import deque import miniaudio -from smithy_aws_core.identity import EnvironmentCredentialsResolver -from smithy_core.aio.interfaces.eventstream import EventPublisher, EventReceiver +from smithy_aws_core.aio.identity import AsyncEnvironmentCredentialsResolver +from smithy_core.aio.interfaces.eventstream import ( + AsyncEventPublisher, + AsyncEventReceiver, +) from smithy_http.aio.crt import AWSCRTHTTPClient from aws_sdk_polly.client import AsyncPollyClient @@ -105,7 +108,7 @@ def get_text_chunks(text_arg: str | None) -> list[str]: async def send_text( - input_stream: EventPublisher[StartSpeechSynthesisStreamActionStream], + input_stream: AsyncEventPublisher[StartSpeechSynthesisStreamActionStream], text_chunks: list[str], ): for chunk in text_chunks: @@ -213,7 +216,7 @@ async def wait_until_player_stops_or_errors( async def play_audio( - output_stream: EventReceiver[StartSpeechSynthesisStreamEventStream], + output_stream: AsyncEventReceiver[StartSpeechSynthesisStreamEventStream], ): source = Mp3StreamSource() stop_player = threading.Event() @@ -246,7 +249,7 @@ async def main(): config=await AsyncPollyConfig.resolve( endpoint_uri=f"https://polly.{args.region}.amazonaws.com", region=args.region, - aws_credentials_identity_resolver=EnvironmentCredentialsResolver(), + aws_credentials_identity_resolver=AsyncEnvironmentCredentialsResolver(), transport=AWSCRTHTTPClient(), ) ) as client: diff --git a/clients/aws-sdk-polly/scripts/docs/generate_doc_stubs.py b/clients/aws-sdk-polly/scripts/docs/generate_doc_stubs.py index 52d470bc..795f2e4b 100644 --- a/clients/aws-sdk-polly/scripts/docs/generate_doc_stubs.py +++ b/clients/aws-sdk-polly/scripts/docs/generate_doc_stubs.py @@ -126,7 +126,9 @@ class ClientInfo: class DocStubGenerator: """Generate markdown API Reference stubs for AWS SDK for Python v4 clients.""" - def __init__(self, client_dir: Path, output_dir: Path, service_name: str | None = None) -> None: + def __init__( + self, client_dir: Path, output_dir: Path, service_name: str | None = None + ) -> None: """ Initialize the documentation generator. @@ -190,7 +192,9 @@ def _analyze_client_package(self, package_name: str) -> ClientInfo: required = ("client", "config", "models") missing = [name for name in required if not package.modules.get(name)] if missing: - raise ValueError(f"Missing required modules in {package_name}: {', '.join(missing)}") + raise ValueError( + f"Missing required modules in {package_name}: {', '.join(missing)}" + ) # Parse submodules client_module = package.modules["client"] @@ -199,11 +203,15 @@ def _analyze_client_package(self, package_name: str) -> ClientInfo: client_class = self._find_class_with_suffix(client_module, "Client") if not client_class: - raise ValueError(f"No class ending with 'Client' found in {package_name}.client") + raise ValueError( + f"No class ending with 'Client' found in {package_name}.client" + ) config_class = self._find_class_with_suffix(config_module, "Config") if not config_class: - raise ValueError(f"No class ending with 'Config' found in {package_name}.config") + raise ValueError( + f"No class ending with 'Config' found in {package_name}.config" + ) plugin_alias = config_module.members.get("Plugin") if not plugin_alias: @@ -288,7 +296,9 @@ def _analyze_operation(self, operation: Function) -> OperationInfo: if output_type in stream_type_map: stream_type = stream_type_map[output_type] - stream_args = self._get_subscript_elements(returns, f"'{operation.name}' stream type") + stream_args = self._get_subscript_elements( + returns, f"'{operation.name}' stream type" + ) if stream_type in (StreamType.INPUT, StreamType.DUPLEX): event_input_type = stream_args[0].canonical_name @@ -316,7 +326,9 @@ def _analyze_operation(self, operation: Function) -> OperationInfo: def _get_expr(self, annotation: str | Expr | None, context: str) -> Expr: """Extract and validate an Expr from an annotation.""" if not isinstance(annotation, Expr): - raise TypeError(f"{context}: expected Expr, got {type(annotation).__name__}") + raise TypeError( + f"{context}: expected Expr, got {type(annotation).__name__}" + ) return annotation def _get_subscript_elements(self, expr: Expr, context: str) -> list[Expr]: @@ -330,7 +342,9 @@ def _get_subscript_elements(self, expr: Expr, context: str) -> list[Expr]: return [el for el in slice_expr.elements if isinstance(el, Expr)] return [slice_expr] - def _extract_models(self, models_module: Module, operations: list[OperationInfo]) -> ModelsInfo: + def _extract_models( + self, models_module: Module, operations: list[OperationInfo] + ) -> ModelsInfo: """Extract structures, unions, enums, and errors from models module.""" structures, unions, enums, errors = [], [], [], [] @@ -356,14 +370,16 @@ def _extract_models(self, models_module: Module, operations: list[OperationInfo] duplicates = [] for structure in structures: - if self._is_operation_io_type(structure.name, operations) or self._is_union_member( - structure.name, unions - ): + if self._is_operation_io_type( + structure.name, operations + ) or self._is_union_member(structure.name, unions): duplicates.append(structure) structures = [struct for struct in structures if struct not in duplicates] - return ModelsInfo(structures=structures, unions=unions, enums=enums, errors=errors) + return ModelsInfo( + structures=structures, unions=unions, enums=enums, errors=errors + ) def _is_union(self, member: Object | Alias) -> TypeGuard[Attribute]: """Check if a module member is a union type.""" @@ -399,7 +415,9 @@ def _extract_union_members( for name in member_names: if not (member_object := models_module.members.get(name)): raise ValueError(f"Union member '{name}' not found in models module") - members.append(TypeInfo(name=member_object.name, module_path=member_object.path)) + members.append( + TypeInfo(name=member_object.name, module_path=member_object.path) + ) return members @@ -408,7 +426,8 @@ def _is_enum(self, member: Object | Alias) -> TypeGuard[Class]: if not isinstance(member, Class): return False return any( - isinstance(base, ExprName) and base.name in ENUM_BASE_CLASSES for base in member.bases + isinstance(base, ExprName) and base.name in ENUM_BASE_CLASSES + for base in member.bases ) def _is_error(self, member: Object | Alias) -> TypeGuard[Class]: @@ -416,10 +435,13 @@ def _is_error(self, member: Object | Alias) -> TypeGuard[Class]: if not isinstance(member, Class): return False return any( - isinstance(base, ExprName) and base.name in ERROR_BASE_CLASSES for base in member.bases + isinstance(base, ExprName) and base.name in ERROR_BASE_CLASSES + for base in member.bases ) - def _is_operation_io_type(self, type_name: str, operations: list[OperationInfo]) -> bool: + def _is_operation_io_type( + self, type_name: str, operations: list[OperationInfo] + ) -> bool: """Check if a type is used as operation input/output.""" return any(type_name in (op.input.name, op.output.name) for op in operations) @@ -437,8 +459,12 @@ def _generate_client_docs(self, client_info: ClientInfo) -> bool: self._generate_type_stubs( client_info.models.structures, "structures", "Structure Class" ) - self._generate_type_stubs(client_info.models.errors, "errors", "Error Class") - self._generate_type_stubs(client_info.models.enums, "enums", "Enum Class", members=True) + self._generate_type_stubs( + client_info.models.errors, "errors", "Error Class" + ) + self._generate_type_stubs( + client_info.models.enums, "enums", "Enum Class", members=True + ) self._generate_union_stubs(client_info.models.unions) except OSError as e: logger.error(f"Failed to write documentation files: {e}") @@ -470,7 +496,9 @@ def _generate_index(self, client_info: ClientInfo) -> None: ] for method in sorted(client_info.client_methods, key=lambda x: x.name): - lines.extend([*self._mkdocs_directive(method.module_path, heading_level=4), ""]) + lines.extend( + [*self._mkdocs_directive(method.module_path, heading_level=4), ""] + ) # Operations section if client_info.operations: @@ -578,7 +606,9 @@ def _generate_operation_stubs(self, operations: list[OperationInfo]) -> None: output_path = self.output_dir / "operations" / f"{op.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb("Operations", op.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb("Operations", op.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(operations)} operation file(s)") @@ -600,7 +630,9 @@ def _generate_type_stubs( output_path = self.output_dir / category / f"{item.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb(category.title(), item.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb(category.title(), item.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(items)} {category} file(s)") @@ -624,7 +656,9 @@ def _generate_union_stubs(self, unions: list[UnionInfo]) -> None: output_path = self.output_dir / "unions" / f"{union.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb("Unions", union.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb("Unions", union.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(unions)} union file(s)") diff --git a/clients/aws-sdk-polly/src/aws_sdk_polly/_private/schemas.py b/clients/aws-sdk-polly/src/aws_sdk_polly/_private/schemas.py index ef6571ea..b1504e2f 100644 --- a/clients/aws-sdk-polly/src/aws_sdk_polly/_private/schemas.py +++ b/clients/aws-sdk-polly/src/aws_sdk_polly/_private/schemas.py @@ -2,1569 +2,1920 @@ from types import MappingProxyType -from smithy_core.prelude import UNIT -from smithy_core.schemas import Schema -from smithy_core.shapes import ShapeID, ShapeType -from smithy_core.traits import Trait - - -ALPHABET = Schema( - id=ShapeID("com.amazonaws.polly#Alphabet"), shape_type=ShapeType.STRING -) - -AUDIO_CHUNK = Schema( - id=ShapeID("com.amazonaws.polly#AudioChunk"), shape_type=ShapeType.BLOB -) - -AUDIO_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.polly#AudioEvent"), - members={ - "AudioChunk": { - "target": AUDIO_CHUNK, - "traits": [Trait.new(id=ShapeID("smithy.api#eventPayload"))], - } - }, -) - -AUDIO_STREAM = Schema( - id=ShapeID("com.amazonaws.polly#AudioStream"), - shape_type=ShapeType.BLOB, - traits=[Trait.new(id=ShapeID("smithy.api#streaming"))], -) - -AVAILABILITY_ERROR_MESSAGE = Schema( - id=ShapeID("com.amazonaws.polly#AvailabilityErrorMessage"), - shape_type=ShapeType.STRING, -) - -CLOSE_STREAM_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.polly#CloseStreamEvent") -) - -CONTENT_TYPE = Schema( - id=ShapeID("com.amazonaws.polly#ContentType"), shape_type=ShapeType.STRING -) - -CORAL_AVAILABILITY_THROTTLED_RESOURCE = Schema( - id=ShapeID("com.amazonaws.polly#CoralAvailabilityThrottledResource"), - shape_type=ShapeType.STRING, -) - -CORAL_AVAILABILITY_THROTTLING_REASON = Schema( - id=ShapeID("com.amazonaws.polly#CoralAvailabilityThrottlingReason"), - shape_type=ShapeType.STRING, -) - -DATE_TIME = Schema( - id=ShapeID("com.amazonaws.polly#DateTime"), shape_type=ShapeType.TIMESTAMP -) - -LEXICON_NAME = Schema( - id=ShapeID("com.amazonaws.polly#LexiconName"), shape_type=ShapeType.STRING -) - -DELETE_LEXICON_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.polly#DeleteLexiconInput"), - members={ - "Name": { - "target": LEXICON_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -DELETE_LEXICON_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.polly#DeleteLexiconOutput") -) - -ERROR_MESSAGE = Schema( - id=ShapeID("com.amazonaws.polly#ErrorMessage"), shape_type=ShapeType.STRING -) - -LEXICON_NOT_FOUND_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.polly#LexiconNotFoundException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=404), - ], - members={"message": {"target": ERROR_MESSAGE}}, -) - -SERVICE_FAILURE_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.polly#ServiceFailureException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="server"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=500), - ], - members={"message": {"target": ERROR_MESSAGE}}, -) - -DELETE_LEXICON = Schema( - id=ShapeID("com.amazonaws.polly#DeleteLexicon"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "DELETE", "uri": "/v1/lexicons/{Name}", "code": 200} - ), +from smithy_core._schema_compact import StaticOperationSchema, StaticSchema + + +n0 = "com.amazonaws.polly" +_A = "Alphabet" +_AC = "AudioChunk" +_AE = "AudioEvent" +_sP = "smithy.api#eventPayload" +_AS = "AudioStream" +_s = "smithy.api#streaming" +_AEM = "AvailabilityErrorMessage" +_CSE = "CloseStreamEvent" +_CT = "ContentType" +_CATR = "CoralAvailabilityThrottledResource" +_CATRo = "CoralAvailabilityThrottlingReason" +_DT = "DateTime" +_LN = "LexiconName" +_DLI = "DeleteLexiconInput" +_sm = "smithy.api#input" +_N = "Name" +_smi = "smithy.api#required" +_sL = "smithy.api#httpLabel" +_DLO = "DeleteLexiconOutput" +_smit = "smithy.api#output" +_EM = "ErrorMessage" +_LNFE = "LexiconNotFoundException" +_smith = "smithy.api#error" +_c = "client" +_sE = "smithy.api#httpError" +_m = "message" +_SFE = "ServiceFailureException" +_se = "server" +_DL = "DeleteLexicon" +_smithy = "smithy.api#http" +_E = "Engine" +_STANDARD = "STANDARD" +_sV = "smithy.api#enumValue" +_st = "standard" +_NEURAL = "NEURAL" +_n = "neural" +_LF = "LONG_FORM" +_lf = "long-form" +_GENERATIVE = "GENERATIVE" +_g = "generative" +_IALC = "IncludeAdditionalLanguageCodes" +_smithya = "smithy.api#default" +_LC = "LanguageCode" +_a = "arb" +_cC = "cmn_CN" +_cC_ = "cmn-CN" +_cG = "cy_GB" +_cG_ = "cy-GB" +_dD = "da_DK" +_dD_ = "da-DK" +_dD__ = "de_DE" +_dD___ = "de-DE" +_eA = "en_AU" +_eA_ = "en-AU" +_eG = "en_GB" +_eG_ = "en-GB" +_eGW = "en_GB_WLS" +_eGW_ = "en-GB-WLS" +_eI = "en_IN" +_eI_ = "en-IN" +_eU = "en_US" +_eU_ = "en-US" +_eE = "es_ES" +_eE_ = "es-ES" +_eM = "es_MX" +_eM_ = "es-MX" +_eU__ = "es_US" +_eU___ = "es-US" +_fC = "fr_CA" +_fC_ = "fr-CA" +_fF = "fr_FR" +_fF_ = "fr-FR" +_iI = "is_IS" +_iI_ = "is-IS" +_iI__ = "it_IT" +_iI___ = "it-IT" +_jJ = "ja_JP" +_jJ_ = "ja-JP" +_hI = "hi_IN" +_hI_ = "hi-IN" +_kK = "ko_KR" +_kK_ = "ko-KR" +_nN = "nb_NO" +_nN_ = "nb-NO" +_nN__ = "nl_NL" +_nN___ = "nl-NL" +_pP = "pl_PL" +_pP_ = "pl-PL" +_pB = "pt_BR" +_pB_ = "pt-BR" +_pP__ = "pt_PT" +_pP___ = "pt-PT" +_rR = "ro_RO" +_rR_ = "ro-RO" +_rR__ = "ru_RU" +_rR___ = "ru-RU" +_sS = "sv_SE" +_sS_ = "sv-SE" +_tT = "tr_TR" +_tT_ = "tr-TR" +_eN = "en_NZ" +_eN_ = "en-NZ" +_eZ = "en_ZA" +_eZ_ = "en-ZA" +_cE = "ca_ES" +_cE_ = "ca-ES" +_dA = "de_AT" +_dA_ = "de-AT" +_yC = "yue_CN" +_yC_ = "yue-CN" +_aA = "ar_AE" +_aA_ = "ar-AE" +_fF__ = "fi_FI" +_fF___ = "fi-FI" +_eI__ = "en_IE" +_eI___ = "en-IE" +_nB = "nl_BE" +_nB_ = "nl-BE" +_fB = "fr_BE" +_fB_ = "fr-BE" +_cC__ = "cs_CZ" +_cC___ = "cs-CZ" +_dC = "de_CH" +_dC_ = "de-CH" +_eS = "en_SG" +_eS_ = "en-SG" +_NT = "NextToken" +_DVI = "DescribeVoicesInput" +_sQ = "smithy.api#httpQuery" +_LCL = "LanguageCodeList" +_me = "member" +_G = "Gender" +_F = "Female" +_M = "Male" +_VI = "VoiceId" +_Ad = "Aditi" +_Am = "Amy" +_As = "Astrid" +_B = "Bianca" +_Br = "Brian" +_C = "Camila" +_Ca = "Carla" +_Car = "Carmen" +_Ce = "Celine" +_Ch = "Chantal" +_Co = "Conchita" +_Cr = "Cristiano" +_D = "Dora" +_Em = "Emma" +_En = "Enrique" +_Ew = "Ewa" +_Fi = "Filiz" +_Ga = "Gabrielle" +_Ge = "Geraint" +_Gi = "Giorgio" +_Gw = "Gwyneth" +_H = "Hans" +_I = "Ines" +_Iv = "Ivy" +_J = "Jacek" +_Ja = "Jan" +_Jo = "Joanna" +_Joe = "Joey" +_Ju = "Justin" +_K = "Karl" +_Ke = "Kendra" +_Kev = "Kevin" +_Ki = "Kimberly" +_L = "Lea" +_Li = "Liv" +_Lo = "Lotte" +_Lu = "Lucia" +_Lup = "Lupe" +_Ma = "Mads" +_Maj = "Maja" +_Mar = "Marlene" +_Mat = "Mathieu" +_Matt = "Matthew" +_Max = "Maxim" +_Mi = "Mia" +_Mig = "Miguel" +_Miz = "Mizuki" +_Na = "Naja" +_Ni = "Nicole" +_O = "Olivia" +_P = "Penelope" +_R = "Raveena" +_Ri = "Ricardo" +_Ru = "Ruben" +_Rus = "Russell" +_S = "Salli" +_Se = "Seoyeon" +_T = "Takumi" +_Ta = "Tatyana" +_V = "Vicki" +_Vi = "Vitoria" +_Z = "Zeina" +_Zh = "Zhiyu" +_Ar = "Aria" +_Ay = "Ayanda" +_Arl = "Arlet" +_Ha = "Hannah" +_Art = "Arthur" +_Da = "Daniel" +_Lia = "Liam" +_Pe = "Pedro" +_Ka = "Kajal" +_Hi = "Hiujin" +_La = "Laura" +_El = "Elin" +_Id = "Ida" +_Su = "Suvi" +_Ol = "Ola" +_Hal = "Hala" +_An = "Andres" +_Ser = "Sergio" +_Re = "Remi" +_Adr = "Adriano" +_Th = "Thiago" +_Rut = "Ruth" +_St = "Stephen" +_Kaz = "Kazuha" +_To = "Tomoko" +_Nia = "Niamh" +_So = "Sofie" +_Lis = "Lisa" +_Is = "Isabelle" +_Za = "Zayd" +_Dan = "Danielle" +_Gr = "Gregory" +_Bu = "Burcu" +_Ji = "Jitka" +_Sa = "Sabrina" +_Jas = "Jasmine" +_Jih = "Jihye" +_Amb = "Ambre" +_Be = "Beatrice" +_Fl = "Florian" +_Le = "Lennart" +_Lor = "Lorenzo" +_Ti = "Tiffany" +_LNa = "LanguageName" +_VN = "VoiceName" +_EL = "EngineList" +_Vo = "Voice" +_Id_ = "Id" +_ALC = "AdditionalLanguageCodes" +_SE = "SupportedEngines" +_VL = "VoiceList" +_DVO = "DescribeVoicesOutput" +_Voi = "Voices" +_INTE = "InvalidNextTokenException" +_DV = "DescribeVoices" +_ENSE = "EngineNotSupportedException" +_Fo = "Force" +_FSC = "FlushStreamConfiguration" +_GLI = "GetLexiconInput" +_LCe = "LexiconContent" +_smithyap = "smithy.api#sensitive" +_Lex = "Lexicon" +_Con = "Content" +_LM = "LastModified" +_LCex = "LexemesCount" +_LA = "LexiconArn" +_Si = "Size" +_LAe = "LexiconAttributes" +_GLO = "GetLexiconOutput" +_GL = "GetLexicon" +_TI = "TaskId" +_GSSTI = "GetSpeechSynthesisTaskInput" +_LNL = "LexiconNameList" +_OF = "OutputFormat" +_JSON = "JSON" +_j = "json" +_MP = "MP3" +_mp = "mp3" +_OO = "OGG_OPUS" +_oo = "ogg_opus" +_OV = "OGG_VORBIS" +_ov = "ogg_vorbis" +_PCM = "PCM" +_p = "pcm" +_MULAW = "MULAW" +_mu = "mulaw" +_ALAW = "ALAW" +_al = "alaw" +_OU = "OutputUri" +_RC = "RequestCharacters" +_SR = "SampleRate" +_STA = "SnsTopicArn" +_SMT = "SpeechMarkType" +_SENTENCE = "SENTENCE" +_sen = "sentence" +_SSML = "SSML" +_ss = "ssml" +_VISEME = "VISEME" +_v = "viseme" +_WORD = "WORD" +_w = "word" +_SMTL = "SpeechMarkTypeList" +_TS = "TaskStatus" +_SCHEDULED = "SCHEDULED" +_sc = "scheduled" +_IP = "IN_PROGRESS" +_iP = "inProgress" +_COMPLETED = "COMPLETED" +_co = "completed" +_FAILED = "FAILED" +_f = "failed" +_TSR = "TaskStatusReason" +_TT = "TextType" +_TEXT = "TEXT" +_t = "text" +_ST = "SynthesisTask" +_CTr = "CreationTime" +_LNe = "LexiconNames" +_SMTp = "SpeechMarkTypes" +_GSSTO = "GetSpeechSynthesisTaskOutput" +_ITIE = "InvalidTaskIdException" +_STNFE = "SynthesisTaskNotFoundException" +_GSST = "GetSpeechSynthesisTask" +_ILE = "InvalidLexiconException" +_ISBE = "InvalidS3BucketException" +_ISKE = "InvalidS3KeyException" +_ISRE = "InvalidSampleRateException" +_ISTAE = "InvalidSnsTopicArnException" +_ISE = "InvalidSsmlException" +_LNSE = "LanguageNotSupportedException" +_LD = "LexiconDescription" +_At = "Attributes" +_LDL = "LexiconDescriptionList" +_LSEE = "LexiconSizeExceededException" +_LLI = "ListLexiconsInput" +_LLO = "ListLexiconsOutput" +_Lexi = "Lexicons" +_LL = "ListLexicons" +_MR = "MaxResults" +_LSSTI = "ListSpeechSynthesisTasksInput" +_Sta = "Status" +_STy = "SynthesisTasks" +_LSSTO = "ListSpeechSynthesisTasksOutput" +_LSST = "ListSpeechSynthesisTasks" +_MNSFFE = "MarksNotSupportedForFormatException" +_MLLEE = "MaxLexemeLengthExceededException" +_MLNEE = "MaxLexiconsNumberExceededException" +_OSBN = "OutputS3BucketName" +_OSKP = "OutputS3KeyPrefix" +_PLI = "PutLexiconInput" +_PLO = "PutLexiconOutput" +_UPAE = "UnsupportedPlsAlphabetException" +_UPLE = "UnsupportedPlsLanguageException" +_PL = "PutLexicon" +_QC = "QuotaCode" +_ISIET = "INPUT_STREAM_INBOUND_EVENT_TIMEOUT" +_isiet = "input-stream-inbound-event-timeout" +_IST = "INPUT_STREAM_TIMEOUT" +_ist = "input-stream-timeout" +_SC = "ServiceCode" +_POLLY = "POLLY" +_po = "polly" +_SQEE = "ServiceQuotaExceededException" +_qC = "quotaCode" +_sC = "serviceCode" +_Te = "Text" +_TE = "TextEvent" +_SSSSAS = "StartSpeechSynthesisStreamActionStream" +_SSSSI = "StartSpeechSynthesisStreamInput" +_sH = "smithy.api#httpHeader" +_xaE = "x-amzn-Engine" +_xaL = "x-amzn-LanguageCode" +_xaL_ = "x-amzn-LexiconNames" +_xaO = "x-amzn-OutputFormat" +_xaS = "x-amzn-SampleRate" +_xaV = "x-amzn-VoiceId" +_ASc = "ActionStream" +_sPm = "smithy.api#httpPayload" +_SCE = "StreamClosedEvent" +_TR = "ThrottlingReason" +_r = "reason" +_re = "resource" +_TRL = "ThrottlingReasonList" +_TEh = "ThrottlingException" +_tR = "throttlingReasons" +_VEFM = "ValidationExceptionFieldMessage" +_VEFN = "ValidationExceptionFieldName" +_VEF = "ValidationExceptionField" +_na = "name" +_VEFL = "ValidationExceptionFieldList" +_VER = "ValidationExceptionReason" +_UO = "UNSUPPORTED_OPERATION" +_uO = "unsupportedOperation" +_FVF = "FIELD_VALIDATION_FAILED" +_fVF = "fieldValidationFailed" +_OTHER = "OTHER" +_o = "other" +_IIE = "INVALID_INBOUND_EVENT" +_iIE = "invalidInboundEvent" +_VE = "ValidationException" +_fi = "fields" +_SSSSES = "StartSpeechSynthesisStreamEventStream" +_SSSSO = "StartSpeechSynthesisStreamOutput" +_ES = "EventStream" +_SSSS = "StartSpeechSynthesisStream" +_SMNSFTTE = "SsmlMarksNotSupportedForTextTypeException" +_SSSTI = "StartSpeechSynthesisTaskInput" +_SSSTO = "StartSpeechSynthesisTaskOutput" +_TLEE = "TextLengthExceededException" +_SSST = "StartSpeechSynthesisTask" +_SSI = "SynthesizeSpeechInput" +_SSO = "SynthesizeSpeechOutput" +_v_ = "" +_CT_ = "Content-Type" +_xaR = "x-amzn-RequestCharacters" +_SS = "SynthesizeSpeech" +_Pv = "Parrot_v1" +_aw = "aws.auth#sigv4" +_sB = "smithy.rules#endpointBdd" +_aws = "aws.api#service" +_sN = "smithy.api#xmlNamespace" +_aJ = "aws.protocols#restJson1" + +ALPHABET: StaticSchema = (3, n0, _A, 0) + +AUDIO_CHUNK: StaticSchema = (1, n0, _AC, 0) + +AUDIO_EVENT: StaticSchema = (18, n0, _AE, 0, (_AC,), ((AUDIO_CHUNK, {_sP: None}),)) + +AUDIO_STREAM: StaticSchema = (1, n0, _AS, {_s: None}) + +AVAILABILITY_ERROR_MESSAGE: StaticSchema = (3, n0, _AEM, 0) + +CLOSE_STREAM_EVENT: StaticSchema = (18, n0, _CSE, 0) + +CONTENT_TYPE: StaticSchema = (3, n0, _CT, 0) + +CORAL_AVAILABILITY_THROTTLED_RESOURCE: StaticSchema = (3, n0, _CATR, 0) + +CORAL_AVAILABILITY_THROTTLING_REASON: StaticSchema = (3, n0, _CATRo, 0) + +DATE_TIME: StaticSchema = (4, n0, _DT, 0) + +LEXICON_NAME: StaticSchema = (3, n0, _LN, 0) + +DELETE_LEXICON_INPUT: StaticSchema = ( + 18, + n0, + _DLI, + {_sm: None}, + (_N,), + ((LEXICON_NAME, 9),), +) + +DELETE_LEXICON_OUTPUT: StaticSchema = (18, n0, _DLO, {_smit: None}) + +ERROR_MESSAGE: StaticSchema = (3, n0, _EM, 0) + +LEXICON_NOT_FOUND_EXCEPTION: StaticSchema = ( + 18, + n0, + _LNFE, + {_smith: _c, _sE: 404}, + (_m,), + ((ERROR_MESSAGE, 0),), +) + +SERVICE_FAILURE_EXCEPTION: StaticSchema = ( + 18, + n0, + _SFE, + {_smith: _se, _sE: 500}, + (_m,), + ((ERROR_MESSAGE, 0),), +) + +DELETE_LEXICON: StaticOperationSchema = ( + 23, + n0, + _DL, + { + _smithy: MappingProxyType( + {"method": "DELETE", "uri": "/v1/lexicons/{Name}", "code": 200} ) - ], -) - -ENGINE = Schema.collection( - id=ShapeID("com.amazonaws.polly#Engine"), - shape_type=ShapeType.ENUM, - members={ - "STANDARD": {"target": UNIT}, - "NEURAL": {"target": UNIT}, - "LONG_FORM": {"target": UNIT}, - "GENERATIVE": {"target": UNIT}, - }, -) - -INCLUDE_ADDITIONAL_LANGUAGE_CODES = Schema( - id=ShapeID("com.amazonaws.polly#IncludeAdditionalLanguageCodes"), - shape_type=ShapeType.BOOLEAN, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=False)], -) - -LANGUAGE_CODE = Schema.collection( - id=ShapeID("com.amazonaws.polly#LanguageCode"), - shape_type=ShapeType.ENUM, - members={ - "arb": {"target": UNIT}, - "cmn_CN": {"target": UNIT}, - "cy_GB": {"target": UNIT}, - "da_DK": {"target": UNIT}, - "de_DE": {"target": UNIT}, - "en_AU": {"target": UNIT}, - "en_GB": {"target": UNIT}, - "en_GB_WLS": {"target": UNIT}, - "en_IN": {"target": UNIT}, - "en_US": {"target": UNIT}, - "es_ES": {"target": UNIT}, - "es_MX": {"target": UNIT}, - "es_US": {"target": UNIT}, - "fr_CA": {"target": UNIT}, - "fr_FR": {"target": UNIT}, - "is_IS": {"target": UNIT}, - "it_IT": {"target": UNIT}, - "ja_JP": {"target": UNIT}, - "hi_IN": {"target": UNIT}, - "ko_KR": {"target": UNIT}, - "nb_NO": {"target": UNIT}, - "nl_NL": {"target": UNIT}, - "pl_PL": {"target": UNIT}, - "pt_BR": {"target": UNIT}, - "pt_PT": {"target": UNIT}, - "ro_RO": {"target": UNIT}, - "ru_RU": {"target": UNIT}, - "sv_SE": {"target": UNIT}, - "tr_TR": {"target": UNIT}, - "en_NZ": {"target": UNIT}, - "en_ZA": {"target": UNIT}, - "ca_ES": {"target": UNIT}, - "de_AT": {"target": UNIT}, - "yue_CN": {"target": UNIT}, - "ar_AE": {"target": UNIT}, - "fi_FI": {"target": UNIT}, - "en_IE": {"target": UNIT}, - "nl_BE": {"target": UNIT}, - "fr_BE": {"target": UNIT}, - "cs_CZ": {"target": UNIT}, - "de_CH": {"target": UNIT}, - "en_SG": {"target": UNIT}, - }, -) - -NEXT_TOKEN = Schema( - id=ShapeID("com.amazonaws.polly#NextToken"), shape_type=ShapeType.STRING -) - -DESCRIBE_VOICES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.polly#DescribeVoicesInput"), - members={ - "Engine": { - "target": ENGINE, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="Engine")], - }, - "LanguageCode": { - "target": LANGUAGE_CODE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="LanguageCode") - ], - }, - "IncludeAdditionalLanguageCodes": { - "target": INCLUDE_ADDITIONAL_LANGUAGE_CODES, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=False), - Trait.new( - id=ShapeID("smithy.api#httpQuery"), - value="IncludeAdditionalLanguageCodes", - ), - ], - }, - "NextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="NextToken") - ], - }, - }, -) - -LANGUAGE_CODE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.polly#LanguageCodeList"), - shape_type=ShapeType.LIST, - members={"member": {"target": LANGUAGE_CODE}}, -) - -GENDER = Schema.collection( - id=ShapeID("com.amazonaws.polly#Gender"), - shape_type=ShapeType.ENUM, - members={"Female": {"target": UNIT}, "Male": {"target": UNIT}}, -) - -VOICE_ID = Schema.collection( - id=ShapeID("com.amazonaws.polly#VoiceId"), - shape_type=ShapeType.ENUM, - members={ - "Aditi": {"target": UNIT}, - "Amy": {"target": UNIT}, - "Astrid": {"target": UNIT}, - "Bianca": {"target": UNIT}, - "Brian": {"target": UNIT}, - "Camila": {"target": UNIT}, - "Carla": {"target": UNIT}, - "Carmen": {"target": UNIT}, - "Celine": {"target": UNIT}, - "Chantal": {"target": UNIT}, - "Conchita": {"target": UNIT}, - "Cristiano": {"target": UNIT}, - "Dora": {"target": UNIT}, - "Emma": {"target": UNIT}, - "Enrique": {"target": UNIT}, - "Ewa": {"target": UNIT}, - "Filiz": {"target": UNIT}, - "Gabrielle": {"target": UNIT}, - "Geraint": {"target": UNIT}, - "Giorgio": {"target": UNIT}, - "Gwyneth": {"target": UNIT}, - "Hans": {"target": UNIT}, - "Ines": {"target": UNIT}, - "Ivy": {"target": UNIT}, - "Jacek": {"target": UNIT}, - "Jan": {"target": UNIT}, - "Joanna": {"target": UNIT}, - "Joey": {"target": UNIT}, - "Justin": {"target": UNIT}, - "Karl": {"target": UNIT}, - "Kendra": {"target": UNIT}, - "Kevin": {"target": UNIT}, - "Kimberly": {"target": UNIT}, - "Lea": {"target": UNIT}, - "Liv": {"target": UNIT}, - "Lotte": {"target": UNIT}, - "Lucia": {"target": UNIT}, - "Lupe": {"target": UNIT}, - "Mads": {"target": UNIT}, - "Maja": {"target": UNIT}, - "Marlene": {"target": UNIT}, - "Mathieu": {"target": UNIT}, - "Matthew": {"target": UNIT}, - "Maxim": {"target": UNIT}, - "Mia": {"target": UNIT}, - "Miguel": {"target": UNIT}, - "Mizuki": {"target": UNIT}, - "Naja": {"target": UNIT}, - "Nicole": {"target": UNIT}, - "Olivia": {"target": UNIT}, - "Penelope": {"target": UNIT}, - "Raveena": {"target": UNIT}, - "Ricardo": {"target": UNIT}, - "Ruben": {"target": UNIT}, - "Russell": {"target": UNIT}, - "Salli": {"target": UNIT}, - "Seoyeon": {"target": UNIT}, - "Takumi": {"target": UNIT}, - "Tatyana": {"target": UNIT}, - "Vicki": {"target": UNIT}, - "Vitoria": {"target": UNIT}, - "Zeina": {"target": UNIT}, - "Zhiyu": {"target": UNIT}, - "Aria": {"target": UNIT}, - "Ayanda": {"target": UNIT}, - "Arlet": {"target": UNIT}, - "Hannah": {"target": UNIT}, - "Arthur": {"target": UNIT}, - "Daniel": {"target": UNIT}, - "Liam": {"target": UNIT}, - "Pedro": {"target": UNIT}, - "Kajal": {"target": UNIT}, - "Hiujin": {"target": UNIT}, - "Laura": {"target": UNIT}, - "Elin": {"target": UNIT}, - "Ida": {"target": UNIT}, - "Suvi": {"target": UNIT}, - "Ola": {"target": UNIT}, - "Hala": {"target": UNIT}, - "Andres": {"target": UNIT}, - "Sergio": {"target": UNIT}, - "Remi": {"target": UNIT}, - "Adriano": {"target": UNIT}, - "Thiago": {"target": UNIT}, - "Ruth": {"target": UNIT}, - "Stephen": {"target": UNIT}, - "Kazuha": {"target": UNIT}, - "Tomoko": {"target": UNIT}, - "Niamh": {"target": UNIT}, - "Sofie": {"target": UNIT}, - "Lisa": {"target": UNIT}, - "Isabelle": {"target": UNIT}, - "Zayd": {"target": UNIT}, - "Danielle": {"target": UNIT}, - "Gregory": {"target": UNIT}, - "Burcu": {"target": UNIT}, - "Jitka": {"target": UNIT}, - "Sabrina": {"target": UNIT}, - "Jasmine": {"target": UNIT}, - "Jihye": {"target": UNIT}, - "Ambre": {"target": UNIT}, - "Beatrice": {"target": UNIT}, - "Florian": {"target": UNIT}, - "Lennart": {"target": UNIT}, - "Lorenzo": {"target": UNIT}, - "Tiffany": {"target": UNIT}, - }, -) - -LANGUAGE_NAME = Schema( - id=ShapeID("com.amazonaws.polly#LanguageName"), shape_type=ShapeType.STRING -) - -VOICE_NAME = Schema( - id=ShapeID("com.amazonaws.polly#VoiceName"), shape_type=ShapeType.STRING -) - -ENGINE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.polly#EngineList"), - shape_type=ShapeType.LIST, - members={"member": {"target": ENGINE}}, -) - -VOICE = Schema.collection( - id=ShapeID("com.amazonaws.polly#Voice"), - members={ - "Gender": {"target": GENDER}, - "Id": {"target": VOICE_ID}, - "LanguageCode": {"target": LANGUAGE_CODE}, - "LanguageName": {"target": LANGUAGE_NAME}, - "Name": {"target": VOICE_NAME}, - "AdditionalLanguageCodes": {"target": LANGUAGE_CODE_LIST}, - "SupportedEngines": {"target": ENGINE_LIST}, }, -) - -VOICE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.polly#VoiceList"), - shape_type=ShapeType.LIST, - members={"member": {"target": VOICE}}, -) - -DESCRIBE_VOICES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.polly#DescribeVoicesOutput"), - members={"Voices": {"target": VOICE_LIST}, "NextToken": {"target": NEXT_TOKEN}}, -) - -INVALID_NEXT_TOKEN_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.polly#InvalidNextTokenException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"message": {"target": ERROR_MESSAGE}}, -) - -DESCRIBE_VOICES = Schema( - id=ShapeID("com.amazonaws.polly#DescribeVoices"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType({"method": "GET", "uri": "/v1/voices", "code": 200}), + DELETE_LEXICON_INPUT, + DELETE_LEXICON_OUTPUT, + (LEXICON_NOT_FOUND_EXCEPTION, SERVICE_FAILURE_EXCEPTION), +) + +ENGINE: StaticSchema = ( + 14, + n0, + _E, + 0, + (_STANDARD, _NEURAL, _LF, _GENERATIVE), + ((-1, {_sV: _st}), (-1, {_sV: _n}), (-1, {_sV: _lf}), (-1, {_sV: _g})), +) + +INCLUDE_ADDITIONAL_LANGUAGE_CODES: StaticSchema = (2, n0, _IALC, {_smithya: False}) + +LANGUAGE_CODE: StaticSchema = ( + 14, + n0, + _LC, + 0, + ( + _a, + _cC, + _cG, + _dD, + _dD__, + _eA, + _eG, + _eGW, + _eI, + _eU, + _eE, + _eM, + _eU__, + _fC, + _fF, + _iI, + _iI__, + _jJ, + _hI, + _kK, + _nN, + _nN__, + _pP, + _pB, + _pP__, + _rR, + _rR__, + _sS, + _tT, + _eN, + _eZ, + _cE, + _dA, + _yC, + _aA, + _fF__, + _eI__, + _nB, + _fB, + _cC__, + _dC, + _eS, + ), + ( + (-1, {_sV: _a}), + (-1, {_sV: _cC_}), + (-1, {_sV: _cG_}), + (-1, {_sV: _dD_}), + (-1, {_sV: _dD___}), + (-1, {_sV: _eA_}), + (-1, {_sV: _eG_}), + (-1, {_sV: _eGW_}), + (-1, {_sV: _eI_}), + (-1, {_sV: _eU_}), + (-1, {_sV: _eE_}), + (-1, {_sV: _eM_}), + (-1, {_sV: _eU___}), + (-1, {_sV: _fC_}), + (-1, {_sV: _fF_}), + (-1, {_sV: _iI_}), + (-1, {_sV: _iI___}), + (-1, {_sV: _jJ_}), + (-1, {_sV: _hI_}), + (-1, {_sV: _kK_}), + (-1, {_sV: _nN_}), + (-1, {_sV: _nN___}), + (-1, {_sV: _pP_}), + (-1, {_sV: _pB_}), + (-1, {_sV: _pP___}), + (-1, {_sV: _rR_}), + (-1, {_sV: _rR___}), + (-1, {_sV: _sS_}), + (-1, {_sV: _tT_}), + (-1, {_sV: _eN_}), + (-1, {_sV: _eZ_}), + (-1, {_sV: _cE_}), + (-1, {_sV: _dA_}), + (-1, {_sV: _yC_}), + (-1, {_sV: _aA_}), + (-1, {_sV: _fF___}), + (-1, {_sV: _eI___}), + (-1, {_sV: _nB_}), + (-1, {_sV: _fB_}), + (-1, {_sV: _cC___}), + (-1, {_sV: _dC_}), + (-1, {_sV: _eS_}), + ), +) + +NEXT_TOKEN: StaticSchema = (3, n0, _NT, 0) + +DESCRIBE_VOICES_INPUT: StaticSchema = ( + 18, + n0, + _DVI, + {_sm: None}, + (_E, _LC, _IALC, _NT), + ( + (ENGINE, {_sQ: _E}), + (LANGUAGE_CODE, {_sQ: _LC}), + (INCLUDE_ADDITIONAL_LANGUAGE_CODES, {_smithya: False, _sQ: _IALC}), + (NEXT_TOKEN, {_sQ: _NT}), + ), +) + +LANGUAGE_CODE_LIST: StaticSchema = (16, n0, _LCL, 0, (_me,), ((LANGUAGE_CODE, 0),)) + +GENDER: StaticSchema = (14, n0, _G, 0, (_F, _M), ((-1, {_sV: _F}), (-1, {_sV: _M}))) + +VOICE_ID: StaticSchema = ( + 14, + n0, + _VI, + 0, + ( + _Ad, + _Am, + _As, + _B, + _Br, + _C, + _Ca, + _Car, + _Ce, + _Ch, + _Co, + _Cr, + _D, + _Em, + _En, + _Ew, + _Fi, + _Ga, + _Ge, + _Gi, + _Gw, + _H, + _I, + _Iv, + _J, + _Ja, + _Jo, + _Joe, + _Ju, + _K, + _Ke, + _Kev, + _Ki, + _L, + _Li, + _Lo, + _Lu, + _Lup, + _Ma, + _Maj, + _Mar, + _Mat, + _Matt, + _Max, + _Mi, + _Mig, + _Miz, + _Na, + _Ni, + _O, + _P, + _R, + _Ri, + _Ru, + _Rus, + _S, + _Se, + _T, + _Ta, + _V, + _Vi, + _Z, + _Zh, + _Ar, + _Ay, + _Arl, + _Ha, + _Art, + _Da, + _Lia, + _Pe, + _Ka, + _Hi, + _La, + _El, + _Id, + _Su, + _Ol, + _Hal, + _An, + _Ser, + _Re, + _Adr, + _Th, + _Rut, + _St, + _Kaz, + _To, + _Nia, + _So, + _Lis, + _Is, + _Za, + _Dan, + _Gr, + _Bu, + _Ji, + _Sa, + _Jas, + _Jih, + _Amb, + _Be, + _Fl, + _Le, + _Lor, + _Ti, + ), + ( + (-1, {_sV: _Ad}), + (-1, {_sV: _Am}), + (-1, {_sV: _As}), + (-1, {_sV: _B}), + (-1, {_sV: _Br}), + (-1, {_sV: _C}), + (-1, {_sV: _Ca}), + (-1, {_sV: _Car}), + (-1, {_sV: _Ce}), + (-1, {_sV: _Ch}), + (-1, {_sV: _Co}), + (-1, {_sV: _Cr}), + (-1, {_sV: _D}), + (-1, {_sV: _Em}), + (-1, {_sV: _En}), + (-1, {_sV: _Ew}), + (-1, {_sV: _Fi}), + (-1, {_sV: _Ga}), + (-1, {_sV: _Ge}), + (-1, {_sV: _Gi}), + (-1, {_sV: _Gw}), + (-1, {_sV: _H}), + (-1, {_sV: _I}), + (-1, {_sV: _Iv}), + (-1, {_sV: _J}), + (-1, {_sV: _Ja}), + (-1, {_sV: _Jo}), + (-1, {_sV: _Joe}), + (-1, {_sV: _Ju}), + (-1, {_sV: _K}), + (-1, {_sV: _Ke}), + (-1, {_sV: _Kev}), + (-1, {_sV: _Ki}), + (-1, {_sV: _L}), + (-1, {_sV: _Li}), + (-1, {_sV: _Lo}), + (-1, {_sV: _Lu}), + (-1, {_sV: _Lup}), + (-1, {_sV: _Ma}), + (-1, {_sV: _Maj}), + (-1, {_sV: _Mar}), + (-1, {_sV: _Mat}), + (-1, {_sV: _Matt}), + (-1, {_sV: _Max}), + (-1, {_sV: _Mi}), + (-1, {_sV: _Mig}), + (-1, {_sV: _Miz}), + (-1, {_sV: _Na}), + (-1, {_sV: _Ni}), + (-1, {_sV: _O}), + (-1, {_sV: _P}), + (-1, {_sV: _R}), + (-1, {_sV: _Ri}), + (-1, {_sV: _Ru}), + (-1, {_sV: _Rus}), + (-1, {_sV: _S}), + (-1, {_sV: _Se}), + (-1, {_sV: _T}), + (-1, {_sV: _Ta}), + (-1, {_sV: _V}), + (-1, {_sV: _Vi}), + (-1, {_sV: _Z}), + (-1, {_sV: _Zh}), + (-1, {_sV: _Ar}), + (-1, {_sV: _Ay}), + (-1, {_sV: _Arl}), + (-1, {_sV: _Ha}), + (-1, {_sV: _Art}), + (-1, {_sV: _Da}), + (-1, {_sV: _Lia}), + (-1, {_sV: _Pe}), + (-1, {_sV: _Ka}), + (-1, {_sV: _Hi}), + (-1, {_sV: _La}), + (-1, {_sV: _El}), + (-1, {_sV: _Id}), + (-1, {_sV: _Su}), + (-1, {_sV: _Ol}), + (-1, {_sV: _Hal}), + (-1, {_sV: _An}), + (-1, {_sV: _Ser}), + (-1, {_sV: _Re}), + (-1, {_sV: _Adr}), + (-1, {_sV: _Th}), + (-1, {_sV: _Rut}), + (-1, {_sV: _St}), + (-1, {_sV: _Kaz}), + (-1, {_sV: _To}), + (-1, {_sV: _Nia}), + (-1, {_sV: _So}), + (-1, {_sV: _Lis}), + (-1, {_sV: _Is}), + (-1, {_sV: _Za}), + (-1, {_sV: _Dan}), + (-1, {_sV: _Gr}), + (-1, {_sV: _Bu}), + (-1, {_sV: _Ji}), + (-1, {_sV: _Sa}), + (-1, {_sV: _Jas}), + (-1, {_sV: _Jih}), + (-1, {_sV: _Amb}), + (-1, {_sV: _Be}), + (-1, {_sV: _Fl}), + (-1, {_sV: _Le}), + (-1, {_sV: _Lor}), + (-1, {_sV: _Ti}), + ), +) + +LANGUAGE_NAME: StaticSchema = (3, n0, _LNa, 0) + +VOICE_NAME: StaticSchema = (3, n0, _VN, 0) + +ENGINE_LIST: StaticSchema = (16, n0, _EL, 0, (_me,), ((ENGINE, 0),)) + +VOICE: StaticSchema = ( + 18, + n0, + _Vo, + 0, + (_G, _Id_, _LC, _LNa, _N, _ALC, _SE), + ( + (GENDER, 0), + (VOICE_ID, 0), + (LANGUAGE_CODE, 0), + (LANGUAGE_NAME, 0), + (VOICE_NAME, 0), + (LANGUAGE_CODE_LIST, 0), + (ENGINE_LIST, 0), + ), +) + +VOICE_LIST: StaticSchema = (16, n0, _VL, 0, (_me,), ((VOICE, 0),)) + +DESCRIBE_VOICES_OUTPUT: StaticSchema = ( + 18, + n0, + _DVO, + {_smit: None}, + (_Voi, _NT), + ((VOICE_LIST, 0), (NEXT_TOKEN, 0)), +) + +INVALID_NEXT_TOKEN_EXCEPTION: StaticSchema = ( + 18, + n0, + _INTE, + {_smith: _c, _sE: 400}, + (_m,), + ((ERROR_MESSAGE, 0),), +) + +DESCRIBE_VOICES: StaticOperationSchema = ( + 23, + n0, + _DV, + {_smithy: MappingProxyType({"method": "GET", "uri": "/v1/voices", "code": 200})}, + DESCRIBE_VOICES_INPUT, + DESCRIBE_VOICES_OUTPUT, + (INVALID_NEXT_TOKEN_EXCEPTION, SERVICE_FAILURE_EXCEPTION), +) + +ENGINE_NOT_SUPPORTED_EXCEPTION: StaticSchema = ( + 18, + n0, + _ENSE, + {_smith: _c, _sE: 400}, + (_m,), + ((ERROR_MESSAGE, 0),), +) + +FORCE: StaticSchema = (2, n0, _Fo, {_smithya: False}) + +FLUSH_STREAM_CONFIGURATION: StaticSchema = ( + 18, + n0, + _FSC, + 0, + (_Fo,), + ((FORCE, {_smithya: False}),), +) + +GET_LEXICON_INPUT: StaticSchema = ( + 18, + n0, + _GLI, + {_sm: None}, + (_N,), + ((LEXICON_NAME, 9),), +) + +LEXICON_CONTENT: StaticSchema = (3, n0, _LCe, 4) + +LEXICON: StaticSchema = ( + 18, + n0, + _Lex, + 0, + (_Con, _N), + ((LEXICON_CONTENT, 0), (LEXICON_NAME, 0)), +) + +LAST_MODIFIED: StaticSchema = (4, n0, _LM, 0) + +LEXEMES_COUNT: StaticSchema = (7, n0, _LCex, {_smithya: 0}) + +LEXICON_ARN: StaticSchema = (3, n0, _LA, 0) + +SIZE: StaticSchema = (7, n0, _Si, {_smithya: 0}) + +LEXICON_ATTRIBUTES: StaticSchema = ( + 18, + n0, + _LAe, + 0, + (_A, _LC, _LM, _LA, _LCex, _Si), + ( + (ALPHABET, 0), + (LANGUAGE_CODE, 0), + (LAST_MODIFIED, 0), + (LEXICON_ARN, 0), + (LEXEMES_COUNT, {_smithya: 0}), + (SIZE, {_smithya: 0}), + ), +) + +GET_LEXICON_OUTPUT: StaticSchema = ( + 18, + n0, + _GLO, + {_smit: None}, + (_Lex, _LAe), + ((LEXICON, 0), (LEXICON_ATTRIBUTES, 0)), +) + +GET_LEXICON: StaticOperationSchema = ( + 23, + n0, + _GL, + { + _smithy: MappingProxyType( + {"method": "GET", "uri": "/v1/lexicons/{Name}", "code": 200} ) - ], -) - -ENGINE_NOT_SUPPORTED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.polly#EngineNotSupportedException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"message": {"target": ERROR_MESSAGE}}, -) - -FORCE = Schema( - id=ShapeID("com.amazonaws.polly#Force"), - shape_type=ShapeType.BOOLEAN, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=False)], -) - -FLUSH_STREAM_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.polly#FlushStreamConfiguration"), - members={ - "Force": { - "target": FORCE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - } }, -) - -GET_LEXICON_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.polly#GetLexiconInput"), - members={ - "Name": { - "target": LEXICON_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -LEXICON_CONTENT = Schema( - id=ShapeID("com.amazonaws.polly#LexiconContent"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -LEXICON = Schema.collection( - id=ShapeID("com.amazonaws.polly#Lexicon"), - members={"Content": {"target": LEXICON_CONTENT}, "Name": {"target": LEXICON_NAME}}, -) - -LAST_MODIFIED = Schema( - id=ShapeID("com.amazonaws.polly#LastModified"), shape_type=ShapeType.TIMESTAMP -) - -LEXEMES_COUNT = Schema( - id=ShapeID("com.amazonaws.polly#LexemesCount"), - shape_type=ShapeType.INTEGER, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=0)], -) - -LEXICON_ARN = Schema( - id=ShapeID("com.amazonaws.polly#LexiconArn"), shape_type=ShapeType.STRING -) - -SIZE = Schema( - id=ShapeID("com.amazonaws.polly#Size"), - shape_type=ShapeType.INTEGER, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=0)], -) - -LEXICON_ATTRIBUTES = Schema.collection( - id=ShapeID("com.amazonaws.polly#LexiconAttributes"), - members={ - "Alphabet": {"target": ALPHABET}, - "LanguageCode": {"target": LANGUAGE_CODE}, - "LastModified": {"target": LAST_MODIFIED}, - "LexiconArn": {"target": LEXICON_ARN}, - "LexemesCount": { - "target": LEXEMES_COUNT, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "Size": { - "target": SIZE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - }, -) - -GET_LEXICON_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.polly#GetLexiconOutput"), - members={ - "Lexicon": {"target": LEXICON}, - "LexiconAttributes": {"target": LEXICON_ATTRIBUTES}, - }, -) - -GET_LEXICON = Schema( - id=ShapeID("com.amazonaws.polly#GetLexicon"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/v1/lexicons/{Name}", "code": 200} - ), + GET_LEXICON_INPUT, + GET_LEXICON_OUTPUT, + (LEXICON_NOT_FOUND_EXCEPTION, SERVICE_FAILURE_EXCEPTION), +) + +TASK_ID: StaticSchema = (3, n0, _TI, 0) + +GET_SPEECH_SYNTHESIS_TASK_INPUT: StaticSchema = ( + 18, + n0, + _GSSTI, + {_sm: None}, + (_TI,), + ((TASK_ID, 9),), +) + +LEXICON_NAME_LIST: StaticSchema = (16, n0, _LNL, 0, (_me,), ((LEXICON_NAME, 0),)) + +OUTPUT_FORMAT: StaticSchema = ( + 14, + n0, + _OF, + 0, + (_JSON, _MP, _OO, _OV, _PCM, _MULAW, _ALAW), + ( + (-1, {_sV: _j}), + (-1, {_sV: _mp}), + (-1, {_sV: _oo}), + (-1, {_sV: _ov}), + (-1, {_sV: _p}), + (-1, {_sV: _mu}), + (-1, {_sV: _al}), + ), +) + +OUTPUT_URI: StaticSchema = (3, n0, _OU, 0) + +REQUEST_CHARACTERS: StaticSchema = (7, n0, _RC, {_smithya: 0}) + +SAMPLE_RATE: StaticSchema = (3, n0, _SR, 0) + +SNS_TOPIC_ARN: StaticSchema = (3, n0, _STA, 0) + +SPEECH_MARK_TYPE: StaticSchema = ( + 14, + n0, + _SMT, + 0, + (_SENTENCE, _SSML, _VISEME, _WORD), + ((-1, {_sV: _sen}), (-1, {_sV: _ss}), (-1, {_sV: _v}), (-1, {_sV: _w})), +) + +SPEECH_MARK_TYPE_LIST: StaticSchema = ( + 16, + n0, + _SMTL, + 0, + (_me,), + ((SPEECH_MARK_TYPE, 0),), +) + +TASK_STATUS: StaticSchema = ( + 14, + n0, + _TS, + 0, + (_SCHEDULED, _IP, _COMPLETED, _FAILED), + ((-1, {_sV: _sc}), (-1, {_sV: _iP}), (-1, {_sV: _co}), (-1, {_sV: _f})), +) + +TASK_STATUS_REASON: StaticSchema = (3, n0, _TSR, 0) + +TEXT_TYPE: StaticSchema = ( + 14, + n0, + _TT, + 0, + (_SSML, _TEXT), + ((-1, {_sV: _ss}), (-1, {_sV: _t})), +) + +SYNTHESIS_TASK: StaticSchema = ( + 18, + n0, + _ST, + 0, + (_E, _TI, _TS, _TSR, _OU, _CTr, _RC, _STA, _LNe, _OF, _SR, _SMTp, _TT, _VI, _LC), + ( + (ENGINE, 0), + (TASK_ID, 0), + (TASK_STATUS, 0), + (TASK_STATUS_REASON, 0), + (OUTPUT_URI, 0), + (DATE_TIME, 0), + (REQUEST_CHARACTERS, {_smithya: 0}), + (SNS_TOPIC_ARN, 0), + (LEXICON_NAME_LIST, 0), + (OUTPUT_FORMAT, 0), + (SAMPLE_RATE, 0), + (SPEECH_MARK_TYPE_LIST, 0), + (TEXT_TYPE, 0), + (VOICE_ID, 0), + (LANGUAGE_CODE, 0), + ), +) + +GET_SPEECH_SYNTHESIS_TASK_OUTPUT: StaticSchema = ( + 18, + n0, + _GSSTO, + {_smit: None}, + (_ST,), + ((SYNTHESIS_TASK, 0),), +) + +INVALID_TASK_ID_EXCEPTION: StaticSchema = ( + 18, + n0, + _ITIE, + {_smith: _c, _sE: 400}, + (_m,), + ((ERROR_MESSAGE, 0),), +) + +SYNTHESIS_TASK_NOT_FOUND_EXCEPTION: StaticSchema = ( + 18, + n0, + _STNFE, + {_smith: _c, _sE: 400}, + (_m,), + ((ERROR_MESSAGE, 0),), +) + +GET_SPEECH_SYNTHESIS_TASK: StaticOperationSchema = ( + 23, + n0, + _GSST, + { + _smithy: MappingProxyType( + {"method": "GET", "uri": "/v1/synthesisTasks/{TaskId}", "code": 200} ) - ], -) - -TASK_ID = Schema(id=ShapeID("com.amazonaws.polly#TaskId"), shape_type=ShapeType.STRING) - -GET_SPEECH_SYNTHESIS_TASK_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.polly#GetSpeechSynthesisTaskInput"), - members={ - "TaskId": { - "target": TASK_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -LEXICON_NAME_LIST = Schema.collection( - id=ShapeID("com.amazonaws.polly#LexiconNameList"), - shape_type=ShapeType.LIST, - members={"member": {"target": LEXICON_NAME}}, -) - -OUTPUT_FORMAT = Schema.collection( - id=ShapeID("com.amazonaws.polly#OutputFormat"), - shape_type=ShapeType.ENUM, - members={ - "JSON": {"target": UNIT}, - "MP3": {"target": UNIT}, - "OGG_OPUS": {"target": UNIT}, - "OGG_VORBIS": {"target": UNIT}, - "PCM": {"target": UNIT}, - "MULAW": {"target": UNIT}, - "ALAW": {"target": UNIT}, - }, -) - -OUTPUT_URI = Schema( - id=ShapeID("com.amazonaws.polly#OutputUri"), shape_type=ShapeType.STRING -) - -REQUEST_CHARACTERS = Schema( - id=ShapeID("com.amazonaws.polly#RequestCharacters"), - shape_type=ShapeType.INTEGER, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=0)], -) - -SAMPLE_RATE = Schema( - id=ShapeID("com.amazonaws.polly#SampleRate"), shape_type=ShapeType.STRING -) - -SNS_TOPIC_ARN = Schema( - id=ShapeID("com.amazonaws.polly#SnsTopicArn"), shape_type=ShapeType.STRING -) - -SPEECH_MARK_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.polly#SpeechMarkType"), - shape_type=ShapeType.ENUM, - members={ - "SENTENCE": {"target": UNIT}, - "SSML": {"target": UNIT}, - "VISEME": {"target": UNIT}, - "WORD": {"target": UNIT}, - }, -) - -SPEECH_MARK_TYPE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.polly#SpeechMarkTypeList"), - shape_type=ShapeType.LIST, - members={"member": {"target": SPEECH_MARK_TYPE}}, -) - -TASK_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.polly#TaskStatus"), - shape_type=ShapeType.ENUM, - members={ - "SCHEDULED": {"target": UNIT}, - "IN_PROGRESS": {"target": UNIT}, - "COMPLETED": {"target": UNIT}, - "FAILED": {"target": UNIT}, }, -) - -TASK_STATUS_REASON = Schema( - id=ShapeID("com.amazonaws.polly#TaskStatusReason"), shape_type=ShapeType.STRING -) - -TEXT_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.polly#TextType"), - shape_type=ShapeType.ENUM, - members={"SSML": {"target": UNIT}, "TEXT": {"target": UNIT}}, -) - -SYNTHESIS_TASK = Schema.collection( - id=ShapeID("com.amazonaws.polly#SynthesisTask"), - members={ - "Engine": {"target": ENGINE}, - "TaskId": {"target": TASK_ID}, - "TaskStatus": {"target": TASK_STATUS}, - "TaskStatusReason": {"target": TASK_STATUS_REASON}, - "OutputUri": {"target": OUTPUT_URI}, - "CreationTime": {"target": DATE_TIME}, - "RequestCharacters": { - "target": REQUEST_CHARACTERS, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "SnsTopicArn": {"target": SNS_TOPIC_ARN}, - "LexiconNames": {"target": LEXICON_NAME_LIST}, - "OutputFormat": {"target": OUTPUT_FORMAT}, - "SampleRate": {"target": SAMPLE_RATE}, - "SpeechMarkTypes": {"target": SPEECH_MARK_TYPE_LIST}, - "TextType": {"target": TEXT_TYPE}, - "VoiceId": {"target": VOICE_ID}, - "LanguageCode": {"target": LANGUAGE_CODE}, - }, -) - -GET_SPEECH_SYNTHESIS_TASK_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.polly#GetSpeechSynthesisTaskOutput"), - members={"SynthesisTask": {"target": SYNTHESIS_TASK}}, -) - -INVALID_TASK_ID_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.polly#InvalidTaskIdException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"message": {"target": ERROR_MESSAGE}}, -) - -SYNTHESIS_TASK_NOT_FOUND_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.polly#SynthesisTaskNotFoundException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"message": {"target": ERROR_MESSAGE}}, -) - -GET_SPEECH_SYNTHESIS_TASK = Schema( - id=ShapeID("com.amazonaws.polly#GetSpeechSynthesisTask"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/v1/synthesisTasks/{TaskId}", "code": 200} - ), + GET_SPEECH_SYNTHESIS_TASK_INPUT, + GET_SPEECH_SYNTHESIS_TASK_OUTPUT, + ( + INVALID_TASK_ID_EXCEPTION, + SERVICE_FAILURE_EXCEPTION, + SYNTHESIS_TASK_NOT_FOUND_EXCEPTION, + ), +) + +INVALID_LEXICON_EXCEPTION: StaticSchema = ( + 18, + n0, + _ILE, + {_smith: _c, _sE: 400}, + (_m,), + ((ERROR_MESSAGE, 0),), +) + +INVALID_S3_BUCKET_EXCEPTION: StaticSchema = ( + 18, + n0, + _ISBE, + {_smith: _c, _sE: 400}, + (_m,), + ((ERROR_MESSAGE, 0),), +) + +INVALID_S3_KEY_EXCEPTION: StaticSchema = ( + 18, + n0, + _ISKE, + {_smith: _c, _sE: 400}, + (_m,), + ((ERROR_MESSAGE, 0),), +) + +INVALID_SAMPLE_RATE_EXCEPTION: StaticSchema = ( + 18, + n0, + _ISRE, + {_smith: _c, _sE: 400}, + (_m,), + ((ERROR_MESSAGE, 0),), +) + +INVALID_SNS_TOPIC_ARN_EXCEPTION: StaticSchema = ( + 18, + n0, + _ISTAE, + {_smith: _c, _sE: 400}, + (_m,), + ((ERROR_MESSAGE, 0),), +) + +INVALID_SSML_EXCEPTION: StaticSchema = ( + 18, + n0, + _ISE, + {_smith: _c, _sE: 400}, + (_m,), + ((ERROR_MESSAGE, 0),), +) + +LANGUAGE_NOT_SUPPORTED_EXCEPTION: StaticSchema = ( + 18, + n0, + _LNSE, + {_smith: _c, _sE: 400}, + (_m,), + ((ERROR_MESSAGE, 0),), +) + +LEXICON_DESCRIPTION: StaticSchema = ( + 18, + n0, + _LD, + 0, + (_N, _At), + ((LEXICON_NAME, 0), (LEXICON_ATTRIBUTES, 0)), +) + +LEXICON_DESCRIPTION_LIST: StaticSchema = ( + 16, + n0, + _LDL, + 0, + (_me,), + ((LEXICON_DESCRIPTION, 0),), +) + +LEXICON_SIZE_EXCEEDED_EXCEPTION: StaticSchema = ( + 18, + n0, + _LSEE, + {_smith: _c, _sE: 400}, + (_m,), + ((ERROR_MESSAGE, 0),), +) + +LIST_LEXICONS_INPUT: StaticSchema = ( + 18, + n0, + _LLI, + {_sm: None}, + (_NT,), + ((NEXT_TOKEN, {_sQ: _NT}),), +) + +LIST_LEXICONS_OUTPUT: StaticSchema = ( + 18, + n0, + _LLO, + {_smit: None}, + (_Lexi, _NT), + ((LEXICON_DESCRIPTION_LIST, 0), (NEXT_TOKEN, 0)), +) + +LIST_LEXICONS: StaticOperationSchema = ( + 23, + n0, + _LL, + {_smithy: MappingProxyType({"method": "GET", "uri": "/v1/lexicons", "code": 200})}, + LIST_LEXICONS_INPUT, + LIST_LEXICONS_OUTPUT, + (INVALID_NEXT_TOKEN_EXCEPTION, SERVICE_FAILURE_EXCEPTION), +) + +MAX_RESULTS: StaticSchema = (7, n0, _MR, 0) + +LIST_SPEECH_SYNTHESIS_TASKS_INPUT: StaticSchema = ( + 18, + n0, + _LSSTI, + {_sm: None}, + (_MR, _NT, _Sta), + ((MAX_RESULTS, {_sQ: _MR}), (NEXT_TOKEN, {_sQ: _NT}), (TASK_STATUS, {_sQ: _Sta})), +) + +SYNTHESIS_TASKS: StaticSchema = (16, n0, _STy, 0, (_me,), ((SYNTHESIS_TASK, 0),)) + +LIST_SPEECH_SYNTHESIS_TASKS_OUTPUT: StaticSchema = ( + 18, + n0, + _LSSTO, + {_smit: None}, + (_NT, _STy), + ((NEXT_TOKEN, 0), (SYNTHESIS_TASKS, 0)), +) + +LIST_SPEECH_SYNTHESIS_TASKS: StaticOperationSchema = ( + 23, + n0, + _LSST, + { + _smithy: MappingProxyType( + {"method": "GET", "uri": "/v1/synthesisTasks", "code": 200} ) - ], -) - -INVALID_LEXICON_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.polly#InvalidLexiconException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"message": {"target": ERROR_MESSAGE}}, -) - -INVALID_S3_BUCKET_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.polly#InvalidS3BucketException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"message": {"target": ERROR_MESSAGE}}, -) - -INVALID_S3_KEY_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.polly#InvalidS3KeyException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"message": {"target": ERROR_MESSAGE}}, -) - -INVALID_SAMPLE_RATE_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.polly#InvalidSampleRateException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"message": {"target": ERROR_MESSAGE}}, -) - -INVALID_SNS_TOPIC_ARN_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.polly#InvalidSnsTopicArnException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"message": {"target": ERROR_MESSAGE}}, -) - -INVALID_SSML_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.polly#InvalidSsmlException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"message": {"target": ERROR_MESSAGE}}, -) - -LANGUAGE_NOT_SUPPORTED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.polly#LanguageNotSupportedException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"message": {"target": ERROR_MESSAGE}}, -) - -LEXICON_DESCRIPTION = Schema.collection( - id=ShapeID("com.amazonaws.polly#LexiconDescription"), - members={ - "Name": {"target": LEXICON_NAME}, - "Attributes": {"target": LEXICON_ATTRIBUTES}, }, -) - -LEXICON_DESCRIPTION_LIST = Schema.collection( - id=ShapeID("com.amazonaws.polly#LexiconDescriptionList"), - shape_type=ShapeType.LIST, - members={"member": {"target": LEXICON_DESCRIPTION}}, -) - -LEXICON_SIZE_EXCEEDED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.polly#LexiconSizeExceededException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"message": {"target": ERROR_MESSAGE}}, -) - -LIST_LEXICONS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.polly#ListLexiconsInput"), - members={ - "NextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="NextToken") - ], - } - }, -) - -LIST_LEXICONS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.polly#ListLexiconsOutput"), - members={ - "Lexicons": {"target": LEXICON_DESCRIPTION_LIST}, - "NextToken": {"target": NEXT_TOKEN}, - }, -) - -LIST_LEXICONS = Schema( - id=ShapeID("com.amazonaws.polly#ListLexicons"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/v1/lexicons", "code": 200} - ), + LIST_SPEECH_SYNTHESIS_TASKS_INPUT, + LIST_SPEECH_SYNTHESIS_TASKS_OUTPUT, + (INVALID_NEXT_TOKEN_EXCEPTION, SERVICE_FAILURE_EXCEPTION), +) + +MARKS_NOT_SUPPORTED_FOR_FORMAT_EXCEPTION: StaticSchema = ( + 18, + n0, + _MNSFFE, + {_smith: _c, _sE: 400}, + (_m,), + ((ERROR_MESSAGE, 0),), +) + +MAX_LEXEME_LENGTH_EXCEEDED_EXCEPTION: StaticSchema = ( + 18, + n0, + _MLLEE, + {_smith: _c, _sE: 400}, + (_m,), + ((ERROR_MESSAGE, 0),), +) + +MAX_LEXICONS_NUMBER_EXCEEDED_EXCEPTION: StaticSchema = ( + 18, + n0, + _MLNEE, + {_smith: _c, _sE: 400}, + (_m,), + ((ERROR_MESSAGE, 0),), +) + +OUTPUT_S3_BUCKET_NAME: StaticSchema = (3, n0, _OSBN, 0) + +OUTPUT_S3_KEY_PREFIX: StaticSchema = (3, n0, _OSKP, 0) + +PUT_LEXICON_INPUT: StaticSchema = ( + 18, + n0, + _PLI, + {_sm: None}, + (_N, _Con), + ((LEXICON_NAME, 9), (LEXICON_CONTENT, 1)), +) + +PUT_LEXICON_OUTPUT: StaticSchema = (18, n0, _PLO, {_smit: None}) + +UNSUPPORTED_PLS_ALPHABET_EXCEPTION: StaticSchema = ( + 18, + n0, + _UPAE, + {_smith: _c, _sE: 400}, + (_m,), + ((ERROR_MESSAGE, 0),), +) + +UNSUPPORTED_PLS_LANGUAGE_EXCEPTION: StaticSchema = ( + 18, + n0, + _UPLE, + {_smith: _c, _sE: 400}, + (_m,), + ((ERROR_MESSAGE, 0),), +) + +PUT_LEXICON: StaticOperationSchema = ( + 23, + n0, + _PL, + { + _smithy: MappingProxyType( + {"method": "PUT", "uri": "/v1/lexicons/{Name}", "code": 200} ) - ], -) - -MAX_RESULTS = Schema( - id=ShapeID("com.amazonaws.polly#MaxResults"), shape_type=ShapeType.INTEGER -) - -LIST_SPEECH_SYNTHESIS_TASKS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.polly#ListSpeechSynthesisTasksInput"), - members={ - "MaxResults": { - "target": MAX_RESULTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="MaxResults") - ], - }, - "NextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="NextToken") - ], - }, - "Status": { - "target": TASK_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="Status")], - }, }, -) - -SYNTHESIS_TASKS = Schema.collection( - id=ShapeID("com.amazonaws.polly#SynthesisTasks"), - shape_type=ShapeType.LIST, - members={"member": {"target": SYNTHESIS_TASK}}, -) - -LIST_SPEECH_SYNTHESIS_TASKS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.polly#ListSpeechSynthesisTasksOutput"), - members={ - "NextToken": {"target": NEXT_TOKEN}, - "SynthesisTasks": {"target": SYNTHESIS_TASKS}, - }, -) - -LIST_SPEECH_SYNTHESIS_TASKS = Schema( - id=ShapeID("com.amazonaws.polly#ListSpeechSynthesisTasks"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/v1/synthesisTasks", "code": 200} - ), + PUT_LEXICON_INPUT, + PUT_LEXICON_OUTPUT, + ( + INVALID_LEXICON_EXCEPTION, + LEXICON_SIZE_EXCEEDED_EXCEPTION, + MAX_LEXEME_LENGTH_EXCEEDED_EXCEPTION, + MAX_LEXICONS_NUMBER_EXCEEDED_EXCEPTION, + SERVICE_FAILURE_EXCEPTION, + UNSUPPORTED_PLS_ALPHABET_EXCEPTION, + UNSUPPORTED_PLS_LANGUAGE_EXCEPTION, + ), +) + +QUOTA_CODE: StaticSchema = ( + 14, + n0, + _QC, + 0, + (_ISIET, _IST), + ((-1, {_sV: _isiet}), (-1, {_sV: _ist})), +) + +SERVICE_CODE: StaticSchema = (14, n0, _SC, 0, (_POLLY,), ((-1, {_sV: _po}),)) + +SERVICE_QUOTA_EXCEEDED_EXCEPTION: StaticSchema = ( + 18, + n0, + _SQEE, + {_smith: _c, _sE: 402}, + (_m, _qC, _sC), + ((ERROR_MESSAGE, 1), (QUOTA_CODE, 1), (SERVICE_CODE, 1)), +) + +TEXT: StaticSchema = (3, n0, _Te, 0) + +TEXT_EVENT: StaticSchema = ( + 18, + n0, + _TE, + 0, + (_Te, _TT, _FSC), + ((TEXT, 1), (TEXT_TYPE, 0), (FLUSH_STREAM_CONFIGURATION, 0)), +) + +START_SPEECH_SYNTHESIS_STREAM_ACTION_STREAM: StaticSchema = ( + 19, + n0, + _SSSSAS, + {_s: None}, + (_TE, _CSE), + ((TEXT_EVENT, 0), (CLOSE_STREAM_EVENT, 0)), +) + +START_SPEECH_SYNTHESIS_STREAM_INPUT: StaticSchema = ( + 18, + n0, + _SSSSI, + {_sm: None}, + (_E, _LC, _LNe, _OF, _SR, _VI, _ASc), + ( + (ENGINE, {_sH: _xaE, _smi: None}), + (LANGUAGE_CODE, {_sH: _xaL}), + (LEXICON_NAME_LIST, {_sH: _xaL_}), + (OUTPUT_FORMAT, {_sH: _xaO, _smi: None}), + (SAMPLE_RATE, {_sH: _xaS}), + (VOICE_ID, {_sH: _xaV, _smi: None}), + (START_SPEECH_SYNTHESIS_STREAM_ACTION_STREAM, 16), + ), +) + +STREAM_CLOSED_EVENT: StaticSchema = ( + 18, + n0, + _SCE, + 0, + (_RC,), + ((REQUEST_CHARACTERS, {_smithya: 0}),), +) + +THROTTLING_REASON: StaticSchema = ( + 18, + n0, + _TR, + 0, + (_r, _re), + ( + (CORAL_AVAILABILITY_THROTTLING_REASON, 0), + (CORAL_AVAILABILITY_THROTTLED_RESOURCE, 0), + ), +) + +THROTTLING_REASON_LIST: StaticSchema = ( + 16, + n0, + _TRL, + 0, + (_me,), + ((THROTTLING_REASON, 0),), +) + +THROTTLING_EXCEPTION: StaticSchema = ( + 18, + n0, + _TEh, + {_smith: _c, _sE: 400}, + (_m, _tR), + ((AVAILABILITY_ERROR_MESSAGE, 0), (THROTTLING_REASON_LIST, 0)), +) + +VALIDATION_EXCEPTION_FIELD_MESSAGE: StaticSchema = (3, n0, _VEFM, 0) + +VALIDATION_EXCEPTION_FIELD_NAME: StaticSchema = (3, n0, _VEFN, 0) + +VALIDATION_EXCEPTION_FIELD: StaticSchema = ( + 18, + n0, + _VEF, + 0, + (_na, _m), + ((VALIDATION_EXCEPTION_FIELD_NAME, 1), (VALIDATION_EXCEPTION_FIELD_MESSAGE, 1)), +) + +VALIDATION_EXCEPTION_FIELD_LIST: StaticSchema = ( + 16, + n0, + _VEFL, + 0, + (_me,), + ((VALIDATION_EXCEPTION_FIELD, 0),), +) + +VALIDATION_EXCEPTION_REASON: StaticSchema = ( + 14, + n0, + _VER, + 0, + (_UO, _FVF, _OTHER, _IIE), + ((-1, {_sV: _uO}), (-1, {_sV: _fVF}), (-1, {_sV: _o}), (-1, {_sV: _iIE})), +) + +VALIDATION_EXCEPTION: StaticSchema = ( + 18, + n0, + _VE, + {_smith: _c, _sE: 400}, + (_m, _r, _fi), + ( + (ERROR_MESSAGE, 1), + (VALIDATION_EXCEPTION_REASON, 1), + (VALIDATION_EXCEPTION_FIELD_LIST, 0), + ), +) + +START_SPEECH_SYNTHESIS_STREAM_EVENT_STREAM: StaticSchema = ( + 19, + n0, + _SSSSES, + {_s: None}, + (_AE, _SCE, _VE, _SQEE, _SFE, _TEh), + ( + (AUDIO_EVENT, 0), + (STREAM_CLOSED_EVENT, 0), + (VALIDATION_EXCEPTION, 0), + (SERVICE_QUOTA_EXCEEDED_EXCEPTION, 0), + (SERVICE_FAILURE_EXCEPTION, 0), + (THROTTLING_EXCEPTION, 0), + ), +) + +START_SPEECH_SYNTHESIS_STREAM_OUTPUT: StaticSchema = ( + 18, + n0, + _SSSSO, + {_smit: None}, + (_ES,), + ((START_SPEECH_SYNTHESIS_STREAM_EVENT_STREAM, 16),), +) + +START_SPEECH_SYNTHESIS_STREAM: StaticOperationSchema = ( + 23, + n0, + _SSSS, + { + _smithy: MappingProxyType( + {"method": "POST", "uri": "/v1/synthesisStream", "code": 200} ) - ], -) - -MARKS_NOT_SUPPORTED_FOR_FORMAT_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.polly#MarksNotSupportedForFormatException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"message": {"target": ERROR_MESSAGE}}, -) - -MAX_LEXEME_LENGTH_EXCEEDED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.polly#MaxLexemeLengthExceededException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"message": {"target": ERROR_MESSAGE}}, -) - -MAX_LEXICONS_NUMBER_EXCEEDED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.polly#MaxLexiconsNumberExceededException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"message": {"target": ERROR_MESSAGE}}, -) - -OUTPUT_S3_BUCKET_NAME = Schema( - id=ShapeID("com.amazonaws.polly#OutputS3BucketName"), shape_type=ShapeType.STRING -) - -OUTPUT_S3_KEY_PREFIX = Schema( - id=ShapeID("com.amazonaws.polly#OutputS3KeyPrefix"), shape_type=ShapeType.STRING -) - -PUT_LEXICON_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.polly#PutLexiconInput"), - members={ - "Name": { - "target": LEXICON_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Content": { - "target": LEXICON_CONTENT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, }, -) - -PUT_LEXICON_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.polly#PutLexiconOutput") -) - -UNSUPPORTED_PLS_ALPHABET_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.polly#UnsupportedPlsAlphabetException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"message": {"target": ERROR_MESSAGE}}, -) - -UNSUPPORTED_PLS_LANGUAGE_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.polly#UnsupportedPlsLanguageException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"message": {"target": ERROR_MESSAGE}}, -) - -PUT_LEXICON = Schema( - id=ShapeID("com.amazonaws.polly#PutLexicon"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "PUT", "uri": "/v1/lexicons/{Name}", "code": 200} - ), + START_SPEECH_SYNTHESIS_STREAM_INPUT, + START_SPEECH_SYNTHESIS_STREAM_OUTPUT, + ( + SERVICE_FAILURE_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), +) + +SSML_MARKS_NOT_SUPPORTED_FOR_TEXT_TYPE_EXCEPTION: StaticSchema = ( + 18, + n0, + _SMNSFTTE, + {_smith: _c, _sE: 400}, + (_m,), + ((ERROR_MESSAGE, 0),), +) + +START_SPEECH_SYNTHESIS_TASK_INPUT: StaticSchema = ( + 18, + n0, + _SSSTI, + {_sm: None}, + (_E, _LC, _LNe, _OF, _OSBN, _OSKP, _SR, _STA, _SMTp, _Te, _TT, _VI), + ( + (ENGINE, 0), + (LANGUAGE_CODE, 0), + (LEXICON_NAME_LIST, 0), + (OUTPUT_FORMAT, 1), + (OUTPUT_S3_BUCKET_NAME, 1), + (OUTPUT_S3_KEY_PREFIX, 0), + (SAMPLE_RATE, 0), + (SNS_TOPIC_ARN, 0), + (SPEECH_MARK_TYPE_LIST, 0), + (TEXT, 1), + (TEXT_TYPE, 0), + (VOICE_ID, 1), + ), +) + +START_SPEECH_SYNTHESIS_TASK_OUTPUT: StaticSchema = ( + 18, + n0, + _SSSTO, + {_smit: None}, + (_ST,), + ((SYNTHESIS_TASK, 0),), +) + +TEXT_LENGTH_EXCEEDED_EXCEPTION: StaticSchema = ( + 18, + n0, + _TLEE, + {_smith: _c, _sE: 400}, + (_m,), + ((ERROR_MESSAGE, 0),), +) + +START_SPEECH_SYNTHESIS_TASK: StaticOperationSchema = ( + 23, + n0, + _SSST, + { + _smithy: MappingProxyType( + {"method": "POST", "uri": "/v1/synthesisTasks", "code": 200} ) - ], -) - -QUOTA_CODE = Schema.collection( - id=ShapeID("com.amazonaws.polly#QuotaCode"), - shape_type=ShapeType.ENUM, - members={ - "INPUT_STREAM_INBOUND_EVENT_TIMEOUT": {"target": UNIT}, - "INPUT_STREAM_TIMEOUT": {"target": UNIT}, - }, -) - -SERVICE_CODE = Schema.collection( - id=ShapeID("com.amazonaws.polly#ServiceCode"), - shape_type=ShapeType.ENUM, - members={"POLLY": {"target": UNIT}}, -) - -SERVICE_QUOTA_EXCEEDED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.polly#ServiceQuotaExceededException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=402), - ], - members={ - "message": { - "target": ERROR_MESSAGE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "quotaCode": { - "target": QUOTA_CODE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "serviceCode": { - "target": SERVICE_CODE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -TEXT = Schema(id=ShapeID("com.amazonaws.polly#Text"), shape_type=ShapeType.STRING) - -TEXT_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.polly#TextEvent"), - members={ - "Text": { - "target": TEXT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "TextType": {"target": TEXT_TYPE}, - "FlushStreamConfiguration": {"target": FLUSH_STREAM_CONFIGURATION}, - }, -) - -START_SPEECH_SYNTHESIS_STREAM_ACTION_STREAM = Schema.collection( - id=ShapeID("com.amazonaws.polly#StartSpeechSynthesisStreamActionStream"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#streaming"))], - members={ - "TextEvent": {"target": TEXT_EVENT}, - "CloseStreamEvent": {"target": CLOSE_STREAM_EVENT}, - }, -) - -START_SPEECH_SYNTHESIS_STREAM_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.polly#StartSpeechSynthesisStreamInput"), - members={ - "Engine": { - "target": ENGINE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="x-amzn-Engine"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "LanguageCode": { - "target": LANGUAGE_CODE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), value="x-amzn-LanguageCode" - ) - ], - }, - "LexiconNames": { - "target": LEXICON_NAME_LIST, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), value="x-amzn-LexiconNames" - ) - ], - }, - "OutputFormat": { - "target": OUTPUT_FORMAT, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), value="x-amzn-OutputFormat" - ), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "SampleRate": { - "target": SAMPLE_RATE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), value="x-amzn-SampleRate" - ) - ], - }, - "VoiceId": { - "target": VOICE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="x-amzn-VoiceId"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "ActionStream": { - "target": START_SPEECH_SYNTHESIS_STREAM_ACTION_STREAM, - "traits": [Trait.new(id=ShapeID("smithy.api#httpPayload"))], - }, - }, -) - -STREAM_CLOSED_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.polly#StreamClosedEvent"), - members={ - "RequestCharacters": { - "target": REQUEST_CHARACTERS, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - } }, -) - -THROTTLING_REASON = Schema.collection( - id=ShapeID("com.amazonaws.polly#ThrottlingReason"), - members={ - "reason": {"target": CORAL_AVAILABILITY_THROTTLING_REASON}, - "resource": {"target": CORAL_AVAILABILITY_THROTTLED_RESOURCE}, - }, -) - -THROTTLING_REASON_LIST = Schema.collection( - id=ShapeID("com.amazonaws.polly#ThrottlingReasonList"), - shape_type=ShapeType.LIST, - members={"member": {"target": THROTTLING_REASON}}, -) - -THROTTLING_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.polly#ThrottlingException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType({"code": "Throttling", "httpResponseCode": 400}), - ), - ], - members={ - "message": {"target": AVAILABILITY_ERROR_MESSAGE}, - "throttlingReasons": {"target": THROTTLING_REASON_LIST}, - }, -) - -VALIDATION_EXCEPTION_FIELD_MESSAGE = Schema( - id=ShapeID("com.amazonaws.polly#ValidationExceptionFieldMessage"), - shape_type=ShapeType.STRING, -) - -VALIDATION_EXCEPTION_FIELD_NAME = Schema( - id=ShapeID("com.amazonaws.polly#ValidationExceptionFieldName"), - shape_type=ShapeType.STRING, -) - -VALIDATION_EXCEPTION_FIELD = Schema.collection( - id=ShapeID("com.amazonaws.polly#ValidationExceptionField"), - members={ - "name": { - "target": VALIDATION_EXCEPTION_FIELD_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "message": { - "target": VALIDATION_EXCEPTION_FIELD_MESSAGE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -VALIDATION_EXCEPTION_FIELD_LIST = Schema.collection( - id=ShapeID("com.amazonaws.polly#ValidationExceptionFieldList"), - shape_type=ShapeType.LIST, - members={"member": {"target": VALIDATION_EXCEPTION_FIELD}}, -) - -VALIDATION_EXCEPTION_REASON = Schema.collection( - id=ShapeID("com.amazonaws.polly#ValidationExceptionReason"), - shape_type=ShapeType.ENUM, - members={ - "UNSUPPORTED_OPERATION": {"target": UNIT}, - "FIELD_VALIDATION_FAILED": {"target": UNIT}, - "OTHER": {"target": UNIT}, - "INVALID_INBOUND_EVENT": {"target": UNIT}, - }, -) - -VALIDATION_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.polly#ValidationException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={ - "message": { - "target": ERROR_MESSAGE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "reason": { - "target": VALIDATION_EXCEPTION_REASON, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "fields": {"target": VALIDATION_EXCEPTION_FIELD_LIST}, - }, -) - -START_SPEECH_SYNTHESIS_STREAM_EVENT_STREAM = Schema.collection( - id=ShapeID("com.amazonaws.polly#StartSpeechSynthesisStreamEventStream"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#streaming"))], - members={ - "AudioEvent": {"target": AUDIO_EVENT}, - "StreamClosedEvent": {"target": STREAM_CLOSED_EVENT}, - "ValidationException": {"target": VALIDATION_EXCEPTION}, - "ServiceQuotaExceededException": {"target": SERVICE_QUOTA_EXCEEDED_EXCEPTION}, - "ServiceFailureException": {"target": SERVICE_FAILURE_EXCEPTION}, - "ThrottlingException": {"target": THROTTLING_EXCEPTION}, - }, -) - -START_SPEECH_SYNTHESIS_STREAM_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.polly#StartSpeechSynthesisStreamOutput"), - members={ - "EventStream": { - "target": START_SPEECH_SYNTHESIS_STREAM_EVENT_STREAM, - "traits": [Trait.new(id=ShapeID("smithy.api#httpPayload"))], - } - }, -) - -START_SPEECH_SYNTHESIS_STREAM = Schema( - id=ShapeID("com.amazonaws.polly#StartSpeechSynthesisStream"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/v1/synthesisStream", "code": 200} - ), - ) - ], -) - -SSML_MARKS_NOT_SUPPORTED_FOR_TEXT_TYPE_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.polly#SsmlMarksNotSupportedForTextTypeException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"message": {"target": ERROR_MESSAGE}}, -) - -START_SPEECH_SYNTHESIS_TASK_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.polly#StartSpeechSynthesisTaskInput"), - members={ - "Engine": {"target": ENGINE}, - "LanguageCode": {"target": LANGUAGE_CODE}, - "LexiconNames": {"target": LEXICON_NAME_LIST}, - "OutputFormat": { - "target": OUTPUT_FORMAT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "OutputS3BucketName": { - "target": OUTPUT_S3_BUCKET_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "OutputS3KeyPrefix": {"target": OUTPUT_S3_KEY_PREFIX}, - "SampleRate": {"target": SAMPLE_RATE}, - "SnsTopicArn": {"target": SNS_TOPIC_ARN}, - "SpeechMarkTypes": {"target": SPEECH_MARK_TYPE_LIST}, - "Text": { - "target": TEXT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "TextType": {"target": TEXT_TYPE}, - "VoiceId": { - "target": VOICE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -START_SPEECH_SYNTHESIS_TASK_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.polly#StartSpeechSynthesisTaskOutput"), - members={"SynthesisTask": {"target": SYNTHESIS_TASK}}, -) - -TEXT_LENGTH_EXCEEDED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.polly#TextLengthExceededException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"message": {"target": ERROR_MESSAGE}}, -) - -START_SPEECH_SYNTHESIS_TASK = Schema( - id=ShapeID("com.amazonaws.polly#StartSpeechSynthesisTask"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/v1/synthesisTasks", "code": 200} - ), - ) - ], -) - -SYNTHESIZE_SPEECH_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.polly#SynthesizeSpeechInput"), - members={ - "Engine": {"target": ENGINE}, - "LanguageCode": {"target": LANGUAGE_CODE}, - "LexiconNames": {"target": LEXICON_NAME_LIST}, - "OutputFormat": { - "target": OUTPUT_FORMAT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "SampleRate": {"target": SAMPLE_RATE}, - "SpeechMarkTypes": {"target": SPEECH_MARK_TYPE_LIST}, - "Text": { - "target": TEXT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "TextType": {"target": TEXT_TYPE}, - "VoiceId": { - "target": VOICE_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -SYNTHESIZE_SPEECH_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.polly#SynthesizeSpeechOutput"), - members={ - "AudioStream": { - "target": AUDIO_STREAM, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=""), - Trait.new(id=ShapeID("smithy.api#httpPayload")), - ], - }, - "ContentType": { - "target": CONTENT_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpHeader"), value="Content-Type") - ], - }, - "RequestCharacters": { - "target": REQUEST_CHARACTERS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=0), - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-RequestCharacters", - ), - ], - }, - }, -) - -SYNTHESIZE_SPEECH = Schema( - id=ShapeID("com.amazonaws.polly#SynthesizeSpeech"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/v1/speech", "code": 200} - ), - ) - ], -) - -PARROT_V1 = Schema( - id=ShapeID("com.amazonaws.polly#Parrot_v1"), - shape_type=ShapeType.SERVICE, - traits=[ - Trait.new( - id=ShapeID("aws.auth#sigv4"), value=MappingProxyType({"name": "polly"}) - ), - Trait.new( - id=ShapeID("smithy.rules#endpointBdd"), - value=MappingProxyType( - { - "version": "1.1", - "parameters": MappingProxyType( - { - "Region": MappingProxyType( - { - "builtIn": "AWS::Region", - "required": False, - "documentation": "The AWS region used to dispatch the request.", - "type": "string", - } - ), - "UseDualStack": MappingProxyType( - { - "builtIn": "AWS::UseDualStack", - "required": True, - "default": False, - "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", - "type": "boolean", - } - ), - "UseFIPS": MappingProxyType( - { - "builtIn": "AWS::UseFIPS", - "required": True, - "default": False, - "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", - "type": "boolean", - } - ), - "Endpoint": MappingProxyType( - { - "builtIn": "SDK::Endpoint", - "required": False, - "documentation": "Override the endpoint used to send this request", - "type": "string", - } - ), - } - ), - "conditions": ( - MappingProxyType( - { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "Endpoint"}),), - } - ), - MappingProxyType( + START_SPEECH_SYNTHESIS_TASK_INPUT, + START_SPEECH_SYNTHESIS_TASK_OUTPUT, + ( + ENGINE_NOT_SUPPORTED_EXCEPTION, + INVALID_S3_BUCKET_EXCEPTION, + INVALID_S3_KEY_EXCEPTION, + INVALID_SAMPLE_RATE_EXCEPTION, + INVALID_SNS_TOPIC_ARN_EXCEPTION, + INVALID_SSML_EXCEPTION, + LANGUAGE_NOT_SUPPORTED_EXCEPTION, + LEXICON_NOT_FOUND_EXCEPTION, + MARKS_NOT_SUPPORTED_FOR_FORMAT_EXCEPTION, + SERVICE_FAILURE_EXCEPTION, + SSML_MARKS_NOT_SUPPORTED_FOR_TEXT_TYPE_EXCEPTION, + TEXT_LENGTH_EXCEEDED_EXCEPTION, + ), +) + +SYNTHESIZE_SPEECH_INPUT: StaticSchema = ( + 18, + n0, + _SSI, + {_sm: None}, + (_E, _LC, _LNe, _OF, _SR, _SMTp, _Te, _TT, _VI), + ( + (ENGINE, 0), + (LANGUAGE_CODE, 0), + (LEXICON_NAME_LIST, 0), + (OUTPUT_FORMAT, 1), + (SAMPLE_RATE, 0), + (SPEECH_MARK_TYPE_LIST, 0), + (TEXT, 1), + (TEXT_TYPE, 0), + (VOICE_ID, 1), + ), +) + +SYNTHESIZE_SPEECH_OUTPUT: StaticSchema = ( + 18, + n0, + _SSO, + {_smit: None}, + (_AS, _CT, _RC), + ( + (AUDIO_STREAM, {_smithya: _v_, _sPm: None}), + (CONTENT_TYPE, {_sH: _CT_}), + (REQUEST_CHARACTERS, {_smithya: 0, _sH: _xaR}), + ), +) + +SYNTHESIZE_SPEECH: StaticOperationSchema = ( + 23, + n0, + _SS, + {_smithy: MappingProxyType({"method": "POST", "uri": "/v1/speech", "code": 200})}, + SYNTHESIZE_SPEECH_INPUT, + SYNTHESIZE_SPEECH_OUTPUT, + ( + ENGINE_NOT_SUPPORTED_EXCEPTION, + INVALID_SAMPLE_RATE_EXCEPTION, + INVALID_SSML_EXCEPTION, + LANGUAGE_NOT_SUPPORTED_EXCEPTION, + LEXICON_NOT_FOUND_EXCEPTION, + MARKS_NOT_SUPPORTED_FOR_FORMAT_EXCEPTION, + SERVICE_FAILURE_EXCEPTION, + SSML_MARKS_NOT_SUPPORTED_FOR_TEXT_TYPE_EXCEPTION, + TEXT_LENGTH_EXCEEDED_EXCEPTION, + ), +) + +PARROT_V1: StaticSchema = ( + 21, + n0, + _Pv, + { + _aw: MappingProxyType({"name": "polly"}), + _sB: MappingProxyType( + { + "version": "1.1", + "parameters": MappingProxyType( + { + "Region": MappingProxyType( { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "Region"}),), + "builtIn": "AWS::Region", + "required": False, + "documentation": "The AWS region used to dispatch the request.", + "type": "string", } ), - MappingProxyType( + "UseDualStack": MappingProxyType( { - "fn": "aws.partition", - "argv": (MappingProxyType({"ref": "Region"}),), - "assign": "PartitionResult", + "builtIn": "AWS::UseDualStack", + "required": True, + "default": False, + "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", + "type": "boolean", } ), - MappingProxyType( + "UseFIPS": MappingProxyType( { - "fn": "booleanEquals", - "argv": (MappingProxyType({"ref": "UseFIPS"}), True), + "builtIn": "AWS::UseFIPS", + "required": True, + "default": False, + "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", + "type": "boolean", } ), - MappingProxyType( + "Endpoint": MappingProxyType( { - "fn": "booleanEquals", - "argv": ( - MappingProxyType({"ref": "UseDualStack"}), - True, - ), - } - ), - MappingProxyType( - { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "supportsDualStack", - ), - } - ), - True, - ), - } - ), - MappingProxyType( - { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "supportsFIPS", - ), - } - ), - True, - ), + "builtIn": "SDK::Endpoint", + "required": False, + "documentation": "Override the endpoint used to send this request", + "type": "string", } ), + } + ), + "conditions": ( + MappingProxyType( + { + "fn": "isSet", + "argv": (MappingProxyType({"ref": "Endpoint"}),), + } ), - "results": ( - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: FIPS and custom endpoint are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": MappingProxyType({"ref": "Endpoint"}), - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://polly-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "FIPS and DualStack are enabled, but this partition does not support one or both", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://polly-fips.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "FIPS is enabled but this partition does not support FIPS", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + MappingProxyType( + {"fn": "isSet", "argv": (MappingProxyType({"ref": "Region"}),)} + ), + MappingProxyType( + { + "fn": "aws.partition", + "argv": (MappingProxyType({"ref": "Region"}),), + "assign": "PartitionResult", + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": (MappingProxyType({"ref": "UseFIPS"}), True), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": (MappingProxyType({"ref": "UseDualStack"}), True), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( { - "url": "https://polly.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "supportsDualStack", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "DualStack is enabled but this partition does not support DualStack", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + True, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( { - "url": "https://polly.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "supportsFIPS", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: Missing Region", - "type": "error", - } - ), + True, + ), + } ), - "root": 2, - "nodeCount": 13, - "nodes": "/////wAAAAH/////AAAAAAAAAAwAAAADAAAAAQAAAAQF9eELAAAAAgAAAAUF9eELAAAAAwAAAAgAAAAGAAAABAAAAAcF9eEKAAAABQX14QgF9eEJAAAABAAAAAoAAAAJAAAABgX14QYF9eEHAAAABQAAAAsF9eEFAAAABgX14QQF9eEFAAAAAwX14QEAAAANAAAABAX14QIF9eED", - } - ), - ), - Trait.new( - id=ShapeID("aws.api#service"), - value=MappingProxyType( - { - "sdkId": "Polly", - "arnNamespace": "polly", - "cloudFormationName": "Polly", - "cloudTrailEventSource": "polly.amazonaws.com", - "endpointPrefix": "polly", - } - ), - ), - Trait.new( - id=ShapeID("smithy.api#xmlNamespace"), - value=MappingProxyType({"uri": "http://polly.amazonaws.com/doc/v1"}), + ), + "results": ( + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: FIPS and custom endpoint are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": MappingProxyType({"ref": "Endpoint"}), + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://polly-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS and DualStack are enabled, but this partition does not support one or both", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://polly-fips.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS is enabled but this partition does not support FIPS", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://polly.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "DualStack is enabled but this partition does not support DualStack", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://polly.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Missing Region", + "type": "error", + } + ), + ), + "root": 2, + "nodeCount": 13, + "nodes": "/////wAAAAH/////AAAAAAAAAAwAAAADAAAAAQAAAAQF9eELAAAAAgAAAAUF9eELAAAAAwAAAAgAAAAGAAAABAAAAAcF9eEKAAAABQX14QgF9eEJAAAABAAAAAoAAAAJAAAABgX14QYF9eEHAAAABQAAAAsF9eEFAAAABgX14QQF9eEFAAAAAwX14QEAAAANAAAABAX14QIF9eED", + } ), - Trait.new( - id=ShapeID("aws.protocols#restJson1"), - value=MappingProxyType( - {"http": ("http/1.1", "h2"), "eventStreamHttp": ("h2",)} - ), + _aws: MappingProxyType( + { + "sdkId": "Polly", + "arnNamespace": "polly", + "cloudFormationName": "Polly", + "cloudTrailEventSource": "polly.amazonaws.com", + "endpointPrefix": "polly", + } ), - ], + _sN: MappingProxyType({"uri": "http://polly.amazonaws.com/doc/v1"}), + _aJ: MappingProxyType({"http": ("http/1.1", "h2"), "eventStreamHttp": ("h2",)}), + }, ) diff --git a/clients/aws-sdk-polly/src/aws_sdk_polly/client.py b/clients/aws-sdk-polly/src/aws_sdk_polly/client.py index 3a907b85..95834c41 100644 --- a/clients/aws-sdk-polly/src/aws_sdk_polly/client.py +++ b/clients/aws-sdk-polly/src/aws_sdk_polly/client.py @@ -1,44 +1,32 @@ # Code generated by smithy-python-codegen DO NOT EDIT. +from __future__ import annotations + from copy import deepcopy import logging from typing import Any, cast +from smithy_aws_core.aio.identity.chain import AsyncIdentityChain from smithy_aws_core.config import ConfigSource from smithy_aws_core.identity import AWSCredentialsIdentity -from smithy_aws_core.identity.chain import IdentityChain -from smithy_core.aio.client import AsyncClient, ClientCall, RequestPipeline -from smithy_core.aio.eventstream import DuplexEventStream +from smithy_core.aio.client import AsyncClient, AsyncClientCall, AsyncRequestPipeline +from smithy_core.aio.eventstream import AsyncDuplexEventStream from smithy_core.deserializers import DeserializeableShape from smithy_core.exceptions import ExpectationNotMetError from smithy_core.schemas import APIOperation from smithy_core.serializers import SerializeableShape -from smithy_http.aio.interfaces import HTTPClient +from smithy_http.aio.interfaces import AsyncHTTPClient from smithy_http.plugins import user_agent_plugin from .config import AsyncPollyConfig, Plugin from .models import ( DELETE_LEXICON, DESCRIBE_VOICES, - DeleteLexiconInput, - DeleteLexiconOutput, - DescribeVoicesInput, - DescribeVoicesOutput, GET_LEXICON, GET_SPEECH_SYNTHESIS_TASK, - GetLexiconInput, - GetLexiconOutput, - GetSpeechSynthesisTaskInput, - GetSpeechSynthesisTaskOutput, LIST_LEXICONS, LIST_SPEECH_SYNTHESIS_TASKS, - ListLexiconsInput, - ListLexiconsOutput, - ListSpeechSynthesisTasksInput, - ListSpeechSynthesisTasksOutput, PUT_LEXICON, - PutLexiconInput, - PutLexiconOutput, START_SPEECH_SYNTHESIS_STREAM, START_SPEECH_SYNTHESIS_TASK, SYNTHESIZE_SPEECH, @@ -46,14 +34,34 @@ StartSpeechSynthesisStreamEventStream, StartSpeechSynthesisStreamInput, StartSpeechSynthesisStreamOutput, - StartSpeechSynthesisTaskInput, - StartSpeechSynthesisTaskOutput, - SynthesizeSpeechInput, - SynthesizeSpeechOutput, _StartSpeechSynthesisStreamEventStreamDeserializer, ) from .user_agent import aws_user_agent_plugin +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .models import ( + DeleteLexiconInput, + DeleteLexiconOutput, + DescribeVoicesInput, + DescribeVoicesOutput, + GetLexiconInput, + GetLexiconOutput, + GetSpeechSynthesisTaskInput, + GetSpeechSynthesisTaskOutput, + ListLexiconsInput, + ListLexiconsOutput, + ListSpeechSynthesisTasksInput, + ListSpeechSynthesisTasksOutput, + PutLexiconInput, + PutLexiconOutput, + StartSpeechSynthesisTaskInput, + StartSpeechSynthesisTaskOutput, + SynthesizeSpeechInput, + SynthesizeSpeechOutput, + ) + logger = logging.getLogger(__name__) @@ -127,12 +135,12 @@ async def _post_setup(self, config: AsyncPollyConfig) -> None: config_file = await config_context.parsed_profiles() if config_context.profile_source is ConfigSource.OVERRIDE: profile_name = config_context.profile_name - config.aws_credentials_identity_resolver = await IdentityChain.create( + config.aws_credentials_identity_resolver = await AsyncIdentityChain.create( AWSCredentialsIdentity, config_file=config_file, profile_name=profile_name, region_override=config.region, - http_client=cast(HTTPClient | None, config.transport), + http_client=cast(AsyncHTTPClient | None, config.transport), ) async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( @@ -141,7 +149,7 @@ async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( operation: APIOperation[I, O], default_plugins: list[Plugin], plugins: list[Plugin] | None, - ) -> tuple[RequestPipeline[Any, Any], ClientCall[I, O]]: + ) -> tuple[AsyncRequestPipeline[Any, Any], AsyncClientCall[I, O]]: if self._closed: raise RuntimeError( "Cannot invoke an operation on a client that has been closed." @@ -371,7 +379,7 @@ async def start_speech_synthesis_stream( self, input: StartSpeechSynthesisStreamInput, plugins: list[Plugin] | None = None, - ) -> DuplexEventStream[ + ) -> AsyncDuplexEventStream[ StartSpeechSynthesisStreamActionStream, StartSpeechSynthesisStreamEventStream, StartSpeechSynthesisStreamOutput, @@ -397,7 +405,7 @@ async def start_speech_synthesis_stream( invocations. Returns: - A `DuplexEventStream` for bidirectional streaming. + An `AsyncDuplexEventStream` for bidirectional streaming. """ pipeline, call = await self._prepare_call( input, START_SPEECH_SYNTHESIS_STREAM, [], plugins diff --git a/clients/aws-sdk-polly/src/aws_sdk_polly/config.py b/clients/aws-sdk-polly/src/aws_sdk_polly/config.py index bf409b31..6aed8977 100644 --- a/clients/aws-sdk-polly/src/aws_sdk_polly/config.py +++ b/clients/aws-sdk-polly/src/aws_sdk_polly/config.py @@ -1,85 +1,102 @@ # Code generated by smithy-python-codegen DO NOT EDIT. from dataclasses import dataclass, field -from typing import Any, Callable, ClassVar, Self, TypeAlias, Union, Unpack +from typing import ( + Any, + Callable, + ClassVar, + Self, + TYPE_CHECKING, + TypeAlias, + Union, + Unpack, +) -from smithy_aws_core.aio.protocols import RestJsonClientProtocol -from smithy_aws_core.auth import SigV4AuthScheme -from smithy_aws_core.config import AwsConfigOverrides, FileSystem -from smithy_aws_core.config.aws_config import AsyncAwsConfig -from smithy_aws_core.config.resolvers import EndpointUriResolver -from smithy_aws_core.config.types import FieldSpec -from smithy_aws_core.endpoints.standard_regional import ( - StandardRegionalEndpointsResolver, +from smithy_aws_core.aio.auth.sigv4 import AsyncSigV4AuthScheme +from smithy_aws_core.aio.config import AsyncFileSystem +from smithy_aws_core.aio.config.aws_config import AsyncAwsConfig, AwsConfigOverrides +from smithy_aws_core.aio.config.resolvers import EndpointUriResolver +from smithy_aws_core.aio.endpoints.standard_regional import ( + AsyncStandardRegionalEndpointsResolver, ) +from smithy_aws_core.aio.protocols import AsyncRestJsonClientProtocol +from smithy_aws_core.config.types import FieldSpec from smithy_aws_core.identity import AWSCredentialsIdentity, AWSIdentityProperties -from smithy_core.aio.interfaces import ( - ClientProtocol, - EndpointResolver, - ProtocolConstructor, - ProtocolSettings, -) -from smithy_core.aio.interfaces.auth import AuthScheme -from smithy_core.aio.interfaces.identity import IdentityResolver -from smithy_core.interceptors import Interceptor +from smithy_core.aio.interfaces import AsyncClientProtocol, AsyncEndpointResolver +from smithy_core.aio.interfaces.auth import AsyncAuthScheme +from smithy_core.aio.interfaces.identity import AsyncIdentityResolver +from smithy_core.interfaces import ProtocolConstructor, ProtocolSettings from smithy_core.interfaces.auth import AuthSchemeResolver from smithy_core.shapes import ShapeID from smithy_http.aio.aiohttp import AIOHTTPClient +from ._private.schemas import PARROT_V1 from .auth import HTTPAuthSchemeResolver -from .models import ( - DeleteLexiconInput, - DeleteLexiconOutput, - DescribeVoicesInput, - DescribeVoicesOutput, - GetLexiconInput, - GetLexiconOutput, - GetSpeechSynthesisTaskInput, - GetSpeechSynthesisTaskOutput, - ListLexiconsInput, - ListLexiconsOutput, - ListSpeechSynthesisTasksInput, - ListSpeechSynthesisTasksOutput, - PutLexiconInput, - PutLexiconOutput, - StartSpeechSynthesisStreamInput, - StartSpeechSynthesisStreamOutput, - StartSpeechSynthesisTaskInput, - StartSpeechSynthesisTaskOutput, - SynthesizeSpeechInput, - SynthesizeSpeechOutput, -) -_ServiceInterceptor = Union[ - Interceptor[DeleteLexiconInput, DeleteLexiconOutput, Any, Any], - Interceptor[DescribeVoicesInput, DescribeVoicesOutput, Any, Any], - Interceptor[GetLexiconInput, GetLexiconOutput, Any, Any], - Interceptor[GetSpeechSynthesisTaskInput, GetSpeechSynthesisTaskOutput, Any, Any], - Interceptor[ListLexiconsInput, ListLexiconsOutput, Any, Any], - Interceptor[ - ListSpeechSynthesisTasksInput, ListSpeechSynthesisTasksOutput, Any, Any - ], - Interceptor[PutLexiconInput, PutLexiconOutput, Any, Any], - Interceptor[ - StartSpeechSynthesisStreamInput, StartSpeechSynthesisStreamOutput, Any, Any - ], - Interceptor[ - StartSpeechSynthesisTaskInput, StartSpeechSynthesisTaskOutput, Any, Any - ], - Interceptor[SynthesizeSpeechInput, SynthesizeSpeechOutput, Any, Any], -] +if TYPE_CHECKING: + from smithy_core.interceptors import Interceptor + from .models import ( + DeleteLexiconInput, + DeleteLexiconOutput, + DescribeVoicesInput, + DescribeVoicesOutput, + GetLexiconInput, + GetLexiconOutput, + GetSpeechSynthesisTaskInput, + GetSpeechSynthesisTaskOutput, + ListLexiconsInput, + ListLexiconsOutput, + ListSpeechSynthesisTasksInput, + ListSpeechSynthesisTasksOutput, + PutLexiconInput, + PutLexiconOutput, + StartSpeechSynthesisStreamInput, + StartSpeechSynthesisStreamOutput, + StartSpeechSynthesisTaskInput, + StartSpeechSynthesisTaskOutput, + SynthesizeSpeechInput, + SynthesizeSpeechOutput, + ) + + _ServiceInterceptor = Union[ + Interceptor[DeleteLexiconInput, DeleteLexiconOutput, Any, Any], + Interceptor[DescribeVoicesInput, DescribeVoicesOutput, Any, Any], + Interceptor[GetLexiconInput, GetLexiconOutput, Any, Any], + Interceptor[ + GetSpeechSynthesisTaskInput, GetSpeechSynthesisTaskOutput, Any, Any + ], + Interceptor[ListLexiconsInput, ListLexiconsOutput, Any, Any], + Interceptor[ + ListSpeechSynthesisTasksInput, ListSpeechSynthesisTasksOutput, Any, Any + ], + Interceptor[PutLexiconInput, PutLexiconOutput, Any, Any], + Interceptor[ + StartSpeechSynthesisStreamInput, StartSpeechSynthesisStreamOutput, Any, Any + ], + Interceptor[ + StartSpeechSynthesisTaskInput, StartSpeechSynthesisTaskOutput, Any, Any + ], + Interceptor[SynthesizeSpeechInput, SynthesizeSpeechOutput, Any, Any], + ] +else: + _ServiceInterceptor = Any + _PROTOCOL_SETTINGS = ProtocolSettings( - namespace="com.amazonaws.polly", service_target="Parrot_v1" + namespace="com.amazonaws.polly", + service_target="Parrot_v1", + service_schema=PARROT_V1, ) class _AsyncPollyConfigOverrides(AwsConfigOverrides, total=False): - endpoint_resolver: EndpointResolver | None + endpoint_resolver: AsyncEndpointResolver | None protocol: ( - ClientProtocol[Any, Any] | ProtocolConstructor[ClientProtocol[Any, Any]] | None + AsyncClientProtocol[Any, Any] + | ProtocolConstructor[AsyncClientProtocol[Any, Any]] + | None ) - auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None + auth_schemes: dict[ShapeID, AsyncAuthScheme[Any, Any, Any, Any]] | None auth_scheme_resolver: AuthSchemeResolver | None @@ -87,17 +104,17 @@ class _AsyncPollyConfigOverrides(AwsConfigOverrides, total=False): class AsyncPollyConfig(AsyncAwsConfig): """Polly configuration (async-resolved).""" - endpoint_resolver: EndpointResolver | None = None + endpoint_resolver: AsyncEndpointResolver | None = None """ The endpoint resolver used to resolve the final endpoint per-operation based on the configuration. """ - protocol: ClientProtocol[Any, Any] | None = None + protocol: AsyncClientProtocol[Any, Any] | None = None """ Pass a protocol class reference from smithy_aws_core.aio.protocols to - select the protocol, e.g. protocol=AwsJson10ClientProtocol. For custom - protocols a protocol instance may also be passed. + select the protocol, e.g. protocol=AsyncAwsJson10ClientProtocol. For + custom protocols a protocol instance may also be passed. """ interceptors: list[_ServiceInterceptor] = field(default_factory=lambda: []) @@ -106,7 +123,7 @@ class AsyncPollyConfig(AsyncAwsConfig): execution of a request. """ - auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None = None + auth_schemes: dict[ShapeID, AsyncAuthScheme[Any, Any, Any, Any]] | None = None """A map of auth scheme ids to auth schemes.""" auth_scheme_resolver: AuthSchemeResolver | None = None @@ -116,7 +133,7 @@ class AsyncPollyConfig(AsyncAwsConfig): """ aws_credentials_identity_resolver: ( - IdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None + AsyncIdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None ) = None """Resolves AWS Credentials. Required for operations that use Sigv4 Auth.""" @@ -155,24 +172,24 @@ class AsyncPollyConfig(AsyncAwsConfig): **AsyncAwsConfig._FIELDS, "endpoint_uri": FieldSpec(default=None, resolver=EndpointUriResolver("polly")), "endpoint_resolver": FieldSpec( - default_factory=lambda: StandardRegionalEndpointsResolver( + default_factory=lambda: AsyncStandardRegionalEndpointsResolver( endpoint_prefix="polly" ) ), "protocol": FieldSpec( - default_factory=lambda: RestJsonClientProtocol(_PROTOCOL_SETTINGS), + default_factory=lambda: AsyncRestJsonClientProtocol(_PROTOCOL_SETTINGS), converter=lambda p: p(_PROTOCOL_SETTINGS) if isinstance(p, type) else p, ), "auth_schemes": FieldSpec( default_factory=lambda: { - ShapeID("aws.auth#sigv4"): SigV4AuthScheme(service="polly") + ShapeID("aws.auth#sigv4"): AsyncSigV4AuthScheme(service="polly") } ), "auth_scheme_resolver": FieldSpec(default_factory=HTTPAuthSchemeResolver), "transport": FieldSpec(default_factory=lambda: AIOHTTPClient()), } - def set_auth_scheme(self, scheme: AuthScheme[Any, Any, Any, Any]) -> None: + def set_auth_scheme(self, scheme: AsyncAuthScheme[Any, Any, Any, Any]) -> None: """ Set an auth scheme implementation using its scheme ID. :param scheme: The auth scheme to add or replace. @@ -186,7 +203,7 @@ async def resolve( # pyright: ignore[reportIncompatibleMethodOverride] cls, *, profile: str | None = None, - fs: FileSystem | None = None, + fs: AsyncFileSystem | None = None, config_file_path: str | None = None, credentials_file_path: str | None = None, **overrides: Unpack[_AsyncPollyConfigOverrides], diff --git a/clients/aws-sdk-polly/src/aws_sdk_polly/models.py b/clients/aws-sdk-polly/src/aws_sdk_polly/models.py index 10fb47e4..27089155 100644 --- a/clients/aws-sdk-polly/src/aws_sdk_polly/models.py +++ b/clients/aws-sdk-polly/src/aws_sdk_polly/models.py @@ -1,95 +1,51 @@ # Code generated by smithy-python-codegen DO NOT EDIT. -from base64 import b64decode -from dataclasses import dataclass, field -from datetime import datetime -from enum import StrEnum -import logging -from typing import Any, Literal, Self, Union +from __future__ import annotations -from smithy_core.aio.interfaces import StreamingBlob -from smithy_core.deserializers import ShapeDeserializer -from smithy_core.documents import TypeRegistry -from smithy_core.exceptions import ModeledError, SerializationError -from smithy_core.response import EMPTY_RESPONSE_METADATA, ResponseMetadata -from smithy_core.schemas import APIOperation, Schema -from smithy_core.serializers import ShapeSerializer +from ._private import schemas as _schemas +from smithy_core._dynamic_models import ModelRegistry +from smithy_core.exceptions import ModeledError +from smithy_core.schemas import APIOperation from smithy_core.shapes import ShapeID -from smithy_core.types import UnknownEnumMixin from ._private.schemas import ( - AUDIO_EVENT as _SCHEMA_AUDIO_EVENT, - CLOSE_STREAM_EVENT as _SCHEMA_CLOSE_STREAM_EVENT, DELETE_LEXICON as _SCHEMA_DELETE_LEXICON, - DELETE_LEXICON_INPUT as _SCHEMA_DELETE_LEXICON_INPUT, - DELETE_LEXICON_OUTPUT as _SCHEMA_DELETE_LEXICON_OUTPUT, DESCRIBE_VOICES as _SCHEMA_DESCRIBE_VOICES, - DESCRIBE_VOICES_INPUT as _SCHEMA_DESCRIBE_VOICES_INPUT, - DESCRIBE_VOICES_OUTPUT as _SCHEMA_DESCRIBE_VOICES_OUTPUT, - ENGINE_NOT_SUPPORTED_EXCEPTION as _SCHEMA_ENGINE_NOT_SUPPORTED_EXCEPTION, - FLUSH_STREAM_CONFIGURATION as _SCHEMA_FLUSH_STREAM_CONFIGURATION, GET_LEXICON as _SCHEMA_GET_LEXICON, - GET_LEXICON_INPUT as _SCHEMA_GET_LEXICON_INPUT, - GET_LEXICON_OUTPUT as _SCHEMA_GET_LEXICON_OUTPUT, GET_SPEECH_SYNTHESIS_TASK as _SCHEMA_GET_SPEECH_SYNTHESIS_TASK, - GET_SPEECH_SYNTHESIS_TASK_INPUT as _SCHEMA_GET_SPEECH_SYNTHESIS_TASK_INPUT, - GET_SPEECH_SYNTHESIS_TASK_OUTPUT as _SCHEMA_GET_SPEECH_SYNTHESIS_TASK_OUTPUT, - INVALID_LEXICON_EXCEPTION as _SCHEMA_INVALID_LEXICON_EXCEPTION, - INVALID_NEXT_TOKEN_EXCEPTION as _SCHEMA_INVALID_NEXT_TOKEN_EXCEPTION, - INVALID_S3_BUCKET_EXCEPTION as _SCHEMA_INVALID_S3_BUCKET_EXCEPTION, - INVALID_S3_KEY_EXCEPTION as _SCHEMA_INVALID_S3_KEY_EXCEPTION, - INVALID_SAMPLE_RATE_EXCEPTION as _SCHEMA_INVALID_SAMPLE_RATE_EXCEPTION, - INVALID_SNS_TOPIC_ARN_EXCEPTION as _SCHEMA_INVALID_SNS_TOPIC_ARN_EXCEPTION, - INVALID_SSML_EXCEPTION as _SCHEMA_INVALID_SSML_EXCEPTION, - INVALID_TASK_ID_EXCEPTION as _SCHEMA_INVALID_TASK_ID_EXCEPTION, - LANGUAGE_NOT_SUPPORTED_EXCEPTION as _SCHEMA_LANGUAGE_NOT_SUPPORTED_EXCEPTION, - LEXICON as _SCHEMA_LEXICON, - LEXICON_ATTRIBUTES as _SCHEMA_LEXICON_ATTRIBUTES, - LEXICON_DESCRIPTION as _SCHEMA_LEXICON_DESCRIPTION, - LEXICON_NOT_FOUND_EXCEPTION as _SCHEMA_LEXICON_NOT_FOUND_EXCEPTION, - LEXICON_SIZE_EXCEEDED_EXCEPTION as _SCHEMA_LEXICON_SIZE_EXCEEDED_EXCEPTION, LIST_LEXICONS as _SCHEMA_LIST_LEXICONS, - LIST_LEXICONS_INPUT as _SCHEMA_LIST_LEXICONS_INPUT, - LIST_LEXICONS_OUTPUT as _SCHEMA_LIST_LEXICONS_OUTPUT, LIST_SPEECH_SYNTHESIS_TASKS as _SCHEMA_LIST_SPEECH_SYNTHESIS_TASKS, - LIST_SPEECH_SYNTHESIS_TASKS_INPUT as _SCHEMA_LIST_SPEECH_SYNTHESIS_TASKS_INPUT, - LIST_SPEECH_SYNTHESIS_TASKS_OUTPUT as _SCHEMA_LIST_SPEECH_SYNTHESIS_TASKS_OUTPUT, - MARKS_NOT_SUPPORTED_FOR_FORMAT_EXCEPTION as _SCHEMA_MARKS_NOT_SUPPORTED_FOR_FORMAT_EXCEPTION, - MAX_LEXEME_LENGTH_EXCEEDED_EXCEPTION as _SCHEMA_MAX_LEXEME_LENGTH_EXCEEDED_EXCEPTION, - MAX_LEXICONS_NUMBER_EXCEEDED_EXCEPTION as _SCHEMA_MAX_LEXICONS_NUMBER_EXCEEDED_EXCEPTION, PUT_LEXICON as _SCHEMA_PUT_LEXICON, - PUT_LEXICON_INPUT as _SCHEMA_PUT_LEXICON_INPUT, - PUT_LEXICON_OUTPUT as _SCHEMA_PUT_LEXICON_OUTPUT, - SERVICE_FAILURE_EXCEPTION as _SCHEMA_SERVICE_FAILURE_EXCEPTION, - SERVICE_QUOTA_EXCEEDED_EXCEPTION as _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - SSML_MARKS_NOT_SUPPORTED_FOR_TEXT_TYPE_EXCEPTION as _SCHEMA_SSML_MARKS_NOT_SUPPORTED_FOR_TEXT_TYPE_EXCEPTION, START_SPEECH_SYNTHESIS_STREAM as _SCHEMA_START_SPEECH_SYNTHESIS_STREAM, - START_SPEECH_SYNTHESIS_STREAM_ACTION_STREAM as _SCHEMA_START_SPEECH_SYNTHESIS_STREAM_ACTION_STREAM, - START_SPEECH_SYNTHESIS_STREAM_EVENT_STREAM as _SCHEMA_START_SPEECH_SYNTHESIS_STREAM_EVENT_STREAM, - START_SPEECH_SYNTHESIS_STREAM_INPUT as _SCHEMA_START_SPEECH_SYNTHESIS_STREAM_INPUT, - START_SPEECH_SYNTHESIS_STREAM_OUTPUT as _SCHEMA_START_SPEECH_SYNTHESIS_STREAM_OUTPUT, START_SPEECH_SYNTHESIS_TASK as _SCHEMA_START_SPEECH_SYNTHESIS_TASK, - START_SPEECH_SYNTHESIS_TASK_INPUT as _SCHEMA_START_SPEECH_SYNTHESIS_TASK_INPUT, - START_SPEECH_SYNTHESIS_TASK_OUTPUT as _SCHEMA_START_SPEECH_SYNTHESIS_TASK_OUTPUT, - STREAM_CLOSED_EVENT as _SCHEMA_STREAM_CLOSED_EVENT, - SYNTHESIS_TASK as _SCHEMA_SYNTHESIS_TASK, - SYNTHESIS_TASK_NOT_FOUND_EXCEPTION as _SCHEMA_SYNTHESIS_TASK_NOT_FOUND_EXCEPTION, SYNTHESIZE_SPEECH as _SCHEMA_SYNTHESIZE_SPEECH, - SYNTHESIZE_SPEECH_INPUT as _SCHEMA_SYNTHESIZE_SPEECH_INPUT, - SYNTHESIZE_SPEECH_OUTPUT as _SCHEMA_SYNTHESIZE_SPEECH_OUTPUT, - TEXT_EVENT as _SCHEMA_TEXT_EVENT, - TEXT_LENGTH_EXCEEDED_EXCEPTION as _SCHEMA_TEXT_LENGTH_EXCEEDED_EXCEPTION, - THROTTLING_EXCEPTION as _SCHEMA_THROTTLING_EXCEPTION, - THROTTLING_REASON as _SCHEMA_THROTTLING_REASON, - UNSUPPORTED_PLS_ALPHABET_EXCEPTION as _SCHEMA_UNSUPPORTED_PLS_ALPHABET_EXCEPTION, - UNSUPPORTED_PLS_LANGUAGE_EXCEPTION as _SCHEMA_UNSUPPORTED_PLS_LANGUAGE_EXCEPTION, - VALIDATION_EXCEPTION as _SCHEMA_VALIDATION_EXCEPTION, - VALIDATION_EXCEPTION_FIELD as _SCHEMA_VALIDATION_EXCEPTION_FIELD, - VOICE as _SCHEMA_VOICE, ) - -logger = logging.getLogger(__name__) +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .models import ( + DeleteLexiconInput, + DeleteLexiconOutput, + DescribeVoicesInput, + DescribeVoicesOutput, + GetLexiconInput, + GetLexiconOutput, + GetSpeechSynthesisTaskInput, + GetSpeechSynthesisTaskOutput, + ListLexiconsInput, + ListLexiconsOutput, + ListSpeechSynthesisTasksInput, + ListSpeechSynthesisTasksOutput, + PutLexiconInput, + PutLexiconOutput, + StartSpeechSynthesisStreamInput, + StartSpeechSynthesisStreamOutput, + StartSpeechSynthesisTaskInput, + StartSpeechSynthesisTaskOutput, + SynthesizeSpeechInput, + SynthesizeSpeechOutput, + ) class ServiceError(ModeledError): @@ -101,4782 +57,302 @@ class ServiceError(ModeledError): """ -@dataclass(kw_only=True) -class AudioEvent: - """Contains a chunk of synthesized audio data.""" - - audio_chunk: bytes | None = None - """ - A chunk of synthesized audio data encoded in the format specified by the - `OutputFormat` parameter. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUDIO_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.audio_chunk is not None: - serializer.write_blob( - _SCHEMA_AUDIO_EVENT.members["AudioChunk"], self.audio_chunk - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["audio_chunk"] = de.read_blob( - _SCHEMA_AUDIO_EVENT.members["AudioChunk"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AUDIO_EVENT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CloseStreamEvent: - """ - Indicates the end of the input stream. After sending this event, the - input stream will be closed and all audio will be returned. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CLOSE_STREAM_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CLOSE_STREAM_EVENT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteLexiconInput: - """Dataclass for DeleteLexiconInput structure.""" - - name: str | None = None - """ - The name of the lexicon to delete. Must be an existing lexicon in the - region. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_LEXICON_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_DELETE_LEXICON_INPUT.members["Name"], self.name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_DELETE_LEXICON_INPUT.members["Name"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_LEXICON_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteLexiconOutput: - """Dataclass for DeleteLexiconOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_LEXICON_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_LEXICON_OUTPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class LexiconNotFoundException(ServiceError): - """ - Amazon Polly can't find the specified lexicon. This could be caused by - a lexicon that is missing, its name is misspelled or specifying a - lexicon that is in a different region. - - Verify that the lexicon exists, is in the region (see ListLexicons) and - that you spelled its name is spelled correctly. Then try again. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LEXICON_NOT_FOUND_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_LEXICON_NOT_FOUND_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_LEXICON_NOT_FOUND_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LEXICON_NOT_FOUND_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ServiceFailureException(ServiceError): - """An unknown condition has caused a service failure.""" - - fault: Literal["client", "server"] | None = "server" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SERVICE_FAILURE_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_SERVICE_FAILURE_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_SERVICE_FAILURE_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SERVICE_FAILURE_EXCEPTION, consumer=_consumer) - return kwargs - - -DELETE_LEXICON = APIOperation( - input=DeleteLexiconInput, - output=DeleteLexiconOutput, - schema=_SCHEMA_DELETE_LEXICON, - input_schema=_SCHEMA_DELETE_LEXICON_INPUT, - output_schema=_SCHEMA_DELETE_LEXICON_OUTPUT, - error_registry=TypeRegistry( +_registry = ModelRegistry( + _schemas, + renames={}, + index={ + "AudioEvent": "AUDIO_EVENT", + "CloseStreamEvent": "CLOSE_STREAM_EVENT", + "DeleteLexiconInput": "DELETE_LEXICON_INPUT", + "DeleteLexiconOutput": "DELETE_LEXICON_OUTPUT", + "DescribeVoicesInput": "DESCRIBE_VOICES_INPUT", + "DescribeVoicesOutput": "DESCRIBE_VOICES_OUTPUT", + "Engine": "ENGINE", + "EngineNotSupportedException": "ENGINE_NOT_SUPPORTED_EXCEPTION", + "FlushStreamConfiguration": "FLUSH_STREAM_CONFIGURATION", + "Gender": "GENDER", + "GetLexiconInput": "GET_LEXICON_INPUT", + "GetLexiconOutput": "GET_LEXICON_OUTPUT", + "GetSpeechSynthesisTaskInput": "GET_SPEECH_SYNTHESIS_TASK_INPUT", + "GetSpeechSynthesisTaskOutput": "GET_SPEECH_SYNTHESIS_TASK_OUTPUT", + "InvalidLexiconException": "INVALID_LEXICON_EXCEPTION", + "InvalidNextTokenException": "INVALID_NEXT_TOKEN_EXCEPTION", + "InvalidS3BucketException": "INVALID_S3_BUCKET_EXCEPTION", + "InvalidS3KeyException": "INVALID_S3_KEY_EXCEPTION", + "InvalidSampleRateException": "INVALID_SAMPLE_RATE_EXCEPTION", + "InvalidSnsTopicArnException": "INVALID_SNS_TOPIC_ARN_EXCEPTION", + "InvalidSsmlException": "INVALID_SSML_EXCEPTION", + "InvalidTaskIdException": "INVALID_TASK_ID_EXCEPTION", + "LanguageCode": "LANGUAGE_CODE", + "LanguageNotSupportedException": "LANGUAGE_NOT_SUPPORTED_EXCEPTION", + "Lexicon": "LEXICON", + "LexiconAttributes": "LEXICON_ATTRIBUTES", + "LexiconDescription": "LEXICON_DESCRIPTION", + "LexiconNotFoundException": "LEXICON_NOT_FOUND_EXCEPTION", + "LexiconSizeExceededException": "LEXICON_SIZE_EXCEEDED_EXCEPTION", + "ListLexiconsInput": "LIST_LEXICONS_INPUT", + "ListLexiconsOutput": "LIST_LEXICONS_OUTPUT", + "ListSpeechSynthesisTasksInput": "LIST_SPEECH_SYNTHESIS_TASKS_INPUT", + "ListSpeechSynthesisTasksOutput": "LIST_SPEECH_SYNTHESIS_TASKS_OUTPUT", + "MarksNotSupportedForFormatException": "MARKS_NOT_SUPPORTED_FOR_FORMAT_EXCEPTION", + "MaxLexemeLengthExceededException": "MAX_LEXEME_LENGTH_EXCEEDED_EXCEPTION", + "MaxLexiconsNumberExceededException": "MAX_LEXICONS_NUMBER_EXCEEDED_EXCEPTION", + "OutputFormat": "OUTPUT_FORMAT", + "PutLexiconInput": "PUT_LEXICON_INPUT", + "PutLexiconOutput": "PUT_LEXICON_OUTPUT", + "QuotaCode": "QUOTA_CODE", + "ServiceCode": "SERVICE_CODE", + "ServiceFailureException": "SERVICE_FAILURE_EXCEPTION", + "ServiceQuotaExceededException": "SERVICE_QUOTA_EXCEEDED_EXCEPTION", + "SpeechMarkType": "SPEECH_MARK_TYPE", + "SsmlMarksNotSupportedForTextTypeException": "SSML_MARKS_NOT_SUPPORTED_FOR_TEXT_TYPE_EXCEPTION", + "StartSpeechSynthesisStreamActionStream": "START_SPEECH_SYNTHESIS_STREAM_ACTION_STREAM", + "StartSpeechSynthesisStreamActionStreamTextEvent": "START_SPEECH_SYNTHESIS_STREAM_ACTION_STREAM", + "StartSpeechSynthesisStreamActionStreamCloseStreamEvent": "START_SPEECH_SYNTHESIS_STREAM_ACTION_STREAM", + "StartSpeechSynthesisStreamActionStreamUnknown": "START_SPEECH_SYNTHESIS_STREAM_ACTION_STREAM", + "StartSpeechSynthesisStreamEventStream": "START_SPEECH_SYNTHESIS_STREAM_EVENT_STREAM", + "StartSpeechSynthesisStreamEventStreamAudioEvent": "START_SPEECH_SYNTHESIS_STREAM_EVENT_STREAM", + "StartSpeechSynthesisStreamEventStreamStreamClosedEvent": "START_SPEECH_SYNTHESIS_STREAM_EVENT_STREAM", + "StartSpeechSynthesisStreamEventStreamValidationException": "START_SPEECH_SYNTHESIS_STREAM_EVENT_STREAM", + "StartSpeechSynthesisStreamEventStreamServiceQuotaExceededException": "START_SPEECH_SYNTHESIS_STREAM_EVENT_STREAM", + "StartSpeechSynthesisStreamEventStreamServiceFailureException": "START_SPEECH_SYNTHESIS_STREAM_EVENT_STREAM", + "StartSpeechSynthesisStreamEventStreamThrottlingException": "START_SPEECH_SYNTHESIS_STREAM_EVENT_STREAM", + "StartSpeechSynthesisStreamEventStreamUnknown": "START_SPEECH_SYNTHESIS_STREAM_EVENT_STREAM", + "StartSpeechSynthesisStreamInput": "START_SPEECH_SYNTHESIS_STREAM_INPUT", + "StartSpeechSynthesisStreamOutput": "START_SPEECH_SYNTHESIS_STREAM_OUTPUT", + "StartSpeechSynthesisTaskInput": "START_SPEECH_SYNTHESIS_TASK_INPUT", + "StartSpeechSynthesisTaskOutput": "START_SPEECH_SYNTHESIS_TASK_OUTPUT", + "StreamClosedEvent": "STREAM_CLOSED_EVENT", + "SynthesisTask": "SYNTHESIS_TASK", + "SynthesisTaskNotFoundException": "SYNTHESIS_TASK_NOT_FOUND_EXCEPTION", + "SynthesizeSpeechInput": "SYNTHESIZE_SPEECH_INPUT", + "SynthesizeSpeechOutput": "SYNTHESIZE_SPEECH_OUTPUT", + "TaskStatus": "TASK_STATUS", + "TextEvent": "TEXT_EVENT", + "TextLengthExceededException": "TEXT_LENGTH_EXCEEDED_EXCEPTION", + "TextType": "TEXT_TYPE", + "ThrottlingException": "THROTTLING_EXCEPTION", + "ThrottlingReason": "THROTTLING_REASON", + "UnsupportedPlsAlphabetException": "UNSUPPORTED_PLS_ALPHABET_EXCEPTION", + "UnsupportedPlsLanguageException": "UNSUPPORTED_PLS_LANGUAGE_EXCEPTION", + "ValidationException": "VALIDATION_EXCEPTION", + "ValidationExceptionField": "VALIDATION_EXCEPTION_FIELD", + "ValidationExceptionReason": "VALIDATION_EXCEPTION_REASON", + "Voice": "VOICE", + "VoiceId": "VOICE_ID", + }, + shape_names=frozenset( { - ShapeID( - "com.amazonaws.polly#LexiconNotFoundException" - ): LexiconNotFoundException, - ShapeID( - "com.amazonaws.polly#ServiceFailureException" - ): ServiceFailureException, + "AudioEvent", + "CloseStreamEvent", + "DeleteLexiconInput", + "DeleteLexiconOutput", + "DescribeVoicesInput", + "DescribeVoicesOutput", + "Engine", + "EngineNotSupportedException", + "FlushStreamConfiguration", + "Gender", + "GetLexiconInput", + "GetLexiconOutput", + "GetSpeechSynthesisTaskInput", + "GetSpeechSynthesisTaskOutput", + "InvalidLexiconException", + "InvalidNextTokenException", + "InvalidS3BucketException", + "InvalidS3KeyException", + "InvalidSampleRateException", + "InvalidSnsTopicArnException", + "InvalidSsmlException", + "InvalidTaskIdException", + "LanguageCode", + "LanguageNotSupportedException", + "Lexicon", + "LexiconAttributes", + "LexiconDescription", + "LexiconNotFoundException", + "LexiconSizeExceededException", + "ListLexiconsInput", + "ListLexiconsOutput", + "ListSpeechSynthesisTasksInput", + "ListSpeechSynthesisTasksOutput", + "MarksNotSupportedForFormatException", + "MaxLexemeLengthExceededException", + "MaxLexiconsNumberExceededException", + "OutputFormat", + "PutLexiconInput", + "PutLexiconOutput", + "QuotaCode", + "ServiceCode", + "ServiceFailureException", + "ServiceQuotaExceededException", + "SpeechMarkType", + "SsmlMarksNotSupportedForTextTypeException", + "StartSpeechSynthesisStreamActionStream", + "StartSpeechSynthesisStreamEventStream", + "StartSpeechSynthesisStreamInput", + "StartSpeechSynthesisStreamOutput", + "StartSpeechSynthesisTaskInput", + "StartSpeechSynthesisTaskOutput", + "StreamClosedEvent", + "SynthesisTask", + "SynthesisTaskNotFoundException", + "SynthesizeSpeechInput", + "SynthesizeSpeechOutput", + "TaskStatus", + "TextEvent", + "TextLengthExceededException", + "TextType", + "ThrottlingException", + "ThrottlingReason", + "UnsupportedPlsAlphabetException", + "UnsupportedPlsLanguageException", + "ValidationException", + "ValidationExceptionField", + "ValidationExceptionReason", + "Voice", + "VoiceId", } ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_LEXICON_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_FAILURE_EXCEPTION, - ], + service_error="ServiceError", ) -class Engine(UnknownEnumMixin, StrEnum): - STANDARD = "standard" - NEURAL = "neural" - LONG_FORM = "long-form" - GENERATIVE = "generative" - - -class LanguageCode(UnknownEnumMixin, StrEnum): - ARB = "arb" - CMN_CN = "cmn-CN" - CY_GB = "cy-GB" - DA_DK = "da-DK" - DE_DE = "de-DE" - EN_AU = "en-AU" - EN_GB = "en-GB" - EN_GB_WLS = "en-GB-WLS" - EN_IN = "en-IN" - EN_US = "en-US" - ES_ES = "es-ES" - ES_MX = "es-MX" - ES_US = "es-US" - FR_CA = "fr-CA" - FR_FR = "fr-FR" - IS_IS = "is-IS" - IT_IT = "it-IT" - JA_JP = "ja-JP" - HI_IN = "hi-IN" - KO_KR = "ko-KR" - NB_NO = "nb-NO" - NL_NL = "nl-NL" - PL_PL = "pl-PL" - PT_BR = "pt-BR" - PT_PT = "pt-PT" - RO_RO = "ro-RO" - RU_RU = "ru-RU" - SV_SE = "sv-SE" - TR_TR = "tr-TR" - EN_NZ = "en-NZ" - EN_ZA = "en-ZA" - CA_ES = "ca-ES" - DE_AT = "de-AT" - YUE_CN = "yue-CN" - AR_AE = "ar-AE" - FI_FI = "fi-FI" - EN_IE = "en-IE" - NL_BE = "nl-BE" - FR_BE = "fr-BE" - CS_CZ = "cs-CZ" - DE_CH = "de-CH" - EN_SG = "en-SG" - - -@dataclass(kw_only=True) -class DescribeVoicesInput: - """Dataclass for DescribeVoicesInput structure.""" - - engine: str | None = None - """ - Specifies the engine (`standard`, `neural`, `long-form` or `generative`) - used by Amazon Polly when processing input text for speech synthesis. - """ - - language_code: str | None = None - """ - The language identification tag (ISO 639 code for the language name-ISO - 3166 country code) for filtering the list of voices returned. If you - don't specify this optional parameter, all available voices are - returned. - """ - - include_additional_language_codes: bool = False - """ - Boolean value indicating whether to return any bilingual voices that use - the specified language as an additional language. For instance, if you - request all languages that use US English (es-US), and there is an - Italian voice that speaks both Italian (it-IT) and US English, that - voice will be included if you specify `yes` but not if you specify `no`. - """ - - next_token: str | None = None - """ - An opaque pagination token returned from the previous `DescribeVoices` - operation. If present, this indicates where to continue the listing. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DESCRIBE_VOICES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.engine is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_VOICES_INPUT.members["Engine"], self.engine - ) - - if self.language_code is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_VOICES_INPUT.members["LanguageCode"], - self.language_code, - ) - - if self.include_additional_language_codes is not None: - serializer.write_boolean( - _SCHEMA_DESCRIBE_VOICES_INPUT.members["IncludeAdditionalLanguageCodes"], - self.include_additional_language_codes, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_VOICES_INPUT.members["NextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["engine"] = Engine( - de.read_string(_SCHEMA_DESCRIBE_VOICES_INPUT.members["Engine"]) - ) - - case 1: - kwargs["language_code"] = LanguageCode( - de.read_string( - _SCHEMA_DESCRIBE_VOICES_INPUT.members["LanguageCode"] - ) - ) - - case 2: - kwargs["include_additional_language_codes"] = de.read_boolean( - _SCHEMA_DESCRIBE_VOICES_INPUT.members[ - "IncludeAdditionalLanguageCodes" - ] - ) - - case 3: - kwargs["next_token"] = de.read_string( - _SCHEMA_DESCRIBE_VOICES_INPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DESCRIBE_VOICES_INPUT, consumer=_consumer) - return kwargs - - -def _serialize_language_code_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_language_code_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(LanguageCode(d.read_string(member_schema))) - - deserializer.read_list(schema, _read_value) - return result - - -class Gender(UnknownEnumMixin, StrEnum): - FEMALE = "Female" - MALE = "Male" - - -class VoiceId(UnknownEnumMixin, StrEnum): - ADITI = "Aditi" - AMY = "Amy" - ASTRID = "Astrid" - BIANCA = "Bianca" - BRIAN = "Brian" - CAMILA = "Camila" - CARLA = "Carla" - CARMEN = "Carmen" - CELINE = "Celine" - CHANTAL = "Chantal" - CONCHITA = "Conchita" - CRISTIANO = "Cristiano" - DORA = "Dora" - EMMA = "Emma" - ENRIQUE = "Enrique" - EWA = "Ewa" - FILIZ = "Filiz" - GABRIELLE = "Gabrielle" - GERAINT = "Geraint" - GIORGIO = "Giorgio" - GWYNETH = "Gwyneth" - HANS = "Hans" - INES = "Ines" - IVY = "Ivy" - JACEK = "Jacek" - JAN = "Jan" - JOANNA = "Joanna" - JOEY = "Joey" - JUSTIN = "Justin" - KARL = "Karl" - KENDRA = "Kendra" - KEVIN = "Kevin" - KIMBERLY = "Kimberly" - LEA = "Lea" - LIV = "Liv" - LOTTE = "Lotte" - LUCIA = "Lucia" - LUPE = "Lupe" - MADS = "Mads" - MAJA = "Maja" - MARLENE = "Marlene" - MATHIEU = "Mathieu" - MATTHEW = "Matthew" - MAXIM = "Maxim" - MIA = "Mia" - MIGUEL = "Miguel" - MIZUKI = "Mizuki" - NAJA = "Naja" - NICOLE = "Nicole" - OLIVIA = "Olivia" - PENELOPE = "Penelope" - RAVEENA = "Raveena" - RICARDO = "Ricardo" - RUBEN = "Ruben" - RUSSELL = "Russell" - SALLI = "Salli" - SEOYEON = "Seoyeon" - TAKUMI = "Takumi" - TATYANA = "Tatyana" - VICKI = "Vicki" - VITORIA = "Vitoria" - ZEINA = "Zeina" - ZHIYU = "Zhiyu" - ARIA = "Aria" - AYANDA = "Ayanda" - ARLET = "Arlet" - HANNAH = "Hannah" - ARTHUR = "Arthur" - DANIEL = "Daniel" - LIAM = "Liam" - PEDRO = "Pedro" - KAJAL = "Kajal" - HIUJIN = "Hiujin" - LAURA = "Laura" - ELIN = "Elin" - IDA = "Ida" - SUVI = "Suvi" - OLA = "Ola" - HALA = "Hala" - ANDRES = "Andres" - SERGIO = "Sergio" - REMI = "Remi" - ADRIANO = "Adriano" - THIAGO = "Thiago" - RUTH = "Ruth" - STEPHEN = "Stephen" - KAZUHA = "Kazuha" - TOMOKO = "Tomoko" - NIAMH = "Niamh" - SOFIE = "Sofie" - LISA = "Lisa" - ISABELLE = "Isabelle" - ZAYD = "Zayd" - DANIELLE = "Danielle" - GREGORY = "Gregory" - BURCU = "Burcu" - JITKA = "Jitka" - SABRINA = "Sabrina" - JASMINE = "Jasmine" - JIHYE = "Jihye" - AMBRE = "Ambre" - BEATRICE = "Beatrice" - FLORIAN = "Florian" - LENNART = "Lennart" - LORENZO = "Lorenzo" - TIFFANY = "Tiffany" - - -def _serialize_engine_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_engine_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Engine(d.read_string(member_schema))) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class Voice: - """Description of the voice.""" - - gender: str | None = None - """Gender of the voice.""" - - id: str | None = None - """ - Amazon Polly assigned voice ID. This is the ID that you specify when - calling the `SynthesizeSpeech` operation. - """ - - language_code: str | None = None - """Language code of the voice.""" - - language_name: str | None = None - """Human readable name of the language in English.""" +def __getattr__(name: str): + return _registry.build(name) - name: str | None = None - """ - Name of the voice (for example, Salli, Kendra, etc.). This provides a - human readable voice name that you might display in your application. - """ - - additional_language_codes: list[str] | None = None - """ - Additional codes for languages available for the specified voice in - addition to its default language. - - For example, the default language for Aditi is Indian English (en-IN) - because it was first used for that language. Since Aditi is bilingual - and fluent in both Indian English and Hindi, this parameter would show - the code `hi-IN`. - """ - - supported_engines: list[str] | None = None - """ - Specifies which engines (`standard`, `neural`, `long-form` or - `generative`) are supported by a given voice. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VOICE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.gender is not None: - serializer.write_string(_SCHEMA_VOICE.members["Gender"], self.gender) - - if self.id is not None: - serializer.write_string(_SCHEMA_VOICE.members["Id"], self.id) - - if self.language_code is not None: - serializer.write_string( - _SCHEMA_VOICE.members["LanguageCode"], self.language_code - ) - - if self.language_name is not None: - serializer.write_string( - _SCHEMA_VOICE.members["LanguageName"], self.language_name - ) - - if self.name is not None: - serializer.write_string(_SCHEMA_VOICE.members["Name"], self.name) - - if self.additional_language_codes is not None: - _serialize_language_code_list( - serializer, - _SCHEMA_VOICE.members["AdditionalLanguageCodes"], - self.additional_language_codes, - ) - - if self.supported_engines is not None: - _serialize_engine_list( - serializer, - _SCHEMA_VOICE.members["SupportedEngines"], - self.supported_engines, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["gender"] = Gender( - de.read_string(_SCHEMA_VOICE.members["Gender"]) - ) - - case 1: - kwargs["id"] = VoiceId(de.read_string(_SCHEMA_VOICE.members["Id"])) - - case 2: - kwargs["language_code"] = LanguageCode( - de.read_string(_SCHEMA_VOICE.members["LanguageCode"]) - ) - - case 3: - kwargs["language_name"] = de.read_string( - _SCHEMA_VOICE.members["LanguageName"] - ) - - case 4: - kwargs["name"] = de.read_string(_SCHEMA_VOICE.members["Name"]) - - case 5: - kwargs["additional_language_codes"] = ( - _deserialize_language_code_list( - de, _SCHEMA_VOICE.members["AdditionalLanguageCodes"] - ) - ) - - case 6: - kwargs["supported_engines"] = _deserialize_engine_list( - de, _SCHEMA_VOICE.members["SupportedEngines"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VOICE, consumer=_consumer) - return kwargs - - -def _serialize_voice_list( - serializer: ShapeSerializer, schema: Schema, value: list[Voice] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_voice_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Voice]: - result: list[Voice] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Voice.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class DescribeVoicesOutput: - """Dataclass for DescribeVoicesOutput structure.""" - - voices: list[Voice] | None = None - """A list of voices with their properties.""" - - next_token: str | None = None - """ - The pagination token to use in the next request to continue the listing - of voices. `NextToken` is returned only if the response is truncated. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DESCRIBE_VOICES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.voices is not None: - _serialize_voice_list( - serializer, - _SCHEMA_DESCRIBE_VOICES_OUTPUT.members["Voices"], - self.voices, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_VOICES_OUTPUT.members["NextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["voices"] = _deserialize_voice_list( - de, _SCHEMA_DESCRIBE_VOICES_OUTPUT.members["Voices"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_DESCRIBE_VOICES_OUTPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DESCRIBE_VOICES_OUTPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class InvalidNextTokenException(ServiceError): - """ - The NextToken is invalid. Verify that it's spelled correctly, and then - try again. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_NEXT_TOKEN_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_NEXT_TOKEN_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_NEXT_TOKEN_EXCEPTION.members["message"] - ) - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVALID_NEXT_TOKEN_EXCEPTION, consumer=_consumer - ) - return kwargs - - -DESCRIBE_VOICES = APIOperation( - input=DescribeVoicesInput, - output=DescribeVoicesOutput, - schema=_SCHEMA_DESCRIBE_VOICES, - input_schema=_SCHEMA_DESCRIBE_VOICES_INPUT, - output_schema=_SCHEMA_DESCRIBE_VOICES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.polly#InvalidNextTokenException" - ): InvalidNextTokenException, - ShapeID( - "com.amazonaws.polly#ServiceFailureException" - ): ServiceFailureException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_NEXT_TOKEN_EXCEPTION, - _SCHEMA_SERVICE_FAILURE_EXCEPTION, +DELETE_LEXICON: APIOperation[DeleteLexiconInput, DeleteLexiconOutput] = APIOperation( + static_schema=_SCHEMA_DELETE_LEXICON, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.polly#LexiconNotFoundException"), + ShapeID("com.amazonaws.polly#ServiceFailureException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) +DESCRIBE_VOICES: APIOperation[DescribeVoicesInput, DescribeVoicesOutput] = APIOperation( + static_schema=_SCHEMA_DESCRIBE_VOICES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.polly#InvalidNextTokenException"), + ShapeID("com.amazonaws.polly#ServiceFailureException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -@dataclass(kw_only=True) -class EngineNotSupportedException(ServiceError): - """ - This engine is not compatible with the voice that you have designated. - Choose a new voice that is compatible with the engine or change the - engine and restart the operation. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ENGINE_NOT_SUPPORTED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_ENGINE_NOT_SUPPORTED_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_ENGINE_NOT_SUPPORTED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ENGINE_NOT_SUPPORTED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class FlushStreamConfiguration: - """ - Configuration that controls when synthesized audio data is sent on the - output stream. - """ - - force: bool = False - """ - Specifies whether to force the synthesis engine to immediately write - buffered audio data to the output stream. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FLUSH_STREAM_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_boolean( - _SCHEMA_FLUSH_STREAM_CONFIGURATION.members["Force"], self.force - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["force"] = de.read_boolean( - _SCHEMA_FLUSH_STREAM_CONFIGURATION.members["Force"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FLUSH_STREAM_CONFIGURATION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetLexiconInput: - """Dataclass for GetLexiconInput structure.""" - - name: str | None = None - """Name of the lexicon.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_LEXICON_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_GET_LEXICON_INPUT.members["Name"], self.name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) +GET_LEXICON: APIOperation[GetLexiconInput, GetLexiconOutput] = APIOperation( + static_schema=_SCHEMA_GET_LEXICON, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.polly#LexiconNotFoundException"), + ShapeID("com.amazonaws.polly#ServiceFailureException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +GET_SPEECH_SYNTHESIS_TASK: APIOperation[ + GetSpeechSynthesisTaskInput, GetSpeechSynthesisTaskOutput +] = APIOperation( + static_schema=_SCHEMA_GET_SPEECH_SYNTHESIS_TASK, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.polly#InvalidTaskIdException"), + ShapeID("com.amazonaws.polly#ServiceFailureException"), + ShapeID("com.amazonaws.polly#SynthesisTaskNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_GET_LEXICON_INPUT.members["Name"] - ) +LIST_LEXICONS: APIOperation[ListLexiconsInput, ListLexiconsOutput] = APIOperation( + static_schema=_SCHEMA_LIST_LEXICONS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.polly#InvalidNextTokenException"), + ShapeID("com.amazonaws.polly#ServiceFailureException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case _: - logger.debug("Unexpected member schema: %s", schema) +LIST_SPEECH_SYNTHESIS_TASKS: APIOperation[ + ListSpeechSynthesisTasksInput, ListSpeechSynthesisTasksOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_SPEECH_SYNTHESIS_TASKS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.polly#InvalidNextTokenException"), + ShapeID("com.amazonaws.polly#ServiceFailureException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - deserializer.read_struct(_SCHEMA_GET_LEXICON_INPUT, consumer=_consumer) - return kwargs +PUT_LEXICON: APIOperation[PutLexiconInput, PutLexiconOutput] = APIOperation( + static_schema=_SCHEMA_PUT_LEXICON, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.polly#InvalidLexiconException"), + ShapeID("com.amazonaws.polly#LexiconSizeExceededException"), + ShapeID("com.amazonaws.polly#MaxLexemeLengthExceededException"), + ShapeID("com.amazonaws.polly#MaxLexiconsNumberExceededException"), + ShapeID("com.amazonaws.polly#ServiceFailureException"), + ShapeID("com.amazonaws.polly#UnsupportedPlsAlphabetException"), + ShapeID("com.amazonaws.polly#UnsupportedPlsLanguageException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +START_SPEECH_SYNTHESIS_STREAM: APIOperation[ + StartSpeechSynthesisStreamInput, StartSpeechSynthesisStreamOutput +] = APIOperation( + static_schema=_SCHEMA_START_SPEECH_SYNTHESIS_STREAM, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.polly#ServiceFailureException"), + ShapeID("com.amazonaws.polly#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.polly#ThrottlingException"), + ShapeID("com.amazonaws.polly#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -@dataclass(kw_only=True) -class Lexicon: - """ - Provides lexicon name and lexicon content in string format. For more - information, see [Pronunciation Lexicon Specification (PLS) Version - 1.0](https://www.w3.org/TR/pronunciation-lexicon/). - """ +START_SPEECH_SYNTHESIS_TASK: APIOperation[ + StartSpeechSynthesisTaskInput, StartSpeechSynthesisTaskOutput +] = APIOperation( + static_schema=_SCHEMA_START_SPEECH_SYNTHESIS_TASK, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.polly#EngineNotSupportedException"), + ShapeID("com.amazonaws.polly#InvalidS3BucketException"), + ShapeID("com.amazonaws.polly#InvalidS3KeyException"), + ShapeID("com.amazonaws.polly#InvalidSampleRateException"), + ShapeID("com.amazonaws.polly#InvalidSnsTopicArnException"), + ShapeID("com.amazonaws.polly#InvalidSsmlException"), + ShapeID("com.amazonaws.polly#LanguageNotSupportedException"), + ShapeID("com.amazonaws.polly#LexiconNotFoundException"), + ShapeID("com.amazonaws.polly#MarksNotSupportedForFormatException"), + ShapeID("com.amazonaws.polly#ServiceFailureException"), + ShapeID("com.amazonaws.polly#SsmlMarksNotSupportedForTextTypeException"), + ShapeID("com.amazonaws.polly#TextLengthExceededException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - content: str | None = field(repr=False, default=None) - """ - Lexicon content in string format. The content of a lexicon must be in - PLS format. - """ - - name: str | None = None - """Name of the lexicon.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LEXICON, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.content is not None: - serializer.write_string(_SCHEMA_LEXICON.members["Content"], self.content) - - if self.name is not None: - serializer.write_string(_SCHEMA_LEXICON.members["Name"], self.name) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["content"] = de.read_string( - _SCHEMA_LEXICON.members["Content"] - ) - - case 1: - kwargs["name"] = de.read_string(_SCHEMA_LEXICON.members["Name"]) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LEXICON, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class LexiconAttributes: - """ - Contains metadata describing the lexicon such as the number of lexemes, - language code, and so on. For more information, see [Managing - Lexicons](https://docs.aws.amazon.com/polly/latest/dg/managing-lexicons.html). - """ - - alphabet: str | None = None - """ - Phonetic alphabet used in the lexicon. Valid values are `ipa` and - `x-sampa`. - """ - - language_code: str | None = None - """ - Language code that the lexicon applies to. A lexicon with a language - code such as \"en\" would be applied to all English languages (en-GB, - en-US, en-AUS, en-WLS, and so on. - """ - - last_modified: datetime | None = None - """Date lexicon was last modified (a timestamp value).""" - - lexicon_arn: str | None = None - """Amazon Resource Name (ARN) of the lexicon.""" - - lexemes_count: int = 0 - """Number of lexemes in the lexicon.""" - - size: int = 0 - """Total size of the lexicon, in characters.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LEXICON_ATTRIBUTES, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.alphabet is not None: - serializer.write_string( - _SCHEMA_LEXICON_ATTRIBUTES.members["Alphabet"], self.alphabet - ) - - if self.language_code is not None: - serializer.write_string( - _SCHEMA_LEXICON_ATTRIBUTES.members["LanguageCode"], self.language_code - ) - - if self.last_modified is not None: - serializer.write_timestamp( - _SCHEMA_LEXICON_ATTRIBUTES.members["LastModified"], self.last_modified - ) - - if self.lexicon_arn is not None: - serializer.write_string( - _SCHEMA_LEXICON_ATTRIBUTES.members["LexiconArn"], self.lexicon_arn - ) - - serializer.write_integer( - _SCHEMA_LEXICON_ATTRIBUTES.members["LexemesCount"], self.lexemes_count - ) - serializer.write_integer(_SCHEMA_LEXICON_ATTRIBUTES.members["Size"], self.size) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["alphabet"] = de.read_string( - _SCHEMA_LEXICON_ATTRIBUTES.members["Alphabet"] - ) - - case 1: - kwargs["language_code"] = LanguageCode( - de.read_string( - _SCHEMA_LEXICON_ATTRIBUTES.members["LanguageCode"] - ) - ) - - case 2: - kwargs["last_modified"] = de.read_timestamp( - _SCHEMA_LEXICON_ATTRIBUTES.members["LastModified"] - ) - - case 3: - kwargs["lexicon_arn"] = de.read_string( - _SCHEMA_LEXICON_ATTRIBUTES.members["LexiconArn"] - ) - - case 4: - kwargs["lexemes_count"] = de.read_integer( - _SCHEMA_LEXICON_ATTRIBUTES.members["LexemesCount"] - ) - - case 5: - kwargs["size"] = de.read_integer( - _SCHEMA_LEXICON_ATTRIBUTES.members["Size"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LEXICON_ATTRIBUTES, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetLexiconOutput: - """Dataclass for GetLexiconOutput structure.""" - - lexicon: Lexicon | None = None - """Lexicon object that provides name and the string content of the lexicon.""" - - lexicon_attributes: LexiconAttributes | None = None - """ - Metadata of the lexicon, including phonetic alphabetic used, language - code, lexicon ARN, number of lexemes defined in the lexicon, and size of - lexicon in bytes. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_LEXICON_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.lexicon is not None: - serializer.write_struct( - _SCHEMA_GET_LEXICON_OUTPUT.members["Lexicon"], self.lexicon - ) - - if self.lexicon_attributes is not None: - serializer.write_struct( - _SCHEMA_GET_LEXICON_OUTPUT.members["LexiconAttributes"], - self.lexicon_attributes, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["lexicon"] = Lexicon.deserialize(de) - - case 1: - kwargs["lexicon_attributes"] = LexiconAttributes.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_LEXICON_OUTPUT, consumer=_consumer) - return kwargs - - -GET_LEXICON = APIOperation( - input=GetLexiconInput, - output=GetLexiconOutput, - schema=_SCHEMA_GET_LEXICON, - input_schema=_SCHEMA_GET_LEXICON_INPUT, - output_schema=_SCHEMA_GET_LEXICON_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.polly#LexiconNotFoundException" - ): LexiconNotFoundException, - ShapeID( - "com.amazonaws.polly#ServiceFailureException" - ): ServiceFailureException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_LEXICON_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_FAILURE_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetSpeechSynthesisTaskInput: - """Dataclass for GetSpeechSynthesisTaskInput structure.""" - - task_id: str | None = None - """The Amazon Polly generated identifier for a speech synthesis task.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_SPEECH_SYNTHESIS_TASK_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.task_id is not None: - serializer.write_string( - _SCHEMA_GET_SPEECH_SYNTHESIS_TASK_INPUT.members["TaskId"], self.task_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["task_id"] = de.read_string( - _SCHEMA_GET_SPEECH_SYNTHESIS_TASK_INPUT.members["TaskId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_SPEECH_SYNTHESIS_TASK_INPUT, consumer=_consumer - ) - return kwargs - - -def _serialize_lexicon_name_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_lexicon_name_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -class OutputFormat(UnknownEnumMixin, StrEnum): - JSON = "json" - MP3 = "mp3" - OGG_OPUS = "ogg_opus" - OGG_VORBIS = "ogg_vorbis" - PCM = "pcm" - MULAW = "mulaw" - ALAW = "alaw" - - -class SpeechMarkType(UnknownEnumMixin, StrEnum): - SENTENCE = "sentence" - SSML = "ssml" - VISEME = "viseme" - WORD = "word" - - -def _serialize_speech_mark_type_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_speech_mark_type_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(SpeechMarkType(d.read_string(member_schema))) - - deserializer.read_list(schema, _read_value) - return result - - -class TaskStatus(UnknownEnumMixin, StrEnum): - SCHEDULED = "scheduled" - IN_PROGRESS = "inProgress" - COMPLETED = "completed" - FAILED = "failed" - - -class TextType(UnknownEnumMixin, StrEnum): - SSML = "ssml" - TEXT = "text" - - -@dataclass(kw_only=True) -class SynthesisTask: - """ - SynthesisTask object that provides information about a speech synthesis - task. - """ - - engine: str | None = None - """ - Specifies the engine (`standard`, `neural`, `long-form` or `generative`) - for Amazon Polly to use when processing input text for speech synthesis. - Using a voice that is not supported for the engine selected will result - in an error. - """ - - task_id: str | None = None - """The Amazon Polly generated identifier for a speech synthesis task.""" - - task_status: str | None = None - """Current status of the individual speech synthesis task.""" - - task_status_reason: str | None = None - """ - Reason for the current status of a specific speech synthesis task, - including errors if the task has failed. - """ - - output_uri: str | None = None - """Pathway for the output speech file.""" - - creation_time: datetime | None = None - """Timestamp for the time the synthesis task was started.""" - - request_characters: int = 0 - """Number of billable characters synthesized.""" - - sns_topic_arn: str | None = None - """ - ARN for the SNS topic optionally used for providing status notification - for a speech synthesis task. - """ - - lexicon_names: list[str] | None = None - """ - List of one or more pronunciation lexicon names you want the service to - apply during synthesis. Lexicons are applied only if the language of the - lexicon is the same as the language of the voice. - """ - - output_format: str | None = None - """ - The format in which the returned output will be encoded. For audio - stream, this will be mp3, ogg_vorbis, ogg_opus, mu-law, a-law, or pcm. - For speech marks, this will be json. - """ - - sample_rate: str | None = None - """ - The audio frequency specified in Hz. - - The valid values for mp3 and ogg_vorbis are \"8000\", \"16000\", - \"22050\", and \"24000\". The default value for standard voices is - \"22050\". The default value for neural voices is \"24000\". The default - value for long-form voices is \"24000\". The default value for - generative voices is \"24000\". - - Valid values for pcm are \"8000\" and \"16000\" The default value is - \"16000\". - - Valid value for ogg_opus is \"48000\". - - Valid value for mu-law and a-law is \"8000\". - """ - - speech_mark_types: list[str] | None = None - """The type of speech marks returned for the input text.""" - - text_type: str | None = None - """ - Specifies whether the input text is plain text or SSML. The default - value is plain text. - """ - - voice_id: str | None = None - """Voice ID to use for the synthesis.""" - - language_code: str | None = None - """ - Optional language code for a synthesis task. This is only necessary if - using a bilingual voice, such as Aditi, which can be used for either - Indian English (en-IN) or Hindi (hi-IN). - - If a bilingual voice is used and no language code is specified, Amazon - Polly uses the default language of the bilingual voice. The default - language for any voice is the one returned by the - [DescribeVoices](https://docs.aws.amazon.com/polly/latest/dg/API_DescribeVoices.html) - operation for the `LanguageCode` parameter. For example, if no language - code is specified, Aditi will use Indian English rather than Hindi. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SYNTHESIS_TASK, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.engine is not None: - serializer.write_string( - _SCHEMA_SYNTHESIS_TASK.members["Engine"], self.engine - ) - - if self.task_id is not None: - serializer.write_string( - _SCHEMA_SYNTHESIS_TASK.members["TaskId"], self.task_id - ) - - if self.task_status is not None: - serializer.write_string( - _SCHEMA_SYNTHESIS_TASK.members["TaskStatus"], self.task_status - ) - - if self.task_status_reason is not None: - serializer.write_string( - _SCHEMA_SYNTHESIS_TASK.members["TaskStatusReason"], - self.task_status_reason, - ) - - if self.output_uri is not None: - serializer.write_string( - _SCHEMA_SYNTHESIS_TASK.members["OutputUri"], self.output_uri - ) - - if self.creation_time is not None: - serializer.write_timestamp( - _SCHEMA_SYNTHESIS_TASK.members["CreationTime"], self.creation_time - ) - - serializer.write_integer( - _SCHEMA_SYNTHESIS_TASK.members["RequestCharacters"], self.request_characters - ) - if self.sns_topic_arn is not None: - serializer.write_string( - _SCHEMA_SYNTHESIS_TASK.members["SnsTopicArn"], self.sns_topic_arn - ) - - if self.lexicon_names is not None: - _serialize_lexicon_name_list( - serializer, - _SCHEMA_SYNTHESIS_TASK.members["LexiconNames"], - self.lexicon_names, - ) - - if self.output_format is not None: - serializer.write_string( - _SCHEMA_SYNTHESIS_TASK.members["OutputFormat"], self.output_format - ) - - if self.sample_rate is not None: - serializer.write_string( - _SCHEMA_SYNTHESIS_TASK.members["SampleRate"], self.sample_rate - ) - - if self.speech_mark_types is not None: - _serialize_speech_mark_type_list( - serializer, - _SCHEMA_SYNTHESIS_TASK.members["SpeechMarkTypes"], - self.speech_mark_types, - ) - - if self.text_type is not None: - serializer.write_string( - _SCHEMA_SYNTHESIS_TASK.members["TextType"], self.text_type - ) - - if self.voice_id is not None: - serializer.write_string( - _SCHEMA_SYNTHESIS_TASK.members["VoiceId"], self.voice_id - ) - - if self.language_code is not None: - serializer.write_string( - _SCHEMA_SYNTHESIS_TASK.members["LanguageCode"], self.language_code - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["engine"] = Engine( - de.read_string(_SCHEMA_SYNTHESIS_TASK.members["Engine"]) - ) - - case 1: - kwargs["task_id"] = de.read_string( - _SCHEMA_SYNTHESIS_TASK.members["TaskId"] - ) - - case 2: - kwargs["task_status"] = TaskStatus( - de.read_string(_SCHEMA_SYNTHESIS_TASK.members["TaskStatus"]) - ) - - case 3: - kwargs["task_status_reason"] = de.read_string( - _SCHEMA_SYNTHESIS_TASK.members["TaskStatusReason"] - ) - - case 4: - kwargs["output_uri"] = de.read_string( - _SCHEMA_SYNTHESIS_TASK.members["OutputUri"] - ) - - case 5: - kwargs["creation_time"] = de.read_timestamp( - _SCHEMA_SYNTHESIS_TASK.members["CreationTime"] - ) - - case 6: - kwargs["request_characters"] = de.read_integer( - _SCHEMA_SYNTHESIS_TASK.members["RequestCharacters"] - ) - - case 7: - kwargs["sns_topic_arn"] = de.read_string( - _SCHEMA_SYNTHESIS_TASK.members["SnsTopicArn"] - ) - - case 8: - kwargs["lexicon_names"] = _deserialize_lexicon_name_list( - de, _SCHEMA_SYNTHESIS_TASK.members["LexiconNames"] - ) - - case 9: - kwargs["output_format"] = OutputFormat( - de.read_string(_SCHEMA_SYNTHESIS_TASK.members["OutputFormat"]) - ) - - case 10: - kwargs["sample_rate"] = de.read_string( - _SCHEMA_SYNTHESIS_TASK.members["SampleRate"] - ) - - case 11: - kwargs["speech_mark_types"] = _deserialize_speech_mark_type_list( - de, _SCHEMA_SYNTHESIS_TASK.members["SpeechMarkTypes"] - ) - - case 12: - kwargs["text_type"] = TextType( - de.read_string(_SCHEMA_SYNTHESIS_TASK.members["TextType"]) - ) - - case 13: - kwargs["voice_id"] = VoiceId( - de.read_string(_SCHEMA_SYNTHESIS_TASK.members["VoiceId"]) - ) - - case 14: - kwargs["language_code"] = LanguageCode( - de.read_string(_SCHEMA_SYNTHESIS_TASK.members["LanguageCode"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SYNTHESIS_TASK, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetSpeechSynthesisTaskOutput: - """Dataclass for GetSpeechSynthesisTaskOutput structure.""" - - synthesis_task: SynthesisTask | None = None - """ - SynthesisTask object that provides information from the requested task, - including output format, creation time, task status, and so on. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_SPEECH_SYNTHESIS_TASK_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.synthesis_task is not None: - serializer.write_struct( - _SCHEMA_GET_SPEECH_SYNTHESIS_TASK_OUTPUT.members["SynthesisTask"], - self.synthesis_task, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["synthesis_task"] = SynthesisTask.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_SPEECH_SYNTHESIS_TASK_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InvalidTaskIdException(ServiceError): - """ - The provided Task ID is not valid. Please provide a valid Task ID and - try again. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_TASK_ID_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_TASK_ID_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_TASK_ID_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INVALID_TASK_ID_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class SynthesisTaskNotFoundException(ServiceError): - """The Speech Synthesis task with requested Task ID cannot be found.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SYNTHESIS_TASK_NOT_FOUND_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_SYNTHESIS_TASK_NOT_FOUND_EXCEPTION.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_SYNTHESIS_TASK_NOT_FOUND_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SYNTHESIS_TASK_NOT_FOUND_EXCEPTION, consumer=_consumer - ) - return kwargs - - -GET_SPEECH_SYNTHESIS_TASK = APIOperation( - input=GetSpeechSynthesisTaskInput, - output=GetSpeechSynthesisTaskOutput, - schema=_SCHEMA_GET_SPEECH_SYNTHESIS_TASK, - input_schema=_SCHEMA_GET_SPEECH_SYNTHESIS_TASK_INPUT, - output_schema=_SCHEMA_GET_SPEECH_SYNTHESIS_TASK_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.polly#InvalidTaskIdException" - ): InvalidTaskIdException, - ShapeID( - "com.amazonaws.polly#ServiceFailureException" - ): ServiceFailureException, - ShapeID( - "com.amazonaws.polly#SynthesisTaskNotFoundException" - ): SynthesisTaskNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_TASK_ID_EXCEPTION, - _SCHEMA_SERVICE_FAILURE_EXCEPTION, - _SCHEMA_SYNTHESIS_TASK_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class InvalidLexiconException(ServiceError): - """ - Amazon Polly can't find the specified lexicon. Verify that the - lexicon's name is spelled correctly, and then try again. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_LEXICON_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_LEXICON_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_LEXICON_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INVALID_LEXICON_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class InvalidS3BucketException(ServiceError): - """ - The provided Amazon S3 bucket name is invalid. Please check your input - with S3 bucket naming requirements and try again. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_S3_BUCKET_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_S3_BUCKET_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_S3_BUCKET_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVALID_S3_BUCKET_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InvalidS3KeyException(ServiceError): - """ - The provided Amazon S3 key prefix is invalid. Please provide a valid S3 - object key name. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_S3_KEY_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_S3_KEY_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_S3_KEY_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INVALID_S3_KEY_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class InvalidSampleRateException(ServiceError): - """The specified sample rate is not valid.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_SAMPLE_RATE_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_SAMPLE_RATE_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_SAMPLE_RATE_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVALID_SAMPLE_RATE_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InvalidSnsTopicArnException(ServiceError): - """ - The provided SNS topic ARN is invalid. Please provide a valid SNS topic - ARN and try again. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_SNS_TOPIC_ARN_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_SNS_TOPIC_ARN_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_SNS_TOPIC_ARN_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVALID_SNS_TOPIC_ARN_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InvalidSsmlException(ServiceError): - """ - The SSML you provided is invalid. Verify the SSML syntax, spelling of - tags and values, and then try again. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_SSML_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_SSML_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_SSML_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INVALID_SSML_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class LanguageNotSupportedException(ServiceError): - """ - The language specified is not currently supported by Amazon Polly in - this capacity. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LANGUAGE_NOT_SUPPORTED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_LANGUAGE_NOT_SUPPORTED_EXCEPTION.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_LANGUAGE_NOT_SUPPORTED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LANGUAGE_NOT_SUPPORTED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class LexiconDescription: - """Describes the content of the lexicon.""" - - name: str | None = None - """Name of the lexicon.""" - - attributes: LexiconAttributes | None = None - """Provides lexicon metadata.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LEXICON_DESCRIPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_LEXICON_DESCRIPTION.members["Name"], self.name - ) - - if self.attributes is not None: - serializer.write_struct( - _SCHEMA_LEXICON_DESCRIPTION.members["Attributes"], self.attributes - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_LEXICON_DESCRIPTION.members["Name"] - ) - - case 1: - kwargs["attributes"] = LexiconAttributes.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LEXICON_DESCRIPTION, consumer=_consumer) - return kwargs - - -def _serialize_lexicon_description_list( - serializer: ShapeSerializer, schema: Schema, value: list[LexiconDescription] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_lexicon_description_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[LexiconDescription]: - result: list[LexiconDescription] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(LexiconDescription.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class LexiconSizeExceededException(ServiceError): - """ - The maximum size of the specified lexicon would be exceeded by this - operation. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LEXICON_SIZE_EXCEEDED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_LEXICON_SIZE_EXCEEDED_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_LEXICON_SIZE_EXCEEDED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LEXICON_SIZE_EXCEEDED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ListLexiconsInput: - """Dataclass for ListLexiconsInput structure.""" - - next_token: str | None = None - """ - An opaque pagination token returned from previous `ListLexicons` - operation. If present, indicates where to continue the list of lexicons. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_LEXICONS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_LEXICONS_INPUT.members["NextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_LEXICONS_INPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_LEXICONS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ListLexiconsOutput: - """Dataclass for ListLexiconsOutput structure.""" - - lexicons: list[LexiconDescription] | None = None - """A list of lexicon names and attributes.""" - - next_token: str | None = None - """ - The pagination token to use in the next request to continue the listing - of lexicons. `NextToken` is returned only if the response is truncated. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_LEXICONS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.lexicons is not None: - _serialize_lexicon_description_list( - serializer, - _SCHEMA_LIST_LEXICONS_OUTPUT.members["Lexicons"], - self.lexicons, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_LEXICONS_OUTPUT.members["NextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["lexicons"] = _deserialize_lexicon_description_list( - de, _SCHEMA_LIST_LEXICONS_OUTPUT.members["Lexicons"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_LEXICONS_OUTPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_LEXICONS_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_LEXICONS = APIOperation( - input=ListLexiconsInput, - output=ListLexiconsOutput, - schema=_SCHEMA_LIST_LEXICONS, - input_schema=_SCHEMA_LIST_LEXICONS_INPUT, - output_schema=_SCHEMA_LIST_LEXICONS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.polly#InvalidNextTokenException" - ): InvalidNextTokenException, - ShapeID( - "com.amazonaws.polly#ServiceFailureException" - ): ServiceFailureException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_NEXT_TOKEN_EXCEPTION, - _SCHEMA_SERVICE_FAILURE_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListSpeechSynthesisTasksInput: - """Dataclass for ListSpeechSynthesisTasksInput structure.""" - - max_results: int | None = None - """Maximum number of speech synthesis tasks returned in a List operation.""" - - next_token: str | None = None - """ - The pagination token to use in the next request to continue the listing - of speech synthesis tasks. - """ - - status: str | None = None - """Status of the speech synthesis tasks returned in a List operation""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_SPEECH_SYNTHESIS_TASKS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_SPEECH_SYNTHESIS_TASKS_INPUT.members["MaxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_SPEECH_SYNTHESIS_TASKS_INPUT.members["NextToken"], - self.next_token, - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_LIST_SPEECH_SYNTHESIS_TASKS_INPUT.members["Status"], self.status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_SPEECH_SYNTHESIS_TASKS_INPUT.members["MaxResults"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_SPEECH_SYNTHESIS_TASKS_INPUT.members["NextToken"] - ) - - case 2: - kwargs["status"] = TaskStatus( - de.read_string( - _SCHEMA_LIST_SPEECH_SYNTHESIS_TASKS_INPUT.members["Status"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_SPEECH_SYNTHESIS_TASKS_INPUT, consumer=_consumer - ) - return kwargs - - -def _serialize_synthesis_tasks( - serializer: ShapeSerializer, schema: Schema, value: list[SynthesisTask] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_synthesis_tasks( - deserializer: ShapeDeserializer, schema: Schema -) -> list[SynthesisTask]: - result: list[SynthesisTask] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(SynthesisTask.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListSpeechSynthesisTasksOutput: - """Dataclass for ListSpeechSynthesisTasksOutput structure.""" - - next_token: str | None = None - """ - An opaque pagination token returned from the previous List operation in - this request. If present, this indicates where to continue the listing. - """ - - synthesis_tasks: list[SynthesisTask] | None = None - """ - List of SynthesisTask objects that provides information from the - specified task in the list request, including output format, creation - time, task status, and so on. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_SPEECH_SYNTHESIS_TASKS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_SPEECH_SYNTHESIS_TASKS_OUTPUT.members["NextToken"], - self.next_token, - ) - - if self.synthesis_tasks is not None: - _serialize_synthesis_tasks( - serializer, - _SCHEMA_LIST_SPEECH_SYNTHESIS_TASKS_OUTPUT.members["SynthesisTasks"], - self.synthesis_tasks, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_SPEECH_SYNTHESIS_TASKS_OUTPUT.members["NextToken"] - ) - - case 1: - kwargs["synthesis_tasks"] = _deserialize_synthesis_tasks( - de, - _SCHEMA_LIST_SPEECH_SYNTHESIS_TASKS_OUTPUT.members[ - "SynthesisTasks" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_SPEECH_SYNTHESIS_TASKS_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_SPEECH_SYNTHESIS_TASKS = APIOperation( - input=ListSpeechSynthesisTasksInput, - output=ListSpeechSynthesisTasksOutput, - schema=_SCHEMA_LIST_SPEECH_SYNTHESIS_TASKS, - input_schema=_SCHEMA_LIST_SPEECH_SYNTHESIS_TASKS_INPUT, - output_schema=_SCHEMA_LIST_SPEECH_SYNTHESIS_TASKS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.polly#InvalidNextTokenException" - ): InvalidNextTokenException, - ShapeID( - "com.amazonaws.polly#ServiceFailureException" - ): ServiceFailureException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_NEXT_TOKEN_EXCEPTION, - _SCHEMA_SERVICE_FAILURE_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class MarksNotSupportedForFormatException(ServiceError): - """ - Speech marks are not supported for the `OutputFormat` selected. Speech - marks are only available for content in `json` format. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MARKS_NOT_SUPPORTED_FOR_FORMAT_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_MARKS_NOT_SUPPORTED_FOR_FORMAT_EXCEPTION.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_MARKS_NOT_SUPPORTED_FOR_FORMAT_EXCEPTION.members[ - "message" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MARKS_NOT_SUPPORTED_FOR_FORMAT_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class MaxLexemeLengthExceededException(ServiceError): - """The maximum size of the lexeme would be exceeded by this operation.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MAX_LEXEME_LENGTH_EXCEEDED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_MAX_LEXEME_LENGTH_EXCEEDED_EXCEPTION.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_MAX_LEXEME_LENGTH_EXCEEDED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MAX_LEXEME_LENGTH_EXCEEDED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class MaxLexiconsNumberExceededException(ServiceError): - """The maximum number of lexicons would be exceeded by this operation.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MAX_LEXICONS_NUMBER_EXCEEDED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_MAX_LEXICONS_NUMBER_EXCEEDED_EXCEPTION.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_MAX_LEXICONS_NUMBER_EXCEEDED_EXCEPTION.members[ - "message" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MAX_LEXICONS_NUMBER_EXCEEDED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class PutLexiconInput: - """Dataclass for PutLexiconInput structure.""" - - name: str | None = None - """ - Name of the lexicon. The name must follow the regular express format - [0-9A-Za-z]{1,20}. That is, the name is a case-sensitive alphanumeric - string up to 20 characters long. - """ - - content: str | None = field(repr=False, default=None) - """Content of the PLS lexicon as string data.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_LEXICON_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_PUT_LEXICON_INPUT.members["Name"], self.name - ) - - if self.content is not None: - serializer.write_string( - _SCHEMA_PUT_LEXICON_INPUT.members["Content"], self.content - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_PUT_LEXICON_INPUT.members["Name"] - ) - - case 1: - kwargs["content"] = de.read_string( - _SCHEMA_PUT_LEXICON_INPUT.members["Content"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUT_LEXICON_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class PutLexiconOutput: - """Dataclass for PutLexiconOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_LEXICON_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUT_LEXICON_OUTPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UnsupportedPlsAlphabetException(ServiceError): - """ - The alphabet specified by the lexicon is not a supported alphabet. Valid - values are `x-sampa` and `ipa`. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNSUPPORTED_PLS_ALPHABET_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_UNSUPPORTED_PLS_ALPHABET_EXCEPTION.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_UNSUPPORTED_PLS_ALPHABET_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UNSUPPORTED_PLS_ALPHABET_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UnsupportedPlsLanguageException(ServiceError): - """ - The language specified in the lexicon is unsupported. For a list of - supported languages, see [Lexicon - Attributes](https://docs.aws.amazon.com/polly/latest/dg/API_LexiconAttributes.html). - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNSUPPORTED_PLS_LANGUAGE_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_UNSUPPORTED_PLS_LANGUAGE_EXCEPTION.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_UNSUPPORTED_PLS_LANGUAGE_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UNSUPPORTED_PLS_LANGUAGE_EXCEPTION, consumer=_consumer - ) - return kwargs - - -PUT_LEXICON = APIOperation( - input=PutLexiconInput, - output=PutLexiconOutput, - schema=_SCHEMA_PUT_LEXICON, - input_schema=_SCHEMA_PUT_LEXICON_INPUT, - output_schema=_SCHEMA_PUT_LEXICON_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.polly#InvalidLexiconException" - ): InvalidLexiconException, - ShapeID( - "com.amazonaws.polly#LexiconSizeExceededException" - ): LexiconSizeExceededException, - ShapeID( - "com.amazonaws.polly#MaxLexemeLengthExceededException" - ): MaxLexemeLengthExceededException, - ShapeID( - "com.amazonaws.polly#MaxLexiconsNumberExceededException" - ): MaxLexiconsNumberExceededException, - ShapeID( - "com.amazonaws.polly#ServiceFailureException" - ): ServiceFailureException, - ShapeID( - "com.amazonaws.polly#UnsupportedPlsAlphabetException" - ): UnsupportedPlsAlphabetException, - ShapeID( - "com.amazonaws.polly#UnsupportedPlsLanguageException" - ): UnsupportedPlsLanguageException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_LEXICON_EXCEPTION, - _SCHEMA_LEXICON_SIZE_EXCEEDED_EXCEPTION, - _SCHEMA_MAX_LEXEME_LENGTH_EXCEEDED_EXCEPTION, - _SCHEMA_MAX_LEXICONS_NUMBER_EXCEEDED_EXCEPTION, - _SCHEMA_SERVICE_FAILURE_EXCEPTION, - _SCHEMA_UNSUPPORTED_PLS_ALPHABET_EXCEPTION, - _SCHEMA_UNSUPPORTED_PLS_LANGUAGE_EXCEPTION, - ], -) - - -class QuotaCode(UnknownEnumMixin, StrEnum): - INPUT_STREAM_INBOUND_EVENT_TIMEOUT = "input-stream-inbound-event-timeout" - INPUT_STREAM_TIMEOUT = "input-stream-timeout" - - -class ServiceCode(UnknownEnumMixin, StrEnum): - POLLY = "polly" - - -@dataclass(kw_only=True) -class ServiceQuotaExceededException(ServiceError): - """The request would cause a service quota to be exceeded.""" - - fault: Literal["client", "server"] | None = "client" - - quota_code: str - """The quota code identifying the specific quota.""" - - service_code: str - """The service code identifying the originating service.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION.members["message"], self.message - ) - serializer.write_string( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION.members["quotaCode"], - self.quota_code, - ) - serializer.write_string( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION.members["serviceCode"], - self.service_code, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION.members["message"] - ) - - case 1: - kwargs["quota_code"] = QuotaCode( - de.read_string( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION.members[ - "quotaCode" - ] - ) - ) - - case 2: - kwargs["service_code"] = ServiceCode( - de.read_string( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION.members[ - "serviceCode" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, consumer=_consumer - ) - if "quota_code" not in kwargs: - kwargs["quota_code"] = QuotaCode._corrected("") - if "service_code" not in kwargs: - kwargs["service_code"] = ServiceCode._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class TextEvent: - """Contains text content to be synthesized into speech.""" - - text: str - """ - The text content to synthesize. If you specify `ssml` as the `TextType`, - follow the SSML format for the input text. - """ - - text_type: str | None = None - """ - Specifies whether the input text is plain text or SSML. Default: plain - text. - """ - - flush_stream_configuration: FlushStreamConfiguration | None = None - """ - Configuration for controlling when synthesized audio flushes to the - output stream. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TEXT_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_TEXT_EVENT.members["Text"], self.text) - if self.text_type is not None: - serializer.write_string( - _SCHEMA_TEXT_EVENT.members["TextType"], self.text_type - ) - - if self.flush_stream_configuration is not None: - serializer.write_struct( - _SCHEMA_TEXT_EVENT.members["FlushStreamConfiguration"], - self.flush_stream_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["text"] = de.read_string(_SCHEMA_TEXT_EVENT.members["Text"]) - - case 1: - kwargs["text_type"] = TextType( - de.read_string(_SCHEMA_TEXT_EVENT.members["TextType"]) - ) - - case 2: - kwargs["flush_stream_configuration"] = ( - FlushStreamConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TEXT_EVENT, consumer=_consumer) - if "text" not in kwargs: - kwargs["text"] = "" - return kwargs - - -@dataclass -class StartSpeechSynthesisStreamActionStreamTextEvent: - """A text event containing content to be synthesized.""" - - value: TextEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_START_SPEECH_SYNTHESIS_STREAM_ACTION_STREAM, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_START_SPEECH_SYNTHESIS_STREAM_ACTION_STREAM.members["TextEvent"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=TextEvent.deserialize(deserializer)) - - -@dataclass -class StartSpeechSynthesisStreamActionStreamCloseStreamEvent: - """An event indicating the end of the input stream.""" - - value: CloseStreamEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_START_SPEECH_SYNTHESIS_STREAM_ACTION_STREAM, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_START_SPEECH_SYNTHESIS_STREAM_ACTION_STREAM.members[ - "CloseStreamEvent" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=CloseStreamEvent.deserialize(deserializer)) - - -@dataclass -class StartSpeechSynthesisStreamActionStreamUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -StartSpeechSynthesisStreamActionStream = Union[ - StartSpeechSynthesisStreamActionStreamTextEvent - | StartSpeechSynthesisStreamActionStreamCloseStreamEvent - | StartSpeechSynthesisStreamActionStreamUnknown -] -""" -Inbound event stream for sending input and control events to manage -bidirectional speech synthesis. -""" - - -class _StartSpeechSynthesisStreamActionStreamDeserializer: - _result: StartSpeechSynthesisStreamActionStream | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> StartSpeechSynthesisStreamActionStream: - self._result = None - deserializer.read_struct( - _SCHEMA_START_SPEECH_SYNTHESIS_STREAM_ACTION_STREAM, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - StartSpeechSynthesisStreamActionStreamTextEvent.deserialize(de) - ) - - case 1: - self._set_result( - StartSpeechSynthesisStreamActionStreamCloseStreamEvent.deserialize( - de - ) - ) - - case _: - self._set_result( - StartSpeechSynthesisStreamActionStreamUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: StartSpeechSynthesisStreamActionStream) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class StartSpeechSynthesisStreamInput: - """Dataclass for StartSpeechSynthesisStreamInput structure.""" - - engine: str | None = None - """ - Specifies the engine for Amazon Polly to use when processing input text - for speech synthesis. Currently, only the `generative` engine is - supported. If you specify a voice that the selected engine doesn't - support, Amazon Polly returns an error. - """ - - language_code: str | None = None - """ - An optional parameter that sets the language code for the speech - synthesis request. Specify this parameter only when using a bilingual - voice. If a bilingual voice is used and no language code is specified, - Amazon Polly uses the default language of the bilingual voice. - """ - - lexicon_names: list[str] | None = None - """ - The names of one or more pronunciation lexicons for the service to apply - during synthesis. Amazon Polly applies lexicons only when the lexicon - language matches the voice language. - """ - - output_format: str | None = None - """ - The audio format for the synthesized speech. Currently, Amazon Polly - does not support JSON speech marks. - """ - - sample_rate: str | None = None - """The audio frequency, specified in Hz.""" - - voice_id: str | None = None - """ - The voice to use in synthesis. To get a list of available voice IDs, use - the - [DescribeVoices](https://docs.aws.amazon.com/polly/latest/API/API_DescribeVoices.html) - operation. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_SPEECH_SYNTHESIS_STREAM_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.engine is not None: - serializer.write_string( - _SCHEMA_START_SPEECH_SYNTHESIS_STREAM_INPUT.members["Engine"], - self.engine, - ) - - if self.language_code is not None: - serializer.write_string( - _SCHEMA_START_SPEECH_SYNTHESIS_STREAM_INPUT.members["LanguageCode"], - self.language_code, - ) - - if self.lexicon_names is not None: - _serialize_lexicon_name_list( - serializer, - _SCHEMA_START_SPEECH_SYNTHESIS_STREAM_INPUT.members["LexiconNames"], - self.lexicon_names, - ) - - if self.output_format is not None: - serializer.write_string( - _SCHEMA_START_SPEECH_SYNTHESIS_STREAM_INPUT.members["OutputFormat"], - self.output_format, - ) - - if self.sample_rate is not None: - serializer.write_string( - _SCHEMA_START_SPEECH_SYNTHESIS_STREAM_INPUT.members["SampleRate"], - self.sample_rate, - ) - - if self.voice_id is not None: - serializer.write_string( - _SCHEMA_START_SPEECH_SYNTHESIS_STREAM_INPUT.members["VoiceId"], - self.voice_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["engine"] = Engine( - de.read_string( - _SCHEMA_START_SPEECH_SYNTHESIS_STREAM_INPUT.members[ - "Engine" - ] - ) - ) - - case 1: - kwargs["language_code"] = LanguageCode( - de.read_string( - _SCHEMA_START_SPEECH_SYNTHESIS_STREAM_INPUT.members[ - "LanguageCode" - ] - ) - ) - - case 2: - kwargs["lexicon_names"] = _deserialize_lexicon_name_list( - de, - _SCHEMA_START_SPEECH_SYNTHESIS_STREAM_INPUT.members[ - "LexiconNames" - ], - ) - - case 3: - kwargs["output_format"] = OutputFormat( - de.read_string( - _SCHEMA_START_SPEECH_SYNTHESIS_STREAM_INPUT.members[ - "OutputFormat" - ] - ) - ) - - case 4: - kwargs["sample_rate"] = de.read_string( - _SCHEMA_START_SPEECH_SYNTHESIS_STREAM_INPUT.members[ - "SampleRate" - ] - ) - - case 5: - kwargs["voice_id"] = VoiceId( - de.read_string( - _SCHEMA_START_SPEECH_SYNTHESIS_STREAM_INPUT.members[ - "VoiceId" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_START_SPEECH_SYNTHESIS_STREAM_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class StreamClosedEvent: - """ - Indicates that the synthesis stream is closed and provides summary - information. - """ - - request_characters: int = 0 - """The total number of characters synthesized during the streaming session.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STREAM_CLOSED_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer( - _SCHEMA_STREAM_CLOSED_EVENT.members["RequestCharacters"], - self.request_characters, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["request_characters"] = de.read_integer( - _SCHEMA_STREAM_CLOSED_EVENT.members["RequestCharacters"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_STREAM_CLOSED_EVENT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ThrottlingReason: - """Provides information about a specific throttling reason.""" - - reason: str | None = None - """The reason code explaining why the request was throttled.""" - - resource: str | None = None - """The resource that caused the throttling.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_THROTTLING_REASON, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.reason is not None: - serializer.write_string( - _SCHEMA_THROTTLING_REASON.members["reason"], self.reason - ) - - if self.resource is not None: - serializer.write_string( - _SCHEMA_THROTTLING_REASON.members["resource"], self.resource - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["reason"] = de.read_string( - _SCHEMA_THROTTLING_REASON.members["reason"] - ) - - case 1: - kwargs["resource"] = de.read_string( - _SCHEMA_THROTTLING_REASON.members["resource"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_THROTTLING_REASON, consumer=_consumer) - return kwargs - - -def _serialize_throttling_reason_list( - serializer: ShapeSerializer, schema: Schema, value: list[ThrottlingReason] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_throttling_reason_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ThrottlingReason]: - result: list[ThrottlingReason] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ThrottlingReason.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ThrottlingException(ServiceError): - """The request was denied because of request throttling.""" - - fault: Literal["client", "server"] | None = "client" - - throttling_reasons: list[ThrottlingReason] | None = None - """A list of reasons explaining why the request was throttled.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_THROTTLING_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_THROTTLING_EXCEPTION.members["message"], self.message - ) - - if self.throttling_reasons is not None: - _serialize_throttling_reason_list( - serializer, - _SCHEMA_THROTTLING_EXCEPTION.members["throttlingReasons"], - self.throttling_reasons, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_THROTTLING_EXCEPTION.members["message"] - ) - - case 1: - kwargs["throttling_reasons"] = _deserialize_throttling_reason_list( - de, _SCHEMA_THROTTLING_EXCEPTION.members["throttlingReasons"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_THROTTLING_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ValidationExceptionField: - """Information about a field that failed validation.""" - - name: str - """The name of the field that failed validation.""" - - message: str - """A message describing why the field failed validation.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VALIDATION_EXCEPTION_FIELD, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_VALIDATION_EXCEPTION_FIELD.members["name"], self.name - ) - serializer.write_string( - _SCHEMA_VALIDATION_EXCEPTION_FIELD.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_VALIDATION_EXCEPTION_FIELD.members["name"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_VALIDATION_EXCEPTION_FIELD.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VALIDATION_EXCEPTION_FIELD, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "message" not in kwargs: - kwargs["message"] = "" - return kwargs - - -def _serialize_validation_exception_field_list( - serializer: ShapeSerializer, schema: Schema, value: list[ValidationExceptionField] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_validation_exception_field_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ValidationExceptionField]: - result: list[ValidationExceptionField] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ValidationExceptionField.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class ValidationExceptionReason(UnknownEnumMixin, StrEnum): - UNSUPPORTED_OPERATION = "unsupportedOperation" - FIELD_VALIDATION_FAILED = "fieldValidationFailed" - OTHER = "other" - INVALID_INBOUND_EVENT = "invalidInboundEvent" - - -@dataclass(kw_only=True) -class ValidationException(ServiceError): - """The input fails to satisfy the constraints specified by the service.""" - - fault: Literal["client", "server"] | None = "client" - - reason: str - """The reason the request failed validation.""" - - fields: list[ValidationExceptionField] | None = None - """The fields that caused the validation error.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VALIDATION_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_VALIDATION_EXCEPTION.members["message"], self.message - ) - serializer.write_string( - _SCHEMA_VALIDATION_EXCEPTION.members["reason"], self.reason - ) - if self.fields is not None: - _serialize_validation_exception_field_list( - serializer, _SCHEMA_VALIDATION_EXCEPTION.members["fields"], self.fields - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_VALIDATION_EXCEPTION.members["message"] - ) - - case 1: - kwargs["reason"] = ValidationExceptionReason( - de.read_string(_SCHEMA_VALIDATION_EXCEPTION.members["reason"]) - ) - - case 2: - kwargs["fields"] = _deserialize_validation_exception_field_list( - de, _SCHEMA_VALIDATION_EXCEPTION.members["fields"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VALIDATION_EXCEPTION, consumer=_consumer) - if "reason" not in kwargs: - kwargs["reason"] = ValidationExceptionReason._corrected("") - return kwargs - - -@dataclass -class StartSpeechSynthesisStreamEventStreamAudioEvent: - """An audio event containing synthesized speech.""" - - value: AudioEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_START_SPEECH_SYNTHESIS_STREAM_EVENT_STREAM, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_START_SPEECH_SYNTHESIS_STREAM_EVENT_STREAM.members["AudioEvent"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=AudioEvent.deserialize(deserializer)) - - -@dataclass -class StartSpeechSynthesisStreamEventStreamStreamClosedEvent: - """An event, with summary information, indicating the stream has closed.""" - - value: StreamClosedEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_START_SPEECH_SYNTHESIS_STREAM_EVENT_STREAM, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_START_SPEECH_SYNTHESIS_STREAM_EVENT_STREAM.members[ - "StreamClosedEvent" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=StreamClosedEvent.deserialize(deserializer)) - - -@dataclass -class StartSpeechSynthesisStreamEventStreamValidationException: - """An exception indicating the input failed validation.""" - - value: ValidationException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_START_SPEECH_SYNTHESIS_STREAM_EVENT_STREAM, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_START_SPEECH_SYNTHESIS_STREAM_EVENT_STREAM.members[ - "ValidationException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ValidationException.deserialize(deserializer)) - - -@dataclass -class StartSpeechSynthesisStreamEventStreamServiceQuotaExceededException: - """An exception indicating a service quota would be exceeded.""" - - value: ServiceQuotaExceededException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_START_SPEECH_SYNTHESIS_STREAM_EVENT_STREAM, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_START_SPEECH_SYNTHESIS_STREAM_EVENT_STREAM.members[ - "ServiceQuotaExceededException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ServiceQuotaExceededException.deserialize(deserializer)) - - -@dataclass -class StartSpeechSynthesisStreamEventStreamServiceFailureException: - """An unknown condition has caused a service failure.""" - - value: ServiceFailureException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_START_SPEECH_SYNTHESIS_STREAM_EVENT_STREAM, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_START_SPEECH_SYNTHESIS_STREAM_EVENT_STREAM.members[ - "ServiceFailureException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ServiceFailureException.deserialize(deserializer)) - - -@dataclass -class StartSpeechSynthesisStreamEventStreamThrottlingException: - """An exception indicating the request was throttled.""" - - value: ThrottlingException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_START_SPEECH_SYNTHESIS_STREAM_EVENT_STREAM, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_START_SPEECH_SYNTHESIS_STREAM_EVENT_STREAM.members[ - "ThrottlingException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ThrottlingException.deserialize(deserializer)) - - -@dataclass -class StartSpeechSynthesisStreamEventStreamUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -StartSpeechSynthesisStreamEventStream = Union[ - StartSpeechSynthesisStreamEventStreamAudioEvent - | StartSpeechSynthesisStreamEventStreamStreamClosedEvent - | StartSpeechSynthesisStreamEventStreamValidationException - | StartSpeechSynthesisStreamEventStreamServiceQuotaExceededException - | StartSpeechSynthesisStreamEventStreamServiceFailureException - | StartSpeechSynthesisStreamEventStreamThrottlingException - | StartSpeechSynthesisStreamEventStreamUnknown -] -""" -Outbound event stream that contains synthesized audio data and stream -status events. -""" - - -class _StartSpeechSynthesisStreamEventStreamDeserializer: - _result: StartSpeechSynthesisStreamEventStream | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> StartSpeechSynthesisStreamEventStream: - self._result = None - deserializer.read_struct( - _SCHEMA_START_SPEECH_SYNTHESIS_STREAM_EVENT_STREAM, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - StartSpeechSynthesisStreamEventStreamAudioEvent.deserialize(de) - ) - - case 1: - self._set_result( - StartSpeechSynthesisStreamEventStreamStreamClosedEvent.deserialize( - de - ) - ) - - case 2: - self._set_result( - StartSpeechSynthesisStreamEventStreamValidationException.deserialize( - de - ) - ) - - case 3: - self._set_result( - StartSpeechSynthesisStreamEventStreamServiceQuotaExceededException.deserialize( - de - ) - ) - - case 4: - self._set_result( - StartSpeechSynthesisStreamEventStreamServiceFailureException.deserialize( - de - ) - ) - - case 5: - self._set_result( - StartSpeechSynthesisStreamEventStreamThrottlingException.deserialize( - de - ) - ) - - case _: - self._set_result( - StartSpeechSynthesisStreamEventStreamUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: StartSpeechSynthesisStreamEventStream) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class StartSpeechSynthesisStreamOutput: - """Dataclass for StartSpeechSynthesisStreamOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_SPEECH_SYNTHESIS_STREAM_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_START_SPEECH_SYNTHESIS_STREAM_OUTPUT, consumer=_consumer - ) - return kwargs - - -START_SPEECH_SYNTHESIS_STREAM = APIOperation( - input=StartSpeechSynthesisStreamInput, - output=StartSpeechSynthesisStreamOutput, - schema=_SCHEMA_START_SPEECH_SYNTHESIS_STREAM, - input_schema=_SCHEMA_START_SPEECH_SYNTHESIS_STREAM_INPUT, - output_schema=_SCHEMA_START_SPEECH_SYNTHESIS_STREAM_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.polly#ServiceFailureException" - ): ServiceFailureException, - ShapeID( - "com.amazonaws.polly#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID("com.amazonaws.polly#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.polly#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_SERVICE_FAILURE_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class SsmlMarksNotSupportedForTextTypeException(ServiceError): - """SSML speech marks are not supported for plain text-type input.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_SSML_MARKS_NOT_SUPPORTED_FOR_TEXT_TYPE_EXCEPTION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_SSML_MARKS_NOT_SUPPORTED_FOR_TEXT_TYPE_EXCEPTION.members[ - "message" - ], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_SSML_MARKS_NOT_SUPPORTED_FOR_TEXT_TYPE_EXCEPTION.members[ - "message" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SSML_MARKS_NOT_SUPPORTED_FOR_TEXT_TYPE_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class StartSpeechSynthesisTaskInput: - """Dataclass for StartSpeechSynthesisTaskInput structure.""" - - engine: str | None = None - """ - Specifies the engine (`standard`, `neural`, `long-form` or `generative`) - for Amazon Polly to use when processing input text for speech synthesis. - Using a voice that is not supported for the engine selected will result - in an error. - """ - - language_code: str | None = None - """ - Optional language code for the Speech Synthesis request. This is only - necessary if using a bilingual voice, such as Aditi, which can be used - for either Indian English (en-IN) or Hindi (hi-IN). - - If a bilingual voice is used and no language code is specified, Amazon - Polly uses the default language of the bilingual voice. The default - language for any voice is the one returned by the - [DescribeVoices](https://docs.aws.amazon.com/polly/latest/dg/API_DescribeVoices.html) - operation for the `LanguageCode` parameter. For example, if no language - code is specified, Aditi will use Indian English rather than Hindi. - """ - - lexicon_names: list[str] | None = None - """ - List of one or more pronunciation lexicon names you want the service to - apply during synthesis. Lexicons are applied only if the language of the - lexicon is the same as the language of the voice. - """ - - output_format: str | None = None - """ - The format in which the returned output will be encoded. For audio - stream, this will be mp3, ogg_vorbis, ogg_opus, mu-law, a-law, or pcm. - For speech marks, this will be json. - """ - - output_s3_bucket_name: str | None = None - """Amazon S3 bucket name to which the output file will be saved.""" - - output_s3_key_prefix: str | None = None - """The Amazon S3 key prefix for the output speech file.""" - - sample_rate: str | None = None - """ - The audio frequency specified in Hz. - - The valid values for mp3 and ogg_vorbis are \"8000\", \"16000\", - \"22050\", and \"24000\". The default value for standard voices is - \"22050\". The default value for neural voices is \"24000\". The default - value for long-form voices is \"24000\". The default value for - generative voices is \"24000\". - - Valid values for pcm are \"8000\" and \"16000\" The default value is - \"16000\". - - Valid value for ogg_opus is \"48000\". - - Valid value for mu-law and a-law is \"8000\". - """ - - sns_topic_arn: str | None = None - """ - ARN for the SNS topic optionally used for providing status notification - for a speech synthesis task. - """ - - speech_mark_types: list[str] | None = None - """The type of speech marks returned for the input text.""" - - text: str | None = None - """ - The input text to synthesize. If you specify ssml as the TextType, - follow the SSML format for the input text. - """ - - text_type: str | None = None - """ - Specifies whether the input text is plain text or SSML. The default - value is plain text. - """ - - voice_id: str | None = None - """Voice ID to use for the synthesis.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_SPEECH_SYNTHESIS_TASK_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.engine is not None: - serializer.write_string( - _SCHEMA_START_SPEECH_SYNTHESIS_TASK_INPUT.members["Engine"], self.engine - ) - - if self.language_code is not None: - serializer.write_string( - _SCHEMA_START_SPEECH_SYNTHESIS_TASK_INPUT.members["LanguageCode"], - self.language_code, - ) - - if self.lexicon_names is not None: - _serialize_lexicon_name_list( - serializer, - _SCHEMA_START_SPEECH_SYNTHESIS_TASK_INPUT.members["LexiconNames"], - self.lexicon_names, - ) - - if self.output_format is not None: - serializer.write_string( - _SCHEMA_START_SPEECH_SYNTHESIS_TASK_INPUT.members["OutputFormat"], - self.output_format, - ) - - if self.output_s3_bucket_name is not None: - serializer.write_string( - _SCHEMA_START_SPEECH_SYNTHESIS_TASK_INPUT.members["OutputS3BucketName"], - self.output_s3_bucket_name, - ) - - if self.output_s3_key_prefix is not None: - serializer.write_string( - _SCHEMA_START_SPEECH_SYNTHESIS_TASK_INPUT.members["OutputS3KeyPrefix"], - self.output_s3_key_prefix, - ) - - if self.sample_rate is not None: - serializer.write_string( - _SCHEMA_START_SPEECH_SYNTHESIS_TASK_INPUT.members["SampleRate"], - self.sample_rate, - ) - - if self.sns_topic_arn is not None: - serializer.write_string( - _SCHEMA_START_SPEECH_SYNTHESIS_TASK_INPUT.members["SnsTopicArn"], - self.sns_topic_arn, - ) - - if self.speech_mark_types is not None: - _serialize_speech_mark_type_list( - serializer, - _SCHEMA_START_SPEECH_SYNTHESIS_TASK_INPUT.members["SpeechMarkTypes"], - self.speech_mark_types, - ) - - if self.text is not None: - serializer.write_string( - _SCHEMA_START_SPEECH_SYNTHESIS_TASK_INPUT.members["Text"], self.text - ) - - if self.text_type is not None: - serializer.write_string( - _SCHEMA_START_SPEECH_SYNTHESIS_TASK_INPUT.members["TextType"], - self.text_type, - ) - - if self.voice_id is not None: - serializer.write_string( - _SCHEMA_START_SPEECH_SYNTHESIS_TASK_INPUT.members["VoiceId"], - self.voice_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["engine"] = Engine( - de.read_string( - _SCHEMA_START_SPEECH_SYNTHESIS_TASK_INPUT.members["Engine"] - ) - ) - - case 1: - kwargs["language_code"] = LanguageCode( - de.read_string( - _SCHEMA_START_SPEECH_SYNTHESIS_TASK_INPUT.members[ - "LanguageCode" - ] - ) - ) - - case 2: - kwargs["lexicon_names"] = _deserialize_lexicon_name_list( - de, - _SCHEMA_START_SPEECH_SYNTHESIS_TASK_INPUT.members[ - "LexiconNames" - ], - ) - - case 3: - kwargs["output_format"] = OutputFormat( - de.read_string( - _SCHEMA_START_SPEECH_SYNTHESIS_TASK_INPUT.members[ - "OutputFormat" - ] - ) - ) - - case 4: - kwargs["output_s3_bucket_name"] = de.read_string( - _SCHEMA_START_SPEECH_SYNTHESIS_TASK_INPUT.members[ - "OutputS3BucketName" - ] - ) - - case 5: - kwargs["output_s3_key_prefix"] = de.read_string( - _SCHEMA_START_SPEECH_SYNTHESIS_TASK_INPUT.members[ - "OutputS3KeyPrefix" - ] - ) - - case 6: - kwargs["sample_rate"] = de.read_string( - _SCHEMA_START_SPEECH_SYNTHESIS_TASK_INPUT.members["SampleRate"] - ) - - case 7: - kwargs["sns_topic_arn"] = de.read_string( - _SCHEMA_START_SPEECH_SYNTHESIS_TASK_INPUT.members["SnsTopicArn"] - ) - - case 8: - kwargs["speech_mark_types"] = _deserialize_speech_mark_type_list( - de, - _SCHEMA_START_SPEECH_SYNTHESIS_TASK_INPUT.members[ - "SpeechMarkTypes" - ], - ) - - case 9: - kwargs["text"] = de.read_string( - _SCHEMA_START_SPEECH_SYNTHESIS_TASK_INPUT.members["Text"] - ) - - case 10: - kwargs["text_type"] = TextType( - de.read_string( - _SCHEMA_START_SPEECH_SYNTHESIS_TASK_INPUT.members[ - "TextType" - ] - ) - ) - - case 11: - kwargs["voice_id"] = VoiceId( - de.read_string( - _SCHEMA_START_SPEECH_SYNTHESIS_TASK_INPUT.members["VoiceId"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_START_SPEECH_SYNTHESIS_TASK_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class StartSpeechSynthesisTaskOutput: - """Dataclass for StartSpeechSynthesisTaskOutput structure.""" - - synthesis_task: SynthesisTask | None = None - """ - SynthesisTask object that provides information and attributes about a - newly submitted speech synthesis task. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_SPEECH_SYNTHESIS_TASK_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.synthesis_task is not None: - serializer.write_struct( - _SCHEMA_START_SPEECH_SYNTHESIS_TASK_OUTPUT.members["SynthesisTask"], - self.synthesis_task, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["synthesis_task"] = SynthesisTask.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_START_SPEECH_SYNTHESIS_TASK_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class TextLengthExceededException(ServiceError): - """ - The value of the \"Text\" parameter is longer than the accepted limits. - For the `SynthesizeSpeech` API, the limit for input text is a maximum of - 6000 characters total, of which no more than 3000 can be billed - characters. For the `StartSpeechSynthesisTask` API, the maximum is - 200,000 characters, of which no more than 100,000 can be billed - characters. SSML tags are not counted as billed characters. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TEXT_LENGTH_EXCEEDED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_TEXT_LENGTH_EXCEEDED_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_TEXT_LENGTH_EXCEEDED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_TEXT_LENGTH_EXCEEDED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -START_SPEECH_SYNTHESIS_TASK = APIOperation( - input=StartSpeechSynthesisTaskInput, - output=StartSpeechSynthesisTaskOutput, - schema=_SCHEMA_START_SPEECH_SYNTHESIS_TASK, - input_schema=_SCHEMA_START_SPEECH_SYNTHESIS_TASK_INPUT, - output_schema=_SCHEMA_START_SPEECH_SYNTHESIS_TASK_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.polly#EngineNotSupportedException" - ): EngineNotSupportedException, - ShapeID( - "com.amazonaws.polly#InvalidS3BucketException" - ): InvalidS3BucketException, - ShapeID("com.amazonaws.polly#InvalidS3KeyException"): InvalidS3KeyException, - ShapeID( - "com.amazonaws.polly#InvalidSampleRateException" - ): InvalidSampleRateException, - ShapeID( - "com.amazonaws.polly#InvalidSnsTopicArnException" - ): InvalidSnsTopicArnException, - ShapeID("com.amazonaws.polly#InvalidSsmlException"): InvalidSsmlException, - ShapeID( - "com.amazonaws.polly#LanguageNotSupportedException" - ): LanguageNotSupportedException, - ShapeID( - "com.amazonaws.polly#LexiconNotFoundException" - ): LexiconNotFoundException, - ShapeID( - "com.amazonaws.polly#MarksNotSupportedForFormatException" - ): MarksNotSupportedForFormatException, - ShapeID( - "com.amazonaws.polly#ServiceFailureException" - ): ServiceFailureException, - ShapeID( - "com.amazonaws.polly#SsmlMarksNotSupportedForTextTypeException" - ): SsmlMarksNotSupportedForTextTypeException, - ShapeID( - "com.amazonaws.polly#TextLengthExceededException" - ): TextLengthExceededException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ENGINE_NOT_SUPPORTED_EXCEPTION, - _SCHEMA_INVALID_S3_BUCKET_EXCEPTION, - _SCHEMA_INVALID_S3_KEY_EXCEPTION, - _SCHEMA_INVALID_SAMPLE_RATE_EXCEPTION, - _SCHEMA_INVALID_SNS_TOPIC_ARN_EXCEPTION, - _SCHEMA_INVALID_SSML_EXCEPTION, - _SCHEMA_LANGUAGE_NOT_SUPPORTED_EXCEPTION, - _SCHEMA_LEXICON_NOT_FOUND_EXCEPTION, - _SCHEMA_MARKS_NOT_SUPPORTED_FOR_FORMAT_EXCEPTION, - _SCHEMA_SERVICE_FAILURE_EXCEPTION, - _SCHEMA_SSML_MARKS_NOT_SUPPORTED_FOR_TEXT_TYPE_EXCEPTION, - _SCHEMA_TEXT_LENGTH_EXCEEDED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class SynthesizeSpeechInput: - """Dataclass for SynthesizeSpeechInput structure.""" - - engine: str | None = None - """ - Specifies the engine (`standard`, `neural`, `long-form`, or - `generative`) for Amazon Polly to use when processing input text for - speech synthesis. Provide an engine that is supported by the voice you - select. If you don't provide an engine, the standard engine is selected - by default. If a chosen voice isn't supported by the standard engine, - this will result in an error. For information on Amazon Polly voices and - which voices are available for each engine, see [Available - Voices](https://docs.aws.amazon.com/polly/latest/dg/voicelist.html). - """ - - language_code: str | None = None - """ - Optional language code for the Synthesize Speech request. This is only - necessary if using a bilingual voice, such as Aditi, which can be used - for either Indian English (en-IN) or Hindi (hi-IN). - - If a bilingual voice is used and no language code is specified, Amazon - Polly uses the default language of the bilingual voice. The default - language for any voice is the one returned by the - [DescribeVoices](https://docs.aws.amazon.com/polly/latest/dg/API_DescribeVoices.html) - operation for the `LanguageCode` parameter. For example, if no language - code is specified, Aditi will use Indian English rather than Hindi. - """ - - lexicon_names: list[str] | None = None - """ - List of one or more pronunciation lexicon names you want the service to - apply during synthesis. Lexicons are applied only if the language of the - lexicon is the same as the language of the voice. For information about - storing lexicons, see - [PutLexicon](https://docs.aws.amazon.com/polly/latest/dg/API_PutLexicon.html). - """ - - output_format: str | None = None - """ - The format in which the returned output will be encoded. For audio - stream, this will be mp3, ogg_vorbis, ogg_opus, mu-law, a-law or pcm. - For speech marks, this will be json. - - When pcm is used, the content returned is audio/pcm in a signed 16-bit, - 1 channel (mono), little-endian format. - """ - - sample_rate: str | None = None - """ - The audio frequency specified in Hz. - - The valid values for mp3 and ogg_vorbis are \"8000\", \"16000\", - \"22050\", \"24000\", \"44100\" and \"48000\". The default value for - standard voices is \"22050\". The default value for neural voices is - \"24000\". The default value for long-form voices is \"24000\". The - default value for generative voices is \"24000\". - - Valid values for pcm are \"8000\" and \"16000\" The default value is - \"16000\". - - Valid value for ogg_opus is \"48000\". - - Valid value for mu-law and a-law is \"8000\". - """ - - speech_mark_types: list[str] | None = None - """The type of speech marks returned for the input text.""" - - text: str | None = None - """ - Input text to synthesize. If you specify `ssml` as the `TextType`, - follow the SSML format for the input text. - """ - - text_type: str | None = None - """ - Specifies whether the input text is plain text or SSML. The default - value is plain text. For more information, see [Using - SSML](https://docs.aws.amazon.com/polly/latest/dg/ssml.html). - """ - - voice_id: str | None = None - """ - Voice ID to use for the synthesis. You can get a list of available voice - IDs by calling the - [DescribeVoices](https://docs.aws.amazon.com/polly/latest/dg/API_DescribeVoices.html) - operation. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SYNTHESIZE_SPEECH_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.engine is not None: - serializer.write_string( - _SCHEMA_SYNTHESIZE_SPEECH_INPUT.members["Engine"], self.engine - ) - - if self.language_code is not None: - serializer.write_string( - _SCHEMA_SYNTHESIZE_SPEECH_INPUT.members["LanguageCode"], - self.language_code, - ) - - if self.lexicon_names is not None: - _serialize_lexicon_name_list( - serializer, - _SCHEMA_SYNTHESIZE_SPEECH_INPUT.members["LexiconNames"], - self.lexicon_names, - ) - - if self.output_format is not None: - serializer.write_string( - _SCHEMA_SYNTHESIZE_SPEECH_INPUT.members["OutputFormat"], - self.output_format, - ) - - if self.sample_rate is not None: - serializer.write_string( - _SCHEMA_SYNTHESIZE_SPEECH_INPUT.members["SampleRate"], self.sample_rate - ) - - if self.speech_mark_types is not None: - _serialize_speech_mark_type_list( - serializer, - _SCHEMA_SYNTHESIZE_SPEECH_INPUT.members["SpeechMarkTypes"], - self.speech_mark_types, - ) - - if self.text is not None: - serializer.write_string( - _SCHEMA_SYNTHESIZE_SPEECH_INPUT.members["Text"], self.text - ) - - if self.text_type is not None: - serializer.write_string( - _SCHEMA_SYNTHESIZE_SPEECH_INPUT.members["TextType"], self.text_type - ) - - if self.voice_id is not None: - serializer.write_string( - _SCHEMA_SYNTHESIZE_SPEECH_INPUT.members["VoiceId"], self.voice_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["engine"] = Engine( - de.read_string( - _SCHEMA_SYNTHESIZE_SPEECH_INPUT.members["Engine"] - ) - ) - - case 1: - kwargs["language_code"] = LanguageCode( - de.read_string( - _SCHEMA_SYNTHESIZE_SPEECH_INPUT.members["LanguageCode"] - ) - ) - - case 2: - kwargs["lexicon_names"] = _deserialize_lexicon_name_list( - de, _SCHEMA_SYNTHESIZE_SPEECH_INPUT.members["LexiconNames"] - ) - - case 3: - kwargs["output_format"] = OutputFormat( - de.read_string( - _SCHEMA_SYNTHESIZE_SPEECH_INPUT.members["OutputFormat"] - ) - ) - - case 4: - kwargs["sample_rate"] = de.read_string( - _SCHEMA_SYNTHESIZE_SPEECH_INPUT.members["SampleRate"] - ) - - case 5: - kwargs["speech_mark_types"] = _deserialize_speech_mark_type_list( - de, _SCHEMA_SYNTHESIZE_SPEECH_INPUT.members["SpeechMarkTypes"] - ) - - case 6: - kwargs["text"] = de.read_string( - _SCHEMA_SYNTHESIZE_SPEECH_INPUT.members["Text"] - ) - - case 7: - kwargs["text_type"] = TextType( - de.read_string( - _SCHEMA_SYNTHESIZE_SPEECH_INPUT.members["TextType"] - ) - ) - - case 8: - kwargs["voice_id"] = VoiceId( - de.read_string( - _SCHEMA_SYNTHESIZE_SPEECH_INPUT.members["VoiceId"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SYNTHESIZE_SPEECH_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class SynthesizeSpeechOutput: - """Dataclass for SynthesizeSpeechOutput structure.""" - - audio_stream: StreamingBlob = b64decode("") - """Stream containing the synthesized speech.""" - - content_type: str | None = None - """ - Specifies the type audio stream. This should reflect the `OutputFormat` - parameter in your request. - - - If you request `mp3` as the `OutputFormat`, the `ContentType` returned - is audio/mpeg. - - - If you request `ogg_vorbis` as the `OutputFormat`, the `ContentType` - returned is audio/ogg. - - - If you request `ogg_opus` as the `OutputFormat`, the `ContentType` - returned is audio/ogg. - - - If you request `pcm` as the `OutputFormat`, the `ContentType` returned - is audio/pcm in a signed 16-bit, 1 channel (mono), little-endian - format. - - - If you request `mu-law` as the `OutputFormat`, the `ContentType` - returned is audio/mulaw. - - - If you request `a-law` as the `OutputFormat`, the `ContentType` - returned is audio/alaw. - - - If you request `json` as the `OutputFormat`, the `ContentType` - returned is application/x-json-stream. - """ - - request_characters: int = 0 - """Number of characters synthesized.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False +SYNTHESIZE_SPEECH: APIOperation[SynthesizeSpeechInput, SynthesizeSpeechOutput] = ( + APIOperation( + static_schema=_SCHEMA_SYNTHESIZE_SPEECH, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.polly#EngineNotSupportedException"), + ShapeID("com.amazonaws.polly#InvalidSampleRateException"), + ShapeID("com.amazonaws.polly#InvalidSsmlException"), + ShapeID("com.amazonaws.polly#LanguageNotSupportedException"), + ShapeID("com.amazonaws.polly#LexiconNotFoundException"), + ShapeID("com.amazonaws.polly#MarksNotSupportedForFormatException"), + ShapeID("com.amazonaws.polly#ServiceFailureException"), + ShapeID("com.amazonaws.polly#SsmlMarksNotSupportedForTextTypeException"), + ShapeID("com.amazonaws.polly#TextLengthExceededException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SYNTHESIZE_SPEECH_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_data_stream( - _SCHEMA_SYNTHESIZE_SPEECH_OUTPUT.members["AudioStream"], self.audio_stream - ) - if self.content_type is not None: - serializer.write_string( - _SCHEMA_SYNTHESIZE_SPEECH_OUTPUT.members["ContentType"], - self.content_type, - ) - - serializer.write_integer( - _SCHEMA_SYNTHESIZE_SPEECH_OUTPUT.members["RequestCharacters"], - self.request_characters, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["audio_stream"] = de.read_data_stream( - _SCHEMA_SYNTHESIZE_SPEECH_OUTPUT.members["AudioStream"] - ) - - case 1: - kwargs["content_type"] = de.read_string( - _SCHEMA_SYNTHESIZE_SPEECH_OUTPUT.members["ContentType"] - ) - - case 2: - kwargs["request_characters"] = de.read_integer( - _SCHEMA_SYNTHESIZE_SPEECH_OUTPUT.members["RequestCharacters"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SYNTHESIZE_SPEECH_OUTPUT, consumer=_consumer) - return kwargs - - -SYNTHESIZE_SPEECH = APIOperation( - input=SynthesizeSpeechInput, - output=SynthesizeSpeechOutput, - schema=_SCHEMA_SYNTHESIZE_SPEECH, - input_schema=_SCHEMA_SYNTHESIZE_SPEECH_INPUT, - output_schema=_SCHEMA_SYNTHESIZE_SPEECH_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.polly#EngineNotSupportedException" - ): EngineNotSupportedException, - ShapeID( - "com.amazonaws.polly#InvalidSampleRateException" - ): InvalidSampleRateException, - ShapeID("com.amazonaws.polly#InvalidSsmlException"): InvalidSsmlException, - ShapeID( - "com.amazonaws.polly#LanguageNotSupportedException" - ): LanguageNotSupportedException, - ShapeID( - "com.amazonaws.polly#LexiconNotFoundException" - ): LexiconNotFoundException, - ShapeID( - "com.amazonaws.polly#MarksNotSupportedForFormatException" - ): MarksNotSupportedForFormatException, - ShapeID( - "com.amazonaws.polly#ServiceFailureException" - ): ServiceFailureException, - ShapeID( - "com.amazonaws.polly#SsmlMarksNotSupportedForTextTypeException" - ): SsmlMarksNotSupportedForTextTypeException, - ShapeID( - "com.amazonaws.polly#TextLengthExceededException" - ): TextLengthExceededException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ENGINE_NOT_SUPPORTED_EXCEPTION, - _SCHEMA_INVALID_SAMPLE_RATE_EXCEPTION, - _SCHEMA_INVALID_SSML_EXCEPTION, - _SCHEMA_LANGUAGE_NOT_SUPPORTED_EXCEPTION, - _SCHEMA_LEXICON_NOT_FOUND_EXCEPTION, - _SCHEMA_MARKS_NOT_SUPPORTED_FOR_FORMAT_EXCEPTION, - _SCHEMA_SERVICE_FAILURE_EXCEPTION, - _SCHEMA_SSML_MARKS_NOT_SUPPORTED_FOR_TEXT_TYPE_EXCEPTION, - _SCHEMA_TEXT_LENGTH_EXCEEDED_EXCEPTION, - ], ) diff --git a/clients/aws-sdk-polly/src/aws_sdk_polly/models.pyi b/clients/aws-sdk-polly/src/aws_sdk_polly/models.pyi new file mode 100644 index 00000000..0754737e --- /dev/null +++ b/clients/aws-sdk-polly/src/aws_sdk_polly/models.pyi @@ -0,0 +1,1439 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. + +from dataclasses import dataclass +from datetime import datetime +from enum import StrEnum +from typing import Self, Union + +from smithy_core.aio.interfaces import StreamingBlob +from smithy_core.deserializers import ShapeDeserializer +from smithy_core.exceptions import ModeledError +from smithy_core.response import ResponseMetadata +from smithy_core.schemas import APIOperation +from smithy_core.serializers import ShapeSerializer +from smithy_core.types import UnknownEnumMixin + +class _SerdeShape: + def serialize(self, serializer: ShapeSerializer) -> None: ... + def serialize_members(self, serializer: ShapeSerializer) -> None: ... + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: ... + +class ServiceError(ModeledError): + """ + Base error for all errors in the service. + + Some exceptions do not extend from this class, including + synthetic, implicit, and shared exception types. + """ + +@dataclass(kw_only=True) +class AudioEvent(_SerdeShape): + """Contains a chunk of synthesized audio data.""" + + audio_chunk: bytes | None = ... + """ + A chunk of synthesized audio data encoded in the format specified by the + `OutputFormat` parameter. + """ + +@dataclass(kw_only=True) +class CloseStreamEvent(_SerdeShape): + """ + Indicates the end of the input stream. After sending this event, the + input stream will be closed and all audio will be returned. + """ + +@dataclass(kw_only=True) +class DeleteLexiconInput(_SerdeShape): + """Dataclass for DeleteLexiconInput structure.""" + + name: str | None = ... + """ + The name of the lexicon to delete. Must be an existing lexicon in the + region. + """ + +@dataclass(kw_only=True) +class DeleteLexiconOutput(_SerdeShape): + """Dataclass for DeleteLexiconOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DescribeVoicesInput(_SerdeShape): + """Dataclass for DescribeVoicesInput structure.""" + + engine: str | None = ... + """ + Specifies the engine (`standard`, `neural`, `long-form` or `generative`) + used by Amazon Polly when processing input text for speech synthesis. + """ + language_code: str | None = ... + """ + The language identification tag (ISO 639 code for the language name-ISO + 3166 country code) for filtering the list of voices returned. If you + don't specify this optional parameter, all available voices are + returned. + """ + include_additional_language_codes: bool = ... + """ + Boolean value indicating whether to return any bilingual voices that use + the specified language as an additional language. For instance, if you + request all languages that use US English (es-US), and there is an + Italian voice that speaks both Italian (it-IT) and US English, that + voice will be included if you specify `yes` but not if you specify `no`. + """ + next_token: str | None = ... + """ + An opaque pagination token returned from the previous `DescribeVoices` + operation. If present, this indicates where to continue the listing. + """ + +@dataclass(kw_only=True) +class DescribeVoicesOutput(_SerdeShape): + """Dataclass for DescribeVoicesOutput structure.""" + + voices: list[Voice] | None = ... + """A list of voices with their properties.""" + next_token: str | None = ... + """ + The pagination token to use in the next request to continue the listing + of voices. `NextToken` is returned only if the response is truncated. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class Engine(UnknownEnumMixin, StrEnum): + STANDARD = "standard" + NEURAL = "neural" + LONG_FORM = "long-form" + GENERATIVE = "generative" + +@dataclass(kw_only=True) +class EngineNotSupportedException(ServiceError, _SerdeShape): + """ + This engine is not compatible with the voice that you have designated. + Choose a new voice that is compatible with the engine or change the + engine and restart the operation. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class FlushStreamConfiguration(_SerdeShape): + """ + Configuration that controls when synthesized audio data is sent on the + output stream. + """ + + force: bool = ... + """ + Specifies whether to force the synthesis engine to immediately write + buffered audio data to the output stream. + """ + +class Gender(UnknownEnumMixin, StrEnum): + FEMALE = "Female" + MALE = "Male" + +@dataclass(kw_only=True) +class GetLexiconInput(_SerdeShape): + """Dataclass for GetLexiconInput structure.""" + + name: str | None = ... + """Name of the lexicon.""" + +@dataclass(kw_only=True) +class GetLexiconOutput(_SerdeShape): + """Dataclass for GetLexiconOutput structure.""" + + lexicon: Lexicon | None = ... + """Lexicon object that provides name and the string content of the lexicon.""" + lexicon_attributes: LexiconAttributes | None = ... + """ + Metadata of the lexicon, including phonetic alphabetic used, language + code, lexicon ARN, number of lexemes defined in the lexicon, and size of + lexicon in bytes. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetSpeechSynthesisTaskInput(_SerdeShape): + """Dataclass for GetSpeechSynthesisTaskInput structure.""" + + task_id: str | None = ... + """The Amazon Polly generated identifier for a speech synthesis task.""" + +@dataclass(kw_only=True) +class GetSpeechSynthesisTaskOutput(_SerdeShape): + """Dataclass for GetSpeechSynthesisTaskOutput structure.""" + + synthesis_task: SynthesisTask | None = ... + """ + SynthesisTask object that provides information from the requested task, + including output format, creation time, task status, and so on. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidLexiconException(ServiceError, _SerdeShape): + """ + Amazon Polly can't find the specified lexicon. Verify that the + lexicon's name is spelled correctly, and then try again. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidNextTokenException(ServiceError, _SerdeShape): + """ + The NextToken is invalid. Verify that it's spelled correctly, and then + try again. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidS3BucketException(ServiceError, _SerdeShape): + """ + The provided Amazon S3 bucket name is invalid. Please check your input + with S3 bucket naming requirements and try again. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidS3KeyException(ServiceError, _SerdeShape): + """ + The provided Amazon S3 key prefix is invalid. Please provide a valid S3 + object key name. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidSampleRateException(ServiceError, _SerdeShape): + """The specified sample rate is not valid.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidSnsTopicArnException(ServiceError, _SerdeShape): + """ + The provided SNS topic ARN is invalid. Please provide a valid SNS topic + ARN and try again. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidSsmlException(ServiceError, _SerdeShape): + """ + The SSML you provided is invalid. Verify the SSML syntax, spelling of + tags and values, and then try again. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidTaskIdException(ServiceError, _SerdeShape): + """ + The provided Task ID is not valid. Please provide a valid Task ID and + try again. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class LanguageCode(UnknownEnumMixin, StrEnum): + ARB = "arb" + CMN_CN = "cmn-CN" + CY_GB = "cy-GB" + DA_DK = "da-DK" + DE_DE = "de-DE" + EN_AU = "en-AU" + EN_GB = "en-GB" + EN_GB_WLS = "en-GB-WLS" + EN_IN = "en-IN" + EN_US = "en-US" + ES_ES = "es-ES" + ES_MX = "es-MX" + ES_US = "es-US" + FR_CA = "fr-CA" + FR_FR = "fr-FR" + IS_IS = "is-IS" + IT_IT = "it-IT" + JA_JP = "ja-JP" + HI_IN = "hi-IN" + KO_KR = "ko-KR" + NB_NO = "nb-NO" + NL_NL = "nl-NL" + PL_PL = "pl-PL" + PT_BR = "pt-BR" + PT_PT = "pt-PT" + RO_RO = "ro-RO" + RU_RU = "ru-RU" + SV_SE = "sv-SE" + TR_TR = "tr-TR" + EN_NZ = "en-NZ" + EN_ZA = "en-ZA" + CA_ES = "ca-ES" + DE_AT = "de-AT" + YUE_CN = "yue-CN" + AR_AE = "ar-AE" + FI_FI = "fi-FI" + EN_IE = "en-IE" + NL_BE = "nl-BE" + FR_BE = "fr-BE" + CS_CZ = "cs-CZ" + DE_CH = "de-CH" + EN_SG = "en-SG" + +@dataclass(kw_only=True) +class LanguageNotSupportedException(ServiceError, _SerdeShape): + """ + The language specified is not currently supported by Amazon Polly in + this capacity. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class Lexicon(_SerdeShape): + """ + Provides lexicon name and lexicon content in string format. For more + information, see [Pronunciation Lexicon Specification (PLS) Version + 1.0](https://www.w3.org/TR/pronunciation-lexicon/). + """ + + content: str | None = ... + """ + Lexicon content in string format. The content of a lexicon must be in + PLS format. + """ + name: str | None = ... + """Name of the lexicon.""" + +@dataclass(kw_only=True) +class LexiconAttributes(_SerdeShape): + """ + Contains metadata describing the lexicon such as the number of lexemes, + language code, and so on. For more information, see [Managing + Lexicons](https://docs.aws.amazon.com/polly/latest/dg/managing-lexicons.html). + """ + + alphabet: str | None = ... + """ + Phonetic alphabet used in the lexicon. Valid values are `ipa` and + `x-sampa`. + """ + language_code: str | None = ... + """ + Language code that the lexicon applies to. A lexicon with a language + code such as \"en\" would be applied to all English languages (en-GB, + en-US, en-AUS, en-WLS, and so on. + """ + last_modified: datetime | None = ... + """Date lexicon was last modified (a timestamp value).""" + lexicon_arn: str | None = ... + """Amazon Resource Name (ARN) of the lexicon.""" + lexemes_count: int = ... + """Number of lexemes in the lexicon.""" + size: int = ... + """Total size of the lexicon, in characters.""" + +@dataclass(kw_only=True) +class LexiconDescription(_SerdeShape): + """Describes the content of the lexicon.""" + + name: str | None = ... + """Name of the lexicon.""" + attributes: LexiconAttributes | None = ... + """Provides lexicon metadata.""" + +@dataclass(kw_only=True) +class LexiconNotFoundException(ServiceError, _SerdeShape): + """ + Amazon Polly can't find the specified lexicon. This could be caused by + a lexicon that is missing, its name is misspelled or specifying a + lexicon that is in a different region. + + Verify that the lexicon exists, is in the region (see ListLexicons) and + that you spelled its name is spelled correctly. Then try again. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class LexiconSizeExceededException(ServiceError, _SerdeShape): + """ + The maximum size of the specified lexicon would be exceeded by this + operation. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListLexiconsInput(_SerdeShape): + """Dataclass for ListLexiconsInput structure.""" + + next_token: str | None = ... + """ + An opaque pagination token returned from previous `ListLexicons` + operation. If present, indicates where to continue the list of lexicons. + """ + +@dataclass(kw_only=True) +class ListLexiconsOutput(_SerdeShape): + """Dataclass for ListLexiconsOutput structure.""" + + lexicons: list[LexiconDescription] | None = ... + """A list of lexicon names and attributes.""" + next_token: str | None = ... + """ + The pagination token to use in the next request to continue the listing + of lexicons. `NextToken` is returned only if the response is truncated. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListSpeechSynthesisTasksInput(_SerdeShape): + """Dataclass for ListSpeechSynthesisTasksInput structure.""" + + max_results: int | None = ... + """Maximum number of speech synthesis tasks returned in a List operation.""" + next_token: str | None = ... + """ + The pagination token to use in the next request to continue the listing + of speech synthesis tasks. + """ + status: str | None = ... + """Status of the speech synthesis tasks returned in a List operation""" + +@dataclass(kw_only=True) +class ListSpeechSynthesisTasksOutput(_SerdeShape): + """Dataclass for ListSpeechSynthesisTasksOutput structure.""" + + next_token: str | None = ... + """ + An opaque pagination token returned from the previous List operation in + this request. If present, this indicates where to continue the listing. + """ + synthesis_tasks: list[SynthesisTask] | None = ... + """ + List of SynthesisTask objects that provides information from the + specified task in the list request, including output format, creation + time, task status, and so on. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class MarksNotSupportedForFormatException(ServiceError, _SerdeShape): + """ + Speech marks are not supported for the `OutputFormat` selected. Speech + marks are only available for content in `json` format. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class MaxLexemeLengthExceededException(ServiceError, _SerdeShape): + """The maximum size of the lexeme would be exceeded by this operation.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class MaxLexiconsNumberExceededException(ServiceError, _SerdeShape): + """The maximum number of lexicons would be exceeded by this operation.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class OutputFormat(UnknownEnumMixin, StrEnum): + JSON = "json" + MP3 = "mp3" + OGG_OPUS = "ogg_opus" + OGG_VORBIS = "ogg_vorbis" + PCM = "pcm" + MULAW = "mulaw" + ALAW = "alaw" + +@dataclass(kw_only=True) +class PutLexiconInput(_SerdeShape): + """Dataclass for PutLexiconInput structure.""" + + name: str | None = ... + """ + Name of the lexicon. The name must follow the regular express format + [0-9A-Za-z]{1,20}. That is, the name is a case-sensitive alphanumeric + string up to 20 characters long. + """ + content: str | None = ... + """Content of the PLS lexicon as string data.""" + +@dataclass(kw_only=True) +class PutLexiconOutput(_SerdeShape): + """Dataclass for PutLexiconOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class QuotaCode(UnknownEnumMixin, StrEnum): + INPUT_STREAM_INBOUND_EVENT_TIMEOUT = "input-stream-inbound-event-timeout" + INPUT_STREAM_TIMEOUT = "input-stream-timeout" + +class ServiceCode(UnknownEnumMixin, StrEnum): + POLLY = "polly" + +@dataclass(kw_only=True) +class ServiceFailureException(ServiceError, _SerdeShape): + """An unknown condition has caused a service failure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ServiceQuotaExceededException(ServiceError, _SerdeShape): + """The request would cause a service quota to be exceeded.""" + + quota_code: str + """The quota code identifying the specific quota.""" + service_code: str + """The service code identifying the originating service.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class SpeechMarkType(UnknownEnumMixin, StrEnum): + SENTENCE = "sentence" + SSML = "ssml" + VISEME = "viseme" + WORD = "word" + +@dataclass(kw_only=True) +class SsmlMarksNotSupportedForTextTypeException(ServiceError, _SerdeShape): + """SSML speech marks are not supported for plain text-type input.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass +class StartSpeechSynthesisStreamActionStreamTextEvent(_SerdeShape): + """A text event containing content to be synthesized.""" + + value: TextEvent + +@dataclass +class StartSpeechSynthesisStreamActionStreamCloseStreamEvent(_SerdeShape): + """An event indicating the end of the input stream.""" + + value: CloseStreamEvent + +@dataclass +class StartSpeechSynthesisStreamActionStreamUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +StartSpeechSynthesisStreamActionStream = Union[ + StartSpeechSynthesisStreamActionStreamTextEvent + | StartSpeechSynthesisStreamActionStreamCloseStreamEvent + | StartSpeechSynthesisStreamActionStreamUnknown +] +""" +Inbound event stream for sending input and control events to manage +bidirectional speech synthesis. +""" + +class _StartSpeechSynthesisStreamActionStreamDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> StartSpeechSynthesisStreamActionStream: ... + +@dataclass +class StartSpeechSynthesisStreamEventStreamAudioEvent(_SerdeShape): + """An audio event containing synthesized speech.""" + + value: AudioEvent + +@dataclass +class StartSpeechSynthesisStreamEventStreamStreamClosedEvent(_SerdeShape): + """An event, with summary information, indicating the stream has closed.""" + + value: StreamClosedEvent + +@dataclass +class StartSpeechSynthesisStreamEventStreamValidationException(_SerdeShape): + """An exception indicating the input failed validation.""" + + value: ValidationException + +@dataclass +class StartSpeechSynthesisStreamEventStreamServiceQuotaExceededException(_SerdeShape): + """An exception indicating a service quota would be exceeded.""" + + value: ServiceQuotaExceededException + +@dataclass +class StartSpeechSynthesisStreamEventStreamServiceFailureException(_SerdeShape): + """An unknown condition has caused a service failure.""" + + value: ServiceFailureException + +@dataclass +class StartSpeechSynthesisStreamEventStreamThrottlingException(_SerdeShape): + """An exception indicating the request was throttled.""" + + value: ThrottlingException + +@dataclass +class StartSpeechSynthesisStreamEventStreamUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +StartSpeechSynthesisStreamEventStream = Union[ + StartSpeechSynthesisStreamEventStreamAudioEvent + | StartSpeechSynthesisStreamEventStreamStreamClosedEvent + | StartSpeechSynthesisStreamEventStreamValidationException + | StartSpeechSynthesisStreamEventStreamServiceQuotaExceededException + | StartSpeechSynthesisStreamEventStreamServiceFailureException + | StartSpeechSynthesisStreamEventStreamThrottlingException + | StartSpeechSynthesisStreamEventStreamUnknown +] +""" +Outbound event stream that contains synthesized audio data and stream +status events. +""" + +class _StartSpeechSynthesisStreamEventStreamDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> StartSpeechSynthesisStreamEventStream: ... + +@dataclass(kw_only=True) +class StartSpeechSynthesisStreamInput(_SerdeShape): + """Dataclass for StartSpeechSynthesisStreamInput structure.""" + + engine: str | None = ... + """ + Specifies the engine for Amazon Polly to use when processing input text + for speech synthesis. Currently, only the `generative` engine is + supported. If you specify a voice that the selected engine doesn't + support, Amazon Polly returns an error. + """ + language_code: str | None = ... + """ + An optional parameter that sets the language code for the speech + synthesis request. Specify this parameter only when using a bilingual + voice. If a bilingual voice is used and no language code is specified, + Amazon Polly uses the default language of the bilingual voice. + """ + lexicon_names: list[str] | None = ... + """ + The names of one or more pronunciation lexicons for the service to apply + during synthesis. Amazon Polly applies lexicons only when the lexicon + language matches the voice language. + """ + output_format: str | None = ... + """ + The audio format for the synthesized speech. Currently, Amazon Polly + does not support JSON speech marks. + """ + sample_rate: str | None = ... + """The audio frequency, specified in Hz.""" + voice_id: str | None = ... + """ + The voice to use in synthesis. To get a list of available voice IDs, use + the + [DescribeVoices](https://docs.aws.amazon.com/polly/latest/API/API_DescribeVoices.html) + operation. + """ + +@dataclass(kw_only=True) +class StartSpeechSynthesisStreamOutput(_SerdeShape): + """Dataclass for StartSpeechSynthesisStreamOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class StartSpeechSynthesisTaskInput(_SerdeShape): + """Dataclass for StartSpeechSynthesisTaskInput structure.""" + + engine: str | None = ... + """ + Specifies the engine (`standard`, `neural`, `long-form` or `generative`) + for Amazon Polly to use when processing input text for speech synthesis. + Using a voice that is not supported for the engine selected will result + in an error. + """ + language_code: str | None = ... + """ + Optional language code for the Speech Synthesis request. This is only + necessary if using a bilingual voice, such as Aditi, which can be used + for either Indian English (en-IN) or Hindi (hi-IN). + + If a bilingual voice is used and no language code is specified, Amazon + Polly uses the default language of the bilingual voice. The default + language for any voice is the one returned by the + [DescribeVoices](https://docs.aws.amazon.com/polly/latest/dg/API_DescribeVoices.html) + operation for the `LanguageCode` parameter. For example, if no language + code is specified, Aditi will use Indian English rather than Hindi. + """ + lexicon_names: list[str] | None = ... + """ + List of one or more pronunciation lexicon names you want the service to + apply during synthesis. Lexicons are applied only if the language of the + lexicon is the same as the language of the voice. + """ + output_format: str | None = ... + """ + The format in which the returned output will be encoded. For audio + stream, this will be mp3, ogg_vorbis, ogg_opus, mu-law, a-law, or pcm. + For speech marks, this will be json. + """ + output_s3_bucket_name: str | None = ... + """Amazon S3 bucket name to which the output file will be saved.""" + output_s3_key_prefix: str | None = ... + """The Amazon S3 key prefix for the output speech file.""" + sample_rate: str | None = ... + """ + The audio frequency specified in Hz. + + The valid values for mp3 and ogg_vorbis are \"8000\", \"16000\", + \"22050\", and \"24000\". The default value for standard voices is + \"22050\". The default value for neural voices is \"24000\". The default + value for long-form voices is \"24000\". The default value for + generative voices is \"24000\". + + Valid values for pcm are \"8000\" and \"16000\" The default value is + \"16000\". + + Valid value for ogg_opus is \"48000\". + + Valid value for mu-law and a-law is \"8000\". + """ + sns_topic_arn: str | None = ... + """ + ARN for the SNS topic optionally used for providing status notification + for a speech synthesis task. + """ + speech_mark_types: list[str] | None = ... + """The type of speech marks returned for the input text.""" + text: str | None = ... + """ + The input text to synthesize. If you specify ssml as the TextType, + follow the SSML format for the input text. + """ + text_type: str | None = ... + """ + Specifies whether the input text is plain text or SSML. The default + value is plain text. + """ + voice_id: str | None = ... + """Voice ID to use for the synthesis.""" + +@dataclass(kw_only=True) +class StartSpeechSynthesisTaskOutput(_SerdeShape): + """Dataclass for StartSpeechSynthesisTaskOutput structure.""" + + synthesis_task: SynthesisTask | None = ... + """ + SynthesisTask object that provides information and attributes about a + newly submitted speech synthesis task. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class StreamClosedEvent(_SerdeShape): + """ + Indicates that the synthesis stream is closed and provides summary + information. + """ + + request_characters: int = ... + """The total number of characters synthesized during the streaming session.""" + +@dataclass(kw_only=True) +class SynthesisTask(_SerdeShape): + """ + SynthesisTask object that provides information about a speech synthesis + task. + """ + + engine: str | None = ... + """ + Specifies the engine (`standard`, `neural`, `long-form` or `generative`) + for Amazon Polly to use when processing input text for speech synthesis. + Using a voice that is not supported for the engine selected will result + in an error. + """ + task_id: str | None = ... + """The Amazon Polly generated identifier for a speech synthesis task.""" + task_status: str | None = ... + """Current status of the individual speech synthesis task.""" + task_status_reason: str | None = ... + """ + Reason for the current status of a specific speech synthesis task, + including errors if the task has failed. + """ + output_uri: str | None = ... + """Pathway for the output speech file.""" + creation_time: datetime | None = ... + """Timestamp for the time the synthesis task was started.""" + request_characters: int = ... + """Number of billable characters synthesized.""" + sns_topic_arn: str | None = ... + """ + ARN for the SNS topic optionally used for providing status notification + for a speech synthesis task. + """ + lexicon_names: list[str] | None = ... + """ + List of one or more pronunciation lexicon names you want the service to + apply during synthesis. Lexicons are applied only if the language of the + lexicon is the same as the language of the voice. + """ + output_format: str | None = ... + """ + The format in which the returned output will be encoded. For audio + stream, this will be mp3, ogg_vorbis, ogg_opus, mu-law, a-law, or pcm. + For speech marks, this will be json. + """ + sample_rate: str | None = ... + """ + The audio frequency specified in Hz. + + The valid values for mp3 and ogg_vorbis are \"8000\", \"16000\", + \"22050\", and \"24000\". The default value for standard voices is + \"22050\". The default value for neural voices is \"24000\". The default + value for long-form voices is \"24000\". The default value for + generative voices is \"24000\". + + Valid values for pcm are \"8000\" and \"16000\" The default value is + \"16000\". + + Valid value for ogg_opus is \"48000\". + + Valid value for mu-law and a-law is \"8000\". + """ + speech_mark_types: list[str] | None = ... + """The type of speech marks returned for the input text.""" + text_type: str | None = ... + """ + Specifies whether the input text is plain text or SSML. The default + value is plain text. + """ + voice_id: str | None = ... + """Voice ID to use for the synthesis.""" + language_code: str | None = ... + """ + Optional language code for a synthesis task. This is only necessary if + using a bilingual voice, such as Aditi, which can be used for either + Indian English (en-IN) or Hindi (hi-IN). + + If a bilingual voice is used and no language code is specified, Amazon + Polly uses the default language of the bilingual voice. The default + language for any voice is the one returned by the + [DescribeVoices](https://docs.aws.amazon.com/polly/latest/dg/API_DescribeVoices.html) + operation for the `LanguageCode` parameter. For example, if no language + code is specified, Aditi will use Indian English rather than Hindi. + """ + +@dataclass(kw_only=True) +class SynthesisTaskNotFoundException(ServiceError, _SerdeShape): + """The Speech Synthesis task with requested Task ID cannot be found.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class SynthesizeSpeechInput(_SerdeShape): + """Dataclass for SynthesizeSpeechInput structure.""" + + engine: str | None = ... + """ + Specifies the engine (`standard`, `neural`, `long-form`, or + `generative`) for Amazon Polly to use when processing input text for + speech synthesis. Provide an engine that is supported by the voice you + select. If you don't provide an engine, the standard engine is selected + by default. If a chosen voice isn't supported by the standard engine, + this will result in an error. For information on Amazon Polly voices and + which voices are available for each engine, see [Available + Voices](https://docs.aws.amazon.com/polly/latest/dg/voicelist.html). + """ + language_code: str | None = ... + """ + Optional language code for the Synthesize Speech request. This is only + necessary if using a bilingual voice, such as Aditi, which can be used + for either Indian English (en-IN) or Hindi (hi-IN). + + If a bilingual voice is used and no language code is specified, Amazon + Polly uses the default language of the bilingual voice. The default + language for any voice is the one returned by the + [DescribeVoices](https://docs.aws.amazon.com/polly/latest/dg/API_DescribeVoices.html) + operation for the `LanguageCode` parameter. For example, if no language + code is specified, Aditi will use Indian English rather than Hindi. + """ + lexicon_names: list[str] | None = ... + """ + List of one or more pronunciation lexicon names you want the service to + apply during synthesis. Lexicons are applied only if the language of the + lexicon is the same as the language of the voice. For information about + storing lexicons, see + [PutLexicon](https://docs.aws.amazon.com/polly/latest/dg/API_PutLexicon.html). + """ + output_format: str | None = ... + """ + The format in which the returned output will be encoded. For audio + stream, this will be mp3, ogg_vorbis, ogg_opus, mu-law, a-law or pcm. + For speech marks, this will be json. + + When pcm is used, the content returned is audio/pcm in a signed 16-bit, + 1 channel (mono), little-endian format. + """ + sample_rate: str | None = ... + """ + The audio frequency specified in Hz. + + The valid values for mp3 and ogg_vorbis are \"8000\", \"16000\", + \"22050\", \"24000\", \"44100\" and \"48000\". The default value for + standard voices is \"22050\". The default value for neural voices is + \"24000\". The default value for long-form voices is \"24000\". The + default value for generative voices is \"24000\". + + Valid values for pcm are \"8000\" and \"16000\" The default value is + \"16000\". + + Valid value for ogg_opus is \"48000\". + + Valid value for mu-law and a-law is \"8000\". + """ + speech_mark_types: list[str] | None = ... + """The type of speech marks returned for the input text.""" + text: str | None = ... + """ + Input text to synthesize. If you specify `ssml` as the `TextType`, + follow the SSML format for the input text. + """ + text_type: str | None = ... + """ + Specifies whether the input text is plain text or SSML. The default + value is plain text. For more information, see [Using + SSML](https://docs.aws.amazon.com/polly/latest/dg/ssml.html). + """ + voice_id: str | None = ... + """ + Voice ID to use for the synthesis. You can get a list of available voice + IDs by calling the + [DescribeVoices](https://docs.aws.amazon.com/polly/latest/dg/API_DescribeVoices.html) + operation. + """ + +@dataclass(kw_only=True) +class SynthesizeSpeechOutput(_SerdeShape): + """Dataclass for SynthesizeSpeechOutput structure.""" + + audio_stream: StreamingBlob = ... + """Stream containing the synthesized speech.""" + content_type: str | None = ... + """ + Specifies the type audio stream. This should reflect the `OutputFormat` + parameter in your request. + + - If you request `mp3` as the `OutputFormat`, the `ContentType` returned + is audio/mpeg. + + - If you request `ogg_vorbis` as the `OutputFormat`, the `ContentType` + returned is audio/ogg. + + - If you request `ogg_opus` as the `OutputFormat`, the `ContentType` + returned is audio/ogg. + + - If you request `pcm` as the `OutputFormat`, the `ContentType` returned + is audio/pcm in a signed 16-bit, 1 channel (mono), little-endian + format. + + - If you request `mu-law` as the `OutputFormat`, the `ContentType` + returned is audio/mulaw. + + - If you request `a-law` as the `OutputFormat`, the `ContentType` + returned is audio/alaw. + + - If you request `json` as the `OutputFormat`, the `ContentType` + returned is application/x-json-stream. + """ + request_characters: int = ... + """Number of characters synthesized.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class TaskStatus(UnknownEnumMixin, StrEnum): + SCHEDULED = "scheduled" + IN_PROGRESS = "inProgress" + COMPLETED = "completed" + FAILED = "failed" + +@dataclass(kw_only=True) +class TextEvent(_SerdeShape): + """Contains text content to be synthesized into speech.""" + + text: str + """ + The text content to synthesize. If you specify `ssml` as the `TextType`, + follow the SSML format for the input text. + """ + text_type: str | None = ... + """ + Specifies whether the input text is plain text or SSML. Default: plain + text. + """ + flush_stream_configuration: FlushStreamConfiguration | None = ... + """ + Configuration for controlling when synthesized audio flushes to the + output stream. + """ + +@dataclass(kw_only=True) +class TextLengthExceededException(ServiceError, _SerdeShape): + """ + The value of the \"Text\" parameter is longer than the accepted limits. + For the `SynthesizeSpeech` API, the limit for input text is a maximum of + 6000 characters total, of which no more than 3000 can be billed + characters. For the `StartSpeechSynthesisTask` API, the maximum is + 200,000 characters, of which no more than 100,000 can be billed + characters. SSML tags are not counted as billed characters. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class TextType(UnknownEnumMixin, StrEnum): + SSML = "ssml" + TEXT = "text" + +@dataclass(kw_only=True) +class ThrottlingException(ServiceError, _SerdeShape): + """The request was denied because of request throttling.""" + + throttling_reasons: list[ThrottlingReason] | None = ... + """A list of reasons explaining why the request was throttled.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ThrottlingReason(_SerdeShape): + """Provides information about a specific throttling reason.""" + + reason: str | None = ... + """The reason code explaining why the request was throttled.""" + resource: str | None = ... + """The resource that caused the throttling.""" + +@dataclass(kw_only=True) +class UnsupportedPlsAlphabetException(ServiceError, _SerdeShape): + """ + The alphabet specified by the lexicon is not a supported alphabet. Valid + values are `x-sampa` and `ipa`. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UnsupportedPlsLanguageException(ServiceError, _SerdeShape): + """ + The language specified in the lexicon is unsupported. For a list of + supported languages, see [Lexicon + Attributes](https://docs.aws.amazon.com/polly/latest/dg/API_LexiconAttributes.html). + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ValidationException(ServiceError, _SerdeShape): + """The input fails to satisfy the constraints specified by the service.""" + + reason: str + """The reason the request failed validation.""" + fields: list[ValidationExceptionField] | None = ... + """The fields that caused the validation error.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ValidationExceptionField(_SerdeShape): + """Information about a field that failed validation.""" + + name: str + """The name of the field that failed validation.""" + message: str + """A message describing why the field failed validation.""" + +class ValidationExceptionReason(UnknownEnumMixin, StrEnum): + UNSUPPORTED_OPERATION = "unsupportedOperation" + FIELD_VALIDATION_FAILED = "fieldValidationFailed" + OTHER = "other" + INVALID_INBOUND_EVENT = "invalidInboundEvent" + +@dataclass(kw_only=True) +class Voice(_SerdeShape): + """Description of the voice.""" + + gender: str | None = ... + """Gender of the voice.""" + id: str | None = ... + """ + Amazon Polly assigned voice ID. This is the ID that you specify when + calling the `SynthesizeSpeech` operation. + """ + language_code: str | None = ... + """Language code of the voice.""" + language_name: str | None = ... + """Human readable name of the language in English.""" + name: str | None = ... + """ + Name of the voice (for example, Salli, Kendra, etc.). This provides a + human readable voice name that you might display in your application. + """ + additional_language_codes: list[str] | None = ... + """ + Additional codes for languages available for the specified voice in + addition to its default language. + + For example, the default language for Aditi is Indian English (en-IN) + because it was first used for that language. Since Aditi is bilingual + and fluent in both Indian English and Hindi, this parameter would show + the code `hi-IN`. + """ + supported_engines: list[str] | None = ... + """ + Specifies which engines (`standard`, `neural`, `long-form` or + `generative`) are supported by a given voice. + """ + +class VoiceId(UnknownEnumMixin, StrEnum): + ADITI = "Aditi" + AMY = "Amy" + ASTRID = "Astrid" + BIANCA = "Bianca" + BRIAN = "Brian" + CAMILA = "Camila" + CARLA = "Carla" + CARMEN = "Carmen" + CELINE = "Celine" + CHANTAL = "Chantal" + CONCHITA = "Conchita" + CRISTIANO = "Cristiano" + DORA = "Dora" + EMMA = "Emma" + ENRIQUE = "Enrique" + EWA = "Ewa" + FILIZ = "Filiz" + GABRIELLE = "Gabrielle" + GERAINT = "Geraint" + GIORGIO = "Giorgio" + GWYNETH = "Gwyneth" + HANS = "Hans" + INES = "Ines" + IVY = "Ivy" + JACEK = "Jacek" + JAN = "Jan" + JOANNA = "Joanna" + JOEY = "Joey" + JUSTIN = "Justin" + KARL = "Karl" + KENDRA = "Kendra" + KEVIN = "Kevin" + KIMBERLY = "Kimberly" + LEA = "Lea" + LIV = "Liv" + LOTTE = "Lotte" + LUCIA = "Lucia" + LUPE = "Lupe" + MADS = "Mads" + MAJA = "Maja" + MARLENE = "Marlene" + MATHIEU = "Mathieu" + MATTHEW = "Matthew" + MAXIM = "Maxim" + MIA = "Mia" + MIGUEL = "Miguel" + MIZUKI = "Mizuki" + NAJA = "Naja" + NICOLE = "Nicole" + OLIVIA = "Olivia" + PENELOPE = "Penelope" + RAVEENA = "Raveena" + RICARDO = "Ricardo" + RUBEN = "Ruben" + RUSSELL = "Russell" + SALLI = "Salli" + SEOYEON = "Seoyeon" + TAKUMI = "Takumi" + TATYANA = "Tatyana" + VICKI = "Vicki" + VITORIA = "Vitoria" + ZEINA = "Zeina" + ZHIYU = "Zhiyu" + ARIA = "Aria" + AYANDA = "Ayanda" + ARLET = "Arlet" + HANNAH = "Hannah" + ARTHUR = "Arthur" + DANIEL = "Daniel" + LIAM = "Liam" + PEDRO = "Pedro" + KAJAL = "Kajal" + HIUJIN = "Hiujin" + LAURA = "Laura" + ELIN = "Elin" + IDA = "Ida" + SUVI = "Suvi" + OLA = "Ola" + HALA = "Hala" + ANDRES = "Andres" + SERGIO = "Sergio" + REMI = "Remi" + ADRIANO = "Adriano" + THIAGO = "Thiago" + RUTH = "Ruth" + STEPHEN = "Stephen" + KAZUHA = "Kazuha" + TOMOKO = "Tomoko" + NIAMH = "Niamh" + SOFIE = "Sofie" + LISA = "Lisa" + ISABELLE = "Isabelle" + ZAYD = "Zayd" + DANIELLE = "Danielle" + GREGORY = "Gregory" + BURCU = "Burcu" + JITKA = "Jitka" + SABRINA = "Sabrina" + JASMINE = "Jasmine" + JIHYE = "Jihye" + AMBRE = "Ambre" + BEATRICE = "Beatrice" + FLORIAN = "Florian" + LENNART = "Lennart" + LORENZO = "Lorenzo" + TIFFANY = "Tiffany" + +DELETE_LEXICON: APIOperation[DeleteLexiconInput, DeleteLexiconOutput] +DESCRIBE_VOICES: APIOperation[DescribeVoicesInput, DescribeVoicesOutput] +GET_LEXICON: APIOperation[GetLexiconInput, GetLexiconOutput] +GET_SPEECH_SYNTHESIS_TASK: APIOperation[ + GetSpeechSynthesisTaskInput, GetSpeechSynthesisTaskOutput +] +LIST_LEXICONS: APIOperation[ListLexiconsInput, ListLexiconsOutput] +LIST_SPEECH_SYNTHESIS_TASKS: APIOperation[ + ListSpeechSynthesisTasksInput, ListSpeechSynthesisTasksOutput +] +PUT_LEXICON: APIOperation[PutLexiconInput, PutLexiconOutput] +START_SPEECH_SYNTHESIS_STREAM: APIOperation[ + StartSpeechSynthesisStreamInput, StartSpeechSynthesisStreamOutput +] +START_SPEECH_SYNTHESIS_TASK: APIOperation[ + StartSpeechSynthesisTaskInput, StartSpeechSynthesisTaskOutput +] +SYNTHESIZE_SPEECH: APIOperation[SynthesizeSpeechInput, SynthesizeSpeechOutput] diff --git a/clients/aws-sdk-polly/tests/integration/__init__.py b/clients/aws-sdk-polly/tests/integration/__init__.py index a9646263..f789ef16 100644 --- a/clients/aws-sdk-polly/tests/integration/__init__.py +++ b/clients/aws-sdk-polly/tests/integration/__init__.py @@ -1,9 +1,9 @@ # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 -from smithy_aws_core.config import AwsConfigOverrides -from smithy_aws_core.identity import EnvironmentCredentialsResolver -from smithy_http.aio.interfaces import HTTPClient +from smithy_aws_core.aio.config import AwsConfigOverrides +from smithy_aws_core.aio.identity import AsyncEnvironmentCredentialsResolver +from smithy_http.aio.interfaces import AsyncHTTPClient from aws_sdk_polly.client import AsyncPollyClient from aws_sdk_polly.config import AsyncPollyConfig @@ -17,13 +17,13 @@ async def create_polly_client( - region: str, *, transport: HTTPClient | None = None + region: str, *, transport: AsyncHTTPClient | None = None ) -> AsyncPollyClient: """Helper to create an AsyncPollyClient for a given region.""" overrides: AwsConfigOverrides = { "endpoint_uri": f"https://polly.{region}.amazonaws.com", "region": region, - "aws_credentials_identity_resolver": EnvironmentCredentialsResolver(), + "aws_credentials_identity_resolver": AsyncEnvironmentCredentialsResolver(), } if transport is not None: overrides["transport"] = transport diff --git a/clients/aws-sdk-polly/tests/integration/test_bidirectional_streaming.py b/clients/aws-sdk-polly/tests/integration/test_bidirectional_streaming.py index da35433a..23975dd1 100644 --- a/clients/aws-sdk-polly/tests/integration/test_bidirectional_streaming.py +++ b/clients/aws-sdk-polly/tests/integration/test_bidirectional_streaming.py @@ -5,7 +5,7 @@ import asyncio -from smithy_core.aio.eventstream import DuplexEventStream +from smithy_core.aio.eventstream import AsyncDuplexEventStream from smithy_http.aio.crt import AWSCRTHTTPClient from aws_sdk_polly.models import ( @@ -19,7 +19,6 @@ StartSpeechSynthesisStreamEventStreamServiceQuotaExceededException, StartSpeechSynthesisStreamEventStreamStreamClosedEvent, StartSpeechSynthesisStreamEventStreamThrottlingException, - StartSpeechSynthesisStreamEventStreamUnknown, StartSpeechSynthesisStreamEventStreamValidationException, StartSpeechSynthesisStreamInput, StartSpeechSynthesisStreamOutput, @@ -45,7 +44,7 @@ async def _send_text( - stream: DuplexEventStream[ + stream: AsyncDuplexEventStream[ StartSpeechSynthesisStreamActionStream, StartSpeechSynthesisStreamEventStream, StartSpeechSynthesisStreamOutput, @@ -62,7 +61,7 @@ async def _send_text( async def _receive_audio( - stream: DuplexEventStream[ + stream: AsyncDuplexEventStream[ StartSpeechSynthesisStreamActionStream, StartSpeechSynthesisStreamEventStream, StartSpeechSynthesisStreamOutput, @@ -85,12 +84,8 @@ async def _receive_audio( break elif isinstance(event, ERROR_EVENT_TYPES): raise event.value - elif isinstance(event, StartSpeechSynthesisStreamEventStreamUnknown): - raise RuntimeError(f"Received unknown event in stream: {event.tag}") else: - raise RuntimeError( - f"Received unexpected event type in stream: {type(event).__name__}" - ) + raise RuntimeError(f"Received unknown event in stream: {event.tag}") return audio_bytes, request_characters diff --git a/clients/aws-sdk-qbusiness/scripts/docs/generate_doc_stubs.py b/clients/aws-sdk-qbusiness/scripts/docs/generate_doc_stubs.py index 52d470bc..795f2e4b 100644 --- a/clients/aws-sdk-qbusiness/scripts/docs/generate_doc_stubs.py +++ b/clients/aws-sdk-qbusiness/scripts/docs/generate_doc_stubs.py @@ -126,7 +126,9 @@ class ClientInfo: class DocStubGenerator: """Generate markdown API Reference stubs for AWS SDK for Python v4 clients.""" - def __init__(self, client_dir: Path, output_dir: Path, service_name: str | None = None) -> None: + def __init__( + self, client_dir: Path, output_dir: Path, service_name: str | None = None + ) -> None: """ Initialize the documentation generator. @@ -190,7 +192,9 @@ def _analyze_client_package(self, package_name: str) -> ClientInfo: required = ("client", "config", "models") missing = [name for name in required if not package.modules.get(name)] if missing: - raise ValueError(f"Missing required modules in {package_name}: {', '.join(missing)}") + raise ValueError( + f"Missing required modules in {package_name}: {', '.join(missing)}" + ) # Parse submodules client_module = package.modules["client"] @@ -199,11 +203,15 @@ def _analyze_client_package(self, package_name: str) -> ClientInfo: client_class = self._find_class_with_suffix(client_module, "Client") if not client_class: - raise ValueError(f"No class ending with 'Client' found in {package_name}.client") + raise ValueError( + f"No class ending with 'Client' found in {package_name}.client" + ) config_class = self._find_class_with_suffix(config_module, "Config") if not config_class: - raise ValueError(f"No class ending with 'Config' found in {package_name}.config") + raise ValueError( + f"No class ending with 'Config' found in {package_name}.config" + ) plugin_alias = config_module.members.get("Plugin") if not plugin_alias: @@ -288,7 +296,9 @@ def _analyze_operation(self, operation: Function) -> OperationInfo: if output_type in stream_type_map: stream_type = stream_type_map[output_type] - stream_args = self._get_subscript_elements(returns, f"'{operation.name}' stream type") + stream_args = self._get_subscript_elements( + returns, f"'{operation.name}' stream type" + ) if stream_type in (StreamType.INPUT, StreamType.DUPLEX): event_input_type = stream_args[0].canonical_name @@ -316,7 +326,9 @@ def _analyze_operation(self, operation: Function) -> OperationInfo: def _get_expr(self, annotation: str | Expr | None, context: str) -> Expr: """Extract and validate an Expr from an annotation.""" if not isinstance(annotation, Expr): - raise TypeError(f"{context}: expected Expr, got {type(annotation).__name__}") + raise TypeError( + f"{context}: expected Expr, got {type(annotation).__name__}" + ) return annotation def _get_subscript_elements(self, expr: Expr, context: str) -> list[Expr]: @@ -330,7 +342,9 @@ def _get_subscript_elements(self, expr: Expr, context: str) -> list[Expr]: return [el for el in slice_expr.elements if isinstance(el, Expr)] return [slice_expr] - def _extract_models(self, models_module: Module, operations: list[OperationInfo]) -> ModelsInfo: + def _extract_models( + self, models_module: Module, operations: list[OperationInfo] + ) -> ModelsInfo: """Extract structures, unions, enums, and errors from models module.""" structures, unions, enums, errors = [], [], [], [] @@ -356,14 +370,16 @@ def _extract_models(self, models_module: Module, operations: list[OperationInfo] duplicates = [] for structure in structures: - if self._is_operation_io_type(structure.name, operations) or self._is_union_member( - structure.name, unions - ): + if self._is_operation_io_type( + structure.name, operations + ) or self._is_union_member(structure.name, unions): duplicates.append(structure) structures = [struct for struct in structures if struct not in duplicates] - return ModelsInfo(structures=structures, unions=unions, enums=enums, errors=errors) + return ModelsInfo( + structures=structures, unions=unions, enums=enums, errors=errors + ) def _is_union(self, member: Object | Alias) -> TypeGuard[Attribute]: """Check if a module member is a union type.""" @@ -399,7 +415,9 @@ def _extract_union_members( for name in member_names: if not (member_object := models_module.members.get(name)): raise ValueError(f"Union member '{name}' not found in models module") - members.append(TypeInfo(name=member_object.name, module_path=member_object.path)) + members.append( + TypeInfo(name=member_object.name, module_path=member_object.path) + ) return members @@ -408,7 +426,8 @@ def _is_enum(self, member: Object | Alias) -> TypeGuard[Class]: if not isinstance(member, Class): return False return any( - isinstance(base, ExprName) and base.name in ENUM_BASE_CLASSES for base in member.bases + isinstance(base, ExprName) and base.name in ENUM_BASE_CLASSES + for base in member.bases ) def _is_error(self, member: Object | Alias) -> TypeGuard[Class]: @@ -416,10 +435,13 @@ def _is_error(self, member: Object | Alias) -> TypeGuard[Class]: if not isinstance(member, Class): return False return any( - isinstance(base, ExprName) and base.name in ERROR_BASE_CLASSES for base in member.bases + isinstance(base, ExprName) and base.name in ERROR_BASE_CLASSES + for base in member.bases ) - def _is_operation_io_type(self, type_name: str, operations: list[OperationInfo]) -> bool: + def _is_operation_io_type( + self, type_name: str, operations: list[OperationInfo] + ) -> bool: """Check if a type is used as operation input/output.""" return any(type_name in (op.input.name, op.output.name) for op in operations) @@ -437,8 +459,12 @@ def _generate_client_docs(self, client_info: ClientInfo) -> bool: self._generate_type_stubs( client_info.models.structures, "structures", "Structure Class" ) - self._generate_type_stubs(client_info.models.errors, "errors", "Error Class") - self._generate_type_stubs(client_info.models.enums, "enums", "Enum Class", members=True) + self._generate_type_stubs( + client_info.models.errors, "errors", "Error Class" + ) + self._generate_type_stubs( + client_info.models.enums, "enums", "Enum Class", members=True + ) self._generate_union_stubs(client_info.models.unions) except OSError as e: logger.error(f"Failed to write documentation files: {e}") @@ -470,7 +496,9 @@ def _generate_index(self, client_info: ClientInfo) -> None: ] for method in sorted(client_info.client_methods, key=lambda x: x.name): - lines.extend([*self._mkdocs_directive(method.module_path, heading_level=4), ""]) + lines.extend( + [*self._mkdocs_directive(method.module_path, heading_level=4), ""] + ) # Operations section if client_info.operations: @@ -578,7 +606,9 @@ def _generate_operation_stubs(self, operations: list[OperationInfo]) -> None: output_path = self.output_dir / "operations" / f"{op.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb("Operations", op.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb("Operations", op.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(operations)} operation file(s)") @@ -600,7 +630,9 @@ def _generate_type_stubs( output_path = self.output_dir / category / f"{item.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb(category.title(), item.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb(category.title(), item.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(items)} {category} file(s)") @@ -624,7 +656,9 @@ def _generate_union_stubs(self, unions: list[UnionInfo]) -> None: output_path = self.output_dir / "unions" / f"{union.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb("Unions", union.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb("Unions", union.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(unions)} union file(s)") diff --git a/clients/aws-sdk-qbusiness/src/aws_sdk_qbusiness/_private/schemas.py b/clients/aws-sdk-qbusiness/src/aws_sdk_qbusiness/_private/schemas.py index 1a135909..9b81c02d 100644 --- a/clients/aws-sdk-qbusiness/src/aws_sdk_qbusiness/_private/schemas.py +++ b/clients/aws-sdk-qbusiness/src/aws_sdk_qbusiness/_private/schemas.py @@ -2,8615 +2,8304 @@ from types import MappingProxyType -from smithy_core.prelude import BLOB as _BLOB, BOOLEAN, UNIT -from smithy_core.schemas import Schema -from smithy_core.shapes import ShapeID, ShapeType -from smithy_core.traits import Trait +from smithy_core._schema_compact import StaticOperationSchema, StaticSchema + + +n0 = "com.amazonaws.qbusiness" +_MR = "MemberRelation" +_AND = "AND" +_sV = "smithy.api#enumValue" +_OR = "OR" +_RAT = "ReadAccessType" +_ALLOW = "ALLOW" +_DENY = "DENY" +_MT = "MembershipType" +_INDEX = "INDEX" +_DATASOURCE = "DATASOURCE" +_GN = "GroupName" +_PG = "PrincipalGroup" +_n = "name" +_a = "access" +_s = "smithy.api#required" +_mT = "membershipType" +_UI = "UserId" +_PU = "PrincipalUser" +_i = "id" +_P = "Principal" +_u = "user" +_g = "group" +_Pr = "Principals" +_m = "member" +_AC = "AccessControl" +_p = "principals" +_mR = "memberRelation" +_ACc = "AccessControls" +_ACcc = "AccessConfiguration" +_aC = "accessControls" +_EM = "ErrorMessage" +_ADE = "AccessDeniedException" +_sm = "smithy.api#error" +_c = "client" +_sE = "smithy.api#httpError" +_me = "message" +_QIA = "QIamAction" +_DAK = "DocumentAttributeKey" +_T = "Timestamp" +_L = "Long" +_S = "String" +_DASLV = "DocumentAttributeStringListValue" +_DASV = "DocumentAttributeStringValue" +_DAV = "DocumentAttributeValue" +_sVt = "stringValue" +_sLV = "stringListValue" +_lV = "longValue" +_dV = "dateValue" +_DA = "DocumentAttribute" +_v = "value" +_APFK = "ActionPayloadFieldKey" +_APFV = "ActionPayloadFieldValue" +_AEPF = "ActionExecutionPayloadField" +_AEP = "ActionExecutionPayload" +_k = "key" +_APFNS = "ActionPayloadFieldNameSeparator" +_PI = "PluginId" +_AE = "ActionExecution" +_pI = "pluginId" +_pa = "payload" +_pFNS = "payloadFieldNameSeparator" +_AEE = "ActionExecutionEvent" +_APFT = "ActionPayloadFieldType" +_STRING = "STRING" +_NUMBER = "NUMBER" +_ARRAY = "ARRAY" +_BOOLEAN = "BOOLEAN" +_ARPFAV = "ActionReviewPayloadFieldAllowedValue" +_dVi = "displayValue" +_ARPFAVc = "ActionReviewPayloadFieldAllowedValues" +_ARPFAIJS = "ActionReviewPayloadFieldArrayItemJsonSchema" +_I = "Integer" +_ARPF = "ActionReviewPayloadField" +_dN = "displayName" +_dO = "displayOrder" +_dD = "displayDescription" +_t = "type" +_aV = "allowedValues" +_aF = "allowedFormat" +_aIJS = "arrayItemJsonSchema" +_r = "required" +_ARP = "ActionReviewPayload" +_PT = "PluginType" +_SN = "SERVICE_NOW" +_SALESFORCE = "SALESFORCE" +_JIRA = "JIRA" +_ZENDESK = "ZENDESK" +_CUSTOM = "CUSTOM" +_QUICKSIGHT = "QUICKSIGHT" +_SNP = "SERVICENOW_NOW_PLATFORM" +_JC = "JIRA_CLOUD" +_SC = "SALESFORCE_CRM" +_ZS = "ZENDESK_SUITE" +_AC_ = "ATLASSIAN_CONFLUENCE" +_GC = "GOOGLE_CALENDAR" +_MT_ = "MICROSOFT_TEAMS" +_ME = "MICROSOFT_EXCHANGE" +_PA = "PAGERDUTY_ADVANCE" +_SMARTSHEET = "SMARTSHEET" +_ASANA = "ASANA" +_AR = "ActionReview" +_pT = "pluginType" +_CI = "ConversationId" +_MI = "MessageId" +_ARE = "ActionReviewEvent" +_cI = "conversationId" +_uMI = "userMessageId" +_sMI = "systemMessageId" +_AS = "ActionSummary" +_aI = "actionIdentifier" +_iE = "instructionExample" +_d = "description" +_A = "Actions" +_ARN = "AmazonResourceName" +_Pa = "Payload" +_smi = "smithy.api#sensitive" +_SBN = "S3BucketName" +_SOK = "S3ObjectKey" +_S_ = "S3" +_b = "bucket" +_APIS = "APISchema" +_s_ = "s3" +_APIST = "APISchemaType" +_OAV = "OPEN_API_V3" +_AI = "ApplicationId" +_AN = "ApplicationName" +_IT = "IdentityType" +_AIIS = "AWS_IAM_IDP_SAML" +_AIIO = "AWS_IAM_IDP_OIDC" +_AII = "AWS_IAM_IDC" +_AQI = "AWS_QUICKSIGHT_IDP" +_ANONYMOUS = "ANONYMOUS" +_CN = "ClientNamespace" +_QSC = "QuickSightConfiguration" +_cN = "clientNamespace" +_ASp = "ApplicationStatus" +_CREATING = "CREATING" +_ACTIVE = "ACTIVE" +_DELETING = "DELETING" +_FAILED = "FAILED" +_UPDATING = "UPDATING" +_Ap = "Application" +_aIp = "applicationId" +_cA = "createdAt" +_uA = "updatedAt" +_st = "status" +_iT = "identityType" +_qSC = "quickSightConfiguration" +_AA = "ApplicationArn" +_CE = "ConflictException" +_rI = "resourceId" +_rT = "resourceType" +_ACM = "AttachmentsControlMode" +_ENABLED = "ENABLED" +_DISABLED = "DISABLED" +_ACt = "AttachmentsConfiguration" +_aCM = "attachmentsControlMode" +_CIFOIDC = "ClientIdForOIDC" +_CIFOIDCl = "ClientIdsForOIDC" +_CT = "ClientToken" +_D = "Description" +_KKI = "KmsKeyId" +_EC = "EncryptionConfiguration" +_kKI = "kmsKeyId" +_IAMIPA = "IAMIdentityProviderArn" +_IA = "InstanceArn" +_PCM = "PersonalizationControlMode" +_PC = "PersonalizationConfiguration" +_pCM = "personalizationControlMode" +_QACM = "QAppsControlMode" +_QAC = "QAppsConfiguration" +_qACM = "qAppsControlMode" +_RA = "RoleArn" +_TK = "TagKey" +_TV = "TagValue" +_Ta = "Tag" +_Tag = "Tags" +_CAI = "CreateApplicationInput" +_sSI = "smithy.synthetic#originalShapeId" +_cCAR = "com.amazonaws.qbusiness#CreateApplicationRequest" +_smit = "smithy.api#input" +_rA = "roleArn" +_iIPA = "iamIdentityProviderArn" +_iCIA = "identityCenterInstanceArn" +_cIFOIDC = "clientIdsForOIDC" +_eC = "encryptionConfiguration" +_ta = "tags" +_cT = "clientToken" +_sT = "smithy.api#idempotencyToken" +_aCt = "attachmentsConfiguration" +_qAC = "qAppsConfiguration" +_pC = "personalizationConfiguration" +_CAO = "CreateApplicationOutput" +_cCARo = "com.amazonaws.qbusiness#CreateApplicationResponse" +_smith = "smithy.api#output" +_aA = "applicationArn" +_ISE = "InternalServerException" +_se = "server" +_RNFE = "ResourceNotFoundException" +_SQEE = "ServiceQuotaExceededException" +_TE = "ThrottlingException" +_VEF = "ValidationExceptionField" +_VEFa = "ValidationExceptionFields" +_VER = "ValidationExceptionReason" +_CP = "CANNOT_PARSE" +_FVF = "FIELD_VALIDATION_FAILED" +_UO = "UNKNOWN_OPERATION" +_VE = "ValidationException" +_re = "reason" +_f = "fields" +_CA = "CreateApplication" +_smithy = "smithy.api#http" +_ITTIA = "IdcTrustedTokenIssuerArn" +_DAITTIC = "DataAccessorIdcTrustedTokenIssuerConfiguration" +_iTTIA = "idcTrustedTokenIssuerArn" +_DAAC = "DataAccessorAuthenticationConfiguration" +_iTTIC = "idcTrustedTokenIssuerConfiguration" +_DAAT = "DataAccessorAuthenticationType" +_AIIT = "AWS_IAM_IDC_TTI" +_AIIAC = "AWS_IAM_IDC_AUTH_CODE" +_DAEI = "DataAccessorExternalId" +_DAEIa = "DataAccessorExternalIds" +_DAAD = "DataAccessorAuthenticationDetail" +_aT = "authenticationType" +_aCu = "authenticationConfiguration" +_eI = "externalIds" +_DAN = "DataAccessorName" +_PRA = "PrincipalRoleArn" +_DAA = "DataAccessorArn" +_DAI = "DataAccessorId" +_IAA = "IdcApplicationArn" +_CDAO = "CreateDataAccessorOutput" +_cCDAR = "com.amazonaws.qbusiness#CreateDataAccessorResponse" +_dAI = "dataAccessorId" +_iAA = "idcApplicationArn" +_dAA = "dataAccessorArn" +_DDAI = "DeleteDataAccessorInput" +_cDDAR = "com.amazonaws.qbusiness#DeleteDataAccessorRequest" +_sL = "smithy.api#httpLabel" +_DDAO = "DeleteDataAccessorOutput" +_cDDARo = "com.amazonaws.qbusiness#DeleteDataAccessorResponse" +_DDA = "DeleteDataAccessor" +_GDAI = "GetDataAccessorInput" +_cGDAR = "com.amazonaws.qbusiness#GetDataAccessorRequest" +_MRIFLDA = "MaxResultsIntegerForListDataAccessors" +_NT = "NextToken1500" +_LDAI = "ListDataAccessorsInput" +_cLDAR = "com.amazonaws.qbusiness#ListDataAccessorsRequest" +_nT = "nextToken" +_sQ = "smithy.api#httpQuery" +_mRa = "maxResults" +_DAa = "DataAccessor" +_pr = "principal" +_aD = "authenticationDetail" +_DAat = "DataAccessors" +_LDAO = "ListDataAccessorsOutput" +_cLDARo = "com.amazonaws.qbusiness#ListDataAccessorsResponse" +_dA = "dataAccessors" +_LDA = "ListDataAccessors" +_UDAO = "UpdateDataAccessorOutput" +_cUDAR = "com.amazonaws.qbusiness#UpdateDataAccessorResponse" +_DAIe = "DeleteApplicationInput" +_cDAR = "com.amazonaws.qbusiness#DeleteApplicationRequest" +_DAO = "DeleteApplicationOutput" +_cDARo = "com.amazonaws.qbusiness#DeleteApplicationResponse" +_DAe = "DeleteApplication" +_GAI = "GetApplicationInput" +_cGAR = "com.amazonaws.qbusiness#GetApplicationRequest" +_AAC = "AppliedAttachmentsConfiguration" +_ASS = "AutoSubscriptionStatus" +_ST = "SubscriptionType" +_QL = "Q_LITE" +_QB = "Q_BUSINESS" +_ASC = "AutoSubscriptionConfiguration" +_aS = "autoSubscribe" +_dST = "defaultSubscriptionType" +_ECr = "ErrorCode" +_IE = "INTERNAL_ERROR" +_IEn = "InternalError" +_IR = "INVALID_REQUEST" +_IRn = "InvalidRequest" +_RI = "RESOURCE_INACTIVE" +_RIe = "ResourceInactive" +_RNF = "RESOURCE_NOT_FOUND" +_RNFe = "ResourceNotFound" +_ED = "ErrorDetail" +_eM = "errorMessage" +_eCr = "errorCode" +_GAO = "GetApplicationOutput" +_cGARo = "com.amazonaws.qbusiness#GetApplicationResponse" +_iCAA = "identityCenterApplicationArn" +_e = "error" +_aSC = "autoSubscriptionConfiguration" +_GA = "GetApplication" +_ICI = "IndexCapacityInteger" +_ICC = "IndexCapacityConfiguration" +_un = "units" +_IN = "IndexName" +_ITn = "IndexType" +_ENTERPRISE = "ENTERPRISE" +_STARTER = "STARTER" +_CII = "CreateIndexInput" +_cCIR = "com.amazonaws.qbusiness#CreateIndexRequest" +_cC = "capacityConfiguration" +_IAn = "IndexArn" +_II = "IndexId" +_CIO = "CreateIndexOutput" +_cCIRo = "com.amazonaws.qbusiness#CreateIndexResponse" +_iI = "indexId" +_iA = "indexArn" +_CIr = "CreateIndex" +_DSC = "DataSourceConfiguration" +_DSN = "DataSourceName" +_DECO = "DocumentEnrichmentConditionOperator" +_GT = "GREATER_THAN" +_GTOE = "GREATER_THAN_OR_EQUALS" +_LT = "LESS_THAN" +_LTOE = "LESS_THAN_OR_EQUALS" +_EQUALS = "EQUALS" +_NE = "NOT_EQUALS" +_CONTAINS = "CONTAINS" +_NC = "NOT_CONTAINS" +_EXISTS = "EXISTS" +_NE_ = "NOT_EXISTS" +_BW = "BEGINS_WITH" +_DAC = "DocumentAttributeCondition" +_o = "operator" +_DCO = "DocumentContentOperator" +_DELETE = "DELETE" +_AVO = "AttributeValueOperator" +_DAT = "DocumentAttributeTarget" +_aVO = "attributeValueOperator" +_IDEC = "InlineDocumentEnrichmentConfiguration" +_co = "condition" +_tar = "target" +_dCO = "documentContentOperator" +_IDECn = "InlineDocumentEnrichmentConfigurations" +_LA = "LambdaArn" +_HC = "HookConfiguration" +_iC = "invocationCondition" +_lA = "lambdaArn" +_sBN = "s3BucketName" +_DEC = "DocumentEnrichmentConfiguration" +_iCn = "inlineConfigurations" +_pEHC = "preExtractionHookConfiguration" +_pEHCo = "postExtractionHookConfiguration" +_AES = "AudioExtractionStatus" +_AEC = "AudioExtractionConfiguration" +_aES = "audioExtractionStatus" +_IES = "ImageExtractionStatus" +_IEC = "ImageExtractionConfiguration" +_iES = "imageExtractionStatus" +_VES = "VideoExtractionStatus" +_VEC = "VideoExtractionConfiguration" +_vES = "videoExtractionStatus" +_MEC = "MediaExtractionConfiguration" +_iEC = "imageExtractionConfiguration" +_aEC = "audioExtractionConfiguration" +_vEC = "videoExtractionConfiguration" +_SS = "SyncSchedule" +_SGI = "SecurityGroupId" +_SGIe = "SecurityGroupIds" +_SI = "SubnetId" +_SIu = "SubnetIds" +_DSVC = "DataSourceVpcConfiguration" +_sI = "subnetIds" +_sGI = "securityGroupIds" +_CDSI = "CreateDataSourceInput" +_cCDSR = "com.amazonaws.qbusiness#CreateDataSourceRequest" +_con = "configuration" +_vC = "vpcConfiguration" +_sS = "syncSchedule" +_dEC = "documentEnrichmentConfiguration" +_mEC = "mediaExtractionConfiguration" +_DSA = "DataSourceArn" +_DSI = "DataSourceId" +_CDSO = "CreateDataSourceOutput" +_cCDSRo = "com.amazonaws.qbusiness#CreateDataSourceResponse" +_dSI = "dataSourceId" +_dSA = "dataSourceArn" +_CDS = "CreateDataSource" +_DDSI = "DeleteDataSourceInput" +_cDDSR = "com.amazonaws.qbusiness#DeleteDataSourceRequest" +_DDSO = "DeleteDataSourceOutput" +_cDDSRo = "com.amazonaws.qbusiness#DeleteDataSourceResponse" +_DDS = "DeleteDataSource" +_GDSI = "GetDataSourceInput" +_cGDSR = "com.amazonaws.qbusiness#GetDataSourceRequest" +_DSS = "DataSourceStatus" +_PC_ = "PENDING_CREATION" +_GDSO = "GetDataSourceOutput" +_cGDSRo = "com.amazonaws.qbusiness#GetDataSourceResponse" +_GDS = "GetDataSource" +_MRIFLDS = "MaxResultsIntegerForListDataSources" +_NTe = "NextToken" +_LDSI = "ListDataSourcesInput" +_cLDSR = "com.amazonaws.qbusiness#ListDataSourcesRequest" +_DS = "DataSource" +_DSa = "DataSources" +_LDSO = "ListDataSourcesOutput" +_cLDSRo = "com.amazonaws.qbusiness#ListDataSourcesResponse" +_dS = "dataSources" +_LDS = "ListDataSources" +_UDSI = "UpdateDataSourceInput" +_cUDSR = "com.amazonaws.qbusiness#UpdateDataSourceRequest" +_UDSO = "UpdateDataSourceOutput" +_cUDSRo = "com.amazonaws.qbusiness#UpdateDataSourceResponse" +_UDS = "UpdateDataSource" +_DII = "DeleteIndexInput" +_cDIR = "com.amazonaws.qbusiness#DeleteIndexRequest" +_DIO = "DeleteIndexOutput" +_cDIRo = "com.amazonaws.qbusiness#DeleteIndexResponse" +_DI = "DeleteIndex" +_GII = "GetIndexInput" +_cGIR = "com.amazonaws.qbusiness#GetIndexRequest" +_DMCN = "DocumentMetadataConfigurationName" +_St = "Status" +_AT = "AttributeType" +_SL = "STRING_LIST" +_DATE = "DATE" +_DACo = "DocumentAttributeConfiguration" +_sea = "search" +_DACoc = "DocumentAttributeConfigurations" +_ITB = "IndexedTextBytes" +_ITD = "IndexedTextDocument" +_TDS = "TextDocumentStatistics" +_iTB = "indexedTextBytes" +_iTDC = "indexedTextDocumentCount" +_IS = "IndexStatistics" +_tDS = "textDocumentStatistics" +_ISn = "IndexStatus" +_GIO = "GetIndexOutput" +_cGIRo = "com.amazonaws.qbusiness#GetIndexResponse" +_dAC = "documentAttributeConfigurations" +_iS = "indexStatistics" +_GI = "GetIndex" +_MRIFLI = "MaxResultsIntegerForListIndices" +_LII = "ListIndicesInput" +_cLIR = "com.amazonaws.qbusiness#ListIndicesRequest" +_In = "Index" +_Ind = "Indices" +_LIO = "ListIndicesOutput" +_cLIRo = "com.amazonaws.qbusiness#ListIndicesResponse" +_in = "indices" +_LI = "ListIndices" +_UII = "UpdateIndexInput" +_cUIR = "com.amazonaws.qbusiness#UpdateIndexRequest" +_UIO = "UpdateIndexOutput" +_cUIRo = "com.amazonaws.qbusiness#UpdateIndexResponse" +_UIp = "UpdateIndex" +_IIn = "IntegrationId" +_MRIFLA = "MaxResultsIntegerForListApplications" +_LAI = "ListApplicationsInput" +_cLAR = "com.amazonaws.qbusiness#ListApplicationsRequest" +_App = "Applications" +_LAO = "ListApplicationsOutput" +_cLARo = "com.amazonaws.qbusiness#ListApplicationsResponse" +_ap = "applications" +_LAi = "ListApplications" +_SA = "SecretArn" +_BAC = "BasicAuthConfiguration" +_sA = "secretArn" +_IAC = "IdcAuthConfiguration" +_NAC = "NoAuthConfiguration" +_U = "Url" +_OACCC = "OAuth2ClientCredentialConfiguration" +_aU = "authorizationUrl" +_tU = "tokenUrl" +_PAC = "PluginAuthConfiguration" +_bAC = "basicAuthConfiguration" +_oACCC = "oAuth2ClientCredentialConfiguration" +_nAC = "noAuthConfiguration" +_iAC = "idcAuthConfiguration" +_PD = "PluginDescription" +_CPC = "CustomPluginConfiguration" +_aST = "apiSchemaType" +_aSp = "apiSchema" +_PN = "PluginName" +_CPI = "CreatePluginInput" +_cCPR = "com.amazonaws.qbusiness#CreatePluginRequest" +_aCut = "authConfiguration" +_sU = "serverUrl" +_cPC = "customPluginConfiguration" +_PBS = "PluginBuildStatus" +_READY = "READY" +_CIP = "CREATE_IN_PROGRESS" +_CF = "CREATE_FAILED" +_UIP = "UPDATE_IN_PROGRESS" +_UF = "UPDATE_FAILED" +_DIP = "DELETE_IN_PROGRESS" +_DF = "DELETE_FAILED" +_PAl = "PluginArn" +_CPO = "CreatePluginOutput" +_cCPRo = "com.amazonaws.qbusiness#CreatePluginResponse" +_pA = "pluginArn" +_bS = "buildStatus" +_CPr = "CreatePlugin" +_DPI = "DeletePluginInput" +_cDPR = "com.amazonaws.qbusiness#DeletePluginRequest" +_DPO = "DeletePluginOutput" +_cDPRo = "com.amazonaws.qbusiness#DeletePluginResponse" +_DP = "DeletePlugin" +_GPI = "GetPluginInput" +_cGPR = "com.amazonaws.qbusiness#GetPluginRequest" +_PS = "PluginState" +_GPO = "GetPluginOutput" +_cGPRo = "com.amazonaws.qbusiness#GetPluginResponse" +_sta = "state" +_GP = "GetPlugin" +_MRIFLP = "MaxResultsIntegerForListPlugins" +_LPI = "ListPluginsInput" +_cLPR = "com.amazonaws.qbusiness#ListPluginsRequest" +_Pl = "Plugin" +_Plu = "Plugins" +_LPO = "ListPluginsOutput" +_cLPRo = "com.amazonaws.qbusiness#ListPluginsResponse" +_pl = "plugins" +_LP = "ListPlugins" +_UPI = "UpdatePluginInput" +_cUPR = "com.amazonaws.qbusiness#UpdatePluginRequest" +_UPO = "UpdatePluginOutput" +_cUPRo = "com.amazonaws.qbusiness#UpdatePluginResponse" +_UP = "UpdatePlugin" +_KII = "KendraIndexId" +_KIC = "KendraIndexConfiguration" +_BDIS = "BoostingDurationInSeconds" +_DABL = "DocumentAttributeBoostingLevel" +_NONE = "NONE" +_LOW = "LOW" +_MEDIUM = "MEDIUM" +_HIGH = "HIGH" +_VH = "VERY_HIGH" +_ONE = "ONE" +_TWO = "TWO" +_DABC = "DateAttributeBoostingConfiguration" +_bL = "boostingLevel" +_bDIS = "boostingDurationInSeconds" +_NABT = "NumberAttributeBoostingType" +_PLV = "PRIORITIZE_LARGER_VALUES" +_PSV = "PRIORITIZE_SMALLER_VALUES" +_NABC = "NumberAttributeBoostingConfiguration" +_bT = "boostingType" +_SAVBL = "StringAttributeValueBoostingLevel" +_THREE = "THREE" +_FOUR = "FOUR" +_FIVE = "FIVE" +_SAVB = "StringAttributeValueBoosting" +_SABC = "StringAttributeBoostingConfiguration" +_aVB = "attributeValueBoosting" +_SLABC = "StringListAttributeBoostingConfiguration" +_DABCo = "DocumentAttributeBoostingConfiguration" +_nC = "numberConfiguration" +_sC = "stringConfiguration" +_dC = "dateConfiguration" +_sLC = "stringListConfiguration" +_DABOM = "DocumentAttributeBoostingOverrideMap" +_NIC = "NativeIndexConfiguration" +_ve = "version" +_bO = "boostingOverride" +_RC = "RetrieverConfiguration" +_nIC = "nativeIndexConfiguration" +_kIC = "kendraIndexConfiguration" +_RN = "RetrieverName" +_RT = "RetrieverType" +_NI = "NATIVE_INDEX" +_KI = "KENDRA_INDEX" +_CRI = "CreateRetrieverInput" +_cCRR = "com.amazonaws.qbusiness#CreateRetrieverRequest" +_RAe = "RetrieverArn" +_RIet = "RetrieverId" +_CRO = "CreateRetrieverOutput" +_cCRRo = "com.amazonaws.qbusiness#CreateRetrieverResponse" +_rIe = "retrieverId" +_rAe = "retrieverArn" +_CR = "CreateRetriever" +_DRI = "DeleteRetrieverInput" +_cDRR = "com.amazonaws.qbusiness#DeleteRetrieverRequest" +_DRO = "DeleteRetrieverOutput" +_cDRRo = "com.amazonaws.qbusiness#DeleteRetrieverResponse" +_DR = "DeleteRetriever" +_GRI = "GetRetrieverInput" +_cGRR = "com.amazonaws.qbusiness#GetRetrieverRequest" +_RS = "RetrieverStatus" +_GRO = "GetRetrieverOutput" +_cGRRo = "com.amazonaws.qbusiness#GetRetrieverResponse" +_GR = "GetRetriever" +_MRIFLRR = "MaxResultsIntegerForListRetrieversRequest" +_LRI = "ListRetrieversInput" +_cLRR = "com.amazonaws.qbusiness#ListRetrieversRequest" +_R = "Retriever" +_Re = "Retrievers" +_LRO = "ListRetrieversOutput" +_cLRRo = "com.amazonaws.qbusiness#ListRetrieversResponse" +_ret = "retrievers" +_LR = "ListRetrievers" +_URI = "UpdateRetrieverInput" +_cURR = "com.amazonaws.qbusiness#UpdateRetrieverRequest" +_URO = "UpdateRetrieverOutput" +_cURRo = "com.amazonaws.qbusiness#UpdateRetrieverResponse" +_UR = "UpdateRetriever" +_UAI = "UpdateApplicationInput" +_cUAR = "com.amazonaws.qbusiness#UpdateApplicationRequest" +_UAO = "UpdateApplicationOutput" +_cUARo = "com.amazonaws.qbusiness#UpdateApplicationResponse" +_UA = "UpdateApplication" +_BE = "BrowserExtension" +_BEL = "BrowserExtensionList" +_BEC = "BrowserExtensionConfiguration" +_eBE = "enabledBrowserExtensions" +_CCSSU = "CustomCSSUrl" +_FU = "FaviconUrl" +_FUo = "FontUrl" +_LU = "LogoUrl" +_CC = "CustomizationConfiguration" +_cCSSU = "customCSSUrl" +_lU = "logoUrl" +_fU = "fontUrl" +_fUa = "faviconUrl" +_OIDCPC = "OpenIDConnectProviderConfiguration" +_sAe = "secretsArn" +_sR = "secretsRole" +_SAU = "SamlAuthenticationUrl" +_SPC = "SamlProviderConfiguration" +_aUu = "authenticationUrl" +_IPC = "IdentityProviderConfiguration" +_sCa = "samlConfiguration" +_oIDCC = "openIDConnectConfiguration" +_O = "Origin" +_WEO = "WebExperienceOrigins" +_WESPCM = "WebExperienceSamplePromptsControlMode" +_WES = "WebExperienceSubtitle" +_WET = "WebExperienceTitle" +_WEWM = "WebExperienceWelcomeMessage" +_CWEI = "CreateWebExperienceInput" +_cCWER = "com.amazonaws.qbusiness#CreateWebExperienceRequest" +_ti = "title" +_su = "subtitle" +_wM = "welcomeMessage" +_sPCM = "samplePromptsControlMode" +_or = "origins" +_iPC = "identityProviderConfiguration" +_bEC = "browserExtensionConfiguration" +_cCu = "customizationConfiguration" +_WEA = "WebExperienceArn" +_WEI = "WebExperienceId" +_CWEO = "CreateWebExperienceOutput" +_cCWERo = "com.amazonaws.qbusiness#CreateWebExperienceResponse" +_wEI = "webExperienceId" +_wEA = "webExperienceArn" +_CWE = "CreateWebExperience" +_DWEI = "DeleteWebExperienceInput" +_cDWER = "com.amazonaws.qbusiness#DeleteWebExperienceRequest" +_DWEO = "DeleteWebExperienceOutput" +_cDWERo = "com.amazonaws.qbusiness#DeleteWebExperienceResponse" +_DWE = "DeleteWebExperience" +_GWEI = "GetWebExperienceInput" +_cGWER = "com.amazonaws.qbusiness#GetWebExperienceRequest" +_SMXML = "SamlMetadataXML" +_SAa = "SamlAttribute" +_SCa = "SamlConfiguration" +_mXML = "metadataXML" +_uIA = "userIdAttribute" +_uGA = "userGroupAttribute" +_WEAC = "WebExperienceAuthConfiguration" +_WESe = "WebExperienceStatus" +_PAC_ = "PENDING_AUTH_CONFIG" +_GWEO = "GetWebExperienceOutput" +_cGWERo = "com.amazonaws.qbusiness#GetWebExperienceResponse" +_dE = "defaultEndpoint" +_GWE = "GetWebExperience" +_MRIFLWER = "MaxResultsIntegerForListWebExperiencesRequest" +_LWEI = "ListWebExperiencesInput" +_cLWER = "com.amazonaws.qbusiness#ListWebExperiencesRequest" +_WE = "WebExperience" +_WEe = "WebExperiences" +_LWEO = "ListWebExperiencesOutput" +_cLWERo = "com.amazonaws.qbusiness#ListWebExperiencesResponse" +_wE = "webExperiences" +_LWE = "ListWebExperiences" +_UWEI = "UpdateWebExperienceInput" +_cUWER = "com.amazonaws.qbusiness#UpdateWebExperienceRequest" +_UWEO = "UpdateWebExperienceOutput" +_cUWERo = "com.amazonaws.qbusiness#UpdateWebExperienceResponse" +_UWE = "UpdateWebExperience" +_CMC = "CreatorModeControl" +_ACMC = "AppliedCreatorModeConfiguration" +_cMC = "creatorModeControl" +_OC = "OrchestrationControl" +_AOC = "AppliedOrchestrationConfiguration" +_cont = "control" +_AG = "AssociatedGroup" +_AGs = "AssociatedGroups" +_AU = "AssociatedUser" +_AUs = "AssociatedUsers" +_QIAa = "QIamActions" +_PCK = "PermissionConditionKey" +_PCO = "PermissionConditionOperator" +_SE = "STRING_EQUALS" +_SEt = "StringEquals" +_PCV = "PermissionConditionValue" +_PCVe = "PermissionConditionValues" +_PCe = "PermissionCondition" +_cO = "conditionOperator" +_cK = "conditionKey" +_cV = "conditionValues" +_PCer = "PermissionConditions" +_SIt = "StatementId" +_API = "AssociatePermissionInput" +_cAPR = "com.amazonaws.qbusiness#AssociatePermissionRequest" +_sIt = "statementId" +_ac = "actions" +_cond = "conditions" +_APO = "AssociatePermissionOutput" +_cAPRo = "com.amazonaws.qbusiness#AssociatePermissionResponse" +_stat = "statement" +_AP = "AssociatePermission" +_AIt = "AttachmentId" +_CS = "ConversationSource" +_aIt = "attachmentId" +_CFS = "CopyFromSource" +_conv = "conversation" +_ANt = "AttachmentName" +_ASt = "AttachmentStatus" +_SUCCESS = "SUCCESS" +_At = "Attachment" +_cF = "copyFrom" +_fT = "fileType" +_fS = "fileSize" +_md = "md5chksum" +_B = "Blob" +_AItt = "AttachmentInput" +_da = "data" +_AIE = "AttachmentInputEvent" +_at = "attachment" +_AL = "AttachmentList" +_AO = "AttachmentOutput" +_AItta = "AttachmentsInput" +_AOt = "AttachmentsOutput" +_AET = "AudioExtractionType" +_TRANSCRIPT = "TRANSCRIPT" +_SUMMARY = "SUMMARY" +_MIe = "MediaId" +_ASD = "AudioSourceDetails" +_mI = "mediaId" +_mMT = "mediaMimeType" +_sTM = "startTimeMilliseconds" +_eTM = "endTimeMilliseconds" +_aET = "audioExtractionType" +_ACR = "AuthChallengeRequest" +_ACRE = "AuthChallengeRequestEvent" +_ARK = "AuthResponseKey" +_ARV = "AuthResponseValue" +_ARM = "AuthorizationResponseMap" +_ACRu = "AuthChallengeResponse" +_rM = "responseMap" +_ACREu = "AuthChallengeResponseEvent" +_EI = "ExecutionId" +_DIo = "DocumentId" +_DD = "DeleteDocument" +_dI = "documentId" +_DDe = "DeleteDocuments" +_BDDI = "BatchDeleteDocumentInput" +_cBDDR = "com.amazonaws.qbusiness#BatchDeleteDocumentRequest" +_do = "documents" +_dSSI = "dataSourceSyncId" +_FD = "FailedDocument" +_FDa = "FailedDocuments" +_BDDO = "BatchDeleteDocumentOutput" +_cBDDRo = "com.amazonaws.qbusiness#BatchDeleteDocumentResponse" +_fD = "failedDocuments" +_BDD = "BatchDeleteDocument" +_DAo = "DocumentAttributes" +_DC = "DocumentContent" +_bl = "blob" +_CTo = "ContentType" +_PDF = "PDF" +_HTML = "HTML" +_MW = "MS_WORD" +_PT_ = "PLAIN_TEXT" +_PPT = "PPT" +_RTF = "RTF" +_XML = "XML" +_XSLT = "XSLT" +_ME_ = "MS_EXCEL" +_CSV = "CSV" +_JSON = "JSON" +_MD = "MD" +_Ti = "Title" +_Do = "Document" +_att = "attributes" +_conte = "content" +_cTo = "contentType" +_aCc = "accessConfiguration" +_Doc = "Documents" +_BPDI = "BatchPutDocumentInput" +_cBPDR = "com.amazonaws.qbusiness#BatchPutDocumentRequest" +_BPDO = "BatchPutDocumentOutput" +_cBPDRo = "com.amazonaws.qbusiness#BatchPutDocumentResponse" +_BPD = "BatchPutDocument" +_BP = "BlockedPhrase" +_BPl = "BlockedPhrases" +_SMO = "SystemMessageOverride" +_BPC = "BlockedPhrasesConfiguration" +_bP = "blockedPhrases" +_sMO = "systemMessageOverride" +_BPCU = "BlockedPhrasesConfigurationUpdate" +_bPTCOU = "blockedPhrasesToCreateOrUpdate" +_bPTD = "blockedPhrasesToDelete" +_SIub = "SubscriptionId" +_CSI = "CancelSubscriptionInput" +_cCSR = "com.amazonaws.qbusiness#CancelSubscriptionRequest" +_sIu = "subscriptionId" +_SD = "SubscriptionDetails" +_SAu = "SubscriptionArn" +_CSO = "CancelSubscriptionOutput" +_cCSRo = "com.amazonaws.qbusiness#CancelSubscriptionResponse" +_sAu = "subscriptionArn" +_cS = "currentSubscription" +_nS = "nextSubscription" +_CSa = "CancelSubscription" +_CM = "ChatMode" +_RM = "RETRIEVAL_MODE" +_CM_ = "CREATOR_MODE" +_PM = "PLUGIN_MODE" +_PCl = "PluginConfiguration" +_CMCh = "ChatModeConfiguration" +_pCl = "pluginConfiguration" +_EOIE = "EndOfInputEvent" +_UM = "UserMessage" +_TIE = "TextInputEvent" +_uM = "userMessage" +_UG = "UserGroups" +_FAE = "FailedAttachmentEvent" +_SAMI = "SourceAttributionMediaId" +_SET = "SnippetExcerptText" +_SEn = "SnippetExcerpt" +_te = "text" +_ISD = "ImageSourceDetails" +_VET = "VideoExtractionType" +_VSD = "VideoSourceDetails" +_vET = "videoExtractionType" +_SDo = "SourceDetails" +_iSD = "imageSourceDetails" +_aSD = "audioSourceDetails" +_vSD = "videoSourceDetails" +_TS = "TextSegment" +_bOe = "beginOffset" +_eO = "endOffset" +_sEn = "snippetExcerpt" +_sD = "sourceDetails" +_TSL = "TextSegmentList" +_SAo = "SourceAttribution" +_sn = "snippet" +_ur = "url" +_cNi = "citationNumber" +_tMS = "textMessageSegments" +_dIa = "datasourceId" +_SAou = "SourceAttributions" +_smithya = "smithy.api#sparse" +_MEe = "MetadataEvent" +_sAo = "sourceAttributions" +_fTM = "finalTextMessage" +_SMT = "SystemMessageType" +_RESPONSE = "RESPONSE" +_GR_ = "GROUNDED_RESPONSE" +_TOE = "TextOutputEvent" +_sMT = "systemMessageType" +_sM = "systemMessage" +_COS = "ChatOutputStream" +_smithyap = "smithy.api#streaming" +_tE = "textEvent" +_mE = "metadataEvent" +_aRE = "actionReviewEvent" +_fAE = "failedAttachmentEvent" +_aCRE = "authChallengeRequestEvent" +_CO = "ChatOutput" +_oS = "outputStream" +_sP = "smithy.api#httpPayload" +_ERE = "ExternalResourceException" +_LNFE = "LicenseNotFoundException" +_CRCA = "ChatResponseConfigurationArn" +_CRCI = "ChatResponseConfigurationId" +_DN = "DisplayName" +_RCS = "ResponseConfigurationSummary" +_CRCS = "ChatResponseConfigurationStatus" +_CRC = "ChatResponseConfiguration" +_cRCI = "chatResponseConfigurationId" +_cRCA = "chatResponseConfigurationArn" +_rCS = "responseConfigurationSummary" +_RCT = "ResponseConfigurationType" +_ALL = "ALL" +_Ins = "Instruction" +_IC = "InstructionCollection" +_rL = "responseLength" +_tA = "targetAudience" +_pe = "perspective" +_oSu = "outputStyle" +_id = "identity" +_to = "tone" +_cIu = "customInstructions" +_ex = "examples" +_RCe = "ResponseConfiguration" +_iCns = "instructionCollection" +_RCes = "ResponseConfigurations" +_CRCD = "ChatResponseConfigurationDetail" +_rC = "responseConfigurations" +_CRCh = "ChatResponseConfigurations" +_CSOh = "ChatSyncOutput" +_aR = "actionReview" +_aCR = "authChallengeRequest" +_fA = "failedAttachments" +_CDAI = "CheckDocumentAccessInput" +_cCDARo = "com.amazonaws.qbusiness#CheckDocumentAccessRequest" +_uI = "userId" +_DAG = "DocumentAclGroup" +_DAGo = "DocumentAclGroups" +_DAU = "DocumentAclUser" +_DAUo = "DocumentAclUsers" +_DACocu = "DocumentAclCondition" +_us = "users" +_gr = "groups" +_DACocum = "DocumentAclConditions" +_DAM = "DocumentAclMembership" +_DAoc = "DocumentAcl" +_al = "allowlist" +_dL = "denyList" +_CDAOh = "CheckDocumentAccessOutput" +_cCDARom = "com.amazonaws.qbusiness#CheckDocumentAccessResponse" +_uG = "userGroups" +_uAs = "userAliases" +_hA = "hasAccess" +_dAo = "documentAcl" +_CDA = "CheckDocumentAccess" +_CBR = "ContentBlockerRule" +_EDS = "EligibleDataSource" +_EDSl = "EligibleDataSources" +_CRR = "ContentRetrievalRule" +_eDS = "eligibleDataSources" +_RCSe = "RetrieverContentSource" +_CSo = "ContentSource" +_retr = "retriever" +_CTon = "ConversationTitle" +_C = "Conversation" +_sTt = "startTime" +_Co = "Conversations" +_SDIM = "SessionDurationInMinutes" +_CAWEUI = "CreateAnonymousWebExperienceUrlInput" +_cCAWEUR = "com.amazonaws.qbusiness#CreateAnonymousWebExperienceUrlRequest" +_sDIM = "sessionDurationInMinutes" +_CAWEUO = "CreateAnonymousWebExperienceUrlOutput" +_cCAWEURo = "com.amazonaws.qbusiness#CreateAnonymousWebExperienceUrlResponse" +_aUn = "anonymousUrl" +_CAWEU = "CreateAnonymousWebExperienceUrl" +_CCRCI = "CreateChatResponseConfigurationInput" +_cCCRCR = "com.amazonaws.qbusiness#CreateChatResponseConfigurationRequest" +_CCRCO = "CreateChatResponseConfigurationOutput" +_cCCRCRo = "com.amazonaws.qbusiness#CreateChatResponseConfigurationResponse" +_CCRC = "CreateChatResponseConfiguration" +_GIr = "GroupIdentifier" +_UIs = "UserIdentifier" +_SP = "SubscriptionPrincipal" +_CSIr = "CreateSubscriptionInput" +_cCSRom = "com.amazonaws.qbusiness#CreateSubscriptionRequest" +_CSOr = "CreateSubscriptionOutput" +_cCSRoma = "com.amazonaws.qbusiness#CreateSubscriptionResponse" +_CSr = "CreateSubscription" +_UAs = "UserAlias" +_UAse = "UserAliases" +_CUI = "CreateUserInput" +_cCUR = "com.amazonaws.qbusiness#CreateUserRequest" +_CUO = "CreateUserOutput" +_cCURo = "com.amazonaws.qbusiness#CreateUserResponse" +_CU = "CreateUser" +_CMCr = "CreatorModeConfiguration" +_DSIa = "DataSourceIds" +_MV = "MetricValue" +_DSSJM = "DataSourceSyncJobMetrics" +_dAoc = "documentsAdded" +_dM = "documentsModified" +_dDo = "documentsDeleted" +_dF = "documentsFailed" +_dSo = "documentsScanned" +_DSSJS = "DataSourceSyncJobStatus" +_SUCCEEDED = "SUCCEEDED" +_SYNCING = "SYNCING" +_INCOMPLETE = "INCOMPLETE" +_STOPPING = "STOPPING" +_ABORTED = "ABORTED" +_SI_ = "SYNCING_INDEXING" +_DSSJ = "DataSourceSyncJob" +_eIx = "executionId" +_eT = "endTime" +_dSEC = "dataSourceErrorCode" +_met = "metrics" +_DSSJa = "DataSourceSyncJobs" +_DSUI = "DataSourceUserId" +_DAIel = "DeleteAttachmentInput" +_cDARom = "com.amazonaws.qbusiness#DeleteAttachmentRequest" +_DAOe = "DeleteAttachmentOutput" +_cDARoma = "com.amazonaws.qbusiness#DeleteAttachmentResponse" +_DAel = "DeleteAttachment" +_DCCCI = "DeleteChatControlsConfigurationInput" +_cDCCCR = "com.amazonaws.qbusiness#DeleteChatControlsConfigurationRequest" +_DCCCO = "DeleteChatControlsConfigurationOutput" +_cDCCCRo = "com.amazonaws.qbusiness#DeleteChatControlsConfigurationResponse" +_DCCC = "DeleteChatControlsConfiguration" +_DCRCI = "DeleteChatResponseConfigurationInput" +_cDCRCR = "com.amazonaws.qbusiness#DeleteChatResponseConfigurationRequest" +_DCRCO = "DeleteChatResponseConfigurationOutput" +_cDCRCRo = "com.amazonaws.qbusiness#DeleteChatResponseConfigurationResponse" +_DCRC = "DeleteChatResponseConfiguration" +_DCI = "DeleteConversationInput" +_cDCR = "com.amazonaws.qbusiness#DeleteConversationRequest" +_DCOe = "DeleteConversationOutput" +_cDCRo = "com.amazonaws.qbusiness#DeleteConversationResponse" +_DCe = "DeleteConversation" +_DGI = "DeleteGroupInput" +_cDGR = "com.amazonaws.qbusiness#DeleteGroupRequest" +_gN = "groupName" +_DGO = "DeleteGroupOutput" +_cDGRo = "com.amazonaws.qbusiness#DeleteGroupResponse" +_DG = "DeleteGroup" +_DUI = "DeleteUserInput" +_cDUR = "com.amazonaws.qbusiness#DeleteUserRequest" +_DUO = "DeleteUserOutput" +_cDURo = "com.amazonaws.qbusiness#DeleteUserResponse" +_DU = "DeleteUser" +_DPIi = "DisassociatePermissionInput" +_cDPRom = "com.amazonaws.qbusiness#DisassociatePermissionRequest" +_DPOi = "DisassociatePermissionOutput" +_cDPRoma = "com.amazonaws.qbusiness#DisassociatePermissionResponse" +_DPi = "DisassociatePermission" +_DSo = "DocumentStatus" +_RECEIVED = "RECEIVED" +_PROCESSING = "PROCESSING" +_INDEXED = "INDEXED" +_UPDATED = "UPDATED" +_DELETED = "DELETED" +_DFTI = "DOCUMENT_FAILED_TO_INDEX" +_DDo = "DocumentDetails" +_DDL = "DocumentDetailList" +_ECM = "ExampleChatMessage" +_ECMx = "ExampleChatMessages" +_MRIFGTC = "MaxResultsIntegerForGetTopicConfigurations" +_GCCCI = "GetChatControlsConfigurationInput" +_cGCCCR = "com.amazonaws.qbusiness#GetChatControlsConfigurationRequest" +_HRC = "HallucinationReductionControl" +_HRCa = "HallucinationReductionConfiguration" +_hRC = "hallucinationReductionControl" +_RSe = "ResponseScope" +_ECO = "ENTERPRISE_CONTENT_ONLY" +_EKE = "EXTENDED_KNOWLEDGE_ENABLED" +_TD = "TopicDescription" +_TCN = "TopicConfigurationName" +_UIse = "UserIds" +_UAG = "UsersAndGroups" +_uIs = "userIds" +_RCu = "RuleConfiguration" +_cBR = "contentBlockerRule" +_cRR = "contentRetrievalRule" +_RTu = "RuleType" +_CBR_ = "CONTENT_BLOCKER_RULE" +_CRR_ = "CONTENT_RETRIEVAL_RULE" +_Ru = "Rule" +_iUAG = "includedUsersAndGroups" +_eUAG = "excludedUsersAndGroups" +_rTu = "ruleType" +_rCu = "ruleConfiguration" +_Rul = "Rules" +_TC = "TopicConfiguration" +_eCM = "exampleChatMessages" +_ru = "rules" +_TCo = "TopicConfigurations" +_GCCCO = "GetChatControlsConfigurationOutput" +_cGCCCRo = "com.amazonaws.qbusiness#GetChatControlsConfigurationResponse" +_rS = "responseScope" +_oC = "orchestrationConfiguration" +_tC = "topicConfigurations" +_cMCr = "creatorModeConfiguration" +_hRCa = "hallucinationReductionConfiguration" +_GCCC = "GetChatControlsConfiguration" +_GCRCI = "GetChatResponseConfigurationInput" +_cGCRCR = "com.amazonaws.qbusiness#GetChatResponseConfigurationRequest" +_GCRCO = "GetChatResponseConfigurationOutput" +_cGCRCRo = "com.amazonaws.qbusiness#GetChatResponseConfigurationResponse" +_iUC = "inUseConfiguration" +_lUC = "lastUpdateConfiguration" +_GCRC = "GetChatResponseConfiguration" +_OF = "OutputFormat" +_RAW = "RAW" +_EXTRACTED = "EXTRACTED" +_GDCI = "GetDocumentContentInput" +_cGDCR = "com.amazonaws.qbusiness#GetDocumentContentRequest" +_oF = "outputFormat" +_GDCO = "GetDocumentContentOutput" +_cGDCRo = "com.amazonaws.qbusiness#GetDocumentContentResponse" +_pU = "presignedUrl" +_mTi = "mimeType" +_GDC = "GetDocumentContent" +_GGI = "GetGroupInput" +_cGGR = "com.amazonaws.qbusiness#GetGroupRequest" +_GS = "GroupStatus" +_GSD = "GroupStatusDetail" +_lUA = "lastUpdatedAt" +_eD = "errorDetail" +_GSDr = "GroupStatusDetails" +_GGO = "GetGroupOutput" +_cGGRo = "com.amazonaws.qbusiness#GetGroupResponse" +_sH = "statusHistory" +_GG = "GetGroup" +_GMI = "GetMediaInput" +_cGMR = "com.amazonaws.qbusiness#GetMediaRequest" +_mIe = "messageId" +_GMO = "GetMediaOutput" +_cGMRo = "com.amazonaws.qbusiness#GetMediaResponse" +_mB = "mediaBytes" +_MTLE = "MediaTooLargeException" +_GM = "GetMedia" +_GPIe = "GetPolicyInput" +_cGPRom = "com.amazonaws.qbusiness#GetPolicyRequest" +_GPOe = "GetPolicyOutput" +_cGPRoma = "com.amazonaws.qbusiness#GetPolicyResponse" +_po = "policy" +_GPe = "GetPolicy" +_GUI = "GetUserInput" +_cGUR = "com.amazonaws.qbusiness#GetUserRequest" +_GUO = "GetUserOutput" +_cGURo = "com.amazonaws.qbusiness#GetUserResponse" +_GU = "GetUser" +_MRIFLAa = "MaxResultsIntegerForListAttachments" +_LAIi = "ListAttachmentsInput" +_cLARom = "com.amazonaws.qbusiness#ListAttachmentsRequest" +_LAOi = "ListAttachmentsOutput" +_cLARoma = "com.amazonaws.qbusiness#ListAttachmentsResponse" +_atta = "attachments" +_LAis = "ListAttachments" +_LCRCI = "ListChatResponseConfigurationsInput" +_cLCRCR = "com.amazonaws.qbusiness#ListChatResponseConfigurationsRequest" +_LCRCO = "ListChatResponseConfigurationsOutput" +_cLCRCRo = "com.amazonaws.qbusiness#ListChatResponseConfigurationsResponse" +_cRC = "chatResponseConfigurations" +_LCRC = "ListChatResponseConfigurations" +_MRIFLC = "MaxResultsIntegerForListConversations" +_LCI = "ListConversationsInput" +_cLCR = "com.amazonaws.qbusiness#ListConversationsRequest" +_LCO = "ListConversationsOutput" +_cLCRo = "com.amazonaws.qbusiness#ListConversationsResponse" +_conve = "conversations" +_LC = "ListConversations" +_MRIFLDSSJ = "MaxResultsIntegerForListDataSourcesSyncJobs" +_LDSSJI = "ListDataSourceSyncJobsInput" +_cLDSSJR = "com.amazonaws.qbusiness#ListDataSourceSyncJobsRequest" +_sF = "statusFilter" +_sSy = "syncStatus" +_LDSSJO = "ListDataSourceSyncJobsOutput" +_cLDSSJRo = "com.amazonaws.qbusiness#ListDataSourceSyncJobsResponse" +_h = "history" +_LDSSJ = "ListDataSourceSyncJobs" +_MRIFLD = "MaxResultsIntegerForListDocuments" +_LDI = "ListDocumentsInput" +_cLDR = "com.amazonaws.qbusiness#ListDocumentsRequest" +_dSIa = "dataSourceIds" +_LDO = "ListDocumentsOutput" +_cLDRo = "com.amazonaws.qbusiness#ListDocumentsResponse" +_dDL = "documentDetailList" +_LD = "ListDocuments" +_MRIFLGR = "MaxResultsIntegerForListGroupsRequest" +_LGI = "ListGroupsInput" +_cLGR = "com.amazonaws.qbusiness#ListGroupsRequest" +_uET = "updatedEarlierThan" +_GSr = "GroupSummary" +_GSL = "GroupSummaryList" +_LGO = "ListGroupsOutput" +_cLGRo = "com.amazonaws.qbusiness#ListGroupsResponse" +_it = "items" +_LG = "ListGroups" +_MRIFLM = "MaxResultsIntegerForListMessages" +_LMI = "ListMessagesInput" +_cLMR = "com.amazonaws.qbusiness#ListMessagesRequest" +_MB = "MessageBody" +_MTe = "MessageType" +_USER = "USER" +_SYSTEM = "SYSTEM" +_M = "Message" +_bo = "body" +_tim = "time" +_sAou = "sourceAttribution" +_aE = "actionExecution" +_Me = "Messages" +_LMO = "ListMessagesOutput" +_cLMRo = "com.amazonaws.qbusiness#ListMessagesResponse" +_mes = "messages" +_LM = "ListMessages" +_MRIFLPA = "MaxResultsIntegerForListPluginActions" +_LPAI = "ListPluginActionsInput" +_cLPAR = "com.amazonaws.qbusiness#ListPluginActionsRequest" +_LPAO = "ListPluginActionsOutput" +_cLPARo = "com.amazonaws.qbusiness#ListPluginActionsResponse" +_LPA = "ListPluginActions" +_MRIFLPTA = "MaxResultsIntegerForListPluginTypeActions" +_LPTAI = "ListPluginTypeActionsInput" +_cLPTAR = "com.amazonaws.qbusiness#ListPluginTypeActionsRequest" +_LPTAO = "ListPluginTypeActionsOutput" +_cLPTARo = "com.amazonaws.qbusiness#ListPluginTypeActionsResponse" +_LPTA = "ListPluginTypeActions" +_MRIFLPTM = "MaxResultsIntegerForListPluginTypeMetadata" +_LPTMI = "ListPluginTypeMetadataInput" +_cLPTMR = "com.amazonaws.qbusiness#ListPluginTypeMetadataRequest" +_PTC = "PluginTypeCategory" +_CRM = "CRM" +_Crm = "Customer relationship management (CRM)" +_PM_ = "PROJECT_MANAGEMENT" +_Pm = "Project management" +_COMMUNICATION = "COMMUNICATION" +_Com = "Communication" +_PRODUCTIVITY = "PRODUCTIVITY" +_Pro = "Productivity" +_TM = "TICKETING_MANAGEMENT" +_Taim = "Ticketing and incident management" +_PTMS = "PluginTypeMetadataSummary" +_ca = "category" +_LPTMS = "ListPluginTypeMetadataSummaries" +_LPTMO = "ListPluginTypeMetadataOutput" +_cLPTMRo = "com.amazonaws.qbusiness#ListPluginTypeMetadataResponse" +_LPTM = "ListPluginTypeMetadata" +_MRIFLS = "MaxResultsIntegerForListSubscriptions" +_LSI = "ListSubscriptionsInput" +_cLSR = "com.amazonaws.qbusiness#ListSubscriptionsRequest" +_Su = "Subscription" +_Sub = "Subscriptions" +_LSO = "ListSubscriptionsOutput" +_cLSRo = "com.amazonaws.qbusiness#ListSubscriptionsResponse" +_sub = "subscriptions" +_LS = "ListSubscriptions" +_LTFRI = "ListTagsForResourceInput" +_cLTFRR = "com.amazonaws.qbusiness#ListTagsForResourceRequest" +_rARN = "resourceARN" +_LTFRO = "ListTagsForResourceOutput" +_cLTFRRo = "com.amazonaws.qbusiness#ListTagsForResourceResponse" +_LTFR = "ListTagsForResource" +_SMI = "SystemMessageId" +_MUC = "MessageUsefulnessComment" +_MUR = "MessageUsefulnessReason" +_NFC = "NOT_FACTUALLY_CORRECT" +_HOU = "HARMFUL_OR_UNSAFE" +_IOMS = "INCORRECT_OR_MISSING_SOURCES" +_NH = "NOT_HELPFUL" +_FC = "FACTUALLY_CORRECT" +_COMPLETE = "COMPLETE" +_RS_ = "RELEVANT_SOURCES" +_HELPFUL = "HELPFUL" +_NBOD = "NOT_BASED_ON_DOCUMENTS" +_NC_ = "NOT_COMPLETE" +_NC__ = "NOT_CONCISE" +_OTHER = "OTHER" +_MU = "MessageUsefulness" +_USEFUL = "USEFUL" +_NU = "NOT_USEFUL" +_MUF = "MessageUsefulnessFeedback" +_use = "usefulness" +_com = "comment" +_sAub = "submittedAt" +_PFI = "PutFeedbackInput" +_cPFR = "com.amazonaws.qbusiness#PutFeedbackRequest" +_mCA = "messageCopiedAt" +_mU = "messageUsefulness" +_PFO = "PutFeedbackOutput" +_sUm = "smithy.api#Unit" +_PF = "PutFeedback" +_MG = "MemberGroup" +_MGe = "MemberGroups" +_MUe = "MemberUser" +_MUem = "MemberUsers" +_GMr = "GroupMembers" +_mG = "memberGroups" +_mUe = "memberUsers" +_sPFGM = "s3PathForGroupMembers" +_PGI = "PutGroupInput" +_cPGR = "com.amazonaws.qbusiness#PutGroupRequest" +_gM = "groupMembers" +_PGO = "PutGroupOutput" +_cPGRo = "com.amazonaws.qbusiness#PutGroupResponse" +_PGu = "PutGroup" +_MRa = "MaxResults" +_QT = "QueryText" +_SCc = "ScoreConfidence" +_NA = "NOT_AVAILABLE" +_SAc = "ScoreAttributes" +_sCc = "scoreConfidence" +_RCel = "RelevantContent" +_dT = "documentTitle" +_dU = "documentUri" +_dAocu = "documentAttributes" +_sAc = "scoreAttributes" +_RCL = "RelevantContentList" +_SRCO = "SearchRelevantContentOutput" +_cSRCR = "com.amazonaws.qbusiness#SearchRelevantContentResponse" +_rCe = "relevantContent" +_SDSSJI = "StartDataSourceSyncJobInput" +_cSDSSJR = "com.amazonaws.qbusiness#StartDataSourceSyncJobRequest" +_SDSSJO = "StartDataSourceSyncJobOutput" +_cSDSSJRo = "com.amazonaws.qbusiness#StartDataSourceSyncJobResponse" +_SDSSJ = "StartDataSourceSyncJob" +_SDSSJIt = "StopDataSourceSyncJobInput" +_cSDSSJRom = "com.amazonaws.qbusiness#StopDataSourceSyncJobRequest" +_SDSSJOt = "StopDataSourceSyncJobOutput" +_cSDSSJRoma = "com.amazonaws.qbusiness#StopDataSourceSyncJobResponse" +_SDSSJt = "StopDataSourceSyncJob" +_TRI = "TagResourceInput" +_cTRR = "com.amazonaws.qbusiness#TagResourceRequest" +_TRO = "TagResourceOutput" +_cTRRo = "com.amazonaws.qbusiness#TagResourceResponse" +_TR = "TagResource" +_TKa = "TagKeys" +_URIn = "UntagResourceInput" +_cURRom = "com.amazonaws.qbusiness#UntagResourceRequest" +_tK = "tagKeys" +_UROn = "UntagResourceOutput" +_cURRoma = "com.amazonaws.qbusiness#UntagResourceResponse" +_URn = "UntagResource" +_OCr = "OrchestrationConfiguration" +_UCCCI = "UpdateChatControlsConfigurationInput" +_cUCCCR = "com.amazonaws.qbusiness#UpdateChatControlsConfigurationRequest" +_bPCU = "blockedPhrasesConfigurationUpdate" +_tCTCOU = "topicConfigurationsToCreateOrUpdate" +_tCTD = "topicConfigurationsToDelete" +_UCCCO = "UpdateChatControlsConfigurationOutput" +_cUCCCRo = "com.amazonaws.qbusiness#UpdateChatControlsConfigurationResponse" +_UCCC = "UpdateChatControlsConfiguration" +_UCRCI = "UpdateChatResponseConfigurationInput" +_cUCRCR = "com.amazonaws.qbusiness#UpdateChatResponseConfigurationRequest" +_UCRCO = "UpdateChatResponseConfigurationOutput" +_cUCRCRo = "com.amazonaws.qbusiness#UpdateChatResponseConfigurationResponse" +_UCRC = "UpdateChatResponseConfiguration" +_USI = "UpdateSubscriptionInput" +_cUSR = "com.amazonaws.qbusiness#UpdateSubscriptionRequest" +_USO = "UpdateSubscriptionOutput" +_cUSRo = "com.amazonaws.qbusiness#UpdateSubscriptionResponse" +_US = "UpdateSubscription" +_UUI = "UpdateUserInput" +_cUUR = "com.amazonaws.qbusiness#UpdateUserRequest" +_uATU = "userAliasesToUpdate" +_uATD = "userAliasesToDelete" +_UUO = "UpdateUserOutput" +_cUURo = "com.amazonaws.qbusiness#UpdateUserResponse" +_uAA = "userAliasesAdded" +_uAU = "userAliasesUpdated" +_uAD = "userAliasesDeleted" +_UU = "UpdateUser" +_AF = "AttributeFilter" +_aAF = "andAllFilters" +_oAF = "orAllFilters" +_nF = "notFilter" +_eTq = "equalsTo" +_cAo = "containsAll" +_cAon = "containsAny" +_gT = "greaterThan" +_gTOE = "greaterThanOrEquals" +_lT = "lessThan" +_lTOE = "lessThanOrEquals" +_AFt = "AttributeFilters" +_AFC = "ActionFilterConfiguration" +_dAF = "documentAttributeFilter" +_CSIh = "ChatSyncInput" +_aCRu = "authChallengeResponse" +_pMI = "parentMessageId" +_aFt = "attributeFilter" +_cM = "chatMode" +_cMCh = "chatModeConfiguration" +_CEo = "ConfigurationEvent" +_SRCI = "SearchRelevantContentInput" +_cSRCRo = "com.amazonaws.qbusiness#SearchRelevantContentRequest" +_qT = "queryText" +_cSo = "contentSource" +_smithyapi = "smithy.api#default" +_CSh = "ChatSync" +_SRC = "SearchRelevantContent" +_ACct = "ActionConfiguration" +_act = "action" +_fC = "filterConfiguration" +_CIS = "ChatInputStream" +_cE = "configurationEvent" +_aEt = "attachmentEvent" +_aEE = "actionExecutionEvent" +_eOIE = "endOfInputEvent" +_aCREu = "authChallengeResponseEvent" +_ACL = "ActionConfigurationList" +_CIh = "ChatInput" +_iSn = "inputStream" +_Ch = "Chat" +_CDAIr = "CreateDataAccessorInput" +_cCDARoma = "com.amazonaws.qbusiness#CreateDataAccessorRequest" +_aCct = "actionConfigurations" +_GDAO = "GetDataAccessorOutput" +_cGDARo = "com.amazonaws.qbusiness#GetDataAccessorResponse" +_UDAI = "UpdateDataAccessorInput" +_cUDARo = "com.amazonaws.qbusiness#UpdateDataAccessorRequest" +_CDAr = "CreateDataAccessor" +_GDA = "GetDataAccessor" +_UDA = "UpdateDataAccessor" +_EQ = "ExpertQ" +_aw = "aws.auth#sigv4" +_sB = "smithy.rules#endpointBdd" +_aws = "aws.api#service" +_aJ = "aws.protocols#restJson1" + +MEMBER_RELATION: StaticSchema = ( + 14, + n0, + _MR, + 0, + (_AND, _OR), + ((-1, {_sV: _AND}), (-1, {_sV: _OR})), +) + +READ_ACCESS_TYPE: StaticSchema = ( + 14, + n0, + _RAT, + 0, + (_ALLOW, _DENY), + ((-1, {_sV: _ALLOW}), (-1, {_sV: _DENY})), +) + +MEMBERSHIP_TYPE: StaticSchema = ( + 14, + n0, + _MT, + 0, + (_INDEX, _DATASOURCE), + ((-1, {_sV: _INDEX}), (-1, {_sV: _DATASOURCE})), +) + +GROUP_NAME: StaticSchema = (3, n0, _GN, 0) + +PRINCIPAL_GROUP: StaticSchema = ( + 18, + n0, + _PG, + 0, + (_n, _a, _mT), + ((GROUP_NAME, 0), (READ_ACCESS_TYPE, 1), (MEMBERSHIP_TYPE, 0)), +) + +USER_ID: StaticSchema = (3, n0, _UI, 0) + +PRINCIPAL_USER: StaticSchema = ( + 18, + n0, + _PU, + 0, + (_i, _a, _mT), + ((USER_ID, 0), (READ_ACCESS_TYPE, 1), (MEMBERSHIP_TYPE, 0)), +) + +PRINCIPAL: StaticSchema = ( + 19, + n0, + _P, + 0, + (_u, _g), + ((PRINCIPAL_USER, 0), (PRINCIPAL_GROUP, 0)), +) + +PRINCIPALS: StaticSchema = (16, n0, _Pr, 0, (_m,), ((PRINCIPAL, 0),)) + +ACCESS_CONTROL: StaticSchema = ( + 18, + n0, + _AC, + 0, + (_p, _mR), + ((PRINCIPALS, 1), (MEMBER_RELATION, 0)), +) + +ACCESS_CONTROLS: StaticSchema = (16, n0, _ACc, 0, (_m,), ((ACCESS_CONTROL, 0),)) + +ACCESS_CONFIGURATION: StaticSchema = ( + 18, + n0, + _ACcc, + 0, + (_aC, _mR), + ((ACCESS_CONTROLS, 1), (MEMBER_RELATION, 0)), +) + +ERROR_MESSAGE: StaticSchema = (3, n0, _EM, 0) + +ACCESS_DENIED_EXCEPTION: StaticSchema = ( + 18, + n0, + _ADE, + {_sm: _c, _sE: 403}, + (_me,), + ((ERROR_MESSAGE, 1),), +) + +Q_IAM_ACTION: StaticSchema = (3, n0, _QIA, 0) +DOCUMENT_ATTRIBUTE_KEY: StaticSchema = (3, n0, _DAK, 0) -MEMBER_RELATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#MemberRelation"), - shape_type=ShapeType.ENUM, - members={"AND": {"target": UNIT}, "OR": {"target": UNIT}}, -) +TIMESTAMP: StaticSchema = (4, n0, _T, 0) -READ_ACCESS_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ReadAccessType"), - shape_type=ShapeType.ENUM, - members={"ALLOW": {"target": UNIT}, "DENY": {"target": UNIT}}, -) +LONG: StaticSchema = (8, n0, _L, 0) -MEMBERSHIP_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#MembershipType"), - shape_type=ShapeType.ENUM, - members={"INDEX": {"target": UNIT}, "DATASOURCE": {"target": UNIT}}, -) +STRING: StaticSchema = (3, n0, _S, 0) -GROUP_NAME = Schema( - id=ShapeID("com.amazonaws.qbusiness#GroupName"), shape_type=ShapeType.STRING +DOCUMENT_ATTRIBUTE_STRING_LIST_VALUE: StaticSchema = ( + 16, + n0, + _DASLV, + 0, + (_m,), + ((STRING, 0),), ) -PRINCIPAL_GROUP = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#PrincipalGroup"), - members={ - "name": {"target": GROUP_NAME}, - "access": { - "target": READ_ACCESS_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "membershipType": {"target": MEMBERSHIP_TYPE}, - }, -) +DOCUMENT_ATTRIBUTE_STRING_VALUE: StaticSchema = (3, n0, _DASV, 0) -USER_ID = Schema( - id=ShapeID("com.amazonaws.qbusiness#UserId"), shape_type=ShapeType.STRING +DOCUMENT_ATTRIBUTE_VALUE: StaticSchema = ( + 19, + n0, + _DAV, + 0, + (_sVt, _sLV, _lV, _dV), + ( + (DOCUMENT_ATTRIBUTE_STRING_VALUE, 0), + (DOCUMENT_ATTRIBUTE_STRING_LIST_VALUE, 0), + (LONG, 0), + (TIMESTAMP, 0), + ), ) -PRINCIPAL_USER = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#PrincipalUser"), - members={ - "id": {"target": USER_ID}, - "access": { - "target": READ_ACCESS_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "membershipType": {"target": MEMBERSHIP_TYPE}, - }, +DOCUMENT_ATTRIBUTE: StaticSchema = ( + 18, + n0, + _DA, + 0, + (_n, _v), + ((DOCUMENT_ATTRIBUTE_KEY, 1), (DOCUMENT_ATTRIBUTE_VALUE, 1)), ) -PRINCIPAL = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#Principal"), - shape_type=ShapeType.UNION, - members={"user": {"target": PRINCIPAL_USER}, "group": {"target": PRINCIPAL_GROUP}}, +ACTION_PAYLOAD_FIELD_KEY: StaticSchema = (3, n0, _APFK, 0) + +ACTION_PAYLOAD_FIELD_VALUE: StaticSchema = (13, n0, _APFV, 0) + +ACTION_EXECUTION_PAYLOAD_FIELD: StaticSchema = ( + 18, + n0, + _AEPF, + 0, + (_v,), + ((ACTION_PAYLOAD_FIELD_VALUE, 1),), ) -PRINCIPALS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#Principals"), - shape_type=ShapeType.LIST, - members={"member": {"target": PRINCIPAL}}, +ACTION_EXECUTION_PAYLOAD: StaticSchema = ( + 17, + n0, + _AEP, + 0, + (_k, _v), + ((ACTION_PAYLOAD_FIELD_KEY, 0), (ACTION_EXECUTION_PAYLOAD_FIELD, 0)), ) -ACCESS_CONTROL = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#AccessControl"), - members={ - "principals": { - "target": PRINCIPALS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "memberRelation": {"target": MEMBER_RELATION}, - }, +ACTION_PAYLOAD_FIELD_NAME_SEPARATOR: StaticSchema = (3, n0, _APFNS, 0) + +PLUGIN_ID: StaticSchema = (3, n0, _PI, 0) + +ACTION_EXECUTION: StaticSchema = ( + 18, + n0, + _AE, + 0, + (_pI, _pa, _pFNS), + ( + (PLUGIN_ID, 1), + (ACTION_EXECUTION_PAYLOAD, 1), + (ACTION_PAYLOAD_FIELD_NAME_SEPARATOR, 1), + ), ) -ACCESS_CONTROLS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#AccessControls"), - shape_type=ShapeType.LIST, - members={"member": {"target": ACCESS_CONTROL}}, +ACTION_EXECUTION_EVENT: StaticSchema = ( + 18, + n0, + _AEE, + 0, + (_pI, _pa, _pFNS), + ( + (PLUGIN_ID, 1), + (ACTION_EXECUTION_PAYLOAD, 1), + (ACTION_PAYLOAD_FIELD_NAME_SEPARATOR, 1), + ), ) -ACCESS_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#AccessConfiguration"), - members={ - "accessControls": { - "target": ACCESS_CONTROLS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "memberRelation": {"target": MEMBER_RELATION}, - }, +ACTION_PAYLOAD_FIELD_TYPE: StaticSchema = ( + 14, + n0, + _APFT, + 0, + (_STRING, _NUMBER, _ARRAY, _BOOLEAN), + ( + (-1, {_sV: _STRING}), + (-1, {_sV: _NUMBER}), + (-1, {_sV: _ARRAY}), + (-1, {_sV: _BOOLEAN}), + ), ) -ERROR_MESSAGE = Schema( - id=ShapeID("com.amazonaws.qbusiness#ErrorMessage"), shape_type=ShapeType.STRING +ACTION_REVIEW_PAYLOAD_FIELD_ALLOWED_VALUE: StaticSchema = ( + 18, + n0, + _ARPFAV, + 0, + (_v, _dVi), + ((ACTION_PAYLOAD_FIELD_VALUE, 0), (ACTION_PAYLOAD_FIELD_VALUE, 0)), +) + +ACTION_REVIEW_PAYLOAD_FIELD_ALLOWED_VALUES: StaticSchema = ( + 16, + n0, + _ARPFAVc, + 0, + (_m,), + ((ACTION_REVIEW_PAYLOAD_FIELD_ALLOWED_VALUE, 0),), +) + +ACTION_REVIEW_PAYLOAD_FIELD_ARRAY_ITEM_JSON_SCHEMA: StaticSchema = ( + 13, + n0, + _ARPFAIJS, + 0, +) + +INTEGER: StaticSchema = (7, n0, _I, 0) + +ACTION_REVIEW_PAYLOAD_FIELD: StaticSchema = ( + 18, + n0, + _ARPF, + 0, + (_dN, _dO, _dD, _t, _v, _aV, _aF, _aIJS, _r), + ( + (STRING, 0), + (INTEGER, 0), + (STRING, 0), + (ACTION_PAYLOAD_FIELD_TYPE, 0), + (ACTION_PAYLOAD_FIELD_VALUE, 0), + (ACTION_REVIEW_PAYLOAD_FIELD_ALLOWED_VALUES, 0), + (STRING, 0), + (ACTION_REVIEW_PAYLOAD_FIELD_ARRAY_ITEM_JSON_SCHEMA, 0), + (2, 0), + ), ) -ACCESS_DENIED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=403), - ], - members={ - "message": { - "target": ERROR_MESSAGE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +ACTION_REVIEW_PAYLOAD: StaticSchema = ( + 17, + n0, + _ARP, + 0, + (_k, _v), + ((ACTION_PAYLOAD_FIELD_KEY, 0), (ACTION_REVIEW_PAYLOAD_FIELD, 0)), +) + +PLUGIN_TYPE: StaticSchema = ( + 14, + n0, + _PT, + 0, + ( + _SN, + _SALESFORCE, + _JIRA, + _ZENDESK, + _CUSTOM, + _QUICKSIGHT, + _SNP, + _JC, + _SC, + _ZS, + _AC_, + _GC, + _MT_, + _ME, + _PA, + _SMARTSHEET, + _ASANA, + ), + ( + (-1, {_sV: _SN}), + (-1, {_sV: _SALESFORCE}), + (-1, {_sV: _JIRA}), + (-1, {_sV: _ZENDESK}), + (-1, {_sV: _CUSTOM}), + (-1, {_sV: _QUICKSIGHT}), + (-1, {_sV: _SNP}), + (-1, {_sV: _JC}), + (-1, {_sV: _SC}), + (-1, {_sV: _ZS}), + (-1, {_sV: _AC_}), + (-1, {_sV: _GC}), + (-1, {_sV: _MT_}), + (-1, {_sV: _ME}), + (-1, {_sV: _PA}), + (-1, {_sV: _SMARTSHEET}), + (-1, {_sV: _ASANA}), + ), ) -Q_IAM_ACTION = Schema( - id=ShapeID("com.amazonaws.qbusiness#QIamAction"), shape_type=ShapeType.STRING +ACTION_REVIEW: StaticSchema = ( + 18, + n0, + _AR, + 0, + (_pI, _pT, _pa, _pFNS), + ( + (PLUGIN_ID, 0), + (PLUGIN_TYPE, 0), + (ACTION_REVIEW_PAYLOAD, 0), + (ACTION_PAYLOAD_FIELD_NAME_SEPARATOR, 0), + ), ) -DOCUMENT_ATTRIBUTE_KEY = Schema( - id=ShapeID("com.amazonaws.qbusiness#DocumentAttributeKey"), - shape_type=ShapeType.STRING, +CONVERSATION_ID: StaticSchema = (3, n0, _CI, 0) + +MESSAGE_ID: StaticSchema = (3, n0, _MI, 0) + +ACTION_REVIEW_EVENT: StaticSchema = ( + 18, + n0, + _ARE, + 0, + (_cI, _uMI, _sMI, _pI, _pT, _pa, _pFNS), + ( + (CONVERSATION_ID, 0), + (MESSAGE_ID, 0), + (MESSAGE_ID, 0), + (PLUGIN_ID, 0), + (PLUGIN_TYPE, 0), + (ACTION_REVIEW_PAYLOAD, 0), + (ACTION_PAYLOAD_FIELD_NAME_SEPARATOR, 0), + ), ) -TIMESTAMP = Schema( - id=ShapeID("com.amazonaws.qbusiness#Timestamp"), shape_type=ShapeType.TIMESTAMP +ACTION_SUMMARY: StaticSchema = ( + 18, + n0, + _AS, + 0, + (_aI, _dN, _iE, _d), + ((STRING, 0), (STRING, 0), (STRING, 0), (STRING, 0)), ) -LONG = Schema(id=ShapeID("com.amazonaws.qbusiness#Long"), shape_type=ShapeType.LONG) +ACTIONS: StaticSchema = (16, n0, _A, 0, (_m,), ((ACTION_SUMMARY, 0),)) -STRING = Schema( - id=ShapeID("com.amazonaws.qbusiness#String"), shape_type=ShapeType.STRING -) +AMAZON_RESOURCE_NAME: StaticSchema = (3, n0, _ARN, 0) -DOCUMENT_ATTRIBUTE_STRING_LIST_VALUE = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DocumentAttributeStringListValue"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, -) +PAYLOAD: StaticSchema = (3, n0, _Pa, 4) -DOCUMENT_ATTRIBUTE_STRING_VALUE = Schema( - id=ShapeID("com.amazonaws.qbusiness#DocumentAttributeStringValue"), - shape_type=ShapeType.STRING, -) +S3_BUCKET_NAME: StaticSchema = (3, n0, _SBN, 0) -DOCUMENT_ATTRIBUTE_VALUE = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DocumentAttributeValue"), - shape_type=ShapeType.UNION, - members={ - "stringValue": {"target": DOCUMENT_ATTRIBUTE_STRING_VALUE}, - "stringListValue": {"target": DOCUMENT_ATTRIBUTE_STRING_LIST_VALUE}, - "longValue": {"target": LONG}, - "dateValue": {"target": TIMESTAMP}, - }, -) +S3_OBJECT_KEY: StaticSchema = (3, n0, _SOK, 0) -DOCUMENT_ATTRIBUTE = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DocumentAttribute"), - members={ - "name": { - "target": DOCUMENT_ATTRIBUTE_KEY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "value": { - "target": DOCUMENT_ATTRIBUTE_VALUE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +S3: StaticSchema = (18, n0, _S_, 0, (_b, _k), ((S3_BUCKET_NAME, 1), (S3_OBJECT_KEY, 1))) -ACTION_PAYLOAD_FIELD_KEY = Schema( - id=ShapeID("com.amazonaws.qbusiness#ActionPayloadFieldKey"), - shape_type=ShapeType.STRING, -) +API_SCHEMA: StaticSchema = (19, n0, _APIS, 0, (_pa, _s_), ((PAYLOAD, 0), (S3, 0))) -ACTION_PAYLOAD_FIELD_VALUE = Schema( - id=ShapeID("com.amazonaws.qbusiness#ActionPayloadFieldValue"), - shape_type=ShapeType.DOCUMENT, -) +API_SCHEMA_TYPE: StaticSchema = (14, n0, _APIST, 0, (_OAV,), ((-1, {_sV: _OAV}),)) -ACTION_EXECUTION_PAYLOAD_FIELD = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ActionExecutionPayloadField"), - members={ - "value": { - "target": ACTION_PAYLOAD_FIELD_VALUE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +APPLICATION_ID: StaticSchema = (3, n0, _AI, 0) + +APPLICATION_NAME: StaticSchema = (3, n0, _AN, 0) + +IDENTITY_TYPE: StaticSchema = ( + 14, + n0, + _IT, + 0, + (_AIIS, _AIIO, _AII, _AQI, _ANONYMOUS), + ( + (-1, {_sV: _AIIS}), + (-1, {_sV: _AIIO}), + (-1, {_sV: _AII}), + (-1, {_sV: _AQI}), + (-1, {_sV: _ANONYMOUS}), + ), ) -ACTION_EXECUTION_PAYLOAD = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ActionExecutionPayload"), - shape_type=ShapeType.MAP, - members={ - "key": {"target": ACTION_PAYLOAD_FIELD_KEY}, - "value": {"target": ACTION_EXECUTION_PAYLOAD_FIELD}, - }, +CLIENT_NAMESPACE: StaticSchema = (3, n0, _CN, 0) + +QUICK_SIGHT_CONFIGURATION: StaticSchema = ( + 18, + n0, + _QSC, + 0, + (_cN,), + ((CLIENT_NAMESPACE, 1),), +) + +APPLICATION_STATUS: StaticSchema = ( + 14, + n0, + _ASp, + 0, + (_CREATING, _ACTIVE, _DELETING, _FAILED, _UPDATING), + ( + (-1, {_sV: _CREATING}), + (-1, {_sV: _ACTIVE}), + (-1, {_sV: _DELETING}), + (-1, {_sV: _FAILED}), + (-1, {_sV: _UPDATING}), + ), ) -ACTION_PAYLOAD_FIELD_NAME_SEPARATOR = Schema( - id=ShapeID("com.amazonaws.qbusiness#ActionPayloadFieldNameSeparator"), - shape_type=ShapeType.STRING, +APPLICATION: StaticSchema = ( + 18, + n0, + _Ap, + 0, + (_dN, _aIp, _cA, _uA, _st, _iT, _qSC), + ( + (APPLICATION_NAME, 0), + (APPLICATION_ID, 0), + (TIMESTAMP, 0), + (TIMESTAMP, 0), + (APPLICATION_STATUS, 0), + (IDENTITY_TYPE, 0), + (QUICK_SIGHT_CONFIGURATION, 0), + ), ) -PLUGIN_ID = Schema( - id=ShapeID("com.amazonaws.qbusiness#PluginId"), shape_type=ShapeType.STRING +APPLICATION_ARN: StaticSchema = (3, n0, _AA, 0) + +CONFLICT_EXCEPTION: StaticSchema = ( + 18, + n0, + _CE, + {_sm: _c, _sE: 409}, + (_me, _rI, _rT), + ((ERROR_MESSAGE, 1), (STRING, 1), (STRING, 1)), ) -ACTION_EXECUTION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ActionExecution"), - members={ - "pluginId": { - "target": PLUGIN_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "payload": { - "target": ACTION_EXECUTION_PAYLOAD, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "payloadFieldNameSeparator": { - "target": ACTION_PAYLOAD_FIELD_NAME_SEPARATOR, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +ATTACHMENTS_CONTROL_MODE: StaticSchema = ( + 14, + n0, + _ACM, + 0, + (_ENABLED, _DISABLED), + ((-1, {_sV: _ENABLED}), (-1, {_sV: _DISABLED})), ) -ACTION_EXECUTION_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ActionExecutionEvent"), - members={ - "pluginId": { - "target": PLUGIN_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "payload": { - "target": ACTION_EXECUTION_PAYLOAD, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "payloadFieldNameSeparator": { - "target": ACTION_PAYLOAD_FIELD_NAME_SEPARATOR, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +ATTACHMENTS_CONFIGURATION: StaticSchema = ( + 18, + n0, + _ACt, + 0, + (_aCM,), + ((ATTACHMENTS_CONTROL_MODE, 1),), ) -ACTION_PAYLOAD_FIELD_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ActionPayloadFieldType"), - shape_type=ShapeType.ENUM, - members={ - "STRING": {"target": UNIT}, - "NUMBER": {"target": UNIT}, - "ARRAY": {"target": UNIT}, - "BOOLEAN": {"target": UNIT}, - }, +CLIENT_ID_FOR_OIDC: StaticSchema = (3, n0, _CIFOIDC, 0) + +CLIENT_IDS_FOR_OIDC: StaticSchema = ( + 16, + n0, + _CIFOIDCl, + 0, + (_m,), + ((CLIENT_ID_FOR_OIDC, 0),), ) -ACTION_REVIEW_PAYLOAD_FIELD_ALLOWED_VALUE = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ActionReviewPayloadFieldAllowedValue"), - members={ - "value": {"target": ACTION_PAYLOAD_FIELD_VALUE}, - "displayValue": {"target": ACTION_PAYLOAD_FIELD_VALUE}, - }, +CLIENT_TOKEN: StaticSchema = (3, n0, _CT, 0) + +DESCRIPTION: StaticSchema = (3, n0, _D, 0) + +KMS_KEY_ID: StaticSchema = (3, n0, _KKI, 4) + +ENCRYPTION_CONFIGURATION: StaticSchema = (18, n0, _EC, 0, (_kKI,), ((KMS_KEY_ID, 0),)) + +IAM_IDENTITY_PROVIDER_ARN: StaticSchema = (3, n0, _IAMIPA, 0) + +INSTANCE_ARN: StaticSchema = (3, n0, _IA, 0) + +PERSONALIZATION_CONTROL_MODE: StaticSchema = ( + 14, + n0, + _PCM, + 0, + (_ENABLED, _DISABLED), + ((-1, {_sV: _ENABLED}), (-1, {_sV: _DISABLED})), ) -ACTION_REVIEW_PAYLOAD_FIELD_ALLOWED_VALUES = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ActionReviewPayloadFieldAllowedValues"), - shape_type=ShapeType.LIST, - members={"member": {"target": ACTION_REVIEW_PAYLOAD_FIELD_ALLOWED_VALUE}}, +PERSONALIZATION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _PC, + 0, + (_pCM,), + ((PERSONALIZATION_CONTROL_MODE, 1),), ) -ACTION_REVIEW_PAYLOAD_FIELD_ARRAY_ITEM_JSON_SCHEMA = Schema( - id=ShapeID("com.amazonaws.qbusiness#ActionReviewPayloadFieldArrayItemJsonSchema"), - shape_type=ShapeType.DOCUMENT, +Q_APPS_CONTROL_MODE: StaticSchema = ( + 14, + n0, + _QACM, + 0, + (_ENABLED, _DISABLED), + ((-1, {_sV: _ENABLED}), (-1, {_sV: _DISABLED})), ) -INTEGER = Schema( - id=ShapeID("com.amazonaws.qbusiness#Integer"), shape_type=ShapeType.INTEGER +Q_APPS_CONFIGURATION: StaticSchema = ( + 18, + n0, + _QAC, + 0, + (_qACM,), + ((Q_APPS_CONTROL_MODE, 1),), ) -ACTION_REVIEW_PAYLOAD_FIELD = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ActionReviewPayloadField"), - members={ - "displayName": {"target": STRING}, - "displayOrder": {"target": INTEGER}, - "displayDescription": {"target": STRING}, - "type": {"target": ACTION_PAYLOAD_FIELD_TYPE}, - "value": {"target": ACTION_PAYLOAD_FIELD_VALUE}, - "allowedValues": {"target": ACTION_REVIEW_PAYLOAD_FIELD_ALLOWED_VALUES}, - "allowedFormat": {"target": STRING}, - "arrayItemJsonSchema": { - "target": ACTION_REVIEW_PAYLOAD_FIELD_ARRAY_ITEM_JSON_SCHEMA - }, - "required": {"target": BOOLEAN}, - }, +ROLE_ARN: StaticSchema = (3, n0, _RA, 0) + +TAG_KEY: StaticSchema = (3, n0, _TK, 0) + +TAG_VALUE: StaticSchema = (3, n0, _TV, 0) + +TAG: StaticSchema = (18, n0, _Ta, 0, (_k, _v), ((TAG_KEY, 1), (TAG_VALUE, 1))) + +TAGS: StaticSchema = (16, n0, _Tag, 0, (_m,), ((TAG, 0),)) + +CREATE_APPLICATION_INPUT: StaticSchema = ( + 18, + n0, + _CAI, + {_sSI: _cCAR, _smit: None}, + (_dN, _rA, _iT, _iIPA, _iCIA, _cIFOIDC, _d, _eC, _ta, _cT, _aCt, _qAC, _pC, _qSC), + ( + (APPLICATION_NAME, 1), + (ROLE_ARN, 0), + (IDENTITY_TYPE, 0), + (IAM_IDENTITY_PROVIDER_ARN, 0), + (INSTANCE_ARN, 0), + (CLIENT_IDS_FOR_OIDC, 0), + (DESCRIPTION, 0), + (ENCRYPTION_CONFIGURATION, 0), + (TAGS, 0), + (CLIENT_TOKEN, 2), + (ATTACHMENTS_CONFIGURATION, 0), + (Q_APPS_CONFIGURATION, 0), + (PERSONALIZATION_CONFIGURATION, 0), + (QUICK_SIGHT_CONFIGURATION, 0), + ), ) -ACTION_REVIEW_PAYLOAD = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ActionReviewPayload"), - shape_type=ShapeType.MAP, - members={ - "key": {"target": ACTION_PAYLOAD_FIELD_KEY}, - "value": {"target": ACTION_REVIEW_PAYLOAD_FIELD}, - }, +CREATE_APPLICATION_OUTPUT: StaticSchema = ( + 18, + n0, + _CAO, + {_sSI: _cCARo, _smith: None}, + (_aIp, _aA), + ((APPLICATION_ID, 0), (APPLICATION_ARN, 0)), +) + +INTERNAL_SERVER_EXCEPTION: StaticSchema = ( + 18, + n0, + _ISE, + {_sm: _se, _sE: 500}, + (_me,), + ((ERROR_MESSAGE, 1),), +) + +RESOURCE_NOT_FOUND_EXCEPTION: StaticSchema = ( + 18, + n0, + _RNFE, + {_sm: _c, _sE: 404}, + (_me, _rI, _rT), + ((ERROR_MESSAGE, 1), (STRING, 1), (STRING, 1)), +) + +SERVICE_QUOTA_EXCEEDED_EXCEPTION: StaticSchema = ( + 18, + n0, + _SQEE, + {_sm: _c, _sE: 402}, + (_me, _rI, _rT), + ((ERROR_MESSAGE, 1), (STRING, 1), (STRING, 1)), +) + +THROTTLING_EXCEPTION: StaticSchema = ( + 18, + n0, + _TE, + {_sm: _c, _sE: 429}, + (_me,), + ((ERROR_MESSAGE, 1),), +) + +VALIDATION_EXCEPTION_FIELD: StaticSchema = ( + 18, + n0, + _VEF, + 0, + (_n, _me), + ((STRING, 1), (STRING, 1)), +) + +VALIDATION_EXCEPTION_FIELDS: StaticSchema = ( + 16, + n0, + _VEFa, + 0, + (_m,), + ((VALIDATION_EXCEPTION_FIELD, 0),), +) + +VALIDATION_EXCEPTION_REASON: StaticSchema = ( + 14, + n0, + _VER, + 0, + (_CP, _FVF, _UO), + ((-1, {_sV: _CP}), (-1, {_sV: _FVF}), (-1, {_sV: _UO})), +) + +VALIDATION_EXCEPTION: StaticSchema = ( + 18, + n0, + _VE, + {_sm: _c, _sE: 400}, + (_me, _re, _f), + ( + (ERROR_MESSAGE, 1), + (VALIDATION_EXCEPTION_REASON, 1), + (VALIDATION_EXCEPTION_FIELDS, 0), + ), ) -PLUGIN_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#PluginType"), - shape_type=ShapeType.ENUM, - members={ - "SERVICE_NOW": {"target": UNIT}, - "SALESFORCE": {"target": UNIT}, - "JIRA": {"target": UNIT}, - "ZENDESK": {"target": UNIT}, - "CUSTOM": {"target": UNIT}, - "QUICKSIGHT": {"target": UNIT}, - "SERVICENOW_NOW_PLATFORM": {"target": UNIT}, - "JIRA_CLOUD": {"target": UNIT}, - "SALESFORCE_CRM": {"target": UNIT}, - "ZENDESK_SUITE": {"target": UNIT}, - "ATLASSIAN_CONFLUENCE": {"target": UNIT}, - "GOOGLE_CALENDAR": {"target": UNIT}, - "MICROSOFT_TEAMS": {"target": UNIT}, - "MICROSOFT_EXCHANGE": {"target": UNIT}, - "PAGERDUTY_ADVANCE": {"target": UNIT}, - "SMARTSHEET": {"target": UNIT}, - "ASANA": {"target": UNIT}, - }, +CREATE_APPLICATION: StaticOperationSchema = ( + 23, + n0, + _CA, + {_smithy: MappingProxyType({"uri": "/applications", "method": "POST"})}, + CREATE_APPLICATION_INPUT, + CREATE_APPLICATION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -ACTION_REVIEW = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ActionReview"), - members={ - "pluginId": {"target": PLUGIN_ID}, - "pluginType": {"target": PLUGIN_TYPE}, - "payload": {"target": ACTION_REVIEW_PAYLOAD}, - "payloadFieldNameSeparator": {"target": ACTION_PAYLOAD_FIELD_NAME_SEPARATOR}, - }, +IDC_TRUSTED_TOKEN_ISSUER_ARN: StaticSchema = (3, n0, _ITTIA, 0) + +DATA_ACCESSOR_IDC_TRUSTED_TOKEN_ISSUER_CONFIGURATION: StaticSchema = ( + 18, + n0, + _DAITTIC, + 0, + (_iTTIA,), + ((IDC_TRUSTED_TOKEN_ISSUER_ARN, 1),), +) + +DATA_ACCESSOR_AUTHENTICATION_CONFIGURATION: StaticSchema = ( + 19, + n0, + _DAAC, + 0, + (_iTTIC,), + ((DATA_ACCESSOR_IDC_TRUSTED_TOKEN_ISSUER_CONFIGURATION, 0),), +) + +DATA_ACCESSOR_AUTHENTICATION_TYPE: StaticSchema = ( + 14, + n0, + _DAAT, + 0, + (_AIIT, _AIIAC), + ((-1, {_sV: _AIIT}), (-1, {_sV: _AIIAC})), +) + +DATA_ACCESSOR_EXTERNAL_ID: StaticSchema = (3, n0, _DAEI, 0) + +DATA_ACCESSOR_EXTERNAL_IDS: StaticSchema = ( + 16, + n0, + _DAEIa, + 0, + (_m,), + ((DATA_ACCESSOR_EXTERNAL_ID, 0),), +) + +DATA_ACCESSOR_AUTHENTICATION_DETAIL: StaticSchema = ( + 18, + n0, + _DAAD, + 0, + (_aT, _aCu, _eI), + ( + (DATA_ACCESSOR_AUTHENTICATION_TYPE, 1), + (DATA_ACCESSOR_AUTHENTICATION_CONFIGURATION, 0), + (DATA_ACCESSOR_EXTERNAL_IDS, 0), + ), ) -CONVERSATION_ID = Schema( - id=ShapeID("com.amazonaws.qbusiness#ConversationId"), shape_type=ShapeType.STRING +DATA_ACCESSOR_NAME: StaticSchema = (3, n0, _DAN, 4) + +PRINCIPAL_ROLE_ARN: StaticSchema = (3, n0, _PRA, 0) + +DATA_ACCESSOR_ARN: StaticSchema = (3, n0, _DAA, 0) + +DATA_ACCESSOR_ID: StaticSchema = (3, n0, _DAI, 0) + +IDC_APPLICATION_ARN: StaticSchema = (3, n0, _IAA, 0) + +CREATE_DATA_ACCESSOR_OUTPUT: StaticSchema = ( + 18, + n0, + _CDAO, + {_sSI: _cCDAR, _smith: None}, + (_dAI, _iAA, _dAA), + ((DATA_ACCESSOR_ID, 1), (IDC_APPLICATION_ARN, 1), (DATA_ACCESSOR_ARN, 1)), ) -MESSAGE_ID = Schema( - id=ShapeID("com.amazonaws.qbusiness#MessageId"), shape_type=ShapeType.STRING +DELETE_DATA_ACCESSOR_INPUT: StaticSchema = ( + 18, + n0, + _DDAI, + {_sSI: _cDDAR, _smit: None}, + (_aIp, _dAI), + ((APPLICATION_ID, 9), (DATA_ACCESSOR_ID, 9)), ) -ACTION_REVIEW_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ActionReviewEvent"), - members={ - "conversationId": {"target": CONVERSATION_ID}, - "userMessageId": {"target": MESSAGE_ID}, - "systemMessageId": {"target": MESSAGE_ID}, - "pluginId": {"target": PLUGIN_ID}, - "pluginType": {"target": PLUGIN_TYPE}, - "payload": {"target": ACTION_REVIEW_PAYLOAD}, - "payloadFieldNameSeparator": {"target": ACTION_PAYLOAD_FIELD_NAME_SEPARATOR}, - }, +DELETE_DATA_ACCESSOR_OUTPUT: StaticSchema = ( + 18, + n0, + _DDAO, + {_sSI: _cDDARo, _smith: None}, ) -ACTION_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ActionSummary"), - members={ - "actionIdentifier": {"target": STRING}, - "displayName": {"target": STRING}, - "instructionExample": {"target": STRING}, - "description": {"target": STRING}, +DELETE_DATA_ACCESSOR: StaticOperationSchema = ( + 23, + n0, + _DDA, + { + _smithy: MappingProxyType( + { + "uri": "/applications/{applicationId}/dataaccessors/{dataAccessorId}", + "method": "DELETE", + } + ) }, + DELETE_DATA_ACCESSOR_INPUT, + DELETE_DATA_ACCESSOR_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -ACTIONS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#Actions"), - shape_type=ShapeType.LIST, - members={"member": {"target": ACTION_SUMMARY}}, +GET_DATA_ACCESSOR_INPUT: StaticSchema = ( + 18, + n0, + _GDAI, + {_sSI: _cGDAR, _smit: None}, + (_aIp, _dAI), + ((APPLICATION_ID, 9), (DATA_ACCESSOR_ID, 9)), ) -AMAZON_RESOURCE_NAME = Schema( - id=ShapeID("com.amazonaws.qbusiness#AmazonResourceName"), - shape_type=ShapeType.STRING, -) +MAX_RESULTS_INTEGER_FOR_LIST_DATA_ACCESSORS: StaticSchema = (7, n0, _MRIFLDA, 0) -PAYLOAD = Schema( - id=ShapeID("com.amazonaws.qbusiness#Payload"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +NEXT_TOKEN1500: StaticSchema = (3, n0, _NT, 0) + +LIST_DATA_ACCESSORS_INPUT: StaticSchema = ( + 18, + n0, + _LDAI, + {_sSI: _cLDAR, _smit: None}, + (_aIp, _nT, _mRa), + ( + (APPLICATION_ID, 9), + (NEXT_TOKEN1500, {_sQ: _nT}), + (MAX_RESULTS_INTEGER_FOR_LIST_DATA_ACCESSORS, {_sQ: _mRa}), + ), ) -S3_BUCKET_NAME = Schema( - id=ShapeID("com.amazonaws.qbusiness#S3BucketName"), shape_type=ShapeType.STRING +DATA_ACCESSOR: StaticSchema = ( + 18, + n0, + _DAa, + 0, + (_dN, _dAI, _dAA, _iAA, _pr, _aD, _cA, _uA), + ( + (DATA_ACCESSOR_NAME, 0), + (DATA_ACCESSOR_ID, 0), + (DATA_ACCESSOR_ARN, 0), + (IDC_APPLICATION_ARN, 0), + (PRINCIPAL_ROLE_ARN, 0), + (DATA_ACCESSOR_AUTHENTICATION_DETAIL, 0), + (TIMESTAMP, 0), + (TIMESTAMP, 0), + ), ) -S3_OBJECT_KEY = Schema( - id=ShapeID("com.amazonaws.qbusiness#S3ObjectKey"), shape_type=ShapeType.STRING +DATA_ACCESSORS: StaticSchema = (16, n0, _DAat, 0, (_m,), ((DATA_ACCESSOR, 0),)) + +LIST_DATA_ACCESSORS_OUTPUT: StaticSchema = ( + 18, + n0, + _LDAO, + {_sSI: _cLDARo, _smith: None}, + (_dA, _nT), + ((DATA_ACCESSORS, 0), (NEXT_TOKEN1500, 0)), ) -S3 = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#S3"), - members={ - "bucket": { - "target": S3_BUCKET_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "key": { - "target": S3_OBJECT_KEY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, +LIST_DATA_ACCESSORS: StaticOperationSchema = ( + 23, + n0, + _LDA, + { + _smithy: MappingProxyType( + {"uri": "/applications/{applicationId}/dataaccessors", "method": "GET"} + ) }, + LIST_DATA_ACCESSORS_INPUT, + LIST_DATA_ACCESSORS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -API_SCHEMA = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#APISchema"), - shape_type=ShapeType.UNION, - members={"payload": {"target": PAYLOAD}, "s3": {"target": S3}}, +UPDATE_DATA_ACCESSOR_OUTPUT: StaticSchema = ( + 18, + n0, + _UDAO, + {_sSI: _cUDAR, _smith: None}, ) -API_SCHEMA_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#APISchemaType"), - shape_type=ShapeType.ENUM, - members={"OPEN_API_V3": {"target": UNIT}}, +DELETE_APPLICATION_INPUT: StaticSchema = ( + 18, + n0, + _DAIe, + {_sSI: _cDAR, _smit: None}, + (_aIp,), + ((APPLICATION_ID, 9),), ) -APPLICATION_ID = Schema( - id=ShapeID("com.amazonaws.qbusiness#ApplicationId"), shape_type=ShapeType.STRING +DELETE_APPLICATION_OUTPUT: StaticSchema = (18, n0, _DAO, {_sSI: _cDARo, _smith: None}) + +DELETE_APPLICATION: StaticOperationSchema = ( + 23, + n0, + _DAe, + { + _smithy: MappingProxyType( + {"uri": "/applications/{applicationId}", "method": "DELETE"} + ) + }, + DELETE_APPLICATION_INPUT, + DELETE_APPLICATION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -APPLICATION_NAME = Schema( - id=ShapeID("com.amazonaws.qbusiness#ApplicationName"), shape_type=ShapeType.STRING +GET_APPLICATION_INPUT: StaticSchema = ( + 18, + n0, + _GAI, + {_sSI: _cGAR, _smit: None}, + (_aIp,), + ((APPLICATION_ID, 9),), +) + +APPLIED_ATTACHMENTS_CONFIGURATION: StaticSchema = ( + 18, + n0, + _AAC, + 0, + (_aCM,), + ((ATTACHMENTS_CONTROL_MODE, 0),), +) + +AUTO_SUBSCRIPTION_STATUS: StaticSchema = ( + 14, + n0, + _ASS, + 0, + (_ENABLED, _DISABLED), + ((-1, {_sV: _ENABLED}), (-1, {_sV: _DISABLED})), +) + +SUBSCRIPTION_TYPE: StaticSchema = ( + 14, + n0, + _ST, + 0, + (_QL, _QB), + ((-1, {_sV: _QL}), (-1, {_sV: _QB})), +) + +AUTO_SUBSCRIPTION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _ASC, + 0, + (_aS, _dST), + ((AUTO_SUBSCRIPTION_STATUS, 1), (SUBSCRIPTION_TYPE, 0)), +) + +ERROR_CODE: StaticSchema = ( + 14, + n0, + _ECr, + 0, + (_IE, _IR, _RI, _RNF), + ((-1, {_sV: _IEn}), (-1, {_sV: _IRn}), (-1, {_sV: _RIe}), (-1, {_sV: _RNFe})), +) + +ERROR_DETAIL: StaticSchema = ( + 18, + n0, + _ED, + 0, + (_eM, _eCr), + ((ERROR_MESSAGE, 0), (ERROR_CODE, 0)), +) + +GET_APPLICATION_OUTPUT: StaticSchema = ( + 18, + n0, + _GAO, + {_sSI: _cGARo, _smith: None}, + ( + _dN, + _aIp, + _aA, + _iT, + _iIPA, + _iCAA, + _rA, + _st, + _d, + _eC, + _cA, + _uA, + _e, + _aCt, + _qAC, + _pC, + _aSC, + _cIFOIDC, + _qSC, + ), + ( + (APPLICATION_NAME, 0), + (APPLICATION_ID, 0), + (APPLICATION_ARN, 0), + (IDENTITY_TYPE, 0), + (IAM_IDENTITY_PROVIDER_ARN, 0), + (IDC_APPLICATION_ARN, 0), + (ROLE_ARN, 0), + (APPLICATION_STATUS, 0), + (DESCRIPTION, 0), + (ENCRYPTION_CONFIGURATION, 0), + (TIMESTAMP, 0), + (TIMESTAMP, 0), + (ERROR_DETAIL, 0), + (APPLIED_ATTACHMENTS_CONFIGURATION, 0), + (Q_APPS_CONFIGURATION, 0), + (PERSONALIZATION_CONFIGURATION, 0), + (AUTO_SUBSCRIPTION_CONFIGURATION, 0), + (CLIENT_IDS_FOR_OIDC, 0), + (QUICK_SIGHT_CONFIGURATION, 0), + ), ) -IDENTITY_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#IdentityType"), - shape_type=ShapeType.ENUM, - members={ - "AWS_IAM_IDP_SAML": {"target": UNIT}, - "AWS_IAM_IDP_OIDC": {"target": UNIT}, - "AWS_IAM_IDC": {"target": UNIT}, - "AWS_QUICKSIGHT_IDP": {"target": UNIT}, - "ANONYMOUS": {"target": UNIT}, +GET_APPLICATION: StaticOperationSchema = ( + 23, + n0, + _GA, + { + _smithy: MappingProxyType( + {"uri": "/applications/{applicationId}", "method": "GET"} + ) }, + GET_APPLICATION_INPUT, + GET_APPLICATION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CLIENT_NAMESPACE = Schema( - id=ShapeID("com.amazonaws.qbusiness#ClientNamespace"), shape_type=ShapeType.STRING +INDEX_CAPACITY_INTEGER: StaticSchema = (7, n0, _ICI, 0) + +INDEX_CAPACITY_CONFIGURATION: StaticSchema = ( + 18, + n0, + _ICC, + 0, + (_un,), + ((INDEX_CAPACITY_INTEGER, 0),), +) + +INDEX_NAME: StaticSchema = (3, n0, _IN, 0) + +INDEX_TYPE: StaticSchema = ( + 14, + n0, + _ITn, + 0, + (_ENTERPRISE, _STARTER), + ((-1, {_sV: _ENTERPRISE}), (-1, {_sV: _STARTER})), +) + +CREATE_INDEX_INPUT: StaticSchema = ( + 18, + n0, + _CII, + {_sSI: _cCIR, _smit: None}, + (_aIp, _dN, _d, _t, _ta, _cC, _cT), + ( + (APPLICATION_ID, 9), + (INDEX_NAME, 1), + (DESCRIPTION, 0), + (INDEX_TYPE, 0), + (TAGS, 0), + (INDEX_CAPACITY_CONFIGURATION, 0), + (CLIENT_TOKEN, 2), + ), ) -QUICK_SIGHT_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#QuickSightConfiguration"), - members={ - "clientNamespace": { - "target": CLIENT_NAMESPACE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +INDEX_ARN: StaticSchema = (3, n0, _IAn, 0) -APPLICATION_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ApplicationStatus"), - shape_type=ShapeType.ENUM, - members={ - "CREATING": {"target": UNIT}, - "ACTIVE": {"target": UNIT}, - "DELETING": {"target": UNIT}, - "FAILED": {"target": UNIT}, - "UPDATING": {"target": UNIT}, - }, +INDEX_ID: StaticSchema = (3, n0, _II, 0) + +CREATE_INDEX_OUTPUT: StaticSchema = ( + 18, + n0, + _CIO, + {_sSI: _cCIRo, _smith: None}, + (_iI, _iA), + ((INDEX_ID, 0), (INDEX_ARN, 0)), ) -APPLICATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#Application"), - members={ - "displayName": {"target": APPLICATION_NAME}, - "applicationId": {"target": APPLICATION_ID}, - "createdAt": {"target": TIMESTAMP}, - "updatedAt": {"target": TIMESTAMP}, - "status": {"target": APPLICATION_STATUS}, - "identityType": {"target": IDENTITY_TYPE}, - "quickSightConfiguration": {"target": QUICK_SIGHT_CONFIGURATION}, +CREATE_INDEX: StaticOperationSchema = ( + 23, + n0, + _CIr, + { + _smithy: MappingProxyType( + {"uri": "/applications/{applicationId}/indices", "method": "POST"} + ) }, + CREATE_INDEX_INPUT, + CREATE_INDEX_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -APPLICATION_ARN = Schema( - id=ShapeID("com.amazonaws.qbusiness#ApplicationArn"), shape_type=ShapeType.STRING -) - -CONFLICT_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ConflictException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=409), - ], - members={ - "message": { - "target": ERROR_MESSAGE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "resourceId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "resourceType": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +DATA_SOURCE_CONFIGURATION: StaticSchema = (13, n0, _DSC, 0) + +DATA_SOURCE_NAME: StaticSchema = (3, n0, _DSN, 0) + +DOCUMENT_ENRICHMENT_CONDITION_OPERATOR: StaticSchema = ( + 14, + n0, + _DECO, + 0, + (_GT, _GTOE, _LT, _LTOE, _EQUALS, _NE, _CONTAINS, _NC, _EXISTS, _NE_, _BW), + ( + (-1, {_sV: _GT}), + (-1, {_sV: _GTOE}), + (-1, {_sV: _LT}), + (-1, {_sV: _LTOE}), + (-1, {_sV: _EQUALS}), + (-1, {_sV: _NE}), + (-1, {_sV: _CONTAINS}), + (-1, {_sV: _NC}), + (-1, {_sV: _EXISTS}), + (-1, {_sV: _NE_}), + (-1, {_sV: _BW}), + ), ) -ATTACHMENTS_CONTROL_MODE = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#AttachmentsControlMode"), - shape_type=ShapeType.ENUM, - members={"ENABLED": {"target": UNIT}, "DISABLED": {"target": UNIT}}, +DOCUMENT_ATTRIBUTE_CONDITION: StaticSchema = ( + 18, + n0, + _DAC, + 0, + (_k, _o, _v), + ( + (DOCUMENT_ATTRIBUTE_KEY, 1), + (DOCUMENT_ENRICHMENT_CONDITION_OPERATOR, 1), + (DOCUMENT_ATTRIBUTE_VALUE, 0), + ), ) -ATTACHMENTS_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#AttachmentsConfiguration"), - members={ - "attachmentsControlMode": { - "target": ATTACHMENTS_CONTROL_MODE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +DOCUMENT_CONTENT_OPERATOR: StaticSchema = ( + 14, + n0, + _DCO, + 0, + (_DELETE,), + ((-1, {_sV: _DELETE}),), +) + +ATTRIBUTE_VALUE_OPERATOR: StaticSchema = ( + 14, + n0, + _AVO, + 0, + (_DELETE,), + ((-1, {_sV: _DELETE}),), +) + +DOCUMENT_ATTRIBUTE_TARGET: StaticSchema = ( + 18, + n0, + _DAT, + 0, + (_k, _v, _aVO), + ( + (DOCUMENT_ATTRIBUTE_KEY, 1), + (DOCUMENT_ATTRIBUTE_VALUE, 0), + (ATTRIBUTE_VALUE_OPERATOR, 0), + ), ) -CLIENT_ID_FOR_OIDC = Schema( - id=ShapeID("com.amazonaws.qbusiness#ClientIdForOIDC"), shape_type=ShapeType.STRING +INLINE_DOCUMENT_ENRICHMENT_CONFIGURATION: StaticSchema = ( + 18, + n0, + _IDEC, + 0, + (_co, _tar, _dCO), + ( + (DOCUMENT_ATTRIBUTE_CONDITION, 0), + (DOCUMENT_ATTRIBUTE_TARGET, 0), + (DOCUMENT_CONTENT_OPERATOR, 0), + ), ) -CLIENT_IDS_FOR_OIDC = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ClientIdsForOIDC"), - shape_type=ShapeType.LIST, - members={"member": {"target": CLIENT_ID_FOR_OIDC}}, +INLINE_DOCUMENT_ENRICHMENT_CONFIGURATIONS: StaticSchema = ( + 16, + n0, + _IDECn, + 0, + (_m,), + ((INLINE_DOCUMENT_ENRICHMENT_CONFIGURATION, 0),), +) + +LAMBDA_ARN: StaticSchema = (3, n0, _LA, 0) + +HOOK_CONFIGURATION: StaticSchema = ( + 18, + n0, + _HC, + 0, + (_iC, _lA, _sBN, _rA), + ( + (DOCUMENT_ATTRIBUTE_CONDITION, 0), + (LAMBDA_ARN, 0), + (S3_BUCKET_NAME, 0), + (ROLE_ARN, 0), + ), ) -CLIENT_TOKEN = Schema( - id=ShapeID("com.amazonaws.qbusiness#ClientToken"), shape_type=ShapeType.STRING +DOCUMENT_ENRICHMENT_CONFIGURATION: StaticSchema = ( + 18, + n0, + _DEC, + 0, + (_iCn, _pEHC, _pEHCo), + ( + (INLINE_DOCUMENT_ENRICHMENT_CONFIGURATIONS, 0), + (HOOK_CONFIGURATION, 0), + (HOOK_CONFIGURATION, 0), + ), ) -DESCRIPTION = Schema( - id=ShapeID("com.amazonaws.qbusiness#Description"), shape_type=ShapeType.STRING +AUDIO_EXTRACTION_STATUS: StaticSchema = ( + 14, + n0, + _AES, + 0, + (_ENABLED, _DISABLED), + ((-1, {_sV: _ENABLED}), (-1, {_sV: _DISABLED})), +) + +AUDIO_EXTRACTION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _AEC, + 0, + (_aES,), + ((AUDIO_EXTRACTION_STATUS, 1),), +) + +IMAGE_EXTRACTION_STATUS: StaticSchema = ( + 14, + n0, + _IES, + 0, + (_ENABLED, _DISABLED), + ((-1, {_sV: _ENABLED}), (-1, {_sV: _DISABLED})), +) + +IMAGE_EXTRACTION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _IEC, + 0, + (_iES,), + ((IMAGE_EXTRACTION_STATUS, 1),), +) + +VIDEO_EXTRACTION_STATUS: StaticSchema = ( + 14, + n0, + _VES, + 0, + (_ENABLED, _DISABLED), + ((-1, {_sV: _ENABLED}), (-1, {_sV: _DISABLED})), +) + +VIDEO_EXTRACTION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _VEC, + 0, + (_vES,), + ((VIDEO_EXTRACTION_STATUS, 1),), +) + +MEDIA_EXTRACTION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _MEC, + 0, + (_iEC, _aEC, _vEC), + ( + (IMAGE_EXTRACTION_CONFIGURATION, 0), + (AUDIO_EXTRACTION_CONFIGURATION, 0), + (VIDEO_EXTRACTION_CONFIGURATION, 0), + ), ) -KMS_KEY_ID = Schema( - id=ShapeID("com.amazonaws.qbusiness#KmsKeyId"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +SYNC_SCHEDULE: StaticSchema = (3, n0, _SS, 0) + +SECURITY_GROUP_ID: StaticSchema = (3, n0, _SGI, 0) + +SECURITY_GROUP_IDS: StaticSchema = (16, n0, _SGIe, 0, (_m,), ((SECURITY_GROUP_ID, 0),)) + +SUBNET_ID: StaticSchema = (3, n0, _SI, 0) + +SUBNET_IDS: StaticSchema = (16, n0, _SIu, 0, (_m,), ((SUBNET_ID, 0),)) + +DATA_SOURCE_VPC_CONFIGURATION: StaticSchema = ( + 18, + n0, + _DSVC, + 0, + (_sI, _sGI), + ((SUBNET_IDS, 1), (SECURITY_GROUP_IDS, 1)), +) + +CREATE_DATA_SOURCE_INPUT: StaticSchema = ( + 18, + n0, + _CDSI, + {_sSI: _cCDSR, _smit: None}, + (_aIp, _iI, _dN, _con, _vC, _d, _ta, _sS, _rA, _cT, _dEC, _mEC), + ( + (APPLICATION_ID, 9), + (INDEX_ID, 9), + (DATA_SOURCE_NAME, 1), + (DATA_SOURCE_CONFIGURATION, 1), + (DATA_SOURCE_VPC_CONFIGURATION, 0), + (DESCRIPTION, 0), + (TAGS, 0), + (SYNC_SCHEDULE, 0), + (ROLE_ARN, 0), + (CLIENT_TOKEN, 2), + (DOCUMENT_ENRICHMENT_CONFIGURATION, 0), + (MEDIA_EXTRACTION_CONFIGURATION, 0), + ), ) -ENCRYPTION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#EncryptionConfiguration"), - members={"kmsKeyId": {"target": KMS_KEY_ID}}, +DATA_SOURCE_ARN: StaticSchema = (3, n0, _DSA, 0) + +DATA_SOURCE_ID: StaticSchema = (3, n0, _DSI, 0) + +CREATE_DATA_SOURCE_OUTPUT: StaticSchema = ( + 18, + n0, + _CDSO, + {_sSI: _cCDSRo, _smith: None}, + (_dSI, _dSA), + ((DATA_SOURCE_ID, 0), (DATA_SOURCE_ARN, 0)), +) + +CREATE_DATA_SOURCE: StaticOperationSchema = ( + 23, + n0, + _CDS, + { + _smithy: MappingProxyType( + { + "uri": "/applications/{applicationId}/indices/{indexId}/datasources", + "method": "POST", + } + ) + }, + CREATE_DATA_SOURCE_INPUT, + CREATE_DATA_SOURCE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -IAM_IDENTITY_PROVIDER_ARN = Schema( - id=ShapeID("com.amazonaws.qbusiness#IAMIdentityProviderArn"), - shape_type=ShapeType.STRING, +DELETE_DATA_SOURCE_INPUT: StaticSchema = ( + 18, + n0, + _DDSI, + {_sSI: _cDDSR, _smit: None}, + (_aIp, _iI, _dSI), + ((APPLICATION_ID, 9), (INDEX_ID, 9), (DATA_SOURCE_ID, 9)), +) + +DELETE_DATA_SOURCE_OUTPUT: StaticSchema = (18, n0, _DDSO, {_sSI: _cDDSRo, _smith: None}) + +DELETE_DATA_SOURCE: StaticOperationSchema = ( + 23, + n0, + _DDS, + { + _smithy: MappingProxyType( + { + "uri": "/applications/{applicationId}/indices/{indexId}/datasources/{dataSourceId}", + "method": "DELETE", + } + ) + }, + DELETE_DATA_SOURCE_INPUT, + DELETE_DATA_SOURCE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -INSTANCE_ARN = Schema( - id=ShapeID("com.amazonaws.qbusiness#InstanceArn"), shape_type=ShapeType.STRING +GET_DATA_SOURCE_INPUT: StaticSchema = ( + 18, + n0, + _GDSI, + {_sSI: _cGDSR, _smit: None}, + (_aIp, _iI, _dSI), + ((APPLICATION_ID, 9), (INDEX_ID, 9), (DATA_SOURCE_ID, 9)), +) + +DATA_SOURCE_STATUS: StaticSchema = ( + 14, + n0, + _DSS, + 0, + (_PC_, _CREATING, _ACTIVE, _DELETING, _FAILED, _UPDATING), + ( + (-1, {_sV: _PC_}), + (-1, {_sV: _CREATING}), + (-1, {_sV: _ACTIVE}), + (-1, {_sV: _DELETING}), + (-1, {_sV: _FAILED}), + (-1, {_sV: _UPDATING}), + ), ) -PERSONALIZATION_CONTROL_MODE = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#PersonalizationControlMode"), - shape_type=ShapeType.ENUM, - members={"ENABLED": {"target": UNIT}, "DISABLED": {"target": UNIT}}, +GET_DATA_SOURCE_OUTPUT: StaticSchema = ( + 18, + n0, + _GDSO, + {_sSI: _cGDSRo, _smith: None}, + ( + _aIp, + _iI, + _dSI, + _dSA, + _dN, + _t, + _con, + _vC, + _cA, + _uA, + _d, + _st, + _sS, + _rA, + _e, + _dEC, + _mEC, + ), + ( + (APPLICATION_ID, 0), + (INDEX_ID, 0), + (DATA_SOURCE_ID, 0), + (DATA_SOURCE_ARN, 0), + (DATA_SOURCE_NAME, 0), + (STRING, 0), + (DATA_SOURCE_CONFIGURATION, 0), + (DATA_SOURCE_VPC_CONFIGURATION, 0), + (TIMESTAMP, 0), + (TIMESTAMP, 0), + (DESCRIPTION, 0), + (DATA_SOURCE_STATUS, 0), + (SYNC_SCHEDULE, 0), + (ROLE_ARN, 0), + (ERROR_DETAIL, 0), + (DOCUMENT_ENRICHMENT_CONFIGURATION, 0), + (MEDIA_EXTRACTION_CONFIGURATION, 0), + ), ) -PERSONALIZATION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#PersonalizationConfiguration"), - members={ - "personalizationControlMode": { - "target": PERSONALIZATION_CONTROL_MODE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +GET_DATA_SOURCE: StaticOperationSchema = ( + 23, + n0, + _GDS, + { + _smithy: MappingProxyType( + { + "uri": "/applications/{applicationId}/indices/{indexId}/datasources/{dataSourceId}", + "method": "GET", + } + ) + }, + GET_DATA_SOURCE_INPUT, + GET_DATA_SOURCE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -Q_APPS_CONTROL_MODE = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#QAppsControlMode"), - shape_type=ShapeType.ENUM, - members={"ENABLED": {"target": UNIT}, "DISABLED": {"target": UNIT}}, +MAX_RESULTS_INTEGER_FOR_LIST_DATA_SOURCES: StaticSchema = (7, n0, _MRIFLDS, 0) + +NEXT_TOKEN: StaticSchema = (3, n0, _NTe, 0) + +LIST_DATA_SOURCES_INPUT: StaticSchema = ( + 18, + n0, + _LDSI, + {_sSI: _cLDSR, _smit: None}, + (_aIp, _iI, _nT, _mRa), + ( + (APPLICATION_ID, 9), + (INDEX_ID, 9), + (NEXT_TOKEN, {_sQ: _nT}), + (MAX_RESULTS_INTEGER_FOR_LIST_DATA_SOURCES, {_sQ: _mRa}), + ), ) -Q_APPS_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#QAppsConfiguration"), - members={ - "qAppsControlMode": { - "target": Q_APPS_CONTROL_MODE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +DATA_SOURCE: StaticSchema = ( + 18, + n0, + _DS, + 0, + (_dN, _dSI, _t, _cA, _uA, _st), + ( + (DATA_SOURCE_NAME, 0), + (DATA_SOURCE_ID, 0), + (STRING, 0), + (TIMESTAMP, 0), + (TIMESTAMP, 0), + (DATA_SOURCE_STATUS, 0), + ), ) -ROLE_ARN = Schema( - id=ShapeID("com.amazonaws.qbusiness#RoleArn"), shape_type=ShapeType.STRING +DATA_SOURCES: StaticSchema = (16, n0, _DSa, 0, (_m,), ((DATA_SOURCE, 0),)) + +LIST_DATA_SOURCES_OUTPUT: StaticSchema = ( + 18, + n0, + _LDSO, + {_sSI: _cLDSRo, _smith: None}, + (_dS, _nT), + ((DATA_SOURCES, 0), (NEXT_TOKEN, 0)), +) + +LIST_DATA_SOURCES: StaticOperationSchema = ( + 23, + n0, + _LDS, + { + _smithy: MappingProxyType( + { + "uri": "/applications/{applicationId}/indices/{indexId}/datasources", + "method": "GET", + } + ) + }, + LIST_DATA_SOURCES_INPUT, + LIST_DATA_SOURCES_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -TAG_KEY = Schema( - id=ShapeID("com.amazonaws.qbusiness#TagKey"), shape_type=ShapeType.STRING +UPDATE_DATA_SOURCE_INPUT: StaticSchema = ( + 18, + n0, + _UDSI, + {_sSI: _cUDSR, _smit: None}, + (_aIp, _iI, _dSI, _dN, _con, _vC, _d, _sS, _rA, _dEC, _mEC), + ( + (APPLICATION_ID, 9), + (INDEX_ID, 9), + (DATA_SOURCE_ID, 9), + (DATA_SOURCE_NAME, 0), + (DATA_SOURCE_CONFIGURATION, 0), + (DATA_SOURCE_VPC_CONFIGURATION, 0), + (DESCRIPTION, 0), + (SYNC_SCHEDULE, 0), + (ROLE_ARN, 0), + (DOCUMENT_ENRICHMENT_CONFIGURATION, 0), + (MEDIA_EXTRACTION_CONFIGURATION, 0), + ), ) -TAG_VALUE = Schema( - id=ShapeID("com.amazonaws.qbusiness#TagValue"), shape_type=ShapeType.STRING +UPDATE_DATA_SOURCE_OUTPUT: StaticSchema = (18, n0, _UDSO, {_sSI: _cUDSRo, _smith: None}) + +UPDATE_DATA_SOURCE: StaticOperationSchema = ( + 23, + n0, + _UDS, + { + _smithy: MappingProxyType( + { + "uri": "/applications/{applicationId}/indices/{indexId}/datasources/{dataSourceId}", + "method": "PUT", + } + ) + }, + UPDATE_DATA_SOURCE_INPUT, + UPDATE_DATA_SOURCE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -TAG = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#Tag"), - members={ - "key": { - "target": TAG_KEY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "value": { - "target": TAG_VALUE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +DELETE_INDEX_INPUT: StaticSchema = ( + 18, + n0, + _DII, + {_sSI: _cDIR, _smit: None}, + (_aIp, _iI), + ((APPLICATION_ID, 9), (INDEX_ID, 9)), +) + +DELETE_INDEX_OUTPUT: StaticSchema = (18, n0, _DIO, {_sSI: _cDIRo, _smith: None}) + +DELETE_INDEX: StaticOperationSchema = ( + 23, + n0, + _DI, + { + _smithy: MappingProxyType( + { + "uri": "/applications/{applicationId}/indices/{indexId}", + "method": "DELETE", + } + ) + }, + DELETE_INDEX_INPUT, + DELETE_INDEX_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -TAGS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#Tags"), - shape_type=ShapeType.LIST, - members={"member": {"target": TAG}}, +GET_INDEX_INPUT: StaticSchema = ( + 18, + n0, + _GII, + {_sSI: _cGIR, _smit: None}, + (_aIp, _iI), + ((APPLICATION_ID, 9), (INDEX_ID, 9)), +) + +DOCUMENT_METADATA_CONFIGURATION_NAME: StaticSchema = (3, n0, _DMCN, 0) + +STATUS: StaticSchema = ( + 14, + n0, + _St, + 0, + (_ENABLED, _DISABLED), + ((-1, {_sV: _ENABLED}), (-1, {_sV: _DISABLED})), +) + +ATTRIBUTE_TYPE: StaticSchema = ( + 14, + n0, + _AT, + 0, + (_STRING, _SL, _NUMBER, _DATE), + ((-1, {_sV: _STRING}), (-1, {_sV: _SL}), (-1, {_sV: _NUMBER}), (-1, {_sV: _DATE})), +) + +DOCUMENT_ATTRIBUTE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _DACo, + 0, + (_n, _t, _sea), + ((DOCUMENT_METADATA_CONFIGURATION_NAME, 0), (ATTRIBUTE_TYPE, 0), (STATUS, 0)), +) + +DOCUMENT_ATTRIBUTE_CONFIGURATIONS: StaticSchema = ( + 16, + n0, + _DACoc, + 0, + (_m,), + ((DOCUMENT_ATTRIBUTE_CONFIGURATION, 0),), +) + +INDEXED_TEXT_BYTES: StaticSchema = (8, n0, _ITB, 0) + +INDEXED_TEXT_DOCUMENT: StaticSchema = (7, n0, _ITD, 0) + +TEXT_DOCUMENT_STATISTICS: StaticSchema = ( + 18, + n0, + _TDS, + 0, + (_iTB, _iTDC), + ((INDEXED_TEXT_BYTES, 0), (INDEXED_TEXT_DOCUMENT, 0)), +) + +INDEX_STATISTICS: StaticSchema = ( + 18, + n0, + _IS, + 0, + (_tDS,), + ((TEXT_DOCUMENT_STATISTICS, 0),), +) + +INDEX_STATUS: StaticSchema = ( + 14, + n0, + _ISn, + 0, + (_CREATING, _ACTIVE, _DELETING, _FAILED, _UPDATING), + ( + (-1, {_sV: _CREATING}), + (-1, {_sV: _ACTIVE}), + (-1, {_sV: _DELETING}), + (-1, {_sV: _FAILED}), + (-1, {_sV: _UPDATING}), + ), ) -CREATE_APPLICATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#CreateApplicationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#CreateApplicationRequest", - ) - ], - members={ - "displayName": { - "target": APPLICATION_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "roleArn": {"target": ROLE_ARN}, - "identityType": {"target": IDENTITY_TYPE}, - "iamIdentityProviderArn": {"target": IAM_IDENTITY_PROVIDER_ARN}, - "identityCenterInstanceArn": {"target": INSTANCE_ARN}, - "clientIdsForOIDC": {"target": CLIENT_IDS_FOR_OIDC}, - "description": {"target": DESCRIPTION}, - "encryptionConfiguration": {"target": ENCRYPTION_CONFIGURATION}, - "tags": {"target": TAGS}, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "attachmentsConfiguration": {"target": ATTACHMENTS_CONFIGURATION}, - "qAppsConfiguration": {"target": Q_APPS_CONFIGURATION}, - "personalizationConfiguration": {"target": PERSONALIZATION_CONFIGURATION}, - "quickSightConfiguration": {"target": QUICK_SIGHT_CONFIGURATION}, - }, +GET_INDEX_OUTPUT: StaticSchema = ( + 18, + n0, + _GIO, + {_sSI: _cGIRo, _smith: None}, + (_aIp, _iI, _dN, _iA, _st, _t, _d, _cA, _uA, _cC, _dAC, _e, _iS), + ( + (APPLICATION_ID, 0), + (INDEX_ID, 0), + (INDEX_NAME, 0), + (INDEX_ARN, 0), + (INDEX_STATUS, 0), + (INDEX_TYPE, 0), + (DESCRIPTION, 0), + (TIMESTAMP, 0), + (TIMESTAMP, 0), + (INDEX_CAPACITY_CONFIGURATION, 0), + (DOCUMENT_ATTRIBUTE_CONFIGURATIONS, 0), + (ERROR_DETAIL, 0), + (INDEX_STATISTICS, 0), + ), ) -CREATE_APPLICATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#CreateApplicationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#CreateApplicationResponse", +GET_INDEX: StaticOperationSchema = ( + 23, + n0, + _GI, + { + _smithy: MappingProxyType( + {"uri": "/applications/{applicationId}/indices/{indexId}", "method": "GET"} ) - ], - members={ - "applicationId": {"target": APPLICATION_ID}, - "applicationArn": {"target": APPLICATION_ARN}, }, + GET_INDEX_INPUT, + GET_INDEX_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -INTERNAL_SERVER_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#InternalServerException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="server"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=500), - ], - members={ - "message": { - "target": ERROR_MESSAGE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +MAX_RESULTS_INTEGER_FOR_LIST_INDICES: StaticSchema = (7, n0, _MRIFLI, 0) -RESOURCE_NOT_FOUND_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=404), - ], - members={ - "message": { - "target": ERROR_MESSAGE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "resourceId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "resourceType": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +LIST_INDICES_INPUT: StaticSchema = ( + 18, + n0, + _LII, + {_sSI: _cLIR, _smit: None}, + (_aIp, _nT, _mRa), + ( + (APPLICATION_ID, 9), + (NEXT_TOKEN, {_sQ: _nT}), + (MAX_RESULTS_INTEGER_FOR_LIST_INDICES, {_sQ: _mRa}), + ), ) -SERVICE_QUOTA_EXCEEDED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ServiceQuotaExceededException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=402), - ], - members={ - "message": { - "target": ERROR_MESSAGE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "resourceId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "resourceType": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +INDEX: StaticSchema = ( + 18, + n0, + _In, + 0, + (_dN, _iI, _cA, _uA, _st), + ((INDEX_NAME, 0), (INDEX_ID, 0), (TIMESTAMP, 0), (TIMESTAMP, 0), (INDEX_STATUS, 0)), ) -THROTTLING_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ThrottlingException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=429), - ], - members={ - "message": { - "target": ERROR_MESSAGE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +INDICES: StaticSchema = (16, n0, _Ind, 0, (_m,), ((INDEX, 0),)) + +LIST_INDICES_OUTPUT: StaticSchema = ( + 18, + n0, + _LIO, + {_sSI: _cLIRo, _smith: None}, + (_nT, _in), + ((NEXT_TOKEN, 0), (INDICES, 0)), ) -VALIDATION_EXCEPTION_FIELD = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ValidationExceptionField"), - members={ - "name": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "message": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, +LIST_INDICES: StaticOperationSchema = ( + 23, + n0, + _LI, + { + _smithy: MappingProxyType( + {"uri": "/applications/{applicationId}/indices", "method": "GET"} + ) }, + LIST_INDICES_INPUT, + LIST_INDICES_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -VALIDATION_EXCEPTION_FIELDS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ValidationExceptionFields"), - shape_type=ShapeType.LIST, - members={"member": {"target": VALIDATION_EXCEPTION_FIELD}}, +UPDATE_INDEX_INPUT: StaticSchema = ( + 18, + n0, + _UII, + {_sSI: _cUIR, _smit: None}, + (_aIp, _iI, _dN, _d, _cC, _dAC), + ( + (APPLICATION_ID, 9), + (INDEX_ID, 9), + (APPLICATION_NAME, 0), + (DESCRIPTION, 0), + (INDEX_CAPACITY_CONFIGURATION, 0), + (DOCUMENT_ATTRIBUTE_CONFIGURATIONS, 0), + ), ) -VALIDATION_EXCEPTION_REASON = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ValidationExceptionReason"), - shape_type=ShapeType.ENUM, - members={ - "CANNOT_PARSE": {"target": UNIT}, - "FIELD_VALIDATION_FAILED": {"target": UNIT}, - "UNKNOWN_OPERATION": {"target": UNIT}, - }, -) +UPDATE_INDEX_OUTPUT: StaticSchema = (18, n0, _UIO, {_sSI: _cUIRo, _smith: None}) -VALIDATION_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ValidationException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={ - "message": { - "target": ERROR_MESSAGE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "reason": { - "target": VALIDATION_EXCEPTION_REASON, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "fields": {"target": VALIDATION_EXCEPTION_FIELDS}, +UPDATE_INDEX: StaticOperationSchema = ( + 23, + n0, + _UIp, + { + _smithy: MappingProxyType( + {"uri": "/applications/{applicationId}/indices/{indexId}", "method": "PUT"} + ) }, + UPDATE_INDEX_INPUT, + UPDATE_INDEX_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CREATE_APPLICATION = Schema( - id=ShapeID("com.amazonaws.qbusiness#CreateApplication"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType({"uri": "/applications", "method": "POST"}), - ) - ], -) +INTEGRATION_ID: StaticSchema = (3, n0, _IIn, 0) -IDC_TRUSTED_TOKEN_ISSUER_ARN = Schema( - id=ShapeID("com.amazonaws.qbusiness#IdcTrustedTokenIssuerArn"), - shape_type=ShapeType.STRING, -) +MAX_RESULTS_INTEGER_FOR_LIST_APPLICATIONS: StaticSchema = (7, n0, _MRIFLA, 0) -DATA_ACCESSOR_IDC_TRUSTED_TOKEN_ISSUER_CONFIGURATION = Schema.collection( - id=ShapeID( - "com.amazonaws.qbusiness#DataAccessorIdcTrustedTokenIssuerConfiguration" +LIST_APPLICATIONS_INPUT: StaticSchema = ( + 18, + n0, + _LAI, + {_sSI: _cLAR, _smit: None}, + (_nT, _mRa), + ( + (NEXT_TOKEN, {_sQ: _nT}), + (MAX_RESULTS_INTEGER_FOR_LIST_APPLICATIONS, {_sQ: _mRa}), ), - members={ - "idcTrustedTokenIssuerArn": { - "target": IDC_TRUSTED_TOKEN_ISSUER_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, ) -DATA_ACCESSOR_AUTHENTICATION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DataAccessorAuthenticationConfiguration"), - shape_type=ShapeType.UNION, - members={ - "idcTrustedTokenIssuerConfiguration": { - "target": DATA_ACCESSOR_IDC_TRUSTED_TOKEN_ISSUER_CONFIGURATION - } - }, +APPLICATIONS: StaticSchema = (16, n0, _App, 0, (_m,), ((APPLICATION, 0),)) + +LIST_APPLICATIONS_OUTPUT: StaticSchema = ( + 18, + n0, + _LAO, + {_sSI: _cLARo, _smith: None}, + (_nT, _ap), + ((NEXT_TOKEN, 0), (APPLICATIONS, 0)), +) + +LIST_APPLICATIONS: StaticOperationSchema = ( + 23, + n0, + _LAi, + {_smithy: MappingProxyType({"uri": "/applications", "method": "GET"})}, + LIST_APPLICATIONS_INPUT, + LIST_APPLICATIONS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -DATA_ACCESSOR_AUTHENTICATION_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DataAccessorAuthenticationType"), - shape_type=ShapeType.ENUM, - members={ - "AWS_IAM_IDC_TTI": {"target": UNIT}, - "AWS_IAM_IDC_AUTH_CODE": {"target": UNIT}, - }, -) +SECRET_ARN: StaticSchema = (3, n0, _SA, 0) -DATA_ACCESSOR_EXTERNAL_ID = Schema( - id=ShapeID("com.amazonaws.qbusiness#DataAccessorExternalId"), - shape_type=ShapeType.STRING, +BASIC_AUTH_CONFIGURATION: StaticSchema = ( + 18, + n0, + _BAC, + 0, + (_sA, _rA), + ((SECRET_ARN, 1), (ROLE_ARN, 1)), ) -DATA_ACCESSOR_EXTERNAL_IDS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DataAccessorExternalIds"), - shape_type=ShapeType.LIST, - members={"member": {"target": DATA_ACCESSOR_EXTERNAL_ID}}, +IDC_AUTH_CONFIGURATION: StaticSchema = ( + 18, + n0, + _IAC, + 0, + (_iAA, _rA), + ((IDC_APPLICATION_ARN, 1), (ROLE_ARN, 1)), ) -DATA_ACCESSOR_AUTHENTICATION_DETAIL = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DataAccessorAuthenticationDetail"), - members={ - "authenticationType": { - "target": DATA_ACCESSOR_AUTHENTICATION_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "authenticationConfiguration": { - "target": DATA_ACCESSOR_AUTHENTICATION_CONFIGURATION - }, - "externalIds": {"target": DATA_ACCESSOR_EXTERNAL_IDS}, - }, +NO_AUTH_CONFIGURATION: StaticSchema = (18, n0, _NAC, 0) + +URL: StaticSchema = (3, n0, _U, 0) + +O_AUTH2_CLIENT_CREDENTIAL_CONFIGURATION: StaticSchema = ( + 18, + n0, + _OACCC, + 0, + (_sA, _rA, _aU, _tU), + ((SECRET_ARN, 1), (ROLE_ARN, 1), (URL, 0), (URL, 0)), ) -DATA_ACCESSOR_NAME = Schema( - id=ShapeID("com.amazonaws.qbusiness#DataAccessorName"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], +PLUGIN_AUTH_CONFIGURATION: StaticSchema = ( + 19, + n0, + _PAC, + 0, + (_bAC, _oACCC, _nAC, _iAC), + ( + (BASIC_AUTH_CONFIGURATION, 0), + (O_AUTH2_CLIENT_CREDENTIAL_CONFIGURATION, 0), + (NO_AUTH_CONFIGURATION, 0), + (IDC_AUTH_CONFIGURATION, 0), + ), ) -PRINCIPAL_ROLE_ARN = Schema( - id=ShapeID("com.amazonaws.qbusiness#PrincipalRoleArn"), shape_type=ShapeType.STRING +PLUGIN_DESCRIPTION: StaticSchema = (3, n0, _PD, 0) + +CUSTOM_PLUGIN_CONFIGURATION: StaticSchema = ( + 18, + n0, + _CPC, + 0, + (_d, _aST, _aSp), + ((PLUGIN_DESCRIPTION, 1), (API_SCHEMA_TYPE, 1), (API_SCHEMA, 0)), +) + +PLUGIN_NAME: StaticSchema = (3, n0, _PN, 0) + +CREATE_PLUGIN_INPUT: StaticSchema = ( + 18, + n0, + _CPI, + {_sSI: _cCPR, _smit: None}, + (_aIp, _dN, _t, _aCut, _sU, _cPC, _ta, _cT), + ( + (APPLICATION_ID, 9), + (PLUGIN_NAME, 1), + (PLUGIN_TYPE, 1), + (PLUGIN_AUTH_CONFIGURATION, 1), + (URL, 0), + (CUSTOM_PLUGIN_CONFIGURATION, 0), + (TAGS, 0), + (CLIENT_TOKEN, 2), + ), ) -DATA_ACCESSOR_ARN = Schema( - id=ShapeID("com.amazonaws.qbusiness#DataAccessorArn"), shape_type=ShapeType.STRING +PLUGIN_BUILD_STATUS: StaticSchema = ( + 14, + n0, + _PBS, + 0, + (_READY, _CIP, _CF, _UIP, _UF, _DIP, _DF), + ( + (-1, {_sV: _READY}), + (-1, {_sV: _CIP}), + (-1, {_sV: _CF}), + (-1, {_sV: _UIP}), + (-1, {_sV: _UF}), + (-1, {_sV: _DIP}), + (-1, {_sV: _DF}), + ), ) -DATA_ACCESSOR_ID = Schema( - id=ShapeID("com.amazonaws.qbusiness#DataAccessorId"), shape_type=ShapeType.STRING +PLUGIN_ARN: StaticSchema = (3, n0, _PAl, 0) + +CREATE_PLUGIN_OUTPUT: StaticSchema = ( + 18, + n0, + _CPO, + {_sSI: _cCPRo, _smith: None}, + (_pI, _pA, _bS), + ((PLUGIN_ID, 0), (PLUGIN_ARN, 0), (PLUGIN_BUILD_STATUS, 0)), +) + +CREATE_PLUGIN: StaticOperationSchema = ( + 23, + n0, + _CPr, + { + _smithy: MappingProxyType( + {"method": "POST", "uri": "/applications/{applicationId}/plugins"} + ) + }, + CREATE_PLUGIN_INPUT, + CREATE_PLUGIN_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -IDC_APPLICATION_ARN = Schema( - id=ShapeID("com.amazonaws.qbusiness#IdcApplicationArn"), shape_type=ShapeType.STRING +DELETE_PLUGIN_INPUT: StaticSchema = ( + 18, + n0, + _DPI, + {_sSI: _cDPR, _smit: None}, + (_aIp, _pI), + ((APPLICATION_ID, 9), (PLUGIN_ID, 9)), +) + +DELETE_PLUGIN_OUTPUT: StaticSchema = (18, n0, _DPO, {_sSI: _cDPRo, _smith: None}) + +DELETE_PLUGIN: StaticOperationSchema = ( + 23, + n0, + _DP, + { + _smithy: MappingProxyType( + { + "method": "DELETE", + "uri": "/applications/{applicationId}/plugins/{pluginId}", + } + ) + }, + DELETE_PLUGIN_INPUT, + DELETE_PLUGIN_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CREATE_DATA_ACCESSOR_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#CreateDataAccessorOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#CreateDataAccessorResponse", - ) - ], - members={ - "dataAccessorId": { - "target": DATA_ACCESSOR_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "idcApplicationArn": { - "target": IDC_APPLICATION_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "dataAccessorArn": { - "target": DATA_ACCESSOR_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +GET_PLUGIN_INPUT: StaticSchema = ( + 18, + n0, + _GPI, + {_sSI: _cGPR, _smit: None}, + (_aIp, _pI), + ((APPLICATION_ID, 9), (PLUGIN_ID, 9)), +) + +PLUGIN_STATE: StaticSchema = ( + 14, + n0, + _PS, + 0, + (_ENABLED, _DISABLED), + ((-1, {_sV: _ENABLED}), (-1, {_sV: _DISABLED})), +) + +GET_PLUGIN_OUTPUT: StaticSchema = ( + 18, + n0, + _GPO, + {_sSI: _cGPRo, _smith: None}, + (_aIp, _pI, _dN, _t, _sU, _aCut, _cPC, _bS, _pA, _sta, _cA, _uA), + ( + (APPLICATION_ID, 0), + (PLUGIN_ID, 0), + (PLUGIN_NAME, 0), + (PLUGIN_TYPE, 0), + (URL, 0), + (PLUGIN_AUTH_CONFIGURATION, 0), + (CUSTOM_PLUGIN_CONFIGURATION, 0), + (PLUGIN_BUILD_STATUS, 0), + (PLUGIN_ARN, 0), + (PLUGIN_STATE, 0), + (TIMESTAMP, 0), + (TIMESTAMP, 0), + ), ) -DELETE_DATA_ACCESSOR_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DeleteDataAccessorInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#DeleteDataAccessorRequest", +GET_PLUGIN: StaticOperationSchema = ( + 23, + n0, + _GP, + { + _smithy: MappingProxyType( + {"method": "GET", "uri": "/applications/{applicationId}/plugins/{pluginId}"} ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "dataAccessorId": { - "target": DATA_ACCESSOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, }, + GET_PLUGIN_INPUT, + GET_PLUGIN_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -DELETE_DATA_ACCESSOR_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DeleteDataAccessorOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#DeleteDataAccessorResponse", - ) - ], -) - -DELETE_DATA_ACCESSOR = Schema( - id=ShapeID("com.amazonaws.qbusiness#DeleteDataAccessor"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "uri": "/applications/{applicationId}/dataaccessors/{dataAccessorId}", - "method": "DELETE", - } - ), - ) - ], -) +MAX_RESULTS_INTEGER_FOR_LIST_PLUGINS: StaticSchema = (7, n0, _MRIFLP, 0) -GET_DATA_ACCESSOR_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#GetDataAccessorInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#GetDataAccessorRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "dataAccessorId": { - "target": DATA_ACCESSOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, +LIST_PLUGINS_INPUT: StaticSchema = ( + 18, + n0, + _LPI, + {_sSI: _cLPR, _smit: None}, + (_aIp, _nT, _mRa), + ( + (APPLICATION_ID, 9), + (NEXT_TOKEN, {_sQ: _nT}), + (MAX_RESULTS_INTEGER_FOR_LIST_PLUGINS, {_sQ: _mRa}), + ), ) -MAX_RESULTS_INTEGER_FOR_LIST_DATA_ACCESSORS = Schema( - id=ShapeID("com.amazonaws.qbusiness#MaxResultsIntegerForListDataAccessors"), - shape_type=ShapeType.INTEGER, +PLUGIN: StaticSchema = ( + 18, + n0, + _Pl, + 0, + (_pI, _dN, _t, _sU, _sta, _bS, _cA, _uA), + ( + (PLUGIN_ID, 0), + (PLUGIN_NAME, 0), + (PLUGIN_TYPE, 0), + (URL, 0), + (PLUGIN_STATE, 0), + (PLUGIN_BUILD_STATUS, 0), + (TIMESTAMP, 0), + (TIMESTAMP, 0), + ), ) -NEXT_TOKEN1500 = Schema( - id=ShapeID("com.amazonaws.qbusiness#NextToken1500"), shape_type=ShapeType.STRING +PLUGINS: StaticSchema = (16, n0, _Plu, 0, (_m,), ((PLUGIN, 0),)) + +LIST_PLUGINS_OUTPUT: StaticSchema = ( + 18, + n0, + _LPO, + {_sSI: _cLPRo, _smith: None}, + (_nT, _pl), + ((NEXT_TOKEN, 0), (PLUGINS, 0)), ) -LIST_DATA_ACCESSORS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ListDataAccessorsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#ListDataAccessorsRequest", +LIST_PLUGINS: StaticOperationSchema = ( + 23, + n0, + _LP, + { + _smithy: MappingProxyType( + {"method": "GET", "uri": "/applications/{applicationId}/plugins"} ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "nextToken": { - "target": NEXT_TOKEN1500, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "maxResults": { - "target": MAX_RESULTS_INTEGER_FOR_LIST_DATA_ACCESSORS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, }, + LIST_PLUGINS_INPUT, + LIST_PLUGINS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -DATA_ACCESSOR = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DataAccessor"), - members={ - "displayName": {"target": DATA_ACCESSOR_NAME}, - "dataAccessorId": {"target": DATA_ACCESSOR_ID}, - "dataAccessorArn": {"target": DATA_ACCESSOR_ARN}, - "idcApplicationArn": {"target": IDC_APPLICATION_ARN}, - "principal": {"target": PRINCIPAL_ROLE_ARN}, - "authenticationDetail": {"target": DATA_ACCESSOR_AUTHENTICATION_DETAIL}, - "createdAt": {"target": TIMESTAMP}, - "updatedAt": {"target": TIMESTAMP}, - }, +UPDATE_PLUGIN_INPUT: StaticSchema = ( + 18, + n0, + _UPI, + {_sSI: _cUPR, _smit: None}, + (_aIp, _pI, _dN, _sta, _sU, _cPC, _aCut), + ( + (APPLICATION_ID, 9), + (PLUGIN_ID, 9), + (PLUGIN_NAME, 0), + (PLUGIN_STATE, 0), + (URL, 0), + (CUSTOM_PLUGIN_CONFIGURATION, 0), + (PLUGIN_AUTH_CONFIGURATION, 0), + ), ) -DATA_ACCESSORS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DataAccessors"), - shape_type=ShapeType.LIST, - members={"member": {"target": DATA_ACCESSOR}}, -) +UPDATE_PLUGIN_OUTPUT: StaticSchema = (18, n0, _UPO, {_sSI: _cUPRo, _smith: None}) -LIST_DATA_ACCESSORS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ListDataAccessorsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#ListDataAccessorsResponse", +UPDATE_PLUGIN: StaticOperationSchema = ( + 23, + n0, + _UP, + { + _smithy: MappingProxyType( + {"method": "PUT", "uri": "/applications/{applicationId}/plugins/{pluginId}"} ) - ], - members={ - "dataAccessors": {"target": DATA_ACCESSORS}, - "nextToken": {"target": NEXT_TOKEN1500}, }, + UPDATE_PLUGIN_INPUT, + UPDATE_PLUGIN_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -LIST_DATA_ACCESSORS = Schema( - id=ShapeID("com.amazonaws.qbusiness#ListDataAccessors"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"uri": "/applications/{applicationId}/dataaccessors", "method": "GET"} - ), - ) - ], +KENDRA_INDEX_ID: StaticSchema = (3, n0, _KII, 0) + +KENDRA_INDEX_CONFIGURATION: StaticSchema = ( + 18, + n0, + _KIC, + 0, + (_iI,), + ((KENDRA_INDEX_ID, 1),), +) + +BOOSTING_DURATION_IN_SECONDS: StaticSchema = (8, n0, _BDIS, 0) + +DOCUMENT_ATTRIBUTE_BOOSTING_LEVEL: StaticSchema = ( + 14, + n0, + _DABL, + 0, + (_NONE, _LOW, _MEDIUM, _HIGH, _VH, _ONE, _TWO), + ( + (-1, {_sV: _NONE}), + (-1, {_sV: _LOW}), + (-1, {_sV: _MEDIUM}), + (-1, {_sV: _HIGH}), + (-1, {_sV: _VH}), + (-1, {_sV: _ONE}), + (-1, {_sV: _TWO}), + ), ) -UPDATE_DATA_ACCESSOR_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#UpdateDataAccessorOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#UpdateDataAccessorResponse", - ) - ], +DATE_ATTRIBUTE_BOOSTING_CONFIGURATION: StaticSchema = ( + 18, + n0, + _DABC, + 0, + (_bL, _bDIS), + ((DOCUMENT_ATTRIBUTE_BOOSTING_LEVEL, 1), (BOOSTING_DURATION_IN_SECONDS, 0)), +) + +NUMBER_ATTRIBUTE_BOOSTING_TYPE: StaticSchema = ( + 14, + n0, + _NABT, + 0, + (_PLV, _PSV), + ((-1, {_sV: _PLV}), (-1, {_sV: _PSV})), +) + +NUMBER_ATTRIBUTE_BOOSTING_CONFIGURATION: StaticSchema = ( + 18, + n0, + _NABC, + 0, + (_bL, _bT), + ((DOCUMENT_ATTRIBUTE_BOOSTING_LEVEL, 1), (NUMBER_ATTRIBUTE_BOOSTING_TYPE, 0)), +) + +STRING_ATTRIBUTE_VALUE_BOOSTING_LEVEL: StaticSchema = ( + 14, + n0, + _SAVBL, + 0, + (_LOW, _MEDIUM, _HIGH, _VH, _ONE, _TWO, _THREE, _FOUR, _FIVE), + ( + (-1, {_sV: _LOW}), + (-1, {_sV: _MEDIUM}), + (-1, {_sV: _HIGH}), + (-1, {_sV: _VH}), + (-1, {_sV: _ONE}), + (-1, {_sV: _TWO}), + (-1, {_sV: _THREE}), + (-1, {_sV: _FOUR}), + (-1, {_sV: _FIVE}), + ), ) -DELETE_APPLICATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DeleteApplicationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#DeleteApplicationRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, +STRING_ATTRIBUTE_VALUE_BOOSTING: StaticSchema = ( + 17, + n0, + _SAVB, + 0, + (_k, _v), + ((STRING, 0), (STRING_ATTRIBUTE_VALUE_BOOSTING_LEVEL, 0)), +) + +STRING_ATTRIBUTE_BOOSTING_CONFIGURATION: StaticSchema = ( + 18, + n0, + _SABC, + 0, + (_bL, _aVB), + ((DOCUMENT_ATTRIBUTE_BOOSTING_LEVEL, 1), (STRING_ATTRIBUTE_VALUE_BOOSTING, 0)), +) + +STRING_LIST_ATTRIBUTE_BOOSTING_CONFIGURATION: StaticSchema = ( + 18, + n0, + _SLABC, + 0, + (_bL,), + ((DOCUMENT_ATTRIBUTE_BOOSTING_LEVEL, 1),), +) + +DOCUMENT_ATTRIBUTE_BOOSTING_CONFIGURATION: StaticSchema = ( + 19, + n0, + _DABCo, + 0, + (_nC, _sC, _dC, _sLC), + ( + (NUMBER_ATTRIBUTE_BOOSTING_CONFIGURATION, 0), + (STRING_ATTRIBUTE_BOOSTING_CONFIGURATION, 0), + (DATE_ATTRIBUTE_BOOSTING_CONFIGURATION, 0), + (STRING_LIST_ATTRIBUTE_BOOSTING_CONFIGURATION, 0), + ), ) -DELETE_APPLICATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DeleteApplicationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#DeleteApplicationResponse", - ) - ], -) - -DELETE_APPLICATION = Schema( - id=ShapeID("com.amazonaws.qbusiness#DeleteApplication"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"uri": "/applications/{applicationId}", "method": "DELETE"} - ), - ) - ], +DOCUMENT_ATTRIBUTE_BOOSTING_OVERRIDE_MAP: StaticSchema = ( + 17, + n0, + _DABOM, + 0, + (_k, _v), + ((DOCUMENT_ATTRIBUTE_KEY, 0), (DOCUMENT_ATTRIBUTE_BOOSTING_CONFIGURATION, 0)), +) + +NATIVE_INDEX_CONFIGURATION: StaticSchema = ( + 18, + n0, + _NIC, + 0, + (_iI, _ve, _bO), + ((INDEX_ID, 1), (LONG, 0), (DOCUMENT_ATTRIBUTE_BOOSTING_OVERRIDE_MAP, 0)), +) + +RETRIEVER_CONFIGURATION: StaticSchema = ( + 19, + n0, + _RC, + 0, + (_nIC, _kIC), + ((NATIVE_INDEX_CONFIGURATION, 0), (KENDRA_INDEX_CONFIGURATION, 0)), +) + +RETRIEVER_NAME: StaticSchema = (3, n0, _RN, 0) + +RETRIEVER_TYPE: StaticSchema = ( + 14, + n0, + _RT, + 0, + (_NI, _KI), + ((-1, {_sV: _NI}), (-1, {_sV: _KI})), +) + +CREATE_RETRIEVER_INPUT: StaticSchema = ( + 18, + n0, + _CRI, + {_sSI: _cCRR, _smit: None}, + (_aIp, _t, _dN, _con, _rA, _cT, _ta), + ( + (APPLICATION_ID, 9), + (RETRIEVER_TYPE, 1), + (RETRIEVER_NAME, 1), + (RETRIEVER_CONFIGURATION, 1), + (ROLE_ARN, 0), + (CLIENT_TOKEN, 2), + (TAGS, 0), + ), +) + +RETRIEVER_ARN: StaticSchema = (3, n0, _RAe, 0) + +RETRIEVER_ID: StaticSchema = (3, n0, _RIet, 0) + +CREATE_RETRIEVER_OUTPUT: StaticSchema = ( + 18, + n0, + _CRO, + {_sSI: _cCRRo, _smith: None}, + (_rIe, _rAe), + ((RETRIEVER_ID, 0), (RETRIEVER_ARN, 0)), ) -GET_APPLICATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#GetApplicationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#GetApplicationRequest", +CREATE_RETRIEVER: StaticOperationSchema = ( + 23, + n0, + _CR, + { + _smithy: MappingProxyType( + {"method": "POST", "uri": "/applications/{applicationId}/retrievers"} ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } }, + CREATE_RETRIEVER_INPUT, + CREATE_RETRIEVER_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -APPLIED_ATTACHMENTS_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#AppliedAttachmentsConfiguration"), - members={"attachmentsControlMode": {"target": ATTACHMENTS_CONTROL_MODE}}, +DELETE_RETRIEVER_INPUT: StaticSchema = ( + 18, + n0, + _DRI, + {_sSI: _cDRR, _smit: None}, + (_aIp, _rIe), + ((APPLICATION_ID, 9), (RETRIEVER_ID, 9)), +) + +DELETE_RETRIEVER_OUTPUT: StaticSchema = (18, n0, _DRO, {_sSI: _cDRRo, _smith: None}) + +DELETE_RETRIEVER: StaticOperationSchema = ( + 23, + n0, + _DR, + { + _smithy: MappingProxyType( + { + "method": "DELETE", + "uri": "/applications/{applicationId}/retrievers/{retrieverId}", + } + ) + }, + DELETE_RETRIEVER_INPUT, + DELETE_RETRIEVER_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AUTO_SUBSCRIPTION_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#AutoSubscriptionStatus"), - shape_type=ShapeType.ENUM, - members={"ENABLED": {"target": UNIT}, "DISABLED": {"target": UNIT}}, +GET_RETRIEVER_INPUT: StaticSchema = ( + 18, + n0, + _GRI, + {_sSI: _cGRR, _smit: None}, + (_aIp, _rIe), + ((APPLICATION_ID, 9), (RETRIEVER_ID, 9)), +) + +RETRIEVER_STATUS: StaticSchema = ( + 14, + n0, + _RS, + 0, + (_CREATING, _ACTIVE, _FAILED), + ((-1, {_sV: _CREATING}), (-1, {_sV: _ACTIVE}), (-1, {_sV: _FAILED})), +) + +GET_RETRIEVER_OUTPUT: StaticSchema = ( + 18, + n0, + _GRO, + {_sSI: _cGRRo, _smith: None}, + (_aIp, _rIe, _rAe, _t, _st, _dN, _con, _rA, _cA, _uA), + ( + (APPLICATION_ID, 0), + (RETRIEVER_ID, 0), + (RETRIEVER_ARN, 0), + (RETRIEVER_TYPE, 0), + (RETRIEVER_STATUS, 0), + (RETRIEVER_NAME, 0), + (RETRIEVER_CONFIGURATION, 0), + (ROLE_ARN, 0), + (TIMESTAMP, 0), + (TIMESTAMP, 0), + ), ) -SUBSCRIPTION_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#SubscriptionType"), - shape_type=ShapeType.ENUM, - members={"Q_LITE": {"target": UNIT}, "Q_BUSINESS": {"target": UNIT}}, +GET_RETRIEVER: StaticOperationSchema = ( + 23, + n0, + _GR, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/applications/{applicationId}/retrievers/{retrieverId}", + } + ) + }, + GET_RETRIEVER_INPUT, + GET_RETRIEVER_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -AUTO_SUBSCRIPTION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#AutoSubscriptionConfiguration"), - members={ - "autoSubscribe": { - "target": AUTO_SUBSCRIPTION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "defaultSubscriptionType": {"target": SUBSCRIPTION_TYPE}, - }, -) +MAX_RESULTS_INTEGER_FOR_LIST_RETRIEVERS_REQUEST: StaticSchema = (7, n0, _MRIFLRR, 0) -ERROR_CODE = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ErrorCode"), - shape_type=ShapeType.ENUM, - members={ - "INTERNAL_ERROR": {"target": UNIT}, - "INVALID_REQUEST": {"target": UNIT}, - "RESOURCE_INACTIVE": {"target": UNIT}, - "RESOURCE_NOT_FOUND": {"target": UNIT}, - }, +LIST_RETRIEVERS_INPUT: StaticSchema = ( + 18, + n0, + _LRI, + {_sSI: _cLRR, _smit: None}, + (_aIp, _nT, _mRa), + ( + (APPLICATION_ID, 9), + (NEXT_TOKEN, {_sQ: _nT}), + (MAX_RESULTS_INTEGER_FOR_LIST_RETRIEVERS_REQUEST, {_sQ: _mRa}), + ), ) -ERROR_DETAIL = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ErrorDetail"), - members={ - "errorMessage": {"target": ERROR_MESSAGE}, - "errorCode": {"target": ERROR_CODE}, - }, +RETRIEVER: StaticSchema = ( + 18, + n0, + _R, + 0, + (_aIp, _rIe, _t, _st, _dN), + ( + (APPLICATION_ID, 0), + (RETRIEVER_ID, 0), + (RETRIEVER_TYPE, 0), + (RETRIEVER_STATUS, 0), + (RETRIEVER_NAME, 0), + ), ) -GET_APPLICATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#GetApplicationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#GetApplicationResponse", - ) - ], - members={ - "displayName": {"target": APPLICATION_NAME}, - "applicationId": {"target": APPLICATION_ID}, - "applicationArn": {"target": APPLICATION_ARN}, - "identityType": {"target": IDENTITY_TYPE}, - "iamIdentityProviderArn": {"target": IAM_IDENTITY_PROVIDER_ARN}, - "identityCenterApplicationArn": {"target": IDC_APPLICATION_ARN}, - "roleArn": {"target": ROLE_ARN}, - "status": {"target": APPLICATION_STATUS}, - "description": {"target": DESCRIPTION}, - "encryptionConfiguration": {"target": ENCRYPTION_CONFIGURATION}, - "createdAt": {"target": TIMESTAMP}, - "updatedAt": {"target": TIMESTAMP}, - "error": {"target": ERROR_DETAIL}, - "attachmentsConfiguration": {"target": APPLIED_ATTACHMENTS_CONFIGURATION}, - "qAppsConfiguration": {"target": Q_APPS_CONFIGURATION}, - "personalizationConfiguration": {"target": PERSONALIZATION_CONFIGURATION}, - "autoSubscriptionConfiguration": {"target": AUTO_SUBSCRIPTION_CONFIGURATION}, - "clientIdsForOIDC": {"target": CLIENT_IDS_FOR_OIDC}, - "quickSightConfiguration": {"target": QUICK_SIGHT_CONFIGURATION}, - }, +RETRIEVERS: StaticSchema = (16, n0, _Re, 0, (_m,), ((RETRIEVER, 0),)) + +LIST_RETRIEVERS_OUTPUT: StaticSchema = ( + 18, + n0, + _LRO, + {_sSI: _cLRRo, _smith: None}, + (_ret, _nT), + ((RETRIEVERS, 0), (NEXT_TOKEN, 0)), ) -GET_APPLICATION = Schema( - id=ShapeID("com.amazonaws.qbusiness#GetApplication"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"uri": "/applications/{applicationId}", "method": "GET"} - ), +LIST_RETRIEVERS: StaticOperationSchema = ( + 23, + n0, + _LR, + { + _smithy: MappingProxyType( + {"uri": "/applications/{applicationId}/retrievers", "method": "GET"} ) - ], + }, + LIST_RETRIEVERS_INPUT, + LIST_RETRIEVERS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -INDEX_CAPACITY_INTEGER = Schema( - id=ShapeID("com.amazonaws.qbusiness#IndexCapacityInteger"), - shape_type=ShapeType.INTEGER, +UPDATE_RETRIEVER_INPUT: StaticSchema = ( + 18, + n0, + _URI, + {_sSI: _cURR, _smit: None}, + (_aIp, _rIe, _con, _dN, _rA), + ( + (APPLICATION_ID, 9), + (RETRIEVER_ID, 9), + (RETRIEVER_CONFIGURATION, 0), + (RETRIEVER_NAME, 0), + (ROLE_ARN, 0), + ), ) -INDEX_CAPACITY_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#IndexCapacityConfiguration"), - members={"units": {"target": INDEX_CAPACITY_INTEGER}}, +UPDATE_RETRIEVER_OUTPUT: StaticSchema = (18, n0, _URO, {_sSI: _cURRo, _smith: None}) + +UPDATE_RETRIEVER: StaticOperationSchema = ( + 23, + n0, + _UR, + { + _smithy: MappingProxyType( + { + "method": "PUT", + "uri": "/applications/{applicationId}/retrievers/{retrieverId}", + } + ) + }, + UPDATE_RETRIEVER_INPUT, + UPDATE_RETRIEVER_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -INDEX_NAME = Schema( - id=ShapeID("com.amazonaws.qbusiness#IndexName"), shape_type=ShapeType.STRING +UPDATE_APPLICATION_INPUT: StaticSchema = ( + 18, + n0, + _UAI, + {_sSI: _cUAR, _smit: None}, + (_aIp, _iCIA, _dN, _d, _rA, _aCt, _qAC, _pC, _aSC), + ( + (APPLICATION_ID, 9), + (INSTANCE_ARN, 0), + (APPLICATION_NAME, 0), + (DESCRIPTION, 0), + (ROLE_ARN, 0), + (ATTACHMENTS_CONFIGURATION, 0), + (Q_APPS_CONFIGURATION, 0), + (PERSONALIZATION_CONFIGURATION, 0), + (AUTO_SUBSCRIPTION_CONFIGURATION, 0), + ), ) -INDEX_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#IndexType"), - shape_type=ShapeType.ENUM, - members={"ENTERPRISE": {"target": UNIT}, "STARTER": {"target": UNIT}}, -) +UPDATE_APPLICATION_OUTPUT: StaticSchema = (18, n0, _UAO, {_sSI: _cUARo, _smith: None}) -CREATE_INDEX_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#CreateIndexInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#CreateIndexRequest", +UPDATE_APPLICATION: StaticOperationSchema = ( + 23, + n0, + _UA, + { + _smithy: MappingProxyType( + {"uri": "/applications/{applicationId}", "method": "PUT"} ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "displayName": { - "target": INDEX_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": DESCRIPTION}, - "type": {"target": INDEX_TYPE}, - "tags": {"target": TAGS}, - "capacityConfiguration": {"target": INDEX_CAPACITY_CONFIGURATION}, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, }, + UPDATE_APPLICATION_INPUT, + UPDATE_APPLICATION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -INDEX_ARN = Schema( - id=ShapeID("com.amazonaws.qbusiness#IndexArn"), shape_type=ShapeType.STRING -) +BROWSER_EXTENSION: StaticSchema = (3, n0, _BE, 0) -INDEX_ID = Schema( - id=ShapeID("com.amazonaws.qbusiness#IndexId"), shape_type=ShapeType.STRING +BROWSER_EXTENSION_LIST: StaticSchema = ( + 16, + n0, + _BEL, + 0, + (_m,), + ((BROWSER_EXTENSION, 0),), ) -CREATE_INDEX_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#CreateIndexOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#CreateIndexResponse", - ) - ], - members={"indexId": {"target": INDEX_ID}, "indexArn": {"target": INDEX_ARN}}, -) - -CREATE_INDEX = Schema( - id=ShapeID("com.amazonaws.qbusiness#CreateIndex"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"uri": "/applications/{applicationId}/indices", "method": "POST"} - ), - ) - ], +BROWSER_EXTENSION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _BEC, + 0, + (_eBE,), + ((BROWSER_EXTENSION_LIST, 1),), ) -DATA_SOURCE_CONFIGURATION = Schema( - id=ShapeID("com.amazonaws.qbusiness#DataSourceConfiguration"), - shape_type=ShapeType.DOCUMENT, -) +CUSTOM_CSS_URL: StaticSchema = (3, n0, _CCSSU, 0) -DATA_SOURCE_NAME = Schema( - id=ShapeID("com.amazonaws.qbusiness#DataSourceName"), shape_type=ShapeType.STRING -) +FAVICON_URL: StaticSchema = (3, n0, _FU, 0) -DOCUMENT_ENRICHMENT_CONDITION_OPERATOR = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DocumentEnrichmentConditionOperator"), - shape_type=ShapeType.ENUM, - members={ - "GREATER_THAN": {"target": UNIT}, - "GREATER_THAN_OR_EQUALS": {"target": UNIT}, - "LESS_THAN": {"target": UNIT}, - "LESS_THAN_OR_EQUALS": {"target": UNIT}, - "EQUALS": {"target": UNIT}, - "NOT_EQUALS": {"target": UNIT}, - "CONTAINS": {"target": UNIT}, - "NOT_CONTAINS": {"target": UNIT}, - "EXISTS": {"target": UNIT}, - "NOT_EXISTS": {"target": UNIT}, - "BEGINS_WITH": {"target": UNIT}, - }, -) +FONT_URL: StaticSchema = (3, n0, _FUo, 0) -DOCUMENT_ATTRIBUTE_CONDITION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DocumentAttributeCondition"), - members={ - "key": { - "target": DOCUMENT_ATTRIBUTE_KEY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "operator": { - "target": DOCUMENT_ENRICHMENT_CONDITION_OPERATOR, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "value": {"target": DOCUMENT_ATTRIBUTE_VALUE}, - }, -) +LOGO_URL: StaticSchema = (3, n0, _LU, 0) -DOCUMENT_CONTENT_OPERATOR = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DocumentContentOperator"), - shape_type=ShapeType.ENUM, - members={"DELETE": {"target": UNIT}}, +CUSTOMIZATION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _CC, + 0, + (_cCSSU, _lU, _fU, _fUa), + ((CUSTOM_CSS_URL, 0), (LOGO_URL, 0), (FONT_URL, 0), (FAVICON_URL, 0)), ) -ATTRIBUTE_VALUE_OPERATOR = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#AttributeValueOperator"), - shape_type=ShapeType.ENUM, - members={"DELETE": {"target": UNIT}}, +OPEN_ID_CONNECT_PROVIDER_CONFIGURATION: StaticSchema = ( + 18, + n0, + _OIDCPC, + 0, + (_sAe, _sR), + ((SECRET_ARN, 1), (ROLE_ARN, 1)), ) -DOCUMENT_ATTRIBUTE_TARGET = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DocumentAttributeTarget"), - members={ - "key": { - "target": DOCUMENT_ATTRIBUTE_KEY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "value": {"target": DOCUMENT_ATTRIBUTE_VALUE}, - "attributeValueOperator": {"target": ATTRIBUTE_VALUE_OPERATOR}, - }, -) +SAML_AUTHENTICATION_URL: StaticSchema = (3, n0, _SAU, 0) -INLINE_DOCUMENT_ENRICHMENT_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#InlineDocumentEnrichmentConfiguration"), - members={ - "condition": {"target": DOCUMENT_ATTRIBUTE_CONDITION}, - "target": {"target": DOCUMENT_ATTRIBUTE_TARGET}, - "documentContentOperator": {"target": DOCUMENT_CONTENT_OPERATOR}, - }, +SAML_PROVIDER_CONFIGURATION: StaticSchema = ( + 18, + n0, + _SPC, + 0, + (_aUu,), + ((SAML_AUTHENTICATION_URL, 1),), ) -INLINE_DOCUMENT_ENRICHMENT_CONFIGURATIONS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#InlineDocumentEnrichmentConfigurations"), - shape_type=ShapeType.LIST, - members={"member": {"target": INLINE_DOCUMENT_ENRICHMENT_CONFIGURATION}}, +IDENTITY_PROVIDER_CONFIGURATION: StaticSchema = ( + 19, + n0, + _IPC, + 0, + (_sCa, _oIDCC), + ((SAML_PROVIDER_CONFIGURATION, 0), (OPEN_ID_CONNECT_PROVIDER_CONFIGURATION, 0)), ) -LAMBDA_ARN = Schema( - id=ShapeID("com.amazonaws.qbusiness#LambdaArn"), shape_type=ShapeType.STRING -) +ORIGIN: StaticSchema = (3, n0, _O, 0) -HOOK_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#HookConfiguration"), - members={ - "invocationCondition": {"target": DOCUMENT_ATTRIBUTE_CONDITION}, - "lambdaArn": {"target": LAMBDA_ARN}, - "s3BucketName": {"target": S3_BUCKET_NAME}, - "roleArn": {"target": ROLE_ARN}, - }, -) +WEB_EXPERIENCE_ORIGINS: StaticSchema = (16, n0, _WEO, 0, (_m,), ((ORIGIN, 0),)) -DOCUMENT_ENRICHMENT_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DocumentEnrichmentConfiguration"), - members={ - "inlineConfigurations": {"target": INLINE_DOCUMENT_ENRICHMENT_CONFIGURATIONS}, - "preExtractionHookConfiguration": {"target": HOOK_CONFIGURATION}, - "postExtractionHookConfiguration": {"target": HOOK_CONFIGURATION}, - }, +WEB_EXPERIENCE_SAMPLE_PROMPTS_CONTROL_MODE: StaticSchema = ( + 14, + n0, + _WESPCM, + 0, + (_ENABLED, _DISABLED), + ((-1, {_sV: _ENABLED}), (-1, {_sV: _DISABLED})), ) -AUDIO_EXTRACTION_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#AudioExtractionStatus"), - shape_type=ShapeType.ENUM, - members={"ENABLED": {"target": UNIT}, "DISABLED": {"target": UNIT}}, -) +WEB_EXPERIENCE_SUBTITLE: StaticSchema = (3, n0, _WES, 0) -AUDIO_EXTRACTION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#AudioExtractionConfiguration"), - members={ - "audioExtractionStatus": { - "target": AUDIO_EXTRACTION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +WEB_EXPERIENCE_TITLE: StaticSchema = (3, n0, _WET, 0) + +WEB_EXPERIENCE_WELCOME_MESSAGE: StaticSchema = (3, n0, _WEWM, 0) + +CREATE_WEB_EXPERIENCE_INPUT: StaticSchema = ( + 18, + n0, + _CWEI, + {_sSI: _cCWER, _smit: None}, + (_aIp, _ti, _su, _wM, _sPCM, _or, _rA, _ta, _cT, _iPC, _bEC, _cCu), + ( + (APPLICATION_ID, 9), + (WEB_EXPERIENCE_TITLE, 0), + (WEB_EXPERIENCE_SUBTITLE, 0), + (WEB_EXPERIENCE_WELCOME_MESSAGE, 0), + (WEB_EXPERIENCE_SAMPLE_PROMPTS_CONTROL_MODE, 0), + (WEB_EXPERIENCE_ORIGINS, 0), + (ROLE_ARN, 0), + (TAGS, 0), + (CLIENT_TOKEN, 2), + (IDENTITY_PROVIDER_CONFIGURATION, 0), + (BROWSER_EXTENSION_CONFIGURATION, 0), + (CUSTOMIZATION_CONFIGURATION, 0), + ), ) -IMAGE_EXTRACTION_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ImageExtractionStatus"), - shape_type=ShapeType.ENUM, - members={"ENABLED": {"target": UNIT}, "DISABLED": {"target": UNIT}}, +WEB_EXPERIENCE_ARN: StaticSchema = (3, n0, _WEA, 0) + +WEB_EXPERIENCE_ID: StaticSchema = (3, n0, _WEI, 0) + +CREATE_WEB_EXPERIENCE_OUTPUT: StaticSchema = ( + 18, + n0, + _CWEO, + {_sSI: _cCWERo, _smith: None}, + (_wEI, _wEA), + ((WEB_EXPERIENCE_ID, 0), (WEB_EXPERIENCE_ARN, 0)), ) -IMAGE_EXTRACTION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ImageExtractionConfiguration"), - members={ - "imageExtractionStatus": { - "target": IMAGE_EXTRACTION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } +CREATE_WEB_EXPERIENCE: StaticOperationSchema = ( + 23, + n0, + _CWE, + { + _smithy: MappingProxyType( + {"uri": "/applications/{applicationId}/experiences", "method": "POST"} + ) }, + CREATE_WEB_EXPERIENCE_INPUT, + CREATE_WEB_EXPERIENCE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -VIDEO_EXTRACTION_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#VideoExtractionStatus"), - shape_type=ShapeType.ENUM, - members={"ENABLED": {"target": UNIT}, "DISABLED": {"target": UNIT}}, +DELETE_WEB_EXPERIENCE_INPUT: StaticSchema = ( + 18, + n0, + _DWEI, + {_sSI: _cDWER, _smit: None}, + (_aIp, _wEI), + ((APPLICATION_ID, 9), (WEB_EXPERIENCE_ID, 9)), +) + +DELETE_WEB_EXPERIENCE_OUTPUT: StaticSchema = ( + 18, + n0, + _DWEO, + {_sSI: _cDWERo, _smith: None}, +) + +DELETE_WEB_EXPERIENCE: StaticOperationSchema = ( + 23, + n0, + _DWE, + { + _smithy: MappingProxyType( + { + "uri": "/applications/{applicationId}/experiences/{webExperienceId}", + "method": "DELETE", + } + ) + }, + DELETE_WEB_EXPERIENCE_INPUT, + DELETE_WEB_EXPERIENCE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -VIDEO_EXTRACTION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#VideoExtractionConfiguration"), - members={ - "videoExtractionStatus": { - "target": VIDEO_EXTRACTION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +GET_WEB_EXPERIENCE_INPUT: StaticSchema = ( + 18, + n0, + _GWEI, + {_sSI: _cGWER, _smit: None}, + (_aIp, _wEI), + ((APPLICATION_ID, 9), (WEB_EXPERIENCE_ID, 9)), +) + +SAML_METADATA_XML: StaticSchema = (3, n0, _SMXML, 0) + +SAML_ATTRIBUTE: StaticSchema = (3, n0, _SAa, 0) + +SAML_CONFIGURATION: StaticSchema = ( + 18, + n0, + _SCa, + 0, + (_mXML, _rA, _uIA, _uGA), + ((SAML_METADATA_XML, 1), (ROLE_ARN, 1), (SAML_ATTRIBUTE, 1), (SAML_ATTRIBUTE, 0)), +) + +WEB_EXPERIENCE_AUTH_CONFIGURATION: StaticSchema = ( + 19, + n0, + _WEAC, + 0, + (_sCa,), + ((SAML_CONFIGURATION, 0),), +) + +WEB_EXPERIENCE_STATUS: StaticSchema = ( + 14, + n0, + _WESe, + 0, + (_CREATING, _ACTIVE, _DELETING, _FAILED, _PAC_), + ( + (-1, {_sV: _CREATING}), + (-1, {_sV: _ACTIVE}), + (-1, {_sV: _DELETING}), + (-1, {_sV: _FAILED}), + (-1, {_sV: _PAC_}), + ), ) -MEDIA_EXTRACTION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#MediaExtractionConfiguration"), - members={ - "imageExtractionConfiguration": {"target": IMAGE_EXTRACTION_CONFIGURATION}, - "audioExtractionConfiguration": {"target": AUDIO_EXTRACTION_CONFIGURATION}, - "videoExtractionConfiguration": {"target": VIDEO_EXTRACTION_CONFIGURATION}, - }, +GET_WEB_EXPERIENCE_OUTPUT: StaticSchema = ( + 18, + n0, + _GWEO, + {_sSI: _cGWERo, _smith: None}, + ( + _aIp, + _wEI, + _wEA, + _dE, + _st, + _cA, + _uA, + _ti, + _su, + _wM, + _sPCM, + _or, + _rA, + _iPC, + _aCu, + _e, + _bEC, + _cCu, + ), + ( + (APPLICATION_ID, 0), + (WEB_EXPERIENCE_ID, 0), + (WEB_EXPERIENCE_ARN, 0), + (URL, 0), + (WEB_EXPERIENCE_STATUS, 0), + (TIMESTAMP, 0), + (TIMESTAMP, 0), + (WEB_EXPERIENCE_TITLE, 0), + (WEB_EXPERIENCE_SUBTITLE, 0), + (WEB_EXPERIENCE_WELCOME_MESSAGE, 0), + (WEB_EXPERIENCE_SAMPLE_PROMPTS_CONTROL_MODE, 0), + (WEB_EXPERIENCE_ORIGINS, 0), + (ROLE_ARN, 0), + (IDENTITY_PROVIDER_CONFIGURATION, 0), + (WEB_EXPERIENCE_AUTH_CONFIGURATION, 0), + (ERROR_DETAIL, 0), + (BROWSER_EXTENSION_CONFIGURATION, 0), + (CUSTOMIZATION_CONFIGURATION, 0), + ), ) -SYNC_SCHEDULE = Schema( - id=ShapeID("com.amazonaws.qbusiness#SyncSchedule"), shape_type=ShapeType.STRING +GET_WEB_EXPERIENCE: StaticOperationSchema = ( + 23, + n0, + _GWE, + { + _smithy: MappingProxyType( + { + "uri": "/applications/{applicationId}/experiences/{webExperienceId}", + "method": "GET", + } + ) + }, + GET_WEB_EXPERIENCE_INPUT, + GET_WEB_EXPERIENCE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -SECURITY_GROUP_ID = Schema( - id=ShapeID("com.amazonaws.qbusiness#SecurityGroupId"), shape_type=ShapeType.STRING +MAX_RESULTS_INTEGER_FOR_LIST_WEB_EXPERIENCES_REQUEST: StaticSchema = ( + 7, + n0, + _MRIFLWER, + 0, ) -SECURITY_GROUP_IDS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#SecurityGroupIds"), - shape_type=ShapeType.LIST, - members={"member": {"target": SECURITY_GROUP_ID}}, +LIST_WEB_EXPERIENCES_INPUT: StaticSchema = ( + 18, + n0, + _LWEI, + {_sSI: _cLWER, _smit: None}, + (_aIp, _nT, _mRa), + ( + (APPLICATION_ID, 9), + (NEXT_TOKEN, {_sQ: _nT}), + (MAX_RESULTS_INTEGER_FOR_LIST_WEB_EXPERIENCES_REQUEST, {_sQ: _mRa}), + ), ) -SUBNET_ID = Schema( - id=ShapeID("com.amazonaws.qbusiness#SubnetId"), shape_type=ShapeType.STRING +WEB_EXPERIENCE: StaticSchema = ( + 18, + n0, + _WE, + 0, + (_wEI, _cA, _uA, _dE, _st), + ( + (WEB_EXPERIENCE_ID, 0), + (TIMESTAMP, 0), + (TIMESTAMP, 0), + (URL, 0), + (WEB_EXPERIENCE_STATUS, 0), + ), ) -SUBNET_IDS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#SubnetIds"), - shape_type=ShapeType.LIST, - members={"member": {"target": SUBNET_ID}}, -) +WEB_EXPERIENCES: StaticSchema = (16, n0, _WEe, 0, (_m,), ((WEB_EXPERIENCE, 0),)) -DATA_SOURCE_VPC_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DataSourceVpcConfiguration"), - members={ - "subnetIds": { - "target": SUBNET_IDS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "securityGroupIds": { - "target": SECURITY_GROUP_IDS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +LIST_WEB_EXPERIENCES_OUTPUT: StaticSchema = ( + 18, + n0, + _LWEO, + {_sSI: _cLWERo, _smith: None}, + (_wE, _nT), + ((WEB_EXPERIENCES, 0), (NEXT_TOKEN, 0)), ) -CREATE_DATA_SOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#CreateDataSourceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#CreateDataSourceRequest", +LIST_WEB_EXPERIENCES: StaticOperationSchema = ( + 23, + n0, + _LWE, + { + _smithy: MappingProxyType( + {"uri": "/applications/{applicationId}/experiences", "method": "GET"} ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "indexId": { - "target": INDEX_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "displayName": { - "target": DATA_SOURCE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "configuration": { - "target": DATA_SOURCE_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "vpcConfiguration": {"target": DATA_SOURCE_VPC_CONFIGURATION}, - "description": {"target": DESCRIPTION}, - "tags": {"target": TAGS}, - "syncSchedule": {"target": SYNC_SCHEDULE}, - "roleArn": {"target": ROLE_ARN}, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "documentEnrichmentConfiguration": { - "target": DOCUMENT_ENRICHMENT_CONFIGURATION - }, - "mediaExtractionConfiguration": {"target": MEDIA_EXTRACTION_CONFIGURATION}, }, + LIST_WEB_EXPERIENCES_INPUT, + LIST_WEB_EXPERIENCES_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -DATA_SOURCE_ARN = Schema( - id=ShapeID("com.amazonaws.qbusiness#DataSourceArn"), shape_type=ShapeType.STRING +UPDATE_WEB_EXPERIENCE_INPUT: StaticSchema = ( + 18, + n0, + _UWEI, + {_sSI: _cUWER, _smit: None}, + (_aIp, _wEI, _rA, _aCu, _ti, _su, _wM, _sPCM, _iPC, _or, _bEC, _cCu), + ( + (APPLICATION_ID, 9), + (WEB_EXPERIENCE_ID, 9), + (ROLE_ARN, 0), + (WEB_EXPERIENCE_AUTH_CONFIGURATION, 0), + (WEB_EXPERIENCE_TITLE, 0), + (WEB_EXPERIENCE_SUBTITLE, 0), + (WEB_EXPERIENCE_WELCOME_MESSAGE, 0), + (WEB_EXPERIENCE_SAMPLE_PROMPTS_CONTROL_MODE, 0), + (IDENTITY_PROVIDER_CONFIGURATION, 0), + (WEB_EXPERIENCE_ORIGINS, 0), + (BROWSER_EXTENSION_CONFIGURATION, 0), + (CUSTOMIZATION_CONFIGURATION, 0), + ), ) -DATA_SOURCE_ID = Schema( - id=ShapeID("com.amazonaws.qbusiness#DataSourceId"), shape_type=ShapeType.STRING +UPDATE_WEB_EXPERIENCE_OUTPUT: StaticSchema = ( + 18, + n0, + _UWEO, + {_sSI: _cUWERo, _smith: None}, +) + +UPDATE_WEB_EXPERIENCE: StaticOperationSchema = ( + 23, + n0, + _UWE, + { + _smithy: MappingProxyType( + { + "uri": "/applications/{applicationId}/experiences/{webExperienceId}", + "method": "PUT", + } + ) + }, + UPDATE_WEB_EXPERIENCE_INPUT, + UPDATE_WEB_EXPERIENCE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CREATE_DATA_SOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#CreateDataSourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#CreateDataSourceResponse", - ) - ], - members={ - "dataSourceId": {"target": DATA_SOURCE_ID}, - "dataSourceArn": {"target": DATA_SOURCE_ARN}, - }, +CREATOR_MODE_CONTROL: StaticSchema = ( + 14, + n0, + _CMC, + 0, + (_ENABLED, _DISABLED), + ((-1, {_sV: _ENABLED}), (-1, {_sV: _DISABLED})), ) -CREATE_DATA_SOURCE = Schema( - id=ShapeID("com.amazonaws.qbusiness#CreateDataSource"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "uri": "/applications/{applicationId}/indices/{indexId}/datasources", - "method": "POST", - } - ), - ) - ], +APPLIED_CREATOR_MODE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _ACMC, + 0, + (_cMC,), + ((CREATOR_MODE_CONTROL, 1),), ) -DELETE_DATA_SOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DeleteDataSourceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#DeleteDataSourceRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "indexId": { - "target": INDEX_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "dataSourceId": { - "target": DATA_SOURCE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, +ORCHESTRATION_CONTROL: StaticSchema = ( + 14, + n0, + _OC, + 0, + (_ENABLED, _DISABLED), + ((-1, {_sV: _ENABLED}), (-1, {_sV: _DISABLED})), ) -DELETE_DATA_SOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DeleteDataSourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#DeleteDataSourceResponse", - ) - ], -) - -DELETE_DATA_SOURCE = Schema( - id=ShapeID("com.amazonaws.qbusiness#DeleteDataSource"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "uri": "/applications/{applicationId}/indices/{indexId}/datasources/{dataSourceId}", - "method": "DELETE", - } - ), - ) - ], +APPLIED_ORCHESTRATION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _AOC, + 0, + (_cont,), + ((ORCHESTRATION_CONTROL, 1),), ) -GET_DATA_SOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#GetDataSourceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#GetDataSourceRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "indexId": { - "target": INDEX_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "dataSourceId": { - "target": DATA_SOURCE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, +ASSOCIATED_GROUP: StaticSchema = ( + 18, + n0, + _AG, + 0, + (_n, _t), + ((GROUP_NAME, 0), (MEMBERSHIP_TYPE, 0)), ) -DATA_SOURCE_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DataSourceStatus"), - shape_type=ShapeType.ENUM, - members={ - "PENDING_CREATION": {"target": UNIT}, - "CREATING": {"target": UNIT}, - "ACTIVE": {"target": UNIT}, - "DELETING": {"target": UNIT}, - "FAILED": {"target": UNIT}, - "UPDATING": {"target": UNIT}, - }, +ASSOCIATED_GROUPS: StaticSchema = (16, n0, _AGs, 0, (_m,), ((ASSOCIATED_GROUP, 0),)) + +ASSOCIATED_USER: StaticSchema = ( + 18, + n0, + _AU, + 0, + (_i, _t), + ((STRING, 0), (MEMBERSHIP_TYPE, 0)), ) -GET_DATA_SOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#GetDataSourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#GetDataSourceResponse", - ) - ], - members={ - "applicationId": {"target": APPLICATION_ID}, - "indexId": {"target": INDEX_ID}, - "dataSourceId": {"target": DATA_SOURCE_ID}, - "dataSourceArn": {"target": DATA_SOURCE_ARN}, - "displayName": {"target": DATA_SOURCE_NAME}, - "type": {"target": STRING}, - "configuration": {"target": DATA_SOURCE_CONFIGURATION}, - "vpcConfiguration": {"target": DATA_SOURCE_VPC_CONFIGURATION}, - "createdAt": {"target": TIMESTAMP}, - "updatedAt": {"target": TIMESTAMP}, - "description": {"target": DESCRIPTION}, - "status": {"target": DATA_SOURCE_STATUS}, - "syncSchedule": {"target": SYNC_SCHEDULE}, - "roleArn": {"target": ROLE_ARN}, - "error": {"target": ERROR_DETAIL}, - "documentEnrichmentConfiguration": { - "target": DOCUMENT_ENRICHMENT_CONFIGURATION - }, - "mediaExtractionConfiguration": {"target": MEDIA_EXTRACTION_CONFIGURATION}, - }, -) +ASSOCIATED_USERS: StaticSchema = (16, n0, _AUs, 0, (_m,), ((ASSOCIATED_USER, 0),)) -GET_DATA_SOURCE = Schema( - id=ShapeID("com.amazonaws.qbusiness#GetDataSource"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "uri": "/applications/{applicationId}/indices/{indexId}/datasources/{dataSourceId}", - "method": "GET", - } - ), - ) - ], -) +Q_IAM_ACTIONS: StaticSchema = (16, n0, _QIAa, 0, (_m,), ((Q_IAM_ACTION, 0),)) -MAX_RESULTS_INTEGER_FOR_LIST_DATA_SOURCES = Schema( - id=ShapeID("com.amazonaws.qbusiness#MaxResultsIntegerForListDataSources"), - shape_type=ShapeType.INTEGER, -) +PERMISSION_CONDITION_KEY: StaticSchema = (3, n0, _PCK, 0) -NEXT_TOKEN = Schema( - id=ShapeID("com.amazonaws.qbusiness#NextToken"), shape_type=ShapeType.STRING +PERMISSION_CONDITION_OPERATOR: StaticSchema = ( + 14, + n0, + _PCO, + 0, + (_SE,), + ((-1, {_sV: _SEt}),), ) -LIST_DATA_SOURCES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ListDataSourcesInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#ListDataSourcesRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "indexId": { - "target": INDEX_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "maxResults": { - "target": MAX_RESULTS_INTEGER_FOR_LIST_DATA_SOURCES, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - }, -) +PERMISSION_CONDITION_VALUE: StaticSchema = (3, n0, _PCV, 0) -DATA_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DataSource"), - members={ - "displayName": {"target": DATA_SOURCE_NAME}, - "dataSourceId": {"target": DATA_SOURCE_ID}, - "type": {"target": STRING}, - "createdAt": {"target": TIMESTAMP}, - "updatedAt": {"target": TIMESTAMP}, - "status": {"target": DATA_SOURCE_STATUS}, - }, +PERMISSION_CONDITION_VALUES: StaticSchema = ( + 16, + n0, + _PCVe, + 0, + (_m,), + ((PERMISSION_CONDITION_VALUE, 0),), ) -DATA_SOURCES = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DataSources"), - shape_type=ShapeType.LIST, - members={"member": {"target": DATA_SOURCE}}, +PERMISSION_CONDITION: StaticSchema = ( + 18, + n0, + _PCe, + 0, + (_cO, _cK, _cV), + ( + (PERMISSION_CONDITION_OPERATOR, 1), + (PERMISSION_CONDITION_KEY, 1), + (PERMISSION_CONDITION_VALUES, 1), + ), ) -LIST_DATA_SOURCES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ListDataSourcesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#ListDataSourcesResponse", - ) - ], - members={ - "dataSources": {"target": DATA_SOURCES}, - "nextToken": {"target": NEXT_TOKEN}, - }, +PERMISSION_CONDITIONS: StaticSchema = ( + 16, + n0, + _PCer, + 0, + (_m,), + ((PERMISSION_CONDITION, 0),), +) + +STATEMENT_ID: StaticSchema = (3, n0, _SIt, 0) + +ASSOCIATE_PERMISSION_INPUT: StaticSchema = ( + 18, + n0, + _API, + {_sSI: _cAPR, _smit: None}, + (_aIp, _sIt, _ac, _cond, _pr), + ( + (APPLICATION_ID, 9), + (STATEMENT_ID, 1), + (Q_IAM_ACTIONS, 1), + (PERMISSION_CONDITIONS, 0), + (PRINCIPAL_ROLE_ARN, 1), + ), ) -LIST_DATA_SOURCES = Schema( - id=ShapeID("com.amazonaws.qbusiness#ListDataSources"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "uri": "/applications/{applicationId}/indices/{indexId}/datasources", - "method": "GET", - } - ), - ) - ], +ASSOCIATE_PERMISSION_OUTPUT: StaticSchema = ( + 18, + n0, + _APO, + {_sSI: _cAPRo, _smith: None}, + (_stat,), + ((STRING, 0),), +) + +ASSOCIATE_PERMISSION: StaticOperationSchema = ( + 23, + n0, + _AP, + { + _smithy: MappingProxyType( + {"uri": "/applications/{applicationId}/policy", "method": "POST"} + ) + }, + ASSOCIATE_PERMISSION_INPUT, + ASSOCIATE_PERMISSION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -UPDATE_DATA_SOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#UpdateDataSourceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#UpdateDataSourceRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "indexId": { - "target": INDEX_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "dataSourceId": { - "target": DATA_SOURCE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "displayName": {"target": DATA_SOURCE_NAME}, - "configuration": {"target": DATA_SOURCE_CONFIGURATION}, - "vpcConfiguration": {"target": DATA_SOURCE_VPC_CONFIGURATION}, - "description": {"target": DESCRIPTION}, - "syncSchedule": {"target": SYNC_SCHEDULE}, - "roleArn": {"target": ROLE_ARN}, - "documentEnrichmentConfiguration": { - "target": DOCUMENT_ENRICHMENT_CONFIGURATION - }, - "mediaExtractionConfiguration": {"target": MEDIA_EXTRACTION_CONFIGURATION}, - }, +ATTACHMENT_ID: StaticSchema = (3, n0, _AIt, 0) + +CONVERSATION_SOURCE: StaticSchema = ( + 18, + n0, + _CS, + 0, + (_cI, _aIt), + ((CONVERSATION_ID, 1), (ATTACHMENT_ID, 1)), +) + +COPY_FROM_SOURCE: StaticSchema = ( + 19, + n0, + _CFS, + 0, + (_conv,), + ((CONVERSATION_SOURCE, 0),), +) + +ATTACHMENT_NAME: StaticSchema = (3, n0, _ANt, 0) + +ATTACHMENT_STATUS: StaticSchema = ( + 14, + n0, + _ASt, + 0, + (_FAILED, _SUCCESS), + ((-1, {_sV: _FAILED}), (-1, {_sV: _SUCCESS})), +) + +ATTACHMENT: StaticSchema = ( + 18, + n0, + _At, + 0, + (_aIt, _cI, _n, _cF, _fT, _fS, _md, _cA, _st, _e), + ( + (ATTACHMENT_ID, 0), + (CONVERSATION_ID, 0), + (ATTACHMENT_NAME, 0), + (COPY_FROM_SOURCE, 0), + (STRING, 0), + (INTEGER, 0), + (STRING, 0), + (TIMESTAMP, 0), + (ATTACHMENT_STATUS, 0), + (ERROR_DETAIL, 0), + ), ) -UPDATE_DATA_SOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#UpdateDataSourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#UpdateDataSourceResponse", - ) - ], -) - -UPDATE_DATA_SOURCE = Schema( - id=ShapeID("com.amazonaws.qbusiness#UpdateDataSource"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "uri": "/applications/{applicationId}/indices/{indexId}/datasources/{dataSourceId}", - "method": "PUT", - } - ), - ) - ], +BLOB: StaticSchema = (1, n0, _B, 0) + +ATTACHMENT_INPUT: StaticSchema = ( + 18, + n0, + _AItt, + 0, + (_da, _n, _cF), + ((BLOB, 0), (ATTACHMENT_NAME, 0), (COPY_FROM_SOURCE, 0)), +) + +ATTACHMENT_INPUT_EVENT: StaticSchema = ( + 18, + n0, + _AIE, + 0, + (_at,), + ((ATTACHMENT_INPUT, 0),), +) + +ATTACHMENT_LIST: StaticSchema = (16, n0, _AL, 0, (_m,), ((ATTACHMENT, 0),)) + +ATTACHMENT_OUTPUT: StaticSchema = ( + 18, + n0, + _AO, + 0, + (_n, _st, _e, _aIt, _cI), + ( + (ATTACHMENT_NAME, 0), + (ATTACHMENT_STATUS, 0), + (ERROR_DETAIL, 0), + (ATTACHMENT_ID, 0), + (CONVERSATION_ID, 0), + ), ) -DELETE_INDEX_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DeleteIndexInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#DeleteIndexRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "indexId": { - "target": INDEX_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) +ATTACHMENTS_INPUT: StaticSchema = (16, n0, _AItta, 0, (_m,), ((ATTACHMENT_INPUT, 0),)) -DELETE_INDEX_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DeleteIndexOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#DeleteIndexResponse", - ) - ], -) - -DELETE_INDEX = Schema( - id=ShapeID("com.amazonaws.qbusiness#DeleteIndex"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "uri": "/applications/{applicationId}/indices/{indexId}", - "method": "DELETE", - } - ), - ) - ], -) +ATTACHMENTS_OUTPUT: StaticSchema = (16, n0, _AOt, 0, (_m,), ((ATTACHMENT_OUTPUT, 0),)) -GET_INDEX_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#GetIndexInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#GetIndexRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "indexId": { - "target": INDEX_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, +AUDIO_EXTRACTION_TYPE: StaticSchema = ( + 14, + n0, + _AET, + 0, + (_TRANSCRIPT, _SUMMARY), + ((-1, {_sV: _TRANSCRIPT}), (-1, {_sV: _SUMMARY})), ) -DOCUMENT_METADATA_CONFIGURATION_NAME = Schema( - id=ShapeID("com.amazonaws.qbusiness#DocumentMetadataConfigurationName"), - shape_type=ShapeType.STRING, -) +MEDIA_ID: StaticSchema = (3, n0, _MIe, 0) -STATUS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#Status"), - shape_type=ShapeType.ENUM, - members={"ENABLED": {"target": UNIT}, "DISABLED": {"target": UNIT}}, +AUDIO_SOURCE_DETAILS: StaticSchema = ( + 18, + n0, + _ASD, + 0, + (_mI, _mMT, _sTM, _eTM, _aET), + ((MEDIA_ID, 0), (STRING, 0), (LONG, 0), (LONG, 0), (AUDIO_EXTRACTION_TYPE, 0)), ) -ATTRIBUTE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#AttributeType"), - shape_type=ShapeType.ENUM, - members={ - "STRING": {"target": UNIT}, - "STRING_LIST": {"target": UNIT}, - "NUMBER": {"target": UNIT}, - "DATE": {"target": UNIT}, - }, -) +AUTH_CHALLENGE_REQUEST: StaticSchema = (18, n0, _ACR, 0, (_aU,), ((URL, 1),)) -DOCUMENT_ATTRIBUTE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DocumentAttributeConfiguration"), - members={ - "name": {"target": DOCUMENT_METADATA_CONFIGURATION_NAME}, - "type": {"target": ATTRIBUTE_TYPE}, - "search": {"target": STATUS}, - }, -) +AUTH_CHALLENGE_REQUEST_EVENT: StaticSchema = (18, n0, _ACRE, 0, (_aU,), ((URL, 1),)) -DOCUMENT_ATTRIBUTE_CONFIGURATIONS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DocumentAttributeConfigurations"), - shape_type=ShapeType.LIST, - members={"member": {"target": DOCUMENT_ATTRIBUTE_CONFIGURATION}}, -) +AUTH_RESPONSE_KEY: StaticSchema = (3, n0, _ARK, 0) -INDEXED_TEXT_BYTES = Schema( - id=ShapeID("com.amazonaws.qbusiness#IndexedTextBytes"), shape_type=ShapeType.LONG -) +AUTH_RESPONSE_VALUE: StaticSchema = (3, n0, _ARV, 0) -INDEXED_TEXT_DOCUMENT = Schema( - id=ShapeID("com.amazonaws.qbusiness#IndexedTextDocument"), - shape_type=ShapeType.INTEGER, +AUTHORIZATION_RESPONSE_MAP: StaticSchema = ( + 17, + n0, + _ARM, + 0, + (_k, _v), + ((AUTH_RESPONSE_KEY, 0), (AUTH_RESPONSE_VALUE, 0)), ) -TEXT_DOCUMENT_STATISTICS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#TextDocumentStatistics"), - members={ - "indexedTextBytes": {"target": INDEXED_TEXT_BYTES}, - "indexedTextDocumentCount": {"target": INDEXED_TEXT_DOCUMENT}, - }, +AUTH_CHALLENGE_RESPONSE: StaticSchema = ( + 18, + n0, + _ACRu, + 0, + (_rM,), + ((AUTHORIZATION_RESPONSE_MAP, 1),), ) -INDEX_STATISTICS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#IndexStatistics"), - members={"textDocumentStatistics": {"target": TEXT_DOCUMENT_STATISTICS}}, +AUTH_CHALLENGE_RESPONSE_EVENT: StaticSchema = ( + 18, + n0, + _ACREu, + 0, + (_rM,), + ((AUTHORIZATION_RESPONSE_MAP, 1),), ) -INDEX_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#IndexStatus"), - shape_type=ShapeType.ENUM, - members={ - "CREATING": {"target": UNIT}, - "ACTIVE": {"target": UNIT}, - "DELETING": {"target": UNIT}, - "FAILED": {"target": UNIT}, - "UPDATING": {"target": UNIT}, - }, -) +EXECUTION_ID: StaticSchema = (3, n0, _EI, 0) -GET_INDEX_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#GetIndexOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#GetIndexResponse", - ) - ], - members={ - "applicationId": {"target": APPLICATION_ID}, - "indexId": {"target": INDEX_ID}, - "displayName": {"target": INDEX_NAME}, - "indexArn": {"target": INDEX_ARN}, - "status": {"target": INDEX_STATUS}, - "type": {"target": INDEX_TYPE}, - "description": {"target": DESCRIPTION}, - "createdAt": {"target": TIMESTAMP}, - "updatedAt": {"target": TIMESTAMP}, - "capacityConfiguration": {"target": INDEX_CAPACITY_CONFIGURATION}, - "documentAttributeConfigurations": { - "target": DOCUMENT_ATTRIBUTE_CONFIGURATIONS - }, - "error": {"target": ERROR_DETAIL}, - "indexStatistics": {"target": INDEX_STATISTICS}, - }, +DOCUMENT_ID: StaticSchema = (3, n0, _DIo, 0) + +DELETE_DOCUMENT: StaticSchema = (18, n0, _DD, 0, (_dI,), ((DOCUMENT_ID, 1),)) + +DELETE_DOCUMENTS: StaticSchema = (16, n0, _DDe, 0, (_m,), ((DELETE_DOCUMENT, 0),)) + +BATCH_DELETE_DOCUMENT_INPUT: StaticSchema = ( + 18, + n0, + _BDDI, + {_sSI: _cBDDR, _smit: None}, + (_aIp, _iI, _do, _dSSI), + ((APPLICATION_ID, 9), (INDEX_ID, 9), (DELETE_DOCUMENTS, 1), (EXECUTION_ID, 0)), ) -GET_INDEX = Schema( - id=ShapeID("com.amazonaws.qbusiness#GetIndex"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "uri": "/applications/{applicationId}/indices/{indexId}", - "method": "GET", - } - ), - ) - ], +FAILED_DOCUMENT: StaticSchema = ( + 18, + n0, + _FD, + 0, + (_i, _e, _dSI), + ((DOCUMENT_ID, 0), (ERROR_DETAIL, 0), (DATA_SOURCE_ID, 0)), ) -MAX_RESULTS_INTEGER_FOR_LIST_INDICES = Schema( - id=ShapeID("com.amazonaws.qbusiness#MaxResultsIntegerForListIndices"), - shape_type=ShapeType.INTEGER, +FAILED_DOCUMENTS: StaticSchema = (16, n0, _FDa, 0, (_m,), ((FAILED_DOCUMENT, 0),)) + +BATCH_DELETE_DOCUMENT_OUTPUT: StaticSchema = ( + 18, + n0, + _BDDO, + {_sSI: _cBDDRo, _smith: None}, + (_fD,), + ((FAILED_DOCUMENTS, 0),), ) -LIST_INDICES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ListIndicesInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#ListIndicesRequest", +BATCH_DELETE_DOCUMENT: StaticOperationSchema = ( + 23, + n0, + _BDD, + { + _smithy: MappingProxyType( + { + "method": "POST", + "uri": "/applications/{applicationId}/indices/{indexId}/documents/delete", + } ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "maxResults": { - "target": MAX_RESULTS_INTEGER_FOR_LIST_INDICES, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, }, + BATCH_DELETE_DOCUMENT_INPUT, + BATCH_DELETE_DOCUMENT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -INDEX = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#Index"), - members={ - "displayName": {"target": INDEX_NAME}, - "indexId": {"target": INDEX_ID}, - "createdAt": {"target": TIMESTAMP}, - "updatedAt": {"target": TIMESTAMP}, - "status": {"target": INDEX_STATUS}, - }, +DOCUMENT_ATTRIBUTES: StaticSchema = (16, n0, _DAo, 0, (_m,), ((DOCUMENT_ATTRIBUTE, 0),)) + +DOCUMENT_CONTENT: StaticSchema = (19, n0, _DC, 0, (_bl, _s_), ((1, 0), (S3, 0))) + +CONTENT_TYPE: StaticSchema = ( + 14, + n0, + _CTo, + 0, + (_PDF, _HTML, _MW, _PT_, _PPT, _RTF, _XML, _XSLT, _ME_, _CSV, _JSON, _MD), + ( + (-1, {_sV: _PDF}), + (-1, {_sV: _HTML}), + (-1, {_sV: _MW}), + (-1, {_sV: _PT_}), + (-1, {_sV: _PPT}), + (-1, {_sV: _RTF}), + (-1, {_sV: _XML}), + (-1, {_sV: _XSLT}), + (-1, {_sV: _ME_}), + (-1, {_sV: _CSV}), + (-1, {_sV: _JSON}), + (-1, {_sV: _MD}), + ), ) -INDICES = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#Indices"), - shape_type=ShapeType.LIST, - members={"member": {"target": INDEX}}, +TITLE: StaticSchema = (3, n0, _Ti, 0) + +DOCUMENT: StaticSchema = ( + 18, + n0, + _Do, + 0, + (_i, _att, _conte, _cTo, _ti, _aCc, _dEC, _mEC), + ( + (DOCUMENT_ID, 1), + (DOCUMENT_ATTRIBUTES, 0), + (DOCUMENT_CONTENT, 0), + (CONTENT_TYPE, 0), + (TITLE, 0), + (ACCESS_CONFIGURATION, 0), + (DOCUMENT_ENRICHMENT_CONFIGURATION, 0), + (MEDIA_EXTRACTION_CONFIGURATION, 0), + ), ) -LIST_INDICES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ListIndicesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#ListIndicesResponse", - ) - ], - members={"nextToken": {"target": NEXT_TOKEN}, "indices": {"target": INDICES}}, -) - -LIST_INDICES = Schema( - id=ShapeID("com.amazonaws.qbusiness#ListIndices"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"uri": "/applications/{applicationId}/indices", "method": "GET"} - ), - ) - ], +DOCUMENTS: StaticSchema = (16, n0, _Doc, 0, (_m,), ((DOCUMENT, 0),)) + +BATCH_PUT_DOCUMENT_INPUT: StaticSchema = ( + 18, + n0, + _BPDI, + {_sSI: _cBPDR, _smit: None}, + (_aIp, _iI, _do, _rA, _dSSI), + ( + (APPLICATION_ID, 9), + (INDEX_ID, 9), + (DOCUMENTS, 1), + (ROLE_ARN, 0), + (EXECUTION_ID, 0), + ), ) -UPDATE_INDEX_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#UpdateIndexInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#UpdateIndexRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "indexId": { - "target": INDEX_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "displayName": {"target": APPLICATION_NAME}, - "description": {"target": DESCRIPTION}, - "capacityConfiguration": {"target": INDEX_CAPACITY_CONFIGURATION}, - "documentAttributeConfigurations": { - "target": DOCUMENT_ATTRIBUTE_CONFIGURATIONS - }, - }, +BATCH_PUT_DOCUMENT_OUTPUT: StaticSchema = ( + 18, + n0, + _BPDO, + {_sSI: _cBPDRo, _smith: None}, + (_fD,), + ((FAILED_DOCUMENTS, 0),), +) + +BATCH_PUT_DOCUMENT: StaticOperationSchema = ( + 23, + n0, + _BPD, + { + _smithy: MappingProxyType( + { + "method": "POST", + "uri": "/applications/{applicationId}/indices/{indexId}/documents", + } + ) + }, + BATCH_PUT_DOCUMENT_INPUT, + BATCH_PUT_DOCUMENT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -UPDATE_INDEX_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#UpdateIndexOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#UpdateIndexResponse", - ) - ], -) - -UPDATE_INDEX = Schema( - id=ShapeID("com.amazonaws.qbusiness#UpdateIndex"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "uri": "/applications/{applicationId}/indices/{indexId}", - "method": "PUT", - } - ), - ) - ], -) +BLOCKED_PHRASE: StaticSchema = (3, n0, _BP, 0) -INTEGRATION_ID = Schema( - id=ShapeID("com.amazonaws.qbusiness#IntegrationId"), shape_type=ShapeType.STRING +BLOCKED_PHRASES: StaticSchema = (16, n0, _BPl, 0, (_m,), ((BLOCKED_PHRASE, 0),)) + +SYSTEM_MESSAGE_OVERRIDE: StaticSchema = (3, n0, _SMO, 0) + +BLOCKED_PHRASES_CONFIGURATION: StaticSchema = ( + 18, + n0, + _BPC, + 0, + (_bP, _sMO), + ((BLOCKED_PHRASES, 0), (SYSTEM_MESSAGE_OVERRIDE, 0)), ) -MAX_RESULTS_INTEGER_FOR_LIST_APPLICATIONS = Schema( - id=ShapeID("com.amazonaws.qbusiness#MaxResultsIntegerForListApplications"), - shape_type=ShapeType.INTEGER, +BLOCKED_PHRASES_CONFIGURATION_UPDATE: StaticSchema = ( + 18, + n0, + _BPCU, + 0, + (_bPTCOU, _bPTD, _sMO), + ((BLOCKED_PHRASES, 0), (BLOCKED_PHRASES, 0), (SYSTEM_MESSAGE_OVERRIDE, 0)), ) -LIST_APPLICATIONS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ListApplicationsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#ListApplicationsRequest", - ) - ], - members={ - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "maxResults": { - "target": MAX_RESULTS_INTEGER_FOR_LIST_APPLICATIONS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - }, +SUBSCRIPTION_ID: StaticSchema = (3, n0, _SIub, 0) + +CANCEL_SUBSCRIPTION_INPUT: StaticSchema = ( + 18, + n0, + _CSI, + {_sSI: _cCSR, _smit: None}, + (_aIp, _sIu), + ((APPLICATION_ID, 9), (SUBSCRIPTION_ID, 9)), ) -APPLICATIONS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#Applications"), - shape_type=ShapeType.LIST, - members={"member": {"target": APPLICATION}}, +SUBSCRIPTION_DETAILS: StaticSchema = (18, n0, _SD, 0, (_t,), ((SUBSCRIPTION_TYPE, 0),)) + +SUBSCRIPTION_ARN: StaticSchema = (3, n0, _SAu, 0) + +CANCEL_SUBSCRIPTION_OUTPUT: StaticSchema = ( + 18, + n0, + _CSO, + {_sSI: _cCSRo, _smith: None}, + (_sAu, _cS, _nS), + ((SUBSCRIPTION_ARN, 0), (SUBSCRIPTION_DETAILS, 0), (SUBSCRIPTION_DETAILS, 0)), ) -LIST_APPLICATIONS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ListApplicationsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#ListApplicationsResponse", +CANCEL_SUBSCRIPTION: StaticOperationSchema = ( + 23, + n0, + _CSa, + { + _smithy: MappingProxyType( + { + "method": "DELETE", + "uri": "/applications/{applicationId}/subscriptions/{subscriptionId}", + } ) - ], - members={ - "nextToken": {"target": NEXT_TOKEN}, - "applications": {"target": APPLICATIONS}, }, + CANCEL_SUBSCRIPTION_INPUT, + CANCEL_SUBSCRIPTION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -LIST_APPLICATIONS = Schema( - id=ShapeID("com.amazonaws.qbusiness#ListApplications"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType({"uri": "/applications", "method": "GET"}), - ) - ], +CHAT_MODE: StaticSchema = ( + 14, + n0, + _CM, + 0, + (_RM, _CM_, _PM), + ((-1, {_sV: _RM}), (-1, {_sV: _CM_}), (-1, {_sV: _PM})), ) -SECRET_ARN = Schema( - id=ShapeID("com.amazonaws.qbusiness#SecretArn"), shape_type=ShapeType.STRING -) +PLUGIN_CONFIGURATION: StaticSchema = (18, n0, _PCl, 0, (_pI,), ((PLUGIN_ID, 1),)) -BASIC_AUTH_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#BasicAuthConfiguration"), - members={ - "secretArn": { - "target": SECRET_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "roleArn": { - "target": ROLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +CHAT_MODE_CONFIGURATION: StaticSchema = ( + 19, + n0, + _CMCh, + 0, + (_pCl,), + ((PLUGIN_CONFIGURATION, 0),), ) -IDC_AUTH_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#IdcAuthConfiguration"), - members={ - "idcApplicationArn": { - "target": IDC_APPLICATION_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "roleArn": { - "target": ROLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +END_OF_INPUT_EVENT: StaticSchema = (18, n0, _EOIE, 0) -NO_AUTH_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#NoAuthConfiguration") -) +USER_MESSAGE: StaticSchema = (3, n0, _UM, 0) -URL = Schema(id=ShapeID("com.amazonaws.qbusiness#Url"), shape_type=ShapeType.STRING) +TEXT_INPUT_EVENT: StaticSchema = (18, n0, _TIE, 0, (_uM,), ((USER_MESSAGE, 1),)) -O_AUTH2_CLIENT_CREDENTIAL_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#OAuth2ClientCredentialConfiguration"), - members={ - "secretArn": { - "target": SECRET_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "roleArn": { - "target": ROLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "authorizationUrl": {"target": URL}, - "tokenUrl": {"target": URL}, - }, -) +USER_GROUPS: StaticSchema = (16, n0, _UG, 0, (_m,), ((STRING, 0),)) -PLUGIN_AUTH_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#PluginAuthConfiguration"), - shape_type=ShapeType.UNION, - members={ - "basicAuthConfiguration": {"target": BASIC_AUTH_CONFIGURATION}, - "oAuth2ClientCredentialConfiguration": { - "target": O_AUTH2_CLIENT_CREDENTIAL_CONFIGURATION - }, - "noAuthConfiguration": {"target": NO_AUTH_CONFIGURATION}, - "idcAuthConfiguration": {"target": IDC_AUTH_CONFIGURATION}, - }, +FAILED_ATTACHMENT_EVENT: StaticSchema = ( + 18, + n0, + _FAE, + 0, + (_cI, _uMI, _sMI, _at), + ((CONVERSATION_ID, 0), (MESSAGE_ID, 0), (MESSAGE_ID, 0), (ATTACHMENT_OUTPUT, 0)), ) -PLUGIN_DESCRIPTION = Schema( - id=ShapeID("com.amazonaws.qbusiness#PluginDescription"), shape_type=ShapeType.STRING -) +SOURCE_ATTRIBUTION_MEDIA_ID: StaticSchema = (3, n0, _SAMI, 0) -CUSTOM_PLUGIN_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#CustomPluginConfiguration"), - members={ - "description": { - "target": PLUGIN_DESCRIPTION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "apiSchemaType": { - "target": API_SCHEMA_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "apiSchema": {"target": API_SCHEMA}, - }, -) +SNIPPET_EXCERPT_TEXT: StaticSchema = (3, n0, _SET, 0) -PLUGIN_NAME = Schema( - id=ShapeID("com.amazonaws.qbusiness#PluginName"), shape_type=ShapeType.STRING -) +SNIPPET_EXCERPT: StaticSchema = (18, n0, _SEn, 0, (_te,), ((SNIPPET_EXCERPT_TEXT, 0),)) -CREATE_PLUGIN_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#CreatePluginInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#CreatePluginRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "displayName": { - "target": PLUGIN_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "type": { - "target": PLUGIN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "authConfiguration": { - "target": PLUGIN_AUTH_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "serverUrl": {"target": URL}, - "customPluginConfiguration": {"target": CUSTOM_PLUGIN_CONFIGURATION}, - "tags": {"target": TAGS}, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - }, +IMAGE_SOURCE_DETAILS: StaticSchema = ( + 18, + n0, + _ISD, + 0, + (_mI, _mMT), + ((MEDIA_ID, 0), (STRING, 0)), ) -PLUGIN_BUILD_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#PluginBuildStatus"), - shape_type=ShapeType.ENUM, - members={ - "READY": {"target": UNIT}, - "CREATE_IN_PROGRESS": {"target": UNIT}, - "CREATE_FAILED": {"target": UNIT}, - "UPDATE_IN_PROGRESS": {"target": UNIT}, - "UPDATE_FAILED": {"target": UNIT}, - "DELETE_IN_PROGRESS": {"target": UNIT}, - "DELETE_FAILED": {"target": UNIT}, - }, +VIDEO_EXTRACTION_TYPE: StaticSchema = ( + 14, + n0, + _VET, + 0, + (_TRANSCRIPT, _SUMMARY), + ((-1, {_sV: _TRANSCRIPT}), (-1, {_sV: _SUMMARY})), ) -PLUGIN_ARN = Schema( - id=ShapeID("com.amazonaws.qbusiness#PluginArn"), shape_type=ShapeType.STRING +VIDEO_SOURCE_DETAILS: StaticSchema = ( + 18, + n0, + _VSD, + 0, + (_mI, _mMT, _sTM, _eTM, _vET), + ((MEDIA_ID, 0), (STRING, 0), (LONG, 0), (LONG, 0), (VIDEO_EXTRACTION_TYPE, 0)), ) -CREATE_PLUGIN_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#CreatePluginOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#CreatePluginResponse", - ) - ], - members={ - "pluginId": {"target": PLUGIN_ID}, - "pluginArn": {"target": PLUGIN_ARN}, - "buildStatus": {"target": PLUGIN_BUILD_STATUS}, - }, +SOURCE_DETAILS: StaticSchema = ( + 19, + n0, + _SDo, + 0, + (_iSD, _aSD, _vSD), + ((IMAGE_SOURCE_DETAILS, 0), (AUDIO_SOURCE_DETAILS, 0), (VIDEO_SOURCE_DETAILS, 0)), ) -CREATE_PLUGIN = Schema( - id=ShapeID("com.amazonaws.qbusiness#CreatePlugin"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/applications/{applicationId}/plugins"} - ), - ) - ], +TEXT_SEGMENT: StaticSchema = ( + 18, + n0, + _TS, + 0, + (_bOe, _eO, _sEn, _mI, _mMT, _sD), + ( + (INTEGER, 0), + (INTEGER, 0), + (SNIPPET_EXCERPT, 0), + (SOURCE_ATTRIBUTION_MEDIA_ID, 0), + (STRING, 0), + (SOURCE_DETAILS, 0), + ), ) -DELETE_PLUGIN_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DeletePluginInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#DeletePluginRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "pluginId": { - "target": PLUGIN_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, +TEXT_SEGMENT_LIST: StaticSchema = (16, n0, _TSL, 0, (_m,), ((TEXT_SEGMENT, 0),)) + +SOURCE_ATTRIBUTION: StaticSchema = ( + 18, + n0, + _SAo, + 0, + (_ti, _sn, _ur, _cNi, _uA, _tMS, _dI, _iI, _dIa), + ( + (STRING, 0), + (STRING, 0), + (STRING, 0), + (INTEGER, 0), + (TIMESTAMP, 0), + (TEXT_SEGMENT_LIST, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + ), ) -DELETE_PLUGIN_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DeletePluginOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#DeletePluginResponse", - ) - ], -) - -DELETE_PLUGIN = Schema( - id=ShapeID("com.amazonaws.qbusiness#DeletePlugin"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/applications/{applicationId}/plugins/{pluginId}", - } - ), - ) - ], +SOURCE_ATTRIBUTIONS: StaticSchema = ( + 16, + n0, + _SAou, + 64, + (_m,), + ((SOURCE_ATTRIBUTION, 0),), +) + +METADATA_EVENT: StaticSchema = ( + 18, + n0, + _MEe, + 0, + (_cI, _uMI, _sMI, _sAo, _fTM), + ( + (CONVERSATION_ID, 0), + (MESSAGE_ID, 0), + (MESSAGE_ID, 0), + (SOURCE_ATTRIBUTIONS, 0), + (STRING, 0), + ), ) -GET_PLUGIN_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#GetPluginInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#GetPluginRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "pluginId": { - "target": PLUGIN_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, +SYSTEM_MESSAGE_TYPE: StaticSchema = ( + 14, + n0, + _SMT, + 0, + (_RESPONSE, _GR_), + ((-1, {_sV: _RESPONSE}), (-1, {_sV: _GR_})), +) + +TEXT_OUTPUT_EVENT: StaticSchema = ( + 18, + n0, + _TOE, + 0, + (_sMT, _cI, _uMI, _sMI, _sM), + ( + (SYSTEM_MESSAGE_TYPE, 0), + (CONVERSATION_ID, 0), + (MESSAGE_ID, 0), + (MESSAGE_ID, 0), + (STRING, 0), + ), ) -PLUGIN_STATE = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#PluginState"), - shape_type=ShapeType.ENUM, - members={"ENABLED": {"target": UNIT}, "DISABLED": {"target": UNIT}}, +CHAT_OUTPUT_STREAM: StaticSchema = ( + 19, + n0, + _COS, + {_smithyap: None}, + (_tE, _mE, _aRE, _fAE, _aCRE), + ( + (TEXT_OUTPUT_EVENT, 0), + (METADATA_EVENT, 0), + (ACTION_REVIEW_EVENT, 0), + (FAILED_ATTACHMENT_EVENT, 0), + (AUTH_CHALLENGE_REQUEST_EVENT, 0), + ), ) -GET_PLUGIN_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#GetPluginOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#GetPluginResponse", - ) - ], - members={ - "applicationId": {"target": APPLICATION_ID}, - "pluginId": {"target": PLUGIN_ID}, - "displayName": {"target": PLUGIN_NAME}, - "type": {"target": PLUGIN_TYPE}, - "serverUrl": {"target": URL}, - "authConfiguration": {"target": PLUGIN_AUTH_CONFIGURATION}, - "customPluginConfiguration": {"target": CUSTOM_PLUGIN_CONFIGURATION}, - "buildStatus": {"target": PLUGIN_BUILD_STATUS}, - "pluginArn": {"target": PLUGIN_ARN}, - "state": {"target": PLUGIN_STATE}, - "createdAt": {"target": TIMESTAMP}, - "updatedAt": {"target": TIMESTAMP}, - }, +CHAT_OUTPUT: StaticSchema = ( + 18, + n0, + _CO, + {_smith: None}, + (_oS,), + ((CHAT_OUTPUT_STREAM, 16),), ) -GET_PLUGIN = Schema( - id=ShapeID("com.amazonaws.qbusiness#GetPlugin"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/applications/{applicationId}/plugins/{pluginId}", - } - ), - ) - ], +EXTERNAL_RESOURCE_EXCEPTION: StaticSchema = ( + 18, + n0, + _ERE, + {_sm: _c, _sE: 424}, + (_me,), + ((ERROR_MESSAGE, 1),), ) -MAX_RESULTS_INTEGER_FOR_LIST_PLUGINS = Schema( - id=ShapeID("com.amazonaws.qbusiness#MaxResultsIntegerForListPlugins"), - shape_type=ShapeType.INTEGER, +LICENSE_NOT_FOUND_EXCEPTION: StaticSchema = ( + 18, + n0, + _LNFE, + {_sm: _c, _sE: 400}, + (_me,), + ((ERROR_MESSAGE, 1),), ) -LIST_PLUGINS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ListPluginsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#ListPluginsRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "maxResults": { - "target": MAX_RESULTS_INTEGER_FOR_LIST_PLUGINS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - }, -) +CHAT_RESPONSE_CONFIGURATION_ARN: StaticSchema = (3, n0, _CRCA, 0) -PLUGIN = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#Plugin"), - members={ - "pluginId": {"target": PLUGIN_ID}, - "displayName": {"target": PLUGIN_NAME}, - "type": {"target": PLUGIN_TYPE}, - "serverUrl": {"target": URL}, - "state": {"target": PLUGIN_STATE}, - "buildStatus": {"target": PLUGIN_BUILD_STATUS}, - "createdAt": {"target": TIMESTAMP}, - "updatedAt": {"target": TIMESTAMP}, - }, +CHAT_RESPONSE_CONFIGURATION_ID: StaticSchema = (3, n0, _CRCI, 0) + +DISPLAY_NAME: StaticSchema = (3, n0, _DN, 0) + +RESPONSE_CONFIGURATION_SUMMARY: StaticSchema = (3, n0, _RCS, 0) + +CHAT_RESPONSE_CONFIGURATION_STATUS: StaticSchema = ( + 14, + n0, + _CRCS, + 0, + (_CREATING, _UPDATING, _FAILED, _ACTIVE), + ( + (-1, {_sV: _CREATING}), + (-1, {_sV: _UPDATING}), + (-1, {_sV: _FAILED}), + (-1, {_sV: _ACTIVE}), + ), ) -PLUGINS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#Plugins"), - shape_type=ShapeType.LIST, - members={"member": {"target": PLUGIN}}, +CHAT_RESPONSE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _CRC, + 0, + (_cRCI, _cRCA, _dN, _rCS, _st, _cA, _uA), + ( + (CHAT_RESPONSE_CONFIGURATION_ID, 1), + (CHAT_RESPONSE_CONFIGURATION_ARN, 1), + (DISPLAY_NAME, 1), + (RESPONSE_CONFIGURATION_SUMMARY, 0), + (CHAT_RESPONSE_CONFIGURATION_STATUS, 1), + (TIMESTAMP, 0), + (TIMESTAMP, 0), + ), ) -LIST_PLUGINS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ListPluginsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#ListPluginsResponse", - ) - ], - members={"nextToken": {"target": NEXT_TOKEN}, "plugins": {"target": PLUGINS}}, -) - -LIST_PLUGINS = Schema( - id=ShapeID("com.amazonaws.qbusiness#ListPlugins"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/applications/{applicationId}/plugins"} - ), - ) - ], +RESPONSE_CONFIGURATION_TYPE: StaticSchema = ( + 14, + n0, + _RCT, + 0, + (_ALL,), + ((-1, {_sV: _ALL}),), +) + +INSTRUCTION: StaticSchema = (3, n0, _Ins, 0) + +INSTRUCTION_COLLECTION: StaticSchema = ( + 18, + n0, + _IC, + 0, + (_rL, _tA, _pe, _oSu, _id, _to, _cIu, _ex), + ( + (INSTRUCTION, 0), + (INSTRUCTION, 0), + (INSTRUCTION, 0), + (INSTRUCTION, 0), + (INSTRUCTION, 0), + (INSTRUCTION, 0), + (INSTRUCTION, 0), + (INSTRUCTION, 0), + ), ) -UPDATE_PLUGIN_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#UpdatePluginInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#UpdatePluginRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "pluginId": { - "target": PLUGIN_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "displayName": {"target": PLUGIN_NAME}, - "state": {"target": PLUGIN_STATE}, - "serverUrl": {"target": URL}, - "customPluginConfiguration": {"target": CUSTOM_PLUGIN_CONFIGURATION}, - "authConfiguration": {"target": PLUGIN_AUTH_CONFIGURATION}, - }, +RESPONSE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _RCe, + 0, + (_iCns,), + ((INSTRUCTION_COLLECTION, 0),), +) + +RESPONSE_CONFIGURATIONS: StaticSchema = ( + 17, + n0, + _RCes, + 0, + (_k, _v), + ((RESPONSE_CONFIGURATION_TYPE, 0), (RESPONSE_CONFIGURATION, 0)), +) + +CHAT_RESPONSE_CONFIGURATION_DETAIL: StaticSchema = ( + 18, + n0, + _CRCD, + 0, + (_rC, _rCS, _st, _e, _uA), + ( + (RESPONSE_CONFIGURATIONS, 0), + (STRING, 0), + (CHAT_RESPONSE_CONFIGURATION_STATUS, 0), + (ERROR_DETAIL, 0), + (TIMESTAMP, 0), + ), ) -UPDATE_PLUGIN_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#UpdatePluginOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#UpdatePluginResponse", - ) - ], -) - -UPDATE_PLUGIN = Schema( - id=ShapeID("com.amazonaws.qbusiness#UpdatePlugin"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PUT", - "uri": "/applications/{applicationId}/plugins/{pluginId}", - } - ), - ) - ], +CHAT_RESPONSE_CONFIGURATIONS: StaticSchema = ( + 16, + n0, + _CRCh, + 0, + (_m,), + ((CHAT_RESPONSE_CONFIGURATION, 0),), +) + +CHAT_SYNC_OUTPUT: StaticSchema = ( + 18, + n0, + _CSOh, + {_smith: None}, + (_cI, _sM, _sMI, _uMI, _aR, _aCR, _sAo, _fA), + ( + (CONVERSATION_ID, 0), + (STRING, 0), + (MESSAGE_ID, 0), + (MESSAGE_ID, 0), + (ACTION_REVIEW, 0), + (AUTH_CHALLENGE_REQUEST, 0), + (SOURCE_ATTRIBUTIONS, 0), + (ATTACHMENTS_OUTPUT, 0), + ), ) -KENDRA_INDEX_ID = Schema( - id=ShapeID("com.amazonaws.qbusiness#KendraIndexId"), shape_type=ShapeType.STRING +CHECK_DOCUMENT_ACCESS_INPUT: StaticSchema = ( + 18, + n0, + _CDAI, + {_sSI: _cCDARo, _smit: None}, + (_aIp, _iI, _uI, _dI, _dSI), + ( + (APPLICATION_ID, 9), + (INDEX_ID, 9), + (STRING, 9), + (DOCUMENT_ID, 9), + (DATA_SOURCE_ID, {_sQ: _dSI}), + ), ) -KENDRA_INDEX_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#KendraIndexConfiguration"), - members={ - "indexId": { - "target": KENDRA_INDEX_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +DOCUMENT_ACL_GROUP: StaticSchema = ( + 18, + n0, + _DAG, + 0, + (_n, _t), + ((GROUP_NAME, 0), (MEMBERSHIP_TYPE, 0)), +) + +DOCUMENT_ACL_GROUPS: StaticSchema = ( + 16, + n0, + _DAGo, + 0, + (_m,), + ((DOCUMENT_ACL_GROUP, 0),), +) + +DOCUMENT_ACL_USER: StaticSchema = ( + 18, + n0, + _DAU, + 0, + (_i, _t), + ((STRING, 0), (MEMBERSHIP_TYPE, 0)), +) + +DOCUMENT_ACL_USERS: StaticSchema = (16, n0, _DAUo, 0, (_m,), ((DOCUMENT_ACL_USER, 0),)) + +DOCUMENT_ACL_CONDITION: StaticSchema = ( + 18, + n0, + _DACocu, + 0, + (_mR, _us, _gr), + ((MEMBER_RELATION, 0), (DOCUMENT_ACL_USERS, 0), (DOCUMENT_ACL_GROUPS, 0)), +) + +DOCUMENT_ACL_CONDITIONS: StaticSchema = ( + 16, + n0, + _DACocum, + 0, + (_m,), + ((DOCUMENT_ACL_CONDITION, 0),), +) + +DOCUMENT_ACL_MEMBERSHIP: StaticSchema = ( + 18, + n0, + _DAM, + 0, + (_mR, _cond), + ((MEMBER_RELATION, 0), (DOCUMENT_ACL_CONDITIONS, 0)), +) + +DOCUMENT_ACL: StaticSchema = ( + 18, + n0, + _DAoc, + 0, + (_al, _dL), + ((DOCUMENT_ACL_MEMBERSHIP, 0), (DOCUMENT_ACL_MEMBERSHIP, 0)), +) + +CHECK_DOCUMENT_ACCESS_OUTPUT: StaticSchema = ( + 18, + n0, + _CDAOh, + {_sSI: _cCDARom, _smith: None}, + (_uG, _uAs, _hA, _dAo), + ((ASSOCIATED_GROUPS, 0), (ASSOCIATED_USERS, 0), (2, 0), (DOCUMENT_ACL, 0)), +) + +CHECK_DOCUMENT_ACCESS: StaticOperationSchema = ( + 23, + n0, + _CDA, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/applications/{applicationId}/index/{indexId}/users/{userId}/documents/{documentId}/check-document-access", + } + ) + }, + CHECK_DOCUMENT_ACCESS_INPUT, + CHECK_DOCUMENT_ACCESS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -BOOSTING_DURATION_IN_SECONDS = Schema( - id=ShapeID("com.amazonaws.qbusiness#BoostingDurationInSeconds"), - shape_type=ShapeType.LONG, +CONTENT_BLOCKER_RULE: StaticSchema = ( + 18, + n0, + _CBR, + 0, + (_sMO,), + ((SYSTEM_MESSAGE_OVERRIDE, 0),), +) + +ELIGIBLE_DATA_SOURCE: StaticSchema = ( + 18, + n0, + _EDS, + 0, + (_iI, _dSI), + ((INDEX_ID, 0), (DATA_SOURCE_ID, 0)), +) + +ELIGIBLE_DATA_SOURCES: StaticSchema = ( + 16, + n0, + _EDSl, + 0, + (_m,), + ((ELIGIBLE_DATA_SOURCE, 0),), +) + +CONTENT_RETRIEVAL_RULE: StaticSchema = ( + 18, + n0, + _CRR, + 0, + (_eDS,), + ((ELIGIBLE_DATA_SOURCES, 0),), +) + +RETRIEVER_CONTENT_SOURCE: StaticSchema = ( + 18, + n0, + _RCSe, + 0, + (_rIe,), + ((RETRIEVER_ID, 1),), +) + +CONTENT_SOURCE: StaticSchema = ( + 19, + n0, + _CSo, + 0, + (_retr,), + ((RETRIEVER_CONTENT_SOURCE, 0),), +) + +CONVERSATION_TITLE: StaticSchema = (3, n0, _CTon, 0) + +CONVERSATION: StaticSchema = ( + 18, + n0, + _C, + 0, + (_cI, _ti, _sTt), + ((CONVERSATION_ID, 0), (CONVERSATION_TITLE, 0), (TIMESTAMP, 0)), +) + +CONVERSATIONS: StaticSchema = (16, n0, _Co, 0, (_m,), ((CONVERSATION, 0),)) + +SESSION_DURATION_IN_MINUTES: StaticSchema = (7, n0, _SDIM, 0) + +CREATE_ANONYMOUS_WEB_EXPERIENCE_URL_INPUT: StaticSchema = ( + 18, + n0, + _CAWEUI, + {_sSI: _cCAWEUR, _smit: None}, + (_aIp, _wEI, _sDIM), + ((APPLICATION_ID, 9), (WEB_EXPERIENCE_ID, 9), (SESSION_DURATION_IN_MINUTES, 0)), +) + +CREATE_ANONYMOUS_WEB_EXPERIENCE_URL_OUTPUT: StaticSchema = ( + 18, + n0, + _CAWEUO, + {_sSI: _cCAWEURo, _smith: None}, + (_aUn,), + ((URL, 0),), +) + +CREATE_ANONYMOUS_WEB_EXPERIENCE_URL: StaticOperationSchema = ( + 23, + n0, + _CAWEU, + { + _smithy: MappingProxyType( + { + "uri": "/applications/{applicationId}/experiences/{webExperienceId}/anonymous-url", + "method": "POST", + } + ) + }, + CREATE_ANONYMOUS_WEB_EXPERIENCE_URL_INPUT, + CREATE_ANONYMOUS_WEB_EXPERIENCE_URL_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -DOCUMENT_ATTRIBUTE_BOOSTING_LEVEL = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DocumentAttributeBoostingLevel"), - shape_type=ShapeType.ENUM, - members={ - "NONE": {"target": UNIT}, - "LOW": {"target": UNIT}, - "MEDIUM": {"target": UNIT}, - "HIGH": {"target": UNIT}, - "VERY_HIGH": {"target": UNIT}, - "ONE": {"target": UNIT}, - "TWO": {"target": UNIT}, - }, +CREATE_CHAT_RESPONSE_CONFIGURATION_INPUT: StaticSchema = ( + 18, + n0, + _CCRCI, + {_sSI: _cCCRCR, _smit: None}, + (_aIp, _dN, _cT, _rC, _ta), + ( + (APPLICATION_ID, 9), + (DISPLAY_NAME, 1), + (STRING, 2), + (RESPONSE_CONFIGURATIONS, 1), + (TAGS, 0), + ), ) -DATE_ATTRIBUTE_BOOSTING_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DateAttributeBoostingConfiguration"), - members={ - "boostingLevel": { - "target": DOCUMENT_ATTRIBUTE_BOOSTING_LEVEL, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "boostingDurationInSeconds": {"target": BOOSTING_DURATION_IN_SECONDS}, - }, +CREATE_CHAT_RESPONSE_CONFIGURATION_OUTPUT: StaticSchema = ( + 18, + n0, + _CCRCO, + {_sSI: _cCCRCRo, _smith: None}, + (_cRCI, _cRCA), + ((CHAT_RESPONSE_CONFIGURATION_ID, 1), (CHAT_RESPONSE_CONFIGURATION_ARN, 1)), +) + +CREATE_CHAT_RESPONSE_CONFIGURATION: StaticOperationSchema = ( + 23, + n0, + _CCRC, + { + _smithy: MappingProxyType( + { + "method": "POST", + "uri": "/applications/{applicationId}/chatresponseconfigurations", + } + ) + }, + CREATE_CHAT_RESPONSE_CONFIGURATION_INPUT, + CREATE_CHAT_RESPONSE_CONFIGURATION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -NUMBER_ATTRIBUTE_BOOSTING_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#NumberAttributeBoostingType"), - shape_type=ShapeType.ENUM, - members={ - "PRIORITIZE_LARGER_VALUES": {"target": UNIT}, - "PRIORITIZE_SMALLER_VALUES": {"target": UNIT}, - }, +GROUP_IDENTIFIER: StaticSchema = (3, n0, _GIr, 0) + +USER_IDENTIFIER: StaticSchema = (3, n0, _UIs, 0) + +SUBSCRIPTION_PRINCIPAL: StaticSchema = ( + 19, + n0, + _SP, + 0, + (_u, _g), + ((USER_IDENTIFIER, 0), (GROUP_IDENTIFIER, 0)), ) -NUMBER_ATTRIBUTE_BOOSTING_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#NumberAttributeBoostingConfiguration"), - members={ - "boostingLevel": { - "target": DOCUMENT_ATTRIBUTE_BOOSTING_LEVEL, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "boostingType": {"target": NUMBER_ATTRIBUTE_BOOSTING_TYPE}, - }, +CREATE_SUBSCRIPTION_INPUT: StaticSchema = ( + 18, + n0, + _CSIr, + {_sSI: _cCSRom, _smit: None}, + (_aIp, _pr, _t, _cT), + ( + (APPLICATION_ID, 9), + (SUBSCRIPTION_PRINCIPAL, 1), + (SUBSCRIPTION_TYPE, 1), + (CLIENT_TOKEN, 2), + ), ) -STRING_ATTRIBUTE_VALUE_BOOSTING_LEVEL = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#StringAttributeValueBoostingLevel"), - shape_type=ShapeType.ENUM, - members={ - "LOW": {"target": UNIT}, - "MEDIUM": {"target": UNIT}, - "HIGH": {"target": UNIT}, - "VERY_HIGH": {"target": UNIT}, - "ONE": {"target": UNIT}, - "TWO": {"target": UNIT}, - "THREE": {"target": UNIT}, - "FOUR": {"target": UNIT}, - "FIVE": {"target": UNIT}, - }, +CREATE_SUBSCRIPTION_OUTPUT: StaticSchema = ( + 18, + n0, + _CSOr, + {_sSI: _cCSRoma, _smith: None}, + (_sIu, _sAu, _cS, _nS), + ( + (SUBSCRIPTION_ID, 0), + (SUBSCRIPTION_ARN, 0), + (SUBSCRIPTION_DETAILS, 0), + (SUBSCRIPTION_DETAILS, 0), + ), ) -STRING_ATTRIBUTE_VALUE_BOOSTING = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#StringAttributeValueBoosting"), - shape_type=ShapeType.MAP, - members={ - "key": {"target": STRING}, - "value": {"target": STRING_ATTRIBUTE_VALUE_BOOSTING_LEVEL}, - }, +CREATE_SUBSCRIPTION: StaticOperationSchema = ( + 23, + n0, + _CSr, + { + _smithy: MappingProxyType( + {"method": "POST", "uri": "/applications/{applicationId}/subscriptions"} + ) + }, + CREATE_SUBSCRIPTION_INPUT, + CREATE_SUBSCRIPTION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -STRING_ATTRIBUTE_BOOSTING_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#StringAttributeBoostingConfiguration"), - members={ - "boostingLevel": { - "target": DOCUMENT_ATTRIBUTE_BOOSTING_LEVEL, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "attributeValueBoosting": {"target": STRING_ATTRIBUTE_VALUE_BOOSTING}, - }, +USER_ALIAS: StaticSchema = ( + 18, + n0, + _UAs, + 0, + (_iI, _dSI, _uI), + ((INDEX_ID, 0), (DATA_SOURCE_ID, 0), (STRING, 1)), ) -STRING_LIST_ATTRIBUTE_BOOSTING_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#StringListAttributeBoostingConfiguration"), - members={ - "boostingLevel": { - "target": DOCUMENT_ATTRIBUTE_BOOSTING_LEVEL, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +USER_ALIASES: StaticSchema = (16, n0, _UAse, 0, (_m,), ((USER_ALIAS, 0),)) + +CREATE_USER_INPUT: StaticSchema = ( + 18, + n0, + _CUI, + {_sSI: _cCUR, _smit: None}, + (_aIp, _uI, _uAs, _cT), + ((APPLICATION_ID, 9), (STRING, 1), (USER_ALIASES, 0), (CLIENT_TOKEN, 2)), ) -DOCUMENT_ATTRIBUTE_BOOSTING_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DocumentAttributeBoostingConfiguration"), - shape_type=ShapeType.UNION, - members={ - "numberConfiguration": {"target": NUMBER_ATTRIBUTE_BOOSTING_CONFIGURATION}, - "stringConfiguration": {"target": STRING_ATTRIBUTE_BOOSTING_CONFIGURATION}, - "dateConfiguration": {"target": DATE_ATTRIBUTE_BOOSTING_CONFIGURATION}, - "stringListConfiguration": { - "target": STRING_LIST_ATTRIBUTE_BOOSTING_CONFIGURATION - }, +CREATE_USER_OUTPUT: StaticSchema = (18, n0, _CUO, {_sSI: _cCURo, _smith: None}) + +CREATE_USER: StaticOperationSchema = ( + 23, + n0, + _CU, + { + _smithy: MappingProxyType( + {"method": "POST", "uri": "/applications/{applicationId}/users"} + ) }, + CREATE_USER_INPUT, + CREATE_USER_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -DOCUMENT_ATTRIBUTE_BOOSTING_OVERRIDE_MAP = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DocumentAttributeBoostingOverrideMap"), - shape_type=ShapeType.MAP, - members={ - "key": {"target": DOCUMENT_ATTRIBUTE_KEY}, - "value": {"target": DOCUMENT_ATTRIBUTE_BOOSTING_CONFIGURATION}, - }, +CREATOR_MODE_CONFIGURATION: StaticSchema = ( + 18, + n0, + _CMCr, + 0, + (_cMC,), + ((CREATOR_MODE_CONTROL, 1),), ) -NATIVE_INDEX_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#NativeIndexConfiguration"), - members={ - "indexId": { - "target": INDEX_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "version": {"target": LONG}, - "boostingOverride": {"target": DOCUMENT_ATTRIBUTE_BOOSTING_OVERRIDE_MAP}, - }, +DATA_SOURCE_IDS: StaticSchema = (16, n0, _DSIa, 0, (_m,), ((DATA_SOURCE_ID, 0),)) + +METRIC_VALUE: StaticSchema = (3, n0, _MV, 0) + +DATA_SOURCE_SYNC_JOB_METRICS: StaticSchema = ( + 18, + n0, + _DSSJM, + 0, + (_dAoc, _dM, _dDo, _dF, _dSo), + ( + (METRIC_VALUE, 0), + (METRIC_VALUE, 0), + (METRIC_VALUE, 0), + (METRIC_VALUE, 0), + (METRIC_VALUE, 0), + ), ) -RETRIEVER_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#RetrieverConfiguration"), - shape_type=ShapeType.UNION, - members={ - "nativeIndexConfiguration": {"target": NATIVE_INDEX_CONFIGURATION}, - "kendraIndexConfiguration": {"target": KENDRA_INDEX_CONFIGURATION}, - }, +DATA_SOURCE_SYNC_JOB_STATUS: StaticSchema = ( + 14, + n0, + _DSSJS, + 0, + (_FAILED, _SUCCEEDED, _SYNCING, _INCOMPLETE, _STOPPING, _ABORTED, _SI_), + ( + (-1, {_sV: _FAILED}), + (-1, {_sV: _SUCCEEDED}), + (-1, {_sV: _SYNCING}), + (-1, {_sV: _INCOMPLETE}), + (-1, {_sV: _STOPPING}), + (-1, {_sV: _ABORTED}), + (-1, {_sV: _SI_}), + ), ) -RETRIEVER_NAME = Schema( - id=ShapeID("com.amazonaws.qbusiness#RetrieverName"), shape_type=ShapeType.STRING +DATA_SOURCE_SYNC_JOB: StaticSchema = ( + 18, + n0, + _DSSJ, + 0, + (_eIx, _sTt, _eT, _st, _e, _dSEC, _met), + ( + (EXECUTION_ID, 0), + (TIMESTAMP, 0), + (TIMESTAMP, 0), + (DATA_SOURCE_SYNC_JOB_STATUS, 0), + (ERROR_DETAIL, 0), + (STRING, 0), + (DATA_SOURCE_SYNC_JOB_METRICS, 0), + ), ) -RETRIEVER_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#RetrieverType"), - shape_type=ShapeType.ENUM, - members={"NATIVE_INDEX": {"target": UNIT}, "KENDRA_INDEX": {"target": UNIT}}, +DATA_SOURCE_SYNC_JOBS: StaticSchema = ( + 16, + n0, + _DSSJa, + 0, + (_m,), + ((DATA_SOURCE_SYNC_JOB, 0),), +) + +DATA_SOURCE_USER_ID: StaticSchema = (3, n0, _DSUI, 0) + +DELETE_ATTACHMENT_INPUT: StaticSchema = ( + 18, + n0, + _DAIel, + {_sSI: _cDARom, _smit: None}, + (_aIp, _cI, _aIt, _uI), + ( + (APPLICATION_ID, 9), + (CONVERSATION_ID, 9), + (ATTACHMENT_ID, 9), + (USER_ID, {_sQ: _uI}), + ), ) -CREATE_RETRIEVER_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#CreateRetrieverInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#CreateRetrieverRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "type": { - "target": RETRIEVER_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "displayName": { - "target": RETRIEVER_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "configuration": { - "target": RETRIEVER_CONFIGURATION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "roleArn": {"target": ROLE_ARN}, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "tags": {"target": TAGS}, - }, +DELETE_ATTACHMENT_OUTPUT: StaticSchema = (18, n0, _DAOe, {_sSI: _cDARoma, _smith: None}) + +DELETE_ATTACHMENT: StaticOperationSchema = ( + 23, + n0, + _DAel, + { + _smithy: MappingProxyType( + { + "uri": "/applications/{applicationId}/conversations/{conversationId}/attachments/{attachmentId}", + "method": "DELETE", + } + ) + }, + DELETE_ATTACHMENT_INPUT, + DELETE_ATTACHMENT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + LICENSE_NOT_FOUND_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -RETRIEVER_ARN = Schema( - id=ShapeID("com.amazonaws.qbusiness#RetrieverArn"), shape_type=ShapeType.STRING +DELETE_CHAT_CONTROLS_CONFIGURATION_INPUT: StaticSchema = ( + 18, + n0, + _DCCCI, + {_sSI: _cDCCCR, _smit: None}, + (_aIp,), + ((APPLICATION_ID, 9),), +) + +DELETE_CHAT_CONTROLS_CONFIGURATION_OUTPUT: StaticSchema = ( + 18, + n0, + _DCCCO, + {_sSI: _cDCCCRo, _smith: None}, +) + +DELETE_CHAT_CONTROLS_CONFIGURATION: StaticOperationSchema = ( + 23, + n0, + _DCCC, + { + _smithy: MappingProxyType( + { + "uri": "/applications/{applicationId}/chatcontrols", + "method": "DELETE", + "code": 200, + } + ) + }, + DELETE_CHAT_CONTROLS_CONFIGURATION_INPUT, + DELETE_CHAT_CONTROLS_CONFIGURATION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -RETRIEVER_ID = Schema( - id=ShapeID("com.amazonaws.qbusiness#RetrieverId"), shape_type=ShapeType.STRING +DELETE_CHAT_RESPONSE_CONFIGURATION_INPUT: StaticSchema = ( + 18, + n0, + _DCRCI, + {_sSI: _cDCRCR, _smit: None}, + (_aIp, _cRCI), + ((APPLICATION_ID, 9), (CHAT_RESPONSE_CONFIGURATION_ID, 9)), +) + +DELETE_CHAT_RESPONSE_CONFIGURATION_OUTPUT: StaticSchema = ( + 18, + n0, + _DCRCO, + {_sSI: _cDCRCRo, _smith: None}, +) + +DELETE_CHAT_RESPONSE_CONFIGURATION: StaticOperationSchema = ( + 23, + n0, + _DCRC, + { + _smithy: MappingProxyType( + { + "method": "DELETE", + "uri": "/applications/{applicationId}/chatresponseconfigurations/{chatResponseConfigurationId}", + } + ) + }, + DELETE_CHAT_RESPONSE_CONFIGURATION_INPUT, + DELETE_CHAT_RESPONSE_CONFIGURATION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CREATE_RETRIEVER_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#CreateRetrieverOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#CreateRetrieverResponse", - ) - ], - members={ - "retrieverId": {"target": RETRIEVER_ID}, - "retrieverArn": {"target": RETRIEVER_ARN}, - }, +DELETE_CONVERSATION_INPUT: StaticSchema = ( + 18, + n0, + _DCI, + {_sSI: _cDCR, _smit: None}, + (_cI, _aIp, _uI), + ((CONVERSATION_ID, 9), (APPLICATION_ID, 9), (USER_ID, {_sQ: _uI})), +) + +DELETE_CONVERSATION_OUTPUT: StaticSchema = (18, n0, _DCOe, {_sSI: _cDCRo, _smith: None}) + +DELETE_CONVERSATION: StaticOperationSchema = ( + 23, + n0, + _DCe, + { + _smithy: MappingProxyType( + { + "uri": "/applications/{applicationId}/conversations/{conversationId}", + "method": "DELETE", + } + ) + }, + DELETE_CONVERSATION_INPUT, + DELETE_CONVERSATION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + LICENSE_NOT_FOUND_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CREATE_RETRIEVER = Schema( - id=ShapeID("com.amazonaws.qbusiness#CreateRetriever"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/applications/{applicationId}/retrievers"} - ), - ) - ], +DELETE_GROUP_INPUT: StaticSchema = ( + 18, + n0, + _DGI, + {_sSI: _cDGR, _smit: None}, + (_aIp, _iI, _gN, _dSI), + ( + (APPLICATION_ID, 9), + (INDEX_ID, 9), + (GROUP_NAME, 9), + (DATA_SOURCE_ID, {_sQ: _dSI}), + ), ) -DELETE_RETRIEVER_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DeleteRetrieverInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#DeleteRetrieverRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "retrieverId": { - "target": RETRIEVER_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, +DELETE_GROUP_OUTPUT: StaticSchema = (18, n0, _DGO, {_sSI: _cDGRo, _smith: None}) + +DELETE_GROUP: StaticOperationSchema = ( + 23, + n0, + _DG, + { + _smithy: MappingProxyType( + { + "method": "DELETE", + "uri": "/applications/{applicationId}/indices/{indexId}/groups/{groupName}", + } + ) + }, + DELETE_GROUP_INPUT, + DELETE_GROUP_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -DELETE_RETRIEVER_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DeleteRetrieverOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#DeleteRetrieverResponse", - ) - ], -) - -DELETE_RETRIEVER = Schema( - id=ShapeID("com.amazonaws.qbusiness#DeleteRetriever"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/applications/{applicationId}/retrievers/{retrieverId}", - } - ), - ) - ], +DELETE_USER_INPUT: StaticSchema = ( + 18, + n0, + _DUI, + {_sSI: _cDUR, _smit: None}, + (_aIp, _uI), + ((APPLICATION_ID, 9), (STRING, 9)), ) -GET_RETRIEVER_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#GetRetrieverInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#GetRetrieverRequest", +DELETE_USER_OUTPUT: StaticSchema = (18, n0, _DUO, {_sSI: _cDURo, _smith: None}) + +DELETE_USER: StaticOperationSchema = ( + 23, + n0, + _DU, + { + _smithy: MappingProxyType( + {"method": "DELETE", "uri": "/applications/{applicationId}/users/{userId}"} ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "retrieverId": { - "target": RETRIEVER_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, }, + DELETE_USER_INPUT, + DELETE_USER_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -RETRIEVER_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#RetrieverStatus"), - shape_type=ShapeType.ENUM, - members={ - "CREATING": {"target": UNIT}, - "ACTIVE": {"target": UNIT}, - "FAILED": {"target": UNIT}, - }, +DISASSOCIATE_PERMISSION_INPUT: StaticSchema = ( + 18, + n0, + _DPIi, + {_sSI: _cDPRom, _smit: None}, + (_aIp, _sIt), + ((APPLICATION_ID, 9), (STRING, 9)), +) + +DISASSOCIATE_PERMISSION_OUTPUT: StaticSchema = ( + 18, + n0, + _DPOi, + {_sSI: _cDPRoma, _smith: None}, +) + +DISASSOCIATE_PERMISSION: StaticOperationSchema = ( + 23, + n0, + _DPi, + { + _smithy: MappingProxyType( + { + "uri": "/applications/{applicationId}/policy/{statementId}", + "method": "DELETE", + } + ) + }, + DISASSOCIATE_PERMISSION_INPUT, + DISASSOCIATE_PERMISSION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -GET_RETRIEVER_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#GetRetrieverOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#GetRetrieverResponse", - ) - ], - members={ - "applicationId": {"target": APPLICATION_ID}, - "retrieverId": {"target": RETRIEVER_ID}, - "retrieverArn": {"target": RETRIEVER_ARN}, - "type": {"target": RETRIEVER_TYPE}, - "status": {"target": RETRIEVER_STATUS}, - "displayName": {"target": RETRIEVER_NAME}, - "configuration": {"target": RETRIEVER_CONFIGURATION}, - "roleArn": {"target": ROLE_ARN}, - "createdAt": {"target": TIMESTAMP}, - "updatedAt": {"target": TIMESTAMP}, - }, +DOCUMENT_STATUS: StaticSchema = ( + 14, + n0, + _DSo, + 0, + (_RECEIVED, _PROCESSING, _INDEXED, _UPDATED, _FAILED, _DELETING, _DELETED, _DFTI), + ( + (-1, {_sV: _RECEIVED}), + (-1, {_sV: _PROCESSING}), + (-1, {_sV: _INDEXED}), + (-1, {_sV: _UPDATED}), + (-1, {_sV: _FAILED}), + (-1, {_sV: _DELETING}), + (-1, {_sV: _DELETED}), + (-1, {_sV: _DFTI}), + ), ) -GET_RETRIEVER = Schema( - id=ShapeID("com.amazonaws.qbusiness#GetRetriever"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/applications/{applicationId}/retrievers/{retrieverId}", - } - ), - ) - ], +DOCUMENT_DETAILS: StaticSchema = ( + 18, + n0, + _DDo, + 0, + (_dI, _st, _e, _cA, _uA), + ( + (DOCUMENT_ID, 0), + (DOCUMENT_STATUS, 0), + (ERROR_DETAIL, 0), + (TIMESTAMP, 0), + (TIMESTAMP, 0), + ), ) -MAX_RESULTS_INTEGER_FOR_LIST_RETRIEVERS_REQUEST = Schema( - id=ShapeID("com.amazonaws.qbusiness#MaxResultsIntegerForListRetrieversRequest"), - shape_type=ShapeType.INTEGER, +DOCUMENT_DETAIL_LIST: StaticSchema = (16, n0, _DDL, 0, (_m,), ((DOCUMENT_DETAILS, 0),)) + +EXAMPLE_CHAT_MESSAGE: StaticSchema = (3, n0, _ECM, 0) + +EXAMPLE_CHAT_MESSAGES: StaticSchema = ( + 16, + n0, + _ECMx, + 0, + (_m,), + ((EXAMPLE_CHAT_MESSAGE, 0),), ) -LIST_RETRIEVERS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ListRetrieversInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#ListRetrieversRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "maxResults": { - "target": MAX_RESULTS_INTEGER_FOR_LIST_RETRIEVERS_REQUEST, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - }, +MAX_RESULTS_INTEGER_FOR_GET_TOPIC_CONFIGURATIONS: StaticSchema = (7, n0, _MRIFGTC, 0) + +GET_CHAT_CONTROLS_CONFIGURATION_INPUT: StaticSchema = ( + 18, + n0, + _GCCCI, + {_sSI: _cGCCCR, _smit: None}, + (_aIp, _mRa, _nT), + ( + (APPLICATION_ID, 9), + (MAX_RESULTS_INTEGER_FOR_GET_TOPIC_CONFIGURATIONS, {_sQ: _mRa}), + (NEXT_TOKEN, {_sQ: _nT}), + ), ) -RETRIEVER = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#Retriever"), - members={ - "applicationId": {"target": APPLICATION_ID}, - "retrieverId": {"target": RETRIEVER_ID}, - "type": {"target": RETRIEVER_TYPE}, - "status": {"target": RETRIEVER_STATUS}, - "displayName": {"target": RETRIEVER_NAME}, - }, +HALLUCINATION_REDUCTION_CONTROL: StaticSchema = ( + 14, + n0, + _HRC, + 0, + (_ENABLED, _DISABLED), + ((-1, {_sV: _ENABLED}), (-1, {_sV: _DISABLED})), +) + +HALLUCINATION_REDUCTION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _HRCa, + 0, + (_hRC,), + ((HALLUCINATION_REDUCTION_CONTROL, 0),), +) + +RESPONSE_SCOPE: StaticSchema = ( + 14, + n0, + _RSe, + 0, + (_ECO, _EKE), + ((-1, {_sV: _ECO}), (-1, {_sV: _EKE})), +) + +TOPIC_DESCRIPTION: StaticSchema = (3, n0, _TD, 0) + +TOPIC_CONFIGURATION_NAME: StaticSchema = (3, n0, _TCN, 0) + +USER_IDS: StaticSchema = (16, n0, _UIse, 0, (_m,), ((STRING, 0),)) + +USERS_AND_GROUPS: StaticSchema = ( + 18, + n0, + _UAG, + 0, + (_uIs, _uG), + ((USER_IDS, 0), (USER_GROUPS, 0)), +) + +RULE_CONFIGURATION: StaticSchema = ( + 19, + n0, + _RCu, + 0, + (_cBR, _cRR), + ((CONTENT_BLOCKER_RULE, 0), (CONTENT_RETRIEVAL_RULE, 0)), +) + +RULE_TYPE: StaticSchema = ( + 14, + n0, + _RTu, + 0, + (_CBR_, _CRR_), + ((-1, {_sV: _CBR_}), (-1, {_sV: _CRR_})), +) + +RULE: StaticSchema = ( + 18, + n0, + _Ru, + 0, + (_iUAG, _eUAG, _rTu, _rCu), + ( + (USERS_AND_GROUPS, 0), + (USERS_AND_GROUPS, 0), + (RULE_TYPE, 1), + (RULE_CONFIGURATION, 0), + ), ) -RETRIEVERS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#Retrievers"), - shape_type=ShapeType.LIST, - members={"member": {"target": RETRIEVER}}, +RULES: StaticSchema = (16, n0, _Rul, 0, (_m,), ((RULE, 0),)) + +TOPIC_CONFIGURATION: StaticSchema = ( + 18, + n0, + _TC, + 0, + (_n, _d, _eCM, _ru), + ( + (TOPIC_CONFIGURATION_NAME, 1), + (TOPIC_DESCRIPTION, 0), + (EXAMPLE_CHAT_MESSAGES, 0), + (RULES, 1), + ), ) -LIST_RETRIEVERS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ListRetrieversOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#ListRetrieversResponse", - ) - ], - members={"retrievers": {"target": RETRIEVERS}, "nextToken": {"target": NEXT_TOKEN}}, -) - -LIST_RETRIEVERS = Schema( - id=ShapeID("com.amazonaws.qbusiness#ListRetrievers"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"uri": "/applications/{applicationId}/retrievers", "method": "GET"} - ), - ) - ], +TOPIC_CONFIGURATIONS: StaticSchema = ( + 16, + n0, + _TCo, + 0, + (_m,), + ((TOPIC_CONFIGURATION, 0),), +) + +GET_CHAT_CONTROLS_CONFIGURATION_OUTPUT: StaticSchema = ( + 18, + n0, + _GCCCO, + {_sSI: _cGCCCRo, _smith: None}, + (_rS, _oC, _bP, _tC, _cMCr, _nT, _hRCa), + ( + (RESPONSE_SCOPE, 0), + (APPLIED_ORCHESTRATION_CONFIGURATION, 0), + (BLOCKED_PHRASES_CONFIGURATION, 0), + (TOPIC_CONFIGURATIONS, 0), + (APPLIED_CREATOR_MODE_CONFIGURATION, 0), + (NEXT_TOKEN, 0), + (HALLUCINATION_REDUCTION_CONFIGURATION, 0), + ), ) -UPDATE_RETRIEVER_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#UpdateRetrieverInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#UpdateRetrieverRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "retrieverId": { - "target": RETRIEVER_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "configuration": {"target": RETRIEVER_CONFIGURATION}, - "displayName": {"target": RETRIEVER_NAME}, - "roleArn": {"target": ROLE_ARN}, - }, +GET_CHAT_CONTROLS_CONFIGURATION: StaticOperationSchema = ( + 23, + n0, + _GCCC, + { + _smithy: MappingProxyType( + { + "uri": "/applications/{applicationId}/chatcontrols", + "method": "GET", + "code": 200, + } + ) + }, + GET_CHAT_CONTROLS_CONFIGURATION_INPUT, + GET_CHAT_CONTROLS_CONFIGURATION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -UPDATE_RETRIEVER_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#UpdateRetrieverOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#UpdateRetrieverResponse", - ) - ], -) - -UPDATE_RETRIEVER = Schema( - id=ShapeID("com.amazonaws.qbusiness#UpdateRetriever"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PUT", - "uri": "/applications/{applicationId}/retrievers/{retrieverId}", - } - ), - ) - ], +GET_CHAT_RESPONSE_CONFIGURATION_INPUT: StaticSchema = ( + 18, + n0, + _GCRCI, + {_sSI: _cGCRCR, _smit: None}, + (_aIp, _cRCI), + ((APPLICATION_ID, 9), (CHAT_RESPONSE_CONFIGURATION_ID, 9)), +) + +GET_CHAT_RESPONSE_CONFIGURATION_OUTPUT: StaticSchema = ( + 18, + n0, + _GCRCO, + {_sSI: _cGCRCRo, _smith: None}, + (_cRCI, _cRCA, _dN, _cA, _iUC, _lUC), + ( + (CHAT_RESPONSE_CONFIGURATION_ID, 0), + (CHAT_RESPONSE_CONFIGURATION_ARN, 0), + (DISPLAY_NAME, 0), + (TIMESTAMP, 0), + (CHAT_RESPONSE_CONFIGURATION_DETAIL, 0), + (CHAT_RESPONSE_CONFIGURATION_DETAIL, 0), + ), ) -UPDATE_APPLICATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#UpdateApplicationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#UpdateApplicationRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "identityCenterInstanceArn": {"target": INSTANCE_ARN}, - "displayName": {"target": APPLICATION_NAME}, - "description": {"target": DESCRIPTION}, - "roleArn": {"target": ROLE_ARN}, - "attachmentsConfiguration": {"target": ATTACHMENTS_CONFIGURATION}, - "qAppsConfiguration": {"target": Q_APPS_CONFIGURATION}, - "personalizationConfiguration": {"target": PERSONALIZATION_CONFIGURATION}, - "autoSubscriptionConfiguration": {"target": AUTO_SUBSCRIPTION_CONFIGURATION}, - }, +GET_CHAT_RESPONSE_CONFIGURATION: StaticOperationSchema = ( + 23, + n0, + _GCRC, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/applications/{applicationId}/chatresponseconfigurations/{chatResponseConfigurationId}", + } + ) + }, + GET_CHAT_RESPONSE_CONFIGURATION_INPUT, + GET_CHAT_RESPONSE_CONFIGURATION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -UPDATE_APPLICATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#UpdateApplicationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#UpdateApplicationResponse", - ) - ], -) - -UPDATE_APPLICATION = Schema( - id=ShapeID("com.amazonaws.qbusiness#UpdateApplication"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"uri": "/applications/{applicationId}", "method": "PUT"} - ), - ) - ], +OUTPUT_FORMAT: StaticSchema = ( + 14, + n0, + _OF, + 0, + (_RAW, _EXTRACTED), + ((-1, {_sV: _RAW}), (-1, {_sV: _EXTRACTED})), +) + +GET_DOCUMENT_CONTENT_INPUT: StaticSchema = ( + 18, + n0, + _GDCI, + {_sSI: _cGDCR, _smit: None}, + (_aIp, _iI, _dSI, _dI, _oF), + ( + (APPLICATION_ID, 9), + (INDEX_ID, 9), + (DATA_SOURCE_ID, {_sQ: _dSI}), + (DOCUMENT_ID, 9), + (OUTPUT_FORMAT, {_sQ: _oF}), + ), ) -BROWSER_EXTENSION = Schema( - id=ShapeID("com.amazonaws.qbusiness#BrowserExtension"), shape_type=ShapeType.STRING +GET_DOCUMENT_CONTENT_OUTPUT: StaticSchema = ( + 18, + n0, + _GDCO, + {_sSI: _cGDCRo, _smith: None}, + (_pU, _mTi), + ((STRING, 1), (STRING, 1)), +) + +GET_DOCUMENT_CONTENT: StaticOperationSchema = ( + 23, + n0, + _GDC, + { + _smithy: MappingProxyType( + { + "uri": "/applications/{applicationId}/index/{indexId}/documents/{documentId}/content", + "method": "GET", + } + ) + }, + GET_DOCUMENT_CONTENT_INPUT, + GET_DOCUMENT_CONTENT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -BROWSER_EXTENSION_LIST = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#BrowserExtensionList"), - shape_type=ShapeType.LIST, - members={"member": {"target": BROWSER_EXTENSION}}, +GET_GROUP_INPUT: StaticSchema = ( + 18, + n0, + _GGI, + {_sSI: _cGGR, _smit: None}, + (_aIp, _iI, _gN, _dSI), + ( + (APPLICATION_ID, 9), + (INDEX_ID, 9), + (GROUP_NAME, 9), + (DATA_SOURCE_ID, {_sQ: _dSI}), + ), ) -BROWSER_EXTENSION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#BrowserExtensionConfiguration"), - members={ - "enabledBrowserExtensions": { - "target": BROWSER_EXTENSION_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +GROUP_STATUS: StaticSchema = ( + 14, + n0, + _GS, + 0, + (_FAILED, _SUCCEEDED, _PROCESSING, _DELETING, _DELETED), + ( + (-1, {_sV: _FAILED}), + (-1, {_sV: _SUCCEEDED}), + (-1, {_sV: _PROCESSING}), + (-1, {_sV: _DELETING}), + (-1, {_sV: _DELETED}), + ), ) -CUSTOM_CSS_URL = Schema( - id=ShapeID("com.amazonaws.qbusiness#CustomCSSUrl"), shape_type=ShapeType.STRING +GROUP_STATUS_DETAIL: StaticSchema = ( + 18, + n0, + _GSD, + 0, + (_st, _lUA, _eD), + ((GROUP_STATUS, 0), (TIMESTAMP, 0), (ERROR_DETAIL, 0)), +) + +GROUP_STATUS_DETAILS: StaticSchema = ( + 16, + n0, + _GSDr, + 0, + (_m,), + ((GROUP_STATUS_DETAIL, 0),), +) + +GET_GROUP_OUTPUT: StaticSchema = ( + 18, + n0, + _GGO, + {_sSI: _cGGRo, _smith: None}, + (_st, _sH), + ((GROUP_STATUS_DETAIL, 0), (GROUP_STATUS_DETAILS, 0)), +) + +GET_GROUP: StaticOperationSchema = ( + 23, + n0, + _GG, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/applications/{applicationId}/indices/{indexId}/groups/{groupName}", + } + ) + }, + GET_GROUP_INPUT, + GET_GROUP_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -FAVICON_URL = Schema( - id=ShapeID("com.amazonaws.qbusiness#FaviconUrl"), shape_type=ShapeType.STRING +GET_MEDIA_INPUT: StaticSchema = ( + 18, + n0, + _GMI, + {_sSI: _cGMR, _smit: None}, + (_aIp, _cI, _mIe, _mI), + ((APPLICATION_ID, 9), (CONVERSATION_ID, 9), (MESSAGE_ID, 9), (MEDIA_ID, 9)), +) + +GET_MEDIA_OUTPUT: StaticSchema = ( + 18, + n0, + _GMO, + {_sSI: _cGMRo, _smith: None}, + (_mB, _mMT), + ((BLOB, 0), (STRING, 0)), +) + +MEDIA_TOO_LARGE_EXCEPTION: StaticSchema = ( + 18, + n0, + _MTLE, + {_sm: _c, _sE: 400}, + (_me,), + ((ERROR_MESSAGE, 1),), +) + +GET_MEDIA: StaticOperationSchema = ( + 23, + n0, + _GM, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/applications/{applicationId}/conversations/{conversationId}/messages/{messageId}/media/{mediaId}", + } + ) + }, + GET_MEDIA_INPUT, + GET_MEDIA_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + LICENSE_NOT_FOUND_EXCEPTION, + MEDIA_TOO_LARGE_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -FONT_URL = Schema( - id=ShapeID("com.amazonaws.qbusiness#FontUrl"), shape_type=ShapeType.STRING +GET_POLICY_INPUT: StaticSchema = ( + 18, + n0, + _GPIe, + {_sSI: _cGPRom, _smit: None}, + (_aIp,), + ((APPLICATION_ID, 9),), +) + +GET_POLICY_OUTPUT: StaticSchema = ( + 18, + n0, + _GPOe, + {_sSI: _cGPRoma, _smith: None}, + (_po,), + ((STRING, 0),), +) + +GET_POLICY: StaticOperationSchema = ( + 23, + n0, + _GPe, + { + _smithy: MappingProxyType( + {"uri": "/applications/{applicationId}/policy", "method": "GET"} + ) + }, + GET_POLICY_INPUT, + GET_POLICY_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -LOGO_URL = Schema( - id=ShapeID("com.amazonaws.qbusiness#LogoUrl"), shape_type=ShapeType.STRING +GET_USER_INPUT: StaticSchema = ( + 18, + n0, + _GUI, + {_sSI: _cGUR, _smit: None}, + (_aIp, _uI), + ((APPLICATION_ID, 9), (STRING, 9)), +) + +GET_USER_OUTPUT: StaticSchema = ( + 18, + n0, + _GUO, + {_sSI: _cGURo, _smith: None}, + (_uAs,), + ((USER_ALIASES, 0),), +) + +GET_USER: StaticOperationSchema = ( + 23, + n0, + _GU, + { + _smithy: MappingProxyType( + {"method": "GET", "uri": "/applications/{applicationId}/users/{userId}"} + ) + }, + GET_USER_INPUT, + GET_USER_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CUSTOMIZATION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#CustomizationConfiguration"), - members={ - "customCSSUrl": {"target": CUSTOM_CSS_URL}, - "logoUrl": {"target": LOGO_URL}, - "fontUrl": {"target": FONT_URL}, - "faviconUrl": {"target": FAVICON_URL}, - }, +MAX_RESULTS_INTEGER_FOR_LIST_ATTACHMENTS: StaticSchema = (7, n0, _MRIFLAa, 0) + +LIST_ATTACHMENTS_INPUT: StaticSchema = ( + 18, + n0, + _LAIi, + {_sSI: _cLARom, _smit: None}, + (_aIp, _cI, _uI, _nT, _mRa), + ( + (APPLICATION_ID, 9), + (CONVERSATION_ID, {_sQ: _cI}), + (USER_ID, {_sQ: _uI}), + (NEXT_TOKEN, {_sQ: _nT}), + (MAX_RESULTS_INTEGER_FOR_LIST_ATTACHMENTS, {_sQ: _mRa}), + ), ) -OPEN_ID_CONNECT_PROVIDER_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#OpenIDConnectProviderConfiguration"), - members={ - "secretsArn": { - "target": SECRET_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "secretsRole": { - "target": ROLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +LIST_ATTACHMENTS_OUTPUT: StaticSchema = ( + 18, + n0, + _LAOi, + {_sSI: _cLARoma, _smith: None}, + (_atta, _nT), + ((ATTACHMENT_LIST, 0), (NEXT_TOKEN, 0)), +) + +LIST_ATTACHMENTS: StaticOperationSchema = ( + 23, + n0, + _LAis, + { + _smithy: MappingProxyType( + {"uri": "/applications/{applicationId}/attachments", "method": "GET"} + ) + }, + LIST_ATTACHMENTS_INPUT, + LIST_ATTACHMENTS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + LICENSE_NOT_FOUND_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -SAML_AUTHENTICATION_URL = Schema( - id=ShapeID("com.amazonaws.qbusiness#SamlAuthenticationUrl"), - shape_type=ShapeType.STRING, +LIST_CHAT_RESPONSE_CONFIGURATIONS_INPUT: StaticSchema = ( + 18, + n0, + _LCRCI, + {_sSI: _cLCRCR, _smit: None}, + (_aIp, _mRa, _nT), + ((APPLICATION_ID, 9), (INTEGER, {_sQ: _mRa}), (NEXT_TOKEN, {_sQ: _nT})), +) + +LIST_CHAT_RESPONSE_CONFIGURATIONS_OUTPUT: StaticSchema = ( + 18, + n0, + _LCRCO, + {_sSI: _cLCRCRo, _smith: None}, + (_cRC, _nT), + ((CHAT_RESPONSE_CONFIGURATIONS, 0), (NEXT_TOKEN, 0)), +) + +LIST_CHAT_RESPONSE_CONFIGURATIONS: StaticOperationSchema = ( + 23, + n0, + _LCRC, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/applications/{applicationId}/chatresponseconfigurations", + } + ) + }, + LIST_CHAT_RESPONSE_CONFIGURATIONS_INPUT, + LIST_CHAT_RESPONSE_CONFIGURATIONS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -SAML_PROVIDER_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#SamlProviderConfiguration"), - members={ - "authenticationUrl": { - "target": SAML_AUTHENTICATION_URL, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +MAX_RESULTS_INTEGER_FOR_LIST_CONVERSATIONS: StaticSchema = (7, n0, _MRIFLC, 0) + +LIST_CONVERSATIONS_INPUT: StaticSchema = ( + 18, + n0, + _LCI, + {_sSI: _cLCR, _smit: None}, + (_aIp, _uI, _nT, _mRa), + ( + (APPLICATION_ID, 9), + (USER_ID, {_sQ: _uI}), + (NEXT_TOKEN, {_sQ: _nT}), + (MAX_RESULTS_INTEGER_FOR_LIST_CONVERSATIONS, {_sQ: _mRa}), + ), ) -IDENTITY_PROVIDER_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#IdentityProviderConfiguration"), - shape_type=ShapeType.UNION, - members={ - "samlConfiguration": {"target": SAML_PROVIDER_CONFIGURATION}, - "openIDConnectConfiguration": { - "target": OPEN_ID_CONNECT_PROVIDER_CONFIGURATION - }, - }, +LIST_CONVERSATIONS_OUTPUT: StaticSchema = ( + 18, + n0, + _LCO, + {_sSI: _cLCRo, _smith: None}, + (_nT, _conve), + ((NEXT_TOKEN, 0), (CONVERSATIONS, 0)), +) + +LIST_CONVERSATIONS: StaticOperationSchema = ( + 23, + n0, + _LC, + { + _smithy: MappingProxyType( + {"uri": "/applications/{applicationId}/conversations", "method": "GET"} + ) + }, + LIST_CONVERSATIONS_INPUT, + LIST_CONVERSATIONS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + LICENSE_NOT_FOUND_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -ORIGIN = Schema( - id=ShapeID("com.amazonaws.qbusiness#Origin"), shape_type=ShapeType.STRING +MAX_RESULTS_INTEGER_FOR_LIST_DATA_SOURCES_SYNC_JOBS: StaticSchema = ( + 7, + n0, + _MRIFLDSSJ, + 0, +) + +LIST_DATA_SOURCE_SYNC_JOBS_INPUT: StaticSchema = ( + 18, + n0, + _LDSSJI, + {_sSI: _cLDSSJR, _smit: None}, + (_dSI, _aIp, _iI, _nT, _mRa, _sTt, _eT, _sF), + ( + (DATA_SOURCE_ID, 9), + (APPLICATION_ID, 9), + (INDEX_ID, 9), + (NEXT_TOKEN, {_sQ: _nT}), + (MAX_RESULTS_INTEGER_FOR_LIST_DATA_SOURCES_SYNC_JOBS, {_sQ: _mRa}), + (TIMESTAMP, {_sQ: _sTt}), + (TIMESTAMP, {_sQ: _eT}), + (DATA_SOURCE_SYNC_JOB_STATUS, {_sQ: _sSy}), + ), ) -WEB_EXPERIENCE_ORIGINS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#WebExperienceOrigins"), - shape_type=ShapeType.LIST, - members={"member": {"target": ORIGIN}}, +LIST_DATA_SOURCE_SYNC_JOBS_OUTPUT: StaticSchema = ( + 18, + n0, + _LDSSJO, + {_sSI: _cLDSSJRo, _smith: None}, + (_h, _nT), + ((DATA_SOURCE_SYNC_JOBS, 0), (NEXT_TOKEN, 0)), +) + +LIST_DATA_SOURCE_SYNC_JOBS: StaticOperationSchema = ( + 23, + n0, + _LDSSJ, + { + _smithy: MappingProxyType( + { + "uri": "/applications/{applicationId}/indices/{indexId}/datasources/{dataSourceId}/syncjobs", + "method": "GET", + } + ) + }, + LIST_DATA_SOURCE_SYNC_JOBS_INPUT, + LIST_DATA_SOURCE_SYNC_JOBS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -WEB_EXPERIENCE_SAMPLE_PROMPTS_CONTROL_MODE = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#WebExperienceSamplePromptsControlMode"), - shape_type=ShapeType.ENUM, - members={"ENABLED": {"target": UNIT}, "DISABLED": {"target": UNIT}}, +MAX_RESULTS_INTEGER_FOR_LIST_DOCUMENTS: StaticSchema = (7, n0, _MRIFLD, 0) + +LIST_DOCUMENTS_INPUT: StaticSchema = ( + 18, + n0, + _LDI, + {_sSI: _cLDR, _smit: None}, + (_aIp, _iI, _dSIa, _nT, _mRa), + ( + (APPLICATION_ID, 9), + (INDEX_ID, 9), + (DATA_SOURCE_IDS, {_sQ: _dSIa}), + (NEXT_TOKEN, {_sQ: _nT}), + (MAX_RESULTS_INTEGER_FOR_LIST_DOCUMENTS, {_sQ: _mRa}), + ), ) -WEB_EXPERIENCE_SUBTITLE = Schema( - id=ShapeID("com.amazonaws.qbusiness#WebExperienceSubtitle"), - shape_type=ShapeType.STRING, +LIST_DOCUMENTS_OUTPUT: StaticSchema = ( + 18, + n0, + _LDO, + {_sSI: _cLDRo, _smith: None}, + (_dDL, _nT), + ((DOCUMENT_DETAIL_LIST, 0), (NEXT_TOKEN, 0)), +) + +LIST_DOCUMENTS: StaticOperationSchema = ( + 23, + n0, + _LD, + { + _smithy: MappingProxyType( + { + "uri": "/applications/{applicationId}/index/{indexId}/documents", + "method": "GET", + } + ) + }, + LIST_DOCUMENTS_INPUT, + LIST_DOCUMENTS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -WEB_EXPERIENCE_TITLE = Schema( - id=ShapeID("com.amazonaws.qbusiness#WebExperienceTitle"), - shape_type=ShapeType.STRING, +MAX_RESULTS_INTEGER_FOR_LIST_GROUPS_REQUEST: StaticSchema = (7, n0, _MRIFLGR, 0) + +LIST_GROUPS_INPUT: StaticSchema = ( + 18, + n0, + _LGI, + {_sSI: _cLGR, _smit: None}, + (_aIp, _iI, _uET, _dSI, _nT, _mRa), + ( + (APPLICATION_ID, 9), + (INDEX_ID, 9), + (TIMESTAMP, {_sQ: _uET, _s: None}), + (DATA_SOURCE_ID, {_sQ: _dSI}), + (NEXT_TOKEN, {_sQ: _nT}), + (MAX_RESULTS_INTEGER_FOR_LIST_GROUPS_REQUEST, {_sQ: _mRa}), + ), ) -WEB_EXPERIENCE_WELCOME_MESSAGE = Schema( - id=ShapeID("com.amazonaws.qbusiness#WebExperienceWelcomeMessage"), - shape_type=ShapeType.STRING, +GROUP_SUMMARY: StaticSchema = (18, n0, _GSr, 0, (_gN,), ((GROUP_NAME, 0),)) + +GROUP_SUMMARY_LIST: StaticSchema = (16, n0, _GSL, 0, (_m,), ((GROUP_SUMMARY, 0),)) + +LIST_GROUPS_OUTPUT: StaticSchema = ( + 18, + n0, + _LGO, + {_sSI: _cLGRo, _smith: None}, + (_nT, _it), + ((NEXT_TOKEN, 0), (GROUP_SUMMARY_LIST, 0)), +) + +LIST_GROUPS: StaticOperationSchema = ( + 23, + n0, + _LG, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/applications/{applicationId}/indices/{indexId}/groups", + } + ) + }, + LIST_GROUPS_INPUT, + LIST_GROUPS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CREATE_WEB_EXPERIENCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#CreateWebExperienceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#CreateWebExperienceRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "title": {"target": WEB_EXPERIENCE_TITLE}, - "subtitle": {"target": WEB_EXPERIENCE_SUBTITLE}, - "welcomeMessage": {"target": WEB_EXPERIENCE_WELCOME_MESSAGE}, - "samplePromptsControlMode": { - "target": WEB_EXPERIENCE_SAMPLE_PROMPTS_CONTROL_MODE - }, - "origins": {"target": WEB_EXPERIENCE_ORIGINS}, - "roleArn": {"target": ROLE_ARN}, - "tags": {"target": TAGS}, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "identityProviderConfiguration": {"target": IDENTITY_PROVIDER_CONFIGURATION}, - "browserExtensionConfiguration": {"target": BROWSER_EXTENSION_CONFIGURATION}, - "customizationConfiguration": {"target": CUSTOMIZATION_CONFIGURATION}, - }, +MAX_RESULTS_INTEGER_FOR_LIST_MESSAGES: StaticSchema = (7, n0, _MRIFLM, 0) + +LIST_MESSAGES_INPUT: StaticSchema = ( + 18, + n0, + _LMI, + {_sSI: _cLMR, _smit: None}, + (_cI, _aIp, _uI, _nT, _mRa), + ( + (CONVERSATION_ID, 9), + (APPLICATION_ID, 9), + (USER_ID, {_sQ: _uI}), + (NEXT_TOKEN, {_sQ: _nT}), + (MAX_RESULTS_INTEGER_FOR_LIST_MESSAGES, {_sQ: _mRa}), + ), ) -WEB_EXPERIENCE_ARN = Schema( - id=ShapeID("com.amazonaws.qbusiness#WebExperienceArn"), shape_type=ShapeType.STRING +MESSAGE_BODY: StaticSchema = (3, n0, _MB, 0) + +MESSAGE_TYPE: StaticSchema = ( + 14, + n0, + _MTe, + 0, + (_USER, _SYSTEM), + ((-1, {_sV: _USER}), (-1, {_sV: _SYSTEM})), +) + +MESSAGE: StaticSchema = ( + 18, + n0, + _M, + 0, + (_mIe, _bo, _tim, _t, _atta, _sAou, _aR, _aE), + ( + (STRING, 0), + (MESSAGE_BODY, 0), + (TIMESTAMP, 0), + (MESSAGE_TYPE, 0), + (ATTACHMENTS_OUTPUT, 0), + (SOURCE_ATTRIBUTIONS, 0), + (ACTION_REVIEW, 0), + (ACTION_EXECUTION, 0), + ), ) -WEB_EXPERIENCE_ID = Schema( - id=ShapeID("com.amazonaws.qbusiness#WebExperienceId"), shape_type=ShapeType.STRING +MESSAGES: StaticSchema = (16, n0, _Me, 0, (_m,), ((MESSAGE, 0),)) + +LIST_MESSAGES_OUTPUT: StaticSchema = ( + 18, + n0, + _LMO, + {_sSI: _cLMRo, _smith: None}, + (_mes, _nT), + ((MESSAGES, 0), (NEXT_TOKEN, 0)), +) + +LIST_MESSAGES: StaticOperationSchema = ( + 23, + n0, + _LM, + { + _smithy: MappingProxyType( + { + "uri": "/applications/{applicationId}/conversations/{conversationId}", + "method": "GET", + } + ) + }, + LIST_MESSAGES_INPUT, + LIST_MESSAGES_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + LICENSE_NOT_FOUND_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CREATE_WEB_EXPERIENCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#CreateWebExperienceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#CreateWebExperienceResponse", - ) - ], - members={ - "webExperienceId": {"target": WEB_EXPERIENCE_ID}, - "webExperienceArn": {"target": WEB_EXPERIENCE_ARN}, - }, +MAX_RESULTS_INTEGER_FOR_LIST_PLUGIN_ACTIONS: StaticSchema = (7, n0, _MRIFLPA, 0) + +LIST_PLUGIN_ACTIONS_INPUT: StaticSchema = ( + 18, + n0, + _LPAI, + {_sSI: _cLPAR, _smit: None}, + (_aIp, _pI, _nT, _mRa), + ( + (APPLICATION_ID, 9), + (PLUGIN_ID, 9), + (NEXT_TOKEN, {_sQ: _nT}), + (MAX_RESULTS_INTEGER_FOR_LIST_PLUGIN_ACTIONS, {_sQ: _mRa}), + ), ) -CREATE_WEB_EXPERIENCE = Schema( - id=ShapeID("com.amazonaws.qbusiness#CreateWebExperience"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"uri": "/applications/{applicationId}/experiences", "method": "POST"} - ), - ) - ], +LIST_PLUGIN_ACTIONS_OUTPUT: StaticSchema = ( + 18, + n0, + _LPAO, + {_sSI: _cLPARo, _smith: None}, + (_nT, _it), + ((NEXT_TOKEN, 0), (ACTIONS, 0)), +) + +LIST_PLUGIN_ACTIONS: StaticOperationSchema = ( + 23, + n0, + _LPA, + { + _smithy: MappingProxyType( + { + "method": "GET", + "uri": "/applications/{applicationId}/plugins/{pluginId}/actions", + } + ) + }, + LIST_PLUGIN_ACTIONS_INPUT, + LIST_PLUGIN_ACTIONS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -DELETE_WEB_EXPERIENCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DeleteWebExperienceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#DeleteWebExperienceRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "webExperienceId": { - "target": WEB_EXPERIENCE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, +MAX_RESULTS_INTEGER_FOR_LIST_PLUGIN_TYPE_ACTIONS: StaticSchema = (7, n0, _MRIFLPTA, 0) + +LIST_PLUGIN_TYPE_ACTIONS_INPUT: StaticSchema = ( + 18, + n0, + _LPTAI, + {_sSI: _cLPTAR, _smit: None}, + (_pT, _nT, _mRa), + ( + (PLUGIN_TYPE, 9), + (NEXT_TOKEN, {_sQ: _nT}), + (MAX_RESULTS_INTEGER_FOR_LIST_PLUGIN_TYPE_ACTIONS, {_sQ: _mRa}), + ), ) -DELETE_WEB_EXPERIENCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DeleteWebExperienceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#DeleteWebExperienceResponse", - ) - ], -) - -DELETE_WEB_EXPERIENCE = Schema( - id=ShapeID("com.amazonaws.qbusiness#DeleteWebExperience"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "uri": "/applications/{applicationId}/experiences/{webExperienceId}", - "method": "DELETE", - } - ), - ) - ], +LIST_PLUGIN_TYPE_ACTIONS_OUTPUT: StaticSchema = ( + 18, + n0, + _LPTAO, + {_sSI: _cLPTARo, _smith: None}, + (_nT, _it), + ((NEXT_TOKEN, 0), (ACTIONS, 0)), ) -GET_WEB_EXPERIENCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#GetWebExperienceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#GetWebExperienceRequest", +LIST_PLUGIN_TYPE_ACTIONS: StaticOperationSchema = ( + 23, + n0, + _LPTA, + { + _smithy: MappingProxyType( + {"method": "GET", "uri": "/pluginTypes/{pluginType}/actions"} ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "webExperienceId": { - "target": WEB_EXPERIENCE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, }, + LIST_PLUGIN_TYPE_ACTIONS_INPUT, + LIST_PLUGIN_TYPE_ACTIONS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -SAML_METADATA_XML = Schema( - id=ShapeID("com.amazonaws.qbusiness#SamlMetadataXML"), shape_type=ShapeType.STRING -) +MAX_RESULTS_INTEGER_FOR_LIST_PLUGIN_TYPE_METADATA: StaticSchema = (7, n0, _MRIFLPTM, 0) -SAML_ATTRIBUTE = Schema( - id=ShapeID("com.amazonaws.qbusiness#SamlAttribute"), shape_type=ShapeType.STRING +LIST_PLUGIN_TYPE_METADATA_INPUT: StaticSchema = ( + 18, + n0, + _LPTMI, + {_sSI: _cLPTMR, _smit: None}, + (_nT, _mRa), + ( + (NEXT_TOKEN, {_sQ: _nT}), + (MAX_RESULTS_INTEGER_FOR_LIST_PLUGIN_TYPE_METADATA, {_sQ: _mRa}), + ), ) -SAML_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#SamlConfiguration"), - members={ - "metadataXML": { - "target": SAML_METADATA_XML, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "roleArn": { - "target": ROLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "userIdAttribute": { - "target": SAML_ATTRIBUTE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "userGroupAttribute": {"target": SAML_ATTRIBUTE}, - }, +PLUGIN_TYPE_CATEGORY: StaticSchema = ( + 14, + n0, + _PTC, + 0, + (_CRM, _PM_, _COMMUNICATION, _PRODUCTIVITY, _TM), + ( + (-1, {_sV: _Crm}), + (-1, {_sV: _Pm}), + (-1, {_sV: _Com}), + (-1, {_sV: _Pro}), + (-1, {_sV: _Taim}), + ), ) -WEB_EXPERIENCE_AUTH_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#WebExperienceAuthConfiguration"), - shape_type=ShapeType.UNION, - members={"samlConfiguration": {"target": SAML_CONFIGURATION}}, +PLUGIN_TYPE_METADATA_SUMMARY: StaticSchema = ( + 18, + n0, + _PTMS, + 0, + (_t, _ca, _d), + ((PLUGIN_TYPE, 0), (PLUGIN_TYPE_CATEGORY, 0), (STRING, 0)), +) + +LIST_PLUGIN_TYPE_METADATA_SUMMARIES: StaticSchema = ( + 16, + n0, + _LPTMS, + 0, + (_m,), + ((PLUGIN_TYPE_METADATA_SUMMARY, 0),), +) + +LIST_PLUGIN_TYPE_METADATA_OUTPUT: StaticSchema = ( + 18, + n0, + _LPTMO, + {_sSI: _cLPTMRo, _smith: None}, + (_nT, _it), + ((NEXT_TOKEN, 0), (LIST_PLUGIN_TYPE_METADATA_SUMMARIES, 0)), +) + +LIST_PLUGIN_TYPE_METADATA: StaticOperationSchema = ( + 23, + n0, + _LPTM, + {_smithy: MappingProxyType({"method": "GET", "uri": "/pluginTypeMetadata"})}, + LIST_PLUGIN_TYPE_METADATA_INPUT, + LIST_PLUGIN_TYPE_METADATA_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -WEB_EXPERIENCE_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#WebExperienceStatus"), - shape_type=ShapeType.ENUM, - members={ - "CREATING": {"target": UNIT}, - "ACTIVE": {"target": UNIT}, - "DELETING": {"target": UNIT}, - "FAILED": {"target": UNIT}, - "PENDING_AUTH_CONFIG": {"target": UNIT}, - }, -) +MAX_RESULTS_INTEGER_FOR_LIST_SUBSCRIPTIONS: StaticSchema = (7, n0, _MRIFLS, 0) -GET_WEB_EXPERIENCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#GetWebExperienceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#GetWebExperienceResponse", - ) - ], - members={ - "applicationId": {"target": APPLICATION_ID}, - "webExperienceId": {"target": WEB_EXPERIENCE_ID}, - "webExperienceArn": {"target": WEB_EXPERIENCE_ARN}, - "defaultEndpoint": {"target": URL}, - "status": {"target": WEB_EXPERIENCE_STATUS}, - "createdAt": {"target": TIMESTAMP}, - "updatedAt": {"target": TIMESTAMP}, - "title": {"target": WEB_EXPERIENCE_TITLE}, - "subtitle": {"target": WEB_EXPERIENCE_SUBTITLE}, - "welcomeMessage": {"target": WEB_EXPERIENCE_WELCOME_MESSAGE}, - "samplePromptsControlMode": { - "target": WEB_EXPERIENCE_SAMPLE_PROMPTS_CONTROL_MODE - }, - "origins": {"target": WEB_EXPERIENCE_ORIGINS}, - "roleArn": {"target": ROLE_ARN}, - "identityProviderConfiguration": {"target": IDENTITY_PROVIDER_CONFIGURATION}, - "authenticationConfiguration": {"target": WEB_EXPERIENCE_AUTH_CONFIGURATION}, - "error": {"target": ERROR_DETAIL}, - "browserExtensionConfiguration": {"target": BROWSER_EXTENSION_CONFIGURATION}, - "customizationConfiguration": {"target": CUSTOMIZATION_CONFIGURATION}, - }, +LIST_SUBSCRIPTIONS_INPUT: StaticSchema = ( + 18, + n0, + _LSI, + {_sSI: _cLSR, _smit: None}, + (_aIp, _nT, _mRa), + ( + (APPLICATION_ID, 9), + (NEXT_TOKEN, {_sQ: _nT}), + (MAX_RESULTS_INTEGER_FOR_LIST_SUBSCRIPTIONS, {_sQ: _mRa}), + ), ) -GET_WEB_EXPERIENCE = Schema( - id=ShapeID("com.amazonaws.qbusiness#GetWebExperience"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "uri": "/applications/{applicationId}/experiences/{webExperienceId}", - "method": "GET", - } - ), - ) - ], +SUBSCRIPTION: StaticSchema = ( + 18, + n0, + _Su, + 0, + (_sIu, _sAu, _pr, _cS, _nS), + ( + (SUBSCRIPTION_ID, 0), + (SUBSCRIPTION_ARN, 0), + (SUBSCRIPTION_PRINCIPAL, 0), + (SUBSCRIPTION_DETAILS, 0), + (SUBSCRIPTION_DETAILS, 0), + ), ) -MAX_RESULTS_INTEGER_FOR_LIST_WEB_EXPERIENCES_REQUEST = Schema( - id=ShapeID("com.amazonaws.qbusiness#MaxResultsIntegerForListWebExperiencesRequest"), - shape_type=ShapeType.INTEGER, +SUBSCRIPTIONS: StaticSchema = (16, n0, _Sub, 0, (_m,), ((SUBSCRIPTION, 0),)) + +LIST_SUBSCRIPTIONS_OUTPUT: StaticSchema = ( + 18, + n0, + _LSO, + {_sSI: _cLSRo, _smith: None}, + (_nT, _sub), + ((NEXT_TOKEN, 0), (SUBSCRIPTIONS, 0)), ) -LIST_WEB_EXPERIENCES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ListWebExperiencesInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#ListWebExperiencesRequest", +LIST_SUBSCRIPTIONS: StaticOperationSchema = ( + 23, + n0, + _LS, + { + _smithy: MappingProxyType( + {"method": "GET", "uri": "/applications/{applicationId}/subscriptions"} ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "maxResults": { - "target": MAX_RESULTS_INTEGER_FOR_LIST_WEB_EXPERIENCES_REQUEST, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, }, + LIST_SUBSCRIPTIONS_INPUT, + LIST_SUBSCRIPTIONS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -WEB_EXPERIENCE = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#WebExperience"), - members={ - "webExperienceId": {"target": WEB_EXPERIENCE_ID}, - "createdAt": {"target": TIMESTAMP}, - "updatedAt": {"target": TIMESTAMP}, - "defaultEndpoint": {"target": URL}, - "status": {"target": WEB_EXPERIENCE_STATUS}, - }, -) - -WEB_EXPERIENCES = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#WebExperiences"), - shape_type=ShapeType.LIST, - members={"member": {"target": WEB_EXPERIENCE}}, -) - -LIST_WEB_EXPERIENCES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ListWebExperiencesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#ListWebExperiencesResponse", - ) - ], - members={ - "webExperiences": {"target": WEB_EXPERIENCES}, - "nextToken": {"target": NEXT_TOKEN}, - }, -) - -LIST_WEB_EXPERIENCES = Schema( - id=ShapeID("com.amazonaws.qbusiness#ListWebExperiences"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"uri": "/applications/{applicationId}/experiences", "method": "GET"} - ), - ) - ], -) - -UPDATE_WEB_EXPERIENCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#UpdateWebExperienceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#UpdateWebExperienceRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "webExperienceId": { - "target": WEB_EXPERIENCE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "roleArn": {"target": ROLE_ARN}, - "authenticationConfiguration": {"target": WEB_EXPERIENCE_AUTH_CONFIGURATION}, - "title": {"target": WEB_EXPERIENCE_TITLE}, - "subtitle": {"target": WEB_EXPERIENCE_SUBTITLE}, - "welcomeMessage": {"target": WEB_EXPERIENCE_WELCOME_MESSAGE}, - "samplePromptsControlMode": { - "target": WEB_EXPERIENCE_SAMPLE_PROMPTS_CONTROL_MODE - }, - "identityProviderConfiguration": {"target": IDENTITY_PROVIDER_CONFIGURATION}, - "origins": {"target": WEB_EXPERIENCE_ORIGINS}, - "browserExtensionConfiguration": {"target": BROWSER_EXTENSION_CONFIGURATION}, - "customizationConfiguration": {"target": CUSTOMIZATION_CONFIGURATION}, - }, -) - -UPDATE_WEB_EXPERIENCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#UpdateWebExperienceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#UpdateWebExperienceResponse", - ) - ], -) - -UPDATE_WEB_EXPERIENCE = Schema( - id=ShapeID("com.amazonaws.qbusiness#UpdateWebExperience"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "uri": "/applications/{applicationId}/experiences/{webExperienceId}", - "method": "PUT", - } - ), - ) - ], -) - -CREATOR_MODE_CONTROL = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#CreatorModeControl"), - shape_type=ShapeType.ENUM, - members={"ENABLED": {"target": UNIT}, "DISABLED": {"target": UNIT}}, -) - -APPLIED_CREATOR_MODE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#AppliedCreatorModeConfiguration"), - members={ - "creatorModeControl": { - "target": CREATOR_MODE_CONTROL, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -ORCHESTRATION_CONTROL = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#OrchestrationControl"), - shape_type=ShapeType.ENUM, - members={"ENABLED": {"target": UNIT}, "DISABLED": {"target": UNIT}}, -) - -APPLIED_ORCHESTRATION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#AppliedOrchestrationConfiguration"), - members={ - "control": { - "target": ORCHESTRATION_CONTROL, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -ASSOCIATED_GROUP = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#AssociatedGroup"), - members={"name": {"target": GROUP_NAME}, "type": {"target": MEMBERSHIP_TYPE}}, -) - -ASSOCIATED_GROUPS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#AssociatedGroups"), - shape_type=ShapeType.LIST, - members={"member": {"target": ASSOCIATED_GROUP}}, -) - -ASSOCIATED_USER = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#AssociatedUser"), - members={"id": {"target": STRING}, "type": {"target": MEMBERSHIP_TYPE}}, -) - -ASSOCIATED_USERS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#AssociatedUsers"), - shape_type=ShapeType.LIST, - members={"member": {"target": ASSOCIATED_USER}}, -) - -Q_IAM_ACTIONS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#QIamActions"), - shape_type=ShapeType.LIST, - members={"member": {"target": Q_IAM_ACTION}}, -) - -PERMISSION_CONDITION_KEY = Schema( - id=ShapeID("com.amazonaws.qbusiness#PermissionConditionKey"), - shape_type=ShapeType.STRING, -) - -PERMISSION_CONDITION_OPERATOR = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#PermissionConditionOperator"), - shape_type=ShapeType.ENUM, - members={"STRING_EQUALS": {"target": UNIT}}, -) - -PERMISSION_CONDITION_VALUE = Schema( - id=ShapeID("com.amazonaws.qbusiness#PermissionConditionValue"), - shape_type=ShapeType.STRING, -) - -PERMISSION_CONDITION_VALUES = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#PermissionConditionValues"), - shape_type=ShapeType.LIST, - members={"member": {"target": PERMISSION_CONDITION_VALUE}}, -) - -PERMISSION_CONDITION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#PermissionCondition"), - members={ - "conditionOperator": { - "target": PERMISSION_CONDITION_OPERATOR, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "conditionKey": { - "target": PERMISSION_CONDITION_KEY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "conditionValues": { - "target": PERMISSION_CONDITION_VALUES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -PERMISSION_CONDITIONS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#PermissionConditions"), - shape_type=ShapeType.LIST, - members={"member": {"target": PERMISSION_CONDITION}}, -) - -STATEMENT_ID = Schema( - id=ShapeID("com.amazonaws.qbusiness#StatementId"), shape_type=ShapeType.STRING -) - -ASSOCIATE_PERMISSION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#AssociatePermissionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#AssociatePermissionRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "statementId": { - "target": STATEMENT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "actions": { - "target": Q_IAM_ACTIONS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "conditions": {"target": PERMISSION_CONDITIONS}, - "principal": { - "target": PRINCIPAL_ROLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -ASSOCIATE_PERMISSION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#AssociatePermissionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#AssociatePermissionResponse", - ) - ], - members={"statement": {"target": STRING}}, -) - -ASSOCIATE_PERMISSION = Schema( - id=ShapeID("com.amazonaws.qbusiness#AssociatePermission"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"uri": "/applications/{applicationId}/policy", "method": "POST"} - ), - ) - ], -) - -ATTACHMENT_ID = Schema( - id=ShapeID("com.amazonaws.qbusiness#AttachmentId"), shape_type=ShapeType.STRING -) - -CONVERSATION_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ConversationSource"), - members={ - "conversationId": { - "target": CONVERSATION_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "attachmentId": { - "target": ATTACHMENT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -COPY_FROM_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#CopyFromSource"), - shape_type=ShapeType.UNION, - members={"conversation": {"target": CONVERSATION_SOURCE}}, -) - -ATTACHMENT_NAME = Schema( - id=ShapeID("com.amazonaws.qbusiness#AttachmentName"), shape_type=ShapeType.STRING -) - -ATTACHMENT_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#AttachmentStatus"), - shape_type=ShapeType.ENUM, - members={"FAILED": {"target": UNIT}, "SUCCESS": {"target": UNIT}}, -) - -ATTACHMENT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#Attachment"), - members={ - "attachmentId": {"target": ATTACHMENT_ID}, - "conversationId": {"target": CONVERSATION_ID}, - "name": {"target": ATTACHMENT_NAME}, - "copyFrom": {"target": COPY_FROM_SOURCE}, - "fileType": {"target": STRING}, - "fileSize": {"target": INTEGER}, - "md5chksum": {"target": STRING}, - "createdAt": {"target": TIMESTAMP}, - "status": {"target": ATTACHMENT_STATUS}, - "error": {"target": ERROR_DETAIL}, - }, -) - -BLOB = Schema(id=ShapeID("com.amazonaws.qbusiness#Blob"), shape_type=ShapeType.BLOB) - -ATTACHMENT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#AttachmentInput"), - members={ - "data": {"target": BLOB}, - "name": {"target": ATTACHMENT_NAME}, - "copyFrom": {"target": COPY_FROM_SOURCE}, - }, -) - -ATTACHMENT_INPUT_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#AttachmentInputEvent"), - members={"attachment": {"target": ATTACHMENT_INPUT}}, -) - -ATTACHMENT_LIST = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#AttachmentList"), - shape_type=ShapeType.LIST, - members={"member": {"target": ATTACHMENT}}, -) - -ATTACHMENT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#AttachmentOutput"), - members={ - "name": {"target": ATTACHMENT_NAME}, - "status": {"target": ATTACHMENT_STATUS}, - "error": {"target": ERROR_DETAIL}, - "attachmentId": {"target": ATTACHMENT_ID}, - "conversationId": {"target": CONVERSATION_ID}, - }, -) - -ATTACHMENTS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#AttachmentsInput"), - shape_type=ShapeType.LIST, - members={"member": {"target": ATTACHMENT_INPUT}}, -) - -ATTACHMENTS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#AttachmentsOutput"), - shape_type=ShapeType.LIST, - members={"member": {"target": ATTACHMENT_OUTPUT}}, -) - -AUDIO_EXTRACTION_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#AudioExtractionType"), - shape_type=ShapeType.ENUM, - members={"TRANSCRIPT": {"target": UNIT}, "SUMMARY": {"target": UNIT}}, -) - -MEDIA_ID = Schema( - id=ShapeID("com.amazonaws.qbusiness#MediaId"), shape_type=ShapeType.STRING -) - -AUDIO_SOURCE_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#AudioSourceDetails"), - members={ - "mediaId": {"target": MEDIA_ID}, - "mediaMimeType": {"target": STRING}, - "startTimeMilliseconds": {"target": LONG}, - "endTimeMilliseconds": {"target": LONG}, - "audioExtractionType": {"target": AUDIO_EXTRACTION_TYPE}, - }, -) - -AUTH_CHALLENGE_REQUEST = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#AuthChallengeRequest"), - members={ - "authorizationUrl": { - "target": URL, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -AUTH_CHALLENGE_REQUEST_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#AuthChallengeRequestEvent"), - members={ - "authorizationUrl": { - "target": URL, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -AUTH_RESPONSE_KEY = Schema( - id=ShapeID("com.amazonaws.qbusiness#AuthResponseKey"), shape_type=ShapeType.STRING -) - -AUTH_RESPONSE_VALUE = Schema( - id=ShapeID("com.amazonaws.qbusiness#AuthResponseValue"), shape_type=ShapeType.STRING -) - -AUTHORIZATION_RESPONSE_MAP = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#AuthorizationResponseMap"), - shape_type=ShapeType.MAP, - members={ - "key": {"target": AUTH_RESPONSE_KEY}, - "value": {"target": AUTH_RESPONSE_VALUE}, - }, -) - -AUTH_CHALLENGE_RESPONSE = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#AuthChallengeResponse"), - members={ - "responseMap": { - "target": AUTHORIZATION_RESPONSE_MAP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -AUTH_CHALLENGE_RESPONSE_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#AuthChallengeResponseEvent"), - members={ - "responseMap": { - "target": AUTHORIZATION_RESPONSE_MAP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -EXECUTION_ID = Schema( - id=ShapeID("com.amazonaws.qbusiness#ExecutionId"), shape_type=ShapeType.STRING -) - -DOCUMENT_ID = Schema( - id=ShapeID("com.amazonaws.qbusiness#DocumentId"), shape_type=ShapeType.STRING -) - -DELETE_DOCUMENT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DeleteDocument"), - members={ - "documentId": { - "target": DOCUMENT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -DELETE_DOCUMENTS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DeleteDocuments"), - shape_type=ShapeType.LIST, - members={"member": {"target": DELETE_DOCUMENT}}, -) - -BATCH_DELETE_DOCUMENT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#BatchDeleteDocumentInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#BatchDeleteDocumentRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "indexId": { - "target": INDEX_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "documents": { - "target": DELETE_DOCUMENTS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "dataSourceSyncId": {"target": EXECUTION_ID}, - }, -) - -FAILED_DOCUMENT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#FailedDocument"), - members={ - "id": {"target": DOCUMENT_ID}, - "error": {"target": ERROR_DETAIL}, - "dataSourceId": {"target": DATA_SOURCE_ID}, - }, -) - -FAILED_DOCUMENTS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#FailedDocuments"), - shape_type=ShapeType.LIST, - members={"member": {"target": FAILED_DOCUMENT}}, -) - -BATCH_DELETE_DOCUMENT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#BatchDeleteDocumentOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#BatchDeleteDocumentResponse", - ) - ], - members={"failedDocuments": {"target": FAILED_DOCUMENTS}}, -) - -BATCH_DELETE_DOCUMENT = Schema( - id=ShapeID("com.amazonaws.qbusiness#BatchDeleteDocument"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/applications/{applicationId}/indices/{indexId}/documents/delete", - } - ), - ) - ], -) - -DOCUMENT_ATTRIBUTES = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DocumentAttributes"), - shape_type=ShapeType.LIST, - members={"member": {"target": DOCUMENT_ATTRIBUTE}}, -) - -DOCUMENT_CONTENT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DocumentContent"), - shape_type=ShapeType.UNION, - members={"blob": {"target": _BLOB}, "s3": {"target": S3}}, -) - -CONTENT_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ContentType"), - shape_type=ShapeType.ENUM, - members={ - "PDF": {"target": UNIT}, - "HTML": {"target": UNIT}, - "MS_WORD": {"target": UNIT}, - "PLAIN_TEXT": {"target": UNIT}, - "PPT": {"target": UNIT}, - "RTF": {"target": UNIT}, - "XML": {"target": UNIT}, - "XSLT": {"target": UNIT}, - "MS_EXCEL": {"target": UNIT}, - "CSV": {"target": UNIT}, - "JSON": {"target": UNIT}, - "MD": {"target": UNIT}, - }, -) - -TITLE = Schema(id=ShapeID("com.amazonaws.qbusiness#Title"), shape_type=ShapeType.STRING) - -DOCUMENT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#Document"), - members={ - "id": { - "target": DOCUMENT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "attributes": {"target": DOCUMENT_ATTRIBUTES}, - "content": {"target": DOCUMENT_CONTENT}, - "contentType": {"target": CONTENT_TYPE}, - "title": {"target": TITLE}, - "accessConfiguration": {"target": ACCESS_CONFIGURATION}, - "documentEnrichmentConfiguration": { - "target": DOCUMENT_ENRICHMENT_CONFIGURATION - }, - "mediaExtractionConfiguration": {"target": MEDIA_EXTRACTION_CONFIGURATION}, - }, -) - -DOCUMENTS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#Documents"), - shape_type=ShapeType.LIST, - members={"member": {"target": DOCUMENT}}, -) - -BATCH_PUT_DOCUMENT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#BatchPutDocumentInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#BatchPutDocumentRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "indexId": { - "target": INDEX_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "documents": { - "target": DOCUMENTS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "roleArn": {"target": ROLE_ARN}, - "dataSourceSyncId": {"target": EXECUTION_ID}, - }, -) - -BATCH_PUT_DOCUMENT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#BatchPutDocumentOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#BatchPutDocumentResponse", - ) - ], - members={"failedDocuments": {"target": FAILED_DOCUMENTS}}, -) - -BATCH_PUT_DOCUMENT = Schema( - id=ShapeID("com.amazonaws.qbusiness#BatchPutDocument"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/applications/{applicationId}/indices/{indexId}/documents", - } - ), - ) - ], -) - -BLOCKED_PHRASE = Schema( - id=ShapeID("com.amazonaws.qbusiness#BlockedPhrase"), shape_type=ShapeType.STRING -) - -BLOCKED_PHRASES = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#BlockedPhrases"), - shape_type=ShapeType.LIST, - members={"member": {"target": BLOCKED_PHRASE}}, -) - -SYSTEM_MESSAGE_OVERRIDE = Schema( - id=ShapeID("com.amazonaws.qbusiness#SystemMessageOverride"), - shape_type=ShapeType.STRING, -) - -BLOCKED_PHRASES_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#BlockedPhrasesConfiguration"), - members={ - "blockedPhrases": {"target": BLOCKED_PHRASES}, - "systemMessageOverride": {"target": SYSTEM_MESSAGE_OVERRIDE}, - }, -) - -BLOCKED_PHRASES_CONFIGURATION_UPDATE = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#BlockedPhrasesConfigurationUpdate"), - members={ - "blockedPhrasesToCreateOrUpdate": {"target": BLOCKED_PHRASES}, - "blockedPhrasesToDelete": {"target": BLOCKED_PHRASES}, - "systemMessageOverride": {"target": SYSTEM_MESSAGE_OVERRIDE}, - }, -) - -SUBSCRIPTION_ID = Schema( - id=ShapeID("com.amazonaws.qbusiness#SubscriptionId"), shape_type=ShapeType.STRING -) - -CANCEL_SUBSCRIPTION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#CancelSubscriptionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#CancelSubscriptionRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "subscriptionId": { - "target": SUBSCRIPTION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -SUBSCRIPTION_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#SubscriptionDetails"), - members={"type": {"target": SUBSCRIPTION_TYPE}}, -) - -SUBSCRIPTION_ARN = Schema( - id=ShapeID("com.amazonaws.qbusiness#SubscriptionArn"), shape_type=ShapeType.STRING -) - -CANCEL_SUBSCRIPTION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#CancelSubscriptionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#CancelSubscriptionResponse", - ) - ], - members={ - "subscriptionArn": {"target": SUBSCRIPTION_ARN}, - "currentSubscription": {"target": SUBSCRIPTION_DETAILS}, - "nextSubscription": {"target": SUBSCRIPTION_DETAILS}, - }, -) - -CANCEL_SUBSCRIPTION = Schema( - id=ShapeID("com.amazonaws.qbusiness#CancelSubscription"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/applications/{applicationId}/subscriptions/{subscriptionId}", - } - ), - ) - ], -) - -CHAT_MODE = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ChatMode"), - shape_type=ShapeType.ENUM, - members={ - "RETRIEVAL_MODE": {"target": UNIT}, - "CREATOR_MODE": {"target": UNIT}, - "PLUGIN_MODE": {"target": UNIT}, - }, -) - -PLUGIN_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#PluginConfiguration"), - members={ - "pluginId": { - "target": PLUGIN_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -CHAT_MODE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ChatModeConfiguration"), - shape_type=ShapeType.UNION, - members={"pluginConfiguration": {"target": PLUGIN_CONFIGURATION}}, -) - -END_OF_INPUT_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#EndOfInputEvent") -) - -USER_MESSAGE = Schema( - id=ShapeID("com.amazonaws.qbusiness#UserMessage"), shape_type=ShapeType.STRING -) - -TEXT_INPUT_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#TextInputEvent"), - members={ - "userMessage": { - "target": USER_MESSAGE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -USER_GROUPS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#UserGroups"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, -) - -FAILED_ATTACHMENT_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#FailedAttachmentEvent"), - members={ - "conversationId": {"target": CONVERSATION_ID}, - "userMessageId": {"target": MESSAGE_ID}, - "systemMessageId": {"target": MESSAGE_ID}, - "attachment": {"target": ATTACHMENT_OUTPUT}, - }, -) - -SOURCE_ATTRIBUTION_MEDIA_ID = Schema( - id=ShapeID("com.amazonaws.qbusiness#SourceAttributionMediaId"), - shape_type=ShapeType.STRING, -) - -SNIPPET_EXCERPT_TEXT = Schema( - id=ShapeID("com.amazonaws.qbusiness#SnippetExcerptText"), - shape_type=ShapeType.STRING, -) - -SNIPPET_EXCERPT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#SnippetExcerpt"), - members={"text": {"target": SNIPPET_EXCERPT_TEXT}}, -) - -IMAGE_SOURCE_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ImageSourceDetails"), - members={"mediaId": {"target": MEDIA_ID}, "mediaMimeType": {"target": STRING}}, -) - -VIDEO_EXTRACTION_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#VideoExtractionType"), - shape_type=ShapeType.ENUM, - members={"TRANSCRIPT": {"target": UNIT}, "SUMMARY": {"target": UNIT}}, -) - -VIDEO_SOURCE_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#VideoSourceDetails"), - members={ - "mediaId": {"target": MEDIA_ID}, - "mediaMimeType": {"target": STRING}, - "startTimeMilliseconds": {"target": LONG}, - "endTimeMilliseconds": {"target": LONG}, - "videoExtractionType": {"target": VIDEO_EXTRACTION_TYPE}, - }, -) - -SOURCE_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#SourceDetails"), - shape_type=ShapeType.UNION, - members={ - "imageSourceDetails": {"target": IMAGE_SOURCE_DETAILS}, - "audioSourceDetails": {"target": AUDIO_SOURCE_DETAILS}, - "videoSourceDetails": {"target": VIDEO_SOURCE_DETAILS}, - }, -) - -TEXT_SEGMENT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#TextSegment"), - members={ - "beginOffset": {"target": INTEGER}, - "endOffset": {"target": INTEGER}, - "snippetExcerpt": {"target": SNIPPET_EXCERPT}, - "mediaId": {"target": SOURCE_ATTRIBUTION_MEDIA_ID}, - "mediaMimeType": {"target": STRING}, - "sourceDetails": {"target": SOURCE_DETAILS}, - }, -) - -TEXT_SEGMENT_LIST = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#TextSegmentList"), - shape_type=ShapeType.LIST, - members={"member": {"target": TEXT_SEGMENT}}, -) - -SOURCE_ATTRIBUTION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#SourceAttribution"), - members={ - "title": {"target": STRING}, - "snippet": {"target": STRING}, - "url": {"target": STRING}, - "citationNumber": {"target": INTEGER}, - "updatedAt": {"target": TIMESTAMP}, - "textMessageSegments": {"target": TEXT_SEGMENT_LIST}, - "documentId": {"target": STRING}, - "indexId": {"target": STRING}, - "datasourceId": {"target": STRING}, - }, -) - -SOURCE_ATTRIBUTIONS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#SourceAttributions"), - shape_type=ShapeType.LIST, - traits=[Trait.new(id=ShapeID("smithy.api#sparse"))], - members={"member": {"target": SOURCE_ATTRIBUTION}}, -) - -METADATA_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#MetadataEvent"), - members={ - "conversationId": {"target": CONVERSATION_ID}, - "userMessageId": {"target": MESSAGE_ID}, - "systemMessageId": {"target": MESSAGE_ID}, - "sourceAttributions": {"target": SOURCE_ATTRIBUTIONS}, - "finalTextMessage": {"target": STRING}, - }, -) - -SYSTEM_MESSAGE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#SystemMessageType"), - shape_type=ShapeType.ENUM, - members={"RESPONSE": {"target": UNIT}, "GROUNDED_RESPONSE": {"target": UNIT}}, -) - -TEXT_OUTPUT_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#TextOutputEvent"), - members={ - "systemMessageType": {"target": SYSTEM_MESSAGE_TYPE}, - "conversationId": {"target": CONVERSATION_ID}, - "userMessageId": {"target": MESSAGE_ID}, - "systemMessageId": {"target": MESSAGE_ID}, - "systemMessage": {"target": STRING}, - }, -) - -CHAT_OUTPUT_STREAM = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ChatOutputStream"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#streaming"))], - members={ - "textEvent": {"target": TEXT_OUTPUT_EVENT}, - "metadataEvent": {"target": METADATA_EVENT}, - "actionReviewEvent": {"target": ACTION_REVIEW_EVENT}, - "failedAttachmentEvent": {"target": FAILED_ATTACHMENT_EVENT}, - "authChallengeRequestEvent": {"target": AUTH_CHALLENGE_REQUEST_EVENT}, - }, -) - -CHAT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ChatOutput"), - members={ - "outputStream": { - "target": CHAT_OUTPUT_STREAM, - "traits": [Trait.new(id=ShapeID("smithy.api#httpPayload"))], - } - }, -) - -EXTERNAL_RESOURCE_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ExternalResourceException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=424), - ], - members={ - "message": { - "target": ERROR_MESSAGE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -LICENSE_NOT_FOUND_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#LicenseNotFoundException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={ - "message": { - "target": ERROR_MESSAGE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -CHAT_RESPONSE_CONFIGURATION_ARN = Schema( - id=ShapeID("com.amazonaws.qbusiness#ChatResponseConfigurationArn"), - shape_type=ShapeType.STRING, -) - -CHAT_RESPONSE_CONFIGURATION_ID = Schema( - id=ShapeID("com.amazonaws.qbusiness#ChatResponseConfigurationId"), - shape_type=ShapeType.STRING, -) - -DISPLAY_NAME = Schema( - id=ShapeID("com.amazonaws.qbusiness#DisplayName"), shape_type=ShapeType.STRING -) - -RESPONSE_CONFIGURATION_SUMMARY = Schema( - id=ShapeID("com.amazonaws.qbusiness#ResponseConfigurationSummary"), - shape_type=ShapeType.STRING, -) - -CHAT_RESPONSE_CONFIGURATION_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ChatResponseConfigurationStatus"), - shape_type=ShapeType.ENUM, - members={ - "CREATING": {"target": UNIT}, - "UPDATING": {"target": UNIT}, - "FAILED": {"target": UNIT}, - "ACTIVE": {"target": UNIT}, - }, -) - -CHAT_RESPONSE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ChatResponseConfiguration"), - members={ - "chatResponseConfigurationId": { - "target": CHAT_RESPONSE_CONFIGURATION_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "chatResponseConfigurationArn": { - "target": CHAT_RESPONSE_CONFIGURATION_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "displayName": { - "target": DISPLAY_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "responseConfigurationSummary": {"target": RESPONSE_CONFIGURATION_SUMMARY}, - "status": { - "target": CHAT_RESPONSE_CONFIGURATION_STATUS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "createdAt": {"target": TIMESTAMP}, - "updatedAt": {"target": TIMESTAMP}, - }, -) - -RESPONSE_CONFIGURATION_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ResponseConfigurationType"), - shape_type=ShapeType.ENUM, - members={"ALL": {"target": UNIT}}, -) - -INSTRUCTION = Schema( - id=ShapeID("com.amazonaws.qbusiness#Instruction"), shape_type=ShapeType.STRING -) - -INSTRUCTION_COLLECTION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#InstructionCollection"), - members={ - "responseLength": {"target": INSTRUCTION}, - "targetAudience": {"target": INSTRUCTION}, - "perspective": {"target": INSTRUCTION}, - "outputStyle": {"target": INSTRUCTION}, - "identity": {"target": INSTRUCTION}, - "tone": {"target": INSTRUCTION}, - "customInstructions": {"target": INSTRUCTION}, - "examples": {"target": INSTRUCTION}, - }, -) - -RESPONSE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ResponseConfiguration"), - members={"instructionCollection": {"target": INSTRUCTION_COLLECTION}}, -) - -RESPONSE_CONFIGURATIONS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ResponseConfigurations"), - shape_type=ShapeType.MAP, - members={ - "key": {"target": RESPONSE_CONFIGURATION_TYPE}, - "value": {"target": RESPONSE_CONFIGURATION}, - }, -) - -CHAT_RESPONSE_CONFIGURATION_DETAIL = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ChatResponseConfigurationDetail"), - members={ - "responseConfigurations": {"target": RESPONSE_CONFIGURATIONS}, - "responseConfigurationSummary": {"target": STRING}, - "status": {"target": CHAT_RESPONSE_CONFIGURATION_STATUS}, - "error": {"target": ERROR_DETAIL}, - "updatedAt": {"target": TIMESTAMP}, - }, -) - -CHAT_RESPONSE_CONFIGURATIONS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ChatResponseConfigurations"), - shape_type=ShapeType.LIST, - members={"member": {"target": CHAT_RESPONSE_CONFIGURATION}}, -) - -CHAT_SYNC_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ChatSyncOutput"), - members={ - "conversationId": {"target": CONVERSATION_ID}, - "systemMessage": {"target": STRING}, - "systemMessageId": {"target": MESSAGE_ID}, - "userMessageId": {"target": MESSAGE_ID}, - "actionReview": {"target": ACTION_REVIEW}, - "authChallengeRequest": {"target": AUTH_CHALLENGE_REQUEST}, - "sourceAttributions": {"target": SOURCE_ATTRIBUTIONS}, - "failedAttachments": {"target": ATTACHMENTS_OUTPUT}, - }, -) - -CHECK_DOCUMENT_ACCESS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#CheckDocumentAccessInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#CheckDocumentAccessRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "indexId": { - "target": INDEX_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "userId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "documentId": { - "target": DOCUMENT_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "dataSourceId": { - "target": DATA_SOURCE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="dataSourceId") - ], - }, - }, -) - -DOCUMENT_ACL_GROUP = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DocumentAclGroup"), - members={"name": {"target": GROUP_NAME}, "type": {"target": MEMBERSHIP_TYPE}}, -) - -DOCUMENT_ACL_GROUPS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DocumentAclGroups"), - shape_type=ShapeType.LIST, - members={"member": {"target": DOCUMENT_ACL_GROUP}}, -) - -DOCUMENT_ACL_USER = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DocumentAclUser"), - members={"id": {"target": STRING}, "type": {"target": MEMBERSHIP_TYPE}}, -) - -DOCUMENT_ACL_USERS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DocumentAclUsers"), - shape_type=ShapeType.LIST, - members={"member": {"target": DOCUMENT_ACL_USER}}, -) - -DOCUMENT_ACL_CONDITION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DocumentAclCondition"), - members={ - "memberRelation": {"target": MEMBER_RELATION}, - "users": {"target": DOCUMENT_ACL_USERS}, - "groups": {"target": DOCUMENT_ACL_GROUPS}, - }, -) - -DOCUMENT_ACL_CONDITIONS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DocumentAclConditions"), - shape_type=ShapeType.LIST, - members={"member": {"target": DOCUMENT_ACL_CONDITION}}, -) - -DOCUMENT_ACL_MEMBERSHIP = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DocumentAclMembership"), - members={ - "memberRelation": {"target": MEMBER_RELATION}, - "conditions": {"target": DOCUMENT_ACL_CONDITIONS}, - }, -) - -DOCUMENT_ACL = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DocumentAcl"), - members={ - "allowlist": {"target": DOCUMENT_ACL_MEMBERSHIP}, - "denyList": {"target": DOCUMENT_ACL_MEMBERSHIP}, - }, -) - -CHECK_DOCUMENT_ACCESS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#CheckDocumentAccessOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#CheckDocumentAccessResponse", - ) - ], - members={ - "userGroups": {"target": ASSOCIATED_GROUPS}, - "userAliases": {"target": ASSOCIATED_USERS}, - "hasAccess": {"target": BOOLEAN}, - "documentAcl": {"target": DOCUMENT_ACL}, - }, -) - -CHECK_DOCUMENT_ACCESS = Schema( - id=ShapeID("com.amazonaws.qbusiness#CheckDocumentAccess"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/applications/{applicationId}/index/{indexId}/users/{userId}/documents/{documentId}/check-document-access", - } - ), - ) - ], -) - -CONTENT_BLOCKER_RULE = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ContentBlockerRule"), - members={"systemMessageOverride": {"target": SYSTEM_MESSAGE_OVERRIDE}}, -) - -ELIGIBLE_DATA_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#EligibleDataSource"), - members={ - "indexId": {"target": INDEX_ID}, - "dataSourceId": {"target": DATA_SOURCE_ID}, - }, -) - -ELIGIBLE_DATA_SOURCES = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#EligibleDataSources"), - shape_type=ShapeType.LIST, - members={"member": {"target": ELIGIBLE_DATA_SOURCE}}, -) - -CONTENT_RETRIEVAL_RULE = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ContentRetrievalRule"), - members={"eligibleDataSources": {"target": ELIGIBLE_DATA_SOURCES}}, -) - -RETRIEVER_CONTENT_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#RetrieverContentSource"), - members={ - "retrieverId": { - "target": RETRIEVER_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -CONTENT_SOURCE = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ContentSource"), - shape_type=ShapeType.UNION, - members={"retriever": {"target": RETRIEVER_CONTENT_SOURCE}}, -) - -CONVERSATION_TITLE = Schema( - id=ShapeID("com.amazonaws.qbusiness#ConversationTitle"), shape_type=ShapeType.STRING -) - -CONVERSATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#Conversation"), - members={ - "conversationId": {"target": CONVERSATION_ID}, - "title": {"target": CONVERSATION_TITLE}, - "startTime": {"target": TIMESTAMP}, - }, -) - -CONVERSATIONS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#Conversations"), - shape_type=ShapeType.LIST, - members={"member": {"target": CONVERSATION}}, -) - -SESSION_DURATION_IN_MINUTES = Schema( - id=ShapeID("com.amazonaws.qbusiness#SessionDurationInMinutes"), - shape_type=ShapeType.INTEGER, -) - -CREATE_ANONYMOUS_WEB_EXPERIENCE_URL_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#CreateAnonymousWebExperienceUrlInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#CreateAnonymousWebExperienceUrlRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "webExperienceId": { - "target": WEB_EXPERIENCE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "sessionDurationInMinutes": {"target": SESSION_DURATION_IN_MINUTES}, - }, -) - -CREATE_ANONYMOUS_WEB_EXPERIENCE_URL_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#CreateAnonymousWebExperienceUrlOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#CreateAnonymousWebExperienceUrlResponse", - ) - ], - members={"anonymousUrl": {"target": URL}}, -) - -CREATE_ANONYMOUS_WEB_EXPERIENCE_URL = Schema( - id=ShapeID("com.amazonaws.qbusiness#CreateAnonymousWebExperienceUrl"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "uri": "/applications/{applicationId}/experiences/{webExperienceId}/anonymous-url", - "method": "POST", - } - ), - ) - ], -) - -CREATE_CHAT_RESPONSE_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#CreateChatResponseConfigurationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#CreateChatResponseConfigurationRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "displayName": { - "target": DISPLAY_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientToken": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "responseConfigurations": { - "target": RESPONSE_CONFIGURATIONS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "tags": {"target": TAGS}, - }, -) - -CREATE_CHAT_RESPONSE_CONFIGURATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#CreateChatResponseConfigurationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#CreateChatResponseConfigurationResponse", - ) - ], - members={ - "chatResponseConfigurationId": { - "target": CHAT_RESPONSE_CONFIGURATION_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "chatResponseConfigurationArn": { - "target": CHAT_RESPONSE_CONFIGURATION_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -CREATE_CHAT_RESPONSE_CONFIGURATION = Schema( - id=ShapeID("com.amazonaws.qbusiness#CreateChatResponseConfiguration"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/applications/{applicationId}/chatresponseconfigurations", - } - ), - ) - ], -) - -GROUP_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.qbusiness#GroupIdentifier"), shape_type=ShapeType.STRING -) - -USER_IDENTIFIER = Schema( - id=ShapeID("com.amazonaws.qbusiness#UserIdentifier"), shape_type=ShapeType.STRING -) - -SUBSCRIPTION_PRINCIPAL = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#SubscriptionPrincipal"), - shape_type=ShapeType.UNION, - members={ - "user": {"target": USER_IDENTIFIER}, - "group": {"target": GROUP_IDENTIFIER}, - }, -) - -CREATE_SUBSCRIPTION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#CreateSubscriptionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#CreateSubscriptionRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "principal": { - "target": SUBSCRIPTION_PRINCIPAL, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "type": { - "target": SUBSCRIPTION_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - }, -) - -CREATE_SUBSCRIPTION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#CreateSubscriptionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#CreateSubscriptionResponse", - ) - ], - members={ - "subscriptionId": {"target": SUBSCRIPTION_ID}, - "subscriptionArn": {"target": SUBSCRIPTION_ARN}, - "currentSubscription": {"target": SUBSCRIPTION_DETAILS}, - "nextSubscription": {"target": SUBSCRIPTION_DETAILS}, - }, -) - -CREATE_SUBSCRIPTION = Schema( - id=ShapeID("com.amazonaws.qbusiness#CreateSubscription"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/applications/{applicationId}/subscriptions"} - ), - ) - ], -) - -USER_ALIAS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#UserAlias"), - members={ - "indexId": {"target": INDEX_ID}, - "dataSourceId": {"target": DATA_SOURCE_ID}, - "userId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -USER_ALIASES = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#UserAliases"), - shape_type=ShapeType.LIST, - members={"member": {"target": USER_ALIAS}}, -) - -CREATE_USER_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#CreateUserInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#CreateUserRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "userId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "userAliases": {"target": USER_ALIASES}, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - }, -) - -CREATE_USER_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#CreateUserOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#CreateUserResponse", - ) - ], -) - -CREATE_USER = Schema( - id=ShapeID("com.amazonaws.qbusiness#CreateUser"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/applications/{applicationId}/users"} - ), - ) - ], -) - -CREATOR_MODE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#CreatorModeConfiguration"), - members={ - "creatorModeControl": { - "target": CREATOR_MODE_CONTROL, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -DATA_SOURCE_IDS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DataSourceIds"), - shape_type=ShapeType.LIST, - members={"member": {"target": DATA_SOURCE_ID}}, -) - -METRIC_VALUE = Schema( - id=ShapeID("com.amazonaws.qbusiness#MetricValue"), shape_type=ShapeType.STRING -) - -DATA_SOURCE_SYNC_JOB_METRICS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DataSourceSyncJobMetrics"), - members={ - "documentsAdded": {"target": METRIC_VALUE}, - "documentsModified": {"target": METRIC_VALUE}, - "documentsDeleted": {"target": METRIC_VALUE}, - "documentsFailed": {"target": METRIC_VALUE}, - "documentsScanned": {"target": METRIC_VALUE}, - }, -) - -DATA_SOURCE_SYNC_JOB_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DataSourceSyncJobStatus"), - shape_type=ShapeType.ENUM, - members={ - "FAILED": {"target": UNIT}, - "SUCCEEDED": {"target": UNIT}, - "SYNCING": {"target": UNIT}, - "INCOMPLETE": {"target": UNIT}, - "STOPPING": {"target": UNIT}, - "ABORTED": {"target": UNIT}, - "SYNCING_INDEXING": {"target": UNIT}, - }, -) - -DATA_SOURCE_SYNC_JOB = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DataSourceSyncJob"), - members={ - "executionId": {"target": EXECUTION_ID}, - "startTime": {"target": TIMESTAMP}, - "endTime": {"target": TIMESTAMP}, - "status": {"target": DATA_SOURCE_SYNC_JOB_STATUS}, - "error": {"target": ERROR_DETAIL}, - "dataSourceErrorCode": {"target": STRING}, - "metrics": {"target": DATA_SOURCE_SYNC_JOB_METRICS}, - }, -) - -DATA_SOURCE_SYNC_JOBS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DataSourceSyncJobs"), - shape_type=ShapeType.LIST, - members={"member": {"target": DATA_SOURCE_SYNC_JOB}}, -) - -DATA_SOURCE_USER_ID = Schema( - id=ShapeID("com.amazonaws.qbusiness#DataSourceUserId"), shape_type=ShapeType.STRING -) - -DELETE_ATTACHMENT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DeleteAttachmentInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#DeleteAttachmentRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "conversationId": { - "target": CONVERSATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "attachmentId": { - "target": ATTACHMENT_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "userId": { - "target": USER_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="userId")], - }, - }, -) - -DELETE_ATTACHMENT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DeleteAttachmentOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#DeleteAttachmentResponse", - ) - ], -) - -DELETE_ATTACHMENT = Schema( - id=ShapeID("com.amazonaws.qbusiness#DeleteAttachment"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "uri": "/applications/{applicationId}/conversations/{conversationId}/attachments/{attachmentId}", - "method": "DELETE", - } - ), - ) - ], -) - -DELETE_CHAT_CONTROLS_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DeleteChatControlsConfigurationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#DeleteChatControlsConfigurationRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -DELETE_CHAT_CONTROLS_CONFIGURATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DeleteChatControlsConfigurationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#DeleteChatControlsConfigurationResponse", - ) - ], -) - -DELETE_CHAT_CONTROLS_CONFIGURATION = Schema( - id=ShapeID("com.amazonaws.qbusiness#DeleteChatControlsConfiguration"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "uri": "/applications/{applicationId}/chatcontrols", - "method": "DELETE", - "code": 200, - } - ), - ) - ], -) - -DELETE_CHAT_RESPONSE_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DeleteChatResponseConfigurationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#DeleteChatResponseConfigurationRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "chatResponseConfigurationId": { - "target": CHAT_RESPONSE_CONFIGURATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -DELETE_CHAT_RESPONSE_CONFIGURATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DeleteChatResponseConfigurationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#DeleteChatResponseConfigurationResponse", - ) - ], -) - -DELETE_CHAT_RESPONSE_CONFIGURATION = Schema( - id=ShapeID("com.amazonaws.qbusiness#DeleteChatResponseConfiguration"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/applications/{applicationId}/chatresponseconfigurations/{chatResponseConfigurationId}", - } - ), - ) - ], -) - -DELETE_CONVERSATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DeleteConversationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#DeleteConversationRequest", - ) - ], - members={ - "conversationId": { - "target": CONVERSATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "userId": { - "target": USER_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="userId")], - }, - }, -) - -DELETE_CONVERSATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DeleteConversationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#DeleteConversationResponse", - ) - ], -) - -DELETE_CONVERSATION = Schema( - id=ShapeID("com.amazonaws.qbusiness#DeleteConversation"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "uri": "/applications/{applicationId}/conversations/{conversationId}", - "method": "DELETE", - } - ), - ) - ], -) - -DELETE_GROUP_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DeleteGroupInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#DeleteGroupRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "indexId": { - "target": INDEX_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "groupName": { - "target": GROUP_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "dataSourceId": { - "target": DATA_SOURCE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="dataSourceId") - ], - }, - }, -) - -DELETE_GROUP_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DeleteGroupOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#DeleteGroupResponse", - ) - ], -) - -DELETE_GROUP = Schema( - id=ShapeID("com.amazonaws.qbusiness#DeleteGroup"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/applications/{applicationId}/indices/{indexId}/groups/{groupName}", - } - ), - ) - ], -) - -DELETE_USER_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DeleteUserInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#DeleteUserRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "userId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -DELETE_USER_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DeleteUserOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#DeleteUserResponse", - ) - ], -) - -DELETE_USER = Schema( - id=ShapeID("com.amazonaws.qbusiness#DeleteUser"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "DELETE", - "uri": "/applications/{applicationId}/users/{userId}", - } - ), - ) - ], -) - -DISASSOCIATE_PERMISSION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DisassociatePermissionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#DisassociatePermissionRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "statementId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -DISASSOCIATE_PERMISSION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DisassociatePermissionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#DisassociatePermissionResponse", - ) - ], -) - -DISASSOCIATE_PERMISSION = Schema( - id=ShapeID("com.amazonaws.qbusiness#DisassociatePermission"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "uri": "/applications/{applicationId}/policy/{statementId}", - "method": "DELETE", - } - ), - ) - ], -) - -DOCUMENT_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DocumentStatus"), - shape_type=ShapeType.ENUM, - members={ - "RECEIVED": {"target": UNIT}, - "PROCESSING": {"target": UNIT}, - "INDEXED": {"target": UNIT}, - "UPDATED": {"target": UNIT}, - "FAILED": {"target": UNIT}, - "DELETING": {"target": UNIT}, - "DELETED": {"target": UNIT}, - "DOCUMENT_FAILED_TO_INDEX": {"target": UNIT}, - }, -) - -DOCUMENT_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DocumentDetails"), - members={ - "documentId": {"target": DOCUMENT_ID}, - "status": {"target": DOCUMENT_STATUS}, - "error": {"target": ERROR_DETAIL}, - "createdAt": {"target": TIMESTAMP}, - "updatedAt": {"target": TIMESTAMP}, - }, -) - -DOCUMENT_DETAIL_LIST = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#DocumentDetailList"), - shape_type=ShapeType.LIST, - members={"member": {"target": DOCUMENT_DETAILS}}, -) - -EXAMPLE_CHAT_MESSAGE = Schema( - id=ShapeID("com.amazonaws.qbusiness#ExampleChatMessage"), - shape_type=ShapeType.STRING, -) - -EXAMPLE_CHAT_MESSAGES = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ExampleChatMessages"), - shape_type=ShapeType.LIST, - members={"member": {"target": EXAMPLE_CHAT_MESSAGE}}, -) - -MAX_RESULTS_INTEGER_FOR_GET_TOPIC_CONFIGURATIONS = Schema( - id=ShapeID("com.amazonaws.qbusiness#MaxResultsIntegerForGetTopicConfigurations"), - shape_type=ShapeType.INTEGER, -) - -GET_CHAT_CONTROLS_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#GetChatControlsConfigurationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#GetChatControlsConfigurationRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "maxResults": { - "target": MAX_RESULTS_INTEGER_FOR_GET_TOPIC_CONFIGURATIONS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - }, -) - -HALLUCINATION_REDUCTION_CONTROL = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#HallucinationReductionControl"), - shape_type=ShapeType.ENUM, - members={"ENABLED": {"target": UNIT}, "DISABLED": {"target": UNIT}}, -) - -HALLUCINATION_REDUCTION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#HallucinationReductionConfiguration"), - members={ - "hallucinationReductionControl": {"target": HALLUCINATION_REDUCTION_CONTROL} - }, -) - -RESPONSE_SCOPE = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ResponseScope"), - shape_type=ShapeType.ENUM, - members={ - "ENTERPRISE_CONTENT_ONLY": {"target": UNIT}, - "EXTENDED_KNOWLEDGE_ENABLED": {"target": UNIT}, - }, -) - -TOPIC_DESCRIPTION = Schema( - id=ShapeID("com.amazonaws.qbusiness#TopicDescription"), shape_type=ShapeType.STRING -) - -TOPIC_CONFIGURATION_NAME = Schema( - id=ShapeID("com.amazonaws.qbusiness#TopicConfigurationName"), - shape_type=ShapeType.STRING, -) - -USER_IDS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#UserIds"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, -) - -USERS_AND_GROUPS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#UsersAndGroups"), - members={"userIds": {"target": USER_IDS}, "userGroups": {"target": USER_GROUPS}}, -) - -RULE_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#RuleConfiguration"), - shape_type=ShapeType.UNION, - members={ - "contentBlockerRule": {"target": CONTENT_BLOCKER_RULE}, - "contentRetrievalRule": {"target": CONTENT_RETRIEVAL_RULE}, - }, -) - -RULE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#RuleType"), - shape_type=ShapeType.ENUM, - members={ - "CONTENT_BLOCKER_RULE": {"target": UNIT}, - "CONTENT_RETRIEVAL_RULE": {"target": UNIT}, - }, -) - -RULE = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#Rule"), - members={ - "includedUsersAndGroups": {"target": USERS_AND_GROUPS}, - "excludedUsersAndGroups": {"target": USERS_AND_GROUPS}, - "ruleType": { - "target": RULE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ruleConfiguration": {"target": RULE_CONFIGURATION}, - }, -) - -RULES = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#Rules"), - shape_type=ShapeType.LIST, - members={"member": {"target": RULE}}, -) - -TOPIC_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#TopicConfiguration"), - members={ - "name": { - "target": TOPIC_CONFIGURATION_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "description": {"target": TOPIC_DESCRIPTION}, - "exampleChatMessages": {"target": EXAMPLE_CHAT_MESSAGES}, - "rules": { - "target": RULES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -TOPIC_CONFIGURATIONS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#TopicConfigurations"), - shape_type=ShapeType.LIST, - members={"member": {"target": TOPIC_CONFIGURATION}}, -) - -GET_CHAT_CONTROLS_CONFIGURATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#GetChatControlsConfigurationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#GetChatControlsConfigurationResponse", - ) - ], - members={ - "responseScope": {"target": RESPONSE_SCOPE}, - "orchestrationConfiguration": {"target": APPLIED_ORCHESTRATION_CONFIGURATION}, - "blockedPhrases": {"target": BLOCKED_PHRASES_CONFIGURATION}, - "topicConfigurations": {"target": TOPIC_CONFIGURATIONS}, - "creatorModeConfiguration": {"target": APPLIED_CREATOR_MODE_CONFIGURATION}, - "nextToken": {"target": NEXT_TOKEN}, - "hallucinationReductionConfiguration": { - "target": HALLUCINATION_REDUCTION_CONFIGURATION - }, - }, -) - -GET_CHAT_CONTROLS_CONFIGURATION = Schema( - id=ShapeID("com.amazonaws.qbusiness#GetChatControlsConfiguration"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "uri": "/applications/{applicationId}/chatcontrols", - "method": "GET", - "code": 200, - } - ), - ) - ], -) - -GET_CHAT_RESPONSE_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#GetChatResponseConfigurationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#GetChatResponseConfigurationRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "chatResponseConfigurationId": { - "target": CHAT_RESPONSE_CONFIGURATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -GET_CHAT_RESPONSE_CONFIGURATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#GetChatResponseConfigurationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#GetChatResponseConfigurationResponse", - ) - ], - members={ - "chatResponseConfigurationId": {"target": CHAT_RESPONSE_CONFIGURATION_ID}, - "chatResponseConfigurationArn": {"target": CHAT_RESPONSE_CONFIGURATION_ARN}, - "displayName": {"target": DISPLAY_NAME}, - "createdAt": {"target": TIMESTAMP}, - "inUseConfiguration": {"target": CHAT_RESPONSE_CONFIGURATION_DETAIL}, - "lastUpdateConfiguration": {"target": CHAT_RESPONSE_CONFIGURATION_DETAIL}, - }, -) - -GET_CHAT_RESPONSE_CONFIGURATION = Schema( - id=ShapeID("com.amazonaws.qbusiness#GetChatResponseConfiguration"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/applications/{applicationId}/chatresponseconfigurations/{chatResponseConfigurationId}", - } - ), - ) - ], -) - -OUTPUT_FORMAT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#OutputFormat"), - shape_type=ShapeType.ENUM, - members={"RAW": {"target": UNIT}, "EXTRACTED": {"target": UNIT}}, -) - -GET_DOCUMENT_CONTENT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#GetDocumentContentInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#GetDocumentContentRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "indexId": { - "target": INDEX_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "dataSourceId": { - "target": DATA_SOURCE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="dataSourceId") - ], - }, - "documentId": { - "target": DOCUMENT_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "outputFormat": { - "target": OUTPUT_FORMAT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="outputFormat") - ], - }, - }, -) - -GET_DOCUMENT_CONTENT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#GetDocumentContentOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#GetDocumentContentResponse", - ) - ], - members={ - "presignedUrl": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "mimeType": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -GET_DOCUMENT_CONTENT = Schema( - id=ShapeID("com.amazonaws.qbusiness#GetDocumentContent"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "uri": "/applications/{applicationId}/index/{indexId}/documents/{documentId}/content", - "method": "GET", - } - ), - ) - ], -) - -GET_GROUP_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#GetGroupInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#GetGroupRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "indexId": { - "target": INDEX_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "groupName": { - "target": GROUP_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "dataSourceId": { - "target": DATA_SOURCE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="dataSourceId") - ], - }, - }, -) - -GROUP_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#GroupStatus"), - shape_type=ShapeType.ENUM, - members={ - "FAILED": {"target": UNIT}, - "SUCCEEDED": {"target": UNIT}, - "PROCESSING": {"target": UNIT}, - "DELETING": {"target": UNIT}, - "DELETED": {"target": UNIT}, - }, -) - -GROUP_STATUS_DETAIL = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#GroupStatusDetail"), - members={ - "status": {"target": GROUP_STATUS}, - "lastUpdatedAt": {"target": TIMESTAMP}, - "errorDetail": {"target": ERROR_DETAIL}, - }, -) - -GROUP_STATUS_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#GroupStatusDetails"), - shape_type=ShapeType.LIST, - members={"member": {"target": GROUP_STATUS_DETAIL}}, -) - -GET_GROUP_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#GetGroupOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#GetGroupResponse", - ) - ], - members={ - "status": {"target": GROUP_STATUS_DETAIL}, - "statusHistory": {"target": GROUP_STATUS_DETAILS}, - }, -) - -GET_GROUP = Schema( - id=ShapeID("com.amazonaws.qbusiness#GetGroup"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/applications/{applicationId}/indices/{indexId}/groups/{groupName}", - } - ), - ) - ], -) - -GET_MEDIA_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#GetMediaInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#GetMediaRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "conversationId": { - "target": CONVERSATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "messageId": { - "target": MESSAGE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "mediaId": { - "target": MEDIA_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -GET_MEDIA_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#GetMediaOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#GetMediaResponse", - ) - ], - members={"mediaBytes": {"target": BLOB}, "mediaMimeType": {"target": STRING}}, -) - -MEDIA_TOO_LARGE_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#MediaTooLargeException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={ - "message": { - "target": ERROR_MESSAGE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -GET_MEDIA = Schema( - id=ShapeID("com.amazonaws.qbusiness#GetMedia"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/applications/{applicationId}/conversations/{conversationId}/messages/{messageId}/media/{mediaId}", - } - ), - ) - ], -) - -GET_POLICY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#GetPolicyInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#GetPolicyRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -GET_POLICY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#GetPolicyOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#GetPolicyResponse", - ) - ], - members={"policy": {"target": STRING}}, -) - -GET_POLICY = Schema( - id=ShapeID("com.amazonaws.qbusiness#GetPolicy"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"uri": "/applications/{applicationId}/policy", "method": "GET"} - ), - ) - ], -) - -GET_USER_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#GetUserInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#GetUserRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "userId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, -) - -GET_USER_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#GetUserOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#GetUserResponse", - ) - ], - members={"userAliases": {"target": USER_ALIASES}}, -) - -GET_USER = Schema( - id=ShapeID("com.amazonaws.qbusiness#GetUser"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/applications/{applicationId}/users/{userId}"} - ), - ) - ], -) - -MAX_RESULTS_INTEGER_FOR_LIST_ATTACHMENTS = Schema( - id=ShapeID("com.amazonaws.qbusiness#MaxResultsIntegerForListAttachments"), - shape_type=ShapeType.INTEGER, -) - -LIST_ATTACHMENTS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ListAttachmentsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#ListAttachmentsRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "conversationId": { - "target": CONVERSATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="conversationId") - ], - }, - "userId": { - "target": USER_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="userId")], - }, - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "maxResults": { - "target": MAX_RESULTS_INTEGER_FOR_LIST_ATTACHMENTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - }, -) - -LIST_ATTACHMENTS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ListAttachmentsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#ListAttachmentsResponse", - ) - ], - members={ - "attachments": {"target": ATTACHMENT_LIST}, - "nextToken": {"target": NEXT_TOKEN}, - }, -) - -LIST_ATTACHMENTS = Schema( - id=ShapeID("com.amazonaws.qbusiness#ListAttachments"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"uri": "/applications/{applicationId}/attachments", "method": "GET"} - ), - ) - ], -) - -LIST_CHAT_RESPONSE_CONFIGURATIONS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ListChatResponseConfigurationsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#ListChatResponseConfigurationsRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "maxResults": { - "target": INTEGER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - }, -) - -LIST_CHAT_RESPONSE_CONFIGURATIONS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ListChatResponseConfigurationsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#ListChatResponseConfigurationsResponse", - ) - ], - members={ - "chatResponseConfigurations": {"target": CHAT_RESPONSE_CONFIGURATIONS}, - "nextToken": {"target": NEXT_TOKEN}, - }, -) - -LIST_CHAT_RESPONSE_CONFIGURATIONS = Schema( - id=ShapeID("com.amazonaws.qbusiness#ListChatResponseConfigurations"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/applications/{applicationId}/chatresponseconfigurations", - } - ), - ) - ], -) - -MAX_RESULTS_INTEGER_FOR_LIST_CONVERSATIONS = Schema( - id=ShapeID("com.amazonaws.qbusiness#MaxResultsIntegerForListConversations"), - shape_type=ShapeType.INTEGER, -) - -LIST_CONVERSATIONS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ListConversationsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#ListConversationsRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "userId": { - "target": USER_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="userId")], - }, - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "maxResults": { - "target": MAX_RESULTS_INTEGER_FOR_LIST_CONVERSATIONS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - }, -) - -LIST_CONVERSATIONS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ListConversationsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#ListConversationsResponse", - ) - ], - members={ - "nextToken": {"target": NEXT_TOKEN}, - "conversations": {"target": CONVERSATIONS}, - }, -) - -LIST_CONVERSATIONS = Schema( - id=ShapeID("com.amazonaws.qbusiness#ListConversations"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"uri": "/applications/{applicationId}/conversations", "method": "GET"} - ), - ) - ], -) - -MAX_RESULTS_INTEGER_FOR_LIST_DATA_SOURCES_SYNC_JOBS = Schema( - id=ShapeID("com.amazonaws.qbusiness#MaxResultsIntegerForListDataSourcesSyncJobs"), - shape_type=ShapeType.INTEGER, -) - -LIST_DATA_SOURCE_SYNC_JOBS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ListDataSourceSyncJobsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#ListDataSourceSyncJobsRequest", - ) - ], - members={ - "dataSourceId": { - "target": DATA_SOURCE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "indexId": { - "target": INDEX_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "maxResults": { - "target": MAX_RESULTS_INTEGER_FOR_LIST_DATA_SOURCES_SYNC_JOBS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - "startTime": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="startTime") - ], - }, - "endTime": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="endTime")], - }, - "statusFilter": { - "target": DATA_SOURCE_SYNC_JOB_STATUS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="syncStatus") - ], - }, - }, -) - -LIST_DATA_SOURCE_SYNC_JOBS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ListDataSourceSyncJobsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#ListDataSourceSyncJobsResponse", - ) - ], - members={ - "history": {"target": DATA_SOURCE_SYNC_JOBS}, - "nextToken": {"target": NEXT_TOKEN}, - }, -) - -LIST_DATA_SOURCE_SYNC_JOBS = Schema( - id=ShapeID("com.amazonaws.qbusiness#ListDataSourceSyncJobs"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "uri": "/applications/{applicationId}/indices/{indexId}/datasources/{dataSourceId}/syncjobs", - "method": "GET", - } - ), - ) - ], -) - -MAX_RESULTS_INTEGER_FOR_LIST_DOCUMENTS = Schema( - id=ShapeID("com.amazonaws.qbusiness#MaxResultsIntegerForListDocuments"), - shape_type=ShapeType.INTEGER, -) - -LIST_DOCUMENTS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ListDocumentsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#ListDocumentsRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "indexId": { - "target": INDEX_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "dataSourceIds": { - "target": DATA_SOURCE_IDS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="dataSourceIds") - ], - }, - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "maxResults": { - "target": MAX_RESULTS_INTEGER_FOR_LIST_DOCUMENTS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - }, -) - -LIST_DOCUMENTS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ListDocumentsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#ListDocumentsResponse", - ) - ], - members={ - "documentDetailList": {"target": DOCUMENT_DETAIL_LIST}, - "nextToken": {"target": NEXT_TOKEN}, - }, -) - -LIST_DOCUMENTS = Schema( - id=ShapeID("com.amazonaws.qbusiness#ListDocuments"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "uri": "/applications/{applicationId}/index/{indexId}/documents", - "method": "GET", - } - ), - ) - ], -) - -MAX_RESULTS_INTEGER_FOR_LIST_GROUPS_REQUEST = Schema( - id=ShapeID("com.amazonaws.qbusiness#MaxResultsIntegerForListGroupsRequest"), - shape_type=ShapeType.INTEGER, -) - -LIST_GROUPS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ListGroupsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#ListGroupsRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "indexId": { - "target": INDEX_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "updatedEarlierThan": { - "target": TIMESTAMP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new( - id=ShapeID("smithy.api#httpQuery"), value="updatedEarlierThan" - ), - ], - }, - "dataSourceId": { - "target": DATA_SOURCE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="dataSourceId") - ], - }, - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "maxResults": { - "target": MAX_RESULTS_INTEGER_FOR_LIST_GROUPS_REQUEST, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - }, -) - -GROUP_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#GroupSummary"), - members={"groupName": {"target": GROUP_NAME}}, -) - -GROUP_SUMMARY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#GroupSummaryList"), - shape_type=ShapeType.LIST, - members={"member": {"target": GROUP_SUMMARY}}, -) - -LIST_GROUPS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ListGroupsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#ListGroupsResponse", - ) - ], - members={ - "nextToken": {"target": NEXT_TOKEN}, - "items": {"target": GROUP_SUMMARY_LIST}, - }, -) - -LIST_GROUPS = Schema( - id=ShapeID("com.amazonaws.qbusiness#ListGroups"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/applications/{applicationId}/indices/{indexId}/groups", - } - ), - ) - ], -) - -MAX_RESULTS_INTEGER_FOR_LIST_MESSAGES = Schema( - id=ShapeID("com.amazonaws.qbusiness#MaxResultsIntegerForListMessages"), - shape_type=ShapeType.INTEGER, -) - -LIST_MESSAGES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ListMessagesInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#ListMessagesRequest", - ) - ], - members={ - "conversationId": { - "target": CONVERSATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "userId": { - "target": USER_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="userId")], - }, - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "maxResults": { - "target": MAX_RESULTS_INTEGER_FOR_LIST_MESSAGES, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - }, -) - -MESSAGE_BODY = Schema( - id=ShapeID("com.amazonaws.qbusiness#MessageBody"), shape_type=ShapeType.STRING -) - -MESSAGE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#MessageType"), - shape_type=ShapeType.ENUM, - members={"USER": {"target": UNIT}, "SYSTEM": {"target": UNIT}}, -) - -MESSAGE = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#Message"), - members={ - "messageId": {"target": STRING}, - "body": {"target": MESSAGE_BODY}, - "time": {"target": TIMESTAMP}, - "type": {"target": MESSAGE_TYPE}, - "attachments": {"target": ATTACHMENTS_OUTPUT}, - "sourceAttribution": {"target": SOURCE_ATTRIBUTIONS}, - "actionReview": {"target": ACTION_REVIEW}, - "actionExecution": {"target": ACTION_EXECUTION}, - }, -) - -MESSAGES = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#Messages"), - shape_type=ShapeType.LIST, - members={"member": {"target": MESSAGE}}, -) - -LIST_MESSAGES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ListMessagesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#ListMessagesResponse", - ) - ], - members={"messages": {"target": MESSAGES}, "nextToken": {"target": NEXT_TOKEN}}, -) - -LIST_MESSAGES = Schema( - id=ShapeID("com.amazonaws.qbusiness#ListMessages"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "uri": "/applications/{applicationId}/conversations/{conversationId}", - "method": "GET", - } - ), - ) - ], -) - -MAX_RESULTS_INTEGER_FOR_LIST_PLUGIN_ACTIONS = Schema( - id=ShapeID("com.amazonaws.qbusiness#MaxResultsIntegerForListPluginActions"), - shape_type=ShapeType.INTEGER, -) - -LIST_PLUGIN_ACTIONS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ListPluginActionsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#ListPluginActionsRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "pluginId": { - "target": PLUGIN_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "maxResults": { - "target": MAX_RESULTS_INTEGER_FOR_LIST_PLUGIN_ACTIONS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - }, -) - -LIST_PLUGIN_ACTIONS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ListPluginActionsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#ListPluginActionsResponse", - ) - ], - members={"nextToken": {"target": NEXT_TOKEN}, "items": {"target": ACTIONS}}, -) - -LIST_PLUGIN_ACTIONS = Schema( - id=ShapeID("com.amazonaws.qbusiness#ListPluginActions"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/applications/{applicationId}/plugins/{pluginId}/actions", - } - ), - ) - ], -) - -MAX_RESULTS_INTEGER_FOR_LIST_PLUGIN_TYPE_ACTIONS = Schema( - id=ShapeID("com.amazonaws.qbusiness#MaxResultsIntegerForListPluginTypeActions"), - shape_type=ShapeType.INTEGER, -) - -LIST_PLUGIN_TYPE_ACTIONS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ListPluginTypeActionsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#ListPluginTypeActionsRequest", - ) - ], - members={ - "pluginType": { - "target": PLUGIN_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "maxResults": { - "target": MAX_RESULTS_INTEGER_FOR_LIST_PLUGIN_TYPE_ACTIONS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - }, -) - -LIST_PLUGIN_TYPE_ACTIONS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ListPluginTypeActionsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#ListPluginTypeActionsResponse", - ) - ], - members={"nextToken": {"target": NEXT_TOKEN}, "items": {"target": ACTIONS}}, -) - -LIST_PLUGIN_TYPE_ACTIONS = Schema( - id=ShapeID("com.amazonaws.qbusiness#ListPluginTypeActions"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/pluginTypes/{pluginType}/actions"} - ), - ) - ], -) - -MAX_RESULTS_INTEGER_FOR_LIST_PLUGIN_TYPE_METADATA = Schema( - id=ShapeID("com.amazonaws.qbusiness#MaxResultsIntegerForListPluginTypeMetadata"), - shape_type=ShapeType.INTEGER, -) - -LIST_PLUGIN_TYPE_METADATA_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ListPluginTypeMetadataInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#ListPluginTypeMetadataRequest", - ) - ], - members={ - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "maxResults": { - "target": MAX_RESULTS_INTEGER_FOR_LIST_PLUGIN_TYPE_METADATA, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - }, -) - -PLUGIN_TYPE_CATEGORY = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#PluginTypeCategory"), - shape_type=ShapeType.ENUM, - members={ - "CRM": {"target": UNIT}, - "PROJECT_MANAGEMENT": {"target": UNIT}, - "COMMUNICATION": {"target": UNIT}, - "PRODUCTIVITY": {"target": UNIT}, - "TICKETING_MANAGEMENT": {"target": UNIT}, - }, -) - -PLUGIN_TYPE_METADATA_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#PluginTypeMetadataSummary"), - members={ - "type": {"target": PLUGIN_TYPE}, - "category": {"target": PLUGIN_TYPE_CATEGORY}, - "description": {"target": STRING}, - }, -) - -LIST_PLUGIN_TYPE_METADATA_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ListPluginTypeMetadataSummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": PLUGIN_TYPE_METADATA_SUMMARY}}, -) - -LIST_PLUGIN_TYPE_METADATA_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ListPluginTypeMetadataOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#ListPluginTypeMetadataResponse", - ) - ], - members={ - "nextToken": {"target": NEXT_TOKEN}, - "items": {"target": LIST_PLUGIN_TYPE_METADATA_SUMMARIES}, - }, -) - -LIST_PLUGIN_TYPE_METADATA = Schema( - id=ShapeID("com.amazonaws.qbusiness#ListPluginTypeMetadata"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType({"method": "GET", "uri": "/pluginTypeMetadata"}), - ) - ], -) - -MAX_RESULTS_INTEGER_FOR_LIST_SUBSCRIPTIONS = Schema( - id=ShapeID("com.amazonaws.qbusiness#MaxResultsIntegerForListSubscriptions"), - shape_type=ShapeType.INTEGER, -) - -LIST_SUBSCRIPTIONS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ListSubscriptionsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#ListSubscriptionsRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "nextToken": { - "target": NEXT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="nextToken") - ], - }, - "maxResults": { - "target": MAX_RESULTS_INTEGER_FOR_LIST_SUBSCRIPTIONS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="maxResults") - ], - }, - }, -) - -SUBSCRIPTION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#Subscription"), - members={ - "subscriptionId": {"target": SUBSCRIPTION_ID}, - "subscriptionArn": {"target": SUBSCRIPTION_ARN}, - "principal": {"target": SUBSCRIPTION_PRINCIPAL}, - "currentSubscription": {"target": SUBSCRIPTION_DETAILS}, - "nextSubscription": {"target": SUBSCRIPTION_DETAILS}, - }, -) - -SUBSCRIPTIONS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#Subscriptions"), - shape_type=ShapeType.LIST, - members={"member": {"target": SUBSCRIPTION}}, -) - -LIST_SUBSCRIPTIONS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ListSubscriptionsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#ListSubscriptionsResponse", - ) - ], - members={ - "nextToken": {"target": NEXT_TOKEN}, - "subscriptions": {"target": SUBSCRIPTIONS}, - }, -) - -LIST_SUBSCRIPTIONS = Schema( - id=ShapeID("com.amazonaws.qbusiness#ListSubscriptions"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "GET", "uri": "/applications/{applicationId}/subscriptions"} - ), - ) - ], -) - -LIST_TAGS_FOR_RESOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ListTagsForResourceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#ListTagsForResourceRequest", - ) - ], - members={ - "resourceARN": { - "target": AMAZON_RESOURCE_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, -) - -LIST_TAGS_FOR_RESOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ListTagsForResourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#ListTagsForResourceResponse", - ) - ], - members={"tags": {"target": TAGS}}, -) - -LIST_TAGS_FOR_RESOURCE = Schema( - id=ShapeID("com.amazonaws.qbusiness#ListTagsForResource"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType({"uri": "/v1/tags/{resourceARN}", "method": "GET"}), - ) - ], -) - -SYSTEM_MESSAGE_ID = Schema( - id=ShapeID("com.amazonaws.qbusiness#SystemMessageId"), shape_type=ShapeType.STRING -) - -MESSAGE_USEFULNESS_COMMENT = Schema( - id=ShapeID("com.amazonaws.qbusiness#MessageUsefulnessComment"), - shape_type=ShapeType.STRING, -) - -MESSAGE_USEFULNESS_REASON = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#MessageUsefulnessReason"), - shape_type=ShapeType.ENUM, - members={ - "NOT_FACTUALLY_CORRECT": {"target": UNIT}, - "HARMFUL_OR_UNSAFE": {"target": UNIT}, - "INCORRECT_OR_MISSING_SOURCES": {"target": UNIT}, - "NOT_HELPFUL": {"target": UNIT}, - "FACTUALLY_CORRECT": {"target": UNIT}, - "COMPLETE": {"target": UNIT}, - "RELEVANT_SOURCES": {"target": UNIT}, - "HELPFUL": {"target": UNIT}, - "NOT_BASED_ON_DOCUMENTS": {"target": UNIT}, - "NOT_COMPLETE": {"target": UNIT}, - "NOT_CONCISE": {"target": UNIT}, - "OTHER": {"target": UNIT}, - }, -) - -MESSAGE_USEFULNESS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#MessageUsefulness"), - shape_type=ShapeType.ENUM, - members={"USEFUL": {"target": UNIT}, "NOT_USEFUL": {"target": UNIT}}, -) - -MESSAGE_USEFULNESS_FEEDBACK = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#MessageUsefulnessFeedback"), - members={ - "usefulness": { - "target": MESSAGE_USEFULNESS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "reason": {"target": MESSAGE_USEFULNESS_REASON}, - "comment": {"target": MESSAGE_USEFULNESS_COMMENT}, - "submittedAt": { - "target": TIMESTAMP, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -PUT_FEEDBACK_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#PutFeedbackInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#PutFeedbackRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "userId": { - "target": USER_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="userId")], - }, - "conversationId": { - "target": CONVERSATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "messageId": { - "target": SYSTEM_MESSAGE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "messageCopiedAt": {"target": TIMESTAMP}, - "messageUsefulness": {"target": MESSAGE_USEFULNESS_FEEDBACK}, - }, -) - -PUT_FEEDBACK_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#PutFeedbackOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -PUT_FEEDBACK = Schema( - id=ShapeID("com.amazonaws.qbusiness#PutFeedback"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "uri": "/applications/{applicationId}/conversations/{conversationId}/messages/{messageId}/feedback", - "method": "POST", - } - ), - ) - ], -) - -MEMBER_GROUP = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#MemberGroup"), - members={ - "groupName": { - "target": GROUP_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "type": {"target": MEMBERSHIP_TYPE}, - }, -) - -MEMBER_GROUPS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#MemberGroups"), - shape_type=ShapeType.LIST, - members={"member": {"target": MEMBER_GROUP}}, -) - -MEMBER_USER = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#MemberUser"), - members={ - "userId": { - "target": DATA_SOURCE_USER_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "type": {"target": MEMBERSHIP_TYPE}, - }, -) - -MEMBER_USERS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#MemberUsers"), - shape_type=ShapeType.LIST, - members={"member": {"target": MEMBER_USER}}, -) - -GROUP_MEMBERS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#GroupMembers"), - members={ - "memberGroups": {"target": MEMBER_GROUPS}, - "memberUsers": {"target": MEMBER_USERS}, - "s3PathForGroupMembers": {"target": S3}, - }, -) - -PUT_GROUP_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#PutGroupInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#PutGroupRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "indexId": { - "target": INDEX_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "groupName": { - "target": GROUP_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "dataSourceId": {"target": DATA_SOURCE_ID}, - "type": { - "target": MEMBERSHIP_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "groupMembers": { - "target": GROUP_MEMBERS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "roleArn": {"target": ROLE_ARN}, - }, -) - -PUT_GROUP_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#PutGroupOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#PutGroupResponse", - ) - ], -) - -PUT_GROUP = Schema( - id=ShapeID("com.amazonaws.qbusiness#PutGroup"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PUT", - "uri": "/applications/{applicationId}/indices/{indexId}/groups", - } - ), - ) - ], -) - -MAX_RESULTS = Schema( - id=ShapeID("com.amazonaws.qbusiness#MaxResults"), shape_type=ShapeType.INTEGER -) - -QUERY_TEXT = Schema( - id=ShapeID("com.amazonaws.qbusiness#QueryText"), shape_type=ShapeType.STRING -) - -SCORE_CONFIDENCE = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ScoreConfidence"), - shape_type=ShapeType.ENUM, - members={ - "VERY_HIGH": {"target": UNIT}, - "HIGH": {"target": UNIT}, - "MEDIUM": {"target": UNIT}, - "LOW": {"target": UNIT}, - "NOT_AVAILABLE": {"target": UNIT}, - }, -) - -SCORE_ATTRIBUTES = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ScoreAttributes"), - members={"scoreConfidence": {"target": SCORE_CONFIDENCE}}, -) - -RELEVANT_CONTENT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#RelevantContent"), - members={ - "content": {"target": STRING}, - "documentId": {"target": DOCUMENT_ID}, - "documentTitle": {"target": TITLE}, - "documentUri": {"target": URL}, - "documentAttributes": {"target": DOCUMENT_ATTRIBUTES}, - "scoreAttributes": {"target": SCORE_ATTRIBUTES}, - }, -) - -RELEVANT_CONTENT_LIST = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#RelevantContentList"), - shape_type=ShapeType.LIST, - members={"member": {"target": RELEVANT_CONTENT}}, -) - -SEARCH_RELEVANT_CONTENT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#SearchRelevantContentOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#SearchRelevantContentResponse", - ) - ], - members={ - "relevantContent": {"target": RELEVANT_CONTENT_LIST}, - "nextToken": {"target": NEXT_TOKEN}, - }, -) - -START_DATA_SOURCE_SYNC_JOB_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#StartDataSourceSyncJobInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#StartDataSourceSyncJobRequest", - ) - ], - members={ - "dataSourceId": { - "target": DATA_SOURCE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "indexId": { - "target": INDEX_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, +LIST_TAGS_FOR_RESOURCE_INPUT: StaticSchema = ( + 18, + n0, + _LTFRI, + {_sSI: _cLTFRR, _smit: None}, + (_rARN,), + ((AMAZON_RESOURCE_NAME, 9),), +) + +LIST_TAGS_FOR_RESOURCE_OUTPUT: StaticSchema = ( + 18, + n0, + _LTFRO, + {_sSI: _cLTFRRo, _smith: None}, + (_ta,), + ((TAGS, 0),), +) + +LIST_TAGS_FOR_RESOURCE: StaticOperationSchema = ( + 23, + n0, + _LTFR, + {_smithy: MappingProxyType({"uri": "/v1/tags/{resourceARN}", "method": "GET"})}, + LIST_TAGS_FOR_RESOURCE_INPUT, + LIST_TAGS_FOR_RESOURCE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -START_DATA_SOURCE_SYNC_JOB_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#StartDataSourceSyncJobOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#StartDataSourceSyncJobResponse", - ) - ], - members={"executionId": {"target": EXECUTION_ID}}, -) - -START_DATA_SOURCE_SYNC_JOB = Schema( - id=ShapeID("com.amazonaws.qbusiness#StartDataSourceSyncJob"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "uri": "/applications/{applicationId}/indices/{indexId}/datasources/{dataSourceId}/startsync", - "method": "POST", - } - ), - ) - ], +SYSTEM_MESSAGE_ID: StaticSchema = (3, n0, _SMI, 0) + +MESSAGE_USEFULNESS_COMMENT: StaticSchema = (3, n0, _MUC, 0) + +MESSAGE_USEFULNESS_REASON: StaticSchema = ( + 14, + n0, + _MUR, + 0, + ( + _NFC, + _HOU, + _IOMS, + _NH, + _FC, + _COMPLETE, + _RS_, + _HELPFUL, + _NBOD, + _NC_, + _NC__, + _OTHER, + ), + ( + (-1, {_sV: _NFC}), + (-1, {_sV: _HOU}), + (-1, {_sV: _IOMS}), + (-1, {_sV: _NH}), + (-1, {_sV: _FC}), + (-1, {_sV: _COMPLETE}), + (-1, {_sV: _RS_}), + (-1, {_sV: _HELPFUL}), + (-1, {_sV: _NBOD}), + (-1, {_sV: _NC_}), + (-1, {_sV: _NC__}), + (-1, {_sV: _OTHER}), + ), ) -STOP_DATA_SOURCE_SYNC_JOB_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#StopDataSourceSyncJobInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#StopDataSourceSyncJobRequest", - ) - ], - members={ - "dataSourceId": { - "target": DATA_SOURCE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "indexId": { - "target": INDEX_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - }, +MESSAGE_USEFULNESS: StaticSchema = ( + 14, + n0, + _MU, + 0, + (_USEFUL, _NU), + ((-1, {_sV: _USEFUL}), (-1, {_sV: _NU})), +) + +MESSAGE_USEFULNESS_FEEDBACK: StaticSchema = ( + 18, + n0, + _MUF, + 0, + (_use, _re, _com, _sAub), + ( + (MESSAGE_USEFULNESS, 1), + (MESSAGE_USEFULNESS_REASON, 0), + (MESSAGE_USEFULNESS_COMMENT, 0), + (TIMESTAMP, 1), + ), ) -STOP_DATA_SOURCE_SYNC_JOB_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#StopDataSourceSyncJobOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#StopDataSourceSyncJobResponse", - ) - ], -) - -STOP_DATA_SOURCE_SYNC_JOB = Schema( - id=ShapeID("com.amazonaws.qbusiness#StopDataSourceSyncJob"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "uri": "/applications/{applicationId}/indices/{indexId}/datasources/{dataSourceId}/stopsync", - "method": "POST", - } - ), - ) - ], +PUT_FEEDBACK_INPUT: StaticSchema = ( + 18, + n0, + _PFI, + {_sSI: _cPFR, _smit: None}, + (_aIp, _uI, _cI, _mIe, _mCA, _mU), + ( + (APPLICATION_ID, 9), + (USER_ID, {_sQ: _uI}), + (CONVERSATION_ID, 9), + (SYSTEM_MESSAGE_ID, 9), + (TIMESTAMP, 0), + (MESSAGE_USEFULNESS_FEEDBACK, 0), + ), ) -TAG_RESOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#TagResourceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#TagResourceRequest", - ) - ], - members={ - "resourceARN": { - "target": AMAZON_RESOURCE_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "tags": { - "target": TAGS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +PUT_FEEDBACK_OUTPUT: StaticSchema = (18, n0, _PFO, {_sSI: _sUm, _smith: None}) + +PUT_FEEDBACK: StaticOperationSchema = ( + 23, + n0, + _PF, + { + _smithy: MappingProxyType( + { + "uri": "/applications/{applicationId}/conversations/{conversationId}/messages/{messageId}/feedback", + "method": "POST", + } + ) + }, + PUT_FEEDBACK_INPUT, + PUT_FEEDBACK_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -TAG_RESOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#TagResourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#TagResourceResponse", - ) - ], +MEMBER_GROUP: StaticSchema = ( + 18, + n0, + _MG, + 0, + (_gN, _t), + ((GROUP_NAME, 1), (MEMBERSHIP_TYPE, 0)), +) + +MEMBER_GROUPS: StaticSchema = (16, n0, _MGe, 0, (_m,), ((MEMBER_GROUP, 0),)) + +MEMBER_USER: StaticSchema = ( + 18, + n0, + _MUe, + 0, + (_uI, _t), + ((DATA_SOURCE_USER_ID, 1), (MEMBERSHIP_TYPE, 0)), +) + +MEMBER_USERS: StaticSchema = (16, n0, _MUem, 0, (_m,), ((MEMBER_USER, 0),)) + +GROUP_MEMBERS: StaticSchema = ( + 18, + n0, + _GMr, + 0, + (_mG, _mUe, _sPFGM), + ((MEMBER_GROUPS, 0), (MEMBER_USERS, 0), (S3, 0)), +) + +PUT_GROUP_INPUT: StaticSchema = ( + 18, + n0, + _PGI, + {_sSI: _cPGR, _smit: None}, + (_aIp, _iI, _gN, _dSI, _t, _gM, _rA), + ( + (APPLICATION_ID, 9), + (INDEX_ID, 9), + (GROUP_NAME, 1), + (DATA_SOURCE_ID, 0), + (MEMBERSHIP_TYPE, 1), + (GROUP_MEMBERS, 1), + (ROLE_ARN, 0), + ), ) -TAG_RESOURCE = Schema( - id=ShapeID("com.amazonaws.qbusiness#TagResource"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType({"uri": "/v1/tags/{resourceARN}", "method": "POST"}), - ) - ], +PUT_GROUP_OUTPUT: StaticSchema = (18, n0, _PGO, {_sSI: _cPGRo, _smith: None}) + +PUT_GROUP: StaticOperationSchema = ( + 23, + n0, + _PGu, + { + _smithy: MappingProxyType( + { + "method": "PUT", + "uri": "/applications/{applicationId}/indices/{indexId}/groups", + } + ) + }, + PUT_GROUP_INPUT, + PUT_GROUP_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -TAG_KEYS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#TagKeys"), - shape_type=ShapeType.LIST, - members={"member": {"target": TAG_KEY}}, -) +MAX_RESULTS: StaticSchema = (7, n0, _MRa, 0) -UNTAG_RESOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#UntagResourceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#UntagResourceRequest", - ) - ], - members={ - "resourceARN": { - "target": AMAZON_RESOURCE_NAME, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "tagKeys": { - "target": TAG_KEYS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="tagKeys"), - ], - }, - }, -) +QUERY_TEXT: StaticSchema = (3, n0, _QT, 0) -UNTAG_RESOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#UntagResourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#UntagResourceResponse", - ) - ], -) - -UNTAG_RESOURCE = Schema( - id=ShapeID("com.amazonaws.qbusiness#UntagResource"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"uri": "/v1/tags/{resourceARN}", "method": "DELETE"} - ), - ) - ], +SCORE_CONFIDENCE: StaticSchema = ( + 14, + n0, + _SCc, + 0, + (_VH, _HIGH, _MEDIUM, _LOW, _NA), + ( + (-1, {_sV: _VH}), + (-1, {_sV: _HIGH}), + (-1, {_sV: _MEDIUM}), + (-1, {_sV: _LOW}), + (-1, {_sV: _NA}), + ), ) -ORCHESTRATION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#OrchestrationConfiguration"), - members={ - "control": { - "target": ORCHESTRATION_CONTROL, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +SCORE_ATTRIBUTES: StaticSchema = (18, n0, _SAc, 0, (_sCc,), ((SCORE_CONFIDENCE, 0),)) + +RELEVANT_CONTENT: StaticSchema = ( + 18, + n0, + _RCel, + 0, + (_conte, _dI, _dT, _dU, _dAocu, _sAc), + ( + (STRING, 0), + (DOCUMENT_ID, 0), + (TITLE, 0), + (URL, 0), + (DOCUMENT_ATTRIBUTES, 0), + (SCORE_ATTRIBUTES, 0), + ), ) -UPDATE_CHAT_CONTROLS_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#UpdateChatControlsConfigurationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#UpdateChatControlsConfigurationRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "responseScope": {"target": RESPONSE_SCOPE}, - "orchestrationConfiguration": {"target": ORCHESTRATION_CONFIGURATION}, - "blockedPhrasesConfigurationUpdate": { - "target": BLOCKED_PHRASES_CONFIGURATION_UPDATE - }, - "topicConfigurationsToCreateOrUpdate": {"target": TOPIC_CONFIGURATIONS}, - "topicConfigurationsToDelete": {"target": TOPIC_CONFIGURATIONS}, - "creatorModeConfiguration": {"target": CREATOR_MODE_CONFIGURATION}, - "hallucinationReductionConfiguration": { - "target": HALLUCINATION_REDUCTION_CONFIGURATION - }, - }, +RELEVANT_CONTENT_LIST: StaticSchema = (16, n0, _RCL, 0, (_m,), ((RELEVANT_CONTENT, 0),)) + +SEARCH_RELEVANT_CONTENT_OUTPUT: StaticSchema = ( + 18, + n0, + _SRCO, + {_sSI: _cSRCR, _smith: None}, + (_rCe, _nT), + ((RELEVANT_CONTENT_LIST, 0), (NEXT_TOKEN, 0)), +) + +START_DATA_SOURCE_SYNC_JOB_INPUT: StaticSchema = ( + 18, + n0, + _SDSSJI, + {_sSI: _cSDSSJR, _smit: None}, + (_dSI, _aIp, _iI), + ((DATA_SOURCE_ID, 9), (APPLICATION_ID, 9), (INDEX_ID, 9)), +) + +START_DATA_SOURCE_SYNC_JOB_OUTPUT: StaticSchema = ( + 18, + n0, + _SDSSJO, + {_sSI: _cSDSSJRo, _smith: None}, + (_eIx,), + ((EXECUTION_ID, 0),), +) + +START_DATA_SOURCE_SYNC_JOB: StaticOperationSchema = ( + 23, + n0, + _SDSSJ, + { + _smithy: MappingProxyType( + { + "uri": "/applications/{applicationId}/indices/{indexId}/datasources/{dataSourceId}/startsync", + "method": "POST", + } + ) + }, + START_DATA_SOURCE_SYNC_JOB_INPUT, + START_DATA_SOURCE_SYNC_JOB_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -UPDATE_CHAT_CONTROLS_CONFIGURATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#UpdateChatControlsConfigurationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#UpdateChatControlsConfigurationResponse", - ) - ], -) - -UPDATE_CHAT_CONTROLS_CONFIGURATION = Schema( - id=ShapeID("com.amazonaws.qbusiness#UpdateChatControlsConfiguration"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "uri": "/applications/{applicationId}/chatcontrols", - "method": "PATCH", - "code": 200, - } - ), - ) - ], +STOP_DATA_SOURCE_SYNC_JOB_INPUT: StaticSchema = ( + 18, + n0, + _SDSSJIt, + {_sSI: _cSDSSJRom, _smit: None}, + (_dSI, _aIp, _iI), + ((DATA_SOURCE_ID, 9), (APPLICATION_ID, 9), (INDEX_ID, 9)), +) + +STOP_DATA_SOURCE_SYNC_JOB_OUTPUT: StaticSchema = ( + 18, + n0, + _SDSSJOt, + {_sSI: _cSDSSJRoma, _smith: None}, +) + +STOP_DATA_SOURCE_SYNC_JOB: StaticOperationSchema = ( + 23, + n0, + _SDSSJt, + { + _smithy: MappingProxyType( + { + "uri": "/applications/{applicationId}/indices/{indexId}/datasources/{dataSourceId}/stopsync", + "method": "POST", + } + ) + }, + STOP_DATA_SOURCE_SYNC_JOB_INPUT, + STOP_DATA_SOURCE_SYNC_JOB_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -UPDATE_CHAT_RESPONSE_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#UpdateChatResponseConfigurationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#UpdateChatResponseConfigurationRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "chatResponseConfigurationId": { - "target": CHAT_RESPONSE_CONFIGURATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "displayName": {"target": DISPLAY_NAME}, - "responseConfigurations": { - "target": RESPONSE_CONFIGURATIONS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientToken": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - }, +TAG_RESOURCE_INPUT: StaticSchema = ( + 18, + n0, + _TRI, + {_sSI: _cTRR, _smit: None}, + (_rARN, _ta), + ((AMAZON_RESOURCE_NAME, 9), (TAGS, 1)), +) + +TAG_RESOURCE_OUTPUT: StaticSchema = (18, n0, _TRO, {_sSI: _cTRRo, _smith: None}) + +TAG_RESOURCE: StaticOperationSchema = ( + 23, + n0, + _TR, + {_smithy: MappingProxyType({"uri": "/v1/tags/{resourceARN}", "method": "POST"})}, + TAG_RESOURCE_INPUT, + TAG_RESOURCE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -UPDATE_CHAT_RESPONSE_CONFIGURATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#UpdateChatResponseConfigurationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#UpdateChatResponseConfigurationResponse", - ) - ], -) - -UPDATE_CHAT_RESPONSE_CONFIGURATION = Schema( - id=ShapeID("com.amazonaws.qbusiness#UpdateChatResponseConfiguration"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PUT", - "uri": "/applications/{applicationId}/chatresponseconfigurations/{chatResponseConfigurationId}", - } - ), - ) - ], +TAG_KEYS: StaticSchema = (16, n0, _TKa, 0, (_m,), ((TAG_KEY, 0),)) + +UNTAG_RESOURCE_INPUT: StaticSchema = ( + 18, + n0, + _URIn, + {_sSI: _cURRom, _smit: None}, + (_rARN, _tK), + ((AMAZON_RESOURCE_NAME, 9), (TAG_KEYS, {_sQ: _tK, _s: None})), +) + +UNTAG_RESOURCE_OUTPUT: StaticSchema = (18, n0, _UROn, {_sSI: _cURRoma, _smith: None}) + +UNTAG_RESOURCE: StaticOperationSchema = ( + 23, + n0, + _URn, + {_smithy: MappingProxyType({"uri": "/v1/tags/{resourceARN}", "method": "DELETE"})}, + UNTAG_RESOURCE_INPUT, + UNTAG_RESOURCE_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -UPDATE_SUBSCRIPTION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#UpdateSubscriptionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#UpdateSubscriptionRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "subscriptionId": { - "target": SUBSCRIPTION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "type": { - "target": SUBSCRIPTION_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +ORCHESTRATION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _OCr, + 0, + (_cont,), + ((ORCHESTRATION_CONTROL, 1),), +) + +UPDATE_CHAT_CONTROLS_CONFIGURATION_INPUT: StaticSchema = ( + 18, + n0, + _UCCCI, + {_sSI: _cUCCCR, _smit: None}, + (_aIp, _cT, _rS, _oC, _bPCU, _tCTCOU, _tCTD, _cMCr, _hRCa), + ( + (APPLICATION_ID, 9), + (CLIENT_TOKEN, 2), + (RESPONSE_SCOPE, 0), + (ORCHESTRATION_CONFIGURATION, 0), + (BLOCKED_PHRASES_CONFIGURATION_UPDATE, 0), + (TOPIC_CONFIGURATIONS, 0), + (TOPIC_CONFIGURATIONS, 0), + (CREATOR_MODE_CONFIGURATION, 0), + (HALLUCINATION_REDUCTION_CONFIGURATION, 0), + ), ) -UPDATE_SUBSCRIPTION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#UpdateSubscriptionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#UpdateSubscriptionResponse", - ) - ], - members={ - "subscriptionArn": {"target": SUBSCRIPTION_ARN}, - "currentSubscription": {"target": SUBSCRIPTION_DETAILS}, - "nextSubscription": {"target": SUBSCRIPTION_DETAILS}, - }, +UPDATE_CHAT_CONTROLS_CONFIGURATION_OUTPUT: StaticSchema = ( + 18, + n0, + _UCCCO, + {_sSI: _cUCCCRo, _smith: None}, +) + +UPDATE_CHAT_CONTROLS_CONFIGURATION: StaticOperationSchema = ( + 23, + n0, + _UCCC, + { + _smithy: MappingProxyType( + { + "uri": "/applications/{applicationId}/chatcontrols", + "method": "PATCH", + "code": 200, + } + ) + }, + UPDATE_CHAT_CONTROLS_CONFIGURATION_INPUT, + UPDATE_CHAT_CONTROLS_CONFIGURATION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -UPDATE_SUBSCRIPTION = Schema( - id=ShapeID("com.amazonaws.qbusiness#UpdateSubscription"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "PUT", - "uri": "/applications/{applicationId}/subscriptions/{subscriptionId}", - } - ), - ) - ], +UPDATE_CHAT_RESPONSE_CONFIGURATION_INPUT: StaticSchema = ( + 18, + n0, + _UCRCI, + {_sSI: _cUCRCR, _smit: None}, + (_aIp, _cRCI, _dN, _rC, _cT), + ( + (APPLICATION_ID, 9), + (CHAT_RESPONSE_CONFIGURATION_ID, 9), + (DISPLAY_NAME, 0), + (RESPONSE_CONFIGURATIONS, 1), + (STRING, 2), + ), ) -UPDATE_USER_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#UpdateUserInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#UpdateUserRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "userId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "userAliasesToUpdate": {"target": USER_ALIASES}, - "userAliasesToDelete": {"target": USER_ALIASES}, - }, +UPDATE_CHAT_RESPONSE_CONFIGURATION_OUTPUT: StaticSchema = ( + 18, + n0, + _UCRCO, + {_sSI: _cUCRCRo, _smith: None}, +) + +UPDATE_CHAT_RESPONSE_CONFIGURATION: StaticOperationSchema = ( + 23, + n0, + _UCRC, + { + _smithy: MappingProxyType( + { + "method": "PUT", + "uri": "/applications/{applicationId}/chatresponseconfigurations/{chatResponseConfigurationId}", + } + ) + }, + UPDATE_CHAT_RESPONSE_CONFIGURATION_INPUT, + UPDATE_CHAT_RESPONSE_CONFIGURATION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -UPDATE_USER_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#UpdateUserOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#UpdateUserResponse", - ) - ], - members={ - "userAliasesAdded": {"target": USER_ALIASES}, - "userAliasesUpdated": {"target": USER_ALIASES}, - "userAliasesDeleted": {"target": USER_ALIASES}, - }, +UPDATE_SUBSCRIPTION_INPUT: StaticSchema = ( + 18, + n0, + _USI, + {_sSI: _cUSR, _smit: None}, + (_aIp, _sIu, _t), + ((APPLICATION_ID, 9), (SUBSCRIPTION_ID, 9), (SUBSCRIPTION_TYPE, 1)), +) + +UPDATE_SUBSCRIPTION_OUTPUT: StaticSchema = ( + 18, + n0, + _USO, + {_sSI: _cUSRo, _smith: None}, + (_sAu, _cS, _nS), + ((SUBSCRIPTION_ARN, 0), (SUBSCRIPTION_DETAILS, 0), (SUBSCRIPTION_DETAILS, 0)), +) + +UPDATE_SUBSCRIPTION: StaticOperationSchema = ( + 23, + n0, + _US, + { + _smithy: MappingProxyType( + { + "method": "PUT", + "uri": "/applications/{applicationId}/subscriptions/{subscriptionId}", + } + ) + }, + UPDATE_SUBSCRIPTION_INPUT, + UPDATE_SUBSCRIPTION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -UPDATE_USER = Schema( - id=ShapeID("com.amazonaws.qbusiness#UpdateUser"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "PUT", "uri": "/applications/{applicationId}/users/{userId}"} - ), - ) - ], -) - -ATTRIBUTE_FILTER = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#AttributeFilter"), - members={ - # This needs to reference a schema that isn't defined yet. - # It will be populated with a non-null value at the end of the file. - "andAllFilters": None, - # This needs to reference a schema that isn't defined yet. - # It will be populated with a non-null value at the end of the file. - "orAllFilters": None, - # This needs to reference a schema that isn't defined yet. - # It will be populated with a non-null value at the end of the file. - "notFilter": None, - "equalsTo": {"target": DOCUMENT_ATTRIBUTE}, - "containsAll": {"target": DOCUMENT_ATTRIBUTE}, - "containsAny": {"target": DOCUMENT_ATTRIBUTE}, - "greaterThan": {"target": DOCUMENT_ATTRIBUTE}, - "greaterThanOrEquals": {"target": DOCUMENT_ATTRIBUTE}, - "lessThan": {"target": DOCUMENT_ATTRIBUTE}, - "lessThanOrEquals": {"target": DOCUMENT_ATTRIBUTE}, - }, +UPDATE_USER_INPUT: StaticSchema = ( + 18, + n0, + _UUI, + {_sSI: _cUUR, _smit: None}, + (_aIp, _uI, _uATU, _uATD), + ((APPLICATION_ID, 9), (STRING, 9), (USER_ALIASES, 0), (USER_ALIASES, 0)), +) + +UPDATE_USER_OUTPUT: StaticSchema = ( + 18, + n0, + _UUO, + {_sSI: _cUURo, _smith: None}, + (_uAA, _uAU, _uAD), + ((USER_ALIASES, 0), (USER_ALIASES, 0), (USER_ALIASES, 0)), +) + +UPDATE_USER: StaticOperationSchema = ( + 23, + n0, + _UU, + { + _smithy: MappingProxyType( + {"method": "PUT", "uri": "/applications/{applicationId}/users/{userId}"} + ) + }, + UPDATE_USER_INPUT, + UPDATE_USER_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -ATTRIBUTE_FILTERS = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#AttributeFilters"), - shape_type=ShapeType.LIST, - members={"member": {"target": ATTRIBUTE_FILTER}}, +ATTRIBUTE_FILTER: StaticSchema = ( + 18, + n0, + _AF, + 0, + (_aAF, _oAF, _nF, _eTq, _cAo, _cAon, _gT, _gTOE, _lT, _lTOE), + ( + (lambda: ATTRIBUTE_FILTERS, 0), + (lambda: ATTRIBUTE_FILTERS, 0), + (lambda: ATTRIBUTE_FILTER, 0), + (DOCUMENT_ATTRIBUTE, 0), + (DOCUMENT_ATTRIBUTE, 0), + (DOCUMENT_ATTRIBUTE, 0), + (DOCUMENT_ATTRIBUTE, 0), + (DOCUMENT_ATTRIBUTE, 0), + (DOCUMENT_ATTRIBUTE, 0), + (DOCUMENT_ATTRIBUTE, 0), + ), ) -ACTION_FILTER_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ActionFilterConfiguration"), - members={ - "documentAttributeFilter": { - "target": ATTRIBUTE_FILTER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +ATTRIBUTE_FILTERS: StaticSchema = (16, n0, _AFt, 0, (_m,), ((ATTRIBUTE_FILTER, 0),)) + +ACTION_FILTER_CONFIGURATION: StaticSchema = ( + 18, + n0, + _AFC, + 0, + (_dAF,), + ((ATTRIBUTE_FILTER, 1),), +) + +CHAT_SYNC_INPUT: StaticSchema = ( + 18, + n0, + _CSIh, + {_smit: None}, + (_aIp, _uI, _uG, _uM, _atta, _aE, _aCRu, _cI, _pMI, _aFt, _cM, _cMCh, _cT), + ( + (APPLICATION_ID, 9), + (USER_ID, {_sQ: _uI}), + (USER_GROUPS, {_sQ: _uG}), + (USER_MESSAGE, 0), + (ATTACHMENTS_INPUT, 0), + (ACTION_EXECUTION, 0), + (AUTH_CHALLENGE_RESPONSE, 0), + (CONVERSATION_ID, 0), + (MESSAGE_ID, 0), + (ATTRIBUTE_FILTER, 0), + (CHAT_MODE, 0), + (CHAT_MODE_CONFIGURATION, 0), + (CLIENT_TOKEN, 2), + ), ) -CHAT_SYNC_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ChatSyncInput"), - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "userId": { - "target": USER_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="userId")], - }, - "userGroups": { - "target": USER_GROUPS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="userGroups") - ], - }, - "userMessage": {"target": USER_MESSAGE}, - "attachments": {"target": ATTACHMENTS_INPUT}, - "actionExecution": {"target": ACTION_EXECUTION}, - "authChallengeResponse": {"target": AUTH_CHALLENGE_RESPONSE}, - "conversationId": {"target": CONVERSATION_ID}, - "parentMessageId": {"target": MESSAGE_ID}, - "attributeFilter": {"target": ATTRIBUTE_FILTER}, - "chatMode": {"target": CHAT_MODE}, - "chatModeConfiguration": {"target": CHAT_MODE_CONFIGURATION}, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - }, +CONFIGURATION_EVENT: StaticSchema = ( + 18, + n0, + _CEo, + 0, + (_cM, _cMCh, _aFt), + ((CHAT_MODE, 0), (CHAT_MODE_CONFIGURATION, 0), (ATTRIBUTE_FILTER, 0)), +) + +SEARCH_RELEVANT_CONTENT_INPUT: StaticSchema = ( + 18, + n0, + _SRCI, + {_sSI: _cSRCRo, _smit: None}, + (_aIp, _qT, _cSo, _aFt, _mRa, _nT), + ( + (APPLICATION_ID, 9), + (QUERY_TEXT, 1), + (CONTENT_SOURCE, 1), + (ATTRIBUTE_FILTER, 0), + (MAX_RESULTS, {_smithyapi: 10}), + (NEXT_TOKEN, 0), + ), ) -CONFIGURATION_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ConfigurationEvent"), - members={ - "chatMode": {"target": CHAT_MODE}, - "chatModeConfiguration": {"target": CHAT_MODE_CONFIGURATION}, - "attributeFilter": {"target": ATTRIBUTE_FILTER}, - }, +CHAT_SYNC: StaticOperationSchema = ( + 23, + n0, + _CSh, + { + _smithy: MappingProxyType( + { + "uri": "/applications/{applicationId}/conversations?sync", + "method": "POST", + } + ) + }, + CHAT_SYNC_INPUT, + CHAT_SYNC_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + EXTERNAL_RESOURCE_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + LICENSE_NOT_FOUND_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -SEARCH_RELEVANT_CONTENT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#SearchRelevantContentInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#SearchRelevantContentRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "queryText": { - "target": QUERY_TEXT, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "contentSource": { - "target": CONTENT_SOURCE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "attributeFilter": {"target": ATTRIBUTE_FILTER}, - "maxResults": { - "target": MAX_RESULTS, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=10)], - }, - "nextToken": {"target": NEXT_TOKEN}, - }, +SEARCH_RELEVANT_CONTENT: StaticOperationSchema = ( + 23, + n0, + _SRC, + { + _smithy: MappingProxyType( + {"uri": "/applications/{applicationId}/relevant-content", "method": "POST"} + ) + }, + SEARCH_RELEVANT_CONTENT_INPUT, + SEARCH_RELEVANT_CONTENT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + LICENSE_NOT_FOUND_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CHAT_SYNC = Schema( - id=ShapeID("com.amazonaws.qbusiness#ChatSync"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "uri": "/applications/{applicationId}/conversations?sync", - "method": "POST", - } - ), - ) - ], -) - -SEARCH_RELEVANT_CONTENT = Schema( - id=ShapeID("com.amazonaws.qbusiness#SearchRelevantContent"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "uri": "/applications/{applicationId}/relevant-content", - "method": "POST", - } - ), - ) - ], +ACTION_CONFIGURATION: StaticSchema = ( + 18, + n0, + _ACct, + 0, + (_act, _fC), + ((Q_IAM_ACTION, 1), (ACTION_FILTER_CONFIGURATION, 0)), +) + +CHAT_INPUT_STREAM: StaticSchema = ( + 19, + n0, + _CIS, + {_smithyap: None}, + (_cE, _tE, _aEt, _aEE, _eOIE, _aCREu), + ( + (CONFIGURATION_EVENT, 0), + (TEXT_INPUT_EVENT, 0), + (ATTACHMENT_INPUT_EVENT, 0), + (ACTION_EXECUTION_EVENT, 0), + (END_OF_INPUT_EVENT, 0), + (AUTH_CHALLENGE_RESPONSE_EVENT, 0), + ), ) -ACTION_CONFIGURATION = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ActionConfiguration"), - members={ - "action": { - "target": Q_IAM_ACTION, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "filterConfiguration": {"target": ACTION_FILTER_CONFIGURATION}, - }, +ACTION_CONFIGURATION_LIST: StaticSchema = ( + 16, + n0, + _ACL, + 0, + (_m,), + ((ACTION_CONFIGURATION, 0),), +) + +CHAT_INPUT: StaticSchema = ( + 18, + n0, + _CIh, + {_smit: None}, + (_aIp, _uI, _uG, _cI, _pMI, _cT, _iSn), + ( + (APPLICATION_ID, 9), + (USER_ID, {_sQ: _uI}), + (USER_GROUPS, {_sQ: _uG}), + (CONVERSATION_ID, {_sQ: _cI}), + (MESSAGE_ID, {_sQ: _pMI}), + (CLIENT_TOKEN, {_sQ: _cT, _sT: None}), + (CHAT_INPUT_STREAM, 16), + ), ) -CHAT_INPUT_STREAM = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ChatInputStream"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#streaming"))], - members={ - "configurationEvent": {"target": CONFIGURATION_EVENT}, - "textEvent": {"target": TEXT_INPUT_EVENT}, - "attachmentEvent": {"target": ATTACHMENT_INPUT_EVENT}, - "actionExecutionEvent": {"target": ACTION_EXECUTION_EVENT}, - "endOfInputEvent": {"target": END_OF_INPUT_EVENT}, - "authChallengeResponseEvent": {"target": AUTH_CHALLENGE_RESPONSE_EVENT}, - }, +CHAT: StaticOperationSchema = ( + 23, + n0, + _Ch, + { + _smithy: MappingProxyType( + {"uri": "/applications/{applicationId}/conversations", "method": "POST"} + ) + }, + CHAT_INPUT, + CHAT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + EXTERNAL_RESOURCE_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + LICENSE_NOT_FOUND_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -ACTION_CONFIGURATION_LIST = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ActionConfigurationList"), - shape_type=ShapeType.LIST, - members={"member": {"target": ACTION_CONFIGURATION}}, -) - -CHAT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#ChatInput"), - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "userId": { - "target": USER_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#httpQuery"), value="userId")], - }, - "userGroups": { - "target": USER_GROUPS, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="userGroups") - ], - }, - "conversationId": { - "target": CONVERSATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="conversationId") - ], - }, - "parentMessageId": { - "target": MESSAGE_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="parentMessageId") - ], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#idempotencyToken")), - Trait.new(id=ShapeID("smithy.api#httpQuery"), value="clientToken"), - ], - }, - "inputStream": { - "target": CHAT_INPUT_STREAM, - "traits": [Trait.new(id=ShapeID("smithy.api#httpPayload"))], - }, - }, +CREATE_DATA_ACCESSOR_INPUT: StaticSchema = ( + 18, + n0, + _CDAIr, + {_sSI: _cCDARoma, _smit: None}, + (_aIp, _pr, _aCct, _cT, _dN, _aD, _ta), + ( + (APPLICATION_ID, 9), + (PRINCIPAL_ROLE_ARN, 1), + (ACTION_CONFIGURATION_LIST, 1), + (CLIENT_TOKEN, 2), + (DATA_ACCESSOR_NAME, 1), + (DATA_ACCESSOR_AUTHENTICATION_DETAIL, 0), + (TAGS, 0), + ), ) -CHAT = Schema( - id=ShapeID("com.amazonaws.qbusiness#Chat"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"uri": "/applications/{applicationId}/conversations", "method": "POST"} - ), - ) - ], +GET_DATA_ACCESSOR_OUTPUT: StaticSchema = ( + 18, + n0, + _GDAO, + {_sSI: _cGDARo, _smith: None}, + (_dN, _dAI, _dAA, _aIp, _iAA, _pr, _aCct, _aD, _cA, _uA), + ( + (DATA_ACCESSOR_NAME, 0), + (DATA_ACCESSOR_ID, 0), + (DATA_ACCESSOR_ARN, 0), + (APPLICATION_ID, 0), + (IDC_APPLICATION_ARN, 0), + (PRINCIPAL_ROLE_ARN, 0), + (ACTION_CONFIGURATION_LIST, 0), + (DATA_ACCESSOR_AUTHENTICATION_DETAIL, 0), + (TIMESTAMP, 0), + (TIMESTAMP, 0), + ), ) -CREATE_DATA_ACCESSOR_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#CreateDataAccessorInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#CreateDataAccessorRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "principal": { - "target": PRINCIPAL_ROLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "actionConfigurations": { - "target": ACTION_CONFIGURATION_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "displayName": { - "target": DATA_ACCESSOR_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "authenticationDetail": {"target": DATA_ACCESSOR_AUTHENTICATION_DETAIL}, - "tags": {"target": TAGS}, - }, +UPDATE_DATA_ACCESSOR_INPUT: StaticSchema = ( + 18, + n0, + _UDAI, + {_sSI: _cUDARo, _smit: None}, + (_aIp, _dAI, _aCct, _aD, _dN), + ( + (APPLICATION_ID, 9), + (DATA_ACCESSOR_ID, 9), + (ACTION_CONFIGURATION_LIST, 1), + (DATA_ACCESSOR_AUTHENTICATION_DETAIL, 0), + (DATA_ACCESSOR_NAME, 0), + ), ) -GET_DATA_ACCESSOR_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#GetDataAccessorOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#GetDataAccessorResponse", - ) - ], - members={ - "displayName": {"target": DATA_ACCESSOR_NAME}, - "dataAccessorId": {"target": DATA_ACCESSOR_ID}, - "dataAccessorArn": {"target": DATA_ACCESSOR_ARN}, - "applicationId": {"target": APPLICATION_ID}, - "idcApplicationArn": {"target": IDC_APPLICATION_ARN}, - "principal": {"target": PRINCIPAL_ROLE_ARN}, - "actionConfigurations": {"target": ACTION_CONFIGURATION_LIST}, - "authenticationDetail": {"target": DATA_ACCESSOR_AUTHENTICATION_DETAIL}, - "createdAt": {"target": TIMESTAMP}, - "updatedAt": {"target": TIMESTAMP}, - }, +CREATE_DATA_ACCESSOR: StaticOperationSchema = ( + 23, + n0, + _CDAr, + { + _smithy: MappingProxyType( + {"uri": "/applications/{applicationId}/dataaccessors", "method": "POST"} + ) + }, + CREATE_DATA_ACCESSOR_INPUT, + CREATE_DATA_ACCESSOR_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -UPDATE_DATA_ACCESSOR_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.qbusiness#UpdateDataAccessorInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.qbusiness#UpdateDataAccessorRequest", - ) - ], - members={ - "applicationId": { - "target": APPLICATION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "dataAccessorId": { - "target": DATA_ACCESSOR_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "actionConfigurations": { - "target": ACTION_CONFIGURATION_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "authenticationDetail": {"target": DATA_ACCESSOR_AUTHENTICATION_DETAIL}, - "displayName": {"target": DATA_ACCESSOR_NAME}, - }, +GET_DATA_ACCESSOR: StaticOperationSchema = ( + 23, + n0, + _GDA, + { + _smithy: MappingProxyType( + { + "uri": "/applications/{applicationId}/dataaccessors/{dataAccessorId}", + "method": "GET", + } + ) + }, + GET_DATA_ACCESSOR_INPUT, + GET_DATA_ACCESSOR_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -CREATE_DATA_ACCESSOR = Schema( - id=ShapeID("com.amazonaws.qbusiness#CreateDataAccessor"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"uri": "/applications/{applicationId}/dataaccessors", "method": "POST"} - ), - ) - ], -) - -GET_DATA_ACCESSOR = Schema( - id=ShapeID("com.amazonaws.qbusiness#GetDataAccessor"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "uri": "/applications/{applicationId}/dataaccessors/{dataAccessorId}", - "method": "GET", - } - ), - ) - ], -) - -UPDATE_DATA_ACCESSOR = Schema( - id=ShapeID("com.amazonaws.qbusiness#UpdateDataAccessor"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "uri": "/applications/{applicationId}/dataaccessors/{dataAccessorId}", - "method": "PUT", - } - ), - ) - ], +UPDATE_DATA_ACCESSOR: StaticOperationSchema = ( + 23, + n0, + _UDA, + { + _smithy: MappingProxyType( + { + "uri": "/applications/{applicationId}/dataaccessors/{dataAccessorId}", + "method": "PUT", + } + ) + }, + UPDATE_DATA_ACCESSOR_INPUT, + UPDATE_DATA_ACCESSOR_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLING_EXCEPTION, + VALIDATION_EXCEPTION, + ), ) -EXPERT_Q = Schema( - id=ShapeID("com.amazonaws.qbusiness#ExpertQ"), - shape_type=ShapeType.SERVICE, - traits=[ - Trait.new( - id=ShapeID("aws.auth#sigv4"), value=MappingProxyType({"name": "qbusiness"}) - ), - Trait.new( - id=ShapeID("smithy.rules#endpointBdd"), - value=MappingProxyType( - { - "version": "1.1", - "parameters": MappingProxyType( - { - "Region": MappingProxyType( - { - "builtIn": "AWS::Region", - "required": False, - "documentation": "The AWS region used to dispatch the request.", - "type": "string", - } - ), - "UseFIPS": MappingProxyType( - { - "builtIn": "AWS::UseFIPS", - "required": True, - "default": False, - "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", - "type": "boolean", - } - ), - "Endpoint": MappingProxyType( - { - "builtIn": "SDK::Endpoint", - "required": False, - "documentation": "Override the endpoint used to send this request", - "type": "string", - } - ), - } - ), - "conditions": ( - MappingProxyType( - { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "Endpoint"}),), - } - ), - MappingProxyType( - { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "Region"}),), - } - ), - MappingProxyType( +EXPERT_Q: StaticSchema = ( + 21, + n0, + _EQ, + { + _aw: MappingProxyType({"name": "qbusiness"}), + _sB: MappingProxyType( + { + "version": "1.1", + "parameters": MappingProxyType( + { + "Region": MappingProxyType( { - "fn": "aws.partition", - "argv": (MappingProxyType({"ref": "Region"}),), - "assign": "PartitionResult", + "builtIn": "AWS::Region", + "required": False, + "documentation": "The AWS region used to dispatch the request.", + "type": "string", } ), - MappingProxyType( + "UseFIPS": MappingProxyType( { - "fn": "booleanEquals", - "argv": (MappingProxyType({"ref": "UseFIPS"}), True), - } - ), - MappingProxyType( - { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "supportsFIPS", - ), - } - ), - True, - ), + "builtIn": "AWS::UseFIPS", + "required": True, + "default": False, + "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", + "type": "boolean", } ), - MappingProxyType( + "Endpoint": MappingProxyType( { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "supportsDualStack", - ), - } - ), - True, - ), + "builtIn": "SDK::Endpoint", + "required": False, + "documentation": "Override the endpoint used to send this request", + "type": "string", } ), + } + ), + "conditions": ( + MappingProxyType( + { + "fn": "isSet", + "argv": (MappingProxyType({"ref": "Endpoint"}),), + } ), - "results": ( - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: FIPS and custom endpoint are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": MappingProxyType({"ref": "Endpoint"}), - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://qbusiness-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "FIPS is enabled but this partition does not support FIPS", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://qbusiness.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + MappingProxyType( + {"fn": "isSet", "argv": (MappingProxyType({"ref": "Region"}),)} + ), + MappingProxyType( + { + "fn": "aws.partition", + "argv": (MappingProxyType({"ref": "Region"}),), + "assign": "PartitionResult", + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": (MappingProxyType({"ref": "UseFIPS"}), True), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( { - "url": "https://qbusiness-fips.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "supportsFIPS", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + True, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( { - "url": "https://qbusiness.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "supportsDualStack", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: Missing Region", - "type": "error", - } - ), + True, + ), + } ), - "root": 2, - "nodeCount": 9, - "nodes": "/////wAAAAH/////AAAAAAAAAAkAAAADAAAAAQAAAAQF9eEIAAAAAgAAAAUF9eEIAAAAAwAAAAcAAAAGAAAABQX14QUF9eEHAAAABAAAAAgF9eEEAAAABQX14QMF9eEGAAAAAwX14QEF9eEC", - } - ), - ), - Trait.new( - id=ShapeID("aws.api#service"), - value=MappingProxyType( - { - "sdkId": "QBusiness", - "cloudFormationName": "QBusiness", - "arnNamespace": "qbusiness", - "cloudTrailEventSource": "qbusiness.amazonaws.com", - } - ), + ), + "results": ( + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: FIPS and custom endpoint are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": MappingProxyType({"ref": "Endpoint"}), + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://qbusiness-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS is enabled but this partition does not support FIPS", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://qbusiness.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://qbusiness-fips.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://qbusiness.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Missing Region", + "type": "error", + } + ), + ), + "root": 2, + "nodeCount": 9, + "nodes": "/////wAAAAH/////AAAAAAAAAAkAAAADAAAAAQAAAAQF9eEIAAAAAgAAAAUF9eEIAAAAAwAAAAcAAAAGAAAABQX14QUF9eEHAAAABAAAAAgF9eEEAAAABQX14QMF9eEGAAAAAwX14QEF9eEC", + } ), - Trait.new( - id=ShapeID("aws.protocols#restJson1"), - value=MappingProxyType( - {"http": ("h2", "http/1.1"), "eventStreamHttp": ("h2",)} - ), + _aws: MappingProxyType( + { + "sdkId": "QBusiness", + "cloudFormationName": "QBusiness", + "arnNamespace": "qbusiness", + "cloudTrailEventSource": "qbusiness.amazonaws.com", + } ), - ], -) - -ATTRIBUTE_FILTER.members["andAllFilters"] = Schema.member( - id=ATTRIBUTE_FILTER.id.with_member("andAllFilters"), - target=ATTRIBUTE_FILTERS, - index=0, -) - -ATTRIBUTE_FILTER.members["notFilter"] = Schema.member( - id=ATTRIBUTE_FILTER.id.with_member("notFilter"), target=ATTRIBUTE_FILTER, index=2 -) - -ATTRIBUTE_FILTER.members["orAllFilters"] = Schema.member( - id=ATTRIBUTE_FILTER.id.with_member("orAllFilters"), - target=ATTRIBUTE_FILTERS, - index=1, + _aJ: MappingProxyType({"http": ("h2", "http/1.1"), "eventStreamHttp": ("h2",)}), + }, ) diff --git a/clients/aws-sdk-qbusiness/src/aws_sdk_qbusiness/client.py b/clients/aws-sdk-qbusiness/src/aws_sdk_qbusiness/client.py index b4af896c..09703bdb 100644 --- a/clients/aws-sdk-qbusiness/src/aws_sdk_qbusiness/client.py +++ b/clients/aws-sdk-qbusiness/src/aws_sdk_qbusiness/client.py @@ -1,32 +1,28 @@ # Code generated by smithy-python-codegen DO NOT EDIT. +from __future__ import annotations + from copy import deepcopy import logging from typing import Any, cast +from smithy_aws_core.aio.identity.chain import AsyncIdentityChain from smithy_aws_core.config import ConfigSource from smithy_aws_core.identity import AWSCredentialsIdentity -from smithy_aws_core.identity.chain import IdentityChain -from smithy_core.aio.client import AsyncClient, ClientCall, RequestPipeline -from smithy_core.aio.eventstream import DuplexEventStream +from smithy_core.aio.client import AsyncClient, AsyncClientCall, AsyncRequestPipeline +from smithy_core.aio.eventstream import AsyncDuplexEventStream from smithy_core.deserializers import DeserializeableShape from smithy_core.exceptions import ExpectationNotMetError from smithy_core.schemas import APIOperation from smithy_core.serializers import SerializeableShape -from smithy_http.aio.interfaces import HTTPClient +from smithy_http.aio.interfaces import AsyncHTTPClient from smithy_http.plugins import user_agent_plugin from .config import AsyncQBusinessConfig, Plugin from .models import ( ASSOCIATE_PERMISSION, - AssociatePermissionInput, - AssociatePermissionOutput, BATCH_DELETE_DOCUMENT, BATCH_PUT_DOCUMENT, - BatchDeleteDocumentInput, - BatchDeleteDocumentOutput, - BatchPutDocumentInput, - BatchPutDocumentOutput, CANCEL_SUBSCRIPTION, CHAT, CHAT_SYNC, @@ -42,38 +38,10 @@ CREATE_SUBSCRIPTION, CREATE_USER, CREATE_WEB_EXPERIENCE, - CancelSubscriptionInput, - CancelSubscriptionOutput, ChatInput, ChatInputStream, ChatOutput, ChatOutputStream, - ChatSyncInput, - ChatSyncOutput, - CheckDocumentAccessInput, - CheckDocumentAccessOutput, - CreateAnonymousWebExperienceUrlInput, - CreateAnonymousWebExperienceUrlOutput, - CreateApplicationInput, - CreateApplicationOutput, - CreateChatResponseConfigurationInput, - CreateChatResponseConfigurationOutput, - CreateDataAccessorInput, - CreateDataAccessorOutput, - CreateDataSourceInput, - CreateDataSourceOutput, - CreateIndexInput, - CreateIndexOutput, - CreatePluginInput, - CreatePluginOutput, - CreateRetrieverInput, - CreateRetrieverOutput, - CreateSubscriptionInput, - CreateSubscriptionOutput, - CreateUserInput, - CreateUserOutput, - CreateWebExperienceInput, - CreateWebExperienceOutput, DELETE_APPLICATION, DELETE_ATTACHMENT, DELETE_CHAT_CONTROLS_CONFIGURATION, @@ -88,34 +56,6 @@ DELETE_USER, DELETE_WEB_EXPERIENCE, DISASSOCIATE_PERMISSION, - DeleteApplicationInput, - DeleteApplicationOutput, - DeleteAttachmentInput, - DeleteAttachmentOutput, - DeleteChatControlsConfigurationInput, - DeleteChatControlsConfigurationOutput, - DeleteChatResponseConfigurationInput, - DeleteChatResponseConfigurationOutput, - DeleteConversationInput, - DeleteConversationOutput, - DeleteDataAccessorInput, - DeleteDataAccessorOutput, - DeleteDataSourceInput, - DeleteDataSourceOutput, - DeleteGroupInput, - DeleteGroupOutput, - DeleteIndexInput, - DeleteIndexOutput, - DeletePluginInput, - DeletePluginOutput, - DeleteRetrieverInput, - DeleteRetrieverOutput, - DeleteUserInput, - DeleteUserOutput, - DeleteWebExperienceInput, - DeleteWebExperienceOutput, - DisassociatePermissionInput, - DisassociatePermissionOutput, GET_APPLICATION, GET_CHAT_CONTROLS_CONFIGURATION, GET_CHAT_RESPONSE_CONFIGURATION, @@ -130,34 +70,6 @@ GET_RETRIEVER, GET_USER, GET_WEB_EXPERIENCE, - GetApplicationInput, - GetApplicationOutput, - GetChatControlsConfigurationInput, - GetChatControlsConfigurationOutput, - GetChatResponseConfigurationInput, - GetChatResponseConfigurationOutput, - GetDataAccessorInput, - GetDataAccessorOutput, - GetDataSourceInput, - GetDataSourceOutput, - GetDocumentContentInput, - GetDocumentContentOutput, - GetGroupInput, - GetGroupOutput, - GetIndexInput, - GetIndexOutput, - GetMediaInput, - GetMediaOutput, - GetPluginInput, - GetPluginOutput, - GetPolicyInput, - GetPolicyOutput, - GetRetrieverInput, - GetRetrieverOutput, - GetUserInput, - GetUserOutput, - GetWebExperienceInput, - GetWebExperienceOutput, LIST_APPLICATIONS, LIST_ATTACHMENTS, LIST_CHAT_RESPONSE_CONFIGURATIONS, @@ -177,62 +89,12 @@ LIST_SUBSCRIPTIONS, LIST_TAGS_FOR_RESOURCE, LIST_WEB_EXPERIENCES, - ListApplicationsInput, - ListApplicationsOutput, - ListAttachmentsInput, - ListAttachmentsOutput, - ListChatResponseConfigurationsInput, - ListChatResponseConfigurationsOutput, - ListConversationsInput, - ListConversationsOutput, - ListDataAccessorsInput, - ListDataAccessorsOutput, - ListDataSourceSyncJobsInput, - ListDataSourceSyncJobsOutput, - ListDataSourcesInput, - ListDataSourcesOutput, - ListDocumentsInput, - ListDocumentsOutput, - ListGroupsInput, - ListGroupsOutput, - ListIndicesInput, - ListIndicesOutput, - ListMessagesInput, - ListMessagesOutput, - ListPluginActionsInput, - ListPluginActionsOutput, - ListPluginTypeActionsInput, - ListPluginTypeActionsOutput, - ListPluginTypeMetadataInput, - ListPluginTypeMetadataOutput, - ListPluginsInput, - ListPluginsOutput, - ListRetrieversInput, - ListRetrieversOutput, - ListSubscriptionsInput, - ListSubscriptionsOutput, - ListTagsForResourceInput, - ListTagsForResourceOutput, - ListWebExperiencesInput, - ListWebExperiencesOutput, PUT_FEEDBACK, PUT_GROUP, - PutFeedbackInput, - PutFeedbackOutput, - PutGroupInput, - PutGroupOutput, SEARCH_RELEVANT_CONTENT, START_DATA_SOURCE_SYNC_JOB, STOP_DATA_SOURCE_SYNC_JOB, - SearchRelevantContentInput, - SearchRelevantContentOutput, - StartDataSourceSyncJobInput, - StartDataSourceSyncJobOutput, - StopDataSourceSyncJobInput, - StopDataSourceSyncJobOutput, TAG_RESOURCE, - TagResourceInput, - TagResourceOutput, UNTAG_RESOURCE, UPDATE_APPLICATION, UPDATE_CHAT_CONTROLS_CONFIGURATION, @@ -245,34 +107,180 @@ UPDATE_SUBSCRIPTION, UPDATE_USER, UPDATE_WEB_EXPERIENCE, - UntagResourceInput, - UntagResourceOutput, - UpdateApplicationInput, - UpdateApplicationOutput, - UpdateChatControlsConfigurationInput, - UpdateChatControlsConfigurationOutput, - UpdateChatResponseConfigurationInput, - UpdateChatResponseConfigurationOutput, - UpdateDataAccessorInput, - UpdateDataAccessorOutput, - UpdateDataSourceInput, - UpdateDataSourceOutput, - UpdateIndexInput, - UpdateIndexOutput, - UpdatePluginInput, - UpdatePluginOutput, - UpdateRetrieverInput, - UpdateRetrieverOutput, - UpdateSubscriptionInput, - UpdateSubscriptionOutput, - UpdateUserInput, - UpdateUserOutput, - UpdateWebExperienceInput, - UpdateWebExperienceOutput, _ChatOutputStreamDeserializer, ) from .user_agent import aws_user_agent_plugin +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .models import ( + AssociatePermissionInput, + AssociatePermissionOutput, + BatchDeleteDocumentInput, + BatchDeleteDocumentOutput, + BatchPutDocumentInput, + BatchPutDocumentOutput, + CancelSubscriptionInput, + CancelSubscriptionOutput, + ChatSyncInput, + ChatSyncOutput, + CheckDocumentAccessInput, + CheckDocumentAccessOutput, + CreateAnonymousWebExperienceUrlInput, + CreateAnonymousWebExperienceUrlOutput, + CreateApplicationInput, + CreateApplicationOutput, + CreateChatResponseConfigurationInput, + CreateChatResponseConfigurationOutput, + CreateDataAccessorInput, + CreateDataAccessorOutput, + CreateDataSourceInput, + CreateDataSourceOutput, + CreateIndexInput, + CreateIndexOutput, + CreatePluginInput, + CreatePluginOutput, + CreateRetrieverInput, + CreateRetrieverOutput, + CreateSubscriptionInput, + CreateSubscriptionOutput, + CreateUserInput, + CreateUserOutput, + CreateWebExperienceInput, + CreateWebExperienceOutput, + DeleteApplicationInput, + DeleteApplicationOutput, + DeleteAttachmentInput, + DeleteAttachmentOutput, + DeleteChatControlsConfigurationInput, + DeleteChatControlsConfigurationOutput, + DeleteChatResponseConfigurationInput, + DeleteChatResponseConfigurationOutput, + DeleteConversationInput, + DeleteConversationOutput, + DeleteDataAccessorInput, + DeleteDataAccessorOutput, + DeleteDataSourceInput, + DeleteDataSourceOutput, + DeleteGroupInput, + DeleteGroupOutput, + DeleteIndexInput, + DeleteIndexOutput, + DeletePluginInput, + DeletePluginOutput, + DeleteRetrieverInput, + DeleteRetrieverOutput, + DeleteUserInput, + DeleteUserOutput, + DeleteWebExperienceInput, + DeleteWebExperienceOutput, + DisassociatePermissionInput, + DisassociatePermissionOutput, + GetApplicationInput, + GetApplicationOutput, + GetChatControlsConfigurationInput, + GetChatControlsConfigurationOutput, + GetChatResponseConfigurationInput, + GetChatResponseConfigurationOutput, + GetDataAccessorInput, + GetDataAccessorOutput, + GetDataSourceInput, + GetDataSourceOutput, + GetDocumentContentInput, + GetDocumentContentOutput, + GetGroupInput, + GetGroupOutput, + GetIndexInput, + GetIndexOutput, + GetMediaInput, + GetMediaOutput, + GetPluginInput, + GetPluginOutput, + GetPolicyInput, + GetPolicyOutput, + GetRetrieverInput, + GetRetrieverOutput, + GetUserInput, + GetUserOutput, + GetWebExperienceInput, + GetWebExperienceOutput, + ListApplicationsInput, + ListApplicationsOutput, + ListAttachmentsInput, + ListAttachmentsOutput, + ListChatResponseConfigurationsInput, + ListChatResponseConfigurationsOutput, + ListConversationsInput, + ListConversationsOutput, + ListDataAccessorsInput, + ListDataAccessorsOutput, + ListDataSourceSyncJobsInput, + ListDataSourceSyncJobsOutput, + ListDataSourcesInput, + ListDataSourcesOutput, + ListDocumentsInput, + ListDocumentsOutput, + ListGroupsInput, + ListGroupsOutput, + ListIndicesInput, + ListIndicesOutput, + ListMessagesInput, + ListMessagesOutput, + ListPluginActionsInput, + ListPluginActionsOutput, + ListPluginTypeActionsInput, + ListPluginTypeActionsOutput, + ListPluginTypeMetadataInput, + ListPluginTypeMetadataOutput, + ListPluginsInput, + ListPluginsOutput, + ListRetrieversInput, + ListRetrieversOutput, + ListSubscriptionsInput, + ListSubscriptionsOutput, + ListTagsForResourceInput, + ListTagsForResourceOutput, + ListWebExperiencesInput, + ListWebExperiencesOutput, + PutFeedbackInput, + PutFeedbackOutput, + PutGroupInput, + PutGroupOutput, + SearchRelevantContentInput, + SearchRelevantContentOutput, + StartDataSourceSyncJobInput, + StartDataSourceSyncJobOutput, + StopDataSourceSyncJobInput, + StopDataSourceSyncJobOutput, + TagResourceInput, + TagResourceOutput, + UntagResourceInput, + UntagResourceOutput, + UpdateApplicationInput, + UpdateApplicationOutput, + UpdateChatControlsConfigurationInput, + UpdateChatControlsConfigurationOutput, + UpdateChatResponseConfigurationInput, + UpdateChatResponseConfigurationOutput, + UpdateDataAccessorInput, + UpdateDataAccessorOutput, + UpdateDataSourceInput, + UpdateDataSourceOutput, + UpdateIndexInput, + UpdateIndexOutput, + UpdatePluginInput, + UpdatePluginOutput, + UpdateRetrieverInput, + UpdateRetrieverOutput, + UpdateSubscriptionInput, + UpdateSubscriptionOutput, + UpdateUserInput, + UpdateUserOutput, + UpdateWebExperienceInput, + UpdateWebExperienceOutput, + ) + logger = logging.getLogger(__name__) @@ -371,12 +379,12 @@ async def _post_setup(self, config: AsyncQBusinessConfig) -> None: config_file = await config_context.parsed_profiles() if config_context.profile_source is ConfigSource.OVERRIDE: profile_name = config_context.profile_name - config.aws_credentials_identity_resolver = await IdentityChain.create( + config.aws_credentials_identity_resolver = await AsyncIdentityChain.create( AWSCredentialsIdentity, config_file=config_file, profile_name=profile_name, region_override=config.region, - http_client=cast(HTTPClient | None, config.transport), + http_client=cast(AsyncHTTPClient | None, config.transport), ) async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( @@ -385,7 +393,7 @@ async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( operation: APIOperation[I, O], default_plugins: list[Plugin], plugins: list[Plugin] | None, - ) -> tuple[RequestPipeline[Any, Any], ClientCall[I, O]]: + ) -> tuple[AsyncRequestPipeline[Any, Any], AsyncClientCall[I, O]]: if self._closed: raise RuntimeError( "Cannot invoke an operation on a client that has been closed." @@ -536,7 +544,7 @@ async def cancel_subscription( async def chat( self, input: ChatInput, plugins: list[Plugin] | None = None - ) -> DuplexEventStream[ChatInputStream, ChatOutputStream, ChatOutput]: + ) -> AsyncDuplexEventStream[ChatInputStream, ChatOutputStream, ChatOutput]: """ Starts or continues a streaming Amazon Q Business conversation. @@ -550,7 +558,7 @@ async def chat( invocations. Returns: - A `DuplexEventStream` for bidirectional streaming. + An `AsyncDuplexEventStream` for bidirectional streaming. """ pipeline, call = await self._prepare_call(input, CHAT, [], plugins) return await pipeline.duplex_stream( diff --git a/clients/aws-sdk-qbusiness/src/aws_sdk_qbusiness/config.py b/clients/aws-sdk-qbusiness/src/aws_sdk_qbusiness/config.py index c9aa7fbd..bc2f9b6c 100644 --- a/clients/aws-sdk-qbusiness/src/aws_sdk_qbusiness/config.py +++ b/clients/aws-sdk-qbusiness/src/aws_sdk_qbusiness/config.py @@ -1,337 +1,366 @@ # Code generated by smithy-python-codegen DO NOT EDIT. from dataclasses import dataclass, field -from typing import Any, Callable, ClassVar, Self, TypeAlias, Union, Unpack +from typing import ( + Any, + Callable, + ClassVar, + Self, + TYPE_CHECKING, + TypeAlias, + Union, + Unpack, +) -from smithy_aws_core.aio.protocols import RestJsonClientProtocol -from smithy_aws_core.auth import SigV4AuthScheme -from smithy_aws_core.config import AwsConfigOverrides, FileSystem -from smithy_aws_core.config.aws_config import AsyncAwsConfig -from smithy_aws_core.config.resolvers import EndpointUriResolver -from smithy_aws_core.config.types import FieldSpec -from smithy_aws_core.endpoints.standard_regional import ( - StandardRegionalEndpointsResolver, +from smithy_aws_core.aio.auth.sigv4 import AsyncSigV4AuthScheme +from smithy_aws_core.aio.config import AsyncFileSystem +from smithy_aws_core.aio.config.aws_config import AsyncAwsConfig, AwsConfigOverrides +from smithy_aws_core.aio.config.resolvers import EndpointUriResolver +from smithy_aws_core.aio.endpoints.standard_regional import ( + AsyncStandardRegionalEndpointsResolver, ) +from smithy_aws_core.aio.protocols import AsyncRestJsonClientProtocol +from smithy_aws_core.config.types import FieldSpec from smithy_aws_core.identity import AWSCredentialsIdentity, AWSIdentityProperties -from smithy_core.aio.interfaces import ( - ClientProtocol, - EndpointResolver, - ProtocolConstructor, - ProtocolSettings, -) -from smithy_core.aio.interfaces.auth import AuthScheme -from smithy_core.aio.interfaces.identity import IdentityResolver -from smithy_core.interceptors import Interceptor +from smithy_core.aio.interfaces import AsyncClientProtocol, AsyncEndpointResolver +from smithy_core.aio.interfaces.auth import AsyncAuthScheme +from smithy_core.aio.interfaces.identity import AsyncIdentityResolver +from smithy_core.interfaces import ProtocolConstructor, ProtocolSettings from smithy_core.interfaces.auth import AuthSchemeResolver from smithy_core.shapes import ShapeID from smithy_http.aio.aiohttp import AIOHTTPClient +from ._private.schemas import EXPERT_Q from .auth import HTTPAuthSchemeResolver -from .models import ( - AssociatePermissionInput, - AssociatePermissionOutput, - BatchDeleteDocumentInput, - BatchDeleteDocumentOutput, - BatchPutDocumentInput, - BatchPutDocumentOutput, - CancelSubscriptionInput, - CancelSubscriptionOutput, - ChatInput, - ChatOutput, - ChatSyncInput, - ChatSyncOutput, - CheckDocumentAccessInput, - CheckDocumentAccessOutput, - CreateAnonymousWebExperienceUrlInput, - CreateAnonymousWebExperienceUrlOutput, - CreateApplicationInput, - CreateApplicationOutput, - CreateChatResponseConfigurationInput, - CreateChatResponseConfigurationOutput, - CreateDataAccessorInput, - CreateDataAccessorOutput, - CreateDataSourceInput, - CreateDataSourceOutput, - CreateIndexInput, - CreateIndexOutput, - CreatePluginInput, - CreatePluginOutput, - CreateRetrieverInput, - CreateRetrieverOutput, - CreateSubscriptionInput, - CreateSubscriptionOutput, - CreateUserInput, - CreateUserOutput, - CreateWebExperienceInput, - CreateWebExperienceOutput, - DeleteApplicationInput, - DeleteApplicationOutput, - DeleteAttachmentInput, - DeleteAttachmentOutput, - DeleteChatControlsConfigurationInput, - DeleteChatControlsConfigurationOutput, - DeleteChatResponseConfigurationInput, - DeleteChatResponseConfigurationOutput, - DeleteConversationInput, - DeleteConversationOutput, - DeleteDataAccessorInput, - DeleteDataAccessorOutput, - DeleteDataSourceInput, - DeleteDataSourceOutput, - DeleteGroupInput, - DeleteGroupOutput, - DeleteIndexInput, - DeleteIndexOutput, - DeletePluginInput, - DeletePluginOutput, - DeleteRetrieverInput, - DeleteRetrieverOutput, - DeleteUserInput, - DeleteUserOutput, - DeleteWebExperienceInput, - DeleteWebExperienceOutput, - DisassociatePermissionInput, - DisassociatePermissionOutput, - GetApplicationInput, - GetApplicationOutput, - GetChatControlsConfigurationInput, - GetChatControlsConfigurationOutput, - GetChatResponseConfigurationInput, - GetChatResponseConfigurationOutput, - GetDataAccessorInput, - GetDataAccessorOutput, - GetDataSourceInput, - GetDataSourceOutput, - GetDocumentContentInput, - GetDocumentContentOutput, - GetGroupInput, - GetGroupOutput, - GetIndexInput, - GetIndexOutput, - GetMediaInput, - GetMediaOutput, - GetPluginInput, - GetPluginOutput, - GetPolicyInput, - GetPolicyOutput, - GetRetrieverInput, - GetRetrieverOutput, - GetUserInput, - GetUserOutput, - GetWebExperienceInput, - GetWebExperienceOutput, - ListApplicationsInput, - ListApplicationsOutput, - ListAttachmentsInput, - ListAttachmentsOutput, - ListChatResponseConfigurationsInput, - ListChatResponseConfigurationsOutput, - ListConversationsInput, - ListConversationsOutput, - ListDataAccessorsInput, - ListDataAccessorsOutput, - ListDataSourceSyncJobsInput, - ListDataSourceSyncJobsOutput, - ListDataSourcesInput, - ListDataSourcesOutput, - ListDocumentsInput, - ListDocumentsOutput, - ListGroupsInput, - ListGroupsOutput, - ListIndicesInput, - ListIndicesOutput, - ListMessagesInput, - ListMessagesOutput, - ListPluginActionsInput, - ListPluginActionsOutput, - ListPluginTypeActionsInput, - ListPluginTypeActionsOutput, - ListPluginTypeMetadataInput, - ListPluginTypeMetadataOutput, - ListPluginsInput, - ListPluginsOutput, - ListRetrieversInput, - ListRetrieversOutput, - ListSubscriptionsInput, - ListSubscriptionsOutput, - ListTagsForResourceInput, - ListTagsForResourceOutput, - ListWebExperiencesInput, - ListWebExperiencesOutput, - PutFeedbackInput, - PutFeedbackOutput, - PutGroupInput, - PutGroupOutput, - SearchRelevantContentInput, - SearchRelevantContentOutput, - StartDataSourceSyncJobInput, - StartDataSourceSyncJobOutput, - StopDataSourceSyncJobInput, - StopDataSourceSyncJobOutput, - TagResourceInput, - TagResourceOutput, - UntagResourceInput, - UntagResourceOutput, - UpdateApplicationInput, - UpdateApplicationOutput, - UpdateChatControlsConfigurationInput, - UpdateChatControlsConfigurationOutput, - UpdateChatResponseConfigurationInput, - UpdateChatResponseConfigurationOutput, - UpdateDataAccessorInput, - UpdateDataAccessorOutput, - UpdateDataSourceInput, - UpdateDataSourceOutput, - UpdateIndexInput, - UpdateIndexOutput, - UpdatePluginInput, - UpdatePluginOutput, - UpdateRetrieverInput, - UpdateRetrieverOutput, - UpdateSubscriptionInput, - UpdateSubscriptionOutput, - UpdateUserInput, - UpdateUserOutput, - UpdateWebExperienceInput, - UpdateWebExperienceOutput, -) -_ServiceInterceptor = Union[ - Interceptor[AssociatePermissionInput, AssociatePermissionOutput, Any, Any], - Interceptor[BatchDeleteDocumentInput, BatchDeleteDocumentOutput, Any, Any], - Interceptor[BatchPutDocumentInput, BatchPutDocumentOutput, Any, Any], - Interceptor[CancelSubscriptionInput, CancelSubscriptionOutput, Any, Any], - Interceptor[ChatInput, ChatOutput, Any, Any], - Interceptor[ChatSyncInput, ChatSyncOutput, Any, Any], - Interceptor[CheckDocumentAccessInput, CheckDocumentAccessOutput, Any, Any], - Interceptor[ +if TYPE_CHECKING: + from smithy_core.interceptors import Interceptor + from .models import ( + AssociatePermissionInput, + AssociatePermissionOutput, + BatchDeleteDocumentInput, + BatchDeleteDocumentOutput, + BatchPutDocumentInput, + BatchPutDocumentOutput, + CancelSubscriptionInput, + CancelSubscriptionOutput, + ChatInput, + ChatOutput, + ChatSyncInput, + ChatSyncOutput, + CheckDocumentAccessInput, + CheckDocumentAccessOutput, CreateAnonymousWebExperienceUrlInput, CreateAnonymousWebExperienceUrlOutput, - Any, - Any, - ], - Interceptor[CreateApplicationInput, CreateApplicationOutput, Any, Any], - Interceptor[ + CreateApplicationInput, + CreateApplicationOutput, CreateChatResponseConfigurationInput, CreateChatResponseConfigurationOutput, - Any, - Any, - ], - Interceptor[CreateDataAccessorInput, CreateDataAccessorOutput, Any, Any], - Interceptor[CreateDataSourceInput, CreateDataSourceOutput, Any, Any], - Interceptor[CreateIndexInput, CreateIndexOutput, Any, Any], - Interceptor[CreatePluginInput, CreatePluginOutput, Any, Any], - Interceptor[CreateRetrieverInput, CreateRetrieverOutput, Any, Any], - Interceptor[CreateSubscriptionInput, CreateSubscriptionOutput, Any, Any], - Interceptor[CreateUserInput, CreateUserOutput, Any, Any], - Interceptor[CreateWebExperienceInput, CreateWebExperienceOutput, Any, Any], - Interceptor[DeleteApplicationInput, DeleteApplicationOutput, Any, Any], - Interceptor[DeleteAttachmentInput, DeleteAttachmentOutput, Any, Any], - Interceptor[ + CreateDataAccessorInput, + CreateDataAccessorOutput, + CreateDataSourceInput, + CreateDataSourceOutput, + CreateIndexInput, + CreateIndexOutput, + CreatePluginInput, + CreatePluginOutput, + CreateRetrieverInput, + CreateRetrieverOutput, + CreateSubscriptionInput, + CreateSubscriptionOutput, + CreateUserInput, + CreateUserOutput, + CreateWebExperienceInput, + CreateWebExperienceOutput, + DeleteApplicationInput, + DeleteApplicationOutput, + DeleteAttachmentInput, + DeleteAttachmentOutput, DeleteChatControlsConfigurationInput, DeleteChatControlsConfigurationOutput, - Any, - Any, - ], - Interceptor[ DeleteChatResponseConfigurationInput, DeleteChatResponseConfigurationOutput, - Any, - Any, - ], - Interceptor[DeleteConversationInput, DeleteConversationOutput, Any, Any], - Interceptor[DeleteDataAccessorInput, DeleteDataAccessorOutput, Any, Any], - Interceptor[DeleteDataSourceInput, DeleteDataSourceOutput, Any, Any], - Interceptor[DeleteGroupInput, DeleteGroupOutput, Any, Any], - Interceptor[DeleteIndexInput, DeleteIndexOutput, Any, Any], - Interceptor[DeletePluginInput, DeletePluginOutput, Any, Any], - Interceptor[DeleteRetrieverInput, DeleteRetrieverOutput, Any, Any], - Interceptor[DeleteUserInput, DeleteUserOutput, Any, Any], - Interceptor[DeleteWebExperienceInput, DeleteWebExperienceOutput, Any, Any], - Interceptor[DisassociatePermissionInput, DisassociatePermissionOutput, Any, Any], - Interceptor[GetApplicationInput, GetApplicationOutput, Any, Any], - Interceptor[ - GetChatControlsConfigurationInput, GetChatControlsConfigurationOutput, Any, Any - ], - Interceptor[ - GetChatResponseConfigurationInput, GetChatResponseConfigurationOutput, Any, Any - ], - Interceptor[GetDataAccessorInput, GetDataAccessorOutput, Any, Any], - Interceptor[GetDataSourceInput, GetDataSourceOutput, Any, Any], - Interceptor[GetDocumentContentInput, GetDocumentContentOutput, Any, Any], - Interceptor[GetGroupInput, GetGroupOutput, Any, Any], - Interceptor[GetIndexInput, GetIndexOutput, Any, Any], - Interceptor[GetMediaInput, GetMediaOutput, Any, Any], - Interceptor[GetPluginInput, GetPluginOutput, Any, Any], - Interceptor[GetPolicyInput, GetPolicyOutput, Any, Any], - Interceptor[GetRetrieverInput, GetRetrieverOutput, Any, Any], - Interceptor[GetUserInput, GetUserOutput, Any, Any], - Interceptor[GetWebExperienceInput, GetWebExperienceOutput, Any, Any], - Interceptor[ListApplicationsInput, ListApplicationsOutput, Any, Any], - Interceptor[ListAttachmentsInput, ListAttachmentsOutput, Any, Any], - Interceptor[ + DeleteConversationInput, + DeleteConversationOutput, + DeleteDataAccessorInput, + DeleteDataAccessorOutput, + DeleteDataSourceInput, + DeleteDataSourceOutput, + DeleteGroupInput, + DeleteGroupOutput, + DeleteIndexInput, + DeleteIndexOutput, + DeletePluginInput, + DeletePluginOutput, + DeleteRetrieverInput, + DeleteRetrieverOutput, + DeleteUserInput, + DeleteUserOutput, + DeleteWebExperienceInput, + DeleteWebExperienceOutput, + DisassociatePermissionInput, + DisassociatePermissionOutput, + GetApplicationInput, + GetApplicationOutput, + GetChatControlsConfigurationInput, + GetChatControlsConfigurationOutput, + GetChatResponseConfigurationInput, + GetChatResponseConfigurationOutput, + GetDataAccessorInput, + GetDataAccessorOutput, + GetDataSourceInput, + GetDataSourceOutput, + GetDocumentContentInput, + GetDocumentContentOutput, + GetGroupInput, + GetGroupOutput, + GetIndexInput, + GetIndexOutput, + GetMediaInput, + GetMediaOutput, + GetPluginInput, + GetPluginOutput, + GetPolicyInput, + GetPolicyOutput, + GetRetrieverInput, + GetRetrieverOutput, + GetUserInput, + GetUserOutput, + GetWebExperienceInput, + GetWebExperienceOutput, + ListApplicationsInput, + ListApplicationsOutput, + ListAttachmentsInput, + ListAttachmentsOutput, ListChatResponseConfigurationsInput, ListChatResponseConfigurationsOutput, - Any, - Any, - ], - Interceptor[ListConversationsInput, ListConversationsOutput, Any, Any], - Interceptor[ListDataAccessorsInput, ListDataAccessorsOutput, Any, Any], - Interceptor[ListDataSourcesInput, ListDataSourcesOutput, Any, Any], - Interceptor[ListDataSourceSyncJobsInput, ListDataSourceSyncJobsOutput, Any, Any], - Interceptor[ListDocumentsInput, ListDocumentsOutput, Any, Any], - Interceptor[ListGroupsInput, ListGroupsOutput, Any, Any], - Interceptor[ListIndicesInput, ListIndicesOutput, Any, Any], - Interceptor[ListMessagesInput, ListMessagesOutput, Any, Any], - Interceptor[ListPluginActionsInput, ListPluginActionsOutput, Any, Any], - Interceptor[ListPluginsInput, ListPluginsOutput, Any, Any], - Interceptor[ListPluginTypeActionsInput, ListPluginTypeActionsOutput, Any, Any], - Interceptor[ListPluginTypeMetadataInput, ListPluginTypeMetadataOutput, Any, Any], - Interceptor[ListRetrieversInput, ListRetrieversOutput, Any, Any], - Interceptor[ListSubscriptionsInput, ListSubscriptionsOutput, Any, Any], - Interceptor[ListTagsForResourceInput, ListTagsForResourceOutput, Any, Any], - Interceptor[ListWebExperiencesInput, ListWebExperiencesOutput, Any, Any], - Interceptor[PutFeedbackInput, PutFeedbackOutput, Any, Any], - Interceptor[PutGroupInput, PutGroupOutput, Any, Any], - Interceptor[SearchRelevantContentInput, SearchRelevantContentOutput, Any, Any], - Interceptor[StartDataSourceSyncJobInput, StartDataSourceSyncJobOutput, Any, Any], - Interceptor[StopDataSourceSyncJobInput, StopDataSourceSyncJobOutput, Any, Any], - Interceptor[TagResourceInput, TagResourceOutput, Any, Any], - Interceptor[UntagResourceInput, UntagResourceOutput, Any, Any], - Interceptor[UpdateApplicationInput, UpdateApplicationOutput, Any, Any], - Interceptor[ + ListConversationsInput, + ListConversationsOutput, + ListDataAccessorsInput, + ListDataAccessorsOutput, + ListDataSourceSyncJobsInput, + ListDataSourceSyncJobsOutput, + ListDataSourcesInput, + ListDataSourcesOutput, + ListDocumentsInput, + ListDocumentsOutput, + ListGroupsInput, + ListGroupsOutput, + ListIndicesInput, + ListIndicesOutput, + ListMessagesInput, + ListMessagesOutput, + ListPluginActionsInput, + ListPluginActionsOutput, + ListPluginTypeActionsInput, + ListPluginTypeActionsOutput, + ListPluginTypeMetadataInput, + ListPluginTypeMetadataOutput, + ListPluginsInput, + ListPluginsOutput, + ListRetrieversInput, + ListRetrieversOutput, + ListSubscriptionsInput, + ListSubscriptionsOutput, + ListTagsForResourceInput, + ListTagsForResourceOutput, + ListWebExperiencesInput, + ListWebExperiencesOutput, + PutFeedbackInput, + PutFeedbackOutput, + PutGroupInput, + PutGroupOutput, + SearchRelevantContentInput, + SearchRelevantContentOutput, + StartDataSourceSyncJobInput, + StartDataSourceSyncJobOutput, + StopDataSourceSyncJobInput, + StopDataSourceSyncJobOutput, + TagResourceInput, + TagResourceOutput, + UntagResourceInput, + UntagResourceOutput, + UpdateApplicationInput, + UpdateApplicationOutput, UpdateChatControlsConfigurationInput, UpdateChatControlsConfigurationOutput, - Any, - Any, - ], - Interceptor[ UpdateChatResponseConfigurationInput, UpdateChatResponseConfigurationOutput, - Any, - Any, - ], - Interceptor[UpdateDataAccessorInput, UpdateDataAccessorOutput, Any, Any], - Interceptor[UpdateDataSourceInput, UpdateDataSourceOutput, Any, Any], - Interceptor[UpdateIndexInput, UpdateIndexOutput, Any, Any], - Interceptor[UpdatePluginInput, UpdatePluginOutput, Any, Any], - Interceptor[UpdateRetrieverInput, UpdateRetrieverOutput, Any, Any], - Interceptor[UpdateSubscriptionInput, UpdateSubscriptionOutput, Any, Any], - Interceptor[UpdateUserInput, UpdateUserOutput, Any, Any], - Interceptor[UpdateWebExperienceInput, UpdateWebExperienceOutput, Any, Any], -] + UpdateDataAccessorInput, + UpdateDataAccessorOutput, + UpdateDataSourceInput, + UpdateDataSourceOutput, + UpdateIndexInput, + UpdateIndexOutput, + UpdatePluginInput, + UpdatePluginOutput, + UpdateRetrieverInput, + UpdateRetrieverOutput, + UpdateSubscriptionInput, + UpdateSubscriptionOutput, + UpdateUserInput, + UpdateUserOutput, + UpdateWebExperienceInput, + UpdateWebExperienceOutput, + ) + + _ServiceInterceptor = Union[ + Interceptor[AssociatePermissionInput, AssociatePermissionOutput, Any, Any], + Interceptor[BatchDeleteDocumentInput, BatchDeleteDocumentOutput, Any, Any], + Interceptor[BatchPutDocumentInput, BatchPutDocumentOutput, Any, Any], + Interceptor[CancelSubscriptionInput, CancelSubscriptionOutput, Any, Any], + Interceptor[ChatInput, ChatOutput, Any, Any], + Interceptor[ChatSyncInput, ChatSyncOutput, Any, Any], + Interceptor[CheckDocumentAccessInput, CheckDocumentAccessOutput, Any, Any], + Interceptor[ + CreateAnonymousWebExperienceUrlInput, + CreateAnonymousWebExperienceUrlOutput, + Any, + Any, + ], + Interceptor[CreateApplicationInput, CreateApplicationOutput, Any, Any], + Interceptor[ + CreateChatResponseConfigurationInput, + CreateChatResponseConfigurationOutput, + Any, + Any, + ], + Interceptor[CreateDataAccessorInput, CreateDataAccessorOutput, Any, Any], + Interceptor[CreateDataSourceInput, CreateDataSourceOutput, Any, Any], + Interceptor[CreateIndexInput, CreateIndexOutput, Any, Any], + Interceptor[CreatePluginInput, CreatePluginOutput, Any, Any], + Interceptor[CreateRetrieverInput, CreateRetrieverOutput, Any, Any], + Interceptor[CreateSubscriptionInput, CreateSubscriptionOutput, Any, Any], + Interceptor[CreateUserInput, CreateUserOutput, Any, Any], + Interceptor[CreateWebExperienceInput, CreateWebExperienceOutput, Any, Any], + Interceptor[DeleteApplicationInput, DeleteApplicationOutput, Any, Any], + Interceptor[DeleteAttachmentInput, DeleteAttachmentOutput, Any, Any], + Interceptor[ + DeleteChatControlsConfigurationInput, + DeleteChatControlsConfigurationOutput, + Any, + Any, + ], + Interceptor[ + DeleteChatResponseConfigurationInput, + DeleteChatResponseConfigurationOutput, + Any, + Any, + ], + Interceptor[DeleteConversationInput, DeleteConversationOutput, Any, Any], + Interceptor[DeleteDataAccessorInput, DeleteDataAccessorOutput, Any, Any], + Interceptor[DeleteDataSourceInput, DeleteDataSourceOutput, Any, Any], + Interceptor[DeleteGroupInput, DeleteGroupOutput, Any, Any], + Interceptor[DeleteIndexInput, DeleteIndexOutput, Any, Any], + Interceptor[DeletePluginInput, DeletePluginOutput, Any, Any], + Interceptor[DeleteRetrieverInput, DeleteRetrieverOutput, Any, Any], + Interceptor[DeleteUserInput, DeleteUserOutput, Any, Any], + Interceptor[DeleteWebExperienceInput, DeleteWebExperienceOutput, Any, Any], + Interceptor[ + DisassociatePermissionInput, DisassociatePermissionOutput, Any, Any + ], + Interceptor[GetApplicationInput, GetApplicationOutput, Any, Any], + Interceptor[ + GetChatControlsConfigurationInput, + GetChatControlsConfigurationOutput, + Any, + Any, + ], + Interceptor[ + GetChatResponseConfigurationInput, + GetChatResponseConfigurationOutput, + Any, + Any, + ], + Interceptor[GetDataAccessorInput, GetDataAccessorOutput, Any, Any], + Interceptor[GetDataSourceInput, GetDataSourceOutput, Any, Any], + Interceptor[GetDocumentContentInput, GetDocumentContentOutput, Any, Any], + Interceptor[GetGroupInput, GetGroupOutput, Any, Any], + Interceptor[GetIndexInput, GetIndexOutput, Any, Any], + Interceptor[GetMediaInput, GetMediaOutput, Any, Any], + Interceptor[GetPluginInput, GetPluginOutput, Any, Any], + Interceptor[GetPolicyInput, GetPolicyOutput, Any, Any], + Interceptor[GetRetrieverInput, GetRetrieverOutput, Any, Any], + Interceptor[GetUserInput, GetUserOutput, Any, Any], + Interceptor[GetWebExperienceInput, GetWebExperienceOutput, Any, Any], + Interceptor[ListApplicationsInput, ListApplicationsOutput, Any, Any], + Interceptor[ListAttachmentsInput, ListAttachmentsOutput, Any, Any], + Interceptor[ + ListChatResponseConfigurationsInput, + ListChatResponseConfigurationsOutput, + Any, + Any, + ], + Interceptor[ListConversationsInput, ListConversationsOutput, Any, Any], + Interceptor[ListDataAccessorsInput, ListDataAccessorsOutput, Any, Any], + Interceptor[ListDataSourcesInput, ListDataSourcesOutput, Any, Any], + Interceptor[ + ListDataSourceSyncJobsInput, ListDataSourceSyncJobsOutput, Any, Any + ], + Interceptor[ListDocumentsInput, ListDocumentsOutput, Any, Any], + Interceptor[ListGroupsInput, ListGroupsOutput, Any, Any], + Interceptor[ListIndicesInput, ListIndicesOutput, Any, Any], + Interceptor[ListMessagesInput, ListMessagesOutput, Any, Any], + Interceptor[ListPluginActionsInput, ListPluginActionsOutput, Any, Any], + Interceptor[ListPluginsInput, ListPluginsOutput, Any, Any], + Interceptor[ListPluginTypeActionsInput, ListPluginTypeActionsOutput, Any, Any], + Interceptor[ + ListPluginTypeMetadataInput, ListPluginTypeMetadataOutput, Any, Any + ], + Interceptor[ListRetrieversInput, ListRetrieversOutput, Any, Any], + Interceptor[ListSubscriptionsInput, ListSubscriptionsOutput, Any, Any], + Interceptor[ListTagsForResourceInput, ListTagsForResourceOutput, Any, Any], + Interceptor[ListWebExperiencesInput, ListWebExperiencesOutput, Any, Any], + Interceptor[PutFeedbackInput, PutFeedbackOutput, Any, Any], + Interceptor[PutGroupInput, PutGroupOutput, Any, Any], + Interceptor[SearchRelevantContentInput, SearchRelevantContentOutput, Any, Any], + Interceptor[ + StartDataSourceSyncJobInput, StartDataSourceSyncJobOutput, Any, Any + ], + Interceptor[StopDataSourceSyncJobInput, StopDataSourceSyncJobOutput, Any, Any], + Interceptor[TagResourceInput, TagResourceOutput, Any, Any], + Interceptor[UntagResourceInput, UntagResourceOutput, Any, Any], + Interceptor[UpdateApplicationInput, UpdateApplicationOutput, Any, Any], + Interceptor[ + UpdateChatControlsConfigurationInput, + UpdateChatControlsConfigurationOutput, + Any, + Any, + ], + Interceptor[ + UpdateChatResponseConfigurationInput, + UpdateChatResponseConfigurationOutput, + Any, + Any, + ], + Interceptor[UpdateDataAccessorInput, UpdateDataAccessorOutput, Any, Any], + Interceptor[UpdateDataSourceInput, UpdateDataSourceOutput, Any, Any], + Interceptor[UpdateIndexInput, UpdateIndexOutput, Any, Any], + Interceptor[UpdatePluginInput, UpdatePluginOutput, Any, Any], + Interceptor[UpdateRetrieverInput, UpdateRetrieverOutput, Any, Any], + Interceptor[UpdateSubscriptionInput, UpdateSubscriptionOutput, Any, Any], + Interceptor[UpdateUserInput, UpdateUserOutput, Any, Any], + Interceptor[UpdateWebExperienceInput, UpdateWebExperienceOutput, Any, Any], + ] +else: + _ServiceInterceptor = Any + _PROTOCOL_SETTINGS = ProtocolSettings( - namespace="com.amazonaws.qbusiness", service_target="ExpertQ" + namespace="com.amazonaws.qbusiness", + service_target="ExpertQ", + service_schema=EXPERT_Q, ) class _AsyncQBusinessConfigOverrides(AwsConfigOverrides, total=False): - endpoint_resolver: EndpointResolver | None + endpoint_resolver: AsyncEndpointResolver | None protocol: ( - ClientProtocol[Any, Any] | ProtocolConstructor[ClientProtocol[Any, Any]] | None + AsyncClientProtocol[Any, Any] + | ProtocolConstructor[AsyncClientProtocol[Any, Any]] + | None ) - auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None + auth_schemes: dict[ShapeID, AsyncAuthScheme[Any, Any, Any, Any]] | None auth_scheme_resolver: AuthSchemeResolver | None @@ -339,17 +368,17 @@ class _AsyncQBusinessConfigOverrides(AwsConfigOverrides, total=False): class AsyncQBusinessConfig(AsyncAwsConfig): """QBusiness configuration (async-resolved).""" - endpoint_resolver: EndpointResolver | None = None + endpoint_resolver: AsyncEndpointResolver | None = None """ The endpoint resolver used to resolve the final endpoint per-operation based on the configuration. """ - protocol: ClientProtocol[Any, Any] | None = None + protocol: AsyncClientProtocol[Any, Any] | None = None """ Pass a protocol class reference from smithy_aws_core.aio.protocols to - select the protocol, e.g. protocol=AwsJson10ClientProtocol. For custom - protocols a protocol instance may also be passed. + select the protocol, e.g. protocol=AsyncAwsJson10ClientProtocol. For + custom protocols a protocol instance may also be passed. """ interceptors: list[_ServiceInterceptor] = field(default_factory=lambda: []) @@ -358,7 +387,7 @@ class AsyncQBusinessConfig(AsyncAwsConfig): execution of a request. """ - auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None = None + auth_schemes: dict[ShapeID, AsyncAuthScheme[Any, Any, Any, Any]] | None = None """A map of auth scheme ids to auth schemes.""" auth_scheme_resolver: AuthSchemeResolver | None = None @@ -368,7 +397,7 @@ class AsyncQBusinessConfig(AsyncAwsConfig): """ aws_credentials_identity_resolver: ( - IdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None + AsyncIdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None ) = None """Resolves AWS Credentials. Required for operations that use Sigv4 Auth.""" @@ -409,24 +438,24 @@ class AsyncQBusinessConfig(AsyncAwsConfig): default=None, resolver=EndpointUriResolver("qbusiness") ), "endpoint_resolver": FieldSpec( - default_factory=lambda: StandardRegionalEndpointsResolver( + default_factory=lambda: AsyncStandardRegionalEndpointsResolver( endpoint_prefix="qbusiness" ) ), "protocol": FieldSpec( - default_factory=lambda: RestJsonClientProtocol(_PROTOCOL_SETTINGS), + default_factory=lambda: AsyncRestJsonClientProtocol(_PROTOCOL_SETTINGS), converter=lambda p: p(_PROTOCOL_SETTINGS) if isinstance(p, type) else p, ), "auth_schemes": FieldSpec( default_factory=lambda: { - ShapeID("aws.auth#sigv4"): SigV4AuthScheme(service="qbusiness") + ShapeID("aws.auth#sigv4"): AsyncSigV4AuthScheme(service="qbusiness") } ), "auth_scheme_resolver": FieldSpec(default_factory=HTTPAuthSchemeResolver), "transport": FieldSpec(default_factory=lambda: AIOHTTPClient()), } - def set_auth_scheme(self, scheme: AuthScheme[Any, Any, Any, Any]) -> None: + def set_auth_scheme(self, scheme: AsyncAuthScheme[Any, Any, Any, Any]) -> None: """ Set an auth scheme implementation using its scheme ID. :param scheme: The auth scheme to add or replace. @@ -440,7 +469,7 @@ async def resolve( # pyright: ignore[reportIncompatibleMethodOverride] cls, *, profile: str | None = None, - fs: FileSystem | None = None, + fs: AsyncFileSystem | None = None, config_file_path: str | None = None, credentials_file_path: str | None = None, **overrides: Unpack[_AsyncQBusinessConfigOverrides], diff --git a/clients/aws-sdk-qbusiness/src/aws_sdk_qbusiness/models.py b/clients/aws-sdk-qbusiness/src/aws_sdk_qbusiness/models.py index a6b3b92c..8c02cd87 100644 --- a/clients/aws-sdk-qbusiness/src/aws_sdk_qbusiness/models.py +++ b/clients/aws-sdk-qbusiness/src/aws_sdk_qbusiness/models.py @@ -1,32937 +1,2389 @@ # Code generated by smithy-python-codegen DO NOT EDIT. -from dataclasses import dataclass, field -from datetime import datetime, timezone -from enum import StrEnum -import logging -from typing import Any, Literal, Self, Union +from __future__ import annotations -from smithy_core.deserializers import ShapeDeserializer -from smithy_core.documents import Document as _Document, TypeRegistry -from smithy_core.exceptions import ModeledError, SerializationError -from smithy_core.response import EMPTY_RESPONSE_METADATA, ResponseMetadata -from smithy_core.schemas import APIOperation, Schema -from smithy_core.serializers import ShapeSerializer +from ._private import schemas as _schemas +from smithy_core._dynamic_models import ModelRegistry +from smithy_core.exceptions import ModeledError +from smithy_core.schemas import APIOperation from smithy_core.shapes import ShapeID -from smithy_core.types import UnknownEnumMixin from ._private.schemas import ( - ACCESS_CONFIGURATION as _SCHEMA_ACCESS_CONFIGURATION, - ACCESS_CONTROL as _SCHEMA_ACCESS_CONTROL, - ACCESS_DENIED_EXCEPTION as _SCHEMA_ACCESS_DENIED_EXCEPTION, - ACTION_CONFIGURATION as _SCHEMA_ACTION_CONFIGURATION, - ACTION_EXECUTION as _SCHEMA_ACTION_EXECUTION, - ACTION_EXECUTION_EVENT as _SCHEMA_ACTION_EXECUTION_EVENT, - ACTION_EXECUTION_PAYLOAD_FIELD as _SCHEMA_ACTION_EXECUTION_PAYLOAD_FIELD, - ACTION_FILTER_CONFIGURATION as _SCHEMA_ACTION_FILTER_CONFIGURATION, - ACTION_REVIEW as _SCHEMA_ACTION_REVIEW, - ACTION_REVIEW_EVENT as _SCHEMA_ACTION_REVIEW_EVENT, - ACTION_REVIEW_PAYLOAD_FIELD as _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD, - ACTION_REVIEW_PAYLOAD_FIELD_ALLOWED_VALUE as _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD_ALLOWED_VALUE, - ACTION_SUMMARY as _SCHEMA_ACTION_SUMMARY, - API_SCHEMA as _SCHEMA_API_SCHEMA, - APPLICATION as _SCHEMA_APPLICATION, - APPLIED_ATTACHMENTS_CONFIGURATION as _SCHEMA_APPLIED_ATTACHMENTS_CONFIGURATION, - APPLIED_CREATOR_MODE_CONFIGURATION as _SCHEMA_APPLIED_CREATOR_MODE_CONFIGURATION, - APPLIED_ORCHESTRATION_CONFIGURATION as _SCHEMA_APPLIED_ORCHESTRATION_CONFIGURATION, - ASSOCIATED_GROUP as _SCHEMA_ASSOCIATED_GROUP, - ASSOCIATED_USER as _SCHEMA_ASSOCIATED_USER, ASSOCIATE_PERMISSION as _SCHEMA_ASSOCIATE_PERMISSION, - ASSOCIATE_PERMISSION_INPUT as _SCHEMA_ASSOCIATE_PERMISSION_INPUT, - ASSOCIATE_PERMISSION_OUTPUT as _SCHEMA_ASSOCIATE_PERMISSION_OUTPUT, - ATTACHMENT as _SCHEMA_ATTACHMENT, - ATTACHMENTS_CONFIGURATION as _SCHEMA_ATTACHMENTS_CONFIGURATION, - ATTACHMENT_INPUT as _SCHEMA_ATTACHMENT_INPUT, - ATTACHMENT_INPUT_EVENT as _SCHEMA_ATTACHMENT_INPUT_EVENT, - ATTACHMENT_OUTPUT as _SCHEMA_ATTACHMENT_OUTPUT, - ATTRIBUTE_FILTER as _SCHEMA_ATTRIBUTE_FILTER, - AUDIO_EXTRACTION_CONFIGURATION as _SCHEMA_AUDIO_EXTRACTION_CONFIGURATION, - AUDIO_SOURCE_DETAILS as _SCHEMA_AUDIO_SOURCE_DETAILS, - AUTH_CHALLENGE_REQUEST as _SCHEMA_AUTH_CHALLENGE_REQUEST, - AUTH_CHALLENGE_REQUEST_EVENT as _SCHEMA_AUTH_CHALLENGE_REQUEST_EVENT, - AUTH_CHALLENGE_RESPONSE as _SCHEMA_AUTH_CHALLENGE_RESPONSE, - AUTH_CHALLENGE_RESPONSE_EVENT as _SCHEMA_AUTH_CHALLENGE_RESPONSE_EVENT, - AUTO_SUBSCRIPTION_CONFIGURATION as _SCHEMA_AUTO_SUBSCRIPTION_CONFIGURATION, - BASIC_AUTH_CONFIGURATION as _SCHEMA_BASIC_AUTH_CONFIGURATION, BATCH_DELETE_DOCUMENT as _SCHEMA_BATCH_DELETE_DOCUMENT, - BATCH_DELETE_DOCUMENT_INPUT as _SCHEMA_BATCH_DELETE_DOCUMENT_INPUT, - BATCH_DELETE_DOCUMENT_OUTPUT as _SCHEMA_BATCH_DELETE_DOCUMENT_OUTPUT, BATCH_PUT_DOCUMENT as _SCHEMA_BATCH_PUT_DOCUMENT, - BATCH_PUT_DOCUMENT_INPUT as _SCHEMA_BATCH_PUT_DOCUMENT_INPUT, - BATCH_PUT_DOCUMENT_OUTPUT as _SCHEMA_BATCH_PUT_DOCUMENT_OUTPUT, - BLOCKED_PHRASES_CONFIGURATION as _SCHEMA_BLOCKED_PHRASES_CONFIGURATION, - BLOCKED_PHRASES_CONFIGURATION_UPDATE as _SCHEMA_BLOCKED_PHRASES_CONFIGURATION_UPDATE, - BROWSER_EXTENSION_CONFIGURATION as _SCHEMA_BROWSER_EXTENSION_CONFIGURATION, CANCEL_SUBSCRIPTION as _SCHEMA_CANCEL_SUBSCRIPTION, - CANCEL_SUBSCRIPTION_INPUT as _SCHEMA_CANCEL_SUBSCRIPTION_INPUT, - CANCEL_SUBSCRIPTION_OUTPUT as _SCHEMA_CANCEL_SUBSCRIPTION_OUTPUT, CHAT as _SCHEMA_CHAT, - CHAT_INPUT as _SCHEMA_CHAT_INPUT, - CHAT_INPUT_STREAM as _SCHEMA_CHAT_INPUT_STREAM, - CHAT_MODE_CONFIGURATION as _SCHEMA_CHAT_MODE_CONFIGURATION, - CHAT_OUTPUT as _SCHEMA_CHAT_OUTPUT, - CHAT_OUTPUT_STREAM as _SCHEMA_CHAT_OUTPUT_STREAM, - CHAT_RESPONSE_CONFIGURATION as _SCHEMA_CHAT_RESPONSE_CONFIGURATION, - CHAT_RESPONSE_CONFIGURATION_DETAIL as _SCHEMA_CHAT_RESPONSE_CONFIGURATION_DETAIL, CHAT_SYNC as _SCHEMA_CHAT_SYNC, - CHAT_SYNC_INPUT as _SCHEMA_CHAT_SYNC_INPUT, - CHAT_SYNC_OUTPUT as _SCHEMA_CHAT_SYNC_OUTPUT, CHECK_DOCUMENT_ACCESS as _SCHEMA_CHECK_DOCUMENT_ACCESS, - CHECK_DOCUMENT_ACCESS_INPUT as _SCHEMA_CHECK_DOCUMENT_ACCESS_INPUT, - CHECK_DOCUMENT_ACCESS_OUTPUT as _SCHEMA_CHECK_DOCUMENT_ACCESS_OUTPUT, - CONFIGURATION_EVENT as _SCHEMA_CONFIGURATION_EVENT, - CONFLICT_EXCEPTION as _SCHEMA_CONFLICT_EXCEPTION, - CONTENT_BLOCKER_RULE as _SCHEMA_CONTENT_BLOCKER_RULE, - CONTENT_RETRIEVAL_RULE as _SCHEMA_CONTENT_RETRIEVAL_RULE, - CONTENT_SOURCE as _SCHEMA_CONTENT_SOURCE, - CONVERSATION as _SCHEMA_CONVERSATION, - CONVERSATION_SOURCE as _SCHEMA_CONVERSATION_SOURCE, - COPY_FROM_SOURCE as _SCHEMA_COPY_FROM_SOURCE, CREATE_ANONYMOUS_WEB_EXPERIENCE_URL as _SCHEMA_CREATE_ANONYMOUS_WEB_EXPERIENCE_URL, - CREATE_ANONYMOUS_WEB_EXPERIENCE_URL_INPUT as _SCHEMA_CREATE_ANONYMOUS_WEB_EXPERIENCE_URL_INPUT, - CREATE_ANONYMOUS_WEB_EXPERIENCE_URL_OUTPUT as _SCHEMA_CREATE_ANONYMOUS_WEB_EXPERIENCE_URL_OUTPUT, CREATE_APPLICATION as _SCHEMA_CREATE_APPLICATION, - CREATE_APPLICATION_INPUT as _SCHEMA_CREATE_APPLICATION_INPUT, - CREATE_APPLICATION_OUTPUT as _SCHEMA_CREATE_APPLICATION_OUTPUT, CREATE_CHAT_RESPONSE_CONFIGURATION as _SCHEMA_CREATE_CHAT_RESPONSE_CONFIGURATION, - CREATE_CHAT_RESPONSE_CONFIGURATION_INPUT as _SCHEMA_CREATE_CHAT_RESPONSE_CONFIGURATION_INPUT, - CREATE_CHAT_RESPONSE_CONFIGURATION_OUTPUT as _SCHEMA_CREATE_CHAT_RESPONSE_CONFIGURATION_OUTPUT, CREATE_DATA_ACCESSOR as _SCHEMA_CREATE_DATA_ACCESSOR, - CREATE_DATA_ACCESSOR_INPUT as _SCHEMA_CREATE_DATA_ACCESSOR_INPUT, - CREATE_DATA_ACCESSOR_OUTPUT as _SCHEMA_CREATE_DATA_ACCESSOR_OUTPUT, CREATE_DATA_SOURCE as _SCHEMA_CREATE_DATA_SOURCE, - CREATE_DATA_SOURCE_INPUT as _SCHEMA_CREATE_DATA_SOURCE_INPUT, - CREATE_DATA_SOURCE_OUTPUT as _SCHEMA_CREATE_DATA_SOURCE_OUTPUT, CREATE_INDEX as _SCHEMA_CREATE_INDEX, - CREATE_INDEX_INPUT as _SCHEMA_CREATE_INDEX_INPUT, - CREATE_INDEX_OUTPUT as _SCHEMA_CREATE_INDEX_OUTPUT, CREATE_PLUGIN as _SCHEMA_CREATE_PLUGIN, - CREATE_PLUGIN_INPUT as _SCHEMA_CREATE_PLUGIN_INPUT, - CREATE_PLUGIN_OUTPUT as _SCHEMA_CREATE_PLUGIN_OUTPUT, CREATE_RETRIEVER as _SCHEMA_CREATE_RETRIEVER, - CREATE_RETRIEVER_INPUT as _SCHEMA_CREATE_RETRIEVER_INPUT, - CREATE_RETRIEVER_OUTPUT as _SCHEMA_CREATE_RETRIEVER_OUTPUT, CREATE_SUBSCRIPTION as _SCHEMA_CREATE_SUBSCRIPTION, - CREATE_SUBSCRIPTION_INPUT as _SCHEMA_CREATE_SUBSCRIPTION_INPUT, - CREATE_SUBSCRIPTION_OUTPUT as _SCHEMA_CREATE_SUBSCRIPTION_OUTPUT, CREATE_USER as _SCHEMA_CREATE_USER, - CREATE_USER_INPUT as _SCHEMA_CREATE_USER_INPUT, - CREATE_USER_OUTPUT as _SCHEMA_CREATE_USER_OUTPUT, CREATE_WEB_EXPERIENCE as _SCHEMA_CREATE_WEB_EXPERIENCE, - CREATE_WEB_EXPERIENCE_INPUT as _SCHEMA_CREATE_WEB_EXPERIENCE_INPUT, - CREATE_WEB_EXPERIENCE_OUTPUT as _SCHEMA_CREATE_WEB_EXPERIENCE_OUTPUT, - CREATOR_MODE_CONFIGURATION as _SCHEMA_CREATOR_MODE_CONFIGURATION, - CUSTOMIZATION_CONFIGURATION as _SCHEMA_CUSTOMIZATION_CONFIGURATION, - CUSTOM_PLUGIN_CONFIGURATION as _SCHEMA_CUSTOM_PLUGIN_CONFIGURATION, - DATA_ACCESSOR as _SCHEMA_DATA_ACCESSOR, - DATA_ACCESSOR_AUTHENTICATION_CONFIGURATION as _SCHEMA_DATA_ACCESSOR_AUTHENTICATION_CONFIGURATION, - DATA_ACCESSOR_AUTHENTICATION_DETAIL as _SCHEMA_DATA_ACCESSOR_AUTHENTICATION_DETAIL, - DATA_ACCESSOR_IDC_TRUSTED_TOKEN_ISSUER_CONFIGURATION as _SCHEMA_DATA_ACCESSOR_IDC_TRUSTED_TOKEN_ISSUER_CONFIGURATION, - DATA_SOURCE as _SCHEMA_DATA_SOURCE, - DATA_SOURCE_SYNC_JOB as _SCHEMA_DATA_SOURCE_SYNC_JOB, - DATA_SOURCE_SYNC_JOB_METRICS as _SCHEMA_DATA_SOURCE_SYNC_JOB_METRICS, - DATA_SOURCE_VPC_CONFIGURATION as _SCHEMA_DATA_SOURCE_VPC_CONFIGURATION, - DATE_ATTRIBUTE_BOOSTING_CONFIGURATION as _SCHEMA_DATE_ATTRIBUTE_BOOSTING_CONFIGURATION, DELETE_APPLICATION as _SCHEMA_DELETE_APPLICATION, - DELETE_APPLICATION_INPUT as _SCHEMA_DELETE_APPLICATION_INPUT, - DELETE_APPLICATION_OUTPUT as _SCHEMA_DELETE_APPLICATION_OUTPUT, DELETE_ATTACHMENT as _SCHEMA_DELETE_ATTACHMENT, - DELETE_ATTACHMENT_INPUT as _SCHEMA_DELETE_ATTACHMENT_INPUT, - DELETE_ATTACHMENT_OUTPUT as _SCHEMA_DELETE_ATTACHMENT_OUTPUT, DELETE_CHAT_CONTROLS_CONFIGURATION as _SCHEMA_DELETE_CHAT_CONTROLS_CONFIGURATION, - DELETE_CHAT_CONTROLS_CONFIGURATION_INPUT as _SCHEMA_DELETE_CHAT_CONTROLS_CONFIGURATION_INPUT, - DELETE_CHAT_CONTROLS_CONFIGURATION_OUTPUT as _SCHEMA_DELETE_CHAT_CONTROLS_CONFIGURATION_OUTPUT, DELETE_CHAT_RESPONSE_CONFIGURATION as _SCHEMA_DELETE_CHAT_RESPONSE_CONFIGURATION, - DELETE_CHAT_RESPONSE_CONFIGURATION_INPUT as _SCHEMA_DELETE_CHAT_RESPONSE_CONFIGURATION_INPUT, - DELETE_CHAT_RESPONSE_CONFIGURATION_OUTPUT as _SCHEMA_DELETE_CHAT_RESPONSE_CONFIGURATION_OUTPUT, DELETE_CONVERSATION as _SCHEMA_DELETE_CONVERSATION, - DELETE_CONVERSATION_INPUT as _SCHEMA_DELETE_CONVERSATION_INPUT, - DELETE_CONVERSATION_OUTPUT as _SCHEMA_DELETE_CONVERSATION_OUTPUT, DELETE_DATA_ACCESSOR as _SCHEMA_DELETE_DATA_ACCESSOR, - DELETE_DATA_ACCESSOR_INPUT as _SCHEMA_DELETE_DATA_ACCESSOR_INPUT, - DELETE_DATA_ACCESSOR_OUTPUT as _SCHEMA_DELETE_DATA_ACCESSOR_OUTPUT, DELETE_DATA_SOURCE as _SCHEMA_DELETE_DATA_SOURCE, - DELETE_DATA_SOURCE_INPUT as _SCHEMA_DELETE_DATA_SOURCE_INPUT, - DELETE_DATA_SOURCE_OUTPUT as _SCHEMA_DELETE_DATA_SOURCE_OUTPUT, - DELETE_DOCUMENT as _SCHEMA_DELETE_DOCUMENT, DELETE_GROUP as _SCHEMA_DELETE_GROUP, - DELETE_GROUP_INPUT as _SCHEMA_DELETE_GROUP_INPUT, - DELETE_GROUP_OUTPUT as _SCHEMA_DELETE_GROUP_OUTPUT, DELETE_INDEX as _SCHEMA_DELETE_INDEX, - DELETE_INDEX_INPUT as _SCHEMA_DELETE_INDEX_INPUT, - DELETE_INDEX_OUTPUT as _SCHEMA_DELETE_INDEX_OUTPUT, DELETE_PLUGIN as _SCHEMA_DELETE_PLUGIN, - DELETE_PLUGIN_INPUT as _SCHEMA_DELETE_PLUGIN_INPUT, - DELETE_PLUGIN_OUTPUT as _SCHEMA_DELETE_PLUGIN_OUTPUT, DELETE_RETRIEVER as _SCHEMA_DELETE_RETRIEVER, - DELETE_RETRIEVER_INPUT as _SCHEMA_DELETE_RETRIEVER_INPUT, - DELETE_RETRIEVER_OUTPUT as _SCHEMA_DELETE_RETRIEVER_OUTPUT, DELETE_USER as _SCHEMA_DELETE_USER, - DELETE_USER_INPUT as _SCHEMA_DELETE_USER_INPUT, - DELETE_USER_OUTPUT as _SCHEMA_DELETE_USER_OUTPUT, DELETE_WEB_EXPERIENCE as _SCHEMA_DELETE_WEB_EXPERIENCE, - DELETE_WEB_EXPERIENCE_INPUT as _SCHEMA_DELETE_WEB_EXPERIENCE_INPUT, - DELETE_WEB_EXPERIENCE_OUTPUT as _SCHEMA_DELETE_WEB_EXPERIENCE_OUTPUT, DISASSOCIATE_PERMISSION as _SCHEMA_DISASSOCIATE_PERMISSION, - DISASSOCIATE_PERMISSION_INPUT as _SCHEMA_DISASSOCIATE_PERMISSION_INPUT, - DISASSOCIATE_PERMISSION_OUTPUT as _SCHEMA_DISASSOCIATE_PERMISSION_OUTPUT, - DOCUMENT as _SCHEMA_DOCUMENT, - DOCUMENT_ACL as _SCHEMA_DOCUMENT_ACL, - DOCUMENT_ACL_CONDITION as _SCHEMA_DOCUMENT_ACL_CONDITION, - DOCUMENT_ACL_GROUP as _SCHEMA_DOCUMENT_ACL_GROUP, - DOCUMENT_ACL_MEMBERSHIP as _SCHEMA_DOCUMENT_ACL_MEMBERSHIP, - DOCUMENT_ACL_USER as _SCHEMA_DOCUMENT_ACL_USER, - DOCUMENT_ATTRIBUTE as _SCHEMA_DOCUMENT_ATTRIBUTE, - DOCUMENT_ATTRIBUTE_BOOSTING_CONFIGURATION as _SCHEMA_DOCUMENT_ATTRIBUTE_BOOSTING_CONFIGURATION, - DOCUMENT_ATTRIBUTE_CONDITION as _SCHEMA_DOCUMENT_ATTRIBUTE_CONDITION, - DOCUMENT_ATTRIBUTE_CONFIGURATION as _SCHEMA_DOCUMENT_ATTRIBUTE_CONFIGURATION, - DOCUMENT_ATTRIBUTE_TARGET as _SCHEMA_DOCUMENT_ATTRIBUTE_TARGET, - DOCUMENT_ATTRIBUTE_VALUE as _SCHEMA_DOCUMENT_ATTRIBUTE_VALUE, - DOCUMENT_CONTENT as _SCHEMA_DOCUMENT_CONTENT, - DOCUMENT_DETAILS as _SCHEMA_DOCUMENT_DETAILS, - DOCUMENT_ENRICHMENT_CONFIGURATION as _SCHEMA_DOCUMENT_ENRICHMENT_CONFIGURATION, - ELIGIBLE_DATA_SOURCE as _SCHEMA_ELIGIBLE_DATA_SOURCE, - ENCRYPTION_CONFIGURATION as _SCHEMA_ENCRYPTION_CONFIGURATION, - END_OF_INPUT_EVENT as _SCHEMA_END_OF_INPUT_EVENT, - ERROR_DETAIL as _SCHEMA_ERROR_DETAIL, - EXTERNAL_RESOURCE_EXCEPTION as _SCHEMA_EXTERNAL_RESOURCE_EXCEPTION, - FAILED_ATTACHMENT_EVENT as _SCHEMA_FAILED_ATTACHMENT_EVENT, - FAILED_DOCUMENT as _SCHEMA_FAILED_DOCUMENT, GET_APPLICATION as _SCHEMA_GET_APPLICATION, - GET_APPLICATION_INPUT as _SCHEMA_GET_APPLICATION_INPUT, - GET_APPLICATION_OUTPUT as _SCHEMA_GET_APPLICATION_OUTPUT, GET_CHAT_CONTROLS_CONFIGURATION as _SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION, - GET_CHAT_CONTROLS_CONFIGURATION_INPUT as _SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION_INPUT, - GET_CHAT_CONTROLS_CONFIGURATION_OUTPUT as _SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION_OUTPUT, GET_CHAT_RESPONSE_CONFIGURATION as _SCHEMA_GET_CHAT_RESPONSE_CONFIGURATION, - GET_CHAT_RESPONSE_CONFIGURATION_INPUT as _SCHEMA_GET_CHAT_RESPONSE_CONFIGURATION_INPUT, - GET_CHAT_RESPONSE_CONFIGURATION_OUTPUT as _SCHEMA_GET_CHAT_RESPONSE_CONFIGURATION_OUTPUT, GET_DATA_ACCESSOR as _SCHEMA_GET_DATA_ACCESSOR, - GET_DATA_ACCESSOR_INPUT as _SCHEMA_GET_DATA_ACCESSOR_INPUT, - GET_DATA_ACCESSOR_OUTPUT as _SCHEMA_GET_DATA_ACCESSOR_OUTPUT, GET_DATA_SOURCE as _SCHEMA_GET_DATA_SOURCE, - GET_DATA_SOURCE_INPUT as _SCHEMA_GET_DATA_SOURCE_INPUT, - GET_DATA_SOURCE_OUTPUT as _SCHEMA_GET_DATA_SOURCE_OUTPUT, GET_DOCUMENT_CONTENT as _SCHEMA_GET_DOCUMENT_CONTENT, - GET_DOCUMENT_CONTENT_INPUT as _SCHEMA_GET_DOCUMENT_CONTENT_INPUT, - GET_DOCUMENT_CONTENT_OUTPUT as _SCHEMA_GET_DOCUMENT_CONTENT_OUTPUT, GET_GROUP as _SCHEMA_GET_GROUP, - GET_GROUP_INPUT as _SCHEMA_GET_GROUP_INPUT, - GET_GROUP_OUTPUT as _SCHEMA_GET_GROUP_OUTPUT, GET_INDEX as _SCHEMA_GET_INDEX, - GET_INDEX_INPUT as _SCHEMA_GET_INDEX_INPUT, - GET_INDEX_OUTPUT as _SCHEMA_GET_INDEX_OUTPUT, GET_MEDIA as _SCHEMA_GET_MEDIA, - GET_MEDIA_INPUT as _SCHEMA_GET_MEDIA_INPUT, - GET_MEDIA_OUTPUT as _SCHEMA_GET_MEDIA_OUTPUT, GET_PLUGIN as _SCHEMA_GET_PLUGIN, - GET_PLUGIN_INPUT as _SCHEMA_GET_PLUGIN_INPUT, - GET_PLUGIN_OUTPUT as _SCHEMA_GET_PLUGIN_OUTPUT, GET_POLICY as _SCHEMA_GET_POLICY, - GET_POLICY_INPUT as _SCHEMA_GET_POLICY_INPUT, - GET_POLICY_OUTPUT as _SCHEMA_GET_POLICY_OUTPUT, GET_RETRIEVER as _SCHEMA_GET_RETRIEVER, - GET_RETRIEVER_INPUT as _SCHEMA_GET_RETRIEVER_INPUT, - GET_RETRIEVER_OUTPUT as _SCHEMA_GET_RETRIEVER_OUTPUT, GET_USER as _SCHEMA_GET_USER, - GET_USER_INPUT as _SCHEMA_GET_USER_INPUT, - GET_USER_OUTPUT as _SCHEMA_GET_USER_OUTPUT, GET_WEB_EXPERIENCE as _SCHEMA_GET_WEB_EXPERIENCE, - GET_WEB_EXPERIENCE_INPUT as _SCHEMA_GET_WEB_EXPERIENCE_INPUT, - GET_WEB_EXPERIENCE_OUTPUT as _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT, - GROUP_MEMBERS as _SCHEMA_GROUP_MEMBERS, - GROUP_STATUS_DETAIL as _SCHEMA_GROUP_STATUS_DETAIL, - GROUP_SUMMARY as _SCHEMA_GROUP_SUMMARY, - HALLUCINATION_REDUCTION_CONFIGURATION as _SCHEMA_HALLUCINATION_REDUCTION_CONFIGURATION, - HOOK_CONFIGURATION as _SCHEMA_HOOK_CONFIGURATION, - IDC_AUTH_CONFIGURATION as _SCHEMA_IDC_AUTH_CONFIGURATION, - IDENTITY_PROVIDER_CONFIGURATION as _SCHEMA_IDENTITY_PROVIDER_CONFIGURATION, - IMAGE_EXTRACTION_CONFIGURATION as _SCHEMA_IMAGE_EXTRACTION_CONFIGURATION, - IMAGE_SOURCE_DETAILS as _SCHEMA_IMAGE_SOURCE_DETAILS, - INDEX as _SCHEMA_INDEX, - INDEX_CAPACITY_CONFIGURATION as _SCHEMA_INDEX_CAPACITY_CONFIGURATION, - INDEX_STATISTICS as _SCHEMA_INDEX_STATISTICS, - INLINE_DOCUMENT_ENRICHMENT_CONFIGURATION as _SCHEMA_INLINE_DOCUMENT_ENRICHMENT_CONFIGURATION, - INSTRUCTION_COLLECTION as _SCHEMA_INSTRUCTION_COLLECTION, - INTERNAL_SERVER_EXCEPTION as _SCHEMA_INTERNAL_SERVER_EXCEPTION, - KENDRA_INDEX_CONFIGURATION as _SCHEMA_KENDRA_INDEX_CONFIGURATION, - LICENSE_NOT_FOUND_EXCEPTION as _SCHEMA_LICENSE_NOT_FOUND_EXCEPTION, LIST_APPLICATIONS as _SCHEMA_LIST_APPLICATIONS, - LIST_APPLICATIONS_INPUT as _SCHEMA_LIST_APPLICATIONS_INPUT, - LIST_APPLICATIONS_OUTPUT as _SCHEMA_LIST_APPLICATIONS_OUTPUT, LIST_ATTACHMENTS as _SCHEMA_LIST_ATTACHMENTS, - LIST_ATTACHMENTS_INPUT as _SCHEMA_LIST_ATTACHMENTS_INPUT, - LIST_ATTACHMENTS_OUTPUT as _SCHEMA_LIST_ATTACHMENTS_OUTPUT, LIST_CHAT_RESPONSE_CONFIGURATIONS as _SCHEMA_LIST_CHAT_RESPONSE_CONFIGURATIONS, - LIST_CHAT_RESPONSE_CONFIGURATIONS_INPUT as _SCHEMA_LIST_CHAT_RESPONSE_CONFIGURATIONS_INPUT, - LIST_CHAT_RESPONSE_CONFIGURATIONS_OUTPUT as _SCHEMA_LIST_CHAT_RESPONSE_CONFIGURATIONS_OUTPUT, LIST_CONVERSATIONS as _SCHEMA_LIST_CONVERSATIONS, - LIST_CONVERSATIONS_INPUT as _SCHEMA_LIST_CONVERSATIONS_INPUT, - LIST_CONVERSATIONS_OUTPUT as _SCHEMA_LIST_CONVERSATIONS_OUTPUT, LIST_DATA_ACCESSORS as _SCHEMA_LIST_DATA_ACCESSORS, - LIST_DATA_ACCESSORS_INPUT as _SCHEMA_LIST_DATA_ACCESSORS_INPUT, - LIST_DATA_ACCESSORS_OUTPUT as _SCHEMA_LIST_DATA_ACCESSORS_OUTPUT, LIST_DATA_SOURCES as _SCHEMA_LIST_DATA_SOURCES, - LIST_DATA_SOURCES_INPUT as _SCHEMA_LIST_DATA_SOURCES_INPUT, - LIST_DATA_SOURCES_OUTPUT as _SCHEMA_LIST_DATA_SOURCES_OUTPUT, LIST_DATA_SOURCE_SYNC_JOBS as _SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS, - LIST_DATA_SOURCE_SYNC_JOBS_INPUT as _SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_INPUT, - LIST_DATA_SOURCE_SYNC_JOBS_OUTPUT as _SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_OUTPUT, LIST_DOCUMENTS as _SCHEMA_LIST_DOCUMENTS, - LIST_DOCUMENTS_INPUT as _SCHEMA_LIST_DOCUMENTS_INPUT, - LIST_DOCUMENTS_OUTPUT as _SCHEMA_LIST_DOCUMENTS_OUTPUT, LIST_GROUPS as _SCHEMA_LIST_GROUPS, - LIST_GROUPS_INPUT as _SCHEMA_LIST_GROUPS_INPUT, - LIST_GROUPS_OUTPUT as _SCHEMA_LIST_GROUPS_OUTPUT, LIST_INDICES as _SCHEMA_LIST_INDICES, - LIST_INDICES_INPUT as _SCHEMA_LIST_INDICES_INPUT, - LIST_INDICES_OUTPUT as _SCHEMA_LIST_INDICES_OUTPUT, LIST_MESSAGES as _SCHEMA_LIST_MESSAGES, - LIST_MESSAGES_INPUT as _SCHEMA_LIST_MESSAGES_INPUT, - LIST_MESSAGES_OUTPUT as _SCHEMA_LIST_MESSAGES_OUTPUT, LIST_PLUGINS as _SCHEMA_LIST_PLUGINS, - LIST_PLUGINS_INPUT as _SCHEMA_LIST_PLUGINS_INPUT, - LIST_PLUGINS_OUTPUT as _SCHEMA_LIST_PLUGINS_OUTPUT, LIST_PLUGIN_ACTIONS as _SCHEMA_LIST_PLUGIN_ACTIONS, - LIST_PLUGIN_ACTIONS_INPUT as _SCHEMA_LIST_PLUGIN_ACTIONS_INPUT, - LIST_PLUGIN_ACTIONS_OUTPUT as _SCHEMA_LIST_PLUGIN_ACTIONS_OUTPUT, LIST_PLUGIN_TYPE_ACTIONS as _SCHEMA_LIST_PLUGIN_TYPE_ACTIONS, - LIST_PLUGIN_TYPE_ACTIONS_INPUT as _SCHEMA_LIST_PLUGIN_TYPE_ACTIONS_INPUT, - LIST_PLUGIN_TYPE_ACTIONS_OUTPUT as _SCHEMA_LIST_PLUGIN_TYPE_ACTIONS_OUTPUT, LIST_PLUGIN_TYPE_METADATA as _SCHEMA_LIST_PLUGIN_TYPE_METADATA, - LIST_PLUGIN_TYPE_METADATA_INPUT as _SCHEMA_LIST_PLUGIN_TYPE_METADATA_INPUT, - LIST_PLUGIN_TYPE_METADATA_OUTPUT as _SCHEMA_LIST_PLUGIN_TYPE_METADATA_OUTPUT, LIST_RETRIEVERS as _SCHEMA_LIST_RETRIEVERS, - LIST_RETRIEVERS_INPUT as _SCHEMA_LIST_RETRIEVERS_INPUT, - LIST_RETRIEVERS_OUTPUT as _SCHEMA_LIST_RETRIEVERS_OUTPUT, LIST_SUBSCRIPTIONS as _SCHEMA_LIST_SUBSCRIPTIONS, - LIST_SUBSCRIPTIONS_INPUT as _SCHEMA_LIST_SUBSCRIPTIONS_INPUT, - LIST_SUBSCRIPTIONS_OUTPUT as _SCHEMA_LIST_SUBSCRIPTIONS_OUTPUT, LIST_TAGS_FOR_RESOURCE as _SCHEMA_LIST_TAGS_FOR_RESOURCE, - LIST_TAGS_FOR_RESOURCE_INPUT as _SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT, - LIST_TAGS_FOR_RESOURCE_OUTPUT as _SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT, LIST_WEB_EXPERIENCES as _SCHEMA_LIST_WEB_EXPERIENCES, - LIST_WEB_EXPERIENCES_INPUT as _SCHEMA_LIST_WEB_EXPERIENCES_INPUT, - LIST_WEB_EXPERIENCES_OUTPUT as _SCHEMA_LIST_WEB_EXPERIENCES_OUTPUT, - MEDIA_EXTRACTION_CONFIGURATION as _SCHEMA_MEDIA_EXTRACTION_CONFIGURATION, - MEDIA_TOO_LARGE_EXCEPTION as _SCHEMA_MEDIA_TOO_LARGE_EXCEPTION, - MEMBER_GROUP as _SCHEMA_MEMBER_GROUP, - MEMBER_USER as _SCHEMA_MEMBER_USER, - MESSAGE as _SCHEMA_MESSAGE, - MESSAGE_USEFULNESS_FEEDBACK as _SCHEMA_MESSAGE_USEFULNESS_FEEDBACK, - METADATA_EVENT as _SCHEMA_METADATA_EVENT, - NATIVE_INDEX_CONFIGURATION as _SCHEMA_NATIVE_INDEX_CONFIGURATION, - NO_AUTH_CONFIGURATION as _SCHEMA_NO_AUTH_CONFIGURATION, - NUMBER_ATTRIBUTE_BOOSTING_CONFIGURATION as _SCHEMA_NUMBER_ATTRIBUTE_BOOSTING_CONFIGURATION, - OPEN_ID_CONNECT_PROVIDER_CONFIGURATION as _SCHEMA_OPEN_ID_CONNECT_PROVIDER_CONFIGURATION, - ORCHESTRATION_CONFIGURATION as _SCHEMA_ORCHESTRATION_CONFIGURATION, - O_AUTH2_CLIENT_CREDENTIAL_CONFIGURATION as _SCHEMA_O_AUTH2_CLIENT_CREDENTIAL_CONFIGURATION, - PERMISSION_CONDITION as _SCHEMA_PERMISSION_CONDITION, - PERSONALIZATION_CONFIGURATION as _SCHEMA_PERSONALIZATION_CONFIGURATION, - PLUGIN as _SCHEMA_PLUGIN, - PLUGIN_AUTH_CONFIGURATION as _SCHEMA_PLUGIN_AUTH_CONFIGURATION, - PLUGIN_CONFIGURATION as _SCHEMA_PLUGIN_CONFIGURATION, - PLUGIN_TYPE_METADATA_SUMMARY as _SCHEMA_PLUGIN_TYPE_METADATA_SUMMARY, - PRINCIPAL as _SCHEMA_PRINCIPAL, - PRINCIPAL_GROUP as _SCHEMA_PRINCIPAL_GROUP, - PRINCIPAL_USER as _SCHEMA_PRINCIPAL_USER, PUT_FEEDBACK as _SCHEMA_PUT_FEEDBACK, - PUT_FEEDBACK_INPUT as _SCHEMA_PUT_FEEDBACK_INPUT, - PUT_FEEDBACK_OUTPUT as _SCHEMA_PUT_FEEDBACK_OUTPUT, PUT_GROUP as _SCHEMA_PUT_GROUP, - PUT_GROUP_INPUT as _SCHEMA_PUT_GROUP_INPUT, - PUT_GROUP_OUTPUT as _SCHEMA_PUT_GROUP_OUTPUT, - QUICK_SIGHT_CONFIGURATION as _SCHEMA_QUICK_SIGHT_CONFIGURATION, - Q_APPS_CONFIGURATION as _SCHEMA_Q_APPS_CONFIGURATION, - RELEVANT_CONTENT as _SCHEMA_RELEVANT_CONTENT, - RESOURCE_NOT_FOUND_EXCEPTION as _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - RESPONSE_CONFIGURATION as _SCHEMA_RESPONSE_CONFIGURATION, - RETRIEVER as _SCHEMA_RETRIEVER, - RETRIEVER_CONFIGURATION as _SCHEMA_RETRIEVER_CONFIGURATION, - RETRIEVER_CONTENT_SOURCE as _SCHEMA_RETRIEVER_CONTENT_SOURCE, - RULE as _SCHEMA_RULE, - RULE_CONFIGURATION as _SCHEMA_RULE_CONFIGURATION, - S3 as _SCHEMA_S3, - SAML_CONFIGURATION as _SCHEMA_SAML_CONFIGURATION, - SAML_PROVIDER_CONFIGURATION as _SCHEMA_SAML_PROVIDER_CONFIGURATION, - SCORE_ATTRIBUTES as _SCHEMA_SCORE_ATTRIBUTES, SEARCH_RELEVANT_CONTENT as _SCHEMA_SEARCH_RELEVANT_CONTENT, - SEARCH_RELEVANT_CONTENT_INPUT as _SCHEMA_SEARCH_RELEVANT_CONTENT_INPUT, - SEARCH_RELEVANT_CONTENT_OUTPUT as _SCHEMA_SEARCH_RELEVANT_CONTENT_OUTPUT, - SERVICE_QUOTA_EXCEEDED_EXCEPTION as _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - SNIPPET_EXCERPT as _SCHEMA_SNIPPET_EXCERPT, - SOURCE_ATTRIBUTION as _SCHEMA_SOURCE_ATTRIBUTION, - SOURCE_DETAILS as _SCHEMA_SOURCE_DETAILS, START_DATA_SOURCE_SYNC_JOB as _SCHEMA_START_DATA_SOURCE_SYNC_JOB, - START_DATA_SOURCE_SYNC_JOB_INPUT as _SCHEMA_START_DATA_SOURCE_SYNC_JOB_INPUT, - START_DATA_SOURCE_SYNC_JOB_OUTPUT as _SCHEMA_START_DATA_SOURCE_SYNC_JOB_OUTPUT, STOP_DATA_SOURCE_SYNC_JOB as _SCHEMA_STOP_DATA_SOURCE_SYNC_JOB, - STOP_DATA_SOURCE_SYNC_JOB_INPUT as _SCHEMA_STOP_DATA_SOURCE_SYNC_JOB_INPUT, - STOP_DATA_SOURCE_SYNC_JOB_OUTPUT as _SCHEMA_STOP_DATA_SOURCE_SYNC_JOB_OUTPUT, - STRING_ATTRIBUTE_BOOSTING_CONFIGURATION as _SCHEMA_STRING_ATTRIBUTE_BOOSTING_CONFIGURATION, - STRING_LIST_ATTRIBUTE_BOOSTING_CONFIGURATION as _SCHEMA_STRING_LIST_ATTRIBUTE_BOOSTING_CONFIGURATION, - SUBSCRIPTION as _SCHEMA_SUBSCRIPTION, - SUBSCRIPTION_DETAILS as _SCHEMA_SUBSCRIPTION_DETAILS, - SUBSCRIPTION_PRINCIPAL as _SCHEMA_SUBSCRIPTION_PRINCIPAL, - TAG as _SCHEMA_TAG, TAG_RESOURCE as _SCHEMA_TAG_RESOURCE, - TAG_RESOURCE_INPUT as _SCHEMA_TAG_RESOURCE_INPUT, - TAG_RESOURCE_OUTPUT as _SCHEMA_TAG_RESOURCE_OUTPUT, - TEXT_DOCUMENT_STATISTICS as _SCHEMA_TEXT_DOCUMENT_STATISTICS, - TEXT_INPUT_EVENT as _SCHEMA_TEXT_INPUT_EVENT, - TEXT_OUTPUT_EVENT as _SCHEMA_TEXT_OUTPUT_EVENT, - TEXT_SEGMENT as _SCHEMA_TEXT_SEGMENT, - THROTTLING_EXCEPTION as _SCHEMA_THROTTLING_EXCEPTION, - TOPIC_CONFIGURATION as _SCHEMA_TOPIC_CONFIGURATION, UNTAG_RESOURCE as _SCHEMA_UNTAG_RESOURCE, - UNTAG_RESOURCE_INPUT as _SCHEMA_UNTAG_RESOURCE_INPUT, - UNTAG_RESOURCE_OUTPUT as _SCHEMA_UNTAG_RESOURCE_OUTPUT, UPDATE_APPLICATION as _SCHEMA_UPDATE_APPLICATION, - UPDATE_APPLICATION_INPUT as _SCHEMA_UPDATE_APPLICATION_INPUT, - UPDATE_APPLICATION_OUTPUT as _SCHEMA_UPDATE_APPLICATION_OUTPUT, UPDATE_CHAT_CONTROLS_CONFIGURATION as _SCHEMA_UPDATE_CHAT_CONTROLS_CONFIGURATION, - UPDATE_CHAT_CONTROLS_CONFIGURATION_INPUT as _SCHEMA_UPDATE_CHAT_CONTROLS_CONFIGURATION_INPUT, - UPDATE_CHAT_CONTROLS_CONFIGURATION_OUTPUT as _SCHEMA_UPDATE_CHAT_CONTROLS_CONFIGURATION_OUTPUT, UPDATE_CHAT_RESPONSE_CONFIGURATION as _SCHEMA_UPDATE_CHAT_RESPONSE_CONFIGURATION, - UPDATE_CHAT_RESPONSE_CONFIGURATION_INPUT as _SCHEMA_UPDATE_CHAT_RESPONSE_CONFIGURATION_INPUT, - UPDATE_CHAT_RESPONSE_CONFIGURATION_OUTPUT as _SCHEMA_UPDATE_CHAT_RESPONSE_CONFIGURATION_OUTPUT, UPDATE_DATA_ACCESSOR as _SCHEMA_UPDATE_DATA_ACCESSOR, - UPDATE_DATA_ACCESSOR_INPUT as _SCHEMA_UPDATE_DATA_ACCESSOR_INPUT, - UPDATE_DATA_ACCESSOR_OUTPUT as _SCHEMA_UPDATE_DATA_ACCESSOR_OUTPUT, UPDATE_DATA_SOURCE as _SCHEMA_UPDATE_DATA_SOURCE, - UPDATE_DATA_SOURCE_INPUT as _SCHEMA_UPDATE_DATA_SOURCE_INPUT, - UPDATE_DATA_SOURCE_OUTPUT as _SCHEMA_UPDATE_DATA_SOURCE_OUTPUT, UPDATE_INDEX as _SCHEMA_UPDATE_INDEX, - UPDATE_INDEX_INPUT as _SCHEMA_UPDATE_INDEX_INPUT, - UPDATE_INDEX_OUTPUT as _SCHEMA_UPDATE_INDEX_OUTPUT, UPDATE_PLUGIN as _SCHEMA_UPDATE_PLUGIN, - UPDATE_PLUGIN_INPUT as _SCHEMA_UPDATE_PLUGIN_INPUT, - UPDATE_PLUGIN_OUTPUT as _SCHEMA_UPDATE_PLUGIN_OUTPUT, UPDATE_RETRIEVER as _SCHEMA_UPDATE_RETRIEVER, - UPDATE_RETRIEVER_INPUT as _SCHEMA_UPDATE_RETRIEVER_INPUT, - UPDATE_RETRIEVER_OUTPUT as _SCHEMA_UPDATE_RETRIEVER_OUTPUT, UPDATE_SUBSCRIPTION as _SCHEMA_UPDATE_SUBSCRIPTION, - UPDATE_SUBSCRIPTION_INPUT as _SCHEMA_UPDATE_SUBSCRIPTION_INPUT, - UPDATE_SUBSCRIPTION_OUTPUT as _SCHEMA_UPDATE_SUBSCRIPTION_OUTPUT, UPDATE_USER as _SCHEMA_UPDATE_USER, - UPDATE_USER_INPUT as _SCHEMA_UPDATE_USER_INPUT, - UPDATE_USER_OUTPUT as _SCHEMA_UPDATE_USER_OUTPUT, UPDATE_WEB_EXPERIENCE as _SCHEMA_UPDATE_WEB_EXPERIENCE, - UPDATE_WEB_EXPERIENCE_INPUT as _SCHEMA_UPDATE_WEB_EXPERIENCE_INPUT, - UPDATE_WEB_EXPERIENCE_OUTPUT as _SCHEMA_UPDATE_WEB_EXPERIENCE_OUTPUT, - USERS_AND_GROUPS as _SCHEMA_USERS_AND_GROUPS, - USER_ALIAS as _SCHEMA_USER_ALIAS, - VALIDATION_EXCEPTION as _SCHEMA_VALIDATION_EXCEPTION, - VALIDATION_EXCEPTION_FIELD as _SCHEMA_VALIDATION_EXCEPTION_FIELD, - VIDEO_EXTRACTION_CONFIGURATION as _SCHEMA_VIDEO_EXTRACTION_CONFIGURATION, - VIDEO_SOURCE_DETAILS as _SCHEMA_VIDEO_SOURCE_DETAILS, - WEB_EXPERIENCE as _SCHEMA_WEB_EXPERIENCE, - WEB_EXPERIENCE_AUTH_CONFIGURATION as _SCHEMA_WEB_EXPERIENCE_AUTH_CONFIGURATION, ) - -logger = logging.getLogger(__name__) - - -class ServiceError(ModeledError): - """ - Base error for all errors in the service. - - Some exceptions do not extend from this class, including - synthetic, implicit, and shared exception types. - """ - - -class MemberRelation(UnknownEnumMixin, StrEnum): - AND_ = "AND" - OR_ = "OR" - - -class ReadAccessType(UnknownEnumMixin, StrEnum): - ALLOW = "ALLOW" - DENY = "DENY" - - -class MembershipType(UnknownEnumMixin, StrEnum): - INDEX = "INDEX" - DATASOURCE = "DATASOURCE" - - -@dataclass(kw_only=True) -class PrincipalGroup: - """Provides information about a group associated with the principal.""" - - access: str - """ - Provides information about whether to allow or deny access to the - principal. - """ - - name: str | None = None - """The name of the group.""" - - membership_type: str | None = None - """The type of group.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PRINCIPAL_GROUP, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string(_SCHEMA_PRINCIPAL_GROUP.members["name"], self.name) - - serializer.write_string(_SCHEMA_PRINCIPAL_GROUP.members["access"], self.access) - if self.membership_type is not None: - serializer.write_string( - _SCHEMA_PRINCIPAL_GROUP.members["membershipType"], self.membership_type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_PRINCIPAL_GROUP.members["name"] - ) - - case 1: - kwargs["access"] = ReadAccessType( - de.read_string(_SCHEMA_PRINCIPAL_GROUP.members["access"]) - ) - - case 2: - kwargs["membership_type"] = MembershipType( - de.read_string( - _SCHEMA_PRINCIPAL_GROUP.members["membershipType"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PRINCIPAL_GROUP, consumer=_consumer) - if "access" not in kwargs: - kwargs["access"] = ReadAccessType._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class PrincipalUser: - """Provides information about a user associated with a principal.""" - - access: str - """ - Provides information about whether to allow or deny access to the - principal. - """ - - id: str | None = None - """The identifier of the user.""" - - membership_type: str | None = None - """The type of group.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PRINCIPAL_USER, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string(_SCHEMA_PRINCIPAL_USER.members["id"], self.id) - - serializer.write_string(_SCHEMA_PRINCIPAL_USER.members["access"], self.access) - if self.membership_type is not None: - serializer.write_string( - _SCHEMA_PRINCIPAL_USER.members["membershipType"], self.membership_type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string(_SCHEMA_PRINCIPAL_USER.members["id"]) - - case 1: - kwargs["access"] = ReadAccessType( - de.read_string(_SCHEMA_PRINCIPAL_USER.members["access"]) - ) - - case 2: - kwargs["membership_type"] = MembershipType( - de.read_string(_SCHEMA_PRINCIPAL_USER.members["membershipType"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PRINCIPAL_USER, consumer=_consumer) - if "access" not in kwargs: - kwargs["access"] = ReadAccessType._corrected("") - return kwargs - - -@dataclass -class Principal_User: - """The user associated with the principal.""" - - value: PrincipalUser - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PRINCIPAL, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PRINCIPAL.members["user"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=PrincipalUser.deserialize(deserializer)) - - -@dataclass -class Principal_Group: - """The group associated with the principal.""" - - value: PrincipalGroup - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PRINCIPAL, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PRINCIPAL.members["group"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=PrincipalGroup.deserialize(deserializer)) - - -@dataclass -class PrincipalUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -Principal = Union[Principal_User | Principal_Group | PrincipalUnknown] -""" -Provides user and group information used for filtering documents to use -for generating Amazon Q Business conversation responses. -""" - - -class _PrincipalDeserializer: - _result: Principal | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> Principal: - self._result = None - deserializer.read_struct(_SCHEMA_PRINCIPAL, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(Principal_User.deserialize(de)) - - case 1: - self._set_result(Principal_Group.deserialize(de)) - - case _: - self._set_result(PrincipalUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: Principal) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_principals( - serializer: ShapeSerializer, schema: Schema, value: list[Principal] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_principals( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Principal]: - result: list[Principal] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(_PrincipalDeserializer().deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AccessControl: - """ - A list of principals. Each principal can be either a `USER` or a `GROUP` - and can be designated document access permissions of either `ALLOW` or - `DENY`. - """ - - principals: list[Principal] - """ - Contains a list of principals, where a principal can be either a `USER` - or a `GROUP`. Each principal can be have the following type of document - access: `ALLOW` or `DENY`. - """ - - member_relation: str | None = None - """Describes the member relation within a principal list.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACCESS_CONTROL, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_principals( - serializer, _SCHEMA_ACCESS_CONTROL.members["principals"], self.principals - ) - if self.member_relation is not None: - serializer.write_string( - _SCHEMA_ACCESS_CONTROL.members["memberRelation"], self.member_relation - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["principals"] = _deserialize_principals( - de, _SCHEMA_ACCESS_CONTROL.members["principals"] - ) - - case 1: - kwargs["member_relation"] = MemberRelation( - de.read_string(_SCHEMA_ACCESS_CONTROL.members["memberRelation"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ACCESS_CONTROL, consumer=_consumer) - if "principals" not in kwargs: - kwargs["principals"] = [] - return kwargs - - -def _serialize_access_controls( - serializer: ShapeSerializer, schema: Schema, value: list[AccessControl] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_access_controls( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AccessControl]: - result: list[AccessControl] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AccessControl.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AccessConfiguration: - """Used to configure access permissions for a document.""" - - access_controls: list[AccessControl] - """A list of `AccessControlList` objects.""" - - member_relation: str | None = None - """Describes the member relation within the `AccessControlList` object.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACCESS_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_access_controls( - serializer, - _SCHEMA_ACCESS_CONFIGURATION.members["accessControls"], - self.access_controls, - ) - if self.member_relation is not None: - serializer.write_string( - _SCHEMA_ACCESS_CONFIGURATION.members["memberRelation"], - self.member_relation, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["access_controls"] = _deserialize_access_controls( - de, _SCHEMA_ACCESS_CONFIGURATION.members["accessControls"] - ) - - case 1: - kwargs["member_relation"] = MemberRelation( - de.read_string( - _SCHEMA_ACCESS_CONFIGURATION.members["memberRelation"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ACCESS_CONFIGURATION, consumer=_consumer) - if "access_controls" not in kwargs: - kwargs["access_controls"] = [] - return kwargs - - -@dataclass(kw_only=True) -class AccessDeniedException(ServiceError): - """ - You don't have access to perform this action. Make sure you have the - required permission policies and user accounts and try again. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACCESS_DENIED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_ACCESS_DENIED_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_ACCESS_DENIED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ACCESS_DENIED_EXCEPTION, consumer=_consumer) - return kwargs - - -def _serialize_document_attribute_string_list_value( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_document_attribute_string_list_value( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass -class DocumentAttributeValueStringValue: - """A string.""" - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_ATTRIBUTE_VALUE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DOCUMENT_ATTRIBUTE_VALUE.members["stringValue"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string( - _SCHEMA_DOCUMENT_ATTRIBUTE_VALUE.members["stringValue"] - ) - ) - - -@dataclass -class DocumentAttributeValueStringListValue: - """A list of strings.""" - - value: list[str] - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_ATTRIBUTE_VALUE, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_document_attribute_string_list_value( - serializer, - _SCHEMA_DOCUMENT_ATTRIBUTE_VALUE.members["stringListValue"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=_deserialize_document_attribute_string_list_value( - deserializer, - _SCHEMA_DOCUMENT_ATTRIBUTE_VALUE.members["stringListValue"], - ) - ) - - -@dataclass -class DocumentAttributeValueLongValue: - """A long integer value.""" - - value: int - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_ATTRIBUTE_VALUE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_long( - _SCHEMA_DOCUMENT_ATTRIBUTE_VALUE.members["longValue"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_long( - _SCHEMA_DOCUMENT_ATTRIBUTE_VALUE.members["longValue"] - ) - ) - - -@dataclass -class DocumentAttributeValueDateValue: - """ - A date expressed as an ISO 8601 string. - - It's important for the time zone to be included in the ISO 8601 - date-time format. For example, 2012-03-25T12:30:10+01:00 is the ISO 8601 - date-time format for March 25th 2012 at 12:30PM (plus 10 seconds) in - Central European Time. - """ - - value: datetime - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_ATTRIBUTE_VALUE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_timestamp( - _SCHEMA_DOCUMENT_ATTRIBUTE_VALUE.members["dateValue"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_timestamp( - _SCHEMA_DOCUMENT_ATTRIBUTE_VALUE.members["dateValue"] - ) - ) - - -@dataclass -class DocumentAttributeValueUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -DocumentAttributeValue = Union[ - DocumentAttributeValueStringValue - | DocumentAttributeValueStringListValue - | DocumentAttributeValueLongValue - | DocumentAttributeValueDateValue - | DocumentAttributeValueUnknown -] -""" -The value of a document attribute. You can only provide one value for a -document attribute. -""" - - -class _DocumentAttributeValueDeserializer: - _result: DocumentAttributeValue | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> DocumentAttributeValue: - self._result = None - deserializer.read_struct(_SCHEMA_DOCUMENT_ATTRIBUTE_VALUE, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(DocumentAttributeValueStringValue.deserialize(de)) - - case 1: - self._set_result(DocumentAttributeValueStringListValue.deserialize(de)) - - case 2: - self._set_result(DocumentAttributeValueLongValue.deserialize(de)) - - case 3: - self._set_result(DocumentAttributeValueDateValue.deserialize(de)) - - case _: - self._set_result( - DocumentAttributeValueUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: DocumentAttributeValue) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class DocumentAttribute: - """A document attribute or metadata field.""" - - name: str - """The identifier for the attribute.""" - - value: DocumentAttributeValue - """The value of the attribute.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_ATTRIBUTE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_DOCUMENT_ATTRIBUTE.members["name"], self.name) - serializer.write_struct(_SCHEMA_DOCUMENT_ATTRIBUTE.members["value"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_DOCUMENT_ATTRIBUTE.members["name"] - ) - - case 1: - kwargs["value"] = _DocumentAttributeValueDeserializer().deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DOCUMENT_ATTRIBUTE, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "value" not in kwargs: - kwargs["value"] = DocumentAttributeValueUnknown(tag="") - return kwargs - - -@dataclass(kw_only=True) -class ActionExecutionPayloadField: - """A user input field in an plugin action execution payload.""" - - value: _Document - """The content of a user input field in an plugin action execution payload.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACTION_EXECUTION_PAYLOAD_FIELD, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_document( - _SCHEMA_ACTION_EXECUTION_PAYLOAD_FIELD.members["value"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["value"] = de.read_document( - _SCHEMA_ACTION_EXECUTION_PAYLOAD_FIELD.members["value"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ACTION_EXECUTION_PAYLOAD_FIELD, consumer=_consumer - ) - if "value" not in kwargs: - kwargs["value"] = _Document(None) - return kwargs - - -def _serialize_action_execution_payload( - serializer: ShapeSerializer, - schema: Schema, - value: dict[str, ActionExecutionPayloadField], -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_struct(value_schema, v)) - - -def _deserialize_action_execution_payload( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, ActionExecutionPayloadField]: - result: dict[str, ActionExecutionPayloadField] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = ActionExecutionPayloadField.deserialize(d) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ActionExecution: - """ - Performs an Amazon Q Business plugin action during a non-streaming chat - conversation. - """ - - plugin_id: str - """The identifier of the plugin the action is attached to.""" - - payload: dict[str, ActionExecutionPayloadField] - """ - A mapping of field names to the field values in input that an end user - provides to Amazon Q Business requests to perform their plugin action. - """ - - payload_field_name_separator: str - """ - A string used to retain information about the hierarchical contexts - within an action execution event payload. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACTION_EXECUTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_ACTION_EXECUTION.members["pluginId"], self.plugin_id - ) - _serialize_action_execution_payload( - serializer, _SCHEMA_ACTION_EXECUTION.members["payload"], self.payload - ) - serializer.write_string( - _SCHEMA_ACTION_EXECUTION.members["payloadFieldNameSeparator"], - self.payload_field_name_separator, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["plugin_id"] = de.read_string( - _SCHEMA_ACTION_EXECUTION.members["pluginId"] - ) - - case 1: - kwargs["payload"] = _deserialize_action_execution_payload( - de, _SCHEMA_ACTION_EXECUTION.members["payload"] - ) - - case 2: - kwargs["payload_field_name_separator"] = de.read_string( - _SCHEMA_ACTION_EXECUTION.members["payloadFieldNameSeparator"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ACTION_EXECUTION, consumer=_consumer) - if "plugin_id" not in kwargs: - kwargs["plugin_id"] = "" - if "payload" not in kwargs: - kwargs["payload"] = {} - if "payload_field_name_separator" not in kwargs: - kwargs["payload_field_name_separator"] = "" - return kwargs - - -@dataclass(kw_only=True) -class ActionExecutionEvent: - """ - A request from an end user signalling an intent to perform an Amazon Q - Business plugin action during a streaming chat. - """ - - plugin_id: str - """The identifier of the plugin for which the action is being requested.""" - - payload: dict[str, ActionExecutionPayloadField] - """ - A mapping of field names to the field values in input that an end user - provides to Amazon Q Business requests to perform their plugin action. - """ - - payload_field_name_separator: str - """ - A string used to retain information about the hierarchical contexts - within a action execution event payload. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACTION_EXECUTION_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_ACTION_EXECUTION_EVENT.members["pluginId"], self.plugin_id - ) - _serialize_action_execution_payload( - serializer, _SCHEMA_ACTION_EXECUTION_EVENT.members["payload"], self.payload - ) - serializer.write_string( - _SCHEMA_ACTION_EXECUTION_EVENT.members["payloadFieldNameSeparator"], - self.payload_field_name_separator, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["plugin_id"] = de.read_string( - _SCHEMA_ACTION_EXECUTION_EVENT.members["pluginId"] - ) - - case 1: - kwargs["payload"] = _deserialize_action_execution_payload( - de, _SCHEMA_ACTION_EXECUTION_EVENT.members["payload"] - ) - - case 2: - kwargs["payload_field_name_separator"] = de.read_string( - _SCHEMA_ACTION_EXECUTION_EVENT.members[ - "payloadFieldNameSeparator" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ACTION_EXECUTION_EVENT, consumer=_consumer) - if "plugin_id" not in kwargs: - kwargs["plugin_id"] = "" - if "payload" not in kwargs: - kwargs["payload"] = {} - if "payload_field_name_separator" not in kwargs: - kwargs["payload_field_name_separator"] = "" - return kwargs - - -class ActionPayloadFieldType(UnknownEnumMixin, StrEnum): - STRING = "STRING" - NUMBER = "NUMBER" - ARRAY = "ARRAY" - BOOLEAN = "BOOLEAN" - - -@dataclass(kw_only=True) -class ActionReviewPayloadFieldAllowedValue: - """ - Information about the field values that an end user can use to provide - to Amazon Q Business for Amazon Q Business to perform the requested - plugin action. - """ - - value: _Document | None = None - """The field value.""" - - display_value: _Document | None = None - """The name of the field.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD_ALLOWED_VALUE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.value is not None: - serializer.write_document( - _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD_ALLOWED_VALUE.members["value"], - self.value, - ) - - if self.display_value is not None: - serializer.write_document( - _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD_ALLOWED_VALUE.members[ - "displayValue" - ], - self.display_value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["value"] = de.read_document( - _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD_ALLOWED_VALUE.members[ - "value" - ] - ) - - case 1: - kwargs["display_value"] = de.read_document( - _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD_ALLOWED_VALUE.members[ - "displayValue" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD_ALLOWED_VALUE, consumer=_consumer - ) - return kwargs - - -def _serialize_action_review_payload_field_allowed_values( - serializer: ShapeSerializer, - schema: Schema, - value: list[ActionReviewPayloadFieldAllowedValue], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_action_review_payload_field_allowed_values( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ActionReviewPayloadFieldAllowedValue]: - result: list[ActionReviewPayloadFieldAllowedValue] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ActionReviewPayloadFieldAllowedValue.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ActionReviewPayloadField: - """A user input field in an plugin action review payload.""" - - display_name: str | None = None - """The name of the field.""" - - display_order: int | None = None - """The display order of fields in a payload.""" - - display_description: str | None = None - """ - The field level description of each action review input field. This - could be an explanation of the field. In the Amazon Q Business web - experience, these descriptions could be used to display as tool tips to - help users understand the field. - """ - - type: str | None = None - """The type of field.""" - - value: _Document | None = None - """The field value.""" - - allowed_values: list[ActionReviewPayloadFieldAllowedValue] | None = None - """ - Information about the field values that an end user can use to provide - to Amazon Q Business for Amazon Q Business to perform the requested - plugin action. - """ - - allowed_format: str | None = None - """ - The expected data format for the action review input field value. For - example, in PTO request, `from` and `to` would be of `datetime` allowed - format. - """ - - array_item_json_schema: _Document | None = None - """ - Use to create a custom form with array fields (fields with nested - objects inside an array). - """ - - required: bool | None = None - """Information about whether the field is required.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.display_name is not None: - serializer.write_string( - _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD.members["displayName"], - self.display_name, - ) - - if self.display_order is not None: - serializer.write_integer( - _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD.members["displayOrder"], - self.display_order, - ) - - if self.display_description is not None: - serializer.write_string( - _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD.members["displayDescription"], - self.display_description, - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD.members["type"], self.type - ) - - if self.value is not None: - serializer.write_document( - _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD.members["value"], self.value - ) - - if self.allowed_values is not None: - _serialize_action_review_payload_field_allowed_values( - serializer, - _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD.members["allowedValues"], - self.allowed_values, - ) - - if self.allowed_format is not None: - serializer.write_string( - _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD.members["allowedFormat"], - self.allowed_format, - ) - - if self.array_item_json_schema is not None: - serializer.write_document( - _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD.members["arrayItemJsonSchema"], - self.array_item_json_schema, - ) - - if self.required is not None: - serializer.write_boolean( - _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD.members["required"], self.required - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["display_name"] = de.read_string( - _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD.members["displayName"] - ) - - case 1: - kwargs["display_order"] = de.read_integer( - _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD.members["displayOrder"] - ) - - case 2: - kwargs["display_description"] = de.read_string( - _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD.members[ - "displayDescription" - ] - ) - - case 3: - kwargs["type"] = ActionPayloadFieldType( - de.read_string( - _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD.members["type"] - ) - ) - - case 4: - kwargs["value"] = de.read_document( - _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD.members["value"] - ) - - case 5: - kwargs["allowed_values"] = ( - _deserialize_action_review_payload_field_allowed_values( - de, - _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD.members[ - "allowedValues" - ], - ) - ) - - case 6: - kwargs["allowed_format"] = de.read_string( - _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD.members["allowedFormat"] - ) - - case 7: - kwargs["array_item_json_schema"] = de.read_document( - _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD.members[ - "arrayItemJsonSchema" - ] - ) - - case 8: - kwargs["required"] = de.read_boolean( - _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD.members["required"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ACTION_REVIEW_PAYLOAD_FIELD, consumer=_consumer - ) - return kwargs - - -def _serialize_action_review_payload( - serializer: ShapeSerializer, - schema: Schema, - value: dict[str, ActionReviewPayloadField], -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_struct(value_schema, v)) - - -def _deserialize_action_review_payload( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, ActionReviewPayloadField]: - result: dict[str, ActionReviewPayloadField] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = ActionReviewPayloadField.deserialize(d) - - deserializer.read_map(schema, _read_value) - return result - - -class PluginType(UnknownEnumMixin, StrEnum): - SERVICE_NOW = "SERVICE_NOW" - SALESFORCE = "SALESFORCE" - JIRA = "JIRA" - ZENDESK = "ZENDESK" - CUSTOM = "CUSTOM" - QUICKSIGHT = "QUICKSIGHT" - SERVICENOW_NOW_PLATFORM = "SERVICENOW_NOW_PLATFORM" - JIRA_CLOUD = "JIRA_CLOUD" - SALESFORCE_CRM = "SALESFORCE_CRM" - ZENDESK_SUITE = "ZENDESK_SUITE" - ATLASSIAN_CONFLUENCE = "ATLASSIAN_CONFLUENCE" - GOOGLE_CALENDAR = "GOOGLE_CALENDAR" - MICROSOFT_TEAMS = "MICROSOFT_TEAMS" - MICROSOFT_EXCHANGE = "MICROSOFT_EXCHANGE" - PAGERDUTY_ADVANCE = "PAGERDUTY_ADVANCE" - SMARTSHEET = "SMARTSHEET" - ASANA = "ASANA" - - -@dataclass(kw_only=True) -class ActionReview: - """ - An output event that Amazon Q Business returns to an user who wants to - perform a plugin action during a non-streaming chat conversation. It - contains information about the selected action with a list of possible - user input fields, some pre-populated by Amazon Q Business. - """ - - plugin_id: str | None = None - """The identifier of the plugin associated with the action review.""" - - plugin_type: str | None = None - """The type of plugin.""" - - payload: dict[str, ActionReviewPayloadField] | None = None - """ - Field values that an end user needs to provide to Amazon Q Business for - Amazon Q Business to perform the requested plugin action. - """ - - payload_field_name_separator: str | None = None - """ - A string used to retain information about the hierarchical contexts - within an action review payload. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACTION_REVIEW, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.plugin_id is not None: - serializer.write_string( - _SCHEMA_ACTION_REVIEW.members["pluginId"], self.plugin_id - ) - - if self.plugin_type is not None: - serializer.write_string( - _SCHEMA_ACTION_REVIEW.members["pluginType"], self.plugin_type - ) - - if self.payload is not None: - _serialize_action_review_payload( - serializer, _SCHEMA_ACTION_REVIEW.members["payload"], self.payload - ) - - if self.payload_field_name_separator is not None: - serializer.write_string( - _SCHEMA_ACTION_REVIEW.members["payloadFieldNameSeparator"], - self.payload_field_name_separator, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["plugin_id"] = de.read_string( - _SCHEMA_ACTION_REVIEW.members["pluginId"] - ) - - case 1: - kwargs["plugin_type"] = PluginType( - de.read_string(_SCHEMA_ACTION_REVIEW.members["pluginType"]) - ) - - case 2: - kwargs["payload"] = _deserialize_action_review_payload( - de, _SCHEMA_ACTION_REVIEW.members["payload"] - ) - - case 3: - kwargs["payload_field_name_separator"] = de.read_string( - _SCHEMA_ACTION_REVIEW.members["payloadFieldNameSeparator"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ACTION_REVIEW, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ActionReviewEvent: - """ - An output event that Amazon Q Business returns to an user who wants to - perform a plugin action during a streaming chat conversation. It - contains information about the selected action with a list of possible - user input fields, some pre-populated by Amazon Q Business. - """ - - conversation_id: str | None = None - """ - The identifier of the conversation with which the action review event is - associated. - """ - - user_message_id: str | None = None - """ - The identifier of the conversation with which the plugin action is - associated. - """ - - system_message_id: str | None = None - """ - The identifier of an Amazon Q Business AI generated associated with the - action review event. - """ - - plugin_id: str | None = None - """The identifier of the plugin associated with the action review event.""" - - plugin_type: str | None = None - """The type of plugin.""" - - payload: dict[str, ActionReviewPayloadField] | None = None - """ - Field values that an end user needs to provide to Amazon Q Business for - Amazon Q Business to perform the requested plugin action. - """ - - payload_field_name_separator: str | None = None - """ - A string used to retain information about the hierarchical contexts - within an action review event payload. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACTION_REVIEW_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.conversation_id is not None: - serializer.write_string( - _SCHEMA_ACTION_REVIEW_EVENT.members["conversationId"], - self.conversation_id, - ) - - if self.user_message_id is not None: - serializer.write_string( - _SCHEMA_ACTION_REVIEW_EVENT.members["userMessageId"], - self.user_message_id, - ) - - if self.system_message_id is not None: - serializer.write_string( - _SCHEMA_ACTION_REVIEW_EVENT.members["systemMessageId"], - self.system_message_id, - ) - - if self.plugin_id is not None: - serializer.write_string( - _SCHEMA_ACTION_REVIEW_EVENT.members["pluginId"], self.plugin_id - ) - - if self.plugin_type is not None: - serializer.write_string( - _SCHEMA_ACTION_REVIEW_EVENT.members["pluginType"], self.plugin_type - ) - - if self.payload is not None: - _serialize_action_review_payload( - serializer, _SCHEMA_ACTION_REVIEW_EVENT.members["payload"], self.payload - ) - - if self.payload_field_name_separator is not None: - serializer.write_string( - _SCHEMA_ACTION_REVIEW_EVENT.members["payloadFieldNameSeparator"], - self.payload_field_name_separator, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["conversation_id"] = de.read_string( - _SCHEMA_ACTION_REVIEW_EVENT.members["conversationId"] - ) - - case 1: - kwargs["user_message_id"] = de.read_string( - _SCHEMA_ACTION_REVIEW_EVENT.members["userMessageId"] - ) - - case 2: - kwargs["system_message_id"] = de.read_string( - _SCHEMA_ACTION_REVIEW_EVENT.members["systemMessageId"] - ) - - case 3: - kwargs["plugin_id"] = de.read_string( - _SCHEMA_ACTION_REVIEW_EVENT.members["pluginId"] - ) - - case 4: - kwargs["plugin_type"] = PluginType( - de.read_string( - _SCHEMA_ACTION_REVIEW_EVENT.members["pluginType"] - ) - ) - - case 5: - kwargs["payload"] = _deserialize_action_review_payload( - de, _SCHEMA_ACTION_REVIEW_EVENT.members["payload"] - ) - - case 6: - kwargs["payload_field_name_separator"] = de.read_string( - _SCHEMA_ACTION_REVIEW_EVENT.members["payloadFieldNameSeparator"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ACTION_REVIEW_EVENT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ActionSummary: - """Summary information for an Amazon Q Business plugin action.""" - - action_identifier: str | None = None - """The identifier of an Amazon Q Business plugin action.""" - - display_name: str | None = None - """ - The display name assigned by Amazon Q Business to a plugin action. You - can't modify this value. - """ - - instruction_example: str | None = None - """ - An Amazon Q Business suggested prompt and end user can use to invoke a - plugin action. This value can be modified and sent as input to initiate - an action. For example: - - - Create a Jira task - - - Create a chat assistant task to find the root cause of a specific - incident - """ - - description: str | None = None - """The description of an Amazon Q Business plugin action.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACTION_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.action_identifier is not None: - serializer.write_string( - _SCHEMA_ACTION_SUMMARY.members["actionIdentifier"], - self.action_identifier, - ) - - if self.display_name is not None: - serializer.write_string( - _SCHEMA_ACTION_SUMMARY.members["displayName"], self.display_name - ) - - if self.instruction_example is not None: - serializer.write_string( - _SCHEMA_ACTION_SUMMARY.members["instructionExample"], - self.instruction_example, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_ACTION_SUMMARY.members["description"], self.description - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["action_identifier"] = de.read_string( - _SCHEMA_ACTION_SUMMARY.members["actionIdentifier"] - ) - - case 1: - kwargs["display_name"] = de.read_string( - _SCHEMA_ACTION_SUMMARY.members["displayName"] - ) - - case 2: - kwargs["instruction_example"] = de.read_string( - _SCHEMA_ACTION_SUMMARY.members["instructionExample"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_ACTION_SUMMARY.members["description"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ACTION_SUMMARY, consumer=_consumer) - return kwargs - - -def _serialize_actions( - serializer: ShapeSerializer, schema: Schema, value: list[ActionSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_actions( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ActionSummary]: - result: list[ActionSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ActionSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class S3: - """ - Information required for Amazon Q Business to find a specific file in an - Amazon S3 bucket. - """ - - bucket: str - """The name of the S3 bucket that contains the file.""" - - key: str - """The name of the file.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_S3, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_S3.members["bucket"], self.bucket) - serializer.write_string(_SCHEMA_S3.members["key"], self.key) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bucket"] = de.read_string(_SCHEMA_S3.members["bucket"]) - - case 1: - kwargs["key"] = de.read_string(_SCHEMA_S3.members["key"]) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_S3, consumer=_consumer) - if "bucket" not in kwargs: - kwargs["bucket"] = "" - if "key" not in kwargs: - kwargs["key"] = "" - return kwargs - - -@dataclass -class APISchemaPayload: - """ - The JSON or YAML-formatted payload defining the OpenAPI schema for a - custom plugin. - """ - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_API_SCHEMA, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_API_SCHEMA.members["payload"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string(_SCHEMA_API_SCHEMA.members["payload"]) - ) - - -@dataclass -class APISchemaS3: - """ - Contains details about the S3 object containing the OpenAPI schema for a - custom plugin. The schema could be in either JSON or YAML format. - """ - - value: S3 - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_API_SCHEMA, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_API_SCHEMA.members["s3"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=S3.deserialize(deserializer)) - - -@dataclass -class APISchemaUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -APISchema = Union[APISchemaPayload | APISchemaS3 | APISchemaUnknown] -""" -Contains details about the OpenAPI schema for a custom plugin. For more -information, see [custom plugin OpenAPI -schemas](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/custom-plugin.html#plugins-api-schema). -You can either include the schema directly in the payload field or you -can upload it to an S3 bucket and specify the S3 bucket location in the -`s3` field. -""" - - -class _APISchemaDeserializer: - _result: APISchema | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> APISchema: - self._result = None - deserializer.read_struct(_SCHEMA_API_SCHEMA, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(APISchemaPayload.deserialize(de)) - - case 1: - self._set_result(APISchemaS3.deserialize(de)) - - case _: - self._set_result(APISchemaUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: APISchema) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class APISchemaType(UnknownEnumMixin, StrEnum): - OPEN_API_V3 = "OPEN_API_V3" - - -class IdentityType(UnknownEnumMixin, StrEnum): - AWS_IAM_IDP_SAML = "AWS_IAM_IDP_SAML" - AWS_IAM_IDP_OIDC = "AWS_IAM_IDP_OIDC" - AWS_IAM_IDC = "AWS_IAM_IDC" - AWS_QUICKSIGHT_IDP = "AWS_QUICKSIGHT_IDP" - ANONYMOUS = "ANONYMOUS" - - -@dataclass(kw_only=True) -class QuickSightConfiguration: - """ - The Amazon Quick Suite configuration for an Amazon Q Business - application that uses Quick Suite as the identity provider. For more - information, see [Creating an Amazon Quick Suite integrated - application](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/create-quicksight-integrated-application.html). - """ - - client_namespace: str - """ - The Amazon Quick Suite namespace that is used as the identity provider. - For more information about Quick Suite namespaces, see [Namespace - operations](https://docs.aws.amazon.com/quicksight/latest/developerguide/namespace-operations.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_QUICK_SIGHT_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_QUICK_SIGHT_CONFIGURATION.members["clientNamespace"], - self.client_namespace, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["client_namespace"] = de.read_string( - _SCHEMA_QUICK_SIGHT_CONFIGURATION.members["clientNamespace"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_QUICK_SIGHT_CONFIGURATION, consumer=_consumer) - if "client_namespace" not in kwargs: - kwargs["client_namespace"] = "" - return kwargs - - -class ApplicationStatus(UnknownEnumMixin, StrEnum): - CREATING = "CREATING" - ACTIVE = "ACTIVE" - DELETING = "DELETING" - FAILED = "FAILED" - UPDATING = "UPDATING" - - -@dataclass(kw_only=True) -class Application: - """Summary information for an Amazon Q Business application.""" - - display_name: str | None = None - """The name of the Amazon Q Business application.""" - - application_id: str | None = None - """The identifier for the Amazon Q Business application.""" - - created_at: datetime | None = None - """The Unix timestamp when the Amazon Q Business application was created.""" - - updated_at: datetime | None = None - """ - The Unix timestamp when the Amazon Q Business application was last - updated. - """ - - status: str | None = None - """ - The status of the Amazon Q Business application. The application is - ready to use when the status is `ACTIVE`. - """ - - identity_type: str | None = None - """The authentication type being used by a Amazon Q Business application.""" - - quick_sight_configuration: QuickSightConfiguration | None = None - """ - The Amazon Quick Suite configuration for an Amazon Q Business - application that uses Quick Suite as the identity provider. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_APPLICATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.display_name is not None: - serializer.write_string( - _SCHEMA_APPLICATION.members["displayName"], self.display_name - ) - - if self.application_id is not None: - serializer.write_string( - _SCHEMA_APPLICATION.members["applicationId"], self.application_id - ) - - if self.created_at is not None: - serializer.write_timestamp( - _SCHEMA_APPLICATION.members["createdAt"], self.created_at - ) - - if self.updated_at is not None: - serializer.write_timestamp( - _SCHEMA_APPLICATION.members["updatedAt"], self.updated_at - ) - - if self.status is not None: - serializer.write_string(_SCHEMA_APPLICATION.members["status"], self.status) - - if self.identity_type is not None: - serializer.write_string( - _SCHEMA_APPLICATION.members["identityType"], self.identity_type - ) - - if self.quick_sight_configuration is not None: - serializer.write_struct( - _SCHEMA_APPLICATION.members["quickSightConfiguration"], - self.quick_sight_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["display_name"] = de.read_string( - _SCHEMA_APPLICATION.members["displayName"] - ) - - case 1: - kwargs["application_id"] = de.read_string( - _SCHEMA_APPLICATION.members["applicationId"] - ) - - case 2: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_APPLICATION.members["createdAt"] - ) - - case 3: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_APPLICATION.members["updatedAt"] - ) - - case 4: - kwargs["status"] = ApplicationStatus( - de.read_string(_SCHEMA_APPLICATION.members["status"]) - ) - - case 5: - kwargs["identity_type"] = IdentityType( - de.read_string(_SCHEMA_APPLICATION.members["identityType"]) - ) - - case 6: - kwargs["quick_sight_configuration"] = ( - QuickSightConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_APPLICATION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ConflictException(ServiceError): - """ - You are trying to perform an action that conflicts with the current - status of your resource. Fix any inconsistencies with your resources and - try again. - """ - - fault: Literal["client", "server"] | None = "client" - - resource_id: str - """The identifier of the resource affected.""" - - resource_type: str - """The type of the resource affected.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONFLICT_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CONFLICT_EXCEPTION.members["message"], self.message - ) - serializer.write_string( - _SCHEMA_CONFLICT_EXCEPTION.members["resourceId"], self.resource_id - ) - serializer.write_string( - _SCHEMA_CONFLICT_EXCEPTION.members["resourceType"], self.resource_type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_CONFLICT_EXCEPTION.members["message"] - ) - - case 1: - kwargs["resource_id"] = de.read_string( - _SCHEMA_CONFLICT_EXCEPTION.members["resourceId"] - ) - - case 2: - kwargs["resource_type"] = de.read_string( - _SCHEMA_CONFLICT_EXCEPTION.members["resourceType"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONFLICT_EXCEPTION, consumer=_consumer) - if "resource_id" not in kwargs: - kwargs["resource_id"] = "" - if "resource_type" not in kwargs: - kwargs["resource_type"] = "" - return kwargs - - -class AttachmentsControlMode(UnknownEnumMixin, StrEnum): - ENABLED = "ENABLED" - DISABLED = "DISABLED" - - -@dataclass(kw_only=True) -class AttachmentsConfiguration: - """Configuration information for the file upload during chat feature.""" - - attachments_control_mode: str - """ - Status information about whether file upload functionality is activated - or deactivated for your end user. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ATTACHMENTS_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_ATTACHMENTS_CONFIGURATION.members["attachmentsControlMode"], - self.attachments_control_mode, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["attachments_control_mode"] = AttachmentsControlMode( - de.read_string( - _SCHEMA_ATTACHMENTS_CONFIGURATION.members[ - "attachmentsControlMode" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ATTACHMENTS_CONFIGURATION, consumer=_consumer) - if "attachments_control_mode" not in kwargs: - kwargs["attachments_control_mode"] = AttachmentsControlMode._corrected("") - return kwargs - - -def _serialize_client_ids_for_oidc( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_client_ids_for_oidc( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class EncryptionConfiguration: - """ - Provides the identifier of the KMS key used to encrypt data indexed by - Amazon Q Business. Amazon Q Business doesn't support asymmetric keys. - """ - - kms_key_id: str | None = field(repr=False, default=None) - """ - The identifier of the KMS key. Amazon Q Business doesn't support - asymmetric keys. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ENCRYPTION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.kms_key_id is not None: - serializer.write_string( - _SCHEMA_ENCRYPTION_CONFIGURATION.members["kmsKeyId"], self.kms_key_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["kms_key_id"] = de.read_string( - _SCHEMA_ENCRYPTION_CONFIGURATION.members["kmsKeyId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ENCRYPTION_CONFIGURATION, consumer=_consumer) - return kwargs - - -class PersonalizationControlMode(UnknownEnumMixin, StrEnum): - ENABLED = "ENABLED" - DISABLED = "DISABLED" - - -@dataclass(kw_only=True) -class PersonalizationConfiguration: - """ - Configuration information about chat response personalization. For more - information, see [Personalizing chat - responses](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/personalizing-chat-responses.html). - """ - - personalization_control_mode: str - """ - An option to allow Amazon Q Business to customize chat responses using - user specific metadata---specifically, location and job information---in - your IAM Identity Center instance. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PERSONALIZATION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_PERSONALIZATION_CONFIGURATION.members["personalizationControlMode"], - self.personalization_control_mode, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["personalization_control_mode"] = PersonalizationControlMode( - de.read_string( - _SCHEMA_PERSONALIZATION_CONFIGURATION.members[ - "personalizationControlMode" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PERSONALIZATION_CONFIGURATION, consumer=_consumer - ) - if "personalization_control_mode" not in kwargs: - kwargs["personalization_control_mode"] = ( - PersonalizationControlMode._corrected("") - ) - return kwargs - - -class QAppsControlMode(UnknownEnumMixin, StrEnum): - ENABLED = "ENABLED" - DISABLED = "DISABLED" - - -@dataclass(kw_only=True) -class QAppsConfiguration: - """Configuration information about Amazon Q Apps.""" - - q_apps_control_mode: str - """ - Status information about whether end users can create and use Amazon Q - Apps in the web experience. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_Q_APPS_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_Q_APPS_CONFIGURATION.members["qAppsControlMode"], - self.q_apps_control_mode, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["q_apps_control_mode"] = QAppsControlMode( - de.read_string( - _SCHEMA_Q_APPS_CONFIGURATION.members["qAppsControlMode"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_Q_APPS_CONFIGURATION, consumer=_consumer) - if "q_apps_control_mode" not in kwargs: - kwargs["q_apps_control_mode"] = QAppsControlMode._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class Tag: - """ - A list of key/value pairs that identify an index, FAQ, or data source. - Tag keys and values can consist of Unicode letters, digits, white space, - and any of the following symbols: _ . : / = + - @. - """ - - key: str - """ - The key for the tag. Keys are not case sensitive and must be unique for - the Amazon Q Business application or data source. - """ - - value: str - """ - The value associated with the tag. The value may be an empty string but - it can't be null. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TAG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_TAG.members["key"], self.key) - serializer.write_string(_SCHEMA_TAG.members["value"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["key"] = de.read_string(_SCHEMA_TAG.members["key"]) - - case 1: - kwargs["value"] = de.read_string(_SCHEMA_TAG.members["value"]) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TAG, consumer=_consumer) - if "key" not in kwargs: - kwargs["key"] = "" - if "value" not in kwargs: - kwargs["value"] = "" - return kwargs - - -def _serialize_tags( - serializer: ShapeSerializer, schema: Schema, value: list[Tag] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_tags(deserializer: ShapeDeserializer, schema: Schema) -> list[Tag]: - result: list[Tag] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Tag.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CreateApplicationInput: - """Dataclass for CreateApplicationInput structure.""" - - display_name: str | None = None - """A name for the Amazon Q Business application.""" - - role_arn: str | None = None - """ - The Amazon Resource Name (ARN) of an IAM role with permissions to access - your Amazon CloudWatch logs and metrics. If this property is not - specified, Amazon Q Business will create a [service linked role - (SLR)](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/using-service-linked-roles.html#slr-permissions) - and use it as the application's role. - """ - - identity_type: str | None = None - """The authentication type being used by a Amazon Q Business application.""" - - iam_identity_provider_arn: str | None = None - """ - The Amazon Resource Name (ARN) of an identity provider being used by an - Amazon Q Business application. - """ - - identity_center_instance_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the IAM Identity Center instance you - are either creating for---or connecting to---your Amazon Q Business - application. - """ - - client_ids_for_oidc: list[str] | None = None - """The OIDC client ID for a Amazon Q Business application.""" - - description: str | None = None - """A description for the Amazon Q Business application.""" - - encryption_configuration: EncryptionConfiguration | None = None - """ - The identifier of the KMS key that is used to encrypt your data. Amazon - Q Business doesn't support asymmetric keys. - """ - - tags: list[Tag] | None = None - """ - A list of key-value pairs that identify or categorize your Amazon Q - Business application. You can also use tags to help control access to - the application. Tag keys and values can consist of Unicode letters, - digits, white space, and any of the following symbols: _ . : / = + - @. - """ - - client_token: str | None = None - """ - A token that you provide to identify the request to create your Amazon Q - Business application. - """ - - attachments_configuration: AttachmentsConfiguration | None = None - """An option to allow end users to upload files directly during chat.""" - - q_apps_configuration: QAppsConfiguration | None = None - """ - An option to allow end users to create and use Amazon Q Apps in the web - experience. - """ - - personalization_configuration: PersonalizationConfiguration | None = None - """ - Configuration information about chat response personalization. For more - information, see [Personalizing chat - responses](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/personalizing-chat-responses.html) - """ - - quick_sight_configuration: QuickSightConfiguration | None = None - """ - The Amazon Quick Suite configuration for an Amazon Q Business - application that uses Quick Suite for authentication. This configuration - is required if your application uses Quick Suite as the identity - provider. For more information, see [Creating an Amazon Quick Suite - integrated - application](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/create-quicksight-integrated-application.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_APPLICATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.display_name is not None: - serializer.write_string( - _SCHEMA_CREATE_APPLICATION_INPUT.members["displayName"], - self.display_name, - ) - - if self.role_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_APPLICATION_INPUT.members["roleArn"], self.role_arn - ) - - if self.identity_type is not None: - serializer.write_string( - _SCHEMA_CREATE_APPLICATION_INPUT.members["identityType"], - self.identity_type, - ) - - if self.iam_identity_provider_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_APPLICATION_INPUT.members["iamIdentityProviderArn"], - self.iam_identity_provider_arn, - ) - - if self.identity_center_instance_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_APPLICATION_INPUT.members["identityCenterInstanceArn"], - self.identity_center_instance_arn, - ) - - if self.client_ids_for_oidc is not None: - _serialize_client_ids_for_oidc( - serializer, - _SCHEMA_CREATE_APPLICATION_INPUT.members["clientIdsForOIDC"], - self.client_ids_for_oidc, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_APPLICATION_INPUT.members["description"], - self.description, - ) - - if self.encryption_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_APPLICATION_INPUT.members["encryptionConfiguration"], - self.encryption_configuration, - ) - - if self.tags is not None: - _serialize_tags( - serializer, _SCHEMA_CREATE_APPLICATION_INPUT.members["tags"], self.tags - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_APPLICATION_INPUT.members["clientToken"], - self.client_token, - ) - - if self.attachments_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_APPLICATION_INPUT.members["attachmentsConfiguration"], - self.attachments_configuration, - ) - - if self.q_apps_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_APPLICATION_INPUT.members["qAppsConfiguration"], - self.q_apps_configuration, - ) - - if self.personalization_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_APPLICATION_INPUT.members[ - "personalizationConfiguration" - ], - self.personalization_configuration, - ) - - if self.quick_sight_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_APPLICATION_INPUT.members["quickSightConfiguration"], - self.quick_sight_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["display_name"] = de.read_string( - _SCHEMA_CREATE_APPLICATION_INPUT.members["displayName"] - ) - - case 1: - kwargs["role_arn"] = de.read_string( - _SCHEMA_CREATE_APPLICATION_INPUT.members["roleArn"] - ) - - case 2: - kwargs["identity_type"] = IdentityType( - de.read_string( - _SCHEMA_CREATE_APPLICATION_INPUT.members["identityType"] - ) - ) - - case 3: - kwargs["iam_identity_provider_arn"] = de.read_string( - _SCHEMA_CREATE_APPLICATION_INPUT.members[ - "iamIdentityProviderArn" - ] - ) - - case 4: - kwargs["identity_center_instance_arn"] = de.read_string( - _SCHEMA_CREATE_APPLICATION_INPUT.members[ - "identityCenterInstanceArn" - ] - ) - - case 5: - kwargs["client_ids_for_oidc"] = _deserialize_client_ids_for_oidc( - de, _SCHEMA_CREATE_APPLICATION_INPUT.members["clientIdsForOIDC"] - ) - - case 6: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_APPLICATION_INPUT.members["description"] - ) - - case 7: - kwargs["encryption_configuration"] = ( - EncryptionConfiguration.deserialize(de) - ) - - case 8: - kwargs["tags"] = _deserialize_tags( - de, _SCHEMA_CREATE_APPLICATION_INPUT.members["tags"] - ) - - case 9: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_APPLICATION_INPUT.members["clientToken"] - ) - - case 10: - kwargs["attachments_configuration"] = ( - AttachmentsConfiguration.deserialize(de) - ) - - case 11: - kwargs["q_apps_configuration"] = QAppsConfiguration.deserialize(de) - - case 12: - kwargs["personalization_configuration"] = ( - PersonalizationConfiguration.deserialize(de) - ) - - case 13: - kwargs["quick_sight_configuration"] = ( - QuickSightConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_APPLICATION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CreateApplicationOutput: - """Dataclass for CreateApplicationOutput structure.""" - - application_id: str | None = None - """The identifier of the Amazon Q Business application.""" - - application_arn: str | None = None - """The Amazon Resource Name (ARN) of the Amazon Q Business application.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_APPLICATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_CREATE_APPLICATION_OUTPUT.members["applicationId"], - self.application_id, - ) - - if self.application_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_APPLICATION_OUTPUT.members["applicationArn"], - self.application_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_CREATE_APPLICATION_OUTPUT.members["applicationId"] - ) - - case 1: - kwargs["application_arn"] = de.read_string( - _SCHEMA_CREATE_APPLICATION_OUTPUT.members["applicationArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_APPLICATION_OUTPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class InternalServerException(ServiceError): - """ - An issue occurred with the internal server used for your Amazon Q - Business service. Wait some minutes and try again, or contact - [Support](http://aws.amazon.com/contact-us/) for help. - """ - - fault: Literal["client", "server"] | None = "server" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INTERNAL_SERVER_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_INTERNAL_SERVER_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INTERNAL_SERVER_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INTERNAL_SERVER_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ResourceNotFoundException(ServiceError): - """ - The application or plugin resource you want to use doesn't exist. Make - sure you have provided the correct resource and try again. - """ - - fault: Literal["client", "server"] | None = "client" - - resource_id: str - """The identifier of the resource affected.""" - - resource_type: str - """The type of the resource affected.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["message"], self.message - ) - serializer.write_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["resourceId"], self.resource_id - ) - serializer.write_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["resourceType"], - self.resource_type, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["message"] - ) - - case 1: - kwargs["resource_id"] = de.read_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["resourceId"] - ) - - case 2: - kwargs["resource_type"] = de.read_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["resourceType"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, consumer=_consumer - ) - if "resource_id" not in kwargs: - kwargs["resource_id"] = "" - if "resource_type" not in kwargs: - kwargs["resource_type"] = "" - return kwargs - - -@dataclass(kw_only=True) -class ServiceQuotaExceededException(ServiceError): - """You have exceeded the set limits for your Amazon Q Business service.""" - - fault: Literal["client", "server"] | None = "client" - - resource_id: str - """The identifier of the resource affected.""" - - resource_type: str - """The type of the resource affected.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION.members["message"], self.message - ) - serializer.write_string( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION.members["resourceId"], - self.resource_id, - ) - serializer.write_string( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION.members["resourceType"], - self.resource_type, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION.members["message"] - ) - - case 1: - kwargs["resource_id"] = de.read_string( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION.members["resourceId"] - ) - - case 2: - kwargs["resource_type"] = de.read_string( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION.members["resourceType"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, consumer=_consumer - ) - if "resource_id" not in kwargs: - kwargs["resource_id"] = "" - if "resource_type" not in kwargs: - kwargs["resource_type"] = "" - return kwargs - - -@dataclass(kw_only=True) -class ThrottlingException(ServiceError): - """ - The request was denied due to throttling. Reduce the number of requests - and try again. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_THROTTLING_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_THROTTLING_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_THROTTLING_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_THROTTLING_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ValidationExceptionField: - """ - The input failed to meet the constraints specified by Amazon Q Business - in a specified field. - """ - - name: str - """The field name where the invalid entry was detected.""" - - message: str - """A message about the validation exception.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VALIDATION_EXCEPTION_FIELD, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_VALIDATION_EXCEPTION_FIELD.members["name"], self.name - ) - serializer.write_string( - _SCHEMA_VALIDATION_EXCEPTION_FIELD.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_VALIDATION_EXCEPTION_FIELD.members["name"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_VALIDATION_EXCEPTION_FIELD.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VALIDATION_EXCEPTION_FIELD, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "message" not in kwargs: - kwargs["message"] = "" - return kwargs - - -def _serialize_validation_exception_fields( - serializer: ShapeSerializer, schema: Schema, value: list[ValidationExceptionField] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_validation_exception_fields( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ValidationExceptionField]: - result: list[ValidationExceptionField] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ValidationExceptionField.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class ValidationExceptionReason(UnknownEnumMixin, StrEnum): - CANNOT_PARSE = "CANNOT_PARSE" - FIELD_VALIDATION_FAILED = "FIELD_VALIDATION_FAILED" - UNKNOWN_OPERATION = "UNKNOWN_OPERATION" - - -@dataclass(kw_only=True) -class ValidationException(ServiceError): - """ - The input doesn't meet the constraints set by the Amazon Q Business - service. Provide the correct input and try again. - """ - - fault: Literal["client", "server"] | None = "client" - - reason: str - """The reason for the `ValidationException`.""" - - fields: list[ValidationExceptionField] | None = None - """The input field(s) that failed validation.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VALIDATION_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_VALIDATION_EXCEPTION.members["message"], self.message - ) - serializer.write_string( - _SCHEMA_VALIDATION_EXCEPTION.members["reason"], self.reason - ) - if self.fields is not None: - _serialize_validation_exception_fields( - serializer, _SCHEMA_VALIDATION_EXCEPTION.members["fields"], self.fields - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_VALIDATION_EXCEPTION.members["message"] - ) - - case 1: - kwargs["reason"] = ValidationExceptionReason( - de.read_string(_SCHEMA_VALIDATION_EXCEPTION.members["reason"]) - ) - - case 2: - kwargs["fields"] = _deserialize_validation_exception_fields( - de, _SCHEMA_VALIDATION_EXCEPTION.members["fields"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VALIDATION_EXCEPTION, consumer=_consumer) - if "reason" not in kwargs: - kwargs["reason"] = ValidationExceptionReason._corrected("") - return kwargs - - -CREATE_APPLICATION = APIOperation( - input=CreateApplicationInput, - output=CreateApplicationOutput, - schema=_SCHEMA_CREATE_APPLICATION, - input_schema=_SCHEMA_CREATE_APPLICATION_INPUT, - output_schema=_SCHEMA_CREATE_APPLICATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.qbusiness#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DataAccessorIdcTrustedTokenIssuerConfiguration: - """ - Configuration details for IAM Identity Center Trusted Token Issuer (TTI) - authentication. - """ - - idc_trusted_token_issuer_arn: str - """ - The Amazon Resource Name (ARN) of the IAM Identity Center Trusted Token - Issuer that will be used for authentication. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DATA_ACCESSOR_IDC_TRUSTED_TOKEN_ISSUER_CONFIGURATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DATA_ACCESSOR_IDC_TRUSTED_TOKEN_ISSUER_CONFIGURATION.members[ - "idcTrustedTokenIssuerArn" - ], - self.idc_trusted_token_issuer_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["idc_trusted_token_issuer_arn"] = de.read_string( - _SCHEMA_DATA_ACCESSOR_IDC_TRUSTED_TOKEN_ISSUER_CONFIGURATION.members[ - "idcTrustedTokenIssuerArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DATA_ACCESSOR_IDC_TRUSTED_TOKEN_ISSUER_CONFIGURATION, - consumer=_consumer, - ) - if "idc_trusted_token_issuer_arn" not in kwargs: - kwargs["idc_trusted_token_issuer_arn"] = "" - return kwargs - - -@dataclass -class DataAccessorAuthenticationConfigurationIdcTrustedTokenIssuerConfiguration: - """ - Configuration for IAM Identity Center Trusted Token Issuer (TTI) - authentication used when the authentication type is `AWS_IAM_IDC_TTI`. - """ - - value: DataAccessorIdcTrustedTokenIssuerConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DATA_ACCESSOR_AUTHENTICATION_CONFIGURATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DATA_ACCESSOR_AUTHENTICATION_CONFIGURATION.members[ - "idcTrustedTokenIssuerConfiguration" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=DataAccessorIdcTrustedTokenIssuerConfiguration.deserialize( - deserializer - ) - ) - - -@dataclass -class DataAccessorAuthenticationConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -DataAccessorAuthenticationConfiguration = Union[ - DataAccessorAuthenticationConfigurationIdcTrustedTokenIssuerConfiguration - | DataAccessorAuthenticationConfigurationUnknown -] -""" -A union type that contains the specific authentication configuration -based on the authentication type selected. -""" - - -class _DataAccessorAuthenticationConfigurationDeserializer: - _result: DataAccessorAuthenticationConfiguration | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> DataAccessorAuthenticationConfiguration: - self._result = None - deserializer.read_struct( - _SCHEMA_DATA_ACCESSOR_AUTHENTICATION_CONFIGURATION, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - DataAccessorAuthenticationConfigurationIdcTrustedTokenIssuerConfiguration.deserialize( - de - ) - ) - - case _: - self._set_result( - DataAccessorAuthenticationConfigurationUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: DataAccessorAuthenticationConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class DataAccessorAuthenticationType(UnknownEnumMixin, StrEnum): - """The type of authentication mechanism used by the data accessor.""" - - AWS_IAM_IDC_TTI = "AWS_IAM_IDC_TTI" - AWS_IAM_IDC_AUTH_CODE = "AWS_IAM_IDC_AUTH_CODE" - - -def _serialize_data_accessor_external_ids( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_data_accessor_external_ids( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class DataAccessorAuthenticationDetail: - """ - Contains the authentication configuration details for a data accessor. - This structure defines how the ISV authenticates when accessing data - through the data accessor. - """ - - authentication_type: str - """ - The type of authentication to use for the data accessor. This determines - how the ISV authenticates when accessing data. You can use one of two - authentication types: - - - `AWS_IAM_IDC_TTI` - Authentication using IAM Identity Center Trusted - Token Issuer (TTI). This authentication type allows the ISV to use a - trusted token issuer to generate tokens for accessing the data. - - - `AWS_IAM_IDC_AUTH_CODE` - Authentication using IAM Identity Center - authorization code flow. This authentication type uses the standard - OAuth 2.0 authorization code flow for authentication. - """ - - authentication_configuration: DataAccessorAuthenticationConfiguration | None = None - """ - The specific authentication configuration based on the authentication - type. - """ - - external_ids: list[str] | None = None - """ - A list of external identifiers associated with this authentication - configuration. These are used to correlate the data accessor with - external systems. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DATA_ACCESSOR_AUTHENTICATION_DETAIL, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DATA_ACCESSOR_AUTHENTICATION_DETAIL.members["authenticationType"], - self.authentication_type, - ) - if self.authentication_configuration is not None: - serializer.write_struct( - _SCHEMA_DATA_ACCESSOR_AUTHENTICATION_DETAIL.members[ - "authenticationConfiguration" - ], - self.authentication_configuration, - ) - - if self.external_ids is not None: - _serialize_data_accessor_external_ids( - serializer, - _SCHEMA_DATA_ACCESSOR_AUTHENTICATION_DETAIL.members["externalIds"], - self.external_ids, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["authentication_type"] = DataAccessorAuthenticationType( - de.read_string( - _SCHEMA_DATA_ACCESSOR_AUTHENTICATION_DETAIL.members[ - "authenticationType" - ] - ) - ) - - case 1: - kwargs["authentication_configuration"] = ( - _DataAccessorAuthenticationConfigurationDeserializer().deserialize( - de - ) - ) - - case 2: - kwargs["external_ids"] = _deserialize_data_accessor_external_ids( - de, - _SCHEMA_DATA_ACCESSOR_AUTHENTICATION_DETAIL.members[ - "externalIds" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DATA_ACCESSOR_AUTHENTICATION_DETAIL, consumer=_consumer - ) - if "authentication_type" not in kwargs: - kwargs["authentication_type"] = DataAccessorAuthenticationType._corrected( - "" - ) - return kwargs - - -@dataclass(kw_only=True) -class CreateDataAccessorOutput: - """Dataclass for CreateDataAccessorOutput structure.""" - - data_accessor_id: str - """The unique identifier of the created data accessor.""" - - idc_application_arn: str - """ - The Amazon Resource Name (ARN) of the IAM Identity Center application - created for this data accessor. - """ - - data_accessor_arn: str - """The Amazon Resource Name (ARN) of the created data accessor.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_DATA_ACCESSOR_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_DATA_ACCESSOR_OUTPUT.members["dataAccessorId"], - self.data_accessor_id, - ) - serializer.write_string( - _SCHEMA_CREATE_DATA_ACCESSOR_OUTPUT.members["idcApplicationArn"], - self.idc_application_arn, - ) - serializer.write_string( - _SCHEMA_CREATE_DATA_ACCESSOR_OUTPUT.members["dataAccessorArn"], - self.data_accessor_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["data_accessor_id"] = de.read_string( - _SCHEMA_CREATE_DATA_ACCESSOR_OUTPUT.members["dataAccessorId"] - ) - - case 1: - kwargs["idc_application_arn"] = de.read_string( - _SCHEMA_CREATE_DATA_ACCESSOR_OUTPUT.members["idcApplicationArn"] - ) - - case 2: - kwargs["data_accessor_arn"] = de.read_string( - _SCHEMA_CREATE_DATA_ACCESSOR_OUTPUT.members["dataAccessorArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_DATA_ACCESSOR_OUTPUT, consumer=_consumer - ) - if "data_accessor_id" not in kwargs: - kwargs["data_accessor_id"] = "" - if "idc_application_arn" not in kwargs: - kwargs["idc_application_arn"] = "" - if "data_accessor_arn" not in kwargs: - kwargs["data_accessor_arn"] = "" - return kwargs - - -@dataclass(kw_only=True) -class DeleteDataAccessorInput: - """Dataclass for DeleteDataAccessorInput structure.""" - - application_id: str | None = None - """The unique identifier of the Amazon Q Business application.""" - - data_accessor_id: str | None = None - """The unique identifier of the data accessor to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_DATA_ACCESSOR_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_DELETE_DATA_ACCESSOR_INPUT.members["applicationId"], - self.application_id, - ) - - if self.data_accessor_id is not None: - serializer.write_string( - _SCHEMA_DELETE_DATA_ACCESSOR_INPUT.members["dataAccessorId"], - self.data_accessor_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_DELETE_DATA_ACCESSOR_INPUT.members["applicationId"] - ) - - case 1: - kwargs["data_accessor_id"] = de.read_string( - _SCHEMA_DELETE_DATA_ACCESSOR_INPUT.members["dataAccessorId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_DATA_ACCESSOR_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteDataAccessorOutput: - """Dataclass for DeleteDataAccessorOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_DATA_ACCESSOR_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_DATA_ACCESSOR_OUTPUT, consumer=_consumer - ) - return kwargs - - -DELETE_DATA_ACCESSOR = APIOperation( - input=DeleteDataAccessorInput, - output=DeleteDataAccessorOutput, - schema=_SCHEMA_DELETE_DATA_ACCESSOR, - input_schema=_SCHEMA_DELETE_DATA_ACCESSOR_INPUT, - output_schema=_SCHEMA_DELETE_DATA_ACCESSOR_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetDataAccessorInput: - """Dataclass for GetDataAccessorInput structure.""" - - application_id: str | None = None - """The unique identifier of the Amazon Q Business application.""" - - data_accessor_id: str | None = None - """The unique identifier of the data accessor to retrieve.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DATA_ACCESSOR_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_GET_DATA_ACCESSOR_INPUT.members["applicationId"], - self.application_id, - ) - - if self.data_accessor_id is not None: - serializer.write_string( - _SCHEMA_GET_DATA_ACCESSOR_INPUT.members["dataAccessorId"], - self.data_accessor_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_GET_DATA_ACCESSOR_INPUT.members["applicationId"] - ) - - case 1: - kwargs["data_accessor_id"] = de.read_string( - _SCHEMA_GET_DATA_ACCESSOR_INPUT.members["dataAccessorId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_DATA_ACCESSOR_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ListDataAccessorsInput: - """Dataclass for ListDataAccessorsInput structure.""" - - application_id: str | None = None - """The unique identifier of the Amazon Q Business application.""" - - next_token: str | None = None - """ - The token for the next set of results. (You received this token from a - previous call.) - """ - - max_results: int | None = None - """The maximum number of results to return in a single call.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_DATA_ACCESSORS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_LIST_DATA_ACCESSORS_INPUT.members["applicationId"], - self.application_id, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_DATA_ACCESSORS_INPUT.members["nextToken"], self.next_token - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_DATA_ACCESSORS_INPUT.members["maxResults"], - self.max_results, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_LIST_DATA_ACCESSORS_INPUT.members["applicationId"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_DATA_ACCESSORS_INPUT.members["nextToken"] - ) - - case 2: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_DATA_ACCESSORS_INPUT.members["maxResults"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_DATA_ACCESSORS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DataAccessor: - """Provides summary information about a data accessor.""" - - display_name: str | None = field(repr=False, default=None) - """The friendly name of the data accessor.""" - - data_accessor_id: str | None = None - """The unique identifier of the data accessor.""" - - data_accessor_arn: str | None = None - """The Amazon Resource Name (ARN) of the data accessor.""" - - idc_application_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the associated IAM Identity Center - application. - """ - - principal: str | None = None - """ - The Amazon Resource Name (ARN) of the IAM role for the ISV associated - with this data accessor. - """ - - authentication_detail: DataAccessorAuthenticationDetail | None = None - """ - The authentication configuration details for the data accessor. This - specifies how the ISV authenticates when accessing data through this - data accessor. - """ - - created_at: datetime | None = None - """The timestamp when the data accessor was created.""" - - updated_at: datetime | None = None - """The timestamp when the data accessor was last updated.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DATA_ACCESSOR, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.display_name is not None: - serializer.write_string( - _SCHEMA_DATA_ACCESSOR.members["displayName"], self.display_name - ) - - if self.data_accessor_id is not None: - serializer.write_string( - _SCHEMA_DATA_ACCESSOR.members["dataAccessorId"], self.data_accessor_id - ) - - if self.data_accessor_arn is not None: - serializer.write_string( - _SCHEMA_DATA_ACCESSOR.members["dataAccessorArn"], self.data_accessor_arn - ) - - if self.idc_application_arn is not None: - serializer.write_string( - _SCHEMA_DATA_ACCESSOR.members["idcApplicationArn"], - self.idc_application_arn, - ) - - if self.principal is not None: - serializer.write_string( - _SCHEMA_DATA_ACCESSOR.members["principal"], self.principal - ) - - if self.authentication_detail is not None: - serializer.write_struct( - _SCHEMA_DATA_ACCESSOR.members["authenticationDetail"], - self.authentication_detail, - ) - - if self.created_at is not None: - serializer.write_timestamp( - _SCHEMA_DATA_ACCESSOR.members["createdAt"], self.created_at - ) - - if self.updated_at is not None: - serializer.write_timestamp( - _SCHEMA_DATA_ACCESSOR.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["display_name"] = de.read_string( - _SCHEMA_DATA_ACCESSOR.members["displayName"] - ) - - case 1: - kwargs["data_accessor_id"] = de.read_string( - _SCHEMA_DATA_ACCESSOR.members["dataAccessorId"] - ) - - case 2: - kwargs["data_accessor_arn"] = de.read_string( - _SCHEMA_DATA_ACCESSOR.members["dataAccessorArn"] - ) - - case 3: - kwargs["idc_application_arn"] = de.read_string( - _SCHEMA_DATA_ACCESSOR.members["idcApplicationArn"] - ) - - case 4: - kwargs["principal"] = de.read_string( - _SCHEMA_DATA_ACCESSOR.members["principal"] - ) - - case 5: - kwargs["authentication_detail"] = ( - DataAccessorAuthenticationDetail.deserialize(de) - ) - - case 6: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_DATA_ACCESSOR.members["createdAt"] - ) - - case 7: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_DATA_ACCESSOR.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DATA_ACCESSOR, consumer=_consumer) - return kwargs - - -def _serialize_data_accessors( - serializer: ShapeSerializer, schema: Schema, value: list[DataAccessor] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_data_accessors( - deserializer: ShapeDeserializer, schema: Schema -) -> list[DataAccessor]: - result: list[DataAccessor] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(DataAccessor.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListDataAccessorsOutput: - """Dataclass for ListDataAccessorsOutput structure.""" - - data_accessors: list[DataAccessor] | None = None - """The list of data accessors.""" - - next_token: str | None = None - """The token to use to retrieve the next set of results, if there are any.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_DATA_ACCESSORS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.data_accessors is not None: - _serialize_data_accessors( - serializer, - _SCHEMA_LIST_DATA_ACCESSORS_OUTPUT.members["dataAccessors"], - self.data_accessors, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_DATA_ACCESSORS_OUTPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["data_accessors"] = _deserialize_data_accessors( - de, _SCHEMA_LIST_DATA_ACCESSORS_OUTPUT.members["dataAccessors"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_DATA_ACCESSORS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_DATA_ACCESSORS_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_DATA_ACCESSORS = APIOperation( - input=ListDataAccessorsInput, - output=ListDataAccessorsOutput, - schema=_SCHEMA_LIST_DATA_ACCESSORS, - input_schema=_SCHEMA_LIST_DATA_ACCESSORS_INPUT, - output_schema=_SCHEMA_LIST_DATA_ACCESSORS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateDataAccessorOutput: - """Dataclass for UpdateDataAccessorOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_DATA_ACCESSOR_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_DATA_ACCESSOR_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteApplicationInput: - """Dataclass for DeleteApplicationInput structure.""" - - application_id: str | None = None - """The identifier of the Amazon Q Business application.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_APPLICATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_DELETE_APPLICATION_INPUT.members["applicationId"], - self.application_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_DELETE_APPLICATION_INPUT.members["applicationId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_APPLICATION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteApplicationOutput: - """Dataclass for DeleteApplicationOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_APPLICATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_APPLICATION_OUTPUT, consumer=_consumer) - return kwargs - - -DELETE_APPLICATION = APIOperation( - input=DeleteApplicationInput, - output=DeleteApplicationOutput, - schema=_SCHEMA_DELETE_APPLICATION, - input_schema=_SCHEMA_DELETE_APPLICATION_INPUT, - output_schema=_SCHEMA_DELETE_APPLICATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetApplicationInput: - """Dataclass for GetApplicationInput structure.""" - - application_id: str | None = None - """The identifier of the Amazon Q Business application.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_APPLICATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_GET_APPLICATION_INPUT.members["applicationId"], - self.application_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_GET_APPLICATION_INPUT.members["applicationId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_APPLICATION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class AppliedAttachmentsConfiguration: - """ - Configuration information about the file upload during chat feature for - your application. - """ - - attachments_control_mode: str | None = None - """ - Information about whether file upload during chat functionality is - activated for your application. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_APPLIED_ATTACHMENTS_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.attachments_control_mode is not None: - serializer.write_string( - _SCHEMA_APPLIED_ATTACHMENTS_CONFIGURATION.members[ - "attachmentsControlMode" - ], - self.attachments_control_mode, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["attachments_control_mode"] = AttachmentsControlMode( - de.read_string( - _SCHEMA_APPLIED_ATTACHMENTS_CONFIGURATION.members[ - "attachmentsControlMode" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_APPLIED_ATTACHMENTS_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -class AutoSubscriptionStatus(UnknownEnumMixin, StrEnum): - ENABLED = "ENABLED" - DISABLED = "DISABLED" - - -class SubscriptionType(UnknownEnumMixin, StrEnum): - Q_LITE = "Q_LITE" - Q_BUSINESS = "Q_BUSINESS" - - -@dataclass(kw_only=True) -class AutoSubscriptionConfiguration: - """ - Subscription configuration information for an Amazon Q Business - application using IAM identity federation for user management. - """ - - auto_subscribe: str - """ - Describes whether automatic subscriptions are enabled for an Amazon Q - Business application using IAM identity federation for user management. - """ - - default_subscription_type: str | None = None - """ - Describes the default subscription type assigned to an Amazon Q Business - application using IAM identity federation for user management. If the - value for `autoSubscribe` is set to `ENABLED` you must select a value - for this field. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTO_SUBSCRIPTION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AUTO_SUBSCRIPTION_CONFIGURATION.members["autoSubscribe"], - self.auto_subscribe, - ) - if self.default_subscription_type is not None: - serializer.write_string( - _SCHEMA_AUTO_SUBSCRIPTION_CONFIGURATION.members[ - "defaultSubscriptionType" - ], - self.default_subscription_type, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["auto_subscribe"] = AutoSubscriptionStatus( - de.read_string( - _SCHEMA_AUTO_SUBSCRIPTION_CONFIGURATION.members[ - "autoSubscribe" - ] - ) - ) - - case 1: - kwargs["default_subscription_type"] = SubscriptionType( - de.read_string( - _SCHEMA_AUTO_SUBSCRIPTION_CONFIGURATION.members[ - "defaultSubscriptionType" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTO_SUBSCRIPTION_CONFIGURATION, consumer=_consumer - ) - if "auto_subscribe" not in kwargs: - kwargs["auto_subscribe"] = AutoSubscriptionStatus._corrected("") - return kwargs - - -class ErrorCode(UnknownEnumMixin, StrEnum): - INTERNAL_ERROR = "InternalError" - INVALID_REQUEST = "InvalidRequest" - RESOURCE_INACTIVE = "ResourceInactive" - RESOURCE_NOT_FOUND = "ResourceNotFound" - - -@dataclass(kw_only=True) -class ErrorDetail: - """Provides information about a Amazon Q Business request error.""" - - error_message: str | None = None - """The message explaining the Amazon Q Business request error.""" - - error_code: str | None = None - """The code associated with the Amazon Q Business request error.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ERROR_DETAIL, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.error_message is not None: - serializer.write_string( - _SCHEMA_ERROR_DETAIL.members["errorMessage"], self.error_message - ) - - if self.error_code is not None: - serializer.write_string( - _SCHEMA_ERROR_DETAIL.members["errorCode"], self.error_code - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["error_message"] = de.read_string( - _SCHEMA_ERROR_DETAIL.members["errorMessage"] - ) - - case 1: - kwargs["error_code"] = ErrorCode( - de.read_string(_SCHEMA_ERROR_DETAIL.members["errorCode"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ERROR_DETAIL, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetApplicationOutput: - """Dataclass for GetApplicationOutput structure.""" - - display_name: str | None = None - """The name of the Amazon Q Business application.""" - - application_id: str | None = None - """The identifier of the Amazon Q Business application.""" - - application_arn: str | None = None - """The Amazon Resource Name (ARN) of the Amazon Q Business application.""" - - identity_type: str | None = None - """The authentication type being used by a Amazon Q Business application.""" - - iam_identity_provider_arn: str | None = None - """ - The Amazon Resource Name (ARN) of an identity provider being used by an - Amazon Q Business application. - """ - - identity_center_application_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the AWS IAM Identity Center instance - attached to your Amazon Q Business application. - """ - - role_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the IAM with permissions to access - your CloudWatch logs and metrics. - """ - - status: str | None = None - """The status of the Amazon Q Business application.""" - - description: str | None = None - """A description for the Amazon Q Business application.""" - - encryption_configuration: EncryptionConfiguration | None = None - """ - The identifier of the Amazon Web Services KMS key that is used to - encrypt your data. Amazon Q Business doesn't support asymmetric keys. - """ - - created_at: datetime | None = None - """ - The Unix timestamp when the Amazon Q Business application was last - updated. - """ - - updated_at: datetime | None = None - """ - The Unix timestamp when the Amazon Q Business application was last - updated. - """ - - error: ErrorDetail | None = None - """ - If the `Status` field is set to `ERROR`, the `ErrorMessage` field - contains a description of the error that caused the synchronization to - fail. - """ - - attachments_configuration: AppliedAttachmentsConfiguration | None = None - """Settings for whether end users can upload files directly during chat.""" - - q_apps_configuration: QAppsConfiguration | None = None - """ - Settings for whether end users can create and use Amazon Q Apps in the - web experience. - """ - - personalization_configuration: PersonalizationConfiguration | None = None - """ - Configuration information about chat response personalization. For more - information, see [Personalizing chat - responses](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/personalizing-chat-responses.html). - """ - - auto_subscription_configuration: AutoSubscriptionConfiguration | None = None - """ - Settings for auto-subscription behavior for this application. This is - only applicable to SAML and OIDC applications. - """ - - client_ids_for_oidc: list[str] | None = None - """The OIDC client ID for a Amazon Q Business application.""" - - quick_sight_configuration: QuickSightConfiguration | None = None - """ - The Amazon Quick Suite authentication configuration for the Amazon Q - Business application. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_APPLICATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.display_name is not None: - serializer.write_string( - _SCHEMA_GET_APPLICATION_OUTPUT.members["displayName"], self.display_name - ) - - if self.application_id is not None: - serializer.write_string( - _SCHEMA_GET_APPLICATION_OUTPUT.members["applicationId"], - self.application_id, - ) - - if self.application_arn is not None: - serializer.write_string( - _SCHEMA_GET_APPLICATION_OUTPUT.members["applicationArn"], - self.application_arn, - ) - - if self.identity_type is not None: - serializer.write_string( - _SCHEMA_GET_APPLICATION_OUTPUT.members["identityType"], - self.identity_type, - ) - - if self.iam_identity_provider_arn is not None: - serializer.write_string( - _SCHEMA_GET_APPLICATION_OUTPUT.members["iamIdentityProviderArn"], - self.iam_identity_provider_arn, - ) - - if self.identity_center_application_arn is not None: - serializer.write_string( - _SCHEMA_GET_APPLICATION_OUTPUT.members["identityCenterApplicationArn"], - self.identity_center_application_arn, - ) - - if self.role_arn is not None: - serializer.write_string( - _SCHEMA_GET_APPLICATION_OUTPUT.members["roleArn"], self.role_arn - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_GET_APPLICATION_OUTPUT.members["status"], self.status - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_APPLICATION_OUTPUT.members["description"], self.description - ) - - if self.encryption_configuration is not None: - serializer.write_struct( - _SCHEMA_GET_APPLICATION_OUTPUT.members["encryptionConfiguration"], - self.encryption_configuration, - ) - - if self.created_at is not None: - serializer.write_timestamp( - _SCHEMA_GET_APPLICATION_OUTPUT.members["createdAt"], self.created_at - ) - - if self.updated_at is not None: - serializer.write_timestamp( - _SCHEMA_GET_APPLICATION_OUTPUT.members["updatedAt"], self.updated_at - ) - - if self.error is not None: - serializer.write_struct( - _SCHEMA_GET_APPLICATION_OUTPUT.members["error"], self.error - ) - - if self.attachments_configuration is not None: - serializer.write_struct( - _SCHEMA_GET_APPLICATION_OUTPUT.members["attachmentsConfiguration"], - self.attachments_configuration, - ) - - if self.q_apps_configuration is not None: - serializer.write_struct( - _SCHEMA_GET_APPLICATION_OUTPUT.members["qAppsConfiguration"], - self.q_apps_configuration, - ) - - if self.personalization_configuration is not None: - serializer.write_struct( - _SCHEMA_GET_APPLICATION_OUTPUT.members["personalizationConfiguration"], - self.personalization_configuration, - ) - - if self.auto_subscription_configuration is not None: - serializer.write_struct( - _SCHEMA_GET_APPLICATION_OUTPUT.members["autoSubscriptionConfiguration"], - self.auto_subscription_configuration, - ) - - if self.client_ids_for_oidc is not None: - _serialize_client_ids_for_oidc( - serializer, - _SCHEMA_GET_APPLICATION_OUTPUT.members["clientIdsForOIDC"], - self.client_ids_for_oidc, - ) - - if self.quick_sight_configuration is not None: - serializer.write_struct( - _SCHEMA_GET_APPLICATION_OUTPUT.members["quickSightConfiguration"], - self.quick_sight_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["display_name"] = de.read_string( - _SCHEMA_GET_APPLICATION_OUTPUT.members["displayName"] - ) - - case 1: - kwargs["application_id"] = de.read_string( - _SCHEMA_GET_APPLICATION_OUTPUT.members["applicationId"] - ) - - case 2: - kwargs["application_arn"] = de.read_string( - _SCHEMA_GET_APPLICATION_OUTPUT.members["applicationArn"] - ) - - case 3: - kwargs["identity_type"] = IdentityType( - de.read_string( - _SCHEMA_GET_APPLICATION_OUTPUT.members["identityType"] - ) - ) - - case 4: - kwargs["iam_identity_provider_arn"] = de.read_string( - _SCHEMA_GET_APPLICATION_OUTPUT.members["iamIdentityProviderArn"] - ) - - case 5: - kwargs["identity_center_application_arn"] = de.read_string( - _SCHEMA_GET_APPLICATION_OUTPUT.members[ - "identityCenterApplicationArn" - ] - ) - - case 6: - kwargs["role_arn"] = de.read_string( - _SCHEMA_GET_APPLICATION_OUTPUT.members["roleArn"] - ) - - case 7: - kwargs["status"] = ApplicationStatus( - de.read_string(_SCHEMA_GET_APPLICATION_OUTPUT.members["status"]) - ) - - case 8: - kwargs["description"] = de.read_string( - _SCHEMA_GET_APPLICATION_OUTPUT.members["description"] - ) - - case 9: - kwargs["encryption_configuration"] = ( - EncryptionConfiguration.deserialize(de) - ) - - case 10: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_APPLICATION_OUTPUT.members["createdAt"] - ) - - case 11: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_GET_APPLICATION_OUTPUT.members["updatedAt"] - ) - - case 12: - kwargs["error"] = ErrorDetail.deserialize(de) - - case 13: - kwargs["attachments_configuration"] = ( - AppliedAttachmentsConfiguration.deserialize(de) - ) - - case 14: - kwargs["q_apps_configuration"] = QAppsConfiguration.deserialize(de) - - case 15: - kwargs["personalization_configuration"] = ( - PersonalizationConfiguration.deserialize(de) - ) - - case 16: - kwargs["auto_subscription_configuration"] = ( - AutoSubscriptionConfiguration.deserialize(de) - ) - - case 17: - kwargs["client_ids_for_oidc"] = _deserialize_client_ids_for_oidc( - de, _SCHEMA_GET_APPLICATION_OUTPUT.members["clientIdsForOIDC"] - ) - - case 18: - kwargs["quick_sight_configuration"] = ( - QuickSightConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_APPLICATION_OUTPUT, consumer=_consumer) - return kwargs - - -GET_APPLICATION = APIOperation( - input=GetApplicationInput, - output=GetApplicationOutput, - schema=_SCHEMA_GET_APPLICATION, - input_schema=_SCHEMA_GET_APPLICATION_INPUT, - output_schema=_SCHEMA_GET_APPLICATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class IndexCapacityConfiguration: - """Provides information about index capacity configuration.""" - - units: int | None = None - """The number of storage units configured for an Amazon Q Business index.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INDEX_CAPACITY_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.units is not None: - serializer.write_integer( - _SCHEMA_INDEX_CAPACITY_CONFIGURATION.members["units"], self.units - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["units"] = de.read_integer( - _SCHEMA_INDEX_CAPACITY_CONFIGURATION.members["units"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INDEX_CAPACITY_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -class IndexType(UnknownEnumMixin, StrEnum): - ENTERPRISE = "ENTERPRISE" - STARTER = "STARTER" - - -@dataclass(kw_only=True) -class CreateIndexInput: - """Dataclass for CreateIndexInput structure.""" - - application_id: str | None = None - """The identifier of the Amazon Q Business application using the index.""" - - display_name: str | None = None - """A name for the Amazon Q Business index.""" - - description: str | None = None - """A description for the Amazon Q Business index.""" - - type: str | None = None - """ - The index type that's suitable for your needs. For more information on - what's included in each type of index, see [Amazon Q Business - tiers](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/tiers.html#index-tiers). - """ - - tags: list[Tag] | None = None - """ - A list of key-value pairs that identify or categorize the index. You can - also use tags to help control access to the index. Tag keys and values - can consist of Unicode letters, digits, white space, and any of the - following symbols: _ . : / = + - @. - """ - - capacity_configuration: IndexCapacityConfiguration | None = None - """ - The capacity units you want to provision for your index. You can add and - remove capacity to fit your usage needs. - """ - - client_token: str | None = None - """ - A token that you provide to identify the request to create an index. - Multiple calls to the `CreateIndex` API with the same client token will - create only one index. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_INDEX_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_CREATE_INDEX_INPUT.members["applicationId"], self.application_id - ) - - if self.display_name is not None: - serializer.write_string( - _SCHEMA_CREATE_INDEX_INPUT.members["displayName"], self.display_name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_INDEX_INPUT.members["description"], self.description - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_CREATE_INDEX_INPUT.members["type"], self.type - ) - - if self.tags is not None: - _serialize_tags( - serializer, _SCHEMA_CREATE_INDEX_INPUT.members["tags"], self.tags - ) - - if self.capacity_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_INDEX_INPUT.members["capacityConfiguration"], - self.capacity_configuration, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_INDEX_INPUT.members["clientToken"], self.client_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_CREATE_INDEX_INPUT.members["applicationId"] - ) - - case 1: - kwargs["display_name"] = de.read_string( - _SCHEMA_CREATE_INDEX_INPUT.members["displayName"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_INDEX_INPUT.members["description"] - ) - - case 3: - kwargs["type"] = IndexType( - de.read_string(_SCHEMA_CREATE_INDEX_INPUT.members["type"]) - ) - - case 4: - kwargs["tags"] = _deserialize_tags( - de, _SCHEMA_CREATE_INDEX_INPUT.members["tags"] - ) - - case 5: - kwargs["capacity_configuration"] = ( - IndexCapacityConfiguration.deserialize(de) - ) - - case 6: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_INDEX_INPUT.members["clientToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_INDEX_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CreateIndexOutput: - """Dataclass for CreateIndexOutput structure.""" - - index_id: str | None = None - """The identifier for the Amazon Q Business index.""" - - index_arn: str | None = None - """The Amazon Resource Name (ARN) of an Amazon Q Business index.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_INDEX_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.index_id is not None: - serializer.write_string( - _SCHEMA_CREATE_INDEX_OUTPUT.members["indexId"], self.index_id - ) - - if self.index_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_INDEX_OUTPUT.members["indexArn"], self.index_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["index_id"] = de.read_string( - _SCHEMA_CREATE_INDEX_OUTPUT.members["indexId"] - ) - - case 1: - kwargs["index_arn"] = de.read_string( - _SCHEMA_CREATE_INDEX_OUTPUT.members["indexArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_INDEX_OUTPUT, consumer=_consumer) - return kwargs - - -CREATE_INDEX = APIOperation( - input=CreateIndexInput, - output=CreateIndexOutput, - schema=_SCHEMA_CREATE_INDEX, - input_schema=_SCHEMA_CREATE_INDEX_INPUT, - output_schema=_SCHEMA_CREATE_INDEX_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.qbusiness#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class DocumentEnrichmentConditionOperator(UnknownEnumMixin, StrEnum): - GREATER_THAN = "GREATER_THAN" - GREATER_THAN_OR_EQUALS = "GREATER_THAN_OR_EQUALS" - LESS_THAN = "LESS_THAN" - LESS_THAN_OR_EQUALS = "LESS_THAN_OR_EQUALS" - EQUALS = "EQUALS" - NOT_EQUALS = "NOT_EQUALS" - CONTAINS = "CONTAINS" - NOT_CONTAINS = "NOT_CONTAINS" - EXISTS = "EXISTS" - NOT_EXISTS = "NOT_EXISTS" - BEGINS_WITH = "BEGINS_WITH" - - -@dataclass(kw_only=True) -class DocumentAttributeCondition: - """ - The condition used for the target document attribute or metadata field - when ingesting documents into Amazon Q Business. You use this with - [`DocumentAttributeTarget`](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_DocumentAttributeTarget.html) - to apply the condition. - - For example, you can create the 'Department' target field and have it - prefill department names associated with the documents based on - information in the 'Source_URI' field. Set the condition that if the - 'Source_URI' field contains 'financial' in its URI value, then - prefill the target field 'Department' with the target value - 'Finance' for the document. - - Amazon Q Business can't create a target field if it has not already - been created as an index field. After you create your index field, you - can create a document metadata field using `DocumentAttributeTarget`. - Amazon Q Business then will map your newly created metadata field to - your index field. - """ - - key: str - """ - The identifier of the document attribute used for the condition. - - For example, 'Source_URI' could be an identifier for the attribute or - metadata field that contains source URIs associated with the documents. - - Amazon Q Business currently doesn't support `_document_body` as an - attribute key used for the condition. - """ - - operator: str - """ - The identifier of the document attribute used for the condition. - - For example, 'Source_URI' could be an identifier for the attribute or - metadata field that contains source URIs associated with the documents. - - Amazon Q Business currently does not support `_document_body` as an - attribute key used for the condition. - """ - - value: DocumentAttributeValue | None = None - """ - The value of a document attribute. You can only provide one value for a - document attribute. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_ATTRIBUTE_CONDITION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DOCUMENT_ATTRIBUTE_CONDITION.members["key"], self.key - ) - serializer.write_string( - _SCHEMA_DOCUMENT_ATTRIBUTE_CONDITION.members["operator"], self.operator - ) - if self.value is not None: - serializer.write_struct( - _SCHEMA_DOCUMENT_ATTRIBUTE_CONDITION.members["value"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["key"] = de.read_string( - _SCHEMA_DOCUMENT_ATTRIBUTE_CONDITION.members["key"] - ) - - case 1: - kwargs["operator"] = DocumentEnrichmentConditionOperator( - de.read_string( - _SCHEMA_DOCUMENT_ATTRIBUTE_CONDITION.members["operator"] - ) - ) - - case 2: - kwargs["value"] = _DocumentAttributeValueDeserializer().deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DOCUMENT_ATTRIBUTE_CONDITION, consumer=_consumer - ) - if "key" not in kwargs: - kwargs["key"] = "" - if "operator" not in kwargs: - kwargs["operator"] = DocumentEnrichmentConditionOperator._corrected("") - return kwargs - - -class DocumentContentOperator(UnknownEnumMixin, StrEnum): - DELETE = "DELETE" - - -class AttributeValueOperator(UnknownEnumMixin, StrEnum): - DELETE = "DELETE" - - -@dataclass(kw_only=True) -class DocumentAttributeTarget: - """ - The target document attribute or metadata field you want to alter when - ingesting documents into Amazon Q Business. - - For example, you can delete all customer identification numbers - associated with the documents, stored in the document metadata field - called 'Customer_ID' by setting the target key as 'Customer_ID' and - the deletion flag to `TRUE`. This removes all customer ID values in the - field 'Customer_ID'. This would scrub personally identifiable - information from each document's metadata. - - Amazon Q Business can't create a target field if it has not already - been created as an index field. After you create your index field, you - can create a document metadata field using - [`DocumentAttributeTarget`](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_DocumentAttributeTarget.html) - . Amazon Q Business will then map your newly created document attribute - to your index field. - - You can also use this with - [`DocumentAttributeCondition`](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_DocumentAttributeCondition.html) - . - """ - - key: str - """ - The identifier of the target document attribute or metadata field. For - example, 'Department' could be an identifier for the target attribute - or metadata field that includes the department names associated with the - documents. - """ - - value: DocumentAttributeValue | None = None - """ - The value of a document attribute. You can only provide one value for a - document attribute. - """ - - attribute_value_operator: str | None = None - """ - `TRUE` to delete the existing target value for your specified target - attribute key. You cannot create a target value and set this to `TRUE`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_ATTRIBUTE_TARGET, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DOCUMENT_ATTRIBUTE_TARGET.members["key"], self.key - ) - if self.value is not None: - serializer.write_struct( - _SCHEMA_DOCUMENT_ATTRIBUTE_TARGET.members["value"], self.value - ) - - if self.attribute_value_operator is not None: - serializer.write_string( - _SCHEMA_DOCUMENT_ATTRIBUTE_TARGET.members["attributeValueOperator"], - self.attribute_value_operator, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["key"] = de.read_string( - _SCHEMA_DOCUMENT_ATTRIBUTE_TARGET.members["key"] - ) - - case 1: - kwargs["value"] = _DocumentAttributeValueDeserializer().deserialize( - de - ) - - case 2: - kwargs["attribute_value_operator"] = AttributeValueOperator( - de.read_string( - _SCHEMA_DOCUMENT_ATTRIBUTE_TARGET.members[ - "attributeValueOperator" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DOCUMENT_ATTRIBUTE_TARGET, consumer=_consumer) - if "key" not in kwargs: - kwargs["key"] = "" - return kwargs - - -@dataclass(kw_only=True) -class InlineDocumentEnrichmentConfiguration: - """ - Provides the configuration information for applying basic logic to alter - document metadata and content when ingesting documents into Amazon Q - Business. - - To apply advanced logic, to go beyond what you can do with basic logic, - see - [`HookConfiguration`](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_HookConfiguration.html) - . - - For more information, see [Custom document - enrichment](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/custom-document-enrichment.html). - """ - - condition: DocumentAttributeCondition | None = None - """ - The condition used for the target document attribute or metadata field - when ingesting documents into Amazon Q Business. You use this with - [`DocumentAttributeTarget`](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_DocumentAttributeTarget.html) - to apply the condition. - - For example, you can create the 'Department' target field and have it - prefill department names associated with the documents based on - information in the 'Source_URI' field. Set the condition that if the - 'Source_URI' field contains 'financial' in its URI value, then - prefill the target field 'Department' with the target value - 'Finance' for the document. - - Amazon Q Business can't create a target field if it has not already - been created as an index field. After you create your index field, you - can create a document metadata field using `DocumentAttributeTarget`. - Amazon Q Business then will map your newly created metadata field to - your index field. - """ - - target: DocumentAttributeTarget | None = None - """ - The target document attribute or metadata field you want to alter when - ingesting documents into Amazon Q Business. - - For example, you can delete all customer identification numbers - associated with the documents, stored in the document metadata field - called 'Customer_ID' by setting the target key as 'Customer_ID' and - the deletion flag to `TRUE`. This removes all customer ID values in the - field 'Customer_ID'. This would scrub personally identifiable - information from each document's metadata. - - Amazon Q Business can't create a target field if it has not already - been created as an index field. After you create your index field, you - can create a document metadata field using - [`DocumentAttributeTarget`](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_DocumentAttributeTarget.html) - . Amazon Q Business will then map your newly created document attribute - to your index field. - - You can also use this with - [`DocumentAttributeCondition`](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_DocumentAttributeCondition.html) - . - """ - - document_content_operator: str | None = None - """ - `TRUE` to delete content if the condition used for the target attribute - is met. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INLINE_DOCUMENT_ENRICHMENT_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.condition is not None: - serializer.write_struct( - _SCHEMA_INLINE_DOCUMENT_ENRICHMENT_CONFIGURATION.members["condition"], - self.condition, - ) - - if self.target is not None: - serializer.write_struct( - _SCHEMA_INLINE_DOCUMENT_ENRICHMENT_CONFIGURATION.members["target"], - self.target, - ) - - if self.document_content_operator is not None: - serializer.write_string( - _SCHEMA_INLINE_DOCUMENT_ENRICHMENT_CONFIGURATION.members[ - "documentContentOperator" - ], - self.document_content_operator, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["condition"] = DocumentAttributeCondition.deserialize(de) - - case 1: - kwargs["target"] = DocumentAttributeTarget.deserialize(de) - - case 2: - kwargs["document_content_operator"] = DocumentContentOperator( - de.read_string( - _SCHEMA_INLINE_DOCUMENT_ENRICHMENT_CONFIGURATION.members[ - "documentContentOperator" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INLINE_DOCUMENT_ENRICHMENT_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -def _serialize_inline_document_enrichment_configurations( - serializer: ShapeSerializer, - schema: Schema, - value: list[InlineDocumentEnrichmentConfiguration], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_inline_document_enrichment_configurations( - deserializer: ShapeDeserializer, schema: Schema -) -> list[InlineDocumentEnrichmentConfiguration]: - result: list[InlineDocumentEnrichmentConfiguration] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(InlineDocumentEnrichmentConfiguration.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class HookConfiguration: - """ - Provides the configuration information for invoking a Lambda function in - Lambda to alter document metadata and content when ingesting documents - into Amazon Q Business. - - You can configure your Lambda function using the - `PreExtractionHookConfiguration` parameter if you want to apply advanced - alterations on the original or raw documents. - - If you want to apply advanced alterations on the Amazon Q Business - structured documents, you must configure your Lambda function using - `PostExtractionHookConfiguration`. - - You can only invoke one Lambda function. However, this function can - invoke other functions it requires. - - For more information, see [Custom document - enrichment](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/custom-document-enrichment.html). - """ - - invocation_condition: DocumentAttributeCondition | None = None - """ - The condition used for when a Lambda function should be invoked. - - For example, you can specify a condition that if there are empty - date-time values, then Amazon Q Business should invoke a function that - inserts the current date-time. - """ - - lambda_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the Lambda function during ingestion. - For more information, see [Using Lambda functions for Amazon Q Business - document - enrichment](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/cde-lambda-operations.html). - """ - - s3_bucket_name: str | None = None - """ - Stores the original, raw documents or the structured, parsed documents - before and after altering them. For more information, see [Data - contracts for Lambda - functions](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/cde-lambda-operations.html#cde-lambda-operations-data-contracts). - """ - - role_arn: str | None = None - """ - The Amazon Resource Name (ARN) of a role with permission to run - `PreExtractionHookConfiguration` and `PostExtractionHookConfiguration` - for altering document metadata and content during the document ingestion - process. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HOOK_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.invocation_condition is not None: - serializer.write_struct( - _SCHEMA_HOOK_CONFIGURATION.members["invocationCondition"], - self.invocation_condition, - ) - - if self.lambda_arn is not None: - serializer.write_string( - _SCHEMA_HOOK_CONFIGURATION.members["lambdaArn"], self.lambda_arn - ) - - if self.s3_bucket_name is not None: - serializer.write_string( - _SCHEMA_HOOK_CONFIGURATION.members["s3BucketName"], self.s3_bucket_name - ) - - if self.role_arn is not None: - serializer.write_string( - _SCHEMA_HOOK_CONFIGURATION.members["roleArn"], self.role_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["invocation_condition"] = ( - DocumentAttributeCondition.deserialize(de) - ) - - case 1: - kwargs["lambda_arn"] = de.read_string( - _SCHEMA_HOOK_CONFIGURATION.members["lambdaArn"] - ) - - case 2: - kwargs["s3_bucket_name"] = de.read_string( - _SCHEMA_HOOK_CONFIGURATION.members["s3BucketName"] - ) - - case 3: - kwargs["role_arn"] = de.read_string( - _SCHEMA_HOOK_CONFIGURATION.members["roleArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_HOOK_CONFIGURATION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DocumentEnrichmentConfiguration: - """ - Provides the configuration information for altering document metadata - and content during the document ingestion process. - - For more information, see [Custom document - enrichment](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/custom-document-enrichment.html). - """ - - inline_configurations: list[InlineDocumentEnrichmentConfiguration] | None = None - """ - Configuration information to alter document attributes or metadata - fields and content when ingesting documents into Amazon Q Business. - """ - - pre_extraction_hook_configuration: HookConfiguration | None = None - """ - Provides the configuration information for invoking a Lambda function in - Lambda to alter document metadata and content when ingesting documents - into Amazon Q Business. - - You can configure your Lambda function using the - `PreExtractionHookConfiguration` parameter if you want to apply advanced - alterations on the original or raw documents. - - If you want to apply advanced alterations on the Amazon Q Business - structured documents, you must configure your Lambda function using - `PostExtractionHookConfiguration`. - - You can only invoke one Lambda function. However, this function can - invoke other functions it requires. - - For more information, see [Custom document - enrichment](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/custom-document-enrichment.html). - """ - - post_extraction_hook_configuration: HookConfiguration | None = None - """ - Provides the configuration information for invoking a Lambda function in - Lambda to alter document metadata and content when ingesting documents - into Amazon Q Business. - - You can configure your Lambda function using the - `PreExtractionHookConfiguration` parameter if you want to apply advanced - alterations on the original or raw documents. - - If you want to apply advanced alterations on the Amazon Q Business - structured documents, you must configure your Lambda function using - `PostExtractionHookConfiguration`. - - You can only invoke one Lambda function. However, this function can - invoke other functions it requires. - - For more information, see [Custom document - enrichment](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/custom-document-enrichment.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_ENRICHMENT_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.inline_configurations is not None: - _serialize_inline_document_enrichment_configurations( - serializer, - _SCHEMA_DOCUMENT_ENRICHMENT_CONFIGURATION.members[ - "inlineConfigurations" - ], - self.inline_configurations, - ) - - if self.pre_extraction_hook_configuration is not None: - serializer.write_struct( - _SCHEMA_DOCUMENT_ENRICHMENT_CONFIGURATION.members[ - "preExtractionHookConfiguration" - ], - self.pre_extraction_hook_configuration, - ) - - if self.post_extraction_hook_configuration is not None: - serializer.write_struct( - _SCHEMA_DOCUMENT_ENRICHMENT_CONFIGURATION.members[ - "postExtractionHookConfiguration" - ], - self.post_extraction_hook_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["inline_configurations"] = ( - _deserialize_inline_document_enrichment_configurations( - de, - _SCHEMA_DOCUMENT_ENRICHMENT_CONFIGURATION.members[ - "inlineConfigurations" - ], - ) - ) - - case 1: - kwargs["pre_extraction_hook_configuration"] = ( - HookConfiguration.deserialize(de) - ) - - case 2: - kwargs["post_extraction_hook_configuration"] = ( - HookConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DOCUMENT_ENRICHMENT_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -class AudioExtractionStatus(UnknownEnumMixin, StrEnum): - ENABLED = "ENABLED" - DISABLED = "DISABLED" - - -@dataclass(kw_only=True) -class AudioExtractionConfiguration: - """Configuration settings for audio content extraction and processing.""" - - audio_extraction_status: str - """ - The status of audio extraction (ENABLED or DISABLED) for processing - audio content from files. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUDIO_EXTRACTION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AUDIO_EXTRACTION_CONFIGURATION.members["audioExtractionStatus"], - self.audio_extraction_status, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["audio_extraction_status"] = AudioExtractionStatus( - de.read_string( - _SCHEMA_AUDIO_EXTRACTION_CONFIGURATION.members[ - "audioExtractionStatus" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUDIO_EXTRACTION_CONFIGURATION, consumer=_consumer - ) - if "audio_extraction_status" not in kwargs: - kwargs["audio_extraction_status"] = AudioExtractionStatus._corrected("") - return kwargs - - -class ImageExtractionStatus(UnknownEnumMixin, StrEnum): - ENABLED = "ENABLED" - DISABLED = "DISABLED" - - -@dataclass(kw_only=True) -class ImageExtractionConfiguration: - """ - The configuration for extracting semantic meaning from images in - documents. For more information, see [Extracting semantic meaning from - images and - visuals](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/extracting-meaning-from-images.html). - """ - - image_extraction_status: str - """ - Specify whether to extract semantic meaning from images and visuals from - documents. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IMAGE_EXTRACTION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_IMAGE_EXTRACTION_CONFIGURATION.members["imageExtractionStatus"], - self.image_extraction_status, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["image_extraction_status"] = ImageExtractionStatus( - de.read_string( - _SCHEMA_IMAGE_EXTRACTION_CONFIGURATION.members[ - "imageExtractionStatus" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_IMAGE_EXTRACTION_CONFIGURATION, consumer=_consumer - ) - if "image_extraction_status" not in kwargs: - kwargs["image_extraction_status"] = ImageExtractionStatus._corrected("") - return kwargs - - -class VideoExtractionStatus(UnknownEnumMixin, StrEnum): - ENABLED = "ENABLED" - DISABLED = "DISABLED" - - -@dataclass(kw_only=True) -class VideoExtractionConfiguration: - """Configuration settings for video content extraction and processing.""" - - video_extraction_status: str - """ - The status of video extraction (ENABLED or DISABLED) for processing - video content from files. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VIDEO_EXTRACTION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_VIDEO_EXTRACTION_CONFIGURATION.members["videoExtractionStatus"], - self.video_extraction_status, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["video_extraction_status"] = VideoExtractionStatus( - de.read_string( - _SCHEMA_VIDEO_EXTRACTION_CONFIGURATION.members[ - "videoExtractionStatus" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_VIDEO_EXTRACTION_CONFIGURATION, consumer=_consumer - ) - if "video_extraction_status" not in kwargs: - kwargs["video_extraction_status"] = VideoExtractionStatus._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class MediaExtractionConfiguration: - """The configuration for extracting information from media in documents.""" - - image_extraction_configuration: ImageExtractionConfiguration | None = None - """ - The configuration for extracting semantic meaning from images in - documents. For more information, see [Extracting semantic meaning from - images and - visuals](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/extracting-meaning-from-images.html). - """ - - audio_extraction_configuration: AudioExtractionConfiguration | None = None - """ - Configuration settings for extracting and processing audio content from - media files. - """ - - video_extraction_configuration: VideoExtractionConfiguration | None = None - """ - Configuration settings for extracting and processing video content from - media files. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDIA_EXTRACTION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.image_extraction_configuration is not None: - serializer.write_struct( - _SCHEMA_MEDIA_EXTRACTION_CONFIGURATION.members[ - "imageExtractionConfiguration" - ], - self.image_extraction_configuration, - ) - - if self.audio_extraction_configuration is not None: - serializer.write_struct( - _SCHEMA_MEDIA_EXTRACTION_CONFIGURATION.members[ - "audioExtractionConfiguration" - ], - self.audio_extraction_configuration, - ) - - if self.video_extraction_configuration is not None: - serializer.write_struct( - _SCHEMA_MEDIA_EXTRACTION_CONFIGURATION.members[ - "videoExtractionConfiguration" - ], - self.video_extraction_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["image_extraction_configuration"] = ( - ImageExtractionConfiguration.deserialize(de) - ) - - case 1: - kwargs["audio_extraction_configuration"] = ( - AudioExtractionConfiguration.deserialize(de) - ) - - case 2: - kwargs["video_extraction_configuration"] = ( - VideoExtractionConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MEDIA_EXTRACTION_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -def _serialize_security_group_ids( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_security_group_ids( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_subnet_ids( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_subnet_ids( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class DataSourceVpcConfiguration: - """ - Provides configuration information needed to connect to an Amazon VPC - (Virtual Private Cloud). - """ - - subnet_ids: list[str] - """ - A list of identifiers for subnets within your Amazon VPC. The subnets - should be able to connect to each other in the VPC, and they should have - outgoing access to the Internet through a NAT device. - """ - - security_group_ids: list[str] - """ - A list of identifiers of security groups within your Amazon VPC. The - security groups should enable Amazon Q Business to connect to the data - source. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DATA_SOURCE_VPC_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_subnet_ids( - serializer, - _SCHEMA_DATA_SOURCE_VPC_CONFIGURATION.members["subnetIds"], - self.subnet_ids, - ) - _serialize_security_group_ids( - serializer, - _SCHEMA_DATA_SOURCE_VPC_CONFIGURATION.members["securityGroupIds"], - self.security_group_ids, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["subnet_ids"] = _deserialize_subnet_ids( - de, _SCHEMA_DATA_SOURCE_VPC_CONFIGURATION.members["subnetIds"] - ) - - case 1: - kwargs["security_group_ids"] = _deserialize_security_group_ids( - de, - _SCHEMA_DATA_SOURCE_VPC_CONFIGURATION.members[ - "securityGroupIds" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DATA_SOURCE_VPC_CONFIGURATION, consumer=_consumer - ) - if "subnet_ids" not in kwargs: - kwargs["subnet_ids"] = [] - if "security_group_ids" not in kwargs: - kwargs["security_group_ids"] = [] - return kwargs - - -@dataclass(kw_only=True) -class CreateDataSourceInput: - """Dataclass for CreateDataSourceInput structure.""" - - application_id: str | None = None - """ - The identifier of the Amazon Q Business application the data source will - be attached to. - """ - - index_id: str | None = None - """ - The identifier of the index that you want to use with the data source - connector. - """ - - display_name: str | None = None - """A name for the data source connector.""" - - configuration: _Document | None = None - """ - Configuration information to connect your data source repository to - Amazon Q Business. Use this parameter to provide a JSON schema with - configuration information specific to your data source connector. - - Each data source has a JSON schema provided by Amazon Q Business that - you must use. For example, the Amazon S3 and Web Crawler connectors - require the following JSON schemas: - - - [Amazon S3 JSON - schema](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/s3-api.html) - - - [Web Crawler JSON - schema](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/web-crawler-api.html) - - You can find configuration templates for your specific data source using - the following steps: - - 1. Navigate to the [Supported - connectors](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/connectors-list.html) - page in the Amazon Q Business User Guide, and select the data source - of your choice. - - 2. Then, from your specific data source connector page, select **Using - the API**. You will find the JSON schema for your data source, - including parameter descriptions, in this section. - """ - - vpc_configuration: DataSourceVpcConfiguration | None = None - """ - Configuration information for an Amazon VPC (Virtual Private Cloud) to - connect to your data source. For more information, see [Using Amazon VPC - with Amazon Q Business - connectors](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/connector-vpc.html). - """ - - description: str | None = None - """A description for the data source connector.""" - - tags: list[Tag] | None = None - """ - A list of key-value pairs that identify or categorize the data source - connector. You can also use tags to help control access to the data - source connector. Tag keys and values can consist of Unicode letters, - digits, white space, and any of the following symbols: _ . : / = + - @. - """ - - sync_schedule: str | None = None - """ - Sets the frequency for Amazon Q Business to check the documents in your - data source repository and update your index. If you don't set a - schedule, Amazon Q Business won't periodically update the index. - - Specify a `cron-` format schedule string or an empty string to indicate - that the index is updated on demand. You can't specify the `Schedule` - parameter when the `Type` parameter is set to `CUSTOM`. If you do, you - receive a `ValidationException` exception. - """ - - role_arn: str | None = None - """ - The Amazon Resource Name (ARN) of an IAM role with permission to access - the data source and required resources. This field is required for all - connector types except custom connectors, where it is optional. - """ - - client_token: str | None = None - """ - A token you provide to identify a request to create a data source - connector. Multiple calls to the `CreateDataSource` API with the same - client token will create only one data source connector. - """ - - document_enrichment_configuration: DocumentEnrichmentConfiguration | None = None - """ - Provides the configuration information for altering document metadata - and content during the document ingestion process. - - For more information, see [Custom document - enrichment](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/custom-document-enrichment.html). - """ - - media_extraction_configuration: MediaExtractionConfiguration | None = None - """ - The configuration for extracting information from media in documents - during ingestion. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_DATA_SOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_CREATE_DATA_SOURCE_INPUT.members["applicationId"], - self.application_id, - ) - - if self.index_id is not None: - serializer.write_string( - _SCHEMA_CREATE_DATA_SOURCE_INPUT.members["indexId"], self.index_id - ) - - if self.display_name is not None: - serializer.write_string( - _SCHEMA_CREATE_DATA_SOURCE_INPUT.members["displayName"], - self.display_name, - ) - - if self.configuration is not None: - serializer.write_document( - _SCHEMA_CREATE_DATA_SOURCE_INPUT.members["configuration"], - self.configuration, - ) - - if self.vpc_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_DATA_SOURCE_INPUT.members["vpcConfiguration"], - self.vpc_configuration, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_DATA_SOURCE_INPUT.members["description"], - self.description, - ) - - if self.tags is not None: - _serialize_tags( - serializer, _SCHEMA_CREATE_DATA_SOURCE_INPUT.members["tags"], self.tags - ) - - if self.sync_schedule is not None: - serializer.write_string( - _SCHEMA_CREATE_DATA_SOURCE_INPUT.members["syncSchedule"], - self.sync_schedule, - ) - - if self.role_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_DATA_SOURCE_INPUT.members["roleArn"], self.role_arn - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_DATA_SOURCE_INPUT.members["clientToken"], - self.client_token, - ) - - if self.document_enrichment_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_DATA_SOURCE_INPUT.members[ - "documentEnrichmentConfiguration" - ], - self.document_enrichment_configuration, - ) - - if self.media_extraction_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_DATA_SOURCE_INPUT.members[ - "mediaExtractionConfiguration" - ], - self.media_extraction_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_CREATE_DATA_SOURCE_INPUT.members["applicationId"] - ) - - case 1: - kwargs["index_id"] = de.read_string( - _SCHEMA_CREATE_DATA_SOURCE_INPUT.members["indexId"] - ) - - case 2: - kwargs["display_name"] = de.read_string( - _SCHEMA_CREATE_DATA_SOURCE_INPUT.members["displayName"] - ) - - case 3: - kwargs["configuration"] = de.read_document( - _SCHEMA_CREATE_DATA_SOURCE_INPUT.members["configuration"] - ) - - case 4: - kwargs["vpc_configuration"] = ( - DataSourceVpcConfiguration.deserialize(de) - ) - - case 5: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_DATA_SOURCE_INPUT.members["description"] - ) - - case 6: - kwargs["tags"] = _deserialize_tags( - de, _SCHEMA_CREATE_DATA_SOURCE_INPUT.members["tags"] - ) - - case 7: - kwargs["sync_schedule"] = de.read_string( - _SCHEMA_CREATE_DATA_SOURCE_INPUT.members["syncSchedule"] - ) - - case 8: - kwargs["role_arn"] = de.read_string( - _SCHEMA_CREATE_DATA_SOURCE_INPUT.members["roleArn"] - ) - - case 9: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_DATA_SOURCE_INPUT.members["clientToken"] - ) - - case 10: - kwargs["document_enrichment_configuration"] = ( - DocumentEnrichmentConfiguration.deserialize(de) - ) - - case 11: - kwargs["media_extraction_configuration"] = ( - MediaExtractionConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_DATA_SOURCE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CreateDataSourceOutput: - """Dataclass for CreateDataSourceOutput structure.""" - - data_source_id: str | None = None - """The identifier of the data source connector.""" - - data_source_arn: str | None = None - """ - The Amazon Resource Name (ARN) of a data source in an Amazon Q Business - application. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_DATA_SOURCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.data_source_id is not None: - serializer.write_string( - _SCHEMA_CREATE_DATA_SOURCE_OUTPUT.members["dataSourceId"], - self.data_source_id, - ) - - if self.data_source_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_DATA_SOURCE_OUTPUT.members["dataSourceArn"], - self.data_source_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["data_source_id"] = de.read_string( - _SCHEMA_CREATE_DATA_SOURCE_OUTPUT.members["dataSourceId"] - ) - - case 1: - kwargs["data_source_arn"] = de.read_string( - _SCHEMA_CREATE_DATA_SOURCE_OUTPUT.members["dataSourceArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_DATA_SOURCE_OUTPUT, consumer=_consumer) - return kwargs - - -CREATE_DATA_SOURCE = APIOperation( - input=CreateDataSourceInput, - output=CreateDataSourceOutput, - schema=_SCHEMA_CREATE_DATA_SOURCE, - input_schema=_SCHEMA_CREATE_DATA_SOURCE_INPUT, - output_schema=_SCHEMA_CREATE_DATA_SOURCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.qbusiness#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteDataSourceInput: - """Dataclass for DeleteDataSourceInput structure.""" - - application_id: str | None = None - """ - The identifier of the Amazon Q Business application used with the data - source connector. - """ - - index_id: str | None = None - """The identifier of the index used with the data source connector.""" - - data_source_id: str | None = None - """The identifier of the data source connector that you want to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_DATA_SOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_DELETE_DATA_SOURCE_INPUT.members["applicationId"], - self.application_id, - ) - - if self.index_id is not None: - serializer.write_string( - _SCHEMA_DELETE_DATA_SOURCE_INPUT.members["indexId"], self.index_id - ) - - if self.data_source_id is not None: - serializer.write_string( - _SCHEMA_DELETE_DATA_SOURCE_INPUT.members["dataSourceId"], - self.data_source_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_DELETE_DATA_SOURCE_INPUT.members["applicationId"] - ) - - case 1: - kwargs["index_id"] = de.read_string( - _SCHEMA_DELETE_DATA_SOURCE_INPUT.members["indexId"] - ) - - case 2: - kwargs["data_source_id"] = de.read_string( - _SCHEMA_DELETE_DATA_SOURCE_INPUT.members["dataSourceId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_DATA_SOURCE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteDataSourceOutput: - """Dataclass for DeleteDataSourceOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_DATA_SOURCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_DATA_SOURCE_OUTPUT, consumer=_consumer) - return kwargs - - -DELETE_DATA_SOURCE = APIOperation( - input=DeleteDataSourceInput, - output=DeleteDataSourceOutput, - schema=_SCHEMA_DELETE_DATA_SOURCE, - input_schema=_SCHEMA_DELETE_DATA_SOURCE_INPUT, - output_schema=_SCHEMA_DELETE_DATA_SOURCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetDataSourceInput: - """Dataclass for GetDataSourceInput structure.""" - - application_id: str | None = None - """The identifier of the Amazon Q Business application.""" - - index_id: str | None = None - """The identfier of the index used with the data source connector.""" - - data_source_id: str | None = None - """The identifier of the data source connector.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DATA_SOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_GET_DATA_SOURCE_INPUT.members["applicationId"], - self.application_id, - ) - - if self.index_id is not None: - serializer.write_string( - _SCHEMA_GET_DATA_SOURCE_INPUT.members["indexId"], self.index_id - ) - - if self.data_source_id is not None: - serializer.write_string( - _SCHEMA_GET_DATA_SOURCE_INPUT.members["dataSourceId"], - self.data_source_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_GET_DATA_SOURCE_INPUT.members["applicationId"] - ) - - case 1: - kwargs["index_id"] = de.read_string( - _SCHEMA_GET_DATA_SOURCE_INPUT.members["indexId"] - ) - - case 2: - kwargs["data_source_id"] = de.read_string( - _SCHEMA_GET_DATA_SOURCE_INPUT.members["dataSourceId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_DATA_SOURCE_INPUT, consumer=_consumer) - return kwargs - - -class DataSourceStatus(UnknownEnumMixin, StrEnum): - PENDING_CREATION = "PENDING_CREATION" - CREATING = "CREATING" - ACTIVE = "ACTIVE" - DELETING = "DELETING" - FAILED = "FAILED" - UPDATING = "UPDATING" - - -@dataclass(kw_only=True) -class GetDataSourceOutput: - """Dataclass for GetDataSourceOutput structure.""" - - application_id: str | None = None - """The identifier of the Amazon Q Business application.""" - - index_id: str | None = None - """The identifier of the index linked to the data source connector.""" - - data_source_id: str | None = None - """The identifier of the data source connector.""" - - data_source_arn: str | None = None - """The Amazon Resource Name (ARN) of the data source.""" - - display_name: str | None = None - """The name for the data source connector.""" - - type: str | None = None - """The type of the data source connector. For example, `S3`.""" - - configuration: _Document | None = None - """The details of how the data source connector is configured.""" - - vpc_configuration: DataSourceVpcConfiguration | None = None - """ - Configuration information for an Amazon VPC (Virtual Private Cloud) to - connect to your data source. - """ - - created_at: datetime | None = None - """The Unix timestamp when the data source connector was created.""" - - updated_at: datetime | None = None - """The Unix timestamp when the data source connector was last updated.""" - - description: str | None = None - """The description for the data source connector.""" - - status: str | None = None - """ - The current status of the data source connector. When the `Status` field - value is `FAILED`, the `ErrorMessage` field contains a description of - the error that caused the data source connector to fail. - """ - - sync_schedule: str | None = None - """The schedule for Amazon Q Business to update the index.""" - - role_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the role with permission to access the - data source and required resources. - """ - - error: ErrorDetail | None = None - """ - When the `Status` field value is `FAILED`, the `ErrorMessage` field - contains a description of the error that caused the data source - connector to fail. - """ - - document_enrichment_configuration: DocumentEnrichmentConfiguration | None = None - """ - Provides the configuration information for altering document metadata - and content during the document ingestion process. - - For more information, see [Custom document - enrichment](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/custom-document-enrichment.html). - """ - - media_extraction_configuration: MediaExtractionConfiguration | None = None - """ - The configuration for extracting information from media in documents for - the data source. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DATA_SOURCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["applicationId"], - self.application_id, - ) - - if self.index_id is not None: - serializer.write_string( - _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["indexId"], self.index_id - ) - - if self.data_source_id is not None: - serializer.write_string( - _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["dataSourceId"], - self.data_source_id, - ) - - if self.data_source_arn is not None: - serializer.write_string( - _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["dataSourceArn"], - self.data_source_arn, - ) - - if self.display_name is not None: - serializer.write_string( - _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["displayName"], self.display_name - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["type"], self.type - ) - - if self.configuration is not None: - serializer.write_document( - _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["configuration"], - self.configuration, - ) - - if self.vpc_configuration is not None: - serializer.write_struct( - _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["vpcConfiguration"], - self.vpc_configuration, - ) - - if self.created_at is not None: - serializer.write_timestamp( - _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["createdAt"], self.created_at - ) - - if self.updated_at is not None: - serializer.write_timestamp( - _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["updatedAt"], self.updated_at - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["description"], self.description - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["status"], self.status - ) - - if self.sync_schedule is not None: - serializer.write_string( - _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["syncSchedule"], - self.sync_schedule, - ) - - if self.role_arn is not None: - serializer.write_string( - _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["roleArn"], self.role_arn - ) - - if self.error is not None: - serializer.write_struct( - _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["error"], self.error - ) - - if self.document_enrichment_configuration is not None: - serializer.write_struct( - _SCHEMA_GET_DATA_SOURCE_OUTPUT.members[ - "documentEnrichmentConfiguration" - ], - self.document_enrichment_configuration, - ) - - if self.media_extraction_configuration is not None: - serializer.write_struct( - _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["mediaExtractionConfiguration"], - self.media_extraction_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["applicationId"] - ) - - case 1: - kwargs["index_id"] = de.read_string( - _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["indexId"] - ) - - case 2: - kwargs["data_source_id"] = de.read_string( - _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["dataSourceId"] - ) - - case 3: - kwargs["data_source_arn"] = de.read_string( - _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["dataSourceArn"] - ) - - case 4: - kwargs["display_name"] = de.read_string( - _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["displayName"] - ) - - case 5: - kwargs["type"] = de.read_string( - _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["type"] - ) - - case 6: - kwargs["configuration"] = de.read_document( - _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["configuration"] - ) - - case 7: - kwargs["vpc_configuration"] = ( - DataSourceVpcConfiguration.deserialize(de) - ) - - case 8: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["createdAt"] - ) - - case 9: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["updatedAt"] - ) - - case 10: - kwargs["description"] = de.read_string( - _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["description"] - ) - - case 11: - kwargs["status"] = DataSourceStatus( - de.read_string(_SCHEMA_GET_DATA_SOURCE_OUTPUT.members["status"]) - ) - - case 12: - kwargs["sync_schedule"] = de.read_string( - _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["syncSchedule"] - ) - - case 13: - kwargs["role_arn"] = de.read_string( - _SCHEMA_GET_DATA_SOURCE_OUTPUT.members["roleArn"] - ) - - case 14: - kwargs["error"] = ErrorDetail.deserialize(de) - - case 15: - kwargs["document_enrichment_configuration"] = ( - DocumentEnrichmentConfiguration.deserialize(de) - ) - - case 16: - kwargs["media_extraction_configuration"] = ( - MediaExtractionConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_DATA_SOURCE_OUTPUT, consumer=_consumer) - return kwargs - - -GET_DATA_SOURCE = APIOperation( - input=GetDataSourceInput, - output=GetDataSourceOutput, - schema=_SCHEMA_GET_DATA_SOURCE, - input_schema=_SCHEMA_GET_DATA_SOURCE_INPUT, - output_schema=_SCHEMA_GET_DATA_SOURCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListDataSourcesInput: - """Dataclass for ListDataSourcesInput structure.""" - - application_id: str | None = None - """ - The identifier of the Amazon Q Business application linked to the data - source connectors. - """ - - index_id: str | None = None - """ - The identifier of the index used with one or more data source - connectors. - """ - - next_token: str | None = None - """ - If the `maxResults` response was incomplete because there is more data - to retrieve, Amazon Q Business returns a pagination token in the - response. You can use this pagination token to retrieve the next set of - Amazon Q Business data source connectors. - """ - - max_results: int | None = None - """The maximum number of data source connectors to return.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_DATA_SOURCES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_LIST_DATA_SOURCES_INPUT.members["applicationId"], - self.application_id, - ) - - if self.index_id is not None: - serializer.write_string( - _SCHEMA_LIST_DATA_SOURCES_INPUT.members["indexId"], self.index_id - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_DATA_SOURCES_INPUT.members["nextToken"], self.next_token - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_DATA_SOURCES_INPUT.members["maxResults"], self.max_results - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_LIST_DATA_SOURCES_INPUT.members["applicationId"] - ) - - case 1: - kwargs["index_id"] = de.read_string( - _SCHEMA_LIST_DATA_SOURCES_INPUT.members["indexId"] - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_DATA_SOURCES_INPUT.members["nextToken"] - ) - - case 3: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_DATA_SOURCES_INPUT.members["maxResults"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_DATA_SOURCES_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DataSource: - """A data source in an Amazon Q Business application.""" - - display_name: str | None = None - """The name of the Amazon Q Business data source.""" - - data_source_id: str | None = None - """The identifier of the Amazon Q Business data source.""" - - type: str | None = None - """The type of the Amazon Q Business data source.""" - - created_at: datetime | None = None - """The Unix timestamp when the Amazon Q Business data source was created.""" - - updated_at: datetime | None = None - """ - The Unix timestamp when the Amazon Q Business data source was last - updated. - """ - - status: str | None = None - """The status of the Amazon Q Business data source.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DATA_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.display_name is not None: - serializer.write_string( - _SCHEMA_DATA_SOURCE.members["displayName"], self.display_name - ) - - if self.data_source_id is not None: - serializer.write_string( - _SCHEMA_DATA_SOURCE.members["dataSourceId"], self.data_source_id - ) - - if self.type is not None: - serializer.write_string(_SCHEMA_DATA_SOURCE.members["type"], self.type) - - if self.created_at is not None: - serializer.write_timestamp( - _SCHEMA_DATA_SOURCE.members["createdAt"], self.created_at - ) - - if self.updated_at is not None: - serializer.write_timestamp( - _SCHEMA_DATA_SOURCE.members["updatedAt"], self.updated_at - ) - - if self.status is not None: - serializer.write_string(_SCHEMA_DATA_SOURCE.members["status"], self.status) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["display_name"] = de.read_string( - _SCHEMA_DATA_SOURCE.members["displayName"] - ) - - case 1: - kwargs["data_source_id"] = de.read_string( - _SCHEMA_DATA_SOURCE.members["dataSourceId"] - ) - - case 2: - kwargs["type"] = de.read_string(_SCHEMA_DATA_SOURCE.members["type"]) - - case 3: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_DATA_SOURCE.members["createdAt"] - ) - - case 4: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_DATA_SOURCE.members["updatedAt"] - ) - - case 5: - kwargs["status"] = DataSourceStatus( - de.read_string(_SCHEMA_DATA_SOURCE.members["status"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DATA_SOURCE, consumer=_consumer) - return kwargs - - -def _serialize_data_sources( - serializer: ShapeSerializer, schema: Schema, value: list[DataSource] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_data_sources( - deserializer: ShapeDeserializer, schema: Schema -) -> list[DataSource]: - result: list[DataSource] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(DataSource.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListDataSourcesOutput: - """Dataclass for ListDataSourcesOutput structure.""" - - data_sources: list[DataSource] | None = None - """An array of summary information for one or more data source connector.""" - - next_token: str | None = None - """ - If the response is truncated, Amazon Q Business returns this token. You - can use this token in a subsequent request to retrieve the next set of - data source connectors. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_DATA_SOURCES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.data_sources is not None: - _serialize_data_sources( - serializer, - _SCHEMA_LIST_DATA_SOURCES_OUTPUT.members["dataSources"], - self.data_sources, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_DATA_SOURCES_OUTPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["data_sources"] = _deserialize_data_sources( - de, _SCHEMA_LIST_DATA_SOURCES_OUTPUT.members["dataSources"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_DATA_SOURCES_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_DATA_SOURCES_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_DATA_SOURCES = APIOperation( - input=ListDataSourcesInput, - output=ListDataSourcesOutput, - schema=_SCHEMA_LIST_DATA_SOURCES, - input_schema=_SCHEMA_LIST_DATA_SOURCES_INPUT, - output_schema=_SCHEMA_LIST_DATA_SOURCES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateDataSourceInput: - """Dataclass for UpdateDataSourceInput structure.""" - - application_id: str | None = None - """ - The identifier of the Amazon Q Business application the data source is - attached to. - """ - - index_id: str | None = None - """The identifier of the index attached to the data source connector.""" - - data_source_id: str | None = None - """The identifier of the data source connector.""" - - display_name: str | None = None - """A name of the data source connector.""" - - configuration: _Document | None = None - """ - Provides the configuration information for an Amazon Q Business data - source. - """ - - vpc_configuration: DataSourceVpcConfiguration | None = None - """ - Provides configuration information needed to connect to an Amazon VPC - (Virtual Private Cloud). - """ - - description: str | None = None - """The description of the data source connector.""" - - sync_schedule: str | None = None - """The chosen update frequency for your data source.""" - - role_arn: str | None = None - """ - The Amazon Resource Name (ARN) of an IAM role with permission to access - the data source and required resources. - """ - - document_enrichment_configuration: DocumentEnrichmentConfiguration | None = None - """ - Provides the configuration information for altering document metadata - and content during the document ingestion process. - - For more information, see [Custom document - enrichment](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/custom-document-enrichment.html). - """ - - media_extraction_configuration: MediaExtractionConfiguration | None = None - """ - The configuration for extracting information from media in documents for - your data source. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_DATA_SOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members["applicationId"], - self.application_id, - ) - - if self.index_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members["indexId"], self.index_id - ) - - if self.data_source_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members["dataSourceId"], - self.data_source_id, - ) - - if self.display_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members["displayName"], - self.display_name, - ) - - if self.configuration is not None: - serializer.write_document( - _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members["configuration"], - self.configuration, - ) - - if self.vpc_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members["vpcConfiguration"], - self.vpc_configuration, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members["description"], - self.description, - ) - - if self.sync_schedule is not None: - serializer.write_string( - _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members["syncSchedule"], - self.sync_schedule, - ) - - if self.role_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members["roleArn"], self.role_arn - ) - - if self.document_enrichment_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members[ - "documentEnrichmentConfiguration" - ], - self.document_enrichment_configuration, - ) - - if self.media_extraction_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members[ - "mediaExtractionConfiguration" - ], - self.media_extraction_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members["applicationId"] - ) - - case 1: - kwargs["index_id"] = de.read_string( - _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members["indexId"] - ) - - case 2: - kwargs["data_source_id"] = de.read_string( - _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members["dataSourceId"] - ) - - case 3: - kwargs["display_name"] = de.read_string( - _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members["displayName"] - ) - - case 4: - kwargs["configuration"] = de.read_document( - _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members["configuration"] - ) - - case 5: - kwargs["vpc_configuration"] = ( - DataSourceVpcConfiguration.deserialize(de) - ) - - case 6: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members["description"] - ) - - case 7: - kwargs["sync_schedule"] = de.read_string( - _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members["syncSchedule"] - ) - - case 8: - kwargs["role_arn"] = de.read_string( - _SCHEMA_UPDATE_DATA_SOURCE_INPUT.members["roleArn"] - ) - - case 9: - kwargs["document_enrichment_configuration"] = ( - DocumentEnrichmentConfiguration.deserialize(de) - ) - - case 10: - kwargs["media_extraction_configuration"] = ( - MediaExtractionConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_DATA_SOURCE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateDataSourceOutput: - """Dataclass for UpdateDataSourceOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_DATA_SOURCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_DATA_SOURCE_OUTPUT, consumer=_consumer) - return kwargs - - -UPDATE_DATA_SOURCE = APIOperation( - input=UpdateDataSourceInput, - output=UpdateDataSourceOutput, - schema=_SCHEMA_UPDATE_DATA_SOURCE, - input_schema=_SCHEMA_UPDATE_DATA_SOURCE_INPUT, - output_schema=_SCHEMA_UPDATE_DATA_SOURCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteIndexInput: - """Dataclass for DeleteIndexInput structure.""" - - application_id: str | None = None - """ - The identifier of the Amazon Q Business application the Amazon Q - Business index is linked to. - """ - - index_id: str | None = None - """The identifier of the Amazon Q Business index.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_INDEX_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_DELETE_INDEX_INPUT.members["applicationId"], self.application_id - ) - - if self.index_id is not None: - serializer.write_string( - _SCHEMA_DELETE_INDEX_INPUT.members["indexId"], self.index_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_DELETE_INDEX_INPUT.members["applicationId"] - ) - - case 1: - kwargs["index_id"] = de.read_string( - _SCHEMA_DELETE_INDEX_INPUT.members["indexId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_INDEX_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteIndexOutput: - """Dataclass for DeleteIndexOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_INDEX_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_INDEX_OUTPUT, consumer=_consumer) - return kwargs - - -DELETE_INDEX = APIOperation( - input=DeleteIndexInput, - output=DeleteIndexOutput, - schema=_SCHEMA_DELETE_INDEX, - input_schema=_SCHEMA_DELETE_INDEX_INPUT, - output_schema=_SCHEMA_DELETE_INDEX_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetIndexInput: - """Dataclass for GetIndexInput structure.""" - - application_id: str | None = None - """ - The identifier of the Amazon Q Business application connected to the - index. - """ - - index_id: str | None = None - """The identifier of the Amazon Q Business index you want information on.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_INDEX_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_GET_INDEX_INPUT.members["applicationId"], self.application_id - ) - - if self.index_id is not None: - serializer.write_string( - _SCHEMA_GET_INDEX_INPUT.members["indexId"], self.index_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_GET_INDEX_INPUT.members["applicationId"] - ) - - case 1: - kwargs["index_id"] = de.read_string( - _SCHEMA_GET_INDEX_INPUT.members["indexId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_INDEX_INPUT, consumer=_consumer) - return kwargs - - -class Status(UnknownEnumMixin, StrEnum): - ENABLED = "ENABLED" - DISABLED = "DISABLED" - - -class AttributeType(UnknownEnumMixin, StrEnum): - STRING = "STRING" - STRING_LIST = "STRING_LIST" - NUMBER = "NUMBER" - DATE = "DATE" - - -@dataclass(kw_only=True) -class DocumentAttributeConfiguration: - """ - Configuration information for document attributes. Document attributes - are metadata or fields associated with your documents. For example, the - company department name associated with each document. - - For more information, see [Understanding document - attributes](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/doc-attributes.html). - """ - - name: str | None = None - """The name of the document attribute.""" - - type: str | None = None - """The type of document attribute.""" - - search: str | None = None - """ - Information about whether the document attribute can be used by an end - user to search for information on their web experience. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_ATTRIBUTE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_DOCUMENT_ATTRIBUTE_CONFIGURATION.members["name"], self.name - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_DOCUMENT_ATTRIBUTE_CONFIGURATION.members["type"], self.type - ) - - if self.search is not None: - serializer.write_string( - _SCHEMA_DOCUMENT_ATTRIBUTE_CONFIGURATION.members["search"], self.search - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_DOCUMENT_ATTRIBUTE_CONFIGURATION.members["name"] - ) - - case 1: - kwargs["type"] = AttributeType( - de.read_string( - _SCHEMA_DOCUMENT_ATTRIBUTE_CONFIGURATION.members["type"] - ) - ) - - case 2: - kwargs["search"] = Status( - de.read_string( - _SCHEMA_DOCUMENT_ATTRIBUTE_CONFIGURATION.members["search"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DOCUMENT_ATTRIBUTE_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -def _serialize_document_attribute_configurations( - serializer: ShapeSerializer, - schema: Schema, - value: list[DocumentAttributeConfiguration], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_document_attribute_configurations( - deserializer: ShapeDeserializer, schema: Schema -) -> list[DocumentAttributeConfiguration]: - result: list[DocumentAttributeConfiguration] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(DocumentAttributeConfiguration.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class TextDocumentStatistics: - """Provides information about text documents in an index.""" - - indexed_text_bytes: int | None = None - """The total size, in bytes, of the indexed documents.""" - - indexed_text_document_count: int | None = None - """The number of text documents indexed.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TEXT_DOCUMENT_STATISTICS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.indexed_text_bytes is not None: - serializer.write_long( - _SCHEMA_TEXT_DOCUMENT_STATISTICS.members["indexedTextBytes"], - self.indexed_text_bytes, - ) - - if self.indexed_text_document_count is not None: - serializer.write_integer( - _SCHEMA_TEXT_DOCUMENT_STATISTICS.members["indexedTextDocumentCount"], - self.indexed_text_document_count, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["indexed_text_bytes"] = de.read_long( - _SCHEMA_TEXT_DOCUMENT_STATISTICS.members["indexedTextBytes"] - ) - - case 1: - kwargs["indexed_text_document_count"] = de.read_integer( - _SCHEMA_TEXT_DOCUMENT_STATISTICS.members[ - "indexedTextDocumentCount" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TEXT_DOCUMENT_STATISTICS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class IndexStatistics: - """Provides information about the number of documents in an index.""" - - text_document_statistics: TextDocumentStatistics | None = None - """The number of documents indexed.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INDEX_STATISTICS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.text_document_statistics is not None: - serializer.write_struct( - _SCHEMA_INDEX_STATISTICS.members["textDocumentStatistics"], - self.text_document_statistics, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["text_document_statistics"] = ( - TextDocumentStatistics.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INDEX_STATISTICS, consumer=_consumer) - return kwargs - - -class IndexStatus(UnknownEnumMixin, StrEnum): - CREATING = "CREATING" - ACTIVE = "ACTIVE" - DELETING = "DELETING" - FAILED = "FAILED" - UPDATING = "UPDATING" - - -@dataclass(kw_only=True) -class GetIndexOutput: - """Dataclass for GetIndexOutput structure.""" - - application_id: str | None = None - """ - The identifier of the Amazon Q Business application associated with the - index. - """ - - index_id: str | None = None - """The identifier of the Amazon Q Business index.""" - - display_name: str | None = None - """The name of the Amazon Q Business index.""" - - index_arn: str | None = None - """The Amazon Resource Name (ARN) of the Amazon Q Business index.""" - - status: str | None = None - """ - The current status of the index. When the value is `ACTIVE`, the index - is ready for use. If the `Status` field value is `FAILED`, the - `ErrorMessage` field contains a message that explains why. - """ - - type: str | None = None - """The type of index attached to your Amazon Q Business application.""" - - description: str | None = None - """The description for the Amazon Q Business index.""" - - created_at: datetime | None = None - """The Unix timestamp when the Amazon Q Business index was created.""" - - updated_at: datetime | None = None - """The Unix timestamp when the Amazon Q Business index was last updated.""" - - capacity_configuration: IndexCapacityConfiguration | None = None - """The storage capacity units chosen for your Amazon Q Business index.""" - - document_attribute_configurations: list[DocumentAttributeConfiguration] | None = ( - None - ) - """ - Configuration information for document attributes or metadata. Document - metadata are fields associated with your documents. For example, the - company department name associated with each document. For more - information, see [Understanding document - attributes](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/doc-attributes-types.html#doc-attributes). - """ - - error: ErrorDetail | None = None - """ - When the `Status` field value is `FAILED`, the `ErrorMessage` field - contains a message that explains why. - """ - - index_statistics: IndexStatistics | None = None - """Provides information about the number of documents indexed.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_INDEX_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_GET_INDEX_OUTPUT.members["applicationId"], self.application_id - ) - - if self.index_id is not None: - serializer.write_string( - _SCHEMA_GET_INDEX_OUTPUT.members["indexId"], self.index_id - ) - - if self.display_name is not None: - serializer.write_string( - _SCHEMA_GET_INDEX_OUTPUT.members["displayName"], self.display_name - ) - - if self.index_arn is not None: - serializer.write_string( - _SCHEMA_GET_INDEX_OUTPUT.members["indexArn"], self.index_arn - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_GET_INDEX_OUTPUT.members["status"], self.status - ) - - if self.type is not None: - serializer.write_string(_SCHEMA_GET_INDEX_OUTPUT.members["type"], self.type) - - if self.description is not None: - serializer.write_string( - _SCHEMA_GET_INDEX_OUTPUT.members["description"], self.description - ) - - if self.created_at is not None: - serializer.write_timestamp( - _SCHEMA_GET_INDEX_OUTPUT.members["createdAt"], self.created_at - ) - - if self.updated_at is not None: - serializer.write_timestamp( - _SCHEMA_GET_INDEX_OUTPUT.members["updatedAt"], self.updated_at - ) - - if self.capacity_configuration is not None: - serializer.write_struct( - _SCHEMA_GET_INDEX_OUTPUT.members["capacityConfiguration"], - self.capacity_configuration, - ) - - if self.document_attribute_configurations is not None: - _serialize_document_attribute_configurations( - serializer, - _SCHEMA_GET_INDEX_OUTPUT.members["documentAttributeConfigurations"], - self.document_attribute_configurations, - ) - - if self.error is not None: - serializer.write_struct( - _SCHEMA_GET_INDEX_OUTPUT.members["error"], self.error - ) - - if self.index_statistics is not None: - serializer.write_struct( - _SCHEMA_GET_INDEX_OUTPUT.members["indexStatistics"], - self.index_statistics, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_GET_INDEX_OUTPUT.members["applicationId"] - ) - - case 1: - kwargs["index_id"] = de.read_string( - _SCHEMA_GET_INDEX_OUTPUT.members["indexId"] - ) - - case 2: - kwargs["display_name"] = de.read_string( - _SCHEMA_GET_INDEX_OUTPUT.members["displayName"] - ) - - case 3: - kwargs["index_arn"] = de.read_string( - _SCHEMA_GET_INDEX_OUTPUT.members["indexArn"] - ) - - case 4: - kwargs["status"] = IndexStatus( - de.read_string(_SCHEMA_GET_INDEX_OUTPUT.members["status"]) - ) - - case 5: - kwargs["type"] = IndexType( - de.read_string(_SCHEMA_GET_INDEX_OUTPUT.members["type"]) - ) - - case 6: - kwargs["description"] = de.read_string( - _SCHEMA_GET_INDEX_OUTPUT.members["description"] - ) - - case 7: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_INDEX_OUTPUT.members["createdAt"] - ) - - case 8: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_GET_INDEX_OUTPUT.members["updatedAt"] - ) - - case 9: - kwargs["capacity_configuration"] = ( - IndexCapacityConfiguration.deserialize(de) - ) - - case 10: - kwargs["document_attribute_configurations"] = ( - _deserialize_document_attribute_configurations( - de, - _SCHEMA_GET_INDEX_OUTPUT.members[ - "documentAttributeConfigurations" - ], - ) - ) - - case 11: - kwargs["error"] = ErrorDetail.deserialize(de) - - case 12: - kwargs["index_statistics"] = IndexStatistics.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_INDEX_OUTPUT, consumer=_consumer) - return kwargs - - -GET_INDEX = APIOperation( - input=GetIndexInput, - output=GetIndexOutput, - schema=_SCHEMA_GET_INDEX, - input_schema=_SCHEMA_GET_INDEX_INPUT, - output_schema=_SCHEMA_GET_INDEX_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListIndicesInput: - """Dataclass for ListIndicesInput structure.""" - - application_id: str | None = None - """ - The identifier of the Amazon Q Business application connected to the - index. - """ - - next_token: str | None = None - """ - If the maxResults response was incomplete because there is more data to - retrieve, Amazon Q Business returns a pagination token in the response. - You can use this pagination token to retrieve the next set of Amazon Q - Business indices. - """ - - max_results: int | None = None - """The maximum number of indices to return.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_INDICES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_LIST_INDICES_INPUT.members["applicationId"], self.application_id - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_INDICES_INPUT.members["nextToken"], self.next_token - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_INDICES_INPUT.members["maxResults"], self.max_results - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_LIST_INDICES_INPUT.members["applicationId"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_INDICES_INPUT.members["nextToken"] - ) - - case 2: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_INDICES_INPUT.members["maxResults"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_INDICES_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Index: - """Summary information for your Amazon Q Business index.""" - - display_name: str | None = None - """The name of the index.""" - - index_id: str | None = None - """The identifier for the index.""" - - created_at: datetime | None = None - """The Unix timestamp when the index was created.""" - - updated_at: datetime | None = None - """The Unix timestamp when the index was last updated.""" - - status: str | None = None - """ - The current status of the index. When the status is `ACTIVE`, the index - is ready. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INDEX, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.display_name is not None: - serializer.write_string( - _SCHEMA_INDEX.members["displayName"], self.display_name - ) - - if self.index_id is not None: - serializer.write_string(_SCHEMA_INDEX.members["indexId"], self.index_id) - - if self.created_at is not None: - serializer.write_timestamp( - _SCHEMA_INDEX.members["createdAt"], self.created_at - ) - - if self.updated_at is not None: - serializer.write_timestamp( - _SCHEMA_INDEX.members["updatedAt"], self.updated_at - ) - - if self.status is not None: - serializer.write_string(_SCHEMA_INDEX.members["status"], self.status) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["display_name"] = de.read_string( - _SCHEMA_INDEX.members["displayName"] - ) - - case 1: - kwargs["index_id"] = de.read_string( - _SCHEMA_INDEX.members["indexId"] - ) - - case 2: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_INDEX.members["createdAt"] - ) - - case 3: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_INDEX.members["updatedAt"] - ) - - case 4: - kwargs["status"] = IndexStatus( - de.read_string(_SCHEMA_INDEX.members["status"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INDEX, consumer=_consumer) - return kwargs - - -def _serialize_indices( - serializer: ShapeSerializer, schema: Schema, value: list[Index] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_indices( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Index]: - result: list[Index] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Index.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListIndicesOutput: - """Dataclass for ListIndicesOutput structure.""" - - next_token: str | None = None - """ - If the response is truncated, Amazon Q Business returns this token that - you can use in the subsequent request to retrieve the next set of - indexes. - """ - - indices: list[Index] | None = None - """An array of information on the items in one or more indexes.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_INDICES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_INDICES_OUTPUT.members["nextToken"], self.next_token - ) - - if self.indices is not None: - _serialize_indices( - serializer, _SCHEMA_LIST_INDICES_OUTPUT.members["indices"], self.indices - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_INDICES_OUTPUT.members["nextToken"] - ) - - case 1: - kwargs["indices"] = _deserialize_indices( - de, _SCHEMA_LIST_INDICES_OUTPUT.members["indices"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_INDICES_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_INDICES = APIOperation( - input=ListIndicesInput, - output=ListIndicesOutput, - schema=_SCHEMA_LIST_INDICES, - input_schema=_SCHEMA_LIST_INDICES_INPUT, - output_schema=_SCHEMA_LIST_INDICES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateIndexInput: - """Dataclass for UpdateIndexInput structure.""" - - application_id: str | None = None - """ - The identifier of the Amazon Q Business application connected to the - index. - """ - - index_id: str | None = None - """The identifier of the Amazon Q Business index.""" - - display_name: str | None = None - """The name of the Amazon Q Business index.""" - - description: str | None = None - """The description of the Amazon Q Business index.""" - - capacity_configuration: IndexCapacityConfiguration | None = None - """ - The storage capacity units you want to provision for your Amazon Q - Business index. You can add and remove capacity to fit your usage needs. - """ - - document_attribute_configurations: list[DocumentAttributeConfiguration] | None = ( - None - ) - """ - Configuration information for document metadata or fields. Document - metadata are fields or attributes associated with your documents. For - example, the company department name associated with each document. For - more information, see [Understanding document - attributes](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/doc-attributes-types.html#doc-attributes). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_INDEX_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_INDEX_INPUT.members["applicationId"], self.application_id - ) - - if self.index_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_INDEX_INPUT.members["indexId"], self.index_id - ) - - if self.display_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_INDEX_INPUT.members["displayName"], self.display_name - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_INDEX_INPUT.members["description"], self.description - ) - - if self.capacity_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_INDEX_INPUT.members["capacityConfiguration"], - self.capacity_configuration, - ) - - if self.document_attribute_configurations is not None: - _serialize_document_attribute_configurations( - serializer, - _SCHEMA_UPDATE_INDEX_INPUT.members["documentAttributeConfigurations"], - self.document_attribute_configurations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_UPDATE_INDEX_INPUT.members["applicationId"] - ) - - case 1: - kwargs["index_id"] = de.read_string( - _SCHEMA_UPDATE_INDEX_INPUT.members["indexId"] - ) - - case 2: - kwargs["display_name"] = de.read_string( - _SCHEMA_UPDATE_INDEX_INPUT.members["displayName"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_INDEX_INPUT.members["description"] - ) - - case 4: - kwargs["capacity_configuration"] = ( - IndexCapacityConfiguration.deserialize(de) - ) - - case 5: - kwargs["document_attribute_configurations"] = ( - _deserialize_document_attribute_configurations( - de, - _SCHEMA_UPDATE_INDEX_INPUT.members[ - "documentAttributeConfigurations" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_INDEX_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateIndexOutput: - """Dataclass for UpdateIndexOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_INDEX_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_INDEX_OUTPUT, consumer=_consumer) - return kwargs - - -UPDATE_INDEX = APIOperation( - input=UpdateIndexInput, - output=UpdateIndexOutput, - schema=_SCHEMA_UPDATE_INDEX, - input_schema=_SCHEMA_UPDATE_INDEX_INPUT, - output_schema=_SCHEMA_UPDATE_INDEX_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.qbusiness#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListApplicationsInput: - """Dataclass for ListApplicationsInput structure.""" - - next_token: str | None = None - """ - If the `maxResults` response was incomplete because there is more data - to retrieve, Amazon Q Business returns a pagination token in the - response. You can use this pagination token to retrieve the next set of - Amazon Q Business applications. - """ - - max_results: int | None = None - """The maximum number of Amazon Q Business applications to return.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_APPLICATIONS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_APPLICATIONS_INPUT.members["nextToken"], self.next_token - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_APPLICATIONS_INPUT.members["maxResults"], self.max_results - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_APPLICATIONS_INPUT.members["nextToken"] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_APPLICATIONS_INPUT.members["maxResults"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_APPLICATIONS_INPUT, consumer=_consumer) - return kwargs - - -def _serialize_applications( - serializer: ShapeSerializer, schema: Schema, value: list[Application] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_applications( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Application]: - result: list[Application] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Application.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListApplicationsOutput: - """Dataclass for ListApplicationsOutput structure.""" - - next_token: str | None = None - """ - If the response is truncated, Amazon Q Business returns this token. You - can use this token in a subsequent request to retrieve the next set of - applications. - """ - - applications: list[Application] | None = None - """ - An array of summary information on the configuration of one or more - Amazon Q Business applications. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_APPLICATIONS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_APPLICATIONS_OUTPUT.members["nextToken"], self.next_token - ) - - if self.applications is not None: - _serialize_applications( - serializer, - _SCHEMA_LIST_APPLICATIONS_OUTPUT.members["applications"], - self.applications, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_APPLICATIONS_OUTPUT.members["nextToken"] - ) - - case 1: - kwargs["applications"] = _deserialize_applications( - de, _SCHEMA_LIST_APPLICATIONS_OUTPUT.members["applications"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_APPLICATIONS_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_APPLICATIONS = APIOperation( - input=ListApplicationsInput, - output=ListApplicationsOutput, - schema=_SCHEMA_LIST_APPLICATIONS, - input_schema=_SCHEMA_LIST_APPLICATIONS_INPUT, - output_schema=_SCHEMA_LIST_APPLICATIONS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class BasicAuthConfiguration: - """ - Information about the basic authentication credentials used to configure - a plugin. - """ - - secret_arn: str - """ - The ARN of the Secrets Manager secret that stores the basic - authentication credentials used for plugin configuration.. - """ - - role_arn: str - """ - The ARN of an IAM role used by Amazon Q Business to access the basic - authentication credentials stored in a Secrets Manager secret. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BASIC_AUTH_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_BASIC_AUTH_CONFIGURATION.members["secretArn"], self.secret_arn - ) - serializer.write_string( - _SCHEMA_BASIC_AUTH_CONFIGURATION.members["roleArn"], self.role_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["secret_arn"] = de.read_string( - _SCHEMA_BASIC_AUTH_CONFIGURATION.members["secretArn"] - ) - - case 1: - kwargs["role_arn"] = de.read_string( - _SCHEMA_BASIC_AUTH_CONFIGURATION.members["roleArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BASIC_AUTH_CONFIGURATION, consumer=_consumer) - if "secret_arn" not in kwargs: - kwargs["secret_arn"] = "" - if "role_arn" not in kwargs: - kwargs["role_arn"] = "" - return kwargs - - -@dataclass(kw_only=True) -class IdcAuthConfiguration: - """ - Information about the IAM Identity Center Application used to configure - authentication for a plugin. - """ - - idc_application_arn: str - """ - The Amazon Resource Name (ARN) of the IAM Identity Center Application - used to configure authentication. - """ - - role_arn: str - """ - The Amazon Resource Name (ARN) of the IAM role with permissions to - perform actions on Amazon Web Services services on your behalf. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IDC_AUTH_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_IDC_AUTH_CONFIGURATION.members["idcApplicationArn"], - self.idc_application_arn, - ) - serializer.write_string( - _SCHEMA_IDC_AUTH_CONFIGURATION.members["roleArn"], self.role_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["idc_application_arn"] = de.read_string( - _SCHEMA_IDC_AUTH_CONFIGURATION.members["idcApplicationArn"] - ) - - case 1: - kwargs["role_arn"] = de.read_string( - _SCHEMA_IDC_AUTH_CONFIGURATION.members["roleArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_IDC_AUTH_CONFIGURATION, consumer=_consumer) - if "idc_application_arn" not in kwargs: - kwargs["idc_application_arn"] = "" - if "role_arn" not in kwargs: - kwargs["role_arn"] = "" - return kwargs - - -@dataclass(kw_only=True) -class NoAuthConfiguration: - """ - Information about invoking a custom plugin without any authentication or - authorization requirement. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_NO_AUTH_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_NO_AUTH_CONFIGURATION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class OAuth2ClientCredentialConfiguration: - """ - Information about the OAuth 2.0 authentication credential/token used to - configure a plugin. - """ - - secret_arn: str - """ - The ARN of the Secrets Manager secret that stores the OAuth 2.0 - credentials/token used for plugin configuration. - """ - - role_arn: str - """ - The ARN of an IAM role used by Amazon Q Business to access the OAuth 2.0 - authentication credentials stored in a Secrets Manager secret. - """ - - authorization_url: str | None = None - """ - The redirect URL required by the OAuth 2.0 protocol for Amazon Q - Business to authenticate a plugin user through a third party - authentication server. - """ - - token_url: str | None = None - """ - The URL required by the OAuth 2.0 protocol to exchange an end user - authorization code for an access token. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_O_AUTH2_CLIENT_CREDENTIAL_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_O_AUTH2_CLIENT_CREDENTIAL_CONFIGURATION.members["secretArn"], - self.secret_arn, - ) - serializer.write_string( - _SCHEMA_O_AUTH2_CLIENT_CREDENTIAL_CONFIGURATION.members["roleArn"], - self.role_arn, - ) - if self.authorization_url is not None: - serializer.write_string( - _SCHEMA_O_AUTH2_CLIENT_CREDENTIAL_CONFIGURATION.members[ - "authorizationUrl" - ], - self.authorization_url, - ) - - if self.token_url is not None: - serializer.write_string( - _SCHEMA_O_AUTH2_CLIENT_CREDENTIAL_CONFIGURATION.members["tokenUrl"], - self.token_url, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["secret_arn"] = de.read_string( - _SCHEMA_O_AUTH2_CLIENT_CREDENTIAL_CONFIGURATION.members[ - "secretArn" - ] - ) - - case 1: - kwargs["role_arn"] = de.read_string( - _SCHEMA_O_AUTH2_CLIENT_CREDENTIAL_CONFIGURATION.members[ - "roleArn" - ] - ) - - case 2: - kwargs["authorization_url"] = de.read_string( - _SCHEMA_O_AUTH2_CLIENT_CREDENTIAL_CONFIGURATION.members[ - "authorizationUrl" - ] - ) - - case 3: - kwargs["token_url"] = de.read_string( - _SCHEMA_O_AUTH2_CLIENT_CREDENTIAL_CONFIGURATION.members[ - "tokenUrl" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_O_AUTH2_CLIENT_CREDENTIAL_CONFIGURATION, consumer=_consumer - ) - if "secret_arn" not in kwargs: - kwargs["secret_arn"] = "" - if "role_arn" not in kwargs: - kwargs["role_arn"] = "" - return kwargs - - -@dataclass -class PluginAuthConfigurationBasicAuthConfiguration: - """ - Information about the basic authentication credentials used to configure - a plugin. - """ - - value: BasicAuthConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PLUGIN_AUTH_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_PLUGIN_AUTH_CONFIGURATION.members["basicAuthConfiguration"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=BasicAuthConfiguration.deserialize(deserializer)) - - -@dataclass -class PluginAuthConfigurationOAuth2ClientCredentialConfiguration: - """ - Information about the OAuth 2.0 authentication credential/token used to - configure a plugin. - """ - - value: OAuth2ClientCredentialConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PLUGIN_AUTH_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_PLUGIN_AUTH_CONFIGURATION.members[ - "oAuth2ClientCredentialConfiguration" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=OAuth2ClientCredentialConfiguration.deserialize(deserializer)) - - -@dataclass -class PluginAuthConfigurationNoAuthConfiguration: - """Information about invoking a custom plugin without any authentication.""" - - value: NoAuthConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PLUGIN_AUTH_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_PLUGIN_AUTH_CONFIGURATION.members["noAuthConfiguration"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=NoAuthConfiguration.deserialize(deserializer)) - - -@dataclass -class PluginAuthConfigurationIdcAuthConfiguration: - """ - Information about the IAM Identity Center Application used to configure - authentication for a plugin. - """ - - value: IdcAuthConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PLUGIN_AUTH_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_PLUGIN_AUTH_CONFIGURATION.members["idcAuthConfiguration"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=IdcAuthConfiguration.deserialize(deserializer)) - - -@dataclass -class PluginAuthConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -PluginAuthConfiguration = Union[ - PluginAuthConfigurationBasicAuthConfiguration - | PluginAuthConfigurationOAuth2ClientCredentialConfiguration - | PluginAuthConfigurationNoAuthConfiguration - | PluginAuthConfigurationIdcAuthConfiguration - | PluginAuthConfigurationUnknown -] -""" -Authentication configuration information for an Amazon Q Business -plugin. -""" - - -class _PluginAuthConfigurationDeserializer: - _result: PluginAuthConfiguration | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> PluginAuthConfiguration: - self._result = None - deserializer.read_struct(_SCHEMA_PLUGIN_AUTH_CONFIGURATION, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - PluginAuthConfigurationBasicAuthConfiguration.deserialize(de) - ) - - case 1: - self._set_result( - PluginAuthConfigurationOAuth2ClientCredentialConfiguration.deserialize( - de - ) - ) - - case 2: - self._set_result( - PluginAuthConfigurationNoAuthConfiguration.deserialize(de) - ) - - case 3: - self._set_result( - PluginAuthConfigurationIdcAuthConfiguration.deserialize(de) - ) - - case _: - self._set_result( - PluginAuthConfigurationUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: PluginAuthConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class CustomPluginConfiguration: - """Configuration information required to create a custom plugin.""" - - description: str - """A description for your custom plugin configuration.""" - - api_schema_type: str - """The type of OpenAPI schema to use.""" - - api_schema: APISchema | None = None - """ - Contains either details about the S3 object containing the OpenAPI - schema for the action group or the JSON or YAML-formatted payload - defining the schema. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOM_PLUGIN_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CUSTOM_PLUGIN_CONFIGURATION.members["description"], self.description - ) - serializer.write_string( - _SCHEMA_CUSTOM_PLUGIN_CONFIGURATION.members["apiSchemaType"], - self.api_schema_type, - ) - if self.api_schema is not None: - serializer.write_struct( - _SCHEMA_CUSTOM_PLUGIN_CONFIGURATION.members["apiSchema"], - self.api_schema, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["description"] = de.read_string( - _SCHEMA_CUSTOM_PLUGIN_CONFIGURATION.members["description"] - ) - - case 1: - kwargs["api_schema_type"] = APISchemaType( - de.read_string( - _SCHEMA_CUSTOM_PLUGIN_CONFIGURATION.members["apiSchemaType"] - ) - ) - - case 2: - kwargs["api_schema"] = _APISchemaDeserializer().deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CUSTOM_PLUGIN_CONFIGURATION, consumer=_consumer - ) - if "description" not in kwargs: - kwargs["description"] = "" - if "api_schema_type" not in kwargs: - kwargs["api_schema_type"] = APISchemaType._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class CreatePluginInput: - """Dataclass for CreatePluginInput structure.""" - - application_id: str | None = None - """The identifier of the application that will contain the plugin.""" - - display_name: str | None = None - """A the name for your plugin.""" - - type: str | None = None - """The type of plugin you want to create.""" - - auth_configuration: PluginAuthConfiguration | None = None - """ - Authentication configuration information for an Amazon Q Business - plugin. - """ - - server_url: str | None = None - """The source URL used for plugin configuration.""" - - custom_plugin_configuration: CustomPluginConfiguration | None = None - """Contains configuration for a custom plugin.""" - - tags: list[Tag] | None = None - """ - A list of key-value pairs that identify or categorize the data source - connector. You can also use tags to help control access to the data - source connector. Tag keys and values can consist of Unicode letters, - digits, white space, and any of the following symbols: _ . : / = + - @. - """ - - client_token: str | None = None - """ - A token that you provide to identify the request to create your Amazon Q - Business plugin. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_PLUGIN_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_CREATE_PLUGIN_INPUT.members["applicationId"], - self.application_id, - ) - - if self.display_name is not None: - serializer.write_string( - _SCHEMA_CREATE_PLUGIN_INPUT.members["displayName"], self.display_name - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_CREATE_PLUGIN_INPUT.members["type"], self.type - ) - - if self.auth_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_PLUGIN_INPUT.members["authConfiguration"], - self.auth_configuration, - ) - - if self.server_url is not None: - serializer.write_string( - _SCHEMA_CREATE_PLUGIN_INPUT.members["serverUrl"], self.server_url - ) - - if self.custom_plugin_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_PLUGIN_INPUT.members["customPluginConfiguration"], - self.custom_plugin_configuration, - ) - - if self.tags is not None: - _serialize_tags( - serializer, _SCHEMA_CREATE_PLUGIN_INPUT.members["tags"], self.tags - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_PLUGIN_INPUT.members["clientToken"], self.client_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_CREATE_PLUGIN_INPUT.members["applicationId"] - ) - - case 1: - kwargs["display_name"] = de.read_string( - _SCHEMA_CREATE_PLUGIN_INPUT.members["displayName"] - ) - - case 2: - kwargs["type"] = PluginType( - de.read_string(_SCHEMA_CREATE_PLUGIN_INPUT.members["type"]) - ) - - case 3: - kwargs["auth_configuration"] = ( - _PluginAuthConfigurationDeserializer().deserialize(de) - ) - - case 4: - kwargs["server_url"] = de.read_string( - _SCHEMA_CREATE_PLUGIN_INPUT.members["serverUrl"] - ) - - case 5: - kwargs["custom_plugin_configuration"] = ( - CustomPluginConfiguration.deserialize(de) - ) - - case 6: - kwargs["tags"] = _deserialize_tags( - de, _SCHEMA_CREATE_PLUGIN_INPUT.members["tags"] - ) - - case 7: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_PLUGIN_INPUT.members["clientToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_PLUGIN_INPUT, consumer=_consumer) - return kwargs - - -class PluginBuildStatus(UnknownEnumMixin, StrEnum): - READY = "READY" - CREATE_IN_PROGRESS = "CREATE_IN_PROGRESS" - CREATE_FAILED = "CREATE_FAILED" - UPDATE_IN_PROGRESS = "UPDATE_IN_PROGRESS" - UPDATE_FAILED = "UPDATE_FAILED" - DELETE_IN_PROGRESS = "DELETE_IN_PROGRESS" - DELETE_FAILED = "DELETE_FAILED" - - -@dataclass(kw_only=True) -class CreatePluginOutput: - """Dataclass for CreatePluginOutput structure.""" - - plugin_id: str | None = None - """The identifier of the plugin created.""" - - plugin_arn: str | None = None - """The Amazon Resource Name (ARN) of a plugin.""" - - build_status: str | None = None - """The current status of a plugin. A plugin is modified asynchronously.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_PLUGIN_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.plugin_id is not None: - serializer.write_string( - _SCHEMA_CREATE_PLUGIN_OUTPUT.members["pluginId"], self.plugin_id - ) - - if self.plugin_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_PLUGIN_OUTPUT.members["pluginArn"], self.plugin_arn - ) - - if self.build_status is not None: - serializer.write_string( - _SCHEMA_CREATE_PLUGIN_OUTPUT.members["buildStatus"], self.build_status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["plugin_id"] = de.read_string( - _SCHEMA_CREATE_PLUGIN_OUTPUT.members["pluginId"] - ) - - case 1: - kwargs["plugin_arn"] = de.read_string( - _SCHEMA_CREATE_PLUGIN_OUTPUT.members["pluginArn"] - ) - - case 2: - kwargs["build_status"] = PluginBuildStatus( - de.read_string( - _SCHEMA_CREATE_PLUGIN_OUTPUT.members["buildStatus"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_PLUGIN_OUTPUT, consumer=_consumer) - return kwargs - - -CREATE_PLUGIN = APIOperation( - input=CreatePluginInput, - output=CreatePluginOutput, - schema=_SCHEMA_CREATE_PLUGIN, - input_schema=_SCHEMA_CREATE_PLUGIN_INPUT, - output_schema=_SCHEMA_CREATE_PLUGIN_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.qbusiness#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeletePluginInput: - """Dataclass for DeletePluginInput structure.""" - - application_id: str | None = None - """The identifier the application attached to the Amazon Q Business plugin.""" - - plugin_id: str | None = None - """The identifier of the plugin being deleted.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_PLUGIN_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_DELETE_PLUGIN_INPUT.members["applicationId"], - self.application_id, - ) - - if self.plugin_id is not None: - serializer.write_string( - _SCHEMA_DELETE_PLUGIN_INPUT.members["pluginId"], self.plugin_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_DELETE_PLUGIN_INPUT.members["applicationId"] - ) - - case 1: - kwargs["plugin_id"] = de.read_string( - _SCHEMA_DELETE_PLUGIN_INPUT.members["pluginId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_PLUGIN_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeletePluginOutput: - """Dataclass for DeletePluginOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_PLUGIN_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_PLUGIN_OUTPUT, consumer=_consumer) - return kwargs - - -DELETE_PLUGIN = APIOperation( - input=DeletePluginInput, - output=DeletePluginOutput, - schema=_SCHEMA_DELETE_PLUGIN, - input_schema=_SCHEMA_DELETE_PLUGIN_INPUT, - output_schema=_SCHEMA_DELETE_PLUGIN_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetPluginInput: - """Dataclass for GetPluginInput structure.""" - - application_id: str | None = None - """The identifier of the application which contains the plugin.""" - - plugin_id: str | None = None - """The identifier of the plugin.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_PLUGIN_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_GET_PLUGIN_INPUT.members["applicationId"], self.application_id - ) - - if self.plugin_id is not None: - serializer.write_string( - _SCHEMA_GET_PLUGIN_INPUT.members["pluginId"], self.plugin_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_GET_PLUGIN_INPUT.members["applicationId"] - ) - - case 1: - kwargs["plugin_id"] = de.read_string( - _SCHEMA_GET_PLUGIN_INPUT.members["pluginId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_PLUGIN_INPUT, consumer=_consumer) - return kwargs - - -class PluginState(UnknownEnumMixin, StrEnum): - ENABLED = "ENABLED" - DISABLED = "DISABLED" - - -@dataclass(kw_only=True) -class GetPluginOutput: - """Dataclass for GetPluginOutput structure.""" - - application_id: str | None = None - """The identifier of the application which contains the plugin.""" - - plugin_id: str | None = None - """The identifier of the plugin.""" - - display_name: str | None = None - """The name of the plugin.""" - - type: str | None = None - """The type of the plugin.""" - - server_url: str | None = None - """The source URL used for plugin configuration.""" - - auth_configuration: PluginAuthConfiguration | None = None - """ - Authentication configuration information for an Amazon Q Business - plugin. - """ - - custom_plugin_configuration: CustomPluginConfiguration | None = None - """Configuration information required to create a custom plugin.""" - - build_status: str | None = None - """The current status of a plugin. A plugin is modified asynchronously.""" - - plugin_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the role with permission to access - resources needed to create the plugin. - """ - - state: str | None = None - """The current state of the plugin.""" - - created_at: datetime | None = None - """The timestamp for when the plugin was created.""" - - updated_at: datetime | None = None - """The timestamp for when the plugin was last updated.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_PLUGIN_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_GET_PLUGIN_OUTPUT.members["applicationId"], self.application_id - ) - - if self.plugin_id is not None: - serializer.write_string( - _SCHEMA_GET_PLUGIN_OUTPUT.members["pluginId"], self.plugin_id - ) - - if self.display_name is not None: - serializer.write_string( - _SCHEMA_GET_PLUGIN_OUTPUT.members["displayName"], self.display_name - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_GET_PLUGIN_OUTPUT.members["type"], self.type - ) - - if self.server_url is not None: - serializer.write_string( - _SCHEMA_GET_PLUGIN_OUTPUT.members["serverUrl"], self.server_url - ) - - if self.auth_configuration is not None: - serializer.write_struct( - _SCHEMA_GET_PLUGIN_OUTPUT.members["authConfiguration"], - self.auth_configuration, - ) - - if self.custom_plugin_configuration is not None: - serializer.write_struct( - _SCHEMA_GET_PLUGIN_OUTPUT.members["customPluginConfiguration"], - self.custom_plugin_configuration, - ) - - if self.build_status is not None: - serializer.write_string( - _SCHEMA_GET_PLUGIN_OUTPUT.members["buildStatus"], self.build_status - ) - - if self.plugin_arn is not None: - serializer.write_string( - _SCHEMA_GET_PLUGIN_OUTPUT.members["pluginArn"], self.plugin_arn - ) - - if self.state is not None: - serializer.write_string( - _SCHEMA_GET_PLUGIN_OUTPUT.members["state"], self.state - ) - - if self.created_at is not None: - serializer.write_timestamp( - _SCHEMA_GET_PLUGIN_OUTPUT.members["createdAt"], self.created_at - ) - - if self.updated_at is not None: - serializer.write_timestamp( - _SCHEMA_GET_PLUGIN_OUTPUT.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_GET_PLUGIN_OUTPUT.members["applicationId"] - ) - - case 1: - kwargs["plugin_id"] = de.read_string( - _SCHEMA_GET_PLUGIN_OUTPUT.members["pluginId"] - ) - - case 2: - kwargs["display_name"] = de.read_string( - _SCHEMA_GET_PLUGIN_OUTPUT.members["displayName"] - ) - - case 3: - kwargs["type"] = PluginType( - de.read_string(_SCHEMA_GET_PLUGIN_OUTPUT.members["type"]) - ) - - case 4: - kwargs["server_url"] = de.read_string( - _SCHEMA_GET_PLUGIN_OUTPUT.members["serverUrl"] - ) - - case 5: - kwargs["auth_configuration"] = ( - _PluginAuthConfigurationDeserializer().deserialize(de) - ) - - case 6: - kwargs["custom_plugin_configuration"] = ( - CustomPluginConfiguration.deserialize(de) - ) - - case 7: - kwargs["build_status"] = PluginBuildStatus( - de.read_string(_SCHEMA_GET_PLUGIN_OUTPUT.members["buildStatus"]) - ) - - case 8: - kwargs["plugin_arn"] = de.read_string( - _SCHEMA_GET_PLUGIN_OUTPUT.members["pluginArn"] - ) - - case 9: - kwargs["state"] = PluginState( - de.read_string(_SCHEMA_GET_PLUGIN_OUTPUT.members["state"]) - ) - - case 10: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_PLUGIN_OUTPUT.members["createdAt"] - ) - - case 11: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_GET_PLUGIN_OUTPUT.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_PLUGIN_OUTPUT, consumer=_consumer) - return kwargs - - -GET_PLUGIN = APIOperation( - input=GetPluginInput, - output=GetPluginOutput, - schema=_SCHEMA_GET_PLUGIN, - input_schema=_SCHEMA_GET_PLUGIN_INPUT, - output_schema=_SCHEMA_GET_PLUGIN_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListPluginsInput: - """Dataclass for ListPluginsInput structure.""" - - application_id: str | None = None - """The identifier of the application the plugin is attached to.""" - - next_token: str | None = None - """ - If the `maxResults` response was incomplete because there is more data - to retrieve, Amazon Q Business returns a pagination token in the - response. You can use this pagination token to retrieve the next set of - plugins. - """ - - max_results: int | None = None - """The maximum number of documents to return.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_PLUGINS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_LIST_PLUGINS_INPUT.members["applicationId"], self.application_id - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_PLUGINS_INPUT.members["nextToken"], self.next_token - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_PLUGINS_INPUT.members["maxResults"], self.max_results - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_LIST_PLUGINS_INPUT.members["applicationId"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_PLUGINS_INPUT.members["nextToken"] - ) - - case 2: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_PLUGINS_INPUT.members["maxResults"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_PLUGINS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Plugin: - """Information about an Amazon Q Business plugin and its configuration.""" - - plugin_id: str | None = None - """The identifier of the plugin.""" - - display_name: str | None = None - """The name of the plugin.""" - - type: str | None = None - """The type of the plugin.""" - - server_url: str | None = None - """The plugin server URL used for configuration.""" - - state: str | None = None - """The current status of the plugin.""" - - build_status: str | None = None - """The status of the plugin.""" - - created_at: datetime | None = None - """The timestamp for when the plugin was created.""" - - updated_at: datetime | None = None - """The timestamp for when the plugin was last updated.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PLUGIN, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.plugin_id is not None: - serializer.write_string(_SCHEMA_PLUGIN.members["pluginId"], self.plugin_id) - - if self.display_name is not None: - serializer.write_string( - _SCHEMA_PLUGIN.members["displayName"], self.display_name - ) - - if self.type is not None: - serializer.write_string(_SCHEMA_PLUGIN.members["type"], self.type) - - if self.server_url is not None: - serializer.write_string( - _SCHEMA_PLUGIN.members["serverUrl"], self.server_url - ) - - if self.state is not None: - serializer.write_string(_SCHEMA_PLUGIN.members["state"], self.state) - - if self.build_status is not None: - serializer.write_string( - _SCHEMA_PLUGIN.members["buildStatus"], self.build_status - ) - - if self.created_at is not None: - serializer.write_timestamp( - _SCHEMA_PLUGIN.members["createdAt"], self.created_at - ) - - if self.updated_at is not None: - serializer.write_timestamp( - _SCHEMA_PLUGIN.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["plugin_id"] = de.read_string( - _SCHEMA_PLUGIN.members["pluginId"] - ) - - case 1: - kwargs["display_name"] = de.read_string( - _SCHEMA_PLUGIN.members["displayName"] - ) - - case 2: - kwargs["type"] = PluginType( - de.read_string(_SCHEMA_PLUGIN.members["type"]) - ) - - case 3: - kwargs["server_url"] = de.read_string( - _SCHEMA_PLUGIN.members["serverUrl"] - ) - - case 4: - kwargs["state"] = PluginState( - de.read_string(_SCHEMA_PLUGIN.members["state"]) - ) - - case 5: - kwargs["build_status"] = PluginBuildStatus( - de.read_string(_SCHEMA_PLUGIN.members["buildStatus"]) - ) - - case 6: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_PLUGIN.members["createdAt"] - ) - - case 7: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_PLUGIN.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PLUGIN, consumer=_consumer) - return kwargs - - -def _serialize_plugins( - serializer: ShapeSerializer, schema: Schema, value: list[Plugin] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_plugins( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Plugin]: - result: list[Plugin] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Plugin.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListPluginsOutput: - """Dataclass for ListPluginsOutput structure.""" - - next_token: str | None = None - """ - If the `maxResults` response was incomplete because there is more data - to retrieve, Amazon Q Business returns a pagination token in the - response. You can use this pagination token to retrieve the next set of - plugins. - """ - - plugins: list[Plugin] | None = None - """Information about a configured plugin.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_PLUGINS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_PLUGINS_OUTPUT.members["nextToken"], self.next_token - ) - - if self.plugins is not None: - _serialize_plugins( - serializer, _SCHEMA_LIST_PLUGINS_OUTPUT.members["plugins"], self.plugins - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_PLUGINS_OUTPUT.members["nextToken"] - ) - - case 1: - kwargs["plugins"] = _deserialize_plugins( - de, _SCHEMA_LIST_PLUGINS_OUTPUT.members["plugins"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_PLUGINS_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_PLUGINS = APIOperation( - input=ListPluginsInput, - output=ListPluginsOutput, - schema=_SCHEMA_LIST_PLUGINS, - input_schema=_SCHEMA_LIST_PLUGINS_INPUT, - output_schema=_SCHEMA_LIST_PLUGINS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdatePluginInput: - """Dataclass for UpdatePluginInput structure.""" - - application_id: str | None = None - """The identifier of the application the plugin is attached to.""" - - plugin_id: str | None = None - """The identifier of the plugin.""" - - display_name: str | None = None - """The name of the plugin.""" - - state: str | None = None - """The status of the plugin.""" - - server_url: str | None = None - """The source URL used for plugin configuration.""" - - custom_plugin_configuration: CustomPluginConfiguration | None = None - """The configuration for a custom plugin.""" - - auth_configuration: PluginAuthConfiguration | None = None - """The authentication configuration the plugin is using.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_PLUGIN_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_PLUGIN_INPUT.members["applicationId"], - self.application_id, - ) - - if self.plugin_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_PLUGIN_INPUT.members["pluginId"], self.plugin_id - ) - - if self.display_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_PLUGIN_INPUT.members["displayName"], self.display_name - ) - - if self.state is not None: - serializer.write_string( - _SCHEMA_UPDATE_PLUGIN_INPUT.members["state"], self.state - ) - - if self.server_url is not None: - serializer.write_string( - _SCHEMA_UPDATE_PLUGIN_INPUT.members["serverUrl"], self.server_url - ) - - if self.custom_plugin_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_PLUGIN_INPUT.members["customPluginConfiguration"], - self.custom_plugin_configuration, - ) - - if self.auth_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_PLUGIN_INPUT.members["authConfiguration"], - self.auth_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_UPDATE_PLUGIN_INPUT.members["applicationId"] - ) - - case 1: - kwargs["plugin_id"] = de.read_string( - _SCHEMA_UPDATE_PLUGIN_INPUT.members["pluginId"] - ) - - case 2: - kwargs["display_name"] = de.read_string( - _SCHEMA_UPDATE_PLUGIN_INPUT.members["displayName"] - ) - - case 3: - kwargs["state"] = PluginState( - de.read_string(_SCHEMA_UPDATE_PLUGIN_INPUT.members["state"]) - ) - - case 4: - kwargs["server_url"] = de.read_string( - _SCHEMA_UPDATE_PLUGIN_INPUT.members["serverUrl"] - ) - - case 5: - kwargs["custom_plugin_configuration"] = ( - CustomPluginConfiguration.deserialize(de) - ) - - case 6: - kwargs["auth_configuration"] = ( - _PluginAuthConfigurationDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_PLUGIN_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdatePluginOutput: - """Dataclass for UpdatePluginOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_PLUGIN_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_PLUGIN_OUTPUT, consumer=_consumer) - return kwargs - - -UPDATE_PLUGIN = APIOperation( - input=UpdatePluginInput, - output=UpdatePluginOutput, - schema=_SCHEMA_UPDATE_PLUGIN, - input_schema=_SCHEMA_UPDATE_PLUGIN_INPUT, - output_schema=_SCHEMA_UPDATE_PLUGIN_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.qbusiness#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class KendraIndexConfiguration: - """Stores an Amazon Kendra index as a retriever.""" - - index_id: str - """The identifier of the Amazon Kendra index.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KENDRA_INDEX_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_KENDRA_INDEX_CONFIGURATION.members["indexId"], self.index_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["index_id"] = de.read_string( - _SCHEMA_KENDRA_INDEX_CONFIGURATION.members["indexId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_KENDRA_INDEX_CONFIGURATION, consumer=_consumer) - if "index_id" not in kwargs: - kwargs["index_id"] = "" - return kwargs - - -class DocumentAttributeBoostingLevel(UnknownEnumMixin, StrEnum): - NONE = "NONE" - LOW = "LOW" - MEDIUM = "MEDIUM" - HIGH = "HIGH" - VERY_HIGH = "VERY_HIGH" - ONE = "ONE" - TWO = "TWO" - - -@dataclass(kw_only=True) -class DateAttributeBoostingConfiguration: - """ - Provides information on boosting `DATE` type document attributes. - - For more information on how boosting document attributes work in Amazon - Q Business, see [Boosting using document - attributes](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/metadata-boosting.html). - """ - - boosting_level: str - """ - Specifies the priority tier ranking of boosting applied to document - attributes. For version 2, this parameter indicates the relative ranking - between boosted fields (ONE being highest priority, TWO being second - highest, etc.) and determines the order in which attributes influence - document ranking in search results. For version 1, this parameter - specifies the boosting intensity. For version 2, boosting intensity - (VERY HIGH, HIGH, MEDIUM, LOW, NONE) are not supported. Note that in - version 2, you are not allowed to boost on only one field and make this - value TWO. - """ - - boosting_duration_in_seconds: int | None = None - """ - Specifies the duration, in seconds, of a boost applies to a `DATE` type - document attribute. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DATE_ATTRIBUTE_BOOSTING_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DATE_ATTRIBUTE_BOOSTING_CONFIGURATION.members["boostingLevel"], - self.boosting_level, - ) - if self.boosting_duration_in_seconds is not None: - serializer.write_long( - _SCHEMA_DATE_ATTRIBUTE_BOOSTING_CONFIGURATION.members[ - "boostingDurationInSeconds" - ], - self.boosting_duration_in_seconds, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["boosting_level"] = DocumentAttributeBoostingLevel( - de.read_string( - _SCHEMA_DATE_ATTRIBUTE_BOOSTING_CONFIGURATION.members[ - "boostingLevel" - ] - ) - ) - - case 1: - kwargs["boosting_duration_in_seconds"] = de.read_long( - _SCHEMA_DATE_ATTRIBUTE_BOOSTING_CONFIGURATION.members[ - "boostingDurationInSeconds" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DATE_ATTRIBUTE_BOOSTING_CONFIGURATION, consumer=_consumer - ) - if "boosting_level" not in kwargs: - kwargs["boosting_level"] = DocumentAttributeBoostingLevel._corrected("") - return kwargs - - -class NumberAttributeBoostingType(UnknownEnumMixin, StrEnum): - PRIORITIZE_LARGER_VALUES = "PRIORITIZE_LARGER_VALUES" - PRIORITIZE_SMALLER_VALUES = "PRIORITIZE_SMALLER_VALUES" - - -@dataclass(kw_only=True) -class NumberAttributeBoostingConfiguration: - """ - Provides information on boosting `NUMBER` type document attributes. - - In the current boosting implementation, boosting focuses primarily on - `DATE` attributes for recency and `STRING` attributes for source - prioritization. `NUMBER` attributes can serve as additional boosting - factors when needed, but are not supported when using - `NativeIndexConfiguration` version 2. - - For more information on how boosting document attributes work in Amazon - Q Business, see [Boosting using document - attributes](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/metadata-boosting.html). - """ - - boosting_level: str - """ - Specifies the priority of boosted document attributes in relation to - other boosted attributes. This parameter determines how strongly the - attribute influences document ranking in search results. `NUMBER` - attributes can serve as additional boosting factors when needed, but are - not supported when using `NativeIndexConfiguration` version 2. - """ - - boosting_type: str | None = None - """ - Specifies whether higher or lower numeric values should be prioritized - when boosting. Valid values are ASCENDING (higher numbers are more - important) and DESCENDING (lower numbers are more important). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_NUMBER_ATTRIBUTE_BOOSTING_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_NUMBER_ATTRIBUTE_BOOSTING_CONFIGURATION.members["boostingLevel"], - self.boosting_level, - ) - if self.boosting_type is not None: - serializer.write_string( - _SCHEMA_NUMBER_ATTRIBUTE_BOOSTING_CONFIGURATION.members["boostingType"], - self.boosting_type, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["boosting_level"] = DocumentAttributeBoostingLevel( - de.read_string( - _SCHEMA_NUMBER_ATTRIBUTE_BOOSTING_CONFIGURATION.members[ - "boostingLevel" - ] - ) - ) - - case 1: - kwargs["boosting_type"] = NumberAttributeBoostingType( - de.read_string( - _SCHEMA_NUMBER_ATTRIBUTE_BOOSTING_CONFIGURATION.members[ - "boostingType" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_NUMBER_ATTRIBUTE_BOOSTING_CONFIGURATION, consumer=_consumer - ) - if "boosting_level" not in kwargs: - kwargs["boosting_level"] = DocumentAttributeBoostingLevel._corrected("") - return kwargs - - -class StringAttributeValueBoostingLevel(UnknownEnumMixin, StrEnum): - LOW = "LOW" - MEDIUM = "MEDIUM" - HIGH = "HIGH" - VERY_HIGH = "VERY_HIGH" - ONE = "ONE" - TWO = "TWO" - THREE = "THREE" - FOUR = "FOUR" - FIVE = "FIVE" - - -def _serialize_string_attribute_value_boosting( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_string_attribute_value_boosting( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = StringAttributeValueBoostingLevel(d.read_string(value_schema)) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class StringAttributeBoostingConfiguration: - """ - Provides information on boosting `STRING` type document attributes. - - Note: - For `STRING` and `STRING_LIST` type document attributes to be used for - boosting on the console and the API, they must be enabled for search - using the - [DocumentAttributeConfiguration](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_DocumentAttributeConfiguration.html) - object of the - [UpdateIndex](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_UpdateIndex.html) - API. If you haven't enabled searching on these attributes, you can't - boost attributes of these data types on either the console or the API. - - For more information on how boosting document attributes work in Amazon - Q Business, see [Boosting using document - attributes](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/metadata-boosting.html). - """ - - boosting_level: str - """ - Specifies the priority tier ranking of boosting applied to document - attributes. For version 2, this parameter indicates the relative ranking - between boosted fields (ONE being highest priority, TWO being second - highest, etc.) and determines the order in which attributes influence - document ranking in search results. For version 1, this parameter - specifies the boosting intensity. For version 2, boosting intensity - (VERY HIGH, HIGH, MEDIUM, LOW, NONE) are not supported. Note that in - version 2, you are not allowed to boost on only one field and make this - value TWO. - """ - - attribute_value_boosting: dict[str, str] | None = None - """ - Specifies specific values of a `STRING` type document attribute being - boosted. When using `NativeIndexConfiguration` version 2, you can - specify up to five values in order of priority. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STRING_ATTRIBUTE_BOOSTING_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_STRING_ATTRIBUTE_BOOSTING_CONFIGURATION.members["boostingLevel"], - self.boosting_level, - ) - if self.attribute_value_boosting is not None: - _serialize_string_attribute_value_boosting( - serializer, - _SCHEMA_STRING_ATTRIBUTE_BOOSTING_CONFIGURATION.members[ - "attributeValueBoosting" - ], - self.attribute_value_boosting, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["boosting_level"] = DocumentAttributeBoostingLevel( - de.read_string( - _SCHEMA_STRING_ATTRIBUTE_BOOSTING_CONFIGURATION.members[ - "boostingLevel" - ] - ) - ) - - case 1: - kwargs["attribute_value_boosting"] = ( - _deserialize_string_attribute_value_boosting( - de, - _SCHEMA_STRING_ATTRIBUTE_BOOSTING_CONFIGURATION.members[ - "attributeValueBoosting" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_STRING_ATTRIBUTE_BOOSTING_CONFIGURATION, consumer=_consumer - ) - if "boosting_level" not in kwargs: - kwargs["boosting_level"] = DocumentAttributeBoostingLevel._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class StringListAttributeBoostingConfiguration: - """ - Provides information on boosting `STRING_LIST` type document attributes. - - In the current boosting implementation, boosting focuses primarily on - `DATE` attributes for recency and `STRING` attributes for source - prioritization. `STRING_LIST` attributes can serve as additional - boosting factors when needed, but are not supported when using - `NativeIndexConfiguration` version 2. - - Note: - For `STRING` and `STRING_LIST` type document attributes to be used for - boosting on the console and the API, they must be enabled for search - using the - [DocumentAttributeConfiguration](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_DocumentAttributeConfiguration.html) - object of the - [UpdateIndex](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_UpdateIndex.html) - API. If you haven't enabled searching on these attributes, you can't - boost attributes of these data types on either the console or the API. - - For more information on how boosting document attributes work in Amazon - Q Business, see [Boosting using document - attributes](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/metadata-boosting.html). - """ - - boosting_level: str - """ - Specifies the priority of boosted document attributes in relation to - other boosted attributes. This parameter determines how strongly the - attribute influences document ranking in search results. `STRING_LIST` - attributes can serve as additional boosting factors when needed, but are - not supported when using `NativeIndexConfiguration` version 2. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_STRING_LIST_ATTRIBUTE_BOOSTING_CONFIGURATION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_STRING_LIST_ATTRIBUTE_BOOSTING_CONFIGURATION.members[ - "boostingLevel" - ], - self.boosting_level, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["boosting_level"] = DocumentAttributeBoostingLevel( - de.read_string( - _SCHEMA_STRING_LIST_ATTRIBUTE_BOOSTING_CONFIGURATION.members[ - "boostingLevel" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_STRING_LIST_ATTRIBUTE_BOOSTING_CONFIGURATION, consumer=_consumer - ) - if "boosting_level" not in kwargs: - kwargs["boosting_level"] = DocumentAttributeBoostingLevel._corrected("") - return kwargs - - -@dataclass -class DocumentAttributeBoostingConfigurationNumberConfiguration: - """ - Provides information on boosting `NUMBER` type document attributes. - - `NUMBER` attributes are not supported when using - `NativeIndexConfiguration` version 2, which focuses on `DATE` attributes - for recency and `STRING` attributes for source prioritization. - """ - - value: NumberAttributeBoostingConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_ATTRIBUTE_BOOSTING_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DOCUMENT_ATTRIBUTE_BOOSTING_CONFIGURATION.members[ - "numberConfiguration" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=NumberAttributeBoostingConfiguration.deserialize(deserializer)) - - -@dataclass -class DocumentAttributeBoostingConfigurationStringConfiguration: - """ - Provides information on boosting `STRING` type document attributes. - - Version 2 assigns priority tiers to `STRING` attributes, establishing - clear hierarchical relationships with other boosted attributes. - """ - - value: StringAttributeBoostingConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_ATTRIBUTE_BOOSTING_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DOCUMENT_ATTRIBUTE_BOOSTING_CONFIGURATION.members[ - "stringConfiguration" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=StringAttributeBoostingConfiguration.deserialize(deserializer)) - - -@dataclass -class DocumentAttributeBoostingConfigurationDateConfiguration: - """ - Provides information on boosting `DATE` type document attributes. - - Version 2 assigns priority tiers to `DATE` attributes, establishing - clear hierarchical relationships with other boosted attributes. - """ - - value: DateAttributeBoostingConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_ATTRIBUTE_BOOSTING_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DOCUMENT_ATTRIBUTE_BOOSTING_CONFIGURATION.members[ - "dateConfiguration" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=DateAttributeBoostingConfiguration.deserialize(deserializer)) - - -@dataclass -class DocumentAttributeBoostingConfigurationStringListConfiguration: - """ - Provides information on boosting `STRING_LIST` type document attributes. - - `STRING_LIST` attributes are not supported when using - `NativeIndexConfiguration` version 2, which focuses on `DATE` attributes - for recency and `STRING` attributes for source prioritization. - """ - - value: StringListAttributeBoostingConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_ATTRIBUTE_BOOSTING_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DOCUMENT_ATTRIBUTE_BOOSTING_CONFIGURATION.members[ - "stringListConfiguration" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=StringListAttributeBoostingConfiguration.deserialize(deserializer) - ) - - -@dataclass -class DocumentAttributeBoostingConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -DocumentAttributeBoostingConfiguration = Union[ - DocumentAttributeBoostingConfigurationNumberConfiguration - | DocumentAttributeBoostingConfigurationStringConfiguration - | DocumentAttributeBoostingConfigurationDateConfiguration - | DocumentAttributeBoostingConfigurationStringListConfiguration - | DocumentAttributeBoostingConfigurationUnknown -] -""" -Provides information on boosting supported Amazon Q Business document -attribute types. When an end user chat query matches document attributes -that have been boosted, Amazon Q Business prioritizes generating -responses from content that matches the boosted document attributes. - -In version 2, boosting uses numeric values (ONE, TWO) to indicate -priority tiers that establish clear hierarchical relationships between -boosted attributes. This allows for more precise control over how -different attributes influence search results. - -Note: - For `STRING` and `STRING_LIST` type document attributes to be used for - boosting on the console and the API, they must be enabled for search - using the - [DocumentAttributeConfiguration](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_DocumentAttributeConfiguration.html) - object of the - [UpdateIndex](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_UpdateIndex.html) - API. If you haven't enabled searching on these attributes, you can't - boost attributes of these data types on either the console or the API. - -For more information on how boosting document attributes work in Amazon -Q Business, see [Boosting using document -attributes](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/metadata-boosting.html). -""" - - -class _DocumentAttributeBoostingConfigurationDeserializer: - _result: DocumentAttributeBoostingConfiguration | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> DocumentAttributeBoostingConfiguration: - self._result = None - deserializer.read_struct( - _SCHEMA_DOCUMENT_ATTRIBUTE_BOOSTING_CONFIGURATION, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - DocumentAttributeBoostingConfigurationNumberConfiguration.deserialize( - de - ) - ) - - case 1: - self._set_result( - DocumentAttributeBoostingConfigurationStringConfiguration.deserialize( - de - ) - ) - - case 2: - self._set_result( - DocumentAttributeBoostingConfigurationDateConfiguration.deserialize( - de - ) - ) - - case 3: - self._set_result( - DocumentAttributeBoostingConfigurationStringListConfiguration.deserialize( - de - ) - ) - - case _: - self._set_result( - DocumentAttributeBoostingConfigurationUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: DocumentAttributeBoostingConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_document_attribute_boosting_override_map( - serializer: ShapeSerializer, - schema: Schema, - value: dict[str, DocumentAttributeBoostingConfiguration], -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_struct(value_schema, v)) - - -def _deserialize_document_attribute_boosting_override_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, DocumentAttributeBoostingConfiguration]: - result: dict[str, DocumentAttributeBoostingConfiguration] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = ( - _DocumentAttributeBoostingConfigurationDeserializer().deserialize(d) - ) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class NativeIndexConfiguration: - """Configuration information for an Amazon Q Business index.""" - - index_id: str - """The identifier for the Amazon Q Business index.""" - - version: int | None = None - """ - A read-only field that specifies the version of the - `NativeIndexConfiguration`. - - Amazon Q Business introduces enhanced document retrieval capabilities in - version 2 of `NativeIndexConfiguration`, focusing on streamlined - metadata boosting that prioritizes recency and source relevance to - deliver more accurate responses to your queries. Version 2 has the - following differences from version 1: - - - Version 2 supports a single Date field (created_at OR last_updated_at) - for recency boosting - - - Version 2 supports a single String field with an ordered list of up to - 5 values - - - Version 2 introduces number-based boost levels (ONE, TWO) alongside - the text-based levels - - - Version 2 allows specifying prioritization between Date and String - fields - - - Version 2 maintains backward compatibility with existing - configurations - """ - - boosting_override: dict[str, DocumentAttributeBoostingConfiguration] | None = None - """ - Overrides the default boosts applied by Amazon Q Business to supported - document attribute data types. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_NATIVE_INDEX_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_NATIVE_INDEX_CONFIGURATION.members["indexId"], self.index_id - ) - if self.version is not None: - serializer.write_long( - _SCHEMA_NATIVE_INDEX_CONFIGURATION.members["version"], self.version - ) - - if self.boosting_override is not None: - _serialize_document_attribute_boosting_override_map( - serializer, - _SCHEMA_NATIVE_INDEX_CONFIGURATION.members["boostingOverride"], - self.boosting_override, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["index_id"] = de.read_string( - _SCHEMA_NATIVE_INDEX_CONFIGURATION.members["indexId"] - ) - - case 1: - kwargs["version"] = de.read_long( - _SCHEMA_NATIVE_INDEX_CONFIGURATION.members["version"] - ) - - case 2: - kwargs["boosting_override"] = ( - _deserialize_document_attribute_boosting_override_map( - de, - _SCHEMA_NATIVE_INDEX_CONFIGURATION.members[ - "boostingOverride" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_NATIVE_INDEX_CONFIGURATION, consumer=_consumer) - if "index_id" not in kwargs: - kwargs["index_id"] = "" - return kwargs - - -@dataclass -class RetrieverConfigurationNativeIndexConfiguration: - """ - Provides information on how a Amazon Q Business index used as a - retriever for your Amazon Q Business application is configured. - """ - - value: NativeIndexConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVER_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RETRIEVER_CONFIGURATION.members["nativeIndexConfiguration"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=NativeIndexConfiguration.deserialize(deserializer)) - - -@dataclass -class RetrieverConfigurationKendraIndexConfiguration: - """ - Provides information on how the Amazon Kendra index used as a retriever - for your Amazon Q Business application is configured. - """ - - value: KendraIndexConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVER_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RETRIEVER_CONFIGURATION.members["kendraIndexConfiguration"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=KendraIndexConfiguration.deserialize(deserializer)) - - -@dataclass -class RetrieverConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -RetrieverConfiguration = Union[ - RetrieverConfigurationNativeIndexConfiguration - | RetrieverConfigurationKendraIndexConfiguration - | RetrieverConfigurationUnknown -] -""" -Provides information on how the retriever used for your Amazon Q -Business application is configured. -""" - - -class _RetrieverConfigurationDeserializer: - _result: RetrieverConfiguration | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> RetrieverConfiguration: - self._result = None - deserializer.read_struct(_SCHEMA_RETRIEVER_CONFIGURATION, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - RetrieverConfigurationNativeIndexConfiguration.deserialize(de) - ) - - case 1: - self._set_result( - RetrieverConfigurationKendraIndexConfiguration.deserialize(de) - ) - - case _: - self._set_result( - RetrieverConfigurationUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: RetrieverConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class RetrieverType(UnknownEnumMixin, StrEnum): - NATIVE_INDEX = "NATIVE_INDEX" - KENDRA_INDEX = "KENDRA_INDEX" - - -@dataclass(kw_only=True) -class CreateRetrieverInput: - """Dataclass for CreateRetrieverInput structure.""" - - application_id: str | None = None - """The identifier of your Amazon Q Business application.""" - - type: str | None = None - """The type of retriever you are using.""" - - display_name: str | None = None - """The name of your retriever.""" - - configuration: RetrieverConfiguration | None = None - """ - Provides information on how the retriever used for your Amazon Q - Business application is configured. - """ - - role_arn: str | None = None - """ - The ARN of an IAM role used by Amazon Q Business to access the basic - authentication credentials stored in a Secrets Manager secret. - """ - - client_token: str | None = None - """ - A token that you provide to identify the request to create your Amazon Q - Business application retriever. - """ - - tags: list[Tag] | None = None - """ - A list of key-value pairs that identify or categorize the retriever. You - can also use tags to help control access to the retriever. Tag keys and - values can consist of Unicode letters, digits, white space, and any of - the following symbols: _ . : / = + - @. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_RETRIEVER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_CREATE_RETRIEVER_INPUT.members["applicationId"], - self.application_id, - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_CREATE_RETRIEVER_INPUT.members["type"], self.type - ) - - if self.display_name is not None: - serializer.write_string( - _SCHEMA_CREATE_RETRIEVER_INPUT.members["displayName"], self.display_name - ) - - if self.configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_RETRIEVER_INPUT.members["configuration"], - self.configuration, - ) - - if self.role_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_RETRIEVER_INPUT.members["roleArn"], self.role_arn - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_RETRIEVER_INPUT.members["clientToken"], self.client_token - ) - - if self.tags is not None: - _serialize_tags( - serializer, _SCHEMA_CREATE_RETRIEVER_INPUT.members["tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_CREATE_RETRIEVER_INPUT.members["applicationId"] - ) - - case 1: - kwargs["type"] = RetrieverType( - de.read_string(_SCHEMA_CREATE_RETRIEVER_INPUT.members["type"]) - ) - - case 2: - kwargs["display_name"] = de.read_string( - _SCHEMA_CREATE_RETRIEVER_INPUT.members["displayName"] - ) - - case 3: - kwargs["configuration"] = ( - _RetrieverConfigurationDeserializer().deserialize(de) - ) - - case 4: - kwargs["role_arn"] = de.read_string( - _SCHEMA_CREATE_RETRIEVER_INPUT.members["roleArn"] - ) - - case 5: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_RETRIEVER_INPUT.members["clientToken"] - ) - - case 6: - kwargs["tags"] = _deserialize_tags( - de, _SCHEMA_CREATE_RETRIEVER_INPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_RETRIEVER_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CreateRetrieverOutput: - """Dataclass for CreateRetrieverOutput structure.""" - - retriever_id: str | None = None - """The identifier of the retriever you are using.""" - - retriever_arn: str | None = None - """ - The Amazon Resource Name (ARN) of an IAM role associated with a - retriever. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_RETRIEVER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.retriever_id is not None: - serializer.write_string( - _SCHEMA_CREATE_RETRIEVER_OUTPUT.members["retrieverId"], - self.retriever_id, - ) - - if self.retriever_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_RETRIEVER_OUTPUT.members["retrieverArn"], - self.retriever_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["retriever_id"] = de.read_string( - _SCHEMA_CREATE_RETRIEVER_OUTPUT.members["retrieverId"] - ) - - case 1: - kwargs["retriever_arn"] = de.read_string( - _SCHEMA_CREATE_RETRIEVER_OUTPUT.members["retrieverArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_RETRIEVER_OUTPUT, consumer=_consumer) - return kwargs - - -CREATE_RETRIEVER = APIOperation( - input=CreateRetrieverInput, - output=CreateRetrieverOutput, - schema=_SCHEMA_CREATE_RETRIEVER, - input_schema=_SCHEMA_CREATE_RETRIEVER_INPUT, - output_schema=_SCHEMA_CREATE_RETRIEVER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.qbusiness#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteRetrieverInput: - """Dataclass for DeleteRetrieverInput structure.""" - - application_id: str | None = None - """The identifier of the Amazon Q Business application using the retriever.""" - - retriever_id: str | None = None - """The identifier of the retriever being deleted.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_RETRIEVER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_DELETE_RETRIEVER_INPUT.members["applicationId"], - self.application_id, - ) - - if self.retriever_id is not None: - serializer.write_string( - _SCHEMA_DELETE_RETRIEVER_INPUT.members["retrieverId"], self.retriever_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_DELETE_RETRIEVER_INPUT.members["applicationId"] - ) - - case 1: - kwargs["retriever_id"] = de.read_string( - _SCHEMA_DELETE_RETRIEVER_INPUT.members["retrieverId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_RETRIEVER_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteRetrieverOutput: - """Dataclass for DeleteRetrieverOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_RETRIEVER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_RETRIEVER_OUTPUT, consumer=_consumer) - return kwargs - - -DELETE_RETRIEVER = APIOperation( - input=DeleteRetrieverInput, - output=DeleteRetrieverOutput, - schema=_SCHEMA_DELETE_RETRIEVER, - input_schema=_SCHEMA_DELETE_RETRIEVER_INPUT, - output_schema=_SCHEMA_DELETE_RETRIEVER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetRetrieverInput: - """Dataclass for GetRetrieverInput structure.""" - - application_id: str | None = None - """The identifier of the Amazon Q Business application using the retriever.""" - - retriever_id: str | None = None - """The identifier of the retriever.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_RETRIEVER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_GET_RETRIEVER_INPUT.members["applicationId"], - self.application_id, - ) - - if self.retriever_id is not None: - serializer.write_string( - _SCHEMA_GET_RETRIEVER_INPUT.members["retrieverId"], self.retriever_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_GET_RETRIEVER_INPUT.members["applicationId"] - ) - - case 1: - kwargs["retriever_id"] = de.read_string( - _SCHEMA_GET_RETRIEVER_INPUT.members["retrieverId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_RETRIEVER_INPUT, consumer=_consumer) - return kwargs - - -class RetrieverStatus(UnknownEnumMixin, StrEnum): - CREATING = "CREATING" - ACTIVE = "ACTIVE" - FAILED = "FAILED" - - -@dataclass(kw_only=True) -class GetRetrieverOutput: - """Dataclass for GetRetrieverOutput structure.""" - - application_id: str | None = None - """The identifier of the Amazon Q Business application using the retriever.""" - - retriever_id: str | None = None - """The identifier of the retriever.""" - - retriever_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the IAM role associated with the - retriever. - """ - - type: str | None = None - """The type of the retriever.""" - - status: str | None = None - """The status of the retriever.""" - - display_name: str | None = None - """The name of the retriever.""" - - configuration: RetrieverConfiguration | None = None - """ - Provides information on how the retriever used for your Amazon Q - Business application is configured. - """ - - role_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the role with the permission to access - the retriever and required resources. - """ - - created_at: datetime | None = None - """The Unix timestamp when the retriever was created.""" - - updated_at: datetime | None = None - """The Unix timestamp when the retriever was last updated.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_RETRIEVER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_GET_RETRIEVER_OUTPUT.members["applicationId"], - self.application_id, - ) - - if self.retriever_id is not None: - serializer.write_string( - _SCHEMA_GET_RETRIEVER_OUTPUT.members["retrieverId"], self.retriever_id - ) - - if self.retriever_arn is not None: - serializer.write_string( - _SCHEMA_GET_RETRIEVER_OUTPUT.members["retrieverArn"], self.retriever_arn - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_GET_RETRIEVER_OUTPUT.members["type"], self.type - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_GET_RETRIEVER_OUTPUT.members["status"], self.status - ) - - if self.display_name is not None: - serializer.write_string( - _SCHEMA_GET_RETRIEVER_OUTPUT.members["displayName"], self.display_name - ) - - if self.configuration is not None: - serializer.write_struct( - _SCHEMA_GET_RETRIEVER_OUTPUT.members["configuration"], - self.configuration, - ) - - if self.role_arn is not None: - serializer.write_string( - _SCHEMA_GET_RETRIEVER_OUTPUT.members["roleArn"], self.role_arn - ) - - if self.created_at is not None: - serializer.write_timestamp( - _SCHEMA_GET_RETRIEVER_OUTPUT.members["createdAt"], self.created_at - ) - - if self.updated_at is not None: - serializer.write_timestamp( - _SCHEMA_GET_RETRIEVER_OUTPUT.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_GET_RETRIEVER_OUTPUT.members["applicationId"] - ) - - case 1: - kwargs["retriever_id"] = de.read_string( - _SCHEMA_GET_RETRIEVER_OUTPUT.members["retrieverId"] - ) - - case 2: - kwargs["retriever_arn"] = de.read_string( - _SCHEMA_GET_RETRIEVER_OUTPUT.members["retrieverArn"] - ) - - case 3: - kwargs["type"] = RetrieverType( - de.read_string(_SCHEMA_GET_RETRIEVER_OUTPUT.members["type"]) - ) - - case 4: - kwargs["status"] = RetrieverStatus( - de.read_string(_SCHEMA_GET_RETRIEVER_OUTPUT.members["status"]) - ) - - case 5: - kwargs["display_name"] = de.read_string( - _SCHEMA_GET_RETRIEVER_OUTPUT.members["displayName"] - ) - - case 6: - kwargs["configuration"] = ( - _RetrieverConfigurationDeserializer().deserialize(de) - ) - - case 7: - kwargs["role_arn"] = de.read_string( - _SCHEMA_GET_RETRIEVER_OUTPUT.members["roleArn"] - ) - - case 8: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_RETRIEVER_OUTPUT.members["createdAt"] - ) - - case 9: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_GET_RETRIEVER_OUTPUT.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_RETRIEVER_OUTPUT, consumer=_consumer) - return kwargs - - -GET_RETRIEVER = APIOperation( - input=GetRetrieverInput, - output=GetRetrieverOutput, - schema=_SCHEMA_GET_RETRIEVER, - input_schema=_SCHEMA_GET_RETRIEVER_INPUT, - output_schema=_SCHEMA_GET_RETRIEVER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListRetrieversInput: - """Dataclass for ListRetrieversInput structure.""" - - application_id: str | None = None - """The identifier of the Amazon Q Business application using the retriever.""" - - next_token: str | None = None - """ - If the number of retrievers returned exceeds `maxResults`, Amazon Q - Business returns a next token as a pagination token to retrieve the next - set of retrievers. - """ - - max_results: int | None = None - """The maximum number of retrievers returned.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_RETRIEVERS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_LIST_RETRIEVERS_INPUT.members["applicationId"], - self.application_id, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_RETRIEVERS_INPUT.members["nextToken"], self.next_token - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_RETRIEVERS_INPUT.members["maxResults"], self.max_results - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_LIST_RETRIEVERS_INPUT.members["applicationId"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_RETRIEVERS_INPUT.members["nextToken"] - ) - - case 2: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_RETRIEVERS_INPUT.members["maxResults"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_RETRIEVERS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Retriever: - """ - Summary information for the retriever used for your Amazon Q Business - application. - """ - - application_id: str | None = None - """The identifier of the Amazon Q Business application using the retriever.""" - - retriever_id: str | None = None - """ - The identifier of the retriever used by your Amazon Q Business - application. - """ - - type: str | None = None - """The type of your retriever.""" - - status: str | None = None - """The status of your retriever.""" - - display_name: str | None = None - """The name of your retriever.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVER, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_RETRIEVER.members["applicationId"], self.application_id - ) - - if self.retriever_id is not None: - serializer.write_string( - _SCHEMA_RETRIEVER.members["retrieverId"], self.retriever_id - ) - - if self.type is not None: - serializer.write_string(_SCHEMA_RETRIEVER.members["type"], self.type) - - if self.status is not None: - serializer.write_string(_SCHEMA_RETRIEVER.members["status"], self.status) - - if self.display_name is not None: - serializer.write_string( - _SCHEMA_RETRIEVER.members["displayName"], self.display_name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_RETRIEVER.members["applicationId"] - ) - - case 1: - kwargs["retriever_id"] = de.read_string( - _SCHEMA_RETRIEVER.members["retrieverId"] - ) - - case 2: - kwargs["type"] = RetrieverType( - de.read_string(_SCHEMA_RETRIEVER.members["type"]) - ) - - case 3: - kwargs["status"] = RetrieverStatus( - de.read_string(_SCHEMA_RETRIEVER.members["status"]) - ) - - case 4: - kwargs["display_name"] = de.read_string( - _SCHEMA_RETRIEVER.members["displayName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RETRIEVER, consumer=_consumer) - return kwargs - - -def _serialize_retrievers( - serializer: ShapeSerializer, schema: Schema, value: list[Retriever] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_retrievers( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Retriever]: - result: list[Retriever] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Retriever.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListRetrieversOutput: - """Dataclass for ListRetrieversOutput structure.""" - - retrievers: list[Retriever] | None = None - """An array of summary information for one or more retrievers.""" - - next_token: str | None = None - """ - If the response is truncated, Amazon Q Business returns this token, - which you can use in a later request to list the next set of retrievers. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_RETRIEVERS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.retrievers is not None: - _serialize_retrievers( - serializer, - _SCHEMA_LIST_RETRIEVERS_OUTPUT.members["retrievers"], - self.retrievers, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_RETRIEVERS_OUTPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["retrievers"] = _deserialize_retrievers( - de, _SCHEMA_LIST_RETRIEVERS_OUTPUT.members["retrievers"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_RETRIEVERS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_RETRIEVERS_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_RETRIEVERS = APIOperation( - input=ListRetrieversInput, - output=ListRetrieversOutput, - schema=_SCHEMA_LIST_RETRIEVERS, - input_schema=_SCHEMA_LIST_RETRIEVERS_INPUT, - output_schema=_SCHEMA_LIST_RETRIEVERS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateRetrieverInput: - """Dataclass for UpdateRetrieverInput structure.""" - - application_id: str | None = None - """The identifier of your Amazon Q Business application.""" - - retriever_id: str | None = None - """The identifier of your retriever.""" - - configuration: RetrieverConfiguration | None = None - """ - Provides information on how the retriever used for your Amazon Q - Business application is configured. - """ - - display_name: str | None = None - """The name of your retriever.""" - - role_arn: str | None = None - """ - The Amazon Resource Name (ARN) of an IAM role with permission to access - the retriever and required resources. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_RETRIEVER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_RETRIEVER_INPUT.members["applicationId"], - self.application_id, - ) - - if self.retriever_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_RETRIEVER_INPUT.members["retrieverId"], self.retriever_id - ) - - if self.configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_RETRIEVER_INPUT.members["configuration"], - self.configuration, - ) - - if self.display_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_RETRIEVER_INPUT.members["displayName"], self.display_name - ) - - if self.role_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_RETRIEVER_INPUT.members["roleArn"], self.role_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_UPDATE_RETRIEVER_INPUT.members["applicationId"] - ) - - case 1: - kwargs["retriever_id"] = de.read_string( - _SCHEMA_UPDATE_RETRIEVER_INPUT.members["retrieverId"] - ) - - case 2: - kwargs["configuration"] = ( - _RetrieverConfigurationDeserializer().deserialize(de) - ) - - case 3: - kwargs["display_name"] = de.read_string( - _SCHEMA_UPDATE_RETRIEVER_INPUT.members["displayName"] - ) - - case 4: - kwargs["role_arn"] = de.read_string( - _SCHEMA_UPDATE_RETRIEVER_INPUT.members["roleArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_RETRIEVER_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateRetrieverOutput: - """Dataclass for UpdateRetrieverOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_RETRIEVER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_RETRIEVER_OUTPUT, consumer=_consumer) - return kwargs - - -UPDATE_RETRIEVER = APIOperation( - input=UpdateRetrieverInput, - output=UpdateRetrieverOutput, - schema=_SCHEMA_UPDATE_RETRIEVER, - input_schema=_SCHEMA_UPDATE_RETRIEVER_INPUT, - output_schema=_SCHEMA_UPDATE_RETRIEVER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.qbusiness#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateApplicationInput: - """Dataclass for UpdateApplicationInput structure.""" - - application_id: str | None = None - """The identifier of the Amazon Q Business application.""" - - identity_center_instance_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the IAM Identity Center instance you - are either creating for---or connecting to---your Amazon Q Business - application. - """ - - display_name: str | None = None - """A name for the Amazon Q Business application.""" - - description: str | None = None - """A description for the Amazon Q Business application.""" - - role_arn: str | None = None - """ - An Amazon Web Services Identity and Access Management (IAM) role that - gives Amazon Q Business permission to access Amazon CloudWatch logs and - metrics. - """ - - attachments_configuration: AttachmentsConfiguration | None = None - """An option to allow end users to upload files directly during chat.""" - - q_apps_configuration: QAppsConfiguration | None = None - """ - An option to allow end users to create and use Amazon Q Apps in the web - experience. - """ - - personalization_configuration: PersonalizationConfiguration | None = None - """ - Configuration information about chat response personalization. For more - information, see [Personalizing chat - responses](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/personalizing-chat-responses.html). - """ - - auto_subscription_configuration: AutoSubscriptionConfiguration | None = None - """ - An option to enable updating the default subscription type assigned to - an Amazon Q Business application using IAM identity federation for user - management. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_APPLICATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_APPLICATION_INPUT.members["applicationId"], - self.application_id, - ) - - if self.identity_center_instance_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_APPLICATION_INPUT.members["identityCenterInstanceArn"], - self.identity_center_instance_arn, - ) - - if self.display_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_APPLICATION_INPUT.members["displayName"], - self.display_name, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_APPLICATION_INPUT.members["description"], - self.description, - ) - - if self.role_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_APPLICATION_INPUT.members["roleArn"], self.role_arn - ) - - if self.attachments_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_APPLICATION_INPUT.members["attachmentsConfiguration"], - self.attachments_configuration, - ) - - if self.q_apps_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_APPLICATION_INPUT.members["qAppsConfiguration"], - self.q_apps_configuration, - ) - - if self.personalization_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_APPLICATION_INPUT.members[ - "personalizationConfiguration" - ], - self.personalization_configuration, - ) - - if self.auto_subscription_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_APPLICATION_INPUT.members[ - "autoSubscriptionConfiguration" - ], - self.auto_subscription_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_UPDATE_APPLICATION_INPUT.members["applicationId"] - ) - - case 1: - kwargs["identity_center_instance_arn"] = de.read_string( - _SCHEMA_UPDATE_APPLICATION_INPUT.members[ - "identityCenterInstanceArn" - ] - ) - - case 2: - kwargs["display_name"] = de.read_string( - _SCHEMA_UPDATE_APPLICATION_INPUT.members["displayName"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_APPLICATION_INPUT.members["description"] - ) - - case 4: - kwargs["role_arn"] = de.read_string( - _SCHEMA_UPDATE_APPLICATION_INPUT.members["roleArn"] - ) - - case 5: - kwargs["attachments_configuration"] = ( - AttachmentsConfiguration.deserialize(de) - ) - - case 6: - kwargs["q_apps_configuration"] = QAppsConfiguration.deserialize(de) - - case 7: - kwargs["personalization_configuration"] = ( - PersonalizationConfiguration.deserialize(de) - ) - - case 8: - kwargs["auto_subscription_configuration"] = ( - AutoSubscriptionConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_APPLICATION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateApplicationOutput: - """Dataclass for UpdateApplicationOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_APPLICATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_APPLICATION_OUTPUT, consumer=_consumer) - return kwargs - - -UPDATE_APPLICATION = APIOperation( - input=UpdateApplicationInput, - output=UpdateApplicationOutput, - schema=_SCHEMA_UPDATE_APPLICATION, - input_schema=_SCHEMA_UPDATE_APPLICATION_INPUT, - output_schema=_SCHEMA_UPDATE_APPLICATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -def _serialize_browser_extension_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_browser_extension_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class BrowserExtensionConfiguration: - """ - The container for browser extension configuration for an Amazon Q - Business web experience. - """ - - enabled_browser_extensions: list[str] - """ - Specify the browser extensions allowed for your Amazon Q web experience. - - - `CHROME` --- Enables the extension for Chromium-based browsers (Google - Chrome, Microsoft Edge, Opera, etc.). - - - `FIREFOX` --- Enables the extension for Mozilla Firefox. - - - `CHROME` and `FIREFOX` --- Enable the extension for Chromium-based - browsers and Mozilla Firefox. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BROWSER_EXTENSION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_browser_extension_list( - serializer, - _SCHEMA_BROWSER_EXTENSION_CONFIGURATION.members["enabledBrowserExtensions"], - self.enabled_browser_extensions, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["enabled_browser_extensions"] = ( - _deserialize_browser_extension_list( - de, - _SCHEMA_BROWSER_EXTENSION_CONFIGURATION.members[ - "enabledBrowserExtensions" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_BROWSER_EXTENSION_CONFIGURATION, consumer=_consumer - ) - if "enabled_browser_extensions" not in kwargs: - kwargs["enabled_browser_extensions"] = [] - return kwargs - - -@dataclass(kw_only=True) -class CustomizationConfiguration: - """ - Contains the configuration information to customize the logo, font, and - color of an Amazon Q Business web experience with individual files for - each property or a CSS file for them all. - """ - - custom_css_url: str | None = None - """ - Provides the URL where the custom CSS file is hosted for an Amazon Q web - experience. - """ - - logo_url: str | None = None - """ - Provides the URL where the custom logo file is hosted for an Amazon Q - web experience. - """ - - font_url: str | None = None - """ - Provides the URL where the custom font file is hosted for an Amazon Q - web experience. - """ - - favicon_url: str | None = None - """ - Provides the URL where the custom favicon file is hosted for an Amazon Q - web experience. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CUSTOMIZATION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.custom_css_url is not None: - serializer.write_string( - _SCHEMA_CUSTOMIZATION_CONFIGURATION.members["customCSSUrl"], - self.custom_css_url, - ) - - if self.logo_url is not None: - serializer.write_string( - _SCHEMA_CUSTOMIZATION_CONFIGURATION.members["logoUrl"], self.logo_url - ) - - if self.font_url is not None: - serializer.write_string( - _SCHEMA_CUSTOMIZATION_CONFIGURATION.members["fontUrl"], self.font_url - ) - - if self.favicon_url is not None: - serializer.write_string( - _SCHEMA_CUSTOMIZATION_CONFIGURATION.members["faviconUrl"], - self.favicon_url, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["custom_css_url"] = de.read_string( - _SCHEMA_CUSTOMIZATION_CONFIGURATION.members["customCSSUrl"] - ) - - case 1: - kwargs["logo_url"] = de.read_string( - _SCHEMA_CUSTOMIZATION_CONFIGURATION.members["logoUrl"] - ) - - case 2: - kwargs["font_url"] = de.read_string( - _SCHEMA_CUSTOMIZATION_CONFIGURATION.members["fontUrl"] - ) - - case 3: - kwargs["favicon_url"] = de.read_string( - _SCHEMA_CUSTOMIZATION_CONFIGURATION.members["faviconUrl"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CUSTOMIZATION_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class OpenIDConnectProviderConfiguration: - """ - Information about the OIDC-compliant identity provider (IdP) used to - authenticate end users of an Amazon Q Business web experience. - """ - - secrets_arn: str - """ - The Amazon Resource Name (ARN) of a Secrets Manager secret containing - the OIDC client secret. - """ - - secrets_role: str - """ - An IAM role with permissions to access KMS to decrypt the Secrets - Manager secret containing your OIDC client secret. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OPEN_ID_CONNECT_PROVIDER_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_OPEN_ID_CONNECT_PROVIDER_CONFIGURATION.members["secretsArn"], - self.secrets_arn, - ) - serializer.write_string( - _SCHEMA_OPEN_ID_CONNECT_PROVIDER_CONFIGURATION.members["secretsRole"], - self.secrets_role, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["secrets_arn"] = de.read_string( - _SCHEMA_OPEN_ID_CONNECT_PROVIDER_CONFIGURATION.members[ - "secretsArn" - ] - ) - - case 1: - kwargs["secrets_role"] = de.read_string( - _SCHEMA_OPEN_ID_CONNECT_PROVIDER_CONFIGURATION.members[ - "secretsRole" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_OPEN_ID_CONNECT_PROVIDER_CONFIGURATION, consumer=_consumer - ) - if "secrets_arn" not in kwargs: - kwargs["secrets_arn"] = "" - if "secrets_role" not in kwargs: - kwargs["secrets_role"] = "" - return kwargs - - -@dataclass(kw_only=True) -class SamlProviderConfiguration: - """ - Information about the SAML 2.0-compliant identity provider (IdP) used to - authenticate end users of an Amazon Q Business web experience. - """ - - authentication_url: str - """ - The URL where Amazon Q Business end users will be redirected for - authentication. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SAML_PROVIDER_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SAML_PROVIDER_CONFIGURATION.members["authenticationUrl"], - self.authentication_url, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["authentication_url"] = de.read_string( - _SCHEMA_SAML_PROVIDER_CONFIGURATION.members["authenticationUrl"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SAML_PROVIDER_CONFIGURATION, consumer=_consumer - ) - if "authentication_url" not in kwargs: - kwargs["authentication_url"] = "" - return kwargs - - -@dataclass -class IdentityProviderConfigurationSamlConfiguration: - """ - Information about the SAML 2.0-compliant identity provider (IdP) used to - authenticate end users of an Amazon Q Business web experience. - """ - - value: SamlProviderConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IDENTITY_PROVIDER_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_IDENTITY_PROVIDER_CONFIGURATION.members["samlConfiguration"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=SamlProviderConfiguration.deserialize(deserializer)) - - -@dataclass -class IdentityProviderConfigurationOpenIDConnectConfiguration: - """ - Information about the OIDC-compliant identity provider (IdP) used to - authenticate end users of an Amazon Q Business web experience. - """ - - value: OpenIDConnectProviderConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IDENTITY_PROVIDER_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_IDENTITY_PROVIDER_CONFIGURATION.members[ - "openIDConnectConfiguration" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=OpenIDConnectProviderConfiguration.deserialize(deserializer)) - - -@dataclass -class IdentityProviderConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -IdentityProviderConfiguration = Union[ - IdentityProviderConfigurationSamlConfiguration - | IdentityProviderConfigurationOpenIDConnectConfiguration - | IdentityProviderConfigurationUnknown -] -""" -Provides information about the identity provider (IdP) used to -authenticate end users of an Amazon Q Business web experience. -""" - - -class _IdentityProviderConfigurationDeserializer: - _result: IdentityProviderConfiguration | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> IdentityProviderConfiguration: - self._result = None - deserializer.read_struct( - _SCHEMA_IDENTITY_PROVIDER_CONFIGURATION, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - IdentityProviderConfigurationSamlConfiguration.deserialize(de) - ) - - case 1: - self._set_result( - IdentityProviderConfigurationOpenIDConnectConfiguration.deserialize( - de - ) - ) - - case _: - self._set_result( - IdentityProviderConfigurationUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: IdentityProviderConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_web_experience_origins( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_web_experience_origins( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -class WebExperienceSamplePromptsControlMode(UnknownEnumMixin, StrEnum): - ENABLED = "ENABLED" - DISABLED = "DISABLED" - - -@dataclass(kw_only=True) -class CreateWebExperienceInput: - """Dataclass for CreateWebExperienceInput structure.""" - - application_id: str | None = None - """The identifier of the Amazon Q Business web experience.""" - - title: str | None = None - """The title for your Amazon Q Business web experience.""" - - subtitle: str | None = None - """A subtitle to personalize your Amazon Q Business web experience.""" - - welcome_message: str | None = None - """ - The customized welcome message for end users of an Amazon Q Business web - experience. - """ - - sample_prompts_control_mode: str | None = None - """ - Determines whether sample prompts are enabled in the web experience for - an end user. - """ - - origins: list[str] | None = None - """ - Sets the website domain origins that are allowed to embed the Amazon Q - Business web experience. The *domain origin* refers to the base URL for - accessing a website including the protocol (`http/https`), the domain - name, and the port number (if specified). - - Note: - You must only submit a *base URL* and not a full path. For example, - `https://docs.aws.amazon.com`. - """ - - role_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the service role attached to your web - experience. - - Note: - The `roleArn` parameter is required when your Amazon Q Business - application is created with IAM Identity Center. It is not required for - SAML-based applications. - """ - - tags: list[Tag] | None = None - """ - A list of key-value pairs that identify or categorize your Amazon Q - Business web experience. You can also use tags to help control access to - the web experience. Tag keys and values can consist of Unicode letters, - digits, white space, and any of the following symbols: _ . : / = + - @. - """ - - client_token: str | None = None - """ - A token you provide to identify a request to create an Amazon Q Business - web experience. - """ - - identity_provider_configuration: IdentityProviderConfiguration | None = None - """ - Information about the identity provider (IdP) used to authenticate end - users of an Amazon Q Business web experience. - """ - - browser_extension_configuration: BrowserExtensionConfiguration | None = None - """ - The browser extension configuration for an Amazon Q Business web - experience. - - Note: - For Amazon Q Business application using external OIDC-compliant identity - providers (IdPs). The IdP administrator must add the browser extension - sign-in redirect URLs to the IdP application. For more information, see - [Configure external OIDC identity provider for your browser - extensions.](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/browser-extensions.html). - """ - - customization_configuration: CustomizationConfiguration | None = None - """ - Sets the custom logo, favicon, font, and color used in the Amazon Q web - experience. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_WEB_EXPERIENCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_CREATE_WEB_EXPERIENCE_INPUT.members["applicationId"], - self.application_id, - ) - - if self.title is not None: - serializer.write_string( - _SCHEMA_CREATE_WEB_EXPERIENCE_INPUT.members["title"], self.title - ) - - if self.subtitle is not None: - serializer.write_string( - _SCHEMA_CREATE_WEB_EXPERIENCE_INPUT.members["subtitle"], self.subtitle - ) - - if self.welcome_message is not None: - serializer.write_string( - _SCHEMA_CREATE_WEB_EXPERIENCE_INPUT.members["welcomeMessage"], - self.welcome_message, - ) - - if self.sample_prompts_control_mode is not None: - serializer.write_string( - _SCHEMA_CREATE_WEB_EXPERIENCE_INPUT.members["samplePromptsControlMode"], - self.sample_prompts_control_mode, - ) - - if self.origins is not None: - _serialize_web_experience_origins( - serializer, - _SCHEMA_CREATE_WEB_EXPERIENCE_INPUT.members["origins"], - self.origins, - ) - - if self.role_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_WEB_EXPERIENCE_INPUT.members["roleArn"], self.role_arn - ) - - if self.tags is not None: - _serialize_tags( - serializer, - _SCHEMA_CREATE_WEB_EXPERIENCE_INPUT.members["tags"], - self.tags, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_WEB_EXPERIENCE_INPUT.members["clientToken"], - self.client_token, - ) - - if self.identity_provider_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_WEB_EXPERIENCE_INPUT.members[ - "identityProviderConfiguration" - ], - self.identity_provider_configuration, - ) - - if self.browser_extension_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_WEB_EXPERIENCE_INPUT.members[ - "browserExtensionConfiguration" - ], - self.browser_extension_configuration, - ) - - if self.customization_configuration is not None: - serializer.write_struct( - _SCHEMA_CREATE_WEB_EXPERIENCE_INPUT.members[ - "customizationConfiguration" - ], - self.customization_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_CREATE_WEB_EXPERIENCE_INPUT.members["applicationId"] - ) - - case 1: - kwargs["title"] = de.read_string( - _SCHEMA_CREATE_WEB_EXPERIENCE_INPUT.members["title"] - ) - - case 2: - kwargs["subtitle"] = de.read_string( - _SCHEMA_CREATE_WEB_EXPERIENCE_INPUT.members["subtitle"] - ) - - case 3: - kwargs["welcome_message"] = de.read_string( - _SCHEMA_CREATE_WEB_EXPERIENCE_INPUT.members["welcomeMessage"] - ) - - case 4: - kwargs["sample_prompts_control_mode"] = ( - WebExperienceSamplePromptsControlMode( - de.read_string( - _SCHEMA_CREATE_WEB_EXPERIENCE_INPUT.members[ - "samplePromptsControlMode" - ] - ) - ) - ) - - case 5: - kwargs["origins"] = _deserialize_web_experience_origins( - de, _SCHEMA_CREATE_WEB_EXPERIENCE_INPUT.members["origins"] - ) - - case 6: - kwargs["role_arn"] = de.read_string( - _SCHEMA_CREATE_WEB_EXPERIENCE_INPUT.members["roleArn"] - ) - - case 7: - kwargs["tags"] = _deserialize_tags( - de, _SCHEMA_CREATE_WEB_EXPERIENCE_INPUT.members["tags"] - ) - - case 8: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_WEB_EXPERIENCE_INPUT.members["clientToken"] - ) - - case 9: - kwargs["identity_provider_configuration"] = ( - _IdentityProviderConfigurationDeserializer().deserialize(de) - ) - - case 10: - kwargs["browser_extension_configuration"] = ( - BrowserExtensionConfiguration.deserialize(de) - ) - - case 11: - kwargs["customization_configuration"] = ( - CustomizationConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_WEB_EXPERIENCE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CreateWebExperienceOutput: - """Dataclass for CreateWebExperienceOutput structure.""" - - web_experience_id: str | None = None - """The identifier of the Amazon Q Business web experience.""" - - web_experience_arn: str | None = None - """The Amazon Resource Name (ARN) of an Amazon Q Business web experience.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_WEB_EXPERIENCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.web_experience_id is not None: - serializer.write_string( - _SCHEMA_CREATE_WEB_EXPERIENCE_OUTPUT.members["webExperienceId"], - self.web_experience_id, - ) - - if self.web_experience_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_WEB_EXPERIENCE_OUTPUT.members["webExperienceArn"], - self.web_experience_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["web_experience_id"] = de.read_string( - _SCHEMA_CREATE_WEB_EXPERIENCE_OUTPUT.members["webExperienceId"] - ) - - case 1: - kwargs["web_experience_arn"] = de.read_string( - _SCHEMA_CREATE_WEB_EXPERIENCE_OUTPUT.members["webExperienceArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_WEB_EXPERIENCE_OUTPUT, consumer=_consumer - ) - return kwargs - - -CREATE_WEB_EXPERIENCE = APIOperation( - input=CreateWebExperienceInput, - output=CreateWebExperienceOutput, - schema=_SCHEMA_CREATE_WEB_EXPERIENCE, - input_schema=_SCHEMA_CREATE_WEB_EXPERIENCE_INPUT, - output_schema=_SCHEMA_CREATE_WEB_EXPERIENCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.qbusiness#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteWebExperienceInput: - """Dataclass for DeleteWebExperienceInput structure.""" - - application_id: str | None = None - """ - The identifier of the Amazon Q Business application linked to the Amazon - Q Business web experience. - """ - - web_experience_id: str | None = None - """The identifier of the Amazon Q Business web experience being deleted.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_WEB_EXPERIENCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_DELETE_WEB_EXPERIENCE_INPUT.members["applicationId"], - self.application_id, - ) - - if self.web_experience_id is not None: - serializer.write_string( - _SCHEMA_DELETE_WEB_EXPERIENCE_INPUT.members["webExperienceId"], - self.web_experience_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_DELETE_WEB_EXPERIENCE_INPUT.members["applicationId"] - ) - - case 1: - kwargs["web_experience_id"] = de.read_string( - _SCHEMA_DELETE_WEB_EXPERIENCE_INPUT.members["webExperienceId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_WEB_EXPERIENCE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteWebExperienceOutput: - """Dataclass for DeleteWebExperienceOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_WEB_EXPERIENCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_WEB_EXPERIENCE_OUTPUT, consumer=_consumer - ) - return kwargs - - -DELETE_WEB_EXPERIENCE = APIOperation( - input=DeleteWebExperienceInput, - output=DeleteWebExperienceOutput, - schema=_SCHEMA_DELETE_WEB_EXPERIENCE, - input_schema=_SCHEMA_DELETE_WEB_EXPERIENCE_INPUT, - output_schema=_SCHEMA_DELETE_WEB_EXPERIENCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetWebExperienceInput: - """Dataclass for GetWebExperienceInput structure.""" - - application_id: str | None = None - """ - The identifier of the Amazon Q Business application linked to the web - experience. - """ - - web_experience_id: str | None = None - """The identifier of the Amazon Q Business web experience.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_WEB_EXPERIENCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_GET_WEB_EXPERIENCE_INPUT.members["applicationId"], - self.application_id, - ) - - if self.web_experience_id is not None: - serializer.write_string( - _SCHEMA_GET_WEB_EXPERIENCE_INPUT.members["webExperienceId"], - self.web_experience_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_GET_WEB_EXPERIENCE_INPUT.members["applicationId"] - ) - - case 1: - kwargs["web_experience_id"] = de.read_string( - _SCHEMA_GET_WEB_EXPERIENCE_INPUT.members["webExperienceId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_WEB_EXPERIENCE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class SamlConfiguration: - """ - Provides the SAML 2.0 compliant identity provider (IdP) configuration - information Amazon Q Business needs to deploy a Amazon Q Business web - experience. - """ - - metadata_xml: str - """The metadata XML that your IdP generated.""" - - role_arn: str - """ - The Amazon Resource Name (ARN) of an IAM role assumed by users when they - authenticate into their Amazon Q Business web experience, containing the - relevant Amazon Q Business permissions for conversing with Amazon Q - Business. - """ - - user_id_attribute: str - """The user attribute name in your IdP that maps to the user email.""" - - user_group_attribute: str | None = None - """The group attribute name in your IdP that maps to user groups.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SAML_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SAML_CONFIGURATION.members["metadataXML"], self.metadata_xml - ) - serializer.write_string( - _SCHEMA_SAML_CONFIGURATION.members["roleArn"], self.role_arn - ) - serializer.write_string( - _SCHEMA_SAML_CONFIGURATION.members["userIdAttribute"], - self.user_id_attribute, - ) - if self.user_group_attribute is not None: - serializer.write_string( - _SCHEMA_SAML_CONFIGURATION.members["userGroupAttribute"], - self.user_group_attribute, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["metadata_xml"] = de.read_string( - _SCHEMA_SAML_CONFIGURATION.members["metadataXML"] - ) - - case 1: - kwargs["role_arn"] = de.read_string( - _SCHEMA_SAML_CONFIGURATION.members["roleArn"] - ) - - case 2: - kwargs["user_id_attribute"] = de.read_string( - _SCHEMA_SAML_CONFIGURATION.members["userIdAttribute"] - ) - - case 3: - kwargs["user_group_attribute"] = de.read_string( - _SCHEMA_SAML_CONFIGURATION.members["userGroupAttribute"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SAML_CONFIGURATION, consumer=_consumer) - if "metadata_xml" not in kwargs: - kwargs["metadata_xml"] = "" - if "role_arn" not in kwargs: - kwargs["role_arn"] = "" - if "user_id_attribute" not in kwargs: - kwargs["user_id_attribute"] = "" - return kwargs - - -@dataclass -class WebExperienceAuthConfigurationSamlConfiguration: - """ - Provides the SAML 2.0 compliant identity provider (IdP) configuration - information Amazon Q Business needs to deploy a Amazon Q Business web - experience. - """ - - value: SamlConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_WEB_EXPERIENCE_AUTH_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_WEB_EXPERIENCE_AUTH_CONFIGURATION.members["samlConfiguration"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=SamlConfiguration.deserialize(deserializer)) - - -@dataclass -class WebExperienceAuthConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -WebExperienceAuthConfiguration = Union[ - WebExperienceAuthConfigurationSamlConfiguration - | WebExperienceAuthConfigurationUnknown -] -""" -Provides the authorization configuration information needed to deploy a -Amazon Q Business web experience to end users. -""" - - -class _WebExperienceAuthConfigurationDeserializer: - _result: WebExperienceAuthConfiguration | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> WebExperienceAuthConfiguration: - self._result = None - deserializer.read_struct( - _SCHEMA_WEB_EXPERIENCE_AUTH_CONFIGURATION, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - WebExperienceAuthConfigurationSamlConfiguration.deserialize(de) - ) - - case _: - self._set_result( - WebExperienceAuthConfigurationUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: WebExperienceAuthConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class WebExperienceStatus(UnknownEnumMixin, StrEnum): - CREATING = "CREATING" - ACTIVE = "ACTIVE" - DELETING = "DELETING" - FAILED = "FAILED" - PENDING_AUTH_CONFIG = "PENDING_AUTH_CONFIG" - - -@dataclass(kw_only=True) -class GetWebExperienceOutput: - """Dataclass for GetWebExperienceOutput structure.""" - - application_id: str | None = None - """ - The identifier of the Amazon Q Business application linked to the web - experience. - """ - - web_experience_id: str | None = None - """The identifier of the Amazon Q Business web experience.""" - - web_experience_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the role with the permission to access - the Amazon Q Business web experience and required resources. - """ - - default_endpoint: str | None = None - """The endpoint of your Amazon Q Business web experience.""" - - status: str | None = None - """ - The current status of the Amazon Q Business web experience. When the - `Status` field value is `FAILED`, the `ErrorMessage` field contains a - description of the error that caused the data source connector to fail. - """ - - created_at: datetime | None = None - """ - The Unix timestamp when the Amazon Q Business web experience was last - created. - """ - - updated_at: datetime | None = None - """ - The Unix timestamp when the Amazon Q Business web experience was last - updated. - """ - - title: str | None = None - """The title for your Amazon Q Business web experience.""" - - subtitle: str | None = None - """The subtitle for your Amazon Q Business web experience.""" - - welcome_message: str | None = None - """ - The customized welcome message for end users of an Amazon Q Business web - experience. - """ - - sample_prompts_control_mode: str | None = None - """ - Determines whether sample prompts are enabled in the web experience for - an end user. - """ - - origins: list[str] | None = None - """ - Gets the website domain origins that are allowed to embed the Amazon Q - Business web experience. The *domain origin* refers to the base URL for - accessing a website including the protocol (`http/https`), the domain - name, and the port number (if specified). - """ - - role_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the service role attached to your web - experience. - """ - - identity_provider_configuration: IdentityProviderConfiguration | None = None - """ - Information about the identity provider (IdP) used to authenticate end - users of an Amazon Q Business web experience. - """ - - authentication_configuration: WebExperienceAuthConfiguration | None = None - """ - The authentication configuration information for your Amazon Q Business - web experience. - """ - - error: ErrorDetail | None = None - """ - When the `Status` field value is `FAILED`, the `ErrorMessage` field - contains a description of the error that caused the data source - connector to fail. - """ - - browser_extension_configuration: BrowserExtensionConfiguration | None = None - """ - The browser extension configuration for an Amazon Q Business web - experience. - """ - - customization_configuration: CustomizationConfiguration | None = None - """ - Gets the custom logo, favicon, font, and color used in the Amazon Q web - experience. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_WEB_EXPERIENCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["applicationId"], - self.application_id, - ) - - if self.web_experience_id is not None: - serializer.write_string( - _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["webExperienceId"], - self.web_experience_id, - ) - - if self.web_experience_arn is not None: - serializer.write_string( - _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["webExperienceArn"], - self.web_experience_arn, - ) - - if self.default_endpoint is not None: - serializer.write_string( - _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["defaultEndpoint"], - self.default_endpoint, - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["status"], self.status - ) - - if self.created_at is not None: - serializer.write_timestamp( - _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["createdAt"], self.created_at - ) - - if self.updated_at is not None: - serializer.write_timestamp( - _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["updatedAt"], self.updated_at - ) - - if self.title is not None: - serializer.write_string( - _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["title"], self.title - ) - - if self.subtitle is not None: - serializer.write_string( - _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["subtitle"], self.subtitle - ) - - if self.welcome_message is not None: - serializer.write_string( - _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["welcomeMessage"], - self.welcome_message, - ) - - if self.sample_prompts_control_mode is not None: - serializer.write_string( - _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["samplePromptsControlMode"], - self.sample_prompts_control_mode, - ) - - if self.origins is not None: - _serialize_web_experience_origins( - serializer, - _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["origins"], - self.origins, - ) - - if self.role_arn is not None: - serializer.write_string( - _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["roleArn"], self.role_arn - ) - - if self.identity_provider_configuration is not None: - serializer.write_struct( - _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members[ - "identityProviderConfiguration" - ], - self.identity_provider_configuration, - ) - - if self.authentication_configuration is not None: - serializer.write_struct( - _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members[ - "authenticationConfiguration" - ], - self.authentication_configuration, - ) - - if self.error is not None: - serializer.write_struct( - _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["error"], self.error - ) - - if self.browser_extension_configuration is not None: - serializer.write_struct( - _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members[ - "browserExtensionConfiguration" - ], - self.browser_extension_configuration, - ) - - if self.customization_configuration is not None: - serializer.write_struct( - _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["customizationConfiguration"], - self.customization_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["applicationId"] - ) - - case 1: - kwargs["web_experience_id"] = de.read_string( - _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["webExperienceId"] - ) - - case 2: - kwargs["web_experience_arn"] = de.read_string( - _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["webExperienceArn"] - ) - - case 3: - kwargs["default_endpoint"] = de.read_string( - _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["defaultEndpoint"] - ) - - case 4: - kwargs["status"] = WebExperienceStatus( - de.read_string( - _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["status"] - ) - ) - - case 5: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["createdAt"] - ) - - case 6: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["updatedAt"] - ) - - case 7: - kwargs["title"] = de.read_string( - _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["title"] - ) - - case 8: - kwargs["subtitle"] = de.read_string( - _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["subtitle"] - ) - - case 9: - kwargs["welcome_message"] = de.read_string( - _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["welcomeMessage"] - ) - - case 10: - kwargs["sample_prompts_control_mode"] = ( - WebExperienceSamplePromptsControlMode( - de.read_string( - _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members[ - "samplePromptsControlMode" - ] - ) - ) - ) - - case 11: - kwargs["origins"] = _deserialize_web_experience_origins( - de, _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["origins"] - ) - - case 12: - kwargs["role_arn"] = de.read_string( - _SCHEMA_GET_WEB_EXPERIENCE_OUTPUT.members["roleArn"] - ) - - case 13: - kwargs["identity_provider_configuration"] = ( - _IdentityProviderConfigurationDeserializer().deserialize(de) - ) - - case 14: - kwargs["authentication_configuration"] = ( - _WebExperienceAuthConfigurationDeserializer().deserialize(de) - ) - - case 15: - kwargs["error"] = ErrorDetail.deserialize(de) - - case 16: - kwargs["browser_extension_configuration"] = ( - BrowserExtensionConfiguration.deserialize(de) - ) - - case 17: - kwargs["customization_configuration"] = ( - CustomizationConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_WEB_EXPERIENCE_OUTPUT, consumer=_consumer) - return kwargs - - -GET_WEB_EXPERIENCE = APIOperation( - input=GetWebExperienceInput, - output=GetWebExperienceOutput, - schema=_SCHEMA_GET_WEB_EXPERIENCE, - input_schema=_SCHEMA_GET_WEB_EXPERIENCE_INPUT, - output_schema=_SCHEMA_GET_WEB_EXPERIENCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListWebExperiencesInput: - """Dataclass for ListWebExperiencesInput structure.""" - - application_id: str | None = None - """ - The identifier of the Amazon Q Business application linked to the listed - web experiences. - """ - - next_token: str | None = None - """ - If the `maxResults` response was incomplete because there is more data - to retrieve, Amazon Q Business returns a pagination token in the - response. You can use this pagination token to retrieve the next set of - Amazon Q Business conversations. - """ - - max_results: int | None = None - """The maximum number of Amazon Q Business Web Experiences to return.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_WEB_EXPERIENCES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_LIST_WEB_EXPERIENCES_INPUT.members["applicationId"], - self.application_id, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_WEB_EXPERIENCES_INPUT.members["nextToken"], self.next_token - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_WEB_EXPERIENCES_INPUT.members["maxResults"], - self.max_results, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_LIST_WEB_EXPERIENCES_INPUT.members["applicationId"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_WEB_EXPERIENCES_INPUT.members["nextToken"] - ) - - case 2: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_WEB_EXPERIENCES_INPUT.members["maxResults"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_WEB_EXPERIENCES_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class WebExperience: - """Provides information for an Amazon Q Business web experience.""" - - web_experience_id: str | None = None - """The identifier of your Amazon Q Business web experience.""" - - created_at: datetime | None = None - """ - The Unix timestamp when the Amazon Q Business application was last - updated. - """ - - updated_at: datetime | None = None - """ - The Unix timestamp when your Amazon Q Business web experience was - updated. - """ - - default_endpoint: str | None = None - """ - The endpoint URLs for your Amazon Q Business web experience. The URLs - are unique and fully hosted by Amazon Web Services. - """ - - status: str | None = None - """The status of your Amazon Q Business web experience.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_WEB_EXPERIENCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.web_experience_id is not None: - serializer.write_string( - _SCHEMA_WEB_EXPERIENCE.members["webExperienceId"], - self.web_experience_id, - ) - - if self.created_at is not None: - serializer.write_timestamp( - _SCHEMA_WEB_EXPERIENCE.members["createdAt"], self.created_at - ) - - if self.updated_at is not None: - serializer.write_timestamp( - _SCHEMA_WEB_EXPERIENCE.members["updatedAt"], self.updated_at - ) - - if self.default_endpoint is not None: - serializer.write_string( - _SCHEMA_WEB_EXPERIENCE.members["defaultEndpoint"], self.default_endpoint - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_WEB_EXPERIENCE.members["status"], self.status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["web_experience_id"] = de.read_string( - _SCHEMA_WEB_EXPERIENCE.members["webExperienceId"] - ) - - case 1: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_WEB_EXPERIENCE.members["createdAt"] - ) - - case 2: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_WEB_EXPERIENCE.members["updatedAt"] - ) - - case 3: - kwargs["default_endpoint"] = de.read_string( - _SCHEMA_WEB_EXPERIENCE.members["defaultEndpoint"] - ) - - case 4: - kwargs["status"] = WebExperienceStatus( - de.read_string(_SCHEMA_WEB_EXPERIENCE.members["status"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_WEB_EXPERIENCE, consumer=_consumer) - return kwargs - - -def _serialize_web_experiences( - serializer: ShapeSerializer, schema: Schema, value: list[WebExperience] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_web_experiences( - deserializer: ShapeDeserializer, schema: Schema -) -> list[WebExperience]: - result: list[WebExperience] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(WebExperience.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListWebExperiencesOutput: - """Dataclass for ListWebExperiencesOutput structure.""" - - web_experiences: list[WebExperience] | None = None - """ - An array of summary information for one or more Amazon Q Business - experiences. - """ - - next_token: str | None = None - """ - If the response is truncated, Amazon Q Business returns this token, - which you can use in a later request to list the next set of messages. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_WEB_EXPERIENCES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.web_experiences is not None: - _serialize_web_experiences( - serializer, - _SCHEMA_LIST_WEB_EXPERIENCES_OUTPUT.members["webExperiences"], - self.web_experiences, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_WEB_EXPERIENCES_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["web_experiences"] = _deserialize_web_experiences( - de, - _SCHEMA_LIST_WEB_EXPERIENCES_OUTPUT.members["webExperiences"], - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_WEB_EXPERIENCES_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_WEB_EXPERIENCES_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_WEB_EXPERIENCES = APIOperation( - input=ListWebExperiencesInput, - output=ListWebExperiencesOutput, - schema=_SCHEMA_LIST_WEB_EXPERIENCES, - input_schema=_SCHEMA_LIST_WEB_EXPERIENCES_INPUT, - output_schema=_SCHEMA_LIST_WEB_EXPERIENCES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateWebExperienceInput: - """Dataclass for UpdateWebExperienceInput structure.""" - - application_id: str | None = None - """ - The identifier of the Amazon Q Business application attached to the web - experience. - """ - - web_experience_id: str | None = None - """The identifier of the Amazon Q Business web experience.""" - - role_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the role with permission to access the - Amazon Q Business web experience and required resources. - """ - - authentication_configuration: WebExperienceAuthConfiguration | None = None - """ - The authentication configuration of the Amazon Q Business web - experience. - """ - - title: str | None = None - """The title of the Amazon Q Business web experience.""" - - subtitle: str | None = None - """The subtitle of the Amazon Q Business web experience.""" - - welcome_message: str | None = None - """ - A customized welcome message for an end user in an Amazon Q Business web - experience. - """ - - sample_prompts_control_mode: str | None = None - """ - Determines whether sample prompts are enabled in the web experience for - an end user. - """ - - identity_provider_configuration: IdentityProviderConfiguration | None = None - """ - Information about the identity provider (IdP) used to authenticate end - users of an Amazon Q Business web experience. - """ - - origins: list[str] | None = None - """ - Updates the website domain origins that are allowed to embed the Amazon - Q Business web experience. The *domain origin* refers to the *base URL* - for accessing a website including the protocol (`http/https`), the - domain name, and the port number (if specified). - - Note: - - Any values except `null` submitted as part of this update will replace - all previous values. - - - You must only submit a *base URL* and not a full path. For example, - `https://docs.aws.amazon.com`. - """ - - browser_extension_configuration: BrowserExtensionConfiguration | None = None - """ - The browser extension configuration for an Amazon Q Business web - experience. - - Note: - For Amazon Q Business application using external OIDC-compliant identity - providers (IdPs). The IdP administrator must add the browser extension - sign-in redirect URLs to the IdP application. For more information, see - [Configure external OIDC identity provider for your browser - extensions.](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/browser-extensions.html). - """ - - customization_configuration: CustomizationConfiguration | None = None - """ - Updates the custom logo, favicon, font, and color used in the Amazon Q - web experience. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_WEB_EXPERIENCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_WEB_EXPERIENCE_INPUT.members["applicationId"], - self.application_id, - ) - - if self.web_experience_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_WEB_EXPERIENCE_INPUT.members["webExperienceId"], - self.web_experience_id, - ) - - if self.role_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_WEB_EXPERIENCE_INPUT.members["roleArn"], self.role_arn - ) - - if self.authentication_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_WEB_EXPERIENCE_INPUT.members[ - "authenticationConfiguration" - ], - self.authentication_configuration, - ) - - if self.title is not None: - serializer.write_string( - _SCHEMA_UPDATE_WEB_EXPERIENCE_INPUT.members["title"], self.title - ) - - if self.subtitle is not None: - serializer.write_string( - _SCHEMA_UPDATE_WEB_EXPERIENCE_INPUT.members["subtitle"], self.subtitle - ) - - if self.welcome_message is not None: - serializer.write_string( - _SCHEMA_UPDATE_WEB_EXPERIENCE_INPUT.members["welcomeMessage"], - self.welcome_message, - ) - - if self.sample_prompts_control_mode is not None: - serializer.write_string( - _SCHEMA_UPDATE_WEB_EXPERIENCE_INPUT.members["samplePromptsControlMode"], - self.sample_prompts_control_mode, - ) - - if self.identity_provider_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_WEB_EXPERIENCE_INPUT.members[ - "identityProviderConfiguration" - ], - self.identity_provider_configuration, - ) - - if self.origins is not None: - _serialize_web_experience_origins( - serializer, - _SCHEMA_UPDATE_WEB_EXPERIENCE_INPUT.members["origins"], - self.origins, - ) - - if self.browser_extension_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_WEB_EXPERIENCE_INPUT.members[ - "browserExtensionConfiguration" - ], - self.browser_extension_configuration, - ) - - if self.customization_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_WEB_EXPERIENCE_INPUT.members[ - "customizationConfiguration" - ], - self.customization_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_UPDATE_WEB_EXPERIENCE_INPUT.members["applicationId"] - ) - - case 1: - kwargs["web_experience_id"] = de.read_string( - _SCHEMA_UPDATE_WEB_EXPERIENCE_INPUT.members["webExperienceId"] - ) - - case 2: - kwargs["role_arn"] = de.read_string( - _SCHEMA_UPDATE_WEB_EXPERIENCE_INPUT.members["roleArn"] - ) - - case 3: - kwargs["authentication_configuration"] = ( - _WebExperienceAuthConfigurationDeserializer().deserialize(de) - ) - - case 4: - kwargs["title"] = de.read_string( - _SCHEMA_UPDATE_WEB_EXPERIENCE_INPUT.members["title"] - ) - - case 5: - kwargs["subtitle"] = de.read_string( - _SCHEMA_UPDATE_WEB_EXPERIENCE_INPUT.members["subtitle"] - ) - - case 6: - kwargs["welcome_message"] = de.read_string( - _SCHEMA_UPDATE_WEB_EXPERIENCE_INPUT.members["welcomeMessage"] - ) - - case 7: - kwargs["sample_prompts_control_mode"] = ( - WebExperienceSamplePromptsControlMode( - de.read_string( - _SCHEMA_UPDATE_WEB_EXPERIENCE_INPUT.members[ - "samplePromptsControlMode" - ] - ) - ) - ) - - case 8: - kwargs["identity_provider_configuration"] = ( - _IdentityProviderConfigurationDeserializer().deserialize(de) - ) - - case 9: - kwargs["origins"] = _deserialize_web_experience_origins( - de, _SCHEMA_UPDATE_WEB_EXPERIENCE_INPUT.members["origins"] - ) - - case 10: - kwargs["browser_extension_configuration"] = ( - BrowserExtensionConfiguration.deserialize(de) - ) - - case 11: - kwargs["customization_configuration"] = ( - CustomizationConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_WEB_EXPERIENCE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateWebExperienceOutput: - """Dataclass for UpdateWebExperienceOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_WEB_EXPERIENCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_WEB_EXPERIENCE_OUTPUT, consumer=_consumer - ) - return kwargs - - -UPDATE_WEB_EXPERIENCE = APIOperation( - input=UpdateWebExperienceInput, - output=UpdateWebExperienceOutput, - schema=_SCHEMA_UPDATE_WEB_EXPERIENCE, - input_schema=_SCHEMA_UPDATE_WEB_EXPERIENCE_INPUT, - output_schema=_SCHEMA_UPDATE_WEB_EXPERIENCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class CreatorModeControl(UnknownEnumMixin, StrEnum): - ENABLED = "ENABLED" - DISABLED = "DISABLED" - - -@dataclass(kw_only=True) -class AppliedCreatorModeConfiguration: - """ - The creator mode specific admin controls configured for an Amazon Q - Business application. Determines whether an end user can generate - LLM-only responses when they use the web experience. - - For more information, see [Admin controls and - guardrails](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/guardrails.html) - and [Conversation - settings](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/using-web-experience.html#chat-source-scope). - """ - - creator_mode_control: str - """ - Information about whether creator mode is enabled or disabled for an - Amazon Q Business application. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_APPLIED_CREATOR_MODE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_APPLIED_CREATOR_MODE_CONFIGURATION.members["creatorModeControl"], - self.creator_mode_control, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["creator_mode_control"] = CreatorModeControl( - de.read_string( - _SCHEMA_APPLIED_CREATOR_MODE_CONFIGURATION.members[ - "creatorModeControl" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_APPLIED_CREATOR_MODE_CONFIGURATION, consumer=_consumer - ) - if "creator_mode_control" not in kwargs: - kwargs["creator_mode_control"] = CreatorModeControl._corrected("") - return kwargs - - -class OrchestrationControl(UnknownEnumMixin, StrEnum): - ENABLED = "ENABLED" - DISABLED = "DISABLED" - - -@dataclass(kw_only=True) -class AppliedOrchestrationConfiguration: - """ - The chat orchestration specific admin controls configured for an Amazon - Q Business application. Determines whether Amazon Q Business - automatically routes chat requests across configured plugins and data - sources in your Amazon Q Business application. - - For more information, see [Chat orchestration - settings](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/guardrails-global-controls.html#guardrails-global-orchestration). - """ - - control: str - """ - Information about whether chat orchestration is enabled or disabled for - an Amazon Q Business application. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_APPLIED_ORCHESTRATION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_APPLIED_ORCHESTRATION_CONFIGURATION.members["control"], self.control - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["control"] = OrchestrationControl( - de.read_string( - _SCHEMA_APPLIED_ORCHESTRATION_CONFIGURATION.members[ - "control" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_APPLIED_ORCHESTRATION_CONFIGURATION, consumer=_consumer - ) - if "control" not in kwargs: - kwargs["control"] = OrchestrationControl._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class AssociatedGroup: - """ - Represents a group associated with a given user in the access control - system. - """ - - name: str | None = None - """ - The name of the group associated with the user. This is used to identify - the group in access control decisions. - """ - - type: str | None = None - """ - The type of the associated group. This indicates the scope of the - group's applicability. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ASSOCIATED_GROUP, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string(_SCHEMA_ASSOCIATED_GROUP.members["name"], self.name) - - if self.type is not None: - serializer.write_string(_SCHEMA_ASSOCIATED_GROUP.members["type"], self.type) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_ASSOCIATED_GROUP.members["name"] - ) - - case 1: - kwargs["type"] = MembershipType( - de.read_string(_SCHEMA_ASSOCIATED_GROUP.members["type"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ASSOCIATED_GROUP, consumer=_consumer) - return kwargs - - -def _serialize_associated_groups( - serializer: ShapeSerializer, schema: Schema, value: list[AssociatedGroup] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_associated_groups( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AssociatedGroup]: - result: list[AssociatedGroup] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AssociatedGroup.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AssociatedUser: - """Represents an associated user in the access control system.""" - - id: str | None = None - """ - The unique identifier of the associated user. This is used to identify - the user in access control decisions. - """ - - type: str | None = None - """ - The type of the associated user. This indicates the scope of the user's - association. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ASSOCIATED_USER, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string(_SCHEMA_ASSOCIATED_USER.members["id"], self.id) - - if self.type is not None: - serializer.write_string(_SCHEMA_ASSOCIATED_USER.members["type"], self.type) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string(_SCHEMA_ASSOCIATED_USER.members["id"]) - - case 1: - kwargs["type"] = MembershipType( - de.read_string(_SCHEMA_ASSOCIATED_USER.members["type"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ASSOCIATED_USER, consumer=_consumer) - return kwargs - - -def _serialize_associated_users( - serializer: ShapeSerializer, schema: Schema, value: list[AssociatedUser] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_associated_users( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AssociatedUser]: - result: list[AssociatedUser] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AssociatedUser.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_q_iam_actions( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_q_iam_actions( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -class PermissionConditionOperator(UnknownEnumMixin, StrEnum): - STRING_EQUALS = "StringEquals" - - -def _serialize_permission_condition_values( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_permission_condition_values( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class PermissionCondition: - """ - Defines a condition that restricts when a permission is effective. - Conditions allow you to control access based on specific attributes of - the request. - """ - - condition_operator: str - """ - The operator to use for the condition evaluation. This determines how - the condition values are compared. - """ - - condition_key: str - """ - The key for the condition. This identifies the attribute that the - condition applies to. - """ - - condition_values: list[str] - """The values to compare against using the specified condition operator.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PERMISSION_CONDITION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_PERMISSION_CONDITION.members["conditionOperator"], - self.condition_operator, - ) - serializer.write_string( - _SCHEMA_PERMISSION_CONDITION.members["conditionKey"], self.condition_key - ) - _serialize_permission_condition_values( - serializer, - _SCHEMA_PERMISSION_CONDITION.members["conditionValues"], - self.condition_values, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["condition_operator"] = PermissionConditionOperator( - de.read_string( - _SCHEMA_PERMISSION_CONDITION.members["conditionOperator"] - ) - ) - - case 1: - kwargs["condition_key"] = de.read_string( - _SCHEMA_PERMISSION_CONDITION.members["conditionKey"] - ) - - case 2: - kwargs["condition_values"] = ( - _deserialize_permission_condition_values( - de, _SCHEMA_PERMISSION_CONDITION.members["conditionValues"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PERMISSION_CONDITION, consumer=_consumer) - if "condition_operator" not in kwargs: - kwargs["condition_operator"] = PermissionConditionOperator._corrected("") - if "condition_key" not in kwargs: - kwargs["condition_key"] = "" - if "condition_values" not in kwargs: - kwargs["condition_values"] = [] - return kwargs - - -def _serialize_permission_conditions( - serializer: ShapeSerializer, schema: Schema, value: list[PermissionCondition] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_permission_conditions( - deserializer: ShapeDeserializer, schema: Schema -) -> list[PermissionCondition]: - result: list[PermissionCondition] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(PermissionCondition.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AssociatePermissionInput: - """Dataclass for AssociatePermissionInput structure.""" - - application_id: str | None = None - """The unique identifier of the Amazon Q Business application.""" - - statement_id: str | None = None - """A unique identifier for the policy statement.""" - - actions: list[str] | None = None - """ - The list of Amazon Q Business actions that the ISV is allowed to - perform. - """ - - conditions: list[PermissionCondition] | None = None - """ - The conditions that restrict when the permission is effective. These - conditions can be used to limit the permission based on specific - attributes of the request. - """ - - principal: str | None = None - """ - The Amazon Resource Name of the IAM role for the ISV that is being - granted permission. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ASSOCIATE_PERMISSION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_ASSOCIATE_PERMISSION_INPUT.members["applicationId"], - self.application_id, - ) - - if self.statement_id is not None: - serializer.write_string( - _SCHEMA_ASSOCIATE_PERMISSION_INPUT.members["statementId"], - self.statement_id, - ) - - if self.actions is not None: - _serialize_q_iam_actions( - serializer, - _SCHEMA_ASSOCIATE_PERMISSION_INPUT.members["actions"], - self.actions, - ) - - if self.conditions is not None: - _serialize_permission_conditions( - serializer, - _SCHEMA_ASSOCIATE_PERMISSION_INPUT.members["conditions"], - self.conditions, - ) - - if self.principal is not None: - serializer.write_string( - _SCHEMA_ASSOCIATE_PERMISSION_INPUT.members["principal"], self.principal - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_ASSOCIATE_PERMISSION_INPUT.members["applicationId"] - ) - - case 1: - kwargs["statement_id"] = de.read_string( - _SCHEMA_ASSOCIATE_PERMISSION_INPUT.members["statementId"] - ) - - case 2: - kwargs["actions"] = _deserialize_q_iam_actions( - de, _SCHEMA_ASSOCIATE_PERMISSION_INPUT.members["actions"] - ) - - case 3: - kwargs["conditions"] = _deserialize_permission_conditions( - de, _SCHEMA_ASSOCIATE_PERMISSION_INPUT.members["conditions"] - ) - - case 4: - kwargs["principal"] = de.read_string( - _SCHEMA_ASSOCIATE_PERMISSION_INPUT.members["principal"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ASSOCIATE_PERMISSION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class AssociatePermissionOutput: - """Dataclass for AssociatePermissionOutput structure.""" - - statement: str | None = None - """The JSON representation of the added permission statement.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ASSOCIATE_PERMISSION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.statement is not None: - serializer.write_string( - _SCHEMA_ASSOCIATE_PERMISSION_OUTPUT.members["statement"], self.statement - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["statement"] = de.read_string( - _SCHEMA_ASSOCIATE_PERMISSION_OUTPUT.members["statement"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ASSOCIATE_PERMISSION_OUTPUT, consumer=_consumer - ) - return kwargs - - -ASSOCIATE_PERMISSION = APIOperation( - input=AssociatePermissionInput, - output=AssociatePermissionOutput, - schema=_SCHEMA_ASSOCIATE_PERMISSION, - input_schema=_SCHEMA_ASSOCIATE_PERMISSION_INPUT, - output_schema=_SCHEMA_ASSOCIATE_PERMISSION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.qbusiness#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ConversationSource: - """ - The source reference for an existing attachment in an existing - conversation. - """ - - conversation_id: str - """The unique identifier of the Amazon Q Business conversation.""" - - attachment_id: str - """The unique identifier of the Amazon Q Business attachment.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONVERSATION_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CONVERSATION_SOURCE.members["conversationId"], self.conversation_id - ) - serializer.write_string( - _SCHEMA_CONVERSATION_SOURCE.members["attachmentId"], self.attachment_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["conversation_id"] = de.read_string( - _SCHEMA_CONVERSATION_SOURCE.members["conversationId"] - ) - - case 1: - kwargs["attachment_id"] = de.read_string( - _SCHEMA_CONVERSATION_SOURCE.members["attachmentId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONVERSATION_SOURCE, consumer=_consumer) - if "conversation_id" not in kwargs: - kwargs["conversation_id"] = "" - if "attachment_id" not in kwargs: - kwargs["attachment_id"] = "" - return kwargs - - -@dataclass -class CopyFromSourceConversation: - """A reference to an attachment in an existing conversation.""" - - value: ConversationSource - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_COPY_FROM_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_COPY_FROM_SOURCE.members["conversation"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ConversationSource.deserialize(deserializer)) - - -@dataclass -class CopyFromSourceUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -CopyFromSource = Union[CopyFromSourceConversation | CopyFromSourceUnknown] -"""The source reference for an existing attachment.""" - - -class _CopyFromSourceDeserializer: - _result: CopyFromSource | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> CopyFromSource: - self._result = None - deserializer.read_struct(_SCHEMA_COPY_FROM_SOURCE, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(CopyFromSourceConversation.deserialize(de)) - - case _: - self._set_result(CopyFromSourceUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: CopyFromSource) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class AttachmentStatus(UnknownEnumMixin, StrEnum): - FAILED = "FAILED" - SUCCESS = "SUCCESS" - - -@dataclass(kw_only=True) -class Attachment: - """An attachment in an Amazon Q Business conversation.""" - - attachment_id: str | None = None - """The identifier of the Amazon Q Business attachment.""" - - conversation_id: str | None = None - """ - The identifier of the Amazon Q Business conversation the attachment is - associated with. - """ - - name: str | None = None - """Filename of the Amazon Q Business attachment.""" - - copy_from: CopyFromSource | None = None - """ - A CopyFromSource containing a reference to the original source of the - Amazon Q Business attachment. - """ - - file_type: str | None = None - """Filetype of the Amazon Q Business attachment.""" - - file_size: int | None = None - """Size in bytes of the Amazon Q Business attachment.""" - - md5chksum: str | None = None - """MD5 checksum of the Amazon Q Business attachment contents.""" - - created_at: datetime | None = None - """The Unix timestamp when the Amazon Q Business attachment was created.""" - - status: str | None = None - """AttachmentStatus of the Amazon Q Business attachment.""" - - error: ErrorDetail | None = None - """ - ErrorDetail providing information about a Amazon Q Business attachment - error. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ATTACHMENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.attachment_id is not None: - serializer.write_string( - _SCHEMA_ATTACHMENT.members["attachmentId"], self.attachment_id - ) - - if self.conversation_id is not None: - serializer.write_string( - _SCHEMA_ATTACHMENT.members["conversationId"], self.conversation_id - ) - - if self.name is not None: - serializer.write_string(_SCHEMA_ATTACHMENT.members["name"], self.name) - - if self.copy_from is not None: - serializer.write_struct( - _SCHEMA_ATTACHMENT.members["copyFrom"], self.copy_from - ) - - if self.file_type is not None: - serializer.write_string( - _SCHEMA_ATTACHMENT.members["fileType"], self.file_type - ) - - if self.file_size is not None: - serializer.write_integer( - _SCHEMA_ATTACHMENT.members["fileSize"], self.file_size - ) - - if self.md5chksum is not None: - serializer.write_string( - _SCHEMA_ATTACHMENT.members["md5chksum"], self.md5chksum - ) - - if self.created_at is not None: - serializer.write_timestamp( - _SCHEMA_ATTACHMENT.members["createdAt"], self.created_at - ) - - if self.status is not None: - serializer.write_string(_SCHEMA_ATTACHMENT.members["status"], self.status) - - if self.error is not None: - serializer.write_struct(_SCHEMA_ATTACHMENT.members["error"], self.error) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["attachment_id"] = de.read_string( - _SCHEMA_ATTACHMENT.members["attachmentId"] - ) - - case 1: - kwargs["conversation_id"] = de.read_string( - _SCHEMA_ATTACHMENT.members["conversationId"] - ) - - case 2: - kwargs["name"] = de.read_string(_SCHEMA_ATTACHMENT.members["name"]) - - case 3: - kwargs["copy_from"] = _CopyFromSourceDeserializer().deserialize(de) - - case 4: - kwargs["file_type"] = de.read_string( - _SCHEMA_ATTACHMENT.members["fileType"] - ) - - case 5: - kwargs["file_size"] = de.read_integer( - _SCHEMA_ATTACHMENT.members["fileSize"] - ) - - case 6: - kwargs["md5chksum"] = de.read_string( - _SCHEMA_ATTACHMENT.members["md5chksum"] - ) - - case 7: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_ATTACHMENT.members["createdAt"] - ) - - case 8: - kwargs["status"] = AttachmentStatus( - de.read_string(_SCHEMA_ATTACHMENT.members["status"]) - ) - - case 9: - kwargs["error"] = ErrorDetail.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ATTACHMENT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class AttachmentInput: - """ - This is either a file directly uploaded into a web experience chat or a - reference to an existing attachment that is part of a web experience - chat. - """ - - data: bytes | None = None - """The contents of the attachment.""" - - name: str | None = None - """The filename of the attachment.""" - - copy_from: CopyFromSource | None = None - """A reference to an existing attachment.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ATTACHMENT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.data is not None: - serializer.write_blob(_SCHEMA_ATTACHMENT_INPUT.members["data"], self.data) - - if self.name is not None: - serializer.write_string(_SCHEMA_ATTACHMENT_INPUT.members["name"], self.name) - - if self.copy_from is not None: - serializer.write_struct( - _SCHEMA_ATTACHMENT_INPUT.members["copyFrom"], self.copy_from - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["data"] = de.read_blob( - _SCHEMA_ATTACHMENT_INPUT.members["data"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_ATTACHMENT_INPUT.members["name"] - ) - - case 2: - kwargs["copy_from"] = _CopyFromSourceDeserializer().deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ATTACHMENT_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class AttachmentInputEvent: - """ - A file input event activated by a end user request to upload files into - their web experience chat. - """ - - attachment: AttachmentInput | None = None - """ - This is either a file directly uploaded into a web experience chat or a - reference to an existing attachment that is part of a web experience - chat. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ATTACHMENT_INPUT_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.attachment is not None: - serializer.write_struct( - _SCHEMA_ATTACHMENT_INPUT_EVENT.members["attachment"], self.attachment - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["attachment"] = AttachmentInput.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ATTACHMENT_INPUT_EVENT, consumer=_consumer) - return kwargs - - -def _serialize_attachment_list( - serializer: ShapeSerializer, schema: Schema, value: list[Attachment] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_attachment_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Attachment]: - result: list[Attachment] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Attachment.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AttachmentOutput: - """The details of a file uploaded during chat.""" - - name: str | None = None - """The name of a file uploaded during chat.""" - - status: str | None = None - """The status of a file uploaded during chat.""" - - error: ErrorDetail | None = None - """An error associated with a file uploaded during chat.""" - - attachment_id: str | None = None - """The unique identifier of the Amazon Q Business attachment.""" - - conversation_id: str | None = None - """The unique identifier of the Amazon Q Business conversation.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ATTACHMENT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_ATTACHMENT_OUTPUT.members["name"], self.name - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_ATTACHMENT_OUTPUT.members["status"], self.status - ) - - if self.error is not None: - serializer.write_struct( - _SCHEMA_ATTACHMENT_OUTPUT.members["error"], self.error - ) - - if self.attachment_id is not None: - serializer.write_string( - _SCHEMA_ATTACHMENT_OUTPUT.members["attachmentId"], self.attachment_id - ) - - if self.conversation_id is not None: - serializer.write_string( - _SCHEMA_ATTACHMENT_OUTPUT.members["conversationId"], - self.conversation_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_ATTACHMENT_OUTPUT.members["name"] - ) - - case 1: - kwargs["status"] = AttachmentStatus( - de.read_string(_SCHEMA_ATTACHMENT_OUTPUT.members["status"]) - ) - - case 2: - kwargs["error"] = ErrorDetail.deserialize(de) - - case 3: - kwargs["attachment_id"] = de.read_string( - _SCHEMA_ATTACHMENT_OUTPUT.members["attachmentId"] - ) - - case 4: - kwargs["conversation_id"] = de.read_string( - _SCHEMA_ATTACHMENT_OUTPUT.members["conversationId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ATTACHMENT_OUTPUT, consumer=_consumer) - return kwargs - - -def _serialize_attachments_input( - serializer: ShapeSerializer, schema: Schema, value: list[AttachmentInput] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_attachments_input( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AttachmentInput]: - result: list[AttachmentInput] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AttachmentInput.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_attachments_output( - serializer: ShapeSerializer, schema: Schema, value: list[AttachmentOutput] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_attachments_output( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AttachmentOutput]: - result: list[AttachmentOutput] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AttachmentOutput.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class AudioExtractionType(UnknownEnumMixin, StrEnum): - TRANSCRIPT = "TRANSCRIPT" - SUMMARY = "SUMMARY" - - -@dataclass(kw_only=True) -class AudioSourceDetails: - """ - Details about an audio source, including its identifier, format, and - time information. - """ - - media_id: str | None = None - """Unique identifier for the audio media file.""" - - media_mime_type: str | None = None - """The MIME type of the audio file (e.g., audio/mp3, audio/wav).""" - - start_time_milliseconds: int | None = None - """The starting timestamp in milliseconds for the relevant audio segment.""" - - end_time_milliseconds: int | None = None - """The ending timestamp in milliseconds for the relevant audio segment.""" - - audio_extraction_type: str | None = None - """The type of audio extraction performed on the content.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUDIO_SOURCE_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.media_id is not None: - serializer.write_string( - _SCHEMA_AUDIO_SOURCE_DETAILS.members["mediaId"], self.media_id - ) - - if self.media_mime_type is not None: - serializer.write_string( - _SCHEMA_AUDIO_SOURCE_DETAILS.members["mediaMimeType"], - self.media_mime_type, - ) - - if self.start_time_milliseconds is not None: - serializer.write_long( - _SCHEMA_AUDIO_SOURCE_DETAILS.members["startTimeMilliseconds"], - self.start_time_milliseconds, - ) - - if self.end_time_milliseconds is not None: - serializer.write_long( - _SCHEMA_AUDIO_SOURCE_DETAILS.members["endTimeMilliseconds"], - self.end_time_milliseconds, - ) - - if self.audio_extraction_type is not None: - serializer.write_string( - _SCHEMA_AUDIO_SOURCE_DETAILS.members["audioExtractionType"], - self.audio_extraction_type, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["media_id"] = de.read_string( - _SCHEMA_AUDIO_SOURCE_DETAILS.members["mediaId"] - ) - - case 1: - kwargs["media_mime_type"] = de.read_string( - _SCHEMA_AUDIO_SOURCE_DETAILS.members["mediaMimeType"] - ) - - case 2: - kwargs["start_time_milliseconds"] = de.read_long( - _SCHEMA_AUDIO_SOURCE_DETAILS.members["startTimeMilliseconds"] - ) - - case 3: - kwargs["end_time_milliseconds"] = de.read_long( - _SCHEMA_AUDIO_SOURCE_DETAILS.members["endTimeMilliseconds"] - ) - - case 4: - kwargs["audio_extraction_type"] = AudioExtractionType( - de.read_string( - _SCHEMA_AUDIO_SOURCE_DETAILS.members["audioExtractionType"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AUDIO_SOURCE_DETAILS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class AuthChallengeRequest: - """ - A request made by Amazon Q Business to a third paty authentication - server to authenticate a custom plugin user. - """ - - authorization_url: str - """ - The URL sent by Amazon Q Business to the third party authentication - server to authenticate a custom plugin user through an OAuth protocol. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTH_CHALLENGE_REQUEST, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AUTH_CHALLENGE_REQUEST.members["authorizationUrl"], - self.authorization_url, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["authorization_url"] = de.read_string( - _SCHEMA_AUTH_CHALLENGE_REQUEST.members["authorizationUrl"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AUTH_CHALLENGE_REQUEST, consumer=_consumer) - if "authorization_url" not in kwargs: - kwargs["authorization_url"] = "" - return kwargs - - -@dataclass(kw_only=True) -class AuthChallengeRequestEvent: - """ - An authentication verification event activated by an end user request to - use a custom plugin. - """ - - authorization_url: str - """ - The URL sent by Amazon Q Business to a third party authentication server - in response to an authentication verification event activated by an end - user request to use a custom plugin. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTH_CHALLENGE_REQUEST_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_AUTH_CHALLENGE_REQUEST_EVENT.members["authorizationUrl"], - self.authorization_url, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["authorization_url"] = de.read_string( - _SCHEMA_AUTH_CHALLENGE_REQUEST_EVENT.members["authorizationUrl"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTH_CHALLENGE_REQUEST_EVENT, consumer=_consumer - ) - if "authorization_url" not in kwargs: - kwargs["authorization_url"] = "" - return kwargs - - -def _serialize_authorization_response_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_authorization_response_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AuthChallengeResponse: - """ - Contains details of the authentication information received from a third - party authentication server in response to an authentication challenge. - """ - - response_map: dict[str, str] - """The mapping of key-value pairs in an authentication challenge response.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTH_CHALLENGE_RESPONSE, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_authorization_response_map( - serializer, - _SCHEMA_AUTH_CHALLENGE_RESPONSE.members["responseMap"], - self.response_map, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["response_map"] = _deserialize_authorization_response_map( - de, _SCHEMA_AUTH_CHALLENGE_RESPONSE.members["responseMap"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AUTH_CHALLENGE_RESPONSE, consumer=_consumer) - if "response_map" not in kwargs: - kwargs["response_map"] = {} - return kwargs - - -@dataclass(kw_only=True) -class AuthChallengeResponseEvent: - """ - An authentication verification event response by a third party - authentication server to Amazon Q Business. - """ - - response_map: dict[str, str] - """The mapping of key-value pairs in an authentication challenge response.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTH_CHALLENGE_RESPONSE_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_authorization_response_map( - serializer, - _SCHEMA_AUTH_CHALLENGE_RESPONSE_EVENT.members["responseMap"], - self.response_map, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["response_map"] = _deserialize_authorization_response_map( - de, _SCHEMA_AUTH_CHALLENGE_RESPONSE_EVENT.members["responseMap"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTH_CHALLENGE_RESPONSE_EVENT, consumer=_consumer - ) - if "response_map" not in kwargs: - kwargs["response_map"] = {} - return kwargs - - -@dataclass(kw_only=True) -class DeleteDocument: - """A document deleted from an Amazon Q Business data source connector.""" - - document_id: str - """The identifier of the deleted document.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_DOCUMENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DELETE_DOCUMENT.members["documentId"], self.document_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["document_id"] = de.read_string( - _SCHEMA_DELETE_DOCUMENT.members["documentId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_DOCUMENT, consumer=_consumer) - if "document_id" not in kwargs: - kwargs["document_id"] = "" - return kwargs - - -def _serialize_delete_documents( - serializer: ShapeSerializer, schema: Schema, value: list[DeleteDocument] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_delete_documents( - deserializer: ShapeDeserializer, schema: Schema -) -> list[DeleteDocument]: - result: list[DeleteDocument] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(DeleteDocument.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class BatchDeleteDocumentInput: - """Dataclass for BatchDeleteDocumentInput structure.""" - - application_id: str | None = None - """The identifier of the Amazon Q Business application.""" - - index_id: str | None = None - """ - The identifier of the Amazon Q Business index that contains the - documents to delete. - """ - - documents: list[DeleteDocument] | None = None - """Documents deleted from the Amazon Q Business index.""" - - data_source_sync_id: str | None = None - """ - The identifier of the data source sync during which the documents were - deleted. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BATCH_DELETE_DOCUMENT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_BATCH_DELETE_DOCUMENT_INPUT.members["applicationId"], - self.application_id, - ) - - if self.index_id is not None: - serializer.write_string( - _SCHEMA_BATCH_DELETE_DOCUMENT_INPUT.members["indexId"], self.index_id - ) - - if self.documents is not None: - _serialize_delete_documents( - serializer, - _SCHEMA_BATCH_DELETE_DOCUMENT_INPUT.members["documents"], - self.documents, - ) - - if self.data_source_sync_id is not None: - serializer.write_string( - _SCHEMA_BATCH_DELETE_DOCUMENT_INPUT.members["dataSourceSyncId"], - self.data_source_sync_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_BATCH_DELETE_DOCUMENT_INPUT.members["applicationId"] - ) - - case 1: - kwargs["index_id"] = de.read_string( - _SCHEMA_BATCH_DELETE_DOCUMENT_INPUT.members["indexId"] - ) - - case 2: - kwargs["documents"] = _deserialize_delete_documents( - de, _SCHEMA_BATCH_DELETE_DOCUMENT_INPUT.members["documents"] - ) - - case 3: - kwargs["data_source_sync_id"] = de.read_string( - _SCHEMA_BATCH_DELETE_DOCUMENT_INPUT.members["dataSourceSyncId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_BATCH_DELETE_DOCUMENT_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class FailedDocument: - """ - A list of documents that could not be removed from an Amazon Q Business - index. Each entry contains an error message that indicates why the - document couldn't be removed from the index. - """ - - id: str | None = None - """ - The identifier of the document that couldn't be removed from the Amazon - Q Business index. - """ - - error: ErrorDetail | None = None - """An explanation for why the document couldn't be removed from the index.""" - - data_source_id: str | None = None - """ - The identifier of the Amazon Q Business data source connector that - contains the failed document. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FAILED_DOCUMENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string(_SCHEMA_FAILED_DOCUMENT.members["id"], self.id) - - if self.error is not None: - serializer.write_struct( - _SCHEMA_FAILED_DOCUMENT.members["error"], self.error - ) - - if self.data_source_id is not None: - serializer.write_string( - _SCHEMA_FAILED_DOCUMENT.members["dataSourceId"], self.data_source_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string(_SCHEMA_FAILED_DOCUMENT.members["id"]) - - case 1: - kwargs["error"] = ErrorDetail.deserialize(de) - - case 2: - kwargs["data_source_id"] = de.read_string( - _SCHEMA_FAILED_DOCUMENT.members["dataSourceId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FAILED_DOCUMENT, consumer=_consumer) - return kwargs - - -def _serialize_failed_documents( - serializer: ShapeSerializer, schema: Schema, value: list[FailedDocument] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_failed_documents( - deserializer: ShapeDeserializer, schema: Schema -) -> list[FailedDocument]: - result: list[FailedDocument] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(FailedDocument.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class BatchDeleteDocumentOutput: - """Dataclass for BatchDeleteDocumentOutput structure.""" - - failed_documents: list[FailedDocument] | None = None - """ - A list of documents that couldn't be removed from the Amazon Q Business - index. Each entry contains an error message that indicates why the - document couldn't be removed from the index. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BATCH_DELETE_DOCUMENT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.failed_documents is not None: - _serialize_failed_documents( - serializer, - _SCHEMA_BATCH_DELETE_DOCUMENT_OUTPUT.members["failedDocuments"], - self.failed_documents, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["failed_documents"] = _deserialize_failed_documents( - de, - _SCHEMA_BATCH_DELETE_DOCUMENT_OUTPUT.members["failedDocuments"], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_BATCH_DELETE_DOCUMENT_OUTPUT, consumer=_consumer - ) - return kwargs - - -BATCH_DELETE_DOCUMENT = APIOperation( - input=BatchDeleteDocumentInput, - output=BatchDeleteDocumentOutput, - schema=_SCHEMA_BATCH_DELETE_DOCUMENT, - input_schema=_SCHEMA_BATCH_DELETE_DOCUMENT_INPUT, - output_schema=_SCHEMA_BATCH_DELETE_DOCUMENT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -def _serialize_document_attributes( - serializer: ShapeSerializer, schema: Schema, value: list[DocumentAttribute] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_document_attributes( - deserializer: ShapeDeserializer, schema: Schema -) -> list[DocumentAttribute]: - result: list[DocumentAttribute] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(DocumentAttribute.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass -class DocumentContentBlob: - """ - The contents of the document. Documents passed to the `blob` parameter - must be base64 encoded. Your code might not need to encode the document - file bytes if you're using an Amazon Web Services SDK to call Amazon Q - Business APIs. If you are calling the Amazon Q Business endpoint - directly using REST, you must base64 encode the contents before sending. - """ - - value: bytes - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_CONTENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_blob(_SCHEMA_DOCUMENT_CONTENT.members["blob"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_blob(_SCHEMA_DOCUMENT_CONTENT.members["blob"]) - ) - - -@dataclass -class DocumentContentS3: - """The path to the document in an Amazon S3 bucket.""" - - value: S3 - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_CONTENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_CONTENT.members["s3"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=S3.deserialize(deserializer)) - - -@dataclass -class DocumentContentUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -DocumentContent = Union[ - DocumentContentBlob | DocumentContentS3 | DocumentContentUnknown -] -""" -The contents of a document. - -Note: - Documents have size limitations. The maximum file size for a document is - 50 MB. The maximum amount of text that can be extracted from a single - document is 5 MB. For more information, see [Supported document formats - in Amazon Q - Business](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/doc-types.html). -""" - - -class _DocumentContentDeserializer: - _result: DocumentContent | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> DocumentContent: - self._result = None - deserializer.read_struct(_SCHEMA_DOCUMENT_CONTENT, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(DocumentContentBlob.deserialize(de)) - - case 1: - self._set_result(DocumentContentS3.deserialize(de)) - - case _: - self._set_result( - DocumentContentUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: DocumentContent) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class ContentType(UnknownEnumMixin, StrEnum): - PDF = "PDF" - HTML = "HTML" - MS_WORD = "MS_WORD" - PLAIN_TEXT = "PLAIN_TEXT" - PPT = "PPT" - RTF = "RTF" - XML = "XML" - XSLT = "XSLT" - MS_EXCEL = "MS_EXCEL" - CSV = "CSV" - JSON = "JSON" - MD = "MD" - - -@dataclass(kw_only=True) -class Document: - """A document in an Amazon Q Business application.""" - - id: str - """The identifier of the document.""" - - attributes: list[DocumentAttribute] | None = None - """ - Custom attributes to apply to the document for refining Amazon Q - Business web experience responses. - """ - - content: DocumentContent | None = None - """The contents of the document.""" - - content_type: str | None = None - """ - The file type of the document in the Blob field. - - If you want to index snippets or subsets of HTML documents instead of - the entirety of the HTML documents, you add the `HTML` start and closing - tags (`content`) around the content. - """ - - title: str | None = None - """The title of the document.""" - - access_configuration: AccessConfiguration | None = None - """Configuration information for access permission to a document.""" - - document_enrichment_configuration: DocumentEnrichmentConfiguration | None = None - """ - The configuration information for altering document metadata and content - during the document ingestion process. - """ - - media_extraction_configuration: MediaExtractionConfiguration | None = None - """The configuration for extracting information from media in the document.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_DOCUMENT.members["id"], self.id) - if self.attributes is not None: - _serialize_document_attributes( - serializer, _SCHEMA_DOCUMENT.members["attributes"], self.attributes - ) - - if self.content is not None: - serializer.write_struct(_SCHEMA_DOCUMENT.members["content"], self.content) - - if self.content_type is not None: - serializer.write_string( - _SCHEMA_DOCUMENT.members["contentType"], self.content_type - ) - - if self.title is not None: - serializer.write_string(_SCHEMA_DOCUMENT.members["title"], self.title) - - if self.access_configuration is not None: - serializer.write_struct( - _SCHEMA_DOCUMENT.members["accessConfiguration"], - self.access_configuration, - ) - - if self.document_enrichment_configuration is not None: - serializer.write_struct( - _SCHEMA_DOCUMENT.members["documentEnrichmentConfiguration"], - self.document_enrichment_configuration, - ) - - if self.media_extraction_configuration is not None: - serializer.write_struct( - _SCHEMA_DOCUMENT.members["mediaExtractionConfiguration"], - self.media_extraction_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string(_SCHEMA_DOCUMENT.members["id"]) - - case 1: - kwargs["attributes"] = _deserialize_document_attributes( - de, _SCHEMA_DOCUMENT.members["attributes"] - ) - - case 2: - kwargs["content"] = _DocumentContentDeserializer().deserialize(de) - - case 3: - kwargs["content_type"] = ContentType( - de.read_string(_SCHEMA_DOCUMENT.members["contentType"]) - ) - - case 4: - kwargs["title"] = de.read_string(_SCHEMA_DOCUMENT.members["title"]) - - case 5: - kwargs["access_configuration"] = AccessConfiguration.deserialize(de) - - case 6: - kwargs["document_enrichment_configuration"] = ( - DocumentEnrichmentConfiguration.deserialize(de) - ) - - case 7: - kwargs["media_extraction_configuration"] = ( - MediaExtractionConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DOCUMENT, consumer=_consumer) - if "id" not in kwargs: - kwargs["id"] = "" - return kwargs - - -def _serialize_documents( - serializer: ShapeSerializer, schema: Schema, value: list[Document] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_documents( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Document]: - result: list[Document] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Document.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class BatchPutDocumentInput: - """Dataclass for BatchPutDocumentInput structure.""" - - application_id: str | None = None - """The identifier of the Amazon Q Business application.""" - - index_id: str | None = None - """The identifier of the Amazon Q Business index to add the documents to.""" - - documents: list[Document] | None = None - """ - One or more documents to add to the index. - - Warning: - Ensure that the name of your document doesn't contain any confidential - information. Amazon Q Business returns document names in chat responses - and citations when relevant. - """ - - role_arn: str | None = None - """ - The Amazon Resource Name (ARN) of an IAM role with permission to access - your S3 bucket. - """ - - data_source_sync_id: str | None = None - """ - The identifier of the data source sync during which the documents were - added. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BATCH_PUT_DOCUMENT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_BATCH_PUT_DOCUMENT_INPUT.members["applicationId"], - self.application_id, - ) - - if self.index_id is not None: - serializer.write_string( - _SCHEMA_BATCH_PUT_DOCUMENT_INPUT.members["indexId"], self.index_id - ) - - if self.documents is not None: - _serialize_documents( - serializer, - _SCHEMA_BATCH_PUT_DOCUMENT_INPUT.members["documents"], - self.documents, - ) - - if self.role_arn is not None: - serializer.write_string( - _SCHEMA_BATCH_PUT_DOCUMENT_INPUT.members["roleArn"], self.role_arn - ) - - if self.data_source_sync_id is not None: - serializer.write_string( - _SCHEMA_BATCH_PUT_DOCUMENT_INPUT.members["dataSourceSyncId"], - self.data_source_sync_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_BATCH_PUT_DOCUMENT_INPUT.members["applicationId"] - ) - - case 1: - kwargs["index_id"] = de.read_string( - _SCHEMA_BATCH_PUT_DOCUMENT_INPUT.members["indexId"] - ) - - case 2: - kwargs["documents"] = _deserialize_documents( - de, _SCHEMA_BATCH_PUT_DOCUMENT_INPUT.members["documents"] - ) - - case 3: - kwargs["role_arn"] = de.read_string( - _SCHEMA_BATCH_PUT_DOCUMENT_INPUT.members["roleArn"] - ) - - case 4: - kwargs["data_source_sync_id"] = de.read_string( - _SCHEMA_BATCH_PUT_DOCUMENT_INPUT.members["dataSourceSyncId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BATCH_PUT_DOCUMENT_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class BatchPutDocumentOutput: - """Dataclass for BatchPutDocumentOutput structure.""" - - failed_documents: list[FailedDocument] | None = None - """ - A list of documents that were not added to the Amazon Q Business index - because the document failed a validation check. Each document contains - an error message that indicates why the document couldn't be added to - the index. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BATCH_PUT_DOCUMENT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.failed_documents is not None: - _serialize_failed_documents( - serializer, - _SCHEMA_BATCH_PUT_DOCUMENT_OUTPUT.members["failedDocuments"], - self.failed_documents, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["failed_documents"] = _deserialize_failed_documents( - de, _SCHEMA_BATCH_PUT_DOCUMENT_OUTPUT.members["failedDocuments"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BATCH_PUT_DOCUMENT_OUTPUT, consumer=_consumer) - return kwargs - - -BATCH_PUT_DOCUMENT = APIOperation( - input=BatchPutDocumentInput, - output=BatchPutDocumentOutput, - schema=_SCHEMA_BATCH_PUT_DOCUMENT, - input_schema=_SCHEMA_BATCH_PUT_DOCUMENT_INPUT, - output_schema=_SCHEMA_BATCH_PUT_DOCUMENT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.qbusiness#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -def _serialize_blocked_phrases( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_blocked_phrases( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class BlockedPhrasesConfiguration: - """ - Provides information about the phrases blocked from chat by your chat - control configuration. - """ - - blocked_phrases: list[str] | None = None - """ - A list of phrases blocked from a Amazon Q Business web experience chat. - - Note: - Each phrase can contain a maximum of 36 characters. The list can contain - a maximum of 20 phrases. - """ - - system_message_override: str | None = None - """ - The configured custom message displayed to an end user informing them - that they've used a blocked phrase during chat. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BLOCKED_PHRASES_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.blocked_phrases is not None: - _serialize_blocked_phrases( - serializer, - _SCHEMA_BLOCKED_PHRASES_CONFIGURATION.members["blockedPhrases"], - self.blocked_phrases, - ) - - if self.system_message_override is not None: - serializer.write_string( - _SCHEMA_BLOCKED_PHRASES_CONFIGURATION.members["systemMessageOverride"], - self.system_message_override, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["blocked_phrases"] = _deserialize_blocked_phrases( - de, - _SCHEMA_BLOCKED_PHRASES_CONFIGURATION.members["blockedPhrases"], - ) - - case 1: - kwargs["system_message_override"] = de.read_string( - _SCHEMA_BLOCKED_PHRASES_CONFIGURATION.members[ - "systemMessageOverride" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_BLOCKED_PHRASES_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class BlockedPhrasesConfigurationUpdate: - """ - Updates a blocked phrases configuration in your Amazon Q Business - application. - """ - - blocked_phrases_to_create_or_update: list[str] | None = None - """ - Creates or updates a blocked phrases configuration in your Amazon Q - Business application. - """ - - blocked_phrases_to_delete: list[str] | None = None - """ - Deletes a blocked phrases configuration in your Amazon Q Business - application. - """ - - system_message_override: str | None = None - """ - The configured custom message displayed to your end user when they use - blocked phrase during chat. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BLOCKED_PHRASES_CONFIGURATION_UPDATE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.blocked_phrases_to_create_or_update is not None: - _serialize_blocked_phrases( - serializer, - _SCHEMA_BLOCKED_PHRASES_CONFIGURATION_UPDATE.members[ - "blockedPhrasesToCreateOrUpdate" - ], - self.blocked_phrases_to_create_or_update, - ) - - if self.blocked_phrases_to_delete is not None: - _serialize_blocked_phrases( - serializer, - _SCHEMA_BLOCKED_PHRASES_CONFIGURATION_UPDATE.members[ - "blockedPhrasesToDelete" - ], - self.blocked_phrases_to_delete, - ) - - if self.system_message_override is not None: - serializer.write_string( - _SCHEMA_BLOCKED_PHRASES_CONFIGURATION_UPDATE.members[ - "systemMessageOverride" - ], - self.system_message_override, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["blocked_phrases_to_create_or_update"] = ( - _deserialize_blocked_phrases( - de, - _SCHEMA_BLOCKED_PHRASES_CONFIGURATION_UPDATE.members[ - "blockedPhrasesToCreateOrUpdate" - ], - ) - ) - - case 1: - kwargs["blocked_phrases_to_delete"] = _deserialize_blocked_phrases( - de, - _SCHEMA_BLOCKED_PHRASES_CONFIGURATION_UPDATE.members[ - "blockedPhrasesToDelete" - ], - ) - - case 2: - kwargs["system_message_override"] = de.read_string( - _SCHEMA_BLOCKED_PHRASES_CONFIGURATION_UPDATE.members[ - "systemMessageOverride" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_BLOCKED_PHRASES_CONFIGURATION_UPDATE, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CancelSubscriptionInput: - """Dataclass for CancelSubscriptionInput structure.""" - - application_id: str | None = None - """ - The identifier of the Amazon Q Business application for which the - subscription is being cancelled. - """ - - subscription_id: str | None = None - """The identifier of the Amazon Q Business subscription being cancelled.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CANCEL_SUBSCRIPTION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_CANCEL_SUBSCRIPTION_INPUT.members["applicationId"], - self.application_id, - ) - - if self.subscription_id is not None: - serializer.write_string( - _SCHEMA_CANCEL_SUBSCRIPTION_INPUT.members["subscriptionId"], - self.subscription_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_CANCEL_SUBSCRIPTION_INPUT.members["applicationId"] - ) - - case 1: - kwargs["subscription_id"] = de.read_string( - _SCHEMA_CANCEL_SUBSCRIPTION_INPUT.members["subscriptionId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CANCEL_SUBSCRIPTION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class SubscriptionDetails: - """The details of an Amazon Q Business subscription.""" - - type: str | None = None - """The type of an Amazon Q Business subscription.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SUBSCRIPTION_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_SUBSCRIPTION_DETAILS.members["type"], self.type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = SubscriptionType( - de.read_string(_SCHEMA_SUBSCRIPTION_DETAILS.members["type"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SUBSCRIPTION_DETAILS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CancelSubscriptionOutput: - """Dataclass for CancelSubscriptionOutput structure.""" - - subscription_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the Amazon Q Business subscription - being cancelled. - """ - - current_subscription: SubscriptionDetails | None = None - """The type of your current Amazon Q Business subscription.""" - - next_subscription: SubscriptionDetails | None = None - """The type of the Amazon Q Business subscription for the next month.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CANCEL_SUBSCRIPTION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.subscription_arn is not None: - serializer.write_string( - _SCHEMA_CANCEL_SUBSCRIPTION_OUTPUT.members["subscriptionArn"], - self.subscription_arn, - ) - - if self.current_subscription is not None: - serializer.write_struct( - _SCHEMA_CANCEL_SUBSCRIPTION_OUTPUT.members["currentSubscription"], - self.current_subscription, - ) - - if self.next_subscription is not None: - serializer.write_struct( - _SCHEMA_CANCEL_SUBSCRIPTION_OUTPUT.members["nextSubscription"], - self.next_subscription, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["subscription_arn"] = de.read_string( - _SCHEMA_CANCEL_SUBSCRIPTION_OUTPUT.members["subscriptionArn"] - ) - - case 1: - kwargs["current_subscription"] = SubscriptionDetails.deserialize(de) - - case 2: - kwargs["next_subscription"] = SubscriptionDetails.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CANCEL_SUBSCRIPTION_OUTPUT, consumer=_consumer) - return kwargs - - -CANCEL_SUBSCRIPTION = APIOperation( - input=CancelSubscriptionInput, - output=CancelSubscriptionOutput, - schema=_SCHEMA_CANCEL_SUBSCRIPTION, - input_schema=_SCHEMA_CANCEL_SUBSCRIPTION_INPUT, - output_schema=_SCHEMA_CANCEL_SUBSCRIPTION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class ChatMode(UnknownEnumMixin, StrEnum): - RETRIEVAL_MODE = "RETRIEVAL_MODE" - CREATOR_MODE = "CREATOR_MODE" - PLUGIN_MODE = "PLUGIN_MODE" - - -@dataclass(kw_only=True) -class PluginConfiguration: - """ - Configuration information required to invoke chat in `PLUGIN_MODE`. - - For more information, see [Admin controls and - guardrails](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/guardrails.html), - [Plugins](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/plugins.html), - and [Conversation - settings](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/using-web-experience.html#chat-source-scope). - """ - - plugin_id: str - """The identifier of the plugin you want to use.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PLUGIN_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_PLUGIN_CONFIGURATION.members["pluginId"], self.plugin_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["plugin_id"] = de.read_string( - _SCHEMA_PLUGIN_CONFIGURATION.members["pluginId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PLUGIN_CONFIGURATION, consumer=_consumer) - if "plugin_id" not in kwargs: - kwargs["plugin_id"] = "" - return kwargs - - -@dataclass -class ChatModeConfigurationPluginConfiguration: - """Configuration information required to invoke chat in `PLUGIN_MODE`.""" - - value: PluginConfiguration - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CHAT_MODE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CHAT_MODE_CONFIGURATION.members["pluginConfiguration"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=PluginConfiguration.deserialize(deserializer)) - - -@dataclass -class ChatModeConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ChatModeConfiguration = Union[ - ChatModeConfigurationPluginConfiguration | ChatModeConfigurationUnknown -] -""" -Configuration information for Amazon Q Business conversation modes. - -For more information, see [Admin controls and -guardrails](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/guardrails.html) -and [Conversation -settings](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/using-web-experience.html#chat-source-scope). -""" - - -class _ChatModeConfigurationDeserializer: - _result: ChatModeConfiguration | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> ChatModeConfiguration: - self._result = None - deserializer.read_struct(_SCHEMA_CHAT_MODE_CONFIGURATION, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - ChatModeConfigurationPluginConfiguration.deserialize(de) - ) - - case _: - self._set_result( - ChatModeConfigurationUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: ChatModeConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class EndOfInputEvent: - """The end of the streaming input for the `Chat` API.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_END_OF_INPUT_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_END_OF_INPUT_EVENT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class TextInputEvent: - """ - An input event for a end user message in an Amazon Q Business web - experience. - """ - - user_message: str - """A user message in a text message input event.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TEXT_INPUT_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_TEXT_INPUT_EVENT.members["userMessage"], self.user_message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["user_message"] = de.read_string( - _SCHEMA_TEXT_INPUT_EVENT.members["userMessage"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TEXT_INPUT_EVENT, consumer=_consumer) - if "user_message" not in kwargs: - kwargs["user_message"] = "" - return kwargs - - -def _serialize_user_groups( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_user_groups( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class FailedAttachmentEvent: - """A failed file upload during web experience chat.""" - - conversation_id: str | None = None - """ - The identifier of the conversation associated with the failed file - upload. - """ - - user_message_id: str | None = None - """ - The identifier of the end user chat message associated with the file - upload. - """ - - system_message_id: str | None = None - """ - The identifier of the AI-generated message associated with the file - upload. - """ - - attachment: AttachmentOutput | None = None - """The details of a file uploaded during chat.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FAILED_ATTACHMENT_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.conversation_id is not None: - serializer.write_string( - _SCHEMA_FAILED_ATTACHMENT_EVENT.members["conversationId"], - self.conversation_id, - ) - - if self.user_message_id is not None: - serializer.write_string( - _SCHEMA_FAILED_ATTACHMENT_EVENT.members["userMessageId"], - self.user_message_id, - ) - - if self.system_message_id is not None: - serializer.write_string( - _SCHEMA_FAILED_ATTACHMENT_EVENT.members["systemMessageId"], - self.system_message_id, - ) - - if self.attachment is not None: - serializer.write_struct( - _SCHEMA_FAILED_ATTACHMENT_EVENT.members["attachment"], self.attachment - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["conversation_id"] = de.read_string( - _SCHEMA_FAILED_ATTACHMENT_EVENT.members["conversationId"] - ) - - case 1: - kwargs["user_message_id"] = de.read_string( - _SCHEMA_FAILED_ATTACHMENT_EVENT.members["userMessageId"] - ) - - case 2: - kwargs["system_message_id"] = de.read_string( - _SCHEMA_FAILED_ATTACHMENT_EVENT.members["systemMessageId"] - ) - - case 3: - kwargs["attachment"] = AttachmentOutput.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FAILED_ATTACHMENT_EVENT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class SnippetExcerpt: - """ - Contains the relevant text excerpt from a source that was used to - generate a citation text segment in an Amazon Q Business chat response. - """ - - text: str | None = None - """ - The relevant text excerpt from a source that was used to generate a - citation text segment in an Amazon Q chat response. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SNIPPET_EXCERPT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.text is not None: - serializer.write_string(_SCHEMA_SNIPPET_EXCERPT.members["text"], self.text) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["text"] = de.read_string( - _SCHEMA_SNIPPET_EXCERPT.members["text"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SNIPPET_EXCERPT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ImageSourceDetails: - """Details about an image source, including its identifier and format.""" - - media_id: str | None = None - """Unique identifier for the image file.""" - - media_mime_type: str | None = None - """The MIME type of the image file.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IMAGE_SOURCE_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.media_id is not None: - serializer.write_string( - _SCHEMA_IMAGE_SOURCE_DETAILS.members["mediaId"], self.media_id - ) - - if self.media_mime_type is not None: - serializer.write_string( - _SCHEMA_IMAGE_SOURCE_DETAILS.members["mediaMimeType"], - self.media_mime_type, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["media_id"] = de.read_string( - _SCHEMA_IMAGE_SOURCE_DETAILS.members["mediaId"] - ) - - case 1: - kwargs["media_mime_type"] = de.read_string( - _SCHEMA_IMAGE_SOURCE_DETAILS.members["mediaMimeType"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_IMAGE_SOURCE_DETAILS, consumer=_consumer) - return kwargs - - -class VideoExtractionType(UnknownEnumMixin, StrEnum): - TRANSCRIPT = "TRANSCRIPT" - SUMMARY = "SUMMARY" - - -@dataclass(kw_only=True) -class VideoSourceDetails: - """ - Details about a video source, including its identifier, format, and time - information. - """ - - media_id: str | None = None - """Unique identifier for the video media file.""" - - media_mime_type: str | None = None - """The MIME type of the video file (e.g., video/mp4, video/avi).""" - - start_time_milliseconds: int | None = None - """The starting timestamp in milliseconds for the relevant video segment.""" - - end_time_milliseconds: int | None = None - """The ending timestamp in milliseconds for the relevant video segment.""" - - video_extraction_type: str | None = None - """The type of video extraction performed on the content.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VIDEO_SOURCE_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.media_id is not None: - serializer.write_string( - _SCHEMA_VIDEO_SOURCE_DETAILS.members["mediaId"], self.media_id - ) - - if self.media_mime_type is not None: - serializer.write_string( - _SCHEMA_VIDEO_SOURCE_DETAILS.members["mediaMimeType"], - self.media_mime_type, - ) - - if self.start_time_milliseconds is not None: - serializer.write_long( - _SCHEMA_VIDEO_SOURCE_DETAILS.members["startTimeMilliseconds"], - self.start_time_milliseconds, - ) - - if self.end_time_milliseconds is not None: - serializer.write_long( - _SCHEMA_VIDEO_SOURCE_DETAILS.members["endTimeMilliseconds"], - self.end_time_milliseconds, - ) - - if self.video_extraction_type is not None: - serializer.write_string( - _SCHEMA_VIDEO_SOURCE_DETAILS.members["videoExtractionType"], - self.video_extraction_type, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["media_id"] = de.read_string( - _SCHEMA_VIDEO_SOURCE_DETAILS.members["mediaId"] - ) - - case 1: - kwargs["media_mime_type"] = de.read_string( - _SCHEMA_VIDEO_SOURCE_DETAILS.members["mediaMimeType"] - ) - - case 2: - kwargs["start_time_milliseconds"] = de.read_long( - _SCHEMA_VIDEO_SOURCE_DETAILS.members["startTimeMilliseconds"] - ) - - case 3: - kwargs["end_time_milliseconds"] = de.read_long( - _SCHEMA_VIDEO_SOURCE_DETAILS.members["endTimeMilliseconds"] - ) - - case 4: - kwargs["video_extraction_type"] = VideoExtractionType( - de.read_string( - _SCHEMA_VIDEO_SOURCE_DETAILS.members["videoExtractionType"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VIDEO_SOURCE_DETAILS, consumer=_consumer) - return kwargs - - -@dataclass -class SourceDetailsImageSourceDetails: - """Details specific to image content within the source.""" - - value: ImageSourceDetails - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SOURCE_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_SOURCE_DETAILS.members["imageSourceDetails"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ImageSourceDetails.deserialize(deserializer)) - - -@dataclass -class SourceDetailsAudioSourceDetails: - """Details specific to audio content within the source.""" - - value: AudioSourceDetails - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SOURCE_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_SOURCE_DETAILS.members["audioSourceDetails"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=AudioSourceDetails.deserialize(deserializer)) - - -@dataclass -class SourceDetailsVideoSourceDetails: - """Details specific to video content within the source.""" - - value: VideoSourceDetails - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SOURCE_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_SOURCE_DETAILS.members["videoSourceDetails"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=VideoSourceDetails.deserialize(deserializer)) - - -@dataclass -class SourceDetailsUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -SourceDetails = Union[ - SourceDetailsImageSourceDetails - | SourceDetailsAudioSourceDetails - | SourceDetailsVideoSourceDetails - | SourceDetailsUnknown -] -""" -Container for details about different types of media sources (image, -audio, or video). -""" - - -class _SourceDetailsDeserializer: - _result: SourceDetails | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> SourceDetails: - self._result = None - deserializer.read_struct(_SCHEMA_SOURCE_DETAILS, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(SourceDetailsImageSourceDetails.deserialize(de)) - - case 1: - self._set_result(SourceDetailsAudioSourceDetails.deserialize(de)) - - case 2: - self._set_result(SourceDetailsVideoSourceDetails.deserialize(de)) - - case _: - self._set_result(SourceDetailsUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: SourceDetails) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class TextSegment: - """ - Provides information about a text extract in a chat response that can be - attributed to a source document. - """ - - begin_offset: int | None = None - """ - The zero-based location in the response string where the source - attribution starts. - """ - - end_offset: int | None = None - """ - The zero-based location in the response string where the source - attribution ends. - """ - - snippet_excerpt: SnippetExcerpt | None = None - """ - The relevant text excerpt from a source that was used to generate a - citation text segment in an Amazon Q Business chat response. - """ - - media_id: str | None = None - """ - The identifier of the media object associated with the text segment in - the source attribution. - """ - - media_mime_type: str | None = None - """ - The MIME type (image/png) of the media object associated with the text - segment in the source attribution. - """ - - source_details: SourceDetails | None = None - """ - Source information for a segment of extracted text, including its media - type. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TEXT_SEGMENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.begin_offset is not None: - serializer.write_integer( - _SCHEMA_TEXT_SEGMENT.members["beginOffset"], self.begin_offset - ) - - if self.end_offset is not None: - serializer.write_integer( - _SCHEMA_TEXT_SEGMENT.members["endOffset"], self.end_offset - ) - - if self.snippet_excerpt is not None: - serializer.write_struct( - _SCHEMA_TEXT_SEGMENT.members["snippetExcerpt"], self.snippet_excerpt - ) - - if self.media_id is not None: - serializer.write_string( - _SCHEMA_TEXT_SEGMENT.members["mediaId"], self.media_id - ) - - if self.media_mime_type is not None: - serializer.write_string( - _SCHEMA_TEXT_SEGMENT.members["mediaMimeType"], self.media_mime_type - ) - - if self.source_details is not None: - serializer.write_struct( - _SCHEMA_TEXT_SEGMENT.members["sourceDetails"], self.source_details - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["begin_offset"] = de.read_integer( - _SCHEMA_TEXT_SEGMENT.members["beginOffset"] - ) - - case 1: - kwargs["end_offset"] = de.read_integer( - _SCHEMA_TEXT_SEGMENT.members["endOffset"] - ) - - case 2: - kwargs["snippet_excerpt"] = SnippetExcerpt.deserialize(de) - - case 3: - kwargs["media_id"] = de.read_string( - _SCHEMA_TEXT_SEGMENT.members["mediaId"] - ) - - case 4: - kwargs["media_mime_type"] = de.read_string( - _SCHEMA_TEXT_SEGMENT.members["mediaMimeType"] - ) - - case 5: - kwargs["source_details"] = _SourceDetailsDeserializer().deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TEXT_SEGMENT, consumer=_consumer) - return kwargs - - -def _serialize_text_segment_list( - serializer: ShapeSerializer, schema: Schema, value: list[TextSegment] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_text_segment_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[TextSegment]: - result: list[TextSegment] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(TextSegment.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class SourceAttribution: - """ - The documents used to generate an Amazon Q Business web experience - response. - """ - - title: str | None = None - """ - The title of the document which is the source for the Amazon Q Business - generated response. - """ - - snippet: str | None = None - """ - The content extract from the document on which the generated response is - based. - """ - - url: str | None = None - """ - The URL of the document which is the source for the Amazon Q Business - generated response. - """ - - citation_number: int | None = None - """ - The number attached to a citation in an Amazon Q Business generated - response. - """ - - updated_at: datetime | None = None - """ - The Unix timestamp when the Amazon Q Business application was last - updated. - """ - - text_message_segments: list[TextSegment] | None = None - """ - A text extract from a source document that is used for source - attribution. - """ - - document_id: str | None = None - """ - The unique identifier of the source document used in the citation, - obtained from the Amazon Q Business index during chat response - generation. This ID is used as input to the `GetDocumentContent` API to - retrieve the actual document content for user verification. - """ - - index_id: str | None = None - """ - The identifier of the index containing the source document's metadata - and access control information. This links the citation back to the - specific Amazon Q Business index where the document's searchable - content and permissions are stored. - """ - - datasource_id: str | None = None - """ - The identifier of the data source from which the document was ingested. - This field is not present if the document is ingested by directly - calling the BatchPutDocument API (similar to checkDocumentAccess). If - the document is from a file-upload data source, the datasource will be - \"uploaded-docs-file-stat-datasourceid\". - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SOURCE_ATTRIBUTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.title is not None: - serializer.write_string( - _SCHEMA_SOURCE_ATTRIBUTION.members["title"], self.title - ) - - if self.snippet is not None: - serializer.write_string( - _SCHEMA_SOURCE_ATTRIBUTION.members["snippet"], self.snippet - ) - - if self.url is not None: - serializer.write_string(_SCHEMA_SOURCE_ATTRIBUTION.members["url"], self.url) - - if self.citation_number is not None: - serializer.write_integer( - _SCHEMA_SOURCE_ATTRIBUTION.members["citationNumber"], - self.citation_number, - ) - - if self.updated_at is not None: - serializer.write_timestamp( - _SCHEMA_SOURCE_ATTRIBUTION.members["updatedAt"], self.updated_at - ) - - if self.text_message_segments is not None: - _serialize_text_segment_list( - serializer, - _SCHEMA_SOURCE_ATTRIBUTION.members["textMessageSegments"], - self.text_message_segments, - ) - - if self.document_id is not None: - serializer.write_string( - _SCHEMA_SOURCE_ATTRIBUTION.members["documentId"], self.document_id - ) - - if self.index_id is not None: - serializer.write_string( - _SCHEMA_SOURCE_ATTRIBUTION.members["indexId"], self.index_id - ) - - if self.datasource_id is not None: - serializer.write_string( - _SCHEMA_SOURCE_ATTRIBUTION.members["datasourceId"], self.datasource_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["title"] = de.read_string( - _SCHEMA_SOURCE_ATTRIBUTION.members["title"] - ) - - case 1: - kwargs["snippet"] = de.read_string( - _SCHEMA_SOURCE_ATTRIBUTION.members["snippet"] - ) - - case 2: - kwargs["url"] = de.read_string( - _SCHEMA_SOURCE_ATTRIBUTION.members["url"] - ) - - case 3: - kwargs["citation_number"] = de.read_integer( - _SCHEMA_SOURCE_ATTRIBUTION.members["citationNumber"] - ) - - case 4: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_SOURCE_ATTRIBUTION.members["updatedAt"] - ) - - case 5: - kwargs["text_message_segments"] = _deserialize_text_segment_list( - de, _SCHEMA_SOURCE_ATTRIBUTION.members["textMessageSegments"] - ) - - case 6: - kwargs["document_id"] = de.read_string( - _SCHEMA_SOURCE_ATTRIBUTION.members["documentId"] - ) - - case 7: - kwargs["index_id"] = de.read_string( - _SCHEMA_SOURCE_ATTRIBUTION.members["indexId"] - ) - - case 8: - kwargs["datasource_id"] = de.read_string( - _SCHEMA_SOURCE_ATTRIBUTION.members["datasourceId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SOURCE_ATTRIBUTION, consumer=_consumer) - return kwargs - - -def _serialize_source_attributions( - serializer: ShapeSerializer, schema: Schema, value: list[SourceAttribution | None] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - if e is None: - ls.write_null(member_schema) - else: - ls.write_struct(member_schema, e) - - -def _deserialize_source_attributions( - deserializer: ShapeDeserializer, schema: Schema -) -> list[SourceAttribution | None]: - result: list[SourceAttribution | None] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - result.append(None) - else: - result.append(SourceAttribution.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class MetadataEvent: - """ - A metadata event for a AI-generated text output message in a Amazon Q - Business conversation, containing associated metadata generated. - """ - - conversation_id: str | None = None - """ - The identifier of the conversation with which the generated metadata is - associated. - """ - - user_message_id: str | None = None - """ - The identifier of an Amazon Q Business end user text input message - within the conversation. - """ - - system_message_id: str | None = None - """ - The identifier of an Amazon Q Business AI generated message within the - conversation. - """ - - source_attributions: list[SourceAttribution | None] | None = None - """The source documents used to generate the conversation response.""" - - final_text_message: str | None = None - """The final text output message generated by the system.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_METADATA_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.conversation_id is not None: - serializer.write_string( - _SCHEMA_METADATA_EVENT.members["conversationId"], self.conversation_id - ) - - if self.user_message_id is not None: - serializer.write_string( - _SCHEMA_METADATA_EVENT.members["userMessageId"], self.user_message_id - ) - - if self.system_message_id is not None: - serializer.write_string( - _SCHEMA_METADATA_EVENT.members["systemMessageId"], - self.system_message_id, - ) - - if self.source_attributions is not None: - _serialize_source_attributions( - serializer, - _SCHEMA_METADATA_EVENT.members["sourceAttributions"], - self.source_attributions, - ) - - if self.final_text_message is not None: - serializer.write_string( - _SCHEMA_METADATA_EVENT.members["finalTextMessage"], - self.final_text_message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["conversation_id"] = de.read_string( - _SCHEMA_METADATA_EVENT.members["conversationId"] - ) - - case 1: - kwargs["user_message_id"] = de.read_string( - _SCHEMA_METADATA_EVENT.members["userMessageId"] - ) - - case 2: - kwargs["system_message_id"] = de.read_string( - _SCHEMA_METADATA_EVENT.members["systemMessageId"] - ) - - case 3: - kwargs["source_attributions"] = _deserialize_source_attributions( - de, _SCHEMA_METADATA_EVENT.members["sourceAttributions"] - ) - - case 4: - kwargs["final_text_message"] = de.read_string( - _SCHEMA_METADATA_EVENT.members["finalTextMessage"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_METADATA_EVENT, consumer=_consumer) - return kwargs - - -class SystemMessageType(UnknownEnumMixin, StrEnum): - RESPONSE = "RESPONSE" - GROUNDED_RESPONSE = "GROUNDED_RESPONSE" - - -@dataclass(kw_only=True) -class TextOutputEvent: - """ - An output event for an AI-generated response in an Amazon Q Business web - experience. - """ - - system_message_type: str | None = None - """ - The type of AI-generated message in a `TextOutputEvent`. Amazon Q - Business currently supports two types of messages: - - - `RESPONSE` - The Amazon Q Business system response. - - - `GROUNDED_RESPONSE` - The corrected, hallucination-reduced, response - returned by Amazon Q Business. Available only if hallucination - reduction is supported and configured for the application and detected - in the end user chat query by Amazon Q Business. - """ - - conversation_id: str | None = None - """ - The identifier of the conversation with which the text output event is - associated. - """ - - user_message_id: str | None = None - """The identifier of an end user message in a `TextOutputEvent`.""" - - system_message_id: str | None = None - """The identifier of an AI-generated message in a `TextOutputEvent`.""" - - system_message: str | None = None - """An AI-generated message in a `TextOutputEvent`.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TEXT_OUTPUT_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.system_message_type is not None: - serializer.write_string( - _SCHEMA_TEXT_OUTPUT_EVENT.members["systemMessageType"], - self.system_message_type, - ) - - if self.conversation_id is not None: - serializer.write_string( - _SCHEMA_TEXT_OUTPUT_EVENT.members["conversationId"], - self.conversation_id, - ) - - if self.user_message_id is not None: - serializer.write_string( - _SCHEMA_TEXT_OUTPUT_EVENT.members["userMessageId"], self.user_message_id - ) - - if self.system_message_id is not None: - serializer.write_string( - _SCHEMA_TEXT_OUTPUT_EVENT.members["systemMessageId"], - self.system_message_id, - ) - - if self.system_message is not None: - serializer.write_string( - _SCHEMA_TEXT_OUTPUT_EVENT.members["systemMessage"], self.system_message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["system_message_type"] = SystemMessageType( - de.read_string( - _SCHEMA_TEXT_OUTPUT_EVENT.members["systemMessageType"] - ) - ) - - case 1: - kwargs["conversation_id"] = de.read_string( - _SCHEMA_TEXT_OUTPUT_EVENT.members["conversationId"] - ) - - case 2: - kwargs["user_message_id"] = de.read_string( - _SCHEMA_TEXT_OUTPUT_EVENT.members["userMessageId"] - ) - - case 3: - kwargs["system_message_id"] = de.read_string( - _SCHEMA_TEXT_OUTPUT_EVENT.members["systemMessageId"] - ) - - case 4: - kwargs["system_message"] = de.read_string( - _SCHEMA_TEXT_OUTPUT_EVENT.members["systemMessage"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TEXT_OUTPUT_EVENT, consumer=_consumer) - return kwargs - - -@dataclass -class ChatOutputStreamTextEvent: - """ - Information about the payload of the `ChatOutputStream` event containing - the AI-generated message output. - """ - - value: TextOutputEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CHAT_OUTPUT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CHAT_OUTPUT_STREAM.members["textEvent"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=TextOutputEvent.deserialize(deserializer)) - - -@dataclass -class ChatOutputStreamMetadataEvent: - """ - A metadata event for a AI-generated text output message in a Amazon Q - Business conversation. - """ - - value: MetadataEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CHAT_OUTPUT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CHAT_OUTPUT_STREAM.members["metadataEvent"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=MetadataEvent.deserialize(deserializer)) - - -@dataclass -class ChatOutputStreamActionReviewEvent: - """ - A request from Amazon Q Business to the end user for information Amazon - Q Business needs to successfully complete a requested plugin action. - """ - - value: ActionReviewEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CHAT_OUTPUT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CHAT_OUTPUT_STREAM.members["actionReviewEvent"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ActionReviewEvent.deserialize(deserializer)) - - -@dataclass -class ChatOutputStreamFailedAttachmentEvent: - """A failed file upload event during a web experience chat.""" - - value: FailedAttachmentEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CHAT_OUTPUT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CHAT_OUTPUT_STREAM.members["failedAttachmentEvent"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=FailedAttachmentEvent.deserialize(deserializer)) - - -@dataclass -class ChatOutputStreamAuthChallengeRequestEvent: - """ - An authentication verification event activated by an end user request to - use a custom plugin. - """ - - value: AuthChallengeRequestEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CHAT_OUTPUT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CHAT_OUTPUT_STREAM.members["authChallengeRequestEvent"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=AuthChallengeRequestEvent.deserialize(deserializer)) - - -@dataclass -class ChatOutputStreamUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ChatOutputStream = Union[ - ChatOutputStreamTextEvent - | ChatOutputStreamMetadataEvent - | ChatOutputStreamActionReviewEvent - | ChatOutputStreamFailedAttachmentEvent - | ChatOutputStreamAuthChallengeRequestEvent - | ChatOutputStreamUnknown -] -"""The streaming output for the `Chat` API.""" - - -class _ChatOutputStreamDeserializer: - _result: ChatOutputStream | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> ChatOutputStream: - self._result = None - deserializer.read_struct(_SCHEMA_CHAT_OUTPUT_STREAM, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(ChatOutputStreamTextEvent.deserialize(de)) - - case 1: - self._set_result(ChatOutputStreamMetadataEvent.deserialize(de)) - - case 2: - self._set_result(ChatOutputStreamActionReviewEvent.deserialize(de)) - - case 3: - self._set_result(ChatOutputStreamFailedAttachmentEvent.deserialize(de)) - - case 4: - self._set_result( - ChatOutputStreamAuthChallengeRequestEvent.deserialize(de) - ) - - case _: - self._set_result( - ChatOutputStreamUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: ChatOutputStream) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class ChatOutput: - """Dataclass for ChatOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CHAT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CHAT_OUTPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ExternalResourceException(ServiceError): - """ - An external resource that you configured with your application is - returning errors and preventing this operation from succeeding. Fix - those errors and try again. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EXTERNAL_RESOURCE_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_EXTERNAL_RESOURCE_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_EXTERNAL_RESOURCE_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EXTERNAL_RESOURCE_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class LicenseNotFoundException(ServiceError): - """ - You don't have permissions to perform the action because your license - is inactive. Ask your admin to activate your license and try again after - your licence is active. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LICENSE_NOT_FOUND_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_LICENSE_NOT_FOUND_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_LICENSE_NOT_FOUND_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LICENSE_NOT_FOUND_EXCEPTION, consumer=_consumer - ) - return kwargs - - -class ChatResponseConfigurationStatus(UnknownEnumMixin, StrEnum): - CREATING = "CREATING" - UPDATING = "UPDATING" - FAILED = "FAILED" - ACTIVE = "ACTIVE" - - -@dataclass(kw_only=True) -class ChatResponseConfiguration: - """ - Configuration details that define how Amazon Q Business generates and - formats responses to user queries in chat interactions. This - configuration allows administrators to customize response - characteristics to meet specific organizational needs and communication - standards. - """ - - chat_response_configuration_id: str - """ - A unique identifier for your chat response configuration settings, used - to reference and manage the configuration within the Amazon Q Business - service. - """ - - chat_response_configuration_arn: str - """ - The Amazon Resource Name (ARN) of the chat response configuration, which - uniquely identifies the resource across all Amazon Web Services services - and accounts. - """ - - display_name: str - """ - A human-readable name for the chat response configuration, making it - easier to identify and manage multiple configurations within an - organization. - """ - - status: str - """ - The current status of the chat response configuration, indicating - whether it is active, pending, or in another state that affects its - availability for use in chat interactions. - """ - - response_configuration_summary: str | None = None - """ - A summary of the response configuration settings, providing a concise - overview of the key parameters that define how responses are generated - and formatted. - """ - - created_at: datetime | None = None - """ - The timestamp indicating when the chat response configuration was - initially created, useful for tracking the lifecycle of configuration - resources. - """ - - updated_at: datetime | None = None - """ - The timestamp indicating when the chat response configuration was last - modified, helping administrators track changes and maintain version - awareness. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CHAT_RESPONSE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CHAT_RESPONSE_CONFIGURATION.members["chatResponseConfigurationId"], - self.chat_response_configuration_id, - ) - serializer.write_string( - _SCHEMA_CHAT_RESPONSE_CONFIGURATION.members["chatResponseConfigurationArn"], - self.chat_response_configuration_arn, - ) - serializer.write_string( - _SCHEMA_CHAT_RESPONSE_CONFIGURATION.members["displayName"], - self.display_name, - ) - if self.response_configuration_summary is not None: - serializer.write_string( - _SCHEMA_CHAT_RESPONSE_CONFIGURATION.members[ - "responseConfigurationSummary" - ], - self.response_configuration_summary, - ) - - serializer.write_string( - _SCHEMA_CHAT_RESPONSE_CONFIGURATION.members["status"], self.status - ) - if self.created_at is not None: - serializer.write_timestamp( - _SCHEMA_CHAT_RESPONSE_CONFIGURATION.members["createdAt"], - self.created_at, - ) - - if self.updated_at is not None: - serializer.write_timestamp( - _SCHEMA_CHAT_RESPONSE_CONFIGURATION.members["updatedAt"], - self.updated_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["chat_response_configuration_id"] = de.read_string( - _SCHEMA_CHAT_RESPONSE_CONFIGURATION.members[ - "chatResponseConfigurationId" - ] - ) - - case 1: - kwargs["chat_response_configuration_arn"] = de.read_string( - _SCHEMA_CHAT_RESPONSE_CONFIGURATION.members[ - "chatResponseConfigurationArn" - ] - ) - - case 2: - kwargs["display_name"] = de.read_string( - _SCHEMA_CHAT_RESPONSE_CONFIGURATION.members["displayName"] - ) - - case 3: - kwargs["response_configuration_summary"] = de.read_string( - _SCHEMA_CHAT_RESPONSE_CONFIGURATION.members[ - "responseConfigurationSummary" - ] - ) - - case 4: - kwargs["status"] = ChatResponseConfigurationStatus( - de.read_string( - _SCHEMA_CHAT_RESPONSE_CONFIGURATION.members["status"] - ) - ) - - case 5: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_CHAT_RESPONSE_CONFIGURATION.members["createdAt"] - ) - - case 6: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_CHAT_RESPONSE_CONFIGURATION.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CHAT_RESPONSE_CONFIGURATION, consumer=_consumer - ) - if "chat_response_configuration_id" not in kwargs: - kwargs["chat_response_configuration_id"] = "" - if "chat_response_configuration_arn" not in kwargs: - kwargs["chat_response_configuration_arn"] = "" - if "display_name" not in kwargs: - kwargs["display_name"] = "" - if "status" not in kwargs: - kwargs["status"] = ChatResponseConfigurationStatus._corrected("") - return kwargs - - -class ResponseConfigurationType(UnknownEnumMixin, StrEnum): - ALL = "ALL" - - -@dataclass(kw_only=True) -class InstructionCollection: - """ - A set of instructions that define how Amazon Q Business should generate - and format responses to user queries. This collection includes - parameters for controlling response characteristics such as length, - audience targeting, perspective, style, identity, tone, and custom - instructions. - """ - - response_length: str | None = None - """ - Specifies the desired length of responses generated by Amazon Q - Business. This parameter allows administrators to control whether - responses are concise and brief or more detailed and comprehensive. - """ - - target_audience: str | None = None - """ - Defines the intended audience for the responses, allowing Amazon Q - Business to tailor its language, terminology, and explanations - appropriately. This could range from technical experts to general users - with varying levels of domain knowledge. - """ - - perspective: str | None = None - """ - Determines the point of view or perspective from which Amazon Q Business - generates responses, such as first-person, second-person, or - third-person perspective, affecting how information is presented to - users. - """ - - output_style: str | None = None - """ - Specifies the formatting and structural style of responses, such as - bullet points, paragraphs, step-by-step instructions, or other - organizational formats that enhance readability and comprehension. - """ - - identity: str | None = None - """ - Defines the persona or identity that Amazon Q Business should adopt when - responding to users, allowing for customization of the assistant's - character, role, or representation within an organization. - """ - - tone: str | None = None - """ - Controls the emotional tone and communication style of responses, such - as formal, casual, technical, friendly, or professional, to align with - organizational communication standards and user expectations. - """ - - custom_instructions: str | None = None - """ - Allows administrators to provide specific, custom instructions that - guide how Amazon Q Business should respond in particular scenarios or to - certain types of queries, enabling fine-grained control over response - generation. - """ - - examples: str | None = None - """ - Provides sample responses or templates that Amazon Q Business can - reference when generating responses, helping to establish consistent - patterns and formats for different types of user queries. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INSTRUCTION_COLLECTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.response_length is not None: - serializer.write_string( - _SCHEMA_INSTRUCTION_COLLECTION.members["responseLength"], - self.response_length, - ) - - if self.target_audience is not None: - serializer.write_string( - _SCHEMA_INSTRUCTION_COLLECTION.members["targetAudience"], - self.target_audience, - ) - - if self.perspective is not None: - serializer.write_string( - _SCHEMA_INSTRUCTION_COLLECTION.members["perspective"], self.perspective - ) - - if self.output_style is not None: - serializer.write_string( - _SCHEMA_INSTRUCTION_COLLECTION.members["outputStyle"], self.output_style - ) - - if self.identity is not None: - serializer.write_string( - _SCHEMA_INSTRUCTION_COLLECTION.members["identity"], self.identity - ) - - if self.tone is not None: - serializer.write_string( - _SCHEMA_INSTRUCTION_COLLECTION.members["tone"], self.tone - ) - - if self.custom_instructions is not None: - serializer.write_string( - _SCHEMA_INSTRUCTION_COLLECTION.members["customInstructions"], - self.custom_instructions, - ) - - if self.examples is not None: - serializer.write_string( - _SCHEMA_INSTRUCTION_COLLECTION.members["examples"], self.examples - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["response_length"] = de.read_string( - _SCHEMA_INSTRUCTION_COLLECTION.members["responseLength"] - ) - - case 1: - kwargs["target_audience"] = de.read_string( - _SCHEMA_INSTRUCTION_COLLECTION.members["targetAudience"] - ) - - case 2: - kwargs["perspective"] = de.read_string( - _SCHEMA_INSTRUCTION_COLLECTION.members["perspective"] - ) - - case 3: - kwargs["output_style"] = de.read_string( - _SCHEMA_INSTRUCTION_COLLECTION.members["outputStyle"] - ) - - case 4: - kwargs["identity"] = de.read_string( - _SCHEMA_INSTRUCTION_COLLECTION.members["identity"] - ) - - case 5: - kwargs["tone"] = de.read_string( - _SCHEMA_INSTRUCTION_COLLECTION.members["tone"] - ) - - case 6: - kwargs["custom_instructions"] = de.read_string( - _SCHEMA_INSTRUCTION_COLLECTION.members["customInstructions"] - ) - - case 7: - kwargs["examples"] = de.read_string( - _SCHEMA_INSTRUCTION_COLLECTION.members["examples"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INSTRUCTION_COLLECTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ResponseConfiguration: - """ - Configuration settings to define how Amazon Q Business generates and - formats responses to user queries. This includes customization options - for response style, tone, length, and other characteristics. - """ - - instruction_collection: InstructionCollection | None = None - """ - A collection of instructions that guide how Amazon Q Business generates - responses, including parameters for response length, target audience, - perspective, output style, identity, tone, and custom instructions. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESPONSE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.instruction_collection is not None: - serializer.write_struct( - _SCHEMA_RESPONSE_CONFIGURATION.members["instructionCollection"], - self.instruction_collection, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["instruction_collection"] = ( - InstructionCollection.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RESPONSE_CONFIGURATION, consumer=_consumer) - return kwargs - - -def _serialize_response_configurations( - serializer: ShapeSerializer, schema: Schema, value: dict[str, ResponseConfiguration] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_struct(value_schema, v)) - - -def _deserialize_response_configurations( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, ResponseConfiguration]: - result: dict[str, ResponseConfiguration] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = ResponseConfiguration.deserialize(d) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ChatResponseConfigurationDetail: - """ - Detailed information about a chat response configuration, including - comprehensive settings and parameters that define how Amazon Q Business - generates and formats responses. - """ - - response_configurations: dict[str, ResponseConfiguration] | None = None - """ - A collection of specific response configuration settings that - collectively define how responses are generated, formatted, and - presented to users in chat interactions. - """ - - response_configuration_summary: str | None = None - """ - A summary of the response configuration details, providing a concise - overview of the key parameters and settings that define the response - generation behavior. - """ - - status: str | None = None - """ - The current status of the chat response configuration, indicating - whether it is active, pending, or in another state that affects its - availability for use. - """ - - error: ErrorDetail | None = None - """Provides information about a Amazon Q Business request error.""" - - updated_at: datetime | None = None - """ - The timestamp indicating when the detailed chat response configuration - was last modified, helping administrators track changes and maintain - version awareness. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CHAT_RESPONSE_CONFIGURATION_DETAIL, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.response_configurations is not None: - _serialize_response_configurations( - serializer, - _SCHEMA_CHAT_RESPONSE_CONFIGURATION_DETAIL.members[ - "responseConfigurations" - ], - self.response_configurations, - ) - - if self.response_configuration_summary is not None: - serializer.write_string( - _SCHEMA_CHAT_RESPONSE_CONFIGURATION_DETAIL.members[ - "responseConfigurationSummary" - ], - self.response_configuration_summary, - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_CHAT_RESPONSE_CONFIGURATION_DETAIL.members["status"], - self.status, - ) - - if self.error is not None: - serializer.write_struct( - _SCHEMA_CHAT_RESPONSE_CONFIGURATION_DETAIL.members["error"], self.error - ) - - if self.updated_at is not None: - serializer.write_timestamp( - _SCHEMA_CHAT_RESPONSE_CONFIGURATION_DETAIL.members["updatedAt"], - self.updated_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["response_configurations"] = ( - _deserialize_response_configurations( - de, - _SCHEMA_CHAT_RESPONSE_CONFIGURATION_DETAIL.members[ - "responseConfigurations" - ], - ) - ) - - case 1: - kwargs["response_configuration_summary"] = de.read_string( - _SCHEMA_CHAT_RESPONSE_CONFIGURATION_DETAIL.members[ - "responseConfigurationSummary" - ] - ) - - case 2: - kwargs["status"] = ChatResponseConfigurationStatus( - de.read_string( - _SCHEMA_CHAT_RESPONSE_CONFIGURATION_DETAIL.members["status"] - ) - ) - - case 3: - kwargs["error"] = ErrorDetail.deserialize(de) - - case 4: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_CHAT_RESPONSE_CONFIGURATION_DETAIL.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CHAT_RESPONSE_CONFIGURATION_DETAIL, consumer=_consumer - ) - return kwargs - - -def _serialize_chat_response_configurations( - serializer: ShapeSerializer, schema: Schema, value: list[ChatResponseConfiguration] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_chat_response_configurations( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ChatResponseConfiguration]: - result: list[ChatResponseConfiguration] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ChatResponseConfiguration.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ChatSyncOutput: - """Dataclass for ChatSyncOutput structure.""" - - conversation_id: str | None = None - """The identifier of the Amazon Q Business conversation.""" - - system_message: str | None = None - """An AI-generated message in a conversation.""" - - system_message_id: str | None = None - """ - The identifier of an Amazon Q Business AI generated message within the - conversation. - """ - - user_message_id: str | None = None - """ - The identifier of an Amazon Q Business end user text input message - within the conversation. - """ - - action_review: ActionReview | None = None - """ - A request from Amazon Q Business to the end user for information Amazon - Q Business needs to successfully complete a requested plugin action. - """ - - auth_challenge_request: AuthChallengeRequest | None = None - """ - An authentication verification event activated by an end user request to - use a custom plugin. - """ - - source_attributions: list[SourceAttribution | None] | None = None - """The source documents used to generate the conversation response.""" - - failed_attachments: list[AttachmentOutput] | None = None - """A list of files which failed to upload during chat.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CHAT_SYNC_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.conversation_id is not None: - serializer.write_string( - _SCHEMA_CHAT_SYNC_OUTPUT.members["conversationId"], self.conversation_id - ) - - if self.system_message is not None: - serializer.write_string( - _SCHEMA_CHAT_SYNC_OUTPUT.members["systemMessage"], self.system_message - ) - - if self.system_message_id is not None: - serializer.write_string( - _SCHEMA_CHAT_SYNC_OUTPUT.members["systemMessageId"], - self.system_message_id, - ) - - if self.user_message_id is not None: - serializer.write_string( - _SCHEMA_CHAT_SYNC_OUTPUT.members["userMessageId"], self.user_message_id - ) - - if self.action_review is not None: - serializer.write_struct( - _SCHEMA_CHAT_SYNC_OUTPUT.members["actionReview"], self.action_review - ) - - if self.auth_challenge_request is not None: - serializer.write_struct( - _SCHEMA_CHAT_SYNC_OUTPUT.members["authChallengeRequest"], - self.auth_challenge_request, - ) - - if self.source_attributions is not None: - _serialize_source_attributions( - serializer, - _SCHEMA_CHAT_SYNC_OUTPUT.members["sourceAttributions"], - self.source_attributions, - ) - - if self.failed_attachments is not None: - _serialize_attachments_output( - serializer, - _SCHEMA_CHAT_SYNC_OUTPUT.members["failedAttachments"], - self.failed_attachments, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["conversation_id"] = de.read_string( - _SCHEMA_CHAT_SYNC_OUTPUT.members["conversationId"] - ) - - case 1: - kwargs["system_message"] = de.read_string( - _SCHEMA_CHAT_SYNC_OUTPUT.members["systemMessage"] - ) - - case 2: - kwargs["system_message_id"] = de.read_string( - _SCHEMA_CHAT_SYNC_OUTPUT.members["systemMessageId"] - ) - - case 3: - kwargs["user_message_id"] = de.read_string( - _SCHEMA_CHAT_SYNC_OUTPUT.members["userMessageId"] - ) - - case 4: - kwargs["action_review"] = ActionReview.deserialize(de) - - case 5: - kwargs["auth_challenge_request"] = AuthChallengeRequest.deserialize( - de - ) - - case 6: - kwargs["source_attributions"] = _deserialize_source_attributions( - de, _SCHEMA_CHAT_SYNC_OUTPUT.members["sourceAttributions"] - ) - - case 7: - kwargs["failed_attachments"] = _deserialize_attachments_output( - de, _SCHEMA_CHAT_SYNC_OUTPUT.members["failedAttachments"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CHAT_SYNC_OUTPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CheckDocumentAccessInput: - """Dataclass for CheckDocumentAccessInput structure.""" - - application_id: str | None = None - """ - The unique identifier of the application. This is required to identify - the specific Amazon Q Business application context for the document - access check. - """ - - index_id: str | None = None - """ - The unique identifier of the index. Used to locate the correct index - within the application where the document is stored. - """ - - user_id: str | None = None - """ - The unique identifier of the user. Used to check the access permissions - for this specific user against the document's ACL. - """ - - document_id: str | None = None - """ - The unique identifier of the document. Specifies which document's - access permissions are being checked. - """ - - data_source_id: str | None = None - """ - The unique identifier of the data source. Identifies the specific data - source from which the document originates. Should not be used when a - document is uploaded directly with BatchPutDocument, as no dataSourceId - is available or necessary. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CHECK_DOCUMENT_ACCESS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_CHECK_DOCUMENT_ACCESS_INPUT.members["applicationId"], - self.application_id, - ) - - if self.index_id is not None: - serializer.write_string( - _SCHEMA_CHECK_DOCUMENT_ACCESS_INPUT.members["indexId"], self.index_id - ) - - if self.user_id is not None: - serializer.write_string( - _SCHEMA_CHECK_DOCUMENT_ACCESS_INPUT.members["userId"], self.user_id - ) - - if self.document_id is not None: - serializer.write_string( - _SCHEMA_CHECK_DOCUMENT_ACCESS_INPUT.members["documentId"], - self.document_id, - ) - - if self.data_source_id is not None: - serializer.write_string( - _SCHEMA_CHECK_DOCUMENT_ACCESS_INPUT.members["dataSourceId"], - self.data_source_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_CHECK_DOCUMENT_ACCESS_INPUT.members["applicationId"] - ) - - case 1: - kwargs["index_id"] = de.read_string( - _SCHEMA_CHECK_DOCUMENT_ACCESS_INPUT.members["indexId"] - ) - - case 2: - kwargs["user_id"] = de.read_string( - _SCHEMA_CHECK_DOCUMENT_ACCESS_INPUT.members["userId"] - ) - - case 3: - kwargs["document_id"] = de.read_string( - _SCHEMA_CHECK_DOCUMENT_ACCESS_INPUT.members["documentId"] - ) - - case 4: - kwargs["data_source_id"] = de.read_string( - _SCHEMA_CHECK_DOCUMENT_ACCESS_INPUT.members["dataSourceId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CHECK_DOCUMENT_ACCESS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DocumentAclGroup: - """ - Represents a group in the document's ACL, used to define access - permissions for multiple users collectively. - """ - - name: str | None = None - """ - The name of the group in the document's ACL. This is used to identify - the group when applying access rules. - """ - - type: str | None = None - """ - The type of the group. This indicates the scope of the group's - applicability in access control. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_ACL_GROUP, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_DOCUMENT_ACL_GROUP.members["name"], self.name - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_DOCUMENT_ACL_GROUP.members["type"], self.type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_DOCUMENT_ACL_GROUP.members["name"] - ) - - case 1: - kwargs["type"] = MembershipType( - de.read_string(_SCHEMA_DOCUMENT_ACL_GROUP.members["type"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DOCUMENT_ACL_GROUP, consumer=_consumer) - return kwargs - - -def _serialize_document_acl_groups( - serializer: ShapeSerializer, schema: Schema, value: list[DocumentAclGroup] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_document_acl_groups( - deserializer: ShapeDeserializer, schema: Schema -) -> list[DocumentAclGroup]: - result: list[DocumentAclGroup] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(DocumentAclGroup.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class DocumentAclUser: - """ - Represents a user in the document's ACL, used to define access - permissions for individual users. - """ - - id: str | None = None - """ - The unique identifier of the user in the document's ACL. This is used - to identify the user when applying access rules. - """ - - type: str | None = None - """ - The type of the user. This indicates the scope of the user's - applicability in access control. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_ACL_USER, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string(_SCHEMA_DOCUMENT_ACL_USER.members["id"], self.id) - - if self.type is not None: - serializer.write_string( - _SCHEMA_DOCUMENT_ACL_USER.members["type"], self.type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_DOCUMENT_ACL_USER.members["id"] - ) - - case 1: - kwargs["type"] = MembershipType( - de.read_string(_SCHEMA_DOCUMENT_ACL_USER.members["type"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DOCUMENT_ACL_USER, consumer=_consumer) - return kwargs - - -def _serialize_document_acl_users( - serializer: ShapeSerializer, schema: Schema, value: list[DocumentAclUser] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_document_acl_users( - deserializer: ShapeDeserializer, schema: Schema -) -> list[DocumentAclUser]: - result: list[DocumentAclUser] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(DocumentAclUser.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class DocumentAclCondition: - """ - Represents a condition in the document's ACL, specifying access rules - for users and groups. - """ - - member_relation: str | None = None - """ - The logical relation between members in the condition, determining how - multiple user or group conditions are combined. - """ - - users: list[DocumentAclUser] | None = None - """ - An array of user identifiers that this condition applies to. Users - listed here are subject to the access rule defined by this condition. - """ - - groups: list[DocumentAclGroup] | None = None - """ - An array of group identifiers that this condition applies to. Groups - listed here are subject to the access rule defined by this condition. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_ACL_CONDITION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.member_relation is not None: - serializer.write_string( - _SCHEMA_DOCUMENT_ACL_CONDITION.members["memberRelation"], - self.member_relation, - ) - - if self.users is not None: - _serialize_document_acl_users( - serializer, _SCHEMA_DOCUMENT_ACL_CONDITION.members["users"], self.users - ) - - if self.groups is not None: - _serialize_document_acl_groups( - serializer, - _SCHEMA_DOCUMENT_ACL_CONDITION.members["groups"], - self.groups, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["member_relation"] = MemberRelation( - de.read_string( - _SCHEMA_DOCUMENT_ACL_CONDITION.members["memberRelation"] - ) - ) - - case 1: - kwargs["users"] = _deserialize_document_acl_users( - de, _SCHEMA_DOCUMENT_ACL_CONDITION.members["users"] - ) - - case 2: - kwargs["groups"] = _deserialize_document_acl_groups( - de, _SCHEMA_DOCUMENT_ACL_CONDITION.members["groups"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DOCUMENT_ACL_CONDITION, consumer=_consumer) - return kwargs - - -def _serialize_document_acl_conditions( - serializer: ShapeSerializer, schema: Schema, value: list[DocumentAclCondition] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_document_acl_conditions( - deserializer: ShapeDeserializer, schema: Schema -) -> list[DocumentAclCondition]: - result: list[DocumentAclCondition] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(DocumentAclCondition.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class DocumentAclMembership: - """ - Represents membership rules in the document's ACL, defining how users - or groups are associated with access permissions. - """ - - member_relation: str | None = None - """ - The logical relation between members in the membership rule, determining - how multiple conditions are combined. - """ - - conditions: list[DocumentAclCondition] | None = None - """ - An array of conditions that define the membership rules. Each condition - specifies criteria for users or groups to be included in this - membership. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_ACL_MEMBERSHIP, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.member_relation is not None: - serializer.write_string( - _SCHEMA_DOCUMENT_ACL_MEMBERSHIP.members["memberRelation"], - self.member_relation, - ) - - if self.conditions is not None: - _serialize_document_acl_conditions( - serializer, - _SCHEMA_DOCUMENT_ACL_MEMBERSHIP.members["conditions"], - self.conditions, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["member_relation"] = MemberRelation( - de.read_string( - _SCHEMA_DOCUMENT_ACL_MEMBERSHIP.members["memberRelation"] - ) - ) - - case 1: - kwargs["conditions"] = _deserialize_document_acl_conditions( - de, _SCHEMA_DOCUMENT_ACL_MEMBERSHIP.members["conditions"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DOCUMENT_ACL_MEMBERSHIP, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DocumentAcl: - """ - Represents the Access Control List (ACL) for a document, containing both - allowlist and denylist conditions. - """ - - allowlist: DocumentAclMembership | None = None - """ - The allowlist conditions for the document. Users or groups matching - these conditions are granted access to the document. - """ - - deny_list: DocumentAclMembership | None = None - """ - The denylist conditions for the document. Users or groups matching these - conditions are denied access to the document, overriding allowlist - permissions. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_ACL, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.allowlist is not None: - serializer.write_struct( - _SCHEMA_DOCUMENT_ACL.members["allowlist"], self.allowlist - ) - - if self.deny_list is not None: - serializer.write_struct( - _SCHEMA_DOCUMENT_ACL.members["denyList"], self.deny_list - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["allowlist"] = DocumentAclMembership.deserialize(de) - - case 1: - kwargs["deny_list"] = DocumentAclMembership.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DOCUMENT_ACL, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CheckDocumentAccessOutput: - """Dataclass for CheckDocumentAccessOutput structure.""" - - user_groups: list[AssociatedGroup] | None = None - """ - An array of groups the user is part of for the specified data source. - Each group has a name and type. - """ - - user_aliases: list[AssociatedUser] | None = None - """ - An array of aliases associated with the user. This includes both global - and local aliases, each with a name and type. - """ - - has_access: bool | None = None - """ - A boolean value indicating whether the specified user has access to the - document, either direct access or transitive access via groups and - aliases attached to the document. - """ - - document_acl: DocumentAcl | None = None - """ - The Access Control List (ACL) associated with the document. Includes - allowlist and denylist conditions that determine user access. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CHECK_DOCUMENT_ACCESS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.user_groups is not None: - _serialize_associated_groups( - serializer, - _SCHEMA_CHECK_DOCUMENT_ACCESS_OUTPUT.members["userGroups"], - self.user_groups, - ) - - if self.user_aliases is not None: - _serialize_associated_users( - serializer, - _SCHEMA_CHECK_DOCUMENT_ACCESS_OUTPUT.members["userAliases"], - self.user_aliases, - ) - - if self.has_access is not None: - serializer.write_boolean( - _SCHEMA_CHECK_DOCUMENT_ACCESS_OUTPUT.members["hasAccess"], - self.has_access, - ) - - if self.document_acl is not None: - serializer.write_struct( - _SCHEMA_CHECK_DOCUMENT_ACCESS_OUTPUT.members["documentAcl"], - self.document_acl, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["user_groups"] = _deserialize_associated_groups( - de, _SCHEMA_CHECK_DOCUMENT_ACCESS_OUTPUT.members["userGroups"] - ) - - case 1: - kwargs["user_aliases"] = _deserialize_associated_users( - de, _SCHEMA_CHECK_DOCUMENT_ACCESS_OUTPUT.members["userAliases"] - ) - - case 2: - kwargs["has_access"] = de.read_boolean( - _SCHEMA_CHECK_DOCUMENT_ACCESS_OUTPUT.members["hasAccess"] - ) - - case 3: - kwargs["document_acl"] = DocumentAcl.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CHECK_DOCUMENT_ACCESS_OUTPUT, consumer=_consumer - ) - return kwargs - - -CHECK_DOCUMENT_ACCESS = APIOperation( - input=CheckDocumentAccessInput, - output=CheckDocumentAccessOutput, - schema=_SCHEMA_CHECK_DOCUMENT_ACCESS, - input_schema=_SCHEMA_CHECK_DOCUMENT_ACCESS_INPUT, - output_schema=_SCHEMA_CHECK_DOCUMENT_ACCESS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ContentBlockerRule: - """ - A rule for configuring how Amazon Q Business responds when it encounters - a a blocked topic. You can configure a custom message to inform your end - users that they have asked about a restricted topic and suggest any next - steps they should take. - """ - - system_message_override: str | None = None - """ - The configured custom message displayed to an end user informing them - that they've used a blocked phrase during chat. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT_BLOCKER_RULE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.system_message_override is not None: - serializer.write_string( - _SCHEMA_CONTENT_BLOCKER_RULE.members["systemMessageOverride"], - self.system_message_override, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["system_message_override"] = de.read_string( - _SCHEMA_CONTENT_BLOCKER_RULE.members["systemMessageOverride"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONTENT_BLOCKER_RULE, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class EligibleDataSource: - """ - The identifier of the data source Amazon Q Business will generate - responses from. - """ - - index_id: str | None = None - """The identifier of the index the data source is attached to.""" - - data_source_id: str | None = None - """The identifier of the data source.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ELIGIBLE_DATA_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.index_id is not None: - serializer.write_string( - _SCHEMA_ELIGIBLE_DATA_SOURCE.members["indexId"], self.index_id - ) - - if self.data_source_id is not None: - serializer.write_string( - _SCHEMA_ELIGIBLE_DATA_SOURCE.members["dataSourceId"], - self.data_source_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["index_id"] = de.read_string( - _SCHEMA_ELIGIBLE_DATA_SOURCE.members["indexId"] - ) - - case 1: - kwargs["data_source_id"] = de.read_string( - _SCHEMA_ELIGIBLE_DATA_SOURCE.members["dataSourceId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ELIGIBLE_DATA_SOURCE, consumer=_consumer) - return kwargs - - -def _serialize_eligible_data_sources( - serializer: ShapeSerializer, schema: Schema, value: list[EligibleDataSource] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_eligible_data_sources( - deserializer: ShapeDeserializer, schema: Schema -) -> list[EligibleDataSource]: - result: list[EligibleDataSource] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(EligibleDataSource.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ContentRetrievalRule: - """ - Rules for retrieving content from data sources connected to a Amazon Q - Business application for a specific topic control configuration. - """ - - eligible_data_sources: list[EligibleDataSource] | None = None - """ - Specifies data sources in a Amazon Q Business application to use for - content generation. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT_RETRIEVAL_RULE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.eligible_data_sources is not None: - _serialize_eligible_data_sources( - serializer, - _SCHEMA_CONTENT_RETRIEVAL_RULE.members["eligibleDataSources"], - self.eligible_data_sources, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["eligible_data_sources"] = ( - _deserialize_eligible_data_sources( - de, - _SCHEMA_CONTENT_RETRIEVAL_RULE.members[ - "eligibleDataSources" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONTENT_RETRIEVAL_RULE, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class RetrieverContentSource: - """Specifies a retriever as the content source for a search.""" - - retriever_id: str - """The unique identifier of the retriever to use as the content source.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RETRIEVER_CONTENT_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_RETRIEVER_CONTENT_SOURCE.members["retrieverId"], self.retriever_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["retriever_id"] = de.read_string( - _SCHEMA_RETRIEVER_CONTENT_SOURCE.members["retrieverId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RETRIEVER_CONTENT_SOURCE, consumer=_consumer) - if "retriever_id" not in kwargs: - kwargs["retriever_id"] = "" - return kwargs - - -@dataclass -class ContentSourceRetriever: - """The retriever to use as the content source.""" - - value: RetrieverContentSource - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT_SOURCE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONTENT_SOURCE.members["retriever"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=RetrieverContentSource.deserialize(deserializer)) - - -@dataclass -class ContentSourceUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ContentSource = Union[ContentSourceRetriever | ContentSourceUnknown] -"""Specifies the source of content to search in.""" - - -class _ContentSourceDeserializer: - _result: ContentSource | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> ContentSource: - self._result = None - deserializer.read_struct(_SCHEMA_CONTENT_SOURCE, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(ContentSourceRetriever.deserialize(de)) - - case _: - self._set_result(ContentSourceUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: ContentSource) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class Conversation: - """A conversation in an Amazon Q Business application.""" - - conversation_id: str | None = None - """The identifier of the Amazon Q Business conversation.""" - - title: str | None = None - """The title of the conversation.""" - - start_time: datetime | None = None - """The start time of the conversation.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONVERSATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.conversation_id is not None: - serializer.write_string( - _SCHEMA_CONVERSATION.members["conversationId"], self.conversation_id - ) - - if self.title is not None: - serializer.write_string(_SCHEMA_CONVERSATION.members["title"], self.title) - - if self.start_time is not None: - serializer.write_timestamp( - _SCHEMA_CONVERSATION.members["startTime"], self.start_time - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["conversation_id"] = de.read_string( - _SCHEMA_CONVERSATION.members["conversationId"] - ) - - case 1: - kwargs["title"] = de.read_string( - _SCHEMA_CONVERSATION.members["title"] - ) - - case 2: - kwargs["start_time"] = de.read_timestamp( - _SCHEMA_CONVERSATION.members["startTime"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONVERSATION, consumer=_consumer) - return kwargs - - -def _serialize_conversations( - serializer: ShapeSerializer, schema: Schema, value: list[Conversation] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_conversations( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Conversation]: - result: list[Conversation] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Conversation.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CreateAnonymousWebExperienceUrlInput: - """Dataclass for CreateAnonymousWebExperienceUrlInput structure.""" - - application_id: str | None = None - """ - The identifier of the Amazon Q Business application environment attached - to the web experience. - """ - - web_experience_id: str | None = None - """The identifier of the web experience.""" - - session_duration_in_minutes: int | None = None - """ - The duration of the session associated with the unique URL for the web - experience. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_ANONYMOUS_WEB_EXPERIENCE_URL_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_CREATE_ANONYMOUS_WEB_EXPERIENCE_URL_INPUT.members[ - "applicationId" - ], - self.application_id, - ) - - if self.web_experience_id is not None: - serializer.write_string( - _SCHEMA_CREATE_ANONYMOUS_WEB_EXPERIENCE_URL_INPUT.members[ - "webExperienceId" - ], - self.web_experience_id, - ) - - if self.session_duration_in_minutes is not None: - serializer.write_integer( - _SCHEMA_CREATE_ANONYMOUS_WEB_EXPERIENCE_URL_INPUT.members[ - "sessionDurationInMinutes" - ], - self.session_duration_in_minutes, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_CREATE_ANONYMOUS_WEB_EXPERIENCE_URL_INPUT.members[ - "applicationId" - ] - ) - - case 1: - kwargs["web_experience_id"] = de.read_string( - _SCHEMA_CREATE_ANONYMOUS_WEB_EXPERIENCE_URL_INPUT.members[ - "webExperienceId" - ] - ) - - case 2: - kwargs["session_duration_in_minutes"] = de.read_integer( - _SCHEMA_CREATE_ANONYMOUS_WEB_EXPERIENCE_URL_INPUT.members[ - "sessionDurationInMinutes" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_ANONYMOUS_WEB_EXPERIENCE_URL_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CreateAnonymousWebExperienceUrlOutput: - """Dataclass for CreateAnonymousWebExperienceUrlOutput structure.""" - - anonymous_url: str | None = None - """ - The unique URL for accessing the web experience. - - Warning: - This URL can only be used once and must be used within 5 minutes after - it's generated. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CREATE_ANONYMOUS_WEB_EXPERIENCE_URL_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.anonymous_url is not None: - serializer.write_string( - _SCHEMA_CREATE_ANONYMOUS_WEB_EXPERIENCE_URL_OUTPUT.members[ - "anonymousUrl" - ], - self.anonymous_url, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["anonymous_url"] = de.read_string( - _SCHEMA_CREATE_ANONYMOUS_WEB_EXPERIENCE_URL_OUTPUT.members[ - "anonymousUrl" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_ANONYMOUS_WEB_EXPERIENCE_URL_OUTPUT, consumer=_consumer - ) - return kwargs - - -CREATE_ANONYMOUS_WEB_EXPERIENCE_URL = APIOperation( - input=CreateAnonymousWebExperienceUrlInput, - output=CreateAnonymousWebExperienceUrlOutput, - schema=_SCHEMA_CREATE_ANONYMOUS_WEB_EXPERIENCE_URL, - input_schema=_SCHEMA_CREATE_ANONYMOUS_WEB_EXPERIENCE_URL_INPUT, - output_schema=_SCHEMA_CREATE_ANONYMOUS_WEB_EXPERIENCE_URL_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.qbusiness#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class CreateChatResponseConfigurationInput: - """Dataclass for CreateChatResponseConfigurationInput structure.""" - - application_id: str | None = None - """ - The unique identifier of the Amazon Q Business application for which to - create the new chat response configuration. - """ - - display_name: str | None = None - """ - A human-readable name for the new chat response configuration, making it - easier to identify and manage among multiple configurations. - """ - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure idempotency of the - request. This helps prevent the same configuration from being created - multiple times if retries occur. - """ - - response_configurations: dict[str, ResponseConfiguration] | None = None - """ - A collection of response configuration settings that define how Amazon Q - Business will generate and format responses to user queries in chat - interactions. - """ - - tags: list[Tag] | None = None - """ - A list of key-value pairs to apply as tags to the new chat response - configuration, enabling categorization and management of resources - across Amazon Web Services services. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_CHAT_RESPONSE_CONFIGURATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_CREATE_CHAT_RESPONSE_CONFIGURATION_INPUT.members[ - "applicationId" - ], - self.application_id, - ) - - if self.display_name is not None: - serializer.write_string( - _SCHEMA_CREATE_CHAT_RESPONSE_CONFIGURATION_INPUT.members["displayName"], - self.display_name, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_CHAT_RESPONSE_CONFIGURATION_INPUT.members["clientToken"], - self.client_token, - ) - - if self.response_configurations is not None: - _serialize_response_configurations( - serializer, - _SCHEMA_CREATE_CHAT_RESPONSE_CONFIGURATION_INPUT.members[ - "responseConfigurations" - ], - self.response_configurations, - ) - - if self.tags is not None: - _serialize_tags( - serializer, - _SCHEMA_CREATE_CHAT_RESPONSE_CONFIGURATION_INPUT.members["tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_CREATE_CHAT_RESPONSE_CONFIGURATION_INPUT.members[ - "applicationId" - ] - ) - - case 1: - kwargs["display_name"] = de.read_string( - _SCHEMA_CREATE_CHAT_RESPONSE_CONFIGURATION_INPUT.members[ - "displayName" - ] - ) - - case 2: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_CHAT_RESPONSE_CONFIGURATION_INPUT.members[ - "clientToken" - ] - ) - - case 3: - kwargs["response_configurations"] = ( - _deserialize_response_configurations( - de, - _SCHEMA_CREATE_CHAT_RESPONSE_CONFIGURATION_INPUT.members[ - "responseConfigurations" - ], - ) - ) - - case 4: - kwargs["tags"] = _deserialize_tags( - de, - _SCHEMA_CREATE_CHAT_RESPONSE_CONFIGURATION_INPUT.members[ - "tags" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_CHAT_RESPONSE_CONFIGURATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CreateChatResponseConfigurationOutput: - """Dataclass for CreateChatResponseConfigurationOutput structure.""" - - chat_response_configuration_id: str - """ - The unique identifier assigned to a newly created chat response - configuration, used for subsequent operations on this resource. - """ - - chat_response_configuration_arn: str - """ - The Amazon Resource Name (ARN) of the newly created chat response - configuration, which uniquely identifies the resource across all Amazon - Web Services services. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_CHAT_RESPONSE_CONFIGURATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_CHAT_RESPONSE_CONFIGURATION_OUTPUT.members[ - "chatResponseConfigurationId" - ], - self.chat_response_configuration_id, - ) - serializer.write_string( - _SCHEMA_CREATE_CHAT_RESPONSE_CONFIGURATION_OUTPUT.members[ - "chatResponseConfigurationArn" - ], - self.chat_response_configuration_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["chat_response_configuration_id"] = de.read_string( - _SCHEMA_CREATE_CHAT_RESPONSE_CONFIGURATION_OUTPUT.members[ - "chatResponseConfigurationId" - ] - ) - - case 1: - kwargs["chat_response_configuration_arn"] = de.read_string( - _SCHEMA_CREATE_CHAT_RESPONSE_CONFIGURATION_OUTPUT.members[ - "chatResponseConfigurationArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_CHAT_RESPONSE_CONFIGURATION_OUTPUT, consumer=_consumer - ) - if "chat_response_configuration_id" not in kwargs: - kwargs["chat_response_configuration_id"] = "" - if "chat_response_configuration_arn" not in kwargs: - kwargs["chat_response_configuration_arn"] = "" - return kwargs - - -CREATE_CHAT_RESPONSE_CONFIGURATION = APIOperation( - input=CreateChatResponseConfigurationInput, - output=CreateChatResponseConfigurationOutput, - schema=_SCHEMA_CREATE_CHAT_RESPONSE_CONFIGURATION, - input_schema=_SCHEMA_CREATE_CHAT_RESPONSE_CONFIGURATION_INPUT, - output_schema=_SCHEMA_CREATE_CHAT_RESPONSE_CONFIGURATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.qbusiness#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass -class SubscriptionPrincipalUser: - """ - The identifier of a user in the IAM Identity Center instance connected - to the Amazon Q Business application. - """ - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SUBSCRIPTION_PRINCIPAL, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SUBSCRIPTION_PRINCIPAL.members["user"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string( - _SCHEMA_SUBSCRIPTION_PRINCIPAL.members["user"] - ) - ) - - -@dataclass -class SubscriptionPrincipalGroup: - """ - The identifier of a group in the IAM Identity Center instance connected - to the Amazon Q Business application. - """ - - value: str - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SUBSCRIPTION_PRINCIPAL, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SUBSCRIPTION_PRINCIPAL.members["group"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls( - value=deserializer.read_string( - _SCHEMA_SUBSCRIPTION_PRINCIPAL.members["group"] - ) - ) - - -@dataclass -class SubscriptionPrincipalUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -SubscriptionPrincipal = Union[ - SubscriptionPrincipalUser - | SubscriptionPrincipalGroup - | SubscriptionPrincipalUnknown -] -""" -A user or group in the IAM Identity Center instance connected to the -Amazon Q Business application. -""" - - -class _SubscriptionPrincipalDeserializer: - _result: SubscriptionPrincipal | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> SubscriptionPrincipal: - self._result = None - deserializer.read_struct(_SCHEMA_SUBSCRIPTION_PRINCIPAL, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(SubscriptionPrincipalUser.deserialize(de)) - - case 1: - self._set_result(SubscriptionPrincipalGroup.deserialize(de)) - - case _: - self._set_result( - SubscriptionPrincipalUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: SubscriptionPrincipal) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class CreateSubscriptionInput: - """Dataclass for CreateSubscriptionInput structure.""" - - application_id: str | None = None - """ - The identifier of the Amazon Q Business application the subscription - should be added to. - """ - - principal: SubscriptionPrincipal | None = None - """ - The IAM Identity Center `UserId` or `GroupId` of a user or group in the - IAM Identity Center instance connected to the Amazon Q Business - application. - """ - - type: str | None = None - """The type of Amazon Q Business subscription you want to create.""" - - client_token: str | None = None - """ - A token that you provide to identify the request to create a - subscription for your Amazon Q Business application. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_SUBSCRIPTION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_CREATE_SUBSCRIPTION_INPUT.members["applicationId"], - self.application_id, - ) - - if self.principal is not None: - serializer.write_struct( - _SCHEMA_CREATE_SUBSCRIPTION_INPUT.members["principal"], self.principal - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_CREATE_SUBSCRIPTION_INPUT.members["type"], self.type - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_SUBSCRIPTION_INPUT.members["clientToken"], - self.client_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_CREATE_SUBSCRIPTION_INPUT.members["applicationId"] - ) - - case 1: - kwargs["principal"] = ( - _SubscriptionPrincipalDeserializer().deserialize(de) - ) - - case 2: - kwargs["type"] = SubscriptionType( - de.read_string( - _SCHEMA_CREATE_SUBSCRIPTION_INPUT.members["type"] - ) - ) - - case 3: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_SUBSCRIPTION_INPUT.members["clientToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_SUBSCRIPTION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CreateSubscriptionOutput: - """Dataclass for CreateSubscriptionOutput structure.""" - - subscription_id: str | None = None - """The identifier of the Amazon Q Business subscription created.""" - - subscription_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the Amazon Q Business subscription - created. - """ - - current_subscription: SubscriptionDetails | None = None - """The type of your current Amazon Q Business subscription.""" - - next_subscription: SubscriptionDetails | None = None - """The type of the Amazon Q Business subscription for the next month.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_SUBSCRIPTION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.subscription_id is not None: - serializer.write_string( - _SCHEMA_CREATE_SUBSCRIPTION_OUTPUT.members["subscriptionId"], - self.subscription_id, - ) - - if self.subscription_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_SUBSCRIPTION_OUTPUT.members["subscriptionArn"], - self.subscription_arn, - ) - - if self.current_subscription is not None: - serializer.write_struct( - _SCHEMA_CREATE_SUBSCRIPTION_OUTPUT.members["currentSubscription"], - self.current_subscription, - ) - - if self.next_subscription is not None: - serializer.write_struct( - _SCHEMA_CREATE_SUBSCRIPTION_OUTPUT.members["nextSubscription"], - self.next_subscription, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["subscription_id"] = de.read_string( - _SCHEMA_CREATE_SUBSCRIPTION_OUTPUT.members["subscriptionId"] - ) - - case 1: - kwargs["subscription_arn"] = de.read_string( - _SCHEMA_CREATE_SUBSCRIPTION_OUTPUT.members["subscriptionArn"] - ) - - case 2: - kwargs["current_subscription"] = SubscriptionDetails.deserialize(de) - - case 3: - kwargs["next_subscription"] = SubscriptionDetails.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_SUBSCRIPTION_OUTPUT, consumer=_consumer) - return kwargs - - -CREATE_SUBSCRIPTION = APIOperation( - input=CreateSubscriptionInput, - output=CreateSubscriptionOutput, - schema=_SCHEMA_CREATE_SUBSCRIPTION, - input_schema=_SCHEMA_CREATE_SUBSCRIPTION_INPUT, - output_schema=_SCHEMA_CREATE_SUBSCRIPTION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UserAlias: - """Aliases attached to a user id within an Amazon Q Business application.""" - - user_id: str - """The identifier of the user id associated with the user aliases.""" - - index_id: str | None = None - """The identifier of the index that the user aliases are associated with.""" - - data_source_id: str | None = None - """ - The identifier of the data source that the user aliases are associated - with. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_USER_ALIAS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.index_id is not None: - serializer.write_string( - _SCHEMA_USER_ALIAS.members["indexId"], self.index_id - ) - - if self.data_source_id is not None: - serializer.write_string( - _SCHEMA_USER_ALIAS.members["dataSourceId"], self.data_source_id - ) - - serializer.write_string(_SCHEMA_USER_ALIAS.members["userId"], self.user_id) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["index_id"] = de.read_string( - _SCHEMA_USER_ALIAS.members["indexId"] - ) - - case 1: - kwargs["data_source_id"] = de.read_string( - _SCHEMA_USER_ALIAS.members["dataSourceId"] - ) - - case 2: - kwargs["user_id"] = de.read_string( - _SCHEMA_USER_ALIAS.members["userId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_USER_ALIAS, consumer=_consumer) - if "user_id" not in kwargs: - kwargs["user_id"] = "" - return kwargs - - -def _serialize_user_aliases( - serializer: ShapeSerializer, schema: Schema, value: list[UserAlias] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_user_aliases( - deserializer: ShapeDeserializer, schema: Schema -) -> list[UserAlias]: - result: list[UserAlias] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(UserAlias.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CreateUserInput: - """Dataclass for CreateUserInput structure.""" - - application_id: str | None = None - """ - The identifier of the application for which the user mapping will be - created. - """ - - user_id: str | None = None - """The user emails attached to a user mapping.""" - - user_aliases: list[UserAlias] | None = None - """The list of user aliases in the mapping.""" - - client_token: str | None = None - """ - A token that you provide to identify the request to create your Amazon Q - Business user mapping. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_USER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_CREATE_USER_INPUT.members["applicationId"], self.application_id - ) - - if self.user_id is not None: - serializer.write_string( - _SCHEMA_CREATE_USER_INPUT.members["userId"], self.user_id - ) - - if self.user_aliases is not None: - _serialize_user_aliases( - serializer, - _SCHEMA_CREATE_USER_INPUT.members["userAliases"], - self.user_aliases, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_USER_INPUT.members["clientToken"], self.client_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_CREATE_USER_INPUT.members["applicationId"] - ) - - case 1: - kwargs["user_id"] = de.read_string( - _SCHEMA_CREATE_USER_INPUT.members["userId"] - ) - - case 2: - kwargs["user_aliases"] = _deserialize_user_aliases( - de, _SCHEMA_CREATE_USER_INPUT.members["userAliases"] - ) - - case 3: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_USER_INPUT.members["clientToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_USER_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CreateUserOutput: - """Dataclass for CreateUserOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_USER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_USER_OUTPUT, consumer=_consumer) - return kwargs - - -CREATE_USER = APIOperation( - input=CreateUserInput, - output=CreateUserOutput, - schema=_SCHEMA_CREATE_USER, - input_schema=_SCHEMA_CREATE_USER_INPUT, - output_schema=_SCHEMA_CREATE_USER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.qbusiness#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class CreatorModeConfiguration: - """ - Configuration information required to invoke chat in `CREATOR_MODE`. - - For more information, see [Admin controls and - guardrails](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/guardrails.html) - and [Conversation - settings](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/using-web-experience.html#chat-source-scope). - """ - - creator_mode_control: str - """ - Status information about whether `CREATOR_MODE` has been enabled or - disabled. The default status is `DISABLED`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATOR_MODE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATOR_MODE_CONFIGURATION.members["creatorModeControl"], - self.creator_mode_control, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["creator_mode_control"] = CreatorModeControl( - de.read_string( - _SCHEMA_CREATOR_MODE_CONFIGURATION.members[ - "creatorModeControl" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATOR_MODE_CONFIGURATION, consumer=_consumer) - if "creator_mode_control" not in kwargs: - kwargs["creator_mode_control"] = CreatorModeControl._corrected("") - return kwargs - - -def _serialize_data_source_ids( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_data_source_ids( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class DataSourceSyncJobMetrics: - """ - Maps a batch delete document request to a specific Amazon Q Business - data source connector sync job. - """ - - documents_added: str | None = None - """ - The current count of documents added from the data source during the - data source sync. - """ - - documents_modified: str | None = None - """ - The current count of documents modified in the data source during the - data source sync. - """ - - documents_deleted: str | None = None - """ - The current count of documents deleted from the data source during the - data source sync. - """ - - documents_failed: str | None = None - """ - The current count of documents that failed to sync from the data source - during the data source sync. - """ - - documents_scanned: str | None = None - """ - The current count of documents crawled by the ongoing sync job in the - data source. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DATA_SOURCE_SYNC_JOB_METRICS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.documents_added is not None: - serializer.write_string( - _SCHEMA_DATA_SOURCE_SYNC_JOB_METRICS.members["documentsAdded"], - self.documents_added, - ) - - if self.documents_modified is not None: - serializer.write_string( - _SCHEMA_DATA_SOURCE_SYNC_JOB_METRICS.members["documentsModified"], - self.documents_modified, - ) - - if self.documents_deleted is not None: - serializer.write_string( - _SCHEMA_DATA_SOURCE_SYNC_JOB_METRICS.members["documentsDeleted"], - self.documents_deleted, - ) - - if self.documents_failed is not None: - serializer.write_string( - _SCHEMA_DATA_SOURCE_SYNC_JOB_METRICS.members["documentsFailed"], - self.documents_failed, - ) - - if self.documents_scanned is not None: - serializer.write_string( - _SCHEMA_DATA_SOURCE_SYNC_JOB_METRICS.members["documentsScanned"], - self.documents_scanned, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["documents_added"] = de.read_string( - _SCHEMA_DATA_SOURCE_SYNC_JOB_METRICS.members["documentsAdded"] - ) - - case 1: - kwargs["documents_modified"] = de.read_string( - _SCHEMA_DATA_SOURCE_SYNC_JOB_METRICS.members[ - "documentsModified" - ] - ) - - case 2: - kwargs["documents_deleted"] = de.read_string( - _SCHEMA_DATA_SOURCE_SYNC_JOB_METRICS.members["documentsDeleted"] - ) - - case 3: - kwargs["documents_failed"] = de.read_string( - _SCHEMA_DATA_SOURCE_SYNC_JOB_METRICS.members["documentsFailed"] - ) - - case 4: - kwargs["documents_scanned"] = de.read_string( - _SCHEMA_DATA_SOURCE_SYNC_JOB_METRICS.members["documentsScanned"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DATA_SOURCE_SYNC_JOB_METRICS, consumer=_consumer - ) - return kwargs - - -class DataSourceSyncJobStatus(UnknownEnumMixin, StrEnum): - FAILED = "FAILED" - SUCCEEDED = "SUCCEEDED" - SYNCING = "SYNCING" - INCOMPLETE = "INCOMPLETE" - STOPPING = "STOPPING" - ABORTED = "ABORTED" - SYNCING_INDEXING = "SYNCING_INDEXING" - - -@dataclass(kw_only=True) -class DataSourceSyncJob: - """ - Provides information about an Amazon Q Business data source connector - synchronization job. - """ - - execution_id: str | None = None - """The identifier of a data source synchronization job.""" - - start_time: datetime | None = None - """The Unix time stamp when the data source synchronization job started.""" - - end_time: datetime | None = None - """The Unix timestamp when the synchronization job completed.""" - - status: str | None = None - """ - The status of the synchronization job. When the `Status` field is set to - `SUCCEEDED`, the synchronization job is done. If the status code is - `FAILED`, the `ErrorCode` and `ErrorMessage` fields give you the reason - for the failure. - """ - - error: ErrorDetail | None = None - """ - If the `Status` field is set to `FAILED`, the `ErrorCode` field - indicates the reason the synchronization failed. - """ - - data_source_error_code: str | None = None - """ - If the reason that the synchronization failed is due to an error with - the underlying data source, this field contains a code that identifies - the error. - """ - - metrics: DataSourceSyncJobMetrics | None = None - """ - Maps a batch delete document request to a specific data source sync job. - This is optional and should only be supplied when documents are deleted - by a data source connector. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DATA_SOURCE_SYNC_JOB, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.execution_id is not None: - serializer.write_string( - _SCHEMA_DATA_SOURCE_SYNC_JOB.members["executionId"], self.execution_id - ) - - if self.start_time is not None: - serializer.write_timestamp( - _SCHEMA_DATA_SOURCE_SYNC_JOB.members["startTime"], self.start_time - ) - - if self.end_time is not None: - serializer.write_timestamp( - _SCHEMA_DATA_SOURCE_SYNC_JOB.members["endTime"], self.end_time - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_DATA_SOURCE_SYNC_JOB.members["status"], self.status - ) - - if self.error is not None: - serializer.write_struct( - _SCHEMA_DATA_SOURCE_SYNC_JOB.members["error"], self.error - ) - - if self.data_source_error_code is not None: - serializer.write_string( - _SCHEMA_DATA_SOURCE_SYNC_JOB.members["dataSourceErrorCode"], - self.data_source_error_code, - ) - - if self.metrics is not None: - serializer.write_struct( - _SCHEMA_DATA_SOURCE_SYNC_JOB.members["metrics"], self.metrics - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["execution_id"] = de.read_string( - _SCHEMA_DATA_SOURCE_SYNC_JOB.members["executionId"] - ) - - case 1: - kwargs["start_time"] = de.read_timestamp( - _SCHEMA_DATA_SOURCE_SYNC_JOB.members["startTime"] - ) - - case 2: - kwargs["end_time"] = de.read_timestamp( - _SCHEMA_DATA_SOURCE_SYNC_JOB.members["endTime"] - ) - - case 3: - kwargs["status"] = DataSourceSyncJobStatus( - de.read_string(_SCHEMA_DATA_SOURCE_SYNC_JOB.members["status"]) - ) - - case 4: - kwargs["error"] = ErrorDetail.deserialize(de) - - case 5: - kwargs["data_source_error_code"] = de.read_string( - _SCHEMA_DATA_SOURCE_SYNC_JOB.members["dataSourceErrorCode"] - ) - - case 6: - kwargs["metrics"] = DataSourceSyncJobMetrics.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DATA_SOURCE_SYNC_JOB, consumer=_consumer) - return kwargs - - -def _serialize_data_source_sync_jobs( - serializer: ShapeSerializer, schema: Schema, value: list[DataSourceSyncJob] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_data_source_sync_jobs( - deserializer: ShapeDeserializer, schema: Schema -) -> list[DataSourceSyncJob]: - result: list[DataSourceSyncJob] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(DataSourceSyncJob.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class DeleteAttachmentInput: - """Dataclass for DeleteAttachmentInput structure.""" - - application_id: str | None = None - """The unique identifier for the Amazon Q Business application environment.""" - - conversation_id: str | None = None - """The unique identifier of the conversation.""" - - attachment_id: str | None = None - """The unique identifier for the attachment.""" - - user_id: str | None = None - """The unique identifier of the user involved in the conversation.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_ATTACHMENT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_DELETE_ATTACHMENT_INPUT.members["applicationId"], - self.application_id, - ) - - if self.conversation_id is not None: - serializer.write_string( - _SCHEMA_DELETE_ATTACHMENT_INPUT.members["conversationId"], - self.conversation_id, - ) - - if self.attachment_id is not None: - serializer.write_string( - _SCHEMA_DELETE_ATTACHMENT_INPUT.members["attachmentId"], - self.attachment_id, - ) - - if self.user_id is not None: - serializer.write_string( - _SCHEMA_DELETE_ATTACHMENT_INPUT.members["userId"], self.user_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_DELETE_ATTACHMENT_INPUT.members["applicationId"] - ) - - case 1: - kwargs["conversation_id"] = de.read_string( - _SCHEMA_DELETE_ATTACHMENT_INPUT.members["conversationId"] - ) - - case 2: - kwargs["attachment_id"] = de.read_string( - _SCHEMA_DELETE_ATTACHMENT_INPUT.members["attachmentId"] - ) - - case 3: - kwargs["user_id"] = de.read_string( - _SCHEMA_DELETE_ATTACHMENT_INPUT.members["userId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_ATTACHMENT_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteAttachmentOutput: - """Dataclass for DeleteAttachmentOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_ATTACHMENT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_ATTACHMENT_OUTPUT, consumer=_consumer) - return kwargs - - -DELETE_ATTACHMENT = APIOperation( - input=DeleteAttachmentInput, - output=DeleteAttachmentOutput, - schema=_SCHEMA_DELETE_ATTACHMENT, - input_schema=_SCHEMA_DELETE_ATTACHMENT_INPUT, - output_schema=_SCHEMA_DELETE_ATTACHMENT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#LicenseNotFoundException" - ): LicenseNotFoundException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_LICENSE_NOT_FOUND_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteChatControlsConfigurationInput: - """Dataclass for DeleteChatControlsConfigurationInput structure.""" - - application_id: str | None = None - """ - The identifier of the application the chat controls have been configured - for. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_CHAT_CONTROLS_CONFIGURATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_DELETE_CHAT_CONTROLS_CONFIGURATION_INPUT.members[ - "applicationId" - ], - self.application_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_DELETE_CHAT_CONTROLS_CONFIGURATION_INPUT.members[ - "applicationId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_CHAT_CONTROLS_CONFIGURATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteChatControlsConfigurationOutput: - """Dataclass for DeleteChatControlsConfigurationOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_CHAT_CONTROLS_CONFIGURATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_CHAT_CONTROLS_CONFIGURATION_OUTPUT, consumer=_consumer - ) - return kwargs - - -DELETE_CHAT_CONTROLS_CONFIGURATION = APIOperation( - input=DeleteChatControlsConfigurationInput, - output=DeleteChatControlsConfigurationOutput, - schema=_SCHEMA_DELETE_CHAT_CONTROLS_CONFIGURATION, - input_schema=_SCHEMA_DELETE_CHAT_CONTROLS_CONFIGURATION_INPUT, - output_schema=_SCHEMA_DELETE_CHAT_CONTROLS_CONFIGURATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteChatResponseConfigurationInput: - """Dataclass for DeleteChatResponseConfigurationInput structure.""" - - application_id: str | None = None - """ - The unique identifier of theAmazon Q Business application from which to - delete the chat response configuration. - """ - - chat_response_configuration_id: str | None = None - """ - The unique identifier of the chat response configuration to delete from - the specified application. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_CHAT_RESPONSE_CONFIGURATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_DELETE_CHAT_RESPONSE_CONFIGURATION_INPUT.members[ - "applicationId" - ], - self.application_id, - ) - - if self.chat_response_configuration_id is not None: - serializer.write_string( - _SCHEMA_DELETE_CHAT_RESPONSE_CONFIGURATION_INPUT.members[ - "chatResponseConfigurationId" - ], - self.chat_response_configuration_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_DELETE_CHAT_RESPONSE_CONFIGURATION_INPUT.members[ - "applicationId" - ] - ) - - case 1: - kwargs["chat_response_configuration_id"] = de.read_string( - _SCHEMA_DELETE_CHAT_RESPONSE_CONFIGURATION_INPUT.members[ - "chatResponseConfigurationId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_CHAT_RESPONSE_CONFIGURATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteChatResponseConfigurationOutput: - """Dataclass for DeleteChatResponseConfigurationOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_CHAT_RESPONSE_CONFIGURATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_CHAT_RESPONSE_CONFIGURATION_OUTPUT, consumer=_consumer - ) - return kwargs - - -DELETE_CHAT_RESPONSE_CONFIGURATION = APIOperation( - input=DeleteChatResponseConfigurationInput, - output=DeleteChatResponseConfigurationOutput, - schema=_SCHEMA_DELETE_CHAT_RESPONSE_CONFIGURATION, - input_schema=_SCHEMA_DELETE_CHAT_RESPONSE_CONFIGURATION_INPUT, - output_schema=_SCHEMA_DELETE_CHAT_RESPONSE_CONFIGURATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteConversationInput: - """Dataclass for DeleteConversationInput structure.""" - - conversation_id: str | None = None - """ - The identifier of the Amazon Q Business web experience conversation - being deleted. - """ - - application_id: str | None = None - """ - The identifier of the Amazon Q Business application associated with the - conversation. - """ - - user_id: str | None = None - """The identifier of the user who is deleting the conversation.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_CONVERSATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.conversation_id is not None: - serializer.write_string( - _SCHEMA_DELETE_CONVERSATION_INPUT.members["conversationId"], - self.conversation_id, - ) - - if self.application_id is not None: - serializer.write_string( - _SCHEMA_DELETE_CONVERSATION_INPUT.members["applicationId"], - self.application_id, - ) - - if self.user_id is not None: - serializer.write_string( - _SCHEMA_DELETE_CONVERSATION_INPUT.members["userId"], self.user_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["conversation_id"] = de.read_string( - _SCHEMA_DELETE_CONVERSATION_INPUT.members["conversationId"] - ) - - case 1: - kwargs["application_id"] = de.read_string( - _SCHEMA_DELETE_CONVERSATION_INPUT.members["applicationId"] - ) - - case 2: - kwargs["user_id"] = de.read_string( - _SCHEMA_DELETE_CONVERSATION_INPUT.members["userId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_CONVERSATION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteConversationOutput: - """Dataclass for DeleteConversationOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_CONVERSATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_CONVERSATION_OUTPUT, consumer=_consumer) - return kwargs - - -DELETE_CONVERSATION = APIOperation( - input=DeleteConversationInput, - output=DeleteConversationOutput, - schema=_SCHEMA_DELETE_CONVERSATION, - input_schema=_SCHEMA_DELETE_CONVERSATION_INPUT, - output_schema=_SCHEMA_DELETE_CONVERSATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#LicenseNotFoundException" - ): LicenseNotFoundException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_LICENSE_NOT_FOUND_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteGroupInput: - """Dataclass for DeleteGroupInput structure.""" - - application_id: str | None = None - """The identifier of the application in which the group mapping belongs.""" - - index_id: str | None = None - """The identifier of the index you want to delete the group from.""" - - group_name: str | None = None - """The name of the group you want to delete.""" - - data_source_id: str | None = None - """ - The identifier of the data source linked to the group - - A group can be tied to multiple data sources. You can delete a group - from accessing documents in a certain data source. For example, the - groups \"Research\", \"Engineering\", and \"Sales and Marketing\" are - all tied to the company's documents stored in the data sources - Confluence and Salesforce. You want to delete \"Research\" and - \"Engineering\" groups from Salesforce, so that these groups cannot - access customer-related documents stored in Salesforce. Only \"Sales and - Marketing\" should access documents in the Salesforce data source. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_GROUP_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_DELETE_GROUP_INPUT.members["applicationId"], self.application_id - ) - - if self.index_id is not None: - serializer.write_string( - _SCHEMA_DELETE_GROUP_INPUT.members["indexId"], self.index_id - ) - - if self.group_name is not None: - serializer.write_string( - _SCHEMA_DELETE_GROUP_INPUT.members["groupName"], self.group_name - ) - - if self.data_source_id is not None: - serializer.write_string( - _SCHEMA_DELETE_GROUP_INPUT.members["dataSourceId"], self.data_source_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_DELETE_GROUP_INPUT.members["applicationId"] - ) - - case 1: - kwargs["index_id"] = de.read_string( - _SCHEMA_DELETE_GROUP_INPUT.members["indexId"] - ) - - case 2: - kwargs["group_name"] = de.read_string( - _SCHEMA_DELETE_GROUP_INPUT.members["groupName"] - ) - - case 3: - kwargs["data_source_id"] = de.read_string( - _SCHEMA_DELETE_GROUP_INPUT.members["dataSourceId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_GROUP_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteGroupOutput: - """Dataclass for DeleteGroupOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_GROUP_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_GROUP_OUTPUT, consumer=_consumer) - return kwargs - - -DELETE_GROUP = APIOperation( - input=DeleteGroupInput, - output=DeleteGroupOutput, - schema=_SCHEMA_DELETE_GROUP, - input_schema=_SCHEMA_DELETE_GROUP_INPUT, - output_schema=_SCHEMA_DELETE_GROUP_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteUserInput: - """Dataclass for DeleteUserInput structure.""" - - application_id: str | None = None - """The identifier of the application from which the user is being deleted.""" - - user_id: str | None = None - """The user email being deleted.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_USER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_DELETE_USER_INPUT.members["applicationId"], self.application_id - ) - - if self.user_id is not None: - serializer.write_string( - _SCHEMA_DELETE_USER_INPUT.members["userId"], self.user_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_DELETE_USER_INPUT.members["applicationId"] - ) - - case 1: - kwargs["user_id"] = de.read_string( - _SCHEMA_DELETE_USER_INPUT.members["userId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_USER_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteUserOutput: - """Dataclass for DeleteUserOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_USER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_USER_OUTPUT, consumer=_consumer) - return kwargs - - -DELETE_USER = APIOperation( - input=DeleteUserInput, - output=DeleteUserOutput, - schema=_SCHEMA_DELETE_USER, - input_schema=_SCHEMA_DELETE_USER_INPUT, - output_schema=_SCHEMA_DELETE_USER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DisassociatePermissionInput: - """Dataclass for DisassociatePermissionInput structure.""" - - application_id: str | None = None - """The unique identifier of the Amazon Q Business application.""" - - statement_id: str | None = None - """The statement ID of the permission to remove.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DISASSOCIATE_PERMISSION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_DISASSOCIATE_PERMISSION_INPUT.members["applicationId"], - self.application_id, - ) - - if self.statement_id is not None: - serializer.write_string( - _SCHEMA_DISASSOCIATE_PERMISSION_INPUT.members["statementId"], - self.statement_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_DISASSOCIATE_PERMISSION_INPUT.members["applicationId"] - ) - - case 1: - kwargs["statement_id"] = de.read_string( - _SCHEMA_DISASSOCIATE_PERMISSION_INPUT.members["statementId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DISASSOCIATE_PERMISSION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DisassociatePermissionOutput: - """Dataclass for DisassociatePermissionOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DISASSOCIATE_PERMISSION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DISASSOCIATE_PERMISSION_OUTPUT, consumer=_consumer - ) - return kwargs - - -DISASSOCIATE_PERMISSION = APIOperation( - input=DisassociatePermissionInput, - output=DisassociatePermissionOutput, - schema=_SCHEMA_DISASSOCIATE_PERMISSION, - input_schema=_SCHEMA_DISASSOCIATE_PERMISSION_INPUT, - output_schema=_SCHEMA_DISASSOCIATE_PERMISSION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class DocumentStatus(UnknownEnumMixin, StrEnum): - RECEIVED = "RECEIVED" - PROCESSING = "PROCESSING" - INDEXED = "INDEXED" - UPDATED = "UPDATED" - FAILED = "FAILED" - DELETING = "DELETING" - DELETED = "DELETED" - DOCUMENT_FAILED_TO_INDEX = "DOCUMENT_FAILED_TO_INDEX" - - -@dataclass(kw_only=True) -class DocumentDetails: - """The details of a document within an Amazon Q Business index.""" - - document_id: str | None = None - """The identifier of the document.""" - - status: str | None = None - """The current status of the document.""" - - error: ErrorDetail | None = None - """An error message associated with the document.""" - - created_at: datetime | None = None - """The timestamp for when the document was created.""" - - updated_at: datetime | None = None - """The timestamp for when the document was last updated.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DOCUMENT_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.document_id is not None: - serializer.write_string( - _SCHEMA_DOCUMENT_DETAILS.members["documentId"], self.document_id - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_DOCUMENT_DETAILS.members["status"], self.status - ) - - if self.error is not None: - serializer.write_struct( - _SCHEMA_DOCUMENT_DETAILS.members["error"], self.error - ) - - if self.created_at is not None: - serializer.write_timestamp( - _SCHEMA_DOCUMENT_DETAILS.members["createdAt"], self.created_at - ) - - if self.updated_at is not None: - serializer.write_timestamp( - _SCHEMA_DOCUMENT_DETAILS.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["document_id"] = de.read_string( - _SCHEMA_DOCUMENT_DETAILS.members["documentId"] - ) - - case 1: - kwargs["status"] = DocumentStatus( - de.read_string(_SCHEMA_DOCUMENT_DETAILS.members["status"]) - ) - - case 2: - kwargs["error"] = ErrorDetail.deserialize(de) - - case 3: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_DOCUMENT_DETAILS.members["createdAt"] - ) - - case 4: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_DOCUMENT_DETAILS.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DOCUMENT_DETAILS, consumer=_consumer) - return kwargs - - -def _serialize_document_detail_list( - serializer: ShapeSerializer, schema: Schema, value: list[DocumentDetails] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_document_detail_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[DocumentDetails]: - result: list[DocumentDetails] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(DocumentDetails.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_example_chat_messages( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_example_chat_messages( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GetChatControlsConfigurationInput: - """Dataclass for GetChatControlsConfigurationInput structure.""" - - application_id: str | None = None - """ - The identifier of the application for which the chat controls are - configured. - """ - - max_results: int | None = None - """The maximum number of configured chat controls to return.""" - - next_token: str | None = None - """ - If the `maxResults` response was incomplete because there is more data - to retrieve, Amazon Q Business returns a pagination token in the - response. You can use this pagination token to retrieve the next set of - Amazon Q Business chat controls configured. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION_INPUT.members["applicationId"], - self.application_id, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION_INPUT.members["maxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION_INPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION_INPUT.members[ - "applicationId" - ] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION_INPUT.members[ - "maxResults" - ] - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION_INPUT.members[ - "nextToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION_INPUT, consumer=_consumer - ) - return kwargs - - -class HallucinationReductionControl(UnknownEnumMixin, StrEnum): - ENABLED = "ENABLED" - DISABLED = "DISABLED" - - -@dataclass(kw_only=True) -class HallucinationReductionConfiguration: - """ - Configuration information required to setup hallucination reduction. For - more information, see [hallucination - reduction](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/hallucination-reduction.html). - - Note: - The hallucination reduction feature won't work if chat orchestration - controls are enabled for your application. - """ - - hallucination_reduction_control: str | None = None - """ - Controls whether hallucination reduction has been enabled or disabled - for your application. The default status is `DISABLED`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_HALLUCINATION_REDUCTION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.hallucination_reduction_control is not None: - serializer.write_string( - _SCHEMA_HALLUCINATION_REDUCTION_CONFIGURATION.members[ - "hallucinationReductionControl" - ], - self.hallucination_reduction_control, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["hallucination_reduction_control"] = ( - HallucinationReductionControl( - de.read_string( - _SCHEMA_HALLUCINATION_REDUCTION_CONFIGURATION.members[ - "hallucinationReductionControl" - ] - ) - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_HALLUCINATION_REDUCTION_CONFIGURATION, consumer=_consumer - ) - return kwargs - - -class ResponseScope(UnknownEnumMixin, StrEnum): - ENTERPRISE_CONTENT_ONLY = "ENTERPRISE_CONTENT_ONLY" - EXTENDED_KNOWLEDGE_ENABLED = "EXTENDED_KNOWLEDGE_ENABLED" - - -def _serialize_user_ids( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_user_ids(deserializer: ShapeDeserializer, schema: Schema) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class UsersAndGroups: - """ - Provides information about users and group names associated with a topic - control rule. - """ - - user_ids: list[str] | None = None - """The user ids associated with a topic control rule.""" - - user_groups: list[str] | None = None - """The user group names associated with a topic control rule.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_USERS_AND_GROUPS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.user_ids is not None: - _serialize_user_ids( - serializer, _SCHEMA_USERS_AND_GROUPS.members["userIds"], self.user_ids - ) - - if self.user_groups is not None: - _serialize_user_groups( - serializer, - _SCHEMA_USERS_AND_GROUPS.members["userGroups"], - self.user_groups, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["user_ids"] = _deserialize_user_ids( - de, _SCHEMA_USERS_AND_GROUPS.members["userIds"] - ) - - case 1: - kwargs["user_groups"] = _deserialize_user_groups( - de, _SCHEMA_USERS_AND_GROUPS.members["userGroups"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_USERS_AND_GROUPS, consumer=_consumer) - return kwargs - - -@dataclass -class RuleConfigurationContentBlockerRule: - """ - A rule for configuring how Amazon Q Business responds when it encounters - a a blocked topic. - """ - - value: ContentBlockerRule - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RULE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RULE_CONFIGURATION.members["contentBlockerRule"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ContentBlockerRule.deserialize(deserializer)) - - -@dataclass -class RuleConfigurationContentRetrievalRule: - """ - Rules for retrieving content from data sources connected to a Amazon Q - Business application for a specific topic control configuration. - """ - - value: ContentRetrievalRule - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RULE_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RULE_CONFIGURATION.members["contentRetrievalRule"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ContentRetrievalRule.deserialize(deserializer)) - - -@dataclass -class RuleConfigurationUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -RuleConfiguration = Union[ - RuleConfigurationContentBlockerRule - | RuleConfigurationContentRetrievalRule - | RuleConfigurationUnknown -] -"""Provides configuration information about a rule.""" - - -class _RuleConfigurationDeserializer: - _result: RuleConfiguration | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> RuleConfiguration: - self._result = None - deserializer.read_struct(_SCHEMA_RULE_CONFIGURATION, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(RuleConfigurationContentBlockerRule.deserialize(de)) - - case 1: - self._set_result(RuleConfigurationContentRetrievalRule.deserialize(de)) - - case _: - self._set_result( - RuleConfigurationUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: RuleConfiguration) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class RuleType(UnknownEnumMixin, StrEnum): - CONTENT_BLOCKER_RULE = "CONTENT_BLOCKER_RULE" - CONTENT_RETRIEVAL_RULE = "CONTENT_RETRIEVAL_RULE" - - -@dataclass(kw_only=True) -class Rule: - """ - Guardrail rules for an Amazon Q Business application. Amazon Q Business - supports only one rule at a time. - """ - - rule_type: str - """The type of rule.""" - - included_users_and_groups: UsersAndGroups | None = None - """Users and groups to be included in a rule.""" - - excluded_users_and_groups: UsersAndGroups | None = None - """Users and groups to be excluded from a rule.""" - - rule_configuration: RuleConfiguration | None = None - """The configuration information for a rule.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RULE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.included_users_and_groups is not None: - serializer.write_struct( - _SCHEMA_RULE.members["includedUsersAndGroups"], - self.included_users_and_groups, - ) - - if self.excluded_users_and_groups is not None: - serializer.write_struct( - _SCHEMA_RULE.members["excludedUsersAndGroups"], - self.excluded_users_and_groups, - ) - - serializer.write_string(_SCHEMA_RULE.members["ruleType"], self.rule_type) - if self.rule_configuration is not None: - serializer.write_struct( - _SCHEMA_RULE.members["ruleConfiguration"], self.rule_configuration - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["included_users_and_groups"] = UsersAndGroups.deserialize(de) - - case 1: - kwargs["excluded_users_and_groups"] = UsersAndGroups.deserialize(de) - - case 2: - kwargs["rule_type"] = RuleType( - de.read_string(_SCHEMA_RULE.members["ruleType"]) - ) - - case 3: - kwargs["rule_configuration"] = ( - _RuleConfigurationDeserializer().deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RULE, consumer=_consumer) - if "rule_type" not in kwargs: - kwargs["rule_type"] = RuleType._corrected("") - return kwargs - - -def _serialize_rules( - serializer: ShapeSerializer, schema: Schema, value: list[Rule] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_rules(deserializer: ShapeDeserializer, schema: Schema) -> list[Rule]: - result: list[Rule] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Rule.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class TopicConfiguration: - """ - The topic specific controls configured for an Amazon Q Business - application. - """ - - name: str - """A name for your topic control configuration.""" - - rules: list[Rule] - """Rules defined for a topic configuration.""" - - description: str | None = None - """ - A description for your topic control configuration. Use this to outline - how the large language model (LLM) should use this topic control - configuration. - """ - - example_chat_messages: list[str] | None = None - """ - A list of example phrases that you expect the end user to use in - relation to the topic. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOPIC_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_TOPIC_CONFIGURATION.members["name"], self.name) - if self.description is not None: - serializer.write_string( - _SCHEMA_TOPIC_CONFIGURATION.members["description"], self.description - ) - - if self.example_chat_messages is not None: - _serialize_example_chat_messages( - serializer, - _SCHEMA_TOPIC_CONFIGURATION.members["exampleChatMessages"], - self.example_chat_messages, - ) - - _serialize_rules( - serializer, _SCHEMA_TOPIC_CONFIGURATION.members["rules"], self.rules - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_TOPIC_CONFIGURATION.members["name"] - ) - - case 1: - kwargs["description"] = de.read_string( - _SCHEMA_TOPIC_CONFIGURATION.members["description"] - ) - - case 2: - kwargs["example_chat_messages"] = ( - _deserialize_example_chat_messages( - de, - _SCHEMA_TOPIC_CONFIGURATION.members["exampleChatMessages"], - ) - ) - - case 3: - kwargs["rules"] = _deserialize_rules( - de, _SCHEMA_TOPIC_CONFIGURATION.members["rules"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TOPIC_CONFIGURATION, consumer=_consumer) - if "name" not in kwargs: - kwargs["name"] = "" - if "rules" not in kwargs: - kwargs["rules"] = [] - return kwargs - - -def _serialize_topic_configurations( - serializer: ShapeSerializer, schema: Schema, value: list[TopicConfiguration] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_topic_configurations( - deserializer: ShapeDeserializer, schema: Schema -) -> list[TopicConfiguration]: - result: list[TopicConfiguration] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(TopicConfiguration.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GetChatControlsConfigurationOutput: - """Dataclass for GetChatControlsConfigurationOutput structure.""" - - response_scope: str | None = None - """ - The response scope configured for a Amazon Q Business application. This - determines whether your application uses its retrieval augmented - generation (RAG) system to generate answers only from your enterprise - data, or also uses the large language models (LLM) knowledge to respons - to end user questions in chat. - """ - - orchestration_configuration: AppliedOrchestrationConfiguration | None = None - """ - The chat response orchestration settings for your application. - - Note: - Chat orchestration is optimized to work for English language content. - For more details on language support in Amazon Q Business, see - [Supported - languages](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/supported-languages.html). - """ - - blocked_phrases: BlockedPhrasesConfiguration | None = None - """The phrases blocked from chat by your chat control configuration.""" - - topic_configurations: list[TopicConfiguration] | None = None - """ - The topic specific controls configured for a Amazon Q Business - application. - """ - - creator_mode_configuration: AppliedCreatorModeConfiguration | None = None - """The configuration details for `CREATOR_MODE`.""" - - next_token: str | None = None - """ - If the `maxResults` response was incomplete because there is more data - to retrieve, Amazon Q Business returns a pagination token in the - response. You can use this pagination token to retrieve the next set of - Amazon Q Business chat controls configured. - """ - - hallucination_reduction_configuration: ( - HallucinationReductionConfiguration | None - ) = None - """The hallucination reduction settings for your application.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.response_scope is not None: - serializer.write_string( - _SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION_OUTPUT.members["responseScope"], - self.response_scope, - ) - - if self.orchestration_configuration is not None: - serializer.write_struct( - _SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION_OUTPUT.members[ - "orchestrationConfiguration" - ], - self.orchestration_configuration, - ) - - if self.blocked_phrases is not None: - serializer.write_struct( - _SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION_OUTPUT.members[ - "blockedPhrases" - ], - self.blocked_phrases, - ) - - if self.topic_configurations is not None: - _serialize_topic_configurations( - serializer, - _SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION_OUTPUT.members[ - "topicConfigurations" - ], - self.topic_configurations, - ) - - if self.creator_mode_configuration is not None: - serializer.write_struct( - _SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION_OUTPUT.members[ - "creatorModeConfiguration" - ], - self.creator_mode_configuration, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION_OUTPUT.members["nextToken"], - self.next_token, - ) - - if self.hallucination_reduction_configuration is not None: - serializer.write_struct( - _SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION_OUTPUT.members[ - "hallucinationReductionConfiguration" - ], - self.hallucination_reduction_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["response_scope"] = ResponseScope( - de.read_string( - _SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION_OUTPUT.members[ - "responseScope" - ] - ) - ) - - case 1: - kwargs["orchestration_configuration"] = ( - AppliedOrchestrationConfiguration.deserialize(de) - ) - - case 2: - kwargs["blocked_phrases"] = BlockedPhrasesConfiguration.deserialize( - de - ) - - case 3: - kwargs["topic_configurations"] = _deserialize_topic_configurations( - de, - _SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION_OUTPUT.members[ - "topicConfigurations" - ], - ) - - case 4: - kwargs["creator_mode_configuration"] = ( - AppliedCreatorModeConfiguration.deserialize(de) - ) - - case 5: - kwargs["next_token"] = de.read_string( - _SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION_OUTPUT.members[ - "nextToken" - ] - ) - - case 6: - kwargs["hallucination_reduction_configuration"] = ( - HallucinationReductionConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_CHAT_CONTROLS_CONFIGURATION = APIOperation( - input=GetChatControlsConfigurationInput, - output=GetChatControlsConfigurationOutput, - schema=_SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION, - input_schema=_SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION_INPUT, - output_schema=_SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetChatResponseConfigurationInput: - """Dataclass for GetChatResponseConfigurationInput structure.""" - - application_id: str | None = None - """ - The unique identifier of the Amazon Q Business application containing - the chat response configuration to retrieve. - """ - - chat_response_configuration_id: str | None = None - """ - The unique identifier of the chat response configuration to retrieve - from the specified application. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_CHAT_RESPONSE_CONFIGURATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_GET_CHAT_RESPONSE_CONFIGURATION_INPUT.members["applicationId"], - self.application_id, - ) - - if self.chat_response_configuration_id is not None: - serializer.write_string( - _SCHEMA_GET_CHAT_RESPONSE_CONFIGURATION_INPUT.members[ - "chatResponseConfigurationId" - ], - self.chat_response_configuration_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_GET_CHAT_RESPONSE_CONFIGURATION_INPUT.members[ - "applicationId" - ] - ) - - case 1: - kwargs["chat_response_configuration_id"] = de.read_string( - _SCHEMA_GET_CHAT_RESPONSE_CONFIGURATION_INPUT.members[ - "chatResponseConfigurationId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_CHAT_RESPONSE_CONFIGURATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetChatResponseConfigurationOutput: - """Dataclass for GetChatResponseConfigurationOutput structure.""" - - chat_response_configuration_id: str | None = None - """The unique identifier of the retrieved chat response configuration.""" - - chat_response_configuration_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the retrieved chat response - configuration, which uniquely identifies the resource across all Amazon - Web Services services. - """ - - display_name: str | None = None - """ - The human-readable name of the retrieved chat response configuration, - making it easier to identify among multiple configurations. - """ - - created_at: datetime | None = None - """ - The timestamp indicating when the chat response configuration was - initially created. - """ - - in_use_configuration: ChatResponseConfigurationDetail | None = None - """ - The currently active configuration settings that are being used to - generate responses in the Amazon Q Business application. - """ - - last_update_configuration: ChatResponseConfigurationDetail | None = None - """ - Information about the most recent update to the configuration, including - timestamp and modification details. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_CHAT_RESPONSE_CONFIGURATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.chat_response_configuration_id is not None: - serializer.write_string( - _SCHEMA_GET_CHAT_RESPONSE_CONFIGURATION_OUTPUT.members[ - "chatResponseConfigurationId" - ], - self.chat_response_configuration_id, - ) - - if self.chat_response_configuration_arn is not None: - serializer.write_string( - _SCHEMA_GET_CHAT_RESPONSE_CONFIGURATION_OUTPUT.members[ - "chatResponseConfigurationArn" - ], - self.chat_response_configuration_arn, - ) - - if self.display_name is not None: - serializer.write_string( - _SCHEMA_GET_CHAT_RESPONSE_CONFIGURATION_OUTPUT.members["displayName"], - self.display_name, - ) - - if self.created_at is not None: - serializer.write_timestamp( - _SCHEMA_GET_CHAT_RESPONSE_CONFIGURATION_OUTPUT.members["createdAt"], - self.created_at, - ) - - if self.in_use_configuration is not None: - serializer.write_struct( - _SCHEMA_GET_CHAT_RESPONSE_CONFIGURATION_OUTPUT.members[ - "inUseConfiguration" - ], - self.in_use_configuration, - ) - - if self.last_update_configuration is not None: - serializer.write_struct( - _SCHEMA_GET_CHAT_RESPONSE_CONFIGURATION_OUTPUT.members[ - "lastUpdateConfiguration" - ], - self.last_update_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["chat_response_configuration_id"] = de.read_string( - _SCHEMA_GET_CHAT_RESPONSE_CONFIGURATION_OUTPUT.members[ - "chatResponseConfigurationId" - ] - ) - - case 1: - kwargs["chat_response_configuration_arn"] = de.read_string( - _SCHEMA_GET_CHAT_RESPONSE_CONFIGURATION_OUTPUT.members[ - "chatResponseConfigurationArn" - ] - ) - - case 2: - kwargs["display_name"] = de.read_string( - _SCHEMA_GET_CHAT_RESPONSE_CONFIGURATION_OUTPUT.members[ - "displayName" - ] - ) - - case 3: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_CHAT_RESPONSE_CONFIGURATION_OUTPUT.members[ - "createdAt" - ] - ) - - case 4: - kwargs["in_use_configuration"] = ( - ChatResponseConfigurationDetail.deserialize(de) - ) - - case 5: - kwargs["last_update_configuration"] = ( - ChatResponseConfigurationDetail.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_CHAT_RESPONSE_CONFIGURATION_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_CHAT_RESPONSE_CONFIGURATION = APIOperation( - input=GetChatResponseConfigurationInput, - output=GetChatResponseConfigurationOutput, - schema=_SCHEMA_GET_CHAT_RESPONSE_CONFIGURATION, - input_schema=_SCHEMA_GET_CHAT_RESPONSE_CONFIGURATION_INPUT, - output_schema=_SCHEMA_GET_CHAT_RESPONSE_CONFIGURATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class OutputFormat(UnknownEnumMixin, StrEnum): - RAW = "RAW" - EXTRACTED = "EXTRACTED" - - -@dataclass(kw_only=True) -class GetDocumentContentInput: - """Dataclass for GetDocumentContentInput structure.""" - - application_id: str | None = None - """ - The unique identifier of the Amazon Q Business application containing - the document. This ensures the request is scoped to the correct - application environment and its associated security policies. - """ - - index_id: str | None = None - """The identifier of the index where documents are indexed.""" - - data_source_id: str | None = None - """ - The identifier of the data source from which the document was ingested. - This field is not present if the document is ingested by directly - calling the BatchPutDocument API. If the document is from a file-upload - data source, the datasource will be - \"uploaded-docs-file-stat-datasourceid\". - """ - - document_id: str | None = None - """ - The unique identifier of the document that is indexed via - BatchPutDocument API or file-upload or connector sync. It is also found - in chat or chatSync response. - """ - - output_format: str | None = None - """Document outputFormat. Defaults to RAW if not selected.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DOCUMENT_CONTENT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_GET_DOCUMENT_CONTENT_INPUT.members["applicationId"], - self.application_id, - ) - - if self.index_id is not None: - serializer.write_string( - _SCHEMA_GET_DOCUMENT_CONTENT_INPUT.members["indexId"], self.index_id - ) - - if self.data_source_id is not None: - serializer.write_string( - _SCHEMA_GET_DOCUMENT_CONTENT_INPUT.members["dataSourceId"], - self.data_source_id, - ) - - if self.document_id is not None: - serializer.write_string( - _SCHEMA_GET_DOCUMENT_CONTENT_INPUT.members["documentId"], - self.document_id, - ) - - if self.output_format is not None: - serializer.write_string( - _SCHEMA_GET_DOCUMENT_CONTENT_INPUT.members["outputFormat"], - self.output_format, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_GET_DOCUMENT_CONTENT_INPUT.members["applicationId"] - ) - - case 1: - kwargs["index_id"] = de.read_string( - _SCHEMA_GET_DOCUMENT_CONTENT_INPUT.members["indexId"] - ) - - case 2: - kwargs["data_source_id"] = de.read_string( - _SCHEMA_GET_DOCUMENT_CONTENT_INPUT.members["dataSourceId"] - ) - - case 3: - kwargs["document_id"] = de.read_string( - _SCHEMA_GET_DOCUMENT_CONTENT_INPUT.members["documentId"] - ) - - case 4: - kwargs["output_format"] = OutputFormat( - de.read_string( - _SCHEMA_GET_DOCUMENT_CONTENT_INPUT.members["outputFormat"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_DOCUMENT_CONTENT_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetDocumentContentOutput: - """Dataclass for GetDocumentContentOutput structure.""" - - presigned_url: str - """ - A pre-signed URL that provides temporary access to download the document - content directly from Amazon Q Business. The URL expires after 5 minutes - for security purposes. This URL is generated only after successful ACL - validation. - """ - - mime_type: str - """ - The MIME type of the document content. When outputFormat is RAW, this - corresponds to the original document's MIME type (e.g., - application/pdf, text/plain, - application/vnd.openxmlformats-officedocument.wordprocessingml.document). - When outputFormat is EXTRACTED, the MIME type is always - application/json. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DOCUMENT_CONTENT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_DOCUMENT_CONTENT_OUTPUT.members["presignedUrl"], - self.presigned_url, - ) - serializer.write_string( - _SCHEMA_GET_DOCUMENT_CONTENT_OUTPUT.members["mimeType"], self.mime_type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["presigned_url"] = de.read_string( - _SCHEMA_GET_DOCUMENT_CONTENT_OUTPUT.members["presignedUrl"] - ) - - case 1: - kwargs["mime_type"] = de.read_string( - _SCHEMA_GET_DOCUMENT_CONTENT_OUTPUT.members["mimeType"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_DOCUMENT_CONTENT_OUTPUT, consumer=_consumer - ) - if "presigned_url" not in kwargs: - kwargs["presigned_url"] = "" - if "mime_type" not in kwargs: - kwargs["mime_type"] = "" - return kwargs - - -GET_DOCUMENT_CONTENT = APIOperation( - input=GetDocumentContentInput, - output=GetDocumentContentOutput, - schema=_SCHEMA_GET_DOCUMENT_CONTENT, - input_schema=_SCHEMA_GET_DOCUMENT_CONTENT_INPUT, - output_schema=_SCHEMA_GET_DOCUMENT_CONTENT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetGroupInput: - """Dataclass for GetGroupInput structure.""" - - application_id: str | None = None - """The identifier of the application id the group is attached to.""" - - index_id: str | None = None - """The identifier of the index the group is attached to.""" - - group_name: str | None = None - """The name of the group.""" - - data_source_id: str | None = None - """The identifier of the data source the group is attached to.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_GROUP_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_GET_GROUP_INPUT.members["applicationId"], self.application_id - ) - - if self.index_id is not None: - serializer.write_string( - _SCHEMA_GET_GROUP_INPUT.members["indexId"], self.index_id - ) - - if self.group_name is not None: - serializer.write_string( - _SCHEMA_GET_GROUP_INPUT.members["groupName"], self.group_name - ) - - if self.data_source_id is not None: - serializer.write_string( - _SCHEMA_GET_GROUP_INPUT.members["dataSourceId"], self.data_source_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_GET_GROUP_INPUT.members["applicationId"] - ) - - case 1: - kwargs["index_id"] = de.read_string( - _SCHEMA_GET_GROUP_INPUT.members["indexId"] - ) - - case 2: - kwargs["group_name"] = de.read_string( - _SCHEMA_GET_GROUP_INPUT.members["groupName"] - ) - - case 3: - kwargs["data_source_id"] = de.read_string( - _SCHEMA_GET_GROUP_INPUT.members["dataSourceId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_GROUP_INPUT, consumer=_consumer) - return kwargs - - -class GroupStatus(UnknownEnumMixin, StrEnum): - FAILED = "FAILED" - SUCCEEDED = "SUCCEEDED" - PROCESSING = "PROCESSING" - DELETING = "DELETING" - DELETED = "DELETED" - - -@dataclass(kw_only=True) -class GroupStatusDetail: - """Provides the details of a group's status.""" - - status: str | None = None - """The status of a group.""" - - last_updated_at: datetime | None = None - """ - The Unix timestamp when the Amazon Q Business application was last - updated. - """ - - error_detail: ErrorDetail | None = None - """The details of an error associated a group status.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GROUP_STATUS_DETAIL, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.status is not None: - serializer.write_string( - _SCHEMA_GROUP_STATUS_DETAIL.members["status"], self.status - ) - - if self.last_updated_at is not None: - serializer.write_timestamp( - _SCHEMA_GROUP_STATUS_DETAIL.members["lastUpdatedAt"], - self.last_updated_at, - ) - - if self.error_detail is not None: - serializer.write_struct( - _SCHEMA_GROUP_STATUS_DETAIL.members["errorDetail"], self.error_detail - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["status"] = GroupStatus( - de.read_string(_SCHEMA_GROUP_STATUS_DETAIL.members["status"]) - ) - - case 1: - kwargs["last_updated_at"] = de.read_timestamp( - _SCHEMA_GROUP_STATUS_DETAIL.members["lastUpdatedAt"] - ) - - case 2: - kwargs["error_detail"] = ErrorDetail.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GROUP_STATUS_DETAIL, consumer=_consumer) - return kwargs - - -def _serialize_group_status_details( - serializer: ShapeSerializer, schema: Schema, value: list[GroupStatusDetail] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_group_status_details( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GroupStatusDetail]: - result: list[GroupStatusDetail] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GroupStatusDetail.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GetGroupOutput: - """Dataclass for GetGroupOutput structure.""" - - status: GroupStatusDetail | None = None - """The current status of the group.""" - - status_history: list[GroupStatusDetail] | None = None - """The status history of the group.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_GROUP_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.status is not None: - serializer.write_struct( - _SCHEMA_GET_GROUP_OUTPUT.members["status"], self.status - ) - - if self.status_history is not None: - _serialize_group_status_details( - serializer, - _SCHEMA_GET_GROUP_OUTPUT.members["statusHistory"], - self.status_history, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["status"] = GroupStatusDetail.deserialize(de) - - case 1: - kwargs["status_history"] = _deserialize_group_status_details( - de, _SCHEMA_GET_GROUP_OUTPUT.members["statusHistory"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_GROUP_OUTPUT, consumer=_consumer) - return kwargs - - -GET_GROUP = APIOperation( - input=GetGroupInput, - output=GetGroupOutput, - schema=_SCHEMA_GET_GROUP, - input_schema=_SCHEMA_GET_GROUP_INPUT, - output_schema=_SCHEMA_GET_GROUP_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetMediaInput: - """Dataclass for GetMediaInput structure.""" - - application_id: str | None = None - """The identifier of the Amazon Q Business which contains the media object.""" - - conversation_id: str | None = None - """The identifier of the Amazon Q Business conversation.""" - - message_id: str | None = None - """The identifier of the Amazon Q Business message.""" - - media_id: str | None = None - """ - The identifier of the media object. You can find this in the - `sourceAttributions` returned by the `Chat`, `ChatSync`, and - `ListMessages` API responses. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_MEDIA_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_GET_MEDIA_INPUT.members["applicationId"], self.application_id - ) - - if self.conversation_id is not None: - serializer.write_string( - _SCHEMA_GET_MEDIA_INPUT.members["conversationId"], self.conversation_id - ) - - if self.message_id is not None: - serializer.write_string( - _SCHEMA_GET_MEDIA_INPUT.members["messageId"], self.message_id - ) - - if self.media_id is not None: - serializer.write_string( - _SCHEMA_GET_MEDIA_INPUT.members["mediaId"], self.media_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_GET_MEDIA_INPUT.members["applicationId"] - ) - - case 1: - kwargs["conversation_id"] = de.read_string( - _SCHEMA_GET_MEDIA_INPUT.members["conversationId"] - ) - - case 2: - kwargs["message_id"] = de.read_string( - _SCHEMA_GET_MEDIA_INPUT.members["messageId"] - ) - - case 3: - kwargs["media_id"] = de.read_string( - _SCHEMA_GET_MEDIA_INPUT.members["mediaId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_MEDIA_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetMediaOutput: - """Dataclass for GetMediaOutput structure.""" - - media_bytes: bytes | None = None - """The base64-encoded bytes of the media object.""" - - media_mime_type: str | None = None - """The MIME type of the media object (image/png).""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_MEDIA_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.media_bytes is not None: - serializer.write_blob( - _SCHEMA_GET_MEDIA_OUTPUT.members["mediaBytes"], self.media_bytes - ) - - if self.media_mime_type is not None: - serializer.write_string( - _SCHEMA_GET_MEDIA_OUTPUT.members["mediaMimeType"], self.media_mime_type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["media_bytes"] = de.read_blob( - _SCHEMA_GET_MEDIA_OUTPUT.members["mediaBytes"] - ) - - case 1: - kwargs["media_mime_type"] = de.read_string( - _SCHEMA_GET_MEDIA_OUTPUT.members["mediaMimeType"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_MEDIA_OUTPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class MediaTooLargeException(ServiceError): - """The requested media object is too large to be returned.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDIA_TOO_LARGE_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MEDIA_TOO_LARGE_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_MEDIA_TOO_LARGE_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MEDIA_TOO_LARGE_EXCEPTION, consumer=_consumer) - return kwargs - - -GET_MEDIA = APIOperation( - input=GetMediaInput, - output=GetMediaOutput, - schema=_SCHEMA_GET_MEDIA, - input_schema=_SCHEMA_GET_MEDIA_INPUT, - output_schema=_SCHEMA_GET_MEDIA_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#LicenseNotFoundException" - ): LicenseNotFoundException, - ShapeID( - "com.amazonaws.qbusiness#MediaTooLargeException" - ): MediaTooLargeException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_LICENSE_NOT_FOUND_EXCEPTION, - _SCHEMA_MEDIA_TOO_LARGE_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetPolicyInput: - """Dataclass for GetPolicyInput structure.""" - - application_id: str | None = None - """The unique identifier of the Amazon Q Business application.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_POLICY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_GET_POLICY_INPUT.members["applicationId"], self.application_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_GET_POLICY_INPUT.members["applicationId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_POLICY_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetPolicyOutput: - """Dataclass for GetPolicyOutput structure.""" - - policy: str | None = None - """The JSON representation of the permission policy.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_POLICY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.policy is not None: - serializer.write_string( - _SCHEMA_GET_POLICY_OUTPUT.members["policy"], self.policy - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy"] = de.read_string( - _SCHEMA_GET_POLICY_OUTPUT.members["policy"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_POLICY_OUTPUT, consumer=_consumer) - return kwargs - - -GET_POLICY = APIOperation( - input=GetPolicyInput, - output=GetPolicyOutput, - schema=_SCHEMA_GET_POLICY, - input_schema=_SCHEMA_GET_POLICY_INPUT, - output_schema=_SCHEMA_GET_POLICY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetUserInput: - """Dataclass for GetUserInput structure.""" - - application_id: str | None = None - """The identifier of the application connected to the user.""" - - user_id: str | None = None - """The user email address attached to the user.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_USER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_GET_USER_INPUT.members["applicationId"], self.application_id - ) - - if self.user_id is not None: - serializer.write_string( - _SCHEMA_GET_USER_INPUT.members["userId"], self.user_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_GET_USER_INPUT.members["applicationId"] - ) - - case 1: - kwargs["user_id"] = de.read_string( - _SCHEMA_GET_USER_INPUT.members["userId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_USER_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetUserOutput: - """Dataclass for GetUserOutput structure.""" - - user_aliases: list[UserAlias] | None = None - """A list of user aliases attached to a user.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_USER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.user_aliases is not None: - _serialize_user_aliases( - serializer, - _SCHEMA_GET_USER_OUTPUT.members["userAliases"], - self.user_aliases, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["user_aliases"] = _deserialize_user_aliases( - de, _SCHEMA_GET_USER_OUTPUT.members["userAliases"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_USER_OUTPUT, consumer=_consumer) - return kwargs - - -GET_USER = APIOperation( - input=GetUserInput, - output=GetUserOutput, - schema=_SCHEMA_GET_USER, - input_schema=_SCHEMA_GET_USER_INPUT, - output_schema=_SCHEMA_GET_USER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListAttachmentsInput: - """Dataclass for ListAttachmentsInput structure.""" - - application_id: str | None = None - """The unique identifier for the Amazon Q Business application.""" - - conversation_id: str | None = None - """ - The unique identifier of the Amazon Q Business web experience - conversation. - """ - - user_id: str | None = None - """ - The unique identifier of the user involved in the Amazon Q Business web - experience conversation. - """ - - next_token: str | None = None - """ - If the number of attachments returned exceeds `maxResults`, Amazon Q - Business returns a next token as a pagination token to retrieve the next - set of attachments. - """ - - max_results: int | None = None - """The maximum number of attachements to return.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_ATTACHMENTS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_LIST_ATTACHMENTS_INPUT.members["applicationId"], - self.application_id, - ) - - if self.conversation_id is not None: - serializer.write_string( - _SCHEMA_LIST_ATTACHMENTS_INPUT.members["conversationId"], - self.conversation_id, - ) - - if self.user_id is not None: - serializer.write_string( - _SCHEMA_LIST_ATTACHMENTS_INPUT.members["userId"], self.user_id - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_ATTACHMENTS_INPUT.members["nextToken"], self.next_token - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_ATTACHMENTS_INPUT.members["maxResults"], self.max_results - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_LIST_ATTACHMENTS_INPUT.members["applicationId"] - ) - - case 1: - kwargs["conversation_id"] = de.read_string( - _SCHEMA_LIST_ATTACHMENTS_INPUT.members["conversationId"] - ) - - case 2: - kwargs["user_id"] = de.read_string( - _SCHEMA_LIST_ATTACHMENTS_INPUT.members["userId"] - ) - - case 3: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_ATTACHMENTS_INPUT.members["nextToken"] - ) - - case 4: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_ATTACHMENTS_INPUT.members["maxResults"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_ATTACHMENTS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ListAttachmentsOutput: - """Dataclass for ListAttachmentsOutput structure.""" - - attachments: list[Attachment] | None = None - """An array of information on one or more attachments.""" - - next_token: str | None = None - """ - If the response is truncated, Amazon Q Business returns this token, - which you can use in a later request to list the next set of - attachments. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_ATTACHMENTS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.attachments is not None: - _serialize_attachment_list( - serializer, - _SCHEMA_LIST_ATTACHMENTS_OUTPUT.members["attachments"], - self.attachments, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_ATTACHMENTS_OUTPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["attachments"] = _deserialize_attachment_list( - de, _SCHEMA_LIST_ATTACHMENTS_OUTPUT.members["attachments"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_ATTACHMENTS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_ATTACHMENTS_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_ATTACHMENTS = APIOperation( - input=ListAttachmentsInput, - output=ListAttachmentsOutput, - schema=_SCHEMA_LIST_ATTACHMENTS, - input_schema=_SCHEMA_LIST_ATTACHMENTS_INPUT, - output_schema=_SCHEMA_LIST_ATTACHMENTS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#LicenseNotFoundException" - ): LicenseNotFoundException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_LICENSE_NOT_FOUND_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListChatResponseConfigurationsInput: - """Dataclass for ListChatResponseConfigurationsInput structure.""" - - application_id: str | None = None - """ - The unique identifier of the Amazon Q Business application for which to - list available chat response configurations. - """ - - max_results: int | None = None - """ - The maximum number of chat response configurations to return in a single - response. This parameter helps control pagination of results when many - configurations exist. - """ - - next_token: str | None = None - """ - A pagination token used to retrieve the next set of results when the - number of configurations exceeds the specified `maxResults` value. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_CHAT_RESPONSE_CONFIGURATIONS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_LIST_CHAT_RESPONSE_CONFIGURATIONS_INPUT.members[ - "applicationId" - ], - self.application_id, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_CHAT_RESPONSE_CONFIGURATIONS_INPUT.members["maxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_CHAT_RESPONSE_CONFIGURATIONS_INPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_LIST_CHAT_RESPONSE_CONFIGURATIONS_INPUT.members[ - "applicationId" - ] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_CHAT_RESPONSE_CONFIGURATIONS_INPUT.members[ - "maxResults" - ] - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_CHAT_RESPONSE_CONFIGURATIONS_INPUT.members[ - "nextToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_CHAT_RESPONSE_CONFIGURATIONS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ListChatResponseConfigurationsOutput: - """Dataclass for ListChatResponseConfigurationsOutput structure.""" - - chat_response_configurations: list[ChatResponseConfiguration] | None = None - """ - A list of chat response configuration summaries, each containing key - information about an available configuration in the specified - application. - """ - - next_token: str | None = None - """ - A pagination token that can be used in a subsequent request to retrieve - additional chat response configurations if the results were truncated - due to the `maxResults` parameter. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_CHAT_RESPONSE_CONFIGURATIONS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.chat_response_configurations is not None: - _serialize_chat_response_configurations( - serializer, - _SCHEMA_LIST_CHAT_RESPONSE_CONFIGURATIONS_OUTPUT.members[ - "chatResponseConfigurations" - ], - self.chat_response_configurations, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_CHAT_RESPONSE_CONFIGURATIONS_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["chat_response_configurations"] = ( - _deserialize_chat_response_configurations( - de, - _SCHEMA_LIST_CHAT_RESPONSE_CONFIGURATIONS_OUTPUT.members[ - "chatResponseConfigurations" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_CHAT_RESPONSE_CONFIGURATIONS_OUTPUT.members[ - "nextToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_CHAT_RESPONSE_CONFIGURATIONS_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_CHAT_RESPONSE_CONFIGURATIONS = APIOperation( - input=ListChatResponseConfigurationsInput, - output=ListChatResponseConfigurationsOutput, - schema=_SCHEMA_LIST_CHAT_RESPONSE_CONFIGURATIONS, - input_schema=_SCHEMA_LIST_CHAT_RESPONSE_CONFIGURATIONS_INPUT, - output_schema=_SCHEMA_LIST_CHAT_RESPONSE_CONFIGURATIONS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListConversationsInput: - """Dataclass for ListConversationsInput structure.""" - - application_id: str | None = None - """The identifier of the Amazon Q Business application.""" - - user_id: str | None = None - """ - The identifier of the user involved in the Amazon Q Business web - experience conversation. - """ - - next_token: str | None = None - """ - If the `maxResults` response was incomplete because there is more data - to retrieve, Amazon Q Business returns a pagination token in the - response. You can use this pagination token to retrieve the next set of - Amazon Q Business conversations. - """ - - max_results: int | None = None - """The maximum number of Amazon Q Business conversations to return.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_CONVERSATIONS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_LIST_CONVERSATIONS_INPUT.members["applicationId"], - self.application_id, - ) - - if self.user_id is not None: - serializer.write_string( - _SCHEMA_LIST_CONVERSATIONS_INPUT.members["userId"], self.user_id - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_CONVERSATIONS_INPUT.members["nextToken"], self.next_token - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_CONVERSATIONS_INPUT.members["maxResults"], self.max_results - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_LIST_CONVERSATIONS_INPUT.members["applicationId"] - ) - - case 1: - kwargs["user_id"] = de.read_string( - _SCHEMA_LIST_CONVERSATIONS_INPUT.members["userId"] - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_CONVERSATIONS_INPUT.members["nextToken"] - ) - - case 3: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_CONVERSATIONS_INPUT.members["maxResults"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_CONVERSATIONS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ListConversationsOutput: - """Dataclass for ListConversationsOutput structure.""" - - next_token: str | None = None - """ - If the response is truncated, Amazon Q Business returns this token, - which you can use in a later request to list the next set of messages. - """ - - conversations: list[Conversation] | None = None - """ - An array of summary information on the configuration of one or more - Amazon Q Business web experiences. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_CONVERSATIONS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_CONVERSATIONS_OUTPUT.members["nextToken"], self.next_token - ) - - if self.conversations is not None: - _serialize_conversations( - serializer, - _SCHEMA_LIST_CONVERSATIONS_OUTPUT.members["conversations"], - self.conversations, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_CONVERSATIONS_OUTPUT.members["nextToken"] - ) - - case 1: - kwargs["conversations"] = _deserialize_conversations( - de, _SCHEMA_LIST_CONVERSATIONS_OUTPUT.members["conversations"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_CONVERSATIONS_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_CONVERSATIONS = APIOperation( - input=ListConversationsInput, - output=ListConversationsOutput, - schema=_SCHEMA_LIST_CONVERSATIONS, - input_schema=_SCHEMA_LIST_CONVERSATIONS_INPUT, - output_schema=_SCHEMA_LIST_CONVERSATIONS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#LicenseNotFoundException" - ): LicenseNotFoundException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_LICENSE_NOT_FOUND_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListDataSourceSyncJobsInput: - """Dataclass for ListDataSourceSyncJobsInput structure.""" - - data_source_id: str | None = None - """The identifier of the data source connector.""" - - application_id: str | None = None - """ - The identifier of the Amazon Q Business application connected to the - data source. - """ - - index_id: str | None = None - """ - The identifier of the index used with the Amazon Q Business data source - connector. - """ - - next_token: str | None = None - """ - If the `maxResults` response was incpmplete because there is more data - to retriever, Amazon Q Business returns a pagination token in the - response. You can use this pagination token to retrieve the next set of - responses. - """ - - max_results: int | None = None - """The maximum number of synchronization jobs to return in the response.""" - - start_time: datetime | None = None - """The start time of the data source connector sync.""" - - end_time: datetime | None = None - """The end time of the data source connector sync.""" - - status_filter: str | None = None - """ - Only returns synchronization jobs with the `Status` field equal to the - specified status. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.data_source_id is not None: - serializer.write_string( - _SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_INPUT.members["dataSourceId"], - self.data_source_id, - ) - - if self.application_id is not None: - serializer.write_string( - _SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_INPUT.members["applicationId"], - self.application_id, - ) - - if self.index_id is not None: - serializer.write_string( - _SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_INPUT.members["indexId"], - self.index_id, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_INPUT.members["nextToken"], - self.next_token, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_INPUT.members["maxResults"], - self.max_results, - ) - - if self.start_time is not None: - serializer.write_timestamp( - _SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_INPUT.members["startTime"], - self.start_time, - ) - - if self.end_time is not None: - serializer.write_timestamp( - _SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_INPUT.members["endTime"], - self.end_time, - ) - - if self.status_filter is not None: - serializer.write_string( - _SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_INPUT.members["statusFilter"], - self.status_filter, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["data_source_id"] = de.read_string( - _SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_INPUT.members["dataSourceId"] - ) - - case 1: - kwargs["application_id"] = de.read_string( - _SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_INPUT.members[ - "applicationId" - ] - ) - - case 2: - kwargs["index_id"] = de.read_string( - _SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_INPUT.members["indexId"] - ) - - case 3: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_INPUT.members["nextToken"] - ) - - case 4: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_INPUT.members["maxResults"] - ) - - case 5: - kwargs["start_time"] = de.read_timestamp( - _SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_INPUT.members["startTime"] - ) - - case 6: - kwargs["end_time"] = de.read_timestamp( - _SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_INPUT.members["endTime"] - ) - - case 7: - kwargs["status_filter"] = DataSourceSyncJobStatus( - de.read_string( - _SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_INPUT.members[ - "statusFilter" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ListDataSourceSyncJobsOutput: - """Dataclass for ListDataSourceSyncJobsOutput structure.""" - - history: list[DataSourceSyncJob] | None = None - """A history of synchronization jobs for the data source connector.""" - - next_token: str | None = None - """ - If the response is truncated, Amazon Q Business returns this token. You - can use this token in any subsequent request to retrieve the next set of - jobs. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.history is not None: - _serialize_data_source_sync_jobs( - serializer, - _SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_OUTPUT.members["history"], - self.history, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["history"] = _deserialize_data_source_sync_jobs( - de, _SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_OUTPUT.members["history"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_DATA_SOURCE_SYNC_JOBS = APIOperation( - input=ListDataSourceSyncJobsInput, - output=ListDataSourceSyncJobsOutput, - schema=_SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS, - input_schema=_SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_INPUT, - output_schema=_SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListDocumentsInput: - """Dataclass for ListDocumentsInput structure.""" - - application_id: str | None = None - """The identifier of the application id the documents are attached to.""" - - index_id: str | None = None - """The identifier of the index the documents are attached to.""" - - data_source_ids: list[str] | None = None - """The identifier of the data sources the documents are attached to.""" - - next_token: str | None = None - """ - If the `maxResults` response was incomplete because there is more data - to retrieve, Amazon Q Business returns a pagination token in the - response. You can use this pagination token to retrieve the next set of - documents. - """ - - max_results: int | None = None - """The maximum number of documents to return.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_DOCUMENTS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_LIST_DOCUMENTS_INPUT.members["applicationId"], - self.application_id, - ) - - if self.index_id is not None: - serializer.write_string( - _SCHEMA_LIST_DOCUMENTS_INPUT.members["indexId"], self.index_id - ) - - if self.data_source_ids is not None: - _serialize_data_source_ids( - serializer, - _SCHEMA_LIST_DOCUMENTS_INPUT.members["dataSourceIds"], - self.data_source_ids, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_DOCUMENTS_INPUT.members["nextToken"], self.next_token - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_DOCUMENTS_INPUT.members["maxResults"], self.max_results - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_LIST_DOCUMENTS_INPUT.members["applicationId"] - ) - - case 1: - kwargs["index_id"] = de.read_string( - _SCHEMA_LIST_DOCUMENTS_INPUT.members["indexId"] - ) - - case 2: - kwargs["data_source_ids"] = _deserialize_data_source_ids( - de, _SCHEMA_LIST_DOCUMENTS_INPUT.members["dataSourceIds"] - ) - - case 3: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_DOCUMENTS_INPUT.members["nextToken"] - ) - - case 4: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_DOCUMENTS_INPUT.members["maxResults"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_DOCUMENTS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ListDocumentsOutput: - """Dataclass for ListDocumentsOutput structure.""" - - document_detail_list: list[DocumentDetails] | None = None - """A list of document details.""" - - next_token: str | None = None - """ - If the `maxResults` response was incomplete because there is more data - to retrieve, Amazon Q Business returns a pagination token in the - response. You can use this pagination token to retrieve the next set of - documents. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_DOCUMENTS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.document_detail_list is not None: - _serialize_document_detail_list( - serializer, - _SCHEMA_LIST_DOCUMENTS_OUTPUT.members["documentDetailList"], - self.document_detail_list, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_DOCUMENTS_OUTPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["document_detail_list"] = _deserialize_document_detail_list( - de, _SCHEMA_LIST_DOCUMENTS_OUTPUT.members["documentDetailList"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_DOCUMENTS_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_DOCUMENTS_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_DOCUMENTS = APIOperation( - input=ListDocumentsInput, - output=ListDocumentsOutput, - schema=_SCHEMA_LIST_DOCUMENTS, - input_schema=_SCHEMA_LIST_DOCUMENTS_INPUT, - output_schema=_SCHEMA_LIST_DOCUMENTS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListGroupsInput: - """Dataclass for ListGroupsInput structure.""" - - application_id: str | None = None - """ - The identifier of the application for getting a list of groups mapped to - users. - """ - - index_id: str | None = None - """ - The identifier of the index for getting a list of groups mapped to - users. - """ - - updated_earlier_than: datetime | None = None - """ - The timestamp identifier used for the latest `PUT` or `DELETE` action - for mapping users to their groups. - """ - - data_source_id: str | None = None - """ - The identifier of the data source for getting a list of groups mapped to - users. - """ - - next_token: str | None = None - """ - If the previous response was incomplete (because there is more data to - retrieve), Amazon Q Business returns a pagination token in the response. - You can use this pagination token to retrieve the next set of groups - that are mapped to users. - """ - - max_results: int | None = None - """The maximum number of returned groups that are mapped to users.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_GROUPS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_LIST_GROUPS_INPUT.members["applicationId"], self.application_id - ) - - if self.index_id is not None: - serializer.write_string( - _SCHEMA_LIST_GROUPS_INPUT.members["indexId"], self.index_id - ) - - if self.updated_earlier_than is not None: - serializer.write_timestamp( - _SCHEMA_LIST_GROUPS_INPUT.members["updatedEarlierThan"], - self.updated_earlier_than, - ) - - if self.data_source_id is not None: - serializer.write_string( - _SCHEMA_LIST_GROUPS_INPUT.members["dataSourceId"], self.data_source_id - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_GROUPS_INPUT.members["nextToken"], self.next_token - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_GROUPS_INPUT.members["maxResults"], self.max_results - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_LIST_GROUPS_INPUT.members["applicationId"] - ) - - case 1: - kwargs["index_id"] = de.read_string( - _SCHEMA_LIST_GROUPS_INPUT.members["indexId"] - ) - - case 2: - kwargs["updated_earlier_than"] = de.read_timestamp( - _SCHEMA_LIST_GROUPS_INPUT.members["updatedEarlierThan"] - ) - - case 3: - kwargs["data_source_id"] = de.read_string( - _SCHEMA_LIST_GROUPS_INPUT.members["dataSourceId"] - ) - - case 4: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_GROUPS_INPUT.members["nextToken"] - ) - - case 5: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_GROUPS_INPUT.members["maxResults"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_GROUPS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GroupSummary: - """Summary information for groups.""" - - group_name: str | None = None - """The name of the group the summary information is for.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GROUP_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.group_name is not None: - serializer.write_string( - _SCHEMA_GROUP_SUMMARY.members["groupName"], self.group_name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["group_name"] = de.read_string( - _SCHEMA_GROUP_SUMMARY.members["groupName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GROUP_SUMMARY, consumer=_consumer) - return kwargs - - -def _serialize_group_summary_list( - serializer: ShapeSerializer, schema: Schema, value: list[GroupSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_group_summary_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[GroupSummary]: - result: list[GroupSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(GroupSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListGroupsOutput: - """Dataclass for ListGroupsOutput structure.""" - - next_token: str | None = None - """ - If the response is truncated, Amazon Q Business returns this token that - you can use in the subsequent request to retrieve the next set of groups - that are mapped to users. - """ - - items: list[GroupSummary] | None = None - """Summary information for list of groups that are mapped to users.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_GROUPS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_GROUPS_OUTPUT.members["nextToken"], self.next_token - ) - - if self.items is not None: - _serialize_group_summary_list( - serializer, _SCHEMA_LIST_GROUPS_OUTPUT.members["items"], self.items - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_GROUPS_OUTPUT.members["nextToken"] - ) - - case 1: - kwargs["items"] = _deserialize_group_summary_list( - de, _SCHEMA_LIST_GROUPS_OUTPUT.members["items"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_GROUPS_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_GROUPS = APIOperation( - input=ListGroupsInput, - output=ListGroupsOutput, - schema=_SCHEMA_LIST_GROUPS, - input_schema=_SCHEMA_LIST_GROUPS_INPUT, - output_schema=_SCHEMA_LIST_GROUPS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListMessagesInput: - """Dataclass for ListMessagesInput structure.""" - - conversation_id: str | None = None - """The identifier of the Amazon Q Business web experience conversation.""" - - application_id: str | None = None - """The identifier for the Amazon Q Business application.""" - - user_id: str | None = None - """ - The identifier of the user involved in the Amazon Q Business web - experience conversation. - """ - - next_token: str | None = None - """ - If the number of messages returned exceeds `maxResults`, Amazon Q - Business returns a next token as a pagination token to retrieve the next - set of messages. - """ - - max_results: int | None = None - """The maximum number of messages to return.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_MESSAGES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.conversation_id is not None: - serializer.write_string( - _SCHEMA_LIST_MESSAGES_INPUT.members["conversationId"], - self.conversation_id, - ) - - if self.application_id is not None: - serializer.write_string( - _SCHEMA_LIST_MESSAGES_INPUT.members["applicationId"], - self.application_id, - ) - - if self.user_id is not None: - serializer.write_string( - _SCHEMA_LIST_MESSAGES_INPUT.members["userId"], self.user_id - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_MESSAGES_INPUT.members["nextToken"], self.next_token - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_MESSAGES_INPUT.members["maxResults"], self.max_results - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["conversation_id"] = de.read_string( - _SCHEMA_LIST_MESSAGES_INPUT.members["conversationId"] - ) - - case 1: - kwargs["application_id"] = de.read_string( - _SCHEMA_LIST_MESSAGES_INPUT.members["applicationId"] - ) - - case 2: - kwargs["user_id"] = de.read_string( - _SCHEMA_LIST_MESSAGES_INPUT.members["userId"] - ) - - case 3: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_MESSAGES_INPUT.members["nextToken"] - ) - - case 4: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_MESSAGES_INPUT.members["maxResults"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_MESSAGES_INPUT, consumer=_consumer) - return kwargs - - -class MessageType(UnknownEnumMixin, StrEnum): - USER = "USER" - SYSTEM = "SYSTEM" - - -@dataclass(kw_only=True) -class Message: - """A message in an Amazon Q Business web experience.""" - - message_id: str | None = None - """The identifier of the Amazon Q Business web experience message.""" - - body: str | None = None - """The content of the Amazon Q Business web experience message.""" - - time: datetime | None = None - """The timestamp of the first Amazon Q Business web experience message.""" - - type: str | None = None - """ - The type of Amazon Q Business message, whether `HUMAN` or `AI` - generated. - """ - - attachments: list[AttachmentOutput] | None = None - """A file directly uploaded into an Amazon Q Business web experience chat.""" - - source_attribution: list[SourceAttribution | None] | None = None - """ - The source documents used to generate Amazon Q Business web experience - message. - """ - - action_review: ActionReview | None = None - """ - An output event that Amazon Q Business returns to an user who wants to - perform a plugin action during a non-streaming chat conversation. It - contains information about the selected action with a list of possible - user input fields, some pre-populated by Amazon Q Business. - """ - - action_execution: ActionExecution | None = None - """ - Performs an Amazon Q Business plugin action during a non-streaming chat - conversation. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MESSAGE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message_id is not None: - serializer.write_string( - _SCHEMA_MESSAGE.members["messageId"], self.message_id - ) - - if self.body is not None: - serializer.write_string(_SCHEMA_MESSAGE.members["body"], self.body) - - if self.time is not None: - serializer.write_timestamp(_SCHEMA_MESSAGE.members["time"], self.time) - - if self.type is not None: - serializer.write_string(_SCHEMA_MESSAGE.members["type"], self.type) - - if self.attachments is not None: - _serialize_attachments_output( - serializer, _SCHEMA_MESSAGE.members["attachments"], self.attachments - ) - - if self.source_attribution is not None: - _serialize_source_attributions( - serializer, - _SCHEMA_MESSAGE.members["sourceAttribution"], - self.source_attribution, - ) - - if self.action_review is not None: - serializer.write_struct( - _SCHEMA_MESSAGE.members["actionReview"], self.action_review - ) - - if self.action_execution is not None: - serializer.write_struct( - _SCHEMA_MESSAGE.members["actionExecution"], self.action_execution - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message_id"] = de.read_string( - _SCHEMA_MESSAGE.members["messageId"] - ) - - case 1: - kwargs["body"] = de.read_string(_SCHEMA_MESSAGE.members["body"]) - - case 2: - kwargs["time"] = de.read_timestamp(_SCHEMA_MESSAGE.members["time"]) - - case 3: - kwargs["type"] = MessageType( - de.read_string(_SCHEMA_MESSAGE.members["type"]) - ) - - case 4: - kwargs["attachments"] = _deserialize_attachments_output( - de, _SCHEMA_MESSAGE.members["attachments"] - ) - - case 5: - kwargs["source_attribution"] = _deserialize_source_attributions( - de, _SCHEMA_MESSAGE.members["sourceAttribution"] - ) - - case 6: - kwargs["action_review"] = ActionReview.deserialize(de) - - case 7: - kwargs["action_execution"] = ActionExecution.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MESSAGE, consumer=_consumer) - return kwargs - - -def _serialize_messages( - serializer: ShapeSerializer, schema: Schema, value: list[Message] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_messages( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Message]: - result: list[Message] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Message.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListMessagesOutput: - """Dataclass for ListMessagesOutput structure.""" - - messages: list[Message] | None = None - """An array of information on one or more messages.""" - - next_token: str | None = None - """ - If the response is truncated, Amazon Q Business returns this token, - which you can use in a later request to list the next set of messages. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_MESSAGES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.messages is not None: - _serialize_messages( - serializer, - _SCHEMA_LIST_MESSAGES_OUTPUT.members["messages"], - self.messages, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_MESSAGES_OUTPUT.members["nextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["messages"] = _deserialize_messages( - de, _SCHEMA_LIST_MESSAGES_OUTPUT.members["messages"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_MESSAGES_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_MESSAGES_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_MESSAGES = APIOperation( - input=ListMessagesInput, - output=ListMessagesOutput, - schema=_SCHEMA_LIST_MESSAGES, - input_schema=_SCHEMA_LIST_MESSAGES_INPUT, - output_schema=_SCHEMA_LIST_MESSAGES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#LicenseNotFoundException" - ): LicenseNotFoundException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_LICENSE_NOT_FOUND_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListPluginActionsInput: - """Dataclass for ListPluginActionsInput structure.""" - - application_id: str | None = None - """ - The identifier of the Amazon Q Business application the plugin is - attached to. - """ - - plugin_id: str | None = None - """The identifier of the Amazon Q Business plugin.""" - - next_token: str | None = None - """ - If the number of plugin actions returned exceeds `maxResults`, Amazon Q - Business returns a next token as a pagination token to retrieve the next - set of plugin actions. - """ - - max_results: int | None = None - """The maximum number of plugin actions to return.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_PLUGIN_ACTIONS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_LIST_PLUGIN_ACTIONS_INPUT.members["applicationId"], - self.application_id, - ) - - if self.plugin_id is not None: - serializer.write_string( - _SCHEMA_LIST_PLUGIN_ACTIONS_INPUT.members["pluginId"], self.plugin_id - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_PLUGIN_ACTIONS_INPUT.members["nextToken"], self.next_token - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_PLUGIN_ACTIONS_INPUT.members["maxResults"], - self.max_results, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_LIST_PLUGIN_ACTIONS_INPUT.members["applicationId"] - ) - - case 1: - kwargs["plugin_id"] = de.read_string( - _SCHEMA_LIST_PLUGIN_ACTIONS_INPUT.members["pluginId"] - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_PLUGIN_ACTIONS_INPUT.members["nextToken"] - ) - - case 3: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_PLUGIN_ACTIONS_INPUT.members["maxResults"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_PLUGIN_ACTIONS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ListPluginActionsOutput: - """Dataclass for ListPluginActionsOutput structure.""" - - next_token: str | None = None - """ - If the response is truncated, Amazon Q Business returns this token, - which you can use in a later request to list the next set of plugin - actions. - """ - - items: list[ActionSummary] | None = None - """An array of information on one or more plugin actions.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_PLUGIN_ACTIONS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_PLUGIN_ACTIONS_OUTPUT.members["nextToken"], self.next_token - ) - - if self.items is not None: - _serialize_actions( - serializer, - _SCHEMA_LIST_PLUGIN_ACTIONS_OUTPUT.members["items"], - self.items, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_PLUGIN_ACTIONS_OUTPUT.members["nextToken"] - ) - - case 1: - kwargs["items"] = _deserialize_actions( - de, _SCHEMA_LIST_PLUGIN_ACTIONS_OUTPUT.members["items"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_PLUGIN_ACTIONS_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_PLUGIN_ACTIONS = APIOperation( - input=ListPluginActionsInput, - output=ListPluginActionsOutput, - schema=_SCHEMA_LIST_PLUGIN_ACTIONS, - input_schema=_SCHEMA_LIST_PLUGIN_ACTIONS_INPUT, - output_schema=_SCHEMA_LIST_PLUGIN_ACTIONS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListPluginTypeActionsInput: - """Dataclass for ListPluginTypeActionsInput structure.""" - - plugin_type: str | None = None - """The type of the plugin.""" - - next_token: str | None = None - """ - If the number of plugins returned exceeds `maxResults`, Amazon Q - Business returns a next token as a pagination token to retrieve the next - set of plugins. - """ - - max_results: int | None = None - """The maximum number of plugins to return.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_PLUGIN_TYPE_ACTIONS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.plugin_type is not None: - serializer.write_string( - _SCHEMA_LIST_PLUGIN_TYPE_ACTIONS_INPUT.members["pluginType"], - self.plugin_type, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_PLUGIN_TYPE_ACTIONS_INPUT.members["nextToken"], - self.next_token, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_PLUGIN_TYPE_ACTIONS_INPUT.members["maxResults"], - self.max_results, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["plugin_type"] = PluginType( - de.read_string( - _SCHEMA_LIST_PLUGIN_TYPE_ACTIONS_INPUT.members["pluginType"] - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_PLUGIN_TYPE_ACTIONS_INPUT.members["nextToken"] - ) - - case 2: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_PLUGIN_TYPE_ACTIONS_INPUT.members["maxResults"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_PLUGIN_TYPE_ACTIONS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ListPluginTypeActionsOutput: - """Dataclass for ListPluginTypeActionsOutput structure.""" - - next_token: str | None = None - """ - If the response is truncated, Amazon Q Business returns this token, - which you can use in a later request to list the next set of plugins. - """ - - items: list[ActionSummary] | None = None - """An array of information on one or more plugins.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_PLUGIN_TYPE_ACTIONS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_PLUGIN_TYPE_ACTIONS_OUTPUT.members["nextToken"], - self.next_token, - ) - - if self.items is not None: - _serialize_actions( - serializer, - _SCHEMA_LIST_PLUGIN_TYPE_ACTIONS_OUTPUT.members["items"], - self.items, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_PLUGIN_TYPE_ACTIONS_OUTPUT.members["nextToken"] - ) - - case 1: - kwargs["items"] = _deserialize_actions( - de, _SCHEMA_LIST_PLUGIN_TYPE_ACTIONS_OUTPUT.members["items"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_PLUGIN_TYPE_ACTIONS_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_PLUGIN_TYPE_ACTIONS = APIOperation( - input=ListPluginTypeActionsInput, - output=ListPluginTypeActionsOutput, - schema=_SCHEMA_LIST_PLUGIN_TYPE_ACTIONS, - input_schema=_SCHEMA_LIST_PLUGIN_TYPE_ACTIONS_INPUT, - output_schema=_SCHEMA_LIST_PLUGIN_TYPE_ACTIONS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListPluginTypeMetadataInput: - """Dataclass for ListPluginTypeMetadataInput structure.""" - - next_token: str | None = None - """ - If the metadata returned exceeds `maxResults`, Amazon Q Business returns - a next token as a pagination token to retrieve the next set of metadata. - """ - - max_results: int | None = None - """The maximum number of plugin metadata items to return.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_PLUGIN_TYPE_METADATA_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_PLUGIN_TYPE_METADATA_INPUT.members["nextToken"], - self.next_token, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_PLUGIN_TYPE_METADATA_INPUT.members["maxResults"], - self.max_results, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_PLUGIN_TYPE_METADATA_INPUT.members["nextToken"] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_PLUGIN_TYPE_METADATA_INPUT.members["maxResults"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_PLUGIN_TYPE_METADATA_INPUT, consumer=_consumer - ) - return kwargs - - -class PluginTypeCategory(UnknownEnumMixin, StrEnum): - CRM = "Customer relationship management (CRM)" - PROJECT_MANAGEMENT = "Project management" - COMMUNICATION = "Communication" - PRODUCTIVITY = "Productivity" - TICKETING_MANAGEMENT = "Ticketing and incident management" - - -@dataclass(kw_only=True) -class PluginTypeMetadataSummary: - """Summary metadata information for a Amazon Q Business plugin.""" - - type: str | None = None - """The type of the plugin.""" - - category: str | None = None - """The category of the plugin type.""" - - description: str | None = None - """ - The description assigned by Amazon Q Business to a plugin. You can't - modify this value. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PLUGIN_TYPE_METADATA_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.type is not None: - serializer.write_string( - _SCHEMA_PLUGIN_TYPE_METADATA_SUMMARY.members["type"], self.type - ) - - if self.category is not None: - serializer.write_string( - _SCHEMA_PLUGIN_TYPE_METADATA_SUMMARY.members["category"], self.category - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_PLUGIN_TYPE_METADATA_SUMMARY.members["description"], - self.description, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = PluginType( - de.read_string( - _SCHEMA_PLUGIN_TYPE_METADATA_SUMMARY.members["type"] - ) - ) - - case 1: - kwargs["category"] = PluginTypeCategory( - de.read_string( - _SCHEMA_PLUGIN_TYPE_METADATA_SUMMARY.members["category"] - ) - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_PLUGIN_TYPE_METADATA_SUMMARY.members["description"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PLUGIN_TYPE_METADATA_SUMMARY, consumer=_consumer - ) - return kwargs - - -def _serialize_list_plugin_type_metadata_summaries( - serializer: ShapeSerializer, schema: Schema, value: list[PluginTypeMetadataSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_list_plugin_type_metadata_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[PluginTypeMetadataSummary]: - result: list[PluginTypeMetadataSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(PluginTypeMetadataSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListPluginTypeMetadataOutput: - """Dataclass for ListPluginTypeMetadataOutput structure.""" - - next_token: str | None = None - """ - If the response is truncated, Amazon Q Business returns this token, - which you can use in a later request to list the next set of plugin - metadata. - """ - - items: list[PluginTypeMetadataSummary] | None = None - """An array of information on plugin metadata.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_PLUGIN_TYPE_METADATA_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_PLUGIN_TYPE_METADATA_OUTPUT.members["nextToken"], - self.next_token, - ) - - if self.items is not None: - _serialize_list_plugin_type_metadata_summaries( - serializer, - _SCHEMA_LIST_PLUGIN_TYPE_METADATA_OUTPUT.members["items"], - self.items, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_PLUGIN_TYPE_METADATA_OUTPUT.members["nextToken"] - ) - - case 1: - kwargs["items"] = _deserialize_list_plugin_type_metadata_summaries( - de, _SCHEMA_LIST_PLUGIN_TYPE_METADATA_OUTPUT.members["items"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_PLUGIN_TYPE_METADATA_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_PLUGIN_TYPE_METADATA = APIOperation( - input=ListPluginTypeMetadataInput, - output=ListPluginTypeMetadataOutput, - schema=_SCHEMA_LIST_PLUGIN_TYPE_METADATA, - input_schema=_SCHEMA_LIST_PLUGIN_TYPE_METADATA_INPUT, - output_schema=_SCHEMA_LIST_PLUGIN_TYPE_METADATA_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListSubscriptionsInput: - """Dataclass for ListSubscriptionsInput structure.""" - - application_id: str | None = None - """ - The identifier of the Amazon Q Business application linked to the - subscription. - """ - - next_token: str | None = None - """ - If the `maxResults` response was incomplete because there is more data - to retrieve, Amazon Q Business returns a pagination token in the - response. You can use this pagination token to retrieve the next set of - Amazon Q Business subscriptions. - """ - - max_results: int | None = None - """The maximum number of Amazon Q Business subscriptions to return.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_SUBSCRIPTIONS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_LIST_SUBSCRIPTIONS_INPUT.members["applicationId"], - self.application_id, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_SUBSCRIPTIONS_INPUT.members["nextToken"], self.next_token - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_SUBSCRIPTIONS_INPUT.members["maxResults"], self.max_results - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_LIST_SUBSCRIPTIONS_INPUT.members["applicationId"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_SUBSCRIPTIONS_INPUT.members["nextToken"] - ) - - case 2: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_SUBSCRIPTIONS_INPUT.members["maxResults"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_SUBSCRIPTIONS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Subscription: - """ - Information about an Amazon Q Business subscription. - - Subscriptions are used to provide access for an IAM Identity Center user - or a group to an Amazon Q Business application. - - Amazon Q Business offers two subscription tiers: `Q_LITE` and - `Q_BUSINESS`. Subscription tier determines feature access for the user. - For more information on subscriptions and pricing tiers, see [Amazon Q - Business pricing](https://aws.amazon.com/q/business/pricing/). - """ - - subscription_id: str | None = None - """The identifier of the Amazon Q Business subscription to be updated.""" - - subscription_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the Amazon Q Business subscription - that was updated. - """ - - principal: SubscriptionPrincipal | None = None - """ - The IAM Identity Center `UserId` or `GroupId` of a user or group in the - IAM Identity Center instance connected to the Amazon Q Business - application. - """ - - current_subscription: SubscriptionDetails | None = None - """The type of your current Amazon Q Business subscription.""" - - next_subscription: SubscriptionDetails | None = None - """The type of the Amazon Q Business subscription for the next month.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SUBSCRIPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.subscription_id is not None: - serializer.write_string( - _SCHEMA_SUBSCRIPTION.members["subscriptionId"], self.subscription_id - ) - - if self.subscription_arn is not None: - serializer.write_string( - _SCHEMA_SUBSCRIPTION.members["subscriptionArn"], self.subscription_arn - ) - - if self.principal is not None: - serializer.write_struct( - _SCHEMA_SUBSCRIPTION.members["principal"], self.principal - ) - - if self.current_subscription is not None: - serializer.write_struct( - _SCHEMA_SUBSCRIPTION.members["currentSubscription"], - self.current_subscription, - ) - - if self.next_subscription is not None: - serializer.write_struct( - _SCHEMA_SUBSCRIPTION.members["nextSubscription"], self.next_subscription - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["subscription_id"] = de.read_string( - _SCHEMA_SUBSCRIPTION.members["subscriptionId"] - ) - - case 1: - kwargs["subscription_arn"] = de.read_string( - _SCHEMA_SUBSCRIPTION.members["subscriptionArn"] - ) - - case 2: - kwargs["principal"] = ( - _SubscriptionPrincipalDeserializer().deserialize(de) - ) - - case 3: - kwargs["current_subscription"] = SubscriptionDetails.deserialize(de) - - case 4: - kwargs["next_subscription"] = SubscriptionDetails.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SUBSCRIPTION, consumer=_consumer) - return kwargs - - -def _serialize_subscriptions( - serializer: ShapeSerializer, schema: Schema, value: list[Subscription] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_subscriptions( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Subscription]: - result: list[Subscription] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Subscription.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListSubscriptionsOutput: - """Dataclass for ListSubscriptionsOutput structure.""" - - next_token: str | None = None - """ - If the response is truncated, Amazon Q Business returns this token. You - can use this token in a subsequent request to retrieve the next set of - subscriptions. - """ - - subscriptions: list[Subscription] | None = None - """ - An array of summary information on the subscriptions configured for an - Amazon Q Business application. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_SUBSCRIPTIONS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_SUBSCRIPTIONS_OUTPUT.members["nextToken"], self.next_token - ) - - if self.subscriptions is not None: - _serialize_subscriptions( - serializer, - _SCHEMA_LIST_SUBSCRIPTIONS_OUTPUT.members["subscriptions"], - self.subscriptions, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_SUBSCRIPTIONS_OUTPUT.members["nextToken"] - ) - - case 1: - kwargs["subscriptions"] = _deserialize_subscriptions( - de, _SCHEMA_LIST_SUBSCRIPTIONS_OUTPUT.members["subscriptions"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_SUBSCRIPTIONS_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_SUBSCRIPTIONS = APIOperation( - input=ListSubscriptionsInput, - output=ListSubscriptionsOutput, - schema=_SCHEMA_LIST_SUBSCRIPTIONS, - input_schema=_SCHEMA_LIST_SUBSCRIPTIONS_INPUT, - output_schema=_SCHEMA_LIST_SUBSCRIPTIONS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListTagsForResourceInput: - """Dataclass for ListTagsForResourceInput structure.""" - - resource_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the Amazon Q Business application or - data source to get a list of tags for. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT.members["resourceARN"], - self.resource_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT.members["resourceARN"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ListTagsForResourceOutput: - """Dataclass for ListTagsForResourceOutput structure.""" - - tags: list[Tag] | None = None - """ - A list of tags associated with the Amazon Q Business application or data - source. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.tags is not None: - _serialize_tags( - serializer, - _SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT.members["tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["tags"] = _deserialize_tags( - de, _SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_TAGS_FOR_RESOURCE = APIOperation( - input=ListTagsForResourceInput, - output=ListTagsForResourceOutput, - schema=_SCHEMA_LIST_TAGS_FOR_RESOURCE, - input_schema=_SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT, - output_schema=_SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class MessageUsefulnessReason(UnknownEnumMixin, StrEnum): - NOT_FACTUALLY_CORRECT = "NOT_FACTUALLY_CORRECT" - HARMFUL_OR_UNSAFE = "HARMFUL_OR_UNSAFE" - INCORRECT_OR_MISSING_SOURCES = "INCORRECT_OR_MISSING_SOURCES" - NOT_HELPFUL = "NOT_HELPFUL" - FACTUALLY_CORRECT = "FACTUALLY_CORRECT" - COMPLETE = "COMPLETE" - RELEVANT_SOURCES = "RELEVANT_SOURCES" - HELPFUL = "HELPFUL" - NOT_BASED_ON_DOCUMENTS = "NOT_BASED_ON_DOCUMENTS" - NOT_COMPLETE = "NOT_COMPLETE" - NOT_CONCISE = "NOT_CONCISE" - OTHER = "OTHER" - - -class MessageUsefulness(UnknownEnumMixin, StrEnum): - USEFUL = "USEFUL" - NOT_USEFUL = "NOT_USEFUL" - - -@dataclass(kw_only=True) -class MessageUsefulnessFeedback: - """ - End user feedback on an AI-generated web experience chat message - usefulness. - """ - - usefulness: str - """The usefulness value assigned by an end user to a message.""" - - submitted_at: datetime - """The timestamp for when the feedback was submitted.""" - - reason: str | None = None - """The reason for a usefulness rating.""" - - comment: str | None = None - """ - A comment given by an end user on the usefulness of an AI-generated chat - message. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MESSAGE_USEFULNESS_FEEDBACK, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MESSAGE_USEFULNESS_FEEDBACK.members["usefulness"], self.usefulness - ) - if self.reason is not None: - serializer.write_string( - _SCHEMA_MESSAGE_USEFULNESS_FEEDBACK.members["reason"], self.reason - ) - - if self.comment is not None: - serializer.write_string( - _SCHEMA_MESSAGE_USEFULNESS_FEEDBACK.members["comment"], self.comment - ) - - serializer.write_timestamp( - _SCHEMA_MESSAGE_USEFULNESS_FEEDBACK.members["submittedAt"], - self.submitted_at, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["usefulness"] = MessageUsefulness( - de.read_string( - _SCHEMA_MESSAGE_USEFULNESS_FEEDBACK.members["usefulness"] - ) - ) - - case 1: - kwargs["reason"] = MessageUsefulnessReason( - de.read_string( - _SCHEMA_MESSAGE_USEFULNESS_FEEDBACK.members["reason"] - ) - ) - - case 2: - kwargs["comment"] = de.read_string( - _SCHEMA_MESSAGE_USEFULNESS_FEEDBACK.members["comment"] - ) - - case 3: - kwargs["submitted_at"] = de.read_timestamp( - _SCHEMA_MESSAGE_USEFULNESS_FEEDBACK.members["submittedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MESSAGE_USEFULNESS_FEEDBACK, consumer=_consumer - ) - if "usefulness" not in kwargs: - kwargs["usefulness"] = MessageUsefulness._corrected("") - if "submitted_at" not in kwargs: - kwargs["submitted_at"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -@dataclass(kw_only=True) -class PutFeedbackInput: - """Dataclass for PutFeedbackInput structure.""" - - application_id: str | None = None - """The identifier of the application associated with the feedback.""" - - user_id: str | None = None - """The identifier of the user giving the feedback.""" - - conversation_id: str | None = None - """The identifier of the conversation the feedback is attached to.""" - - message_id: str | None = None - """The identifier of the chat message that the feedback was given for.""" - - message_copied_at: datetime | None = None - """The timestamp for when the feedback was recorded.""" - - message_usefulness: MessageUsefulnessFeedback | None = None - """The feedback usefulness value given by the user to the chat message.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_FEEDBACK_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_PUT_FEEDBACK_INPUT.members["applicationId"], self.application_id - ) - - if self.user_id is not None: - serializer.write_string( - _SCHEMA_PUT_FEEDBACK_INPUT.members["userId"], self.user_id - ) - - if self.conversation_id is not None: - serializer.write_string( - _SCHEMA_PUT_FEEDBACK_INPUT.members["conversationId"], - self.conversation_id, - ) - - if self.message_id is not None: - serializer.write_string( - _SCHEMA_PUT_FEEDBACK_INPUT.members["messageId"], self.message_id - ) - - if self.message_copied_at is not None: - serializer.write_timestamp( - _SCHEMA_PUT_FEEDBACK_INPUT.members["messageCopiedAt"], - self.message_copied_at, - ) - - if self.message_usefulness is not None: - serializer.write_struct( - _SCHEMA_PUT_FEEDBACK_INPUT.members["messageUsefulness"], - self.message_usefulness, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_PUT_FEEDBACK_INPUT.members["applicationId"] - ) - - case 1: - kwargs["user_id"] = de.read_string( - _SCHEMA_PUT_FEEDBACK_INPUT.members["userId"] - ) - - case 2: - kwargs["conversation_id"] = de.read_string( - _SCHEMA_PUT_FEEDBACK_INPUT.members["conversationId"] - ) - - case 3: - kwargs["message_id"] = de.read_string( - _SCHEMA_PUT_FEEDBACK_INPUT.members["messageId"] - ) - - case 4: - kwargs["message_copied_at"] = de.read_timestamp( - _SCHEMA_PUT_FEEDBACK_INPUT.members["messageCopiedAt"] - ) - - case 5: - kwargs["message_usefulness"] = ( - MessageUsefulnessFeedback.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUT_FEEDBACK_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class PutFeedbackOutput: - """Dataclass for PutFeedbackOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_FEEDBACK_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUT_FEEDBACK_OUTPUT, consumer=_consumer) - return kwargs - - -PUT_FEEDBACK = APIOperation( - input=PutFeedbackInput, - output=PutFeedbackOutput, - schema=_SCHEMA_PUT_FEEDBACK, - input_schema=_SCHEMA_PUT_FEEDBACK_INPUT, - output_schema=_SCHEMA_PUT_FEEDBACK_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class MemberGroup: - """The sub groups that belong to a group.""" - - group_name: str - """The name of the sub group.""" - - type: str | None = None - """The type of the sub group.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEMBER_GROUP, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MEMBER_GROUP.members["groupName"], self.group_name - ) - if self.type is not None: - serializer.write_string(_SCHEMA_MEMBER_GROUP.members["type"], self.type) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["group_name"] = de.read_string( - _SCHEMA_MEMBER_GROUP.members["groupName"] - ) - - case 1: - kwargs["type"] = MembershipType( - de.read_string(_SCHEMA_MEMBER_GROUP.members["type"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MEMBER_GROUP, consumer=_consumer) - if "group_name" not in kwargs: - kwargs["group_name"] = "" - return kwargs - - -def _serialize_member_groups( - serializer: ShapeSerializer, schema: Schema, value: list[MemberGroup] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_member_groups( - deserializer: ShapeDeserializer, schema: Schema -) -> list[MemberGroup]: - result: list[MemberGroup] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(MemberGroup.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class MemberUser: - """The users that belong to a group.""" - - user_id: str - """The identifier of the user you want to map to a group.""" - - type: str | None = None - """The type of the user.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEMBER_USER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_MEMBER_USER.members["userId"], self.user_id) - if self.type is not None: - serializer.write_string(_SCHEMA_MEMBER_USER.members["type"], self.type) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["user_id"] = de.read_string( - _SCHEMA_MEMBER_USER.members["userId"] - ) - - case 1: - kwargs["type"] = MembershipType( - de.read_string(_SCHEMA_MEMBER_USER.members["type"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MEMBER_USER, consumer=_consumer) - if "user_id" not in kwargs: - kwargs["user_id"] = "" - return kwargs - - -def _serialize_member_users( - serializer: ShapeSerializer, schema: Schema, value: list[MemberUser] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_member_users( - deserializer: ShapeDeserializer, schema: Schema -) -> list[MemberUser]: - result: list[MemberUser] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(MemberUser.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GroupMembers: - """ - A list of users or sub groups that belong to a group. This is for - generating Amazon Q Business chat results only from document a user has - access to. - """ - - member_groups: list[MemberGroup] | None = None - """ - A list of sub groups that belong to a group. For example, the sub groups - \"Research\", \"Engineering\", and \"Sales and Marketing\" all belong to - the group \"Company\". - """ - - member_users: list[MemberUser] | None = None - """ - A list of users that belong to a group. For example, a list of interns - all belong to the \"Interns\" group. - """ - - s3_path_for_group_members: S3 | None = None - """ - Information required for Amazon Q Business to find a specific file in an - Amazon S3 bucket. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GROUP_MEMBERS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.member_groups is not None: - _serialize_member_groups( - serializer, - _SCHEMA_GROUP_MEMBERS.members["memberGroups"], - self.member_groups, - ) - - if self.member_users is not None: - _serialize_member_users( - serializer, - _SCHEMA_GROUP_MEMBERS.members["memberUsers"], - self.member_users, - ) - - if self.s3_path_for_group_members is not None: - serializer.write_struct( - _SCHEMA_GROUP_MEMBERS.members["s3PathForGroupMembers"], - self.s3_path_for_group_members, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["member_groups"] = _deserialize_member_groups( - de, _SCHEMA_GROUP_MEMBERS.members["memberGroups"] - ) - - case 1: - kwargs["member_users"] = _deserialize_member_users( - de, _SCHEMA_GROUP_MEMBERS.members["memberUsers"] - ) - - case 2: - kwargs["s3_path_for_group_members"] = S3.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GROUP_MEMBERS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class PutGroupInput: - """Dataclass for PutGroupInput structure.""" - - application_id: str | None = None - """ - The identifier of the application in which the user and group mapping - belongs. - """ - - index_id: str | None = None - """ - The identifier of the index in which you want to map users to their - groups. - """ - - group_name: str | None = None - """ - The list that contains your users or sub groups that belong the same - group. For example, the group \"Company\" includes the user \"CEO\" and - the sub groups \"Research\", \"Engineering\", and \"Sales and - Marketing\". - """ - - data_source_id: str | None = None - """ - The identifier of the data source for which you want to map users to - their groups. This is useful if a group is tied to multiple data - sources, but you only want the group to access documents of a certain - data source. For example, the groups \"Research\", \"Engineering\", and - \"Sales and Marketing\" are all tied to the company's documents stored - in the data sources Confluence and Salesforce. However, \"Sales and - Marketing\" team only needs access to customer-related documents stored - in Salesforce. - """ - - type: str | None = None - """The type of the group.""" - - group_members: GroupMembers | None = None - """ - A list of users or sub groups that belong to a group. This is for - generating Amazon Q Business chat results only from document a user has - access to. - """ - - role_arn: str | None = None - """ - The Amazon Resource Name (ARN) of an IAM role that has access to the S3 - file that contains your list of users that belong to a group. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_GROUP_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_PUT_GROUP_INPUT.members["applicationId"], self.application_id - ) - - if self.index_id is not None: - serializer.write_string( - _SCHEMA_PUT_GROUP_INPUT.members["indexId"], self.index_id - ) - - if self.group_name is not None: - serializer.write_string( - _SCHEMA_PUT_GROUP_INPUT.members["groupName"], self.group_name - ) - - if self.data_source_id is not None: - serializer.write_string( - _SCHEMA_PUT_GROUP_INPUT.members["dataSourceId"], self.data_source_id - ) - - if self.type is not None: - serializer.write_string(_SCHEMA_PUT_GROUP_INPUT.members["type"], self.type) - - if self.group_members is not None: - serializer.write_struct( - _SCHEMA_PUT_GROUP_INPUT.members["groupMembers"], self.group_members - ) - - if self.role_arn is not None: - serializer.write_string( - _SCHEMA_PUT_GROUP_INPUT.members["roleArn"], self.role_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_PUT_GROUP_INPUT.members["applicationId"] - ) - - case 1: - kwargs["index_id"] = de.read_string( - _SCHEMA_PUT_GROUP_INPUT.members["indexId"] - ) - - case 2: - kwargs["group_name"] = de.read_string( - _SCHEMA_PUT_GROUP_INPUT.members["groupName"] - ) - - case 3: - kwargs["data_source_id"] = de.read_string( - _SCHEMA_PUT_GROUP_INPUT.members["dataSourceId"] - ) - - case 4: - kwargs["type"] = MembershipType( - de.read_string(_SCHEMA_PUT_GROUP_INPUT.members["type"]) - ) - - case 5: - kwargs["group_members"] = GroupMembers.deserialize(de) - - case 6: - kwargs["role_arn"] = de.read_string( - _SCHEMA_PUT_GROUP_INPUT.members["roleArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUT_GROUP_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class PutGroupOutput: - """Dataclass for PutGroupOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_GROUP_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUT_GROUP_OUTPUT, consumer=_consumer) - return kwargs - - -PUT_GROUP = APIOperation( - input=PutGroupInput, - output=PutGroupOutput, - schema=_SCHEMA_PUT_GROUP, - input_schema=_SCHEMA_PUT_GROUP_INPUT, - output_schema=_SCHEMA_PUT_GROUP_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.qbusiness#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -class ScoreConfidence(UnknownEnumMixin, StrEnum): - VERY_HIGH = "VERY_HIGH" - HIGH = "HIGH" - MEDIUM = "MEDIUM" - LOW = "LOW" - NOT_AVAILABLE = "NOT_AVAILABLE" - - -@dataclass(kw_only=True) -class ScoreAttributes: - """Provides information about the relevance score of content.""" - - score_confidence: str | None = None - """The confidence level of the relevance score.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SCORE_ATTRIBUTES, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.score_confidence is not None: - serializer.write_string( - _SCHEMA_SCORE_ATTRIBUTES.members["scoreConfidence"], - self.score_confidence, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["score_confidence"] = ScoreConfidence( - de.read_string( - _SCHEMA_SCORE_ATTRIBUTES.members["scoreConfidence"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SCORE_ATTRIBUTES, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class RelevantContent: - """Represents a piece of content that is relevant to a search query.""" - - content: str | None = None - """The actual content of the relevant item.""" - - document_id: str | None = None - """The unique identifier of the document containing the relevant content.""" - - document_title: str | None = None - """The title of the document containing the relevant content.""" - - document_uri: str | None = None - """The URI of the document containing the relevant content.""" - - document_attributes: list[DocumentAttribute] | None = None - """Additional attributes of the document containing the relevant content.""" - - score_attributes: ScoreAttributes | None = None - """Attributes related to the relevance score of the content.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RELEVANT_CONTENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.content is not None: - serializer.write_string( - _SCHEMA_RELEVANT_CONTENT.members["content"], self.content - ) - - if self.document_id is not None: - serializer.write_string( - _SCHEMA_RELEVANT_CONTENT.members["documentId"], self.document_id - ) - - if self.document_title is not None: - serializer.write_string( - _SCHEMA_RELEVANT_CONTENT.members["documentTitle"], self.document_title - ) - - if self.document_uri is not None: - serializer.write_string( - _SCHEMA_RELEVANT_CONTENT.members["documentUri"], self.document_uri - ) - - if self.document_attributes is not None: - _serialize_document_attributes( - serializer, - _SCHEMA_RELEVANT_CONTENT.members["documentAttributes"], - self.document_attributes, - ) - - if self.score_attributes is not None: - serializer.write_struct( - _SCHEMA_RELEVANT_CONTENT.members["scoreAttributes"], - self.score_attributes, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["content"] = de.read_string( - _SCHEMA_RELEVANT_CONTENT.members["content"] - ) - - case 1: - kwargs["document_id"] = de.read_string( - _SCHEMA_RELEVANT_CONTENT.members["documentId"] - ) - - case 2: - kwargs["document_title"] = de.read_string( - _SCHEMA_RELEVANT_CONTENT.members["documentTitle"] - ) - - case 3: - kwargs["document_uri"] = de.read_string( - _SCHEMA_RELEVANT_CONTENT.members["documentUri"] - ) - - case 4: - kwargs["document_attributes"] = _deserialize_document_attributes( - de, _SCHEMA_RELEVANT_CONTENT.members["documentAttributes"] - ) - - case 5: - kwargs["score_attributes"] = ScoreAttributes.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RELEVANT_CONTENT, consumer=_consumer) - return kwargs - - -def _serialize_relevant_content_list( - serializer: ShapeSerializer, schema: Schema, value: list[RelevantContent] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_relevant_content_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[RelevantContent]: - result: list[RelevantContent] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(RelevantContent.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class SearchRelevantContentOutput: - """Dataclass for SearchRelevantContentOutput structure.""" - - relevant_content: list[RelevantContent] | None = None - """The list of relevant content items found.""" - - next_token: str | None = None - """The token to use to retrieve the next set of results, if there are any.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SEARCH_RELEVANT_CONTENT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.relevant_content is not None: - _serialize_relevant_content_list( - serializer, - _SCHEMA_SEARCH_RELEVANT_CONTENT_OUTPUT.members["relevantContent"], - self.relevant_content, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_SEARCH_RELEVANT_CONTENT_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["relevant_content"] = _deserialize_relevant_content_list( - de, - _SCHEMA_SEARCH_RELEVANT_CONTENT_OUTPUT.members[ - "relevantContent" - ], - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_SEARCH_RELEVANT_CONTENT_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SEARCH_RELEVANT_CONTENT_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class StartDataSourceSyncJobInput: - """Dataclass for StartDataSourceSyncJobInput structure.""" - - data_source_id: str | None = None - """The identifier of the data source connector.""" - - application_id: str | None = None - """ - The identifier of Amazon Q Business application the data source is - connected to. - """ - - index_id: str | None = None - """The identifier of the index used with the data source connector.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_DATA_SOURCE_SYNC_JOB_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.data_source_id is not None: - serializer.write_string( - _SCHEMA_START_DATA_SOURCE_SYNC_JOB_INPUT.members["dataSourceId"], - self.data_source_id, - ) - - if self.application_id is not None: - serializer.write_string( - _SCHEMA_START_DATA_SOURCE_SYNC_JOB_INPUT.members["applicationId"], - self.application_id, - ) - - if self.index_id is not None: - serializer.write_string( - _SCHEMA_START_DATA_SOURCE_SYNC_JOB_INPUT.members["indexId"], - self.index_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["data_source_id"] = de.read_string( - _SCHEMA_START_DATA_SOURCE_SYNC_JOB_INPUT.members["dataSourceId"] - ) - - case 1: - kwargs["application_id"] = de.read_string( - _SCHEMA_START_DATA_SOURCE_SYNC_JOB_INPUT.members[ - "applicationId" - ] - ) - - case 2: - kwargs["index_id"] = de.read_string( - _SCHEMA_START_DATA_SOURCE_SYNC_JOB_INPUT.members["indexId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_START_DATA_SOURCE_SYNC_JOB_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class StartDataSourceSyncJobOutput: - """Dataclass for StartDataSourceSyncJobOutput structure.""" - - execution_id: str | None = None - """The identifier for a particular synchronization job.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_DATA_SOURCE_SYNC_JOB_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.execution_id is not None: - serializer.write_string( - _SCHEMA_START_DATA_SOURCE_SYNC_JOB_OUTPUT.members["executionId"], - self.execution_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["execution_id"] = de.read_string( - _SCHEMA_START_DATA_SOURCE_SYNC_JOB_OUTPUT.members["executionId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_START_DATA_SOURCE_SYNC_JOB_OUTPUT, consumer=_consumer - ) - return kwargs - - -START_DATA_SOURCE_SYNC_JOB = APIOperation( - input=StartDataSourceSyncJobInput, - output=StartDataSourceSyncJobOutput, - schema=_SCHEMA_START_DATA_SOURCE_SYNC_JOB, - input_schema=_SCHEMA_START_DATA_SOURCE_SYNC_JOB_INPUT, - output_schema=_SCHEMA_START_DATA_SOURCE_SYNC_JOB_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.qbusiness#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class StopDataSourceSyncJobInput: - """Dataclass for StopDataSourceSyncJobInput structure.""" - - data_source_id: str | None = None - """The identifier of the data source connector.""" - - application_id: str | None = None - """ - The identifier of the Amazon Q Business application that the data source - is connected to. - """ - - index_id: str | None = None - """ - The identifier of the index used with the Amazon Q Business data source - connector. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STOP_DATA_SOURCE_SYNC_JOB_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.data_source_id is not None: - serializer.write_string( - _SCHEMA_STOP_DATA_SOURCE_SYNC_JOB_INPUT.members["dataSourceId"], - self.data_source_id, - ) - - if self.application_id is not None: - serializer.write_string( - _SCHEMA_STOP_DATA_SOURCE_SYNC_JOB_INPUT.members["applicationId"], - self.application_id, - ) - - if self.index_id is not None: - serializer.write_string( - _SCHEMA_STOP_DATA_SOURCE_SYNC_JOB_INPUT.members["indexId"], - self.index_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["data_source_id"] = de.read_string( - _SCHEMA_STOP_DATA_SOURCE_SYNC_JOB_INPUT.members["dataSourceId"] - ) - - case 1: - kwargs["application_id"] = de.read_string( - _SCHEMA_STOP_DATA_SOURCE_SYNC_JOB_INPUT.members["applicationId"] - ) - - case 2: - kwargs["index_id"] = de.read_string( - _SCHEMA_STOP_DATA_SOURCE_SYNC_JOB_INPUT.members["indexId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_STOP_DATA_SOURCE_SYNC_JOB_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class StopDataSourceSyncJobOutput: - """Dataclass for StopDataSourceSyncJobOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STOP_DATA_SOURCE_SYNC_JOB_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_STOP_DATA_SOURCE_SYNC_JOB_OUTPUT, consumer=_consumer - ) - return kwargs - - -STOP_DATA_SOURCE_SYNC_JOB = APIOperation( - input=StopDataSourceSyncJobInput, - output=StopDataSourceSyncJobOutput, - schema=_SCHEMA_STOP_DATA_SOURCE_SYNC_JOB, - input_schema=_SCHEMA_STOP_DATA_SOURCE_SYNC_JOB_INPUT, - output_schema=_SCHEMA_STOP_DATA_SOURCE_SYNC_JOB_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class TagResourceInput: - """Dataclass for TagResourceInput structure.""" - - resource_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the Amazon Q Business application or - data source to tag. - """ - - tags: list[Tag] | None = None - """ - A list of tag keys to add to the Amazon Q Business application or data - source. If a tag already exists, the existing value is replaced with the - new value. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TAG_RESOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_TAG_RESOURCE_INPUT.members["resourceARN"], self.resource_arn - ) - - if self.tags is not None: - _serialize_tags( - serializer, _SCHEMA_TAG_RESOURCE_INPUT.members["tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_TAG_RESOURCE_INPUT.members["resourceARN"] - ) - - case 1: - kwargs["tags"] = _deserialize_tags( - de, _SCHEMA_TAG_RESOURCE_INPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TAG_RESOURCE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class TagResourceOutput: - """Dataclass for TagResourceOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TAG_RESOURCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TAG_RESOURCE_OUTPUT, consumer=_consumer) - return kwargs - - -TAG_RESOURCE = APIOperation( - input=TagResourceInput, - output=TagResourceOutput, - schema=_SCHEMA_TAG_RESOURCE, - input_schema=_SCHEMA_TAG_RESOURCE_INPUT, - output_schema=_SCHEMA_TAG_RESOURCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -def _serialize_tag_keys( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_tag_keys(deserializer: ShapeDeserializer, schema: Schema) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class UntagResourceInput: - """Dataclass for UntagResourceInput structure.""" - - resource_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the Amazon Q Business application, or - data source to remove the tag from. - """ - - tag_keys: list[str] | None = None - """ - A list of tag keys to remove from the Amazon Q Business application or - data source. If a tag key does not exist on the resource, it is ignored. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNTAG_RESOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_UNTAG_RESOURCE_INPUT.members["resourceARN"], self.resource_arn - ) - - if self.tag_keys is not None: - _serialize_tag_keys( - serializer, - _SCHEMA_UNTAG_RESOURCE_INPUT.members["tagKeys"], - self.tag_keys, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_UNTAG_RESOURCE_INPUT.members["resourceARN"] - ) - - case 1: - kwargs["tag_keys"] = _deserialize_tag_keys( - de, _SCHEMA_UNTAG_RESOURCE_INPUT.members["tagKeys"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UNTAG_RESOURCE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UntagResourceOutput: - """Dataclass for UntagResourceOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNTAG_RESOURCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UNTAG_RESOURCE_OUTPUT, consumer=_consumer) - return kwargs - - -UNTAG_RESOURCE = APIOperation( - input=UntagResourceInput, - output=UntagResourceOutput, - schema=_SCHEMA_UNTAG_RESOURCE, - input_schema=_SCHEMA_UNTAG_RESOURCE_INPUT, - output_schema=_SCHEMA_UNTAG_RESOURCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class OrchestrationConfiguration: - """ - Configuration information required to enable chat orchestration for your - Amazon Q Business application. - - Note: - Chat orchestration is optimized to work for English language content. - For more details on language support in Amazon Q Business, see - [Supported - languages](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/supported-languages.html). - """ - - control: str - """ - Status information about whether chat orchestration is activated or - deactivated for your Amazon Q Business application. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ORCHESTRATION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_ORCHESTRATION_CONFIGURATION.members["control"], self.control - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["control"] = OrchestrationControl( - de.read_string( - _SCHEMA_ORCHESTRATION_CONFIGURATION.members["control"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ORCHESTRATION_CONFIGURATION, consumer=_consumer - ) - if "control" not in kwargs: - kwargs["control"] = OrchestrationControl._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class UpdateChatControlsConfigurationInput: - """Dataclass for UpdateChatControlsConfigurationInput structure.""" - - application_id: str | None = None - """ - The identifier of the application for which the chat controls are - configured. - """ - - client_token: str | None = None - """ - A token that you provide to identify the request to update a Amazon Q - Business application chat configuration. - """ - - response_scope: str | None = None - """ - The response scope configured for your application. This determines - whether your application uses its retrieval augmented generation (RAG) - system to generate answers only from your enterprise data, or also uses - the large language models (LLM) knowledge to respons to end user - questions in chat. - """ - - orchestration_configuration: OrchestrationConfiguration | None = None - """The chat response orchestration settings for your application.""" - - blocked_phrases_configuration_update: BlockedPhrasesConfigurationUpdate | None = ( - None - ) - """The phrases blocked from chat by your chat control configuration.""" - - topic_configurations_to_create_or_update: list[TopicConfiguration] | None = None - """The configured topic specific chat controls you want to update.""" - - topic_configurations_to_delete: list[TopicConfiguration] | None = None - """The configured topic specific chat controls you want to delete.""" - - creator_mode_configuration: CreatorModeConfiguration | None = None - """The configuration details for `CREATOR_MODE`.""" - - hallucination_reduction_configuration: ( - HallucinationReductionConfiguration | None - ) = None - """The hallucination reduction settings for your application.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_CHAT_CONTROLS_CONFIGURATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_CHAT_CONTROLS_CONFIGURATION_INPUT.members[ - "applicationId" - ], - self.application_id, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_UPDATE_CHAT_CONTROLS_CONFIGURATION_INPUT.members["clientToken"], - self.client_token, - ) - - if self.response_scope is not None: - serializer.write_string( - _SCHEMA_UPDATE_CHAT_CONTROLS_CONFIGURATION_INPUT.members[ - "responseScope" - ], - self.response_scope, - ) - - if self.orchestration_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_CHAT_CONTROLS_CONFIGURATION_INPUT.members[ - "orchestrationConfiguration" - ], - self.orchestration_configuration, - ) - - if self.blocked_phrases_configuration_update is not None: - serializer.write_struct( - _SCHEMA_UPDATE_CHAT_CONTROLS_CONFIGURATION_INPUT.members[ - "blockedPhrasesConfigurationUpdate" - ], - self.blocked_phrases_configuration_update, - ) - - if self.topic_configurations_to_create_or_update is not None: - _serialize_topic_configurations( - serializer, - _SCHEMA_UPDATE_CHAT_CONTROLS_CONFIGURATION_INPUT.members[ - "topicConfigurationsToCreateOrUpdate" - ], - self.topic_configurations_to_create_or_update, - ) - - if self.topic_configurations_to_delete is not None: - _serialize_topic_configurations( - serializer, - _SCHEMA_UPDATE_CHAT_CONTROLS_CONFIGURATION_INPUT.members[ - "topicConfigurationsToDelete" - ], - self.topic_configurations_to_delete, - ) - - if self.creator_mode_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_CHAT_CONTROLS_CONFIGURATION_INPUT.members[ - "creatorModeConfiguration" - ], - self.creator_mode_configuration, - ) - - if self.hallucination_reduction_configuration is not None: - serializer.write_struct( - _SCHEMA_UPDATE_CHAT_CONTROLS_CONFIGURATION_INPUT.members[ - "hallucinationReductionConfiguration" - ], - self.hallucination_reduction_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_UPDATE_CHAT_CONTROLS_CONFIGURATION_INPUT.members[ - "applicationId" - ] - ) - - case 1: - kwargs["client_token"] = de.read_string( - _SCHEMA_UPDATE_CHAT_CONTROLS_CONFIGURATION_INPUT.members[ - "clientToken" - ] - ) - - case 2: - kwargs["response_scope"] = ResponseScope( - de.read_string( - _SCHEMA_UPDATE_CHAT_CONTROLS_CONFIGURATION_INPUT.members[ - "responseScope" - ] - ) - ) - - case 3: - kwargs["orchestration_configuration"] = ( - OrchestrationConfiguration.deserialize(de) - ) - - case 4: - kwargs["blocked_phrases_configuration_update"] = ( - BlockedPhrasesConfigurationUpdate.deserialize(de) - ) - - case 5: - kwargs["topic_configurations_to_create_or_update"] = ( - _deserialize_topic_configurations( - de, - _SCHEMA_UPDATE_CHAT_CONTROLS_CONFIGURATION_INPUT.members[ - "topicConfigurationsToCreateOrUpdate" - ], - ) - ) - - case 6: - kwargs["topic_configurations_to_delete"] = ( - _deserialize_topic_configurations( - de, - _SCHEMA_UPDATE_CHAT_CONTROLS_CONFIGURATION_INPUT.members[ - "topicConfigurationsToDelete" - ], - ) - ) - - case 7: - kwargs["creator_mode_configuration"] = ( - CreatorModeConfiguration.deserialize(de) - ) - - case 8: - kwargs["hallucination_reduction_configuration"] = ( - HallucinationReductionConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_CHAT_CONTROLS_CONFIGURATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateChatControlsConfigurationOutput: - """Dataclass for UpdateChatControlsConfigurationOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_CHAT_CONTROLS_CONFIGURATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_CHAT_CONTROLS_CONFIGURATION_OUTPUT, consumer=_consumer - ) - return kwargs - - -UPDATE_CHAT_CONTROLS_CONFIGURATION = APIOperation( - input=UpdateChatControlsConfigurationInput, - output=UpdateChatControlsConfigurationOutput, - schema=_SCHEMA_UPDATE_CHAT_CONTROLS_CONFIGURATION, - input_schema=_SCHEMA_UPDATE_CHAT_CONTROLS_CONFIGURATION_INPUT, - output_schema=_SCHEMA_UPDATE_CHAT_CONTROLS_CONFIGURATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.qbusiness#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateChatResponseConfigurationInput: - """Dataclass for UpdateChatResponseConfigurationInput structure.""" - - application_id: str | None = None - """ - The unique identifier of the Amazon Q Business application containing - the chat response configuration to update. - """ - - chat_response_configuration_id: str | None = None - """ - The unique identifier of the chat response configuration to update - within the specified application. - """ - - display_name: str | None = None - """ - The new human-readable name to assign to the chat response - configuration, making it easier to identify among multiple - configurations. - """ - - response_configurations: dict[str, ResponseConfiguration] | None = None - """ - The updated collection of response configuration settings that define - how Amazon Q Business generates and formats responses to user queries. - """ - - client_token: str | None = None - """ - A unique, case-sensitive identifier to ensure idempotency of the - request. This helps prevent the same update from being processed - multiple times if retries occur. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_CHAT_RESPONSE_CONFIGURATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_CHAT_RESPONSE_CONFIGURATION_INPUT.members[ - "applicationId" - ], - self.application_id, - ) - - if self.chat_response_configuration_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_CHAT_RESPONSE_CONFIGURATION_INPUT.members[ - "chatResponseConfigurationId" - ], - self.chat_response_configuration_id, - ) - - if self.display_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_CHAT_RESPONSE_CONFIGURATION_INPUT.members["displayName"], - self.display_name, - ) - - if self.response_configurations is not None: - _serialize_response_configurations( - serializer, - _SCHEMA_UPDATE_CHAT_RESPONSE_CONFIGURATION_INPUT.members[ - "responseConfigurations" - ], - self.response_configurations, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_UPDATE_CHAT_RESPONSE_CONFIGURATION_INPUT.members["clientToken"], - self.client_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_UPDATE_CHAT_RESPONSE_CONFIGURATION_INPUT.members[ - "applicationId" - ] - ) - - case 1: - kwargs["chat_response_configuration_id"] = de.read_string( - _SCHEMA_UPDATE_CHAT_RESPONSE_CONFIGURATION_INPUT.members[ - "chatResponseConfigurationId" - ] - ) - - case 2: - kwargs["display_name"] = de.read_string( - _SCHEMA_UPDATE_CHAT_RESPONSE_CONFIGURATION_INPUT.members[ - "displayName" - ] - ) - - case 3: - kwargs["response_configurations"] = ( - _deserialize_response_configurations( - de, - _SCHEMA_UPDATE_CHAT_RESPONSE_CONFIGURATION_INPUT.members[ - "responseConfigurations" - ], - ) - ) - - case 4: - kwargs["client_token"] = de.read_string( - _SCHEMA_UPDATE_CHAT_RESPONSE_CONFIGURATION_INPUT.members[ - "clientToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_CHAT_RESPONSE_CONFIGURATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class UpdateChatResponseConfigurationOutput: - """Dataclass for UpdateChatResponseConfigurationOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_CHAT_RESPONSE_CONFIGURATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_CHAT_RESPONSE_CONFIGURATION_OUTPUT, consumer=_consumer - ) - return kwargs - - -UPDATE_CHAT_RESPONSE_CONFIGURATION = APIOperation( - input=UpdateChatResponseConfigurationInput, - output=UpdateChatResponseConfigurationOutput, - schema=_SCHEMA_UPDATE_CHAT_RESPONSE_CONFIGURATION, - input_schema=_SCHEMA_UPDATE_CHAT_RESPONSE_CONFIGURATION_INPUT, - output_schema=_SCHEMA_UPDATE_CHAT_RESPONSE_CONFIGURATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateSubscriptionInput: - """Dataclass for UpdateSubscriptionInput structure.""" - - application_id: str | None = None - """ - The identifier of the Amazon Q Business application where the - subscription update should take effect. - """ - - subscription_id: str | None = None - """The identifier of the Amazon Q Business subscription to be updated.""" - - type: str | None = None - """The type of the Amazon Q Business subscription to be updated.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_SUBSCRIPTION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_SUBSCRIPTION_INPUT.members["applicationId"], - self.application_id, - ) - - if self.subscription_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_SUBSCRIPTION_INPUT.members["subscriptionId"], - self.subscription_id, - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_UPDATE_SUBSCRIPTION_INPUT.members["type"], self.type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_UPDATE_SUBSCRIPTION_INPUT.members["applicationId"] - ) - - case 1: - kwargs["subscription_id"] = de.read_string( - _SCHEMA_UPDATE_SUBSCRIPTION_INPUT.members["subscriptionId"] - ) - - case 2: - kwargs["type"] = SubscriptionType( - de.read_string( - _SCHEMA_UPDATE_SUBSCRIPTION_INPUT.members["type"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_SUBSCRIPTION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateSubscriptionOutput: - """Dataclass for UpdateSubscriptionOutput structure.""" - - subscription_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the Amazon Q Business subscription - that was updated. - """ - - current_subscription: SubscriptionDetails | None = None - """The type of your current Amazon Q Business subscription.""" - - next_subscription: SubscriptionDetails | None = None - """The type of the Amazon Q Business subscription for the next month.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_SUBSCRIPTION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.subscription_arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_SUBSCRIPTION_OUTPUT.members["subscriptionArn"], - self.subscription_arn, - ) - - if self.current_subscription is not None: - serializer.write_struct( - _SCHEMA_UPDATE_SUBSCRIPTION_OUTPUT.members["currentSubscription"], - self.current_subscription, - ) - - if self.next_subscription is not None: - serializer.write_struct( - _SCHEMA_UPDATE_SUBSCRIPTION_OUTPUT.members["nextSubscription"], - self.next_subscription, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["subscription_arn"] = de.read_string( - _SCHEMA_UPDATE_SUBSCRIPTION_OUTPUT.members["subscriptionArn"] - ) - - case 1: - kwargs["current_subscription"] = SubscriptionDetails.deserialize(de) - - case 2: - kwargs["next_subscription"] = SubscriptionDetails.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_SUBSCRIPTION_OUTPUT, consumer=_consumer) - return kwargs - - -UPDATE_SUBSCRIPTION = APIOperation( - input=UpdateSubscriptionInput, - output=UpdateSubscriptionOutput, - schema=_SCHEMA_UPDATE_SUBSCRIPTION, - input_schema=_SCHEMA_UPDATE_SUBSCRIPTION_INPUT, - output_schema=_SCHEMA_UPDATE_SUBSCRIPTION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class UpdateUserInput: - """Dataclass for UpdateUserInput structure.""" - - application_id: str | None = None - """The identifier of the application the user is attached to.""" - - user_id: str | None = None - """The email id attached to the user.""" - - user_aliases_to_update: list[UserAlias] | None = None - """The user aliases attached to the user id that are to be updated.""" - - user_aliases_to_delete: list[UserAlias] | None = None - """The user aliases attached to the user id that are to be deleted.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_USER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_USER_INPUT.members["applicationId"], self.application_id - ) - - if self.user_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_USER_INPUT.members["userId"], self.user_id - ) - - if self.user_aliases_to_update is not None: - _serialize_user_aliases( - serializer, - _SCHEMA_UPDATE_USER_INPUT.members["userAliasesToUpdate"], - self.user_aliases_to_update, - ) - - if self.user_aliases_to_delete is not None: - _serialize_user_aliases( - serializer, - _SCHEMA_UPDATE_USER_INPUT.members["userAliasesToDelete"], - self.user_aliases_to_delete, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_UPDATE_USER_INPUT.members["applicationId"] - ) - - case 1: - kwargs["user_id"] = de.read_string( - _SCHEMA_UPDATE_USER_INPUT.members["userId"] - ) - - case 2: - kwargs["user_aliases_to_update"] = _deserialize_user_aliases( - de, _SCHEMA_UPDATE_USER_INPUT.members["userAliasesToUpdate"] - ) - - case 3: - kwargs["user_aliases_to_delete"] = _deserialize_user_aliases( - de, _SCHEMA_UPDATE_USER_INPUT.members["userAliasesToDelete"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_USER_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateUserOutput: - """Dataclass for UpdateUserOutput structure.""" - - user_aliases_added: list[UserAlias] | None = None - """The user aliases that have been to be added to a user id.""" - - user_aliases_updated: list[UserAlias] | None = None - """The user aliases attached to a user id that have been updated.""" - - user_aliases_deleted: list[UserAlias] | None = None - """The user aliases that have been deleted from a user id.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_USER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.user_aliases_added is not None: - _serialize_user_aliases( - serializer, - _SCHEMA_UPDATE_USER_OUTPUT.members["userAliasesAdded"], - self.user_aliases_added, - ) - - if self.user_aliases_updated is not None: - _serialize_user_aliases( - serializer, - _SCHEMA_UPDATE_USER_OUTPUT.members["userAliasesUpdated"], - self.user_aliases_updated, - ) - - if self.user_aliases_deleted is not None: - _serialize_user_aliases( - serializer, - _SCHEMA_UPDATE_USER_OUTPUT.members["userAliasesDeleted"], - self.user_aliases_deleted, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["user_aliases_added"] = _deserialize_user_aliases( - de, _SCHEMA_UPDATE_USER_OUTPUT.members["userAliasesAdded"] - ) - - case 1: - kwargs["user_aliases_updated"] = _deserialize_user_aliases( - de, _SCHEMA_UPDATE_USER_OUTPUT.members["userAliasesUpdated"] - ) - - case 2: - kwargs["user_aliases_deleted"] = _deserialize_user_aliases( - de, _SCHEMA_UPDATE_USER_OUTPUT.members["userAliasesDeleted"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_USER_OUTPUT, consumer=_consumer) - return kwargs - - -UPDATE_USER = APIOperation( - input=UpdateUserInput, - output=UpdateUserOutput, - schema=_SCHEMA_UPDATE_USER, - input_schema=_SCHEMA_UPDATE_USER_INPUT, - output_schema=_SCHEMA_UPDATE_USER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.qbusiness#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class AttributeFilter: - """ - Enables filtering of responses based on document attributes or metadata - fields. - """ - - and_all_filters: "list[AttributeFilter] | None" = None - """Performs a logical `AND` operation on all supplied filters.""" - - or_all_filters: "list[AttributeFilter] | None" = None - """Performs a logical `OR` operation on all supplied filters.""" - - not_filter: "AttributeFilter | None" = None - """Performs a logical `NOT` operation on all supplied filters.""" - - equals_to: DocumentAttribute | None = None - """ - Performs an equals operation on two document attributes or metadata - fields. Supported for the following [document attribute value - types](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_DocumentAttributeValue.html): - `dateValue`, `longValue`, `stringListValue` and `stringValue`. - """ - - contains_all: DocumentAttribute | None = None - """ - Returns `true` when a document contains all the specified document - attributes or metadata fields. Supported for the following [document - attribute value - types](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_DocumentAttributeValue.html): - `stringListValue`. - """ - - contains_any: DocumentAttribute | None = None - """ - Returns `true` when a document contains any of the specified document - attributes or metadata fields. Supported for the following [document - attribute value - types](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_DocumentAttributeValue.html): - `stringListValue`. - """ - - greater_than: DocumentAttribute | None = None - """ - Performs a greater than operation on two document attributes or metadata - fields. Supported for the following [document attribute value - types](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_DocumentAttributeValue.html): - `dateValue` and `longValue`. - """ - - greater_than_or_equals: DocumentAttribute | None = None - """ - Performs a greater or equals than operation on two document attributes - or metadata fields. Supported for the following [document attribute - value - types](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_DocumentAttributeValue.html): - `dateValue` and `longValue`. - """ - - less_than: DocumentAttribute | None = None - """ - Performs a less than operation on two document attributes or metadata - fields. Supported for the following [document attribute value - types](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_DocumentAttributeValue.html): - `dateValue` and `longValue`. - """ - - less_than_or_equals: DocumentAttribute | None = None - """ - Performs a less than or equals operation on two document attributes or - metadata fields.Supported for the following [document attribute value - type](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_DocumentAttributeValue.html): - `dateValue` and `longValue`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ATTRIBUTE_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.and_all_filters is not None: - _serialize_attribute_filters( - serializer, - _SCHEMA_ATTRIBUTE_FILTER.members["andAllFilters"], - self.and_all_filters, - ) - - if self.or_all_filters is not None: - _serialize_attribute_filters( - serializer, - _SCHEMA_ATTRIBUTE_FILTER.members["orAllFilters"], - self.or_all_filters, - ) - - if self.not_filter is not None: - serializer.write_struct( - _SCHEMA_ATTRIBUTE_FILTER.members["notFilter"], self.not_filter - ) - - if self.equals_to is not None: - serializer.write_struct( - _SCHEMA_ATTRIBUTE_FILTER.members["equalsTo"], self.equals_to - ) - - if self.contains_all is not None: - serializer.write_struct( - _SCHEMA_ATTRIBUTE_FILTER.members["containsAll"], self.contains_all - ) - - if self.contains_any is not None: - serializer.write_struct( - _SCHEMA_ATTRIBUTE_FILTER.members["containsAny"], self.contains_any - ) - - if self.greater_than is not None: - serializer.write_struct( - _SCHEMA_ATTRIBUTE_FILTER.members["greaterThan"], self.greater_than - ) - - if self.greater_than_or_equals is not None: - serializer.write_struct( - _SCHEMA_ATTRIBUTE_FILTER.members["greaterThanOrEquals"], - self.greater_than_or_equals, - ) - - if self.less_than is not None: - serializer.write_struct( - _SCHEMA_ATTRIBUTE_FILTER.members["lessThan"], self.less_than - ) - - if self.less_than_or_equals is not None: - serializer.write_struct( - _SCHEMA_ATTRIBUTE_FILTER.members["lessThanOrEquals"], - self.less_than_or_equals, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["and_all_filters"] = _deserialize_attribute_filters( - de, _SCHEMA_ATTRIBUTE_FILTER.members["andAllFilters"] - ) - - case 1: - kwargs["or_all_filters"] = _deserialize_attribute_filters( - de, _SCHEMA_ATTRIBUTE_FILTER.members["orAllFilters"] - ) - - case 2: - kwargs["not_filter"] = AttributeFilter.deserialize(de) - - case 3: - kwargs["equals_to"] = DocumentAttribute.deserialize(de) - - case 4: - kwargs["contains_all"] = DocumentAttribute.deserialize(de) - - case 5: - kwargs["contains_any"] = DocumentAttribute.deserialize(de) - - case 6: - kwargs["greater_than"] = DocumentAttribute.deserialize(de) - - case 7: - kwargs["greater_than_or_equals"] = DocumentAttribute.deserialize(de) - - case 8: - kwargs["less_than"] = DocumentAttribute.deserialize(de) - - case 9: - kwargs["less_than_or_equals"] = DocumentAttribute.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ATTRIBUTE_FILTER, consumer=_consumer) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls() - - -def _serialize_attribute_filters( - serializer: ShapeSerializer, schema: Schema, value: list[AttributeFilter] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_attribute_filters( - deserializer: ShapeDeserializer, schema: Schema -) -> list[AttributeFilter]: - result: list[AttributeFilter] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(AttributeFilter.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ActionFilterConfiguration: - """Specifies filters to apply to an allowed action.""" - - document_attribute_filter: "AttributeFilter" - """ - Enables filtering of responses based on document attributes or metadata - fields. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACTION_FILTER_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_ACTION_FILTER_CONFIGURATION.members["documentAttributeFilter"], - self.document_attribute_filter, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["document_attribute_filter"] = AttributeFilter.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ACTION_FILTER_CONFIGURATION, consumer=_consumer - ) - if "document_attribute_filter" not in kwargs: - kwargs["document_attribute_filter"] = AttributeFilter._smithy_default() - return kwargs - - -@dataclass(kw_only=True) -class ChatSyncInput: - """Dataclass for ChatSyncInput structure.""" - - application_id: str | None = None - """ - The identifier of the Amazon Q Business application linked to the Amazon - Q Business conversation. - """ - - user_id: str | None = None - """The identifier of the user attached to the chat input.""" - - user_groups: list[str] | None = None - """The group names that a user associated with the chat input belongs to.""" - - user_message: str | None = None - """A end user message in a conversation.""" - - attachments: list[AttachmentInput] | None = None - """ - A list of files uploaded directly during chat. You can upload a maximum - of 5 files of upto 10 MB each. - """ - - action_execution: ActionExecution | None = None - """ - A request from an end user to perform an Amazon Q Business plugin - action. - """ - - auth_challenge_response: AuthChallengeResponse | None = None - """ - An authentication verification event response by a third party - authentication server to Amazon Q Business. - """ - - conversation_id: str | None = None - """The identifier of the Amazon Q Business conversation.""" - - parent_message_id: str | None = None - """The identifier of the previous system message in a conversation.""" - - attribute_filter: "AttributeFilter | None" = None - """ - Enables filtering of Amazon Q Business web experience responses based on - document attributes or metadata fields. - """ - - chat_mode: str | None = None - """ - The `chatMode` parameter determines the chat modes available to Amazon Q - Business users: - - - `RETRIEVAL_MODE` - If you choose this mode, Amazon Q generates - responses solely from the data sources connected and indexed by the - application. If an answer is not found in the data sources or there - are no data sources available, Amazon Q will respond with a \"*No - Answer Found*\" message, unless LLM knowledge has been enabled. In - that case, Amazon Q will generate a response from the LLM knowledge - - - `CREATOR_MODE` - By selecting this mode, you can choose to generate - responses only from the LLM knowledge. You can also attach files and - have Amazon Q generate a response based on the data in those files. If - the attached files do not contain an answer for the query, Amazon Q - will automatically fall back to generating a response from the LLM - knowledge. - - - `PLUGIN_MODE` - By selecting this mode, users can choose to use - plugins in chat to get their responses. - - Note: - If none of the modes are selected, Amazon Q will only respond using the - information from the attached files. - - For more information, see [Admin controls and - guardrails](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/guardrails.html), - [Plugins](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/plugins.html), - and [Response - sources](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/using-web-experience.html#chat-source-scope). - """ - - chat_mode_configuration: ChatModeConfiguration | None = None - """The chat mode configuration for an Amazon Q Business application.""" - - client_token: str | None = None - """A token that you provide to identify a chat request.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CHAT_SYNC_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_CHAT_SYNC_INPUT.members["applicationId"], self.application_id - ) - - if self.user_id is not None: - serializer.write_string( - _SCHEMA_CHAT_SYNC_INPUT.members["userId"], self.user_id - ) - - if self.user_groups is not None: - _serialize_user_groups( - serializer, - _SCHEMA_CHAT_SYNC_INPUT.members["userGroups"], - self.user_groups, - ) - - if self.user_message is not None: - serializer.write_string( - _SCHEMA_CHAT_SYNC_INPUT.members["userMessage"], self.user_message - ) - - if self.attachments is not None: - _serialize_attachments_input( - serializer, - _SCHEMA_CHAT_SYNC_INPUT.members["attachments"], - self.attachments, - ) - - if self.action_execution is not None: - serializer.write_struct( - _SCHEMA_CHAT_SYNC_INPUT.members["actionExecution"], - self.action_execution, - ) - - if self.auth_challenge_response is not None: - serializer.write_struct( - _SCHEMA_CHAT_SYNC_INPUT.members["authChallengeResponse"], - self.auth_challenge_response, - ) - - if self.conversation_id is not None: - serializer.write_string( - _SCHEMA_CHAT_SYNC_INPUT.members["conversationId"], self.conversation_id - ) - - if self.parent_message_id is not None: - serializer.write_string( - _SCHEMA_CHAT_SYNC_INPUT.members["parentMessageId"], - self.parent_message_id, - ) - - if self.attribute_filter is not None: - serializer.write_struct( - _SCHEMA_CHAT_SYNC_INPUT.members["attributeFilter"], - self.attribute_filter, - ) - - if self.chat_mode is not None: - serializer.write_string( - _SCHEMA_CHAT_SYNC_INPUT.members["chatMode"], self.chat_mode - ) - - if self.chat_mode_configuration is not None: - serializer.write_struct( - _SCHEMA_CHAT_SYNC_INPUT.members["chatModeConfiguration"], - self.chat_mode_configuration, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CHAT_SYNC_INPUT.members["clientToken"], self.client_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_CHAT_SYNC_INPUT.members["applicationId"] - ) - - case 1: - kwargs["user_id"] = de.read_string( - _SCHEMA_CHAT_SYNC_INPUT.members["userId"] - ) - - case 2: - kwargs["user_groups"] = _deserialize_user_groups( - de, _SCHEMA_CHAT_SYNC_INPUT.members["userGroups"] - ) - - case 3: - kwargs["user_message"] = de.read_string( - _SCHEMA_CHAT_SYNC_INPUT.members["userMessage"] - ) - - case 4: - kwargs["attachments"] = _deserialize_attachments_input( - de, _SCHEMA_CHAT_SYNC_INPUT.members["attachments"] - ) - - case 5: - kwargs["action_execution"] = ActionExecution.deserialize(de) - - case 6: - kwargs["auth_challenge_response"] = ( - AuthChallengeResponse.deserialize(de) - ) - - case 7: - kwargs["conversation_id"] = de.read_string( - _SCHEMA_CHAT_SYNC_INPUT.members["conversationId"] - ) - - case 8: - kwargs["parent_message_id"] = de.read_string( - _SCHEMA_CHAT_SYNC_INPUT.members["parentMessageId"] - ) - - case 9: - kwargs["attribute_filter"] = AttributeFilter.deserialize(de) - - case 10: - kwargs["chat_mode"] = ChatMode( - de.read_string(_SCHEMA_CHAT_SYNC_INPUT.members["chatMode"]) - ) - - case 11: - kwargs["chat_mode_configuration"] = ( - _ChatModeConfigurationDeserializer().deserialize(de) - ) - - case 12: - kwargs["client_token"] = de.read_string( - _SCHEMA_CHAT_SYNC_INPUT.members["clientToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CHAT_SYNC_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ConfigurationEvent: - """ - A configuration event activated by an end user request to select a - specific chat mode. - """ - - chat_mode: str | None = None - """ - The chat modes available to an Amazon Q Business end user. - - - `RETRIEVAL_MODE` - The default chat mode for an Amazon Q Business - application. When this mode is enabled, Amazon Q Business generates - responses only from data sources connected to an Amazon Q Business - application. - - - `CREATOR_MODE` - By selecting this mode, users can choose to generate - responses only from the LLM knowledge, without consulting connected - data sources, for a chat request. - - - `PLUGIN_MODE` - By selecting this mode, users can choose to use - plugins in chat. - - For more information, see [Admin controls and - guardrails](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/guardrails.html), - [Plugins](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/plugins.html), - and [Conversation - settings](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/using-web-experience.html#chat-source-scope). - """ - - chat_mode_configuration: ChatModeConfiguration | None = None - """ - Configuration information for Amazon Q Business conversation modes. - - For more information, see [Admin controls and - guardrails](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/guardrails.html) - and [Conversation - settings](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/using-web-experience.html#chat-source-scope). - """ - - attribute_filter: "AttributeFilter | None" = None - """ - Enables filtering of responses based on document attributes or metadata - fields. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONFIGURATION_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.chat_mode is not None: - serializer.write_string( - _SCHEMA_CONFIGURATION_EVENT.members["chatMode"], self.chat_mode - ) - - if self.chat_mode_configuration is not None: - serializer.write_struct( - _SCHEMA_CONFIGURATION_EVENT.members["chatModeConfiguration"], - self.chat_mode_configuration, - ) - - if self.attribute_filter is not None: - serializer.write_struct( - _SCHEMA_CONFIGURATION_EVENT.members["attributeFilter"], - self.attribute_filter, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["chat_mode"] = ChatMode( - de.read_string(_SCHEMA_CONFIGURATION_EVENT.members["chatMode"]) - ) - - case 1: - kwargs["chat_mode_configuration"] = ( - _ChatModeConfigurationDeserializer().deserialize(de) - ) - - case 2: - kwargs["attribute_filter"] = AttributeFilter.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONFIGURATION_EVENT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class SearchRelevantContentInput: - """Dataclass for SearchRelevantContentInput structure.""" - - application_id: str | None = None - """The unique identifier of the Amazon Q Business application to search.""" - - query_text: str | None = None - """The text to search for.""" - - content_source: ContentSource | None = None - """The source of content to search in.""" - - attribute_filter: "AttributeFilter | None" = None - """ - Enables filtering of responses based on document attributes or metadata - fields. - """ - - max_results: int = 10 - """The maximum number of results to return.""" - - next_token: str | None = None - """ - The token for the next set of results. (You received this token from a - previous call.) - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SEARCH_RELEVANT_CONTENT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_SEARCH_RELEVANT_CONTENT_INPUT.members["applicationId"], - self.application_id, - ) - - if self.query_text is not None: - serializer.write_string( - _SCHEMA_SEARCH_RELEVANT_CONTENT_INPUT.members["queryText"], - self.query_text, - ) - - if self.content_source is not None: - serializer.write_struct( - _SCHEMA_SEARCH_RELEVANT_CONTENT_INPUT.members["contentSource"], - self.content_source, - ) - - if self.attribute_filter is not None: - serializer.write_struct( - _SCHEMA_SEARCH_RELEVANT_CONTENT_INPUT.members["attributeFilter"], - self.attribute_filter, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_SEARCH_RELEVANT_CONTENT_INPUT.members["maxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_SEARCH_RELEVANT_CONTENT_INPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_SEARCH_RELEVANT_CONTENT_INPUT.members["applicationId"] - ) - - case 1: - kwargs["query_text"] = de.read_string( - _SCHEMA_SEARCH_RELEVANT_CONTENT_INPUT.members["queryText"] - ) - - case 2: - kwargs["content_source"] = _ContentSourceDeserializer().deserialize( - de - ) - - case 3: - kwargs["attribute_filter"] = AttributeFilter.deserialize(de) - - case 4: - kwargs["max_results"] = de.read_integer( - _SCHEMA_SEARCH_RELEVANT_CONTENT_INPUT.members["maxResults"] - ) - - case 5: - kwargs["next_token"] = de.read_string( - _SCHEMA_SEARCH_RELEVANT_CONTENT_INPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SEARCH_RELEVANT_CONTENT_INPUT, consumer=_consumer - ) - return kwargs - - -CHAT_SYNC = APIOperation( - input=ChatSyncInput, - output=ChatSyncOutput, - schema=_SCHEMA_CHAT_SYNC, - input_schema=_SCHEMA_CHAT_SYNC_INPUT, - output_schema=_SCHEMA_CHAT_SYNC_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.qbusiness#ExternalResourceException" - ): ExternalResourceException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#LicenseNotFoundException" - ): LicenseNotFoundException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_EXTERNAL_RESOURCE_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_LICENSE_NOT_FOUND_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - -SEARCH_RELEVANT_CONTENT = APIOperation( - input=SearchRelevantContentInput, - output=SearchRelevantContentOutput, - schema=_SCHEMA_SEARCH_RELEVANT_CONTENT, - input_schema=_SCHEMA_SEARCH_RELEVANT_CONTENT_INPUT, - output_schema=_SCHEMA_SEARCH_RELEVANT_CONTENT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#LicenseNotFoundException" - ): LicenseNotFoundException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_LICENSE_NOT_FOUND_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ActionConfiguration: - """Specifies an allowed action and its associated filter configuration.""" - - action: str - """The Amazon Q Business action that is allowed.""" - - filter_configuration: "ActionFilterConfiguration | None" = None - """The filter configuration for the action, if any.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACTION_CONFIGURATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_ACTION_CONFIGURATION.members["action"], self.action - ) - if self.filter_configuration is not None: - serializer.write_struct( - _SCHEMA_ACTION_CONFIGURATION.members["filterConfiguration"], - self.filter_configuration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["action"] = de.read_string( - _SCHEMA_ACTION_CONFIGURATION.members["action"] - ) - - case 1: - kwargs["filter_configuration"] = ( - ActionFilterConfiguration.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ACTION_CONFIGURATION, consumer=_consumer) - if "action" not in kwargs: - kwargs["action"] = "" - return kwargs - - -@dataclass -class ChatInputStreamConfigurationEvent: - """ - A configuration event activated by an end user request to select a - specific chat mode. - """ - - value: "ConfigurationEvent" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CHAT_INPUT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CHAT_INPUT_STREAM.members["configurationEvent"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ConfigurationEvent.deserialize(deserializer)) - - -@dataclass -class ChatInputStreamTextEvent: - """ - Information about the payload of the `ChatInputStream` event containing - the end user message input. - """ - - value: TextInputEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CHAT_INPUT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CHAT_INPUT_STREAM.members["textEvent"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=TextInputEvent.deserialize(deserializer)) - - -@dataclass -class ChatInputStreamAttachmentEvent: - """A request by an end user to upload a file during chat.""" - - value: AttachmentInputEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CHAT_INPUT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CHAT_INPUT_STREAM.members["attachmentEvent"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=AttachmentInputEvent.deserialize(deserializer)) - - -@dataclass -class ChatInputStreamActionExecutionEvent: - """ - A request from an end user to perform an Amazon Q Business plugin - action. - """ - - value: ActionExecutionEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CHAT_INPUT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CHAT_INPUT_STREAM.members["actionExecutionEvent"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ActionExecutionEvent.deserialize(deserializer)) - - -@dataclass -class ChatInputStreamEndOfInputEvent: - """The end of the streaming input for the `Chat` API.""" - - value: EndOfInputEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CHAT_INPUT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CHAT_INPUT_STREAM.members["endOfInputEvent"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=EndOfInputEvent.deserialize(deserializer)) - - -@dataclass -class ChatInputStreamAuthChallengeResponseEvent: - """ - An authentication verification event response by a third party - authentication server to Amazon Q Business. - """ - - value: AuthChallengeResponseEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CHAT_INPUT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CHAT_INPUT_STREAM.members["authChallengeResponseEvent"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=AuthChallengeResponseEvent.deserialize(deserializer)) +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .models import ( + AssociatePermissionInput, + AssociatePermissionOutput, + BatchDeleteDocumentInput, + BatchDeleteDocumentOutput, + BatchPutDocumentInput, + BatchPutDocumentOutput, + CancelSubscriptionInput, + CancelSubscriptionOutput, + ChatInput, + ChatOutput, + ChatSyncInput, + ChatSyncOutput, + CheckDocumentAccessInput, + CheckDocumentAccessOutput, + CreateAnonymousWebExperienceUrlInput, + CreateAnonymousWebExperienceUrlOutput, + CreateApplicationInput, + CreateApplicationOutput, + CreateChatResponseConfigurationInput, + CreateChatResponseConfigurationOutput, + CreateDataAccessorInput, + CreateDataAccessorOutput, + CreateDataSourceInput, + CreateDataSourceOutput, + CreateIndexInput, + CreateIndexOutput, + CreatePluginInput, + CreatePluginOutput, + CreateRetrieverInput, + CreateRetrieverOutput, + CreateSubscriptionInput, + CreateSubscriptionOutput, + CreateUserInput, + CreateUserOutput, + CreateWebExperienceInput, + CreateWebExperienceOutput, + DeleteApplicationInput, + DeleteApplicationOutput, + DeleteAttachmentInput, + DeleteAttachmentOutput, + DeleteChatControlsConfigurationInput, + DeleteChatControlsConfigurationOutput, + DeleteChatResponseConfigurationInput, + DeleteChatResponseConfigurationOutput, + DeleteConversationInput, + DeleteConversationOutput, + DeleteDataAccessorInput, + DeleteDataAccessorOutput, + DeleteDataSourceInput, + DeleteDataSourceOutput, + DeleteGroupInput, + DeleteGroupOutput, + DeleteIndexInput, + DeleteIndexOutput, + DeletePluginInput, + DeletePluginOutput, + DeleteRetrieverInput, + DeleteRetrieverOutput, + DeleteUserInput, + DeleteUserOutput, + DeleteWebExperienceInput, + DeleteWebExperienceOutput, + DisassociatePermissionInput, + DisassociatePermissionOutput, + GetApplicationInput, + GetApplicationOutput, + GetChatControlsConfigurationInput, + GetChatControlsConfigurationOutput, + GetChatResponseConfigurationInput, + GetChatResponseConfigurationOutput, + GetDataAccessorInput, + GetDataAccessorOutput, + GetDataSourceInput, + GetDataSourceOutput, + GetDocumentContentInput, + GetDocumentContentOutput, + GetGroupInput, + GetGroupOutput, + GetIndexInput, + GetIndexOutput, + GetMediaInput, + GetMediaOutput, + GetPluginInput, + GetPluginOutput, + GetPolicyInput, + GetPolicyOutput, + GetRetrieverInput, + GetRetrieverOutput, + GetUserInput, + GetUserOutput, + GetWebExperienceInput, + GetWebExperienceOutput, + ListApplicationsInput, + ListApplicationsOutput, + ListAttachmentsInput, + ListAttachmentsOutput, + ListChatResponseConfigurationsInput, + ListChatResponseConfigurationsOutput, + ListConversationsInput, + ListConversationsOutput, + ListDataAccessorsInput, + ListDataAccessorsOutput, + ListDataSourceSyncJobsInput, + ListDataSourceSyncJobsOutput, + ListDataSourcesInput, + ListDataSourcesOutput, + ListDocumentsInput, + ListDocumentsOutput, + ListGroupsInput, + ListGroupsOutput, + ListIndicesInput, + ListIndicesOutput, + ListMessagesInput, + ListMessagesOutput, + ListPluginActionsInput, + ListPluginActionsOutput, + ListPluginTypeActionsInput, + ListPluginTypeActionsOutput, + ListPluginTypeMetadataInput, + ListPluginTypeMetadataOutput, + ListPluginsInput, + ListPluginsOutput, + ListRetrieversInput, + ListRetrieversOutput, + ListSubscriptionsInput, + ListSubscriptionsOutput, + ListTagsForResourceInput, + ListTagsForResourceOutput, + ListWebExperiencesInput, + ListWebExperiencesOutput, + PutFeedbackInput, + PutFeedbackOutput, + PutGroupInput, + PutGroupOutput, + SearchRelevantContentInput, + SearchRelevantContentOutput, + StartDataSourceSyncJobInput, + StartDataSourceSyncJobOutput, + StopDataSourceSyncJobInput, + StopDataSourceSyncJobOutput, + TagResourceInput, + TagResourceOutput, + UntagResourceInput, + UntagResourceOutput, + UpdateApplicationInput, + UpdateApplicationOutput, + UpdateChatControlsConfigurationInput, + UpdateChatControlsConfigurationOutput, + UpdateChatResponseConfigurationInput, + UpdateChatResponseConfigurationOutput, + UpdateDataAccessorInput, + UpdateDataAccessorOutput, + UpdateDataSourceInput, + UpdateDataSourceOutput, + UpdateIndexInput, + UpdateIndexOutput, + UpdatePluginInput, + UpdatePluginOutput, + UpdateRetrieverInput, + UpdateRetrieverOutput, + UpdateSubscriptionInput, + UpdateSubscriptionOutput, + UpdateUserInput, + UpdateUserOutput, + UpdateWebExperienceInput, + UpdateWebExperienceOutput, + ) -@dataclass -class ChatInputStreamUnknown: +class ServiceError(ModeledError): """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. + Base error for all errors in the service. - This value may not be deliberately sent. + Some exceptions do not extend from this class, including + synthetic, implicit, and shared exception types. """ - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ChatInputStream = Union[ - ChatInputStreamConfigurationEvent - | ChatInputStreamTextEvent - | ChatInputStreamAttachmentEvent - | ChatInputStreamActionExecutionEvent - | ChatInputStreamEndOfInputEvent - | ChatInputStreamAuthChallengeResponseEvent - | ChatInputStreamUnknown -] -"""The streaming input for the `Chat` API.""" - - -class _ChatInputStreamDeserializer: - _result: ChatInputStream | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> ChatInputStream: - self._result = None - deserializer.read_struct(_SCHEMA_CHAT_INPUT_STREAM, self._consumer) - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(ChatInputStreamConfigurationEvent.deserialize(de)) - - case 1: - self._set_result(ChatInputStreamTextEvent.deserialize(de)) - - case 2: - self._set_result(ChatInputStreamAttachmentEvent.deserialize(de)) - - case 3: - self._set_result(ChatInputStreamActionExecutionEvent.deserialize(de)) - - case 4: - self._set_result(ChatInputStreamEndOfInputEvent.deserialize(de)) - - case 5: - self._set_result( - ChatInputStreamAuthChallengeResponseEvent.deserialize(de) - ) - - case _: - self._set_result( - ChatInputStreamUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: ChatInputStream) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -def _serialize_action_configuration_list( - serializer: ShapeSerializer, schema: Schema, value: list[ActionConfiguration] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_action_configuration_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ActionConfiguration]: - result: list[ActionConfiguration] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ActionConfiguration.deserialize(d)) +_registry = ModelRegistry( + _schemas, + renames={}, + index={ + "AccessConfiguration": "ACCESS_CONFIGURATION", + "AccessControl": "ACCESS_CONTROL", + "AccessDeniedException": "ACCESS_DENIED_EXCEPTION", + "ActionConfiguration": "ACTION_CONFIGURATION", + "ActionExecution": "ACTION_EXECUTION", + "ActionExecutionEvent": "ACTION_EXECUTION_EVENT", + "ActionExecutionPayloadField": "ACTION_EXECUTION_PAYLOAD_FIELD", + "ActionFilterConfiguration": "ACTION_FILTER_CONFIGURATION", + "ActionPayloadFieldType": "ACTION_PAYLOAD_FIELD_TYPE", + "ActionReview": "ACTION_REVIEW", + "ActionReviewEvent": "ACTION_REVIEW_EVENT", + "ActionReviewPayloadField": "ACTION_REVIEW_PAYLOAD_FIELD", + "ActionReviewPayloadFieldAllowedValue": "ACTION_REVIEW_PAYLOAD_FIELD_ALLOWED_VALUE", + "ActionSummary": "ACTION_SUMMARY", + "APISchema": "API_SCHEMA", + "APISchemaPayload": "API_SCHEMA", + "APISchemaS3": "API_SCHEMA", + "APISchemaUnknown": "API_SCHEMA", + "APISchemaType": "API_SCHEMA_TYPE", + "Application": "APPLICATION", + "ApplicationStatus": "APPLICATION_STATUS", + "AppliedAttachmentsConfiguration": "APPLIED_ATTACHMENTS_CONFIGURATION", + "AppliedCreatorModeConfiguration": "APPLIED_CREATOR_MODE_CONFIGURATION", + "AppliedOrchestrationConfiguration": "APPLIED_ORCHESTRATION_CONFIGURATION", + "AssociatedGroup": "ASSOCIATED_GROUP", + "AssociatedUser": "ASSOCIATED_USER", + "AssociatePermissionInput": "ASSOCIATE_PERMISSION_INPUT", + "AssociatePermissionOutput": "ASSOCIATE_PERMISSION_OUTPUT", + "Attachment": "ATTACHMENT", + "AttachmentInput": "ATTACHMENT_INPUT", + "AttachmentInputEvent": "ATTACHMENT_INPUT_EVENT", + "AttachmentOutput": "ATTACHMENT_OUTPUT", + "AttachmentsConfiguration": "ATTACHMENTS_CONFIGURATION", + "AttachmentsControlMode": "ATTACHMENTS_CONTROL_MODE", + "AttachmentStatus": "ATTACHMENT_STATUS", + "AttributeFilter": "ATTRIBUTE_FILTER", + "AttributeType": "ATTRIBUTE_TYPE", + "AttributeValueOperator": "ATTRIBUTE_VALUE_OPERATOR", + "AudioExtractionConfiguration": "AUDIO_EXTRACTION_CONFIGURATION", + "AudioExtractionStatus": "AUDIO_EXTRACTION_STATUS", + "AudioExtractionType": "AUDIO_EXTRACTION_TYPE", + "AudioSourceDetails": "AUDIO_SOURCE_DETAILS", + "AuthChallengeRequest": "AUTH_CHALLENGE_REQUEST", + "AuthChallengeRequestEvent": "AUTH_CHALLENGE_REQUEST_EVENT", + "AuthChallengeResponse": "AUTH_CHALLENGE_RESPONSE", + "AuthChallengeResponseEvent": "AUTH_CHALLENGE_RESPONSE_EVENT", + "AutoSubscriptionConfiguration": "AUTO_SUBSCRIPTION_CONFIGURATION", + "AutoSubscriptionStatus": "AUTO_SUBSCRIPTION_STATUS", + "BasicAuthConfiguration": "BASIC_AUTH_CONFIGURATION", + "BatchDeleteDocumentInput": "BATCH_DELETE_DOCUMENT_INPUT", + "BatchDeleteDocumentOutput": "BATCH_DELETE_DOCUMENT_OUTPUT", + "BatchPutDocumentInput": "BATCH_PUT_DOCUMENT_INPUT", + "BatchPutDocumentOutput": "BATCH_PUT_DOCUMENT_OUTPUT", + "BlockedPhrasesConfiguration": "BLOCKED_PHRASES_CONFIGURATION", + "BlockedPhrasesConfigurationUpdate": "BLOCKED_PHRASES_CONFIGURATION_UPDATE", + "BrowserExtensionConfiguration": "BROWSER_EXTENSION_CONFIGURATION", + "CancelSubscriptionInput": "CANCEL_SUBSCRIPTION_INPUT", + "CancelSubscriptionOutput": "CANCEL_SUBSCRIPTION_OUTPUT", + "ChatInput": "CHAT_INPUT", + "ChatInputStream": "CHAT_INPUT_STREAM", + "ChatInputStreamConfigurationEvent": "CHAT_INPUT_STREAM", + "ChatInputStreamTextEvent": "CHAT_INPUT_STREAM", + "ChatInputStreamAttachmentEvent": "CHAT_INPUT_STREAM", + "ChatInputStreamActionExecutionEvent": "CHAT_INPUT_STREAM", + "ChatInputStreamEndOfInputEvent": "CHAT_INPUT_STREAM", + "ChatInputStreamAuthChallengeResponseEvent": "CHAT_INPUT_STREAM", + "ChatInputStreamUnknown": "CHAT_INPUT_STREAM", + "ChatMode": "CHAT_MODE", + "ChatModeConfiguration": "CHAT_MODE_CONFIGURATION", + "ChatModeConfigurationPluginConfiguration": "CHAT_MODE_CONFIGURATION", + "ChatModeConfigurationUnknown": "CHAT_MODE_CONFIGURATION", + "ChatOutput": "CHAT_OUTPUT", + "ChatOutputStream": "CHAT_OUTPUT_STREAM", + "ChatOutputStreamTextEvent": "CHAT_OUTPUT_STREAM", + "ChatOutputStreamMetadataEvent": "CHAT_OUTPUT_STREAM", + "ChatOutputStreamActionReviewEvent": "CHAT_OUTPUT_STREAM", + "ChatOutputStreamFailedAttachmentEvent": "CHAT_OUTPUT_STREAM", + "ChatOutputStreamAuthChallengeRequestEvent": "CHAT_OUTPUT_STREAM", + "ChatOutputStreamUnknown": "CHAT_OUTPUT_STREAM", + "ChatResponseConfiguration": "CHAT_RESPONSE_CONFIGURATION", + "ChatResponseConfigurationDetail": "CHAT_RESPONSE_CONFIGURATION_DETAIL", + "ChatResponseConfigurationStatus": "CHAT_RESPONSE_CONFIGURATION_STATUS", + "ChatSyncInput": "CHAT_SYNC_INPUT", + "ChatSyncOutput": "CHAT_SYNC_OUTPUT", + "CheckDocumentAccessInput": "CHECK_DOCUMENT_ACCESS_INPUT", + "CheckDocumentAccessOutput": "CHECK_DOCUMENT_ACCESS_OUTPUT", + "ConfigurationEvent": "CONFIGURATION_EVENT", + "ConflictException": "CONFLICT_EXCEPTION", + "ContentBlockerRule": "CONTENT_BLOCKER_RULE", + "ContentRetrievalRule": "CONTENT_RETRIEVAL_RULE", + "ContentSource": "CONTENT_SOURCE", + "ContentSourceRetriever": "CONTENT_SOURCE", + "ContentSourceUnknown": "CONTENT_SOURCE", + "ContentType": "CONTENT_TYPE", + "Conversation": "CONVERSATION", + "ConversationSource": "CONVERSATION_SOURCE", + "CopyFromSource": "COPY_FROM_SOURCE", + "CopyFromSourceConversation": "COPY_FROM_SOURCE", + "CopyFromSourceUnknown": "COPY_FROM_SOURCE", + "CreateAnonymousWebExperienceUrlInput": "CREATE_ANONYMOUS_WEB_EXPERIENCE_URL_INPUT", + "CreateAnonymousWebExperienceUrlOutput": "CREATE_ANONYMOUS_WEB_EXPERIENCE_URL_OUTPUT", + "CreateApplicationInput": "CREATE_APPLICATION_INPUT", + "CreateApplicationOutput": "CREATE_APPLICATION_OUTPUT", + "CreateChatResponseConfigurationInput": "CREATE_CHAT_RESPONSE_CONFIGURATION_INPUT", + "CreateChatResponseConfigurationOutput": "CREATE_CHAT_RESPONSE_CONFIGURATION_OUTPUT", + "CreateDataAccessorInput": "CREATE_DATA_ACCESSOR_INPUT", + "CreateDataAccessorOutput": "CREATE_DATA_ACCESSOR_OUTPUT", + "CreateDataSourceInput": "CREATE_DATA_SOURCE_INPUT", + "CreateDataSourceOutput": "CREATE_DATA_SOURCE_OUTPUT", + "CreateIndexInput": "CREATE_INDEX_INPUT", + "CreateIndexOutput": "CREATE_INDEX_OUTPUT", + "CreatePluginInput": "CREATE_PLUGIN_INPUT", + "CreatePluginOutput": "CREATE_PLUGIN_OUTPUT", + "CreateRetrieverInput": "CREATE_RETRIEVER_INPUT", + "CreateRetrieverOutput": "CREATE_RETRIEVER_OUTPUT", + "CreateSubscriptionInput": "CREATE_SUBSCRIPTION_INPUT", + "CreateSubscriptionOutput": "CREATE_SUBSCRIPTION_OUTPUT", + "CreateUserInput": "CREATE_USER_INPUT", + "CreateUserOutput": "CREATE_USER_OUTPUT", + "CreateWebExperienceInput": "CREATE_WEB_EXPERIENCE_INPUT", + "CreateWebExperienceOutput": "CREATE_WEB_EXPERIENCE_OUTPUT", + "CreatorModeConfiguration": "CREATOR_MODE_CONFIGURATION", + "CreatorModeControl": "CREATOR_MODE_CONTROL", + "CustomizationConfiguration": "CUSTOMIZATION_CONFIGURATION", + "CustomPluginConfiguration": "CUSTOM_PLUGIN_CONFIGURATION", + "DataAccessor": "DATA_ACCESSOR", + "DataAccessorAuthenticationConfiguration": "DATA_ACCESSOR_AUTHENTICATION_CONFIGURATION", + "DataAccessorAuthenticationConfigurationIdcTrustedTokenIssuerConfiguration": "DATA_ACCESSOR_AUTHENTICATION_CONFIGURATION", + "DataAccessorAuthenticationConfigurationUnknown": "DATA_ACCESSOR_AUTHENTICATION_CONFIGURATION", + "DataAccessorAuthenticationDetail": "DATA_ACCESSOR_AUTHENTICATION_DETAIL", + "DataAccessorAuthenticationType": "DATA_ACCESSOR_AUTHENTICATION_TYPE", + "DataAccessorIdcTrustedTokenIssuerConfiguration": "DATA_ACCESSOR_IDC_TRUSTED_TOKEN_ISSUER_CONFIGURATION", + "DataSource": "DATA_SOURCE", + "DataSourceStatus": "DATA_SOURCE_STATUS", + "DataSourceSyncJob": "DATA_SOURCE_SYNC_JOB", + "DataSourceSyncJobMetrics": "DATA_SOURCE_SYNC_JOB_METRICS", + "DataSourceSyncJobStatus": "DATA_SOURCE_SYNC_JOB_STATUS", + "DataSourceVpcConfiguration": "DATA_SOURCE_VPC_CONFIGURATION", + "DateAttributeBoostingConfiguration": "DATE_ATTRIBUTE_BOOSTING_CONFIGURATION", + "DeleteApplicationInput": "DELETE_APPLICATION_INPUT", + "DeleteApplicationOutput": "DELETE_APPLICATION_OUTPUT", + "DeleteAttachmentInput": "DELETE_ATTACHMENT_INPUT", + "DeleteAttachmentOutput": "DELETE_ATTACHMENT_OUTPUT", + "DeleteChatControlsConfigurationInput": "DELETE_CHAT_CONTROLS_CONFIGURATION_INPUT", + "DeleteChatControlsConfigurationOutput": "DELETE_CHAT_CONTROLS_CONFIGURATION_OUTPUT", + "DeleteChatResponseConfigurationInput": "DELETE_CHAT_RESPONSE_CONFIGURATION_INPUT", + "DeleteChatResponseConfigurationOutput": "DELETE_CHAT_RESPONSE_CONFIGURATION_OUTPUT", + "DeleteConversationInput": "DELETE_CONVERSATION_INPUT", + "DeleteConversationOutput": "DELETE_CONVERSATION_OUTPUT", + "DeleteDataAccessorInput": "DELETE_DATA_ACCESSOR_INPUT", + "DeleteDataAccessorOutput": "DELETE_DATA_ACCESSOR_OUTPUT", + "DeleteDataSourceInput": "DELETE_DATA_SOURCE_INPUT", + "DeleteDataSourceOutput": "DELETE_DATA_SOURCE_OUTPUT", + "DeleteDocument": "DELETE_DOCUMENT", + "DeleteGroupInput": "DELETE_GROUP_INPUT", + "DeleteGroupOutput": "DELETE_GROUP_OUTPUT", + "DeleteIndexInput": "DELETE_INDEX_INPUT", + "DeleteIndexOutput": "DELETE_INDEX_OUTPUT", + "DeletePluginInput": "DELETE_PLUGIN_INPUT", + "DeletePluginOutput": "DELETE_PLUGIN_OUTPUT", + "DeleteRetrieverInput": "DELETE_RETRIEVER_INPUT", + "DeleteRetrieverOutput": "DELETE_RETRIEVER_OUTPUT", + "DeleteUserInput": "DELETE_USER_INPUT", + "DeleteUserOutput": "DELETE_USER_OUTPUT", + "DeleteWebExperienceInput": "DELETE_WEB_EXPERIENCE_INPUT", + "DeleteWebExperienceOutput": "DELETE_WEB_EXPERIENCE_OUTPUT", + "DisassociatePermissionInput": "DISASSOCIATE_PERMISSION_INPUT", + "DisassociatePermissionOutput": "DISASSOCIATE_PERMISSION_OUTPUT", + "Document": "DOCUMENT", + "DocumentAcl": "DOCUMENT_ACL", + "DocumentAclCondition": "DOCUMENT_ACL_CONDITION", + "DocumentAclGroup": "DOCUMENT_ACL_GROUP", + "DocumentAclMembership": "DOCUMENT_ACL_MEMBERSHIP", + "DocumentAclUser": "DOCUMENT_ACL_USER", + "DocumentAttribute": "DOCUMENT_ATTRIBUTE", + "DocumentAttributeBoostingConfiguration": "DOCUMENT_ATTRIBUTE_BOOSTING_CONFIGURATION", + "DocumentAttributeBoostingConfigurationNumberConfiguration": "DOCUMENT_ATTRIBUTE_BOOSTING_CONFIGURATION", + "DocumentAttributeBoostingConfigurationStringConfiguration": "DOCUMENT_ATTRIBUTE_BOOSTING_CONFIGURATION", + "DocumentAttributeBoostingConfigurationDateConfiguration": "DOCUMENT_ATTRIBUTE_BOOSTING_CONFIGURATION", + "DocumentAttributeBoostingConfigurationStringListConfiguration": "DOCUMENT_ATTRIBUTE_BOOSTING_CONFIGURATION", + "DocumentAttributeBoostingConfigurationUnknown": "DOCUMENT_ATTRIBUTE_BOOSTING_CONFIGURATION", + "DocumentAttributeBoostingLevel": "DOCUMENT_ATTRIBUTE_BOOSTING_LEVEL", + "DocumentAttributeCondition": "DOCUMENT_ATTRIBUTE_CONDITION", + "DocumentAttributeConfiguration": "DOCUMENT_ATTRIBUTE_CONFIGURATION", + "DocumentAttributeTarget": "DOCUMENT_ATTRIBUTE_TARGET", + "DocumentAttributeValue": "DOCUMENT_ATTRIBUTE_VALUE", + "DocumentAttributeValueStringValue": "DOCUMENT_ATTRIBUTE_VALUE", + "DocumentAttributeValueStringListValue": "DOCUMENT_ATTRIBUTE_VALUE", + "DocumentAttributeValueLongValue": "DOCUMENT_ATTRIBUTE_VALUE", + "DocumentAttributeValueDateValue": "DOCUMENT_ATTRIBUTE_VALUE", + "DocumentAttributeValueUnknown": "DOCUMENT_ATTRIBUTE_VALUE", + "DocumentContent": "DOCUMENT_CONTENT", + "DocumentContentBlob": "DOCUMENT_CONTENT", + "DocumentContentS3": "DOCUMENT_CONTENT", + "DocumentContentUnknown": "DOCUMENT_CONTENT", + "DocumentContentOperator": "DOCUMENT_CONTENT_OPERATOR", + "DocumentDetails": "DOCUMENT_DETAILS", + "DocumentEnrichmentConditionOperator": "DOCUMENT_ENRICHMENT_CONDITION_OPERATOR", + "DocumentEnrichmentConfiguration": "DOCUMENT_ENRICHMENT_CONFIGURATION", + "DocumentStatus": "DOCUMENT_STATUS", + "EligibleDataSource": "ELIGIBLE_DATA_SOURCE", + "EncryptionConfiguration": "ENCRYPTION_CONFIGURATION", + "EndOfInputEvent": "END_OF_INPUT_EVENT", + "ErrorCode": "ERROR_CODE", + "ErrorDetail": "ERROR_DETAIL", + "ExternalResourceException": "EXTERNAL_RESOURCE_EXCEPTION", + "FailedAttachmentEvent": "FAILED_ATTACHMENT_EVENT", + "FailedDocument": "FAILED_DOCUMENT", + "GetApplicationInput": "GET_APPLICATION_INPUT", + "GetApplicationOutput": "GET_APPLICATION_OUTPUT", + "GetChatControlsConfigurationInput": "GET_CHAT_CONTROLS_CONFIGURATION_INPUT", + "GetChatControlsConfigurationOutput": "GET_CHAT_CONTROLS_CONFIGURATION_OUTPUT", + "GetChatResponseConfigurationInput": "GET_CHAT_RESPONSE_CONFIGURATION_INPUT", + "GetChatResponseConfigurationOutput": "GET_CHAT_RESPONSE_CONFIGURATION_OUTPUT", + "GetDataAccessorInput": "GET_DATA_ACCESSOR_INPUT", + "GetDataAccessorOutput": "GET_DATA_ACCESSOR_OUTPUT", + "GetDataSourceInput": "GET_DATA_SOURCE_INPUT", + "GetDataSourceOutput": "GET_DATA_SOURCE_OUTPUT", + "GetDocumentContentInput": "GET_DOCUMENT_CONTENT_INPUT", + "GetDocumentContentOutput": "GET_DOCUMENT_CONTENT_OUTPUT", + "GetGroupInput": "GET_GROUP_INPUT", + "GetGroupOutput": "GET_GROUP_OUTPUT", + "GetIndexInput": "GET_INDEX_INPUT", + "GetIndexOutput": "GET_INDEX_OUTPUT", + "GetMediaInput": "GET_MEDIA_INPUT", + "GetMediaOutput": "GET_MEDIA_OUTPUT", + "GetPluginInput": "GET_PLUGIN_INPUT", + "GetPluginOutput": "GET_PLUGIN_OUTPUT", + "GetPolicyInput": "GET_POLICY_INPUT", + "GetPolicyOutput": "GET_POLICY_OUTPUT", + "GetRetrieverInput": "GET_RETRIEVER_INPUT", + "GetRetrieverOutput": "GET_RETRIEVER_OUTPUT", + "GetUserInput": "GET_USER_INPUT", + "GetUserOutput": "GET_USER_OUTPUT", + "GetWebExperienceInput": "GET_WEB_EXPERIENCE_INPUT", + "GetWebExperienceOutput": "GET_WEB_EXPERIENCE_OUTPUT", + "GroupMembers": "GROUP_MEMBERS", + "GroupStatus": "GROUP_STATUS", + "GroupStatusDetail": "GROUP_STATUS_DETAIL", + "GroupSummary": "GROUP_SUMMARY", + "HallucinationReductionConfiguration": "HALLUCINATION_REDUCTION_CONFIGURATION", + "HallucinationReductionControl": "HALLUCINATION_REDUCTION_CONTROL", + "HookConfiguration": "HOOK_CONFIGURATION", + "IdcAuthConfiguration": "IDC_AUTH_CONFIGURATION", + "IdentityProviderConfiguration": "IDENTITY_PROVIDER_CONFIGURATION", + "IdentityProviderConfigurationSamlConfiguration": "IDENTITY_PROVIDER_CONFIGURATION", + "IdentityProviderConfigurationOpenIDConnectConfiguration": "IDENTITY_PROVIDER_CONFIGURATION", + "IdentityProviderConfigurationUnknown": "IDENTITY_PROVIDER_CONFIGURATION", + "IdentityType": "IDENTITY_TYPE", + "ImageExtractionConfiguration": "IMAGE_EXTRACTION_CONFIGURATION", + "ImageExtractionStatus": "IMAGE_EXTRACTION_STATUS", + "ImageSourceDetails": "IMAGE_SOURCE_DETAILS", + "Index": "INDEX", + "IndexCapacityConfiguration": "INDEX_CAPACITY_CONFIGURATION", + "IndexStatistics": "INDEX_STATISTICS", + "IndexStatus": "INDEX_STATUS", + "IndexType": "INDEX_TYPE", + "InlineDocumentEnrichmentConfiguration": "INLINE_DOCUMENT_ENRICHMENT_CONFIGURATION", + "InstructionCollection": "INSTRUCTION_COLLECTION", + "InternalServerException": "INTERNAL_SERVER_EXCEPTION", + "KendraIndexConfiguration": "KENDRA_INDEX_CONFIGURATION", + "LicenseNotFoundException": "LICENSE_NOT_FOUND_EXCEPTION", + "ListApplicationsInput": "LIST_APPLICATIONS_INPUT", + "ListApplicationsOutput": "LIST_APPLICATIONS_OUTPUT", + "ListAttachmentsInput": "LIST_ATTACHMENTS_INPUT", + "ListAttachmentsOutput": "LIST_ATTACHMENTS_OUTPUT", + "ListChatResponseConfigurationsInput": "LIST_CHAT_RESPONSE_CONFIGURATIONS_INPUT", + "ListChatResponseConfigurationsOutput": "LIST_CHAT_RESPONSE_CONFIGURATIONS_OUTPUT", + "ListConversationsInput": "LIST_CONVERSATIONS_INPUT", + "ListConversationsOutput": "LIST_CONVERSATIONS_OUTPUT", + "ListDataAccessorsInput": "LIST_DATA_ACCESSORS_INPUT", + "ListDataAccessorsOutput": "LIST_DATA_ACCESSORS_OUTPUT", + "ListDataSourcesInput": "LIST_DATA_SOURCES_INPUT", + "ListDataSourcesOutput": "LIST_DATA_SOURCES_OUTPUT", + "ListDataSourceSyncJobsInput": "LIST_DATA_SOURCE_SYNC_JOBS_INPUT", + "ListDataSourceSyncJobsOutput": "LIST_DATA_SOURCE_SYNC_JOBS_OUTPUT", + "ListDocumentsInput": "LIST_DOCUMENTS_INPUT", + "ListDocumentsOutput": "LIST_DOCUMENTS_OUTPUT", + "ListGroupsInput": "LIST_GROUPS_INPUT", + "ListGroupsOutput": "LIST_GROUPS_OUTPUT", + "ListIndicesInput": "LIST_INDICES_INPUT", + "ListIndicesOutput": "LIST_INDICES_OUTPUT", + "ListMessagesInput": "LIST_MESSAGES_INPUT", + "ListMessagesOutput": "LIST_MESSAGES_OUTPUT", + "ListPluginActionsInput": "LIST_PLUGIN_ACTIONS_INPUT", + "ListPluginActionsOutput": "LIST_PLUGIN_ACTIONS_OUTPUT", + "ListPluginsInput": "LIST_PLUGINS_INPUT", + "ListPluginsOutput": "LIST_PLUGINS_OUTPUT", + "ListPluginTypeActionsInput": "LIST_PLUGIN_TYPE_ACTIONS_INPUT", + "ListPluginTypeActionsOutput": "LIST_PLUGIN_TYPE_ACTIONS_OUTPUT", + "ListPluginTypeMetadataInput": "LIST_PLUGIN_TYPE_METADATA_INPUT", + "ListPluginTypeMetadataOutput": "LIST_PLUGIN_TYPE_METADATA_OUTPUT", + "ListRetrieversInput": "LIST_RETRIEVERS_INPUT", + "ListRetrieversOutput": "LIST_RETRIEVERS_OUTPUT", + "ListSubscriptionsInput": "LIST_SUBSCRIPTIONS_INPUT", + "ListSubscriptionsOutput": "LIST_SUBSCRIPTIONS_OUTPUT", + "ListTagsForResourceInput": "LIST_TAGS_FOR_RESOURCE_INPUT", + "ListTagsForResourceOutput": "LIST_TAGS_FOR_RESOURCE_OUTPUT", + "ListWebExperiencesInput": "LIST_WEB_EXPERIENCES_INPUT", + "ListWebExperiencesOutput": "LIST_WEB_EXPERIENCES_OUTPUT", + "MediaExtractionConfiguration": "MEDIA_EXTRACTION_CONFIGURATION", + "MediaTooLargeException": "MEDIA_TOO_LARGE_EXCEPTION", + "MemberGroup": "MEMBER_GROUP", + "MemberRelation": "MEMBER_RELATION", + "MembershipType": "MEMBERSHIP_TYPE", + "MemberUser": "MEMBER_USER", + "Message": "MESSAGE", + "MessageType": "MESSAGE_TYPE", + "MessageUsefulness": "MESSAGE_USEFULNESS", + "MessageUsefulnessFeedback": "MESSAGE_USEFULNESS_FEEDBACK", + "MessageUsefulnessReason": "MESSAGE_USEFULNESS_REASON", + "MetadataEvent": "METADATA_EVENT", + "NativeIndexConfiguration": "NATIVE_INDEX_CONFIGURATION", + "NoAuthConfiguration": "NO_AUTH_CONFIGURATION", + "NumberAttributeBoostingConfiguration": "NUMBER_ATTRIBUTE_BOOSTING_CONFIGURATION", + "NumberAttributeBoostingType": "NUMBER_ATTRIBUTE_BOOSTING_TYPE", + "OAuth2ClientCredentialConfiguration": "O_AUTH2_CLIENT_CREDENTIAL_CONFIGURATION", + "OpenIDConnectProviderConfiguration": "OPEN_ID_CONNECT_PROVIDER_CONFIGURATION", + "OrchestrationConfiguration": "ORCHESTRATION_CONFIGURATION", + "OrchestrationControl": "ORCHESTRATION_CONTROL", + "OutputFormat": "OUTPUT_FORMAT", + "PermissionCondition": "PERMISSION_CONDITION", + "PermissionConditionOperator": "PERMISSION_CONDITION_OPERATOR", + "PersonalizationConfiguration": "PERSONALIZATION_CONFIGURATION", + "PersonalizationControlMode": "PERSONALIZATION_CONTROL_MODE", + "Plugin": "PLUGIN", + "PluginAuthConfiguration": "PLUGIN_AUTH_CONFIGURATION", + "PluginAuthConfigurationBasicAuthConfiguration": "PLUGIN_AUTH_CONFIGURATION", + "PluginAuthConfigurationOAuth2ClientCredentialConfiguration": "PLUGIN_AUTH_CONFIGURATION", + "PluginAuthConfigurationNoAuthConfiguration": "PLUGIN_AUTH_CONFIGURATION", + "PluginAuthConfigurationIdcAuthConfiguration": "PLUGIN_AUTH_CONFIGURATION", + "PluginAuthConfigurationUnknown": "PLUGIN_AUTH_CONFIGURATION", + "PluginBuildStatus": "PLUGIN_BUILD_STATUS", + "PluginConfiguration": "PLUGIN_CONFIGURATION", + "PluginState": "PLUGIN_STATE", + "PluginType": "PLUGIN_TYPE", + "PluginTypeCategory": "PLUGIN_TYPE_CATEGORY", + "PluginTypeMetadataSummary": "PLUGIN_TYPE_METADATA_SUMMARY", + "Principal": "PRINCIPAL", + "Principal_User": "PRINCIPAL", + "Principal_Group": "PRINCIPAL", + "PrincipalUnknown": "PRINCIPAL", + "PrincipalGroup": "PRINCIPAL_GROUP", + "PrincipalUser": "PRINCIPAL_USER", + "PutFeedbackInput": "PUT_FEEDBACK_INPUT", + "PutFeedbackOutput": "PUT_FEEDBACK_OUTPUT", + "PutGroupInput": "PUT_GROUP_INPUT", + "PutGroupOutput": "PUT_GROUP_OUTPUT", + "QAppsConfiguration": "Q_APPS_CONFIGURATION", + "QAppsControlMode": "Q_APPS_CONTROL_MODE", + "QuickSightConfiguration": "QUICK_SIGHT_CONFIGURATION", + "ReadAccessType": "READ_ACCESS_TYPE", + "RelevantContent": "RELEVANT_CONTENT", + "ResourceNotFoundException": "RESOURCE_NOT_FOUND_EXCEPTION", + "ResponseConfiguration": "RESPONSE_CONFIGURATION", + "ResponseConfigurationType": "RESPONSE_CONFIGURATION_TYPE", + "ResponseScope": "RESPONSE_SCOPE", + "Retriever": "RETRIEVER", + "RetrieverConfiguration": "RETRIEVER_CONFIGURATION", + "RetrieverConfigurationNativeIndexConfiguration": "RETRIEVER_CONFIGURATION", + "RetrieverConfigurationKendraIndexConfiguration": "RETRIEVER_CONFIGURATION", + "RetrieverConfigurationUnknown": "RETRIEVER_CONFIGURATION", + "RetrieverContentSource": "RETRIEVER_CONTENT_SOURCE", + "RetrieverStatus": "RETRIEVER_STATUS", + "RetrieverType": "RETRIEVER_TYPE", + "Rule": "RULE", + "RuleConfiguration": "RULE_CONFIGURATION", + "RuleConfigurationContentBlockerRule": "RULE_CONFIGURATION", + "RuleConfigurationContentRetrievalRule": "RULE_CONFIGURATION", + "RuleConfigurationUnknown": "RULE_CONFIGURATION", + "RuleType": "RULE_TYPE", + "S3": "S3", + "SamlConfiguration": "SAML_CONFIGURATION", + "SamlProviderConfiguration": "SAML_PROVIDER_CONFIGURATION", + "ScoreAttributes": "SCORE_ATTRIBUTES", + "ScoreConfidence": "SCORE_CONFIDENCE", + "SearchRelevantContentInput": "SEARCH_RELEVANT_CONTENT_INPUT", + "SearchRelevantContentOutput": "SEARCH_RELEVANT_CONTENT_OUTPUT", + "ServiceQuotaExceededException": "SERVICE_QUOTA_EXCEEDED_EXCEPTION", + "SnippetExcerpt": "SNIPPET_EXCERPT", + "SourceAttribution": "SOURCE_ATTRIBUTION", + "SourceDetails": "SOURCE_DETAILS", + "SourceDetailsImageSourceDetails": "SOURCE_DETAILS", + "SourceDetailsAudioSourceDetails": "SOURCE_DETAILS", + "SourceDetailsVideoSourceDetails": "SOURCE_DETAILS", + "SourceDetailsUnknown": "SOURCE_DETAILS", + "StartDataSourceSyncJobInput": "START_DATA_SOURCE_SYNC_JOB_INPUT", + "StartDataSourceSyncJobOutput": "START_DATA_SOURCE_SYNC_JOB_OUTPUT", + "Status": "STATUS", + "StopDataSourceSyncJobInput": "STOP_DATA_SOURCE_SYNC_JOB_INPUT", + "StopDataSourceSyncJobOutput": "STOP_DATA_SOURCE_SYNC_JOB_OUTPUT", + "StringAttributeBoostingConfiguration": "STRING_ATTRIBUTE_BOOSTING_CONFIGURATION", + "StringAttributeValueBoostingLevel": "STRING_ATTRIBUTE_VALUE_BOOSTING_LEVEL", + "StringListAttributeBoostingConfiguration": "STRING_LIST_ATTRIBUTE_BOOSTING_CONFIGURATION", + "Subscription": "SUBSCRIPTION", + "SubscriptionDetails": "SUBSCRIPTION_DETAILS", + "SubscriptionPrincipal": "SUBSCRIPTION_PRINCIPAL", + "SubscriptionPrincipalUser": "SUBSCRIPTION_PRINCIPAL", + "SubscriptionPrincipalGroup": "SUBSCRIPTION_PRINCIPAL", + "SubscriptionPrincipalUnknown": "SUBSCRIPTION_PRINCIPAL", + "SubscriptionType": "SUBSCRIPTION_TYPE", + "SystemMessageType": "SYSTEM_MESSAGE_TYPE", + "Tag": "TAG", + "TagResourceInput": "TAG_RESOURCE_INPUT", + "TagResourceOutput": "TAG_RESOURCE_OUTPUT", + "TextDocumentStatistics": "TEXT_DOCUMENT_STATISTICS", + "TextInputEvent": "TEXT_INPUT_EVENT", + "TextOutputEvent": "TEXT_OUTPUT_EVENT", + "TextSegment": "TEXT_SEGMENT", + "ThrottlingException": "THROTTLING_EXCEPTION", + "TopicConfiguration": "TOPIC_CONFIGURATION", + "UntagResourceInput": "UNTAG_RESOURCE_INPUT", + "UntagResourceOutput": "UNTAG_RESOURCE_OUTPUT", + "UpdateApplicationInput": "UPDATE_APPLICATION_INPUT", + "UpdateApplicationOutput": "UPDATE_APPLICATION_OUTPUT", + "UpdateChatControlsConfigurationInput": "UPDATE_CHAT_CONTROLS_CONFIGURATION_INPUT", + "UpdateChatControlsConfigurationOutput": "UPDATE_CHAT_CONTROLS_CONFIGURATION_OUTPUT", + "UpdateChatResponseConfigurationInput": "UPDATE_CHAT_RESPONSE_CONFIGURATION_INPUT", + "UpdateChatResponseConfigurationOutput": "UPDATE_CHAT_RESPONSE_CONFIGURATION_OUTPUT", + "UpdateDataAccessorInput": "UPDATE_DATA_ACCESSOR_INPUT", + "UpdateDataAccessorOutput": "UPDATE_DATA_ACCESSOR_OUTPUT", + "UpdateDataSourceInput": "UPDATE_DATA_SOURCE_INPUT", + "UpdateDataSourceOutput": "UPDATE_DATA_SOURCE_OUTPUT", + "UpdateIndexInput": "UPDATE_INDEX_INPUT", + "UpdateIndexOutput": "UPDATE_INDEX_OUTPUT", + "UpdatePluginInput": "UPDATE_PLUGIN_INPUT", + "UpdatePluginOutput": "UPDATE_PLUGIN_OUTPUT", + "UpdateRetrieverInput": "UPDATE_RETRIEVER_INPUT", + "UpdateRetrieverOutput": "UPDATE_RETRIEVER_OUTPUT", + "UpdateSubscriptionInput": "UPDATE_SUBSCRIPTION_INPUT", + "UpdateSubscriptionOutput": "UPDATE_SUBSCRIPTION_OUTPUT", + "UpdateUserInput": "UPDATE_USER_INPUT", + "UpdateUserOutput": "UPDATE_USER_OUTPUT", + "UpdateWebExperienceInput": "UPDATE_WEB_EXPERIENCE_INPUT", + "UpdateWebExperienceOutput": "UPDATE_WEB_EXPERIENCE_OUTPUT", + "UserAlias": "USER_ALIAS", + "UsersAndGroups": "USERS_AND_GROUPS", + "ValidationException": "VALIDATION_EXCEPTION", + "ValidationExceptionField": "VALIDATION_EXCEPTION_FIELD", + "ValidationExceptionReason": "VALIDATION_EXCEPTION_REASON", + "VideoExtractionConfiguration": "VIDEO_EXTRACTION_CONFIGURATION", + "VideoExtractionStatus": "VIDEO_EXTRACTION_STATUS", + "VideoExtractionType": "VIDEO_EXTRACTION_TYPE", + "VideoSourceDetails": "VIDEO_SOURCE_DETAILS", + "WebExperience": "WEB_EXPERIENCE", + "WebExperienceAuthConfiguration": "WEB_EXPERIENCE_AUTH_CONFIGURATION", + "WebExperienceAuthConfigurationSamlConfiguration": "WEB_EXPERIENCE_AUTH_CONFIGURATION", + "WebExperienceAuthConfigurationUnknown": "WEB_EXPERIENCE_AUTH_CONFIGURATION", + "WebExperienceSamplePromptsControlMode": "WEB_EXPERIENCE_SAMPLE_PROMPTS_CONTROL_MODE", + "WebExperienceStatus": "WEB_EXPERIENCE_STATUS", + }, + shape_names=frozenset( + { + "APISchema", + "APISchemaType", + "AccessConfiguration", + "AccessControl", + "AccessDeniedException", + "ActionConfiguration", + "ActionExecution", + "ActionExecutionEvent", + "ActionExecutionPayloadField", + "ActionFilterConfiguration", + "ActionPayloadFieldType", + "ActionReview", + "ActionReviewEvent", + "ActionReviewPayloadField", + "ActionReviewPayloadFieldAllowedValue", + "ActionSummary", + "Application", + "ApplicationStatus", + "AppliedAttachmentsConfiguration", + "AppliedCreatorModeConfiguration", + "AppliedOrchestrationConfiguration", + "AssociatePermissionInput", + "AssociatePermissionOutput", + "AssociatedGroup", + "AssociatedUser", + "Attachment", + "AttachmentInput", + "AttachmentInputEvent", + "AttachmentOutput", + "AttachmentStatus", + "AttachmentsConfiguration", + "AttachmentsControlMode", + "AttributeFilter", + "AttributeType", + "AttributeValueOperator", + "AudioExtractionConfiguration", + "AudioExtractionStatus", + "AudioExtractionType", + "AudioSourceDetails", + "AuthChallengeRequest", + "AuthChallengeRequestEvent", + "AuthChallengeResponse", + "AuthChallengeResponseEvent", + "AutoSubscriptionConfiguration", + "AutoSubscriptionStatus", + "BasicAuthConfiguration", + "BatchDeleteDocumentInput", + "BatchDeleteDocumentOutput", + "BatchPutDocumentInput", + "BatchPutDocumentOutput", + "BlockedPhrasesConfiguration", + "BlockedPhrasesConfigurationUpdate", + "BrowserExtensionConfiguration", + "CancelSubscriptionInput", + "CancelSubscriptionOutput", + "ChatInput", + "ChatInputStream", + "ChatMode", + "ChatModeConfiguration", + "ChatOutput", + "ChatOutputStream", + "ChatResponseConfiguration", + "ChatResponseConfigurationDetail", + "ChatResponseConfigurationStatus", + "ChatSyncInput", + "ChatSyncOutput", + "CheckDocumentAccessInput", + "CheckDocumentAccessOutput", + "ConfigurationEvent", + "ConflictException", + "ContentBlockerRule", + "ContentRetrievalRule", + "ContentSource", + "ContentType", + "Conversation", + "ConversationSource", + "CopyFromSource", + "CreateAnonymousWebExperienceUrlInput", + "CreateAnonymousWebExperienceUrlOutput", + "CreateApplicationInput", + "CreateApplicationOutput", + "CreateChatResponseConfigurationInput", + "CreateChatResponseConfigurationOutput", + "CreateDataAccessorInput", + "CreateDataAccessorOutput", + "CreateDataSourceInput", + "CreateDataSourceOutput", + "CreateIndexInput", + "CreateIndexOutput", + "CreatePluginInput", + "CreatePluginOutput", + "CreateRetrieverInput", + "CreateRetrieverOutput", + "CreateSubscriptionInput", + "CreateSubscriptionOutput", + "CreateUserInput", + "CreateUserOutput", + "CreateWebExperienceInput", + "CreateWebExperienceOutput", + "CreatorModeConfiguration", + "CreatorModeControl", + "CustomPluginConfiguration", + "CustomizationConfiguration", + "DataAccessor", + "DataAccessorAuthenticationConfiguration", + "DataAccessorAuthenticationDetail", + "DataAccessorAuthenticationType", + "DataAccessorIdcTrustedTokenIssuerConfiguration", + "DataSource", + "DataSourceStatus", + "DataSourceSyncJob", + "DataSourceSyncJobMetrics", + "DataSourceSyncJobStatus", + "DataSourceVpcConfiguration", + "DateAttributeBoostingConfiguration", + "DeleteApplicationInput", + "DeleteApplicationOutput", + "DeleteAttachmentInput", + "DeleteAttachmentOutput", + "DeleteChatControlsConfigurationInput", + "DeleteChatControlsConfigurationOutput", + "DeleteChatResponseConfigurationInput", + "DeleteChatResponseConfigurationOutput", + "DeleteConversationInput", + "DeleteConversationOutput", + "DeleteDataAccessorInput", + "DeleteDataAccessorOutput", + "DeleteDataSourceInput", + "DeleteDataSourceOutput", + "DeleteDocument", + "DeleteGroupInput", + "DeleteGroupOutput", + "DeleteIndexInput", + "DeleteIndexOutput", + "DeletePluginInput", + "DeletePluginOutput", + "DeleteRetrieverInput", + "DeleteRetrieverOutput", + "DeleteUserInput", + "DeleteUserOutput", + "DeleteWebExperienceInput", + "DeleteWebExperienceOutput", + "DisassociatePermissionInput", + "DisassociatePermissionOutput", + "Document", + "DocumentAcl", + "DocumentAclCondition", + "DocumentAclGroup", + "DocumentAclMembership", + "DocumentAclUser", + "DocumentAttribute", + "DocumentAttributeBoostingConfiguration", + "DocumentAttributeBoostingLevel", + "DocumentAttributeCondition", + "DocumentAttributeConfiguration", + "DocumentAttributeTarget", + "DocumentAttributeValue", + "DocumentContent", + "DocumentContentOperator", + "DocumentDetails", + "DocumentEnrichmentConditionOperator", + "DocumentEnrichmentConfiguration", + "DocumentStatus", + "EligibleDataSource", + "EncryptionConfiguration", + "EndOfInputEvent", + "ErrorCode", + "ErrorDetail", + "ExternalResourceException", + "FailedAttachmentEvent", + "FailedDocument", + "GetApplicationInput", + "GetApplicationOutput", + "GetChatControlsConfigurationInput", + "GetChatControlsConfigurationOutput", + "GetChatResponseConfigurationInput", + "GetChatResponseConfigurationOutput", + "GetDataAccessorInput", + "GetDataAccessorOutput", + "GetDataSourceInput", + "GetDataSourceOutput", + "GetDocumentContentInput", + "GetDocumentContentOutput", + "GetGroupInput", + "GetGroupOutput", + "GetIndexInput", + "GetIndexOutput", + "GetMediaInput", + "GetMediaOutput", + "GetPluginInput", + "GetPluginOutput", + "GetPolicyInput", + "GetPolicyOutput", + "GetRetrieverInput", + "GetRetrieverOutput", + "GetUserInput", + "GetUserOutput", + "GetWebExperienceInput", + "GetWebExperienceOutput", + "GroupMembers", + "GroupStatus", + "GroupStatusDetail", + "GroupSummary", + "HallucinationReductionConfiguration", + "HallucinationReductionControl", + "HookConfiguration", + "IdcAuthConfiguration", + "IdentityProviderConfiguration", + "IdentityType", + "ImageExtractionConfiguration", + "ImageExtractionStatus", + "ImageSourceDetails", + "Index", + "IndexCapacityConfiguration", + "IndexStatistics", + "IndexStatus", + "IndexType", + "InlineDocumentEnrichmentConfiguration", + "InstructionCollection", + "InternalServerException", + "KendraIndexConfiguration", + "LicenseNotFoundException", + "ListApplicationsInput", + "ListApplicationsOutput", + "ListAttachmentsInput", + "ListAttachmentsOutput", + "ListChatResponseConfigurationsInput", + "ListChatResponseConfigurationsOutput", + "ListConversationsInput", + "ListConversationsOutput", + "ListDataAccessorsInput", + "ListDataAccessorsOutput", + "ListDataSourceSyncJobsInput", + "ListDataSourceSyncJobsOutput", + "ListDataSourcesInput", + "ListDataSourcesOutput", + "ListDocumentsInput", + "ListDocumentsOutput", + "ListGroupsInput", + "ListGroupsOutput", + "ListIndicesInput", + "ListIndicesOutput", + "ListMessagesInput", + "ListMessagesOutput", + "ListPluginActionsInput", + "ListPluginActionsOutput", + "ListPluginTypeActionsInput", + "ListPluginTypeActionsOutput", + "ListPluginTypeMetadataInput", + "ListPluginTypeMetadataOutput", + "ListPluginsInput", + "ListPluginsOutput", + "ListRetrieversInput", + "ListRetrieversOutput", + "ListSubscriptionsInput", + "ListSubscriptionsOutput", + "ListTagsForResourceInput", + "ListTagsForResourceOutput", + "ListWebExperiencesInput", + "ListWebExperiencesOutput", + "MediaExtractionConfiguration", + "MediaTooLargeException", + "MemberGroup", + "MemberRelation", + "MemberUser", + "MembershipType", + "Message", + "MessageType", + "MessageUsefulness", + "MessageUsefulnessFeedback", + "MessageUsefulnessReason", + "MetadataEvent", + "NativeIndexConfiguration", + "NoAuthConfiguration", + "NumberAttributeBoostingConfiguration", + "NumberAttributeBoostingType", + "OAuth2ClientCredentialConfiguration", + "OpenIDConnectProviderConfiguration", + "OrchestrationConfiguration", + "OrchestrationControl", + "OutputFormat", + "PermissionCondition", + "PermissionConditionOperator", + "PersonalizationConfiguration", + "PersonalizationControlMode", + "Plugin", + "PluginAuthConfiguration", + "PluginBuildStatus", + "PluginConfiguration", + "PluginState", + "PluginType", + "PluginTypeCategory", + "PluginTypeMetadataSummary", + "Principal", + "PrincipalGroup", + "PrincipalUser", + "PutFeedbackInput", + "PutFeedbackOutput", + "PutGroupInput", + "PutGroupOutput", + "QAppsConfiguration", + "QAppsControlMode", + "QuickSightConfiguration", + "ReadAccessType", + "RelevantContent", + "ResourceNotFoundException", + "ResponseConfiguration", + "ResponseConfigurationType", + "ResponseScope", + "Retriever", + "RetrieverConfiguration", + "RetrieverContentSource", + "RetrieverStatus", + "RetrieverType", + "Rule", + "RuleConfiguration", + "RuleType", + "S3", + "SamlConfiguration", + "SamlProviderConfiguration", + "ScoreAttributes", + "ScoreConfidence", + "SearchRelevantContentInput", + "SearchRelevantContentOutput", + "ServiceQuotaExceededException", + "SnippetExcerpt", + "SourceAttribution", + "SourceDetails", + "StartDataSourceSyncJobInput", + "StartDataSourceSyncJobOutput", + "Status", + "StopDataSourceSyncJobInput", + "StopDataSourceSyncJobOutput", + "StringAttributeBoostingConfiguration", + "StringAttributeValueBoostingLevel", + "StringListAttributeBoostingConfiguration", + "Subscription", + "SubscriptionDetails", + "SubscriptionPrincipal", + "SubscriptionType", + "SystemMessageType", + "Tag", + "TagResourceInput", + "TagResourceOutput", + "TextDocumentStatistics", + "TextInputEvent", + "TextOutputEvent", + "TextSegment", + "ThrottlingException", + "TopicConfiguration", + "UntagResourceInput", + "UntagResourceOutput", + "UpdateApplicationInput", + "UpdateApplicationOutput", + "UpdateChatControlsConfigurationInput", + "UpdateChatControlsConfigurationOutput", + "UpdateChatResponseConfigurationInput", + "UpdateChatResponseConfigurationOutput", + "UpdateDataAccessorInput", + "UpdateDataAccessorOutput", + "UpdateDataSourceInput", + "UpdateDataSourceOutput", + "UpdateIndexInput", + "UpdateIndexOutput", + "UpdatePluginInput", + "UpdatePluginOutput", + "UpdateRetrieverInput", + "UpdateRetrieverOutput", + "UpdateSubscriptionInput", + "UpdateSubscriptionOutput", + "UpdateUserInput", + "UpdateUserOutput", + "UpdateWebExperienceInput", + "UpdateWebExperienceOutput", + "UserAlias", + "UsersAndGroups", + "ValidationException", + "ValidationExceptionField", + "ValidationExceptionReason", + "VideoExtractionConfiguration", + "VideoExtractionStatus", + "VideoExtractionType", + "VideoSourceDetails", + "WebExperience", + "WebExperienceAuthConfiguration", + "WebExperienceSamplePromptsControlMode", + "WebExperienceStatus", + } + ), + service_error="ServiceError", +) + + +def __getattr__(name: str): + return _registry.build(name) + + +CREATE_APPLICATION: APIOperation[CreateApplicationInput, CreateApplicationOutput] = ( + APIOperation( + static_schema=_SCHEMA_CREATE_APPLICATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#ConflictException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +DELETE_DATA_ACCESSOR: APIOperation[ + DeleteDataAccessorInput, DeleteDataAccessorOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_DATA_ACCESSOR, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#ConflictException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +LIST_DATA_ACCESSORS: APIOperation[ListDataAccessorsInput, ListDataAccessorsOutput] = ( + APIOperation( + static_schema=_SCHEMA_LIST_DATA_ACCESSORS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +DELETE_APPLICATION: APIOperation[DeleteApplicationInput, DeleteApplicationOutput] = ( + APIOperation( + static_schema=_SCHEMA_DELETE_APPLICATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#ConflictException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +GET_APPLICATION: APIOperation[GetApplicationInput, GetApplicationOutput] = APIOperation( + static_schema=_SCHEMA_GET_APPLICATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +CREATE_INDEX: APIOperation[CreateIndexInput, CreateIndexOutput] = APIOperation( + static_schema=_SCHEMA_CREATE_INDEX, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#ConflictException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +CREATE_DATA_SOURCE: APIOperation[CreateDataSourceInput, CreateDataSourceOutput] = ( + APIOperation( + static_schema=_SCHEMA_CREATE_DATA_SOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#ConflictException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +DELETE_DATA_SOURCE: APIOperation[DeleteDataSourceInput, DeleteDataSourceOutput] = ( + APIOperation( + static_schema=_SCHEMA_DELETE_DATA_SOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#ConflictException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - deserializer.read_list(schema, _read_value) - return result +GET_DATA_SOURCE: APIOperation[GetDataSourceInput, GetDataSourceOutput] = APIOperation( + static_schema=_SCHEMA_GET_DATA_SOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +LIST_DATA_SOURCES: APIOperation[ListDataSourcesInput, ListDataSourcesOutput] = ( + APIOperation( + static_schema=_SCHEMA_LIST_DATA_SOURCES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) +UPDATE_DATA_SOURCE: APIOperation[UpdateDataSourceInput, UpdateDataSourceOutput] = ( + APIOperation( + static_schema=_SCHEMA_UPDATE_DATA_SOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#ConflictException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) -@dataclass(kw_only=True) -class ChatInput: - """Dataclass for ChatInput structure.""" +DELETE_INDEX: APIOperation[DeleteIndexInput, DeleteIndexOutput] = APIOperation( + static_schema=_SCHEMA_DELETE_INDEX, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#ConflictException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - application_id: str | None = None - """ - The identifier of the Amazon Q Business application linked to a - streaming Amazon Q Business conversation. - """ +GET_INDEX: APIOperation[GetIndexInput, GetIndexOutput] = APIOperation( + static_schema=_SCHEMA_GET_INDEX, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - user_id: str | None = None - """The identifier of the user attached to the chat input.""" +LIST_INDICES: APIOperation[ListIndicesInput, ListIndicesOutput] = APIOperation( + static_schema=_SCHEMA_LIST_INDICES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - user_groups: list[str] | None = None - """The group names that a user associated with the chat input belongs to.""" +UPDATE_INDEX: APIOperation[UpdateIndexInput, UpdateIndexOutput] = APIOperation( + static_schema=_SCHEMA_UPDATE_INDEX, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#ConflictException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - conversation_id: str | None = None - """The identifier of the Amazon Q Business conversation.""" +LIST_APPLICATIONS: APIOperation[ListApplicationsInput, ListApplicationsOutput] = ( + APIOperation( + static_schema=_SCHEMA_LIST_APPLICATIONS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +CREATE_PLUGIN: APIOperation[CreatePluginInput, CreatePluginOutput] = APIOperation( + static_schema=_SCHEMA_CREATE_PLUGIN, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#ConflictException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - parent_message_id: str | None = None - """ - The identifier used to associate a user message with a AI generated - response. - """ +DELETE_PLUGIN: APIOperation[DeletePluginInput, DeletePluginOutput] = APIOperation( + static_schema=_SCHEMA_DELETE_PLUGIN, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#ConflictException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - client_token: str | None = None - """A token that you provide to identify the chat input.""" +GET_PLUGIN: APIOperation[GetPluginInput, GetPluginOutput] = APIOperation( + static_schema=_SCHEMA_GET_PLUGIN, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CHAT_INPUT, self) +LIST_PLUGINS: APIOperation[ListPluginsInput, ListPluginsOutput] = APIOperation( + static_schema=_SCHEMA_LIST_PLUGINS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_CHAT_INPUT.members["applicationId"], self.application_id - ) +UPDATE_PLUGIN: APIOperation[UpdatePluginInput, UpdatePluginOutput] = APIOperation( + static_schema=_SCHEMA_UPDATE_PLUGIN, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#ConflictException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +CREATE_RETRIEVER: APIOperation[CreateRetrieverInput, CreateRetrieverOutput] = ( + APIOperation( + static_schema=_SCHEMA_CREATE_RETRIEVER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#ConflictException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +DELETE_RETRIEVER: APIOperation[DeleteRetrieverInput, DeleteRetrieverOutput] = ( + APIOperation( + static_schema=_SCHEMA_DELETE_RETRIEVER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#ConflictException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +GET_RETRIEVER: APIOperation[GetRetrieverInput, GetRetrieverOutput] = APIOperation( + static_schema=_SCHEMA_GET_RETRIEVER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +LIST_RETRIEVERS: APIOperation[ListRetrieversInput, ListRetrieversOutput] = APIOperation( + static_schema=_SCHEMA_LIST_RETRIEVERS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +UPDATE_RETRIEVER: APIOperation[UpdateRetrieverInput, UpdateRetrieverOutput] = ( + APIOperation( + static_schema=_SCHEMA_UPDATE_RETRIEVER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#ConflictException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +UPDATE_APPLICATION: APIOperation[UpdateApplicationInput, UpdateApplicationOutput] = ( + APIOperation( + static_schema=_SCHEMA_UPDATE_APPLICATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#ConflictException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +CREATE_WEB_EXPERIENCE: APIOperation[ + CreateWebExperienceInput, CreateWebExperienceOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_WEB_EXPERIENCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#ConflictException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +DELETE_WEB_EXPERIENCE: APIOperation[ + DeleteWebExperienceInput, DeleteWebExperienceOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_WEB_EXPERIENCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#ConflictException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +GET_WEB_EXPERIENCE: APIOperation[GetWebExperienceInput, GetWebExperienceOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_WEB_EXPERIENCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +LIST_WEB_EXPERIENCES: APIOperation[ + ListWebExperiencesInput, ListWebExperiencesOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_WEB_EXPERIENCES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +UPDATE_WEB_EXPERIENCE: APIOperation[ + UpdateWebExperienceInput, UpdateWebExperienceOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_WEB_EXPERIENCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#ConflictException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +ASSOCIATE_PERMISSION: APIOperation[ + AssociatePermissionInput, AssociatePermissionOutput +] = APIOperation( + static_schema=_SCHEMA_ASSOCIATE_PERMISSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#ConflictException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +BATCH_DELETE_DOCUMENT: APIOperation[ + BatchDeleteDocumentInput, BatchDeleteDocumentOutput +] = APIOperation( + static_schema=_SCHEMA_BATCH_DELETE_DOCUMENT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#ConflictException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +BATCH_PUT_DOCUMENT: APIOperation[BatchPutDocumentInput, BatchPutDocumentOutput] = ( + APIOperation( + static_schema=_SCHEMA_BATCH_PUT_DOCUMENT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#ConflictException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +CANCEL_SUBSCRIPTION: APIOperation[CancelSubscriptionInput, CancelSubscriptionOutput] = ( + APIOperation( + static_schema=_SCHEMA_CANCEL_SUBSCRIPTION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +CHECK_DOCUMENT_ACCESS: APIOperation[ + CheckDocumentAccessInput, CheckDocumentAccessOutput +] = APIOperation( + static_schema=_SCHEMA_CHECK_DOCUMENT_ACCESS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +CREATE_ANONYMOUS_WEB_EXPERIENCE_URL: APIOperation[ + CreateAnonymousWebExperienceUrlInput, CreateAnonymousWebExperienceUrlOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_ANONYMOUS_WEB_EXPERIENCE_URL, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +CREATE_CHAT_RESPONSE_CONFIGURATION: APIOperation[ + CreateChatResponseConfigurationInput, CreateChatResponseConfigurationOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_CHAT_RESPONSE_CONFIGURATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#ConflictException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +CREATE_SUBSCRIPTION: APIOperation[CreateSubscriptionInput, CreateSubscriptionOutput] = ( + APIOperation( + static_schema=_SCHEMA_CREATE_SUBSCRIPTION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#ConflictException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +CREATE_USER: APIOperation[CreateUserInput, CreateUserOutput] = APIOperation( + static_schema=_SCHEMA_CREATE_USER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#ConflictException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +DELETE_ATTACHMENT: APIOperation[DeleteAttachmentInput, DeleteAttachmentOutput] = ( + APIOperation( + static_schema=_SCHEMA_DELETE_ATTACHMENT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#LicenseNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +DELETE_CHAT_CONTROLS_CONFIGURATION: APIOperation[ + DeleteChatControlsConfigurationInput, DeleteChatControlsConfigurationOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_CHAT_CONTROLS_CONFIGURATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +DELETE_CHAT_RESPONSE_CONFIGURATION: APIOperation[ + DeleteChatResponseConfigurationInput, DeleteChatResponseConfigurationOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_CHAT_RESPONSE_CONFIGURATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#ConflictException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +DELETE_CONVERSATION: APIOperation[DeleteConversationInput, DeleteConversationOutput] = ( + APIOperation( + static_schema=_SCHEMA_DELETE_CONVERSATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#ConflictException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#LicenseNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - if self.user_id is not None: - serializer.write_string(_SCHEMA_CHAT_INPUT.members["userId"], self.user_id) +DELETE_GROUP: APIOperation[DeleteGroupInput, DeleteGroupOutput] = APIOperation( + static_schema=_SCHEMA_DELETE_GROUP, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#ConflictException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) + +DELETE_USER: APIOperation[DeleteUserInput, DeleteUserOutput] = APIOperation( + static_schema=_SCHEMA_DELETE_USER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#ConflictException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - if self.user_groups is not None: - _serialize_user_groups( - serializer, _SCHEMA_CHAT_INPUT.members["userGroups"], self.user_groups - ) +DISASSOCIATE_PERMISSION: APIOperation[ + DisassociatePermissionInput, DisassociatePermissionOutput +] = APIOperation( + static_schema=_SCHEMA_DISASSOCIATE_PERMISSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#ConflictException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - if self.conversation_id is not None: - serializer.write_string( - _SCHEMA_CHAT_INPUT.members["conversationId"], self.conversation_id - ) +GET_CHAT_CONTROLS_CONFIGURATION: APIOperation[ + GetChatControlsConfigurationInput, GetChatControlsConfigurationOutput +] = APIOperation( + static_schema=_SCHEMA_GET_CHAT_CONTROLS_CONFIGURATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - if self.parent_message_id is not None: - serializer.write_string( - _SCHEMA_CHAT_INPUT.members["parentMessageId"], self.parent_message_id - ) +GET_CHAT_RESPONSE_CONFIGURATION: APIOperation[ + GetChatResponseConfigurationInput, GetChatResponseConfigurationOutput +] = APIOperation( + static_schema=_SCHEMA_GET_CHAT_RESPONSE_CONFIGURATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CHAT_INPUT.members["clientToken"], self.client_token - ) +GET_DOCUMENT_CONTENT: APIOperation[ + GetDocumentContentInput, GetDocumentContentOutput +] = APIOperation( + static_schema=_SCHEMA_GET_DOCUMENT_CONTENT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) +GET_GROUP: APIOperation[GetGroupInput, GetGroupOutput] = APIOperation( + static_schema=_SCHEMA_GET_GROUP, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#ConflictException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +GET_MEDIA: APIOperation[GetMediaInput, GetMediaOutput] = APIOperation( + static_schema=_SCHEMA_GET_MEDIA, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#LicenseNotFoundException"), + ShapeID("com.amazonaws.qbusiness#MediaTooLargeException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_CHAT_INPUT.members["applicationId"] - ) +GET_POLICY: APIOperation[GetPolicyInput, GetPolicyOutput] = APIOperation( + static_schema=_SCHEMA_GET_POLICY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 1: - kwargs["user_id"] = de.read_string( - _SCHEMA_CHAT_INPUT.members["userId"] - ) +GET_USER: APIOperation[GetUserInput, GetUserOutput] = APIOperation( + static_schema=_SCHEMA_GET_USER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#ConflictException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 2: - kwargs["user_groups"] = _deserialize_user_groups( - de, _SCHEMA_CHAT_INPUT.members["userGroups"] - ) +LIST_ATTACHMENTS: APIOperation[ListAttachmentsInput, ListAttachmentsOutput] = ( + APIOperation( + static_schema=_SCHEMA_LIST_ATTACHMENTS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#LicenseNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - case 3: - kwargs["conversation_id"] = de.read_string( - _SCHEMA_CHAT_INPUT.members["conversationId"] - ) +LIST_CHAT_RESPONSE_CONFIGURATIONS: APIOperation[ + ListChatResponseConfigurationsInput, ListChatResponseConfigurationsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_CHAT_RESPONSE_CONFIGURATIONS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 4: - kwargs["parent_message_id"] = de.read_string( - _SCHEMA_CHAT_INPUT.members["parentMessageId"] - ) +LIST_CONVERSATIONS: APIOperation[ListConversationsInput, ListConversationsOutput] = ( + APIOperation( + static_schema=_SCHEMA_LIST_CONVERSATIONS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#LicenseNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - case 5: - kwargs["client_token"] = de.read_string( - _SCHEMA_CHAT_INPUT.members["clientToken"] - ) +LIST_DATA_SOURCE_SYNC_JOBS: APIOperation[ + ListDataSourceSyncJobsInput, ListDataSourceSyncJobsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_DATA_SOURCE_SYNC_JOBS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#ConflictException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case _: - logger.debug("Unexpected member schema: %s", schema) +LIST_DOCUMENTS: APIOperation[ListDocumentsInput, ListDocumentsOutput] = APIOperation( + static_schema=_SCHEMA_LIST_DOCUMENTS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - deserializer.read_struct(_SCHEMA_CHAT_INPUT, consumer=_consumer) - return kwargs +LIST_GROUPS: APIOperation[ListGroupsInput, ListGroupsOutput] = APIOperation( + static_schema=_SCHEMA_LIST_GROUPS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#ConflictException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +LIST_MESSAGES: APIOperation[ListMessagesInput, ListMessagesOutput] = APIOperation( + static_schema=_SCHEMA_LIST_MESSAGES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#LicenseNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -CHAT = APIOperation( - input=ChatInput, - output=ChatOutput, - schema=_SCHEMA_CHAT, - input_schema=_SCHEMA_CHAT_INPUT, - output_schema=_SCHEMA_CHAT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.qbusiness#ExternalResourceException" - ): ExternalResourceException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#LicenseNotFoundException" - ): LicenseNotFoundException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), +LIST_PLUGIN_ACTIONS: APIOperation[ListPluginActionsInput, ListPluginActionsOutput] = ( + APIOperation( + static_schema=_SCHEMA_LIST_PLUGIN_ACTIONS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) + +LIST_PLUGIN_TYPE_ACTIONS: APIOperation[ + ListPluginTypeActionsInput, ListPluginTypeActionsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_PLUGIN_TYPE_ACTIONS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_EXTERNAL_RESOURCE_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_LICENSE_NOT_FOUND_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, +) + +LIST_PLUGIN_TYPE_METADATA: APIOperation[ + ListPluginTypeMetadataInput, ListPluginTypeMetadataOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_PLUGIN_TYPE_METADATA, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) - -@dataclass(kw_only=True) -class CreateDataAccessorInput: - """Dataclass for CreateDataAccessorInput structure.""" - - application_id: str | None = None - """The unique identifier of the Amazon Q Business application.""" - - principal: str | None = None - """ - The Amazon Resource Name (ARN) of the IAM role for the ISV that will be - accessing the data. - """ - - action_configurations: "list[ActionConfiguration] | None" = None - """ - A list of action configurations specifying the allowed actions and any - associated filters. - """ - - client_token: str | None = None - """ - A unique, case-sensitive identifier you provide to ensure idempotency of - the request. - """ - - display_name: str | None = field(repr=False, default=None) - """A friendly name for the data accessor.""" - - authentication_detail: DataAccessorAuthenticationDetail | None = None - """ - The authentication configuration details for the data accessor. This - specifies how the ISV will authenticate when accessing data through this - data accessor. - """ - - tags: list[Tag] | None = None - """The tags to associate with the data accessor.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_DATA_ACCESSOR_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_CREATE_DATA_ACCESSOR_INPUT.members["applicationId"], - self.application_id, - ) - - if self.principal is not None: - serializer.write_string( - _SCHEMA_CREATE_DATA_ACCESSOR_INPUT.members["principal"], self.principal - ) - - if self.action_configurations is not None: - _serialize_action_configuration_list( - serializer, - _SCHEMA_CREATE_DATA_ACCESSOR_INPUT.members["actionConfigurations"], - self.action_configurations, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_CREATE_DATA_ACCESSOR_INPUT.members["clientToken"], - self.client_token, - ) - - if self.display_name is not None: - serializer.write_string( - _SCHEMA_CREATE_DATA_ACCESSOR_INPUT.members["displayName"], - self.display_name, - ) - - if self.authentication_detail is not None: - serializer.write_struct( - _SCHEMA_CREATE_DATA_ACCESSOR_INPUT.members["authenticationDetail"], - self.authentication_detail, - ) - - if self.tags is not None: - _serialize_tags( - serializer, - _SCHEMA_CREATE_DATA_ACCESSOR_INPUT.members["tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_CREATE_DATA_ACCESSOR_INPUT.members["applicationId"] - ) - - case 1: - kwargs["principal"] = de.read_string( - _SCHEMA_CREATE_DATA_ACCESSOR_INPUT.members["principal"] - ) - - case 2: - kwargs["action_configurations"] = ( - _deserialize_action_configuration_list( - de, - _SCHEMA_CREATE_DATA_ACCESSOR_INPUT.members[ - "actionConfigurations" - ], - ) - ) - - case 3: - kwargs["client_token"] = de.read_string( - _SCHEMA_CREATE_DATA_ACCESSOR_INPUT.members["clientToken"] - ) - - case 4: - kwargs["display_name"] = de.read_string( - _SCHEMA_CREATE_DATA_ACCESSOR_INPUT.members["displayName"] - ) - - case 5: - kwargs["authentication_detail"] = ( - DataAccessorAuthenticationDetail.deserialize(de) - ) - - case 6: - kwargs["tags"] = _deserialize_tags( - de, _SCHEMA_CREATE_DATA_ACCESSOR_INPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_DATA_ACCESSOR_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetDataAccessorOutput: - """Dataclass for GetDataAccessorOutput structure.""" - - display_name: str | None = field(repr=False, default=None) - """The friendly name of the data accessor.""" - - data_accessor_id: str | None = None - """The unique identifier of the data accessor.""" - - data_accessor_arn: str | None = None - """The Amazon Resource Name (ARN) of the data accessor.""" - - application_id: str | None = None - """ - The unique identifier of the Amazon Q Business application associated - with this data accessor. - """ - - idc_application_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the IAM Identity Center application - associated with this data accessor. - """ - - principal: str | None = None - """ - The Amazon Resource Name (ARN) of the IAM role for the ISV associated - with this data accessor. - """ - - action_configurations: "list[ActionConfiguration] | None" = None - """ - The list of action configurations specifying the allowed actions and any - associated filters. - """ - - authentication_detail: DataAccessorAuthenticationDetail | None = None - """ - The authentication configuration details for the data accessor. This - specifies how the ISV authenticates when accessing data through this - data accessor. - """ - - created_at: datetime | None = None - """The timestamp when the data accessor was created.""" - - updated_at: datetime | None = None - """The timestamp when the data accessor was last updated.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False +LIST_SUBSCRIPTIONS: APIOperation[ListSubscriptionsInput, ListSubscriptionsOutput] = ( + APIOperation( + static_schema=_SCHEMA_LIST_SUBSCRIPTIONS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#ConflictException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DATA_ACCESSOR_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.display_name is not None: - serializer.write_string( - _SCHEMA_GET_DATA_ACCESSOR_OUTPUT.members["displayName"], - self.display_name, - ) - - if self.data_accessor_id is not None: - serializer.write_string( - _SCHEMA_GET_DATA_ACCESSOR_OUTPUT.members["dataAccessorId"], - self.data_accessor_id, - ) - - if self.data_accessor_arn is not None: - serializer.write_string( - _SCHEMA_GET_DATA_ACCESSOR_OUTPUT.members["dataAccessorArn"], - self.data_accessor_arn, - ) - - if self.application_id is not None: - serializer.write_string( - _SCHEMA_GET_DATA_ACCESSOR_OUTPUT.members["applicationId"], - self.application_id, - ) - - if self.idc_application_arn is not None: - serializer.write_string( - _SCHEMA_GET_DATA_ACCESSOR_OUTPUT.members["idcApplicationArn"], - self.idc_application_arn, - ) - - if self.principal is not None: - serializer.write_string( - _SCHEMA_GET_DATA_ACCESSOR_OUTPUT.members["principal"], self.principal - ) - - if self.action_configurations is not None: - _serialize_action_configuration_list( - serializer, - _SCHEMA_GET_DATA_ACCESSOR_OUTPUT.members["actionConfigurations"], - self.action_configurations, - ) - - if self.authentication_detail is not None: - serializer.write_struct( - _SCHEMA_GET_DATA_ACCESSOR_OUTPUT.members["authenticationDetail"], - self.authentication_detail, - ) - - if self.created_at is not None: - serializer.write_timestamp( - _SCHEMA_GET_DATA_ACCESSOR_OUTPUT.members["createdAt"], self.created_at - ) - - if self.updated_at is not None: - serializer.write_timestamp( - _SCHEMA_GET_DATA_ACCESSOR_OUTPUT.members["updatedAt"], self.updated_at - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["display_name"] = de.read_string( - _SCHEMA_GET_DATA_ACCESSOR_OUTPUT.members["displayName"] - ) - - case 1: - kwargs["data_accessor_id"] = de.read_string( - _SCHEMA_GET_DATA_ACCESSOR_OUTPUT.members["dataAccessorId"] - ) - - case 2: - kwargs["data_accessor_arn"] = de.read_string( - _SCHEMA_GET_DATA_ACCESSOR_OUTPUT.members["dataAccessorArn"] - ) - - case 3: - kwargs["application_id"] = de.read_string( - _SCHEMA_GET_DATA_ACCESSOR_OUTPUT.members["applicationId"] - ) - - case 4: - kwargs["idc_application_arn"] = de.read_string( - _SCHEMA_GET_DATA_ACCESSOR_OUTPUT.members["idcApplicationArn"] - ) - - case 5: - kwargs["principal"] = de.read_string( - _SCHEMA_GET_DATA_ACCESSOR_OUTPUT.members["principal"] - ) - - case 6: - kwargs["action_configurations"] = ( - _deserialize_action_configuration_list( - de, - _SCHEMA_GET_DATA_ACCESSOR_OUTPUT.members[ - "actionConfigurations" - ], - ) - ) - - case 7: - kwargs["authentication_detail"] = ( - DataAccessorAuthenticationDetail.deserialize(de) - ) - - case 8: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_GET_DATA_ACCESSOR_OUTPUT.members["createdAt"] - ) - - case 9: - kwargs["updated_at"] = de.read_timestamp( - _SCHEMA_GET_DATA_ACCESSOR_OUTPUT.members["updatedAt"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_DATA_ACCESSOR_OUTPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateDataAccessorInput: - """Dataclass for UpdateDataAccessorInput structure.""" - - application_id: str | None = None - """The unique identifier of the Amazon Q Business application.""" - - data_accessor_id: str | None = None - """The unique identifier of the data accessor to update.""" - - action_configurations: "list[ActionConfiguration] | None" = None - """ - The updated list of action configurations specifying the allowed actions - and any associated filters. - """ - - authentication_detail: DataAccessorAuthenticationDetail | None = None - """ - The updated authentication configuration details for the data accessor. - This specifies how the ISV will authenticate when accessing data through - this data accessor. - """ - - display_name: str | None = field(repr=False, default=None) - """The updated friendly name for the data accessor.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_DATA_ACCESSOR_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.application_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_DATA_ACCESSOR_INPUT.members["applicationId"], - self.application_id, - ) +) - if self.data_accessor_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_DATA_ACCESSOR_INPUT.members["dataAccessorId"], - self.data_accessor_id, - ) +LIST_TAGS_FOR_RESOURCE: APIOperation[ + ListTagsForResourceInput, ListTagsForResourceOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_TAGS_FOR_RESOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - if self.action_configurations is not None: - _serialize_action_configuration_list( - serializer, - _SCHEMA_UPDATE_DATA_ACCESSOR_INPUT.members["actionConfigurations"], - self.action_configurations, - ) +PUT_FEEDBACK: APIOperation[PutFeedbackInput, PutFeedbackOutput] = APIOperation( + static_schema=_SCHEMA_PUT_FEEDBACK, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - if self.authentication_detail is not None: - serializer.write_struct( - _SCHEMA_UPDATE_DATA_ACCESSOR_INPUT.members["authenticationDetail"], - self.authentication_detail, - ) +PUT_GROUP: APIOperation[PutGroupInput, PutGroupOutput] = APIOperation( + static_schema=_SCHEMA_PUT_GROUP, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#ConflictException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - if self.display_name is not None: - serializer.write_string( - _SCHEMA_UPDATE_DATA_ACCESSOR_INPUT.members["displayName"], - self.display_name, - ) +START_DATA_SOURCE_SYNC_JOB: APIOperation[ + StartDataSourceSyncJobInput, StartDataSourceSyncJobOutput +] = APIOperation( + static_schema=_SCHEMA_START_DATA_SOURCE_SYNC_JOB, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#ConflictException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) +STOP_DATA_SOURCE_SYNC_JOB: APIOperation[ + StopDataSourceSyncJobInput, StopDataSourceSyncJobOutput +] = APIOperation( + static_schema=_SCHEMA_STOP_DATA_SOURCE_SYNC_JOB, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#ConflictException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +TAG_RESOURCE: APIOperation[TagResourceInput, TagResourceOutput] = APIOperation( + static_schema=_SCHEMA_TAG_RESOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#ConflictException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["application_id"] = de.read_string( - _SCHEMA_UPDATE_DATA_ACCESSOR_INPUT.members["applicationId"] - ) +UNTAG_RESOURCE: APIOperation[UntagResourceInput, UntagResourceOutput] = APIOperation( + static_schema=_SCHEMA_UNTAG_RESOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 1: - kwargs["data_accessor_id"] = de.read_string( - _SCHEMA_UPDATE_DATA_ACCESSOR_INPUT.members["dataAccessorId"] - ) +UPDATE_CHAT_CONTROLS_CONFIGURATION: APIOperation[ + UpdateChatControlsConfigurationInput, UpdateChatControlsConfigurationOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_CHAT_CONTROLS_CONFIGURATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#ConflictException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 2: - kwargs["action_configurations"] = ( - _deserialize_action_configuration_list( - de, - _SCHEMA_UPDATE_DATA_ACCESSOR_INPUT.members[ - "actionConfigurations" - ], - ) - ) +UPDATE_CHAT_RESPONSE_CONFIGURATION: APIOperation[ + UpdateChatResponseConfigurationInput, UpdateChatResponseConfigurationOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_CHAT_RESPONSE_CONFIGURATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#ConflictException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 3: - kwargs["authentication_detail"] = ( - DataAccessorAuthenticationDetail.deserialize(de) - ) +UPDATE_SUBSCRIPTION: APIOperation[UpdateSubscriptionInput, UpdateSubscriptionOutput] = ( + APIOperation( + static_schema=_SCHEMA_UPDATE_SUBSCRIPTION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#ConflictException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - case 4: - kwargs["display_name"] = de.read_string( - _SCHEMA_UPDATE_DATA_ACCESSOR_INPUT.members["displayName"] - ) +UPDATE_USER: APIOperation[UpdateUserInput, UpdateUserOutput] = APIOperation( + static_schema=_SCHEMA_UPDATE_USER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#ConflictException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case _: - logger.debug("Unexpected member schema: %s", schema) +CHAT_SYNC: APIOperation[ChatSyncInput, ChatSyncOutput] = APIOperation( + static_schema=_SCHEMA_CHAT_SYNC, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#ConflictException"), + ShapeID("com.amazonaws.qbusiness#ExternalResourceException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#LicenseNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - deserializer.read_struct(_SCHEMA_UPDATE_DATA_ACCESSOR_INPUT, consumer=_consumer) - return kwargs +SEARCH_RELEVANT_CONTENT: APIOperation[ + SearchRelevantContentInput, SearchRelevantContentOutput +] = APIOperation( + static_schema=_SCHEMA_SEARCH_RELEVANT_CONTENT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#LicenseNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +CHAT: APIOperation[ChatInput, ChatOutput] = APIOperation( + static_schema=_SCHEMA_CHAT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#ConflictException"), + ShapeID("com.amazonaws.qbusiness#ExternalResourceException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#LicenseNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -CREATE_DATA_ACCESSOR = APIOperation( - input=CreateDataAccessorInput, - output=CreateDataAccessorOutput, - schema=_SCHEMA_CREATE_DATA_ACCESSOR, - input_schema=_SCHEMA_CREATE_DATA_ACCESSOR_INPUT, - output_schema=_SCHEMA_CREATE_DATA_ACCESSOR_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID( - "com.amazonaws.qbusiness#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], +CREATE_DATA_ACCESSOR: APIOperation[ + CreateDataAccessorInput, CreateDataAccessorOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_DATA_ACCESSOR, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#ConflictException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) -GET_DATA_ACCESSOR = APIOperation( - input=GetDataAccessorInput, - output=GetDataAccessorOutput, - schema=_SCHEMA_GET_DATA_ACCESSOR, - input_schema=_SCHEMA_GET_DATA_ACCESSOR_INPUT, - output_schema=_SCHEMA_GET_DATA_ACCESSOR_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) +GET_DATA_ACCESSOR: APIOperation[GetDataAccessorInput, GetDataAccessorOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_DATA_ACCESSOR, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) -UPDATE_DATA_ACCESSOR = APIOperation( - input=UpdateDataAccessorInput, - output=UpdateDataAccessorOutput, - schema=_SCHEMA_UPDATE_DATA_ACCESSOR, - input_schema=_SCHEMA_UPDATE_DATA_ACCESSOR_INPUT, - output_schema=_SCHEMA_UPDATE_DATA_ACCESSOR_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.qbusiness#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.qbusiness#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.qbusiness#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.qbusiness#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.qbusiness#ThrottlingException"): ThrottlingException, - ShapeID("com.amazonaws.qbusiness#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLING_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, +UPDATE_DATA_ACCESSOR: APIOperation[ + UpdateDataAccessorInput, UpdateDataAccessorOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_DATA_ACCESSOR, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.qbusiness#AccessDeniedException"), + ShapeID("com.amazonaws.qbusiness#ConflictException"), + ShapeID("com.amazonaws.qbusiness#InternalServerException"), + ShapeID("com.amazonaws.qbusiness#ResourceNotFoundException"), + ShapeID("com.amazonaws.qbusiness#ThrottlingException"), + ShapeID("com.amazonaws.qbusiness#ValidationException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) diff --git a/clients/aws-sdk-qbusiness/src/aws_sdk_qbusiness/models.pyi b/clients/aws-sdk-qbusiness/src/aws_sdk_qbusiness/models.pyi new file mode 100644 index 00000000..8fcc6643 --- /dev/null +++ b/clients/aws-sdk-qbusiness/src/aws_sdk_qbusiness/models.pyi @@ -0,0 +1,7941 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. + +from dataclasses import dataclass +from datetime import datetime +from enum import StrEnum +from typing import Self, Union + +from smithy_core.deserializers import ShapeDeserializer +from smithy_core.documents import Document as _Document +from smithy_core.exceptions import ModeledError +from smithy_core.response import ResponseMetadata +from smithy_core.schemas import APIOperation +from smithy_core.serializers import ShapeSerializer +from smithy_core.types import UnknownEnumMixin + +class _SerdeShape: + def serialize(self, serializer: ShapeSerializer) -> None: ... + def serialize_members(self, serializer: ShapeSerializer) -> None: ... + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: ... + +class ServiceError(ModeledError): + """ + Base error for all errors in the service. + + Some exceptions do not extend from this class, including + synthetic, implicit, and shared exception types. + """ + +@dataclass(kw_only=True) +class AccessConfiguration(_SerdeShape): + """Used to configure access permissions for a document.""" + + access_controls: list[AccessControl] + """A list of `AccessControlList` objects.""" + member_relation: str | None = ... + """Describes the member relation within the `AccessControlList` object.""" + +@dataclass(kw_only=True) +class AccessControl(_SerdeShape): + """ + A list of principals. Each principal can be either a `USER` or a `GROUP` + and can be designated document access permissions of either `ALLOW` or + `DENY`. + """ + + principals: list[Principal] + """ + Contains a list of principals, where a principal can be either a `USER` + or a `GROUP`. Each principal can be have the following type of document + access: `ALLOW` or `DENY`. + """ + member_relation: str | None = ... + """Describes the member relation within a principal list.""" + +@dataclass(kw_only=True) +class AccessDeniedException(ServiceError, _SerdeShape): + """ + You don't have access to perform this action. Make sure you have the + required permission policies and user accounts and try again. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ActionConfiguration(_SerdeShape): + """Specifies an allowed action and its associated filter configuration.""" + + action: str + """The Amazon Q Business action that is allowed.""" + filter_configuration: ActionFilterConfiguration | None = ... + """The filter configuration for the action, if any.""" + +@dataclass(kw_only=True) +class ActionExecution(_SerdeShape): + """ + Performs an Amazon Q Business plugin action during a non-streaming chat + conversation. + """ + + plugin_id: str + """The identifier of the plugin the action is attached to.""" + payload: dict[str, ActionExecutionPayloadField] + """ + A mapping of field names to the field values in input that an end user + provides to Amazon Q Business requests to perform their plugin action. + """ + payload_field_name_separator: str + """ + A string used to retain information about the hierarchical contexts + within an action execution event payload. + """ + +@dataclass(kw_only=True) +class ActionExecutionEvent(_SerdeShape): + """ + A request from an end user signalling an intent to perform an Amazon Q + Business plugin action during a streaming chat. + """ + + plugin_id: str + """The identifier of the plugin for which the action is being requested.""" + payload: dict[str, ActionExecutionPayloadField] + """ + A mapping of field names to the field values in input that an end user + provides to Amazon Q Business requests to perform their plugin action. + """ + payload_field_name_separator: str + """ + A string used to retain information about the hierarchical contexts + within a action execution event payload. + """ + +@dataclass(kw_only=True) +class ActionExecutionPayloadField(_SerdeShape): + """A user input field in an plugin action execution payload.""" + + value: _Document + """The content of a user input field in an plugin action execution payload.""" + +@dataclass(kw_only=True) +class ActionFilterConfiguration(_SerdeShape): + """Specifies filters to apply to an allowed action.""" + + document_attribute_filter: AttributeFilter + """ + Enables filtering of responses based on document attributes or metadata + fields. + """ + +class ActionPayloadFieldType(UnknownEnumMixin, StrEnum): + STRING = "STRING" + NUMBER = "NUMBER" + ARRAY = "ARRAY" + BOOLEAN = "BOOLEAN" + +@dataclass(kw_only=True) +class ActionReview(_SerdeShape): + """ + An output event that Amazon Q Business returns to an user who wants to + perform a plugin action during a non-streaming chat conversation. It + contains information about the selected action with a list of possible + user input fields, some pre-populated by Amazon Q Business. + """ + + plugin_id: str | None = ... + """The identifier of the plugin associated with the action review.""" + plugin_type: str | None = ... + """The type of plugin.""" + payload: dict[str, ActionReviewPayloadField] | None = ... + """ + Field values that an end user needs to provide to Amazon Q Business for + Amazon Q Business to perform the requested plugin action. + """ + payload_field_name_separator: str | None = ... + """ + A string used to retain information about the hierarchical contexts + within an action review payload. + """ + +@dataclass(kw_only=True) +class ActionReviewEvent(_SerdeShape): + """ + An output event that Amazon Q Business returns to an user who wants to + perform a plugin action during a streaming chat conversation. It + contains information about the selected action with a list of possible + user input fields, some pre-populated by Amazon Q Business. + """ + + conversation_id: str | None = ... + """ + The identifier of the conversation with which the action review event is + associated. + """ + user_message_id: str | None = ... + """ + The identifier of the conversation with which the plugin action is + associated. + """ + system_message_id: str | None = ... + """ + The identifier of an Amazon Q Business AI generated associated with the + action review event. + """ + plugin_id: str | None = ... + """The identifier of the plugin associated with the action review event.""" + plugin_type: str | None = ... + """The type of plugin.""" + payload: dict[str, ActionReviewPayloadField] | None = ... + """ + Field values that an end user needs to provide to Amazon Q Business for + Amazon Q Business to perform the requested plugin action. + """ + payload_field_name_separator: str | None = ... + """ + A string used to retain information about the hierarchical contexts + within an action review event payload. + """ + +@dataclass(kw_only=True) +class ActionReviewPayloadField(_SerdeShape): + """A user input field in an plugin action review payload.""" + + display_name: str | None = ... + """The name of the field.""" + display_order: int | None = ... + """The display order of fields in a payload.""" + display_description: str | None = ... + """ + The field level description of each action review input field. This + could be an explanation of the field. In the Amazon Q Business web + experience, these descriptions could be used to display as tool tips to + help users understand the field. + """ + type: str | None = ... + """The type of field.""" + value: _Document | None = ... + """The field value.""" + allowed_values: list[ActionReviewPayloadFieldAllowedValue] | None = ... + """ + Information about the field values that an end user can use to provide + to Amazon Q Business for Amazon Q Business to perform the requested + plugin action. + """ + allowed_format: str | None = ... + """ + The expected data format for the action review input field value. For + example, in PTO request, `from` and `to` would be of `datetime` allowed + format. + """ + array_item_json_schema: _Document | None = ... + """ + Use to create a custom form with array fields (fields with nested + objects inside an array). + """ + required: bool | None = ... + """Information about whether the field is required.""" + +@dataclass(kw_only=True) +class ActionReviewPayloadFieldAllowedValue(_SerdeShape): + """ + Information about the field values that an end user can use to provide + to Amazon Q Business for Amazon Q Business to perform the requested + plugin action. + """ + + value: _Document | None = ... + """The field value.""" + display_value: _Document | None = ... + """The name of the field.""" + +@dataclass(kw_only=True) +class ActionSummary(_SerdeShape): + """Summary information for an Amazon Q Business plugin action.""" + + action_identifier: str | None = ... + """The identifier of an Amazon Q Business plugin action.""" + display_name: str | None = ... + """ + The display name assigned by Amazon Q Business to a plugin action. You + can't modify this value. + """ + instruction_example: str | None = ... + """ + An Amazon Q Business suggested prompt and end user can use to invoke a + plugin action. This value can be modified and sent as input to initiate + an action. For example: + + - Create a Jira task + + - Create a chat assistant task to find the root cause of a specific + incident + """ + description: str | None = ... + """The description of an Amazon Q Business plugin action.""" + +@dataclass +class APISchemaPayload(_SerdeShape): + """ + The JSON or YAML-formatted payload defining the OpenAPI schema for a + custom plugin. + """ + + value: str + +@dataclass +class APISchemaS3(_SerdeShape): + """ + Contains details about the S3 object containing the OpenAPI schema for a + custom plugin. The schema could be in either JSON or YAML format. + """ + + value: S3 + +@dataclass +class APISchemaUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +APISchema = Union[APISchemaPayload | APISchemaS3 | APISchemaUnknown] +""" +Contains details about the OpenAPI schema for a custom plugin. For more +information, see [custom plugin OpenAPI +schemas](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/custom-plugin.html#plugins-api-schema). +You can either include the schema directly in the payload field or you +can upload it to an S3 bucket and specify the S3 bucket location in the +`s3` field. +""" + +class _APISchemaDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> APISchema: ... + +class APISchemaType(UnknownEnumMixin, StrEnum): + OPEN_API_V3 = "OPEN_API_V3" + +@dataclass(kw_only=True) +class Application(_SerdeShape): + """Summary information for an Amazon Q Business application.""" + + display_name: str | None = ... + """The name of the Amazon Q Business application.""" + application_id: str | None = ... + """The identifier for the Amazon Q Business application.""" + created_at: datetime | None = ... + """The Unix timestamp when the Amazon Q Business application was created.""" + updated_at: datetime | None = ... + """ + The Unix timestamp when the Amazon Q Business application was last + updated. + """ + status: str | None = ... + """ + The status of the Amazon Q Business application. The application is + ready to use when the status is `ACTIVE`. + """ + identity_type: str | None = ... + """The authentication type being used by a Amazon Q Business application.""" + quick_sight_configuration: QuickSightConfiguration | None = ... + """ + The Amazon Quick Suite configuration for an Amazon Q Business + application that uses Quick Suite as the identity provider. + """ + +class ApplicationStatus(UnknownEnumMixin, StrEnum): + CREATING = "CREATING" + ACTIVE = "ACTIVE" + DELETING = "DELETING" + FAILED = "FAILED" + UPDATING = "UPDATING" + +@dataclass(kw_only=True) +class AppliedAttachmentsConfiguration(_SerdeShape): + """ + Configuration information about the file upload during chat feature for + your application. + """ + + attachments_control_mode: str | None = ... + """ + Information about whether file upload during chat functionality is + activated for your application. + """ + +@dataclass(kw_only=True) +class AppliedCreatorModeConfiguration(_SerdeShape): + """ + The creator mode specific admin controls configured for an Amazon Q + Business application. Determines whether an end user can generate + LLM-only responses when they use the web experience. + + For more information, see [Admin controls and + guardrails](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/guardrails.html) + and [Conversation + settings](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/using-web-experience.html#chat-source-scope). + """ + + creator_mode_control: str + """ + Information about whether creator mode is enabled or disabled for an + Amazon Q Business application. + """ + +@dataclass(kw_only=True) +class AppliedOrchestrationConfiguration(_SerdeShape): + """ + The chat orchestration specific admin controls configured for an Amazon + Q Business application. Determines whether Amazon Q Business + automatically routes chat requests across configured plugins and data + sources in your Amazon Q Business application. + + For more information, see [Chat orchestration + settings](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/guardrails-global-controls.html#guardrails-global-orchestration). + """ + + control: str + """ + Information about whether chat orchestration is enabled or disabled for + an Amazon Q Business application. + """ + +@dataclass(kw_only=True) +class AssociatedGroup(_SerdeShape): + """ + Represents a group associated with a given user in the access control + system. + """ + + name: str | None = ... + """ + The name of the group associated with the user. This is used to identify + the group in access control decisions. + """ + type: str | None = ... + """ + The type of the associated group. This indicates the scope of the + group's applicability. + """ + +@dataclass(kw_only=True) +class AssociatedUser(_SerdeShape): + """Represents an associated user in the access control system.""" + + id: str | None = ... + """ + The unique identifier of the associated user. This is used to identify + the user in access control decisions. + """ + type: str | None = ... + """ + The type of the associated user. This indicates the scope of the user's + association. + """ + +@dataclass(kw_only=True) +class AssociatePermissionInput(_SerdeShape): + """Dataclass for AssociatePermissionInput structure.""" + + application_id: str | None = ... + """The unique identifier of the Amazon Q Business application.""" + statement_id: str | None = ... + """A unique identifier for the policy statement.""" + actions: list[str] | None = ... + """ + The list of Amazon Q Business actions that the ISV is allowed to + perform. + """ + conditions: list[PermissionCondition] | None = ... + """ + The conditions that restrict when the permission is effective. These + conditions can be used to limit the permission based on specific + attributes of the request. + """ + principal: str | None = ... + """ + The Amazon Resource Name of the IAM role for the ISV that is being + granted permission. + """ + +@dataclass(kw_only=True) +class AssociatePermissionOutput(_SerdeShape): + """Dataclass for AssociatePermissionOutput structure.""" + + statement: str | None = ... + """The JSON representation of the added permission statement.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class Attachment(_SerdeShape): + """An attachment in an Amazon Q Business conversation.""" + + attachment_id: str | None = ... + """The identifier of the Amazon Q Business attachment.""" + conversation_id: str | None = ... + """ + The identifier of the Amazon Q Business conversation the attachment is + associated with. + """ + name: str | None = ... + """Filename of the Amazon Q Business attachment.""" + copy_from: CopyFromSource | None = ... + """ + A CopyFromSource containing a reference to the original source of the + Amazon Q Business attachment. + """ + file_type: str | None = ... + """Filetype of the Amazon Q Business attachment.""" + file_size: int | None = ... + """Size in bytes of the Amazon Q Business attachment.""" + md5chksum: str | None = ... + """MD5 checksum of the Amazon Q Business attachment contents.""" + created_at: datetime | None = ... + """The Unix timestamp when the Amazon Q Business attachment was created.""" + status: str | None = ... + """AttachmentStatus of the Amazon Q Business attachment.""" + error: ErrorDetail | None = ... + """ + ErrorDetail providing information about a Amazon Q Business attachment + error. + """ + +@dataclass(kw_only=True) +class AttachmentInput(_SerdeShape): + """ + This is either a file directly uploaded into a web experience chat or a + reference to an existing attachment that is part of a web experience + chat. + """ + + data: bytes | None = ... + """The contents of the attachment.""" + name: str | None = ... + """The filename of the attachment.""" + copy_from: CopyFromSource | None = ... + """A reference to an existing attachment.""" + +@dataclass(kw_only=True) +class AttachmentInputEvent(_SerdeShape): + """ + A file input event activated by a end user request to upload files into + their web experience chat. + """ + + attachment: AttachmentInput | None = ... + """ + This is either a file directly uploaded into a web experience chat or a + reference to an existing attachment that is part of a web experience + chat. + """ + +@dataclass(kw_only=True) +class AttachmentOutput(_SerdeShape): + """The details of a file uploaded during chat.""" + + name: str | None = ... + """The name of a file uploaded during chat.""" + status: str | None = ... + """The status of a file uploaded during chat.""" + error: ErrorDetail | None = ... + """An error associated with a file uploaded during chat.""" + attachment_id: str | None = ... + """The unique identifier of the Amazon Q Business attachment.""" + conversation_id: str | None = ... + """The unique identifier of the Amazon Q Business conversation.""" + +@dataclass(kw_only=True) +class AttachmentsConfiguration(_SerdeShape): + """Configuration information for the file upload during chat feature.""" + + attachments_control_mode: str + """ + Status information about whether file upload functionality is activated + or deactivated for your end user. + """ + +class AttachmentsControlMode(UnknownEnumMixin, StrEnum): + ENABLED = "ENABLED" + DISABLED = "DISABLED" + +class AttachmentStatus(UnknownEnumMixin, StrEnum): + FAILED = "FAILED" + SUCCESS = "SUCCESS" + +@dataclass(kw_only=True) +class AttributeFilter(_SerdeShape): + """ + Enables filtering of responses based on document attributes or metadata + fields. + """ + + and_all_filters: list[AttributeFilter] | None = ... + """Performs a logical `AND` operation on all supplied filters.""" + or_all_filters: list[AttributeFilter] | None = ... + """Performs a logical `OR` operation on all supplied filters.""" + not_filter: AttributeFilter | None = ... + """Performs a logical `NOT` operation on all supplied filters.""" + equals_to: DocumentAttribute | None = ... + """ + Performs an equals operation on two document attributes or metadata + fields. Supported for the following [document attribute value + types](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_DocumentAttributeValue.html): + `dateValue`, `longValue`, `stringListValue` and `stringValue`. + """ + contains_all: DocumentAttribute | None = ... + """ + Returns `true` when a document contains all the specified document + attributes or metadata fields. Supported for the following [document + attribute value + types](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_DocumentAttributeValue.html): + `stringListValue`. + """ + contains_any: DocumentAttribute | None = ... + """ + Returns `true` when a document contains any of the specified document + attributes or metadata fields. Supported for the following [document + attribute value + types](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_DocumentAttributeValue.html): + `stringListValue`. + """ + greater_than: DocumentAttribute | None = ... + """ + Performs a greater than operation on two document attributes or metadata + fields. Supported for the following [document attribute value + types](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_DocumentAttributeValue.html): + `dateValue` and `longValue`. + """ + greater_than_or_equals: DocumentAttribute | None = ... + """ + Performs a greater or equals than operation on two document attributes + or metadata fields. Supported for the following [document attribute + value + types](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_DocumentAttributeValue.html): + `dateValue` and `longValue`. + """ + less_than: DocumentAttribute | None = ... + """ + Performs a less than operation on two document attributes or metadata + fields. Supported for the following [document attribute value + types](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_DocumentAttributeValue.html): + `dateValue` and `longValue`. + """ + less_than_or_equals: DocumentAttribute | None = ... + """ + Performs a less than or equals operation on two document attributes or + metadata fields.Supported for the following [document attribute value + type](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_DocumentAttributeValue.html): + `dateValue` and `longValue`. + """ + +class AttributeType(UnknownEnumMixin, StrEnum): + STRING = "STRING" + STRING_LIST = "STRING_LIST" + NUMBER = "NUMBER" + DATE = "DATE" + +class AttributeValueOperator(UnknownEnumMixin, StrEnum): + DELETE = "DELETE" + +@dataclass(kw_only=True) +class AudioExtractionConfiguration(_SerdeShape): + """Configuration settings for audio content extraction and processing.""" + + audio_extraction_status: str + """ + The status of audio extraction (ENABLED or DISABLED) for processing + audio content from files. + """ + +class AudioExtractionStatus(UnknownEnumMixin, StrEnum): + ENABLED = "ENABLED" + DISABLED = "DISABLED" + +class AudioExtractionType(UnknownEnumMixin, StrEnum): + TRANSCRIPT = "TRANSCRIPT" + SUMMARY = "SUMMARY" + +@dataclass(kw_only=True) +class AudioSourceDetails(_SerdeShape): + """ + Details about an audio source, including its identifier, format, and + time information. + """ + + media_id: str | None = ... + """Unique identifier for the audio media file.""" + media_mime_type: str | None = ... + """The MIME type of the audio file (e.g., audio/mp3, audio/wav).""" + start_time_milliseconds: int | None = ... + """The starting timestamp in milliseconds for the relevant audio segment.""" + end_time_milliseconds: int | None = ... + """The ending timestamp in milliseconds for the relevant audio segment.""" + audio_extraction_type: str | None = ... + """The type of audio extraction performed on the content.""" + +@dataclass(kw_only=True) +class AuthChallengeRequest(_SerdeShape): + """ + A request made by Amazon Q Business to a third paty authentication + server to authenticate a custom plugin user. + """ + + authorization_url: str + """ + The URL sent by Amazon Q Business to the third party authentication + server to authenticate a custom plugin user through an OAuth protocol. + """ + +@dataclass(kw_only=True) +class AuthChallengeRequestEvent(_SerdeShape): + """ + An authentication verification event activated by an end user request to + use a custom plugin. + """ + + authorization_url: str + """ + The URL sent by Amazon Q Business to a third party authentication server + in response to an authentication verification event activated by an end + user request to use a custom plugin. + """ + +@dataclass(kw_only=True) +class AuthChallengeResponse(_SerdeShape): + """ + Contains details of the authentication information received from a third + party authentication server in response to an authentication challenge. + """ + + response_map: dict[str, str] + """The mapping of key-value pairs in an authentication challenge response.""" + +@dataclass(kw_only=True) +class AuthChallengeResponseEvent(_SerdeShape): + """ + An authentication verification event response by a third party + authentication server to Amazon Q Business. + """ + + response_map: dict[str, str] + """The mapping of key-value pairs in an authentication challenge response.""" + +@dataclass(kw_only=True) +class AutoSubscriptionConfiguration(_SerdeShape): + """ + Subscription configuration information for an Amazon Q Business + application using IAM identity federation for user management. + """ + + auto_subscribe: str + """ + Describes whether automatic subscriptions are enabled for an Amazon Q + Business application using IAM identity federation for user management. + """ + default_subscription_type: str | None = ... + """ + Describes the default subscription type assigned to an Amazon Q Business + application using IAM identity federation for user management. If the + value for `autoSubscribe` is set to `ENABLED` you must select a value + for this field. + """ + +class AutoSubscriptionStatus(UnknownEnumMixin, StrEnum): + ENABLED = "ENABLED" + DISABLED = "DISABLED" + +@dataclass(kw_only=True) +class BasicAuthConfiguration(_SerdeShape): + """ + Information about the basic authentication credentials used to configure + a plugin. + """ + + secret_arn: str + """ + The ARN of the Secrets Manager secret that stores the basic + authentication credentials used for plugin configuration.. + """ + role_arn: str + """ + The ARN of an IAM role used by Amazon Q Business to access the basic + authentication credentials stored in a Secrets Manager secret. + """ + +@dataclass(kw_only=True) +class BatchDeleteDocumentInput(_SerdeShape): + """Dataclass for BatchDeleteDocumentInput structure.""" + + application_id: str | None = ... + """The identifier of the Amazon Q Business application.""" + index_id: str | None = ... + """ + The identifier of the Amazon Q Business index that contains the + documents to delete. + """ + documents: list[DeleteDocument] | None = ... + """Documents deleted from the Amazon Q Business index.""" + data_source_sync_id: str | None = ... + """ + The identifier of the data source sync during which the documents were + deleted. + """ + +@dataclass(kw_only=True) +class BatchDeleteDocumentOutput(_SerdeShape): + """Dataclass for BatchDeleteDocumentOutput structure.""" + + failed_documents: list[FailedDocument] | None = ... + """ + A list of documents that couldn't be removed from the Amazon Q Business + index. Each entry contains an error message that indicates why the + document couldn't be removed from the index. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class BatchPutDocumentInput(_SerdeShape): + """Dataclass for BatchPutDocumentInput structure.""" + + application_id: str | None = ... + """The identifier of the Amazon Q Business application.""" + index_id: str | None = ... + """The identifier of the Amazon Q Business index to add the documents to.""" + documents: list[Document] | None = ... + """ + One or more documents to add to the index. + + Warning: + Ensure that the name of your document doesn't contain any confidential + information. Amazon Q Business returns document names in chat responses + and citations when relevant. + """ + role_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of an IAM role with permission to access + your S3 bucket. + """ + data_source_sync_id: str | None = ... + """ + The identifier of the data source sync during which the documents were + added. + """ + +@dataclass(kw_only=True) +class BatchPutDocumentOutput(_SerdeShape): + """Dataclass for BatchPutDocumentOutput structure.""" + + failed_documents: list[FailedDocument] | None = ... + """ + A list of documents that were not added to the Amazon Q Business index + because the document failed a validation check. Each document contains + an error message that indicates why the document couldn't be added to + the index. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class BlockedPhrasesConfiguration(_SerdeShape): + """ + Provides information about the phrases blocked from chat by your chat + control configuration. + """ + + blocked_phrases: list[str] | None = ... + """ + A list of phrases blocked from a Amazon Q Business web experience chat. + + Note: + Each phrase can contain a maximum of 36 characters. The list can contain + a maximum of 20 phrases. + """ + system_message_override: str | None = ... + """ + The configured custom message displayed to an end user informing them + that they've used a blocked phrase during chat. + """ + +@dataclass(kw_only=True) +class BlockedPhrasesConfigurationUpdate(_SerdeShape): + """ + Updates a blocked phrases configuration in your Amazon Q Business + application. + """ + + blocked_phrases_to_create_or_update: list[str] | None = ... + """ + Creates or updates a blocked phrases configuration in your Amazon Q + Business application. + """ + blocked_phrases_to_delete: list[str] | None = ... + """ + Deletes a blocked phrases configuration in your Amazon Q Business + application. + """ + system_message_override: str | None = ... + """ + The configured custom message displayed to your end user when they use + blocked phrase during chat. + """ + +@dataclass(kw_only=True) +class BrowserExtensionConfiguration(_SerdeShape): + """ + The container for browser extension configuration for an Amazon Q + Business web experience. + """ + + enabled_browser_extensions: list[str] + """ + Specify the browser extensions allowed for your Amazon Q web experience. + + - `CHROME` --- Enables the extension for Chromium-based browsers (Google + Chrome, Microsoft Edge, Opera, etc.). + + - `FIREFOX` --- Enables the extension for Mozilla Firefox. + + - `CHROME` and `FIREFOX` --- Enable the extension for Chromium-based + browsers and Mozilla Firefox. + """ + +@dataclass(kw_only=True) +class CancelSubscriptionInput(_SerdeShape): + """Dataclass for CancelSubscriptionInput structure.""" + + application_id: str | None = ... + """ + The identifier of the Amazon Q Business application for which the + subscription is being cancelled. + """ + subscription_id: str | None = ... + """The identifier of the Amazon Q Business subscription being cancelled.""" + +@dataclass(kw_only=True) +class CancelSubscriptionOutput(_SerdeShape): + """Dataclass for CancelSubscriptionOutput structure.""" + + subscription_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the Amazon Q Business subscription + being cancelled. + """ + current_subscription: SubscriptionDetails | None = ... + """The type of your current Amazon Q Business subscription.""" + next_subscription: SubscriptionDetails | None = ... + """The type of the Amazon Q Business subscription for the next month.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ChatInput(_SerdeShape): + """Dataclass for ChatInput structure.""" + + application_id: str | None = ... + """ + The identifier of the Amazon Q Business application linked to a + streaming Amazon Q Business conversation. + """ + user_id: str | None = ... + """The identifier of the user attached to the chat input.""" + user_groups: list[str] | None = ... + """The group names that a user associated with the chat input belongs to.""" + conversation_id: str | None = ... + """The identifier of the Amazon Q Business conversation.""" + parent_message_id: str | None = ... + """ + The identifier used to associate a user message with a AI generated + response. + """ + client_token: str | None = ... + """A token that you provide to identify the chat input.""" + +@dataclass +class ChatInputStreamConfigurationEvent(_SerdeShape): + """ + A configuration event activated by an end user request to select a + specific chat mode. + """ + + value: ConfigurationEvent + +@dataclass +class ChatInputStreamTextEvent(_SerdeShape): + """ + Information about the payload of the `ChatInputStream` event containing + the end user message input. + """ + + value: TextInputEvent + +@dataclass +class ChatInputStreamAttachmentEvent(_SerdeShape): + """A request by an end user to upload a file during chat.""" + + value: AttachmentInputEvent + +@dataclass +class ChatInputStreamActionExecutionEvent(_SerdeShape): + """ + A request from an end user to perform an Amazon Q Business plugin + action. + """ + + value: ActionExecutionEvent + +@dataclass +class ChatInputStreamEndOfInputEvent(_SerdeShape): + """The end of the streaming input for the `Chat` API.""" + + value: EndOfInputEvent + +@dataclass +class ChatInputStreamAuthChallengeResponseEvent(_SerdeShape): + """ + An authentication verification event response by a third party + authentication server to Amazon Q Business. + """ + + value: AuthChallengeResponseEvent + +@dataclass +class ChatInputStreamUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ChatInputStream = Union[ + ChatInputStreamConfigurationEvent + | ChatInputStreamTextEvent + | ChatInputStreamAttachmentEvent + | ChatInputStreamActionExecutionEvent + | ChatInputStreamEndOfInputEvent + | ChatInputStreamAuthChallengeResponseEvent + | ChatInputStreamUnknown +] +"""The streaming input for the `Chat` API.""" + +class _ChatInputStreamDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> ChatInputStream: ... + +class ChatMode(UnknownEnumMixin, StrEnum): + RETRIEVAL_MODE = "RETRIEVAL_MODE" + CREATOR_MODE = "CREATOR_MODE" + PLUGIN_MODE = "PLUGIN_MODE" + +@dataclass +class ChatModeConfigurationPluginConfiguration(_SerdeShape): + """Configuration information required to invoke chat in `PLUGIN_MODE`.""" + + value: PluginConfiguration + +@dataclass +class ChatModeConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ChatModeConfiguration = Union[ + ChatModeConfigurationPluginConfiguration | ChatModeConfigurationUnknown +] +""" +Configuration information for Amazon Q Business conversation modes. + +For more information, see [Admin controls and +guardrails](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/guardrails.html) +and [Conversation +settings](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/using-web-experience.html#chat-source-scope). +""" + +class _ChatModeConfigurationDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> ChatModeConfiguration: ... + +@dataclass(kw_only=True) +class ChatOutput(_SerdeShape): + """Dataclass for ChatOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass +class ChatOutputStreamTextEvent(_SerdeShape): + """ + Information about the payload of the `ChatOutputStream` event containing + the AI-generated message output. + """ + + value: TextOutputEvent + +@dataclass +class ChatOutputStreamMetadataEvent(_SerdeShape): + """ + A metadata event for a AI-generated text output message in a Amazon Q + Business conversation. + """ + + value: MetadataEvent + +@dataclass +class ChatOutputStreamActionReviewEvent(_SerdeShape): + """ + A request from Amazon Q Business to the end user for information Amazon + Q Business needs to successfully complete a requested plugin action. + """ + + value: ActionReviewEvent + +@dataclass +class ChatOutputStreamFailedAttachmentEvent(_SerdeShape): + """A failed file upload event during a web experience chat.""" + + value: FailedAttachmentEvent + +@dataclass +class ChatOutputStreamAuthChallengeRequestEvent(_SerdeShape): + """ + An authentication verification event activated by an end user request to + use a custom plugin. + """ + + value: AuthChallengeRequestEvent + +@dataclass +class ChatOutputStreamUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ChatOutputStream = Union[ + ChatOutputStreamTextEvent + | ChatOutputStreamMetadataEvent + | ChatOutputStreamActionReviewEvent + | ChatOutputStreamFailedAttachmentEvent + | ChatOutputStreamAuthChallengeRequestEvent + | ChatOutputStreamUnknown +] +"""The streaming output for the `Chat` API.""" + +class _ChatOutputStreamDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> ChatOutputStream: ... + +@dataclass(kw_only=True) +class ChatResponseConfiguration(_SerdeShape): + """ + Configuration details that define how Amazon Q Business generates and + formats responses to user queries in chat interactions. This + configuration allows administrators to customize response + characteristics to meet specific organizational needs and communication + standards. + """ + + chat_response_configuration_id: str + """ + A unique identifier for your chat response configuration settings, used + to reference and manage the configuration within the Amazon Q Business + service. + """ + chat_response_configuration_arn: str + """ + The Amazon Resource Name (ARN) of the chat response configuration, which + uniquely identifies the resource across all Amazon Web Services services + and accounts. + """ + display_name: str + """ + A human-readable name for the chat response configuration, making it + easier to identify and manage multiple configurations within an + organization. + """ + response_configuration_summary: str | None = ... + """ + A summary of the response configuration settings, providing a concise + overview of the key parameters that define how responses are generated + and formatted. + """ + status: str + """ + The current status of the chat response configuration, indicating + whether it is active, pending, or in another state that affects its + availability for use in chat interactions. + """ + created_at: datetime | None = ... + """ + The timestamp indicating when the chat response configuration was + initially created, useful for tracking the lifecycle of configuration + resources. + """ + updated_at: datetime | None = ... + """ + The timestamp indicating when the chat response configuration was last + modified, helping administrators track changes and maintain version + awareness. + """ + +@dataclass(kw_only=True) +class ChatResponseConfigurationDetail(_SerdeShape): + """ + Detailed information about a chat response configuration, including + comprehensive settings and parameters that define how Amazon Q Business + generates and formats responses. + """ + + response_configurations: dict[str, ResponseConfiguration] | None = ... + """ + A collection of specific response configuration settings that + collectively define how responses are generated, formatted, and + presented to users in chat interactions. + """ + response_configuration_summary: str | None = ... + """ + A summary of the response configuration details, providing a concise + overview of the key parameters and settings that define the response + generation behavior. + """ + status: str | None = ... + """ + The current status of the chat response configuration, indicating + whether it is active, pending, or in another state that affects its + availability for use. + """ + error: ErrorDetail | None = ... + """Provides information about a Amazon Q Business request error.""" + updated_at: datetime | None = ... + """ + The timestamp indicating when the detailed chat response configuration + was last modified, helping administrators track changes and maintain + version awareness. + """ + +class ChatResponseConfigurationStatus(UnknownEnumMixin, StrEnum): + CREATING = "CREATING" + UPDATING = "UPDATING" + FAILED = "FAILED" + ACTIVE = "ACTIVE" + +@dataclass(kw_only=True) +class ChatSyncInput(_SerdeShape): + """Dataclass for ChatSyncInput structure.""" + + application_id: str | None = ... + """ + The identifier of the Amazon Q Business application linked to the Amazon + Q Business conversation. + """ + user_id: str | None = ... + """The identifier of the user attached to the chat input.""" + user_groups: list[str] | None = ... + """The group names that a user associated with the chat input belongs to.""" + user_message: str | None = ... + """A end user message in a conversation.""" + attachments: list[AttachmentInput] | None = ... + """ + A list of files uploaded directly during chat. You can upload a maximum + of 5 files of upto 10 MB each. + """ + action_execution: ActionExecution | None = ... + """ + A request from an end user to perform an Amazon Q Business plugin + action. + """ + auth_challenge_response: AuthChallengeResponse | None = ... + """ + An authentication verification event response by a third party + authentication server to Amazon Q Business. + """ + conversation_id: str | None = ... + """The identifier of the Amazon Q Business conversation.""" + parent_message_id: str | None = ... + """The identifier of the previous system message in a conversation.""" + attribute_filter: AttributeFilter | None = ... + """ + Enables filtering of Amazon Q Business web experience responses based on + document attributes or metadata fields. + """ + chat_mode: str | None = ... + """ + The `chatMode` parameter determines the chat modes available to Amazon Q + Business users: + + - `RETRIEVAL_MODE` - If you choose this mode, Amazon Q generates + responses solely from the data sources connected and indexed by the + application. If an answer is not found in the data sources or there + are no data sources available, Amazon Q will respond with a \"*No + Answer Found*\" message, unless LLM knowledge has been enabled. In + that case, Amazon Q will generate a response from the LLM knowledge + + - `CREATOR_MODE` - By selecting this mode, you can choose to generate + responses only from the LLM knowledge. You can also attach files and + have Amazon Q generate a response based on the data in those files. If + the attached files do not contain an answer for the query, Amazon Q + will automatically fall back to generating a response from the LLM + knowledge. + + - `PLUGIN_MODE` - By selecting this mode, users can choose to use + plugins in chat to get their responses. + + Note: + If none of the modes are selected, Amazon Q will only respond using the + information from the attached files. + + For more information, see [Admin controls and + guardrails](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/guardrails.html), + [Plugins](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/plugins.html), + and [Response + sources](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/using-web-experience.html#chat-source-scope). + """ + chat_mode_configuration: ChatModeConfiguration | None = ... + """The chat mode configuration for an Amazon Q Business application.""" + client_token: str | None = ... + """A token that you provide to identify a chat request.""" + +@dataclass(kw_only=True) +class ChatSyncOutput(_SerdeShape): + """Dataclass for ChatSyncOutput structure.""" + + conversation_id: str | None = ... + """The identifier of the Amazon Q Business conversation.""" + system_message: str | None = ... + """An AI-generated message in a conversation.""" + system_message_id: str | None = ... + """ + The identifier of an Amazon Q Business AI generated message within the + conversation. + """ + user_message_id: str | None = ... + """ + The identifier of an Amazon Q Business end user text input message + within the conversation. + """ + action_review: ActionReview | None = ... + """ + A request from Amazon Q Business to the end user for information Amazon + Q Business needs to successfully complete a requested plugin action. + """ + auth_challenge_request: AuthChallengeRequest | None = ... + """ + An authentication verification event activated by an end user request to + use a custom plugin. + """ + source_attributions: list[SourceAttribution | None] | None = ... + """The source documents used to generate the conversation response.""" + failed_attachments: list[AttachmentOutput] | None = ... + """A list of files which failed to upload during chat.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CheckDocumentAccessInput(_SerdeShape): + """Dataclass for CheckDocumentAccessInput structure.""" + + application_id: str | None = ... + """ + The unique identifier of the application. This is required to identify + the specific Amazon Q Business application context for the document + access check. + """ + index_id: str | None = ... + """ + The unique identifier of the index. Used to locate the correct index + within the application where the document is stored. + """ + user_id: str | None = ... + """ + The unique identifier of the user. Used to check the access permissions + for this specific user against the document's ACL. + """ + document_id: str | None = ... + """ + The unique identifier of the document. Specifies which document's + access permissions are being checked. + """ + data_source_id: str | None = ... + """ + The unique identifier of the data source. Identifies the specific data + source from which the document originates. Should not be used when a + document is uploaded directly with BatchPutDocument, as no dataSourceId + is available or necessary. + """ + +@dataclass(kw_only=True) +class CheckDocumentAccessOutput(_SerdeShape): + """Dataclass for CheckDocumentAccessOutput structure.""" + + user_groups: list[AssociatedGroup] | None = ... + """ + An array of groups the user is part of for the specified data source. + Each group has a name and type. + """ + user_aliases: list[AssociatedUser] | None = ... + """ + An array of aliases associated with the user. This includes both global + and local aliases, each with a name and type. + """ + has_access: bool | None = ... + """ + A boolean value indicating whether the specified user has access to the + document, either direct access or transitive access via groups and + aliases attached to the document. + """ + document_acl: DocumentAcl | None = ... + """ + The Access Control List (ACL) associated with the document. Includes + allowlist and denylist conditions that determine user access. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ConfigurationEvent(_SerdeShape): + """ + A configuration event activated by an end user request to select a + specific chat mode. + """ + + chat_mode: str | None = ... + """ + The chat modes available to an Amazon Q Business end user. + + - `RETRIEVAL_MODE` - The default chat mode for an Amazon Q Business + application. When this mode is enabled, Amazon Q Business generates + responses only from data sources connected to an Amazon Q Business + application. + + - `CREATOR_MODE` - By selecting this mode, users can choose to generate + responses only from the LLM knowledge, without consulting connected + data sources, for a chat request. + + - `PLUGIN_MODE` - By selecting this mode, users can choose to use + plugins in chat. + + For more information, see [Admin controls and + guardrails](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/guardrails.html), + [Plugins](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/plugins.html), + and [Conversation + settings](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/using-web-experience.html#chat-source-scope). + """ + chat_mode_configuration: ChatModeConfiguration | None = ... + """ + Configuration information for Amazon Q Business conversation modes. + + For more information, see [Admin controls and + guardrails](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/guardrails.html) + and [Conversation + settings](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/using-web-experience.html#chat-source-scope). + """ + attribute_filter: AttributeFilter | None = ... + """ + Enables filtering of responses based on document attributes or metadata + fields. + """ + +@dataclass(kw_only=True) +class ConflictException(ServiceError, _SerdeShape): + """ + You are trying to perform an action that conflicts with the current + status of your resource. Fix any inconsistencies with your resources and + try again. + """ + + resource_id: str + """The identifier of the resource affected.""" + resource_type: str + """The type of the resource affected.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ContentBlockerRule(_SerdeShape): + """ + A rule for configuring how Amazon Q Business responds when it encounters + a a blocked topic. You can configure a custom message to inform your end + users that they have asked about a restricted topic and suggest any next + steps they should take. + """ + + system_message_override: str | None = ... + """ + The configured custom message displayed to an end user informing them + that they've used a blocked phrase during chat. + """ + +@dataclass(kw_only=True) +class ContentRetrievalRule(_SerdeShape): + """ + Rules for retrieving content from data sources connected to a Amazon Q + Business application for a specific topic control configuration. + """ + + eligible_data_sources: list[EligibleDataSource] | None = ... + """ + Specifies data sources in a Amazon Q Business application to use for + content generation. + """ + +@dataclass +class ContentSourceRetriever(_SerdeShape): + """The retriever to use as the content source.""" + + value: RetrieverContentSource + +@dataclass +class ContentSourceUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ContentSource = Union[ContentSourceRetriever | ContentSourceUnknown] +"""Specifies the source of content to search in.""" + +class _ContentSourceDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> ContentSource: ... + +class ContentType(UnknownEnumMixin, StrEnum): + PDF = "PDF" + HTML = "HTML" + MS_WORD = "MS_WORD" + PLAIN_TEXT = "PLAIN_TEXT" + PPT = "PPT" + RTF = "RTF" + XML = "XML" + XSLT = "XSLT" + MS_EXCEL = "MS_EXCEL" + CSV = "CSV" + JSON = "JSON" + MD = "MD" + +@dataclass(kw_only=True) +class Conversation(_SerdeShape): + """A conversation in an Amazon Q Business application.""" + + conversation_id: str | None = ... + """The identifier of the Amazon Q Business conversation.""" + title: str | None = ... + """The title of the conversation.""" + start_time: datetime | None = ... + """The start time of the conversation.""" + +@dataclass(kw_only=True) +class ConversationSource(_SerdeShape): + """ + The source reference for an existing attachment in an existing + conversation. + """ + + conversation_id: str + """The unique identifier of the Amazon Q Business conversation.""" + attachment_id: str + """The unique identifier of the Amazon Q Business attachment.""" + +@dataclass +class CopyFromSourceConversation(_SerdeShape): + """A reference to an attachment in an existing conversation.""" + + value: ConversationSource + +@dataclass +class CopyFromSourceUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +CopyFromSource = Union[CopyFromSourceConversation | CopyFromSourceUnknown] +"""The source reference for an existing attachment.""" + +class _CopyFromSourceDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> CopyFromSource: ... + +@dataclass(kw_only=True) +class CreateAnonymousWebExperienceUrlInput(_SerdeShape): + """Dataclass for CreateAnonymousWebExperienceUrlInput structure.""" + + application_id: str | None = ... + """ + The identifier of the Amazon Q Business application environment attached + to the web experience. + """ + web_experience_id: str | None = ... + """The identifier of the web experience.""" + session_duration_in_minutes: int | None = ... + """ + The duration of the session associated with the unique URL for the web + experience. + """ + +@dataclass(kw_only=True) +class CreateAnonymousWebExperienceUrlOutput(_SerdeShape): + """Dataclass for CreateAnonymousWebExperienceUrlOutput structure.""" + + anonymous_url: str | None = ... + """ + The unique URL for accessing the web experience. + + Warning: + This URL can only be used once and must be used within 5 minutes after + it's generated. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateApplicationInput(_SerdeShape): + """Dataclass for CreateApplicationInput structure.""" + + display_name: str | None = ... + """A name for the Amazon Q Business application.""" + role_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of an IAM role with permissions to access + your Amazon CloudWatch logs and metrics. If this property is not + specified, Amazon Q Business will create a [service linked role + (SLR)](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/using-service-linked-roles.html#slr-permissions) + and use it as the application's role. + """ + identity_type: str | None = ... + """The authentication type being used by a Amazon Q Business application.""" + iam_identity_provider_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of an identity provider being used by an + Amazon Q Business application. + """ + identity_center_instance_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the IAM Identity Center instance you + are either creating for---or connecting to---your Amazon Q Business + application. + """ + client_ids_for_oidc: list[str] | None = ... + """The OIDC client ID for a Amazon Q Business application.""" + description: str | None = ... + """A description for the Amazon Q Business application.""" + encryption_configuration: EncryptionConfiguration | None = ... + """ + The identifier of the KMS key that is used to encrypt your data. Amazon + Q Business doesn't support asymmetric keys. + """ + tags: list[Tag] | None = ... + """ + A list of key-value pairs that identify or categorize your Amazon Q + Business application. You can also use tags to help control access to + the application. Tag keys and values can consist of Unicode letters, + digits, white space, and any of the following symbols: _ . : / = + - @. + """ + client_token: str | None = ... + """ + A token that you provide to identify the request to create your Amazon Q + Business application. + """ + attachments_configuration: AttachmentsConfiguration | None = ... + """An option to allow end users to upload files directly during chat.""" + q_apps_configuration: QAppsConfiguration | None = ... + """ + An option to allow end users to create and use Amazon Q Apps in the web + experience. + """ + personalization_configuration: PersonalizationConfiguration | None = ... + """ + Configuration information about chat response personalization. For more + information, see [Personalizing chat + responses](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/personalizing-chat-responses.html) + """ + quick_sight_configuration: QuickSightConfiguration | None = ... + """ + The Amazon Quick Suite configuration for an Amazon Q Business + application that uses Quick Suite for authentication. This configuration + is required if your application uses Quick Suite as the identity + provider. For more information, see [Creating an Amazon Quick Suite + integrated + application](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/create-quicksight-integrated-application.html). + """ + +@dataclass(kw_only=True) +class CreateApplicationOutput(_SerdeShape): + """Dataclass for CreateApplicationOutput structure.""" + + application_id: str | None = ... + """The identifier of the Amazon Q Business application.""" + application_arn: str | None = ... + """The Amazon Resource Name (ARN) of the Amazon Q Business application.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateChatResponseConfigurationInput(_SerdeShape): + """Dataclass for CreateChatResponseConfigurationInput structure.""" + + application_id: str | None = ... + """ + The unique identifier of the Amazon Q Business application for which to + create the new chat response configuration. + """ + display_name: str | None = ... + """ + A human-readable name for the new chat response configuration, making it + easier to identify and manage among multiple configurations. + """ + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure idempotency of the + request. This helps prevent the same configuration from being created + multiple times if retries occur. + """ + response_configurations: dict[str, ResponseConfiguration] | None = ... + """ + A collection of response configuration settings that define how Amazon Q + Business will generate and format responses to user queries in chat + interactions. + """ + tags: list[Tag] | None = ... + """ + A list of key-value pairs to apply as tags to the new chat response + configuration, enabling categorization and management of resources + across Amazon Web Services services. + """ + +@dataclass(kw_only=True) +class CreateChatResponseConfigurationOutput(_SerdeShape): + """Dataclass for CreateChatResponseConfigurationOutput structure.""" + + chat_response_configuration_id: str + """ + The unique identifier assigned to a newly created chat response + configuration, used for subsequent operations on this resource. + """ + chat_response_configuration_arn: str + """ + The Amazon Resource Name (ARN) of the newly created chat response + configuration, which uniquely identifies the resource across all Amazon + Web Services services. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateDataAccessorInput(_SerdeShape): + """Dataclass for CreateDataAccessorInput structure.""" + + application_id: str | None = ... + """The unique identifier of the Amazon Q Business application.""" + principal: str | None = ... + """ + The Amazon Resource Name (ARN) of the IAM role for the ISV that will be + accessing the data. + """ + action_configurations: list[ActionConfiguration] | None = ... + """ + A list of action configurations specifying the allowed actions and any + associated filters. + """ + client_token: str | None = ... + """ + A unique, case-sensitive identifier you provide to ensure idempotency of + the request. + """ + display_name: str | None = ... + """A friendly name for the data accessor.""" + authentication_detail: DataAccessorAuthenticationDetail | None = ... + """ + The authentication configuration details for the data accessor. This + specifies how the ISV will authenticate when accessing data through this + data accessor. + """ + tags: list[Tag] | None = ... + """The tags to associate with the data accessor.""" + +@dataclass(kw_only=True) +class CreateDataAccessorOutput(_SerdeShape): + """Dataclass for CreateDataAccessorOutput structure.""" + + data_accessor_id: str + """The unique identifier of the created data accessor.""" + idc_application_arn: str + """ + The Amazon Resource Name (ARN) of the IAM Identity Center application + created for this data accessor. + """ + data_accessor_arn: str + """The Amazon Resource Name (ARN) of the created data accessor.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateDataSourceInput(_SerdeShape): + """Dataclass for CreateDataSourceInput structure.""" + + application_id: str | None = ... + """ + The identifier of the Amazon Q Business application the data source will + be attached to. + """ + index_id: str | None = ... + """ + The identifier of the index that you want to use with the data source + connector. + """ + display_name: str | None = ... + """A name for the data source connector.""" + configuration: _Document | None = ... + """ + Configuration information to connect your data source repository to + Amazon Q Business. Use this parameter to provide a JSON schema with + configuration information specific to your data source connector. + + Each data source has a JSON schema provided by Amazon Q Business that + you must use. For example, the Amazon S3 and Web Crawler connectors + require the following JSON schemas: + + - [Amazon S3 JSON + schema](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/s3-api.html) + + - [Web Crawler JSON + schema](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/web-crawler-api.html) + + You can find configuration templates for your specific data source using + the following steps: + + 1. Navigate to the [Supported + connectors](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/connectors-list.html) + page in the Amazon Q Business User Guide, and select the data source + of your choice. + + 2. Then, from your specific data source connector page, select **Using + the API**. You will find the JSON schema for your data source, + including parameter descriptions, in this section. + """ + vpc_configuration: DataSourceVpcConfiguration | None = ... + """ + Configuration information for an Amazon VPC (Virtual Private Cloud) to + connect to your data source. For more information, see [Using Amazon VPC + with Amazon Q Business + connectors](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/connector-vpc.html). + """ + description: str | None = ... + """A description for the data source connector.""" + tags: list[Tag] | None = ... + """ + A list of key-value pairs that identify or categorize the data source + connector. You can also use tags to help control access to the data + source connector. Tag keys and values can consist of Unicode letters, + digits, white space, and any of the following symbols: _ . : / = + - @. + """ + sync_schedule: str | None = ... + """ + Sets the frequency for Amazon Q Business to check the documents in your + data source repository and update your index. If you don't set a + schedule, Amazon Q Business won't periodically update the index. + + Specify a `cron-` format schedule string or an empty string to indicate + that the index is updated on demand. You can't specify the `Schedule` + parameter when the `Type` parameter is set to `CUSTOM`. If you do, you + receive a `ValidationException` exception. + """ + role_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of an IAM role with permission to access + the data source and required resources. This field is required for all + connector types except custom connectors, where it is optional. + """ + client_token: str | None = ... + """ + A token you provide to identify a request to create a data source + connector. Multiple calls to the `CreateDataSource` API with the same + client token will create only one data source connector. + """ + document_enrichment_configuration: DocumentEnrichmentConfiguration | None = ... + """ + Provides the configuration information for altering document metadata + and content during the document ingestion process. + + For more information, see [Custom document + enrichment](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/custom-document-enrichment.html). + """ + media_extraction_configuration: MediaExtractionConfiguration | None = ... + """ + The configuration for extracting information from media in documents + during ingestion. + """ + +@dataclass(kw_only=True) +class CreateDataSourceOutput(_SerdeShape): + """Dataclass for CreateDataSourceOutput structure.""" + + data_source_id: str | None = ... + """The identifier of the data source connector.""" + data_source_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of a data source in an Amazon Q Business + application. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateIndexInput(_SerdeShape): + """Dataclass for CreateIndexInput structure.""" + + application_id: str | None = ... + """The identifier of the Amazon Q Business application using the index.""" + display_name: str | None = ... + """A name for the Amazon Q Business index.""" + description: str | None = ... + """A description for the Amazon Q Business index.""" + type: str | None = ... + """ + The index type that's suitable for your needs. For more information on + what's included in each type of index, see [Amazon Q Business + tiers](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/tiers.html#index-tiers). + """ + tags: list[Tag] | None = ... + """ + A list of key-value pairs that identify or categorize the index. You can + also use tags to help control access to the index. Tag keys and values + can consist of Unicode letters, digits, white space, and any of the + following symbols: _ . : / = + - @. + """ + capacity_configuration: IndexCapacityConfiguration | None = ... + """ + The capacity units you want to provision for your index. You can add and + remove capacity to fit your usage needs. + """ + client_token: str | None = ... + """ + A token that you provide to identify the request to create an index. + Multiple calls to the `CreateIndex` API with the same client token will + create only one index. + """ + +@dataclass(kw_only=True) +class CreateIndexOutput(_SerdeShape): + """Dataclass for CreateIndexOutput structure.""" + + index_id: str | None = ... + """The identifier for the Amazon Q Business index.""" + index_arn: str | None = ... + """The Amazon Resource Name (ARN) of an Amazon Q Business index.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreatePluginInput(_SerdeShape): + """Dataclass for CreatePluginInput structure.""" + + application_id: str | None = ... + """The identifier of the application that will contain the plugin.""" + display_name: str | None = ... + """A the name for your plugin.""" + type: str | None = ... + """The type of plugin you want to create.""" + auth_configuration: PluginAuthConfiguration | None = ... + """ + Authentication configuration information for an Amazon Q Business + plugin. + """ + server_url: str | None = ... + """The source URL used for plugin configuration.""" + custom_plugin_configuration: CustomPluginConfiguration | None = ... + """Contains configuration for a custom plugin.""" + tags: list[Tag] | None = ... + """ + A list of key-value pairs that identify or categorize the data source + connector. You can also use tags to help control access to the data + source connector. Tag keys and values can consist of Unicode letters, + digits, white space, and any of the following symbols: _ . : / = + - @. + """ + client_token: str | None = ... + """ + A token that you provide to identify the request to create your Amazon Q + Business plugin. + """ + +@dataclass(kw_only=True) +class CreatePluginOutput(_SerdeShape): + """Dataclass for CreatePluginOutput structure.""" + + plugin_id: str | None = ... + """The identifier of the plugin created.""" + plugin_arn: str | None = ... + """The Amazon Resource Name (ARN) of a plugin.""" + build_status: str | None = ... + """The current status of a plugin. A plugin is modified asynchronously.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateRetrieverInput(_SerdeShape): + """Dataclass for CreateRetrieverInput structure.""" + + application_id: str | None = ... + """The identifier of your Amazon Q Business application.""" + type: str | None = ... + """The type of retriever you are using.""" + display_name: str | None = ... + """The name of your retriever.""" + configuration: RetrieverConfiguration | None = ... + """ + Provides information on how the retriever used for your Amazon Q + Business application is configured. + """ + role_arn: str | None = ... + """ + The ARN of an IAM role used by Amazon Q Business to access the basic + authentication credentials stored in a Secrets Manager secret. + """ + client_token: str | None = ... + """ + A token that you provide to identify the request to create your Amazon Q + Business application retriever. + """ + tags: list[Tag] | None = ... + """ + A list of key-value pairs that identify or categorize the retriever. You + can also use tags to help control access to the retriever. Tag keys and + values can consist of Unicode letters, digits, white space, and any of + the following symbols: _ . : / = + - @. + """ + +@dataclass(kw_only=True) +class CreateRetrieverOutput(_SerdeShape): + """Dataclass for CreateRetrieverOutput structure.""" + + retriever_id: str | None = ... + """The identifier of the retriever you are using.""" + retriever_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of an IAM role associated with a + retriever. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateSubscriptionInput(_SerdeShape): + """Dataclass for CreateSubscriptionInput structure.""" + + application_id: str | None = ... + """ + The identifier of the Amazon Q Business application the subscription + should be added to. + """ + principal: SubscriptionPrincipal | None = ... + """ + The IAM Identity Center `UserId` or `GroupId` of a user or group in the + IAM Identity Center instance connected to the Amazon Q Business + application. + """ + type: str | None = ... + """The type of Amazon Q Business subscription you want to create.""" + client_token: str | None = ... + """ + A token that you provide to identify the request to create a + subscription for your Amazon Q Business application. + """ + +@dataclass(kw_only=True) +class CreateSubscriptionOutput(_SerdeShape): + """Dataclass for CreateSubscriptionOutput structure.""" + + subscription_id: str | None = ... + """The identifier of the Amazon Q Business subscription created.""" + subscription_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the Amazon Q Business subscription + created. + """ + current_subscription: SubscriptionDetails | None = ... + """The type of your current Amazon Q Business subscription.""" + next_subscription: SubscriptionDetails | None = ... + """The type of the Amazon Q Business subscription for the next month.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateUserInput(_SerdeShape): + """Dataclass for CreateUserInput structure.""" + + application_id: str | None = ... + """ + The identifier of the application for which the user mapping will be + created. + """ + user_id: str | None = ... + """The user emails attached to a user mapping.""" + user_aliases: list[UserAlias] | None = ... + """The list of user aliases in the mapping.""" + client_token: str | None = ... + """ + A token that you provide to identify the request to create your Amazon Q + Business user mapping. + """ + +@dataclass(kw_only=True) +class CreateUserOutput(_SerdeShape): + """Dataclass for CreateUserOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateWebExperienceInput(_SerdeShape): + """Dataclass for CreateWebExperienceInput structure.""" + + application_id: str | None = ... + """The identifier of the Amazon Q Business web experience.""" + title: str | None = ... + """The title for your Amazon Q Business web experience.""" + subtitle: str | None = ... + """A subtitle to personalize your Amazon Q Business web experience.""" + welcome_message: str | None = ... + """ + The customized welcome message for end users of an Amazon Q Business web + experience. + """ + sample_prompts_control_mode: str | None = ... + """ + Determines whether sample prompts are enabled in the web experience for + an end user. + """ + origins: list[str] | None = ... + """ + Sets the website domain origins that are allowed to embed the Amazon Q + Business web experience. The *domain origin* refers to the base URL for + accessing a website including the protocol (`http/https`), the domain + name, and the port number (if specified). + + Note: + You must only submit a *base URL* and not a full path. For example, + `https://docs.aws.amazon.com`. + """ + role_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the service role attached to your web + experience. + + Note: + The `roleArn` parameter is required when your Amazon Q Business + application is created with IAM Identity Center. It is not required for + SAML-based applications. + """ + tags: list[Tag] | None = ... + """ + A list of key-value pairs that identify or categorize your Amazon Q + Business web experience. You can also use tags to help control access to + the web experience. Tag keys and values can consist of Unicode letters, + digits, white space, and any of the following symbols: _ . : / = + - @. + """ + client_token: str | None = ... + """ + A token you provide to identify a request to create an Amazon Q Business + web experience. + """ + identity_provider_configuration: IdentityProviderConfiguration | None = ... + """ + Information about the identity provider (IdP) used to authenticate end + users of an Amazon Q Business web experience. + """ + browser_extension_configuration: BrowserExtensionConfiguration | None = ... + """ + The browser extension configuration for an Amazon Q Business web + experience. + + Note: + For Amazon Q Business application using external OIDC-compliant identity + providers (IdPs). The IdP administrator must add the browser extension + sign-in redirect URLs to the IdP application. For more information, see + [Configure external OIDC identity provider for your browser + extensions.](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/browser-extensions.html). + """ + customization_configuration: CustomizationConfiguration | None = ... + """ + Sets the custom logo, favicon, font, and color used in the Amazon Q web + experience. + """ + +@dataclass(kw_only=True) +class CreateWebExperienceOutput(_SerdeShape): + """Dataclass for CreateWebExperienceOutput structure.""" + + web_experience_id: str | None = ... + """The identifier of the Amazon Q Business web experience.""" + web_experience_arn: str | None = ... + """The Amazon Resource Name (ARN) of an Amazon Q Business web experience.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreatorModeConfiguration(_SerdeShape): + """ + Configuration information required to invoke chat in `CREATOR_MODE`. + + For more information, see [Admin controls and + guardrails](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/guardrails.html) + and [Conversation + settings](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/using-web-experience.html#chat-source-scope). + """ + + creator_mode_control: str + """ + Status information about whether `CREATOR_MODE` has been enabled or + disabled. The default status is `DISABLED`. + """ + +class CreatorModeControl(UnknownEnumMixin, StrEnum): + ENABLED = "ENABLED" + DISABLED = "DISABLED" + +@dataclass(kw_only=True) +class CustomizationConfiguration(_SerdeShape): + """ + Contains the configuration information to customize the logo, font, and + color of an Amazon Q Business web experience with individual files for + each property or a CSS file for them all. + """ + + custom_css_url: str | None = ... + """ + Provides the URL where the custom CSS file is hosted for an Amazon Q web + experience. + """ + logo_url: str | None = ... + """ + Provides the URL where the custom logo file is hosted for an Amazon Q + web experience. + """ + font_url: str | None = ... + """ + Provides the URL where the custom font file is hosted for an Amazon Q + web experience. + """ + favicon_url: str | None = ... + """ + Provides the URL where the custom favicon file is hosted for an Amazon Q + web experience. + """ + +@dataclass(kw_only=True) +class CustomPluginConfiguration(_SerdeShape): + """Configuration information required to create a custom plugin.""" + + description: str + """A description for your custom plugin configuration.""" + api_schema_type: str + """The type of OpenAPI schema to use.""" + api_schema: APISchema | None = ... + """ + Contains either details about the S3 object containing the OpenAPI + schema for the action group or the JSON or YAML-formatted payload + defining the schema. + """ + +@dataclass(kw_only=True) +class DataAccessor(_SerdeShape): + """Provides summary information about a data accessor.""" + + display_name: str | None = ... + """The friendly name of the data accessor.""" + data_accessor_id: str | None = ... + """The unique identifier of the data accessor.""" + data_accessor_arn: str | None = ... + """The Amazon Resource Name (ARN) of the data accessor.""" + idc_application_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the associated IAM Identity Center + application. + """ + principal: str | None = ... + """ + The Amazon Resource Name (ARN) of the IAM role for the ISV associated + with this data accessor. + """ + authentication_detail: DataAccessorAuthenticationDetail | None = ... + """ + The authentication configuration details for the data accessor. This + specifies how the ISV authenticates when accessing data through this + data accessor. + """ + created_at: datetime | None = ... + """The timestamp when the data accessor was created.""" + updated_at: datetime | None = ... + """The timestamp when the data accessor was last updated.""" + +@dataclass +class DataAccessorAuthenticationConfigurationIdcTrustedTokenIssuerConfiguration( + _SerdeShape +): + """ + Configuration for IAM Identity Center Trusted Token Issuer (TTI) + authentication used when the authentication type is `AWS_IAM_IDC_TTI`. + """ + + value: DataAccessorIdcTrustedTokenIssuerConfiguration + +@dataclass +class DataAccessorAuthenticationConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +DataAccessorAuthenticationConfiguration = Union[ + DataAccessorAuthenticationConfigurationIdcTrustedTokenIssuerConfiguration + | DataAccessorAuthenticationConfigurationUnknown +] +""" +A union type that contains the specific authentication configuration +based on the authentication type selected. +""" + +class _DataAccessorAuthenticationConfigurationDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> DataAccessorAuthenticationConfiguration: ... + +@dataclass(kw_only=True) +class DataAccessorAuthenticationDetail(_SerdeShape): + """ + Contains the authentication configuration details for a data accessor. + This structure defines how the ISV authenticates when accessing data + through the data accessor. + """ + + authentication_type: str + """ + The type of authentication to use for the data accessor. This determines + how the ISV authenticates when accessing data. You can use one of two + authentication types: + + - `AWS_IAM_IDC_TTI` - Authentication using IAM Identity Center Trusted + Token Issuer (TTI). This authentication type allows the ISV to use a + trusted token issuer to generate tokens for accessing the data. + + - `AWS_IAM_IDC_AUTH_CODE` - Authentication using IAM Identity Center + authorization code flow. This authentication type uses the standard + OAuth 2.0 authorization code flow for authentication. + """ + authentication_configuration: DataAccessorAuthenticationConfiguration | None = ... + """ + The specific authentication configuration based on the authentication + type. + """ + external_ids: list[str] | None = ... + """ + A list of external identifiers associated with this authentication + configuration. These are used to correlate the data accessor with + external systems. + """ + +class DataAccessorAuthenticationType(UnknownEnumMixin, StrEnum): + """The type of authentication mechanism used by the data accessor.""" + + AWS_IAM_IDC_TTI = "AWS_IAM_IDC_TTI" + AWS_IAM_IDC_AUTH_CODE = "AWS_IAM_IDC_AUTH_CODE" + +@dataclass(kw_only=True) +class DataAccessorIdcTrustedTokenIssuerConfiguration(_SerdeShape): + """ + Configuration details for IAM Identity Center Trusted Token Issuer (TTI) + authentication. + """ + + idc_trusted_token_issuer_arn: str + """ + The Amazon Resource Name (ARN) of the IAM Identity Center Trusted Token + Issuer that will be used for authentication. + """ + +@dataclass(kw_only=True) +class DataSource(_SerdeShape): + """A data source in an Amazon Q Business application.""" + + display_name: str | None = ... + """The name of the Amazon Q Business data source.""" + data_source_id: str | None = ... + """The identifier of the Amazon Q Business data source.""" + type: str | None = ... + """The type of the Amazon Q Business data source.""" + created_at: datetime | None = ... + """The Unix timestamp when the Amazon Q Business data source was created.""" + updated_at: datetime | None = ... + """ + The Unix timestamp when the Amazon Q Business data source was last + updated. + """ + status: str | None = ... + """The status of the Amazon Q Business data source.""" + +class DataSourceStatus(UnknownEnumMixin, StrEnum): + PENDING_CREATION = "PENDING_CREATION" + CREATING = "CREATING" + ACTIVE = "ACTIVE" + DELETING = "DELETING" + FAILED = "FAILED" + UPDATING = "UPDATING" + +@dataclass(kw_only=True) +class DataSourceSyncJob(_SerdeShape): + """ + Provides information about an Amazon Q Business data source connector + synchronization job. + """ + + execution_id: str | None = ... + """The identifier of a data source synchronization job.""" + start_time: datetime | None = ... + """The Unix time stamp when the data source synchronization job started.""" + end_time: datetime | None = ... + """The Unix timestamp when the synchronization job completed.""" + status: str | None = ... + """ + The status of the synchronization job. When the `Status` field is set to + `SUCCEEDED`, the synchronization job is done. If the status code is + `FAILED`, the `ErrorCode` and `ErrorMessage` fields give you the reason + for the failure. + """ + error: ErrorDetail | None = ... + """ + If the `Status` field is set to `FAILED`, the `ErrorCode` field + indicates the reason the synchronization failed. + """ + data_source_error_code: str | None = ... + """ + If the reason that the synchronization failed is due to an error with + the underlying data source, this field contains a code that identifies + the error. + """ + metrics: DataSourceSyncJobMetrics | None = ... + """ + Maps a batch delete document request to a specific data source sync job. + This is optional and should only be supplied when documents are deleted + by a data source connector. + """ + +@dataclass(kw_only=True) +class DataSourceSyncJobMetrics(_SerdeShape): + """ + Maps a batch delete document request to a specific Amazon Q Business + data source connector sync job. + """ + + documents_added: str | None = ... + """ + The current count of documents added from the data source during the + data source sync. + """ + documents_modified: str | None = ... + """ + The current count of documents modified in the data source during the + data source sync. + """ + documents_deleted: str | None = ... + """ + The current count of documents deleted from the data source during the + data source sync. + """ + documents_failed: str | None = ... + """ + The current count of documents that failed to sync from the data source + during the data source sync. + """ + documents_scanned: str | None = ... + """ + The current count of documents crawled by the ongoing sync job in the + data source. + """ + +class DataSourceSyncJobStatus(UnknownEnumMixin, StrEnum): + FAILED = "FAILED" + SUCCEEDED = "SUCCEEDED" + SYNCING = "SYNCING" + INCOMPLETE = "INCOMPLETE" + STOPPING = "STOPPING" + ABORTED = "ABORTED" + SYNCING_INDEXING = "SYNCING_INDEXING" + +@dataclass(kw_only=True) +class DataSourceVpcConfiguration(_SerdeShape): + """ + Provides configuration information needed to connect to an Amazon VPC + (Virtual Private Cloud). + """ + + subnet_ids: list[str] + """ + A list of identifiers for subnets within your Amazon VPC. The subnets + should be able to connect to each other in the VPC, and they should have + outgoing access to the Internet through a NAT device. + """ + security_group_ids: list[str] + """ + A list of identifiers of security groups within your Amazon VPC. The + security groups should enable Amazon Q Business to connect to the data + source. + """ + +@dataclass(kw_only=True) +class DateAttributeBoostingConfiguration(_SerdeShape): + """ + Provides information on boosting `DATE` type document attributes. + + For more information on how boosting document attributes work in Amazon + Q Business, see [Boosting using document + attributes](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/metadata-boosting.html). + """ + + boosting_level: str + """ + Specifies the priority tier ranking of boosting applied to document + attributes. For version 2, this parameter indicates the relative ranking + between boosted fields (ONE being highest priority, TWO being second + highest, etc.) and determines the order in which attributes influence + document ranking in search results. For version 1, this parameter + specifies the boosting intensity. For version 2, boosting intensity + (VERY HIGH, HIGH, MEDIUM, LOW, NONE) are not supported. Note that in + version 2, you are not allowed to boost on only one field and make this + value TWO. + """ + boosting_duration_in_seconds: int | None = ... + """ + Specifies the duration, in seconds, of a boost applies to a `DATE` type + document attribute. + """ + +@dataclass(kw_only=True) +class DeleteApplicationInput(_SerdeShape): + """Dataclass for DeleteApplicationInput structure.""" + + application_id: str | None = ... + """The identifier of the Amazon Q Business application.""" + +@dataclass(kw_only=True) +class DeleteApplicationOutput(_SerdeShape): + """Dataclass for DeleteApplicationOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteAttachmentInput(_SerdeShape): + """Dataclass for DeleteAttachmentInput structure.""" + + application_id: str | None = ... + """The unique identifier for the Amazon Q Business application environment.""" + conversation_id: str | None = ... + """The unique identifier of the conversation.""" + attachment_id: str | None = ... + """The unique identifier for the attachment.""" + user_id: str | None = ... + """The unique identifier of the user involved in the conversation.""" + +@dataclass(kw_only=True) +class DeleteAttachmentOutput(_SerdeShape): + """Dataclass for DeleteAttachmentOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteChatControlsConfigurationInput(_SerdeShape): + """Dataclass for DeleteChatControlsConfigurationInput structure.""" + + application_id: str | None = ... + """ + The identifier of the application the chat controls have been configured + for. + """ + +@dataclass(kw_only=True) +class DeleteChatControlsConfigurationOutput(_SerdeShape): + """Dataclass for DeleteChatControlsConfigurationOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteChatResponseConfigurationInput(_SerdeShape): + """Dataclass for DeleteChatResponseConfigurationInput structure.""" + + application_id: str | None = ... + """ + The unique identifier of theAmazon Q Business application from which to + delete the chat response configuration. + """ + chat_response_configuration_id: str | None = ... + """ + The unique identifier of the chat response configuration to delete from + the specified application. + """ + +@dataclass(kw_only=True) +class DeleteChatResponseConfigurationOutput(_SerdeShape): + """Dataclass for DeleteChatResponseConfigurationOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteConversationInput(_SerdeShape): + """Dataclass for DeleteConversationInput structure.""" + + conversation_id: str | None = ... + """ + The identifier of the Amazon Q Business web experience conversation + being deleted. + """ + application_id: str | None = ... + """ + The identifier of the Amazon Q Business application associated with the + conversation. + """ + user_id: str | None = ... + """The identifier of the user who is deleting the conversation.""" + +@dataclass(kw_only=True) +class DeleteConversationOutput(_SerdeShape): + """Dataclass for DeleteConversationOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteDataAccessorInput(_SerdeShape): + """Dataclass for DeleteDataAccessorInput structure.""" + + application_id: str | None = ... + """The unique identifier of the Amazon Q Business application.""" + data_accessor_id: str | None = ... + """The unique identifier of the data accessor to delete.""" + +@dataclass(kw_only=True) +class DeleteDataAccessorOutput(_SerdeShape): + """Dataclass for DeleteDataAccessorOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteDataSourceInput(_SerdeShape): + """Dataclass for DeleteDataSourceInput structure.""" + + application_id: str | None = ... + """ + The identifier of the Amazon Q Business application used with the data + source connector. + """ + index_id: str | None = ... + """The identifier of the index used with the data source connector.""" + data_source_id: str | None = ... + """The identifier of the data source connector that you want to delete.""" + +@dataclass(kw_only=True) +class DeleteDataSourceOutput(_SerdeShape): + """Dataclass for DeleteDataSourceOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteDocument(_SerdeShape): + """A document deleted from an Amazon Q Business data source connector.""" + + document_id: str + """The identifier of the deleted document.""" + +@dataclass(kw_only=True) +class DeleteGroupInput(_SerdeShape): + """Dataclass for DeleteGroupInput structure.""" + + application_id: str | None = ... + """The identifier of the application in which the group mapping belongs.""" + index_id: str | None = ... + """The identifier of the index you want to delete the group from.""" + group_name: str | None = ... + """The name of the group you want to delete.""" + data_source_id: str | None = ... + """ + The identifier of the data source linked to the group + + A group can be tied to multiple data sources. You can delete a group + from accessing documents in a certain data source. For example, the + groups \"Research\", \"Engineering\", and \"Sales and Marketing\" are + all tied to the company's documents stored in the data sources + Confluence and Salesforce. You want to delete \"Research\" and + \"Engineering\" groups from Salesforce, so that these groups cannot + access customer-related documents stored in Salesforce. Only \"Sales and + Marketing\" should access documents in the Salesforce data source. + """ + +@dataclass(kw_only=True) +class DeleteGroupOutput(_SerdeShape): + """Dataclass for DeleteGroupOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteIndexInput(_SerdeShape): + """Dataclass for DeleteIndexInput structure.""" + + application_id: str | None = ... + """ + The identifier of the Amazon Q Business application the Amazon Q + Business index is linked to. + """ + index_id: str | None = ... + """The identifier of the Amazon Q Business index.""" + +@dataclass(kw_only=True) +class DeleteIndexOutput(_SerdeShape): + """Dataclass for DeleteIndexOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeletePluginInput(_SerdeShape): + """Dataclass for DeletePluginInput structure.""" + + application_id: str | None = ... + """The identifier the application attached to the Amazon Q Business plugin.""" + plugin_id: str | None = ... + """The identifier of the plugin being deleted.""" + +@dataclass(kw_only=True) +class DeletePluginOutput(_SerdeShape): + """Dataclass for DeletePluginOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteRetrieverInput(_SerdeShape): + """Dataclass for DeleteRetrieverInput structure.""" + + application_id: str | None = ... + """The identifier of the Amazon Q Business application using the retriever.""" + retriever_id: str | None = ... + """The identifier of the retriever being deleted.""" + +@dataclass(kw_only=True) +class DeleteRetrieverOutput(_SerdeShape): + """Dataclass for DeleteRetrieverOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteUserInput(_SerdeShape): + """Dataclass for DeleteUserInput structure.""" + + application_id: str | None = ... + """The identifier of the application from which the user is being deleted.""" + user_id: str | None = ... + """The user email being deleted.""" + +@dataclass(kw_only=True) +class DeleteUserOutput(_SerdeShape): + """Dataclass for DeleteUserOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteWebExperienceInput(_SerdeShape): + """Dataclass for DeleteWebExperienceInput structure.""" + + application_id: str | None = ... + """ + The identifier of the Amazon Q Business application linked to the Amazon + Q Business web experience. + """ + web_experience_id: str | None = ... + """The identifier of the Amazon Q Business web experience being deleted.""" + +@dataclass(kw_only=True) +class DeleteWebExperienceOutput(_SerdeShape): + """Dataclass for DeleteWebExperienceOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DisassociatePermissionInput(_SerdeShape): + """Dataclass for DisassociatePermissionInput structure.""" + + application_id: str | None = ... + """The unique identifier of the Amazon Q Business application.""" + statement_id: str | None = ... + """The statement ID of the permission to remove.""" + +@dataclass(kw_only=True) +class DisassociatePermissionOutput(_SerdeShape): + """Dataclass for DisassociatePermissionOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class Document(_SerdeShape): + """A document in an Amazon Q Business application.""" + + id: str + """The identifier of the document.""" + attributes: list[DocumentAttribute] | None = ... + """ + Custom attributes to apply to the document for refining Amazon Q + Business web experience responses. + """ + content: DocumentContent | None = ... + """The contents of the document.""" + content_type: str | None = ... + """ + The file type of the document in the Blob field. + + If you want to index snippets or subsets of HTML documents instead of + the entirety of the HTML documents, you add the `HTML` start and closing + tags (`content`) around the content. + """ + title: str | None = ... + """The title of the document.""" + access_configuration: AccessConfiguration | None = ... + """Configuration information for access permission to a document.""" + document_enrichment_configuration: DocumentEnrichmentConfiguration | None = ... + """ + The configuration information for altering document metadata and content + during the document ingestion process. + """ + media_extraction_configuration: MediaExtractionConfiguration | None = ... + """The configuration for extracting information from media in the document.""" + +@dataclass(kw_only=True) +class DocumentAcl(_SerdeShape): + """ + Represents the Access Control List (ACL) for a document, containing both + allowlist and denylist conditions. + """ + + allowlist: DocumentAclMembership | None = ... + """ + The allowlist conditions for the document. Users or groups matching + these conditions are granted access to the document. + """ + deny_list: DocumentAclMembership | None = ... + """ + The denylist conditions for the document. Users or groups matching these + conditions are denied access to the document, overriding allowlist + permissions. + """ + +@dataclass(kw_only=True) +class DocumentAclCondition(_SerdeShape): + """ + Represents a condition in the document's ACL, specifying access rules + for users and groups. + """ + + member_relation: str | None = ... + """ + The logical relation between members in the condition, determining how + multiple user or group conditions are combined. + """ + users: list[DocumentAclUser] | None = ... + """ + An array of user identifiers that this condition applies to. Users + listed here are subject to the access rule defined by this condition. + """ + groups: list[DocumentAclGroup] | None = ... + """ + An array of group identifiers that this condition applies to. Groups + listed here are subject to the access rule defined by this condition. + """ + +@dataclass(kw_only=True) +class DocumentAclGroup(_SerdeShape): + """ + Represents a group in the document's ACL, used to define access + permissions for multiple users collectively. + """ + + name: str | None = ... + """ + The name of the group in the document's ACL. This is used to identify + the group when applying access rules. + """ + type: str | None = ... + """ + The type of the group. This indicates the scope of the group's + applicability in access control. + """ + +@dataclass(kw_only=True) +class DocumentAclMembership(_SerdeShape): + """ + Represents membership rules in the document's ACL, defining how users + or groups are associated with access permissions. + """ + + member_relation: str | None = ... + """ + The logical relation between members in the membership rule, determining + how multiple conditions are combined. + """ + conditions: list[DocumentAclCondition] | None = ... + """ + An array of conditions that define the membership rules. Each condition + specifies criteria for users or groups to be included in this + membership. + """ + +@dataclass(kw_only=True) +class DocumentAclUser(_SerdeShape): + """ + Represents a user in the document's ACL, used to define access + permissions for individual users. + """ + + id: str | None = ... + """ + The unique identifier of the user in the document's ACL. This is used + to identify the user when applying access rules. + """ + type: str | None = ... + """ + The type of the user. This indicates the scope of the user's + applicability in access control. + """ + +@dataclass(kw_only=True) +class DocumentAttribute(_SerdeShape): + """A document attribute or metadata field.""" + + name: str + """The identifier for the attribute.""" + value: DocumentAttributeValue + """The value of the attribute.""" + +@dataclass +class DocumentAttributeBoostingConfigurationNumberConfiguration(_SerdeShape): + """ + Provides information on boosting `NUMBER` type document attributes. + + `NUMBER` attributes are not supported when using + `NativeIndexConfiguration` version 2, which focuses on `DATE` attributes + for recency and `STRING` attributes for source prioritization. + """ + + value: NumberAttributeBoostingConfiguration + +@dataclass +class DocumentAttributeBoostingConfigurationStringConfiguration(_SerdeShape): + """ + Provides information on boosting `STRING` type document attributes. + + Version 2 assigns priority tiers to `STRING` attributes, establishing + clear hierarchical relationships with other boosted attributes. + """ + + value: StringAttributeBoostingConfiguration + +@dataclass +class DocumentAttributeBoostingConfigurationDateConfiguration(_SerdeShape): + """ + Provides information on boosting `DATE` type document attributes. + + Version 2 assigns priority tiers to `DATE` attributes, establishing + clear hierarchical relationships with other boosted attributes. + """ + + value: DateAttributeBoostingConfiguration + +@dataclass +class DocumentAttributeBoostingConfigurationStringListConfiguration(_SerdeShape): + """ + Provides information on boosting `STRING_LIST` type document attributes. + + `STRING_LIST` attributes are not supported when using + `NativeIndexConfiguration` version 2, which focuses on `DATE` attributes + for recency and `STRING` attributes for source prioritization. + """ + + value: StringListAttributeBoostingConfiguration + +@dataclass +class DocumentAttributeBoostingConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +DocumentAttributeBoostingConfiguration = Union[ + DocumentAttributeBoostingConfigurationNumberConfiguration + | DocumentAttributeBoostingConfigurationStringConfiguration + | DocumentAttributeBoostingConfigurationDateConfiguration + | DocumentAttributeBoostingConfigurationStringListConfiguration + | DocumentAttributeBoostingConfigurationUnknown +] +""" +Provides information on boosting supported Amazon Q Business document +attribute types. When an end user chat query matches document attributes +that have been boosted, Amazon Q Business prioritizes generating +responses from content that matches the boosted document attributes. + +In version 2, boosting uses numeric values (ONE, TWO) to indicate +priority tiers that establish clear hierarchical relationships between +boosted attributes. This allows for more precise control over how +different attributes influence search results. + +Note: + For `STRING` and `STRING_LIST` type document attributes to be used for + boosting on the console and the API, they must be enabled for search + using the + [DocumentAttributeConfiguration](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_DocumentAttributeConfiguration.html) + object of the + [UpdateIndex](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_UpdateIndex.html) + API. If you haven't enabled searching on these attributes, you can't + boost attributes of these data types on either the console or the API. + +For more information on how boosting document attributes work in Amazon +Q Business, see [Boosting using document +attributes](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/metadata-boosting.html). +""" + +class _DocumentAttributeBoostingConfigurationDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> DocumentAttributeBoostingConfiguration: ... + +class DocumentAttributeBoostingLevel(UnknownEnumMixin, StrEnum): + NONE = "NONE" + LOW = "LOW" + MEDIUM = "MEDIUM" + HIGH = "HIGH" + VERY_HIGH = "VERY_HIGH" + ONE = "ONE" + TWO = "TWO" + +@dataclass(kw_only=True) +class DocumentAttributeCondition(_SerdeShape): + """ + The condition used for the target document attribute or metadata field + when ingesting documents into Amazon Q Business. You use this with + [`DocumentAttributeTarget`](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_DocumentAttributeTarget.html) + to apply the condition. + + For example, you can create the 'Department' target field and have it + prefill department names associated with the documents based on + information in the 'Source_URI' field. Set the condition that if the + 'Source_URI' field contains 'financial' in its URI value, then + prefill the target field 'Department' with the target value + 'Finance' for the document. + + Amazon Q Business can't create a target field if it has not already + been created as an index field. After you create your index field, you + can create a document metadata field using `DocumentAttributeTarget`. + Amazon Q Business then will map your newly created metadata field to + your index field. + """ + + key: str + """ + The identifier of the document attribute used for the condition. + + For example, 'Source_URI' could be an identifier for the attribute or + metadata field that contains source URIs associated with the documents. + + Amazon Q Business currently doesn't support `_document_body` as an + attribute key used for the condition. + """ + operator: str + """ + The identifier of the document attribute used for the condition. + + For example, 'Source_URI' could be an identifier for the attribute or + metadata field that contains source URIs associated with the documents. + + Amazon Q Business currently does not support `_document_body` as an + attribute key used for the condition. + """ + value: DocumentAttributeValue | None = ... + """ + The value of a document attribute. You can only provide one value for a + document attribute. + """ + +@dataclass(kw_only=True) +class DocumentAttributeConfiguration(_SerdeShape): + """ + Configuration information for document attributes. Document attributes + are metadata or fields associated with your documents. For example, the + company department name associated with each document. + + For more information, see [Understanding document + attributes](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/doc-attributes.html). + """ + + name: str | None = ... + """The name of the document attribute.""" + type: str | None = ... + """The type of document attribute.""" + search: str | None = ... + """ + Information about whether the document attribute can be used by an end + user to search for information on their web experience. + """ + +@dataclass(kw_only=True) +class DocumentAttributeTarget(_SerdeShape): + """ + The target document attribute or metadata field you want to alter when + ingesting documents into Amazon Q Business. + + For example, you can delete all customer identification numbers + associated with the documents, stored in the document metadata field + called 'Customer_ID' by setting the target key as 'Customer_ID' and + the deletion flag to `TRUE`. This removes all customer ID values in the + field 'Customer_ID'. This would scrub personally identifiable + information from each document's metadata. + + Amazon Q Business can't create a target field if it has not already + been created as an index field. After you create your index field, you + can create a document metadata field using + [`DocumentAttributeTarget`](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_DocumentAttributeTarget.html) + . Amazon Q Business will then map your newly created document attribute + to your index field. + + You can also use this with + [`DocumentAttributeCondition`](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_DocumentAttributeCondition.html) + . + """ + + key: str + """ + The identifier of the target document attribute or metadata field. For + example, 'Department' could be an identifier for the target attribute + or metadata field that includes the department names associated with the + documents. + """ + value: DocumentAttributeValue | None = ... + """ + The value of a document attribute. You can only provide one value for a + document attribute. + """ + attribute_value_operator: str | None = ... + """ + `TRUE` to delete the existing target value for your specified target + attribute key. You cannot create a target value and set this to `TRUE`. + """ + +@dataclass +class DocumentAttributeValueStringValue(_SerdeShape): + """A string.""" + + value: str + +@dataclass +class DocumentAttributeValueStringListValue(_SerdeShape): + """A list of strings.""" + + value: list[str] + +@dataclass +class DocumentAttributeValueLongValue(_SerdeShape): + """A long integer value.""" + + value: int + +@dataclass +class DocumentAttributeValueDateValue(_SerdeShape): + """ + A date expressed as an ISO 8601 string. + + It's important for the time zone to be included in the ISO 8601 + date-time format. For example, 2012-03-25T12:30:10+01:00 is the ISO 8601 + date-time format for March 25th 2012 at 12:30PM (plus 10 seconds) in + Central European Time. + """ + + value: datetime + +@dataclass +class DocumentAttributeValueUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +DocumentAttributeValue = Union[ + DocumentAttributeValueStringValue + | DocumentAttributeValueStringListValue + | DocumentAttributeValueLongValue + | DocumentAttributeValueDateValue + | DocumentAttributeValueUnknown +] +""" +The value of a document attribute. You can only provide one value for a +document attribute. +""" + +class _DocumentAttributeValueDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> DocumentAttributeValue: ... + +@dataclass +class DocumentContentBlob(_SerdeShape): + """ + The contents of the document. Documents passed to the `blob` parameter + must be base64 encoded. Your code might not need to encode the document + file bytes if you're using an Amazon Web Services SDK to call Amazon Q + Business APIs. If you are calling the Amazon Q Business endpoint + directly using REST, you must base64 encode the contents before sending. + """ + + value: bytes + +@dataclass +class DocumentContentS3(_SerdeShape): + """The path to the document in an Amazon S3 bucket.""" + + value: S3 + +@dataclass +class DocumentContentUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +DocumentContent = Union[ + DocumentContentBlob | DocumentContentS3 | DocumentContentUnknown +] +""" +The contents of a document. + +Note: + Documents have size limitations. The maximum file size for a document is + 50 MB. The maximum amount of text that can be extracted from a single + document is 5 MB. For more information, see [Supported document formats + in Amazon Q + Business](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/doc-types.html). +""" + +class _DocumentContentDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> DocumentContent: ... + +class DocumentContentOperator(UnknownEnumMixin, StrEnum): + DELETE = "DELETE" + +@dataclass(kw_only=True) +class DocumentDetails(_SerdeShape): + """The details of a document within an Amazon Q Business index.""" + + document_id: str | None = ... + """The identifier of the document.""" + status: str | None = ... + """The current status of the document.""" + error: ErrorDetail | None = ... + """An error message associated with the document.""" + created_at: datetime | None = ... + """The timestamp for when the document was created.""" + updated_at: datetime | None = ... + """The timestamp for when the document was last updated.""" + +class DocumentEnrichmentConditionOperator(UnknownEnumMixin, StrEnum): + GREATER_THAN = "GREATER_THAN" + GREATER_THAN_OR_EQUALS = "GREATER_THAN_OR_EQUALS" + LESS_THAN = "LESS_THAN" + LESS_THAN_OR_EQUALS = "LESS_THAN_OR_EQUALS" + EQUALS = "EQUALS" + NOT_EQUALS = "NOT_EQUALS" + CONTAINS = "CONTAINS" + NOT_CONTAINS = "NOT_CONTAINS" + EXISTS = "EXISTS" + NOT_EXISTS = "NOT_EXISTS" + BEGINS_WITH = "BEGINS_WITH" + +@dataclass(kw_only=True) +class DocumentEnrichmentConfiguration(_SerdeShape): + """ + Provides the configuration information for altering document metadata + and content during the document ingestion process. + + For more information, see [Custom document + enrichment](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/custom-document-enrichment.html). + """ + + inline_configurations: list[InlineDocumentEnrichmentConfiguration] | None = ... + """ + Configuration information to alter document attributes or metadata + fields and content when ingesting documents into Amazon Q Business. + """ + pre_extraction_hook_configuration: HookConfiguration | None = ... + """ + Provides the configuration information for invoking a Lambda function in + Lambda to alter document metadata and content when ingesting documents + into Amazon Q Business. + + You can configure your Lambda function using the + `PreExtractionHookConfiguration` parameter if you want to apply advanced + alterations on the original or raw documents. + + If you want to apply advanced alterations on the Amazon Q Business + structured documents, you must configure your Lambda function using + `PostExtractionHookConfiguration`. + + You can only invoke one Lambda function. However, this function can + invoke other functions it requires. + + For more information, see [Custom document + enrichment](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/custom-document-enrichment.html). + """ + post_extraction_hook_configuration: HookConfiguration | None = ... + """ + Provides the configuration information for invoking a Lambda function in + Lambda to alter document metadata and content when ingesting documents + into Amazon Q Business. + + You can configure your Lambda function using the + `PreExtractionHookConfiguration` parameter if you want to apply advanced + alterations on the original or raw documents. + + If you want to apply advanced alterations on the Amazon Q Business + structured documents, you must configure your Lambda function using + `PostExtractionHookConfiguration`. + + You can only invoke one Lambda function. However, this function can + invoke other functions it requires. + + For more information, see [Custom document + enrichment](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/custom-document-enrichment.html). + """ + +class DocumentStatus(UnknownEnumMixin, StrEnum): + RECEIVED = "RECEIVED" + PROCESSING = "PROCESSING" + INDEXED = "INDEXED" + UPDATED = "UPDATED" + FAILED = "FAILED" + DELETING = "DELETING" + DELETED = "DELETED" + DOCUMENT_FAILED_TO_INDEX = "DOCUMENT_FAILED_TO_INDEX" + +@dataclass(kw_only=True) +class EligibleDataSource(_SerdeShape): + """ + The identifier of the data source Amazon Q Business will generate + responses from. + """ + + index_id: str | None = ... + """The identifier of the index the data source is attached to.""" + data_source_id: str | None = ... + """The identifier of the data source.""" + +@dataclass(kw_only=True) +class EncryptionConfiguration(_SerdeShape): + """ + Provides the identifier of the KMS key used to encrypt data indexed by + Amazon Q Business. Amazon Q Business doesn't support asymmetric keys. + """ + + kms_key_id: str | None = ... + """ + The identifier of the KMS key. Amazon Q Business doesn't support + asymmetric keys. + """ + +@dataclass(kw_only=True) +class EndOfInputEvent(_SerdeShape): + """The end of the streaming input for the `Chat` API.""" + +class ErrorCode(UnknownEnumMixin, StrEnum): + INTERNAL_ERROR = "InternalError" + INVALID_REQUEST = "InvalidRequest" + RESOURCE_INACTIVE = "ResourceInactive" + RESOURCE_NOT_FOUND = "ResourceNotFound" + +@dataclass(kw_only=True) +class ErrorDetail(_SerdeShape): + """Provides information about a Amazon Q Business request error.""" + + error_message: str | None = ... + """The message explaining the Amazon Q Business request error.""" + error_code: str | None = ... + """The code associated with the Amazon Q Business request error.""" + +@dataclass(kw_only=True) +class ExternalResourceException(ServiceError, _SerdeShape): + """ + An external resource that you configured with your application is + returning errors and preventing this operation from succeeding. Fix + those errors and try again. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class FailedAttachmentEvent(_SerdeShape): + """A failed file upload during web experience chat.""" + + conversation_id: str | None = ... + """ + The identifier of the conversation associated with the failed file + upload. + """ + user_message_id: str | None = ... + """ + The identifier of the end user chat message associated with the file + upload. + """ + system_message_id: str | None = ... + """ + The identifier of the AI-generated message associated with the file + upload. + """ + attachment: AttachmentOutput | None = ... + """The details of a file uploaded during chat.""" + +@dataclass(kw_only=True) +class FailedDocument(_SerdeShape): + """ + A list of documents that could not be removed from an Amazon Q Business + index. Each entry contains an error message that indicates why the + document couldn't be removed from the index. + """ + + id: str | None = ... + """ + The identifier of the document that couldn't be removed from the Amazon + Q Business index. + """ + error: ErrorDetail | None = ... + """An explanation for why the document couldn't be removed from the index.""" + data_source_id: str | None = ... + """ + The identifier of the Amazon Q Business data source connector that + contains the failed document. + """ + +@dataclass(kw_only=True) +class GetApplicationInput(_SerdeShape): + """Dataclass for GetApplicationInput structure.""" + + application_id: str | None = ... + """The identifier of the Amazon Q Business application.""" + +@dataclass(kw_only=True) +class GetApplicationOutput(_SerdeShape): + """Dataclass for GetApplicationOutput structure.""" + + display_name: str | None = ... + """The name of the Amazon Q Business application.""" + application_id: str | None = ... + """The identifier of the Amazon Q Business application.""" + application_arn: str | None = ... + """The Amazon Resource Name (ARN) of the Amazon Q Business application.""" + identity_type: str | None = ... + """The authentication type being used by a Amazon Q Business application.""" + iam_identity_provider_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of an identity provider being used by an + Amazon Q Business application. + """ + identity_center_application_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the AWS IAM Identity Center instance + attached to your Amazon Q Business application. + """ + role_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the IAM with permissions to access + your CloudWatch logs and metrics. + """ + status: str | None = ... + """The status of the Amazon Q Business application.""" + description: str | None = ... + """A description for the Amazon Q Business application.""" + encryption_configuration: EncryptionConfiguration | None = ... + """ + The identifier of the Amazon Web Services KMS key that is used to + encrypt your data. Amazon Q Business doesn't support asymmetric keys. + """ + created_at: datetime | None = ... + """ + The Unix timestamp when the Amazon Q Business application was last + updated. + """ + updated_at: datetime | None = ... + """ + The Unix timestamp when the Amazon Q Business application was last + updated. + """ + error: ErrorDetail | None = ... + """ + If the `Status` field is set to `ERROR`, the `ErrorMessage` field + contains a description of the error that caused the synchronization to + fail. + """ + attachments_configuration: AppliedAttachmentsConfiguration | None = ... + """Settings for whether end users can upload files directly during chat.""" + q_apps_configuration: QAppsConfiguration | None = ... + """ + Settings for whether end users can create and use Amazon Q Apps in the + web experience. + """ + personalization_configuration: PersonalizationConfiguration | None = ... + """ + Configuration information about chat response personalization. For more + information, see [Personalizing chat + responses](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/personalizing-chat-responses.html). + """ + auto_subscription_configuration: AutoSubscriptionConfiguration | None = ... + """ + Settings for auto-subscription behavior for this application. This is + only applicable to SAML and OIDC applications. + """ + client_ids_for_oidc: list[str] | None = ... + """The OIDC client ID for a Amazon Q Business application.""" + quick_sight_configuration: QuickSightConfiguration | None = ... + """ + The Amazon Quick Suite authentication configuration for the Amazon Q + Business application. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetChatControlsConfigurationInput(_SerdeShape): + """Dataclass for GetChatControlsConfigurationInput structure.""" + + application_id: str | None = ... + """ + The identifier of the application for which the chat controls are + configured. + """ + max_results: int | None = ... + """The maximum number of configured chat controls to return.""" + next_token: str | None = ... + """ + If the `maxResults` response was incomplete because there is more data + to retrieve, Amazon Q Business returns a pagination token in the + response. You can use this pagination token to retrieve the next set of + Amazon Q Business chat controls configured. + """ + +@dataclass(kw_only=True) +class GetChatControlsConfigurationOutput(_SerdeShape): + """Dataclass for GetChatControlsConfigurationOutput structure.""" + + response_scope: str | None = ... + """ + The response scope configured for a Amazon Q Business application. This + determines whether your application uses its retrieval augmented + generation (RAG) system to generate answers only from your enterprise + data, or also uses the large language models (LLM) knowledge to respons + to end user questions in chat. + """ + orchestration_configuration: AppliedOrchestrationConfiguration | None = ... + """ + The chat response orchestration settings for your application. + + Note: + Chat orchestration is optimized to work for English language content. + For more details on language support in Amazon Q Business, see + [Supported + languages](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/supported-languages.html). + """ + blocked_phrases: BlockedPhrasesConfiguration | None = ... + """The phrases blocked from chat by your chat control configuration.""" + topic_configurations: list[TopicConfiguration] | None = ... + """ + The topic specific controls configured for a Amazon Q Business + application. + """ + creator_mode_configuration: AppliedCreatorModeConfiguration | None = ... + """The configuration details for `CREATOR_MODE`.""" + next_token: str | None = ... + """ + If the `maxResults` response was incomplete because there is more data + to retrieve, Amazon Q Business returns a pagination token in the + response. You can use this pagination token to retrieve the next set of + Amazon Q Business chat controls configured. + """ + hallucination_reduction_configuration: ( + HallucinationReductionConfiguration | None + ) = ... + """The hallucination reduction settings for your application.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetChatResponseConfigurationInput(_SerdeShape): + """Dataclass for GetChatResponseConfigurationInput structure.""" + + application_id: str | None = ... + """ + The unique identifier of the Amazon Q Business application containing + the chat response configuration to retrieve. + """ + chat_response_configuration_id: str | None = ... + """ + The unique identifier of the chat response configuration to retrieve + from the specified application. + """ + +@dataclass(kw_only=True) +class GetChatResponseConfigurationOutput(_SerdeShape): + """Dataclass for GetChatResponseConfigurationOutput structure.""" + + chat_response_configuration_id: str | None = ... + """The unique identifier of the retrieved chat response configuration.""" + chat_response_configuration_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the retrieved chat response + configuration, which uniquely identifies the resource across all Amazon + Web Services services. + """ + display_name: str | None = ... + """ + The human-readable name of the retrieved chat response configuration, + making it easier to identify among multiple configurations. + """ + created_at: datetime | None = ... + """ + The timestamp indicating when the chat response configuration was + initially created. + """ + in_use_configuration: ChatResponseConfigurationDetail | None = ... + """ + The currently active configuration settings that are being used to + generate responses in the Amazon Q Business application. + """ + last_update_configuration: ChatResponseConfigurationDetail | None = ... + """ + Information about the most recent update to the configuration, including + timestamp and modification details. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetDataAccessorInput(_SerdeShape): + """Dataclass for GetDataAccessorInput structure.""" + + application_id: str | None = ... + """The unique identifier of the Amazon Q Business application.""" + data_accessor_id: str | None = ... + """The unique identifier of the data accessor to retrieve.""" + +@dataclass(kw_only=True) +class GetDataAccessorOutput(_SerdeShape): + """Dataclass for GetDataAccessorOutput structure.""" + + display_name: str | None = ... + """The friendly name of the data accessor.""" + data_accessor_id: str | None = ... + """The unique identifier of the data accessor.""" + data_accessor_arn: str | None = ... + """The Amazon Resource Name (ARN) of the data accessor.""" + application_id: str | None = ... + """ + The unique identifier of the Amazon Q Business application associated + with this data accessor. + """ + idc_application_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the IAM Identity Center application + associated with this data accessor. + """ + principal: str | None = ... + """ + The Amazon Resource Name (ARN) of the IAM role for the ISV associated + with this data accessor. + """ + action_configurations: list[ActionConfiguration] | None = ... + """ + The list of action configurations specifying the allowed actions and any + associated filters. + """ + authentication_detail: DataAccessorAuthenticationDetail | None = ... + """ + The authentication configuration details for the data accessor. This + specifies how the ISV authenticates when accessing data through this + data accessor. + """ + created_at: datetime | None = ... + """The timestamp when the data accessor was created.""" + updated_at: datetime | None = ... + """The timestamp when the data accessor was last updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetDataSourceInput(_SerdeShape): + """Dataclass for GetDataSourceInput structure.""" + + application_id: str | None = ... + """The identifier of the Amazon Q Business application.""" + index_id: str | None = ... + """The identfier of the index used with the data source connector.""" + data_source_id: str | None = ... + """The identifier of the data source connector.""" + +@dataclass(kw_only=True) +class GetDataSourceOutput(_SerdeShape): + """Dataclass for GetDataSourceOutput structure.""" + + application_id: str | None = ... + """The identifier of the Amazon Q Business application.""" + index_id: str | None = ... + """The identifier of the index linked to the data source connector.""" + data_source_id: str | None = ... + """The identifier of the data source connector.""" + data_source_arn: str | None = ... + """The Amazon Resource Name (ARN) of the data source.""" + display_name: str | None = ... + """The name for the data source connector.""" + type: str | None = ... + """The type of the data source connector. For example, `S3`.""" + configuration: _Document | None = ... + """The details of how the data source connector is configured.""" + vpc_configuration: DataSourceVpcConfiguration | None = ... + """ + Configuration information for an Amazon VPC (Virtual Private Cloud) to + connect to your data source. + """ + created_at: datetime | None = ... + """The Unix timestamp when the data source connector was created.""" + updated_at: datetime | None = ... + """The Unix timestamp when the data source connector was last updated.""" + description: str | None = ... + """The description for the data source connector.""" + status: str | None = ... + """ + The current status of the data source connector. When the `Status` field + value is `FAILED`, the `ErrorMessage` field contains a description of + the error that caused the data source connector to fail. + """ + sync_schedule: str | None = ... + """The schedule for Amazon Q Business to update the index.""" + role_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the role with permission to access the + data source and required resources. + """ + error: ErrorDetail | None = ... + """ + When the `Status` field value is `FAILED`, the `ErrorMessage` field + contains a description of the error that caused the data source + connector to fail. + """ + document_enrichment_configuration: DocumentEnrichmentConfiguration | None = ... + """ + Provides the configuration information for altering document metadata + and content during the document ingestion process. + + For more information, see [Custom document + enrichment](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/custom-document-enrichment.html). + """ + media_extraction_configuration: MediaExtractionConfiguration | None = ... + """ + The configuration for extracting information from media in documents for + the data source. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetDocumentContentInput(_SerdeShape): + """Dataclass for GetDocumentContentInput structure.""" + + application_id: str | None = ... + """ + The unique identifier of the Amazon Q Business application containing + the document. This ensures the request is scoped to the correct + application environment and its associated security policies. + """ + index_id: str | None = ... + """The identifier of the index where documents are indexed.""" + data_source_id: str | None = ... + """ + The identifier of the data source from which the document was ingested. + This field is not present if the document is ingested by directly + calling the BatchPutDocument API. If the document is from a file-upload + data source, the datasource will be + \"uploaded-docs-file-stat-datasourceid\". + """ + document_id: str | None = ... + """ + The unique identifier of the document that is indexed via + BatchPutDocument API or file-upload or connector sync. It is also found + in chat or chatSync response. + """ + output_format: str | None = ... + """Document outputFormat. Defaults to RAW if not selected.""" + +@dataclass(kw_only=True) +class GetDocumentContentOutput(_SerdeShape): + """Dataclass for GetDocumentContentOutput structure.""" + + presigned_url: str + """ + A pre-signed URL that provides temporary access to download the document + content directly from Amazon Q Business. The URL expires after 5 minutes + for security purposes. This URL is generated only after successful ACL + validation. + """ + mime_type: str + """ + The MIME type of the document content. When outputFormat is RAW, this + corresponds to the original document's MIME type (e.g., + application/pdf, text/plain, + application/vnd.openxmlformats-officedocument.wordprocessingml.document). + When outputFormat is EXTRACTED, the MIME type is always + application/json. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetGroupInput(_SerdeShape): + """Dataclass for GetGroupInput structure.""" + + application_id: str | None = ... + """The identifier of the application id the group is attached to.""" + index_id: str | None = ... + """The identifier of the index the group is attached to.""" + group_name: str | None = ... + """The name of the group.""" + data_source_id: str | None = ... + """The identifier of the data source the group is attached to.""" + +@dataclass(kw_only=True) +class GetGroupOutput(_SerdeShape): + """Dataclass for GetGroupOutput structure.""" + + status: GroupStatusDetail | None = ... + """The current status of the group.""" + status_history: list[GroupStatusDetail] | None = ... + """The status history of the group.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetIndexInput(_SerdeShape): + """Dataclass for GetIndexInput structure.""" + + application_id: str | None = ... + """ + The identifier of the Amazon Q Business application connected to the + index. + """ + index_id: str | None = ... + """The identifier of the Amazon Q Business index you want information on.""" + +@dataclass(kw_only=True) +class GetIndexOutput(_SerdeShape): + """Dataclass for GetIndexOutput structure.""" + + application_id: str | None = ... + """ + The identifier of the Amazon Q Business application associated with the + index. + """ + index_id: str | None = ... + """The identifier of the Amazon Q Business index.""" + display_name: str | None = ... + """The name of the Amazon Q Business index.""" + index_arn: str | None = ... + """The Amazon Resource Name (ARN) of the Amazon Q Business index.""" + status: str | None = ... + """ + The current status of the index. When the value is `ACTIVE`, the index + is ready for use. If the `Status` field value is `FAILED`, the + `ErrorMessage` field contains a message that explains why. + """ + type: str | None = ... + """The type of index attached to your Amazon Q Business application.""" + description: str | None = ... + """The description for the Amazon Q Business index.""" + created_at: datetime | None = ... + """The Unix timestamp when the Amazon Q Business index was created.""" + updated_at: datetime | None = ... + """The Unix timestamp when the Amazon Q Business index was last updated.""" + capacity_configuration: IndexCapacityConfiguration | None = ... + """The storage capacity units chosen for your Amazon Q Business index.""" + document_attribute_configurations: list[DocumentAttributeConfiguration] | None = ... + """ + Configuration information for document attributes or metadata. Document + metadata are fields associated with your documents. For example, the + company department name associated with each document. For more + information, see [Understanding document + attributes](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/doc-attributes-types.html#doc-attributes). + """ + error: ErrorDetail | None = ... + """ + When the `Status` field value is `FAILED`, the `ErrorMessage` field + contains a message that explains why. + """ + index_statistics: IndexStatistics | None = ... + """Provides information about the number of documents indexed.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetMediaInput(_SerdeShape): + """Dataclass for GetMediaInput structure.""" + + application_id: str | None = ... + """The identifier of the Amazon Q Business which contains the media object.""" + conversation_id: str | None = ... + """The identifier of the Amazon Q Business conversation.""" + message_id: str | None = ... + """The identifier of the Amazon Q Business message.""" + media_id: str | None = ... + """ + The identifier of the media object. You can find this in the + `sourceAttributions` returned by the `Chat`, `ChatSync`, and + `ListMessages` API responses. + """ + +@dataclass(kw_only=True) +class GetMediaOutput(_SerdeShape): + """Dataclass for GetMediaOutput structure.""" + + media_bytes: bytes | None = ... + """The base64-encoded bytes of the media object.""" + media_mime_type: str | None = ... + """The MIME type of the media object (image/png).""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetPluginInput(_SerdeShape): + """Dataclass for GetPluginInput structure.""" + + application_id: str | None = ... + """The identifier of the application which contains the plugin.""" + plugin_id: str | None = ... + """The identifier of the plugin.""" + +@dataclass(kw_only=True) +class GetPluginOutput(_SerdeShape): + """Dataclass for GetPluginOutput structure.""" + + application_id: str | None = ... + """The identifier of the application which contains the plugin.""" + plugin_id: str | None = ... + """The identifier of the plugin.""" + display_name: str | None = ... + """The name of the plugin.""" + type: str | None = ... + """The type of the plugin.""" + server_url: str | None = ... + """The source URL used for plugin configuration.""" + auth_configuration: PluginAuthConfiguration | None = ... + """ + Authentication configuration information for an Amazon Q Business + plugin. + """ + custom_plugin_configuration: CustomPluginConfiguration | None = ... + """Configuration information required to create a custom plugin.""" + build_status: str | None = ... + """The current status of a plugin. A plugin is modified asynchronously.""" + plugin_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the role with permission to access + resources needed to create the plugin. + """ + state: str | None = ... + """The current state of the plugin.""" + created_at: datetime | None = ... + """The timestamp for when the plugin was created.""" + updated_at: datetime | None = ... + """The timestamp for when the plugin was last updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetPolicyInput(_SerdeShape): + """Dataclass for GetPolicyInput structure.""" + + application_id: str | None = ... + """The unique identifier of the Amazon Q Business application.""" + +@dataclass(kw_only=True) +class GetPolicyOutput(_SerdeShape): + """Dataclass for GetPolicyOutput structure.""" + + policy: str | None = ... + """The JSON representation of the permission policy.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetRetrieverInput(_SerdeShape): + """Dataclass for GetRetrieverInput structure.""" + + application_id: str | None = ... + """The identifier of the Amazon Q Business application using the retriever.""" + retriever_id: str | None = ... + """The identifier of the retriever.""" + +@dataclass(kw_only=True) +class GetRetrieverOutput(_SerdeShape): + """Dataclass for GetRetrieverOutput structure.""" + + application_id: str | None = ... + """The identifier of the Amazon Q Business application using the retriever.""" + retriever_id: str | None = ... + """The identifier of the retriever.""" + retriever_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the IAM role associated with the + retriever. + """ + type: str | None = ... + """The type of the retriever.""" + status: str | None = ... + """The status of the retriever.""" + display_name: str | None = ... + """The name of the retriever.""" + configuration: RetrieverConfiguration | None = ... + """ + Provides information on how the retriever used for your Amazon Q + Business application is configured. + """ + role_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the role with the permission to access + the retriever and required resources. + """ + created_at: datetime | None = ... + """The Unix timestamp when the retriever was created.""" + updated_at: datetime | None = ... + """The Unix timestamp when the retriever was last updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetUserInput(_SerdeShape): + """Dataclass for GetUserInput structure.""" + + application_id: str | None = ... + """The identifier of the application connected to the user.""" + user_id: str | None = ... + """The user email address attached to the user.""" + +@dataclass(kw_only=True) +class GetUserOutput(_SerdeShape): + """Dataclass for GetUserOutput structure.""" + + user_aliases: list[UserAlias] | None = ... + """A list of user aliases attached to a user.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetWebExperienceInput(_SerdeShape): + """Dataclass for GetWebExperienceInput structure.""" + + application_id: str | None = ... + """ + The identifier of the Amazon Q Business application linked to the web + experience. + """ + web_experience_id: str | None = ... + """The identifier of the Amazon Q Business web experience.""" + +@dataclass(kw_only=True) +class GetWebExperienceOutput(_SerdeShape): + """Dataclass for GetWebExperienceOutput structure.""" + + application_id: str | None = ... + """ + The identifier of the Amazon Q Business application linked to the web + experience. + """ + web_experience_id: str | None = ... + """The identifier of the Amazon Q Business web experience.""" + web_experience_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the role with the permission to access + the Amazon Q Business web experience and required resources. + """ + default_endpoint: str | None = ... + """The endpoint of your Amazon Q Business web experience.""" + status: str | None = ... + """ + The current status of the Amazon Q Business web experience. When the + `Status` field value is `FAILED`, the `ErrorMessage` field contains a + description of the error that caused the data source connector to fail. + """ + created_at: datetime | None = ... + """ + The Unix timestamp when the Amazon Q Business web experience was last + created. + """ + updated_at: datetime | None = ... + """ + The Unix timestamp when the Amazon Q Business web experience was last + updated. + """ + title: str | None = ... + """The title for your Amazon Q Business web experience.""" + subtitle: str | None = ... + """The subtitle for your Amazon Q Business web experience.""" + welcome_message: str | None = ... + """ + The customized welcome message for end users of an Amazon Q Business web + experience. + """ + sample_prompts_control_mode: str | None = ... + """ + Determines whether sample prompts are enabled in the web experience for + an end user. + """ + origins: list[str] | None = ... + """ + Gets the website domain origins that are allowed to embed the Amazon Q + Business web experience. The *domain origin* refers to the base URL for + accessing a website including the protocol (`http/https`), the domain + name, and the port number (if specified). + """ + role_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the service role attached to your web + experience. + """ + identity_provider_configuration: IdentityProviderConfiguration | None = ... + """ + Information about the identity provider (IdP) used to authenticate end + users of an Amazon Q Business web experience. + """ + authentication_configuration: WebExperienceAuthConfiguration | None = ... + """ + The authentication configuration information for your Amazon Q Business + web experience. + """ + error: ErrorDetail | None = ... + """ + When the `Status` field value is `FAILED`, the `ErrorMessage` field + contains a description of the error that caused the data source + connector to fail. + """ + browser_extension_configuration: BrowserExtensionConfiguration | None = ... + """ + The browser extension configuration for an Amazon Q Business web + experience. + """ + customization_configuration: CustomizationConfiguration | None = ... + """ + Gets the custom logo, favicon, font, and color used in the Amazon Q web + experience. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GroupMembers(_SerdeShape): + """ + A list of users or sub groups that belong to a group. This is for + generating Amazon Q Business chat results only from document a user has + access to. + """ + + member_groups: list[MemberGroup] | None = ... + """ + A list of sub groups that belong to a group. For example, the sub groups + \"Research\", \"Engineering\", and \"Sales and Marketing\" all belong to + the group \"Company\". + """ + member_users: list[MemberUser] | None = ... + """ + A list of users that belong to a group. For example, a list of interns + all belong to the \"Interns\" group. + """ + s3_path_for_group_members: S3 | None = ... + """ + Information required for Amazon Q Business to find a specific file in an + Amazon S3 bucket. + """ + +class GroupStatus(UnknownEnumMixin, StrEnum): + FAILED = "FAILED" + SUCCEEDED = "SUCCEEDED" + PROCESSING = "PROCESSING" + DELETING = "DELETING" + DELETED = "DELETED" + +@dataclass(kw_only=True) +class GroupStatusDetail(_SerdeShape): + """Provides the details of a group's status.""" + + status: str | None = ... + """The status of a group.""" + last_updated_at: datetime | None = ... + """ + The Unix timestamp when the Amazon Q Business application was last + updated. + """ + error_detail: ErrorDetail | None = ... + """The details of an error associated a group status.""" + +@dataclass(kw_only=True) +class GroupSummary(_SerdeShape): + """Summary information for groups.""" + + group_name: str | None = ... + """The name of the group the summary information is for.""" + +@dataclass(kw_only=True) +class HallucinationReductionConfiguration(_SerdeShape): + """ + Configuration information required to setup hallucination reduction. For + more information, see [hallucination + reduction](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/hallucination-reduction.html). + + Note: + The hallucination reduction feature won't work if chat orchestration + controls are enabled for your application. + """ + + hallucination_reduction_control: str | None = ... + """ + Controls whether hallucination reduction has been enabled or disabled + for your application. The default status is `DISABLED`. + """ + +class HallucinationReductionControl(UnknownEnumMixin, StrEnum): + ENABLED = "ENABLED" + DISABLED = "DISABLED" + +@dataclass(kw_only=True) +class HookConfiguration(_SerdeShape): + """ + Provides the configuration information for invoking a Lambda function in + Lambda to alter document metadata and content when ingesting documents + into Amazon Q Business. + + You can configure your Lambda function using the + `PreExtractionHookConfiguration` parameter if you want to apply advanced + alterations on the original or raw documents. + + If you want to apply advanced alterations on the Amazon Q Business + structured documents, you must configure your Lambda function using + `PostExtractionHookConfiguration`. + + You can only invoke one Lambda function. However, this function can + invoke other functions it requires. + + For more information, see [Custom document + enrichment](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/custom-document-enrichment.html). + """ + + invocation_condition: DocumentAttributeCondition | None = ... + """ + The condition used for when a Lambda function should be invoked. + + For example, you can specify a condition that if there are empty + date-time values, then Amazon Q Business should invoke a function that + inserts the current date-time. + """ + lambda_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the Lambda function during ingestion. + For more information, see [Using Lambda functions for Amazon Q Business + document + enrichment](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/cde-lambda-operations.html). + """ + s3_bucket_name: str | None = ... + """ + Stores the original, raw documents or the structured, parsed documents + before and after altering them. For more information, see [Data + contracts for Lambda + functions](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/cde-lambda-operations.html#cde-lambda-operations-data-contracts). + """ + role_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of a role with permission to run + `PreExtractionHookConfiguration` and `PostExtractionHookConfiguration` + for altering document metadata and content during the document ingestion + process. + """ + +@dataclass(kw_only=True) +class IdcAuthConfiguration(_SerdeShape): + """ + Information about the IAM Identity Center Application used to configure + authentication for a plugin. + """ + + idc_application_arn: str + """ + The Amazon Resource Name (ARN) of the IAM Identity Center Application + used to configure authentication. + """ + role_arn: str + """ + The Amazon Resource Name (ARN) of the IAM role with permissions to + perform actions on Amazon Web Services services on your behalf. + """ + +@dataclass +class IdentityProviderConfigurationSamlConfiguration(_SerdeShape): + """ + Information about the SAML 2.0-compliant identity provider (IdP) used to + authenticate end users of an Amazon Q Business web experience. + """ + + value: SamlProviderConfiguration + +@dataclass +class IdentityProviderConfigurationOpenIDConnectConfiguration(_SerdeShape): + """ + Information about the OIDC-compliant identity provider (IdP) used to + authenticate end users of an Amazon Q Business web experience. + """ + + value: OpenIDConnectProviderConfiguration + +@dataclass +class IdentityProviderConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +IdentityProviderConfiguration = Union[ + IdentityProviderConfigurationSamlConfiguration + | IdentityProviderConfigurationOpenIDConnectConfiguration + | IdentityProviderConfigurationUnknown +] +""" +Provides information about the identity provider (IdP) used to +authenticate end users of an Amazon Q Business web experience. +""" + +class _IdentityProviderConfigurationDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> IdentityProviderConfiguration: ... + +class IdentityType(UnknownEnumMixin, StrEnum): + AWS_IAM_IDP_SAML = "AWS_IAM_IDP_SAML" + AWS_IAM_IDP_OIDC = "AWS_IAM_IDP_OIDC" + AWS_IAM_IDC = "AWS_IAM_IDC" + AWS_QUICKSIGHT_IDP = "AWS_QUICKSIGHT_IDP" + ANONYMOUS = "ANONYMOUS" + +@dataclass(kw_only=True) +class ImageExtractionConfiguration(_SerdeShape): + """ + The configuration for extracting semantic meaning from images in + documents. For more information, see [Extracting semantic meaning from + images and + visuals](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/extracting-meaning-from-images.html). + """ + + image_extraction_status: str + """ + Specify whether to extract semantic meaning from images and visuals from + documents. + """ + +class ImageExtractionStatus(UnknownEnumMixin, StrEnum): + ENABLED = "ENABLED" + DISABLED = "DISABLED" + +@dataclass(kw_only=True) +class ImageSourceDetails(_SerdeShape): + """Details about an image source, including its identifier and format.""" + + media_id: str | None = ... + """Unique identifier for the image file.""" + media_mime_type: str | None = ... + """The MIME type of the image file.""" + +@dataclass(kw_only=True) +class Index(_SerdeShape): + """Summary information for your Amazon Q Business index.""" + + display_name: str | None = ... + """The name of the index.""" + index_id: str | None = ... + """The identifier for the index.""" + created_at: datetime | None = ... + """The Unix timestamp when the index was created.""" + updated_at: datetime | None = ... + """The Unix timestamp when the index was last updated.""" + status: str | None = ... + """ + The current status of the index. When the status is `ACTIVE`, the index + is ready. + """ + +@dataclass(kw_only=True) +class IndexCapacityConfiguration(_SerdeShape): + """Provides information about index capacity configuration.""" + + units: int | None = ... + """The number of storage units configured for an Amazon Q Business index.""" + +@dataclass(kw_only=True) +class IndexStatistics(_SerdeShape): + """Provides information about the number of documents in an index.""" + + text_document_statistics: TextDocumentStatistics | None = ... + """The number of documents indexed.""" + +class IndexStatus(UnknownEnumMixin, StrEnum): + CREATING = "CREATING" + ACTIVE = "ACTIVE" + DELETING = "DELETING" + FAILED = "FAILED" + UPDATING = "UPDATING" + +class IndexType(UnknownEnumMixin, StrEnum): + ENTERPRISE = "ENTERPRISE" + STARTER = "STARTER" + +@dataclass(kw_only=True) +class InlineDocumentEnrichmentConfiguration(_SerdeShape): + """ + Provides the configuration information for applying basic logic to alter + document metadata and content when ingesting documents into Amazon Q + Business. + + To apply advanced logic, to go beyond what you can do with basic logic, + see + [`HookConfiguration`](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_HookConfiguration.html) + . + + For more information, see [Custom document + enrichment](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/custom-document-enrichment.html). + """ + + condition: DocumentAttributeCondition | None = ... + """ + The condition used for the target document attribute or metadata field + when ingesting documents into Amazon Q Business. You use this with + [`DocumentAttributeTarget`](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_DocumentAttributeTarget.html) + to apply the condition. + + For example, you can create the 'Department' target field and have it + prefill department names associated with the documents based on + information in the 'Source_URI' field. Set the condition that if the + 'Source_URI' field contains 'financial' in its URI value, then + prefill the target field 'Department' with the target value + 'Finance' for the document. + + Amazon Q Business can't create a target field if it has not already + been created as an index field. After you create your index field, you + can create a document metadata field using `DocumentAttributeTarget`. + Amazon Q Business then will map your newly created metadata field to + your index field. + """ + target: DocumentAttributeTarget | None = ... + """ + The target document attribute or metadata field you want to alter when + ingesting documents into Amazon Q Business. + + For example, you can delete all customer identification numbers + associated with the documents, stored in the document metadata field + called 'Customer_ID' by setting the target key as 'Customer_ID' and + the deletion flag to `TRUE`. This removes all customer ID values in the + field 'Customer_ID'. This would scrub personally identifiable + information from each document's metadata. + + Amazon Q Business can't create a target field if it has not already + been created as an index field. After you create your index field, you + can create a document metadata field using + [`DocumentAttributeTarget`](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_DocumentAttributeTarget.html) + . Amazon Q Business will then map your newly created document attribute + to your index field. + + You can also use this with + [`DocumentAttributeCondition`](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_DocumentAttributeCondition.html) + . + """ + document_content_operator: str | None = ... + """ + `TRUE` to delete content if the condition used for the target attribute + is met. + """ + +@dataclass(kw_only=True) +class InstructionCollection(_SerdeShape): + """ + A set of instructions that define how Amazon Q Business should generate + and format responses to user queries. This collection includes + parameters for controlling response characteristics such as length, + audience targeting, perspective, style, identity, tone, and custom + instructions. + """ + + response_length: str | None = ... + """ + Specifies the desired length of responses generated by Amazon Q + Business. This parameter allows administrators to control whether + responses are concise and brief or more detailed and comprehensive. + """ + target_audience: str | None = ... + """ + Defines the intended audience for the responses, allowing Amazon Q + Business to tailor its language, terminology, and explanations + appropriately. This could range from technical experts to general users + with varying levels of domain knowledge. + """ + perspective: str | None = ... + """ + Determines the point of view or perspective from which Amazon Q Business + generates responses, such as first-person, second-person, or + third-person perspective, affecting how information is presented to + users. + """ + output_style: str | None = ... + """ + Specifies the formatting and structural style of responses, such as + bullet points, paragraphs, step-by-step instructions, or other + organizational formats that enhance readability and comprehension. + """ + identity: str | None = ... + """ + Defines the persona or identity that Amazon Q Business should adopt when + responding to users, allowing for customization of the assistant's + character, role, or representation within an organization. + """ + tone: str | None = ... + """ + Controls the emotional tone and communication style of responses, such + as formal, casual, technical, friendly, or professional, to align with + organizational communication standards and user expectations. + """ + custom_instructions: str | None = ... + """ + Allows administrators to provide specific, custom instructions that + guide how Amazon Q Business should respond in particular scenarios or to + certain types of queries, enabling fine-grained control over response + generation. + """ + examples: str | None = ... + """ + Provides sample responses or templates that Amazon Q Business can + reference when generating responses, helping to establish consistent + patterns and formats for different types of user queries. + """ + +@dataclass(kw_only=True) +class InternalServerException(ServiceError, _SerdeShape): + """ + An issue occurred with the internal server used for your Amazon Q + Business service. Wait some minutes and try again, or contact + [Support](http://aws.amazon.com/contact-us/) for help. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class KendraIndexConfiguration(_SerdeShape): + """Stores an Amazon Kendra index as a retriever.""" + + index_id: str + """The identifier of the Amazon Kendra index.""" + +@dataclass(kw_only=True) +class LicenseNotFoundException(ServiceError, _SerdeShape): + """ + You don't have permissions to perform the action because your license + is inactive. Ask your admin to activate your license and try again after + your licence is active. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListApplicationsInput(_SerdeShape): + """Dataclass for ListApplicationsInput structure.""" + + next_token: str | None = ... + """ + If the `maxResults` response was incomplete because there is more data + to retrieve, Amazon Q Business returns a pagination token in the + response. You can use this pagination token to retrieve the next set of + Amazon Q Business applications. + """ + max_results: int | None = ... + """The maximum number of Amazon Q Business applications to return.""" + +@dataclass(kw_only=True) +class ListApplicationsOutput(_SerdeShape): + """Dataclass for ListApplicationsOutput structure.""" + + next_token: str | None = ... + """ + If the response is truncated, Amazon Q Business returns this token. You + can use this token in a subsequent request to retrieve the next set of + applications. + """ + applications: list[Application] | None = ... + """ + An array of summary information on the configuration of one or more + Amazon Q Business applications. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListAttachmentsInput(_SerdeShape): + """Dataclass for ListAttachmentsInput structure.""" + + application_id: str | None = ... + """The unique identifier for the Amazon Q Business application.""" + conversation_id: str | None = ... + """ + The unique identifier of the Amazon Q Business web experience + conversation. + """ + user_id: str | None = ... + """ + The unique identifier of the user involved in the Amazon Q Business web + experience conversation. + """ + next_token: str | None = ... + """ + If the number of attachments returned exceeds `maxResults`, Amazon Q + Business returns a next token as a pagination token to retrieve the next + set of attachments. + """ + max_results: int | None = ... + """The maximum number of attachements to return.""" + +@dataclass(kw_only=True) +class ListAttachmentsOutput(_SerdeShape): + """Dataclass for ListAttachmentsOutput structure.""" + + attachments: list[Attachment] | None = ... + """An array of information on one or more attachments.""" + next_token: str | None = ... + """ + If the response is truncated, Amazon Q Business returns this token, + which you can use in a later request to list the next set of + attachments. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListChatResponseConfigurationsInput(_SerdeShape): + """Dataclass for ListChatResponseConfigurationsInput structure.""" + + application_id: str | None = ... + """ + The unique identifier of the Amazon Q Business application for which to + list available chat response configurations. + """ + max_results: int | None = ... + """ + The maximum number of chat response configurations to return in a single + response. This parameter helps control pagination of results when many + configurations exist. + """ + next_token: str | None = ... + """ + A pagination token used to retrieve the next set of results when the + number of configurations exceeds the specified `maxResults` value. + """ + +@dataclass(kw_only=True) +class ListChatResponseConfigurationsOutput(_SerdeShape): + """Dataclass for ListChatResponseConfigurationsOutput structure.""" + + chat_response_configurations: list[ChatResponseConfiguration] | None = ... + """ + A list of chat response configuration summaries, each containing key + information about an available configuration in the specified + application. + """ + next_token: str | None = ... + """ + A pagination token that can be used in a subsequent request to retrieve + additional chat response configurations if the results were truncated + due to the `maxResults` parameter. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListConversationsInput(_SerdeShape): + """Dataclass for ListConversationsInput structure.""" + + application_id: str | None = ... + """The identifier of the Amazon Q Business application.""" + user_id: str | None = ... + """ + The identifier of the user involved in the Amazon Q Business web + experience conversation. + """ + next_token: str | None = ... + """ + If the `maxResults` response was incomplete because there is more data + to retrieve, Amazon Q Business returns a pagination token in the + response. You can use this pagination token to retrieve the next set of + Amazon Q Business conversations. + """ + max_results: int | None = ... + """The maximum number of Amazon Q Business conversations to return.""" + +@dataclass(kw_only=True) +class ListConversationsOutput(_SerdeShape): + """Dataclass for ListConversationsOutput structure.""" + + next_token: str | None = ... + """ + If the response is truncated, Amazon Q Business returns this token, + which you can use in a later request to list the next set of messages. + """ + conversations: list[Conversation] | None = ... + """ + An array of summary information on the configuration of one or more + Amazon Q Business web experiences. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListDataAccessorsInput(_SerdeShape): + """Dataclass for ListDataAccessorsInput structure.""" + + application_id: str | None = ... + """The unique identifier of the Amazon Q Business application.""" + next_token: str | None = ... + """ + The token for the next set of results. (You received this token from a + previous call.) + """ + max_results: int | None = ... + """The maximum number of results to return in a single call.""" + +@dataclass(kw_only=True) +class ListDataAccessorsOutput(_SerdeShape): + """Dataclass for ListDataAccessorsOutput structure.""" + + data_accessors: list[DataAccessor] | None = ... + """The list of data accessors.""" + next_token: str | None = ... + """The token to use to retrieve the next set of results, if there are any.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListDataSourcesInput(_SerdeShape): + """Dataclass for ListDataSourcesInput structure.""" + + application_id: str | None = ... + """ + The identifier of the Amazon Q Business application linked to the data + source connectors. + """ + index_id: str | None = ... + """ + The identifier of the index used with one or more data source + connectors. + """ + next_token: str | None = ... + """ + If the `maxResults` response was incomplete because there is more data + to retrieve, Amazon Q Business returns a pagination token in the + response. You can use this pagination token to retrieve the next set of + Amazon Q Business data source connectors. + """ + max_results: int | None = ... + """The maximum number of data source connectors to return.""" + +@dataclass(kw_only=True) +class ListDataSourcesOutput(_SerdeShape): + """Dataclass for ListDataSourcesOutput structure.""" + + data_sources: list[DataSource] | None = ... + """An array of summary information for one or more data source connector.""" + next_token: str | None = ... + """ + If the response is truncated, Amazon Q Business returns this token. You + can use this token in a subsequent request to retrieve the next set of + data source connectors. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListDataSourceSyncJobsInput(_SerdeShape): + """Dataclass for ListDataSourceSyncJobsInput structure.""" + + data_source_id: str | None = ... + """The identifier of the data source connector.""" + application_id: str | None = ... + """ + The identifier of the Amazon Q Business application connected to the + data source. + """ + index_id: str | None = ... + """ + The identifier of the index used with the Amazon Q Business data source + connector. + """ + next_token: str | None = ... + """ + If the `maxResults` response was incpmplete because there is more data + to retriever, Amazon Q Business returns a pagination token in the + response. You can use this pagination token to retrieve the next set of + responses. + """ + max_results: int | None = ... + """The maximum number of synchronization jobs to return in the response.""" + start_time: datetime | None = ... + """The start time of the data source connector sync.""" + end_time: datetime | None = ... + """The end time of the data source connector sync.""" + status_filter: str | None = ... + """ + Only returns synchronization jobs with the `Status` field equal to the + specified status. + """ + +@dataclass(kw_only=True) +class ListDataSourceSyncJobsOutput(_SerdeShape): + """Dataclass for ListDataSourceSyncJobsOutput structure.""" + + history: list[DataSourceSyncJob] | None = ... + """A history of synchronization jobs for the data source connector.""" + next_token: str | None = ... + """ + If the response is truncated, Amazon Q Business returns this token. You + can use this token in any subsequent request to retrieve the next set of + jobs. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListDocumentsInput(_SerdeShape): + """Dataclass for ListDocumentsInput structure.""" + + application_id: str | None = ... + """The identifier of the application id the documents are attached to.""" + index_id: str | None = ... + """The identifier of the index the documents are attached to.""" + data_source_ids: list[str] | None = ... + """The identifier of the data sources the documents are attached to.""" + next_token: str | None = ... + """ + If the `maxResults` response was incomplete because there is more data + to retrieve, Amazon Q Business returns a pagination token in the + response. You can use this pagination token to retrieve the next set of + documents. + """ + max_results: int | None = ... + """The maximum number of documents to return.""" + +@dataclass(kw_only=True) +class ListDocumentsOutput(_SerdeShape): + """Dataclass for ListDocumentsOutput structure.""" + + document_detail_list: list[DocumentDetails] | None = ... + """A list of document details.""" + next_token: str | None = ... + """ + If the `maxResults` response was incomplete because there is more data + to retrieve, Amazon Q Business returns a pagination token in the + response. You can use this pagination token to retrieve the next set of + documents. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListGroupsInput(_SerdeShape): + """Dataclass for ListGroupsInput structure.""" + + application_id: str | None = ... + """ + The identifier of the application for getting a list of groups mapped to + users. + """ + index_id: str | None = ... + """ + The identifier of the index for getting a list of groups mapped to + users. + """ + updated_earlier_than: datetime | None = ... + """ + The timestamp identifier used for the latest `PUT` or `DELETE` action + for mapping users to their groups. + """ + data_source_id: str | None = ... + """ + The identifier of the data source for getting a list of groups mapped to + users. + """ + next_token: str | None = ... + """ + If the previous response was incomplete (because there is more data to + retrieve), Amazon Q Business returns a pagination token in the response. + You can use this pagination token to retrieve the next set of groups + that are mapped to users. + """ + max_results: int | None = ... + """The maximum number of returned groups that are mapped to users.""" + +@dataclass(kw_only=True) +class ListGroupsOutput(_SerdeShape): + """Dataclass for ListGroupsOutput structure.""" + + next_token: str | None = ... + """ + If the response is truncated, Amazon Q Business returns this token that + you can use in the subsequent request to retrieve the next set of groups + that are mapped to users. + """ + items: list[GroupSummary] | None = ... + """Summary information for list of groups that are mapped to users.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListIndicesInput(_SerdeShape): + """Dataclass for ListIndicesInput structure.""" + + application_id: str | None = ... + """ + The identifier of the Amazon Q Business application connected to the + index. + """ + next_token: str | None = ... + """ + If the maxResults response was incomplete because there is more data to + retrieve, Amazon Q Business returns a pagination token in the response. + You can use this pagination token to retrieve the next set of Amazon Q + Business indices. + """ + max_results: int | None = ... + """The maximum number of indices to return.""" + +@dataclass(kw_only=True) +class ListIndicesOutput(_SerdeShape): + """Dataclass for ListIndicesOutput structure.""" + + next_token: str | None = ... + """ + If the response is truncated, Amazon Q Business returns this token that + you can use in the subsequent request to retrieve the next set of + indexes. + """ + indices: list[Index] | None = ... + """An array of information on the items in one or more indexes.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListMessagesInput(_SerdeShape): + """Dataclass for ListMessagesInput structure.""" + + conversation_id: str | None = ... + """The identifier of the Amazon Q Business web experience conversation.""" + application_id: str | None = ... + """The identifier for the Amazon Q Business application.""" + user_id: str | None = ... + """ + The identifier of the user involved in the Amazon Q Business web + experience conversation. + """ + next_token: str | None = ... + """ + If the number of messages returned exceeds `maxResults`, Amazon Q + Business returns a next token as a pagination token to retrieve the next + set of messages. + """ + max_results: int | None = ... + """The maximum number of messages to return.""" + +@dataclass(kw_only=True) +class ListMessagesOutput(_SerdeShape): + """Dataclass for ListMessagesOutput structure.""" + + messages: list[Message] | None = ... + """An array of information on one or more messages.""" + next_token: str | None = ... + """ + If the response is truncated, Amazon Q Business returns this token, + which you can use in a later request to list the next set of messages. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListPluginActionsInput(_SerdeShape): + """Dataclass for ListPluginActionsInput structure.""" + + application_id: str | None = ... + """ + The identifier of the Amazon Q Business application the plugin is + attached to. + """ + plugin_id: str | None = ... + """The identifier of the Amazon Q Business plugin.""" + next_token: str | None = ... + """ + If the number of plugin actions returned exceeds `maxResults`, Amazon Q + Business returns a next token as a pagination token to retrieve the next + set of plugin actions. + """ + max_results: int | None = ... + """The maximum number of plugin actions to return.""" + +@dataclass(kw_only=True) +class ListPluginActionsOutput(_SerdeShape): + """Dataclass for ListPluginActionsOutput structure.""" + + next_token: str | None = ... + """ + If the response is truncated, Amazon Q Business returns this token, + which you can use in a later request to list the next set of plugin + actions. + """ + items: list[ActionSummary] | None = ... + """An array of information on one or more plugin actions.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListPluginsInput(_SerdeShape): + """Dataclass for ListPluginsInput structure.""" + + application_id: str | None = ... + """The identifier of the application the plugin is attached to.""" + next_token: str | None = ... + """ + If the `maxResults` response was incomplete because there is more data + to retrieve, Amazon Q Business returns a pagination token in the + response. You can use this pagination token to retrieve the next set of + plugins. + """ + max_results: int | None = ... + """The maximum number of documents to return.""" + +@dataclass(kw_only=True) +class ListPluginsOutput(_SerdeShape): + """Dataclass for ListPluginsOutput structure.""" + + next_token: str | None = ... + """ + If the `maxResults` response was incomplete because there is more data + to retrieve, Amazon Q Business returns a pagination token in the + response. You can use this pagination token to retrieve the next set of + plugins. + """ + plugins: list[Plugin] | None = ... + """Information about a configured plugin.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListPluginTypeActionsInput(_SerdeShape): + """Dataclass for ListPluginTypeActionsInput structure.""" + + plugin_type: str | None = ... + """The type of the plugin.""" + next_token: str | None = ... + """ + If the number of plugins returned exceeds `maxResults`, Amazon Q + Business returns a next token as a pagination token to retrieve the next + set of plugins. + """ + max_results: int | None = ... + """The maximum number of plugins to return.""" + +@dataclass(kw_only=True) +class ListPluginTypeActionsOutput(_SerdeShape): + """Dataclass for ListPluginTypeActionsOutput structure.""" + + next_token: str | None = ... + """ + If the response is truncated, Amazon Q Business returns this token, + which you can use in a later request to list the next set of plugins. + """ + items: list[ActionSummary] | None = ... + """An array of information on one or more plugins.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListPluginTypeMetadataInput(_SerdeShape): + """Dataclass for ListPluginTypeMetadataInput structure.""" + + next_token: str | None = ... + """ + If the metadata returned exceeds `maxResults`, Amazon Q Business returns + a next token as a pagination token to retrieve the next set of metadata. + """ + max_results: int | None = ... + """The maximum number of plugin metadata items to return.""" + +@dataclass(kw_only=True) +class ListPluginTypeMetadataOutput(_SerdeShape): + """Dataclass for ListPluginTypeMetadataOutput structure.""" + + next_token: str | None = ... + """ + If the response is truncated, Amazon Q Business returns this token, + which you can use in a later request to list the next set of plugin + metadata. + """ + items: list[PluginTypeMetadataSummary] | None = ... + """An array of information on plugin metadata.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListRetrieversInput(_SerdeShape): + """Dataclass for ListRetrieversInput structure.""" + + application_id: str | None = ... + """The identifier of the Amazon Q Business application using the retriever.""" + next_token: str | None = ... + """ + If the number of retrievers returned exceeds `maxResults`, Amazon Q + Business returns a next token as a pagination token to retrieve the next + set of retrievers. + """ + max_results: int | None = ... + """The maximum number of retrievers returned.""" + +@dataclass(kw_only=True) +class ListRetrieversOutput(_SerdeShape): + """Dataclass for ListRetrieversOutput structure.""" + + retrievers: list[Retriever] | None = ... + """An array of summary information for one or more retrievers.""" + next_token: str | None = ... + """ + If the response is truncated, Amazon Q Business returns this token, + which you can use in a later request to list the next set of retrievers. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListSubscriptionsInput(_SerdeShape): + """Dataclass for ListSubscriptionsInput structure.""" + + application_id: str | None = ... + """ + The identifier of the Amazon Q Business application linked to the + subscription. + """ + next_token: str | None = ... + """ + If the `maxResults` response was incomplete because there is more data + to retrieve, Amazon Q Business returns a pagination token in the + response. You can use this pagination token to retrieve the next set of + Amazon Q Business subscriptions. + """ + max_results: int | None = ... + """The maximum number of Amazon Q Business subscriptions to return.""" + +@dataclass(kw_only=True) +class ListSubscriptionsOutput(_SerdeShape): + """Dataclass for ListSubscriptionsOutput structure.""" + + next_token: str | None = ... + """ + If the response is truncated, Amazon Q Business returns this token. You + can use this token in a subsequent request to retrieve the next set of + subscriptions. + """ + subscriptions: list[Subscription] | None = ... + """ + An array of summary information on the subscriptions configured for an + Amazon Q Business application. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListTagsForResourceInput(_SerdeShape): + """Dataclass for ListTagsForResourceInput structure.""" + + resource_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the Amazon Q Business application or + data source to get a list of tags for. + """ + +@dataclass(kw_only=True) +class ListTagsForResourceOutput(_SerdeShape): + """Dataclass for ListTagsForResourceOutput structure.""" + + tags: list[Tag] | None = ... + """ + A list of tags associated with the Amazon Q Business application or data + source. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListWebExperiencesInput(_SerdeShape): + """Dataclass for ListWebExperiencesInput structure.""" + + application_id: str | None = ... + """ + The identifier of the Amazon Q Business application linked to the listed + web experiences. + """ + next_token: str | None = ... + """ + If the `maxResults` response was incomplete because there is more data + to retrieve, Amazon Q Business returns a pagination token in the + response. You can use this pagination token to retrieve the next set of + Amazon Q Business conversations. + """ + max_results: int | None = ... + """The maximum number of Amazon Q Business Web Experiences to return.""" + +@dataclass(kw_only=True) +class ListWebExperiencesOutput(_SerdeShape): + """Dataclass for ListWebExperiencesOutput structure.""" + + web_experiences: list[WebExperience] | None = ... + """ + An array of summary information for one or more Amazon Q Business + experiences. + """ + next_token: str | None = ... + """ + If the response is truncated, Amazon Q Business returns this token, + which you can use in a later request to list the next set of messages. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class MediaExtractionConfiguration(_SerdeShape): + """The configuration for extracting information from media in documents.""" + + image_extraction_configuration: ImageExtractionConfiguration | None = ... + """ + The configuration for extracting semantic meaning from images in + documents. For more information, see [Extracting semantic meaning from + images and + visuals](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/extracting-meaning-from-images.html). + """ + audio_extraction_configuration: AudioExtractionConfiguration | None = ... + """ + Configuration settings for extracting and processing audio content from + media files. + """ + video_extraction_configuration: VideoExtractionConfiguration | None = ... + """ + Configuration settings for extracting and processing video content from + media files. + """ + +@dataclass(kw_only=True) +class MediaTooLargeException(ServiceError, _SerdeShape): + """The requested media object is too large to be returned.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class MemberGroup(_SerdeShape): + """The sub groups that belong to a group.""" + + group_name: str + """The name of the sub group.""" + type: str | None = ... + """The type of the sub group.""" + +class MemberRelation(UnknownEnumMixin, StrEnum): + AND_ = "AND" + OR_ = "OR" + +class MembershipType(UnknownEnumMixin, StrEnum): + INDEX = "INDEX" + DATASOURCE = "DATASOURCE" + +@dataclass(kw_only=True) +class MemberUser(_SerdeShape): + """The users that belong to a group.""" + + user_id: str + """The identifier of the user you want to map to a group.""" + type: str | None = ... + """The type of the user.""" + +@dataclass(kw_only=True) +class Message(_SerdeShape): + """A message in an Amazon Q Business web experience.""" + + message_id: str | None = ... + """The identifier of the Amazon Q Business web experience message.""" + body: str | None = ... + """The content of the Amazon Q Business web experience message.""" + time: datetime | None = ... + """The timestamp of the first Amazon Q Business web experience message.""" + type: str | None = ... + """ + The type of Amazon Q Business message, whether `HUMAN` or `AI` + generated. + """ + attachments: list[AttachmentOutput] | None = ... + """A file directly uploaded into an Amazon Q Business web experience chat.""" + source_attribution: list[SourceAttribution | None] | None = ... + """ + The source documents used to generate Amazon Q Business web experience + message. + """ + action_review: ActionReview | None = ... + """ + An output event that Amazon Q Business returns to an user who wants to + perform a plugin action during a non-streaming chat conversation. It + contains information about the selected action with a list of possible + user input fields, some pre-populated by Amazon Q Business. + """ + action_execution: ActionExecution | None = ... + """ + Performs an Amazon Q Business plugin action during a non-streaming chat + conversation. + """ + +class MessageType(UnknownEnumMixin, StrEnum): + USER = "USER" + SYSTEM = "SYSTEM" + +class MessageUsefulness(UnknownEnumMixin, StrEnum): + USEFUL = "USEFUL" + NOT_USEFUL = "NOT_USEFUL" + +@dataclass(kw_only=True) +class MessageUsefulnessFeedback(_SerdeShape): + """ + End user feedback on an AI-generated web experience chat message + usefulness. + """ + + usefulness: str + """The usefulness value assigned by an end user to a message.""" + reason: str | None = ... + """The reason for a usefulness rating.""" + comment: str | None = ... + """ + A comment given by an end user on the usefulness of an AI-generated chat + message. + """ + submitted_at: datetime + """The timestamp for when the feedback was submitted.""" + +class MessageUsefulnessReason(UnknownEnumMixin, StrEnum): + NOT_FACTUALLY_CORRECT = "NOT_FACTUALLY_CORRECT" + HARMFUL_OR_UNSAFE = "HARMFUL_OR_UNSAFE" + INCORRECT_OR_MISSING_SOURCES = "INCORRECT_OR_MISSING_SOURCES" + NOT_HELPFUL = "NOT_HELPFUL" + FACTUALLY_CORRECT = "FACTUALLY_CORRECT" + COMPLETE = "COMPLETE" + RELEVANT_SOURCES = "RELEVANT_SOURCES" + HELPFUL = "HELPFUL" + NOT_BASED_ON_DOCUMENTS = "NOT_BASED_ON_DOCUMENTS" + NOT_COMPLETE = "NOT_COMPLETE" + NOT_CONCISE = "NOT_CONCISE" + OTHER = "OTHER" + +@dataclass(kw_only=True) +class MetadataEvent(_SerdeShape): + """ + A metadata event for a AI-generated text output message in a Amazon Q + Business conversation, containing associated metadata generated. + """ + + conversation_id: str | None = ... + """ + The identifier of the conversation with which the generated metadata is + associated. + """ + user_message_id: str | None = ... + """ + The identifier of an Amazon Q Business end user text input message + within the conversation. + """ + system_message_id: str | None = ... + """ + The identifier of an Amazon Q Business AI generated message within the + conversation. + """ + source_attributions: list[SourceAttribution | None] | None = ... + """The source documents used to generate the conversation response.""" + final_text_message: str | None = ... + """The final text output message generated by the system.""" + +@dataclass(kw_only=True) +class NativeIndexConfiguration(_SerdeShape): + """Configuration information for an Amazon Q Business index.""" + + index_id: str + """The identifier for the Amazon Q Business index.""" + version: int | None = ... + """ + A read-only field that specifies the version of the + `NativeIndexConfiguration`. + + Amazon Q Business introduces enhanced document retrieval capabilities in + version 2 of `NativeIndexConfiguration`, focusing on streamlined + metadata boosting that prioritizes recency and source relevance to + deliver more accurate responses to your queries. Version 2 has the + following differences from version 1: + + - Version 2 supports a single Date field (created_at OR last_updated_at) + for recency boosting + + - Version 2 supports a single String field with an ordered list of up to + 5 values + + - Version 2 introduces number-based boost levels (ONE, TWO) alongside + the text-based levels + + - Version 2 allows specifying prioritization between Date and String + fields + + - Version 2 maintains backward compatibility with existing + configurations + """ + boosting_override: dict[str, DocumentAttributeBoostingConfiguration] | None = ... + """ + Overrides the default boosts applied by Amazon Q Business to supported + document attribute data types. + """ + +@dataclass(kw_only=True) +class NoAuthConfiguration(_SerdeShape): + """ + Information about invoking a custom plugin without any authentication or + authorization requirement. + """ + +@dataclass(kw_only=True) +class NumberAttributeBoostingConfiguration(_SerdeShape): + """ + Provides information on boosting `NUMBER` type document attributes. + + In the current boosting implementation, boosting focuses primarily on + `DATE` attributes for recency and `STRING` attributes for source + prioritization. `NUMBER` attributes can serve as additional boosting + factors when needed, but are not supported when using + `NativeIndexConfiguration` version 2. + + For more information on how boosting document attributes work in Amazon + Q Business, see [Boosting using document + attributes](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/metadata-boosting.html). + """ + + boosting_level: str + """ + Specifies the priority of boosted document attributes in relation to + other boosted attributes. This parameter determines how strongly the + attribute influences document ranking in search results. `NUMBER` + attributes can serve as additional boosting factors when needed, but are + not supported when using `NativeIndexConfiguration` version 2. + """ + boosting_type: str | None = ... + """ + Specifies whether higher or lower numeric values should be prioritized + when boosting. Valid values are ASCENDING (higher numbers are more + important) and DESCENDING (lower numbers are more important). + """ + +class NumberAttributeBoostingType(UnknownEnumMixin, StrEnum): + PRIORITIZE_LARGER_VALUES = "PRIORITIZE_LARGER_VALUES" + PRIORITIZE_SMALLER_VALUES = "PRIORITIZE_SMALLER_VALUES" + +@dataclass(kw_only=True) +class OAuth2ClientCredentialConfiguration(_SerdeShape): + """ + Information about the OAuth 2.0 authentication credential/token used to + configure a plugin. + """ + + secret_arn: str + """ + The ARN of the Secrets Manager secret that stores the OAuth 2.0 + credentials/token used for plugin configuration. + """ + role_arn: str + """ + The ARN of an IAM role used by Amazon Q Business to access the OAuth 2.0 + authentication credentials stored in a Secrets Manager secret. + """ + authorization_url: str | None = ... + """ + The redirect URL required by the OAuth 2.0 protocol for Amazon Q + Business to authenticate a plugin user through a third party + authentication server. + """ + token_url: str | None = ... + """ + The URL required by the OAuth 2.0 protocol to exchange an end user + authorization code for an access token. + """ + +@dataclass(kw_only=True) +class OpenIDConnectProviderConfiguration(_SerdeShape): + """ + Information about the OIDC-compliant identity provider (IdP) used to + authenticate end users of an Amazon Q Business web experience. + """ + + secrets_arn: str + """ + The Amazon Resource Name (ARN) of a Secrets Manager secret containing + the OIDC client secret. + """ + secrets_role: str + """ + An IAM role with permissions to access KMS to decrypt the Secrets + Manager secret containing your OIDC client secret. + """ + +@dataclass(kw_only=True) +class OrchestrationConfiguration(_SerdeShape): + """ + Configuration information required to enable chat orchestration for your + Amazon Q Business application. + + Note: + Chat orchestration is optimized to work for English language content. + For more details on language support in Amazon Q Business, see + [Supported + languages](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/supported-languages.html). + """ + + control: str + """ + Status information about whether chat orchestration is activated or + deactivated for your Amazon Q Business application. + """ + +class OrchestrationControl(UnknownEnumMixin, StrEnum): + ENABLED = "ENABLED" + DISABLED = "DISABLED" + +class OutputFormat(UnknownEnumMixin, StrEnum): + RAW = "RAW" + EXTRACTED = "EXTRACTED" + +@dataclass(kw_only=True) +class PermissionCondition(_SerdeShape): + """ + Defines a condition that restricts when a permission is effective. + Conditions allow you to control access based on specific attributes of + the request. + """ + + condition_operator: str + """ + The operator to use for the condition evaluation. This determines how + the condition values are compared. + """ + condition_key: str + """ + The key for the condition. This identifies the attribute that the + condition applies to. + """ + condition_values: list[str] + """The values to compare against using the specified condition operator.""" + +class PermissionConditionOperator(UnknownEnumMixin, StrEnum): + STRING_EQUALS = "StringEquals" + +@dataclass(kw_only=True) +class PersonalizationConfiguration(_SerdeShape): + """ + Configuration information about chat response personalization. For more + information, see [Personalizing chat + responses](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/personalizing-chat-responses.html). + """ + + personalization_control_mode: str + """ + An option to allow Amazon Q Business to customize chat responses using + user specific metadata---specifically, location and job information---in + your IAM Identity Center instance. + """ + +class PersonalizationControlMode(UnknownEnumMixin, StrEnum): + ENABLED = "ENABLED" + DISABLED = "DISABLED" + +@dataclass(kw_only=True) +class Plugin(_SerdeShape): + """Information about an Amazon Q Business plugin and its configuration.""" + + plugin_id: str | None = ... + """The identifier of the plugin.""" + display_name: str | None = ... + """The name of the plugin.""" + type: str | None = ... + """The type of the plugin.""" + server_url: str | None = ... + """The plugin server URL used for configuration.""" + state: str | None = ... + """The current status of the plugin.""" + build_status: str | None = ... + """The status of the plugin.""" + created_at: datetime | None = ... + """The timestamp for when the plugin was created.""" + updated_at: datetime | None = ... + """The timestamp for when the plugin was last updated.""" + +@dataclass +class PluginAuthConfigurationBasicAuthConfiguration(_SerdeShape): + """ + Information about the basic authentication credentials used to configure + a plugin. + """ + + value: BasicAuthConfiguration + +@dataclass +class PluginAuthConfigurationOAuth2ClientCredentialConfiguration(_SerdeShape): + """ + Information about the OAuth 2.0 authentication credential/token used to + configure a plugin. + """ + + value: OAuth2ClientCredentialConfiguration + +@dataclass +class PluginAuthConfigurationNoAuthConfiguration(_SerdeShape): + """Information about invoking a custom plugin without any authentication.""" + + value: NoAuthConfiguration + +@dataclass +class PluginAuthConfigurationIdcAuthConfiguration(_SerdeShape): + """ + Information about the IAM Identity Center Application used to configure + authentication for a plugin. + """ + + value: IdcAuthConfiguration + +@dataclass +class PluginAuthConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +PluginAuthConfiguration = Union[ + PluginAuthConfigurationBasicAuthConfiguration + | PluginAuthConfigurationOAuth2ClientCredentialConfiguration + | PluginAuthConfigurationNoAuthConfiguration + | PluginAuthConfigurationIdcAuthConfiguration + | PluginAuthConfigurationUnknown +] +""" +Authentication configuration information for an Amazon Q Business +plugin. +""" + +class _PluginAuthConfigurationDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> PluginAuthConfiguration: ... + +class PluginBuildStatus(UnknownEnumMixin, StrEnum): + READY = "READY" + CREATE_IN_PROGRESS = "CREATE_IN_PROGRESS" + CREATE_FAILED = "CREATE_FAILED" + UPDATE_IN_PROGRESS = "UPDATE_IN_PROGRESS" + UPDATE_FAILED = "UPDATE_FAILED" + DELETE_IN_PROGRESS = "DELETE_IN_PROGRESS" + DELETE_FAILED = "DELETE_FAILED" + +@dataclass(kw_only=True) +class PluginConfiguration(_SerdeShape): + """ + Configuration information required to invoke chat in `PLUGIN_MODE`. + + For more information, see [Admin controls and + guardrails](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/guardrails.html), + [Plugins](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/plugins.html), + and [Conversation + settings](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/using-web-experience.html#chat-source-scope). + """ + + plugin_id: str + """The identifier of the plugin you want to use.""" + +class PluginState(UnknownEnumMixin, StrEnum): + ENABLED = "ENABLED" + DISABLED = "DISABLED" + +class PluginType(UnknownEnumMixin, StrEnum): + SERVICE_NOW = "SERVICE_NOW" + SALESFORCE = "SALESFORCE" + JIRA = "JIRA" + ZENDESK = "ZENDESK" + CUSTOM = "CUSTOM" + QUICKSIGHT = "QUICKSIGHT" + SERVICENOW_NOW_PLATFORM = "SERVICENOW_NOW_PLATFORM" + JIRA_CLOUD = "JIRA_CLOUD" + SALESFORCE_CRM = "SALESFORCE_CRM" + ZENDESK_SUITE = "ZENDESK_SUITE" + ATLASSIAN_CONFLUENCE = "ATLASSIAN_CONFLUENCE" + GOOGLE_CALENDAR = "GOOGLE_CALENDAR" + MICROSOFT_TEAMS = "MICROSOFT_TEAMS" + MICROSOFT_EXCHANGE = "MICROSOFT_EXCHANGE" + PAGERDUTY_ADVANCE = "PAGERDUTY_ADVANCE" + SMARTSHEET = "SMARTSHEET" + ASANA = "ASANA" + +class PluginTypeCategory(UnknownEnumMixin, StrEnum): + CRM = "Customer relationship management (CRM)" + PROJECT_MANAGEMENT = "Project management" + COMMUNICATION = "Communication" + PRODUCTIVITY = "Productivity" + TICKETING_MANAGEMENT = "Ticketing and incident management" + +@dataclass(kw_only=True) +class PluginTypeMetadataSummary(_SerdeShape): + """Summary metadata information for a Amazon Q Business plugin.""" + + type: str | None = ... + """The type of the plugin.""" + category: str | None = ... + """The category of the plugin type.""" + description: str | None = ... + """ + The description assigned by Amazon Q Business to a plugin. You can't + modify this value. + """ + +@dataclass +class Principal_User(_SerdeShape): + """The user associated with the principal.""" + + value: PrincipalUser + +@dataclass +class Principal_Group(_SerdeShape): + """The group associated with the principal.""" + + value: PrincipalGroup + +@dataclass +class PrincipalUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +Principal = Union[Principal_User | Principal_Group | PrincipalUnknown] +""" +Provides user and group information used for filtering documents to use +for generating Amazon Q Business conversation responses. +""" + +class _PrincipalDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> Principal: ... + +@dataclass(kw_only=True) +class PrincipalGroup(_SerdeShape): + """Provides information about a group associated with the principal.""" + + name: str | None = ... + """The name of the group.""" + access: str + """ + Provides information about whether to allow or deny access to the + principal. + """ + membership_type: str | None = ... + """The type of group.""" + +@dataclass(kw_only=True) +class PrincipalUser(_SerdeShape): + """Provides information about a user associated with a principal.""" + + id: str | None = ... + """The identifier of the user.""" + access: str + """ + Provides information about whether to allow or deny access to the + principal. + """ + membership_type: str | None = ... + """The type of group.""" + +@dataclass(kw_only=True) +class PutFeedbackInput(_SerdeShape): + """Dataclass for PutFeedbackInput structure.""" + + application_id: str | None = ... + """The identifier of the application associated with the feedback.""" + user_id: str | None = ... + """The identifier of the user giving the feedback.""" + conversation_id: str | None = ... + """The identifier of the conversation the feedback is attached to.""" + message_id: str | None = ... + """The identifier of the chat message that the feedback was given for.""" + message_copied_at: datetime | None = ... + """The timestamp for when the feedback was recorded.""" + message_usefulness: MessageUsefulnessFeedback | None = ... + """The feedback usefulness value given by the user to the chat message.""" + +@dataclass(kw_only=True) +class PutFeedbackOutput(_SerdeShape): + """Dataclass for PutFeedbackOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class PutGroupInput(_SerdeShape): + """Dataclass for PutGroupInput structure.""" + + application_id: str | None = ... + """ + The identifier of the application in which the user and group mapping + belongs. + """ + index_id: str | None = ... + """ + The identifier of the index in which you want to map users to their + groups. + """ + group_name: str | None = ... + """ + The list that contains your users or sub groups that belong the same + group. For example, the group \"Company\" includes the user \"CEO\" and + the sub groups \"Research\", \"Engineering\", and \"Sales and + Marketing\". + """ + data_source_id: str | None = ... + """ + The identifier of the data source for which you want to map users to + their groups. This is useful if a group is tied to multiple data + sources, but you only want the group to access documents of a certain + data source. For example, the groups \"Research\", \"Engineering\", and + \"Sales and Marketing\" are all tied to the company's documents stored + in the data sources Confluence and Salesforce. However, \"Sales and + Marketing\" team only needs access to customer-related documents stored + in Salesforce. + """ + type: str | None = ... + """The type of the group.""" + group_members: GroupMembers | None = ... + """ + A list of users or sub groups that belong to a group. This is for + generating Amazon Q Business chat results only from document a user has + access to. + """ + role_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of an IAM role that has access to the S3 + file that contains your list of users that belong to a group. + """ + +@dataclass(kw_only=True) +class PutGroupOutput(_SerdeShape): + """Dataclass for PutGroupOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class QAppsConfiguration(_SerdeShape): + """Configuration information about Amazon Q Apps.""" + + q_apps_control_mode: str + """ + Status information about whether end users can create and use Amazon Q + Apps in the web experience. + """ + +class QAppsControlMode(UnknownEnumMixin, StrEnum): + ENABLED = "ENABLED" + DISABLED = "DISABLED" + +@dataclass(kw_only=True) +class QuickSightConfiguration(_SerdeShape): + """ + The Amazon Quick Suite configuration for an Amazon Q Business + application that uses Quick Suite as the identity provider. For more + information, see [Creating an Amazon Quick Suite integrated + application](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/create-quicksight-integrated-application.html). + """ + + client_namespace: str + """ + The Amazon Quick Suite namespace that is used as the identity provider. + For more information about Quick Suite namespaces, see [Namespace + operations](https://docs.aws.amazon.com/quicksight/latest/developerguide/namespace-operations.html). + """ + +class ReadAccessType(UnknownEnumMixin, StrEnum): + ALLOW = "ALLOW" + DENY = "DENY" + +@dataclass(kw_only=True) +class RelevantContent(_SerdeShape): + """Represents a piece of content that is relevant to a search query.""" + + content: str | None = ... + """The actual content of the relevant item.""" + document_id: str | None = ... + """The unique identifier of the document containing the relevant content.""" + document_title: str | None = ... + """The title of the document containing the relevant content.""" + document_uri: str | None = ... + """The URI of the document containing the relevant content.""" + document_attributes: list[DocumentAttribute] | None = ... + """Additional attributes of the document containing the relevant content.""" + score_attributes: ScoreAttributes | None = ... + """Attributes related to the relevance score of the content.""" + +@dataclass(kw_only=True) +class ResourceNotFoundException(ServiceError, _SerdeShape): + """ + The application or plugin resource you want to use doesn't exist. Make + sure you have provided the correct resource and try again. + """ + + resource_id: str + """The identifier of the resource affected.""" + resource_type: str + """The type of the resource affected.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ResponseConfiguration(_SerdeShape): + """ + Configuration settings to define how Amazon Q Business generates and + formats responses to user queries. This includes customization options + for response style, tone, length, and other characteristics. + """ + + instruction_collection: InstructionCollection | None = ... + """ + A collection of instructions that guide how Amazon Q Business generates + responses, including parameters for response length, target audience, + perspective, output style, identity, tone, and custom instructions. + """ + +class ResponseConfigurationType(UnknownEnumMixin, StrEnum): + ALL = "ALL" + +class ResponseScope(UnknownEnumMixin, StrEnum): + ENTERPRISE_CONTENT_ONLY = "ENTERPRISE_CONTENT_ONLY" + EXTENDED_KNOWLEDGE_ENABLED = "EXTENDED_KNOWLEDGE_ENABLED" + +@dataclass(kw_only=True) +class Retriever(_SerdeShape): + """ + Summary information for the retriever used for your Amazon Q Business + application. + """ + + application_id: str | None = ... + """The identifier of the Amazon Q Business application using the retriever.""" + retriever_id: str | None = ... + """ + The identifier of the retriever used by your Amazon Q Business + application. + """ + type: str | None = ... + """The type of your retriever.""" + status: str | None = ... + """The status of your retriever.""" + display_name: str | None = ... + """The name of your retriever.""" + +@dataclass +class RetrieverConfigurationNativeIndexConfiguration(_SerdeShape): + """ + Provides information on how a Amazon Q Business index used as a + retriever for your Amazon Q Business application is configured. + """ + + value: NativeIndexConfiguration + +@dataclass +class RetrieverConfigurationKendraIndexConfiguration(_SerdeShape): + """ + Provides information on how the Amazon Kendra index used as a retriever + for your Amazon Q Business application is configured. + """ + + value: KendraIndexConfiguration + +@dataclass +class RetrieverConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +RetrieverConfiguration = Union[ + RetrieverConfigurationNativeIndexConfiguration + | RetrieverConfigurationKendraIndexConfiguration + | RetrieverConfigurationUnknown +] +""" +Provides information on how the retriever used for your Amazon Q +Business application is configured. +""" + +class _RetrieverConfigurationDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> RetrieverConfiguration: ... + +@dataclass(kw_only=True) +class RetrieverContentSource(_SerdeShape): + """Specifies a retriever as the content source for a search.""" + + retriever_id: str + """The unique identifier of the retriever to use as the content source.""" + +class RetrieverStatus(UnknownEnumMixin, StrEnum): + CREATING = "CREATING" + ACTIVE = "ACTIVE" + FAILED = "FAILED" + +class RetrieverType(UnknownEnumMixin, StrEnum): + NATIVE_INDEX = "NATIVE_INDEX" + KENDRA_INDEX = "KENDRA_INDEX" + +@dataclass(kw_only=True) +class Rule(_SerdeShape): + """ + Guardrail rules for an Amazon Q Business application. Amazon Q Business + supports only one rule at a time. + """ + + included_users_and_groups: UsersAndGroups | None = ... + """Users and groups to be included in a rule.""" + excluded_users_and_groups: UsersAndGroups | None = ... + """Users and groups to be excluded from a rule.""" + rule_type: str + """The type of rule.""" + rule_configuration: RuleConfiguration | None = ... + """The configuration information for a rule.""" + +@dataclass +class RuleConfigurationContentBlockerRule(_SerdeShape): + """ + A rule for configuring how Amazon Q Business responds when it encounters + a a blocked topic. + """ + + value: ContentBlockerRule + +@dataclass +class RuleConfigurationContentRetrievalRule(_SerdeShape): + """ + Rules for retrieving content from data sources connected to a Amazon Q + Business application for a specific topic control configuration. + """ + + value: ContentRetrievalRule + +@dataclass +class RuleConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +RuleConfiguration = Union[ + RuleConfigurationContentBlockerRule + | RuleConfigurationContentRetrievalRule + | RuleConfigurationUnknown +] +"""Provides configuration information about a rule.""" + +class _RuleConfigurationDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> RuleConfiguration: ... + +class RuleType(UnknownEnumMixin, StrEnum): + CONTENT_BLOCKER_RULE = "CONTENT_BLOCKER_RULE" + CONTENT_RETRIEVAL_RULE = "CONTENT_RETRIEVAL_RULE" + +@dataclass(kw_only=True) +class S3(_SerdeShape): + """ + Information required for Amazon Q Business to find a specific file in an + Amazon S3 bucket. + """ + + bucket: str + """The name of the S3 bucket that contains the file.""" + key: str + """The name of the file.""" + +@dataclass(kw_only=True) +class SamlConfiguration(_SerdeShape): + """ + Provides the SAML 2.0 compliant identity provider (IdP) configuration + information Amazon Q Business needs to deploy a Amazon Q Business web + experience. + """ + + metadata_xml: str + """The metadata XML that your IdP generated.""" + role_arn: str + """ + The Amazon Resource Name (ARN) of an IAM role assumed by users when they + authenticate into their Amazon Q Business web experience, containing the + relevant Amazon Q Business permissions for conversing with Amazon Q + Business. + """ + user_id_attribute: str + """The user attribute name in your IdP that maps to the user email.""" + user_group_attribute: str | None = ... + """The group attribute name in your IdP that maps to user groups.""" + +@dataclass(kw_only=True) +class SamlProviderConfiguration(_SerdeShape): + """ + Information about the SAML 2.0-compliant identity provider (IdP) used to + authenticate end users of an Amazon Q Business web experience. + """ + + authentication_url: str + """ + The URL where Amazon Q Business end users will be redirected for + authentication. + """ + +@dataclass(kw_only=True) +class ScoreAttributes(_SerdeShape): + """Provides information about the relevance score of content.""" + + score_confidence: str | None = ... + """The confidence level of the relevance score.""" + +class ScoreConfidence(UnknownEnumMixin, StrEnum): + VERY_HIGH = "VERY_HIGH" + HIGH = "HIGH" + MEDIUM = "MEDIUM" + LOW = "LOW" + NOT_AVAILABLE = "NOT_AVAILABLE" + +@dataclass(kw_only=True) +class SearchRelevantContentInput(_SerdeShape): + """Dataclass for SearchRelevantContentInput structure.""" + + application_id: str | None = ... + """The unique identifier of the Amazon Q Business application to search.""" + query_text: str | None = ... + """The text to search for.""" + content_source: ContentSource | None = ... + """The source of content to search in.""" + attribute_filter: AttributeFilter | None = ... + """ + Enables filtering of responses based on document attributes or metadata + fields. + """ + max_results: int = ... + """The maximum number of results to return.""" + next_token: str | None = ... + """ + The token for the next set of results. (You received this token from a + previous call.) + """ + +@dataclass(kw_only=True) +class SearchRelevantContentOutput(_SerdeShape): + """Dataclass for SearchRelevantContentOutput structure.""" + + relevant_content: list[RelevantContent] | None = ... + """The list of relevant content items found.""" + next_token: str | None = ... + """The token to use to retrieve the next set of results, if there are any.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ServiceQuotaExceededException(ServiceError, _SerdeShape): + """You have exceeded the set limits for your Amazon Q Business service.""" + + resource_id: str + """The identifier of the resource affected.""" + resource_type: str + """The type of the resource affected.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class SnippetExcerpt(_SerdeShape): + """ + Contains the relevant text excerpt from a source that was used to + generate a citation text segment in an Amazon Q Business chat response. + """ + + text: str | None = ... + """ + The relevant text excerpt from a source that was used to generate a + citation text segment in an Amazon Q chat response. + """ + +@dataclass(kw_only=True) +class SourceAttribution(_SerdeShape): + """ + The documents used to generate an Amazon Q Business web experience + response. + """ + + title: str | None = ... + """ + The title of the document which is the source for the Amazon Q Business + generated response. + """ + snippet: str | None = ... + """ + The content extract from the document on which the generated response is + based. + """ + url: str | None = ... + """ + The URL of the document which is the source for the Amazon Q Business + generated response. + """ + citation_number: int | None = ... + """ + The number attached to a citation in an Amazon Q Business generated + response. + """ + updated_at: datetime | None = ... + """ + The Unix timestamp when the Amazon Q Business application was last + updated. + """ + text_message_segments: list[TextSegment] | None = ... + """ + A text extract from a source document that is used for source + attribution. + """ + document_id: str | None = ... + """ + The unique identifier of the source document used in the citation, + obtained from the Amazon Q Business index during chat response + generation. This ID is used as input to the `GetDocumentContent` API to + retrieve the actual document content for user verification. + """ + index_id: str | None = ... + """ + The identifier of the index containing the source document's metadata + and access control information. This links the citation back to the + specific Amazon Q Business index where the document's searchable + content and permissions are stored. + """ + datasource_id: str | None = ... + """ + The identifier of the data source from which the document was ingested. + This field is not present if the document is ingested by directly + calling the BatchPutDocument API (similar to checkDocumentAccess). If + the document is from a file-upload data source, the datasource will be + \"uploaded-docs-file-stat-datasourceid\". + """ + +@dataclass +class SourceDetailsImageSourceDetails(_SerdeShape): + """Details specific to image content within the source.""" + + value: ImageSourceDetails + +@dataclass +class SourceDetailsAudioSourceDetails(_SerdeShape): + """Details specific to audio content within the source.""" + + value: AudioSourceDetails + +@dataclass +class SourceDetailsVideoSourceDetails(_SerdeShape): + """Details specific to video content within the source.""" + + value: VideoSourceDetails + +@dataclass +class SourceDetailsUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +SourceDetails = Union[ + SourceDetailsImageSourceDetails + | SourceDetailsAudioSourceDetails + | SourceDetailsVideoSourceDetails + | SourceDetailsUnknown +] +""" +Container for details about different types of media sources (image, +audio, or video). +""" + +class _SourceDetailsDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> SourceDetails: ... + +@dataclass(kw_only=True) +class StartDataSourceSyncJobInput(_SerdeShape): + """Dataclass for StartDataSourceSyncJobInput structure.""" + + data_source_id: str | None = ... + """The identifier of the data source connector.""" + application_id: str | None = ... + """ + The identifier of Amazon Q Business application the data source is + connected to. + """ + index_id: str | None = ... + """The identifier of the index used with the data source connector.""" + +@dataclass(kw_only=True) +class StartDataSourceSyncJobOutput(_SerdeShape): + """Dataclass for StartDataSourceSyncJobOutput structure.""" + + execution_id: str | None = ... + """The identifier for a particular synchronization job.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class Status(UnknownEnumMixin, StrEnum): + ENABLED = "ENABLED" + DISABLED = "DISABLED" + +@dataclass(kw_only=True) +class StopDataSourceSyncJobInput(_SerdeShape): + """Dataclass for StopDataSourceSyncJobInput structure.""" + + data_source_id: str | None = ... + """The identifier of the data source connector.""" + application_id: str | None = ... + """ + The identifier of the Amazon Q Business application that the data source + is connected to. + """ + index_id: str | None = ... + """ + The identifier of the index used with the Amazon Q Business data source + connector. + """ + +@dataclass(kw_only=True) +class StopDataSourceSyncJobOutput(_SerdeShape): + """Dataclass for StopDataSourceSyncJobOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class StringAttributeBoostingConfiguration(_SerdeShape): + """ + Provides information on boosting `STRING` type document attributes. + + Note: + For `STRING` and `STRING_LIST` type document attributes to be used for + boosting on the console and the API, they must be enabled for search + using the + [DocumentAttributeConfiguration](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_DocumentAttributeConfiguration.html) + object of the + [UpdateIndex](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_UpdateIndex.html) + API. If you haven't enabled searching on these attributes, you can't + boost attributes of these data types on either the console or the API. + + For more information on how boosting document attributes work in Amazon + Q Business, see [Boosting using document + attributes](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/metadata-boosting.html). + """ + + boosting_level: str + """ + Specifies the priority tier ranking of boosting applied to document + attributes. For version 2, this parameter indicates the relative ranking + between boosted fields (ONE being highest priority, TWO being second + highest, etc.) and determines the order in which attributes influence + document ranking in search results. For version 1, this parameter + specifies the boosting intensity. For version 2, boosting intensity + (VERY HIGH, HIGH, MEDIUM, LOW, NONE) are not supported. Note that in + version 2, you are not allowed to boost on only one field and make this + value TWO. + """ + attribute_value_boosting: dict[str, str] | None = ... + """ + Specifies specific values of a `STRING` type document attribute being + boosted. When using `NativeIndexConfiguration` version 2, you can + specify up to five values in order of priority. + """ + +class StringAttributeValueBoostingLevel(UnknownEnumMixin, StrEnum): + LOW = "LOW" + MEDIUM = "MEDIUM" + HIGH = "HIGH" + VERY_HIGH = "VERY_HIGH" + ONE = "ONE" + TWO = "TWO" + THREE = "THREE" + FOUR = "FOUR" + FIVE = "FIVE" + +@dataclass(kw_only=True) +class StringListAttributeBoostingConfiguration(_SerdeShape): + """ + Provides information on boosting `STRING_LIST` type document attributes. + + In the current boosting implementation, boosting focuses primarily on + `DATE` attributes for recency and `STRING` attributes for source + prioritization. `STRING_LIST` attributes can serve as additional + boosting factors when needed, but are not supported when using + `NativeIndexConfiguration` version 2. + + Note: + For `STRING` and `STRING_LIST` type document attributes to be used for + boosting on the console and the API, they must be enabled for search + using the + [DocumentAttributeConfiguration](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_DocumentAttributeConfiguration.html) + object of the + [UpdateIndex](https://docs.aws.amazon.com/amazonq/latest/api-reference/API_UpdateIndex.html) + API. If you haven't enabled searching on these attributes, you can't + boost attributes of these data types on either the console or the API. + + For more information on how boosting document attributes work in Amazon + Q Business, see [Boosting using document + attributes](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/metadata-boosting.html). + """ + + boosting_level: str + """ + Specifies the priority of boosted document attributes in relation to + other boosted attributes. This parameter determines how strongly the + attribute influences document ranking in search results. `STRING_LIST` + attributes can serve as additional boosting factors when needed, but are + not supported when using `NativeIndexConfiguration` version 2. + """ + +@dataclass(kw_only=True) +class Subscription(_SerdeShape): + """ + Information about an Amazon Q Business subscription. + + Subscriptions are used to provide access for an IAM Identity Center user + or a group to an Amazon Q Business application. + + Amazon Q Business offers two subscription tiers: `Q_LITE` and + `Q_BUSINESS`. Subscription tier determines feature access for the user. + For more information on subscriptions and pricing tiers, see [Amazon Q + Business pricing](https://aws.amazon.com/q/business/pricing/). + """ + + subscription_id: str | None = ... + """The identifier of the Amazon Q Business subscription to be updated.""" + subscription_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the Amazon Q Business subscription + that was updated. + """ + principal: SubscriptionPrincipal | None = ... + """ + The IAM Identity Center `UserId` or `GroupId` of a user or group in the + IAM Identity Center instance connected to the Amazon Q Business + application. + """ + current_subscription: SubscriptionDetails | None = ... + """The type of your current Amazon Q Business subscription.""" + next_subscription: SubscriptionDetails | None = ... + """The type of the Amazon Q Business subscription for the next month.""" + +@dataclass(kw_only=True) +class SubscriptionDetails(_SerdeShape): + """The details of an Amazon Q Business subscription.""" + + type: str | None = ... + """The type of an Amazon Q Business subscription.""" + +@dataclass +class SubscriptionPrincipalUser(_SerdeShape): + """ + The identifier of a user in the IAM Identity Center instance connected + to the Amazon Q Business application. + """ + + value: str + +@dataclass +class SubscriptionPrincipalGroup(_SerdeShape): + """ + The identifier of a group in the IAM Identity Center instance connected + to the Amazon Q Business application. + """ + + value: str + +@dataclass +class SubscriptionPrincipalUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +SubscriptionPrincipal = Union[ + SubscriptionPrincipalUser + | SubscriptionPrincipalGroup + | SubscriptionPrincipalUnknown +] +""" +A user or group in the IAM Identity Center instance connected to the +Amazon Q Business application. +""" + +class _SubscriptionPrincipalDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> SubscriptionPrincipal: ... + +class SubscriptionType(UnknownEnumMixin, StrEnum): + Q_LITE = "Q_LITE" + Q_BUSINESS = "Q_BUSINESS" + +class SystemMessageType(UnknownEnumMixin, StrEnum): + RESPONSE = "RESPONSE" + GROUNDED_RESPONSE = "GROUNDED_RESPONSE" + +@dataclass(kw_only=True) +class Tag(_SerdeShape): + """ + A list of key/value pairs that identify an index, FAQ, or data source. + Tag keys and values can consist of Unicode letters, digits, white space, + and any of the following symbols: _ . : / = + - @. + """ + + key: str + """ + The key for the tag. Keys are not case sensitive and must be unique for + the Amazon Q Business application or data source. + """ + value: str + """ + The value associated with the tag. The value may be an empty string but + it can't be null. + """ + +@dataclass(kw_only=True) +class TagResourceInput(_SerdeShape): + """Dataclass for TagResourceInput structure.""" + + resource_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the Amazon Q Business application or + data source to tag. + """ + tags: list[Tag] | None = ... + """ + A list of tag keys to add to the Amazon Q Business application or data + source. If a tag already exists, the existing value is replaced with the + new value. + """ + +@dataclass(kw_only=True) +class TagResourceOutput(_SerdeShape): + """Dataclass for TagResourceOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class TextDocumentStatistics(_SerdeShape): + """Provides information about text documents in an index.""" + + indexed_text_bytes: int | None = ... + """The total size, in bytes, of the indexed documents.""" + indexed_text_document_count: int | None = ... + """The number of text documents indexed.""" + +@dataclass(kw_only=True) +class TextInputEvent(_SerdeShape): + """ + An input event for a end user message in an Amazon Q Business web + experience. + """ + + user_message: str + """A user message in a text message input event.""" + +@dataclass(kw_only=True) +class TextOutputEvent(_SerdeShape): + """ + An output event for an AI-generated response in an Amazon Q Business web + experience. + """ + + system_message_type: str | None = ... + """ + The type of AI-generated message in a `TextOutputEvent`. Amazon Q + Business currently supports two types of messages: + + - `RESPONSE` - The Amazon Q Business system response. + + - `GROUNDED_RESPONSE` - The corrected, hallucination-reduced, response + returned by Amazon Q Business. Available only if hallucination + reduction is supported and configured for the application and detected + in the end user chat query by Amazon Q Business. + """ + conversation_id: str | None = ... + """ + The identifier of the conversation with which the text output event is + associated. + """ + user_message_id: str | None = ... + """The identifier of an end user message in a `TextOutputEvent`.""" + system_message_id: str | None = ... + """The identifier of an AI-generated message in a `TextOutputEvent`.""" + system_message: str | None = ... + """An AI-generated message in a `TextOutputEvent`.""" + +@dataclass(kw_only=True) +class TextSegment(_SerdeShape): + """ + Provides information about a text extract in a chat response that can be + attributed to a source document. + """ + + begin_offset: int | None = ... + """ + The zero-based location in the response string where the source + attribution starts. + """ + end_offset: int | None = ... + """ + The zero-based location in the response string where the source + attribution ends. + """ + snippet_excerpt: SnippetExcerpt | None = ... + """ + The relevant text excerpt from a source that was used to generate a + citation text segment in an Amazon Q Business chat response. + """ + media_id: str | None = ... + """ + The identifier of the media object associated with the text segment in + the source attribution. + """ + media_mime_type: str | None = ... + """ + The MIME type (image/png) of the media object associated with the text + segment in the source attribution. + """ + source_details: SourceDetails | None = ... + """ + Source information for a segment of extracted text, including its media + type. + """ + +@dataclass(kw_only=True) +class ThrottlingException(ServiceError, _SerdeShape): + """ + The request was denied due to throttling. Reduce the number of requests + and try again. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class TopicConfiguration(_SerdeShape): + """ + The topic specific controls configured for an Amazon Q Business + application. + """ + + name: str + """A name for your topic control configuration.""" + description: str | None = ... + """ + A description for your topic control configuration. Use this to outline + how the large language model (LLM) should use this topic control + configuration. + """ + example_chat_messages: list[str] | None = ... + """ + A list of example phrases that you expect the end user to use in + relation to the topic. + """ + rules: list[Rule] + """Rules defined for a topic configuration.""" + +@dataclass(kw_only=True) +class UntagResourceInput(_SerdeShape): + """Dataclass for UntagResourceInput structure.""" + + resource_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the Amazon Q Business application, or + data source to remove the tag from. + """ + tag_keys: list[str] | None = ... + """ + A list of tag keys to remove from the Amazon Q Business application or + data source. If a tag key does not exist on the resource, it is ignored. + """ + +@dataclass(kw_only=True) +class UntagResourceOutput(_SerdeShape): + """Dataclass for UntagResourceOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateApplicationInput(_SerdeShape): + """Dataclass for UpdateApplicationInput structure.""" + + application_id: str | None = ... + """The identifier of the Amazon Q Business application.""" + identity_center_instance_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the IAM Identity Center instance you + are either creating for---or connecting to---your Amazon Q Business + application. + """ + display_name: str | None = ... + """A name for the Amazon Q Business application.""" + description: str | None = ... + """A description for the Amazon Q Business application.""" + role_arn: str | None = ... + """ + An Amazon Web Services Identity and Access Management (IAM) role that + gives Amazon Q Business permission to access Amazon CloudWatch logs and + metrics. + """ + attachments_configuration: AttachmentsConfiguration | None = ... + """An option to allow end users to upload files directly during chat.""" + q_apps_configuration: QAppsConfiguration | None = ... + """ + An option to allow end users to create and use Amazon Q Apps in the web + experience. + """ + personalization_configuration: PersonalizationConfiguration | None = ... + """ + Configuration information about chat response personalization. For more + information, see [Personalizing chat + responses](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/personalizing-chat-responses.html). + """ + auto_subscription_configuration: AutoSubscriptionConfiguration | None = ... + """ + An option to enable updating the default subscription type assigned to + an Amazon Q Business application using IAM identity federation for user + management. + """ + +@dataclass(kw_only=True) +class UpdateApplicationOutput(_SerdeShape): + """Dataclass for UpdateApplicationOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateChatControlsConfigurationInput(_SerdeShape): + """Dataclass for UpdateChatControlsConfigurationInput structure.""" + + application_id: str | None = ... + """ + The identifier of the application for which the chat controls are + configured. + """ + client_token: str | None = ... + """ + A token that you provide to identify the request to update a Amazon Q + Business application chat configuration. + """ + response_scope: str | None = ... + """ + The response scope configured for your application. This determines + whether your application uses its retrieval augmented generation (RAG) + system to generate answers only from your enterprise data, or also uses + the large language models (LLM) knowledge to respons to end user + questions in chat. + """ + orchestration_configuration: OrchestrationConfiguration | None = ... + """The chat response orchestration settings for your application.""" + blocked_phrases_configuration_update: BlockedPhrasesConfigurationUpdate | None = ... + """The phrases blocked from chat by your chat control configuration.""" + topic_configurations_to_create_or_update: list[TopicConfiguration] | None = ... + """The configured topic specific chat controls you want to update.""" + topic_configurations_to_delete: list[TopicConfiguration] | None = ... + """The configured topic specific chat controls you want to delete.""" + creator_mode_configuration: CreatorModeConfiguration | None = ... + """The configuration details for `CREATOR_MODE`.""" + hallucination_reduction_configuration: ( + HallucinationReductionConfiguration | None + ) = ... + """The hallucination reduction settings for your application.""" + +@dataclass(kw_only=True) +class UpdateChatControlsConfigurationOutput(_SerdeShape): + """Dataclass for UpdateChatControlsConfigurationOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateChatResponseConfigurationInput(_SerdeShape): + """Dataclass for UpdateChatResponseConfigurationInput structure.""" + + application_id: str | None = ... + """ + The unique identifier of the Amazon Q Business application containing + the chat response configuration to update. + """ + chat_response_configuration_id: str | None = ... + """ + The unique identifier of the chat response configuration to update + within the specified application. + """ + display_name: str | None = ... + """ + The new human-readable name to assign to the chat response + configuration, making it easier to identify among multiple + configurations. + """ + response_configurations: dict[str, ResponseConfiguration] | None = ... + """ + The updated collection of response configuration settings that define + how Amazon Q Business generates and formats responses to user queries. + """ + client_token: str | None = ... + """ + A unique, case-sensitive identifier to ensure idempotency of the + request. This helps prevent the same update from being processed + multiple times if retries occur. + """ + +@dataclass(kw_only=True) +class UpdateChatResponseConfigurationOutput(_SerdeShape): + """Dataclass for UpdateChatResponseConfigurationOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateDataAccessorInput(_SerdeShape): + """Dataclass for UpdateDataAccessorInput structure.""" + + application_id: str | None = ... + """The unique identifier of the Amazon Q Business application.""" + data_accessor_id: str | None = ... + """The unique identifier of the data accessor to update.""" + action_configurations: list[ActionConfiguration] | None = ... + """ + The updated list of action configurations specifying the allowed actions + and any associated filters. + """ + authentication_detail: DataAccessorAuthenticationDetail | None = ... + """ + The updated authentication configuration details for the data accessor. + This specifies how the ISV will authenticate when accessing data through + this data accessor. + """ + display_name: str | None = ... + """The updated friendly name for the data accessor.""" + +@dataclass(kw_only=True) +class UpdateDataAccessorOutput(_SerdeShape): + """Dataclass for UpdateDataAccessorOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateDataSourceInput(_SerdeShape): + """Dataclass for UpdateDataSourceInput structure.""" + + application_id: str | None = ... + """ + The identifier of the Amazon Q Business application the data source is + attached to. + """ + index_id: str | None = ... + """The identifier of the index attached to the data source connector.""" + data_source_id: str | None = ... + """The identifier of the data source connector.""" + display_name: str | None = ... + """A name of the data source connector.""" + configuration: _Document | None = ... + """ + Provides the configuration information for an Amazon Q Business data + source. + """ + vpc_configuration: DataSourceVpcConfiguration | None = ... + """ + Provides configuration information needed to connect to an Amazon VPC + (Virtual Private Cloud). + """ + description: str | None = ... + """The description of the data source connector.""" + sync_schedule: str | None = ... + """The chosen update frequency for your data source.""" + role_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of an IAM role with permission to access + the data source and required resources. + """ + document_enrichment_configuration: DocumentEnrichmentConfiguration | None = ... + """ + Provides the configuration information for altering document metadata + and content during the document ingestion process. + + For more information, see [Custom document + enrichment](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/custom-document-enrichment.html). + """ + media_extraction_configuration: MediaExtractionConfiguration | None = ... + """ + The configuration for extracting information from media in documents for + your data source. + """ + +@dataclass(kw_only=True) +class UpdateDataSourceOutput(_SerdeShape): + """Dataclass for UpdateDataSourceOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateIndexInput(_SerdeShape): + """Dataclass for UpdateIndexInput structure.""" + + application_id: str | None = ... + """ + The identifier of the Amazon Q Business application connected to the + index. + """ + index_id: str | None = ... + """The identifier of the Amazon Q Business index.""" + display_name: str | None = ... + """The name of the Amazon Q Business index.""" + description: str | None = ... + """The description of the Amazon Q Business index.""" + capacity_configuration: IndexCapacityConfiguration | None = ... + """ + The storage capacity units you want to provision for your Amazon Q + Business index. You can add and remove capacity to fit your usage needs. + """ + document_attribute_configurations: list[DocumentAttributeConfiguration] | None = ... + """ + Configuration information for document metadata or fields. Document + metadata are fields or attributes associated with your documents. For + example, the company department name associated with each document. For + more information, see [Understanding document + attributes](https://docs.aws.amazon.com/amazonq/latest/business-use-dg/doc-attributes-types.html#doc-attributes). + """ + +@dataclass(kw_only=True) +class UpdateIndexOutput(_SerdeShape): + """Dataclass for UpdateIndexOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdatePluginInput(_SerdeShape): + """Dataclass for UpdatePluginInput structure.""" + + application_id: str | None = ... + """The identifier of the application the plugin is attached to.""" + plugin_id: str | None = ... + """The identifier of the plugin.""" + display_name: str | None = ... + """The name of the plugin.""" + state: str | None = ... + """The status of the plugin.""" + server_url: str | None = ... + """The source URL used for plugin configuration.""" + custom_plugin_configuration: CustomPluginConfiguration | None = ... + """The configuration for a custom plugin.""" + auth_configuration: PluginAuthConfiguration | None = ... + """The authentication configuration the plugin is using.""" + +@dataclass(kw_only=True) +class UpdatePluginOutput(_SerdeShape): + """Dataclass for UpdatePluginOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateRetrieverInput(_SerdeShape): + """Dataclass for UpdateRetrieverInput structure.""" + + application_id: str | None = ... + """The identifier of your Amazon Q Business application.""" + retriever_id: str | None = ... + """The identifier of your retriever.""" + configuration: RetrieverConfiguration | None = ... + """ + Provides information on how the retriever used for your Amazon Q + Business application is configured. + """ + display_name: str | None = ... + """The name of your retriever.""" + role_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of an IAM role with permission to access + the retriever and required resources. + """ + +@dataclass(kw_only=True) +class UpdateRetrieverOutput(_SerdeShape): + """Dataclass for UpdateRetrieverOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateSubscriptionInput(_SerdeShape): + """Dataclass for UpdateSubscriptionInput structure.""" + + application_id: str | None = ... + """ + The identifier of the Amazon Q Business application where the + subscription update should take effect. + """ + subscription_id: str | None = ... + """The identifier of the Amazon Q Business subscription to be updated.""" + type: str | None = ... + """The type of the Amazon Q Business subscription to be updated.""" + +@dataclass(kw_only=True) +class UpdateSubscriptionOutput(_SerdeShape): + """Dataclass for UpdateSubscriptionOutput structure.""" + + subscription_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the Amazon Q Business subscription + that was updated. + """ + current_subscription: SubscriptionDetails | None = ... + """The type of your current Amazon Q Business subscription.""" + next_subscription: SubscriptionDetails | None = ... + """The type of the Amazon Q Business subscription for the next month.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateUserInput(_SerdeShape): + """Dataclass for UpdateUserInput structure.""" + + application_id: str | None = ... + """The identifier of the application the user is attached to.""" + user_id: str | None = ... + """The email id attached to the user.""" + user_aliases_to_update: list[UserAlias] | None = ... + """The user aliases attached to the user id that are to be updated.""" + user_aliases_to_delete: list[UserAlias] | None = ... + """The user aliases attached to the user id that are to be deleted.""" + +@dataclass(kw_only=True) +class UpdateUserOutput(_SerdeShape): + """Dataclass for UpdateUserOutput structure.""" + + user_aliases_added: list[UserAlias] | None = ... + """The user aliases that have been to be added to a user id.""" + user_aliases_updated: list[UserAlias] | None = ... + """The user aliases attached to a user id that have been updated.""" + user_aliases_deleted: list[UserAlias] | None = ... + """The user aliases that have been deleted from a user id.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateWebExperienceInput(_SerdeShape): + """Dataclass for UpdateWebExperienceInput structure.""" + + application_id: str | None = ... + """ + The identifier of the Amazon Q Business application attached to the web + experience. + """ + web_experience_id: str | None = ... + """The identifier of the Amazon Q Business web experience.""" + role_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the role with permission to access the + Amazon Q Business web experience and required resources. + """ + authentication_configuration: WebExperienceAuthConfiguration | None = ... + """ + The authentication configuration of the Amazon Q Business web + experience. + """ + title: str | None = ... + """The title of the Amazon Q Business web experience.""" + subtitle: str | None = ... + """The subtitle of the Amazon Q Business web experience.""" + welcome_message: str | None = ... + """ + A customized welcome message for an end user in an Amazon Q Business web + experience. + """ + sample_prompts_control_mode: str | None = ... + """ + Determines whether sample prompts are enabled in the web experience for + an end user. + """ + identity_provider_configuration: IdentityProviderConfiguration | None = ... + """ + Information about the identity provider (IdP) used to authenticate end + users of an Amazon Q Business web experience. + """ + origins: list[str] | None = ... + """ + Updates the website domain origins that are allowed to embed the Amazon + Q Business web experience. The *domain origin* refers to the *base URL* + for accessing a website including the protocol (`http/https`), the + domain name, and the port number (if specified). + + Note: + - Any values except `null` submitted as part of this update will replace + all previous values. + + - You must only submit a *base URL* and not a full path. For example, + `https://docs.aws.amazon.com`. + """ + browser_extension_configuration: BrowserExtensionConfiguration | None = ... + """ + The browser extension configuration for an Amazon Q Business web + experience. + + Note: + For Amazon Q Business application using external OIDC-compliant identity + providers (IdPs). The IdP administrator must add the browser extension + sign-in redirect URLs to the IdP application. For more information, see + [Configure external OIDC identity provider for your browser + extensions.](https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/browser-extensions.html). + """ + customization_configuration: CustomizationConfiguration | None = ... + """ + Updates the custom logo, favicon, font, and color used in the Amazon Q + web experience. + """ + +@dataclass(kw_only=True) +class UpdateWebExperienceOutput(_SerdeShape): + """Dataclass for UpdateWebExperienceOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UserAlias(_SerdeShape): + """Aliases attached to a user id within an Amazon Q Business application.""" + + index_id: str | None = ... + """The identifier of the index that the user aliases are associated with.""" + data_source_id: str | None = ... + """ + The identifier of the data source that the user aliases are associated + with. + """ + user_id: str + """The identifier of the user id associated with the user aliases.""" + +@dataclass(kw_only=True) +class UsersAndGroups(_SerdeShape): + """ + Provides information about users and group names associated with a topic + control rule. + """ + + user_ids: list[str] | None = ... + """The user ids associated with a topic control rule.""" + user_groups: list[str] | None = ... + """The user group names associated with a topic control rule.""" + +@dataclass(kw_only=True) +class ValidationException(ServiceError, _SerdeShape): + """ + The input doesn't meet the constraints set by the Amazon Q Business + service. Provide the correct input and try again. + """ + + reason: str + """The reason for the `ValidationException`.""" + fields: list[ValidationExceptionField] | None = ... + """The input field(s) that failed validation.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ValidationExceptionField(_SerdeShape): + """ + The input failed to meet the constraints specified by Amazon Q Business + in a specified field. + """ + + name: str + """The field name where the invalid entry was detected.""" + message: str + """A message about the validation exception.""" + +class ValidationExceptionReason(UnknownEnumMixin, StrEnum): + CANNOT_PARSE = "CANNOT_PARSE" + FIELD_VALIDATION_FAILED = "FIELD_VALIDATION_FAILED" + UNKNOWN_OPERATION = "UNKNOWN_OPERATION" + +@dataclass(kw_only=True) +class VideoExtractionConfiguration(_SerdeShape): + """Configuration settings for video content extraction and processing.""" + + video_extraction_status: str + """ + The status of video extraction (ENABLED or DISABLED) for processing + video content from files. + """ + +class VideoExtractionStatus(UnknownEnumMixin, StrEnum): + ENABLED = "ENABLED" + DISABLED = "DISABLED" + +class VideoExtractionType(UnknownEnumMixin, StrEnum): + TRANSCRIPT = "TRANSCRIPT" + SUMMARY = "SUMMARY" + +@dataclass(kw_only=True) +class VideoSourceDetails(_SerdeShape): + """ + Details about a video source, including its identifier, format, and time + information. + """ + + media_id: str | None = ... + """Unique identifier for the video media file.""" + media_mime_type: str | None = ... + """The MIME type of the video file (e.g., video/mp4, video/avi).""" + start_time_milliseconds: int | None = ... + """The starting timestamp in milliseconds for the relevant video segment.""" + end_time_milliseconds: int | None = ... + """The ending timestamp in milliseconds for the relevant video segment.""" + video_extraction_type: str | None = ... + """The type of video extraction performed on the content.""" + +@dataclass(kw_only=True) +class WebExperience(_SerdeShape): + """Provides information for an Amazon Q Business web experience.""" + + web_experience_id: str | None = ... + """The identifier of your Amazon Q Business web experience.""" + created_at: datetime | None = ... + """ + The Unix timestamp when the Amazon Q Business application was last + updated. + """ + updated_at: datetime | None = ... + """ + The Unix timestamp when your Amazon Q Business web experience was + updated. + """ + default_endpoint: str | None = ... + """ + The endpoint URLs for your Amazon Q Business web experience. The URLs + are unique and fully hosted by Amazon Web Services. + """ + status: str | None = ... + """The status of your Amazon Q Business web experience.""" + +@dataclass +class WebExperienceAuthConfigurationSamlConfiguration(_SerdeShape): + """ + Provides the SAML 2.0 compliant identity provider (IdP) configuration + information Amazon Q Business needs to deploy a Amazon Q Business web + experience. + """ + + value: SamlConfiguration + +@dataclass +class WebExperienceAuthConfigurationUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +WebExperienceAuthConfiguration = Union[ + WebExperienceAuthConfigurationSamlConfiguration + | WebExperienceAuthConfigurationUnknown +] +""" +Provides the authorization configuration information needed to deploy a +Amazon Q Business web experience to end users. +""" + +class _WebExperienceAuthConfigurationDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> WebExperienceAuthConfiguration: ... + +class WebExperienceSamplePromptsControlMode(UnknownEnumMixin, StrEnum): + ENABLED = "ENABLED" + DISABLED = "DISABLED" + +class WebExperienceStatus(UnknownEnumMixin, StrEnum): + CREATING = "CREATING" + ACTIVE = "ACTIVE" + DELETING = "DELETING" + FAILED = "FAILED" + PENDING_AUTH_CONFIG = "PENDING_AUTH_CONFIG" + +ASSOCIATE_PERMISSION: APIOperation[AssociatePermissionInput, AssociatePermissionOutput] +BATCH_DELETE_DOCUMENT: APIOperation[BatchDeleteDocumentInput, BatchDeleteDocumentOutput] +BATCH_PUT_DOCUMENT: APIOperation[BatchPutDocumentInput, BatchPutDocumentOutput] +CANCEL_SUBSCRIPTION: APIOperation[CancelSubscriptionInput, CancelSubscriptionOutput] +CHAT: APIOperation[ChatInput, ChatOutput] +CHAT_SYNC: APIOperation[ChatSyncInput, ChatSyncOutput] +CHECK_DOCUMENT_ACCESS: APIOperation[CheckDocumentAccessInput, CheckDocumentAccessOutput] +CREATE_ANONYMOUS_WEB_EXPERIENCE_URL: APIOperation[ + CreateAnonymousWebExperienceUrlInput, CreateAnonymousWebExperienceUrlOutput +] +CREATE_APPLICATION: APIOperation[CreateApplicationInput, CreateApplicationOutput] +CREATE_CHAT_RESPONSE_CONFIGURATION: APIOperation[ + CreateChatResponseConfigurationInput, CreateChatResponseConfigurationOutput +] +CREATE_DATA_ACCESSOR: APIOperation[CreateDataAccessorInput, CreateDataAccessorOutput] +CREATE_DATA_SOURCE: APIOperation[CreateDataSourceInput, CreateDataSourceOutput] +CREATE_INDEX: APIOperation[CreateIndexInput, CreateIndexOutput] +CREATE_PLUGIN: APIOperation[CreatePluginInput, CreatePluginOutput] +CREATE_RETRIEVER: APIOperation[CreateRetrieverInput, CreateRetrieverOutput] +CREATE_SUBSCRIPTION: APIOperation[CreateSubscriptionInput, CreateSubscriptionOutput] +CREATE_USER: APIOperation[CreateUserInput, CreateUserOutput] +CREATE_WEB_EXPERIENCE: APIOperation[CreateWebExperienceInput, CreateWebExperienceOutput] +DELETE_APPLICATION: APIOperation[DeleteApplicationInput, DeleteApplicationOutput] +DELETE_ATTACHMENT: APIOperation[DeleteAttachmentInput, DeleteAttachmentOutput] +DELETE_CHAT_CONTROLS_CONFIGURATION: APIOperation[ + DeleteChatControlsConfigurationInput, DeleteChatControlsConfigurationOutput +] +DELETE_CHAT_RESPONSE_CONFIGURATION: APIOperation[ + DeleteChatResponseConfigurationInput, DeleteChatResponseConfigurationOutput +] +DELETE_CONVERSATION: APIOperation[DeleteConversationInput, DeleteConversationOutput] +DELETE_DATA_ACCESSOR: APIOperation[DeleteDataAccessorInput, DeleteDataAccessorOutput] +DELETE_DATA_SOURCE: APIOperation[DeleteDataSourceInput, DeleteDataSourceOutput] +DELETE_GROUP: APIOperation[DeleteGroupInput, DeleteGroupOutput] +DELETE_INDEX: APIOperation[DeleteIndexInput, DeleteIndexOutput] +DELETE_PLUGIN: APIOperation[DeletePluginInput, DeletePluginOutput] +DELETE_RETRIEVER: APIOperation[DeleteRetrieverInput, DeleteRetrieverOutput] +DELETE_USER: APIOperation[DeleteUserInput, DeleteUserOutput] +DELETE_WEB_EXPERIENCE: APIOperation[DeleteWebExperienceInput, DeleteWebExperienceOutput] +DISASSOCIATE_PERMISSION: APIOperation[ + DisassociatePermissionInput, DisassociatePermissionOutput +] +GET_APPLICATION: APIOperation[GetApplicationInput, GetApplicationOutput] +GET_CHAT_CONTROLS_CONFIGURATION: APIOperation[ + GetChatControlsConfigurationInput, GetChatControlsConfigurationOutput +] +GET_CHAT_RESPONSE_CONFIGURATION: APIOperation[ + GetChatResponseConfigurationInput, GetChatResponseConfigurationOutput +] +GET_DATA_ACCESSOR: APIOperation[GetDataAccessorInput, GetDataAccessorOutput] +GET_DATA_SOURCE: APIOperation[GetDataSourceInput, GetDataSourceOutput] +GET_DOCUMENT_CONTENT: APIOperation[GetDocumentContentInput, GetDocumentContentOutput] +GET_GROUP: APIOperation[GetGroupInput, GetGroupOutput] +GET_INDEX: APIOperation[GetIndexInput, GetIndexOutput] +GET_MEDIA: APIOperation[GetMediaInput, GetMediaOutput] +GET_PLUGIN: APIOperation[GetPluginInput, GetPluginOutput] +GET_POLICY: APIOperation[GetPolicyInput, GetPolicyOutput] +GET_RETRIEVER: APIOperation[GetRetrieverInput, GetRetrieverOutput] +GET_USER: APIOperation[GetUserInput, GetUserOutput] +GET_WEB_EXPERIENCE: APIOperation[GetWebExperienceInput, GetWebExperienceOutput] +LIST_APPLICATIONS: APIOperation[ListApplicationsInput, ListApplicationsOutput] +LIST_ATTACHMENTS: APIOperation[ListAttachmentsInput, ListAttachmentsOutput] +LIST_CHAT_RESPONSE_CONFIGURATIONS: APIOperation[ + ListChatResponseConfigurationsInput, ListChatResponseConfigurationsOutput +] +LIST_CONVERSATIONS: APIOperation[ListConversationsInput, ListConversationsOutput] +LIST_DATA_ACCESSORS: APIOperation[ListDataAccessorsInput, ListDataAccessorsOutput] +LIST_DATA_SOURCES: APIOperation[ListDataSourcesInput, ListDataSourcesOutput] +LIST_DATA_SOURCE_SYNC_JOBS: APIOperation[ + ListDataSourceSyncJobsInput, ListDataSourceSyncJobsOutput +] +LIST_DOCUMENTS: APIOperation[ListDocumentsInput, ListDocumentsOutput] +LIST_GROUPS: APIOperation[ListGroupsInput, ListGroupsOutput] +LIST_INDICES: APIOperation[ListIndicesInput, ListIndicesOutput] +LIST_MESSAGES: APIOperation[ListMessagesInput, ListMessagesOutput] +LIST_PLUGIN_ACTIONS: APIOperation[ListPluginActionsInput, ListPluginActionsOutput] +LIST_PLUGINS: APIOperation[ListPluginsInput, ListPluginsOutput] +LIST_PLUGIN_TYPE_ACTIONS: APIOperation[ + ListPluginTypeActionsInput, ListPluginTypeActionsOutput +] +LIST_PLUGIN_TYPE_METADATA: APIOperation[ + ListPluginTypeMetadataInput, ListPluginTypeMetadataOutput +] +LIST_RETRIEVERS: APIOperation[ListRetrieversInput, ListRetrieversOutput] +LIST_SUBSCRIPTIONS: APIOperation[ListSubscriptionsInput, ListSubscriptionsOutput] +LIST_TAGS_FOR_RESOURCE: APIOperation[ + ListTagsForResourceInput, ListTagsForResourceOutput +] +LIST_WEB_EXPERIENCES: APIOperation[ListWebExperiencesInput, ListWebExperiencesOutput] +PUT_FEEDBACK: APIOperation[PutFeedbackInput, PutFeedbackOutput] +PUT_GROUP: APIOperation[PutGroupInput, PutGroupOutput] +SEARCH_RELEVANT_CONTENT: APIOperation[ + SearchRelevantContentInput, SearchRelevantContentOutput +] +START_DATA_SOURCE_SYNC_JOB: APIOperation[ + StartDataSourceSyncJobInput, StartDataSourceSyncJobOutput +] +STOP_DATA_SOURCE_SYNC_JOB: APIOperation[ + StopDataSourceSyncJobInput, StopDataSourceSyncJobOutput +] +TAG_RESOURCE: APIOperation[TagResourceInput, TagResourceOutput] +UNTAG_RESOURCE: APIOperation[UntagResourceInput, UntagResourceOutput] +UPDATE_APPLICATION: APIOperation[UpdateApplicationInput, UpdateApplicationOutput] +UPDATE_CHAT_CONTROLS_CONFIGURATION: APIOperation[ + UpdateChatControlsConfigurationInput, UpdateChatControlsConfigurationOutput +] +UPDATE_CHAT_RESPONSE_CONFIGURATION: APIOperation[ + UpdateChatResponseConfigurationInput, UpdateChatResponseConfigurationOutput +] +UPDATE_DATA_ACCESSOR: APIOperation[UpdateDataAccessorInput, UpdateDataAccessorOutput] +UPDATE_DATA_SOURCE: APIOperation[UpdateDataSourceInput, UpdateDataSourceOutput] +UPDATE_INDEX: APIOperation[UpdateIndexInput, UpdateIndexOutput] +UPDATE_PLUGIN: APIOperation[UpdatePluginInput, UpdatePluginOutput] +UPDATE_RETRIEVER: APIOperation[UpdateRetrieverInput, UpdateRetrieverOutput] +UPDATE_SUBSCRIPTION: APIOperation[UpdateSubscriptionInput, UpdateSubscriptionOutput] +UPDATE_USER: APIOperation[UpdateUserInput, UpdateUserOutput] +UPDATE_WEB_EXPERIENCE: APIOperation[UpdateWebExperienceInput, UpdateWebExperienceOutput] diff --git a/clients/aws-sdk-qbusiness/tests/integration/__init__.py b/clients/aws-sdk-qbusiness/tests/integration/__init__.py index 34ab9a9d..675ccff7 100644 --- a/clients/aws-sdk-qbusiness/tests/integration/__init__.py +++ b/clients/aws-sdk-qbusiness/tests/integration/__init__.py @@ -1,9 +1,9 @@ # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 -from smithy_aws_core.config import AwsConfigOverrides -from smithy_aws_core.identity import EnvironmentCredentialsResolver -from smithy_http.aio.interfaces import HTTPClient +from smithy_aws_core.aio.config import AwsConfigOverrides +from smithy_aws_core.aio.identity import AsyncEnvironmentCredentialsResolver +from smithy_http.aio.interfaces import AsyncHTTPClient from aws_sdk_qbusiness.client import AsyncQBusinessClient from aws_sdk_qbusiness.config import AsyncQBusinessConfig @@ -12,13 +12,13 @@ async def create_qbusiness_client( - region: str, *, transport: HTTPClient | None = None + region: str, *, transport: AsyncHTTPClient | None = None ) -> AsyncQBusinessClient: """Helper to create an AsyncQBusinessClient for a given region.""" overrides: AwsConfigOverrides = { "endpoint_uri": f"https://qbusiness.{region}.api.aws", "region": region, - "aws_credentials_identity_resolver": EnvironmentCredentialsResolver(), + "aws_credentials_identity_resolver": AsyncEnvironmentCredentialsResolver(), } if transport is not None: overrides["transport"] = transport diff --git a/clients/aws-sdk-qbusiness/tests/integration/conftest.py b/clients/aws-sdk-qbusiness/tests/integration/conftest.py index 4ac6316c..35ea1f02 100644 --- a/clients/aws-sdk-qbusiness/tests/integration/conftest.py +++ b/clients/aws-sdk-qbusiness/tests/integration/conftest.py @@ -13,6 +13,7 @@ import pytest +from aws_sdk_qbusiness.client import AsyncQBusinessClient from aws_sdk_qbusiness.models import ( ApplicationStatus, CreateApplicationInput, @@ -46,7 +47,9 @@ _THROTTLE_RETRY_TIMEOUT_SECONDS = 300 -async def _wait_for_application_active(client, application_id: str) -> None: +async def _wait_for_application_active( + client: AsyncQBusinessClient, application_id: str +) -> None: """Wait for an Application to reach ACTIVE status. Args: @@ -68,7 +71,9 @@ async def _wait_for_application_active(client, application_id: str) -> None: raise TimeoutError(f"Application {application_id} did not become ACTIVE in time") -async def _wait_for_index_active(client, application_id: str, index_id: str) -> None: +async def _wait_for_index_active( + client: AsyncQBusinessClient, application_id: str, index_id: str +) -> None: """Wait for an Index to reach ACTIVE status. Args: @@ -92,7 +97,7 @@ async def _wait_for_index_active(client, application_id: str, index_id: str) -> async def _wait_for_retriever_active( - client, application_id: str, retriever_id: str + client: AsyncQBusinessClient, application_id: str, retriever_id: str ) -> None: """Wait for a Retriever to reach ACTIVE status. @@ -119,7 +124,7 @@ async def _wait_for_retriever_active( async def _create_qbusiness_app( - client, app_name: str, index_name: str, retriever_name: str + client: AsyncQBusinessClient, app_name: str, index_name: str, retriever_name: str ) -> str: """Create a Q Business application with index and retriever. @@ -185,7 +190,9 @@ async def _create_qbusiness_app( return application_id -async def _delete_qbusiness_app(client, application_id: str | None) -> None: +async def _delete_qbusiness_app( + client: AsyncQBusinessClient, application_id: str | None +) -> None: """Delete a Q Business application. Cascades to its index and retriever. Args: diff --git a/clients/aws-sdk-qbusiness/tests/integration/test_bidirectional_streaming.py b/clients/aws-sdk-qbusiness/tests/integration/test_bidirectional_streaming.py index 82ed6cfb..df571939 100644 --- a/clients/aws-sdk-qbusiness/tests/integration/test_bidirectional_streaming.py +++ b/clients/aws-sdk-qbusiness/tests/integration/test_bidirectional_streaming.py @@ -6,7 +6,7 @@ import asyncio import uuid -from smithy_core.aio.eventstream import DuplexEventStream +from smithy_core.aio.eventstream import AsyncDuplexEventStream from smithy_http.aio.crt import AWSCRTHTTPClient from aws_sdk_qbusiness.models import ( @@ -29,7 +29,7 @@ async def _send_chat_events( - stream: DuplexEventStream[ChatInputStream, ChatOutputStream, ChatOutput], + stream: AsyncDuplexEventStream[ChatInputStream, ChatOutputStream, ChatOutput], ) -> None: """Send chat input events: configuration, text message, end of input.""" await stream.input_stream.send( @@ -50,7 +50,7 @@ async def _send_chat_events( async def _receive_chat_output( - stream: DuplexEventStream[ChatInputStream, ChatOutputStream, ChatOutput], + stream: AsyncDuplexEventStream[ChatInputStream, ChatOutputStream, ChatOutput], ) -> tuple[bool, bool]: """Receive and validate chat output from the stream. diff --git a/clients/aws-sdk-sagemaker-runtime-http2/scripts/docs/generate_doc_stubs.py b/clients/aws-sdk-sagemaker-runtime-http2/scripts/docs/generate_doc_stubs.py index 52d470bc..795f2e4b 100644 --- a/clients/aws-sdk-sagemaker-runtime-http2/scripts/docs/generate_doc_stubs.py +++ b/clients/aws-sdk-sagemaker-runtime-http2/scripts/docs/generate_doc_stubs.py @@ -126,7 +126,9 @@ class ClientInfo: class DocStubGenerator: """Generate markdown API Reference stubs for AWS SDK for Python v4 clients.""" - def __init__(self, client_dir: Path, output_dir: Path, service_name: str | None = None) -> None: + def __init__( + self, client_dir: Path, output_dir: Path, service_name: str | None = None + ) -> None: """ Initialize the documentation generator. @@ -190,7 +192,9 @@ def _analyze_client_package(self, package_name: str) -> ClientInfo: required = ("client", "config", "models") missing = [name for name in required if not package.modules.get(name)] if missing: - raise ValueError(f"Missing required modules in {package_name}: {', '.join(missing)}") + raise ValueError( + f"Missing required modules in {package_name}: {', '.join(missing)}" + ) # Parse submodules client_module = package.modules["client"] @@ -199,11 +203,15 @@ def _analyze_client_package(self, package_name: str) -> ClientInfo: client_class = self._find_class_with_suffix(client_module, "Client") if not client_class: - raise ValueError(f"No class ending with 'Client' found in {package_name}.client") + raise ValueError( + f"No class ending with 'Client' found in {package_name}.client" + ) config_class = self._find_class_with_suffix(config_module, "Config") if not config_class: - raise ValueError(f"No class ending with 'Config' found in {package_name}.config") + raise ValueError( + f"No class ending with 'Config' found in {package_name}.config" + ) plugin_alias = config_module.members.get("Plugin") if not plugin_alias: @@ -288,7 +296,9 @@ def _analyze_operation(self, operation: Function) -> OperationInfo: if output_type in stream_type_map: stream_type = stream_type_map[output_type] - stream_args = self._get_subscript_elements(returns, f"'{operation.name}' stream type") + stream_args = self._get_subscript_elements( + returns, f"'{operation.name}' stream type" + ) if stream_type in (StreamType.INPUT, StreamType.DUPLEX): event_input_type = stream_args[0].canonical_name @@ -316,7 +326,9 @@ def _analyze_operation(self, operation: Function) -> OperationInfo: def _get_expr(self, annotation: str | Expr | None, context: str) -> Expr: """Extract and validate an Expr from an annotation.""" if not isinstance(annotation, Expr): - raise TypeError(f"{context}: expected Expr, got {type(annotation).__name__}") + raise TypeError( + f"{context}: expected Expr, got {type(annotation).__name__}" + ) return annotation def _get_subscript_elements(self, expr: Expr, context: str) -> list[Expr]: @@ -330,7 +342,9 @@ def _get_subscript_elements(self, expr: Expr, context: str) -> list[Expr]: return [el for el in slice_expr.elements if isinstance(el, Expr)] return [slice_expr] - def _extract_models(self, models_module: Module, operations: list[OperationInfo]) -> ModelsInfo: + def _extract_models( + self, models_module: Module, operations: list[OperationInfo] + ) -> ModelsInfo: """Extract structures, unions, enums, and errors from models module.""" structures, unions, enums, errors = [], [], [], [] @@ -356,14 +370,16 @@ def _extract_models(self, models_module: Module, operations: list[OperationInfo] duplicates = [] for structure in structures: - if self._is_operation_io_type(structure.name, operations) or self._is_union_member( - structure.name, unions - ): + if self._is_operation_io_type( + structure.name, operations + ) or self._is_union_member(structure.name, unions): duplicates.append(structure) structures = [struct for struct in structures if struct not in duplicates] - return ModelsInfo(structures=structures, unions=unions, enums=enums, errors=errors) + return ModelsInfo( + structures=structures, unions=unions, enums=enums, errors=errors + ) def _is_union(self, member: Object | Alias) -> TypeGuard[Attribute]: """Check if a module member is a union type.""" @@ -399,7 +415,9 @@ def _extract_union_members( for name in member_names: if not (member_object := models_module.members.get(name)): raise ValueError(f"Union member '{name}' not found in models module") - members.append(TypeInfo(name=member_object.name, module_path=member_object.path)) + members.append( + TypeInfo(name=member_object.name, module_path=member_object.path) + ) return members @@ -408,7 +426,8 @@ def _is_enum(self, member: Object | Alias) -> TypeGuard[Class]: if not isinstance(member, Class): return False return any( - isinstance(base, ExprName) and base.name in ENUM_BASE_CLASSES for base in member.bases + isinstance(base, ExprName) and base.name in ENUM_BASE_CLASSES + for base in member.bases ) def _is_error(self, member: Object | Alias) -> TypeGuard[Class]: @@ -416,10 +435,13 @@ def _is_error(self, member: Object | Alias) -> TypeGuard[Class]: if not isinstance(member, Class): return False return any( - isinstance(base, ExprName) and base.name in ERROR_BASE_CLASSES for base in member.bases + isinstance(base, ExprName) and base.name in ERROR_BASE_CLASSES + for base in member.bases ) - def _is_operation_io_type(self, type_name: str, operations: list[OperationInfo]) -> bool: + def _is_operation_io_type( + self, type_name: str, operations: list[OperationInfo] + ) -> bool: """Check if a type is used as operation input/output.""" return any(type_name in (op.input.name, op.output.name) for op in operations) @@ -437,8 +459,12 @@ def _generate_client_docs(self, client_info: ClientInfo) -> bool: self._generate_type_stubs( client_info.models.structures, "structures", "Structure Class" ) - self._generate_type_stubs(client_info.models.errors, "errors", "Error Class") - self._generate_type_stubs(client_info.models.enums, "enums", "Enum Class", members=True) + self._generate_type_stubs( + client_info.models.errors, "errors", "Error Class" + ) + self._generate_type_stubs( + client_info.models.enums, "enums", "Enum Class", members=True + ) self._generate_union_stubs(client_info.models.unions) except OSError as e: logger.error(f"Failed to write documentation files: {e}") @@ -470,7 +496,9 @@ def _generate_index(self, client_info: ClientInfo) -> None: ] for method in sorted(client_info.client_methods, key=lambda x: x.name): - lines.extend([*self._mkdocs_directive(method.module_path, heading_level=4), ""]) + lines.extend( + [*self._mkdocs_directive(method.module_path, heading_level=4), ""] + ) # Operations section if client_info.operations: @@ -578,7 +606,9 @@ def _generate_operation_stubs(self, operations: list[OperationInfo]) -> None: output_path = self.output_dir / "operations" / f"{op.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb("Operations", op.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb("Operations", op.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(operations)} operation file(s)") @@ -600,7 +630,9 @@ def _generate_type_stubs( output_path = self.output_dir / category / f"{item.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb(category.title(), item.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb(category.title(), item.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(items)} {category} file(s)") @@ -624,7 +656,9 @@ def _generate_union_stubs(self, unions: list[UnionInfo]) -> None: output_path = self.output_dir / "unions" / f"{union.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb("Unions", union.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb("Unions", union.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(unions)} union file(s)") diff --git a/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/_private/schemas.py b/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/_private/schemas.py index d6ab0886..4cde5e7f 100644 --- a/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/_private/schemas.py +++ b/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/_private/schemas.py @@ -2,663 +2,623 @@ from types import MappingProxyType -from smithy_core.prelude import INTEGER, STRING -from smithy_core.schemas import Schema -from smithy_core.shapes import ShapeID, ShapeType -from smithy_core.traits import Trait +from smithy_core._schema_compact import StaticOperationSchema, StaticSchema -INPUT_VALIDATION_ERROR = Schema.collection( - id=ShapeID("com.amazonaws.sagemakerruntimehttp2#InputValidationError"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"Message": {"target": STRING}, "ErrorCode": {"target": STRING}}, -) +n0 = "com.amazonaws.sagemakerruntimehttp2" +_IVE = "InputValidationError" +_s = "smithy.api#error" +_c = "client" +_sE = "smithy.api#httpError" +_M = "Message" +_EC = "ErrorCode" +_ISE = "InternalServerError" +_se = "server" +_ISF = "InternalStreamFailure" +_SB = "SensitiveBlob" +_sm = "smithy.api#sensitive" +_RPP = "RequestPayloadPart" +_B = "Bytes" +_sP = "smithy.api#eventPayload" +_DT = "DataType" +_sH = "smithy.api#eventHeader" +_CS = "CompletionState" +_P = "P" +_RSE = "RequestStreamEvent" +_smi = "smithy.api#streaming" +_PP = "PayloadPart" +_IEWBSI = "InvokeEndpointWithBidirectionalStreamInput" +_smit = "smithy.api#input" +_EN = "EndpointName" +_smith = "smithy.api#required" +_sL = "smithy.api#httpLabel" +_Bo = "Body" +_sPm = "smithy.api#httpPayload" +_TV = "TargetVariant" +_sHm = "smithy.api#httpHeader" +_XASTV = "X-Amzn-SageMaker-Target-Variant" +_MIP = "ModelInvocationPath" +_XASMIP = "X-Amzn-SageMaker-Model-Invocation-Path" +_MQS = "ModelQueryString" +_XASMQS = "X-Amzn-SageMaker-Model-Query-String" +_MSE = "ModelStreamError" +_RPPe = "ResponsePayloadPart" +_RSEe = "ResponseStreamEvent" +_IEWBSO = "InvokeEndpointWithBidirectionalStreamOutput" +_smithy = "smithy.api#output" +_IPV = "InvokedProductionVariant" +_XAIPV = "X-Amzn-Invoked-Production-Variant" +_ME = "ModelError" +_OSC = "OriginalStatusCode" +_OM = "OriginalMessage" +_LSA = "LogStreamArn" +_SUE = "ServiceUnavailableError" +_IEWBS = "InvokeEndpointWithBidirectionalStream" +_smithya = "smithy.api#http" +_ASMRH = "AmazonSageMakerRuntimeHttp2" +_a = "aws.auth#sigv4" +_sB = "smithy.rules#endpointBdd" +_aw = "aws.api#service" +_aJ = "aws.protocols#restJson1" -INTERNAL_SERVER_ERROR = Schema.collection( - id=ShapeID("com.amazonaws.sagemakerruntimehttp2#InternalServerError"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="server"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=500), - ], - members={"Message": {"target": STRING}, "ErrorCode": {"target": STRING}}, +INPUT_VALIDATION_ERROR: StaticSchema = ( + 18, + n0, + _IVE, + {_s: _c, _sE: 400}, + (_M, _EC), + ((3, 0), (3, 0)), ) -INTERNAL_STREAM_FAILURE = Schema.collection( - id=ShapeID("com.amazonaws.sagemakerruntimehttp2#InternalStreamFailure"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="server")], - members={"Message": {"target": STRING}}, +INTERNAL_SERVER_ERROR: StaticSchema = ( + 18, + n0, + _ISE, + {_s: _se, _sE: 500}, + (_M, _EC), + ((3, 0), (3, 0)), ) -SENSITIVE_BLOB = Schema( - id=ShapeID("com.amazonaws.sagemakerruntimehttp2#SensitiveBlob"), - shape_type=ShapeType.BLOB, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) +INTERNAL_STREAM_FAILURE: StaticSchema = (18, n0, _ISF, {_s: _se}, (_M,), ((3, 0),)) -REQUEST_PAYLOAD_PART = Schema.collection( - id=ShapeID("com.amazonaws.sagemakerruntimehttp2#RequestPayloadPart"), - members={ - "Bytes": { - "target": SENSITIVE_BLOB, - "traits": [Trait.new(id=ShapeID("smithy.api#eventPayload"))], - }, - "DataType": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#eventHeader"))], - }, - "CompletionState": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#eventHeader"))], - }, - "P": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#eventHeader"))], - }, - }, +SENSITIVE_BLOB: StaticSchema = (1, n0, _SB, 4) + +REQUEST_PAYLOAD_PART: StaticSchema = ( + 18, + n0, + _RPP, + 0, + (_B, _DT, _CS, _P), + ( + (SENSITIVE_BLOB, {_sP: None}), + (3, {_sH: None}), + (3, {_sH: None}), + (3, {_sH: None}), + ), ) -REQUEST_STREAM_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.sagemakerruntimehttp2#RequestStreamEvent"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#streaming"))], - members={"PayloadPart": {"target": REQUEST_PAYLOAD_PART}}, +REQUEST_STREAM_EVENT: StaticSchema = ( + 19, + n0, + _RSE, + {_smi: None}, + (_PP,), + ((REQUEST_PAYLOAD_PART, 0),), ) -INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.sagemakerruntimehttp2#InvokeEndpointWithBidirectionalStreamInput" +INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT: StaticSchema = ( + 18, + n0, + _IEWBSI, + {_smit: None}, + (_EN, _Bo, _TV, _MIP, _MQS), + ( + (3, 9), + (REQUEST_STREAM_EVENT, 17), + (3, {_sHm: _XASTV}), + (3, {_sHm: _XASMIP}), + (3, {_sHm: _XASMQS}), ), - members={ - "EndpointName": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - }, - "Body": { - "target": REQUEST_STREAM_EVENT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpPayload")), - ], - }, - "TargetVariant": { - "target": STRING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="X-Amzn-SageMaker-Target-Variant", - ) - ], - }, - "ModelInvocationPath": { - "target": STRING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="X-Amzn-SageMaker-Model-Invocation-Path", - ) - ], - }, - "ModelQueryString": { - "target": STRING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="X-Amzn-SageMaker-Model-Query-String", - ) - ], - }, - }, ) -MODEL_STREAM_ERROR = Schema.collection( - id=ShapeID("com.amazonaws.sagemakerruntimehttp2#ModelStreamError"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], - members={"Message": {"target": STRING}, "ErrorCode": {"target": STRING}}, -) +MODEL_STREAM_ERROR: StaticSchema = (18, n0, _MSE, {_s: _c}, (_M, _EC), ((3, 0), (3, 0))) -RESPONSE_PAYLOAD_PART = Schema.collection( - id=ShapeID("com.amazonaws.sagemakerruntimehttp2#ResponsePayloadPart"), - members={ - "Bytes": { - "target": SENSITIVE_BLOB, - "traits": [Trait.new(id=ShapeID("smithy.api#eventPayload"))], - }, - "DataType": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#eventHeader"))], - }, - "CompletionState": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#eventHeader"))], - }, - "P": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#eventHeader"))], - }, - }, +RESPONSE_PAYLOAD_PART: StaticSchema = ( + 18, + n0, + _RPPe, + 0, + (_B, _DT, _CS, _P), + ( + (SENSITIVE_BLOB, {_sP: None}), + (3, {_sH: None}), + (3, {_sH: None}), + (3, {_sH: None}), + ), ) -RESPONSE_STREAM_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.sagemakerruntimehttp2#ResponseStreamEvent"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#streaming"))], - members={ - "PayloadPart": {"target": RESPONSE_PAYLOAD_PART}, - "ModelStreamError": {"target": MODEL_STREAM_ERROR}, - "InternalStreamFailure": {"target": INTERNAL_STREAM_FAILURE}, - }, +RESPONSE_STREAM_EVENT: StaticSchema = ( + 19, + n0, + _RSEe, + {_smi: None}, + (_PP, _MSE, _ISF), + ((RESPONSE_PAYLOAD_PART, 0), (MODEL_STREAM_ERROR, 0), (INTERNAL_STREAM_FAILURE, 0)), ) -INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.sagemakerruntimehttp2#InvokeEndpointWithBidirectionalStreamOutput" - ), - members={ - "Body": { - "target": RESPONSE_STREAM_EVENT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpPayload")), - ], - }, - "InvokedProductionVariant": { - "target": STRING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="X-Amzn-Invoked-Production-Variant", - ) - ], - }, - }, +INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_OUTPUT: StaticSchema = ( + 18, + n0, + _IEWBSO, + {_smithy: None}, + (_Bo, _IPV), + ((RESPONSE_STREAM_EVENT, 17), (3, {_sHm: _XAIPV})), ) -MODEL_ERROR = Schema.collection( - id=ShapeID("com.amazonaws.sagemakerruntimehttp2#ModelError"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=424), - ], - members={ - "Message": {"target": STRING}, - "OriginalStatusCode": {"target": INTEGER}, - "OriginalMessage": {"target": STRING}, - "LogStreamArn": {"target": STRING}, - "ErrorCode": {"target": STRING}, - }, +MODEL_ERROR: StaticSchema = ( + 18, + n0, + _ME, + {_s: _c, _sE: 424}, + (_M, _OSC, _OM, _LSA, _EC), + ((3, 0), (7, 0), (3, 0), (3, 0), (3, 0)), ) -SERVICE_UNAVAILABLE_ERROR = Schema.collection( - id=ShapeID("com.amazonaws.sagemakerruntimehttp2#ServiceUnavailableError"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="server"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=503), - ], - members={"Message": {"target": STRING}, "ErrorCode": {"target": STRING}}, +SERVICE_UNAVAILABLE_ERROR: StaticSchema = ( + 18, + n0, + _SUE, + {_s: _se, _sE: 503}, + (_M, _EC), + ((3, 0), (3, 0)), ) -INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM = Schema( - id=ShapeID( - "com.amazonaws.sagemakerruntimehttp2#InvokeEndpointWithBidirectionalStream" - ), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/endpoints/{EndpointName}/invocations-bidirectional-stream", - } - ), +INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM: StaticOperationSchema = ( + 23, + n0, + _IEWBS, + { + _smithya: MappingProxyType( + { + "method": "POST", + "uri": "/endpoints/{EndpointName}/invocations-bidirectional-stream", + } ) - ], + }, + INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT, + INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_OUTPUT, + ( + INPUT_VALIDATION_ERROR, + INTERNAL_SERVER_ERROR, + INTERNAL_STREAM_FAILURE, + MODEL_ERROR, + MODEL_STREAM_ERROR, + SERVICE_UNAVAILABLE_ERROR, + ), ) -AMAZON_SAGE_MAKER_RUNTIME_HTTP2 = Schema( - id=ShapeID("com.amazonaws.sagemakerruntimehttp2#AmazonSageMakerRuntimeHttp2"), - shape_type=ShapeType.SERVICE, - traits=[ - Trait.new( - id=ShapeID("aws.auth#sigv4"), value=MappingProxyType({"name": "sagemaker"}) - ), - Trait.new( - id=ShapeID("smithy.rules#endpointBdd"), - value=MappingProxyType( - { - "version": "1.1", - "parameters": MappingProxyType( - { - "UseDualStack": MappingProxyType( - { - "builtIn": "AWS::UseDualStack", - "required": True, - "default": False, - "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", - "type": "boolean", - } - ), - "UseFIPS": MappingProxyType( - { - "builtIn": "AWS::UseFIPS", - "required": True, - "default": False, - "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", - "type": "boolean", - } - ), - "Endpoint": MappingProxyType( - { - "builtIn": "SDK::Endpoint", - "required": False, - "documentation": "Override the endpoint used to send this request", - "type": "string", - } - ), - "Region": MappingProxyType( - { - "builtIn": "AWS::Region", - "required": False, - "documentation": "The AWS region used to dispatch the request.", - "type": "string", - } - ), - } - ), - "conditions": ( - MappingProxyType( - { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "Endpoint"}),), - } - ), - MappingProxyType( - { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "Region"}),), - } - ), - MappingProxyType( - { - "fn": "aws.partition", - "argv": (MappingProxyType({"ref": "Region"}),), - "assign": "PartitionResult", - } - ), - MappingProxyType( - { - "fn": "stringEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "name", - ), - } - ), - "aws", - ), - } - ), - MappingProxyType( - { - "fn": "stringEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "name", - ), - } - ), - "aws-cn", - ), - } - ), - MappingProxyType( - { - "fn": "stringEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "name", - ), - } - ), - "aws-us-gov", - ), - } - ), - MappingProxyType( - { - "fn": "stringEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "name", - ), - } - ), - "aws-iso", - ), - } - ), - MappingProxyType( - { - "fn": "stringEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "name", - ), - } - ), - "aws-iso-b", - ), - } - ), - MappingProxyType( - { - "fn": "stringEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "name", - ), - } - ), - "aws-eusc", - ), - } - ), - MappingProxyType( - { - "fn": "stringEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "name", - ), - } - ), - "aws-iso-f", - ), - } - ), - MappingProxyType( +AMAZON_SAGE_MAKER_RUNTIME_HTTP2: StaticSchema = ( + 21, + n0, + _ASMRH, + { + _a: MappingProxyType({"name": "sagemaker"}), + _sB: MappingProxyType( + { + "version": "1.1", + "parameters": MappingProxyType( + { + "UseDualStack": MappingProxyType( { - "fn": "booleanEquals", - "argv": (MappingProxyType({"ref": "UseFIPS"}), True), + "builtIn": "AWS::UseDualStack", + "required": True, + "default": False, + "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", + "type": "boolean", } ), - MappingProxyType( + "UseFIPS": MappingProxyType( { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "supportsFIPS", - ), - } - ), - True, - ), + "builtIn": "AWS::UseFIPS", + "required": True, + "default": False, + "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", + "type": "boolean", } ), - MappingProxyType( + "Endpoint": MappingProxyType( { - "fn": "booleanEquals", - "argv": ( - MappingProxyType({"ref": "UseDualStack"}), - True, - ), + "builtIn": "SDK::Endpoint", + "required": False, + "documentation": "Override the endpoint used to send this request", + "type": "string", } ), - MappingProxyType( + "Region": MappingProxyType( { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "supportsDualStack", - ), - } - ), - True, - ), + "builtIn": "AWS::Region", + "required": False, + "documentation": "The AWS region used to dispatch the request.", + "type": "string", } ), + } + ), + "conditions": ( + MappingProxyType( + { + "fn": "isSet", + "argv": (MappingProxyType({"ref": "Endpoint"}),), + } ), - "results": ( - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: FIPS and custom endpoint are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + MappingProxyType( + {"fn": "isSet", "argv": (MappingProxyType({"ref": "Region"}),)} + ), + MappingProxyType( + { + "fn": "aws.partition", + "argv": (MappingProxyType({"ref": "Region"}),), + "assign": "PartitionResult", + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( { - "url": MappingProxyType({"ref": "Endpoint"}), - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "name", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + "aws", + ), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( { - "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "name", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + "aws-cn", + ), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( { - "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "name", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + "aws-us-gov", + ), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( { - "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "name", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + "aws-iso", + ), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( { - "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "name", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + "aws-iso-b", + ), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( { - "url": "https://runtime.sagemaker-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "name", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "FIPS and DualStack are enabled, but this partition does not support one or both", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + "aws-eusc", + ), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( { - "url": "https://runtime.sagemaker-fips.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "name", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "FIPS is enabled but this partition does not support FIPS", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + "aws-iso-f", + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": (MappingProxyType({"ref": "UseFIPS"}), True), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( { - "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "supportsFIPS", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "DualStack is enabled but this partition does not support DualStack", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + True, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": (MappingProxyType({"ref": "UseDualStack"}), True), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( { - "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "supportsDualStack", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: Missing Region", - "type": "error", - } - ), + True, + ), + } ), - "root": 2, - "nodeCount": 23, - "nodes": "/////wAAAAH/////AAAAAAAAABYAAAADAAAAAQAAAAQF9eEPAAAAAgAAAAUF9eEPAAAAAwAAABMAAAAGAAAABAAAABMAAAAHAAAABQAAABMAAAAIAAAABgAAABMAAAAJAAAABwAAABMAAAAKAAAACAAAABMAAAALAAAACQAAABMAAAAMAAAACgAAAA8AAAANAAAADAAAAA4F9eEOAAAADQX14QwF9eENAAAACwAAABEAAAAQAAAADAX14QkF9eELAAAADAAAABIF9eEKAAAADQX14QgF9eEJAAAACgAAABUAAAAUAAAADAX14QUF9eEEAAAADAX14QcF9eEGAAAACgX14QEAAAAXAAAADAX14QIF9eED", - } - ), - ), - Trait.new( - id=ShapeID("aws.api#service"), - value=MappingProxyType( - { - "sdkId": "SageMaker Runtime HTTP2", - "arnNamespace": "sagemaker", - "cloudFormationName": "SageMakerRuntime", - "endpointPrefix": "runtime.sagemaker", - } - ), + ), + "results": ( + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: FIPS and custom endpoint are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": MappingProxyType({"ref": "Endpoint"}), + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://runtime.sagemaker-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS and DualStack are enabled, but this partition does not support one or both", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://runtime.sagemaker-fips.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS is enabled but this partition does not support FIPS", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "DualStack is enabled but this partition does not support DualStack", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://runtime.sagemaker.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Missing Region", + "type": "error", + } + ), + ), + "root": 2, + "nodeCount": 23, + "nodes": "/////wAAAAH/////AAAAAAAAABYAAAADAAAAAQAAAAQF9eEPAAAAAgAAAAUF9eEPAAAAAwAAABMAAAAGAAAABAAAABMAAAAHAAAABQAAABMAAAAIAAAABgAAABMAAAAJAAAABwAAABMAAAAKAAAACAAAABMAAAALAAAACQAAABMAAAAMAAAACgAAAA8AAAANAAAADAAAAA4F9eEOAAAADQX14QwF9eENAAAACwAAABEAAAAQAAAADAX14QkF9eELAAAADAAAABIF9eEKAAAADQX14QgF9eEJAAAACgAAABUAAAAUAAAADAX14QUF9eEEAAAADAX14QcF9eEGAAAACgX14QEAAAAXAAAADAX14QIF9eED", + } ), - Trait.new( - id=ShapeID("aws.protocols#restJson1"), - value=MappingProxyType({"http": ("h2",), "eventStreamHttp": ("h2",)}), + _aw: MappingProxyType( + { + "sdkId": "SageMaker Runtime HTTP2", + "arnNamespace": "sagemaker", + "cloudFormationName": "SageMakerRuntime", + "endpointPrefix": "runtime.sagemaker", + } ), - ], + _aJ: MappingProxyType({"http": ("h2",), "eventStreamHttp": ("h2",)}), + }, ) diff --git a/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/client.py b/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/client.py index 7b67fcfa..2fb7ab20 100644 --- a/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/client.py +++ b/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/client.py @@ -4,16 +4,16 @@ import logging from typing import Any, cast +from smithy_aws_core.aio.identity.chain import AsyncIdentityChain from smithy_aws_core.config import ConfigSource from smithy_aws_core.identity import AWSCredentialsIdentity -from smithy_aws_core.identity.chain import IdentityChain -from smithy_core.aio.client import AsyncClient, ClientCall, RequestPipeline -from smithy_core.aio.eventstream import DuplexEventStream +from smithy_core.aio.client import AsyncClient, AsyncClientCall, AsyncRequestPipeline +from smithy_core.aio.eventstream import AsyncDuplexEventStream from smithy_core.deserializers import DeserializeableShape from smithy_core.exceptions import ExpectationNotMetError from smithy_core.schemas import APIOperation from smithy_core.serializers import SerializeableShape -from smithy_http.aio.interfaces import HTTPClient +from smithy_http.aio.interfaces import AsyncHTTPClient from smithy_http.plugins import user_agent_plugin from .config import AsyncSageMakerRuntimeHTTP2Config, Plugin @@ -92,12 +92,12 @@ async def _post_setup(self, config: AsyncSageMakerRuntimeHTTP2Config) -> None: config_file = await config_context.parsed_profiles() if config_context.profile_source is ConfigSource.OVERRIDE: profile_name = config_context.profile_name - config.aws_credentials_identity_resolver = await IdentityChain.create( + config.aws_credentials_identity_resolver = await AsyncIdentityChain.create( AWSCredentialsIdentity, config_file=config_file, profile_name=profile_name, region_override=config.region, - http_client=cast(HTTPClient | None, config.transport), + http_client=cast(AsyncHTTPClient | None, config.transport), ) async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( @@ -106,7 +106,7 @@ async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( operation: APIOperation[I, O], default_plugins: list[Plugin], plugins: list[Plugin] | None, - ) -> tuple[RequestPipeline[Any, Any], ClientCall[I, O]]: + ) -> tuple[AsyncRequestPipeline[Any, Any], AsyncClientCall[I, O]]: if self._closed: raise RuntimeError( "Cannot invoke an operation on a client that has been closed." @@ -144,7 +144,7 @@ async def invoke_endpoint_with_bidirectional_stream( self, input: InvokeEndpointWithBidirectionalStreamInput, plugins: list[Plugin] | None = None, - ) -> DuplexEventStream[ + ) -> AsyncDuplexEventStream[ RequestStreamEvent, ResponseStreamEvent, InvokeEndpointWithBidirectionalStreamOutput, @@ -196,7 +196,7 @@ async def invoke_endpoint_with_bidirectional_stream( invocations. Returns: - A `DuplexEventStream` for bidirectional streaming. + An `AsyncDuplexEventStream` for bidirectional streaming. """ pipeline, call = await self._prepare_call( input, INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM, [], plugins diff --git a/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/config.py b/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/config.py index 6a0d688b..2a498a8b 100644 --- a/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/config.py +++ b/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/config.py @@ -1,58 +1,72 @@ # Code generated by smithy-python-codegen DO NOT EDIT. from dataclasses import dataclass, field -from typing import Any, Callable, ClassVar, Self, TypeAlias, Union, Unpack +from typing import ( + Any, + Callable, + ClassVar, + Self, + TYPE_CHECKING, + TypeAlias, + Union, + Unpack, +) -from smithy_aws_core.aio.protocols import RestJsonClientProtocol -from smithy_aws_core.auth import SigV4AuthScheme -from smithy_aws_core.config import AwsConfigOverrides, FileSystem -from smithy_aws_core.config.aws_config import AsyncAwsConfig -from smithy_aws_core.config.resolvers import EndpointUriResolver -from smithy_aws_core.config.types import FieldSpec -from smithy_aws_core.endpoints.standard_regional import ( - StandardRegionalEndpointsResolver, +from smithy_aws_core.aio.auth.sigv4 import AsyncSigV4AuthScheme +from smithy_aws_core.aio.config import AsyncFileSystem +from smithy_aws_core.aio.config.aws_config import AsyncAwsConfig, AwsConfigOverrides +from smithy_aws_core.aio.config.resolvers import EndpointUriResolver +from smithy_aws_core.aio.endpoints.standard_regional import ( + AsyncStandardRegionalEndpointsResolver, ) +from smithy_aws_core.aio.protocols import AsyncRestJsonClientProtocol +from smithy_aws_core.config.types import FieldSpec from smithy_aws_core.identity import AWSCredentialsIdentity, AWSIdentityProperties -from smithy_core.aio.interfaces import ( - ClientProtocol, - EndpointResolver, - ProtocolConstructor, - ProtocolSettings, -) -from smithy_core.aio.interfaces.auth import AuthScheme -from smithy_core.aio.interfaces.identity import IdentityResolver -from smithy_core.interceptors import Interceptor +from smithy_core.aio.interfaces import AsyncClientProtocol, AsyncEndpointResolver +from smithy_core.aio.interfaces.auth import AsyncAuthScheme +from smithy_core.aio.interfaces.identity import AsyncIdentityResolver +from smithy_core.interfaces import ProtocolConstructor, ProtocolSettings from smithy_core.interfaces.auth import AuthSchemeResolver from smithy_core.shapes import ShapeID from smithy_http.aio.aiohttp import AIOHTTPClient +from ._private.schemas import AMAZON_SAGE_MAKER_RUNTIME_HTTP2 from .auth import HTTPAuthSchemeResolver -from .models import ( - InvokeEndpointWithBidirectionalStreamInput, - InvokeEndpointWithBidirectionalStreamOutput, -) -_ServiceInterceptor = Union[ - Interceptor[ +if TYPE_CHECKING: + from smithy_core.interceptors import Interceptor + from .models import ( InvokeEndpointWithBidirectionalStreamInput, InvokeEndpointWithBidirectionalStreamOutput, - Any, - Any, + ) + + _ServiceInterceptor = Union[ + Interceptor[ + InvokeEndpointWithBidirectionalStreamInput, + InvokeEndpointWithBidirectionalStreamOutput, + Any, + Any, + ], ] -] +else: + _ServiceInterceptor = Any + _PROTOCOL_SETTINGS = ProtocolSettings( namespace="com.amazonaws.sagemakerruntimehttp2", service_target="AmazonSageMakerRuntimeHttp2", + service_schema=AMAZON_SAGE_MAKER_RUNTIME_HTTP2, ) class _AsyncSageMakerRuntimeHTTP2ConfigOverrides(AwsConfigOverrides, total=False): - endpoint_resolver: EndpointResolver | None + endpoint_resolver: AsyncEndpointResolver | None protocol: ( - ClientProtocol[Any, Any] | ProtocolConstructor[ClientProtocol[Any, Any]] | None + AsyncClientProtocol[Any, Any] + | ProtocolConstructor[AsyncClientProtocol[Any, Any]] + | None ) - auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None + auth_schemes: dict[ShapeID, AsyncAuthScheme[Any, Any, Any, Any]] | None auth_scheme_resolver: AuthSchemeResolver | None @@ -60,17 +74,17 @@ class _AsyncSageMakerRuntimeHTTP2ConfigOverrides(AwsConfigOverrides, total=False class AsyncSageMakerRuntimeHTTP2Config(AsyncAwsConfig): """SageMaker Runtime HTTP2 configuration (async-resolved).""" - endpoint_resolver: EndpointResolver | None = None + endpoint_resolver: AsyncEndpointResolver | None = None """ The endpoint resolver used to resolve the final endpoint per-operation based on the configuration. """ - protocol: ClientProtocol[Any, Any] | None = None + protocol: AsyncClientProtocol[Any, Any] | None = None """ Pass a protocol class reference from smithy_aws_core.aio.protocols to - select the protocol, e.g. protocol=AwsJson10ClientProtocol. For custom - protocols a protocol instance may also be passed. + select the protocol, e.g. protocol=AsyncAwsJson10ClientProtocol. For + custom protocols a protocol instance may also be passed. """ interceptors: list[_ServiceInterceptor] = field(default_factory=lambda: []) @@ -79,7 +93,7 @@ class AsyncSageMakerRuntimeHTTP2Config(AsyncAwsConfig): execution of a request. """ - auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None = None + auth_schemes: dict[ShapeID, AsyncAuthScheme[Any, Any, Any, Any]] | None = None """A map of auth scheme ids to auth schemes.""" auth_scheme_resolver: AuthSchemeResolver | None = None @@ -89,7 +103,7 @@ class AsyncSageMakerRuntimeHTTP2Config(AsyncAwsConfig): """ aws_credentials_identity_resolver: ( - IdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None + AsyncIdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None ) = None """Resolves AWS Credentials. Required for operations that use Sigv4 Auth.""" @@ -130,24 +144,24 @@ class AsyncSageMakerRuntimeHTTP2Config(AsyncAwsConfig): default=None, resolver=EndpointUriResolver("sagemaker_runtime_http2") ), "endpoint_resolver": FieldSpec( - default_factory=lambda: StandardRegionalEndpointsResolver( + default_factory=lambda: AsyncStandardRegionalEndpointsResolver( endpoint_prefix="runtime.sagemaker" ) ), "protocol": FieldSpec( - default_factory=lambda: RestJsonClientProtocol(_PROTOCOL_SETTINGS), + default_factory=lambda: AsyncRestJsonClientProtocol(_PROTOCOL_SETTINGS), converter=lambda p: p(_PROTOCOL_SETTINGS) if isinstance(p, type) else p, ), "auth_schemes": FieldSpec( default_factory=lambda: { - ShapeID("aws.auth#sigv4"): SigV4AuthScheme(service="sagemaker") + ShapeID("aws.auth#sigv4"): AsyncSigV4AuthScheme(service="sagemaker") } ), "auth_scheme_resolver": FieldSpec(default_factory=HTTPAuthSchemeResolver), "transport": FieldSpec(default_factory=lambda: AIOHTTPClient()), } - def set_auth_scheme(self, scheme: AuthScheme[Any, Any, Any, Any]) -> None: + def set_auth_scheme(self, scheme: AsyncAuthScheme[Any, Any, Any, Any]) -> None: """ Set an auth scheme implementation using its scheme ID. :param scheme: The auth scheme to add or replace. @@ -161,7 +175,7 @@ async def resolve( # pyright: ignore[reportIncompatibleMethodOverride] cls, *, profile: str | None = None, - fs: FileSystem | None = None, + fs: AsyncFileSystem | None = None, config_file_path: str | None = None, credentials_file_path: str | None = None, **overrides: Unpack[_AsyncSageMakerRuntimeHTTP2ConfigOverrides], diff --git a/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/models.py b/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/models.py index 63c04214..a16af01e 100644 --- a/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/models.py +++ b/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/models.py @@ -1,35 +1,24 @@ # Code generated by smithy-python-codegen DO NOT EDIT. -from dataclasses import dataclass, field -import logging -from typing import Any, Literal, Self, Union +from __future__ import annotations -from smithy_core.deserializers import ShapeDeserializer -from smithy_core.documents import TypeRegistry -from smithy_core.exceptions import ModeledError, SerializationError -from smithy_core.response import EMPTY_RESPONSE_METADATA, ResponseMetadata -from smithy_core.schemas import APIOperation, Schema -from smithy_core.serializers import ShapeSerializer +from ._private import schemas as _schemas +from smithy_core._dynamic_models import ModelRegistry +from smithy_core.exceptions import ModeledError +from smithy_core.schemas import APIOperation from smithy_core.shapes import ShapeID from ._private.schemas import ( - INPUT_VALIDATION_ERROR as _SCHEMA_INPUT_VALIDATION_ERROR, - INTERNAL_SERVER_ERROR as _SCHEMA_INTERNAL_SERVER_ERROR, - INTERNAL_STREAM_FAILURE as _SCHEMA_INTERNAL_STREAM_FAILURE, INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM as _SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM, - INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT as _SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT, - INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_OUTPUT as _SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_OUTPUT, - MODEL_ERROR as _SCHEMA_MODEL_ERROR, - MODEL_STREAM_ERROR as _SCHEMA_MODEL_STREAM_ERROR, - REQUEST_PAYLOAD_PART as _SCHEMA_REQUEST_PAYLOAD_PART, - REQUEST_STREAM_EVENT as _SCHEMA_REQUEST_STREAM_EVENT, - RESPONSE_PAYLOAD_PART as _SCHEMA_RESPONSE_PAYLOAD_PART, - RESPONSE_STREAM_EVENT as _SCHEMA_RESPONSE_STREAM_EVENT, - SERVICE_UNAVAILABLE_ERROR as _SCHEMA_SERVICE_UNAVAILABLE_ERROR, ) +from typing import TYPE_CHECKING -logger = logging.getLogger(__name__) +if TYPE_CHECKING: + from .models import ( + InvokeEndpointWithBidirectionalStreamInput, + InvokeEndpointWithBidirectionalStreamOutput, + ) class ServiceError(ModeledError): @@ -41,900 +30,66 @@ class ServiceError(ModeledError): """ -@dataclass(kw_only=True) -class InputValidationError(ServiceError): - """The input fails to satisfy the constraints specified by an AWS service.""" - - fault: Literal["client", "server"] | None = "client" - - error_code: str | None = None - """Error code.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INPUT_VALIDATION_ERROR, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INPUT_VALIDATION_ERROR.members["Message"], self.message - ) - - if self.error_code is not None: - serializer.write_string( - _SCHEMA_INPUT_VALIDATION_ERROR.members["ErrorCode"], self.error_code - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INPUT_VALIDATION_ERROR.members["Message"] - ) - - case 1: - kwargs["error_code"] = de.read_string( - _SCHEMA_INPUT_VALIDATION_ERROR.members["ErrorCode"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INPUT_VALIDATION_ERROR, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class InternalServerError(ServiceError): - """ - The request processing has failed because of an unknown error, exception - or failure. - """ - - fault: Literal["client", "server"] | None = "server" - - error_code: str | None = None - """Error code.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INTERNAL_SERVER_ERROR, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INTERNAL_SERVER_ERROR.members["Message"], self.message - ) - - if self.error_code is not None: - serializer.write_string( - _SCHEMA_INTERNAL_SERVER_ERROR.members["ErrorCode"], self.error_code - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INTERNAL_SERVER_ERROR.members["Message"] - ) - - case 1: - kwargs["error_code"] = de.read_string( - _SCHEMA_INTERNAL_SERVER_ERROR.members["ErrorCode"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INTERNAL_SERVER_ERROR, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class InternalStreamFailure(ServiceError): - """Internal stream failure that occurs during streaming.""" - - fault: Literal["client", "server"] | None = "server" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INTERNAL_STREAM_FAILURE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INTERNAL_STREAM_FAILURE.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INTERNAL_STREAM_FAILURE.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INTERNAL_STREAM_FAILURE, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class RequestPayloadPart: - """Request payload part structure.""" - - bytes_: bytes | None = field(repr=False, default=None) - """The payload bytes.""" - - data_type: str | None = None - """ - Data type header. Can be one of these possible values: \"UTF8\", - \"BINARY\". - """ - - completion_state: str | None = None - """ - Completion state header. Can be one of these possible values: - \"PARTIAL\", \"COMPLETE\". - """ - - p: str | None = None - """Padding string for alignment.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REQUEST_PAYLOAD_PART, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.bytes_ is not None: - serializer.write_blob( - _SCHEMA_REQUEST_PAYLOAD_PART.members["Bytes"], self.bytes_ - ) - - if self.data_type is not None: - serializer.write_string( - _SCHEMA_REQUEST_PAYLOAD_PART.members["DataType"], self.data_type - ) - - if self.completion_state is not None: - serializer.write_string( - _SCHEMA_REQUEST_PAYLOAD_PART.members["CompletionState"], - self.completion_state, - ) - - if self.p is not None: - serializer.write_string(_SCHEMA_REQUEST_PAYLOAD_PART.members["P"], self.p) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bytes_"] = de.read_blob( - _SCHEMA_REQUEST_PAYLOAD_PART.members["Bytes"] - ) - - case 1: - kwargs["data_type"] = de.read_string( - _SCHEMA_REQUEST_PAYLOAD_PART.members["DataType"] - ) - - case 2: - kwargs["completion_state"] = de.read_string( - _SCHEMA_REQUEST_PAYLOAD_PART.members["CompletionState"] - ) - - case 3: - kwargs["p"] = de.read_string( - _SCHEMA_REQUEST_PAYLOAD_PART.members["P"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_REQUEST_PAYLOAD_PART, consumer=_consumer) - return kwargs - - -@dataclass -class RequestStreamEventPayloadPart: - """Payload part event.""" - - value: RequestPayloadPart - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REQUEST_STREAM_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_REQUEST_STREAM_EVENT.members["PayloadPart"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=RequestPayloadPart.deserialize(deserializer)) - - -@dataclass -class RequestStreamEventUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -RequestStreamEvent = Union[RequestStreamEventPayloadPart | RequestStreamEventUnknown] -"""Request stream event union.""" - - -class _RequestStreamEventDeserializer: - _result: RequestStreamEvent | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> RequestStreamEvent: - self._result = None - deserializer.read_struct(_SCHEMA_REQUEST_STREAM_EVENT, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(RequestStreamEventPayloadPart.deserialize(de)) - - case _: - self._set_result( - RequestStreamEventUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: RequestStreamEvent) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class InvokeEndpointWithBidirectionalStreamInput: - """Dataclass for InvokeEndpointWithBidirectionalStreamInput structure.""" - - endpoint_name: str | None = None - """The name of the endpoint to invoke.""" - - target_variant: str | None = None - """Target variant for the request.""" - - model_invocation_path: str | None = None - """Model invocation path.""" - - model_query_string: str | None = None - """Model query string.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.endpoint_name is not None: - serializer.write_string( - _SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT.members[ - "EndpointName" - ], - self.endpoint_name, - ) - - if self.target_variant is not None: - serializer.write_string( - _SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT.members[ - "TargetVariant" - ], - self.target_variant, - ) - - if self.model_invocation_path is not None: - serializer.write_string( - _SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT.members[ - "ModelInvocationPath" - ], - self.model_invocation_path, - ) - - if self.model_query_string is not None: - serializer.write_string( - _SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT.members[ - "ModelQueryString" - ], - self.model_query_string, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["endpoint_name"] = de.read_string( - _SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT.members[ - "EndpointName" - ] - ) - - case 2: - kwargs["target_variant"] = de.read_string( - _SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT.members[ - "TargetVariant" - ] - ) - - case 3: - kwargs["model_invocation_path"] = de.read_string( - _SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT.members[ - "ModelInvocationPath" - ] - ) - - case 4: - kwargs["model_query_string"] = de.read_string( - _SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT.members[ - "ModelQueryString" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ModelStreamError(ServiceError): - """Model stream error that occurs during streaming.""" - - fault: Literal["client", "server"] | None = "client" - - error_code: str | None = None - """Error code.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MODEL_STREAM_ERROR, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_MODEL_STREAM_ERROR.members["Message"], self.message - ) - - if self.error_code is not None: - serializer.write_string( - _SCHEMA_MODEL_STREAM_ERROR.members["ErrorCode"], self.error_code - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_MODEL_STREAM_ERROR.members["Message"] - ) - - case 1: - kwargs["error_code"] = de.read_string( - _SCHEMA_MODEL_STREAM_ERROR.members["ErrorCode"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MODEL_STREAM_ERROR, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ResponsePayloadPart: - """Response payload part structure.""" - - bytes_: bytes | None = field(repr=False, default=None) - """The payload bytes.""" - - data_type: str | None = None - """ - Data type header. Can be one of these possible values: \"UTF8\", - \"BINARY\". - """ - - completion_state: str | None = None - """ - Completion state header. Can be one of these possible values: - \"PARTIAL\", \"COMPLETE\". - """ - - p: str | None = None - """Padding string for alignment.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESPONSE_PAYLOAD_PART, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.bytes_ is not None: - serializer.write_blob( - _SCHEMA_RESPONSE_PAYLOAD_PART.members["Bytes"], self.bytes_ - ) - - if self.data_type is not None: - serializer.write_string( - _SCHEMA_RESPONSE_PAYLOAD_PART.members["DataType"], self.data_type - ) - - if self.completion_state is not None: - serializer.write_string( - _SCHEMA_RESPONSE_PAYLOAD_PART.members["CompletionState"], - self.completion_state, - ) - - if self.p is not None: - serializer.write_string(_SCHEMA_RESPONSE_PAYLOAD_PART.members["P"], self.p) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["bytes_"] = de.read_blob( - _SCHEMA_RESPONSE_PAYLOAD_PART.members["Bytes"] - ) - - case 1: - kwargs["data_type"] = de.read_string( - _SCHEMA_RESPONSE_PAYLOAD_PART.members["DataType"] - ) - - case 2: - kwargs["completion_state"] = de.read_string( - _SCHEMA_RESPONSE_PAYLOAD_PART.members["CompletionState"] - ) - - case 3: - kwargs["p"] = de.read_string( - _SCHEMA_RESPONSE_PAYLOAD_PART.members["P"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RESPONSE_PAYLOAD_PART, consumer=_consumer) - return kwargs - - -@dataclass -class ResponseStreamEventPayloadPart: - """Payload part event.""" - - value: ResponsePayloadPart - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESPONSE_STREAM_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RESPONSE_STREAM_EVENT.members["PayloadPart"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ResponsePayloadPart.deserialize(deserializer)) - - -@dataclass -class ResponseStreamEventModelStreamError: - """Model stream error event.""" - - value: ModelStreamError - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESPONSE_STREAM_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RESPONSE_STREAM_EVENT.members["ModelStreamError"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ModelStreamError.deserialize(deserializer)) - - -@dataclass -class ResponseStreamEventInternalStreamFailure: - """Internal stream failure event.""" - - value: InternalStreamFailure - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESPONSE_STREAM_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_RESPONSE_STREAM_EVENT.members["InternalStreamFailure"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=InternalStreamFailure.deserialize(deserializer)) - - -@dataclass -class ResponseStreamEventUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -ResponseStreamEvent = Union[ - ResponseStreamEventPayloadPart - | ResponseStreamEventModelStreamError - | ResponseStreamEventInternalStreamFailure - | ResponseStreamEventUnknown -] -"""Response stream event union.""" - - -class _ResponseStreamEventDeserializer: - _result: ResponseStreamEvent | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> ResponseStreamEvent: - self._result = None - deserializer.read_struct(_SCHEMA_RESPONSE_STREAM_EVENT, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(ResponseStreamEventPayloadPart.deserialize(de)) - - case 1: - self._set_result(ResponseStreamEventModelStreamError.deserialize(de)) - - case 2: - self._set_result( - ResponseStreamEventInternalStreamFailure.deserialize(de) - ) - - case _: - self._set_result( - ResponseStreamEventUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: ResponseStreamEvent) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class InvokeEndpointWithBidirectionalStreamOutput: - """Dataclass for InvokeEndpointWithBidirectionalStreamOutput structure.""" - - invoked_production_variant: str | None = None - """The invoked production variant.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.invoked_production_variant is not None: - serializer.write_string( - _SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_OUTPUT.members[ - "InvokedProductionVariant" - ], - self.invoked_production_variant, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 1: - kwargs["invoked_production_variant"] = de.read_string( - _SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_OUTPUT.members[ - "InvokedProductionVariant" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ModelError(ServiceError): - """An error occurred while processing the model.""" - - fault: Literal["client", "server"] | None = "client" - - original_status_code: int | None = None - """HTTP status code returned by model.""" - - original_message: str | None = None - """Original error message from the model.""" - - log_stream_arn: str | None = None - """CloudWatch log stream ARN.""" - - error_code: str | None = None - """Error code.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MODEL_ERROR, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_MODEL_ERROR.members["Message"], self.message - ) - - if self.original_status_code is not None: - serializer.write_integer( - _SCHEMA_MODEL_ERROR.members["OriginalStatusCode"], - self.original_status_code, - ) - - if self.original_message is not None: - serializer.write_string( - _SCHEMA_MODEL_ERROR.members["OriginalMessage"], self.original_message - ) - - if self.log_stream_arn is not None: - serializer.write_string( - _SCHEMA_MODEL_ERROR.members["LogStreamArn"], self.log_stream_arn - ) - - if self.error_code is not None: - serializer.write_string( - _SCHEMA_MODEL_ERROR.members["ErrorCode"], self.error_code - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_MODEL_ERROR.members["Message"] - ) - - case 1: - kwargs["original_status_code"] = de.read_integer( - _SCHEMA_MODEL_ERROR.members["OriginalStatusCode"] - ) - - case 2: - kwargs["original_message"] = de.read_string( - _SCHEMA_MODEL_ERROR.members["OriginalMessage"] - ) - - case 3: - kwargs["log_stream_arn"] = de.read_string( - _SCHEMA_MODEL_ERROR.members["LogStreamArn"] - ) - - case 4: - kwargs["error_code"] = de.read_string( - _SCHEMA_MODEL_ERROR.members["ErrorCode"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MODEL_ERROR, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ServiceUnavailableError(ServiceError): - """The request has failed due to a temporary failure of the server.""" - - fault: Literal["client", "server"] | None = "server" - - error_code: str | None = None - """Error code.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SERVICE_UNAVAILABLE_ERROR, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_SERVICE_UNAVAILABLE_ERROR.members["Message"], self.message - ) - - if self.error_code is not None: - serializer.write_string( - _SCHEMA_SERVICE_UNAVAILABLE_ERROR.members["ErrorCode"], self.error_code - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_SERVICE_UNAVAILABLE_ERROR.members["Message"] - ) - - case 1: - kwargs["error_code"] = de.read_string( - _SCHEMA_SERVICE_UNAVAILABLE_ERROR.members["ErrorCode"] - ) +_registry = ModelRegistry( + _schemas, + renames={}, + index={ + "InputValidationError": "INPUT_VALIDATION_ERROR", + "InternalServerError": "INTERNAL_SERVER_ERROR", + "InternalStreamFailure": "INTERNAL_STREAM_FAILURE", + "InvokeEndpointWithBidirectionalStreamInput": "INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT", + "InvokeEndpointWithBidirectionalStreamOutput": "INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_OUTPUT", + "ModelError": "MODEL_ERROR", + "ModelStreamError": "MODEL_STREAM_ERROR", + "RequestPayloadPart": "REQUEST_PAYLOAD_PART", + "RequestStreamEvent": "REQUEST_STREAM_EVENT", + "RequestStreamEventPayloadPart": "REQUEST_STREAM_EVENT", + "RequestStreamEventUnknown": "REQUEST_STREAM_EVENT", + "ResponsePayloadPart": "RESPONSE_PAYLOAD_PART", + "ResponseStreamEvent": "RESPONSE_STREAM_EVENT", + "ResponseStreamEventPayloadPart": "RESPONSE_STREAM_EVENT", + "ResponseStreamEventModelStreamError": "RESPONSE_STREAM_EVENT", + "ResponseStreamEventInternalStreamFailure": "RESPONSE_STREAM_EVENT", + "ResponseStreamEventUnknown": "RESPONSE_STREAM_EVENT", + "ServiceUnavailableError": "SERVICE_UNAVAILABLE_ERROR", + }, + shape_names=frozenset( + { + "InputValidationError", + "InternalServerError", + "InternalStreamFailure", + "InvokeEndpointWithBidirectionalStreamInput", + "InvokeEndpointWithBidirectionalStreamOutput", + "ModelError", + "ModelStreamError", + "RequestPayloadPart", + "RequestStreamEvent", + "ResponsePayloadPart", + "ResponseStreamEvent", + "ServiceUnavailableError", + } + ), + service_error="ServiceError", +) - case _: - logger.debug("Unexpected member schema: %s", schema) - deserializer.read_struct(_SCHEMA_SERVICE_UNAVAILABLE_ERROR, consumer=_consumer) - return kwargs +def __getattr__(name: str): + return _registry.build(name) -INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM = APIOperation( - input=InvokeEndpointWithBidirectionalStreamInput, - output=InvokeEndpointWithBidirectionalStreamOutput, - schema=_SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM, - input_schema=_SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_INPUT, - output_schema=_SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.sagemakerruntimehttp2#InputValidationError" - ): InputValidationError, - ShapeID( - "com.amazonaws.sagemakerruntimehttp2#InternalServerError" - ): InternalServerError, - ShapeID( - "com.amazonaws.sagemakerruntimehttp2#InternalStreamFailure" - ): InternalStreamFailure, - ShapeID("com.amazonaws.sagemakerruntimehttp2#ModelError"): ModelError, - ShapeID( - "com.amazonaws.sagemakerruntimehttp2#ModelStreamError" - ): ModelStreamError, - ShapeID( - "com.amazonaws.sagemakerruntimehttp2#ServiceUnavailableError" - ): ServiceUnavailableError, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INPUT_VALIDATION_ERROR, - _SCHEMA_INTERNAL_SERVER_ERROR, - _SCHEMA_INTERNAL_STREAM_FAILURE, - _SCHEMA_MODEL_ERROR, - _SCHEMA_MODEL_STREAM_ERROR, - _SCHEMA_SERVICE_UNAVAILABLE_ERROR, +INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM: APIOperation[ + InvokeEndpointWithBidirectionalStreamInput, + InvokeEndpointWithBidirectionalStreamOutput, +] = APIOperation( + static_schema=_SCHEMA_INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sagemakerruntimehttp2#InputValidationError"), + ShapeID("com.amazonaws.sagemakerruntimehttp2#InternalServerError"), + ShapeID("com.amazonaws.sagemakerruntimehttp2#InternalStreamFailure"), + ShapeID("com.amazonaws.sagemakerruntimehttp2#ModelError"), + ShapeID("com.amazonaws.sagemakerruntimehttp2#ModelStreamError"), + ShapeID("com.amazonaws.sagemakerruntimehttp2#ServiceUnavailableError"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) diff --git a/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/models.pyi b/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/models.pyi new file mode 100644 index 00000000..7af4f6f2 --- /dev/null +++ b/clients/aws-sdk-sagemaker-runtime-http2/src/aws_sdk_sagemaker_runtime_http2/models.pyi @@ -0,0 +1,246 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. + +from dataclasses import dataclass +from typing import Self, Union + +from smithy_core.deserializers import ShapeDeserializer +from smithy_core.exceptions import ModeledError +from smithy_core.response import ResponseMetadata +from smithy_core.schemas import APIOperation +from smithy_core.serializers import ShapeSerializer + +class _SerdeShape: + def serialize(self, serializer: ShapeSerializer) -> None: ... + def serialize_members(self, serializer: ShapeSerializer) -> None: ... + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: ... + +class ServiceError(ModeledError): + """ + Base error for all errors in the service. + + Some exceptions do not extend from this class, including + synthetic, implicit, and shared exception types. + """ + +@dataclass(kw_only=True) +class InputValidationError(ServiceError, _SerdeShape): + """The input fails to satisfy the constraints specified by an AWS service.""" + + error_code: str | None = ... + """Error code.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InternalServerError(ServiceError, _SerdeShape): + """ + The request processing has failed because of an unknown error, exception + or failure. + """ + + error_code: str | None = ... + """Error code.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InternalStreamFailure(ServiceError, _SerdeShape): + """Internal stream failure that occurs during streaming.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvokeEndpointWithBidirectionalStreamInput(_SerdeShape): + """Dataclass for InvokeEndpointWithBidirectionalStreamInput structure.""" + + endpoint_name: str | None = ... + """The name of the endpoint to invoke.""" + target_variant: str | None = ... + """Target variant for the request.""" + model_invocation_path: str | None = ... + """Model invocation path.""" + model_query_string: str | None = ... + """Model query string.""" + +@dataclass(kw_only=True) +class InvokeEndpointWithBidirectionalStreamOutput(_SerdeShape): + """Dataclass for InvokeEndpointWithBidirectionalStreamOutput structure.""" + + invoked_production_variant: str | None = ... + """The invoked production variant.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ModelError(ServiceError, _SerdeShape): + """An error occurred while processing the model.""" + + original_status_code: int | None = ... + """HTTP status code returned by model.""" + original_message: str | None = ... + """Original error message from the model.""" + log_stream_arn: str | None = ... + """CloudWatch log stream ARN.""" + error_code: str | None = ... + """Error code.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ModelStreamError(ServiceError, _SerdeShape): + """Model stream error that occurs during streaming.""" + + error_code: str | None = ... + """Error code.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class RequestPayloadPart(_SerdeShape): + """Request payload part structure.""" + + bytes_: bytes | None = ... + """The payload bytes.""" + data_type: str | None = ... + """ + Data type header. Can be one of these possible values: \"UTF8\", + \"BINARY\". + """ + completion_state: str | None = ... + """ + Completion state header. Can be one of these possible values: + \"PARTIAL\", \"COMPLETE\". + """ + p: str | None = ... + """Padding string for alignment.""" + +@dataclass +class RequestStreamEventPayloadPart(_SerdeShape): + """Payload part event.""" + + value: RequestPayloadPart + +@dataclass +class RequestStreamEventUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +RequestStreamEvent = Union[RequestStreamEventPayloadPart | RequestStreamEventUnknown] +"""Request stream event union.""" + +class _RequestStreamEventDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> RequestStreamEvent: ... + +@dataclass(kw_only=True) +class ResponsePayloadPart(_SerdeShape): + """Response payload part structure.""" + + bytes_: bytes | None = ... + """The payload bytes.""" + data_type: str | None = ... + """ + Data type header. Can be one of these possible values: \"UTF8\", + \"BINARY\". + """ + completion_state: str | None = ... + """ + Completion state header. Can be one of these possible values: + \"PARTIAL\", \"COMPLETE\". + """ + p: str | None = ... + """Padding string for alignment.""" + +@dataclass +class ResponseStreamEventPayloadPart(_SerdeShape): + """Payload part event.""" + + value: ResponsePayloadPart + +@dataclass +class ResponseStreamEventModelStreamError(_SerdeShape): + """Model stream error event.""" + + value: ModelStreamError + +@dataclass +class ResponseStreamEventInternalStreamFailure(_SerdeShape): + """Internal stream failure event.""" + + value: InternalStreamFailure + +@dataclass +class ResponseStreamEventUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +ResponseStreamEvent = Union[ + ResponseStreamEventPayloadPart + | ResponseStreamEventModelStreamError + | ResponseStreamEventInternalStreamFailure + | ResponseStreamEventUnknown +] +"""Response stream event union.""" + +class _ResponseStreamEventDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> ResponseStreamEvent: ... + +@dataclass(kw_only=True) +class ServiceUnavailableError(ServiceError, _SerdeShape): + """The request has failed due to a temporary failure of the server.""" + + error_code: str | None = ... + """Error code.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +INVOKE_ENDPOINT_WITH_BIDIRECTIONAL_STREAM: APIOperation[ + InvokeEndpointWithBidirectionalStreamInput, + InvokeEndpointWithBidirectionalStreamOutput, +] diff --git a/clients/aws-sdk-secrets-manager/scripts/docs/generate_doc_stubs.py b/clients/aws-sdk-secrets-manager/scripts/docs/generate_doc_stubs.py index 52d470bc..795f2e4b 100644 --- a/clients/aws-sdk-secrets-manager/scripts/docs/generate_doc_stubs.py +++ b/clients/aws-sdk-secrets-manager/scripts/docs/generate_doc_stubs.py @@ -126,7 +126,9 @@ class ClientInfo: class DocStubGenerator: """Generate markdown API Reference stubs for AWS SDK for Python v4 clients.""" - def __init__(self, client_dir: Path, output_dir: Path, service_name: str | None = None) -> None: + def __init__( + self, client_dir: Path, output_dir: Path, service_name: str | None = None + ) -> None: """ Initialize the documentation generator. @@ -190,7 +192,9 @@ def _analyze_client_package(self, package_name: str) -> ClientInfo: required = ("client", "config", "models") missing = [name for name in required if not package.modules.get(name)] if missing: - raise ValueError(f"Missing required modules in {package_name}: {', '.join(missing)}") + raise ValueError( + f"Missing required modules in {package_name}: {', '.join(missing)}" + ) # Parse submodules client_module = package.modules["client"] @@ -199,11 +203,15 @@ def _analyze_client_package(self, package_name: str) -> ClientInfo: client_class = self._find_class_with_suffix(client_module, "Client") if not client_class: - raise ValueError(f"No class ending with 'Client' found in {package_name}.client") + raise ValueError( + f"No class ending with 'Client' found in {package_name}.client" + ) config_class = self._find_class_with_suffix(config_module, "Config") if not config_class: - raise ValueError(f"No class ending with 'Config' found in {package_name}.config") + raise ValueError( + f"No class ending with 'Config' found in {package_name}.config" + ) plugin_alias = config_module.members.get("Plugin") if not plugin_alias: @@ -288,7 +296,9 @@ def _analyze_operation(self, operation: Function) -> OperationInfo: if output_type in stream_type_map: stream_type = stream_type_map[output_type] - stream_args = self._get_subscript_elements(returns, f"'{operation.name}' stream type") + stream_args = self._get_subscript_elements( + returns, f"'{operation.name}' stream type" + ) if stream_type in (StreamType.INPUT, StreamType.DUPLEX): event_input_type = stream_args[0].canonical_name @@ -316,7 +326,9 @@ def _analyze_operation(self, operation: Function) -> OperationInfo: def _get_expr(self, annotation: str | Expr | None, context: str) -> Expr: """Extract and validate an Expr from an annotation.""" if not isinstance(annotation, Expr): - raise TypeError(f"{context}: expected Expr, got {type(annotation).__name__}") + raise TypeError( + f"{context}: expected Expr, got {type(annotation).__name__}" + ) return annotation def _get_subscript_elements(self, expr: Expr, context: str) -> list[Expr]: @@ -330,7 +342,9 @@ def _get_subscript_elements(self, expr: Expr, context: str) -> list[Expr]: return [el for el in slice_expr.elements if isinstance(el, Expr)] return [slice_expr] - def _extract_models(self, models_module: Module, operations: list[OperationInfo]) -> ModelsInfo: + def _extract_models( + self, models_module: Module, operations: list[OperationInfo] + ) -> ModelsInfo: """Extract structures, unions, enums, and errors from models module.""" structures, unions, enums, errors = [], [], [], [] @@ -356,14 +370,16 @@ def _extract_models(self, models_module: Module, operations: list[OperationInfo] duplicates = [] for structure in structures: - if self._is_operation_io_type(structure.name, operations) or self._is_union_member( - structure.name, unions - ): + if self._is_operation_io_type( + structure.name, operations + ) or self._is_union_member(structure.name, unions): duplicates.append(structure) structures = [struct for struct in structures if struct not in duplicates] - return ModelsInfo(structures=structures, unions=unions, enums=enums, errors=errors) + return ModelsInfo( + structures=structures, unions=unions, enums=enums, errors=errors + ) def _is_union(self, member: Object | Alias) -> TypeGuard[Attribute]: """Check if a module member is a union type.""" @@ -399,7 +415,9 @@ def _extract_union_members( for name in member_names: if not (member_object := models_module.members.get(name)): raise ValueError(f"Union member '{name}' not found in models module") - members.append(TypeInfo(name=member_object.name, module_path=member_object.path)) + members.append( + TypeInfo(name=member_object.name, module_path=member_object.path) + ) return members @@ -408,7 +426,8 @@ def _is_enum(self, member: Object | Alias) -> TypeGuard[Class]: if not isinstance(member, Class): return False return any( - isinstance(base, ExprName) and base.name in ENUM_BASE_CLASSES for base in member.bases + isinstance(base, ExprName) and base.name in ENUM_BASE_CLASSES + for base in member.bases ) def _is_error(self, member: Object | Alias) -> TypeGuard[Class]: @@ -416,10 +435,13 @@ def _is_error(self, member: Object | Alias) -> TypeGuard[Class]: if not isinstance(member, Class): return False return any( - isinstance(base, ExprName) and base.name in ERROR_BASE_CLASSES for base in member.bases + isinstance(base, ExprName) and base.name in ERROR_BASE_CLASSES + for base in member.bases ) - def _is_operation_io_type(self, type_name: str, operations: list[OperationInfo]) -> bool: + def _is_operation_io_type( + self, type_name: str, operations: list[OperationInfo] + ) -> bool: """Check if a type is used as operation input/output.""" return any(type_name in (op.input.name, op.output.name) for op in operations) @@ -437,8 +459,12 @@ def _generate_client_docs(self, client_info: ClientInfo) -> bool: self._generate_type_stubs( client_info.models.structures, "structures", "Structure Class" ) - self._generate_type_stubs(client_info.models.errors, "errors", "Error Class") - self._generate_type_stubs(client_info.models.enums, "enums", "Enum Class", members=True) + self._generate_type_stubs( + client_info.models.errors, "errors", "Error Class" + ) + self._generate_type_stubs( + client_info.models.enums, "enums", "Enum Class", members=True + ) self._generate_union_stubs(client_info.models.unions) except OSError as e: logger.error(f"Failed to write documentation files: {e}") @@ -470,7 +496,9 @@ def _generate_index(self, client_info: ClientInfo) -> None: ] for method in sorted(client_info.client_methods, key=lambda x: x.name): - lines.extend([*self._mkdocs_directive(method.module_path, heading_level=4), ""]) + lines.extend( + [*self._mkdocs_directive(method.module_path, heading_level=4), ""] + ) # Operations section if client_info.operations: @@ -578,7 +606,9 @@ def _generate_operation_stubs(self, operations: list[OperationInfo]) -> None: output_path = self.output_dir / "operations" / f"{op.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb("Operations", op.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb("Operations", op.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(operations)} operation file(s)") @@ -600,7 +630,9 @@ def _generate_type_stubs( output_path = self.output_dir / category / f"{item.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb(category.title(), item.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb(category.title(), item.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(items)} {category} file(s)") @@ -624,7 +656,9 @@ def _generate_union_stubs(self, unions: list[UnionInfo]) -> None: output_path = self.output_dir / "unions" / f"{union.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb("Unions", union.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb("Unions", union.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(unions)} union file(s)") diff --git a/clients/aws-sdk-secrets-manager/src/aws_sdk_secrets_manager/_private/schemas.py b/clients/aws-sdk-secrets-manager/src/aws_sdk_secrets_manager/_private/schemas.py index 40e9912f..8211aacf 100644 --- a/clients/aws-sdk-secrets-manager/src/aws_sdk_secrets_manager/_private/schemas.py +++ b/clients/aws-sdk-secrets-manager/src/aws_sdk_secrets_manager/_private/schemas.py @@ -2,1912 +2,2090 @@ from types import MappingProxyType -from smithy_core.prelude import UNIT -from smithy_core.schemas import Schema -from smithy_core.shapes import ShapeID, ShapeType -from smithy_core.traits import Trait - - -KMS_KEY_ID_TYPE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#KmsKeyIdType"), shape_type=ShapeType.STRING -) - -REGION_TYPE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#RegionType"), shape_type=ShapeType.STRING -) - -REPLICA_REGION_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#ReplicaRegionType"), - members={ - "Region": {"target": REGION_TYPE}, - "KmsKeyId": {"target": KMS_KEY_ID_TYPE}, - }, -) - -ADD_REPLICA_REGION_LIST_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#AddReplicaRegionListType"), - shape_type=ShapeType.LIST, - members={"member": {"target": REPLICA_REGION_TYPE}}, -) - -ERROR_CODE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#ErrorCode"), shape_type=ShapeType.STRING -) - -ERROR_MESSAGE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#ErrorMessage"), shape_type=ShapeType.STRING -) - -SECRET_ID_TYPE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#SecretIdType"), shape_type=ShapeType.STRING -) - -API_ERROR_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#APIErrorType"), - members={ - "SecretId": {"target": SECRET_ID_TYPE}, - "ErrorCode": {"target": ERROR_CODE}, - "Message": {"target": ERROR_MESSAGE}, - }, -) - -API_ERROR_LIST_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#APIErrorListType"), - shape_type=ShapeType.LIST, - members={"member": {"target": API_ERROR_TYPE}}, -) - -AUTOMATICALLY_ROTATE_AFTER_DAYS_TYPE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#AutomaticallyRotateAfterDaysType"), - shape_type=ShapeType.LONG, -) - -FILTER_NAME_STRING_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#FilterNameStringType"), - shape_type=ShapeType.ENUM, - members={ - "description": {"target": UNIT}, - "name": {"target": UNIT}, - "tag_key": {"target": UNIT}, - "tag_value": {"target": UNIT}, - "primary_region": {"target": UNIT}, - "owning_service": {"target": UNIT}, - "all": {"target": UNIT}, - }, -) - -FILTER_VALUE_STRING_TYPE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#FilterValueStringType"), - shape_type=ShapeType.STRING, -) - -FILTER_VALUES_STRING_LIST = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#FilterValuesStringList"), - shape_type=ShapeType.LIST, - members={"member": {"target": FILTER_VALUE_STRING_TYPE}}, -) - -FILTER = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#Filter"), - members={ - "Key": {"target": FILTER_NAME_STRING_TYPE}, - "Values": {"target": FILTER_VALUES_STRING_LIST}, - }, +from smithy_core._schema_compact import StaticOperationSchema, StaticSchema + + +n0 = "com.amazonaws.secretsmanager" +_KKIT = "KmsKeyIdType" +_RT = "RegionType" +_RRT = "ReplicaRegionType" +_R = "Region" +_KKI = "KmsKeyId" +_ARRLT = "AddReplicaRegionListType" +_m = "member" +_EC = "ErrorCode" +_EM = "ErrorMessage" +_SIT = "SecretIdType" +_APIET = "APIErrorType" +_SI = "SecretId" +_M = "Message" +_APIELT = "APIErrorListType" +_ARADT = "AutomaticallyRotateAfterDaysType" +_FNST = "FilterNameStringType" +_d = "description" +_sV = "smithy.api#enumValue" +_n = "name" +_tk = "tag_key" +_tk_ = "tag-key" +_tv = "tag_value" +_tv_ = "tag-value" +_pr = "primary_region" +_pr_ = "primary-region" +_os = "owning_service" +_os_ = "owning-service" +_a = "all" +_FVST = "FilterValueStringType" +_FVSL = "FilterValuesStringList" +_F = "Filter" +_K = "Key" +_V = "Values" +_FLT = "FiltersListType" +_MRBT = "MaxResultsBatchType" +_NTT = "NextTokenType" +_SILT = "SecretIdListType" +_BGSVI = "BatchGetSecretValueInput" +_sSI = "smithy.synthetic#originalShapeId" +_cBGSVR = "com.amazonaws.secretsmanager#BatchGetSecretValueRequest" +_s = "smithy.api#input" +_SIL = "SecretIdList" +_Fi = "Filters" +_MR = "MaxResults" +_NT = "NextToken" +_SARNT = "SecretARNType" +_CDT = "CreatedDateType" +_SNT = "SecretNameType" +_SBT = "SecretBinaryType" +_sm = "smithy.api#sensitive" +_SST = "SecretStringType" +_SVIT = "SecretVersionIdType" +_SVST = "SecretVersionStageType" +_SVSTe = "SecretVersionStagesType" +_SVE = "SecretValueEntry" +_ARN = "ARN" +_N = "Name" +_VI = "VersionId" +_SB = "SecretBinary" +_SS = "SecretString" +_VS = "VersionStages" +_CD = "CreatedDate" +_SVT = "SecretValuesType" +_BGSVO = "BatchGetSecretValueOutput" +_cBGSVRo = "com.amazonaws.secretsmanager#BatchGetSecretValueResponse" +_smi = "smithy.api#output" +_SV = "SecretValues" +_E = "Errors" +_DF = "DecryptionFailure" +_smit = "smithy.api#error" +_c = "client" +_ISE = "InternalServiceError" +_se = "server" +_INTE = "InvalidNextTokenException" +_IPE = "InvalidParameterException" +_IRE = "InvalidRequestException" +_RNFE = "ResourceNotFoundException" +_BGSV = "BatchGetSecretValue" +_BT = "BooleanType" +_smith = "smithy.api#default" +_CRSI = "CancelRotateSecretInput" +_cCRSR = "com.amazonaws.secretsmanager#CancelRotateSecretRequest" +_smithy = "smithy.api#required" +_CRSO = "CancelRotateSecretOutput" +_cCRSRo = "com.amazonaws.secretsmanager#CancelRotateSecretResponse" +_CRS = "CancelRotateSecret" +_CRTT = "ClientRequestTokenType" +_DT = "DescriptionType" +_NTa = "NameType" +_TKT = "TagKeyType" +_TVT = "TagValueType" +_T = "Tag" +_Va = "Value" +_TLT = "TagListType" +_MTT = "MedeaTypeType" +_CSI = "CreateSecretInput" +_cCSR = "com.amazonaws.secretsmanager#CreateSecretRequest" +_CRT = "ClientRequestToken" +_sT = "smithy.api#idempotencyToken" +_D = "Description" +_Ta = "Tags" +_ARR = "AddReplicaRegions" +_FORS = "ForceOverwriteReplicaSecret" +_Ty = "Type" +_LADT = "LastAccessedDateType" +_ST = "StatusType" +_IS = "InSync" +_Fa = "Failed" +_IP = "InProgress" +_SMT = "StatusMessageType" +_RST = "ReplicationStatusType" +_S = "Status" +_SM = "StatusMessage" +_LAD = "LastAccessedDate" +_RSLT = "ReplicationStatusListType" +_CSO = "CreateSecretOutput" +_cCSRo = "com.amazonaws.secretsmanager#CreateSecretResponse" +_RS = "ReplicationStatus" +_EF = "EncryptionFailure" +_LEE = "LimitExceededException" +_MPDE = "MalformedPolicyDocumentException" +_PNME = "PreconditionNotMetException" +_REE = "ResourceExistsException" +_CS = "CreateSecret" +_DDT = "DeletedDateType" +_DRPI = "DeleteResourcePolicyInput" +_cDRPR = "com.amazonaws.secretsmanager#DeleteResourcePolicyRequest" +_DRPO = "DeleteResourcePolicyOutput" +_cDRPRo = "com.amazonaws.secretsmanager#DeleteResourcePolicyResponse" +_DRP = "DeleteResourcePolicy" +_RWIDT = "RecoveryWindowInDaysType" +_DSI = "DeleteSecretInput" +_cDSR = "com.amazonaws.secretsmanager#DeleteSecretRequest" +_RWID = "RecoveryWindowInDays" +_FDWR = "ForceDeleteWithoutRecovery" +_DDTe = "DeletionDateType" +_DSO = "DeleteSecretOutput" +_cDSRo = "com.amazonaws.secretsmanager#DeleteSecretResponse" +_DD = "DeletionDate" +_DS = "DeleteSecret" +_DSIe = "DescribeSecretInput" +_cDSRom = "com.amazonaws.secretsmanager#DescribeSecretRequest" +_TT = "TimestampType" +_ESRMIKT = "ExternalSecretRotationMetadataItemKeyType" +_ESRMIVT = "ExternalSecretRotationMetadataItemValueType" +_ESRMI = "ExternalSecretRotationMetadataItem" +_ESRMT = "ExternalSecretRotationMetadataType" +_RARNT = "RoleARNType" +_LCDT = "LastChangedDateType" +_LRDT = "LastRotatedDateType" +_NRDT = "NextRotationDateType" +_OST = "OwningServiceType" +_RET = "RotationEnabledType" +_RLARNT = "RotationLambdaARNType" +_DTu = "DurationType" +_SET = "ScheduleExpressionType" +_RRTo = "RotationRulesType" +_AAD = "AutomaticallyAfterDays" +_Du = "Duration" +_SE = "ScheduleExpression" +_SVTSMT = "SecretVersionsToStagesMapType" +_k = "key" +_v = "value" +_DSOe = "DescribeSecretOutput" +_cDSRoma = "com.amazonaws.secretsmanager#DescribeSecretResponse" +_RE = "RotationEnabled" +_RLARN = "RotationLambdaARN" +_RR = "RotationRules" +_ESRM = "ExternalSecretRotationMetadata" +_ESRRA = "ExternalSecretRotationRoleArn" +_LRD = "LastRotatedDate" +_LCD = "LastChangedDate" +_DDe = "DeletedDate" +_NRD = "NextRotationDate" +_VITS = "VersionIdsToStages" +_OS = "OwningService" +_PR = "PrimaryRegion" +_DSe = "DescribeSecret" +_ECT = "ExcludeCharactersType" +_ELT = "ExcludeLowercaseType" +_ENT = "ExcludeNumbersType" +_EPT = "ExcludePunctuationType" +_EUT = "ExcludeUppercaseType" +_IST = "IncludeSpaceType" +_PLT = "PasswordLengthType" +_REITT = "RequireEachIncludedTypeType" +_GRPI = "GetRandomPasswordInput" +_cGRPR = "com.amazonaws.secretsmanager#GetRandomPasswordRequest" +_PL = "PasswordLength" +_ECx = "ExcludeCharacters" +_EN = "ExcludeNumbers" +_EP = "ExcludePunctuation" +_EU = "ExcludeUppercase" +_EL = "ExcludeLowercase" +_ISn = "IncludeSpace" +_REIT = "RequireEachIncludedType" +_RPT = "RandomPasswordType" +_GRPO = "GetRandomPasswordOutput" +_cGRPRo = "com.amazonaws.secretsmanager#GetRandomPasswordResponse" +_RP = "RandomPassword" +_GRP = "GetRandomPassword" +_GRPIe = "GetResourcePolicyInput" +_cGRPRom = "com.amazonaws.secretsmanager#GetResourcePolicyRequest" +_NERPT = "NonEmptyResourcePolicyType" +_GRPOe = "GetResourcePolicyOutput" +_cGRPRoma = "com.amazonaws.secretsmanager#GetResourcePolicyResponse" +_RPe = "ResourcePolicy" +_GRPe = "GetResourcePolicy" +_GSVI = "GetSecretValueInput" +_cGSVR = "com.amazonaws.secretsmanager#GetSecretValueRequest" +_VSe = "VersionStage" +_GSVO = "GetSecretValueOutput" +_cGSVRo = "com.amazonaws.secretsmanager#GetSecretValueResponse" +_GSV = "GetSecretValue" +_KKILT = "KmsKeyIdListType" +_MRT = "MaxResultsType" +_SBTo = "SortByType" +_cd = "created_date" +_cd_ = "created-date" +_lad = "last_accessed_date" +_lad_ = "last-accessed-date" +_lcd = "last_changed_date" +_lcd_ = "last-changed-date" +_SOT = "SortOrderType" +_as = "asc" +_de = "desc" +_LSI = "ListSecretsInput" +_cLSR = "com.amazonaws.secretsmanager#ListSecretsRequest" +_IPD = "IncludePlannedDeletion" +_SO = "SortOrder" +_SBo = "SortBy" +_SLE = "SecretListEntry" +_SVTS = "SecretVersionsToStages" +_SLT = "SecretListType" +_LSO = "ListSecretsOutput" +_cLSRo = "com.amazonaws.secretsmanager#ListSecretsResponse" +_SL = "SecretList" +_LS = "ListSecrets" +_LSVII = "ListSecretVersionIdsInput" +_cLSVIR = "com.amazonaws.secretsmanager#ListSecretVersionIdsRequest" +_ID = "IncludeDeprecated" +_SVLE = "SecretVersionsListEntry" +_KKIm = "KmsKeyIds" +_SVLT = "SecretVersionsListType" +_LSVIO = "ListSecretVersionIdsOutput" +_cLSVIRo = "com.amazonaws.secretsmanager#ListSecretVersionIdsResponse" +_Ve = "Versions" +_LSVI = "ListSecretVersionIds" +_PPE = "PublicPolicyException" +_PRPI = "PutResourcePolicyInput" +_cPRPR = "com.amazonaws.secretsmanager#PutResourcePolicyRequest" +_BPP = "BlockPublicPolicy" +_PRPO = "PutResourcePolicyOutput" +_cPRPRo = "com.amazonaws.secretsmanager#PutResourcePolicyResponse" +_PRP = "PutResourcePolicy" +_RTT = "RotationTokenType" +_PSVI = "PutSecretValueInput" +_cPSVR = "com.amazonaws.secretsmanager#PutSecretValueRequest" +_RTo = "RotationToken" +_PSVO = "PutSecretValueOutput" +_cPSVRo = "com.amazonaws.secretsmanager#PutSecretValueResponse" +_PSV = "PutSecretValue" +_RRRLT = "RemoveReplicaRegionListType" +_RRFRI = "RemoveRegionsFromReplicationInput" +_cRRFRR = "com.amazonaws.secretsmanager#RemoveRegionsFromReplicationRequest" +_RRR = "RemoveReplicaRegions" +_RRFRO = "RemoveRegionsFromReplicationOutput" +_cRRFRRo = "com.amazonaws.secretsmanager#RemoveRegionsFromReplicationResponse" +_RRFR = "RemoveRegionsFromReplication" +_RSTRI = "ReplicateSecretToRegionsInput" +_cRSTRR = "com.amazonaws.secretsmanager#ReplicateSecretToRegionsRequest" +_RSTRO = "ReplicateSecretToRegionsOutput" +_cRSTRRo = "com.amazonaws.secretsmanager#ReplicateSecretToRegionsResponse" +_RSTR = "ReplicateSecretToRegions" +_RSI = "RestoreSecretInput" +_cRSR = "com.amazonaws.secretsmanager#RestoreSecretRequest" +_RSO = "RestoreSecretOutput" +_cRSRo = "com.amazonaws.secretsmanager#RestoreSecretResponse" +_RSe = "RestoreSecret" +_RSIo = "RotateSecretInput" +_cRSRom = "com.amazonaws.secretsmanager#RotateSecretRequest" +_RI = "RotateImmediately" +_RSOo = "RotateSecretOutput" +_cRSRoma = "com.amazonaws.secretsmanager#RotateSecretResponse" +_RSo = "RotateSecret" +_SRTRI = "StopReplicationToReplicaInput" +_cSRTRR = "com.amazonaws.secretsmanager#StopReplicationToReplicaRequest" +_SRTRO = "StopReplicationToReplicaOutput" +_cSRTRRo = "com.amazonaws.secretsmanager#StopReplicationToReplicaResponse" +_SRTR = "StopReplicationToReplica" +_TRI = "TagResourceInput" +_cTRR = "com.amazonaws.secretsmanager#TagResourceRequest" +_TRO = "TagResourceOutput" +_sU = "smithy.api#Unit" +_TR = "TagResource" +_TKLT = "TagKeyListType" +_URI = "UntagResourceInput" +_cURR = "com.amazonaws.secretsmanager#UntagResourceRequest" +_TK = "TagKeys" +_URO = "UntagResourceOutput" +_UR = "UntagResource" +_USI = "UpdateSecretInput" +_cUSR = "com.amazonaws.secretsmanager#UpdateSecretRequest" +_USO = "UpdateSecretOutput" +_cUSRo = "com.amazonaws.secretsmanager#UpdateSecretResponse" +_US = "UpdateSecret" +_USVSI = "UpdateSecretVersionStageInput" +_cUSVSR = "com.amazonaws.secretsmanager#UpdateSecretVersionStageRequest" +_RFVI = "RemoveFromVersionId" +_MTVI = "MoveToVersionId" +_USVSO = "UpdateSecretVersionStageOutput" +_cUSVSRo = "com.amazonaws.secretsmanager#UpdateSecretVersionStageResponse" +_USVS = "UpdateSecretVersionStage" +_VRPI = "ValidateResourcePolicyInput" +_cVRPR = "com.amazonaws.secretsmanager#ValidateResourcePolicyRequest" +_VEE = "ValidationErrorsEntry" +_CN = "CheckName" +_VET = "ValidationErrorsType" +_VRPO = "ValidateResourcePolicyOutput" +_cVRPRo = "com.amazonaws.secretsmanager#ValidateResourcePolicyResponse" +_PVP = "PolicyValidationPassed" +_VE = "ValidationErrors" +_VRP = "ValidateResourcePolicy" +_sec = "secretsmanager" +_aw = "aws.auth#sigv4" +_a_ = "aws.protocols#awsJson1_1" +_sB = "smithy.rules#endpointBdd" +_aws = "aws.api#service" + +KMS_KEY_ID_TYPE: StaticSchema = (3, n0, _KKIT, 0) + +REGION_TYPE: StaticSchema = (3, n0, _RT, 0) + +REPLICA_REGION_TYPE: StaticSchema = ( + 18, + n0, + _RRT, + 0, + (_R, _KKI), + ((REGION_TYPE, 0), (KMS_KEY_ID_TYPE, 0)), +) + +ADD_REPLICA_REGION_LIST_TYPE: StaticSchema = ( + 16, + n0, + _ARRLT, + 0, + (_m,), + ((REPLICA_REGION_TYPE, 0),), +) + +ERROR_CODE: StaticSchema = (3, n0, _EC, 0) + +ERROR_MESSAGE: StaticSchema = (3, n0, _EM, 0) + +SECRET_ID_TYPE: StaticSchema = (3, n0, _SIT, 0) + +API_ERROR_TYPE: StaticSchema = ( + 18, + n0, + _APIET, + 0, + (_SI, _EC, _M), + ((SECRET_ID_TYPE, 0), (ERROR_CODE, 0), (ERROR_MESSAGE, 0)), +) + +API_ERROR_LIST_TYPE: StaticSchema = (16, n0, _APIELT, 0, (_m,), ((API_ERROR_TYPE, 0),)) + +AUTOMATICALLY_ROTATE_AFTER_DAYS_TYPE: StaticSchema = (8, n0, _ARADT, 0) + +FILTER_NAME_STRING_TYPE: StaticSchema = ( + 14, + n0, + _FNST, + 0, + (_d, _n, _tk, _tv, _pr, _os, _a), + ( + (-1, {_sV: _d}), + (-1, {_sV: _n}), + (-1, {_sV: _tk_}), + (-1, {_sV: _tv_}), + (-1, {_sV: _pr_}), + (-1, {_sV: _os_}), + (-1, {_sV: _a}), + ), ) -FILTERS_LIST_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#FiltersListType"), - shape_type=ShapeType.LIST, - members={"member": {"target": FILTER}}, -) +FILTER_VALUE_STRING_TYPE: StaticSchema = (3, n0, _FVST, 0) -MAX_RESULTS_BATCH_TYPE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#MaxResultsBatchType"), - shape_type=ShapeType.INTEGER, +FILTER_VALUES_STRING_LIST: StaticSchema = ( + 16, + n0, + _FVSL, + 0, + (_m,), + ((FILTER_VALUE_STRING_TYPE, 0),), ) -NEXT_TOKEN_TYPE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#NextTokenType"), - shape_type=ShapeType.STRING, +FILTER: StaticSchema = ( + 18, + n0, + _F, + 0, + (_K, _V), + ((FILTER_NAME_STRING_TYPE, 0), (FILTER_VALUES_STRING_LIST, 0)), ) -SECRET_ID_LIST_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#SecretIdListType"), - shape_type=ShapeType.LIST, - members={"member": {"target": SECRET_ID_TYPE}}, -) +FILTERS_LIST_TYPE: StaticSchema = (16, n0, _FLT, 0, (_m,), ((FILTER, 0),)) -BATCH_GET_SECRET_VALUE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#BatchGetSecretValueInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.secretsmanager#BatchGetSecretValueRequest", - ) - ], - members={ - "SecretIdList": {"target": SECRET_ID_LIST_TYPE}, - "Filters": {"target": FILTERS_LIST_TYPE}, - "MaxResults": {"target": MAX_RESULTS_BATCH_TYPE}, - "NextToken": {"target": NEXT_TOKEN_TYPE}, - }, -) +MAX_RESULTS_BATCH_TYPE: StaticSchema = (7, n0, _MRBT, 0) -SECRET_ARN_TYPE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#SecretARNType"), - shape_type=ShapeType.STRING, -) +NEXT_TOKEN_TYPE: StaticSchema = (3, n0, _NTT, 0) -CREATED_DATE_TYPE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#CreatedDateType"), - shape_type=ShapeType.TIMESTAMP, -) +SECRET_ID_LIST_TYPE: StaticSchema = (16, n0, _SILT, 0, (_m,), ((SECRET_ID_TYPE, 0),)) -SECRET_NAME_TYPE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#SecretNameType"), - shape_type=ShapeType.STRING, +BATCH_GET_SECRET_VALUE_INPUT: StaticSchema = ( + 18, + n0, + _BGSVI, + {_sSI: _cBGSVR, _s: None}, + (_SIL, _Fi, _MR, _NT), + ( + (SECRET_ID_LIST_TYPE, 0), + (FILTERS_LIST_TYPE, 0), + (MAX_RESULTS_BATCH_TYPE, 0), + (NEXT_TOKEN_TYPE, 0), + ), ) -SECRET_BINARY_TYPE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#SecretBinaryType"), - shape_type=ShapeType.BLOB, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) +SECRET_ARN_TYPE: StaticSchema = (3, n0, _SARNT, 0) -SECRET_STRING_TYPE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#SecretStringType"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) +CREATED_DATE_TYPE: StaticSchema = (4, n0, _CDT, 0) -SECRET_VERSION_ID_TYPE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#SecretVersionIdType"), - shape_type=ShapeType.STRING, -) +SECRET_NAME_TYPE: StaticSchema = (3, n0, _SNT, 0) -SECRET_VERSION_STAGE_TYPE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#SecretVersionStageType"), - shape_type=ShapeType.STRING, -) +SECRET_BINARY_TYPE: StaticSchema = (1, n0, _SBT, 4) -SECRET_VERSION_STAGES_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#SecretVersionStagesType"), - shape_type=ShapeType.LIST, - members={"member": {"target": SECRET_VERSION_STAGE_TYPE}}, -) +SECRET_STRING_TYPE: StaticSchema = (3, n0, _SST, 4) -SECRET_VALUE_ENTRY = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#SecretValueEntry"), - members={ - "ARN": {"target": SECRET_ARN_TYPE}, - "Name": {"target": SECRET_NAME_TYPE}, - "VersionId": {"target": SECRET_VERSION_ID_TYPE}, - "SecretBinary": {"target": SECRET_BINARY_TYPE}, - "SecretString": {"target": SECRET_STRING_TYPE}, - "VersionStages": {"target": SECRET_VERSION_STAGES_TYPE}, - "CreatedDate": {"target": CREATED_DATE_TYPE}, - }, -) +SECRET_VERSION_ID_TYPE: StaticSchema = (3, n0, _SVIT, 0) -SECRET_VALUES_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#SecretValuesType"), - shape_type=ShapeType.LIST, - members={"member": {"target": SECRET_VALUE_ENTRY}}, -) - -BATCH_GET_SECRET_VALUE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#BatchGetSecretValueOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.secretsmanager#BatchGetSecretValueResponse", - ) - ], - members={ - "SecretValues": {"target": SECRET_VALUES_TYPE}, - "NextToken": {"target": NEXT_TOKEN_TYPE}, - "Errors": {"target": API_ERROR_LIST_TYPE}, - }, -) +SECRET_VERSION_STAGE_TYPE: StaticSchema = (3, n0, _SVST, 0) -DECRYPTION_FAILURE = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#DecryptionFailure"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], - members={"Message": {"target": ERROR_MESSAGE}}, +SECRET_VERSION_STAGES_TYPE: StaticSchema = ( + 16, + n0, + _SVSTe, + 0, + (_m,), + ((SECRET_VERSION_STAGE_TYPE, 0),), ) -INTERNAL_SERVICE_ERROR = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#InternalServiceError"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="server")], - members={"Message": {"target": ERROR_MESSAGE}}, +SECRET_VALUE_ENTRY: StaticSchema = ( + 18, + n0, + _SVE, + 0, + (_ARN, _N, _VI, _SB, _SS, _VS, _CD), + ( + (SECRET_ARN_TYPE, 0), + (SECRET_NAME_TYPE, 0), + (SECRET_VERSION_ID_TYPE, 0), + (SECRET_BINARY_TYPE, 0), + (SECRET_STRING_TYPE, 0), + (SECRET_VERSION_STAGES_TYPE, 0), + (CREATED_DATE_TYPE, 0), + ), ) -INVALID_NEXT_TOKEN_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#InvalidNextTokenException"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], - members={"Message": {"target": ERROR_MESSAGE}}, +SECRET_VALUES_TYPE: StaticSchema = (16, n0, _SVT, 0, (_m,), ((SECRET_VALUE_ENTRY, 0),)) + +BATCH_GET_SECRET_VALUE_OUTPUT: StaticSchema = ( + 18, + n0, + _BGSVO, + {_sSI: _cBGSVRo, _smi: None}, + (_SV, _NT, _E), + ((SECRET_VALUES_TYPE, 0), (NEXT_TOKEN_TYPE, 0), (API_ERROR_LIST_TYPE, 0)), +) + +DECRYPTION_FAILURE: StaticSchema = ( + 18, + n0, + _DF, + {_smit: _c}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +INTERNAL_SERVICE_ERROR: StaticSchema = ( + 18, + n0, + _ISE, + {_smit: _se}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +INVALID_NEXT_TOKEN_EXCEPTION: StaticSchema = ( + 18, + n0, + _INTE, + {_smit: _c}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +INVALID_PARAMETER_EXCEPTION: StaticSchema = ( + 18, + n0, + _IPE, + {_smit: _c}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +INVALID_REQUEST_EXCEPTION: StaticSchema = ( + 18, + n0, + _IRE, + {_smit: _c}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +RESOURCE_NOT_FOUND_EXCEPTION: StaticSchema = ( + 18, + n0, + _RNFE, + {_smit: _c}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +BATCH_GET_SECRET_VALUE: StaticOperationSchema = ( + 23, + n0, + _BGSV, + 0, + BATCH_GET_SECRET_VALUE_INPUT, + BATCH_GET_SECRET_VALUE_OUTPUT, + ( + DECRYPTION_FAILURE, + INTERNAL_SERVICE_ERROR, + INVALID_NEXT_TOKEN_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + INVALID_REQUEST_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + ), ) -INVALID_PARAMETER_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#InvalidParameterException"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], - members={"Message": {"target": ERROR_MESSAGE}}, +BOOLEAN_TYPE: StaticSchema = (2, n0, _BT, {_smith: False}) + +CANCEL_ROTATE_SECRET_INPUT: StaticSchema = ( + 18, + n0, + _CRSI, + {_sSI: _cCRSR, _s: None}, + (_SI,), + ((SECRET_ID_TYPE, 1),), +) + +CANCEL_ROTATE_SECRET_OUTPUT: StaticSchema = ( + 18, + n0, + _CRSO, + {_sSI: _cCRSRo, _smi: None}, + (_ARN, _N, _VI), + ((SECRET_ARN_TYPE, 0), (SECRET_NAME_TYPE, 0), (SECRET_VERSION_ID_TYPE, 0)), +) + +CANCEL_ROTATE_SECRET: StaticOperationSchema = ( + 23, + n0, + _CRS, + 0, + CANCEL_ROTATE_SECRET_INPUT, + CANCEL_ROTATE_SECRET_OUTPUT, + ( + INTERNAL_SERVICE_ERROR, + INVALID_PARAMETER_EXCEPTION, + INVALID_REQUEST_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + ), ) -INVALID_REQUEST_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#InvalidRequestException"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], - members={"Message": {"target": ERROR_MESSAGE}}, -) +CLIENT_REQUEST_TOKEN_TYPE: StaticSchema = (3, n0, _CRTT, 0) -RESOURCE_NOT_FOUND_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#ResourceNotFoundException"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], - members={"Message": {"target": ERROR_MESSAGE}}, -) +DESCRIPTION_TYPE: StaticSchema = (3, n0, _DT, 0) -BATCH_GET_SECRET_VALUE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#BatchGetSecretValue"), - shape_type=ShapeType.OPERATION, -) +NAME_TYPE: StaticSchema = (3, n0, _NTa, 0) -BOOLEAN_TYPE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#BooleanType"), - shape_type=ShapeType.BOOLEAN, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=False)], -) +TAG_KEY_TYPE: StaticSchema = (3, n0, _TKT, 0) -CANCEL_ROTATE_SECRET_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#CancelRotateSecretInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.secretsmanager#CancelRotateSecretRequest", - ) - ], - members={ - "SecretId": { - "target": SECRET_ID_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +TAG_VALUE_TYPE: StaticSchema = (3, n0, _TVT, 0) -CANCEL_ROTATE_SECRET_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#CancelRotateSecretOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.secretsmanager#CancelRotateSecretResponse", - ) - ], - members={ - "ARN": {"target": SECRET_ARN_TYPE}, - "Name": {"target": SECRET_NAME_TYPE}, - "VersionId": {"target": SECRET_VERSION_ID_TYPE}, - }, -) +TAG: StaticSchema = (18, n0, _T, 0, (_K, _Va), ((TAG_KEY_TYPE, 0), (TAG_VALUE_TYPE, 0))) -CANCEL_ROTATE_SECRET = Schema( - id=ShapeID("com.amazonaws.secretsmanager#CancelRotateSecret"), - shape_type=ShapeType.OPERATION, -) +TAG_LIST_TYPE: StaticSchema = (16, n0, _TLT, 0, (_m,), ((TAG, 0),)) -CLIENT_REQUEST_TOKEN_TYPE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#ClientRequestTokenType"), - shape_type=ShapeType.STRING, -) +MEDEA_TYPE_TYPE: StaticSchema = (3, n0, _MTT, 0) -DESCRIPTION_TYPE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#DescriptionType"), - shape_type=ShapeType.STRING, +CREATE_SECRET_INPUT: StaticSchema = ( + 18, + n0, + _CSI, + {_sSI: _cCSR, _s: None}, + (_N, _CRT, _D, _KKI, _SB, _SS, _Ta, _ARR, _FORS, _Ty), + ( + (NAME_TYPE, 1), + (CLIENT_REQUEST_TOKEN_TYPE, 2), + (DESCRIPTION_TYPE, 0), + (KMS_KEY_ID_TYPE, 0), + (SECRET_BINARY_TYPE, 0), + (SECRET_STRING_TYPE, 0), + (TAG_LIST_TYPE, 0), + (ADD_REPLICA_REGION_LIST_TYPE, 0), + (BOOLEAN_TYPE, {_smith: False}), + (MEDEA_TYPE_TYPE, 0), + ), ) -NAME_TYPE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#NameType"), shape_type=ShapeType.STRING -) +LAST_ACCESSED_DATE_TYPE: StaticSchema = (4, n0, _LADT, 0) -TAG_KEY_TYPE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#TagKeyType"), shape_type=ShapeType.STRING +STATUS_TYPE: StaticSchema = ( + 14, + n0, + _ST, + 0, + (_IS, _Fa, _IP), + ((-1, {_sV: _IS}), (-1, {_sV: _Fa}), (-1, {_sV: _IP})), ) -TAG_VALUE_TYPE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#TagValueType"), shape_type=ShapeType.STRING -) +STATUS_MESSAGE_TYPE: StaticSchema = (3, n0, _SMT, 0) -TAG = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#Tag"), - members={"Key": {"target": TAG_KEY_TYPE}, "Value": {"target": TAG_VALUE_TYPE}}, +REPLICATION_STATUS_TYPE: StaticSchema = ( + 18, + n0, + _RST, + 0, + (_R, _KKI, _S, _SM, _LAD), + ( + (REGION_TYPE, 0), + (KMS_KEY_ID_TYPE, 0), + (STATUS_TYPE, 0), + (STATUS_MESSAGE_TYPE, 0), + (LAST_ACCESSED_DATE_TYPE, 0), + ), ) -TAG_LIST_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#TagListType"), - shape_type=ShapeType.LIST, - members={"member": {"target": TAG}}, +REPLICATION_STATUS_LIST_TYPE: StaticSchema = ( + 16, + n0, + _RSLT, + 0, + (_m,), + ((REPLICATION_STATUS_TYPE, 0),), +) + +CREATE_SECRET_OUTPUT: StaticSchema = ( + 18, + n0, + _CSO, + {_sSI: _cCSRo, _smi: None}, + (_ARN, _N, _VI, _RS), + ( + (SECRET_ARN_TYPE, 0), + (SECRET_NAME_TYPE, 0), + (SECRET_VERSION_ID_TYPE, 0), + (REPLICATION_STATUS_LIST_TYPE, 0), + ), ) -MEDEA_TYPE_TYPE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#MedeaTypeType"), - shape_type=ShapeType.STRING, +ENCRYPTION_FAILURE: StaticSchema = ( + 18, + n0, + _EF, + {_smit: _c}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +LIMIT_EXCEEDED_EXCEPTION: StaticSchema = ( + 18, + n0, + _LEE, + {_smit: _c}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +MALFORMED_POLICY_DOCUMENT_EXCEPTION: StaticSchema = ( + 18, + n0, + _MPDE, + {_smit: _c}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +PRECONDITION_NOT_MET_EXCEPTION: StaticSchema = ( + 18, + n0, + _PNME, + {_smit: _c}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +RESOURCE_EXISTS_EXCEPTION: StaticSchema = ( + 18, + n0, + _REE, + {_smit: _c}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +CREATE_SECRET: StaticOperationSchema = ( + 23, + n0, + _CS, + 0, + CREATE_SECRET_INPUT, + CREATE_SECRET_OUTPUT, + ( + DECRYPTION_FAILURE, + ENCRYPTION_FAILURE, + INTERNAL_SERVICE_ERROR, + INVALID_PARAMETER_EXCEPTION, + INVALID_REQUEST_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + MALFORMED_POLICY_DOCUMENT_EXCEPTION, + PRECONDITION_NOT_MET_EXCEPTION, + RESOURCE_EXISTS_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + ), ) -CREATE_SECRET_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#CreateSecretInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.secretsmanager#CreateSecretRequest", - ) - ], - members={ - "Name": { - "target": NAME_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ClientRequestToken": { - "target": CLIENT_REQUEST_TOKEN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "Description": {"target": DESCRIPTION_TYPE}, - "KmsKeyId": {"target": KMS_KEY_ID_TYPE}, - "SecretBinary": {"target": SECRET_BINARY_TYPE}, - "SecretString": {"target": SECRET_STRING_TYPE}, - "Tags": {"target": TAG_LIST_TYPE}, - "AddReplicaRegions": {"target": ADD_REPLICA_REGION_LIST_TYPE}, - "ForceOverwriteReplicaSecret": { - "target": BOOLEAN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "Type": {"target": MEDEA_TYPE_TYPE}, - }, +DELETED_DATE_TYPE: StaticSchema = (4, n0, _DDT, 0) + +DELETE_RESOURCE_POLICY_INPUT: StaticSchema = ( + 18, + n0, + _DRPI, + {_sSI: _cDRPR, _s: None}, + (_SI,), + ((SECRET_ID_TYPE, 1),), +) + +DELETE_RESOURCE_POLICY_OUTPUT: StaticSchema = ( + 18, + n0, + _DRPO, + {_sSI: _cDRPRo, _smi: None}, + (_ARN, _N), + ((SECRET_ARN_TYPE, 0), (NAME_TYPE, 0)), +) + +DELETE_RESOURCE_POLICY: StaticOperationSchema = ( + 23, + n0, + _DRP, + 0, + DELETE_RESOURCE_POLICY_INPUT, + DELETE_RESOURCE_POLICY_OUTPUT, + ( + INTERNAL_SERVICE_ERROR, + INVALID_PARAMETER_EXCEPTION, + INVALID_REQUEST_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + ), ) -LAST_ACCESSED_DATE_TYPE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#LastAccessedDateType"), - shape_type=ShapeType.TIMESTAMP, -) +RECOVERY_WINDOW_IN_DAYS_TYPE: StaticSchema = (8, n0, _RWIDT, {_smith: 0}) -STATUS_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#StatusType"), - shape_type=ShapeType.ENUM, - members={ - "InSync": {"target": UNIT}, - "Failed": {"target": UNIT}, - "InProgress": {"target": UNIT}, - }, +DELETE_SECRET_INPUT: StaticSchema = ( + 18, + n0, + _DSI, + {_sSI: _cDSR, _s: None}, + (_SI, _RWID, _FDWR), + ( + (SECRET_ID_TYPE, 1), + (RECOVERY_WINDOW_IN_DAYS_TYPE, {_smith: None}), + (BOOLEAN_TYPE, {_smith: None}), + ), ) -STATUS_MESSAGE_TYPE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#StatusMessageType"), - shape_type=ShapeType.STRING, +DELETION_DATE_TYPE: StaticSchema = (4, n0, _DDTe, 0) + +DELETE_SECRET_OUTPUT: StaticSchema = ( + 18, + n0, + _DSO, + {_sSI: _cDSRo, _smi: None}, + (_ARN, _N, _DD), + ((SECRET_ARN_TYPE, 0), (SECRET_NAME_TYPE, 0), (DELETION_DATE_TYPE, 0)), +) + +DELETE_SECRET: StaticOperationSchema = ( + 23, + n0, + _DS, + 0, + DELETE_SECRET_INPUT, + DELETE_SECRET_OUTPUT, + ( + INTERNAL_SERVICE_ERROR, + INVALID_PARAMETER_EXCEPTION, + INVALID_REQUEST_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + ), ) -REPLICATION_STATUS_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#ReplicationStatusType"), - members={ - "Region": {"target": REGION_TYPE}, - "KmsKeyId": {"target": KMS_KEY_ID_TYPE}, - "Status": {"target": STATUS_TYPE}, - "StatusMessage": {"target": STATUS_MESSAGE_TYPE}, - "LastAccessedDate": {"target": LAST_ACCESSED_DATE_TYPE}, - }, +DESCRIBE_SECRET_INPUT: StaticSchema = ( + 18, + n0, + _DSIe, + {_sSI: _cDSRom, _s: None}, + (_SI,), + ((SECRET_ID_TYPE, 1),), ) -REPLICATION_STATUS_LIST_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#ReplicationStatusListType"), - shape_type=ShapeType.LIST, - members={"member": {"target": REPLICATION_STATUS_TYPE}}, -) - -CREATE_SECRET_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#CreateSecretOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.secretsmanager#CreateSecretResponse", - ) - ], - members={ - "ARN": {"target": SECRET_ARN_TYPE}, - "Name": {"target": SECRET_NAME_TYPE}, - "VersionId": {"target": SECRET_VERSION_ID_TYPE}, - "ReplicationStatus": {"target": REPLICATION_STATUS_LIST_TYPE}, - }, -) +TIMESTAMP_TYPE: StaticSchema = (4, n0, _TT, 0) -ENCRYPTION_FAILURE = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#EncryptionFailure"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], - members={"Message": {"target": ERROR_MESSAGE}}, -) +EXTERNAL_SECRET_ROTATION_METADATA_ITEM_KEY_TYPE: StaticSchema = (3, n0, _ESRMIKT, 0) -LIMIT_EXCEEDED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#LimitExceededException"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], - members={"Message": {"target": ERROR_MESSAGE}}, -) +EXTERNAL_SECRET_ROTATION_METADATA_ITEM_VALUE_TYPE: StaticSchema = (3, n0, _ESRMIVT, 0) -MALFORMED_POLICY_DOCUMENT_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#MalformedPolicyDocumentException"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], - members={"Message": {"target": ERROR_MESSAGE}}, +EXTERNAL_SECRET_ROTATION_METADATA_ITEM: StaticSchema = ( + 18, + n0, + _ESRMI, + 0, + (_K, _Va), + ( + (EXTERNAL_SECRET_ROTATION_METADATA_ITEM_KEY_TYPE, 0), + (EXTERNAL_SECRET_ROTATION_METADATA_ITEM_VALUE_TYPE, 0), + ), ) -PRECONDITION_NOT_MET_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#PreconditionNotMetException"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], - members={"Message": {"target": ERROR_MESSAGE}}, +EXTERNAL_SECRET_ROTATION_METADATA_TYPE: StaticSchema = ( + 16, + n0, + _ESRMT, + 0, + (_m,), + ((EXTERNAL_SECRET_ROTATION_METADATA_ITEM, 0),), ) -RESOURCE_EXISTS_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#ResourceExistsException"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], - members={"Message": {"target": ERROR_MESSAGE}}, -) +ROLE_ARN_TYPE: StaticSchema = (3, n0, _RARNT, 0) -CREATE_SECRET = Schema( - id=ShapeID("com.amazonaws.secretsmanager#CreateSecret"), - shape_type=ShapeType.OPERATION, -) +LAST_CHANGED_DATE_TYPE: StaticSchema = (4, n0, _LCDT, 0) -DELETED_DATE_TYPE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#DeletedDateType"), - shape_type=ShapeType.TIMESTAMP, -) +LAST_ROTATED_DATE_TYPE: StaticSchema = (4, n0, _LRDT, 0) -DELETE_RESOURCE_POLICY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#DeleteResourcePolicyInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.secretsmanager#DeleteResourcePolicyRequest", - ) - ], - members={ - "SecretId": { - "target": SECRET_ID_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +NEXT_ROTATION_DATE_TYPE: StaticSchema = (4, n0, _NRDT, 0) -DELETE_RESOURCE_POLICY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#DeleteResourcePolicyOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.secretsmanager#DeleteResourcePolicyResponse", - ) - ], - members={"ARN": {"target": SECRET_ARN_TYPE}, "Name": {"target": NAME_TYPE}}, -) - -DELETE_RESOURCE_POLICY = Schema( - id=ShapeID("com.amazonaws.secretsmanager#DeleteResourcePolicy"), - shape_type=ShapeType.OPERATION, -) - -RECOVERY_WINDOW_IN_DAYS_TYPE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#RecoveryWindowInDaysType"), - shape_type=ShapeType.LONG, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=0)], -) - -DELETE_SECRET_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#DeleteSecretInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.secretsmanager#DeleteSecretRequest", - ) - ], - members={ - "SecretId": { - "target": SECRET_ID_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "RecoveryWindowInDays": { - "target": RECOVERY_WINDOW_IN_DAYS_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=None)], - }, - "ForceDeleteWithoutRecovery": { - "target": BOOLEAN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=None)], - }, - }, -) +OWNING_SERVICE_TYPE: StaticSchema = (3, n0, _OST, 0) -DELETION_DATE_TYPE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#DeletionDateType"), - shape_type=ShapeType.TIMESTAMP, -) +ROTATION_ENABLED_TYPE: StaticSchema = (2, n0, _RET, {_smith: False}) -DELETE_SECRET_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#DeleteSecretOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.secretsmanager#DeleteSecretResponse", - ) - ], - members={ - "ARN": {"target": SECRET_ARN_TYPE}, - "Name": {"target": SECRET_NAME_TYPE}, - "DeletionDate": {"target": DELETION_DATE_TYPE}, - }, -) +ROTATION_LAMBDA_ARN_TYPE: StaticSchema = (3, n0, _RLARNT, 0) -DELETE_SECRET = Schema( - id=ShapeID("com.amazonaws.secretsmanager#DeleteSecret"), - shape_type=ShapeType.OPERATION, -) - -DESCRIBE_SECRET_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#DescribeSecretInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.secretsmanager#DescribeSecretRequest", - ) - ], - members={ - "SecretId": { - "target": SECRET_ID_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +DURATION_TYPE: StaticSchema = (3, n0, _DTu, 0) -TIMESTAMP_TYPE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#TimestampType"), - shape_type=ShapeType.TIMESTAMP, -) +SCHEDULE_EXPRESSION_TYPE: StaticSchema = (3, n0, _SET, 0) -EXTERNAL_SECRET_ROTATION_METADATA_ITEM_KEY_TYPE = Schema( - id=ShapeID( - "com.amazonaws.secretsmanager#ExternalSecretRotationMetadataItemKeyType" +ROTATION_RULES_TYPE: StaticSchema = ( + 18, + n0, + _RRTo, + 0, + (_AAD, _Du, _SE), + ( + (AUTOMATICALLY_ROTATE_AFTER_DAYS_TYPE, 0), + (DURATION_TYPE, 0), + (SCHEDULE_EXPRESSION_TYPE, 0), ), - shape_type=ShapeType.STRING, ) -EXTERNAL_SECRET_ROTATION_METADATA_ITEM_VALUE_TYPE = Schema( - id=ShapeID( - "com.amazonaws.secretsmanager#ExternalSecretRotationMetadataItemValueType" +SECRET_VERSIONS_TO_STAGES_MAP_TYPE: StaticSchema = ( + 17, + n0, + _SVTSMT, + 0, + (_k, _v), + ((SECRET_VERSION_ID_TYPE, 0), (SECRET_VERSION_STAGES_TYPE, 0)), +) + +DESCRIBE_SECRET_OUTPUT: StaticSchema = ( + 18, + n0, + _DSOe, + {_sSI: _cDSRoma, _smi: None}, + ( + _ARN, + _N, + _Ty, + _D, + _KKI, + _RE, + _RLARN, + _RR, + _ESRM, + _ESRRA, + _LRD, + _LCD, + _LAD, + _DDe, + _NRD, + _Ta, + _VITS, + _OS, + _CD, + _PR, + _RS, + ), + ( + (SECRET_ARN_TYPE, 0), + (SECRET_NAME_TYPE, 0), + (MEDEA_TYPE_TYPE, 0), + (DESCRIPTION_TYPE, 0), + (KMS_KEY_ID_TYPE, 0), + (ROTATION_ENABLED_TYPE, {_smith: None}), + (ROTATION_LAMBDA_ARN_TYPE, 0), + (ROTATION_RULES_TYPE, 0), + (EXTERNAL_SECRET_ROTATION_METADATA_TYPE, 0), + (ROLE_ARN_TYPE, 0), + (LAST_ROTATED_DATE_TYPE, 0), + (LAST_CHANGED_DATE_TYPE, 0), + (LAST_ACCESSED_DATE_TYPE, 0), + (DELETED_DATE_TYPE, 0), + (NEXT_ROTATION_DATE_TYPE, 0), + (TAG_LIST_TYPE, 0), + (SECRET_VERSIONS_TO_STAGES_MAP_TYPE, 0), + (OWNING_SERVICE_TYPE, 0), + (TIMESTAMP_TYPE, 0), + (REGION_TYPE, 0), + (REPLICATION_STATUS_LIST_TYPE, 0), ), - shape_type=ShapeType.STRING, -) - -EXTERNAL_SECRET_ROTATION_METADATA_ITEM = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#ExternalSecretRotationMetadataItem"), - members={ - "Key": {"target": EXTERNAL_SECRET_ROTATION_METADATA_ITEM_KEY_TYPE}, - "Value": {"target": EXTERNAL_SECRET_ROTATION_METADATA_ITEM_VALUE_TYPE}, - }, -) - -EXTERNAL_SECRET_ROTATION_METADATA_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#ExternalSecretRotationMetadataType"), - shape_type=ShapeType.LIST, - members={"member": {"target": EXTERNAL_SECRET_ROTATION_METADATA_ITEM}}, ) -ROLE_ARN_TYPE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#RoleARNType"), shape_type=ShapeType.STRING +DESCRIBE_SECRET: StaticOperationSchema = ( + 23, + n0, + _DSe, + 0, + DESCRIBE_SECRET_INPUT, + DESCRIBE_SECRET_OUTPUT, + (INTERNAL_SERVICE_ERROR, INVALID_PARAMETER_EXCEPTION, RESOURCE_NOT_FOUND_EXCEPTION), ) -LAST_CHANGED_DATE_TYPE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#LastChangedDateType"), - shape_type=ShapeType.TIMESTAMP, -) +EXCLUDE_CHARACTERS_TYPE: StaticSchema = (3, n0, _ECT, 0) -LAST_ROTATED_DATE_TYPE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#LastRotatedDateType"), - shape_type=ShapeType.TIMESTAMP, -) +EXCLUDE_LOWERCASE_TYPE: StaticSchema = (2, n0, _ELT, {_smith: False}) -NEXT_ROTATION_DATE_TYPE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#NextRotationDateType"), - shape_type=ShapeType.TIMESTAMP, -) +EXCLUDE_NUMBERS_TYPE: StaticSchema = (2, n0, _ENT, {_smith: False}) -OWNING_SERVICE_TYPE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#OwningServiceType"), - shape_type=ShapeType.STRING, -) +EXCLUDE_PUNCTUATION_TYPE: StaticSchema = (2, n0, _EPT, {_smith: False}) -ROTATION_ENABLED_TYPE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#RotationEnabledType"), - shape_type=ShapeType.BOOLEAN, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=False)], -) +EXCLUDE_UPPERCASE_TYPE: StaticSchema = (2, n0, _EUT, {_smith: False}) -ROTATION_LAMBDA_ARN_TYPE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#RotationLambdaARNType"), - shape_type=ShapeType.STRING, -) - -DURATION_TYPE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#DurationType"), shape_type=ShapeType.STRING -) +INCLUDE_SPACE_TYPE: StaticSchema = (2, n0, _IST, {_smith: False}) -SCHEDULE_EXPRESSION_TYPE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#ScheduleExpressionType"), - shape_type=ShapeType.STRING, -) +PASSWORD_LENGTH_TYPE: StaticSchema = (8, n0, _PLT, 0) -ROTATION_RULES_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#RotationRulesType"), - members={ - "AutomaticallyAfterDays": {"target": AUTOMATICALLY_ROTATE_AFTER_DAYS_TYPE}, - "Duration": {"target": DURATION_TYPE}, - "ScheduleExpression": {"target": SCHEDULE_EXPRESSION_TYPE}, - }, -) - -SECRET_VERSIONS_TO_STAGES_MAP_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#SecretVersionsToStagesMapType"), - shape_type=ShapeType.MAP, - members={ - "key": {"target": SECRET_VERSION_ID_TYPE}, - "value": {"target": SECRET_VERSION_STAGES_TYPE}, - }, -) - -DESCRIBE_SECRET_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#DescribeSecretOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.secretsmanager#DescribeSecretResponse", - ) - ], - members={ - "ARN": {"target": SECRET_ARN_TYPE}, - "Name": {"target": SECRET_NAME_TYPE}, - "Type": {"target": MEDEA_TYPE_TYPE}, - "Description": {"target": DESCRIPTION_TYPE}, - "KmsKeyId": {"target": KMS_KEY_ID_TYPE}, - "RotationEnabled": { - "target": ROTATION_ENABLED_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=None)], - }, - "RotationLambdaARN": {"target": ROTATION_LAMBDA_ARN_TYPE}, - "RotationRules": {"target": ROTATION_RULES_TYPE}, - "ExternalSecretRotationMetadata": { - "target": EXTERNAL_SECRET_ROTATION_METADATA_TYPE - }, - "ExternalSecretRotationRoleArn": {"target": ROLE_ARN_TYPE}, - "LastRotatedDate": {"target": LAST_ROTATED_DATE_TYPE}, - "LastChangedDate": {"target": LAST_CHANGED_DATE_TYPE}, - "LastAccessedDate": {"target": LAST_ACCESSED_DATE_TYPE}, - "DeletedDate": {"target": DELETED_DATE_TYPE}, - "NextRotationDate": {"target": NEXT_ROTATION_DATE_TYPE}, - "Tags": {"target": TAG_LIST_TYPE}, - "VersionIdsToStages": {"target": SECRET_VERSIONS_TO_STAGES_MAP_TYPE}, - "OwningService": {"target": OWNING_SERVICE_TYPE}, - "CreatedDate": {"target": TIMESTAMP_TYPE}, - "PrimaryRegion": {"target": REGION_TYPE}, - "ReplicationStatus": {"target": REPLICATION_STATUS_LIST_TYPE}, - }, -) - -DESCRIBE_SECRET = Schema( - id=ShapeID("com.amazonaws.secretsmanager#DescribeSecret"), - shape_type=ShapeType.OPERATION, -) - -EXCLUDE_CHARACTERS_TYPE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#ExcludeCharactersType"), - shape_type=ShapeType.STRING, -) - -EXCLUDE_LOWERCASE_TYPE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#ExcludeLowercaseType"), - shape_type=ShapeType.BOOLEAN, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=False)], -) - -EXCLUDE_NUMBERS_TYPE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#ExcludeNumbersType"), - shape_type=ShapeType.BOOLEAN, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=False)], -) - -EXCLUDE_PUNCTUATION_TYPE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#ExcludePunctuationType"), - shape_type=ShapeType.BOOLEAN, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=False)], -) - -EXCLUDE_UPPERCASE_TYPE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#ExcludeUppercaseType"), - shape_type=ShapeType.BOOLEAN, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=False)], -) - -INCLUDE_SPACE_TYPE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#IncludeSpaceType"), - shape_type=ShapeType.BOOLEAN, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=False)], -) - -PASSWORD_LENGTH_TYPE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#PasswordLengthType"), - shape_type=ShapeType.LONG, -) - -REQUIRE_EACH_INCLUDED_TYPE_TYPE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#RequireEachIncludedTypeType"), - shape_type=ShapeType.BOOLEAN, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=False)], -) - -GET_RANDOM_PASSWORD_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#GetRandomPasswordInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.secretsmanager#GetRandomPasswordRequest", - ) - ], - members={ - "PasswordLength": {"target": PASSWORD_LENGTH_TYPE}, - "ExcludeCharacters": {"target": EXCLUDE_CHARACTERS_TYPE}, - "ExcludeNumbers": { - "target": EXCLUDE_NUMBERS_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=None)], - }, - "ExcludePunctuation": { - "target": EXCLUDE_PUNCTUATION_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=None)], - }, - "ExcludeUppercase": { - "target": EXCLUDE_UPPERCASE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=None)], - }, - "ExcludeLowercase": { - "target": EXCLUDE_LOWERCASE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=None)], - }, - "IncludeSpace": { - "target": INCLUDE_SPACE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=None)], - }, - "RequireEachIncludedType": { - "target": REQUIRE_EACH_INCLUDED_TYPE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=None)], - }, - }, -) - -RANDOM_PASSWORD_TYPE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#RandomPasswordType"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -GET_RANDOM_PASSWORD_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#GetRandomPasswordOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.secretsmanager#GetRandomPasswordResponse", - ) - ], - members={"RandomPassword": {"target": RANDOM_PASSWORD_TYPE}}, -) - -GET_RANDOM_PASSWORD = Schema( - id=ShapeID("com.amazonaws.secretsmanager#GetRandomPassword"), - shape_type=ShapeType.OPERATION, -) - -GET_RESOURCE_POLICY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#GetResourcePolicyInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.secretsmanager#GetResourcePolicyRequest", - ) - ], - members={ - "SecretId": { - "target": SECRET_ID_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) +REQUIRE_EACH_INCLUDED_TYPE_TYPE: StaticSchema = (2, n0, _REITT, {_smith: False}) -NON_EMPTY_RESOURCE_POLICY_TYPE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#NonEmptyResourcePolicyType"), - shape_type=ShapeType.STRING, -) - -GET_RESOURCE_POLICY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#GetResourcePolicyOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.secretsmanager#GetResourcePolicyResponse", - ) - ], - members={ - "ARN": {"target": SECRET_ARN_TYPE}, - "Name": {"target": NAME_TYPE}, - "ResourcePolicy": {"target": NON_EMPTY_RESOURCE_POLICY_TYPE}, - }, -) - -GET_RESOURCE_POLICY = Schema( - id=ShapeID("com.amazonaws.secretsmanager#GetResourcePolicy"), - shape_type=ShapeType.OPERATION, -) - -GET_SECRET_VALUE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#GetSecretValueInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.secretsmanager#GetSecretValueRequest", - ) - ], - members={ - "SecretId": { - "target": SECRET_ID_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "VersionId": {"target": SECRET_VERSION_ID_TYPE}, - "VersionStage": {"target": SECRET_VERSION_STAGE_TYPE}, - }, +GET_RANDOM_PASSWORD_INPUT: StaticSchema = ( + 18, + n0, + _GRPI, + {_sSI: _cGRPR, _s: None}, + (_PL, _ECx, _EN, _EP, _EU, _EL, _ISn, _REIT), + ( + (PASSWORD_LENGTH_TYPE, 0), + (EXCLUDE_CHARACTERS_TYPE, 0), + (EXCLUDE_NUMBERS_TYPE, {_smith: None}), + (EXCLUDE_PUNCTUATION_TYPE, {_smith: None}), + (EXCLUDE_UPPERCASE_TYPE, {_smith: None}), + (EXCLUDE_LOWERCASE_TYPE, {_smith: None}), + (INCLUDE_SPACE_TYPE, {_smith: None}), + (REQUIRE_EACH_INCLUDED_TYPE_TYPE, {_smith: None}), + ), ) -GET_SECRET_VALUE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#GetSecretValueOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.secretsmanager#GetSecretValueResponse", - ) - ], - members={ - "ARN": {"target": SECRET_ARN_TYPE}, - "Name": {"target": SECRET_NAME_TYPE}, - "VersionId": {"target": SECRET_VERSION_ID_TYPE}, - "SecretBinary": {"target": SECRET_BINARY_TYPE}, - "SecretString": {"target": SECRET_STRING_TYPE}, - "VersionStages": {"target": SECRET_VERSION_STAGES_TYPE}, - "CreatedDate": {"target": CREATED_DATE_TYPE}, - }, +RANDOM_PASSWORD_TYPE: StaticSchema = (3, n0, _RPT, 4) + +GET_RANDOM_PASSWORD_OUTPUT: StaticSchema = ( + 18, + n0, + _GRPO, + {_sSI: _cGRPRo, _smi: None}, + (_RP,), + ((RANDOM_PASSWORD_TYPE, 0),), +) + +GET_RANDOM_PASSWORD: StaticOperationSchema = ( + 23, + n0, + _GRP, + 0, + GET_RANDOM_PASSWORD_INPUT, + GET_RANDOM_PASSWORD_OUTPUT, + (INTERNAL_SERVICE_ERROR, INVALID_PARAMETER_EXCEPTION, INVALID_REQUEST_EXCEPTION), +) + +GET_RESOURCE_POLICY_INPUT: StaticSchema = ( + 18, + n0, + _GRPIe, + {_sSI: _cGRPRom, _s: None}, + (_SI,), + ((SECRET_ID_TYPE, 1),), +) + +NON_EMPTY_RESOURCE_POLICY_TYPE: StaticSchema = (3, n0, _NERPT, 0) + +GET_RESOURCE_POLICY_OUTPUT: StaticSchema = ( + 18, + n0, + _GRPOe, + {_sSI: _cGRPRoma, _smi: None}, + (_ARN, _N, _RPe), + ((SECRET_ARN_TYPE, 0), (NAME_TYPE, 0), (NON_EMPTY_RESOURCE_POLICY_TYPE, 0)), +) + +GET_RESOURCE_POLICY: StaticOperationSchema = ( + 23, + n0, + _GRPe, + 0, + GET_RESOURCE_POLICY_INPUT, + GET_RESOURCE_POLICY_OUTPUT, + ( + INTERNAL_SERVICE_ERROR, + INVALID_PARAMETER_EXCEPTION, + INVALID_REQUEST_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + ), ) -GET_SECRET_VALUE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#GetSecretValue"), - shape_type=ShapeType.OPERATION, +GET_SECRET_VALUE_INPUT: StaticSchema = ( + 18, + n0, + _GSVI, + {_sSI: _cGSVR, _s: None}, + (_SI, _VI, _VSe), + ((SECRET_ID_TYPE, 1), (SECRET_VERSION_ID_TYPE, 0), (SECRET_VERSION_STAGE_TYPE, 0)), +) + +GET_SECRET_VALUE_OUTPUT: StaticSchema = ( + 18, + n0, + _GSVO, + {_sSI: _cGSVRo, _smi: None}, + (_ARN, _N, _VI, _SB, _SS, _VS, _CD), + ( + (SECRET_ARN_TYPE, 0), + (SECRET_NAME_TYPE, 0), + (SECRET_VERSION_ID_TYPE, 0), + (SECRET_BINARY_TYPE, 0), + (SECRET_STRING_TYPE, 0), + (SECRET_VERSION_STAGES_TYPE, 0), + (CREATED_DATE_TYPE, 0), + ), ) -KMS_KEY_ID_LIST_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#KmsKeyIdListType"), - shape_type=ShapeType.LIST, - members={"member": {"target": KMS_KEY_ID_TYPE}}, +GET_SECRET_VALUE: StaticOperationSchema = ( + 23, + n0, + _GSV, + 0, + GET_SECRET_VALUE_INPUT, + GET_SECRET_VALUE_OUTPUT, + ( + DECRYPTION_FAILURE, + INTERNAL_SERVICE_ERROR, + INVALID_PARAMETER_EXCEPTION, + INVALID_REQUEST_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + ), ) -MAX_RESULTS_TYPE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#MaxResultsType"), - shape_type=ShapeType.INTEGER, +KMS_KEY_ID_LIST_TYPE: StaticSchema = (16, n0, _KKILT, 0, (_m,), ((KMS_KEY_ID_TYPE, 0),)) + +MAX_RESULTS_TYPE: StaticSchema = (7, n0, _MRT, 0) + +SORT_BY_TYPE: StaticSchema = ( + 14, + n0, + _SBTo, + 0, + (_cd, _lad, _lcd, _n), + ((-1, {_sV: _cd_}), (-1, {_sV: _lad_}), (-1, {_sV: _lcd_}), (-1, {_sV: _n})), +) + +SORT_ORDER_TYPE: StaticSchema = ( + 14, + n0, + _SOT, + 0, + (_as, _de), + ((-1, {_sV: _as}), (-1, {_sV: _de})), +) + +LIST_SECRETS_INPUT: StaticSchema = ( + 18, + n0, + _LSI, + {_sSI: _cLSR, _s: None}, + (_IPD, _MR, _NT, _Fi, _SO, _SBo), + ( + (BOOLEAN_TYPE, {_smith: None}), + (MAX_RESULTS_TYPE, 0), + (NEXT_TOKEN_TYPE, 0), + (FILTERS_LIST_TYPE, 0), + (SORT_ORDER_TYPE, 0), + (SORT_BY_TYPE, 0), + ), ) -SORT_BY_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#SortByType"), - shape_type=ShapeType.ENUM, - members={ - "created_date": {"target": UNIT}, - "last_accessed_date": {"target": UNIT}, - "last_changed_date": {"target": UNIT}, - "name": {"target": UNIT}, - }, +SECRET_LIST_ENTRY: StaticSchema = ( + 18, + n0, + _SLE, + 0, + ( + _ARN, + _N, + _Ty, + _D, + _KKI, + _RE, + _RLARN, + _RR, + _ESRM, + _ESRRA, + _LRD, + _LCD, + _LAD, + _DDe, + _NRD, + _Ta, + _SVTS, + _OS, + _CD, + _PR, + ), + ( + (SECRET_ARN_TYPE, 0), + (SECRET_NAME_TYPE, 0), + (MEDEA_TYPE_TYPE, 0), + (DESCRIPTION_TYPE, 0), + (KMS_KEY_ID_TYPE, 0), + (ROTATION_ENABLED_TYPE, {_smith: None}), + (ROTATION_LAMBDA_ARN_TYPE, 0), + (ROTATION_RULES_TYPE, 0), + (EXTERNAL_SECRET_ROTATION_METADATA_TYPE, 0), + (ROLE_ARN_TYPE, 0), + (LAST_ROTATED_DATE_TYPE, 0), + (LAST_CHANGED_DATE_TYPE, 0), + (LAST_ACCESSED_DATE_TYPE, 0), + (DELETED_DATE_TYPE, 0), + (NEXT_ROTATION_DATE_TYPE, 0), + (TAG_LIST_TYPE, 0), + (SECRET_VERSIONS_TO_STAGES_MAP_TYPE, 0), + (OWNING_SERVICE_TYPE, 0), + (TIMESTAMP_TYPE, 0), + (REGION_TYPE, 0), + ), ) -SORT_ORDER_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#SortOrderType"), - shape_type=ShapeType.ENUM, - members={"asc": {"target": UNIT}, "desc": {"target": UNIT}}, -) - -LIST_SECRETS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#ListSecretsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.secretsmanager#ListSecretsRequest", - ) - ], - members={ - "IncludePlannedDeletion": { - "target": BOOLEAN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=None)], - }, - "MaxResults": {"target": MAX_RESULTS_TYPE}, - "NextToken": {"target": NEXT_TOKEN_TYPE}, - "Filters": {"target": FILTERS_LIST_TYPE}, - "SortOrder": {"target": SORT_ORDER_TYPE}, - "SortBy": {"target": SORT_BY_TYPE}, - }, +SECRET_LIST_TYPE: StaticSchema = (16, n0, _SLT, 0, (_m,), ((SECRET_LIST_ENTRY, 0),)) + +LIST_SECRETS_OUTPUT: StaticSchema = ( + 18, + n0, + _LSO, + {_sSI: _cLSRo, _smi: None}, + (_SL, _NT), + ((SECRET_LIST_TYPE, 0), (NEXT_TOKEN_TYPE, 0)), +) + +LIST_SECRETS: StaticOperationSchema = ( + 23, + n0, + _LS, + 0, + LIST_SECRETS_INPUT, + LIST_SECRETS_OUTPUT, + ( + INTERNAL_SERVICE_ERROR, + INVALID_NEXT_TOKEN_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + INVALID_REQUEST_EXCEPTION, + ), ) -SECRET_LIST_ENTRY = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#SecretListEntry"), - members={ - "ARN": {"target": SECRET_ARN_TYPE}, - "Name": {"target": SECRET_NAME_TYPE}, - "Type": {"target": MEDEA_TYPE_TYPE}, - "Description": {"target": DESCRIPTION_TYPE}, - "KmsKeyId": {"target": KMS_KEY_ID_TYPE}, - "RotationEnabled": { - "target": ROTATION_ENABLED_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=None)], - }, - "RotationLambdaARN": {"target": ROTATION_LAMBDA_ARN_TYPE}, - "RotationRules": {"target": ROTATION_RULES_TYPE}, - "ExternalSecretRotationMetadata": { - "target": EXTERNAL_SECRET_ROTATION_METADATA_TYPE - }, - "ExternalSecretRotationRoleArn": {"target": ROLE_ARN_TYPE}, - "LastRotatedDate": {"target": LAST_ROTATED_DATE_TYPE}, - "LastChangedDate": {"target": LAST_CHANGED_DATE_TYPE}, - "LastAccessedDate": {"target": LAST_ACCESSED_DATE_TYPE}, - "DeletedDate": {"target": DELETED_DATE_TYPE}, - "NextRotationDate": {"target": NEXT_ROTATION_DATE_TYPE}, - "Tags": {"target": TAG_LIST_TYPE}, - "SecretVersionsToStages": {"target": SECRET_VERSIONS_TO_STAGES_MAP_TYPE}, - "OwningService": {"target": OWNING_SERVICE_TYPE}, - "CreatedDate": {"target": TIMESTAMP_TYPE}, - "PrimaryRegion": {"target": REGION_TYPE}, - }, +LIST_SECRET_VERSION_IDS_INPUT: StaticSchema = ( + 18, + n0, + _LSVII, + {_sSI: _cLSVIR, _s: None}, + (_SI, _MR, _NT, _ID), + ( + (SECRET_ID_TYPE, 1), + (MAX_RESULTS_TYPE, 0), + (NEXT_TOKEN_TYPE, 0), + (BOOLEAN_TYPE, {_smith: None}), + ), ) -SECRET_LIST_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#SecretListType"), - shape_type=ShapeType.LIST, - members={"member": {"target": SECRET_LIST_ENTRY}}, +SECRET_VERSIONS_LIST_ENTRY: StaticSchema = ( + 18, + n0, + _SVLE, + 0, + (_VI, _VS, _LAD, _CD, _KKIm), + ( + (SECRET_VERSION_ID_TYPE, 0), + (SECRET_VERSION_STAGES_TYPE, 0), + (LAST_ACCESSED_DATE_TYPE, 0), + (CREATED_DATE_TYPE, 0), + (KMS_KEY_ID_LIST_TYPE, 0), + ), ) -LIST_SECRETS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#ListSecretsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.secretsmanager#ListSecretsResponse", - ) - ], - members={ - "SecretList": {"target": SECRET_LIST_TYPE}, - "NextToken": {"target": NEXT_TOKEN_TYPE}, - }, +SECRET_VERSIONS_LIST_TYPE: StaticSchema = ( + 16, + n0, + _SVLT, + 0, + (_m,), + ((SECRET_VERSIONS_LIST_ENTRY, 0),), +) + +LIST_SECRET_VERSION_IDS_OUTPUT: StaticSchema = ( + 18, + n0, + _LSVIO, + {_sSI: _cLSVIRo, _smi: None}, + (_Ve, _NT, _ARN, _N), + ( + (SECRET_VERSIONS_LIST_TYPE, 0), + (NEXT_TOKEN_TYPE, 0), + (SECRET_ARN_TYPE, 0), + (SECRET_NAME_TYPE, 0), + ), ) -LIST_SECRETS = Schema( - id=ShapeID("com.amazonaws.secretsmanager#ListSecrets"), - shape_type=ShapeType.OPERATION, -) - -LIST_SECRET_VERSION_IDS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#ListSecretVersionIdsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.secretsmanager#ListSecretVersionIdsRequest", - ) - ], - members={ - "SecretId": { - "target": SECRET_ID_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "MaxResults": {"target": MAX_RESULTS_TYPE}, - "NextToken": {"target": NEXT_TOKEN_TYPE}, - "IncludeDeprecated": { - "target": BOOLEAN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=None)], - }, - }, +LIST_SECRET_VERSION_IDS: StaticOperationSchema = ( + 23, + n0, + _LSVI, + 0, + LIST_SECRET_VERSION_IDS_INPUT, + LIST_SECRET_VERSION_IDS_OUTPUT, + ( + INTERNAL_SERVICE_ERROR, + INVALID_NEXT_TOKEN_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + ), ) -SECRET_VERSIONS_LIST_ENTRY = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#SecretVersionsListEntry"), - members={ - "VersionId": {"target": SECRET_VERSION_ID_TYPE}, - "VersionStages": {"target": SECRET_VERSION_STAGES_TYPE}, - "LastAccessedDate": {"target": LAST_ACCESSED_DATE_TYPE}, - "CreatedDate": {"target": CREATED_DATE_TYPE}, - "KmsKeyIds": {"target": KMS_KEY_ID_LIST_TYPE}, - }, +PUBLIC_POLICY_EXCEPTION: StaticSchema = ( + 18, + n0, + _PPE, + {_smit: _c}, + (_M,), + ((ERROR_MESSAGE, 0),), +) + +PUT_RESOURCE_POLICY_INPUT: StaticSchema = ( + 18, + n0, + _PRPI, + {_sSI: _cPRPR, _s: None}, + (_SI, _RPe, _BPP), + ( + (SECRET_ID_TYPE, 1), + (NON_EMPTY_RESOURCE_POLICY_TYPE, 1), + (BOOLEAN_TYPE, {_smith: None}), + ), ) -SECRET_VERSIONS_LIST_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#SecretVersionsListType"), - shape_type=ShapeType.LIST, - members={"member": {"target": SECRET_VERSIONS_LIST_ENTRY}}, -) - -LIST_SECRET_VERSION_IDS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#ListSecretVersionIdsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.secretsmanager#ListSecretVersionIdsResponse", - ) - ], - members={ - "Versions": {"target": SECRET_VERSIONS_LIST_TYPE}, - "NextToken": {"target": NEXT_TOKEN_TYPE}, - "ARN": {"target": SECRET_ARN_TYPE}, - "Name": {"target": SECRET_NAME_TYPE}, - }, +PUT_RESOURCE_POLICY_OUTPUT: StaticSchema = ( + 18, + n0, + _PRPO, + {_sSI: _cPRPRo, _smi: None}, + (_ARN, _N), + ((SECRET_ARN_TYPE, 0), (NAME_TYPE, 0)), +) + +PUT_RESOURCE_POLICY: StaticOperationSchema = ( + 23, + n0, + _PRP, + 0, + PUT_RESOURCE_POLICY_INPUT, + PUT_RESOURCE_POLICY_OUTPUT, + ( + INTERNAL_SERVICE_ERROR, + INVALID_PARAMETER_EXCEPTION, + INVALID_REQUEST_EXCEPTION, + MALFORMED_POLICY_DOCUMENT_EXCEPTION, + PUBLIC_POLICY_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + ), ) -LIST_SECRET_VERSION_IDS = Schema( - id=ShapeID("com.amazonaws.secretsmanager#ListSecretVersionIds"), - shape_type=ShapeType.OPERATION, -) - -PUBLIC_POLICY_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#PublicPolicyException"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], - members={"Message": {"target": ERROR_MESSAGE}}, -) - -PUT_RESOURCE_POLICY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#PutResourcePolicyInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.secretsmanager#PutResourcePolicyRequest", - ) - ], - members={ - "SecretId": { - "target": SECRET_ID_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ResourcePolicy": { - "target": NON_EMPTY_RESOURCE_POLICY_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "BlockPublicPolicy": { - "target": BOOLEAN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=None)], - }, - }, +ROTATION_TOKEN_TYPE: StaticSchema = (3, n0, _RTT, 4) + +PUT_SECRET_VALUE_INPUT: StaticSchema = ( + 18, + n0, + _PSVI, + {_sSI: _cPSVR, _s: None}, + (_SI, _CRT, _SB, _SS, _VS, _RTo), + ( + (SECRET_ID_TYPE, 1), + (CLIENT_REQUEST_TOKEN_TYPE, 2), + (SECRET_BINARY_TYPE, 0), + (SECRET_STRING_TYPE, 0), + (SECRET_VERSION_STAGES_TYPE, 0), + (ROTATION_TOKEN_TYPE, 0), + ), ) -PUT_RESOURCE_POLICY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#PutResourcePolicyOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.secretsmanager#PutResourcePolicyResponse", - ) - ], - members={"ARN": {"target": SECRET_ARN_TYPE}, "Name": {"target": NAME_TYPE}}, -) - -PUT_RESOURCE_POLICY = Schema( - id=ShapeID("com.amazonaws.secretsmanager#PutResourcePolicy"), - shape_type=ShapeType.OPERATION, -) - -ROTATION_TOKEN_TYPE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#RotationTokenType"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -PUT_SECRET_VALUE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#PutSecretValueInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.secretsmanager#PutSecretValueRequest", - ) - ], - members={ - "SecretId": { - "target": SECRET_ID_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ClientRequestToken": { - "target": CLIENT_REQUEST_TOKEN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "SecretBinary": {"target": SECRET_BINARY_TYPE}, - "SecretString": {"target": SECRET_STRING_TYPE}, - "VersionStages": {"target": SECRET_VERSION_STAGES_TYPE}, - "RotationToken": {"target": ROTATION_TOKEN_TYPE}, - }, +PUT_SECRET_VALUE_OUTPUT: StaticSchema = ( + 18, + n0, + _PSVO, + {_sSI: _cPSVRo, _smi: None}, + (_ARN, _N, _VI, _VS), + ( + (SECRET_ARN_TYPE, 0), + (SECRET_NAME_TYPE, 0), + (SECRET_VERSION_ID_TYPE, 0), + (SECRET_VERSION_STAGES_TYPE, 0), + ), ) -PUT_SECRET_VALUE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#PutSecretValueOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.secretsmanager#PutSecretValueResponse", - ) - ], - members={ - "ARN": {"target": SECRET_ARN_TYPE}, - "Name": {"target": SECRET_NAME_TYPE}, - "VersionId": {"target": SECRET_VERSION_ID_TYPE}, - "VersionStages": {"target": SECRET_VERSION_STAGES_TYPE}, - }, +PUT_SECRET_VALUE: StaticOperationSchema = ( + 23, + n0, + _PSV, + 0, + PUT_SECRET_VALUE_INPUT, + PUT_SECRET_VALUE_OUTPUT, + ( + DECRYPTION_FAILURE, + ENCRYPTION_FAILURE, + INTERNAL_SERVICE_ERROR, + INVALID_PARAMETER_EXCEPTION, + INVALID_REQUEST_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + RESOURCE_EXISTS_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + ), ) -PUT_SECRET_VALUE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#PutSecretValue"), - shape_type=ShapeType.OPERATION, -) - -REMOVE_REPLICA_REGION_LIST_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#RemoveReplicaRegionListType"), - shape_type=ShapeType.LIST, - members={"member": {"target": REGION_TYPE}}, -) - -REMOVE_REGIONS_FROM_REPLICATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#RemoveRegionsFromReplicationInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.secretsmanager#RemoveRegionsFromReplicationRequest", - ) - ], - members={ - "SecretId": { - "target": SECRET_ID_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "RemoveReplicaRegions": { - "target": REMOVE_REPLICA_REGION_LIST_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +REMOVE_REPLICA_REGION_LIST_TYPE: StaticSchema = ( + 16, + n0, + _RRRLT, + 0, + (_m,), + ((REGION_TYPE, 0),), +) + +REMOVE_REGIONS_FROM_REPLICATION_INPUT: StaticSchema = ( + 18, + n0, + _RRFRI, + {_sSI: _cRRFRR, _s: None}, + (_SI, _RRR), + ((SECRET_ID_TYPE, 1), (REMOVE_REPLICA_REGION_LIST_TYPE, 1)), +) + +REMOVE_REGIONS_FROM_REPLICATION_OUTPUT: StaticSchema = ( + 18, + n0, + _RRFRO, + {_sSI: _cRRFRRo, _smi: None}, + (_ARN, _RS), + ((SECRET_ARN_TYPE, 0), (REPLICATION_STATUS_LIST_TYPE, 0)), +) + +REMOVE_REGIONS_FROM_REPLICATION: StaticOperationSchema = ( + 23, + n0, + _RRFR, + 0, + REMOVE_REGIONS_FROM_REPLICATION_INPUT, + REMOVE_REGIONS_FROM_REPLICATION_OUTPUT, + ( + INTERNAL_SERVICE_ERROR, + INVALID_PARAMETER_EXCEPTION, + INVALID_REQUEST_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + ), ) -REMOVE_REGIONS_FROM_REPLICATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#RemoveRegionsFromReplicationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.secretsmanager#RemoveRegionsFromReplicationResponse", - ) - ], - members={ - "ARN": {"target": SECRET_ARN_TYPE}, - "ReplicationStatus": {"target": REPLICATION_STATUS_LIST_TYPE}, - }, +REPLICATE_SECRET_TO_REGIONS_INPUT: StaticSchema = ( + 18, + n0, + _RSTRI, + {_sSI: _cRSTRR, _s: None}, + (_SI, _ARR, _FORS), + ( + (SECRET_ID_TYPE, 1), + (ADD_REPLICA_REGION_LIST_TYPE, 1), + (BOOLEAN_TYPE, {_smith: False}), + ), ) -REMOVE_REGIONS_FROM_REPLICATION = Schema( - id=ShapeID("com.amazonaws.secretsmanager#RemoveRegionsFromReplication"), - shape_type=ShapeType.OPERATION, -) - -REPLICATE_SECRET_TO_REGIONS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#ReplicateSecretToRegionsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.secretsmanager#ReplicateSecretToRegionsRequest", - ) - ], - members={ - "SecretId": { - "target": SECRET_ID_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "AddReplicaRegions": { - "target": ADD_REPLICA_REGION_LIST_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ForceOverwriteReplicaSecret": { - "target": BOOLEAN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - }, +REPLICATE_SECRET_TO_REGIONS_OUTPUT: StaticSchema = ( + 18, + n0, + _RSTRO, + {_sSI: _cRSTRRo, _smi: None}, + (_ARN, _RS), + ((SECRET_ARN_TYPE, 0), (REPLICATION_STATUS_LIST_TYPE, 0)), +) + +REPLICATE_SECRET_TO_REGIONS: StaticOperationSchema = ( + 23, + n0, + _RSTR, + 0, + REPLICATE_SECRET_TO_REGIONS_INPUT, + REPLICATE_SECRET_TO_REGIONS_OUTPUT, + ( + INTERNAL_SERVICE_ERROR, + INVALID_PARAMETER_EXCEPTION, + INVALID_REQUEST_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + ), ) -REPLICATE_SECRET_TO_REGIONS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#ReplicateSecretToRegionsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.secretsmanager#ReplicateSecretToRegionsResponse", - ) - ], - members={ - "ARN": {"target": SECRET_ARN_TYPE}, - "ReplicationStatus": {"target": REPLICATION_STATUS_LIST_TYPE}, - }, +RESTORE_SECRET_INPUT: StaticSchema = ( + 18, + n0, + _RSI, + {_sSI: _cRSR, _s: None}, + (_SI,), + ((SECRET_ID_TYPE, 1),), +) + +RESTORE_SECRET_OUTPUT: StaticSchema = ( + 18, + n0, + _RSO, + {_sSI: _cRSRo, _smi: None}, + (_ARN, _N), + ((SECRET_ARN_TYPE, 0), (SECRET_NAME_TYPE, 0)), +) + +RESTORE_SECRET: StaticOperationSchema = ( + 23, + n0, + _RSe, + 0, + RESTORE_SECRET_INPUT, + RESTORE_SECRET_OUTPUT, + ( + INTERNAL_SERVICE_ERROR, + INVALID_PARAMETER_EXCEPTION, + INVALID_REQUEST_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + ), ) -REPLICATE_SECRET_TO_REGIONS = Schema( - id=ShapeID("com.amazonaws.secretsmanager#ReplicateSecretToRegions"), - shape_type=ShapeType.OPERATION, -) - -RESTORE_SECRET_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#RestoreSecretInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.secretsmanager#RestoreSecretRequest", - ) - ], - members={ - "SecretId": { - "target": SECRET_ID_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +ROTATE_SECRET_INPUT: StaticSchema = ( + 18, + n0, + _RSIo, + {_sSI: _cRSRom, _s: None}, + (_SI, _CRT, _RLARN, _RR, _ESRM, _ESRRA, _RI), + ( + (SECRET_ID_TYPE, 1), + (CLIENT_REQUEST_TOKEN_TYPE, 2), + (ROTATION_LAMBDA_ARN_TYPE, 0), + (ROTATION_RULES_TYPE, 0), + (EXTERNAL_SECRET_ROTATION_METADATA_TYPE, 0), + (ROLE_ARN_TYPE, 0), + (BOOLEAN_TYPE, {_smith: None}), + ), ) -RESTORE_SECRET_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#RestoreSecretOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.secretsmanager#RestoreSecretResponse", - ) - ], - members={"ARN": {"target": SECRET_ARN_TYPE}, "Name": {"target": SECRET_NAME_TYPE}}, -) - -RESTORE_SECRET = Schema( - id=ShapeID("com.amazonaws.secretsmanager#RestoreSecret"), - shape_type=ShapeType.OPERATION, -) - -ROTATE_SECRET_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#RotateSecretInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.secretsmanager#RotateSecretRequest", - ) - ], - members={ - "SecretId": { - "target": SECRET_ID_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ClientRequestToken": { - "target": CLIENT_REQUEST_TOKEN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "RotationLambdaARN": {"target": ROTATION_LAMBDA_ARN_TYPE}, - "RotationRules": {"target": ROTATION_RULES_TYPE}, - "ExternalSecretRotationMetadata": { - "target": EXTERNAL_SECRET_ROTATION_METADATA_TYPE - }, - "ExternalSecretRotationRoleArn": {"target": ROLE_ARN_TYPE}, - "RotateImmediately": { - "target": BOOLEAN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=None)], - }, - }, +ROTATE_SECRET_OUTPUT: StaticSchema = ( + 18, + n0, + _RSOo, + {_sSI: _cRSRoma, _smi: None}, + (_ARN, _N, _VI), + ((SECRET_ARN_TYPE, 0), (SECRET_NAME_TYPE, 0), (SECRET_VERSION_ID_TYPE, 0)), +) + +ROTATE_SECRET: StaticOperationSchema = ( + 23, + n0, + _RSo, + 0, + ROTATE_SECRET_INPUT, + ROTATE_SECRET_OUTPUT, + ( + INTERNAL_SERVICE_ERROR, + INVALID_PARAMETER_EXCEPTION, + INVALID_REQUEST_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + ), ) -ROTATE_SECRET_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#RotateSecretOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.secretsmanager#RotateSecretResponse", - ) - ], - members={ - "ARN": {"target": SECRET_ARN_TYPE}, - "Name": {"target": SECRET_NAME_TYPE}, - "VersionId": {"target": SECRET_VERSION_ID_TYPE}, - }, +STOP_REPLICATION_TO_REPLICA_INPUT: StaticSchema = ( + 18, + n0, + _SRTRI, + {_sSI: _cSRTRR, _s: None}, + (_SI,), + ((SECRET_ID_TYPE, 1),), +) + +STOP_REPLICATION_TO_REPLICA_OUTPUT: StaticSchema = ( + 18, + n0, + _SRTRO, + {_sSI: _cSRTRRo, _smi: None}, + (_ARN,), + ((SECRET_ARN_TYPE, 0),), +) + +STOP_REPLICATION_TO_REPLICA: StaticOperationSchema = ( + 23, + n0, + _SRTR, + 0, + STOP_REPLICATION_TO_REPLICA_INPUT, + STOP_REPLICATION_TO_REPLICA_OUTPUT, + ( + INTERNAL_SERVICE_ERROR, + INVALID_PARAMETER_EXCEPTION, + INVALID_REQUEST_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + ), ) -ROTATE_SECRET = Schema( - id=ShapeID("com.amazonaws.secretsmanager#RotateSecret"), - shape_type=ShapeType.OPERATION, -) - -STOP_REPLICATION_TO_REPLICA_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#StopReplicationToReplicaInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.secretsmanager#StopReplicationToReplicaRequest", - ) - ], - members={ - "SecretId": { - "target": SECRET_ID_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +TAG_RESOURCE_INPUT: StaticSchema = ( + 18, + n0, + _TRI, + {_sSI: _cTRR, _s: None}, + (_SI, _Ta), + ((SECRET_ID_TYPE, 1), (TAG_LIST_TYPE, 1)), +) + +TAG_RESOURCE_OUTPUT: StaticSchema = (18, n0, _TRO, {_sSI: _sU, _smi: None}) + +TAG_RESOURCE: StaticOperationSchema = ( + 23, + n0, + _TR, + 0, + TAG_RESOURCE_INPUT, + TAG_RESOURCE_OUTPUT, + ( + INTERNAL_SERVICE_ERROR, + INVALID_PARAMETER_EXCEPTION, + INVALID_REQUEST_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + ), ) -STOP_REPLICATION_TO_REPLICA_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#StopReplicationToReplicaOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.secretsmanager#StopReplicationToReplicaResponse", - ) - ], - members={"ARN": {"target": SECRET_ARN_TYPE}}, -) - -STOP_REPLICATION_TO_REPLICA = Schema( - id=ShapeID("com.amazonaws.secretsmanager#StopReplicationToReplica"), - shape_type=ShapeType.OPERATION, -) - -TAG_RESOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#TagResourceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.secretsmanager#TagResourceRequest", - ) - ], - members={ - "SecretId": { - "target": SECRET_ID_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Tags": { - "target": TAG_LIST_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +TAG_KEY_LIST_TYPE: StaticSchema = (16, n0, _TKLT, 0, (_m,), ((TAG_KEY_TYPE, 0),)) -TAG_RESOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#TagResourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -TAG_RESOURCE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#TagResource"), - shape_type=ShapeType.OPERATION, -) - -TAG_KEY_LIST_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#TagKeyListType"), - shape_type=ShapeType.LIST, - members={"member": {"target": TAG_KEY_TYPE}}, -) - -UNTAG_RESOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#UntagResourceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.secretsmanager#UntagResourceRequest", - ) - ], - members={ - "SecretId": { - "target": SECRET_ID_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "TagKeys": { - "target": TAG_KEY_LIST_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +UNTAG_RESOURCE_INPUT: StaticSchema = ( + 18, + n0, + _URI, + {_sSI: _cURR, _s: None}, + (_SI, _TK), + ((SECRET_ID_TYPE, 1), (TAG_KEY_LIST_TYPE, 1)), ) -UNTAG_RESOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#UntagResourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -UNTAG_RESOURCE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#UntagResource"), - shape_type=ShapeType.OPERATION, -) - -UPDATE_SECRET_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#UpdateSecretInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.secretsmanager#UpdateSecretRequest", - ) - ], - members={ - "SecretId": { - "target": SECRET_ID_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ClientRequestToken": { - "target": CLIENT_REQUEST_TOKEN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - "Description": {"target": DESCRIPTION_TYPE}, - "KmsKeyId": {"target": KMS_KEY_ID_TYPE}, - "SecretBinary": {"target": SECRET_BINARY_TYPE}, - "SecretString": {"target": SECRET_STRING_TYPE}, - "Type": {"target": MEDEA_TYPE_TYPE}, - }, -) +UNTAG_RESOURCE_OUTPUT: StaticSchema = (18, n0, _URO, {_sSI: _sU, _smi: None}) -UPDATE_SECRET_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#UpdateSecretOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.secretsmanager#UpdateSecretResponse", - ) - ], - members={ - "ARN": {"target": SECRET_ARN_TYPE}, - "Name": {"target": SECRET_NAME_TYPE}, - "VersionId": {"target": SECRET_VERSION_ID_TYPE}, - }, +UNTAG_RESOURCE: StaticOperationSchema = ( + 23, + n0, + _UR, + 0, + UNTAG_RESOURCE_INPUT, + UNTAG_RESOURCE_OUTPUT, + ( + INTERNAL_SERVICE_ERROR, + INVALID_PARAMETER_EXCEPTION, + INVALID_REQUEST_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + ), ) -UPDATE_SECRET = Schema( - id=ShapeID("com.amazonaws.secretsmanager#UpdateSecret"), - shape_type=ShapeType.OPERATION, -) - -UPDATE_SECRET_VERSION_STAGE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#UpdateSecretVersionStageInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.secretsmanager#UpdateSecretVersionStageRequest", - ) - ], - members={ - "SecretId": { - "target": SECRET_ID_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "VersionStage": { - "target": SECRET_VERSION_STAGE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "RemoveFromVersionId": {"target": SECRET_VERSION_ID_TYPE}, - "MoveToVersionId": {"target": SECRET_VERSION_ID_TYPE}, - }, +UPDATE_SECRET_INPUT: StaticSchema = ( + 18, + n0, + _USI, + {_sSI: _cUSR, _s: None}, + (_SI, _CRT, _D, _KKI, _SB, _SS, _Ty), + ( + (SECRET_ID_TYPE, 1), + (CLIENT_REQUEST_TOKEN_TYPE, 2), + (DESCRIPTION_TYPE, 0), + (KMS_KEY_ID_TYPE, 0), + (SECRET_BINARY_TYPE, 0), + (SECRET_STRING_TYPE, 0), + (MEDEA_TYPE_TYPE, 0), + ), ) -UPDATE_SECRET_VERSION_STAGE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#UpdateSecretVersionStageOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.secretsmanager#UpdateSecretVersionStageResponse", - ) - ], - members={"ARN": {"target": SECRET_ARN_TYPE}, "Name": {"target": SECRET_NAME_TYPE}}, -) - -UPDATE_SECRET_VERSION_STAGE = Schema( - id=ShapeID("com.amazonaws.secretsmanager#UpdateSecretVersionStage"), - shape_type=ShapeType.OPERATION, -) - -VALIDATE_RESOURCE_POLICY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#ValidateResourcePolicyInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.secretsmanager#ValidateResourcePolicyRequest", - ) - ], - members={ - "SecretId": {"target": SECRET_ID_TYPE}, - "ResourcePolicy": { - "target": NON_EMPTY_RESOURCE_POLICY_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +UPDATE_SECRET_OUTPUT: StaticSchema = ( + 18, + n0, + _USO, + {_sSI: _cUSRo, _smi: None}, + (_ARN, _N, _VI), + ((SECRET_ARN_TYPE, 0), (SECRET_NAME_TYPE, 0), (SECRET_VERSION_ID_TYPE, 0)), +) + +UPDATE_SECRET: StaticOperationSchema = ( + 23, + n0, + _US, + 0, + UPDATE_SECRET_INPUT, + UPDATE_SECRET_OUTPUT, + ( + DECRYPTION_FAILURE, + ENCRYPTION_FAILURE, + INTERNAL_SERVICE_ERROR, + INVALID_PARAMETER_EXCEPTION, + INVALID_REQUEST_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + MALFORMED_POLICY_DOCUMENT_EXCEPTION, + PRECONDITION_NOT_MET_EXCEPTION, + RESOURCE_EXISTS_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + ), ) -VALIDATION_ERRORS_ENTRY = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#ValidationErrorsEntry"), - members={ - "CheckName": {"target": NAME_TYPE}, - "ErrorMessage": {"target": ERROR_MESSAGE}, - }, +UPDATE_SECRET_VERSION_STAGE_INPUT: StaticSchema = ( + 18, + n0, + _USVSI, + {_sSI: _cUSVSR, _s: None}, + (_SI, _VSe, _RFVI, _MTVI), + ( + (SECRET_ID_TYPE, 1), + (SECRET_VERSION_STAGE_TYPE, 1), + (SECRET_VERSION_ID_TYPE, 0), + (SECRET_VERSION_ID_TYPE, 0), + ), ) -VALIDATION_ERRORS_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#ValidationErrorsType"), - shape_type=ShapeType.LIST, - members={"member": {"target": VALIDATION_ERRORS_ENTRY}}, -) - -VALIDATE_RESOURCE_POLICY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.secretsmanager#ValidateResourcePolicyOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.secretsmanager#ValidateResourcePolicyResponse", - ) - ], - members={ - "PolicyValidationPassed": { - "target": BOOLEAN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "ValidationErrors": {"target": VALIDATION_ERRORS_TYPE}, - }, +UPDATE_SECRET_VERSION_STAGE_OUTPUT: StaticSchema = ( + 18, + n0, + _USVSO, + {_sSI: _cUSVSRo, _smi: None}, + (_ARN, _N), + ((SECRET_ARN_TYPE, 0), (SECRET_NAME_TYPE, 0)), +) + +UPDATE_SECRET_VERSION_STAGE: StaticOperationSchema = ( + 23, + n0, + _USVS, + 0, + UPDATE_SECRET_VERSION_STAGE_INPUT, + UPDATE_SECRET_VERSION_STAGE_OUTPUT, + ( + INTERNAL_SERVICE_ERROR, + INVALID_PARAMETER_EXCEPTION, + INVALID_REQUEST_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + ), ) -VALIDATE_RESOURCE_POLICY = Schema( - id=ShapeID("com.amazonaws.secretsmanager#ValidateResourcePolicy"), - shape_type=ShapeType.OPERATION, +VALIDATE_RESOURCE_POLICY_INPUT: StaticSchema = ( + 18, + n0, + _VRPI, + {_sSI: _cVRPR, _s: None}, + (_SI, _RPe), + ((SECRET_ID_TYPE, 0), (NON_EMPTY_RESOURCE_POLICY_TYPE, 1)), +) + +VALIDATION_ERRORS_ENTRY: StaticSchema = ( + 18, + n0, + _VEE, + 0, + (_CN, _EM), + ((NAME_TYPE, 0), (ERROR_MESSAGE, 0)), +) + +VALIDATION_ERRORS_TYPE: StaticSchema = ( + 16, + n0, + _VET, + 0, + (_m,), + ((VALIDATION_ERRORS_ENTRY, 0),), +) + +VALIDATE_RESOURCE_POLICY_OUTPUT: StaticSchema = ( + 18, + n0, + _VRPO, + {_sSI: _cVRPRo, _smi: None}, + (_PVP, _VE), + ((BOOLEAN_TYPE, {_smith: False}), (VALIDATION_ERRORS_TYPE, 0)), +) + +VALIDATE_RESOURCE_POLICY: StaticOperationSchema = ( + 23, + n0, + _VRP, + 0, + VALIDATE_RESOURCE_POLICY_INPUT, + VALIDATE_RESOURCE_POLICY_OUTPUT, + ( + INTERNAL_SERVICE_ERROR, + INVALID_PARAMETER_EXCEPTION, + INVALID_REQUEST_EXCEPTION, + MALFORMED_POLICY_DOCUMENT_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + ), ) -SECRETSMANAGER = Schema( - id=ShapeID("com.amazonaws.secretsmanager#secretsmanager"), - shape_type=ShapeType.SERVICE, - traits=[ - Trait.new( - id=ShapeID("aws.auth#sigv4"), - value=MappingProxyType({"name": "secretsmanager"}), - ), - Trait.new(id=ShapeID("aws.protocols#awsJson1_1")), - Trait.new( - id=ShapeID("smithy.rules#endpointBdd"), - value=MappingProxyType( - { - "version": "1.1", - "parameters": MappingProxyType( - { - "Region": MappingProxyType( - { - "builtIn": "AWS::Region", - "required": False, - "documentation": "The AWS region used to dispatch the request.", - "type": "string", - } - ), - "UseDualStack": MappingProxyType( - { - "builtIn": "AWS::UseDualStack", - "required": True, - "default": False, - "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", - "type": "boolean", - } - ), - "UseFIPS": MappingProxyType( - { - "builtIn": "AWS::UseFIPS", - "required": True, - "default": False, - "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", - "type": "boolean", - } - ), - "Endpoint": MappingProxyType( - { - "builtIn": "SDK::Endpoint", - "required": False, - "documentation": "Override the endpoint used to send this request", - "type": "string", - } - ), - } - ), - "conditions": ( - MappingProxyType( +SECRETSMANAGER: StaticSchema = ( + 21, + n0, + _sec, + { + _aw: MappingProxyType({"name": "secretsmanager"}), + _a_: None, + _sB: MappingProxyType( + { + "version": "1.1", + "parameters": MappingProxyType( + { + "Region": MappingProxyType( { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "Endpoint"}),), + "builtIn": "AWS::Region", + "required": False, + "documentation": "The AWS region used to dispatch the request.", + "type": "string", } ), - MappingProxyType( + "UseDualStack": MappingProxyType( { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "Region"}),), + "builtIn": "AWS::UseDualStack", + "required": True, + "default": False, + "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", + "type": "boolean", } ), - MappingProxyType( + "UseFIPS": MappingProxyType( { - "fn": "aws.partition", - "argv": (MappingProxyType({"ref": "Region"}),), - "assign": "PartitionResult", + "builtIn": "AWS::UseFIPS", + "required": True, + "default": False, + "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", + "type": "boolean", } ), - MappingProxyType( + "Endpoint": MappingProxyType( { - "fn": "booleanEquals", - "argv": (MappingProxyType({"ref": "UseFIPS"}), True), - } - ), - MappingProxyType( - { - "fn": "booleanEquals", - "argv": ( - MappingProxyType({"ref": "UseDualStack"}), - True, - ), - } - ), - MappingProxyType( - { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "supportsDualStack", - ), - } - ), - True, - ), - } - ), - MappingProxyType( - { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "supportsFIPS", - ), - } - ), - True, - ), - } - ), - MappingProxyType( - { - "fn": "stringEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "name", - ), - } - ), - "aws", - ), - } - ), - MappingProxyType( - { - "fn": "stringEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "name", - ), - } - ), - "aws-cn", - ), - } - ), - MappingProxyType( - { - "fn": "stringEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "name", - ), - } - ), - "aws-us-gov", - ), + "builtIn": "SDK::Endpoint", + "required": False, + "documentation": "Override the endpoint used to send this request", + "type": "string", } ), + } + ), + "conditions": ( + MappingProxyType( + { + "fn": "isSet", + "argv": (MappingProxyType({"ref": "Endpoint"}),), + } ), - "results": ( - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: FIPS and custom endpoint are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": MappingProxyType({"ref": "Endpoint"}), - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://secretsmanager-fips.{Region}.amazonaws.com", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://secretsmanager-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "FIPS and DualStack are enabled, but this partition does not support one or both", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + MappingProxyType( + {"fn": "isSet", "argv": (MappingProxyType({"ref": "Region"}),)} + ), + MappingProxyType( + { + "fn": "aws.partition", + "argv": (MappingProxyType({"ref": "Region"}),), + "assign": "PartitionResult", + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": (MappingProxyType({"ref": "UseFIPS"}), True), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": (MappingProxyType({"ref": "UseDualStack"}), True), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( { - "url": "https://secretsmanager-fips.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "supportsDualStack", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "FIPS is enabled but this partition does not support FIPS", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + True, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( { - "url": "https://secretsmanager.{Region}.amazonaws.com", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "supportsFIPS", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + True, + ), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( { - "url": "https://secretsmanager.{Region}.amazonaws.com.cn", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "name", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + "aws", + ), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( { - "url": "https://secretsmanager.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "name", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "DualStack is enabled but this partition does not support DualStack", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + "aws-cn", + ), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( { - "url": "https://secretsmanager.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "name", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: Missing Region", - "type": "error", - } - ), + "aws-us-gov", + ), + } + ), + ), + "results": ( + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: FIPS and custom endpoint are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": MappingProxyType({"ref": "Endpoint"}), + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://secretsmanager-fips.{Region}.amazonaws.com", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://secretsmanager-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS and DualStack are enabled, but this partition does not support one or both", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://secretsmanager-fips.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS is enabled but this partition does not support FIPS", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://secretsmanager.{Region}.amazonaws.com", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://secretsmanager.{Region}.amazonaws.com.cn", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://secretsmanager.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "DualStack is enabled but this partition does not support DualStack", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://secretsmanager.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Missing Region", + "type": "error", + } ), - "root": 2, - "nodeCount": 18, - "nodes": "/////wAAAAH/////AAAAAAAAABEAAAADAAAAAQAAAAQF9eEOAAAAAgAAAAUF9eEOAAAAAwAAAAsAAAAGAAAABAAAAAcF9eENAAAABQAAAAgF9eEMAAAABwX14QkAAAAJAAAACAX14QoAAAAKAAAACQX14QkF9eELAAAABAAAAA0AAAAMAAAABgX14QcF9eEIAAAABQAAAA4F9eEGAAAABgAAAA8F9eEGAAAABwX14QQAAAAQAAAACQX14QQF9eEFAAAAAwX14QEAAAASAAAABAX14QIF9eED", - } - ), + ), + "root": 2, + "nodeCount": 18, + "nodes": "/////wAAAAH/////AAAAAAAAABEAAAADAAAAAQAAAAQF9eEOAAAAAgAAAAUF9eEOAAAAAwAAAAsAAAAGAAAABAAAAAcF9eENAAAABQAAAAgF9eEMAAAABwX14QkAAAAJAAAACAX14QoAAAAKAAAACQX14QkF9eELAAAABAAAAA0AAAAMAAAABgX14QcF9eEIAAAABQAAAA4F9eEGAAAABgAAAA8F9eEGAAAABwX14QQAAAAQAAAACQX14QQF9eEFAAAAAwX14QEAAAASAAAABAX14QIF9eED", + } ), - Trait.new( - id=ShapeID("aws.api#service"), - value=MappingProxyType( - { - "sdkId": "Secrets Manager", - "arnNamespace": "secretsmanager", - "cloudFormationName": "SecretsManager", - "cloudTrailEventSource": "secretsmanager.amazonaws.com", - "docId": "secretsmanager-2017-10-17", - "endpointPrefix": "secretsmanager", - } - ), + _aws: MappingProxyType( + { + "sdkId": "Secrets Manager", + "arnNamespace": "secretsmanager", + "cloudFormationName": "SecretsManager", + "cloudTrailEventSource": "secretsmanager.amazonaws.com", + "docId": "secretsmanager-2017-10-17", + "endpointPrefix": "secretsmanager", + } ), - ], + }, ) diff --git a/clients/aws-sdk-secrets-manager/src/aws_sdk_secrets_manager/client.py b/clients/aws-sdk-secrets-manager/src/aws_sdk_secrets_manager/client.py index 79d0d270..494e8235 100644 --- a/clients/aws-sdk-secrets-manager/src/aws_sdk_secrets_manager/client.py +++ b/clients/aws-sdk-secrets-manager/src/aws_sdk_secrets_manager/client.py @@ -1,94 +1,102 @@ # Code generated by smithy-python-codegen DO NOT EDIT. +from __future__ import annotations + from copy import deepcopy import logging from typing import Any, cast +from smithy_aws_core.aio.identity.chain import AsyncIdentityChain from smithy_aws_core.config import ConfigSource from smithy_aws_core.identity import AWSCredentialsIdentity -from smithy_aws_core.identity.chain import IdentityChain -from smithy_core.aio.client import AsyncClient, ClientCall, RequestPipeline +from smithy_core.aio.client import AsyncClient, AsyncClientCall, AsyncRequestPipeline from smithy_core.deserializers import DeserializeableShape from smithy_core.exceptions import ExpectationNotMetError from smithy_core.schemas import APIOperation from smithy_core.serializers import SerializeableShape -from smithy_http.aio.interfaces import HTTPClient +from smithy_http.aio.interfaces import AsyncHTTPClient from smithy_http.plugins import user_agent_plugin from .config import AsyncSecretsManagerConfig, Plugin from .models import ( BATCH_GET_SECRET_VALUE, - BatchGetSecretValueInput, - BatchGetSecretValueOutput, CANCEL_ROTATE_SECRET, CREATE_SECRET, - CancelRotateSecretInput, - CancelRotateSecretOutput, - CreateSecretInput, - CreateSecretOutput, DELETE_RESOURCE_POLICY, DELETE_SECRET, DESCRIBE_SECRET, - DeleteResourcePolicyInput, - DeleteResourcePolicyOutput, - DeleteSecretInput, - DeleteSecretOutput, - DescribeSecretInput, - DescribeSecretOutput, GET_RANDOM_PASSWORD, GET_RESOURCE_POLICY, GET_SECRET_VALUE, - GetRandomPasswordInput, - GetRandomPasswordOutput, - GetResourcePolicyInput, - GetResourcePolicyOutput, - GetSecretValueInput, - GetSecretValueOutput, LIST_SECRETS, LIST_SECRET_VERSION_IDS, - ListSecretVersionIdsInput, - ListSecretVersionIdsOutput, - ListSecretsInput, - ListSecretsOutput, PUT_RESOURCE_POLICY, PUT_SECRET_VALUE, - PutResourcePolicyInput, - PutResourcePolicyOutput, - PutSecretValueInput, - PutSecretValueOutput, REMOVE_REGIONS_FROM_REPLICATION, REPLICATE_SECRET_TO_REGIONS, RESTORE_SECRET, ROTATE_SECRET, - RemoveRegionsFromReplicationInput, - RemoveRegionsFromReplicationOutput, - ReplicateSecretToRegionsInput, - ReplicateSecretToRegionsOutput, - RestoreSecretInput, - RestoreSecretOutput, - RotateSecretInput, - RotateSecretOutput, STOP_REPLICATION_TO_REPLICA, - StopReplicationToReplicaInput, - StopReplicationToReplicaOutput, TAG_RESOURCE, - TagResourceInput, - TagResourceOutput, UNTAG_RESOURCE, UPDATE_SECRET, UPDATE_SECRET_VERSION_STAGE, - UntagResourceInput, - UntagResourceOutput, - UpdateSecretInput, - UpdateSecretOutput, - UpdateSecretVersionStageInput, - UpdateSecretVersionStageOutput, VALIDATE_RESOURCE_POLICY, - ValidateResourcePolicyInput, - ValidateResourcePolicyOutput, ) from .user_agent import aws_user_agent_plugin +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .models import ( + BatchGetSecretValueInput, + BatchGetSecretValueOutput, + CancelRotateSecretInput, + CancelRotateSecretOutput, + CreateSecretInput, + CreateSecretOutput, + DeleteResourcePolicyInput, + DeleteResourcePolicyOutput, + DeleteSecretInput, + DeleteSecretOutput, + DescribeSecretInput, + DescribeSecretOutput, + GetRandomPasswordInput, + GetRandomPasswordOutput, + GetResourcePolicyInput, + GetResourcePolicyOutput, + GetSecretValueInput, + GetSecretValueOutput, + ListSecretVersionIdsInput, + ListSecretVersionIdsOutput, + ListSecretsInput, + ListSecretsOutput, + PutResourcePolicyInput, + PutResourcePolicyOutput, + PutSecretValueInput, + PutSecretValueOutput, + RemoveRegionsFromReplicationInput, + RemoveRegionsFromReplicationOutput, + ReplicateSecretToRegionsInput, + ReplicateSecretToRegionsOutput, + RestoreSecretInput, + RestoreSecretOutput, + RotateSecretInput, + RotateSecretOutput, + StopReplicationToReplicaInput, + StopReplicationToReplicaOutput, + TagResourceInput, + TagResourceOutput, + UntagResourceInput, + UntagResourceOutput, + UpdateSecretInput, + UpdateSecretOutput, + UpdateSecretVersionStageInput, + UpdateSecretVersionStageOutput, + ValidateResourcePolicyInput, + ValidateResourcePolicyOutput, + ) + logger = logging.getLogger(__name__) @@ -196,12 +204,12 @@ async def _post_setup(self, config: AsyncSecretsManagerConfig) -> None: config_file = await config_context.parsed_profiles() if config_context.profile_source is ConfigSource.OVERRIDE: profile_name = config_context.profile_name - config.aws_credentials_identity_resolver = await IdentityChain.create( + config.aws_credentials_identity_resolver = await AsyncIdentityChain.create( AWSCredentialsIdentity, config_file=config_file, profile_name=profile_name, region_override=config.region, - http_client=cast(HTTPClient | None, config.transport), + http_client=cast(AsyncHTTPClient | None, config.transport), ) async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( @@ -210,7 +218,7 @@ async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( operation: APIOperation[I, O], default_plugins: list[Plugin], plugins: list[Plugin] | None, - ) -> tuple[RequestPipeline[Any, Any], ClientCall[I, O]]: + ) -> tuple[AsyncRequestPipeline[Any, Any], AsyncClientCall[I, O]]: if self._closed: raise RuntimeError( "Cannot invoke an operation on a client that has been closed." diff --git a/clients/aws-sdk-secrets-manager/src/aws_sdk_secrets_manager/config.py b/clients/aws-sdk-secrets-manager/src/aws_sdk_secrets_manager/config.py index 03e88bff..eb1ae224 100644 --- a/clients/aws-sdk-secrets-manager/src/aws_sdk_secrets_manager/config.py +++ b/clients/aws-sdk-secrets-manager/src/aws_sdk_secrets_manager/config.py @@ -1,126 +1,146 @@ # Code generated by smithy-python-codegen DO NOT EDIT. from dataclasses import dataclass, field -from typing import Any, Callable, ClassVar, Self, TypeAlias, Union, Unpack +from typing import ( + Any, + Callable, + ClassVar, + Self, + TYPE_CHECKING, + TypeAlias, + Union, + Unpack, +) -from smithy_aws_core.aio.protocols import AwsJson11ClientProtocol -from smithy_aws_core.auth import SigV4AuthScheme -from smithy_aws_core.config import AwsConfigOverrides, FileSystem -from smithy_aws_core.config.aws_config import AsyncAwsConfig -from smithy_aws_core.config.resolvers import EndpointUriResolver -from smithy_aws_core.config.types import FieldSpec -from smithy_aws_core.endpoints.standard_regional import ( - StandardRegionalEndpointsResolver, +from smithy_aws_core.aio.auth.sigv4 import AsyncSigV4AuthScheme +from smithy_aws_core.aio.config import AsyncFileSystem +from smithy_aws_core.aio.config.aws_config import AsyncAwsConfig, AwsConfigOverrides +from smithy_aws_core.aio.config.resolvers import EndpointUriResolver +from smithy_aws_core.aio.endpoints.standard_regional import ( + AsyncStandardRegionalEndpointsResolver, ) +from smithy_aws_core.aio.protocols import AsyncAwsJson11ClientProtocol +from smithy_aws_core.config.types import FieldSpec from smithy_aws_core.identity import AWSCredentialsIdentity, AWSIdentityProperties -from smithy_core.aio.interfaces import ( - ClientProtocol, - EndpointResolver, - ProtocolConstructor, - ProtocolSettings, -) -from smithy_core.aio.interfaces.auth import AuthScheme -from smithy_core.aio.interfaces.identity import IdentityResolver -from smithy_core.interceptors import Interceptor +from smithy_core.aio.interfaces import AsyncClientProtocol, AsyncEndpointResolver +from smithy_core.aio.interfaces.auth import AsyncAuthScheme +from smithy_core.aio.interfaces.identity import AsyncIdentityResolver +from smithy_core.interfaces import ProtocolConstructor, ProtocolSettings from smithy_core.interfaces.auth import AuthSchemeResolver from smithy_core.shapes import ShapeID from smithy_http.aio.aiohttp import AIOHTTPClient +from ._private.schemas import SECRETSMANAGER from .auth import HTTPAuthSchemeResolver -from .models import ( - BatchGetSecretValueInput, - BatchGetSecretValueOutput, - CancelRotateSecretInput, - CancelRotateSecretOutput, - CreateSecretInput, - CreateSecretOutput, - DeleteResourcePolicyInput, - DeleteResourcePolicyOutput, - DeleteSecretInput, - DeleteSecretOutput, - DescribeSecretInput, - DescribeSecretOutput, - GetRandomPasswordInput, - GetRandomPasswordOutput, - GetResourcePolicyInput, - GetResourcePolicyOutput, - GetSecretValueInput, - GetSecretValueOutput, - ListSecretVersionIdsInput, - ListSecretVersionIdsOutput, - ListSecretsInput, - ListSecretsOutput, - PutResourcePolicyInput, - PutResourcePolicyOutput, - PutSecretValueInput, - PutSecretValueOutput, - RemoveRegionsFromReplicationInput, - RemoveRegionsFromReplicationOutput, - ReplicateSecretToRegionsInput, - ReplicateSecretToRegionsOutput, - RestoreSecretInput, - RestoreSecretOutput, - RotateSecretInput, - RotateSecretOutput, - StopReplicationToReplicaInput, - StopReplicationToReplicaOutput, - TagResourceInput, - TagResourceOutput, - UntagResourceInput, - UntagResourceOutput, - UpdateSecretInput, - UpdateSecretOutput, - UpdateSecretVersionStageInput, - UpdateSecretVersionStageOutput, - ValidateResourcePolicyInput, - ValidateResourcePolicyOutput, -) -_ServiceInterceptor = Union[ - Interceptor[BatchGetSecretValueInput, BatchGetSecretValueOutput, Any, Any], - Interceptor[CancelRotateSecretInput, CancelRotateSecretOutput, Any, Any], - Interceptor[CreateSecretInput, CreateSecretOutput, Any, Any], - Interceptor[DeleteResourcePolicyInput, DeleteResourcePolicyOutput, Any, Any], - Interceptor[DeleteSecretInput, DeleteSecretOutput, Any, Any], - Interceptor[DescribeSecretInput, DescribeSecretOutput, Any, Any], - Interceptor[GetRandomPasswordInput, GetRandomPasswordOutput, Any, Any], - Interceptor[GetResourcePolicyInput, GetResourcePolicyOutput, Any, Any], - Interceptor[GetSecretValueInput, GetSecretValueOutput, Any, Any], - Interceptor[ListSecretsInput, ListSecretsOutput, Any, Any], - Interceptor[ListSecretVersionIdsInput, ListSecretVersionIdsOutput, Any, Any], - Interceptor[PutResourcePolicyInput, PutResourcePolicyOutput, Any, Any], - Interceptor[PutSecretValueInput, PutSecretValueOutput, Any, Any], - Interceptor[ - RemoveRegionsFromReplicationInput, RemoveRegionsFromReplicationOutput, Any, Any - ], - Interceptor[ - ReplicateSecretToRegionsInput, ReplicateSecretToRegionsOutput, Any, Any - ], - Interceptor[RestoreSecretInput, RestoreSecretOutput, Any, Any], - Interceptor[RotateSecretInput, RotateSecretOutput, Any, Any], - Interceptor[ - StopReplicationToReplicaInput, StopReplicationToReplicaOutput, Any, Any - ], - Interceptor[TagResourceInput, TagResourceOutput, Any, Any], - Interceptor[UntagResourceInput, UntagResourceOutput, Any, Any], - Interceptor[UpdateSecretInput, UpdateSecretOutput, Any, Any], - Interceptor[ - UpdateSecretVersionStageInput, UpdateSecretVersionStageOutput, Any, Any - ], - Interceptor[ValidateResourcePolicyInput, ValidateResourcePolicyOutput, Any, Any], -] +if TYPE_CHECKING: + from smithy_core.interceptors import Interceptor + from .models import ( + BatchGetSecretValueInput, + BatchGetSecretValueOutput, + CancelRotateSecretInput, + CancelRotateSecretOutput, + CreateSecretInput, + CreateSecretOutput, + DeleteResourcePolicyInput, + DeleteResourcePolicyOutput, + DeleteSecretInput, + DeleteSecretOutput, + DescribeSecretInput, + DescribeSecretOutput, + GetRandomPasswordInput, + GetRandomPasswordOutput, + GetResourcePolicyInput, + GetResourcePolicyOutput, + GetSecretValueInput, + GetSecretValueOutput, + ListSecretVersionIdsInput, + ListSecretVersionIdsOutput, + ListSecretsInput, + ListSecretsOutput, + PutResourcePolicyInput, + PutResourcePolicyOutput, + PutSecretValueInput, + PutSecretValueOutput, + RemoveRegionsFromReplicationInput, + RemoveRegionsFromReplicationOutput, + ReplicateSecretToRegionsInput, + ReplicateSecretToRegionsOutput, + RestoreSecretInput, + RestoreSecretOutput, + RotateSecretInput, + RotateSecretOutput, + StopReplicationToReplicaInput, + StopReplicationToReplicaOutput, + TagResourceInput, + TagResourceOutput, + UntagResourceInput, + UntagResourceOutput, + UpdateSecretInput, + UpdateSecretOutput, + UpdateSecretVersionStageInput, + UpdateSecretVersionStageOutput, + ValidateResourcePolicyInput, + ValidateResourcePolicyOutput, + ) + + _ServiceInterceptor = Union[ + Interceptor[BatchGetSecretValueInput, BatchGetSecretValueOutput, Any, Any], + Interceptor[CancelRotateSecretInput, CancelRotateSecretOutput, Any, Any], + Interceptor[CreateSecretInput, CreateSecretOutput, Any, Any], + Interceptor[DeleteResourcePolicyInput, DeleteResourcePolicyOutput, Any, Any], + Interceptor[DeleteSecretInput, DeleteSecretOutput, Any, Any], + Interceptor[DescribeSecretInput, DescribeSecretOutput, Any, Any], + Interceptor[GetRandomPasswordInput, GetRandomPasswordOutput, Any, Any], + Interceptor[GetResourcePolicyInput, GetResourcePolicyOutput, Any, Any], + Interceptor[GetSecretValueInput, GetSecretValueOutput, Any, Any], + Interceptor[ListSecretsInput, ListSecretsOutput, Any, Any], + Interceptor[ListSecretVersionIdsInput, ListSecretVersionIdsOutput, Any, Any], + Interceptor[PutResourcePolicyInput, PutResourcePolicyOutput, Any, Any], + Interceptor[PutSecretValueInput, PutSecretValueOutput, Any, Any], + Interceptor[ + RemoveRegionsFromReplicationInput, + RemoveRegionsFromReplicationOutput, + Any, + Any, + ], + Interceptor[ + ReplicateSecretToRegionsInput, ReplicateSecretToRegionsOutput, Any, Any + ], + Interceptor[RestoreSecretInput, RestoreSecretOutput, Any, Any], + Interceptor[RotateSecretInput, RotateSecretOutput, Any, Any], + Interceptor[ + StopReplicationToReplicaInput, StopReplicationToReplicaOutput, Any, Any + ], + Interceptor[TagResourceInput, TagResourceOutput, Any, Any], + Interceptor[UntagResourceInput, UntagResourceOutput, Any, Any], + Interceptor[UpdateSecretInput, UpdateSecretOutput, Any, Any], + Interceptor[ + UpdateSecretVersionStageInput, UpdateSecretVersionStageOutput, Any, Any + ], + Interceptor[ + ValidateResourcePolicyInput, ValidateResourcePolicyOutput, Any, Any + ], + ] +else: + _ServiceInterceptor = Any + _PROTOCOL_SETTINGS = ProtocolSettings( - namespace="com.amazonaws.secretsmanager", service_target="secretsmanager" + namespace="com.amazonaws.secretsmanager", + service_target="secretsmanager", + service_schema=SECRETSMANAGER, ) class _AsyncSecretsManagerConfigOverrides(AwsConfigOverrides, total=False): - endpoint_resolver: EndpointResolver | None + endpoint_resolver: AsyncEndpointResolver | None protocol: ( - ClientProtocol[Any, Any] | ProtocolConstructor[ClientProtocol[Any, Any]] | None + AsyncClientProtocol[Any, Any] + | ProtocolConstructor[AsyncClientProtocol[Any, Any]] + | None ) - auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None + auth_schemes: dict[ShapeID, AsyncAuthScheme[Any, Any, Any, Any]] | None auth_scheme_resolver: AuthSchemeResolver | None @@ -128,17 +148,17 @@ class _AsyncSecretsManagerConfigOverrides(AwsConfigOverrides, total=False): class AsyncSecretsManagerConfig(AsyncAwsConfig): """Secrets Manager configuration (async-resolved).""" - endpoint_resolver: EndpointResolver | None = None + endpoint_resolver: AsyncEndpointResolver | None = None """ The endpoint resolver used to resolve the final endpoint per-operation based on the configuration. """ - protocol: ClientProtocol[Any, Any] | None = None + protocol: AsyncClientProtocol[Any, Any] | None = None """ Pass a protocol class reference from smithy_aws_core.aio.protocols to - select the protocol, e.g. protocol=AwsJson10ClientProtocol. For custom - protocols a protocol instance may also be passed. + select the protocol, e.g. protocol=AsyncAwsJson10ClientProtocol. For + custom protocols a protocol instance may also be passed. """ interceptors: list[_ServiceInterceptor] = field(default_factory=lambda: []) @@ -147,7 +167,7 @@ class AsyncSecretsManagerConfig(AsyncAwsConfig): execution of a request. """ - auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None = None + auth_schemes: dict[ShapeID, AsyncAuthScheme[Any, Any, Any, Any]] | None = None """A map of auth scheme ids to auth schemes.""" auth_scheme_resolver: AuthSchemeResolver | None = None @@ -157,7 +177,7 @@ class AsyncSecretsManagerConfig(AsyncAwsConfig): """ aws_credentials_identity_resolver: ( - IdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None + AsyncIdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None ) = None """Resolves AWS Credentials. Required for operations that use Sigv4 Auth.""" @@ -198,24 +218,26 @@ class AsyncSecretsManagerConfig(AsyncAwsConfig): default=None, resolver=EndpointUriResolver("secrets_manager") ), "endpoint_resolver": FieldSpec( - default_factory=lambda: StandardRegionalEndpointsResolver( + default_factory=lambda: AsyncStandardRegionalEndpointsResolver( endpoint_prefix="secretsmanager" ) ), "protocol": FieldSpec( - default_factory=lambda: AwsJson11ClientProtocol(_PROTOCOL_SETTINGS), + default_factory=lambda: AsyncAwsJson11ClientProtocol(_PROTOCOL_SETTINGS), converter=lambda p: p(_PROTOCOL_SETTINGS) if isinstance(p, type) else p, ), "auth_schemes": FieldSpec( default_factory=lambda: { - ShapeID("aws.auth#sigv4"): SigV4AuthScheme(service="secretsmanager") + ShapeID("aws.auth#sigv4"): AsyncSigV4AuthScheme( + service="secretsmanager" + ) } ), "auth_scheme_resolver": FieldSpec(default_factory=HTTPAuthSchemeResolver), "transport": FieldSpec(default_factory=lambda: AIOHTTPClient()), } - def set_auth_scheme(self, scheme: AuthScheme[Any, Any, Any, Any]) -> None: + def set_auth_scheme(self, scheme: AsyncAuthScheme[Any, Any, Any, Any]) -> None: """ Set an auth scheme implementation using its scheme ID. :param scheme: The auth scheme to add or replace. @@ -229,7 +251,7 @@ async def resolve( # pyright: ignore[reportIncompatibleMethodOverride] cls, *, profile: str | None = None, - fs: FileSystem | None = None, + fs: AsyncFileSystem | None = None, config_file_path: str | None = None, credentials_file_path: str | None = None, **overrides: Unpack[_AsyncSecretsManagerConfigOverrides], diff --git a/clients/aws-sdk-secrets-manager/src/aws_sdk_secrets_manager/models.py b/clients/aws-sdk-secrets-manager/src/aws_sdk_secrets_manager/models.py index 758c1453..b940f0fd 100644 --- a/clients/aws-sdk-secrets-manager/src/aws_sdk_secrets_manager/models.py +++ b/clients/aws-sdk-secrets-manager/src/aws_sdk_secrets_manager/models.py @@ -1,7589 +1,585 @@ # Code generated by smithy-python-codegen DO NOT EDIT. -from dataclasses import dataclass, field -from datetime import datetime -from enum import StrEnum -import logging -from typing import Any, Literal, Self +from __future__ import annotations -from smithy_core.deserializers import ShapeDeserializer -from smithy_core.documents import TypeRegistry +from ._private import schemas as _schemas +from smithy_core._dynamic_models import ModelRegistry from smithy_core.exceptions import ModeledError -from smithy_core.response import EMPTY_RESPONSE_METADATA, ResponseMetadata -from smithy_core.schemas import APIOperation, Schema -from smithy_core.serializers import ShapeSerializer +from smithy_core.schemas import APIOperation from smithy_core.shapes import ShapeID -from smithy_core.types import UnknownEnumMixin from ._private.schemas import ( - API_ERROR_TYPE as _SCHEMA_API_ERROR_TYPE, BATCH_GET_SECRET_VALUE as _SCHEMA_BATCH_GET_SECRET_VALUE, - BATCH_GET_SECRET_VALUE_INPUT as _SCHEMA_BATCH_GET_SECRET_VALUE_INPUT, - BATCH_GET_SECRET_VALUE_OUTPUT as _SCHEMA_BATCH_GET_SECRET_VALUE_OUTPUT, CANCEL_ROTATE_SECRET as _SCHEMA_CANCEL_ROTATE_SECRET, - CANCEL_ROTATE_SECRET_INPUT as _SCHEMA_CANCEL_ROTATE_SECRET_INPUT, - CANCEL_ROTATE_SECRET_OUTPUT as _SCHEMA_CANCEL_ROTATE_SECRET_OUTPUT, CREATE_SECRET as _SCHEMA_CREATE_SECRET, - CREATE_SECRET_INPUT as _SCHEMA_CREATE_SECRET_INPUT, - CREATE_SECRET_OUTPUT as _SCHEMA_CREATE_SECRET_OUTPUT, - DECRYPTION_FAILURE as _SCHEMA_DECRYPTION_FAILURE, DELETE_RESOURCE_POLICY as _SCHEMA_DELETE_RESOURCE_POLICY, - DELETE_RESOURCE_POLICY_INPUT as _SCHEMA_DELETE_RESOURCE_POLICY_INPUT, - DELETE_RESOURCE_POLICY_OUTPUT as _SCHEMA_DELETE_RESOURCE_POLICY_OUTPUT, DELETE_SECRET as _SCHEMA_DELETE_SECRET, - DELETE_SECRET_INPUT as _SCHEMA_DELETE_SECRET_INPUT, - DELETE_SECRET_OUTPUT as _SCHEMA_DELETE_SECRET_OUTPUT, DESCRIBE_SECRET as _SCHEMA_DESCRIBE_SECRET, - DESCRIBE_SECRET_INPUT as _SCHEMA_DESCRIBE_SECRET_INPUT, - DESCRIBE_SECRET_OUTPUT as _SCHEMA_DESCRIBE_SECRET_OUTPUT, - ENCRYPTION_FAILURE as _SCHEMA_ENCRYPTION_FAILURE, - EXTERNAL_SECRET_ROTATION_METADATA_ITEM as _SCHEMA_EXTERNAL_SECRET_ROTATION_METADATA_ITEM, - FILTER as _SCHEMA_FILTER, GET_RANDOM_PASSWORD as _SCHEMA_GET_RANDOM_PASSWORD, - GET_RANDOM_PASSWORD_INPUT as _SCHEMA_GET_RANDOM_PASSWORD_INPUT, - GET_RANDOM_PASSWORD_OUTPUT as _SCHEMA_GET_RANDOM_PASSWORD_OUTPUT, GET_RESOURCE_POLICY as _SCHEMA_GET_RESOURCE_POLICY, - GET_RESOURCE_POLICY_INPUT as _SCHEMA_GET_RESOURCE_POLICY_INPUT, - GET_RESOURCE_POLICY_OUTPUT as _SCHEMA_GET_RESOURCE_POLICY_OUTPUT, GET_SECRET_VALUE as _SCHEMA_GET_SECRET_VALUE, - GET_SECRET_VALUE_INPUT as _SCHEMA_GET_SECRET_VALUE_INPUT, - GET_SECRET_VALUE_OUTPUT as _SCHEMA_GET_SECRET_VALUE_OUTPUT, - INTERNAL_SERVICE_ERROR as _SCHEMA_INTERNAL_SERVICE_ERROR, - INVALID_NEXT_TOKEN_EXCEPTION as _SCHEMA_INVALID_NEXT_TOKEN_EXCEPTION, - INVALID_PARAMETER_EXCEPTION as _SCHEMA_INVALID_PARAMETER_EXCEPTION, - INVALID_REQUEST_EXCEPTION as _SCHEMA_INVALID_REQUEST_EXCEPTION, - LIMIT_EXCEEDED_EXCEPTION as _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, LIST_SECRETS as _SCHEMA_LIST_SECRETS, - LIST_SECRETS_INPUT as _SCHEMA_LIST_SECRETS_INPUT, - LIST_SECRETS_OUTPUT as _SCHEMA_LIST_SECRETS_OUTPUT, LIST_SECRET_VERSION_IDS as _SCHEMA_LIST_SECRET_VERSION_IDS, - LIST_SECRET_VERSION_IDS_INPUT as _SCHEMA_LIST_SECRET_VERSION_IDS_INPUT, - LIST_SECRET_VERSION_IDS_OUTPUT as _SCHEMA_LIST_SECRET_VERSION_IDS_OUTPUT, - MALFORMED_POLICY_DOCUMENT_EXCEPTION as _SCHEMA_MALFORMED_POLICY_DOCUMENT_EXCEPTION, - PRECONDITION_NOT_MET_EXCEPTION as _SCHEMA_PRECONDITION_NOT_MET_EXCEPTION, - PUBLIC_POLICY_EXCEPTION as _SCHEMA_PUBLIC_POLICY_EXCEPTION, PUT_RESOURCE_POLICY as _SCHEMA_PUT_RESOURCE_POLICY, - PUT_RESOURCE_POLICY_INPUT as _SCHEMA_PUT_RESOURCE_POLICY_INPUT, - PUT_RESOURCE_POLICY_OUTPUT as _SCHEMA_PUT_RESOURCE_POLICY_OUTPUT, PUT_SECRET_VALUE as _SCHEMA_PUT_SECRET_VALUE, - PUT_SECRET_VALUE_INPUT as _SCHEMA_PUT_SECRET_VALUE_INPUT, - PUT_SECRET_VALUE_OUTPUT as _SCHEMA_PUT_SECRET_VALUE_OUTPUT, REMOVE_REGIONS_FROM_REPLICATION as _SCHEMA_REMOVE_REGIONS_FROM_REPLICATION, - REMOVE_REGIONS_FROM_REPLICATION_INPUT as _SCHEMA_REMOVE_REGIONS_FROM_REPLICATION_INPUT, - REMOVE_REGIONS_FROM_REPLICATION_OUTPUT as _SCHEMA_REMOVE_REGIONS_FROM_REPLICATION_OUTPUT, REPLICATE_SECRET_TO_REGIONS as _SCHEMA_REPLICATE_SECRET_TO_REGIONS, - REPLICATE_SECRET_TO_REGIONS_INPUT as _SCHEMA_REPLICATE_SECRET_TO_REGIONS_INPUT, - REPLICATE_SECRET_TO_REGIONS_OUTPUT as _SCHEMA_REPLICATE_SECRET_TO_REGIONS_OUTPUT, - REPLICATION_STATUS_TYPE as _SCHEMA_REPLICATION_STATUS_TYPE, - REPLICA_REGION_TYPE as _SCHEMA_REPLICA_REGION_TYPE, - RESOURCE_EXISTS_EXCEPTION as _SCHEMA_RESOURCE_EXISTS_EXCEPTION, - RESOURCE_NOT_FOUND_EXCEPTION as _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, RESTORE_SECRET as _SCHEMA_RESTORE_SECRET, - RESTORE_SECRET_INPUT as _SCHEMA_RESTORE_SECRET_INPUT, - RESTORE_SECRET_OUTPUT as _SCHEMA_RESTORE_SECRET_OUTPUT, ROTATE_SECRET as _SCHEMA_ROTATE_SECRET, - ROTATE_SECRET_INPUT as _SCHEMA_ROTATE_SECRET_INPUT, - ROTATE_SECRET_OUTPUT as _SCHEMA_ROTATE_SECRET_OUTPUT, - ROTATION_RULES_TYPE as _SCHEMA_ROTATION_RULES_TYPE, - SECRET_LIST_ENTRY as _SCHEMA_SECRET_LIST_ENTRY, - SECRET_VALUE_ENTRY as _SCHEMA_SECRET_VALUE_ENTRY, - SECRET_VERSIONS_LIST_ENTRY as _SCHEMA_SECRET_VERSIONS_LIST_ENTRY, STOP_REPLICATION_TO_REPLICA as _SCHEMA_STOP_REPLICATION_TO_REPLICA, - STOP_REPLICATION_TO_REPLICA_INPUT as _SCHEMA_STOP_REPLICATION_TO_REPLICA_INPUT, - STOP_REPLICATION_TO_REPLICA_OUTPUT as _SCHEMA_STOP_REPLICATION_TO_REPLICA_OUTPUT, - TAG as _SCHEMA_TAG, TAG_RESOURCE as _SCHEMA_TAG_RESOURCE, - TAG_RESOURCE_INPUT as _SCHEMA_TAG_RESOURCE_INPUT, - TAG_RESOURCE_OUTPUT as _SCHEMA_TAG_RESOURCE_OUTPUT, UNTAG_RESOURCE as _SCHEMA_UNTAG_RESOURCE, - UNTAG_RESOURCE_INPUT as _SCHEMA_UNTAG_RESOURCE_INPUT, - UNTAG_RESOURCE_OUTPUT as _SCHEMA_UNTAG_RESOURCE_OUTPUT, UPDATE_SECRET as _SCHEMA_UPDATE_SECRET, - UPDATE_SECRET_INPUT as _SCHEMA_UPDATE_SECRET_INPUT, - UPDATE_SECRET_OUTPUT as _SCHEMA_UPDATE_SECRET_OUTPUT, UPDATE_SECRET_VERSION_STAGE as _SCHEMA_UPDATE_SECRET_VERSION_STAGE, - UPDATE_SECRET_VERSION_STAGE_INPUT as _SCHEMA_UPDATE_SECRET_VERSION_STAGE_INPUT, - UPDATE_SECRET_VERSION_STAGE_OUTPUT as _SCHEMA_UPDATE_SECRET_VERSION_STAGE_OUTPUT, VALIDATE_RESOURCE_POLICY as _SCHEMA_VALIDATE_RESOURCE_POLICY, - VALIDATE_RESOURCE_POLICY_INPUT as _SCHEMA_VALIDATE_RESOURCE_POLICY_INPUT, - VALIDATE_RESOURCE_POLICY_OUTPUT as _SCHEMA_VALIDATE_RESOURCE_POLICY_OUTPUT, - VALIDATION_ERRORS_ENTRY as _SCHEMA_VALIDATION_ERRORS_ENTRY, ) +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .models import ( + BatchGetSecretValueInput, + BatchGetSecretValueOutput, + CancelRotateSecretInput, + CancelRotateSecretOutput, + CreateSecretInput, + CreateSecretOutput, + DeleteResourcePolicyInput, + DeleteResourcePolicyOutput, + DeleteSecretInput, + DeleteSecretOutput, + DescribeSecretInput, + DescribeSecretOutput, + GetRandomPasswordInput, + GetRandomPasswordOutput, + GetResourcePolicyInput, + GetResourcePolicyOutput, + GetSecretValueInput, + GetSecretValueOutput, + ListSecretVersionIdsInput, + ListSecretVersionIdsOutput, + ListSecretsInput, + ListSecretsOutput, + PutResourcePolicyInput, + PutResourcePolicyOutput, + PutSecretValueInput, + PutSecretValueOutput, + RemoveRegionsFromReplicationInput, + RemoveRegionsFromReplicationOutput, + ReplicateSecretToRegionsInput, + ReplicateSecretToRegionsOutput, + RestoreSecretInput, + RestoreSecretOutput, + RotateSecretInput, + RotateSecretOutput, + StopReplicationToReplicaInput, + StopReplicationToReplicaOutput, + TagResourceInput, + TagResourceOutput, + UntagResourceInput, + UntagResourceOutput, + UpdateSecretInput, + UpdateSecretOutput, + UpdateSecretVersionStageInput, + UpdateSecretVersionStageOutput, + ValidateResourcePolicyInput, + ValidateResourcePolicyOutput, + ) -logger = logging.getLogger(__name__) - - -class ServiceError(ModeledError): - """ - Base error for all errors in the service. - - Some exceptions do not extend from this class, including - synthetic, implicit, and shared exception types. - """ - - -@dataclass(kw_only=True) -class ReplicaRegionType: - """ - A custom type that specifies a `Region` and the `KmsKeyId` for a replica - secret. - """ - - region: str | None = None - """ - A Region code. For a list of Region codes, see [Name and code of - Regions](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). - """ - - kms_key_id: str | None = None - """ - The ARN, key ID, or alias of the KMS key to encrypt the secret. If you - don't include this field, Secrets Manager uses `aws/secretsmanager`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REPLICA_REGION_TYPE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.region is not None: - serializer.write_string( - _SCHEMA_REPLICA_REGION_TYPE.members["Region"], self.region - ) - - if self.kms_key_id is not None: - serializer.write_string( - _SCHEMA_REPLICA_REGION_TYPE.members["KmsKeyId"], self.kms_key_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["region"] = de.read_string( - _SCHEMA_REPLICA_REGION_TYPE.members["Region"] - ) - - case 1: - kwargs["kms_key_id"] = de.read_string( - _SCHEMA_REPLICA_REGION_TYPE.members["KmsKeyId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_REPLICA_REGION_TYPE, consumer=_consumer) - return kwargs - - -def _serialize_add_replica_region_list_type( - serializer: ShapeSerializer, schema: Schema, value: list[ReplicaRegionType] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_add_replica_region_list_type( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ReplicaRegionType]: - result: list[ReplicaRegionType] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ReplicaRegionType.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class APIErrorType: - """ - The error Secrets Manager encountered while retrieving an individual - secret as part of BatchGetSecretValue. - """ - - secret_id: str | None = None - """The ARN or name of the secret.""" - - error_code: str | None = None - """ - The error Secrets Manager encountered while retrieving an individual - secret as part of BatchGetSecretValue, for example - `ResourceNotFoundException`,`InvalidParameterException`, - `InvalidRequestException`, `DecryptionFailure`, or - `AccessDeniedException`. - """ - - message: str | None = None - """A message describing the error.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_API_ERROR_TYPE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.secret_id is not None: - serializer.write_string( - _SCHEMA_API_ERROR_TYPE.members["SecretId"], self.secret_id - ) - - if self.error_code is not None: - serializer.write_string( - _SCHEMA_API_ERROR_TYPE.members["ErrorCode"], self.error_code - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_API_ERROR_TYPE.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["secret_id"] = de.read_string( - _SCHEMA_API_ERROR_TYPE.members["SecretId"] - ) - - case 1: - kwargs["error_code"] = de.read_string( - _SCHEMA_API_ERROR_TYPE.members["ErrorCode"] - ) - - case 2: - kwargs["message"] = de.read_string( - _SCHEMA_API_ERROR_TYPE.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_API_ERROR_TYPE, consumer=_consumer) - return kwargs - - -def _serialize_api_error_list_type( - serializer: ShapeSerializer, schema: Schema, value: list[APIErrorType] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_api_error_list_type( - deserializer: ShapeDeserializer, schema: Schema -) -> list[APIErrorType]: - result: list[APIErrorType] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(APIErrorType.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class FilterNameStringType(UnknownEnumMixin, StrEnum): - DESCRIPTION = "description" - NAME = "name" - TAG_KEY = "tag-key" - TAG_VALUE = "tag-value" - PRIMARY_REGION = "primary-region" - OWNING_SERVICE = "owning-service" - ALL = "all" - - -def _serialize_filter_values_string_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_filter_values_string_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class Filter: - """ - Allows you to add filters when you use the search function in Secrets - Manager. For more information, see [Find secrets in Secrets - Manager](https://docs.aws.amazon.com/secretsmanager/latest/userguide/manage_search-secret.html). - """ - - key: str | None = None - """ - The following are keys you can use: - - - **description**: Prefix match, not case-sensitive. - - - **name**: Prefix match, case-sensitive. - - - **tag-key**: Prefix match, case-sensitive. - - - **tag-value**: Prefix match, case-sensitive. - - - **primary-region**: Prefix match, case-sensitive. - - - **owning-service**: Prefix match, case-sensitive. - - - **all**: Breaks the filter value string into words and then searches - all attributes for matches. Not case-sensitive. - """ - - values: list[str] | None = None - """ - The keyword to filter for. - - You can prefix your search value with an exclamation mark (`!`) in order - to perform negation filters. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FILTER, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.key is not None: - serializer.write_string(_SCHEMA_FILTER.members["Key"], self.key) - - if self.values is not None: - _serialize_filter_values_string_list( - serializer, _SCHEMA_FILTER.members["Values"], self.values - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["key"] = FilterNameStringType( - de.read_string(_SCHEMA_FILTER.members["Key"]) - ) - - case 1: - kwargs["values"] = _deserialize_filter_values_string_list( - de, _SCHEMA_FILTER.members["Values"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FILTER, consumer=_consumer) - return kwargs - - -def _serialize_filters_list_type( - serializer: ShapeSerializer, schema: Schema, value: list[Filter] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_filters_list_type( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Filter]: - result: list[Filter] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Filter.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_secret_id_list_type( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_secret_id_list_type( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class BatchGetSecretValueInput: - """Dataclass for BatchGetSecretValueInput structure.""" - - secret_id_list: list[str] | None = None - """ - The ARN or names of the secrets to retrieve. You must include `Filters` - or `SecretIdList`, but not both. - """ - - filters: list[Filter] | None = None - """ - The filters to choose which secrets to retrieve. You must include - `Filters` or `SecretIdList`, but not both. - """ - - max_results: int | None = None - """ - The number of results to include in the response. - - If there are more results available, in the response, Secrets Manager - includes `NextToken`. To get the next results, call - `BatchGetSecretValue` again with the value from `NextToken`. To use this - parameter, you must also use the `Filters` parameter. - """ - - next_token: str | None = None - """ - A token that indicates where the output should continue from, if a - previous call did not show all results. To get the next results, call - `BatchGetSecretValue` again with this value. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BATCH_GET_SECRET_VALUE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.secret_id_list is not None: - _serialize_secret_id_list_type( - serializer, - _SCHEMA_BATCH_GET_SECRET_VALUE_INPUT.members["SecretIdList"], - self.secret_id_list, - ) - - if self.filters is not None: - _serialize_filters_list_type( - serializer, - _SCHEMA_BATCH_GET_SECRET_VALUE_INPUT.members["Filters"], - self.filters, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_BATCH_GET_SECRET_VALUE_INPUT.members["MaxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_BATCH_GET_SECRET_VALUE_INPUT.members["NextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["secret_id_list"] = _deserialize_secret_id_list_type( - de, _SCHEMA_BATCH_GET_SECRET_VALUE_INPUT.members["SecretIdList"] - ) - - case 1: - kwargs["filters"] = _deserialize_filters_list_type( - de, _SCHEMA_BATCH_GET_SECRET_VALUE_INPUT.members["Filters"] - ) - - case 2: - kwargs["max_results"] = de.read_integer( - _SCHEMA_BATCH_GET_SECRET_VALUE_INPUT.members["MaxResults"] - ) - - case 3: - kwargs["next_token"] = de.read_string( - _SCHEMA_BATCH_GET_SECRET_VALUE_INPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_BATCH_GET_SECRET_VALUE_INPUT, consumer=_consumer - ) - return kwargs - - -def _serialize_secret_version_stages_type( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_secret_version_stages_type( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class SecretValueEntry: - """ - A structure that contains the secret value and other details for a - secret. - """ - - arn: str | None = None - """The Amazon Resource Name (ARN) of the secret.""" - - name: str | None = None - """The friendly name of the secret.""" - - version_id: str | None = None - """The unique version identifier of this version of the secret.""" - - secret_binary: bytes | None = field(repr=False, default=None) - """ - The decrypted secret value, if the secret value was originally provided - as binary data in the form of a byte array. The parameter represents the - binary data as a - [base64-encoded](https://tools.ietf.org/html/rfc4648#section-4) string. - """ - - secret_string: str | None = field(repr=False, default=None) - """ - The decrypted secret value, if the secret value was originally provided - as a string or through the Secrets Manager console. - """ - - version_stages: list[str] | None = None - """ - A list of all of the staging labels currently attached to this version - of the secret. - """ - - created_date: datetime | None = None - """The date the secret was created.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SECRET_VALUE_ENTRY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.arn is not None: - serializer.write_string(_SCHEMA_SECRET_VALUE_ENTRY.members["ARN"], self.arn) - - if self.name is not None: - serializer.write_string( - _SCHEMA_SECRET_VALUE_ENTRY.members["Name"], self.name - ) - - if self.version_id is not None: - serializer.write_string( - _SCHEMA_SECRET_VALUE_ENTRY.members["VersionId"], self.version_id - ) - - if self.secret_binary is not None: - serializer.write_blob( - _SCHEMA_SECRET_VALUE_ENTRY.members["SecretBinary"], self.secret_binary - ) - - if self.secret_string is not None: - serializer.write_string( - _SCHEMA_SECRET_VALUE_ENTRY.members["SecretString"], self.secret_string - ) - - if self.version_stages is not None: - _serialize_secret_version_stages_type( - serializer, - _SCHEMA_SECRET_VALUE_ENTRY.members["VersionStages"], - self.version_stages, - ) - - if self.created_date is not None: - serializer.write_timestamp( - _SCHEMA_SECRET_VALUE_ENTRY.members["CreatedDate"], self.created_date - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["arn"] = de.read_string( - _SCHEMA_SECRET_VALUE_ENTRY.members["ARN"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_SECRET_VALUE_ENTRY.members["Name"] - ) - - case 2: - kwargs["version_id"] = de.read_string( - _SCHEMA_SECRET_VALUE_ENTRY.members["VersionId"] - ) - - case 3: - kwargs["secret_binary"] = de.read_blob( - _SCHEMA_SECRET_VALUE_ENTRY.members["SecretBinary"] - ) - - case 4: - kwargs["secret_string"] = de.read_string( - _SCHEMA_SECRET_VALUE_ENTRY.members["SecretString"] - ) - - case 5: - kwargs["version_stages"] = _deserialize_secret_version_stages_type( - de, _SCHEMA_SECRET_VALUE_ENTRY.members["VersionStages"] - ) - - case 6: - kwargs["created_date"] = de.read_timestamp( - _SCHEMA_SECRET_VALUE_ENTRY.members["CreatedDate"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SECRET_VALUE_ENTRY, consumer=_consumer) - return kwargs - - -def _serialize_secret_values_type( - serializer: ShapeSerializer, schema: Schema, value: list[SecretValueEntry] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_secret_values_type( - deserializer: ShapeDeserializer, schema: Schema -) -> list[SecretValueEntry]: - result: list[SecretValueEntry] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(SecretValueEntry.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class BatchGetSecretValueOutput: - """Dataclass for BatchGetSecretValueOutput structure.""" - - secret_values: list[SecretValueEntry] | None = None - """A list of secret values.""" - - next_token: str | None = None - """ - Secrets Manager includes this value if there's more output available - than what is included in the current response. This can occur even when - the response includes no values at all, such as when you ask for a - filtered view of a long list. To get the next results, call - `BatchGetSecretValue` again with this value. - """ - - errors: list[APIErrorType] | None = None - """ - A list of errors Secrets Manager encountered while attempting to - retrieve individual secrets. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BATCH_GET_SECRET_VALUE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.secret_values is not None: - _serialize_secret_values_type( - serializer, - _SCHEMA_BATCH_GET_SECRET_VALUE_OUTPUT.members["SecretValues"], - self.secret_values, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_BATCH_GET_SECRET_VALUE_OUTPUT.members["NextToken"], - self.next_token, - ) - - if self.errors is not None: - _serialize_api_error_list_type( - serializer, - _SCHEMA_BATCH_GET_SECRET_VALUE_OUTPUT.members["Errors"], - self.errors, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["secret_values"] = _deserialize_secret_values_type( - de, - _SCHEMA_BATCH_GET_SECRET_VALUE_OUTPUT.members["SecretValues"], - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_BATCH_GET_SECRET_VALUE_OUTPUT.members["NextToken"] - ) - - case 2: - kwargs["errors"] = _deserialize_api_error_list_type( - de, _SCHEMA_BATCH_GET_SECRET_VALUE_OUTPUT.members["Errors"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_BATCH_GET_SECRET_VALUE_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DecryptionFailure(ServiceError): - """ - Secrets Manager can't decrypt the protected secret text using the - provided KMS key. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DECRYPTION_FAILURE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_DECRYPTION_FAILURE.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_DECRYPTION_FAILURE.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DECRYPTION_FAILURE, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class InternalServiceError(ServiceError): - """An error occurred on the server side.""" - - fault: Literal["client", "server"] | None = "server" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INTERNAL_SERVICE_ERROR, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INTERNAL_SERVICE_ERROR.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INTERNAL_SERVICE_ERROR.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INTERNAL_SERVICE_ERROR, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class InvalidNextTokenException(ServiceError): - """The `NextToken` value is invalid.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_NEXT_TOKEN_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_NEXT_TOKEN_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_NEXT_TOKEN_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVALID_NEXT_TOKEN_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InvalidParameterException(ServiceError): - """The parameter name or value is invalid.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_PARAMETER_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_PARAMETER_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_PARAMETER_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVALID_PARAMETER_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InvalidRequestException(ServiceError): - """ - A parameter value is not valid for the current state of the resource. - - Possible causes: - - - The secret is scheduled for deletion. - - - You tried to enable rotation on a secret that doesn't already have a - Lambda function ARN configured and you didn't include such an ARN as - a parameter in this call. - - - The secret is managed by another service, and you must use that - service to update it. For more information, see [Secrets managed by - other Amazon Web Services - services](https://docs.aws.amazon.com/secretsmanager/latest/userguide/service-linked-secrets.html). - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_REQUEST_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_REQUEST_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_REQUEST_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INVALID_REQUEST_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ResourceNotFoundException(ServiceError): - """Secrets Manager can't find the resource that you asked for.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, consumer=_consumer - ) - return kwargs - - -BATCH_GET_SECRET_VALUE = APIOperation( - input=BatchGetSecretValueInput, - output=BatchGetSecretValueOutput, - schema=_SCHEMA_BATCH_GET_SECRET_VALUE, - input_schema=_SCHEMA_BATCH_GET_SECRET_VALUE_INPUT, - output_schema=_SCHEMA_BATCH_GET_SECRET_VALUE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.secretsmanager#DecryptionFailure" - ): DecryptionFailure, - ShapeID( - "com.amazonaws.secretsmanager#InternalServiceError" - ): InternalServiceError, - ShapeID( - "com.amazonaws.secretsmanager#InvalidNextTokenException" - ): InvalidNextTokenException, - ShapeID( - "com.amazonaws.secretsmanager#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.secretsmanager#InvalidRequestException" - ): InvalidRequestException, - ShapeID( - "com.amazonaws.secretsmanager#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_DECRYPTION_FAILURE, - _SCHEMA_INTERNAL_SERVICE_ERROR, - _SCHEMA_INVALID_NEXT_TOKEN_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_INVALID_REQUEST_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class CancelRotateSecretInput: - """Dataclass for CancelRotateSecretInput structure.""" - - secret_id: str | None = None - """ - The ARN or name of the secret. - - For an ARN, we recommend that you specify a complete ARN rather than a - partial ARN. See [Finding a secret from a partial - ARN](https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CANCEL_ROTATE_SECRET_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.secret_id is not None: - serializer.write_string( - _SCHEMA_CANCEL_ROTATE_SECRET_INPUT.members["SecretId"], self.secret_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["secret_id"] = de.read_string( - _SCHEMA_CANCEL_ROTATE_SECRET_INPUT.members["SecretId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CANCEL_ROTATE_SECRET_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CancelRotateSecretOutput: - """Dataclass for CancelRotateSecretOutput structure.""" - - arn: str | None = None - """The ARN of the secret.""" - - name: str | None = None - """The name of the secret.""" - - version_id: str | None = None - """ - The unique identifier of the version of the secret created during the - rotation. This version might not be complete, and should be evaluated - for possible deletion. We recommend that you remove the `VersionStage` - value `AWSPENDING` from this version so that Secrets Manager can delete - it. Failing to clean up a cancelled rotation can block you from starting - future rotations. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CANCEL_ROTATE_SECRET_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.arn is not None: - serializer.write_string( - _SCHEMA_CANCEL_ROTATE_SECRET_OUTPUT.members["ARN"], self.arn - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_CANCEL_ROTATE_SECRET_OUTPUT.members["Name"], self.name - ) - - if self.version_id is not None: - serializer.write_string( - _SCHEMA_CANCEL_ROTATE_SECRET_OUTPUT.members["VersionId"], - self.version_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["arn"] = de.read_string( - _SCHEMA_CANCEL_ROTATE_SECRET_OUTPUT.members["ARN"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_CANCEL_ROTATE_SECRET_OUTPUT.members["Name"] - ) - - case 2: - kwargs["version_id"] = de.read_string( - _SCHEMA_CANCEL_ROTATE_SECRET_OUTPUT.members["VersionId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CANCEL_ROTATE_SECRET_OUTPUT, consumer=_consumer - ) - return kwargs - - -CANCEL_ROTATE_SECRET = APIOperation( - input=CancelRotateSecretInput, - output=CancelRotateSecretOutput, - schema=_SCHEMA_CANCEL_ROTATE_SECRET, - input_schema=_SCHEMA_CANCEL_ROTATE_SECRET_INPUT, - output_schema=_SCHEMA_CANCEL_ROTATE_SECRET_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.secretsmanager#InternalServiceError" - ): InternalServiceError, - ShapeID( - "com.amazonaws.secretsmanager#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.secretsmanager#InvalidRequestException" - ): InvalidRequestException, - ShapeID( - "com.amazonaws.secretsmanager#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_SERVICE_ERROR, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_INVALID_REQUEST_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class Tag: - """A structure that contains information about a tag.""" - - key: str | None = None - """The key identifier, or name, of the tag.""" - - value: str | None = None - """The string value associated with the key of the tag.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TAG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.key is not None: - serializer.write_string(_SCHEMA_TAG.members["Key"], self.key) - - if self.value is not None: - serializer.write_string(_SCHEMA_TAG.members["Value"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["key"] = de.read_string(_SCHEMA_TAG.members["Key"]) - - case 1: - kwargs["value"] = de.read_string(_SCHEMA_TAG.members["Value"]) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TAG, consumer=_consumer) - return kwargs - - -def _serialize_tag_list_type( - serializer: ShapeSerializer, schema: Schema, value: list[Tag] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_tag_list_type( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Tag]: - result: list[Tag] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Tag.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CreateSecretInput: - """Dataclass for CreateSecretInput structure.""" - - name: str | None = None - """ - The name of the new secret. - - The secret name can contain ASCII letters, numbers, and the following - characters: /_+=.@- - - Do not end your secret name with a hyphen followed by six characters. If - you do so, you risk confusion and unexpected results when searching for - a secret by partial ARN. Secrets Manager automatically adds a hyphen and - six random characters after the secret name at the end of the ARN. - """ - - client_request_token: str | None = None - """ - If you include `SecretString` or `SecretBinary`, then Secrets Manager - creates an initial version for the secret, and this parameter specifies - the unique identifier for the new version. - - Note: - If you use the Amazon Web Services CLI or one of the Amazon Web Services - SDKs to call this operation, then you can leave this parameter empty. - The CLI or SDK generates a random UUID for you and includes it as the - value for this parameter in the request. - - If you generate a raw HTTP request to the Secrets Manager service - endpoint, then you must generate a `ClientRequestToken` and include it - in the request. - - This value helps ensure idempotency. Secrets Manager uses this value to - prevent the accidental creation of duplicate versions if there are - failures and retries during a rotation. We recommend that you generate a - [UUID-type](https://wikipedia.org/wiki/Universally_unique_identifier) - value to ensure uniqueness of your versions within the specified secret. - - - If the `ClientRequestToken` value isn't already associated with a - version of the secret then a new version of the secret is created. - - - If a version with this value already exists and the version - `SecretString` and `SecretBinary` values are the same as those in the - request, then the request is ignored. - - - If a version with this value already exists and that version's - `SecretString` and `SecretBinary` values are different from those in - the request, then the request fails because you cannot modify an - existing version. Instead, use PutSecretValue to create a new version. - - This value becomes the `VersionId` of the new version. - """ - - description: str | None = None - """The description of the secret.""" - - kms_key_id: str | None = None - """ - The ARN, key ID, or alias of the KMS key that Secrets Manager uses to - encrypt the secret value in the secret. An alias is always prefixed by - `alias/`, for example `alias/aws/secretsmanager`. For more information, - see [About - aliases](https://docs.aws.amazon.com/kms/latest/developerguide/alias-about.html). - - To use a KMS key in a different account, use the key ARN or the alias - ARN. - - If you don't specify this value, then Secrets Manager uses the key - `aws/secretsmanager`. If that key doesn't yet exist, then Secrets - Manager creates it for you automatically the first time it encrypts the - secret value. - - If the secret is in a different Amazon Web Services account from the - credentials calling the API, then you can't use `aws/secretsmanager` to - encrypt the secret, and you must create and use a customer managed KMS - key. - """ - - secret_binary: bytes | None = field(repr=False, default=None) - """ - The binary data to encrypt and store in the new version of the secret. - We recommend that you store your binary data in a file and then pass the - contents of the file as a parameter. - - Either `SecretString` or `SecretBinary` must have a value, but not both. - - This parameter is not available in the Secrets Manager console. - - Sensitive: This field contains sensitive information, so the service - does not include it in CloudTrail log entries. If you create your own - log entries, you must also avoid logging the information in this field. - """ - - secret_string: str | None = field(repr=False, default=None) - """ - The text data to encrypt and store in this new version of the secret. We - recommend you use a JSON structure of key/value pairs for your secret - value. - - Either `SecretString` or `SecretBinary` must have a value, but not both. - - If you create a secret by using the Secrets Manager console then Secrets - Manager puts the protected secret text in only the `SecretString` - parameter. The Secrets Manager console stores the information as a JSON - structure of key/value pairs that a Lambda rotation function can parse. - - Sensitive: This field contains sensitive information, so the service - does not include it in CloudTrail log entries. If you create your own - log entries, you must also avoid logging the information in this field. - """ - - tags: list[Tag] | None = None - """ - A list of tags to attach to the secret. Each tag is a key and value pair - of strings in a JSON text string, for example: - - `[{"Key":"CostCenter","Value":"12345"},{"Key":"environment","Value":"production"}]` - - Secrets Manager tag key names are case sensitive. A tag with the key - \"ABC\" is a different tag from one with key \"abc\". - - If you check tags in permissions policies as part of your security - strategy, then adding or removing a tag can change permissions. If the - completion of this operation would result in you losing your permissions - for this secret, then Secrets Manager blocks the operation and returns - an `Access Denied` error. For more information, see [Control access to - secrets using - tags](https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html#tag-secrets-abac) - and [Limit access to identities with tags that match secrets' - tags](https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html#auth-and-access_tags2). - - For information about how to format a JSON parameter for the various - command line tool environments, see [Using JSON for - Parameters](https://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#cli-using-param-json). - If your command-line tool or SDK requires quotation marks around the - parameter, you should use single quotes to avoid confusion with the - double quotes required in the JSON text. - - For tag quotas and naming restrictions, see [Service quotas for - Tagging](https://docs.aws.amazon.com/general/latest/gr/arg.html#taged-reference-quotas) - in the *Amazon Web Services General Reference guide*. - """ - - add_replica_regions: list[ReplicaRegionType] | None = None - """A list of Regions and KMS keys to replicate secrets.""" - - force_overwrite_replica_secret: bool = False - """ - Specifies whether to overwrite a secret with the same name in the - destination Region. By default, secrets aren't overwritten. - """ - - type: str | None = None - """ - The exact string that identifies the partner that holds the external - secret. For more information, see [Using Secrets Manager managed - external - secrets](https://docs.aws.amazon.com/secretsmanager/latest/userguide/managed-external-secrets.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_SECRET_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_SECRET_INPUT.members["Name"], self.name - ) - - if self.client_request_token is not None: - serializer.write_string( - _SCHEMA_CREATE_SECRET_INPUT.members["ClientRequestToken"], - self.client_request_token, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_CREATE_SECRET_INPUT.members["Description"], self.description - ) - - if self.kms_key_id is not None: - serializer.write_string( - _SCHEMA_CREATE_SECRET_INPUT.members["KmsKeyId"], self.kms_key_id - ) - - if self.secret_binary is not None: - serializer.write_blob( - _SCHEMA_CREATE_SECRET_INPUT.members["SecretBinary"], self.secret_binary - ) - - if self.secret_string is not None: - serializer.write_string( - _SCHEMA_CREATE_SECRET_INPUT.members["SecretString"], self.secret_string - ) - - if self.tags is not None: - _serialize_tag_list_type( - serializer, _SCHEMA_CREATE_SECRET_INPUT.members["Tags"], self.tags - ) - - if self.add_replica_regions is not None: - _serialize_add_replica_region_list_type( - serializer, - _SCHEMA_CREATE_SECRET_INPUT.members["AddReplicaRegions"], - self.add_replica_regions, - ) - - if self.force_overwrite_replica_secret is not None: - serializer.write_boolean( - _SCHEMA_CREATE_SECRET_INPUT.members["ForceOverwriteReplicaSecret"], - self.force_overwrite_replica_secret, - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_CREATE_SECRET_INPUT.members["Type"], self.type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_SECRET_INPUT.members["Name"] - ) - - case 1: - kwargs["client_request_token"] = de.read_string( - _SCHEMA_CREATE_SECRET_INPUT.members["ClientRequestToken"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_CREATE_SECRET_INPUT.members["Description"] - ) - - case 3: - kwargs["kms_key_id"] = de.read_string( - _SCHEMA_CREATE_SECRET_INPUT.members["KmsKeyId"] - ) - - case 4: - kwargs["secret_binary"] = de.read_blob( - _SCHEMA_CREATE_SECRET_INPUT.members["SecretBinary"] - ) - - case 5: - kwargs["secret_string"] = de.read_string( - _SCHEMA_CREATE_SECRET_INPUT.members["SecretString"] - ) - - case 6: - kwargs["tags"] = _deserialize_tag_list_type( - de, _SCHEMA_CREATE_SECRET_INPUT.members["Tags"] - ) - - case 7: - kwargs["add_replica_regions"] = ( - _deserialize_add_replica_region_list_type( - de, _SCHEMA_CREATE_SECRET_INPUT.members["AddReplicaRegions"] - ) - ) - - case 8: - kwargs["force_overwrite_replica_secret"] = de.read_boolean( - _SCHEMA_CREATE_SECRET_INPUT.members[ - "ForceOverwriteReplicaSecret" - ] - ) - - case 9: - kwargs["type"] = de.read_string( - _SCHEMA_CREATE_SECRET_INPUT.members["Type"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_SECRET_INPUT, consumer=_consumer) - return kwargs - - -class StatusType(UnknownEnumMixin, StrEnum): - IN_SYNC = "InSync" - FAILED = "Failed" - IN_PROGRESS = "InProgress" - - -@dataclass(kw_only=True) -class ReplicationStatusType: - """ - A replication object consisting of a `RegionReplicationStatus` object - and includes a Region, KMSKeyId, status, and status message. - """ - - region: str | None = None - """The Region where replication occurs.""" - - kms_key_id: str | None = None - """Can be an `ARN`, `Key ID`, or `Alias`.""" - - status: str | None = None - """The status can be `InProgress`, `Failed`, or `InSync`.""" - - status_message: str | None = None - """ - Status message such as \"*Secret with this name already exists in this - region*\". - """ - - last_accessed_date: datetime | None = None - """ - The date that the secret was last accessed in the Region. This field is - omitted if the secret has never been retrieved in the Region. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REPLICATION_STATUS_TYPE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.region is not None: - serializer.write_string( - _SCHEMA_REPLICATION_STATUS_TYPE.members["Region"], self.region - ) - - if self.kms_key_id is not None: - serializer.write_string( - _SCHEMA_REPLICATION_STATUS_TYPE.members["KmsKeyId"], self.kms_key_id - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_REPLICATION_STATUS_TYPE.members["Status"], self.status - ) - - if self.status_message is not None: - serializer.write_string( - _SCHEMA_REPLICATION_STATUS_TYPE.members["StatusMessage"], - self.status_message, - ) - - if self.last_accessed_date is not None: - serializer.write_timestamp( - _SCHEMA_REPLICATION_STATUS_TYPE.members["LastAccessedDate"], - self.last_accessed_date, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["region"] = de.read_string( - _SCHEMA_REPLICATION_STATUS_TYPE.members["Region"] - ) - - case 1: - kwargs["kms_key_id"] = de.read_string( - _SCHEMA_REPLICATION_STATUS_TYPE.members["KmsKeyId"] - ) - - case 2: - kwargs["status"] = StatusType( - de.read_string( - _SCHEMA_REPLICATION_STATUS_TYPE.members["Status"] - ) - ) - - case 3: - kwargs["status_message"] = de.read_string( - _SCHEMA_REPLICATION_STATUS_TYPE.members["StatusMessage"] - ) - - case 4: - kwargs["last_accessed_date"] = de.read_timestamp( - _SCHEMA_REPLICATION_STATUS_TYPE.members["LastAccessedDate"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_REPLICATION_STATUS_TYPE, consumer=_consumer) - return kwargs - - -def _serialize_replication_status_list_type( - serializer: ShapeSerializer, schema: Schema, value: list[ReplicationStatusType] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_replication_status_list_type( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ReplicationStatusType]: - result: list[ReplicationStatusType] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ReplicationStatusType.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CreateSecretOutput: - """Dataclass for CreateSecretOutput structure.""" - - arn: str | None = None - """ - The ARN of the new secret. The ARN includes the name of the secret - followed by six random characters. This ensures that if you create a new - secret with the same name as a deleted secret, then users with access to - the old secret don't get access to the new secret because the ARNs are - different. - """ - - name: str | None = None - """The name of the new secret.""" - - version_id: str | None = None - """The unique identifier associated with the version of the new secret.""" - - replication_status: list[ReplicationStatusType] | None = None - """ - A list of the replicas of this secret and their status: - - - `Failed`, which indicates that the replica was not created. - - - `InProgress`, which indicates that Secrets Manager is in the process - of creating the replica. - - - `InSync`, which indicates that the replica was created. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_SECRET_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.arn is not None: - serializer.write_string( - _SCHEMA_CREATE_SECRET_OUTPUT.members["ARN"], self.arn - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_SECRET_OUTPUT.members["Name"], self.name - ) - - if self.version_id is not None: - serializer.write_string( - _SCHEMA_CREATE_SECRET_OUTPUT.members["VersionId"], self.version_id - ) - - if self.replication_status is not None: - _serialize_replication_status_list_type( - serializer, - _SCHEMA_CREATE_SECRET_OUTPUT.members["ReplicationStatus"], - self.replication_status, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["arn"] = de.read_string( - _SCHEMA_CREATE_SECRET_OUTPUT.members["ARN"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_SECRET_OUTPUT.members["Name"] - ) - - case 2: - kwargs["version_id"] = de.read_string( - _SCHEMA_CREATE_SECRET_OUTPUT.members["VersionId"] - ) - - case 3: - kwargs["replication_status"] = ( - _deserialize_replication_status_list_type( - de, - _SCHEMA_CREATE_SECRET_OUTPUT.members["ReplicationStatus"], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_SECRET_OUTPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class EncryptionFailure(ServiceError): - """ - Secrets Manager can't encrypt the protected secret text using the - provided KMS key. Check that the KMS key is available, enabled, and not - in an invalid state. For more information, see [Key state: Effect on - your KMS - key](https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html). - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ENCRYPTION_FAILURE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_ENCRYPTION_FAILURE.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_ENCRYPTION_FAILURE.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ENCRYPTION_FAILURE, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class LimitExceededException(ServiceError): - """ - The request failed because it would exceed one of the Secrets Manager - quotas. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIMIT_EXCEEDED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIMIT_EXCEEDED_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class MalformedPolicyDocumentException(ServiceError): - """The resource policy has syntax errors.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MALFORMED_POLICY_DOCUMENT_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_MALFORMED_POLICY_DOCUMENT_EXCEPTION.members["Message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_MALFORMED_POLICY_DOCUMENT_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MALFORMED_POLICY_DOCUMENT_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class PreconditionNotMetException(ServiceError): - """ - The request failed because you did not complete all the prerequisite - steps. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PRECONDITION_NOT_MET_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_PRECONDITION_NOT_MET_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_PRECONDITION_NOT_MET_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PRECONDITION_NOT_MET_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ResourceExistsException(ServiceError): - """A resource with the ID you requested already exists.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESOURCE_EXISTS_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_RESOURCE_EXISTS_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_RESOURCE_EXISTS_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RESOURCE_EXISTS_EXCEPTION, consumer=_consumer) - return kwargs - - -CREATE_SECRET = APIOperation( - input=CreateSecretInput, - output=CreateSecretOutput, - schema=_SCHEMA_CREATE_SECRET, - input_schema=_SCHEMA_CREATE_SECRET_INPUT, - output_schema=_SCHEMA_CREATE_SECRET_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.secretsmanager#DecryptionFailure" - ): DecryptionFailure, - ShapeID( - "com.amazonaws.secretsmanager#EncryptionFailure" - ): EncryptionFailure, - ShapeID( - "com.amazonaws.secretsmanager#InternalServiceError" - ): InternalServiceError, - ShapeID( - "com.amazonaws.secretsmanager#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.secretsmanager#InvalidRequestException" - ): InvalidRequestException, - ShapeID( - "com.amazonaws.secretsmanager#LimitExceededException" - ): LimitExceededException, - ShapeID( - "com.amazonaws.secretsmanager#MalformedPolicyDocumentException" - ): MalformedPolicyDocumentException, - ShapeID( - "com.amazonaws.secretsmanager#PreconditionNotMetException" - ): PreconditionNotMetException, - ShapeID( - "com.amazonaws.secretsmanager#ResourceExistsException" - ): ResourceExistsException, - ShapeID( - "com.amazonaws.secretsmanager#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_DECRYPTION_FAILURE, - _SCHEMA_ENCRYPTION_FAILURE, - _SCHEMA_INTERNAL_SERVICE_ERROR, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_INVALID_REQUEST_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_MALFORMED_POLICY_DOCUMENT_EXCEPTION, - _SCHEMA_PRECONDITION_NOT_MET_EXCEPTION, - _SCHEMA_RESOURCE_EXISTS_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteResourcePolicyInput: - """Dataclass for DeleteResourcePolicyInput structure.""" - - secret_id: str | None = None - """ - The ARN or name of the secret to delete the attached resource-based - policy for. - - For an ARN, we recommend that you specify a complete ARN rather than a - partial ARN. See [Finding a secret from a partial - ARN](https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_RESOURCE_POLICY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.secret_id is not None: - serializer.write_string( - _SCHEMA_DELETE_RESOURCE_POLICY_INPUT.members["SecretId"], self.secret_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["secret_id"] = de.read_string( - _SCHEMA_DELETE_RESOURCE_POLICY_INPUT.members["SecretId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_RESOURCE_POLICY_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteResourcePolicyOutput: - """Dataclass for DeleteResourcePolicyOutput structure.""" - - arn: str | None = None - """The ARN of the secret that the resource-based policy was deleted for.""" - - name: str | None = None - """The name of the secret that the resource-based policy was deleted for.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_RESOURCE_POLICY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.arn is not None: - serializer.write_string( - _SCHEMA_DELETE_RESOURCE_POLICY_OUTPUT.members["ARN"], self.arn - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_DELETE_RESOURCE_POLICY_OUTPUT.members["Name"], self.name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["arn"] = de.read_string( - _SCHEMA_DELETE_RESOURCE_POLICY_OUTPUT.members["ARN"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_DELETE_RESOURCE_POLICY_OUTPUT.members["Name"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_RESOURCE_POLICY_OUTPUT, consumer=_consumer - ) - return kwargs - - -DELETE_RESOURCE_POLICY = APIOperation( - input=DeleteResourcePolicyInput, - output=DeleteResourcePolicyOutput, - schema=_SCHEMA_DELETE_RESOURCE_POLICY, - input_schema=_SCHEMA_DELETE_RESOURCE_POLICY_INPUT, - output_schema=_SCHEMA_DELETE_RESOURCE_POLICY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.secretsmanager#InternalServiceError" - ): InternalServiceError, - ShapeID( - "com.amazonaws.secretsmanager#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.secretsmanager#InvalidRequestException" - ): InvalidRequestException, - ShapeID( - "com.amazonaws.secretsmanager#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_SERVICE_ERROR, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_INVALID_REQUEST_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteSecretInput: - """Dataclass for DeleteSecretInput structure.""" - - secret_id: str | None = None - """ - The ARN or name of the secret to delete. - - For an ARN, we recommend that you specify a complete ARN rather than a - partial ARN. See [Finding a secret from a partial - ARN](https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen). - """ - - recovery_window_in_days: int | None = None - """ - The number of days from 7 to 30 that Secrets Manager waits before - permanently deleting the secret. You can't use both this parameter and - `ForceDeleteWithoutRecovery` in the same call. If you don't use either, - then by default Secrets Manager uses a 30 day recovery window. - """ - - force_delete_without_recovery: bool | None = None - """ - Specifies whether to delete the secret without any recovery window. You - can't use both this parameter and `RecoveryWindowInDays` in the same - call. If you don't use either, then by default Secrets Manager uses a - 30 day recovery window. - - Secrets Manager performs the actual deletion with an asynchronous - background process, so there might be a short delay before the secret is - permanently deleted. If you delete a secret and then immediately create - a secret with the same name, use appropriate back off and retry logic. - - If you forcibly delete an already deleted or nonexistent secret, the - operation does not return `ResourceNotFoundException`. - - Warning: - Use this parameter with caution. This parameter causes the operation to - skip the normal recovery window before the permanent deletion that - Secrets Manager would normally impose with the `RecoveryWindowInDays` - parameter. If you delete a secret with the `ForceDeleteWithoutRecovery` - parameter, then you have no opportunity to recover the secret. You lose - the secret permanently. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_SECRET_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.secret_id is not None: - serializer.write_string( - _SCHEMA_DELETE_SECRET_INPUT.members["SecretId"], self.secret_id - ) - - if self.recovery_window_in_days is not None: - serializer.write_long( - _SCHEMA_DELETE_SECRET_INPUT.members["RecoveryWindowInDays"], - self.recovery_window_in_days, - ) - - if self.force_delete_without_recovery is not None: - serializer.write_boolean( - _SCHEMA_DELETE_SECRET_INPUT.members["ForceDeleteWithoutRecovery"], - self.force_delete_without_recovery, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["secret_id"] = de.read_string( - _SCHEMA_DELETE_SECRET_INPUT.members["SecretId"] - ) - - case 1: - kwargs["recovery_window_in_days"] = de.read_long( - _SCHEMA_DELETE_SECRET_INPUT.members["RecoveryWindowInDays"] - ) - - case 2: - kwargs["force_delete_without_recovery"] = de.read_boolean( - _SCHEMA_DELETE_SECRET_INPUT.members[ - "ForceDeleteWithoutRecovery" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_SECRET_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteSecretOutput: - """Dataclass for DeleteSecretOutput structure.""" - - arn: str | None = None - """The ARN of the secret.""" - - name: str | None = None - """The name of the secret.""" - - deletion_date: datetime | None = None - """ - The date and time after which this secret Secrets Manager can - permanently delete this secret, and it can no longer be restored. This - value is the date and time of the delete request plus the number of days - in `RecoveryWindowInDays`. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_SECRET_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.arn is not None: - serializer.write_string( - _SCHEMA_DELETE_SECRET_OUTPUT.members["ARN"], self.arn - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_DELETE_SECRET_OUTPUT.members["Name"], self.name - ) - - if self.deletion_date is not None: - serializer.write_timestamp( - _SCHEMA_DELETE_SECRET_OUTPUT.members["DeletionDate"], self.deletion_date - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["arn"] = de.read_string( - _SCHEMA_DELETE_SECRET_OUTPUT.members["ARN"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_DELETE_SECRET_OUTPUT.members["Name"] - ) - - case 2: - kwargs["deletion_date"] = de.read_timestamp( - _SCHEMA_DELETE_SECRET_OUTPUT.members["DeletionDate"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_SECRET_OUTPUT, consumer=_consumer) - return kwargs - - -DELETE_SECRET = APIOperation( - input=DeleteSecretInput, - output=DeleteSecretOutput, - schema=_SCHEMA_DELETE_SECRET, - input_schema=_SCHEMA_DELETE_SECRET_INPUT, - output_schema=_SCHEMA_DELETE_SECRET_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.secretsmanager#InternalServiceError" - ): InternalServiceError, - ShapeID( - "com.amazonaws.secretsmanager#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.secretsmanager#InvalidRequestException" - ): InvalidRequestException, - ShapeID( - "com.amazonaws.secretsmanager#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_SERVICE_ERROR, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_INVALID_REQUEST_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DescribeSecretInput: - """Dataclass for DescribeSecretInput structure.""" - - secret_id: str | None = None - """ - The ARN or name of the secret. - - For an ARN, we recommend that you specify a complete ARN rather than a - partial ARN. See [Finding a secret from a partial - ARN](https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DESCRIBE_SECRET_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.secret_id is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_SECRET_INPUT.members["SecretId"], self.secret_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["secret_id"] = de.read_string( - _SCHEMA_DESCRIBE_SECRET_INPUT.members["SecretId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DESCRIBE_SECRET_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ExternalSecretRotationMetadataItem: - """ - The metadata needed to successfully rotate a managed external secret. A - list of key value pairs in JSON format specified by the partner. For - more information, see [Managed external secret - partners](https://docs.aws.amazon.com/secretsmanager/latest/userguide/mes-partners.html). - """ - - key: str | None = None - """The key that identifies the item.""" - - value: str | None = None - """The value of the specified item.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EXTERNAL_SECRET_ROTATION_METADATA_ITEM, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.key is not None: - serializer.write_string( - _SCHEMA_EXTERNAL_SECRET_ROTATION_METADATA_ITEM.members["Key"], self.key - ) - - if self.value is not None: - serializer.write_string( - _SCHEMA_EXTERNAL_SECRET_ROTATION_METADATA_ITEM.members["Value"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["key"] = de.read_string( - _SCHEMA_EXTERNAL_SECRET_ROTATION_METADATA_ITEM.members["Key"] - ) - - case 1: - kwargs["value"] = de.read_string( - _SCHEMA_EXTERNAL_SECRET_ROTATION_METADATA_ITEM.members["Value"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EXTERNAL_SECRET_ROTATION_METADATA_ITEM, consumer=_consumer - ) - return kwargs - - -def _serialize_external_secret_rotation_metadata_type( - serializer: ShapeSerializer, - schema: Schema, - value: list[ExternalSecretRotationMetadataItem], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_external_secret_rotation_metadata_type( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ExternalSecretRotationMetadataItem]: - result: list[ExternalSecretRotationMetadataItem] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ExternalSecretRotationMetadataItem.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class RotationRulesType: - """A structure that defines the rotation configuration for the secret.""" - - automatically_after_days: int | None = None - """ - The number of days between rotations of the secret. You can use this - value to check that your secret meets your compliance guidelines for how - often secrets must be rotated. If you use this field to set the rotation - schedule, Secrets Manager calculates the next rotation date based on the - previous rotation. Manually updating the secret value by calling - `PutSecretValue` or `UpdateSecret` is considered a valid rotation. - - In `DescribeSecret` and `ListSecrets`, this value is calculated from the - rotation schedule after every successful rotation. In `RotateSecret`, - you can set the rotation schedule in `RotationRules` with - `AutomaticallyAfterDays` or `ScheduleExpression`, but not both. To set a - rotation schedule in hours, use `ScheduleExpression`. - """ - - duration: str | None = None - """ - The length of the rotation window in hours, for example `3h` for a three - hour window. Secrets Manager rotates your secret at any time during this - window. The window must not extend into the next rotation window or the - next UTC day. The window starts according to the `ScheduleExpression`. - If you don't specify a `Duration`, for a `ScheduleExpression` in hours, - the window automatically closes after one hour. For a - `ScheduleExpression` in days, the window automatically closes at the end - of the UTC day. For more information, including examples, see [Schedule - expressions in Secrets Manager - rotation](https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_schedule.html) - in the *Secrets Manager Users Guide*. - """ - - schedule_expression: str | None = None - """ - A `cron()` or `rate()` expression that defines the schedule for rotating - your secret. Secrets Manager rotation schedules use UTC time zone. - Secrets Manager rotates your secret any time during a rotation window. - - Secrets Manager `rate()` expressions represent the interval in hours or - days that you want to rotate your secret, for example `rate(12 hours)` - or `rate(10 days)`. You can rotate a secret as often as every four - hours. If you use a `rate()` expression, the rotation window starts at - midnight. For a rate in hours, the default rotation window closes after - one hour. For a rate in days, the default rotation window closes at the - end of the day. You can set the `Duration` to change the rotation - window. The rotation window must not extend into the next UTC day or - into the next rotation window. - - You can use a `cron()` expression to create a rotation schedule that is - more detailed than a rotation interval. For more information, including - examples, see [Schedule expressions in Secrets Manager - rotation](https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_schedule.html) - in the *Secrets Manager Users Guide*. For a cron expression that - represents a schedule in hours, the default rotation window closes after - one hour. For a cron expression that represents a schedule in days, the - default rotation window closes at the end of the day. You can set the - `Duration` to change the rotation window. The rotation window must not - extend into the next UTC day or into the next rotation window. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ROTATION_RULES_TYPE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.automatically_after_days is not None: - serializer.write_long( - _SCHEMA_ROTATION_RULES_TYPE.members["AutomaticallyAfterDays"], - self.automatically_after_days, - ) - - if self.duration is not None: - serializer.write_string( - _SCHEMA_ROTATION_RULES_TYPE.members["Duration"], self.duration - ) - - if self.schedule_expression is not None: - serializer.write_string( - _SCHEMA_ROTATION_RULES_TYPE.members["ScheduleExpression"], - self.schedule_expression, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["automatically_after_days"] = de.read_long( - _SCHEMA_ROTATION_RULES_TYPE.members["AutomaticallyAfterDays"] - ) - - case 1: - kwargs["duration"] = de.read_string( - _SCHEMA_ROTATION_RULES_TYPE.members["Duration"] - ) - - case 2: - kwargs["schedule_expression"] = de.read_string( - _SCHEMA_ROTATION_RULES_TYPE.members["ScheduleExpression"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ROTATION_RULES_TYPE, consumer=_consumer) - return kwargs - - -def _serialize_secret_versions_to_stages_map_type( - serializer: ShapeSerializer, schema: Schema, value: dict[str, list[str]] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry( - k, lambda vs: _serialize_secret_version_stages_type(vs, value_schema, v) - ) - - -def _deserialize_secret_versions_to_stages_map_type( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, list[str]]: - result: dict[str, list[str]] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = _deserialize_secret_version_stages_type(d, value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class DescribeSecretOutput: - """Dataclass for DescribeSecretOutput structure.""" - - arn: str | None = None - """The ARN of the secret.""" - - name: str | None = None - """The name of the secret.""" - - type: str | None = None - """ - The exact string that identifies the partner that holds the external - secret. For more information, see [Using Secrets Manager managed - external - secrets](https://docs.aws.amazon.com/secretsmanager/latest/userguide/managed-external-secrets.html). - """ - - description: str | None = None - """The description of the secret.""" - - kms_key_id: str | None = None - """ - The key ID or alias ARN of the KMS key that Secrets Manager uses to - encrypt the secret value. If the secret is encrypted with the Amazon Web - Services managed key `aws/secretsmanager`, this field is omitted. - Secrets created using the console use an KMS key ID. - """ - - rotation_enabled: bool | None = None - """ - Specifies whether automatic rotation is turned on for this secret. If - the secret has never been configured for rotation, Secrets Manager - returns null. - - To turn on rotation, use RotateSecret. To turn off rotation, use - CancelRotateSecret. - """ - - rotation_lambda_arn: str | None = None - """ - The ARN of the Lambda function that Secrets Manager invokes to rotate - the secret. - """ - - rotation_rules: RotationRulesType | None = None - """ - The rotation schedule and Lambda function for this secret. If the secret - previously had rotation turned on, but it is now turned off, this field - shows the previous rotation schedule and rotation function. If the - secret never had rotation turned on, this field is omitted. - """ - - external_secret_rotation_metadata: ( - list[ExternalSecretRotationMetadataItem] | None - ) = None - """ - The metadata needed to successfully rotate a managed external secret. A - list of key value pairs in JSON format specified by the partner. For - more information about the required information, see [Managed external - secrets - partners](https://docs.aws.amazon.com/secretsmanager/latest/userguide/mes-partners.html). - """ - - external_secret_rotation_role_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the role that allows Secrets Manager - to rotate a secret held by a third-party partner. For more information, - see [Security and - permissions](https://docs.aws.amazon.com/secretsmanager/latest/userguide/mes-security.html). - """ - - last_rotated_date: datetime | None = None - """ - The last date and time that Secrets Manager rotated the secret. If the - secret isn't configured for rotation or rotation has been disabled, - Secrets Manager returns null. - """ - - last_changed_date: datetime | None = None - """The last date and time that this secret was modified in any way.""" - - last_accessed_date: datetime | None = None - """ - The date that the secret was last accessed in the Region. This field is - omitted if the secret has never been retrieved in the Region. - """ - - deleted_date: datetime | None = None - """ - The date the secret is scheduled for deletion. If it is not scheduled - for deletion, this field is omitted. When you delete a secret, Secrets - Manager requires a recovery window of at least 7 days before deleting - the secret. Some time after the deleted date, Secrets Manager deletes - the secret, including all of its versions. - - If a secret is scheduled for deletion, then its details, including the - encrypted secret value, is not accessible. To cancel a scheduled - deletion and restore access to the secret, use RestoreSecret. - """ - - next_rotation_date: datetime | None = None - """ - The next rotation is scheduled to occur on or before this date. If the - secret isn't configured for rotation or rotation has been disabled, - Secrets Manager returns null. If rotation fails, Secrets Manager retries - the entire rotation process multiple times. If rotation is unsuccessful, - this date may be in the past. - - This date represents the latest date that rotation will occur, but it is - not an approximate rotation date. In some cases, for example if you turn - off automatic rotation and then turn it back on, the next rotation may - occur much sooner than this date. - """ - - tags: list[Tag] | None = None - """ - The list of tags attached to the secret. To add tags to a secret, use - TagResource. To remove tags, use UntagResource. - """ - - version_ids_to_stages: dict[str, list[str]] | None = None - """ - A list of the versions of the secret that have staging labels attached. - Versions that don't have staging labels are considered deprecated and - Secrets Manager can delete them. - - Secrets Manager uses staging labels to indicate the status of a secret - version during rotation. The three staging labels for rotation are: - - - `AWSCURRENT`, which indicates the current version of the secret. - - - `AWSPENDING`, which indicates the version of the secret that contains - new secret information that will become the next current version when - rotation finishes. - - During rotation, Secrets Manager creates an `AWSPENDING` version ID - before creating the new secret version. To check if a secret version - exists, call GetSecretValue. - - - `AWSPREVIOUS`, which indicates the previous current version of the - secret. You can use this as the *last known good* version. - - For more information about rotation and staging labels, see [How - rotation - works](https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_how.html). - """ - - owning_service: str | None = None - """ - The ID of the service that created this secret. For more information, - see [Secrets managed by other Amazon Web Services - services](https://docs.aws.amazon.com/secretsmanager/latest/userguide/service-linked-secrets.html). - """ - - created_date: datetime | None = None - """The date the secret was created.""" - - primary_region: str | None = None - """ - The Region the secret is in. If a secret is replicated to other Regions, - the replicas are listed in `ReplicationStatus`. - """ - - replication_status: list[ReplicationStatusType] | None = None - """ - A list of the replicas of this secret and their status: - - - `Failed`, which indicates that the replica was not created. - - - `InProgress`, which indicates that Secrets Manager is in the process - of creating the replica. - - - `InSync`, which indicates that the replica was created. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DESCRIBE_SECRET_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.arn is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_SECRET_OUTPUT.members["ARN"], self.arn - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_SECRET_OUTPUT.members["Name"], self.name - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_SECRET_OUTPUT.members["Type"], self.type - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_SECRET_OUTPUT.members["Description"], self.description - ) - - if self.kms_key_id is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_SECRET_OUTPUT.members["KmsKeyId"], self.kms_key_id - ) - - if self.rotation_enabled is not None: - serializer.write_boolean( - _SCHEMA_DESCRIBE_SECRET_OUTPUT.members["RotationEnabled"], - self.rotation_enabled, - ) - - if self.rotation_lambda_arn is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_SECRET_OUTPUT.members["RotationLambdaARN"], - self.rotation_lambda_arn, - ) - - if self.rotation_rules is not None: - serializer.write_struct( - _SCHEMA_DESCRIBE_SECRET_OUTPUT.members["RotationRules"], - self.rotation_rules, - ) - - if self.external_secret_rotation_metadata is not None: - _serialize_external_secret_rotation_metadata_type( - serializer, - _SCHEMA_DESCRIBE_SECRET_OUTPUT.members[ - "ExternalSecretRotationMetadata" - ], - self.external_secret_rotation_metadata, - ) - - if self.external_secret_rotation_role_arn is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_SECRET_OUTPUT.members["ExternalSecretRotationRoleArn"], - self.external_secret_rotation_role_arn, - ) - - if self.last_rotated_date is not None: - serializer.write_timestamp( - _SCHEMA_DESCRIBE_SECRET_OUTPUT.members["LastRotatedDate"], - self.last_rotated_date, - ) - - if self.last_changed_date is not None: - serializer.write_timestamp( - _SCHEMA_DESCRIBE_SECRET_OUTPUT.members["LastChangedDate"], - self.last_changed_date, - ) - - if self.last_accessed_date is not None: - serializer.write_timestamp( - _SCHEMA_DESCRIBE_SECRET_OUTPUT.members["LastAccessedDate"], - self.last_accessed_date, - ) - - if self.deleted_date is not None: - serializer.write_timestamp( - _SCHEMA_DESCRIBE_SECRET_OUTPUT.members["DeletedDate"], self.deleted_date - ) - - if self.next_rotation_date is not None: - serializer.write_timestamp( - _SCHEMA_DESCRIBE_SECRET_OUTPUT.members["NextRotationDate"], - self.next_rotation_date, - ) - - if self.tags is not None: - _serialize_tag_list_type( - serializer, _SCHEMA_DESCRIBE_SECRET_OUTPUT.members["Tags"], self.tags - ) - - if self.version_ids_to_stages is not None: - _serialize_secret_versions_to_stages_map_type( - serializer, - _SCHEMA_DESCRIBE_SECRET_OUTPUT.members["VersionIdsToStages"], - self.version_ids_to_stages, - ) - - if self.owning_service is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_SECRET_OUTPUT.members["OwningService"], - self.owning_service, - ) - - if self.created_date is not None: - serializer.write_timestamp( - _SCHEMA_DESCRIBE_SECRET_OUTPUT.members["CreatedDate"], self.created_date - ) - - if self.primary_region is not None: - serializer.write_string( - _SCHEMA_DESCRIBE_SECRET_OUTPUT.members["PrimaryRegion"], - self.primary_region, - ) - - if self.replication_status is not None: - _serialize_replication_status_list_type( - serializer, - _SCHEMA_DESCRIBE_SECRET_OUTPUT.members["ReplicationStatus"], - self.replication_status, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["arn"] = de.read_string( - _SCHEMA_DESCRIBE_SECRET_OUTPUT.members["ARN"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_DESCRIBE_SECRET_OUTPUT.members["Name"] - ) - - case 2: - kwargs["type"] = de.read_string( - _SCHEMA_DESCRIBE_SECRET_OUTPUT.members["Type"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_DESCRIBE_SECRET_OUTPUT.members["Description"] - ) - - case 4: - kwargs["kms_key_id"] = de.read_string( - _SCHEMA_DESCRIBE_SECRET_OUTPUT.members["KmsKeyId"] - ) - - case 5: - kwargs["rotation_enabled"] = de.read_boolean( - _SCHEMA_DESCRIBE_SECRET_OUTPUT.members["RotationEnabled"] - ) - - case 6: - kwargs["rotation_lambda_arn"] = de.read_string( - _SCHEMA_DESCRIBE_SECRET_OUTPUT.members["RotationLambdaARN"] - ) - - case 7: - kwargs["rotation_rules"] = RotationRulesType.deserialize(de) - - case 8: - kwargs["external_secret_rotation_metadata"] = ( - _deserialize_external_secret_rotation_metadata_type( - de, - _SCHEMA_DESCRIBE_SECRET_OUTPUT.members[ - "ExternalSecretRotationMetadata" - ], - ) - ) - - case 9: - kwargs["external_secret_rotation_role_arn"] = de.read_string( - _SCHEMA_DESCRIBE_SECRET_OUTPUT.members[ - "ExternalSecretRotationRoleArn" - ] - ) - - case 10: - kwargs["last_rotated_date"] = de.read_timestamp( - _SCHEMA_DESCRIBE_SECRET_OUTPUT.members["LastRotatedDate"] - ) - - case 11: - kwargs["last_changed_date"] = de.read_timestamp( - _SCHEMA_DESCRIBE_SECRET_OUTPUT.members["LastChangedDate"] - ) - - case 12: - kwargs["last_accessed_date"] = de.read_timestamp( - _SCHEMA_DESCRIBE_SECRET_OUTPUT.members["LastAccessedDate"] - ) - - case 13: - kwargs["deleted_date"] = de.read_timestamp( - _SCHEMA_DESCRIBE_SECRET_OUTPUT.members["DeletedDate"] - ) - - case 14: - kwargs["next_rotation_date"] = de.read_timestamp( - _SCHEMA_DESCRIBE_SECRET_OUTPUT.members["NextRotationDate"] - ) - - case 15: - kwargs["tags"] = _deserialize_tag_list_type( - de, _SCHEMA_DESCRIBE_SECRET_OUTPUT.members["Tags"] - ) - - case 16: - kwargs["version_ids_to_stages"] = ( - _deserialize_secret_versions_to_stages_map_type( - de, - _SCHEMA_DESCRIBE_SECRET_OUTPUT.members[ - "VersionIdsToStages" - ], - ) - ) - - case 17: - kwargs["owning_service"] = de.read_string( - _SCHEMA_DESCRIBE_SECRET_OUTPUT.members["OwningService"] - ) - - case 18: - kwargs["created_date"] = de.read_timestamp( - _SCHEMA_DESCRIBE_SECRET_OUTPUT.members["CreatedDate"] - ) - - case 19: - kwargs["primary_region"] = de.read_string( - _SCHEMA_DESCRIBE_SECRET_OUTPUT.members["PrimaryRegion"] - ) - - case 20: - kwargs["replication_status"] = ( - _deserialize_replication_status_list_type( - de, - _SCHEMA_DESCRIBE_SECRET_OUTPUT.members["ReplicationStatus"], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DESCRIBE_SECRET_OUTPUT, consumer=_consumer) - return kwargs - - -DESCRIBE_SECRET = APIOperation( - input=DescribeSecretInput, - output=DescribeSecretOutput, - schema=_SCHEMA_DESCRIBE_SECRET, - input_schema=_SCHEMA_DESCRIBE_SECRET_INPUT, - output_schema=_SCHEMA_DESCRIBE_SECRET_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.secretsmanager#InternalServiceError" - ): InternalServiceError, - ShapeID( - "com.amazonaws.secretsmanager#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.secretsmanager#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_SERVICE_ERROR, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetRandomPasswordInput: - """Dataclass for GetRandomPasswordInput structure.""" - - password_length: int | None = None - """ - The length of the password. If you don't include this parameter, the - default length is 32 characters. - """ - - exclude_characters: str | None = None - """A string of the characters that you don't want in the password.""" - - exclude_numbers: bool | None = None - """ - Specifies whether to exclude numbers from the password. If you don't - include this switch, the password can contain numbers. - """ - - exclude_punctuation: bool | None = None - """ - Specifies whether to exclude the following punctuation characters from - the password: - `` ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \\ ] ^ _ ` { | } ~ ``. - If you don't include this switch, the password can contain punctuation. - """ - - exclude_uppercase: bool | None = None - """ - Specifies whether to exclude uppercase letters from the password. If you - don't include this switch, the password can contain uppercase letters. - """ - - exclude_lowercase: bool | None = None - """ - Specifies whether to exclude lowercase letters from the password. If you - don't include this switch, the password can contain lowercase letters. - """ - - include_space: bool | None = None - """ - Specifies whether to include the space character. If you include this - switch, the password can contain space characters. - """ - - require_each_included_type: bool | None = None - """ - Specifies whether to include at least one upper and lowercase letter, - one number, and one punctuation. If you don't include this switch, the - password contains at least one of every character type. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_RANDOM_PASSWORD_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.password_length is not None: - serializer.write_long( - _SCHEMA_GET_RANDOM_PASSWORD_INPUT.members["PasswordLength"], - self.password_length, - ) - - if self.exclude_characters is not None: - serializer.write_string( - _SCHEMA_GET_RANDOM_PASSWORD_INPUT.members["ExcludeCharacters"], - self.exclude_characters, - ) - - if self.exclude_numbers is not None: - serializer.write_boolean( - _SCHEMA_GET_RANDOM_PASSWORD_INPUT.members["ExcludeNumbers"], - self.exclude_numbers, - ) - - if self.exclude_punctuation is not None: - serializer.write_boolean( - _SCHEMA_GET_RANDOM_PASSWORD_INPUT.members["ExcludePunctuation"], - self.exclude_punctuation, - ) - - if self.exclude_uppercase is not None: - serializer.write_boolean( - _SCHEMA_GET_RANDOM_PASSWORD_INPUT.members["ExcludeUppercase"], - self.exclude_uppercase, - ) - - if self.exclude_lowercase is not None: - serializer.write_boolean( - _SCHEMA_GET_RANDOM_PASSWORD_INPUT.members["ExcludeLowercase"], - self.exclude_lowercase, - ) - - if self.include_space is not None: - serializer.write_boolean( - _SCHEMA_GET_RANDOM_PASSWORD_INPUT.members["IncludeSpace"], - self.include_space, - ) - - if self.require_each_included_type is not None: - serializer.write_boolean( - _SCHEMA_GET_RANDOM_PASSWORD_INPUT.members["RequireEachIncludedType"], - self.require_each_included_type, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["password_length"] = de.read_long( - _SCHEMA_GET_RANDOM_PASSWORD_INPUT.members["PasswordLength"] - ) - - case 1: - kwargs["exclude_characters"] = de.read_string( - _SCHEMA_GET_RANDOM_PASSWORD_INPUT.members["ExcludeCharacters"] - ) - - case 2: - kwargs["exclude_numbers"] = de.read_boolean( - _SCHEMA_GET_RANDOM_PASSWORD_INPUT.members["ExcludeNumbers"] - ) - - case 3: - kwargs["exclude_punctuation"] = de.read_boolean( - _SCHEMA_GET_RANDOM_PASSWORD_INPUT.members["ExcludePunctuation"] - ) - - case 4: - kwargs["exclude_uppercase"] = de.read_boolean( - _SCHEMA_GET_RANDOM_PASSWORD_INPUT.members["ExcludeUppercase"] - ) - - case 5: - kwargs["exclude_lowercase"] = de.read_boolean( - _SCHEMA_GET_RANDOM_PASSWORD_INPUT.members["ExcludeLowercase"] - ) - - case 6: - kwargs["include_space"] = de.read_boolean( - _SCHEMA_GET_RANDOM_PASSWORD_INPUT.members["IncludeSpace"] - ) - - case 7: - kwargs["require_each_included_type"] = de.read_boolean( - _SCHEMA_GET_RANDOM_PASSWORD_INPUT.members[ - "RequireEachIncludedType" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_RANDOM_PASSWORD_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetRandomPasswordOutput: - """Dataclass for GetRandomPasswordOutput structure.""" - - random_password: str | None = field(repr=False, default=None) - """A string with the password.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_RANDOM_PASSWORD_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.random_password is not None: - serializer.write_string( - _SCHEMA_GET_RANDOM_PASSWORD_OUTPUT.members["RandomPassword"], - self.random_password, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["random_password"] = de.read_string( - _SCHEMA_GET_RANDOM_PASSWORD_OUTPUT.members["RandomPassword"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_RANDOM_PASSWORD_OUTPUT, consumer=_consumer) - return kwargs - - -GET_RANDOM_PASSWORD = APIOperation( - input=GetRandomPasswordInput, - output=GetRandomPasswordOutput, - schema=_SCHEMA_GET_RANDOM_PASSWORD, - input_schema=_SCHEMA_GET_RANDOM_PASSWORD_INPUT, - output_schema=_SCHEMA_GET_RANDOM_PASSWORD_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.secretsmanager#InternalServiceError" - ): InternalServiceError, - ShapeID( - "com.amazonaws.secretsmanager#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.secretsmanager#InvalidRequestException" - ): InvalidRequestException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_SERVICE_ERROR, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_INVALID_REQUEST_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetResourcePolicyInput: - """Dataclass for GetResourcePolicyInput structure.""" - - secret_id: str | None = None - """ - The ARN or name of the secret to retrieve the attached resource-based - policy for. - - For an ARN, we recommend that you specify a complete ARN rather than a - partial ARN. See [Finding a secret from a partial - ARN](https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_RESOURCE_POLICY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.secret_id is not None: - serializer.write_string( - _SCHEMA_GET_RESOURCE_POLICY_INPUT.members["SecretId"], self.secret_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["secret_id"] = de.read_string( - _SCHEMA_GET_RESOURCE_POLICY_INPUT.members["SecretId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_RESOURCE_POLICY_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetResourcePolicyOutput: - """Dataclass for GetResourcePolicyOutput structure.""" - - arn: str | None = None - """The ARN of the secret that the resource-based policy was retrieved for.""" - - name: str | None = None - """The name of the secret that the resource-based policy was retrieved for.""" - - resource_policy: str | None = None - """ - A JSON-formatted string that contains the permissions policy attached to - the secret. For more information about permissions policies, see - [Authentication and access control for Secrets - Manager](https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html). - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_RESOURCE_POLICY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.arn is not None: - serializer.write_string( - _SCHEMA_GET_RESOURCE_POLICY_OUTPUT.members["ARN"], self.arn - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_GET_RESOURCE_POLICY_OUTPUT.members["Name"], self.name - ) - - if self.resource_policy is not None: - serializer.write_string( - _SCHEMA_GET_RESOURCE_POLICY_OUTPUT.members["ResourcePolicy"], - self.resource_policy, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["arn"] = de.read_string( - _SCHEMA_GET_RESOURCE_POLICY_OUTPUT.members["ARN"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_GET_RESOURCE_POLICY_OUTPUT.members["Name"] - ) - - case 2: - kwargs["resource_policy"] = de.read_string( - _SCHEMA_GET_RESOURCE_POLICY_OUTPUT.members["ResourcePolicy"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_RESOURCE_POLICY_OUTPUT, consumer=_consumer) - return kwargs - - -GET_RESOURCE_POLICY = APIOperation( - input=GetResourcePolicyInput, - output=GetResourcePolicyOutput, - schema=_SCHEMA_GET_RESOURCE_POLICY, - input_schema=_SCHEMA_GET_RESOURCE_POLICY_INPUT, - output_schema=_SCHEMA_GET_RESOURCE_POLICY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.secretsmanager#InternalServiceError" - ): InternalServiceError, - ShapeID( - "com.amazonaws.secretsmanager#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.secretsmanager#InvalidRequestException" - ): InvalidRequestException, - ShapeID( - "com.amazonaws.secretsmanager#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_SERVICE_ERROR, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_INVALID_REQUEST_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetSecretValueInput: - """Dataclass for GetSecretValueInput structure.""" - - secret_id: str | None = None - """ - The ARN or name of the secret to retrieve. To retrieve a secret from - another account, you must use an ARN. - - For an ARN, we recommend that you specify a complete ARN rather than a - partial ARN. See [Finding a secret from a partial - ARN](https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen). - """ - - version_id: str | None = None - """ - The unique identifier of the version of the secret to retrieve. If you - include both this parameter and `VersionStage`, the two parameters must - refer to the same secret version. If you don't specify either a - `VersionStage` or `VersionId`, then Secrets Manager returns the - `AWSCURRENT` version. - - This value is typically a - [UUID-type](https://wikipedia.org/wiki/Universally_unique_identifier) - value with 32 hexadecimal digits. - """ - - version_stage: str | None = None - """ - The staging label of the version of the secret to retrieve. - - Secrets Manager uses staging labels to keep track of different versions - during the rotation process. If you include both this parameter and - `VersionId`, the two parameters must refer to the same secret version. - If you don't specify either a `VersionStage` or `VersionId`, Secrets - Manager returns the `AWSCURRENT` version. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_SECRET_VALUE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.secret_id is not None: - serializer.write_string( - _SCHEMA_GET_SECRET_VALUE_INPUT.members["SecretId"], self.secret_id - ) - - if self.version_id is not None: - serializer.write_string( - _SCHEMA_GET_SECRET_VALUE_INPUT.members["VersionId"], self.version_id - ) - - if self.version_stage is not None: - serializer.write_string( - _SCHEMA_GET_SECRET_VALUE_INPUT.members["VersionStage"], - self.version_stage, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["secret_id"] = de.read_string( - _SCHEMA_GET_SECRET_VALUE_INPUT.members["SecretId"] - ) - - case 1: - kwargs["version_id"] = de.read_string( - _SCHEMA_GET_SECRET_VALUE_INPUT.members["VersionId"] - ) - - case 2: - kwargs["version_stage"] = de.read_string( - _SCHEMA_GET_SECRET_VALUE_INPUT.members["VersionStage"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_SECRET_VALUE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetSecretValueOutput: - """Dataclass for GetSecretValueOutput structure.""" - - arn: str | None = None - """The ARN of the secret.""" - - name: str | None = None - """The friendly name of the secret.""" - - version_id: str | None = None - """The unique identifier of this version of the secret.""" - - secret_binary: bytes | None = field(repr=False, default=None) - """ - The decrypted secret value, if the secret value was originally provided - as binary data in the form of a byte array. When you retrieve a - `SecretBinary` using the HTTP API, the Python SDK, or the Amazon Web - Services CLI, the value is Base64-encoded. Otherwise, it is not encoded. - - If the secret was created by using the Secrets Manager console, or if - the secret value was originally provided as a string, then this field is - omitted. The secret value appears in `SecretString` instead. - - Sensitive: This field contains sensitive information, so the service - does not include it in CloudTrail log entries. If you create your own - log entries, you must also avoid logging the information in this field. - """ - - secret_string: str | None = field(repr=False, default=None) - """ - The decrypted secret value, if the secret value was originally provided - as a string or through the Secrets Manager console. - - If this secret was created by using the console, then Secrets Manager - stores the information as a JSON structure of key/value pairs. - - Sensitive: This field contains sensitive information, so the service - does not include it in CloudTrail log entries. If you create your own - log entries, you must also avoid logging the information in this field. - """ - - version_stages: list[str] | None = None - """ - A list of all of the staging labels currently attached to this version - of the secret. - """ - - created_date: datetime | None = None - """ - The date and time that this version of the secret was created. If you - don't specify which version in `VersionId` or `VersionStage`, then - Secrets Manager uses the `AWSCURRENT` version. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_SECRET_VALUE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.arn is not None: - serializer.write_string( - _SCHEMA_GET_SECRET_VALUE_OUTPUT.members["ARN"], self.arn - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_GET_SECRET_VALUE_OUTPUT.members["Name"], self.name - ) - - if self.version_id is not None: - serializer.write_string( - _SCHEMA_GET_SECRET_VALUE_OUTPUT.members["VersionId"], self.version_id - ) - - if self.secret_binary is not None: - serializer.write_blob( - _SCHEMA_GET_SECRET_VALUE_OUTPUT.members["SecretBinary"], - self.secret_binary, - ) - - if self.secret_string is not None: - serializer.write_string( - _SCHEMA_GET_SECRET_VALUE_OUTPUT.members["SecretString"], - self.secret_string, - ) - - if self.version_stages is not None: - _serialize_secret_version_stages_type( - serializer, - _SCHEMA_GET_SECRET_VALUE_OUTPUT.members["VersionStages"], - self.version_stages, - ) - - if self.created_date is not None: - serializer.write_timestamp( - _SCHEMA_GET_SECRET_VALUE_OUTPUT.members["CreatedDate"], - self.created_date, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["arn"] = de.read_string( - _SCHEMA_GET_SECRET_VALUE_OUTPUT.members["ARN"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_GET_SECRET_VALUE_OUTPUT.members["Name"] - ) - - case 2: - kwargs["version_id"] = de.read_string( - _SCHEMA_GET_SECRET_VALUE_OUTPUT.members["VersionId"] - ) - - case 3: - kwargs["secret_binary"] = de.read_blob( - _SCHEMA_GET_SECRET_VALUE_OUTPUT.members["SecretBinary"] - ) - - case 4: - kwargs["secret_string"] = de.read_string( - _SCHEMA_GET_SECRET_VALUE_OUTPUT.members["SecretString"] - ) - - case 5: - kwargs["version_stages"] = _deserialize_secret_version_stages_type( - de, _SCHEMA_GET_SECRET_VALUE_OUTPUT.members["VersionStages"] - ) - - case 6: - kwargs["created_date"] = de.read_timestamp( - _SCHEMA_GET_SECRET_VALUE_OUTPUT.members["CreatedDate"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_SECRET_VALUE_OUTPUT, consumer=_consumer) - return kwargs - - -GET_SECRET_VALUE = APIOperation( - input=GetSecretValueInput, - output=GetSecretValueOutput, - schema=_SCHEMA_GET_SECRET_VALUE, - input_schema=_SCHEMA_GET_SECRET_VALUE_INPUT, - output_schema=_SCHEMA_GET_SECRET_VALUE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.secretsmanager#DecryptionFailure" - ): DecryptionFailure, - ShapeID( - "com.amazonaws.secretsmanager#InternalServiceError" - ): InternalServiceError, - ShapeID( - "com.amazonaws.secretsmanager#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.secretsmanager#InvalidRequestException" - ): InvalidRequestException, - ShapeID( - "com.amazonaws.secretsmanager#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_DECRYPTION_FAILURE, - _SCHEMA_INTERNAL_SERVICE_ERROR, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_INVALID_REQUEST_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - ], -) - - -def _serialize_kms_key_id_list_type( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_kms_key_id_list_type( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -class SortByType(UnknownEnumMixin, StrEnum): - CREATED_DATE = "created-date" - LAST_ACCESSED_DATE = "last-accessed-date" - LAST_CHANGED_DATE = "last-changed-date" - NAME = "name" - - -class SortOrderType(UnknownEnumMixin, StrEnum): - ASC = "asc" - DESC = "desc" - - -@dataclass(kw_only=True) -class ListSecretsInput: - """Dataclass for ListSecretsInput structure.""" - - include_planned_deletion: bool | None = None - """ - Specifies whether to include secrets scheduled for deletion. By default, - secrets scheduled for deletion aren't included. - """ - - max_results: int | None = None - """ - The number of results to include in the response. - - If there are more results available, in the response, Secrets Manager - includes `NextToken`. To get the next results, call `ListSecrets` again - with the value from `NextToken`. - """ - - next_token: str | None = None - """ - A token that indicates where the output should continue from, if a - previous call did not show all results. To get the next results, call - `ListSecrets` again with this value. - """ - - filters: list[Filter] | None = None - """The filters to apply to the list of secrets.""" - - sort_order: str | None = None - """Secrets are listed by `CreatedDate`.""" - - sort_by: str | None = None - """If not specified, secrets are listed by `CreatedDate`.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_SECRETS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.include_planned_deletion is not None: - serializer.write_boolean( - _SCHEMA_LIST_SECRETS_INPUT.members["IncludePlannedDeletion"], - self.include_planned_deletion, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_SECRETS_INPUT.members["MaxResults"], self.max_results - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_SECRETS_INPUT.members["NextToken"], self.next_token - ) - - if self.filters is not None: - _serialize_filters_list_type( - serializer, _SCHEMA_LIST_SECRETS_INPUT.members["Filters"], self.filters - ) - - if self.sort_order is not None: - serializer.write_string( - _SCHEMA_LIST_SECRETS_INPUT.members["SortOrder"], self.sort_order - ) - - if self.sort_by is not None: - serializer.write_string( - _SCHEMA_LIST_SECRETS_INPUT.members["SortBy"], self.sort_by - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["include_planned_deletion"] = de.read_boolean( - _SCHEMA_LIST_SECRETS_INPUT.members["IncludePlannedDeletion"] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_SECRETS_INPUT.members["MaxResults"] - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_SECRETS_INPUT.members["NextToken"] - ) - - case 3: - kwargs["filters"] = _deserialize_filters_list_type( - de, _SCHEMA_LIST_SECRETS_INPUT.members["Filters"] - ) - - case 4: - kwargs["sort_order"] = SortOrderType( - de.read_string(_SCHEMA_LIST_SECRETS_INPUT.members["SortOrder"]) - ) - - case 5: - kwargs["sort_by"] = SortByType( - de.read_string(_SCHEMA_LIST_SECRETS_INPUT.members["SortBy"]) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_SECRETS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class SecretListEntry: - """ - A structure that contains the details about a secret. It does not - include the encrypted `SecretString` and `SecretBinary` values. To get - those values, use - [GetSecretValue](https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_GetSecretValue.html) - . - """ - - arn: str | None = None - """The Amazon Resource Name (ARN) of the secret.""" - - name: str | None = None - """The friendly name of the secret.""" - - type: str | None = None - """ - The exact string that identifies the third-party partner that holds the - external secret. For more information, see [Managed external secret - partners](https://docs.aws.amazon.com/secretsmanager/latest/userguide/mes-partners.html). - """ - - description: str | None = None - """The user-provided description of the secret.""" - - kms_key_id: str | None = None - """ - The ARN of the KMS key that Secrets Manager uses to encrypt the secret - value. If the secret is encrypted with the Amazon Web Services managed - key `aws/secretsmanager`, this field is omitted. - """ - - rotation_enabled: bool | None = None - """ - Indicates whether automatic, scheduled rotation is enabled for this - secret. - """ - - rotation_lambda_arn: str | None = None - """ - The ARN of an Amazon Web Services Lambda function invoked by Secrets - Manager to rotate and expire the secret either automatically per the - schedule or manually by a call to - [`RotateSecret`](https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_RotateSecret.html) - . - """ - - rotation_rules: RotationRulesType | None = None - """A structure that defines the rotation configuration for the secret.""" - - external_secret_rotation_metadata: ( - list[ExternalSecretRotationMetadataItem] | None - ) = None - """ - The metadata needed to successfully rotate a managed external secret. A - list of key value pairs in JSON format specified by the partner. For - more information about the required information, see [Managed external - secrets - partners](https://docs.aws.amazon.com/secretsmanager/latest/userguide/mes-partners.html). - """ - - external_secret_rotation_role_arn: str | None = None - """ - The role that Secrets Manager assumes to call APIs required to perform - the rotation. For more information about the required information, see - [Managed external secrets - partners](https://docs.aws.amazon.com/secretsmanager/latest/userguide/mes-partners.html). - """ - - last_rotated_date: datetime | None = None - """ - The most recent date and time that the Secrets Manager rotation process - was successfully completed. This value is null if the secret hasn't - ever rotated. - """ - - last_changed_date: datetime | None = None - """The last date and time that this secret was modified in any way.""" - - last_accessed_date: datetime | None = None - """ - The date that the secret was last accessed in the Region. This field is - omitted if the secret has never been retrieved in the Region. - """ - - deleted_date: datetime | None = None - """ - The date and time the deletion of the secret occurred. Not present on - active secrets. The secret can be recovered until the number of days in - the recovery window has passed, as specified in the - `RecoveryWindowInDays` parameter of the - [`DeleteSecret`](https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_DeleteSecret.html) - operation. - """ - - next_rotation_date: datetime | None = None - """ - The next rotation is scheduled to occur on or before this date. If the - secret isn't configured for rotation or rotation has been disabled, - Secrets Manager returns null. - """ - - tags: list[Tag] | None = None - """ - The list of user-defined tags associated with the secret. To add tags to - a secret, use - [`TagResource`](https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_TagResource.html) - . To remove tags, use - [`UntagResource`](https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_UntagResource.html) - . - """ - - secret_versions_to_stages: dict[str, list[str]] | None = None - """ - A list of all of the currently assigned `SecretVersionStage` staging - labels and the `SecretVersionId` attached to each one. Staging labels - are used to keep track of the different versions during the rotation - process. - - Note: - A version that does not have any `SecretVersionStage` is considered - deprecated and subject to deletion. Such versions are not included in - this list. - """ - - owning_service: str | None = None - """Returns the name of the service that created the secret.""" - - created_date: datetime | None = None - """The date and time when a secret was created.""" - - primary_region: str | None = None - """The Region where Secrets Manager originated the secret.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SECRET_LIST_ENTRY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.arn is not None: - serializer.write_string(_SCHEMA_SECRET_LIST_ENTRY.members["ARN"], self.arn) - - if self.name is not None: - serializer.write_string( - _SCHEMA_SECRET_LIST_ENTRY.members["Name"], self.name - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_SECRET_LIST_ENTRY.members["Type"], self.type - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_SECRET_LIST_ENTRY.members["Description"], self.description - ) - - if self.kms_key_id is not None: - serializer.write_string( - _SCHEMA_SECRET_LIST_ENTRY.members["KmsKeyId"], self.kms_key_id - ) - - if self.rotation_enabled is not None: - serializer.write_boolean( - _SCHEMA_SECRET_LIST_ENTRY.members["RotationEnabled"], - self.rotation_enabled, - ) - - if self.rotation_lambda_arn is not None: - serializer.write_string( - _SCHEMA_SECRET_LIST_ENTRY.members["RotationLambdaARN"], - self.rotation_lambda_arn, - ) - - if self.rotation_rules is not None: - serializer.write_struct( - _SCHEMA_SECRET_LIST_ENTRY.members["RotationRules"], self.rotation_rules - ) - - if self.external_secret_rotation_metadata is not None: - _serialize_external_secret_rotation_metadata_type( - serializer, - _SCHEMA_SECRET_LIST_ENTRY.members["ExternalSecretRotationMetadata"], - self.external_secret_rotation_metadata, - ) - - if self.external_secret_rotation_role_arn is not None: - serializer.write_string( - _SCHEMA_SECRET_LIST_ENTRY.members["ExternalSecretRotationRoleArn"], - self.external_secret_rotation_role_arn, - ) - - if self.last_rotated_date is not None: - serializer.write_timestamp( - _SCHEMA_SECRET_LIST_ENTRY.members["LastRotatedDate"], - self.last_rotated_date, - ) - - if self.last_changed_date is not None: - serializer.write_timestamp( - _SCHEMA_SECRET_LIST_ENTRY.members["LastChangedDate"], - self.last_changed_date, - ) - - if self.last_accessed_date is not None: - serializer.write_timestamp( - _SCHEMA_SECRET_LIST_ENTRY.members["LastAccessedDate"], - self.last_accessed_date, - ) - - if self.deleted_date is not None: - serializer.write_timestamp( - _SCHEMA_SECRET_LIST_ENTRY.members["DeletedDate"], self.deleted_date - ) - - if self.next_rotation_date is not None: - serializer.write_timestamp( - _SCHEMA_SECRET_LIST_ENTRY.members["NextRotationDate"], - self.next_rotation_date, - ) - - if self.tags is not None: - _serialize_tag_list_type( - serializer, _SCHEMA_SECRET_LIST_ENTRY.members["Tags"], self.tags - ) - - if self.secret_versions_to_stages is not None: - _serialize_secret_versions_to_stages_map_type( - serializer, - _SCHEMA_SECRET_LIST_ENTRY.members["SecretVersionsToStages"], - self.secret_versions_to_stages, - ) - - if self.owning_service is not None: - serializer.write_string( - _SCHEMA_SECRET_LIST_ENTRY.members["OwningService"], self.owning_service - ) - - if self.created_date is not None: - serializer.write_timestamp( - _SCHEMA_SECRET_LIST_ENTRY.members["CreatedDate"], self.created_date - ) - - if self.primary_region is not None: - serializer.write_string( - _SCHEMA_SECRET_LIST_ENTRY.members["PrimaryRegion"], self.primary_region - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["arn"] = de.read_string( - _SCHEMA_SECRET_LIST_ENTRY.members["ARN"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_SECRET_LIST_ENTRY.members["Name"] - ) - - case 2: - kwargs["type"] = de.read_string( - _SCHEMA_SECRET_LIST_ENTRY.members["Type"] - ) - - case 3: - kwargs["description"] = de.read_string( - _SCHEMA_SECRET_LIST_ENTRY.members["Description"] - ) - - case 4: - kwargs["kms_key_id"] = de.read_string( - _SCHEMA_SECRET_LIST_ENTRY.members["KmsKeyId"] - ) - - case 5: - kwargs["rotation_enabled"] = de.read_boolean( - _SCHEMA_SECRET_LIST_ENTRY.members["RotationEnabled"] - ) - - case 6: - kwargs["rotation_lambda_arn"] = de.read_string( - _SCHEMA_SECRET_LIST_ENTRY.members["RotationLambdaARN"] - ) - - case 7: - kwargs["rotation_rules"] = RotationRulesType.deserialize(de) - - case 8: - kwargs["external_secret_rotation_metadata"] = ( - _deserialize_external_secret_rotation_metadata_type( - de, - _SCHEMA_SECRET_LIST_ENTRY.members[ - "ExternalSecretRotationMetadata" - ], - ) - ) - - case 9: - kwargs["external_secret_rotation_role_arn"] = de.read_string( - _SCHEMA_SECRET_LIST_ENTRY.members[ - "ExternalSecretRotationRoleArn" - ] - ) - - case 10: - kwargs["last_rotated_date"] = de.read_timestamp( - _SCHEMA_SECRET_LIST_ENTRY.members["LastRotatedDate"] - ) - - case 11: - kwargs["last_changed_date"] = de.read_timestamp( - _SCHEMA_SECRET_LIST_ENTRY.members["LastChangedDate"] - ) - - case 12: - kwargs["last_accessed_date"] = de.read_timestamp( - _SCHEMA_SECRET_LIST_ENTRY.members["LastAccessedDate"] - ) - - case 13: - kwargs["deleted_date"] = de.read_timestamp( - _SCHEMA_SECRET_LIST_ENTRY.members["DeletedDate"] - ) - - case 14: - kwargs["next_rotation_date"] = de.read_timestamp( - _SCHEMA_SECRET_LIST_ENTRY.members["NextRotationDate"] - ) - - case 15: - kwargs["tags"] = _deserialize_tag_list_type( - de, _SCHEMA_SECRET_LIST_ENTRY.members["Tags"] - ) - - case 16: - kwargs["secret_versions_to_stages"] = ( - _deserialize_secret_versions_to_stages_map_type( - de, - _SCHEMA_SECRET_LIST_ENTRY.members["SecretVersionsToStages"], - ) - ) - - case 17: - kwargs["owning_service"] = de.read_string( - _SCHEMA_SECRET_LIST_ENTRY.members["OwningService"] - ) - - case 18: - kwargs["created_date"] = de.read_timestamp( - _SCHEMA_SECRET_LIST_ENTRY.members["CreatedDate"] - ) - - case 19: - kwargs["primary_region"] = de.read_string( - _SCHEMA_SECRET_LIST_ENTRY.members["PrimaryRegion"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SECRET_LIST_ENTRY, consumer=_consumer) - return kwargs - - -def _serialize_secret_list_type( - serializer: ShapeSerializer, schema: Schema, value: list[SecretListEntry] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_secret_list_type( - deserializer: ShapeDeserializer, schema: Schema -) -> list[SecretListEntry]: - result: list[SecretListEntry] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(SecretListEntry.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListSecretsOutput: - """Dataclass for ListSecretsOutput structure.""" - - secret_list: list[SecretListEntry] | None = None - """A list of the secrets in the account.""" - - next_token: str | None = None - """ - Secrets Manager includes this value if there's more output available - than what is included in the current response. This can occur even when - the response includes no values at all, such as when you ask for a - filtered view of a long list. To get the next results, call - `ListSecrets` again with this value. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_SECRETS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.secret_list is not None: - _serialize_secret_list_type( - serializer, - _SCHEMA_LIST_SECRETS_OUTPUT.members["SecretList"], - self.secret_list, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_SECRETS_OUTPUT.members["NextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["secret_list"] = _deserialize_secret_list_type( - de, _SCHEMA_LIST_SECRETS_OUTPUT.members["SecretList"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_SECRETS_OUTPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_SECRETS_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_SECRETS = APIOperation( - input=ListSecretsInput, - output=ListSecretsOutput, - schema=_SCHEMA_LIST_SECRETS, - input_schema=_SCHEMA_LIST_SECRETS_INPUT, - output_schema=_SCHEMA_LIST_SECRETS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.secretsmanager#InternalServiceError" - ): InternalServiceError, - ShapeID( - "com.amazonaws.secretsmanager#InvalidNextTokenException" - ): InvalidNextTokenException, - ShapeID( - "com.amazonaws.secretsmanager#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.secretsmanager#InvalidRequestException" - ): InvalidRequestException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_SERVICE_ERROR, - _SCHEMA_INVALID_NEXT_TOKEN_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_INVALID_REQUEST_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListSecretVersionIdsInput: - """Dataclass for ListSecretVersionIdsInput structure.""" - - secret_id: str | None = None - """ - The ARN or name of the secret whose versions you want to list. - - For an ARN, we recommend that you specify a complete ARN rather than a - partial ARN. See [Finding a secret from a partial - ARN](https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen). - """ - - max_results: int | None = None - """ - The number of results to include in the response. - - If there are more results available, in the response, Secrets Manager - includes `NextToken`. To get the next results, call - `ListSecretVersionIds` again with the value from `NextToken`. - """ - - next_token: str | None = None - """ - A token that indicates where the output should continue from, if a - previous call did not show all results. To get the next results, call - `ListSecretVersionIds` again with this value. - """ - - include_deprecated: bool | None = None - """ - Specifies whether to include versions of secrets that don't have any - staging labels attached to them. Versions without staging labels are - considered deprecated and are subject to deletion by Secrets Manager. By - default, versions without staging labels aren't included. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_SECRET_VERSION_IDS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.secret_id is not None: - serializer.write_string( - _SCHEMA_LIST_SECRET_VERSION_IDS_INPUT.members["SecretId"], - self.secret_id, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_SECRET_VERSION_IDS_INPUT.members["MaxResults"], - self.max_results, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_SECRET_VERSION_IDS_INPUT.members["NextToken"], - self.next_token, - ) - - if self.include_deprecated is not None: - serializer.write_boolean( - _SCHEMA_LIST_SECRET_VERSION_IDS_INPUT.members["IncludeDeprecated"], - self.include_deprecated, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["secret_id"] = de.read_string( - _SCHEMA_LIST_SECRET_VERSION_IDS_INPUT.members["SecretId"] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_SECRET_VERSION_IDS_INPUT.members["MaxResults"] - ) - - case 2: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_SECRET_VERSION_IDS_INPUT.members["NextToken"] - ) - - case 3: - kwargs["include_deprecated"] = de.read_boolean( - _SCHEMA_LIST_SECRET_VERSION_IDS_INPUT.members[ - "IncludeDeprecated" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_SECRET_VERSION_IDS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class SecretVersionsListEntry: - """A structure that contains information about one version of a secret.""" - - version_id: str | None = None - """The unique version identifier of this version of the secret.""" - - version_stages: list[str] | None = None - """ - An array of staging labels that are currently associated with this - version of the secret. - """ - - last_accessed_date: datetime | None = None - """ - The date that this version of the secret was last accessed. Note that - the resolution of this field is at the date level and does not include - the time. - """ - - created_date: datetime | None = None - """The date and time this version of the secret was created.""" - - kms_key_ids: list[str] | None = None - """The KMS keys used to encrypt the secret version.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SECRET_VERSIONS_LIST_ENTRY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.version_id is not None: - serializer.write_string( - _SCHEMA_SECRET_VERSIONS_LIST_ENTRY.members["VersionId"], self.version_id - ) - - if self.version_stages is not None: - _serialize_secret_version_stages_type( - serializer, - _SCHEMA_SECRET_VERSIONS_LIST_ENTRY.members["VersionStages"], - self.version_stages, - ) - - if self.last_accessed_date is not None: - serializer.write_timestamp( - _SCHEMA_SECRET_VERSIONS_LIST_ENTRY.members["LastAccessedDate"], - self.last_accessed_date, - ) - - if self.created_date is not None: - serializer.write_timestamp( - _SCHEMA_SECRET_VERSIONS_LIST_ENTRY.members["CreatedDate"], - self.created_date, - ) - - if self.kms_key_ids is not None: - _serialize_kms_key_id_list_type( - serializer, - _SCHEMA_SECRET_VERSIONS_LIST_ENTRY.members["KmsKeyIds"], - self.kms_key_ids, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["version_id"] = de.read_string( - _SCHEMA_SECRET_VERSIONS_LIST_ENTRY.members["VersionId"] - ) - - case 1: - kwargs["version_stages"] = _deserialize_secret_version_stages_type( - de, _SCHEMA_SECRET_VERSIONS_LIST_ENTRY.members["VersionStages"] - ) - - case 2: - kwargs["last_accessed_date"] = de.read_timestamp( - _SCHEMA_SECRET_VERSIONS_LIST_ENTRY.members["LastAccessedDate"] - ) - - case 3: - kwargs["created_date"] = de.read_timestamp( - _SCHEMA_SECRET_VERSIONS_LIST_ENTRY.members["CreatedDate"] - ) - - case 4: - kwargs["kms_key_ids"] = _deserialize_kms_key_id_list_type( - de, _SCHEMA_SECRET_VERSIONS_LIST_ENTRY.members["KmsKeyIds"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SECRET_VERSIONS_LIST_ENTRY, consumer=_consumer) - return kwargs - - -def _serialize_secret_versions_list_type( - serializer: ShapeSerializer, schema: Schema, value: list[SecretVersionsListEntry] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_secret_versions_list_type( - deserializer: ShapeDeserializer, schema: Schema -) -> list[SecretVersionsListEntry]: - result: list[SecretVersionsListEntry] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(SecretVersionsListEntry.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListSecretVersionIdsOutput: - """Dataclass for ListSecretVersionIdsOutput structure.""" - - versions: list[SecretVersionsListEntry] | None = None - """A list of the versions of the secret.""" - - next_token: str | None = None - """ - Secrets Manager includes this value if there's more output available - than what is included in the current response. This can occur even when - the response includes no values at all, such as when you ask for a - filtered view of a long list. To get the next results, call - `ListSecretVersionIds` again with this value. - """ - - arn: str | None = None - """The ARN of the secret.""" - - name: str | None = None - """The name of the secret.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_SECRET_VERSION_IDS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.versions is not None: - _serialize_secret_versions_list_type( - serializer, - _SCHEMA_LIST_SECRET_VERSION_IDS_OUTPUT.members["Versions"], - self.versions, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_SECRET_VERSION_IDS_OUTPUT.members["NextToken"], - self.next_token, - ) - - if self.arn is not None: - serializer.write_string( - _SCHEMA_LIST_SECRET_VERSION_IDS_OUTPUT.members["ARN"], self.arn - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_LIST_SECRET_VERSION_IDS_OUTPUT.members["Name"], self.name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["versions"] = _deserialize_secret_versions_list_type( - de, _SCHEMA_LIST_SECRET_VERSION_IDS_OUTPUT.members["Versions"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_SECRET_VERSION_IDS_OUTPUT.members["NextToken"] - ) - - case 2: - kwargs["arn"] = de.read_string( - _SCHEMA_LIST_SECRET_VERSION_IDS_OUTPUT.members["ARN"] - ) - - case 3: - kwargs["name"] = de.read_string( - _SCHEMA_LIST_SECRET_VERSION_IDS_OUTPUT.members["Name"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_SECRET_VERSION_IDS_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_SECRET_VERSION_IDS = APIOperation( - input=ListSecretVersionIdsInput, - output=ListSecretVersionIdsOutput, - schema=_SCHEMA_LIST_SECRET_VERSION_IDS, - input_schema=_SCHEMA_LIST_SECRET_VERSION_IDS_INPUT, - output_schema=_SCHEMA_LIST_SECRET_VERSION_IDS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.secretsmanager#InternalServiceError" - ): InternalServiceError, - ShapeID( - "com.amazonaws.secretsmanager#InvalidNextTokenException" - ): InvalidNextTokenException, - ShapeID( - "com.amazonaws.secretsmanager#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.secretsmanager#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_SERVICE_ERROR, - _SCHEMA_INVALID_NEXT_TOKEN_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class PublicPolicyException(ServiceError): - """ - The `BlockPublicPolicy` parameter is set to true, and the resource - policy did not prevent broad access to the secret. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUBLIC_POLICY_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_PUBLIC_POLICY_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_PUBLIC_POLICY_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUBLIC_POLICY_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class PutResourcePolicyInput: - """Dataclass for PutResourcePolicyInput structure.""" - - secret_id: str | None = None - """ - The ARN or name of the secret to attach the resource-based policy. - - For an ARN, we recommend that you specify a complete ARN rather than a - partial ARN. See [Finding a secret from a partial - ARN](https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen). - """ - - resource_policy: str | None = None - """ - A JSON-formatted string for an Amazon Web Services resource-based - policy. For example policies, see [Permissions policy - examples](https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html). - """ - - block_public_policy: bool | None = None - """ - Specifies whether to block resource-based policies that allow broad - access to the secret, for example those that use a wildcard for the - principal. By default, public policies aren't blocked. - - Warning: - Resource policy validation and the BlockPublicPolicy parameter help - protect your resources by preventing public access from being granted - through the resource policies that are directly attached to your - secrets. In addition to using these features, carefully inspect the - following policies to confirm that they do not grant public access: - - - Identity-based policies attached to associated Amazon Web Services - principals (for example, IAM roles) - - - Resource-based policies attached to associated Amazon Web Services - resources (for example, Key Management Service (KMS) keys) - - To review permissions to your secrets, see [Determine who has - permissions to your - secrets](https://docs.aws.amazon.com/secretsmanager/latest/userguide/determine-acccess_examine-iam-policies.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_RESOURCE_POLICY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.secret_id is not None: - serializer.write_string( - _SCHEMA_PUT_RESOURCE_POLICY_INPUT.members["SecretId"], self.secret_id - ) - - if self.resource_policy is not None: - serializer.write_string( - _SCHEMA_PUT_RESOURCE_POLICY_INPUT.members["ResourcePolicy"], - self.resource_policy, - ) - - if self.block_public_policy is not None: - serializer.write_boolean( - _SCHEMA_PUT_RESOURCE_POLICY_INPUT.members["BlockPublicPolicy"], - self.block_public_policy, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["secret_id"] = de.read_string( - _SCHEMA_PUT_RESOURCE_POLICY_INPUT.members["SecretId"] - ) - - case 1: - kwargs["resource_policy"] = de.read_string( - _SCHEMA_PUT_RESOURCE_POLICY_INPUT.members["ResourcePolicy"] - ) - - case 2: - kwargs["block_public_policy"] = de.read_boolean( - _SCHEMA_PUT_RESOURCE_POLICY_INPUT.members["BlockPublicPolicy"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUT_RESOURCE_POLICY_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class PutResourcePolicyOutput: - """Dataclass for PutResourcePolicyOutput structure.""" - - arn: str | None = None - """The ARN of the secret.""" - - name: str | None = None - """The name of the secret.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_RESOURCE_POLICY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.arn is not None: - serializer.write_string( - _SCHEMA_PUT_RESOURCE_POLICY_OUTPUT.members["ARN"], self.arn - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_PUT_RESOURCE_POLICY_OUTPUT.members["Name"], self.name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["arn"] = de.read_string( - _SCHEMA_PUT_RESOURCE_POLICY_OUTPUT.members["ARN"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_PUT_RESOURCE_POLICY_OUTPUT.members["Name"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUT_RESOURCE_POLICY_OUTPUT, consumer=_consumer) - return kwargs - - -PUT_RESOURCE_POLICY = APIOperation( - input=PutResourcePolicyInput, - output=PutResourcePolicyOutput, - schema=_SCHEMA_PUT_RESOURCE_POLICY, - input_schema=_SCHEMA_PUT_RESOURCE_POLICY_INPUT, - output_schema=_SCHEMA_PUT_RESOURCE_POLICY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.secretsmanager#InternalServiceError" - ): InternalServiceError, - ShapeID( - "com.amazonaws.secretsmanager#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.secretsmanager#InvalidRequestException" - ): InvalidRequestException, - ShapeID( - "com.amazonaws.secretsmanager#MalformedPolicyDocumentException" - ): MalformedPolicyDocumentException, - ShapeID( - "com.amazonaws.secretsmanager#PublicPolicyException" - ): PublicPolicyException, - ShapeID( - "com.amazonaws.secretsmanager#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_SERVICE_ERROR, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_INVALID_REQUEST_EXCEPTION, - _SCHEMA_MALFORMED_POLICY_DOCUMENT_EXCEPTION, - _SCHEMA_PUBLIC_POLICY_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class PutSecretValueInput: - """Dataclass for PutSecretValueInput structure.""" - - secret_id: str | None = None - """ - The ARN or name of the secret to add a new version to. - - For an ARN, we recommend that you specify a complete ARN rather than a - partial ARN. See [Finding a secret from a partial - ARN](https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen). - - If the secret doesn't already exist, use `CreateSecret` instead. - """ - - client_request_token: str | None = None - """ - A unique identifier for the new version of the secret. - - Note: - If you use the Amazon Web Services CLI or one of the Amazon Web Services - SDKs to call this operation, then you can leave this parameter empty. - The CLI or SDK generates a random UUID for you and includes it as the - value for this parameter in the request. - - If you generate a raw HTTP request to the Secrets Manager service - endpoint, then you must generate a `ClientRequestToken` and include it - in the request. - - This value helps ensure idempotency. Secrets Manager uses this value to - prevent the accidental creation of duplicate versions if there are - failures and retries during a rotation. We recommend that you generate a - [UUID-type](https://wikipedia.org/wiki/Universally_unique_identifier) - value to ensure uniqueness of your versions within the specified secret. - - - If the `ClientRequestToken` value isn't already associated with a - version of the secret then a new version of the secret is created. - - - If a version with this value already exists and that version's - `SecretString` or `SecretBinary` values are the same as those in the - request then the request is ignored. The operation is idempotent. - - - If a version with this value already exists and the version of the - `SecretString` and `SecretBinary` values are different from those in - the request, then the request fails because you can't modify a secret - version. You can only create new versions to store new secret values. - - This value becomes the `VersionId` of the new version. - """ - - secret_binary: bytes | None = field(repr=False, default=None) - """ - The binary data to encrypt and store in the new version of the secret. - To use this parameter in the command-line tools, we recommend that you - store your binary data in a file and then pass the contents of the file - as a parameter. - - You must include `SecretBinary` or `SecretString`, but not both. - - You can't access this value from the Secrets Manager console. - - Sensitive: This field contains sensitive information, so the service - does not include it in CloudTrail log entries. If you create your own - log entries, you must also avoid logging the information in this field. - """ - - secret_string: str | None = field(repr=False, default=None) - """ - The text to encrypt and store in the new version of the secret. - - You must include `SecretBinary` or `SecretString`, but not both. - - We recommend you create the secret string as JSON key/value pairs, as - shown in the example. - - Sensitive: This field contains sensitive information, so the service - does not include it in CloudTrail log entries. If you create your own - log entries, you must also avoid logging the information in this field. - """ - - version_stages: list[str] | None = None - """ - A list of staging labels to attach to this version of the secret. - Secrets Manager uses staging labels to track versions of a secret - through the rotation process. - - If you specify a staging label that's already associated with a - different version of the same secret, then Secrets Manager removes the - label from the other version and attaches it to this version. If you - specify `AWSCURRENT`, and it is already attached to another version, - then Secrets Manager also moves the staging label `AWSPREVIOUS` to the - version that `AWSCURRENT` was removed from. - - If you don't include `VersionStages`, then Secrets Manager - automatically moves the staging label `AWSCURRENT` to this version. - """ - - rotation_token: str | None = field(repr=False, default=None) - """ - A unique identifier that indicates the source of the request. Required - for secret rotations using an IAM assumed role or cross-account - rotation, in which you rotate a secret in one account by using a Lambda - rotation function in another account. In both cases, the rotation - function assumes an IAM role to call Secrets Manager, and then Secrets - Manager validates the identity using the token. For more information, - see [How rotation - works](https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotating-secrets.html) - and [Rotation by Lambda - functions](https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_lambda). - - Sensitive: This field contains sensitive information, so the service - does not include it in CloudTrail log entries. If you create your own - log entries, you must also avoid logging the information in this field. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_SECRET_VALUE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.secret_id is not None: - serializer.write_string( - _SCHEMA_PUT_SECRET_VALUE_INPUT.members["SecretId"], self.secret_id - ) - - if self.client_request_token is not None: - serializer.write_string( - _SCHEMA_PUT_SECRET_VALUE_INPUT.members["ClientRequestToken"], - self.client_request_token, - ) - - if self.secret_binary is not None: - serializer.write_blob( - _SCHEMA_PUT_SECRET_VALUE_INPUT.members["SecretBinary"], - self.secret_binary, - ) - - if self.secret_string is not None: - serializer.write_string( - _SCHEMA_PUT_SECRET_VALUE_INPUT.members["SecretString"], - self.secret_string, - ) - - if self.version_stages is not None: - _serialize_secret_version_stages_type( - serializer, - _SCHEMA_PUT_SECRET_VALUE_INPUT.members["VersionStages"], - self.version_stages, - ) - - if self.rotation_token is not None: - serializer.write_string( - _SCHEMA_PUT_SECRET_VALUE_INPUT.members["RotationToken"], - self.rotation_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["secret_id"] = de.read_string( - _SCHEMA_PUT_SECRET_VALUE_INPUT.members["SecretId"] - ) - - case 1: - kwargs["client_request_token"] = de.read_string( - _SCHEMA_PUT_SECRET_VALUE_INPUT.members["ClientRequestToken"] - ) - - case 2: - kwargs["secret_binary"] = de.read_blob( - _SCHEMA_PUT_SECRET_VALUE_INPUT.members["SecretBinary"] - ) - - case 3: - kwargs["secret_string"] = de.read_string( - _SCHEMA_PUT_SECRET_VALUE_INPUT.members["SecretString"] - ) - - case 4: - kwargs["version_stages"] = _deserialize_secret_version_stages_type( - de, _SCHEMA_PUT_SECRET_VALUE_INPUT.members["VersionStages"] - ) - - case 5: - kwargs["rotation_token"] = de.read_string( - _SCHEMA_PUT_SECRET_VALUE_INPUT.members["RotationToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUT_SECRET_VALUE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class PutSecretValueOutput: - """Dataclass for PutSecretValueOutput structure.""" - - arn: str | None = None - """The ARN of the secret.""" - - name: str | None = None - """The name of the secret.""" - - version_id: str | None = None - """The unique identifier of the version of the secret.""" - - version_stages: list[str] | None = None - """ - The list of staging labels that are currently attached to this version - of the secret. Secrets Manager uses staging labels to track a version as - it progresses through the secret rotation process. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_SECRET_VALUE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.arn is not None: - serializer.write_string( - _SCHEMA_PUT_SECRET_VALUE_OUTPUT.members["ARN"], self.arn - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_PUT_SECRET_VALUE_OUTPUT.members["Name"], self.name - ) - - if self.version_id is not None: - serializer.write_string( - _SCHEMA_PUT_SECRET_VALUE_OUTPUT.members["VersionId"], self.version_id - ) - - if self.version_stages is not None: - _serialize_secret_version_stages_type( - serializer, - _SCHEMA_PUT_SECRET_VALUE_OUTPUT.members["VersionStages"], - self.version_stages, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["arn"] = de.read_string( - _SCHEMA_PUT_SECRET_VALUE_OUTPUT.members["ARN"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_PUT_SECRET_VALUE_OUTPUT.members["Name"] - ) - - case 2: - kwargs["version_id"] = de.read_string( - _SCHEMA_PUT_SECRET_VALUE_OUTPUT.members["VersionId"] - ) - - case 3: - kwargs["version_stages"] = _deserialize_secret_version_stages_type( - de, _SCHEMA_PUT_SECRET_VALUE_OUTPUT.members["VersionStages"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUT_SECRET_VALUE_OUTPUT, consumer=_consumer) - return kwargs - - -PUT_SECRET_VALUE = APIOperation( - input=PutSecretValueInput, - output=PutSecretValueOutput, - schema=_SCHEMA_PUT_SECRET_VALUE, - input_schema=_SCHEMA_PUT_SECRET_VALUE_INPUT, - output_schema=_SCHEMA_PUT_SECRET_VALUE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.secretsmanager#DecryptionFailure" - ): DecryptionFailure, - ShapeID( - "com.amazonaws.secretsmanager#EncryptionFailure" - ): EncryptionFailure, - ShapeID( - "com.amazonaws.secretsmanager#InternalServiceError" - ): InternalServiceError, - ShapeID( - "com.amazonaws.secretsmanager#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.secretsmanager#InvalidRequestException" - ): InvalidRequestException, - ShapeID( - "com.amazonaws.secretsmanager#LimitExceededException" - ): LimitExceededException, - ShapeID( - "com.amazonaws.secretsmanager#ResourceExistsException" - ): ResourceExistsException, - ShapeID( - "com.amazonaws.secretsmanager#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_DECRYPTION_FAILURE, - _SCHEMA_ENCRYPTION_FAILURE, - _SCHEMA_INTERNAL_SERVICE_ERROR, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_INVALID_REQUEST_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_RESOURCE_EXISTS_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - ], -) - - -def _serialize_remove_replica_region_list_type( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_remove_replica_region_list_type( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class RemoveRegionsFromReplicationInput: - """Dataclass for RemoveRegionsFromReplicationInput structure.""" - - secret_id: str | None = None - """The ARN or name of the secret.""" - - remove_replica_regions: list[str] | None = None - """The Regions of the replicas to remove.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REMOVE_REGIONS_FROM_REPLICATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.secret_id is not None: - serializer.write_string( - _SCHEMA_REMOVE_REGIONS_FROM_REPLICATION_INPUT.members["SecretId"], - self.secret_id, - ) - - if self.remove_replica_regions is not None: - _serialize_remove_replica_region_list_type( - serializer, - _SCHEMA_REMOVE_REGIONS_FROM_REPLICATION_INPUT.members[ - "RemoveReplicaRegions" - ], - self.remove_replica_regions, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["secret_id"] = de.read_string( - _SCHEMA_REMOVE_REGIONS_FROM_REPLICATION_INPUT.members[ - "SecretId" - ] - ) - - case 1: - kwargs["remove_replica_regions"] = ( - _deserialize_remove_replica_region_list_type( - de, - _SCHEMA_REMOVE_REGIONS_FROM_REPLICATION_INPUT.members[ - "RemoveReplicaRegions" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_REMOVE_REGIONS_FROM_REPLICATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class RemoveRegionsFromReplicationOutput: - """Dataclass for RemoveRegionsFromReplicationOutput structure.""" - - arn: str | None = None - """The ARN of the primary secret.""" - - replication_status: list[ReplicationStatusType] | None = None - """The status of replicas for this secret after you remove Regions.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REMOVE_REGIONS_FROM_REPLICATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.arn is not None: - serializer.write_string( - _SCHEMA_REMOVE_REGIONS_FROM_REPLICATION_OUTPUT.members["ARN"], self.arn - ) - - if self.replication_status is not None: - _serialize_replication_status_list_type( - serializer, - _SCHEMA_REMOVE_REGIONS_FROM_REPLICATION_OUTPUT.members[ - "ReplicationStatus" - ], - self.replication_status, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["arn"] = de.read_string( - _SCHEMA_REMOVE_REGIONS_FROM_REPLICATION_OUTPUT.members["ARN"] - ) - - case 1: - kwargs["replication_status"] = ( - _deserialize_replication_status_list_type( - de, - _SCHEMA_REMOVE_REGIONS_FROM_REPLICATION_OUTPUT.members[ - "ReplicationStatus" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_REMOVE_REGIONS_FROM_REPLICATION_OUTPUT, consumer=_consumer - ) - return kwargs - - -REMOVE_REGIONS_FROM_REPLICATION = APIOperation( - input=RemoveRegionsFromReplicationInput, - output=RemoveRegionsFromReplicationOutput, - schema=_SCHEMA_REMOVE_REGIONS_FROM_REPLICATION, - input_schema=_SCHEMA_REMOVE_REGIONS_FROM_REPLICATION_INPUT, - output_schema=_SCHEMA_REMOVE_REGIONS_FROM_REPLICATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.secretsmanager#InternalServiceError" - ): InternalServiceError, - ShapeID( - "com.amazonaws.secretsmanager#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.secretsmanager#InvalidRequestException" - ): InvalidRequestException, - ShapeID( - "com.amazonaws.secretsmanager#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_SERVICE_ERROR, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_INVALID_REQUEST_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ReplicateSecretToRegionsInput: - """Dataclass for ReplicateSecretToRegionsInput structure.""" - - secret_id: str | None = None - """The ARN or name of the secret to replicate.""" - - add_replica_regions: list[ReplicaRegionType] | None = None - """A list of Regions in which to replicate the secret.""" - - force_overwrite_replica_secret: bool = False - """ - Specifies whether to overwrite a secret with the same name in the - destination Region. By default, secrets aren't overwritten. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REPLICATE_SECRET_TO_REGIONS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.secret_id is not None: - serializer.write_string( - _SCHEMA_REPLICATE_SECRET_TO_REGIONS_INPUT.members["SecretId"], - self.secret_id, - ) - - if self.add_replica_regions is not None: - _serialize_add_replica_region_list_type( - serializer, - _SCHEMA_REPLICATE_SECRET_TO_REGIONS_INPUT.members["AddReplicaRegions"], - self.add_replica_regions, - ) - - if self.force_overwrite_replica_secret is not None: - serializer.write_boolean( - _SCHEMA_REPLICATE_SECRET_TO_REGIONS_INPUT.members[ - "ForceOverwriteReplicaSecret" - ], - self.force_overwrite_replica_secret, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["secret_id"] = de.read_string( - _SCHEMA_REPLICATE_SECRET_TO_REGIONS_INPUT.members["SecretId"] - ) - - case 1: - kwargs["add_replica_regions"] = ( - _deserialize_add_replica_region_list_type( - de, - _SCHEMA_REPLICATE_SECRET_TO_REGIONS_INPUT.members[ - "AddReplicaRegions" - ], - ) - ) - - case 2: - kwargs["force_overwrite_replica_secret"] = de.read_boolean( - _SCHEMA_REPLICATE_SECRET_TO_REGIONS_INPUT.members[ - "ForceOverwriteReplicaSecret" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_REPLICATE_SECRET_TO_REGIONS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ReplicateSecretToRegionsOutput: - """Dataclass for ReplicateSecretToRegionsOutput structure.""" - - arn: str | None = None - """The ARN of the primary secret.""" - - replication_status: list[ReplicationStatusType] | None = None - """The status of replication.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REPLICATE_SECRET_TO_REGIONS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.arn is not None: - serializer.write_string( - _SCHEMA_REPLICATE_SECRET_TO_REGIONS_OUTPUT.members["ARN"], self.arn - ) - - if self.replication_status is not None: - _serialize_replication_status_list_type( - serializer, - _SCHEMA_REPLICATE_SECRET_TO_REGIONS_OUTPUT.members["ReplicationStatus"], - self.replication_status, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["arn"] = de.read_string( - _SCHEMA_REPLICATE_SECRET_TO_REGIONS_OUTPUT.members["ARN"] - ) - - case 1: - kwargs["replication_status"] = ( - _deserialize_replication_status_list_type( - de, - _SCHEMA_REPLICATE_SECRET_TO_REGIONS_OUTPUT.members[ - "ReplicationStatus" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_REPLICATE_SECRET_TO_REGIONS_OUTPUT, consumer=_consumer - ) - return kwargs - - -REPLICATE_SECRET_TO_REGIONS = APIOperation( - input=ReplicateSecretToRegionsInput, - output=ReplicateSecretToRegionsOutput, - schema=_SCHEMA_REPLICATE_SECRET_TO_REGIONS, - input_schema=_SCHEMA_REPLICATE_SECRET_TO_REGIONS_INPUT, - output_schema=_SCHEMA_REPLICATE_SECRET_TO_REGIONS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.secretsmanager#InternalServiceError" - ): InternalServiceError, - ShapeID( - "com.amazonaws.secretsmanager#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.secretsmanager#InvalidRequestException" - ): InvalidRequestException, - ShapeID( - "com.amazonaws.secretsmanager#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_SERVICE_ERROR, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_INVALID_REQUEST_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class RestoreSecretInput: - """Dataclass for RestoreSecretInput structure.""" - - secret_id: str | None = None - """ - The ARN or name of the secret to restore. - - For an ARN, we recommend that you specify a complete ARN rather than a - partial ARN. See [Finding a secret from a partial - ARN](https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESTORE_SECRET_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.secret_id is not None: - serializer.write_string( - _SCHEMA_RESTORE_SECRET_INPUT.members["SecretId"], self.secret_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["secret_id"] = de.read_string( - _SCHEMA_RESTORE_SECRET_INPUT.members["SecretId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RESTORE_SECRET_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class RestoreSecretOutput: - """Dataclass for RestoreSecretOutput structure.""" - - arn: str | None = None - """The ARN of the secret that was restored.""" - - name: str | None = None - """The name of the secret that was restored.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESTORE_SECRET_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.arn is not None: - serializer.write_string( - _SCHEMA_RESTORE_SECRET_OUTPUT.members["ARN"], self.arn - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_RESTORE_SECRET_OUTPUT.members["Name"], self.name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["arn"] = de.read_string( - _SCHEMA_RESTORE_SECRET_OUTPUT.members["ARN"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_RESTORE_SECRET_OUTPUT.members["Name"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RESTORE_SECRET_OUTPUT, consumer=_consumer) - return kwargs - - -RESTORE_SECRET = APIOperation( - input=RestoreSecretInput, - output=RestoreSecretOutput, - schema=_SCHEMA_RESTORE_SECRET, - input_schema=_SCHEMA_RESTORE_SECRET_INPUT, - output_schema=_SCHEMA_RESTORE_SECRET_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.secretsmanager#InternalServiceError" - ): InternalServiceError, - ShapeID( - "com.amazonaws.secretsmanager#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.secretsmanager#InvalidRequestException" - ): InvalidRequestException, - ShapeID( - "com.amazonaws.secretsmanager#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_SERVICE_ERROR, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_INVALID_REQUEST_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class RotateSecretInput: - """Dataclass for RotateSecretInput structure.""" - - secret_id: str | None = None - """ - The ARN or name of the secret to rotate. - - For an ARN, we recommend that you specify a complete ARN rather than a - partial ARN. See [Finding a secret from a partial - ARN](https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen). - """ - - client_request_token: str | None = None - """ - A unique identifier for the new version of the secret. You only need to - specify this value if you implement your own retry logic and you want to - ensure that Secrets Manager doesn't attempt to create a secret version - twice. - - Note: - If you use the Amazon Web Services CLI or one of the Amazon Web Services - SDKs to call this operation, then you can leave this parameter empty. - The CLI or SDK generates a random UUID for you and includes it as the - value for this parameter in the request. - - If you generate a raw HTTP request to the Secrets Manager service - endpoint, then you must generate a `ClientRequestToken` and include it - in the request. - - This value helps ensure idempotency. Secrets Manager uses this value to - prevent the accidental creation of duplicate versions if there are - failures and retries during a rotation. We recommend that you generate a - [UUID-type](https://wikipedia.org/wiki/Universally_unique_identifier) - value to ensure uniqueness of your versions within the specified secret. - """ - - rotation_lambda_arn: str | None = None - """ - For secrets that use a Lambda rotation function to rotate, the ARN of - the Lambda rotation function. - - For secrets that use *managed rotation*, omit this field. For more - information, see [Managed - rotation](https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_managed.html) - in the *Secrets Manager User Guide*. - """ - - rotation_rules: RotationRulesType | None = None - """ - A structure that defines the rotation configuration for this secret. - - Warning: - When changing an existing rotation schedule and setting - `RotateImmediately` to `false`: - - - If using `AutomaticallyAfterDays` or a `ScheduleExpression` with - `rate()`, the previously scheduled rotation might still occur. - - - To prevent unintended rotations, use a `ScheduleExpression` with - `cron()` for granular control over rotation windows. - """ - - external_secret_rotation_metadata: ( - list[ExternalSecretRotationMetadataItem] | None - ) = None - """ - The metadata needed to successfully rotate a managed external secret. A - list of key value pairs in JSON format specified by the partner. For - more information about the required information, see [Using Secrets - Manager managed external - secrets](https://docs.aws.amazon.com/secretsmanager/latest/userguide/managed-external-secrets.html) - """ - - external_secret_rotation_role_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the role that allows Secrets Manager - to rotate a secret held by a third-party partner. For more information, - see [Security and - permissions](https://docs.aws.amazon.com/secretsmanager/latest/userguide/mes-security.html). - """ - - rotate_immediately: bool | None = None - """ - Specifies whether to rotate the secret immediately or wait until the - next scheduled rotation window. The rotation schedule is defined in - RotateSecretRequest$RotationRules. - - The default for `RotateImmediately` is `true`. If you don't specify - this value, Secrets Manager rotates the secret immediately. - - If you set `RotateImmediately` to `false`, Secrets Manager tests the - rotation configuration by running the [`testSecret` - step](https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_how.html) - of the Lambda rotation function. This test creates an `AWSPENDING` - version of the secret and then removes it. - - When changing an existing rotation schedule and setting - `RotateImmediately` to `false`: - - - If using `AutomaticallyAfterDays` or a `ScheduleExpression` with - `rate()`, the previously scheduled rotation might still occur. - - - To prevent unintended rotations, use a `ScheduleExpression` with - `cron()` for granular control over rotation windows. - - Rotation is an asynchronous process. For more information, see [How - rotation - works](https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_how.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ROTATE_SECRET_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.secret_id is not None: - serializer.write_string( - _SCHEMA_ROTATE_SECRET_INPUT.members["SecretId"], self.secret_id - ) - - if self.client_request_token is not None: - serializer.write_string( - _SCHEMA_ROTATE_SECRET_INPUT.members["ClientRequestToken"], - self.client_request_token, - ) - - if self.rotation_lambda_arn is not None: - serializer.write_string( - _SCHEMA_ROTATE_SECRET_INPUT.members["RotationLambdaARN"], - self.rotation_lambda_arn, - ) - - if self.rotation_rules is not None: - serializer.write_struct( - _SCHEMA_ROTATE_SECRET_INPUT.members["RotationRules"], - self.rotation_rules, - ) - - if self.external_secret_rotation_metadata is not None: - _serialize_external_secret_rotation_metadata_type( - serializer, - _SCHEMA_ROTATE_SECRET_INPUT.members["ExternalSecretRotationMetadata"], - self.external_secret_rotation_metadata, - ) - - if self.external_secret_rotation_role_arn is not None: - serializer.write_string( - _SCHEMA_ROTATE_SECRET_INPUT.members["ExternalSecretRotationRoleArn"], - self.external_secret_rotation_role_arn, - ) - - if self.rotate_immediately is not None: - serializer.write_boolean( - _SCHEMA_ROTATE_SECRET_INPUT.members["RotateImmediately"], - self.rotate_immediately, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["secret_id"] = de.read_string( - _SCHEMA_ROTATE_SECRET_INPUT.members["SecretId"] - ) - - case 1: - kwargs["client_request_token"] = de.read_string( - _SCHEMA_ROTATE_SECRET_INPUT.members["ClientRequestToken"] - ) - - case 2: - kwargs["rotation_lambda_arn"] = de.read_string( - _SCHEMA_ROTATE_SECRET_INPUT.members["RotationLambdaARN"] - ) - - case 3: - kwargs["rotation_rules"] = RotationRulesType.deserialize(de) - - case 4: - kwargs["external_secret_rotation_metadata"] = ( - _deserialize_external_secret_rotation_metadata_type( - de, - _SCHEMA_ROTATE_SECRET_INPUT.members[ - "ExternalSecretRotationMetadata" - ], - ) - ) - - case 5: - kwargs["external_secret_rotation_role_arn"] = de.read_string( - _SCHEMA_ROTATE_SECRET_INPUT.members[ - "ExternalSecretRotationRoleArn" - ] - ) - - case 6: - kwargs["rotate_immediately"] = de.read_boolean( - _SCHEMA_ROTATE_SECRET_INPUT.members["RotateImmediately"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ROTATE_SECRET_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class RotateSecretOutput: - """Dataclass for RotateSecretOutput structure.""" - - arn: str | None = None - """The ARN of the secret.""" - - name: str | None = None - """The name of the secret.""" - - version_id: str | None = None - """The ID of the new version of the secret.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ROTATE_SECRET_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.arn is not None: - serializer.write_string( - _SCHEMA_ROTATE_SECRET_OUTPUT.members["ARN"], self.arn - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_ROTATE_SECRET_OUTPUT.members["Name"], self.name - ) - - if self.version_id is not None: - serializer.write_string( - _SCHEMA_ROTATE_SECRET_OUTPUT.members["VersionId"], self.version_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["arn"] = de.read_string( - _SCHEMA_ROTATE_SECRET_OUTPUT.members["ARN"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_ROTATE_SECRET_OUTPUT.members["Name"] - ) - - case 2: - kwargs["version_id"] = de.read_string( - _SCHEMA_ROTATE_SECRET_OUTPUT.members["VersionId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ROTATE_SECRET_OUTPUT, consumer=_consumer) - return kwargs - - -ROTATE_SECRET = APIOperation( - input=RotateSecretInput, - output=RotateSecretOutput, - schema=_SCHEMA_ROTATE_SECRET, - input_schema=_SCHEMA_ROTATE_SECRET_INPUT, - output_schema=_SCHEMA_ROTATE_SECRET_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.secretsmanager#InternalServiceError" - ): InternalServiceError, - ShapeID( - "com.amazonaws.secretsmanager#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.secretsmanager#InvalidRequestException" - ): InvalidRequestException, - ShapeID( - "com.amazonaws.secretsmanager#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_SERVICE_ERROR, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_INVALID_REQUEST_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class StopReplicationToReplicaInput: - """Dataclass for StopReplicationToReplicaInput structure.""" - - secret_id: str | None = None - """ - The name of the secret or the replica ARN. The replica ARN is the same - as the original primary secret ARN expect the Region is changed to the - replica Region. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STOP_REPLICATION_TO_REPLICA_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.secret_id is not None: - serializer.write_string( - _SCHEMA_STOP_REPLICATION_TO_REPLICA_INPUT.members["SecretId"], - self.secret_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["secret_id"] = de.read_string( - _SCHEMA_STOP_REPLICATION_TO_REPLICA_INPUT.members["SecretId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_STOP_REPLICATION_TO_REPLICA_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class StopReplicationToReplicaOutput: - """Dataclass for StopReplicationToReplicaOutput structure.""" - - arn: str | None = None - """ - The ARN of the promoted secret. The ARN is the same as the original - primary secret except the Region is changed. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STOP_REPLICATION_TO_REPLICA_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.arn is not None: - serializer.write_string( - _SCHEMA_STOP_REPLICATION_TO_REPLICA_OUTPUT.members["ARN"], self.arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["arn"] = de.read_string( - _SCHEMA_STOP_REPLICATION_TO_REPLICA_OUTPUT.members["ARN"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_STOP_REPLICATION_TO_REPLICA_OUTPUT, consumer=_consumer - ) - return kwargs - - -STOP_REPLICATION_TO_REPLICA = APIOperation( - input=StopReplicationToReplicaInput, - output=StopReplicationToReplicaOutput, - schema=_SCHEMA_STOP_REPLICATION_TO_REPLICA, - input_schema=_SCHEMA_STOP_REPLICATION_TO_REPLICA_INPUT, - output_schema=_SCHEMA_STOP_REPLICATION_TO_REPLICA_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.secretsmanager#InternalServiceError" - ): InternalServiceError, - ShapeID( - "com.amazonaws.secretsmanager#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.secretsmanager#InvalidRequestException" - ): InvalidRequestException, - ShapeID( - "com.amazonaws.secretsmanager#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_SERVICE_ERROR, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_INVALID_REQUEST_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class TagResourceInput: - """Dataclass for TagResourceInput structure.""" - - secret_id: str | None = None - """ - The identifier for the secret to attach tags to. You can specify either - the Amazon Resource Name (ARN) or the friendly name of the secret. - - For an ARN, we recommend that you specify a complete ARN rather than a - partial ARN. See [Finding a secret from a partial - ARN](https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen). - """ - - tags: list[Tag] | None = None - """ - The tags to attach to the secret as a JSON text string argument. Each - element in the list consists of a `Key` and a `Value`. - - For storing multiple values, we recommend that you use a JSON text - string argument and specify key/value pairs. For more information, see - [Specifying parameter values for the Amazon Web Services - CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters.html) - in the Amazon Web Services CLI User Guide. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TAG_RESOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.secret_id is not None: - serializer.write_string( - _SCHEMA_TAG_RESOURCE_INPUT.members["SecretId"], self.secret_id - ) - - if self.tags is not None: - _serialize_tag_list_type( - serializer, _SCHEMA_TAG_RESOURCE_INPUT.members["Tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["secret_id"] = de.read_string( - _SCHEMA_TAG_RESOURCE_INPUT.members["SecretId"] - ) - - case 1: - kwargs["tags"] = _deserialize_tag_list_type( - de, _SCHEMA_TAG_RESOURCE_INPUT.members["Tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TAG_RESOURCE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class TagResourceOutput: - """Dataclass for TagResourceOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TAG_RESOURCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TAG_RESOURCE_OUTPUT, consumer=_consumer) - return kwargs - - -TAG_RESOURCE = APIOperation( - input=TagResourceInput, - output=TagResourceOutput, - schema=_SCHEMA_TAG_RESOURCE, - input_schema=_SCHEMA_TAG_RESOURCE_INPUT, - output_schema=_SCHEMA_TAG_RESOURCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.secretsmanager#InternalServiceError" - ): InternalServiceError, - ShapeID( - "com.amazonaws.secretsmanager#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.secretsmanager#InvalidRequestException" - ): InvalidRequestException, - ShapeID( - "com.amazonaws.secretsmanager#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_SERVICE_ERROR, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_INVALID_REQUEST_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - ], -) - - -def _serialize_tag_key_list_type( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_tag_key_list_type( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class UntagResourceInput: - """Dataclass for UntagResourceInput structure.""" - - secret_id: str | None = None - """ - The ARN or name of the secret. - - For an ARN, we recommend that you specify a complete ARN rather than a - partial ARN. See [Finding a secret from a partial - ARN](https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen). - """ - - tag_keys: list[str] | None = None - """ - A list of tag key names to remove from the secret. You don't specify - the value. Both the key and its associated value are removed. - - This parameter requires a JSON text string argument. - For storing multiple values, we recommend that you use a JSON text - string argument and specify key/value pairs. For more information, see - [Specifying parameter values for the Amazon Web Services - CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters.html) - in the Amazon Web Services CLI User Guide. +class ServiceError(ModeledError): """ + Base error for all errors in the service. - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNTAG_RESOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.secret_id is not None: - serializer.write_string( - _SCHEMA_UNTAG_RESOURCE_INPUT.members["SecretId"], self.secret_id - ) - - if self.tag_keys is not None: - _serialize_tag_key_list_type( - serializer, - _SCHEMA_UNTAG_RESOURCE_INPUT.members["TagKeys"], - self.tag_keys, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["secret_id"] = de.read_string( - _SCHEMA_UNTAG_RESOURCE_INPUT.members["SecretId"] - ) - - case 1: - kwargs["tag_keys"] = _deserialize_tag_key_list_type( - de, _SCHEMA_UNTAG_RESOURCE_INPUT.members["TagKeys"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UNTAG_RESOURCE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UntagResourceOutput: - """Dataclass for UntagResourceOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. + Some exceptions do not extend from this class, including + synthetic, implicit, and shared exception types. """ - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNTAG_RESOURCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UNTAG_RESOURCE_OUTPUT, consumer=_consumer) - return kwargs - - -UNTAG_RESOURCE = APIOperation( - input=UntagResourceInput, - output=UntagResourceOutput, - schema=_SCHEMA_UNTAG_RESOURCE, - input_schema=_SCHEMA_UNTAG_RESOURCE_INPUT, - output_schema=_SCHEMA_UNTAG_RESOURCE_OUTPUT, - error_registry=TypeRegistry( +_registry = ModelRegistry( + _schemas, + renames={}, + index={ + "APIErrorType": "API_ERROR_TYPE", + "BatchGetSecretValueInput": "BATCH_GET_SECRET_VALUE_INPUT", + "BatchGetSecretValueOutput": "BATCH_GET_SECRET_VALUE_OUTPUT", + "CancelRotateSecretInput": "CANCEL_ROTATE_SECRET_INPUT", + "CancelRotateSecretOutput": "CANCEL_ROTATE_SECRET_OUTPUT", + "CreateSecretInput": "CREATE_SECRET_INPUT", + "CreateSecretOutput": "CREATE_SECRET_OUTPUT", + "DecryptionFailure": "DECRYPTION_FAILURE", + "DeleteResourcePolicyInput": "DELETE_RESOURCE_POLICY_INPUT", + "DeleteResourcePolicyOutput": "DELETE_RESOURCE_POLICY_OUTPUT", + "DeleteSecretInput": "DELETE_SECRET_INPUT", + "DeleteSecretOutput": "DELETE_SECRET_OUTPUT", + "DescribeSecretInput": "DESCRIBE_SECRET_INPUT", + "DescribeSecretOutput": "DESCRIBE_SECRET_OUTPUT", + "EncryptionFailure": "ENCRYPTION_FAILURE", + "ExternalSecretRotationMetadataItem": "EXTERNAL_SECRET_ROTATION_METADATA_ITEM", + "Filter": "FILTER", + "FilterNameStringType": "FILTER_NAME_STRING_TYPE", + "GetRandomPasswordInput": "GET_RANDOM_PASSWORD_INPUT", + "GetRandomPasswordOutput": "GET_RANDOM_PASSWORD_OUTPUT", + "GetResourcePolicyInput": "GET_RESOURCE_POLICY_INPUT", + "GetResourcePolicyOutput": "GET_RESOURCE_POLICY_OUTPUT", + "GetSecretValueInput": "GET_SECRET_VALUE_INPUT", + "GetSecretValueOutput": "GET_SECRET_VALUE_OUTPUT", + "InternalServiceError": "INTERNAL_SERVICE_ERROR", + "InvalidNextTokenException": "INVALID_NEXT_TOKEN_EXCEPTION", + "InvalidParameterException": "INVALID_PARAMETER_EXCEPTION", + "InvalidRequestException": "INVALID_REQUEST_EXCEPTION", + "LimitExceededException": "LIMIT_EXCEEDED_EXCEPTION", + "ListSecretsInput": "LIST_SECRETS_INPUT", + "ListSecretsOutput": "LIST_SECRETS_OUTPUT", + "ListSecretVersionIdsInput": "LIST_SECRET_VERSION_IDS_INPUT", + "ListSecretVersionIdsOutput": "LIST_SECRET_VERSION_IDS_OUTPUT", + "MalformedPolicyDocumentException": "MALFORMED_POLICY_DOCUMENT_EXCEPTION", + "PreconditionNotMetException": "PRECONDITION_NOT_MET_EXCEPTION", + "PublicPolicyException": "PUBLIC_POLICY_EXCEPTION", + "PutResourcePolicyInput": "PUT_RESOURCE_POLICY_INPUT", + "PutResourcePolicyOutput": "PUT_RESOURCE_POLICY_OUTPUT", + "PutSecretValueInput": "PUT_SECRET_VALUE_INPUT", + "PutSecretValueOutput": "PUT_SECRET_VALUE_OUTPUT", + "RemoveRegionsFromReplicationInput": "REMOVE_REGIONS_FROM_REPLICATION_INPUT", + "RemoveRegionsFromReplicationOutput": "REMOVE_REGIONS_FROM_REPLICATION_OUTPUT", + "ReplicaRegionType": "REPLICA_REGION_TYPE", + "ReplicateSecretToRegionsInput": "REPLICATE_SECRET_TO_REGIONS_INPUT", + "ReplicateSecretToRegionsOutput": "REPLICATE_SECRET_TO_REGIONS_OUTPUT", + "ReplicationStatusType": "REPLICATION_STATUS_TYPE", + "ResourceExistsException": "RESOURCE_EXISTS_EXCEPTION", + "ResourceNotFoundException": "RESOURCE_NOT_FOUND_EXCEPTION", + "RestoreSecretInput": "RESTORE_SECRET_INPUT", + "RestoreSecretOutput": "RESTORE_SECRET_OUTPUT", + "RotateSecretInput": "ROTATE_SECRET_INPUT", + "RotateSecretOutput": "ROTATE_SECRET_OUTPUT", + "RotationRulesType": "ROTATION_RULES_TYPE", + "SecretListEntry": "SECRET_LIST_ENTRY", + "SecretValueEntry": "SECRET_VALUE_ENTRY", + "SecretVersionsListEntry": "SECRET_VERSIONS_LIST_ENTRY", + "SortByType": "SORT_BY_TYPE", + "SortOrderType": "SORT_ORDER_TYPE", + "StatusType": "STATUS_TYPE", + "StopReplicationToReplicaInput": "STOP_REPLICATION_TO_REPLICA_INPUT", + "StopReplicationToReplicaOutput": "STOP_REPLICATION_TO_REPLICA_OUTPUT", + "Tag": "TAG", + "TagResourceInput": "TAG_RESOURCE_INPUT", + "TagResourceOutput": "TAG_RESOURCE_OUTPUT", + "UntagResourceInput": "UNTAG_RESOURCE_INPUT", + "UntagResourceOutput": "UNTAG_RESOURCE_OUTPUT", + "UpdateSecretInput": "UPDATE_SECRET_INPUT", + "UpdateSecretOutput": "UPDATE_SECRET_OUTPUT", + "UpdateSecretVersionStageInput": "UPDATE_SECRET_VERSION_STAGE_INPUT", + "UpdateSecretVersionStageOutput": "UPDATE_SECRET_VERSION_STAGE_OUTPUT", + "ValidateResourcePolicyInput": "VALIDATE_RESOURCE_POLICY_INPUT", + "ValidateResourcePolicyOutput": "VALIDATE_RESOURCE_POLICY_OUTPUT", + "ValidationErrorsEntry": "VALIDATION_ERRORS_ENTRY", + }, + shape_names=frozenset( { - ShapeID( - "com.amazonaws.secretsmanager#InternalServiceError" - ): InternalServiceError, - ShapeID( - "com.amazonaws.secretsmanager#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.secretsmanager#InvalidRequestException" - ): InvalidRequestException, - ShapeID( - "com.amazonaws.secretsmanager#ResourceNotFoundException" - ): ResourceNotFoundException, + "APIErrorType", + "BatchGetSecretValueInput", + "BatchGetSecretValueOutput", + "CancelRotateSecretInput", + "CancelRotateSecretOutput", + "CreateSecretInput", + "CreateSecretOutput", + "DecryptionFailure", + "DeleteResourcePolicyInput", + "DeleteResourcePolicyOutput", + "DeleteSecretInput", + "DeleteSecretOutput", + "DescribeSecretInput", + "DescribeSecretOutput", + "EncryptionFailure", + "ExternalSecretRotationMetadataItem", + "Filter", + "FilterNameStringType", + "GetRandomPasswordInput", + "GetRandomPasswordOutput", + "GetResourcePolicyInput", + "GetResourcePolicyOutput", + "GetSecretValueInput", + "GetSecretValueOutput", + "InternalServiceError", + "InvalidNextTokenException", + "InvalidParameterException", + "InvalidRequestException", + "LimitExceededException", + "ListSecretVersionIdsInput", + "ListSecretVersionIdsOutput", + "ListSecretsInput", + "ListSecretsOutput", + "MalformedPolicyDocumentException", + "PreconditionNotMetException", + "PublicPolicyException", + "PutResourcePolicyInput", + "PutResourcePolicyOutput", + "PutSecretValueInput", + "PutSecretValueOutput", + "RemoveRegionsFromReplicationInput", + "RemoveRegionsFromReplicationOutput", + "ReplicaRegionType", + "ReplicateSecretToRegionsInput", + "ReplicateSecretToRegionsOutput", + "ReplicationStatusType", + "ResourceExistsException", + "ResourceNotFoundException", + "RestoreSecretInput", + "RestoreSecretOutput", + "RotateSecretInput", + "RotateSecretOutput", + "RotationRulesType", + "SecretListEntry", + "SecretValueEntry", + "SecretVersionsListEntry", + "SortByType", + "SortOrderType", + "StatusType", + "StopReplicationToReplicaInput", + "StopReplicationToReplicaOutput", + "Tag", + "TagResourceInput", + "TagResourceOutput", + "UntagResourceInput", + "UntagResourceOutput", + "UpdateSecretInput", + "UpdateSecretOutput", + "UpdateSecretVersionStageInput", + "UpdateSecretVersionStageOutput", + "ValidateResourcePolicyInput", + "ValidateResourcePolicyOutput", + "ValidationErrorsEntry", } ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_SERVICE_ERROR, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_INVALID_REQUEST_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - ], + service_error="ServiceError", ) -@dataclass(kw_only=True) -class UpdateSecretInput: - """Dataclass for UpdateSecretInput structure.""" - - secret_id: str | None = None - """ - The ARN or name of the secret. - - For an ARN, we recommend that you specify a complete ARN rather than a - partial ARN. See [Finding a secret from a partial - ARN](https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen). - """ - - client_request_token: str | None = None - """ - If you include `SecretString` or `SecretBinary`, then Secrets Manager - creates a new version for the secret, and this parameter specifies the - unique identifier for the new version. - - Note: - If you use the Amazon Web Services CLI or one of the Amazon Web Services - SDKs to call this operation, then you can leave this parameter empty. - The CLI or SDK generates a random UUID for you and includes it as the - value for this parameter in the request. - - If you generate a raw HTTP request to the Secrets Manager service - endpoint, then you must generate a `ClientRequestToken` and include it - in the request. - - This value helps ensure idempotency. Secrets Manager uses this value to - prevent the accidental creation of duplicate versions if there are - failures and retries during a rotation. We recommend that you generate a - [UUID-type](https://wikipedia.org/wiki/Universally_unique_identifier) - value to ensure uniqueness of your versions within the specified secret. - """ - - description: str | None = None - """The description of the secret.""" - - kms_key_id: str | None = None - """ - The ARN, key ID, or alias of the KMS key that Secrets Manager uses to - encrypt new secret versions as well as any existing versions with the - staging labels `AWSCURRENT`, `AWSPENDING`, or `AWSPREVIOUS`. If you - don't have `kms:Encrypt` permission to the new key, Secrets Manager - does not re-encrypt existing secret versions with the new key. For more - information about versions and staging labels, see [Concepts: - Version](https://docs.aws.amazon.com/secretsmanager/latest/userguide/getting-started.html#term_version). - - A key alias is always prefixed by `alias/`, for example - `alias/aws/secretsmanager`. For more information, see [About - aliases](https://docs.aws.amazon.com/kms/latest/developerguide/alias-about.html). - - If you set this to an empty string, Secrets Manager uses the Amazon Web - Services managed key `aws/secretsmanager`. If this key doesn't already - exist in your account, then Secrets Manager creates it for you - automatically. All users and roles in the Amazon Web Services account - automatically have access to use `aws/secretsmanager`. Creating - `aws/secretsmanager` can result in a one-time significant delay in - returning the result. - - Warning: - You can only use the Amazon Web Services managed key - `aws/secretsmanager` if you call this operation using credentials from - the same Amazon Web Services account that owns the secret. If the secret - is in a different account, then you must use a customer managed key and - provide the ARN of that KMS key in this field. The user making the call - must have permissions to both the secret and the KMS key in their - respective accounts. - """ - - secret_binary: bytes | None = field(repr=False, default=None) - """ - The binary data to encrypt and store in the new version of the secret. - We recommend that you store your binary data in a file and then pass the - contents of the file as a parameter. - - Either `SecretBinary` or `SecretString` must have a value, but not both. - - You can't access this parameter in the Secrets Manager console. - - Sensitive: This field contains sensitive information, so the service - does not include it in CloudTrail log entries. If you create your own - log entries, you must also avoid logging the information in this field. - """ - - secret_string: str | None = field(repr=False, default=None) - """ - The text data to encrypt and store in the new version of the secret. We - recommend you use a JSON structure of key/value pairs for your secret - value. - - Either `SecretBinary` or `SecretString` must have a value, but not both. - - Sensitive: This field contains sensitive information, so the service - does not include it in CloudTrail log entries. If you create your own - log entries, you must also avoid logging the information in this field. - """ - - type: str | None = None - """ - The exact string that identifies the third-party partner that holds the - external secret. For more information, see [Managed external secret - partners](https://docs.aws.amazon.com/secretsmanager/latest/userguide/mes-partners.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_SECRET_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.secret_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_SECRET_INPUT.members["SecretId"], self.secret_id - ) - - if self.client_request_token is not None: - serializer.write_string( - _SCHEMA_UPDATE_SECRET_INPUT.members["ClientRequestToken"], - self.client_request_token, - ) - - if self.description is not None: - serializer.write_string( - _SCHEMA_UPDATE_SECRET_INPUT.members["Description"], self.description - ) - - if self.kms_key_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_SECRET_INPUT.members["KmsKeyId"], self.kms_key_id - ) - - if self.secret_binary is not None: - serializer.write_blob( - _SCHEMA_UPDATE_SECRET_INPUT.members["SecretBinary"], self.secret_binary - ) - - if self.secret_string is not None: - serializer.write_string( - _SCHEMA_UPDATE_SECRET_INPUT.members["SecretString"], self.secret_string - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_UPDATE_SECRET_INPUT.members["Type"], self.type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["secret_id"] = de.read_string( - _SCHEMA_UPDATE_SECRET_INPUT.members["SecretId"] - ) - - case 1: - kwargs["client_request_token"] = de.read_string( - _SCHEMA_UPDATE_SECRET_INPUT.members["ClientRequestToken"] - ) - - case 2: - kwargs["description"] = de.read_string( - _SCHEMA_UPDATE_SECRET_INPUT.members["Description"] - ) - - case 3: - kwargs["kms_key_id"] = de.read_string( - _SCHEMA_UPDATE_SECRET_INPUT.members["KmsKeyId"] - ) - - case 4: - kwargs["secret_binary"] = de.read_blob( - _SCHEMA_UPDATE_SECRET_INPUT.members["SecretBinary"] - ) - - case 5: - kwargs["secret_string"] = de.read_string( - _SCHEMA_UPDATE_SECRET_INPUT.members["SecretString"] - ) - - case 6: - kwargs["type"] = de.read_string( - _SCHEMA_UPDATE_SECRET_INPUT.members["Type"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_SECRET_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UpdateSecretOutput: - """Dataclass for UpdateSecretOutput structure.""" - - arn: str | None = None - """The ARN of the secret that was updated.""" - - name: str | None = None - """The name of the secret that was updated.""" - - version_id: str | None = None - """ - If Secrets Manager created a new version of the secret during this - operation, then `VersionId` contains the unique identifier of the new - version. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_SECRET_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_SECRET_OUTPUT.members["ARN"], self.arn - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_UPDATE_SECRET_OUTPUT.members["Name"], self.name - ) - - if self.version_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_SECRET_OUTPUT.members["VersionId"], self.version_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +def __getattr__(name: str): + return _registry.build(name) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["arn"] = de.read_string( - _SCHEMA_UPDATE_SECRET_OUTPUT.members["ARN"] - ) - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_SECRET_OUTPUT.members["Name"] - ) - - case 2: - kwargs["version_id"] = de.read_string( - _SCHEMA_UPDATE_SECRET_OUTPUT.members["VersionId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UPDATE_SECRET_OUTPUT, consumer=_consumer) - return kwargs - - -UPDATE_SECRET = APIOperation( - input=UpdateSecretInput, - output=UpdateSecretOutput, - schema=_SCHEMA_UPDATE_SECRET, - input_schema=_SCHEMA_UPDATE_SECRET_INPUT, - output_schema=_SCHEMA_UPDATE_SECRET_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.secretsmanager#DecryptionFailure" - ): DecryptionFailure, - ShapeID( - "com.amazonaws.secretsmanager#EncryptionFailure" - ): EncryptionFailure, - ShapeID( - "com.amazonaws.secretsmanager#InternalServiceError" - ): InternalServiceError, - ShapeID( - "com.amazonaws.secretsmanager#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.secretsmanager#InvalidRequestException" - ): InvalidRequestException, - ShapeID( - "com.amazonaws.secretsmanager#LimitExceededException" - ): LimitExceededException, - ShapeID( - "com.amazonaws.secretsmanager#MalformedPolicyDocumentException" - ): MalformedPolicyDocumentException, - ShapeID( - "com.amazonaws.secretsmanager#PreconditionNotMetException" - ): PreconditionNotMetException, - ShapeID( - "com.amazonaws.secretsmanager#ResourceExistsException" - ): ResourceExistsException, - ShapeID( - "com.amazonaws.secretsmanager#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_DECRYPTION_FAILURE, - _SCHEMA_ENCRYPTION_FAILURE, - _SCHEMA_INTERNAL_SERVICE_ERROR, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_INVALID_REQUEST_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_MALFORMED_POLICY_DOCUMENT_EXCEPTION, - _SCHEMA_PRECONDITION_NOT_MET_EXCEPTION, - _SCHEMA_RESOURCE_EXISTS_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, +BATCH_GET_SECRET_VALUE: APIOperation[ + BatchGetSecretValueInput, BatchGetSecretValueOutput +] = APIOperation( + static_schema=_SCHEMA_BATCH_GET_SECRET_VALUE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.secretsmanager#DecryptionFailure"), + ShapeID("com.amazonaws.secretsmanager#InternalServiceError"), + ShapeID("com.amazonaws.secretsmanager#InvalidNextTokenException"), + ShapeID("com.amazonaws.secretsmanager#InvalidParameterException"), + ShapeID("com.amazonaws.secretsmanager#InvalidRequestException"), + ShapeID("com.amazonaws.secretsmanager#ResourceNotFoundException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) +CANCEL_ROTATE_SECRET: APIOperation[ + CancelRotateSecretInput, CancelRotateSecretOutput +] = APIOperation( + static_schema=_SCHEMA_CANCEL_ROTATE_SECRET, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.secretsmanager#InternalServiceError"), + ShapeID("com.amazonaws.secretsmanager#InvalidParameterException"), + ShapeID("com.amazonaws.secretsmanager#InvalidRequestException"), + ShapeID("com.amazonaws.secretsmanager#ResourceNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -@dataclass(kw_only=True) -class UpdateSecretVersionStageInput: - """Dataclass for UpdateSecretVersionStageInput structure.""" - - secret_id: str | None = None - """ - The ARN or the name of the secret with the version and staging labelsto - modify. - - For an ARN, we recommend that you specify a complete ARN rather than a - partial ARN. See [Finding a secret from a partial - ARN](https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen). - """ - - version_stage: str | None = None - """The staging label to add to this version.""" - - remove_from_version_id: str | None = None - """ - The ID of the version that the staging label is to be removed from. If - the staging label you are trying to attach to one version is already - attached to a different version, then you must include this parameter - and specify the version that the label is to be removed from. If the - label is attached and you either do not specify this parameter, or the - version ID does not match, then the operation fails. - """ - - move_to_version_id: str | None = None - """ - The ID of the version to add the staging label to. To remove a label - from a version, then do not specify this parameter. - - If the staging label is already attached to a different version of the - secret, then you must also specify the `RemoveFromVersionId` parameter. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_SECRET_VERSION_STAGE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.secret_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_SECRET_VERSION_STAGE_INPUT.members["SecretId"], - self.secret_id, - ) - - if self.version_stage is not None: - serializer.write_string( - _SCHEMA_UPDATE_SECRET_VERSION_STAGE_INPUT.members["VersionStage"], - self.version_stage, - ) - - if self.remove_from_version_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_SECRET_VERSION_STAGE_INPUT.members[ - "RemoveFromVersionId" - ], - self.remove_from_version_id, - ) - - if self.move_to_version_id is not None: - serializer.write_string( - _SCHEMA_UPDATE_SECRET_VERSION_STAGE_INPUT.members["MoveToVersionId"], - self.move_to_version_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["secret_id"] = de.read_string( - _SCHEMA_UPDATE_SECRET_VERSION_STAGE_INPUT.members["SecretId"] - ) - - case 1: - kwargs["version_stage"] = de.read_string( - _SCHEMA_UPDATE_SECRET_VERSION_STAGE_INPUT.members[ - "VersionStage" - ] - ) - - case 2: - kwargs["remove_from_version_id"] = de.read_string( - _SCHEMA_UPDATE_SECRET_VERSION_STAGE_INPUT.members[ - "RemoveFromVersionId" - ] - ) - - case 3: - kwargs["move_to_version_id"] = de.read_string( - _SCHEMA_UPDATE_SECRET_VERSION_STAGE_INPUT.members[ - "MoveToVersionId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_UPDATE_SECRET_VERSION_STAGE_INPUT, consumer=_consumer - ) - return kwargs - +CREATE_SECRET: APIOperation[CreateSecretInput, CreateSecretOutput] = APIOperation( + static_schema=_SCHEMA_CREATE_SECRET, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.secretsmanager#DecryptionFailure"), + ShapeID("com.amazonaws.secretsmanager#EncryptionFailure"), + ShapeID("com.amazonaws.secretsmanager#InternalServiceError"), + ShapeID("com.amazonaws.secretsmanager#InvalidParameterException"), + ShapeID("com.amazonaws.secretsmanager#InvalidRequestException"), + ShapeID("com.amazonaws.secretsmanager#LimitExceededException"), + ShapeID("com.amazonaws.secretsmanager#MalformedPolicyDocumentException"), + ShapeID("com.amazonaws.secretsmanager#PreconditionNotMetException"), + ShapeID("com.amazonaws.secretsmanager#ResourceExistsException"), + ShapeID("com.amazonaws.secretsmanager#ResourceNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -@dataclass(kw_only=True) -class UpdateSecretVersionStageOutput: - """Dataclass for UpdateSecretVersionStageOutput structure.""" +DELETE_RESOURCE_POLICY: APIOperation[ + DeleteResourcePolicyInput, DeleteResourcePolicyOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_RESOURCE_POLICY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.secretsmanager#InternalServiceError"), + ShapeID("com.amazonaws.secretsmanager#InvalidParameterException"), + ShapeID("com.amazonaws.secretsmanager#InvalidRequestException"), + ShapeID("com.amazonaws.secretsmanager#ResourceNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - arn: str | None = None - """The ARN of the secret that was updated.""" +DELETE_SECRET: APIOperation[DeleteSecretInput, DeleteSecretOutput] = APIOperation( + static_schema=_SCHEMA_DELETE_SECRET, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.secretsmanager#InternalServiceError"), + ShapeID("com.amazonaws.secretsmanager#InvalidParameterException"), + ShapeID("com.amazonaws.secretsmanager#InvalidRequestException"), + ShapeID("com.amazonaws.secretsmanager#ResourceNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - name: str | None = None - """The name of the secret that was updated.""" +DESCRIBE_SECRET: APIOperation[DescribeSecretInput, DescribeSecretOutput] = APIOperation( + static_schema=_SCHEMA_DESCRIBE_SECRET, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.secretsmanager#InternalServiceError"), + ShapeID("com.amazonaws.secretsmanager#InvalidParameterException"), + ShapeID("com.amazonaws.secretsmanager#ResourceNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False +GET_RANDOM_PASSWORD: APIOperation[GetRandomPasswordInput, GetRandomPasswordOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_RANDOM_PASSWORD, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.secretsmanager#InternalServiceError"), + ShapeID("com.amazonaws.secretsmanager#InvalidParameterException"), + ShapeID("com.amazonaws.secretsmanager#InvalidRequestException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UPDATE_SECRET_VERSION_STAGE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.arn is not None: - serializer.write_string( - _SCHEMA_UPDATE_SECRET_VERSION_STAGE_OUTPUT.members["ARN"], self.arn - ) - - if self.name is not None: - serializer.write_string( - _SCHEMA_UPDATE_SECRET_VERSION_STAGE_OUTPUT.members["Name"], self.name - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["arn"] = de.read_string( - _SCHEMA_UPDATE_SECRET_VERSION_STAGE_OUTPUT.members["ARN"] - ) - - case 1: - kwargs["name"] = de.read_string( - _SCHEMA_UPDATE_SECRET_VERSION_STAGE_OUTPUT.members["Name"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) +) - deserializer.read_struct( - _SCHEMA_UPDATE_SECRET_VERSION_STAGE_OUTPUT, consumer=_consumer - ) - return kwargs +GET_RESOURCE_POLICY: APIOperation[GetResourcePolicyInput, GetResourcePolicyOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_RESOURCE_POLICY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.secretsmanager#InternalServiceError"), + ShapeID("com.amazonaws.secretsmanager#InvalidParameterException"), + ShapeID("com.amazonaws.secretsmanager#InvalidRequestException"), + ShapeID("com.amazonaws.secretsmanager#ResourceNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) +GET_SECRET_VALUE: APIOperation[GetSecretValueInput, GetSecretValueOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_SECRET_VALUE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.secretsmanager#DecryptionFailure"), + ShapeID("com.amazonaws.secretsmanager#InternalServiceError"), + ShapeID("com.amazonaws.secretsmanager#InvalidParameterException"), + ShapeID("com.amazonaws.secretsmanager#InvalidRequestException"), + ShapeID("com.amazonaws.secretsmanager#ResourceNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) -UPDATE_SECRET_VERSION_STAGE = APIOperation( - input=UpdateSecretVersionStageInput, - output=UpdateSecretVersionStageOutput, - schema=_SCHEMA_UPDATE_SECRET_VERSION_STAGE, - input_schema=_SCHEMA_UPDATE_SECRET_VERSION_STAGE_INPUT, - output_schema=_SCHEMA_UPDATE_SECRET_VERSION_STAGE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.secretsmanager#InternalServiceError" - ): InternalServiceError, - ShapeID( - "com.amazonaws.secretsmanager#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.secretsmanager#InvalidRequestException" - ): InvalidRequestException, - ShapeID( - "com.amazonaws.secretsmanager#LimitExceededException" - ): LimitExceededException, - ShapeID( - "com.amazonaws.secretsmanager#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_SERVICE_ERROR, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_INVALID_REQUEST_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, +LIST_SECRETS: APIOperation[ListSecretsInput, ListSecretsOutput] = APIOperation( + static_schema=_SCHEMA_LIST_SECRETS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.secretsmanager#InternalServiceError"), + ShapeID("com.amazonaws.secretsmanager#InvalidNextTokenException"), + ShapeID("com.amazonaws.secretsmanager#InvalidParameterException"), + ShapeID("com.amazonaws.secretsmanager#InvalidRequestException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) +LIST_SECRET_VERSION_IDS: APIOperation[ + ListSecretVersionIdsInput, ListSecretVersionIdsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_SECRET_VERSION_IDS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.secretsmanager#InternalServiceError"), + ShapeID("com.amazonaws.secretsmanager#InvalidNextTokenException"), + ShapeID("com.amazonaws.secretsmanager#InvalidParameterException"), + ShapeID("com.amazonaws.secretsmanager#ResourceNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -@dataclass(kw_only=True) -class ValidateResourcePolicyInput: - """Dataclass for ValidateResourcePolicyInput structure.""" - - secret_id: str | None = None - """ - The ARN or name of the secret with the resource-based policy you want to - validate. - """ - - resource_policy: str | None = None - """ - A JSON-formatted string that contains an Amazon Web Services - resource-based policy. The policy in the string identifies who can - access or manage this secret and its versions. For example policies, see - [Permissions policy - examples](https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VALIDATE_RESOURCE_POLICY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.secret_id is not None: - serializer.write_string( - _SCHEMA_VALIDATE_RESOURCE_POLICY_INPUT.members["SecretId"], - self.secret_id, - ) - - if self.resource_policy is not None: - serializer.write_string( - _SCHEMA_VALIDATE_RESOURCE_POLICY_INPUT.members["ResourcePolicy"], - self.resource_policy, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["secret_id"] = de.read_string( - _SCHEMA_VALIDATE_RESOURCE_POLICY_INPUT.members["SecretId"] - ) - - case 1: - kwargs["resource_policy"] = de.read_string( - _SCHEMA_VALIDATE_RESOURCE_POLICY_INPUT.members["ResourcePolicy"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_VALIDATE_RESOURCE_POLICY_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ValidationErrorsEntry: - """Displays errors that occurred during validation of the resource policy.""" - - check_name: str | None = None - """Checks the name of the policy.""" - - error_message: str | None = None - """ - Displays error messages if validation encounters problems during - validation of the resource policy. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VALIDATION_ERRORS_ENTRY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.check_name is not None: - serializer.write_string( - _SCHEMA_VALIDATION_ERRORS_ENTRY.members["CheckName"], self.check_name - ) - - if self.error_message is not None: - serializer.write_string( - _SCHEMA_VALIDATION_ERRORS_ENTRY.members["ErrorMessage"], - self.error_message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["check_name"] = de.read_string( - _SCHEMA_VALIDATION_ERRORS_ENTRY.members["CheckName"] - ) - - case 1: - kwargs["error_message"] = de.read_string( - _SCHEMA_VALIDATION_ERRORS_ENTRY.members["ErrorMessage"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VALIDATION_ERRORS_ENTRY, consumer=_consumer) - return kwargs - - -def _serialize_validation_errors_type( - serializer: ShapeSerializer, schema: Schema, value: list[ValidationErrorsEntry] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_validation_errors_type( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ValidationErrorsEntry]: - result: list[ValidationErrorsEntry] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ValidationErrorsEntry.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ValidateResourcePolicyOutput: - """Dataclass for ValidateResourcePolicyOutput structure.""" - - policy_validation_passed: bool = False - """True if your policy passes validation, otherwise false.""" - - validation_errors: list[ValidationErrorsEntry] | None = None - """Validation errors if your policy didn't pass validation.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False +PUT_RESOURCE_POLICY: APIOperation[PutResourcePolicyInput, PutResourcePolicyOutput] = ( + APIOperation( + static_schema=_SCHEMA_PUT_RESOURCE_POLICY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.secretsmanager#InternalServiceError"), + ShapeID("com.amazonaws.secretsmanager#InvalidParameterException"), + ShapeID("com.amazonaws.secretsmanager#InvalidRequestException"), + ShapeID("com.amazonaws.secretsmanager#MalformedPolicyDocumentException"), + ShapeID("com.amazonaws.secretsmanager#PublicPolicyException"), + ShapeID("com.amazonaws.secretsmanager#ResourceNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ +) - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VALIDATE_RESOURCE_POLICY_OUTPUT, self) +PUT_SECRET_VALUE: APIOperation[PutSecretValueInput, PutSecretValueOutput] = ( + APIOperation( + static_schema=_SCHEMA_PUT_SECRET_VALUE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.secretsmanager#DecryptionFailure"), + ShapeID("com.amazonaws.secretsmanager#EncryptionFailure"), + ShapeID("com.amazonaws.secretsmanager#InternalServiceError"), + ShapeID("com.amazonaws.secretsmanager#InvalidParameterException"), + ShapeID("com.amazonaws.secretsmanager#InvalidRequestException"), + ShapeID("com.amazonaws.secretsmanager#LimitExceededException"), + ShapeID("com.amazonaws.secretsmanager#ResourceExistsException"), + ShapeID("com.amazonaws.secretsmanager#ResourceNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_boolean( - _SCHEMA_VALIDATE_RESOURCE_POLICY_OUTPUT.members["PolicyValidationPassed"], - self.policy_validation_passed, - ) - if self.validation_errors is not None: - _serialize_validation_errors_type( - serializer, - _SCHEMA_VALIDATE_RESOURCE_POLICY_OUTPUT.members["ValidationErrors"], - self.validation_errors, - ) +REMOVE_REGIONS_FROM_REPLICATION: APIOperation[ + RemoveRegionsFromReplicationInput, RemoveRegionsFromReplicationOutput +] = APIOperation( + static_schema=_SCHEMA_REMOVE_REGIONS_FROM_REPLICATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.secretsmanager#InternalServiceError"), + ShapeID("com.amazonaws.secretsmanager#InvalidParameterException"), + ShapeID("com.amazonaws.secretsmanager#InvalidRequestException"), + ShapeID("com.amazonaws.secretsmanager#ResourceNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) +REPLICATE_SECRET_TO_REGIONS: APIOperation[ + ReplicateSecretToRegionsInput, ReplicateSecretToRegionsOutput +] = APIOperation( + static_schema=_SCHEMA_REPLICATE_SECRET_TO_REGIONS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.secretsmanager#InternalServiceError"), + ShapeID("com.amazonaws.secretsmanager#InvalidParameterException"), + ShapeID("com.amazonaws.secretsmanager#InvalidRequestException"), + ShapeID("com.amazonaws.secretsmanager#ResourceNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +RESTORE_SECRET: APIOperation[RestoreSecretInput, RestoreSecretOutput] = APIOperation( + static_schema=_SCHEMA_RESTORE_SECRET, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.secretsmanager#InternalServiceError"), + ShapeID("com.amazonaws.secretsmanager#InvalidParameterException"), + ShapeID("com.amazonaws.secretsmanager#InvalidRequestException"), + ShapeID("com.amazonaws.secretsmanager#ResourceNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["policy_validation_passed"] = de.read_boolean( - _SCHEMA_VALIDATE_RESOURCE_POLICY_OUTPUT.members[ - "PolicyValidationPassed" - ] - ) +ROTATE_SECRET: APIOperation[RotateSecretInput, RotateSecretOutput] = APIOperation( + static_schema=_SCHEMA_ROTATE_SECRET, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.secretsmanager#InternalServiceError"), + ShapeID("com.amazonaws.secretsmanager#InvalidParameterException"), + ShapeID("com.amazonaws.secretsmanager#InvalidRequestException"), + ShapeID("com.amazonaws.secretsmanager#ResourceNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 1: - kwargs["validation_errors"] = _deserialize_validation_errors_type( - de, - _SCHEMA_VALIDATE_RESOURCE_POLICY_OUTPUT.members[ - "ValidationErrors" - ], - ) +STOP_REPLICATION_TO_REPLICA: APIOperation[ + StopReplicationToReplicaInput, StopReplicationToReplicaOutput +] = APIOperation( + static_schema=_SCHEMA_STOP_REPLICATION_TO_REPLICA, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.secretsmanager#InternalServiceError"), + ShapeID("com.amazonaws.secretsmanager#InvalidParameterException"), + ShapeID("com.amazonaws.secretsmanager#InvalidRequestException"), + ShapeID("com.amazonaws.secretsmanager#ResourceNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case _: - logger.debug("Unexpected member schema: %s", schema) +TAG_RESOURCE: APIOperation[TagResourceInput, TagResourceOutput] = APIOperation( + static_schema=_SCHEMA_TAG_RESOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.secretsmanager#InternalServiceError"), + ShapeID("com.amazonaws.secretsmanager#InvalidParameterException"), + ShapeID("com.amazonaws.secretsmanager#InvalidRequestException"), + ShapeID("com.amazonaws.secretsmanager#ResourceNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - deserializer.read_struct( - _SCHEMA_VALIDATE_RESOURCE_POLICY_OUTPUT, consumer=_consumer - ) - return kwargs +UNTAG_RESOURCE: APIOperation[UntagResourceInput, UntagResourceOutput] = APIOperation( + static_schema=_SCHEMA_UNTAG_RESOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.secretsmanager#InternalServiceError"), + ShapeID("com.amazonaws.secretsmanager#InvalidParameterException"), + ShapeID("com.amazonaws.secretsmanager#InvalidRequestException"), + ShapeID("com.amazonaws.secretsmanager#ResourceNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +UPDATE_SECRET: APIOperation[UpdateSecretInput, UpdateSecretOutput] = APIOperation( + static_schema=_SCHEMA_UPDATE_SECRET, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.secretsmanager#DecryptionFailure"), + ShapeID("com.amazonaws.secretsmanager#EncryptionFailure"), + ShapeID("com.amazonaws.secretsmanager#InternalServiceError"), + ShapeID("com.amazonaws.secretsmanager#InvalidParameterException"), + ShapeID("com.amazonaws.secretsmanager#InvalidRequestException"), + ShapeID("com.amazonaws.secretsmanager#LimitExceededException"), + ShapeID("com.amazonaws.secretsmanager#MalformedPolicyDocumentException"), + ShapeID("com.amazonaws.secretsmanager#PreconditionNotMetException"), + ShapeID("com.amazonaws.secretsmanager#ResourceExistsException"), + ShapeID("com.amazonaws.secretsmanager#ResourceNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -VALIDATE_RESOURCE_POLICY = APIOperation( - input=ValidateResourcePolicyInput, - output=ValidateResourcePolicyOutput, - schema=_SCHEMA_VALIDATE_RESOURCE_POLICY, - input_schema=_SCHEMA_VALIDATE_RESOURCE_POLICY_INPUT, - output_schema=_SCHEMA_VALIDATE_RESOURCE_POLICY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.secretsmanager#InternalServiceError" - ): InternalServiceError, - ShapeID( - "com.amazonaws.secretsmanager#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.secretsmanager#InvalidRequestException" - ): InvalidRequestException, - ShapeID( - "com.amazonaws.secretsmanager#MalformedPolicyDocumentException" - ): MalformedPolicyDocumentException, - ShapeID( - "com.amazonaws.secretsmanager#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), +UPDATE_SECRET_VERSION_STAGE: APIOperation[ + UpdateSecretVersionStageInput, UpdateSecretVersionStageOutput +] = APIOperation( + static_schema=_SCHEMA_UPDATE_SECRET_VERSION_STAGE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.secretsmanager#InternalServiceError"), + ShapeID("com.amazonaws.secretsmanager#InvalidParameterException"), + ShapeID("com.amazonaws.secretsmanager#InvalidRequestException"), + ShapeID("com.amazonaws.secretsmanager#LimitExceededException"), + ShapeID("com.amazonaws.secretsmanager#ResourceNotFoundException"), + ], effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INTERNAL_SERVICE_ERROR, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_INVALID_REQUEST_EXCEPTION, - _SCHEMA_MALFORMED_POLICY_DOCUMENT_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, +) + +VALIDATE_RESOURCE_POLICY: APIOperation[ + ValidateResourcePolicyInput, ValidateResourcePolicyOutput +] = APIOperation( + static_schema=_SCHEMA_VALIDATE_RESOURCE_POLICY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.secretsmanager#InternalServiceError"), + ShapeID("com.amazonaws.secretsmanager#InvalidParameterException"), + ShapeID("com.amazonaws.secretsmanager#InvalidRequestException"), + ShapeID("com.amazonaws.secretsmanager#MalformedPolicyDocumentException"), + ShapeID("com.amazonaws.secretsmanager#ResourceNotFoundException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) diff --git a/clients/aws-sdk-secrets-manager/src/aws_sdk_secrets_manager/models.pyi b/clients/aws-sdk-secrets-manager/src/aws_sdk_secrets_manager/models.pyi new file mode 100644 index 00000000..10cdab20 --- /dev/null +++ b/clients/aws-sdk-secrets-manager/src/aws_sdk_secrets_manager/models.pyi @@ -0,0 +1,2193 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. + +from dataclasses import dataclass +from datetime import datetime +from enum import StrEnum +from typing import Self + +from smithy_core.deserializers import ShapeDeserializer +from smithy_core.exceptions import ModeledError +from smithy_core.response import ResponseMetadata +from smithy_core.schemas import APIOperation +from smithy_core.serializers import ShapeSerializer +from smithy_core.types import UnknownEnumMixin + +class _SerdeShape: + def serialize(self, serializer: ShapeSerializer) -> None: ... + def serialize_members(self, serializer: ShapeSerializer) -> None: ... + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: ... + +class ServiceError(ModeledError): + """ + Base error for all errors in the service. + + Some exceptions do not extend from this class, including + synthetic, implicit, and shared exception types. + """ + +@dataclass(kw_only=True) +class APIErrorType(_SerdeShape): + """ + The error Secrets Manager encountered while retrieving an individual + secret as part of BatchGetSecretValue. + """ + + secret_id: str | None = ... + """The ARN or name of the secret.""" + error_code: str | None = ... + """ + The error Secrets Manager encountered while retrieving an individual + secret as part of BatchGetSecretValue, for example + `ResourceNotFoundException`,`InvalidParameterException`, + `InvalidRequestException`, `DecryptionFailure`, or + `AccessDeniedException`. + """ + message: str | None = ... + """A message describing the error.""" + +@dataclass(kw_only=True) +class BatchGetSecretValueInput(_SerdeShape): + """Dataclass for BatchGetSecretValueInput structure.""" + + secret_id_list: list[str] | None = ... + """ + The ARN or names of the secrets to retrieve. You must include `Filters` + or `SecretIdList`, but not both. + """ + filters: list[Filter] | None = ... + """ + The filters to choose which secrets to retrieve. You must include + `Filters` or `SecretIdList`, but not both. + """ + max_results: int | None = ... + """ + The number of results to include in the response. + + If there are more results available, in the response, Secrets Manager + includes `NextToken`. To get the next results, call + `BatchGetSecretValue` again with the value from `NextToken`. To use this + parameter, you must also use the `Filters` parameter. + """ + next_token: str | None = ... + """ + A token that indicates where the output should continue from, if a + previous call did not show all results. To get the next results, call + `BatchGetSecretValue` again with this value. + """ + +@dataclass(kw_only=True) +class BatchGetSecretValueOutput(_SerdeShape): + """Dataclass for BatchGetSecretValueOutput structure.""" + + secret_values: list[SecretValueEntry] | None = ... + """A list of secret values.""" + next_token: str | None = ... + """ + Secrets Manager includes this value if there's more output available + than what is included in the current response. This can occur even when + the response includes no values at all, such as when you ask for a + filtered view of a long list. To get the next results, call + `BatchGetSecretValue` again with this value. + """ + errors: list[APIErrorType] | None = ... + """ + A list of errors Secrets Manager encountered while attempting to + retrieve individual secrets. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CancelRotateSecretInput(_SerdeShape): + """Dataclass for CancelRotateSecretInput structure.""" + + secret_id: str | None = ... + """ + The ARN or name of the secret. + + For an ARN, we recommend that you specify a complete ARN rather than a + partial ARN. See [Finding a secret from a partial + ARN](https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen). + """ + +@dataclass(kw_only=True) +class CancelRotateSecretOutput(_SerdeShape): + """Dataclass for CancelRotateSecretOutput structure.""" + + arn: str | None = ... + """The ARN of the secret.""" + name: str | None = ... + """The name of the secret.""" + version_id: str | None = ... + """ + The unique identifier of the version of the secret created during the + rotation. This version might not be complete, and should be evaluated + for possible deletion. We recommend that you remove the `VersionStage` + value `AWSPENDING` from this version so that Secrets Manager can delete + it. Failing to clean up a cancelled rotation can block you from starting + future rotations. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateSecretInput(_SerdeShape): + """Dataclass for CreateSecretInput structure.""" + + name: str | None = ... + """ + The name of the new secret. + + The secret name can contain ASCII letters, numbers, and the following + characters: /_+=.@- + + Do not end your secret name with a hyphen followed by six characters. If + you do so, you risk confusion and unexpected results when searching for + a secret by partial ARN. Secrets Manager automatically adds a hyphen and + six random characters after the secret name at the end of the ARN. + """ + client_request_token: str | None = ... + """ + If you include `SecretString` or `SecretBinary`, then Secrets Manager + creates an initial version for the secret, and this parameter specifies + the unique identifier for the new version. + + Note: + If you use the Amazon Web Services CLI or one of the Amazon Web Services + SDKs to call this operation, then you can leave this parameter empty. + The CLI or SDK generates a random UUID for you and includes it as the + value for this parameter in the request. + + If you generate a raw HTTP request to the Secrets Manager service + endpoint, then you must generate a `ClientRequestToken` and include it + in the request. + + This value helps ensure idempotency. Secrets Manager uses this value to + prevent the accidental creation of duplicate versions if there are + failures and retries during a rotation. We recommend that you generate a + [UUID-type](https://wikipedia.org/wiki/Universally_unique_identifier) + value to ensure uniqueness of your versions within the specified secret. + + - If the `ClientRequestToken` value isn't already associated with a + version of the secret then a new version of the secret is created. + + - If a version with this value already exists and the version + `SecretString` and `SecretBinary` values are the same as those in the + request, then the request is ignored. + + - If a version with this value already exists and that version's + `SecretString` and `SecretBinary` values are different from those in + the request, then the request fails because you cannot modify an + existing version. Instead, use PutSecretValue to create a new version. + + This value becomes the `VersionId` of the new version. + """ + description: str | None = ... + """The description of the secret.""" + kms_key_id: str | None = ... + """ + The ARN, key ID, or alias of the KMS key that Secrets Manager uses to + encrypt the secret value in the secret. An alias is always prefixed by + `alias/`, for example `alias/aws/secretsmanager`. For more information, + see [About + aliases](https://docs.aws.amazon.com/kms/latest/developerguide/alias-about.html). + + To use a KMS key in a different account, use the key ARN or the alias + ARN. + + If you don't specify this value, then Secrets Manager uses the key + `aws/secretsmanager`. If that key doesn't yet exist, then Secrets + Manager creates it for you automatically the first time it encrypts the + secret value. + + If the secret is in a different Amazon Web Services account from the + credentials calling the API, then you can't use `aws/secretsmanager` to + encrypt the secret, and you must create and use a customer managed KMS + key. + """ + secret_binary: bytes | None = ... + """ + The binary data to encrypt and store in the new version of the secret. + We recommend that you store your binary data in a file and then pass the + contents of the file as a parameter. + + Either `SecretString` or `SecretBinary` must have a value, but not both. + + This parameter is not available in the Secrets Manager console. + + Sensitive: This field contains sensitive information, so the service + does not include it in CloudTrail log entries. If you create your own + log entries, you must also avoid logging the information in this field. + """ + secret_string: str | None = ... + """ + The text data to encrypt and store in this new version of the secret. We + recommend you use a JSON structure of key/value pairs for your secret + value. + + Either `SecretString` or `SecretBinary` must have a value, but not both. + + If you create a secret by using the Secrets Manager console then Secrets + Manager puts the protected secret text in only the `SecretString` + parameter. The Secrets Manager console stores the information as a JSON + structure of key/value pairs that a Lambda rotation function can parse. + + Sensitive: This field contains sensitive information, so the service + does not include it in CloudTrail log entries. If you create your own + log entries, you must also avoid logging the information in this field. + """ + tags: list[Tag] | None = ... + """ + A list of tags to attach to the secret. Each tag is a key and value pair + of strings in a JSON text string, for example: + + `[{"Key":"CostCenter","Value":"12345"},{"Key":"environment","Value":"production"}]` + + Secrets Manager tag key names are case sensitive. A tag with the key + \"ABC\" is a different tag from one with key \"abc\". + + If you check tags in permissions policies as part of your security + strategy, then adding or removing a tag can change permissions. If the + completion of this operation would result in you losing your permissions + for this secret, then Secrets Manager blocks the operation and returns + an `Access Denied` error. For more information, see [Control access to + secrets using + tags](https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html#tag-secrets-abac) + and [Limit access to identities with tags that match secrets' + tags](https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html#auth-and-access_tags2). + + For information about how to format a JSON parameter for the various + command line tool environments, see [Using JSON for + Parameters](https://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#cli-using-param-json). + If your command-line tool or SDK requires quotation marks around the + parameter, you should use single quotes to avoid confusion with the + double quotes required in the JSON text. + + For tag quotas and naming restrictions, see [Service quotas for + Tagging](https://docs.aws.amazon.com/general/latest/gr/arg.html#taged-reference-quotas) + in the *Amazon Web Services General Reference guide*. + """ + add_replica_regions: list[ReplicaRegionType] | None = ... + """A list of Regions and KMS keys to replicate secrets.""" + force_overwrite_replica_secret: bool = ... + """ + Specifies whether to overwrite a secret with the same name in the + destination Region. By default, secrets aren't overwritten. + """ + type: str | None = ... + """ + The exact string that identifies the partner that holds the external + secret. For more information, see [Using Secrets Manager managed + external + secrets](https://docs.aws.amazon.com/secretsmanager/latest/userguide/managed-external-secrets.html). + """ + +@dataclass(kw_only=True) +class CreateSecretOutput(_SerdeShape): + """Dataclass for CreateSecretOutput structure.""" + + arn: str | None = ... + """ + The ARN of the new secret. The ARN includes the name of the secret + followed by six random characters. This ensures that if you create a new + secret with the same name as a deleted secret, then users with access to + the old secret don't get access to the new secret because the ARNs are + different. + """ + name: str | None = ... + """The name of the new secret.""" + version_id: str | None = ... + """The unique identifier associated with the version of the new secret.""" + replication_status: list[ReplicationStatusType] | None = ... + """ + A list of the replicas of this secret and their status: + + - `Failed`, which indicates that the replica was not created. + + - `InProgress`, which indicates that Secrets Manager is in the process + of creating the replica. + + - `InSync`, which indicates that the replica was created. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DecryptionFailure(ServiceError, _SerdeShape): + """ + Secrets Manager can't decrypt the protected secret text using the + provided KMS key. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteResourcePolicyInput(_SerdeShape): + """Dataclass for DeleteResourcePolicyInput structure.""" + + secret_id: str | None = ... + """ + The ARN or name of the secret to delete the attached resource-based + policy for. + + For an ARN, we recommend that you specify a complete ARN rather than a + partial ARN. See [Finding a secret from a partial + ARN](https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen). + """ + +@dataclass(kw_only=True) +class DeleteResourcePolicyOutput(_SerdeShape): + """Dataclass for DeleteResourcePolicyOutput structure.""" + + arn: str | None = ... + """The ARN of the secret that the resource-based policy was deleted for.""" + name: str | None = ... + """The name of the secret that the resource-based policy was deleted for.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteSecretInput(_SerdeShape): + """Dataclass for DeleteSecretInput structure.""" + + secret_id: str | None = ... + """ + The ARN or name of the secret to delete. + + For an ARN, we recommend that you specify a complete ARN rather than a + partial ARN. See [Finding a secret from a partial + ARN](https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen). + """ + recovery_window_in_days: int | None = ... + """ + The number of days from 7 to 30 that Secrets Manager waits before + permanently deleting the secret. You can't use both this parameter and + `ForceDeleteWithoutRecovery` in the same call. If you don't use either, + then by default Secrets Manager uses a 30 day recovery window. + """ + force_delete_without_recovery: bool | None = ... + """ + Specifies whether to delete the secret without any recovery window. You + can't use both this parameter and `RecoveryWindowInDays` in the same + call. If you don't use either, then by default Secrets Manager uses a + 30 day recovery window. + + Secrets Manager performs the actual deletion with an asynchronous + background process, so there might be a short delay before the secret is + permanently deleted. If you delete a secret and then immediately create + a secret with the same name, use appropriate back off and retry logic. + + If you forcibly delete an already deleted or nonexistent secret, the + operation does not return `ResourceNotFoundException`. + + Warning: + Use this parameter with caution. This parameter causes the operation to + skip the normal recovery window before the permanent deletion that + Secrets Manager would normally impose with the `RecoveryWindowInDays` + parameter. If you delete a secret with the `ForceDeleteWithoutRecovery` + parameter, then you have no opportunity to recover the secret. You lose + the secret permanently. + """ + +@dataclass(kw_only=True) +class DeleteSecretOutput(_SerdeShape): + """Dataclass for DeleteSecretOutput structure.""" + + arn: str | None = ... + """The ARN of the secret.""" + name: str | None = ... + """The name of the secret.""" + deletion_date: datetime | None = ... + """ + The date and time after which this secret Secrets Manager can + permanently delete this secret, and it can no longer be restored. This + value is the date and time of the delete request plus the number of days + in `RecoveryWindowInDays`. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DescribeSecretInput(_SerdeShape): + """Dataclass for DescribeSecretInput structure.""" + + secret_id: str | None = ... + """ + The ARN or name of the secret. + + For an ARN, we recommend that you specify a complete ARN rather than a + partial ARN. See [Finding a secret from a partial + ARN](https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen). + """ + +@dataclass(kw_only=True) +class DescribeSecretOutput(_SerdeShape): + """Dataclass for DescribeSecretOutput structure.""" + + arn: str | None = ... + """The ARN of the secret.""" + name: str | None = ... + """The name of the secret.""" + type: str | None = ... + """ + The exact string that identifies the partner that holds the external + secret. For more information, see [Using Secrets Manager managed + external + secrets](https://docs.aws.amazon.com/secretsmanager/latest/userguide/managed-external-secrets.html). + """ + description: str | None = ... + """The description of the secret.""" + kms_key_id: str | None = ... + """ + The key ID or alias ARN of the KMS key that Secrets Manager uses to + encrypt the secret value. If the secret is encrypted with the Amazon Web + Services managed key `aws/secretsmanager`, this field is omitted. + Secrets created using the console use an KMS key ID. + """ + rotation_enabled: bool | None = ... + """ + Specifies whether automatic rotation is turned on for this secret. If + the secret has never been configured for rotation, Secrets Manager + returns null. + + To turn on rotation, use RotateSecret. To turn off rotation, use + CancelRotateSecret. + """ + rotation_lambda_arn: str | None = ... + """ + The ARN of the Lambda function that Secrets Manager invokes to rotate + the secret. + """ + rotation_rules: RotationRulesType | None = ... + """ + The rotation schedule and Lambda function for this secret. If the secret + previously had rotation turned on, but it is now turned off, this field + shows the previous rotation schedule and rotation function. If the + secret never had rotation turned on, this field is omitted. + """ + external_secret_rotation_metadata: ( + list[ExternalSecretRotationMetadataItem] | None + ) = ... + """ + The metadata needed to successfully rotate a managed external secret. A + list of key value pairs in JSON format specified by the partner. For + more information about the required information, see [Managed external + secrets + partners](https://docs.aws.amazon.com/secretsmanager/latest/userguide/mes-partners.html). + """ + external_secret_rotation_role_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the role that allows Secrets Manager + to rotate a secret held by a third-party partner. For more information, + see [Security and + permissions](https://docs.aws.amazon.com/secretsmanager/latest/userguide/mes-security.html). + """ + last_rotated_date: datetime | None = ... + """ + The last date and time that Secrets Manager rotated the secret. If the + secret isn't configured for rotation or rotation has been disabled, + Secrets Manager returns null. + """ + last_changed_date: datetime | None = ... + """The last date and time that this secret was modified in any way.""" + last_accessed_date: datetime | None = ... + """ + The date that the secret was last accessed in the Region. This field is + omitted if the secret has never been retrieved in the Region. + """ + deleted_date: datetime | None = ... + """ + The date the secret is scheduled for deletion. If it is not scheduled + for deletion, this field is omitted. When you delete a secret, Secrets + Manager requires a recovery window of at least 7 days before deleting + the secret. Some time after the deleted date, Secrets Manager deletes + the secret, including all of its versions. + + If a secret is scheduled for deletion, then its details, including the + encrypted secret value, is not accessible. To cancel a scheduled + deletion and restore access to the secret, use RestoreSecret. + """ + next_rotation_date: datetime | None = ... + """ + The next rotation is scheduled to occur on or before this date. If the + secret isn't configured for rotation or rotation has been disabled, + Secrets Manager returns null. If rotation fails, Secrets Manager retries + the entire rotation process multiple times. If rotation is unsuccessful, + this date may be in the past. + + This date represents the latest date that rotation will occur, but it is + not an approximate rotation date. In some cases, for example if you turn + off automatic rotation and then turn it back on, the next rotation may + occur much sooner than this date. + """ + tags: list[Tag] | None = ... + """ + The list of tags attached to the secret. To add tags to a secret, use + TagResource. To remove tags, use UntagResource. + """ + version_ids_to_stages: dict[str, list[str]] | None = ... + """ + A list of the versions of the secret that have staging labels attached. + Versions that don't have staging labels are considered deprecated and + Secrets Manager can delete them. + + Secrets Manager uses staging labels to indicate the status of a secret + version during rotation. The three staging labels for rotation are: + + - `AWSCURRENT`, which indicates the current version of the secret. + + - `AWSPENDING`, which indicates the version of the secret that contains + new secret information that will become the next current version when + rotation finishes. + + During rotation, Secrets Manager creates an `AWSPENDING` version ID + before creating the new secret version. To check if a secret version + exists, call GetSecretValue. + + - `AWSPREVIOUS`, which indicates the previous current version of the + secret. You can use this as the *last known good* version. + + For more information about rotation and staging labels, see [How + rotation + works](https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_how.html). + """ + owning_service: str | None = ... + """ + The ID of the service that created this secret. For more information, + see [Secrets managed by other Amazon Web Services + services](https://docs.aws.amazon.com/secretsmanager/latest/userguide/service-linked-secrets.html). + """ + created_date: datetime | None = ... + """The date the secret was created.""" + primary_region: str | None = ... + """ + The Region the secret is in. If a secret is replicated to other Regions, + the replicas are listed in `ReplicationStatus`. + """ + replication_status: list[ReplicationStatusType] | None = ... + """ + A list of the replicas of this secret and their status: + + - `Failed`, which indicates that the replica was not created. + + - `InProgress`, which indicates that Secrets Manager is in the process + of creating the replica. + + - `InSync`, which indicates that the replica was created. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class EncryptionFailure(ServiceError, _SerdeShape): + """ + Secrets Manager can't encrypt the protected secret text using the + provided KMS key. Check that the KMS key is available, enabled, and not + in an invalid state. For more information, see [Key state: Effect on + your KMS + key](https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html). + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ExternalSecretRotationMetadataItem(_SerdeShape): + """ + The metadata needed to successfully rotate a managed external secret. A + list of key value pairs in JSON format specified by the partner. For + more information, see [Managed external secret + partners](https://docs.aws.amazon.com/secretsmanager/latest/userguide/mes-partners.html). + """ + + key: str | None = ... + """The key that identifies the item.""" + value: str | None = ... + """The value of the specified item.""" + +@dataclass(kw_only=True) +class Filter(_SerdeShape): + """ + Allows you to add filters when you use the search function in Secrets + Manager. For more information, see [Find secrets in Secrets + Manager](https://docs.aws.amazon.com/secretsmanager/latest/userguide/manage_search-secret.html). + """ + + key: str | None = ... + """ + The following are keys you can use: + + - **description**: Prefix match, not case-sensitive. + + - **name**: Prefix match, case-sensitive. + + - **tag-key**: Prefix match, case-sensitive. + + - **tag-value**: Prefix match, case-sensitive. + + - **primary-region**: Prefix match, case-sensitive. + + - **owning-service**: Prefix match, case-sensitive. + + - **all**: Breaks the filter value string into words and then searches + all attributes for matches. Not case-sensitive. + """ + values: list[str] | None = ... + """ + The keyword to filter for. + + You can prefix your search value with an exclamation mark (`!`) in order + to perform negation filters. + """ + +class FilterNameStringType(UnknownEnumMixin, StrEnum): + DESCRIPTION = "description" + NAME = "name" + TAG_KEY = "tag-key" + TAG_VALUE = "tag-value" + PRIMARY_REGION = "primary-region" + OWNING_SERVICE = "owning-service" + ALL = "all" + +@dataclass(kw_only=True) +class GetRandomPasswordInput(_SerdeShape): + """Dataclass for GetRandomPasswordInput structure.""" + + password_length: int | None = ... + """ + The length of the password. If you don't include this parameter, the + default length is 32 characters. + """ + exclude_characters: str | None = ... + """A string of the characters that you don't want in the password.""" + exclude_numbers: bool | None = ... + """ + Specifies whether to exclude numbers from the password. If you don't + include this switch, the password can contain numbers. + """ + exclude_punctuation: bool | None = ... + """ + Specifies whether to exclude the following punctuation characters from + the password: + `` ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \\ ] ^ _ ` { | } ~ ``. + If you don't include this switch, the password can contain punctuation. + """ + exclude_uppercase: bool | None = ... + """ + Specifies whether to exclude uppercase letters from the password. If you + don't include this switch, the password can contain uppercase letters. + """ + exclude_lowercase: bool | None = ... + """ + Specifies whether to exclude lowercase letters from the password. If you + don't include this switch, the password can contain lowercase letters. + """ + include_space: bool | None = ... + """ + Specifies whether to include the space character. If you include this + switch, the password can contain space characters. + """ + require_each_included_type: bool | None = ... + """ + Specifies whether to include at least one upper and lowercase letter, + one number, and one punctuation. If you don't include this switch, the + password contains at least one of every character type. + """ + +@dataclass(kw_only=True) +class GetRandomPasswordOutput(_SerdeShape): + """Dataclass for GetRandomPasswordOutput structure.""" + + random_password: str | None = ... + """A string with the password.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetResourcePolicyInput(_SerdeShape): + """Dataclass for GetResourcePolicyInput structure.""" + + secret_id: str | None = ... + """ + The ARN or name of the secret to retrieve the attached resource-based + policy for. + + For an ARN, we recommend that you specify a complete ARN rather than a + partial ARN. See [Finding a secret from a partial + ARN](https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen). + """ + +@dataclass(kw_only=True) +class GetResourcePolicyOutput(_SerdeShape): + """Dataclass for GetResourcePolicyOutput structure.""" + + arn: str | None = ... + """The ARN of the secret that the resource-based policy was retrieved for.""" + name: str | None = ... + """The name of the secret that the resource-based policy was retrieved for.""" + resource_policy: str | None = ... + """ + A JSON-formatted string that contains the permissions policy attached to + the secret. For more information about permissions policies, see + [Authentication and access control for Secrets + Manager](https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html). + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetSecretValueInput(_SerdeShape): + """Dataclass for GetSecretValueInput structure.""" + + secret_id: str | None = ... + """ + The ARN or name of the secret to retrieve. To retrieve a secret from + another account, you must use an ARN. + + For an ARN, we recommend that you specify a complete ARN rather than a + partial ARN. See [Finding a secret from a partial + ARN](https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen). + """ + version_id: str | None = ... + """ + The unique identifier of the version of the secret to retrieve. If you + include both this parameter and `VersionStage`, the two parameters must + refer to the same secret version. If you don't specify either a + `VersionStage` or `VersionId`, then Secrets Manager returns the + `AWSCURRENT` version. + + This value is typically a + [UUID-type](https://wikipedia.org/wiki/Universally_unique_identifier) + value with 32 hexadecimal digits. + """ + version_stage: str | None = ... + """ + The staging label of the version of the secret to retrieve. + + Secrets Manager uses staging labels to keep track of different versions + during the rotation process. If you include both this parameter and + `VersionId`, the two parameters must refer to the same secret version. + If you don't specify either a `VersionStage` or `VersionId`, Secrets + Manager returns the `AWSCURRENT` version. + """ + +@dataclass(kw_only=True) +class GetSecretValueOutput(_SerdeShape): + """Dataclass for GetSecretValueOutput structure.""" + + arn: str | None = ... + """The ARN of the secret.""" + name: str | None = ... + """The friendly name of the secret.""" + version_id: str | None = ... + """The unique identifier of this version of the secret.""" + secret_binary: bytes | None = ... + """ + The decrypted secret value, if the secret value was originally provided + as binary data in the form of a byte array. When you retrieve a + `SecretBinary` using the HTTP API, the Python SDK, or the Amazon Web + Services CLI, the value is Base64-encoded. Otherwise, it is not encoded. + + If the secret was created by using the Secrets Manager console, or if + the secret value was originally provided as a string, then this field is + omitted. The secret value appears in `SecretString` instead. + + Sensitive: This field contains sensitive information, so the service + does not include it in CloudTrail log entries. If you create your own + log entries, you must also avoid logging the information in this field. + """ + secret_string: str | None = ... + """ + The decrypted secret value, if the secret value was originally provided + as a string or through the Secrets Manager console. + + If this secret was created by using the console, then Secrets Manager + stores the information as a JSON structure of key/value pairs. + + Sensitive: This field contains sensitive information, so the service + does not include it in CloudTrail log entries. If you create your own + log entries, you must also avoid logging the information in this field. + """ + version_stages: list[str] | None = ... + """ + A list of all of the staging labels currently attached to this version + of the secret. + """ + created_date: datetime | None = ... + """ + The date and time that this version of the secret was created. If you + don't specify which version in `VersionId` or `VersionStage`, then + Secrets Manager uses the `AWSCURRENT` version. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InternalServiceError(ServiceError, _SerdeShape): + """An error occurred on the server side.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidNextTokenException(ServiceError, _SerdeShape): + """The `NextToken` value is invalid.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidParameterException(ServiceError, _SerdeShape): + """The parameter name or value is invalid.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidRequestException(ServiceError, _SerdeShape): + """ + A parameter value is not valid for the current state of the resource. + + Possible causes: + + - The secret is scheduled for deletion. + + - You tried to enable rotation on a secret that doesn't already have a + Lambda function ARN configured and you didn't include such an ARN as + a parameter in this call. + + - The secret is managed by another service, and you must use that + service to update it. For more information, see [Secrets managed by + other Amazon Web Services + services](https://docs.aws.amazon.com/secretsmanager/latest/userguide/service-linked-secrets.html). + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class LimitExceededException(ServiceError, _SerdeShape): + """ + The request failed because it would exceed one of the Secrets Manager + quotas. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListSecretsInput(_SerdeShape): + """Dataclass for ListSecretsInput structure.""" + + include_planned_deletion: bool | None = ... + """ + Specifies whether to include secrets scheduled for deletion. By default, + secrets scheduled for deletion aren't included. + """ + max_results: int | None = ... + """ + The number of results to include in the response. + + If there are more results available, in the response, Secrets Manager + includes `NextToken`. To get the next results, call `ListSecrets` again + with the value from `NextToken`. + """ + next_token: str | None = ... + """ + A token that indicates where the output should continue from, if a + previous call did not show all results. To get the next results, call + `ListSecrets` again with this value. + """ + filters: list[Filter] | None = ... + """The filters to apply to the list of secrets.""" + sort_order: str | None = ... + """Secrets are listed by `CreatedDate`.""" + sort_by: str | None = ... + """If not specified, secrets are listed by `CreatedDate`.""" + +@dataclass(kw_only=True) +class ListSecretsOutput(_SerdeShape): + """Dataclass for ListSecretsOutput structure.""" + + secret_list: list[SecretListEntry] | None = ... + """A list of the secrets in the account.""" + next_token: str | None = ... + """ + Secrets Manager includes this value if there's more output available + than what is included in the current response. This can occur even when + the response includes no values at all, such as when you ask for a + filtered view of a long list. To get the next results, call + `ListSecrets` again with this value. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListSecretVersionIdsInput(_SerdeShape): + """Dataclass for ListSecretVersionIdsInput structure.""" + + secret_id: str | None = ... + """ + The ARN or name of the secret whose versions you want to list. + + For an ARN, we recommend that you specify a complete ARN rather than a + partial ARN. See [Finding a secret from a partial + ARN](https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen). + """ + max_results: int | None = ... + """ + The number of results to include in the response. + + If there are more results available, in the response, Secrets Manager + includes `NextToken`. To get the next results, call + `ListSecretVersionIds` again with the value from `NextToken`. + """ + next_token: str | None = ... + """ + A token that indicates where the output should continue from, if a + previous call did not show all results. To get the next results, call + `ListSecretVersionIds` again with this value. + """ + include_deprecated: bool | None = ... + """ + Specifies whether to include versions of secrets that don't have any + staging labels attached to them. Versions without staging labels are + considered deprecated and are subject to deletion by Secrets Manager. By + default, versions without staging labels aren't included. + """ + +@dataclass(kw_only=True) +class ListSecretVersionIdsOutput(_SerdeShape): + """Dataclass for ListSecretVersionIdsOutput structure.""" + + versions: list[SecretVersionsListEntry] | None = ... + """A list of the versions of the secret.""" + next_token: str | None = ... + """ + Secrets Manager includes this value if there's more output available + than what is included in the current response. This can occur even when + the response includes no values at all, such as when you ask for a + filtered view of a long list. To get the next results, call + `ListSecretVersionIds` again with this value. + """ + arn: str | None = ... + """The ARN of the secret.""" + name: str | None = ... + """The name of the secret.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class MalformedPolicyDocumentException(ServiceError, _SerdeShape): + """The resource policy has syntax errors.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class PreconditionNotMetException(ServiceError, _SerdeShape): + """ + The request failed because you did not complete all the prerequisite + steps. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class PublicPolicyException(ServiceError, _SerdeShape): + """ + The `BlockPublicPolicy` parameter is set to true, and the resource + policy did not prevent broad access to the secret. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class PutResourcePolicyInput(_SerdeShape): + """Dataclass for PutResourcePolicyInput structure.""" + + secret_id: str | None = ... + """ + The ARN or name of the secret to attach the resource-based policy. + + For an ARN, we recommend that you specify a complete ARN rather than a + partial ARN. See [Finding a secret from a partial + ARN](https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen). + """ + resource_policy: str | None = ... + """ + A JSON-formatted string for an Amazon Web Services resource-based + policy. For example policies, see [Permissions policy + examples](https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html). + """ + block_public_policy: bool | None = ... + """ + Specifies whether to block resource-based policies that allow broad + access to the secret, for example those that use a wildcard for the + principal. By default, public policies aren't blocked. + + Warning: + Resource policy validation and the BlockPublicPolicy parameter help + protect your resources by preventing public access from being granted + through the resource policies that are directly attached to your + secrets. In addition to using these features, carefully inspect the + following policies to confirm that they do not grant public access: + + - Identity-based policies attached to associated Amazon Web Services + principals (for example, IAM roles) + + - Resource-based policies attached to associated Amazon Web Services + resources (for example, Key Management Service (KMS) keys) + + To review permissions to your secrets, see [Determine who has + permissions to your + secrets](https://docs.aws.amazon.com/secretsmanager/latest/userguide/determine-acccess_examine-iam-policies.html). + """ + +@dataclass(kw_only=True) +class PutResourcePolicyOutput(_SerdeShape): + """Dataclass for PutResourcePolicyOutput structure.""" + + arn: str | None = ... + """The ARN of the secret.""" + name: str | None = ... + """The name of the secret.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class PutSecretValueInput(_SerdeShape): + """Dataclass for PutSecretValueInput structure.""" + + secret_id: str | None = ... + """ + The ARN or name of the secret to add a new version to. + + For an ARN, we recommend that you specify a complete ARN rather than a + partial ARN. See [Finding a secret from a partial + ARN](https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen). + + If the secret doesn't already exist, use `CreateSecret` instead. + """ + client_request_token: str | None = ... + """ + A unique identifier for the new version of the secret. + + Note: + If you use the Amazon Web Services CLI or one of the Amazon Web Services + SDKs to call this operation, then you can leave this parameter empty. + The CLI or SDK generates a random UUID for you and includes it as the + value for this parameter in the request. + + If you generate a raw HTTP request to the Secrets Manager service + endpoint, then you must generate a `ClientRequestToken` and include it + in the request. + + This value helps ensure idempotency. Secrets Manager uses this value to + prevent the accidental creation of duplicate versions if there are + failures and retries during a rotation. We recommend that you generate a + [UUID-type](https://wikipedia.org/wiki/Universally_unique_identifier) + value to ensure uniqueness of your versions within the specified secret. + + - If the `ClientRequestToken` value isn't already associated with a + version of the secret then a new version of the secret is created. + + - If a version with this value already exists and that version's + `SecretString` or `SecretBinary` values are the same as those in the + request then the request is ignored. The operation is idempotent. + + - If a version with this value already exists and the version of the + `SecretString` and `SecretBinary` values are different from those in + the request, then the request fails because you can't modify a secret + version. You can only create new versions to store new secret values. + + This value becomes the `VersionId` of the new version. + """ + secret_binary: bytes | None = ... + """ + The binary data to encrypt and store in the new version of the secret. + To use this parameter in the command-line tools, we recommend that you + store your binary data in a file and then pass the contents of the file + as a parameter. + + You must include `SecretBinary` or `SecretString`, but not both. + + You can't access this value from the Secrets Manager console. + + Sensitive: This field contains sensitive information, so the service + does not include it in CloudTrail log entries. If you create your own + log entries, you must also avoid logging the information in this field. + """ + secret_string: str | None = ... + """ + The text to encrypt and store in the new version of the secret. + + You must include `SecretBinary` or `SecretString`, but not both. + + We recommend you create the secret string as JSON key/value pairs, as + shown in the example. + + Sensitive: This field contains sensitive information, so the service + does not include it in CloudTrail log entries. If you create your own + log entries, you must also avoid logging the information in this field. + """ + version_stages: list[str] | None = ... + """ + A list of staging labels to attach to this version of the secret. + Secrets Manager uses staging labels to track versions of a secret + through the rotation process. + + If you specify a staging label that's already associated with a + different version of the same secret, then Secrets Manager removes the + label from the other version and attaches it to this version. If you + specify `AWSCURRENT`, and it is already attached to another version, + then Secrets Manager also moves the staging label `AWSPREVIOUS` to the + version that `AWSCURRENT` was removed from. + + If you don't include `VersionStages`, then Secrets Manager + automatically moves the staging label `AWSCURRENT` to this version. + """ + rotation_token: str | None = ... + """ + A unique identifier that indicates the source of the request. Required + for secret rotations using an IAM assumed role or cross-account + rotation, in which you rotate a secret in one account by using a Lambda + rotation function in another account. In both cases, the rotation + function assumes an IAM role to call Secrets Manager, and then Secrets + Manager validates the identity using the token. For more information, + see [How rotation + works](https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotating-secrets.html) + and [Rotation by Lambda + functions](https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_lambda). + + Sensitive: This field contains sensitive information, so the service + does not include it in CloudTrail log entries. If you create your own + log entries, you must also avoid logging the information in this field. + """ + +@dataclass(kw_only=True) +class PutSecretValueOutput(_SerdeShape): + """Dataclass for PutSecretValueOutput structure.""" + + arn: str | None = ... + """The ARN of the secret.""" + name: str | None = ... + """The name of the secret.""" + version_id: str | None = ... + """The unique identifier of the version of the secret.""" + version_stages: list[str] | None = ... + """ + The list of staging labels that are currently attached to this version + of the secret. Secrets Manager uses staging labels to track a version as + it progresses through the secret rotation process. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class RemoveRegionsFromReplicationInput(_SerdeShape): + """Dataclass for RemoveRegionsFromReplicationInput structure.""" + + secret_id: str | None = ... + """The ARN or name of the secret.""" + remove_replica_regions: list[str] | None = ... + """The Regions of the replicas to remove.""" + +@dataclass(kw_only=True) +class RemoveRegionsFromReplicationOutput(_SerdeShape): + """Dataclass for RemoveRegionsFromReplicationOutput structure.""" + + arn: str | None = ... + """The ARN of the primary secret.""" + replication_status: list[ReplicationStatusType] | None = ... + """The status of replicas for this secret after you remove Regions.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ReplicaRegionType(_SerdeShape): + """ + A custom type that specifies a `Region` and the `KmsKeyId` for a replica + secret. + """ + + region: str | None = ... + """ + A Region code. For a list of Region codes, see [Name and code of + Regions](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). + """ + kms_key_id: str | None = ... + """ + The ARN, key ID, or alias of the KMS key to encrypt the secret. If you + don't include this field, Secrets Manager uses `aws/secretsmanager`. + """ + +@dataclass(kw_only=True) +class ReplicateSecretToRegionsInput(_SerdeShape): + """Dataclass for ReplicateSecretToRegionsInput structure.""" + + secret_id: str | None = ... + """The ARN or name of the secret to replicate.""" + add_replica_regions: list[ReplicaRegionType] | None = ... + """A list of Regions in which to replicate the secret.""" + force_overwrite_replica_secret: bool = ... + """ + Specifies whether to overwrite a secret with the same name in the + destination Region. By default, secrets aren't overwritten. + """ + +@dataclass(kw_only=True) +class ReplicateSecretToRegionsOutput(_SerdeShape): + """Dataclass for ReplicateSecretToRegionsOutput structure.""" + + arn: str | None = ... + """The ARN of the primary secret.""" + replication_status: list[ReplicationStatusType] | None = ... + """The status of replication.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ReplicationStatusType(_SerdeShape): + """ + A replication object consisting of a `RegionReplicationStatus` object + and includes a Region, KMSKeyId, status, and status message. + """ + + region: str | None = ... + """The Region where replication occurs.""" + kms_key_id: str | None = ... + """Can be an `ARN`, `Key ID`, or `Alias`.""" + status: str | None = ... + """The status can be `InProgress`, `Failed`, or `InSync`.""" + status_message: str | None = ... + """ + Status message such as \"*Secret with this name already exists in this + region*\". + """ + last_accessed_date: datetime | None = ... + """ + The date that the secret was last accessed in the Region. This field is + omitted if the secret has never been retrieved in the Region. + """ + +@dataclass(kw_only=True) +class ResourceExistsException(ServiceError, _SerdeShape): + """A resource with the ID you requested already exists.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ResourceNotFoundException(ServiceError, _SerdeShape): + """Secrets Manager can't find the resource that you asked for.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class RestoreSecretInput(_SerdeShape): + """Dataclass for RestoreSecretInput structure.""" + + secret_id: str | None = ... + """ + The ARN or name of the secret to restore. + + For an ARN, we recommend that you specify a complete ARN rather than a + partial ARN. See [Finding a secret from a partial + ARN](https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen). + """ + +@dataclass(kw_only=True) +class RestoreSecretOutput(_SerdeShape): + """Dataclass for RestoreSecretOutput structure.""" + + arn: str | None = ... + """The ARN of the secret that was restored.""" + name: str | None = ... + """The name of the secret that was restored.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class RotateSecretInput(_SerdeShape): + """Dataclass for RotateSecretInput structure.""" + + secret_id: str | None = ... + """ + The ARN or name of the secret to rotate. + + For an ARN, we recommend that you specify a complete ARN rather than a + partial ARN. See [Finding a secret from a partial + ARN](https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen). + """ + client_request_token: str | None = ... + """ + A unique identifier for the new version of the secret. You only need to + specify this value if you implement your own retry logic and you want to + ensure that Secrets Manager doesn't attempt to create a secret version + twice. + + Note: + If you use the Amazon Web Services CLI or one of the Amazon Web Services + SDKs to call this operation, then you can leave this parameter empty. + The CLI or SDK generates a random UUID for you and includes it as the + value for this parameter in the request. + + If you generate a raw HTTP request to the Secrets Manager service + endpoint, then you must generate a `ClientRequestToken` and include it + in the request. + + This value helps ensure idempotency. Secrets Manager uses this value to + prevent the accidental creation of duplicate versions if there are + failures and retries during a rotation. We recommend that you generate a + [UUID-type](https://wikipedia.org/wiki/Universally_unique_identifier) + value to ensure uniqueness of your versions within the specified secret. + """ + rotation_lambda_arn: str | None = ... + """ + For secrets that use a Lambda rotation function to rotate, the ARN of + the Lambda rotation function. + + For secrets that use *managed rotation*, omit this field. For more + information, see [Managed + rotation](https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_managed.html) + in the *Secrets Manager User Guide*. + """ + rotation_rules: RotationRulesType | None = ... + """ + A structure that defines the rotation configuration for this secret. + + Warning: + When changing an existing rotation schedule and setting + `RotateImmediately` to `false`: + + - If using `AutomaticallyAfterDays` or a `ScheduleExpression` with + `rate()`, the previously scheduled rotation might still occur. + + - To prevent unintended rotations, use a `ScheduleExpression` with + `cron()` for granular control over rotation windows. + """ + external_secret_rotation_metadata: ( + list[ExternalSecretRotationMetadataItem] | None + ) = ... + """ + The metadata needed to successfully rotate a managed external secret. A + list of key value pairs in JSON format specified by the partner. For + more information about the required information, see [Using Secrets + Manager managed external + secrets](https://docs.aws.amazon.com/secretsmanager/latest/userguide/managed-external-secrets.html) + """ + external_secret_rotation_role_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the role that allows Secrets Manager + to rotate a secret held by a third-party partner. For more information, + see [Security and + permissions](https://docs.aws.amazon.com/secretsmanager/latest/userguide/mes-security.html). + """ + rotate_immediately: bool | None = ... + """ + Specifies whether to rotate the secret immediately or wait until the + next scheduled rotation window. The rotation schedule is defined in + RotateSecretRequest$RotationRules. + + The default for `RotateImmediately` is `true`. If you don't specify + this value, Secrets Manager rotates the secret immediately. + + If you set `RotateImmediately` to `false`, Secrets Manager tests the + rotation configuration by running the [`testSecret` + step](https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_how.html) + of the Lambda rotation function. This test creates an `AWSPENDING` + version of the secret and then removes it. + + When changing an existing rotation schedule and setting + `RotateImmediately` to `false`: + + - If using `AutomaticallyAfterDays` or a `ScheduleExpression` with + `rate()`, the previously scheduled rotation might still occur. + + - To prevent unintended rotations, use a `ScheduleExpression` with + `cron()` for granular control over rotation windows. + + Rotation is an asynchronous process. For more information, see [How + rotation + works](https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_how.html). + """ + +@dataclass(kw_only=True) +class RotateSecretOutput(_SerdeShape): + """Dataclass for RotateSecretOutput structure.""" + + arn: str | None = ... + """The ARN of the secret.""" + name: str | None = ... + """The name of the secret.""" + version_id: str | None = ... + """The ID of the new version of the secret.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class RotationRulesType(_SerdeShape): + """A structure that defines the rotation configuration for the secret.""" + + automatically_after_days: int | None = ... + """ + The number of days between rotations of the secret. You can use this + value to check that your secret meets your compliance guidelines for how + often secrets must be rotated. If you use this field to set the rotation + schedule, Secrets Manager calculates the next rotation date based on the + previous rotation. Manually updating the secret value by calling + `PutSecretValue` or `UpdateSecret` is considered a valid rotation. + + In `DescribeSecret` and `ListSecrets`, this value is calculated from the + rotation schedule after every successful rotation. In `RotateSecret`, + you can set the rotation schedule in `RotationRules` with + `AutomaticallyAfterDays` or `ScheduleExpression`, but not both. To set a + rotation schedule in hours, use `ScheduleExpression`. + """ + duration: str | None = ... + """ + The length of the rotation window in hours, for example `3h` for a three + hour window. Secrets Manager rotates your secret at any time during this + window. The window must not extend into the next rotation window or the + next UTC day. The window starts according to the `ScheduleExpression`. + If you don't specify a `Duration`, for a `ScheduleExpression` in hours, + the window automatically closes after one hour. For a + `ScheduleExpression` in days, the window automatically closes at the end + of the UTC day. For more information, including examples, see [Schedule + expressions in Secrets Manager + rotation](https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_schedule.html) + in the *Secrets Manager Users Guide*. + """ + schedule_expression: str | None = ... + """ + A `cron()` or `rate()` expression that defines the schedule for rotating + your secret. Secrets Manager rotation schedules use UTC time zone. + Secrets Manager rotates your secret any time during a rotation window. + + Secrets Manager `rate()` expressions represent the interval in hours or + days that you want to rotate your secret, for example `rate(12 hours)` + or `rate(10 days)`. You can rotate a secret as often as every four + hours. If you use a `rate()` expression, the rotation window starts at + midnight. For a rate in hours, the default rotation window closes after + one hour. For a rate in days, the default rotation window closes at the + end of the day. You can set the `Duration` to change the rotation + window. The rotation window must not extend into the next UTC day or + into the next rotation window. + + You can use a `cron()` expression to create a rotation schedule that is + more detailed than a rotation interval. For more information, including + examples, see [Schedule expressions in Secrets Manager + rotation](https://docs.aws.amazon.com/secretsmanager/latest/userguide/rotate-secrets_schedule.html) + in the *Secrets Manager Users Guide*. For a cron expression that + represents a schedule in hours, the default rotation window closes after + one hour. For a cron expression that represents a schedule in days, the + default rotation window closes at the end of the day. You can set the + `Duration` to change the rotation window. The rotation window must not + extend into the next UTC day or into the next rotation window. + """ + +@dataclass(kw_only=True) +class SecretListEntry(_SerdeShape): + """ + A structure that contains the details about a secret. It does not + include the encrypted `SecretString` and `SecretBinary` values. To get + those values, use + [GetSecretValue](https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_GetSecretValue.html) + . + """ + + arn: str | None = ... + """The Amazon Resource Name (ARN) of the secret.""" + name: str | None = ... + """The friendly name of the secret.""" + type: str | None = ... + """ + The exact string that identifies the third-party partner that holds the + external secret. For more information, see [Managed external secret + partners](https://docs.aws.amazon.com/secretsmanager/latest/userguide/mes-partners.html). + """ + description: str | None = ... + """The user-provided description of the secret.""" + kms_key_id: str | None = ... + """ + The ARN of the KMS key that Secrets Manager uses to encrypt the secret + value. If the secret is encrypted with the Amazon Web Services managed + key `aws/secretsmanager`, this field is omitted. + """ + rotation_enabled: bool | None = ... + """ + Indicates whether automatic, scheduled rotation is enabled for this + secret. + """ + rotation_lambda_arn: str | None = ... + """ + The ARN of an Amazon Web Services Lambda function invoked by Secrets + Manager to rotate and expire the secret either automatically per the + schedule or manually by a call to + [`RotateSecret`](https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_RotateSecret.html) + . + """ + rotation_rules: RotationRulesType | None = ... + """A structure that defines the rotation configuration for the secret.""" + external_secret_rotation_metadata: ( + list[ExternalSecretRotationMetadataItem] | None + ) = ... + """ + The metadata needed to successfully rotate a managed external secret. A + list of key value pairs in JSON format specified by the partner. For + more information about the required information, see [Managed external + secrets + partners](https://docs.aws.amazon.com/secretsmanager/latest/userguide/mes-partners.html). + """ + external_secret_rotation_role_arn: str | None = ... + """ + The role that Secrets Manager assumes to call APIs required to perform + the rotation. For more information about the required information, see + [Managed external secrets + partners](https://docs.aws.amazon.com/secretsmanager/latest/userguide/mes-partners.html). + """ + last_rotated_date: datetime | None = ... + """ + The most recent date and time that the Secrets Manager rotation process + was successfully completed. This value is null if the secret hasn't + ever rotated. + """ + last_changed_date: datetime | None = ... + """The last date and time that this secret was modified in any way.""" + last_accessed_date: datetime | None = ... + """ + The date that the secret was last accessed in the Region. This field is + omitted if the secret has never been retrieved in the Region. + """ + deleted_date: datetime | None = ... + """ + The date and time the deletion of the secret occurred. Not present on + active secrets. The secret can be recovered until the number of days in + the recovery window has passed, as specified in the + `RecoveryWindowInDays` parameter of the + [`DeleteSecret`](https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_DeleteSecret.html) + operation. + """ + next_rotation_date: datetime | None = ... + """ + The next rotation is scheduled to occur on or before this date. If the + secret isn't configured for rotation or rotation has been disabled, + Secrets Manager returns null. + """ + tags: list[Tag] | None = ... + """ + The list of user-defined tags associated with the secret. To add tags to + a secret, use + [`TagResource`](https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_TagResource.html) + . To remove tags, use + [`UntagResource`](https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_UntagResource.html) + . + """ + secret_versions_to_stages: dict[str, list[str]] | None = ... + """ + A list of all of the currently assigned `SecretVersionStage` staging + labels and the `SecretVersionId` attached to each one. Staging labels + are used to keep track of the different versions during the rotation + process. + + Note: + A version that does not have any `SecretVersionStage` is considered + deprecated and subject to deletion. Such versions are not included in + this list. + """ + owning_service: str | None = ... + """Returns the name of the service that created the secret.""" + created_date: datetime | None = ... + """The date and time when a secret was created.""" + primary_region: str | None = ... + """The Region where Secrets Manager originated the secret.""" + +@dataclass(kw_only=True) +class SecretValueEntry(_SerdeShape): + """ + A structure that contains the secret value and other details for a + secret. + """ + + arn: str | None = ... + """The Amazon Resource Name (ARN) of the secret.""" + name: str | None = ... + """The friendly name of the secret.""" + version_id: str | None = ... + """The unique version identifier of this version of the secret.""" + secret_binary: bytes | None = ... + """ + The decrypted secret value, if the secret value was originally provided + as binary data in the form of a byte array. The parameter represents the + binary data as a + [base64-encoded](https://tools.ietf.org/html/rfc4648#section-4) string. + """ + secret_string: str | None = ... + """ + The decrypted secret value, if the secret value was originally provided + as a string or through the Secrets Manager console. + """ + version_stages: list[str] | None = ... + """ + A list of all of the staging labels currently attached to this version + of the secret. + """ + created_date: datetime | None = ... + """The date the secret was created.""" + +@dataclass(kw_only=True) +class SecretVersionsListEntry(_SerdeShape): + """A structure that contains information about one version of a secret.""" + + version_id: str | None = ... + """The unique version identifier of this version of the secret.""" + version_stages: list[str] | None = ... + """ + An array of staging labels that are currently associated with this + version of the secret. + """ + last_accessed_date: datetime | None = ... + """ + The date that this version of the secret was last accessed. Note that + the resolution of this field is at the date level and does not include + the time. + """ + created_date: datetime | None = ... + """The date and time this version of the secret was created.""" + kms_key_ids: list[str] | None = ... + """The KMS keys used to encrypt the secret version.""" + +class SortByType(UnknownEnumMixin, StrEnum): + CREATED_DATE = "created-date" + LAST_ACCESSED_DATE = "last-accessed-date" + LAST_CHANGED_DATE = "last-changed-date" + NAME = "name" + +class SortOrderType(UnknownEnumMixin, StrEnum): + ASC = "asc" + DESC = "desc" + +class StatusType(UnknownEnumMixin, StrEnum): + IN_SYNC = "InSync" + FAILED = "Failed" + IN_PROGRESS = "InProgress" + +@dataclass(kw_only=True) +class StopReplicationToReplicaInput(_SerdeShape): + """Dataclass for StopReplicationToReplicaInput structure.""" + + secret_id: str | None = ... + """ + The name of the secret or the replica ARN. The replica ARN is the same + as the original primary secret ARN expect the Region is changed to the + replica Region. + """ + +@dataclass(kw_only=True) +class StopReplicationToReplicaOutput(_SerdeShape): + """Dataclass for StopReplicationToReplicaOutput structure.""" + + arn: str | None = ... + """ + The ARN of the promoted secret. The ARN is the same as the original + primary secret except the Region is changed. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class Tag(_SerdeShape): + """A structure that contains information about a tag.""" + + key: str | None = ... + """The key identifier, or name, of the tag.""" + value: str | None = ... + """The string value associated with the key of the tag.""" + +@dataclass(kw_only=True) +class TagResourceInput(_SerdeShape): + """Dataclass for TagResourceInput structure.""" + + secret_id: str | None = ... + """ + The identifier for the secret to attach tags to. You can specify either + the Amazon Resource Name (ARN) or the friendly name of the secret. + + For an ARN, we recommend that you specify a complete ARN rather than a + partial ARN. See [Finding a secret from a partial + ARN](https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen). + """ + tags: list[Tag] | None = ... + """ + The tags to attach to the secret as a JSON text string argument. Each + element in the list consists of a `Key` and a `Value`. + + For storing multiple values, we recommend that you use a JSON text + string argument and specify key/value pairs. For more information, see + [Specifying parameter values for the Amazon Web Services + CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters.html) + in the Amazon Web Services CLI User Guide. + """ + +@dataclass(kw_only=True) +class TagResourceOutput(_SerdeShape): + """Dataclass for TagResourceOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UntagResourceInput(_SerdeShape): + """Dataclass for UntagResourceInput structure.""" + + secret_id: str | None = ... + """ + The ARN or name of the secret. + + For an ARN, we recommend that you specify a complete ARN rather than a + partial ARN. See [Finding a secret from a partial + ARN](https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen). + """ + tag_keys: list[str] | None = ... + """ + A list of tag key names to remove from the secret. You don't specify + the value. Both the key and its associated value are removed. + + This parameter requires a JSON text string argument. + + For storing multiple values, we recommend that you use a JSON text + string argument and specify key/value pairs. For more information, see + [Specifying parameter values for the Amazon Web Services + CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters.html) + in the Amazon Web Services CLI User Guide. + """ + +@dataclass(kw_only=True) +class UntagResourceOutput(_SerdeShape): + """Dataclass for UntagResourceOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateSecretInput(_SerdeShape): + """Dataclass for UpdateSecretInput structure.""" + + secret_id: str | None = ... + """ + The ARN or name of the secret. + + For an ARN, we recommend that you specify a complete ARN rather than a + partial ARN. See [Finding a secret from a partial + ARN](https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen). + """ + client_request_token: str | None = ... + """ + If you include `SecretString` or `SecretBinary`, then Secrets Manager + creates a new version for the secret, and this parameter specifies the + unique identifier for the new version. + + Note: + If you use the Amazon Web Services CLI or one of the Amazon Web Services + SDKs to call this operation, then you can leave this parameter empty. + The CLI or SDK generates a random UUID for you and includes it as the + value for this parameter in the request. + + If you generate a raw HTTP request to the Secrets Manager service + endpoint, then you must generate a `ClientRequestToken` and include it + in the request. + + This value helps ensure idempotency. Secrets Manager uses this value to + prevent the accidental creation of duplicate versions if there are + failures and retries during a rotation. We recommend that you generate a + [UUID-type](https://wikipedia.org/wiki/Universally_unique_identifier) + value to ensure uniqueness of your versions within the specified secret. + """ + description: str | None = ... + """The description of the secret.""" + kms_key_id: str | None = ... + """ + The ARN, key ID, or alias of the KMS key that Secrets Manager uses to + encrypt new secret versions as well as any existing versions with the + staging labels `AWSCURRENT`, `AWSPENDING`, or `AWSPREVIOUS`. If you + don't have `kms:Encrypt` permission to the new key, Secrets Manager + does not re-encrypt existing secret versions with the new key. For more + information about versions and staging labels, see [Concepts: + Version](https://docs.aws.amazon.com/secretsmanager/latest/userguide/getting-started.html#term_version). + + A key alias is always prefixed by `alias/`, for example + `alias/aws/secretsmanager`. For more information, see [About + aliases](https://docs.aws.amazon.com/kms/latest/developerguide/alias-about.html). + + If you set this to an empty string, Secrets Manager uses the Amazon Web + Services managed key `aws/secretsmanager`. If this key doesn't already + exist in your account, then Secrets Manager creates it for you + automatically. All users and roles in the Amazon Web Services account + automatically have access to use `aws/secretsmanager`. Creating + `aws/secretsmanager` can result in a one-time significant delay in + returning the result. + + Warning: + You can only use the Amazon Web Services managed key + `aws/secretsmanager` if you call this operation using credentials from + the same Amazon Web Services account that owns the secret. If the secret + is in a different account, then you must use a customer managed key and + provide the ARN of that KMS key in this field. The user making the call + must have permissions to both the secret and the KMS key in their + respective accounts. + """ + secret_binary: bytes | None = ... + """ + The binary data to encrypt and store in the new version of the secret. + We recommend that you store your binary data in a file and then pass the + contents of the file as a parameter. + + Either `SecretBinary` or `SecretString` must have a value, but not both. + + You can't access this parameter in the Secrets Manager console. + + Sensitive: This field contains sensitive information, so the service + does not include it in CloudTrail log entries. If you create your own + log entries, you must also avoid logging the information in this field. + """ + secret_string: str | None = ... + """ + The text data to encrypt and store in the new version of the secret. We + recommend you use a JSON structure of key/value pairs for your secret + value. + + Either `SecretBinary` or `SecretString` must have a value, but not both. + + Sensitive: This field contains sensitive information, so the service + does not include it in CloudTrail log entries. If you create your own + log entries, you must also avoid logging the information in this field. + """ + type: str | None = ... + """ + The exact string that identifies the third-party partner that holds the + external secret. For more information, see [Managed external secret + partners](https://docs.aws.amazon.com/secretsmanager/latest/userguide/mes-partners.html). + """ + +@dataclass(kw_only=True) +class UpdateSecretOutput(_SerdeShape): + """Dataclass for UpdateSecretOutput structure.""" + + arn: str | None = ... + """The ARN of the secret that was updated.""" + name: str | None = ... + """The name of the secret that was updated.""" + version_id: str | None = ... + """ + If Secrets Manager created a new version of the secret during this + operation, then `VersionId` contains the unique identifier of the new + version. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UpdateSecretVersionStageInput(_SerdeShape): + """Dataclass for UpdateSecretVersionStageInput structure.""" + + secret_id: str | None = ... + """ + The ARN or the name of the secret with the version and staging labelsto + modify. + + For an ARN, we recommend that you specify a complete ARN rather than a + partial ARN. See [Finding a secret from a partial + ARN](https://docs.aws.amazon.com/secretsmanager/latest/userguide/troubleshoot.html#ARN_secretnamehyphen). + """ + version_stage: str | None = ... + """The staging label to add to this version.""" + remove_from_version_id: str | None = ... + """ + The ID of the version that the staging label is to be removed from. If + the staging label you are trying to attach to one version is already + attached to a different version, then you must include this parameter + and specify the version that the label is to be removed from. If the + label is attached and you either do not specify this parameter, or the + version ID does not match, then the operation fails. + """ + move_to_version_id: str | None = ... + """ + The ID of the version to add the staging label to. To remove a label + from a version, then do not specify this parameter. + + If the staging label is already attached to a different version of the + secret, then you must also specify the `RemoveFromVersionId` parameter. + """ + +@dataclass(kw_only=True) +class UpdateSecretVersionStageOutput(_SerdeShape): + """Dataclass for UpdateSecretVersionStageOutput structure.""" + + arn: str | None = ... + """The ARN of the secret that was updated.""" + name: str | None = ... + """The name of the secret that was updated.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ValidateResourcePolicyInput(_SerdeShape): + """Dataclass for ValidateResourcePolicyInput structure.""" + + secret_id: str | None = ... + """ + The ARN or name of the secret with the resource-based policy you want to + validate. + """ + resource_policy: str | None = ... + """ + A JSON-formatted string that contains an Amazon Web Services + resource-based policy. The policy in the string identifies who can + access or manage this secret and its versions. For example policies, see + [Permissions policy + examples](https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_examples.html). + """ + +@dataclass(kw_only=True) +class ValidateResourcePolicyOutput(_SerdeShape): + """Dataclass for ValidateResourcePolicyOutput structure.""" + + policy_validation_passed: bool = ... + """True if your policy passes validation, otherwise false.""" + validation_errors: list[ValidationErrorsEntry] | None = ... + """Validation errors if your policy didn't pass validation.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ValidationErrorsEntry(_SerdeShape): + """Displays errors that occurred during validation of the resource policy.""" + + check_name: str | None = ... + """Checks the name of the policy.""" + error_message: str | None = ... + """ + Displays error messages if validation encounters problems during + validation of the resource policy. + """ + +BATCH_GET_SECRET_VALUE: APIOperation[ + BatchGetSecretValueInput, BatchGetSecretValueOutput +] +CANCEL_ROTATE_SECRET: APIOperation[CancelRotateSecretInput, CancelRotateSecretOutput] +CREATE_SECRET: APIOperation[CreateSecretInput, CreateSecretOutput] +DELETE_RESOURCE_POLICY: APIOperation[ + DeleteResourcePolicyInput, DeleteResourcePolicyOutput +] +DELETE_SECRET: APIOperation[DeleteSecretInput, DeleteSecretOutput] +DESCRIBE_SECRET: APIOperation[DescribeSecretInput, DescribeSecretOutput] +GET_RANDOM_PASSWORD: APIOperation[GetRandomPasswordInput, GetRandomPasswordOutput] +GET_RESOURCE_POLICY: APIOperation[GetResourcePolicyInput, GetResourcePolicyOutput] +GET_SECRET_VALUE: APIOperation[GetSecretValueInput, GetSecretValueOutput] +LIST_SECRETS: APIOperation[ListSecretsInput, ListSecretsOutput] +LIST_SECRET_VERSION_IDS: APIOperation[ + ListSecretVersionIdsInput, ListSecretVersionIdsOutput +] +PUT_RESOURCE_POLICY: APIOperation[PutResourcePolicyInput, PutResourcePolicyOutput] +PUT_SECRET_VALUE: APIOperation[PutSecretValueInput, PutSecretValueOutput] +REMOVE_REGIONS_FROM_REPLICATION: APIOperation[ + RemoveRegionsFromReplicationInput, RemoveRegionsFromReplicationOutput +] +REPLICATE_SECRET_TO_REGIONS: APIOperation[ + ReplicateSecretToRegionsInput, ReplicateSecretToRegionsOutput +] +RESTORE_SECRET: APIOperation[RestoreSecretInput, RestoreSecretOutput] +ROTATE_SECRET: APIOperation[RotateSecretInput, RotateSecretOutput] +STOP_REPLICATION_TO_REPLICA: APIOperation[ + StopReplicationToReplicaInput, StopReplicationToReplicaOutput +] +TAG_RESOURCE: APIOperation[TagResourceInput, TagResourceOutput] +UNTAG_RESOURCE: APIOperation[UntagResourceInput, UntagResourceOutput] +UPDATE_SECRET: APIOperation[UpdateSecretInput, UpdateSecretOutput] +UPDATE_SECRET_VERSION_STAGE: APIOperation[ + UpdateSecretVersionStageInput, UpdateSecretVersionStageOutput +] +VALIDATE_RESOURCE_POLICY: APIOperation[ + ValidateResourcePolicyInput, ValidateResourcePolicyOutput +] diff --git a/clients/aws-sdk-signin/scripts/docs/generate_doc_stubs.py b/clients/aws-sdk-signin/scripts/docs/generate_doc_stubs.py index 52d470bc..795f2e4b 100644 --- a/clients/aws-sdk-signin/scripts/docs/generate_doc_stubs.py +++ b/clients/aws-sdk-signin/scripts/docs/generate_doc_stubs.py @@ -126,7 +126,9 @@ class ClientInfo: class DocStubGenerator: """Generate markdown API Reference stubs for AWS SDK for Python v4 clients.""" - def __init__(self, client_dir: Path, output_dir: Path, service_name: str | None = None) -> None: + def __init__( + self, client_dir: Path, output_dir: Path, service_name: str | None = None + ) -> None: """ Initialize the documentation generator. @@ -190,7 +192,9 @@ def _analyze_client_package(self, package_name: str) -> ClientInfo: required = ("client", "config", "models") missing = [name for name in required if not package.modules.get(name)] if missing: - raise ValueError(f"Missing required modules in {package_name}: {', '.join(missing)}") + raise ValueError( + f"Missing required modules in {package_name}: {', '.join(missing)}" + ) # Parse submodules client_module = package.modules["client"] @@ -199,11 +203,15 @@ def _analyze_client_package(self, package_name: str) -> ClientInfo: client_class = self._find_class_with_suffix(client_module, "Client") if not client_class: - raise ValueError(f"No class ending with 'Client' found in {package_name}.client") + raise ValueError( + f"No class ending with 'Client' found in {package_name}.client" + ) config_class = self._find_class_with_suffix(config_module, "Config") if not config_class: - raise ValueError(f"No class ending with 'Config' found in {package_name}.config") + raise ValueError( + f"No class ending with 'Config' found in {package_name}.config" + ) plugin_alias = config_module.members.get("Plugin") if not plugin_alias: @@ -288,7 +296,9 @@ def _analyze_operation(self, operation: Function) -> OperationInfo: if output_type in stream_type_map: stream_type = stream_type_map[output_type] - stream_args = self._get_subscript_elements(returns, f"'{operation.name}' stream type") + stream_args = self._get_subscript_elements( + returns, f"'{operation.name}' stream type" + ) if stream_type in (StreamType.INPUT, StreamType.DUPLEX): event_input_type = stream_args[0].canonical_name @@ -316,7 +326,9 @@ def _analyze_operation(self, operation: Function) -> OperationInfo: def _get_expr(self, annotation: str | Expr | None, context: str) -> Expr: """Extract and validate an Expr from an annotation.""" if not isinstance(annotation, Expr): - raise TypeError(f"{context}: expected Expr, got {type(annotation).__name__}") + raise TypeError( + f"{context}: expected Expr, got {type(annotation).__name__}" + ) return annotation def _get_subscript_elements(self, expr: Expr, context: str) -> list[Expr]: @@ -330,7 +342,9 @@ def _get_subscript_elements(self, expr: Expr, context: str) -> list[Expr]: return [el for el in slice_expr.elements if isinstance(el, Expr)] return [slice_expr] - def _extract_models(self, models_module: Module, operations: list[OperationInfo]) -> ModelsInfo: + def _extract_models( + self, models_module: Module, operations: list[OperationInfo] + ) -> ModelsInfo: """Extract structures, unions, enums, and errors from models module.""" structures, unions, enums, errors = [], [], [], [] @@ -356,14 +370,16 @@ def _extract_models(self, models_module: Module, operations: list[OperationInfo] duplicates = [] for structure in structures: - if self._is_operation_io_type(structure.name, operations) or self._is_union_member( - structure.name, unions - ): + if self._is_operation_io_type( + structure.name, operations + ) or self._is_union_member(structure.name, unions): duplicates.append(structure) structures = [struct for struct in structures if struct not in duplicates] - return ModelsInfo(structures=structures, unions=unions, enums=enums, errors=errors) + return ModelsInfo( + structures=structures, unions=unions, enums=enums, errors=errors + ) def _is_union(self, member: Object | Alias) -> TypeGuard[Attribute]: """Check if a module member is a union type.""" @@ -399,7 +415,9 @@ def _extract_union_members( for name in member_names: if not (member_object := models_module.members.get(name)): raise ValueError(f"Union member '{name}' not found in models module") - members.append(TypeInfo(name=member_object.name, module_path=member_object.path)) + members.append( + TypeInfo(name=member_object.name, module_path=member_object.path) + ) return members @@ -408,7 +426,8 @@ def _is_enum(self, member: Object | Alias) -> TypeGuard[Class]: if not isinstance(member, Class): return False return any( - isinstance(base, ExprName) and base.name in ENUM_BASE_CLASSES for base in member.bases + isinstance(base, ExprName) and base.name in ENUM_BASE_CLASSES + for base in member.bases ) def _is_error(self, member: Object | Alias) -> TypeGuard[Class]: @@ -416,10 +435,13 @@ def _is_error(self, member: Object | Alias) -> TypeGuard[Class]: if not isinstance(member, Class): return False return any( - isinstance(base, ExprName) and base.name in ERROR_BASE_CLASSES for base in member.bases + isinstance(base, ExprName) and base.name in ERROR_BASE_CLASSES + for base in member.bases ) - def _is_operation_io_type(self, type_name: str, operations: list[OperationInfo]) -> bool: + def _is_operation_io_type( + self, type_name: str, operations: list[OperationInfo] + ) -> bool: """Check if a type is used as operation input/output.""" return any(type_name in (op.input.name, op.output.name) for op in operations) @@ -437,8 +459,12 @@ def _generate_client_docs(self, client_info: ClientInfo) -> bool: self._generate_type_stubs( client_info.models.structures, "structures", "Structure Class" ) - self._generate_type_stubs(client_info.models.errors, "errors", "Error Class") - self._generate_type_stubs(client_info.models.enums, "enums", "Enum Class", members=True) + self._generate_type_stubs( + client_info.models.errors, "errors", "Error Class" + ) + self._generate_type_stubs( + client_info.models.enums, "enums", "Enum Class", members=True + ) self._generate_union_stubs(client_info.models.unions) except OSError as e: logger.error(f"Failed to write documentation files: {e}") @@ -470,7 +496,9 @@ def _generate_index(self, client_info: ClientInfo) -> None: ] for method in sorted(client_info.client_methods, key=lambda x: x.name): - lines.extend([*self._mkdocs_directive(method.module_path, heading_level=4), ""]) + lines.extend( + [*self._mkdocs_directive(method.module_path, heading_level=4), ""] + ) # Operations section if client_info.operations: @@ -578,7 +606,9 @@ def _generate_operation_stubs(self, operations: list[OperationInfo]) -> None: output_path = self.output_dir / "operations" / f"{op.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb("Operations", op.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb("Operations", op.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(operations)} operation file(s)") @@ -600,7 +630,9 @@ def _generate_type_stubs( output_path = self.output_dir / category / f"{item.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb(category.title(), item.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb(category.title(), item.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(items)} {category} file(s)") @@ -624,7 +656,9 @@ def _generate_union_stubs(self, unions: list[UnionInfo]) -> None: output_path = self.output_dir / "unions" / f"{union.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb("Unions", union.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb("Unions", union.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(unions)} union file(s)") diff --git a/clients/aws-sdk-signin/src/aws_sdk_signin/_private/schemas.py b/clients/aws-sdk-signin/src/aws_sdk_signin/_private/schemas.py index a5617843..aa9fa22f 100644 --- a/clients/aws-sdk-signin/src/aws_sdk_signin/_private/schemas.py +++ b/clients/aws-sdk-signin/src/aws_sdk_signin/_private/schemas.py @@ -2,1700 +2,1567 @@ from types import MappingProxyType -from smithy_core.prelude import BOOLEAN, LONG, STRING, UNIT -from smithy_core.schemas import Schema -from smithy_core.shapes import ShapeID, ShapeType -from smithy_core.traits import Trait - - -O_AUTH2_ERROR_CODE = Schema.collection( - id=ShapeID("com.amazonaws.signin#OAuth2ErrorCode"), - shape_type=ShapeType.ENUM, - members={ - "TOKEN_EXPIRED": {"target": UNIT}, - "USER_CREDENTIALS_CHANGED": {"target": UNIT}, - "INSUFFICIENT_PERMISSIONS": {"target": UNIT}, - "AUTHCODE_EXPIRED": {"target": UNIT}, - "SERVER_ERROR": {"target": UNIT}, - "INVALID_REQUEST": {"target": UNIT}, - "RESOURCE_NOT_FOUND": {"target": UNIT}, - "CONFLICT": {"target": UNIT}, - "SERVICE_QUOTA_EXCEEDED": {"target": UNIT}, - }, -) - -ACCESS_DENIED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.signin#AccessDeniedException"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], - members={ - "error": { - "target": O_AUTH2_ERROR_CODE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "message": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -ACCESS_TOKEN = Schema.collection( - id=ShapeID("com.amazonaws.signin#AccessToken"), - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "accessKeyId": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="accessKeyId"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "secretAccessKey": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="secretAccessKey"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "sessionToken": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="sessionToken"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - }, -) - -ACCOUNT_ID = Schema( - id=ShapeID("com.amazonaws.signin#AccountId"), shape_type=ShapeType.STRING -) - -AUTHORIZATION_CODE = Schema( - id=ShapeID("com.amazonaws.signin#AuthorizationCode"), shape_type=ShapeType.STRING -) - -BEARER_TOKEN_TYPE = Schema( - id=ShapeID("com.amazonaws.signin#BearerTokenType"), shape_type=ShapeType.STRING -) - -CLIENT_CREDENTIALS_GRANT_TYPE = Schema( - id=ShapeID("com.amazonaws.signin#ClientCredentialsGrantType"), - shape_type=ShapeType.STRING, -) - -CLIENT_ID = Schema( - id=ShapeID("com.amazonaws.signin#ClientId"), shape_type=ShapeType.STRING -) - -CLIENT_TOKEN = Schema( - id=ShapeID("com.amazonaws.signin#ClientToken"), shape_type=ShapeType.STRING -) - -CODE_VERIFIER = Schema( - id=ShapeID("com.amazonaws.signin#CodeVerifier"), shape_type=ShapeType.STRING -) - -CONDITION_VALUES = Schema.collection( - id=ShapeID("com.amazonaws.signin#ConditionValues"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, -) - -CONDITION = Schema.collection( - id=ShapeID("com.amazonaws.signin#Condition"), - shape_type=ShapeType.MAP, - members={"key": {"target": STRING}, "value": {"target": CONDITION_VALUES}}, -) - -CONDITION_TYPE = Schema( - id=ShapeID("com.amazonaws.signin#ConditionType"), shape_type=ShapeType.STRING -) - -CONDITION_BLOCK = Schema.collection( - id=ShapeID("com.amazonaws.signin#ConditionBlock"), - shape_type=ShapeType.MAP, - members={"key": {"target": CONDITION_TYPE}, "value": {"target": CONDITION}}, -) - -CONFLICT_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.signin#ConflictException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=409), - ], - members={ - "error": { - "target": O_AUTH2_ERROR_CODE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "message": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -CONSOLE_PERMISSION_MAX_RESULTS = Schema( - id=ShapeID("com.amazonaws.signin#ConsolePermissionMaxResults"), - shape_type=ShapeType.INTEGER, -) - -GRANT_TYPE = Schema( - id=ShapeID("com.amazonaws.signin#GrantType"), shape_type=ShapeType.STRING -) - -REDIRECT_URI = Schema( - id=ShapeID("com.amazonaws.signin#RedirectUri"), shape_type=ShapeType.STRING -) - -REFRESH_TOKEN = Schema( - id=ShapeID("com.amazonaws.signin#RefreshToken"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -CREATE_O_AUTH2_TOKEN_REQUEST_BODY = Schema.collection( - id=ShapeID("com.amazonaws.signin#CreateOAuth2TokenRequestBody"), - members={ - "clientId": { - "target": CLIENT_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="clientId"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "grantType": { - "target": GRANT_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="grantType"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "code": {"target": AUTHORIZATION_CODE}, - "redirectUri": { - "target": REDIRECT_URI, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="redirectUri") - ], - }, - "codeVerifier": { - "target": CODE_VERIFIER, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="codeVerifier") - ], - }, - "refreshToken": { - "target": REFRESH_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="refreshToken") - ], - }, - }, -) - -CREATE_O_AUTH2_TOKEN_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.signin#CreateOAuth2TokenInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.signin#CreateOAuth2TokenRequest", - ) - ], - members={ - "tokenInput": { - "target": CREATE_O_AUTH2_TOKEN_REQUEST_BODY, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpPayload")), - ], - } - }, -) - -EXPIRES_IN = Schema( - id=ShapeID("com.amazonaws.signin#ExpiresIn"), shape_type=ShapeType.INTEGER -) - -ID_TOKEN = Schema( - id=ShapeID("com.amazonaws.signin#IdToken"), shape_type=ShapeType.STRING -) - -TOKEN_TYPE = Schema( - id=ShapeID("com.amazonaws.signin#TokenType"), shape_type=ShapeType.STRING -) - -CREATE_O_AUTH2_TOKEN_RESPONSE_BODY = Schema.collection( - id=ShapeID("com.amazonaws.signin#CreateOAuth2TokenResponseBody"), - members={ - "accessToken": { - "target": ACCESS_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="accessToken"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "tokenType": { - "target": TOKEN_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="tokenType"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "expiresIn": { - "target": EXPIRES_IN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="expiresIn"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "refreshToken": { - "target": REFRESH_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="refreshToken"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "idToken": { - "target": ID_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="idToken")], - }, - }, -) - -CREATE_O_AUTH2_TOKEN_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.signin#CreateOAuth2TokenOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.signin#CreateOAuth2TokenResponse", - ) - ], - members={ - "tokenOutput": { - "target": CREATE_O_AUTH2_TOKEN_RESPONSE_BODY, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpPayload")), - ], - } - }, -) - -INTERNAL_SERVER_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.signin#InternalServerException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="server"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=500), - ], - members={ - "error": { - "target": O_AUTH2_ERROR_CODE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "message": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -TOO_MANY_REQUESTS_ERROR = Schema.collection( - id=ShapeID("com.amazonaws.signin#TooManyRequestsError"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=429), - ], - members={ - "error": { - "target": O_AUTH2_ERROR_CODE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "message": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -VALIDATION_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.signin#ValidationException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={ - "error": { - "target": O_AUTH2_ERROR_CODE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "message": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -CREATE_O_AUTH2_TOKEN = Schema( - id=ShapeID("com.amazonaws.signin#CreateOAuth2Token"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType({"method": "POST", "uri": "/v1/token"}), - ) - ], -) - -CREATE_O_AUTH2_TOKEN_WITH_IAM_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.signin#CreateOAuth2TokenWithIAMInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.signin#CreateOAuth2TokenWithIAMRequest", - ) - ], - members={ - "grantType": { - "target": CLIENT_CREDENTIALS_GRANT_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="grant_type"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "resource": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -O_AUTH_ACCESS_TOKEN = Schema( - id=ShapeID("com.amazonaws.signin#OAuthAccessToken"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -TOKEN_EXPIRES_IN = Schema( - id=ShapeID("com.amazonaws.signin#TokenExpiresIn"), shape_type=ShapeType.INTEGER -) - -CREATE_O_AUTH2_TOKEN_WITH_IAM_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.signin#CreateOAuth2TokenWithIAMOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.signin#CreateOAuth2TokenWithIAMResponse", - ) - ], - members={ - "accessToken": { - "target": O_AUTH_ACCESS_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="access_token"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "tokenType": { - "target": BEARER_TOKEN_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="token_type"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "expiresIn": { - "target": TOKEN_EXPIRES_IN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="expires_in"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - }, -) - -CREATE_O_AUTH2_TOKEN_WITH_IAM = Schema( - id=ShapeID("com.amazonaws.signin#CreateOAuth2TokenWithIAM"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/v1/token?x-amz-client-auth-method=iam"} - ), - ) - ], -) - -TARGET_ID = Schema( - id=ShapeID("com.amazonaws.signin#TargetId"), shape_type=ShapeType.STRING -) - -DELETE_CONSOLE_AUTHORIZATION_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.signin#DeleteConsoleAuthorizationConfigurationInput"), - members={"targetId": {"target": TARGET_ID}}, -) - -DELETE_CONSOLE_AUTHORIZATION_CONFIGURATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.signin#DeleteConsoleAuthorizationConfigurationOutput"), - members={ - "targetId": { - "target": TARGET_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "scope": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "consoleAuthorizationEnabled": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -RESOURCE_NOT_FOUND_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.signin#ResourceNotFoundException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=404), - ], - members={ - "error": { - "target": O_AUTH2_ERROR_CODE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "message": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +from smithy_core._schema_compact import StaticOperationSchema, StaticSchema + + +n0 = "com.amazonaws.signin" +_OAEC = "OAuth2ErrorCode" +_TE = "TOKEN_EXPIRED" +_sV = "smithy.api#enumValue" +_UCC = "USER_CREDENTIALS_CHANGED" +_IP = "INSUFFICIENT_PERMISSIONS" +_AE = "AUTHCODE_EXPIRED" +_SE = "SERVER_ERROR" +_se = "server_error" +_IR = "INVALID_REQUEST" +_RNF = "RESOURCE_NOT_FOUND" +_CONFLICT = "CONFLICT" +_SQE = "SERVICE_QUOTA_EXCEEDED" +_ADE = "AccessDeniedException" +_s = "smithy.api#error" +_c = "client" +_e = "error" +_sm = "smithy.api#required" +_m = "message" +_AT = "AccessToken" +_smi = "smithy.api#sensitive" +_aKI = "accessKeyId" +_sN = "smithy.api#jsonName" +_sAK = "secretAccessKey" +_sT = "sessionToken" +_AI = "AccountId" +_AC = "AuthorizationCode" +_BTT = "BearerTokenType" +_CCGT = "ClientCredentialsGrantType" +_CI = "ClientId" +_CT = "ClientToken" +_CV = "CodeVerifier" +_CVo = "ConditionValues" +_me = "member" +_C = "Condition" +_k = "key" +_v = "value" +_CTo = "ConditionType" +_CB = "ConditionBlock" +_CE = "ConflictException" +_sE = "smithy.api#httpError" +_CPMR = "ConsolePermissionMaxResults" +_GT = "GrantType" +_RU = "RedirectUri" +_RT = "RefreshToken" +_COATRB = "CreateOAuth2TokenRequestBody" +_cI = "clientId" +_gT = "grantType" +_co = "code" +_rU = "redirectUri" +_cV = "codeVerifier" +_rT = "refreshToken" +_COATI = "CreateOAuth2TokenInput" +_sSI = "smithy.synthetic#originalShapeId" +_cCOATR = "com.amazonaws.signin#CreateOAuth2TokenRequest" +_smit = "smithy.api#input" +_tI = "tokenInput" +_sP = "smithy.api#httpPayload" +_EI = "ExpiresIn" +_IT = "IdToken" +_TT = "TokenType" +_COATRBr = "CreateOAuth2TokenResponseBody" +_aT = "accessToken" +_tT = "tokenType" +_eI = "expiresIn" +_iT = "idToken" +_COATO = "CreateOAuth2TokenOutput" +_cCOATRo = "com.amazonaws.signin#CreateOAuth2TokenResponse" +_smith = "smithy.api#output" +_tO = "tokenOutput" +_ISE = "InternalServerException" +_ser = "server" +_TMRE = "TooManyRequestsError" +_VE = "ValidationException" +_COAT = "CreateOAuth2Token" +_smithy = "smithy.api#http" +_COATWIAMI = "CreateOAuth2TokenWithIAMInput" +_cCOATWIAMR = "com.amazonaws.signin#CreateOAuth2TokenWithIAMRequest" +_gt = "grant_type" +_r = "resource" +_OAAT = "OAuthAccessToken" +_TEI = "TokenExpiresIn" +_COATWIAMO = "CreateOAuth2TokenWithIAMOutput" +_cCOATWIAMRo = "com.amazonaws.signin#CreateOAuth2TokenWithIAMResponse" +_at = "access_token" +_tt = "token_type" +_ei = "expires_in" +_COATWIAM = "CreateOAuth2TokenWithIAM" +_TI = "TargetId" +_DCACI = "DeleteConsoleAuthorizationConfigurationInput" +_tIa = "targetId" +_DCACO = "DeleteConsoleAuthorizationConfigurationOutput" +_sc = "scope" +_cAE = "consoleAuthorizationEnabled" +_RNFE = "ResourceNotFoundException" +_DCAC = "DeleteConsoleAuthorizationConfiguration" +_SI = "StatementId" +_DRPSI = "DeleteResourcePermissionStatementInput" +_sI = "statementId" +_cT = "clientToken" +_sTm = "smithy.api#idempotencyToken" +_DRPSO = "DeleteResourcePermissionStatementOutput" +_DRPS = "DeleteResourcePermissionStatement" +_EP = "ExcludedPrincipal" +_GCACI = "GetConsoleAuthorizationConfigurationInput" +_GCACO = "GetConsoleAuthorizationConfigurationOutput" +_GCAC = "GetConsoleAuthorizationConfiguration" +_GRPI = "GetResourcePolicyInput" +_PA = "PolicyActions" +_P = "Principal" +_PS = "PolicyStatement" +_ef = "effect" +_E = "Effect" +_p = "principal" +_a = "action" +_A = "Action" +_R = "Resource" +_con = "condition" +_PSo = "PolicyStatements" +_SRBP = "SigninResourceBasedPolicy" +_ve = "version" +_V = "Version" +_st = "statement" +_S = "Statement" +_GRPO = "GetResourcePolicyOutput" +_sRBP = "signinResourceBasedPolicy" +_GRP = "GetResourcePolicy" +_ITT = "IntrospectedTokenType" +_ITn = "IntrospectionToken" +_TTH = "TokenTypeHint" +_IOATWIAMI = "IntrospectOAuth2TokenWithIAMInput" +_cIOATWIAMR = "com.amazonaws.signin#IntrospectOAuth2TokenWithIAMRequest" +_t = "token" +_tTH = "tokenTypeHint" +_tth = "token_type_hint" +_IOATWIAMO = "IntrospectOAuth2TokenWithIAMOutput" +_cIOATWIAMRo = "com.amazonaws.signin#IntrospectOAuth2TokenWithIAMResponse" +_ac = "active" +_ci = "client_id" +_uI = "userId" +_ui = "user_id" +_ex = "exp" +_i = "iat" +_n = "nbf" +_su = "sub" +_au = "aud" +_is = "iss" +_j = "jti" +_aI = "accountId" +_ai = "account_id" +_sS = "signinSession" +_ss = "signin_session" +_IOATWIAM = "IntrospectOAuth2TokenWithIAM" +_NT = "NextToken" +_LRPSI = "ListResourcePermissionStatementsInput" +_mR = "maxResults" +_nT = "nextToken" +_PSS = "PermissionStatementSummary" +_si = "sid" +_PSSe = "PermissionStatementSummaries" +_LRPSO = "ListResourcePermissionStatementsOutput" +_pS = "permissionStatements" +_LRPS = "ListResourcePermissionStatements" +_PCACI = "PutConsoleAuthorizationConfigurationInput" +_PCACO = "PutConsoleAuthorizationConfigurationOutput" +_PCAC = "PutConsoleAuthorizationConfiguration" +_SV = "SourceVpce" +_RR = "RequestedRegion" +_SIo = "SourceIp" +_SVo = "SourceVpc" +_VSI = "VpcSourceIp" +_PRPSI = "PutResourcePermissionStatementInput" +_sVo = "sourceVpc" +_sSV = "signinSourceVpce" +_cSV = "consoleSourceVpce" +_vSI = "vpcSourceIp" +_sIo = "sourceIp" +_rR = "requestedRegion" +_eP = "excludedPrincipal" +_PRPSO = "PutResourcePermissionStatementOutput" +_SQEE = "ServiceQuotaExceededException" +_PRPS = "PutResourcePermissionStatement" +_RTe = "RevocationToken" +_ROATWIAMI = "RevokeOAuth2TokenWithIAMInput" +_cROATWIAMR = "com.amazonaws.signin#RevokeOAuth2TokenWithIAMRequest" +_ROATWIAMO = "RevokeOAuth2TokenWithIAMOutput" +_cROATWIAMRo = "com.amazonaws.signin#RevokeOAuth2TokenWithIAMResponse" +_ROATWIAM = "RevokeOAuth2TokenWithIAM" +_Si = "Signin" +_aw = "aws.auth#sigv4" +_sB = "smithy.rules#endpointBdd" +_aws = "aws.api#service" +_aJ = "aws.protocols#restJson1" + +O_AUTH2_ERROR_CODE: StaticSchema = ( + 14, + n0, + _OAEC, + 0, + (_TE, _UCC, _IP, _AE, _SE, _IR, _RNF, _CONFLICT, _SQE), + ( + (-1, {_sV: _TE}), + (-1, {_sV: _UCC}), + (-1, {_sV: _IP}), + (-1, {_sV: _AE}), + (-1, {_sV: _se}), + (-1, {_sV: _IR}), + (-1, {_sV: _RNF}), + (-1, {_sV: _CONFLICT}), + (-1, {_sV: _SQE}), + ), +) + +ACCESS_DENIED_EXCEPTION: StaticSchema = ( + 18, + n0, + _ADE, + {_s: _c}, + (_e, _m), + ((O_AUTH2_ERROR_CODE, 1), (3, 1)), +) + +ACCESS_TOKEN: StaticSchema = ( + 18, + n0, + _AT, + 4, + (_aKI, _sAK, _sT), + ( + (3, {_sN: _aKI, _sm: None}), + (3, {_sN: _sAK, _sm: None}), + (3, {_sN: _sT, _sm: None}), + ), +) + +ACCOUNT_ID: StaticSchema = (3, n0, _AI, 0) + +AUTHORIZATION_CODE: StaticSchema = (3, n0, _AC, 0) + +BEARER_TOKEN_TYPE: StaticSchema = (3, n0, _BTT, 0) + +CLIENT_CREDENTIALS_GRANT_TYPE: StaticSchema = (3, n0, _CCGT, 0) + +CLIENT_ID: StaticSchema = (3, n0, _CI, 0) + +CLIENT_TOKEN: StaticSchema = (3, n0, _CT, 0) + +CODE_VERIFIER: StaticSchema = (3, n0, _CV, 0) + +CONDITION_VALUES: StaticSchema = (16, n0, _CVo, 0, (_me,), ((3, 0),)) + +CONDITION: StaticSchema = (17, n0, _C, 0, (_k, _v), ((3, 0), (CONDITION_VALUES, 0))) + +CONDITION_TYPE: StaticSchema = (3, n0, _CTo, 0) + +CONDITION_BLOCK: StaticSchema = ( + 17, + n0, + _CB, + 0, + (_k, _v), + ((CONDITION_TYPE, 0), (CONDITION, 0)), +) + +CONFLICT_EXCEPTION: StaticSchema = ( + 18, + n0, + _CE, + {_s: _c, _sE: 409}, + (_e, _m), + ((O_AUTH2_ERROR_CODE, 1), (3, 1)), +) + +CONSOLE_PERMISSION_MAX_RESULTS: StaticSchema = (7, n0, _CPMR, 0) + +GRANT_TYPE: StaticSchema = (3, n0, _GT, 0) + +REDIRECT_URI: StaticSchema = (3, n0, _RU, 0) + +REFRESH_TOKEN: StaticSchema = (3, n0, _RT, 4) + +CREATE_O_AUTH2_TOKEN_REQUEST_BODY: StaticSchema = ( + 18, + n0, + _COATRB, + 0, + (_cI, _gT, _co, _rU, _cV, _rT), + ( + (CLIENT_ID, {_sN: _cI, _sm: None}), + (GRANT_TYPE, {_sN: _gT, _sm: None}), + (AUTHORIZATION_CODE, 0), + (REDIRECT_URI, {_sN: _rU}), + (CODE_VERIFIER, {_sN: _cV}), + (REFRESH_TOKEN, {_sN: _rT}), + ), +) + +CREATE_O_AUTH2_TOKEN_INPUT: StaticSchema = ( + 18, + n0, + _COATI, + {_sSI: _cCOATR, _smit: None}, + (_tI,), + ((CREATE_O_AUTH2_TOKEN_REQUEST_BODY, 17),), +) + +EXPIRES_IN: StaticSchema = (7, n0, _EI, 0) + +ID_TOKEN: StaticSchema = (3, n0, _IT, 0) + +TOKEN_TYPE: StaticSchema = (3, n0, _TT, 0) + +CREATE_O_AUTH2_TOKEN_RESPONSE_BODY: StaticSchema = ( + 18, + n0, + _COATRBr, + 0, + (_aT, _tT, _eI, _rT, _iT), + ( + (ACCESS_TOKEN, {_sN: _aT, _sm: None}), + (TOKEN_TYPE, {_sN: _tT, _sm: None}), + (EXPIRES_IN, {_sN: _eI, _sm: None}), + (REFRESH_TOKEN, {_sN: _rT, _sm: None}), + (ID_TOKEN, {_sN: _iT}), + ), +) + +CREATE_O_AUTH2_TOKEN_OUTPUT: StaticSchema = ( + 18, + n0, + _COATO, + {_sSI: _cCOATRo, _smith: None}, + (_tO,), + ((CREATE_O_AUTH2_TOKEN_RESPONSE_BODY, 17),), ) - -DELETE_CONSOLE_AUTHORIZATION_CONFIGURATION = Schema( - id=ShapeID("com.amazonaws.signin#DeleteConsoleAuthorizationConfiguration"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/delete-console-authorization-configuration"} - ), + +INTERNAL_SERVER_EXCEPTION: StaticSchema = ( + 18, + n0, + _ISE, + {_s: _ser, _sE: 500}, + (_e, _m), + ((O_AUTH2_ERROR_CODE, 1), (3, 1)), +) + +TOO_MANY_REQUESTS_ERROR: StaticSchema = ( + 18, + n0, + _TMRE, + {_s: _c, _sE: 429}, + (_e, _m), + ((O_AUTH2_ERROR_CODE, 1), (3, 1)), +) + +VALIDATION_EXCEPTION: StaticSchema = ( + 18, + n0, + _VE, + {_s: _c, _sE: 400}, + (_e, _m), + ((O_AUTH2_ERROR_CODE, 1), (3, 1)), +) + +CREATE_O_AUTH2_TOKEN: StaticOperationSchema = ( + 23, + n0, + _COAT, + {_smithy: MappingProxyType({"method": "POST", "uri": "/v1/token"})}, + CREATE_O_AUTH2_TOKEN_INPUT, + CREATE_O_AUTH2_TOKEN_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + TOO_MANY_REQUESTS_ERROR, + VALIDATION_EXCEPTION, + ), +) + +CREATE_O_AUTH2_TOKEN_WITH_IAM_INPUT: StaticSchema = ( + 18, + n0, + _COATWIAMI, + {_sSI: _cCOATWIAMR, _smit: None}, + (_gT, _r), + ((CLIENT_CREDENTIALS_GRANT_TYPE, {_sN: _gt, _sm: None}), (3, 1)), +) + +O_AUTH_ACCESS_TOKEN: StaticSchema = (3, n0, _OAAT, 4) + +TOKEN_EXPIRES_IN: StaticSchema = (7, n0, _TEI, 0) + +CREATE_O_AUTH2_TOKEN_WITH_IAM_OUTPUT: StaticSchema = ( + 18, + n0, + _COATWIAMO, + {_sSI: _cCOATWIAMRo, _smith: None}, + (_aT, _tT, _eI), + ( + (O_AUTH_ACCESS_TOKEN, {_sN: _at, _sm: None}), + (BEARER_TOKEN_TYPE, {_sN: _tt, _sm: None}), + (TOKEN_EXPIRES_IN, {_sN: _ei, _sm: None}), + ), +) + +CREATE_O_AUTH2_TOKEN_WITH_IAM: StaticOperationSchema = ( + 23, + n0, + _COATWIAM, + { + _smithy: MappingProxyType( + {"method": "POST", "uri": "/v1/token?x-amz-client-auth-method=iam"} ) - ], -) - -STATEMENT_ID = Schema( - id=ShapeID("com.amazonaws.signin#StatementId"), shape_type=ShapeType.STRING -) - -DELETE_RESOURCE_PERMISSION_STATEMENT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.signin#DeleteResourcePermissionStatementInput"), - members={ - "statementId": { - "target": STATEMENT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, }, -) - -DELETE_RESOURCE_PERMISSION_STATEMENT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.signin#DeleteResourcePermissionStatementOutput") -) - -DELETE_RESOURCE_PERMISSION_STATEMENT = Schema( - id=ShapeID("com.amazonaws.signin#DeleteResourcePermissionStatement"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/delete-resource-permission-statement"} - ), + CREATE_O_AUTH2_TOKEN_WITH_IAM_INPUT, + CREATE_O_AUTH2_TOKEN_WITH_IAM_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + TOO_MANY_REQUESTS_ERROR, + VALIDATION_EXCEPTION, + ), +) + +TARGET_ID: StaticSchema = (3, n0, _TI, 0) + +DELETE_CONSOLE_AUTHORIZATION_CONFIGURATION_INPUT: StaticSchema = ( + 18, + n0, + _DCACI, + {_smit: None}, + (_tIa,), + ((TARGET_ID, 0),), +) + +DELETE_CONSOLE_AUTHORIZATION_CONFIGURATION_OUTPUT: StaticSchema = ( + 18, + n0, + _DCACO, + {_smith: None}, + (_tIa, _sc, _cAE), + ((TARGET_ID, 1), (3, 1), (2, 1)), +) + +RESOURCE_NOT_FOUND_EXCEPTION: StaticSchema = ( + 18, + n0, + _RNFE, + {_s: _c, _sE: 404}, + (_e, _m), + ((O_AUTH2_ERROR_CODE, 1), (3, 1)), +) + +DELETE_CONSOLE_AUTHORIZATION_CONFIGURATION: StaticOperationSchema = ( + 23, + n0, + _DCAC, + { + _smithy: MappingProxyType( + {"method": "POST", "uri": "/delete-console-authorization-configuration"} ) - ], -) - -EXCLUDED_PRINCIPAL = Schema( - id=ShapeID("com.amazonaws.signin#ExcludedPrincipal"), shape_type=ShapeType.STRING -) - -GET_CONSOLE_AUTHORIZATION_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.signin#GetConsoleAuthorizationConfigurationInput"), - members={"targetId": {"target": TARGET_ID}}, -) - -GET_CONSOLE_AUTHORIZATION_CONFIGURATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.signin#GetConsoleAuthorizationConfigurationOutput"), - members={ - "targetId": { - "target": TARGET_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "scope": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "consoleAuthorizationEnabled": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, }, -) - -GET_CONSOLE_AUTHORIZATION_CONFIGURATION = Schema( - id=ShapeID("com.amazonaws.signin#GetConsoleAuthorizationConfiguration"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/get-console-authorization-configuration"} - ), + DELETE_CONSOLE_AUTHORIZATION_CONFIGURATION_INPUT, + DELETE_CONSOLE_AUTHORIZATION_CONFIGURATION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_ERROR, + VALIDATION_EXCEPTION, + ), +) + +STATEMENT_ID: StaticSchema = (3, n0, _SI, 0) + +DELETE_RESOURCE_PERMISSION_STATEMENT_INPUT: StaticSchema = ( + 18, + n0, + _DRPSI, + {_smit: None}, + (_sI, _cT), + ((STATEMENT_ID, 1), (CLIENT_TOKEN, 2)), +) + +DELETE_RESOURCE_PERMISSION_STATEMENT_OUTPUT: StaticSchema = ( + 18, + n0, + _DRPSO, + {_smith: None}, +) + +DELETE_RESOURCE_PERMISSION_STATEMENT: StaticOperationSchema = ( + 23, + n0, + _DRPS, + { + _smithy: MappingProxyType( + {"method": "POST", "uri": "/delete-resource-permission-statement"} ) - ], -) - -GET_RESOURCE_POLICY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.signin#GetResourcePolicyInput") -) - -POLICY_ACTIONS = Schema.collection( - id=ShapeID("com.amazonaws.signin#PolicyActions"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, -) - -PRINCIPAL = Schema.collection( - id=ShapeID("com.amazonaws.signin#Principal"), - shape_type=ShapeType.MAP, - members={"key": {"target": STRING}, "value": {"target": STRING}}, -) - -POLICY_STATEMENT = Schema.collection( - id=ShapeID("com.amazonaws.signin#PolicyStatement"), - members={ - "effect": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="Effect")], - }, - "principal": { - "target": PRINCIPAL, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="Principal")], - }, - "action": { - "target": POLICY_ACTIONS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="Action")], - }, - "resource": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="Resource")], - }, - "condition": { - "target": CONDITION_BLOCK, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="Condition")], - }, - }, -) - -POLICY_STATEMENTS = Schema.collection( - id=ShapeID("com.amazonaws.signin#PolicyStatements"), - shape_type=ShapeType.LIST, - members={"member": {"target": POLICY_STATEMENT}}, -) - -SIGNIN_RESOURCE_BASED_POLICY = Schema.collection( - id=ShapeID("com.amazonaws.signin#SigninResourceBasedPolicy"), - members={ - "version": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="Version")], - }, - "statement": { - "target": POLICY_STATEMENTS, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="Statement")], - }, - }, -) - -GET_RESOURCE_POLICY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.signin#GetResourcePolicyOutput"), - members={ - "signinResourceBasedPolicy": { - "target": SIGNIN_RESOURCE_BASED_POLICY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } }, -) - -GET_RESOURCE_POLICY = Schema( - id=ShapeID("com.amazonaws.signin#GetResourcePolicy"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType({"method": "POST", "uri": "/get-resource-policy"}), - ) - ], -) - -INTROSPECTED_TOKEN_TYPE = Schema( - id=ShapeID("com.amazonaws.signin#IntrospectedTokenType"), - shape_type=ShapeType.STRING, -) - -INTROSPECTION_TOKEN = Schema( - id=ShapeID("com.amazonaws.signin#IntrospectionToken"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -TOKEN_TYPE_HINT = Schema( - id=ShapeID("com.amazonaws.signin#TokenTypeHint"), shape_type=ShapeType.STRING -) - -INTROSPECT_O_AUTH2_TOKEN_WITH_IAM_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.signin#IntrospectOAuth2TokenWithIAMInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.signin#IntrospectOAuth2TokenWithIAMRequest", + DELETE_RESOURCE_PERMISSION_STATEMENT_INPUT, + DELETE_RESOURCE_PERMISSION_STATEMENT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_ERROR, + VALIDATION_EXCEPTION, + ), +) + +EXCLUDED_PRINCIPAL: StaticSchema = (3, n0, _EP, 0) + +GET_CONSOLE_AUTHORIZATION_CONFIGURATION_INPUT: StaticSchema = ( + 18, + n0, + _GCACI, + {_smit: None}, + (_tIa,), + ((TARGET_ID, 0),), +) + +GET_CONSOLE_AUTHORIZATION_CONFIGURATION_OUTPUT: StaticSchema = ( + 18, + n0, + _GCACO, + {_smith: None}, + (_tIa, _sc, _cAE), + ((TARGET_ID, 1), (3, 1), (2, 1)), +) + +GET_CONSOLE_AUTHORIZATION_CONFIGURATION: StaticOperationSchema = ( + 23, + n0, + _GCAC, + { + _smithy: MappingProxyType( + {"method": "POST", "uri": "/get-console-authorization-configuration"} ) - ], - members={ - "token": { - "target": INTROSPECTION_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="token"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "tokenTypeHint": { - "target": TOKEN_TYPE_HINT, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="token_type_hint") - ], - }, }, -) - -INTROSPECT_O_AUTH2_TOKEN_WITH_IAM_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.signin#IntrospectOAuth2TokenWithIAMOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.signin#IntrospectOAuth2TokenWithIAMResponse", + GET_CONSOLE_AUTHORIZATION_CONFIGURATION_INPUT, + GET_CONSOLE_AUTHORIZATION_CONFIGURATION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_ERROR, + VALIDATION_EXCEPTION, + ), +) + +GET_RESOURCE_POLICY_INPUT: StaticSchema = (18, n0, _GRPI, {_smit: None}) + +POLICY_ACTIONS: StaticSchema = (16, n0, _PA, 0, (_me,), ((3, 0),)) + +PRINCIPAL: StaticSchema = (17, n0, _P, 0, (_k, _v), ((3, 0), (3, 0))) + +POLICY_STATEMENT: StaticSchema = ( + 18, + n0, + _PS, + 0, + (_ef, _p, _a, _r, _con), + ( + (3, {_sN: _E}), + (PRINCIPAL, {_sN: _P}), + (POLICY_ACTIONS, {_sN: _A}), + (3, {_sN: _R}), + (CONDITION_BLOCK, {_sN: _C}), + ), +) + +POLICY_STATEMENTS: StaticSchema = (16, n0, _PSo, 0, (_me,), ((POLICY_STATEMENT, 0),)) + +SIGNIN_RESOURCE_BASED_POLICY: StaticSchema = ( + 18, + n0, + _SRBP, + 0, + (_ve, _st), + ((3, {_sN: _V}), (POLICY_STATEMENTS, {_sN: _S})), +) + +GET_RESOURCE_POLICY_OUTPUT: StaticSchema = ( + 18, + n0, + _GRPO, + {_smith: None}, + (_sRBP,), + ((SIGNIN_RESOURCE_BASED_POLICY, 1),), +) + +GET_RESOURCE_POLICY: StaticOperationSchema = ( + 23, + n0, + _GRP, + {_smithy: MappingProxyType({"method": "POST", "uri": "/get-resource-policy"})}, + GET_RESOURCE_POLICY_INPUT, + GET_RESOURCE_POLICY_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_ERROR, + ), +) + +INTROSPECTED_TOKEN_TYPE: StaticSchema = (3, n0, _ITT, 0) + +INTROSPECTION_TOKEN: StaticSchema = (3, n0, _ITn, 4) + +TOKEN_TYPE_HINT: StaticSchema = (3, n0, _TTH, 0) + +INTROSPECT_O_AUTH2_TOKEN_WITH_IAM_INPUT: StaticSchema = ( + 18, + n0, + _IOATWIAMI, + {_sSI: _cIOATWIAMR, _smit: None}, + (_t, _tTH), + ((INTROSPECTION_TOKEN, {_sN: _t, _sm: None}), (TOKEN_TYPE_HINT, {_sN: _tth})), +) + +INTROSPECT_O_AUTH2_TOKEN_WITH_IAM_OUTPUT: StaticSchema = ( + 18, + n0, + _IOATWIAMO, + {_sSI: _cIOATWIAMRo, _smith: None}, + (_ac, _cI, _uI, _tT, _ex, _i, _n, _su, _au, _is, _j, _aI, _sS, _r), + ( + (2, 1), + (3, {_sN: _ci}), + (3, {_sN: _ui}), + (INTROSPECTED_TOKEN_TYPE, {_sN: _tt}), + (8, {_sN: _ex}), + (8, {_sN: _i}), + (8, {_sN: _n}), + (3, {_sN: _su}), + (3, {_sN: _au}), + (3, {_sN: _is}), + (3, {_sN: _j}), + (ACCOUNT_ID, {_sN: _ai}), + (3, {_sN: _ss}), + (3, {_sN: _r}), + ), +) + +INTROSPECT_O_AUTH2_TOKEN_WITH_IAM: StaticOperationSchema = ( + 23, + n0, + _IOATWIAM, + { + _smithy: MappingProxyType( + {"method": "POST", "uri": "/v1/introspect?x-amz-client-auth-method=iam"} ) - ], - members={ - "active": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "clientId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="client_id")], - }, - "userId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="user_id")], - }, - "tokenType": { - "target": INTROSPECTED_TOKEN_TYPE, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="token_type") - ], - }, - "exp": { - "target": LONG, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="exp")], - }, - "iat": { - "target": LONG, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="iat")], - }, - "nbf": { - "target": LONG, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="nbf")], - }, - "sub": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="sub")], - }, - "aud": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="aud")], - }, - "iss": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="iss")], - }, - "jti": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="jti")], - }, - "accountId": { - "target": ACCOUNT_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="account_id") - ], - }, - "signinSession": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="signin_session") - ], - }, - "resource": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#jsonName"), value="resource")], - }, }, -) - -INTROSPECT_O_AUTH2_TOKEN_WITH_IAM = Schema( - id=ShapeID("com.amazonaws.signin#IntrospectOAuth2TokenWithIAM"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/v1/introspect?x-amz-client-auth-method=iam"} - ), + INTROSPECT_O_AUTH2_TOKEN_WITH_IAM_INPUT, + INTROSPECT_O_AUTH2_TOKEN_WITH_IAM_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + TOO_MANY_REQUESTS_ERROR, + VALIDATION_EXCEPTION, + ), +) + +NEXT_TOKEN: StaticSchema = (3, n0, _NT, 0) + +LIST_RESOURCE_PERMISSION_STATEMENTS_INPUT: StaticSchema = ( + 18, + n0, + _LRPSI, + {_smit: None}, + (_mR, _nT), + ((CONSOLE_PERMISSION_MAX_RESULTS, 0), (NEXT_TOKEN, 0)), +) + +PERMISSION_STATEMENT_SUMMARY: StaticSchema = ( + 18, + n0, + _PSS, + 0, + (_si, _con), + ((STATEMENT_ID, 1), (CONDITION_BLOCK, 0)), +) + +PERMISSION_STATEMENT_SUMMARIES: StaticSchema = ( + 16, + n0, + _PSSe, + 0, + (_me,), + ((PERMISSION_STATEMENT_SUMMARY, 0),), +) + +LIST_RESOURCE_PERMISSION_STATEMENTS_OUTPUT: StaticSchema = ( + 18, + n0, + _LRPSO, + {_smith: None}, + (_pS, _nT), + ((PERMISSION_STATEMENT_SUMMARIES, 1), (NEXT_TOKEN, 0)), +) + +LIST_RESOURCE_PERMISSION_STATEMENTS: StaticOperationSchema = ( + 23, + n0, + _LRPS, + { + _smithy: MappingProxyType( + {"method": "POST", "uri": "/list-resource-permission-statements"} ) - ], -) - -NEXT_TOKEN = Schema( - id=ShapeID("com.amazonaws.signin#NextToken"), shape_type=ShapeType.STRING -) - -LIST_RESOURCE_PERMISSION_STATEMENTS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.signin#ListResourcePermissionStatementsInput"), - members={ - "maxResults": {"target": CONSOLE_PERMISSION_MAX_RESULTS}, - "nextToken": {"target": NEXT_TOKEN}, - }, -) - -PERMISSION_STATEMENT_SUMMARY = Schema.collection( - id=ShapeID("com.amazonaws.signin#PermissionStatementSummary"), - members={ - "sid": { - "target": STATEMENT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "condition": {"target": CONDITION_BLOCK}, }, -) - -PERMISSION_STATEMENT_SUMMARIES = Schema.collection( - id=ShapeID("com.amazonaws.signin#PermissionStatementSummaries"), - shape_type=ShapeType.LIST, - members={"member": {"target": PERMISSION_STATEMENT_SUMMARY}}, -) - -LIST_RESOURCE_PERMISSION_STATEMENTS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.signin#ListResourcePermissionStatementsOutput"), - members={ - "permissionStatements": { - "target": PERMISSION_STATEMENT_SUMMARIES, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "nextToken": {"target": NEXT_TOKEN}, - }, -) - -LIST_RESOURCE_PERMISSION_STATEMENTS = Schema( - id=ShapeID("com.amazonaws.signin#ListResourcePermissionStatements"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/list-resource-permission-statements"} - ), + LIST_RESOURCE_PERMISSION_STATEMENTS_INPUT, + LIST_RESOURCE_PERMISSION_STATEMENTS_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_ERROR, + VALIDATION_EXCEPTION, + ), +) + +PUT_CONSOLE_AUTHORIZATION_CONFIGURATION_INPUT: StaticSchema = ( + 18, + n0, + _PCACI, + {_smit: None}, + (_tIa,), + ((TARGET_ID, 0),), +) + +PUT_CONSOLE_AUTHORIZATION_CONFIGURATION_OUTPUT: StaticSchema = ( + 18, + n0, + _PCACO, + {_smith: None}, + (_tIa, _sc, _cAE), + ((TARGET_ID, 1), (3, 1), (2, 1)), +) + +PUT_CONSOLE_AUTHORIZATION_CONFIGURATION: StaticOperationSchema = ( + 23, + n0, + _PCAC, + { + _smithy: MappingProxyType( + {"method": "POST", "uri": "/put-console-authorization-configuration"} ) - ], -) - -PUT_CONSOLE_AUTHORIZATION_CONFIGURATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.signin#PutConsoleAuthorizationConfigurationInput"), - members={"targetId": {"target": TARGET_ID}}, -) - -PUT_CONSOLE_AUTHORIZATION_CONFIGURATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.signin#PutConsoleAuthorizationConfigurationOutput"), - members={ - "targetId": { - "target": TARGET_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "scope": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "consoleAuthorizationEnabled": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, }, -) - -PUT_CONSOLE_AUTHORIZATION_CONFIGURATION = Schema( - id=ShapeID("com.amazonaws.signin#PutConsoleAuthorizationConfiguration"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/put-console-authorization-configuration"} - ), + PUT_CONSOLE_AUTHORIZATION_CONFIGURATION_INPUT, + PUT_CONSOLE_AUTHORIZATION_CONFIGURATION_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + TOO_MANY_REQUESTS_ERROR, + VALIDATION_EXCEPTION, + ), +) + +SOURCE_VPCE: StaticSchema = (3, n0, _SV, 0) + +REQUESTED_REGION: StaticSchema = (3, n0, _RR, 0) + +SOURCE_IP: StaticSchema = (3, n0, _SIo, 0) + +SOURCE_VPC: StaticSchema = (3, n0, _SVo, 0) + +VPC_SOURCE_IP: StaticSchema = (3, n0, _VSI, 0) + +PUT_RESOURCE_PERMISSION_STATEMENT_INPUT: StaticSchema = ( + 18, + n0, + _PRPSI, + {_smit: None}, + (_sVo, _sSV, _cSV, _vSI, _sIo, _rR, _eP, _cT), + ( + (SOURCE_VPC, 0), + (SOURCE_VPCE, 0), + (SOURCE_VPCE, 0), + (VPC_SOURCE_IP, 0), + (SOURCE_IP, 0), + (REQUESTED_REGION, 0), + (EXCLUDED_PRINCIPAL, 0), + (CLIENT_TOKEN, 2), + ), +) + +PUT_RESOURCE_PERMISSION_STATEMENT_OUTPUT: StaticSchema = ( + 18, + n0, + _PRPSO, + {_smith: None}, + (_sI,), + ((STATEMENT_ID, 1),), +) + +SERVICE_QUOTA_EXCEEDED_EXCEPTION: StaticSchema = ( + 18, + n0, + _SQEE, + {_s: _c, _sE: 402}, + (_e, _m), + ((O_AUTH2_ERROR_CODE, 1), (3, 1)), +) + +PUT_RESOURCE_PERMISSION_STATEMENT: StaticOperationSchema = ( + 23, + n0, + _PRPS, + { + _smithy: MappingProxyType( + {"method": "POST", "uri": "/put-resource-permission-statement"} ) - ], -) - -SOURCE_VPCE = Schema( - id=ShapeID("com.amazonaws.signin#SourceVpce"), shape_type=ShapeType.STRING -) - -REQUESTED_REGION = Schema( - id=ShapeID("com.amazonaws.signin#RequestedRegion"), shape_type=ShapeType.STRING -) - -SOURCE_IP = Schema( - id=ShapeID("com.amazonaws.signin#SourceIp"), shape_type=ShapeType.STRING -) - -SOURCE_VPC = Schema( - id=ShapeID("com.amazonaws.signin#SourceVpc"), shape_type=ShapeType.STRING -) - -VPC_SOURCE_IP = Schema( - id=ShapeID("com.amazonaws.signin#VpcSourceIp"), shape_type=ShapeType.STRING -) - -PUT_RESOURCE_PERMISSION_STATEMENT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.signin#PutResourcePermissionStatementInput"), - members={ - "sourceVpc": {"target": SOURCE_VPC}, - "signinSourceVpce": {"target": SOURCE_VPCE}, - "consoleSourceVpce": {"target": SOURCE_VPCE}, - "vpcSourceIp": {"target": VPC_SOURCE_IP}, - "sourceIp": {"target": SOURCE_IP}, - "requestedRegion": {"target": REQUESTED_REGION}, - "excludedPrincipal": {"target": EXCLUDED_PRINCIPAL}, - "clientToken": { - "target": CLIENT_TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#idempotencyToken"))], - }, - }, -) - -PUT_RESOURCE_PERMISSION_STATEMENT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.signin#PutResourcePermissionStatementOutput"), - members={ - "statementId": { - "target": STATEMENT_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } }, -) - -SERVICE_QUOTA_EXCEEDED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.signin#ServiceQuotaExceededException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=402), - ], - members={ - "error": { - "target": O_AUTH2_ERROR_CODE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "message": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -PUT_RESOURCE_PERMISSION_STATEMENT = Schema( - id=ShapeID("com.amazonaws.signin#PutResourcePermissionStatement"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/put-resource-permission-statement"} - ), - ) - ], -) - -REVOCATION_TOKEN = Schema( - id=ShapeID("com.amazonaws.signin#RevocationToken"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -REVOKE_O_AUTH2_TOKEN_WITH_IAM_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.signin#RevokeOAuth2TokenWithIAMInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.signin#RevokeOAuth2TokenWithIAMRequest", + PUT_RESOURCE_PERMISSION_STATEMENT_INPUT, + PUT_RESOURCE_PERMISSION_STATEMENT_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + SERVICE_QUOTA_EXCEEDED_EXCEPTION, + TOO_MANY_REQUESTS_ERROR, + VALIDATION_EXCEPTION, + ), +) + +REVOCATION_TOKEN: StaticSchema = (3, n0, _RTe, 4) + +REVOKE_O_AUTH2_TOKEN_WITH_IAM_INPUT: StaticSchema = ( + 18, + n0, + _ROATWIAMI, + {_sSI: _cROATWIAMR, _smit: None}, + (_t,), + ((REVOCATION_TOKEN, {_sN: _t, _sm: None}),), +) + +REVOKE_O_AUTH2_TOKEN_WITH_IAM_OUTPUT: StaticSchema = ( + 18, + n0, + _ROATWIAMO, + {_sSI: _cROATWIAMRo, _smith: None}, +) + +REVOKE_O_AUTH2_TOKEN_WITH_IAM: StaticOperationSchema = ( + 23, + n0, + _ROATWIAM, + { + _smithy: MappingProxyType( + {"method": "POST", "uri": "/v1/revoke?x-amz-client-auth-method=iam"} ) - ], - members={ - "token": { - "target": REVOCATION_TOKEN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#jsonName"), value="token"), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } }, -) - -REVOKE_O_AUTH2_TOKEN_WITH_IAM_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.signin#RevokeOAuth2TokenWithIAMOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.signin#RevokeOAuth2TokenWithIAMResponse", - ) - ], -) - -REVOKE_O_AUTH2_TOKEN_WITH_IAM = Schema( - id=ShapeID("com.amazonaws.signin#RevokeOAuth2TokenWithIAM"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/v1/revoke?x-amz-client-auth-method=iam"} - ), - ) - ], -) - -SIGNIN = Schema( - id=ShapeID("com.amazonaws.signin#Signin"), - shape_type=ShapeType.SERVICE, - traits=[ - Trait.new( - id=ShapeID("aws.auth#sigv4"), value=MappingProxyType({"name": "signin"}) - ), - Trait.new( - id=ShapeID("smithy.rules#endpointBdd"), - value=MappingProxyType( - { - "version": "1.1", - "parameters": MappingProxyType( - { - "UseDualStack": MappingProxyType( - { - "builtIn": "AWS::UseDualStack", - "required": True, - "default": False, - "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", - "type": "boolean", - } - ), - "UseFIPS": MappingProxyType( - { - "builtIn": "AWS::UseFIPS", - "required": True, - "default": False, - "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", - "type": "boolean", - } - ), - "Endpoint": MappingProxyType( - { - "builtIn": "SDK::Endpoint", - "required": False, - "documentation": "Override the endpoint used to send this request", - "type": "string", - } - ), - "Region": MappingProxyType( - { - "builtIn": "AWS::Region", - "required": False, - "documentation": "The AWS region used to dispatch the request.", - "type": "string", - } - ), - "IsControlPlane": MappingProxyType( - { - "required": False, - "documentation": "Indicates if the operation targets the control plane endpoint", - "type": "boolean", - } - ), - "IsOAuthEndpoint": MappingProxyType( - { - "required": False, - "documentation": "Indicates if the operation targets the OAuth token endpoint", - "type": "boolean", - } - ), - } - ), - "conditions": ( - MappingProxyType( + REVOKE_O_AUTH2_TOKEN_WITH_IAM_INPUT, + REVOKE_O_AUTH2_TOKEN_WITH_IAM_OUTPUT, + ( + ACCESS_DENIED_EXCEPTION, + INTERNAL_SERVER_EXCEPTION, + TOO_MANY_REQUESTS_ERROR, + VALIDATION_EXCEPTION, + ), +) + +SIGNIN: StaticSchema = ( + 21, + n0, + _Si, + { + _aw: MappingProxyType({"name": "signin"}), + _sB: MappingProxyType( + { + "version": "1.1", + "parameters": MappingProxyType( + { + "UseDualStack": MappingProxyType( { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "Region"}),), - } - ), - MappingProxyType( - { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( - { - "fn": "coalesce", - "argv": ( - MappingProxyType( - {"ref": "IsControlPlane"} - ), - False, - ), - } - ), - True, - ), + "builtIn": "AWS::UseDualStack", + "required": True, + "default": False, + "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", + "type": "boolean", } ), - MappingProxyType( + "UseFIPS": MappingProxyType( { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "Endpoint"}),), + "builtIn": "AWS::UseFIPS", + "required": True, + "default": False, + "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", + "type": "boolean", } ), - MappingProxyType( + "Endpoint": MappingProxyType( { - "fn": "aws.partition", - "argv": (MappingProxyType({"ref": "Region"}),), - "assign": "PartitionResult", + "builtIn": "SDK::Endpoint", + "required": False, + "documentation": "Override the endpoint used to send this request", + "type": "string", } ), - MappingProxyType( + "Region": MappingProxyType( { - "fn": "booleanEquals", - "argv": (MappingProxyType({"ref": "UseFIPS"}), True), + "builtIn": "AWS::Region", + "required": False, + "documentation": "The AWS region used to dispatch the request.", + "type": "string", } ), - MappingProxyType( + "IsControlPlane": MappingProxyType( { - "fn": "stringEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "name", - ), - } - ), - "aws", - ), + "required": False, + "documentation": "Indicates if the operation targets the control plane endpoint", + "type": "boolean", } ), - MappingProxyType( + "IsOAuthEndpoint": MappingProxyType( { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( - { - "fn": "coalesce", - "argv": ( - MappingProxyType( - {"ref": "IsOAuthEndpoint"} - ), - False, - ), - } - ), - True, - ), + "required": False, + "documentation": "Indicates if the operation targets the OAuth token endpoint", + "type": "boolean", } ), - MappingProxyType( - { - "fn": "booleanEquals", - "argv": ( - MappingProxyType({"ref": "UseDualStack"}), - True, + } + ), + "conditions": ( + MappingProxyType( + {"fn": "isSet", "argv": (MappingProxyType({"ref": "Region"}),)} + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "fn": "coalesce", + "argv": ( + MappingProxyType({"ref": "IsControlPlane"}), + False, + ), + } ), - } - ), - MappingProxyType( - { - "fn": "stringEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "name", - ), - } - ), - "aws-cn", - ), - } - ), - MappingProxyType( - { - "fn": "stringEquals", - "argv": ( - MappingProxyType({"ref": "Region"}), - "us-gov-west-1", - ), - } - ), - MappingProxyType( - { - "fn": "stringEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "name", - ), - } - ), - "aws-us-gov", - ), - } - ), - MappingProxyType( - { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "supportsFIPS", - ), - } - ), - True, - ), - } - ), - MappingProxyType( - { - "fn": "stringEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "name", - ), - } - ), - "aws-iso", - ), - } - ), - MappingProxyType( - { - "fn": "stringEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "name", - ), - } - ), - "aws-iso-b", - ), - } - ), - MappingProxyType( - { - "fn": "stringEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "name", - ), - } - ), - "aws-iso-f", - ), - } - ), - MappingProxyType( - { - "fn": "stringEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "name", - ), - } - ), - "aws-iso-e", - ), - } - ), - MappingProxyType( - { - "fn": "stringEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "name", - ), - } - ), - "aws-eusc", - ), - } - ), - MappingProxyType( - { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "supportsDualStack", - ), - } - ), - True, - ), - } - ), + True, + ), + } ), - "results": ( - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + MappingProxyType( + { + "fn": "isSet", + "argv": (MappingProxyType({"ref": "Endpoint"}),), + } + ), + MappingProxyType( + { + "fn": "aws.partition", + "argv": (MappingProxyType({"ref": "Region"}),), + "assign": "PartitionResult", + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": (MappingProxyType({"ref": "UseFIPS"}), True), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( { - "url": "https://signin.{Region}.api.aws", - "properties": MappingProxyType( - { - "authSchemes": ( - MappingProxyType( - { - "name": "sigv4", - "signingName": "signin", - "signingRegion": "{Region}", - } - ), - ) - } + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "name", ), - "headers": MappingProxyType({}), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + "aws", + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( { - "url": "https://signin.{Region}.api.amazonwebservices.com.cn", - "properties": MappingProxyType( - { - "authSchemes": ( - MappingProxyType( - { - "name": "sigv4", - "signingName": "signin", - "signingRegion": "{Region}", - } - ), - ) - } + "fn": "coalesce", + "argv": ( + MappingProxyType( + {"ref": "IsOAuthEndpoint"} + ), + False, ), - "headers": MappingProxyType({}), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + True, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": (MappingProxyType({"ref": "UseDualStack"}), True), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( { - "url": "https://signin.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType( - { - "authSchemes": ( - MappingProxyType( - { - "name": "sigv4", - "signingName": "signin", - "signingRegion": "{Region}", - } - ), - ) - } + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "name", ), - "headers": MappingProxyType({}), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "FIPS endpoints are not supported for OAuth operations. Disable FIPS or use a non-OAuth operation.", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + "aws-cn", + ), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType({"ref": "Region"}), + "us-gov-west-1", + ), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( { - "url": "https://{Region}.oauth.signin.aws", - "properties": MappingProxyType( - { - "authSchemes": ( - MappingProxyType( - { - "name": "sigv4", - "signingName": "signin", - "signingRegion": "{Region}", - } - ), - ) - } + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "name", ), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://{Region}.signin.aws.amazon.com", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://{Region}.signin.amazonaws.cn", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://{Region}.signin.amazonaws-us-gov.com", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://{Region}.signin.c2shome.ic.gov", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://{Region}.signin.sc2shome.sgov.gov", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://{Region}.signin.csphome.hci.ic.gov", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://{Region}.signin.csphome.adc-e.uk", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://{Region}.signin.amazonaws-eusc.eu", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://signin-fips.amazonaws-us-gov.com", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + "aws-us-gov", + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( { - "url": "https://{Region}.signin-fips.amazonaws-us-gov.com", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "supportsFIPS", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + True, + ), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( { - "url": "https://{Region}.signin.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "name", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: FIPS and custom endpoint are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + "aws-iso", + ), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( { - "url": MappingProxyType({"ref": "Endpoint"}), - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "name", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + "aws-iso-b", + ), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( { - "url": "https://signin-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "name", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "FIPS and DualStack are enabled, but this partition does not support one or both", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + "aws-iso-f", + ), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( { - "url": "https://signin-fips.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "name", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "FIPS is enabled but this partition does not support FIPS", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + "aws-iso-e", + ), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( { - "url": "https://signin.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "name", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "DualStack is enabled but this partition does not support DualStack", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + "aws-eusc", + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( { - "url": "https://signin.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "supportsDualStack", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: Missing Region", - "type": "error", - } - ), + True, + ), + } + ), + ), + "results": ( + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://signin.{Region}.api.aws", + "properties": MappingProxyType( + { + "authSchemes": ( + MappingProxyType( + { + "name": "sigv4", + "signingName": "signin", + "signingRegion": "{Region}", + } + ), + ) + } + ), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://signin.{Region}.api.amazonwebservices.com.cn", + "properties": MappingProxyType( + { + "authSchemes": ( + MappingProxyType( + { + "name": "sigv4", + "signingName": "signin", + "signingRegion": "{Region}", + } + ), + ) + } + ), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://signin.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType( + { + "authSchemes": ( + MappingProxyType( + { + "name": "sigv4", + "signingName": "signin", + "signingRegion": "{Region}", + } + ), + ) + } + ), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS endpoints are not supported for OAuth operations. Disable FIPS or use a non-OAuth operation.", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://{Region}.oauth.signin.aws", + "properties": MappingProxyType( + { + "authSchemes": ( + MappingProxyType( + { + "name": "sigv4", + "signingName": "signin", + "signingRegion": "{Region}", + } + ), + ) + } + ), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://{Region}.signin.aws.amazon.com", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } ), - "root": 2, - "nodeCount": 40, - "nodes": "/////wAAAAH/////AAAAAAAAAAYAAAADAAAAAgAAACQAAAAEAAAABAAAAAUF9eEbAAAABgX14QQF9eEbAAAAAQAAAB0AAAAHAAAAAgAAACQAAAAIAAAAAwAAAAkAAAAfAAAABAAAABYAAAAKAAAABQAAABMAAAALAAAABwAAABUAAAAMAAAACAX14QcAAAANAAAACgX14QgAAAAOAAAADAX14QkAAAAPAAAADQX14QoAAAAQAAAADgX14QsAAAARAAAADwX14QwAAAASAAAAEAX14Q0F9eEQAAAABgX14QUAAAAUAAAABwAAABUF9eEGAAAAEQX14RgF9eEZAAAABgX14QQAAAAXAAAABwAAABsAAAAYAAAACQX14Q4AAAAZAAAACgX14Q8AAAAaAAAACwX14RYF9eEXAAAACwAAABwF9eEVAAAAEQX14RQF9eEVAAAAAgAAACMAAAAeAAAAAwAAACcAAAAfAAAABAAAACAF9eEbAAAABgX14QQAAAAhAAAABwX14RsAAAAiAAAACQX14Q4F9eEbAAAAAwAAACcAAAAkAAAABAAAACYAAAAlAAAABwX14RIF9eETAAAABgX14QQF9eERAAAABQX14QEAAAAoAAAACAX14QIF9eED", - } - ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://{Region}.signin.amazonaws.cn", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://{Region}.signin.amazonaws-us-gov.com", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://{Region}.signin.c2shome.ic.gov", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://{Region}.signin.sc2shome.sgov.gov", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://{Region}.signin.csphome.hci.ic.gov", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://{Region}.signin.csphome.adc-e.uk", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://{Region}.signin.amazonaws-eusc.eu", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://signin-fips.amazonaws-us-gov.com", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://{Region}.signin-fips.amazonaws-us-gov.com", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://{Region}.signin.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: FIPS and custom endpoint are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": MappingProxyType({"ref": "Endpoint"}), + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://signin-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS and DualStack are enabled, but this partition does not support one or both", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://signin-fips.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS is enabled but this partition does not support FIPS", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://signin.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "DualStack is enabled but this partition does not support DualStack", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://signin.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Missing Region", + "type": "error", + } + ), + ), + "root": 2, + "nodeCount": 40, + "nodes": "/////wAAAAH/////AAAAAAAAAAYAAAADAAAAAgAAACQAAAAEAAAABAAAAAUF9eEbAAAABgX14QQF9eEbAAAAAQAAAB0AAAAHAAAAAgAAACQAAAAIAAAAAwAAAAkAAAAfAAAABAAAABYAAAAKAAAABQAAABMAAAALAAAABwAAABUAAAAMAAAACAX14QcAAAANAAAACgX14QgAAAAOAAAADAX14QkAAAAPAAAADQX14QoAAAAQAAAADgX14QsAAAARAAAADwX14QwAAAASAAAAEAX14Q0F9eEQAAAABgX14QUAAAAUAAAABwAAABUF9eEGAAAAEQX14RgF9eEZAAAABgX14QQAAAAXAAAABwAAABsAAAAYAAAACQX14Q4AAAAZAAAACgX14Q8AAAAaAAAACwX14RYF9eEXAAAACwAAABwF9eEVAAAAEQX14RQF9eEVAAAAAgAAACMAAAAeAAAAAwAAACcAAAAfAAAABAAAACAF9eEbAAAABgX14QQAAAAhAAAABwX14RsAAAAiAAAACQX14Q4F9eEbAAAAAwAAACcAAAAkAAAABAAAACYAAAAlAAAABwX14RIF9eETAAAABgX14QQF9eERAAAABQX14QEAAAAoAAAACAX14QIF9eED", + } ), - Trait.new( - id=ShapeID("aws.api#service"), - value=MappingProxyType( - { - "sdkId": "Signin", - "arnNamespace": "signin", - "endpointPrefix": "signin", - } - ), + _aws: MappingProxyType( + {"sdkId": "Signin", "arnNamespace": "signin", "endpointPrefix": "signin"} ), - Trait.new(id=ShapeID("aws.protocols#restJson1")), - ], + _aJ: None, + }, ) diff --git a/clients/aws-sdk-signin/src/aws_sdk_signin/client.py b/clients/aws-sdk-signin/src/aws_sdk_signin/client.py index c61161da..c83eafea 100644 --- a/clients/aws-sdk-signin/src/aws_sdk_signin/client.py +++ b/clients/aws-sdk-signin/src/aws_sdk_signin/client.py @@ -1,58 +1,66 @@ # Code generated by smithy-python-codegen DO NOT EDIT. +from __future__ import annotations + from copy import deepcopy import logging from typing import Any, cast +from smithy_aws_core.aio.identity.chain import AsyncIdentityChain from smithy_aws_core.config import ConfigSource from smithy_aws_core.identity import AWSCredentialsIdentity -from smithy_aws_core.identity.chain import IdentityChain -from smithy_core.aio.client import AsyncClient, ClientCall, RequestPipeline +from smithy_core.aio.client import AsyncClient, AsyncClientCall, AsyncRequestPipeline from smithy_core.deserializers import DeserializeableShape from smithy_core.exceptions import ExpectationNotMetError from smithy_core.schemas import APIOperation from smithy_core.serializers import SerializeableShape -from smithy_http.aio.interfaces import HTTPClient +from smithy_http.aio.interfaces import AsyncHTTPClient from smithy_http.plugins import user_agent_plugin from .config import AsyncSigninConfig, Plugin from .models import ( CREATE_O_AUTH2_TOKEN, CREATE_O_AUTH2_TOKEN_WITH_IAM, - CreateOAuth2TokenInput, - CreateOAuth2TokenOutput, - CreateOAuth2TokenWithIAMInput, - CreateOAuth2TokenWithIAMOutput, DELETE_CONSOLE_AUTHORIZATION_CONFIGURATION, DELETE_RESOURCE_PERMISSION_STATEMENT, - DeleteConsoleAuthorizationConfigurationInput, - DeleteConsoleAuthorizationConfigurationOutput, - DeleteResourcePermissionStatementInput, - DeleteResourcePermissionStatementOutput, GET_CONSOLE_AUTHORIZATION_CONFIGURATION, GET_RESOURCE_POLICY, - GetConsoleAuthorizationConfigurationInput, - GetConsoleAuthorizationConfigurationOutput, - GetResourcePolicyInput, - GetResourcePolicyOutput, INTROSPECT_O_AUTH2_TOKEN_WITH_IAM, - IntrospectOAuth2TokenWithIAMInput, - IntrospectOAuth2TokenWithIAMOutput, LIST_RESOURCE_PERMISSION_STATEMENTS, - ListResourcePermissionStatementsInput, - ListResourcePermissionStatementsOutput, PUT_CONSOLE_AUTHORIZATION_CONFIGURATION, PUT_RESOURCE_PERMISSION_STATEMENT, - PutConsoleAuthorizationConfigurationInput, - PutConsoleAuthorizationConfigurationOutput, - PutResourcePermissionStatementInput, - PutResourcePermissionStatementOutput, REVOKE_O_AUTH2_TOKEN_WITH_IAM, - RevokeOAuth2TokenWithIAMInput, - RevokeOAuth2TokenWithIAMOutput, ) from .user_agent import aws_user_agent_plugin +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .models import ( + CreateOAuth2TokenInput, + CreateOAuth2TokenOutput, + CreateOAuth2TokenWithIAMInput, + CreateOAuth2TokenWithIAMOutput, + DeleteConsoleAuthorizationConfigurationInput, + DeleteConsoleAuthorizationConfigurationOutput, + DeleteResourcePermissionStatementInput, + DeleteResourcePermissionStatementOutput, + GetConsoleAuthorizationConfigurationInput, + GetConsoleAuthorizationConfigurationOutput, + GetResourcePolicyInput, + GetResourcePolicyOutput, + IntrospectOAuth2TokenWithIAMInput, + IntrospectOAuth2TokenWithIAMOutput, + ListResourcePermissionStatementsInput, + ListResourcePermissionStatementsOutput, + PutConsoleAuthorizationConfigurationInput, + PutConsoleAuthorizationConfigurationOutput, + PutResourcePermissionStatementInput, + PutResourcePermissionStatementOutput, + RevokeOAuth2TokenWithIAMInput, + RevokeOAuth2TokenWithIAMOutput, + ) + logger = logging.getLogger(__name__) @@ -122,12 +130,12 @@ async def _post_setup(self, config: AsyncSigninConfig) -> None: config_file = await config_context.parsed_profiles() if config_context.profile_source is ConfigSource.OVERRIDE: profile_name = config_context.profile_name - config.aws_credentials_identity_resolver = await IdentityChain.create( + config.aws_credentials_identity_resolver = await AsyncIdentityChain.create( AWSCredentialsIdentity, config_file=config_file, profile_name=profile_name, region_override=config.region, - http_client=cast(HTTPClient | None, config.transport), + http_client=cast(AsyncHTTPClient | None, config.transport), ) async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( @@ -136,7 +144,7 @@ async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( operation: APIOperation[I, O], default_plugins: list[Plugin], plugins: list[Plugin] | None, - ) -> tuple[RequestPipeline[Any, Any], ClientCall[I, O]]: + ) -> tuple[AsyncRequestPipeline[Any, Any], AsyncClientCall[I, O]]: if self._closed: raise RuntimeError( "Cannot invoke an operation on a client that has been closed." diff --git a/clients/aws-sdk-signin/src/aws_sdk_signin/config.py b/clients/aws-sdk-signin/src/aws_sdk_signin/config.py index b525c263..c8abe6ef 100644 --- a/clients/aws-sdk-signin/src/aws_sdk_signin/config.py +++ b/clients/aws-sdk-signin/src/aws_sdk_signin/config.py @@ -1,118 +1,134 @@ # Code generated by smithy-python-codegen DO NOT EDIT. from dataclasses import dataclass, field -from typing import Any, Callable, ClassVar, Self, TypeAlias, Union, Unpack +from typing import ( + Any, + Callable, + ClassVar, + Self, + TYPE_CHECKING, + TypeAlias, + Union, + Unpack, +) -from smithy_aws_core.aio.protocols import RestJsonClientProtocol -from smithy_aws_core.auth import SigV4AuthScheme -from smithy_aws_core.config import AwsConfigOverrides, FileSystem -from smithy_aws_core.config.aws_config import AsyncAwsConfig -from smithy_aws_core.config.resolvers import EndpointUriResolver -from smithy_aws_core.config.types import FieldSpec -from smithy_aws_core.endpoints.standard_regional import ( - StandardRegionalEndpointsResolver, +from smithy_aws_core.aio.auth.sigv4 import AsyncSigV4AuthScheme +from smithy_aws_core.aio.config import AsyncFileSystem +from smithy_aws_core.aio.config.aws_config import AsyncAwsConfig, AwsConfigOverrides +from smithy_aws_core.aio.config.resolvers import EndpointUriResolver +from smithy_aws_core.aio.endpoints.standard_regional import ( + AsyncStandardRegionalEndpointsResolver, ) +from smithy_aws_core.aio.protocols import AsyncRestJsonClientProtocol +from smithy_aws_core.config.types import FieldSpec from smithy_aws_core.identity import AWSCredentialsIdentity, AWSIdentityProperties -from smithy_core.aio.interfaces import ( - ClientProtocol, - EndpointResolver, - ProtocolConstructor, - ProtocolSettings, -) -from smithy_core.aio.interfaces.auth import AuthScheme -from smithy_core.aio.interfaces.identity import IdentityResolver -from smithy_core.interceptors import Interceptor +from smithy_core.aio.interfaces import AsyncClientProtocol, AsyncEndpointResolver +from smithy_core.aio.interfaces.auth import AsyncAuthScheme +from smithy_core.aio.interfaces.identity import AsyncIdentityResolver +from smithy_core.interfaces import ProtocolConstructor, ProtocolSettings from smithy_core.interfaces.auth import AuthSchemeResolver from smithy_core.shapes import ShapeID from smithy_http.aio.aiohttp import AIOHTTPClient +from ._private.schemas import SIGNIN from .auth import HTTPAuthSchemeResolver -from .models import ( - CreateOAuth2TokenInput, - CreateOAuth2TokenOutput, - CreateOAuth2TokenWithIAMInput, - CreateOAuth2TokenWithIAMOutput, - DeleteConsoleAuthorizationConfigurationInput, - DeleteConsoleAuthorizationConfigurationOutput, - DeleteResourcePermissionStatementInput, - DeleteResourcePermissionStatementOutput, - GetConsoleAuthorizationConfigurationInput, - GetConsoleAuthorizationConfigurationOutput, - GetResourcePolicyInput, - GetResourcePolicyOutput, - IntrospectOAuth2TokenWithIAMInput, - IntrospectOAuth2TokenWithIAMOutput, - ListResourcePermissionStatementsInput, - ListResourcePermissionStatementsOutput, - PutConsoleAuthorizationConfigurationInput, - PutConsoleAuthorizationConfigurationOutput, - PutResourcePermissionStatementInput, - PutResourcePermissionStatementOutput, - RevokeOAuth2TokenWithIAMInput, - RevokeOAuth2TokenWithIAMOutput, -) -_ServiceInterceptor = Union[ - Interceptor[CreateOAuth2TokenInput, CreateOAuth2TokenOutput, Any, Any], - Interceptor[ - CreateOAuth2TokenWithIAMInput, CreateOAuth2TokenWithIAMOutput, Any, Any - ], - Interceptor[ +if TYPE_CHECKING: + from smithy_core.interceptors import Interceptor + from .models import ( + CreateOAuth2TokenInput, + CreateOAuth2TokenOutput, + CreateOAuth2TokenWithIAMInput, + CreateOAuth2TokenWithIAMOutput, DeleteConsoleAuthorizationConfigurationInput, DeleteConsoleAuthorizationConfigurationOutput, - Any, - Any, - ], - Interceptor[ DeleteResourcePermissionStatementInput, DeleteResourcePermissionStatementOutput, - Any, - Any, - ], - Interceptor[ GetConsoleAuthorizationConfigurationInput, GetConsoleAuthorizationConfigurationOutput, - Any, - Any, - ], - Interceptor[GetResourcePolicyInput, GetResourcePolicyOutput, Any, Any], - Interceptor[ - IntrospectOAuth2TokenWithIAMInput, IntrospectOAuth2TokenWithIAMOutput, Any, Any - ], - Interceptor[ + GetResourcePolicyInput, + GetResourcePolicyOutput, + IntrospectOAuth2TokenWithIAMInput, + IntrospectOAuth2TokenWithIAMOutput, ListResourcePermissionStatementsInput, ListResourcePermissionStatementsOutput, - Any, - Any, - ], - Interceptor[ PutConsoleAuthorizationConfigurationInput, PutConsoleAuthorizationConfigurationOutput, - Any, - Any, - ], - Interceptor[ PutResourcePermissionStatementInput, PutResourcePermissionStatementOutput, - Any, - Any, - ], - Interceptor[ - RevokeOAuth2TokenWithIAMInput, RevokeOAuth2TokenWithIAMOutput, Any, Any - ], -] + RevokeOAuth2TokenWithIAMInput, + RevokeOAuth2TokenWithIAMOutput, + ) + + _ServiceInterceptor = Union[ + Interceptor[CreateOAuth2TokenInput, CreateOAuth2TokenOutput, Any, Any], + Interceptor[ + CreateOAuth2TokenWithIAMInput, CreateOAuth2TokenWithIAMOutput, Any, Any + ], + Interceptor[ + DeleteConsoleAuthorizationConfigurationInput, + DeleteConsoleAuthorizationConfigurationOutput, + Any, + Any, + ], + Interceptor[ + DeleteResourcePermissionStatementInput, + DeleteResourcePermissionStatementOutput, + Any, + Any, + ], + Interceptor[ + GetConsoleAuthorizationConfigurationInput, + GetConsoleAuthorizationConfigurationOutput, + Any, + Any, + ], + Interceptor[GetResourcePolicyInput, GetResourcePolicyOutput, Any, Any], + Interceptor[ + IntrospectOAuth2TokenWithIAMInput, + IntrospectOAuth2TokenWithIAMOutput, + Any, + Any, + ], + Interceptor[ + ListResourcePermissionStatementsInput, + ListResourcePermissionStatementsOutput, + Any, + Any, + ], + Interceptor[ + PutConsoleAuthorizationConfigurationInput, + PutConsoleAuthorizationConfigurationOutput, + Any, + Any, + ], + Interceptor[ + PutResourcePermissionStatementInput, + PutResourcePermissionStatementOutput, + Any, + Any, + ], + Interceptor[ + RevokeOAuth2TokenWithIAMInput, RevokeOAuth2TokenWithIAMOutput, Any, Any + ], + ] +else: + _ServiceInterceptor = Any + _PROTOCOL_SETTINGS = ProtocolSettings( - namespace="com.amazonaws.signin", service_target="Signin" + namespace="com.amazonaws.signin", service_target="Signin", service_schema=SIGNIN ) class _AsyncSigninConfigOverrides(AwsConfigOverrides, total=False): - endpoint_resolver: EndpointResolver | None + endpoint_resolver: AsyncEndpointResolver | None protocol: ( - ClientProtocol[Any, Any] | ProtocolConstructor[ClientProtocol[Any, Any]] | None + AsyncClientProtocol[Any, Any] + | ProtocolConstructor[AsyncClientProtocol[Any, Any]] + | None ) - auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None + auth_schemes: dict[ShapeID, AsyncAuthScheme[Any, Any, Any, Any]] | None auth_scheme_resolver: AuthSchemeResolver | None @@ -120,17 +136,17 @@ class _AsyncSigninConfigOverrides(AwsConfigOverrides, total=False): class AsyncSigninConfig(AsyncAwsConfig): """Signin configuration (async-resolved).""" - endpoint_resolver: EndpointResolver | None = None + endpoint_resolver: AsyncEndpointResolver | None = None """ The endpoint resolver used to resolve the final endpoint per-operation based on the configuration. """ - protocol: ClientProtocol[Any, Any] | None = None + protocol: AsyncClientProtocol[Any, Any] | None = None """ Pass a protocol class reference from smithy_aws_core.aio.protocols to - select the protocol, e.g. protocol=AwsJson10ClientProtocol. For custom - protocols a protocol instance may also be passed. + select the protocol, e.g. protocol=AsyncAwsJson10ClientProtocol. For + custom protocols a protocol instance may also be passed. """ interceptors: list[_ServiceInterceptor] = field(default_factory=lambda: []) @@ -139,7 +155,7 @@ class AsyncSigninConfig(AsyncAwsConfig): execution of a request. """ - auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None = None + auth_schemes: dict[ShapeID, AsyncAuthScheme[Any, Any, Any, Any]] | None = None """A map of auth scheme ids to auth schemes.""" auth_scheme_resolver: AuthSchemeResolver | None = None @@ -149,7 +165,7 @@ class AsyncSigninConfig(AsyncAwsConfig): """ aws_credentials_identity_resolver: ( - IdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None + AsyncIdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None ) = None """Resolves AWS Credentials. Required for operations that use Sigv4 Auth.""" @@ -188,24 +204,24 @@ class AsyncSigninConfig(AsyncAwsConfig): **AsyncAwsConfig._FIELDS, "endpoint_uri": FieldSpec(default=None, resolver=EndpointUriResolver("signin")), "endpoint_resolver": FieldSpec( - default_factory=lambda: StandardRegionalEndpointsResolver( + default_factory=lambda: AsyncStandardRegionalEndpointsResolver( endpoint_prefix="signin" ) ), "protocol": FieldSpec( - default_factory=lambda: RestJsonClientProtocol(_PROTOCOL_SETTINGS), + default_factory=lambda: AsyncRestJsonClientProtocol(_PROTOCOL_SETTINGS), converter=lambda p: p(_PROTOCOL_SETTINGS) if isinstance(p, type) else p, ), "auth_schemes": FieldSpec( default_factory=lambda: { - ShapeID("aws.auth#sigv4"): SigV4AuthScheme(service="signin") + ShapeID("aws.auth#sigv4"): AsyncSigV4AuthScheme(service="signin") } ), "auth_scheme_resolver": FieldSpec(default_factory=HTTPAuthSchemeResolver), "transport": FieldSpec(default_factory=lambda: AIOHTTPClient()), } - def set_auth_scheme(self, scheme: AuthScheme[Any, Any, Any, Any]) -> None: + def set_auth_scheme(self, scheme: AsyncAuthScheme[Any, Any, Any, Any]) -> None: """ Set an auth scheme implementation using its scheme ID. :param scheme: The auth scheme to add or replace. @@ -219,7 +235,7 @@ async def resolve( # pyright: ignore[reportIncompatibleMethodOverride] cls, *, profile: str | None = None, - fs: FileSystem | None = None, + fs: AsyncFileSystem | None = None, config_file_path: str | None = None, credentials_file_path: str | None = None, **overrides: Unpack[_AsyncSigninConfigOverrides], diff --git a/clients/aws-sdk-signin/src/aws_sdk_signin/models.py b/clients/aws-sdk-signin/src/aws_sdk_signin/models.py index ea8d99c5..2f2877d6 100644 --- a/clients/aws-sdk-signin/src/aws_sdk_signin/models.py +++ b/clients/aws-sdk-signin/src/aws_sdk_signin/models.py @@ -1,3224 +1,315 @@ # Code generated by smithy-python-codegen DO NOT EDIT. -from dataclasses import dataclass, field -from enum import StrEnum -import logging -from typing import Any, Literal, Self +from __future__ import annotations -from smithy_core.deserializers import ShapeDeserializer -from smithy_core.documents import TypeRegistry +from ._private import schemas as _schemas +from smithy_core._dynamic_models import ModelRegistry from smithy_core.exceptions import ModeledError -from smithy_core.response import EMPTY_RESPONSE_METADATA, ResponseMetadata -from smithy_core.schemas import APIOperation, Schema -from smithy_core.serializers import ShapeSerializer +from smithy_core.schemas import APIOperation from smithy_core.shapes import ShapeID -from smithy_core.types import UnknownEnumMixin from ._private.schemas import ( - ACCESS_DENIED_EXCEPTION as _SCHEMA_ACCESS_DENIED_EXCEPTION, - ACCESS_TOKEN as _SCHEMA_ACCESS_TOKEN, - CONFLICT_EXCEPTION as _SCHEMA_CONFLICT_EXCEPTION, CREATE_O_AUTH2_TOKEN as _SCHEMA_CREATE_O_AUTH2_TOKEN, - CREATE_O_AUTH2_TOKEN_INPUT as _SCHEMA_CREATE_O_AUTH2_TOKEN_INPUT, - CREATE_O_AUTH2_TOKEN_OUTPUT as _SCHEMA_CREATE_O_AUTH2_TOKEN_OUTPUT, - CREATE_O_AUTH2_TOKEN_REQUEST_BODY as _SCHEMA_CREATE_O_AUTH2_TOKEN_REQUEST_BODY, - CREATE_O_AUTH2_TOKEN_RESPONSE_BODY as _SCHEMA_CREATE_O_AUTH2_TOKEN_RESPONSE_BODY, CREATE_O_AUTH2_TOKEN_WITH_IAM as _SCHEMA_CREATE_O_AUTH2_TOKEN_WITH_IAM, - CREATE_O_AUTH2_TOKEN_WITH_IAM_INPUT as _SCHEMA_CREATE_O_AUTH2_TOKEN_WITH_IAM_INPUT, - CREATE_O_AUTH2_TOKEN_WITH_IAM_OUTPUT as _SCHEMA_CREATE_O_AUTH2_TOKEN_WITH_IAM_OUTPUT, DELETE_CONSOLE_AUTHORIZATION_CONFIGURATION as _SCHEMA_DELETE_CONSOLE_AUTHORIZATION_CONFIGURATION, - DELETE_CONSOLE_AUTHORIZATION_CONFIGURATION_INPUT as _SCHEMA_DELETE_CONSOLE_AUTHORIZATION_CONFIGURATION_INPUT, - DELETE_CONSOLE_AUTHORIZATION_CONFIGURATION_OUTPUT as _SCHEMA_DELETE_CONSOLE_AUTHORIZATION_CONFIGURATION_OUTPUT, DELETE_RESOURCE_PERMISSION_STATEMENT as _SCHEMA_DELETE_RESOURCE_PERMISSION_STATEMENT, - DELETE_RESOURCE_PERMISSION_STATEMENT_INPUT as _SCHEMA_DELETE_RESOURCE_PERMISSION_STATEMENT_INPUT, - DELETE_RESOURCE_PERMISSION_STATEMENT_OUTPUT as _SCHEMA_DELETE_RESOURCE_PERMISSION_STATEMENT_OUTPUT, GET_CONSOLE_AUTHORIZATION_CONFIGURATION as _SCHEMA_GET_CONSOLE_AUTHORIZATION_CONFIGURATION, - GET_CONSOLE_AUTHORIZATION_CONFIGURATION_INPUT as _SCHEMA_GET_CONSOLE_AUTHORIZATION_CONFIGURATION_INPUT, - GET_CONSOLE_AUTHORIZATION_CONFIGURATION_OUTPUT as _SCHEMA_GET_CONSOLE_AUTHORIZATION_CONFIGURATION_OUTPUT, GET_RESOURCE_POLICY as _SCHEMA_GET_RESOURCE_POLICY, - GET_RESOURCE_POLICY_INPUT as _SCHEMA_GET_RESOURCE_POLICY_INPUT, - GET_RESOURCE_POLICY_OUTPUT as _SCHEMA_GET_RESOURCE_POLICY_OUTPUT, - INTERNAL_SERVER_EXCEPTION as _SCHEMA_INTERNAL_SERVER_EXCEPTION, INTROSPECT_O_AUTH2_TOKEN_WITH_IAM as _SCHEMA_INTROSPECT_O_AUTH2_TOKEN_WITH_IAM, - INTROSPECT_O_AUTH2_TOKEN_WITH_IAM_INPUT as _SCHEMA_INTROSPECT_O_AUTH2_TOKEN_WITH_IAM_INPUT, - INTROSPECT_O_AUTH2_TOKEN_WITH_IAM_OUTPUT as _SCHEMA_INTROSPECT_O_AUTH2_TOKEN_WITH_IAM_OUTPUT, LIST_RESOURCE_PERMISSION_STATEMENTS as _SCHEMA_LIST_RESOURCE_PERMISSION_STATEMENTS, - LIST_RESOURCE_PERMISSION_STATEMENTS_INPUT as _SCHEMA_LIST_RESOURCE_PERMISSION_STATEMENTS_INPUT, - LIST_RESOURCE_PERMISSION_STATEMENTS_OUTPUT as _SCHEMA_LIST_RESOURCE_PERMISSION_STATEMENTS_OUTPUT, - PERMISSION_STATEMENT_SUMMARY as _SCHEMA_PERMISSION_STATEMENT_SUMMARY, - POLICY_STATEMENT as _SCHEMA_POLICY_STATEMENT, PUT_CONSOLE_AUTHORIZATION_CONFIGURATION as _SCHEMA_PUT_CONSOLE_AUTHORIZATION_CONFIGURATION, - PUT_CONSOLE_AUTHORIZATION_CONFIGURATION_INPUT as _SCHEMA_PUT_CONSOLE_AUTHORIZATION_CONFIGURATION_INPUT, - PUT_CONSOLE_AUTHORIZATION_CONFIGURATION_OUTPUT as _SCHEMA_PUT_CONSOLE_AUTHORIZATION_CONFIGURATION_OUTPUT, PUT_RESOURCE_PERMISSION_STATEMENT as _SCHEMA_PUT_RESOURCE_PERMISSION_STATEMENT, - PUT_RESOURCE_PERMISSION_STATEMENT_INPUT as _SCHEMA_PUT_RESOURCE_PERMISSION_STATEMENT_INPUT, - PUT_RESOURCE_PERMISSION_STATEMENT_OUTPUT as _SCHEMA_PUT_RESOURCE_PERMISSION_STATEMENT_OUTPUT, - RESOURCE_NOT_FOUND_EXCEPTION as _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, REVOKE_O_AUTH2_TOKEN_WITH_IAM as _SCHEMA_REVOKE_O_AUTH2_TOKEN_WITH_IAM, - REVOKE_O_AUTH2_TOKEN_WITH_IAM_INPUT as _SCHEMA_REVOKE_O_AUTH2_TOKEN_WITH_IAM_INPUT, - REVOKE_O_AUTH2_TOKEN_WITH_IAM_OUTPUT as _SCHEMA_REVOKE_O_AUTH2_TOKEN_WITH_IAM_OUTPUT, - SERVICE_QUOTA_EXCEEDED_EXCEPTION as _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - SIGNIN_RESOURCE_BASED_POLICY as _SCHEMA_SIGNIN_RESOURCE_BASED_POLICY, - TOO_MANY_REQUESTS_ERROR as _SCHEMA_TOO_MANY_REQUESTS_ERROR, - VALIDATION_EXCEPTION as _SCHEMA_VALIDATION_EXCEPTION, ) +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .models import ( + CreateOAuth2TokenInput, + CreateOAuth2TokenOutput, + CreateOAuth2TokenWithIAMInput, + CreateOAuth2TokenWithIAMOutput, + DeleteConsoleAuthorizationConfigurationInput, + DeleteConsoleAuthorizationConfigurationOutput, + DeleteResourcePermissionStatementInput, + DeleteResourcePermissionStatementOutput, + GetConsoleAuthorizationConfigurationInput, + GetConsoleAuthorizationConfigurationOutput, + GetResourcePolicyInput, + GetResourcePolicyOutput, + IntrospectOAuth2TokenWithIAMInput, + IntrospectOAuth2TokenWithIAMOutput, + ListResourcePermissionStatementsInput, + ListResourcePermissionStatementsOutput, + PutConsoleAuthorizationConfigurationInput, + PutConsoleAuthorizationConfigurationOutput, + PutResourcePermissionStatementInput, + PutResourcePermissionStatementOutput, + RevokeOAuth2TokenWithIAMInput, + RevokeOAuth2TokenWithIAMOutput, + ) -logger = logging.getLogger(__name__) - - -class ServiceError(ModeledError): - """ - Base error for all errors in the service. - - Some exceptions do not extend from this class, including - synthetic, implicit, and shared exception types. - """ - - -class OAuth2ErrorCode(UnknownEnumMixin, StrEnum): - """ - OAuth 2.0 error codes returned by the server Standard OAuth 2.0 error - codes used in error responses to indicate the specific type of error - that occurred during token operations. - """ - - TOKEN_EXPIRED = "TOKEN_EXPIRED" - """Token has expired and needs to be refreshed""" - USER_CREDENTIALS_CHANGED = "USER_CREDENTIALS_CHANGED" - """User credentials have been changed""" - INSUFFICIENT_PERMISSIONS = "INSUFFICIENT_PERMISSIONS" - """Insufficient permissions to perform this operation""" - AUTHCODE_EXPIRED = "AUTHCODE_EXPIRED" - """Authorization code has expired""" - SERVER_ERROR = "server_error" - """Internal server error occurred""" - INVALID_REQUEST = "INVALID_REQUEST" - """ - The request is missing a required parameter, includes an invalid - parameter value, or is otherwise malformed - """ - RESOURCE_NOT_FOUND = "RESOURCE_NOT_FOUND" - """Requested resource was not found""" - CONFLICT = "CONFLICT" - """Request conflicts with current state of the resource""" - SERVICE_QUOTA_EXCEEDED = "SERVICE_QUOTA_EXCEEDED" - """Request would cause a service quota to be exceeded""" - - -@dataclass(kw_only=True) -class AccessDeniedException(ServiceError): - """ - Error thrown for access denied scenarios with flexible HTTP status - mapping Runtime HTTP Status Code Mapping: - HTTP 401 (Unauthorized): - TOKEN_EXPIRED, AUTHCODE_EXPIRED - HTTP 403 (Forbidden): - USER_CREDENTIALS_CHANGED, INSUFFICIENT_PERMISSIONS The specific HTTP - status code is determined at runtime based on the error enum value. - Consumers should use the error field to determine the specific access - denial reason. - """ - - fault: Literal["client", "server"] | None = "client" - - error: str - """ - OAuth 2.0 error code indicating the specific type of access denial Can - be TOKEN_EXPIRED, AUTHCODE_EXPIRED, USER_CREDENTIALS_CHANGED, or - INSUFFICIENT_PERMISSIONS - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACCESS_DENIED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_ACCESS_DENIED_EXCEPTION.members["error"], self.error - ) - serializer.write_string( - _SCHEMA_ACCESS_DENIED_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["error"] = OAuth2ErrorCode( - de.read_string(_SCHEMA_ACCESS_DENIED_EXCEPTION.members["error"]) - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_ACCESS_DENIED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ACCESS_DENIED_EXCEPTION, consumer=_consumer) - if "error" not in kwargs: - kwargs["error"] = OAuth2ErrorCode._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class AccessToken: - """ - AWS credentials structure containing temporary access credentials - Scoped, temporary AWS credentials with a 15-minute duration. - """ - - access_key_id: str - """AWS access key ID for temporary credentials""" - - secret_access_key: str - """AWS secret access key for temporary credentials""" - - session_token: str - """AWS session token for temporary credentials""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ACCESS_TOKEN, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_ACCESS_TOKEN.members["accessKeyId"], self.access_key_id - ) - serializer.write_string( - _SCHEMA_ACCESS_TOKEN.members["secretAccessKey"], self.secret_access_key - ) - serializer.write_string( - _SCHEMA_ACCESS_TOKEN.members["sessionToken"], self.session_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["access_key_id"] = de.read_string( - _SCHEMA_ACCESS_TOKEN.members["accessKeyId"] - ) - - case 1: - kwargs["secret_access_key"] = de.read_string( - _SCHEMA_ACCESS_TOKEN.members["secretAccessKey"] - ) - - case 2: - kwargs["session_token"] = de.read_string( - _SCHEMA_ACCESS_TOKEN.members["sessionToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ACCESS_TOKEN, consumer=_consumer) - if "access_key_id" not in kwargs: - kwargs["access_key_id"] = "" - if "secret_access_key" not in kwargs: - kwargs["secret_access_key"] = "" - if "session_token" not in kwargs: - kwargs["session_token"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(access_key_id="", secret_access_key="", session_token="") - - -def _serialize_condition_values( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_condition_values( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_condition( - serializer: ShapeSerializer, schema: Schema, value: dict[str, list[str]] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: _serialize_condition_values(vs, value_schema, v)) - - -def _deserialize_condition( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, list[str]]: - result: dict[str, list[str]] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = _deserialize_condition_values(d, value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -def _serialize_condition_block( - serializer: ShapeSerializer, schema: Schema, value: dict[str, dict[str, list[str]]] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: _serialize_condition(vs, value_schema, v)) - - -def _deserialize_condition_block( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, dict[str, list[str]]]: - result: dict[str, dict[str, list[str]]] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = _deserialize_condition(d, value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ConflictException(ServiceError): - """ - Error thrown when request conflicts with current state HTTP Status Code: - 409 Conflict Used when the request conflicts with the current state of - the resource - """ - - fault: Literal["client", "server"] | None = "client" - - error: str - """OAuth 2.0 error code indicating conflict Will be CONFLICT""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONFLICT_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_CONFLICT_EXCEPTION.members["error"], self.error) - serializer.write_string( - _SCHEMA_CONFLICT_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["error"] = OAuth2ErrorCode( - de.read_string(_SCHEMA_CONFLICT_EXCEPTION.members["error"]) - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_CONFLICT_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONFLICT_EXCEPTION, consumer=_consumer) - if "error" not in kwargs: - kwargs["error"] = OAuth2ErrorCode._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class CreateOAuth2TokenRequestBody: - """ - Request body payload for CreateOAuth2Token operation The operation type - is determined by the grant_type parameter: - - grant_type=authorization_code: Requires code, redirect_uri, - code_verifier - grant_type=refresh_token: Requires refresh_token - """ - - client_id: str - """ - The client identifier (ARN) used during Sign-In onboarding Required for - both authorization code and refresh token flows - """ - - grant_type: str - """ - OAuth 2.0 grant type - determines which flow is used Must be - \"authorization_code\" or \"refresh_token\" - """ - - code: str | None = None - """ - The authorization code received from /v1/authorize Required only when - grant_type=authorization_code - """ - - redirect_uri: str | None = None - """ - The redirect URI that must match the original authorization request - Required only when grant_type=authorization_code - """ - - code_verifier: str | None = None - """ - PKCE code verifier to prove possession of the original code challenge - Required only when grant_type=authorization_code - """ - - refresh_token: str | None = field(repr=False, default=None) - """ - The refresh token returned from auth_code redemption Required only when - grant_type=refresh_token - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_O_AUTH2_TOKEN_REQUEST_BODY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_O_AUTH2_TOKEN_REQUEST_BODY.members["clientId"], - self.client_id, - ) - serializer.write_string( - _SCHEMA_CREATE_O_AUTH2_TOKEN_REQUEST_BODY.members["grantType"], - self.grant_type, - ) - if self.code is not None: - serializer.write_string( - _SCHEMA_CREATE_O_AUTH2_TOKEN_REQUEST_BODY.members["code"], self.code - ) - - if self.redirect_uri is not None: - serializer.write_string( - _SCHEMA_CREATE_O_AUTH2_TOKEN_REQUEST_BODY.members["redirectUri"], - self.redirect_uri, - ) - - if self.code_verifier is not None: - serializer.write_string( - _SCHEMA_CREATE_O_AUTH2_TOKEN_REQUEST_BODY.members["codeVerifier"], - self.code_verifier, - ) - - if self.refresh_token is not None: - serializer.write_string( - _SCHEMA_CREATE_O_AUTH2_TOKEN_REQUEST_BODY.members["refreshToken"], - self.refresh_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["client_id"] = de.read_string( - _SCHEMA_CREATE_O_AUTH2_TOKEN_REQUEST_BODY.members["clientId"] - ) - - case 1: - kwargs["grant_type"] = de.read_string( - _SCHEMA_CREATE_O_AUTH2_TOKEN_REQUEST_BODY.members["grantType"] - ) - - case 2: - kwargs["code"] = de.read_string( - _SCHEMA_CREATE_O_AUTH2_TOKEN_REQUEST_BODY.members["code"] - ) - - case 3: - kwargs["redirect_uri"] = de.read_string( - _SCHEMA_CREATE_O_AUTH2_TOKEN_REQUEST_BODY.members["redirectUri"] - ) - - case 4: - kwargs["code_verifier"] = de.read_string( - _SCHEMA_CREATE_O_AUTH2_TOKEN_REQUEST_BODY.members[ - "codeVerifier" - ] - ) - - case 5: - kwargs["refresh_token"] = de.read_string( - _SCHEMA_CREATE_O_AUTH2_TOKEN_REQUEST_BODY.members[ - "refreshToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_O_AUTH2_TOKEN_REQUEST_BODY, consumer=_consumer - ) - if "client_id" not in kwargs: - kwargs["client_id"] = "" - if "grant_type" not in kwargs: - kwargs["grant_type"] = "" - return kwargs - - -@dataclass(kw_only=True) -class CreateOAuth2TokenInput: - """ - Input structure for CreateOAuth2Token operation Contains flattened token - operation inputs for both authorization code and refresh token flows. - The operation type is determined by the grant_type parameter in the - request body. - """ - - token_input: CreateOAuth2TokenRequestBody | None = None - """ - Flattened token operation inputs The specific operation is determined by - grant_type in the request body - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_O_AUTH2_TOKEN_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.token_input is not None: - serializer.write_struct( - _SCHEMA_CREATE_O_AUTH2_TOKEN_INPUT.members["tokenInput"], - self.token_input, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["token_input"] = CreateOAuth2TokenRequestBody.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_O_AUTH2_TOKEN_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CreateOAuth2TokenResponseBody: - """ - Response body payload for CreateOAuth2Token operation The response - content depends on the grant_type from the request: - - grant_type=authorization_code: Returns all fields including - refresh_token and id_token - grant_type=refresh_token: Returns - access_token, token_type, expires_in, refresh_token (no id_token) - """ - - access_token: AccessToken = field(repr=False) - """ - Scoped-down AWS credentials (15 minute duration) Present for both - authorization code redemption and token refresh - """ - - token_type: str - """ - Token type indicating this is AWS SigV4 credentials Value is - \"aws_sigv4\" for both flows - """ - - expires_in: int - """ - Time to expiry in seconds (maximum 900) Present for both authorization - code redemption and token refresh - """ - - refresh_token: str = field(repr=False) - """ - Encrypted refresh token with cnf.jkt (SHA-256 thumbprint of presented - jwk) Always present in responses (required for both flows) - """ - - id_token: str | None = None - """ - ID token containing user identity information Present only in - authorization code redemption response (grant_type=authorization_code) - Not included in token refresh responses - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_O_AUTH2_TOKEN_RESPONSE_BODY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CREATE_O_AUTH2_TOKEN_RESPONSE_BODY.members["accessToken"], - self.access_token, - ) - serializer.write_string( - _SCHEMA_CREATE_O_AUTH2_TOKEN_RESPONSE_BODY.members["tokenType"], - self.token_type, - ) - serializer.write_integer( - _SCHEMA_CREATE_O_AUTH2_TOKEN_RESPONSE_BODY.members["expiresIn"], - self.expires_in, - ) - serializer.write_string( - _SCHEMA_CREATE_O_AUTH2_TOKEN_RESPONSE_BODY.members["refreshToken"], - self.refresh_token, - ) - if self.id_token is not None: - serializer.write_string( - _SCHEMA_CREATE_O_AUTH2_TOKEN_RESPONSE_BODY.members["idToken"], - self.id_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["access_token"] = AccessToken.deserialize(de) - - case 1: - kwargs["token_type"] = de.read_string( - _SCHEMA_CREATE_O_AUTH2_TOKEN_RESPONSE_BODY.members["tokenType"] - ) - - case 2: - kwargs["expires_in"] = de.read_integer( - _SCHEMA_CREATE_O_AUTH2_TOKEN_RESPONSE_BODY.members["expiresIn"] - ) - - case 3: - kwargs["refresh_token"] = de.read_string( - _SCHEMA_CREATE_O_AUTH2_TOKEN_RESPONSE_BODY.members[ - "refreshToken" - ] - ) - - case 4: - kwargs["id_token"] = de.read_string( - _SCHEMA_CREATE_O_AUTH2_TOKEN_RESPONSE_BODY.members["idToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_O_AUTH2_TOKEN_RESPONSE_BODY, consumer=_consumer - ) - if "access_token" not in kwargs: - kwargs["access_token"] = AccessToken._smithy_default() - if "token_type" not in kwargs: - kwargs["token_type"] = "" - if "expires_in" not in kwargs: - kwargs["expires_in"] = 0 - if "refresh_token" not in kwargs: - kwargs["refresh_token"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls( - access_token=AccessToken._smithy_default(), - token_type="", - expires_in=0, - refresh_token="", - ) - - -@dataclass(kw_only=True) -class CreateOAuth2TokenOutput: - """ - Output structure for CreateOAuth2Token operation Contains flattened - token operation outputs for both authorization code and refresh token - flows. The response content depends on the grant_type from the original - request. - """ - - token_output: CreateOAuth2TokenResponseBody - """ - Flattened token operation outputs The specific response fields depend on - the grant_type used in the request - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_O_AUTH2_TOKEN_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CREATE_O_AUTH2_TOKEN_OUTPUT.members["tokenOutput"], - self.token_output, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["token_output"] = CreateOAuth2TokenResponseBody.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_O_AUTH2_TOKEN_OUTPUT, consumer=_consumer - ) - if "token_output" not in kwargs: - kwargs["token_output"] = CreateOAuth2TokenResponseBody._smithy_default() - return kwargs - - -@dataclass(kw_only=True) -class InternalServerException(ServiceError): - """ - Error thrown when an internal server error occurs HTTP Status Code: 500 - Internal Server Error Used for unexpected server-side errors that - prevent request processing. - """ - - fault: Literal["client", "server"] | None = "server" - - error: str - """ - OAuth 2.0 error code indicating server error Will be SERVER_ERROR for - internal server errors - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INTERNAL_SERVER_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_INTERNAL_SERVER_EXCEPTION.members["error"], self.error - ) - serializer.write_string( - _SCHEMA_INTERNAL_SERVER_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["error"] = OAuth2ErrorCode( - de.read_string( - _SCHEMA_INTERNAL_SERVER_EXCEPTION.members["error"] - ) - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_INTERNAL_SERVER_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INTERNAL_SERVER_EXCEPTION, consumer=_consumer) - if "error" not in kwargs: - kwargs["error"] = OAuth2ErrorCode._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class TooManyRequestsError(ServiceError): - """ - Error thrown when rate limit is exceeded HTTP Status Code: 429 Too Many - Requests Possible OAuth2ErrorCode values: - INVALID_REQUEST: Rate - limiting, too many requests, abuse prevention Possible causes: - Too - many token requests from the same client - Rate limiting based on - client_id or IP address - Abuse prevention mechanisms triggered - - Service protection against excessive token generation - """ - - fault: Literal["client", "server"] | None = "client" - - error: str - """ - OAuth 2.0 error code indicating the specific type of error Will be - INVALID_REQUEST for rate limiting scenarios - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOO_MANY_REQUESTS_ERROR, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_TOO_MANY_REQUESTS_ERROR.members["error"], self.error - ) - serializer.write_string( - _SCHEMA_TOO_MANY_REQUESTS_ERROR.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["error"] = OAuth2ErrorCode( - de.read_string(_SCHEMA_TOO_MANY_REQUESTS_ERROR.members["error"]) - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_TOO_MANY_REQUESTS_ERROR.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TOO_MANY_REQUESTS_ERROR, consumer=_consumer) - if "error" not in kwargs: - kwargs["error"] = OAuth2ErrorCode._corrected("") - return kwargs - - -@dataclass(kw_only=True) -class ValidationException(ServiceError): - """ - Error thrown when request validation fails HTTP Status Code: 400 Bad - Request Used for request validation errors such as malformed parameters, - missing required fields, or invalid parameter values. - """ - - fault: Literal["client", "server"] | None = "client" - - error: str - """ - OAuth 2.0 error code indicating validation failure Will be - INVALID_REQUEST for validation errors - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VALIDATION_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_VALIDATION_EXCEPTION.members["error"], self.error - ) - serializer.write_string( - _SCHEMA_VALIDATION_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["error"] = OAuth2ErrorCode( - de.read_string(_SCHEMA_VALIDATION_EXCEPTION.members["error"]) - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_VALIDATION_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VALIDATION_EXCEPTION, consumer=_consumer) - if "error" not in kwargs: - kwargs["error"] = OAuth2ErrorCode._corrected("") - return kwargs - - -CREATE_O_AUTH2_TOKEN = APIOperation( - input=CreateOAuth2TokenInput, - output=CreateOAuth2TokenOutput, - schema=_SCHEMA_CREATE_O_AUTH2_TOKEN, - input_schema=_SCHEMA_CREATE_O_AUTH2_TOKEN_INPUT, - output_schema=_SCHEMA_CREATE_O_AUTH2_TOKEN_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.signin#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.signin#InternalServerException" - ): InternalServerException, - ShapeID("com.amazonaws.signin#TooManyRequestsError"): TooManyRequestsError, - ShapeID("com.amazonaws.signin#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("smithy.api#noAuth")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_ERROR, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class CreateOAuth2TokenWithIAMInput: - """Input structure for CreateOAuth2TokenWithIAM operation""" - - grant_type: str | None = None - """OAuth 2.0 grant type. Must be \"client_credentials\".""" - - resource: str | None = None - """ - The OAuth resource for which the access token is requested. Example: - \"aws-mcp.amazonaws.com\". - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_O_AUTH2_TOKEN_WITH_IAM_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.grant_type is not None: - serializer.write_string( - _SCHEMA_CREATE_O_AUTH2_TOKEN_WITH_IAM_INPUT.members["grantType"], - self.grant_type, - ) - - if self.resource is not None: - serializer.write_string( - _SCHEMA_CREATE_O_AUTH2_TOKEN_WITH_IAM_INPUT.members["resource"], - self.resource, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["grant_type"] = de.read_string( - _SCHEMA_CREATE_O_AUTH2_TOKEN_WITH_IAM_INPUT.members["grantType"] - ) - - case 1: - kwargs["resource"] = de.read_string( - _SCHEMA_CREATE_O_AUTH2_TOKEN_WITH_IAM_INPUT.members["resource"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_O_AUTH2_TOKEN_WITH_IAM_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CreateOAuth2TokenWithIAMOutput: - """ - Output structure for CreateOAuth2TokenWithIAM operation Contains the JWT - access token, token type, and expiration per RFC 6749 §5.1. - """ - - access_token: str = field(repr=False) - """ - JWT access token containing principal identity, resource scope, and - session metadata - """ - - token_type: str - """Always \"Bearer\" per OAuth 2.1 specification""" - - expires_in: int - """ - Token lifetime in seconds. Value is the minimum of session validity and - 1 hour. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_O_AUTH2_TOKEN_WITH_IAM_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREATE_O_AUTH2_TOKEN_WITH_IAM_OUTPUT.members["accessToken"], - self.access_token, - ) - serializer.write_string( - _SCHEMA_CREATE_O_AUTH2_TOKEN_WITH_IAM_OUTPUT.members["tokenType"], - self.token_type, - ) - serializer.write_integer( - _SCHEMA_CREATE_O_AUTH2_TOKEN_WITH_IAM_OUTPUT.members["expiresIn"], - self.expires_in, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["access_token"] = de.read_string( - _SCHEMA_CREATE_O_AUTH2_TOKEN_WITH_IAM_OUTPUT.members[ - "accessToken" - ] - ) - - case 1: - kwargs["token_type"] = de.read_string( - _SCHEMA_CREATE_O_AUTH2_TOKEN_WITH_IAM_OUTPUT.members[ - "tokenType" - ] - ) - - case 2: - kwargs["expires_in"] = de.read_integer( - _SCHEMA_CREATE_O_AUTH2_TOKEN_WITH_IAM_OUTPUT.members[ - "expiresIn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_O_AUTH2_TOKEN_WITH_IAM_OUTPUT, consumer=_consumer - ) - if "access_token" not in kwargs: - kwargs["access_token"] = "" - if "token_type" not in kwargs: - kwargs["token_type"] = "" - if "expires_in" not in kwargs: - kwargs["expires_in"] = 0 - return kwargs - - -CREATE_O_AUTH2_TOKEN_WITH_IAM = APIOperation( - input=CreateOAuth2TokenWithIAMInput, - output=CreateOAuth2TokenWithIAMOutput, - schema=_SCHEMA_CREATE_O_AUTH2_TOKEN_WITH_IAM, - input_schema=_SCHEMA_CREATE_O_AUTH2_TOKEN_WITH_IAM_INPUT, - output_schema=_SCHEMA_CREATE_O_AUTH2_TOKEN_WITH_IAM_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.signin#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.signin#InternalServerException" - ): InternalServerException, - ShapeID("com.amazonaws.signin#TooManyRequestsError"): TooManyRequestsError, - ShapeID("com.amazonaws.signin#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_ERROR, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteConsoleAuthorizationConfigurationInput: - """Input for DeleteConsoleAuthorizationConfiguration operation""" - - target_id: str | None = None - """Target account identifier""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DELETE_CONSOLE_AUTHORIZATION_CONFIGURATION_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.target_id is not None: - serializer.write_string( - _SCHEMA_DELETE_CONSOLE_AUTHORIZATION_CONFIGURATION_INPUT.members[ - "targetId" - ], - self.target_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["target_id"] = de.read_string( - _SCHEMA_DELETE_CONSOLE_AUTHORIZATION_CONFIGURATION_INPUT.members[ - "targetId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_CONSOLE_AUTHORIZATION_CONFIGURATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteConsoleAuthorizationConfigurationOutput: - """Output for DeleteConsoleAuthorizationConfiguration operation""" - - target_id: str - """Target account identifier""" - - scope: str - """Authorization scope""" - - console_authorization_enabled: bool - """Whether console authorization is enabled""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DELETE_CONSOLE_AUTHORIZATION_CONFIGURATION_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DELETE_CONSOLE_AUTHORIZATION_CONFIGURATION_OUTPUT.members[ - "targetId" - ], - self.target_id, - ) - serializer.write_string( - _SCHEMA_DELETE_CONSOLE_AUTHORIZATION_CONFIGURATION_OUTPUT.members["scope"], - self.scope, - ) - serializer.write_boolean( - _SCHEMA_DELETE_CONSOLE_AUTHORIZATION_CONFIGURATION_OUTPUT.members[ - "consoleAuthorizationEnabled" - ], - self.console_authorization_enabled, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["target_id"] = de.read_string( - _SCHEMA_DELETE_CONSOLE_AUTHORIZATION_CONFIGURATION_OUTPUT.members[ - "targetId" - ] - ) - - case 1: - kwargs["scope"] = de.read_string( - _SCHEMA_DELETE_CONSOLE_AUTHORIZATION_CONFIGURATION_OUTPUT.members[ - "scope" - ] - ) - - case 2: - kwargs["console_authorization_enabled"] = de.read_boolean( - _SCHEMA_DELETE_CONSOLE_AUTHORIZATION_CONFIGURATION_OUTPUT.members[ - "consoleAuthorizationEnabled" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_CONSOLE_AUTHORIZATION_CONFIGURATION_OUTPUT, - consumer=_consumer, - ) - if "target_id" not in kwargs: - kwargs["target_id"] = "" - if "scope" not in kwargs: - kwargs["scope"] = "" - if "console_authorization_enabled" not in kwargs: - kwargs["console_authorization_enabled"] = False - return kwargs - - -@dataclass(kw_only=True) -class ResourceNotFoundException(ServiceError): - """ - Error thrown when requested resource is not found HTTP Status Code: 404 - Not Found Used when the specified resource does not exist - """ - - fault: Literal["client", "server"] | None = "client" - - error: str - """ - OAuth 2.0 error code indicating resource not found Will be - RESOURCE_NOT_FOUND - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["error"], self.error - ) - serializer.write_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["error"] = OAuth2ErrorCode( - de.read_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["error"] - ) - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, consumer=_consumer - ) - if "error" not in kwargs: - kwargs["error"] = OAuth2ErrorCode._corrected("") - return kwargs - - -DELETE_CONSOLE_AUTHORIZATION_CONFIGURATION = APIOperation( - input=DeleteConsoleAuthorizationConfigurationInput, - output=DeleteConsoleAuthorizationConfigurationOutput, - schema=_SCHEMA_DELETE_CONSOLE_AUTHORIZATION_CONFIGURATION, - input_schema=_SCHEMA_DELETE_CONSOLE_AUTHORIZATION_CONFIGURATION_INPUT, - output_schema=_SCHEMA_DELETE_CONSOLE_AUTHORIZATION_CONFIGURATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.signin#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.signin#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.signin#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.signin#TooManyRequestsError"): TooManyRequestsError, - ShapeID("com.amazonaws.signin#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_ERROR, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteResourcePermissionStatementInput: - """Input for DeleteResourcePermissionStatement operation""" - - statement_id: str | None = None - """Unique identifier of the permission statement to delete""" - - client_token: str | None = None - """Idempotency token for the request""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DELETE_RESOURCE_PERMISSION_STATEMENT_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.statement_id is not None: - serializer.write_string( - _SCHEMA_DELETE_RESOURCE_PERMISSION_STATEMENT_INPUT.members[ - "statementId" - ], - self.statement_id, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_DELETE_RESOURCE_PERMISSION_STATEMENT_INPUT.members[ - "clientToken" - ], - self.client_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["statement_id"] = de.read_string( - _SCHEMA_DELETE_RESOURCE_PERMISSION_STATEMENT_INPUT.members[ - "statementId" - ] - ) - - case 1: - kwargs["client_token"] = de.read_string( - _SCHEMA_DELETE_RESOURCE_PERMISSION_STATEMENT_INPUT.members[ - "clientToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_RESOURCE_PERMISSION_STATEMENT_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteResourcePermissionStatementOutput: - """Output for DeleteResourcePermissionStatement operation""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_DELETE_RESOURCE_PERMISSION_STATEMENT_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_RESOURCE_PERMISSION_STATEMENT_OUTPUT, consumer=_consumer - ) - return kwargs - - -DELETE_RESOURCE_PERMISSION_STATEMENT = APIOperation( - input=DeleteResourcePermissionStatementInput, - output=DeleteResourcePermissionStatementOutput, - schema=_SCHEMA_DELETE_RESOURCE_PERMISSION_STATEMENT, - input_schema=_SCHEMA_DELETE_RESOURCE_PERMISSION_STATEMENT_INPUT, - output_schema=_SCHEMA_DELETE_RESOURCE_PERMISSION_STATEMENT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.signin#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.signin#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.signin#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.signin#TooManyRequestsError"): TooManyRequestsError, - ShapeID("com.amazonaws.signin#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_ERROR, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetConsoleAuthorizationConfigurationInput: - """Input for GetConsoleAuthorizationConfiguration operation""" - - target_id: str | None = None - """Target account identifier""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_CONSOLE_AUTHORIZATION_CONFIGURATION_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.target_id is not None: - serializer.write_string( - _SCHEMA_GET_CONSOLE_AUTHORIZATION_CONFIGURATION_INPUT.members[ - "targetId" - ], - self.target_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["target_id"] = de.read_string( - _SCHEMA_GET_CONSOLE_AUTHORIZATION_CONFIGURATION_INPUT.members[ - "targetId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_CONSOLE_AUTHORIZATION_CONFIGURATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetConsoleAuthorizationConfigurationOutput: - """Output for GetConsoleAuthorizationConfiguration operation""" - - target_id: str - """Target account identifier""" - - scope: str - """Authorization scope""" - - console_authorization_enabled: bool - """Whether console authorization is enabled""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_CONSOLE_AUTHORIZATION_CONFIGURATION_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_GET_CONSOLE_AUTHORIZATION_CONFIGURATION_OUTPUT.members["targetId"], - self.target_id, - ) - serializer.write_string( - _SCHEMA_GET_CONSOLE_AUTHORIZATION_CONFIGURATION_OUTPUT.members["scope"], - self.scope, - ) - serializer.write_boolean( - _SCHEMA_GET_CONSOLE_AUTHORIZATION_CONFIGURATION_OUTPUT.members[ - "consoleAuthorizationEnabled" - ], - self.console_authorization_enabled, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["target_id"] = de.read_string( - _SCHEMA_GET_CONSOLE_AUTHORIZATION_CONFIGURATION_OUTPUT.members[ - "targetId" - ] - ) - - case 1: - kwargs["scope"] = de.read_string( - _SCHEMA_GET_CONSOLE_AUTHORIZATION_CONFIGURATION_OUTPUT.members[ - "scope" - ] - ) - - case 2: - kwargs["console_authorization_enabled"] = de.read_boolean( - _SCHEMA_GET_CONSOLE_AUTHORIZATION_CONFIGURATION_OUTPUT.members[ - "consoleAuthorizationEnabled" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_CONSOLE_AUTHORIZATION_CONFIGURATION_OUTPUT, consumer=_consumer - ) - if "target_id" not in kwargs: - kwargs["target_id"] = "" - if "scope" not in kwargs: - kwargs["scope"] = "" - if "console_authorization_enabled" not in kwargs: - kwargs["console_authorization_enabled"] = False - return kwargs - - -GET_CONSOLE_AUTHORIZATION_CONFIGURATION = APIOperation( - input=GetConsoleAuthorizationConfigurationInput, - output=GetConsoleAuthorizationConfigurationOutput, - schema=_SCHEMA_GET_CONSOLE_AUTHORIZATION_CONFIGURATION, - input_schema=_SCHEMA_GET_CONSOLE_AUTHORIZATION_CONFIGURATION_INPUT, - output_schema=_SCHEMA_GET_CONSOLE_AUTHORIZATION_CONFIGURATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.signin#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.signin#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.signin#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.signin#TooManyRequestsError"): TooManyRequestsError, - ShapeID("com.amazonaws.signin#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_ERROR, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetResourcePolicyInput: - """Input for GetResourcePolicy operation""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_RESOURCE_POLICY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_RESOURCE_POLICY_INPUT, consumer=_consumer) - return kwargs - - -def _serialize_policy_actions( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_policy_actions( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_principal( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_principal( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class PolicyStatement: - """Individual policy statement within a resource-based policy""" - - effect: str | None = None - """Effect of the policy statement (Allow/Deny)""" - - principal: dict[str, str] | None = None - """Principal the statement applies to""" - - action: list[str] | None = None - """Actions the statement controls""" - - resource: str | None = None - """Resource the statement applies to""" - - condition: dict[str, dict[str, list[str]]] | None = None - """Condition block for the statement""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_POLICY_STATEMENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.effect is not None: - serializer.write_string( - _SCHEMA_POLICY_STATEMENT.members["effect"], self.effect - ) - - if self.principal is not None: - _serialize_principal( - serializer, - _SCHEMA_POLICY_STATEMENT.members["principal"], - self.principal, - ) - - if self.action is not None: - _serialize_policy_actions( - serializer, _SCHEMA_POLICY_STATEMENT.members["action"], self.action - ) - - if self.resource is not None: - serializer.write_string( - _SCHEMA_POLICY_STATEMENT.members["resource"], self.resource - ) - - if self.condition is not None: - _serialize_condition_block( - serializer, - _SCHEMA_POLICY_STATEMENT.members["condition"], - self.condition, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["effect"] = de.read_string( - _SCHEMA_POLICY_STATEMENT.members["effect"] - ) - - case 1: - kwargs["principal"] = _deserialize_principal( - de, _SCHEMA_POLICY_STATEMENT.members["principal"] - ) - - case 2: - kwargs["action"] = _deserialize_policy_actions( - de, _SCHEMA_POLICY_STATEMENT.members["action"] - ) - - case 3: - kwargs["resource"] = de.read_string( - _SCHEMA_POLICY_STATEMENT.members["resource"] - ) - - case 4: - kwargs["condition"] = _deserialize_condition_block( - de, _SCHEMA_POLICY_STATEMENT.members["condition"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_POLICY_STATEMENT, consumer=_consumer) - return kwargs - - -def _serialize_policy_statements( - serializer: ShapeSerializer, schema: Schema, value: list[PolicyStatement] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_policy_statements( - deserializer: ShapeDeserializer, schema: Schema -) -> list[PolicyStatement]: - result: list[PolicyStatement] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(PolicyStatement.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class SigninResourceBasedPolicy: - """SignIn resource-based policy document""" - - version: str | None = None - """Policy version""" - - statement: list[PolicyStatement] | None = None - """Policy statements""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SIGNIN_RESOURCE_BASED_POLICY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.version is not None: - serializer.write_string( - _SCHEMA_SIGNIN_RESOURCE_BASED_POLICY.members["version"], self.version - ) - - if self.statement is not None: - _serialize_policy_statements( - serializer, - _SCHEMA_SIGNIN_RESOURCE_BASED_POLICY.members["statement"], - self.statement, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["version"] = de.read_string( - _SCHEMA_SIGNIN_RESOURCE_BASED_POLICY.members["version"] - ) - - case 1: - kwargs["statement"] = _deserialize_policy_statements( - de, _SCHEMA_SIGNIN_RESOURCE_BASED_POLICY.members["statement"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SIGNIN_RESOURCE_BASED_POLICY, consumer=_consumer - ) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls() - - -@dataclass(kw_only=True) -class GetResourcePolicyOutput: - """Output for GetResourcePolicy operation""" - - signin_resource_based_policy: SigninResourceBasedPolicy - """The account's SignIn resource-based policy""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_RESOURCE_POLICY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_RESOURCE_POLICY_OUTPUT.members["signinResourceBasedPolicy"], - self.signin_resource_based_policy, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["signin_resource_based_policy"] = ( - SigninResourceBasedPolicy.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_RESOURCE_POLICY_OUTPUT, consumer=_consumer) - if "signin_resource_based_policy" not in kwargs: - kwargs["signin_resource_based_policy"] = ( - SigninResourceBasedPolicy._smithy_default() - ) - return kwargs - - -GET_RESOURCE_POLICY = APIOperation( - input=GetResourcePolicyInput, - output=GetResourcePolicyOutput, - schema=_SCHEMA_GET_RESOURCE_POLICY, - input_schema=_SCHEMA_GET_RESOURCE_POLICY_INPUT, - output_schema=_SCHEMA_GET_RESOURCE_POLICY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.signin#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.signin#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.signin#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.signin#TooManyRequestsError"): TooManyRequestsError, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_ERROR, - ], -) - - -@dataclass(kw_only=True) -class IntrospectOAuth2TokenWithIAMInput: - """ - Input structure for IntrospectOAuth2TokenWithIAM operation RFC 7662 §2.1 - introspection request. Contains the token to inspect and an optional - hint about the token's type. - """ - - token: str | None = field(repr=False, default=None) - """ - The string value of the token to introspect. May be either an - access_token or a refresh_token issued by AWS Sign-In. - """ - - token_type_hint: str | None = None - """ - Optional hint about the type of the token submitted for introspection. - The server uses this hint to optimize lookup, but still falls back to - the other token type on miss. Allowed values: access_token, - refresh_token. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INTROSPECT_O_AUTH2_TOKEN_WITH_IAM_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.token is not None: - serializer.write_string( - _SCHEMA_INTROSPECT_O_AUTH2_TOKEN_WITH_IAM_INPUT.members["token"], - self.token, - ) - - if self.token_type_hint is not None: - serializer.write_string( - _SCHEMA_INTROSPECT_O_AUTH2_TOKEN_WITH_IAM_INPUT.members[ - "tokenTypeHint" - ], - self.token_type_hint, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["token"] = de.read_string( - _SCHEMA_INTROSPECT_O_AUTH2_TOKEN_WITH_IAM_INPUT.members["token"] - ) - - case 1: - kwargs["token_type_hint"] = de.read_string( - _SCHEMA_INTROSPECT_O_AUTH2_TOKEN_WITH_IAM_INPUT.members[ - "tokenTypeHint" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INTROSPECT_O_AUTH2_TOKEN_WITH_IAM_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class IntrospectOAuth2TokenWithIAMOutput: - """ - Output structure for IntrospectOAuth2TokenWithIAM operation RFC 7662 - §2.2 introspection response. Only `active` is required; all other - claims are omitted when the token is inactive. - """ - - active: bool - """ - Indicates whether the token is currently active. `true` only when the - token is valid, has not expired, has not been revoked, and belongs to - the caller's account. - """ - - client_id: str | None = None - """Client identifier for the OAuth 2.0 client that requested the token.""" - - user_id: str | None = None - """ - User identifier matching sts:GetCallerIdentity's `UserId` field for - the token's subject principal (e.g. \"AIDAEXAMPLE\" for an IAM user, or - \"AROAEXAMPLE:session-name\" for an assumed role). - """ - - token_type: str | None = None - """ - Indicates which kind of token was introspected. One of \"access_token\" - or \"refresh_token\". - """ - - exp: int | None = None - """Token expiration time as a NumericDate (Unix epoch seconds).""" - - iat: int | None = None - """Token issuance time as a NumericDate (Unix epoch seconds).""" - - nbf: int | None = None - """Token \"not before\" time as a NumericDate (Unix epoch seconds).""" - - sub: str | None = None - """ - Subject of the token: the IAM principal ARN. For assumed-role sessions, - this is the session ARN (matches sts:GetCallerIdentity's `Arn` - field), e.g. arn:aws:sts::123456789012:assumed-role/MyRole/session-name. - """ - - aud: str | None = None - """ - Audience of the token: the OAuth resource the token is scoped to (for - example, \"aws-mcp.amazonaws.com\"). Omitted for refresh tokens. - """ - - iss: str | None = None - """Issuer of the token. Always \"signin.amazonaws.com\" for AWS Sign-In.""" - - jti: str | None = None - """Unique identifier for the token.""" - - account_id: str | None = None - """12-digit AWS account ID of the token's subject principal.""" - - signin_session: str | None = None - """ - AWS Sign-In session ARN bound to the token, of the form - arn:aws:signin:{region}:{account}:session/{uuid}. - """ - resource: str | None = None - """ - The OAuth resource the token is scoped to during Human OAuth flow. Only - present for refresh token introspection. +class ServiceError(ModeledError): """ + Base error for all errors in the service. - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. + Some exceptions do not extend from this class, including + synthetic, implicit, and shared exception types. """ - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INTROSPECT_O_AUTH2_TOKEN_WITH_IAM_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_boolean( - _SCHEMA_INTROSPECT_O_AUTH2_TOKEN_WITH_IAM_OUTPUT.members["active"], - self.active, - ) - if self.client_id is not None: - serializer.write_string( - _SCHEMA_INTROSPECT_O_AUTH2_TOKEN_WITH_IAM_OUTPUT.members["clientId"], - self.client_id, - ) - - if self.user_id is not None: - serializer.write_string( - _SCHEMA_INTROSPECT_O_AUTH2_TOKEN_WITH_IAM_OUTPUT.members["userId"], - self.user_id, - ) - - if self.token_type is not None: - serializer.write_string( - _SCHEMA_INTROSPECT_O_AUTH2_TOKEN_WITH_IAM_OUTPUT.members["tokenType"], - self.token_type, - ) - - if self.exp is not None: - serializer.write_long( - _SCHEMA_INTROSPECT_O_AUTH2_TOKEN_WITH_IAM_OUTPUT.members["exp"], - self.exp, - ) - - if self.iat is not None: - serializer.write_long( - _SCHEMA_INTROSPECT_O_AUTH2_TOKEN_WITH_IAM_OUTPUT.members["iat"], - self.iat, - ) - - if self.nbf is not None: - serializer.write_long( - _SCHEMA_INTROSPECT_O_AUTH2_TOKEN_WITH_IAM_OUTPUT.members["nbf"], - self.nbf, - ) - if self.sub is not None: - serializer.write_string( - _SCHEMA_INTROSPECT_O_AUTH2_TOKEN_WITH_IAM_OUTPUT.members["sub"], - self.sub, - ) - - if self.aud is not None: - serializer.write_string( - _SCHEMA_INTROSPECT_O_AUTH2_TOKEN_WITH_IAM_OUTPUT.members["aud"], - self.aud, - ) - - if self.iss is not None: - serializer.write_string( - _SCHEMA_INTROSPECT_O_AUTH2_TOKEN_WITH_IAM_OUTPUT.members["iss"], - self.iss, - ) - - if self.jti is not None: - serializer.write_string( - _SCHEMA_INTROSPECT_O_AUTH2_TOKEN_WITH_IAM_OUTPUT.members["jti"], - self.jti, - ) - - if self.account_id is not None: - serializer.write_string( - _SCHEMA_INTROSPECT_O_AUTH2_TOKEN_WITH_IAM_OUTPUT.members["accountId"], - self.account_id, - ) - - if self.signin_session is not None: - serializer.write_string( - _SCHEMA_INTROSPECT_O_AUTH2_TOKEN_WITH_IAM_OUTPUT.members[ - "signinSession" - ], - self.signin_session, - ) - - if self.resource is not None: - serializer.write_string( - _SCHEMA_INTROSPECT_O_AUTH2_TOKEN_WITH_IAM_OUTPUT.members["resource"], - self.resource, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["active"] = de.read_boolean( - _SCHEMA_INTROSPECT_O_AUTH2_TOKEN_WITH_IAM_OUTPUT.members[ - "active" - ] - ) - - case 1: - kwargs["client_id"] = de.read_string( - _SCHEMA_INTROSPECT_O_AUTH2_TOKEN_WITH_IAM_OUTPUT.members[ - "clientId" - ] - ) - - case 2: - kwargs["user_id"] = de.read_string( - _SCHEMA_INTROSPECT_O_AUTH2_TOKEN_WITH_IAM_OUTPUT.members[ - "userId" - ] - ) - - case 3: - kwargs["token_type"] = de.read_string( - _SCHEMA_INTROSPECT_O_AUTH2_TOKEN_WITH_IAM_OUTPUT.members[ - "tokenType" - ] - ) - - case 4: - kwargs["exp"] = de.read_long( - _SCHEMA_INTROSPECT_O_AUTH2_TOKEN_WITH_IAM_OUTPUT.members["exp"] - ) - - case 5: - kwargs["iat"] = de.read_long( - _SCHEMA_INTROSPECT_O_AUTH2_TOKEN_WITH_IAM_OUTPUT.members["iat"] - ) - - case 6: - kwargs["nbf"] = de.read_long( - _SCHEMA_INTROSPECT_O_AUTH2_TOKEN_WITH_IAM_OUTPUT.members["nbf"] - ) - - case 7: - kwargs["sub"] = de.read_string( - _SCHEMA_INTROSPECT_O_AUTH2_TOKEN_WITH_IAM_OUTPUT.members["sub"] - ) - - case 8: - kwargs["aud"] = de.read_string( - _SCHEMA_INTROSPECT_O_AUTH2_TOKEN_WITH_IAM_OUTPUT.members["aud"] - ) - - case 9: - kwargs["iss"] = de.read_string( - _SCHEMA_INTROSPECT_O_AUTH2_TOKEN_WITH_IAM_OUTPUT.members["iss"] - ) - - case 10: - kwargs["jti"] = de.read_string( - _SCHEMA_INTROSPECT_O_AUTH2_TOKEN_WITH_IAM_OUTPUT.members["jti"] - ) - - case 11: - kwargs["account_id"] = de.read_string( - _SCHEMA_INTROSPECT_O_AUTH2_TOKEN_WITH_IAM_OUTPUT.members[ - "accountId" - ] - ) - - case 12: - kwargs["signin_session"] = de.read_string( - _SCHEMA_INTROSPECT_O_AUTH2_TOKEN_WITH_IAM_OUTPUT.members[ - "signinSession" - ] - ) - - case 13: - kwargs["resource"] = de.read_string( - _SCHEMA_INTROSPECT_O_AUTH2_TOKEN_WITH_IAM_OUTPUT.members[ - "resource" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INTROSPECT_O_AUTH2_TOKEN_WITH_IAM_OUTPUT, consumer=_consumer - ) - if "active" not in kwargs: - kwargs["active"] = False - return kwargs - - -INTROSPECT_O_AUTH2_TOKEN_WITH_IAM = APIOperation( - input=IntrospectOAuth2TokenWithIAMInput, - output=IntrospectOAuth2TokenWithIAMOutput, - schema=_SCHEMA_INTROSPECT_O_AUTH2_TOKEN_WITH_IAM, - input_schema=_SCHEMA_INTROSPECT_O_AUTH2_TOKEN_WITH_IAM_INPUT, - output_schema=_SCHEMA_INTROSPECT_O_AUTH2_TOKEN_WITH_IAM_OUTPUT, - error_registry=TypeRegistry( +_registry = ModelRegistry( + _schemas, + renames={}, + index={ + "AccessDeniedException": "ACCESS_DENIED_EXCEPTION", + "AccessToken": "ACCESS_TOKEN", + "ConflictException": "CONFLICT_EXCEPTION", + "CreateOAuth2TokenInput": "CREATE_O_AUTH2_TOKEN_INPUT", + "CreateOAuth2TokenOutput": "CREATE_O_AUTH2_TOKEN_OUTPUT", + "CreateOAuth2TokenRequestBody": "CREATE_O_AUTH2_TOKEN_REQUEST_BODY", + "CreateOAuth2TokenResponseBody": "CREATE_O_AUTH2_TOKEN_RESPONSE_BODY", + "CreateOAuth2TokenWithIAMInput": "CREATE_O_AUTH2_TOKEN_WITH_IAM_INPUT", + "CreateOAuth2TokenWithIAMOutput": "CREATE_O_AUTH2_TOKEN_WITH_IAM_OUTPUT", + "DeleteConsoleAuthorizationConfigurationInput": "DELETE_CONSOLE_AUTHORIZATION_CONFIGURATION_INPUT", + "DeleteConsoleAuthorizationConfigurationOutput": "DELETE_CONSOLE_AUTHORIZATION_CONFIGURATION_OUTPUT", + "DeleteResourcePermissionStatementInput": "DELETE_RESOURCE_PERMISSION_STATEMENT_INPUT", + "DeleteResourcePermissionStatementOutput": "DELETE_RESOURCE_PERMISSION_STATEMENT_OUTPUT", + "GetConsoleAuthorizationConfigurationInput": "GET_CONSOLE_AUTHORIZATION_CONFIGURATION_INPUT", + "GetConsoleAuthorizationConfigurationOutput": "GET_CONSOLE_AUTHORIZATION_CONFIGURATION_OUTPUT", + "GetResourcePolicyInput": "GET_RESOURCE_POLICY_INPUT", + "GetResourcePolicyOutput": "GET_RESOURCE_POLICY_OUTPUT", + "InternalServerException": "INTERNAL_SERVER_EXCEPTION", + "IntrospectOAuth2TokenWithIAMInput": "INTROSPECT_O_AUTH2_TOKEN_WITH_IAM_INPUT", + "IntrospectOAuth2TokenWithIAMOutput": "INTROSPECT_O_AUTH2_TOKEN_WITH_IAM_OUTPUT", + "ListResourcePermissionStatementsInput": "LIST_RESOURCE_PERMISSION_STATEMENTS_INPUT", + "ListResourcePermissionStatementsOutput": "LIST_RESOURCE_PERMISSION_STATEMENTS_OUTPUT", + "OAuth2ErrorCode": "O_AUTH2_ERROR_CODE", + "PermissionStatementSummary": "PERMISSION_STATEMENT_SUMMARY", + "PolicyStatement": "POLICY_STATEMENT", + "PutConsoleAuthorizationConfigurationInput": "PUT_CONSOLE_AUTHORIZATION_CONFIGURATION_INPUT", + "PutConsoleAuthorizationConfigurationOutput": "PUT_CONSOLE_AUTHORIZATION_CONFIGURATION_OUTPUT", + "PutResourcePermissionStatementInput": "PUT_RESOURCE_PERMISSION_STATEMENT_INPUT", + "PutResourcePermissionStatementOutput": "PUT_RESOURCE_PERMISSION_STATEMENT_OUTPUT", + "ResourceNotFoundException": "RESOURCE_NOT_FOUND_EXCEPTION", + "RevokeOAuth2TokenWithIAMInput": "REVOKE_O_AUTH2_TOKEN_WITH_IAM_INPUT", + "RevokeOAuth2TokenWithIAMOutput": "REVOKE_O_AUTH2_TOKEN_WITH_IAM_OUTPUT", + "ServiceQuotaExceededException": "SERVICE_QUOTA_EXCEEDED_EXCEPTION", + "SigninResourceBasedPolicy": "SIGNIN_RESOURCE_BASED_POLICY", + "TooManyRequestsError": "TOO_MANY_REQUESTS_ERROR", + "ValidationException": "VALIDATION_EXCEPTION", + }, + shape_names=frozenset( { - ShapeID( - "com.amazonaws.signin#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.signin#InternalServerException" - ): InternalServerException, - ShapeID("com.amazonaws.signin#TooManyRequestsError"): TooManyRequestsError, - ShapeID("com.amazonaws.signin#ValidationException"): ValidationException, + "AccessDeniedException", + "AccessToken", + "ConflictException", + "CreateOAuth2TokenInput", + "CreateOAuth2TokenOutput", + "CreateOAuth2TokenRequestBody", + "CreateOAuth2TokenResponseBody", + "CreateOAuth2TokenWithIAMInput", + "CreateOAuth2TokenWithIAMOutput", + "DeleteConsoleAuthorizationConfigurationInput", + "DeleteConsoleAuthorizationConfigurationOutput", + "DeleteResourcePermissionStatementInput", + "DeleteResourcePermissionStatementOutput", + "GetConsoleAuthorizationConfigurationInput", + "GetConsoleAuthorizationConfigurationOutput", + "GetResourcePolicyInput", + "GetResourcePolicyOutput", + "InternalServerException", + "IntrospectOAuth2TokenWithIAMInput", + "IntrospectOAuth2TokenWithIAMOutput", + "ListResourcePermissionStatementsInput", + "ListResourcePermissionStatementsOutput", + "OAuth2ErrorCode", + "PermissionStatementSummary", + "PolicyStatement", + "PutConsoleAuthorizationConfigurationInput", + "PutConsoleAuthorizationConfigurationOutput", + "PutResourcePermissionStatementInput", + "PutResourcePermissionStatementOutput", + "ResourceNotFoundException", + "RevokeOAuth2TokenWithIAMInput", + "RevokeOAuth2TokenWithIAMOutput", + "ServiceQuotaExceededException", + "SigninResourceBasedPolicy", + "TooManyRequestsError", + "ValidationException", } ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_ERROR, - _SCHEMA_VALIDATION_EXCEPTION, - ], + service_error="ServiceError", ) -@dataclass(kw_only=True) -class ListResourcePermissionStatementsInput: - """Input for ListResourcePermissionStatements operation""" - - max_results: int | None = None - """Maximum number of results to return""" - - next_token: str | None = None - """Token for pagination""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_RESOURCE_PERMISSION_STATEMENTS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_RESOURCE_PERMISSION_STATEMENTS_INPUT.members["maxResults"], - self.max_results, - ) +def __getattr__(name: str): + return _registry.build(name) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_RESOURCE_PERMISSION_STATEMENTS_INPUT.members["nextToken"], - self.next_token, - ) - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_RESOURCE_PERMISSION_STATEMENTS_INPUT.members[ - "maxResults" - ] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_RESOURCE_PERMISSION_STATEMENTS_INPUT.members[ - "nextToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_RESOURCE_PERMISSION_STATEMENTS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class PermissionStatementSummary: - """Summary of a permission statement""" - - sid: str - """Unique identifier for the permission statement""" - - condition: dict[str, dict[str, list[str]]] | None = None - """Condition block for the permission statement""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PERMISSION_STATEMENT_SUMMARY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_PERMISSION_STATEMENT_SUMMARY.members["sid"], self.sid - ) - if self.condition is not None: - _serialize_condition_block( - serializer, - _SCHEMA_PERMISSION_STATEMENT_SUMMARY.members["condition"], - self.condition, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["sid"] = de.read_string( - _SCHEMA_PERMISSION_STATEMENT_SUMMARY.members["sid"] - ) - - case 1: - kwargs["condition"] = _deserialize_condition_block( - de, _SCHEMA_PERMISSION_STATEMENT_SUMMARY.members["condition"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PERMISSION_STATEMENT_SUMMARY, consumer=_consumer - ) - if "sid" not in kwargs: - kwargs["sid"] = "" - return kwargs - - -def _serialize_permission_statement_summaries( - serializer: ShapeSerializer, schema: Schema, value: list[PermissionStatementSummary] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_permission_statement_summaries( - deserializer: ShapeDeserializer, schema: Schema -) -> list[PermissionStatementSummary]: - result: list[PermissionStatementSummary] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(PermissionStatementSummary.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListResourcePermissionStatementsOutput: - """Output for ListResourcePermissionStatements operation""" - - permission_statements: list[PermissionStatementSummary] - """List of permission statement summaries""" - - next_token: str | None = None - """Token for next page of results""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False +CREATE_O_AUTH2_TOKEN: APIOperation[CreateOAuth2TokenInput, CreateOAuth2TokenOutput] = ( + APIOperation( + static_schema=_SCHEMA_CREATE_O_AUTH2_TOKEN, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.signin#AccessDeniedException"), + ShapeID("com.amazonaws.signin#InternalServerException"), + ShapeID("com.amazonaws.signin#TooManyRequestsError"), + ShapeID("com.amazonaws.signin#ValidationException"), + ], + effective_auth_schemes=[ShapeID("smithy.api#noAuth")], ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_LIST_RESOURCE_PERMISSION_STATEMENTS_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_permission_statement_summaries( - serializer, - _SCHEMA_LIST_RESOURCE_PERMISSION_STATEMENTS_OUTPUT.members[ - "permissionStatements" - ], - self.permission_statements, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_RESOURCE_PERMISSION_STATEMENTS_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["permission_statements"] = ( - _deserialize_permission_statement_summaries( - de, - _SCHEMA_LIST_RESOURCE_PERMISSION_STATEMENTS_OUTPUT.members[ - "permissionStatements" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_RESOURCE_PERMISSION_STATEMENTS_OUTPUT.members[ - "nextToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_RESOURCE_PERMISSION_STATEMENTS_OUTPUT, consumer=_consumer - ) - if "permission_statements" not in kwargs: - kwargs["permission_statements"] = [] - return kwargs - +) -LIST_RESOURCE_PERMISSION_STATEMENTS = APIOperation( - input=ListResourcePermissionStatementsInput, - output=ListResourcePermissionStatementsOutput, - schema=_SCHEMA_LIST_RESOURCE_PERMISSION_STATEMENTS, - input_schema=_SCHEMA_LIST_RESOURCE_PERMISSION_STATEMENTS_INPUT, - output_schema=_SCHEMA_LIST_RESOURCE_PERMISSION_STATEMENTS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.signin#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.signin#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.signin#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.signin#TooManyRequestsError"): TooManyRequestsError, - ShapeID("com.amazonaws.signin#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_ERROR, - _SCHEMA_VALIDATION_EXCEPTION, +CREATE_O_AUTH2_TOKEN_WITH_IAM: APIOperation[ + CreateOAuth2TokenWithIAMInput, CreateOAuth2TokenWithIAMOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_O_AUTH2_TOKEN_WITH_IAM, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.signin#AccessDeniedException"), + ShapeID("com.amazonaws.signin#InternalServerException"), + ShapeID("com.amazonaws.signin#TooManyRequestsError"), + ShapeID("com.amazonaws.signin#ValidationException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) - -@dataclass(kw_only=True) -class PutConsoleAuthorizationConfigurationInput: - """Input for PutConsoleAuthorizationConfiguration operation""" - - target_id: str | None = None - """Target account identifier""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_PUT_CONSOLE_AUTHORIZATION_CONFIGURATION_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.target_id is not None: - serializer.write_string( - _SCHEMA_PUT_CONSOLE_AUTHORIZATION_CONFIGURATION_INPUT.members[ - "targetId" - ], - self.target_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["target_id"] = de.read_string( - _SCHEMA_PUT_CONSOLE_AUTHORIZATION_CONFIGURATION_INPUT.members[ - "targetId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PUT_CONSOLE_AUTHORIZATION_CONFIGURATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class PutConsoleAuthorizationConfigurationOutput: - """Output for PutConsoleAuthorizationConfiguration operation""" - - target_id: str - """Target account identifier""" - - scope: str - """Authorization scope""" - - console_authorization_enabled: bool - """Whether console authorization is enabled""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_PUT_CONSOLE_AUTHORIZATION_CONFIGURATION_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_PUT_CONSOLE_AUTHORIZATION_CONFIGURATION_OUTPUT.members["targetId"], - self.target_id, - ) - serializer.write_string( - _SCHEMA_PUT_CONSOLE_AUTHORIZATION_CONFIGURATION_OUTPUT.members["scope"], - self.scope, - ) - serializer.write_boolean( - _SCHEMA_PUT_CONSOLE_AUTHORIZATION_CONFIGURATION_OUTPUT.members[ - "consoleAuthorizationEnabled" - ], - self.console_authorization_enabled, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["target_id"] = de.read_string( - _SCHEMA_PUT_CONSOLE_AUTHORIZATION_CONFIGURATION_OUTPUT.members[ - "targetId" - ] - ) - - case 1: - kwargs["scope"] = de.read_string( - _SCHEMA_PUT_CONSOLE_AUTHORIZATION_CONFIGURATION_OUTPUT.members[ - "scope" - ] - ) - - case 2: - kwargs["console_authorization_enabled"] = de.read_boolean( - _SCHEMA_PUT_CONSOLE_AUTHORIZATION_CONFIGURATION_OUTPUT.members[ - "consoleAuthorizationEnabled" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PUT_CONSOLE_AUTHORIZATION_CONFIGURATION_OUTPUT, consumer=_consumer - ) - if "target_id" not in kwargs: - kwargs["target_id"] = "" - if "scope" not in kwargs: - kwargs["scope"] = "" - if "console_authorization_enabled" not in kwargs: - kwargs["console_authorization_enabled"] = False - return kwargs - - -PUT_CONSOLE_AUTHORIZATION_CONFIGURATION = APIOperation( - input=PutConsoleAuthorizationConfigurationInput, - output=PutConsoleAuthorizationConfigurationOutput, - schema=_SCHEMA_PUT_CONSOLE_AUTHORIZATION_CONFIGURATION, - input_schema=_SCHEMA_PUT_CONSOLE_AUTHORIZATION_CONFIGURATION_INPUT, - output_schema=_SCHEMA_PUT_CONSOLE_AUTHORIZATION_CONFIGURATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.signin#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.signin#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.signin#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.signin#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.signin#TooManyRequestsError"): TooManyRequestsError, - ShapeID("com.amazonaws.signin#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_ERROR, - _SCHEMA_VALIDATION_EXCEPTION, +DELETE_CONSOLE_AUTHORIZATION_CONFIGURATION: APIOperation[ + DeleteConsoleAuthorizationConfigurationInput, + DeleteConsoleAuthorizationConfigurationOutput, +] = APIOperation( + static_schema=_SCHEMA_DELETE_CONSOLE_AUTHORIZATION_CONFIGURATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.signin#AccessDeniedException"), + ShapeID("com.amazonaws.signin#InternalServerException"), + ShapeID("com.amazonaws.signin#ResourceNotFoundException"), + ShapeID("com.amazonaws.signin#TooManyRequestsError"), + ShapeID("com.amazonaws.signin#ValidationException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) - -@dataclass(kw_only=True) -class PutResourcePermissionStatementInput: - """Input for PutResourcePermissionStatement operation""" - - source_vpc: str | None = None - """VPC identifier to restrict console access""" - - signin_source_vpce: str | None = None - """SignIn VPC endpoint identifier""" - - console_source_vpce: str | None = None - """Console VPC endpoint identifier""" - - vpc_source_ip: str | None = None - """Source IP address within VPC""" - - source_ip: str | None = None - """Source IP address""" - - requested_region: str | None = None - """ - AWS region where the VPC and VPC endpoint reside Required when sourceVpc - or signinSourceVpce/consoleSourceVpce is provided - """ - - excluded_principal: str | None = None - """Principal to exclude from the permission statement""" - - client_token: str | None = None - """Idempotency token for the request""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_RESOURCE_PERMISSION_STATEMENT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.source_vpc is not None: - serializer.write_string( - _SCHEMA_PUT_RESOURCE_PERMISSION_STATEMENT_INPUT.members["sourceVpc"], - self.source_vpc, - ) - - if self.signin_source_vpce is not None: - serializer.write_string( - _SCHEMA_PUT_RESOURCE_PERMISSION_STATEMENT_INPUT.members[ - "signinSourceVpce" - ], - self.signin_source_vpce, - ) - - if self.console_source_vpce is not None: - serializer.write_string( - _SCHEMA_PUT_RESOURCE_PERMISSION_STATEMENT_INPUT.members[ - "consoleSourceVpce" - ], - self.console_source_vpce, - ) - - if self.vpc_source_ip is not None: - serializer.write_string( - _SCHEMA_PUT_RESOURCE_PERMISSION_STATEMENT_INPUT.members["vpcSourceIp"], - self.vpc_source_ip, - ) - - if self.source_ip is not None: - serializer.write_string( - _SCHEMA_PUT_RESOURCE_PERMISSION_STATEMENT_INPUT.members["sourceIp"], - self.source_ip, - ) - - if self.requested_region is not None: - serializer.write_string( - _SCHEMA_PUT_RESOURCE_PERMISSION_STATEMENT_INPUT.members[ - "requestedRegion" - ], - self.requested_region, - ) - - if self.excluded_principal is not None: - serializer.write_string( - _SCHEMA_PUT_RESOURCE_PERMISSION_STATEMENT_INPUT.members[ - "excludedPrincipal" - ], - self.excluded_principal, - ) - - if self.client_token is not None: - serializer.write_string( - _SCHEMA_PUT_RESOURCE_PERMISSION_STATEMENT_INPUT.members["clientToken"], - self.client_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["source_vpc"] = de.read_string( - _SCHEMA_PUT_RESOURCE_PERMISSION_STATEMENT_INPUT.members[ - "sourceVpc" - ] - ) - - case 1: - kwargs["signin_source_vpce"] = de.read_string( - _SCHEMA_PUT_RESOURCE_PERMISSION_STATEMENT_INPUT.members[ - "signinSourceVpce" - ] - ) - - case 2: - kwargs["console_source_vpce"] = de.read_string( - _SCHEMA_PUT_RESOURCE_PERMISSION_STATEMENT_INPUT.members[ - "consoleSourceVpce" - ] - ) - - case 3: - kwargs["vpc_source_ip"] = de.read_string( - _SCHEMA_PUT_RESOURCE_PERMISSION_STATEMENT_INPUT.members[ - "vpcSourceIp" - ] - ) - - case 4: - kwargs["source_ip"] = de.read_string( - _SCHEMA_PUT_RESOURCE_PERMISSION_STATEMENT_INPUT.members[ - "sourceIp" - ] - ) - - case 5: - kwargs["requested_region"] = de.read_string( - _SCHEMA_PUT_RESOURCE_PERMISSION_STATEMENT_INPUT.members[ - "requestedRegion" - ] - ) - - case 6: - kwargs["excluded_principal"] = de.read_string( - _SCHEMA_PUT_RESOURCE_PERMISSION_STATEMENT_INPUT.members[ - "excludedPrincipal" - ] - ) - - case 7: - kwargs["client_token"] = de.read_string( - _SCHEMA_PUT_RESOURCE_PERMISSION_STATEMENT_INPUT.members[ - "clientToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PUT_RESOURCE_PERMISSION_STATEMENT_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class PutResourcePermissionStatementOutput: - """Output for PutResourcePermissionStatement operation""" - - statement_id: str - """Unique identifier for the created permission statement""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_RESOURCE_PERMISSION_STATEMENT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_PUT_RESOURCE_PERMISSION_STATEMENT_OUTPUT.members["statementId"], - self.statement_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["statement_id"] = de.read_string( - _SCHEMA_PUT_RESOURCE_PERMISSION_STATEMENT_OUTPUT.members[ - "statementId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PUT_RESOURCE_PERMISSION_STATEMENT_OUTPUT, consumer=_consumer - ) - if "statement_id" not in kwargs: - kwargs["statement_id"] = "" - return kwargs - - -@dataclass(kw_only=True) -class ServiceQuotaExceededException(ServiceError): - """ - Error thrown when service quota is exceeded HTTP Status Code: 402 - Payment Required (used as quota exceeded indicator) Used when the - request would cause a service quota to be exceeded - """ - - fault: Literal["client", "server"] | None = "client" - - error: str - """ - OAuth 2.0 error code indicating service quota exceeded Will be - SERVICE_QUOTA_EXCEEDED - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION.members["error"], self.error - ) - serializer.write_string( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["error"] = OAuth2ErrorCode( - de.read_string( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION.members["error"] - ) - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, consumer=_consumer - ) - if "error" not in kwargs: - kwargs["error"] = OAuth2ErrorCode._corrected("") - return kwargs - - -PUT_RESOURCE_PERMISSION_STATEMENT = APIOperation( - input=PutResourcePermissionStatementInput, - output=PutResourcePermissionStatementOutput, - schema=_SCHEMA_PUT_RESOURCE_PERMISSION_STATEMENT, - input_schema=_SCHEMA_PUT_RESOURCE_PERMISSION_STATEMENT_INPUT, - output_schema=_SCHEMA_PUT_RESOURCE_PERMISSION_STATEMENT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.signin#AccessDeniedException" - ): AccessDeniedException, - ShapeID("com.amazonaws.signin#ConflictException"): ConflictException, - ShapeID( - "com.amazonaws.signin#InternalServerException" - ): InternalServerException, - ShapeID( - "com.amazonaws.signin#ServiceQuotaExceededException" - ): ServiceQuotaExceededException, - ShapeID("com.amazonaws.signin#TooManyRequestsError"): TooManyRequestsError, - ShapeID("com.amazonaws.signin#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_SERVICE_QUOTA_EXCEEDED_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_ERROR, - _SCHEMA_VALIDATION_EXCEPTION, +DELETE_RESOURCE_PERMISSION_STATEMENT: APIOperation[ + DeleteResourcePermissionStatementInput, DeleteResourcePermissionStatementOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_RESOURCE_PERMISSION_STATEMENT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.signin#AccessDeniedException"), + ShapeID("com.amazonaws.signin#InternalServerException"), + ShapeID("com.amazonaws.signin#ResourceNotFoundException"), + ShapeID("com.amazonaws.signin#TooManyRequestsError"), + ShapeID("com.amazonaws.signin#ValidationException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) +GET_CONSOLE_AUTHORIZATION_CONFIGURATION: APIOperation[ + GetConsoleAuthorizationConfigurationInput, + GetConsoleAuthorizationConfigurationOutput, +] = APIOperation( + static_schema=_SCHEMA_GET_CONSOLE_AUTHORIZATION_CONFIGURATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.signin#AccessDeniedException"), + ShapeID("com.amazonaws.signin#InternalServerException"), + ShapeID("com.amazonaws.signin#ResourceNotFoundException"), + ShapeID("com.amazonaws.signin#TooManyRequestsError"), + ShapeID("com.amazonaws.signin#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -@dataclass(kw_only=True) -class RevokeOAuth2TokenWithIAMInput: - """ - Input structure for RevokeOAuth2TokenWithIAM operation RFC 7009 §2.1 - revocation request. Contains the refresh_token to revoke. - """ - - token: str | None = field(repr=False, default=None) - """ - The refresh_token to revoke. Must be a refresh_token issued by AWS - Sign-In (prefix \"ASOR\"); access_tokens are not accepted for - revocation. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REVOKE_O_AUTH2_TOKEN_WITH_IAM_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.token is not None: - serializer.write_string( - _SCHEMA_REVOKE_O_AUTH2_TOKEN_WITH_IAM_INPUT.members["token"], self.token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["token"] = de.read_string( - _SCHEMA_REVOKE_O_AUTH2_TOKEN_WITH_IAM_INPUT.members["token"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_REVOKE_O_AUTH2_TOKEN_WITH_IAM_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class RevokeOAuth2TokenWithIAMOutput: - """ - Output structure for RevokeOAuth2TokenWithIAM operation RFC 7009 §2.2 - revocation response. The endpoint returns 200 OK with an empty body on - success; there are no response fields. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False +GET_RESOURCE_POLICY: APIOperation[GetResourcePolicyInput, GetResourcePolicyOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_RESOURCE_POLICY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.signin#AccessDeniedException"), + ShapeID("com.amazonaws.signin#InternalServerException"), + ShapeID("com.amazonaws.signin#ResourceNotFoundException"), + ShapeID("com.amazonaws.signin#TooManyRequestsError"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REVOKE_O_AUTH2_TOKEN_WITH_IAM_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) +INTROSPECT_O_AUTH2_TOKEN_WITH_IAM: APIOperation[ + IntrospectOAuth2TokenWithIAMInput, IntrospectOAuth2TokenWithIAMOutput +] = APIOperation( + static_schema=_SCHEMA_INTROSPECT_O_AUTH2_TOKEN_WITH_IAM, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.signin#AccessDeniedException"), + ShapeID("com.amazonaws.signin#InternalServerException"), + ShapeID("com.amazonaws.signin#TooManyRequestsError"), + ShapeID("com.amazonaws.signin#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - deserializer.read_struct( - _SCHEMA_REVOKE_O_AUTH2_TOKEN_WITH_IAM_OUTPUT, consumer=_consumer - ) - return kwargs +LIST_RESOURCE_PERMISSION_STATEMENTS: APIOperation[ + ListResourcePermissionStatementsInput, ListResourcePermissionStatementsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_RESOURCE_PERMISSION_STATEMENTS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.signin#AccessDeniedException"), + ShapeID("com.amazonaws.signin#InternalServerException"), + ShapeID("com.amazonaws.signin#ResourceNotFoundException"), + ShapeID("com.amazonaws.signin#TooManyRequestsError"), + ShapeID("com.amazonaws.signin#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +PUT_CONSOLE_AUTHORIZATION_CONFIGURATION: APIOperation[ + PutConsoleAuthorizationConfigurationInput, + PutConsoleAuthorizationConfigurationOutput, +] = APIOperation( + static_schema=_SCHEMA_PUT_CONSOLE_AUTHORIZATION_CONFIGURATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.signin#AccessDeniedException"), + ShapeID("com.amazonaws.signin#ConflictException"), + ShapeID("com.amazonaws.signin#InternalServerException"), + ShapeID("com.amazonaws.signin#ResourceNotFoundException"), + ShapeID("com.amazonaws.signin#TooManyRequestsError"), + ShapeID("com.amazonaws.signin#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -REVOKE_O_AUTH2_TOKEN_WITH_IAM = APIOperation( - input=RevokeOAuth2TokenWithIAMInput, - output=RevokeOAuth2TokenWithIAMOutput, - schema=_SCHEMA_REVOKE_O_AUTH2_TOKEN_WITH_IAM, - input_schema=_SCHEMA_REVOKE_O_AUTH2_TOKEN_WITH_IAM_INPUT, - output_schema=_SCHEMA_REVOKE_O_AUTH2_TOKEN_WITH_IAM_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.signin#AccessDeniedException" - ): AccessDeniedException, - ShapeID( - "com.amazonaws.signin#InternalServerException" - ): InternalServerException, - ShapeID("com.amazonaws.signin#TooManyRequestsError"): TooManyRequestsError, - ShapeID("com.amazonaws.signin#ValidationException"): ValidationException, - } - ), +PUT_RESOURCE_PERMISSION_STATEMENT: APIOperation[ + PutResourcePermissionStatementInput, PutResourcePermissionStatementOutput +] = APIOperation( + static_schema=_SCHEMA_PUT_RESOURCE_PERMISSION_STATEMENT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.signin#AccessDeniedException"), + ShapeID("com.amazonaws.signin#ConflictException"), + ShapeID("com.amazonaws.signin#InternalServerException"), + ShapeID("com.amazonaws.signin#ServiceQuotaExceededException"), + ShapeID("com.amazonaws.signin#TooManyRequestsError"), + ShapeID("com.amazonaws.signin#ValidationException"), + ], effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_ACCESS_DENIED_EXCEPTION, - _SCHEMA_INTERNAL_SERVER_EXCEPTION, - _SCHEMA_TOO_MANY_REQUESTS_ERROR, - _SCHEMA_VALIDATION_EXCEPTION, +) + +REVOKE_O_AUTH2_TOKEN_WITH_IAM: APIOperation[ + RevokeOAuth2TokenWithIAMInput, RevokeOAuth2TokenWithIAMOutput +] = APIOperation( + static_schema=_SCHEMA_REVOKE_O_AUTH2_TOKEN_WITH_IAM, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.signin#AccessDeniedException"), + ShapeID("com.amazonaws.signin#InternalServerException"), + ShapeID("com.amazonaws.signin#TooManyRequestsError"), + ShapeID("com.amazonaws.signin#ValidationException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) diff --git a/clients/aws-sdk-signin/src/aws_sdk_signin/models.pyi b/clients/aws-sdk-signin/src/aws_sdk_signin/models.pyi new file mode 100644 index 00000000..caf0fb60 --- /dev/null +++ b/clients/aws-sdk-signin/src/aws_sdk_signin/models.pyi @@ -0,0 +1,735 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. + +from dataclasses import dataclass +from enum import StrEnum +from typing import Self + +from smithy_core.deserializers import ShapeDeserializer +from smithy_core.exceptions import ModeledError +from smithy_core.response import ResponseMetadata +from smithy_core.schemas import APIOperation +from smithy_core.serializers import ShapeSerializer +from smithy_core.types import UnknownEnumMixin + +class _SerdeShape: + def serialize(self, serializer: ShapeSerializer) -> None: ... + def serialize_members(self, serializer: ShapeSerializer) -> None: ... + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: ... + +class ServiceError(ModeledError): + """ + Base error for all errors in the service. + + Some exceptions do not extend from this class, including + synthetic, implicit, and shared exception types. + """ + +@dataclass(kw_only=True) +class AccessDeniedException(ServiceError, _SerdeShape): + """ + Error thrown for access denied scenarios with flexible HTTP status + mapping Runtime HTTP Status Code Mapping: - HTTP 401 (Unauthorized): + TOKEN_EXPIRED, AUTHCODE_EXPIRED - HTTP 403 (Forbidden): + USER_CREDENTIALS_CHANGED, INSUFFICIENT_PERMISSIONS The specific HTTP + status code is determined at runtime based on the error enum value. + Consumers should use the error field to determine the specific access + denial reason. + """ + + error: str + """ + OAuth 2.0 error code indicating the specific type of access denial Can + be TOKEN_EXPIRED, AUTHCODE_EXPIRED, USER_CREDENTIALS_CHANGED, or + INSUFFICIENT_PERMISSIONS + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class AccessToken(_SerdeShape): + """ + AWS credentials structure containing temporary access credentials + Scoped, temporary AWS credentials with a 15-minute duration. + """ + + access_key_id: str + """AWS access key ID for temporary credentials""" + secret_access_key: str + """AWS secret access key for temporary credentials""" + session_token: str + """AWS session token for temporary credentials""" + +@dataclass(kw_only=True) +class ConflictException(ServiceError, _SerdeShape): + """ + Error thrown when request conflicts with current state HTTP Status Code: + 409 Conflict Used when the request conflicts with the current state of + the resource + """ + + error: str + """OAuth 2.0 error code indicating conflict Will be CONFLICT""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateOAuth2TokenInput(_SerdeShape): + """ + Input structure for CreateOAuth2Token operation Contains flattened token + operation inputs for both authorization code and refresh token flows. + The operation type is determined by the grant_type parameter in the + request body. + """ + + token_input: CreateOAuth2TokenRequestBody | None = ... + """ + Flattened token operation inputs The specific operation is determined by + grant_type in the request body + """ + +@dataclass(kw_only=True) +class CreateOAuth2TokenOutput(_SerdeShape): + """ + Output structure for CreateOAuth2Token operation Contains flattened + token operation outputs for both authorization code and refresh token + flows. The response content depends on the grant_type from the original + request. + """ + + token_output: CreateOAuth2TokenResponseBody + """ + Flattened token operation outputs The specific response fields depend on + the grant_type used in the request + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateOAuth2TokenRequestBody(_SerdeShape): + """ + Request body payload for CreateOAuth2Token operation The operation type + is determined by the grant_type parameter: - + grant_type=authorization_code: Requires code, redirect_uri, + code_verifier - grant_type=refresh_token: Requires refresh_token + """ + + client_id: str + """ + The client identifier (ARN) used during Sign-In onboarding Required for + both authorization code and refresh token flows + """ + grant_type: str + """ + OAuth 2.0 grant type - determines which flow is used Must be + \"authorization_code\" or \"refresh_token\" + """ + code: str | None = ... + """ + The authorization code received from /v1/authorize Required only when + grant_type=authorization_code + """ + redirect_uri: str | None = ... + """ + The redirect URI that must match the original authorization request + Required only when grant_type=authorization_code + """ + code_verifier: str | None = ... + """ + PKCE code verifier to prove possession of the original code challenge + Required only when grant_type=authorization_code + """ + refresh_token: str | None = ... + """ + The refresh token returned from auth_code redemption Required only when + grant_type=refresh_token + """ + +@dataclass(kw_only=True) +class CreateOAuth2TokenResponseBody(_SerdeShape): + """ + Response body payload for CreateOAuth2Token operation The response + content depends on the grant_type from the request: - + grant_type=authorization_code: Returns all fields including + refresh_token and id_token - grant_type=refresh_token: Returns + access_token, token_type, expires_in, refresh_token (no id_token) + """ + + access_token: AccessToken + """ + Scoped-down AWS credentials (15 minute duration) Present for both + authorization code redemption and token refresh + """ + token_type: str + """ + Token type indicating this is AWS SigV4 credentials Value is + \"aws_sigv4\" for both flows + """ + expires_in: int + """ + Time to expiry in seconds (maximum 900) Present for both authorization + code redemption and token refresh + """ + refresh_token: str + """ + Encrypted refresh token with cnf.jkt (SHA-256 thumbprint of presented + jwk) Always present in responses (required for both flows) + """ + id_token: str | None = ... + """ + ID token containing user identity information Present only in + authorization code redemption response (grant_type=authorization_code) + Not included in token refresh responses + """ + +@dataclass(kw_only=True) +class CreateOAuth2TokenWithIAMInput(_SerdeShape): + """Input structure for CreateOAuth2TokenWithIAM operation""" + + grant_type: str | None = ... + """OAuth 2.0 grant type. Must be \"client_credentials\".""" + resource: str | None = ... + """ + The OAuth resource for which the access token is requested. Example: + \"aws-mcp.amazonaws.com\". + """ + +@dataclass(kw_only=True) +class CreateOAuth2TokenWithIAMOutput(_SerdeShape): + """ + Output structure for CreateOAuth2TokenWithIAM operation Contains the JWT + access token, token type, and expiration per RFC 6749 §5.1. + """ + + access_token: str + """ + JWT access token containing principal identity, resource scope, and + session metadata + """ + token_type: str + """Always \"Bearer\" per OAuth 2.1 specification""" + expires_in: int + """ + Token lifetime in seconds. Value is the minimum of session validity and + 1 hour. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteConsoleAuthorizationConfigurationInput(_SerdeShape): + """Input for DeleteConsoleAuthorizationConfiguration operation""" + + target_id: str | None = ... + """Target account identifier""" + +@dataclass(kw_only=True) +class DeleteConsoleAuthorizationConfigurationOutput(_SerdeShape): + """Output for DeleteConsoleAuthorizationConfiguration operation""" + + target_id: str + """Target account identifier""" + scope: str + """Authorization scope""" + console_authorization_enabled: bool + """Whether console authorization is enabled""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteResourcePermissionStatementInput(_SerdeShape): + """Input for DeleteResourcePermissionStatement operation""" + + statement_id: str | None = ... + """Unique identifier of the permission statement to delete""" + client_token: str | None = ... + """Idempotency token for the request""" + +@dataclass(kw_only=True) +class DeleteResourcePermissionStatementOutput(_SerdeShape): + """Output for DeleteResourcePermissionStatement operation""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetConsoleAuthorizationConfigurationInput(_SerdeShape): + """Input for GetConsoleAuthorizationConfiguration operation""" + + target_id: str | None = ... + """Target account identifier""" + +@dataclass(kw_only=True) +class GetConsoleAuthorizationConfigurationOutput(_SerdeShape): + """Output for GetConsoleAuthorizationConfiguration operation""" + + target_id: str + """Target account identifier""" + scope: str + """Authorization scope""" + console_authorization_enabled: bool + """Whether console authorization is enabled""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetResourcePolicyInput(_SerdeShape): + """Input for GetResourcePolicy operation""" + +@dataclass(kw_only=True) +class GetResourcePolicyOutput(_SerdeShape): + """Output for GetResourcePolicy operation""" + + signin_resource_based_policy: SigninResourceBasedPolicy + """The account's SignIn resource-based policy""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InternalServerException(ServiceError, _SerdeShape): + """ + Error thrown when an internal server error occurs HTTP Status Code: 500 + Internal Server Error Used for unexpected server-side errors that + prevent request processing. + """ + + error: str + """ + OAuth 2.0 error code indicating server error Will be SERVER_ERROR for + internal server errors + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class IntrospectOAuth2TokenWithIAMInput(_SerdeShape): + """ + Input structure for IntrospectOAuth2TokenWithIAM operation RFC 7662 §2.1 + introspection request. Contains the token to inspect and an optional + hint about the token's type. + """ + + token: str | None = ... + """ + The string value of the token to introspect. May be either an + access_token or a refresh_token issued by AWS Sign-In. + """ + token_type_hint: str | None = ... + """ + Optional hint about the type of the token submitted for introspection. + The server uses this hint to optimize lookup, but still falls back to + the other token type on miss. Allowed values: access_token, + refresh_token. + """ + +@dataclass(kw_only=True) +class IntrospectOAuth2TokenWithIAMOutput(_SerdeShape): + """ + Output structure for IntrospectOAuth2TokenWithIAM operation RFC 7662 + §2.2 introspection response. Only `active` is required; all other + claims are omitted when the token is inactive. + """ + + active: bool + """ + Indicates whether the token is currently active. `true` only when the + token is valid, has not expired, has not been revoked, and belongs to + the caller's account. + """ + client_id: str | None = ... + """Client identifier for the OAuth 2.0 client that requested the token.""" + user_id: str | None = ... + """ + User identifier matching sts:GetCallerIdentity's `UserId` field for + the token's subject principal (e.g. \"AIDAEXAMPLE\" for an IAM user, or + \"AROAEXAMPLE:session-name\" for an assumed role). + """ + token_type: str | None = ... + """ + Indicates which kind of token was introspected. One of \"access_token\" + or \"refresh_token\". + """ + exp: int | None = ... + """Token expiration time as a NumericDate (Unix epoch seconds).""" + iat: int | None = ... + """Token issuance time as a NumericDate (Unix epoch seconds).""" + nbf: int | None = ... + """Token \"not before\" time as a NumericDate (Unix epoch seconds).""" + sub: str | None = ... + """ + Subject of the token: the IAM principal ARN. For assumed-role sessions, + this is the session ARN (matches sts:GetCallerIdentity's `Arn` + field), e.g. arn:aws:sts::123456789012:assumed-role/MyRole/session-name. + """ + aud: str | None = ... + """ + Audience of the token: the OAuth resource the token is scoped to (for + example, \"aws-mcp.amazonaws.com\"). Omitted for refresh tokens. + """ + iss: str | None = ... + """Issuer of the token. Always \"signin.amazonaws.com\" for AWS Sign-In.""" + jti: str | None = ... + """Unique identifier for the token.""" + account_id: str | None = ... + """12-digit AWS account ID of the token's subject principal.""" + signin_session: str | None = ... + """ + AWS Sign-In session ARN bound to the token, of the form + arn:aws:signin:{region}:{account}:session/{uuid}. + """ + resource: str | None = ... + """ + The OAuth resource the token is scoped to during Human OAuth flow. Only + present for refresh token introspection. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListResourcePermissionStatementsInput(_SerdeShape): + """Input for ListResourcePermissionStatements operation""" + + max_results: int | None = ... + """Maximum number of results to return""" + next_token: str | None = ... + """Token for pagination""" + +@dataclass(kw_only=True) +class ListResourcePermissionStatementsOutput(_SerdeShape): + """Output for ListResourcePermissionStatements operation""" + + permission_statements: list[PermissionStatementSummary] + """List of permission statement summaries""" + next_token: str | None = ... + """Token for next page of results""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class OAuth2ErrorCode(UnknownEnumMixin, StrEnum): + """ + OAuth 2.0 error codes returned by the server Standard OAuth 2.0 error + codes used in error responses to indicate the specific type of error + that occurred during token operations. + """ + + TOKEN_EXPIRED = "TOKEN_EXPIRED" + """Token has expired and needs to be refreshed""" + USER_CREDENTIALS_CHANGED = "USER_CREDENTIALS_CHANGED" + """User credentials have been changed""" + INSUFFICIENT_PERMISSIONS = "INSUFFICIENT_PERMISSIONS" + """Insufficient permissions to perform this operation""" + AUTHCODE_EXPIRED = "AUTHCODE_EXPIRED" + """Authorization code has expired""" + SERVER_ERROR = "server_error" + """Internal server error occurred""" + INVALID_REQUEST = "INVALID_REQUEST" + """ + The request is missing a required parameter, includes an invalid + parameter value, or is otherwise malformed + """ + RESOURCE_NOT_FOUND = "RESOURCE_NOT_FOUND" + """Requested resource was not found""" + CONFLICT = "CONFLICT" + """Request conflicts with current state of the resource""" + SERVICE_QUOTA_EXCEEDED = "SERVICE_QUOTA_EXCEEDED" + """Request would cause a service quota to be exceeded""" + +@dataclass(kw_only=True) +class PermissionStatementSummary(_SerdeShape): + """Summary of a permission statement""" + + sid: str + """Unique identifier for the permission statement""" + condition: dict[str, dict[str, list[str]]] | None = ... + """Condition block for the permission statement""" + +@dataclass(kw_only=True) +class PolicyStatement(_SerdeShape): + """Individual policy statement within a resource-based policy""" + + effect: str | None = ... + """Effect of the policy statement (Allow/Deny)""" + principal: dict[str, str] | None = ... + """Principal the statement applies to""" + action: list[str] | None = ... + """Actions the statement controls""" + resource: str | None = ... + """Resource the statement applies to""" + condition: dict[str, dict[str, list[str]]] | None = ... + """Condition block for the statement""" + +@dataclass(kw_only=True) +class PutConsoleAuthorizationConfigurationInput(_SerdeShape): + """Input for PutConsoleAuthorizationConfiguration operation""" + + target_id: str | None = ... + """Target account identifier""" + +@dataclass(kw_only=True) +class PutConsoleAuthorizationConfigurationOutput(_SerdeShape): + """Output for PutConsoleAuthorizationConfiguration operation""" + + target_id: str + """Target account identifier""" + scope: str + """Authorization scope""" + console_authorization_enabled: bool + """Whether console authorization is enabled""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class PutResourcePermissionStatementInput(_SerdeShape): + """Input for PutResourcePermissionStatement operation""" + + source_vpc: str | None = ... + """VPC identifier to restrict console access""" + signin_source_vpce: str | None = ... + """SignIn VPC endpoint identifier""" + console_source_vpce: str | None = ... + """Console VPC endpoint identifier""" + vpc_source_ip: str | None = ... + """Source IP address within VPC""" + source_ip: str | None = ... + """Source IP address""" + requested_region: str | None = ... + """ + AWS region where the VPC and VPC endpoint reside Required when sourceVpc + or signinSourceVpce/consoleSourceVpce is provided + """ + excluded_principal: str | None = ... + """Principal to exclude from the permission statement""" + client_token: str | None = ... + """Idempotency token for the request""" + +@dataclass(kw_only=True) +class PutResourcePermissionStatementOutput(_SerdeShape): + """Output for PutResourcePermissionStatement operation""" + + statement_id: str + """Unique identifier for the created permission statement""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ResourceNotFoundException(ServiceError, _SerdeShape): + """ + Error thrown when requested resource is not found HTTP Status Code: 404 + Not Found Used when the specified resource does not exist + """ + + error: str + """ + OAuth 2.0 error code indicating resource not found Will be + RESOURCE_NOT_FOUND + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class RevokeOAuth2TokenWithIAMInput(_SerdeShape): + """ + Input structure for RevokeOAuth2TokenWithIAM operation RFC 7009 §2.1 + revocation request. Contains the refresh_token to revoke. + """ + + token: str | None = ... + """ + The refresh_token to revoke. Must be a refresh_token issued by AWS + Sign-In (prefix \"ASOR\"); access_tokens are not accepted for + revocation. + """ + +@dataclass(kw_only=True) +class RevokeOAuth2TokenWithIAMOutput(_SerdeShape): + """ + Output structure for RevokeOAuth2TokenWithIAM operation RFC 7009 §2.2 + revocation response. The endpoint returns 200 OK with an empty body on + success; there are no response fields. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ServiceQuotaExceededException(ServiceError, _SerdeShape): + """ + Error thrown when service quota is exceeded HTTP Status Code: 402 + Payment Required (used as quota exceeded indicator) Used when the + request would cause a service quota to be exceeded + """ + + error: str + """ + OAuth 2.0 error code indicating service quota exceeded Will be + SERVICE_QUOTA_EXCEEDED + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class SigninResourceBasedPolicy(_SerdeShape): + """SignIn resource-based policy document""" + + version: str | None = ... + """Policy version""" + statement: list[PolicyStatement] | None = ... + """Policy statements""" + +@dataclass(kw_only=True) +class TooManyRequestsError(ServiceError, _SerdeShape): + """ + Error thrown when rate limit is exceeded HTTP Status Code: 429 Too Many + Requests Possible OAuth2ErrorCode values: - INVALID_REQUEST: Rate + limiting, too many requests, abuse prevention Possible causes: - Too + many token requests from the same client - Rate limiting based on + client_id or IP address - Abuse prevention mechanisms triggered - + Service protection against excessive token generation + """ + + error: str + """ + OAuth 2.0 error code indicating the specific type of error Will be + INVALID_REQUEST for rate limiting scenarios + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ValidationException(ServiceError, _SerdeShape): + """ + Error thrown when request validation fails HTTP Status Code: 400 Bad + Request Used for request validation errors such as malformed parameters, + missing required fields, or invalid parameter values. + """ + + error: str + """ + OAuth 2.0 error code indicating validation failure Will be + INVALID_REQUEST for validation errors + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +CREATE_O_AUTH2_TOKEN: APIOperation[CreateOAuth2TokenInput, CreateOAuth2TokenOutput] +CREATE_O_AUTH2_TOKEN_WITH_IAM: APIOperation[ + CreateOAuth2TokenWithIAMInput, CreateOAuth2TokenWithIAMOutput +] +DELETE_CONSOLE_AUTHORIZATION_CONFIGURATION: APIOperation[ + DeleteConsoleAuthorizationConfigurationInput, + DeleteConsoleAuthorizationConfigurationOutput, +] +DELETE_RESOURCE_PERMISSION_STATEMENT: APIOperation[ + DeleteResourcePermissionStatementInput, DeleteResourcePermissionStatementOutput +] +GET_CONSOLE_AUTHORIZATION_CONFIGURATION: APIOperation[ + GetConsoleAuthorizationConfigurationInput, + GetConsoleAuthorizationConfigurationOutput, +] +GET_RESOURCE_POLICY: APIOperation[GetResourcePolicyInput, GetResourcePolicyOutput] +INTROSPECT_O_AUTH2_TOKEN_WITH_IAM: APIOperation[ + IntrospectOAuth2TokenWithIAMInput, IntrospectOAuth2TokenWithIAMOutput +] +LIST_RESOURCE_PERMISSION_STATEMENTS: APIOperation[ + ListResourcePermissionStatementsInput, ListResourcePermissionStatementsOutput +] +PUT_CONSOLE_AUTHORIZATION_CONFIGURATION: APIOperation[ + PutConsoleAuthorizationConfigurationInput, + PutConsoleAuthorizationConfigurationOutput, +] +PUT_RESOURCE_PERMISSION_STATEMENT: APIOperation[ + PutResourcePermissionStatementInput, PutResourcePermissionStatementOutput +] +REVOKE_O_AUTH2_TOKEN_WITH_IAM: APIOperation[ + RevokeOAuth2TokenWithIAMInput, RevokeOAuth2TokenWithIAMOutput +] diff --git a/clients/aws-sdk-sns/scripts/docs/generate_doc_stubs.py b/clients/aws-sdk-sns/scripts/docs/generate_doc_stubs.py index 52d470bc..795f2e4b 100644 --- a/clients/aws-sdk-sns/scripts/docs/generate_doc_stubs.py +++ b/clients/aws-sdk-sns/scripts/docs/generate_doc_stubs.py @@ -126,7 +126,9 @@ class ClientInfo: class DocStubGenerator: """Generate markdown API Reference stubs for AWS SDK for Python v4 clients.""" - def __init__(self, client_dir: Path, output_dir: Path, service_name: str | None = None) -> None: + def __init__( + self, client_dir: Path, output_dir: Path, service_name: str | None = None + ) -> None: """ Initialize the documentation generator. @@ -190,7 +192,9 @@ def _analyze_client_package(self, package_name: str) -> ClientInfo: required = ("client", "config", "models") missing = [name for name in required if not package.modules.get(name)] if missing: - raise ValueError(f"Missing required modules in {package_name}: {', '.join(missing)}") + raise ValueError( + f"Missing required modules in {package_name}: {', '.join(missing)}" + ) # Parse submodules client_module = package.modules["client"] @@ -199,11 +203,15 @@ def _analyze_client_package(self, package_name: str) -> ClientInfo: client_class = self._find_class_with_suffix(client_module, "Client") if not client_class: - raise ValueError(f"No class ending with 'Client' found in {package_name}.client") + raise ValueError( + f"No class ending with 'Client' found in {package_name}.client" + ) config_class = self._find_class_with_suffix(config_module, "Config") if not config_class: - raise ValueError(f"No class ending with 'Config' found in {package_name}.config") + raise ValueError( + f"No class ending with 'Config' found in {package_name}.config" + ) plugin_alias = config_module.members.get("Plugin") if not plugin_alias: @@ -288,7 +296,9 @@ def _analyze_operation(self, operation: Function) -> OperationInfo: if output_type in stream_type_map: stream_type = stream_type_map[output_type] - stream_args = self._get_subscript_elements(returns, f"'{operation.name}' stream type") + stream_args = self._get_subscript_elements( + returns, f"'{operation.name}' stream type" + ) if stream_type in (StreamType.INPUT, StreamType.DUPLEX): event_input_type = stream_args[0].canonical_name @@ -316,7 +326,9 @@ def _analyze_operation(self, operation: Function) -> OperationInfo: def _get_expr(self, annotation: str | Expr | None, context: str) -> Expr: """Extract and validate an Expr from an annotation.""" if not isinstance(annotation, Expr): - raise TypeError(f"{context}: expected Expr, got {type(annotation).__name__}") + raise TypeError( + f"{context}: expected Expr, got {type(annotation).__name__}" + ) return annotation def _get_subscript_elements(self, expr: Expr, context: str) -> list[Expr]: @@ -330,7 +342,9 @@ def _get_subscript_elements(self, expr: Expr, context: str) -> list[Expr]: return [el for el in slice_expr.elements if isinstance(el, Expr)] return [slice_expr] - def _extract_models(self, models_module: Module, operations: list[OperationInfo]) -> ModelsInfo: + def _extract_models( + self, models_module: Module, operations: list[OperationInfo] + ) -> ModelsInfo: """Extract structures, unions, enums, and errors from models module.""" structures, unions, enums, errors = [], [], [], [] @@ -356,14 +370,16 @@ def _extract_models(self, models_module: Module, operations: list[OperationInfo] duplicates = [] for structure in structures: - if self._is_operation_io_type(structure.name, operations) or self._is_union_member( - structure.name, unions - ): + if self._is_operation_io_type( + structure.name, operations + ) or self._is_union_member(structure.name, unions): duplicates.append(structure) structures = [struct for struct in structures if struct not in duplicates] - return ModelsInfo(structures=structures, unions=unions, enums=enums, errors=errors) + return ModelsInfo( + structures=structures, unions=unions, enums=enums, errors=errors + ) def _is_union(self, member: Object | Alias) -> TypeGuard[Attribute]: """Check if a module member is a union type.""" @@ -399,7 +415,9 @@ def _extract_union_members( for name in member_names: if not (member_object := models_module.members.get(name)): raise ValueError(f"Union member '{name}' not found in models module") - members.append(TypeInfo(name=member_object.name, module_path=member_object.path)) + members.append( + TypeInfo(name=member_object.name, module_path=member_object.path) + ) return members @@ -408,7 +426,8 @@ def _is_enum(self, member: Object | Alias) -> TypeGuard[Class]: if not isinstance(member, Class): return False return any( - isinstance(base, ExprName) and base.name in ENUM_BASE_CLASSES for base in member.bases + isinstance(base, ExprName) and base.name in ENUM_BASE_CLASSES + for base in member.bases ) def _is_error(self, member: Object | Alias) -> TypeGuard[Class]: @@ -416,10 +435,13 @@ def _is_error(self, member: Object | Alias) -> TypeGuard[Class]: if not isinstance(member, Class): return False return any( - isinstance(base, ExprName) and base.name in ERROR_BASE_CLASSES for base in member.bases + isinstance(base, ExprName) and base.name in ERROR_BASE_CLASSES + for base in member.bases ) - def _is_operation_io_type(self, type_name: str, operations: list[OperationInfo]) -> bool: + def _is_operation_io_type( + self, type_name: str, operations: list[OperationInfo] + ) -> bool: """Check if a type is used as operation input/output.""" return any(type_name in (op.input.name, op.output.name) for op in operations) @@ -437,8 +459,12 @@ def _generate_client_docs(self, client_info: ClientInfo) -> bool: self._generate_type_stubs( client_info.models.structures, "structures", "Structure Class" ) - self._generate_type_stubs(client_info.models.errors, "errors", "Error Class") - self._generate_type_stubs(client_info.models.enums, "enums", "Enum Class", members=True) + self._generate_type_stubs( + client_info.models.errors, "errors", "Error Class" + ) + self._generate_type_stubs( + client_info.models.enums, "enums", "Enum Class", members=True + ) self._generate_union_stubs(client_info.models.unions) except OSError as e: logger.error(f"Failed to write documentation files: {e}") @@ -470,7 +496,9 @@ def _generate_index(self, client_info: ClientInfo) -> None: ] for method in sorted(client_info.client_methods, key=lambda x: x.name): - lines.extend([*self._mkdocs_directive(method.module_path, heading_level=4), ""]) + lines.extend( + [*self._mkdocs_directive(method.module_path, heading_level=4), ""] + ) # Operations section if client_info.operations: @@ -578,7 +606,9 @@ def _generate_operation_stubs(self, operations: list[OperationInfo]) -> None: output_path = self.output_dir / "operations" / f"{op.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb("Operations", op.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb("Operations", op.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(operations)} operation file(s)") @@ -600,7 +630,9 @@ def _generate_type_stubs( output_path = self.output_dir / category / f"{item.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb(category.title(), item.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb(category.title(), item.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(items)} {category} file(s)") @@ -624,7 +656,9 @@ def _generate_union_stubs(self, unions: list[UnionInfo]) -> None: output_path = self.output_dir / "unions" / f"{union.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb("Unions", union.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb("Unions", union.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(unions)} union file(s)") diff --git a/clients/aws-sdk-sns/src/aws_sdk_sns/_private/schemas.py b/clients/aws-sdk-sns/src/aws_sdk_sns/_private/schemas.py index b39d6558..7c18f685 100644 --- a/clients/aws-sdk-sns/src/aws_sdk_sns/_private/schemas.py +++ b/clients/aws-sdk-sns/src/aws_sdk_sns/_private/schemas.py @@ -2,2380 +2,2806 @@ from types import MappingProxyType -from smithy_core.prelude import UNIT -from smithy_core.schemas import Schema -from smithy_core.shapes import ShapeID, ShapeType -from smithy_core.traits import Trait - - -ACCOUNT = Schema(id=ShapeID("com.amazonaws.sns#account"), shape_type=ShapeType.STRING) - -ACTION = Schema(id=ShapeID("com.amazonaws.sns#action"), shape_type=ShapeType.STRING) - -ACTIONS_LIST = Schema.collection( - id=ShapeID("com.amazonaws.sns#ActionsList"), - shape_type=ShapeType.LIST, - members={"member": {"target": ACTION}}, -) - -DELEGATE = Schema(id=ShapeID("com.amazonaws.sns#delegate"), shape_type=ShapeType.STRING) - -DELEGATES_LIST = Schema.collection( - id=ShapeID("com.amazonaws.sns#DelegatesList"), - shape_type=ShapeType.LIST, - members={"member": {"target": DELEGATE}}, -) - -LABEL = Schema(id=ShapeID("com.amazonaws.sns#label"), shape_type=ShapeType.STRING) - -TOPIC_ARN = Schema( - id=ShapeID("com.amazonaws.sns#topicARN"), shape_type=ShapeType.STRING -) - -ADD_PERMISSION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#AddPermissionInput"), - members={ - "TopicArn": { - "target": TOPIC_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Label": { - "target": LABEL, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "AWSAccountId": { - "target": DELEGATES_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ActionName": { - "target": ACTIONS_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, +from smithy_core._schema_compact import StaticOperationSchema, StaticSchema + + +n0 = "com.amazonaws.sns" +_a = "account" +_ac = "action" +_AL = "ActionsList" +_m = "member" +_d = "delegate" +_DL = "DelegatesList" +_l = "label" +_tARN = "topicARN" +_API = "AddPermissionInput" +_s = "smithy.api#input" +_TA = "TopicArn" +_sm = "smithy.api#required" +_L = "Label" +_AWSAI = "AWSAccountId" +_AN = "ActionName" +_APO = "AddPermissionOutput" +_sSI = "smithy.synthetic#originalShapeId" +_sU = "smithy.api#Unit" +_smi = "smithy.api#output" +_S = "String" +_AEE = "AuthorizationErrorException" +_smit = "smithy.api#error" +_c = "client" +_sE = "smithy.api#httpError" +_aQE = "aws.protocols#awsQueryError" +_me = "message" +_IEE = "InternalErrorException" +_se = "server" +_IPE = "InvalidParameterException" +_NFE = "NotFoundException" +_AP = "AddPermission" +_ARN = "AmazonResourceName" +_PN = "PhoneNumber" +_smith = "smithy.api#sensitive" +_CIPNIOOI = "CheckIfPhoneNumberIsOptedOutInput" +_pN = "phoneNumber" +_b = "boolean" +_smithy = "smithy.api#default" +_CIPNIOOO = "CheckIfPhoneNumberIsOptedOutOutput" +_cCIPNIOOR = "com.amazonaws.sns#CheckIfPhoneNumberIsOptedOutResponse" +_iOO = "isOptedOut" +_TE = "ThrottledException" +_CIPNIOO = "CheckIfPhoneNumberIsOptedOut" +_aOU = "authenticateOnUnsubscribe" +_t = "token" +_CSI = "ConfirmSubscriptionInput" +_T = "Token" +_AOU = "AuthenticateOnUnsubscribe" +_sARN = "subscriptionARN" +_CSO = "ConfirmSubscriptionOutput" +_cCSR = "com.amazonaws.sns#ConfirmSubscriptionResponse" +_SA = "SubscriptionArn" +_FPLEE = "FilterPolicyLimitExceededException" +_RLEE = "ReplayLimitExceededException" +_SLEE = "SubscriptionLimitExceededException" +_CS = "ConfirmSubscription" +_MSTS = "MapStringToString" +_k = "key" +_v = "value" +_CPAI = "CreatePlatformApplicationInput" +_N = "Name" +_P = "Platform" +_A = "Attributes" +_CPAO = "CreatePlatformApplicationOutput" +_cCPAR = "com.amazonaws.sns#CreatePlatformApplicationResponse" +_PAA = "PlatformApplicationArn" +_CPA = "CreatePlatformApplication" +_CPEI = "CreatePlatformEndpointInput" +_CUD = "CustomUserData" +_CPEO = "CreatePlatformEndpointOutput" +_cCER = "com.amazonaws.sns#CreateEndpointResponse" +_EA = "EndpointArn" +_CPE = "CreatePlatformEndpoint" +_LCS = "LanguageCodeString" +_eU = "en_US" +_sV = "smithy.api#enumValue" +_eU_ = "en-US" +_eG = "en_GB" +_eG_ = "en-GB" +_e = "es_419" +_e_ = "es-419" +_eE = "es_ES" +_eE_ = "es-ES" +_dD = "de_DE" +_dD_ = "de-DE" +_fC = "fr_CA" +_fC_ = "fr-CA" +_fF = "fr_FR" +_fF_ = "fr-FR" +_iI = "it_IT" +_iI_ = "it-IT" +_jJ = "jp_JP" +_jJ_ = "ja-JP" +_pB = "pt_BR" +_pB_ = "pt-BR" +_kK = "kr_KR" +_kK_ = "kr-KR" +_zC = "zh_CN" +_zC_ = "zh-CN" +_zT = "zh_TW" +_zT_ = "zh-TW" +_PNS = "PhoneNumberString" +_CSMSSPNI = "CreateSMSSandboxPhoneNumberInput" +_LC = "LanguageCode" +_CSMSSPNO = "CreateSMSSandboxPhoneNumberOutput" +_cCSMSSPNR = "com.amazonaws.sns#CreateSMSSandboxPhoneNumberResult" +_OOE = "OptedOutException" +_UEE = "UserErrorException" +_CSMSSPN = "CreateSMSSandboxPhoneNumber" +_CAE = "ConcurrentAccessException" +_aN = "attributeName" +_aV = "attributeValue" +_TAM = "TopicAttributesMap" +_tN = "topicName" +_TK = "TagKey" +_TV = "TagValue" +_Ta = "Tag" +_K = "Key" +_V = "Value" +_TL = "TagList" +_CTI = "CreateTopicInput" +_Tag = "Tags" +_DPP = "DataProtectionPolicy" +_CTO = "CreateTopicOutput" +_cCTR = "com.amazonaws.sns#CreateTopicResponse" +_ISE = "InvalidSecurityException" +_STE = "StaleTagException" +_TLEE = "TagLimitExceededException" +_TPE = "TagPolicyException" +_TLEEo = "TopicLimitExceededException" +_CT = "CreateTopic" +_DEI = "DeleteEndpointInput" +_DEO = "DeleteEndpointOutput" +_DE = "DeleteEndpoint" +_DPAI = "DeletePlatformApplicationInput" +_DPAO = "DeletePlatformApplicationOutput" +_DPA = "DeletePlatformApplication" +_DSMSSPNI = "DeleteSMSSandboxPhoneNumberInput" +_DSMSSPNO = "DeleteSMSSandboxPhoneNumberOutput" +_cDSMSSPNR = "com.amazonaws.sns#DeleteSMSSandboxPhoneNumberResult" +_RNFE = "ResourceNotFoundException" +_DSMSSPN = "DeleteSMSSandboxPhoneNumber" +_DTI = "DeleteTopicInput" +_DTO = "DeleteTopicOutput" +_ISEn = "InvalidStateException" +_DT = "DeleteTopic" +_GDPPI = "GetDataProtectionPolicyInput" +_RA = "ResourceArn" +_GDPPO = "GetDataProtectionPolicyOutput" +_cGDPPR = "com.amazonaws.sns#GetDataProtectionPolicyResponse" +_GDPP = "GetDataProtectionPolicy" +_GEAI = "GetEndpointAttributesInput" +_GEAO = "GetEndpointAttributesOutput" +_cGEAR = "com.amazonaws.sns#GetEndpointAttributesResponse" +_GEA = "GetEndpointAttributes" +_GPAAI = "GetPlatformApplicationAttributesInput" +_GPAAO = "GetPlatformApplicationAttributesOutput" +_cGPAAR = "com.amazonaws.sns#GetPlatformApplicationAttributesResponse" +_GPAA = "GetPlatformApplicationAttributes" +_LS = "ListString" +_GSMSAI = "GetSMSAttributesInput" +_at = "attributes" +_GSMSAO = "GetSMSAttributesOutput" +_cGSMSAR = "com.amazonaws.sns#GetSMSAttributesResponse" +_GSMSA = "GetSMSAttributes" +_GSMSSASI = "GetSMSSandboxAccountStatusInput" +_GSMSSASO = "GetSMSSandboxAccountStatusOutput" +_cGSMSSASR = "com.amazonaws.sns#GetSMSSandboxAccountStatusResult" +_IIS = "IsInSandbox" +_GSMSSAS = "GetSMSSandboxAccountStatus" +_GSAI = "GetSubscriptionAttributesInput" +_SAM = "SubscriptionAttributesMap" +_GSAO = "GetSubscriptionAttributesOutput" +_cGSAR = "com.amazonaws.sns#GetSubscriptionAttributesResponse" +_GSA = "GetSubscriptionAttributes" +_GTAI = "GetTopicAttributesInput" +_GTAO = "GetTopicAttributesOutput" +_cGTAR = "com.amazonaws.sns#GetTopicAttributesResponse" +_GTA = "GetTopicAttributes" +_LEBPAI = "ListEndpointsByPlatformApplicationInput" +_NT = "NextToken" +_E = "Endpoint" +_LOE = "ListOfEndpoints" +_LEBPAO = "ListEndpointsByPlatformApplicationOutput" +_cLEBPAR = "com.amazonaws.sns#ListEndpointsByPlatformApplicationResponse" +_En = "Endpoints" +_LEBPA = "ListEndpointsByPlatformApplication" +_MILON = "MaxItemsListOriginationNumbers" +_nT = "nextToken" +_LONI = "ListOriginationNumbersInput" +_cLONR = "com.amazonaws.sns#ListOriginationNumbersRequest" +_MR = "MaxResults" +_Ti = "Timestamp" +_ICC = "Iso2CountryCode" +_NC = "NumberCapability" +_SMS = "SMS" +_MMS = "MMS" +_VOICE = "VOICE" +_NCL = "NumberCapabilityList" +_RT = "RouteType" +_Tr = "Transactional" +_Pr = "Promotional" +_Pre = "Premium" +_PNI = "PhoneNumberInformation" +_CA = "CreatedAt" +_St = "Status" +_NCu = "NumberCapabilities" +_PNIL = "PhoneNumberInformationList" +_LONO = "ListOriginationNumbersOutput" +_cLONRo = "com.amazonaws.sns#ListOriginationNumbersResult" +_PNh = "PhoneNumbers" +_VE = "ValidationException" +_M = "Message" +_LON = "ListOriginationNumbers" +_LPNOOI = "ListPhoneNumbersOptedOutInput" +_PNL = "PhoneNumberList" +_LPNOOO = "ListPhoneNumbersOptedOutOutput" +_cLPNOOR = "com.amazonaws.sns#ListPhoneNumbersOptedOutResponse" +_pNh = "phoneNumbers" +_LPNOO = "ListPhoneNumbersOptedOut" +_LPAI = "ListPlatformApplicationsInput" +_PA = "PlatformApplication" +_LOPA = "ListOfPlatformApplications" +_LPAO = "ListPlatformApplicationsOutput" +_cLPAR = "com.amazonaws.sns#ListPlatformApplicationsResponse" +_PAl = "PlatformApplications" +_LPA = "ListPlatformApplications" +_MI = "MaxItems" +_LSMSSPNI = "ListSMSSandboxPhoneNumbersInput" +_SMSSPNVS = "SMSSandboxPhoneNumberVerificationStatus" +_Pe = "Pending" +_Ve = "Verified" +_SMSSPN = "SMSSandboxPhoneNumber" +_SMSSPNL = "SMSSandboxPhoneNumberList" +_LSMSSPNO = "ListSMSSandboxPhoneNumbersOutput" +_cLSMSSPNR = "com.amazonaws.sns#ListSMSSandboxPhoneNumbersResult" +_LSMSSPN = "ListSMSSandboxPhoneNumbers" +_LSI = "ListSubscriptionsInput" +_End = "Endpoint2" +_p = "protocol" +_Su = "Subscription" +_O = "Owner" +_Pro = "Protocol" +_SL = "SubscriptionsList" +_LSO = "ListSubscriptionsOutput" +_cLSR = "com.amazonaws.sns#ListSubscriptionsResponse" +_Sub = "Subscriptions" +_LSi = "ListSubscriptions" +_LSBTI = "ListSubscriptionsByTopicInput" +_LSBTO = "ListSubscriptionsByTopicOutput" +_cLSBTR = "com.amazonaws.sns#ListSubscriptionsByTopicResponse" +_LSBT = "ListSubscriptionsByTopic" +_LTFRI = "ListTagsForResourceInput" +_cLTFRR = "com.amazonaws.sns#ListTagsForResourceRequest" +_LTFRO = "ListTagsForResourceOutput" +_cLTFRRo = "com.amazonaws.sns#ListTagsForResourceResponse" +_LTFR = "ListTagsForResource" +_LTI = "ListTopicsInput" +_To = "Topic" +_TLo = "TopicsList" +_LTO = "ListTopicsOutput" +_cLTR = "com.amazonaws.sns#ListTopicsResponse" +_Top = "Topics" +_LT = "ListTopics" +_OIPNI = "OptInPhoneNumberInput" +_OIPNO = "OptInPhoneNumberOutput" +_cOIPNR = "com.amazonaws.sns#OptInPhoneNumberResponse" +_OIPN = "OptInPhoneNumber" +_EDE = "EndpointDisabledException" +_IPVE = "InvalidParameterValueException" +_KMSADE = "KMSAccessDeniedException" +_KMSDE = "KMSDisabledException" +_KMSISE = "KMSInvalidStateException" +_KMSNFE = "KMSNotFoundException" +_KMSOIR = "KMSOptInRequired" +_KMSTE = "KMSThrottlingException" +_PADE = "PlatformApplicationDisabledException" +_B = "Binary" +_MAV = "MessageAttributeValue" +_DTa = "DataType" +_SV = "StringValue" +_BV = "BinaryValue" +_MAM = "MessageAttributeMap" +_sN = "smithy.api#xmlName" +_mS = "messageStructure" +_su = "subject" +_PI = "PublishInput" +_TAa = "TargetArn" +_Subj = "Subject" +_MS = "MessageStructure" +_MA = "MessageAttributes" +_MDI = "MessageDeduplicationId" +_MGI = "MessageGroupId" +_mI = "messageId" +_PO = "PublishOutput" +_cPR = "com.amazonaws.sns#PublishResponse" +_MIe = "MessageId" +_SN = "SequenceNumber" +_Pu = "Publish" +_BEINDE = "BatchEntryIdsNotDistinctException" +_BRTLE = "BatchRequestTooLongException" +_EBRE = "EmptyBatchRequestException" +_IBEIE = "InvalidBatchEntryIdException" +_PBRE = "PublishBatchRequestEntry" +_I = "Id" +_PBREL = "PublishBatchRequestEntryList" +_PBI = "PublishBatchInput" +_PBREu = "PublishBatchRequestEntries" +_BREE = "BatchResultErrorEntry" +_C = "Code" +_SF = "SenderFault" +_BREEL = "BatchResultErrorEntryList" +_PBREub = "PublishBatchResultEntry" +_PBRELu = "PublishBatchResultEntryList" +_PBO = "PublishBatchOutput" +_cPBR = "com.amazonaws.sns#PublishBatchResponse" +_Suc = "Successful" +_F = "Failed" +_TMEIBRE = "TooManyEntriesInBatchRequestException" +_PB = "PublishBatch" +_PDPPI = "PutDataProtectionPolicyInput" +_PDPPO = "PutDataProtectionPolicyOutput" +_PDPP = "PutDataProtectionPolicy" +_RPI = "RemovePermissionInput" +_RPO = "RemovePermissionOutput" +_RP = "RemovePermission" +_SEAI = "SetEndpointAttributesInput" +_SEAO = "SetEndpointAttributesOutput" +_SEA = "SetEndpointAttributes" +_SPAAI = "SetPlatformApplicationAttributesInput" +_SPAAO = "SetPlatformApplicationAttributesOutput" +_SPAA = "SetPlatformApplicationAttributes" +_SSMSAI = "SetSMSAttributesInput" +_SSMSAO = "SetSMSAttributesOutput" +_cSSMSAR = "com.amazonaws.sns#SetSMSAttributesResponse" +_SSMSA = "SetSMSAttributes" +_SSAI = "SetSubscriptionAttributesInput" +_ANt = "AttributeName" +_AV = "AttributeValue" +_SSAO = "SetSubscriptionAttributesOutput" +_SSA = "SetSubscriptionAttributes" +_STAI = "SetTopicAttributesInput" +_STAO = "SetTopicAttributesOutput" +_STA = "SetTopicAttributes" +_SI = "SubscribeInput" +_RSA = "ReturnSubscriptionArn" +_SO = "SubscribeOutput" +_cSR = "com.amazonaws.sns#SubscribeResponse" +_Subs = "Subscribe" +_TRI = "TagResourceInput" +_cTRR = "com.amazonaws.sns#TagResourceRequest" +_TRO = "TagResourceOutput" +_cTRRo = "com.amazonaws.sns#TagResourceResponse" +_TR = "TagResource" +_UI = "UnsubscribeInput" +_UO = "UnsubscribeOutput" +_U = "Unsubscribe" +_TKL = "TagKeyList" +_URI = "UntagResourceInput" +_cURR = "com.amazonaws.sns#UntagResourceRequest" +_TKa = "TagKeys" +_URO = "UntagResourceOutput" +_cURRo = "com.amazonaws.sns#UntagResourceResponse" +_UR = "UntagResource" +_VEe = "VerificationException" +_OTPC = "OTPCode" +_VSMSSPNI = "VerifySMSSandboxPhoneNumberInput" +_OTP = "OneTimePassword" +_VSMSSPNO = "VerifySMSSandboxPhoneNumberOutput" +_cVSMSSPNR = "com.amazonaws.sns#VerifySMSSandboxPhoneNumberResult" +_VSMSSPN = "VerifySMSSandboxPhoneNumber" +_ASNS = "AmazonSimpleNotificationService" +_aw = "aws.auth#sigv4" +_aQ = "aws.protocols#awsQuery" +_sB = "smithy.rules#endpointBdd" +_aws = "aws.api#service" +_sNm = "smithy.api#xmlNamespace" + +ACCOUNT: StaticSchema = (3, n0, _a, 0) + +ACTION: StaticSchema = (3, n0, _ac, 0) + +ACTIONS_LIST: StaticSchema = (16, n0, _AL, 0, (_m,), ((ACTION, 0),)) + +DELEGATE: StaticSchema = (3, n0, _d, 0) + +DELEGATES_LIST: StaticSchema = (16, n0, _DL, 0, (_m,), ((DELEGATE, 0),)) + +LABEL: StaticSchema = (3, n0, _l, 0) + +TOPIC_ARN: StaticSchema = (3, n0, _tARN, 0) + +ADD_PERMISSION_INPUT: StaticSchema = ( + 18, + n0, + _API, + {_s: None}, + (_TA, _L, _AWSAI, _AN), + ((TOPIC_ARN, 1), (LABEL, 1), (DELEGATES_LIST, 1), (ACTIONS_LIST, 1)), +) + +ADD_PERMISSION_OUTPUT: StaticSchema = (18, n0, _APO, {_sSI: _sU, _smi: None}) + +STRING: StaticSchema = (3, n0, _S, 0) + +AUTHORIZATION_ERROR_EXCEPTION: StaticSchema = ( + 18, + n0, + _AEE, + { + _smit: _c, + _sE: 403, + _aQE: MappingProxyType({"code": "AuthorizationError", "httpResponseCode": 403}), }, -) - -ADD_PERMISSION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#AddPermissionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -STRING = Schema(id=ShapeID("com.amazonaws.sns#String"), shape_type=ShapeType.STRING) - -AUTHORIZATION_ERROR_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.sns#AuthorizationErrorException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=403), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "AuthorizationError", "httpResponseCode": 403} - ), - ), - ], - members={"message": {"target": STRING}}, -) - -INTERNAL_ERROR_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.sns#InternalErrorException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="server"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=500), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType({"code": "InternalError", "httpResponseCode": 500}), - ), - ], - members={"message": {"target": STRING}}, -) - -INVALID_PARAMETER_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.sns#InvalidParameterException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "InvalidParameter", "httpResponseCode": 400} - ), - ), - ], - members={"message": {"target": STRING}}, -) - -NOT_FOUND_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.sns#NotFoundException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=404), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType({"code": "NotFound", "httpResponseCode": 404}), - ), - ], - members={"message": {"target": STRING}}, -) - -ADD_PERMISSION = Schema( - id=ShapeID("com.amazonaws.sns#AddPermission"), shape_type=ShapeType.OPERATION -) - -AMAZON_RESOURCE_NAME = Schema( - id=ShapeID("com.amazonaws.sns#AmazonResourceName"), shape_type=ShapeType.STRING -) - -PHONE_NUMBER = Schema( - id=ShapeID("com.amazonaws.sns#PhoneNumber"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -CHECK_IF_PHONE_NUMBER_IS_OPTED_OUT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#CheckIfPhoneNumberIsOptedOutInput"), - members={ - "phoneNumber": { - "target": PHONE_NUMBER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } + (_me,), + ((STRING, 0),), +) + +INTERNAL_ERROR_EXCEPTION: StaticSchema = ( + 18, + n0, + _IEE, + { + _smit: _se, + _sE: 500, + _aQE: MappingProxyType({"code": "InternalError", "httpResponseCode": 500}), }, -) - -BOOLEAN = Schema( - id=ShapeID("com.amazonaws.sns#boolean"), - shape_type=ShapeType.BOOLEAN, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=False)], -) - -CHECK_IF_PHONE_NUMBER_IS_OPTED_OUT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#CheckIfPhoneNumberIsOptedOutOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sns#CheckIfPhoneNumberIsOptedOutResponse", - ) - ], - members={ - "isOptedOut": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - } + (_me,), + ((STRING, 0),), +) + +INVALID_PARAMETER_EXCEPTION: StaticSchema = ( + 18, + n0, + _IPE, + { + _smit: _c, + _sE: 400, + _aQE: MappingProxyType({"code": "InvalidParameter", "httpResponseCode": 400}), }, -) - -THROTTLED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.sns#ThrottledException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=429), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType({"code": "Throttled", "httpResponseCode": 429}), - ), - ], - members={"message": {"target": STRING}}, -) - -CHECK_IF_PHONE_NUMBER_IS_OPTED_OUT = Schema( - id=ShapeID("com.amazonaws.sns#CheckIfPhoneNumberIsOptedOut"), - shape_type=ShapeType.OPERATION, -) - -AUTHENTICATE_ON_UNSUBSCRIBE = Schema( - id=ShapeID("com.amazonaws.sns#authenticateOnUnsubscribe"), - shape_type=ShapeType.STRING, -) - -TOKEN = Schema(id=ShapeID("com.amazonaws.sns#token"), shape_type=ShapeType.STRING) - -CONFIRM_SUBSCRIPTION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#ConfirmSubscriptionInput"), - members={ - "TopicArn": { - "target": TOPIC_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Token": { - "target": TOKEN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "AuthenticateOnUnsubscribe": {"target": AUTHENTICATE_ON_UNSUBSCRIBE}, + (_me,), + ((STRING, 0),), +) + +NOT_FOUND_EXCEPTION: StaticSchema = ( + 18, + n0, + _NFE, + { + _smit: _c, + _sE: 404, + _aQE: MappingProxyType({"code": "NotFound", "httpResponseCode": 404}), }, -) - -SUBSCRIPTION_ARN = Schema( - id=ShapeID("com.amazonaws.sns#subscriptionARN"), shape_type=ShapeType.STRING -) - -CONFIRM_SUBSCRIPTION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#ConfirmSubscriptionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sns#ConfirmSubscriptionResponse", - ) - ], - members={"SubscriptionArn": {"target": SUBSCRIPTION_ARN}}, -) - -FILTER_POLICY_LIMIT_EXCEEDED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.sns#FilterPolicyLimitExceededException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=403), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "FilterPolicyLimitExceeded", "httpResponseCode": 403} - ), - ), - ], - members={"message": {"target": STRING}}, -) - -REPLAY_LIMIT_EXCEEDED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.sns#ReplayLimitExceededException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=403), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "ReplayLimitExceeded", "httpResponseCode": 403} - ), - ), - ], - members={"message": {"target": STRING}}, -) - -SUBSCRIPTION_LIMIT_EXCEEDED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.sns#SubscriptionLimitExceededException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=403), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "SubscriptionLimitExceeded", "httpResponseCode": 403} - ), - ), - ], - members={"message": {"target": STRING}}, -) - -CONFIRM_SUBSCRIPTION = Schema( - id=ShapeID("com.amazonaws.sns#ConfirmSubscription"), shape_type=ShapeType.OPERATION -) - -MAP_STRING_TO_STRING = Schema.collection( - id=ShapeID("com.amazonaws.sns#MapStringToString"), - shape_type=ShapeType.MAP, - members={"key": {"target": STRING}, "value": {"target": STRING}}, -) - -CREATE_PLATFORM_APPLICATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#CreatePlatformApplicationInput"), - members={ - "Name": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Platform": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Attributes": { - "target": MAP_STRING_TO_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -CREATE_PLATFORM_APPLICATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#CreatePlatformApplicationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sns#CreatePlatformApplicationResponse", - ) - ], - members={"PlatformApplicationArn": {"target": STRING}}, -) - -CREATE_PLATFORM_APPLICATION = Schema( - id=ShapeID("com.amazonaws.sns#CreatePlatformApplication"), - shape_type=ShapeType.OPERATION, -) - -CREATE_PLATFORM_ENDPOINT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#CreatePlatformEndpointInput"), - members={ - "PlatformApplicationArn": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Token": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "CustomUserData": {"target": STRING}, - "Attributes": {"target": MAP_STRING_TO_STRING}, - }, -) - -CREATE_PLATFORM_ENDPOINT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#CreatePlatformEndpointOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sns#CreateEndpointResponse", - ) - ], - members={"EndpointArn": {"target": STRING}}, -) - -CREATE_PLATFORM_ENDPOINT = Schema( - id=ShapeID("com.amazonaws.sns#CreatePlatformEndpoint"), - shape_type=ShapeType.OPERATION, -) - -LANGUAGE_CODE_STRING = Schema.collection( - id=ShapeID("com.amazonaws.sns#LanguageCodeString"), - shape_type=ShapeType.ENUM, - members={ - "en_US": {"target": UNIT}, - "en_GB": {"target": UNIT}, - "es_419": {"target": UNIT}, - "es_ES": {"target": UNIT}, - "de_DE": {"target": UNIT}, - "fr_CA": {"target": UNIT}, - "fr_FR": {"target": UNIT}, - "it_IT": {"target": UNIT}, - "jp_JP": {"target": UNIT}, - "pt_BR": {"target": UNIT}, - "kr_KR": {"target": UNIT}, - "zh_CN": {"target": UNIT}, - "zh_TW": {"target": UNIT}, - }, -) - -PHONE_NUMBER_STRING = Schema( - id=ShapeID("com.amazonaws.sns#PhoneNumberString"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -CREATE_SMS_SANDBOX_PHONE_NUMBER_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#CreateSMSSandboxPhoneNumberInput"), - members={ - "PhoneNumber": { - "target": PHONE_NUMBER_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "LanguageCode": {"target": LANGUAGE_CODE_STRING}, + (_me,), + ((STRING, 0),), +) + +ADD_PERMISSION: StaticOperationSchema = ( + 23, + n0, + _AP, + 0, + ADD_PERMISSION_INPUT, + ADD_PERMISSION_OUTPUT, + ( + AUTHORIZATION_ERROR_EXCEPTION, + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + NOT_FOUND_EXCEPTION, + ), +) + +AMAZON_RESOURCE_NAME: StaticSchema = (3, n0, _ARN, 0) + +PHONE_NUMBER: StaticSchema = (3, n0, _PN, 4) + +CHECK_IF_PHONE_NUMBER_IS_OPTED_OUT_INPUT: StaticSchema = ( + 18, + n0, + _CIPNIOOI, + {_s: None}, + (_pN,), + ((PHONE_NUMBER, 1),), +) + +BOOLEAN: StaticSchema = (2, n0, _b, {_smithy: False}) + +CHECK_IF_PHONE_NUMBER_IS_OPTED_OUT_OUTPUT: StaticSchema = ( + 18, + n0, + _CIPNIOOO, + {_sSI: _cCIPNIOOR, _smi: None}, + (_iOO,), + ((BOOLEAN, {_smithy: False}),), +) + +THROTTLED_EXCEPTION: StaticSchema = ( + 18, + n0, + _TE, + { + _smit: _c, + _sE: 429, + _aQE: MappingProxyType({"code": "Throttled", "httpResponseCode": 429}), }, -) - -CREATE_SMS_SANDBOX_PHONE_NUMBER_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#CreateSMSSandboxPhoneNumberOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sns#CreateSMSSandboxPhoneNumberResult", - ) - ], -) - -OPTED_OUT_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.sns#OptedOutException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType({"code": "OptedOut", "httpResponseCode": 400}), - ), - ], - members={"message": {"target": STRING}}, -) - -USER_ERROR_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.sns#UserErrorException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType({"code": "UserError", "httpResponseCode": 400}), + (_me,), + ((STRING, 0),), +) + +CHECK_IF_PHONE_NUMBER_IS_OPTED_OUT: StaticOperationSchema = ( + 23, + n0, + _CIPNIOO, + 0, + CHECK_IF_PHONE_NUMBER_IS_OPTED_OUT_INPUT, + CHECK_IF_PHONE_NUMBER_IS_OPTED_OUT_OUTPUT, + ( + AUTHORIZATION_ERROR_EXCEPTION, + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + THROTTLED_EXCEPTION, + ), +) + +AUTHENTICATE_ON_UNSUBSCRIBE: StaticSchema = (3, n0, _aOU, 0) + +TOKEN: StaticSchema = (3, n0, _t, 0) + +CONFIRM_SUBSCRIPTION_INPUT: StaticSchema = ( + 18, + n0, + _CSI, + {_s: None}, + (_TA, _T, _AOU), + ((TOPIC_ARN, 1), (TOKEN, 1), (AUTHENTICATE_ON_UNSUBSCRIBE, 0)), +) + +SUBSCRIPTION_ARN: StaticSchema = (3, n0, _sARN, 0) + +CONFIRM_SUBSCRIPTION_OUTPUT: StaticSchema = ( + 18, + n0, + _CSO, + {_sSI: _cCSR, _smi: None}, + (_SA,), + ((SUBSCRIPTION_ARN, 0),), +) + +FILTER_POLICY_LIMIT_EXCEEDED_EXCEPTION: StaticSchema = ( + 18, + n0, + _FPLEE, + { + _smit: _c, + _sE: 403, + _aQE: MappingProxyType( + {"code": "FilterPolicyLimitExceeded", "httpResponseCode": 403} ), - ], - members={"message": {"target": STRING}}, -) - -CREATE_SMS_SANDBOX_PHONE_NUMBER = Schema( - id=ShapeID("com.amazonaws.sns#CreateSMSSandboxPhoneNumber"), - shape_type=ShapeType.OPERATION, -) - -CONCURRENT_ACCESS_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.sns#ConcurrentAccessException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "ConcurrentAccess", "httpResponseCode": 400} - ), - ), - ], - members={"message": {"target": STRING}}, -) - -ATTRIBUTE_NAME = Schema( - id=ShapeID("com.amazonaws.sns#attributeName"), shape_type=ShapeType.STRING -) - -ATTRIBUTE_VALUE = Schema( - id=ShapeID("com.amazonaws.sns#attributeValue"), shape_type=ShapeType.STRING -) - -TOPIC_ATTRIBUTES_MAP = Schema.collection( - id=ShapeID("com.amazonaws.sns#TopicAttributesMap"), - shape_type=ShapeType.MAP, - members={"key": {"target": ATTRIBUTE_NAME}, "value": {"target": ATTRIBUTE_VALUE}}, -) - -TOPIC_NAME = Schema( - id=ShapeID("com.amazonaws.sns#topicName"), shape_type=ShapeType.STRING -) - -TAG_KEY = Schema(id=ShapeID("com.amazonaws.sns#TagKey"), shape_type=ShapeType.STRING) - -TAG_VALUE = Schema( - id=ShapeID("com.amazonaws.sns#TagValue"), shape_type=ShapeType.STRING -) - -TAG = Schema.collection( - id=ShapeID("com.amazonaws.sns#Tag"), - members={ - "Key": { - "target": TAG_KEY, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Value": { - "target": TAG_VALUE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -TAG_LIST = Schema.collection( - id=ShapeID("com.amazonaws.sns#TagList"), - shape_type=ShapeType.LIST, - members={"member": {"target": TAG}}, -) - -CREATE_TOPIC_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#CreateTopicInput"), - members={ - "Name": { - "target": TOPIC_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Attributes": {"target": TOPIC_ATTRIBUTES_MAP}, - "Tags": {"target": TAG_LIST}, - "DataProtectionPolicy": {"target": ATTRIBUTE_VALUE}, }, -) - -CREATE_TOPIC_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#CreateTopicOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sns#CreateTopicResponse", - ) - ], - members={"TopicArn": {"target": TOPIC_ARN}}, -) - -INVALID_SECURITY_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.sns#InvalidSecurityException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=403), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "InvalidSecurity", "httpResponseCode": 403} - ), - ), - ], - members={"message": {"target": STRING}}, -) - -STALE_TAG_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.sns#StaleTagException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType({"code": "StaleTag", "httpResponseCode": 400}), - ), - ], - members={"message": {"target": STRING}}, -) - -TAG_LIMIT_EXCEEDED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.sns#TagLimitExceededException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "TagLimitExceeded", "httpResponseCode": 400} - ), - ), - ], - members={"message": {"target": STRING}}, -) - -TAG_POLICY_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.sns#TagPolicyException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType({"code": "TagPolicy", "httpResponseCode": 400}), - ), - ], - members={"message": {"target": STRING}}, -) - -TOPIC_LIMIT_EXCEEDED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.sns#TopicLimitExceededException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=403), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "TopicLimitExceeded", "httpResponseCode": 403} - ), + (_me,), + ((STRING, 0),), +) + +REPLAY_LIMIT_EXCEEDED_EXCEPTION: StaticSchema = ( + 18, + n0, + _RLEE, + { + _smit: _c, + _sE: 403, + _aQE: MappingProxyType( + {"code": "ReplayLimitExceeded", "httpResponseCode": 403} ), - ], - members={"message": {"target": STRING}}, -) - -CREATE_TOPIC = Schema( - id=ShapeID("com.amazonaws.sns#CreateTopic"), shape_type=ShapeType.OPERATION -) - -DELETE_ENDPOINT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#DeleteEndpointInput"), - members={ - "EndpointArn": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -DELETE_ENDPOINT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#DeleteEndpointOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -DELETE_ENDPOINT = Schema( - id=ShapeID("com.amazonaws.sns#DeleteEndpoint"), shape_type=ShapeType.OPERATION -) - -DELETE_PLATFORM_APPLICATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#DeletePlatformApplicationInput"), - members={ - "PlatformApplicationArn": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } }, -) - -DELETE_PLATFORM_APPLICATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#DeletePlatformApplicationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -DELETE_PLATFORM_APPLICATION = Schema( - id=ShapeID("com.amazonaws.sns#DeletePlatformApplication"), - shape_type=ShapeType.OPERATION, -) - -DELETE_SMS_SANDBOX_PHONE_NUMBER_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#DeleteSMSSandboxPhoneNumberInput"), - members={ - "PhoneNumber": { - "target": PHONE_NUMBER_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -DELETE_SMS_SANDBOX_PHONE_NUMBER_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#DeleteSMSSandboxPhoneNumberOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sns#DeleteSMSSandboxPhoneNumberResult", - ) - ], -) - -RESOURCE_NOT_FOUND_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.sns#ResourceNotFoundException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=404), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "ResourceNotFound", "httpResponseCode": 404} - ), + (_me,), + ((STRING, 0),), +) + +SUBSCRIPTION_LIMIT_EXCEEDED_EXCEPTION: StaticSchema = ( + 18, + n0, + _SLEE, + { + _smit: _c, + _sE: 403, + _aQE: MappingProxyType( + {"code": "SubscriptionLimitExceeded", "httpResponseCode": 403} ), - ], - members={"message": {"target": STRING}}, -) - -DELETE_SMS_SANDBOX_PHONE_NUMBER = Schema( - id=ShapeID("com.amazonaws.sns#DeleteSMSSandboxPhoneNumber"), - shape_type=ShapeType.OPERATION, -) - -DELETE_TOPIC_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#DeleteTopicInput"), - members={ - "TopicArn": { - "target": TOPIC_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -DELETE_TOPIC_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#DeleteTopicOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -INVALID_STATE_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.sns#InvalidStateException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType({"code": "InvalidState", "httpResponseCode": 400}), - ), - ], - members={"message": {"target": STRING}}, -) - -DELETE_TOPIC = Schema( - id=ShapeID("com.amazonaws.sns#DeleteTopic"), shape_type=ShapeType.OPERATION -) - -GET_DATA_PROTECTION_POLICY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#GetDataProtectionPolicyInput"), - members={ - "ResourceArn": { - "target": TOPIC_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -GET_DATA_PROTECTION_POLICY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#GetDataProtectionPolicyOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sns#GetDataProtectionPolicyResponse", - ) - ], - members={"DataProtectionPolicy": {"target": ATTRIBUTE_VALUE}}, -) - -GET_DATA_PROTECTION_POLICY = Schema( - id=ShapeID("com.amazonaws.sns#GetDataProtectionPolicy"), - shape_type=ShapeType.OPERATION, -) - -GET_ENDPOINT_ATTRIBUTES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#GetEndpointAttributesInput"), - members={ - "EndpointArn": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -GET_ENDPOINT_ATTRIBUTES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#GetEndpointAttributesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sns#GetEndpointAttributesResponse", - ) - ], - members={"Attributes": {"target": MAP_STRING_TO_STRING}}, -) - -GET_ENDPOINT_ATTRIBUTES = Schema( - id=ShapeID("com.amazonaws.sns#GetEndpointAttributes"), - shape_type=ShapeType.OPERATION, -) - -GET_PLATFORM_APPLICATION_ATTRIBUTES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#GetPlatformApplicationAttributesInput"), - members={ - "PlatformApplicationArn": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -GET_PLATFORM_APPLICATION_ATTRIBUTES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#GetPlatformApplicationAttributesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sns#GetPlatformApplicationAttributesResponse", - ) - ], - members={"Attributes": {"target": MAP_STRING_TO_STRING}}, -) - -GET_PLATFORM_APPLICATION_ATTRIBUTES = Schema( - id=ShapeID("com.amazonaws.sns#GetPlatformApplicationAttributes"), - shape_type=ShapeType.OPERATION, -) - -LIST_STRING = Schema.collection( - id=ShapeID("com.amazonaws.sns#ListString"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, -) - -GET_SMS_ATTRIBUTES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#GetSMSAttributesInput"), - members={"attributes": {"target": LIST_STRING}}, -) - -GET_SMS_ATTRIBUTES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#GetSMSAttributesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sns#GetSMSAttributesResponse", - ) - ], - members={"attributes": {"target": MAP_STRING_TO_STRING}}, -) - -GET_SMS_ATTRIBUTES = Schema( - id=ShapeID("com.amazonaws.sns#GetSMSAttributes"), shape_type=ShapeType.OPERATION -) - -GET_SMS_SANDBOX_ACCOUNT_STATUS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#GetSMSSandboxAccountStatusInput") -) - -GET_SMS_SANDBOX_ACCOUNT_STATUS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#GetSMSSandboxAccountStatusOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sns#GetSMSSandboxAccountStatusResult", - ) - ], - members={ - "IsInSandbox": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=False), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, -) - -GET_SMS_SANDBOX_ACCOUNT_STATUS = Schema( - id=ShapeID("com.amazonaws.sns#GetSMSSandboxAccountStatus"), - shape_type=ShapeType.OPERATION, -) - -GET_SUBSCRIPTION_ATTRIBUTES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#GetSubscriptionAttributesInput"), - members={ - "SubscriptionArn": { - "target": SUBSCRIPTION_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -SUBSCRIPTION_ATTRIBUTES_MAP = Schema.collection( - id=ShapeID("com.amazonaws.sns#SubscriptionAttributesMap"), - shape_type=ShapeType.MAP, - members={"key": {"target": ATTRIBUTE_NAME}, "value": {"target": ATTRIBUTE_VALUE}}, -) - -GET_SUBSCRIPTION_ATTRIBUTES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#GetSubscriptionAttributesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sns#GetSubscriptionAttributesResponse", - ) - ], - members={"Attributes": {"target": SUBSCRIPTION_ATTRIBUTES_MAP}}, -) - -GET_SUBSCRIPTION_ATTRIBUTES = Schema( - id=ShapeID("com.amazonaws.sns#GetSubscriptionAttributes"), - shape_type=ShapeType.OPERATION, -) - -GET_TOPIC_ATTRIBUTES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#GetTopicAttributesInput"), - members={ - "TopicArn": { - "target": TOPIC_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -GET_TOPIC_ATTRIBUTES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#GetTopicAttributesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sns#GetTopicAttributesResponse", - ) - ], - members={"Attributes": {"target": TOPIC_ATTRIBUTES_MAP}}, -) - -GET_TOPIC_ATTRIBUTES = Schema( - id=ShapeID("com.amazonaws.sns#GetTopicAttributes"), shape_type=ShapeType.OPERATION -) - -LIST_ENDPOINTS_BY_PLATFORM_APPLICATION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#ListEndpointsByPlatformApplicationInput"), - members={ - "PlatformApplicationArn": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "NextToken": {"target": STRING}, - }, -) - -ENDPOINT = Schema.collection( - id=ShapeID("com.amazonaws.sns#Endpoint"), - members={ - "EndpointArn": {"target": STRING}, - "Attributes": {"target": MAP_STRING_TO_STRING}, - }, -) - -LIST_OF_ENDPOINTS = Schema.collection( - id=ShapeID("com.amazonaws.sns#ListOfEndpoints"), - shape_type=ShapeType.LIST, - members={"member": {"target": ENDPOINT}}, -) - -LIST_ENDPOINTS_BY_PLATFORM_APPLICATION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#ListEndpointsByPlatformApplicationOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sns#ListEndpointsByPlatformApplicationResponse", - ) - ], - members={ - "Endpoints": {"target": LIST_OF_ENDPOINTS}, - "NextToken": {"target": STRING}, - }, -) - -LIST_ENDPOINTS_BY_PLATFORM_APPLICATION = Schema( - id=ShapeID("com.amazonaws.sns#ListEndpointsByPlatformApplication"), - shape_type=ShapeType.OPERATION, -) - -MAX_ITEMS_LIST_ORIGINATION_NUMBERS = Schema( - id=ShapeID("com.amazonaws.sns#MaxItemsListOriginationNumbers"), - shape_type=ShapeType.INTEGER, -) - -NEXT_TOKEN = Schema( - id=ShapeID("com.amazonaws.sns#nextToken"), shape_type=ShapeType.STRING -) - -LIST_ORIGINATION_NUMBERS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#ListOriginationNumbersInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sns#ListOriginationNumbersRequest", - ) - ], - members={ - "NextToken": {"target": NEXT_TOKEN}, - "MaxResults": {"target": MAX_ITEMS_LIST_ORIGINATION_NUMBERS}, - }, -) - -TIMESTAMP = Schema( - id=ShapeID("com.amazonaws.sns#Timestamp"), shape_type=ShapeType.TIMESTAMP -) - -ISO2_COUNTRY_CODE = Schema( - id=ShapeID("com.amazonaws.sns#Iso2CountryCode"), shape_type=ShapeType.STRING -) - -NUMBER_CAPABILITY = Schema.collection( - id=ShapeID("com.amazonaws.sns#NumberCapability"), - shape_type=ShapeType.ENUM, - members={ - "SMS": {"target": UNIT}, - "MMS": {"target": UNIT}, - "VOICE": {"target": UNIT}, - }, -) - -NUMBER_CAPABILITY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.sns#NumberCapabilityList"), - shape_type=ShapeType.LIST, - members={"member": {"target": NUMBER_CAPABILITY}}, -) - -ROUTE_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.sns#RouteType"), - shape_type=ShapeType.ENUM, - members={ - "Transactional": {"target": UNIT}, - "Promotional": {"target": UNIT}, - "Premium": {"target": UNIT}, - }, -) - -PHONE_NUMBER_INFORMATION = Schema.collection( - id=ShapeID("com.amazonaws.sns#PhoneNumberInformation"), - members={ - "CreatedAt": {"target": TIMESTAMP}, - "PhoneNumber": {"target": PHONE_NUMBER}, - "Status": {"target": STRING}, - "Iso2CountryCode": {"target": ISO2_COUNTRY_CODE}, - "RouteType": {"target": ROUTE_TYPE}, - "NumberCapabilities": {"target": NUMBER_CAPABILITY_LIST}, - }, -) - -PHONE_NUMBER_INFORMATION_LIST = Schema.collection( - id=ShapeID("com.amazonaws.sns#PhoneNumberInformationList"), - shape_type=ShapeType.LIST, - members={"member": {"target": PHONE_NUMBER_INFORMATION}}, -) - -LIST_ORIGINATION_NUMBERS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#ListOriginationNumbersOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sns#ListOriginationNumbersResult", - ) - ], - members={ - "NextToken": {"target": NEXT_TOKEN}, - "PhoneNumbers": {"target": PHONE_NUMBER_INFORMATION_LIST}, - }, -) - -VALIDATION_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.sns#ValidationException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "ValidationException", "httpResponseCode": 400} - ), - ), - ], - members={ - "Message": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -LIST_ORIGINATION_NUMBERS = Schema( - id=ShapeID("com.amazonaws.sns#ListOriginationNumbers"), - shape_type=ShapeType.OPERATION, -) - -LIST_PHONE_NUMBERS_OPTED_OUT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#ListPhoneNumbersOptedOutInput"), - members={"nextToken": {"target": STRING}}, -) - -PHONE_NUMBER_LIST = Schema.collection( - id=ShapeID("com.amazonaws.sns#PhoneNumberList"), - shape_type=ShapeType.LIST, - members={"member": {"target": PHONE_NUMBER}}, -) - -LIST_PHONE_NUMBERS_OPTED_OUT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#ListPhoneNumbersOptedOutOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sns#ListPhoneNumbersOptedOutResponse", - ) - ], - members={ - "phoneNumbers": {"target": PHONE_NUMBER_LIST}, - "nextToken": {"target": STRING}, - }, -) - -LIST_PHONE_NUMBERS_OPTED_OUT = Schema( - id=ShapeID("com.amazonaws.sns#ListPhoneNumbersOptedOut"), - shape_type=ShapeType.OPERATION, -) - -LIST_PLATFORM_APPLICATIONS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#ListPlatformApplicationsInput"), - members={"NextToken": {"target": STRING}}, -) - -PLATFORM_APPLICATION = Schema.collection( - id=ShapeID("com.amazonaws.sns#PlatformApplication"), - members={ - "PlatformApplicationArn": {"target": STRING}, - "Attributes": {"target": MAP_STRING_TO_STRING}, - }, -) - -LIST_OF_PLATFORM_APPLICATIONS = Schema.collection( - id=ShapeID("com.amazonaws.sns#ListOfPlatformApplications"), - shape_type=ShapeType.LIST, - members={"member": {"target": PLATFORM_APPLICATION}}, -) - -LIST_PLATFORM_APPLICATIONS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#ListPlatformApplicationsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sns#ListPlatformApplicationsResponse", - ) - ], - members={ - "PlatformApplications": {"target": LIST_OF_PLATFORM_APPLICATIONS}, - "NextToken": {"target": STRING}, - }, -) - -LIST_PLATFORM_APPLICATIONS = Schema( - id=ShapeID("com.amazonaws.sns#ListPlatformApplications"), - shape_type=ShapeType.OPERATION, -) - -MAX_ITEMS = Schema( - id=ShapeID("com.amazonaws.sns#MaxItems"), shape_type=ShapeType.INTEGER -) - -LIST_SMS_SANDBOX_PHONE_NUMBERS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#ListSMSSandboxPhoneNumbersInput"), - members={"NextToken": {"target": NEXT_TOKEN}, "MaxResults": {"target": MAX_ITEMS}}, -) - -SMS_SANDBOX_PHONE_NUMBER_VERIFICATION_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.sns#SMSSandboxPhoneNumberVerificationStatus"), - shape_type=ShapeType.ENUM, - members={"Pending": {"target": UNIT}, "Verified": {"target": UNIT}}, -) - -SMS_SANDBOX_PHONE_NUMBER = Schema.collection( - id=ShapeID("com.amazonaws.sns#SMSSandboxPhoneNumber"), - members={ - "PhoneNumber": {"target": PHONE_NUMBER_STRING}, - "Status": {"target": SMS_SANDBOX_PHONE_NUMBER_VERIFICATION_STATUS}, - }, -) - -SMS_SANDBOX_PHONE_NUMBER_LIST = Schema.collection( - id=ShapeID("com.amazonaws.sns#SMSSandboxPhoneNumberList"), - shape_type=ShapeType.LIST, - members={"member": {"target": SMS_SANDBOX_PHONE_NUMBER}}, -) - -LIST_SMS_SANDBOX_PHONE_NUMBERS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#ListSMSSandboxPhoneNumbersOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sns#ListSMSSandboxPhoneNumbersResult", - ) - ], - members={ - "PhoneNumbers": { - "target": SMS_SANDBOX_PHONE_NUMBER_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "NextToken": {"target": STRING}, - }, -) - -LIST_SMS_SANDBOX_PHONE_NUMBERS = Schema( - id=ShapeID("com.amazonaws.sns#ListSMSSandboxPhoneNumbers"), - shape_type=ShapeType.OPERATION, -) - -LIST_SUBSCRIPTIONS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#ListSubscriptionsInput"), - members={"NextToken": {"target": NEXT_TOKEN}}, -) - -ENDPOINT2 = Schema( - id=ShapeID("com.amazonaws.sns#Endpoint2"), shape_type=ShapeType.STRING -) - -PROTOCOL = Schema(id=ShapeID("com.amazonaws.sns#protocol"), shape_type=ShapeType.STRING) - -SUBSCRIPTION = Schema.collection( - id=ShapeID("com.amazonaws.sns#Subscription"), - members={ - "SubscriptionArn": {"target": SUBSCRIPTION_ARN}, - "Owner": {"target": ACCOUNT}, - "Protocol": {"target": PROTOCOL}, - "Endpoint": {"target": ENDPOINT2}, - "TopicArn": {"target": TOPIC_ARN}, - }, -) - -SUBSCRIPTIONS_LIST = Schema.collection( - id=ShapeID("com.amazonaws.sns#SubscriptionsList"), - shape_type=ShapeType.LIST, - members={"member": {"target": SUBSCRIPTION}}, -) - -LIST_SUBSCRIPTIONS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#ListSubscriptionsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sns#ListSubscriptionsResponse", - ) - ], - members={ - "Subscriptions": {"target": SUBSCRIPTIONS_LIST}, - "NextToken": {"target": NEXT_TOKEN}, - }, -) - -LIST_SUBSCRIPTIONS = Schema( - id=ShapeID("com.amazonaws.sns#ListSubscriptions"), shape_type=ShapeType.OPERATION -) - -LIST_SUBSCRIPTIONS_BY_TOPIC_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#ListSubscriptionsByTopicInput"), - members={ - "TopicArn": { - "target": TOPIC_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "NextToken": {"target": NEXT_TOKEN}, - }, -) - -LIST_SUBSCRIPTIONS_BY_TOPIC_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#ListSubscriptionsByTopicOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sns#ListSubscriptionsByTopicResponse", - ) - ], - members={ - "Subscriptions": {"target": SUBSCRIPTIONS_LIST}, - "NextToken": {"target": NEXT_TOKEN}, - }, -) - -LIST_SUBSCRIPTIONS_BY_TOPIC = Schema( - id=ShapeID("com.amazonaws.sns#ListSubscriptionsByTopic"), - shape_type=ShapeType.OPERATION, -) - -LIST_TAGS_FOR_RESOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#ListTagsForResourceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sns#ListTagsForResourceRequest", - ) - ], - members={ - "ResourceArn": { - "target": AMAZON_RESOURCE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -LIST_TAGS_FOR_RESOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#ListTagsForResourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sns#ListTagsForResourceResponse", - ) - ], - members={"Tags": {"target": TAG_LIST}}, -) - -LIST_TAGS_FOR_RESOURCE = Schema( - id=ShapeID("com.amazonaws.sns#ListTagsForResource"), shape_type=ShapeType.OPERATION -) - -LIST_TOPICS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#ListTopicsInput"), - members={"NextToken": {"target": NEXT_TOKEN}}, -) - -TOPIC = Schema.collection( - id=ShapeID("com.amazonaws.sns#Topic"), members={"TopicArn": {"target": TOPIC_ARN}} -) - -TOPICS_LIST = Schema.collection( - id=ShapeID("com.amazonaws.sns#TopicsList"), - shape_type=ShapeType.LIST, - members={"member": {"target": TOPIC}}, -) - -LIST_TOPICS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#ListTopicsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sns#ListTopicsResponse", - ) - ], - members={"Topics": {"target": TOPICS_LIST}, "NextToken": {"target": NEXT_TOKEN}}, -) - -LIST_TOPICS = Schema( - id=ShapeID("com.amazonaws.sns#ListTopics"), shape_type=ShapeType.OPERATION -) - -OPT_IN_PHONE_NUMBER_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#OptInPhoneNumberInput"), - members={ - "phoneNumber": { - "target": PHONE_NUMBER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -OPT_IN_PHONE_NUMBER_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#OptInPhoneNumberOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sns#OptInPhoneNumberResponse", - ) - ], -) - -OPT_IN_PHONE_NUMBER = Schema( - id=ShapeID("com.amazonaws.sns#OptInPhoneNumber"), shape_type=ShapeType.OPERATION -) - -ENDPOINT_DISABLED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.sns#EndpointDisabledException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "EndpointDisabled", "httpResponseCode": 400} - ), - ), - ], - members={"message": {"target": STRING}}, -) - -INVALID_PARAMETER_VALUE_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.sns#InvalidParameterValueException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "ParameterValueInvalid", "httpResponseCode": 400} - ), - ), - ], - members={"message": {"target": STRING}}, -) - -KMS_ACCESS_DENIED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.sns#KMSAccessDeniedException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "KMSAccessDenied", "httpResponseCode": 400} - ), - ), - ], - members={"message": {"target": STRING}}, -) - -KMS_DISABLED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.sns#KMSDisabledException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType({"code": "KMSDisabled", "httpResponseCode": 400}), - ), - ], - members={"message": {"target": STRING}}, -) - -KMS_INVALID_STATE_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.sns#KMSInvalidStateException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "KMSInvalidState", "httpResponseCode": 400} - ), - ), - ], - members={"message": {"target": STRING}}, -) - -KMS_NOT_FOUND_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.sns#KMSNotFoundException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType({"code": "KMSNotFound", "httpResponseCode": 400}), - ), - ], - members={"message": {"target": STRING}}, -) - -KMS_OPT_IN_REQUIRED = Schema.collection( - id=ShapeID("com.amazonaws.sns#KMSOptInRequired"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=403), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "KMSOptInRequired", "httpResponseCode": 403} - ), - ), - ], - members={"message": {"target": STRING}}, -) - -KMS_THROTTLING_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.sns#KMSThrottlingException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType({"code": "KMSThrottling", "httpResponseCode": 400}), - ), - ], - members={"message": {"target": STRING}}, -) - -PLATFORM_APPLICATION_DISABLED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.sns#PlatformApplicationDisabledException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "PlatformApplicationDisabled", "httpResponseCode": 400} - ), - ), - ], - members={"message": {"target": STRING}}, -) - -MESSAGE = Schema(id=ShapeID("com.amazonaws.sns#message"), shape_type=ShapeType.STRING) - -BINARY = Schema(id=ShapeID("com.amazonaws.sns#Binary"), shape_type=ShapeType.BLOB) - -MESSAGE_ATTRIBUTE_VALUE = Schema.collection( - id=ShapeID("com.amazonaws.sns#MessageAttributeValue"), - members={ - "DataType": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "StringValue": {"target": STRING}, - "BinaryValue": {"target": BINARY}, - }, -) - -MESSAGE_ATTRIBUTE_MAP = Schema.collection( - id=ShapeID("com.amazonaws.sns#MessageAttributeMap"), - shape_type=ShapeType.MAP, - members={ - "key": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#xmlName"), value="Name")], - }, - "value": { - "target": MESSAGE_ATTRIBUTE_VALUE, - "traits": [Trait.new(id=ShapeID("smithy.api#xmlName"), value="Value")], - }, - }, -) - -MESSAGE_STRUCTURE = Schema( - id=ShapeID("com.amazonaws.sns#messageStructure"), shape_type=ShapeType.STRING -) - -SUBJECT = Schema(id=ShapeID("com.amazonaws.sns#subject"), shape_type=ShapeType.STRING) - -PUBLISH_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#PublishInput"), - members={ - "TopicArn": {"target": TOPIC_ARN}, - "TargetArn": {"target": STRING}, - "PhoneNumber": {"target": PHONE_NUMBER}, - "Message": { - "target": MESSAGE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Subject": {"target": SUBJECT}, - "MessageStructure": {"target": MESSAGE_STRUCTURE}, - "MessageAttributes": {"target": MESSAGE_ATTRIBUTE_MAP}, - "MessageDeduplicationId": {"target": STRING}, - "MessageGroupId": {"target": STRING}, - }, -) - -MESSAGE_ID = Schema( - id=ShapeID("com.amazonaws.sns#messageId"), shape_type=ShapeType.STRING -) - -PUBLISH_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#PublishOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sns#PublishResponse", - ) - ], - members={"MessageId": {"target": MESSAGE_ID}, "SequenceNumber": {"target": STRING}}, -) - -PUBLISH = Schema( - id=ShapeID("com.amazonaws.sns#Publish"), shape_type=ShapeType.OPERATION -) - -BATCH_ENTRY_IDS_NOT_DISTINCT_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.sns#BatchEntryIdsNotDistinctException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "BatchEntryIdsNotDistinct", "httpResponseCode": 400} - ), - ), - ], - members={"message": {"target": STRING}}, -) - -BATCH_REQUEST_TOO_LONG_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.sns#BatchRequestTooLongException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "BatchRequestTooLong", "httpResponseCode": 400} - ), - ), - ], - members={"message": {"target": STRING}}, -) - -EMPTY_BATCH_REQUEST_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.sns#EmptyBatchRequestException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "EmptyBatchRequest", "httpResponseCode": 400} - ), - ), - ], - members={"message": {"target": STRING}}, -) - -INVALID_BATCH_ENTRY_ID_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.sns#InvalidBatchEntryIdException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "InvalidBatchEntryId", "httpResponseCode": 400} - ), - ), - ], - members={"message": {"target": STRING}}, -) - -PUBLISH_BATCH_REQUEST_ENTRY = Schema.collection( - id=ShapeID("com.amazonaws.sns#PublishBatchRequestEntry"), - members={ - "Id": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Message": { - "target": MESSAGE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Subject": {"target": SUBJECT}, - "MessageStructure": {"target": MESSAGE_STRUCTURE}, - "MessageAttributes": {"target": MESSAGE_ATTRIBUTE_MAP}, - "MessageDeduplicationId": {"target": STRING}, - "MessageGroupId": {"target": STRING}, - }, -) - -PUBLISH_BATCH_REQUEST_ENTRY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.sns#PublishBatchRequestEntryList"), - shape_type=ShapeType.LIST, - members={"member": {"target": PUBLISH_BATCH_REQUEST_ENTRY}}, -) - -PUBLISH_BATCH_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#PublishBatchInput"), - members={ - "TopicArn": { - "target": TOPIC_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "PublishBatchRequestEntries": { - "target": PUBLISH_BATCH_REQUEST_ENTRY_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, }, -) - -BATCH_RESULT_ERROR_ENTRY = Schema.collection( - id=ShapeID("com.amazonaws.sns#BatchResultErrorEntry"), - members={ - "Id": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Code": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Message": {"target": STRING}, - "SenderFault": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=False), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, + (_me,), + ((STRING, 0),), +) + +CONFIRM_SUBSCRIPTION: StaticOperationSchema = ( + 23, + n0, + _CS, + 0, + CONFIRM_SUBSCRIPTION_INPUT, + CONFIRM_SUBSCRIPTION_OUTPUT, + ( + AUTHORIZATION_ERROR_EXCEPTION, + FILTER_POLICY_LIMIT_EXCEEDED_EXCEPTION, + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + NOT_FOUND_EXCEPTION, + REPLAY_LIMIT_EXCEEDED_EXCEPTION, + SUBSCRIPTION_LIMIT_EXCEEDED_EXCEPTION, + ), +) + +MAP_STRING_TO_STRING: StaticSchema = ( + 17, + n0, + _MSTS, + 0, + (_k, _v), + ((STRING, 0), (STRING, 0)), +) + +CREATE_PLATFORM_APPLICATION_INPUT: StaticSchema = ( + 18, + n0, + _CPAI, + {_s: None}, + (_N, _P, _A), + ((STRING, 1), (STRING, 1), (MAP_STRING_TO_STRING, 1)), +) + +CREATE_PLATFORM_APPLICATION_OUTPUT: StaticSchema = ( + 18, + n0, + _CPAO, + {_sSI: _cCPAR, _smi: None}, + (_PAA,), + ((STRING, 0),), +) + +CREATE_PLATFORM_APPLICATION: StaticOperationSchema = ( + 23, + n0, + _CPA, + 0, + CREATE_PLATFORM_APPLICATION_INPUT, + CREATE_PLATFORM_APPLICATION_OUTPUT, + ( + AUTHORIZATION_ERROR_EXCEPTION, + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + ), +) + +CREATE_PLATFORM_ENDPOINT_INPUT: StaticSchema = ( + 18, + n0, + _CPEI, + {_s: None}, + (_PAA, _T, _CUD, _A), + ((STRING, 1), (STRING, 1), (STRING, 0), (MAP_STRING_TO_STRING, 0)), +) + +CREATE_PLATFORM_ENDPOINT_OUTPUT: StaticSchema = ( + 18, + n0, + _CPEO, + {_sSI: _cCER, _smi: None}, + (_EA,), + ((STRING, 0),), +) + +CREATE_PLATFORM_ENDPOINT: StaticOperationSchema = ( + 23, + n0, + _CPE, + 0, + CREATE_PLATFORM_ENDPOINT_INPUT, + CREATE_PLATFORM_ENDPOINT_OUTPUT, + ( + AUTHORIZATION_ERROR_EXCEPTION, + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + NOT_FOUND_EXCEPTION, + ), +) + +LANGUAGE_CODE_STRING: StaticSchema = ( + 14, + n0, + _LCS, + 0, + (_eU, _eG, _e, _eE, _dD, _fC, _fF, _iI, _jJ, _pB, _kK, _zC, _zT), + ( + (-1, {_sV: _eU_}), + (-1, {_sV: _eG_}), + (-1, {_sV: _e_}), + (-1, {_sV: _eE_}), + (-1, {_sV: _dD_}), + (-1, {_sV: _fC_}), + (-1, {_sV: _fF_}), + (-1, {_sV: _iI_}), + (-1, {_sV: _jJ_}), + (-1, {_sV: _pB_}), + (-1, {_sV: _kK_}), + (-1, {_sV: _zC_}), + (-1, {_sV: _zT_}), + ), +) + +PHONE_NUMBER_STRING: StaticSchema = (3, n0, _PNS, 4) + +CREATE_SMS_SANDBOX_PHONE_NUMBER_INPUT: StaticSchema = ( + 18, + n0, + _CSMSSPNI, + {_s: None}, + (_PN, _LC), + ((PHONE_NUMBER_STRING, 1), (LANGUAGE_CODE_STRING, 0)), +) + +CREATE_SMS_SANDBOX_PHONE_NUMBER_OUTPUT: StaticSchema = ( + 18, + n0, + _CSMSSPNO, + {_sSI: _cCSMSSPNR, _smi: None}, +) + +OPTED_OUT_EXCEPTION: StaticSchema = ( + 18, + n0, + _OOE, + { + _smit: _c, + _sE: 400, + _aQE: MappingProxyType({"code": "OptedOut", "httpResponseCode": 400}), }, -) - -BATCH_RESULT_ERROR_ENTRY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.sns#BatchResultErrorEntryList"), - shape_type=ShapeType.LIST, - members={"member": {"target": BATCH_RESULT_ERROR_ENTRY}}, -) - -PUBLISH_BATCH_RESULT_ENTRY = Schema.collection( - id=ShapeID("com.amazonaws.sns#PublishBatchResultEntry"), - members={ - "Id": {"target": STRING}, - "MessageId": {"target": MESSAGE_ID}, - "SequenceNumber": {"target": STRING}, + (_me,), + ((STRING, 0),), +) + +USER_ERROR_EXCEPTION: StaticSchema = ( + 18, + n0, + _UEE, + { + _smit: _c, + _sE: 400, + _aQE: MappingProxyType({"code": "UserError", "httpResponseCode": 400}), }, -) - -PUBLISH_BATCH_RESULT_ENTRY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.sns#PublishBatchResultEntryList"), - shape_type=ShapeType.LIST, - members={"member": {"target": PUBLISH_BATCH_RESULT_ENTRY}}, -) - -PUBLISH_BATCH_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#PublishBatchOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sns#PublishBatchResponse", - ) - ], - members={ - "Successful": {"target": PUBLISH_BATCH_RESULT_ENTRY_LIST}, - "Failed": {"target": BATCH_RESULT_ERROR_ENTRY_LIST}, + (_me,), + ((STRING, 0),), +) + +CREATE_SMS_SANDBOX_PHONE_NUMBER: StaticOperationSchema = ( + 23, + n0, + _CSMSSPN, + 0, + CREATE_SMS_SANDBOX_PHONE_NUMBER_INPUT, + CREATE_SMS_SANDBOX_PHONE_NUMBER_OUTPUT, + ( + AUTHORIZATION_ERROR_EXCEPTION, + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + OPTED_OUT_EXCEPTION, + THROTTLED_EXCEPTION, + USER_ERROR_EXCEPTION, + ), +) + +CONCURRENT_ACCESS_EXCEPTION: StaticSchema = ( + 18, + n0, + _CAE, + { + _smit: _c, + _sE: 400, + _aQE: MappingProxyType({"code": "ConcurrentAccess", "httpResponseCode": 400}), }, + (_me,), + ((STRING, 0),), ) -TOO_MANY_ENTRIES_IN_BATCH_REQUEST_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.sns#TooManyEntriesInBatchRequestException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "TooManyEntriesInBatchRequest", "httpResponseCode": 400} - ), - ), - ], - members={"message": {"target": STRING}}, -) - -PUBLISH_BATCH = Schema( - id=ShapeID("com.amazonaws.sns#PublishBatch"), shape_type=ShapeType.OPERATION -) +ATTRIBUTE_NAME: StaticSchema = (3, n0, _aN, 0) -PUT_DATA_PROTECTION_POLICY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#PutDataProtectionPolicyInput"), - members={ - "ResourceArn": { - "target": TOPIC_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "DataProtectionPolicy": { - "target": ATTRIBUTE_VALUE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +ATTRIBUTE_VALUE: StaticSchema = (3, n0, _aV, 0) -PUT_DATA_PROTECTION_POLICY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#PutDataProtectionPolicyOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], +TOPIC_ATTRIBUTES_MAP: StaticSchema = ( + 17, + n0, + _TAM, + 0, + (_k, _v), + ((ATTRIBUTE_NAME, 0), (ATTRIBUTE_VALUE, 0)), ) -PUT_DATA_PROTECTION_POLICY = Schema( - id=ShapeID("com.amazonaws.sns#PutDataProtectionPolicy"), - shape_type=ShapeType.OPERATION, -) +TOPIC_NAME: StaticSchema = (3, n0, _tN, 0) -REMOVE_PERMISSION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#RemovePermissionInput"), - members={ - "TopicArn": { - "target": TOPIC_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Label": { - "target": LABEL, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +TAG_KEY: StaticSchema = (3, n0, _TK, 0) -REMOVE_PERMISSION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#RemovePermissionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) +TAG_VALUE: StaticSchema = (3, n0, _TV, 0) -REMOVE_PERMISSION = Schema( - id=ShapeID("com.amazonaws.sns#RemovePermission"), shape_type=ShapeType.OPERATION -) +TAG: StaticSchema = (18, n0, _Ta, 0, (_K, _V), ((TAG_KEY, 1), (TAG_VALUE, 1))) -SET_ENDPOINT_ATTRIBUTES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#SetEndpointAttributesInput"), - members={ - "EndpointArn": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Attributes": { - "target": MAP_STRING_TO_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +TAG_LIST: StaticSchema = (16, n0, _TL, 0, (_m,), ((TAG, 0),)) -SET_ENDPOINT_ATTRIBUTES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#SetEndpointAttributesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], +CREATE_TOPIC_INPUT: StaticSchema = ( + 18, + n0, + _CTI, + {_s: None}, + (_N, _A, _Tag, _DPP), + ((TOPIC_NAME, 1), (TOPIC_ATTRIBUTES_MAP, 0), (TAG_LIST, 0), (ATTRIBUTE_VALUE, 0)), ) -SET_ENDPOINT_ATTRIBUTES = Schema( - id=ShapeID("com.amazonaws.sns#SetEndpointAttributes"), - shape_type=ShapeType.OPERATION, +CREATE_TOPIC_OUTPUT: StaticSchema = ( + 18, + n0, + _CTO, + {_sSI: _cCTR, _smi: None}, + (_TA,), + ((TOPIC_ARN, 0),), ) -SET_PLATFORM_APPLICATION_ATTRIBUTES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#SetPlatformApplicationAttributesInput"), - members={ - "PlatformApplicationArn": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Attributes": { - "target": MAP_STRING_TO_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, +INVALID_SECURITY_EXCEPTION: StaticSchema = ( + 18, + n0, + _ISE, + { + _smit: _c, + _sE: 403, + _aQE: MappingProxyType({"code": "InvalidSecurity", "httpResponseCode": 403}), }, -) - -SET_PLATFORM_APPLICATION_ATTRIBUTES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#SetPlatformApplicationAttributesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -SET_PLATFORM_APPLICATION_ATTRIBUTES = Schema( - id=ShapeID("com.amazonaws.sns#SetPlatformApplicationAttributes"), - shape_type=ShapeType.OPERATION, -) - -SET_SMS_ATTRIBUTES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#SetSMSAttributesInput"), - members={ - "attributes": { - "target": MAP_STRING_TO_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } + (_me,), + ((STRING, 0),), +) + +STALE_TAG_EXCEPTION: StaticSchema = ( + 18, + n0, + _STE, + { + _smit: _c, + _sE: 400, + _aQE: MappingProxyType({"code": "StaleTag", "httpResponseCode": 400}), }, -) - -SET_SMS_ATTRIBUTES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#SetSMSAttributesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sns#SetSMSAttributesResponse", - ) - ], -) - -SET_SMS_ATTRIBUTES = Schema( - id=ShapeID("com.amazonaws.sns#SetSMSAttributes"), shape_type=ShapeType.OPERATION -) - -SET_SUBSCRIPTION_ATTRIBUTES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#SetSubscriptionAttributesInput"), - members={ - "SubscriptionArn": { - "target": SUBSCRIPTION_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "AttributeName": { - "target": ATTRIBUTE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "AttributeValue": {"target": ATTRIBUTE_VALUE}, + (_me,), + ((STRING, 0),), +) + +TAG_LIMIT_EXCEEDED_EXCEPTION: StaticSchema = ( + 18, + n0, + _TLEE, + { + _smit: _c, + _sE: 400, + _aQE: MappingProxyType({"code": "TagLimitExceeded", "httpResponseCode": 400}), }, -) - -SET_SUBSCRIPTION_ATTRIBUTES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#SetSubscriptionAttributesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -SET_SUBSCRIPTION_ATTRIBUTES = Schema( - id=ShapeID("com.amazonaws.sns#SetSubscriptionAttributes"), - shape_type=ShapeType.OPERATION, -) - -SET_TOPIC_ATTRIBUTES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#SetTopicAttributesInput"), - members={ - "TopicArn": { - "target": TOPIC_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "AttributeName": { - "target": ATTRIBUTE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "AttributeValue": {"target": ATTRIBUTE_VALUE}, + (_me,), + ((STRING, 0),), +) + +TAG_POLICY_EXCEPTION: StaticSchema = ( + 18, + n0, + _TPE, + { + _smit: _c, + _sE: 400, + _aQE: MappingProxyType({"code": "TagPolicy", "httpResponseCode": 400}), }, -) - -SET_TOPIC_ATTRIBUTES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#SetTopicAttributesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -SET_TOPIC_ATTRIBUTES = Schema( - id=ShapeID("com.amazonaws.sns#SetTopicAttributes"), shape_type=ShapeType.OPERATION -) - -SUBSCRIBE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#SubscribeInput"), - members={ - "TopicArn": { - "target": TOPIC_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Protocol": { - "target": PROTOCOL, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Endpoint": {"target": ENDPOINT2}, - "Attributes": {"target": SUBSCRIPTION_ATTRIBUTES_MAP}, - "ReturnSubscriptionArn": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, + (_me,), + ((STRING, 0),), +) + +TOPIC_LIMIT_EXCEEDED_EXCEPTION: StaticSchema = ( + 18, + n0, + _TLEEo, + { + _smit: _c, + _sE: 403, + _aQE: MappingProxyType({"code": "TopicLimitExceeded", "httpResponseCode": 403}), }, -) - -SUBSCRIBE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#SubscribeOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sns#SubscribeResponse", - ) - ], - members={"SubscriptionArn": {"target": SUBSCRIPTION_ARN}}, -) - -SUBSCRIBE = Schema( - id=ShapeID("com.amazonaws.sns#Subscribe"), shape_type=ShapeType.OPERATION -) - -TAG_RESOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#TagResourceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sns#TagResourceRequest", - ) - ], - members={ - "ResourceArn": { - "target": AMAZON_RESOURCE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Tags": { - "target": TAG_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, + (_me,), + ((STRING, 0),), +) + +CREATE_TOPIC: StaticOperationSchema = ( + 23, + n0, + _CT, + 0, + CREATE_TOPIC_INPUT, + CREATE_TOPIC_OUTPUT, + ( + AUTHORIZATION_ERROR_EXCEPTION, + CONCURRENT_ACCESS_EXCEPTION, + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + INVALID_SECURITY_EXCEPTION, + STALE_TAG_EXCEPTION, + TAG_LIMIT_EXCEEDED_EXCEPTION, + TAG_POLICY_EXCEPTION, + TOPIC_LIMIT_EXCEEDED_EXCEPTION, + ), +) + +DELETE_ENDPOINT_INPUT: StaticSchema = (18, n0, _DEI, {_s: None}, (_EA,), ((STRING, 1),)) + +DELETE_ENDPOINT_OUTPUT: StaticSchema = (18, n0, _DEO, {_sSI: _sU, _smi: None}) + +DELETE_ENDPOINT: StaticOperationSchema = ( + 23, + n0, + _DE, + 0, + DELETE_ENDPOINT_INPUT, + DELETE_ENDPOINT_OUTPUT, + ( + AUTHORIZATION_ERROR_EXCEPTION, + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + ), +) + +DELETE_PLATFORM_APPLICATION_INPUT: StaticSchema = ( + 18, + n0, + _DPAI, + {_s: None}, + (_PAA,), + ((STRING, 1),), +) + +DELETE_PLATFORM_APPLICATION_OUTPUT: StaticSchema = ( + 18, + n0, + _DPAO, + {_sSI: _sU, _smi: None}, +) + +DELETE_PLATFORM_APPLICATION: StaticOperationSchema = ( + 23, + n0, + _DPA, + 0, + DELETE_PLATFORM_APPLICATION_INPUT, + DELETE_PLATFORM_APPLICATION_OUTPUT, + ( + AUTHORIZATION_ERROR_EXCEPTION, + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + ), +) + +DELETE_SMS_SANDBOX_PHONE_NUMBER_INPUT: StaticSchema = ( + 18, + n0, + _DSMSSPNI, + {_s: None}, + (_PN,), + ((PHONE_NUMBER_STRING, 1),), +) + +DELETE_SMS_SANDBOX_PHONE_NUMBER_OUTPUT: StaticSchema = ( + 18, + n0, + _DSMSSPNO, + {_sSI: _cDSMSSPNR, _smi: None}, +) + +RESOURCE_NOT_FOUND_EXCEPTION: StaticSchema = ( + 18, + n0, + _RNFE, + { + _smit: _c, + _sE: 404, + _aQE: MappingProxyType({"code": "ResourceNotFound", "httpResponseCode": 404}), }, -) - -TAG_RESOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#TagResourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sns#TagResourceResponse", - ) - ], -) - -TAG_RESOURCE = Schema( - id=ShapeID("com.amazonaws.sns#TagResource"), shape_type=ShapeType.OPERATION -) - -UNSUBSCRIBE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#UnsubscribeInput"), - members={ - "SubscriptionArn": { - "target": SUBSCRIPTION_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } + (_me,), + ((STRING, 0),), +) + +DELETE_SMS_SANDBOX_PHONE_NUMBER: StaticOperationSchema = ( + 23, + n0, + _DSMSSPN, + 0, + DELETE_SMS_SANDBOX_PHONE_NUMBER_INPUT, + DELETE_SMS_SANDBOX_PHONE_NUMBER_OUTPUT, + ( + AUTHORIZATION_ERROR_EXCEPTION, + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLED_EXCEPTION, + USER_ERROR_EXCEPTION, + ), +) + +DELETE_TOPIC_INPUT: StaticSchema = (18, n0, _DTI, {_s: None}, (_TA,), ((TOPIC_ARN, 1),)) + +DELETE_TOPIC_OUTPUT: StaticSchema = (18, n0, _DTO, {_sSI: _sU, _smi: None}) + +INVALID_STATE_EXCEPTION: StaticSchema = ( + 18, + n0, + _ISEn, + { + _smit: _c, + _sE: 400, + _aQE: MappingProxyType({"code": "InvalidState", "httpResponseCode": 400}), }, -) - -UNSUBSCRIBE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#UnsubscribeOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -UNSUBSCRIBE = Schema( - id=ShapeID("com.amazonaws.sns#Unsubscribe"), shape_type=ShapeType.OPERATION -) - -TAG_KEY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.sns#TagKeyList"), - shape_type=ShapeType.LIST, - members={"member": {"target": TAG_KEY}}, -) - -UNTAG_RESOURCE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#UntagResourceInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sns#UntagResourceRequest", - ) - ], - members={ - "ResourceArn": { - "target": AMAZON_RESOURCE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "TagKeys": { - "target": TAG_KEY_LIST, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, + (_me,), + ((STRING, 0),), +) + +DELETE_TOPIC: StaticOperationSchema = ( + 23, + n0, + _DT, + 0, + DELETE_TOPIC_INPUT, + DELETE_TOPIC_OUTPUT, + ( + AUTHORIZATION_ERROR_EXCEPTION, + CONCURRENT_ACCESS_EXCEPTION, + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + INVALID_STATE_EXCEPTION, + NOT_FOUND_EXCEPTION, + STALE_TAG_EXCEPTION, + TAG_POLICY_EXCEPTION, + ), +) + +GET_DATA_PROTECTION_POLICY_INPUT: StaticSchema = ( + 18, + n0, + _GDPPI, + {_s: None}, + (_RA,), + ((TOPIC_ARN, 1),), +) + +GET_DATA_PROTECTION_POLICY_OUTPUT: StaticSchema = ( + 18, + n0, + _GDPPO, + {_sSI: _cGDPPR, _smi: None}, + (_DPP,), + ((ATTRIBUTE_VALUE, 0),), +) + +GET_DATA_PROTECTION_POLICY: StaticOperationSchema = ( + 23, + n0, + _GDPP, + 0, + GET_DATA_PROTECTION_POLICY_INPUT, + GET_DATA_PROTECTION_POLICY_OUTPUT, + ( + AUTHORIZATION_ERROR_EXCEPTION, + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + INVALID_SECURITY_EXCEPTION, + NOT_FOUND_EXCEPTION, + ), +) + +GET_ENDPOINT_ATTRIBUTES_INPUT: StaticSchema = ( + 18, + n0, + _GEAI, + {_s: None}, + (_EA,), + ((STRING, 1),), +) + +GET_ENDPOINT_ATTRIBUTES_OUTPUT: StaticSchema = ( + 18, + n0, + _GEAO, + {_sSI: _cGEAR, _smi: None}, + (_A,), + ((MAP_STRING_TO_STRING, 0),), +) + +GET_ENDPOINT_ATTRIBUTES: StaticOperationSchema = ( + 23, + n0, + _GEA, + 0, + GET_ENDPOINT_ATTRIBUTES_INPUT, + GET_ENDPOINT_ATTRIBUTES_OUTPUT, + ( + AUTHORIZATION_ERROR_EXCEPTION, + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + NOT_FOUND_EXCEPTION, + ), +) + +GET_PLATFORM_APPLICATION_ATTRIBUTES_INPUT: StaticSchema = ( + 18, + n0, + _GPAAI, + {_s: None}, + (_PAA,), + ((STRING, 1),), +) + +GET_PLATFORM_APPLICATION_ATTRIBUTES_OUTPUT: StaticSchema = ( + 18, + n0, + _GPAAO, + {_sSI: _cGPAAR, _smi: None}, + (_A,), + ((MAP_STRING_TO_STRING, 0),), +) + +GET_PLATFORM_APPLICATION_ATTRIBUTES: StaticOperationSchema = ( + 23, + n0, + _GPAA, + 0, + GET_PLATFORM_APPLICATION_ATTRIBUTES_INPUT, + GET_PLATFORM_APPLICATION_ATTRIBUTES_OUTPUT, + ( + AUTHORIZATION_ERROR_EXCEPTION, + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + NOT_FOUND_EXCEPTION, + ), +) + +LIST_STRING: StaticSchema = (16, n0, _LS, 0, (_m,), ((STRING, 0),)) + +GET_SMS_ATTRIBUTES_INPUT: StaticSchema = ( + 18, + n0, + _GSMSAI, + {_s: None}, + (_at,), + ((LIST_STRING, 0),), +) + +GET_SMS_ATTRIBUTES_OUTPUT: StaticSchema = ( + 18, + n0, + _GSMSAO, + {_sSI: _cGSMSAR, _smi: None}, + (_at,), + ((MAP_STRING_TO_STRING, 0),), +) + +GET_SMS_ATTRIBUTES: StaticOperationSchema = ( + 23, + n0, + _GSMSA, + 0, + GET_SMS_ATTRIBUTES_INPUT, + GET_SMS_ATTRIBUTES_OUTPUT, + ( + AUTHORIZATION_ERROR_EXCEPTION, + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + THROTTLED_EXCEPTION, + ), +) + +GET_SMS_SANDBOX_ACCOUNT_STATUS_INPUT: StaticSchema = (18, n0, _GSMSSASI, {_s: None}) + +GET_SMS_SANDBOX_ACCOUNT_STATUS_OUTPUT: StaticSchema = ( + 18, + n0, + _GSMSSASO, + {_sSI: _cGSMSSASR, _smi: None}, + (_IIS,), + ((BOOLEAN, {_smithy: False, _sm: None}),), +) + +GET_SMS_SANDBOX_ACCOUNT_STATUS: StaticOperationSchema = ( + 23, + n0, + _GSMSSAS, + 0, + GET_SMS_SANDBOX_ACCOUNT_STATUS_INPUT, + GET_SMS_SANDBOX_ACCOUNT_STATUS_OUTPUT, + (AUTHORIZATION_ERROR_EXCEPTION, INTERNAL_ERROR_EXCEPTION, THROTTLED_EXCEPTION), +) + +GET_SUBSCRIPTION_ATTRIBUTES_INPUT: StaticSchema = ( + 18, + n0, + _GSAI, + {_s: None}, + (_SA,), + ((SUBSCRIPTION_ARN, 1),), +) + +SUBSCRIPTION_ATTRIBUTES_MAP: StaticSchema = ( + 17, + n0, + _SAM, + 0, + (_k, _v), + ((ATTRIBUTE_NAME, 0), (ATTRIBUTE_VALUE, 0)), +) + +GET_SUBSCRIPTION_ATTRIBUTES_OUTPUT: StaticSchema = ( + 18, + n0, + _GSAO, + {_sSI: _cGSAR, _smi: None}, + (_A,), + ((SUBSCRIPTION_ATTRIBUTES_MAP, 0),), +) + +GET_SUBSCRIPTION_ATTRIBUTES: StaticOperationSchema = ( + 23, + n0, + _GSA, + 0, + GET_SUBSCRIPTION_ATTRIBUTES_INPUT, + GET_SUBSCRIPTION_ATTRIBUTES_OUTPUT, + ( + AUTHORIZATION_ERROR_EXCEPTION, + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + NOT_FOUND_EXCEPTION, + ), +) + +GET_TOPIC_ATTRIBUTES_INPUT: StaticSchema = ( + 18, + n0, + _GTAI, + {_s: None}, + (_TA,), + ((TOPIC_ARN, 1),), +) + +GET_TOPIC_ATTRIBUTES_OUTPUT: StaticSchema = ( + 18, + n0, + _GTAO, + {_sSI: _cGTAR, _smi: None}, + (_A,), + ((TOPIC_ATTRIBUTES_MAP, 0),), +) + +GET_TOPIC_ATTRIBUTES: StaticOperationSchema = ( + 23, + n0, + _GTA, + 0, + GET_TOPIC_ATTRIBUTES_INPUT, + GET_TOPIC_ATTRIBUTES_OUTPUT, + ( + AUTHORIZATION_ERROR_EXCEPTION, + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + INVALID_SECURITY_EXCEPTION, + NOT_FOUND_EXCEPTION, + ), +) + +LIST_ENDPOINTS_BY_PLATFORM_APPLICATION_INPUT: StaticSchema = ( + 18, + n0, + _LEBPAI, + {_s: None}, + (_PAA, _NT), + ((STRING, 1), (STRING, 0)), +) + +ENDPOINT: StaticSchema = ( + 18, + n0, + _E, + 0, + (_EA, _A), + ((STRING, 0), (MAP_STRING_TO_STRING, 0)), +) + +LIST_OF_ENDPOINTS: StaticSchema = (16, n0, _LOE, 0, (_m,), ((ENDPOINT, 0),)) + +LIST_ENDPOINTS_BY_PLATFORM_APPLICATION_OUTPUT: StaticSchema = ( + 18, + n0, + _LEBPAO, + {_sSI: _cLEBPAR, _smi: None}, + (_En, _NT), + ((LIST_OF_ENDPOINTS, 0), (STRING, 0)), +) + +LIST_ENDPOINTS_BY_PLATFORM_APPLICATION: StaticOperationSchema = ( + 23, + n0, + _LEBPA, + 0, + LIST_ENDPOINTS_BY_PLATFORM_APPLICATION_INPUT, + LIST_ENDPOINTS_BY_PLATFORM_APPLICATION_OUTPUT, + ( + AUTHORIZATION_ERROR_EXCEPTION, + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + NOT_FOUND_EXCEPTION, + ), +) + +MAX_ITEMS_LIST_ORIGINATION_NUMBERS: StaticSchema = (7, n0, _MILON, 0) + +NEXT_TOKEN: StaticSchema = (3, n0, _nT, 0) + +LIST_ORIGINATION_NUMBERS_INPUT: StaticSchema = ( + 18, + n0, + _LONI, + {_sSI: _cLONR, _s: None}, + (_NT, _MR), + ((NEXT_TOKEN, 0), (MAX_ITEMS_LIST_ORIGINATION_NUMBERS, 0)), +) + +TIMESTAMP: StaticSchema = (4, n0, _Ti, 0) + +ISO2_COUNTRY_CODE: StaticSchema = (3, n0, _ICC, 0) + +NUMBER_CAPABILITY: StaticSchema = ( + 14, + n0, + _NC, + 0, + (_SMS, _MMS, _VOICE), + ((-1, {_sV: _SMS}), (-1, {_sV: _MMS}), (-1, {_sV: _VOICE})), +) + +NUMBER_CAPABILITY_LIST: StaticSchema = ( + 16, + n0, + _NCL, + 0, + (_m,), + ((NUMBER_CAPABILITY, 0),), +) + +ROUTE_TYPE: StaticSchema = ( + 14, + n0, + _RT, + 0, + (_Tr, _Pr, _Pre), + ((-1, {_sV: _Tr}), (-1, {_sV: _Pr}), (-1, {_sV: _Pre})), +) + +PHONE_NUMBER_INFORMATION: StaticSchema = ( + 18, + n0, + _PNI, + 0, + (_CA, _PN, _St, _ICC, _RT, _NCu), + ( + (TIMESTAMP, 0), + (PHONE_NUMBER, 0), + (STRING, 0), + (ISO2_COUNTRY_CODE, 0), + (ROUTE_TYPE, 0), + (NUMBER_CAPABILITY_LIST, 0), + ), +) + +PHONE_NUMBER_INFORMATION_LIST: StaticSchema = ( + 16, + n0, + _PNIL, + 0, + (_m,), + ((PHONE_NUMBER_INFORMATION, 0),), +) + +LIST_ORIGINATION_NUMBERS_OUTPUT: StaticSchema = ( + 18, + n0, + _LONO, + {_sSI: _cLONRo, _smi: None}, + (_NT, _PNh), + ((NEXT_TOKEN, 0), (PHONE_NUMBER_INFORMATION_LIST, 0)), +) + +VALIDATION_EXCEPTION: StaticSchema = ( + 18, + n0, + _VE, + { + _smit: _c, + _sE: 400, + _aQE: MappingProxyType( + {"code": "ValidationException", "httpResponseCode": 400} + ), }, -) - -UNTAG_RESOURCE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#UntagResourceOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sns#UntagResourceResponse", - ) - ], -) - -UNTAG_RESOURCE = Schema( - id=ShapeID("com.amazonaws.sns#UntagResource"), shape_type=ShapeType.OPERATION -) - -VERIFICATION_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.sns#VerificationException"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], - members={ - "Message": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Status": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, + (_M,), + ((STRING, 1),), +) + +LIST_ORIGINATION_NUMBERS: StaticOperationSchema = ( + 23, + n0, + _LON, + 0, + LIST_ORIGINATION_NUMBERS_INPUT, + LIST_ORIGINATION_NUMBERS_OUTPUT, + ( + AUTHORIZATION_ERROR_EXCEPTION, + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + THROTTLED_EXCEPTION, + VALIDATION_EXCEPTION, + ), +) + +LIST_PHONE_NUMBERS_OPTED_OUT_INPUT: StaticSchema = ( + 18, + n0, + _LPNOOI, + {_s: None}, + (_nT,), + ((STRING, 0),), +) + +PHONE_NUMBER_LIST: StaticSchema = (16, n0, _PNL, 0, (_m,), ((PHONE_NUMBER, 0),)) + +LIST_PHONE_NUMBERS_OPTED_OUT_OUTPUT: StaticSchema = ( + 18, + n0, + _LPNOOO, + {_sSI: _cLPNOOR, _smi: None}, + (_pNh, _nT), + ((PHONE_NUMBER_LIST, 0), (STRING, 0)), +) + +LIST_PHONE_NUMBERS_OPTED_OUT: StaticOperationSchema = ( + 23, + n0, + _LPNOO, + 0, + LIST_PHONE_NUMBERS_OPTED_OUT_INPUT, + LIST_PHONE_NUMBERS_OPTED_OUT_OUTPUT, + ( + AUTHORIZATION_ERROR_EXCEPTION, + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + THROTTLED_EXCEPTION, + ), +) + +LIST_PLATFORM_APPLICATIONS_INPUT: StaticSchema = ( + 18, + n0, + _LPAI, + {_s: None}, + (_NT,), + ((STRING, 0),), +) + +PLATFORM_APPLICATION: StaticSchema = ( + 18, + n0, + _PA, + 0, + (_PAA, _A), + ((STRING, 0), (MAP_STRING_TO_STRING, 0)), +) + +LIST_OF_PLATFORM_APPLICATIONS: StaticSchema = ( + 16, + n0, + _LOPA, + 0, + (_m,), + ((PLATFORM_APPLICATION, 0),), +) + +LIST_PLATFORM_APPLICATIONS_OUTPUT: StaticSchema = ( + 18, + n0, + _LPAO, + {_sSI: _cLPAR, _smi: None}, + (_PAl, _NT), + ((LIST_OF_PLATFORM_APPLICATIONS, 0), (STRING, 0)), +) + +LIST_PLATFORM_APPLICATIONS: StaticOperationSchema = ( + 23, + n0, + _LPA, + 0, + LIST_PLATFORM_APPLICATIONS_INPUT, + LIST_PLATFORM_APPLICATIONS_OUTPUT, + ( + AUTHORIZATION_ERROR_EXCEPTION, + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + ), +) + +MAX_ITEMS: StaticSchema = (7, n0, _MI, 0) + +LIST_SMS_SANDBOX_PHONE_NUMBERS_INPUT: StaticSchema = ( + 18, + n0, + _LSMSSPNI, + {_s: None}, + (_NT, _MR), + ((NEXT_TOKEN, 0), (MAX_ITEMS, 0)), +) + +SMS_SANDBOX_PHONE_NUMBER_VERIFICATION_STATUS: StaticSchema = ( + 14, + n0, + _SMSSPNVS, + 0, + (_Pe, _Ve), + ((-1, {_sV: _Pe}), (-1, {_sV: _Ve})), +) + +SMS_SANDBOX_PHONE_NUMBER: StaticSchema = ( + 18, + n0, + _SMSSPN, + 0, + (_PN, _St), + ((PHONE_NUMBER_STRING, 0), (SMS_SANDBOX_PHONE_NUMBER_VERIFICATION_STATUS, 0)), +) + +SMS_SANDBOX_PHONE_NUMBER_LIST: StaticSchema = ( + 16, + n0, + _SMSSPNL, + 0, + (_m,), + ((SMS_SANDBOX_PHONE_NUMBER, 0),), +) + +LIST_SMS_SANDBOX_PHONE_NUMBERS_OUTPUT: StaticSchema = ( + 18, + n0, + _LSMSSPNO, + {_sSI: _cLSMSSPNR, _smi: None}, + (_PNh, _NT), + ((SMS_SANDBOX_PHONE_NUMBER_LIST, 1), (STRING, 0)), +) + +LIST_SMS_SANDBOX_PHONE_NUMBERS: StaticOperationSchema = ( + 23, + n0, + _LSMSSPN, + 0, + LIST_SMS_SANDBOX_PHONE_NUMBERS_INPUT, + LIST_SMS_SANDBOX_PHONE_NUMBERS_OUTPUT, + ( + AUTHORIZATION_ERROR_EXCEPTION, + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLED_EXCEPTION, + ), +) + +LIST_SUBSCRIPTIONS_INPUT: StaticSchema = ( + 18, + n0, + _LSI, + {_s: None}, + (_NT,), + ((NEXT_TOKEN, 0),), +) + +ENDPOINT2: StaticSchema = (3, n0, _End, 0) + +PROTOCOL: StaticSchema = (3, n0, _p, 0) + +SUBSCRIPTION: StaticSchema = ( + 18, + n0, + _Su, + 0, + (_SA, _O, _Pro, _E, _TA), + ( + (SUBSCRIPTION_ARN, 0), + (ACCOUNT, 0), + (PROTOCOL, 0), + (ENDPOINT2, 0), + (TOPIC_ARN, 0), + ), +) + +SUBSCRIPTIONS_LIST: StaticSchema = (16, n0, _SL, 0, (_m,), ((SUBSCRIPTION, 0),)) + +LIST_SUBSCRIPTIONS_OUTPUT: StaticSchema = ( + 18, + n0, + _LSO, + {_sSI: _cLSR, _smi: None}, + (_Sub, _NT), + ((SUBSCRIPTIONS_LIST, 0), (NEXT_TOKEN, 0)), +) + +LIST_SUBSCRIPTIONS: StaticOperationSchema = ( + 23, + n0, + _LSi, + 0, + LIST_SUBSCRIPTIONS_INPUT, + LIST_SUBSCRIPTIONS_OUTPUT, + ( + AUTHORIZATION_ERROR_EXCEPTION, + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + ), +) + +LIST_SUBSCRIPTIONS_BY_TOPIC_INPUT: StaticSchema = ( + 18, + n0, + _LSBTI, + {_s: None}, + (_TA, _NT), + ((TOPIC_ARN, 1), (NEXT_TOKEN, 0)), +) + +LIST_SUBSCRIPTIONS_BY_TOPIC_OUTPUT: StaticSchema = ( + 18, + n0, + _LSBTO, + {_sSI: _cLSBTR, _smi: None}, + (_Sub, _NT), + ((SUBSCRIPTIONS_LIST, 0), (NEXT_TOKEN, 0)), +) + +LIST_SUBSCRIPTIONS_BY_TOPIC: StaticOperationSchema = ( + 23, + n0, + _LSBT, + 0, + LIST_SUBSCRIPTIONS_BY_TOPIC_INPUT, + LIST_SUBSCRIPTIONS_BY_TOPIC_OUTPUT, + ( + AUTHORIZATION_ERROR_EXCEPTION, + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + NOT_FOUND_EXCEPTION, + ), +) + +LIST_TAGS_FOR_RESOURCE_INPUT: StaticSchema = ( + 18, + n0, + _LTFRI, + {_sSI: _cLTFRR, _s: None}, + (_RA,), + ((AMAZON_RESOURCE_NAME, 1),), +) + +LIST_TAGS_FOR_RESOURCE_OUTPUT: StaticSchema = ( + 18, + n0, + _LTFRO, + {_sSI: _cLTFRRo, _smi: None}, + (_Tag,), + ((TAG_LIST, 0),), +) + +LIST_TAGS_FOR_RESOURCE: StaticOperationSchema = ( + 23, + n0, + _LTFR, + 0, + LIST_TAGS_FOR_RESOURCE_INPUT, + LIST_TAGS_FOR_RESOURCE_OUTPUT, + ( + AUTHORIZATION_ERROR_EXCEPTION, + CONCURRENT_ACCESS_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + TAG_POLICY_EXCEPTION, + ), +) + +LIST_TOPICS_INPUT: StaticSchema = (18, n0, _LTI, {_s: None}, (_NT,), ((NEXT_TOKEN, 0),)) + +TOPIC: StaticSchema = (18, n0, _To, 0, (_TA,), ((TOPIC_ARN, 0),)) + +TOPICS_LIST: StaticSchema = (16, n0, _TLo, 0, (_m,), ((TOPIC, 0),)) + +LIST_TOPICS_OUTPUT: StaticSchema = ( + 18, + n0, + _LTO, + {_sSI: _cLTR, _smi: None}, + (_Top, _NT), + ((TOPICS_LIST, 0), (NEXT_TOKEN, 0)), +) + +LIST_TOPICS: StaticOperationSchema = ( + 23, + n0, + _LT, + 0, + LIST_TOPICS_INPUT, + LIST_TOPICS_OUTPUT, + ( + AUTHORIZATION_ERROR_EXCEPTION, + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + ), +) + +OPT_IN_PHONE_NUMBER_INPUT: StaticSchema = ( + 18, + n0, + _OIPNI, + {_s: None}, + (_pN,), + ((PHONE_NUMBER, 1),), +) + +OPT_IN_PHONE_NUMBER_OUTPUT: StaticSchema = (18, n0, _OIPNO, {_sSI: _cOIPNR, _smi: None}) + +OPT_IN_PHONE_NUMBER: StaticOperationSchema = ( + 23, + n0, + _OIPN, + 0, + OPT_IN_PHONE_NUMBER_INPUT, + OPT_IN_PHONE_NUMBER_OUTPUT, + ( + AUTHORIZATION_ERROR_EXCEPTION, + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + THROTTLED_EXCEPTION, + ), +) + +ENDPOINT_DISABLED_EXCEPTION: StaticSchema = ( + 18, + n0, + _EDE, + { + _smit: _c, + _sE: 400, + _aQE: MappingProxyType({"code": "EndpointDisabled", "httpResponseCode": 400}), }, -) - -OTP_CODE = Schema(id=ShapeID("com.amazonaws.sns#OTPCode"), shape_type=ShapeType.STRING) - -VERIFY_SMS_SANDBOX_PHONE_NUMBER_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#VerifySMSSandboxPhoneNumberInput"), - members={ - "PhoneNumber": { - "target": PHONE_NUMBER_STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "OneTimePassword": { - "target": OTP_CODE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, + (_me,), + ((STRING, 0),), +) + +INVALID_PARAMETER_VALUE_EXCEPTION: StaticSchema = ( + 18, + n0, + _IPVE, + { + _smit: _c, + _sE: 400, + _aQE: MappingProxyType( + {"code": "ParameterValueInvalid", "httpResponseCode": 400} + ), }, -) - -VERIFY_SMS_SANDBOX_PHONE_NUMBER_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sns#VerifySMSSandboxPhoneNumberOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sns#VerifySMSSandboxPhoneNumberResult", - ) - ], -) - -VERIFY_SMS_SANDBOX_PHONE_NUMBER = Schema( - id=ShapeID("com.amazonaws.sns#VerifySMSSandboxPhoneNumber"), - shape_type=ShapeType.OPERATION, -) - -AMAZON_SIMPLE_NOTIFICATION_SERVICE = Schema( - id=ShapeID("com.amazonaws.sns#AmazonSimpleNotificationService"), - shape_type=ShapeType.SERVICE, - traits=[ - Trait.new( - id=ShapeID("aws.auth#sigv4"), value=MappingProxyType({"name": "sns"}) + (_me,), + ((STRING, 0),), +) + +KMS_ACCESS_DENIED_EXCEPTION: StaticSchema = ( + 18, + n0, + _KMSADE, + { + _smit: _c, + _sE: 400, + _aQE: MappingProxyType({"code": "KMSAccessDenied", "httpResponseCode": 400}), + }, + (_me,), + ((STRING, 0),), +) + +KMS_DISABLED_EXCEPTION: StaticSchema = ( + 18, + n0, + _KMSDE, + { + _smit: _c, + _sE: 400, + _aQE: MappingProxyType({"code": "KMSDisabled", "httpResponseCode": 400}), + }, + (_me,), + ((STRING, 0),), +) + +KMS_INVALID_STATE_EXCEPTION: StaticSchema = ( + 18, + n0, + _KMSISE, + { + _smit: _c, + _sE: 400, + _aQE: MappingProxyType({"code": "KMSInvalidState", "httpResponseCode": 400}), + }, + (_me,), + ((STRING, 0),), +) + +KMS_NOT_FOUND_EXCEPTION: StaticSchema = ( + 18, + n0, + _KMSNFE, + { + _smit: _c, + _sE: 400, + _aQE: MappingProxyType({"code": "KMSNotFound", "httpResponseCode": 400}), + }, + (_me,), + ((STRING, 0),), +) + +KMS_OPT_IN_REQUIRED: StaticSchema = ( + 18, + n0, + _KMSOIR, + { + _smit: _c, + _sE: 403, + _aQE: MappingProxyType({"code": "KMSOptInRequired", "httpResponseCode": 403}), + }, + (_me,), + ((STRING, 0),), +) + +KMS_THROTTLING_EXCEPTION: StaticSchema = ( + 18, + n0, + _KMSTE, + { + _smit: _c, + _sE: 400, + _aQE: MappingProxyType({"code": "KMSThrottling", "httpResponseCode": 400}), + }, + (_me,), + ((STRING, 0),), +) + +PLATFORM_APPLICATION_DISABLED_EXCEPTION: StaticSchema = ( + 18, + n0, + _PADE, + { + _smit: _c, + _sE: 400, + _aQE: MappingProxyType( + {"code": "PlatformApplicationDisabled", "httpResponseCode": 400} ), - Trait.new(id=ShapeID("aws.protocols#awsQuery")), - Trait.new( - id=ShapeID("smithy.rules#endpointBdd"), - value=MappingProxyType( - { - "version": "1.1", - "parameters": MappingProxyType( - { - "Region": MappingProxyType( - { - "builtIn": "AWS::Region", - "required": False, - "documentation": "The AWS region used to dispatch the request.", - "type": "string", - } - ), - "UseDualStack": MappingProxyType( - { - "builtIn": "AWS::UseDualStack", - "required": True, - "default": False, - "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", - "type": "boolean", - } - ), - "UseFIPS": MappingProxyType( - { - "builtIn": "AWS::UseFIPS", - "required": True, - "default": False, - "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", - "type": "boolean", - } - ), - "Endpoint": MappingProxyType( - { - "builtIn": "SDK::Endpoint", - "required": False, - "documentation": "Override the endpoint used to send this request", - "type": "string", - } - ), - } - ), - "conditions": ( - MappingProxyType( - { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "Endpoint"}),), - } - ), - MappingProxyType( - { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "Region"}),), - } - ), - MappingProxyType( - { - "fn": "aws.partition", - "argv": (MappingProxyType({"ref": "Region"}),), - "assign": "PartitionResult", - } - ), - MappingProxyType( - { - "fn": "booleanEquals", - "argv": (MappingProxyType({"ref": "UseFIPS"}), True), - } - ), - MappingProxyType( - { - "fn": "booleanEquals", - "argv": ( - MappingProxyType({"ref": "UseDualStack"}), - True, - ), - } - ), - MappingProxyType( + }, + (_me,), + ((STRING, 0),), +) + +MESSAGE: StaticSchema = (3, n0, _me, 0) + +BINARY: StaticSchema = (1, n0, _B, 0) + +MESSAGE_ATTRIBUTE_VALUE: StaticSchema = ( + 18, + n0, + _MAV, + 0, + (_DTa, _SV, _BV), + ((STRING, 1), (STRING, 0), (BINARY, 0)), +) + +MESSAGE_ATTRIBUTE_MAP: StaticSchema = ( + 17, + n0, + _MAM, + 0, + (_k, _v), + ((STRING, {_sN: _N}), (MESSAGE_ATTRIBUTE_VALUE, {_sN: _V})), +) + +MESSAGE_STRUCTURE: StaticSchema = (3, n0, _mS, 0) + +SUBJECT: StaticSchema = (3, n0, _su, 0) + +PUBLISH_INPUT: StaticSchema = ( + 18, + n0, + _PI, + {_s: None}, + (_TA, _TAa, _PN, _M, _Subj, _MS, _MA, _MDI, _MGI), + ( + (TOPIC_ARN, 0), + (STRING, 0), + (PHONE_NUMBER, 0), + (MESSAGE, 1), + (SUBJECT, 0), + (MESSAGE_STRUCTURE, 0), + (MESSAGE_ATTRIBUTE_MAP, 0), + (STRING, 0), + (STRING, 0), + ), +) + +MESSAGE_ID: StaticSchema = (3, n0, _mI, 0) + +PUBLISH_OUTPUT: StaticSchema = ( + 18, + n0, + _PO, + {_sSI: _cPR, _smi: None}, + (_MIe, _SN), + ((MESSAGE_ID, 0), (STRING, 0)), +) + +PUBLISH: StaticOperationSchema = ( + 23, + n0, + _Pu, + 0, + PUBLISH_INPUT, + PUBLISH_OUTPUT, + ( + AUTHORIZATION_ERROR_EXCEPTION, + ENDPOINT_DISABLED_EXCEPTION, + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + INVALID_PARAMETER_VALUE_EXCEPTION, + INVALID_SECURITY_EXCEPTION, + KMS_ACCESS_DENIED_EXCEPTION, + KMS_DISABLED_EXCEPTION, + KMS_INVALID_STATE_EXCEPTION, + KMS_NOT_FOUND_EXCEPTION, + KMS_OPT_IN_REQUIRED, + KMS_THROTTLING_EXCEPTION, + NOT_FOUND_EXCEPTION, + PLATFORM_APPLICATION_DISABLED_EXCEPTION, + VALIDATION_EXCEPTION, + ), +) + +BATCH_ENTRY_IDS_NOT_DISTINCT_EXCEPTION: StaticSchema = ( + 18, + n0, + _BEINDE, + { + _smit: _c, + _sE: 400, + _aQE: MappingProxyType( + {"code": "BatchEntryIdsNotDistinct", "httpResponseCode": 400} + ), + }, + (_me,), + ((STRING, 0),), +) + +BATCH_REQUEST_TOO_LONG_EXCEPTION: StaticSchema = ( + 18, + n0, + _BRTLE, + { + _smit: _c, + _sE: 400, + _aQE: MappingProxyType( + {"code": "BatchRequestTooLong", "httpResponseCode": 400} + ), + }, + (_me,), + ((STRING, 0),), +) + +EMPTY_BATCH_REQUEST_EXCEPTION: StaticSchema = ( + 18, + n0, + _EBRE, + { + _smit: _c, + _sE: 400, + _aQE: MappingProxyType({"code": "EmptyBatchRequest", "httpResponseCode": 400}), + }, + (_me,), + ((STRING, 0),), +) + +INVALID_BATCH_ENTRY_ID_EXCEPTION: StaticSchema = ( + 18, + n0, + _IBEIE, + { + _smit: _c, + _sE: 400, + _aQE: MappingProxyType( + {"code": "InvalidBatchEntryId", "httpResponseCode": 400} + ), + }, + (_me,), + ((STRING, 0),), +) + +PUBLISH_BATCH_REQUEST_ENTRY: StaticSchema = ( + 18, + n0, + _PBRE, + 0, + (_I, _M, _Subj, _MS, _MA, _MDI, _MGI), + ( + (STRING, 1), + (MESSAGE, 1), + (SUBJECT, 0), + (MESSAGE_STRUCTURE, 0), + (MESSAGE_ATTRIBUTE_MAP, 0), + (STRING, 0), + (STRING, 0), + ), +) + +PUBLISH_BATCH_REQUEST_ENTRY_LIST: StaticSchema = ( + 16, + n0, + _PBREL, + 0, + (_m,), + ((PUBLISH_BATCH_REQUEST_ENTRY, 0),), +) + +PUBLISH_BATCH_INPUT: StaticSchema = ( + 18, + n0, + _PBI, + {_s: None}, + (_TA, _PBREu), + ((TOPIC_ARN, 1), (PUBLISH_BATCH_REQUEST_ENTRY_LIST, 1)), +) + +BATCH_RESULT_ERROR_ENTRY: StaticSchema = ( + 18, + n0, + _BREE, + 0, + (_I, _C, _M, _SF), + ((STRING, 1), (STRING, 1), (STRING, 0), (BOOLEAN, {_smithy: False, _sm: None})), +) + +BATCH_RESULT_ERROR_ENTRY_LIST: StaticSchema = ( + 16, + n0, + _BREEL, + 0, + (_m,), + ((BATCH_RESULT_ERROR_ENTRY, 0),), +) + +PUBLISH_BATCH_RESULT_ENTRY: StaticSchema = ( + 18, + n0, + _PBREub, + 0, + (_I, _MIe, _SN), + ((STRING, 0), (MESSAGE_ID, 0), (STRING, 0)), +) + +PUBLISH_BATCH_RESULT_ENTRY_LIST: StaticSchema = ( + 16, + n0, + _PBRELu, + 0, + (_m,), + ((PUBLISH_BATCH_RESULT_ENTRY, 0),), +) + +PUBLISH_BATCH_OUTPUT: StaticSchema = ( + 18, + n0, + _PBO, + {_sSI: _cPBR, _smi: None}, + (_Suc, _F), + ((PUBLISH_BATCH_RESULT_ENTRY_LIST, 0), (BATCH_RESULT_ERROR_ENTRY_LIST, 0)), +) + +TOO_MANY_ENTRIES_IN_BATCH_REQUEST_EXCEPTION: StaticSchema = ( + 18, + n0, + _TMEIBRE, + { + _smit: _c, + _sE: 400, + _aQE: MappingProxyType( + {"code": "TooManyEntriesInBatchRequest", "httpResponseCode": 400} + ), + }, + (_me,), + ((STRING, 0),), +) + +PUBLISH_BATCH: StaticOperationSchema = ( + 23, + n0, + _PB, + 0, + PUBLISH_BATCH_INPUT, + PUBLISH_BATCH_OUTPUT, + ( + AUTHORIZATION_ERROR_EXCEPTION, + BATCH_ENTRY_IDS_NOT_DISTINCT_EXCEPTION, + BATCH_REQUEST_TOO_LONG_EXCEPTION, + EMPTY_BATCH_REQUEST_EXCEPTION, + ENDPOINT_DISABLED_EXCEPTION, + INTERNAL_ERROR_EXCEPTION, + INVALID_BATCH_ENTRY_ID_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + INVALID_PARAMETER_VALUE_EXCEPTION, + INVALID_SECURITY_EXCEPTION, + KMS_ACCESS_DENIED_EXCEPTION, + KMS_DISABLED_EXCEPTION, + KMS_INVALID_STATE_EXCEPTION, + KMS_NOT_FOUND_EXCEPTION, + KMS_OPT_IN_REQUIRED, + KMS_THROTTLING_EXCEPTION, + NOT_FOUND_EXCEPTION, + PLATFORM_APPLICATION_DISABLED_EXCEPTION, + TOO_MANY_ENTRIES_IN_BATCH_REQUEST_EXCEPTION, + VALIDATION_EXCEPTION, + ), +) + +PUT_DATA_PROTECTION_POLICY_INPUT: StaticSchema = ( + 18, + n0, + _PDPPI, + {_s: None}, + (_RA, _DPP), + ((TOPIC_ARN, 1), (ATTRIBUTE_VALUE, 1)), +) + +PUT_DATA_PROTECTION_POLICY_OUTPUT: StaticSchema = ( + 18, + n0, + _PDPPO, + {_sSI: _sU, _smi: None}, +) + +PUT_DATA_PROTECTION_POLICY: StaticOperationSchema = ( + 23, + n0, + _PDPP, + 0, + PUT_DATA_PROTECTION_POLICY_INPUT, + PUT_DATA_PROTECTION_POLICY_OUTPUT, + ( + AUTHORIZATION_ERROR_EXCEPTION, + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + INVALID_SECURITY_EXCEPTION, + NOT_FOUND_EXCEPTION, + ), +) + +REMOVE_PERMISSION_INPUT: StaticSchema = ( + 18, + n0, + _RPI, + {_s: None}, + (_TA, _L), + ((TOPIC_ARN, 1), (LABEL, 1)), +) + +REMOVE_PERMISSION_OUTPUT: StaticSchema = (18, n0, _RPO, {_sSI: _sU, _smi: None}) + +REMOVE_PERMISSION: StaticOperationSchema = ( + 23, + n0, + _RP, + 0, + REMOVE_PERMISSION_INPUT, + REMOVE_PERMISSION_OUTPUT, + ( + AUTHORIZATION_ERROR_EXCEPTION, + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + NOT_FOUND_EXCEPTION, + ), +) + +SET_ENDPOINT_ATTRIBUTES_INPUT: StaticSchema = ( + 18, + n0, + _SEAI, + {_s: None}, + (_EA, _A), + ((STRING, 1), (MAP_STRING_TO_STRING, 1)), +) + +SET_ENDPOINT_ATTRIBUTES_OUTPUT: StaticSchema = (18, n0, _SEAO, {_sSI: _sU, _smi: None}) + +SET_ENDPOINT_ATTRIBUTES: StaticOperationSchema = ( + 23, + n0, + _SEA, + 0, + SET_ENDPOINT_ATTRIBUTES_INPUT, + SET_ENDPOINT_ATTRIBUTES_OUTPUT, + ( + AUTHORIZATION_ERROR_EXCEPTION, + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + NOT_FOUND_EXCEPTION, + ), +) + +SET_PLATFORM_APPLICATION_ATTRIBUTES_INPUT: StaticSchema = ( + 18, + n0, + _SPAAI, + {_s: None}, + (_PAA, _A), + ((STRING, 1), (MAP_STRING_TO_STRING, 1)), +) + +SET_PLATFORM_APPLICATION_ATTRIBUTES_OUTPUT: StaticSchema = ( + 18, + n0, + _SPAAO, + {_sSI: _sU, _smi: None}, +) + +SET_PLATFORM_APPLICATION_ATTRIBUTES: StaticOperationSchema = ( + 23, + n0, + _SPAA, + 0, + SET_PLATFORM_APPLICATION_ATTRIBUTES_INPUT, + SET_PLATFORM_APPLICATION_ATTRIBUTES_OUTPUT, + ( + AUTHORIZATION_ERROR_EXCEPTION, + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + NOT_FOUND_EXCEPTION, + ), +) + +SET_SMS_ATTRIBUTES_INPUT: StaticSchema = ( + 18, + n0, + _SSMSAI, + {_s: None}, + (_at,), + ((MAP_STRING_TO_STRING, 1),), +) + +SET_SMS_ATTRIBUTES_OUTPUT: StaticSchema = ( + 18, + n0, + _SSMSAO, + {_sSI: _cSSMSAR, _smi: None}, +) + +SET_SMS_ATTRIBUTES: StaticOperationSchema = ( + 23, + n0, + _SSMSA, + 0, + SET_SMS_ATTRIBUTES_INPUT, + SET_SMS_ATTRIBUTES_OUTPUT, + ( + AUTHORIZATION_ERROR_EXCEPTION, + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + THROTTLED_EXCEPTION, + ), +) + +SET_SUBSCRIPTION_ATTRIBUTES_INPUT: StaticSchema = ( + 18, + n0, + _SSAI, + {_s: None}, + (_SA, _ANt, _AV), + ((SUBSCRIPTION_ARN, 1), (ATTRIBUTE_NAME, 1), (ATTRIBUTE_VALUE, 0)), +) + +SET_SUBSCRIPTION_ATTRIBUTES_OUTPUT: StaticSchema = ( + 18, + n0, + _SSAO, + {_sSI: _sU, _smi: None}, +) + +SET_SUBSCRIPTION_ATTRIBUTES: StaticOperationSchema = ( + 23, + n0, + _SSA, + 0, + SET_SUBSCRIPTION_ATTRIBUTES_INPUT, + SET_SUBSCRIPTION_ATTRIBUTES_OUTPUT, + ( + AUTHORIZATION_ERROR_EXCEPTION, + FILTER_POLICY_LIMIT_EXCEEDED_EXCEPTION, + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + NOT_FOUND_EXCEPTION, + REPLAY_LIMIT_EXCEEDED_EXCEPTION, + ), +) + +SET_TOPIC_ATTRIBUTES_INPUT: StaticSchema = ( + 18, + n0, + _STAI, + {_s: None}, + (_TA, _ANt, _AV), + ((TOPIC_ARN, 1), (ATTRIBUTE_NAME, 1), (ATTRIBUTE_VALUE, 0)), +) + +SET_TOPIC_ATTRIBUTES_OUTPUT: StaticSchema = (18, n0, _STAO, {_sSI: _sU, _smi: None}) + +SET_TOPIC_ATTRIBUTES: StaticOperationSchema = ( + 23, + n0, + _STA, + 0, + SET_TOPIC_ATTRIBUTES_INPUT, + SET_TOPIC_ATTRIBUTES_OUTPUT, + ( + AUTHORIZATION_ERROR_EXCEPTION, + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + INVALID_SECURITY_EXCEPTION, + NOT_FOUND_EXCEPTION, + ), +) + +SUBSCRIBE_INPUT: StaticSchema = ( + 18, + n0, + _SI, + {_s: None}, + (_TA, _Pro, _E, _A, _RSA), + ( + (TOPIC_ARN, 1), + (PROTOCOL, 1), + (ENDPOINT2, 0), + (SUBSCRIPTION_ATTRIBUTES_MAP, 0), + (BOOLEAN, {_smithy: False}), + ), +) + +SUBSCRIBE_OUTPUT: StaticSchema = ( + 18, + n0, + _SO, + {_sSI: _cSR, _smi: None}, + (_SA,), + ((SUBSCRIPTION_ARN, 0),), +) + +SUBSCRIBE: StaticOperationSchema = ( + 23, + n0, + _Subs, + 0, + SUBSCRIBE_INPUT, + SUBSCRIBE_OUTPUT, + ( + AUTHORIZATION_ERROR_EXCEPTION, + FILTER_POLICY_LIMIT_EXCEEDED_EXCEPTION, + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + INVALID_SECURITY_EXCEPTION, + NOT_FOUND_EXCEPTION, + REPLAY_LIMIT_EXCEEDED_EXCEPTION, + SUBSCRIPTION_LIMIT_EXCEEDED_EXCEPTION, + ), +) + +TAG_RESOURCE_INPUT: StaticSchema = ( + 18, + n0, + _TRI, + {_sSI: _cTRR, _s: None}, + (_RA, _Tag), + ((AMAZON_RESOURCE_NAME, 1), (TAG_LIST, 1)), +) + +TAG_RESOURCE_OUTPUT: StaticSchema = (18, n0, _TRO, {_sSI: _cTRRo, _smi: None}) + +TAG_RESOURCE: StaticOperationSchema = ( + 23, + n0, + _TR, + 0, + TAG_RESOURCE_INPUT, + TAG_RESOURCE_OUTPUT, + ( + AUTHORIZATION_ERROR_EXCEPTION, + CONCURRENT_ACCESS_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + STALE_TAG_EXCEPTION, + TAG_LIMIT_EXCEEDED_EXCEPTION, + TAG_POLICY_EXCEPTION, + ), +) + +UNSUBSCRIBE_INPUT: StaticSchema = ( + 18, + n0, + _UI, + {_s: None}, + (_SA,), + ((SUBSCRIPTION_ARN, 1),), +) + +UNSUBSCRIBE_OUTPUT: StaticSchema = (18, n0, _UO, {_sSI: _sU, _smi: None}) + +UNSUBSCRIBE: StaticOperationSchema = ( + 23, + n0, + _U, + 0, + UNSUBSCRIBE_INPUT, + UNSUBSCRIBE_OUTPUT, + ( + AUTHORIZATION_ERROR_EXCEPTION, + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + INVALID_SECURITY_EXCEPTION, + NOT_FOUND_EXCEPTION, + ), +) + +TAG_KEY_LIST: StaticSchema = (16, n0, _TKL, 0, (_m,), ((TAG_KEY, 0),)) + +UNTAG_RESOURCE_INPUT: StaticSchema = ( + 18, + n0, + _URI, + {_sSI: _cURR, _s: None}, + (_RA, _TKa), + ((AMAZON_RESOURCE_NAME, 1), (TAG_KEY_LIST, 1)), +) + +UNTAG_RESOURCE_OUTPUT: StaticSchema = (18, n0, _URO, {_sSI: _cURRo, _smi: None}) + +UNTAG_RESOURCE: StaticOperationSchema = ( + 23, + n0, + _UR, + 0, + UNTAG_RESOURCE_INPUT, + UNTAG_RESOURCE_OUTPUT, + ( + AUTHORIZATION_ERROR_EXCEPTION, + CONCURRENT_ACCESS_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + STALE_TAG_EXCEPTION, + TAG_LIMIT_EXCEEDED_EXCEPTION, + TAG_POLICY_EXCEPTION, + ), +) + +VERIFICATION_EXCEPTION: StaticSchema = ( + 18, + n0, + _VEe, + {_smit: _c}, + (_M, _St), + ((STRING, 1), (STRING, 1)), +) + +OTP_CODE: StaticSchema = (3, n0, _OTPC, 0) + +VERIFY_SMS_SANDBOX_PHONE_NUMBER_INPUT: StaticSchema = ( + 18, + n0, + _VSMSSPNI, + {_s: None}, + (_PN, _OTP), + ((PHONE_NUMBER_STRING, 1), (OTP_CODE, 1)), +) + +VERIFY_SMS_SANDBOX_PHONE_NUMBER_OUTPUT: StaticSchema = ( + 18, + n0, + _VSMSSPNO, + {_sSI: _cVSMSSPNR, _smi: None}, +) + +VERIFY_SMS_SANDBOX_PHONE_NUMBER: StaticOperationSchema = ( + 23, + n0, + _VSMSSPN, + 0, + VERIFY_SMS_SANDBOX_PHONE_NUMBER_INPUT, + VERIFY_SMS_SANDBOX_PHONE_NUMBER_OUTPUT, + ( + AUTHORIZATION_ERROR_EXCEPTION, + INTERNAL_ERROR_EXCEPTION, + INVALID_PARAMETER_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + THROTTLED_EXCEPTION, + VERIFICATION_EXCEPTION, + ), +) + +AMAZON_SIMPLE_NOTIFICATION_SERVICE: StaticSchema = ( + 21, + n0, + _ASNS, + { + _aw: MappingProxyType({"name": "sns"}), + _aQ: None, + _sB: MappingProxyType( + { + "version": "1.1", + "parameters": MappingProxyType( + { + "Region": MappingProxyType( { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "supportsDualStack", - ), - } - ), - True, - ), + "builtIn": "AWS::Region", + "required": False, + "documentation": "The AWS region used to dispatch the request.", + "type": "string", } ), - MappingProxyType( + "UseDualStack": MappingProxyType( { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "supportsFIPS", - ), - } - ), - True, - ), + "builtIn": "AWS::UseDualStack", + "required": True, + "default": False, + "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", + "type": "boolean", } ), - MappingProxyType( + "UseFIPS": MappingProxyType( { - "fn": "stringEquals", - "argv": ( - MappingProxyType({"ref": "Region"}), - "us-gov-east-1", - ), + "builtIn": "AWS::UseFIPS", + "required": True, + "default": False, + "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", + "type": "boolean", } ), - MappingProxyType( + "Endpoint": MappingProxyType( { - "fn": "stringEquals", - "argv": ( - MappingProxyType({"ref": "Region"}), - "us-gov-west-1", - ), + "builtIn": "SDK::Endpoint", + "required": False, + "documentation": "Override the endpoint used to send this request", + "type": "string", } ), + } + ), + "conditions": ( + MappingProxyType( + { + "fn": "isSet", + "argv": (MappingProxyType({"ref": "Endpoint"}),), + } ), - "results": ( - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: FIPS and custom endpoint are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": MappingProxyType({"ref": "Endpoint"}), - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://sns-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "FIPS and DualStack are enabled, but this partition does not support one or both", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://sns.us-gov-east-1.amazonaws.com", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://sns.us-gov-west-1.amazonaws.com", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://sns-fips.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "FIPS is enabled but this partition does not support FIPS", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + MappingProxyType( + {"fn": "isSet", "argv": (MappingProxyType({"ref": "Region"}),)} + ), + MappingProxyType( + { + "fn": "aws.partition", + "argv": (MappingProxyType({"ref": "Region"}),), + "assign": "PartitionResult", + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": (MappingProxyType({"ref": "UseFIPS"}), True), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": (MappingProxyType({"ref": "UseDualStack"}), True), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( { - "url": "https://sns.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "supportsDualStack", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "DualStack is enabled but this partition does not support DualStack", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + True, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( { - "url": "https://sns.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "supportsFIPS", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: Missing Region", - "type": "error", - } - ), + True, + ), + } ), - "root": 2, - "nodeCount": 15, - "nodes": "/////wAAAAH/////AAAAAAAAAA4AAAADAAAAAQAAAAQF9eENAAAAAgAAAAUF9eENAAAAAwAAAAgAAAAGAAAABAAAAAcF9eEMAAAABQX14QoF9eELAAAABAAAAAwAAAAJAAAABgAAAAoF9eEJAAAABwX14QYAAAALAAAACAX14QcF9eEIAAAABQAAAA0F9eEFAAAABgX14QQF9eEFAAAAAwX14QEAAAAPAAAABAX14QIF9eED", - } - ), - ), - Trait.new( - id=ShapeID("aws.api#service"), - value=MappingProxyType( - { - "sdkId": "SNS", - "arnNamespace": "sns", - "cloudFormationName": "SNS", - "cloudTrailEventSource": "sns.amazonaws.com", - "endpointPrefix": "sns", - } - ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType({"ref": "Region"}), + "us-gov-east-1", + ), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType({"ref": "Region"}), + "us-gov-west-1", + ), + } + ), + ), + "results": ( + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: FIPS and custom endpoint are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": MappingProxyType({"ref": "Endpoint"}), + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://sns-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS and DualStack are enabled, but this partition does not support one or both", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://sns.us-gov-east-1.amazonaws.com", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://sns.us-gov-west-1.amazonaws.com", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://sns-fips.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS is enabled but this partition does not support FIPS", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://sns.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "DualStack is enabled but this partition does not support DualStack", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://sns.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Missing Region", + "type": "error", + } + ), + ), + "root": 2, + "nodeCount": 15, + "nodes": "/////wAAAAH/////AAAAAAAAAA4AAAADAAAAAQAAAAQF9eENAAAAAgAAAAUF9eENAAAAAwAAAAgAAAAGAAAABAAAAAcF9eEMAAAABQX14QoF9eELAAAABAAAAAwAAAAJAAAABgAAAAoF9eEJAAAABwX14QYAAAALAAAACAX14QcF9eEIAAAABQAAAA0F9eEFAAAABgX14QQF9eEFAAAAAwX14QEAAAAPAAAABAX14QIF9eED", + } ), - Trait.new( - id=ShapeID("smithy.api#xmlNamespace"), - value=MappingProxyType({"uri": "http://sns.amazonaws.com/doc/2010-03-31/"}), + _aws: MappingProxyType( + { + "sdkId": "SNS", + "arnNamespace": "sns", + "cloudFormationName": "SNS", + "cloudTrailEventSource": "sns.amazonaws.com", + "endpointPrefix": "sns", + } ), - ], + _sNm: MappingProxyType({"uri": "http://sns.amazonaws.com/doc/2010-03-31/"}), + }, ) diff --git a/clients/aws-sdk-sns/src/aws_sdk_sns/client.py b/clients/aws-sdk-sns/src/aws_sdk_sns/client.py index 7fc26da7..1bd22305 100644 --- a/clients/aws-sdk-sns/src/aws_sdk_sns/client.py +++ b/clients/aws-sdk-sns/src/aws_sdk_sns/client.py @@ -1,55 +1,35 @@ # Code generated by smithy-python-codegen DO NOT EDIT. +from __future__ import annotations + from copy import deepcopy import logging from typing import Any, cast +from smithy_aws_core.aio.identity.chain import AsyncIdentityChain from smithy_aws_core.config import ConfigSource from smithy_aws_core.identity import AWSCredentialsIdentity -from smithy_aws_core.identity.chain import IdentityChain -from smithy_core.aio.client import AsyncClient, ClientCall, RequestPipeline +from smithy_core.aio.client import AsyncClient, AsyncClientCall, AsyncRequestPipeline from smithy_core.deserializers import DeserializeableShape from smithy_core.exceptions import ExpectationNotMetError from smithy_core.schemas import APIOperation from smithy_core.serializers import SerializeableShape -from smithy_http.aio.interfaces import HTTPClient +from smithy_http.aio.interfaces import AsyncHTTPClient from smithy_http.plugins import user_agent_plugin from .config import AsyncSNSConfig, Plugin from .models import ( ADD_PERMISSION, - AddPermissionInput, - AddPermissionOutput, CHECK_IF_PHONE_NUMBER_IS_OPTED_OUT, CONFIRM_SUBSCRIPTION, CREATE_PLATFORM_APPLICATION, CREATE_PLATFORM_ENDPOINT, CREATE_SMS_SANDBOX_PHONE_NUMBER, CREATE_TOPIC, - CheckIfPhoneNumberIsOptedOutInput, - CheckIfPhoneNumberIsOptedOutOutput, - ConfirmSubscriptionInput, - ConfirmSubscriptionOutput, - CreatePlatformApplicationInput, - CreatePlatformApplicationOutput, - CreatePlatformEndpointInput, - CreatePlatformEndpointOutput, - CreateSMSSandboxPhoneNumberInput, - CreateSMSSandboxPhoneNumberOutput, - CreateTopicInput, - CreateTopicOutput, DELETE_ENDPOINT, DELETE_PLATFORM_APPLICATION, DELETE_SMS_SANDBOX_PHONE_NUMBER, DELETE_TOPIC, - DeleteEndpointInput, - DeleteEndpointOutput, - DeletePlatformApplicationInput, - DeletePlatformApplicationOutput, - DeleteSMSSandboxPhoneNumberInput, - DeleteSMSSandboxPhoneNumberOutput, - DeleteTopicInput, - DeleteTopicOutput, GET_DATA_PROTECTION_POLICY, GET_ENDPOINT_ATTRIBUTES, GET_PLATFORM_APPLICATION_ATTRIBUTES, @@ -57,20 +37,6 @@ GET_SMS_SANDBOX_ACCOUNT_STATUS, GET_SUBSCRIPTION_ATTRIBUTES, GET_TOPIC_ATTRIBUTES, - GetDataProtectionPolicyInput, - GetDataProtectionPolicyOutput, - GetEndpointAttributesInput, - GetEndpointAttributesOutput, - GetPlatformApplicationAttributesInput, - GetPlatformApplicationAttributesOutput, - GetSMSAttributesInput, - GetSMSAttributesOutput, - GetSMSSandboxAccountStatusInput, - GetSMSSandboxAccountStatusOutput, - GetSubscriptionAttributesInput, - GetSubscriptionAttributesOutput, - GetTopicAttributesInput, - GetTopicAttributesOutput, LIST_ENDPOINTS_BY_PLATFORM_APPLICATION, LIST_ORIGINATION_NUMBERS, LIST_PHONE_NUMBERS_OPTED_OUT, @@ -80,72 +46,114 @@ LIST_SUBSCRIPTIONS_BY_TOPIC, LIST_TAGS_FOR_RESOURCE, LIST_TOPICS, - ListEndpointsByPlatformApplicationInput, - ListEndpointsByPlatformApplicationOutput, - ListOriginationNumbersInput, - ListOriginationNumbersOutput, - ListPhoneNumbersOptedOutInput, - ListPhoneNumbersOptedOutOutput, - ListPlatformApplicationsInput, - ListPlatformApplicationsOutput, - ListSMSSandboxPhoneNumbersInput, - ListSMSSandboxPhoneNumbersOutput, - ListSubscriptionsByTopicInput, - ListSubscriptionsByTopicOutput, - ListSubscriptionsInput, - ListSubscriptionsOutput, - ListTagsForResourceInput, - ListTagsForResourceOutput, - ListTopicsInput, - ListTopicsOutput, OPT_IN_PHONE_NUMBER, - OptInPhoneNumberInput, - OptInPhoneNumberOutput, PUBLISH, PUBLISH_BATCH, PUT_DATA_PROTECTION_POLICY, - PublishBatchInput, - PublishBatchOutput, - PublishInput, - PublishOutput, - PutDataProtectionPolicyInput, - PutDataProtectionPolicyOutput, REMOVE_PERMISSION, - RemovePermissionInput, - RemovePermissionOutput, SET_ENDPOINT_ATTRIBUTES, SET_PLATFORM_APPLICATION_ATTRIBUTES, SET_SMS_ATTRIBUTES, SET_SUBSCRIPTION_ATTRIBUTES, SET_TOPIC_ATTRIBUTES, SUBSCRIBE, - SetEndpointAttributesInput, - SetEndpointAttributesOutput, - SetPlatformApplicationAttributesInput, - SetPlatformApplicationAttributesOutput, - SetSMSAttributesInput, - SetSMSAttributesOutput, - SetSubscriptionAttributesInput, - SetSubscriptionAttributesOutput, - SetTopicAttributesInput, - SetTopicAttributesOutput, - SubscribeInput, - SubscribeOutput, TAG_RESOURCE, - TagResourceInput, - TagResourceOutput, UNSUBSCRIBE, UNTAG_RESOURCE, - UnsubscribeInput, - UnsubscribeOutput, - UntagResourceInput, - UntagResourceOutput, VERIFY_SMS_SANDBOX_PHONE_NUMBER, - VerifySMSSandboxPhoneNumberInput, - VerifySMSSandboxPhoneNumberOutput, ) from .user_agent import aws_user_agent_plugin +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .models import ( + AddPermissionInput, + AddPermissionOutput, + CheckIfPhoneNumberIsOptedOutInput, + CheckIfPhoneNumberIsOptedOutOutput, + ConfirmSubscriptionInput, + ConfirmSubscriptionOutput, + CreatePlatformApplicationInput, + CreatePlatformApplicationOutput, + CreatePlatformEndpointInput, + CreatePlatformEndpointOutput, + CreateSMSSandboxPhoneNumberInput, + CreateSMSSandboxPhoneNumberOutput, + CreateTopicInput, + CreateTopicOutput, + DeleteEndpointInput, + DeleteEndpointOutput, + DeletePlatformApplicationInput, + DeletePlatformApplicationOutput, + DeleteSMSSandboxPhoneNumberInput, + DeleteSMSSandboxPhoneNumberOutput, + DeleteTopicInput, + DeleteTopicOutput, + GetDataProtectionPolicyInput, + GetDataProtectionPolicyOutput, + GetEndpointAttributesInput, + GetEndpointAttributesOutput, + GetPlatformApplicationAttributesInput, + GetPlatformApplicationAttributesOutput, + GetSMSAttributesInput, + GetSMSAttributesOutput, + GetSMSSandboxAccountStatusInput, + GetSMSSandboxAccountStatusOutput, + GetSubscriptionAttributesInput, + GetSubscriptionAttributesOutput, + GetTopicAttributesInput, + GetTopicAttributesOutput, + ListEndpointsByPlatformApplicationInput, + ListEndpointsByPlatformApplicationOutput, + ListOriginationNumbersInput, + ListOriginationNumbersOutput, + ListPhoneNumbersOptedOutInput, + ListPhoneNumbersOptedOutOutput, + ListPlatformApplicationsInput, + ListPlatformApplicationsOutput, + ListSMSSandboxPhoneNumbersInput, + ListSMSSandboxPhoneNumbersOutput, + ListSubscriptionsByTopicInput, + ListSubscriptionsByTopicOutput, + ListSubscriptionsInput, + ListSubscriptionsOutput, + ListTagsForResourceInput, + ListTagsForResourceOutput, + ListTopicsInput, + ListTopicsOutput, + OptInPhoneNumberInput, + OptInPhoneNumberOutput, + PublishBatchInput, + PublishBatchOutput, + PublishInput, + PublishOutput, + PutDataProtectionPolicyInput, + PutDataProtectionPolicyOutput, + RemovePermissionInput, + RemovePermissionOutput, + SetEndpointAttributesInput, + SetEndpointAttributesOutput, + SetPlatformApplicationAttributesInput, + SetPlatformApplicationAttributesOutput, + SetSMSAttributesInput, + SetSMSAttributesOutput, + SetSubscriptionAttributesInput, + SetSubscriptionAttributesOutput, + SetTopicAttributesInput, + SetTopicAttributesOutput, + SubscribeInput, + SubscribeOutput, + TagResourceInput, + TagResourceOutput, + UnsubscribeInput, + UnsubscribeOutput, + UntagResourceInput, + UntagResourceOutput, + VerifySMSSandboxPhoneNumberInput, + VerifySMSSandboxPhoneNumberOutput, + ) + logger = logging.getLogger(__name__) @@ -230,12 +238,12 @@ async def _post_setup(self, config: AsyncSNSConfig) -> None: config_file = await config_context.parsed_profiles() if config_context.profile_source is ConfigSource.OVERRIDE: profile_name = config_context.profile_name - config.aws_credentials_identity_resolver = await IdentityChain.create( + config.aws_credentials_identity_resolver = await AsyncIdentityChain.create( AWSCredentialsIdentity, config_file=config_file, profile_name=profile_name, region_override=config.region, - http_client=cast(HTTPClient | None, config.transport), + http_client=cast(AsyncHTTPClient | None, config.transport), ) async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( @@ -244,7 +252,7 @@ async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( operation: APIOperation[I, O], default_plugins: list[Plugin], plugins: list[Plugin] | None, - ) -> tuple[RequestPipeline[Any, Any], ClientCall[I, O]]: + ) -> tuple[AsyncRequestPipeline[Any, Any], AsyncClientCall[I, O]]: if self._closed: raise RuntimeError( "Cannot invoke an operation on a client that has been closed." diff --git a/clients/aws-sdk-sns/src/aws_sdk_sns/config.py b/clients/aws-sdk-sns/src/aws_sdk_sns/config.py index cf6c9493..b9c7ac59 100644 --- a/clients/aws-sdk-sns/src/aws_sdk_sns/config.py +++ b/clients/aws-sdk-sns/src/aws_sdk_sns/config.py @@ -1,218 +1,252 @@ # Code generated by smithy-python-codegen DO NOT EDIT. from dataclasses import dataclass, field -from typing import Any, Callable, ClassVar, Self, TypeAlias, Union, Unpack +from typing import ( + Any, + Callable, + ClassVar, + Self, + TYPE_CHECKING, + TypeAlias, + Union, + Unpack, +) -from smithy_aws_core.aio.protocols import AwsQueryClientProtocol -from smithy_aws_core.auth import SigV4AuthScheme -from smithy_aws_core.config import AwsConfigOverrides, FileSystem -from smithy_aws_core.config.aws_config import AsyncAwsConfig -from smithy_aws_core.config.resolvers import EndpointUriResolver -from smithy_aws_core.config.types import FieldSpec -from smithy_aws_core.endpoints.standard_regional import ( - StandardRegionalEndpointsResolver, +from smithy_aws_core.aio.auth.sigv4 import AsyncSigV4AuthScheme +from smithy_aws_core.aio.config import AsyncFileSystem +from smithy_aws_core.aio.config.aws_config import AsyncAwsConfig, AwsConfigOverrides +from smithy_aws_core.aio.config.resolvers import EndpointUriResolver +from smithy_aws_core.aio.endpoints.standard_regional import ( + AsyncStandardRegionalEndpointsResolver, ) +from smithy_aws_core.aio.protocols import AsyncAwsQueryClientProtocol +from smithy_aws_core.config.types import FieldSpec from smithy_aws_core.identity import AWSCredentialsIdentity, AWSIdentityProperties -from smithy_core.aio.interfaces import ( - ClientProtocol, - EndpointResolver, - ProtocolConstructor, - ProtocolSettings, -) -from smithy_core.aio.interfaces.auth import AuthScheme -from smithy_core.aio.interfaces.identity import IdentityResolver -from smithy_core.interceptors import Interceptor +from smithy_core.aio.interfaces import AsyncClientProtocol, AsyncEndpointResolver +from smithy_core.aio.interfaces.auth import AsyncAuthScheme +from smithy_core.aio.interfaces.identity import AsyncIdentityResolver +from smithy_core.interfaces import ProtocolConstructor, ProtocolSettings from smithy_core.interfaces.auth import AuthSchemeResolver from smithy_core.shapes import ShapeID from smithy_http.aio.aiohttp import AIOHTTPClient +from ._private.schemas import AMAZON_SIMPLE_NOTIFICATION_SERVICE from .auth import HTTPAuthSchemeResolver -from .models import ( - AddPermissionInput, - AddPermissionOutput, - CheckIfPhoneNumberIsOptedOutInput, - CheckIfPhoneNumberIsOptedOutOutput, - ConfirmSubscriptionInput, - ConfirmSubscriptionOutput, - CreatePlatformApplicationInput, - CreatePlatformApplicationOutput, - CreatePlatformEndpointInput, - CreatePlatformEndpointOutput, - CreateSMSSandboxPhoneNumberInput, - CreateSMSSandboxPhoneNumberOutput, - CreateTopicInput, - CreateTopicOutput, - DeleteEndpointInput, - DeleteEndpointOutput, - DeletePlatformApplicationInput, - DeletePlatformApplicationOutput, - DeleteSMSSandboxPhoneNumberInput, - DeleteSMSSandboxPhoneNumberOutput, - DeleteTopicInput, - DeleteTopicOutput, - GetDataProtectionPolicyInput, - GetDataProtectionPolicyOutput, - GetEndpointAttributesInput, - GetEndpointAttributesOutput, - GetPlatformApplicationAttributesInput, - GetPlatformApplicationAttributesOutput, - GetSMSAttributesInput, - GetSMSAttributesOutput, - GetSMSSandboxAccountStatusInput, - GetSMSSandboxAccountStatusOutput, - GetSubscriptionAttributesInput, - GetSubscriptionAttributesOutput, - GetTopicAttributesInput, - GetTopicAttributesOutput, - ListEndpointsByPlatformApplicationInput, - ListEndpointsByPlatformApplicationOutput, - ListOriginationNumbersInput, - ListOriginationNumbersOutput, - ListPhoneNumbersOptedOutInput, - ListPhoneNumbersOptedOutOutput, - ListPlatformApplicationsInput, - ListPlatformApplicationsOutput, - ListSMSSandboxPhoneNumbersInput, - ListSMSSandboxPhoneNumbersOutput, - ListSubscriptionsByTopicInput, - ListSubscriptionsByTopicOutput, - ListSubscriptionsInput, - ListSubscriptionsOutput, - ListTagsForResourceInput, - ListTagsForResourceOutput, - ListTopicsInput, - ListTopicsOutput, - OptInPhoneNumberInput, - OptInPhoneNumberOutput, - PublishBatchInput, - PublishBatchOutput, - PublishInput, - PublishOutput, - PutDataProtectionPolicyInput, - PutDataProtectionPolicyOutput, - RemovePermissionInput, - RemovePermissionOutput, - SetEndpointAttributesInput, - SetEndpointAttributesOutput, - SetPlatformApplicationAttributesInput, - SetPlatformApplicationAttributesOutput, - SetSMSAttributesInput, - SetSMSAttributesOutput, - SetSubscriptionAttributesInput, - SetSubscriptionAttributesOutput, - SetTopicAttributesInput, - SetTopicAttributesOutput, - SubscribeInput, - SubscribeOutput, - TagResourceInput, - TagResourceOutput, - UnsubscribeInput, - UnsubscribeOutput, - UntagResourceInput, - UntagResourceOutput, - VerifySMSSandboxPhoneNumberInput, - VerifySMSSandboxPhoneNumberOutput, -) -_ServiceInterceptor = Union[ - Interceptor[AddPermissionInput, AddPermissionOutput, Any, Any], - Interceptor[ - CheckIfPhoneNumberIsOptedOutInput, CheckIfPhoneNumberIsOptedOutOutput, Any, Any - ], - Interceptor[ConfirmSubscriptionInput, ConfirmSubscriptionOutput, Any, Any], - Interceptor[ - CreatePlatformApplicationInput, CreatePlatformApplicationOutput, Any, Any - ], - Interceptor[CreatePlatformEndpointInput, CreatePlatformEndpointOutput, Any, Any], - Interceptor[ - CreateSMSSandboxPhoneNumberInput, CreateSMSSandboxPhoneNumberOutput, Any, Any - ], - Interceptor[CreateTopicInput, CreateTopicOutput, Any, Any], - Interceptor[DeleteEndpointInput, DeleteEndpointOutput, Any, Any], - Interceptor[ - DeletePlatformApplicationInput, DeletePlatformApplicationOutput, Any, Any - ], - Interceptor[ - DeleteSMSSandboxPhoneNumberInput, DeleteSMSSandboxPhoneNumberOutput, Any, Any - ], - Interceptor[DeleteTopicInput, DeleteTopicOutput, Any, Any], - Interceptor[GetDataProtectionPolicyInput, GetDataProtectionPolicyOutput, Any, Any], - Interceptor[GetEndpointAttributesInput, GetEndpointAttributesOutput, Any, Any], - Interceptor[ +if TYPE_CHECKING: + from smithy_core.interceptors import Interceptor + from .models import ( + AddPermissionInput, + AddPermissionOutput, + CheckIfPhoneNumberIsOptedOutInput, + CheckIfPhoneNumberIsOptedOutOutput, + ConfirmSubscriptionInput, + ConfirmSubscriptionOutput, + CreatePlatformApplicationInput, + CreatePlatformApplicationOutput, + CreatePlatformEndpointInput, + CreatePlatformEndpointOutput, + CreateSMSSandboxPhoneNumberInput, + CreateSMSSandboxPhoneNumberOutput, + CreateTopicInput, + CreateTopicOutput, + DeleteEndpointInput, + DeleteEndpointOutput, + DeletePlatformApplicationInput, + DeletePlatformApplicationOutput, + DeleteSMSSandboxPhoneNumberInput, + DeleteSMSSandboxPhoneNumberOutput, + DeleteTopicInput, + DeleteTopicOutput, + GetDataProtectionPolicyInput, + GetDataProtectionPolicyOutput, + GetEndpointAttributesInput, + GetEndpointAttributesOutput, GetPlatformApplicationAttributesInput, GetPlatformApplicationAttributesOutput, - Any, - Any, - ], - Interceptor[GetSMSAttributesInput, GetSMSAttributesOutput, Any, Any], - Interceptor[ - GetSMSSandboxAccountStatusInput, GetSMSSandboxAccountStatusOutput, Any, Any - ], - Interceptor[ - GetSubscriptionAttributesInput, GetSubscriptionAttributesOutput, Any, Any - ], - Interceptor[GetTopicAttributesInput, GetTopicAttributesOutput, Any, Any], - Interceptor[ + GetSMSAttributesInput, + GetSMSAttributesOutput, + GetSMSSandboxAccountStatusInput, + GetSMSSandboxAccountStatusOutput, + GetSubscriptionAttributesInput, + GetSubscriptionAttributesOutput, + GetTopicAttributesInput, + GetTopicAttributesOutput, ListEndpointsByPlatformApplicationInput, ListEndpointsByPlatformApplicationOutput, - Any, - Any, - ], - Interceptor[ListOriginationNumbersInput, ListOriginationNumbersOutput, Any, Any], - Interceptor[ - ListPhoneNumbersOptedOutInput, ListPhoneNumbersOptedOutOutput, Any, Any - ], - Interceptor[ - ListPlatformApplicationsInput, ListPlatformApplicationsOutput, Any, Any - ], - Interceptor[ - ListSMSSandboxPhoneNumbersInput, ListSMSSandboxPhoneNumbersOutput, Any, Any - ], - Interceptor[ListSubscriptionsInput, ListSubscriptionsOutput, Any, Any], - Interceptor[ - ListSubscriptionsByTopicInput, ListSubscriptionsByTopicOutput, Any, Any - ], - Interceptor[ListTagsForResourceInput, ListTagsForResourceOutput, Any, Any], - Interceptor[ListTopicsInput, ListTopicsOutput, Any, Any], - Interceptor[OptInPhoneNumberInput, OptInPhoneNumberOutput, Any, Any], - Interceptor[PublishInput, PublishOutput, Any, Any], - Interceptor[PublishBatchInput, PublishBatchOutput, Any, Any], - Interceptor[PutDataProtectionPolicyInput, PutDataProtectionPolicyOutput, Any, Any], - Interceptor[RemovePermissionInput, RemovePermissionOutput, Any, Any], - Interceptor[SetEndpointAttributesInput, SetEndpointAttributesOutput, Any, Any], - Interceptor[ + ListOriginationNumbersInput, + ListOriginationNumbersOutput, + ListPhoneNumbersOptedOutInput, + ListPhoneNumbersOptedOutOutput, + ListPlatformApplicationsInput, + ListPlatformApplicationsOutput, + ListSMSSandboxPhoneNumbersInput, + ListSMSSandboxPhoneNumbersOutput, + ListSubscriptionsByTopicInput, + ListSubscriptionsByTopicOutput, + ListSubscriptionsInput, + ListSubscriptionsOutput, + ListTagsForResourceInput, + ListTagsForResourceOutput, + ListTopicsInput, + ListTopicsOutput, + OptInPhoneNumberInput, + OptInPhoneNumberOutput, + PublishBatchInput, + PublishBatchOutput, + PublishInput, + PublishOutput, + PutDataProtectionPolicyInput, + PutDataProtectionPolicyOutput, + RemovePermissionInput, + RemovePermissionOutput, + SetEndpointAttributesInput, + SetEndpointAttributesOutput, SetPlatformApplicationAttributesInput, SetPlatformApplicationAttributesOutput, - Any, - Any, - ], - Interceptor[SetSMSAttributesInput, SetSMSAttributesOutput, Any, Any], - Interceptor[ - SetSubscriptionAttributesInput, SetSubscriptionAttributesOutput, Any, Any - ], - Interceptor[SetTopicAttributesInput, SetTopicAttributesOutput, Any, Any], - Interceptor[SubscribeInput, SubscribeOutput, Any, Any], - Interceptor[TagResourceInput, TagResourceOutput, Any, Any], - Interceptor[UnsubscribeInput, UnsubscribeOutput, Any, Any], - Interceptor[UntagResourceInput, UntagResourceOutput, Any, Any], - Interceptor[ - VerifySMSSandboxPhoneNumberInput, VerifySMSSandboxPhoneNumberOutput, Any, Any - ], -] + SetSMSAttributesInput, + SetSMSAttributesOutput, + SetSubscriptionAttributesInput, + SetSubscriptionAttributesOutput, + SetTopicAttributesInput, + SetTopicAttributesOutput, + SubscribeInput, + SubscribeOutput, + TagResourceInput, + TagResourceOutput, + UnsubscribeInput, + UnsubscribeOutput, + UntagResourceInput, + UntagResourceOutput, + VerifySMSSandboxPhoneNumberInput, + VerifySMSSandboxPhoneNumberOutput, + ) + + _ServiceInterceptor = Union[ + Interceptor[AddPermissionInput, AddPermissionOutput, Any, Any], + Interceptor[ + CheckIfPhoneNumberIsOptedOutInput, + CheckIfPhoneNumberIsOptedOutOutput, + Any, + Any, + ], + Interceptor[ConfirmSubscriptionInput, ConfirmSubscriptionOutput, Any, Any], + Interceptor[ + CreatePlatformApplicationInput, CreatePlatformApplicationOutput, Any, Any + ], + Interceptor[ + CreatePlatformEndpointInput, CreatePlatformEndpointOutput, Any, Any + ], + Interceptor[ + CreateSMSSandboxPhoneNumberInput, + CreateSMSSandboxPhoneNumberOutput, + Any, + Any, + ], + Interceptor[CreateTopicInput, CreateTopicOutput, Any, Any], + Interceptor[DeleteEndpointInput, DeleteEndpointOutput, Any, Any], + Interceptor[ + DeletePlatformApplicationInput, DeletePlatformApplicationOutput, Any, Any + ], + Interceptor[ + DeleteSMSSandboxPhoneNumberInput, + DeleteSMSSandboxPhoneNumberOutput, + Any, + Any, + ], + Interceptor[DeleteTopicInput, DeleteTopicOutput, Any, Any], + Interceptor[ + GetDataProtectionPolicyInput, GetDataProtectionPolicyOutput, Any, Any + ], + Interceptor[GetEndpointAttributesInput, GetEndpointAttributesOutput, Any, Any], + Interceptor[ + GetPlatformApplicationAttributesInput, + GetPlatformApplicationAttributesOutput, + Any, + Any, + ], + Interceptor[GetSMSAttributesInput, GetSMSAttributesOutput, Any, Any], + Interceptor[ + GetSMSSandboxAccountStatusInput, GetSMSSandboxAccountStatusOutput, Any, Any + ], + Interceptor[ + GetSubscriptionAttributesInput, GetSubscriptionAttributesOutput, Any, Any + ], + Interceptor[GetTopicAttributesInput, GetTopicAttributesOutput, Any, Any], + Interceptor[ + ListEndpointsByPlatformApplicationInput, + ListEndpointsByPlatformApplicationOutput, + Any, + Any, + ], + Interceptor[ + ListOriginationNumbersInput, ListOriginationNumbersOutput, Any, Any + ], + Interceptor[ + ListPhoneNumbersOptedOutInput, ListPhoneNumbersOptedOutOutput, Any, Any + ], + Interceptor[ + ListPlatformApplicationsInput, ListPlatformApplicationsOutput, Any, Any + ], + Interceptor[ + ListSMSSandboxPhoneNumbersInput, ListSMSSandboxPhoneNumbersOutput, Any, Any + ], + Interceptor[ListSubscriptionsInput, ListSubscriptionsOutput, Any, Any], + Interceptor[ + ListSubscriptionsByTopicInput, ListSubscriptionsByTopicOutput, Any, Any + ], + Interceptor[ListTagsForResourceInput, ListTagsForResourceOutput, Any, Any], + Interceptor[ListTopicsInput, ListTopicsOutput, Any, Any], + Interceptor[OptInPhoneNumberInput, OptInPhoneNumberOutput, Any, Any], + Interceptor[PublishInput, PublishOutput, Any, Any], + Interceptor[PublishBatchInput, PublishBatchOutput, Any, Any], + Interceptor[ + PutDataProtectionPolicyInput, PutDataProtectionPolicyOutput, Any, Any + ], + Interceptor[RemovePermissionInput, RemovePermissionOutput, Any, Any], + Interceptor[SetEndpointAttributesInput, SetEndpointAttributesOutput, Any, Any], + Interceptor[ + SetPlatformApplicationAttributesInput, + SetPlatformApplicationAttributesOutput, + Any, + Any, + ], + Interceptor[SetSMSAttributesInput, SetSMSAttributesOutput, Any, Any], + Interceptor[ + SetSubscriptionAttributesInput, SetSubscriptionAttributesOutput, Any, Any + ], + Interceptor[SetTopicAttributesInput, SetTopicAttributesOutput, Any, Any], + Interceptor[SubscribeInput, SubscribeOutput, Any, Any], + Interceptor[TagResourceInput, TagResourceOutput, Any, Any], + Interceptor[UnsubscribeInput, UnsubscribeOutput, Any, Any], + Interceptor[UntagResourceInput, UntagResourceOutput, Any, Any], + Interceptor[ + VerifySMSSandboxPhoneNumberInput, + VerifySMSSandboxPhoneNumberOutput, + Any, + Any, + ], + ] +else: + _ServiceInterceptor = Any + _PROTOCOL_SETTINGS = ProtocolSettings( namespace="com.amazonaws.sns", service_target="AmazonSimpleNotificationService", version="2010-03-31", + service_schema=AMAZON_SIMPLE_NOTIFICATION_SERVICE, ) class _AsyncSNSConfigOverrides(AwsConfigOverrides, total=False): - endpoint_resolver: EndpointResolver | None + endpoint_resolver: AsyncEndpointResolver | None protocol: ( - ClientProtocol[Any, Any] | ProtocolConstructor[ClientProtocol[Any, Any]] | None + AsyncClientProtocol[Any, Any] + | ProtocolConstructor[AsyncClientProtocol[Any, Any]] + | None ) - auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None + auth_schemes: dict[ShapeID, AsyncAuthScheme[Any, Any, Any, Any]] | None auth_scheme_resolver: AuthSchemeResolver | None @@ -220,17 +254,17 @@ class _AsyncSNSConfigOverrides(AwsConfigOverrides, total=False): class AsyncSNSConfig(AsyncAwsConfig): """SNS configuration (async-resolved).""" - endpoint_resolver: EndpointResolver | None = None + endpoint_resolver: AsyncEndpointResolver | None = None """ The endpoint resolver used to resolve the final endpoint per-operation based on the configuration. """ - protocol: ClientProtocol[Any, Any] | None = None + protocol: AsyncClientProtocol[Any, Any] | None = None """ Pass a protocol class reference from smithy_aws_core.aio.protocols to - select the protocol, e.g. protocol=AwsJson10ClientProtocol. For custom - protocols a protocol instance may also be passed. + select the protocol, e.g. protocol=AsyncAwsJson10ClientProtocol. For + custom protocols a protocol instance may also be passed. """ interceptors: list[_ServiceInterceptor] = field(default_factory=lambda: []) @@ -239,7 +273,7 @@ class AsyncSNSConfig(AsyncAwsConfig): execution of a request. """ - auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None = None + auth_schemes: dict[ShapeID, AsyncAuthScheme[Any, Any, Any, Any]] | None = None """A map of auth scheme ids to auth schemes.""" auth_scheme_resolver: AuthSchemeResolver | None = None @@ -249,7 +283,7 @@ class AsyncSNSConfig(AsyncAwsConfig): """ aws_credentials_identity_resolver: ( - IdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None + AsyncIdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None ) = None """Resolves AWS Credentials. Required for operations that use Sigv4 Auth.""" @@ -288,24 +322,24 @@ class AsyncSNSConfig(AsyncAwsConfig): **AsyncAwsConfig._FIELDS, "endpoint_uri": FieldSpec(default=None, resolver=EndpointUriResolver("sns")), "endpoint_resolver": FieldSpec( - default_factory=lambda: StandardRegionalEndpointsResolver( + default_factory=lambda: AsyncStandardRegionalEndpointsResolver( endpoint_prefix="sns" ) ), "protocol": FieldSpec( - default_factory=lambda: AwsQueryClientProtocol(_PROTOCOL_SETTINGS), + default_factory=lambda: AsyncAwsQueryClientProtocol(_PROTOCOL_SETTINGS), converter=lambda p: p(_PROTOCOL_SETTINGS) if isinstance(p, type) else p, ), "auth_schemes": FieldSpec( default_factory=lambda: { - ShapeID("aws.auth#sigv4"): SigV4AuthScheme(service="sns") + ShapeID("aws.auth#sigv4"): AsyncSigV4AuthScheme(service="sns") } ), "auth_scheme_resolver": FieldSpec(default_factory=HTTPAuthSchemeResolver), "transport": FieldSpec(default_factory=lambda: AIOHTTPClient()), } - def set_auth_scheme(self, scheme: AuthScheme[Any, Any, Any, Any]) -> None: + def set_auth_scheme(self, scheme: AsyncAuthScheme[Any, Any, Any, Any]) -> None: """ Set an auth scheme implementation using its scheme ID. :param scheme: The auth scheme to add or replace. @@ -319,7 +353,7 @@ async def resolve( # pyright: ignore[reportIncompatibleMethodOverride] cls, *, profile: str | None = None, - fs: FileSystem | None = None, + fs: AsyncFileSystem | None = None, config_file_path: str | None = None, credentials_file_path: str | None = None, **overrides: Unpack[_AsyncSNSConfigOverrides], diff --git a/clients/aws-sdk-sns/src/aws_sdk_sns/models.py b/clients/aws-sdk-sns/src/aws_sdk_sns/models.py index 2433e867..3309ea14 100644 --- a/clients/aws-sdk-sns/src/aws_sdk_sns/models.py +++ b/clients/aws-sdk-sns/src/aws_sdk_sns/models.py @@ -1,10186 +1,1061 @@ # Code generated by smithy-python-codegen DO NOT EDIT. -from dataclasses import dataclass, field -from datetime import datetime -from enum import StrEnum -import logging -from typing import Any, Literal, Self +from __future__ import annotations -from smithy_core.deserializers import ShapeDeserializer -from smithy_core.documents import TypeRegistry +from ._private import schemas as _schemas +from smithy_core._dynamic_models import ModelRegistry from smithy_core.exceptions import ModeledError -from smithy_core.response import EMPTY_RESPONSE_METADATA, ResponseMetadata -from smithy_core.schemas import APIOperation, Schema -from smithy_core.serializers import ShapeSerializer +from smithy_core.schemas import APIOperation from smithy_core.shapes import ShapeID -from smithy_core.types import UnknownEnumMixin from ._private.schemas import ( ADD_PERMISSION as _SCHEMA_ADD_PERMISSION, - ADD_PERMISSION_INPUT as _SCHEMA_ADD_PERMISSION_INPUT, - ADD_PERMISSION_OUTPUT as _SCHEMA_ADD_PERMISSION_OUTPUT, - AUTHORIZATION_ERROR_EXCEPTION as _SCHEMA_AUTHORIZATION_ERROR_EXCEPTION, - BATCH_ENTRY_IDS_NOT_DISTINCT_EXCEPTION as _SCHEMA_BATCH_ENTRY_IDS_NOT_DISTINCT_EXCEPTION, - BATCH_REQUEST_TOO_LONG_EXCEPTION as _SCHEMA_BATCH_REQUEST_TOO_LONG_EXCEPTION, - BATCH_RESULT_ERROR_ENTRY as _SCHEMA_BATCH_RESULT_ERROR_ENTRY, CHECK_IF_PHONE_NUMBER_IS_OPTED_OUT as _SCHEMA_CHECK_IF_PHONE_NUMBER_IS_OPTED_OUT, - CHECK_IF_PHONE_NUMBER_IS_OPTED_OUT_INPUT as _SCHEMA_CHECK_IF_PHONE_NUMBER_IS_OPTED_OUT_INPUT, - CHECK_IF_PHONE_NUMBER_IS_OPTED_OUT_OUTPUT as _SCHEMA_CHECK_IF_PHONE_NUMBER_IS_OPTED_OUT_OUTPUT, - CONCURRENT_ACCESS_EXCEPTION as _SCHEMA_CONCURRENT_ACCESS_EXCEPTION, CONFIRM_SUBSCRIPTION as _SCHEMA_CONFIRM_SUBSCRIPTION, - CONFIRM_SUBSCRIPTION_INPUT as _SCHEMA_CONFIRM_SUBSCRIPTION_INPUT, - CONFIRM_SUBSCRIPTION_OUTPUT as _SCHEMA_CONFIRM_SUBSCRIPTION_OUTPUT, CREATE_PLATFORM_APPLICATION as _SCHEMA_CREATE_PLATFORM_APPLICATION, - CREATE_PLATFORM_APPLICATION_INPUT as _SCHEMA_CREATE_PLATFORM_APPLICATION_INPUT, - CREATE_PLATFORM_APPLICATION_OUTPUT as _SCHEMA_CREATE_PLATFORM_APPLICATION_OUTPUT, CREATE_PLATFORM_ENDPOINT as _SCHEMA_CREATE_PLATFORM_ENDPOINT, - CREATE_PLATFORM_ENDPOINT_INPUT as _SCHEMA_CREATE_PLATFORM_ENDPOINT_INPUT, - CREATE_PLATFORM_ENDPOINT_OUTPUT as _SCHEMA_CREATE_PLATFORM_ENDPOINT_OUTPUT, CREATE_SMS_SANDBOX_PHONE_NUMBER as _SCHEMA_CREATE_SMS_SANDBOX_PHONE_NUMBER, - CREATE_SMS_SANDBOX_PHONE_NUMBER_INPUT as _SCHEMA_CREATE_SMS_SANDBOX_PHONE_NUMBER_INPUT, - CREATE_SMS_SANDBOX_PHONE_NUMBER_OUTPUT as _SCHEMA_CREATE_SMS_SANDBOX_PHONE_NUMBER_OUTPUT, CREATE_TOPIC as _SCHEMA_CREATE_TOPIC, - CREATE_TOPIC_INPUT as _SCHEMA_CREATE_TOPIC_INPUT, - CREATE_TOPIC_OUTPUT as _SCHEMA_CREATE_TOPIC_OUTPUT, DELETE_ENDPOINT as _SCHEMA_DELETE_ENDPOINT, - DELETE_ENDPOINT_INPUT as _SCHEMA_DELETE_ENDPOINT_INPUT, - DELETE_ENDPOINT_OUTPUT as _SCHEMA_DELETE_ENDPOINT_OUTPUT, DELETE_PLATFORM_APPLICATION as _SCHEMA_DELETE_PLATFORM_APPLICATION, - DELETE_PLATFORM_APPLICATION_INPUT as _SCHEMA_DELETE_PLATFORM_APPLICATION_INPUT, - DELETE_PLATFORM_APPLICATION_OUTPUT as _SCHEMA_DELETE_PLATFORM_APPLICATION_OUTPUT, DELETE_SMS_SANDBOX_PHONE_NUMBER as _SCHEMA_DELETE_SMS_SANDBOX_PHONE_NUMBER, - DELETE_SMS_SANDBOX_PHONE_NUMBER_INPUT as _SCHEMA_DELETE_SMS_SANDBOX_PHONE_NUMBER_INPUT, - DELETE_SMS_SANDBOX_PHONE_NUMBER_OUTPUT as _SCHEMA_DELETE_SMS_SANDBOX_PHONE_NUMBER_OUTPUT, DELETE_TOPIC as _SCHEMA_DELETE_TOPIC, - DELETE_TOPIC_INPUT as _SCHEMA_DELETE_TOPIC_INPUT, - DELETE_TOPIC_OUTPUT as _SCHEMA_DELETE_TOPIC_OUTPUT, - EMPTY_BATCH_REQUEST_EXCEPTION as _SCHEMA_EMPTY_BATCH_REQUEST_EXCEPTION, - ENDPOINT as _SCHEMA_ENDPOINT, - ENDPOINT_DISABLED_EXCEPTION as _SCHEMA_ENDPOINT_DISABLED_EXCEPTION, - FILTER_POLICY_LIMIT_EXCEEDED_EXCEPTION as _SCHEMA_FILTER_POLICY_LIMIT_EXCEEDED_EXCEPTION, GET_DATA_PROTECTION_POLICY as _SCHEMA_GET_DATA_PROTECTION_POLICY, - GET_DATA_PROTECTION_POLICY_INPUT as _SCHEMA_GET_DATA_PROTECTION_POLICY_INPUT, - GET_DATA_PROTECTION_POLICY_OUTPUT as _SCHEMA_GET_DATA_PROTECTION_POLICY_OUTPUT, GET_ENDPOINT_ATTRIBUTES as _SCHEMA_GET_ENDPOINT_ATTRIBUTES, - GET_ENDPOINT_ATTRIBUTES_INPUT as _SCHEMA_GET_ENDPOINT_ATTRIBUTES_INPUT, - GET_ENDPOINT_ATTRIBUTES_OUTPUT as _SCHEMA_GET_ENDPOINT_ATTRIBUTES_OUTPUT, GET_PLATFORM_APPLICATION_ATTRIBUTES as _SCHEMA_GET_PLATFORM_APPLICATION_ATTRIBUTES, - GET_PLATFORM_APPLICATION_ATTRIBUTES_INPUT as _SCHEMA_GET_PLATFORM_APPLICATION_ATTRIBUTES_INPUT, - GET_PLATFORM_APPLICATION_ATTRIBUTES_OUTPUT as _SCHEMA_GET_PLATFORM_APPLICATION_ATTRIBUTES_OUTPUT, GET_SMS_ATTRIBUTES as _SCHEMA_GET_SMS_ATTRIBUTES, - GET_SMS_ATTRIBUTES_INPUT as _SCHEMA_GET_SMS_ATTRIBUTES_INPUT, - GET_SMS_ATTRIBUTES_OUTPUT as _SCHEMA_GET_SMS_ATTRIBUTES_OUTPUT, GET_SMS_SANDBOX_ACCOUNT_STATUS as _SCHEMA_GET_SMS_SANDBOX_ACCOUNT_STATUS, - GET_SMS_SANDBOX_ACCOUNT_STATUS_INPUT as _SCHEMA_GET_SMS_SANDBOX_ACCOUNT_STATUS_INPUT, - GET_SMS_SANDBOX_ACCOUNT_STATUS_OUTPUT as _SCHEMA_GET_SMS_SANDBOX_ACCOUNT_STATUS_OUTPUT, GET_SUBSCRIPTION_ATTRIBUTES as _SCHEMA_GET_SUBSCRIPTION_ATTRIBUTES, - GET_SUBSCRIPTION_ATTRIBUTES_INPUT as _SCHEMA_GET_SUBSCRIPTION_ATTRIBUTES_INPUT, - GET_SUBSCRIPTION_ATTRIBUTES_OUTPUT as _SCHEMA_GET_SUBSCRIPTION_ATTRIBUTES_OUTPUT, GET_TOPIC_ATTRIBUTES as _SCHEMA_GET_TOPIC_ATTRIBUTES, - GET_TOPIC_ATTRIBUTES_INPUT as _SCHEMA_GET_TOPIC_ATTRIBUTES_INPUT, - GET_TOPIC_ATTRIBUTES_OUTPUT as _SCHEMA_GET_TOPIC_ATTRIBUTES_OUTPUT, - INTERNAL_ERROR_EXCEPTION as _SCHEMA_INTERNAL_ERROR_EXCEPTION, - INVALID_BATCH_ENTRY_ID_EXCEPTION as _SCHEMA_INVALID_BATCH_ENTRY_ID_EXCEPTION, - INVALID_PARAMETER_EXCEPTION as _SCHEMA_INVALID_PARAMETER_EXCEPTION, - INVALID_PARAMETER_VALUE_EXCEPTION as _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - INVALID_SECURITY_EXCEPTION as _SCHEMA_INVALID_SECURITY_EXCEPTION, - INVALID_STATE_EXCEPTION as _SCHEMA_INVALID_STATE_EXCEPTION, - KMS_ACCESS_DENIED_EXCEPTION as _SCHEMA_KMS_ACCESS_DENIED_EXCEPTION, - KMS_DISABLED_EXCEPTION as _SCHEMA_KMS_DISABLED_EXCEPTION, - KMS_INVALID_STATE_EXCEPTION as _SCHEMA_KMS_INVALID_STATE_EXCEPTION, - KMS_NOT_FOUND_EXCEPTION as _SCHEMA_KMS_NOT_FOUND_EXCEPTION, - KMS_OPT_IN_REQUIRED as _SCHEMA_KMS_OPT_IN_REQUIRED, - KMS_THROTTLING_EXCEPTION as _SCHEMA_KMS_THROTTLING_EXCEPTION, LIST_ENDPOINTS_BY_PLATFORM_APPLICATION as _SCHEMA_LIST_ENDPOINTS_BY_PLATFORM_APPLICATION, - LIST_ENDPOINTS_BY_PLATFORM_APPLICATION_INPUT as _SCHEMA_LIST_ENDPOINTS_BY_PLATFORM_APPLICATION_INPUT, - LIST_ENDPOINTS_BY_PLATFORM_APPLICATION_OUTPUT as _SCHEMA_LIST_ENDPOINTS_BY_PLATFORM_APPLICATION_OUTPUT, LIST_ORIGINATION_NUMBERS as _SCHEMA_LIST_ORIGINATION_NUMBERS, - LIST_ORIGINATION_NUMBERS_INPUT as _SCHEMA_LIST_ORIGINATION_NUMBERS_INPUT, - LIST_ORIGINATION_NUMBERS_OUTPUT as _SCHEMA_LIST_ORIGINATION_NUMBERS_OUTPUT, LIST_PHONE_NUMBERS_OPTED_OUT as _SCHEMA_LIST_PHONE_NUMBERS_OPTED_OUT, - LIST_PHONE_NUMBERS_OPTED_OUT_INPUT as _SCHEMA_LIST_PHONE_NUMBERS_OPTED_OUT_INPUT, - LIST_PHONE_NUMBERS_OPTED_OUT_OUTPUT as _SCHEMA_LIST_PHONE_NUMBERS_OPTED_OUT_OUTPUT, LIST_PLATFORM_APPLICATIONS as _SCHEMA_LIST_PLATFORM_APPLICATIONS, - LIST_PLATFORM_APPLICATIONS_INPUT as _SCHEMA_LIST_PLATFORM_APPLICATIONS_INPUT, - LIST_PLATFORM_APPLICATIONS_OUTPUT as _SCHEMA_LIST_PLATFORM_APPLICATIONS_OUTPUT, LIST_SMS_SANDBOX_PHONE_NUMBERS as _SCHEMA_LIST_SMS_SANDBOX_PHONE_NUMBERS, - LIST_SMS_SANDBOX_PHONE_NUMBERS_INPUT as _SCHEMA_LIST_SMS_SANDBOX_PHONE_NUMBERS_INPUT, - LIST_SMS_SANDBOX_PHONE_NUMBERS_OUTPUT as _SCHEMA_LIST_SMS_SANDBOX_PHONE_NUMBERS_OUTPUT, LIST_SUBSCRIPTIONS as _SCHEMA_LIST_SUBSCRIPTIONS, LIST_SUBSCRIPTIONS_BY_TOPIC as _SCHEMA_LIST_SUBSCRIPTIONS_BY_TOPIC, - LIST_SUBSCRIPTIONS_BY_TOPIC_INPUT as _SCHEMA_LIST_SUBSCRIPTIONS_BY_TOPIC_INPUT, - LIST_SUBSCRIPTIONS_BY_TOPIC_OUTPUT as _SCHEMA_LIST_SUBSCRIPTIONS_BY_TOPIC_OUTPUT, - LIST_SUBSCRIPTIONS_INPUT as _SCHEMA_LIST_SUBSCRIPTIONS_INPUT, - LIST_SUBSCRIPTIONS_OUTPUT as _SCHEMA_LIST_SUBSCRIPTIONS_OUTPUT, LIST_TAGS_FOR_RESOURCE as _SCHEMA_LIST_TAGS_FOR_RESOURCE, - LIST_TAGS_FOR_RESOURCE_INPUT as _SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT, - LIST_TAGS_FOR_RESOURCE_OUTPUT as _SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT, LIST_TOPICS as _SCHEMA_LIST_TOPICS, - LIST_TOPICS_INPUT as _SCHEMA_LIST_TOPICS_INPUT, - LIST_TOPICS_OUTPUT as _SCHEMA_LIST_TOPICS_OUTPUT, - MESSAGE_ATTRIBUTE_VALUE as _SCHEMA_MESSAGE_ATTRIBUTE_VALUE, - NOT_FOUND_EXCEPTION as _SCHEMA_NOT_FOUND_EXCEPTION, - OPTED_OUT_EXCEPTION as _SCHEMA_OPTED_OUT_EXCEPTION, OPT_IN_PHONE_NUMBER as _SCHEMA_OPT_IN_PHONE_NUMBER, - OPT_IN_PHONE_NUMBER_INPUT as _SCHEMA_OPT_IN_PHONE_NUMBER_INPUT, - OPT_IN_PHONE_NUMBER_OUTPUT as _SCHEMA_OPT_IN_PHONE_NUMBER_OUTPUT, - PHONE_NUMBER_INFORMATION as _SCHEMA_PHONE_NUMBER_INFORMATION, - PLATFORM_APPLICATION as _SCHEMA_PLATFORM_APPLICATION, - PLATFORM_APPLICATION_DISABLED_EXCEPTION as _SCHEMA_PLATFORM_APPLICATION_DISABLED_EXCEPTION, PUBLISH as _SCHEMA_PUBLISH, PUBLISH_BATCH as _SCHEMA_PUBLISH_BATCH, - PUBLISH_BATCH_INPUT as _SCHEMA_PUBLISH_BATCH_INPUT, - PUBLISH_BATCH_OUTPUT as _SCHEMA_PUBLISH_BATCH_OUTPUT, - PUBLISH_BATCH_REQUEST_ENTRY as _SCHEMA_PUBLISH_BATCH_REQUEST_ENTRY, - PUBLISH_BATCH_RESULT_ENTRY as _SCHEMA_PUBLISH_BATCH_RESULT_ENTRY, - PUBLISH_INPUT as _SCHEMA_PUBLISH_INPUT, - PUBLISH_OUTPUT as _SCHEMA_PUBLISH_OUTPUT, PUT_DATA_PROTECTION_POLICY as _SCHEMA_PUT_DATA_PROTECTION_POLICY, - PUT_DATA_PROTECTION_POLICY_INPUT as _SCHEMA_PUT_DATA_PROTECTION_POLICY_INPUT, - PUT_DATA_PROTECTION_POLICY_OUTPUT as _SCHEMA_PUT_DATA_PROTECTION_POLICY_OUTPUT, REMOVE_PERMISSION as _SCHEMA_REMOVE_PERMISSION, - REMOVE_PERMISSION_INPUT as _SCHEMA_REMOVE_PERMISSION_INPUT, - REMOVE_PERMISSION_OUTPUT as _SCHEMA_REMOVE_PERMISSION_OUTPUT, - REPLAY_LIMIT_EXCEEDED_EXCEPTION as _SCHEMA_REPLAY_LIMIT_EXCEEDED_EXCEPTION, - RESOURCE_NOT_FOUND_EXCEPTION as _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, SET_ENDPOINT_ATTRIBUTES as _SCHEMA_SET_ENDPOINT_ATTRIBUTES, - SET_ENDPOINT_ATTRIBUTES_INPUT as _SCHEMA_SET_ENDPOINT_ATTRIBUTES_INPUT, - SET_ENDPOINT_ATTRIBUTES_OUTPUT as _SCHEMA_SET_ENDPOINT_ATTRIBUTES_OUTPUT, SET_PLATFORM_APPLICATION_ATTRIBUTES as _SCHEMA_SET_PLATFORM_APPLICATION_ATTRIBUTES, - SET_PLATFORM_APPLICATION_ATTRIBUTES_INPUT as _SCHEMA_SET_PLATFORM_APPLICATION_ATTRIBUTES_INPUT, - SET_PLATFORM_APPLICATION_ATTRIBUTES_OUTPUT as _SCHEMA_SET_PLATFORM_APPLICATION_ATTRIBUTES_OUTPUT, SET_SMS_ATTRIBUTES as _SCHEMA_SET_SMS_ATTRIBUTES, - SET_SMS_ATTRIBUTES_INPUT as _SCHEMA_SET_SMS_ATTRIBUTES_INPUT, - SET_SMS_ATTRIBUTES_OUTPUT as _SCHEMA_SET_SMS_ATTRIBUTES_OUTPUT, SET_SUBSCRIPTION_ATTRIBUTES as _SCHEMA_SET_SUBSCRIPTION_ATTRIBUTES, - SET_SUBSCRIPTION_ATTRIBUTES_INPUT as _SCHEMA_SET_SUBSCRIPTION_ATTRIBUTES_INPUT, - SET_SUBSCRIPTION_ATTRIBUTES_OUTPUT as _SCHEMA_SET_SUBSCRIPTION_ATTRIBUTES_OUTPUT, SET_TOPIC_ATTRIBUTES as _SCHEMA_SET_TOPIC_ATTRIBUTES, - SET_TOPIC_ATTRIBUTES_INPUT as _SCHEMA_SET_TOPIC_ATTRIBUTES_INPUT, - SET_TOPIC_ATTRIBUTES_OUTPUT as _SCHEMA_SET_TOPIC_ATTRIBUTES_OUTPUT, - SMS_SANDBOX_PHONE_NUMBER as _SCHEMA_SMS_SANDBOX_PHONE_NUMBER, - STALE_TAG_EXCEPTION as _SCHEMA_STALE_TAG_EXCEPTION, SUBSCRIBE as _SCHEMA_SUBSCRIBE, - SUBSCRIBE_INPUT as _SCHEMA_SUBSCRIBE_INPUT, - SUBSCRIBE_OUTPUT as _SCHEMA_SUBSCRIBE_OUTPUT, - SUBSCRIPTION as _SCHEMA_SUBSCRIPTION, - SUBSCRIPTION_LIMIT_EXCEEDED_EXCEPTION as _SCHEMA_SUBSCRIPTION_LIMIT_EXCEEDED_EXCEPTION, - TAG as _SCHEMA_TAG, - TAG_LIMIT_EXCEEDED_EXCEPTION as _SCHEMA_TAG_LIMIT_EXCEEDED_EXCEPTION, - TAG_POLICY_EXCEPTION as _SCHEMA_TAG_POLICY_EXCEPTION, TAG_RESOURCE as _SCHEMA_TAG_RESOURCE, - TAG_RESOURCE_INPUT as _SCHEMA_TAG_RESOURCE_INPUT, - TAG_RESOURCE_OUTPUT as _SCHEMA_TAG_RESOURCE_OUTPUT, - THROTTLED_EXCEPTION as _SCHEMA_THROTTLED_EXCEPTION, - TOO_MANY_ENTRIES_IN_BATCH_REQUEST_EXCEPTION as _SCHEMA_TOO_MANY_ENTRIES_IN_BATCH_REQUEST_EXCEPTION, - TOPIC as _SCHEMA_TOPIC, - TOPIC_LIMIT_EXCEEDED_EXCEPTION as _SCHEMA_TOPIC_LIMIT_EXCEEDED_EXCEPTION, UNSUBSCRIBE as _SCHEMA_UNSUBSCRIBE, - UNSUBSCRIBE_INPUT as _SCHEMA_UNSUBSCRIBE_INPUT, - UNSUBSCRIBE_OUTPUT as _SCHEMA_UNSUBSCRIBE_OUTPUT, UNTAG_RESOURCE as _SCHEMA_UNTAG_RESOURCE, - UNTAG_RESOURCE_INPUT as _SCHEMA_UNTAG_RESOURCE_INPUT, - UNTAG_RESOURCE_OUTPUT as _SCHEMA_UNTAG_RESOURCE_OUTPUT, - USER_ERROR_EXCEPTION as _SCHEMA_USER_ERROR_EXCEPTION, - VALIDATION_EXCEPTION as _SCHEMA_VALIDATION_EXCEPTION, - VERIFICATION_EXCEPTION as _SCHEMA_VERIFICATION_EXCEPTION, VERIFY_SMS_SANDBOX_PHONE_NUMBER as _SCHEMA_VERIFY_SMS_SANDBOX_PHONE_NUMBER, - VERIFY_SMS_SANDBOX_PHONE_NUMBER_INPUT as _SCHEMA_VERIFY_SMS_SANDBOX_PHONE_NUMBER_INPUT, - VERIFY_SMS_SANDBOX_PHONE_NUMBER_OUTPUT as _SCHEMA_VERIFY_SMS_SANDBOX_PHONE_NUMBER_OUTPUT, ) +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .models import ( + AddPermissionInput, + AddPermissionOutput, + CheckIfPhoneNumberIsOptedOutInput, + CheckIfPhoneNumberIsOptedOutOutput, + ConfirmSubscriptionInput, + ConfirmSubscriptionOutput, + CreatePlatformApplicationInput, + CreatePlatformApplicationOutput, + CreatePlatformEndpointInput, + CreatePlatformEndpointOutput, + CreateSMSSandboxPhoneNumberInput, + CreateSMSSandboxPhoneNumberOutput, + CreateTopicInput, + CreateTopicOutput, + DeleteEndpointInput, + DeleteEndpointOutput, + DeletePlatformApplicationInput, + DeletePlatformApplicationOutput, + DeleteSMSSandboxPhoneNumberInput, + DeleteSMSSandboxPhoneNumberOutput, + DeleteTopicInput, + DeleteTopicOutput, + GetDataProtectionPolicyInput, + GetDataProtectionPolicyOutput, + GetEndpointAttributesInput, + GetEndpointAttributesOutput, + GetPlatformApplicationAttributesInput, + GetPlatformApplicationAttributesOutput, + GetSMSAttributesInput, + GetSMSAttributesOutput, + GetSMSSandboxAccountStatusInput, + GetSMSSandboxAccountStatusOutput, + GetSubscriptionAttributesInput, + GetSubscriptionAttributesOutput, + GetTopicAttributesInput, + GetTopicAttributesOutput, + ListEndpointsByPlatformApplicationInput, + ListEndpointsByPlatformApplicationOutput, + ListOriginationNumbersInput, + ListOriginationNumbersOutput, + ListPhoneNumbersOptedOutInput, + ListPhoneNumbersOptedOutOutput, + ListPlatformApplicationsInput, + ListPlatformApplicationsOutput, + ListSMSSandboxPhoneNumbersInput, + ListSMSSandboxPhoneNumbersOutput, + ListSubscriptionsByTopicInput, + ListSubscriptionsByTopicOutput, + ListSubscriptionsInput, + ListSubscriptionsOutput, + ListTagsForResourceInput, + ListTagsForResourceOutput, + ListTopicsInput, + ListTopicsOutput, + OptInPhoneNumberInput, + OptInPhoneNumberOutput, + PublishBatchInput, + PublishBatchOutput, + PublishInput, + PublishOutput, + PutDataProtectionPolicyInput, + PutDataProtectionPolicyOutput, + RemovePermissionInput, + RemovePermissionOutput, + SetEndpointAttributesInput, + SetEndpointAttributesOutput, + SetPlatformApplicationAttributesInput, + SetPlatformApplicationAttributesOutput, + SetSMSAttributesInput, + SetSMSAttributesOutput, + SetSubscriptionAttributesInput, + SetSubscriptionAttributesOutput, + SetTopicAttributesInput, + SetTopicAttributesOutput, + SubscribeInput, + SubscribeOutput, + TagResourceInput, + TagResourceOutput, + UnsubscribeInput, + UnsubscribeOutput, + UntagResourceInput, + UntagResourceOutput, + VerifySMSSandboxPhoneNumberInput, + VerifySMSSandboxPhoneNumberOutput, + ) -logger = logging.getLogger(__name__) - - -class ServiceError(ModeledError): - """ - Base error for all errors in the service. - - Some exceptions do not extend from this class, including - synthetic, implicit, and shared exception types. - """ - - -def _serialize_actions_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_actions_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_delegates_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_delegates_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AddPermissionInput: - """Dataclass for AddPermissionInput structure.""" - - topic_arn: str | None = None - """The ARN of the topic whose access control policy you wish to modify.""" - - label: str | None = None - """A unique identifier for the new policy statement.""" - - aws_account_id: list[str] | None = None - """ - The Amazon Web Services account IDs of the users (principals) who will - be given access to the specified actions. The users must have Amazon Web - Services account, but do not need to be signed up for this service. - """ - - action_name: list[str] | None = None - """ - The action you want to allow for the specified principal(s). - - Valid values: Any Amazon SNS action name, for example `Publish`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ADD_PERMISSION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.topic_arn is not None: - serializer.write_string( - _SCHEMA_ADD_PERMISSION_INPUT.members["TopicArn"], self.topic_arn - ) - - if self.label is not None: - serializer.write_string( - _SCHEMA_ADD_PERMISSION_INPUT.members["Label"], self.label - ) - - if self.aws_account_id is not None: - _serialize_delegates_list( - serializer, - _SCHEMA_ADD_PERMISSION_INPUT.members["AWSAccountId"], - self.aws_account_id, - ) - - if self.action_name is not None: - _serialize_actions_list( - serializer, - _SCHEMA_ADD_PERMISSION_INPUT.members["ActionName"], - self.action_name, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["topic_arn"] = de.read_string( - _SCHEMA_ADD_PERMISSION_INPUT.members["TopicArn"] - ) - - case 1: - kwargs["label"] = de.read_string( - _SCHEMA_ADD_PERMISSION_INPUT.members["Label"] - ) - - case 2: - kwargs["aws_account_id"] = _deserialize_delegates_list( - de, _SCHEMA_ADD_PERMISSION_INPUT.members["AWSAccountId"] - ) - - case 3: - kwargs["action_name"] = _deserialize_actions_list( - de, _SCHEMA_ADD_PERMISSION_INPUT.members["ActionName"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ADD_PERMISSION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class AddPermissionOutput: - """Dataclass for AddPermissionOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ADD_PERMISSION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ADD_PERMISSION_OUTPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class AuthorizationErrorException(ServiceError): - """ - Indicates that the user has been denied access to the requested - resource. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUTHORIZATION_ERROR_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_AUTHORIZATION_ERROR_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_AUTHORIZATION_ERROR_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_AUTHORIZATION_ERROR_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InternalErrorException(ServiceError): - """Indicates an internal service error.""" - - fault: Literal["client", "server"] | None = "server" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INTERNAL_ERROR_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INTERNAL_ERROR_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INTERNAL_ERROR_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INTERNAL_ERROR_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class InvalidParameterException(ServiceError): - """ - Indicates that a request parameter does not comply with the associated - constraints. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_PARAMETER_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_PARAMETER_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_PARAMETER_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVALID_PARAMETER_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class NotFoundException(ServiceError): - """Indicates that the requested resource does not exist.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_NOT_FOUND_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_NOT_FOUND_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_NOT_FOUND_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_NOT_FOUND_EXCEPTION, consumer=_consumer) - return kwargs - - -ADD_PERMISSION = APIOperation( - input=AddPermissionInput, - output=AddPermissionOutput, - schema=_SCHEMA_ADD_PERMISSION, - input_schema=_SCHEMA_ADD_PERMISSION_INPUT, - output_schema=_SCHEMA_ADD_PERMISSION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.sns#AuthorizationErrorException" - ): AuthorizationErrorException, - ShapeID("com.amazonaws.sns#InternalErrorException"): InternalErrorException, - ShapeID( - "com.amazonaws.sns#InvalidParameterException" - ): InvalidParameterException, - ShapeID("com.amazonaws.sns#NotFoundException"): NotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_AUTHORIZATION_ERROR_EXCEPTION, - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class CheckIfPhoneNumberIsOptedOutInput: - """The input for the `CheckIfPhoneNumberIsOptedOut` action.""" - - phone_number: str | None = field(repr=False, default=None) - """The phone number for which you want to check the opt out status.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CHECK_IF_PHONE_NUMBER_IS_OPTED_OUT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.phone_number is not None: - serializer.write_string( - _SCHEMA_CHECK_IF_PHONE_NUMBER_IS_OPTED_OUT_INPUT.members["phoneNumber"], - self.phone_number, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["phone_number"] = de.read_string( - _SCHEMA_CHECK_IF_PHONE_NUMBER_IS_OPTED_OUT_INPUT.members[ - "phoneNumber" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CHECK_IF_PHONE_NUMBER_IS_OPTED_OUT_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CheckIfPhoneNumberIsOptedOutOutput: - """The response from the `CheckIfPhoneNumberIsOptedOut` action.""" - - is_opted_out: bool = False - """ - Indicates whether the phone number is opted out: - - - `true` -- The phone number is opted out, meaning you cannot publish - SMS messages to it. - - - `false` -- The phone number is opted in, meaning you can publish SMS - messages to it. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CHECK_IF_PHONE_NUMBER_IS_OPTED_OUT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_boolean( - _SCHEMA_CHECK_IF_PHONE_NUMBER_IS_OPTED_OUT_OUTPUT.members["isOptedOut"], - self.is_opted_out, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["is_opted_out"] = de.read_boolean( - _SCHEMA_CHECK_IF_PHONE_NUMBER_IS_OPTED_OUT_OUTPUT.members[ - "isOptedOut" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CHECK_IF_PHONE_NUMBER_IS_OPTED_OUT_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ThrottledException(ServiceError): - """ - Indicates that the rate at which requests have been submitted for this - action exceeds the limit for your Amazon Web Services account. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_THROTTLED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_THROTTLED_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_THROTTLED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_THROTTLED_EXCEPTION, consumer=_consumer) - return kwargs - - -CHECK_IF_PHONE_NUMBER_IS_OPTED_OUT = APIOperation( - input=CheckIfPhoneNumberIsOptedOutInput, - output=CheckIfPhoneNumberIsOptedOutOutput, - schema=_SCHEMA_CHECK_IF_PHONE_NUMBER_IS_OPTED_OUT, - input_schema=_SCHEMA_CHECK_IF_PHONE_NUMBER_IS_OPTED_OUT_INPUT, - output_schema=_SCHEMA_CHECK_IF_PHONE_NUMBER_IS_OPTED_OUT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.sns#AuthorizationErrorException" - ): AuthorizationErrorException, - ShapeID("com.amazonaws.sns#InternalErrorException"): InternalErrorException, - ShapeID( - "com.amazonaws.sns#InvalidParameterException" - ): InvalidParameterException, - ShapeID("com.amazonaws.sns#ThrottledException"): ThrottledException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_AUTHORIZATION_ERROR_EXCEPTION, - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_THROTTLED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ConfirmSubscriptionInput: - """Input for ConfirmSubscription action.""" - - topic_arn: str | None = None - """The ARN of the topic for which you wish to confirm a subscription.""" - - token: str | None = None - """Short-lived token sent to an endpoint during the `Subscribe` action.""" - - authenticate_on_unsubscribe: str | None = None - """ - Disallows unauthenticated unsubscribes of the subscription. If the value - of this parameter is `true` and the request has an Amazon Web Services - signature, then only the topic owner and the subscription owner can - unsubscribe the endpoint. The unsubscribe action requires Amazon Web - Services authentication. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONFIRM_SUBSCRIPTION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.topic_arn is not None: - serializer.write_string( - _SCHEMA_CONFIRM_SUBSCRIPTION_INPUT.members["TopicArn"], self.topic_arn - ) - - if self.token is not None: - serializer.write_string( - _SCHEMA_CONFIRM_SUBSCRIPTION_INPUT.members["Token"], self.token - ) - - if self.authenticate_on_unsubscribe is not None: - serializer.write_string( - _SCHEMA_CONFIRM_SUBSCRIPTION_INPUT.members["AuthenticateOnUnsubscribe"], - self.authenticate_on_unsubscribe, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["topic_arn"] = de.read_string( - _SCHEMA_CONFIRM_SUBSCRIPTION_INPUT.members["TopicArn"] - ) - - case 1: - kwargs["token"] = de.read_string( - _SCHEMA_CONFIRM_SUBSCRIPTION_INPUT.members["Token"] - ) - - case 2: - kwargs["authenticate_on_unsubscribe"] = de.read_string( - _SCHEMA_CONFIRM_SUBSCRIPTION_INPUT.members[ - "AuthenticateOnUnsubscribe" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONFIRM_SUBSCRIPTION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ConfirmSubscriptionOutput: - """Response for ConfirmSubscriptions action.""" - - subscription_arn: str | None = None - """The ARN of the created subscription.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONFIRM_SUBSCRIPTION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.subscription_arn is not None: - serializer.write_string( - _SCHEMA_CONFIRM_SUBSCRIPTION_OUTPUT.members["SubscriptionArn"], - self.subscription_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["subscription_arn"] = de.read_string( - _SCHEMA_CONFIRM_SUBSCRIPTION_OUTPUT.members["SubscriptionArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CONFIRM_SUBSCRIPTION_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class FilterPolicyLimitExceededException(ServiceError): - """ - Indicates that the number of filter polices in your Amazon Web Services - account exceeds the limit. To add more filter polices, submit an Amazon - SNS Limit Increase case in the Amazon Web Services Support Center. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FILTER_POLICY_LIMIT_EXCEEDED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_FILTER_POLICY_LIMIT_EXCEEDED_EXCEPTION.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_FILTER_POLICY_LIMIT_EXCEEDED_EXCEPTION.members[ - "message" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_FILTER_POLICY_LIMIT_EXCEEDED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ReplayLimitExceededException(ServiceError): - """ - Indicates that the request parameter has exceeded the maximum number of - concurrent message replays. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REPLAY_LIMIT_EXCEEDED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_REPLAY_LIMIT_EXCEEDED_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_REPLAY_LIMIT_EXCEEDED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_REPLAY_LIMIT_EXCEEDED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class SubscriptionLimitExceededException(ServiceError): - """ - Indicates that the customer already owns the maximum allowed number of - subscriptions. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SUBSCRIPTION_LIMIT_EXCEEDED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_SUBSCRIPTION_LIMIT_EXCEEDED_EXCEPTION.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_SUBSCRIPTION_LIMIT_EXCEEDED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SUBSCRIPTION_LIMIT_EXCEEDED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -CONFIRM_SUBSCRIPTION = APIOperation( - input=ConfirmSubscriptionInput, - output=ConfirmSubscriptionOutput, - schema=_SCHEMA_CONFIRM_SUBSCRIPTION, - input_schema=_SCHEMA_CONFIRM_SUBSCRIPTION_INPUT, - output_schema=_SCHEMA_CONFIRM_SUBSCRIPTION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.sns#AuthorizationErrorException" - ): AuthorizationErrorException, - ShapeID( - "com.amazonaws.sns#FilterPolicyLimitExceededException" - ): FilterPolicyLimitExceededException, - ShapeID("com.amazonaws.sns#InternalErrorException"): InternalErrorException, - ShapeID( - "com.amazonaws.sns#InvalidParameterException" - ): InvalidParameterException, - ShapeID("com.amazonaws.sns#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.sns#ReplayLimitExceededException" - ): ReplayLimitExceededException, - ShapeID( - "com.amazonaws.sns#SubscriptionLimitExceededException" - ): SubscriptionLimitExceededException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_AUTHORIZATION_ERROR_EXCEPTION, - _SCHEMA_FILTER_POLICY_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_REPLAY_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_SUBSCRIPTION_LIMIT_EXCEEDED_EXCEPTION, - ], -) - - -def _serialize_map_string_to_string( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_map_string_to_string( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CreatePlatformApplicationInput: - """Input for CreatePlatformApplication action.""" - - name: str | None = None - """ - Application names must be made up of only uppercase and lowercase ASCII - letters, numbers, underscores, hyphens, and periods, and must be between - 1 and 256 characters long. - """ - - platform: str | None = None - """ - The following platforms are supported: ADM (Amazon Device Messaging), - APNS (Apple Push Notification Service), APNS_SANDBOX, and GCM (Firebase - Cloud Messaging). - """ - - attributes: dict[str, str] | None = None - """ - For a list of attributes, see - [`SetPlatformApplicationAttributes`](https://docs.aws.amazon.com/sns/latest/api/API_SetPlatformApplicationAttributes.html) - . - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_PLATFORM_APPLICATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_PLATFORM_APPLICATION_INPUT.members["Name"], self.name - ) - - if self.platform is not None: - serializer.write_string( - _SCHEMA_CREATE_PLATFORM_APPLICATION_INPUT.members["Platform"], - self.platform, - ) - - if self.attributes is not None: - _serialize_map_string_to_string( - serializer, - _SCHEMA_CREATE_PLATFORM_APPLICATION_INPUT.members["Attributes"], - self.attributes, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_PLATFORM_APPLICATION_INPUT.members["Name"] - ) - - case 1: - kwargs["platform"] = de.read_string( - _SCHEMA_CREATE_PLATFORM_APPLICATION_INPUT.members["Platform"] - ) - - case 2: - kwargs["attributes"] = _deserialize_map_string_to_string( - de, - _SCHEMA_CREATE_PLATFORM_APPLICATION_INPUT.members["Attributes"], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_PLATFORM_APPLICATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CreatePlatformApplicationOutput: - """Response from CreatePlatformApplication action.""" - - platform_application_arn: str | None = None - """`PlatformApplicationArn` is returned.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_PLATFORM_APPLICATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.platform_application_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_PLATFORM_APPLICATION_OUTPUT.members[ - "PlatformApplicationArn" - ], - self.platform_application_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["platform_application_arn"] = de.read_string( - _SCHEMA_CREATE_PLATFORM_APPLICATION_OUTPUT.members[ - "PlatformApplicationArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_PLATFORM_APPLICATION_OUTPUT, consumer=_consumer - ) - return kwargs - - -CREATE_PLATFORM_APPLICATION = APIOperation( - input=CreatePlatformApplicationInput, - output=CreatePlatformApplicationOutput, - schema=_SCHEMA_CREATE_PLATFORM_APPLICATION, - input_schema=_SCHEMA_CREATE_PLATFORM_APPLICATION_INPUT, - output_schema=_SCHEMA_CREATE_PLATFORM_APPLICATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.sns#AuthorizationErrorException" - ): AuthorizationErrorException, - ShapeID("com.amazonaws.sns#InternalErrorException"): InternalErrorException, - ShapeID( - "com.amazonaws.sns#InvalidParameterException" - ): InvalidParameterException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_AUTHORIZATION_ERROR_EXCEPTION, - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class CreatePlatformEndpointInput: - """Input for CreatePlatformEndpoint action.""" - - platform_application_arn: str | None = None - """ - `PlatformApplicationArn` returned from CreatePlatformApplication is used - to create a an endpoint. - """ - - token: str | None = None - """ - Unique identifier created by the notification service for an app on a - device. The specific name for Token will vary, depending on which - notification service is being used. For example, when using APNS as the - notification service, you need the device token. Alternatively, when - using GCM (Firebase Cloud Messaging) or ADM, the device token equivalent - is called the registration ID. - """ - - custom_user_data: str | None = None - """ - Arbitrary user data to associate with the endpoint. Amazon SNS does not - use this data. The data must be in UTF-8 format and less than 2KB. - """ - - attributes: dict[str, str] | None = None - """ - For a list of attributes, see - [`SetEndpointAttributes`](https://docs.aws.amazon.com/sns/latest/api/API_SetEndpointAttributes.html) - . - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_PLATFORM_ENDPOINT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.platform_application_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_PLATFORM_ENDPOINT_INPUT.members[ - "PlatformApplicationArn" - ], - self.platform_application_arn, - ) - - if self.token is not None: - serializer.write_string( - _SCHEMA_CREATE_PLATFORM_ENDPOINT_INPUT.members["Token"], self.token - ) - - if self.custom_user_data is not None: - serializer.write_string( - _SCHEMA_CREATE_PLATFORM_ENDPOINT_INPUT.members["CustomUserData"], - self.custom_user_data, - ) - - if self.attributes is not None: - _serialize_map_string_to_string( - serializer, - _SCHEMA_CREATE_PLATFORM_ENDPOINT_INPUT.members["Attributes"], - self.attributes, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["platform_application_arn"] = de.read_string( - _SCHEMA_CREATE_PLATFORM_ENDPOINT_INPUT.members[ - "PlatformApplicationArn" - ] - ) - - case 1: - kwargs["token"] = de.read_string( - _SCHEMA_CREATE_PLATFORM_ENDPOINT_INPUT.members["Token"] - ) - - case 2: - kwargs["custom_user_data"] = de.read_string( - _SCHEMA_CREATE_PLATFORM_ENDPOINT_INPUT.members["CustomUserData"] - ) - - case 3: - kwargs["attributes"] = _deserialize_map_string_to_string( - de, _SCHEMA_CREATE_PLATFORM_ENDPOINT_INPUT.members["Attributes"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_PLATFORM_ENDPOINT_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CreatePlatformEndpointOutput: - """Response from CreateEndpoint action.""" - - endpoint_arn: str | None = None - """EndpointArn returned from CreateEndpoint action.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_PLATFORM_ENDPOINT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.endpoint_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_PLATFORM_ENDPOINT_OUTPUT.members["EndpointArn"], - self.endpoint_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["endpoint_arn"] = de.read_string( - _SCHEMA_CREATE_PLATFORM_ENDPOINT_OUTPUT.members["EndpointArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_PLATFORM_ENDPOINT_OUTPUT, consumer=_consumer - ) - return kwargs - - -CREATE_PLATFORM_ENDPOINT = APIOperation( - input=CreatePlatformEndpointInput, - output=CreatePlatformEndpointOutput, - schema=_SCHEMA_CREATE_PLATFORM_ENDPOINT, - input_schema=_SCHEMA_CREATE_PLATFORM_ENDPOINT_INPUT, - output_schema=_SCHEMA_CREATE_PLATFORM_ENDPOINT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.sns#AuthorizationErrorException" - ): AuthorizationErrorException, - ShapeID("com.amazonaws.sns#InternalErrorException"): InternalErrorException, - ShapeID( - "com.amazonaws.sns#InvalidParameterException" - ): InvalidParameterException, - ShapeID("com.amazonaws.sns#NotFoundException"): NotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_AUTHORIZATION_ERROR_EXCEPTION, - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - ], -) - - -class LanguageCodeString(UnknownEnumMixin, StrEnum): - """Supported language code for sending OTP message""" - - EN_US = "en-US" - EN_GB = "en-GB" - ES_419 = "es-419" - ES_ES = "es-ES" - DE_DE = "de-DE" - FR_CA = "fr-CA" - FR_FR = "fr-FR" - IT_IT = "it-IT" - JP_JP = "ja-JP" - PT_BR = "pt-BR" - KR_KR = "kr-KR" - ZH_CN = "zh-CN" - ZH_TW = "zh-TW" - - -@dataclass(kw_only=True) -class CreateSMSSandboxPhoneNumberInput: - """Dataclass for CreateSMSSandboxPhoneNumberInput structure.""" - - phone_number: str | None = field(repr=False, default=None) - """ - The destination phone number to verify. On verification, Amazon SNS adds - this phone number to the list of verified phone numbers that you can - send SMS messages to. - """ - - language_code: str | None = None - """The language to use for sending the OTP. The default value is `en-US`.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_SMS_SANDBOX_PHONE_NUMBER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.phone_number is not None: - serializer.write_string( - _SCHEMA_CREATE_SMS_SANDBOX_PHONE_NUMBER_INPUT.members["PhoneNumber"], - self.phone_number, - ) - - if self.language_code is not None: - serializer.write_string( - _SCHEMA_CREATE_SMS_SANDBOX_PHONE_NUMBER_INPUT.members["LanguageCode"], - self.language_code, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["phone_number"] = de.read_string( - _SCHEMA_CREATE_SMS_SANDBOX_PHONE_NUMBER_INPUT.members[ - "PhoneNumber" - ] - ) - - case 1: - kwargs["language_code"] = LanguageCodeString( - de.read_string( - _SCHEMA_CREATE_SMS_SANDBOX_PHONE_NUMBER_INPUT.members[ - "LanguageCode" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_SMS_SANDBOX_PHONE_NUMBER_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CreateSMSSandboxPhoneNumberOutput: - """Dataclass for CreateSMSSandboxPhoneNumberOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_SMS_SANDBOX_PHONE_NUMBER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CREATE_SMS_SANDBOX_PHONE_NUMBER_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class OptedOutException(ServiceError): - """ - Indicates that the specified phone number opted out of receiving SMS - messages from your Amazon Web Services account. You can't send SMS - messages to phone numbers that opt out. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OPTED_OUT_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_OPTED_OUT_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_OPTED_OUT_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_OPTED_OUT_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UserErrorException(ServiceError): - """ - Indicates that a request parameter does not comply with the associated - constraints. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_USER_ERROR_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_USER_ERROR_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_USER_ERROR_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_USER_ERROR_EXCEPTION, consumer=_consumer) - return kwargs - - -CREATE_SMS_SANDBOX_PHONE_NUMBER = APIOperation( - input=CreateSMSSandboxPhoneNumberInput, - output=CreateSMSSandboxPhoneNumberOutput, - schema=_SCHEMA_CREATE_SMS_SANDBOX_PHONE_NUMBER, - input_schema=_SCHEMA_CREATE_SMS_SANDBOX_PHONE_NUMBER_INPUT, - output_schema=_SCHEMA_CREATE_SMS_SANDBOX_PHONE_NUMBER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.sns#AuthorizationErrorException" - ): AuthorizationErrorException, - ShapeID("com.amazonaws.sns#InternalErrorException"): InternalErrorException, - ShapeID( - "com.amazonaws.sns#InvalidParameterException" - ): InvalidParameterException, - ShapeID("com.amazonaws.sns#OptedOutException"): OptedOutException, - ShapeID("com.amazonaws.sns#ThrottledException"): ThrottledException, - ShapeID("com.amazonaws.sns#UserErrorException"): UserErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_AUTHORIZATION_ERROR_EXCEPTION, - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_OPTED_OUT_EXCEPTION, - _SCHEMA_THROTTLED_EXCEPTION, - _SCHEMA_USER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ConcurrentAccessException(ServiceError): - """ - Can't perform multiple operations on a tag simultaneously. Perform the - operations sequentially. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONCURRENT_ACCESS_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_CONCURRENT_ACCESS_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_CONCURRENT_ACCESS_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CONCURRENT_ACCESS_EXCEPTION, consumer=_consumer - ) - return kwargs - - -def _serialize_topic_attributes_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_topic_attributes_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class Tag: - """The list of tags to be added to the specified topic.""" - - key: str - """The required key portion of the tag.""" - - value: str - """The optional value portion of the tag.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TAG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_TAG.members["Key"], self.key) - serializer.write_string(_SCHEMA_TAG.members["Value"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["key"] = de.read_string(_SCHEMA_TAG.members["Key"]) - - case 1: - kwargs["value"] = de.read_string(_SCHEMA_TAG.members["Value"]) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TAG, consumer=_consumer) - if "key" not in kwargs: - kwargs["key"] = "" - if "value" not in kwargs: - kwargs["value"] = "" - return kwargs - - -def _serialize_tag_list( - serializer: ShapeSerializer, schema: Schema, value: list[Tag] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_tag_list(deserializer: ShapeDeserializer, schema: Schema) -> list[Tag]: - result: list[Tag] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Tag.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CreateTopicInput: - """Input for CreateTopic action.""" - - name: str | None = None - """ - The name of the topic you want to create. - - Constraints: Topic names must be made up of only uppercase and lowercase - ASCII letters, numbers, underscores, and hyphens, and must be between 1 - and 256 characters long. - - For a FIFO (first-in-first-out) topic, the name must end with the - `.fifo` suffix. - """ - - attributes: dict[str, str] | None = None - """ - A map of attributes with their corresponding values. - - The following lists names, descriptions, and values of the special - request parameters that the `CreateTopic` action uses: - - - `DeliveryPolicy` -- The policy that defines how Amazon SNS retries - failed deliveries to HTTP/S endpoints. - - - `DisplayName` -- The display name to use for a topic with SMS, - `email`, and `email-json` subscriptions. For `email` and `email-json` - subscriptions, the display name is used as the sender name for regular - notification messages. Subscription confirmation and unsubscribe - confirmation emails always use \"Amazon Web Services Notifications\" - as the sender name. - - - `MaximumMessageSize` -- The maximum size, in bytes, of a message that - can be published to the topic. Valid values are `1024` to `1048576` (1 - MiB). The default is `262144` (256 KiB). - - A topic with a `MaximumMessageSize` above 256 KiB must have 100 or - fewer subscriptions, and each subscription must be an Amazon SQS, - Amazon Data Firehose, or Lambda subscription. - - - `Policy` -- The policy that defines who can access your topic. By - default, only the topic owner can publish or subscribe to the topic. - - - `TracingConfig` -- Tracing mode of an Amazon SNS topic. By default - `TracingConfig` is set to `PassThrough`, and the topic passes through - the tracing header it receives from an Amazon SNS publisher to its - subscriptions. If set to `Active`, Amazon SNS will vend X-Ray segment - data to topic owner account if the sampled flag in the tracing header - is true. This is only supported on standard topics. - - - HTTP - - - `HTTPSuccessFeedbackRoleArn` -- Indicates successful message - delivery status for an Amazon SNS topic that is subscribed to an - HTTP endpoint. - - - `HTTPSuccessFeedbackSampleRate` -- Indicates percentage of - successful messages to sample for an Amazon SNS topic that is - subscribed to an HTTP endpoint. - - - `HTTPFailureFeedbackRoleArn` -- Indicates failed message delivery - status for an Amazon SNS topic that is subscribed to an HTTP - endpoint. - - - Amazon Data Firehose - - - `FirehoseSuccessFeedbackRoleArn` -- Indicates successful message - delivery status for an Amazon SNS topic that is subscribed to an - Amazon Data Firehose endpoint. - - - `FirehoseSuccessFeedbackSampleRate` -- Indicates percentage of - successful messages to sample for an Amazon SNS topic that is - subscribed to an Amazon Data Firehose endpoint. - - - `FirehoseFailureFeedbackRoleArn` -- Indicates failed message - delivery status for an Amazon SNS topic that is subscribed to an - Amazon Data Firehose endpoint. - - - Lambda - - - `LambdaSuccessFeedbackRoleArn` -- Indicates successful message - delivery status for an Amazon SNS topic that is subscribed to an - Lambda endpoint. - - - `LambdaSuccessFeedbackSampleRate` -- Indicates percentage of - successful messages to sample for an Amazon SNS topic that is - subscribed to an Lambda endpoint. - - - `LambdaFailureFeedbackRoleArn` -- Indicates failed message delivery - status for an Amazon SNS topic that is subscribed to an Lambda - endpoint. - - - Platform application endpoint - - - `ApplicationSuccessFeedbackRoleArn` -- Indicates successful message - delivery status for an Amazon SNS topic that is subscribed to a - platform application endpoint. - - - `ApplicationSuccessFeedbackSampleRate` -- Indicates percentage of - successful messages to sample for an Amazon SNS topic that is - subscribed to an platform application endpoint. - - - `ApplicationFailureFeedbackRoleArn` -- Indicates failed message - delivery status for an Amazon SNS topic that is subscribed to an - platform application endpoint. - - Note: - In addition to being able to configure topic attributes for message - delivery status of notification messages sent to Amazon SNS - application endpoints, you can also configure application attributes - for the delivery status of push notification messages sent to push - notification services. - - For example, For more information, see [Using Amazon SNS Application - Attributes for Message Delivery - Status](https://docs.aws.amazon.com/sns/latest/dg/sns-msg-status.html). - - - Amazon SQS - - - `SQSSuccessFeedbackRoleArn` -- Indicates successful message delivery - status for an Amazon SNS topic that is subscribed to an Amazon SQS - endpoint. - - - `SQSSuccessFeedbackSampleRate` -- Indicates percentage of successful - messages to sample for an Amazon SNS topic that is subscribed to an - Amazon SQS endpoint. - - - `SQSFailureFeedbackRoleArn` -- Indicates failed message delivery - status for an Amazon SNS topic that is subscribed to an Amazon SQS - endpoint. - - Note: - The ``{=html}SuccessFeedbackRoleArn and - ``{=html}FailureFeedbackRoleArn attributes are used to give - Amazon SNS write access to use CloudWatch Logs on your behalf. The - ``{=html}SuccessFeedbackSampleRate attribute is for specifying - the sample rate percentage (0-100) of successfully delivered messages. - After you configure the ``{=html}FailureFeedbackRoleArn - attribute, then all failed message deliveries generate CloudWatch Logs. - - The following attribute applies only to [server-side - encryption](https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html): - - - `KmsMasterKeyId` -- The ID of an Amazon Web Services managed customer - master key (CMK) for Amazon SNS or a custom CMK. For more information, - see [Key - Terms](https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html#sse-key-terms). - For more examples, see - [KeyId](https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters) - in the *Key Management Service API Reference*. - - The following attributes apply only to [FIFO - topics](https://docs.aws.amazon.com/sns/latest/dg/sns-fifo-topics.html): - - - `ArchivePolicy` -- The policy that sets the retention period for - messages stored in the message archive of an Amazon SNS FIFO topic. - - - `ContentBasedDeduplication` -- Enables content-based deduplication for - FIFO topics. - - - By default, `ContentBasedDeduplication` is set to `false`. If you - create a FIFO topic and this attribute is `false`, you must specify - a value for the `MessageDeduplicationId` parameter for the - [Publish](https://docs.aws.amazon.com/sns/latest/api/API_Publish.html) - action. - - - When you set `ContentBasedDeduplication` to `true`, Amazon SNS uses - a SHA-256 hash to generate the `MessageDeduplicationId` using the - body of the message (but not the attributes of the message). - - (Optional) To override the generated value, you can specify a value - for the `MessageDeduplicationId` parameter for the `Publish` action. - - - - - `FifoThroughputScope` -- Enables higher throughput for your FIFO topic - by adjusting the scope of deduplication. This attribute has two - possible values: - - - `Topic` -- The scope of message deduplication is across the entire - topic. This is the default value and maintains existing behavior, - with a maximum throughput of 3000 messages per second or 20MB per - second, whichever comes first. - - - `MessageGroup` -- The scope of deduplication is within each - individual message group, which enables higher throughput per topic - subject to regional quotas. For more information on quotas or to - request an increase, see [Amazon SNS service - quotas](https://docs.aws.amazon.com/general/latest/gr/sns.html) in - the Amazon Web Services General Reference. - """ - - tags: list[Tag] | None = None - """ - The list of tags to add to a new topic. - - Note: - To be able to tag a topic on creation, you must have the - `sns:CreateTopic` and `sns:TagResource` permissions. - """ - - data_protection_policy: str | None = None - """ - Warning: - Amazon SNS message data protection is no longer available to new - customers. For more information and guidance on alternatives, see - [Amazon SNS message data protection availability - change](https://docs.aws.amazon.com/sns/latest/dg/sns-message-data-protection-availability-change.html). - - The body of the policy document you want to use for this topic. - - You can only add one policy per topic. - - The policy must be in JSON string format. - - Length Constraints: Maximum length of 30,720. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_TOPIC_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_CREATE_TOPIC_INPUT.members["Name"], self.name - ) - - if self.attributes is not None: - _serialize_topic_attributes_map( - serializer, - _SCHEMA_CREATE_TOPIC_INPUT.members["Attributes"], - self.attributes, - ) - - if self.tags is not None: - _serialize_tag_list( - serializer, _SCHEMA_CREATE_TOPIC_INPUT.members["Tags"], self.tags - ) - - if self.data_protection_policy is not None: - serializer.write_string( - _SCHEMA_CREATE_TOPIC_INPUT.members["DataProtectionPolicy"], - self.data_protection_policy, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_CREATE_TOPIC_INPUT.members["Name"] - ) - - case 1: - kwargs["attributes"] = _deserialize_topic_attributes_map( - de, _SCHEMA_CREATE_TOPIC_INPUT.members["Attributes"] - ) - - case 2: - kwargs["tags"] = _deserialize_tag_list( - de, _SCHEMA_CREATE_TOPIC_INPUT.members["Tags"] - ) - - case 3: - kwargs["data_protection_policy"] = de.read_string( - _SCHEMA_CREATE_TOPIC_INPUT.members["DataProtectionPolicy"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_TOPIC_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CreateTopicOutput: - """Response from CreateTopic action.""" - - topic_arn: str | None = None - """The Amazon Resource Name (ARN) assigned to the created topic.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_TOPIC_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.topic_arn is not None: - serializer.write_string( - _SCHEMA_CREATE_TOPIC_OUTPUT.members["TopicArn"], self.topic_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["topic_arn"] = de.read_string( - _SCHEMA_CREATE_TOPIC_OUTPUT.members["TopicArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_TOPIC_OUTPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class InvalidSecurityException(ServiceError): - """ - The credential signature isn't valid. You must use an HTTPS endpoint - and sign your request using Signature Version 4. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_SECURITY_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_SECURITY_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_SECURITY_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INVALID_SECURITY_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class StaleTagException(ServiceError): - """ - A tag has been added to a resource with the same ARN as a deleted - resource. Wait a short while and then retry the operation. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_STALE_TAG_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_STALE_TAG_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_STALE_TAG_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_STALE_TAG_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class TagLimitExceededException(ServiceError): - """Can't add more than 50 tags to a topic.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TAG_LIMIT_EXCEEDED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_TAG_LIMIT_EXCEEDED_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_TAG_LIMIT_EXCEEDED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_TAG_LIMIT_EXCEEDED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class TagPolicyException(ServiceError): - """ - The request doesn't comply with the IAM tag policy. Correct your - request and then retry it. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TAG_POLICY_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_TAG_POLICY_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_TAG_POLICY_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TAG_POLICY_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class TopicLimitExceededException(ServiceError): - """ - Indicates that the customer already owns the maximum allowed number of - topics. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOPIC_LIMIT_EXCEEDED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_TOPIC_LIMIT_EXCEEDED_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_TOPIC_LIMIT_EXCEEDED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_TOPIC_LIMIT_EXCEEDED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -CREATE_TOPIC = APIOperation( - input=CreateTopicInput, - output=CreateTopicOutput, - schema=_SCHEMA_CREATE_TOPIC, - input_schema=_SCHEMA_CREATE_TOPIC_INPUT, - output_schema=_SCHEMA_CREATE_TOPIC_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.sns#AuthorizationErrorException" - ): AuthorizationErrorException, - ShapeID( - "com.amazonaws.sns#ConcurrentAccessException" - ): ConcurrentAccessException, - ShapeID("com.amazonaws.sns#InternalErrorException"): InternalErrorException, - ShapeID( - "com.amazonaws.sns#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.sns#InvalidSecurityException" - ): InvalidSecurityException, - ShapeID("com.amazonaws.sns#StaleTagException"): StaleTagException, - ShapeID( - "com.amazonaws.sns#TagLimitExceededException" - ): TagLimitExceededException, - ShapeID("com.amazonaws.sns#TagPolicyException"): TagPolicyException, - ShapeID( - "com.amazonaws.sns#TopicLimitExceededException" - ): TopicLimitExceededException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_AUTHORIZATION_ERROR_EXCEPTION, - _SCHEMA_CONCURRENT_ACCESS_EXCEPTION, - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_INVALID_SECURITY_EXCEPTION, - _SCHEMA_STALE_TAG_EXCEPTION, - _SCHEMA_TAG_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_TAG_POLICY_EXCEPTION, - _SCHEMA_TOPIC_LIMIT_EXCEEDED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteEndpointInput: - """Input for `DeleteEndpoint` action.""" - - endpoint_arn: str | None = None - """`EndpointArn` of endpoint to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_ENDPOINT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.endpoint_arn is not None: - serializer.write_string( - _SCHEMA_DELETE_ENDPOINT_INPUT.members["EndpointArn"], self.endpoint_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["endpoint_arn"] = de.read_string( - _SCHEMA_DELETE_ENDPOINT_INPUT.members["EndpointArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_ENDPOINT_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteEndpointOutput: - """Dataclass for DeleteEndpointOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_ENDPOINT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_ENDPOINT_OUTPUT, consumer=_consumer) - return kwargs - - -DELETE_ENDPOINT = APIOperation( - input=DeleteEndpointInput, - output=DeleteEndpointOutput, - schema=_SCHEMA_DELETE_ENDPOINT, - input_schema=_SCHEMA_DELETE_ENDPOINT_INPUT, - output_schema=_SCHEMA_DELETE_ENDPOINT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.sns#AuthorizationErrorException" - ): AuthorizationErrorException, - ShapeID("com.amazonaws.sns#InternalErrorException"): InternalErrorException, - ShapeID( - "com.amazonaws.sns#InvalidParameterException" - ): InvalidParameterException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_AUTHORIZATION_ERROR_EXCEPTION, - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeletePlatformApplicationInput: - """Input for `DeletePlatformApplication` action.""" - - platform_application_arn: str | None = None - """`PlatformApplicationArn` of platform application object to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_PLATFORM_APPLICATION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.platform_application_arn is not None: - serializer.write_string( - _SCHEMA_DELETE_PLATFORM_APPLICATION_INPUT.members[ - "PlatformApplicationArn" - ], - self.platform_application_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["platform_application_arn"] = de.read_string( - _SCHEMA_DELETE_PLATFORM_APPLICATION_INPUT.members[ - "PlatformApplicationArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_PLATFORM_APPLICATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeletePlatformApplicationOutput: - """Dataclass for DeletePlatformApplicationOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_PLATFORM_APPLICATION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_PLATFORM_APPLICATION_OUTPUT, consumer=_consumer - ) - return kwargs - - -DELETE_PLATFORM_APPLICATION = APIOperation( - input=DeletePlatformApplicationInput, - output=DeletePlatformApplicationOutput, - schema=_SCHEMA_DELETE_PLATFORM_APPLICATION, - input_schema=_SCHEMA_DELETE_PLATFORM_APPLICATION_INPUT, - output_schema=_SCHEMA_DELETE_PLATFORM_APPLICATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.sns#AuthorizationErrorException" - ): AuthorizationErrorException, - ShapeID("com.amazonaws.sns#InternalErrorException"): InternalErrorException, - ShapeID( - "com.amazonaws.sns#InvalidParameterException" - ): InvalidParameterException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_AUTHORIZATION_ERROR_EXCEPTION, - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteSMSSandboxPhoneNumberInput: - """Dataclass for DeleteSMSSandboxPhoneNumberInput structure.""" - - phone_number: str | None = field(repr=False, default=None) - """The destination phone number to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_SMS_SANDBOX_PHONE_NUMBER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.phone_number is not None: - serializer.write_string( - _SCHEMA_DELETE_SMS_SANDBOX_PHONE_NUMBER_INPUT.members["PhoneNumber"], - self.phone_number, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["phone_number"] = de.read_string( - _SCHEMA_DELETE_SMS_SANDBOX_PHONE_NUMBER_INPUT.members[ - "PhoneNumber" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_SMS_SANDBOX_PHONE_NUMBER_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DeleteSMSSandboxPhoneNumberOutput: - """Dataclass for DeleteSMSSandboxPhoneNumberOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_SMS_SANDBOX_PHONE_NUMBER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_SMS_SANDBOX_PHONE_NUMBER_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ResourceNotFoundException(ServiceError): - """ - Can't perform the action on the specified resource. Make sure that the - resource exists. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, consumer=_consumer - ) - return kwargs - - -DELETE_SMS_SANDBOX_PHONE_NUMBER = APIOperation( - input=DeleteSMSSandboxPhoneNumberInput, - output=DeleteSMSSandboxPhoneNumberOutput, - schema=_SCHEMA_DELETE_SMS_SANDBOX_PHONE_NUMBER, - input_schema=_SCHEMA_DELETE_SMS_SANDBOX_PHONE_NUMBER_INPUT, - output_schema=_SCHEMA_DELETE_SMS_SANDBOX_PHONE_NUMBER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.sns#AuthorizationErrorException" - ): AuthorizationErrorException, - ShapeID("com.amazonaws.sns#InternalErrorException"): InternalErrorException, - ShapeID( - "com.amazonaws.sns#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.sns#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.sns#ThrottledException"): ThrottledException, - ShapeID("com.amazonaws.sns#UserErrorException"): UserErrorException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_AUTHORIZATION_ERROR_EXCEPTION, - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLED_EXCEPTION, - _SCHEMA_USER_ERROR_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class DeleteTopicInput: - """Dataclass for DeleteTopicInput structure.""" - - topic_arn: str | None = None - """The ARN of the topic you want to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_TOPIC_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.topic_arn is not None: - serializer.write_string( - _SCHEMA_DELETE_TOPIC_INPUT.members["TopicArn"], self.topic_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["topic_arn"] = de.read_string( - _SCHEMA_DELETE_TOPIC_INPUT.members["TopicArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_TOPIC_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteTopicOutput: - """Dataclass for DeleteTopicOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_TOPIC_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_TOPIC_OUTPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class InvalidStateException(ServiceError): - """ - Indicates that the specified state is not a valid state for an event - source. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_STATE_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_STATE_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_STATE_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INVALID_STATE_EXCEPTION, consumer=_consumer) - return kwargs - - -DELETE_TOPIC = APIOperation( - input=DeleteTopicInput, - output=DeleteTopicOutput, - schema=_SCHEMA_DELETE_TOPIC, - input_schema=_SCHEMA_DELETE_TOPIC_INPUT, - output_schema=_SCHEMA_DELETE_TOPIC_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.sns#AuthorizationErrorException" - ): AuthorizationErrorException, - ShapeID( - "com.amazonaws.sns#ConcurrentAccessException" - ): ConcurrentAccessException, - ShapeID("com.amazonaws.sns#InternalErrorException"): InternalErrorException, - ShapeID( - "com.amazonaws.sns#InvalidParameterException" - ): InvalidParameterException, - ShapeID("com.amazonaws.sns#InvalidStateException"): InvalidStateException, - ShapeID("com.amazonaws.sns#NotFoundException"): NotFoundException, - ShapeID("com.amazonaws.sns#StaleTagException"): StaleTagException, - ShapeID("com.amazonaws.sns#TagPolicyException"): TagPolicyException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_AUTHORIZATION_ERROR_EXCEPTION, - _SCHEMA_CONCURRENT_ACCESS_EXCEPTION, - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_INVALID_STATE_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_STALE_TAG_EXCEPTION, - _SCHEMA_TAG_POLICY_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetDataProtectionPolicyInput: - """Dataclass for GetDataProtectionPolicyInput structure.""" - - resource_arn: str | None = None - """ - The ARN of the topic whose `DataProtectionPolicy` you want to get. - - For more information about ARNs, see [Amazon Resource Names - (ARNs)](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - in the Amazon Web Services General Reference. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DATA_PROTECTION_POLICY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_GET_DATA_PROTECTION_POLICY_INPUT.members["ResourceArn"], - self.resource_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_GET_DATA_PROTECTION_POLICY_INPUT.members["ResourceArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_DATA_PROTECTION_POLICY_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetDataProtectionPolicyOutput: - """Dataclass for GetDataProtectionPolicyOutput structure.""" - - data_protection_policy: str | None = None - """Retrieves the `DataProtectionPolicy` in JSON string format.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DATA_PROTECTION_POLICY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.data_protection_policy is not None: - serializer.write_string( - _SCHEMA_GET_DATA_PROTECTION_POLICY_OUTPUT.members[ - "DataProtectionPolicy" - ], - self.data_protection_policy, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["data_protection_policy"] = de.read_string( - _SCHEMA_GET_DATA_PROTECTION_POLICY_OUTPUT.members[ - "DataProtectionPolicy" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_DATA_PROTECTION_POLICY_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_DATA_PROTECTION_POLICY = APIOperation( - input=GetDataProtectionPolicyInput, - output=GetDataProtectionPolicyOutput, - schema=_SCHEMA_GET_DATA_PROTECTION_POLICY, - input_schema=_SCHEMA_GET_DATA_PROTECTION_POLICY_INPUT, - output_schema=_SCHEMA_GET_DATA_PROTECTION_POLICY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.sns#AuthorizationErrorException" - ): AuthorizationErrorException, - ShapeID("com.amazonaws.sns#InternalErrorException"): InternalErrorException, - ShapeID( - "com.amazonaws.sns#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.sns#InvalidSecurityException" - ): InvalidSecurityException, - ShapeID("com.amazonaws.sns#NotFoundException"): NotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_AUTHORIZATION_ERROR_EXCEPTION, - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_INVALID_SECURITY_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetEndpointAttributesInput: - """Input for `GetEndpointAttributes` action.""" - - endpoint_arn: str | None = None - """`EndpointArn` for `GetEndpointAttributes` input.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_ENDPOINT_ATTRIBUTES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.endpoint_arn is not None: - serializer.write_string( - _SCHEMA_GET_ENDPOINT_ATTRIBUTES_INPUT.members["EndpointArn"], - self.endpoint_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["endpoint_arn"] = de.read_string( - _SCHEMA_GET_ENDPOINT_ATTRIBUTES_INPUT.members["EndpointArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_ENDPOINT_ATTRIBUTES_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetEndpointAttributesOutput: - """Response from `GetEndpointAttributes` of the `EndpointArn`.""" - - attributes: dict[str, str] | None = None - """ - Attributes include the following: - - - `CustomUserData` -- arbitrary user data to associate with the - endpoint. Amazon SNS does not use this data. The data must be in UTF-8 - format and less than 2KB. - - - `Enabled` -- flag that enables/disables delivery to the endpoint. - Amazon SNS will set this to false when a notification service - indicates to Amazon SNS that the endpoint is invalid. Users can set it - back to true, typically after updating Token. - - - `Token` -- device token, also referred to as a registration id, for an - app and mobile device. This is returned from the notification service - when an app and mobile device are registered with the notification - service. - - Note: - The device token for the iOS platform is returned in lowercase. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_ENDPOINT_ATTRIBUTES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.attributes is not None: - _serialize_map_string_to_string( - serializer, - _SCHEMA_GET_ENDPOINT_ATTRIBUTES_OUTPUT.members["Attributes"], - self.attributes, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["attributes"] = _deserialize_map_string_to_string( - de, _SCHEMA_GET_ENDPOINT_ATTRIBUTES_OUTPUT.members["Attributes"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_ENDPOINT_ATTRIBUTES_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_ENDPOINT_ATTRIBUTES = APIOperation( - input=GetEndpointAttributesInput, - output=GetEndpointAttributesOutput, - schema=_SCHEMA_GET_ENDPOINT_ATTRIBUTES, - input_schema=_SCHEMA_GET_ENDPOINT_ATTRIBUTES_INPUT, - output_schema=_SCHEMA_GET_ENDPOINT_ATTRIBUTES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.sns#AuthorizationErrorException" - ): AuthorizationErrorException, - ShapeID("com.amazonaws.sns#InternalErrorException"): InternalErrorException, - ShapeID( - "com.amazonaws.sns#InvalidParameterException" - ): InvalidParameterException, - ShapeID("com.amazonaws.sns#NotFoundException"): NotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_AUTHORIZATION_ERROR_EXCEPTION, - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetPlatformApplicationAttributesInput: - """Input for `GetPlatformApplicationAttributes` action.""" - - platform_application_arn: str | None = None - """`PlatformApplicationArn` for GetPlatformApplicationAttributesInput.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_PLATFORM_APPLICATION_ATTRIBUTES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.platform_application_arn is not None: - serializer.write_string( - _SCHEMA_GET_PLATFORM_APPLICATION_ATTRIBUTES_INPUT.members[ - "PlatformApplicationArn" - ], - self.platform_application_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["platform_application_arn"] = de.read_string( - _SCHEMA_GET_PLATFORM_APPLICATION_ATTRIBUTES_INPUT.members[ - "PlatformApplicationArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_PLATFORM_APPLICATION_ATTRIBUTES_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetPlatformApplicationAttributesOutput: - """Response for `GetPlatformApplicationAttributes` action.""" - - attributes: dict[str, str] | None = None - """ - Attributes include the following: - - - `AppleCertificateExpiryDate` -- The expiry date of the SSL certificate - used to configure certificate-based authentication. - - - `ApplePlatformTeamID` -- The Apple developer account ID used to - configure token-based authentication. - - - `ApplePlatformBundleID` -- The app identifier used to configure - token-based authentication. - - - `AuthenticationMethod` -- Returns the credential type used when - sending push notifications from application to APNS/APNS_Sandbox, or - application to GCM. - - - APNS -- Returns the token or certificate. - - - GCM -- Returns the token or key. - - - `EventEndpointCreated` -- Topic ARN to which EndpointCreated event - notifications should be sent. - - - `EventEndpointDeleted` -- Topic ARN to which EndpointDeleted event - notifications should be sent. - - - `EventEndpointUpdated` -- Topic ARN to which EndpointUpdate event - notifications should be sent. - - - `EventDeliveryFailure` -- Topic ARN to which DeliveryFailure event - notifications should be sent upon Direct Publish delivery failure - (permanent) to one of the application's endpoints. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_GET_PLATFORM_APPLICATION_ATTRIBUTES_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.attributes is not None: - _serialize_map_string_to_string( - serializer, - _SCHEMA_GET_PLATFORM_APPLICATION_ATTRIBUTES_OUTPUT.members[ - "Attributes" - ], - self.attributes, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["attributes"] = _deserialize_map_string_to_string( - de, - _SCHEMA_GET_PLATFORM_APPLICATION_ATTRIBUTES_OUTPUT.members[ - "Attributes" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_PLATFORM_APPLICATION_ATTRIBUTES_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_PLATFORM_APPLICATION_ATTRIBUTES = APIOperation( - input=GetPlatformApplicationAttributesInput, - output=GetPlatformApplicationAttributesOutput, - schema=_SCHEMA_GET_PLATFORM_APPLICATION_ATTRIBUTES, - input_schema=_SCHEMA_GET_PLATFORM_APPLICATION_ATTRIBUTES_INPUT, - output_schema=_SCHEMA_GET_PLATFORM_APPLICATION_ATTRIBUTES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.sns#AuthorizationErrorException" - ): AuthorizationErrorException, - ShapeID("com.amazonaws.sns#InternalErrorException"): InternalErrorException, - ShapeID( - "com.amazonaws.sns#InvalidParameterException" - ): InvalidParameterException, - ShapeID("com.amazonaws.sns#NotFoundException"): NotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_AUTHORIZATION_ERROR_EXCEPTION, - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - ], -) - - -def _serialize_list_string( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_list_string( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GetSMSAttributesInput: - """The input for the `GetSMSAttributes` request.""" - - attributes: list[str] | None = None - """ - A list of the individual attribute names, such as `MonthlySpendLimit`, - for which you want values. - - For all attribute names, see - [SetSMSAttributes](https://docs.aws.amazon.com/sns/latest/api/API_SetSMSAttributes.html). - - If you don't use this parameter, Amazon SNS returns all SMS attributes. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_SMS_ATTRIBUTES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.attributes is not None: - _serialize_list_string( - serializer, - _SCHEMA_GET_SMS_ATTRIBUTES_INPUT.members["attributes"], - self.attributes, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["attributes"] = _deserialize_list_string( - de, _SCHEMA_GET_SMS_ATTRIBUTES_INPUT.members["attributes"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_SMS_ATTRIBUTES_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetSMSAttributesOutput: - """The response from the `GetSMSAttributes` request.""" - - attributes: dict[str, str] | None = None - """The SMS attribute names and their values.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_SMS_ATTRIBUTES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.attributes is not None: - _serialize_map_string_to_string( - serializer, - _SCHEMA_GET_SMS_ATTRIBUTES_OUTPUT.members["attributes"], - self.attributes, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["attributes"] = _deserialize_map_string_to_string( - de, _SCHEMA_GET_SMS_ATTRIBUTES_OUTPUT.members["attributes"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_SMS_ATTRIBUTES_OUTPUT, consumer=_consumer) - return kwargs - - -GET_SMS_ATTRIBUTES = APIOperation( - input=GetSMSAttributesInput, - output=GetSMSAttributesOutput, - schema=_SCHEMA_GET_SMS_ATTRIBUTES, - input_schema=_SCHEMA_GET_SMS_ATTRIBUTES_INPUT, - output_schema=_SCHEMA_GET_SMS_ATTRIBUTES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.sns#AuthorizationErrorException" - ): AuthorizationErrorException, - ShapeID("com.amazonaws.sns#InternalErrorException"): InternalErrorException, - ShapeID( - "com.amazonaws.sns#InvalidParameterException" - ): InvalidParameterException, - ShapeID("com.amazonaws.sns#ThrottledException"): ThrottledException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_AUTHORIZATION_ERROR_EXCEPTION, - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_THROTTLED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetSMSSandboxAccountStatusInput: - """Dataclass for GetSMSSandboxAccountStatusInput structure.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_SMS_SANDBOX_ACCOUNT_STATUS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_SMS_SANDBOX_ACCOUNT_STATUS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetSMSSandboxAccountStatusOutput: - """Dataclass for GetSMSSandboxAccountStatusOutput structure.""" - - is_in_sandbox: bool = False - """ - Indicates whether the calling Amazon Web Services account is in the SMS - sandbox. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_SMS_SANDBOX_ACCOUNT_STATUS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_boolean( - _SCHEMA_GET_SMS_SANDBOX_ACCOUNT_STATUS_OUTPUT.members["IsInSandbox"], - self.is_in_sandbox, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["is_in_sandbox"] = de.read_boolean( - _SCHEMA_GET_SMS_SANDBOX_ACCOUNT_STATUS_OUTPUT.members[ - "IsInSandbox" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_SMS_SANDBOX_ACCOUNT_STATUS_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_SMS_SANDBOX_ACCOUNT_STATUS = APIOperation( - input=GetSMSSandboxAccountStatusInput, - output=GetSMSSandboxAccountStatusOutput, - schema=_SCHEMA_GET_SMS_SANDBOX_ACCOUNT_STATUS, - input_schema=_SCHEMA_GET_SMS_SANDBOX_ACCOUNT_STATUS_INPUT, - output_schema=_SCHEMA_GET_SMS_SANDBOX_ACCOUNT_STATUS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.sns#AuthorizationErrorException" - ): AuthorizationErrorException, - ShapeID("com.amazonaws.sns#InternalErrorException"): InternalErrorException, - ShapeID("com.amazonaws.sns#ThrottledException"): ThrottledException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_AUTHORIZATION_ERROR_EXCEPTION, - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_THROTTLED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetSubscriptionAttributesInput: - """Input for GetSubscriptionAttributes.""" - - subscription_arn: str | None = None - """The ARN of the subscription whose properties you want to get.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_SUBSCRIPTION_ATTRIBUTES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.subscription_arn is not None: - serializer.write_string( - _SCHEMA_GET_SUBSCRIPTION_ATTRIBUTES_INPUT.members["SubscriptionArn"], - self.subscription_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["subscription_arn"] = de.read_string( - _SCHEMA_GET_SUBSCRIPTION_ATTRIBUTES_INPUT.members[ - "SubscriptionArn" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_SUBSCRIPTION_ATTRIBUTES_INPUT, consumer=_consumer - ) - return kwargs - - -def _serialize_subscription_attributes_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_subscription_attributes_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GetSubscriptionAttributesOutput: - """Response for GetSubscriptionAttributes action.""" - - attributes: dict[str, str] | None = None - """ - A map of the subscription's attributes. Attributes in this map include - the following: - - - `ConfirmationWasAuthenticated` -- `true` if the subscription - confirmation request was authenticated. - - - `DeliveryPolicy` -- The JSON serialization of the subscription's - delivery policy. - - - `EffectiveDeliveryPolicy` -- The JSON serialization of the effective - delivery policy that takes into account the topic delivery policy and - account system defaults. - - - `FilterPolicy` -- The filter policy JSON that is assigned to the - subscription. For more information, see [Amazon SNS Message - Filtering](https://docs.aws.amazon.com/sns/latest/dg/sns-message-filtering.html) - in the *Amazon SNS Developer Guide*. - - - `FilterPolicyScope` -- This attribute lets you choose the filtering - scope by using one of the following string value types: - - - `MessageAttributes` (default) -- The filter is applied on the - message attributes. - - - `MessageBody` -- The filter is applied on the message body. - - - `Owner` -- The Amazon Web Services account ID of the subscription's - owner. - - - `PendingConfirmation` -- `true` if the subscription hasn't been - confirmed. To confirm a pending subscription, call the - `ConfirmSubscription` action with a confirmation token. - - - `RawMessageDelivery` -- `true` if raw message delivery is enabled for - the subscription. Raw messages are free of JSON formatting and can be - sent to HTTP/S and Amazon SQS endpoints. - - - `RedrivePolicy` -- When specified, sends undeliverable messages to the - specified Amazon SQS dead-letter queue. Messages that can't be - delivered due to client errors (for example, when the subscribed - endpoint is unreachable) or server errors (for example, when the - service that powers the subscribed endpoint becomes unavailable) are - held in the dead-letter queue for further analysis or reprocessing. - - - `SubscriptionArn` -- The subscription's ARN. - - - `TopicArn` -- The topic ARN that the subscription is associated with. - - The following attribute applies only to Amazon Data Firehose delivery - stream subscriptions: - - - `SubscriptionRoleArn` -- The ARN of the IAM role that has the - following: - - - Permission to write to the Firehose delivery stream - - - Amazon SNS listed as a trusted entity - - Specifying a valid ARN for this attribute is required for Firehose - delivery stream subscriptions. For more information, see [Fanout to - Firehose delivery - streams](https://docs.aws.amazon.com/sns/latest/dg/sns-firehose-as-subscriber.html) - in the *Amazon SNS Developer Guide*. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_SUBSCRIPTION_ATTRIBUTES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.attributes is not None: - _serialize_subscription_attributes_map( - serializer, - _SCHEMA_GET_SUBSCRIPTION_ATTRIBUTES_OUTPUT.members["Attributes"], - self.attributes, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["attributes"] = _deserialize_subscription_attributes_map( - de, - _SCHEMA_GET_SUBSCRIPTION_ATTRIBUTES_OUTPUT.members[ - "Attributes" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_SUBSCRIPTION_ATTRIBUTES_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_SUBSCRIPTION_ATTRIBUTES = APIOperation( - input=GetSubscriptionAttributesInput, - output=GetSubscriptionAttributesOutput, - schema=_SCHEMA_GET_SUBSCRIPTION_ATTRIBUTES, - input_schema=_SCHEMA_GET_SUBSCRIPTION_ATTRIBUTES_INPUT, - output_schema=_SCHEMA_GET_SUBSCRIPTION_ATTRIBUTES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.sns#AuthorizationErrorException" - ): AuthorizationErrorException, - ShapeID("com.amazonaws.sns#InternalErrorException"): InternalErrorException, - ShapeID( - "com.amazonaws.sns#InvalidParameterException" - ): InvalidParameterException, - ShapeID("com.amazonaws.sns#NotFoundException"): NotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_AUTHORIZATION_ERROR_EXCEPTION, - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetTopicAttributesInput: - """Input for GetTopicAttributes action.""" - - topic_arn: str | None = None - """The ARN of the topic whose properties you want to get.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_TOPIC_ATTRIBUTES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.topic_arn is not None: - serializer.write_string( - _SCHEMA_GET_TOPIC_ATTRIBUTES_INPUT.members["TopicArn"], self.topic_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["topic_arn"] = de.read_string( - _SCHEMA_GET_TOPIC_ATTRIBUTES_INPUT.members["TopicArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_TOPIC_ATTRIBUTES_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetTopicAttributesOutput: - """Response for GetTopicAttributes action.""" - - attributes: dict[str, str] | None = None - """ - A map of the topic's attributes. Attributes in this map include the - following: - - - `DeliveryPolicy` -- The JSON serialization of the topic's delivery - policy. - - - `DisplayName` -- The human-readable name used in the `From` field for - notifications to `email` and `email-json` endpoints. For subscription - confirmation and unsubscribe confirmation emails, the sender name is - always \"Amazon Web Services Notifications\" regardless of this - attribute. - - - `EffectiveDeliveryPolicy` -- The JSON serialization of the effective - delivery policy, taking system defaults into account. - - - `MaximumMessageSize` -- The maximum size, in bytes, of a message that - can be published to the topic. Amazon SNS returns this attribute only - if you explicitly set it. If Amazon SNS doesn't return it, the topic - uses the default of `262144` (256 KiB). - - - `Owner` -- The Amazon Web Services account ID of the topic's owner. - - - `Policy` -- The JSON serialization of the topic's access control - policy. - - - `SignatureVersion` -- The signature version corresponds to the hashing - algorithm used while creating the signature of the notifications, - subscription confirmations, or unsubscribe confirmation messages sent - by Amazon SNS. - - - By default, `SignatureVersion` is set to **1**. The signature is a - Base64-encoded **SHA1withRSA** signature. - - - When you set `SignatureVersion` to **2**. Amazon SNS uses a - Base64-encoded **SHA256withRSA** signature. - - Note: - If the API response does not include the `SignatureVersion` - attribute, it means that the `SignatureVersion` for the topic has - value **1**. - - - `SubscriptionsConfirmed` -- The number of confirmed subscriptions for - the topic. - - - `SubscriptionsDeleted` -- The number of deleted subscriptions for the - topic. - - - `SubscriptionsPending` -- The number of subscriptions pending - confirmation for the topic. - - - `TopicArn` -- The topic's ARN. - - - `TracingConfig` -- Tracing mode of an Amazon SNS topic. By default - `TracingConfig` is set to `PassThrough`, and the topic passes through - the tracing header it receives from an Amazon SNS publisher to its - subscriptions. If set to `Active`, Amazon SNS will vend X-Ray segment - data to topic owner account if the sampled flag in the tracing header - is true. This is only supported on standard topics. - - The following attribute applies only to - [server-side-encryption](https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html): - - - `KmsMasterKeyId` - The ID of an Amazon Web Services managed customer - master key (CMK) for Amazon SNS or a custom CMK. For more information, - see [Key - Terms](https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html#sse-key-terms). - For more examples, see - [KeyId](https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters) - in the *Key Management Service API Reference*. - - The following attributes apply only to [FIFO - topics](https://docs.aws.amazon.com/sns/latest/dg/sns-fifo-topics.html): - - - `ArchivePolicy` -- The policy that sets the retention period for - messages stored in the message archive of an Amazon SNS FIFO topic. - - - `BeginningArchiveTime` -- The earliest starting point at which a - message in the topic's archive can be replayed from. This point in - time is based on the configured message retention period set by the - topic's message archiving policy. - - - `ContentBasedDeduplication` -- Enables content-based deduplication for - FIFO topics. - - - By default, `ContentBasedDeduplication` is set to `false`. If you - create a FIFO topic and this attribute is `false`, you must specify - a value for the `MessageDeduplicationId` parameter for the - [Publish](https://docs.aws.amazon.com/sns/latest/api/API_Publish.html) - action. - - - When you set `ContentBasedDeduplication` to `true`, Amazon SNS uses - a SHA-256 hash to generate the `MessageDeduplicationId` using the - body of the message (but not the attributes of the message). - - (Optional) To override the generated value, you can specify a value - for the `MessageDeduplicationId` parameter for the `Publish` action. - - - `FifoTopic` -- When this is set to `true`, a FIFO topic is created. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_TOPIC_ATTRIBUTES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.attributes is not None: - _serialize_topic_attributes_map( - serializer, - _SCHEMA_GET_TOPIC_ATTRIBUTES_OUTPUT.members["Attributes"], - self.attributes, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["attributes"] = _deserialize_topic_attributes_map( - de, _SCHEMA_GET_TOPIC_ATTRIBUTES_OUTPUT.members["Attributes"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_TOPIC_ATTRIBUTES_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_TOPIC_ATTRIBUTES = APIOperation( - input=GetTopicAttributesInput, - output=GetTopicAttributesOutput, - schema=_SCHEMA_GET_TOPIC_ATTRIBUTES, - input_schema=_SCHEMA_GET_TOPIC_ATTRIBUTES_INPUT, - output_schema=_SCHEMA_GET_TOPIC_ATTRIBUTES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.sns#AuthorizationErrorException" - ): AuthorizationErrorException, - ShapeID("com.amazonaws.sns#InternalErrorException"): InternalErrorException, - ShapeID( - "com.amazonaws.sns#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.sns#InvalidSecurityException" - ): InvalidSecurityException, - ShapeID("com.amazonaws.sns#NotFoundException"): NotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_AUTHORIZATION_ERROR_EXCEPTION, - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_INVALID_SECURITY_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListEndpointsByPlatformApplicationInput: - """Input for `ListEndpointsByPlatformApplication` action.""" - - platform_application_arn: str | None = None - """ - `PlatformApplicationArn` for `ListEndpointsByPlatformApplicationInput` - action. - """ - - next_token: str | None = None - """ - `NextToken` string is used when calling - `ListEndpointsByPlatformApplication` action to retrieve additional - records that are available after the first page results. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_LIST_ENDPOINTS_BY_PLATFORM_APPLICATION_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.platform_application_arn is not None: - serializer.write_string( - _SCHEMA_LIST_ENDPOINTS_BY_PLATFORM_APPLICATION_INPUT.members[ - "PlatformApplicationArn" - ], - self.platform_application_arn, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_ENDPOINTS_BY_PLATFORM_APPLICATION_INPUT.members[ - "NextToken" - ], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["platform_application_arn"] = de.read_string( - _SCHEMA_LIST_ENDPOINTS_BY_PLATFORM_APPLICATION_INPUT.members[ - "PlatformApplicationArn" - ] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_ENDPOINTS_BY_PLATFORM_APPLICATION_INPUT.members[ - "NextToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_ENDPOINTS_BY_PLATFORM_APPLICATION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class Endpoint: - """The endpoint for mobile app and device.""" - - endpoint_arn: str | None = None - """The `EndpointArn` for mobile app and device.""" - - attributes: dict[str, str] | None = None - """Attributes for endpoint.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ENDPOINT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.endpoint_arn is not None: - serializer.write_string( - _SCHEMA_ENDPOINT.members["EndpointArn"], self.endpoint_arn - ) - - if self.attributes is not None: - _serialize_map_string_to_string( - serializer, _SCHEMA_ENDPOINT.members["Attributes"], self.attributes - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["endpoint_arn"] = de.read_string( - _SCHEMA_ENDPOINT.members["EndpointArn"] - ) - - case 1: - kwargs["attributes"] = _deserialize_map_string_to_string( - de, _SCHEMA_ENDPOINT.members["Attributes"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ENDPOINT, consumer=_consumer) - return kwargs - - -def _serialize_list_of_endpoints( - serializer: ShapeSerializer, schema: Schema, value: list[Endpoint] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_list_of_endpoints( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Endpoint]: - result: list[Endpoint] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Endpoint.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListEndpointsByPlatformApplicationOutput: - """Response for `ListEndpointsByPlatformApplication` action.""" - - endpoints: list[Endpoint] | None = None - """Endpoints returned for `ListEndpointsByPlatformApplication` action.""" - - next_token: str | None = None - """ - `NextToken` string is returned when calling - `ListEndpointsByPlatformApplication` action if additional records are - available after the first page results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_LIST_ENDPOINTS_BY_PLATFORM_APPLICATION_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.endpoints is not None: - _serialize_list_of_endpoints( - serializer, - _SCHEMA_LIST_ENDPOINTS_BY_PLATFORM_APPLICATION_OUTPUT.members[ - "Endpoints" - ], - self.endpoints, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_ENDPOINTS_BY_PLATFORM_APPLICATION_OUTPUT.members[ - "NextToken" - ], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["endpoints"] = _deserialize_list_of_endpoints( - de, - _SCHEMA_LIST_ENDPOINTS_BY_PLATFORM_APPLICATION_OUTPUT.members[ - "Endpoints" - ], - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_ENDPOINTS_BY_PLATFORM_APPLICATION_OUTPUT.members[ - "NextToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_ENDPOINTS_BY_PLATFORM_APPLICATION_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_ENDPOINTS_BY_PLATFORM_APPLICATION = APIOperation( - input=ListEndpointsByPlatformApplicationInput, - output=ListEndpointsByPlatformApplicationOutput, - schema=_SCHEMA_LIST_ENDPOINTS_BY_PLATFORM_APPLICATION, - input_schema=_SCHEMA_LIST_ENDPOINTS_BY_PLATFORM_APPLICATION_INPUT, - output_schema=_SCHEMA_LIST_ENDPOINTS_BY_PLATFORM_APPLICATION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.sns#AuthorizationErrorException" - ): AuthorizationErrorException, - ShapeID("com.amazonaws.sns#InternalErrorException"): InternalErrorException, - ShapeID( - "com.amazonaws.sns#InvalidParameterException" - ): InvalidParameterException, - ShapeID("com.amazonaws.sns#NotFoundException"): NotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_AUTHORIZATION_ERROR_EXCEPTION, - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListOriginationNumbersInput: - """Dataclass for ListOriginationNumbersInput structure.""" - - next_token: str | None = None - """Token that the previous `ListOriginationNumbers` request returns.""" - - max_results: int | None = None - """The maximum number of origination numbers to return.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_ORIGINATION_NUMBERS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_ORIGINATION_NUMBERS_INPUT.members["NextToken"], - self.next_token, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_ORIGINATION_NUMBERS_INPUT.members["MaxResults"], - self.max_results, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_ORIGINATION_NUMBERS_INPUT.members["NextToken"] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_ORIGINATION_NUMBERS_INPUT.members["MaxResults"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_ORIGINATION_NUMBERS_INPUT, consumer=_consumer - ) - return kwargs - - -class NumberCapability(UnknownEnumMixin, StrEnum): - """Enum listing out all supported number capabilities.""" - - SMS = "SMS" - MMS = "MMS" - VOICE = "VOICE" - - -def _serialize_number_capability_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_number_capability_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(NumberCapability(d.read_string(member_schema))) - - deserializer.read_list(schema, _read_value) - return result - - -class RouteType(UnknownEnumMixin, StrEnum): - """ - Enum listing out all supported route types. The following enum values - are supported. 1. Transactional : Non-marketing traffic 2. Promotional : - Marketing 3. Premium : Premium routes for OTP delivery to the carriers - """ - - TRANSACTIONAL = "Transactional" - PROMOTIONAL = "Promotional" - PREMIUM = "Premium" - - -@dataclass(kw_only=True) -class PhoneNumberInformation: - """A list of phone numbers and their metadata.""" - - created_at: datetime | None = None - """The date and time when the phone number was created.""" - - phone_number: str | None = field(repr=False, default=None) - """The phone number.""" - - status: str | None = None - """The status of the phone number.""" - - iso2_country_code: str | None = None - """ - The two-character code for the country or region, in ISO 3166-1 alpha-2 - format. - """ - - route_type: str | None = None - """The list of supported routes.""" - - number_capabilities: list[str] | None = None - """The capabilities of each phone number.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PHONE_NUMBER_INFORMATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.created_at is not None: - serializer.write_timestamp( - _SCHEMA_PHONE_NUMBER_INFORMATION.members["CreatedAt"], self.created_at - ) - - if self.phone_number is not None: - serializer.write_string( - _SCHEMA_PHONE_NUMBER_INFORMATION.members["PhoneNumber"], - self.phone_number, - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_PHONE_NUMBER_INFORMATION.members["Status"], self.status - ) - - if self.iso2_country_code is not None: - serializer.write_string( - _SCHEMA_PHONE_NUMBER_INFORMATION.members["Iso2CountryCode"], - self.iso2_country_code, - ) - - if self.route_type is not None: - serializer.write_string( - _SCHEMA_PHONE_NUMBER_INFORMATION.members["RouteType"], self.route_type - ) - - if self.number_capabilities is not None: - _serialize_number_capability_list( - serializer, - _SCHEMA_PHONE_NUMBER_INFORMATION.members["NumberCapabilities"], - self.number_capabilities, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["created_at"] = de.read_timestamp( - _SCHEMA_PHONE_NUMBER_INFORMATION.members["CreatedAt"] - ) - - case 1: - kwargs["phone_number"] = de.read_string( - _SCHEMA_PHONE_NUMBER_INFORMATION.members["PhoneNumber"] - ) - - case 2: - kwargs["status"] = de.read_string( - _SCHEMA_PHONE_NUMBER_INFORMATION.members["Status"] - ) - - case 3: - kwargs["iso2_country_code"] = de.read_string( - _SCHEMA_PHONE_NUMBER_INFORMATION.members["Iso2CountryCode"] - ) - - case 4: - kwargs["route_type"] = RouteType( - de.read_string( - _SCHEMA_PHONE_NUMBER_INFORMATION.members["RouteType"] - ) - ) - - case 5: - kwargs["number_capabilities"] = _deserialize_number_capability_list( - de, - _SCHEMA_PHONE_NUMBER_INFORMATION.members["NumberCapabilities"], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PHONE_NUMBER_INFORMATION, consumer=_consumer) - return kwargs - - -def _serialize_phone_number_information_list( - serializer: ShapeSerializer, schema: Schema, value: list[PhoneNumberInformation] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_phone_number_information_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[PhoneNumberInformation]: - result: list[PhoneNumberInformation] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(PhoneNumberInformation.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListOriginationNumbersOutput: - """Dataclass for ListOriginationNumbersOutput structure.""" - - next_token: str | None = None - """ - A `NextToken` string is returned when you call the - `ListOriginationNumbers` operation if additional pages of records are - available. - """ - - phone_numbers: list[PhoneNumberInformation] | None = None - """ - A list of the calling account's verified and pending origination - numbers. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_ORIGINATION_NUMBERS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_ORIGINATION_NUMBERS_OUTPUT.members["NextToken"], - self.next_token, - ) - - if self.phone_numbers is not None: - _serialize_phone_number_information_list( - serializer, - _SCHEMA_LIST_ORIGINATION_NUMBERS_OUTPUT.members["PhoneNumbers"], - self.phone_numbers, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_ORIGINATION_NUMBERS_OUTPUT.members["NextToken"] - ) - - case 1: - kwargs["phone_numbers"] = ( - _deserialize_phone_number_information_list( - de, - _SCHEMA_LIST_ORIGINATION_NUMBERS_OUTPUT.members[ - "PhoneNumbers" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_ORIGINATION_NUMBERS_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ValidationException(ServiceError): - """Indicates that a parameter in the request is invalid.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VALIDATION_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_VALIDATION_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_VALIDATION_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VALIDATION_EXCEPTION, consumer=_consumer) - return kwargs - - -LIST_ORIGINATION_NUMBERS = APIOperation( - input=ListOriginationNumbersInput, - output=ListOriginationNumbersOutput, - schema=_SCHEMA_LIST_ORIGINATION_NUMBERS, - input_schema=_SCHEMA_LIST_ORIGINATION_NUMBERS_INPUT, - output_schema=_SCHEMA_LIST_ORIGINATION_NUMBERS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.sns#AuthorizationErrorException" - ): AuthorizationErrorException, - ShapeID("com.amazonaws.sns#InternalErrorException"): InternalErrorException, - ShapeID( - "com.amazonaws.sns#InvalidParameterException" - ): InvalidParameterException, - ShapeID("com.amazonaws.sns#ThrottledException"): ThrottledException, - ShapeID("com.amazonaws.sns#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_AUTHORIZATION_ERROR_EXCEPTION, - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_THROTTLED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListPhoneNumbersOptedOutInput: - """The input for the `ListPhoneNumbersOptedOut` action.""" - - next_token: str | None = None - """ - A `NextToken` string is used when you call the - `ListPhoneNumbersOptedOut` action to retrieve additional records that - are available after the first page of results. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_PHONE_NUMBERS_OPTED_OUT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_PHONE_NUMBERS_OPTED_OUT_INPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_PHONE_NUMBERS_OPTED_OUT_INPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_PHONE_NUMBERS_OPTED_OUT_INPUT, consumer=_consumer - ) - return kwargs - - -def _serialize_phone_number_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_phone_number_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListPhoneNumbersOptedOutOutput: - """The response from the `ListPhoneNumbersOptedOut` action.""" - - phone_numbers: list[str] | None = None - """ - A list of phone numbers that are opted out of receiving SMS messages. - The list is paginated, and each page can contain up to 100 phone - numbers. - """ - - next_token: str | None = None - """ - A `NextToken` string is returned when you call the - `ListPhoneNumbersOptedOut` action if additional records are available - after the first page of results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_PHONE_NUMBERS_OPTED_OUT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.phone_numbers is not None: - _serialize_phone_number_list( - serializer, - _SCHEMA_LIST_PHONE_NUMBERS_OPTED_OUT_OUTPUT.members["phoneNumbers"], - self.phone_numbers, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_PHONE_NUMBERS_OPTED_OUT_OUTPUT.members["nextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["phone_numbers"] = _deserialize_phone_number_list( - de, - _SCHEMA_LIST_PHONE_NUMBERS_OPTED_OUT_OUTPUT.members[ - "phoneNumbers" - ], - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_PHONE_NUMBERS_OPTED_OUT_OUTPUT.members["nextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_PHONE_NUMBERS_OPTED_OUT_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_PHONE_NUMBERS_OPTED_OUT = APIOperation( - input=ListPhoneNumbersOptedOutInput, - output=ListPhoneNumbersOptedOutOutput, - schema=_SCHEMA_LIST_PHONE_NUMBERS_OPTED_OUT, - input_schema=_SCHEMA_LIST_PHONE_NUMBERS_OPTED_OUT_INPUT, - output_schema=_SCHEMA_LIST_PHONE_NUMBERS_OPTED_OUT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.sns#AuthorizationErrorException" - ): AuthorizationErrorException, - ShapeID("com.amazonaws.sns#InternalErrorException"): InternalErrorException, - ShapeID( - "com.amazonaws.sns#InvalidParameterException" - ): InvalidParameterException, - ShapeID("com.amazonaws.sns#ThrottledException"): ThrottledException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_AUTHORIZATION_ERROR_EXCEPTION, - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_THROTTLED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListPlatformApplicationsInput: - """Input for `ListPlatformApplications` action.""" - - next_token: str | None = None - """ - `NextToken` string is used when calling `ListPlatformApplications` - action to retrieve additional records that are available after the first - page results. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_PLATFORM_APPLICATIONS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_PLATFORM_APPLICATIONS_INPUT.members["NextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_PLATFORM_APPLICATIONS_INPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_PLATFORM_APPLICATIONS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class PlatformApplication: - """Platform application object.""" - - platform_application_arn: str | None = None - """PlatformApplicationArn for platform application object.""" - - attributes: dict[str, str] | None = None - """Attributes for platform application object.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PLATFORM_APPLICATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.platform_application_arn is not None: - serializer.write_string( - _SCHEMA_PLATFORM_APPLICATION.members["PlatformApplicationArn"], - self.platform_application_arn, - ) - - if self.attributes is not None: - _serialize_map_string_to_string( - serializer, - _SCHEMA_PLATFORM_APPLICATION.members["Attributes"], - self.attributes, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["platform_application_arn"] = de.read_string( - _SCHEMA_PLATFORM_APPLICATION.members["PlatformApplicationArn"] - ) - - case 1: - kwargs["attributes"] = _deserialize_map_string_to_string( - de, _SCHEMA_PLATFORM_APPLICATION.members["Attributes"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PLATFORM_APPLICATION, consumer=_consumer) - return kwargs - - -def _serialize_list_of_platform_applications( - serializer: ShapeSerializer, schema: Schema, value: list[PlatformApplication] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_list_of_platform_applications( - deserializer: ShapeDeserializer, schema: Schema -) -> list[PlatformApplication]: - result: list[PlatformApplication] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(PlatformApplication.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListPlatformApplicationsOutput: - """Response for `ListPlatformApplications` action.""" - - platform_applications: list[PlatformApplication] | None = None - """ - Platform applications returned when calling `ListPlatformApplications` - action. - """ - - next_token: str | None = None - """ - `NextToken` string is returned when calling `ListPlatformApplications` - action if additional records are available after the first page results. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_PLATFORM_APPLICATIONS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.platform_applications is not None: - _serialize_list_of_platform_applications( - serializer, - _SCHEMA_LIST_PLATFORM_APPLICATIONS_OUTPUT.members[ - "PlatformApplications" - ], - self.platform_applications, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_PLATFORM_APPLICATIONS_OUTPUT.members["NextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["platform_applications"] = ( - _deserialize_list_of_platform_applications( - de, - _SCHEMA_LIST_PLATFORM_APPLICATIONS_OUTPUT.members[ - "PlatformApplications" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_PLATFORM_APPLICATIONS_OUTPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_PLATFORM_APPLICATIONS_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_PLATFORM_APPLICATIONS = APIOperation( - input=ListPlatformApplicationsInput, - output=ListPlatformApplicationsOutput, - schema=_SCHEMA_LIST_PLATFORM_APPLICATIONS, - input_schema=_SCHEMA_LIST_PLATFORM_APPLICATIONS_INPUT, - output_schema=_SCHEMA_LIST_PLATFORM_APPLICATIONS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.sns#AuthorizationErrorException" - ): AuthorizationErrorException, - ShapeID("com.amazonaws.sns#InternalErrorException"): InternalErrorException, - ShapeID( - "com.amazonaws.sns#InvalidParameterException" - ): InvalidParameterException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_AUTHORIZATION_ERROR_EXCEPTION, - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListSMSSandboxPhoneNumbersInput: - """Dataclass for ListSMSSandboxPhoneNumbersInput structure.""" - - next_token: str | None = None - """ - Token that the previous `ListSMSSandboxPhoneNumbersInput` request - returns. - """ - - max_results: int | None = None - """The maximum number of phone numbers to return.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_SMS_SANDBOX_PHONE_NUMBERS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_SMS_SANDBOX_PHONE_NUMBERS_INPUT.members["NextToken"], - self.next_token, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_SMS_SANDBOX_PHONE_NUMBERS_INPUT.members["MaxResults"], - self.max_results, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_SMS_SANDBOX_PHONE_NUMBERS_INPUT.members[ - "NextToken" - ] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_SMS_SANDBOX_PHONE_NUMBERS_INPUT.members[ - "MaxResults" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_SMS_SANDBOX_PHONE_NUMBERS_INPUT, consumer=_consumer - ) - return kwargs - - -class SMSSandboxPhoneNumberVerificationStatus(UnknownEnumMixin, StrEnum): - """ - Enum listing out all supported destination phone number verification - statuses. The following enum values are supported. 1. PENDING : The - destination phone number is pending verification. 2. VERIFIED : The - destination phone number is verified. - """ - - PENDING = "Pending" - VERIFIED = "Verified" - - -@dataclass(kw_only=True) -class SMSSandboxPhoneNumber: - """ - A verified or pending destination phone number in the SMS sandbox. - - When you start using Amazon SNS to send SMS messages, your Amazon Web - Services account is in the *SMS sandbox*. The SMS sandbox provides a - safe environment for you to try Amazon SNS features without risking your - reputation as an SMS sender. While your Amazon Web Services account is - in the SMS sandbox, you can use all of the features of Amazon SNS. - However, you can send SMS messages only to verified destination phone - numbers. For more information, including how to move out of the sandbox - to send messages without restrictions, see [SMS - sandbox](https://docs.aws.amazon.com/sns/latest/dg/sns-sms-sandbox.html) - in the *Amazon SNS Developer Guide*. - """ - - phone_number: str | None = field(repr=False, default=None) - """The destination phone number.""" - - status: str | None = None - """The destination phone number's verification status.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SMS_SANDBOX_PHONE_NUMBER, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.phone_number is not None: - serializer.write_string( - _SCHEMA_SMS_SANDBOX_PHONE_NUMBER.members["PhoneNumber"], - self.phone_number, - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_SMS_SANDBOX_PHONE_NUMBER.members["Status"], self.status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["phone_number"] = de.read_string( - _SCHEMA_SMS_SANDBOX_PHONE_NUMBER.members["PhoneNumber"] - ) - - case 1: - kwargs["status"] = SMSSandboxPhoneNumberVerificationStatus( - de.read_string( - _SCHEMA_SMS_SANDBOX_PHONE_NUMBER.members["Status"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SMS_SANDBOX_PHONE_NUMBER, consumer=_consumer) - return kwargs - - -def _serialize_sms_sandbox_phone_number_list( - serializer: ShapeSerializer, schema: Schema, value: list[SMSSandboxPhoneNumber] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_sms_sandbox_phone_number_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[SMSSandboxPhoneNumber]: - result: list[SMSSandboxPhoneNumber] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(SMSSandboxPhoneNumber.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListSMSSandboxPhoneNumbersOutput: - """Dataclass for ListSMSSandboxPhoneNumbersOutput structure.""" - - phone_numbers: list[SMSSandboxPhoneNumber] - """A list of the calling account's pending and verified phone numbers.""" - - next_token: str | None = None - """ - A `NextToken` string is returned when you call the - `ListSMSSandboxPhoneNumbersInput` operation if additional pages of - records are available. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_SMS_SANDBOX_PHONE_NUMBERS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_sms_sandbox_phone_number_list( - serializer, - _SCHEMA_LIST_SMS_SANDBOX_PHONE_NUMBERS_OUTPUT.members["PhoneNumbers"], - self.phone_numbers, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_SMS_SANDBOX_PHONE_NUMBERS_OUTPUT.members["NextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["phone_numbers"] = ( - _deserialize_sms_sandbox_phone_number_list( - de, - _SCHEMA_LIST_SMS_SANDBOX_PHONE_NUMBERS_OUTPUT.members[ - "PhoneNumbers" - ], - ) - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_SMS_SANDBOX_PHONE_NUMBERS_OUTPUT.members[ - "NextToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_SMS_SANDBOX_PHONE_NUMBERS_OUTPUT, consumer=_consumer - ) - if "phone_numbers" not in kwargs: - kwargs["phone_numbers"] = [] - return kwargs - - -LIST_SMS_SANDBOX_PHONE_NUMBERS = APIOperation( - input=ListSMSSandboxPhoneNumbersInput, - output=ListSMSSandboxPhoneNumbersOutput, - schema=_SCHEMA_LIST_SMS_SANDBOX_PHONE_NUMBERS, - input_schema=_SCHEMA_LIST_SMS_SANDBOX_PHONE_NUMBERS_INPUT, - output_schema=_SCHEMA_LIST_SMS_SANDBOX_PHONE_NUMBERS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.sns#AuthorizationErrorException" - ): AuthorizationErrorException, - ShapeID("com.amazonaws.sns#InternalErrorException"): InternalErrorException, - ShapeID( - "com.amazonaws.sns#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.sns#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.sns#ThrottledException"): ThrottledException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_AUTHORIZATION_ERROR_EXCEPTION, - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListSubscriptionsInput: - """Input for ListSubscriptions action.""" - - next_token: str | None = None - """Token returned by the previous `ListSubscriptions` request.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_SUBSCRIPTIONS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_SUBSCRIPTIONS_INPUT.members["NextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_SUBSCRIPTIONS_INPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_SUBSCRIPTIONS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Subscription: - """A wrapper type for the attributes of an Amazon SNS subscription.""" - - subscription_arn: str | None = None - """The subscription's ARN.""" - - owner: str | None = None - """The subscription's owner.""" - - protocol: str | None = None - """The subscription's protocol.""" - - endpoint: str | None = None - """The subscription's endpoint (format depends on the protocol).""" - - topic_arn: str | None = None - """The ARN of the subscription's topic.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SUBSCRIPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.subscription_arn is not None: - serializer.write_string( - _SCHEMA_SUBSCRIPTION.members["SubscriptionArn"], self.subscription_arn - ) - - if self.owner is not None: - serializer.write_string(_SCHEMA_SUBSCRIPTION.members["Owner"], self.owner) - - if self.protocol is not None: - serializer.write_string( - _SCHEMA_SUBSCRIPTION.members["Protocol"], self.protocol - ) - - if self.endpoint is not None: - serializer.write_string( - _SCHEMA_SUBSCRIPTION.members["Endpoint"], self.endpoint - ) - - if self.topic_arn is not None: - serializer.write_string( - _SCHEMA_SUBSCRIPTION.members["TopicArn"], self.topic_arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["subscription_arn"] = de.read_string( - _SCHEMA_SUBSCRIPTION.members["SubscriptionArn"] - ) - - case 1: - kwargs["owner"] = de.read_string( - _SCHEMA_SUBSCRIPTION.members["Owner"] - ) - - case 2: - kwargs["protocol"] = de.read_string( - _SCHEMA_SUBSCRIPTION.members["Protocol"] - ) - - case 3: - kwargs["endpoint"] = de.read_string( - _SCHEMA_SUBSCRIPTION.members["Endpoint"] - ) - - case 4: - kwargs["topic_arn"] = de.read_string( - _SCHEMA_SUBSCRIPTION.members["TopicArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SUBSCRIPTION, consumer=_consumer) - return kwargs - - -def _serialize_subscriptions_list( - serializer: ShapeSerializer, schema: Schema, value: list[Subscription] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_subscriptions_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Subscription]: - result: list[Subscription] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Subscription.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListSubscriptionsOutput: - """Response for ListSubscriptions action""" - - subscriptions: list[Subscription] | None = None - """A list of subscriptions.""" - - next_token: str | None = None - """ - Token to pass along to the next `ListSubscriptions` request. This - element is returned if there are more subscriptions to retrieve. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_SUBSCRIPTIONS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.subscriptions is not None: - _serialize_subscriptions_list( - serializer, - _SCHEMA_LIST_SUBSCRIPTIONS_OUTPUT.members["Subscriptions"], - self.subscriptions, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_SUBSCRIPTIONS_OUTPUT.members["NextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["subscriptions"] = _deserialize_subscriptions_list( - de, _SCHEMA_LIST_SUBSCRIPTIONS_OUTPUT.members["Subscriptions"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_SUBSCRIPTIONS_OUTPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_SUBSCRIPTIONS_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_SUBSCRIPTIONS = APIOperation( - input=ListSubscriptionsInput, - output=ListSubscriptionsOutput, - schema=_SCHEMA_LIST_SUBSCRIPTIONS, - input_schema=_SCHEMA_LIST_SUBSCRIPTIONS_INPUT, - output_schema=_SCHEMA_LIST_SUBSCRIPTIONS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.sns#AuthorizationErrorException" - ): AuthorizationErrorException, - ShapeID("com.amazonaws.sns#InternalErrorException"): InternalErrorException, - ShapeID( - "com.amazonaws.sns#InvalidParameterException" - ): InvalidParameterException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_AUTHORIZATION_ERROR_EXCEPTION, - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListSubscriptionsByTopicInput: - """Input for ListSubscriptionsByTopic action.""" - - topic_arn: str | None = None - """The ARN of the topic for which you wish to find subscriptions.""" - - next_token: str | None = None - """Token returned by the previous `ListSubscriptionsByTopic` request.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_SUBSCRIPTIONS_BY_TOPIC_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.topic_arn is not None: - serializer.write_string( - _SCHEMA_LIST_SUBSCRIPTIONS_BY_TOPIC_INPUT.members["TopicArn"], - self.topic_arn, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_SUBSCRIPTIONS_BY_TOPIC_INPUT.members["NextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["topic_arn"] = de.read_string( - _SCHEMA_LIST_SUBSCRIPTIONS_BY_TOPIC_INPUT.members["TopicArn"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_SUBSCRIPTIONS_BY_TOPIC_INPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_SUBSCRIPTIONS_BY_TOPIC_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ListSubscriptionsByTopicOutput: - """Response for ListSubscriptionsByTopic action.""" - - subscriptions: list[Subscription] | None = None - """A list of subscriptions.""" - - next_token: str | None = None - """ - Token to pass along to the next `ListSubscriptionsByTopic` request. This - element is returned if there are more subscriptions to retrieve. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_SUBSCRIPTIONS_BY_TOPIC_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.subscriptions is not None: - _serialize_subscriptions_list( - serializer, - _SCHEMA_LIST_SUBSCRIPTIONS_BY_TOPIC_OUTPUT.members["Subscriptions"], - self.subscriptions, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_SUBSCRIPTIONS_BY_TOPIC_OUTPUT.members["NextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["subscriptions"] = _deserialize_subscriptions_list( - de, - _SCHEMA_LIST_SUBSCRIPTIONS_BY_TOPIC_OUTPUT.members[ - "Subscriptions" - ], - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_SUBSCRIPTIONS_BY_TOPIC_OUTPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_SUBSCRIPTIONS_BY_TOPIC_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_SUBSCRIPTIONS_BY_TOPIC = APIOperation( - input=ListSubscriptionsByTopicInput, - output=ListSubscriptionsByTopicOutput, - schema=_SCHEMA_LIST_SUBSCRIPTIONS_BY_TOPIC, - input_schema=_SCHEMA_LIST_SUBSCRIPTIONS_BY_TOPIC_INPUT, - output_schema=_SCHEMA_LIST_SUBSCRIPTIONS_BY_TOPIC_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.sns#AuthorizationErrorException" - ): AuthorizationErrorException, - ShapeID("com.amazonaws.sns#InternalErrorException"): InternalErrorException, - ShapeID( - "com.amazonaws.sns#InvalidParameterException" - ): InvalidParameterException, - ShapeID("com.amazonaws.sns#NotFoundException"): NotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_AUTHORIZATION_ERROR_EXCEPTION, - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListTagsForResourceInput: - """Dataclass for ListTagsForResourceInput structure.""" - - resource_arn: str | None = None - """The ARN of the topic for which to list tags.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT.members["ResourceArn"], - self.resource_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT.members["ResourceArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ListTagsForResourceOutput: - """Dataclass for ListTagsForResourceOutput structure.""" - - tags: list[Tag] | None = None - """The tags associated with the specified topic.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.tags is not None: - _serialize_tag_list( - serializer, - _SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT.members["Tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["tags"] = _deserialize_tag_list( - de, _SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT.members["Tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_TAGS_FOR_RESOURCE = APIOperation( - input=ListTagsForResourceInput, - output=ListTagsForResourceOutput, - schema=_SCHEMA_LIST_TAGS_FOR_RESOURCE, - input_schema=_SCHEMA_LIST_TAGS_FOR_RESOURCE_INPUT, - output_schema=_SCHEMA_LIST_TAGS_FOR_RESOURCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.sns#AuthorizationErrorException" - ): AuthorizationErrorException, - ShapeID( - "com.amazonaws.sns#ConcurrentAccessException" - ): ConcurrentAccessException, - ShapeID( - "com.amazonaws.sns#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.sns#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.sns#TagPolicyException"): TagPolicyException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_AUTHORIZATION_ERROR_EXCEPTION, - _SCHEMA_CONCURRENT_ACCESS_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_TAG_POLICY_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class ListTopicsInput: - """Dataclass for ListTopicsInput structure.""" - - next_token: str | None = None - """Token returned by the previous `ListTopics` request.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_TOPICS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_TOPICS_INPUT.members["NextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_TOPICS_INPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_TOPICS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Topic: - """ - A wrapper type for the topic's Amazon Resource Name (ARN). To retrieve - a topic's attributes, use `GetTopicAttributes`. - """ - - topic_arn: str | None = None - """The topic's ARN.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOPIC, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.topic_arn is not None: - serializer.write_string(_SCHEMA_TOPIC.members["TopicArn"], self.topic_arn) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["topic_arn"] = de.read_string( - _SCHEMA_TOPIC.members["TopicArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TOPIC, consumer=_consumer) - return kwargs - - -def _serialize_topics_list( - serializer: ShapeSerializer, schema: Schema, value: list[Topic] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_topics_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Topic]: - result: list[Topic] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Topic.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListTopicsOutput: - """Response for ListTopics action.""" - - topics: list[Topic] | None = None - """A list of topic ARNs.""" - - next_token: str | None = None - """ - Token to pass along to the next `ListTopics` request. This element is - returned if there are additional topics to retrieve. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_TOPICS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.topics is not None: - _serialize_topics_list( - serializer, _SCHEMA_LIST_TOPICS_OUTPUT.members["Topics"], self.topics - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_TOPICS_OUTPUT.members["NextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["topics"] = _deserialize_topics_list( - de, _SCHEMA_LIST_TOPICS_OUTPUT.members["Topics"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_TOPICS_OUTPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_TOPICS_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_TOPICS = APIOperation( - input=ListTopicsInput, - output=ListTopicsOutput, - schema=_SCHEMA_LIST_TOPICS, - input_schema=_SCHEMA_LIST_TOPICS_INPUT, - output_schema=_SCHEMA_LIST_TOPICS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.sns#AuthorizationErrorException" - ): AuthorizationErrorException, - ShapeID("com.amazonaws.sns#InternalErrorException"): InternalErrorException, - ShapeID( - "com.amazonaws.sns#InvalidParameterException" - ): InvalidParameterException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_AUTHORIZATION_ERROR_EXCEPTION, - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class OptInPhoneNumberInput: - """Input for the OptInPhoneNumber action.""" - - phone_number: str | None = field(repr=False, default=None) - """The phone number to opt in. Use E.164 format.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OPT_IN_PHONE_NUMBER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.phone_number is not None: - serializer.write_string( - _SCHEMA_OPT_IN_PHONE_NUMBER_INPUT.members["phoneNumber"], - self.phone_number, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["phone_number"] = de.read_string( - _SCHEMA_OPT_IN_PHONE_NUMBER_INPUT.members["phoneNumber"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_OPT_IN_PHONE_NUMBER_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class OptInPhoneNumberOutput: - """The response for the OptInPhoneNumber action.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OPT_IN_PHONE_NUMBER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_OPT_IN_PHONE_NUMBER_OUTPUT, consumer=_consumer) - return kwargs - - -OPT_IN_PHONE_NUMBER = APIOperation( - input=OptInPhoneNumberInput, - output=OptInPhoneNumberOutput, - schema=_SCHEMA_OPT_IN_PHONE_NUMBER, - input_schema=_SCHEMA_OPT_IN_PHONE_NUMBER_INPUT, - output_schema=_SCHEMA_OPT_IN_PHONE_NUMBER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.sns#AuthorizationErrorException" - ): AuthorizationErrorException, - ShapeID("com.amazonaws.sns#InternalErrorException"): InternalErrorException, - ShapeID( - "com.amazonaws.sns#InvalidParameterException" - ): InvalidParameterException, - ShapeID("com.amazonaws.sns#ThrottledException"): ThrottledException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_AUTHORIZATION_ERROR_EXCEPTION, - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_THROTTLED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class EndpointDisabledException(ServiceError): - """Exception error indicating endpoint disabled.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ENDPOINT_DISABLED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_ENDPOINT_DISABLED_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_ENDPOINT_DISABLED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ENDPOINT_DISABLED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InvalidParameterValueException(ServiceError): - """ - Indicates that a request parameter does not comply with the associated - constraints. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class KMSAccessDeniedException(ServiceError): - """ - The ciphertext references a key that doesn't exist or that you don't - have access to. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KMS_ACCESS_DENIED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_KMS_ACCESS_DENIED_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_KMS_ACCESS_DENIED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_KMS_ACCESS_DENIED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class KMSDisabledException(ServiceError): - """ - The request was rejected because the specified Amazon Web Services KMS - key isn't enabled. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KMS_DISABLED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_KMS_DISABLED_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_KMS_DISABLED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_KMS_DISABLED_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class KMSInvalidStateException(ServiceError): - """ - The request was rejected because the state of the specified resource - isn't valid for this request. For more information, see [Key states of - Amazon Web Services KMS - keys](https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) - in the *Key Management Service Developer Guide*. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KMS_INVALID_STATE_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_KMS_INVALID_STATE_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_KMS_INVALID_STATE_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_KMS_INVALID_STATE_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class KMSNotFoundException(ServiceError): - """ - The request was rejected because the specified entity or resource can't - be found. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KMS_NOT_FOUND_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_KMS_NOT_FOUND_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_KMS_NOT_FOUND_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_KMS_NOT_FOUND_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class KMSOptInRequired(ServiceError): - """ - The Amazon Web Services access key ID needs a subscription for the - service. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KMS_OPT_IN_REQUIRED, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_KMS_OPT_IN_REQUIRED.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_KMS_OPT_IN_REQUIRED.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_KMS_OPT_IN_REQUIRED, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class KMSThrottlingException(ServiceError): - """ - The request was denied due to request throttling. For more information - about throttling, see - [Limits](https://docs.aws.amazon.com/kms/latest/developerguide/limits.html#requests-per-second) - in the *Key Management Service Developer Guide.* - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KMS_THROTTLING_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_KMS_THROTTLING_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_KMS_THROTTLING_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_KMS_THROTTLING_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class PlatformApplicationDisabledException(ServiceError): - """Exception error indicating platform application disabled.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PLATFORM_APPLICATION_DISABLED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_PLATFORM_APPLICATION_DISABLED_EXCEPTION.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_PLATFORM_APPLICATION_DISABLED_EXCEPTION.members[ - "message" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PLATFORM_APPLICATION_DISABLED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class MessageAttributeValue: - """ - The user-specified message attribute value. For string data types, the - value attribute has the same restrictions on the content as the message - body. For more information, see - [Publish](https://docs.aws.amazon.com/sns/latest/api/API_Publish.html). - - Name, type, and value must not be empty or null. In addition, the - message body should not be empty or null. All parts of the message - attribute, including name, type, and value, are included in the message - size restriction, which is 256 KiB (262,144 bytes) by default and is - determined by the topic's `MaximumMessageSize` attribute. For more - information, see [Large message - payloads](https://docs.aws.amazon.com/sns/latest/dg/large-message-payloads.html), - [Amazon SNS message - attributes](https://docs.aws.amazon.com/sns/latest/dg/SNSMessageAttributes.html) - and [Publishing to a mobile - phone](https://docs.aws.amazon.com/sns/latest/dg/sms_publish-to-phone.html) - in the *Amazon SNS Developer Guide.* - """ - - data_type: str - """ - Amazon SNS supports the following logical data types: String, - String.Array, Number, and Binary. For more information, see [Message - Attribute Data - Types](https://docs.aws.amazon.com/sns/latest/dg/SNSMessageAttributes.html#SNSMessageAttributes.DataTypes). - """ - - string_value: str | None = None - """ - Strings are Unicode with UTF8 binary encoding. For a list of code - values, see [ASCII Printable - Characters](https://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters). - """ - - binary_value: bytes | None = None - """ - Binary type attributes can store any binary data, for example, - compressed data, encrypted data, or images. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MESSAGE_ATTRIBUTE_VALUE, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MESSAGE_ATTRIBUTE_VALUE.members["DataType"], self.data_type - ) - if self.string_value is not None: - serializer.write_string( - _SCHEMA_MESSAGE_ATTRIBUTE_VALUE.members["StringValue"], - self.string_value, - ) - - if self.binary_value is not None: - serializer.write_blob( - _SCHEMA_MESSAGE_ATTRIBUTE_VALUE.members["BinaryValue"], - self.binary_value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["data_type"] = de.read_string( - _SCHEMA_MESSAGE_ATTRIBUTE_VALUE.members["DataType"] - ) - - case 1: - kwargs["string_value"] = de.read_string( - _SCHEMA_MESSAGE_ATTRIBUTE_VALUE.members["StringValue"] - ) - - case 2: - kwargs["binary_value"] = de.read_blob( - _SCHEMA_MESSAGE_ATTRIBUTE_VALUE.members["BinaryValue"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MESSAGE_ATTRIBUTE_VALUE, consumer=_consumer) - if "data_type" not in kwargs: - kwargs["data_type"] = "" - return kwargs - - -def _serialize_message_attribute_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, MessageAttributeValue] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_struct(value_schema, v)) - - -def _deserialize_message_attribute_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, MessageAttributeValue]: - result: dict[str, MessageAttributeValue] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = MessageAttributeValue.deserialize(d) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class PublishInput: - """Input for Publish action.""" - - topic_arn: str | None = None - """ - The topic you want to publish to. - - If you don't specify a value for the `TopicArn` parameter, you must - specify a value for the `PhoneNumber` or `TargetArn` parameters. - """ - - target_arn: str | None = None - """ - If you don't specify a value for the `TargetArn` parameter, you must - specify a value for the `PhoneNumber` or `TopicArn` parameters. - """ - - phone_number: str | None = field(repr=False, default=None) - """ - The phone number to which you want to deliver an SMS message. Use E.164 - format. - - If you don't specify a value for the `PhoneNumber` parameter, you must - specify a value for the `TargetArn` or `TopicArn` parameters. - """ - - message: str | None = None - """ - The message you want to send. - - If you are publishing to a topic and you want to send the same message - to all transport protocols, include the text of the message as a String - value. If you want to send different messages for each transport - protocol, set the value of the `MessageStructure` parameter to `json` - and use a JSON object for the `Message` parameter. - - Constraints: - - - With the exception of SMS, messages must be UTF-8 encoded strings. By - default, a message can be at most 256 KiB in size (262,144 bytes, not - 262,144 characters). - - When you publish to a topic, the maximum size is determined by the - topic's `MaximumMessageSize` attribute, which supports values up to 1 - MiB (1,048,576 bytes). Amazon SNS validates the combined size of the - message body and message attributes against this value and returns an - `InvalidParameter` error if the limit is exceeded. - - For more information, see [Large message - payloads](https://docs.aws.amazon.com/sns/latest/dg/large-message-payloads.html) - in the *Amazon SNS Developer Guide.* - - - For SMS, each message can contain up to 140 characters. This character - limit depends on the encoding schema. For example, an SMS message can - contain 160 GSM characters, 140 ASCII characters, or 70 UCS-2 - characters. - - If you publish a message that exceeds this size limit, Amazon SNS - sends the message as multiple messages, each fitting within the size - limit. Messages aren't truncated mid-word but are cut off at - whole-word boundaries. - - The total size limit for a single SMS `Publish` action is 1,600 - characters. - - JSON-specific constraints: - - - Keys in the JSON object that correspond to supported transport - protocols must have simple JSON string values. - - - The values will be parsed (unescaped) before they are used in outgoing - messages. - - - Outbound notifications are JSON encoded (meaning that the characters - will be reescaped for sending). - - - Values have a minimum length of 0 (the empty string, \"\", is - allowed). - - - Values have a maximum length bounded by the overall message size (so, - including multiple protocols may limit message sizes). - - - Non-string values will cause the key to be ignored. - - - Keys that do not correspond to supported transport protocols are - ignored. - - - Duplicate keys are not allowed. - - - Failure to parse or validate any key or value in the message will - cause the `Publish` call to return an error (no partial delivery). - """ - - subject: str | None = None - """ - Optional parameter to be used as the \"Subject\" line when the message - is delivered to email endpoints. This field will also be included, if - present, in the standard JSON messages delivered to other endpoints. - - Constraints: Subjects must be UTF-8 text with no line breaks or control - characters, and less than 100 characters long. - """ - - message_structure: str | None = None - """ - Set `MessageStructure` to `json` if you want to send a different message - for each protocol. For example, using one publish action, you can send a - short message to your SMS subscribers and a longer message to your email - subscribers. If you set `MessageStructure` to `json`, the value of the - `Message` parameter must: - - - be a syntactically valid JSON object; and - - - contain at least a top-level JSON key of \"default\" with a value that - is a string. - - You can define other top-level keys that define the message you want to - send to a specific transport protocol (e.g., \"http\"). - - Valid value: `json` - """ - - message_attributes: dict[str, MessageAttributeValue] | None = None - """Message attributes for Publish action.""" - - message_deduplication_id: str | None = None - """ - - This parameter applies only to FIFO (first-in-first-out) topics. The - `MessageDeduplicationId` can contain up to 128 alphanumeric characters - `(a-z, A-Z, 0-9)` and punctuation - `` (!"#$%&'()*+,-./:;<=>?@[]^_`{|}~) ``. - - - Every message must have a unique `MessageDeduplicationId`, which is a - token used for deduplication of sent messages within the 5 minute - minimum deduplication interval. - - - The scope of deduplication depends on the `FifoThroughputScope` - attribute, when set to `Topic` the message deduplication scope is - across the entire topic, when set to `MessageGroup` the message - deduplication scope is within each individual message group. - - - If a message with a particular `MessageDeduplicationId` is sent - successfully, subsequent messages within the deduplication scope and - interval, with the same `MessageDeduplicationId`, are accepted - successfully but aren't delivered. - - - Every message must have a unique `MessageDeduplicationId`: - - - You may provide a `MessageDeduplicationId` explicitly. - - - If you aren't able to provide a `MessageDeduplicationId` and you - enable `ContentBasedDeduplication` for your topic, Amazon SNS uses a - SHA-256 hash to generate the `MessageDeduplicationId` using the body - of the message (but not the attributes of the message). - - - If you don't provide a `MessageDeduplicationId` and the topic - doesn't have `ContentBasedDeduplication` set, the action fails with - an error. - - - If the topic has a `ContentBasedDeduplication` set, your - `MessageDeduplicationId` overrides the generated one. - - - When `ContentBasedDeduplication` is in effect, messages with identical - content sent within the deduplication scope and interval are treated - as duplicates and only one copy of the message is delivered. - - - If you send one message with `ContentBasedDeduplication` enabled, and - then another message with a `MessageDeduplicationId` that is the same - as the one generated for the first `MessageDeduplicationId`, the two - messages are treated as duplicates, within the deduplication scope and - interval, and only one copy of the message is delivered. - """ - - message_group_id: str | None = None - """ - The `MessageGroupId` can contain up to 128 alphanumeric characters - `(a-z, A-Z, 0-9)` and punctuation - `` (!"#$%&'()*+,-./:;<=>?@[]^_`{|}~) ``. - - For FIFO topics: The `MessageGroupId` is a tag that specifies that a - message belongs to a specific message group. Messages that belong to the - same message group are processed in a FIFO manner (however, messages in - different message groups might be processed out of order). Every message - must include a `MessageGroupId`. - - For standard topics: The `MessageGroupId` is optional and is forwarded - only to Amazon SQS standard subscriptions to activate [fair - queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-fair-queues.html). - The `MessageGroupId` is not used for, or sent to, any other endpoint - types. When provided, the same validation rules apply as for FIFO - topics. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUBLISH_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.topic_arn is not None: - serializer.write_string( - _SCHEMA_PUBLISH_INPUT.members["TopicArn"], self.topic_arn - ) - - if self.target_arn is not None: - serializer.write_string( - _SCHEMA_PUBLISH_INPUT.members["TargetArn"], self.target_arn - ) - - if self.phone_number is not None: - serializer.write_string( - _SCHEMA_PUBLISH_INPUT.members["PhoneNumber"], self.phone_number - ) - - if self.message is not None: - serializer.write_string( - _SCHEMA_PUBLISH_INPUT.members["Message"], self.message - ) - - if self.subject is not None: - serializer.write_string( - _SCHEMA_PUBLISH_INPUT.members["Subject"], self.subject - ) - - if self.message_structure is not None: - serializer.write_string( - _SCHEMA_PUBLISH_INPUT.members["MessageStructure"], - self.message_structure, - ) - - if self.message_attributes is not None: - _serialize_message_attribute_map( - serializer, - _SCHEMA_PUBLISH_INPUT.members["MessageAttributes"], - self.message_attributes, - ) - - if self.message_deduplication_id is not None: - serializer.write_string( - _SCHEMA_PUBLISH_INPUT.members["MessageDeduplicationId"], - self.message_deduplication_id, - ) - - if self.message_group_id is not None: - serializer.write_string( - _SCHEMA_PUBLISH_INPUT.members["MessageGroupId"], self.message_group_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["topic_arn"] = de.read_string( - _SCHEMA_PUBLISH_INPUT.members["TopicArn"] - ) - - case 1: - kwargs["target_arn"] = de.read_string( - _SCHEMA_PUBLISH_INPUT.members["TargetArn"] - ) - - case 2: - kwargs["phone_number"] = de.read_string( - _SCHEMA_PUBLISH_INPUT.members["PhoneNumber"] - ) - - case 3: - kwargs["message"] = de.read_string( - _SCHEMA_PUBLISH_INPUT.members["Message"] - ) - - case 4: - kwargs["subject"] = de.read_string( - _SCHEMA_PUBLISH_INPUT.members["Subject"] - ) - - case 5: - kwargs["message_structure"] = de.read_string( - _SCHEMA_PUBLISH_INPUT.members["MessageStructure"] - ) - - case 6: - kwargs["message_attributes"] = _deserialize_message_attribute_map( - de, _SCHEMA_PUBLISH_INPUT.members["MessageAttributes"] - ) - - case 7: - kwargs["message_deduplication_id"] = de.read_string( - _SCHEMA_PUBLISH_INPUT.members["MessageDeduplicationId"] - ) - - case 8: - kwargs["message_group_id"] = de.read_string( - _SCHEMA_PUBLISH_INPUT.members["MessageGroupId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUBLISH_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class PublishOutput: - """Response for Publish action.""" - - message_id: str | None = None - """ - Unique identifier assigned to the published message. - - Length Constraint: Maximum 100 characters - """ - - sequence_number: str | None = None - """ - This response element applies only to FIFO (first-in-first-out) topics. - - The sequence number is a large, non-consecutive number that Amazon SNS - assigns to each message. The length of `SequenceNumber` is 128 bits. - `SequenceNumber` continues to increase for each `MessageGroupId`. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUBLISH_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message_id is not None: - serializer.write_string( - _SCHEMA_PUBLISH_OUTPUT.members["MessageId"], self.message_id - ) - - if self.sequence_number is not None: - serializer.write_string( - _SCHEMA_PUBLISH_OUTPUT.members["SequenceNumber"], self.sequence_number - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message_id"] = de.read_string( - _SCHEMA_PUBLISH_OUTPUT.members["MessageId"] - ) - - case 1: - kwargs["sequence_number"] = de.read_string( - _SCHEMA_PUBLISH_OUTPUT.members["SequenceNumber"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUBLISH_OUTPUT, consumer=_consumer) - return kwargs - - -PUBLISH = APIOperation( - input=PublishInput, - output=PublishOutput, - schema=_SCHEMA_PUBLISH, - input_schema=_SCHEMA_PUBLISH_INPUT, - output_schema=_SCHEMA_PUBLISH_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.sns#AuthorizationErrorException" - ): AuthorizationErrorException, - ShapeID( - "com.amazonaws.sns#EndpointDisabledException" - ): EndpointDisabledException, - ShapeID("com.amazonaws.sns#InternalErrorException"): InternalErrorException, - ShapeID( - "com.amazonaws.sns#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.sns#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.sns#InvalidSecurityException" - ): InvalidSecurityException, - ShapeID( - "com.amazonaws.sns#KMSAccessDeniedException" - ): KMSAccessDeniedException, - ShapeID("com.amazonaws.sns#KMSDisabledException"): KMSDisabledException, - ShapeID( - "com.amazonaws.sns#KMSInvalidStateException" - ): KMSInvalidStateException, - ShapeID("com.amazonaws.sns#KMSNotFoundException"): KMSNotFoundException, - ShapeID("com.amazonaws.sns#KMSOptInRequired"): KMSOptInRequired, - ShapeID("com.amazonaws.sns#KMSThrottlingException"): KMSThrottlingException, - ShapeID("com.amazonaws.sns#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.sns#PlatformApplicationDisabledException" - ): PlatformApplicationDisabledException, - ShapeID("com.amazonaws.sns#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_AUTHORIZATION_ERROR_EXCEPTION, - _SCHEMA_ENDPOINT_DISABLED_EXCEPTION, - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_INVALID_SECURITY_EXCEPTION, - _SCHEMA_KMS_ACCESS_DENIED_EXCEPTION, - _SCHEMA_KMS_DISABLED_EXCEPTION, - _SCHEMA_KMS_INVALID_STATE_EXCEPTION, - _SCHEMA_KMS_NOT_FOUND_EXCEPTION, - _SCHEMA_KMS_OPT_IN_REQUIRED, - _SCHEMA_KMS_THROTTLING_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_PLATFORM_APPLICATION_DISABLED_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class BatchEntryIdsNotDistinctException(ServiceError): - """Two or more batch entries in the request have the same `Id`.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BATCH_ENTRY_IDS_NOT_DISTINCT_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_BATCH_ENTRY_IDS_NOT_DISTINCT_EXCEPTION.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_BATCH_ENTRY_IDS_NOT_DISTINCT_EXCEPTION.members[ - "message" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_BATCH_ENTRY_IDS_NOT_DISTINCT_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class BatchRequestTooLongException(ServiceError): - """ - The length of all the batch messages put together is more than the - limit. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BATCH_REQUEST_TOO_LONG_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_BATCH_REQUEST_TOO_LONG_EXCEPTION.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_BATCH_REQUEST_TOO_LONG_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_BATCH_REQUEST_TOO_LONG_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class EmptyBatchRequestException(ServiceError): - """The batch request doesn't contain any entries.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EMPTY_BATCH_REQUEST_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_EMPTY_BATCH_REQUEST_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_EMPTY_BATCH_REQUEST_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EMPTY_BATCH_REQUEST_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InvalidBatchEntryIdException(ServiceError): - """ - The `Id` of a batch entry in a batch request doesn't abide by the - specification. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_BATCH_ENTRY_ID_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_BATCH_ENTRY_ID_EXCEPTION.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_BATCH_ENTRY_ID_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVALID_BATCH_ENTRY_ID_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class PublishBatchRequestEntry: - """ - Contains the details of a single Amazon SNS message along with an `Id` - that identifies a message within the batch. - """ - - id: str - """ - An identifier for the message in this batch. - - Note: - The `Ids` of a batch request must be unique within a request. - - This identifier can have up to 80 characters. The following characters - are accepted: alphanumeric characters, hyphens(-), and underscores (_). - """ - - message: str - """The body of the message.""" - - subject: str | None = None - """The subject of the batch message.""" - - message_structure: str | None = None - """ - Set `MessageStructure` to `json` if you want to send a different message - for each protocol. For example, using one publish action, you can send a - short message to your SMS subscribers and a longer message to your email - subscribers. If you set `MessageStructure` to `json`, the value of the - `Message` parameter must: - - - be a syntactically valid JSON object; and - - - contain at least a top-level JSON key of \"default\" with a value that - is a string. - - You can define other top-level keys that define the message you want to - send to a specific transport protocol (for example, http). - """ - - message_attributes: dict[str, MessageAttributeValue] | None = None - """ - Each message attribute consists of a `Name`, `Type`, and `Value`. For - more information, see [Amazon SNS message - attributes](https://docs.aws.amazon.com/sns/latest/dg/sns-message-attributes.html) - in the Amazon SNS Developer Guide. - """ - - message_deduplication_id: str | None = None - """ - This parameter applies only to FIFO (first-in-first-out) topics. - - - This parameter applies only to FIFO (first-in-first-out) topics. The - `MessageDeduplicationId` can contain up to 128 alphanumeric characters - `(a-z, A-Z, 0-9)` and punctuation - `` (!"#$%&'()*+,-./:;<=>?@[]^_`{|}~) ``. - - - Every message must have a unique `MessageDeduplicationId`, which is a - token used for deduplication of sent messages within the 5 minute - minimum deduplication interval. - - - The scope of deduplication depends on the `FifoThroughputScope` - attribute, when set to `Topic` the message deduplication scope is - across the entire topic, when set to `MessageGroup` the message - deduplication scope is within each individual message group. - - - If a message with a particular `MessageDeduplicationId` is sent - successfully, subsequent messages within the deduplication scope and - interval, with the same `MessageDeduplicationId`, are accepted - successfully but aren't delivered. - - - Every message must have a unique `MessageDeduplicationId`. - - - You may provide a `MessageDeduplicationId` explicitly. - - - If you aren't able to provide a `MessageDeduplicationId` and you - enable `ContentBasedDeduplication` for your topic, Amazon SNS uses a - SHA-256 hash to generate the `MessageDeduplicationId` using the body - of the message (but not the attributes of the message). - - - If you don't provide a `MessageDeduplicationId` and the topic - doesn't have `ContentBasedDeduplication` set, the action fails with - an error. - - - If the topic has a `ContentBasedDeduplication` set, your - `MessageDeduplicationId` overrides the generated one. - - - When `ContentBasedDeduplication` is in effect, messages with identical - content sent within the deduplication scope and interval are treated - as duplicates and only one copy of the message is delivered. - - - If you send one message with `ContentBasedDeduplication` enabled, and - then another message with a `MessageDeduplicationId` that is the same - as the one generated for the first `MessageDeduplicationId`, the two - messages are treated as duplicates, within the deduplication scope and - interval, and only one copy of the message is delivered. - - Note: - The `MessageDeduplicationId` is available to the consumer of the message - (this can be useful for troubleshooting delivery issues). - - If a message is sent successfully but the acknowledgement is lost and - the message is resent with the same `MessageDeduplicationId` after the - deduplication interval, Amazon SNS can't detect duplicate messages. - - Amazon SNS continues to keep track of the message deduplication ID even - after the message is received and deleted. - """ - - message_group_id: str | None = None - """ - FIFO topics: The tag that specifies that a message belongs to a specific - message group. Messages that belong to the same message group are - processed in a FIFO manner (however, messages in different message - groups might be processed out of order). To interleave multiple ordered - streams within a single topic, use `MessageGroupId` values (for example, - session data for multiple users). In this scenario, multiple consumers - can process the topic, but the session data of each user is processed in - a FIFO fashion. You must associate a non-empty `MessageGroupId` with a - message. If you do not provide a `MessageGroupId`, the action fails. - - Standard topics: The `MessageGroupId` is optional and is forwarded only - to Amazon SQS standard subscriptions to activate [fair - queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-fair-queues.html). - The `MessageGroupId` is not used for, or sent to, any other endpoint - types. - - The length of `MessageGroupId` is 128 characters. - - `MessageGroupId` can contain alphanumeric characters `(a-z, A-Z, 0-9)` - and punctuation `` (!"#$%&'()*+,-./:;<=>?@[]^_`{|}~) ``. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUBLISH_BATCH_REQUEST_ENTRY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_PUBLISH_BATCH_REQUEST_ENTRY.members["Id"], self.id - ) - serializer.write_string( - _SCHEMA_PUBLISH_BATCH_REQUEST_ENTRY.members["Message"], self.message - ) - if self.subject is not None: - serializer.write_string( - _SCHEMA_PUBLISH_BATCH_REQUEST_ENTRY.members["Subject"], self.subject - ) - - if self.message_structure is not None: - serializer.write_string( - _SCHEMA_PUBLISH_BATCH_REQUEST_ENTRY.members["MessageStructure"], - self.message_structure, - ) - - if self.message_attributes is not None: - _serialize_message_attribute_map( - serializer, - _SCHEMA_PUBLISH_BATCH_REQUEST_ENTRY.members["MessageAttributes"], - self.message_attributes, - ) - - if self.message_deduplication_id is not None: - serializer.write_string( - _SCHEMA_PUBLISH_BATCH_REQUEST_ENTRY.members["MessageDeduplicationId"], - self.message_deduplication_id, - ) - - if self.message_group_id is not None: - serializer.write_string( - _SCHEMA_PUBLISH_BATCH_REQUEST_ENTRY.members["MessageGroupId"], - self.message_group_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_PUBLISH_BATCH_REQUEST_ENTRY.members["Id"] - ) - - case 1: - kwargs["message"] = de.read_string( - _SCHEMA_PUBLISH_BATCH_REQUEST_ENTRY.members["Message"] - ) - - case 2: - kwargs["subject"] = de.read_string( - _SCHEMA_PUBLISH_BATCH_REQUEST_ENTRY.members["Subject"] - ) - - case 3: - kwargs["message_structure"] = de.read_string( - _SCHEMA_PUBLISH_BATCH_REQUEST_ENTRY.members["MessageStructure"] - ) - - case 4: - kwargs["message_attributes"] = _deserialize_message_attribute_map( - de, - _SCHEMA_PUBLISH_BATCH_REQUEST_ENTRY.members[ - "MessageAttributes" - ], - ) - - case 5: - kwargs["message_deduplication_id"] = de.read_string( - _SCHEMA_PUBLISH_BATCH_REQUEST_ENTRY.members[ - "MessageDeduplicationId" - ] - ) - - case 6: - kwargs["message_group_id"] = de.read_string( - _SCHEMA_PUBLISH_BATCH_REQUEST_ENTRY.members["MessageGroupId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PUBLISH_BATCH_REQUEST_ENTRY, consumer=_consumer - ) - if "id" not in kwargs: - kwargs["id"] = "" - if "message" not in kwargs: - kwargs["message"] = "" - return kwargs - - -def _serialize_publish_batch_request_entry_list( - serializer: ShapeSerializer, schema: Schema, value: list[PublishBatchRequestEntry] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_publish_batch_request_entry_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[PublishBatchRequestEntry]: - result: list[PublishBatchRequestEntry] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(PublishBatchRequestEntry.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class PublishBatchInput: - """Dataclass for PublishBatchInput structure.""" - - topic_arn: str | None = None - """ - The Amazon resource name (ARN) of the topic you want to batch publish - to. - """ - - publish_batch_request_entries: list[PublishBatchRequestEntry] | None = None - """A list of `PublishBatch` request entries to be sent to the SNS topic.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUBLISH_BATCH_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.topic_arn is not None: - serializer.write_string( - _SCHEMA_PUBLISH_BATCH_INPUT.members["TopicArn"], self.topic_arn - ) - - if self.publish_batch_request_entries is not None: - _serialize_publish_batch_request_entry_list( - serializer, - _SCHEMA_PUBLISH_BATCH_INPUT.members["PublishBatchRequestEntries"], - self.publish_batch_request_entries, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["topic_arn"] = de.read_string( - _SCHEMA_PUBLISH_BATCH_INPUT.members["TopicArn"] - ) - - case 1: - kwargs["publish_batch_request_entries"] = ( - _deserialize_publish_batch_request_entry_list( - de, - _SCHEMA_PUBLISH_BATCH_INPUT.members[ - "PublishBatchRequestEntries" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUBLISH_BATCH_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class BatchResultErrorEntry: - """Gives a detailed description of failed messages in the batch.""" - - id: str - """The `Id` of an entry in a batch request""" - - code: str - """An error code representing why the action failed on this entry.""" - - message: str | None = None - """A message explaining why the action failed on this entry.""" - - sender_fault: bool = False - """ - Specifies whether the error happened due to the caller of the batch API - action. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BATCH_RESULT_ERROR_ENTRY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_BATCH_RESULT_ERROR_ENTRY.members["Id"], self.id) - serializer.write_string( - _SCHEMA_BATCH_RESULT_ERROR_ENTRY.members["Code"], self.code - ) - if self.message is not None: - serializer.write_string( - _SCHEMA_BATCH_RESULT_ERROR_ENTRY.members["Message"], self.message - ) - - serializer.write_boolean( - _SCHEMA_BATCH_RESULT_ERROR_ENTRY.members["SenderFault"], self.sender_fault - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_BATCH_RESULT_ERROR_ENTRY.members["Id"] - ) - - case 1: - kwargs["code"] = de.read_string( - _SCHEMA_BATCH_RESULT_ERROR_ENTRY.members["Code"] - ) - - case 2: - kwargs["message"] = de.read_string( - _SCHEMA_BATCH_RESULT_ERROR_ENTRY.members["Message"] - ) - - case 3: - kwargs["sender_fault"] = de.read_boolean( - _SCHEMA_BATCH_RESULT_ERROR_ENTRY.members["SenderFault"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BATCH_RESULT_ERROR_ENTRY, consumer=_consumer) - if "id" not in kwargs: - kwargs["id"] = "" - if "code" not in kwargs: - kwargs["code"] = "" - return kwargs - - -def _serialize_batch_result_error_entry_list( - serializer: ShapeSerializer, schema: Schema, value: list[BatchResultErrorEntry] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_batch_result_error_entry_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[BatchResultErrorEntry]: - result: list[BatchResultErrorEntry] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(BatchResultErrorEntry.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class PublishBatchResultEntry: - """ - Encloses data related to a successful message in a batch request for - topic. - """ - - id: str | None = None - """The `Id` of an entry in a batch request.""" - - message_id: str | None = None - """An identifier for the message.""" - - sequence_number: str | None = None - """ - This parameter applies only to FIFO (first-in-first-out) topics. - - The large, non-consecutive number that Amazon SNS assigns to each - message. - - The length of `SequenceNumber` is 128 bits. `SequenceNumber` continues - to increase for a particular `MessageGroupId`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUBLISH_BATCH_RESULT_ENTRY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.id is not None: - serializer.write_string( - _SCHEMA_PUBLISH_BATCH_RESULT_ENTRY.members["Id"], self.id - ) - - if self.message_id is not None: - serializer.write_string( - _SCHEMA_PUBLISH_BATCH_RESULT_ENTRY.members["MessageId"], self.message_id - ) - - if self.sequence_number is not None: - serializer.write_string( - _SCHEMA_PUBLISH_BATCH_RESULT_ENTRY.members["SequenceNumber"], - self.sequence_number, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_PUBLISH_BATCH_RESULT_ENTRY.members["Id"] - ) - - case 1: - kwargs["message_id"] = de.read_string( - _SCHEMA_PUBLISH_BATCH_RESULT_ENTRY.members["MessageId"] - ) - - case 2: - kwargs["sequence_number"] = de.read_string( - _SCHEMA_PUBLISH_BATCH_RESULT_ENTRY.members["SequenceNumber"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUBLISH_BATCH_RESULT_ENTRY, consumer=_consumer) - return kwargs - - -def _serialize_publish_batch_result_entry_list( - serializer: ShapeSerializer, schema: Schema, value: list[PublishBatchResultEntry] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_publish_batch_result_entry_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[PublishBatchResultEntry]: - result: list[PublishBatchResultEntry] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(PublishBatchResultEntry.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class PublishBatchOutput: - """Dataclass for PublishBatchOutput structure.""" - - successful: list[PublishBatchResultEntry] | None = None - """A list of successful `PublishBatch` responses.""" - - failed: list[BatchResultErrorEntry] | None = None - """A list of failed `PublishBatch` responses.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUBLISH_BATCH_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.successful is not None: - _serialize_publish_batch_result_entry_list( - serializer, - _SCHEMA_PUBLISH_BATCH_OUTPUT.members["Successful"], - self.successful, - ) - - if self.failed is not None: - _serialize_batch_result_error_entry_list( - serializer, _SCHEMA_PUBLISH_BATCH_OUTPUT.members["Failed"], self.failed - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["successful"] = _deserialize_publish_batch_result_entry_list( - de, _SCHEMA_PUBLISH_BATCH_OUTPUT.members["Successful"] - ) - - case 1: - kwargs["failed"] = _deserialize_batch_result_error_entry_list( - de, _SCHEMA_PUBLISH_BATCH_OUTPUT.members["Failed"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PUBLISH_BATCH_OUTPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class TooManyEntriesInBatchRequestException(ServiceError): - """The batch request contains more entries than permissible (more than 10).""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_TOO_MANY_ENTRIES_IN_BATCH_REQUEST_EXCEPTION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_TOO_MANY_ENTRIES_IN_BATCH_REQUEST_EXCEPTION.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_TOO_MANY_ENTRIES_IN_BATCH_REQUEST_EXCEPTION.members[ - "message" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_TOO_MANY_ENTRIES_IN_BATCH_REQUEST_EXCEPTION, consumer=_consumer - ) - return kwargs - - -PUBLISH_BATCH = APIOperation( - input=PublishBatchInput, - output=PublishBatchOutput, - schema=_SCHEMA_PUBLISH_BATCH, - input_schema=_SCHEMA_PUBLISH_BATCH_INPUT, - output_schema=_SCHEMA_PUBLISH_BATCH_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.sns#AuthorizationErrorException" - ): AuthorizationErrorException, - ShapeID( - "com.amazonaws.sns#BatchEntryIdsNotDistinctException" - ): BatchEntryIdsNotDistinctException, - ShapeID( - "com.amazonaws.sns#BatchRequestTooLongException" - ): BatchRequestTooLongException, - ShapeID( - "com.amazonaws.sns#EmptyBatchRequestException" - ): EmptyBatchRequestException, - ShapeID( - "com.amazonaws.sns#EndpointDisabledException" - ): EndpointDisabledException, - ShapeID("com.amazonaws.sns#InternalErrorException"): InternalErrorException, - ShapeID( - "com.amazonaws.sns#InvalidBatchEntryIdException" - ): InvalidBatchEntryIdException, - ShapeID( - "com.amazonaws.sns#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.sns#InvalidParameterValueException" - ): InvalidParameterValueException, - ShapeID( - "com.amazonaws.sns#InvalidSecurityException" - ): InvalidSecurityException, - ShapeID( - "com.amazonaws.sns#KMSAccessDeniedException" - ): KMSAccessDeniedException, - ShapeID("com.amazonaws.sns#KMSDisabledException"): KMSDisabledException, - ShapeID( - "com.amazonaws.sns#KMSInvalidStateException" - ): KMSInvalidStateException, - ShapeID("com.amazonaws.sns#KMSNotFoundException"): KMSNotFoundException, - ShapeID("com.amazonaws.sns#KMSOptInRequired"): KMSOptInRequired, - ShapeID("com.amazonaws.sns#KMSThrottlingException"): KMSThrottlingException, - ShapeID("com.amazonaws.sns#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.sns#PlatformApplicationDisabledException" - ): PlatformApplicationDisabledException, - ShapeID( - "com.amazonaws.sns#TooManyEntriesInBatchRequestException" - ): TooManyEntriesInBatchRequestException, - ShapeID("com.amazonaws.sns#ValidationException"): ValidationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_AUTHORIZATION_ERROR_EXCEPTION, - _SCHEMA_BATCH_ENTRY_IDS_NOT_DISTINCT_EXCEPTION, - _SCHEMA_BATCH_REQUEST_TOO_LONG_EXCEPTION, - _SCHEMA_EMPTY_BATCH_REQUEST_EXCEPTION, - _SCHEMA_ENDPOINT_DISABLED_EXCEPTION, - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_BATCH_ENTRY_ID_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_VALUE_EXCEPTION, - _SCHEMA_INVALID_SECURITY_EXCEPTION, - _SCHEMA_KMS_ACCESS_DENIED_EXCEPTION, - _SCHEMA_KMS_DISABLED_EXCEPTION, - _SCHEMA_KMS_INVALID_STATE_EXCEPTION, - _SCHEMA_KMS_NOT_FOUND_EXCEPTION, - _SCHEMA_KMS_OPT_IN_REQUIRED, - _SCHEMA_KMS_THROTTLING_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_PLATFORM_APPLICATION_DISABLED_EXCEPTION, - _SCHEMA_TOO_MANY_ENTRIES_IN_BATCH_REQUEST_EXCEPTION, - _SCHEMA_VALIDATION_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class PutDataProtectionPolicyInput: - """Dataclass for PutDataProtectionPolicyInput structure.""" - - resource_arn: str | None = None - """ - The ARN of the topic whose `DataProtectionPolicy` you want to add or - update. - - For more information about ARNs, see [Amazon Resource Names - (ARNs)](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - in the Amazon Web Services General Reference. - """ - - data_protection_policy: str | None = None - """ - The JSON serialization of the topic's `DataProtectionPolicy`. - - The `DataProtectionPolicy` must be in JSON string format. - - Length Constraints: Maximum length of 30,720. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_DATA_PROTECTION_POLICY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_PUT_DATA_PROTECTION_POLICY_INPUT.members["ResourceArn"], - self.resource_arn, - ) - - if self.data_protection_policy is not None: - serializer.write_string( - _SCHEMA_PUT_DATA_PROTECTION_POLICY_INPUT.members[ - "DataProtectionPolicy" - ], - self.data_protection_policy, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_PUT_DATA_PROTECTION_POLICY_INPUT.members["ResourceArn"] - ) - - case 1: - kwargs["data_protection_policy"] = de.read_string( - _SCHEMA_PUT_DATA_PROTECTION_POLICY_INPUT.members[ - "DataProtectionPolicy" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PUT_DATA_PROTECTION_POLICY_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class PutDataProtectionPolicyOutput: - """Dataclass for PutDataProtectionPolicyOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PUT_DATA_PROTECTION_POLICY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PUT_DATA_PROTECTION_POLICY_OUTPUT, consumer=_consumer - ) - return kwargs - - -PUT_DATA_PROTECTION_POLICY = APIOperation( - input=PutDataProtectionPolicyInput, - output=PutDataProtectionPolicyOutput, - schema=_SCHEMA_PUT_DATA_PROTECTION_POLICY, - input_schema=_SCHEMA_PUT_DATA_PROTECTION_POLICY_INPUT, - output_schema=_SCHEMA_PUT_DATA_PROTECTION_POLICY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.sns#AuthorizationErrorException" - ): AuthorizationErrorException, - ShapeID("com.amazonaws.sns#InternalErrorException"): InternalErrorException, - ShapeID( - "com.amazonaws.sns#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.sns#InvalidSecurityException" - ): InvalidSecurityException, - ShapeID("com.amazonaws.sns#NotFoundException"): NotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_AUTHORIZATION_ERROR_EXCEPTION, - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_INVALID_SECURITY_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class RemovePermissionInput: - """Input for RemovePermission action.""" - - topic_arn: str | None = None - """The ARN of the topic whose access control policy you wish to modify.""" - - label: str | None = None - """The unique label of the statement you want to remove.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REMOVE_PERMISSION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.topic_arn is not None: - serializer.write_string( - _SCHEMA_REMOVE_PERMISSION_INPUT.members["TopicArn"], self.topic_arn - ) - - if self.label is not None: - serializer.write_string( - _SCHEMA_REMOVE_PERMISSION_INPUT.members["Label"], self.label - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["topic_arn"] = de.read_string( - _SCHEMA_REMOVE_PERMISSION_INPUT.members["TopicArn"] - ) - - case 1: - kwargs["label"] = de.read_string( - _SCHEMA_REMOVE_PERMISSION_INPUT.members["Label"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_REMOVE_PERMISSION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class RemovePermissionOutput: - """Dataclass for RemovePermissionOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REMOVE_PERMISSION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_REMOVE_PERMISSION_OUTPUT, consumer=_consumer) - return kwargs - - -REMOVE_PERMISSION = APIOperation( - input=RemovePermissionInput, - output=RemovePermissionOutput, - schema=_SCHEMA_REMOVE_PERMISSION, - input_schema=_SCHEMA_REMOVE_PERMISSION_INPUT, - output_schema=_SCHEMA_REMOVE_PERMISSION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.sns#AuthorizationErrorException" - ): AuthorizationErrorException, - ShapeID("com.amazonaws.sns#InternalErrorException"): InternalErrorException, - ShapeID( - "com.amazonaws.sns#InvalidParameterException" - ): InvalidParameterException, - ShapeID("com.amazonaws.sns#NotFoundException"): NotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_AUTHORIZATION_ERROR_EXCEPTION, - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class SetEndpointAttributesInput: - """Input for `SetEndpointAttributes` action.""" - - endpoint_arn: str | None = None - """EndpointArn used for `SetEndpointAttributes` action.""" - - attributes: dict[str, str] | None = None - """ - A map of the endpoint attributes. Attributes in this map include the - following: - - - `CustomUserData` -- arbitrary user data to associate with the - endpoint. Amazon SNS does not use this data. The data must be in UTF-8 - format and less than 2KB. - - - `Enabled` -- flag that enables/disables delivery to the endpoint. - Amazon SNS will set this to false when a notification service - indicates to Amazon SNS that the endpoint is invalid. Users can set it - back to true, typically after updating Token. - - - `Token` -- device token, also referred to as a registration id, for an - app and mobile device. This is returned from the notification service - when an app and mobile device are registered with the notification - service. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SET_ENDPOINT_ATTRIBUTES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.endpoint_arn is not None: - serializer.write_string( - _SCHEMA_SET_ENDPOINT_ATTRIBUTES_INPUT.members["EndpointArn"], - self.endpoint_arn, - ) - - if self.attributes is not None: - _serialize_map_string_to_string( - serializer, - _SCHEMA_SET_ENDPOINT_ATTRIBUTES_INPUT.members["Attributes"], - self.attributes, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["endpoint_arn"] = de.read_string( - _SCHEMA_SET_ENDPOINT_ATTRIBUTES_INPUT.members["EndpointArn"] - ) - - case 1: - kwargs["attributes"] = _deserialize_map_string_to_string( - de, _SCHEMA_SET_ENDPOINT_ATTRIBUTES_INPUT.members["Attributes"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SET_ENDPOINT_ATTRIBUTES_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class SetEndpointAttributesOutput: - """Dataclass for SetEndpointAttributesOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SET_ENDPOINT_ATTRIBUTES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SET_ENDPOINT_ATTRIBUTES_OUTPUT, consumer=_consumer - ) - return kwargs - - -SET_ENDPOINT_ATTRIBUTES = APIOperation( - input=SetEndpointAttributesInput, - output=SetEndpointAttributesOutput, - schema=_SCHEMA_SET_ENDPOINT_ATTRIBUTES, - input_schema=_SCHEMA_SET_ENDPOINT_ATTRIBUTES_INPUT, - output_schema=_SCHEMA_SET_ENDPOINT_ATTRIBUTES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.sns#AuthorizationErrorException" - ): AuthorizationErrorException, - ShapeID("com.amazonaws.sns#InternalErrorException"): InternalErrorException, - ShapeID( - "com.amazonaws.sns#InvalidParameterException" - ): InvalidParameterException, - ShapeID("com.amazonaws.sns#NotFoundException"): NotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_AUTHORIZATION_ERROR_EXCEPTION, - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class SetPlatformApplicationAttributesInput: - """Input for `SetPlatformApplicationAttributes` action.""" - - platform_application_arn: str | None = None - """`PlatformApplicationArn` for `SetPlatformApplicationAttributes` action.""" - - attributes: dict[str, str] | None = None - """ - A map of the platform application attributes. Attributes in this map - include the following: - - - `PlatformCredential` -- The credential received from the notification - service. - - - For ADM, `PlatformCredential`is client secret. - - - For Apple Services using certificate credentials, - `PlatformCredential` is private key. - - - For Apple Services using token credentials, `PlatformCredential` is - signing key. - - - For GCM (Firebase Cloud Messaging) using key credentials, there is - no `PlatformPrincipal`. The `PlatformCredential` is `API key`. - - - For GCM (Firebase Cloud Messaging) using token credentials, there is - no `PlatformPrincipal`. The `PlatformCredential` is a JSON formatted - private key file. When using the Amazon Web Services CLI, the file - must be in string format and special characters must be ignored. To - format the file correctly, Amazon SNS recommends using the following - command: `` SERVICE_JSON=`jq @json <<< cat service.json` ``. - - - - - `PlatformPrincipal` -- The principal received from the notification - service. - - - For ADM, `PlatformPrincipal`is client id. - - - For Apple Services using certificate credentials, - `PlatformPrincipal` is SSL certificate. - - - For Apple Services using token credentials, `PlatformPrincipal` is - signing key ID. - - - For GCM (Firebase Cloud Messaging), there is no `PlatformPrincipal`. - - - - - `EventEndpointCreated` -- Topic ARN to which `EndpointCreated` event - notifications are sent. - - - `EventEndpointDeleted` -- Topic ARN to which `EndpointDeleted` event - notifications are sent. - - - `EventEndpointUpdated` -- Topic ARN to which `EndpointUpdate` event - notifications are sent. - - - `EventDeliveryFailure` -- Topic ARN to which `DeliveryFailure` event - notifications are sent upon Direct Publish delivery failure - (permanent) to one of the application's endpoints. - - - `SuccessFeedbackRoleArn` -- IAM role ARN used to give Amazon SNS write - access to use CloudWatch Logs on your behalf. - - - `FailureFeedbackRoleArn` -- IAM role ARN used to give Amazon SNS write - access to use CloudWatch Logs on your behalf. - - - `SuccessFeedbackSampleRate` -- Sample rate percentage (0-100) of - successfully delivered messages. - - The following attributes only apply to `APNs` token-based - authentication: - - - `ApplePlatformTeamID` -- The identifier that's assigned to your Apple - developer account team. - - - `ApplePlatformBundleID` -- The bundle identifier that's assigned to - your iOS app. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SET_PLATFORM_APPLICATION_ATTRIBUTES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.platform_application_arn is not None: - serializer.write_string( - _SCHEMA_SET_PLATFORM_APPLICATION_ATTRIBUTES_INPUT.members[ - "PlatformApplicationArn" - ], - self.platform_application_arn, - ) - - if self.attributes is not None: - _serialize_map_string_to_string( - serializer, - _SCHEMA_SET_PLATFORM_APPLICATION_ATTRIBUTES_INPUT.members["Attributes"], - self.attributes, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["platform_application_arn"] = de.read_string( - _SCHEMA_SET_PLATFORM_APPLICATION_ATTRIBUTES_INPUT.members[ - "PlatformApplicationArn" - ] - ) - - case 1: - kwargs["attributes"] = _deserialize_map_string_to_string( - de, - _SCHEMA_SET_PLATFORM_APPLICATION_ATTRIBUTES_INPUT.members[ - "Attributes" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SET_PLATFORM_APPLICATION_ATTRIBUTES_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class SetPlatformApplicationAttributesOutput: - """Dataclass for SetPlatformApplicationAttributesOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_SET_PLATFORM_APPLICATION_ATTRIBUTES_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SET_PLATFORM_APPLICATION_ATTRIBUTES_OUTPUT, consumer=_consumer - ) - return kwargs - - -SET_PLATFORM_APPLICATION_ATTRIBUTES = APIOperation( - input=SetPlatformApplicationAttributesInput, - output=SetPlatformApplicationAttributesOutput, - schema=_SCHEMA_SET_PLATFORM_APPLICATION_ATTRIBUTES, - input_schema=_SCHEMA_SET_PLATFORM_APPLICATION_ATTRIBUTES_INPUT, - output_schema=_SCHEMA_SET_PLATFORM_APPLICATION_ATTRIBUTES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.sns#AuthorizationErrorException" - ): AuthorizationErrorException, - ShapeID("com.amazonaws.sns#InternalErrorException"): InternalErrorException, - ShapeID( - "com.amazonaws.sns#InvalidParameterException" - ): InvalidParameterException, - ShapeID("com.amazonaws.sns#NotFoundException"): NotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_AUTHORIZATION_ERROR_EXCEPTION, - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class SetSMSAttributesInput: - """The input for the SetSMSAttributes action.""" - - attributes: dict[str, str] | None = None - """ - The default settings for sending SMS messages from your Amazon Web - Services account. You can set values for the following attribute names: - - `MonthlySpendLimit` -- The maximum amount in USD that you are willing to - spend each month to send SMS messages. When Amazon SNS determines that - sending an SMS message would incur a cost that exceeds this limit, it - stops sending SMS messages within minutes. - - Warning: - Amazon SNS stops sending SMS messages within minutes of the limit being - crossed. During that interval, if you continue to send SMS messages, you - will incur costs that exceed your limit. - - By default, the spend limit is set to the maximum allowed by Amazon SNS. - If you want to raise the limit, submit an [SNS Limit Increase - case](https://console.aws.amazon.com/support/home#/case/create?issueType=service-limit-increase&limitType=service-code-sns). - For **New limit value**, enter your desired monthly spend limit. In the - **Use Case Description** field, explain that you are requesting an SMS - monthly spend limit increase. - - `DeliveryStatusIAMRole` -- The ARN of the IAM role that allows Amazon - SNS to write logs about SMS deliveries in CloudWatch Logs. For each SMS - message that you send, Amazon SNS writes a log that includes the message - price, the success or failure status, the reason for failure (if the - message failed), the message dwell time, and other information. - - `DeliveryStatusSuccessSamplingRate` -- The percentage of successful SMS - deliveries for which Amazon SNS will write logs in CloudWatch Logs. The - value can be an integer from 0 - 100. For example, to write logs only - for failed deliveries, set this value to `0`. To write logs for 10% of - your successful deliveries, set it to `10`. - - `DefaultSenderID` -- A string, such as your business brand, that is - displayed as the sender on the receiving device. Support for sender IDs - varies by country. The sender ID can be 1 - 11 alphanumeric characters, - and it must contain at least one letter. - - `DefaultSMSType` -- The type of SMS message that you will send by - default. You can assign the following values: - - - `Promotional` -- (Default) Noncritical messages, such as marketing - messages. Amazon SNS optimizes the message delivery to incur the - lowest cost. - - - `Transactional` -- Critical messages that support customer - transactions, such as one-time passcodes for multi-factor - authentication. Amazon SNS optimizes the message delivery to achieve - the highest reliability. - - `UsageReportS3Bucket` -- The name of the Amazon S3 bucket to receive - daily SMS usage reports from Amazon SNS. Each day, Amazon SNS will - deliver a usage report as a CSV file to the bucket. The report includes - the following information for each SMS message that was successfully - delivered by your Amazon Web Services account: - - - Time that the message was published (in UTC) - - - Message ID - - - Destination phone number - - - Message type - - - Delivery status - - - Message price (in USD) - - - Part number (a message is split into multiple parts if it is too long - for a single message) - - - Total number of parts - - To receive the report, the bucket must have a policy that allows the - Amazon SNS service principal to perform the `s3:PutObject` and - `s3:GetBucketLocation` actions. - - For an example bucket policy and usage report, see [Monitoring SMS - Activity](https://docs.aws.amazon.com/sns/latest/dg/sms_stats.html) in - the *Amazon SNS Developer Guide*. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SET_SMS_ATTRIBUTES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.attributes is not None: - _serialize_map_string_to_string( - serializer, - _SCHEMA_SET_SMS_ATTRIBUTES_INPUT.members["attributes"], - self.attributes, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["attributes"] = _deserialize_map_string_to_string( - de, _SCHEMA_SET_SMS_ATTRIBUTES_INPUT.members["attributes"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SET_SMS_ATTRIBUTES_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class SetSMSAttributesOutput: - """The response for the SetSMSAttributes action.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SET_SMS_ATTRIBUTES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SET_SMS_ATTRIBUTES_OUTPUT, consumer=_consumer) - return kwargs - - -SET_SMS_ATTRIBUTES = APIOperation( - input=SetSMSAttributesInput, - output=SetSMSAttributesOutput, - schema=_SCHEMA_SET_SMS_ATTRIBUTES, - input_schema=_SCHEMA_SET_SMS_ATTRIBUTES_INPUT, - output_schema=_SCHEMA_SET_SMS_ATTRIBUTES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.sns#AuthorizationErrorException" - ): AuthorizationErrorException, - ShapeID("com.amazonaws.sns#InternalErrorException"): InternalErrorException, - ShapeID( - "com.amazonaws.sns#InvalidParameterException" - ): InvalidParameterException, - ShapeID("com.amazonaws.sns#ThrottledException"): ThrottledException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_AUTHORIZATION_ERROR_EXCEPTION, - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_THROTTLED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class SetSubscriptionAttributesInput: - """Input for SetSubscriptionAttributes action.""" - - subscription_arn: str | None = None - """The ARN of the subscription to modify.""" - - attribute_name: str | None = None - """ - A map of attributes with their corresponding values. - - The following lists the names, descriptions, and values of the special - request parameters that this action uses: - - - `DeliveryPolicy` -- The policy that defines how Amazon SNS retries - failed deliveries to HTTP/S endpoints. - - - `FilterPolicy` -- The simple JSON object that lets your subscriber - receive only a subset of messages, rather than receiving every message - published to the topic. - - - `FilterPolicyScope` -- This attribute lets you choose the filtering - scope by using one of the following string value types: - - - `MessageAttributes` (default) -- The filter is applied on the - message attributes. - - - `MessageBody` -- The filter is applied on the message body. - - - `RawMessageDelivery` -- When set to `true`, enables raw message - delivery to Amazon SQS or HTTP/S endpoints. This eliminates the need - for the endpoints to process JSON formatting, which is otherwise - created for Amazon SNS metadata. - - - `RedrivePolicy` -- When specified, sends undeliverable messages to the - specified Amazon SQS dead-letter queue. Messages that can't be - delivered due to client errors (for example, when the subscribed - endpoint is unreachable) or server errors (for example, when the - service that powers the subscribed endpoint becomes unavailable) are - held in the dead-letter queue for further analysis or reprocessing. - - The following attribute applies only to Amazon Data Firehose delivery - stream subscriptions: - - - `SubscriptionRoleArn` -- The ARN of the IAM role that has the - following: - - - Permission to write to the Firehose delivery stream - - - Amazon SNS listed as a trusted entity - - Specifying a valid ARN for this attribute is required for Firehose - delivery stream subscriptions. For more information, see [Fanout to - Firehose delivery - streams](https://docs.aws.amazon.com/sns/latest/dg/sns-firehose-as-subscriber.html) - in the *Amazon SNS Developer Guide*. - """ - - attribute_value: str | None = None - """The new value for the attribute in JSON format.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SET_SUBSCRIPTION_ATTRIBUTES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.subscription_arn is not None: - serializer.write_string( - _SCHEMA_SET_SUBSCRIPTION_ATTRIBUTES_INPUT.members["SubscriptionArn"], - self.subscription_arn, - ) - - if self.attribute_name is not None: - serializer.write_string( - _SCHEMA_SET_SUBSCRIPTION_ATTRIBUTES_INPUT.members["AttributeName"], - self.attribute_name, - ) - - if self.attribute_value is not None: - serializer.write_string( - _SCHEMA_SET_SUBSCRIPTION_ATTRIBUTES_INPUT.members["AttributeValue"], - self.attribute_value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["subscription_arn"] = de.read_string( - _SCHEMA_SET_SUBSCRIPTION_ATTRIBUTES_INPUT.members[ - "SubscriptionArn" - ] - ) - - case 1: - kwargs["attribute_name"] = de.read_string( - _SCHEMA_SET_SUBSCRIPTION_ATTRIBUTES_INPUT.members[ - "AttributeName" - ] - ) - - case 2: - kwargs["attribute_value"] = de.read_string( - _SCHEMA_SET_SUBSCRIPTION_ATTRIBUTES_INPUT.members[ - "AttributeValue" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SET_SUBSCRIPTION_ATTRIBUTES_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class SetSubscriptionAttributesOutput: - """Dataclass for SetSubscriptionAttributesOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SET_SUBSCRIPTION_ATTRIBUTES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SET_SUBSCRIPTION_ATTRIBUTES_OUTPUT, consumer=_consumer - ) - return kwargs - - -SET_SUBSCRIPTION_ATTRIBUTES = APIOperation( - input=SetSubscriptionAttributesInput, - output=SetSubscriptionAttributesOutput, - schema=_SCHEMA_SET_SUBSCRIPTION_ATTRIBUTES, - input_schema=_SCHEMA_SET_SUBSCRIPTION_ATTRIBUTES_INPUT, - output_schema=_SCHEMA_SET_SUBSCRIPTION_ATTRIBUTES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.sns#AuthorizationErrorException" - ): AuthorizationErrorException, - ShapeID( - "com.amazonaws.sns#FilterPolicyLimitExceededException" - ): FilterPolicyLimitExceededException, - ShapeID("com.amazonaws.sns#InternalErrorException"): InternalErrorException, - ShapeID( - "com.amazonaws.sns#InvalidParameterException" - ): InvalidParameterException, - ShapeID("com.amazonaws.sns#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.sns#ReplayLimitExceededException" - ): ReplayLimitExceededException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_AUTHORIZATION_ERROR_EXCEPTION, - _SCHEMA_FILTER_POLICY_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_REPLAY_LIMIT_EXCEEDED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class SetTopicAttributesInput: - """Input for SetTopicAttributes action.""" - - topic_arn: str | None = None - """The ARN of the topic to modify.""" - - attribute_name: str | None = None - """ - A map of attributes with their corresponding values. - - The following lists the names, descriptions, and values of the special - request parameters that the `SetTopicAttributes` action uses: - - - `DeliveryPolicy` -- The policy that defines how Amazon SNS retries - failed deliveries to HTTP/S endpoints. - - - `DisplayName` -- The display name to use for a topic with SMS, - `email`, and `email-json` subscriptions. For `email` and `email-json` - subscriptions, the display name is used as the sender name for regular - notification messages. Subscription confirmation and unsubscribe - confirmation emails always use \"Amazon Web Services Notifications\" - as the sender name. - - - `MaximumMessageSize` -- The maximum size, in bytes, of a message that - can be published to the topic. Valid values are `1024` to `1048576` (1 - MiB). The default is `262144` (256 KiB). - - A topic with a `MaximumMessageSize` above 256 KiB must have 100 or - fewer subscriptions, and each subscription must be an Amazon SQS, - Amazon Data Firehose, or Lambda subscription. - - You can increase or decrease this value at any time. If the topic - doesn't meet these requirements when you set a value above 256 KiB, - Amazon SNS returns an `InvalidParameter` error. For more information, - see [Large message - payloads](https://docs.aws.amazon.com/sns/latest/dg/large-message-payloads.html) - in the *Amazon SNS Developer Guide.* - - - `Policy` -- The policy that defines who can access your topic. By - default, only the topic owner can publish or subscribe to the topic. - - - `TracingConfig` -- Tracing mode of an Amazon SNS topic. By default - `TracingConfig` is set to `PassThrough`, and the topic passes through - the tracing header it receives from an Amazon SNS publisher to its - subscriptions. If set to `Active`, Amazon SNS will vend X-Ray segment - data to topic owner account if the sampled flag in the tracing header - is true. This is only supported on standard topics. - - - HTTP - - - `HTTPSuccessFeedbackRoleArn` -- Indicates successful message - delivery status for an Amazon SNS topic that is subscribed to an - HTTP endpoint. - - - `HTTPSuccessFeedbackSampleRate` -- Indicates percentage of - successful messages to sample for an Amazon SNS topic that is - subscribed to an HTTP endpoint. - - - `HTTPFailureFeedbackRoleArn` -- Indicates failed message delivery - status for an Amazon SNS topic that is subscribed to an HTTP - endpoint. - - - Amazon Data Firehose - - - `FirehoseSuccessFeedbackRoleArn` -- Indicates successful message - delivery status for an Amazon SNS topic that is subscribed to an - Amazon Data Firehose endpoint. - - - `FirehoseSuccessFeedbackSampleRate` -- Indicates percentage of - successful messages to sample for an Amazon SNS topic that is - subscribed to an Amazon Data Firehose endpoint. - - - `FirehoseFailureFeedbackRoleArn` -- Indicates failed message - delivery status for an Amazon SNS topic that is subscribed to an - Amazon Data Firehose endpoint. - - - Lambda - - - `LambdaSuccessFeedbackRoleArn` -- Indicates successful message - delivery status for an Amazon SNS topic that is subscribed to an - Lambda endpoint. - - - `LambdaSuccessFeedbackSampleRate` -- Indicates percentage of - successful messages to sample for an Amazon SNS topic that is - subscribed to an Lambda endpoint. - - - `LambdaFailureFeedbackRoleArn` -- Indicates failed message delivery - status for an Amazon SNS topic that is subscribed to an Lambda - endpoint. - - - Platform application endpoint - - - `ApplicationSuccessFeedbackRoleArn` -- Indicates successful message - delivery status for an Amazon SNS topic that is subscribed to an - platform application endpoint. - - - `ApplicationSuccessFeedbackSampleRate` -- Indicates percentage of - successful messages to sample for an Amazon SNS topic that is - subscribed to an platform application endpoint. - - - `ApplicationFailureFeedbackRoleArn` -- Indicates failed message - delivery status for an Amazon SNS topic that is subscribed to an - platform application endpoint. - - Note: - In addition to being able to configure topic attributes for message - delivery status of notification messages sent to Amazon SNS - application endpoints, you can also configure application attributes - for the delivery status of push notification messages sent to push - notification services. - - For example, For more information, see [Using Amazon SNS Application - Attributes for Message Delivery - Status](https://docs.aws.amazon.com/sns/latest/dg/sns-msg-status.html). - - - Amazon SQS - - - `SQSSuccessFeedbackRoleArn` -- Indicates successful message delivery - status for an Amazon SNS topic that is subscribed to an Amazon SQS - endpoint. - - - `SQSSuccessFeedbackSampleRate` -- Indicates percentage of successful - messages to sample for an Amazon SNS topic that is subscribed to an - Amazon SQS endpoint. - - - `SQSFailureFeedbackRoleArn` -- Indicates failed message delivery - status for an Amazon SNS topic that is subscribed to an Amazon SQS - endpoint. - - Note: - The ``{=html}SuccessFeedbackRoleArn and - ``{=html}FailureFeedbackRoleArn attributes are used to give - Amazon SNS write access to use CloudWatch Logs on your behalf. The - ``{=html}SuccessFeedbackSampleRate attribute is for specifying - the sample rate percentage (0-100) of successfully delivered messages. - After you configure the ``{=html}FailureFeedbackRoleArn - attribute, then all failed message deliveries generate CloudWatch Logs. - - The following attribute applies only to - [server-side-encryption](https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html): - - - `KmsMasterKeyId` -- The ID of an Amazon Web Services managed customer - master key (CMK) for Amazon SNS or a custom CMK. For more information, - see [Key - Terms](https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html#sse-key-terms). - For more examples, see - [KeyId](https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters) - in the *Key Management Service API Reference*. - - - `SignatureVersion` -- The signature version corresponds to the hashing - algorithm used while creating the signature of the notifications, - subscription confirmations, or unsubscribe confirmation messages sent - by Amazon SNS. By default, `SignatureVersion` is set to `1`. - - The following attribute applies only to [FIFO - topics](https://docs.aws.amazon.com/sns/latest/dg/sns-fifo-topics.html): - - - `ArchivePolicy` -- The policy that sets the retention period for - messages stored in the message archive of an Amazon SNS FIFO topic. - - - `ContentBasedDeduplication` -- Enables content-based deduplication for - FIFO topics. - - - By default, `ContentBasedDeduplication` is set to `false`. If you - create a FIFO topic and this attribute is `false`, you must specify - a value for the `MessageDeduplicationId` parameter for the - [Publish](https://docs.aws.amazon.com/sns/latest/api/API_Publish.html) - action. - - - When you set `ContentBasedDeduplication` to `true`, Amazon SNS uses - a SHA-256 hash to generate the `MessageDeduplicationId` using the - body of the message (but not the attributes of the message). - - (Optional) To override the generated value, you can specify a value - for the `MessageDeduplicationId` parameter for the `Publish` action. - - - - - `FifoThroughputScope` -- Enables higher throughput for your FIFO topic - by adjusting the scope of deduplication. This attribute has two - possible values: - - - `Topic` -- The scope of message deduplication is across the entire - topic. This is the default value and maintains existing behavior, - with a maximum throughput of 3000 messages per second or 20MB per - second, whichever comes first. - - - `MessageGroup` -- The scope of deduplication is within each - individual message group, which enables higher throughput per topic - subject to regional quotas. For more information on quotas or to - request an increase, see [Amazon SNS service - quotas](https://docs.aws.amazon.com/general/latest/gr/sns.html) in - the Amazon Web Services General Reference. - """ - - attribute_value: str | None = None - """The new value for the attribute.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SET_TOPIC_ATTRIBUTES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.topic_arn is not None: - serializer.write_string( - _SCHEMA_SET_TOPIC_ATTRIBUTES_INPUT.members["TopicArn"], self.topic_arn - ) - - if self.attribute_name is not None: - serializer.write_string( - _SCHEMA_SET_TOPIC_ATTRIBUTES_INPUT.members["AttributeName"], - self.attribute_name, - ) - - if self.attribute_value is not None: - serializer.write_string( - _SCHEMA_SET_TOPIC_ATTRIBUTES_INPUT.members["AttributeValue"], - self.attribute_value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["topic_arn"] = de.read_string( - _SCHEMA_SET_TOPIC_ATTRIBUTES_INPUT.members["TopicArn"] - ) - - case 1: - kwargs["attribute_name"] = de.read_string( - _SCHEMA_SET_TOPIC_ATTRIBUTES_INPUT.members["AttributeName"] - ) - - case 2: - kwargs["attribute_value"] = de.read_string( - _SCHEMA_SET_TOPIC_ATTRIBUTES_INPUT.members["AttributeValue"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SET_TOPIC_ATTRIBUTES_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class SetTopicAttributesOutput: - """Dataclass for SetTopicAttributesOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SET_TOPIC_ATTRIBUTES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SET_TOPIC_ATTRIBUTES_OUTPUT, consumer=_consumer - ) - return kwargs - - -SET_TOPIC_ATTRIBUTES = APIOperation( - input=SetTopicAttributesInput, - output=SetTopicAttributesOutput, - schema=_SCHEMA_SET_TOPIC_ATTRIBUTES, - input_schema=_SCHEMA_SET_TOPIC_ATTRIBUTES_INPUT, - output_schema=_SCHEMA_SET_TOPIC_ATTRIBUTES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.sns#AuthorizationErrorException" - ): AuthorizationErrorException, - ShapeID("com.amazonaws.sns#InternalErrorException"): InternalErrorException, - ShapeID( - "com.amazonaws.sns#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.sns#InvalidSecurityException" - ): InvalidSecurityException, - ShapeID("com.amazonaws.sns#NotFoundException"): NotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_AUTHORIZATION_ERROR_EXCEPTION, - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_INVALID_SECURITY_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class SubscribeInput: - """Input for Subscribe action.""" - - topic_arn: str | None = None - """The ARN of the topic you want to subscribe to.""" - - protocol: str | None = None - """ - The protocol that you want to use. Supported protocols include: - - - `http` -- delivery of JSON-encoded message via HTTP POST - - - `https` -- delivery of JSON-encoded message via HTTPS POST - - - `email` -- delivery of message via SMTP - - - `email-json` -- delivery of JSON-encoded message via SMTP - - - `sms` -- delivery of message via SMS - - - `sqs` -- delivery of JSON-encoded message to an Amazon SQS queue - - - `application` -- delivery of JSON-encoded message to an EndpointArn - for a mobile app and device - - - `lambda` -- delivery of JSON-encoded message to an Lambda function - - - `firehose` -- delivery of JSON-encoded message to an Amazon Data - Firehose delivery stream. - """ - - endpoint: str | None = None - """ - The endpoint that you want to receive notifications. Endpoints vary by - protocol: - - - For the `http` protocol, the (public) endpoint is a URL beginning with - `http://`. - - - For the `https` protocol, the (public) endpoint is a URL beginning - with `https://`. - - - For the `email` protocol, the endpoint is an email address. - - - For the `email-json` protocol, the endpoint is an email address. - - - For the `sms` protocol, the endpoint is a phone number of an - SMS-enabled device. - - - For the `sqs` protocol, the endpoint is the ARN of an Amazon SQS - queue. - - - For the `application` protocol, the endpoint is the EndpointArn of a - mobile app and device. - - - For the `lambda` protocol, the endpoint is the ARN of an Lambda - function. - - - For the `firehose` protocol, the endpoint is the ARN of an Amazon Data - Firehose delivery stream. - """ - - attributes: dict[str, str] | None = None - """ - A map of attributes with their corresponding values. - - The following lists the names, descriptions, and values of the special - request parameters that the `Subscribe` action uses: - - - `DeliveryPolicy` -- The policy that defines how Amazon SNS retries - failed deliveries to HTTP/S endpoints. - - - `FilterPolicy` -- The simple JSON object that lets your subscriber - receive only a subset of messages, rather than receiving every message - published to the topic. - - - `FilterPolicyScope` -- This attribute lets you choose the filtering - scope by using one of the following string value types: - - - `MessageAttributes` (default) -- The filter is applied on the - message attributes. - - - `MessageBody` -- The filter is applied on the message body. - - - `RawMessageDelivery` -- When set to `true`, enables raw message - delivery to Amazon SQS or HTTP/S endpoints. This eliminates the need - for the endpoints to process JSON formatting, which is otherwise - created for Amazon SNS metadata. - - - `RedrivePolicy` -- When specified, sends undeliverable messages to the - specified Amazon SQS dead-letter queue. Messages that can't be - delivered due to client errors (for example, when the subscribed - endpoint is unreachable) or server errors (for example, when the - service that powers the subscribed endpoint becomes unavailable) are - held in the dead-letter queue for further analysis or reprocessing. - - The following attribute applies only to Amazon Data Firehose delivery - stream subscriptions: - - - `SubscriptionRoleArn` -- The ARN of the IAM role that has the - following: - - - Permission to write to the Firehose delivery stream - - - Amazon SNS listed as a trusted entity - - Specifying a valid ARN for this attribute is required for Firehose - delivery stream subscriptions. For more information, see [Fanout to - Firehose delivery - streams](https://docs.aws.amazon.com/sns/latest/dg/sns-firehose-as-subscriber.html) - in the *Amazon SNS Developer Guide*. - - The following attributes apply only to [FIFO - topics](https://docs.aws.amazon.com/sns/latest/dg/sns-fifo-topics.html): - - - `ReplayPolicy` -- Adds or updates an inline policy document for a - subscription to replay messages stored in the specified Amazon SNS - topic. - - - `ReplayStatus` -- Retrieves the status of the subscription message - replay, which can be one of the following: - - - `Completed` -- The replay has successfully redelivered all messages, - and is now delivering newly published messages. If an ending point - was specified in the `ReplayPolicy` then the subscription will no - longer receive newly published messages. - - - `In progress` -- The replay is currently replaying the selected - messages. - - - `Failed` -- The replay was unable to complete. - - - `Pending` -- The default state while the replay initiates. - """ - - return_subscription_arn: bool = False - """ - Sets whether the response from the `Subscribe` request includes the - subscription ARN, even if the subscription is not yet confirmed. - - If you set this parameter to `true`, the response includes the ARN in - all cases, even if the subscription is not yet confirmed. In addition to - the ARN for confirmed subscriptions, the response also includes the - `pending subscription` ARN value for subscriptions that aren't yet - confirmed. A subscription becomes confirmed when the subscriber calls - the `ConfirmSubscription` action with a confirmation token. - - The default value is `false`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SUBSCRIBE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.topic_arn is not None: - serializer.write_string( - _SCHEMA_SUBSCRIBE_INPUT.members["TopicArn"], self.topic_arn - ) - - if self.protocol is not None: - serializer.write_string( - _SCHEMA_SUBSCRIBE_INPUT.members["Protocol"], self.protocol - ) - - if self.endpoint is not None: - serializer.write_string( - _SCHEMA_SUBSCRIBE_INPUT.members["Endpoint"], self.endpoint - ) - - if self.attributes is not None: - _serialize_subscription_attributes_map( - serializer, - _SCHEMA_SUBSCRIBE_INPUT.members["Attributes"], - self.attributes, - ) - - if self.return_subscription_arn is not None: - serializer.write_boolean( - _SCHEMA_SUBSCRIBE_INPUT.members["ReturnSubscriptionArn"], - self.return_subscription_arn, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["topic_arn"] = de.read_string( - _SCHEMA_SUBSCRIBE_INPUT.members["TopicArn"] - ) - - case 1: - kwargs["protocol"] = de.read_string( - _SCHEMA_SUBSCRIBE_INPUT.members["Protocol"] - ) - - case 2: - kwargs["endpoint"] = de.read_string( - _SCHEMA_SUBSCRIBE_INPUT.members["Endpoint"] - ) - - case 3: - kwargs["attributes"] = _deserialize_subscription_attributes_map( - de, _SCHEMA_SUBSCRIBE_INPUT.members["Attributes"] - ) - - case 4: - kwargs["return_subscription_arn"] = de.read_boolean( - _SCHEMA_SUBSCRIBE_INPUT.members["ReturnSubscriptionArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SUBSCRIBE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class SubscribeOutput: - """Response for Subscribe action.""" - subscription_arn: str | None = None - """ - The ARN of the subscription if it is confirmed, or the string \"pending - confirmation\" if the subscription requires confirmation. However, if - the API request parameter `ReturnSubscriptionArn` is true, then the - value is always the subscription ARN, even if the subscription requires - confirmation. +class ServiceError(ModeledError): """ + Base error for all errors in the service. - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. + Some exceptions do not extend from this class, including + synthetic, implicit, and shared exception types. """ - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SUBSCRIBE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.subscription_arn is not None: - serializer.write_string( - _SCHEMA_SUBSCRIBE_OUTPUT.members["SubscriptionArn"], - self.subscription_arn, - ) - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["subscription_arn"] = de.read_string( - _SCHEMA_SUBSCRIBE_OUTPUT.members["SubscriptionArn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SUBSCRIBE_OUTPUT, consumer=_consumer) - return kwargs - - -SUBSCRIBE = APIOperation( - input=SubscribeInput, - output=SubscribeOutput, - schema=_SCHEMA_SUBSCRIBE, - input_schema=_SCHEMA_SUBSCRIBE_INPUT, - output_schema=_SCHEMA_SUBSCRIBE_OUTPUT, - error_registry=TypeRegistry( +_registry = ModelRegistry( + _schemas, + renames={}, + index={ + "AddPermissionInput": "ADD_PERMISSION_INPUT", + "AddPermissionOutput": "ADD_PERMISSION_OUTPUT", + "AuthorizationErrorException": "AUTHORIZATION_ERROR_EXCEPTION", + "BatchEntryIdsNotDistinctException": "BATCH_ENTRY_IDS_NOT_DISTINCT_EXCEPTION", + "BatchRequestTooLongException": "BATCH_REQUEST_TOO_LONG_EXCEPTION", + "BatchResultErrorEntry": "BATCH_RESULT_ERROR_ENTRY", + "CheckIfPhoneNumberIsOptedOutInput": "CHECK_IF_PHONE_NUMBER_IS_OPTED_OUT_INPUT", + "CheckIfPhoneNumberIsOptedOutOutput": "CHECK_IF_PHONE_NUMBER_IS_OPTED_OUT_OUTPUT", + "ConcurrentAccessException": "CONCURRENT_ACCESS_EXCEPTION", + "ConfirmSubscriptionInput": "CONFIRM_SUBSCRIPTION_INPUT", + "ConfirmSubscriptionOutput": "CONFIRM_SUBSCRIPTION_OUTPUT", + "CreatePlatformApplicationInput": "CREATE_PLATFORM_APPLICATION_INPUT", + "CreatePlatformApplicationOutput": "CREATE_PLATFORM_APPLICATION_OUTPUT", + "CreatePlatformEndpointInput": "CREATE_PLATFORM_ENDPOINT_INPUT", + "CreatePlatformEndpointOutput": "CREATE_PLATFORM_ENDPOINT_OUTPUT", + "CreateSMSSandboxPhoneNumberInput": "CREATE_SMS_SANDBOX_PHONE_NUMBER_INPUT", + "CreateSMSSandboxPhoneNumberOutput": "CREATE_SMS_SANDBOX_PHONE_NUMBER_OUTPUT", + "CreateTopicInput": "CREATE_TOPIC_INPUT", + "CreateTopicOutput": "CREATE_TOPIC_OUTPUT", + "DeleteEndpointInput": "DELETE_ENDPOINT_INPUT", + "DeleteEndpointOutput": "DELETE_ENDPOINT_OUTPUT", + "DeletePlatformApplicationInput": "DELETE_PLATFORM_APPLICATION_INPUT", + "DeletePlatformApplicationOutput": "DELETE_PLATFORM_APPLICATION_OUTPUT", + "DeleteSMSSandboxPhoneNumberInput": "DELETE_SMS_SANDBOX_PHONE_NUMBER_INPUT", + "DeleteSMSSandboxPhoneNumberOutput": "DELETE_SMS_SANDBOX_PHONE_NUMBER_OUTPUT", + "DeleteTopicInput": "DELETE_TOPIC_INPUT", + "DeleteTopicOutput": "DELETE_TOPIC_OUTPUT", + "EmptyBatchRequestException": "EMPTY_BATCH_REQUEST_EXCEPTION", + "Endpoint": "ENDPOINT", + "EndpointDisabledException": "ENDPOINT_DISABLED_EXCEPTION", + "FilterPolicyLimitExceededException": "FILTER_POLICY_LIMIT_EXCEEDED_EXCEPTION", + "GetDataProtectionPolicyInput": "GET_DATA_PROTECTION_POLICY_INPUT", + "GetDataProtectionPolicyOutput": "GET_DATA_PROTECTION_POLICY_OUTPUT", + "GetEndpointAttributesInput": "GET_ENDPOINT_ATTRIBUTES_INPUT", + "GetEndpointAttributesOutput": "GET_ENDPOINT_ATTRIBUTES_OUTPUT", + "GetPlatformApplicationAttributesInput": "GET_PLATFORM_APPLICATION_ATTRIBUTES_INPUT", + "GetPlatformApplicationAttributesOutput": "GET_PLATFORM_APPLICATION_ATTRIBUTES_OUTPUT", + "GetSMSAttributesInput": "GET_SMS_ATTRIBUTES_INPUT", + "GetSMSAttributesOutput": "GET_SMS_ATTRIBUTES_OUTPUT", + "GetSMSSandboxAccountStatusInput": "GET_SMS_SANDBOX_ACCOUNT_STATUS_INPUT", + "GetSMSSandboxAccountStatusOutput": "GET_SMS_SANDBOX_ACCOUNT_STATUS_OUTPUT", + "GetSubscriptionAttributesInput": "GET_SUBSCRIPTION_ATTRIBUTES_INPUT", + "GetSubscriptionAttributesOutput": "GET_SUBSCRIPTION_ATTRIBUTES_OUTPUT", + "GetTopicAttributesInput": "GET_TOPIC_ATTRIBUTES_INPUT", + "GetTopicAttributesOutput": "GET_TOPIC_ATTRIBUTES_OUTPUT", + "InternalErrorException": "INTERNAL_ERROR_EXCEPTION", + "InvalidBatchEntryIdException": "INVALID_BATCH_ENTRY_ID_EXCEPTION", + "InvalidParameterException": "INVALID_PARAMETER_EXCEPTION", + "InvalidParameterValueException": "INVALID_PARAMETER_VALUE_EXCEPTION", + "InvalidSecurityException": "INVALID_SECURITY_EXCEPTION", + "InvalidStateException": "INVALID_STATE_EXCEPTION", + "KMSAccessDeniedException": "KMS_ACCESS_DENIED_EXCEPTION", + "KMSDisabledException": "KMS_DISABLED_EXCEPTION", + "KMSInvalidStateException": "KMS_INVALID_STATE_EXCEPTION", + "KMSNotFoundException": "KMS_NOT_FOUND_EXCEPTION", + "KMSOptInRequired": "KMS_OPT_IN_REQUIRED", + "KMSThrottlingException": "KMS_THROTTLING_EXCEPTION", + "LanguageCodeString": "LANGUAGE_CODE_STRING", + "ListEndpointsByPlatformApplicationInput": "LIST_ENDPOINTS_BY_PLATFORM_APPLICATION_INPUT", + "ListEndpointsByPlatformApplicationOutput": "LIST_ENDPOINTS_BY_PLATFORM_APPLICATION_OUTPUT", + "ListOriginationNumbersInput": "LIST_ORIGINATION_NUMBERS_INPUT", + "ListOriginationNumbersOutput": "LIST_ORIGINATION_NUMBERS_OUTPUT", + "ListPhoneNumbersOptedOutInput": "LIST_PHONE_NUMBERS_OPTED_OUT_INPUT", + "ListPhoneNumbersOptedOutOutput": "LIST_PHONE_NUMBERS_OPTED_OUT_OUTPUT", + "ListPlatformApplicationsInput": "LIST_PLATFORM_APPLICATIONS_INPUT", + "ListPlatformApplicationsOutput": "LIST_PLATFORM_APPLICATIONS_OUTPUT", + "ListSMSSandboxPhoneNumbersInput": "LIST_SMS_SANDBOX_PHONE_NUMBERS_INPUT", + "ListSMSSandboxPhoneNumbersOutput": "LIST_SMS_SANDBOX_PHONE_NUMBERS_OUTPUT", + "ListSubscriptionsByTopicInput": "LIST_SUBSCRIPTIONS_BY_TOPIC_INPUT", + "ListSubscriptionsByTopicOutput": "LIST_SUBSCRIPTIONS_BY_TOPIC_OUTPUT", + "ListSubscriptionsInput": "LIST_SUBSCRIPTIONS_INPUT", + "ListSubscriptionsOutput": "LIST_SUBSCRIPTIONS_OUTPUT", + "ListTagsForResourceInput": "LIST_TAGS_FOR_RESOURCE_INPUT", + "ListTagsForResourceOutput": "LIST_TAGS_FOR_RESOURCE_OUTPUT", + "ListTopicsInput": "LIST_TOPICS_INPUT", + "ListTopicsOutput": "LIST_TOPICS_OUTPUT", + "MessageAttributeValue": "MESSAGE_ATTRIBUTE_VALUE", + "NotFoundException": "NOT_FOUND_EXCEPTION", + "NumberCapability": "NUMBER_CAPABILITY", + "OptedOutException": "OPTED_OUT_EXCEPTION", + "OptInPhoneNumberInput": "OPT_IN_PHONE_NUMBER_INPUT", + "OptInPhoneNumberOutput": "OPT_IN_PHONE_NUMBER_OUTPUT", + "PhoneNumberInformation": "PHONE_NUMBER_INFORMATION", + "PlatformApplication": "PLATFORM_APPLICATION", + "PlatformApplicationDisabledException": "PLATFORM_APPLICATION_DISABLED_EXCEPTION", + "PublishBatchInput": "PUBLISH_BATCH_INPUT", + "PublishBatchOutput": "PUBLISH_BATCH_OUTPUT", + "PublishBatchRequestEntry": "PUBLISH_BATCH_REQUEST_ENTRY", + "PublishBatchResultEntry": "PUBLISH_BATCH_RESULT_ENTRY", + "PublishInput": "PUBLISH_INPUT", + "PublishOutput": "PUBLISH_OUTPUT", + "PutDataProtectionPolicyInput": "PUT_DATA_PROTECTION_POLICY_INPUT", + "PutDataProtectionPolicyOutput": "PUT_DATA_PROTECTION_POLICY_OUTPUT", + "RemovePermissionInput": "REMOVE_PERMISSION_INPUT", + "RemovePermissionOutput": "REMOVE_PERMISSION_OUTPUT", + "ReplayLimitExceededException": "REPLAY_LIMIT_EXCEEDED_EXCEPTION", + "ResourceNotFoundException": "RESOURCE_NOT_FOUND_EXCEPTION", + "RouteType": "ROUTE_TYPE", + "SetEndpointAttributesInput": "SET_ENDPOINT_ATTRIBUTES_INPUT", + "SetEndpointAttributesOutput": "SET_ENDPOINT_ATTRIBUTES_OUTPUT", + "SetPlatformApplicationAttributesInput": "SET_PLATFORM_APPLICATION_ATTRIBUTES_INPUT", + "SetPlatformApplicationAttributesOutput": "SET_PLATFORM_APPLICATION_ATTRIBUTES_OUTPUT", + "SetSMSAttributesInput": "SET_SMS_ATTRIBUTES_INPUT", + "SetSMSAttributesOutput": "SET_SMS_ATTRIBUTES_OUTPUT", + "SetSubscriptionAttributesInput": "SET_SUBSCRIPTION_ATTRIBUTES_INPUT", + "SetSubscriptionAttributesOutput": "SET_SUBSCRIPTION_ATTRIBUTES_OUTPUT", + "SetTopicAttributesInput": "SET_TOPIC_ATTRIBUTES_INPUT", + "SetTopicAttributesOutput": "SET_TOPIC_ATTRIBUTES_OUTPUT", + "SMSSandboxPhoneNumber": "SMS_SANDBOX_PHONE_NUMBER", + "SMSSandboxPhoneNumberVerificationStatus": "SMS_SANDBOX_PHONE_NUMBER_VERIFICATION_STATUS", + "StaleTagException": "STALE_TAG_EXCEPTION", + "SubscribeInput": "SUBSCRIBE_INPUT", + "SubscribeOutput": "SUBSCRIBE_OUTPUT", + "Subscription": "SUBSCRIPTION", + "SubscriptionLimitExceededException": "SUBSCRIPTION_LIMIT_EXCEEDED_EXCEPTION", + "Tag": "TAG", + "TagLimitExceededException": "TAG_LIMIT_EXCEEDED_EXCEPTION", + "TagPolicyException": "TAG_POLICY_EXCEPTION", + "TagResourceInput": "TAG_RESOURCE_INPUT", + "TagResourceOutput": "TAG_RESOURCE_OUTPUT", + "ThrottledException": "THROTTLED_EXCEPTION", + "TooManyEntriesInBatchRequestException": "TOO_MANY_ENTRIES_IN_BATCH_REQUEST_EXCEPTION", + "Topic": "TOPIC", + "TopicLimitExceededException": "TOPIC_LIMIT_EXCEEDED_EXCEPTION", + "UnsubscribeInput": "UNSUBSCRIBE_INPUT", + "UnsubscribeOutput": "UNSUBSCRIBE_OUTPUT", + "UntagResourceInput": "UNTAG_RESOURCE_INPUT", + "UntagResourceOutput": "UNTAG_RESOURCE_OUTPUT", + "UserErrorException": "USER_ERROR_EXCEPTION", + "ValidationException": "VALIDATION_EXCEPTION", + "VerificationException": "VERIFICATION_EXCEPTION", + "VerifySMSSandboxPhoneNumberInput": "VERIFY_SMS_SANDBOX_PHONE_NUMBER_INPUT", + "VerifySMSSandboxPhoneNumberOutput": "VERIFY_SMS_SANDBOX_PHONE_NUMBER_OUTPUT", + }, + shape_names=frozenset( { - ShapeID( - "com.amazonaws.sns#AuthorizationErrorException" - ): AuthorizationErrorException, - ShapeID( - "com.amazonaws.sns#FilterPolicyLimitExceededException" - ): FilterPolicyLimitExceededException, - ShapeID("com.amazonaws.sns#InternalErrorException"): InternalErrorException, - ShapeID( - "com.amazonaws.sns#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.sns#InvalidSecurityException" - ): InvalidSecurityException, - ShapeID("com.amazonaws.sns#NotFoundException"): NotFoundException, - ShapeID( - "com.amazonaws.sns#ReplayLimitExceededException" - ): ReplayLimitExceededException, - ShapeID( - "com.amazonaws.sns#SubscriptionLimitExceededException" - ): SubscriptionLimitExceededException, + "AddPermissionInput", + "AddPermissionOutput", + "AuthorizationErrorException", + "BatchEntryIdsNotDistinctException", + "BatchRequestTooLongException", + "BatchResultErrorEntry", + "CheckIfPhoneNumberIsOptedOutInput", + "CheckIfPhoneNumberIsOptedOutOutput", + "ConcurrentAccessException", + "ConfirmSubscriptionInput", + "ConfirmSubscriptionOutput", + "CreatePlatformApplicationInput", + "CreatePlatformApplicationOutput", + "CreatePlatformEndpointInput", + "CreatePlatformEndpointOutput", + "CreateSMSSandboxPhoneNumberInput", + "CreateSMSSandboxPhoneNumberOutput", + "CreateTopicInput", + "CreateTopicOutput", + "DeleteEndpointInput", + "DeleteEndpointOutput", + "DeletePlatformApplicationInput", + "DeletePlatformApplicationOutput", + "DeleteSMSSandboxPhoneNumberInput", + "DeleteSMSSandboxPhoneNumberOutput", + "DeleteTopicInput", + "DeleteTopicOutput", + "EmptyBatchRequestException", + "Endpoint", + "EndpointDisabledException", + "FilterPolicyLimitExceededException", + "GetDataProtectionPolicyInput", + "GetDataProtectionPolicyOutput", + "GetEndpointAttributesInput", + "GetEndpointAttributesOutput", + "GetPlatformApplicationAttributesInput", + "GetPlatformApplicationAttributesOutput", + "GetSMSAttributesInput", + "GetSMSAttributesOutput", + "GetSMSSandboxAccountStatusInput", + "GetSMSSandboxAccountStatusOutput", + "GetSubscriptionAttributesInput", + "GetSubscriptionAttributesOutput", + "GetTopicAttributesInput", + "GetTopicAttributesOutput", + "InternalErrorException", + "InvalidBatchEntryIdException", + "InvalidParameterException", + "InvalidParameterValueException", + "InvalidSecurityException", + "InvalidStateException", + "KMSAccessDeniedException", + "KMSDisabledException", + "KMSInvalidStateException", + "KMSNotFoundException", + "KMSOptInRequired", + "KMSThrottlingException", + "LanguageCodeString", + "ListEndpointsByPlatformApplicationInput", + "ListEndpointsByPlatformApplicationOutput", + "ListOriginationNumbersInput", + "ListOriginationNumbersOutput", + "ListPhoneNumbersOptedOutInput", + "ListPhoneNumbersOptedOutOutput", + "ListPlatformApplicationsInput", + "ListPlatformApplicationsOutput", + "ListSMSSandboxPhoneNumbersInput", + "ListSMSSandboxPhoneNumbersOutput", + "ListSubscriptionsByTopicInput", + "ListSubscriptionsByTopicOutput", + "ListSubscriptionsInput", + "ListSubscriptionsOutput", + "ListTagsForResourceInput", + "ListTagsForResourceOutput", + "ListTopicsInput", + "ListTopicsOutput", + "MessageAttributeValue", + "NotFoundException", + "NumberCapability", + "OptInPhoneNumberInput", + "OptInPhoneNumberOutput", + "OptedOutException", + "PhoneNumberInformation", + "PlatformApplication", + "PlatformApplicationDisabledException", + "PublishBatchInput", + "PublishBatchOutput", + "PublishBatchRequestEntry", + "PublishBatchResultEntry", + "PublishInput", + "PublishOutput", + "PutDataProtectionPolicyInput", + "PutDataProtectionPolicyOutput", + "RemovePermissionInput", + "RemovePermissionOutput", + "ReplayLimitExceededException", + "ResourceNotFoundException", + "RouteType", + "SMSSandboxPhoneNumber", + "SMSSandboxPhoneNumberVerificationStatus", + "SetEndpointAttributesInput", + "SetEndpointAttributesOutput", + "SetPlatformApplicationAttributesInput", + "SetPlatformApplicationAttributesOutput", + "SetSMSAttributesInput", + "SetSMSAttributesOutput", + "SetSubscriptionAttributesInput", + "SetSubscriptionAttributesOutput", + "SetTopicAttributesInput", + "SetTopicAttributesOutput", + "StaleTagException", + "SubscribeInput", + "SubscribeOutput", + "Subscription", + "SubscriptionLimitExceededException", + "Tag", + "TagLimitExceededException", + "TagPolicyException", + "TagResourceInput", + "TagResourceOutput", + "ThrottledException", + "TooManyEntriesInBatchRequestException", + "Topic", + "TopicLimitExceededException", + "UnsubscribeInput", + "UnsubscribeOutput", + "UntagResourceInput", + "UntagResourceOutput", + "UserErrorException", + "ValidationException", + "VerificationException", + "VerifySMSSandboxPhoneNumberInput", + "VerifySMSSandboxPhoneNumberOutput", } ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_AUTHORIZATION_ERROR_EXCEPTION, - _SCHEMA_FILTER_POLICY_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_INVALID_SECURITY_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, - _SCHEMA_REPLAY_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_SUBSCRIPTION_LIMIT_EXCEEDED_EXCEPTION, - ], + service_error="ServiceError", ) -@dataclass(kw_only=True) -class TagResourceInput: - """Dataclass for TagResourceInput structure.""" - - resource_arn: str | None = None - """The ARN of the topic to which to add tags.""" - - tags: list[Tag] | None = None - """ - The tags to be added to the specified topic. A tag consists of a - required key and an optional value. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TAG_RESOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_TAG_RESOURCE_INPUT.members["ResourceArn"], self.resource_arn - ) - - if self.tags is not None: - _serialize_tag_list( - serializer, _SCHEMA_TAG_RESOURCE_INPUT.members["Tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_TAG_RESOURCE_INPUT.members["ResourceArn"] - ) - - case 1: - kwargs["tags"] = _deserialize_tag_list( - de, _SCHEMA_TAG_RESOURCE_INPUT.members["Tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TAG_RESOURCE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class TagResourceOutput: - """Dataclass for TagResourceOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TAG_RESOURCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) +def __getattr__(name: str): + return _registry.build(name) - deserializer.read_struct(_SCHEMA_TAG_RESOURCE_OUTPUT, consumer=_consumer) - return kwargs - -TAG_RESOURCE = APIOperation( - input=TagResourceInput, - output=TagResourceOutput, - schema=_SCHEMA_TAG_RESOURCE, - input_schema=_SCHEMA_TAG_RESOURCE_INPUT, - output_schema=_SCHEMA_TAG_RESOURCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.sns#AuthorizationErrorException" - ): AuthorizationErrorException, - ShapeID( - "com.amazonaws.sns#ConcurrentAccessException" - ): ConcurrentAccessException, - ShapeID( - "com.amazonaws.sns#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.sns#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.sns#StaleTagException"): StaleTagException, - ShapeID( - "com.amazonaws.sns#TagLimitExceededException" - ): TagLimitExceededException, - ShapeID("com.amazonaws.sns#TagPolicyException"): TagPolicyException, - } - ), +ADD_PERMISSION: APIOperation[AddPermissionInput, AddPermissionOutput] = APIOperation( + static_schema=_SCHEMA_ADD_PERMISSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sns#AuthorizationErrorException"), + ShapeID("com.amazonaws.sns#InternalErrorException"), + ShapeID("com.amazonaws.sns#InvalidParameterException"), + ShapeID("com.amazonaws.sns#NotFoundException"), + ], effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_AUTHORIZATION_ERROR_EXCEPTION, - _SCHEMA_CONCURRENT_ACCESS_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_STALE_TAG_EXCEPTION, - _SCHEMA_TAG_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_TAG_POLICY_EXCEPTION, +) + +CHECK_IF_PHONE_NUMBER_IS_OPTED_OUT: APIOperation[ + CheckIfPhoneNumberIsOptedOutInput, CheckIfPhoneNumberIsOptedOutOutput +] = APIOperation( + static_schema=_SCHEMA_CHECK_IF_PHONE_NUMBER_IS_OPTED_OUT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sns#AuthorizationErrorException"), + ShapeID("com.amazonaws.sns#InternalErrorException"), + ShapeID("com.amazonaws.sns#InvalidParameterException"), + ShapeID("com.amazonaws.sns#ThrottledException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) +CONFIRM_SUBSCRIPTION: APIOperation[ + ConfirmSubscriptionInput, ConfirmSubscriptionOutput +] = APIOperation( + static_schema=_SCHEMA_CONFIRM_SUBSCRIPTION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sns#AuthorizationErrorException"), + ShapeID("com.amazonaws.sns#FilterPolicyLimitExceededException"), + ShapeID("com.amazonaws.sns#InternalErrorException"), + ShapeID("com.amazonaws.sns#InvalidParameterException"), + ShapeID("com.amazonaws.sns#NotFoundException"), + ShapeID("com.amazonaws.sns#ReplayLimitExceededException"), + ShapeID("com.amazonaws.sns#SubscriptionLimitExceededException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -@dataclass(kw_only=True) -class UnsubscribeInput: - """Input for Unsubscribe action.""" +CREATE_PLATFORM_APPLICATION: APIOperation[ + CreatePlatformApplicationInput, CreatePlatformApplicationOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_PLATFORM_APPLICATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sns#AuthorizationErrorException"), + ShapeID("com.amazonaws.sns#InternalErrorException"), + ShapeID("com.amazonaws.sns#InvalidParameterException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - subscription_arn: str | None = None - """The ARN of the subscription to be deleted.""" +CREATE_PLATFORM_ENDPOINT: APIOperation[ + CreatePlatformEndpointInput, CreatePlatformEndpointOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_PLATFORM_ENDPOINT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sns#AuthorizationErrorException"), + ShapeID("com.amazonaws.sns#InternalErrorException"), + ShapeID("com.amazonaws.sns#InvalidParameterException"), + ShapeID("com.amazonaws.sns#NotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNSUBSCRIBE_INPUT, self) +CREATE_SMS_SANDBOX_PHONE_NUMBER: APIOperation[ + CreateSMSSandboxPhoneNumberInput, CreateSMSSandboxPhoneNumberOutput +] = APIOperation( + static_schema=_SCHEMA_CREATE_SMS_SANDBOX_PHONE_NUMBER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sns#AuthorizationErrorException"), + ShapeID("com.amazonaws.sns#InternalErrorException"), + ShapeID("com.amazonaws.sns#InvalidParameterException"), + ShapeID("com.amazonaws.sns#OptedOutException"), + ShapeID("com.amazonaws.sns#ThrottledException"), + ShapeID("com.amazonaws.sns#UserErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize_members(self, serializer: ShapeSerializer): - if self.subscription_arn is not None: - serializer.write_string( - _SCHEMA_UNSUBSCRIBE_INPUT.members["SubscriptionArn"], - self.subscription_arn, - ) +CREATE_TOPIC: APIOperation[CreateTopicInput, CreateTopicOutput] = APIOperation( + static_schema=_SCHEMA_CREATE_TOPIC, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sns#AuthorizationErrorException"), + ShapeID("com.amazonaws.sns#ConcurrentAccessException"), + ShapeID("com.amazonaws.sns#InternalErrorException"), + ShapeID("com.amazonaws.sns#InvalidParameterException"), + ShapeID("com.amazonaws.sns#InvalidSecurityException"), + ShapeID("com.amazonaws.sns#StaleTagException"), + ShapeID("com.amazonaws.sns#TagLimitExceededException"), + ShapeID("com.amazonaws.sns#TagPolicyException"), + ShapeID("com.amazonaws.sns#TopicLimitExceededException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) +DELETE_ENDPOINT: APIOperation[DeleteEndpointInput, DeleteEndpointOutput] = APIOperation( + static_schema=_SCHEMA_DELETE_ENDPOINT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sns#AuthorizationErrorException"), + ShapeID("com.amazonaws.sns#InternalErrorException"), + ShapeID("com.amazonaws.sns#InvalidParameterException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +DELETE_PLATFORM_APPLICATION: APIOperation[ + DeletePlatformApplicationInput, DeletePlatformApplicationOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_PLATFORM_APPLICATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sns#AuthorizationErrorException"), + ShapeID("com.amazonaws.sns#InternalErrorException"), + ShapeID("com.amazonaws.sns#InvalidParameterException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["subscription_arn"] = de.read_string( - _SCHEMA_UNSUBSCRIBE_INPUT.members["SubscriptionArn"] - ) +DELETE_SMS_SANDBOX_PHONE_NUMBER: APIOperation[ + DeleteSMSSandboxPhoneNumberInput, DeleteSMSSandboxPhoneNumberOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_SMS_SANDBOX_PHONE_NUMBER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sns#AuthorizationErrorException"), + ShapeID("com.amazonaws.sns#InternalErrorException"), + ShapeID("com.amazonaws.sns#InvalidParameterException"), + ShapeID("com.amazonaws.sns#ResourceNotFoundException"), + ShapeID("com.amazonaws.sns#ThrottledException"), + ShapeID("com.amazonaws.sns#UserErrorException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case _: - logger.debug("Unexpected member schema: %s", schema) +DELETE_TOPIC: APIOperation[DeleteTopicInput, DeleteTopicOutput] = APIOperation( + static_schema=_SCHEMA_DELETE_TOPIC, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sns#AuthorizationErrorException"), + ShapeID("com.amazonaws.sns#ConcurrentAccessException"), + ShapeID("com.amazonaws.sns#InternalErrorException"), + ShapeID("com.amazonaws.sns#InvalidParameterException"), + ShapeID("com.amazonaws.sns#InvalidStateException"), + ShapeID("com.amazonaws.sns#NotFoundException"), + ShapeID("com.amazonaws.sns#StaleTagException"), + ShapeID("com.amazonaws.sns#TagPolicyException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - deserializer.read_struct(_SCHEMA_UNSUBSCRIBE_INPUT, consumer=_consumer) - return kwargs +GET_DATA_PROTECTION_POLICY: APIOperation[ + GetDataProtectionPolicyInput, GetDataProtectionPolicyOutput +] = APIOperation( + static_schema=_SCHEMA_GET_DATA_PROTECTION_POLICY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sns#AuthorizationErrorException"), + ShapeID("com.amazonaws.sns#InternalErrorException"), + ShapeID("com.amazonaws.sns#InvalidParameterException"), + ShapeID("com.amazonaws.sns#InvalidSecurityException"), + ShapeID("com.amazonaws.sns#NotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +GET_ENDPOINT_ATTRIBUTES: APIOperation[ + GetEndpointAttributesInput, GetEndpointAttributesOutput +] = APIOperation( + static_schema=_SCHEMA_GET_ENDPOINT_ATTRIBUTES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sns#AuthorizationErrorException"), + ShapeID("com.amazonaws.sns#InternalErrorException"), + ShapeID("com.amazonaws.sns#InvalidParameterException"), + ShapeID("com.amazonaws.sns#NotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -@dataclass(kw_only=True) -class UnsubscribeOutput: - """Dataclass for UnsubscribeOutput structure.""" +GET_PLATFORM_APPLICATION_ATTRIBUTES: APIOperation[ + GetPlatformApplicationAttributesInput, GetPlatformApplicationAttributesOutput +] = APIOperation( + static_schema=_SCHEMA_GET_PLATFORM_APPLICATION_ATTRIBUTES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sns#AuthorizationErrorException"), + ShapeID("com.amazonaws.sns#InternalErrorException"), + ShapeID("com.amazonaws.sns#InvalidParameterException"), + ShapeID("com.amazonaws.sns#NotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False +GET_SMS_ATTRIBUTES: APIOperation[GetSMSAttributesInput, GetSMSAttributesOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_SMS_ATTRIBUTES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sns#AuthorizationErrorException"), + ShapeID("com.amazonaws.sns#InternalErrorException"), + ShapeID("com.amazonaws.sns#InvalidParameterException"), + ShapeID("com.amazonaws.sns#ThrottledException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNSUBSCRIBE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UNSUBSCRIBE_OUTPUT, consumer=_consumer) - return kwargs - +) -UNSUBSCRIBE = APIOperation( - input=UnsubscribeInput, - output=UnsubscribeOutput, - schema=_SCHEMA_UNSUBSCRIBE, - input_schema=_SCHEMA_UNSUBSCRIBE_INPUT, - output_schema=_SCHEMA_UNSUBSCRIBE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.sns#AuthorizationErrorException" - ): AuthorizationErrorException, - ShapeID("com.amazonaws.sns#InternalErrorException"): InternalErrorException, - ShapeID( - "com.amazonaws.sns#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.sns#InvalidSecurityException" - ): InvalidSecurityException, - ShapeID("com.amazonaws.sns#NotFoundException"): NotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_AUTHORIZATION_ERROR_EXCEPTION, - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_INVALID_SECURITY_EXCEPTION, - _SCHEMA_NOT_FOUND_EXCEPTION, +GET_SMS_SANDBOX_ACCOUNT_STATUS: APIOperation[ + GetSMSSandboxAccountStatusInput, GetSMSSandboxAccountStatusOutput +] = APIOperation( + static_schema=_SCHEMA_GET_SMS_SANDBOX_ACCOUNT_STATUS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sns#AuthorizationErrorException"), + ShapeID("com.amazonaws.sns#InternalErrorException"), + ShapeID("com.amazonaws.sns#ThrottledException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) +GET_SUBSCRIPTION_ATTRIBUTES: APIOperation[ + GetSubscriptionAttributesInput, GetSubscriptionAttributesOutput +] = APIOperation( + static_schema=_SCHEMA_GET_SUBSCRIPTION_ATTRIBUTES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sns#AuthorizationErrorException"), + ShapeID("com.amazonaws.sns#InternalErrorException"), + ShapeID("com.amazonaws.sns#InvalidParameterException"), + ShapeID("com.amazonaws.sns#NotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -def _serialize_tag_key_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_tag_key_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class UntagResourceInput: - """Dataclass for UntagResourceInput structure.""" - - resource_arn: str | None = None - """The ARN of the topic from which to remove tags.""" - - tag_keys: list[str] | None = None - """The list of tag keys to remove from the specified topic.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNTAG_RESOURCE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.resource_arn is not None: - serializer.write_string( - _SCHEMA_UNTAG_RESOURCE_INPUT.members["ResourceArn"], self.resource_arn - ) - - if self.tag_keys is not None: - _serialize_tag_key_list( - serializer, - _SCHEMA_UNTAG_RESOURCE_INPUT.members["TagKeys"], - self.tag_keys, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["resource_arn"] = de.read_string( - _SCHEMA_UNTAG_RESOURCE_INPUT.members["ResourceArn"] - ) +GET_TOPIC_ATTRIBUTES: APIOperation[ + GetTopicAttributesInput, GetTopicAttributesOutput +] = APIOperation( + static_schema=_SCHEMA_GET_TOPIC_ATTRIBUTES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sns#AuthorizationErrorException"), + ShapeID("com.amazonaws.sns#InternalErrorException"), + ShapeID("com.amazonaws.sns#InvalidParameterException"), + ShapeID("com.amazonaws.sns#InvalidSecurityException"), + ShapeID("com.amazonaws.sns#NotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 1: - kwargs["tag_keys"] = _deserialize_tag_key_list( - de, _SCHEMA_UNTAG_RESOURCE_INPUT.members["TagKeys"] - ) +LIST_ENDPOINTS_BY_PLATFORM_APPLICATION: APIOperation[ + ListEndpointsByPlatformApplicationInput, ListEndpointsByPlatformApplicationOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_ENDPOINTS_BY_PLATFORM_APPLICATION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sns#AuthorizationErrorException"), + ShapeID("com.amazonaws.sns#InternalErrorException"), + ShapeID("com.amazonaws.sns#InvalidParameterException"), + ShapeID("com.amazonaws.sns#NotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case _: - logger.debug("Unexpected member schema: %s", schema) +LIST_ORIGINATION_NUMBERS: APIOperation[ + ListOriginationNumbersInput, ListOriginationNumbersOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_ORIGINATION_NUMBERS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sns#AuthorizationErrorException"), + ShapeID("com.amazonaws.sns#InternalErrorException"), + ShapeID("com.amazonaws.sns#InvalidParameterException"), + ShapeID("com.amazonaws.sns#ThrottledException"), + ShapeID("com.amazonaws.sns#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - deserializer.read_struct(_SCHEMA_UNTAG_RESOURCE_INPUT, consumer=_consumer) - return kwargs +LIST_PHONE_NUMBERS_OPTED_OUT: APIOperation[ + ListPhoneNumbersOptedOutInput, ListPhoneNumbersOptedOutOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_PHONE_NUMBERS_OPTED_OUT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sns#AuthorizationErrorException"), + ShapeID("com.amazonaws.sns#InternalErrorException"), + ShapeID("com.amazonaws.sns#InvalidParameterException"), + ShapeID("com.amazonaws.sns#ThrottledException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +LIST_PLATFORM_APPLICATIONS: APIOperation[ + ListPlatformApplicationsInput, ListPlatformApplicationsOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_PLATFORM_APPLICATIONS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sns#AuthorizationErrorException"), + ShapeID("com.amazonaws.sns#InternalErrorException"), + ShapeID("com.amazonaws.sns#InvalidParameterException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -@dataclass(kw_only=True) -class UntagResourceOutput: - """Dataclass for UntagResourceOutput structure.""" +LIST_SMS_SANDBOX_PHONE_NUMBERS: APIOperation[ + ListSMSSandboxPhoneNumbersInput, ListSMSSandboxPhoneNumbersOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_SMS_SANDBOX_PHONE_NUMBERS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sns#AuthorizationErrorException"), + ShapeID("com.amazonaws.sns#InternalErrorException"), + ShapeID("com.amazonaws.sns#InvalidParameterException"), + ShapeID("com.amazonaws.sns#ResourceNotFoundException"), + ShapeID("com.amazonaws.sns#ThrottledException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False +LIST_SUBSCRIPTIONS: APIOperation[ListSubscriptionsInput, ListSubscriptionsOutput] = ( + APIOperation( + static_schema=_SCHEMA_LIST_SUBSCRIPTIONS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sns#AuthorizationErrorException"), + ShapeID("com.amazonaws.sns#InternalErrorException"), + ShapeID("com.amazonaws.sns#InvalidParameterException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNTAG_RESOURCE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UNTAG_RESOURCE_OUTPUT, consumer=_consumer) - return kwargs - +) -UNTAG_RESOURCE = APIOperation( - input=UntagResourceInput, - output=UntagResourceOutput, - schema=_SCHEMA_UNTAG_RESOURCE, - input_schema=_SCHEMA_UNTAG_RESOURCE_INPUT, - output_schema=_SCHEMA_UNTAG_RESOURCE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.sns#AuthorizationErrorException" - ): AuthorizationErrorException, - ShapeID( - "com.amazonaws.sns#ConcurrentAccessException" - ): ConcurrentAccessException, - ShapeID( - "com.amazonaws.sns#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.sns#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.sns#StaleTagException"): StaleTagException, - ShapeID( - "com.amazonaws.sns#TagLimitExceededException" - ): TagLimitExceededException, - ShapeID("com.amazonaws.sns#TagPolicyException"): TagPolicyException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_AUTHORIZATION_ERROR_EXCEPTION, - _SCHEMA_CONCURRENT_ACCESS_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_STALE_TAG_EXCEPTION, - _SCHEMA_TAG_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_TAG_POLICY_EXCEPTION, +LIST_SUBSCRIPTIONS_BY_TOPIC: APIOperation[ + ListSubscriptionsByTopicInput, ListSubscriptionsByTopicOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_SUBSCRIPTIONS_BY_TOPIC, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sns#AuthorizationErrorException"), + ShapeID("com.amazonaws.sns#InternalErrorException"), + ShapeID("com.amazonaws.sns#InvalidParameterException"), + ShapeID("com.amazonaws.sns#NotFoundException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) +LIST_TAGS_FOR_RESOURCE: APIOperation[ + ListTagsForResourceInput, ListTagsForResourceOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_TAGS_FOR_RESOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sns#AuthorizationErrorException"), + ShapeID("com.amazonaws.sns#ConcurrentAccessException"), + ShapeID("com.amazonaws.sns#InvalidParameterException"), + ShapeID("com.amazonaws.sns#ResourceNotFoundException"), + ShapeID("com.amazonaws.sns#TagPolicyException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -@dataclass(kw_only=True) -class VerificationException(ServiceError): - """ - Indicates that the one-time password (OTP) used for verification is - invalid. - """ - - fault: Literal["client", "server"] | None = "client" - - status: str - """The status of the verification error.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VERIFICATION_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_VERIFICATION_EXCEPTION.members["Message"], self.message - ) - serializer.write_string( - _SCHEMA_VERIFICATION_EXCEPTION.members["Status"], self.status - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_VERIFICATION_EXCEPTION.members["Message"] - ) - - case 1: - kwargs["status"] = de.read_string( - _SCHEMA_VERIFICATION_EXCEPTION.members["Status"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_VERIFICATION_EXCEPTION, consumer=_consumer) - if "status" not in kwargs: - kwargs["status"] = "" - return kwargs - - -@dataclass(kw_only=True) -class VerifySMSSandboxPhoneNumberInput: - """Dataclass for VerifySMSSandboxPhoneNumberInput structure.""" - - phone_number: str | None = field(repr=False, default=None) - """The destination phone number to verify.""" - - one_time_password: str | None = None - """ - The OTP sent to the destination number from the - `CreateSMSSandBoxPhoneNumber` call. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VERIFY_SMS_SANDBOX_PHONE_NUMBER_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.phone_number is not None: - serializer.write_string( - _SCHEMA_VERIFY_SMS_SANDBOX_PHONE_NUMBER_INPUT.members["PhoneNumber"], - self.phone_number, - ) - - if self.one_time_password is not None: - serializer.write_string( - _SCHEMA_VERIFY_SMS_SANDBOX_PHONE_NUMBER_INPUT.members[ - "OneTimePassword" - ], - self.one_time_password, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) +LIST_TOPICS: APIOperation[ListTopicsInput, ListTopicsOutput] = APIOperation( + static_schema=_SCHEMA_LIST_TOPICS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sns#AuthorizationErrorException"), + ShapeID("com.amazonaws.sns#InternalErrorException"), + ShapeID("com.amazonaws.sns#InvalidParameterException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +OPT_IN_PHONE_NUMBER: APIOperation[OptInPhoneNumberInput, OptInPhoneNumberOutput] = ( + APIOperation( + static_schema=_SCHEMA_OPT_IN_PHONE_NUMBER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sns#AuthorizationErrorException"), + ShapeID("com.amazonaws.sns#InternalErrorException"), + ShapeID("com.amazonaws.sns#InvalidParameterException"), + ShapeID("com.amazonaws.sns#ThrottledException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["phone_number"] = de.read_string( - _SCHEMA_VERIFY_SMS_SANDBOX_PHONE_NUMBER_INPUT.members[ - "PhoneNumber" - ] - ) +PUBLISH: APIOperation[PublishInput, PublishOutput] = APIOperation( + static_schema=_SCHEMA_PUBLISH, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sns#AuthorizationErrorException"), + ShapeID("com.amazonaws.sns#EndpointDisabledException"), + ShapeID("com.amazonaws.sns#InternalErrorException"), + ShapeID("com.amazonaws.sns#InvalidParameterException"), + ShapeID("com.amazonaws.sns#InvalidParameterValueException"), + ShapeID("com.amazonaws.sns#InvalidSecurityException"), + ShapeID("com.amazonaws.sns#KMSAccessDeniedException"), + ShapeID("com.amazonaws.sns#KMSDisabledException"), + ShapeID("com.amazonaws.sns#KMSInvalidStateException"), + ShapeID("com.amazonaws.sns#KMSNotFoundException"), + ShapeID("com.amazonaws.sns#KMSOptInRequired"), + ShapeID("com.amazonaws.sns#KMSThrottlingException"), + ShapeID("com.amazonaws.sns#NotFoundException"), + ShapeID("com.amazonaws.sns#PlatformApplicationDisabledException"), + ShapeID("com.amazonaws.sns#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 1: - kwargs["one_time_password"] = de.read_string( - _SCHEMA_VERIFY_SMS_SANDBOX_PHONE_NUMBER_INPUT.members[ - "OneTimePassword" - ] - ) +PUBLISH_BATCH: APIOperation[PublishBatchInput, PublishBatchOutput] = APIOperation( + static_schema=_SCHEMA_PUBLISH_BATCH, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sns#AuthorizationErrorException"), + ShapeID("com.amazonaws.sns#BatchEntryIdsNotDistinctException"), + ShapeID("com.amazonaws.sns#BatchRequestTooLongException"), + ShapeID("com.amazonaws.sns#EmptyBatchRequestException"), + ShapeID("com.amazonaws.sns#EndpointDisabledException"), + ShapeID("com.amazonaws.sns#InternalErrorException"), + ShapeID("com.amazonaws.sns#InvalidBatchEntryIdException"), + ShapeID("com.amazonaws.sns#InvalidParameterException"), + ShapeID("com.amazonaws.sns#InvalidParameterValueException"), + ShapeID("com.amazonaws.sns#InvalidSecurityException"), + ShapeID("com.amazonaws.sns#KMSAccessDeniedException"), + ShapeID("com.amazonaws.sns#KMSDisabledException"), + ShapeID("com.amazonaws.sns#KMSInvalidStateException"), + ShapeID("com.amazonaws.sns#KMSNotFoundException"), + ShapeID("com.amazonaws.sns#KMSOptInRequired"), + ShapeID("com.amazonaws.sns#KMSThrottlingException"), + ShapeID("com.amazonaws.sns#NotFoundException"), + ShapeID("com.amazonaws.sns#PlatformApplicationDisabledException"), + ShapeID("com.amazonaws.sns#TooManyEntriesInBatchRequestException"), + ShapeID("com.amazonaws.sns#ValidationException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case _: - logger.debug("Unexpected member schema: %s", schema) +PUT_DATA_PROTECTION_POLICY: APIOperation[ + PutDataProtectionPolicyInput, PutDataProtectionPolicyOutput +] = APIOperation( + static_schema=_SCHEMA_PUT_DATA_PROTECTION_POLICY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sns#AuthorizationErrorException"), + ShapeID("com.amazonaws.sns#InternalErrorException"), + ShapeID("com.amazonaws.sns#InvalidParameterException"), + ShapeID("com.amazonaws.sns#InvalidSecurityException"), + ShapeID("com.amazonaws.sns#NotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - deserializer.read_struct( - _SCHEMA_VERIFY_SMS_SANDBOX_PHONE_NUMBER_INPUT, consumer=_consumer - ) - return kwargs +REMOVE_PERMISSION: APIOperation[RemovePermissionInput, RemovePermissionOutput] = ( + APIOperation( + static_schema=_SCHEMA_REMOVE_PERMISSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sns#AuthorizationErrorException"), + ShapeID("com.amazonaws.sns#InternalErrorException"), + ShapeID("com.amazonaws.sns#InvalidParameterException"), + ShapeID("com.amazonaws.sns#NotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], + ) +) +SET_ENDPOINT_ATTRIBUTES: APIOperation[ + SetEndpointAttributesInput, SetEndpointAttributesOutput +] = APIOperation( + static_schema=_SCHEMA_SET_ENDPOINT_ATTRIBUTES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sns#AuthorizationErrorException"), + ShapeID("com.amazonaws.sns#InternalErrorException"), + ShapeID("com.amazonaws.sns#InvalidParameterException"), + ShapeID("com.amazonaws.sns#NotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -@dataclass(kw_only=True) -class VerifySMSSandboxPhoneNumberOutput: - """The destination phone number's verification status.""" +SET_PLATFORM_APPLICATION_ATTRIBUTES: APIOperation[ + SetPlatformApplicationAttributesInput, SetPlatformApplicationAttributesOutput +] = APIOperation( + static_schema=_SCHEMA_SET_PLATFORM_APPLICATION_ATTRIBUTES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sns#AuthorizationErrorException"), + ShapeID("com.amazonaws.sns#InternalErrorException"), + ShapeID("com.amazonaws.sns#InvalidParameterException"), + ShapeID("com.amazonaws.sns#NotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False +SET_SMS_ATTRIBUTES: APIOperation[SetSMSAttributesInput, SetSMSAttributesOutput] = ( + APIOperation( + static_schema=_SCHEMA_SET_SMS_ATTRIBUTES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sns#AuthorizationErrorException"), + ShapeID("com.amazonaws.sns#InternalErrorException"), + ShapeID("com.amazonaws.sns#InvalidParameterException"), + ShapeID("com.amazonaws.sns#ThrottledException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_VERIFY_SMS_SANDBOX_PHONE_NUMBER_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass +) - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) +SET_SUBSCRIPTION_ATTRIBUTES: APIOperation[ + SetSubscriptionAttributesInput, SetSubscriptionAttributesOutput +] = APIOperation( + static_schema=_SCHEMA_SET_SUBSCRIPTION_ATTRIBUTES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sns#AuthorizationErrorException"), + ShapeID("com.amazonaws.sns#FilterPolicyLimitExceededException"), + ShapeID("com.amazonaws.sns#InternalErrorException"), + ShapeID("com.amazonaws.sns#InvalidParameterException"), + ShapeID("com.amazonaws.sns#NotFoundException"), + ShapeID("com.amazonaws.sns#ReplayLimitExceededException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +SET_TOPIC_ATTRIBUTES: APIOperation[ + SetTopicAttributesInput, SetTopicAttributesOutput +] = APIOperation( + static_schema=_SCHEMA_SET_TOPIC_ATTRIBUTES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sns#AuthorizationErrorException"), + ShapeID("com.amazonaws.sns#InternalErrorException"), + ShapeID("com.amazonaws.sns#InvalidParameterException"), + ShapeID("com.amazonaws.sns#InvalidSecurityException"), + ShapeID("com.amazonaws.sns#NotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) +SUBSCRIBE: APIOperation[SubscribeInput, SubscribeOutput] = APIOperation( + static_schema=_SCHEMA_SUBSCRIBE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sns#AuthorizationErrorException"), + ShapeID("com.amazonaws.sns#FilterPolicyLimitExceededException"), + ShapeID("com.amazonaws.sns#InternalErrorException"), + ShapeID("com.amazonaws.sns#InvalidParameterException"), + ShapeID("com.amazonaws.sns#InvalidSecurityException"), + ShapeID("com.amazonaws.sns#NotFoundException"), + ShapeID("com.amazonaws.sns#ReplayLimitExceededException"), + ShapeID("com.amazonaws.sns#SubscriptionLimitExceededException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - deserializer.read_struct( - _SCHEMA_VERIFY_SMS_SANDBOX_PHONE_NUMBER_OUTPUT, consumer=_consumer - ) - return kwargs +TAG_RESOURCE: APIOperation[TagResourceInput, TagResourceOutput] = APIOperation( + static_schema=_SCHEMA_TAG_RESOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sns#AuthorizationErrorException"), + ShapeID("com.amazonaws.sns#ConcurrentAccessException"), + ShapeID("com.amazonaws.sns#InvalidParameterException"), + ShapeID("com.amazonaws.sns#ResourceNotFoundException"), + ShapeID("com.amazonaws.sns#StaleTagException"), + ShapeID("com.amazonaws.sns#TagLimitExceededException"), + ShapeID("com.amazonaws.sns#TagPolicyException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +UNSUBSCRIBE: APIOperation[UnsubscribeInput, UnsubscribeOutput] = APIOperation( + static_schema=_SCHEMA_UNSUBSCRIBE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sns#AuthorizationErrorException"), + ShapeID("com.amazonaws.sns#InternalErrorException"), + ShapeID("com.amazonaws.sns#InvalidParameterException"), + ShapeID("com.amazonaws.sns#InvalidSecurityException"), + ShapeID("com.amazonaws.sns#NotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -VERIFY_SMS_SANDBOX_PHONE_NUMBER = APIOperation( - input=VerifySMSSandboxPhoneNumberInput, - output=VerifySMSSandboxPhoneNumberOutput, - schema=_SCHEMA_VERIFY_SMS_SANDBOX_PHONE_NUMBER, - input_schema=_SCHEMA_VERIFY_SMS_SANDBOX_PHONE_NUMBER_INPUT, - output_schema=_SCHEMA_VERIFY_SMS_SANDBOX_PHONE_NUMBER_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.sns#AuthorizationErrorException" - ): AuthorizationErrorException, - ShapeID("com.amazonaws.sns#InternalErrorException"): InternalErrorException, - ShapeID( - "com.amazonaws.sns#InvalidParameterException" - ): InvalidParameterException, - ShapeID( - "com.amazonaws.sns#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.sns#ThrottledException"): ThrottledException, - ShapeID("com.amazonaws.sns#VerificationException"): VerificationException, - } - ), +UNTAG_RESOURCE: APIOperation[UntagResourceInput, UntagResourceOutput] = APIOperation( + static_schema=_SCHEMA_UNTAG_RESOURCE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sns#AuthorizationErrorException"), + ShapeID("com.amazonaws.sns#ConcurrentAccessException"), + ShapeID("com.amazonaws.sns#InvalidParameterException"), + ShapeID("com.amazonaws.sns#ResourceNotFoundException"), + ShapeID("com.amazonaws.sns#StaleTagException"), + ShapeID("com.amazonaws.sns#TagLimitExceededException"), + ShapeID("com.amazonaws.sns#TagPolicyException"), + ], effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_AUTHORIZATION_ERROR_EXCEPTION, - _SCHEMA_INTERNAL_ERROR_EXCEPTION, - _SCHEMA_INVALID_PARAMETER_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_THROTTLED_EXCEPTION, - _SCHEMA_VERIFICATION_EXCEPTION, +) + +VERIFY_SMS_SANDBOX_PHONE_NUMBER: APIOperation[ + VerifySMSSandboxPhoneNumberInput, VerifySMSSandboxPhoneNumberOutput +] = APIOperation( + static_schema=_SCHEMA_VERIFY_SMS_SANDBOX_PHONE_NUMBER, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sns#AuthorizationErrorException"), + ShapeID("com.amazonaws.sns#InternalErrorException"), + ShapeID("com.amazonaws.sns#InvalidParameterException"), + ShapeID("com.amazonaws.sns#ResourceNotFoundException"), + ShapeID("com.amazonaws.sns#ThrottledException"), + ShapeID("com.amazonaws.sns#VerificationException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) diff --git a/clients/aws-sdk-sns/src/aws_sdk_sns/models.pyi b/clients/aws-sdk-sns/src/aws_sdk_sns/models.pyi new file mode 100644 index 00000000..e6c96dd6 --- /dev/null +++ b/clients/aws-sdk-sns/src/aws_sdk_sns/models.pyi @@ -0,0 +1,3183 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. + +from dataclasses import dataclass +from datetime import datetime +from enum import StrEnum +from typing import Self + +from smithy_core.deserializers import ShapeDeserializer +from smithy_core.exceptions import ModeledError +from smithy_core.response import ResponseMetadata +from smithy_core.schemas import APIOperation +from smithy_core.serializers import ShapeSerializer +from smithy_core.types import UnknownEnumMixin + +class _SerdeShape: + def serialize(self, serializer: ShapeSerializer) -> None: ... + def serialize_members(self, serializer: ShapeSerializer) -> None: ... + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: ... + +class ServiceError(ModeledError): + """ + Base error for all errors in the service. + + Some exceptions do not extend from this class, including + synthetic, implicit, and shared exception types. + """ + +@dataclass(kw_only=True) +class AddPermissionInput(_SerdeShape): + """Dataclass for AddPermissionInput structure.""" + + topic_arn: str | None = ... + """The ARN of the topic whose access control policy you wish to modify.""" + label: str | None = ... + """A unique identifier for the new policy statement.""" + aws_account_id: list[str] | None = ... + """ + The Amazon Web Services account IDs of the users (principals) who will + be given access to the specified actions. The users must have Amazon Web + Services account, but do not need to be signed up for this service. + """ + action_name: list[str] | None = ... + """ + The action you want to allow for the specified principal(s). + + Valid values: Any Amazon SNS action name, for example `Publish`. + """ + +@dataclass(kw_only=True) +class AddPermissionOutput(_SerdeShape): + """Dataclass for AddPermissionOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class AuthorizationErrorException(ServiceError, _SerdeShape): + """ + Indicates that the user has been denied access to the requested + resource. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class BatchEntryIdsNotDistinctException(ServiceError, _SerdeShape): + """Two or more batch entries in the request have the same `Id`.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class BatchRequestTooLongException(ServiceError, _SerdeShape): + """ + The length of all the batch messages put together is more than the + limit. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class BatchResultErrorEntry(_SerdeShape): + """Gives a detailed description of failed messages in the batch.""" + + id: str + """The `Id` of an entry in a batch request""" + code: str + """An error code representing why the action failed on this entry.""" + message: str | None = ... + """A message explaining why the action failed on this entry.""" + sender_fault: bool = ... + """ + Specifies whether the error happened due to the caller of the batch API + action. + """ + +@dataclass(kw_only=True) +class CheckIfPhoneNumberIsOptedOutInput(_SerdeShape): + """The input for the `CheckIfPhoneNumberIsOptedOut` action.""" + + phone_number: str | None = ... + """The phone number for which you want to check the opt out status.""" + +@dataclass(kw_only=True) +class CheckIfPhoneNumberIsOptedOutOutput(_SerdeShape): + """The response from the `CheckIfPhoneNumberIsOptedOut` action.""" + + is_opted_out: bool = ... + """ + Indicates whether the phone number is opted out: + + - `true` -- The phone number is opted out, meaning you cannot publish + SMS messages to it. + + - `false` -- The phone number is opted in, meaning you can publish SMS + messages to it. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ConcurrentAccessException(ServiceError, _SerdeShape): + """ + Can't perform multiple operations on a tag simultaneously. Perform the + operations sequentially. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ConfirmSubscriptionInput(_SerdeShape): + """Input for ConfirmSubscription action.""" + + topic_arn: str | None = ... + """The ARN of the topic for which you wish to confirm a subscription.""" + token: str | None = ... + """Short-lived token sent to an endpoint during the `Subscribe` action.""" + authenticate_on_unsubscribe: str | None = ... + """ + Disallows unauthenticated unsubscribes of the subscription. If the value + of this parameter is `true` and the request has an Amazon Web Services + signature, then only the topic owner and the subscription owner can + unsubscribe the endpoint. The unsubscribe action requires Amazon Web + Services authentication. + """ + +@dataclass(kw_only=True) +class ConfirmSubscriptionOutput(_SerdeShape): + """Response for ConfirmSubscriptions action.""" + + subscription_arn: str | None = ... + """The ARN of the created subscription.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreatePlatformApplicationInput(_SerdeShape): + """Input for CreatePlatformApplication action.""" + + name: str | None = ... + """ + Application names must be made up of only uppercase and lowercase ASCII + letters, numbers, underscores, hyphens, and periods, and must be between + 1 and 256 characters long. + """ + platform: str | None = ... + """ + The following platforms are supported: ADM (Amazon Device Messaging), + APNS (Apple Push Notification Service), APNS_SANDBOX, and GCM (Firebase + Cloud Messaging). + """ + attributes: dict[str, str] | None = ... + """ + For a list of attributes, see + [`SetPlatformApplicationAttributes`](https://docs.aws.amazon.com/sns/latest/api/API_SetPlatformApplicationAttributes.html) + . + """ + +@dataclass(kw_only=True) +class CreatePlatformApplicationOutput(_SerdeShape): + """Response from CreatePlatformApplication action.""" + + platform_application_arn: str | None = ... + """`PlatformApplicationArn` is returned.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreatePlatformEndpointInput(_SerdeShape): + """Input for CreatePlatformEndpoint action.""" + + platform_application_arn: str | None = ... + """ + `PlatformApplicationArn` returned from CreatePlatformApplication is used + to create a an endpoint. + """ + token: str | None = ... + """ + Unique identifier created by the notification service for an app on a + device. The specific name for Token will vary, depending on which + notification service is being used. For example, when using APNS as the + notification service, you need the device token. Alternatively, when + using GCM (Firebase Cloud Messaging) or ADM, the device token equivalent + is called the registration ID. + """ + custom_user_data: str | None = ... + """ + Arbitrary user data to associate with the endpoint. Amazon SNS does not + use this data. The data must be in UTF-8 format and less than 2KB. + """ + attributes: dict[str, str] | None = ... + """ + For a list of attributes, see + [`SetEndpointAttributes`](https://docs.aws.amazon.com/sns/latest/api/API_SetEndpointAttributes.html) + . + """ + +@dataclass(kw_only=True) +class CreatePlatformEndpointOutput(_SerdeShape): + """Response from CreateEndpoint action.""" + + endpoint_arn: str | None = ... + """EndpointArn returned from CreateEndpoint action.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateSMSSandboxPhoneNumberInput(_SerdeShape): + """Dataclass for CreateSMSSandboxPhoneNumberInput structure.""" + + phone_number: str | None = ... + """ + The destination phone number to verify. On verification, Amazon SNS adds + this phone number to the list of verified phone numbers that you can + send SMS messages to. + """ + language_code: str | None = ... + """The language to use for sending the OTP. The default value is `en-US`.""" + +@dataclass(kw_only=True) +class CreateSMSSandboxPhoneNumberOutput(_SerdeShape): + """Dataclass for CreateSMSSandboxPhoneNumberOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateTopicInput(_SerdeShape): + """Input for CreateTopic action.""" + + name: str | None = ... + """ + The name of the topic you want to create. + + Constraints: Topic names must be made up of only uppercase and lowercase + ASCII letters, numbers, underscores, and hyphens, and must be between 1 + and 256 characters long. + + For a FIFO (first-in-first-out) topic, the name must end with the + `.fifo` suffix. + """ + attributes: dict[str, str] | None = ... + """ + A map of attributes with their corresponding values. + + The following lists names, descriptions, and values of the special + request parameters that the `CreateTopic` action uses: + + - `DeliveryPolicy` -- The policy that defines how Amazon SNS retries + failed deliveries to HTTP/S endpoints. + + - `DisplayName` -- The display name to use for a topic with SMS, + `email`, and `email-json` subscriptions. For `email` and `email-json` + subscriptions, the display name is used as the sender name for regular + notification messages. Subscription confirmation and unsubscribe + confirmation emails always use \"Amazon Web Services Notifications\" + as the sender name. + + - `MaximumMessageSize` -- The maximum size, in bytes, of a message that + can be published to the topic. Valid values are `1024` to `1048576` (1 + MiB). The default is `262144` (256 KiB). + + A topic with a `MaximumMessageSize` above 256 KiB must have 100 or + fewer subscriptions, and each subscription must be an Amazon SQS, + Amazon Data Firehose, or Lambda subscription. + + - `Policy` -- The policy that defines who can access your topic. By + default, only the topic owner can publish or subscribe to the topic. + + - `TracingConfig` -- Tracing mode of an Amazon SNS topic. By default + `TracingConfig` is set to `PassThrough`, and the topic passes through + the tracing header it receives from an Amazon SNS publisher to its + subscriptions. If set to `Active`, Amazon SNS will vend X-Ray segment + data to topic owner account if the sampled flag in the tracing header + is true. This is only supported on standard topics. + + - HTTP + + - `HTTPSuccessFeedbackRoleArn` -- Indicates successful message + delivery status for an Amazon SNS topic that is subscribed to an + HTTP endpoint. + + - `HTTPSuccessFeedbackSampleRate` -- Indicates percentage of + successful messages to sample for an Amazon SNS topic that is + subscribed to an HTTP endpoint. + + - `HTTPFailureFeedbackRoleArn` -- Indicates failed message delivery + status for an Amazon SNS topic that is subscribed to an HTTP + endpoint. + + - Amazon Data Firehose + + - `FirehoseSuccessFeedbackRoleArn` -- Indicates successful message + delivery status for an Amazon SNS topic that is subscribed to an + Amazon Data Firehose endpoint. + + - `FirehoseSuccessFeedbackSampleRate` -- Indicates percentage of + successful messages to sample for an Amazon SNS topic that is + subscribed to an Amazon Data Firehose endpoint. + + - `FirehoseFailureFeedbackRoleArn` -- Indicates failed message + delivery status for an Amazon SNS topic that is subscribed to an + Amazon Data Firehose endpoint. + + - Lambda + + - `LambdaSuccessFeedbackRoleArn` -- Indicates successful message + delivery status for an Amazon SNS topic that is subscribed to an + Lambda endpoint. + + - `LambdaSuccessFeedbackSampleRate` -- Indicates percentage of + successful messages to sample for an Amazon SNS topic that is + subscribed to an Lambda endpoint. + + - `LambdaFailureFeedbackRoleArn` -- Indicates failed message delivery + status for an Amazon SNS topic that is subscribed to an Lambda + endpoint. + + - Platform application endpoint + + - `ApplicationSuccessFeedbackRoleArn` -- Indicates successful message + delivery status for an Amazon SNS topic that is subscribed to a + platform application endpoint. + + - `ApplicationSuccessFeedbackSampleRate` -- Indicates percentage of + successful messages to sample for an Amazon SNS topic that is + subscribed to an platform application endpoint. + + - `ApplicationFailureFeedbackRoleArn` -- Indicates failed message + delivery status for an Amazon SNS topic that is subscribed to an + platform application endpoint. + + Note: + In addition to being able to configure topic attributes for message + delivery status of notification messages sent to Amazon SNS + application endpoints, you can also configure application attributes + for the delivery status of push notification messages sent to push + notification services. + + For example, For more information, see [Using Amazon SNS Application + Attributes for Message Delivery + Status](https://docs.aws.amazon.com/sns/latest/dg/sns-msg-status.html). + + - Amazon SQS + + - `SQSSuccessFeedbackRoleArn` -- Indicates successful message delivery + status for an Amazon SNS topic that is subscribed to an Amazon SQS + endpoint. + + - `SQSSuccessFeedbackSampleRate` -- Indicates percentage of successful + messages to sample for an Amazon SNS topic that is subscribed to an + Amazon SQS endpoint. + + - `SQSFailureFeedbackRoleArn` -- Indicates failed message delivery + status for an Amazon SNS topic that is subscribed to an Amazon SQS + endpoint. + + Note: + The ``{=html}SuccessFeedbackRoleArn and + ``{=html}FailureFeedbackRoleArn attributes are used to give + Amazon SNS write access to use CloudWatch Logs on your behalf. The + ``{=html}SuccessFeedbackSampleRate attribute is for specifying + the sample rate percentage (0-100) of successfully delivered messages. + After you configure the ``{=html}FailureFeedbackRoleArn + attribute, then all failed message deliveries generate CloudWatch Logs. + + The following attribute applies only to [server-side + encryption](https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html): + + - `KmsMasterKeyId` -- The ID of an Amazon Web Services managed customer + master key (CMK) for Amazon SNS or a custom CMK. For more information, + see [Key + Terms](https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html#sse-key-terms). + For more examples, see + [KeyId](https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters) + in the *Key Management Service API Reference*. + + The following attributes apply only to [FIFO + topics](https://docs.aws.amazon.com/sns/latest/dg/sns-fifo-topics.html): + + - `ArchivePolicy` -- The policy that sets the retention period for + messages stored in the message archive of an Amazon SNS FIFO topic. + + - `ContentBasedDeduplication` -- Enables content-based deduplication for + FIFO topics. + + - By default, `ContentBasedDeduplication` is set to `false`. If you + create a FIFO topic and this attribute is `false`, you must specify + a value for the `MessageDeduplicationId` parameter for the + [Publish](https://docs.aws.amazon.com/sns/latest/api/API_Publish.html) + action. + + - When you set `ContentBasedDeduplication` to `true`, Amazon SNS uses + a SHA-256 hash to generate the `MessageDeduplicationId` using the + body of the message (but not the attributes of the message). + + (Optional) To override the generated value, you can specify a value + for the `MessageDeduplicationId` parameter for the `Publish` action. + + + + - `FifoThroughputScope` -- Enables higher throughput for your FIFO topic + by adjusting the scope of deduplication. This attribute has two + possible values: + + - `Topic` -- The scope of message deduplication is across the entire + topic. This is the default value and maintains existing behavior, + with a maximum throughput of 3000 messages per second or 20MB per + second, whichever comes first. + + - `MessageGroup` -- The scope of deduplication is within each + individual message group, which enables higher throughput per topic + subject to regional quotas. For more information on quotas or to + request an increase, see [Amazon SNS service + quotas](https://docs.aws.amazon.com/general/latest/gr/sns.html) in + the Amazon Web Services General Reference. + """ + tags: list[Tag] | None = ... + """ + The list of tags to add to a new topic. + + Note: + To be able to tag a topic on creation, you must have the + `sns:CreateTopic` and `sns:TagResource` permissions. + """ + data_protection_policy: str | None = ... + """ + Warning: + Amazon SNS message data protection is no longer available to new + customers. For more information and guidance on alternatives, see + [Amazon SNS message data protection availability + change](https://docs.aws.amazon.com/sns/latest/dg/sns-message-data-protection-availability-change.html). + + The body of the policy document you want to use for this topic. + + You can only add one policy per topic. + + The policy must be in JSON string format. + + Length Constraints: Maximum length of 30,720. + """ + +@dataclass(kw_only=True) +class CreateTopicOutput(_SerdeShape): + """Response from CreateTopic action.""" + + topic_arn: str | None = ... + """The Amazon Resource Name (ARN) assigned to the created topic.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteEndpointInput(_SerdeShape): + """Input for `DeleteEndpoint` action.""" + + endpoint_arn: str | None = ... + """`EndpointArn` of endpoint to delete.""" + +@dataclass(kw_only=True) +class DeleteEndpointOutput(_SerdeShape): + """Dataclass for DeleteEndpointOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeletePlatformApplicationInput(_SerdeShape): + """Input for `DeletePlatformApplication` action.""" + + platform_application_arn: str | None = ... + """`PlatformApplicationArn` of platform application object to delete.""" + +@dataclass(kw_only=True) +class DeletePlatformApplicationOutput(_SerdeShape): + """Dataclass for DeletePlatformApplicationOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteSMSSandboxPhoneNumberInput(_SerdeShape): + """Dataclass for DeleteSMSSandboxPhoneNumberInput structure.""" + + phone_number: str | None = ... + """The destination phone number to delete.""" + +@dataclass(kw_only=True) +class DeleteSMSSandboxPhoneNumberOutput(_SerdeShape): + """Dataclass for DeleteSMSSandboxPhoneNumberOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteTopicInput(_SerdeShape): + """Dataclass for DeleteTopicInput structure.""" + + topic_arn: str | None = ... + """The ARN of the topic you want to delete.""" + +@dataclass(kw_only=True) +class DeleteTopicOutput(_SerdeShape): + """Dataclass for DeleteTopicOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class EmptyBatchRequestException(ServiceError, _SerdeShape): + """The batch request doesn't contain any entries.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class Endpoint(_SerdeShape): + """The endpoint for mobile app and device.""" + + endpoint_arn: str | None = ... + """The `EndpointArn` for mobile app and device.""" + attributes: dict[str, str] | None = ... + """Attributes for endpoint.""" + +@dataclass(kw_only=True) +class EndpointDisabledException(ServiceError, _SerdeShape): + """Exception error indicating endpoint disabled.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class FilterPolicyLimitExceededException(ServiceError, _SerdeShape): + """ + Indicates that the number of filter polices in your Amazon Web Services + account exceeds the limit. To add more filter polices, submit an Amazon + SNS Limit Increase case in the Amazon Web Services Support Center. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetDataProtectionPolicyInput(_SerdeShape): + """Dataclass for GetDataProtectionPolicyInput structure.""" + + resource_arn: str | None = ... + """ + The ARN of the topic whose `DataProtectionPolicy` you want to get. + + For more information about ARNs, see [Amazon Resource Names + (ARNs)](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + in the Amazon Web Services General Reference. + """ + +@dataclass(kw_only=True) +class GetDataProtectionPolicyOutput(_SerdeShape): + """Dataclass for GetDataProtectionPolicyOutput structure.""" + + data_protection_policy: str | None = ... + """Retrieves the `DataProtectionPolicy` in JSON string format.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetEndpointAttributesInput(_SerdeShape): + """Input for `GetEndpointAttributes` action.""" + + endpoint_arn: str | None = ... + """`EndpointArn` for `GetEndpointAttributes` input.""" + +@dataclass(kw_only=True) +class GetEndpointAttributesOutput(_SerdeShape): + """Response from `GetEndpointAttributes` of the `EndpointArn`.""" + + attributes: dict[str, str] | None = ... + """ + Attributes include the following: + + - `CustomUserData` -- arbitrary user data to associate with the + endpoint. Amazon SNS does not use this data. The data must be in UTF-8 + format and less than 2KB. + + - `Enabled` -- flag that enables/disables delivery to the endpoint. + Amazon SNS will set this to false when a notification service + indicates to Amazon SNS that the endpoint is invalid. Users can set it + back to true, typically after updating Token. + + - `Token` -- device token, also referred to as a registration id, for an + app and mobile device. This is returned from the notification service + when an app and mobile device are registered with the notification + service. + + Note: + The device token for the iOS platform is returned in lowercase. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetPlatformApplicationAttributesInput(_SerdeShape): + """Input for `GetPlatformApplicationAttributes` action.""" + + platform_application_arn: str | None = ... + """`PlatformApplicationArn` for GetPlatformApplicationAttributesInput.""" + +@dataclass(kw_only=True) +class GetPlatformApplicationAttributesOutput(_SerdeShape): + """Response for `GetPlatformApplicationAttributes` action.""" + + attributes: dict[str, str] | None = ... + """ + Attributes include the following: + + - `AppleCertificateExpiryDate` -- The expiry date of the SSL certificate + used to configure certificate-based authentication. + + - `ApplePlatformTeamID` -- The Apple developer account ID used to + configure token-based authentication. + + - `ApplePlatformBundleID` -- The app identifier used to configure + token-based authentication. + + - `AuthenticationMethod` -- Returns the credential type used when + sending push notifications from application to APNS/APNS_Sandbox, or + application to GCM. + + - APNS -- Returns the token or certificate. + + - GCM -- Returns the token or key. + + - `EventEndpointCreated` -- Topic ARN to which EndpointCreated event + notifications should be sent. + + - `EventEndpointDeleted` -- Topic ARN to which EndpointDeleted event + notifications should be sent. + + - `EventEndpointUpdated` -- Topic ARN to which EndpointUpdate event + notifications should be sent. + + - `EventDeliveryFailure` -- Topic ARN to which DeliveryFailure event + notifications should be sent upon Direct Publish delivery failure + (permanent) to one of the application's endpoints. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetSMSAttributesInput(_SerdeShape): + """The input for the `GetSMSAttributes` request.""" + + attributes: list[str] | None = ... + """ + A list of the individual attribute names, such as `MonthlySpendLimit`, + for which you want values. + + For all attribute names, see + [SetSMSAttributes](https://docs.aws.amazon.com/sns/latest/api/API_SetSMSAttributes.html). + + If you don't use this parameter, Amazon SNS returns all SMS attributes. + """ + +@dataclass(kw_only=True) +class GetSMSAttributesOutput(_SerdeShape): + """The response from the `GetSMSAttributes` request.""" + + attributes: dict[str, str] | None = ... + """The SMS attribute names and their values.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetSMSSandboxAccountStatusInput(_SerdeShape): + """Dataclass for GetSMSSandboxAccountStatusInput structure.""" + +@dataclass(kw_only=True) +class GetSMSSandboxAccountStatusOutput(_SerdeShape): + """Dataclass for GetSMSSandboxAccountStatusOutput structure.""" + + is_in_sandbox: bool = ... + """ + Indicates whether the calling Amazon Web Services account is in the SMS + sandbox. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetSubscriptionAttributesInput(_SerdeShape): + """Input for GetSubscriptionAttributes.""" + + subscription_arn: str | None = ... + """The ARN of the subscription whose properties you want to get.""" + +@dataclass(kw_only=True) +class GetSubscriptionAttributesOutput(_SerdeShape): + """Response for GetSubscriptionAttributes action.""" + + attributes: dict[str, str] | None = ... + """ + A map of the subscription's attributes. Attributes in this map include + the following: + + - `ConfirmationWasAuthenticated` -- `true` if the subscription + confirmation request was authenticated. + + - `DeliveryPolicy` -- The JSON serialization of the subscription's + delivery policy. + + - `EffectiveDeliveryPolicy` -- The JSON serialization of the effective + delivery policy that takes into account the topic delivery policy and + account system defaults. + + - `FilterPolicy` -- The filter policy JSON that is assigned to the + subscription. For more information, see [Amazon SNS Message + Filtering](https://docs.aws.amazon.com/sns/latest/dg/sns-message-filtering.html) + in the *Amazon SNS Developer Guide*. + + - `FilterPolicyScope` -- This attribute lets you choose the filtering + scope by using one of the following string value types: + + - `MessageAttributes` (default) -- The filter is applied on the + message attributes. + + - `MessageBody` -- The filter is applied on the message body. + + - `Owner` -- The Amazon Web Services account ID of the subscription's + owner. + + - `PendingConfirmation` -- `true` if the subscription hasn't been + confirmed. To confirm a pending subscription, call the + `ConfirmSubscription` action with a confirmation token. + + - `RawMessageDelivery` -- `true` if raw message delivery is enabled for + the subscription. Raw messages are free of JSON formatting and can be + sent to HTTP/S and Amazon SQS endpoints. + + - `RedrivePolicy` -- When specified, sends undeliverable messages to the + specified Amazon SQS dead-letter queue. Messages that can't be + delivered due to client errors (for example, when the subscribed + endpoint is unreachable) or server errors (for example, when the + service that powers the subscribed endpoint becomes unavailable) are + held in the dead-letter queue for further analysis or reprocessing. + + - `SubscriptionArn` -- The subscription's ARN. + + - `TopicArn` -- The topic ARN that the subscription is associated with. + + The following attribute applies only to Amazon Data Firehose delivery + stream subscriptions: + + - `SubscriptionRoleArn` -- The ARN of the IAM role that has the + following: + + - Permission to write to the Firehose delivery stream + + - Amazon SNS listed as a trusted entity + + Specifying a valid ARN for this attribute is required for Firehose + delivery stream subscriptions. For more information, see [Fanout to + Firehose delivery + streams](https://docs.aws.amazon.com/sns/latest/dg/sns-firehose-as-subscriber.html) + in the *Amazon SNS Developer Guide*. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetTopicAttributesInput(_SerdeShape): + """Input for GetTopicAttributes action.""" + + topic_arn: str | None = ... + """The ARN of the topic whose properties you want to get.""" + +@dataclass(kw_only=True) +class GetTopicAttributesOutput(_SerdeShape): + """Response for GetTopicAttributes action.""" + + attributes: dict[str, str] | None = ... + """ + A map of the topic's attributes. Attributes in this map include the + following: + + - `DeliveryPolicy` -- The JSON serialization of the topic's delivery + policy. + + - `DisplayName` -- The human-readable name used in the `From` field for + notifications to `email` and `email-json` endpoints. For subscription + confirmation and unsubscribe confirmation emails, the sender name is + always \"Amazon Web Services Notifications\" regardless of this + attribute. + + - `EffectiveDeliveryPolicy` -- The JSON serialization of the effective + delivery policy, taking system defaults into account. + + - `MaximumMessageSize` -- The maximum size, in bytes, of a message that + can be published to the topic. Amazon SNS returns this attribute only + if you explicitly set it. If Amazon SNS doesn't return it, the topic + uses the default of `262144` (256 KiB). + + - `Owner` -- The Amazon Web Services account ID of the topic's owner. + + - `Policy` -- The JSON serialization of the topic's access control + policy. + + - `SignatureVersion` -- The signature version corresponds to the hashing + algorithm used while creating the signature of the notifications, + subscription confirmations, or unsubscribe confirmation messages sent + by Amazon SNS. + + - By default, `SignatureVersion` is set to **1**. The signature is a + Base64-encoded **SHA1withRSA** signature. + + - When you set `SignatureVersion` to **2**. Amazon SNS uses a + Base64-encoded **SHA256withRSA** signature. + + Note: + If the API response does not include the `SignatureVersion` + attribute, it means that the `SignatureVersion` for the topic has + value **1**. + + - `SubscriptionsConfirmed` -- The number of confirmed subscriptions for + the topic. + + - `SubscriptionsDeleted` -- The number of deleted subscriptions for the + topic. + + - `SubscriptionsPending` -- The number of subscriptions pending + confirmation for the topic. + + - `TopicArn` -- The topic's ARN. + + - `TracingConfig` -- Tracing mode of an Amazon SNS topic. By default + `TracingConfig` is set to `PassThrough`, and the topic passes through + the tracing header it receives from an Amazon SNS publisher to its + subscriptions. If set to `Active`, Amazon SNS will vend X-Ray segment + data to topic owner account if the sampled flag in the tracing header + is true. This is only supported on standard topics. + + The following attribute applies only to + [server-side-encryption](https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html): + + - `KmsMasterKeyId` - The ID of an Amazon Web Services managed customer + master key (CMK) for Amazon SNS or a custom CMK. For more information, + see [Key + Terms](https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html#sse-key-terms). + For more examples, see + [KeyId](https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters) + in the *Key Management Service API Reference*. + + The following attributes apply only to [FIFO + topics](https://docs.aws.amazon.com/sns/latest/dg/sns-fifo-topics.html): + + - `ArchivePolicy` -- The policy that sets the retention period for + messages stored in the message archive of an Amazon SNS FIFO topic. + + - `BeginningArchiveTime` -- The earliest starting point at which a + message in the topic's archive can be replayed from. This point in + time is based on the configured message retention period set by the + topic's message archiving policy. + + - `ContentBasedDeduplication` -- Enables content-based deduplication for + FIFO topics. + + - By default, `ContentBasedDeduplication` is set to `false`. If you + create a FIFO topic and this attribute is `false`, you must specify + a value for the `MessageDeduplicationId` parameter for the + [Publish](https://docs.aws.amazon.com/sns/latest/api/API_Publish.html) + action. + + - When you set `ContentBasedDeduplication` to `true`, Amazon SNS uses + a SHA-256 hash to generate the `MessageDeduplicationId` using the + body of the message (but not the attributes of the message). + + (Optional) To override the generated value, you can specify a value + for the `MessageDeduplicationId` parameter for the `Publish` action. + + - `FifoTopic` -- When this is set to `true`, a FIFO topic is created. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InternalErrorException(ServiceError, _SerdeShape): + """Indicates an internal service error.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidBatchEntryIdException(ServiceError, _SerdeShape): + """ + The `Id` of a batch entry in a batch request doesn't abide by the + specification. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidParameterException(ServiceError, _SerdeShape): + """ + Indicates that a request parameter does not comply with the associated + constraints. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidParameterValueException(ServiceError, _SerdeShape): + """ + Indicates that a request parameter does not comply with the associated + constraints. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidSecurityException(ServiceError, _SerdeShape): + """ + The credential signature isn't valid. You must use an HTTPS endpoint + and sign your request using Signature Version 4. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidStateException(ServiceError, _SerdeShape): + """ + Indicates that the specified state is not a valid state for an event + source. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class KMSAccessDeniedException(ServiceError, _SerdeShape): + """ + The ciphertext references a key that doesn't exist or that you don't + have access to. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class KMSDisabledException(ServiceError, _SerdeShape): + """ + The request was rejected because the specified Amazon Web Services KMS + key isn't enabled. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class KMSInvalidStateException(ServiceError, _SerdeShape): + """ + The request was rejected because the state of the specified resource + isn't valid for this request. For more information, see [Key states of + Amazon Web Services KMS + keys](https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) + in the *Key Management Service Developer Guide*. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class KMSNotFoundException(ServiceError, _SerdeShape): + """ + The request was rejected because the specified entity or resource can't + be found. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class KMSOptInRequired(ServiceError, _SerdeShape): + """ + The Amazon Web Services access key ID needs a subscription for the + service. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class KMSThrottlingException(ServiceError, _SerdeShape): + """ + The request was denied due to request throttling. For more information + about throttling, see + [Limits](https://docs.aws.amazon.com/kms/latest/developerguide/limits.html#requests-per-second) + in the *Key Management Service Developer Guide.* + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class LanguageCodeString(UnknownEnumMixin, StrEnum): + """Supported language code for sending OTP message""" + + EN_US = "en-US" + EN_GB = "en-GB" + ES_419 = "es-419" + ES_ES = "es-ES" + DE_DE = "de-DE" + FR_CA = "fr-CA" + FR_FR = "fr-FR" + IT_IT = "it-IT" + JP_JP = "ja-JP" + PT_BR = "pt-BR" + KR_KR = "kr-KR" + ZH_CN = "zh-CN" + ZH_TW = "zh-TW" + +@dataclass(kw_only=True) +class ListEndpointsByPlatformApplicationInput(_SerdeShape): + """Input for `ListEndpointsByPlatformApplication` action.""" + + platform_application_arn: str | None = ... + """ + `PlatformApplicationArn` for `ListEndpointsByPlatformApplicationInput` + action. + """ + next_token: str | None = ... + """ + `NextToken` string is used when calling + `ListEndpointsByPlatformApplication` action to retrieve additional + records that are available after the first page results. + """ + +@dataclass(kw_only=True) +class ListEndpointsByPlatformApplicationOutput(_SerdeShape): + """Response for `ListEndpointsByPlatformApplication` action.""" + + endpoints: list[Endpoint] | None = ... + """Endpoints returned for `ListEndpointsByPlatformApplication` action.""" + next_token: str | None = ... + """ + `NextToken` string is returned when calling + `ListEndpointsByPlatformApplication` action if additional records are + available after the first page results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListOriginationNumbersInput(_SerdeShape): + """Dataclass for ListOriginationNumbersInput structure.""" + + next_token: str | None = ... + """Token that the previous `ListOriginationNumbers` request returns.""" + max_results: int | None = ... + """The maximum number of origination numbers to return.""" + +@dataclass(kw_only=True) +class ListOriginationNumbersOutput(_SerdeShape): + """Dataclass for ListOriginationNumbersOutput structure.""" + + next_token: str | None = ... + """ + A `NextToken` string is returned when you call the + `ListOriginationNumbers` operation if additional pages of records are + available. + """ + phone_numbers: list[PhoneNumberInformation] | None = ... + """ + A list of the calling account's verified and pending origination + numbers. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListPhoneNumbersOptedOutInput(_SerdeShape): + """The input for the `ListPhoneNumbersOptedOut` action.""" + + next_token: str | None = ... + """ + A `NextToken` string is used when you call the + `ListPhoneNumbersOptedOut` action to retrieve additional records that + are available after the first page of results. + """ + +@dataclass(kw_only=True) +class ListPhoneNumbersOptedOutOutput(_SerdeShape): + """The response from the `ListPhoneNumbersOptedOut` action.""" + + phone_numbers: list[str] | None = ... + """ + A list of phone numbers that are opted out of receiving SMS messages. + The list is paginated, and each page can contain up to 100 phone + numbers. + """ + next_token: str | None = ... + """ + A `NextToken` string is returned when you call the + `ListPhoneNumbersOptedOut` action if additional records are available + after the first page of results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListPlatformApplicationsInput(_SerdeShape): + """Input for `ListPlatformApplications` action.""" + + next_token: str | None = ... + """ + `NextToken` string is used when calling `ListPlatformApplications` + action to retrieve additional records that are available after the first + page results. + """ + +@dataclass(kw_only=True) +class ListPlatformApplicationsOutput(_SerdeShape): + """Response for `ListPlatformApplications` action.""" + + platform_applications: list[PlatformApplication] | None = ... + """ + Platform applications returned when calling `ListPlatformApplications` + action. + """ + next_token: str | None = ... + """ + `NextToken` string is returned when calling `ListPlatformApplications` + action if additional records are available after the first page results. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListSMSSandboxPhoneNumbersInput(_SerdeShape): + """Dataclass for ListSMSSandboxPhoneNumbersInput structure.""" + + next_token: str | None = ... + """ + Token that the previous `ListSMSSandboxPhoneNumbersInput` request + returns. + """ + max_results: int | None = ... + """The maximum number of phone numbers to return.""" + +@dataclass(kw_only=True) +class ListSMSSandboxPhoneNumbersOutput(_SerdeShape): + """Dataclass for ListSMSSandboxPhoneNumbersOutput structure.""" + + phone_numbers: list[SMSSandboxPhoneNumber] + """A list of the calling account's pending and verified phone numbers.""" + next_token: str | None = ... + """ + A `NextToken` string is returned when you call the + `ListSMSSandboxPhoneNumbersInput` operation if additional pages of + records are available. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListSubscriptionsByTopicInput(_SerdeShape): + """Input for ListSubscriptionsByTopic action.""" + + topic_arn: str | None = ... + """The ARN of the topic for which you wish to find subscriptions.""" + next_token: str | None = ... + """Token returned by the previous `ListSubscriptionsByTopic` request.""" + +@dataclass(kw_only=True) +class ListSubscriptionsByTopicOutput(_SerdeShape): + """Response for ListSubscriptionsByTopic action.""" + + subscriptions: list[Subscription] | None = ... + """A list of subscriptions.""" + next_token: str | None = ... + """ + Token to pass along to the next `ListSubscriptionsByTopic` request. This + element is returned if there are more subscriptions to retrieve. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListSubscriptionsInput(_SerdeShape): + """Input for ListSubscriptions action.""" + + next_token: str | None = ... + """Token returned by the previous `ListSubscriptions` request.""" + +@dataclass(kw_only=True) +class ListSubscriptionsOutput(_SerdeShape): + """Response for ListSubscriptions action""" + + subscriptions: list[Subscription] | None = ... + """A list of subscriptions.""" + next_token: str | None = ... + """ + Token to pass along to the next `ListSubscriptions` request. This + element is returned if there are more subscriptions to retrieve. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListTagsForResourceInput(_SerdeShape): + """Dataclass for ListTagsForResourceInput structure.""" + + resource_arn: str | None = ... + """The ARN of the topic for which to list tags.""" + +@dataclass(kw_only=True) +class ListTagsForResourceOutput(_SerdeShape): + """Dataclass for ListTagsForResourceOutput structure.""" + + tags: list[Tag] | None = ... + """The tags associated with the specified topic.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListTopicsInput(_SerdeShape): + """Dataclass for ListTopicsInput structure.""" + + next_token: str | None = ... + """Token returned by the previous `ListTopics` request.""" + +@dataclass(kw_only=True) +class ListTopicsOutput(_SerdeShape): + """Response for ListTopics action.""" + + topics: list[Topic] | None = ... + """A list of topic ARNs.""" + next_token: str | None = ... + """ + Token to pass along to the next `ListTopics` request. This element is + returned if there are additional topics to retrieve. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class MessageAttributeValue(_SerdeShape): + """ + The user-specified message attribute value. For string data types, the + value attribute has the same restrictions on the content as the message + body. For more information, see + [Publish](https://docs.aws.amazon.com/sns/latest/api/API_Publish.html). + + Name, type, and value must not be empty or null. In addition, the + message body should not be empty or null. All parts of the message + attribute, including name, type, and value, are included in the message + size restriction, which is 256 KiB (262,144 bytes) by default and is + determined by the topic's `MaximumMessageSize` attribute. For more + information, see [Large message + payloads](https://docs.aws.amazon.com/sns/latest/dg/large-message-payloads.html), + [Amazon SNS message + attributes](https://docs.aws.amazon.com/sns/latest/dg/SNSMessageAttributes.html) + and [Publishing to a mobile + phone](https://docs.aws.amazon.com/sns/latest/dg/sms_publish-to-phone.html) + in the *Amazon SNS Developer Guide.* + """ + + data_type: str + """ + Amazon SNS supports the following logical data types: String, + String.Array, Number, and Binary. For more information, see [Message + Attribute Data + Types](https://docs.aws.amazon.com/sns/latest/dg/SNSMessageAttributes.html#SNSMessageAttributes.DataTypes). + """ + string_value: str | None = ... + """ + Strings are Unicode with UTF8 binary encoding. For a list of code + values, see [ASCII Printable + Characters](https://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters). + """ + binary_value: bytes | None = ... + """ + Binary type attributes can store any binary data, for example, + compressed data, encrypted data, or images. + """ + +@dataclass(kw_only=True) +class NotFoundException(ServiceError, _SerdeShape): + """Indicates that the requested resource does not exist.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class NumberCapability(UnknownEnumMixin, StrEnum): + """Enum listing out all supported number capabilities.""" + + SMS = "SMS" + MMS = "MMS" + VOICE = "VOICE" + +@dataclass(kw_only=True) +class OptedOutException(ServiceError, _SerdeShape): + """ + Indicates that the specified phone number opted out of receiving SMS + messages from your Amazon Web Services account. You can't send SMS + messages to phone numbers that opt out. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class OptInPhoneNumberInput(_SerdeShape): + """Input for the OptInPhoneNumber action.""" + + phone_number: str | None = ... + """The phone number to opt in. Use E.164 format.""" + +@dataclass(kw_only=True) +class OptInPhoneNumberOutput(_SerdeShape): + """The response for the OptInPhoneNumber action.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class PhoneNumberInformation(_SerdeShape): + """A list of phone numbers and their metadata.""" + + created_at: datetime | None = ... + """The date and time when the phone number was created.""" + phone_number: str | None = ... + """The phone number.""" + status: str | None = ... + """The status of the phone number.""" + iso2_country_code: str | None = ... + """ + The two-character code for the country or region, in ISO 3166-1 alpha-2 + format. + """ + route_type: str | None = ... + """The list of supported routes.""" + number_capabilities: list[str] | None = ... + """The capabilities of each phone number.""" + +@dataclass(kw_only=True) +class PlatformApplication(_SerdeShape): + """Platform application object.""" + + platform_application_arn: str | None = ... + """PlatformApplicationArn for platform application object.""" + attributes: dict[str, str] | None = ... + """Attributes for platform application object.""" + +@dataclass(kw_only=True) +class PlatformApplicationDisabledException(ServiceError, _SerdeShape): + """Exception error indicating platform application disabled.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class PublishBatchInput(_SerdeShape): + """Dataclass for PublishBatchInput structure.""" + + topic_arn: str | None = ... + """ + The Amazon resource name (ARN) of the topic you want to batch publish + to. + """ + publish_batch_request_entries: list[PublishBatchRequestEntry] | None = ... + """A list of `PublishBatch` request entries to be sent to the SNS topic.""" + +@dataclass(kw_only=True) +class PublishBatchOutput(_SerdeShape): + """Dataclass for PublishBatchOutput structure.""" + + successful: list[PublishBatchResultEntry] | None = ... + """A list of successful `PublishBatch` responses.""" + failed: list[BatchResultErrorEntry] | None = ... + """A list of failed `PublishBatch` responses.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class PublishBatchRequestEntry(_SerdeShape): + """ + Contains the details of a single Amazon SNS message along with an `Id` + that identifies a message within the batch. + """ + + id: str + """ + An identifier for the message in this batch. + + Note: + The `Ids` of a batch request must be unique within a request. + + This identifier can have up to 80 characters. The following characters + are accepted: alphanumeric characters, hyphens(-), and underscores (_). + """ + message: str + """The body of the message.""" + subject: str | None = ... + """The subject of the batch message.""" + message_structure: str | None = ... + """ + Set `MessageStructure` to `json` if you want to send a different message + for each protocol. For example, using one publish action, you can send a + short message to your SMS subscribers and a longer message to your email + subscribers. If you set `MessageStructure` to `json`, the value of the + `Message` parameter must: + + - be a syntactically valid JSON object; and + + - contain at least a top-level JSON key of \"default\" with a value that + is a string. + + You can define other top-level keys that define the message you want to + send to a specific transport protocol (for example, http). + """ + message_attributes: dict[str, MessageAttributeValue] | None = ... + """ + Each message attribute consists of a `Name`, `Type`, and `Value`. For + more information, see [Amazon SNS message + attributes](https://docs.aws.amazon.com/sns/latest/dg/sns-message-attributes.html) + in the Amazon SNS Developer Guide. + """ + message_deduplication_id: str | None = ... + """ + This parameter applies only to FIFO (first-in-first-out) topics. + + - This parameter applies only to FIFO (first-in-first-out) topics. The + `MessageDeduplicationId` can contain up to 128 alphanumeric characters + `(a-z, A-Z, 0-9)` and punctuation + `` (!"#$%&'()*+,-./:;<=>?@[]^_`{|}~) ``. + + - Every message must have a unique `MessageDeduplicationId`, which is a + token used for deduplication of sent messages within the 5 minute + minimum deduplication interval. + + - The scope of deduplication depends on the `FifoThroughputScope` + attribute, when set to `Topic` the message deduplication scope is + across the entire topic, when set to `MessageGroup` the message + deduplication scope is within each individual message group. + + - If a message with a particular `MessageDeduplicationId` is sent + successfully, subsequent messages within the deduplication scope and + interval, with the same `MessageDeduplicationId`, are accepted + successfully but aren't delivered. + + - Every message must have a unique `MessageDeduplicationId`. + + - You may provide a `MessageDeduplicationId` explicitly. + + - If you aren't able to provide a `MessageDeduplicationId` and you + enable `ContentBasedDeduplication` for your topic, Amazon SNS uses a + SHA-256 hash to generate the `MessageDeduplicationId` using the body + of the message (but not the attributes of the message). + + - If you don't provide a `MessageDeduplicationId` and the topic + doesn't have `ContentBasedDeduplication` set, the action fails with + an error. + + - If the topic has a `ContentBasedDeduplication` set, your + `MessageDeduplicationId` overrides the generated one. + + - When `ContentBasedDeduplication` is in effect, messages with identical + content sent within the deduplication scope and interval are treated + as duplicates and only one copy of the message is delivered. + + - If you send one message with `ContentBasedDeduplication` enabled, and + then another message with a `MessageDeduplicationId` that is the same + as the one generated for the first `MessageDeduplicationId`, the two + messages are treated as duplicates, within the deduplication scope and + interval, and only one copy of the message is delivered. + + Note: + The `MessageDeduplicationId` is available to the consumer of the message + (this can be useful for troubleshooting delivery issues). + + If a message is sent successfully but the acknowledgement is lost and + the message is resent with the same `MessageDeduplicationId` after the + deduplication interval, Amazon SNS can't detect duplicate messages. + + Amazon SNS continues to keep track of the message deduplication ID even + after the message is received and deleted. + """ + message_group_id: str | None = ... + """ + FIFO topics: The tag that specifies that a message belongs to a specific + message group. Messages that belong to the same message group are + processed in a FIFO manner (however, messages in different message + groups might be processed out of order). To interleave multiple ordered + streams within a single topic, use `MessageGroupId` values (for example, + session data for multiple users). In this scenario, multiple consumers + can process the topic, but the session data of each user is processed in + a FIFO fashion. You must associate a non-empty `MessageGroupId` with a + message. If you do not provide a `MessageGroupId`, the action fails. + + Standard topics: The `MessageGroupId` is optional and is forwarded only + to Amazon SQS standard subscriptions to activate [fair + queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-fair-queues.html). + The `MessageGroupId` is not used for, or sent to, any other endpoint + types. + + The length of `MessageGroupId` is 128 characters. + + `MessageGroupId` can contain alphanumeric characters `(a-z, A-Z, 0-9)` + and punctuation `` (!"#$%&'()*+,-./:;<=>?@[]^_`{|}~) ``. + """ + +@dataclass(kw_only=True) +class PublishBatchResultEntry(_SerdeShape): + """ + Encloses data related to a successful message in a batch request for + topic. + """ + + id: str | None = ... + """The `Id` of an entry in a batch request.""" + message_id: str | None = ... + """An identifier for the message.""" + sequence_number: str | None = ... + """ + This parameter applies only to FIFO (first-in-first-out) topics. + + The large, non-consecutive number that Amazon SNS assigns to each + message. + + The length of `SequenceNumber` is 128 bits. `SequenceNumber` continues + to increase for a particular `MessageGroupId`. + """ + +@dataclass(kw_only=True) +class PublishInput(_SerdeShape): + """Input for Publish action.""" + + topic_arn: str | None = ... + """ + The topic you want to publish to. + + If you don't specify a value for the `TopicArn` parameter, you must + specify a value for the `PhoneNumber` or `TargetArn` parameters. + """ + target_arn: str | None = ... + """ + If you don't specify a value for the `TargetArn` parameter, you must + specify a value for the `PhoneNumber` or `TopicArn` parameters. + """ + phone_number: str | None = ... + """ + The phone number to which you want to deliver an SMS message. Use E.164 + format. + + If you don't specify a value for the `PhoneNumber` parameter, you must + specify a value for the `TargetArn` or `TopicArn` parameters. + """ + message: str | None = ... + """ + The message you want to send. + + If you are publishing to a topic and you want to send the same message + to all transport protocols, include the text of the message as a String + value. If you want to send different messages for each transport + protocol, set the value of the `MessageStructure` parameter to `json` + and use a JSON object for the `Message` parameter. + + Constraints: + + - With the exception of SMS, messages must be UTF-8 encoded strings. By + default, a message can be at most 256 KiB in size (262,144 bytes, not + 262,144 characters). + + When you publish to a topic, the maximum size is determined by the + topic's `MaximumMessageSize` attribute, which supports values up to 1 + MiB (1,048,576 bytes). Amazon SNS validates the combined size of the + message body and message attributes against this value and returns an + `InvalidParameter` error if the limit is exceeded. + + For more information, see [Large message + payloads](https://docs.aws.amazon.com/sns/latest/dg/large-message-payloads.html) + in the *Amazon SNS Developer Guide.* + + - For SMS, each message can contain up to 140 characters. This character + limit depends on the encoding schema. For example, an SMS message can + contain 160 GSM characters, 140 ASCII characters, or 70 UCS-2 + characters. + + If you publish a message that exceeds this size limit, Amazon SNS + sends the message as multiple messages, each fitting within the size + limit. Messages aren't truncated mid-word but are cut off at + whole-word boundaries. + + The total size limit for a single SMS `Publish` action is 1,600 + characters. + + JSON-specific constraints: + + - Keys in the JSON object that correspond to supported transport + protocols must have simple JSON string values. + + - The values will be parsed (unescaped) before they are used in outgoing + messages. + + - Outbound notifications are JSON encoded (meaning that the characters + will be reescaped for sending). + + - Values have a minimum length of 0 (the empty string, \"\", is + allowed). + + - Values have a maximum length bounded by the overall message size (so, + including multiple protocols may limit message sizes). + + - Non-string values will cause the key to be ignored. + + - Keys that do not correspond to supported transport protocols are + ignored. + + - Duplicate keys are not allowed. + + - Failure to parse or validate any key or value in the message will + cause the `Publish` call to return an error (no partial delivery). + """ + subject: str | None = ... + """ + Optional parameter to be used as the \"Subject\" line when the message + is delivered to email endpoints. This field will also be included, if + present, in the standard JSON messages delivered to other endpoints. + + Constraints: Subjects must be UTF-8 text with no line breaks or control + characters, and less than 100 characters long. + """ + message_structure: str | None = ... + """ + Set `MessageStructure` to `json` if you want to send a different message + for each protocol. For example, using one publish action, you can send a + short message to your SMS subscribers and a longer message to your email + subscribers. If you set `MessageStructure` to `json`, the value of the + `Message` parameter must: + + - be a syntactically valid JSON object; and + + - contain at least a top-level JSON key of \"default\" with a value that + is a string. + + You can define other top-level keys that define the message you want to + send to a specific transport protocol (e.g., \"http\"). + + Valid value: `json` + """ + message_attributes: dict[str, MessageAttributeValue] | None = ... + """Message attributes for Publish action.""" + message_deduplication_id: str | None = ... + """ + - This parameter applies only to FIFO (first-in-first-out) topics. The + `MessageDeduplicationId` can contain up to 128 alphanumeric characters + `(a-z, A-Z, 0-9)` and punctuation + `` (!"#$%&'()*+,-./:;<=>?@[]^_`{|}~) ``. + + - Every message must have a unique `MessageDeduplicationId`, which is a + token used for deduplication of sent messages within the 5 minute + minimum deduplication interval. + + - The scope of deduplication depends on the `FifoThroughputScope` + attribute, when set to `Topic` the message deduplication scope is + across the entire topic, when set to `MessageGroup` the message + deduplication scope is within each individual message group. + + - If a message with a particular `MessageDeduplicationId` is sent + successfully, subsequent messages within the deduplication scope and + interval, with the same `MessageDeduplicationId`, are accepted + successfully but aren't delivered. + + - Every message must have a unique `MessageDeduplicationId`: + + - You may provide a `MessageDeduplicationId` explicitly. + + - If you aren't able to provide a `MessageDeduplicationId` and you + enable `ContentBasedDeduplication` for your topic, Amazon SNS uses a + SHA-256 hash to generate the `MessageDeduplicationId` using the body + of the message (but not the attributes of the message). + + - If you don't provide a `MessageDeduplicationId` and the topic + doesn't have `ContentBasedDeduplication` set, the action fails with + an error. + + - If the topic has a `ContentBasedDeduplication` set, your + `MessageDeduplicationId` overrides the generated one. + + - When `ContentBasedDeduplication` is in effect, messages with identical + content sent within the deduplication scope and interval are treated + as duplicates and only one copy of the message is delivered. + + - If you send one message with `ContentBasedDeduplication` enabled, and + then another message with a `MessageDeduplicationId` that is the same + as the one generated for the first `MessageDeduplicationId`, the two + messages are treated as duplicates, within the deduplication scope and + interval, and only one copy of the message is delivered. + """ + message_group_id: str | None = ... + """ + The `MessageGroupId` can contain up to 128 alphanumeric characters + `(a-z, A-Z, 0-9)` and punctuation + `` (!"#$%&'()*+,-./:;<=>?@[]^_`{|}~) ``. + + For FIFO topics: The `MessageGroupId` is a tag that specifies that a + message belongs to a specific message group. Messages that belong to the + same message group are processed in a FIFO manner (however, messages in + different message groups might be processed out of order). Every message + must include a `MessageGroupId`. + + For standard topics: The `MessageGroupId` is optional and is forwarded + only to Amazon SQS standard subscriptions to activate [fair + queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-fair-queues.html). + The `MessageGroupId` is not used for, or sent to, any other endpoint + types. When provided, the same validation rules apply as for FIFO + topics. + """ + +@dataclass(kw_only=True) +class PublishOutput(_SerdeShape): + """Response for Publish action.""" + + message_id: str | None = ... + """ + Unique identifier assigned to the published message. + + Length Constraint: Maximum 100 characters + """ + sequence_number: str | None = ... + """ + This response element applies only to FIFO (first-in-first-out) topics. + + The sequence number is a large, non-consecutive number that Amazon SNS + assigns to each message. The length of `SequenceNumber` is 128 bits. + `SequenceNumber` continues to increase for each `MessageGroupId`. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class PutDataProtectionPolicyInput(_SerdeShape): + """Dataclass for PutDataProtectionPolicyInput structure.""" + + resource_arn: str | None = ... + """ + The ARN of the topic whose `DataProtectionPolicy` you want to add or + update. + + For more information about ARNs, see [Amazon Resource Names + (ARNs)](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + in the Amazon Web Services General Reference. + """ + data_protection_policy: str | None = ... + """ + The JSON serialization of the topic's `DataProtectionPolicy`. + + The `DataProtectionPolicy` must be in JSON string format. + + Length Constraints: Maximum length of 30,720. + """ + +@dataclass(kw_only=True) +class PutDataProtectionPolicyOutput(_SerdeShape): + """Dataclass for PutDataProtectionPolicyOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class RemovePermissionInput(_SerdeShape): + """Input for RemovePermission action.""" + + topic_arn: str | None = ... + """The ARN of the topic whose access control policy you wish to modify.""" + label: str | None = ... + """The unique label of the statement you want to remove.""" + +@dataclass(kw_only=True) +class RemovePermissionOutput(_SerdeShape): + """Dataclass for RemovePermissionOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ReplayLimitExceededException(ServiceError, _SerdeShape): + """ + Indicates that the request parameter has exceeded the maximum number of + concurrent message replays. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ResourceNotFoundException(ServiceError, _SerdeShape): + """ + Can't perform the action on the specified resource. Make sure that the + resource exists. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class RouteType(UnknownEnumMixin, StrEnum): + """ + Enum listing out all supported route types. The following enum values + are supported. 1. Transactional : Non-marketing traffic 2. Promotional : + Marketing 3. Premium : Premium routes for OTP delivery to the carriers + """ + + TRANSACTIONAL = "Transactional" + PROMOTIONAL = "Promotional" + PREMIUM = "Premium" + +@dataclass(kw_only=True) +class SetEndpointAttributesInput(_SerdeShape): + """Input for `SetEndpointAttributes` action.""" + + endpoint_arn: str | None = ... + """EndpointArn used for `SetEndpointAttributes` action.""" + attributes: dict[str, str] | None = ... + """ + A map of the endpoint attributes. Attributes in this map include the + following: + + - `CustomUserData` -- arbitrary user data to associate with the + endpoint. Amazon SNS does not use this data. The data must be in UTF-8 + format and less than 2KB. + + - `Enabled` -- flag that enables/disables delivery to the endpoint. + Amazon SNS will set this to false when a notification service + indicates to Amazon SNS that the endpoint is invalid. Users can set it + back to true, typically after updating Token. + + - `Token` -- device token, also referred to as a registration id, for an + app and mobile device. This is returned from the notification service + when an app and mobile device are registered with the notification + service. + """ + +@dataclass(kw_only=True) +class SetEndpointAttributesOutput(_SerdeShape): + """Dataclass for SetEndpointAttributesOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class SetPlatformApplicationAttributesInput(_SerdeShape): + """Input for `SetPlatformApplicationAttributes` action.""" + + platform_application_arn: str | None = ... + """`PlatformApplicationArn` for `SetPlatformApplicationAttributes` action.""" + attributes: dict[str, str] | None = ... + """ + A map of the platform application attributes. Attributes in this map + include the following: + + - `PlatformCredential` -- The credential received from the notification + service. + + - For ADM, `PlatformCredential`is client secret. + + - For Apple Services using certificate credentials, + `PlatformCredential` is private key. + + - For Apple Services using token credentials, `PlatformCredential` is + signing key. + + - For GCM (Firebase Cloud Messaging) using key credentials, there is + no `PlatformPrincipal`. The `PlatformCredential` is `API key`. + + - For GCM (Firebase Cloud Messaging) using token credentials, there is + no `PlatformPrincipal`. The `PlatformCredential` is a JSON formatted + private key file. When using the Amazon Web Services CLI, the file + must be in string format and special characters must be ignored. To + format the file correctly, Amazon SNS recommends using the following + command: `` SERVICE_JSON=`jq @json <<< cat service.json` ``. + + + + - `PlatformPrincipal` -- The principal received from the notification + service. + + - For ADM, `PlatformPrincipal`is client id. + + - For Apple Services using certificate credentials, + `PlatformPrincipal` is SSL certificate. + + - For Apple Services using token credentials, `PlatformPrincipal` is + signing key ID. + + - For GCM (Firebase Cloud Messaging), there is no `PlatformPrincipal`. + + + + - `EventEndpointCreated` -- Topic ARN to which `EndpointCreated` event + notifications are sent. + + - `EventEndpointDeleted` -- Topic ARN to which `EndpointDeleted` event + notifications are sent. + + - `EventEndpointUpdated` -- Topic ARN to which `EndpointUpdate` event + notifications are sent. + + - `EventDeliveryFailure` -- Topic ARN to which `DeliveryFailure` event + notifications are sent upon Direct Publish delivery failure + (permanent) to one of the application's endpoints. + + - `SuccessFeedbackRoleArn` -- IAM role ARN used to give Amazon SNS write + access to use CloudWatch Logs on your behalf. + + - `FailureFeedbackRoleArn` -- IAM role ARN used to give Amazon SNS write + access to use CloudWatch Logs on your behalf. + + - `SuccessFeedbackSampleRate` -- Sample rate percentage (0-100) of + successfully delivered messages. + + The following attributes only apply to `APNs` token-based + authentication: + + - `ApplePlatformTeamID` -- The identifier that's assigned to your Apple + developer account team. + + - `ApplePlatformBundleID` -- The bundle identifier that's assigned to + your iOS app. + """ + +@dataclass(kw_only=True) +class SetPlatformApplicationAttributesOutput(_SerdeShape): + """Dataclass for SetPlatformApplicationAttributesOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class SetSMSAttributesInput(_SerdeShape): + """The input for the SetSMSAttributes action.""" + + attributes: dict[str, str] | None = ... + """ + The default settings for sending SMS messages from your Amazon Web + Services account. You can set values for the following attribute names: + + `MonthlySpendLimit` -- The maximum amount in USD that you are willing to + spend each month to send SMS messages. When Amazon SNS determines that + sending an SMS message would incur a cost that exceeds this limit, it + stops sending SMS messages within minutes. + + Warning: + Amazon SNS stops sending SMS messages within minutes of the limit being + crossed. During that interval, if you continue to send SMS messages, you + will incur costs that exceed your limit. + + By default, the spend limit is set to the maximum allowed by Amazon SNS. + If you want to raise the limit, submit an [SNS Limit Increase + case](https://console.aws.amazon.com/support/home#/case/create?issueType=service-limit-increase&limitType=service-code-sns). + For **New limit value**, enter your desired monthly spend limit. In the + **Use Case Description** field, explain that you are requesting an SMS + monthly spend limit increase. + + `DeliveryStatusIAMRole` -- The ARN of the IAM role that allows Amazon + SNS to write logs about SMS deliveries in CloudWatch Logs. For each SMS + message that you send, Amazon SNS writes a log that includes the message + price, the success or failure status, the reason for failure (if the + message failed), the message dwell time, and other information. + + `DeliveryStatusSuccessSamplingRate` -- The percentage of successful SMS + deliveries for which Amazon SNS will write logs in CloudWatch Logs. The + value can be an integer from 0 - 100. For example, to write logs only + for failed deliveries, set this value to `0`. To write logs for 10% of + your successful deliveries, set it to `10`. + + `DefaultSenderID` -- A string, such as your business brand, that is + displayed as the sender on the receiving device. Support for sender IDs + varies by country. The sender ID can be 1 - 11 alphanumeric characters, + and it must contain at least one letter. + + `DefaultSMSType` -- The type of SMS message that you will send by + default. You can assign the following values: + + - `Promotional` -- (Default) Noncritical messages, such as marketing + messages. Amazon SNS optimizes the message delivery to incur the + lowest cost. + + - `Transactional` -- Critical messages that support customer + transactions, such as one-time passcodes for multi-factor + authentication. Amazon SNS optimizes the message delivery to achieve + the highest reliability. + + `UsageReportS3Bucket` -- The name of the Amazon S3 bucket to receive + daily SMS usage reports from Amazon SNS. Each day, Amazon SNS will + deliver a usage report as a CSV file to the bucket. The report includes + the following information for each SMS message that was successfully + delivered by your Amazon Web Services account: + + - Time that the message was published (in UTC) + + - Message ID + + - Destination phone number + + - Message type + + - Delivery status + + - Message price (in USD) + + - Part number (a message is split into multiple parts if it is too long + for a single message) + + - Total number of parts + + To receive the report, the bucket must have a policy that allows the + Amazon SNS service principal to perform the `s3:PutObject` and + `s3:GetBucketLocation` actions. + + For an example bucket policy and usage report, see [Monitoring SMS + Activity](https://docs.aws.amazon.com/sns/latest/dg/sms_stats.html) in + the *Amazon SNS Developer Guide*. + """ + +@dataclass(kw_only=True) +class SetSMSAttributesOutput(_SerdeShape): + """The response for the SetSMSAttributes action.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class SetSubscriptionAttributesInput(_SerdeShape): + """Input for SetSubscriptionAttributes action.""" + + subscription_arn: str | None = ... + """The ARN of the subscription to modify.""" + attribute_name: str | None = ... + """ + A map of attributes with their corresponding values. + + The following lists the names, descriptions, and values of the special + request parameters that this action uses: + + - `DeliveryPolicy` -- The policy that defines how Amazon SNS retries + failed deliveries to HTTP/S endpoints. + + - `FilterPolicy` -- The simple JSON object that lets your subscriber + receive only a subset of messages, rather than receiving every message + published to the topic. + + - `FilterPolicyScope` -- This attribute lets you choose the filtering + scope by using one of the following string value types: + + - `MessageAttributes` (default) -- The filter is applied on the + message attributes. + + - `MessageBody` -- The filter is applied on the message body. + + - `RawMessageDelivery` -- When set to `true`, enables raw message + delivery to Amazon SQS or HTTP/S endpoints. This eliminates the need + for the endpoints to process JSON formatting, which is otherwise + created for Amazon SNS metadata. + + - `RedrivePolicy` -- When specified, sends undeliverable messages to the + specified Amazon SQS dead-letter queue. Messages that can't be + delivered due to client errors (for example, when the subscribed + endpoint is unreachable) or server errors (for example, when the + service that powers the subscribed endpoint becomes unavailable) are + held in the dead-letter queue for further analysis or reprocessing. + + The following attribute applies only to Amazon Data Firehose delivery + stream subscriptions: + + - `SubscriptionRoleArn` -- The ARN of the IAM role that has the + following: + + - Permission to write to the Firehose delivery stream + + - Amazon SNS listed as a trusted entity + + Specifying a valid ARN for this attribute is required for Firehose + delivery stream subscriptions. For more information, see [Fanout to + Firehose delivery + streams](https://docs.aws.amazon.com/sns/latest/dg/sns-firehose-as-subscriber.html) + in the *Amazon SNS Developer Guide*. + """ + attribute_value: str | None = ... + """The new value for the attribute in JSON format.""" + +@dataclass(kw_only=True) +class SetSubscriptionAttributesOutput(_SerdeShape): + """Dataclass for SetSubscriptionAttributesOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class SetTopicAttributesInput(_SerdeShape): + """Input for SetTopicAttributes action.""" + + topic_arn: str | None = ... + """The ARN of the topic to modify.""" + attribute_name: str | None = ... + """ + A map of attributes with their corresponding values. + + The following lists the names, descriptions, and values of the special + request parameters that the `SetTopicAttributes` action uses: + + - `DeliveryPolicy` -- The policy that defines how Amazon SNS retries + failed deliveries to HTTP/S endpoints. + + - `DisplayName` -- The display name to use for a topic with SMS, + `email`, and `email-json` subscriptions. For `email` and `email-json` + subscriptions, the display name is used as the sender name for regular + notification messages. Subscription confirmation and unsubscribe + confirmation emails always use \"Amazon Web Services Notifications\" + as the sender name. + + - `MaximumMessageSize` -- The maximum size, in bytes, of a message that + can be published to the topic. Valid values are `1024` to `1048576` (1 + MiB). The default is `262144` (256 KiB). + + A topic with a `MaximumMessageSize` above 256 KiB must have 100 or + fewer subscriptions, and each subscription must be an Amazon SQS, + Amazon Data Firehose, or Lambda subscription. + + You can increase or decrease this value at any time. If the topic + doesn't meet these requirements when you set a value above 256 KiB, + Amazon SNS returns an `InvalidParameter` error. For more information, + see [Large message + payloads](https://docs.aws.amazon.com/sns/latest/dg/large-message-payloads.html) + in the *Amazon SNS Developer Guide.* + + - `Policy` -- The policy that defines who can access your topic. By + default, only the topic owner can publish or subscribe to the topic. + + - `TracingConfig` -- Tracing mode of an Amazon SNS topic. By default + `TracingConfig` is set to `PassThrough`, and the topic passes through + the tracing header it receives from an Amazon SNS publisher to its + subscriptions. If set to `Active`, Amazon SNS will vend X-Ray segment + data to topic owner account if the sampled flag in the tracing header + is true. This is only supported on standard topics. + + - HTTP + + - `HTTPSuccessFeedbackRoleArn` -- Indicates successful message + delivery status for an Amazon SNS topic that is subscribed to an + HTTP endpoint. + + - `HTTPSuccessFeedbackSampleRate` -- Indicates percentage of + successful messages to sample for an Amazon SNS topic that is + subscribed to an HTTP endpoint. + + - `HTTPFailureFeedbackRoleArn` -- Indicates failed message delivery + status for an Amazon SNS topic that is subscribed to an HTTP + endpoint. + + - Amazon Data Firehose + + - `FirehoseSuccessFeedbackRoleArn` -- Indicates successful message + delivery status for an Amazon SNS topic that is subscribed to an + Amazon Data Firehose endpoint. + + - `FirehoseSuccessFeedbackSampleRate` -- Indicates percentage of + successful messages to sample for an Amazon SNS topic that is + subscribed to an Amazon Data Firehose endpoint. + + - `FirehoseFailureFeedbackRoleArn` -- Indicates failed message + delivery status for an Amazon SNS topic that is subscribed to an + Amazon Data Firehose endpoint. + + - Lambda + + - `LambdaSuccessFeedbackRoleArn` -- Indicates successful message + delivery status for an Amazon SNS topic that is subscribed to an + Lambda endpoint. + + - `LambdaSuccessFeedbackSampleRate` -- Indicates percentage of + successful messages to sample for an Amazon SNS topic that is + subscribed to an Lambda endpoint. + + - `LambdaFailureFeedbackRoleArn` -- Indicates failed message delivery + status for an Amazon SNS topic that is subscribed to an Lambda + endpoint. + + - Platform application endpoint + + - `ApplicationSuccessFeedbackRoleArn` -- Indicates successful message + delivery status for an Amazon SNS topic that is subscribed to an + platform application endpoint. + + - `ApplicationSuccessFeedbackSampleRate` -- Indicates percentage of + successful messages to sample for an Amazon SNS topic that is + subscribed to an platform application endpoint. + + - `ApplicationFailureFeedbackRoleArn` -- Indicates failed message + delivery status for an Amazon SNS topic that is subscribed to an + platform application endpoint. + + Note: + In addition to being able to configure topic attributes for message + delivery status of notification messages sent to Amazon SNS + application endpoints, you can also configure application attributes + for the delivery status of push notification messages sent to push + notification services. + + For example, For more information, see [Using Amazon SNS Application + Attributes for Message Delivery + Status](https://docs.aws.amazon.com/sns/latest/dg/sns-msg-status.html). + + - Amazon SQS + + - `SQSSuccessFeedbackRoleArn` -- Indicates successful message delivery + status for an Amazon SNS topic that is subscribed to an Amazon SQS + endpoint. + + - `SQSSuccessFeedbackSampleRate` -- Indicates percentage of successful + messages to sample for an Amazon SNS topic that is subscribed to an + Amazon SQS endpoint. + + - `SQSFailureFeedbackRoleArn` -- Indicates failed message delivery + status for an Amazon SNS topic that is subscribed to an Amazon SQS + endpoint. + + Note: + The ``{=html}SuccessFeedbackRoleArn and + ``{=html}FailureFeedbackRoleArn attributes are used to give + Amazon SNS write access to use CloudWatch Logs on your behalf. The + ``{=html}SuccessFeedbackSampleRate attribute is for specifying + the sample rate percentage (0-100) of successfully delivered messages. + After you configure the ``{=html}FailureFeedbackRoleArn + attribute, then all failed message deliveries generate CloudWatch Logs. + + The following attribute applies only to + [server-side-encryption](https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html): + + - `KmsMasterKeyId` -- The ID of an Amazon Web Services managed customer + master key (CMK) for Amazon SNS or a custom CMK. For more information, + see [Key + Terms](https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html#sse-key-terms). + For more examples, see + [KeyId](https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters) + in the *Key Management Service API Reference*. + + - `SignatureVersion` -- The signature version corresponds to the hashing + algorithm used while creating the signature of the notifications, + subscription confirmations, or unsubscribe confirmation messages sent + by Amazon SNS. By default, `SignatureVersion` is set to `1`. + + The following attribute applies only to [FIFO + topics](https://docs.aws.amazon.com/sns/latest/dg/sns-fifo-topics.html): + + - `ArchivePolicy` -- The policy that sets the retention period for + messages stored in the message archive of an Amazon SNS FIFO topic. + + - `ContentBasedDeduplication` -- Enables content-based deduplication for + FIFO topics. + + - By default, `ContentBasedDeduplication` is set to `false`. If you + create a FIFO topic and this attribute is `false`, you must specify + a value for the `MessageDeduplicationId` parameter for the + [Publish](https://docs.aws.amazon.com/sns/latest/api/API_Publish.html) + action. + + - When you set `ContentBasedDeduplication` to `true`, Amazon SNS uses + a SHA-256 hash to generate the `MessageDeduplicationId` using the + body of the message (but not the attributes of the message). + + (Optional) To override the generated value, you can specify a value + for the `MessageDeduplicationId` parameter for the `Publish` action. + + + + - `FifoThroughputScope` -- Enables higher throughput for your FIFO topic + by adjusting the scope of deduplication. This attribute has two + possible values: + + - `Topic` -- The scope of message deduplication is across the entire + topic. This is the default value and maintains existing behavior, + with a maximum throughput of 3000 messages per second or 20MB per + second, whichever comes first. + + - `MessageGroup` -- The scope of deduplication is within each + individual message group, which enables higher throughput per topic + subject to regional quotas. For more information on quotas or to + request an increase, see [Amazon SNS service + quotas](https://docs.aws.amazon.com/general/latest/gr/sns.html) in + the Amazon Web Services General Reference. + """ + attribute_value: str | None = ... + """The new value for the attribute.""" + +@dataclass(kw_only=True) +class SetTopicAttributesOutput(_SerdeShape): + """Dataclass for SetTopicAttributesOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class SMSSandboxPhoneNumber(_SerdeShape): + """ + A verified or pending destination phone number in the SMS sandbox. + + When you start using Amazon SNS to send SMS messages, your Amazon Web + Services account is in the *SMS sandbox*. The SMS sandbox provides a + safe environment for you to try Amazon SNS features without risking your + reputation as an SMS sender. While your Amazon Web Services account is + in the SMS sandbox, you can use all of the features of Amazon SNS. + However, you can send SMS messages only to verified destination phone + numbers. For more information, including how to move out of the sandbox + to send messages without restrictions, see [SMS + sandbox](https://docs.aws.amazon.com/sns/latest/dg/sns-sms-sandbox.html) + in the *Amazon SNS Developer Guide*. + """ + + phone_number: str | None = ... + """The destination phone number.""" + status: str | None = ... + """The destination phone number's verification status.""" + +class SMSSandboxPhoneNumberVerificationStatus(UnknownEnumMixin, StrEnum): + """ + Enum listing out all supported destination phone number verification + statuses. The following enum values are supported. 1. PENDING : The + destination phone number is pending verification. 2. VERIFIED : The + destination phone number is verified. + """ + + PENDING = "Pending" + VERIFIED = "Verified" + +@dataclass(kw_only=True) +class StaleTagException(ServiceError, _SerdeShape): + """ + A tag has been added to a resource with the same ARN as a deleted + resource. Wait a short while and then retry the operation. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class SubscribeInput(_SerdeShape): + """Input for Subscribe action.""" + + topic_arn: str | None = ... + """The ARN of the topic you want to subscribe to.""" + protocol: str | None = ... + """ + The protocol that you want to use. Supported protocols include: + + - `http` -- delivery of JSON-encoded message via HTTP POST + + - `https` -- delivery of JSON-encoded message via HTTPS POST + + - `email` -- delivery of message via SMTP + + - `email-json` -- delivery of JSON-encoded message via SMTP + + - `sms` -- delivery of message via SMS + + - `sqs` -- delivery of JSON-encoded message to an Amazon SQS queue + + - `application` -- delivery of JSON-encoded message to an EndpointArn + for a mobile app and device + + - `lambda` -- delivery of JSON-encoded message to an Lambda function + + - `firehose` -- delivery of JSON-encoded message to an Amazon Data + Firehose delivery stream. + """ + endpoint: str | None = ... + """ + The endpoint that you want to receive notifications. Endpoints vary by + protocol: + + - For the `http` protocol, the (public) endpoint is a URL beginning with + `http://`. + + - For the `https` protocol, the (public) endpoint is a URL beginning + with `https://`. + + - For the `email` protocol, the endpoint is an email address. + + - For the `email-json` protocol, the endpoint is an email address. + + - For the `sms` protocol, the endpoint is a phone number of an + SMS-enabled device. + + - For the `sqs` protocol, the endpoint is the ARN of an Amazon SQS + queue. + + - For the `application` protocol, the endpoint is the EndpointArn of a + mobile app and device. + + - For the `lambda` protocol, the endpoint is the ARN of an Lambda + function. + + - For the `firehose` protocol, the endpoint is the ARN of an Amazon Data + Firehose delivery stream. + """ + attributes: dict[str, str] | None = ... + """ + A map of attributes with their corresponding values. + + The following lists the names, descriptions, and values of the special + request parameters that the `Subscribe` action uses: + + - `DeliveryPolicy` -- The policy that defines how Amazon SNS retries + failed deliveries to HTTP/S endpoints. + + - `FilterPolicy` -- The simple JSON object that lets your subscriber + receive only a subset of messages, rather than receiving every message + published to the topic. + + - `FilterPolicyScope` -- This attribute lets you choose the filtering + scope by using one of the following string value types: + + - `MessageAttributes` (default) -- The filter is applied on the + message attributes. + + - `MessageBody` -- The filter is applied on the message body. + + - `RawMessageDelivery` -- When set to `true`, enables raw message + delivery to Amazon SQS or HTTP/S endpoints. This eliminates the need + for the endpoints to process JSON formatting, which is otherwise + created for Amazon SNS metadata. + + - `RedrivePolicy` -- When specified, sends undeliverable messages to the + specified Amazon SQS dead-letter queue. Messages that can't be + delivered due to client errors (for example, when the subscribed + endpoint is unreachable) or server errors (for example, when the + service that powers the subscribed endpoint becomes unavailable) are + held in the dead-letter queue for further analysis or reprocessing. + + The following attribute applies only to Amazon Data Firehose delivery + stream subscriptions: + + - `SubscriptionRoleArn` -- The ARN of the IAM role that has the + following: + + - Permission to write to the Firehose delivery stream + + - Amazon SNS listed as a trusted entity + + Specifying a valid ARN for this attribute is required for Firehose + delivery stream subscriptions. For more information, see [Fanout to + Firehose delivery + streams](https://docs.aws.amazon.com/sns/latest/dg/sns-firehose-as-subscriber.html) + in the *Amazon SNS Developer Guide*. + + The following attributes apply only to [FIFO + topics](https://docs.aws.amazon.com/sns/latest/dg/sns-fifo-topics.html): + + - `ReplayPolicy` -- Adds or updates an inline policy document for a + subscription to replay messages stored in the specified Amazon SNS + topic. + + - `ReplayStatus` -- Retrieves the status of the subscription message + replay, which can be one of the following: + + - `Completed` -- The replay has successfully redelivered all messages, + and is now delivering newly published messages. If an ending point + was specified in the `ReplayPolicy` then the subscription will no + longer receive newly published messages. + + - `In progress` -- The replay is currently replaying the selected + messages. + + - `Failed` -- The replay was unable to complete. + + - `Pending` -- The default state while the replay initiates. + """ + return_subscription_arn: bool = ... + """ + Sets whether the response from the `Subscribe` request includes the + subscription ARN, even if the subscription is not yet confirmed. + + If you set this parameter to `true`, the response includes the ARN in + all cases, even if the subscription is not yet confirmed. In addition to + the ARN for confirmed subscriptions, the response also includes the + `pending subscription` ARN value for subscriptions that aren't yet + confirmed. A subscription becomes confirmed when the subscriber calls + the `ConfirmSubscription` action with a confirmation token. + + The default value is `false`. + """ + +@dataclass(kw_only=True) +class SubscribeOutput(_SerdeShape): + """Response for Subscribe action.""" + + subscription_arn: str | None = ... + """ + The ARN of the subscription if it is confirmed, or the string \"pending + confirmation\" if the subscription requires confirmation. However, if + the API request parameter `ReturnSubscriptionArn` is true, then the + value is always the subscription ARN, even if the subscription requires + confirmation. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class Subscription(_SerdeShape): + """A wrapper type for the attributes of an Amazon SNS subscription.""" + + subscription_arn: str | None = ... + """The subscription's ARN.""" + owner: str | None = ... + """The subscription's owner.""" + protocol: str | None = ... + """The subscription's protocol.""" + endpoint: str | None = ... + """The subscription's endpoint (format depends on the protocol).""" + topic_arn: str | None = ... + """The ARN of the subscription's topic.""" + +@dataclass(kw_only=True) +class SubscriptionLimitExceededException(ServiceError, _SerdeShape): + """ + Indicates that the customer already owns the maximum allowed number of + subscriptions. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class Tag(_SerdeShape): + """The list of tags to be added to the specified topic.""" + + key: str + """The required key portion of the tag.""" + value: str + """The optional value portion of the tag.""" + +@dataclass(kw_only=True) +class TagLimitExceededException(ServiceError, _SerdeShape): + """Can't add more than 50 tags to a topic.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class TagPolicyException(ServiceError, _SerdeShape): + """ + The request doesn't comply with the IAM tag policy. Correct your + request and then retry it. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class TagResourceInput(_SerdeShape): + """Dataclass for TagResourceInput structure.""" + + resource_arn: str | None = ... + """The ARN of the topic to which to add tags.""" + tags: list[Tag] | None = ... + """ + The tags to be added to the specified topic. A tag consists of a + required key and an optional value. + """ + +@dataclass(kw_only=True) +class TagResourceOutput(_SerdeShape): + """Dataclass for TagResourceOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ThrottledException(ServiceError, _SerdeShape): + """ + Indicates that the rate at which requests have been submitted for this + action exceeds the limit for your Amazon Web Services account. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class TooManyEntriesInBatchRequestException(ServiceError, _SerdeShape): + """The batch request contains more entries than permissible (more than 10).""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class Topic(_SerdeShape): + """ + A wrapper type for the topic's Amazon Resource Name (ARN). To retrieve + a topic's attributes, use `GetTopicAttributes`. + """ + + topic_arn: str | None = ... + """The topic's ARN.""" + +@dataclass(kw_only=True) +class TopicLimitExceededException(ServiceError, _SerdeShape): + """ + Indicates that the customer already owns the maximum allowed number of + topics. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UnsubscribeInput(_SerdeShape): + """Input for Unsubscribe action.""" + + subscription_arn: str | None = ... + """The ARN of the subscription to be deleted.""" + +@dataclass(kw_only=True) +class UnsubscribeOutput(_SerdeShape): + """Dataclass for UnsubscribeOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UntagResourceInput(_SerdeShape): + """Dataclass for UntagResourceInput structure.""" + + resource_arn: str | None = ... + """The ARN of the topic from which to remove tags.""" + tag_keys: list[str] | None = ... + """The list of tag keys to remove from the specified topic.""" + +@dataclass(kw_only=True) +class UntagResourceOutput(_SerdeShape): + """Dataclass for UntagResourceOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UserErrorException(ServiceError, _SerdeShape): + """ + Indicates that a request parameter does not comply with the associated + constraints. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ValidationException(ServiceError, _SerdeShape): + """Indicates that a parameter in the request is invalid.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class VerificationException(ServiceError, _SerdeShape): + """ + Indicates that the one-time password (OTP) used for verification is + invalid. + """ + + status: str + """The status of the verification error.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class VerifySMSSandboxPhoneNumberInput(_SerdeShape): + """Dataclass for VerifySMSSandboxPhoneNumberInput structure.""" + + phone_number: str | None = ... + """The destination phone number to verify.""" + one_time_password: str | None = ... + """ + The OTP sent to the destination number from the + `CreateSMSSandBoxPhoneNumber` call. + """ + +@dataclass(kw_only=True) +class VerifySMSSandboxPhoneNumberOutput(_SerdeShape): + """The destination phone number's verification status.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +ADD_PERMISSION: APIOperation[AddPermissionInput, AddPermissionOutput] +CHECK_IF_PHONE_NUMBER_IS_OPTED_OUT: APIOperation[ + CheckIfPhoneNumberIsOptedOutInput, CheckIfPhoneNumberIsOptedOutOutput +] +CONFIRM_SUBSCRIPTION: APIOperation[ConfirmSubscriptionInput, ConfirmSubscriptionOutput] +CREATE_PLATFORM_APPLICATION: APIOperation[ + CreatePlatformApplicationInput, CreatePlatformApplicationOutput +] +CREATE_PLATFORM_ENDPOINT: APIOperation[ + CreatePlatformEndpointInput, CreatePlatformEndpointOutput +] +CREATE_SMS_SANDBOX_PHONE_NUMBER: APIOperation[ + CreateSMSSandboxPhoneNumberInput, CreateSMSSandboxPhoneNumberOutput +] +CREATE_TOPIC: APIOperation[CreateTopicInput, CreateTopicOutput] +DELETE_ENDPOINT: APIOperation[DeleteEndpointInput, DeleteEndpointOutput] +DELETE_PLATFORM_APPLICATION: APIOperation[ + DeletePlatformApplicationInput, DeletePlatformApplicationOutput +] +DELETE_SMS_SANDBOX_PHONE_NUMBER: APIOperation[ + DeleteSMSSandboxPhoneNumberInput, DeleteSMSSandboxPhoneNumberOutput +] +DELETE_TOPIC: APIOperation[DeleteTopicInput, DeleteTopicOutput] +GET_DATA_PROTECTION_POLICY: APIOperation[ + GetDataProtectionPolicyInput, GetDataProtectionPolicyOutput +] +GET_ENDPOINT_ATTRIBUTES: APIOperation[ + GetEndpointAttributesInput, GetEndpointAttributesOutput +] +GET_PLATFORM_APPLICATION_ATTRIBUTES: APIOperation[ + GetPlatformApplicationAttributesInput, GetPlatformApplicationAttributesOutput +] +GET_SMS_ATTRIBUTES: APIOperation[GetSMSAttributesInput, GetSMSAttributesOutput] +GET_SMS_SANDBOX_ACCOUNT_STATUS: APIOperation[ + GetSMSSandboxAccountStatusInput, GetSMSSandboxAccountStatusOutput +] +GET_SUBSCRIPTION_ATTRIBUTES: APIOperation[ + GetSubscriptionAttributesInput, GetSubscriptionAttributesOutput +] +GET_TOPIC_ATTRIBUTES: APIOperation[GetTopicAttributesInput, GetTopicAttributesOutput] +LIST_ENDPOINTS_BY_PLATFORM_APPLICATION: APIOperation[ + ListEndpointsByPlatformApplicationInput, ListEndpointsByPlatformApplicationOutput +] +LIST_ORIGINATION_NUMBERS: APIOperation[ + ListOriginationNumbersInput, ListOriginationNumbersOutput +] +LIST_PHONE_NUMBERS_OPTED_OUT: APIOperation[ + ListPhoneNumbersOptedOutInput, ListPhoneNumbersOptedOutOutput +] +LIST_PLATFORM_APPLICATIONS: APIOperation[ + ListPlatformApplicationsInput, ListPlatformApplicationsOutput +] +LIST_SMS_SANDBOX_PHONE_NUMBERS: APIOperation[ + ListSMSSandboxPhoneNumbersInput, ListSMSSandboxPhoneNumbersOutput +] +LIST_SUBSCRIPTIONS: APIOperation[ListSubscriptionsInput, ListSubscriptionsOutput] +LIST_SUBSCRIPTIONS_BY_TOPIC: APIOperation[ + ListSubscriptionsByTopicInput, ListSubscriptionsByTopicOutput +] +LIST_TAGS_FOR_RESOURCE: APIOperation[ + ListTagsForResourceInput, ListTagsForResourceOutput +] +LIST_TOPICS: APIOperation[ListTopicsInput, ListTopicsOutput] +OPT_IN_PHONE_NUMBER: APIOperation[OptInPhoneNumberInput, OptInPhoneNumberOutput] +PUBLISH: APIOperation[PublishInput, PublishOutput] +PUBLISH_BATCH: APIOperation[PublishBatchInput, PublishBatchOutput] +PUT_DATA_PROTECTION_POLICY: APIOperation[ + PutDataProtectionPolicyInput, PutDataProtectionPolicyOutput +] +REMOVE_PERMISSION: APIOperation[RemovePermissionInput, RemovePermissionOutput] +SET_ENDPOINT_ATTRIBUTES: APIOperation[ + SetEndpointAttributesInput, SetEndpointAttributesOutput +] +SET_PLATFORM_APPLICATION_ATTRIBUTES: APIOperation[ + SetPlatformApplicationAttributesInput, SetPlatformApplicationAttributesOutput +] +SET_SMS_ATTRIBUTES: APIOperation[SetSMSAttributesInput, SetSMSAttributesOutput] +SET_SUBSCRIPTION_ATTRIBUTES: APIOperation[ + SetSubscriptionAttributesInput, SetSubscriptionAttributesOutput +] +SET_TOPIC_ATTRIBUTES: APIOperation[SetTopicAttributesInput, SetTopicAttributesOutput] +SUBSCRIBE: APIOperation[SubscribeInput, SubscribeOutput] +TAG_RESOURCE: APIOperation[TagResourceInput, TagResourceOutput] +UNSUBSCRIBE: APIOperation[UnsubscribeInput, UnsubscribeOutput] +UNTAG_RESOURCE: APIOperation[UntagResourceInput, UntagResourceOutput] +VERIFY_SMS_SANDBOX_PHONE_NUMBER: APIOperation[ + VerifySMSSandboxPhoneNumberInput, VerifySMSSandboxPhoneNumberOutput +] diff --git a/clients/aws-sdk-sqs/scripts/docs/generate_doc_stubs.py b/clients/aws-sdk-sqs/scripts/docs/generate_doc_stubs.py index 52d470bc..795f2e4b 100644 --- a/clients/aws-sdk-sqs/scripts/docs/generate_doc_stubs.py +++ b/clients/aws-sdk-sqs/scripts/docs/generate_doc_stubs.py @@ -126,7 +126,9 @@ class ClientInfo: class DocStubGenerator: """Generate markdown API Reference stubs for AWS SDK for Python v4 clients.""" - def __init__(self, client_dir: Path, output_dir: Path, service_name: str | None = None) -> None: + def __init__( + self, client_dir: Path, output_dir: Path, service_name: str | None = None + ) -> None: """ Initialize the documentation generator. @@ -190,7 +192,9 @@ def _analyze_client_package(self, package_name: str) -> ClientInfo: required = ("client", "config", "models") missing = [name for name in required if not package.modules.get(name)] if missing: - raise ValueError(f"Missing required modules in {package_name}: {', '.join(missing)}") + raise ValueError( + f"Missing required modules in {package_name}: {', '.join(missing)}" + ) # Parse submodules client_module = package.modules["client"] @@ -199,11 +203,15 @@ def _analyze_client_package(self, package_name: str) -> ClientInfo: client_class = self._find_class_with_suffix(client_module, "Client") if not client_class: - raise ValueError(f"No class ending with 'Client' found in {package_name}.client") + raise ValueError( + f"No class ending with 'Client' found in {package_name}.client" + ) config_class = self._find_class_with_suffix(config_module, "Config") if not config_class: - raise ValueError(f"No class ending with 'Config' found in {package_name}.config") + raise ValueError( + f"No class ending with 'Config' found in {package_name}.config" + ) plugin_alias = config_module.members.get("Plugin") if not plugin_alias: @@ -288,7 +296,9 @@ def _analyze_operation(self, operation: Function) -> OperationInfo: if output_type in stream_type_map: stream_type = stream_type_map[output_type] - stream_args = self._get_subscript_elements(returns, f"'{operation.name}' stream type") + stream_args = self._get_subscript_elements( + returns, f"'{operation.name}' stream type" + ) if stream_type in (StreamType.INPUT, StreamType.DUPLEX): event_input_type = stream_args[0].canonical_name @@ -316,7 +326,9 @@ def _analyze_operation(self, operation: Function) -> OperationInfo: def _get_expr(self, annotation: str | Expr | None, context: str) -> Expr: """Extract and validate an Expr from an annotation.""" if not isinstance(annotation, Expr): - raise TypeError(f"{context}: expected Expr, got {type(annotation).__name__}") + raise TypeError( + f"{context}: expected Expr, got {type(annotation).__name__}" + ) return annotation def _get_subscript_elements(self, expr: Expr, context: str) -> list[Expr]: @@ -330,7 +342,9 @@ def _get_subscript_elements(self, expr: Expr, context: str) -> list[Expr]: return [el for el in slice_expr.elements if isinstance(el, Expr)] return [slice_expr] - def _extract_models(self, models_module: Module, operations: list[OperationInfo]) -> ModelsInfo: + def _extract_models( + self, models_module: Module, operations: list[OperationInfo] + ) -> ModelsInfo: """Extract structures, unions, enums, and errors from models module.""" structures, unions, enums, errors = [], [], [], [] @@ -356,14 +370,16 @@ def _extract_models(self, models_module: Module, operations: list[OperationInfo] duplicates = [] for structure in structures: - if self._is_operation_io_type(structure.name, operations) or self._is_union_member( - structure.name, unions - ): + if self._is_operation_io_type( + structure.name, operations + ) or self._is_union_member(structure.name, unions): duplicates.append(structure) structures = [struct for struct in structures if struct not in duplicates] - return ModelsInfo(structures=structures, unions=unions, enums=enums, errors=errors) + return ModelsInfo( + structures=structures, unions=unions, enums=enums, errors=errors + ) def _is_union(self, member: Object | Alias) -> TypeGuard[Attribute]: """Check if a module member is a union type.""" @@ -399,7 +415,9 @@ def _extract_union_members( for name in member_names: if not (member_object := models_module.members.get(name)): raise ValueError(f"Union member '{name}' not found in models module") - members.append(TypeInfo(name=member_object.name, module_path=member_object.path)) + members.append( + TypeInfo(name=member_object.name, module_path=member_object.path) + ) return members @@ -408,7 +426,8 @@ def _is_enum(self, member: Object | Alias) -> TypeGuard[Class]: if not isinstance(member, Class): return False return any( - isinstance(base, ExprName) and base.name in ENUM_BASE_CLASSES for base in member.bases + isinstance(base, ExprName) and base.name in ENUM_BASE_CLASSES + for base in member.bases ) def _is_error(self, member: Object | Alias) -> TypeGuard[Class]: @@ -416,10 +435,13 @@ def _is_error(self, member: Object | Alias) -> TypeGuard[Class]: if not isinstance(member, Class): return False return any( - isinstance(base, ExprName) and base.name in ERROR_BASE_CLASSES for base in member.bases + isinstance(base, ExprName) and base.name in ERROR_BASE_CLASSES + for base in member.bases ) - def _is_operation_io_type(self, type_name: str, operations: list[OperationInfo]) -> bool: + def _is_operation_io_type( + self, type_name: str, operations: list[OperationInfo] + ) -> bool: """Check if a type is used as operation input/output.""" return any(type_name in (op.input.name, op.output.name) for op in operations) @@ -437,8 +459,12 @@ def _generate_client_docs(self, client_info: ClientInfo) -> bool: self._generate_type_stubs( client_info.models.structures, "structures", "Structure Class" ) - self._generate_type_stubs(client_info.models.errors, "errors", "Error Class") - self._generate_type_stubs(client_info.models.enums, "enums", "Enum Class", members=True) + self._generate_type_stubs( + client_info.models.errors, "errors", "Error Class" + ) + self._generate_type_stubs( + client_info.models.enums, "enums", "Enum Class", members=True + ) self._generate_union_stubs(client_info.models.unions) except OSError as e: logger.error(f"Failed to write documentation files: {e}") @@ -470,7 +496,9 @@ def _generate_index(self, client_info: ClientInfo) -> None: ] for method in sorted(client_info.client_methods, key=lambda x: x.name): - lines.extend([*self._mkdocs_directive(method.module_path, heading_level=4), ""]) + lines.extend( + [*self._mkdocs_directive(method.module_path, heading_level=4), ""] + ) # Operations section if client_info.operations: @@ -578,7 +606,9 @@ def _generate_operation_stubs(self, operations: list[OperationInfo]) -> None: output_path = self.output_dir / "operations" / f"{op.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb("Operations", op.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb("Operations", op.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(operations)} operation file(s)") @@ -600,7 +630,9 @@ def _generate_type_stubs( output_path = self.output_dir / category / f"{item.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb(category.title(), item.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb(category.title(), item.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(items)} {category} file(s)") @@ -624,7 +656,9 @@ def _generate_union_stubs(self, unions: list[UnionInfo]) -> None: output_path = self.output_dir / "unions" / f"{union.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb("Unions", union.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb("Unions", union.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(unions)} union file(s)") diff --git a/clients/aws-sdk-sqs/src/aws_sdk_sqs/_private/schemas.py b/clients/aws-sdk-sqs/src/aws_sdk_sqs/_private/schemas.py index 2d53dfe2..00735bb9 100644 --- a/clients/aws-sdk-sqs/src/aws_sdk_sqs/_private/schemas.py +++ b/clients/aws-sdk-sqs/src/aws_sdk_sqs/_private/schemas.py @@ -2,2219 +2,2043 @@ from types import MappingProxyType -from smithy_core.prelude import UNIT -from smithy_core.schemas import Schema -from smithy_core.shapes import ShapeID, ShapeType -from smithy_core.traits import Trait - - -STRING = Schema(id=ShapeID("com.amazonaws.sqs#String"), shape_type=ShapeType.STRING) - -ACTION_NAME_LIST = Schema.collection( - id=ShapeID("com.amazonaws.sqs#ActionNameList"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, -) - -AWS_ACCOUNT_ID_LIST = Schema.collection( - id=ShapeID("com.amazonaws.sqs#AWSAccountIdList"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, -) - -ADD_PERMISSION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sqs#AddPermissionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sqs#AddPermissionRequest", - ) - ], - members={ - "QueueUrl": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Label": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "AWSAccountIds": { - "target": AWS_ACCOUNT_ID_LIST, - "traits": [ - Trait.new(id=ShapeID("smithy.api#xmlName"), value="AWSAccountId"), - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#xmlFlattened")), - ], - }, - "Actions": { - "target": ACTION_NAME_LIST, - "traits": [ - Trait.new(id=ShapeID("smithy.api#xmlName"), value="ActionName"), - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#xmlFlattened")), - ], - }, - }, -) - -ADD_PERMISSION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sqs#AddPermissionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -EXCEPTION_MESSAGE = Schema( - id=ShapeID("com.amazonaws.sqs#ExceptionMessage"), shape_type=ShapeType.STRING -) - -INVALID_ADDRESS = Schema.collection( - id=ShapeID("com.amazonaws.sqs#InvalidAddress"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=404), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType({"code": "InvalidAddress", "httpResponseCode": 404}), - ), - ], - members={"message": {"target": EXCEPTION_MESSAGE}}, -) - -INVALID_SECURITY = Schema.collection( - id=ShapeID("com.amazonaws.sqs#InvalidSecurity"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=403), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "InvalidSecurity", "httpResponseCode": 403} - ), - ), - ], - members={"message": {"target": EXCEPTION_MESSAGE}}, -) - -OVER_LIMIT = Schema.collection( - id=ShapeID("com.amazonaws.sqs#OverLimit"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=403), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType({"code": "OverLimit", "httpResponseCode": 403}), - ), - ], - members={"message": {"target": EXCEPTION_MESSAGE}}, -) - -QUEUE_DOES_NOT_EXIST = Schema.collection( - id=ShapeID("com.amazonaws.sqs#QueueDoesNotExist"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - { - "code": "AWS.SimpleQueueService.NonExistentQueue", - "httpResponseCode": 400, - } - ), - ), - ], - members={"message": {"target": EXCEPTION_MESSAGE}}, -) - -REQUEST_THROTTLED = Schema.collection( - id=ShapeID("com.amazonaws.sqs#RequestThrottled"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=403), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "RequestThrottled", "httpResponseCode": 403} - ), - ), - ], - members={"message": {"target": EXCEPTION_MESSAGE}}, -) - -UNSUPPORTED_OPERATION = Schema.collection( - id=ShapeID("com.amazonaws.sqs#UnsupportedOperation"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - { - "code": "AWS.SimpleQueueService.UnsupportedOperation", - "httpResponseCode": 400, - } - ), - ), - ], - members={"message": {"target": EXCEPTION_MESSAGE}}, -) - -ADD_PERMISSION = Schema( - id=ShapeID("com.amazonaws.sqs#AddPermission"), shape_type=ShapeType.OPERATION -) - -CANCEL_MESSAGE_MOVE_TASK_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sqs#CancelMessageMoveTaskInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sqs#CancelMessageMoveTaskRequest", - ) - ], - members={ - "TaskHandle": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -LONG = Schema( - id=ShapeID("com.amazonaws.sqs#Long"), - shape_type=ShapeType.LONG, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=0)], -) - -CANCEL_MESSAGE_MOVE_TASK_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sqs#CancelMessageMoveTaskOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sqs#CancelMessageMoveTaskResult", - ) - ], - members={ - "ApproximateNumberOfMessagesMoved": { - "target": LONG, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - } - }, -) - -RESOURCE_NOT_FOUND_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.sqs#ResourceNotFoundException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=404), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "ResourceNotFoundException", "httpResponseCode": 404} - ), - ), - ], - members={"message": {"target": EXCEPTION_MESSAGE}}, -) - -CANCEL_MESSAGE_MOVE_TASK = Schema( - id=ShapeID("com.amazonaws.sqs#CancelMessageMoveTask"), - shape_type=ShapeType.OPERATION, -) - -NULLABLE_INTEGER = Schema( - id=ShapeID("com.amazonaws.sqs#NullableInteger"), shape_type=ShapeType.INTEGER -) - -CHANGE_MESSAGE_VISIBILITY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sqs#ChangeMessageVisibilityInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sqs#ChangeMessageVisibilityRequest", - ) - ], - members={ - "QueueUrl": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ReceiptHandle": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "VisibilityTimeout": { - "target": NULLABLE_INTEGER, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -CHANGE_MESSAGE_VISIBILITY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sqs#ChangeMessageVisibilityOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -MESSAGE_NOT_INFLIGHT = Schema.collection( - id=ShapeID("com.amazonaws.sqs#MessageNotInflight"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - { - "code": "AWS.SimpleQueueService.MessageNotInflight", - "httpResponseCode": 400, - } - ), - ), - ], -) - -RECEIPT_HANDLE_IS_INVALID = Schema.collection( - id=ShapeID("com.amazonaws.sqs#ReceiptHandleIsInvalid"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=404), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "ReceiptHandleIsInvalid", "httpResponseCode": 404} - ), - ), - ], - members={"message": {"target": EXCEPTION_MESSAGE}}, -) - -CHANGE_MESSAGE_VISIBILITY = Schema( - id=ShapeID("com.amazonaws.sqs#ChangeMessageVisibility"), - shape_type=ShapeType.OPERATION, -) - -BATCH_ENTRY_IDS_NOT_DISTINCT = Schema.collection( - id=ShapeID("com.amazonaws.sqs#BatchEntryIdsNotDistinct"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - { - "code": "AWS.SimpleQueueService.BatchEntryIdsNotDistinct", - "httpResponseCode": 400, - } - ), - ), - ], - members={"message": {"target": EXCEPTION_MESSAGE}}, -) - -CHANGE_MESSAGE_VISIBILITY_BATCH_REQUEST_ENTRY = Schema.collection( - id=ShapeID("com.amazonaws.sqs#ChangeMessageVisibilityBatchRequestEntry"), - members={ - "Id": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ReceiptHandle": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "VisibilityTimeout": {"target": NULLABLE_INTEGER}, - }, -) - -CHANGE_MESSAGE_VISIBILITY_BATCH_REQUEST_ENTRY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.sqs#ChangeMessageVisibilityBatchRequestEntryList"), - shape_type=ShapeType.LIST, - members={"member": {"target": CHANGE_MESSAGE_VISIBILITY_BATCH_REQUEST_ENTRY}}, -) - -CHANGE_MESSAGE_VISIBILITY_BATCH_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sqs#ChangeMessageVisibilityBatchInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sqs#ChangeMessageVisibilityBatchRequest", - ) - ], - members={ - "QueueUrl": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Entries": { - "target": CHANGE_MESSAGE_VISIBILITY_BATCH_REQUEST_ENTRY_LIST, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#xmlName"), - value="ChangeMessageVisibilityBatchRequestEntry", - ), - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#xmlFlattened")), - ], - }, - }, -) - -BOOLEAN = Schema( - id=ShapeID("com.amazonaws.sqs#Boolean"), - shape_type=ShapeType.BOOLEAN, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=False)], -) - -BATCH_RESULT_ERROR_ENTRY = Schema.collection( - id=ShapeID("com.amazonaws.sqs#BatchResultErrorEntry"), - members={ - "Id": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "SenderFault": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=False), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Code": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Message": {"target": STRING}, - }, -) - -BATCH_RESULT_ERROR_ENTRY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.sqs#BatchResultErrorEntryList"), - shape_type=ShapeType.LIST, - members={"member": {"target": BATCH_RESULT_ERROR_ENTRY}}, -) - -CHANGE_MESSAGE_VISIBILITY_BATCH_RESULT_ENTRY = Schema.collection( - id=ShapeID("com.amazonaws.sqs#ChangeMessageVisibilityBatchResultEntry"), - members={ - "Id": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -CHANGE_MESSAGE_VISIBILITY_BATCH_RESULT_ENTRY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.sqs#ChangeMessageVisibilityBatchResultEntryList"), - shape_type=ShapeType.LIST, - members={"member": {"target": CHANGE_MESSAGE_VISIBILITY_BATCH_RESULT_ENTRY}}, -) - -CHANGE_MESSAGE_VISIBILITY_BATCH_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sqs#ChangeMessageVisibilityBatchOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sqs#ChangeMessageVisibilityBatchResult", - ) - ], - members={ - "Successful": { - "target": CHANGE_MESSAGE_VISIBILITY_BATCH_RESULT_ENTRY_LIST, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#xmlName"), - value="ChangeMessageVisibilityBatchResultEntry", - ), - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#xmlFlattened")), - ], - }, - "Failed": { - "target": BATCH_RESULT_ERROR_ENTRY_LIST, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#xmlName"), value="BatchResultErrorEntry" - ), - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#xmlFlattened")), - ], - }, - }, -) - -EMPTY_BATCH_REQUEST = Schema.collection( - id=ShapeID("com.amazonaws.sqs#EmptyBatchRequest"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - { - "code": "AWS.SimpleQueueService.EmptyBatchRequest", - "httpResponseCode": 400, - } - ), - ), - ], - members={"message": {"target": EXCEPTION_MESSAGE}}, -) - -INVALID_BATCH_ENTRY_ID = Schema.collection( - id=ShapeID("com.amazonaws.sqs#InvalidBatchEntryId"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - { - "code": "AWS.SimpleQueueService.InvalidBatchEntryId", - "httpResponseCode": 400, - } - ), - ), - ], - members={"message": {"target": EXCEPTION_MESSAGE}}, -) - -TOO_MANY_ENTRIES_IN_BATCH_REQUEST = Schema.collection( - id=ShapeID("com.amazonaws.sqs#TooManyEntriesInBatchRequest"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - { - "code": "AWS.SimpleQueueService.TooManyEntriesInBatchRequest", - "httpResponseCode": 400, - } - ), - ), - ], - members={"message": {"target": EXCEPTION_MESSAGE}}, -) - -CHANGE_MESSAGE_VISIBILITY_BATCH = Schema( - id=ShapeID("com.amazonaws.sqs#ChangeMessageVisibilityBatch"), - shape_type=ShapeType.OPERATION, -) - -QUEUE_ATTRIBUTE_NAME = Schema.collection( - id=ShapeID("com.amazonaws.sqs#QueueAttributeName"), - shape_type=ShapeType.ENUM, - members={ - "All": {"target": UNIT}, - "Policy": {"target": UNIT}, - "VisibilityTimeout": {"target": UNIT}, - "MaximumMessageSize": {"target": UNIT}, - "MessageRetentionPeriod": {"target": UNIT}, - "ApproximateNumberOfMessages": {"target": UNIT}, - "ApproximateNumberOfMessagesNotVisible": {"target": UNIT}, - "CreatedTimestamp": {"target": UNIT}, - "LastModifiedTimestamp": {"target": UNIT}, - "QueueArn": {"target": UNIT}, - "ApproximateNumberOfMessagesDelayed": {"target": UNIT}, - "DelaySeconds": {"target": UNIT}, - "ReceiveMessageWaitTimeSeconds": {"target": UNIT}, - "RedrivePolicy": {"target": UNIT}, - "FifoQueue": {"target": UNIT}, - "ContentBasedDeduplication": {"target": UNIT}, - "KmsMasterKeyId": {"target": UNIT}, - "KmsDataKeyReusePeriodSeconds": {"target": UNIT}, - "DeduplicationScope": {"target": UNIT}, - "FifoThroughputLimit": {"target": UNIT}, - "RedriveAllowPolicy": {"target": UNIT}, - "SqsManagedSseEnabled": {"target": UNIT}, - }, -) - -QUEUE_ATTRIBUTE_MAP = Schema.collection( - id=ShapeID("com.amazonaws.sqs#QueueAttributeMap"), - shape_type=ShapeType.MAP, - members={ - "key": { - "target": QUEUE_ATTRIBUTE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#xmlName"), value="Name")], - }, - "value": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#xmlName"), value="Value")], - }, - }, -) - -TAG_KEY = Schema(id=ShapeID("com.amazonaws.sqs#TagKey"), shape_type=ShapeType.STRING) - -TAG_VALUE = Schema( - id=ShapeID("com.amazonaws.sqs#TagValue"), shape_type=ShapeType.STRING -) - -TAG_MAP = Schema.collection( - id=ShapeID("com.amazonaws.sqs#TagMap"), - shape_type=ShapeType.MAP, - members={ - "key": { - "target": TAG_KEY, - "traits": [Trait.new(id=ShapeID("smithy.api#xmlName"), value="Key")], - }, - "value": { - "target": TAG_VALUE, - "traits": [Trait.new(id=ShapeID("smithy.api#xmlName"), value="Value")], - }, - }, -) - -CREATE_QUEUE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sqs#CreateQueueInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sqs#CreateQueueRequest", - ) - ], - members={ - "QueueName": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Attributes": { - "target": QUEUE_ATTRIBUTE_MAP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#xmlName"), value="Attribute"), - Trait.new(id=ShapeID("smithy.api#xmlFlattened")), - ], - }, - "tags": { - "target": TAG_MAP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#xmlName"), value="Tag"), - Trait.new(id=ShapeID("smithy.api#xmlFlattened")), - ], - }, - }, -) - -CREATE_QUEUE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sqs#CreateQueueOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sqs#CreateQueueResult", - ) - ], - members={"QueueUrl": {"target": STRING}}, -) - -INVALID_ATTRIBUTE_NAME = Schema.collection( - id=ShapeID("com.amazonaws.sqs#InvalidAttributeName"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], - members={"message": {"target": EXCEPTION_MESSAGE}}, -) - -INVALID_ATTRIBUTE_VALUE = Schema.collection( - id=ShapeID("com.amazonaws.sqs#InvalidAttributeValue"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], - members={"message": {"target": EXCEPTION_MESSAGE}}, -) - -QUEUE_DELETED_RECENTLY = Schema.collection( - id=ShapeID("com.amazonaws.sqs#QueueDeletedRecently"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - { - "code": "AWS.SimpleQueueService.QueueDeletedRecently", - "httpResponseCode": 400, - } - ), +from smithy_core._schema_compact import StaticOperationSchema, StaticSchema + + +n0 = "com.amazonaws.sqs" +_S = "String" +_ANL = "ActionNameList" +_m = "member" +_AWSAIL = "AWSAccountIdList" +_API = "AddPermissionInput" +_sSI = "smithy.synthetic#originalShapeId" +_cAPR = "com.amazonaws.sqs#AddPermissionRequest" +_s = "smithy.api#input" +_QU = "QueueUrl" +_sm = "smithy.api#required" +_L = "Label" +_AWSAI = "AWSAccountIds" +_sN = "smithy.api#xmlName" +_AWSAIc = "AWSAccountId" +_sF = "smithy.api#xmlFlattened" +_A = "Actions" +_AN = "ActionName" +_APO = "AddPermissionOutput" +_sU = "smithy.api#Unit" +_smi = "smithy.api#output" +_EM = "ExceptionMessage" +_IA = "InvalidAddress" +_smit = "smithy.api#error" +_c = "client" +_sE = "smithy.api#httpError" +_me = "message" +_IS = "InvalidSecurity" +_OL = "OverLimit" +_QDNE = "QueueDoesNotExist" +_RT = "RequestThrottled" +_UO = "UnsupportedOperation" +_AP = "AddPermission" +_CMMTI = "CancelMessageMoveTaskInput" +_cCMMTR = "com.amazonaws.sqs#CancelMessageMoveTaskRequest" +_TH = "TaskHandle" +_Lo = "Long" +_smith = "smithy.api#default" +_CMMTO = "CancelMessageMoveTaskOutput" +_cCMMTRo = "com.amazonaws.sqs#CancelMessageMoveTaskResult" +_ANOMM = "ApproximateNumberOfMessagesMoved" +_RNFE = "ResourceNotFoundException" +_CMMT = "CancelMessageMoveTask" +_NI = "NullableInteger" +_CMVI = "ChangeMessageVisibilityInput" +_cCMVR = "com.amazonaws.sqs#ChangeMessageVisibilityRequest" +_RH = "ReceiptHandle" +_VT = "VisibilityTimeout" +_CMVO = "ChangeMessageVisibilityOutput" +_MNI = "MessageNotInflight" +_RHII = "ReceiptHandleIsInvalid" +_CMV = "ChangeMessageVisibility" +_BEIND = "BatchEntryIdsNotDistinct" +_CMVBRE = "ChangeMessageVisibilityBatchRequestEntry" +_I = "Id" +_CMVBREL = "ChangeMessageVisibilityBatchRequestEntryList" +_CMVBI = "ChangeMessageVisibilityBatchInput" +_cCMVBR = "com.amazonaws.sqs#ChangeMessageVisibilityBatchRequest" +_E = "Entries" +_B = "Boolean" +_BREE = "BatchResultErrorEntry" +_SF = "SenderFault" +_C = "Code" +_M = "Message" +_BREEL = "BatchResultErrorEntryList" +_CMVBREh = "ChangeMessageVisibilityBatchResultEntry" +_CMVBRELh = "ChangeMessageVisibilityBatchResultEntryList" +_CMVBO = "ChangeMessageVisibilityBatchOutput" +_cCMVBRo = "com.amazonaws.sqs#ChangeMessageVisibilityBatchResult" +_Su = "Successful" +_F = "Failed" +_EBR = "EmptyBatchRequest" +_IBEI = "InvalidBatchEntryId" +_TMEIBR = "TooManyEntriesInBatchRequest" +_CMVB = "ChangeMessageVisibilityBatch" +_QAN = "QueueAttributeName" +_Al = "All" +_sV = "smithy.api#enumValue" +_P = "Policy" +_MMS = "MaximumMessageSize" +_MRP = "MessageRetentionPeriod" +_ANOM = "ApproximateNumberOfMessages" +_ANOMNV = "ApproximateNumberOfMessagesNotVisible" +_CT = "CreatedTimestamp" +_LMT = "LastModifiedTimestamp" +_QA = "QueueArn" +_ANOMD = "ApproximateNumberOfMessagesDelayed" +_DS = "DelaySeconds" +_RMWTS = "ReceiveMessageWaitTimeSeconds" +_RP = "RedrivePolicy" +_FQ = "FifoQueue" +_CBD = "ContentBasedDeduplication" +_KMKI = "KmsMasterKeyId" +_KDKRPS = "KmsDataKeyReusePeriodSeconds" +_DSe = "DeduplicationScope" +_FTL = "FifoThroughputLimit" +_RAP = "RedriveAllowPolicy" +_SMSE = "SqsManagedSseEnabled" +_QAM = "QueueAttributeMap" +_k = "key" +_N = "Name" +_v = "value" +_V = "Value" +_TK = "TagKey" +_TV = "TagValue" +_TM = "TagMap" +_K = "Key" +_CQI = "CreateQueueInput" +_cCQR = "com.amazonaws.sqs#CreateQueueRequest" +_QN = "QueueName" +_At = "Attributes" +_Att = "Attribute" +_t = "tags" +_T = "Tag" +_CQO = "CreateQueueOutput" +_cCQRo = "com.amazonaws.sqs#CreateQueueResult" +_IAN = "InvalidAttributeName" +_IAV = "InvalidAttributeValue" +_QDR = "QueueDeletedRecently" +_QNE = "QueueNameExists" +_CQ = "CreateQueue" +_DMI = "DeleteMessageInput" +_cDMR = "com.amazonaws.sqs#DeleteMessageRequest" +_DMO = "DeleteMessageOutput" +_IIF = "InvalidIdFormat" +_DM = "DeleteMessage" +_DMBRE = "DeleteMessageBatchRequestEntry" +_DMBREL = "DeleteMessageBatchRequestEntryList" +_DMBI = "DeleteMessageBatchInput" +_cDMBR = "com.amazonaws.sqs#DeleteMessageBatchRequest" +_DMBREe = "DeleteMessageBatchResultEntry" +_DMBRELe = "DeleteMessageBatchResultEntryList" +_DMBO = "DeleteMessageBatchOutput" +_cDMBRo = "com.amazonaws.sqs#DeleteMessageBatchResult" +_DMB = "DeleteMessageBatch" +_DQI = "DeleteQueueInput" +_cDQR = "com.amazonaws.sqs#DeleteQueueRequest" +_DQO = "DeleteQueueOutput" +_DQ = "DeleteQueue" +_ANLt = "AttributeNameList" +_GQAI = "GetQueueAttributesInput" +_cGQAR = "com.amazonaws.sqs#GetQueueAttributesRequest" +_ANt = "AttributeNames" +_ANtt = "AttributeName" +_GQAO = "GetQueueAttributesOutput" +_cGQARo = "com.amazonaws.sqs#GetQueueAttributesResult" +_GQA = "GetQueueAttributes" +_GQUI = "GetQueueUrlInput" +_cGQUR = "com.amazonaws.sqs#GetQueueUrlRequest" +_QOAWSAI = "QueueOwnerAWSAccountId" +_GQUO = "GetQueueUrlOutput" +_cGQURo = "com.amazonaws.sqs#GetQueueUrlResult" +_GQU = "GetQueueUrl" +_BI = "BoxedInteger" +_To = "Token" +_LDLSQI = "ListDeadLetterSourceQueuesInput" +_cLDLSQR = "com.amazonaws.sqs#ListDeadLetterSourceQueuesRequest" +_NT = "NextToken" +_MR = "MaxResults" +_QUL = "QueueUrlList" +_LDLSQO = "ListDeadLetterSourceQueuesOutput" +_cLDLSQRo = "com.amazonaws.sqs#ListDeadLetterSourceQueuesResult" +_qU = "queueUrls" +_LDLSQ = "ListDeadLetterSourceQueues" +_LMMTI = "ListMessageMoveTasksInput" +_cLMMTR = "com.amazonaws.sqs#ListMessageMoveTasksRequest" +_SA = "SourceArn" +_NL = "NullableLong" +_LMMTRE = "ListMessageMoveTasksResultEntry" +_St = "Status" +_DA = "DestinationArn" +_MNOMPS = "MaxNumberOfMessagesPerSecond" +_ANOMTM = "ApproximateNumberOfMessagesToMove" +_FR = "FailureReason" +_ST = "StartedTimestamp" +_LMMTREL = "ListMessageMoveTasksResultEntryList" +_LMMTO = "ListMessageMoveTasksOutput" +_LMMTR = "ListMessageMoveTasksResult" +_cLMMTRo = "com.amazonaws.sqs#ListMessageMoveTasksResult" +_R = "Results" +_LMMT = "ListMessageMoveTasks" +_LQI = "ListQueuesInput" +_cLQR = "com.amazonaws.sqs#ListQueuesRequest" +_QNP = "QueueNamePrefix" +_LQO = "ListQueuesOutput" +_cLQRo = "com.amazonaws.sqs#ListQueuesResult" +_QUu = "QueueUrls" +_LQ = "ListQueues" +_LQTI = "ListQueueTagsInput" +_cLQTR = "com.amazonaws.sqs#ListQueueTagsRequest" +_LQTO = "ListQueueTagsOutput" +_cLQTRo = "com.amazonaws.sqs#ListQueueTagsResult" +_Ta = "Tags" +_LQT = "ListQueueTags" +_PQIP = "PurgeQueueInProgress" +_PQI = "PurgeQueueInput" +_cPQR = "com.amazonaws.sqs#PurgeQueueRequest" +_PQO = "PurgeQueueOutput" +_PQ = "PurgeQueue" +_KAD = "KmsAccessDenied" +_KD = "KmsDisabled" +_KIKU = "KmsInvalidKeyUsage" +_KIS = "KmsInvalidState" +_KNF = "KmsNotFound" +_KOIR = "KmsOptInRequired" +_KT = "KmsThrottled" +_MAN = "MessageAttributeName" +_MANL = "MessageAttributeNameList" +_MSAN = "MessageSystemAttributeName" +_SI = "SenderId" +_STe = "SentTimestamp" +_ARC = "ApproximateReceiveCount" +_AFRT = "ApproximateFirstReceiveTimestamp" +_SN = "SequenceNumber" +_MDI = "MessageDeduplicationId" +_MGI = "MessageGroupId" +_AWSTH = "AWSTraceHeader" +_DLQSA = "DeadLetterQueueSourceArn" +_MSAL = "MessageSystemAttributeList" +_RMI = "ReceiveMessageInput" +_cRMR = "com.amazonaws.sqs#ReceiveMessageRequest" +_MSANe = "MessageSystemAttributeNames" +_MANe = "MessageAttributeNames" +_MNOM = "MaxNumberOfMessages" +_WTS = "WaitTimeSeconds" +_RRAI = "ReceiveRequestAttemptId" +_MSAM = "MessageSystemAttributeMap" +_Bi = "Binary" +_BL = "BinaryList" +_BLV = "BinaryListValue" +_SL = "StringList" +_SLV = "StringListValue" +_MAV = "MessageAttributeValue" +_SV = "StringValue" +_BV = "BinaryValue" +_SLVt = "StringListValues" +_BLVi = "BinaryListValues" +_DT = "DataType" +_MBAM = "MessageBodyAttributeMap" +_MI = "MessageId" +_MDOB = "MD5OfBody" +_Bo = "Body" +_MDOMA = "MD5OfMessageAttributes" +_MA = "MessageAttributes" +_MAe = "MessageAttribute" +_ML = "MessageList" +_RMO = "ReceiveMessageOutput" +_cRMRo = "com.amazonaws.sqs#ReceiveMessageResult" +_Me = "Messages" +_RM = "ReceiveMessage" +_RPI = "RemovePermissionInput" +_cRPR = "com.amazonaws.sqs#RemovePermissionRequest" +_RPO = "RemovePermissionOutput" +_RPe = "RemovePermission" +_IMC = "InvalidMessageContents" +_MSANFS = "MessageSystemAttributeNameForSends" +_MSAV = "MessageSystemAttributeValue" +_MBSAM = "MessageBodySystemAttributeMap" +_SMI = "SendMessageInput" +_cSMR = "com.amazonaws.sqs#SendMessageRequest" +_MB = "MessageBody" +_MSA = "MessageSystemAttributes" +_MSAe = "MessageSystemAttribute" +_SMO = "SendMessageOutput" +_cSMRo = "com.amazonaws.sqs#SendMessageResult" +_MDOMB = "MD5OfMessageBody" +_MDOMSA = "MD5OfMessageSystemAttributes" +_SM = "SendMessage" +_BRTL = "BatchRequestTooLong" +_SMBRE = "SendMessageBatchRequestEntry" +_SMBREL = "SendMessageBatchRequestEntryList" +_SMBI = "SendMessageBatchInput" +_cSMBR = "com.amazonaws.sqs#SendMessageBatchRequest" +_SMBREe = "SendMessageBatchResultEntry" +_SMBRELe = "SendMessageBatchResultEntryList" +_SMBO = "SendMessageBatchOutput" +_cSMBRo = "com.amazonaws.sqs#SendMessageBatchResult" +_SMB = "SendMessageBatch" +_SQAI = "SetQueueAttributesInput" +_cSQAR = "com.amazonaws.sqs#SetQueueAttributesRequest" +_SQAO = "SetQueueAttributesOutput" +_SQA = "SetQueueAttributes" +_SMMTI = "StartMessageMoveTaskInput" +_cSMMTR = "com.amazonaws.sqs#StartMessageMoveTaskRequest" +_SMMTO = "StartMessageMoveTaskOutput" +_cSMMTRo = "com.amazonaws.sqs#StartMessageMoveTaskResult" +_SMMT = "StartMessageMoveTask" +_TQI = "TagQueueInput" +_cTQR = "com.amazonaws.sqs#TagQueueRequest" +_TQO = "TagQueueOutput" +_TQ = "TagQueue" +_TKL = "TagKeyList" +_UQI = "UntagQueueInput" +_cUQR = "com.amazonaws.sqs#UntagQueueRequest" +_TKa = "TagKeys" +_UQO = "UntagQueueOutput" +_UQ = "UntagQueue" +_ASQS = "AmazonSQS" +_a = "aws.auth#sigv4" +_a_ = "aws.protocols#awsJson1_0" +_sB = "smithy.rules#endpointBdd" +_aw = "aws.api#service" + +STRING: StaticSchema = (3, n0, _S, 0) + +ACTION_NAME_LIST: StaticSchema = (16, n0, _ANL, 0, (_m,), ((STRING, 0),)) + +AWS_ACCOUNT_ID_LIST: StaticSchema = (16, n0, _AWSAIL, 0, (_m,), ((STRING, 0),)) + +ADD_PERMISSION_INPUT: StaticSchema = ( + 18, + n0, + _API, + {_sSI: _cAPR, _s: None}, + (_QU, _L, _AWSAI, _A), + ( + (STRING, 1), + (STRING, 1), + (AWS_ACCOUNT_ID_LIST, {_sN: _AWSAIc, _sF: None, _sm: None}), + (ACTION_NAME_LIST, {_sN: _AN, _sF: None, _sm: None}), + ), +) + +ADD_PERMISSION_OUTPUT: StaticSchema = (18, n0, _APO, {_sSI: _sU, _smi: None}) + +EXCEPTION_MESSAGE: StaticSchema = (3, n0, _EM, 0) + +INVALID_ADDRESS: StaticSchema = ( + 18, + n0, + _IA, + {_smit: _c, _sE: 404}, + (_me,), + ((EXCEPTION_MESSAGE, 0),), +) + +INVALID_SECURITY: StaticSchema = ( + 18, + n0, + _IS, + {_smit: _c, _sE: 403}, + (_me,), + ((EXCEPTION_MESSAGE, 0),), +) + +OVER_LIMIT: StaticSchema = ( + 18, + n0, + _OL, + {_smit: _c, _sE: 403}, + (_me,), + ((EXCEPTION_MESSAGE, 0),), +) + +QUEUE_DOES_NOT_EXIST: StaticSchema = ( + 18, + n0, + _QDNE, + {_smit: _c, _sE: 400}, + (_me,), + ((EXCEPTION_MESSAGE, 0),), +) + +REQUEST_THROTTLED: StaticSchema = ( + 18, + n0, + _RT, + {_smit: _c, _sE: 403}, + (_me,), + ((EXCEPTION_MESSAGE, 0),), +) + +UNSUPPORTED_OPERATION: StaticSchema = ( + 18, + n0, + _UO, + {_smit: _c, _sE: 400}, + (_me,), + ((EXCEPTION_MESSAGE, 0),), +) + +ADD_PERMISSION: StaticOperationSchema = ( + 23, + n0, + _AP, + 0, + ADD_PERMISSION_INPUT, + ADD_PERMISSION_OUTPUT, + ( + INVALID_ADDRESS, + INVALID_SECURITY, + OVER_LIMIT, + QUEUE_DOES_NOT_EXIST, + REQUEST_THROTTLED, + UNSUPPORTED_OPERATION, + ), +) + +CANCEL_MESSAGE_MOVE_TASK_INPUT: StaticSchema = ( + 18, + n0, + _CMMTI, + {_sSI: _cCMMTR, _s: None}, + (_TH,), + ((STRING, 1),), +) + +LONG: StaticSchema = (8, n0, _Lo, {_smith: 0}) + +CANCEL_MESSAGE_MOVE_TASK_OUTPUT: StaticSchema = ( + 18, + n0, + _CMMTO, + {_sSI: _cCMMTRo, _smi: None}, + (_ANOMM,), + ((LONG, {_smith: 0}),), +) + +RESOURCE_NOT_FOUND_EXCEPTION: StaticSchema = ( + 18, + n0, + _RNFE, + {_smit: _c, _sE: 404}, + (_me,), + ((EXCEPTION_MESSAGE, 0),), +) + +CANCEL_MESSAGE_MOVE_TASK: StaticOperationSchema = ( + 23, + n0, + _CMMT, + 0, + CANCEL_MESSAGE_MOVE_TASK_INPUT, + CANCEL_MESSAGE_MOVE_TASK_OUTPUT, + ( + INVALID_ADDRESS, + INVALID_SECURITY, + REQUEST_THROTTLED, + RESOURCE_NOT_FOUND_EXCEPTION, + UNSUPPORTED_OPERATION, + ), +) + +NULLABLE_INTEGER: StaticSchema = (7, n0, _NI, 0) + +CHANGE_MESSAGE_VISIBILITY_INPUT: StaticSchema = ( + 18, + n0, + _CMVI, + {_sSI: _cCMVR, _s: None}, + (_QU, _RH, _VT), + ((STRING, 1), (STRING, 1), (NULLABLE_INTEGER, 1)), +) + +CHANGE_MESSAGE_VISIBILITY_OUTPUT: StaticSchema = ( + 18, + n0, + _CMVO, + {_sSI: _sU, _smi: None}, +) + +MESSAGE_NOT_INFLIGHT: StaticSchema = (18, n0, _MNI, {_smit: _c, _sE: 400}) + +RECEIPT_HANDLE_IS_INVALID: StaticSchema = ( + 18, + n0, + _RHII, + {_smit: _c, _sE: 404}, + (_me,), + ((EXCEPTION_MESSAGE, 0),), +) + +CHANGE_MESSAGE_VISIBILITY: StaticOperationSchema = ( + 23, + n0, + _CMV, + 0, + CHANGE_MESSAGE_VISIBILITY_INPUT, + CHANGE_MESSAGE_VISIBILITY_OUTPUT, + ( + INVALID_ADDRESS, + INVALID_SECURITY, + MESSAGE_NOT_INFLIGHT, + QUEUE_DOES_NOT_EXIST, + RECEIPT_HANDLE_IS_INVALID, + REQUEST_THROTTLED, + UNSUPPORTED_OPERATION, + ), +) + +BATCH_ENTRY_IDS_NOT_DISTINCT: StaticSchema = ( + 18, + n0, + _BEIND, + {_smit: _c, _sE: 400}, + (_me,), + ((EXCEPTION_MESSAGE, 0),), +) + +CHANGE_MESSAGE_VISIBILITY_BATCH_REQUEST_ENTRY: StaticSchema = ( + 18, + n0, + _CMVBRE, + 0, + (_I, _RH, _VT), + ((STRING, 1), (STRING, 1), (NULLABLE_INTEGER, 0)), +) + +CHANGE_MESSAGE_VISIBILITY_BATCH_REQUEST_ENTRY_LIST: StaticSchema = ( + 16, + n0, + _CMVBREL, + 0, + (_m,), + ((CHANGE_MESSAGE_VISIBILITY_BATCH_REQUEST_ENTRY, 0),), +) + +CHANGE_MESSAGE_VISIBILITY_BATCH_INPUT: StaticSchema = ( + 18, + n0, + _CMVBI, + {_sSI: _cCMVBR, _s: None}, + (_QU, _E), + ( + (STRING, 1), + ( + CHANGE_MESSAGE_VISIBILITY_BATCH_REQUEST_ENTRY_LIST, + {_sN: _CMVBRE, _sF: None, _sm: None}, ), - ], - members={"message": {"target": EXCEPTION_MESSAGE}}, -) - -QUEUE_NAME_EXISTS = Schema.collection( - id=ShapeID("com.amazonaws.sqs#QueueNameExists"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "QueueAlreadyExists", "httpResponseCode": 400} - ), + ), +) + +BOOLEAN: StaticSchema = (2, n0, _B, {_smith: False}) + +BATCH_RESULT_ERROR_ENTRY: StaticSchema = ( + 18, + n0, + _BREE, + 0, + (_I, _SF, _C, _M), + ((STRING, 1), (BOOLEAN, {_smith: False, _sm: None}), (STRING, 1), (STRING, 0)), +) + +BATCH_RESULT_ERROR_ENTRY_LIST: StaticSchema = ( + 16, + n0, + _BREEL, + 0, + (_m,), + ((BATCH_RESULT_ERROR_ENTRY, 0),), +) + +CHANGE_MESSAGE_VISIBILITY_BATCH_RESULT_ENTRY: StaticSchema = ( + 18, + n0, + _CMVBREh, + 0, + (_I,), + ((STRING, 1),), +) + +CHANGE_MESSAGE_VISIBILITY_BATCH_RESULT_ENTRY_LIST: StaticSchema = ( + 16, + n0, + _CMVBRELh, + 0, + (_m,), + ((CHANGE_MESSAGE_VISIBILITY_BATCH_RESULT_ENTRY, 0),), +) + +CHANGE_MESSAGE_VISIBILITY_BATCH_OUTPUT: StaticSchema = ( + 18, + n0, + _CMVBO, + {_sSI: _cCMVBRo, _smi: None}, + (_Su, _F), + ( + ( + CHANGE_MESSAGE_VISIBILITY_BATCH_RESULT_ENTRY_LIST, + {_sN: _CMVBREh, _sF: None, _sm: None}, ), - ], - members={"message": {"target": EXCEPTION_MESSAGE}}, -) - -CREATE_QUEUE = Schema( - id=ShapeID("com.amazonaws.sqs#CreateQueue"), shape_type=ShapeType.OPERATION -) - -DELETE_MESSAGE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sqs#DeleteMessageInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sqs#DeleteMessageRequest", - ) - ], - members={ - "QueueUrl": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ReceiptHandle": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -DELETE_MESSAGE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sqs#DeleteMessageOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -INVALID_ID_FORMAT = Schema.collection( - id=ShapeID("com.amazonaws.sqs#InvalidIdFormat"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], -) - -DELETE_MESSAGE = Schema( - id=ShapeID("com.amazonaws.sqs#DeleteMessage"), shape_type=ShapeType.OPERATION -) - -DELETE_MESSAGE_BATCH_REQUEST_ENTRY = Schema.collection( - id=ShapeID("com.amazonaws.sqs#DeleteMessageBatchRequestEntry"), - members={ - "Id": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ReceiptHandle": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -DELETE_MESSAGE_BATCH_REQUEST_ENTRY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.sqs#DeleteMessageBatchRequestEntryList"), - shape_type=ShapeType.LIST, - members={"member": {"target": DELETE_MESSAGE_BATCH_REQUEST_ENTRY}}, -) - -DELETE_MESSAGE_BATCH_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sqs#DeleteMessageBatchInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sqs#DeleteMessageBatchRequest", - ) - ], - members={ - "QueueUrl": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Entries": { - "target": DELETE_MESSAGE_BATCH_REQUEST_ENTRY_LIST, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#xmlName"), - value="DeleteMessageBatchRequestEntry", - ), - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#xmlFlattened")), - ], - }, - }, -) - -DELETE_MESSAGE_BATCH_RESULT_ENTRY = Schema.collection( - id=ShapeID("com.amazonaws.sqs#DeleteMessageBatchResultEntry"), - members={ - "Id": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -DELETE_MESSAGE_BATCH_RESULT_ENTRY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.sqs#DeleteMessageBatchResultEntryList"), - shape_type=ShapeType.LIST, - members={"member": {"target": DELETE_MESSAGE_BATCH_RESULT_ENTRY}}, -) - -DELETE_MESSAGE_BATCH_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sqs#DeleteMessageBatchOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sqs#DeleteMessageBatchResult", - ) - ], - members={ - "Successful": { - "target": DELETE_MESSAGE_BATCH_RESULT_ENTRY_LIST, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#xmlName"), - value="DeleteMessageBatchResultEntry", - ), - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#xmlFlattened")), - ], - }, - "Failed": { - "target": BATCH_RESULT_ERROR_ENTRY_LIST, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#xmlName"), value="BatchResultErrorEntry" - ), - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#xmlFlattened")), - ], - }, - }, -) - -DELETE_MESSAGE_BATCH = Schema( - id=ShapeID("com.amazonaws.sqs#DeleteMessageBatch"), shape_type=ShapeType.OPERATION -) - -DELETE_QUEUE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sqs#DeleteQueueInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sqs#DeleteQueueRequest", - ) - ], - members={ - "QueueUrl": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -DELETE_QUEUE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sqs#DeleteQueueOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -DELETE_QUEUE = Schema( - id=ShapeID("com.amazonaws.sqs#DeleteQueue"), shape_type=ShapeType.OPERATION -) - -ATTRIBUTE_NAME_LIST = Schema.collection( - id=ShapeID("com.amazonaws.sqs#AttributeNameList"), - shape_type=ShapeType.LIST, - members={"member": {"target": QUEUE_ATTRIBUTE_NAME}}, -) - -GET_QUEUE_ATTRIBUTES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sqs#GetQueueAttributesInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sqs#GetQueueAttributesRequest", - ) - ], - members={ - "QueueUrl": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "AttributeNames": { - "target": ATTRIBUTE_NAME_LIST, - "traits": [ - Trait.new(id=ShapeID("smithy.api#xmlName"), value="AttributeName"), - Trait.new(id=ShapeID("smithy.api#xmlFlattened")), - ], - }, - }, -) - -GET_QUEUE_ATTRIBUTES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sqs#GetQueueAttributesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sqs#GetQueueAttributesResult", - ) - ], - members={ - "Attributes": { - "target": QUEUE_ATTRIBUTE_MAP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#xmlName"), value="Attribute"), - Trait.new(id=ShapeID("smithy.api#xmlFlattened")), - ], - } - }, -) - -GET_QUEUE_ATTRIBUTES = Schema( - id=ShapeID("com.amazonaws.sqs#GetQueueAttributes"), shape_type=ShapeType.OPERATION -) - -GET_QUEUE_URL_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sqs#GetQueueUrlInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sqs#GetQueueUrlRequest", - ) - ], - members={ - "QueueName": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "QueueOwnerAWSAccountId": {"target": STRING}, - }, -) - -GET_QUEUE_URL_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sqs#GetQueueUrlOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sqs#GetQueueUrlResult", - ) - ], - members={"QueueUrl": {"target": STRING}}, -) - -GET_QUEUE_URL = Schema( - id=ShapeID("com.amazonaws.sqs#GetQueueUrl"), shape_type=ShapeType.OPERATION -) - -BOXED_INTEGER = Schema( - id=ShapeID("com.amazonaws.sqs#BoxedInteger"), shape_type=ShapeType.INTEGER -) - -TOKEN = Schema(id=ShapeID("com.amazonaws.sqs#Token"), shape_type=ShapeType.STRING) - -LIST_DEAD_LETTER_SOURCE_QUEUES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sqs#ListDeadLetterSourceQueuesInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sqs#ListDeadLetterSourceQueuesRequest", - ) - ], - members={ - "QueueUrl": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "NextToken": {"target": TOKEN}, - "MaxResults": {"target": BOXED_INTEGER}, - }, -) - -QUEUE_URL_LIST = Schema.collection( - id=ShapeID("com.amazonaws.sqs#QueueUrlList"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, -) - -LIST_DEAD_LETTER_SOURCE_QUEUES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sqs#ListDeadLetterSourceQueuesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sqs#ListDeadLetterSourceQueuesResult", - ) - ], - members={ - "queueUrls": { - "target": QUEUE_URL_LIST, - "traits": [ - Trait.new(id=ShapeID("smithy.api#xmlName"), value="QueueUrl"), - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#xmlFlattened")), - ], - }, - "NextToken": {"target": TOKEN}, - }, -) - -LIST_DEAD_LETTER_SOURCE_QUEUES = Schema( - id=ShapeID("com.amazonaws.sqs#ListDeadLetterSourceQueues"), - shape_type=ShapeType.OPERATION, -) - -LIST_MESSAGE_MOVE_TASKS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sqs#ListMessageMoveTasksInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sqs#ListMessageMoveTasksRequest", - ) - ], - members={ - "SourceArn": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "MaxResults": {"target": NULLABLE_INTEGER}, - }, -) - -NULLABLE_LONG = Schema( - id=ShapeID("com.amazonaws.sqs#NullableLong"), shape_type=ShapeType.LONG -) - -LIST_MESSAGE_MOVE_TASKS_RESULT_ENTRY = Schema.collection( - id=ShapeID("com.amazonaws.sqs#ListMessageMoveTasksResultEntry"), - members={ - "TaskHandle": {"target": STRING}, - "Status": {"target": STRING}, - "SourceArn": {"target": STRING}, - "DestinationArn": {"target": STRING}, - "MaxNumberOfMessagesPerSecond": {"target": NULLABLE_INTEGER}, - "ApproximateNumberOfMessagesMoved": { - "target": LONG, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "ApproximateNumberOfMessagesToMove": {"target": NULLABLE_LONG}, - "FailureReason": {"target": STRING}, - "StartedTimestamp": { - "target": LONG, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - }, -) - -LIST_MESSAGE_MOVE_TASKS_RESULT_ENTRY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.sqs#ListMessageMoveTasksResultEntryList"), - shape_type=ShapeType.LIST, - members={"member": {"target": LIST_MESSAGE_MOVE_TASKS_RESULT_ENTRY}}, -) - -LIST_MESSAGE_MOVE_TASKS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sqs#ListMessageMoveTasksOutput"), - traits=[ - Trait.new(id=ShapeID("smithy.api#xmlName"), value="ListMessageMoveTasksResult"), - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sqs#ListMessageMoveTasksResult", - ), - ], - members={ - "Results": { - "target": LIST_MESSAGE_MOVE_TASKS_RESULT_ENTRY_LIST, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#xmlName"), - value="ListMessageMoveTasksResultEntry", - ), - Trait.new(id=ShapeID("smithy.api#xmlFlattened")), - ], - } - }, -) - -LIST_MESSAGE_MOVE_TASKS = Schema( - id=ShapeID("com.amazonaws.sqs#ListMessageMoveTasks"), shape_type=ShapeType.OPERATION -) - -LIST_QUEUES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sqs#ListQueuesInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sqs#ListQueuesRequest", - ) - ], - members={ - "QueueNamePrefix": {"target": STRING}, - "NextToken": {"target": TOKEN}, - "MaxResults": {"target": BOXED_INTEGER}, - }, -) - -LIST_QUEUES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sqs#ListQueuesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sqs#ListQueuesResult", - ) - ], - members={ - "QueueUrls": { - "target": QUEUE_URL_LIST, - "traits": [ - Trait.new(id=ShapeID("smithy.api#xmlName"), value="QueueUrl"), - Trait.new(id=ShapeID("smithy.api#xmlFlattened")), - ], - }, - "NextToken": {"target": TOKEN}, - }, -) - -LIST_QUEUES = Schema( - id=ShapeID("com.amazonaws.sqs#ListQueues"), shape_type=ShapeType.OPERATION -) - -LIST_QUEUE_TAGS_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sqs#ListQueueTagsInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sqs#ListQueueTagsRequest", - ) - ], - members={ - "QueueUrl": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -LIST_QUEUE_TAGS_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sqs#ListQueueTagsOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sqs#ListQueueTagsResult", - ) - ], - members={ - "Tags": { - "target": TAG_MAP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#xmlName"), value="Tag"), - Trait.new(id=ShapeID("smithy.api#xmlFlattened")), - ], - } - }, -) - -LIST_QUEUE_TAGS = Schema( - id=ShapeID("com.amazonaws.sqs#ListQueueTags"), shape_type=ShapeType.OPERATION -) - -PURGE_QUEUE_IN_PROGRESS = Schema.collection( - id=ShapeID("com.amazonaws.sqs#PurgeQueueInProgress"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=403), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - { - "code": "AWS.SimpleQueueService.PurgeQueueInProgress", - "httpResponseCode": 403, - } - ), - ), - ], - members={"message": {"target": EXCEPTION_MESSAGE}}, -) - -PURGE_QUEUE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sqs#PurgeQueueInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sqs#PurgeQueueRequest", - ) - ], - members={ - "QueueUrl": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, -) - -PURGE_QUEUE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sqs#PurgeQueueOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -PURGE_QUEUE = Schema( - id=ShapeID("com.amazonaws.sqs#PurgeQueue"), shape_type=ShapeType.OPERATION -) - -KMS_ACCESS_DENIED = Schema.collection( - id=ShapeID("com.amazonaws.sqs#KmsAccessDenied"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "KMS.AccessDeniedException", "httpResponseCode": 400} - ), - ), - ], - members={"message": {"target": EXCEPTION_MESSAGE}}, -) - -KMS_DISABLED = Schema.collection( - id=ShapeID("com.amazonaws.sqs#KmsDisabled"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "KMS.DisabledException", "httpResponseCode": 400} - ), - ), - ], - members={"message": {"target": EXCEPTION_MESSAGE}}, -) - -KMS_INVALID_KEY_USAGE = Schema.collection( - id=ShapeID("com.amazonaws.sqs#KmsInvalidKeyUsage"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "KMS.InvalidKeyUsageException", "httpResponseCode": 400} - ), - ), - ], - members={"message": {"target": EXCEPTION_MESSAGE}}, -) - -KMS_INVALID_STATE = Schema.collection( - id=ShapeID("com.amazonaws.sqs#KmsInvalidState"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "KMS.InvalidStateException", "httpResponseCode": 400} - ), - ), - ], - members={"message": {"target": EXCEPTION_MESSAGE}}, -) - -KMS_NOT_FOUND = Schema.collection( - id=ShapeID("com.amazonaws.sqs#KmsNotFound"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "KMS.NotFoundException", "httpResponseCode": 400} - ), - ), - ], - members={"message": {"target": EXCEPTION_MESSAGE}}, -) - -KMS_OPT_IN_REQUIRED = Schema.collection( - id=ShapeID("com.amazonaws.sqs#KmsOptInRequired"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=403), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "KMS.OptInRequired", "httpResponseCode": 403} - ), - ), - ], - members={"message": {"target": EXCEPTION_MESSAGE}}, -) - -KMS_THROTTLED = Schema.collection( - id=ShapeID("com.amazonaws.sqs#KmsThrottled"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "KMS.ThrottlingException", "httpResponseCode": 400} - ), - ), - ], - members={"message": {"target": EXCEPTION_MESSAGE}}, -) - -MESSAGE_ATTRIBUTE_NAME = Schema( - id=ShapeID("com.amazonaws.sqs#MessageAttributeName"), shape_type=ShapeType.STRING -) - -MESSAGE_ATTRIBUTE_NAME_LIST = Schema.collection( - id=ShapeID("com.amazonaws.sqs#MessageAttributeNameList"), - shape_type=ShapeType.LIST, - members={"member": {"target": MESSAGE_ATTRIBUTE_NAME}}, -) - -MESSAGE_SYSTEM_ATTRIBUTE_NAME = Schema.collection( - id=ShapeID("com.amazonaws.sqs#MessageSystemAttributeName"), - shape_type=ShapeType.ENUM, - members={ - "All": {"target": UNIT}, - "SenderId": {"target": UNIT}, - "SentTimestamp": {"target": UNIT}, - "ApproximateReceiveCount": {"target": UNIT}, - "ApproximateFirstReceiveTimestamp": {"target": UNIT}, - "SequenceNumber": {"target": UNIT}, - "MessageDeduplicationId": {"target": UNIT}, - "MessageGroupId": {"target": UNIT}, - "AWSTraceHeader": {"target": UNIT}, - "DeadLetterQueueSourceArn": {"target": UNIT}, - }, -) - -MESSAGE_SYSTEM_ATTRIBUTE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.sqs#MessageSystemAttributeList"), - shape_type=ShapeType.LIST, - members={"member": {"target": MESSAGE_SYSTEM_ATTRIBUTE_NAME}}, -) - -RECEIVE_MESSAGE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sqs#ReceiveMessageInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sqs#ReceiveMessageRequest", - ) - ], - members={ - "QueueUrl": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "AttributeNames": { - "target": ATTRIBUTE_NAME_LIST, - "traits": [ - Trait.new(id=ShapeID("smithy.api#xmlName"), value="AttributeName"), - Trait.new(id=ShapeID("smithy.api#xmlFlattened")), - ], - }, - "MessageSystemAttributeNames": { - "target": MESSAGE_SYSTEM_ATTRIBUTE_LIST, - "traits": [ - Trait.new(id=ShapeID("smithy.api#xmlName"), value="AttributeName"), - Trait.new(id=ShapeID("smithy.api#xmlFlattened")), - ], - }, - "MessageAttributeNames": { - "target": MESSAGE_ATTRIBUTE_NAME_LIST, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#xmlName"), value="MessageAttributeName" - ), - Trait.new(id=ShapeID("smithy.api#xmlFlattened")), - ], - }, - "MaxNumberOfMessages": {"target": NULLABLE_INTEGER}, - "VisibilityTimeout": {"target": NULLABLE_INTEGER}, - "WaitTimeSeconds": {"target": NULLABLE_INTEGER}, - "ReceiveRequestAttemptId": {"target": STRING}, - }, -) - -MESSAGE_SYSTEM_ATTRIBUTE_MAP = Schema.collection( - id=ShapeID("com.amazonaws.sqs#MessageSystemAttributeMap"), - shape_type=ShapeType.MAP, - members={ - "key": { - "target": MESSAGE_SYSTEM_ATTRIBUTE_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#xmlName"), value="Name")], - }, - "value": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#xmlName"), value="Value")], - }, - }, -) - -BINARY = Schema(id=ShapeID("com.amazonaws.sqs#Binary"), shape_type=ShapeType.BLOB) - -BINARY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.sqs#BinaryList"), - shape_type=ShapeType.LIST, - members={ - "member": { - "target": BINARY, - "traits": [ - Trait.new(id=ShapeID("smithy.api#xmlName"), value="BinaryListValue") - ], - } - }, -) - -STRING_LIST = Schema.collection( - id=ShapeID("com.amazonaws.sqs#StringList"), - shape_type=ShapeType.LIST, - members={ - "member": { - "target": STRING, - "traits": [ - Trait.new(id=ShapeID("smithy.api#xmlName"), value="StringListValue") - ], - } - }, -) - -MESSAGE_ATTRIBUTE_VALUE = Schema.collection( - id=ShapeID("com.amazonaws.sqs#MessageAttributeValue"), - members={ - "StringValue": {"target": STRING}, - "BinaryValue": {"target": BINARY}, - "StringListValues": { - "target": STRING_LIST, - "traits": [ - Trait.new(id=ShapeID("smithy.api#xmlName"), value="StringListValue"), - Trait.new(id=ShapeID("smithy.api#xmlFlattened")), - ], - }, - "BinaryListValues": { - "target": BINARY_LIST, - "traits": [ - Trait.new(id=ShapeID("smithy.api#xmlName"), value="BinaryListValue"), - Trait.new(id=ShapeID("smithy.api#xmlFlattened")), - ], - }, - "DataType": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -MESSAGE_BODY_ATTRIBUTE_MAP = Schema.collection( - id=ShapeID("com.amazonaws.sqs#MessageBodyAttributeMap"), - shape_type=ShapeType.MAP, - members={ - "key": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#xmlName"), value="Name")], - }, - "value": { - "target": MESSAGE_ATTRIBUTE_VALUE, - "traits": [Trait.new(id=ShapeID("smithy.api#xmlName"), value="Value")], - }, - }, -) - -MESSAGE = Schema.collection( - id=ShapeID("com.amazonaws.sqs#Message"), - members={ - "MessageId": {"target": STRING}, - "ReceiptHandle": {"target": STRING}, - "MD5OfBody": {"target": STRING}, - "Body": {"target": STRING}, - "Attributes": { - "target": MESSAGE_SYSTEM_ATTRIBUTE_MAP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#xmlName"), value="Attribute"), - Trait.new(id=ShapeID("smithy.api#xmlFlattened")), - ], - }, - "MD5OfMessageAttributes": {"target": STRING}, - "MessageAttributes": { - "target": MESSAGE_BODY_ATTRIBUTE_MAP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#xmlName"), value="MessageAttribute"), - Trait.new(id=ShapeID("smithy.api#xmlFlattened")), - ], - }, - }, -) - -MESSAGE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.sqs#MessageList"), - shape_type=ShapeType.LIST, - members={"member": {"target": MESSAGE}}, -) - -RECEIVE_MESSAGE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sqs#ReceiveMessageOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sqs#ReceiveMessageResult", - ) - ], - members={ - "Messages": { - "target": MESSAGE_LIST, - "traits": [ - Trait.new(id=ShapeID("smithy.api#xmlName"), value="Message"), - Trait.new(id=ShapeID("smithy.api#xmlFlattened")), - ], - } - }, -) - -RECEIVE_MESSAGE = Schema( - id=ShapeID("com.amazonaws.sqs#ReceiveMessage"), shape_type=ShapeType.OPERATION -) - -REMOVE_PERMISSION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sqs#RemovePermissionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sqs#RemovePermissionRequest", - ) - ], - members={ - "QueueUrl": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Label": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -REMOVE_PERMISSION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sqs#RemovePermissionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -REMOVE_PERMISSION = Schema( - id=ShapeID("com.amazonaws.sqs#RemovePermission"), shape_type=ShapeType.OPERATION -) - -INVALID_MESSAGE_CONTENTS = Schema.collection( - id=ShapeID("com.amazonaws.sqs#InvalidMessageContents"), - traits=[Trait.new(id=ShapeID("smithy.api#error"), value="client")], - members={"message": {"target": EXCEPTION_MESSAGE}}, -) - -MESSAGE_SYSTEM_ATTRIBUTE_NAME_FOR_SENDS = Schema.collection( - id=ShapeID("com.amazonaws.sqs#MessageSystemAttributeNameForSends"), - shape_type=ShapeType.ENUM, - members={"AWSTraceHeader": {"target": UNIT}}, -) - -MESSAGE_SYSTEM_ATTRIBUTE_VALUE = Schema.collection( - id=ShapeID("com.amazonaws.sqs#MessageSystemAttributeValue"), - members={ - "StringValue": {"target": STRING}, - "BinaryValue": {"target": BINARY}, - "StringListValues": { - "target": STRING_LIST, - "traits": [ - Trait.new(id=ShapeID("smithy.api#xmlName"), value="StringListValue"), - Trait.new(id=ShapeID("smithy.api#xmlFlattened")), - ], - }, - "BinaryListValues": { - "target": BINARY_LIST, - "traits": [ - Trait.new(id=ShapeID("smithy.api#xmlName"), value="BinaryListValue"), - Trait.new(id=ShapeID("smithy.api#xmlFlattened")), - ], - }, - "DataType": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -MESSAGE_BODY_SYSTEM_ATTRIBUTE_MAP = Schema.collection( - id=ShapeID("com.amazonaws.sqs#MessageBodySystemAttributeMap"), - shape_type=ShapeType.MAP, - members={ - "key": { - "target": MESSAGE_SYSTEM_ATTRIBUTE_NAME_FOR_SENDS, - "traits": [Trait.new(id=ShapeID("smithy.api#xmlName"), value="Name")], - }, - "value": { - "target": MESSAGE_SYSTEM_ATTRIBUTE_VALUE, - "traits": [Trait.new(id=ShapeID("smithy.api#xmlName"), value="Value")], - }, - }, -) - -SEND_MESSAGE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sqs#SendMessageInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sqs#SendMessageRequest", - ) - ], - members={ - "QueueUrl": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "MessageBody": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "DelaySeconds": {"target": NULLABLE_INTEGER}, - "MessageAttributes": { - "target": MESSAGE_BODY_ATTRIBUTE_MAP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#xmlName"), value="MessageAttribute"), - Trait.new(id=ShapeID("smithy.api#xmlFlattened")), - ], - }, - "MessageSystemAttributes": { - "target": MESSAGE_BODY_SYSTEM_ATTRIBUTE_MAP, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#xmlName"), value="MessageSystemAttribute" - ), - Trait.new(id=ShapeID("smithy.api#xmlFlattened")), - ], - }, - "MessageDeduplicationId": {"target": STRING}, - "MessageGroupId": {"target": STRING}, - }, -) - -SEND_MESSAGE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sqs#SendMessageOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sqs#SendMessageResult", - ) - ], - members={ - "MD5OfMessageBody": {"target": STRING}, - "MD5OfMessageAttributes": {"target": STRING}, - "MD5OfMessageSystemAttributes": {"target": STRING}, - "MessageId": {"target": STRING}, - "SequenceNumber": {"target": STRING}, - }, -) - -SEND_MESSAGE = Schema( - id=ShapeID("com.amazonaws.sqs#SendMessage"), shape_type=ShapeType.OPERATION -) - -BATCH_REQUEST_TOO_LONG = Schema.collection( - id=ShapeID("com.amazonaws.sqs#BatchRequestTooLong"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - { - "code": "AWS.SimpleQueueService.BatchRequestTooLong", - "httpResponseCode": 400, - } - ), - ), - ], - members={"message": {"target": EXCEPTION_MESSAGE}}, -) - -SEND_MESSAGE_BATCH_REQUEST_ENTRY = Schema.collection( - id=ShapeID("com.amazonaws.sqs#SendMessageBatchRequestEntry"), - members={ - "Id": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "MessageBody": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "DelaySeconds": {"target": NULLABLE_INTEGER}, - "MessageAttributes": { - "target": MESSAGE_BODY_ATTRIBUTE_MAP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#xmlName"), value="MessageAttribute"), - Trait.new(id=ShapeID("smithy.api#xmlFlattened")), - ], - }, - "MessageSystemAttributes": { - "target": MESSAGE_BODY_SYSTEM_ATTRIBUTE_MAP, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#xmlName"), value="MessageSystemAttribute" - ), - Trait.new(id=ShapeID("smithy.api#xmlFlattened")), - ], - }, - "MessageDeduplicationId": {"target": STRING}, - "MessageGroupId": {"target": STRING}, - }, -) - -SEND_MESSAGE_BATCH_REQUEST_ENTRY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.sqs#SendMessageBatchRequestEntryList"), - shape_type=ShapeType.LIST, - members={"member": {"target": SEND_MESSAGE_BATCH_REQUEST_ENTRY}}, -) - -SEND_MESSAGE_BATCH_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sqs#SendMessageBatchInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sqs#SendMessageBatchRequest", - ) - ], - members={ - "QueueUrl": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Entries": { - "target": SEND_MESSAGE_BATCH_REQUEST_ENTRY_LIST, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#xmlName"), - value="SendMessageBatchRequestEntry", - ), - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#xmlFlattened")), - ], - }, - }, -) - -SEND_MESSAGE_BATCH_RESULT_ENTRY = Schema.collection( - id=ShapeID("com.amazonaws.sqs#SendMessageBatchResultEntry"), - members={ - "Id": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "MessageId": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "MD5OfMessageBody": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "MD5OfMessageAttributes": {"target": STRING}, - "MD5OfMessageSystemAttributes": {"target": STRING}, - "SequenceNumber": {"target": STRING}, - }, -) - -SEND_MESSAGE_BATCH_RESULT_ENTRY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.sqs#SendMessageBatchResultEntryList"), - shape_type=ShapeType.LIST, - members={"member": {"target": SEND_MESSAGE_BATCH_RESULT_ENTRY}}, -) - -SEND_MESSAGE_BATCH_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sqs#SendMessageBatchOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sqs#SendMessageBatchResult", - ) - ], - members={ - "Successful": { - "target": SEND_MESSAGE_BATCH_RESULT_ENTRY_LIST, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#xmlName"), - value="SendMessageBatchResultEntry", - ), - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#xmlFlattened")), - ], - }, - "Failed": { - "target": BATCH_RESULT_ERROR_ENTRY_LIST, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#xmlName"), value="BatchResultErrorEntry" - ), - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#xmlFlattened")), - ], - }, - }, -) - -SEND_MESSAGE_BATCH = Schema( - id=ShapeID("com.amazonaws.sqs#SendMessageBatch"), shape_type=ShapeType.OPERATION -) - -SET_QUEUE_ATTRIBUTES_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sqs#SetQueueAttributesInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sqs#SetQueueAttributesRequest", - ) - ], - members={ - "QueueUrl": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Attributes": { - "target": QUEUE_ATTRIBUTE_MAP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#xmlName"), value="Attribute"), - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#xmlFlattened")), - ], - }, - }, -) - -SET_QUEUE_ATTRIBUTES_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sqs#SetQueueAttributesOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -SET_QUEUE_ATTRIBUTES = Schema( - id=ShapeID("com.amazonaws.sqs#SetQueueAttributes"), shape_type=ShapeType.OPERATION -) - -START_MESSAGE_MOVE_TASK_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sqs#StartMessageMoveTaskInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sqs#StartMessageMoveTaskRequest", - ) - ], - members={ - "SourceArn": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "DestinationArn": {"target": STRING}, - "MaxNumberOfMessagesPerSecond": {"target": NULLABLE_INTEGER}, - }, -) - -START_MESSAGE_MOVE_TASK_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sqs#StartMessageMoveTaskOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sqs#StartMessageMoveTaskResult", - ) - ], - members={"TaskHandle": {"target": STRING}}, -) - -START_MESSAGE_MOVE_TASK = Schema( - id=ShapeID("com.amazonaws.sqs#StartMessageMoveTask"), shape_type=ShapeType.OPERATION -) - -TAG_QUEUE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sqs#TagQueueInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sqs#TagQueueRequest", - ) - ], - members={ - "QueueUrl": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Tags": { - "target": TAG_MAP, - "traits": [ - Trait.new(id=ShapeID("smithy.api#xmlName"), value="Tag"), - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#xmlFlattened")), - ], - }, - }, -) - -TAG_QUEUE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sqs#TagQueueOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -TAG_QUEUE = Schema( - id=ShapeID("com.amazonaws.sqs#TagQueue"), shape_type=ShapeType.OPERATION -) - -TAG_KEY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.sqs#TagKeyList"), - shape_type=ShapeType.LIST, - members={"member": {"target": TAG_KEY}}, -) - -UNTAG_QUEUE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sqs#UntagQueueInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sqs#UntagQueueRequest", - ) - ], - members={ - "QueueUrl": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "TagKeys": { - "target": TAG_KEY_LIST, - "traits": [ - Trait.new(id=ShapeID("smithy.api#xmlName"), value="TagKey"), - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#xmlFlattened")), - ], - }, - }, -) - -UNTAG_QUEUE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sqs#UntagQueueOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), value="smithy.api#Unit" - ) - ], -) - -UNTAG_QUEUE = Schema( - id=ShapeID("com.amazonaws.sqs#UntagQueue"), shape_type=ShapeType.OPERATION -) - -AMAZON_SQS = Schema( - id=ShapeID("com.amazonaws.sqs#AmazonSQS"), - shape_type=ShapeType.SERVICE, - traits=[ - Trait.new( - id=ShapeID("aws.auth#sigv4"), value=MappingProxyType({"name": "sqs"}) - ), - Trait.new(id=ShapeID("aws.protocols#awsJson1_0")), - Trait.new( - id=ShapeID("smithy.rules#endpointBdd"), - value=MappingProxyType( - { - "version": "1.1", - "parameters": MappingProxyType( - { - "Region": MappingProxyType( - { - "builtIn": "AWS::Region", - "required": False, - "documentation": "The AWS region used to dispatch the request.", - "type": "string", - } - ), - "UseDualStack": MappingProxyType( - { - "builtIn": "AWS::UseDualStack", - "required": True, - "default": False, - "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", - "type": "boolean", - } - ), - "UseFIPS": MappingProxyType( - { - "builtIn": "AWS::UseFIPS", - "required": True, - "default": False, - "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", - "type": "boolean", - } - ), - "Endpoint": MappingProxyType( - { - "builtIn": "SDK::Endpoint", - "required": False, - "documentation": "Override the endpoint used to send this request", - "type": "string", - } - ), - } - ), - "conditions": ( - MappingProxyType( + (BATCH_RESULT_ERROR_ENTRY_LIST, {_sN: _BREE, _sF: None, _sm: None}), + ), +) + +EMPTY_BATCH_REQUEST: StaticSchema = ( + 18, + n0, + _EBR, + {_smit: _c, _sE: 400}, + (_me,), + ((EXCEPTION_MESSAGE, 0),), +) + +INVALID_BATCH_ENTRY_ID: StaticSchema = ( + 18, + n0, + _IBEI, + {_smit: _c, _sE: 400}, + (_me,), + ((EXCEPTION_MESSAGE, 0),), +) + +TOO_MANY_ENTRIES_IN_BATCH_REQUEST: StaticSchema = ( + 18, + n0, + _TMEIBR, + {_smit: _c, _sE: 400}, + (_me,), + ((EXCEPTION_MESSAGE, 0),), +) + +CHANGE_MESSAGE_VISIBILITY_BATCH: StaticOperationSchema = ( + 23, + n0, + _CMVB, + 0, + CHANGE_MESSAGE_VISIBILITY_BATCH_INPUT, + CHANGE_MESSAGE_VISIBILITY_BATCH_OUTPUT, + ( + BATCH_ENTRY_IDS_NOT_DISTINCT, + EMPTY_BATCH_REQUEST, + INVALID_ADDRESS, + INVALID_BATCH_ENTRY_ID, + INVALID_SECURITY, + QUEUE_DOES_NOT_EXIST, + REQUEST_THROTTLED, + TOO_MANY_ENTRIES_IN_BATCH_REQUEST, + UNSUPPORTED_OPERATION, + ), +) + +QUEUE_ATTRIBUTE_NAME: StaticSchema = ( + 14, + n0, + _QAN, + 0, + ( + _Al, + _P, + _VT, + _MMS, + _MRP, + _ANOM, + _ANOMNV, + _CT, + _LMT, + _QA, + _ANOMD, + _DS, + _RMWTS, + _RP, + _FQ, + _CBD, + _KMKI, + _KDKRPS, + _DSe, + _FTL, + _RAP, + _SMSE, + ), + ( + (-1, {_sV: _Al}), + (-1, {_sV: _P}), + (-1, {_sV: _VT}), + (-1, {_sV: _MMS}), + (-1, {_sV: _MRP}), + (-1, {_sV: _ANOM}), + (-1, {_sV: _ANOMNV}), + (-1, {_sV: _CT}), + (-1, {_sV: _LMT}), + (-1, {_sV: _QA}), + (-1, {_sV: _ANOMD}), + (-1, {_sV: _DS}), + (-1, {_sV: _RMWTS}), + (-1, {_sV: _RP}), + (-1, {_sV: _FQ}), + (-1, {_sV: _CBD}), + (-1, {_sV: _KMKI}), + (-1, {_sV: _KDKRPS}), + (-1, {_sV: _DSe}), + (-1, {_sV: _FTL}), + (-1, {_sV: _RAP}), + (-1, {_sV: _SMSE}), + ), +) + +QUEUE_ATTRIBUTE_MAP: StaticSchema = ( + 17, + n0, + _QAM, + 0, + (_k, _v), + ((QUEUE_ATTRIBUTE_NAME, {_sN: _N}), (STRING, {_sN: _V})), +) + +TAG_KEY: StaticSchema = (3, n0, _TK, 0) + +TAG_VALUE: StaticSchema = (3, n0, _TV, 0) + +TAG_MAP: StaticSchema = ( + 17, + n0, + _TM, + 0, + (_k, _v), + ((TAG_KEY, {_sN: _K}), (TAG_VALUE, {_sN: _V})), +) + +CREATE_QUEUE_INPUT: StaticSchema = ( + 18, + n0, + _CQI, + {_sSI: _cCQR, _s: None}, + (_QN, _At, _t), + ( + (STRING, 1), + (QUEUE_ATTRIBUTE_MAP, {_sN: _Att, _sF: None}), + (TAG_MAP, {_sN: _T, _sF: None}), + ), +) + +CREATE_QUEUE_OUTPUT: StaticSchema = ( + 18, + n0, + _CQO, + {_sSI: _cCQRo, _smi: None}, + (_QU,), + ((STRING, 0),), +) + +INVALID_ATTRIBUTE_NAME: StaticSchema = ( + 18, + n0, + _IAN, + {_smit: _c}, + (_me,), + ((EXCEPTION_MESSAGE, 0),), +) + +INVALID_ATTRIBUTE_VALUE: StaticSchema = ( + 18, + n0, + _IAV, + {_smit: _c}, + (_me,), + ((EXCEPTION_MESSAGE, 0),), +) + +QUEUE_DELETED_RECENTLY: StaticSchema = ( + 18, + n0, + _QDR, + {_smit: _c, _sE: 400}, + (_me,), + ((EXCEPTION_MESSAGE, 0),), +) + +QUEUE_NAME_EXISTS: StaticSchema = ( + 18, + n0, + _QNE, + {_smit: _c, _sE: 400}, + (_me,), + ((EXCEPTION_MESSAGE, 0),), +) + +CREATE_QUEUE: StaticOperationSchema = ( + 23, + n0, + _CQ, + 0, + CREATE_QUEUE_INPUT, + CREATE_QUEUE_OUTPUT, + ( + INVALID_ADDRESS, + INVALID_ATTRIBUTE_NAME, + INVALID_ATTRIBUTE_VALUE, + INVALID_SECURITY, + QUEUE_DELETED_RECENTLY, + QUEUE_NAME_EXISTS, + REQUEST_THROTTLED, + UNSUPPORTED_OPERATION, + ), +) + +DELETE_MESSAGE_INPUT: StaticSchema = ( + 18, + n0, + _DMI, + {_sSI: _cDMR, _s: None}, + (_QU, _RH), + ((STRING, 1), (STRING, 1)), +) + +DELETE_MESSAGE_OUTPUT: StaticSchema = (18, n0, _DMO, {_sSI: _sU, _smi: None}) + +INVALID_ID_FORMAT: StaticSchema = (18, n0, _IIF, {_smit: _c}) + +DELETE_MESSAGE: StaticOperationSchema = ( + 23, + n0, + _DM, + 0, + DELETE_MESSAGE_INPUT, + DELETE_MESSAGE_OUTPUT, + ( + INVALID_ADDRESS, + INVALID_ID_FORMAT, + INVALID_SECURITY, + QUEUE_DOES_NOT_EXIST, + RECEIPT_HANDLE_IS_INVALID, + REQUEST_THROTTLED, + UNSUPPORTED_OPERATION, + ), +) + +DELETE_MESSAGE_BATCH_REQUEST_ENTRY: StaticSchema = ( + 18, + n0, + _DMBRE, + 0, + (_I, _RH), + ((STRING, 1), (STRING, 1)), +) + +DELETE_MESSAGE_BATCH_REQUEST_ENTRY_LIST: StaticSchema = ( + 16, + n0, + _DMBREL, + 0, + (_m,), + ((DELETE_MESSAGE_BATCH_REQUEST_ENTRY, 0),), +) + +DELETE_MESSAGE_BATCH_INPUT: StaticSchema = ( + 18, + n0, + _DMBI, + {_sSI: _cDMBR, _s: None}, + (_QU, _E), + ( + (STRING, 1), + (DELETE_MESSAGE_BATCH_REQUEST_ENTRY_LIST, {_sN: _DMBRE, _sF: None, _sm: None}), + ), +) + +DELETE_MESSAGE_BATCH_RESULT_ENTRY: StaticSchema = ( + 18, + n0, + _DMBREe, + 0, + (_I,), + ((STRING, 1),), +) + +DELETE_MESSAGE_BATCH_RESULT_ENTRY_LIST: StaticSchema = ( + 16, + n0, + _DMBRELe, + 0, + (_m,), + ((DELETE_MESSAGE_BATCH_RESULT_ENTRY, 0),), +) + +DELETE_MESSAGE_BATCH_OUTPUT: StaticSchema = ( + 18, + n0, + _DMBO, + {_sSI: _cDMBRo, _smi: None}, + (_Su, _F), + ( + (DELETE_MESSAGE_BATCH_RESULT_ENTRY_LIST, {_sN: _DMBREe, _sF: None, _sm: None}), + (BATCH_RESULT_ERROR_ENTRY_LIST, {_sN: _BREE, _sF: None, _sm: None}), + ), +) + +DELETE_MESSAGE_BATCH: StaticOperationSchema = ( + 23, + n0, + _DMB, + 0, + DELETE_MESSAGE_BATCH_INPUT, + DELETE_MESSAGE_BATCH_OUTPUT, + ( + BATCH_ENTRY_IDS_NOT_DISTINCT, + EMPTY_BATCH_REQUEST, + INVALID_ADDRESS, + INVALID_BATCH_ENTRY_ID, + INVALID_SECURITY, + QUEUE_DOES_NOT_EXIST, + REQUEST_THROTTLED, + TOO_MANY_ENTRIES_IN_BATCH_REQUEST, + UNSUPPORTED_OPERATION, + ), +) + +DELETE_QUEUE_INPUT: StaticSchema = ( + 18, + n0, + _DQI, + {_sSI: _cDQR, _s: None}, + (_QU,), + ((STRING, 1),), +) + +DELETE_QUEUE_OUTPUT: StaticSchema = (18, n0, _DQO, {_sSI: _sU, _smi: None}) + +DELETE_QUEUE: StaticOperationSchema = ( + 23, + n0, + _DQ, + 0, + DELETE_QUEUE_INPUT, + DELETE_QUEUE_OUTPUT, + ( + INVALID_ADDRESS, + INVALID_SECURITY, + QUEUE_DOES_NOT_EXIST, + REQUEST_THROTTLED, + UNSUPPORTED_OPERATION, + ), +) + +ATTRIBUTE_NAME_LIST: StaticSchema = ( + 16, + n0, + _ANLt, + 0, + (_m,), + ((QUEUE_ATTRIBUTE_NAME, 0),), +) + +GET_QUEUE_ATTRIBUTES_INPUT: StaticSchema = ( + 18, + n0, + _GQAI, + {_sSI: _cGQAR, _s: None}, + (_QU, _ANt), + ((STRING, 1), (ATTRIBUTE_NAME_LIST, {_sN: _ANtt, _sF: None})), +) + +GET_QUEUE_ATTRIBUTES_OUTPUT: StaticSchema = ( + 18, + n0, + _GQAO, + {_sSI: _cGQARo, _smi: None}, + (_At,), + ((QUEUE_ATTRIBUTE_MAP, {_sN: _Att, _sF: None}),), +) + +GET_QUEUE_ATTRIBUTES: StaticOperationSchema = ( + 23, + n0, + _GQA, + 0, + GET_QUEUE_ATTRIBUTES_INPUT, + GET_QUEUE_ATTRIBUTES_OUTPUT, + ( + INVALID_ADDRESS, + INVALID_ATTRIBUTE_NAME, + INVALID_SECURITY, + QUEUE_DOES_NOT_EXIST, + REQUEST_THROTTLED, + UNSUPPORTED_OPERATION, + ), +) + +GET_QUEUE_URL_INPUT: StaticSchema = ( + 18, + n0, + _GQUI, + {_sSI: _cGQUR, _s: None}, + (_QN, _QOAWSAI), + ((STRING, 1), (STRING, 0)), +) + +GET_QUEUE_URL_OUTPUT: StaticSchema = ( + 18, + n0, + _GQUO, + {_sSI: _cGQURo, _smi: None}, + (_QU,), + ((STRING, 0),), +) + +GET_QUEUE_URL: StaticOperationSchema = ( + 23, + n0, + _GQU, + 0, + GET_QUEUE_URL_INPUT, + GET_QUEUE_URL_OUTPUT, + ( + INVALID_ADDRESS, + INVALID_SECURITY, + QUEUE_DOES_NOT_EXIST, + REQUEST_THROTTLED, + UNSUPPORTED_OPERATION, + ), +) + +BOXED_INTEGER: StaticSchema = (7, n0, _BI, 0) + +TOKEN: StaticSchema = (3, n0, _To, 0) + +LIST_DEAD_LETTER_SOURCE_QUEUES_INPUT: StaticSchema = ( + 18, + n0, + _LDLSQI, + {_sSI: _cLDLSQR, _s: None}, + (_QU, _NT, _MR), + ((STRING, 1), (TOKEN, 0), (BOXED_INTEGER, 0)), +) + +QUEUE_URL_LIST: StaticSchema = (16, n0, _QUL, 0, (_m,), ((STRING, 0),)) + +LIST_DEAD_LETTER_SOURCE_QUEUES_OUTPUT: StaticSchema = ( + 18, + n0, + _LDLSQO, + {_sSI: _cLDLSQRo, _smi: None}, + (_qU, _NT), + ((QUEUE_URL_LIST, {_sN: _QU, _sF: None, _sm: None}), (TOKEN, 0)), +) + +LIST_DEAD_LETTER_SOURCE_QUEUES: StaticOperationSchema = ( + 23, + n0, + _LDLSQ, + 0, + LIST_DEAD_LETTER_SOURCE_QUEUES_INPUT, + LIST_DEAD_LETTER_SOURCE_QUEUES_OUTPUT, + ( + INVALID_ADDRESS, + INVALID_SECURITY, + QUEUE_DOES_NOT_EXIST, + REQUEST_THROTTLED, + UNSUPPORTED_OPERATION, + ), +) + +LIST_MESSAGE_MOVE_TASKS_INPUT: StaticSchema = ( + 18, + n0, + _LMMTI, + {_sSI: _cLMMTR, _s: None}, + (_SA, _MR), + ((STRING, 1), (NULLABLE_INTEGER, 0)), +) + +NULLABLE_LONG: StaticSchema = (8, n0, _NL, 0) + +LIST_MESSAGE_MOVE_TASKS_RESULT_ENTRY: StaticSchema = ( + 18, + n0, + _LMMTRE, + 0, + (_TH, _St, _SA, _DA, _MNOMPS, _ANOMM, _ANOMTM, _FR, _ST), + ( + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (NULLABLE_INTEGER, 0), + (LONG, {_smith: 0}), + (NULLABLE_LONG, 0), + (STRING, 0), + (LONG, {_smith: 0}), + ), +) + +LIST_MESSAGE_MOVE_TASKS_RESULT_ENTRY_LIST: StaticSchema = ( + 16, + n0, + _LMMTREL, + 0, + (_m,), + ((LIST_MESSAGE_MOVE_TASKS_RESULT_ENTRY, 0),), +) + +LIST_MESSAGE_MOVE_TASKS_OUTPUT: StaticSchema = ( + 18, + n0, + _LMMTO, + {_sN: _LMMTR, _sSI: _cLMMTRo, _smi: None}, + (_R,), + ((LIST_MESSAGE_MOVE_TASKS_RESULT_ENTRY_LIST, {_sN: _LMMTRE, _sF: None}),), +) + +LIST_MESSAGE_MOVE_TASKS: StaticOperationSchema = ( + 23, + n0, + _LMMT, + 0, + LIST_MESSAGE_MOVE_TASKS_INPUT, + LIST_MESSAGE_MOVE_TASKS_OUTPUT, + ( + INVALID_ADDRESS, + INVALID_SECURITY, + REQUEST_THROTTLED, + RESOURCE_NOT_FOUND_EXCEPTION, + UNSUPPORTED_OPERATION, + ), +) + +LIST_QUEUES_INPUT: StaticSchema = ( + 18, + n0, + _LQI, + {_sSI: _cLQR, _s: None}, + (_QNP, _NT, _MR), + ((STRING, 0), (TOKEN, 0), (BOXED_INTEGER, 0)), +) + +LIST_QUEUES_OUTPUT: StaticSchema = ( + 18, + n0, + _LQO, + {_sSI: _cLQRo, _smi: None}, + (_QUu, _NT), + ((QUEUE_URL_LIST, {_sN: _QU, _sF: None}), (TOKEN, 0)), +) + +LIST_QUEUES: StaticOperationSchema = ( + 23, + n0, + _LQ, + 0, + LIST_QUEUES_INPUT, + LIST_QUEUES_OUTPUT, + (INVALID_ADDRESS, INVALID_SECURITY, REQUEST_THROTTLED, UNSUPPORTED_OPERATION), +) + +LIST_QUEUE_TAGS_INPUT: StaticSchema = ( + 18, + n0, + _LQTI, + {_sSI: _cLQTR, _s: None}, + (_QU,), + ((STRING, 1),), +) + +LIST_QUEUE_TAGS_OUTPUT: StaticSchema = ( + 18, + n0, + _LQTO, + {_sSI: _cLQTRo, _smi: None}, + (_Ta,), + ((TAG_MAP, {_sN: _T, _sF: None}),), +) + +LIST_QUEUE_TAGS: StaticOperationSchema = ( + 23, + n0, + _LQT, + 0, + LIST_QUEUE_TAGS_INPUT, + LIST_QUEUE_TAGS_OUTPUT, + ( + INVALID_ADDRESS, + INVALID_SECURITY, + QUEUE_DOES_NOT_EXIST, + REQUEST_THROTTLED, + UNSUPPORTED_OPERATION, + ), +) + +PURGE_QUEUE_IN_PROGRESS: StaticSchema = ( + 18, + n0, + _PQIP, + {_smit: _c, _sE: 403}, + (_me,), + ((EXCEPTION_MESSAGE, 0),), +) + +PURGE_QUEUE_INPUT: StaticSchema = ( + 18, + n0, + _PQI, + {_sSI: _cPQR, _s: None}, + (_QU,), + ((STRING, 1),), +) + +PURGE_QUEUE_OUTPUT: StaticSchema = (18, n0, _PQO, {_sSI: _sU, _smi: None}) + +PURGE_QUEUE: StaticOperationSchema = ( + 23, + n0, + _PQ, + 0, + PURGE_QUEUE_INPUT, + PURGE_QUEUE_OUTPUT, + ( + INVALID_ADDRESS, + INVALID_SECURITY, + PURGE_QUEUE_IN_PROGRESS, + QUEUE_DOES_NOT_EXIST, + REQUEST_THROTTLED, + UNSUPPORTED_OPERATION, + ), +) + +KMS_ACCESS_DENIED: StaticSchema = ( + 18, + n0, + _KAD, + {_smit: _c, _sE: 400}, + (_me,), + ((EXCEPTION_MESSAGE, 0),), +) + +KMS_DISABLED: StaticSchema = ( + 18, + n0, + _KD, + {_smit: _c, _sE: 400}, + (_me,), + ((EXCEPTION_MESSAGE, 0),), +) + +KMS_INVALID_KEY_USAGE: StaticSchema = ( + 18, + n0, + _KIKU, + {_smit: _c, _sE: 400}, + (_me,), + ((EXCEPTION_MESSAGE, 0),), +) + +KMS_INVALID_STATE: StaticSchema = ( + 18, + n0, + _KIS, + {_smit: _c, _sE: 400}, + (_me,), + ((EXCEPTION_MESSAGE, 0),), +) + +KMS_NOT_FOUND: StaticSchema = ( + 18, + n0, + _KNF, + {_smit: _c, _sE: 400}, + (_me,), + ((EXCEPTION_MESSAGE, 0),), +) + +KMS_OPT_IN_REQUIRED: StaticSchema = ( + 18, + n0, + _KOIR, + {_smit: _c, _sE: 403}, + (_me,), + ((EXCEPTION_MESSAGE, 0),), +) + +KMS_THROTTLED: StaticSchema = ( + 18, + n0, + _KT, + {_smit: _c, _sE: 400}, + (_me,), + ((EXCEPTION_MESSAGE, 0),), +) + +MESSAGE_ATTRIBUTE_NAME: StaticSchema = (3, n0, _MAN, 0) + +MESSAGE_ATTRIBUTE_NAME_LIST: StaticSchema = ( + 16, + n0, + _MANL, + 0, + (_m,), + ((MESSAGE_ATTRIBUTE_NAME, 0),), +) + +MESSAGE_SYSTEM_ATTRIBUTE_NAME: StaticSchema = ( + 14, + n0, + _MSAN, + 0, + (_Al, _SI, _STe, _ARC, _AFRT, _SN, _MDI, _MGI, _AWSTH, _DLQSA), + ( + (-1, {_sV: _Al}), + (-1, {_sV: _SI}), + (-1, {_sV: _STe}), + (-1, {_sV: _ARC}), + (-1, {_sV: _AFRT}), + (-1, {_sV: _SN}), + (-1, {_sV: _MDI}), + (-1, {_sV: _MGI}), + (-1, {_sV: _AWSTH}), + (-1, {_sV: _DLQSA}), + ), +) + +MESSAGE_SYSTEM_ATTRIBUTE_LIST: StaticSchema = ( + 16, + n0, + _MSAL, + 0, + (_m,), + ((MESSAGE_SYSTEM_ATTRIBUTE_NAME, 0),), +) + +RECEIVE_MESSAGE_INPUT: StaticSchema = ( + 18, + n0, + _RMI, + {_sSI: _cRMR, _s: None}, + (_QU, _ANt, _MSANe, _MANe, _MNOM, _VT, _WTS, _RRAI), + ( + (STRING, 1), + (ATTRIBUTE_NAME_LIST, {_sN: _ANtt, _sF: None}), + (MESSAGE_SYSTEM_ATTRIBUTE_LIST, {_sN: _ANtt, _sF: None}), + (MESSAGE_ATTRIBUTE_NAME_LIST, {_sN: _MAN, _sF: None}), + (NULLABLE_INTEGER, 0), + (NULLABLE_INTEGER, 0), + (NULLABLE_INTEGER, 0), + (STRING, 0), + ), +) + +MESSAGE_SYSTEM_ATTRIBUTE_MAP: StaticSchema = ( + 17, + n0, + _MSAM, + 0, + (_k, _v), + ((MESSAGE_SYSTEM_ATTRIBUTE_NAME, {_sN: _N}), (STRING, {_sN: _V})), +) + +BINARY: StaticSchema = (1, n0, _Bi, 0) + +BINARY_LIST: StaticSchema = (16, n0, _BL, 0, (_m,), ((BINARY, {_sN: _BLV}),)) + +STRING_LIST: StaticSchema = (16, n0, _SL, 0, (_m,), ((STRING, {_sN: _SLV}),)) + +MESSAGE_ATTRIBUTE_VALUE: StaticSchema = ( + 18, + n0, + _MAV, + 0, + (_SV, _BV, _SLVt, _BLVi, _DT), + ( + (STRING, 0), + (BINARY, 0), + (STRING_LIST, {_sN: _SLV, _sF: None}), + (BINARY_LIST, {_sN: _BLV, _sF: None}), + (STRING, 1), + ), +) + +MESSAGE_BODY_ATTRIBUTE_MAP: StaticSchema = ( + 17, + n0, + _MBAM, + 0, + (_k, _v), + ((STRING, {_sN: _N}), (MESSAGE_ATTRIBUTE_VALUE, {_sN: _V})), +) + +MESSAGE: StaticSchema = ( + 18, + n0, + _M, + 0, + (_MI, _RH, _MDOB, _Bo, _At, _MDOMA, _MA), + ( + (STRING, 0), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (MESSAGE_SYSTEM_ATTRIBUTE_MAP, {_sN: _Att, _sF: None}), + (STRING, 0), + (MESSAGE_BODY_ATTRIBUTE_MAP, {_sN: _MAe, _sF: None}), + ), +) + +MESSAGE_LIST: StaticSchema = (16, n0, _ML, 0, (_m,), ((MESSAGE, 0),)) + +RECEIVE_MESSAGE_OUTPUT: StaticSchema = ( + 18, + n0, + _RMO, + {_sSI: _cRMRo, _smi: None}, + (_Me,), + ((MESSAGE_LIST, {_sN: _M, _sF: None}),), +) + +RECEIVE_MESSAGE: StaticOperationSchema = ( + 23, + n0, + _RM, + 0, + RECEIVE_MESSAGE_INPUT, + RECEIVE_MESSAGE_OUTPUT, + ( + INVALID_ADDRESS, + INVALID_SECURITY, + KMS_ACCESS_DENIED, + KMS_DISABLED, + KMS_INVALID_KEY_USAGE, + KMS_INVALID_STATE, + KMS_NOT_FOUND, + KMS_OPT_IN_REQUIRED, + KMS_THROTTLED, + OVER_LIMIT, + QUEUE_DOES_NOT_EXIST, + REQUEST_THROTTLED, + UNSUPPORTED_OPERATION, + ), +) + +REMOVE_PERMISSION_INPUT: StaticSchema = ( + 18, + n0, + _RPI, + {_sSI: _cRPR, _s: None}, + (_QU, _L), + ((STRING, 1), (STRING, 1)), +) + +REMOVE_PERMISSION_OUTPUT: StaticSchema = (18, n0, _RPO, {_sSI: _sU, _smi: None}) + +REMOVE_PERMISSION: StaticOperationSchema = ( + 23, + n0, + _RPe, + 0, + REMOVE_PERMISSION_INPUT, + REMOVE_PERMISSION_OUTPUT, + ( + INVALID_ADDRESS, + INVALID_SECURITY, + QUEUE_DOES_NOT_EXIST, + REQUEST_THROTTLED, + UNSUPPORTED_OPERATION, + ), +) + +INVALID_MESSAGE_CONTENTS: StaticSchema = ( + 18, + n0, + _IMC, + {_smit: _c}, + (_me,), + ((EXCEPTION_MESSAGE, 0),), +) + +MESSAGE_SYSTEM_ATTRIBUTE_NAME_FOR_SENDS: StaticSchema = ( + 14, + n0, + _MSANFS, + 0, + (_AWSTH,), + ((-1, {_sV: _AWSTH}),), +) + +MESSAGE_SYSTEM_ATTRIBUTE_VALUE: StaticSchema = ( + 18, + n0, + _MSAV, + 0, + (_SV, _BV, _SLVt, _BLVi, _DT), + ( + (STRING, 0), + (BINARY, 0), + (STRING_LIST, {_sN: _SLV, _sF: None}), + (BINARY_LIST, {_sN: _BLV, _sF: None}), + (STRING, 1), + ), +) + +MESSAGE_BODY_SYSTEM_ATTRIBUTE_MAP: StaticSchema = ( + 17, + n0, + _MBSAM, + 0, + (_k, _v), + ( + (MESSAGE_SYSTEM_ATTRIBUTE_NAME_FOR_SENDS, {_sN: _N}), + (MESSAGE_SYSTEM_ATTRIBUTE_VALUE, {_sN: _V}), + ), +) + +SEND_MESSAGE_INPUT: StaticSchema = ( + 18, + n0, + _SMI, + {_sSI: _cSMR, _s: None}, + (_QU, _MB, _DS, _MA, _MSA, _MDI, _MGI), + ( + (STRING, 1), + (STRING, 1), + (NULLABLE_INTEGER, 0), + (MESSAGE_BODY_ATTRIBUTE_MAP, {_sN: _MAe, _sF: None}), + (MESSAGE_BODY_SYSTEM_ATTRIBUTE_MAP, {_sN: _MSAe, _sF: None}), + (STRING, 0), + (STRING, 0), + ), +) + +SEND_MESSAGE_OUTPUT: StaticSchema = ( + 18, + n0, + _SMO, + {_sSI: _cSMRo, _smi: None}, + (_MDOMB, _MDOMA, _MDOMSA, _MI, _SN), + ((STRING, 0), (STRING, 0), (STRING, 0), (STRING, 0), (STRING, 0)), +) + +SEND_MESSAGE: StaticOperationSchema = ( + 23, + n0, + _SM, + 0, + SEND_MESSAGE_INPUT, + SEND_MESSAGE_OUTPUT, + ( + INVALID_ADDRESS, + INVALID_MESSAGE_CONTENTS, + INVALID_SECURITY, + KMS_ACCESS_DENIED, + KMS_DISABLED, + KMS_INVALID_KEY_USAGE, + KMS_INVALID_STATE, + KMS_NOT_FOUND, + KMS_OPT_IN_REQUIRED, + KMS_THROTTLED, + QUEUE_DOES_NOT_EXIST, + REQUEST_THROTTLED, + UNSUPPORTED_OPERATION, + ), +) + +BATCH_REQUEST_TOO_LONG: StaticSchema = ( + 18, + n0, + _BRTL, + {_smit: _c, _sE: 400}, + (_me,), + ((EXCEPTION_MESSAGE, 0),), +) + +SEND_MESSAGE_BATCH_REQUEST_ENTRY: StaticSchema = ( + 18, + n0, + _SMBRE, + 0, + (_I, _MB, _DS, _MA, _MSA, _MDI, _MGI), + ( + (STRING, 1), + (STRING, 1), + (NULLABLE_INTEGER, 0), + (MESSAGE_BODY_ATTRIBUTE_MAP, {_sN: _MAe, _sF: None}), + (MESSAGE_BODY_SYSTEM_ATTRIBUTE_MAP, {_sN: _MSAe, _sF: None}), + (STRING, 0), + (STRING, 0), + ), +) + +SEND_MESSAGE_BATCH_REQUEST_ENTRY_LIST: StaticSchema = ( + 16, + n0, + _SMBREL, + 0, + (_m,), + ((SEND_MESSAGE_BATCH_REQUEST_ENTRY, 0),), +) + +SEND_MESSAGE_BATCH_INPUT: StaticSchema = ( + 18, + n0, + _SMBI, + {_sSI: _cSMBR, _s: None}, + (_QU, _E), + ( + (STRING, 1), + (SEND_MESSAGE_BATCH_REQUEST_ENTRY_LIST, {_sN: _SMBRE, _sF: None, _sm: None}), + ), +) + +SEND_MESSAGE_BATCH_RESULT_ENTRY: StaticSchema = ( + 18, + n0, + _SMBREe, + 0, + (_I, _MI, _MDOMB, _MDOMA, _MDOMSA, _SN), + ((STRING, 1), (STRING, 1), (STRING, 1), (STRING, 0), (STRING, 0), (STRING, 0)), +) + +SEND_MESSAGE_BATCH_RESULT_ENTRY_LIST: StaticSchema = ( + 16, + n0, + _SMBRELe, + 0, + (_m,), + ((SEND_MESSAGE_BATCH_RESULT_ENTRY, 0),), +) + +SEND_MESSAGE_BATCH_OUTPUT: StaticSchema = ( + 18, + n0, + _SMBO, + {_sSI: _cSMBRo, _smi: None}, + (_Su, _F), + ( + (SEND_MESSAGE_BATCH_RESULT_ENTRY_LIST, {_sN: _SMBREe, _sF: None, _sm: None}), + (BATCH_RESULT_ERROR_ENTRY_LIST, {_sN: _BREE, _sF: None, _sm: None}), + ), +) + +SEND_MESSAGE_BATCH: StaticOperationSchema = ( + 23, + n0, + _SMB, + 0, + SEND_MESSAGE_BATCH_INPUT, + SEND_MESSAGE_BATCH_OUTPUT, + ( + BATCH_ENTRY_IDS_NOT_DISTINCT, + BATCH_REQUEST_TOO_LONG, + EMPTY_BATCH_REQUEST, + INVALID_ADDRESS, + INVALID_BATCH_ENTRY_ID, + INVALID_SECURITY, + KMS_ACCESS_DENIED, + KMS_DISABLED, + KMS_INVALID_KEY_USAGE, + KMS_INVALID_STATE, + KMS_NOT_FOUND, + KMS_OPT_IN_REQUIRED, + KMS_THROTTLED, + QUEUE_DOES_NOT_EXIST, + REQUEST_THROTTLED, + TOO_MANY_ENTRIES_IN_BATCH_REQUEST, + UNSUPPORTED_OPERATION, + ), +) + +SET_QUEUE_ATTRIBUTES_INPUT: StaticSchema = ( + 18, + n0, + _SQAI, + {_sSI: _cSQAR, _s: None}, + (_QU, _At), + ((STRING, 1), (QUEUE_ATTRIBUTE_MAP, {_sN: _Att, _sF: None, _sm: None})), +) + +SET_QUEUE_ATTRIBUTES_OUTPUT: StaticSchema = (18, n0, _SQAO, {_sSI: _sU, _smi: None}) + +SET_QUEUE_ATTRIBUTES: StaticOperationSchema = ( + 23, + n0, + _SQA, + 0, + SET_QUEUE_ATTRIBUTES_INPUT, + SET_QUEUE_ATTRIBUTES_OUTPUT, + ( + INVALID_ADDRESS, + INVALID_ATTRIBUTE_NAME, + INVALID_ATTRIBUTE_VALUE, + INVALID_SECURITY, + OVER_LIMIT, + QUEUE_DOES_NOT_EXIST, + REQUEST_THROTTLED, + UNSUPPORTED_OPERATION, + ), +) + +START_MESSAGE_MOVE_TASK_INPUT: StaticSchema = ( + 18, + n0, + _SMMTI, + {_sSI: _cSMMTR, _s: None}, + (_SA, _DA, _MNOMPS), + ((STRING, 1), (STRING, 0), (NULLABLE_INTEGER, 0)), +) + +START_MESSAGE_MOVE_TASK_OUTPUT: StaticSchema = ( + 18, + n0, + _SMMTO, + {_sSI: _cSMMTRo, _smi: None}, + (_TH,), + ((STRING, 0),), +) + +START_MESSAGE_MOVE_TASK: StaticOperationSchema = ( + 23, + n0, + _SMMT, + 0, + START_MESSAGE_MOVE_TASK_INPUT, + START_MESSAGE_MOVE_TASK_OUTPUT, + ( + INVALID_ADDRESS, + INVALID_SECURITY, + REQUEST_THROTTLED, + RESOURCE_NOT_FOUND_EXCEPTION, + UNSUPPORTED_OPERATION, + ), +) + +TAG_QUEUE_INPUT: StaticSchema = ( + 18, + n0, + _TQI, + {_sSI: _cTQR, _s: None}, + (_QU, _Ta), + ((STRING, 1), (TAG_MAP, {_sN: _T, _sF: None, _sm: None})), +) + +TAG_QUEUE_OUTPUT: StaticSchema = (18, n0, _TQO, {_sSI: _sU, _smi: None}) + +TAG_QUEUE: StaticOperationSchema = ( + 23, + n0, + _TQ, + 0, + TAG_QUEUE_INPUT, + TAG_QUEUE_OUTPUT, + ( + INVALID_ADDRESS, + INVALID_SECURITY, + QUEUE_DOES_NOT_EXIST, + REQUEST_THROTTLED, + UNSUPPORTED_OPERATION, + ), +) + +TAG_KEY_LIST: StaticSchema = (16, n0, _TKL, 0, (_m,), ((TAG_KEY, 0),)) + +UNTAG_QUEUE_INPUT: StaticSchema = ( + 18, + n0, + _UQI, + {_sSI: _cUQR, _s: None}, + (_QU, _TKa), + ((STRING, 1), (TAG_KEY_LIST, {_sN: _TK, _sF: None, _sm: None})), +) + +UNTAG_QUEUE_OUTPUT: StaticSchema = (18, n0, _UQO, {_sSI: _sU, _smi: None}) + +UNTAG_QUEUE: StaticOperationSchema = ( + 23, + n0, + _UQ, + 0, + UNTAG_QUEUE_INPUT, + UNTAG_QUEUE_OUTPUT, + ( + INVALID_ADDRESS, + INVALID_SECURITY, + QUEUE_DOES_NOT_EXIST, + REQUEST_THROTTLED, + UNSUPPORTED_OPERATION, + ), +) + +AMAZON_SQS: StaticSchema = ( + 21, + n0, + _ASQS, + { + _a: MappingProxyType({"name": "sqs"}), + _a_: None, + _sB: MappingProxyType( + { + "version": "1.1", + "parameters": MappingProxyType( + { + "Region": MappingProxyType( { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "Endpoint"}),), + "builtIn": "AWS::Region", + "required": False, + "documentation": "The AWS region used to dispatch the request.", + "type": "string", } ), - MappingProxyType( + "UseDualStack": MappingProxyType( { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "Region"}),), + "builtIn": "AWS::UseDualStack", + "required": True, + "default": False, + "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", + "type": "boolean", } ), - MappingProxyType( + "UseFIPS": MappingProxyType( { - "fn": "aws.partition", - "argv": (MappingProxyType({"ref": "Region"}),), - "assign": "PartitionResult", + "builtIn": "AWS::UseFIPS", + "required": True, + "default": False, + "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", + "type": "boolean", } ), - MappingProxyType( + "Endpoint": MappingProxyType( { - "fn": "booleanEquals", - "argv": (MappingProxyType({"ref": "UseFIPS"}), True), - } - ), - MappingProxyType( - { - "fn": "booleanEquals", - "argv": ( - MappingProxyType({"ref": "UseDualStack"}), - True, - ), - } - ), - MappingProxyType( - { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "supportsDualStack", - ), - } - ), - True, - ), - } - ), - MappingProxyType( - { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "supportsFIPS", - ), - } - ), - True, - ), - } - ), - MappingProxyType( - { - "fn": "stringEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "name", - ), - } - ), - "aws-us-gov", - ), + "builtIn": "SDK::Endpoint", + "required": False, + "documentation": "Override the endpoint used to send this request", + "type": "string", } ), + } + ), + "conditions": ( + MappingProxyType( + { + "fn": "isSet", + "argv": (MappingProxyType({"ref": "Endpoint"}),), + } ), - "results": ( - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: FIPS and custom endpoint are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": MappingProxyType({"ref": "Endpoint"}), - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://sqs-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "FIPS and DualStack are enabled, but this partition does not support one or both", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://sqs.{Region}.amazonaws.com", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + MappingProxyType( + {"fn": "isSet", "argv": (MappingProxyType({"ref": "Region"}),)} + ), + MappingProxyType( + { + "fn": "aws.partition", + "argv": (MappingProxyType({"ref": "Region"}),), + "assign": "PartitionResult", + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": (MappingProxyType({"ref": "UseFIPS"}), True), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": (MappingProxyType({"ref": "UseDualStack"}), True), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( { - "url": "https://sqs-fips.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "supportsDualStack", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "FIPS is enabled but this partition does not support FIPS", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + True, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( { - "url": "https://sqs.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "supportsFIPS", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "DualStack is enabled but this partition does not support DualStack", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + True, + ), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( { - "url": "https://sqs.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "name", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: Missing Region", - "type": "error", - } - ), + "aws-us-gov", + ), + } + ), + ), + "results": ( + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: FIPS and custom endpoint are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", + "type": "error", + } ), - "root": 2, - "nodeCount": 14, - "nodes": "/////wAAAAH/////AAAAAAAAAA0AAAADAAAAAQAAAAQF9eEMAAAAAgAAAAUF9eEMAAAAAwAAAAgAAAAGAAAABAAAAAcF9eELAAAABQX14QkF9eEKAAAABAAAAAsAAAAJAAAABgAAAAoF9eEIAAAABwX14QYF9eEHAAAABQAAAAwF9eEFAAAABgX14QQF9eEFAAAAAwX14QEAAAAOAAAABAX14QIF9eED", - } - ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": MappingProxyType({"ref": "Endpoint"}), + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://sqs-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS and DualStack are enabled, but this partition does not support one or both", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://sqs.{Region}.amazonaws.com", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://sqs-fips.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS is enabled but this partition does not support FIPS", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://sqs.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "DualStack is enabled but this partition does not support DualStack", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://sqs.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Missing Region", + "type": "error", + } + ), + ), + "root": 2, + "nodeCount": 14, + "nodes": "/////wAAAAH/////AAAAAAAAAA0AAAADAAAAAQAAAAQF9eEMAAAAAgAAAAUF9eEMAAAAAwAAAAgAAAAGAAAABAAAAAcF9eELAAAABQX14QkF9eEKAAAABAAAAAsAAAAJAAAABgAAAAoF9eEIAAAABwX14QYF9eEHAAAABQAAAAwF9eEFAAAABgX14QQF9eEFAAAAAwX14QEAAAAOAAAABAX14QIF9eED", + } ), - Trait.new( - id=ShapeID("aws.api#service"), - value=MappingProxyType( - { - "sdkId": "SQS", - "arnNamespace": "sqs", - "cloudFormationName": "SQS", - "cloudTrailEventSource": "sqs.amazonaws.com", - "endpointPrefix": "sqs", - } - ), + _aw: MappingProxyType( + { + "sdkId": "SQS", + "arnNamespace": "sqs", + "cloudFormationName": "SQS", + "cloudTrailEventSource": "sqs.amazonaws.com", + "endpointPrefix": "sqs", + } ), - ], + }, ) diff --git a/clients/aws-sdk-sqs/src/aws_sdk_sqs/client.py b/clients/aws-sdk-sqs/src/aws_sdk_sqs/client.py index eb8aea23..3e0cd875 100644 --- a/clients/aws-sdk-sqs/src/aws_sdk_sqs/client.py +++ b/clients/aws-sdk-sqs/src/aws_sdk_sqs/client.py @@ -1,94 +1,102 @@ # Code generated by smithy-python-codegen DO NOT EDIT. +from __future__ import annotations + from copy import deepcopy import logging from typing import Any, cast +from smithy_aws_core.aio.identity.chain import AsyncIdentityChain from smithy_aws_core.config import ConfigSource from smithy_aws_core.identity import AWSCredentialsIdentity -from smithy_aws_core.identity.chain import IdentityChain -from smithy_core.aio.client import AsyncClient, ClientCall, RequestPipeline +from smithy_core.aio.client import AsyncClient, AsyncClientCall, AsyncRequestPipeline from smithy_core.deserializers import DeserializeableShape from smithy_core.exceptions import ExpectationNotMetError from smithy_core.schemas import APIOperation from smithy_core.serializers import SerializeableShape -from smithy_http.aio.interfaces import HTTPClient +from smithy_http.aio.interfaces import AsyncHTTPClient from smithy_http.plugins import user_agent_plugin from .config import AsyncSQSConfig, Plugin from .models import ( ADD_PERMISSION, - AddPermissionInput, - AddPermissionOutput, CANCEL_MESSAGE_MOVE_TASK, CHANGE_MESSAGE_VISIBILITY, CHANGE_MESSAGE_VISIBILITY_BATCH, CREATE_QUEUE, - CancelMessageMoveTaskInput, - CancelMessageMoveTaskOutput, - ChangeMessageVisibilityBatchInput, - ChangeMessageVisibilityBatchOutput, - ChangeMessageVisibilityInput, - ChangeMessageVisibilityOutput, - CreateQueueInput, - CreateQueueOutput, DELETE_MESSAGE, DELETE_MESSAGE_BATCH, DELETE_QUEUE, - DeleteMessageBatchInput, - DeleteMessageBatchOutput, - DeleteMessageInput, - DeleteMessageOutput, - DeleteQueueInput, - DeleteQueueOutput, GET_QUEUE_ATTRIBUTES, GET_QUEUE_URL, - GetQueueAttributesInput, - GetQueueAttributesOutput, - GetQueueUrlInput, - GetQueueUrlOutput, LIST_DEAD_LETTER_SOURCE_QUEUES, LIST_MESSAGE_MOVE_TASKS, LIST_QUEUES, LIST_QUEUE_TAGS, - ListDeadLetterSourceQueuesInput, - ListDeadLetterSourceQueuesOutput, - ListMessageMoveTasksInput, - ListMessageMoveTasksOutput, - ListQueueTagsInput, - ListQueueTagsOutput, - ListQueuesInput, - ListQueuesOutput, PURGE_QUEUE, - PurgeQueueInput, - PurgeQueueOutput, RECEIVE_MESSAGE, REMOVE_PERMISSION, - ReceiveMessageInput, - ReceiveMessageOutput, - RemovePermissionInput, - RemovePermissionOutput, SEND_MESSAGE, SEND_MESSAGE_BATCH, SET_QUEUE_ATTRIBUTES, START_MESSAGE_MOVE_TASK, - SendMessageBatchInput, - SendMessageBatchOutput, - SendMessageInput, - SendMessageOutput, - SetQueueAttributesInput, - SetQueueAttributesOutput, - StartMessageMoveTaskInput, - StartMessageMoveTaskOutput, TAG_QUEUE, - TagQueueInput, - TagQueueOutput, UNTAG_QUEUE, - UntagQueueInput, - UntagQueueOutput, ) from .user_agent import aws_user_agent_plugin +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .models import ( + AddPermissionInput, + AddPermissionOutput, + CancelMessageMoveTaskInput, + CancelMessageMoveTaskOutput, + ChangeMessageVisibilityBatchInput, + ChangeMessageVisibilityBatchOutput, + ChangeMessageVisibilityInput, + ChangeMessageVisibilityOutput, + CreateQueueInput, + CreateQueueOutput, + DeleteMessageBatchInput, + DeleteMessageBatchOutput, + DeleteMessageInput, + DeleteMessageOutput, + DeleteQueueInput, + DeleteQueueOutput, + GetQueueAttributesInput, + GetQueueAttributesOutput, + GetQueueUrlInput, + GetQueueUrlOutput, + ListDeadLetterSourceQueuesInput, + ListDeadLetterSourceQueuesOutput, + ListMessageMoveTasksInput, + ListMessageMoveTasksOutput, + ListQueueTagsInput, + ListQueueTagsOutput, + ListQueuesInput, + ListQueuesOutput, + PurgeQueueInput, + PurgeQueueOutput, + ReceiveMessageInput, + ReceiveMessageOutput, + RemovePermissionInput, + RemovePermissionOutput, + SendMessageBatchInput, + SendMessageBatchOutput, + SendMessageInput, + SendMessageOutput, + SetQueueAttributesInput, + SetQueueAttributesOutput, + StartMessageMoveTaskInput, + StartMessageMoveTaskOutput, + TagQueueInput, + TagQueueOutput, + UntagQueueInput, + UntagQueueOutput, + ) + logger = logging.getLogger(__name__) @@ -197,12 +205,12 @@ async def _post_setup(self, config: AsyncSQSConfig) -> None: config_file = await config_context.parsed_profiles() if config_context.profile_source is ConfigSource.OVERRIDE: profile_name = config_context.profile_name - config.aws_credentials_identity_resolver = await IdentityChain.create( + config.aws_credentials_identity_resolver = await AsyncIdentityChain.create( AWSCredentialsIdentity, config_file=config_file, profile_name=profile_name, region_override=config.region, - http_client=cast(HTTPClient | None, config.transport), + http_client=cast(AsyncHTTPClient | None, config.transport), ) async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( @@ -211,7 +219,7 @@ async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( operation: APIOperation[I, O], default_plugins: list[Plugin], plugins: list[Plugin] | None, - ) -> tuple[RequestPipeline[Any, Any], ClientCall[I, O]]: + ) -> tuple[AsyncRequestPipeline[Any, Any], AsyncClientCall[I, O]]: if self._closed: raise RuntimeError( "Cannot invoke an operation on a client that has been closed." diff --git a/clients/aws-sdk-sqs/src/aws_sdk_sqs/config.py b/clients/aws-sdk-sqs/src/aws_sdk_sqs/config.py index d1bf8963..9c2839d2 100644 --- a/clients/aws-sdk-sqs/src/aws_sdk_sqs/config.py +++ b/clients/aws-sdk-sqs/src/aws_sdk_sqs/config.py @@ -1,122 +1,140 @@ # Code generated by smithy-python-codegen DO NOT EDIT. from dataclasses import dataclass, field -from typing import Any, Callable, ClassVar, Self, TypeAlias, Union, Unpack +from typing import ( + Any, + Callable, + ClassVar, + Self, + TYPE_CHECKING, + TypeAlias, + Union, + Unpack, +) -from smithy_aws_core.aio.protocols import AwsJson10ClientProtocol -from smithy_aws_core.auth import SigV4AuthScheme -from smithy_aws_core.config import AwsConfigOverrides, FileSystem -from smithy_aws_core.config.aws_config import AsyncAwsConfig -from smithy_aws_core.config.resolvers import EndpointUriResolver -from smithy_aws_core.config.types import FieldSpec -from smithy_aws_core.endpoints.standard_regional import ( - StandardRegionalEndpointsResolver, +from smithy_aws_core.aio.auth.sigv4 import AsyncSigV4AuthScheme +from smithy_aws_core.aio.config import AsyncFileSystem +from smithy_aws_core.aio.config.aws_config import AsyncAwsConfig, AwsConfigOverrides +from smithy_aws_core.aio.config.resolvers import EndpointUriResolver +from smithy_aws_core.aio.endpoints.standard_regional import ( + AsyncStandardRegionalEndpointsResolver, ) +from smithy_aws_core.aio.protocols import AsyncAwsJson10ClientProtocol +from smithy_aws_core.config.types import FieldSpec from smithy_aws_core.identity import AWSCredentialsIdentity, AWSIdentityProperties -from smithy_core.aio.interfaces import ( - ClientProtocol, - EndpointResolver, - ProtocolConstructor, - ProtocolSettings, -) -from smithy_core.aio.interfaces.auth import AuthScheme -from smithy_core.aio.interfaces.identity import IdentityResolver -from smithy_core.interceptors import Interceptor +from smithy_core.aio.interfaces import AsyncClientProtocol, AsyncEndpointResolver +from smithy_core.aio.interfaces.auth import AsyncAuthScheme +from smithy_core.aio.interfaces.identity import AsyncIdentityResolver +from smithy_core.interfaces import ProtocolConstructor, ProtocolSettings from smithy_core.interfaces.auth import AuthSchemeResolver from smithy_core.shapes import ShapeID from smithy_http.aio.aiohttp import AIOHTTPClient +from ._private.schemas import AMAZON_SQS from .auth import HTTPAuthSchemeResolver -from .models import ( - AddPermissionInput, - AddPermissionOutput, - CancelMessageMoveTaskInput, - CancelMessageMoveTaskOutput, - ChangeMessageVisibilityBatchInput, - ChangeMessageVisibilityBatchOutput, - ChangeMessageVisibilityInput, - ChangeMessageVisibilityOutput, - CreateQueueInput, - CreateQueueOutput, - DeleteMessageBatchInput, - DeleteMessageBatchOutput, - DeleteMessageInput, - DeleteMessageOutput, - DeleteQueueInput, - DeleteQueueOutput, - GetQueueAttributesInput, - GetQueueAttributesOutput, - GetQueueUrlInput, - GetQueueUrlOutput, - ListDeadLetterSourceQueuesInput, - ListDeadLetterSourceQueuesOutput, - ListMessageMoveTasksInput, - ListMessageMoveTasksOutput, - ListQueueTagsInput, - ListQueueTagsOutput, - ListQueuesInput, - ListQueuesOutput, - PurgeQueueInput, - PurgeQueueOutput, - ReceiveMessageInput, - ReceiveMessageOutput, - RemovePermissionInput, - RemovePermissionOutput, - SendMessageBatchInput, - SendMessageBatchOutput, - SendMessageInput, - SendMessageOutput, - SetQueueAttributesInput, - SetQueueAttributesOutput, - StartMessageMoveTaskInput, - StartMessageMoveTaskOutput, - TagQueueInput, - TagQueueOutput, - UntagQueueInput, - UntagQueueOutput, -) -_ServiceInterceptor = Union[ - Interceptor[AddPermissionInput, AddPermissionOutput, Any, Any], - Interceptor[CancelMessageMoveTaskInput, CancelMessageMoveTaskOutput, Any, Any], - Interceptor[ChangeMessageVisibilityInput, ChangeMessageVisibilityOutput, Any, Any], - Interceptor[ - ChangeMessageVisibilityBatchInput, ChangeMessageVisibilityBatchOutput, Any, Any - ], - Interceptor[CreateQueueInput, CreateQueueOutput, Any, Any], - Interceptor[DeleteMessageInput, DeleteMessageOutput, Any, Any], - Interceptor[DeleteMessageBatchInput, DeleteMessageBatchOutput, Any, Any], - Interceptor[DeleteQueueInput, DeleteQueueOutput, Any, Any], - Interceptor[GetQueueAttributesInput, GetQueueAttributesOutput, Any, Any], - Interceptor[GetQueueUrlInput, GetQueueUrlOutput, Any, Any], - Interceptor[ - ListDeadLetterSourceQueuesInput, ListDeadLetterSourceQueuesOutput, Any, Any - ], - Interceptor[ListMessageMoveTasksInput, ListMessageMoveTasksOutput, Any, Any], - Interceptor[ListQueuesInput, ListQueuesOutput, Any, Any], - Interceptor[ListQueueTagsInput, ListQueueTagsOutput, Any, Any], - Interceptor[PurgeQueueInput, PurgeQueueOutput, Any, Any], - Interceptor[ReceiveMessageInput, ReceiveMessageOutput, Any, Any], - Interceptor[RemovePermissionInput, RemovePermissionOutput, Any, Any], - Interceptor[SendMessageInput, SendMessageOutput, Any, Any], - Interceptor[SendMessageBatchInput, SendMessageBatchOutput, Any, Any], - Interceptor[SetQueueAttributesInput, SetQueueAttributesOutput, Any, Any], - Interceptor[StartMessageMoveTaskInput, StartMessageMoveTaskOutput, Any, Any], - Interceptor[TagQueueInput, TagQueueOutput, Any, Any], - Interceptor[UntagQueueInput, UntagQueueOutput, Any, Any], -] +if TYPE_CHECKING: + from smithy_core.interceptors import Interceptor + from .models import ( + AddPermissionInput, + AddPermissionOutput, + CancelMessageMoveTaskInput, + CancelMessageMoveTaskOutput, + ChangeMessageVisibilityBatchInput, + ChangeMessageVisibilityBatchOutput, + ChangeMessageVisibilityInput, + ChangeMessageVisibilityOutput, + CreateQueueInput, + CreateQueueOutput, + DeleteMessageBatchInput, + DeleteMessageBatchOutput, + DeleteMessageInput, + DeleteMessageOutput, + DeleteQueueInput, + DeleteQueueOutput, + GetQueueAttributesInput, + GetQueueAttributesOutput, + GetQueueUrlInput, + GetQueueUrlOutput, + ListDeadLetterSourceQueuesInput, + ListDeadLetterSourceQueuesOutput, + ListMessageMoveTasksInput, + ListMessageMoveTasksOutput, + ListQueueTagsInput, + ListQueueTagsOutput, + ListQueuesInput, + ListQueuesOutput, + PurgeQueueInput, + PurgeQueueOutput, + ReceiveMessageInput, + ReceiveMessageOutput, + RemovePermissionInput, + RemovePermissionOutput, + SendMessageBatchInput, + SendMessageBatchOutput, + SendMessageInput, + SendMessageOutput, + SetQueueAttributesInput, + SetQueueAttributesOutput, + StartMessageMoveTaskInput, + StartMessageMoveTaskOutput, + TagQueueInput, + TagQueueOutput, + UntagQueueInput, + UntagQueueOutput, + ) + + _ServiceInterceptor = Union[ + Interceptor[AddPermissionInput, AddPermissionOutput, Any, Any], + Interceptor[CancelMessageMoveTaskInput, CancelMessageMoveTaskOutput, Any, Any], + Interceptor[ + ChangeMessageVisibilityInput, ChangeMessageVisibilityOutput, Any, Any + ], + Interceptor[ + ChangeMessageVisibilityBatchInput, + ChangeMessageVisibilityBatchOutput, + Any, + Any, + ], + Interceptor[CreateQueueInput, CreateQueueOutput, Any, Any], + Interceptor[DeleteMessageInput, DeleteMessageOutput, Any, Any], + Interceptor[DeleteMessageBatchInput, DeleteMessageBatchOutput, Any, Any], + Interceptor[DeleteQueueInput, DeleteQueueOutput, Any, Any], + Interceptor[GetQueueAttributesInput, GetQueueAttributesOutput, Any, Any], + Interceptor[GetQueueUrlInput, GetQueueUrlOutput, Any, Any], + Interceptor[ + ListDeadLetterSourceQueuesInput, ListDeadLetterSourceQueuesOutput, Any, Any + ], + Interceptor[ListMessageMoveTasksInput, ListMessageMoveTasksOutput, Any, Any], + Interceptor[ListQueuesInput, ListQueuesOutput, Any, Any], + Interceptor[ListQueueTagsInput, ListQueueTagsOutput, Any, Any], + Interceptor[PurgeQueueInput, PurgeQueueOutput, Any, Any], + Interceptor[ReceiveMessageInput, ReceiveMessageOutput, Any, Any], + Interceptor[RemovePermissionInput, RemovePermissionOutput, Any, Any], + Interceptor[SendMessageInput, SendMessageOutput, Any, Any], + Interceptor[SendMessageBatchInput, SendMessageBatchOutput, Any, Any], + Interceptor[SetQueueAttributesInput, SetQueueAttributesOutput, Any, Any], + Interceptor[StartMessageMoveTaskInput, StartMessageMoveTaskOutput, Any, Any], + Interceptor[TagQueueInput, TagQueueOutput, Any, Any], + Interceptor[UntagQueueInput, UntagQueueOutput, Any, Any], + ] +else: + _ServiceInterceptor = Any + _PROTOCOL_SETTINGS = ProtocolSettings( - namespace="com.amazonaws.sqs", service_target="AmazonSQS" + namespace="com.amazonaws.sqs", service_target="AmazonSQS", service_schema=AMAZON_SQS ) class _AsyncSQSConfigOverrides(AwsConfigOverrides, total=False): - endpoint_resolver: EndpointResolver | None + endpoint_resolver: AsyncEndpointResolver | None protocol: ( - ClientProtocol[Any, Any] | ProtocolConstructor[ClientProtocol[Any, Any]] | None + AsyncClientProtocol[Any, Any] + | ProtocolConstructor[AsyncClientProtocol[Any, Any]] + | None ) - auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None + auth_schemes: dict[ShapeID, AsyncAuthScheme[Any, Any, Any, Any]] | None auth_scheme_resolver: AuthSchemeResolver | None @@ -124,17 +142,17 @@ class _AsyncSQSConfigOverrides(AwsConfigOverrides, total=False): class AsyncSQSConfig(AsyncAwsConfig): """SQS configuration (async-resolved).""" - endpoint_resolver: EndpointResolver | None = None + endpoint_resolver: AsyncEndpointResolver | None = None """ The endpoint resolver used to resolve the final endpoint per-operation based on the configuration. """ - protocol: ClientProtocol[Any, Any] | None = None + protocol: AsyncClientProtocol[Any, Any] | None = None """ Pass a protocol class reference from smithy_aws_core.aio.protocols to - select the protocol, e.g. protocol=AwsJson10ClientProtocol. For custom - protocols a protocol instance may also be passed. + select the protocol, e.g. protocol=AsyncAwsJson10ClientProtocol. For + custom protocols a protocol instance may also be passed. """ interceptors: list[_ServiceInterceptor] = field(default_factory=lambda: []) @@ -143,7 +161,7 @@ class AsyncSQSConfig(AsyncAwsConfig): execution of a request. """ - auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None = None + auth_schemes: dict[ShapeID, AsyncAuthScheme[Any, Any, Any, Any]] | None = None """A map of auth scheme ids to auth schemes.""" auth_scheme_resolver: AuthSchemeResolver | None = None @@ -153,7 +171,7 @@ class AsyncSQSConfig(AsyncAwsConfig): """ aws_credentials_identity_resolver: ( - IdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None + AsyncIdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None ) = None """Resolves AWS Credentials. Required for operations that use Sigv4 Auth.""" @@ -192,24 +210,24 @@ class AsyncSQSConfig(AsyncAwsConfig): **AsyncAwsConfig._FIELDS, "endpoint_uri": FieldSpec(default=None, resolver=EndpointUriResolver("sqs")), "endpoint_resolver": FieldSpec( - default_factory=lambda: StandardRegionalEndpointsResolver( + default_factory=lambda: AsyncStandardRegionalEndpointsResolver( endpoint_prefix="sqs" ) ), "protocol": FieldSpec( - default_factory=lambda: AwsJson10ClientProtocol(_PROTOCOL_SETTINGS), + default_factory=lambda: AsyncAwsJson10ClientProtocol(_PROTOCOL_SETTINGS), converter=lambda p: p(_PROTOCOL_SETTINGS) if isinstance(p, type) else p, ), "auth_schemes": FieldSpec( default_factory=lambda: { - ShapeID("aws.auth#sigv4"): SigV4AuthScheme(service="sqs") + ShapeID("aws.auth#sigv4"): AsyncSigV4AuthScheme(service="sqs") } ), "auth_scheme_resolver": FieldSpec(default_factory=HTTPAuthSchemeResolver), "transport": FieldSpec(default_factory=lambda: AIOHTTPClient()), } - def set_auth_scheme(self, scheme: AuthScheme[Any, Any, Any, Any]) -> None: + def set_auth_scheme(self, scheme: AsyncAuthScheme[Any, Any, Any, Any]) -> None: """ Set an auth scheme implementation using its scheme ID. :param scheme: The auth scheme to add or replace. @@ -223,7 +241,7 @@ async def resolve( # pyright: ignore[reportIncompatibleMethodOverride] cls, *, profile: str | None = None, - fs: FileSystem | None = None, + fs: AsyncFileSystem | None = None, config_file_path: str | None = None, credentials_file_path: str | None = None, **overrides: Unpack[_AsyncSQSConfigOverrides], diff --git a/clients/aws-sdk-sqs/src/aws_sdk_sqs/models.py b/clients/aws-sdk-sqs/src/aws_sdk_sqs/models.py index dfed7427..3be2aa2c 100644 --- a/clients/aws-sdk-sqs/src/aws_sdk_sqs/models.py +++ b/clients/aws-sdk-sqs/src/aws_sdk_sqs/models.py @@ -1,7774 +1,659 @@ # Code generated by smithy-python-codegen DO NOT EDIT. -from dataclasses import dataclass, field -from enum import StrEnum -import logging -from typing import Any, Literal, Self +from __future__ import annotations -from smithy_core.deserializers import ShapeDeserializer -from smithy_core.documents import TypeRegistry +from ._private import schemas as _schemas +from smithy_core._dynamic_models import ModelRegistry from smithy_core.exceptions import ModeledError -from smithy_core.response import EMPTY_RESPONSE_METADATA, ResponseMetadata -from smithy_core.schemas import APIOperation, Schema -from smithy_core.serializers import ShapeSerializer +from smithy_core.schemas import APIOperation from smithy_core.shapes import ShapeID -from smithy_core.types import UnknownEnumMixin from ._private.schemas import ( ADD_PERMISSION as _SCHEMA_ADD_PERMISSION, - ADD_PERMISSION_INPUT as _SCHEMA_ADD_PERMISSION_INPUT, - ADD_PERMISSION_OUTPUT as _SCHEMA_ADD_PERMISSION_OUTPUT, - BATCH_ENTRY_IDS_NOT_DISTINCT as _SCHEMA_BATCH_ENTRY_IDS_NOT_DISTINCT, - BATCH_REQUEST_TOO_LONG as _SCHEMA_BATCH_REQUEST_TOO_LONG, - BATCH_RESULT_ERROR_ENTRY as _SCHEMA_BATCH_RESULT_ERROR_ENTRY, CANCEL_MESSAGE_MOVE_TASK as _SCHEMA_CANCEL_MESSAGE_MOVE_TASK, - CANCEL_MESSAGE_MOVE_TASK_INPUT as _SCHEMA_CANCEL_MESSAGE_MOVE_TASK_INPUT, - CANCEL_MESSAGE_MOVE_TASK_OUTPUT as _SCHEMA_CANCEL_MESSAGE_MOVE_TASK_OUTPUT, CHANGE_MESSAGE_VISIBILITY as _SCHEMA_CHANGE_MESSAGE_VISIBILITY, CHANGE_MESSAGE_VISIBILITY_BATCH as _SCHEMA_CHANGE_MESSAGE_VISIBILITY_BATCH, - CHANGE_MESSAGE_VISIBILITY_BATCH_INPUT as _SCHEMA_CHANGE_MESSAGE_VISIBILITY_BATCH_INPUT, - CHANGE_MESSAGE_VISIBILITY_BATCH_OUTPUT as _SCHEMA_CHANGE_MESSAGE_VISIBILITY_BATCH_OUTPUT, - CHANGE_MESSAGE_VISIBILITY_BATCH_REQUEST_ENTRY as _SCHEMA_CHANGE_MESSAGE_VISIBILITY_BATCH_REQUEST_ENTRY, - CHANGE_MESSAGE_VISIBILITY_BATCH_RESULT_ENTRY as _SCHEMA_CHANGE_MESSAGE_VISIBILITY_BATCH_RESULT_ENTRY, - CHANGE_MESSAGE_VISIBILITY_INPUT as _SCHEMA_CHANGE_MESSAGE_VISIBILITY_INPUT, - CHANGE_MESSAGE_VISIBILITY_OUTPUT as _SCHEMA_CHANGE_MESSAGE_VISIBILITY_OUTPUT, CREATE_QUEUE as _SCHEMA_CREATE_QUEUE, - CREATE_QUEUE_INPUT as _SCHEMA_CREATE_QUEUE_INPUT, - CREATE_QUEUE_OUTPUT as _SCHEMA_CREATE_QUEUE_OUTPUT, DELETE_MESSAGE as _SCHEMA_DELETE_MESSAGE, DELETE_MESSAGE_BATCH as _SCHEMA_DELETE_MESSAGE_BATCH, - DELETE_MESSAGE_BATCH_INPUT as _SCHEMA_DELETE_MESSAGE_BATCH_INPUT, - DELETE_MESSAGE_BATCH_OUTPUT as _SCHEMA_DELETE_MESSAGE_BATCH_OUTPUT, - DELETE_MESSAGE_BATCH_REQUEST_ENTRY as _SCHEMA_DELETE_MESSAGE_BATCH_REQUEST_ENTRY, - DELETE_MESSAGE_BATCH_RESULT_ENTRY as _SCHEMA_DELETE_MESSAGE_BATCH_RESULT_ENTRY, - DELETE_MESSAGE_INPUT as _SCHEMA_DELETE_MESSAGE_INPUT, - DELETE_MESSAGE_OUTPUT as _SCHEMA_DELETE_MESSAGE_OUTPUT, DELETE_QUEUE as _SCHEMA_DELETE_QUEUE, - DELETE_QUEUE_INPUT as _SCHEMA_DELETE_QUEUE_INPUT, - DELETE_QUEUE_OUTPUT as _SCHEMA_DELETE_QUEUE_OUTPUT, - EMPTY_BATCH_REQUEST as _SCHEMA_EMPTY_BATCH_REQUEST, GET_QUEUE_ATTRIBUTES as _SCHEMA_GET_QUEUE_ATTRIBUTES, - GET_QUEUE_ATTRIBUTES_INPUT as _SCHEMA_GET_QUEUE_ATTRIBUTES_INPUT, - GET_QUEUE_ATTRIBUTES_OUTPUT as _SCHEMA_GET_QUEUE_ATTRIBUTES_OUTPUT, GET_QUEUE_URL as _SCHEMA_GET_QUEUE_URL, - GET_QUEUE_URL_INPUT as _SCHEMA_GET_QUEUE_URL_INPUT, - GET_QUEUE_URL_OUTPUT as _SCHEMA_GET_QUEUE_URL_OUTPUT, - INVALID_ADDRESS as _SCHEMA_INVALID_ADDRESS, - INVALID_ATTRIBUTE_NAME as _SCHEMA_INVALID_ATTRIBUTE_NAME, - INVALID_ATTRIBUTE_VALUE as _SCHEMA_INVALID_ATTRIBUTE_VALUE, - INVALID_BATCH_ENTRY_ID as _SCHEMA_INVALID_BATCH_ENTRY_ID, - INVALID_ID_FORMAT as _SCHEMA_INVALID_ID_FORMAT, - INVALID_MESSAGE_CONTENTS as _SCHEMA_INVALID_MESSAGE_CONTENTS, - INVALID_SECURITY as _SCHEMA_INVALID_SECURITY, - KMS_ACCESS_DENIED as _SCHEMA_KMS_ACCESS_DENIED, - KMS_DISABLED as _SCHEMA_KMS_DISABLED, - KMS_INVALID_KEY_USAGE as _SCHEMA_KMS_INVALID_KEY_USAGE, - KMS_INVALID_STATE as _SCHEMA_KMS_INVALID_STATE, - KMS_NOT_FOUND as _SCHEMA_KMS_NOT_FOUND, - KMS_OPT_IN_REQUIRED as _SCHEMA_KMS_OPT_IN_REQUIRED, - KMS_THROTTLED as _SCHEMA_KMS_THROTTLED, LIST_DEAD_LETTER_SOURCE_QUEUES as _SCHEMA_LIST_DEAD_LETTER_SOURCE_QUEUES, - LIST_DEAD_LETTER_SOURCE_QUEUES_INPUT as _SCHEMA_LIST_DEAD_LETTER_SOURCE_QUEUES_INPUT, - LIST_DEAD_LETTER_SOURCE_QUEUES_OUTPUT as _SCHEMA_LIST_DEAD_LETTER_SOURCE_QUEUES_OUTPUT, LIST_MESSAGE_MOVE_TASKS as _SCHEMA_LIST_MESSAGE_MOVE_TASKS, - LIST_MESSAGE_MOVE_TASKS_INPUT as _SCHEMA_LIST_MESSAGE_MOVE_TASKS_INPUT, - LIST_MESSAGE_MOVE_TASKS_OUTPUT as _SCHEMA_LIST_MESSAGE_MOVE_TASKS_OUTPUT, - LIST_MESSAGE_MOVE_TASKS_RESULT_ENTRY as _SCHEMA_LIST_MESSAGE_MOVE_TASKS_RESULT_ENTRY, LIST_QUEUES as _SCHEMA_LIST_QUEUES, - LIST_QUEUES_INPUT as _SCHEMA_LIST_QUEUES_INPUT, - LIST_QUEUES_OUTPUT as _SCHEMA_LIST_QUEUES_OUTPUT, LIST_QUEUE_TAGS as _SCHEMA_LIST_QUEUE_TAGS, - LIST_QUEUE_TAGS_INPUT as _SCHEMA_LIST_QUEUE_TAGS_INPUT, - LIST_QUEUE_TAGS_OUTPUT as _SCHEMA_LIST_QUEUE_TAGS_OUTPUT, - MESSAGE as _SCHEMA_MESSAGE, - MESSAGE_ATTRIBUTE_VALUE as _SCHEMA_MESSAGE_ATTRIBUTE_VALUE, - MESSAGE_NOT_INFLIGHT as _SCHEMA_MESSAGE_NOT_INFLIGHT, - MESSAGE_SYSTEM_ATTRIBUTE_VALUE as _SCHEMA_MESSAGE_SYSTEM_ATTRIBUTE_VALUE, - OVER_LIMIT as _SCHEMA_OVER_LIMIT, PURGE_QUEUE as _SCHEMA_PURGE_QUEUE, - PURGE_QUEUE_INPUT as _SCHEMA_PURGE_QUEUE_INPUT, - PURGE_QUEUE_IN_PROGRESS as _SCHEMA_PURGE_QUEUE_IN_PROGRESS, - PURGE_QUEUE_OUTPUT as _SCHEMA_PURGE_QUEUE_OUTPUT, - QUEUE_DELETED_RECENTLY as _SCHEMA_QUEUE_DELETED_RECENTLY, - QUEUE_DOES_NOT_EXIST as _SCHEMA_QUEUE_DOES_NOT_EXIST, - QUEUE_NAME_EXISTS as _SCHEMA_QUEUE_NAME_EXISTS, - RECEIPT_HANDLE_IS_INVALID as _SCHEMA_RECEIPT_HANDLE_IS_INVALID, RECEIVE_MESSAGE as _SCHEMA_RECEIVE_MESSAGE, - RECEIVE_MESSAGE_INPUT as _SCHEMA_RECEIVE_MESSAGE_INPUT, - RECEIVE_MESSAGE_OUTPUT as _SCHEMA_RECEIVE_MESSAGE_OUTPUT, REMOVE_PERMISSION as _SCHEMA_REMOVE_PERMISSION, - REMOVE_PERMISSION_INPUT as _SCHEMA_REMOVE_PERMISSION_INPUT, - REMOVE_PERMISSION_OUTPUT as _SCHEMA_REMOVE_PERMISSION_OUTPUT, - REQUEST_THROTTLED as _SCHEMA_REQUEST_THROTTLED, - RESOURCE_NOT_FOUND_EXCEPTION as _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, SEND_MESSAGE as _SCHEMA_SEND_MESSAGE, SEND_MESSAGE_BATCH as _SCHEMA_SEND_MESSAGE_BATCH, - SEND_MESSAGE_BATCH_INPUT as _SCHEMA_SEND_MESSAGE_BATCH_INPUT, - SEND_MESSAGE_BATCH_OUTPUT as _SCHEMA_SEND_MESSAGE_BATCH_OUTPUT, - SEND_MESSAGE_BATCH_REQUEST_ENTRY as _SCHEMA_SEND_MESSAGE_BATCH_REQUEST_ENTRY, - SEND_MESSAGE_BATCH_RESULT_ENTRY as _SCHEMA_SEND_MESSAGE_BATCH_RESULT_ENTRY, - SEND_MESSAGE_INPUT as _SCHEMA_SEND_MESSAGE_INPUT, - SEND_MESSAGE_OUTPUT as _SCHEMA_SEND_MESSAGE_OUTPUT, SET_QUEUE_ATTRIBUTES as _SCHEMA_SET_QUEUE_ATTRIBUTES, - SET_QUEUE_ATTRIBUTES_INPUT as _SCHEMA_SET_QUEUE_ATTRIBUTES_INPUT, - SET_QUEUE_ATTRIBUTES_OUTPUT as _SCHEMA_SET_QUEUE_ATTRIBUTES_OUTPUT, START_MESSAGE_MOVE_TASK as _SCHEMA_START_MESSAGE_MOVE_TASK, - START_MESSAGE_MOVE_TASK_INPUT as _SCHEMA_START_MESSAGE_MOVE_TASK_INPUT, - START_MESSAGE_MOVE_TASK_OUTPUT as _SCHEMA_START_MESSAGE_MOVE_TASK_OUTPUT, TAG_QUEUE as _SCHEMA_TAG_QUEUE, - TAG_QUEUE_INPUT as _SCHEMA_TAG_QUEUE_INPUT, - TAG_QUEUE_OUTPUT as _SCHEMA_TAG_QUEUE_OUTPUT, - TOO_MANY_ENTRIES_IN_BATCH_REQUEST as _SCHEMA_TOO_MANY_ENTRIES_IN_BATCH_REQUEST, - UNSUPPORTED_OPERATION as _SCHEMA_UNSUPPORTED_OPERATION, UNTAG_QUEUE as _SCHEMA_UNTAG_QUEUE, - UNTAG_QUEUE_INPUT as _SCHEMA_UNTAG_QUEUE_INPUT, - UNTAG_QUEUE_OUTPUT as _SCHEMA_UNTAG_QUEUE_OUTPUT, ) +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .models import ( + AddPermissionInput, + AddPermissionOutput, + CancelMessageMoveTaskInput, + CancelMessageMoveTaskOutput, + ChangeMessageVisibilityBatchInput, + ChangeMessageVisibilityBatchOutput, + ChangeMessageVisibilityInput, + ChangeMessageVisibilityOutput, + CreateQueueInput, + CreateQueueOutput, + DeleteMessageBatchInput, + DeleteMessageBatchOutput, + DeleteMessageInput, + DeleteMessageOutput, + DeleteQueueInput, + DeleteQueueOutput, + GetQueueAttributesInput, + GetQueueAttributesOutput, + GetQueueUrlInput, + GetQueueUrlOutput, + ListDeadLetterSourceQueuesInput, + ListDeadLetterSourceQueuesOutput, + ListMessageMoveTasksInput, + ListMessageMoveTasksOutput, + ListQueueTagsInput, + ListQueueTagsOutput, + ListQueuesInput, + ListQueuesOutput, + PurgeQueueInput, + PurgeQueueOutput, + ReceiveMessageInput, + ReceiveMessageOutput, + RemovePermissionInput, + RemovePermissionOutput, + SendMessageBatchInput, + SendMessageBatchOutput, + SendMessageInput, + SendMessageOutput, + SetQueueAttributesInput, + SetQueueAttributesOutput, + StartMessageMoveTaskInput, + StartMessageMoveTaskOutput, + TagQueueInput, + TagQueueOutput, + UntagQueueInput, + UntagQueueOutput, + ) -logger = logging.getLogger(__name__) - - -class ServiceError(ModeledError): - """ - Base error for all errors in the service. - - Some exceptions do not extend from this class, including - synthetic, implicit, and shared exception types. - """ - - -def _serialize_action_name_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_action_name_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_aws_account_id_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_aws_account_id_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AddPermissionInput: - """""" - - queue_url: str | None = None - """ - The URL of the Amazon SQS queue to which permissions are added. - - Queue URLs and names are case-sensitive. - """ - - label: str | None = None - """ - The unique identification of the permission you're setting (for - example, `AliceSendMessage`). Maximum 80 characters. Allowed characters - include alphanumeric characters, hyphens (`-`), and underscores (`_`). - """ - - aws_account_ids: list[str] | None = None - """ - The Amazon Web Services account numbers of the - [principals](https://docs.aws.amazon.com/general/latest/gr/glos-chap.html#P) - who are to receive permission. For information about locating the Amazon - Web Services account identification, see [Your Amazon Web Services - Identifiers](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-making-api-requests.html#sqs-api-request-authentication) - in the *Amazon SQS Developer Guide*. - """ - - actions: list[str] | None = None - """ - The action the client wants to allow for the specified principal. Valid - values: the name of any action or `*`. - - For more information about these actions, see [Overview of Managing - Access Permissions to Your Amazon Simple Queue Service - Resource](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-overview-of-managing-access.html) - in the *Amazon SQS Developer Guide*. - - Specifying `SendMessage`, `DeleteMessage`, or `ChangeMessageVisibility` - for `ActionName.n` also grants permissions for the corresponding batch - versions of those actions: `SendMessageBatch`, `DeleteMessageBatch`, and - `ChangeMessageVisibilityBatch`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ADD_PERMISSION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.queue_url is not None: - serializer.write_string( - _SCHEMA_ADD_PERMISSION_INPUT.members["QueueUrl"], self.queue_url - ) - - if self.label is not None: - serializer.write_string( - _SCHEMA_ADD_PERMISSION_INPUT.members["Label"], self.label - ) - - if self.aws_account_ids is not None: - _serialize_aws_account_id_list( - serializer, - _SCHEMA_ADD_PERMISSION_INPUT.members["AWSAccountIds"], - self.aws_account_ids, - ) - - if self.actions is not None: - _serialize_action_name_list( - serializer, - _SCHEMA_ADD_PERMISSION_INPUT.members["Actions"], - self.actions, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["queue_url"] = de.read_string( - _SCHEMA_ADD_PERMISSION_INPUT.members["QueueUrl"] - ) - - case 1: - kwargs["label"] = de.read_string( - _SCHEMA_ADD_PERMISSION_INPUT.members["Label"] - ) - - case 2: - kwargs["aws_account_ids"] = _deserialize_aws_account_id_list( - de, _SCHEMA_ADD_PERMISSION_INPUT.members["AWSAccountIds"] - ) - - case 3: - kwargs["actions"] = _deserialize_action_name_list( - de, _SCHEMA_ADD_PERMISSION_INPUT.members["Actions"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ADD_PERMISSION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class AddPermissionOutput: - """Dataclass for AddPermissionOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ADD_PERMISSION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ADD_PERMISSION_OUTPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class InvalidAddress(ServiceError): - """The specified ID is invalid.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_ADDRESS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_ADDRESS.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_ADDRESS.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INVALID_ADDRESS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class InvalidSecurity(ServiceError): - """The request was not made over HTTPS or did not use SigV4 for signing.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_SECURITY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_SECURITY.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_SECURITY.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INVALID_SECURITY, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class OverLimit(ServiceError): - """ - The specified action violates a limit. For example, `ReceiveMessage` - returns this error if the maximum number of in flight messages is - reached and `AddPermission` returns this error if the maximum number of - permissions for the queue is reached. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_OVER_LIMIT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string(_SCHEMA_OVER_LIMIT.members["message"], self.message) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_OVER_LIMIT.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_OVER_LIMIT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class QueueDoesNotExist(ServiceError): - """ - Ensure that the `QueueUrl` is correct and that the queue has not been - deleted. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_QUEUE_DOES_NOT_EXIST, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_QUEUE_DOES_NOT_EXIST.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_QUEUE_DOES_NOT_EXIST.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_QUEUE_DOES_NOT_EXIST, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class RequestThrottled(ServiceError): - """ - The request was denied due to request throttling. - - - Exceeds the permitted request rate for the queue or for the recipient - of the request. - - - Ensure that the request rate is within the Amazon SQS limits for - sending messages. For more information, see [Amazon SQS - quotas](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-quotas.html#quotas-requests) - in the *Amazon SQS Developer Guide*. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REQUEST_THROTTLED, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_REQUEST_THROTTLED.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_REQUEST_THROTTLED.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_REQUEST_THROTTLED, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UnsupportedOperation(ServiceError): - """Error code 400. Unsupported operation.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNSUPPORTED_OPERATION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_UNSUPPORTED_OPERATION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_UNSUPPORTED_OPERATION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UNSUPPORTED_OPERATION, consumer=_consumer) - return kwargs - - -ADD_PERMISSION = APIOperation( - input=AddPermissionInput, - output=AddPermissionOutput, - schema=_SCHEMA_ADD_PERMISSION, - input_schema=_SCHEMA_ADD_PERMISSION_INPUT, - output_schema=_SCHEMA_ADD_PERMISSION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.sqs#InvalidAddress"): InvalidAddress, - ShapeID("com.amazonaws.sqs#InvalidSecurity"): InvalidSecurity, - ShapeID("com.amazonaws.sqs#OverLimit"): OverLimit, - ShapeID("com.amazonaws.sqs#QueueDoesNotExist"): QueueDoesNotExist, - ShapeID("com.amazonaws.sqs#RequestThrottled"): RequestThrottled, - ShapeID("com.amazonaws.sqs#UnsupportedOperation"): UnsupportedOperation, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_ADDRESS, - _SCHEMA_INVALID_SECURITY, - _SCHEMA_OVER_LIMIT, - _SCHEMA_QUEUE_DOES_NOT_EXIST, - _SCHEMA_REQUEST_THROTTLED, - _SCHEMA_UNSUPPORTED_OPERATION, - ], -) - - -@dataclass(kw_only=True) -class CancelMessageMoveTaskInput: - """Dataclass for CancelMessageMoveTaskInput structure.""" - - task_handle: str | None = None - """An identifier associated with a message movement task.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CANCEL_MESSAGE_MOVE_TASK_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.task_handle is not None: - serializer.write_string( - _SCHEMA_CANCEL_MESSAGE_MOVE_TASK_INPUT.members["TaskHandle"], - self.task_handle, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["task_handle"] = de.read_string( - _SCHEMA_CANCEL_MESSAGE_MOVE_TASK_INPUT.members["TaskHandle"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CANCEL_MESSAGE_MOVE_TASK_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CancelMessageMoveTaskOutput: - """Dataclass for CancelMessageMoveTaskOutput structure.""" - - approximate_number_of_messages_moved: int = 0 - """ - The approximate number of messages already moved to the destination - queue. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CANCEL_MESSAGE_MOVE_TASK_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_long( - _SCHEMA_CANCEL_MESSAGE_MOVE_TASK_OUTPUT.members[ - "ApproximateNumberOfMessagesMoved" - ], - self.approximate_number_of_messages_moved, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["approximate_number_of_messages_moved"] = de.read_long( - _SCHEMA_CANCEL_MESSAGE_MOVE_TASK_OUTPUT.members[ - "ApproximateNumberOfMessagesMoved" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CANCEL_MESSAGE_MOVE_TASK_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ResourceNotFoundException(ServiceError): - """One or more specified resources don't exist.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, consumer=_consumer - ) - return kwargs - - -CANCEL_MESSAGE_MOVE_TASK = APIOperation( - input=CancelMessageMoveTaskInput, - output=CancelMessageMoveTaskOutput, - schema=_SCHEMA_CANCEL_MESSAGE_MOVE_TASK, - input_schema=_SCHEMA_CANCEL_MESSAGE_MOVE_TASK_INPUT, - output_schema=_SCHEMA_CANCEL_MESSAGE_MOVE_TASK_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.sqs#InvalidAddress"): InvalidAddress, - ShapeID("com.amazonaws.sqs#InvalidSecurity"): InvalidSecurity, - ShapeID("com.amazonaws.sqs#RequestThrottled"): RequestThrottled, - ShapeID( - "com.amazonaws.sqs#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.sqs#UnsupportedOperation"): UnsupportedOperation, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_ADDRESS, - _SCHEMA_INVALID_SECURITY, - _SCHEMA_REQUEST_THROTTLED, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION, - ], -) - - -@dataclass(kw_only=True) -class ChangeMessageVisibilityInput: - """Dataclass for ChangeMessageVisibilityInput structure.""" - - queue_url: str | None = None - """ - The URL of the Amazon SQS queue whose message's visibility is changed. - - Queue URLs and names are case-sensitive. - """ - - receipt_handle: str | None = None - """ - The receipt handle associated with the message, whose visibility timeout - is changed. This parameter is returned by the ` ``ReceiveMessage`` ` - action. - """ - - visibility_timeout: int | None = None - """ - The new value for the message's visibility timeout (in seconds). Values - range: `0` to `43200`. Maximum: 12 hours. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CHANGE_MESSAGE_VISIBILITY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.queue_url is not None: - serializer.write_string( - _SCHEMA_CHANGE_MESSAGE_VISIBILITY_INPUT.members["QueueUrl"], - self.queue_url, - ) - - if self.receipt_handle is not None: - serializer.write_string( - _SCHEMA_CHANGE_MESSAGE_VISIBILITY_INPUT.members["ReceiptHandle"], - self.receipt_handle, - ) - - if self.visibility_timeout is not None: - serializer.write_integer( - _SCHEMA_CHANGE_MESSAGE_VISIBILITY_INPUT.members["VisibilityTimeout"], - self.visibility_timeout, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["queue_url"] = de.read_string( - _SCHEMA_CHANGE_MESSAGE_VISIBILITY_INPUT.members["QueueUrl"] - ) - - case 1: - kwargs["receipt_handle"] = de.read_string( - _SCHEMA_CHANGE_MESSAGE_VISIBILITY_INPUT.members["ReceiptHandle"] - ) - - case 2: - kwargs["visibility_timeout"] = de.read_integer( - _SCHEMA_CHANGE_MESSAGE_VISIBILITY_INPUT.members[ - "VisibilityTimeout" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CHANGE_MESSAGE_VISIBILITY_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ChangeMessageVisibilityOutput: - """Dataclass for ChangeMessageVisibilityOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CHANGE_MESSAGE_VISIBILITY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CHANGE_MESSAGE_VISIBILITY_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class MessageNotInflight(ServiceError): - """The specified message isn't in flight.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MESSAGE_NOT_INFLIGHT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MESSAGE_NOT_INFLIGHT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ReceiptHandleIsInvalid(ServiceError): - """The specified receipt handle isn't valid.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RECEIPT_HANDLE_IS_INVALID, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_RECEIPT_HANDLE_IS_INVALID.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_RECEIPT_HANDLE_IS_INVALID.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RECEIPT_HANDLE_IS_INVALID, consumer=_consumer) - return kwargs - - -CHANGE_MESSAGE_VISIBILITY = APIOperation( - input=ChangeMessageVisibilityInput, - output=ChangeMessageVisibilityOutput, - schema=_SCHEMA_CHANGE_MESSAGE_VISIBILITY, - input_schema=_SCHEMA_CHANGE_MESSAGE_VISIBILITY_INPUT, - output_schema=_SCHEMA_CHANGE_MESSAGE_VISIBILITY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.sqs#InvalidAddress"): InvalidAddress, - ShapeID("com.amazonaws.sqs#InvalidSecurity"): InvalidSecurity, - ShapeID("com.amazonaws.sqs#MessageNotInflight"): MessageNotInflight, - ShapeID("com.amazonaws.sqs#QueueDoesNotExist"): QueueDoesNotExist, - ShapeID("com.amazonaws.sqs#ReceiptHandleIsInvalid"): ReceiptHandleIsInvalid, - ShapeID("com.amazonaws.sqs#RequestThrottled"): RequestThrottled, - ShapeID("com.amazonaws.sqs#UnsupportedOperation"): UnsupportedOperation, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_ADDRESS, - _SCHEMA_INVALID_SECURITY, - _SCHEMA_MESSAGE_NOT_INFLIGHT, - _SCHEMA_QUEUE_DOES_NOT_EXIST, - _SCHEMA_RECEIPT_HANDLE_IS_INVALID, - _SCHEMA_REQUEST_THROTTLED, - _SCHEMA_UNSUPPORTED_OPERATION, - ], -) - - -@dataclass(kw_only=True) -class BatchEntryIdsNotDistinct(ServiceError): - """Two or more batch entries in the request have the same `Id`.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BATCH_ENTRY_IDS_NOT_DISTINCT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_BATCH_ENTRY_IDS_NOT_DISTINCT.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_BATCH_ENTRY_IDS_NOT_DISTINCT.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_BATCH_ENTRY_IDS_NOT_DISTINCT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ChangeMessageVisibilityBatchRequestEntry: - """ - Encloses a receipt handle and an entry ID for each message in - ` ``ChangeMessageVisibilityBatch``.` - """ - - id: str - """ - An identifier for this particular receipt handle used to communicate the - result. - - Note: - The `Id`s of a batch request need to be unique within a request. - - This identifier can have up to 80 characters. The following characters - are accepted: alphanumeric characters, hyphens(-), and underscores (_). - """ - - receipt_handle: str - """A receipt handle.""" - - visibility_timeout: int | None = None - """The new value (in seconds) for the message's visibility timeout.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CHANGE_MESSAGE_VISIBILITY_BATCH_REQUEST_ENTRY, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CHANGE_MESSAGE_VISIBILITY_BATCH_REQUEST_ENTRY.members["Id"], self.id - ) - serializer.write_string( - _SCHEMA_CHANGE_MESSAGE_VISIBILITY_BATCH_REQUEST_ENTRY.members[ - "ReceiptHandle" - ], - self.receipt_handle, - ) - if self.visibility_timeout is not None: - serializer.write_integer( - _SCHEMA_CHANGE_MESSAGE_VISIBILITY_BATCH_REQUEST_ENTRY.members[ - "VisibilityTimeout" - ], - self.visibility_timeout, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_CHANGE_MESSAGE_VISIBILITY_BATCH_REQUEST_ENTRY.members[ - "Id" - ] - ) - - case 1: - kwargs["receipt_handle"] = de.read_string( - _SCHEMA_CHANGE_MESSAGE_VISIBILITY_BATCH_REQUEST_ENTRY.members[ - "ReceiptHandle" - ] - ) - - case 2: - kwargs["visibility_timeout"] = de.read_integer( - _SCHEMA_CHANGE_MESSAGE_VISIBILITY_BATCH_REQUEST_ENTRY.members[ - "VisibilityTimeout" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CHANGE_MESSAGE_VISIBILITY_BATCH_REQUEST_ENTRY, consumer=_consumer - ) - if "id" not in kwargs: - kwargs["id"] = "" - if "receipt_handle" not in kwargs: - kwargs["receipt_handle"] = "" - return kwargs - - -def _serialize_change_message_visibility_batch_request_entry_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[ChangeMessageVisibilityBatchRequestEntry], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_change_message_visibility_batch_request_entry_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ChangeMessageVisibilityBatchRequestEntry]: - result: list[ChangeMessageVisibilityBatchRequestEntry] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ChangeMessageVisibilityBatchRequestEntry.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ChangeMessageVisibilityBatchInput: - """""" - - queue_url: str | None = None - """ - The URL of the Amazon SQS queue whose messages' visibility is changed. - - Queue URLs and names are case-sensitive. - """ - - entries: list[ChangeMessageVisibilityBatchRequestEntry] | None = None - """ - Lists the receipt handles of the messages for which the visibility - timeout must be changed. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CHANGE_MESSAGE_VISIBILITY_BATCH_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.queue_url is not None: - serializer.write_string( - _SCHEMA_CHANGE_MESSAGE_VISIBILITY_BATCH_INPUT.members["QueueUrl"], - self.queue_url, - ) - - if self.entries is not None: - _serialize_change_message_visibility_batch_request_entry_list( - serializer, - _SCHEMA_CHANGE_MESSAGE_VISIBILITY_BATCH_INPUT.members["Entries"], - self.entries, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["queue_url"] = de.read_string( - _SCHEMA_CHANGE_MESSAGE_VISIBILITY_BATCH_INPUT.members[ - "QueueUrl" - ] - ) - - case 1: - kwargs["entries"] = ( - _deserialize_change_message_visibility_batch_request_entry_list( - de, - _SCHEMA_CHANGE_MESSAGE_VISIBILITY_BATCH_INPUT.members[ - "Entries" - ], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CHANGE_MESSAGE_VISIBILITY_BATCH_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class BatchResultErrorEntry: - """ - Gives a detailed description of the result of an action on each entry in - the request. - """ - - id: str - """The `Id` of an entry in a batch request.""" - - code: str - """An error code representing why the action failed on this entry.""" - - sender_fault: bool = False - """ - Specifies whether the error happened due to the caller of the batch API - action. - """ - - message: str | None = None - """A message explaining why the action failed on this entry.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BATCH_RESULT_ERROR_ENTRY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_BATCH_RESULT_ERROR_ENTRY.members["Id"], self.id) - serializer.write_boolean( - _SCHEMA_BATCH_RESULT_ERROR_ENTRY.members["SenderFault"], self.sender_fault - ) - serializer.write_string( - _SCHEMA_BATCH_RESULT_ERROR_ENTRY.members["Code"], self.code - ) - if self.message is not None: - serializer.write_string( - _SCHEMA_BATCH_RESULT_ERROR_ENTRY.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_BATCH_RESULT_ERROR_ENTRY.members["Id"] - ) - - case 1: - kwargs["sender_fault"] = de.read_boolean( - _SCHEMA_BATCH_RESULT_ERROR_ENTRY.members["SenderFault"] - ) - - case 2: - kwargs["code"] = de.read_string( - _SCHEMA_BATCH_RESULT_ERROR_ENTRY.members["Code"] - ) - - case 3: - kwargs["message"] = de.read_string( - _SCHEMA_BATCH_RESULT_ERROR_ENTRY.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BATCH_RESULT_ERROR_ENTRY, consumer=_consumer) - if "id" not in kwargs: - kwargs["id"] = "" - if "code" not in kwargs: - kwargs["code"] = "" - return kwargs - - -def _serialize_batch_result_error_entry_list( - serializer: ShapeSerializer, schema: Schema, value: list[BatchResultErrorEntry] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_batch_result_error_entry_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[BatchResultErrorEntry]: - result: list[BatchResultErrorEntry] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(BatchResultErrorEntry.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ChangeMessageVisibilityBatchResultEntry: - """Encloses the `Id` of an entry in ` ``ChangeMessageVisibilityBatch``.`""" - - id: str - """ - Represents a message whose visibility timeout has been changed - successfully. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CHANGE_MESSAGE_VISIBILITY_BATCH_RESULT_ENTRY, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CHANGE_MESSAGE_VISIBILITY_BATCH_RESULT_ENTRY.members["Id"], self.id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_CHANGE_MESSAGE_VISIBILITY_BATCH_RESULT_ENTRY.members[ - "Id" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CHANGE_MESSAGE_VISIBILITY_BATCH_RESULT_ENTRY, consumer=_consumer - ) - if "id" not in kwargs: - kwargs["id"] = "" - return kwargs - - -def _serialize_change_message_visibility_batch_result_entry_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[ChangeMessageVisibilityBatchResultEntry], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_change_message_visibility_batch_result_entry_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ChangeMessageVisibilityBatchResultEntry]: - result: list[ChangeMessageVisibilityBatchResultEntry] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ChangeMessageVisibilityBatchResultEntry.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ChangeMessageVisibilityBatchOutput: - """ - For each message in the batch, the response contains a - ` ``ChangeMessageVisibilityBatchResultEntry`` ` tag if the message - succeeds or a ` ``BatchResultErrorEntry`` ` tag if the message fails. - """ - - successful: list[ChangeMessageVisibilityBatchResultEntry] - """A list of ` ``ChangeMessageVisibilityBatchResultEntry`` ` items.""" - - failed: list[BatchResultErrorEntry] - """A list of ` ``BatchResultErrorEntry`` ` items.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CHANGE_MESSAGE_VISIBILITY_BATCH_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_change_message_visibility_batch_result_entry_list( - serializer, - _SCHEMA_CHANGE_MESSAGE_VISIBILITY_BATCH_OUTPUT.members["Successful"], - self.successful, - ) - _serialize_batch_result_error_entry_list( - serializer, - _SCHEMA_CHANGE_MESSAGE_VISIBILITY_BATCH_OUTPUT.members["Failed"], - self.failed, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["successful"] = ( - _deserialize_change_message_visibility_batch_result_entry_list( - de, - _SCHEMA_CHANGE_MESSAGE_VISIBILITY_BATCH_OUTPUT.members[ - "Successful" - ], - ) - ) - - case 1: - kwargs["failed"] = _deserialize_batch_result_error_entry_list( - de, - _SCHEMA_CHANGE_MESSAGE_VISIBILITY_BATCH_OUTPUT.members[ - "Failed" - ], - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CHANGE_MESSAGE_VISIBILITY_BATCH_OUTPUT, consumer=_consumer - ) - if "successful" not in kwargs: - kwargs["successful"] = [] - if "failed" not in kwargs: - kwargs["failed"] = [] - return kwargs - - -@dataclass(kw_only=True) -class EmptyBatchRequest(ServiceError): - """The batch request doesn't contain any entries.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EMPTY_BATCH_REQUEST, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_EMPTY_BATCH_REQUEST.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_EMPTY_BATCH_REQUEST.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EMPTY_BATCH_REQUEST, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class InvalidBatchEntryId(ServiceError): - """ - The `Id` of a batch entry in a batch request doesn't abide by the - specification. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_BATCH_ENTRY_ID, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_BATCH_ENTRY_ID.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_BATCH_ENTRY_ID.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INVALID_BATCH_ENTRY_ID, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class TooManyEntriesInBatchRequest(ServiceError): - """ - The batch request contains more entries than permissible. For Amazon - SQS, the maximum number of entries you can include in a single - [SendMessageBatch](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_SendMessageBatch.html), - [DeleteMessageBatch](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_DeleteMessageBatch.html), - or - [ChangeMessageVisibilityBatch](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ChangeMessageVisibilityBatch.html) - request is 10. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TOO_MANY_ENTRIES_IN_BATCH_REQUEST, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_TOO_MANY_ENTRIES_IN_BATCH_REQUEST.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_TOO_MANY_ENTRIES_IN_BATCH_REQUEST.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_TOO_MANY_ENTRIES_IN_BATCH_REQUEST, consumer=_consumer - ) - return kwargs - - -CHANGE_MESSAGE_VISIBILITY_BATCH = APIOperation( - input=ChangeMessageVisibilityBatchInput, - output=ChangeMessageVisibilityBatchOutput, - schema=_SCHEMA_CHANGE_MESSAGE_VISIBILITY_BATCH, - input_schema=_SCHEMA_CHANGE_MESSAGE_VISIBILITY_BATCH_INPUT, - output_schema=_SCHEMA_CHANGE_MESSAGE_VISIBILITY_BATCH_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.sqs#BatchEntryIdsNotDistinct" - ): BatchEntryIdsNotDistinct, - ShapeID("com.amazonaws.sqs#EmptyBatchRequest"): EmptyBatchRequest, - ShapeID("com.amazonaws.sqs#InvalidAddress"): InvalidAddress, - ShapeID("com.amazonaws.sqs#InvalidBatchEntryId"): InvalidBatchEntryId, - ShapeID("com.amazonaws.sqs#InvalidSecurity"): InvalidSecurity, - ShapeID("com.amazonaws.sqs#QueueDoesNotExist"): QueueDoesNotExist, - ShapeID("com.amazonaws.sqs#RequestThrottled"): RequestThrottled, - ShapeID( - "com.amazonaws.sqs#TooManyEntriesInBatchRequest" - ): TooManyEntriesInBatchRequest, - ShapeID("com.amazonaws.sqs#UnsupportedOperation"): UnsupportedOperation, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BATCH_ENTRY_IDS_NOT_DISTINCT, - _SCHEMA_EMPTY_BATCH_REQUEST, - _SCHEMA_INVALID_ADDRESS, - _SCHEMA_INVALID_BATCH_ENTRY_ID, - _SCHEMA_INVALID_SECURITY, - _SCHEMA_QUEUE_DOES_NOT_EXIST, - _SCHEMA_REQUEST_THROTTLED, - _SCHEMA_TOO_MANY_ENTRIES_IN_BATCH_REQUEST, - _SCHEMA_UNSUPPORTED_OPERATION, - ], -) - - -class QueueAttributeName(UnknownEnumMixin, StrEnum): - ALL = "All" - POLICY = "Policy" - VISIBILITY_TIMEOUT = "VisibilityTimeout" - MAXIMUM_MESSAGE_SIZE = "MaximumMessageSize" - MESSAGE_RETENTION_PERIOD = "MessageRetentionPeriod" - APPROXIMATE_NUMBER_OF_MESSAGES = "ApproximateNumberOfMessages" - APPROXIMATE_NUMBER_OF_MESSAGES_NOT_VISIBLE = "ApproximateNumberOfMessagesNotVisible" - CREATED_TIMESTAMP = "CreatedTimestamp" - LAST_MODIFIED_TIMESTAMP = "LastModifiedTimestamp" - QUEUE_ARN = "QueueArn" - APPROXIMATE_NUMBER_OF_MESSAGES_DELAYED = "ApproximateNumberOfMessagesDelayed" - DELAY_SECONDS = "DelaySeconds" - RECEIVE_MESSAGE_WAIT_TIME_SECONDS = "ReceiveMessageWaitTimeSeconds" - REDRIVE_POLICY = "RedrivePolicy" - FIFO_QUEUE = "FifoQueue" - CONTENT_BASED_DEDUPLICATION = "ContentBasedDeduplication" - KMS_MASTER_KEY_ID = "KmsMasterKeyId" - KMS_DATA_KEY_REUSE_PERIOD_SECONDS = "KmsDataKeyReusePeriodSeconds" - DEDUPLICATION_SCOPE = "DeduplicationScope" - FIFO_THROUGHPUT_LIMIT = "FifoThroughputLimit" - REDRIVE_ALLOW_POLICY = "RedriveAllowPolicy" - SQS_MANAGED_SSE_ENABLED = "SqsManagedSseEnabled" - - -def _serialize_queue_attribute_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_queue_attribute_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -def _serialize_tag_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_tag_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CreateQueueInput: - """""" - - queue_name: str | None = None - """ - The name of the new queue. The following limits apply to this name: - - - A queue name can have up to 80 characters. - - - Valid values: alphanumeric characters, hyphens (`-`), and underscores - (`_`). - - - A FIFO queue name must end with the `.fifo` suffix. - - Queue URLs and names are case-sensitive. - """ - - attributes: dict[str, str] | None = None - """ - A map of attributes with their corresponding values. - - The following lists the names, descriptions, and values of the special - request parameters that the `CreateQueue` action uses: - - - `DelaySeconds` -- The length of time, in seconds, for which the - delivery of all messages in the queue is delayed. Valid values: An - integer from 0 to 900 seconds (15 minutes). Default: 0. - - - `MaximumMessageSize` -- The limit of how many bytes a message can - contain before Amazon SQS rejects it. Valid values: An integer from - 1,024 bytes (1 KiB) to 1,048,576 bytes (1 MiB). Default: 1,048,576 - bytes (1 MiB). - - - `MessageRetentionPeriod` -- The length of time, in seconds, for which - Amazon SQS retains a message. Valid values: An integer from 60 seconds - (1 minute) to 1,209,600 seconds (14 days). Default: 345,600 (4 days). - When you change a queue's attributes, the change can take up to 60 - seconds for most of the attributes to propagate throughout the Amazon - SQS system. Changes made to the `MessageRetentionPeriod` attribute can - take up to 15 minutes and will impact existing messages in the queue - potentially causing them to be expired and deleted if the - `MessageRetentionPeriod` is reduced below the age of existing - messages. - - - `Policy` -- The queue's policy. A valid Amazon Web Services policy. - For more information about policy structure, see [Overview of Amazon - Web Services IAM - Policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/PoliciesOverview.html) - in the *IAM User Guide*. - - - `ReceiveMessageWaitTimeSeconds` -- The length of time, in seconds, for - which a ` ``ReceiveMessage`` ` action waits for a message to arrive. - Valid values: An integer from 0 to 20 (seconds). Default: 0. - - - `VisibilityTimeout` -- The visibility timeout for the queue, in - seconds. Valid values: An integer from 0 to 43,200 (12 hours). - Default: 30. For more information about the visibility timeout, see - [Visibility - Timeout](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html) - in the *Amazon SQS Developer Guide*. - - The following attributes apply only to [dead-letter - queues:](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html) - - - `RedrivePolicy` -- The string that includes the parameters for the - dead-letter queue functionality of the source queue as a JSON object. - The parameters are as follows: - - - `deadLetterTargetArn` -- The Amazon Resource Name (ARN) of the - dead-letter queue to which Amazon SQS moves messages after the value - of `maxReceiveCount` is exceeded. - - - `maxReceiveCount` -- The number of times a message is delivered to - the source queue before being moved to the dead-letter queue. - Default: 10. When the `ReceiveCount` for a message exceeds the - `maxReceiveCount` for a queue, Amazon SQS moves the message to the - dead-letter-queue. - - - `RedriveAllowPolicy` -- The string that includes the parameters for - the permissions for the dead-letter queue redrive permission and which - source queues can specify dead-letter queues as a JSON object. The - parameters are as follows: - - - `redrivePermission` -- The permission type that defines which source - queues can specify the current queue as the dead-letter queue. Valid - values are: - - - `allowAll` -- (Default) Any source queues in this Amazon Web - Services account in the same Region can specify this queue as the - dead-letter queue. - - - `denyAll` -- No source queues can specify this queue as the - dead-letter queue. - - - `byQueue` -- Only queues specified by the `sourceQueueArns` - parameter can specify this queue as the dead-letter queue. - - - `sourceQueueArns` -- The Amazon Resource Names (ARN)s of the source - queues that can specify this queue as the dead-letter queue and - redrive messages. You can specify this parameter only when the - `redrivePermission` parameter is set to `byQueue`. You can specify - up to 10 source queue ARNs. To allow more than 10 source queues to - specify dead-letter queues, set the `redrivePermission` parameter to - `allowAll`. - - Note: - The dead-letter queue of a FIFO queue must also be a FIFO queue. - Similarly, the dead-letter queue of a standard queue must also be a - standard queue. - - The following attributes apply only to - [server-side-encryption](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html): - - - `KmsMasterKeyId` -- The ID of an Amazon Web Services managed customer - master key (CMK) for Amazon SQS or a custom CMK. For more information, - see [Key - Terms](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-sse-key-terms). - While the alias of the Amazon Web Services managed CMK for Amazon SQS - is always `alias/aws/sqs`, the alias of a custom CMK can, for example, - be `alias/`*`MyAlias`*` `. For more examples, see - [KeyId](https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters) - in the *Key Management Service API Reference*. - - - `KmsDataKeyReusePeriodSeconds` -- The length of time, in seconds, for - which Amazon SQS can reuse a [data - key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#data-keys) - to encrypt or decrypt messages before calling KMS again. An integer - representing seconds, between 60 seconds (1 minute) and 86,400 seconds - (24 hours). Default: 300 (5 minutes). A shorter time period provides - better security but results in more calls to KMS which might incur - charges after Free Tier. For more information, see [How Does the Data - Key Reuse Period - Work?](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-how-does-the-data-key-reuse-period-work) - - - `SqsManagedSseEnabled` -- Enables server-side queue encryption using - SQS owned encryption keys. Only one server-side encryption option is - supported per queue (for example, - [SSE-KMS](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sse-existing-queue.html) - or - [SSE-SQS](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sqs-sse-queue.html)). - - The following attributes apply only to [FIFO (first-in-first-out) - queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html): - - - `FifoQueue` -- Designates a queue as FIFO. Valid values are `true` and - `false`. If you don't specify the `FifoQueue` attribute, Amazon SQS - creates a standard queue. You can provide this attribute only during - queue creation. You can't change it for an existing queue. When you - set this attribute, you must also provide the `MessageGroupId` for - your messages explicitly. - - For more information, see [FIFO queue - logic](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues-understanding-logic.html) - in the *Amazon SQS Developer Guide*. - - - `ContentBasedDeduplication` -- Enables content-based deduplication. - Valid values are `true` and `false`. For more information, see - [Exactly-once - processing](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues-exactly-once-processing.html) - in the *Amazon SQS Developer Guide*. Note the following: - - - Every message must have a unique `MessageDeduplicationId`. - - - You may provide a `MessageDeduplicationId` explicitly. - - - If you aren't able to provide a `MessageDeduplicationId` and you - enable `ContentBasedDeduplication` for your queue, Amazon SQS uses - a SHA-256 hash to generate the `MessageDeduplicationId` using the - body of the message (but not the attributes of the message). - - - If you don't provide a `MessageDeduplicationId` and the queue - doesn't have `ContentBasedDeduplication` set, the action fails - with an error. - - - If the queue has `ContentBasedDeduplication` set, your - `MessageDeduplicationId` overrides the generated one. - - - When `ContentBasedDeduplication` is in effect, messages with - identical content sent within the deduplication interval are treated - as duplicates and only one copy of the message is delivered. - - - If you send one message with `ContentBasedDeduplication` enabled and - then another message with a `MessageDeduplicationId` that is the - same as the one generated for the first `MessageDeduplicationId`, - the two messages are treated as duplicates and only one copy of the - message is delivered. - - The following attributes apply only to [high throughput for FIFO - queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/high-throughput-fifo.html): - - - `DeduplicationScope` -- Specifies whether message deduplication occurs - at the message group or queue level. Valid values are `messageGroup` - and `queue`. - - - `FifoThroughputLimit` -- Specifies whether the FIFO queue throughput - quota applies to the entire queue or per message group. Valid values - are `perQueue` and `perMessageGroupId`. The `perMessageGroupId` value - is allowed only when the value for `DeduplicationScope` is - `messageGroup`. - - To enable high throughput for FIFO queues, do the following: - - - Set `DeduplicationScope` to `messageGroup`. - - - Set `FifoThroughputLimit` to `perMessageGroupId`. - - If you set these attributes to anything other than the values shown for - enabling high throughput, normal throughput is in effect and - deduplication occurs as specified. - - For information on throughput quotas, see [Quotas related to - messages](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/quotas-messages.html) - in the *Amazon SQS Developer Guide*. - """ - - tags: dict[str, str] | None = None - """ - Add cost allocation tags to the specified Amazon SQS queue. For an - overview, see [Tagging Your Amazon SQS - Queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-queue-tags.html) - in the *Amazon SQS Developer Guide*. - - When you use queue tags, keep the following guidelines in mind: - - - Adding more than 50 tags to a queue isn't recommended. - - - Tags don't have any semantic meaning. Amazon SQS interprets tags as - character strings. - - - Tags are case-sensitive. - - - A new tag with a key identical to that of an existing tag overwrites - the existing tag. - - For a full list of tag restrictions, see [Quotas related to - queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-limits.html#limits-queues) - in the *Amazon SQS Developer Guide*. - - Note: - To be able to tag a queue on creation, you must have the - `sqs:CreateQueue` and `sqs:TagQueue` permissions. - - Cross-account permissions don't apply to this action. For more - information, see [Grant cross-account permissions to a role and a - username](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name) - in the *Amazon SQS Developer Guide*. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_QUEUE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.queue_name is not None: - serializer.write_string( - _SCHEMA_CREATE_QUEUE_INPUT.members["QueueName"], self.queue_name - ) - - if self.attributes is not None: - _serialize_queue_attribute_map( - serializer, - _SCHEMA_CREATE_QUEUE_INPUT.members["Attributes"], - self.attributes, - ) - - if self.tags is not None: - _serialize_tag_map( - serializer, _SCHEMA_CREATE_QUEUE_INPUT.members["tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["queue_name"] = de.read_string( - _SCHEMA_CREATE_QUEUE_INPUT.members["QueueName"] - ) - - case 1: - kwargs["attributes"] = _deserialize_queue_attribute_map( - de, _SCHEMA_CREATE_QUEUE_INPUT.members["Attributes"] - ) - - case 2: - kwargs["tags"] = _deserialize_tag_map( - de, _SCHEMA_CREATE_QUEUE_INPUT.members["tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_QUEUE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CreateQueueOutput: - """Returns the `QueueUrl` attribute of the created queue.""" - - queue_url: str | None = None - """The URL of the created Amazon SQS queue.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREATE_QUEUE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.queue_url is not None: - serializer.write_string( - _SCHEMA_CREATE_QUEUE_OUTPUT.members["QueueUrl"], self.queue_url - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["queue_url"] = de.read_string( - _SCHEMA_CREATE_QUEUE_OUTPUT.members["QueueUrl"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREATE_QUEUE_OUTPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class InvalidAttributeName(ServiceError): - """The specified attribute doesn't exist.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_ATTRIBUTE_NAME, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_ATTRIBUTE_NAME.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_ATTRIBUTE_NAME.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INVALID_ATTRIBUTE_NAME, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class InvalidAttributeValue(ServiceError): - """A queue attribute value is invalid.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_ATTRIBUTE_VALUE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_ATTRIBUTE_VALUE.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_ATTRIBUTE_VALUE.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INVALID_ATTRIBUTE_VALUE, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class QueueDeletedRecently(ServiceError): - """ - You must wait 60 seconds after deleting a queue before you can create - another queue with the same name. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_QUEUE_DELETED_RECENTLY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_QUEUE_DELETED_RECENTLY.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_QUEUE_DELETED_RECENTLY.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_QUEUE_DELETED_RECENTLY, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class QueueNameExists(ServiceError): - """ - A queue with this name already exists. Amazon SQS returns this error - only if the request includes attributes whose values differ from those - of the existing queue. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_QUEUE_NAME_EXISTS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_QUEUE_NAME_EXISTS.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_QUEUE_NAME_EXISTS.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_QUEUE_NAME_EXISTS, consumer=_consumer) - return kwargs - - -CREATE_QUEUE = APIOperation( - input=CreateQueueInput, - output=CreateQueueOutput, - schema=_SCHEMA_CREATE_QUEUE, - input_schema=_SCHEMA_CREATE_QUEUE_INPUT, - output_schema=_SCHEMA_CREATE_QUEUE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.sqs#InvalidAddress"): InvalidAddress, - ShapeID("com.amazonaws.sqs#InvalidAttributeName"): InvalidAttributeName, - ShapeID("com.amazonaws.sqs#InvalidAttributeValue"): InvalidAttributeValue, - ShapeID("com.amazonaws.sqs#InvalidSecurity"): InvalidSecurity, - ShapeID("com.amazonaws.sqs#QueueDeletedRecently"): QueueDeletedRecently, - ShapeID("com.amazonaws.sqs#QueueNameExists"): QueueNameExists, - ShapeID("com.amazonaws.sqs#RequestThrottled"): RequestThrottled, - ShapeID("com.amazonaws.sqs#UnsupportedOperation"): UnsupportedOperation, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_ADDRESS, - _SCHEMA_INVALID_ATTRIBUTE_NAME, - _SCHEMA_INVALID_ATTRIBUTE_VALUE, - _SCHEMA_INVALID_SECURITY, - _SCHEMA_QUEUE_DELETED_RECENTLY, - _SCHEMA_QUEUE_NAME_EXISTS, - _SCHEMA_REQUEST_THROTTLED, - _SCHEMA_UNSUPPORTED_OPERATION, - ], -) - - -@dataclass(kw_only=True) -class DeleteMessageInput: - """""" - - queue_url: str | None = None - """ - The URL of the Amazon SQS queue from which messages are deleted. - - Queue URLs and names are case-sensitive. - """ - - receipt_handle: str | None = None - """The receipt handle associated with the message to delete.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_MESSAGE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.queue_url is not None: - serializer.write_string( - _SCHEMA_DELETE_MESSAGE_INPUT.members["QueueUrl"], self.queue_url - ) - - if self.receipt_handle is not None: - serializer.write_string( - _SCHEMA_DELETE_MESSAGE_INPUT.members["ReceiptHandle"], - self.receipt_handle, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["queue_url"] = de.read_string( - _SCHEMA_DELETE_MESSAGE_INPUT.members["QueueUrl"] - ) - - case 1: - kwargs["receipt_handle"] = de.read_string( - _SCHEMA_DELETE_MESSAGE_INPUT.members["ReceiptHandle"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_MESSAGE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteMessageOutput: - """Dataclass for DeleteMessageOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_MESSAGE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_MESSAGE_OUTPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class InvalidIdFormat(ServiceError): - """The specified receipt handle isn't valid for the current version.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_ID_FORMAT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INVALID_ID_FORMAT, consumer=_consumer) - return kwargs - - -DELETE_MESSAGE = APIOperation( - input=DeleteMessageInput, - output=DeleteMessageOutput, - schema=_SCHEMA_DELETE_MESSAGE, - input_schema=_SCHEMA_DELETE_MESSAGE_INPUT, - output_schema=_SCHEMA_DELETE_MESSAGE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.sqs#InvalidAddress"): InvalidAddress, - ShapeID("com.amazonaws.sqs#InvalidIdFormat"): InvalidIdFormat, - ShapeID("com.amazonaws.sqs#InvalidSecurity"): InvalidSecurity, - ShapeID("com.amazonaws.sqs#QueueDoesNotExist"): QueueDoesNotExist, - ShapeID("com.amazonaws.sqs#ReceiptHandleIsInvalid"): ReceiptHandleIsInvalid, - ShapeID("com.amazonaws.sqs#RequestThrottled"): RequestThrottled, - ShapeID("com.amazonaws.sqs#UnsupportedOperation"): UnsupportedOperation, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_ADDRESS, - _SCHEMA_INVALID_ID_FORMAT, - _SCHEMA_INVALID_SECURITY, - _SCHEMA_QUEUE_DOES_NOT_EXIST, - _SCHEMA_RECEIPT_HANDLE_IS_INVALID, - _SCHEMA_REQUEST_THROTTLED, - _SCHEMA_UNSUPPORTED_OPERATION, - ], -) - - -@dataclass(kw_only=True) -class DeleteMessageBatchRequestEntry: - """Encloses a receipt handle and an identifier for it.""" - - id: str - """ - The identifier for this particular receipt handle. This is used to - communicate the result. - - Note: - The `Id`s of a batch request need to be unique within a request. - - This identifier can have up to 80 characters. The following characters - are accepted: alphanumeric characters, hyphens(-), and underscores (_). - """ - - receipt_handle: str - """A receipt handle.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_MESSAGE_BATCH_REQUEST_ENTRY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DELETE_MESSAGE_BATCH_REQUEST_ENTRY.members["Id"], self.id - ) - serializer.write_string( - _SCHEMA_DELETE_MESSAGE_BATCH_REQUEST_ENTRY.members["ReceiptHandle"], - self.receipt_handle, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_DELETE_MESSAGE_BATCH_REQUEST_ENTRY.members["Id"] - ) - - case 1: - kwargs["receipt_handle"] = de.read_string( - _SCHEMA_DELETE_MESSAGE_BATCH_REQUEST_ENTRY.members[ - "ReceiptHandle" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_MESSAGE_BATCH_REQUEST_ENTRY, consumer=_consumer - ) - if "id" not in kwargs: - kwargs["id"] = "" - if "receipt_handle" not in kwargs: - kwargs["receipt_handle"] = "" - return kwargs - - -def _serialize_delete_message_batch_request_entry_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[DeleteMessageBatchRequestEntry], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_delete_message_batch_request_entry_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[DeleteMessageBatchRequestEntry]: - result: list[DeleteMessageBatchRequestEntry] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(DeleteMessageBatchRequestEntry.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class DeleteMessageBatchInput: - """""" - - queue_url: str | None = None - """ - The URL of the Amazon SQS queue from which messages are deleted. - - Queue URLs and names are case-sensitive. - """ - - entries: list[DeleteMessageBatchRequestEntry] | None = None - """Lists the receipt handles for the messages to be deleted.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_MESSAGE_BATCH_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.queue_url is not None: - serializer.write_string( - _SCHEMA_DELETE_MESSAGE_BATCH_INPUT.members["QueueUrl"], self.queue_url - ) - - if self.entries is not None: - _serialize_delete_message_batch_request_entry_list( - serializer, - _SCHEMA_DELETE_MESSAGE_BATCH_INPUT.members["Entries"], - self.entries, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["queue_url"] = de.read_string( - _SCHEMA_DELETE_MESSAGE_BATCH_INPUT.members["QueueUrl"] - ) - - case 1: - kwargs["entries"] = ( - _deserialize_delete_message_batch_request_entry_list( - de, _SCHEMA_DELETE_MESSAGE_BATCH_INPUT.members["Entries"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_MESSAGE_BATCH_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteMessageBatchResultEntry: - """Encloses the `Id` of an entry in ` ``DeleteMessageBatch``.`""" - - id: str - """Represents a successfully deleted message.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_MESSAGE_BATCH_RESULT_ENTRY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_DELETE_MESSAGE_BATCH_RESULT_ENTRY.members["Id"], self.id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_DELETE_MESSAGE_BATCH_RESULT_ENTRY.members["Id"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_MESSAGE_BATCH_RESULT_ENTRY, consumer=_consumer - ) - if "id" not in kwargs: - kwargs["id"] = "" - return kwargs - - -def _serialize_delete_message_batch_result_entry_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[DeleteMessageBatchResultEntry], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_delete_message_batch_result_entry_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[DeleteMessageBatchResultEntry]: - result: list[DeleteMessageBatchResultEntry] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(DeleteMessageBatchResultEntry.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class DeleteMessageBatchOutput: - """ - For each message in the batch, the response contains a - ` ``DeleteMessageBatchResultEntry`` ` tag if the message is deleted or a - ` ``BatchResultErrorEntry`` ` tag if the message can't be deleted. - """ - - successful: list[DeleteMessageBatchResultEntry] - """A list of ` ``DeleteMessageBatchResultEntry`` ` items.""" - - failed: list[BatchResultErrorEntry] - """A list of ` ``BatchResultErrorEntry`` ` items.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_MESSAGE_BATCH_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_delete_message_batch_result_entry_list( - serializer, - _SCHEMA_DELETE_MESSAGE_BATCH_OUTPUT.members["Successful"], - self.successful, - ) - _serialize_batch_result_error_entry_list( - serializer, - _SCHEMA_DELETE_MESSAGE_BATCH_OUTPUT.members["Failed"], - self.failed, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["successful"] = ( - _deserialize_delete_message_batch_result_entry_list( - de, - _SCHEMA_DELETE_MESSAGE_BATCH_OUTPUT.members["Successful"], - ) - ) - - case 1: - kwargs["failed"] = _deserialize_batch_result_error_entry_list( - de, _SCHEMA_DELETE_MESSAGE_BATCH_OUTPUT.members["Failed"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DELETE_MESSAGE_BATCH_OUTPUT, consumer=_consumer - ) - if "successful" not in kwargs: - kwargs["successful"] = [] - if "failed" not in kwargs: - kwargs["failed"] = [] - return kwargs - - -DELETE_MESSAGE_BATCH = APIOperation( - input=DeleteMessageBatchInput, - output=DeleteMessageBatchOutput, - schema=_SCHEMA_DELETE_MESSAGE_BATCH, - input_schema=_SCHEMA_DELETE_MESSAGE_BATCH_INPUT, - output_schema=_SCHEMA_DELETE_MESSAGE_BATCH_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.sqs#BatchEntryIdsNotDistinct" - ): BatchEntryIdsNotDistinct, - ShapeID("com.amazonaws.sqs#EmptyBatchRequest"): EmptyBatchRequest, - ShapeID("com.amazonaws.sqs#InvalidAddress"): InvalidAddress, - ShapeID("com.amazonaws.sqs#InvalidBatchEntryId"): InvalidBatchEntryId, - ShapeID("com.amazonaws.sqs#InvalidSecurity"): InvalidSecurity, - ShapeID("com.amazonaws.sqs#QueueDoesNotExist"): QueueDoesNotExist, - ShapeID("com.amazonaws.sqs#RequestThrottled"): RequestThrottled, - ShapeID( - "com.amazonaws.sqs#TooManyEntriesInBatchRequest" - ): TooManyEntriesInBatchRequest, - ShapeID("com.amazonaws.sqs#UnsupportedOperation"): UnsupportedOperation, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BATCH_ENTRY_IDS_NOT_DISTINCT, - _SCHEMA_EMPTY_BATCH_REQUEST, - _SCHEMA_INVALID_ADDRESS, - _SCHEMA_INVALID_BATCH_ENTRY_ID, - _SCHEMA_INVALID_SECURITY, - _SCHEMA_QUEUE_DOES_NOT_EXIST, - _SCHEMA_REQUEST_THROTTLED, - _SCHEMA_TOO_MANY_ENTRIES_IN_BATCH_REQUEST, - _SCHEMA_UNSUPPORTED_OPERATION, - ], -) - - -@dataclass(kw_only=True) -class DeleteQueueInput: - """""" - - queue_url: str | None = None - """ - The URL of the Amazon SQS queue to delete. - - Queue URLs and names are case-sensitive. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_QUEUE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.queue_url is not None: - serializer.write_string( - _SCHEMA_DELETE_QUEUE_INPUT.members["QueueUrl"], self.queue_url - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["queue_url"] = de.read_string( - _SCHEMA_DELETE_QUEUE_INPUT.members["QueueUrl"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_QUEUE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class DeleteQueueOutput: - """Dataclass for DeleteQueueOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DELETE_QUEUE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_DELETE_QUEUE_OUTPUT, consumer=_consumer) - return kwargs - - -DELETE_QUEUE = APIOperation( - input=DeleteQueueInput, - output=DeleteQueueOutput, - schema=_SCHEMA_DELETE_QUEUE, - input_schema=_SCHEMA_DELETE_QUEUE_INPUT, - output_schema=_SCHEMA_DELETE_QUEUE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.sqs#InvalidAddress"): InvalidAddress, - ShapeID("com.amazonaws.sqs#InvalidSecurity"): InvalidSecurity, - ShapeID("com.amazonaws.sqs#QueueDoesNotExist"): QueueDoesNotExist, - ShapeID("com.amazonaws.sqs#RequestThrottled"): RequestThrottled, - ShapeID("com.amazonaws.sqs#UnsupportedOperation"): UnsupportedOperation, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_ADDRESS, - _SCHEMA_INVALID_SECURITY, - _SCHEMA_QUEUE_DOES_NOT_EXIST, - _SCHEMA_REQUEST_THROTTLED, - _SCHEMA_UNSUPPORTED_OPERATION, - ], -) - - -def _serialize_attribute_name_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_attribute_name_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(QueueAttributeName(d.read_string(member_schema))) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GetQueueAttributesInput: - """""" - - queue_url: str | None = None - """ - The URL of the Amazon SQS queue whose attribute information is - retrieved. - - Queue URLs and names are case-sensitive. - """ - - attribute_names: list[str] | None = None - """ - A list of attributes for which to retrieve information. - - The `AttributeNames` parameter is optional, but if you don't specify - values for this parameter, the request returns empty results. - - Note: - In the future, new attributes might be added. If you write code that - calls this action, we recommend that you structure your code so that it - can handle new attributes gracefully. - - The following attributes are supported: - - Warning: - The `ApproximateNumberOfMessagesDelayed`, - `ApproximateNumberOfMessagesNotVisible`, and - `ApproximateNumberOfMessages` metrics may not achieve consistency until - at least 1 minute after the producers stop sending messages. This period - is required for the queue metadata to reach eventual consistency. - - - `All` -- Returns all values. - - - `ApproximateNumberOfMessages` -- Returns the approximate number of - messages available for retrieval from the queue. - - - `ApproximateNumberOfMessagesDelayed` -- Returns the approximate number - of messages in the queue that are delayed and not available for - reading immediately. This can happen when the queue is configured as a - delay queue or when a message has been sent with a delay parameter. - - - `ApproximateNumberOfMessagesNotVisible` -- Returns the approximate - number of messages that are in flight. Messages are considered to be - *in flight* if they have been sent to a client but have not yet been - deleted or have not yet reached the end of their visibility window. - - - `CreatedTimestamp` -- Returns the time when the queue was created in - seconds ([epoch time](http://en.wikipedia.org/wiki/Unix_time)). - - - `DelaySeconds` -- Returns the default delay on the queue in seconds. - - - `LastModifiedTimestamp` -- Returns the time when the queue was last - changed in seconds ([epoch - time](http://en.wikipedia.org/wiki/Unix_time)). - - - `MaximumMessageSize` -- Returns the limit of how many bytes a message - can contain before Amazon SQS rejects it. - - - `MessageRetentionPeriod` -- Returns the length of time, in seconds, - for which Amazon SQS retains a message. When you change a queue's - attributes, the change can take up to 60 seconds for most of the - attributes to propagate throughout the Amazon SQS system. Changes made - to the `MessageRetentionPeriod` attribute can take up to 15 minutes - and will impact existing messages in the queue potentially causing - them to be expired and deleted if the `MessageRetentionPeriod` is - reduced below the age of existing messages. - - - `Policy` -- Returns the policy of the queue. - - - `QueueArn` -- Returns the Amazon resource name (ARN) of the queue. - - - `ReceiveMessageWaitTimeSeconds` -- Returns the length of time, in - seconds, for which the `ReceiveMessage` action waits for a message to - arrive. - - - `VisibilityTimeout` -- Returns the visibility timeout for the queue. - For more information about the visibility timeout, see [Visibility - Timeout](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html) - in the *Amazon SQS Developer Guide*. - - The following attributes apply only to [dead-letter - queues:](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html) - - - `RedrivePolicy` -- The string that includes the parameters for the - dead-letter queue functionality of the source queue as a JSON object. - The parameters are as follows: - - - `deadLetterTargetArn` -- The Amazon Resource Name (ARN) of the - dead-letter queue to which Amazon SQS moves messages after the value - of `maxReceiveCount` is exceeded. - - - `maxReceiveCount` -- The number of times a message is delivered to - the source queue before being moved to the dead-letter queue. - Default: 10. When the `ReceiveCount` for a message exceeds the - `maxReceiveCount` for a queue, Amazon SQS moves the message to the - dead-letter-queue. - - - `RedriveAllowPolicy` -- The string that includes the parameters for - the permissions for the dead-letter queue redrive permission and which - source queues can specify dead-letter queues as a JSON object. The - parameters are as follows: - - - `redrivePermission` -- The permission type that defines which source - queues can specify the current queue as the dead-letter queue. Valid - values are: - - - `allowAll` -- (Default) Any source queues in this Amazon Web - Services account in the same Region can specify this queue as the - dead-letter queue. - - - `denyAll` -- No source queues can specify this queue as the - dead-letter queue. - - - `byQueue` -- Only queues specified by the `sourceQueueArns` - parameter can specify this queue as the dead-letter queue. - - - `sourceQueueArns` -- The Amazon Resource Names (ARN)s of the source - queues that can specify this queue as the dead-letter queue and - redrive messages. You can specify this parameter only when the - `redrivePermission` parameter is set to `byQueue`. You can specify - up to 10 source queue ARNs. To allow more than 10 source queues to - specify dead-letter queues, set the `redrivePermission` parameter to - `allowAll`. - - Note: - The dead-letter queue of a FIFO queue must also be a FIFO queue. - Similarly, the dead-letter queue of a standard queue must also be a - standard queue. - - The following attributes apply only to - [server-side-encryption](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html): - - - `KmsMasterKeyId` -- Returns the ID of an Amazon Web Services managed - customer master key (CMK) for Amazon SQS or a custom CMK. For more - information, see [Key - Terms](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-sse-key-terms). - - - `KmsDataKeyReusePeriodSeconds` -- Returns the length of time, in - seconds, for which Amazon SQS can reuse a data key to encrypt or - decrypt messages before calling KMS again. For more information, see - [How Does the Data Key Reuse Period - Work?](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-how-does-the-data-key-reuse-period-work). - - - `SqsManagedSseEnabled` -- Returns information about whether the queue - is using SSE-SQS encryption using SQS owned encryption keys. Only one - server-side encryption option is supported per queue (for example, - [SSE-KMS](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sse-existing-queue.html) - or - [SSE-SQS](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sqs-sse-queue.html)). - - The following attributes apply only to [FIFO (first-in-first-out) - queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html): - - - `FifoQueue` -- Returns information about whether the queue is FIFO. - For more information, see [FIFO queue - logic](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues-understanding-logic.html) - in the *Amazon SQS Developer Guide*. - - Note: - To determine whether a queue is - [FIFO](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html), - you can check whether `QueueName` ends with the `.fifo` suffix. - - - `ContentBasedDeduplication` -- Returns whether content-based - deduplication is enabled for the queue. For more information, see - [Exactly-once - processing](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues-exactly-once-processing.html) - in the *Amazon SQS Developer Guide*. - - The following attributes apply only to [high throughput for FIFO - queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/high-throughput-fifo.html): - - - `DeduplicationScope` -- Specifies whether message deduplication occurs - at the message group or queue level. Valid values are `messageGroup` - and `queue`. - - - `FifoThroughputLimit` -- Specifies whether the FIFO queue throughput - quota applies to the entire queue or per message group. Valid values - are `perQueue` and `perMessageGroupId`. The `perMessageGroupId` value - is allowed only when the value for `DeduplicationScope` is - `messageGroup`. - - To enable high throughput for FIFO queues, do the following: - - - Set `DeduplicationScope` to `messageGroup`. - - - Set `FifoThroughputLimit` to `perMessageGroupId`. - - If you set these attributes to anything other than the values shown for - enabling high throughput, normal throughput is in effect and - deduplication occurs as specified. - - For information on throughput quotas, see [Quotas related to - messages](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/quotas-messages.html) - in the *Amazon SQS Developer Guide*. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_QUEUE_ATTRIBUTES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.queue_url is not None: - serializer.write_string( - _SCHEMA_GET_QUEUE_ATTRIBUTES_INPUT.members["QueueUrl"], self.queue_url - ) - - if self.attribute_names is not None: - _serialize_attribute_name_list( - serializer, - _SCHEMA_GET_QUEUE_ATTRIBUTES_INPUT.members["AttributeNames"], - self.attribute_names, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["queue_url"] = de.read_string( - _SCHEMA_GET_QUEUE_ATTRIBUTES_INPUT.members["QueueUrl"] - ) - - case 1: - kwargs["attribute_names"] = _deserialize_attribute_name_list( - de, _SCHEMA_GET_QUEUE_ATTRIBUTES_INPUT.members["AttributeNames"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_QUEUE_ATTRIBUTES_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetQueueAttributesOutput: - """A list of returned queue attributes.""" - - attributes: dict[str, str] | None = None - """A map of attributes to their respective values.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_QUEUE_ATTRIBUTES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.attributes is not None: - _serialize_queue_attribute_map( - serializer, - _SCHEMA_GET_QUEUE_ATTRIBUTES_OUTPUT.members["Attributes"], - self.attributes, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["attributes"] = _deserialize_queue_attribute_map( - de, _SCHEMA_GET_QUEUE_ATTRIBUTES_OUTPUT.members["Attributes"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_QUEUE_ATTRIBUTES_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_QUEUE_ATTRIBUTES = APIOperation( - input=GetQueueAttributesInput, - output=GetQueueAttributesOutput, - schema=_SCHEMA_GET_QUEUE_ATTRIBUTES, - input_schema=_SCHEMA_GET_QUEUE_ATTRIBUTES_INPUT, - output_schema=_SCHEMA_GET_QUEUE_ATTRIBUTES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.sqs#InvalidAddress"): InvalidAddress, - ShapeID("com.amazonaws.sqs#InvalidAttributeName"): InvalidAttributeName, - ShapeID("com.amazonaws.sqs#InvalidSecurity"): InvalidSecurity, - ShapeID("com.amazonaws.sqs#QueueDoesNotExist"): QueueDoesNotExist, - ShapeID("com.amazonaws.sqs#RequestThrottled"): RequestThrottled, - ShapeID("com.amazonaws.sqs#UnsupportedOperation"): UnsupportedOperation, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_ADDRESS, - _SCHEMA_INVALID_ATTRIBUTE_NAME, - _SCHEMA_INVALID_SECURITY, - _SCHEMA_QUEUE_DOES_NOT_EXIST, - _SCHEMA_REQUEST_THROTTLED, - _SCHEMA_UNSUPPORTED_OPERATION, - ], -) - - -@dataclass(kw_only=True) -class GetQueueUrlInput: - """ - Retrieves the URL of an existing queue based on its name and, - optionally, the Amazon Web Services account ID. - """ - - queue_name: str | None = None - """ - (Required) The name of the queue for which you want to fetch the URL. - The name can be up to 80 characters long and can include alphanumeric - characters, hyphens (-), and underscores (_). Queue URLs and names are - case-sensitive. - """ - - queue_owner_aws_account_id: str | None = None - """ - (Optional) The Amazon Web Services account ID of the account that - created the queue. This is only required when you are attempting to - access a queue owned by another Amazon Web Services account. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_QUEUE_URL_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.queue_name is not None: - serializer.write_string( - _SCHEMA_GET_QUEUE_URL_INPUT.members["QueueName"], self.queue_name - ) - - if self.queue_owner_aws_account_id is not None: - serializer.write_string( - _SCHEMA_GET_QUEUE_URL_INPUT.members["QueueOwnerAWSAccountId"], - self.queue_owner_aws_account_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["queue_name"] = de.read_string( - _SCHEMA_GET_QUEUE_URL_INPUT.members["QueueName"] - ) - - case 1: - kwargs["queue_owner_aws_account_id"] = de.read_string( - _SCHEMA_GET_QUEUE_URL_INPUT.members["QueueOwnerAWSAccountId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_QUEUE_URL_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetQueueUrlOutput: - """ - For more information, see [Interpreting - Responses](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-api-responses.html) - in the *Amazon SQS Developer Guide*. - """ - - queue_url: str | None = None - """The URL of the queue.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_QUEUE_URL_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.queue_url is not None: - serializer.write_string( - _SCHEMA_GET_QUEUE_URL_OUTPUT.members["QueueUrl"], self.queue_url - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["queue_url"] = de.read_string( - _SCHEMA_GET_QUEUE_URL_OUTPUT.members["QueueUrl"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_QUEUE_URL_OUTPUT, consumer=_consumer) - return kwargs - - -GET_QUEUE_URL = APIOperation( - input=GetQueueUrlInput, - output=GetQueueUrlOutput, - schema=_SCHEMA_GET_QUEUE_URL, - input_schema=_SCHEMA_GET_QUEUE_URL_INPUT, - output_schema=_SCHEMA_GET_QUEUE_URL_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.sqs#InvalidAddress"): InvalidAddress, - ShapeID("com.amazonaws.sqs#InvalidSecurity"): InvalidSecurity, - ShapeID("com.amazonaws.sqs#QueueDoesNotExist"): QueueDoesNotExist, - ShapeID("com.amazonaws.sqs#RequestThrottled"): RequestThrottled, - ShapeID("com.amazonaws.sqs#UnsupportedOperation"): UnsupportedOperation, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_ADDRESS, - _SCHEMA_INVALID_SECURITY, - _SCHEMA_QUEUE_DOES_NOT_EXIST, - _SCHEMA_REQUEST_THROTTLED, - _SCHEMA_UNSUPPORTED_OPERATION, - ], -) - - -@dataclass(kw_only=True) -class ListDeadLetterSourceQueuesInput: - """""" - - queue_url: str | None = None - """ - The URL of a dead-letter queue. - - Queue URLs and names are case-sensitive. - """ - - next_token: str | None = None - """Pagination token to request the next set of results.""" - - max_results: int | None = None - """ - Maximum number of results to include in the response. Value range is 1 - to 1000. You must set `MaxResults` to receive a value for `NextToken` in - the response. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_DEAD_LETTER_SOURCE_QUEUES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.queue_url is not None: - serializer.write_string( - _SCHEMA_LIST_DEAD_LETTER_SOURCE_QUEUES_INPUT.members["QueueUrl"], - self.queue_url, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_DEAD_LETTER_SOURCE_QUEUES_INPUT.members["NextToken"], - self.next_token, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_DEAD_LETTER_SOURCE_QUEUES_INPUT.members["MaxResults"], - self.max_results, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["queue_url"] = de.read_string( - _SCHEMA_LIST_DEAD_LETTER_SOURCE_QUEUES_INPUT.members["QueueUrl"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_DEAD_LETTER_SOURCE_QUEUES_INPUT.members[ - "NextToken" - ] - ) - - case 2: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_DEAD_LETTER_SOURCE_QUEUES_INPUT.members[ - "MaxResults" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_DEAD_LETTER_SOURCE_QUEUES_INPUT, consumer=_consumer - ) - return kwargs - - -def _serialize_queue_url_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_queue_url_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListDeadLetterSourceQueuesOutput: - """A list of your dead letter source queues.""" - - queue_urls: list[str] - """ - A list of source queue URLs that have the `RedrivePolicy` queue - attribute configured with a dead-letter queue. - """ - - next_token: str | None = None - """ - Pagination token to include in the next request. Token value is `null` - if there are no additional results to request, or if you did not set - `MaxResults` in the request. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_DEAD_LETTER_SOURCE_QUEUES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_queue_url_list( - serializer, - _SCHEMA_LIST_DEAD_LETTER_SOURCE_QUEUES_OUTPUT.members["queueUrls"], - self.queue_urls, - ) - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_DEAD_LETTER_SOURCE_QUEUES_OUTPUT.members["NextToken"], - self.next_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["queue_urls"] = _deserialize_queue_url_list( - de, - _SCHEMA_LIST_DEAD_LETTER_SOURCE_QUEUES_OUTPUT.members[ - "queueUrls" - ], - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_DEAD_LETTER_SOURCE_QUEUES_OUTPUT.members[ - "NextToken" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_DEAD_LETTER_SOURCE_QUEUES_OUTPUT, consumer=_consumer - ) - if "queue_urls" not in kwargs: - kwargs["queue_urls"] = [] - return kwargs - - -LIST_DEAD_LETTER_SOURCE_QUEUES = APIOperation( - input=ListDeadLetterSourceQueuesInput, - output=ListDeadLetterSourceQueuesOutput, - schema=_SCHEMA_LIST_DEAD_LETTER_SOURCE_QUEUES, - input_schema=_SCHEMA_LIST_DEAD_LETTER_SOURCE_QUEUES_INPUT, - output_schema=_SCHEMA_LIST_DEAD_LETTER_SOURCE_QUEUES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.sqs#InvalidAddress"): InvalidAddress, - ShapeID("com.amazonaws.sqs#InvalidSecurity"): InvalidSecurity, - ShapeID("com.amazonaws.sqs#QueueDoesNotExist"): QueueDoesNotExist, - ShapeID("com.amazonaws.sqs#RequestThrottled"): RequestThrottled, - ShapeID("com.amazonaws.sqs#UnsupportedOperation"): UnsupportedOperation, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_ADDRESS, - _SCHEMA_INVALID_SECURITY, - _SCHEMA_QUEUE_DOES_NOT_EXIST, - _SCHEMA_REQUEST_THROTTLED, - _SCHEMA_UNSUPPORTED_OPERATION, - ], -) - - -@dataclass(kw_only=True) -class ListMessageMoveTasksInput: - """Dataclass for ListMessageMoveTasksInput structure.""" - - source_arn: str | None = None - """The ARN of the queue whose message movement tasks are to be listed.""" - - max_results: int | None = None - """ - The maximum number of results to include in the response. The default is - 1, which provides the most recent message movement task. The upper limit - is 10. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_MESSAGE_MOVE_TASKS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.source_arn is not None: - serializer.write_string( - _SCHEMA_LIST_MESSAGE_MOVE_TASKS_INPUT.members["SourceArn"], - self.source_arn, - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_MESSAGE_MOVE_TASKS_INPUT.members["MaxResults"], - self.max_results, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["source_arn"] = de.read_string( - _SCHEMA_LIST_MESSAGE_MOVE_TASKS_INPUT.members["SourceArn"] - ) - - case 1: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_MESSAGE_MOVE_TASKS_INPUT.members["MaxResults"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_MESSAGE_MOVE_TASKS_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ListMessageMoveTasksResultEntry: - """Contains the details of a message movement task.""" - - task_handle: str | None = None - """ - An identifier associated with a message movement task. When this field - is returned in the response of the `ListMessageMoveTasks` action, it is - only populated for tasks that are in RUNNING status. - """ - - status: str | None = None - """ - The status of the message movement task. Possible values are: RUNNING, - COMPLETED, CANCELLING, CANCELLED, and FAILED. - """ - - source_arn: str | None = None - """ - The ARN of the queue that contains the messages to be moved to another - queue. - """ - - destination_arn: str | None = None - """ - The ARN of the destination queue if it has been specified in the - `StartMessageMoveTask` request. If a `DestinationArn` has not been - specified in the `StartMessageMoveTask` request, this field value will - be NULL. - """ - - max_number_of_messages_per_second: int | None = None - """ - The number of messages to be moved per second (the message movement - rate), if it has been specified in the `StartMessageMoveTask` request. - If a `MaxNumberOfMessagesPerSecond` has not been specified in the - `StartMessageMoveTask` request, this field value will be NULL. - """ - - approximate_number_of_messages_moved: int = 0 - """ - The approximate number of messages already moved to the destination - queue. - """ - - approximate_number_of_messages_to_move: int | None = None - """ - The number of messages to be moved from the source queue. This number is - obtained at the time of starting the message movement task and is only - included after the message movement task is selected to start. - """ - - failure_reason: str | None = None - """The task failure reason (only included if the task status is FAILED).""" - - started_timestamp: int = 0 - """The timestamp of starting the message movement task.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_MESSAGE_MOVE_TASKS_RESULT_ENTRY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.task_handle is not None: - serializer.write_string( - _SCHEMA_LIST_MESSAGE_MOVE_TASKS_RESULT_ENTRY.members["TaskHandle"], - self.task_handle, - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_LIST_MESSAGE_MOVE_TASKS_RESULT_ENTRY.members["Status"], - self.status, - ) - - if self.source_arn is not None: - serializer.write_string( - _SCHEMA_LIST_MESSAGE_MOVE_TASKS_RESULT_ENTRY.members["SourceArn"], - self.source_arn, - ) - - if self.destination_arn is not None: - serializer.write_string( - _SCHEMA_LIST_MESSAGE_MOVE_TASKS_RESULT_ENTRY.members["DestinationArn"], - self.destination_arn, - ) - - if self.max_number_of_messages_per_second is not None: - serializer.write_integer( - _SCHEMA_LIST_MESSAGE_MOVE_TASKS_RESULT_ENTRY.members[ - "MaxNumberOfMessagesPerSecond" - ], - self.max_number_of_messages_per_second, - ) - - serializer.write_long( - _SCHEMA_LIST_MESSAGE_MOVE_TASKS_RESULT_ENTRY.members[ - "ApproximateNumberOfMessagesMoved" - ], - self.approximate_number_of_messages_moved, - ) - if self.approximate_number_of_messages_to_move is not None: - serializer.write_long( - _SCHEMA_LIST_MESSAGE_MOVE_TASKS_RESULT_ENTRY.members[ - "ApproximateNumberOfMessagesToMove" - ], - self.approximate_number_of_messages_to_move, - ) - - if self.failure_reason is not None: - serializer.write_string( - _SCHEMA_LIST_MESSAGE_MOVE_TASKS_RESULT_ENTRY.members["FailureReason"], - self.failure_reason, - ) - - serializer.write_long( - _SCHEMA_LIST_MESSAGE_MOVE_TASKS_RESULT_ENTRY.members["StartedTimestamp"], - self.started_timestamp, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["task_handle"] = de.read_string( - _SCHEMA_LIST_MESSAGE_MOVE_TASKS_RESULT_ENTRY.members[ - "TaskHandle" - ] - ) - - case 1: - kwargs["status"] = de.read_string( - _SCHEMA_LIST_MESSAGE_MOVE_TASKS_RESULT_ENTRY.members["Status"] - ) - - case 2: - kwargs["source_arn"] = de.read_string( - _SCHEMA_LIST_MESSAGE_MOVE_TASKS_RESULT_ENTRY.members[ - "SourceArn" - ] - ) - - case 3: - kwargs["destination_arn"] = de.read_string( - _SCHEMA_LIST_MESSAGE_MOVE_TASKS_RESULT_ENTRY.members[ - "DestinationArn" - ] - ) - - case 4: - kwargs["max_number_of_messages_per_second"] = de.read_integer( - _SCHEMA_LIST_MESSAGE_MOVE_TASKS_RESULT_ENTRY.members[ - "MaxNumberOfMessagesPerSecond" - ] - ) - - case 5: - kwargs["approximate_number_of_messages_moved"] = de.read_long( - _SCHEMA_LIST_MESSAGE_MOVE_TASKS_RESULT_ENTRY.members[ - "ApproximateNumberOfMessagesMoved" - ] - ) - - case 6: - kwargs["approximate_number_of_messages_to_move"] = de.read_long( - _SCHEMA_LIST_MESSAGE_MOVE_TASKS_RESULT_ENTRY.members[ - "ApproximateNumberOfMessagesToMove" - ] - ) - - case 7: - kwargs["failure_reason"] = de.read_string( - _SCHEMA_LIST_MESSAGE_MOVE_TASKS_RESULT_ENTRY.members[ - "FailureReason" - ] - ) - - case 8: - kwargs["started_timestamp"] = de.read_long( - _SCHEMA_LIST_MESSAGE_MOVE_TASKS_RESULT_ENTRY.members[ - "StartedTimestamp" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_MESSAGE_MOVE_TASKS_RESULT_ENTRY, consumer=_consumer - ) - return kwargs - - -def _serialize_list_message_move_tasks_result_entry_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[ListMessageMoveTasksResultEntry], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_list_message_move_tasks_result_entry_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ListMessageMoveTasksResultEntry]: - result: list[ListMessageMoveTasksResultEntry] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ListMessageMoveTasksResultEntry.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ListMessageMoveTasksOutput: - """Dataclass for ListMessageMoveTasksOutput structure.""" - - results: list[ListMessageMoveTasksResultEntry] | None = None - """A list of message movement tasks and their attributes.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_MESSAGE_MOVE_TASKS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.results is not None: - _serialize_list_message_move_tasks_result_entry_list( - serializer, - _SCHEMA_LIST_MESSAGE_MOVE_TASKS_OUTPUT.members["Results"], - self.results, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["results"] = ( - _deserialize_list_message_move_tasks_result_entry_list( - de, - _SCHEMA_LIST_MESSAGE_MOVE_TASKS_OUTPUT.members["Results"], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_LIST_MESSAGE_MOVE_TASKS_OUTPUT, consumer=_consumer - ) - return kwargs - - -LIST_MESSAGE_MOVE_TASKS = APIOperation( - input=ListMessageMoveTasksInput, - output=ListMessageMoveTasksOutput, - schema=_SCHEMA_LIST_MESSAGE_MOVE_TASKS, - input_schema=_SCHEMA_LIST_MESSAGE_MOVE_TASKS_INPUT, - output_schema=_SCHEMA_LIST_MESSAGE_MOVE_TASKS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.sqs#InvalidAddress"): InvalidAddress, - ShapeID("com.amazonaws.sqs#InvalidSecurity"): InvalidSecurity, - ShapeID("com.amazonaws.sqs#RequestThrottled"): RequestThrottled, - ShapeID( - "com.amazonaws.sqs#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.sqs#UnsupportedOperation"): UnsupportedOperation, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_ADDRESS, - _SCHEMA_INVALID_SECURITY, - _SCHEMA_REQUEST_THROTTLED, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION, - ], -) - - -@dataclass(kw_only=True) -class ListQueuesInput: - """""" - - queue_name_prefix: str | None = None - """ - A string to use for filtering the list results. Only those queues whose - name begins with the specified string are returned. - - Queue URLs and names are case-sensitive. - """ - - next_token: str | None = None - """Pagination token to request the next set of results.""" - - max_results: int | None = None - """ - Maximum number of results to include in the response. Value range is 1 - to 1000. You must set `MaxResults` to receive a value for `NextToken` in - the response. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_QUEUES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.queue_name_prefix is not None: - serializer.write_string( - _SCHEMA_LIST_QUEUES_INPUT.members["QueueNamePrefix"], - self.queue_name_prefix, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_QUEUES_INPUT.members["NextToken"], self.next_token - ) - - if self.max_results is not None: - serializer.write_integer( - _SCHEMA_LIST_QUEUES_INPUT.members["MaxResults"], self.max_results - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["queue_name_prefix"] = de.read_string( - _SCHEMA_LIST_QUEUES_INPUT.members["QueueNamePrefix"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_QUEUES_INPUT.members["NextToken"] - ) - - case 2: - kwargs["max_results"] = de.read_integer( - _SCHEMA_LIST_QUEUES_INPUT.members["MaxResults"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_QUEUES_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ListQueuesOutput: - """A list of your queues.""" - - queue_urls: list[str] | None = None - """ - A list of queue URLs, up to 1,000 entries, or the value of `MaxResults` - that you sent in the request. - """ - - next_token: str | None = None - """ - Pagination token to include in the next request. Token value is `null` - if there are no additional results to request, or if you did not set - `MaxResults` in the request. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_QUEUES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.queue_urls is not None: - _serialize_queue_url_list( - serializer, - _SCHEMA_LIST_QUEUES_OUTPUT.members["QueueUrls"], - self.queue_urls, - ) - - if self.next_token is not None: - serializer.write_string( - _SCHEMA_LIST_QUEUES_OUTPUT.members["NextToken"], self.next_token - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["queue_urls"] = _deserialize_queue_url_list( - de, _SCHEMA_LIST_QUEUES_OUTPUT.members["QueueUrls"] - ) - - case 1: - kwargs["next_token"] = de.read_string( - _SCHEMA_LIST_QUEUES_OUTPUT.members["NextToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_QUEUES_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_QUEUES = APIOperation( - input=ListQueuesInput, - output=ListQueuesOutput, - schema=_SCHEMA_LIST_QUEUES, - input_schema=_SCHEMA_LIST_QUEUES_INPUT, - output_schema=_SCHEMA_LIST_QUEUES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.sqs#InvalidAddress"): InvalidAddress, - ShapeID("com.amazonaws.sqs#InvalidSecurity"): InvalidSecurity, - ShapeID("com.amazonaws.sqs#RequestThrottled"): RequestThrottled, - ShapeID("com.amazonaws.sqs#UnsupportedOperation"): UnsupportedOperation, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_ADDRESS, - _SCHEMA_INVALID_SECURITY, - _SCHEMA_REQUEST_THROTTLED, - _SCHEMA_UNSUPPORTED_OPERATION, - ], -) - - -@dataclass(kw_only=True) -class ListQueueTagsInput: - """Dataclass for ListQueueTagsInput structure.""" - - queue_url: str | None = None - """The URL of the queue.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_QUEUE_TAGS_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.queue_url is not None: - serializer.write_string( - _SCHEMA_LIST_QUEUE_TAGS_INPUT.members["QueueUrl"], self.queue_url - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["queue_url"] = de.read_string( - _SCHEMA_LIST_QUEUE_TAGS_INPUT.members["QueueUrl"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_QUEUE_TAGS_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ListQueueTagsOutput: - """Dataclass for ListQueueTagsOutput structure.""" - - tags: dict[str, str] | None = None - """The list of all tags added to the specified queue.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIST_QUEUE_TAGS_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.tags is not None: - _serialize_tag_map( - serializer, _SCHEMA_LIST_QUEUE_TAGS_OUTPUT.members["Tags"], self.tags - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["tags"] = _deserialize_tag_map( - de, _SCHEMA_LIST_QUEUE_TAGS_OUTPUT.members["Tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIST_QUEUE_TAGS_OUTPUT, consumer=_consumer) - return kwargs - - -LIST_QUEUE_TAGS = APIOperation( - input=ListQueueTagsInput, - output=ListQueueTagsOutput, - schema=_SCHEMA_LIST_QUEUE_TAGS, - input_schema=_SCHEMA_LIST_QUEUE_TAGS_INPUT, - output_schema=_SCHEMA_LIST_QUEUE_TAGS_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.sqs#InvalidAddress"): InvalidAddress, - ShapeID("com.amazonaws.sqs#InvalidSecurity"): InvalidSecurity, - ShapeID("com.amazonaws.sqs#QueueDoesNotExist"): QueueDoesNotExist, - ShapeID("com.amazonaws.sqs#RequestThrottled"): RequestThrottled, - ShapeID("com.amazonaws.sqs#UnsupportedOperation"): UnsupportedOperation, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_ADDRESS, - _SCHEMA_INVALID_SECURITY, - _SCHEMA_QUEUE_DOES_NOT_EXIST, - _SCHEMA_REQUEST_THROTTLED, - _SCHEMA_UNSUPPORTED_OPERATION, - ], -) - - -@dataclass(kw_only=True) -class PurgeQueueInProgress(ServiceError): - """ - Indicates that the specified queue previously received a `PurgeQueue` - request within the last 60 seconds (the time it can take to delete the - messages in the queue). - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PURGE_QUEUE_IN_PROGRESS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_PURGE_QUEUE_IN_PROGRESS.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_PURGE_QUEUE_IN_PROGRESS.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PURGE_QUEUE_IN_PROGRESS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class PurgeQueueInput: - """""" - - queue_url: str | None = None - """ - The URL of the queue from which the `PurgeQueue` action deletes - messages. - - Queue URLs and names are case-sensitive. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PURGE_QUEUE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.queue_url is not None: - serializer.write_string( - _SCHEMA_PURGE_QUEUE_INPUT.members["QueueUrl"], self.queue_url - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["queue_url"] = de.read_string( - _SCHEMA_PURGE_QUEUE_INPUT.members["QueueUrl"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PURGE_QUEUE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class PurgeQueueOutput: - """Dataclass for PurgeQueueOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PURGE_QUEUE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PURGE_QUEUE_OUTPUT, consumer=_consumer) - return kwargs - - -PURGE_QUEUE = APIOperation( - input=PurgeQueueInput, - output=PurgeQueueOutput, - schema=_SCHEMA_PURGE_QUEUE, - input_schema=_SCHEMA_PURGE_QUEUE_INPUT, - output_schema=_SCHEMA_PURGE_QUEUE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.sqs#InvalidAddress"): InvalidAddress, - ShapeID("com.amazonaws.sqs#InvalidSecurity"): InvalidSecurity, - ShapeID("com.amazonaws.sqs#PurgeQueueInProgress"): PurgeQueueInProgress, - ShapeID("com.amazonaws.sqs#QueueDoesNotExist"): QueueDoesNotExist, - ShapeID("com.amazonaws.sqs#RequestThrottled"): RequestThrottled, - ShapeID("com.amazonaws.sqs#UnsupportedOperation"): UnsupportedOperation, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_ADDRESS, - _SCHEMA_INVALID_SECURITY, - _SCHEMA_PURGE_QUEUE_IN_PROGRESS, - _SCHEMA_QUEUE_DOES_NOT_EXIST, - _SCHEMA_REQUEST_THROTTLED, - _SCHEMA_UNSUPPORTED_OPERATION, - ], -) - - -@dataclass(kw_only=True) -class KmsAccessDenied(ServiceError): - """The caller doesn't have the required KMS access.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KMS_ACCESS_DENIED, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_KMS_ACCESS_DENIED.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_KMS_ACCESS_DENIED.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_KMS_ACCESS_DENIED, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class KmsDisabled(ServiceError): - """The request was denied due to request throttling.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KMS_DISABLED, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_KMS_DISABLED.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_KMS_DISABLED.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_KMS_DISABLED, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class KmsInvalidKeyUsage(ServiceError): - """ - The request was rejected for one of the following reasons: - - - The KeyUsage value of the KMS key is incompatible with the API - operation. - - - The encryption algorithm or signing algorithm specified for the - operation is incompatible with the type of key material in the KMS key - (KeySpec). - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KMS_INVALID_KEY_USAGE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_KMS_INVALID_KEY_USAGE.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_KMS_INVALID_KEY_USAGE.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_KMS_INVALID_KEY_USAGE, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class KmsInvalidState(ServiceError): - """ - The request was rejected because the state of the specified resource is - not valid for this request. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KMS_INVALID_STATE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_KMS_INVALID_STATE.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_KMS_INVALID_STATE.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_KMS_INVALID_STATE, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class KmsNotFound(ServiceError): - """ - The request was rejected because the specified entity or resource could - not be found. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KMS_NOT_FOUND, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_KMS_NOT_FOUND.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_KMS_NOT_FOUND.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_KMS_NOT_FOUND, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class KmsOptInRequired(ServiceError): - """ - The request was rejected because the specified key policy isn't - syntactically or semantically correct. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KMS_OPT_IN_REQUIRED, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_KMS_OPT_IN_REQUIRED.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_KMS_OPT_IN_REQUIRED.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_KMS_OPT_IN_REQUIRED, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class KmsThrottled(ServiceError): - """Amazon Web Services KMS throttles requests for the following conditions.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_KMS_THROTTLED, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_KMS_THROTTLED.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_KMS_THROTTLED.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_KMS_THROTTLED, consumer=_consumer) - return kwargs - - -def _serialize_message_attribute_name_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_message_attribute_name_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -class MessageSystemAttributeName(UnknownEnumMixin, StrEnum): - ALL = "All" - SENDER_ID = "SenderId" - SENT_TIMESTAMP = "SentTimestamp" - APPROXIMATE_RECEIVE_COUNT = "ApproximateReceiveCount" - APPROXIMATE_FIRST_RECEIVE_TIMESTAMP = "ApproximateFirstReceiveTimestamp" - SEQUENCE_NUMBER = "SequenceNumber" - MESSAGE_DEDUPLICATION_ID = "MessageDeduplicationId" - MESSAGE_GROUP_ID = "MessageGroupId" - AWS_TRACE_HEADER = "AWSTraceHeader" - DEAD_LETTER_QUEUE_SOURCE_ARN = "DeadLetterQueueSourceArn" - - -def _serialize_message_system_attribute_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_message_system_attribute_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(MessageSystemAttributeName(d.read_string(member_schema))) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ReceiveMessageInput: - """Retrieves one or more messages from a specified queue.""" - - queue_url: str | None = None - """ - The URL of the Amazon SQS queue from which messages are received. - - Queue URLs and names are case-sensitive. - """ - - attribute_names: list[str] | None = None - """ - Warning: - This parameter has been discontinued but will be supported for backward - compatibility. To provide attribute names, you are encouraged to use - `MessageSystemAttributeNames`. - - A list of attributes that need to be returned along with each message. - These attributes include: - - - `All` -- Returns all values. - - - `ApproximateFirstReceiveTimestamp` -- Returns the time the message was - first received from the queue ([epoch - time](http://en.wikipedia.org/wiki/Unix_time) in milliseconds). - - - `ApproximateReceiveCount` -- Returns the number of times a message has - been received across all queues but not deleted. - - - `AWSTraceHeader` -- Returns the X-Ray trace header string. - - - `SenderId` - - - For a user, returns the user ID, for example - `ABCDEFGHI1JKLMNOPQ23R`. - - - For an IAM role, returns the IAM role ID, for example - `ABCDE1F2GH3I4JK5LMNOP:i-a123b456`. - - - `SentTimestamp` -- Returns the time the message was sent to the queue - ([epoch time](http://en.wikipedia.org/wiki/Unix_time) in - milliseconds). - - - `SqsManagedSseEnabled` -- Enables server-side queue encryption using - SQS owned encryption keys. Only one server-side encryption option is - supported per queue (for example, - [SSE-KMS](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sse-existing-queue.html) - or - [SSE-SQS](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sqs-sse-queue.html)). - - - `MessageDeduplicationId` -- Returns the value provided by the producer - that calls the ` ``SendMessage`` ` action. - - - `MessageGroupId` -- Returns the value provided by the producer that - calls the ` ``SendMessage`` ` action. - - - `SequenceNumber` -- Returns the value provided by Amazon SQS. - """ - - message_system_attribute_names: list[str] | None = None - """ - A list of attributes that need to be returned along with each message. - These attributes include: - - - `All` -- Returns all values. - - - `ApproximateFirstReceiveTimestamp` -- Returns the time the message was - first received from the queue ([epoch - time](http://en.wikipedia.org/wiki/Unix_time) in milliseconds). - - - `ApproximateReceiveCount` -- Returns the number of times a message has - been received across all queues but not deleted. - - - `AWSTraceHeader` -- Returns the X-Ray trace header string. - - - `SenderId` - - - For a user, returns the user ID, for example - `ABCDEFGHI1JKLMNOPQ23R`. - - - For an IAM role, returns the IAM role ID, for example - `ABCDE1F2GH3I4JK5LMNOP:i-a123b456`. - - - `SentTimestamp` -- Returns the time the message was sent to the queue - ([epoch time](http://en.wikipedia.org/wiki/Unix_time) in - milliseconds). - - - `SqsManagedSseEnabled` -- Enables server-side queue encryption using - SQS owned encryption keys. Only one server-side encryption option is - supported per queue (for example, - [SSE-KMS](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sse-existing-queue.html) - or - [SSE-SQS](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sqs-sse-queue.html)). - - - `MessageDeduplicationId` -- Returns the value provided by the producer - that calls the ` ``SendMessage`` ` action. - - - `MessageGroupId` -- Returns the value provided by the producer that - calls the ` ``SendMessage`` ` action. - - - `SequenceNumber` -- Returns the value provided by Amazon SQS. - """ - - message_attribute_names: list[str] | None = None - """ - The name of the message attribute, where *N* is the index. - - - The name can contain alphanumeric characters and the underscore (`_`), - hyphen (`-`), and period (`.`). - - - The name is case-sensitive and must be unique among all attribute - names for the message. - - - The name must not start with AWS-reserved prefixes such as `AWS.` or - `Amazon.` (or any casing variants). - - - The name must not start or end with a period (`.`), and it should not - have periods in succession (`..`). - - - The name can be up to 256 characters long. - - When using `ReceiveMessage`, you can send a list of attribute names to - receive, or you can return all of the attributes by specifying `All` or - `.*` in your request. You can also use all message attributes starting - with a prefix, for example `bar.*`. - """ - - max_number_of_messages: int | None = None - """ - The maximum number of messages to return. Amazon SQS never returns more - messages than this value (however, fewer messages might be returned). - Valid values: 1 to 10. Default: 1. - """ - - visibility_timeout: int | None = None - """ - The duration (in seconds) that the received messages are hidden from - subsequent retrieve requests after being retrieved by a `ReceiveMessage` - request. If not specified, the default visibility timeout for the queue - is used, which is 30 seconds. - - Understanding `VisibilityTimeout`: - - - When a message is received from a queue, it becomes temporarily - invisible to other consumers for the duration of the visibility - timeout. This prevents multiple consumers from processing the same - message simultaneously. If the message is not deleted or its - visibility timeout is not extended before the timeout expires, it - becomes visible again and can be retrieved by other consumers. - - - Setting an appropriate visibility timeout is crucial. If it's too - short, the message might become visible again before processing is - complete, leading to duplicate processing. If it's too long, it - delays the reprocessing of messages if the initial processing fails. - - - You can adjust the visibility timeout using the `--visibility-timeout` - parameter in the `receive-message` command to match the processing - time required by your application. - - - A message that isn't deleted or a message whose visibility isn't - extended before the visibility timeout expires counts as a failed - receive. Depending on the configuration of the queue, the message - might be sent to the dead-letter queue. - - For more information, see [Visibility - Timeout](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html) - in the *Amazon SQS Developer Guide*. - """ - - wait_time_seconds: int | None = None - """ - The duration (in seconds) for which the call waits for a message to - arrive in the queue before returning. If a message is available, the - call returns sooner than `WaitTimeSeconds`. If no messages are available - and the wait time expires, the call does not return a message list. If - you are using the Java SDK, it returns a `ReceiveMessageResponse` - object, which has a empty list instead of a Null object. - - Warning: - To avoid HTTP errors, ensure that the HTTP response timeout for - `ReceiveMessage` requests is longer than the `WaitTimeSeconds` - parameter. For example, with the Java SDK, you can set HTTP transport - settings using the - [NettyNioAsyncHttpClient](https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/http/nio/netty/NettyNioAsyncHttpClient.html) - for asynchronous clients, or the - [ApacheHttpClient](https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/http/apache/ApacheHttpClient.html) - for synchronous clients. - """ - - receive_request_attempt_id: str | None = None - """ - This parameter applies only to FIFO (first-in-first-out) queues. - - The token used for deduplication of `ReceiveMessage` calls. If a - networking issue occurs after a `ReceiveMessage` action, and instead of - a response you receive a generic error, it is possible to retry the same - action with an identical `ReceiveRequestAttemptId` to retrieve the same - set of messages, even if their visibility timeout has not yet expired. - - - You can use `ReceiveRequestAttemptId` only for 5 minutes after a - `ReceiveMessage` action. - - - When you set `FifoQueue`, a caller of the `ReceiveMessage` action can - provide a `ReceiveRequestAttemptId` explicitly. - - - It is possible to retry the `ReceiveMessage` action with the same - `ReceiveRequestAttemptId` if none of the messages have been modified - (deleted or had their visibility changes). - - - During a visibility timeout, subsequent calls with the same - `ReceiveRequestAttemptId` return the same messages and receipt - handles. If a retry occurs within the deduplication interval, it - resets the visibility timeout. For more information, see [Visibility - Timeout](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html) - in the *Amazon SQS Developer Guide*. - - Warning: - If a caller of the `ReceiveMessage` action still processes messages - when the visibility timeout expires and messages become visible, - another worker consuming from the same queue can receive the same - messages and therefore process duplicates. Also, if a consumer whose - message processing time is longer than the visibility timeout tries to - delete the processed messages, the action fails with an error. - - To mitigate this effect, ensure that your application observes a safe - threshold before the visibility timeout expires and extend the - visibility timeout as necessary. - - - While messages with a particular `MessageGroupId` are invisible, no - more messages belonging to the same `MessageGroupId` are returned - until the visibility timeout expires. You can still receive messages - with another `MessageGroupId` from your FIFO queue as long as they are - visible. - - - If a caller of `ReceiveMessage` can't track the - `ReceiveRequestAttemptId`, no retries work until the original - visibility timeout expires. As a result, delays might occur but the - messages in the queue remain in a strict order. - - The maximum length of `ReceiveRequestAttemptId` is 128 characters. - `ReceiveRequestAttemptId` can contain alphanumeric characters (`a-z`, - `A-Z`, `0-9`) and punctuation (`` !"#$%&'()*+,-./:;<=>?@[]^_`{|}~ ``). - - For best practices of using `ReceiveRequestAttemptId`, see [Using the - ReceiveRequestAttemptId Request - Parameter](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-receiverequestattemptid-request-parameter.html) - in the *Amazon SQS Developer Guide*. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RECEIVE_MESSAGE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.queue_url is not None: - serializer.write_string( - _SCHEMA_RECEIVE_MESSAGE_INPUT.members["QueueUrl"], self.queue_url - ) - - if self.attribute_names is not None: - _serialize_attribute_name_list( - serializer, - _SCHEMA_RECEIVE_MESSAGE_INPUT.members["AttributeNames"], - self.attribute_names, - ) - - if self.message_system_attribute_names is not None: - _serialize_message_system_attribute_list( - serializer, - _SCHEMA_RECEIVE_MESSAGE_INPUT.members["MessageSystemAttributeNames"], - self.message_system_attribute_names, - ) - - if self.message_attribute_names is not None: - _serialize_message_attribute_name_list( - serializer, - _SCHEMA_RECEIVE_MESSAGE_INPUT.members["MessageAttributeNames"], - self.message_attribute_names, - ) - - if self.max_number_of_messages is not None: - serializer.write_integer( - _SCHEMA_RECEIVE_MESSAGE_INPUT.members["MaxNumberOfMessages"], - self.max_number_of_messages, - ) - - if self.visibility_timeout is not None: - serializer.write_integer( - _SCHEMA_RECEIVE_MESSAGE_INPUT.members["VisibilityTimeout"], - self.visibility_timeout, - ) - - if self.wait_time_seconds is not None: - serializer.write_integer( - _SCHEMA_RECEIVE_MESSAGE_INPUT.members["WaitTimeSeconds"], - self.wait_time_seconds, - ) - - if self.receive_request_attempt_id is not None: - serializer.write_string( - _SCHEMA_RECEIVE_MESSAGE_INPUT.members["ReceiveRequestAttemptId"], - self.receive_request_attempt_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["queue_url"] = de.read_string( - _SCHEMA_RECEIVE_MESSAGE_INPUT.members["QueueUrl"] - ) - - case 1: - kwargs["attribute_names"] = _deserialize_attribute_name_list( - de, _SCHEMA_RECEIVE_MESSAGE_INPUT.members["AttributeNames"] - ) - - case 2: - kwargs["message_system_attribute_names"] = ( - _deserialize_message_system_attribute_list( - de, - _SCHEMA_RECEIVE_MESSAGE_INPUT.members[ - "MessageSystemAttributeNames" - ], - ) - ) - - case 3: - kwargs["message_attribute_names"] = ( - _deserialize_message_attribute_name_list( - de, - _SCHEMA_RECEIVE_MESSAGE_INPUT.members[ - "MessageAttributeNames" - ], - ) - ) - - case 4: - kwargs["max_number_of_messages"] = de.read_integer( - _SCHEMA_RECEIVE_MESSAGE_INPUT.members["MaxNumberOfMessages"] - ) - - case 5: - kwargs["visibility_timeout"] = de.read_integer( - _SCHEMA_RECEIVE_MESSAGE_INPUT.members["VisibilityTimeout"] - ) - - case 6: - kwargs["wait_time_seconds"] = de.read_integer( - _SCHEMA_RECEIVE_MESSAGE_INPUT.members["WaitTimeSeconds"] - ) - - case 7: - kwargs["receive_request_attempt_id"] = de.read_string( - _SCHEMA_RECEIVE_MESSAGE_INPUT.members["ReceiveRequestAttemptId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RECEIVE_MESSAGE_INPUT, consumer=_consumer) - return kwargs - - -def _serialize_message_system_attribute_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_message_system_attribute_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -def _serialize_binary_list( - serializer: ShapeSerializer, schema: Schema, value: list[bytes] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_blob(member_schema, e) - - -def _deserialize_binary_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[bytes]: - result: list[bytes] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_blob(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_string_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_string_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class MessageAttributeValue: - """ - The user-specified message attribute value. For string data types, the - `Value` attribute has the same restrictions on the content as the - message body. For more information, see ` ``SendMessage``.` - - `Name`, `type`, `value` and the message body must not be empty or null. - All parts of the message attribute, including `Name`, `Type`, and - `Value`, are part of the message size restriction (1 MiB or 1,048,576 - bytes). - """ - - data_type: str - """ - Amazon SQS supports the following logical data types: `String`, - `Number`, and `Binary`. For the `Number` data type, you must use - `StringValue`. - - You can also append custom labels. For more information, see [Amazon SQS - Message - Attributes](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-metadata.html#sqs-message-attributes) - in the *Amazon SQS Developer Guide*. - """ - - string_value: str | None = None - """ - Strings are Unicode with UTF-8 binary encoding. For a list of code - values, see [ASCII Printable - Characters](http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters). - """ - - binary_value: bytes | None = None - """ - Binary type attributes can store any binary data, such as compressed - data, encrypted data, or images. - """ - - string_list_values: list[str] | None = None - """Not implemented. Reserved for future use.""" - - binary_list_values: list[bytes] | None = None - """Not implemented. Reserved for future use.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MESSAGE_ATTRIBUTE_VALUE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.string_value is not None: - serializer.write_string( - _SCHEMA_MESSAGE_ATTRIBUTE_VALUE.members["StringValue"], - self.string_value, - ) - - if self.binary_value is not None: - serializer.write_blob( - _SCHEMA_MESSAGE_ATTRIBUTE_VALUE.members["BinaryValue"], - self.binary_value, - ) - - if self.string_list_values is not None: - _serialize_string_list( - serializer, - _SCHEMA_MESSAGE_ATTRIBUTE_VALUE.members["StringListValues"], - self.string_list_values, - ) - - if self.binary_list_values is not None: - _serialize_binary_list( - serializer, - _SCHEMA_MESSAGE_ATTRIBUTE_VALUE.members["BinaryListValues"], - self.binary_list_values, - ) - - serializer.write_string( - _SCHEMA_MESSAGE_ATTRIBUTE_VALUE.members["DataType"], self.data_type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["string_value"] = de.read_string( - _SCHEMA_MESSAGE_ATTRIBUTE_VALUE.members["StringValue"] - ) - - case 1: - kwargs["binary_value"] = de.read_blob( - _SCHEMA_MESSAGE_ATTRIBUTE_VALUE.members["BinaryValue"] - ) - - case 2: - kwargs["string_list_values"] = _deserialize_string_list( - de, _SCHEMA_MESSAGE_ATTRIBUTE_VALUE.members["StringListValues"] - ) - - case 3: - kwargs["binary_list_values"] = _deserialize_binary_list( - de, _SCHEMA_MESSAGE_ATTRIBUTE_VALUE.members["BinaryListValues"] - ) - - case 4: - kwargs["data_type"] = de.read_string( - _SCHEMA_MESSAGE_ATTRIBUTE_VALUE.members["DataType"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MESSAGE_ATTRIBUTE_VALUE, consumer=_consumer) - if "data_type" not in kwargs: - kwargs["data_type"] = "" - return kwargs - - -def _serialize_message_body_attribute_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, MessageAttributeValue] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_struct(value_schema, v)) - - -def _deserialize_message_body_attribute_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, MessageAttributeValue]: - result: dict[str, MessageAttributeValue] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = MessageAttributeValue.deserialize(d) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class Message: - """An Amazon SQS message.""" - - message_id: str | None = None - """ - A unique identifier for the message. A `MessageId`is considered unique - across all Amazon Web Services accounts for an extended period of time. - """ - - receipt_handle: str | None = None - """ - An identifier associated with the act of receiving the message. A new - receipt handle is returned every time you receive a message. When - deleting a message, you provide the last received receipt handle to - delete the message. - """ - - md5_of_body: str | None = None - """An MD5 digest of the non-URL-encoded message body string.""" - - body: str | None = None - """The message's contents (not URL-encoded).""" - - attributes: dict[str, str] | None = None - """ - A map of the attributes requested in ` ``ReceiveMessage`` ` to their - respective values. Supported attributes: - - - `ApproximateReceiveCount` - - - `ApproximateFirstReceiveTimestamp` - - - `MessageDeduplicationId` - - - `MessageGroupId` - - - `SenderId` - - - `SentTimestamp` - - - `SequenceNumber` - - `ApproximateFirstReceiveTimestamp` and `SentTimestamp` are each returned - as an integer representing the [epoch - time](http://en.wikipedia.org/wiki/Unix_time) in milliseconds. - """ - - md5_of_message_attributes: str | None = None - """ - An MD5 digest of the non-URL-encoded message attribute string. You can - use this attribute to verify that Amazon SQS received the message - correctly. Amazon SQS URL-decodes the message before creating the MD5 - digest. For information about MD5, see - [RFC1321](https://www.ietf.org/rfc/rfc1321.txt). - """ - - message_attributes: dict[str, MessageAttributeValue] | None = None - """ - Each message attribute consists of a `Name`, `Type`, and `Value`. For - more information, see [Amazon SQS message - attributes](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-metadata.html#sqs-message-attributes) - in the *Amazon SQS Developer Guide*. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MESSAGE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message_id is not None: - serializer.write_string( - _SCHEMA_MESSAGE.members["MessageId"], self.message_id - ) - - if self.receipt_handle is not None: - serializer.write_string( - _SCHEMA_MESSAGE.members["ReceiptHandle"], self.receipt_handle - ) - - if self.md5_of_body is not None: - serializer.write_string( - _SCHEMA_MESSAGE.members["MD5OfBody"], self.md5_of_body - ) - - if self.body is not None: - serializer.write_string(_SCHEMA_MESSAGE.members["Body"], self.body) - - if self.attributes is not None: - _serialize_message_system_attribute_map( - serializer, _SCHEMA_MESSAGE.members["Attributes"], self.attributes - ) - - if self.md5_of_message_attributes is not None: - serializer.write_string( - _SCHEMA_MESSAGE.members["MD5OfMessageAttributes"], - self.md5_of_message_attributes, - ) - - if self.message_attributes is not None: - _serialize_message_body_attribute_map( - serializer, - _SCHEMA_MESSAGE.members["MessageAttributes"], - self.message_attributes, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message_id"] = de.read_string( - _SCHEMA_MESSAGE.members["MessageId"] - ) - - case 1: - kwargs["receipt_handle"] = de.read_string( - _SCHEMA_MESSAGE.members["ReceiptHandle"] - ) - - case 2: - kwargs["md5_of_body"] = de.read_string( - _SCHEMA_MESSAGE.members["MD5OfBody"] - ) - - case 3: - kwargs["body"] = de.read_string(_SCHEMA_MESSAGE.members["Body"]) - - case 4: - kwargs["attributes"] = _deserialize_message_system_attribute_map( - de, _SCHEMA_MESSAGE.members["Attributes"] - ) - - case 5: - kwargs["md5_of_message_attributes"] = de.read_string( - _SCHEMA_MESSAGE.members["MD5OfMessageAttributes"] - ) - - case 6: - kwargs["message_attributes"] = ( - _deserialize_message_body_attribute_map( - de, _SCHEMA_MESSAGE.members["MessageAttributes"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MESSAGE, consumer=_consumer) - return kwargs - - -def _serialize_message_list( - serializer: ShapeSerializer, schema: Schema, value: list[Message] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_message_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Message]: - result: list[Message] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Message.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ReceiveMessageOutput: - """A list of received messages.""" - - messages: list[Message] | None = None - """A list of messages.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RECEIVE_MESSAGE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.messages is not None: - _serialize_message_list( - serializer, - _SCHEMA_RECEIVE_MESSAGE_OUTPUT.members["Messages"], - self.messages, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["messages"] = _deserialize_message_list( - de, _SCHEMA_RECEIVE_MESSAGE_OUTPUT.members["Messages"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RECEIVE_MESSAGE_OUTPUT, consumer=_consumer) - return kwargs - - -RECEIVE_MESSAGE = APIOperation( - input=ReceiveMessageInput, - output=ReceiveMessageOutput, - schema=_SCHEMA_RECEIVE_MESSAGE, - input_schema=_SCHEMA_RECEIVE_MESSAGE_INPUT, - output_schema=_SCHEMA_RECEIVE_MESSAGE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.sqs#InvalidAddress"): InvalidAddress, - ShapeID("com.amazonaws.sqs#InvalidSecurity"): InvalidSecurity, - ShapeID("com.amazonaws.sqs#KmsAccessDenied"): KmsAccessDenied, - ShapeID("com.amazonaws.sqs#KmsDisabled"): KmsDisabled, - ShapeID("com.amazonaws.sqs#KmsInvalidKeyUsage"): KmsInvalidKeyUsage, - ShapeID("com.amazonaws.sqs#KmsInvalidState"): KmsInvalidState, - ShapeID("com.amazonaws.sqs#KmsNotFound"): KmsNotFound, - ShapeID("com.amazonaws.sqs#KmsOptInRequired"): KmsOptInRequired, - ShapeID("com.amazonaws.sqs#KmsThrottled"): KmsThrottled, - ShapeID("com.amazonaws.sqs#OverLimit"): OverLimit, - ShapeID("com.amazonaws.sqs#QueueDoesNotExist"): QueueDoesNotExist, - ShapeID("com.amazonaws.sqs#RequestThrottled"): RequestThrottled, - ShapeID("com.amazonaws.sqs#UnsupportedOperation"): UnsupportedOperation, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_ADDRESS, - _SCHEMA_INVALID_SECURITY, - _SCHEMA_KMS_ACCESS_DENIED, - _SCHEMA_KMS_DISABLED, - _SCHEMA_KMS_INVALID_KEY_USAGE, - _SCHEMA_KMS_INVALID_STATE, - _SCHEMA_KMS_NOT_FOUND, - _SCHEMA_KMS_OPT_IN_REQUIRED, - _SCHEMA_KMS_THROTTLED, - _SCHEMA_OVER_LIMIT, - _SCHEMA_QUEUE_DOES_NOT_EXIST, - _SCHEMA_REQUEST_THROTTLED, - _SCHEMA_UNSUPPORTED_OPERATION, - ], -) - - -@dataclass(kw_only=True) -class RemovePermissionInput: - """""" - - queue_url: str | None = None - """ - The URL of the Amazon SQS queue from which permissions are removed. - - Queue URLs and names are case-sensitive. - """ - - label: str | None = None - """ - The identification of the permission to remove. This is the label added - using the ` ``AddPermission`` ` action. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REMOVE_PERMISSION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.queue_url is not None: - serializer.write_string( - _SCHEMA_REMOVE_PERMISSION_INPUT.members["QueueUrl"], self.queue_url - ) - - if self.label is not None: - serializer.write_string( - _SCHEMA_REMOVE_PERMISSION_INPUT.members["Label"], self.label - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["queue_url"] = de.read_string( - _SCHEMA_REMOVE_PERMISSION_INPUT.members["QueueUrl"] - ) - - case 1: - kwargs["label"] = de.read_string( - _SCHEMA_REMOVE_PERMISSION_INPUT.members["Label"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_REMOVE_PERMISSION_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class RemovePermissionOutput: - """Dataclass for RemovePermissionOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REMOVE_PERMISSION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_REMOVE_PERMISSION_OUTPUT, consumer=_consumer) - return kwargs - - -REMOVE_PERMISSION = APIOperation( - input=RemovePermissionInput, - output=RemovePermissionOutput, - schema=_SCHEMA_REMOVE_PERMISSION, - input_schema=_SCHEMA_REMOVE_PERMISSION_INPUT, - output_schema=_SCHEMA_REMOVE_PERMISSION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.sqs#InvalidAddress"): InvalidAddress, - ShapeID("com.amazonaws.sqs#InvalidSecurity"): InvalidSecurity, - ShapeID("com.amazonaws.sqs#QueueDoesNotExist"): QueueDoesNotExist, - ShapeID("com.amazonaws.sqs#RequestThrottled"): RequestThrottled, - ShapeID("com.amazonaws.sqs#UnsupportedOperation"): UnsupportedOperation, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_ADDRESS, - _SCHEMA_INVALID_SECURITY, - _SCHEMA_QUEUE_DOES_NOT_EXIST, - _SCHEMA_REQUEST_THROTTLED, - _SCHEMA_UNSUPPORTED_OPERATION, - ], -) - - -@dataclass(kw_only=True) -class InvalidMessageContents(ServiceError): - """The message contains characters outside the allowed set.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_MESSAGE_CONTENTS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_MESSAGE_CONTENTS.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_MESSAGE_CONTENTS.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INVALID_MESSAGE_CONTENTS, consumer=_consumer) - return kwargs - - -class MessageSystemAttributeNameForSends(UnknownEnumMixin, StrEnum): - AWS_TRACE_HEADER = "AWSTraceHeader" - - -@dataclass(kw_only=True) -class MessageSystemAttributeValue: - """ - The user-specified message system attribute value. For string data - types, the `Value` attribute has the same restrictions on the content as - the message body. For more information, see ` ``SendMessage``.` - - `Name`, `type`, `value` and the message body must not be empty or null. - """ - - data_type: str - """ - Amazon SQS supports the following logical data types: `String`, - `Number`, and `Binary`. For the `Number` data type, you must use - `StringValue`. - - You can also append custom labels. For more information, see [Amazon SQS - Message - Attributes](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-metadata.html#sqs-message-attributes) - in the *Amazon SQS Developer Guide*. - """ - - string_value: str | None = None - """ - Strings are Unicode with UTF-8 binary encoding. For a list of code - values, see [ASCII Printable - Characters](http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters). - """ - - binary_value: bytes | None = None - """ - Binary type attributes can store any binary data, such as compressed - data, encrypted data, or images. - """ - - string_list_values: list[str] | None = None - """Not implemented. Reserved for future use.""" - - binary_list_values: list[bytes] | None = None - """Not implemented. Reserved for future use.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MESSAGE_SYSTEM_ATTRIBUTE_VALUE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.string_value is not None: - serializer.write_string( - _SCHEMA_MESSAGE_SYSTEM_ATTRIBUTE_VALUE.members["StringValue"], - self.string_value, - ) - - if self.binary_value is not None: - serializer.write_blob( - _SCHEMA_MESSAGE_SYSTEM_ATTRIBUTE_VALUE.members["BinaryValue"], - self.binary_value, - ) - - if self.string_list_values is not None: - _serialize_string_list( - serializer, - _SCHEMA_MESSAGE_SYSTEM_ATTRIBUTE_VALUE.members["StringListValues"], - self.string_list_values, - ) - - if self.binary_list_values is not None: - _serialize_binary_list( - serializer, - _SCHEMA_MESSAGE_SYSTEM_ATTRIBUTE_VALUE.members["BinaryListValues"], - self.binary_list_values, - ) - - serializer.write_string( - _SCHEMA_MESSAGE_SYSTEM_ATTRIBUTE_VALUE.members["DataType"], self.data_type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["string_value"] = de.read_string( - _SCHEMA_MESSAGE_SYSTEM_ATTRIBUTE_VALUE.members["StringValue"] - ) - - case 1: - kwargs["binary_value"] = de.read_blob( - _SCHEMA_MESSAGE_SYSTEM_ATTRIBUTE_VALUE.members["BinaryValue"] - ) - - case 2: - kwargs["string_list_values"] = _deserialize_string_list( - de, - _SCHEMA_MESSAGE_SYSTEM_ATTRIBUTE_VALUE.members[ - "StringListValues" - ], - ) - - case 3: - kwargs["binary_list_values"] = _deserialize_binary_list( - de, - _SCHEMA_MESSAGE_SYSTEM_ATTRIBUTE_VALUE.members[ - "BinaryListValues" - ], - ) - - case 4: - kwargs["data_type"] = de.read_string( - _SCHEMA_MESSAGE_SYSTEM_ATTRIBUTE_VALUE.members["DataType"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MESSAGE_SYSTEM_ATTRIBUTE_VALUE, consumer=_consumer - ) - if "data_type" not in kwargs: - kwargs["data_type"] = "" - return kwargs - - -def _serialize_message_body_system_attribute_map( - serializer: ShapeSerializer, - schema: Schema, - value: dict[str, MessageSystemAttributeValue], -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_struct(value_schema, v)) - - -def _deserialize_message_body_system_attribute_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, MessageSystemAttributeValue]: - result: dict[str, MessageSystemAttributeValue] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = MessageSystemAttributeValue.deserialize(d) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class SendMessageInput: - """""" - - queue_url: str | None = None - """ - The URL of the Amazon SQS queue to which a message is sent. - - Queue URLs and names are case-sensitive. - """ - - message_body: str | None = None - """ - The message to send. The minimum size is one character. The maximum size - is 1 MiB or 1,048,576 bytes - - Warning: - A message can include only XML, JSON, and unformatted text. The - following Unicode characters are allowed. For more information, see the - [W3C specification for - characters](http://www.w3.org/TR/REC-xml/#charsets). - - `#x9` | `#xA` | `#xD` | `#x20` to `#xD7FF` | `#xE000` to `#xFFFD` | - `#x10000` to `#x10FFFF` - - If a message contains characters outside the allowed set, Amazon SQS - rejects the message and returns an InvalidMessageContents error. Ensure - that your message body includes only valid characters to avoid this - exception. - """ - - delay_seconds: int | None = None - """ - The length of time, in seconds, for which to delay a specific message. - Valid values: 0 to 900. Maximum: 15 minutes. Messages with a positive - `DelaySeconds` value become available for processing after the delay - period is finished. If you don't specify a value, the default value for - the queue applies. - - Note: - When you set `FifoQueue`, you can't set `DelaySeconds` per message. You - can set this parameter only on a queue level. - """ - - message_attributes: dict[str, MessageAttributeValue] | None = None - """ - Each message attribute consists of a `Name`, `Type`, and `Value`. For - more information, see [Amazon SQS message - attributes](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-metadata.html#sqs-message-attributes) - in the *Amazon SQS Developer Guide*. - """ - - message_system_attributes: dict[str, MessageSystemAttributeValue] | None = None - """ - The message system attribute to send. Each message system attribute - consists of a `Name`, `Type`, and `Value`. - - Warning: - - Currently, the only supported message system attribute is - `AWSTraceHeader`. Its type must be `String` and its value must be a - correctly formatted X-Ray trace header string. - - - The size of a message system attribute doesn't count towards the - total size of a message. - """ - - message_deduplication_id: str | None = None - """ - This parameter applies only to FIFO (first-in-first-out) queues. - - The token used for deduplication of sent messages. If a message with a - particular `MessageDeduplicationId` is sent successfully, any messages - sent with the same `MessageDeduplicationId` are accepted successfully - but aren't delivered during the 5-minute deduplication interval. For - more information, see [Exactly-once - processing](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues-exactly-once-processing.html) - in the *Amazon SQS Developer Guide*. - - - Every message must have a unique `MessageDeduplicationId`, - - - You may provide a `MessageDeduplicationId` explicitly. - - - If you aren't able to provide a `MessageDeduplicationId` and you - enable `ContentBasedDeduplication` for your queue, Amazon SQS uses a - SHA-256 hash to generate the `MessageDeduplicationId` using the body - of the message (but not the attributes of the message). - - - If you don't provide a `MessageDeduplicationId` and the queue - doesn't have `ContentBasedDeduplication` set, the action fails with - an error. - - - If the queue has `ContentBasedDeduplication` set, your - `MessageDeduplicationId` overrides the generated one. - - - When `ContentBasedDeduplication` is in effect, messages with identical - content sent within the deduplication interval are treated as - duplicates and only one copy of the message is delivered. - - - If you send one message with `ContentBasedDeduplication` enabled and - then another message with a `MessageDeduplicationId` that is the same - as the one generated for the first `MessageDeduplicationId`, the two - messages are treated as duplicates and only one copy of the message is - delivered. - - Note: - The `MessageDeduplicationId` is available to the consumer of the message - (this can be useful for troubleshooting delivery issues). - - If a message is sent successfully but the acknowledgement is lost and - the message is resent with the same `MessageDeduplicationId` after the - deduplication interval, Amazon SQS can't detect duplicate messages. - - Amazon SQS continues to keep track of the message deduplication ID even - after the message is received and deleted. - - The maximum length of `MessageDeduplicationId` is 128 characters. - `MessageDeduplicationId` can contain alphanumeric characters (`a-z`, - `A-Z`, `0-9`) and punctuation (`` !"#$%&'()*+,-./:;<=>?@[]^_`{|}~ ``). - - For best practices of using `MessageDeduplicationId`, see [Using the - MessageDeduplicationId - Property](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagededuplicationid-property.html) - in the *Amazon SQS Developer Guide*. - """ - - message_group_id: str | None = None - """ - `MessageGroupId` is an attribute used in Amazon SQS FIFO - (First-In-First-Out) and standard queues. In FIFO queues, - `MessageGroupId` organizes messages into distinct groups. Messages - within the same message group are always processed one at a time, in - strict order, ensuring that no two messages from the same group are - processed simultaneously. In standard queues, using `MessageGroupId` - enables fair queues. It is used to identify the tenant a message belongs - to, helping maintain consistent message dwell time across all tenants - during noisy neighbor events. Unlike FIFO queues, messages with the same - `MessageGroupId` can be processed in parallel, maintaining the high - throughput of standard queues. - - - **FIFO queues:** `MessageGroupId` acts as the tag that specifies that - a message belongs to a specific message group. Messages that belong to - the same message group are processed in a FIFO manner (however, - messages in different message groups might be processed out of order). - To interleave multiple ordered streams within a single queue, use - `MessageGroupId` values (for example, session data for multiple - users). In this scenario, multiple consumers can process the queue, - but the session data of each user is processed in a FIFO fashion. - - If you do not provide a `MessageGroupId` when sending a message to a - FIFO queue, the action fails. - - `ReceiveMessage` might return messages with multiple `MessageGroupId` - values. For each `MessageGroupId`, the messages are sorted by time - sent. - - - **Standard queues:**Use `MessageGroupId` in standard queues to enable - fair queues. The `MessageGroupId` identifies the tenant a message - belongs to. A tenant can be any entity that shares a queue with - others, such as your customer, a client application, or a request - type. When one tenant sends a disproportionately large volume of - messages or has messages that require longer processing time, fair - queues ensure other tenants' messages maintain low dwell time. This - preserves quality of service for all tenants while maintaining the - scalability and throughput of standard queues. We recommend that you - include a `MessageGroupId` in all messages when using fair queues. - - The length of `MessageGroupId` is 128 characters. Valid values: - alphanumeric characters and punctuation - `` (!"#$%&'()*+,-./:;<=>?@[]^_`{|}~) ``. - - For best practices of using `MessageGroupId`, see [Using the - MessageGroupId - Property](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagegroupid-property.html) - in the *Amazon SQS Developer Guide*. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SEND_MESSAGE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.queue_url is not None: - serializer.write_string( - _SCHEMA_SEND_MESSAGE_INPUT.members["QueueUrl"], self.queue_url - ) - - if self.message_body is not None: - serializer.write_string( - _SCHEMA_SEND_MESSAGE_INPUT.members["MessageBody"], self.message_body - ) - - if self.delay_seconds is not None: - serializer.write_integer( - _SCHEMA_SEND_MESSAGE_INPUT.members["DelaySeconds"], self.delay_seconds - ) - - if self.message_attributes is not None: - _serialize_message_body_attribute_map( - serializer, - _SCHEMA_SEND_MESSAGE_INPUT.members["MessageAttributes"], - self.message_attributes, - ) - - if self.message_system_attributes is not None: - _serialize_message_body_system_attribute_map( - serializer, - _SCHEMA_SEND_MESSAGE_INPUT.members["MessageSystemAttributes"], - self.message_system_attributes, - ) - - if self.message_deduplication_id is not None: - serializer.write_string( - _SCHEMA_SEND_MESSAGE_INPUT.members["MessageDeduplicationId"], - self.message_deduplication_id, - ) - - if self.message_group_id is not None: - serializer.write_string( - _SCHEMA_SEND_MESSAGE_INPUT.members["MessageGroupId"], - self.message_group_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["queue_url"] = de.read_string( - _SCHEMA_SEND_MESSAGE_INPUT.members["QueueUrl"] - ) - - case 1: - kwargs["message_body"] = de.read_string( - _SCHEMA_SEND_MESSAGE_INPUT.members["MessageBody"] - ) - - case 2: - kwargs["delay_seconds"] = de.read_integer( - _SCHEMA_SEND_MESSAGE_INPUT.members["DelaySeconds"] - ) - - case 3: - kwargs["message_attributes"] = ( - _deserialize_message_body_attribute_map( - de, _SCHEMA_SEND_MESSAGE_INPUT.members["MessageAttributes"] - ) - ) - - case 4: - kwargs["message_system_attributes"] = ( - _deserialize_message_body_system_attribute_map( - de, - _SCHEMA_SEND_MESSAGE_INPUT.members[ - "MessageSystemAttributes" - ], - ) - ) - - case 5: - kwargs["message_deduplication_id"] = de.read_string( - _SCHEMA_SEND_MESSAGE_INPUT.members["MessageDeduplicationId"] - ) - - case 6: - kwargs["message_group_id"] = de.read_string( - _SCHEMA_SEND_MESSAGE_INPUT.members["MessageGroupId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SEND_MESSAGE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class SendMessageOutput: - """The `MD5OfMessageBody` and `MessageId` elements.""" - - md5_of_message_body: str | None = None - """ - An MD5 digest of the non-URL-encoded message body string. You can use - this attribute to verify that Amazon SQS received the message correctly. - Amazon SQS URL-decodes the message before creating the MD5 digest. For - information about MD5, see - [RFC1321](https://www.ietf.org/rfc/rfc1321.txt). - """ - - md5_of_message_attributes: str | None = None - """ - An MD5 digest of the non-URL-encoded message attribute string. You can - use this attribute to verify that Amazon SQS received the message - correctly. Amazon SQS URL-decodes the message before creating the MD5 - digest. For information about MD5, see - [RFC1321](https://www.ietf.org/rfc/rfc1321.txt). - """ - - md5_of_message_system_attributes: str | None = None - """ - An MD5 digest of the non-URL-encoded message system attribute string. - You can use this attribute to verify that Amazon SQS received the - message correctly. Amazon SQS URL-decodes the message before creating - the MD5 digest. - """ - - message_id: str | None = None - """ - An attribute containing the `MessageId` of the message sent to the - queue. For more information, see [Queue and Message - Identifiers](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-queue-message-identifiers.html) - in the *Amazon SQS Developer Guide*. - """ - - sequence_number: str | None = None - """ - This parameter applies only to FIFO (first-in-first-out) queues. - - The large, non-consecutive number that Amazon SQS assigns to each - message. - - The length of `SequenceNumber` is 128 bits. `SequenceNumber` continues - to increase for a particular `MessageGroupId`. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SEND_MESSAGE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.md5_of_message_body is not None: - serializer.write_string( - _SCHEMA_SEND_MESSAGE_OUTPUT.members["MD5OfMessageBody"], - self.md5_of_message_body, - ) - - if self.md5_of_message_attributes is not None: - serializer.write_string( - _SCHEMA_SEND_MESSAGE_OUTPUT.members["MD5OfMessageAttributes"], - self.md5_of_message_attributes, - ) - - if self.md5_of_message_system_attributes is not None: - serializer.write_string( - _SCHEMA_SEND_MESSAGE_OUTPUT.members["MD5OfMessageSystemAttributes"], - self.md5_of_message_system_attributes, - ) - - if self.message_id is not None: - serializer.write_string( - _SCHEMA_SEND_MESSAGE_OUTPUT.members["MessageId"], self.message_id - ) - - if self.sequence_number is not None: - serializer.write_string( - _SCHEMA_SEND_MESSAGE_OUTPUT.members["SequenceNumber"], - self.sequence_number, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["md5_of_message_body"] = de.read_string( - _SCHEMA_SEND_MESSAGE_OUTPUT.members["MD5OfMessageBody"] - ) - - case 1: - kwargs["md5_of_message_attributes"] = de.read_string( - _SCHEMA_SEND_MESSAGE_OUTPUT.members["MD5OfMessageAttributes"] - ) - - case 2: - kwargs["md5_of_message_system_attributes"] = de.read_string( - _SCHEMA_SEND_MESSAGE_OUTPUT.members[ - "MD5OfMessageSystemAttributes" - ] - ) - - case 3: - kwargs["message_id"] = de.read_string( - _SCHEMA_SEND_MESSAGE_OUTPUT.members["MessageId"] - ) - - case 4: - kwargs["sequence_number"] = de.read_string( - _SCHEMA_SEND_MESSAGE_OUTPUT.members["SequenceNumber"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SEND_MESSAGE_OUTPUT, consumer=_consumer) - return kwargs - - -SEND_MESSAGE = APIOperation( - input=SendMessageInput, - output=SendMessageOutput, - schema=_SCHEMA_SEND_MESSAGE, - input_schema=_SCHEMA_SEND_MESSAGE_INPUT, - output_schema=_SCHEMA_SEND_MESSAGE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.sqs#InvalidAddress"): InvalidAddress, - ShapeID("com.amazonaws.sqs#InvalidMessageContents"): InvalidMessageContents, - ShapeID("com.amazonaws.sqs#InvalidSecurity"): InvalidSecurity, - ShapeID("com.amazonaws.sqs#KmsAccessDenied"): KmsAccessDenied, - ShapeID("com.amazonaws.sqs#KmsDisabled"): KmsDisabled, - ShapeID("com.amazonaws.sqs#KmsInvalidKeyUsage"): KmsInvalidKeyUsage, - ShapeID("com.amazonaws.sqs#KmsInvalidState"): KmsInvalidState, - ShapeID("com.amazonaws.sqs#KmsNotFound"): KmsNotFound, - ShapeID("com.amazonaws.sqs#KmsOptInRequired"): KmsOptInRequired, - ShapeID("com.amazonaws.sqs#KmsThrottled"): KmsThrottled, - ShapeID("com.amazonaws.sqs#QueueDoesNotExist"): QueueDoesNotExist, - ShapeID("com.amazonaws.sqs#RequestThrottled"): RequestThrottled, - ShapeID("com.amazonaws.sqs#UnsupportedOperation"): UnsupportedOperation, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_ADDRESS, - _SCHEMA_INVALID_MESSAGE_CONTENTS, - _SCHEMA_INVALID_SECURITY, - _SCHEMA_KMS_ACCESS_DENIED, - _SCHEMA_KMS_DISABLED, - _SCHEMA_KMS_INVALID_KEY_USAGE, - _SCHEMA_KMS_INVALID_STATE, - _SCHEMA_KMS_NOT_FOUND, - _SCHEMA_KMS_OPT_IN_REQUIRED, - _SCHEMA_KMS_THROTTLED, - _SCHEMA_QUEUE_DOES_NOT_EXIST, - _SCHEMA_REQUEST_THROTTLED, - _SCHEMA_UNSUPPORTED_OPERATION, - ], -) - - -@dataclass(kw_only=True) -class BatchRequestTooLong(ServiceError): - """The length of all the messages put together is more than the limit.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BATCH_REQUEST_TOO_LONG, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_BATCH_REQUEST_TOO_LONG.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_BATCH_REQUEST_TOO_LONG.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BATCH_REQUEST_TOO_LONG, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class SendMessageBatchRequestEntry: - """Contains the details of a single Amazon SQS message along with an `Id`.""" - - id: str - """ - An identifier for a message in this batch used to communicate the - result. - - Note: - The `Id`s of a batch request need to be unique within a request. - - This identifier can have up to 80 characters. The following characters - are accepted: alphanumeric characters, hyphens(-), and underscores (_). - """ - - message_body: str - """The body of the message.""" - - delay_seconds: int | None = None - """ - The length of time, in seconds, for which a specific message is delayed. - Valid values: 0 to 900. Maximum: 15 minutes. Messages with a positive - `DelaySeconds` value become available for processing after the delay - period is finished. If you don't specify a value, the default value for - the queue is applied. - - Note: - When you set `FifoQueue`, you can't set `DelaySeconds` per message. You - can set this parameter only on a queue level. - """ - - message_attributes: dict[str, MessageAttributeValue] | None = None - """ - Each message attribute consists of a `Name`, `Type`, and `Value`. For - more information, see [Amazon SQS message - attributes](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-metadata.html#sqs-message-attributes) - in the *Amazon SQS Developer Guide*. - """ - - message_system_attributes: dict[str, MessageSystemAttributeValue] | None = None - """ - The message system attribute to send Each message system attribute - consists of a `Name`, `Type`, and `Value`. - - Warning: - - Currently, the only supported message system attribute is - `AWSTraceHeader`. Its type must be `String` and its value must be a - correctly formatted X-Ray trace header string. - - - The size of a message system attribute doesn't count towards the - total size of a message. - """ - - message_deduplication_id: str | None = None - """ - This parameter applies only to FIFO (first-in-first-out) queues. - - The token used for deduplication of messages within a 5-minute minimum - deduplication interval. If a message with a particular - `MessageDeduplicationId` is sent successfully, subsequent messages with - the same `MessageDeduplicationId` are accepted successfully but aren't - delivered. For more information, see [Exactly-once - processing](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues-exactly-once-processing.html) - in the *Amazon SQS Developer Guide*. - - - Every message must have a unique `MessageDeduplicationId`, - - - You may provide a `MessageDeduplicationId` explicitly. - - - If you aren't able to provide a `MessageDeduplicationId` and you - enable `ContentBasedDeduplication` for your queue, Amazon SQS uses a - SHA-256 hash to generate the `MessageDeduplicationId` using the body - of the message (but not the attributes of the message). - - - If you don't provide a `MessageDeduplicationId` and the queue - doesn't have `ContentBasedDeduplication` set, the action fails with - an error. - - - If the queue has `ContentBasedDeduplication` set, your - `MessageDeduplicationId` overrides the generated one. - - - When `ContentBasedDeduplication` is in effect, messages with identical - content sent within the deduplication interval are treated as - duplicates and only one copy of the message is delivered. - - - If you send one message with `ContentBasedDeduplication` enabled and - then another message with a `MessageDeduplicationId` that is the same - as the one generated for the first `MessageDeduplicationId`, the two - messages are treated as duplicates and only one copy of the message is - delivered. - - Note: - The `MessageDeduplicationId` is available to the consumer of the message - (this can be useful for troubleshooting delivery issues). - - If a message is sent successfully but the acknowledgement is lost and - the message is resent with the same `MessageDeduplicationId` after the - deduplication interval, Amazon SQS can't detect duplicate messages. - - Amazon SQS continues to keep track of the message deduplication ID even - after the message is received and deleted. - - The length of `MessageDeduplicationId` is 128 characters. - `MessageDeduplicationId` can contain alphanumeric characters (`a-z`, - `A-Z`, `0-9`) and punctuation (`` !"#$%&'()*+,-./:;<=>?@[]^_`{|}~ ``). - - For best practices of using `MessageDeduplicationId`, see [Using the - MessageDeduplicationId - Property](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagededuplicationid-property.html) - in the *Amazon SQS Developer Guide*. - """ - - message_group_id: str | None = None - """ - `MessageGroupId` is an attribute used in Amazon SQS FIFO - (First-In-First-Out) and standard queues. In FIFO queues, - `MessageGroupId` organizes messages into distinct groups. Messages - within the same message group are always processed one at a time, in - strict order, ensuring that no two messages from the same group are - processed simultaneously. In standard queues, using `MessageGroupId` - enables fair queues. It is used to identify the tenant a message belongs - to, helping maintain consistent message dwell time across all tenants - during noisy neighbor events. Unlike FIFO queues, messages with the same - `MessageGroupId` can be processed in parallel, maintaining the high - throughput of standard queues. - - - **FIFO queues:** `MessageGroupId` acts as the tag that specifies that - a message belongs to a specific message group. Messages that belong to - the same message group are processed in a FIFO manner (however, - messages in different message groups might be processed out of order). - To interleave multiple ordered streams within a single queue, use - `MessageGroupId` values (for example, session data for multiple - users). In this scenario, multiple consumers can process the queue, - but the session data of each user is processed in a FIFO fashion. - - If you do not provide a `MessageGroupId` when sending a message to a - FIFO queue, the action fails. - - `ReceiveMessage` might return messages with multiple `MessageGroupId` - values. For each `MessageGroupId`, the messages are sorted by time - sent. - - - **Standard queues:**Use `MessageGroupId` in standard queues to enable - fair queues. The `MessageGroupId` identifies the tenant a message - belongs to. A tenant can be any entity that shares a queue with - others, such as your customer, a client application, or a request - type. When one tenant sends a disproportionately large volume of - messages or has messages that require longer processing time, fair - queues ensure other tenants' messages maintain low dwell time. This - preserves quality of service for all tenants while maintaining the - scalability and throughput of standard queues. We recommend that you - include a `MessageGroupId` in all messages when using fair queues. - - The length of `MessageGroupId` is 128 characters. Valid values: - alphanumeric characters and punctuation - `` (!"#$%&'()*+,-./:;<=>?@[]^_`{|}~) ``. - - For best practices of using `MessageGroupId`, see [Using the - MessageGroupId - Property](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagegroupid-property.html) - in the *Amazon SQS Developer Guide*. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SEND_MESSAGE_BATCH_REQUEST_ENTRY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SEND_MESSAGE_BATCH_REQUEST_ENTRY.members["Id"], self.id - ) - serializer.write_string( - _SCHEMA_SEND_MESSAGE_BATCH_REQUEST_ENTRY.members["MessageBody"], - self.message_body, - ) - if self.delay_seconds is not None: - serializer.write_integer( - _SCHEMA_SEND_MESSAGE_BATCH_REQUEST_ENTRY.members["DelaySeconds"], - self.delay_seconds, - ) - - if self.message_attributes is not None: - _serialize_message_body_attribute_map( - serializer, - _SCHEMA_SEND_MESSAGE_BATCH_REQUEST_ENTRY.members["MessageAttributes"], - self.message_attributes, - ) - - if self.message_system_attributes is not None: - _serialize_message_body_system_attribute_map( - serializer, - _SCHEMA_SEND_MESSAGE_BATCH_REQUEST_ENTRY.members[ - "MessageSystemAttributes" - ], - self.message_system_attributes, - ) - - if self.message_deduplication_id is not None: - serializer.write_string( - _SCHEMA_SEND_MESSAGE_BATCH_REQUEST_ENTRY.members[ - "MessageDeduplicationId" - ], - self.message_deduplication_id, - ) - - if self.message_group_id is not None: - serializer.write_string( - _SCHEMA_SEND_MESSAGE_BATCH_REQUEST_ENTRY.members["MessageGroupId"], - self.message_group_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_SEND_MESSAGE_BATCH_REQUEST_ENTRY.members["Id"] - ) - - case 1: - kwargs["message_body"] = de.read_string( - _SCHEMA_SEND_MESSAGE_BATCH_REQUEST_ENTRY.members["MessageBody"] - ) - - case 2: - kwargs["delay_seconds"] = de.read_integer( - _SCHEMA_SEND_MESSAGE_BATCH_REQUEST_ENTRY.members["DelaySeconds"] - ) - - case 3: - kwargs["message_attributes"] = ( - _deserialize_message_body_attribute_map( - de, - _SCHEMA_SEND_MESSAGE_BATCH_REQUEST_ENTRY.members[ - "MessageAttributes" - ], - ) - ) - - case 4: - kwargs["message_system_attributes"] = ( - _deserialize_message_body_system_attribute_map( - de, - _SCHEMA_SEND_MESSAGE_BATCH_REQUEST_ENTRY.members[ - "MessageSystemAttributes" - ], - ) - ) - - case 5: - kwargs["message_deduplication_id"] = de.read_string( - _SCHEMA_SEND_MESSAGE_BATCH_REQUEST_ENTRY.members[ - "MessageDeduplicationId" - ] - ) - - case 6: - kwargs["message_group_id"] = de.read_string( - _SCHEMA_SEND_MESSAGE_BATCH_REQUEST_ENTRY.members[ - "MessageGroupId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SEND_MESSAGE_BATCH_REQUEST_ENTRY, consumer=_consumer - ) - if "id" not in kwargs: - kwargs["id"] = "" - if "message_body" not in kwargs: - kwargs["message_body"] = "" - return kwargs - - -def _serialize_send_message_batch_request_entry_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[SendMessageBatchRequestEntry], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_send_message_batch_request_entry_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[SendMessageBatchRequestEntry]: - result: list[SendMessageBatchRequestEntry] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(SendMessageBatchRequestEntry.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class SendMessageBatchInput: - """""" - - queue_url: str | None = None - """ - The URL of the Amazon SQS queue to which batched messages are sent. - - Queue URLs and names are case-sensitive. - """ - - entries: list[SendMessageBatchRequestEntry] | None = None - """A list of ` ``SendMessageBatchRequestEntry`` ` items.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SEND_MESSAGE_BATCH_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.queue_url is not None: - serializer.write_string( - _SCHEMA_SEND_MESSAGE_BATCH_INPUT.members["QueueUrl"], self.queue_url - ) - - if self.entries is not None: - _serialize_send_message_batch_request_entry_list( - serializer, - _SCHEMA_SEND_MESSAGE_BATCH_INPUT.members["Entries"], - self.entries, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["queue_url"] = de.read_string( - _SCHEMA_SEND_MESSAGE_BATCH_INPUT.members["QueueUrl"] - ) - - case 1: - kwargs["entries"] = ( - _deserialize_send_message_batch_request_entry_list( - de, _SCHEMA_SEND_MESSAGE_BATCH_INPUT.members["Entries"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SEND_MESSAGE_BATCH_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class SendMessageBatchResultEntry: - """ - Encloses a `MessageId` for a successfully-enqueued message in a - ` ``SendMessageBatch``.` - """ - - id: str - """An identifier for the message in this batch.""" - - message_id: str - """An identifier for the message.""" - - md5_of_message_body: str - """ - An MD5 digest of the non-URL-encoded message body string. You can use - this attribute to verify that Amazon SQS received the message correctly. - Amazon SQS URL-decodes the message before creating the MD5 digest. For - information about MD5, see - [RFC1321](https://www.ietf.org/rfc/rfc1321.txt). - """ - - md5_of_message_attributes: str | None = None - """ - An MD5 digest of the non-URL-encoded message attribute string. You can - use this attribute to verify that Amazon SQS received the message - correctly. Amazon SQS URL-decodes the message before creating the MD5 - digest. For information about MD5, see - [RFC1321](https://www.ietf.org/rfc/rfc1321.txt). - """ - - md5_of_message_system_attributes: str | None = None - """ - An MD5 digest of the non-URL-encoded message system attribute string. - You can use this attribute to verify that Amazon SQS received the - message correctly. Amazon SQS URL-decodes the message before creating - the MD5 digest. For information about MD5, see - [RFC1321](https://www.ietf.org/rfc/rfc1321.txt). - """ - - sequence_number: str | None = None - """ - This parameter applies only to FIFO (first-in-first-out) queues. - - The large, non-consecutive number that Amazon SQS assigns to each - message. - - The length of `SequenceNumber` is 128 bits. As `SequenceNumber` - continues to increase for a particular `MessageGroupId`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SEND_MESSAGE_BATCH_RESULT_ENTRY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_SEND_MESSAGE_BATCH_RESULT_ENTRY.members["Id"], self.id - ) - serializer.write_string( - _SCHEMA_SEND_MESSAGE_BATCH_RESULT_ENTRY.members["MessageId"], - self.message_id, - ) - serializer.write_string( - _SCHEMA_SEND_MESSAGE_BATCH_RESULT_ENTRY.members["MD5OfMessageBody"], - self.md5_of_message_body, - ) - if self.md5_of_message_attributes is not None: - serializer.write_string( - _SCHEMA_SEND_MESSAGE_BATCH_RESULT_ENTRY.members[ - "MD5OfMessageAttributes" - ], - self.md5_of_message_attributes, - ) - - if self.md5_of_message_system_attributes is not None: - serializer.write_string( - _SCHEMA_SEND_MESSAGE_BATCH_RESULT_ENTRY.members[ - "MD5OfMessageSystemAttributes" - ], - self.md5_of_message_system_attributes, - ) - - if self.sequence_number is not None: - serializer.write_string( - _SCHEMA_SEND_MESSAGE_BATCH_RESULT_ENTRY.members["SequenceNumber"], - self.sequence_number, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["id"] = de.read_string( - _SCHEMA_SEND_MESSAGE_BATCH_RESULT_ENTRY.members["Id"] - ) - - case 1: - kwargs["message_id"] = de.read_string( - _SCHEMA_SEND_MESSAGE_BATCH_RESULT_ENTRY.members["MessageId"] - ) - - case 2: - kwargs["md5_of_message_body"] = de.read_string( - _SCHEMA_SEND_MESSAGE_BATCH_RESULT_ENTRY.members[ - "MD5OfMessageBody" - ] - ) - - case 3: - kwargs["md5_of_message_attributes"] = de.read_string( - _SCHEMA_SEND_MESSAGE_BATCH_RESULT_ENTRY.members[ - "MD5OfMessageAttributes" - ] - ) - - case 4: - kwargs["md5_of_message_system_attributes"] = de.read_string( - _SCHEMA_SEND_MESSAGE_BATCH_RESULT_ENTRY.members[ - "MD5OfMessageSystemAttributes" - ] - ) - - case 5: - kwargs["sequence_number"] = de.read_string( - _SCHEMA_SEND_MESSAGE_BATCH_RESULT_ENTRY.members[ - "SequenceNumber" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SEND_MESSAGE_BATCH_RESULT_ENTRY, consumer=_consumer - ) - if "id" not in kwargs: - kwargs["id"] = "" - if "message_id" not in kwargs: - kwargs["message_id"] = "" - if "md5_of_message_body" not in kwargs: - kwargs["md5_of_message_body"] = "" - return kwargs - - -def _serialize_send_message_batch_result_entry_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[SendMessageBatchResultEntry], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_send_message_batch_result_entry_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[SendMessageBatchResultEntry]: - result: list[SendMessageBatchResultEntry] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(SendMessageBatchResultEntry.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class SendMessageBatchOutput: - """ - For each message in the batch, the response contains a - ` ``SendMessageBatchResultEntry`` ` tag if the message succeeds or a - ` ``BatchResultErrorEntry`` ` tag if the message fails. - """ - - successful: list[SendMessageBatchResultEntry] - """A list of ` ``SendMessageBatchResultEntry`` ` items.""" - failed: list[BatchResultErrorEntry] - """ - A list of ` ``BatchResultErrorEntry`` ` items with error details about - each message that can't be enqueued. +class ServiceError(ModeledError): """ + Base error for all errors in the service. - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. + Some exceptions do not extend from this class, including + synthetic, implicit, and shared exception types. """ - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SEND_MESSAGE_BATCH_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - _serialize_send_message_batch_result_entry_list( - serializer, - _SCHEMA_SEND_MESSAGE_BATCH_OUTPUT.members["Successful"], - self.successful, - ) - _serialize_batch_result_error_entry_list( - serializer, _SCHEMA_SEND_MESSAGE_BATCH_OUTPUT.members["Failed"], self.failed - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["successful"] = ( - _deserialize_send_message_batch_result_entry_list( - de, _SCHEMA_SEND_MESSAGE_BATCH_OUTPUT.members["Successful"] - ) - ) - - case 1: - kwargs["failed"] = _deserialize_batch_result_error_entry_list( - de, _SCHEMA_SEND_MESSAGE_BATCH_OUTPUT.members["Failed"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SEND_MESSAGE_BATCH_OUTPUT, consumer=_consumer) - if "successful" not in kwargs: - kwargs["successful"] = [] - if "failed" not in kwargs: - kwargs["failed"] = [] - return kwargs - - -SEND_MESSAGE_BATCH = APIOperation( - input=SendMessageBatchInput, - output=SendMessageBatchOutput, - schema=_SCHEMA_SEND_MESSAGE_BATCH, - input_schema=_SCHEMA_SEND_MESSAGE_BATCH_INPUT, - output_schema=_SCHEMA_SEND_MESSAGE_BATCH_OUTPUT, - error_registry=TypeRegistry( +_registry = ModelRegistry( + _schemas, + renames={}, + index={ + "AddPermissionInput": "ADD_PERMISSION_INPUT", + "AddPermissionOutput": "ADD_PERMISSION_OUTPUT", + "BatchEntryIdsNotDistinct": "BATCH_ENTRY_IDS_NOT_DISTINCT", + "BatchRequestTooLong": "BATCH_REQUEST_TOO_LONG", + "BatchResultErrorEntry": "BATCH_RESULT_ERROR_ENTRY", + "CancelMessageMoveTaskInput": "CANCEL_MESSAGE_MOVE_TASK_INPUT", + "CancelMessageMoveTaskOutput": "CANCEL_MESSAGE_MOVE_TASK_OUTPUT", + "ChangeMessageVisibilityBatchInput": "CHANGE_MESSAGE_VISIBILITY_BATCH_INPUT", + "ChangeMessageVisibilityBatchOutput": "CHANGE_MESSAGE_VISIBILITY_BATCH_OUTPUT", + "ChangeMessageVisibilityBatchRequestEntry": "CHANGE_MESSAGE_VISIBILITY_BATCH_REQUEST_ENTRY", + "ChangeMessageVisibilityBatchResultEntry": "CHANGE_MESSAGE_VISIBILITY_BATCH_RESULT_ENTRY", + "ChangeMessageVisibilityInput": "CHANGE_MESSAGE_VISIBILITY_INPUT", + "ChangeMessageVisibilityOutput": "CHANGE_MESSAGE_VISIBILITY_OUTPUT", + "CreateQueueInput": "CREATE_QUEUE_INPUT", + "CreateQueueOutput": "CREATE_QUEUE_OUTPUT", + "DeleteMessageBatchInput": "DELETE_MESSAGE_BATCH_INPUT", + "DeleteMessageBatchOutput": "DELETE_MESSAGE_BATCH_OUTPUT", + "DeleteMessageBatchRequestEntry": "DELETE_MESSAGE_BATCH_REQUEST_ENTRY", + "DeleteMessageBatchResultEntry": "DELETE_MESSAGE_BATCH_RESULT_ENTRY", + "DeleteMessageInput": "DELETE_MESSAGE_INPUT", + "DeleteMessageOutput": "DELETE_MESSAGE_OUTPUT", + "DeleteQueueInput": "DELETE_QUEUE_INPUT", + "DeleteQueueOutput": "DELETE_QUEUE_OUTPUT", + "EmptyBatchRequest": "EMPTY_BATCH_REQUEST", + "GetQueueAttributesInput": "GET_QUEUE_ATTRIBUTES_INPUT", + "GetQueueAttributesOutput": "GET_QUEUE_ATTRIBUTES_OUTPUT", + "GetQueueUrlInput": "GET_QUEUE_URL_INPUT", + "GetQueueUrlOutput": "GET_QUEUE_URL_OUTPUT", + "InvalidAddress": "INVALID_ADDRESS", + "InvalidAttributeName": "INVALID_ATTRIBUTE_NAME", + "InvalidAttributeValue": "INVALID_ATTRIBUTE_VALUE", + "InvalidBatchEntryId": "INVALID_BATCH_ENTRY_ID", + "InvalidIdFormat": "INVALID_ID_FORMAT", + "InvalidMessageContents": "INVALID_MESSAGE_CONTENTS", + "InvalidSecurity": "INVALID_SECURITY", + "KmsAccessDenied": "KMS_ACCESS_DENIED", + "KmsDisabled": "KMS_DISABLED", + "KmsInvalidKeyUsage": "KMS_INVALID_KEY_USAGE", + "KmsInvalidState": "KMS_INVALID_STATE", + "KmsNotFound": "KMS_NOT_FOUND", + "KmsOptInRequired": "KMS_OPT_IN_REQUIRED", + "KmsThrottled": "KMS_THROTTLED", + "ListDeadLetterSourceQueuesInput": "LIST_DEAD_LETTER_SOURCE_QUEUES_INPUT", + "ListDeadLetterSourceQueuesOutput": "LIST_DEAD_LETTER_SOURCE_QUEUES_OUTPUT", + "ListMessageMoveTasksInput": "LIST_MESSAGE_MOVE_TASKS_INPUT", + "ListMessageMoveTasksOutput": "LIST_MESSAGE_MOVE_TASKS_OUTPUT", + "ListMessageMoveTasksResultEntry": "LIST_MESSAGE_MOVE_TASKS_RESULT_ENTRY", + "ListQueuesInput": "LIST_QUEUES_INPUT", + "ListQueuesOutput": "LIST_QUEUES_OUTPUT", + "ListQueueTagsInput": "LIST_QUEUE_TAGS_INPUT", + "ListQueueTagsOutput": "LIST_QUEUE_TAGS_OUTPUT", + "Message": "MESSAGE", + "MessageAttributeValue": "MESSAGE_ATTRIBUTE_VALUE", + "MessageNotInflight": "MESSAGE_NOT_INFLIGHT", + "MessageSystemAttributeName": "MESSAGE_SYSTEM_ATTRIBUTE_NAME", + "MessageSystemAttributeNameForSends": "MESSAGE_SYSTEM_ATTRIBUTE_NAME_FOR_SENDS", + "MessageSystemAttributeValue": "MESSAGE_SYSTEM_ATTRIBUTE_VALUE", + "OverLimit": "OVER_LIMIT", + "PurgeQueueInProgress": "PURGE_QUEUE_IN_PROGRESS", + "PurgeQueueInput": "PURGE_QUEUE_INPUT", + "PurgeQueueOutput": "PURGE_QUEUE_OUTPUT", + "QueueAttributeName": "QUEUE_ATTRIBUTE_NAME", + "QueueDeletedRecently": "QUEUE_DELETED_RECENTLY", + "QueueDoesNotExist": "QUEUE_DOES_NOT_EXIST", + "QueueNameExists": "QUEUE_NAME_EXISTS", + "ReceiptHandleIsInvalid": "RECEIPT_HANDLE_IS_INVALID", + "ReceiveMessageInput": "RECEIVE_MESSAGE_INPUT", + "ReceiveMessageOutput": "RECEIVE_MESSAGE_OUTPUT", + "RemovePermissionInput": "REMOVE_PERMISSION_INPUT", + "RemovePermissionOutput": "REMOVE_PERMISSION_OUTPUT", + "RequestThrottled": "REQUEST_THROTTLED", + "ResourceNotFoundException": "RESOURCE_NOT_FOUND_EXCEPTION", + "SendMessageBatchInput": "SEND_MESSAGE_BATCH_INPUT", + "SendMessageBatchOutput": "SEND_MESSAGE_BATCH_OUTPUT", + "SendMessageBatchRequestEntry": "SEND_MESSAGE_BATCH_REQUEST_ENTRY", + "SendMessageBatchResultEntry": "SEND_MESSAGE_BATCH_RESULT_ENTRY", + "SendMessageInput": "SEND_MESSAGE_INPUT", + "SendMessageOutput": "SEND_MESSAGE_OUTPUT", + "SetQueueAttributesInput": "SET_QUEUE_ATTRIBUTES_INPUT", + "SetQueueAttributesOutput": "SET_QUEUE_ATTRIBUTES_OUTPUT", + "StartMessageMoveTaskInput": "START_MESSAGE_MOVE_TASK_INPUT", + "StartMessageMoveTaskOutput": "START_MESSAGE_MOVE_TASK_OUTPUT", + "TagQueueInput": "TAG_QUEUE_INPUT", + "TagQueueOutput": "TAG_QUEUE_OUTPUT", + "TooManyEntriesInBatchRequest": "TOO_MANY_ENTRIES_IN_BATCH_REQUEST", + "UnsupportedOperation": "UNSUPPORTED_OPERATION", + "UntagQueueInput": "UNTAG_QUEUE_INPUT", + "UntagQueueOutput": "UNTAG_QUEUE_OUTPUT", + }, + shape_names=frozenset( { - ShapeID( - "com.amazonaws.sqs#BatchEntryIdsNotDistinct" - ): BatchEntryIdsNotDistinct, - ShapeID("com.amazonaws.sqs#BatchRequestTooLong"): BatchRequestTooLong, - ShapeID("com.amazonaws.sqs#EmptyBatchRequest"): EmptyBatchRequest, - ShapeID("com.amazonaws.sqs#InvalidAddress"): InvalidAddress, - ShapeID("com.amazonaws.sqs#InvalidBatchEntryId"): InvalidBatchEntryId, - ShapeID("com.amazonaws.sqs#InvalidSecurity"): InvalidSecurity, - ShapeID("com.amazonaws.sqs#KmsAccessDenied"): KmsAccessDenied, - ShapeID("com.amazonaws.sqs#KmsDisabled"): KmsDisabled, - ShapeID("com.amazonaws.sqs#KmsInvalidKeyUsage"): KmsInvalidKeyUsage, - ShapeID("com.amazonaws.sqs#KmsInvalidState"): KmsInvalidState, - ShapeID("com.amazonaws.sqs#KmsNotFound"): KmsNotFound, - ShapeID("com.amazonaws.sqs#KmsOptInRequired"): KmsOptInRequired, - ShapeID("com.amazonaws.sqs#KmsThrottled"): KmsThrottled, - ShapeID("com.amazonaws.sqs#QueueDoesNotExist"): QueueDoesNotExist, - ShapeID("com.amazonaws.sqs#RequestThrottled"): RequestThrottled, - ShapeID( - "com.amazonaws.sqs#TooManyEntriesInBatchRequest" - ): TooManyEntriesInBatchRequest, - ShapeID("com.amazonaws.sqs#UnsupportedOperation"): UnsupportedOperation, + "AddPermissionInput", + "AddPermissionOutput", + "BatchEntryIdsNotDistinct", + "BatchRequestTooLong", + "BatchResultErrorEntry", + "CancelMessageMoveTaskInput", + "CancelMessageMoveTaskOutput", + "ChangeMessageVisibilityBatchInput", + "ChangeMessageVisibilityBatchOutput", + "ChangeMessageVisibilityBatchRequestEntry", + "ChangeMessageVisibilityBatchResultEntry", + "ChangeMessageVisibilityInput", + "ChangeMessageVisibilityOutput", + "CreateQueueInput", + "CreateQueueOutput", + "DeleteMessageBatchInput", + "DeleteMessageBatchOutput", + "DeleteMessageBatchRequestEntry", + "DeleteMessageBatchResultEntry", + "DeleteMessageInput", + "DeleteMessageOutput", + "DeleteQueueInput", + "DeleteQueueOutput", + "EmptyBatchRequest", + "GetQueueAttributesInput", + "GetQueueAttributesOutput", + "GetQueueUrlInput", + "GetQueueUrlOutput", + "InvalidAddress", + "InvalidAttributeName", + "InvalidAttributeValue", + "InvalidBatchEntryId", + "InvalidIdFormat", + "InvalidMessageContents", + "InvalidSecurity", + "KmsAccessDenied", + "KmsDisabled", + "KmsInvalidKeyUsage", + "KmsInvalidState", + "KmsNotFound", + "KmsOptInRequired", + "KmsThrottled", + "ListDeadLetterSourceQueuesInput", + "ListDeadLetterSourceQueuesOutput", + "ListMessageMoveTasksInput", + "ListMessageMoveTasksOutput", + "ListMessageMoveTasksResultEntry", + "ListQueueTagsInput", + "ListQueueTagsOutput", + "ListQueuesInput", + "ListQueuesOutput", + "Message", + "MessageAttributeValue", + "MessageNotInflight", + "MessageSystemAttributeName", + "MessageSystemAttributeNameForSends", + "MessageSystemAttributeValue", + "OverLimit", + "PurgeQueueInProgress", + "PurgeQueueInput", + "PurgeQueueOutput", + "QueueAttributeName", + "QueueDeletedRecently", + "QueueDoesNotExist", + "QueueNameExists", + "ReceiptHandleIsInvalid", + "ReceiveMessageInput", + "ReceiveMessageOutput", + "RemovePermissionInput", + "RemovePermissionOutput", + "RequestThrottled", + "ResourceNotFoundException", + "SendMessageBatchInput", + "SendMessageBatchOutput", + "SendMessageBatchRequestEntry", + "SendMessageBatchResultEntry", + "SendMessageInput", + "SendMessageOutput", + "SetQueueAttributesInput", + "SetQueueAttributesOutput", + "StartMessageMoveTaskInput", + "StartMessageMoveTaskOutput", + "TagQueueInput", + "TagQueueOutput", + "TooManyEntriesInBatchRequest", + "UnsupportedOperation", + "UntagQueueInput", + "UntagQueueOutput", } ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BATCH_ENTRY_IDS_NOT_DISTINCT, - _SCHEMA_BATCH_REQUEST_TOO_LONG, - _SCHEMA_EMPTY_BATCH_REQUEST, - _SCHEMA_INVALID_ADDRESS, - _SCHEMA_INVALID_BATCH_ENTRY_ID, - _SCHEMA_INVALID_SECURITY, - _SCHEMA_KMS_ACCESS_DENIED, - _SCHEMA_KMS_DISABLED, - _SCHEMA_KMS_INVALID_KEY_USAGE, - _SCHEMA_KMS_INVALID_STATE, - _SCHEMA_KMS_NOT_FOUND, - _SCHEMA_KMS_OPT_IN_REQUIRED, - _SCHEMA_KMS_THROTTLED, - _SCHEMA_QUEUE_DOES_NOT_EXIST, - _SCHEMA_REQUEST_THROTTLED, - _SCHEMA_TOO_MANY_ENTRIES_IN_BATCH_REQUEST, - _SCHEMA_UNSUPPORTED_OPERATION, - ], + service_error="ServiceError", ) -@dataclass(kw_only=True) -class SetQueueAttributesInput: - """""" - - queue_url: str | None = None - """ - The URL of the Amazon SQS queue whose attributes are set. - - Queue URLs and names are case-sensitive. - """ - - attributes: dict[str, str] | None = None - """ - A map of attributes to set. - - The following lists the names, descriptions, and values of the special - request parameters that the `SetQueueAttributes` action uses: - - - `DelaySeconds` -- The length of time, in seconds, for which the - delivery of all messages in the queue is delayed. Valid values: An - integer from 0 to 900 (15 minutes). Default: 0. - - - `MaximumMessageSize` -- The limit of how many bytes a message can - contain before Amazon SQS rejects it. Valid values: An integer from - 1,024 bytes (1 KiB) up to 1,048,576 bytes (1 MiB). Default: 1,048,576 - bytes (1 MiB). - - - `MessageRetentionPeriod` -- The length of time, in seconds, for which - Amazon SQS retains a message. Valid values: An integer representing - seconds, from 60 (1 minute) to 1,209,600 (14 days). Default: 345,600 - (4 days). When you change a queue's attributes, the change can take - up to 60 seconds for most of the attributes to propagate throughout - the Amazon SQS system. Changes made to the `MessageRetentionPeriod` - attribute can take up to 15 minutes and will impact existing messages - in the queue potentially causing them to be expired and deleted if the - `MessageRetentionPeriod` is reduced below the age of existing - messages. - - - `Policy` -- The queue's policy. A valid Amazon Web Services policy. - For more information about policy structure, see [Overview of Amazon - Web Services IAM - Policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/PoliciesOverview.html) - in the *Identity and Access Management User Guide*. - - - `ReceiveMessageWaitTimeSeconds` -- The length of time, in seconds, for - which a ` ``ReceiveMessage`` ` action waits for a message to arrive. - Valid values: An integer from 0 to 20 (seconds). Default: 0. - - - `VisibilityTimeout` -- The visibility timeout for the queue, in - seconds. Valid values: An integer from 0 to 43,200 (12 hours). - Default: 30. For more information about the visibility timeout, see - [Visibility - Timeout](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html) - in the *Amazon SQS Developer Guide*. - - The following attributes apply only to [dead-letter - queues:](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html) - - - `RedrivePolicy` -- The string that includes the parameters for the - dead-letter queue functionality of the source queue as a JSON object. - The parameters are as follows: - - - `deadLetterTargetArn` -- The Amazon Resource Name (ARN) of the - dead-letter queue to which Amazon SQS moves messages after the value - of `maxReceiveCount` is exceeded. - - - `maxReceiveCount` -- The number of times a message is delivered to - the source queue before being moved to the dead-letter queue. - Default: 10. When the `ReceiveCount` for a message exceeds the - `maxReceiveCount` for a queue, Amazon SQS moves the message to the - dead-letter-queue. - - - `RedriveAllowPolicy` -- The string that includes the parameters for - the permissions for the dead-letter queue redrive permission and which - source queues can specify dead-letter queues as a JSON object. The - parameters are as follows: - - - `redrivePermission` -- The permission type that defines which source - queues can specify the current queue as the dead-letter queue. Valid - values are: - - - `allowAll` -- (Default) Any source queues in this Amazon Web - Services account in the same Region can specify this queue as the - dead-letter queue. - - - `denyAll` -- No source queues can specify this queue as the - dead-letter queue. - - - `byQueue` -- Only queues specified by the `sourceQueueArns` - parameter can specify this queue as the dead-letter queue. - - - `sourceQueueArns` -- The Amazon Resource Names (ARN)s of the source - queues that can specify this queue as the dead-letter queue and - redrive messages. You can specify this parameter only when the - `redrivePermission` parameter is set to `byQueue`. You can specify - up to 10 source queue ARNs. To allow more than 10 source queues to - specify dead-letter queues, set the `redrivePermission` parameter to - `allowAll`. - - Note: - The dead-letter queue of a FIFO queue must also be a FIFO queue. - Similarly, the dead-letter queue of a standard queue must also be a - standard queue. - - The following attributes apply only to - [server-side-encryption](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html): +def __getattr__(name: str): + return _registry.build(name) - - `KmsMasterKeyId` -- The ID of an Amazon Web Services managed customer - master key (CMK) for Amazon SQS or a custom CMK. For more information, - see [Key - Terms](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-sse-key-terms). - While the alias of the AWS-managed CMK for Amazon SQS is always - `alias/aws/sqs`, the alias of a custom CMK can, for example, be - `alias/`*`MyAlias`*` `. For more examples, see - [KeyId](https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters) - in the *Key Management Service API Reference*. - - `KmsDataKeyReusePeriodSeconds` -- The length of time, in seconds, for - which Amazon SQS can reuse a [data - key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#data-keys) - to encrypt or decrypt messages before calling KMS again. An integer - representing seconds, between 60 seconds (1 minute) and 86,400 seconds - (24 hours). Default: 300 (5 minutes). A shorter time period provides - better security but results in more calls to KMS which might incur - charges after Free Tier. For more information, see [How Does the Data - Key Reuse Period - Work?](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-how-does-the-data-key-reuse-period-work). - - - `SqsManagedSseEnabled` -- Enables server-side queue encryption using - SQS owned encryption keys. Only one server-side encryption option is - supported per queue (for example, - [SSE-KMS](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sse-existing-queue.html) - or - [SSE-SQS](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sqs-sse-queue.html)). - - The following attribute applies only to [FIFO (first-in-first-out) - queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html): - - - `ContentBasedDeduplication` -- Enables content-based deduplication. - For more information, see [Exactly-once - processing](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues-exactly-once-processing.html) - in the *Amazon SQS Developer Guide*. Note the following: - - - Every message must have a unique `MessageDeduplicationId`. - - - You may provide a `MessageDeduplicationId` explicitly. - - - If you aren't able to provide a `MessageDeduplicationId` and you - enable `ContentBasedDeduplication` for your queue, Amazon SQS uses - a SHA-256 hash to generate the `MessageDeduplicationId` using the - body of the message (but not the attributes of the message). - - - If you don't provide a `MessageDeduplicationId` and the queue - doesn't have `ContentBasedDeduplication` set, the action fails - with an error. - - - If the queue has `ContentBasedDeduplication` set, your - `MessageDeduplicationId` overrides the generated one. - - - When `ContentBasedDeduplication` is in effect, messages with - identical content sent within the deduplication interval are treated - as duplicates and only one copy of the message is delivered. - - - If you send one message with `ContentBasedDeduplication` enabled and - then another message with a `MessageDeduplicationId` that is the - same as the one generated for the first `MessageDeduplicationId`, - the two messages are treated as duplicates and only one copy of the - message is delivered. - - The following attributes apply only to [high throughput for FIFO - queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/high-throughput-fifo.html): - - - `DeduplicationScope` -- Specifies whether message deduplication occurs - at the message group or queue level. Valid values are `messageGroup` - and `queue`. - - - `FifoThroughputLimit` -- Specifies whether the FIFO queue throughput - quota applies to the entire queue or per message group. Valid values - are `perQueue` and `perMessageGroupId`. The `perMessageGroupId` value - is allowed only when the value for `DeduplicationScope` is - `messageGroup`. - - To enable high throughput for FIFO queues, do the following: - - - Set `DeduplicationScope` to `messageGroup`. - - - Set `FifoThroughputLimit` to `perMessageGroupId`. - - If you set these attributes to anything other than the values shown for - enabling high throughput, normal throughput is in effect and - deduplication occurs as specified. - - For information on throughput quotas, see [Quotas related to - messages](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/quotas-messages.html) - in the *Amazon SQS Developer Guide*. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SET_QUEUE_ATTRIBUTES_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.queue_url is not None: - serializer.write_string( - _SCHEMA_SET_QUEUE_ATTRIBUTES_INPUT.members["QueueUrl"], self.queue_url - ) - - if self.attributes is not None: - _serialize_queue_attribute_map( - serializer, - _SCHEMA_SET_QUEUE_ATTRIBUTES_INPUT.members["Attributes"], - self.attributes, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["queue_url"] = de.read_string( - _SCHEMA_SET_QUEUE_ATTRIBUTES_INPUT.members["QueueUrl"] - ) - - case 1: - kwargs["attributes"] = _deserialize_queue_attribute_map( - de, _SCHEMA_SET_QUEUE_ATTRIBUTES_INPUT.members["Attributes"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_SET_QUEUE_ATTRIBUTES_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class SetQueueAttributesOutput: - """Dataclass for SetQueueAttributesOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SET_QUEUE_ATTRIBUTES_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SET_QUEUE_ATTRIBUTES_OUTPUT, consumer=_consumer - ) - return kwargs - - -SET_QUEUE_ATTRIBUTES = APIOperation( - input=SetQueueAttributesInput, - output=SetQueueAttributesOutput, - schema=_SCHEMA_SET_QUEUE_ATTRIBUTES, - input_schema=_SCHEMA_SET_QUEUE_ATTRIBUTES_INPUT, - output_schema=_SCHEMA_SET_QUEUE_ATTRIBUTES_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.sqs#InvalidAddress"): InvalidAddress, - ShapeID("com.amazonaws.sqs#InvalidAttributeName"): InvalidAttributeName, - ShapeID("com.amazonaws.sqs#InvalidAttributeValue"): InvalidAttributeValue, - ShapeID("com.amazonaws.sqs#InvalidSecurity"): InvalidSecurity, - ShapeID("com.amazonaws.sqs#OverLimit"): OverLimit, - ShapeID("com.amazonaws.sqs#QueueDoesNotExist"): QueueDoesNotExist, - ShapeID("com.amazonaws.sqs#RequestThrottled"): RequestThrottled, - ShapeID("com.amazonaws.sqs#UnsupportedOperation"): UnsupportedOperation, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_ADDRESS, - _SCHEMA_INVALID_ATTRIBUTE_NAME, - _SCHEMA_INVALID_ATTRIBUTE_VALUE, - _SCHEMA_INVALID_SECURITY, - _SCHEMA_OVER_LIMIT, - _SCHEMA_QUEUE_DOES_NOT_EXIST, - _SCHEMA_REQUEST_THROTTLED, - _SCHEMA_UNSUPPORTED_OPERATION, +ADD_PERMISSION: APIOperation[AddPermissionInput, AddPermissionOutput] = APIOperation( + static_schema=_SCHEMA_ADD_PERMISSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sqs#InvalidAddress"), + ShapeID("com.amazonaws.sqs#InvalidSecurity"), + ShapeID("com.amazonaws.sqs#OverLimit"), + ShapeID("com.amazonaws.sqs#QueueDoesNotExist"), + ShapeID("com.amazonaws.sqs#RequestThrottled"), + ShapeID("com.amazonaws.sqs#UnsupportedOperation"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) - -@dataclass(kw_only=True) -class StartMessageMoveTaskInput: - """Dataclass for StartMessageMoveTaskInput structure.""" - - source_arn: str | None = None - """ - The ARN of the queue that contains the messages to be moved to another - queue. Currently, only ARNs of dead-letter queues (DLQs) whose sources - are other Amazon SQS queues are accepted. DLQs whose sources are non-SQS - queues, such as Lambda or Amazon SNS topics, are not currently - supported. - """ - - destination_arn: str | None = None - """ - The ARN of the queue that receives the moved messages. You can use this - field to specify the destination queue where you would like to redrive - messages. If this field is left blank, the messages will be redriven - back to their respective original source queues. - """ - - max_number_of_messages_per_second: int | None = None - """ - The number of messages to be moved per second (the message movement - rate). You can use this field to define a fixed message movement rate. - The maximum value for messages per second is 500. If this field is left - blank, the system will optimize the rate based on the queue message - backlog size, which may vary throughout the duration of the message - movement task. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_MESSAGE_MOVE_TASK_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.source_arn is not None: - serializer.write_string( - _SCHEMA_START_MESSAGE_MOVE_TASK_INPUT.members["SourceArn"], - self.source_arn, - ) - - if self.destination_arn is not None: - serializer.write_string( - _SCHEMA_START_MESSAGE_MOVE_TASK_INPUT.members["DestinationArn"], - self.destination_arn, - ) - - if self.max_number_of_messages_per_second is not None: - serializer.write_integer( - _SCHEMA_START_MESSAGE_MOVE_TASK_INPUT.members[ - "MaxNumberOfMessagesPerSecond" - ], - self.max_number_of_messages_per_second, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["source_arn"] = de.read_string( - _SCHEMA_START_MESSAGE_MOVE_TASK_INPUT.members["SourceArn"] - ) - - case 1: - kwargs["destination_arn"] = de.read_string( - _SCHEMA_START_MESSAGE_MOVE_TASK_INPUT.members["DestinationArn"] - ) - - case 2: - kwargs["max_number_of_messages_per_second"] = de.read_integer( - _SCHEMA_START_MESSAGE_MOVE_TASK_INPUT.members[ - "MaxNumberOfMessagesPerSecond" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_START_MESSAGE_MOVE_TASK_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class StartMessageMoveTaskOutput: - """Dataclass for StartMessageMoveTaskOutput structure.""" - - task_handle: str | None = None - """ - An identifier associated with a message movement task. You can use this - identifier to cancel a specified message movement task using the - `CancelMessageMoveTask` action. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_MESSAGE_MOVE_TASK_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.task_handle is not None: - serializer.write_string( - _SCHEMA_START_MESSAGE_MOVE_TASK_OUTPUT.members["TaskHandle"], - self.task_handle, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["task_handle"] = de.read_string( - _SCHEMA_START_MESSAGE_MOVE_TASK_OUTPUT.members["TaskHandle"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_START_MESSAGE_MOVE_TASK_OUTPUT, consumer=_consumer - ) - return kwargs - - -START_MESSAGE_MOVE_TASK = APIOperation( - input=StartMessageMoveTaskInput, - output=StartMessageMoveTaskOutput, - schema=_SCHEMA_START_MESSAGE_MOVE_TASK, - input_schema=_SCHEMA_START_MESSAGE_MOVE_TASK_INPUT, - output_schema=_SCHEMA_START_MESSAGE_MOVE_TASK_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.sqs#InvalidAddress"): InvalidAddress, - ShapeID("com.amazonaws.sqs#InvalidSecurity"): InvalidSecurity, - ShapeID("com.amazonaws.sqs#RequestThrottled"): RequestThrottled, - ShapeID( - "com.amazonaws.sqs#ResourceNotFoundException" - ): ResourceNotFoundException, - ShapeID("com.amazonaws.sqs#UnsupportedOperation"): UnsupportedOperation, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_ADDRESS, - _SCHEMA_INVALID_SECURITY, - _SCHEMA_REQUEST_THROTTLED, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - _SCHEMA_UNSUPPORTED_OPERATION, +CANCEL_MESSAGE_MOVE_TASK: APIOperation[ + CancelMessageMoveTaskInput, CancelMessageMoveTaskOutput +] = APIOperation( + static_schema=_SCHEMA_CANCEL_MESSAGE_MOVE_TASK, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sqs#InvalidAddress"), + ShapeID("com.amazonaws.sqs#InvalidSecurity"), + ShapeID("com.amazonaws.sqs#RequestThrottled"), + ShapeID("com.amazonaws.sqs#ResourceNotFoundException"), + ShapeID("com.amazonaws.sqs#UnsupportedOperation"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) +CHANGE_MESSAGE_VISIBILITY: APIOperation[ + ChangeMessageVisibilityInput, ChangeMessageVisibilityOutput +] = APIOperation( + static_schema=_SCHEMA_CHANGE_MESSAGE_VISIBILITY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sqs#InvalidAddress"), + ShapeID("com.amazonaws.sqs#InvalidSecurity"), + ShapeID("com.amazonaws.sqs#MessageNotInflight"), + ShapeID("com.amazonaws.sqs#QueueDoesNotExist"), + ShapeID("com.amazonaws.sqs#ReceiptHandleIsInvalid"), + ShapeID("com.amazonaws.sqs#RequestThrottled"), + ShapeID("com.amazonaws.sqs#UnsupportedOperation"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -@dataclass(kw_only=True) -class TagQueueInput: - """Dataclass for TagQueueInput structure.""" - - queue_url: str | None = None - """The URL of the queue.""" +CHANGE_MESSAGE_VISIBILITY_BATCH: APIOperation[ + ChangeMessageVisibilityBatchInput, ChangeMessageVisibilityBatchOutput +] = APIOperation( + static_schema=_SCHEMA_CHANGE_MESSAGE_VISIBILITY_BATCH, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sqs#BatchEntryIdsNotDistinct"), + ShapeID("com.amazonaws.sqs#EmptyBatchRequest"), + ShapeID("com.amazonaws.sqs#InvalidAddress"), + ShapeID("com.amazonaws.sqs#InvalidBatchEntryId"), + ShapeID("com.amazonaws.sqs#InvalidSecurity"), + ShapeID("com.amazonaws.sqs#QueueDoesNotExist"), + ShapeID("com.amazonaws.sqs#RequestThrottled"), + ShapeID("com.amazonaws.sqs#TooManyEntriesInBatchRequest"), + ShapeID("com.amazonaws.sqs#UnsupportedOperation"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - tags: dict[str, str] | None = None - """The list of tags to be added to the specified queue.""" +CREATE_QUEUE: APIOperation[CreateQueueInput, CreateQueueOutput] = APIOperation( + static_schema=_SCHEMA_CREATE_QUEUE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sqs#InvalidAddress"), + ShapeID("com.amazonaws.sqs#InvalidAttributeName"), + ShapeID("com.amazonaws.sqs#InvalidAttributeValue"), + ShapeID("com.amazonaws.sqs#InvalidSecurity"), + ShapeID("com.amazonaws.sqs#QueueDeletedRecently"), + ShapeID("com.amazonaws.sqs#QueueNameExists"), + ShapeID("com.amazonaws.sqs#RequestThrottled"), + ShapeID("com.amazonaws.sqs#UnsupportedOperation"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TAG_QUEUE_INPUT, self) +DELETE_MESSAGE: APIOperation[DeleteMessageInput, DeleteMessageOutput] = APIOperation( + static_schema=_SCHEMA_DELETE_MESSAGE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sqs#InvalidAddress"), + ShapeID("com.amazonaws.sqs#InvalidIdFormat"), + ShapeID("com.amazonaws.sqs#InvalidSecurity"), + ShapeID("com.amazonaws.sqs#QueueDoesNotExist"), + ShapeID("com.amazonaws.sqs#ReceiptHandleIsInvalid"), + ShapeID("com.amazonaws.sqs#RequestThrottled"), + ShapeID("com.amazonaws.sqs#UnsupportedOperation"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize_members(self, serializer: ShapeSerializer): - if self.queue_url is not None: - serializer.write_string( - _SCHEMA_TAG_QUEUE_INPUT.members["QueueUrl"], self.queue_url - ) +DELETE_MESSAGE_BATCH: APIOperation[ + DeleteMessageBatchInput, DeleteMessageBatchOutput +] = APIOperation( + static_schema=_SCHEMA_DELETE_MESSAGE_BATCH, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sqs#BatchEntryIdsNotDistinct"), + ShapeID("com.amazonaws.sqs#EmptyBatchRequest"), + ShapeID("com.amazonaws.sqs#InvalidAddress"), + ShapeID("com.amazonaws.sqs#InvalidBatchEntryId"), + ShapeID("com.amazonaws.sqs#InvalidSecurity"), + ShapeID("com.amazonaws.sqs#QueueDoesNotExist"), + ShapeID("com.amazonaws.sqs#RequestThrottled"), + ShapeID("com.amazonaws.sqs#TooManyEntriesInBatchRequest"), + ShapeID("com.amazonaws.sqs#UnsupportedOperation"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - if self.tags is not None: - _serialize_tag_map( - serializer, _SCHEMA_TAG_QUEUE_INPUT.members["Tags"], self.tags - ) +DELETE_QUEUE: APIOperation[DeleteQueueInput, DeleteQueueOutput] = APIOperation( + static_schema=_SCHEMA_DELETE_QUEUE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sqs#InvalidAddress"), + ShapeID("com.amazonaws.sqs#InvalidSecurity"), + ShapeID("com.amazonaws.sqs#QueueDoesNotExist"), + ShapeID("com.amazonaws.sqs#RequestThrottled"), + ShapeID("com.amazonaws.sqs#UnsupportedOperation"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) +GET_QUEUE_ATTRIBUTES: APIOperation[ + GetQueueAttributesInput, GetQueueAttributesOutput +] = APIOperation( + static_schema=_SCHEMA_GET_QUEUE_ATTRIBUTES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sqs#InvalidAddress"), + ShapeID("com.amazonaws.sqs#InvalidAttributeName"), + ShapeID("com.amazonaws.sqs#InvalidSecurity"), + ShapeID("com.amazonaws.sqs#QueueDoesNotExist"), + ShapeID("com.amazonaws.sqs#RequestThrottled"), + ShapeID("com.amazonaws.sqs#UnsupportedOperation"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +GET_QUEUE_URL: APIOperation[GetQueueUrlInput, GetQueueUrlOutput] = APIOperation( + static_schema=_SCHEMA_GET_QUEUE_URL, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sqs#InvalidAddress"), + ShapeID("com.amazonaws.sqs#InvalidSecurity"), + ShapeID("com.amazonaws.sqs#QueueDoesNotExist"), + ShapeID("com.amazonaws.sqs#RequestThrottled"), + ShapeID("com.amazonaws.sqs#UnsupportedOperation"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["queue_url"] = de.read_string( - _SCHEMA_TAG_QUEUE_INPUT.members["QueueUrl"] - ) +LIST_DEAD_LETTER_SOURCE_QUEUES: APIOperation[ + ListDeadLetterSourceQueuesInput, ListDeadLetterSourceQueuesOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_DEAD_LETTER_SOURCE_QUEUES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sqs#InvalidAddress"), + ShapeID("com.amazonaws.sqs#InvalidSecurity"), + ShapeID("com.amazonaws.sqs#QueueDoesNotExist"), + ShapeID("com.amazonaws.sqs#RequestThrottled"), + ShapeID("com.amazonaws.sqs#UnsupportedOperation"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case 1: - kwargs["tags"] = _deserialize_tag_map( - de, _SCHEMA_TAG_QUEUE_INPUT.members["Tags"] - ) +LIST_MESSAGE_MOVE_TASKS: APIOperation[ + ListMessageMoveTasksInput, ListMessageMoveTasksOutput +] = APIOperation( + static_schema=_SCHEMA_LIST_MESSAGE_MOVE_TASKS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sqs#InvalidAddress"), + ShapeID("com.amazonaws.sqs#InvalidSecurity"), + ShapeID("com.amazonaws.sqs#RequestThrottled"), + ShapeID("com.amazonaws.sqs#ResourceNotFoundException"), + ShapeID("com.amazonaws.sqs#UnsupportedOperation"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - case _: - logger.debug("Unexpected member schema: %s", schema) +LIST_QUEUES: APIOperation[ListQueuesInput, ListQueuesOutput] = APIOperation( + static_schema=_SCHEMA_LIST_QUEUES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sqs#InvalidAddress"), + ShapeID("com.amazonaws.sqs#InvalidSecurity"), + ShapeID("com.amazonaws.sqs#RequestThrottled"), + ShapeID("com.amazonaws.sqs#UnsupportedOperation"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - deserializer.read_struct(_SCHEMA_TAG_QUEUE_INPUT, consumer=_consumer) - return kwargs +LIST_QUEUE_TAGS: APIOperation[ListQueueTagsInput, ListQueueTagsOutput] = APIOperation( + static_schema=_SCHEMA_LIST_QUEUE_TAGS, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sqs#InvalidAddress"), + ShapeID("com.amazonaws.sqs#InvalidSecurity"), + ShapeID("com.amazonaws.sqs#QueueDoesNotExist"), + ShapeID("com.amazonaws.sqs#RequestThrottled"), + ShapeID("com.amazonaws.sqs#UnsupportedOperation"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +PURGE_QUEUE: APIOperation[PurgeQueueInput, PurgeQueueOutput] = APIOperation( + static_schema=_SCHEMA_PURGE_QUEUE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sqs#InvalidAddress"), + ShapeID("com.amazonaws.sqs#InvalidSecurity"), + ShapeID("com.amazonaws.sqs#PurgeQueueInProgress"), + ShapeID("com.amazonaws.sqs#QueueDoesNotExist"), + ShapeID("com.amazonaws.sqs#RequestThrottled"), + ShapeID("com.amazonaws.sqs#UnsupportedOperation"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -@dataclass(kw_only=True) -class TagQueueOutput: - """Dataclass for TagQueueOutput structure.""" +RECEIVE_MESSAGE: APIOperation[ReceiveMessageInput, ReceiveMessageOutput] = APIOperation( + static_schema=_SCHEMA_RECEIVE_MESSAGE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sqs#InvalidAddress"), + ShapeID("com.amazonaws.sqs#InvalidSecurity"), + ShapeID("com.amazonaws.sqs#KmsAccessDenied"), + ShapeID("com.amazonaws.sqs#KmsDisabled"), + ShapeID("com.amazonaws.sqs#KmsInvalidKeyUsage"), + ShapeID("com.amazonaws.sqs#KmsInvalidState"), + ShapeID("com.amazonaws.sqs#KmsNotFound"), + ShapeID("com.amazonaws.sqs#KmsOptInRequired"), + ShapeID("com.amazonaws.sqs#KmsThrottled"), + ShapeID("com.amazonaws.sqs#OverLimit"), + ShapeID("com.amazonaws.sqs#QueueDoesNotExist"), + ShapeID("com.amazonaws.sqs#RequestThrottled"), + ShapeID("com.amazonaws.sqs#UnsupportedOperation"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False +REMOVE_PERMISSION: APIOperation[RemovePermissionInput, RemovePermissionOutput] = ( + APIOperation( + static_schema=_SCHEMA_REMOVE_PERMISSION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sqs#InvalidAddress"), + ShapeID("com.amazonaws.sqs#InvalidSecurity"), + ShapeID("com.amazonaws.sqs#QueueDoesNotExist"), + ShapeID("com.amazonaws.sqs#RequestThrottled"), + ShapeID("com.amazonaws.sqs#UnsupportedOperation"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TAG_QUEUE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TAG_QUEUE_OUTPUT, consumer=_consumer) - return kwargs - +) -TAG_QUEUE = APIOperation( - input=TagQueueInput, - output=TagQueueOutput, - schema=_SCHEMA_TAG_QUEUE, - input_schema=_SCHEMA_TAG_QUEUE_INPUT, - output_schema=_SCHEMA_TAG_QUEUE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.sqs#InvalidAddress"): InvalidAddress, - ShapeID("com.amazonaws.sqs#InvalidSecurity"): InvalidSecurity, - ShapeID("com.amazonaws.sqs#QueueDoesNotExist"): QueueDoesNotExist, - ShapeID("com.amazonaws.sqs#RequestThrottled"): RequestThrottled, - ShapeID("com.amazonaws.sqs#UnsupportedOperation"): UnsupportedOperation, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_ADDRESS, - _SCHEMA_INVALID_SECURITY, - _SCHEMA_QUEUE_DOES_NOT_EXIST, - _SCHEMA_REQUEST_THROTTLED, - _SCHEMA_UNSUPPORTED_OPERATION, +SEND_MESSAGE: APIOperation[SendMessageInput, SendMessageOutput] = APIOperation( + static_schema=_SCHEMA_SEND_MESSAGE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sqs#InvalidAddress"), + ShapeID("com.amazonaws.sqs#InvalidMessageContents"), + ShapeID("com.amazonaws.sqs#InvalidSecurity"), + ShapeID("com.amazonaws.sqs#KmsAccessDenied"), + ShapeID("com.amazonaws.sqs#KmsDisabled"), + ShapeID("com.amazonaws.sqs#KmsInvalidKeyUsage"), + ShapeID("com.amazonaws.sqs#KmsInvalidState"), + ShapeID("com.amazonaws.sqs#KmsNotFound"), + ShapeID("com.amazonaws.sqs#KmsOptInRequired"), + ShapeID("com.amazonaws.sqs#KmsThrottled"), + ShapeID("com.amazonaws.sqs#QueueDoesNotExist"), + ShapeID("com.amazonaws.sqs#RequestThrottled"), + ShapeID("com.amazonaws.sqs#UnsupportedOperation"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) - -def _serialize_tag_key_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_tag_key_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class UntagQueueInput: - """Dataclass for UntagQueueInput structure.""" - - queue_url: str | None = None - """The URL of the queue.""" - - tag_keys: list[str] | None = None - """The list of tags to be removed from the specified queue.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNTAG_QUEUE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.queue_url is not None: - serializer.write_string( - _SCHEMA_UNTAG_QUEUE_INPUT.members["QueueUrl"], self.queue_url - ) - - if self.tag_keys is not None: - _serialize_tag_key_list( - serializer, _SCHEMA_UNTAG_QUEUE_INPUT.members["TagKeys"], self.tag_keys - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["queue_url"] = de.read_string( - _SCHEMA_UNTAG_QUEUE_INPUT.members["QueueUrl"] - ) - - case 1: - kwargs["tag_keys"] = _deserialize_tag_key_list( - de, _SCHEMA_UNTAG_QUEUE_INPUT.members["TagKeys"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UNTAG_QUEUE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class UntagQueueOutput: - """Dataclass for UntagQueueOutput structure.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False +SEND_MESSAGE_BATCH: APIOperation[SendMessageBatchInput, SendMessageBatchOutput] = ( + APIOperation( + static_schema=_SCHEMA_SEND_MESSAGE_BATCH, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sqs#BatchEntryIdsNotDistinct"), + ShapeID("com.amazonaws.sqs#BatchRequestTooLong"), + ShapeID("com.amazonaws.sqs#EmptyBatchRequest"), + ShapeID("com.amazonaws.sqs#InvalidAddress"), + ShapeID("com.amazonaws.sqs#InvalidBatchEntryId"), + ShapeID("com.amazonaws.sqs#InvalidSecurity"), + ShapeID("com.amazonaws.sqs#KmsAccessDenied"), + ShapeID("com.amazonaws.sqs#KmsDisabled"), + ShapeID("com.amazonaws.sqs#KmsInvalidKeyUsage"), + ShapeID("com.amazonaws.sqs#KmsInvalidState"), + ShapeID("com.amazonaws.sqs#KmsNotFound"), + ShapeID("com.amazonaws.sqs#KmsOptInRequired"), + ShapeID("com.amazonaws.sqs#KmsThrottled"), + ShapeID("com.amazonaws.sqs#QueueDoesNotExist"), + ShapeID("com.amazonaws.sqs#RequestThrottled"), + ShapeID("com.amazonaws.sqs#TooManyEntriesInBatchRequest"), + ShapeID("com.amazonaws.sqs#UnsupportedOperation"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UNTAG_QUEUE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) +) - deserializer.read_struct(_SCHEMA_UNTAG_QUEUE_OUTPUT, consumer=_consumer) - return kwargs +SET_QUEUE_ATTRIBUTES: APIOperation[ + SetQueueAttributesInput, SetQueueAttributesOutput +] = APIOperation( + static_schema=_SCHEMA_SET_QUEUE_ATTRIBUTES, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sqs#InvalidAddress"), + ShapeID("com.amazonaws.sqs#InvalidAttributeName"), + ShapeID("com.amazonaws.sqs#InvalidAttributeValue"), + ShapeID("com.amazonaws.sqs#InvalidSecurity"), + ShapeID("com.amazonaws.sqs#OverLimit"), + ShapeID("com.amazonaws.sqs#QueueDoesNotExist"), + ShapeID("com.amazonaws.sqs#RequestThrottled"), + ShapeID("com.amazonaws.sqs#UnsupportedOperation"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +START_MESSAGE_MOVE_TASK: APIOperation[ + StartMessageMoveTaskInput, StartMessageMoveTaskOutput +] = APIOperation( + static_schema=_SCHEMA_START_MESSAGE_MOVE_TASK, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sqs#InvalidAddress"), + ShapeID("com.amazonaws.sqs#InvalidSecurity"), + ShapeID("com.amazonaws.sqs#RequestThrottled"), + ShapeID("com.amazonaws.sqs#ResourceNotFoundException"), + ShapeID("com.amazonaws.sqs#UnsupportedOperation"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -UNTAG_QUEUE = APIOperation( - input=UntagQueueInput, - output=UntagQueueOutput, - schema=_SCHEMA_UNTAG_QUEUE, - input_schema=_SCHEMA_UNTAG_QUEUE_INPUT, - output_schema=_SCHEMA_UNTAG_QUEUE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.sqs#InvalidAddress"): InvalidAddress, - ShapeID("com.amazonaws.sqs#InvalidSecurity"): InvalidSecurity, - ShapeID("com.amazonaws.sqs#QueueDoesNotExist"): QueueDoesNotExist, - ShapeID("com.amazonaws.sqs#RequestThrottled"): RequestThrottled, - ShapeID("com.amazonaws.sqs#UnsupportedOperation"): UnsupportedOperation, - } - ), +TAG_QUEUE: APIOperation[TagQueueInput, TagQueueOutput] = APIOperation( + static_schema=_SCHEMA_TAG_QUEUE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sqs#InvalidAddress"), + ShapeID("com.amazonaws.sqs#InvalidSecurity"), + ShapeID("com.amazonaws.sqs#QueueDoesNotExist"), + ShapeID("com.amazonaws.sqs#RequestThrottled"), + ShapeID("com.amazonaws.sqs#UnsupportedOperation"), + ], effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_INVALID_ADDRESS, - _SCHEMA_INVALID_SECURITY, - _SCHEMA_QUEUE_DOES_NOT_EXIST, - _SCHEMA_REQUEST_THROTTLED, - _SCHEMA_UNSUPPORTED_OPERATION, +) + +UNTAG_QUEUE: APIOperation[UntagQueueInput, UntagQueueOutput] = APIOperation( + static_schema=_SCHEMA_UNTAG_QUEUE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sqs#InvalidAddress"), + ShapeID("com.amazonaws.sqs#InvalidSecurity"), + ShapeID("com.amazonaws.sqs#QueueDoesNotExist"), + ShapeID("com.amazonaws.sqs#RequestThrottled"), + ShapeID("com.amazonaws.sqs#UnsupportedOperation"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) diff --git a/clients/aws-sdk-sqs/src/aws_sdk_sqs/models.pyi b/clients/aws-sdk-sqs/src/aws_sdk_sqs/models.pyi new file mode 100644 index 00000000..3d370de1 --- /dev/null +++ b/clients/aws-sdk-sqs/src/aws_sdk_sqs/models.pyi @@ -0,0 +1,2699 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. + +from dataclasses import dataclass +from enum import StrEnum +from typing import Self + +from smithy_core.deserializers import ShapeDeserializer +from smithy_core.exceptions import ModeledError +from smithy_core.response import ResponseMetadata +from smithy_core.schemas import APIOperation +from smithy_core.serializers import ShapeSerializer +from smithy_core.types import UnknownEnumMixin + +class _SerdeShape: + def serialize(self, serializer: ShapeSerializer) -> None: ... + def serialize_members(self, serializer: ShapeSerializer) -> None: ... + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: ... + +class ServiceError(ModeledError): + """ + Base error for all errors in the service. + + Some exceptions do not extend from this class, including + synthetic, implicit, and shared exception types. + """ + +@dataclass(kw_only=True) +class AddPermissionInput(_SerdeShape): + """""" + + queue_url: str | None = ... + """ + The URL of the Amazon SQS queue to which permissions are added. + + Queue URLs and names are case-sensitive. + """ + label: str | None = ... + """ + The unique identification of the permission you're setting (for + example, `AliceSendMessage`). Maximum 80 characters. Allowed characters + include alphanumeric characters, hyphens (`-`), and underscores (`_`). + """ + aws_account_ids: list[str] | None = ... + """ + The Amazon Web Services account numbers of the + [principals](https://docs.aws.amazon.com/general/latest/gr/glos-chap.html#P) + who are to receive permission. For information about locating the Amazon + Web Services account identification, see [Your Amazon Web Services + Identifiers](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-making-api-requests.html#sqs-api-request-authentication) + in the *Amazon SQS Developer Guide*. + """ + actions: list[str] | None = ... + """ + The action the client wants to allow for the specified principal. Valid + values: the name of any action or `*`. + + For more information about these actions, see [Overview of Managing + Access Permissions to Your Amazon Simple Queue Service + Resource](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-overview-of-managing-access.html) + in the *Amazon SQS Developer Guide*. + + Specifying `SendMessage`, `DeleteMessage`, or `ChangeMessageVisibility` + for `ActionName.n` also grants permissions for the corresponding batch + versions of those actions: `SendMessageBatch`, `DeleteMessageBatch`, and + `ChangeMessageVisibilityBatch`. + """ + +@dataclass(kw_only=True) +class AddPermissionOutput(_SerdeShape): + """Dataclass for AddPermissionOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class BatchEntryIdsNotDistinct(ServiceError, _SerdeShape): + """Two or more batch entries in the request have the same `Id`.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class BatchRequestTooLong(ServiceError, _SerdeShape): + """The length of all the messages put together is more than the limit.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class BatchResultErrorEntry(_SerdeShape): + """ + Gives a detailed description of the result of an action on each entry in + the request. + """ + + id: str + """The `Id` of an entry in a batch request.""" + sender_fault: bool = ... + """ + Specifies whether the error happened due to the caller of the batch API + action. + """ + code: str + """An error code representing why the action failed on this entry.""" + message: str | None = ... + """A message explaining why the action failed on this entry.""" + +@dataclass(kw_only=True) +class CancelMessageMoveTaskInput(_SerdeShape): + """Dataclass for CancelMessageMoveTaskInput structure.""" + + task_handle: str | None = ... + """An identifier associated with a message movement task.""" + +@dataclass(kw_only=True) +class CancelMessageMoveTaskOutput(_SerdeShape): + """Dataclass for CancelMessageMoveTaskOutput structure.""" + + approximate_number_of_messages_moved: int = ... + """ + The approximate number of messages already moved to the destination + queue. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ChangeMessageVisibilityBatchInput(_SerdeShape): + """""" + + queue_url: str | None = ... + """ + The URL of the Amazon SQS queue whose messages' visibility is changed. + + Queue URLs and names are case-sensitive. + """ + entries: list[ChangeMessageVisibilityBatchRequestEntry] | None = ... + """ + Lists the receipt handles of the messages for which the visibility + timeout must be changed. + """ + +@dataclass(kw_only=True) +class ChangeMessageVisibilityBatchOutput(_SerdeShape): + """ + For each message in the batch, the response contains a + ` ``ChangeMessageVisibilityBatchResultEntry`` ` tag if the message + succeeds or a ` ``BatchResultErrorEntry`` ` tag if the message fails. + """ + + successful: list[ChangeMessageVisibilityBatchResultEntry] + """A list of ` ``ChangeMessageVisibilityBatchResultEntry`` ` items.""" + failed: list[BatchResultErrorEntry] + """A list of ` ``BatchResultErrorEntry`` ` items.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ChangeMessageVisibilityBatchRequestEntry(_SerdeShape): + """ + Encloses a receipt handle and an entry ID for each message in + ` ``ChangeMessageVisibilityBatch``.` + """ + + id: str + """ + An identifier for this particular receipt handle used to communicate the + result. + + Note: + The `Id`s of a batch request need to be unique within a request. + + This identifier can have up to 80 characters. The following characters + are accepted: alphanumeric characters, hyphens(-), and underscores (_). + """ + receipt_handle: str + """A receipt handle.""" + visibility_timeout: int | None = ... + """The new value (in seconds) for the message's visibility timeout.""" + +@dataclass(kw_only=True) +class ChangeMessageVisibilityBatchResultEntry(_SerdeShape): + """Encloses the `Id` of an entry in ` ``ChangeMessageVisibilityBatch``.`""" + + id: str + """ + Represents a message whose visibility timeout has been changed + successfully. + """ + +@dataclass(kw_only=True) +class ChangeMessageVisibilityInput(_SerdeShape): + """Dataclass for ChangeMessageVisibilityInput structure.""" + + queue_url: str | None = ... + """ + The URL of the Amazon SQS queue whose message's visibility is changed. + + Queue URLs and names are case-sensitive. + """ + receipt_handle: str | None = ... + """ + The receipt handle associated with the message, whose visibility timeout + is changed. This parameter is returned by the ` ``ReceiveMessage`` ` + action. + """ + visibility_timeout: int | None = ... + """ + The new value for the message's visibility timeout (in seconds). Values + range: `0` to `43200`. Maximum: 12 hours. + """ + +@dataclass(kw_only=True) +class ChangeMessageVisibilityOutput(_SerdeShape): + """Dataclass for ChangeMessageVisibilityOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CreateQueueInput(_SerdeShape): + """""" + + queue_name: str | None = ... + """ + The name of the new queue. The following limits apply to this name: + + - A queue name can have up to 80 characters. + + - Valid values: alphanumeric characters, hyphens (`-`), and underscores + (`_`). + + - A FIFO queue name must end with the `.fifo` suffix. + + Queue URLs and names are case-sensitive. + """ + attributes: dict[str, str] | None = ... + """ + A map of attributes with their corresponding values. + + The following lists the names, descriptions, and values of the special + request parameters that the `CreateQueue` action uses: + + - `DelaySeconds` -- The length of time, in seconds, for which the + delivery of all messages in the queue is delayed. Valid values: An + integer from 0 to 900 seconds (15 minutes). Default: 0. + + - `MaximumMessageSize` -- The limit of how many bytes a message can + contain before Amazon SQS rejects it. Valid values: An integer from + 1,024 bytes (1 KiB) to 1,048,576 bytes (1 MiB). Default: 1,048,576 + bytes (1 MiB). + + - `MessageRetentionPeriod` -- The length of time, in seconds, for which + Amazon SQS retains a message. Valid values: An integer from 60 seconds + (1 minute) to 1,209,600 seconds (14 days). Default: 345,600 (4 days). + When you change a queue's attributes, the change can take up to 60 + seconds for most of the attributes to propagate throughout the Amazon + SQS system. Changes made to the `MessageRetentionPeriod` attribute can + take up to 15 minutes and will impact existing messages in the queue + potentially causing them to be expired and deleted if the + `MessageRetentionPeriod` is reduced below the age of existing + messages. + + - `Policy` -- The queue's policy. A valid Amazon Web Services policy. + For more information about policy structure, see [Overview of Amazon + Web Services IAM + Policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/PoliciesOverview.html) + in the *IAM User Guide*. + + - `ReceiveMessageWaitTimeSeconds` -- The length of time, in seconds, for + which a ` ``ReceiveMessage`` ` action waits for a message to arrive. + Valid values: An integer from 0 to 20 (seconds). Default: 0. + + - `VisibilityTimeout` -- The visibility timeout for the queue, in + seconds. Valid values: An integer from 0 to 43,200 (12 hours). + Default: 30. For more information about the visibility timeout, see + [Visibility + Timeout](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html) + in the *Amazon SQS Developer Guide*. + + The following attributes apply only to [dead-letter + queues:](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html) + + - `RedrivePolicy` -- The string that includes the parameters for the + dead-letter queue functionality of the source queue as a JSON object. + The parameters are as follows: + + - `deadLetterTargetArn` -- The Amazon Resource Name (ARN) of the + dead-letter queue to which Amazon SQS moves messages after the value + of `maxReceiveCount` is exceeded. + + - `maxReceiveCount` -- The number of times a message is delivered to + the source queue before being moved to the dead-letter queue. + Default: 10. When the `ReceiveCount` for a message exceeds the + `maxReceiveCount` for a queue, Amazon SQS moves the message to the + dead-letter-queue. + + - `RedriveAllowPolicy` -- The string that includes the parameters for + the permissions for the dead-letter queue redrive permission and which + source queues can specify dead-letter queues as a JSON object. The + parameters are as follows: + + - `redrivePermission` -- The permission type that defines which source + queues can specify the current queue as the dead-letter queue. Valid + values are: + + - `allowAll` -- (Default) Any source queues in this Amazon Web + Services account in the same Region can specify this queue as the + dead-letter queue. + + - `denyAll` -- No source queues can specify this queue as the + dead-letter queue. + + - `byQueue` -- Only queues specified by the `sourceQueueArns` + parameter can specify this queue as the dead-letter queue. + + - `sourceQueueArns` -- The Amazon Resource Names (ARN)s of the source + queues that can specify this queue as the dead-letter queue and + redrive messages. You can specify this parameter only when the + `redrivePermission` parameter is set to `byQueue`. You can specify + up to 10 source queue ARNs. To allow more than 10 source queues to + specify dead-letter queues, set the `redrivePermission` parameter to + `allowAll`. + + Note: + The dead-letter queue of a FIFO queue must also be a FIFO queue. + Similarly, the dead-letter queue of a standard queue must also be a + standard queue. + + The following attributes apply only to + [server-side-encryption](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html): + + - `KmsMasterKeyId` -- The ID of an Amazon Web Services managed customer + master key (CMK) for Amazon SQS or a custom CMK. For more information, + see [Key + Terms](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-sse-key-terms). + While the alias of the Amazon Web Services managed CMK for Amazon SQS + is always `alias/aws/sqs`, the alias of a custom CMK can, for example, + be `alias/`*`MyAlias`*` `. For more examples, see + [KeyId](https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters) + in the *Key Management Service API Reference*. + + - `KmsDataKeyReusePeriodSeconds` -- The length of time, in seconds, for + which Amazon SQS can reuse a [data + key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#data-keys) + to encrypt or decrypt messages before calling KMS again. An integer + representing seconds, between 60 seconds (1 minute) and 86,400 seconds + (24 hours). Default: 300 (5 minutes). A shorter time period provides + better security but results in more calls to KMS which might incur + charges after Free Tier. For more information, see [How Does the Data + Key Reuse Period + Work?](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-how-does-the-data-key-reuse-period-work) + + - `SqsManagedSseEnabled` -- Enables server-side queue encryption using + SQS owned encryption keys. Only one server-side encryption option is + supported per queue (for example, + [SSE-KMS](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sse-existing-queue.html) + or + [SSE-SQS](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sqs-sse-queue.html)). + + The following attributes apply only to [FIFO (first-in-first-out) + queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html): + + - `FifoQueue` -- Designates a queue as FIFO. Valid values are `true` and + `false`. If you don't specify the `FifoQueue` attribute, Amazon SQS + creates a standard queue. You can provide this attribute only during + queue creation. You can't change it for an existing queue. When you + set this attribute, you must also provide the `MessageGroupId` for + your messages explicitly. + + For more information, see [FIFO queue + logic](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues-understanding-logic.html) + in the *Amazon SQS Developer Guide*. + + - `ContentBasedDeduplication` -- Enables content-based deduplication. + Valid values are `true` and `false`. For more information, see + [Exactly-once + processing](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues-exactly-once-processing.html) + in the *Amazon SQS Developer Guide*. Note the following: + + - Every message must have a unique `MessageDeduplicationId`. + + - You may provide a `MessageDeduplicationId` explicitly. + + - If you aren't able to provide a `MessageDeduplicationId` and you + enable `ContentBasedDeduplication` for your queue, Amazon SQS uses + a SHA-256 hash to generate the `MessageDeduplicationId` using the + body of the message (but not the attributes of the message). + + - If you don't provide a `MessageDeduplicationId` and the queue + doesn't have `ContentBasedDeduplication` set, the action fails + with an error. + + - If the queue has `ContentBasedDeduplication` set, your + `MessageDeduplicationId` overrides the generated one. + + - When `ContentBasedDeduplication` is in effect, messages with + identical content sent within the deduplication interval are treated + as duplicates and only one copy of the message is delivered. + + - If you send one message with `ContentBasedDeduplication` enabled and + then another message with a `MessageDeduplicationId` that is the + same as the one generated for the first `MessageDeduplicationId`, + the two messages are treated as duplicates and only one copy of the + message is delivered. + + The following attributes apply only to [high throughput for FIFO + queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/high-throughput-fifo.html): + + - `DeduplicationScope` -- Specifies whether message deduplication occurs + at the message group or queue level. Valid values are `messageGroup` + and `queue`. + + - `FifoThroughputLimit` -- Specifies whether the FIFO queue throughput + quota applies to the entire queue or per message group. Valid values + are `perQueue` and `perMessageGroupId`. The `perMessageGroupId` value + is allowed only when the value for `DeduplicationScope` is + `messageGroup`. + + To enable high throughput for FIFO queues, do the following: + + - Set `DeduplicationScope` to `messageGroup`. + + - Set `FifoThroughputLimit` to `perMessageGroupId`. + + If you set these attributes to anything other than the values shown for + enabling high throughput, normal throughput is in effect and + deduplication occurs as specified. + + For information on throughput quotas, see [Quotas related to + messages](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/quotas-messages.html) + in the *Amazon SQS Developer Guide*. + """ + tags: dict[str, str] | None = ... + """ + Add cost allocation tags to the specified Amazon SQS queue. For an + overview, see [Tagging Your Amazon SQS + Queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-queue-tags.html) + in the *Amazon SQS Developer Guide*. + + When you use queue tags, keep the following guidelines in mind: + + - Adding more than 50 tags to a queue isn't recommended. + + - Tags don't have any semantic meaning. Amazon SQS interprets tags as + character strings. + + - Tags are case-sensitive. + + - A new tag with a key identical to that of an existing tag overwrites + the existing tag. + + For a full list of tag restrictions, see [Quotas related to + queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-limits.html#limits-queues) + in the *Amazon SQS Developer Guide*. + + Note: + To be able to tag a queue on creation, you must have the + `sqs:CreateQueue` and `sqs:TagQueue` permissions. + + Cross-account permissions don't apply to this action. For more + information, see [Grant cross-account permissions to a role and a + username](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name) + in the *Amazon SQS Developer Guide*. + """ + +@dataclass(kw_only=True) +class CreateQueueOutput(_SerdeShape): + """Returns the `QueueUrl` attribute of the created queue.""" + + queue_url: str | None = ... + """The URL of the created Amazon SQS queue.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteMessageBatchInput(_SerdeShape): + """""" + + queue_url: str | None = ... + """ + The URL of the Amazon SQS queue from which messages are deleted. + + Queue URLs and names are case-sensitive. + """ + entries: list[DeleteMessageBatchRequestEntry] | None = ... + """Lists the receipt handles for the messages to be deleted.""" + +@dataclass(kw_only=True) +class DeleteMessageBatchOutput(_SerdeShape): + """ + For each message in the batch, the response contains a + ` ``DeleteMessageBatchResultEntry`` ` tag if the message is deleted or a + ` ``BatchResultErrorEntry`` ` tag if the message can't be deleted. + """ + + successful: list[DeleteMessageBatchResultEntry] + """A list of ` ``DeleteMessageBatchResultEntry`` ` items.""" + failed: list[BatchResultErrorEntry] + """A list of ` ``BatchResultErrorEntry`` ` items.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteMessageBatchRequestEntry(_SerdeShape): + """Encloses a receipt handle and an identifier for it.""" + + id: str + """ + The identifier for this particular receipt handle. This is used to + communicate the result. + + Note: + The `Id`s of a batch request need to be unique within a request. + + This identifier can have up to 80 characters. The following characters + are accepted: alphanumeric characters, hyphens(-), and underscores (_). + """ + receipt_handle: str + """A receipt handle.""" + +@dataclass(kw_only=True) +class DeleteMessageBatchResultEntry(_SerdeShape): + """Encloses the `Id` of an entry in ` ``DeleteMessageBatch``.`""" + + id: str + """Represents a successfully deleted message.""" + +@dataclass(kw_only=True) +class DeleteMessageInput(_SerdeShape): + """""" + + queue_url: str | None = ... + """ + The URL of the Amazon SQS queue from which messages are deleted. + + Queue URLs and names are case-sensitive. + """ + receipt_handle: str | None = ... + """The receipt handle associated with the message to delete.""" + +@dataclass(kw_only=True) +class DeleteMessageOutput(_SerdeShape): + """Dataclass for DeleteMessageOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class DeleteQueueInput(_SerdeShape): + """""" + + queue_url: str | None = ... + """ + The URL of the Amazon SQS queue to delete. + + Queue URLs and names are case-sensitive. + """ + +@dataclass(kw_only=True) +class DeleteQueueOutput(_SerdeShape): + """Dataclass for DeleteQueueOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class EmptyBatchRequest(ServiceError, _SerdeShape): + """The batch request doesn't contain any entries.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetQueueAttributesInput(_SerdeShape): + """""" + + queue_url: str | None = ... + """ + The URL of the Amazon SQS queue whose attribute information is + retrieved. + + Queue URLs and names are case-sensitive. + """ + attribute_names: list[str] | None = ... + """ + A list of attributes for which to retrieve information. + + The `AttributeNames` parameter is optional, but if you don't specify + values for this parameter, the request returns empty results. + + Note: + In the future, new attributes might be added. If you write code that + calls this action, we recommend that you structure your code so that it + can handle new attributes gracefully. + + The following attributes are supported: + + Warning: + The `ApproximateNumberOfMessagesDelayed`, + `ApproximateNumberOfMessagesNotVisible`, and + `ApproximateNumberOfMessages` metrics may not achieve consistency until + at least 1 minute after the producers stop sending messages. This period + is required for the queue metadata to reach eventual consistency. + + - `All` -- Returns all values. + + - `ApproximateNumberOfMessages` -- Returns the approximate number of + messages available for retrieval from the queue. + + - `ApproximateNumberOfMessagesDelayed` -- Returns the approximate number + of messages in the queue that are delayed and not available for + reading immediately. This can happen when the queue is configured as a + delay queue or when a message has been sent with a delay parameter. + + - `ApproximateNumberOfMessagesNotVisible` -- Returns the approximate + number of messages that are in flight. Messages are considered to be + *in flight* if they have been sent to a client but have not yet been + deleted or have not yet reached the end of their visibility window. + + - `CreatedTimestamp` -- Returns the time when the queue was created in + seconds ([epoch time](http://en.wikipedia.org/wiki/Unix_time)). + + - `DelaySeconds` -- Returns the default delay on the queue in seconds. + + - `LastModifiedTimestamp` -- Returns the time when the queue was last + changed in seconds ([epoch + time](http://en.wikipedia.org/wiki/Unix_time)). + + - `MaximumMessageSize` -- Returns the limit of how many bytes a message + can contain before Amazon SQS rejects it. + + - `MessageRetentionPeriod` -- Returns the length of time, in seconds, + for which Amazon SQS retains a message. When you change a queue's + attributes, the change can take up to 60 seconds for most of the + attributes to propagate throughout the Amazon SQS system. Changes made + to the `MessageRetentionPeriod` attribute can take up to 15 minutes + and will impact existing messages in the queue potentially causing + them to be expired and deleted if the `MessageRetentionPeriod` is + reduced below the age of existing messages. + + - `Policy` -- Returns the policy of the queue. + + - `QueueArn` -- Returns the Amazon resource name (ARN) of the queue. + + - `ReceiveMessageWaitTimeSeconds` -- Returns the length of time, in + seconds, for which the `ReceiveMessage` action waits for a message to + arrive. + + - `VisibilityTimeout` -- Returns the visibility timeout for the queue. + For more information about the visibility timeout, see [Visibility + Timeout](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html) + in the *Amazon SQS Developer Guide*. + + The following attributes apply only to [dead-letter + queues:](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html) + + - `RedrivePolicy` -- The string that includes the parameters for the + dead-letter queue functionality of the source queue as a JSON object. + The parameters are as follows: + + - `deadLetterTargetArn` -- The Amazon Resource Name (ARN) of the + dead-letter queue to which Amazon SQS moves messages after the value + of `maxReceiveCount` is exceeded. + + - `maxReceiveCount` -- The number of times a message is delivered to + the source queue before being moved to the dead-letter queue. + Default: 10. When the `ReceiveCount` for a message exceeds the + `maxReceiveCount` for a queue, Amazon SQS moves the message to the + dead-letter-queue. + + - `RedriveAllowPolicy` -- The string that includes the parameters for + the permissions for the dead-letter queue redrive permission and which + source queues can specify dead-letter queues as a JSON object. The + parameters are as follows: + + - `redrivePermission` -- The permission type that defines which source + queues can specify the current queue as the dead-letter queue. Valid + values are: + + - `allowAll` -- (Default) Any source queues in this Amazon Web + Services account in the same Region can specify this queue as the + dead-letter queue. + + - `denyAll` -- No source queues can specify this queue as the + dead-letter queue. + + - `byQueue` -- Only queues specified by the `sourceQueueArns` + parameter can specify this queue as the dead-letter queue. + + - `sourceQueueArns` -- The Amazon Resource Names (ARN)s of the source + queues that can specify this queue as the dead-letter queue and + redrive messages. You can specify this parameter only when the + `redrivePermission` parameter is set to `byQueue`. You can specify + up to 10 source queue ARNs. To allow more than 10 source queues to + specify dead-letter queues, set the `redrivePermission` parameter to + `allowAll`. + + Note: + The dead-letter queue of a FIFO queue must also be a FIFO queue. + Similarly, the dead-letter queue of a standard queue must also be a + standard queue. + + The following attributes apply only to + [server-side-encryption](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html): + + - `KmsMasterKeyId` -- Returns the ID of an Amazon Web Services managed + customer master key (CMK) for Amazon SQS or a custom CMK. For more + information, see [Key + Terms](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-sse-key-terms). + + - `KmsDataKeyReusePeriodSeconds` -- Returns the length of time, in + seconds, for which Amazon SQS can reuse a data key to encrypt or + decrypt messages before calling KMS again. For more information, see + [How Does the Data Key Reuse Period + Work?](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-how-does-the-data-key-reuse-period-work). + + - `SqsManagedSseEnabled` -- Returns information about whether the queue + is using SSE-SQS encryption using SQS owned encryption keys. Only one + server-side encryption option is supported per queue (for example, + [SSE-KMS](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sse-existing-queue.html) + or + [SSE-SQS](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sqs-sse-queue.html)). + + The following attributes apply only to [FIFO (first-in-first-out) + queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html): + + - `FifoQueue` -- Returns information about whether the queue is FIFO. + For more information, see [FIFO queue + logic](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues-understanding-logic.html) + in the *Amazon SQS Developer Guide*. + + Note: + To determine whether a queue is + [FIFO](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html), + you can check whether `QueueName` ends with the `.fifo` suffix. + + - `ContentBasedDeduplication` -- Returns whether content-based + deduplication is enabled for the queue. For more information, see + [Exactly-once + processing](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues-exactly-once-processing.html) + in the *Amazon SQS Developer Guide*. + + The following attributes apply only to [high throughput for FIFO + queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/high-throughput-fifo.html): + + - `DeduplicationScope` -- Specifies whether message deduplication occurs + at the message group or queue level. Valid values are `messageGroup` + and `queue`. + + - `FifoThroughputLimit` -- Specifies whether the FIFO queue throughput + quota applies to the entire queue or per message group. Valid values + are `perQueue` and `perMessageGroupId`. The `perMessageGroupId` value + is allowed only when the value for `DeduplicationScope` is + `messageGroup`. + + To enable high throughput for FIFO queues, do the following: + + - Set `DeduplicationScope` to `messageGroup`. + + - Set `FifoThroughputLimit` to `perMessageGroupId`. + + If you set these attributes to anything other than the values shown for + enabling high throughput, normal throughput is in effect and + deduplication occurs as specified. + + For information on throughput quotas, see [Quotas related to + messages](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/quotas-messages.html) + in the *Amazon SQS Developer Guide*. + """ + +@dataclass(kw_only=True) +class GetQueueAttributesOutput(_SerdeShape): + """A list of returned queue attributes.""" + + attributes: dict[str, str] | None = ... + """A map of attributes to their respective values.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetQueueUrlInput(_SerdeShape): + """ + Retrieves the URL of an existing queue based on its name and, + optionally, the Amazon Web Services account ID. + """ + + queue_name: str | None = ... + """ + (Required) The name of the queue for which you want to fetch the URL. + The name can be up to 80 characters long and can include alphanumeric + characters, hyphens (-), and underscores (_). Queue URLs and names are + case-sensitive. + """ + queue_owner_aws_account_id: str | None = ... + """ + (Optional) The Amazon Web Services account ID of the account that + created the queue. This is only required when you are attempting to + access a queue owned by another Amazon Web Services account. + """ + +@dataclass(kw_only=True) +class GetQueueUrlOutput(_SerdeShape): + """ + For more information, see [Interpreting + Responses](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-api-responses.html) + in the *Amazon SQS Developer Guide*. + """ + + queue_url: str | None = ... + """The URL of the queue.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidAddress(ServiceError, _SerdeShape): + """The specified ID is invalid.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidAttributeName(ServiceError, _SerdeShape): + """The specified attribute doesn't exist.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidAttributeValue(ServiceError, _SerdeShape): + """A queue attribute value is invalid.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidBatchEntryId(ServiceError, _SerdeShape): + """ + The `Id` of a batch entry in a batch request doesn't abide by the + specification. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidIdFormat(ServiceError, _SerdeShape): + """The specified receipt handle isn't valid for the current version.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidMessageContents(ServiceError, _SerdeShape): + """The message contains characters outside the allowed set.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidSecurity(ServiceError, _SerdeShape): + """The request was not made over HTTPS or did not use SigV4 for signing.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class KmsAccessDenied(ServiceError, _SerdeShape): + """The caller doesn't have the required KMS access.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class KmsDisabled(ServiceError, _SerdeShape): + """The request was denied due to request throttling.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class KmsInvalidKeyUsage(ServiceError, _SerdeShape): + """ + The request was rejected for one of the following reasons: + + - The KeyUsage value of the KMS key is incompatible with the API + operation. + + - The encryption algorithm or signing algorithm specified for the + operation is incompatible with the type of key material in the KMS key + (KeySpec). + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class KmsInvalidState(ServiceError, _SerdeShape): + """ + The request was rejected because the state of the specified resource is + not valid for this request. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class KmsNotFound(ServiceError, _SerdeShape): + """ + The request was rejected because the specified entity or resource could + not be found. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class KmsOptInRequired(ServiceError, _SerdeShape): + """ + The request was rejected because the specified key policy isn't + syntactically or semantically correct. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class KmsThrottled(ServiceError, _SerdeShape): + """Amazon Web Services KMS throttles requests for the following conditions.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListDeadLetterSourceQueuesInput(_SerdeShape): + """""" + + queue_url: str | None = ... + """ + The URL of a dead-letter queue. + + Queue URLs and names are case-sensitive. + """ + next_token: str | None = ... + """Pagination token to request the next set of results.""" + max_results: int | None = ... + """ + Maximum number of results to include in the response. Value range is 1 + to 1000. You must set `MaxResults` to receive a value for `NextToken` in + the response. + """ + +@dataclass(kw_only=True) +class ListDeadLetterSourceQueuesOutput(_SerdeShape): + """A list of your dead letter source queues.""" + + queue_urls: list[str] + """ + A list of source queue URLs that have the `RedrivePolicy` queue + attribute configured with a dead-letter queue. + """ + next_token: str | None = ... + """ + Pagination token to include in the next request. Token value is `null` + if there are no additional results to request, or if you did not set + `MaxResults` in the request. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListMessageMoveTasksInput(_SerdeShape): + """Dataclass for ListMessageMoveTasksInput structure.""" + + source_arn: str | None = ... + """The ARN of the queue whose message movement tasks are to be listed.""" + max_results: int | None = ... + """ + The maximum number of results to include in the response. The default is + 1, which provides the most recent message movement task. The upper limit + is 10. + """ + +@dataclass(kw_only=True) +class ListMessageMoveTasksOutput(_SerdeShape): + """Dataclass for ListMessageMoveTasksOutput structure.""" + + results: list[ListMessageMoveTasksResultEntry] | None = ... + """A list of message movement tasks and their attributes.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListMessageMoveTasksResultEntry(_SerdeShape): + """Contains the details of a message movement task.""" + + task_handle: str | None = ... + """ + An identifier associated with a message movement task. When this field + is returned in the response of the `ListMessageMoveTasks` action, it is + only populated for tasks that are in RUNNING status. + """ + status: str | None = ... + """ + The status of the message movement task. Possible values are: RUNNING, + COMPLETED, CANCELLING, CANCELLED, and FAILED. + """ + source_arn: str | None = ... + """ + The ARN of the queue that contains the messages to be moved to another + queue. + """ + destination_arn: str | None = ... + """ + The ARN of the destination queue if it has been specified in the + `StartMessageMoveTask` request. If a `DestinationArn` has not been + specified in the `StartMessageMoveTask` request, this field value will + be NULL. + """ + max_number_of_messages_per_second: int | None = ... + """ + The number of messages to be moved per second (the message movement + rate), if it has been specified in the `StartMessageMoveTask` request. + If a `MaxNumberOfMessagesPerSecond` has not been specified in the + `StartMessageMoveTask` request, this field value will be NULL. + """ + approximate_number_of_messages_moved: int = ... + """ + The approximate number of messages already moved to the destination + queue. + """ + approximate_number_of_messages_to_move: int | None = ... + """ + The number of messages to be moved from the source queue. This number is + obtained at the time of starting the message movement task and is only + included after the message movement task is selected to start. + """ + failure_reason: str | None = ... + """The task failure reason (only included if the task status is FAILED).""" + started_timestamp: int = ... + """The timestamp of starting the message movement task.""" + +@dataclass(kw_only=True) +class ListQueuesInput(_SerdeShape): + """""" + + queue_name_prefix: str | None = ... + """ + A string to use for filtering the list results. Only those queues whose + name begins with the specified string are returned. + + Queue URLs and names are case-sensitive. + """ + next_token: str | None = ... + """Pagination token to request the next set of results.""" + max_results: int | None = ... + """ + Maximum number of results to include in the response. Value range is 1 + to 1000. You must set `MaxResults` to receive a value for `NextToken` in + the response. + """ + +@dataclass(kw_only=True) +class ListQueuesOutput(_SerdeShape): + """A list of your queues.""" + + queue_urls: list[str] | None = ... + """ + A list of queue URLs, up to 1,000 entries, or the value of `MaxResults` + that you sent in the request. + """ + next_token: str | None = ... + """ + Pagination token to include in the next request. Token value is `null` + if there are no additional results to request, or if you did not set + `MaxResults` in the request. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ListQueueTagsInput(_SerdeShape): + """Dataclass for ListQueueTagsInput structure.""" + + queue_url: str | None = ... + """The URL of the queue.""" + +@dataclass(kw_only=True) +class ListQueueTagsOutput(_SerdeShape): + """Dataclass for ListQueueTagsOutput structure.""" + + tags: dict[str, str] | None = ... + """The list of all tags added to the specified queue.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class Message(_SerdeShape): + """An Amazon SQS message.""" + + message_id: str | None = ... + """ + A unique identifier for the message. A `MessageId`is considered unique + across all Amazon Web Services accounts for an extended period of time. + """ + receipt_handle: str | None = ... + """ + An identifier associated with the act of receiving the message. A new + receipt handle is returned every time you receive a message. When + deleting a message, you provide the last received receipt handle to + delete the message. + """ + md5_of_body: str | None = ... + """An MD5 digest of the non-URL-encoded message body string.""" + body: str | None = ... + """The message's contents (not URL-encoded).""" + attributes: dict[str, str] | None = ... + """ + A map of the attributes requested in ` ``ReceiveMessage`` ` to their + respective values. Supported attributes: + + - `ApproximateReceiveCount` + + - `ApproximateFirstReceiveTimestamp` + + - `MessageDeduplicationId` + + - `MessageGroupId` + + - `SenderId` + + - `SentTimestamp` + + - `SequenceNumber` + + `ApproximateFirstReceiveTimestamp` and `SentTimestamp` are each returned + as an integer representing the [epoch + time](http://en.wikipedia.org/wiki/Unix_time) in milliseconds. + """ + md5_of_message_attributes: str | None = ... + """ + An MD5 digest of the non-URL-encoded message attribute string. You can + use this attribute to verify that Amazon SQS received the message + correctly. Amazon SQS URL-decodes the message before creating the MD5 + digest. For information about MD5, see + [RFC1321](https://www.ietf.org/rfc/rfc1321.txt). + """ + message_attributes: dict[str, MessageAttributeValue] | None = ... + """ + Each message attribute consists of a `Name`, `Type`, and `Value`. For + more information, see [Amazon SQS message + attributes](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-metadata.html#sqs-message-attributes) + in the *Amazon SQS Developer Guide*. + """ + +@dataclass(kw_only=True) +class MessageAttributeValue(_SerdeShape): + """ + The user-specified message attribute value. For string data types, the + `Value` attribute has the same restrictions on the content as the + message body. For more information, see ` ``SendMessage``.` + + `Name`, `type`, `value` and the message body must not be empty or null. + All parts of the message attribute, including `Name`, `Type`, and + `Value`, are part of the message size restriction (1 MiB or 1,048,576 + bytes). + """ + + string_value: str | None = ... + """ + Strings are Unicode with UTF-8 binary encoding. For a list of code + values, see [ASCII Printable + Characters](http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters). + """ + binary_value: bytes | None = ... + """ + Binary type attributes can store any binary data, such as compressed + data, encrypted data, or images. + """ + string_list_values: list[str] | None = ... + """Not implemented. Reserved for future use.""" + binary_list_values: list[bytes] | None = ... + """Not implemented. Reserved for future use.""" + data_type: str + """ + Amazon SQS supports the following logical data types: `String`, + `Number`, and `Binary`. For the `Number` data type, you must use + `StringValue`. + + You can also append custom labels. For more information, see [Amazon SQS + Message + Attributes](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-metadata.html#sqs-message-attributes) + in the *Amazon SQS Developer Guide*. + """ + +@dataclass(kw_only=True) +class MessageNotInflight(ServiceError, _SerdeShape): + """The specified message isn't in flight.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class MessageSystemAttributeName(UnknownEnumMixin, StrEnum): + ALL = "All" + SENDER_ID = "SenderId" + SENT_TIMESTAMP = "SentTimestamp" + APPROXIMATE_RECEIVE_COUNT = "ApproximateReceiveCount" + APPROXIMATE_FIRST_RECEIVE_TIMESTAMP = "ApproximateFirstReceiveTimestamp" + SEQUENCE_NUMBER = "SequenceNumber" + MESSAGE_DEDUPLICATION_ID = "MessageDeduplicationId" + MESSAGE_GROUP_ID = "MessageGroupId" + AWS_TRACE_HEADER = "AWSTraceHeader" + DEAD_LETTER_QUEUE_SOURCE_ARN = "DeadLetterQueueSourceArn" + +class MessageSystemAttributeNameForSends(UnknownEnumMixin, StrEnum): + AWS_TRACE_HEADER = "AWSTraceHeader" + +@dataclass(kw_only=True) +class MessageSystemAttributeValue(_SerdeShape): + """ + The user-specified message system attribute value. For string data + types, the `Value` attribute has the same restrictions on the content as + the message body. For more information, see ` ``SendMessage``.` + + `Name`, `type`, `value` and the message body must not be empty or null. + """ + + string_value: str | None = ... + """ + Strings are Unicode with UTF-8 binary encoding. For a list of code + values, see [ASCII Printable + Characters](http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters). + """ + binary_value: bytes | None = ... + """ + Binary type attributes can store any binary data, such as compressed + data, encrypted data, or images. + """ + string_list_values: list[str] | None = ... + """Not implemented. Reserved for future use.""" + binary_list_values: list[bytes] | None = ... + """Not implemented. Reserved for future use.""" + data_type: str + """ + Amazon SQS supports the following logical data types: `String`, + `Number`, and `Binary`. For the `Number` data type, you must use + `StringValue`. + + You can also append custom labels. For more information, see [Amazon SQS + Message + Attributes](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-metadata.html#sqs-message-attributes) + in the *Amazon SQS Developer Guide*. + """ + +@dataclass(kw_only=True) +class OverLimit(ServiceError, _SerdeShape): + """ + The specified action violates a limit. For example, `ReceiveMessage` + returns this error if the maximum number of in flight messages is + reached and `AddPermission` returns this error if the maximum number of + permissions for the queue is reached. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class PurgeQueueInProgress(ServiceError, _SerdeShape): + """ + Indicates that the specified queue previously received a `PurgeQueue` + request within the last 60 seconds (the time it can take to delete the + messages in the queue). + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class PurgeQueueInput(_SerdeShape): + """""" + + queue_url: str | None = ... + """ + The URL of the queue from which the `PurgeQueue` action deletes + messages. + + Queue URLs and names are case-sensitive. + """ + +@dataclass(kw_only=True) +class PurgeQueueOutput(_SerdeShape): + """Dataclass for PurgeQueueOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class QueueAttributeName(UnknownEnumMixin, StrEnum): + ALL = "All" + POLICY = "Policy" + VISIBILITY_TIMEOUT = "VisibilityTimeout" + MAXIMUM_MESSAGE_SIZE = "MaximumMessageSize" + MESSAGE_RETENTION_PERIOD = "MessageRetentionPeriod" + APPROXIMATE_NUMBER_OF_MESSAGES = "ApproximateNumberOfMessages" + APPROXIMATE_NUMBER_OF_MESSAGES_NOT_VISIBLE = "ApproximateNumberOfMessagesNotVisible" + CREATED_TIMESTAMP = "CreatedTimestamp" + LAST_MODIFIED_TIMESTAMP = "LastModifiedTimestamp" + QUEUE_ARN = "QueueArn" + APPROXIMATE_NUMBER_OF_MESSAGES_DELAYED = "ApproximateNumberOfMessagesDelayed" + DELAY_SECONDS = "DelaySeconds" + RECEIVE_MESSAGE_WAIT_TIME_SECONDS = "ReceiveMessageWaitTimeSeconds" + REDRIVE_POLICY = "RedrivePolicy" + FIFO_QUEUE = "FifoQueue" + CONTENT_BASED_DEDUPLICATION = "ContentBasedDeduplication" + KMS_MASTER_KEY_ID = "KmsMasterKeyId" + KMS_DATA_KEY_REUSE_PERIOD_SECONDS = "KmsDataKeyReusePeriodSeconds" + DEDUPLICATION_SCOPE = "DeduplicationScope" + FIFO_THROUGHPUT_LIMIT = "FifoThroughputLimit" + REDRIVE_ALLOW_POLICY = "RedriveAllowPolicy" + SQS_MANAGED_SSE_ENABLED = "SqsManagedSseEnabled" + +@dataclass(kw_only=True) +class QueueDeletedRecently(ServiceError, _SerdeShape): + """ + You must wait 60 seconds after deleting a queue before you can create + another queue with the same name. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class QueueDoesNotExist(ServiceError, _SerdeShape): + """ + Ensure that the `QueueUrl` is correct and that the queue has not been + deleted. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class QueueNameExists(ServiceError, _SerdeShape): + """ + A queue with this name already exists. Amazon SQS returns this error + only if the request includes attributes whose values differ from those + of the existing queue. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ReceiptHandleIsInvalid(ServiceError, _SerdeShape): + """The specified receipt handle isn't valid.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ReceiveMessageInput(_SerdeShape): + """Retrieves one or more messages from a specified queue.""" + + queue_url: str | None = ... + """ + The URL of the Amazon SQS queue from which messages are received. + + Queue URLs and names are case-sensitive. + """ + attribute_names: list[str] | None = ... + """ + Warning: + This parameter has been discontinued but will be supported for backward + compatibility. To provide attribute names, you are encouraged to use + `MessageSystemAttributeNames`. + + A list of attributes that need to be returned along with each message. + These attributes include: + + - `All` -- Returns all values. + + - `ApproximateFirstReceiveTimestamp` -- Returns the time the message was + first received from the queue ([epoch + time](http://en.wikipedia.org/wiki/Unix_time) in milliseconds). + + - `ApproximateReceiveCount` -- Returns the number of times a message has + been received across all queues but not deleted. + + - `AWSTraceHeader` -- Returns the X-Ray trace header string. + + - `SenderId` + + - For a user, returns the user ID, for example + `ABCDEFGHI1JKLMNOPQ23R`. + + - For an IAM role, returns the IAM role ID, for example + `ABCDE1F2GH3I4JK5LMNOP:i-a123b456`. + + - `SentTimestamp` -- Returns the time the message was sent to the queue + ([epoch time](http://en.wikipedia.org/wiki/Unix_time) in + milliseconds). + + - `SqsManagedSseEnabled` -- Enables server-side queue encryption using + SQS owned encryption keys. Only one server-side encryption option is + supported per queue (for example, + [SSE-KMS](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sse-existing-queue.html) + or + [SSE-SQS](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sqs-sse-queue.html)). + + - `MessageDeduplicationId` -- Returns the value provided by the producer + that calls the ` ``SendMessage`` ` action. + + - `MessageGroupId` -- Returns the value provided by the producer that + calls the ` ``SendMessage`` ` action. + + - `SequenceNumber` -- Returns the value provided by Amazon SQS. + """ + message_system_attribute_names: list[str] | None = ... + """ + A list of attributes that need to be returned along with each message. + These attributes include: + + - `All` -- Returns all values. + + - `ApproximateFirstReceiveTimestamp` -- Returns the time the message was + first received from the queue ([epoch + time](http://en.wikipedia.org/wiki/Unix_time) in milliseconds). + + - `ApproximateReceiveCount` -- Returns the number of times a message has + been received across all queues but not deleted. + + - `AWSTraceHeader` -- Returns the X-Ray trace header string. + + - `SenderId` + + - For a user, returns the user ID, for example + `ABCDEFGHI1JKLMNOPQ23R`. + + - For an IAM role, returns the IAM role ID, for example + `ABCDE1F2GH3I4JK5LMNOP:i-a123b456`. + + - `SentTimestamp` -- Returns the time the message was sent to the queue + ([epoch time](http://en.wikipedia.org/wiki/Unix_time) in + milliseconds). + + - `SqsManagedSseEnabled` -- Enables server-side queue encryption using + SQS owned encryption keys. Only one server-side encryption option is + supported per queue (for example, + [SSE-KMS](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sse-existing-queue.html) + or + [SSE-SQS](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sqs-sse-queue.html)). + + - `MessageDeduplicationId` -- Returns the value provided by the producer + that calls the ` ``SendMessage`` ` action. + + - `MessageGroupId` -- Returns the value provided by the producer that + calls the ` ``SendMessage`` ` action. + + - `SequenceNumber` -- Returns the value provided by Amazon SQS. + """ + message_attribute_names: list[str] | None = ... + """ + The name of the message attribute, where *N* is the index. + + - The name can contain alphanumeric characters and the underscore (`_`), + hyphen (`-`), and period (`.`). + + - The name is case-sensitive and must be unique among all attribute + names for the message. + + - The name must not start with AWS-reserved prefixes such as `AWS.` or + `Amazon.` (or any casing variants). + + - The name must not start or end with a period (`.`), and it should not + have periods in succession (`..`). + + - The name can be up to 256 characters long. + + When using `ReceiveMessage`, you can send a list of attribute names to + receive, or you can return all of the attributes by specifying `All` or + `.*` in your request. You can also use all message attributes starting + with a prefix, for example `bar.*`. + """ + max_number_of_messages: int | None = ... + """ + The maximum number of messages to return. Amazon SQS never returns more + messages than this value (however, fewer messages might be returned). + Valid values: 1 to 10. Default: 1. + """ + visibility_timeout: int | None = ... + """ + The duration (in seconds) that the received messages are hidden from + subsequent retrieve requests after being retrieved by a `ReceiveMessage` + request. If not specified, the default visibility timeout for the queue + is used, which is 30 seconds. + + Understanding `VisibilityTimeout`: + + - When a message is received from a queue, it becomes temporarily + invisible to other consumers for the duration of the visibility + timeout. This prevents multiple consumers from processing the same + message simultaneously. If the message is not deleted or its + visibility timeout is not extended before the timeout expires, it + becomes visible again and can be retrieved by other consumers. + + - Setting an appropriate visibility timeout is crucial. If it's too + short, the message might become visible again before processing is + complete, leading to duplicate processing. If it's too long, it + delays the reprocessing of messages if the initial processing fails. + + - You can adjust the visibility timeout using the `--visibility-timeout` + parameter in the `receive-message` command to match the processing + time required by your application. + + - A message that isn't deleted or a message whose visibility isn't + extended before the visibility timeout expires counts as a failed + receive. Depending on the configuration of the queue, the message + might be sent to the dead-letter queue. + + For more information, see [Visibility + Timeout](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html) + in the *Amazon SQS Developer Guide*. + """ + wait_time_seconds: int | None = ... + """ + The duration (in seconds) for which the call waits for a message to + arrive in the queue before returning. If a message is available, the + call returns sooner than `WaitTimeSeconds`. If no messages are available + and the wait time expires, the call does not return a message list. If + you are using the Java SDK, it returns a `ReceiveMessageResponse` + object, which has a empty list instead of a Null object. + + Warning: + To avoid HTTP errors, ensure that the HTTP response timeout for + `ReceiveMessage` requests is longer than the `WaitTimeSeconds` + parameter. For example, with the Java SDK, you can set HTTP transport + settings using the + [NettyNioAsyncHttpClient](https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/http/nio/netty/NettyNioAsyncHttpClient.html) + for asynchronous clients, or the + [ApacheHttpClient](https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/http/apache/ApacheHttpClient.html) + for synchronous clients. + """ + receive_request_attempt_id: str | None = ... + """ + This parameter applies only to FIFO (first-in-first-out) queues. + + The token used for deduplication of `ReceiveMessage` calls. If a + networking issue occurs after a `ReceiveMessage` action, and instead of + a response you receive a generic error, it is possible to retry the same + action with an identical `ReceiveRequestAttemptId` to retrieve the same + set of messages, even if their visibility timeout has not yet expired. + + - You can use `ReceiveRequestAttemptId` only for 5 minutes after a + `ReceiveMessage` action. + + - When you set `FifoQueue`, a caller of the `ReceiveMessage` action can + provide a `ReceiveRequestAttemptId` explicitly. + + - It is possible to retry the `ReceiveMessage` action with the same + `ReceiveRequestAttemptId` if none of the messages have been modified + (deleted or had their visibility changes). + + - During a visibility timeout, subsequent calls with the same + `ReceiveRequestAttemptId` return the same messages and receipt + handles. If a retry occurs within the deduplication interval, it + resets the visibility timeout. For more information, see [Visibility + Timeout](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html) + in the *Amazon SQS Developer Guide*. + + Warning: + If a caller of the `ReceiveMessage` action still processes messages + when the visibility timeout expires and messages become visible, + another worker consuming from the same queue can receive the same + messages and therefore process duplicates. Also, if a consumer whose + message processing time is longer than the visibility timeout tries to + delete the processed messages, the action fails with an error. + + To mitigate this effect, ensure that your application observes a safe + threshold before the visibility timeout expires and extend the + visibility timeout as necessary. + + - While messages with a particular `MessageGroupId` are invisible, no + more messages belonging to the same `MessageGroupId` are returned + until the visibility timeout expires. You can still receive messages + with another `MessageGroupId` from your FIFO queue as long as they are + visible. + + - If a caller of `ReceiveMessage` can't track the + `ReceiveRequestAttemptId`, no retries work until the original + visibility timeout expires. As a result, delays might occur but the + messages in the queue remain in a strict order. + + The maximum length of `ReceiveRequestAttemptId` is 128 characters. + `ReceiveRequestAttemptId` can contain alphanumeric characters (`a-z`, + `A-Z`, `0-9`) and punctuation (`` !"#$%&'()*+,-./:;<=>?@[]^_`{|}~ ``). + + For best practices of using `ReceiveRequestAttemptId`, see [Using the + ReceiveRequestAttemptId Request + Parameter](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-receiverequestattemptid-request-parameter.html) + in the *Amazon SQS Developer Guide*. + """ + +@dataclass(kw_only=True) +class ReceiveMessageOutput(_SerdeShape): + """A list of received messages.""" + + messages: list[Message] | None = ... + """A list of messages.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class RemovePermissionInput(_SerdeShape): + """""" + + queue_url: str | None = ... + """ + The URL of the Amazon SQS queue from which permissions are removed. + + Queue URLs and names are case-sensitive. + """ + label: str | None = ... + """ + The identification of the permission to remove. This is the label added + using the ` ``AddPermission`` ` action. + """ + +@dataclass(kw_only=True) +class RemovePermissionOutput(_SerdeShape): + """Dataclass for RemovePermissionOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class RequestThrottled(ServiceError, _SerdeShape): + """ + The request was denied due to request throttling. + + - Exceeds the permitted request rate for the queue or for the recipient + of the request. + + - Ensure that the request rate is within the Amazon SQS limits for + sending messages. For more information, see [Amazon SQS + quotas](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-quotas.html#quotas-requests) + in the *Amazon SQS Developer Guide*. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ResourceNotFoundException(ServiceError, _SerdeShape): + """One or more specified resources don't exist.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class SendMessageBatchInput(_SerdeShape): + """""" + + queue_url: str | None = ... + """ + The URL of the Amazon SQS queue to which batched messages are sent. + + Queue URLs and names are case-sensitive. + """ + entries: list[SendMessageBatchRequestEntry] | None = ... + """A list of ` ``SendMessageBatchRequestEntry`` ` items.""" + +@dataclass(kw_only=True) +class SendMessageBatchOutput(_SerdeShape): + """ + For each message in the batch, the response contains a + ` ``SendMessageBatchResultEntry`` ` tag if the message succeeds or a + ` ``BatchResultErrorEntry`` ` tag if the message fails. + """ + + successful: list[SendMessageBatchResultEntry] + """A list of ` ``SendMessageBatchResultEntry`` ` items.""" + failed: list[BatchResultErrorEntry] + """ + A list of ` ``BatchResultErrorEntry`` ` items with error details about + each message that can't be enqueued. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class SendMessageBatchRequestEntry(_SerdeShape): + """Contains the details of a single Amazon SQS message along with an `Id`.""" + + id: str + """ + An identifier for a message in this batch used to communicate the + result. + + Note: + The `Id`s of a batch request need to be unique within a request. + + This identifier can have up to 80 characters. The following characters + are accepted: alphanumeric characters, hyphens(-), and underscores (_). + """ + message_body: str + """The body of the message.""" + delay_seconds: int | None = ... + """ + The length of time, in seconds, for which a specific message is delayed. + Valid values: 0 to 900. Maximum: 15 minutes. Messages with a positive + `DelaySeconds` value become available for processing after the delay + period is finished. If you don't specify a value, the default value for + the queue is applied. + + Note: + When you set `FifoQueue`, you can't set `DelaySeconds` per message. You + can set this parameter only on a queue level. + """ + message_attributes: dict[str, MessageAttributeValue] | None = ... + """ + Each message attribute consists of a `Name`, `Type`, and `Value`. For + more information, see [Amazon SQS message + attributes](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-metadata.html#sqs-message-attributes) + in the *Amazon SQS Developer Guide*. + """ + message_system_attributes: dict[str, MessageSystemAttributeValue] | None = ... + """ + The message system attribute to send Each message system attribute + consists of a `Name`, `Type`, and `Value`. + + Warning: + - Currently, the only supported message system attribute is + `AWSTraceHeader`. Its type must be `String` and its value must be a + correctly formatted X-Ray trace header string. + + - The size of a message system attribute doesn't count towards the + total size of a message. + """ + message_deduplication_id: str | None = ... + """ + This parameter applies only to FIFO (first-in-first-out) queues. + + The token used for deduplication of messages within a 5-minute minimum + deduplication interval. If a message with a particular + `MessageDeduplicationId` is sent successfully, subsequent messages with + the same `MessageDeduplicationId` are accepted successfully but aren't + delivered. For more information, see [Exactly-once + processing](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues-exactly-once-processing.html) + in the *Amazon SQS Developer Guide*. + + - Every message must have a unique `MessageDeduplicationId`, + + - You may provide a `MessageDeduplicationId` explicitly. + + - If you aren't able to provide a `MessageDeduplicationId` and you + enable `ContentBasedDeduplication` for your queue, Amazon SQS uses a + SHA-256 hash to generate the `MessageDeduplicationId` using the body + of the message (but not the attributes of the message). + + - If you don't provide a `MessageDeduplicationId` and the queue + doesn't have `ContentBasedDeduplication` set, the action fails with + an error. + + - If the queue has `ContentBasedDeduplication` set, your + `MessageDeduplicationId` overrides the generated one. + + - When `ContentBasedDeduplication` is in effect, messages with identical + content sent within the deduplication interval are treated as + duplicates and only one copy of the message is delivered. + + - If you send one message with `ContentBasedDeduplication` enabled and + then another message with a `MessageDeduplicationId` that is the same + as the one generated for the first `MessageDeduplicationId`, the two + messages are treated as duplicates and only one copy of the message is + delivered. + + Note: + The `MessageDeduplicationId` is available to the consumer of the message + (this can be useful for troubleshooting delivery issues). + + If a message is sent successfully but the acknowledgement is lost and + the message is resent with the same `MessageDeduplicationId` after the + deduplication interval, Amazon SQS can't detect duplicate messages. + + Amazon SQS continues to keep track of the message deduplication ID even + after the message is received and deleted. + + The length of `MessageDeduplicationId` is 128 characters. + `MessageDeduplicationId` can contain alphanumeric characters (`a-z`, + `A-Z`, `0-9`) and punctuation (`` !"#$%&'()*+,-./:;<=>?@[]^_`{|}~ ``). + + For best practices of using `MessageDeduplicationId`, see [Using the + MessageDeduplicationId + Property](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagededuplicationid-property.html) + in the *Amazon SQS Developer Guide*. + """ + message_group_id: str | None = ... + """ + `MessageGroupId` is an attribute used in Amazon SQS FIFO + (First-In-First-Out) and standard queues. In FIFO queues, + `MessageGroupId` organizes messages into distinct groups. Messages + within the same message group are always processed one at a time, in + strict order, ensuring that no two messages from the same group are + processed simultaneously. In standard queues, using `MessageGroupId` + enables fair queues. It is used to identify the tenant a message belongs + to, helping maintain consistent message dwell time across all tenants + during noisy neighbor events. Unlike FIFO queues, messages with the same + `MessageGroupId` can be processed in parallel, maintaining the high + throughput of standard queues. + + - **FIFO queues:** `MessageGroupId` acts as the tag that specifies that + a message belongs to a specific message group. Messages that belong to + the same message group are processed in a FIFO manner (however, + messages in different message groups might be processed out of order). + To interleave multiple ordered streams within a single queue, use + `MessageGroupId` values (for example, session data for multiple + users). In this scenario, multiple consumers can process the queue, + but the session data of each user is processed in a FIFO fashion. + + If you do not provide a `MessageGroupId` when sending a message to a + FIFO queue, the action fails. + + `ReceiveMessage` might return messages with multiple `MessageGroupId` + values. For each `MessageGroupId`, the messages are sorted by time + sent. + + - **Standard queues:**Use `MessageGroupId` in standard queues to enable + fair queues. The `MessageGroupId` identifies the tenant a message + belongs to. A tenant can be any entity that shares a queue with + others, such as your customer, a client application, or a request + type. When one tenant sends a disproportionately large volume of + messages or has messages that require longer processing time, fair + queues ensure other tenants' messages maintain low dwell time. This + preserves quality of service for all tenants while maintaining the + scalability and throughput of standard queues. We recommend that you + include a `MessageGroupId` in all messages when using fair queues. + + The length of `MessageGroupId` is 128 characters. Valid values: + alphanumeric characters and punctuation + `` (!"#$%&'()*+,-./:;<=>?@[]^_`{|}~) ``. + + For best practices of using `MessageGroupId`, see [Using the + MessageGroupId + Property](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagegroupid-property.html) + in the *Amazon SQS Developer Guide*. + """ + +@dataclass(kw_only=True) +class SendMessageBatchResultEntry(_SerdeShape): + """ + Encloses a `MessageId` for a successfully-enqueued message in a + ` ``SendMessageBatch``.` + """ + + id: str + """An identifier for the message in this batch.""" + message_id: str + """An identifier for the message.""" + md5_of_message_body: str + """ + An MD5 digest of the non-URL-encoded message body string. You can use + this attribute to verify that Amazon SQS received the message correctly. + Amazon SQS URL-decodes the message before creating the MD5 digest. For + information about MD5, see + [RFC1321](https://www.ietf.org/rfc/rfc1321.txt). + """ + md5_of_message_attributes: str | None = ... + """ + An MD5 digest of the non-URL-encoded message attribute string. You can + use this attribute to verify that Amazon SQS received the message + correctly. Amazon SQS URL-decodes the message before creating the MD5 + digest. For information about MD5, see + [RFC1321](https://www.ietf.org/rfc/rfc1321.txt). + """ + md5_of_message_system_attributes: str | None = ... + """ + An MD5 digest of the non-URL-encoded message system attribute string. + You can use this attribute to verify that Amazon SQS received the + message correctly. Amazon SQS URL-decodes the message before creating + the MD5 digest. For information about MD5, see + [RFC1321](https://www.ietf.org/rfc/rfc1321.txt). + """ + sequence_number: str | None = ... + """ + This parameter applies only to FIFO (first-in-first-out) queues. + + The large, non-consecutive number that Amazon SQS assigns to each + message. + + The length of `SequenceNumber` is 128 bits. As `SequenceNumber` + continues to increase for a particular `MessageGroupId`. + """ + +@dataclass(kw_only=True) +class SendMessageInput(_SerdeShape): + """""" + + queue_url: str | None = ... + """ + The URL of the Amazon SQS queue to which a message is sent. + + Queue URLs and names are case-sensitive. + """ + message_body: str | None = ... + """ + The message to send. The minimum size is one character. The maximum size + is 1 MiB or 1,048,576 bytes + + Warning: + A message can include only XML, JSON, and unformatted text. The + following Unicode characters are allowed. For more information, see the + [W3C specification for + characters](http://www.w3.org/TR/REC-xml/#charsets). + + `#x9` | `#xA` | `#xD` | `#x20` to `#xD7FF` | `#xE000` to `#xFFFD` | + `#x10000` to `#x10FFFF` + + If a message contains characters outside the allowed set, Amazon SQS + rejects the message and returns an InvalidMessageContents error. Ensure + that your message body includes only valid characters to avoid this + exception. + """ + delay_seconds: int | None = ... + """ + The length of time, in seconds, for which to delay a specific message. + Valid values: 0 to 900. Maximum: 15 minutes. Messages with a positive + `DelaySeconds` value become available for processing after the delay + period is finished. If you don't specify a value, the default value for + the queue applies. + + Note: + When you set `FifoQueue`, you can't set `DelaySeconds` per message. You + can set this parameter only on a queue level. + """ + message_attributes: dict[str, MessageAttributeValue] | None = ... + """ + Each message attribute consists of a `Name`, `Type`, and `Value`. For + more information, see [Amazon SQS message + attributes](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-metadata.html#sqs-message-attributes) + in the *Amazon SQS Developer Guide*. + """ + message_system_attributes: dict[str, MessageSystemAttributeValue] | None = ... + """ + The message system attribute to send. Each message system attribute + consists of a `Name`, `Type`, and `Value`. + + Warning: + - Currently, the only supported message system attribute is + `AWSTraceHeader`. Its type must be `String` and its value must be a + correctly formatted X-Ray trace header string. + + - The size of a message system attribute doesn't count towards the + total size of a message. + """ + message_deduplication_id: str | None = ... + """ + This parameter applies only to FIFO (first-in-first-out) queues. + + The token used for deduplication of sent messages. If a message with a + particular `MessageDeduplicationId` is sent successfully, any messages + sent with the same `MessageDeduplicationId` are accepted successfully + but aren't delivered during the 5-minute deduplication interval. For + more information, see [Exactly-once + processing](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues-exactly-once-processing.html) + in the *Amazon SQS Developer Guide*. + + - Every message must have a unique `MessageDeduplicationId`, + + - You may provide a `MessageDeduplicationId` explicitly. + + - If you aren't able to provide a `MessageDeduplicationId` and you + enable `ContentBasedDeduplication` for your queue, Amazon SQS uses a + SHA-256 hash to generate the `MessageDeduplicationId` using the body + of the message (but not the attributes of the message). + + - If you don't provide a `MessageDeduplicationId` and the queue + doesn't have `ContentBasedDeduplication` set, the action fails with + an error. + + - If the queue has `ContentBasedDeduplication` set, your + `MessageDeduplicationId` overrides the generated one. + + - When `ContentBasedDeduplication` is in effect, messages with identical + content sent within the deduplication interval are treated as + duplicates and only one copy of the message is delivered. + + - If you send one message with `ContentBasedDeduplication` enabled and + then another message with a `MessageDeduplicationId` that is the same + as the one generated for the first `MessageDeduplicationId`, the two + messages are treated as duplicates and only one copy of the message is + delivered. + + Note: + The `MessageDeduplicationId` is available to the consumer of the message + (this can be useful for troubleshooting delivery issues). + + If a message is sent successfully but the acknowledgement is lost and + the message is resent with the same `MessageDeduplicationId` after the + deduplication interval, Amazon SQS can't detect duplicate messages. + + Amazon SQS continues to keep track of the message deduplication ID even + after the message is received and deleted. + + The maximum length of `MessageDeduplicationId` is 128 characters. + `MessageDeduplicationId` can contain alphanumeric characters (`a-z`, + `A-Z`, `0-9`) and punctuation (`` !"#$%&'()*+,-./:;<=>?@[]^_`{|}~ ``). + + For best practices of using `MessageDeduplicationId`, see [Using the + MessageDeduplicationId + Property](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagededuplicationid-property.html) + in the *Amazon SQS Developer Guide*. + """ + message_group_id: str | None = ... + """ + `MessageGroupId` is an attribute used in Amazon SQS FIFO + (First-In-First-Out) and standard queues. In FIFO queues, + `MessageGroupId` organizes messages into distinct groups. Messages + within the same message group are always processed one at a time, in + strict order, ensuring that no two messages from the same group are + processed simultaneously. In standard queues, using `MessageGroupId` + enables fair queues. It is used to identify the tenant a message belongs + to, helping maintain consistent message dwell time across all tenants + during noisy neighbor events. Unlike FIFO queues, messages with the same + `MessageGroupId` can be processed in parallel, maintaining the high + throughput of standard queues. + + - **FIFO queues:** `MessageGroupId` acts as the tag that specifies that + a message belongs to a specific message group. Messages that belong to + the same message group are processed in a FIFO manner (however, + messages in different message groups might be processed out of order). + To interleave multiple ordered streams within a single queue, use + `MessageGroupId` values (for example, session data for multiple + users). In this scenario, multiple consumers can process the queue, + but the session data of each user is processed in a FIFO fashion. + + If you do not provide a `MessageGroupId` when sending a message to a + FIFO queue, the action fails. + + `ReceiveMessage` might return messages with multiple `MessageGroupId` + values. For each `MessageGroupId`, the messages are sorted by time + sent. + + - **Standard queues:**Use `MessageGroupId` in standard queues to enable + fair queues. The `MessageGroupId` identifies the tenant a message + belongs to. A tenant can be any entity that shares a queue with + others, such as your customer, a client application, or a request + type. When one tenant sends a disproportionately large volume of + messages or has messages that require longer processing time, fair + queues ensure other tenants' messages maintain low dwell time. This + preserves quality of service for all tenants while maintaining the + scalability and throughput of standard queues. We recommend that you + include a `MessageGroupId` in all messages when using fair queues. + + The length of `MessageGroupId` is 128 characters. Valid values: + alphanumeric characters and punctuation + `` (!"#$%&'()*+,-./:;<=>?@[]^_`{|}~) ``. + + For best practices of using `MessageGroupId`, see [Using the + MessageGroupId + Property](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagegroupid-property.html) + in the *Amazon SQS Developer Guide*. + """ + +@dataclass(kw_only=True) +class SendMessageOutput(_SerdeShape): + """The `MD5OfMessageBody` and `MessageId` elements.""" + + md5_of_message_body: str | None = ... + """ + An MD5 digest of the non-URL-encoded message body string. You can use + this attribute to verify that Amazon SQS received the message correctly. + Amazon SQS URL-decodes the message before creating the MD5 digest. For + information about MD5, see + [RFC1321](https://www.ietf.org/rfc/rfc1321.txt). + """ + md5_of_message_attributes: str | None = ... + """ + An MD5 digest of the non-URL-encoded message attribute string. You can + use this attribute to verify that Amazon SQS received the message + correctly. Amazon SQS URL-decodes the message before creating the MD5 + digest. For information about MD5, see + [RFC1321](https://www.ietf.org/rfc/rfc1321.txt). + """ + md5_of_message_system_attributes: str | None = ... + """ + An MD5 digest of the non-URL-encoded message system attribute string. + You can use this attribute to verify that Amazon SQS received the + message correctly. Amazon SQS URL-decodes the message before creating + the MD5 digest. + """ + message_id: str | None = ... + """ + An attribute containing the `MessageId` of the message sent to the + queue. For more information, see [Queue and Message + Identifiers](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-queue-message-identifiers.html) + in the *Amazon SQS Developer Guide*. + """ + sequence_number: str | None = ... + """ + This parameter applies only to FIFO (first-in-first-out) queues. + + The large, non-consecutive number that Amazon SQS assigns to each + message. + + The length of `SequenceNumber` is 128 bits. `SequenceNumber` continues + to increase for a particular `MessageGroupId`. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class SetQueueAttributesInput(_SerdeShape): + """""" + + queue_url: str | None = ... + """ + The URL of the Amazon SQS queue whose attributes are set. + + Queue URLs and names are case-sensitive. + """ + attributes: dict[str, str] | None = ... + """ + A map of attributes to set. + + The following lists the names, descriptions, and values of the special + request parameters that the `SetQueueAttributes` action uses: + + - `DelaySeconds` -- The length of time, in seconds, for which the + delivery of all messages in the queue is delayed. Valid values: An + integer from 0 to 900 (15 minutes). Default: 0. + + - `MaximumMessageSize` -- The limit of how many bytes a message can + contain before Amazon SQS rejects it. Valid values: An integer from + 1,024 bytes (1 KiB) up to 1,048,576 bytes (1 MiB). Default: 1,048,576 + bytes (1 MiB). + + - `MessageRetentionPeriod` -- The length of time, in seconds, for which + Amazon SQS retains a message. Valid values: An integer representing + seconds, from 60 (1 minute) to 1,209,600 (14 days). Default: 345,600 + (4 days). When you change a queue's attributes, the change can take + up to 60 seconds for most of the attributes to propagate throughout + the Amazon SQS system. Changes made to the `MessageRetentionPeriod` + attribute can take up to 15 minutes and will impact existing messages + in the queue potentially causing them to be expired and deleted if the + `MessageRetentionPeriod` is reduced below the age of existing + messages. + + - `Policy` -- The queue's policy. A valid Amazon Web Services policy. + For more information about policy structure, see [Overview of Amazon + Web Services IAM + Policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/PoliciesOverview.html) + in the *Identity and Access Management User Guide*. + + - `ReceiveMessageWaitTimeSeconds` -- The length of time, in seconds, for + which a ` ``ReceiveMessage`` ` action waits for a message to arrive. + Valid values: An integer from 0 to 20 (seconds). Default: 0. + + - `VisibilityTimeout` -- The visibility timeout for the queue, in + seconds. Valid values: An integer from 0 to 43,200 (12 hours). + Default: 30. For more information about the visibility timeout, see + [Visibility + Timeout](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html) + in the *Amazon SQS Developer Guide*. + + The following attributes apply only to [dead-letter + queues:](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html) + + - `RedrivePolicy` -- The string that includes the parameters for the + dead-letter queue functionality of the source queue as a JSON object. + The parameters are as follows: + + - `deadLetterTargetArn` -- The Amazon Resource Name (ARN) of the + dead-letter queue to which Amazon SQS moves messages after the value + of `maxReceiveCount` is exceeded. + + - `maxReceiveCount` -- The number of times a message is delivered to + the source queue before being moved to the dead-letter queue. + Default: 10. When the `ReceiveCount` for a message exceeds the + `maxReceiveCount` for a queue, Amazon SQS moves the message to the + dead-letter-queue. + + - `RedriveAllowPolicy` -- The string that includes the parameters for + the permissions for the dead-letter queue redrive permission and which + source queues can specify dead-letter queues as a JSON object. The + parameters are as follows: + + - `redrivePermission` -- The permission type that defines which source + queues can specify the current queue as the dead-letter queue. Valid + values are: + + - `allowAll` -- (Default) Any source queues in this Amazon Web + Services account in the same Region can specify this queue as the + dead-letter queue. + + - `denyAll` -- No source queues can specify this queue as the + dead-letter queue. + + - `byQueue` -- Only queues specified by the `sourceQueueArns` + parameter can specify this queue as the dead-letter queue. + + - `sourceQueueArns` -- The Amazon Resource Names (ARN)s of the source + queues that can specify this queue as the dead-letter queue and + redrive messages. You can specify this parameter only when the + `redrivePermission` parameter is set to `byQueue`. You can specify + up to 10 source queue ARNs. To allow more than 10 source queues to + specify dead-letter queues, set the `redrivePermission` parameter to + `allowAll`. + + Note: + The dead-letter queue of a FIFO queue must also be a FIFO queue. + Similarly, the dead-letter queue of a standard queue must also be a + standard queue. + + The following attributes apply only to + [server-side-encryption](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html): + + - `KmsMasterKeyId` -- The ID of an Amazon Web Services managed customer + master key (CMK) for Amazon SQS or a custom CMK. For more information, + see [Key + Terms](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-sse-key-terms). + While the alias of the AWS-managed CMK for Amazon SQS is always + `alias/aws/sqs`, the alias of a custom CMK can, for example, be + `alias/`*`MyAlias`*` `. For more examples, see + [KeyId](https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters) + in the *Key Management Service API Reference*. + + - `KmsDataKeyReusePeriodSeconds` -- The length of time, in seconds, for + which Amazon SQS can reuse a [data + key](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#data-keys) + to encrypt or decrypt messages before calling KMS again. An integer + representing seconds, between 60 seconds (1 minute) and 86,400 seconds + (24 hours). Default: 300 (5 minutes). A shorter time period provides + better security but results in more calls to KMS which might incur + charges after Free Tier. For more information, see [How Does the Data + Key Reuse Period + Work?](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-how-does-the-data-key-reuse-period-work). + + - `SqsManagedSseEnabled` -- Enables server-side queue encryption using + SQS owned encryption keys. Only one server-side encryption option is + supported per queue (for example, + [SSE-KMS](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sse-existing-queue.html) + or + [SSE-SQS](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sqs-sse-queue.html)). + + The following attribute applies only to [FIFO (first-in-first-out) + queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html): + + - `ContentBasedDeduplication` -- Enables content-based deduplication. + For more information, see [Exactly-once + processing](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues-exactly-once-processing.html) + in the *Amazon SQS Developer Guide*. Note the following: + + - Every message must have a unique `MessageDeduplicationId`. + + - You may provide a `MessageDeduplicationId` explicitly. + + - If you aren't able to provide a `MessageDeduplicationId` and you + enable `ContentBasedDeduplication` for your queue, Amazon SQS uses + a SHA-256 hash to generate the `MessageDeduplicationId` using the + body of the message (but not the attributes of the message). + + - If you don't provide a `MessageDeduplicationId` and the queue + doesn't have `ContentBasedDeduplication` set, the action fails + with an error. + + - If the queue has `ContentBasedDeduplication` set, your + `MessageDeduplicationId` overrides the generated one. + + - When `ContentBasedDeduplication` is in effect, messages with + identical content sent within the deduplication interval are treated + as duplicates and only one copy of the message is delivered. + + - If you send one message with `ContentBasedDeduplication` enabled and + then another message with a `MessageDeduplicationId` that is the + same as the one generated for the first `MessageDeduplicationId`, + the two messages are treated as duplicates and only one copy of the + message is delivered. + + The following attributes apply only to [high throughput for FIFO + queues](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/high-throughput-fifo.html): + + - `DeduplicationScope` -- Specifies whether message deduplication occurs + at the message group or queue level. Valid values are `messageGroup` + and `queue`. + + - `FifoThroughputLimit` -- Specifies whether the FIFO queue throughput + quota applies to the entire queue or per message group. Valid values + are `perQueue` and `perMessageGroupId`. The `perMessageGroupId` value + is allowed only when the value for `DeduplicationScope` is + `messageGroup`. + + To enable high throughput for FIFO queues, do the following: + + - Set `DeduplicationScope` to `messageGroup`. + + - Set `FifoThroughputLimit` to `perMessageGroupId`. + + If you set these attributes to anything other than the values shown for + enabling high throughput, normal throughput is in effect and + deduplication occurs as specified. + + For information on throughput quotas, see [Quotas related to + messages](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/quotas-messages.html) + in the *Amazon SQS Developer Guide*. + """ + +@dataclass(kw_only=True) +class SetQueueAttributesOutput(_SerdeShape): + """Dataclass for SetQueueAttributesOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class StartMessageMoveTaskInput(_SerdeShape): + """Dataclass for StartMessageMoveTaskInput structure.""" + + source_arn: str | None = ... + """ + The ARN of the queue that contains the messages to be moved to another + queue. Currently, only ARNs of dead-letter queues (DLQs) whose sources + are other Amazon SQS queues are accepted. DLQs whose sources are non-SQS + queues, such as Lambda or Amazon SNS topics, are not currently + supported. + """ + destination_arn: str | None = ... + """ + The ARN of the queue that receives the moved messages. You can use this + field to specify the destination queue where you would like to redrive + messages. If this field is left blank, the messages will be redriven + back to their respective original source queues. + """ + max_number_of_messages_per_second: int | None = ... + """ + The number of messages to be moved per second (the message movement + rate). You can use this field to define a fixed message movement rate. + The maximum value for messages per second is 500. If this field is left + blank, the system will optimize the rate based on the queue message + backlog size, which may vary throughout the duration of the message + movement task. + """ + +@dataclass(kw_only=True) +class StartMessageMoveTaskOutput(_SerdeShape): + """Dataclass for StartMessageMoveTaskOutput structure.""" + + task_handle: str | None = ... + """ + An identifier associated with a message movement task. You can use this + identifier to cancel a specified message movement task using the + `CancelMessageMoveTask` action. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class TagQueueInput(_SerdeShape): + """Dataclass for TagQueueInput structure.""" + + queue_url: str | None = ... + """The URL of the queue.""" + tags: dict[str, str] | None = ... + """The list of tags to be added to the specified queue.""" + +@dataclass(kw_only=True) +class TagQueueOutput(_SerdeShape): + """Dataclass for TagQueueOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class TooManyEntriesInBatchRequest(ServiceError, _SerdeShape): + """ + The batch request contains more entries than permissible. For Amazon + SQS, the maximum number of entries you can include in a single + [SendMessageBatch](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_SendMessageBatch.html), + [DeleteMessageBatch](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_DeleteMessageBatch.html), + or + [ChangeMessageVisibilityBatch](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ChangeMessageVisibilityBatch.html) + request is 10. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UnsupportedOperation(ServiceError, _SerdeShape): + """Error code 400. Unsupported operation.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class UntagQueueInput(_SerdeShape): + """Dataclass for UntagQueueInput structure.""" + + queue_url: str | None = ... + """The URL of the queue.""" + tag_keys: list[str] | None = ... + """The list of tags to be removed from the specified queue.""" + +@dataclass(kw_only=True) +class UntagQueueOutput(_SerdeShape): + """Dataclass for UntagQueueOutput structure.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +ADD_PERMISSION: APIOperation[AddPermissionInput, AddPermissionOutput] +CANCEL_MESSAGE_MOVE_TASK: APIOperation[ + CancelMessageMoveTaskInput, CancelMessageMoveTaskOutput +] +CHANGE_MESSAGE_VISIBILITY: APIOperation[ + ChangeMessageVisibilityInput, ChangeMessageVisibilityOutput +] +CHANGE_MESSAGE_VISIBILITY_BATCH: APIOperation[ + ChangeMessageVisibilityBatchInput, ChangeMessageVisibilityBatchOutput +] +CREATE_QUEUE: APIOperation[CreateQueueInput, CreateQueueOutput] +DELETE_MESSAGE: APIOperation[DeleteMessageInput, DeleteMessageOutput] +DELETE_MESSAGE_BATCH: APIOperation[DeleteMessageBatchInput, DeleteMessageBatchOutput] +DELETE_QUEUE: APIOperation[DeleteQueueInput, DeleteQueueOutput] +GET_QUEUE_ATTRIBUTES: APIOperation[GetQueueAttributesInput, GetQueueAttributesOutput] +GET_QUEUE_URL: APIOperation[GetQueueUrlInput, GetQueueUrlOutput] +LIST_DEAD_LETTER_SOURCE_QUEUES: APIOperation[ + ListDeadLetterSourceQueuesInput, ListDeadLetterSourceQueuesOutput +] +LIST_MESSAGE_MOVE_TASKS: APIOperation[ + ListMessageMoveTasksInput, ListMessageMoveTasksOutput +] +LIST_QUEUES: APIOperation[ListQueuesInput, ListQueuesOutput] +LIST_QUEUE_TAGS: APIOperation[ListQueueTagsInput, ListQueueTagsOutput] +PURGE_QUEUE: APIOperation[PurgeQueueInput, PurgeQueueOutput] +RECEIVE_MESSAGE: APIOperation[ReceiveMessageInput, ReceiveMessageOutput] +REMOVE_PERMISSION: APIOperation[RemovePermissionInput, RemovePermissionOutput] +SEND_MESSAGE: APIOperation[SendMessageInput, SendMessageOutput] +SEND_MESSAGE_BATCH: APIOperation[SendMessageBatchInput, SendMessageBatchOutput] +SET_QUEUE_ATTRIBUTES: APIOperation[SetQueueAttributesInput, SetQueueAttributesOutput] +START_MESSAGE_MOVE_TASK: APIOperation[ + StartMessageMoveTaskInput, StartMessageMoveTaskOutput +] +TAG_QUEUE: APIOperation[TagQueueInput, TagQueueOutput] +UNTAG_QUEUE: APIOperation[UntagQueueInput, UntagQueueOutput] diff --git a/clients/aws-sdk-sts/scripts/docs/generate_doc_stubs.py b/clients/aws-sdk-sts/scripts/docs/generate_doc_stubs.py index 52d470bc..795f2e4b 100644 --- a/clients/aws-sdk-sts/scripts/docs/generate_doc_stubs.py +++ b/clients/aws-sdk-sts/scripts/docs/generate_doc_stubs.py @@ -126,7 +126,9 @@ class ClientInfo: class DocStubGenerator: """Generate markdown API Reference stubs for AWS SDK for Python v4 clients.""" - def __init__(self, client_dir: Path, output_dir: Path, service_name: str | None = None) -> None: + def __init__( + self, client_dir: Path, output_dir: Path, service_name: str | None = None + ) -> None: """ Initialize the documentation generator. @@ -190,7 +192,9 @@ def _analyze_client_package(self, package_name: str) -> ClientInfo: required = ("client", "config", "models") missing = [name for name in required if not package.modules.get(name)] if missing: - raise ValueError(f"Missing required modules in {package_name}: {', '.join(missing)}") + raise ValueError( + f"Missing required modules in {package_name}: {', '.join(missing)}" + ) # Parse submodules client_module = package.modules["client"] @@ -199,11 +203,15 @@ def _analyze_client_package(self, package_name: str) -> ClientInfo: client_class = self._find_class_with_suffix(client_module, "Client") if not client_class: - raise ValueError(f"No class ending with 'Client' found in {package_name}.client") + raise ValueError( + f"No class ending with 'Client' found in {package_name}.client" + ) config_class = self._find_class_with_suffix(config_module, "Config") if not config_class: - raise ValueError(f"No class ending with 'Config' found in {package_name}.config") + raise ValueError( + f"No class ending with 'Config' found in {package_name}.config" + ) plugin_alias = config_module.members.get("Plugin") if not plugin_alias: @@ -288,7 +296,9 @@ def _analyze_operation(self, operation: Function) -> OperationInfo: if output_type in stream_type_map: stream_type = stream_type_map[output_type] - stream_args = self._get_subscript_elements(returns, f"'{operation.name}' stream type") + stream_args = self._get_subscript_elements( + returns, f"'{operation.name}' stream type" + ) if stream_type in (StreamType.INPUT, StreamType.DUPLEX): event_input_type = stream_args[0].canonical_name @@ -316,7 +326,9 @@ def _analyze_operation(self, operation: Function) -> OperationInfo: def _get_expr(self, annotation: str | Expr | None, context: str) -> Expr: """Extract and validate an Expr from an annotation.""" if not isinstance(annotation, Expr): - raise TypeError(f"{context}: expected Expr, got {type(annotation).__name__}") + raise TypeError( + f"{context}: expected Expr, got {type(annotation).__name__}" + ) return annotation def _get_subscript_elements(self, expr: Expr, context: str) -> list[Expr]: @@ -330,7 +342,9 @@ def _get_subscript_elements(self, expr: Expr, context: str) -> list[Expr]: return [el for el in slice_expr.elements if isinstance(el, Expr)] return [slice_expr] - def _extract_models(self, models_module: Module, operations: list[OperationInfo]) -> ModelsInfo: + def _extract_models( + self, models_module: Module, operations: list[OperationInfo] + ) -> ModelsInfo: """Extract structures, unions, enums, and errors from models module.""" structures, unions, enums, errors = [], [], [], [] @@ -356,14 +370,16 @@ def _extract_models(self, models_module: Module, operations: list[OperationInfo] duplicates = [] for structure in structures: - if self._is_operation_io_type(structure.name, operations) or self._is_union_member( - structure.name, unions - ): + if self._is_operation_io_type( + structure.name, operations + ) or self._is_union_member(structure.name, unions): duplicates.append(structure) structures = [struct for struct in structures if struct not in duplicates] - return ModelsInfo(structures=structures, unions=unions, enums=enums, errors=errors) + return ModelsInfo( + structures=structures, unions=unions, enums=enums, errors=errors + ) def _is_union(self, member: Object | Alias) -> TypeGuard[Attribute]: """Check if a module member is a union type.""" @@ -399,7 +415,9 @@ def _extract_union_members( for name in member_names: if not (member_object := models_module.members.get(name)): raise ValueError(f"Union member '{name}' not found in models module") - members.append(TypeInfo(name=member_object.name, module_path=member_object.path)) + members.append( + TypeInfo(name=member_object.name, module_path=member_object.path) + ) return members @@ -408,7 +426,8 @@ def _is_enum(self, member: Object | Alias) -> TypeGuard[Class]: if not isinstance(member, Class): return False return any( - isinstance(base, ExprName) and base.name in ENUM_BASE_CLASSES for base in member.bases + isinstance(base, ExprName) and base.name in ENUM_BASE_CLASSES + for base in member.bases ) def _is_error(self, member: Object | Alias) -> TypeGuard[Class]: @@ -416,10 +435,13 @@ def _is_error(self, member: Object | Alias) -> TypeGuard[Class]: if not isinstance(member, Class): return False return any( - isinstance(base, ExprName) and base.name in ERROR_BASE_CLASSES for base in member.bases + isinstance(base, ExprName) and base.name in ERROR_BASE_CLASSES + for base in member.bases ) - def _is_operation_io_type(self, type_name: str, operations: list[OperationInfo]) -> bool: + def _is_operation_io_type( + self, type_name: str, operations: list[OperationInfo] + ) -> bool: """Check if a type is used as operation input/output.""" return any(type_name in (op.input.name, op.output.name) for op in operations) @@ -437,8 +459,12 @@ def _generate_client_docs(self, client_info: ClientInfo) -> bool: self._generate_type_stubs( client_info.models.structures, "structures", "Structure Class" ) - self._generate_type_stubs(client_info.models.errors, "errors", "Error Class") - self._generate_type_stubs(client_info.models.enums, "enums", "Enum Class", members=True) + self._generate_type_stubs( + client_info.models.errors, "errors", "Error Class" + ) + self._generate_type_stubs( + client_info.models.enums, "enums", "Enum Class", members=True + ) self._generate_union_stubs(client_info.models.unions) except OSError as e: logger.error(f"Failed to write documentation files: {e}") @@ -470,7 +496,9 @@ def _generate_index(self, client_info: ClientInfo) -> None: ] for method in sorted(client_info.client_methods, key=lambda x: x.name): - lines.extend([*self._mkdocs_directive(method.module_path, heading_level=4), ""]) + lines.extend( + [*self._mkdocs_directive(method.module_path, heading_level=4), ""] + ) # Operations section if client_info.operations: @@ -578,7 +606,9 @@ def _generate_operation_stubs(self, operations: list[OperationInfo]) -> None: output_path = self.output_dir / "operations" / f"{op.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb("Operations", op.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb("Operations", op.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(operations)} operation file(s)") @@ -600,7 +630,9 @@ def _generate_type_stubs( output_path = self.output_dir / category / f"{item.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb(category.title(), item.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb(category.title(), item.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(items)} {category} file(s)") @@ -624,7 +656,9 @@ def _generate_union_stubs(self, unions: list[UnionInfo]) -> None: output_path = self.output_dir / "unions" / f"{union.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb("Unions", union.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb("Unions", union.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(unions)} union file(s)") diff --git a/clients/aws-sdk-sts/src/aws_sdk_sts/_private/schemas.py b/clients/aws-sdk-sts/src/aws_sdk_sts/_private/schemas.py index ddcac6de..56277a13 100644 --- a/clients/aws-sdk-sts/src/aws_sdk_sts/_private/schemas.py +++ b/clients/aws-sdk-sts/src/aws_sdk_sts/_private/schemas.py @@ -2,1502 +2,1457 @@ from types import MappingProxyType -from smithy_core.schemas import Schema -from smithy_core.shapes import ShapeID, ShapeType -from smithy_core.traits import Trait - - -ACCESS_KEY_ID_TYPE = Schema( - id=ShapeID("com.amazonaws.sts#accessKeyIdType"), shape_type=ShapeType.STRING -) - -ACCESS_KEY_SECRET_TYPE = Schema( - id=ShapeID("com.amazonaws.sts#accessKeySecretType"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -ACCOUNT_TYPE = Schema( - id=ShapeID("com.amazonaws.sts#accountType"), shape_type=ShapeType.STRING -) - -ARN_TYPE = Schema(id=ShapeID("com.amazonaws.sts#arnType"), shape_type=ShapeType.STRING) - -ASSUMED_ROLE_ID_TYPE = Schema( - id=ShapeID("com.amazonaws.sts#assumedRoleIdType"), shape_type=ShapeType.STRING -) - -ASSUMED_ROLE_USER = Schema.collection( - id=ShapeID("com.amazonaws.sts#AssumedRoleUser"), - members={ - "AssumedRoleId": { - "target": ASSUMED_ROLE_ID_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Arn": { - "target": ARN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -ROLE_DURATION_SECONDS_TYPE = Schema( - id=ShapeID("com.amazonaws.sts#roleDurationSecondsType"), - shape_type=ShapeType.INTEGER, -) - -EXTERNAL_ID_TYPE = Schema( - id=ShapeID("com.amazonaws.sts#externalIdType"), shape_type=ShapeType.STRING -) - -MINIMUM_SESSION_TOKEN_SIZE_TYPE = Schema( - id=ShapeID("com.amazonaws.sts#minimumSessionTokenSizeType"), - shape_type=ShapeType.INTEGER, -) - -UNRESTRICTED_SESSION_POLICY_DOCUMENT_TYPE = Schema( - id=ShapeID("com.amazonaws.sts#unrestrictedSessionPolicyDocumentType"), - shape_type=ShapeType.STRING, -) - -POLICY_DESCRIPTOR_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.sts#PolicyDescriptorType"), - members={"arn": {"target": ARN_TYPE}}, -) - -POLICY_DESCRIPTOR_LIST_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.sts#policyDescriptorListType"), - shape_type=ShapeType.LIST, - members={"member": {"target": POLICY_DESCRIPTOR_TYPE}}, -) - -CONTEXT_ASSERTION_TYPE = Schema( - id=ShapeID("com.amazonaws.sts#contextAssertionType"), shape_type=ShapeType.STRING -) - -PROVIDED_CONTEXT = Schema.collection( - id=ShapeID("com.amazonaws.sts#ProvidedContext"), - members={ - "ProviderArn": {"target": ARN_TYPE}, - "ContextAssertion": {"target": CONTEXT_ASSERTION_TYPE}, - }, -) - -PROVIDED_CONTEXTS_LIST_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.sts#ProvidedContextsListType"), - shape_type=ShapeType.LIST, - members={"member": {"target": PROVIDED_CONTEXT}}, -) - -ROLE_SESSION_NAME_TYPE = Schema( - id=ShapeID("com.amazonaws.sts#roleSessionNameType"), shape_type=ShapeType.STRING -) - -SERIAL_NUMBER_TYPE = Schema( - id=ShapeID("com.amazonaws.sts#serialNumberType"), shape_type=ShapeType.STRING -) - -SOURCE_IDENTITY_TYPE = Schema( - id=ShapeID("com.amazonaws.sts#sourceIdentityType"), shape_type=ShapeType.STRING -) - -TAG_KEY_TYPE = Schema( - id=ShapeID("com.amazonaws.sts#tagKeyType"), shape_type=ShapeType.STRING -) - -TAG_VALUE_TYPE = Schema( - id=ShapeID("com.amazonaws.sts#tagValueType"), shape_type=ShapeType.STRING -) - -TAG = Schema.collection( - id=ShapeID("com.amazonaws.sts#Tag"), - members={ - "Key": { - "target": TAG_KEY_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Value": { - "target": TAG_VALUE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -TAG_LIST_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.sts#tagListType"), - shape_type=ShapeType.LIST, - members={"member": {"target": TAG}}, -) - -TOKEN_CODE_TYPE = Schema( - id=ShapeID("com.amazonaws.sts#tokenCodeType"), shape_type=ShapeType.STRING -) - -TAG_KEY_LIST_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.sts#tagKeyListType"), - shape_type=ShapeType.LIST, - members={"member": {"target": TAG_KEY_TYPE}}, -) - -ASSUME_ROLE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sts#AssumeRoleInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sts#AssumeRoleRequest", - ) - ], - members={ - "RoleArn": { - "target": ARN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "RoleSessionName": { - "target": ROLE_SESSION_NAME_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "PolicyArns": {"target": POLICY_DESCRIPTOR_LIST_TYPE}, - "Policy": {"target": UNRESTRICTED_SESSION_POLICY_DOCUMENT_TYPE}, - "DurationSeconds": {"target": ROLE_DURATION_SECONDS_TYPE}, - "Tags": {"target": TAG_LIST_TYPE}, - "TransitiveTagKeys": {"target": TAG_KEY_LIST_TYPE}, - "ExternalId": {"target": EXTERNAL_ID_TYPE}, - "SerialNumber": {"target": SERIAL_NUMBER_TYPE}, - "TokenCode": {"target": TOKEN_CODE_TYPE}, - "SourceIdentity": {"target": SOURCE_IDENTITY_TYPE}, - "ProvidedContexts": {"target": PROVIDED_CONTEXTS_LIST_TYPE}, - "MinimumSessionTokenSize": {"target": MINIMUM_SESSION_TOKEN_SIZE_TYPE}, - }, -) - -DATE_TYPE = Schema( - id=ShapeID("com.amazonaws.sts#dateType"), shape_type=ShapeType.TIMESTAMP -) - -TOKEN_TYPE = Schema( - id=ShapeID("com.amazonaws.sts#tokenType"), shape_type=ShapeType.STRING -) - -CREDENTIALS = Schema.collection( - id=ShapeID("com.amazonaws.sts#Credentials"), - members={ - "AccessKeyId": { - "target": ACCESS_KEY_ID_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "SecretAccessKey": { - "target": ACCESS_KEY_SECRET_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "SessionToken": { - "target": TOKEN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Expiration": { - "target": DATE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -NON_NEGATIVE_INTEGER_TYPE = Schema( - id=ShapeID("com.amazonaws.sts#nonNegativeIntegerType"), shape_type=ShapeType.INTEGER -) - -SESSION_TOKEN_SIZE_TYPE = Schema( - id=ShapeID("com.amazonaws.sts#sessionTokenSizeType"), shape_type=ShapeType.INTEGER +from smithy_core._schema_compact import StaticOperationSchema, StaticSchema + + +n0 = "com.amazonaws.sts" +_aKIT = "accessKeyIdType" +_aKST = "accessKeySecretType" +_s = "smithy.api#sensitive" +_aT = "accountType" +_aTr = "arnType" +_aRIT = "assumedRoleIdType" +_ARU = "AssumedRoleUser" +_ARI = "AssumedRoleId" +_sm = "smithy.api#required" +_A = "Arn" +_rDST = "roleDurationSecondsType" +_eIT = "externalIdType" +_mSTST = "minimumSessionTokenSizeType" +_uSPDT = "unrestrictedSessionPolicyDocumentType" +_PDT = "PolicyDescriptorType" +_a = "arn" +_pDLT = "policyDescriptorListType" +_m = "member" +_cAT = "contextAssertionType" +_PC = "ProvidedContext" +_PA = "ProviderArn" +_CA = "ContextAssertion" +_PCLT = "ProvidedContextsListType" +_rSNT = "roleSessionNameType" +_sNT = "serialNumberType" +_sIT = "sourceIdentityType" +_tKT = "tagKeyType" +_tVT = "tagValueType" +_T = "Tag" +_K = "Key" +_V = "Value" +_tLT = "tagListType" +_tCT = "tokenCodeType" +_tKLT = "tagKeyListType" +_ARIs = "AssumeRoleInput" +_sSI = "smithy.synthetic#originalShapeId" +_cARR = "com.amazonaws.sts#AssumeRoleRequest" +_smi = "smithy.api#input" +_RA = "RoleArn" +_RSN = "RoleSessionName" +_PAo = "PolicyArns" +_P = "Policy" +_DS = "DurationSeconds" +_Ta = "Tags" +_TTK = "TransitiveTagKeys" +_EI = "ExternalId" +_SN = "SerialNumber" +_TC = "TokenCode" +_SI = "SourceIdentity" +_PCr = "ProvidedContexts" +_MSTS = "MinimumSessionTokenSize" +_dT = "dateType" +_tT = "tokenType" +_C = "Credentials" +_AKI = "AccessKeyId" +_SAK = "SecretAccessKey" +_ST = "SessionToken" +_E = "Expiration" +_nNIT = "nonNegativeIntegerType" +_sTST = "sessionTokenSizeType" +_sTUT = "sessionTokenUtilizationType" +_ARO = "AssumeRoleOutput" +_cARRo = "com.amazonaws.sts#AssumeRoleResponse" +_smit = "smithy.api#output" +_PPS = "PackedPolicySize" +_STU = "SessionTokenUtilization" +_STS = "SessionTokenSize" +_eITM = "expiredIdentityTokenMessage" +_ETE = "ExpiredTokenException" +_smith = "smithy.api#error" +_c = "client" +_sE = "smithy.api#httpError" +_aQE = "aws.protocols#awsQueryError" +_me = "message" +_mPDM = "malformedPolicyDocumentMessage" +_MPDE = "MalformedPolicyDocumentException" +_pPTLM = "packedPolicyTooLargeMessage" +_PPTLE = "PackedPolicyTooLargeException" +_rDM = "regionDisabledMessage" +_RDE = "RegionDisabledException" +_AR = "AssumeRole" +_sPDT = "sessionPolicyDocumentType" +_SAMLAT = "SAMLAssertionType" +_ARWSAMLI = "AssumeRoleWithSAMLInput" +_cARWSAMLR = "com.amazonaws.sts#AssumeRoleWithSAMLRequest" +_PAr = "PrincipalArn" +_SAMLA = "SAMLAssertion" +_Au = "Audience" +_I = "Issuer" +_NQ = "NameQualifier" +_S = "Subject" +_STu = "SubjectType" +_ARWSAMLO = "AssumeRoleWithSAMLOutput" +_cARWSAMLRo = "com.amazonaws.sts#AssumeRoleWithSAMLResponse" +_iRCM = "idpRejectedClaimMessage" +_IDPRCE = "IDPRejectedClaimException" +_iITM = "invalidIdentityTokenMessage" +_IITE = "InvalidIdentityTokenException" +_ARWSAML = "AssumeRoleWithSAML" +_uT = "urlType" +_cTT = "clientTokenType" +_ARWWII = "AssumeRoleWithWebIdentityInput" +_cARWWIR = "com.amazonaws.sts#AssumeRoleWithWebIdentityRequest" +_WIT = "WebIdentityToken" +_PI = "ProviderId" +_wIST = "webIdentitySubjectType" +_ARWWIO = "AssumeRoleWithWebIdentityOutput" +_cARWWIRo = "com.amazonaws.sts#AssumeRoleWithWebIdentityResponse" +_SFWIT = "SubjectFromWebIdentityToken" +_Pr = "Provider" +_iCEM = "idpCommunicationErrorMessage" +_IDPCEE = "IDPCommunicationErrorException" +_ARWWI = "AssumeRoleWithWebIdentity" +_RDST = "RootDurationSecondsType" +_TPT = "TargetPrincipalType" +_ARIss = "AssumeRootInput" +_cARRom = "com.amazonaws.sts#AssumeRootRequest" +_TP = "TargetPrincipal" +_TPA = "TaskPolicyArn" +_AROs = "AssumeRootOutput" +_cARRoma = "com.amazonaws.sts#AssumeRootResponse" +_ARs = "AssumeRoot" +_eMT = "encodedMessageType" +_DAMI = "DecodeAuthorizationMessageInput" +_cDAMR = "com.amazonaws.sts#DecodeAuthorizationMessageRequest" +_EM = "EncodedMessage" +_dMT = "decodedMessageType" +_DAMO = "DecodeAuthorizationMessageOutput" +_cDAMRo = "com.amazonaws.sts#DecodeAuthorizationMessageResponse" +_DM = "DecodedMessage" +_iAM = "invalidAuthorizationMessage" +_IAME = "InvalidAuthorizationMessageException" +_DAM = "DecodeAuthorizationMessage" +_GAKII = "GetAccessKeyInfoInput" +_cGAKIR = "com.amazonaws.sts#GetAccessKeyInfoRequest" +_GAKIO = "GetAccessKeyInfoOutput" +_cGAKIRo = "com.amazonaws.sts#GetAccessKeyInfoResponse" +_Ac = "Account" +_GAKI = "GetAccessKeyInfo" +_GCII = "GetCallerIdentityInput" +_cGCIR = "com.amazonaws.sts#GetCallerIdentityRequest" +_uIT = "userIdType" +_GCIO = "GetCallerIdentityOutput" +_cGCIRo = "com.amazonaws.sts#GetCallerIdentityResponse" +_UI = "UserId" +_GCI = "GetCallerIdentity" +_eTITEM = "expiredTradeInTokenExceptionMessage" +_ETITE = "ExpiredTradeInTokenException" +_tITT = "tradeInTokenType" +_GDATI = "GetDelegatedAccessTokenInput" +_cGDATR = "com.amazonaws.sts#GetDelegatedAccessTokenRequest" +_TIT = "TradeInToken" +_GDATO = "GetDelegatedAccessTokenOutput" +_cGDATRo = "com.amazonaws.sts#GetDelegatedAccessTokenResponse" +_AP = "AssumedPrincipal" +_GDAT = "GetDelegatedAccessToken" +_dST = "durationSecondsType" +_uNT = "userNameType" +_GFTI = "GetFederationTokenInput" +_cGFTR = "com.amazonaws.sts#GetFederationTokenRequest" +_N = "Name" +_fIT = "federatedIdType" +_FU = "FederatedUser" +_FUI = "FederatedUserId" +_GFTO = "GetFederationTokenOutput" +_cGFTRo = "com.amazonaws.sts#GetFederationTokenResponse" +_GFT = "GetFederationToken" +_GSTI = "GetSessionTokenInput" +_cGSTR = "com.amazonaws.sts#GetSessionTokenRequest" +_GSTO = "GetSessionTokenOutput" +_cGSTRo = "com.amazonaws.sts#GetSessionTokenResponse" +_GST = "GetSessionToken" +_wITAST = "webIdentityTokenAudienceStringType" +_wITALT = "webIdentityTokenAudienceListType" +_wITDST = "webIdentityTokenDurationSecondsType" +_jAT = "jwtAlgorithmType" +_GWITI = "GetWebIdentityTokenInput" +_cGWITR = "com.amazonaws.sts#GetWebIdentityTokenRequest" +_SA = "SigningAlgorithm" +_wITT = "webIdentityTokenType" +_GWITO = "GetWebIdentityTokenOutput" +_cGWITRo = "com.amazonaws.sts#GetWebIdentityTokenResponse" +_JWTPSEE = "JWTPayloadSizeExceededException2" +_JWTPSEEa = "JWTPayloadSizeExceededException" +_OWIFDE = "OutboundWebIdentityFederationDisabledException2" +_OWIFDEu = "OutboundWebIdentityFederationDisabledException" +_SDEE = "SessionDurationEscalationException2" +_SDEEe = "SessionDurationEscalationException" +_GWIT = "GetWebIdentityToken" +_AWSSTSV = "AWSSecurityTokenServiceV20110615" +_aw = "aws.auth#sigv4" +_aws = "aws.auth#sigv4a" +_aQ = "aws.protocols#awsQuery" +_sB = "smithy.rules#endpointBdd" +_awsa = "aws.api#service" +_sN = "smithy.api#xmlNamespace" + +ACCESS_KEY_ID_TYPE: StaticSchema = (3, n0, _aKIT, 0) + +ACCESS_KEY_SECRET_TYPE: StaticSchema = (3, n0, _aKST, 4) + +ACCOUNT_TYPE: StaticSchema = (3, n0, _aT, 0) + +ARN_TYPE: StaticSchema = (3, n0, _aTr, 0) + +ASSUMED_ROLE_ID_TYPE: StaticSchema = (3, n0, _aRIT, 0) + +ASSUMED_ROLE_USER: StaticSchema = ( + 18, + n0, + _ARU, + 0, + (_ARI, _A), + ((ASSUMED_ROLE_ID_TYPE, 1), (ARN_TYPE, 1)), +) + +ROLE_DURATION_SECONDS_TYPE: StaticSchema = (7, n0, _rDST, 0) + +EXTERNAL_ID_TYPE: StaticSchema = (3, n0, _eIT, 0) + +MINIMUM_SESSION_TOKEN_SIZE_TYPE: StaticSchema = (7, n0, _mSTST, 0) + +UNRESTRICTED_SESSION_POLICY_DOCUMENT_TYPE: StaticSchema = (3, n0, _uSPDT, 0) + +POLICY_DESCRIPTOR_TYPE: StaticSchema = (18, n0, _PDT, 0, (_a,), ((ARN_TYPE, 0),)) + +POLICY_DESCRIPTOR_LIST_TYPE: StaticSchema = ( + 16, + n0, + _pDLT, + 0, + (_m,), + ((POLICY_DESCRIPTOR_TYPE, 0),), +) + +CONTEXT_ASSERTION_TYPE: StaticSchema = (3, n0, _cAT, 0) + +PROVIDED_CONTEXT: StaticSchema = ( + 18, + n0, + _PC, + 0, + (_PA, _CA), + ((ARN_TYPE, 0), (CONTEXT_ASSERTION_TYPE, 0)), +) + +PROVIDED_CONTEXTS_LIST_TYPE: StaticSchema = ( + 16, + n0, + _PCLT, + 0, + (_m,), + ((PROVIDED_CONTEXT, 0),), +) + +ROLE_SESSION_NAME_TYPE: StaticSchema = (3, n0, _rSNT, 0) + +SERIAL_NUMBER_TYPE: StaticSchema = (3, n0, _sNT, 0) + +SOURCE_IDENTITY_TYPE: StaticSchema = (3, n0, _sIT, 0) + +TAG_KEY_TYPE: StaticSchema = (3, n0, _tKT, 0) + +TAG_VALUE_TYPE: StaticSchema = (3, n0, _tVT, 0) + +TAG: StaticSchema = (18, n0, _T, 0, (_K, _V), ((TAG_KEY_TYPE, 1), (TAG_VALUE_TYPE, 1))) + +TAG_LIST_TYPE: StaticSchema = (16, n0, _tLT, 0, (_m,), ((TAG, 0),)) + +TOKEN_CODE_TYPE: StaticSchema = (3, n0, _tCT, 0) + +TAG_KEY_LIST_TYPE: StaticSchema = (16, n0, _tKLT, 0, (_m,), ((TAG_KEY_TYPE, 0),)) + +ASSUME_ROLE_INPUT: StaticSchema = ( + 18, + n0, + _ARIs, + {_sSI: _cARR, _smi: None}, + (_RA, _RSN, _PAo, _P, _DS, _Ta, _TTK, _EI, _SN, _TC, _SI, _PCr, _MSTS), + ( + (ARN_TYPE, 1), + (ROLE_SESSION_NAME_TYPE, 1), + (POLICY_DESCRIPTOR_LIST_TYPE, 0), + (UNRESTRICTED_SESSION_POLICY_DOCUMENT_TYPE, 0), + (ROLE_DURATION_SECONDS_TYPE, 0), + (TAG_LIST_TYPE, 0), + (TAG_KEY_LIST_TYPE, 0), + (EXTERNAL_ID_TYPE, 0), + (SERIAL_NUMBER_TYPE, 0), + (TOKEN_CODE_TYPE, 0), + (SOURCE_IDENTITY_TYPE, 0), + (PROVIDED_CONTEXTS_LIST_TYPE, 0), + (MINIMUM_SESSION_TOKEN_SIZE_TYPE, 0), + ), ) -SESSION_TOKEN_UTILIZATION_TYPE = Schema( - id=ShapeID("com.amazonaws.sts#sessionTokenUtilizationType"), - shape_type=ShapeType.INTEGER, -) - -ASSUME_ROLE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sts#AssumeRoleOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sts#AssumeRoleResponse", - ) - ], - members={ - "Credentials": {"target": CREDENTIALS}, - "AssumedRoleUser": {"target": ASSUMED_ROLE_USER}, - "PackedPolicySize": {"target": NON_NEGATIVE_INTEGER_TYPE}, - "SourceIdentity": {"target": SOURCE_IDENTITY_TYPE}, - "SessionTokenUtilization": {"target": SESSION_TOKEN_UTILIZATION_TYPE}, - "SessionTokenSize": {"target": SESSION_TOKEN_SIZE_TYPE}, - }, -) - -EXPIRED_IDENTITY_TOKEN_MESSAGE = Schema( - id=ShapeID("com.amazonaws.sts#expiredIdentityTokenMessage"), - shape_type=ShapeType.STRING, -) - -EXPIRED_TOKEN_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.sts#ExpiredTokenException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "ExpiredTokenException", "httpResponseCode": 400} - ), - ), - ], - members={"message": {"target": EXPIRED_IDENTITY_TOKEN_MESSAGE}}, -) +DATE_TYPE: StaticSchema = (4, n0, _dT, 0) -MALFORMED_POLICY_DOCUMENT_MESSAGE = Schema( - id=ShapeID("com.amazonaws.sts#malformedPolicyDocumentMessage"), - shape_type=ShapeType.STRING, -) +TOKEN_TYPE: StaticSchema = (3, n0, _tT, 0) -MALFORMED_POLICY_DOCUMENT_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.sts#MalformedPolicyDocumentException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "MalformedPolicyDocument", "httpResponseCode": 400} - ), - ), - ], - members={"message": {"target": MALFORMED_POLICY_DOCUMENT_MESSAGE}}, +CREDENTIALS: StaticSchema = ( + 18, + n0, + _C, + 0, + (_AKI, _SAK, _ST, _E), + ( + (ACCESS_KEY_ID_TYPE, 1), + (ACCESS_KEY_SECRET_TYPE, 1), + (TOKEN_TYPE, 1), + (DATE_TYPE, 1), + ), ) -PACKED_POLICY_TOO_LARGE_MESSAGE = Schema( - id=ShapeID("com.amazonaws.sts#packedPolicyTooLargeMessage"), - shape_type=ShapeType.STRING, -) +NON_NEGATIVE_INTEGER_TYPE: StaticSchema = (7, n0, _nNIT, 0) -PACKED_POLICY_TOO_LARGE_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.sts#PackedPolicyTooLargeException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "PackedPolicyTooLarge", "httpResponseCode": 400} - ), - ), - ], - members={"message": {"target": PACKED_POLICY_TOO_LARGE_MESSAGE}}, -) +SESSION_TOKEN_SIZE_TYPE: StaticSchema = (7, n0, _sTST, 0) -REGION_DISABLED_MESSAGE = Schema( - id=ShapeID("com.amazonaws.sts#regionDisabledMessage"), shape_type=ShapeType.STRING -) +SESSION_TOKEN_UTILIZATION_TYPE: StaticSchema = (7, n0, _sTUT, 0) -REGION_DISABLED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.sts#RegionDisabledException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=403), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "RegionDisabledException", "httpResponseCode": 403} - ), +ASSUME_ROLE_OUTPUT: StaticSchema = ( + 18, + n0, + _ARO, + {_sSI: _cARRo, _smit: None}, + (_C, _ARU, _PPS, _SI, _STU, _STS), + ( + (CREDENTIALS, 0), + (ASSUMED_ROLE_USER, 0), + (NON_NEGATIVE_INTEGER_TYPE, 0), + (SOURCE_IDENTITY_TYPE, 0), + (SESSION_TOKEN_UTILIZATION_TYPE, 0), + (SESSION_TOKEN_SIZE_TYPE, 0), + ), +) + +EXPIRED_IDENTITY_TOKEN_MESSAGE: StaticSchema = (3, n0, _eITM, 0) + +EXPIRED_TOKEN_EXCEPTION: StaticSchema = ( + 18, + n0, + _ETE, + { + _smith: _c, + _sE: 400, + _aQE: MappingProxyType( + {"code": "ExpiredTokenException", "httpResponseCode": 400} ), - ], - members={"message": {"target": REGION_DISABLED_MESSAGE}}, -) - -ASSUME_ROLE = Schema( - id=ShapeID("com.amazonaws.sts#AssumeRole"), shape_type=ShapeType.OPERATION -) - -SESSION_POLICY_DOCUMENT_TYPE = Schema( - id=ShapeID("com.amazonaws.sts#sessionPolicyDocumentType"), - shape_type=ShapeType.STRING, -) - -SAML_ASSERTION_TYPE = Schema( - id=ShapeID("com.amazonaws.sts#SAMLAssertionType"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -ASSUME_ROLE_WITH_SAML_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sts#AssumeRoleWithSAMLInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sts#AssumeRoleWithSAMLRequest", - ) - ], - members={ - "RoleArn": { - "target": ARN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "PrincipalArn": { - "target": ARN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "SAMLAssertion": { - "target": SAML_ASSERTION_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "PolicyArns": {"target": POLICY_DESCRIPTOR_LIST_TYPE}, - "Policy": {"target": SESSION_POLICY_DOCUMENT_TYPE}, - "DurationSeconds": {"target": ROLE_DURATION_SECONDS_TYPE}, - "MinimumSessionTokenSize": {"target": MINIMUM_SESSION_TOKEN_SIZE_TYPE}, - }, -) - -AUDIENCE = Schema(id=ShapeID("com.amazonaws.sts#Audience"), shape_type=ShapeType.STRING) - -ISSUER = Schema(id=ShapeID("com.amazonaws.sts#Issuer"), shape_type=ShapeType.STRING) - -NAME_QUALIFIER = Schema( - id=ShapeID("com.amazonaws.sts#NameQualifier"), shape_type=ShapeType.STRING -) - -SUBJECT = Schema(id=ShapeID("com.amazonaws.sts#Subject"), shape_type=ShapeType.STRING) - -SUBJECT_TYPE = Schema( - id=ShapeID("com.amazonaws.sts#SubjectType"), shape_type=ShapeType.STRING -) - -ASSUME_ROLE_WITH_SAML_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sts#AssumeRoleWithSAMLOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sts#AssumeRoleWithSAMLResponse", - ) - ], - members={ - "Credentials": {"target": CREDENTIALS}, - "AssumedRoleUser": {"target": ASSUMED_ROLE_USER}, - "PackedPolicySize": {"target": NON_NEGATIVE_INTEGER_TYPE}, - "Subject": {"target": SUBJECT}, - "SubjectType": {"target": SUBJECT_TYPE}, - "Issuer": {"target": ISSUER}, - "Audience": {"target": AUDIENCE}, - "NameQualifier": {"target": NAME_QUALIFIER}, - "SourceIdentity": {"target": SOURCE_IDENTITY_TYPE}, - "SessionTokenUtilization": {"target": SESSION_TOKEN_UTILIZATION_TYPE}, - "SessionTokenSize": {"target": SESSION_TOKEN_SIZE_TYPE}, }, + (_me,), + ((EXPIRED_IDENTITY_TOKEN_MESSAGE, 0),), ) -IDP_REJECTED_CLAIM_MESSAGE = Schema( - id=ShapeID("com.amazonaws.sts#idpRejectedClaimMessage"), shape_type=ShapeType.STRING -) - -IDP_REJECTED_CLAIM_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.sts#IDPRejectedClaimException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=403), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "IDPRejectedClaim", "httpResponseCode": 403} - ), - ), - ], - members={"message": {"target": IDP_REJECTED_CLAIM_MESSAGE}}, -) - -INVALID_IDENTITY_TOKEN_MESSAGE = Schema( - id=ShapeID("com.amazonaws.sts#invalidIdentityTokenMessage"), - shape_type=ShapeType.STRING, -) +MALFORMED_POLICY_DOCUMENT_MESSAGE: StaticSchema = (3, n0, _mPDM, 0) -INVALID_IDENTITY_TOKEN_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.sts#InvalidIdentityTokenException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "InvalidIdentityToken", "httpResponseCode": 400} - ), +MALFORMED_POLICY_DOCUMENT_EXCEPTION: StaticSchema = ( + 18, + n0, + _MPDE, + { + _smith: _c, + _sE: 400, + _aQE: MappingProxyType( + {"code": "MalformedPolicyDocument", "httpResponseCode": 400} ), - ], - members={"message": {"target": INVALID_IDENTITY_TOKEN_MESSAGE}}, -) - -ASSUME_ROLE_WITH_SAML = Schema( - id=ShapeID("com.amazonaws.sts#AssumeRoleWithSAML"), shape_type=ShapeType.OPERATION -) - -URL_TYPE = Schema(id=ShapeID("com.amazonaws.sts#urlType"), shape_type=ShapeType.STRING) - -CLIENT_TOKEN_TYPE = Schema( - id=ShapeID("com.amazonaws.sts#clientTokenType"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -ASSUME_ROLE_WITH_WEB_IDENTITY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sts#AssumeRoleWithWebIdentityInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sts#AssumeRoleWithWebIdentityRequest", - ) - ], - members={ - "RoleArn": { - "target": ARN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "RoleSessionName": { - "target": ROLE_SESSION_NAME_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "WebIdentityToken": { - "target": CLIENT_TOKEN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ProviderId": {"target": URL_TYPE}, - "PolicyArns": {"target": POLICY_DESCRIPTOR_LIST_TYPE}, - "Policy": {"target": SESSION_POLICY_DOCUMENT_TYPE}, - "DurationSeconds": {"target": ROLE_DURATION_SECONDS_TYPE}, - "MinimumSessionTokenSize": {"target": MINIMUM_SESSION_TOKEN_SIZE_TYPE}, - }, -) - -WEB_IDENTITY_SUBJECT_TYPE = Schema( - id=ShapeID("com.amazonaws.sts#webIdentitySubjectType"), shape_type=ShapeType.STRING -) - -ASSUME_ROLE_WITH_WEB_IDENTITY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sts#AssumeRoleWithWebIdentityOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sts#AssumeRoleWithWebIdentityResponse", - ) - ], - members={ - "Credentials": {"target": CREDENTIALS}, - "SubjectFromWebIdentityToken": {"target": WEB_IDENTITY_SUBJECT_TYPE}, - "AssumedRoleUser": {"target": ASSUMED_ROLE_USER}, - "PackedPolicySize": {"target": NON_NEGATIVE_INTEGER_TYPE}, - "Provider": {"target": ISSUER}, - "Audience": {"target": AUDIENCE}, - "SourceIdentity": {"target": SOURCE_IDENTITY_TYPE}, - "SessionTokenUtilization": {"target": SESSION_TOKEN_UTILIZATION_TYPE}, - "SessionTokenSize": {"target": SESSION_TOKEN_SIZE_TYPE}, }, + (_me,), + ((MALFORMED_POLICY_DOCUMENT_MESSAGE, 0),), ) -IDP_COMMUNICATION_ERROR_MESSAGE = Schema( - id=ShapeID("com.amazonaws.sts#idpCommunicationErrorMessage"), - shape_type=ShapeType.STRING, -) +PACKED_POLICY_TOO_LARGE_MESSAGE: StaticSchema = (3, n0, _pPTLM, 0) -IDP_COMMUNICATION_ERROR_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.sts#IDPCommunicationErrorException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "IDPCommunicationError", "httpResponseCode": 400} - ), +PACKED_POLICY_TOO_LARGE_EXCEPTION: StaticSchema = ( + 18, + n0, + _PPTLE, + { + _smith: _c, + _sE: 400, + _aQE: MappingProxyType( + {"code": "PackedPolicyTooLarge", "httpResponseCode": 400} ), - ], - members={"message": {"target": IDP_COMMUNICATION_ERROR_MESSAGE}}, -) - -ASSUME_ROLE_WITH_WEB_IDENTITY = Schema( - id=ShapeID("com.amazonaws.sts#AssumeRoleWithWebIdentity"), - shape_type=ShapeType.OPERATION, -) - -ROOT_DURATION_SECONDS_TYPE = Schema( - id=ShapeID("com.amazonaws.sts#RootDurationSecondsType"), - shape_type=ShapeType.INTEGER, -) - -TARGET_PRINCIPAL_TYPE = Schema( - id=ShapeID("com.amazonaws.sts#TargetPrincipalType"), shape_type=ShapeType.STRING -) - -ASSUME_ROOT_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sts#AssumeRootInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sts#AssumeRootRequest", - ) - ], - members={ - "TargetPrincipal": { - "target": TARGET_PRINCIPAL_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "TaskPolicyArn": { - "target": POLICY_DESCRIPTOR_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "DurationSeconds": {"target": ROOT_DURATION_SECONDS_TYPE}, - "MinimumSessionTokenSize": {"target": MINIMUM_SESSION_TOKEN_SIZE_TYPE}, - }, -) - -ASSUME_ROOT_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sts#AssumeRootOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sts#AssumeRootResponse", - ) - ], - members={ - "Credentials": {"target": CREDENTIALS}, - "SourceIdentity": {"target": SOURCE_IDENTITY_TYPE}, - "SessionTokenUtilization": {"target": SESSION_TOKEN_UTILIZATION_TYPE}, - "SessionTokenSize": {"target": SESSION_TOKEN_SIZE_TYPE}, - }, -) - -ASSUME_ROOT = Schema( - id=ShapeID("com.amazonaws.sts#AssumeRoot"), shape_type=ShapeType.OPERATION -) - -ENCODED_MESSAGE_TYPE = Schema( - id=ShapeID("com.amazonaws.sts#encodedMessageType"), shape_type=ShapeType.STRING -) - -DECODE_AUTHORIZATION_MESSAGE_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sts#DecodeAuthorizationMessageInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sts#DecodeAuthorizationMessageRequest", - ) - ], - members={ - "EncodedMessage": { - "target": ENCODED_MESSAGE_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } }, + (_me,), + ((PACKED_POLICY_TOO_LARGE_MESSAGE, 0),), ) -DECODED_MESSAGE_TYPE = Schema( - id=ShapeID("com.amazonaws.sts#decodedMessageType"), shape_type=ShapeType.STRING -) - -DECODE_AUTHORIZATION_MESSAGE_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sts#DecodeAuthorizationMessageOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sts#DecodeAuthorizationMessageResponse", - ) - ], - members={"DecodedMessage": {"target": DECODED_MESSAGE_TYPE}}, -) - -INVALID_AUTHORIZATION_MESSAGE = Schema( - id=ShapeID("com.amazonaws.sts#invalidAuthorizationMessage"), - shape_type=ShapeType.STRING, -) +REGION_DISABLED_MESSAGE: StaticSchema = (3, n0, _rDM, 0) -INVALID_AUTHORIZATION_MESSAGE_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.sts#InvalidAuthorizationMessageException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - { - "code": "InvalidAuthorizationMessageException", - "httpResponseCode": 400, - } - ), +REGION_DISABLED_EXCEPTION: StaticSchema = ( + 18, + n0, + _RDE, + { + _smith: _c, + _sE: 403, + _aQE: MappingProxyType( + {"code": "RegionDisabledException", "httpResponseCode": 403} ), - ], - members={"message": {"target": INVALID_AUTHORIZATION_MESSAGE}}, -) - -DECODE_AUTHORIZATION_MESSAGE = Schema( - id=ShapeID("com.amazonaws.sts#DecodeAuthorizationMessage"), - shape_type=ShapeType.OPERATION, -) - -GET_ACCESS_KEY_INFO_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sts#GetAccessKeyInfoInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sts#GetAccessKeyInfoRequest", - ) - ], - members={ - "AccessKeyId": { - "target": ACCESS_KEY_ID_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } }, -) - -GET_ACCESS_KEY_INFO_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sts#GetAccessKeyInfoOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sts#GetAccessKeyInfoResponse", - ) - ], - members={"Account": {"target": ACCOUNT_TYPE}}, -) - -GET_ACCESS_KEY_INFO = Schema( - id=ShapeID("com.amazonaws.sts#GetAccessKeyInfo"), shape_type=ShapeType.OPERATION -) - -GET_CALLER_IDENTITY_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sts#GetCallerIdentityInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sts#GetCallerIdentityRequest", - ) - ], -) - -USER_ID_TYPE = Schema( - id=ShapeID("com.amazonaws.sts#userIdType"), shape_type=ShapeType.STRING -) - -GET_CALLER_IDENTITY_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sts#GetCallerIdentityOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sts#GetCallerIdentityResponse", - ) - ], - members={ - "UserId": {"target": USER_ID_TYPE}, - "Account": {"target": ACCOUNT_TYPE}, - "Arn": {"target": ARN_TYPE}, + (_me,), + ((REGION_DISABLED_MESSAGE, 0),), +) + +ASSUME_ROLE: StaticOperationSchema = ( + 23, + n0, + _AR, + 0, + ASSUME_ROLE_INPUT, + ASSUME_ROLE_OUTPUT, + ( + EXPIRED_TOKEN_EXCEPTION, + MALFORMED_POLICY_DOCUMENT_EXCEPTION, + PACKED_POLICY_TOO_LARGE_EXCEPTION, + REGION_DISABLED_EXCEPTION, + ), +) + +SESSION_POLICY_DOCUMENT_TYPE: StaticSchema = (3, n0, _sPDT, 0) + +SAML_ASSERTION_TYPE: StaticSchema = (3, n0, _SAMLAT, 4) + +ASSUME_ROLE_WITH_SAML_INPUT: StaticSchema = ( + 18, + n0, + _ARWSAMLI, + {_sSI: _cARWSAMLR, _smi: None}, + (_RA, _PAr, _SAMLA, _PAo, _P, _DS, _MSTS), + ( + (ARN_TYPE, 1), + (ARN_TYPE, 1), + (SAML_ASSERTION_TYPE, 1), + (POLICY_DESCRIPTOR_LIST_TYPE, 0), + (SESSION_POLICY_DOCUMENT_TYPE, 0), + (ROLE_DURATION_SECONDS_TYPE, 0), + (MINIMUM_SESSION_TOKEN_SIZE_TYPE, 0), + ), +) + +AUDIENCE: StaticSchema = (3, n0, _Au, 0) + +ISSUER: StaticSchema = (3, n0, _I, 0) + +NAME_QUALIFIER: StaticSchema = (3, n0, _NQ, 0) + +SUBJECT: StaticSchema = (3, n0, _S, 0) + +SUBJECT_TYPE: StaticSchema = (3, n0, _STu, 0) + +ASSUME_ROLE_WITH_SAML_OUTPUT: StaticSchema = ( + 18, + n0, + _ARWSAMLO, + {_sSI: _cARWSAMLRo, _smit: None}, + (_C, _ARU, _PPS, _S, _STu, _I, _Au, _NQ, _SI, _STU, _STS), + ( + (CREDENTIALS, 0), + (ASSUMED_ROLE_USER, 0), + (NON_NEGATIVE_INTEGER_TYPE, 0), + (SUBJECT, 0), + (SUBJECT_TYPE, 0), + (ISSUER, 0), + (AUDIENCE, 0), + (NAME_QUALIFIER, 0), + (SOURCE_IDENTITY_TYPE, 0), + (SESSION_TOKEN_UTILIZATION_TYPE, 0), + (SESSION_TOKEN_SIZE_TYPE, 0), + ), +) + +IDP_REJECTED_CLAIM_MESSAGE: StaticSchema = (3, n0, _iRCM, 0) + +IDP_REJECTED_CLAIM_EXCEPTION: StaticSchema = ( + 18, + n0, + _IDPRCE, + { + _smith: _c, + _sE: 403, + _aQE: MappingProxyType({"code": "IDPRejectedClaim", "httpResponseCode": 403}), }, + (_me,), + ((IDP_REJECTED_CLAIM_MESSAGE, 0),), ) -GET_CALLER_IDENTITY = Schema( - id=ShapeID("com.amazonaws.sts#GetCallerIdentity"), shape_type=ShapeType.OPERATION -) - -EXPIRED_TRADE_IN_TOKEN_EXCEPTION_MESSAGE = Schema( - id=ShapeID("com.amazonaws.sts#expiredTradeInTokenExceptionMessage"), - shape_type=ShapeType.STRING, -) +INVALID_IDENTITY_TOKEN_MESSAGE: StaticSchema = (3, n0, _iITM, 0) -EXPIRED_TRADE_IN_TOKEN_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.sts#ExpiredTradeInTokenException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "ExpiredTradeInTokenException", "httpResponseCode": 400} - ), +INVALID_IDENTITY_TOKEN_EXCEPTION: StaticSchema = ( + 18, + n0, + _IITE, + { + _smith: _c, + _sE: 400, + _aQE: MappingProxyType( + {"code": "InvalidIdentityToken", "httpResponseCode": 400} ), - ], - members={"message": {"target": EXPIRED_TRADE_IN_TOKEN_EXCEPTION_MESSAGE}}, -) - -TRADE_IN_TOKEN_TYPE = Schema( - id=ShapeID("com.amazonaws.sts#tradeInTokenType"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -GET_DELEGATED_ACCESS_TOKEN_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sts#GetDelegatedAccessTokenInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sts#GetDelegatedAccessTokenRequest", - ) - ], - members={ - "TradeInToken": { - "target": TRADE_IN_TOKEN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } }, -) - -GET_DELEGATED_ACCESS_TOKEN_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sts#GetDelegatedAccessTokenOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sts#GetDelegatedAccessTokenResponse", - ) - ], - members={ - "Credentials": {"target": CREDENTIALS}, - "PackedPolicySize": {"target": NON_NEGATIVE_INTEGER_TYPE}, - "AssumedPrincipal": {"target": ARN_TYPE}, - }, -) - -GET_DELEGATED_ACCESS_TOKEN = Schema( - id=ShapeID("com.amazonaws.sts#GetDelegatedAccessToken"), - shape_type=ShapeType.OPERATION, -) - -DURATION_SECONDS_TYPE = Schema( - id=ShapeID("com.amazonaws.sts#durationSecondsType"), shape_type=ShapeType.INTEGER -) - -USER_NAME_TYPE = Schema( - id=ShapeID("com.amazonaws.sts#userNameType"), shape_type=ShapeType.STRING -) - -GET_FEDERATION_TOKEN_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sts#GetFederationTokenInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sts#GetFederationTokenRequest", - ) - ], - members={ - "Name": { - "target": USER_NAME_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Policy": {"target": SESSION_POLICY_DOCUMENT_TYPE}, - "PolicyArns": {"target": POLICY_DESCRIPTOR_LIST_TYPE}, - "DurationSeconds": {"target": DURATION_SECONDS_TYPE}, - "Tags": {"target": TAG_LIST_TYPE}, - "MinimumSessionTokenSize": {"target": MINIMUM_SESSION_TOKEN_SIZE_TYPE}, - }, -) - -FEDERATED_ID_TYPE = Schema( - id=ShapeID("com.amazonaws.sts#federatedIdType"), shape_type=ShapeType.STRING -) - -FEDERATED_USER = Schema.collection( - id=ShapeID("com.amazonaws.sts#FederatedUser"), - members={ - "FederatedUserId": { - "target": FEDERATED_ID_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Arn": { - "target": ARN_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -GET_FEDERATION_TOKEN_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sts#GetFederationTokenOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sts#GetFederationTokenResponse", - ) - ], - members={ - "Credentials": {"target": CREDENTIALS}, - "FederatedUser": {"target": FEDERATED_USER}, - "PackedPolicySize": {"target": NON_NEGATIVE_INTEGER_TYPE}, - "SessionTokenUtilization": {"target": SESSION_TOKEN_UTILIZATION_TYPE}, - "SessionTokenSize": {"target": SESSION_TOKEN_SIZE_TYPE}, - }, -) - -GET_FEDERATION_TOKEN = Schema( - id=ShapeID("com.amazonaws.sts#GetFederationToken"), shape_type=ShapeType.OPERATION -) - -GET_SESSION_TOKEN_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sts#GetSessionTokenInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sts#GetSessionTokenRequest", - ) - ], - members={ - "DurationSeconds": {"target": DURATION_SECONDS_TYPE}, - "SerialNumber": {"target": SERIAL_NUMBER_TYPE}, - "TokenCode": {"target": TOKEN_CODE_TYPE}, - "MinimumSessionTokenSize": {"target": MINIMUM_SESSION_TOKEN_SIZE_TYPE}, - }, -) - -GET_SESSION_TOKEN_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sts#GetSessionTokenOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sts#GetSessionTokenResponse", - ) - ], - members={ - "Credentials": {"target": CREDENTIALS}, - "SessionTokenUtilization": {"target": SESSION_TOKEN_UTILIZATION_TYPE}, - "SessionTokenSize": {"target": SESSION_TOKEN_SIZE_TYPE}, - }, -) - -GET_SESSION_TOKEN = Schema( - id=ShapeID("com.amazonaws.sts#GetSessionToken"), shape_type=ShapeType.OPERATION -) - -WEB_IDENTITY_TOKEN_AUDIENCE_STRING_TYPE = Schema( - id=ShapeID("com.amazonaws.sts#webIdentityTokenAudienceStringType"), - shape_type=ShapeType.STRING, -) - -WEB_IDENTITY_TOKEN_AUDIENCE_LIST_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.sts#webIdentityTokenAudienceListType"), - shape_type=ShapeType.LIST, - members={"member": {"target": WEB_IDENTITY_TOKEN_AUDIENCE_STRING_TYPE}}, -) - -WEB_IDENTITY_TOKEN_DURATION_SECONDS_TYPE = Schema( - id=ShapeID("com.amazonaws.sts#webIdentityTokenDurationSecondsType"), - shape_type=ShapeType.INTEGER, -) - -JWT_ALGORITHM_TYPE = Schema( - id=ShapeID("com.amazonaws.sts#jwtAlgorithmType"), shape_type=ShapeType.STRING -) - -GET_WEB_IDENTITY_TOKEN_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.sts#GetWebIdentityTokenInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sts#GetWebIdentityTokenRequest", - ) - ], - members={ - "Audience": { - "target": WEB_IDENTITY_TOKEN_AUDIENCE_LIST_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "DurationSeconds": {"target": WEB_IDENTITY_TOKEN_DURATION_SECONDS_TYPE}, - "SigningAlgorithm": { - "target": JWT_ALGORITHM_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "Tags": {"target": TAG_LIST_TYPE}, + (_me,), + ((INVALID_IDENTITY_TOKEN_MESSAGE, 0),), +) + +ASSUME_ROLE_WITH_SAML: StaticOperationSchema = ( + 23, + n0, + _ARWSAML, + 0, + ASSUME_ROLE_WITH_SAML_INPUT, + ASSUME_ROLE_WITH_SAML_OUTPUT, + ( + EXPIRED_TOKEN_EXCEPTION, + IDP_REJECTED_CLAIM_EXCEPTION, + INVALID_IDENTITY_TOKEN_EXCEPTION, + MALFORMED_POLICY_DOCUMENT_EXCEPTION, + PACKED_POLICY_TOO_LARGE_EXCEPTION, + REGION_DISABLED_EXCEPTION, + ), +) + +URL_TYPE: StaticSchema = (3, n0, _uT, 0) + +CLIENT_TOKEN_TYPE: StaticSchema = (3, n0, _cTT, 4) + +ASSUME_ROLE_WITH_WEB_IDENTITY_INPUT: StaticSchema = ( + 18, + n0, + _ARWWII, + {_sSI: _cARWWIR, _smi: None}, + (_RA, _RSN, _WIT, _PI, _PAo, _P, _DS, _MSTS), + ( + (ARN_TYPE, 1), + (ROLE_SESSION_NAME_TYPE, 1), + (CLIENT_TOKEN_TYPE, 1), + (URL_TYPE, 0), + (POLICY_DESCRIPTOR_LIST_TYPE, 0), + (SESSION_POLICY_DOCUMENT_TYPE, 0), + (ROLE_DURATION_SECONDS_TYPE, 0), + (MINIMUM_SESSION_TOKEN_SIZE_TYPE, 0), + ), +) + +WEB_IDENTITY_SUBJECT_TYPE: StaticSchema = (3, n0, _wIST, 0) + +ASSUME_ROLE_WITH_WEB_IDENTITY_OUTPUT: StaticSchema = ( + 18, + n0, + _ARWWIO, + {_sSI: _cARWWIRo, _smit: None}, + (_C, _SFWIT, _ARU, _PPS, _Pr, _Au, _SI, _STU, _STS), + ( + (CREDENTIALS, 0), + (WEB_IDENTITY_SUBJECT_TYPE, 0), + (ASSUMED_ROLE_USER, 0), + (NON_NEGATIVE_INTEGER_TYPE, 0), + (ISSUER, 0), + (AUDIENCE, 0), + (SOURCE_IDENTITY_TYPE, 0), + (SESSION_TOKEN_UTILIZATION_TYPE, 0), + (SESSION_TOKEN_SIZE_TYPE, 0), + ), +) + +IDP_COMMUNICATION_ERROR_MESSAGE: StaticSchema = (3, n0, _iCEM, 0) + +IDP_COMMUNICATION_ERROR_EXCEPTION: StaticSchema = ( + 18, + n0, + _IDPCEE, + { + _smith: _c, + _sE: 400, + _aQE: MappingProxyType( + {"code": "IDPCommunicationError", "httpResponseCode": 400} + ), }, -) - -WEB_IDENTITY_TOKEN_TYPE = Schema( - id=ShapeID("com.amazonaws.sts#webIdentityTokenType"), - shape_type=ShapeType.STRING, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], -) - -GET_WEB_IDENTITY_TOKEN_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.sts#GetWebIdentityTokenOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.sts#GetWebIdentityTokenResponse", - ) - ], - members={ - "WebIdentityToken": {"target": WEB_IDENTITY_TOKEN_TYPE}, - "Expiration": {"target": DATE_TYPE}, + (_me,), + ((IDP_COMMUNICATION_ERROR_MESSAGE, 0),), +) + +ASSUME_ROLE_WITH_WEB_IDENTITY: StaticOperationSchema = ( + 23, + n0, + _ARWWI, + 0, + ASSUME_ROLE_WITH_WEB_IDENTITY_INPUT, + ASSUME_ROLE_WITH_WEB_IDENTITY_OUTPUT, + ( + EXPIRED_TOKEN_EXCEPTION, + IDP_COMMUNICATION_ERROR_EXCEPTION, + IDP_REJECTED_CLAIM_EXCEPTION, + INVALID_IDENTITY_TOKEN_EXCEPTION, + MALFORMED_POLICY_DOCUMENT_EXCEPTION, + PACKED_POLICY_TOO_LARGE_EXCEPTION, + REGION_DISABLED_EXCEPTION, + ), +) + +ROOT_DURATION_SECONDS_TYPE: StaticSchema = (7, n0, _RDST, 0) + +TARGET_PRINCIPAL_TYPE: StaticSchema = (3, n0, _TPT, 0) + +ASSUME_ROOT_INPUT: StaticSchema = ( + 18, + n0, + _ARIss, + {_sSI: _cARRom, _smi: None}, + (_TP, _TPA, _DS, _MSTS), + ( + (TARGET_PRINCIPAL_TYPE, 1), + (POLICY_DESCRIPTOR_TYPE, 1), + (ROOT_DURATION_SECONDS_TYPE, 0), + (MINIMUM_SESSION_TOKEN_SIZE_TYPE, 0), + ), +) + +ASSUME_ROOT_OUTPUT: StaticSchema = ( + 18, + n0, + _AROs, + {_sSI: _cARRoma, _smit: None}, + (_C, _SI, _STU, _STS), + ( + (CREDENTIALS, 0), + (SOURCE_IDENTITY_TYPE, 0), + (SESSION_TOKEN_UTILIZATION_TYPE, 0), + (SESSION_TOKEN_SIZE_TYPE, 0), + ), +) + +ASSUME_ROOT: StaticOperationSchema = ( + 23, + n0, + _ARs, + 0, + ASSUME_ROOT_INPUT, + ASSUME_ROOT_OUTPUT, + (EXPIRED_TOKEN_EXCEPTION, REGION_DISABLED_EXCEPTION), +) + +ENCODED_MESSAGE_TYPE: StaticSchema = (3, n0, _eMT, 0) + +DECODE_AUTHORIZATION_MESSAGE_INPUT: StaticSchema = ( + 18, + n0, + _DAMI, + {_sSI: _cDAMR, _smi: None}, + (_EM,), + ((ENCODED_MESSAGE_TYPE, 1),), +) + +DECODED_MESSAGE_TYPE: StaticSchema = (3, n0, _dMT, 0) + +DECODE_AUTHORIZATION_MESSAGE_OUTPUT: StaticSchema = ( + 18, + n0, + _DAMO, + {_sSI: _cDAMRo, _smit: None}, + (_DM,), + ((DECODED_MESSAGE_TYPE, 0),), +) + +INVALID_AUTHORIZATION_MESSAGE: StaticSchema = (3, n0, _iAM, 0) + +INVALID_AUTHORIZATION_MESSAGE_EXCEPTION: StaticSchema = ( + 18, + n0, + _IAME, + { + _smith: _c, + _sE: 400, + _aQE: MappingProxyType( + {"code": "InvalidAuthorizationMessageException", "httpResponseCode": 400} + ), }, -) - -JWT_PAYLOAD_SIZE_EXCEEDED_EXCEPTION2 = Schema( - id=ShapeID("com.amazonaws.sts#JWTPayloadSizeExceededException2"), - shape_type=ShapeType.STRING, -) - -JWT_PAYLOAD_SIZE_EXCEEDED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.sts#JWTPayloadSizeExceededException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "JWTPayloadSizeExceededException", "httpResponseCode": 400} - ), + (_me,), + ((INVALID_AUTHORIZATION_MESSAGE, 0),), +) + +DECODE_AUTHORIZATION_MESSAGE: StaticOperationSchema = ( + 23, + n0, + _DAM, + 0, + DECODE_AUTHORIZATION_MESSAGE_INPUT, + DECODE_AUTHORIZATION_MESSAGE_OUTPUT, + (INVALID_AUTHORIZATION_MESSAGE_EXCEPTION,), +) + +GET_ACCESS_KEY_INFO_INPUT: StaticSchema = ( + 18, + n0, + _GAKII, + {_sSI: _cGAKIR, _smi: None}, + (_AKI,), + ((ACCESS_KEY_ID_TYPE, 1),), +) + +GET_ACCESS_KEY_INFO_OUTPUT: StaticSchema = ( + 18, + n0, + _GAKIO, + {_sSI: _cGAKIRo, _smit: None}, + (_Ac,), + ((ACCOUNT_TYPE, 0),), +) + +GET_ACCESS_KEY_INFO: StaticOperationSchema = ( + 23, + n0, + _GAKI, + 0, + GET_ACCESS_KEY_INFO_INPUT, + GET_ACCESS_KEY_INFO_OUTPUT, + (), +) + +GET_CALLER_IDENTITY_INPUT: StaticSchema = (18, n0, _GCII, {_sSI: _cGCIR, _smi: None}) + +USER_ID_TYPE: StaticSchema = (3, n0, _uIT, 0) + +GET_CALLER_IDENTITY_OUTPUT: StaticSchema = ( + 18, + n0, + _GCIO, + {_sSI: _cGCIRo, _smit: None}, + (_UI, _Ac, _A), + ((USER_ID_TYPE, 0), (ACCOUNT_TYPE, 0), (ARN_TYPE, 0)), +) + +GET_CALLER_IDENTITY: StaticOperationSchema = ( + 23, + n0, + _GCI, + 0, + GET_CALLER_IDENTITY_INPUT, + GET_CALLER_IDENTITY_OUTPUT, + (), +) + +EXPIRED_TRADE_IN_TOKEN_EXCEPTION_MESSAGE: StaticSchema = (3, n0, _eTITEM, 0) + +EXPIRED_TRADE_IN_TOKEN_EXCEPTION: StaticSchema = ( + 18, + n0, + _ETITE, + { + _smith: _c, + _sE: 400, + _aQE: MappingProxyType( + {"code": "ExpiredTradeInTokenException", "httpResponseCode": 400} ), - ], - members={"message": {"target": JWT_PAYLOAD_SIZE_EXCEEDED_EXCEPTION2}}, -) - -OUTBOUND_WEB_IDENTITY_FEDERATION_DISABLED_EXCEPTION2 = Schema( - id=ShapeID("com.amazonaws.sts#OutboundWebIdentityFederationDisabledException2"), - shape_type=ShapeType.STRING, -) - -OUTBOUND_WEB_IDENTITY_FEDERATION_DISABLED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.sts#OutboundWebIdentityFederationDisabledException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=403), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - { - "code": "OutboundWebIdentityFederationDisabledException", - "httpResponseCode": 403, - } - ), + }, + (_me,), + ((EXPIRED_TRADE_IN_TOKEN_EXCEPTION_MESSAGE, 0),), +) + +TRADE_IN_TOKEN_TYPE: StaticSchema = (3, n0, _tITT, 4) + +GET_DELEGATED_ACCESS_TOKEN_INPUT: StaticSchema = ( + 18, + n0, + _GDATI, + {_sSI: _cGDATR, _smi: None}, + (_TIT,), + ((TRADE_IN_TOKEN_TYPE, 1),), +) + +GET_DELEGATED_ACCESS_TOKEN_OUTPUT: StaticSchema = ( + 18, + n0, + _GDATO, + {_sSI: _cGDATRo, _smit: None}, + (_C, _PPS, _AP), + ((CREDENTIALS, 0), (NON_NEGATIVE_INTEGER_TYPE, 0), (ARN_TYPE, 0)), +) + +GET_DELEGATED_ACCESS_TOKEN: StaticOperationSchema = ( + 23, + n0, + _GDAT, + 0, + GET_DELEGATED_ACCESS_TOKEN_INPUT, + GET_DELEGATED_ACCESS_TOKEN_OUTPUT, + ( + EXPIRED_TRADE_IN_TOKEN_EXCEPTION, + PACKED_POLICY_TOO_LARGE_EXCEPTION, + REGION_DISABLED_EXCEPTION, + ), +) + +DURATION_SECONDS_TYPE: StaticSchema = (7, n0, _dST, 0) + +USER_NAME_TYPE: StaticSchema = (3, n0, _uNT, 0) + +GET_FEDERATION_TOKEN_INPUT: StaticSchema = ( + 18, + n0, + _GFTI, + {_sSI: _cGFTR, _smi: None}, + (_N, _P, _PAo, _DS, _Ta, _MSTS), + ( + (USER_NAME_TYPE, 1), + (SESSION_POLICY_DOCUMENT_TYPE, 0), + (POLICY_DESCRIPTOR_LIST_TYPE, 0), + (DURATION_SECONDS_TYPE, 0), + (TAG_LIST_TYPE, 0), + (MINIMUM_SESSION_TOKEN_SIZE_TYPE, 0), + ), +) + +FEDERATED_ID_TYPE: StaticSchema = (3, n0, _fIT, 0) + +FEDERATED_USER: StaticSchema = ( + 18, + n0, + _FU, + 0, + (_FUI, _A), + ((FEDERATED_ID_TYPE, 1), (ARN_TYPE, 1)), +) + +GET_FEDERATION_TOKEN_OUTPUT: StaticSchema = ( + 18, + n0, + _GFTO, + {_sSI: _cGFTRo, _smit: None}, + (_C, _FU, _PPS, _STU, _STS), + ( + (CREDENTIALS, 0), + (FEDERATED_USER, 0), + (NON_NEGATIVE_INTEGER_TYPE, 0), + (SESSION_TOKEN_UTILIZATION_TYPE, 0), + (SESSION_TOKEN_SIZE_TYPE, 0), + ), +) + +GET_FEDERATION_TOKEN: StaticOperationSchema = ( + 23, + n0, + _GFT, + 0, + GET_FEDERATION_TOKEN_INPUT, + GET_FEDERATION_TOKEN_OUTPUT, + ( + MALFORMED_POLICY_DOCUMENT_EXCEPTION, + PACKED_POLICY_TOO_LARGE_EXCEPTION, + REGION_DISABLED_EXCEPTION, + ), +) + +GET_SESSION_TOKEN_INPUT: StaticSchema = ( + 18, + n0, + _GSTI, + {_sSI: _cGSTR, _smi: None}, + (_DS, _SN, _TC, _MSTS), + ( + (DURATION_SECONDS_TYPE, 0), + (SERIAL_NUMBER_TYPE, 0), + (TOKEN_CODE_TYPE, 0), + (MINIMUM_SESSION_TOKEN_SIZE_TYPE, 0), + ), +) + +GET_SESSION_TOKEN_OUTPUT: StaticSchema = ( + 18, + n0, + _GSTO, + {_sSI: _cGSTRo, _smit: None}, + (_C, _STU, _STS), + ( + (CREDENTIALS, 0), + (SESSION_TOKEN_UTILIZATION_TYPE, 0), + (SESSION_TOKEN_SIZE_TYPE, 0), + ), +) + +GET_SESSION_TOKEN: StaticOperationSchema = ( + 23, + n0, + _GST, + 0, + GET_SESSION_TOKEN_INPUT, + GET_SESSION_TOKEN_OUTPUT, + (REGION_DISABLED_EXCEPTION,), +) + +WEB_IDENTITY_TOKEN_AUDIENCE_STRING_TYPE: StaticSchema = (3, n0, _wITAST, 0) + +WEB_IDENTITY_TOKEN_AUDIENCE_LIST_TYPE: StaticSchema = ( + 16, + n0, + _wITALT, + 0, + (_m,), + ((WEB_IDENTITY_TOKEN_AUDIENCE_STRING_TYPE, 0),), +) + +WEB_IDENTITY_TOKEN_DURATION_SECONDS_TYPE: StaticSchema = (7, n0, _wITDST, 0) + +JWT_ALGORITHM_TYPE: StaticSchema = (3, n0, _jAT, 0) + +GET_WEB_IDENTITY_TOKEN_INPUT: StaticSchema = ( + 18, + n0, + _GWITI, + {_sSI: _cGWITR, _smi: None}, + (_Au, _DS, _SA, _Ta), + ( + (WEB_IDENTITY_TOKEN_AUDIENCE_LIST_TYPE, 1), + (WEB_IDENTITY_TOKEN_DURATION_SECONDS_TYPE, 0), + (JWT_ALGORITHM_TYPE, 1), + (TAG_LIST_TYPE, 0), + ), +) + +WEB_IDENTITY_TOKEN_TYPE: StaticSchema = (3, n0, _wITT, 4) + +GET_WEB_IDENTITY_TOKEN_OUTPUT: StaticSchema = ( + 18, + n0, + _GWITO, + {_sSI: _cGWITRo, _smit: None}, + (_WIT, _E), + ((WEB_IDENTITY_TOKEN_TYPE, 0), (DATE_TYPE, 0)), +) + +JWT_PAYLOAD_SIZE_EXCEEDED_EXCEPTION2: StaticSchema = (3, n0, _JWTPSEE, 0) + +JWT_PAYLOAD_SIZE_EXCEEDED_EXCEPTION: StaticSchema = ( + 18, + n0, + _JWTPSEEa, + { + _smith: _c, + _sE: 400, + _aQE: MappingProxyType( + {"code": "JWTPayloadSizeExceededException", "httpResponseCode": 400} ), - ], - members={ - "message": {"target": OUTBOUND_WEB_IDENTITY_FEDERATION_DISABLED_EXCEPTION2} }, -) - -SESSION_DURATION_ESCALATION_EXCEPTION2 = Schema( - id=ShapeID("com.amazonaws.sts#SessionDurationEscalationException2"), - shape_type=ShapeType.STRING, -) - -SESSION_DURATION_ESCALATION_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.sts#SessionDurationEscalationException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=403), - Trait.new( - id=ShapeID("aws.protocols#awsQueryError"), - value=MappingProxyType( - {"code": "SessionDurationEscalationException", "httpResponseCode": 403} - ), + (_me,), + ((JWT_PAYLOAD_SIZE_EXCEEDED_EXCEPTION2, 0),), +) + +OUTBOUND_WEB_IDENTITY_FEDERATION_DISABLED_EXCEPTION2: StaticSchema = (3, n0, _OWIFDE, 0) + +OUTBOUND_WEB_IDENTITY_FEDERATION_DISABLED_EXCEPTION: StaticSchema = ( + 18, + n0, + _OWIFDEu, + { + _smith: _c, + _sE: 403, + _aQE: MappingProxyType( + { + "code": "OutboundWebIdentityFederationDisabledException", + "httpResponseCode": 403, + } ), - ], - members={"message": {"target": SESSION_DURATION_ESCALATION_EXCEPTION2}}, + }, + (_me,), + ((OUTBOUND_WEB_IDENTITY_FEDERATION_DISABLED_EXCEPTION2, 0),), ) -GET_WEB_IDENTITY_TOKEN = Schema( - id=ShapeID("com.amazonaws.sts#GetWebIdentityToken"), shape_type=ShapeType.OPERATION -) +SESSION_DURATION_ESCALATION_EXCEPTION2: StaticSchema = (3, n0, _SDEE, 0) -AWS_SECURITY_TOKEN_SERVICE_V20110615 = Schema( - id=ShapeID("com.amazonaws.sts#AWSSecurityTokenServiceV20110615"), - shape_type=ShapeType.SERVICE, - traits=[ - Trait.new( - id=ShapeID("aws.auth#sigv4"), value=MappingProxyType({"name": "sts"}) - ), - Trait.new( - id=ShapeID("aws.auth#sigv4a"), value=MappingProxyType({"name": "sts"}) +SESSION_DURATION_ESCALATION_EXCEPTION: StaticSchema = ( + 18, + n0, + _SDEEe, + { + _smith: _c, + _sE: 403, + _aQE: MappingProxyType( + {"code": "SessionDurationEscalationException", "httpResponseCode": 403} ), - Trait.new(id=ShapeID("aws.protocols#awsQuery")), - Trait.new( - id=ShapeID("smithy.rules#endpointBdd"), - value=MappingProxyType( - { - "version": "1.1", - "parameters": MappingProxyType( - { - "Region": MappingProxyType( - { - "builtIn": "AWS::Region", - "required": False, - "documentation": "The AWS region used to dispatch the request.", - "type": "string", - } - ), - "UseDualStack": MappingProxyType( - { - "builtIn": "AWS::UseDualStack", - "required": True, - "default": False, - "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", - "type": "boolean", - } - ), - "UseFIPS": MappingProxyType( - { - "builtIn": "AWS::UseFIPS", - "required": True, - "default": False, - "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", - "type": "boolean", - } - ), - "Endpoint": MappingProxyType( - { - "builtIn": "SDK::Endpoint", - "required": False, - "documentation": "Override the endpoint used to send this request", - "type": "string", - } - ), - "UseGlobalEndpoint": MappingProxyType( - { - "builtIn": "AWS::STS::UseGlobalEndpoint", - "required": True, - "default": False, - "documentation": "Whether the global endpoint should be used, rather then the regional endpoint for us-east-1.", - "type": "boolean", - } - ), - } - ), - "conditions": ( - MappingProxyType( - { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "Endpoint"}),), - } - ), - MappingProxyType( - { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "Region"}),), - } - ), - MappingProxyType( - { - "fn": "aws.partition", - "argv": (MappingProxyType({"ref": "Region"}),), - "assign": "PartitionResult", - } - ), - MappingProxyType( + }, + (_me,), + ((SESSION_DURATION_ESCALATION_EXCEPTION2, 0),), +) + +GET_WEB_IDENTITY_TOKEN: StaticOperationSchema = ( + 23, + n0, + _GWIT, + 0, + GET_WEB_IDENTITY_TOKEN_INPUT, + GET_WEB_IDENTITY_TOKEN_OUTPUT, + ( + JWT_PAYLOAD_SIZE_EXCEEDED_EXCEPTION, + OUTBOUND_WEB_IDENTITY_FEDERATION_DISABLED_EXCEPTION, + SESSION_DURATION_ESCALATION_EXCEPTION, + ), +) + +AWS_SECURITY_TOKEN_SERVICE_V20110615: StaticSchema = ( + 21, + n0, + _AWSSTSV, + { + _aw: MappingProxyType({"name": "sts"}), + _aws: MappingProxyType({"name": "sts"}), + _aQ: None, + _sB: MappingProxyType( + { + "version": "1.1", + "parameters": MappingProxyType( + { + "Region": MappingProxyType( { - "fn": "booleanEquals", - "argv": (MappingProxyType({"ref": "UseFIPS"}), True), + "builtIn": "AWS::Region", + "required": False, + "documentation": "The AWS region used to dispatch the request.", + "type": "string", } ), - MappingProxyType( + "UseDualStack": MappingProxyType( { - "fn": "booleanEquals", - "argv": ( - MappingProxyType({"ref": "UseDualStack"}), - True, - ), + "builtIn": "AWS::UseDualStack", + "required": True, + "default": False, + "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", + "type": "boolean", } ), - MappingProxyType( + "UseFIPS": MappingProxyType( { - "fn": "stringEquals", - "argv": ( - MappingProxyType({"ref": "Region"}), - "aws-global", - ), + "builtIn": "AWS::UseFIPS", + "required": True, + "default": False, + "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", + "type": "boolean", } ), - MappingProxyType( + "Endpoint": MappingProxyType( { - "fn": "booleanEquals", - "argv": ( - MappingProxyType({"ref": "UseGlobalEndpoint"}), - True, - ), + "builtIn": "SDK::Endpoint", + "required": False, + "documentation": "Override the endpoint used to send this request", + "type": "string", } ), - MappingProxyType( + "UseGlobalEndpoint": MappingProxyType( { - "fn": "stringEquals", - "argv": ( - MappingProxyType({"ref": "Region"}), - "eu-central-1", - ), + "builtIn": "AWS::STS::UseGlobalEndpoint", + "required": True, + "default": False, + "documentation": "Whether the global endpoint should be used, rather then the regional endpoint for us-east-1.", + "type": "boolean", } ), - MappingProxyType( - { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "supportsDualStack", + } + ), + "conditions": ( + MappingProxyType( + { + "fn": "isSet", + "argv": (MappingProxyType({"ref": "Endpoint"}),), + } + ), + MappingProxyType( + {"fn": "isSet", "argv": (MappingProxyType({"ref": "Region"}),)} + ), + MappingProxyType( + { + "fn": "aws.partition", + "argv": (MappingProxyType({"ref": "Region"}),), + "assign": "PartitionResult", + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": (MappingProxyType({"ref": "UseFIPS"}), True), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": (MappingProxyType({"ref": "UseDualStack"}), True), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": (MappingProxyType({"ref": "Region"}), "aws-global"), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType({"ref": "UseGlobalEndpoint"}), + True, + ), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType({"ref": "Region"}), + "eu-central-1", + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} ), - } - ), - True, + "supportsDualStack", + ), + } ), - } - ), - MappingProxyType( - { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( + True, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( + { + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "supportsFIPS", + ), + } + ), + True, + ), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": (MappingProxyType({"ref": "Region"}), "ap-south-1"), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": (MappingProxyType({"ref": "Region"}), "eu-north-1"), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": (MappingProxyType({"ref": "Region"}), "eu-west-1"), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": (MappingProxyType({"ref": "Region"}), "eu-west-2"), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": (MappingProxyType({"ref": "Region"}), "eu-west-3"), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": (MappingProxyType({"ref": "Region"}), "sa-east-1"), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": (MappingProxyType({"ref": "Region"}), "us-east-1"), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": (MappingProxyType({"ref": "Region"}), "us-east-2"), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": (MappingProxyType({"ref": "Region"}), "us-west-2"), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": (MappingProxyType({"ref": "Region"}), "us-west-1"), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType({"ref": "Region"}), + "ca-central-1", + ), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType({"ref": "Region"}), + "ap-southeast-1", + ), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType({"ref": "Region"}), + "ap-northeast-1", + ), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType({"ref": "Region"}), + "ap-southeast-2", + ), + } + ), + MappingProxyType( + { + "fn": "stringEquals", + "argv": ( + MappingProxyType( + { + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "name", + ), + } + ), + "aws-us-gov", + ), + } + ), + ), + "results": ( + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://sts.amazonaws.com", + "properties": MappingProxyType( { - "fn": "getAttr", - "argv": ( + "authSchemes": ( MappingProxyType( - {"ref": "PartitionResult"} + { + "name": "sigv4", + "signingName": "sts", + "signingRegion": "us-east-1", + } ), - "supportsFIPS", - ), + ) } ), - True, - ), - } - ), - MappingProxyType( - { - "fn": "stringEquals", - "argv": ( - MappingProxyType({"ref": "Region"}), - "ap-south-1", - ), - } - ), - MappingProxyType( - { - "fn": "stringEquals", - "argv": ( - MappingProxyType({"ref": "Region"}), - "eu-north-1", - ), - } - ), - MappingProxyType( - { - "fn": "stringEquals", - "argv": ( - MappingProxyType({"ref": "Region"}), - "eu-west-1", - ), - } - ), - MappingProxyType( - { - "fn": "stringEquals", - "argv": ( - MappingProxyType({"ref": "Region"}), - "eu-west-2", - ), - } - ), - MappingProxyType( - { - "fn": "stringEquals", - "argv": ( - MappingProxyType({"ref": "Region"}), - "eu-west-3", - ), - } - ), - MappingProxyType( - { - "fn": "stringEquals", - "argv": ( - MappingProxyType({"ref": "Region"}), - "sa-east-1", - ), - } - ), - MappingProxyType( - { - "fn": "stringEquals", - "argv": ( - MappingProxyType({"ref": "Region"}), - "us-east-1", - ), - } - ), - MappingProxyType( - { - "fn": "stringEquals", - "argv": ( - MappingProxyType({"ref": "Region"}), - "us-east-2", - ), - } - ), - MappingProxyType( - { - "fn": "stringEquals", - "argv": ( - MappingProxyType({"ref": "Region"}), - "us-west-2", - ), - } - ), - MappingProxyType( - { - "fn": "stringEquals", - "argv": ( - MappingProxyType({"ref": "Region"}), - "us-west-1", - ), - } - ), - MappingProxyType( - { - "fn": "stringEquals", - "argv": ( - MappingProxyType({"ref": "Region"}), - "ca-central-1", - ), - } - ), - MappingProxyType( - { - "fn": "stringEquals", - "argv": ( - MappingProxyType({"ref": "Region"}), - "ap-southeast-1", - ), - } - ), - MappingProxyType( - { - "fn": "stringEquals", - "argv": ( - MappingProxyType({"ref": "Region"}), - "ap-northeast-1", - ), - } - ), - MappingProxyType( - { - "fn": "stringEquals", - "argv": ( - MappingProxyType({"ref": "Region"}), - "ap-southeast-2", - ), - } - ), - MappingProxyType( - { - "fn": "stringEquals", - "argv": ( - MappingProxyType( + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://sts.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType( { - "fn": "getAttr", - "argv": ( + "authSchemes": ( MappingProxyType( - {"ref": "PartitionResult"} + { + "name": "sigv4", + "signingName": "sts", + "signingRegion": "{Region}", + } ), - "name", - ), + ) } ), - "aws-us-gov", - ), - } - ), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } ), - "results": ( - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://sts.amazonaws.com", - "properties": MappingProxyType( - { - "authSchemes": ( - MappingProxyType( - { - "name": "sigv4", - "signingName": "sts", - "signingRegion": "us-east-1", - } - ), - ) - } - ), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://sts.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType( - { - "authSchemes": ( - MappingProxyType( - { - "name": "sigv4", - "signingName": "sts", - "signingRegion": "{Region}", - } - ), - ) - } - ), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: FIPS and custom endpoint are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": MappingProxyType({"ref": "Endpoint"}), - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "FIPS and DualStack are enabled, but this partition does not support one or both", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://sts.{Region}.amazonaws.com", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://sts-fips.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "FIPS is enabled but this partition does not support FIPS", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "DualStack is enabled but this partition does not support DualStack", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://sts.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: Missing Region", - "type": "error", - } - ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: FIPS and custom endpoint are not supported", + "type": "error", + } ), - "root": 2, - "nodeCount": 31, - "nodes": "/////wAAAAH/////AAAAAAAAAB4AAAADAAAAAQAAAAQF9eEOAAAAAgAAAAUF9eEOAAAAAwAAABkAAAAGAAAABAAAABgAAAAHAAAABQX14QEAAAAIAAAABgAAAAkF9eENAAAABwX14QEAAAAKAAAACgX14QEAAAALAAAACwX14QEAAAAMAAAADAX14QEAAAANAAAADQX14QEAAAAOAAAADgX14QEAAAAPAAAADwX14QEAAAAQAAAAEAX14QEAAAARAAAAEQX14QEAAAASAAAAEgX14QEAAAATAAAAEwX14QEAAAAUAAAAFAX14QEAAAAVAAAAFQX14QEAAAAWAAAAFgX14QEAAAAXAAAAFwX14QEF9eECAAAACAX14QsF9eEMAAAABAAAABwAAAAaAAAACQAAABsF9eEKAAAAGAX14QgF9eEJAAAACAAAAB0F9eEHAAAACQX14QYF9eEHAAAAAwX14QMAAAAfAAAABAX14QQF9eEF", - } - ), - ), - Trait.new( - id=ShapeID("aws.api#service"), - value=MappingProxyType( - { - "sdkId": "STS", - "arnNamespace": "sts", - "cloudFormationName": "STS", - "cloudTrailEventSource": "sts.amazonaws.com", - "endpointPrefix": "sts", - } - ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": MappingProxyType({"ref": "Endpoint"}), + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS and DualStack are enabled, but this partition does not support one or both", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://sts.{Region}.amazonaws.com", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://sts-fips.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS is enabled but this partition does not support FIPS", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "DualStack is enabled but this partition does not support DualStack", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://sts.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Missing Region", + "type": "error", + } + ), + ), + "root": 2, + "nodeCount": 31, + "nodes": "/////wAAAAH/////AAAAAAAAAB4AAAADAAAAAQAAAAQF9eEOAAAAAgAAAAUF9eEOAAAAAwAAABkAAAAGAAAABAAAABgAAAAHAAAABQX14QEAAAAIAAAABgAAAAkF9eENAAAABwX14QEAAAAKAAAACgX14QEAAAALAAAACwX14QEAAAAMAAAADAX14QEAAAANAAAADQX14QEAAAAOAAAADgX14QEAAAAPAAAADwX14QEAAAAQAAAAEAX14QEAAAARAAAAEQX14QEAAAASAAAAEgX14QEAAAATAAAAEwX14QEAAAAUAAAAFAX14QEAAAAVAAAAFQX14QEAAAAWAAAAFgX14QEAAAAXAAAAFwX14QEF9eECAAAACAX14QsF9eEMAAAABAAAABwAAAAaAAAACQAAABsF9eEKAAAAGAX14QgF9eEJAAAACAAAAB0F9eEHAAAACQX14QYF9eEHAAAAAwX14QMAAAAfAAAABAX14QQF9eEF", + } ), - Trait.new( - id=ShapeID("smithy.api#xmlNamespace"), - value=MappingProxyType( - {"uri": "https://sts.amazonaws.com/doc/2011-06-15/"} - ), + _awsa: MappingProxyType( + { + "sdkId": "STS", + "arnNamespace": "sts", + "cloudFormationName": "STS", + "cloudTrailEventSource": "sts.amazonaws.com", + "endpointPrefix": "sts", + } ), - ], + _sN: MappingProxyType({"uri": "https://sts.amazonaws.com/doc/2011-06-15/"}), + }, ) diff --git a/clients/aws-sdk-sts/src/aws_sdk_sts/client.py b/clients/aws-sdk-sts/src/aws_sdk_sts/client.py index 86878959..ef747016 100644 --- a/clients/aws-sdk-sts/src/aws_sdk_sts/client.py +++ b/clients/aws-sdk-sts/src/aws_sdk_sts/client.py @@ -1,18 +1,20 @@ # Code generated by smithy-python-codegen DO NOT EDIT. +from __future__ import annotations + from copy import deepcopy import logging from typing import Any, cast +from smithy_aws_core.aio.identity.chain import AsyncIdentityChain from smithy_aws_core.config import ConfigSource from smithy_aws_core.identity import AWSCredentialsIdentity -from smithy_aws_core.identity.chain import IdentityChain -from smithy_core.aio.client import AsyncClient, ClientCall, RequestPipeline +from smithy_core.aio.client import AsyncClient, AsyncClientCall, AsyncRequestPipeline from smithy_core.deserializers import DeserializeableShape from smithy_core.exceptions import ExpectationNotMetError from smithy_core.schemas import APIOperation from smithy_core.serializers import SerializeableShape -from smithy_http.aio.interfaces import HTTPClient +from smithy_http.aio.interfaces import AsyncHTTPClient from smithy_http.plugins import user_agent_plugin from .config import AsyncSTSConfig, Plugin @@ -21,38 +23,44 @@ ASSUME_ROLE_WITH_SAML, ASSUME_ROLE_WITH_WEB_IDENTITY, ASSUME_ROOT, - AssumeRoleInput, - AssumeRoleOutput, - AssumeRoleWithSAMLInput, - AssumeRoleWithSAMLOutput, - AssumeRoleWithWebIdentityInput, - AssumeRoleWithWebIdentityOutput, - AssumeRootInput, - AssumeRootOutput, DECODE_AUTHORIZATION_MESSAGE, - DecodeAuthorizationMessageInput, - DecodeAuthorizationMessageOutput, GET_ACCESS_KEY_INFO, GET_CALLER_IDENTITY, GET_DELEGATED_ACCESS_TOKEN, GET_FEDERATION_TOKEN, GET_SESSION_TOKEN, GET_WEB_IDENTITY_TOKEN, - GetAccessKeyInfoInput, - GetAccessKeyInfoOutput, - GetCallerIdentityInput, - GetCallerIdentityOutput, - GetDelegatedAccessTokenInput, - GetDelegatedAccessTokenOutput, - GetFederationTokenInput, - GetFederationTokenOutput, - GetSessionTokenInput, - GetSessionTokenOutput, - GetWebIdentityTokenInput, - GetWebIdentityTokenOutput, ) from .user_agent import aws_user_agent_plugin +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .models import ( + AssumeRoleInput, + AssumeRoleOutput, + AssumeRoleWithSAMLInput, + AssumeRoleWithSAMLOutput, + AssumeRoleWithWebIdentityInput, + AssumeRoleWithWebIdentityOutput, + AssumeRootInput, + AssumeRootOutput, + DecodeAuthorizationMessageInput, + DecodeAuthorizationMessageOutput, + GetAccessKeyInfoInput, + GetAccessKeyInfoOutput, + GetCallerIdentityInput, + GetCallerIdentityOutput, + GetDelegatedAccessTokenInput, + GetDelegatedAccessTokenOutput, + GetFederationTokenInput, + GetFederationTokenOutput, + GetSessionTokenInput, + GetSessionTokenOutput, + GetWebIdentityTokenInput, + GetWebIdentityTokenOutput, + ) + logger = logging.getLogger(__name__) @@ -152,12 +160,12 @@ async def _post_setup(self, config: AsyncSTSConfig) -> None: config_file = await config_context.parsed_profiles() if config_context.profile_source is ConfigSource.OVERRIDE: profile_name = config_context.profile_name - config.aws_credentials_identity_resolver = await IdentityChain.create( + config.aws_credentials_identity_resolver = await AsyncIdentityChain.create( AWSCredentialsIdentity, config_file=config_file, profile_name=profile_name, region_override=config.region, - http_client=cast(HTTPClient | None, config.transport), + http_client=cast(AsyncHTTPClient | None, config.transport), ) async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( @@ -166,7 +174,7 @@ async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( operation: APIOperation[I, O], default_plugins: list[Plugin], plugins: list[Plugin] | None, - ) -> tuple[RequestPipeline[Any, Any], ClientCall[I, O]]: + ) -> tuple[AsyncRequestPipeline[Any, Any], AsyncClientCall[I, O]]: if self._closed: raise RuntimeError( "Cannot invoke an operation on a client that has been closed." diff --git a/clients/aws-sdk-sts/src/aws_sdk_sts/config.py b/clients/aws-sdk-sts/src/aws_sdk_sts/config.py index 882ada08..ec497849 100644 --- a/clients/aws-sdk-sts/src/aws_sdk_sts/config.py +++ b/clients/aws-sdk-sts/src/aws_sdk_sts/config.py @@ -1,88 +1,104 @@ # Code generated by smithy-python-codegen DO NOT EDIT. from dataclasses import dataclass, field -from typing import Any, Callable, ClassVar, Self, TypeAlias, Union, Unpack +from typing import ( + Any, + Callable, + ClassVar, + Self, + TYPE_CHECKING, + TypeAlias, + Union, + Unpack, +) -from smithy_aws_core.aio.protocols import AwsQueryClientProtocol -from smithy_aws_core.auth import SigV4AuthScheme -from smithy_aws_core.config import AwsConfigOverrides, FileSystem -from smithy_aws_core.config.aws_config import AsyncAwsConfig -from smithy_aws_core.config.resolvers import EndpointUriResolver -from smithy_aws_core.config.types import FieldSpec -from smithy_aws_core.endpoints.standard_regional import ( - StandardRegionalEndpointsResolver, +from smithy_aws_core.aio.auth.sigv4 import AsyncSigV4AuthScheme +from smithy_aws_core.aio.config import AsyncFileSystem +from smithy_aws_core.aio.config.aws_config import AsyncAwsConfig, AwsConfigOverrides +from smithy_aws_core.aio.config.resolvers import EndpointUriResolver +from smithy_aws_core.aio.endpoints.standard_regional import ( + AsyncStandardRegionalEndpointsResolver, ) +from smithy_aws_core.aio.protocols import AsyncAwsQueryClientProtocol +from smithy_aws_core.config.types import FieldSpec from smithy_aws_core.identity import AWSCredentialsIdentity, AWSIdentityProperties -from smithy_core.aio.interfaces import ( - ClientProtocol, - EndpointResolver, - ProtocolConstructor, - ProtocolSettings, -) -from smithy_core.aio.interfaces.auth import AuthScheme -from smithy_core.aio.interfaces.identity import IdentityResolver -from smithy_core.interceptors import Interceptor +from smithy_core.aio.interfaces import AsyncClientProtocol, AsyncEndpointResolver +from smithy_core.aio.interfaces.auth import AsyncAuthScheme +from smithy_core.aio.interfaces.identity import AsyncIdentityResolver +from smithy_core.interfaces import ProtocolConstructor, ProtocolSettings from smithy_core.interfaces.auth import AuthSchemeResolver from smithy_core.shapes import ShapeID from smithy_http.aio.aiohttp import AIOHTTPClient +from ._private.schemas import AWS_SECURITY_TOKEN_SERVICE_V20110615 from .auth import HTTPAuthSchemeResolver -from .models import ( - AssumeRoleInput, - AssumeRoleOutput, - AssumeRoleWithSAMLInput, - AssumeRoleWithSAMLOutput, - AssumeRoleWithWebIdentityInput, - AssumeRoleWithWebIdentityOutput, - AssumeRootInput, - AssumeRootOutput, - DecodeAuthorizationMessageInput, - DecodeAuthorizationMessageOutput, - GetAccessKeyInfoInput, - GetAccessKeyInfoOutput, - GetCallerIdentityInput, - GetCallerIdentityOutput, - GetDelegatedAccessTokenInput, - GetDelegatedAccessTokenOutput, - GetFederationTokenInput, - GetFederationTokenOutput, - GetSessionTokenInput, - GetSessionTokenOutput, - GetWebIdentityTokenInput, - GetWebIdentityTokenOutput, -) -_ServiceInterceptor = Union[ - Interceptor[AssumeRoleInput, AssumeRoleOutput, Any, Any], - Interceptor[AssumeRoleWithSAMLInput, AssumeRoleWithSAMLOutput, Any, Any], - Interceptor[ - AssumeRoleWithWebIdentityInput, AssumeRoleWithWebIdentityOutput, Any, Any - ], - Interceptor[AssumeRootInput, AssumeRootOutput, Any, Any], - Interceptor[ - DecodeAuthorizationMessageInput, DecodeAuthorizationMessageOutput, Any, Any - ], - Interceptor[GetAccessKeyInfoInput, GetAccessKeyInfoOutput, Any, Any], - Interceptor[GetCallerIdentityInput, GetCallerIdentityOutput, Any, Any], - Interceptor[GetDelegatedAccessTokenInput, GetDelegatedAccessTokenOutput, Any, Any], - Interceptor[GetFederationTokenInput, GetFederationTokenOutput, Any, Any], - Interceptor[GetSessionTokenInput, GetSessionTokenOutput, Any, Any], - Interceptor[GetWebIdentityTokenInput, GetWebIdentityTokenOutput, Any, Any], -] +if TYPE_CHECKING: + from smithy_core.interceptors import Interceptor + from .models import ( + AssumeRoleInput, + AssumeRoleOutput, + AssumeRoleWithSAMLInput, + AssumeRoleWithSAMLOutput, + AssumeRoleWithWebIdentityInput, + AssumeRoleWithWebIdentityOutput, + AssumeRootInput, + AssumeRootOutput, + DecodeAuthorizationMessageInput, + DecodeAuthorizationMessageOutput, + GetAccessKeyInfoInput, + GetAccessKeyInfoOutput, + GetCallerIdentityInput, + GetCallerIdentityOutput, + GetDelegatedAccessTokenInput, + GetDelegatedAccessTokenOutput, + GetFederationTokenInput, + GetFederationTokenOutput, + GetSessionTokenInput, + GetSessionTokenOutput, + GetWebIdentityTokenInput, + GetWebIdentityTokenOutput, + ) + + _ServiceInterceptor = Union[ + Interceptor[AssumeRoleInput, AssumeRoleOutput, Any, Any], + Interceptor[AssumeRoleWithSAMLInput, AssumeRoleWithSAMLOutput, Any, Any], + Interceptor[ + AssumeRoleWithWebIdentityInput, AssumeRoleWithWebIdentityOutput, Any, Any + ], + Interceptor[AssumeRootInput, AssumeRootOutput, Any, Any], + Interceptor[ + DecodeAuthorizationMessageInput, DecodeAuthorizationMessageOutput, Any, Any + ], + Interceptor[GetAccessKeyInfoInput, GetAccessKeyInfoOutput, Any, Any], + Interceptor[GetCallerIdentityInput, GetCallerIdentityOutput, Any, Any], + Interceptor[ + GetDelegatedAccessTokenInput, GetDelegatedAccessTokenOutput, Any, Any + ], + Interceptor[GetFederationTokenInput, GetFederationTokenOutput, Any, Any], + Interceptor[GetSessionTokenInput, GetSessionTokenOutput, Any, Any], + Interceptor[GetWebIdentityTokenInput, GetWebIdentityTokenOutput, Any, Any], + ] +else: + _ServiceInterceptor = Any + _PROTOCOL_SETTINGS = ProtocolSettings( namespace="com.amazonaws.sts", service_target="AWSSecurityTokenServiceV20110615", version="2011-06-15", + service_schema=AWS_SECURITY_TOKEN_SERVICE_V20110615, ) class _AsyncSTSConfigOverrides(AwsConfigOverrides, total=False): - endpoint_resolver: EndpointResolver | None + endpoint_resolver: AsyncEndpointResolver | None protocol: ( - ClientProtocol[Any, Any] | ProtocolConstructor[ClientProtocol[Any, Any]] | None + AsyncClientProtocol[Any, Any] + | ProtocolConstructor[AsyncClientProtocol[Any, Any]] + | None ) - auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None + auth_schemes: dict[ShapeID, AsyncAuthScheme[Any, Any, Any, Any]] | None auth_scheme_resolver: AuthSchemeResolver | None @@ -90,17 +106,17 @@ class _AsyncSTSConfigOverrides(AwsConfigOverrides, total=False): class AsyncSTSConfig(AsyncAwsConfig): """STS configuration (async-resolved).""" - endpoint_resolver: EndpointResolver | None = None + endpoint_resolver: AsyncEndpointResolver | None = None """ The endpoint resolver used to resolve the final endpoint per-operation based on the configuration. """ - protocol: ClientProtocol[Any, Any] | None = None + protocol: AsyncClientProtocol[Any, Any] | None = None """ Pass a protocol class reference from smithy_aws_core.aio.protocols to - select the protocol, e.g. protocol=AwsJson10ClientProtocol. For custom - protocols a protocol instance may also be passed. + select the protocol, e.g. protocol=AsyncAwsJson10ClientProtocol. For + custom protocols a protocol instance may also be passed. """ interceptors: list[_ServiceInterceptor] = field(default_factory=lambda: []) @@ -109,7 +125,7 @@ class AsyncSTSConfig(AsyncAwsConfig): execution of a request. """ - auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None = None + auth_schemes: dict[ShapeID, AsyncAuthScheme[Any, Any, Any, Any]] | None = None """A map of auth scheme ids to auth schemes.""" auth_scheme_resolver: AuthSchemeResolver | None = None @@ -119,7 +135,7 @@ class AsyncSTSConfig(AsyncAwsConfig): """ aws_credentials_identity_resolver: ( - IdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None + AsyncIdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None ) = None """Resolves AWS Credentials. Required for operations that use Sigv4 Auth.""" @@ -158,24 +174,24 @@ class AsyncSTSConfig(AsyncAwsConfig): **AsyncAwsConfig._FIELDS, "endpoint_uri": FieldSpec(default=None, resolver=EndpointUriResolver("sts")), "endpoint_resolver": FieldSpec( - default_factory=lambda: StandardRegionalEndpointsResolver( + default_factory=lambda: AsyncStandardRegionalEndpointsResolver( endpoint_prefix="sts" ) ), "protocol": FieldSpec( - default_factory=lambda: AwsQueryClientProtocol(_PROTOCOL_SETTINGS), + default_factory=lambda: AsyncAwsQueryClientProtocol(_PROTOCOL_SETTINGS), converter=lambda p: p(_PROTOCOL_SETTINGS) if isinstance(p, type) else p, ), "auth_schemes": FieldSpec( default_factory=lambda: { - ShapeID("aws.auth#sigv4"): SigV4AuthScheme(service="sts") + ShapeID("aws.auth#sigv4"): AsyncSigV4AuthScheme(service="sts") } ), "auth_scheme_resolver": FieldSpec(default_factory=HTTPAuthSchemeResolver), "transport": FieldSpec(default_factory=lambda: AIOHTTPClient()), } - def set_auth_scheme(self, scheme: AuthScheme[Any, Any, Any, Any]) -> None: + def set_auth_scheme(self, scheme: AsyncAuthScheme[Any, Any, Any, Any]) -> None: """ Set an auth scheme implementation using its scheme ID. :param scheme: The auth scheme to add or replace. @@ -189,7 +205,7 @@ async def resolve( # pyright: ignore[reportIncompatibleMethodOverride] cls, *, profile: str | None = None, - fs: FileSystem | None = None, + fs: AsyncFileSystem | None = None, config_file_path: str | None = None, credentials_file_path: str | None = None, **overrides: Unpack[_AsyncSTSConfigOverrides], diff --git a/clients/aws-sdk-sts/src/aws_sdk_sts/models.py b/clients/aws-sdk-sts/src/aws_sdk_sts/models.py index 6d276c5a..a252e28d 100644 --- a/clients/aws-sdk-sts/src/aws_sdk_sts/models.py +++ b/clients/aws-sdk-sts/src/aws_sdk_sts/models.py @@ -1,4528 +1,288 @@ # Code generated by smithy-python-codegen DO NOT EDIT. -from dataclasses import dataclass, field -from datetime import datetime, timezone -import logging -from typing import Any, Literal, Self +from __future__ import annotations -from smithy_core.deserializers import ShapeDeserializer -from smithy_core.documents import TypeRegistry +from ._private import schemas as _schemas +from smithy_core._dynamic_models import ModelRegistry from smithy_core.exceptions import ModeledError -from smithy_core.response import EMPTY_RESPONSE_METADATA, ResponseMetadata -from smithy_core.schemas import APIOperation, Schema -from smithy_core.serializers import ShapeSerializer +from smithy_core.schemas import APIOperation from smithy_core.shapes import ShapeID from ._private.schemas import ( - ASSUMED_ROLE_USER as _SCHEMA_ASSUMED_ROLE_USER, ASSUME_ROLE as _SCHEMA_ASSUME_ROLE, - ASSUME_ROLE_INPUT as _SCHEMA_ASSUME_ROLE_INPUT, - ASSUME_ROLE_OUTPUT as _SCHEMA_ASSUME_ROLE_OUTPUT, ASSUME_ROLE_WITH_SAML as _SCHEMA_ASSUME_ROLE_WITH_SAML, - ASSUME_ROLE_WITH_SAML_INPUT as _SCHEMA_ASSUME_ROLE_WITH_SAML_INPUT, - ASSUME_ROLE_WITH_SAML_OUTPUT as _SCHEMA_ASSUME_ROLE_WITH_SAML_OUTPUT, ASSUME_ROLE_WITH_WEB_IDENTITY as _SCHEMA_ASSUME_ROLE_WITH_WEB_IDENTITY, - ASSUME_ROLE_WITH_WEB_IDENTITY_INPUT as _SCHEMA_ASSUME_ROLE_WITH_WEB_IDENTITY_INPUT, - ASSUME_ROLE_WITH_WEB_IDENTITY_OUTPUT as _SCHEMA_ASSUME_ROLE_WITH_WEB_IDENTITY_OUTPUT, ASSUME_ROOT as _SCHEMA_ASSUME_ROOT, - ASSUME_ROOT_INPUT as _SCHEMA_ASSUME_ROOT_INPUT, - ASSUME_ROOT_OUTPUT as _SCHEMA_ASSUME_ROOT_OUTPUT, - CREDENTIALS as _SCHEMA_CREDENTIALS, DECODE_AUTHORIZATION_MESSAGE as _SCHEMA_DECODE_AUTHORIZATION_MESSAGE, - DECODE_AUTHORIZATION_MESSAGE_INPUT as _SCHEMA_DECODE_AUTHORIZATION_MESSAGE_INPUT, - DECODE_AUTHORIZATION_MESSAGE_OUTPUT as _SCHEMA_DECODE_AUTHORIZATION_MESSAGE_OUTPUT, - EXPIRED_TOKEN_EXCEPTION as _SCHEMA_EXPIRED_TOKEN_EXCEPTION, - EXPIRED_TRADE_IN_TOKEN_EXCEPTION as _SCHEMA_EXPIRED_TRADE_IN_TOKEN_EXCEPTION, - FEDERATED_USER as _SCHEMA_FEDERATED_USER, GET_ACCESS_KEY_INFO as _SCHEMA_GET_ACCESS_KEY_INFO, - GET_ACCESS_KEY_INFO_INPUT as _SCHEMA_GET_ACCESS_KEY_INFO_INPUT, - GET_ACCESS_KEY_INFO_OUTPUT as _SCHEMA_GET_ACCESS_KEY_INFO_OUTPUT, GET_CALLER_IDENTITY as _SCHEMA_GET_CALLER_IDENTITY, - GET_CALLER_IDENTITY_INPUT as _SCHEMA_GET_CALLER_IDENTITY_INPUT, - GET_CALLER_IDENTITY_OUTPUT as _SCHEMA_GET_CALLER_IDENTITY_OUTPUT, GET_DELEGATED_ACCESS_TOKEN as _SCHEMA_GET_DELEGATED_ACCESS_TOKEN, - GET_DELEGATED_ACCESS_TOKEN_INPUT as _SCHEMA_GET_DELEGATED_ACCESS_TOKEN_INPUT, - GET_DELEGATED_ACCESS_TOKEN_OUTPUT as _SCHEMA_GET_DELEGATED_ACCESS_TOKEN_OUTPUT, GET_FEDERATION_TOKEN as _SCHEMA_GET_FEDERATION_TOKEN, - GET_FEDERATION_TOKEN_INPUT as _SCHEMA_GET_FEDERATION_TOKEN_INPUT, - GET_FEDERATION_TOKEN_OUTPUT as _SCHEMA_GET_FEDERATION_TOKEN_OUTPUT, GET_SESSION_TOKEN as _SCHEMA_GET_SESSION_TOKEN, - GET_SESSION_TOKEN_INPUT as _SCHEMA_GET_SESSION_TOKEN_INPUT, - GET_SESSION_TOKEN_OUTPUT as _SCHEMA_GET_SESSION_TOKEN_OUTPUT, GET_WEB_IDENTITY_TOKEN as _SCHEMA_GET_WEB_IDENTITY_TOKEN, - GET_WEB_IDENTITY_TOKEN_INPUT as _SCHEMA_GET_WEB_IDENTITY_TOKEN_INPUT, - GET_WEB_IDENTITY_TOKEN_OUTPUT as _SCHEMA_GET_WEB_IDENTITY_TOKEN_OUTPUT, - IDP_COMMUNICATION_ERROR_EXCEPTION as _SCHEMA_IDP_COMMUNICATION_ERROR_EXCEPTION, - IDP_REJECTED_CLAIM_EXCEPTION as _SCHEMA_IDP_REJECTED_CLAIM_EXCEPTION, - INVALID_AUTHORIZATION_MESSAGE_EXCEPTION as _SCHEMA_INVALID_AUTHORIZATION_MESSAGE_EXCEPTION, - INVALID_IDENTITY_TOKEN_EXCEPTION as _SCHEMA_INVALID_IDENTITY_TOKEN_EXCEPTION, - JWT_PAYLOAD_SIZE_EXCEEDED_EXCEPTION as _SCHEMA_JWT_PAYLOAD_SIZE_EXCEEDED_EXCEPTION, - MALFORMED_POLICY_DOCUMENT_EXCEPTION as _SCHEMA_MALFORMED_POLICY_DOCUMENT_EXCEPTION, - OUTBOUND_WEB_IDENTITY_FEDERATION_DISABLED_EXCEPTION as _SCHEMA_OUTBOUND_WEB_IDENTITY_FEDERATION_DISABLED_EXCEPTION, - PACKED_POLICY_TOO_LARGE_EXCEPTION as _SCHEMA_PACKED_POLICY_TOO_LARGE_EXCEPTION, - POLICY_DESCRIPTOR_TYPE as _SCHEMA_POLICY_DESCRIPTOR_TYPE, - PROVIDED_CONTEXT as _SCHEMA_PROVIDED_CONTEXT, - REGION_DISABLED_EXCEPTION as _SCHEMA_REGION_DISABLED_EXCEPTION, - SESSION_DURATION_ESCALATION_EXCEPTION as _SCHEMA_SESSION_DURATION_ESCALATION_EXCEPTION, - TAG as _SCHEMA_TAG, ) +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .models import ( + AssumeRoleInput, + AssumeRoleOutput, + AssumeRoleWithSAMLInput, + AssumeRoleWithSAMLOutput, + AssumeRoleWithWebIdentityInput, + AssumeRoleWithWebIdentityOutput, + AssumeRootInput, + AssumeRootOutput, + DecodeAuthorizationMessageInput, + DecodeAuthorizationMessageOutput, + GetAccessKeyInfoInput, + GetAccessKeyInfoOutput, + GetCallerIdentityInput, + GetCallerIdentityOutput, + GetDelegatedAccessTokenInput, + GetDelegatedAccessTokenOutput, + GetFederationTokenInput, + GetFederationTokenOutput, + GetSessionTokenInput, + GetSessionTokenOutput, + GetWebIdentityTokenInput, + GetWebIdentityTokenOutput, + ) -logger = logging.getLogger(__name__) - - -class ServiceError(ModeledError): - """ - Base error for all errors in the service. - - Some exceptions do not extend from this class, including - synthetic, implicit, and shared exception types. - """ - - -@dataclass(kw_only=True) -class AssumedRoleUser: - """ - The identifiers for the temporary security credentials that the - operation returns. - """ - - assumed_role_id: str - """ - A unique identifier that contains the role ID and the role session name - of the role that is being assumed. The role ID is generated by Amazon - Web Services when the role is created. - """ - - arn: str - """ - The ARN of the temporary security credentials that are returned from the - AssumeRole action. For more information about ARNs and how to use them - in policies, see [IAM - Identifiers](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html) - in the *IAM User Guide*. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ASSUMED_ROLE_USER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_ASSUMED_ROLE_USER.members["AssumedRoleId"], self.assumed_role_id - ) - serializer.write_string(_SCHEMA_ASSUMED_ROLE_USER.members["Arn"], self.arn) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["assumed_role_id"] = de.read_string( - _SCHEMA_ASSUMED_ROLE_USER.members["AssumedRoleId"] - ) - - case 1: - kwargs["arn"] = de.read_string( - _SCHEMA_ASSUMED_ROLE_USER.members["Arn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ASSUMED_ROLE_USER, consumer=_consumer) - if "assumed_role_id" not in kwargs: - kwargs["assumed_role_id"] = "" - if "arn" not in kwargs: - kwargs["arn"] = "" - return kwargs - - -@dataclass(kw_only=True) -class PolicyDescriptorType: - """ - A reference to the IAM managed policy that is passed as a session policy - for a role session or a federated user session. - """ - - arn: str | None = None - """ - The Amazon Resource Name (ARN) of the IAM managed policy to use as a - session policy for the role. For more information about ARNs, see - [Amazon Resource Names (ARNs) and Amazon Web Services Service - Namespaces](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - in the *Amazon Web Services General Reference*. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_POLICY_DESCRIPTOR_TYPE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.arn is not None: - serializer.write_string( - _SCHEMA_POLICY_DESCRIPTOR_TYPE.members["arn"], self.arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["arn"] = de.read_string( - _SCHEMA_POLICY_DESCRIPTOR_TYPE.members["arn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_POLICY_DESCRIPTOR_TYPE, consumer=_consumer) - return kwargs - - -def _serialize_policy_descriptor_list_type( - serializer: ShapeSerializer, schema: Schema, value: list[PolicyDescriptorType] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_policy_descriptor_list_type( - deserializer: ShapeDeserializer, schema: Schema -) -> list[PolicyDescriptorType]: - result: list[PolicyDescriptorType] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(PolicyDescriptorType.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class ProvidedContext: - """ - Contains information about the provided context. This includes the - signed and encrypted trusted context assertion and the context provider - ARN from which the trusted context assertion was generated. - """ - - provider_arn: str | None = None - """ - The context provider ARN from which the trusted context assertion was - generated. - """ - - context_assertion: str | None = None - """ - The signed and encrypted trusted context assertion generated by the - context provider. The trusted context assertion is signed and encrypted - by Amazon Web Services STS. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PROVIDED_CONTEXT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.provider_arn is not None: - serializer.write_string( - _SCHEMA_PROVIDED_CONTEXT.members["ProviderArn"], self.provider_arn - ) - - if self.context_assertion is not None: - serializer.write_string( - _SCHEMA_PROVIDED_CONTEXT.members["ContextAssertion"], - self.context_assertion, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["provider_arn"] = de.read_string( - _SCHEMA_PROVIDED_CONTEXT.members["ProviderArn"] - ) - - case 1: - kwargs["context_assertion"] = de.read_string( - _SCHEMA_PROVIDED_CONTEXT.members["ContextAssertion"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_PROVIDED_CONTEXT, consumer=_consumer) - return kwargs - - -def _serialize_provided_contexts_list_type( - serializer: ShapeSerializer, schema: Schema, value: list[ProvidedContext] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_provided_contexts_list_type( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ProvidedContext]: - result: list[ProvidedContext] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ProvidedContext.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class Tag: - """ - You can pass custom key-value pair attributes when you assume a role or - federate a user. These are called session tags. You can then use the - session tags to control access to resources. For more information, see - [Tagging Amazon Web Services STS - Sessions](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) - in the *IAM User Guide*. - """ - - key: str - """ - The key for a session tag. - - You can pass up to 50 session tags. The plain text session tag keys - can't exceed 128 characters. For these and additional limits, see [IAM - and STS Character - Limits](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) - in the *IAM User Guide*. - """ - - value: str - """ - The value for a session tag. - - You can pass up to 50 session tags. The plain text session tag values - can't exceed 256 characters. For these and additional limits, see [IAM - and STS Character - Limits](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) - in the *IAM User Guide*. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TAG, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string(_SCHEMA_TAG.members["Key"], self.key) - serializer.write_string(_SCHEMA_TAG.members["Value"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["key"] = de.read_string(_SCHEMA_TAG.members["Key"]) - - case 1: - kwargs["value"] = de.read_string(_SCHEMA_TAG.members["Value"]) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TAG, consumer=_consumer) - if "key" not in kwargs: - kwargs["key"] = "" - if "value" not in kwargs: - kwargs["value"] = "" - return kwargs - - -def _serialize_tag_list_type( - serializer: ShapeSerializer, schema: Schema, value: list[Tag] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_tag_list_type( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Tag]: - result: list[Tag] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Tag.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_tag_key_list_type( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_tag_key_list_type( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AssumeRoleInput: - """Dataclass for AssumeRoleInput structure.""" - - role_arn: str | None = None - """The Amazon Resource Name (ARN) of the role to assume.""" - - role_session_name: str | None = None - """ - An identifier for the assumed role session. - - Use the role session name to uniquely identify a session when the same - role is assumed by different principals or for different reasons. In - cross-account scenarios, the role session name is visible to, and can be - logged by the account that owns the role. The role session name is also - used in the ARN of the assumed role principal. This means that - subsequent cross-account API requests that use the temporary security - credentials will expose the role session name to the external account in - their CloudTrail logs. - - For security purposes, administrators can view this field in [CloudTrail - logs](https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-integration.html#cloudtrail-integration_signin-tempcreds) - to help identify who performed an action in Amazon Web Services. Your - administrator might require that you specify your user name as the - session name when you assume the role. For more information, see - [`sts:RoleSessionName`](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#ck_rolesessionname) - . - - The regex used to validate this parameter is a string of characters - consisting of upper- and lower-case alphanumeric characters with no - spaces. You can also include underscores or any of the following - characters: +=,.@- - """ - - policy_arns: list[PolicyDescriptorType] | None = None - """ - The Amazon Resource Names (ARNs) of the IAM managed policies that you - want to use as managed session policies. The policies must exist in the - same account as the role. - - This parameter is optional. You can provide up to 10 managed policy - ARNs. However, the plaintext that you use for both inline and managed - session policies can't exceed 2,048 characters. For more information - about ARNs, see [Amazon Resource Names (ARNs) and Amazon Web Services - Service - Namespaces](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - in the Amazon Web Services General Reference. - - Note: - An Amazon Web Services conversion compresses the passed inline session - policy, managed policy ARNs, and session tags into a packed binary - format that has a separate limit. Your request can fail for this limit - even if your plaintext meets the other requirements. The - `PackedPolicySize` response element indicates by percentage how close - the policies and tags for your request are to the upper size limit. - - Passing policies to this operation returns new temporary credentials. - The resulting session's permissions are the intersection of the role's - identity-based policy and the session policies. You can use the role's - temporary credentials in subsequent Amazon Web Services API calls to - access resources in the account that owns the role. You cannot use - session policies to grant more permissions than those allowed by the - identity-based policy of the role that is being assumed. For more - information, see [Session - Policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) - in the *IAM User Guide*. - """ - - policy: str | None = None - """ - An IAM policy in JSON format that you want to use as an inline session - policy. - - This parameter is optional. Passing policies to this operation returns - new temporary credentials. The resulting session's permissions are the - intersection of the role's identity-based policy and the session - policies. You can use the role's temporary credentials in subsequent - Amazon Web Services API calls to access resources in the account that - owns the role. You cannot use session policies to grant more permissions - than those allowed by the identity-based policy of the role that is - being assumed. For more information, see [Session - Policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) - in the *IAM User Guide*. - - The plaintext that you use for both inline and managed session policies - can't exceed 2,048 characters. The JSON policy characters can be any - ASCII character from the space character to the end of the valid - character list (\\u0020 through \\u00FF). It can also include the tab - (\\u0009), linefeed (\\u000A), and carriage return (\\u000D) characters. - - Note: - An Amazon Web Services conversion compresses the passed inline session - policy, managed policy ARNs, and session tags into a packed binary - format that has a separate limit. Your request can fail for this limit - even if your plaintext meets the other requirements. The - `PackedPolicySize` response element indicates by percentage how close - the policies and tags for your request are to the upper size limit. - - For more information about role session permissions, see [Session - policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session). - """ - - duration_seconds: int | None = None - """ - The duration, in seconds, of the role session. The value specified can - range from 900 seconds (15 minutes) up to the maximum session duration - set for the role. The maximum session duration setting can have a value - from 1 hour to 12 hours. If you specify a value higher than this setting - or the administrator setting (whichever is lower), the operation fails. - For example, if you specify a session duration of 12 hours, but your - administrator set the maximum session duration to 6 hours, your - operation fails. - - Role chaining limits your Amazon Web Services CLI or Amazon Web Services - API role session to a maximum of one hour. When you use the `AssumeRole` - API operation to assume a role, you can specify the duration of your - role session with the `DurationSeconds` parameter. You can specify a - parameter value of up to 43200 seconds (12 hours), depending on the - maximum session duration setting for your role. However, if you assume a - role using role chaining and provide a `DurationSeconds` parameter value - greater than one hour, the operation fails. To learn how to view the - maximum value for your role, see [Update the maximum session duration - for a - role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_update-role-settings.html#id_roles_update-session-duration). - - By default, the value is set to `3600` seconds. - - Note: - The `DurationSeconds` parameter is separate from the duration of a - console session that you might request using the returned credentials. - The request to the federation endpoint for a console sign-in token takes - a `SessionDuration` parameter that specifies the maximum length of the - console session. For more information, see [Creating a URL that Enables - Federated Users to Access the Amazon Web Services Management - Console](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html) - in the *IAM User Guide*. - """ - - tags: list[Tag] | None = None - """ - A list of session tags that you want to pass. Each session tag consists - of a key name and an associated value. For more information about - session tags, see [Tagging Amazon Web Services STS - Sessions](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) - in the *IAM User Guide*. - - This parameter is optional. You can pass up to 50 session tags. The - plaintext session tag keys can't exceed 128 characters, and the values - can't exceed 256 characters. For these and additional limits, see [IAM - and STS Character - Limits](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) - in the *IAM User Guide*. - - Note: - An Amazon Web Services conversion compresses the passed inline session - policy, managed policy ARNs, and session tags into a packed binary - format that has a separate limit. Your request can fail for this limit - even if your plaintext meets the other requirements. The - `PackedPolicySize` response element indicates by percentage how close - the policies and tags for your request are to the upper size limit. - - You can pass a session tag with the same key as a tag that is already - attached to the role. When you do, session tags override a role tag with - the same key. - - Tag key--value pairs are not case sensitive, but case is preserved. This - means that you cannot have separate `Department` and `department` tag - keys. Assume that the role has the `Department`=`Marketing` tag and you - pass the `department`=`engineering` session tag. `Department` and - `department` are not saved as separate tags, and the session tag passed - in the request takes precedence over the role tag. - - Additionally, if you used temporary credentials to perform this - operation, the new session inherits any transitive session tags from the - calling session. If you pass a session tag with the same key as an - inherited tag, the operation fails. To view the inherited tags for a - session, see the CloudTrail logs. For more information, see [Viewing - Session Tags in - CloudTrail](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_ctlogs) - in the *IAM User Guide*. - """ - - transitive_tag_keys: list[str] | None = None - """ - A list of keys for session tags that you want to set as transitive. If - you set a tag key as transitive, the corresponding key and value passes - to subsequent sessions in a role chain. For more information, see - [Chaining Roles with Session - Tags](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining) - in the *IAM User Guide*. - - This parameter is optional. The transitive status of a session tag does - not impact its packed binary size. - - If you choose not to specify a transitive tag key, then no tags are - passed from this session to any subsequent sessions. - """ - - external_id: str | None = None - """ - A unique identifier that might be required when you assume a role in - another account. If the administrator of the account to which the role - belongs provided you with an external ID, then provide that value in the - `ExternalId` parameter. This value can be any string, such as a - passphrase or account number. A cross-account role is usually set up to - trust everyone in an account. Therefore, the administrator of the - trusting account might send an external ID to the administrator of the - trusted account. That way, only someone with the ID can assume the role, - rather than everyone in the account. For more information about the - external ID, see [How to Use an External ID When Granting Access to Your - Amazon Web Services Resources to a Third - Party](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html) - in the *IAM User Guide*. - - The regex used to validate this parameter is a string of characters - consisting of upper- and lower-case alphanumeric characters with no - spaces. You can also include underscores or any of the following - characters: +=,.@:\\/- - """ - - serial_number: str | None = None - """ - The identification number of the MFA device that is associated with the - user who is making the `AssumeRole` call. Specify this value if the - trust policy of the role being assumed includes a condition that - requires MFA authentication. The value is either the serial number for a - hardware device (such as `GAHT12345678`) or an Amazon Resource Name - (ARN) for a virtual device (such as - `arn:aws:iam::123456789012:mfa/user`). - - The regex used to validate this parameter is a string of characters - consisting of upper- and lower-case alphanumeric characters with no - spaces. You can also include underscores or any of the following - characters: +=/:,.@- - """ - - token_code: str | None = None - """ - The value provided by the MFA device, if the trust policy of the role - being assumed requires MFA. (In other words, if the policy includes a - condition that tests for MFA). If the role being assumed requires MFA - and if the `TokenCode` value is missing or expired, the `AssumeRole` - call returns an \"access denied\" error. - - The format for this parameter, as described by its regex pattern, is a - sequence of six numeric digits. - """ - - source_identity: str | None = None - """ - The source identity specified by the principal that is calling the - `AssumeRole` operation. The source identity value persists across - [chained - role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html#iam-term-role-chaining) - sessions. - - You can require users to specify a source identity when they assume a - role. You do this by using the - [`sts:SourceIdentity`](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-sourceidentity) - condition key in a role trust policy. You can use source identity - information in CloudTrail logs to determine who took actions with a - role. You can use the `aws:SourceIdentity` condition key to further - control access to Amazon Web Services resources based on the value of - source identity. For more information about using source identity, see - [Monitor and control actions taken with assumed - roles](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html) - in the *IAM User Guide*. - - The regex used to validate this parameter is a string of characters - consisting of upper- and lower-case alphanumeric characters with no - spaces. You can also include underscores or any of the following - characters: +=,.@-. You cannot use a value that begins with the text - `aws:`. This prefix is reserved for Amazon Web Services internal use. - """ - - provided_contexts: list[ProvidedContext] | None = None - """ - A list of previously acquired trusted context assertions in the format - of a JSON array. The trusted context assertion is signed and encrypted - by Amazon Web Services STS. - - The following is an example of a `ProvidedContext` value that includes a - single trusted context assertion and the ARN of the context provider - from which the trusted context assertion was generated. - - `[{"ProviderArn":"arn:aws:iam::aws:contextProvider/IdentityCenter","ContextAssertion":"trusted-context-assertion"}]` - """ - - minimum_session_token_size: int | None = None - """ - The minimum size, in bytes, of the session token that STS issues for the - request. STS increases the session token to at least this size, - regardless of its actual content. The value must not exceed 4,096 bytes. - When set to 0 or not specified, the session token size is unchanged. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ASSUME_ROLE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.role_arn is not None: - serializer.write_string( - _SCHEMA_ASSUME_ROLE_INPUT.members["RoleArn"], self.role_arn - ) - - if self.role_session_name is not None: - serializer.write_string( - _SCHEMA_ASSUME_ROLE_INPUT.members["RoleSessionName"], - self.role_session_name, - ) - - if self.policy_arns is not None: - _serialize_policy_descriptor_list_type( - serializer, - _SCHEMA_ASSUME_ROLE_INPUT.members["PolicyArns"], - self.policy_arns, - ) - - if self.policy is not None: - serializer.write_string( - _SCHEMA_ASSUME_ROLE_INPUT.members["Policy"], self.policy - ) - - if self.duration_seconds is not None: - serializer.write_integer( - _SCHEMA_ASSUME_ROLE_INPUT.members["DurationSeconds"], - self.duration_seconds, - ) - - if self.tags is not None: - _serialize_tag_list_type( - serializer, _SCHEMA_ASSUME_ROLE_INPUT.members["Tags"], self.tags - ) - - if self.transitive_tag_keys is not None: - _serialize_tag_key_list_type( - serializer, - _SCHEMA_ASSUME_ROLE_INPUT.members["TransitiveTagKeys"], - self.transitive_tag_keys, - ) - - if self.external_id is not None: - serializer.write_string( - _SCHEMA_ASSUME_ROLE_INPUT.members["ExternalId"], self.external_id - ) - - if self.serial_number is not None: - serializer.write_string( - _SCHEMA_ASSUME_ROLE_INPUT.members["SerialNumber"], self.serial_number - ) - - if self.token_code is not None: - serializer.write_string( - _SCHEMA_ASSUME_ROLE_INPUT.members["TokenCode"], self.token_code - ) - - if self.source_identity is not None: - serializer.write_string( - _SCHEMA_ASSUME_ROLE_INPUT.members["SourceIdentity"], - self.source_identity, - ) - - if self.provided_contexts is not None: - _serialize_provided_contexts_list_type( - serializer, - _SCHEMA_ASSUME_ROLE_INPUT.members["ProvidedContexts"], - self.provided_contexts, - ) - - if self.minimum_session_token_size is not None: - serializer.write_integer( - _SCHEMA_ASSUME_ROLE_INPUT.members["MinimumSessionTokenSize"], - self.minimum_session_token_size, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["role_arn"] = de.read_string( - _SCHEMA_ASSUME_ROLE_INPUT.members["RoleArn"] - ) - - case 1: - kwargs["role_session_name"] = de.read_string( - _SCHEMA_ASSUME_ROLE_INPUT.members["RoleSessionName"] - ) - - case 2: - kwargs["policy_arns"] = _deserialize_policy_descriptor_list_type( - de, _SCHEMA_ASSUME_ROLE_INPUT.members["PolicyArns"] - ) - - case 3: - kwargs["policy"] = de.read_string( - _SCHEMA_ASSUME_ROLE_INPUT.members["Policy"] - ) - - case 4: - kwargs["duration_seconds"] = de.read_integer( - _SCHEMA_ASSUME_ROLE_INPUT.members["DurationSeconds"] - ) - - case 5: - kwargs["tags"] = _deserialize_tag_list_type( - de, _SCHEMA_ASSUME_ROLE_INPUT.members["Tags"] - ) - - case 6: - kwargs["transitive_tag_keys"] = _deserialize_tag_key_list_type( - de, _SCHEMA_ASSUME_ROLE_INPUT.members["TransitiveTagKeys"] - ) - - case 7: - kwargs["external_id"] = de.read_string( - _SCHEMA_ASSUME_ROLE_INPUT.members["ExternalId"] - ) - - case 8: - kwargs["serial_number"] = de.read_string( - _SCHEMA_ASSUME_ROLE_INPUT.members["SerialNumber"] - ) - - case 9: - kwargs["token_code"] = de.read_string( - _SCHEMA_ASSUME_ROLE_INPUT.members["TokenCode"] - ) - - case 10: - kwargs["source_identity"] = de.read_string( - _SCHEMA_ASSUME_ROLE_INPUT.members["SourceIdentity"] - ) - - case 11: - kwargs["provided_contexts"] = ( - _deserialize_provided_contexts_list_type( - de, _SCHEMA_ASSUME_ROLE_INPUT.members["ProvidedContexts"] - ) - ) - - case 12: - kwargs["minimum_session_token_size"] = de.read_integer( - _SCHEMA_ASSUME_ROLE_INPUT.members["MinimumSessionTokenSize"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ASSUME_ROLE_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class Credentials: - """Amazon Web Services credentials for API authentication.""" - - access_key_id: str - """The access key ID that identifies the temporary security credentials.""" - - secret_access_key: str = field(repr=False) - """The secret access key that can be used to sign requests.""" - - session_token: str - """ - The token that users must pass to the service API to use the temporary - credentials. - """ - - expiration: datetime - """The date on which the current credentials expire.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CREDENTIALS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CREDENTIALS.members["AccessKeyId"], self.access_key_id - ) - serializer.write_string( - _SCHEMA_CREDENTIALS.members["SecretAccessKey"], self.secret_access_key - ) - serializer.write_string( - _SCHEMA_CREDENTIALS.members["SessionToken"], self.session_token - ) - serializer.write_timestamp( - _SCHEMA_CREDENTIALS.members["Expiration"], self.expiration - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["access_key_id"] = de.read_string( - _SCHEMA_CREDENTIALS.members["AccessKeyId"] - ) - - case 1: - kwargs["secret_access_key"] = de.read_string( - _SCHEMA_CREDENTIALS.members["SecretAccessKey"] - ) - - case 2: - kwargs["session_token"] = de.read_string( - _SCHEMA_CREDENTIALS.members["SessionToken"] - ) - - case 3: - kwargs["expiration"] = de.read_timestamp( - _SCHEMA_CREDENTIALS.members["Expiration"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CREDENTIALS, consumer=_consumer) - if "access_key_id" not in kwargs: - kwargs["access_key_id"] = "" - if "secret_access_key" not in kwargs: - kwargs["secret_access_key"] = "" - if "session_token" not in kwargs: - kwargs["session_token"] = "" - if "expiration" not in kwargs: - kwargs["expiration"] = datetime.fromtimestamp(0, tz=timezone.utc) - return kwargs - - -@dataclass(kw_only=True) -class AssumeRoleOutput: - """ - Contains the response to a successful AssumeRole request, including - temporary Amazon Web Services credentials that can be used to make - Amazon Web Services requests. - """ - - credentials: Credentials | None = None - """ - The temporary security credentials, which include an access key ID, a - secret access key, and a security (or session) token. - - Note: - The size of the security token that STS API operations return is not - fixed. We strongly recommend that you make no assumptions about the - maximum size. - """ - - assumed_role_user: AssumedRoleUser | None = None - """ - The Amazon Resource Name (ARN) and the assumed role ID, which are - identifiers that you can use to refer to the resulting temporary - security credentials. For example, you can reference these credentials - as a principal in a resource-based policy by using the ARN or assumed - role ID. The ARN and ID include the `RoleSessionName` that you specified - when you called `AssumeRole`. - """ - - packed_policy_size: int | None = None - """ - A percentage value that indicates the packed size of the session - policies and session tags combined passed in the request. The request - fails if the packed size is greater than 100 percent, which means the - policies and tags exceeded the allowed space. - """ - - source_identity: str | None = None - """ - The source identity specified by the principal that is calling the - `AssumeRole` operation. - - You can require users to specify a source identity when they assume a - role. You do this by using the `sts:SourceIdentity` condition key in a - role trust policy. You can use source identity information in CloudTrail - logs to determine who took actions with a role. You can use the - `aws:SourceIdentity` condition key to further control access to Amazon - Web Services resources based on the value of source identity. For more - information about using source identity, see [Monitor and control - actions taken with assumed - roles](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html) - in the *IAM User Guide*. - - The regex used to validate this parameter is a string of characters - consisting of upper- and lower-case alphanumeric characters with no - spaces. You can also include underscores or any of the following - characters: =,.@- - """ - - session_token_utilization: int | None = None - """ - The percentage (0-100) of the maximum allowed session token size that - the returned session token consumes. - """ - - session_token_size: int | None = None - """ - The size, in bytes, of the session token returned in the Credentials for - this response. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ASSUME_ROLE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.credentials is not None: - serializer.write_struct( - _SCHEMA_ASSUME_ROLE_OUTPUT.members["Credentials"], self.credentials - ) - - if self.assumed_role_user is not None: - serializer.write_struct( - _SCHEMA_ASSUME_ROLE_OUTPUT.members["AssumedRoleUser"], - self.assumed_role_user, - ) - - if self.packed_policy_size is not None: - serializer.write_integer( - _SCHEMA_ASSUME_ROLE_OUTPUT.members["PackedPolicySize"], - self.packed_policy_size, - ) - - if self.source_identity is not None: - serializer.write_string( - _SCHEMA_ASSUME_ROLE_OUTPUT.members["SourceIdentity"], - self.source_identity, - ) - - if self.session_token_utilization is not None: - serializer.write_integer( - _SCHEMA_ASSUME_ROLE_OUTPUT.members["SessionTokenUtilization"], - self.session_token_utilization, - ) - - if self.session_token_size is not None: - serializer.write_integer( - _SCHEMA_ASSUME_ROLE_OUTPUT.members["SessionTokenSize"], - self.session_token_size, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["credentials"] = Credentials.deserialize(de) - - case 1: - kwargs["assumed_role_user"] = AssumedRoleUser.deserialize(de) - - case 2: - kwargs["packed_policy_size"] = de.read_integer( - _SCHEMA_ASSUME_ROLE_OUTPUT.members["PackedPolicySize"] - ) - - case 3: - kwargs["source_identity"] = de.read_string( - _SCHEMA_ASSUME_ROLE_OUTPUT.members["SourceIdentity"] - ) - - case 4: - kwargs["session_token_utilization"] = de.read_integer( - _SCHEMA_ASSUME_ROLE_OUTPUT.members["SessionTokenUtilization"] - ) - - case 5: - kwargs["session_token_size"] = de.read_integer( - _SCHEMA_ASSUME_ROLE_OUTPUT.members["SessionTokenSize"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ASSUME_ROLE_OUTPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ExpiredTokenException(ServiceError): - """ - The web identity token that was passed is expired or is not valid. Get a - new identity token from the identity provider and then retry the - request. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EXPIRED_TOKEN_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_EXPIRED_TOKEN_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_EXPIRED_TOKEN_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_EXPIRED_TOKEN_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class MalformedPolicyDocumentException(ServiceError): - """ - The request was rejected because the policy document was malformed. The - error message describes the specific error. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MALFORMED_POLICY_DOCUMENT_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_MALFORMED_POLICY_DOCUMENT_EXCEPTION.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_MALFORMED_POLICY_DOCUMENT_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MALFORMED_POLICY_DOCUMENT_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class PackedPolicyTooLargeException(ServiceError): - """ - The request was rejected because the total packed size of the session - policies and session tags combined was too large. An Amazon Web Services - conversion compresses the session policy document, session policy ARNs, - and session tags into a packed binary format that has a separate limit. - The error message indicates by percentage how close the policies and - tags are to the upper size limit. For more information, see [Passing - Session Tags in - STS](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) - in the *IAM User Guide*. - - You could receive this error even though you meet other defined session - policy and session tag limits. For more information, see [IAM and STS - Entity Character - Limits](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html#reference_iam-limits-entity-length) - in the *IAM User Guide*. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_PACKED_POLICY_TOO_LARGE_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_PACKED_POLICY_TOO_LARGE_EXCEPTION.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_PACKED_POLICY_TOO_LARGE_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_PACKED_POLICY_TOO_LARGE_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class RegionDisabledException(ServiceError): - """ - STS is not activated in the requested region for the account that is - being asked to generate credentials. The account administrator must use - the IAM console to activate STS in that region. For more information, - see [Activating and Deactivating STS in an Amazon Web Services - Region](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html#sts-regions-activate-deactivate) - in the *IAM User Guide*. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_REGION_DISABLED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_REGION_DISABLED_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_REGION_DISABLED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_REGION_DISABLED_EXCEPTION, consumer=_consumer) - return kwargs - - -ASSUME_ROLE = APIOperation( - input=AssumeRoleInput, - output=AssumeRoleOutput, - schema=_SCHEMA_ASSUME_ROLE, - input_schema=_SCHEMA_ASSUME_ROLE_INPUT, - output_schema=_SCHEMA_ASSUME_ROLE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.sts#ExpiredTokenException"): ExpiredTokenException, - ShapeID( - "com.amazonaws.sts#MalformedPolicyDocumentException" - ): MalformedPolicyDocumentException, - ShapeID( - "com.amazonaws.sts#PackedPolicyTooLargeException" - ): PackedPolicyTooLargeException, - ShapeID( - "com.amazonaws.sts#RegionDisabledException" - ): RegionDisabledException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4"), ShapeID("aws.auth#sigv4a")], - error_schemas=[ - _SCHEMA_EXPIRED_TOKEN_EXCEPTION, - _SCHEMA_MALFORMED_POLICY_DOCUMENT_EXCEPTION, - _SCHEMA_PACKED_POLICY_TOO_LARGE_EXCEPTION, - _SCHEMA_REGION_DISABLED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class AssumeRoleWithSAMLInput: - """Dataclass for AssumeRoleWithSAMLInput structure.""" - - role_arn: str | None = None - """The Amazon Resource Name (ARN) of the role that the caller is assuming.""" - - principal_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the SAML provider in IAM that - describes the IdP. - """ - - saml_assertion: str | None = field(repr=False, default=None) - """ - The base64 encoded SAML authentication response provided by the IdP. - - For more information, see [Configuring a Relying Party and Adding - Claims](https://docs.aws.amazon.com/IAM/latest/UserGuide/create-role-saml-IdP-tasks.html) - in the *IAM User Guide*. - """ - - policy_arns: list[PolicyDescriptorType] | None = None - """ - The Amazon Resource Names (ARNs) of the IAM managed policies that you - want to use as managed session policies. The policies must exist in the - same account as the role. - - This parameter is optional. You can provide up to 10 managed policy - ARNs. However, the plaintext that you use for both inline and managed - session policies can't exceed 2,048 characters. For more information - about ARNs, see [Amazon Resource Names (ARNs) and Amazon Web Services - Service - Namespaces](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - in the Amazon Web Services General Reference. - - Note: - An Amazon Web Services conversion compresses the passed inline session - policy, managed policy ARNs, and session tags into a packed binary - format that has a separate limit. Your request can fail for this limit - even if your plaintext meets the other requirements. The - `PackedPolicySize` response element indicates by percentage how close - the policies and tags for your request are to the upper size limit. - - Passing policies to this operation returns new temporary credentials. - The resulting session's permissions are the intersection of the role's - identity-based policy and the session policies. You can use the role's - temporary credentials in subsequent Amazon Web Services API calls to - access resources in the account that owns the role. You cannot use - session policies to grant more permissions than those allowed by the - identity-based policy of the role that is being assumed. For more - information, see [Session - Policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) - in the *IAM User Guide*. - """ - - policy: str | None = None - """ - An IAM policy in JSON format that you want to use as an inline session - policy. - - This parameter is optional. Passing policies to this operation returns - new temporary credentials. The resulting session's permissions are the - intersection of the role's identity-based policy and the session - policies. You can use the role's temporary credentials in subsequent - Amazon Web Services API calls to access resources in the account that - owns the role. You cannot use session policies to grant more permissions - than those allowed by the identity-based policy of the role that is - being assumed. For more information, see [Session - Policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) - in the *IAM User Guide*. - - The plaintext that you use for both inline and managed session policies - can't exceed 2,048 characters. The JSON policy characters can be any - ASCII character from the space character to the end of the valid - character list (\\u0020 through \\u00FF). It can also include the tab - (\\u0009), linefeed (\\u000A), and carriage return (\\u000D) characters. - - For more information about role session permissions, see [Session - policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session). - - Note: - An Amazon Web Services conversion compresses the passed inline session - policy, managed policy ARNs, and session tags into a packed binary - format that has a separate limit. Your request can fail for this limit - even if your plaintext meets the other requirements. The - `PackedPolicySize` response element indicates by percentage how close - the policies and tags for your request are to the upper size limit. - """ - - duration_seconds: int | None = None - """ - The duration, in seconds, of the role session. Your role session lasts - for the duration that you specify for the `DurationSeconds` parameter, - or until the time specified in the SAML authentication response's - `SessionNotOnOrAfter` value, whichever is shorter. You can provide a - `DurationSeconds` value from 900 seconds (15 minutes) up to the maximum - session duration setting for the role. This setting can have a value - from 1 hour to 12 hours. If you specify a value higher than this - setting, the operation fails. For example, if you specify a session - duration of 12 hours, but your administrator set the maximum session - duration to 6 hours, your operation fails. To learn how to view the - maximum value for your role, see [View the Maximum Session Duration - Setting for a - Role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session) - in the *IAM User Guide*. - - By default, the value is set to `3600` seconds. - - Note: - The `DurationSeconds` parameter is separate from the duration of a - console session that you might request using the returned credentials. - The request to the federation endpoint for a console sign-in token takes - a `SessionDuration` parameter that specifies the maximum length of the - console session. For more information, see [Creating a URL that Enables - Federated Users to Access the Amazon Web Services Management - Console](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html) - in the *IAM User Guide*. - """ - - minimum_session_token_size: int | None = None - """ - The minimum size, in bytes, of the session token that STS issues for the - request. STS increases the session token to at least this size, - regardless of its actual content. The value must not exceed 4,096 bytes. - When set to 0 or not specified, the session token size is unchanged. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ASSUME_ROLE_WITH_SAML_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.role_arn is not None: - serializer.write_string( - _SCHEMA_ASSUME_ROLE_WITH_SAML_INPUT.members["RoleArn"], self.role_arn - ) - - if self.principal_arn is not None: - serializer.write_string( - _SCHEMA_ASSUME_ROLE_WITH_SAML_INPUT.members["PrincipalArn"], - self.principal_arn, - ) - - if self.saml_assertion is not None: - serializer.write_string( - _SCHEMA_ASSUME_ROLE_WITH_SAML_INPUT.members["SAMLAssertion"], - self.saml_assertion, - ) - - if self.policy_arns is not None: - _serialize_policy_descriptor_list_type( - serializer, - _SCHEMA_ASSUME_ROLE_WITH_SAML_INPUT.members["PolicyArns"], - self.policy_arns, - ) - - if self.policy is not None: - serializer.write_string( - _SCHEMA_ASSUME_ROLE_WITH_SAML_INPUT.members["Policy"], self.policy - ) - - if self.duration_seconds is not None: - serializer.write_integer( - _SCHEMA_ASSUME_ROLE_WITH_SAML_INPUT.members["DurationSeconds"], - self.duration_seconds, - ) - - if self.minimum_session_token_size is not None: - serializer.write_integer( - _SCHEMA_ASSUME_ROLE_WITH_SAML_INPUT.members["MinimumSessionTokenSize"], - self.minimum_session_token_size, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["role_arn"] = de.read_string( - _SCHEMA_ASSUME_ROLE_WITH_SAML_INPUT.members["RoleArn"] - ) - - case 1: - kwargs["principal_arn"] = de.read_string( - _SCHEMA_ASSUME_ROLE_WITH_SAML_INPUT.members["PrincipalArn"] - ) - - case 2: - kwargs["saml_assertion"] = de.read_string( - _SCHEMA_ASSUME_ROLE_WITH_SAML_INPUT.members["SAMLAssertion"] - ) - - case 3: - kwargs["policy_arns"] = _deserialize_policy_descriptor_list_type( - de, _SCHEMA_ASSUME_ROLE_WITH_SAML_INPUT.members["PolicyArns"] - ) - - case 4: - kwargs["policy"] = de.read_string( - _SCHEMA_ASSUME_ROLE_WITH_SAML_INPUT.members["Policy"] - ) - - case 5: - kwargs["duration_seconds"] = de.read_integer( - _SCHEMA_ASSUME_ROLE_WITH_SAML_INPUT.members["DurationSeconds"] - ) - - case 6: - kwargs["minimum_session_token_size"] = de.read_integer( - _SCHEMA_ASSUME_ROLE_WITH_SAML_INPUT.members[ - "MinimumSessionTokenSize" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ASSUME_ROLE_WITH_SAML_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class AssumeRoleWithSAMLOutput: - """ - Contains the response to a successful AssumeRoleWithSAML request, - including temporary Amazon Web Services credentials that can be used to - make Amazon Web Services requests. - """ - - credentials: Credentials | None = None - """ - The temporary security credentials, which include an access key ID, a - secret access key, and a security (or session) token. - - Note: - The size of the security token that STS API operations return is not - fixed. We strongly recommend that you make no assumptions about the - maximum size. - """ - - assumed_role_user: AssumedRoleUser | None = None - """ - The identifiers for the temporary security credentials that the - operation returns. - """ - - packed_policy_size: int | None = None - """ - A percentage value that indicates the packed size of the session - policies and session tags combined passed in the request. The request - fails if the packed size is greater than 100 percent, which means the - policies and tags exceeded the allowed space. - """ - - subject: str | None = None - """ - The value of the `NameID` element in the `Subject` element of the SAML - assertion. - """ - - subject_type: str | None = None - """ - The format of the name ID, as defined by the `Format` attribute in the - `NameID` element of the SAML assertion. Typical examples of the format - are `transient` or `persistent`. - - If the format includes the prefix - `urn:oasis:names:tc:SAML:2.0:nameid-format`, that prefix is removed. For - example, `urn:oasis:names:tc:SAML:2.0:nameid-format:transient` is - returned as `transient`. If the format includes any other prefix, the - format is returned with no modifications. - """ - - issuer: str | None = None - """The value of the `Issuer` element of the SAML assertion.""" - - audience: str | None = None - """ - The value of the `Recipient` attribute of the `SubjectConfirmationData` - element of the SAML assertion. - """ - - name_qualifier: str | None = None - """ - A hash value based on the concatenation of the following: - - - The `Issuer` response value. - - - The Amazon Web Services account ID. - - - The friendly name (the last part of the ARN) of the SAML provider in - IAM. - - The combination of `NameQualifier` and `Subject` can be used to uniquely - identify a user. - - The following pseudocode shows how the hash value is calculated: - - `BASE64 ( SHA1 ( "https://example.com/saml" + "123456789012" + "/MySAMLIdP" ) )` - """ - - source_identity: str | None = None - """ - The value in the `SourceIdentity` attribute in the SAML assertion. The - source identity value persists across [chained - role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html#iam-term-role-chaining) - sessions. - - You can require users to set a source identity value when they assume a - role. You do this by using the `sts:SourceIdentity` condition key in a - role trust policy. That way, actions that are taken with the role are - associated with that user. After the source identity is set, the value - cannot be changed. It is present in the request for all actions that are - taken by the role and persists across [chained - role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html#id_roles_terms-and-concepts) - sessions. You can configure your SAML identity provider to use an - attribute associated with your users, like user name or email, as the - source identity when calling `AssumeRoleWithSAML`. You do this by adding - an attribute to the SAML assertion. For more information about using - source identity, see [Monitor and control actions taken with assumed - roles](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html) - in the *IAM User Guide*. - - The regex used to validate this parameter is a string of characters - consisting of upper- and lower-case alphanumeric characters with no - spaces. You can also include underscores or any of the following - characters: =,.@- - """ - - session_token_utilization: int | None = None - """ - The percentage (0-100) of the maximum allowed session token size that - the returned session token consumes. - """ - - session_token_size: int | None = None - """ - The size, in bytes, of the session token returned in the Credentials for - this response. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ASSUME_ROLE_WITH_SAML_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.credentials is not None: - serializer.write_struct( - _SCHEMA_ASSUME_ROLE_WITH_SAML_OUTPUT.members["Credentials"], - self.credentials, - ) - - if self.assumed_role_user is not None: - serializer.write_struct( - _SCHEMA_ASSUME_ROLE_WITH_SAML_OUTPUT.members["AssumedRoleUser"], - self.assumed_role_user, - ) - - if self.packed_policy_size is not None: - serializer.write_integer( - _SCHEMA_ASSUME_ROLE_WITH_SAML_OUTPUT.members["PackedPolicySize"], - self.packed_policy_size, - ) - - if self.subject is not None: - serializer.write_string( - _SCHEMA_ASSUME_ROLE_WITH_SAML_OUTPUT.members["Subject"], self.subject - ) - - if self.subject_type is not None: - serializer.write_string( - _SCHEMA_ASSUME_ROLE_WITH_SAML_OUTPUT.members["SubjectType"], - self.subject_type, - ) - - if self.issuer is not None: - serializer.write_string( - _SCHEMA_ASSUME_ROLE_WITH_SAML_OUTPUT.members["Issuer"], self.issuer - ) - - if self.audience is not None: - serializer.write_string( - _SCHEMA_ASSUME_ROLE_WITH_SAML_OUTPUT.members["Audience"], self.audience - ) - - if self.name_qualifier is not None: - serializer.write_string( - _SCHEMA_ASSUME_ROLE_WITH_SAML_OUTPUT.members["NameQualifier"], - self.name_qualifier, - ) - - if self.source_identity is not None: - serializer.write_string( - _SCHEMA_ASSUME_ROLE_WITH_SAML_OUTPUT.members["SourceIdentity"], - self.source_identity, - ) - - if self.session_token_utilization is not None: - serializer.write_integer( - _SCHEMA_ASSUME_ROLE_WITH_SAML_OUTPUT.members["SessionTokenUtilization"], - self.session_token_utilization, - ) - - if self.session_token_size is not None: - serializer.write_integer( - _SCHEMA_ASSUME_ROLE_WITH_SAML_OUTPUT.members["SessionTokenSize"], - self.session_token_size, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["credentials"] = Credentials.deserialize(de) - - case 1: - kwargs["assumed_role_user"] = AssumedRoleUser.deserialize(de) - - case 2: - kwargs["packed_policy_size"] = de.read_integer( - _SCHEMA_ASSUME_ROLE_WITH_SAML_OUTPUT.members["PackedPolicySize"] - ) - - case 3: - kwargs["subject"] = de.read_string( - _SCHEMA_ASSUME_ROLE_WITH_SAML_OUTPUT.members["Subject"] - ) - - case 4: - kwargs["subject_type"] = de.read_string( - _SCHEMA_ASSUME_ROLE_WITH_SAML_OUTPUT.members["SubjectType"] - ) - - case 5: - kwargs["issuer"] = de.read_string( - _SCHEMA_ASSUME_ROLE_WITH_SAML_OUTPUT.members["Issuer"] - ) - - case 6: - kwargs["audience"] = de.read_string( - _SCHEMA_ASSUME_ROLE_WITH_SAML_OUTPUT.members["Audience"] - ) - - case 7: - kwargs["name_qualifier"] = de.read_string( - _SCHEMA_ASSUME_ROLE_WITH_SAML_OUTPUT.members["NameQualifier"] - ) - - case 8: - kwargs["source_identity"] = de.read_string( - _SCHEMA_ASSUME_ROLE_WITH_SAML_OUTPUT.members["SourceIdentity"] - ) - - case 9: - kwargs["session_token_utilization"] = de.read_integer( - _SCHEMA_ASSUME_ROLE_WITH_SAML_OUTPUT.members[ - "SessionTokenUtilization" - ] - ) - - case 10: - kwargs["session_token_size"] = de.read_integer( - _SCHEMA_ASSUME_ROLE_WITH_SAML_OUTPUT.members["SessionTokenSize"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ASSUME_ROLE_WITH_SAML_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class IDPRejectedClaimException(ServiceError): - """ - The identity provider (IdP) reported that authentication failed. This - might be because the claim is invalid. - - If this error is returned for the `AssumeRoleWithWebIdentity` operation, - it can also mean that the claim has expired or has been explicitly - revoked. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IDP_REJECTED_CLAIM_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_IDP_REJECTED_CLAIM_EXCEPTION.members["message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_IDP_REJECTED_CLAIM_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_IDP_REJECTED_CLAIM_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InvalidIdentityTokenException(ServiceError): - """ - The web identity token that was passed could not be validated by Amazon - Web Services. Get a new identity token from the identity provider and - then retry the request. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_IDENTITY_TOKEN_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_IDENTITY_TOKEN_EXCEPTION.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_IDENTITY_TOKEN_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVALID_IDENTITY_TOKEN_EXCEPTION, consumer=_consumer - ) - return kwargs - - -ASSUME_ROLE_WITH_SAML = APIOperation( - input=AssumeRoleWithSAMLInput, - output=AssumeRoleWithSAMLOutput, - schema=_SCHEMA_ASSUME_ROLE_WITH_SAML, - input_schema=_SCHEMA_ASSUME_ROLE_WITH_SAML_INPUT, - output_schema=_SCHEMA_ASSUME_ROLE_WITH_SAML_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.sts#ExpiredTokenException"): ExpiredTokenException, - ShapeID( - "com.amazonaws.sts#IDPRejectedClaimException" - ): IDPRejectedClaimException, - ShapeID( - "com.amazonaws.sts#InvalidIdentityTokenException" - ): InvalidIdentityTokenException, - ShapeID( - "com.amazonaws.sts#MalformedPolicyDocumentException" - ): MalformedPolicyDocumentException, - ShapeID( - "com.amazonaws.sts#PackedPolicyTooLargeException" - ): PackedPolicyTooLargeException, - ShapeID( - "com.amazonaws.sts#RegionDisabledException" - ): RegionDisabledException, - } - ), - effective_auth_schemes=[ShapeID("smithy.api#noAuth")], - error_schemas=[ - _SCHEMA_EXPIRED_TOKEN_EXCEPTION, - _SCHEMA_IDP_REJECTED_CLAIM_EXCEPTION, - _SCHEMA_INVALID_IDENTITY_TOKEN_EXCEPTION, - _SCHEMA_MALFORMED_POLICY_DOCUMENT_EXCEPTION, - _SCHEMA_PACKED_POLICY_TOO_LARGE_EXCEPTION, - _SCHEMA_REGION_DISABLED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class AssumeRoleWithWebIdentityInput: - """Dataclass for AssumeRoleWithWebIdentityInput structure.""" - - role_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the role that the caller is assuming. - - Note: - Additional considerations apply to Amazon Cognito identity pools that - assume [cross-account IAM - roles](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies-cross-account-resource-access.html). - The trust policies of these roles must accept the - `cognito-identity.amazonaws.com` service principal and must contain the - `cognito-identity.amazonaws.com:aud` condition key to restrict role - assumption to users from your intended identity pools. A policy that - trusts Amazon Cognito identity pools without this condition creates a - risk that a user from an unintended identity pool can assume the role. - For more information, see [Trust policies for IAM roles in Basic - (Classic) - authentication](https://docs.aws.amazon.com/cognito/latest/developerguide/iam-roles.html#trust-policies) - in the *Amazon Cognito Developer Guide*. - """ - - role_session_name: str | None = None - """ - An identifier for the assumed role session. Typically, you pass the name - or identifier that is associated with the user who is using your - application. That way, the temporary security credentials that your - application will use are associated with that user. This session name is - included as part of the ARN and assumed role ID in the `AssumedRoleUser` - response element. - - For security purposes, administrators can view this field in [CloudTrail - logs](https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-integration.html#cloudtrail-integration_signin-tempcreds) - to help identify who performed an action in Amazon Web Services. Your - administrator might require that you specify your user name as the - session name when you assume the role. For more information, see - [`sts:RoleSessionName`](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#ck_rolesessionname) - . - - The regex used to validate this parameter is a string of characters - consisting of upper- and lower-case alphanumeric characters with no - spaces. You can also include underscores or any of the following - characters: =,.@- - """ - - web_identity_token: str | None = field(repr=False, default=None) - """ - The OAuth 2.0 access token or OpenID Connect ID token that is provided - by the identity provider. Your application must get this token by - authenticating the user who is using your application with a web - identity provider before the application makes an - `AssumeRoleWithWebIdentity` call. Timestamps in the token must be - formatted as either an integer or a long integer. Tokens must be signed - using either RSA keys (RS256, RS384, or RS512) or ECDSA keys (ES256, - ES384, or ES512). - """ - - provider_id: str | None = None - """ - The fully qualified host component of the domain name of the OAuth 2.0 - identity provider. Do not specify this value for an OpenID Connect - identity provider. - - Currently `www.amazon.com` and `graph.facebook.com` are the only - supported identity providers for OAuth 2.0 access tokens. Do not include - URL schemes and port numbers. - - Do not specify this value for OpenID Connect ID tokens. - """ - - policy_arns: list[PolicyDescriptorType] | None = None - """ - The Amazon Resource Names (ARNs) of the IAM managed policies that you - want to use as managed session policies. The policies must exist in the - same account as the role. - - This parameter is optional. You can provide up to 10 managed policy - ARNs. However, the plaintext that you use for both inline and managed - session policies can't exceed 2,048 characters. For more information - about ARNs, see [Amazon Resource Names (ARNs) and Amazon Web Services - Service - Namespaces](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - in the Amazon Web Services General Reference. - - Note: - An Amazon Web Services conversion compresses the passed inline session - policy, managed policy ARNs, and session tags into a packed binary - format that has a separate limit. Your request can fail for this limit - even if your plaintext meets the other requirements. The - `PackedPolicySize` response element indicates by percentage how close - the policies and tags for your request are to the upper size limit. - - Passing policies to this operation returns new temporary credentials. - The resulting session's permissions are the intersection of the role's - identity-based policy and the session policies. You can use the role's - temporary credentials in subsequent Amazon Web Services API calls to - access resources in the account that owns the role. You cannot use - session policies to grant more permissions than those allowed by the - identity-based policy of the role that is being assumed. For more - information, see [Session - Policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) - in the *IAM User Guide*. - """ - - policy: str | None = None - """ - An IAM policy in JSON format that you want to use as an inline session - policy. - - This parameter is optional. Passing policies to this operation returns - new temporary credentials. The resulting session's permissions are the - intersection of the role's identity-based policy and the session - policies. You can use the role's temporary credentials in subsequent - Amazon Web Services API calls to access resources in the account that - owns the role. You cannot use session policies to grant more permissions - than those allowed by the identity-based policy of the role that is - being assumed. For more information, see [Session - Policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) - in the *IAM User Guide*. - - The plaintext that you use for both inline and managed session policies - can't exceed 2,048 characters. The JSON policy characters can be any - ASCII character from the space character to the end of the valid - character list (\\u0020 through \\u00FF). It can also include the tab - (\\u0009), linefeed (\\u000A), and carriage return (\\u000D) characters. - - For more information about role session permissions, see [Session - policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session). - - Note: - An Amazon Web Services conversion compresses the passed inline session - policy, managed policy ARNs, and session tags into a packed binary - format that has a separate limit. Your request can fail for this limit - even if your plaintext meets the other requirements. The - `PackedPolicySize` response element indicates by percentage how close - the policies and tags for your request are to the upper size limit. - """ - - duration_seconds: int | None = None - """ - The duration, in seconds, of the role session. The value can range from - 900 seconds (15 minutes) up to the maximum session duration setting for - the role. This setting can have a value from 1 hour to 12 hours. If you - specify a value higher than this setting, the operation fails. For - example, if you specify a session duration of 12 hours, but your - administrator set the maximum session duration to 6 hours, your - operation fails. To learn how to view the maximum value for your role, - see [View the Maximum Session Duration Setting for a - Role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session) - in the *IAM User Guide*. - - By default, the value is set to `3600` seconds. - - Note: - The `DurationSeconds` parameter is separate from the duration of a - console session that you might request using the returned credentials. - The request to the federation endpoint for a console sign-in token takes - a `SessionDuration` parameter that specifies the maximum length of the - console session. For more information, see [Creating a URL that Enables - Federated Users to Access the Amazon Web Services Management - Console](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html) - in the *IAM User Guide*. - """ - - minimum_session_token_size: int | None = None - """ - The minimum size, in bytes, of the session token that STS issues for the - request. STS increases the session token to at least this size, - regardless of its actual content. The value must not exceed 4,096 bytes. - When set to 0 or not specified, the session token size is unchanged. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ASSUME_ROLE_WITH_WEB_IDENTITY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.role_arn is not None: - serializer.write_string( - _SCHEMA_ASSUME_ROLE_WITH_WEB_IDENTITY_INPUT.members["RoleArn"], - self.role_arn, - ) - - if self.role_session_name is not None: - serializer.write_string( - _SCHEMA_ASSUME_ROLE_WITH_WEB_IDENTITY_INPUT.members["RoleSessionName"], - self.role_session_name, - ) - - if self.web_identity_token is not None: - serializer.write_string( - _SCHEMA_ASSUME_ROLE_WITH_WEB_IDENTITY_INPUT.members["WebIdentityToken"], - self.web_identity_token, - ) - - if self.provider_id is not None: - serializer.write_string( - _SCHEMA_ASSUME_ROLE_WITH_WEB_IDENTITY_INPUT.members["ProviderId"], - self.provider_id, - ) - - if self.policy_arns is not None: - _serialize_policy_descriptor_list_type( - serializer, - _SCHEMA_ASSUME_ROLE_WITH_WEB_IDENTITY_INPUT.members["PolicyArns"], - self.policy_arns, - ) - - if self.policy is not None: - serializer.write_string( - _SCHEMA_ASSUME_ROLE_WITH_WEB_IDENTITY_INPUT.members["Policy"], - self.policy, - ) - - if self.duration_seconds is not None: - serializer.write_integer( - _SCHEMA_ASSUME_ROLE_WITH_WEB_IDENTITY_INPUT.members["DurationSeconds"], - self.duration_seconds, - ) - - if self.minimum_session_token_size is not None: - serializer.write_integer( - _SCHEMA_ASSUME_ROLE_WITH_WEB_IDENTITY_INPUT.members[ - "MinimumSessionTokenSize" - ], - self.minimum_session_token_size, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["role_arn"] = de.read_string( - _SCHEMA_ASSUME_ROLE_WITH_WEB_IDENTITY_INPUT.members["RoleArn"] - ) - - case 1: - kwargs["role_session_name"] = de.read_string( - _SCHEMA_ASSUME_ROLE_WITH_WEB_IDENTITY_INPUT.members[ - "RoleSessionName" - ] - ) - - case 2: - kwargs["web_identity_token"] = de.read_string( - _SCHEMA_ASSUME_ROLE_WITH_WEB_IDENTITY_INPUT.members[ - "WebIdentityToken" - ] - ) - - case 3: - kwargs["provider_id"] = de.read_string( - _SCHEMA_ASSUME_ROLE_WITH_WEB_IDENTITY_INPUT.members[ - "ProviderId" - ] - ) - - case 4: - kwargs["policy_arns"] = _deserialize_policy_descriptor_list_type( - de, - _SCHEMA_ASSUME_ROLE_WITH_WEB_IDENTITY_INPUT.members[ - "PolicyArns" - ], - ) - - case 5: - kwargs["policy"] = de.read_string( - _SCHEMA_ASSUME_ROLE_WITH_WEB_IDENTITY_INPUT.members["Policy"] - ) - - case 6: - kwargs["duration_seconds"] = de.read_integer( - _SCHEMA_ASSUME_ROLE_WITH_WEB_IDENTITY_INPUT.members[ - "DurationSeconds" - ] - ) - - case 7: - kwargs["minimum_session_token_size"] = de.read_integer( - _SCHEMA_ASSUME_ROLE_WITH_WEB_IDENTITY_INPUT.members[ - "MinimumSessionTokenSize" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ASSUME_ROLE_WITH_WEB_IDENTITY_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class AssumeRoleWithWebIdentityOutput: - """ - Contains the response to a successful AssumeRoleWithWebIdentity request, - including temporary Amazon Web Services credentials that can be used to - make Amazon Web Services requests. - """ - - credentials: Credentials | None = None - """ - The temporary security credentials, which include an access key ID, a - secret access key, and a security token. - - Note: - The size of the security token that STS API operations return is not - fixed. We strongly recommend that you make no assumptions about the - maximum size. - """ - - subject_from_web_identity_token: str | None = None - """ - The unique user identifier that is returned by the identity provider. - This identifier is associated with the `WebIdentityToken` that was - submitted with the `AssumeRoleWithWebIdentity` call. The identifier is - typically unique to the user and the application that acquired the - `WebIdentityToken` (pairwise identifier). For OpenID Connect ID tokens, - this field contains the value returned by the identity provider as the - token's `sub` (Subject) claim. - """ - - assumed_role_user: AssumedRoleUser | None = None - """ - The Amazon Resource Name (ARN) and the assumed role ID, which are - identifiers that you can use to refer to the resulting temporary - security credentials. For example, you can reference these credentials - as a principal in a resource-based policy by using the ARN or assumed - role ID. The ARN and ID include the `RoleSessionName` that you specified - when you called `AssumeRole`. - """ - - packed_policy_size: int | None = None - """ - A percentage value that indicates the packed size of the session - policies and session tags combined passed in the request. The request - fails if the packed size is greater than 100 percent, which means the - policies and tags exceeded the allowed space. - """ - - provider: str | None = None - """ - The issuing authority of the web identity token presented. For OpenID - Connect ID tokens, this contains the value of the `iss` field. For OAuth - 2.0 access tokens, this contains the value of the `ProviderId` parameter - that was passed in the `AssumeRoleWithWebIdentity` request. - """ - - audience: str | None = None - """ - The intended audience (also known as client ID) of the web identity - token. This is traditionally the client identifier issued to the - application that requested the web identity token. - """ - - source_identity: str | None = None - """ - The value of the source identity that is returned in the JSON web token - (JWT) from the identity provider. - - You can require users to set a source identity value when they assume a - role. You do this by using the `sts:SourceIdentity` condition key in a - role trust policy. That way, actions that are taken with the role are - associated with that user. After the source identity is set, the value - cannot be changed. It is present in the request for all actions that are - taken by the role and persists across [chained - role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html#id_roles_terms-and-concepts) - sessions. You can configure your identity provider to use an attribute - associated with your users, like user name or email, as the source - identity when calling `AssumeRoleWithWebIdentity`. You do this by adding - a claim to the JSON web token. To learn more about OIDC tokens and - claims, see [Using Tokens with User - Pools](https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-using-tokens-with-identity-providers.html) - in the *Amazon Cognito Developer Guide*. For more information about - using source identity, see [Monitor and control actions taken with - assumed - roles](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html) - in the *IAM User Guide*. - - The regex used to validate this parameter is a string of characters - consisting of upper- and lower-case alphanumeric characters with no - spaces. You can also include underscores or any of the following - characters: =,.@- - """ - - session_token_utilization: int | None = None - """ - The percentage (0-100) of the maximum allowed session token size that - the returned session token consumes. - """ - - session_token_size: int | None = None - """ - The size, in bytes, of the session token returned in the Credentials for - this response. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ASSUME_ROLE_WITH_WEB_IDENTITY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.credentials is not None: - serializer.write_struct( - _SCHEMA_ASSUME_ROLE_WITH_WEB_IDENTITY_OUTPUT.members["Credentials"], - self.credentials, - ) - - if self.subject_from_web_identity_token is not None: - serializer.write_string( - _SCHEMA_ASSUME_ROLE_WITH_WEB_IDENTITY_OUTPUT.members[ - "SubjectFromWebIdentityToken" - ], - self.subject_from_web_identity_token, - ) - - if self.assumed_role_user is not None: - serializer.write_struct( - _SCHEMA_ASSUME_ROLE_WITH_WEB_IDENTITY_OUTPUT.members["AssumedRoleUser"], - self.assumed_role_user, - ) - - if self.packed_policy_size is not None: - serializer.write_integer( - _SCHEMA_ASSUME_ROLE_WITH_WEB_IDENTITY_OUTPUT.members[ - "PackedPolicySize" - ], - self.packed_policy_size, - ) - - if self.provider is not None: - serializer.write_string( - _SCHEMA_ASSUME_ROLE_WITH_WEB_IDENTITY_OUTPUT.members["Provider"], - self.provider, - ) - - if self.audience is not None: - serializer.write_string( - _SCHEMA_ASSUME_ROLE_WITH_WEB_IDENTITY_OUTPUT.members["Audience"], - self.audience, - ) - - if self.source_identity is not None: - serializer.write_string( - _SCHEMA_ASSUME_ROLE_WITH_WEB_IDENTITY_OUTPUT.members["SourceIdentity"], - self.source_identity, - ) - - if self.session_token_utilization is not None: - serializer.write_integer( - _SCHEMA_ASSUME_ROLE_WITH_WEB_IDENTITY_OUTPUT.members[ - "SessionTokenUtilization" - ], - self.session_token_utilization, - ) - - if self.session_token_size is not None: - serializer.write_integer( - _SCHEMA_ASSUME_ROLE_WITH_WEB_IDENTITY_OUTPUT.members[ - "SessionTokenSize" - ], - self.session_token_size, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["credentials"] = Credentials.deserialize(de) - - case 1: - kwargs["subject_from_web_identity_token"] = de.read_string( - _SCHEMA_ASSUME_ROLE_WITH_WEB_IDENTITY_OUTPUT.members[ - "SubjectFromWebIdentityToken" - ] - ) - - case 2: - kwargs["assumed_role_user"] = AssumedRoleUser.deserialize(de) - - case 3: - kwargs["packed_policy_size"] = de.read_integer( - _SCHEMA_ASSUME_ROLE_WITH_WEB_IDENTITY_OUTPUT.members[ - "PackedPolicySize" - ] - ) - - case 4: - kwargs["provider"] = de.read_string( - _SCHEMA_ASSUME_ROLE_WITH_WEB_IDENTITY_OUTPUT.members["Provider"] - ) - - case 5: - kwargs["audience"] = de.read_string( - _SCHEMA_ASSUME_ROLE_WITH_WEB_IDENTITY_OUTPUT.members["Audience"] - ) - - case 6: - kwargs["source_identity"] = de.read_string( - _SCHEMA_ASSUME_ROLE_WITH_WEB_IDENTITY_OUTPUT.members[ - "SourceIdentity" - ] - ) - - case 7: - kwargs["session_token_utilization"] = de.read_integer( - _SCHEMA_ASSUME_ROLE_WITH_WEB_IDENTITY_OUTPUT.members[ - "SessionTokenUtilization" - ] - ) - - case 8: - kwargs["session_token_size"] = de.read_integer( - _SCHEMA_ASSUME_ROLE_WITH_WEB_IDENTITY_OUTPUT.members[ - "SessionTokenSize" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_ASSUME_ROLE_WITH_WEB_IDENTITY_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class IDPCommunicationErrorException(ServiceError): - """ - The request could not be fulfilled because the identity provider (IDP) - that was asked to verify the incoming identity token could not be - reached. This is often a transient error caused by network conditions. - Retry the request a limited number of times so that you don't exceed - the request rate. If the error persists, the identity provider might be - down or not responding. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_IDP_COMMUNICATION_ERROR_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_IDP_COMMUNICATION_ERROR_EXCEPTION.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_IDP_COMMUNICATION_ERROR_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_IDP_COMMUNICATION_ERROR_EXCEPTION, consumer=_consumer - ) - return kwargs - - -ASSUME_ROLE_WITH_WEB_IDENTITY = APIOperation( - input=AssumeRoleWithWebIdentityInput, - output=AssumeRoleWithWebIdentityOutput, - schema=_SCHEMA_ASSUME_ROLE_WITH_WEB_IDENTITY, - input_schema=_SCHEMA_ASSUME_ROLE_WITH_WEB_IDENTITY_INPUT, - output_schema=_SCHEMA_ASSUME_ROLE_WITH_WEB_IDENTITY_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.sts#ExpiredTokenException"): ExpiredTokenException, - ShapeID( - "com.amazonaws.sts#IDPCommunicationErrorException" - ): IDPCommunicationErrorException, - ShapeID( - "com.amazonaws.sts#IDPRejectedClaimException" - ): IDPRejectedClaimException, - ShapeID( - "com.amazonaws.sts#InvalidIdentityTokenException" - ): InvalidIdentityTokenException, - ShapeID( - "com.amazonaws.sts#MalformedPolicyDocumentException" - ): MalformedPolicyDocumentException, - ShapeID( - "com.amazonaws.sts#PackedPolicyTooLargeException" - ): PackedPolicyTooLargeException, - ShapeID( - "com.amazonaws.sts#RegionDisabledException" - ): RegionDisabledException, - } - ), - effective_auth_schemes=[ShapeID("smithy.api#noAuth")], - error_schemas=[ - _SCHEMA_EXPIRED_TOKEN_EXCEPTION, - _SCHEMA_IDP_COMMUNICATION_ERROR_EXCEPTION, - _SCHEMA_IDP_REJECTED_CLAIM_EXCEPTION, - _SCHEMA_INVALID_IDENTITY_TOKEN_EXCEPTION, - _SCHEMA_MALFORMED_POLICY_DOCUMENT_EXCEPTION, - _SCHEMA_PACKED_POLICY_TOO_LARGE_EXCEPTION, - _SCHEMA_REGION_DISABLED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class AssumeRootInput: - """Dataclass for AssumeRootInput structure.""" - - target_principal: str | None = None - """The member account principal ARN or account ID.""" - - task_policy_arn: PolicyDescriptorType | None = None - """ - The identity based policy that scopes the session to the privileged - tasks that can be performed. You must use one of following Amazon Web - Services managed policies to scope root session actions: - - - [IAMAuditRootUserCredentials](https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMAuditRootUserCredentials) - - - [IAMCreateRootUserPassword](https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMCreateRootUserPassword) - - - [IAMDeleteRootUserCredentials](https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMDeleteRootUserCredentials) - - - [S3UnlockBucketPolicy](https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-S3UnlockBucketPolicy) - - - [SQSUnlockQueuePolicy](https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-SQSUnlockQueuePolicy) - """ - - duration_seconds: int | None = None - """ - The duration, in seconds, of the privileged session. The value can range - from 0 seconds up to the maximum session duration of 900 seconds (15 - minutes). If you specify a value higher than this setting, the operation - fails. - - By default, the value is set to `900` seconds. - """ - - minimum_session_token_size: int | None = None - """ - The minimum size, in bytes, of the session token that STS issues for the - request. STS increases the session token to at least this size, - regardless of its actual content. The value must not exceed 4,096 bytes. - When set to 0 or not specified, the session token size is unchanged. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ASSUME_ROOT_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.target_principal is not None: - serializer.write_string( - _SCHEMA_ASSUME_ROOT_INPUT.members["TargetPrincipal"], - self.target_principal, - ) - - if self.task_policy_arn is not None: - serializer.write_struct( - _SCHEMA_ASSUME_ROOT_INPUT.members["TaskPolicyArn"], self.task_policy_arn - ) - - if self.duration_seconds is not None: - serializer.write_integer( - _SCHEMA_ASSUME_ROOT_INPUT.members["DurationSeconds"], - self.duration_seconds, - ) - - if self.minimum_session_token_size is not None: - serializer.write_integer( - _SCHEMA_ASSUME_ROOT_INPUT.members["MinimumSessionTokenSize"], - self.minimum_session_token_size, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["target_principal"] = de.read_string( - _SCHEMA_ASSUME_ROOT_INPUT.members["TargetPrincipal"] - ) - - case 1: - kwargs["task_policy_arn"] = PolicyDescriptorType.deserialize(de) - - case 2: - kwargs["duration_seconds"] = de.read_integer( - _SCHEMA_ASSUME_ROOT_INPUT.members["DurationSeconds"] - ) - - case 3: - kwargs["minimum_session_token_size"] = de.read_integer( - _SCHEMA_ASSUME_ROOT_INPUT.members["MinimumSessionTokenSize"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ASSUME_ROOT_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class AssumeRootOutput: - """Dataclass for AssumeRootOutput structure.""" - - credentials: Credentials | None = None - """ - The temporary security credentials, which include an access key ID, a - secret access key, and a security token. - - Note: - The size of the security token that STS API operations return is not - fixed. We strongly recommend that you make no assumptions about the - maximum size. - """ - - source_identity: str | None = None - """ - The source identity specified by the principal that is calling the - `AssumeRoot` operation. - - You can use the `aws:SourceIdentity` condition key to control access - based on the value of source identity. For more information about using - source identity, see [Monitor and control actions taken with assumed - roles](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html) - in the *IAM User Guide*. - - The regex used to validate this parameter is a string of characters - consisting of upper- and lower-case alphanumeric characters with no - spaces. You can also include underscores or any of the following - characters: =,.@- - """ - - session_token_utilization: int | None = None - """ - The percentage (0-100) of the maximum allowed session token size that - the returned session token consumes. - """ - - session_token_size: int | None = None - """ - The size, in bytes, of the session token returned in the Credentials for - this response. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ASSUME_ROOT_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.credentials is not None: - serializer.write_struct( - _SCHEMA_ASSUME_ROOT_OUTPUT.members["Credentials"], self.credentials - ) - - if self.source_identity is not None: - serializer.write_string( - _SCHEMA_ASSUME_ROOT_OUTPUT.members["SourceIdentity"], - self.source_identity, - ) - - if self.session_token_utilization is not None: - serializer.write_integer( - _SCHEMA_ASSUME_ROOT_OUTPUT.members["SessionTokenUtilization"], - self.session_token_utilization, - ) - - if self.session_token_size is not None: - serializer.write_integer( - _SCHEMA_ASSUME_ROOT_OUTPUT.members["SessionTokenSize"], - self.session_token_size, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["credentials"] = Credentials.deserialize(de) - - case 1: - kwargs["source_identity"] = de.read_string( - _SCHEMA_ASSUME_ROOT_OUTPUT.members["SourceIdentity"] - ) - - case 2: - kwargs["session_token_utilization"] = de.read_integer( - _SCHEMA_ASSUME_ROOT_OUTPUT.members["SessionTokenUtilization"] - ) - - case 3: - kwargs["session_token_size"] = de.read_integer( - _SCHEMA_ASSUME_ROOT_OUTPUT.members["SessionTokenSize"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ASSUME_ROOT_OUTPUT, consumer=_consumer) - return kwargs - - -ASSUME_ROOT = APIOperation( - input=AssumeRootInput, - output=AssumeRootOutput, - schema=_SCHEMA_ASSUME_ROOT, - input_schema=_SCHEMA_ASSUME_ROOT_INPUT, - output_schema=_SCHEMA_ASSUME_ROOT_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID("com.amazonaws.sts#ExpiredTokenException"): ExpiredTokenException, - ShapeID( - "com.amazonaws.sts#RegionDisabledException" - ): RegionDisabledException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4"), ShapeID("aws.auth#sigv4a")], - error_schemas=[_SCHEMA_EXPIRED_TOKEN_EXCEPTION, _SCHEMA_REGION_DISABLED_EXCEPTION], -) - - -@dataclass(kw_only=True) -class DecodeAuthorizationMessageInput: - """Dataclass for DecodeAuthorizationMessageInput structure.""" - - encoded_message: str | None = None - """The encoded message that was returned with the response.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DECODE_AUTHORIZATION_MESSAGE_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.encoded_message is not None: - serializer.write_string( - _SCHEMA_DECODE_AUTHORIZATION_MESSAGE_INPUT.members["EncodedMessage"], - self.encoded_message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["encoded_message"] = de.read_string( - _SCHEMA_DECODE_AUTHORIZATION_MESSAGE_INPUT.members[ - "EncodedMessage" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DECODE_AUTHORIZATION_MESSAGE_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class DecodeAuthorizationMessageOutput: - """ - A document that contains additional information about the authorization - status of a request from an encoded message that is returned in response - to an Amazon Web Services request. - """ - - decoded_message: str | None = None - """The API returns a response with the decoded message.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_DECODE_AUTHORIZATION_MESSAGE_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.decoded_message is not None: - serializer.write_string( - _SCHEMA_DECODE_AUTHORIZATION_MESSAGE_OUTPUT.members["DecodedMessage"], - self.decoded_message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["decoded_message"] = de.read_string( - _SCHEMA_DECODE_AUTHORIZATION_MESSAGE_OUTPUT.members[ - "DecodedMessage" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_DECODE_AUTHORIZATION_MESSAGE_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class InvalidAuthorizationMessageException(ServiceError): - """ - The error returned if the message passed to `DecodeAuthorizationMessage` - was invalid. This can happen if the token contains invalid characters, - such as line breaks, or if the message has expired. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INVALID_AUTHORIZATION_MESSAGE_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INVALID_AUTHORIZATION_MESSAGE_EXCEPTION.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INVALID_AUTHORIZATION_MESSAGE_EXCEPTION.members[ - "message" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_INVALID_AUTHORIZATION_MESSAGE_EXCEPTION, consumer=_consumer - ) - return kwargs - - -DECODE_AUTHORIZATION_MESSAGE = APIOperation( - input=DecodeAuthorizationMessageInput, - output=DecodeAuthorizationMessageOutput, - schema=_SCHEMA_DECODE_AUTHORIZATION_MESSAGE, - input_schema=_SCHEMA_DECODE_AUTHORIZATION_MESSAGE_INPUT, - output_schema=_SCHEMA_DECODE_AUTHORIZATION_MESSAGE_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.sts#InvalidAuthorizationMessageException" - ): InvalidAuthorizationMessageException - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4"), ShapeID("aws.auth#sigv4a")], - error_schemas=[_SCHEMA_INVALID_AUTHORIZATION_MESSAGE_EXCEPTION], -) - - -@dataclass(kw_only=True) -class GetAccessKeyInfoInput: - """Dataclass for GetAccessKeyInfoInput structure.""" - - access_key_id: str | None = None - """ - The identifier of an access key. - - This parameter allows (through its regex pattern) a string of characters - that can consist of any upper- or lowercase letter or digit. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_ACCESS_KEY_INFO_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.access_key_id is not None: - serializer.write_string( - _SCHEMA_GET_ACCESS_KEY_INFO_INPUT.members["AccessKeyId"], - self.access_key_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["access_key_id"] = de.read_string( - _SCHEMA_GET_ACCESS_KEY_INFO_INPUT.members["AccessKeyId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_ACCESS_KEY_INFO_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetAccessKeyInfoOutput: - """Dataclass for GetAccessKeyInfoOutput structure.""" - - account: str | None = None - """The number used to identify the Amazon Web Services account.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_ACCESS_KEY_INFO_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.account is not None: - serializer.write_string( - _SCHEMA_GET_ACCESS_KEY_INFO_OUTPUT.members["Account"], self.account - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["account"] = de.read_string( - _SCHEMA_GET_ACCESS_KEY_INFO_OUTPUT.members["Account"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_ACCESS_KEY_INFO_OUTPUT, consumer=_consumer) - return kwargs - - -GET_ACCESS_KEY_INFO = APIOperation( - input=GetAccessKeyInfoInput, - output=GetAccessKeyInfoOutput, - schema=_SCHEMA_GET_ACCESS_KEY_INFO, - input_schema=_SCHEMA_GET_ACCESS_KEY_INFO_INPUT, - output_schema=_SCHEMA_GET_ACCESS_KEY_INFO_OUTPUT, - error_registry=TypeRegistry({}), - effective_auth_schemes=[ShapeID("aws.auth#sigv4"), ShapeID("aws.auth#sigv4a")], - error_schemas=[], -) - - -@dataclass(kw_only=True) -class GetCallerIdentityInput: - """Dataclass for GetCallerIdentityInput structure.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_CALLER_IDENTITY_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - pass - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_CALLER_IDENTITY_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetCallerIdentityOutput: - """ - Contains the response to a successful GetCallerIdentity request, - including information about the entity making the request. - """ - - user_id: str | None = None - """ - The unique identifier of the calling entity. The exact value depends on - the type of entity that is making the call. The values returned are - those listed in the **aws:userid** column in the [Principal - table](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_variables.html#principaltable) - found on the **Policy Variables** reference page in the *IAM User - Guide*. - """ - - account: str | None = None - """ - The Amazon Web Services account ID number of the account that owns or - contains the calling entity. - """ - - arn: str | None = None - """The Amazon Web Services ARN associated with the calling entity.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_CALLER_IDENTITY_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.user_id is not None: - serializer.write_string( - _SCHEMA_GET_CALLER_IDENTITY_OUTPUT.members["UserId"], self.user_id - ) - - if self.account is not None: - serializer.write_string( - _SCHEMA_GET_CALLER_IDENTITY_OUTPUT.members["Account"], self.account - ) - - if self.arn is not None: - serializer.write_string( - _SCHEMA_GET_CALLER_IDENTITY_OUTPUT.members["Arn"], self.arn - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["user_id"] = de.read_string( - _SCHEMA_GET_CALLER_IDENTITY_OUTPUT.members["UserId"] - ) - - case 1: - kwargs["account"] = de.read_string( - _SCHEMA_GET_CALLER_IDENTITY_OUTPUT.members["Account"] - ) - - case 2: - kwargs["arn"] = de.read_string( - _SCHEMA_GET_CALLER_IDENTITY_OUTPUT.members["Arn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_CALLER_IDENTITY_OUTPUT, consumer=_consumer) - return kwargs - - -GET_CALLER_IDENTITY = APIOperation( - input=GetCallerIdentityInput, - output=GetCallerIdentityOutput, - schema=_SCHEMA_GET_CALLER_IDENTITY, - input_schema=_SCHEMA_GET_CALLER_IDENTITY_INPUT, - output_schema=_SCHEMA_GET_CALLER_IDENTITY_OUTPUT, - error_registry=TypeRegistry({}), - effective_auth_schemes=[ShapeID("aws.auth#sigv4"), ShapeID("aws.auth#sigv4a")], - error_schemas=[], -) - - -@dataclass(kw_only=True) -class ExpiredTradeInTokenException(ServiceError): - """ - The trade-in token provided in the request has expired and can no longer - be exchanged for credentials. Request a new token and retry the - operation. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_EXPIRED_TRADE_IN_TOKEN_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_EXPIRED_TRADE_IN_TOKEN_EXCEPTION.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_EXPIRED_TRADE_IN_TOKEN_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_EXPIRED_TRADE_IN_TOKEN_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetDelegatedAccessTokenInput: - """Dataclass for GetDelegatedAccessTokenInput structure.""" - - trade_in_token: str | None = field(repr=False, default=None) - """ - The token to exchange for temporary Amazon Web Services credentials. - This token must be valid and unexpired at the time of the request. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DELEGATED_ACCESS_TOKEN_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.trade_in_token is not None: - serializer.write_string( - _SCHEMA_GET_DELEGATED_ACCESS_TOKEN_INPUT.members["TradeInToken"], - self.trade_in_token, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["trade_in_token"] = de.read_string( - _SCHEMA_GET_DELEGATED_ACCESS_TOKEN_INPUT.members["TradeInToken"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_DELEGATED_ACCESS_TOKEN_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetDelegatedAccessTokenOutput: - """Dataclass for GetDelegatedAccessTokenOutput structure.""" - - credentials: Credentials | None = None - """Amazon Web Services credentials for API authentication.""" - - packed_policy_size: int | None = None - """ - The percentage of the maximum policy size that is used by the session - policy. The policy size is calculated as the sum of all the session - policies and permission boundaries attached to the session. If the - packed size exceeds 100%, the request fails. - """ - - assumed_principal: str | None = None - """ - The Amazon Resource Name (ARN) of the principal that was assumed when - obtaining the delegated access token. This ARN identifies the IAM entity - whose permissions are granted by the temporary credentials. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_DELEGATED_ACCESS_TOKEN_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.credentials is not None: - serializer.write_struct( - _SCHEMA_GET_DELEGATED_ACCESS_TOKEN_OUTPUT.members["Credentials"], - self.credentials, - ) - - if self.packed_policy_size is not None: - serializer.write_integer( - _SCHEMA_GET_DELEGATED_ACCESS_TOKEN_OUTPUT.members["PackedPolicySize"], - self.packed_policy_size, - ) - - if self.assumed_principal is not None: - serializer.write_string( - _SCHEMA_GET_DELEGATED_ACCESS_TOKEN_OUTPUT.members["AssumedPrincipal"], - self.assumed_principal, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["credentials"] = Credentials.deserialize(de) - - case 1: - kwargs["packed_policy_size"] = de.read_integer( - _SCHEMA_GET_DELEGATED_ACCESS_TOKEN_OUTPUT.members[ - "PackedPolicySize" - ] - ) - - case 2: - kwargs["assumed_principal"] = de.read_string( - _SCHEMA_GET_DELEGATED_ACCESS_TOKEN_OUTPUT.members[ - "AssumedPrincipal" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_DELEGATED_ACCESS_TOKEN_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_DELEGATED_ACCESS_TOKEN = APIOperation( - input=GetDelegatedAccessTokenInput, - output=GetDelegatedAccessTokenOutput, - schema=_SCHEMA_GET_DELEGATED_ACCESS_TOKEN, - input_schema=_SCHEMA_GET_DELEGATED_ACCESS_TOKEN_INPUT, - output_schema=_SCHEMA_GET_DELEGATED_ACCESS_TOKEN_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.sts#ExpiredTradeInTokenException" - ): ExpiredTradeInTokenException, - ShapeID( - "com.amazonaws.sts#PackedPolicyTooLargeException" - ): PackedPolicyTooLargeException, - ShapeID( - "com.amazonaws.sts#RegionDisabledException" - ): RegionDisabledException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4"), ShapeID("aws.auth#sigv4a")], - error_schemas=[ - _SCHEMA_EXPIRED_TRADE_IN_TOKEN_EXCEPTION, - _SCHEMA_PACKED_POLICY_TOO_LARGE_EXCEPTION, - _SCHEMA_REGION_DISABLED_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class GetFederationTokenInput: - """Dataclass for GetFederationTokenInput structure.""" - - name: str | None = None - """ - The name of the federated user. The name is used as an identifier for - the temporary security credentials (such as `Bob`). For example, you can - reference the federated user name in a resource-based policy, such as in - an Amazon S3 bucket policy. - - The regex used to validate this parameter is a string of characters - consisting of upper- and lower-case alphanumeric characters with no - spaces. You can also include underscores or any of the following - characters: =,.@- - """ - - policy: str | None = None - """ - An IAM policy in JSON format that you want to use as an inline session - policy. - - You must pass an inline or managed [session - policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) - to this operation. You can pass a single JSON policy document to use as - an inline session policy. You can also specify up to 10 managed policy - Amazon Resource Names (ARNs) to use as managed session policies. - - This parameter is optional. However, if you do not pass any session - policies, then the resulting federated user session has no permissions. - - When you pass session policies, the session permissions are the - intersection of the IAM user policies and the session policies that you - pass. This gives you a way to further restrict the permissions for a - federated user. You cannot use session policies to grant more - permissions than those that are defined in the permissions policy of the - IAM user. For more information, see [Session - Policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) - in the *IAM User Guide*. - - The resulting credentials can be used to access a resource that has a - resource-based policy. If that policy specifically references the - federated user session in the `Principal` element of the policy, the - session has the permissions allowed by the policy. These permissions are - granted in addition to the permissions that are granted by the session - policies. - - The plaintext that you use for both inline and managed session policies - can't exceed 2,048 characters. The JSON policy characters can be any - ASCII character from the space character to the end of the valid - character list (\\u0020 through \\u00FF). It can also include the tab - (\\u0009), linefeed (\\u000A), and carriage return (\\u000D) characters. - - Note: - An Amazon Web Services conversion compresses the passed inline session - policy, managed policy ARNs, and session tags into a packed binary - format that has a separate limit. Your request can fail for this limit - even if your plaintext meets the other requirements. The - `PackedPolicySize` response element indicates by percentage how close - the policies and tags for your request are to the upper size limit. - """ - - policy_arns: list[PolicyDescriptorType] | None = None - """ - The Amazon Resource Names (ARNs) of the IAM managed policies that you - want to use as a managed session policy. The policies must exist in the - same account as the IAM user that is requesting federated access. - - You must pass an inline or managed [session - policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) - to this operation. You can pass a single JSON policy document to use as - an inline session policy. You can also specify up to 10 managed policy - Amazon Resource Names (ARNs) to use as managed session policies. The - plaintext that you use for both inline and managed session policies - can't exceed 2,048 characters. You can provide up to 10 managed policy - ARNs. For more information about ARNs, see [Amazon Resource Names (ARNs) - and Amazon Web Services Service - Namespaces](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - in the Amazon Web Services General Reference. - - This parameter is optional. However, if you do not pass any session - policies, then the resulting federated user session has no permissions. - - When you pass session policies, the session permissions are the - intersection of the IAM user policies and the session policies that you - pass. This gives you a way to further restrict the permissions for a - federated user. You cannot use session policies to grant more - permissions than those that are defined in the permissions policy of the - IAM user. For more information, see [Session - Policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) - in the *IAM User Guide*. - - The resulting credentials can be used to access a resource that has a - resource-based policy. If that policy specifically references the - federated user session in the `Principal` element of the policy, the - session has the permissions allowed by the policy. These permissions are - granted in addition to the permissions that are granted by the session - policies. - - Note: - An Amazon Web Services conversion compresses the passed inline session - policy, managed policy ARNs, and session tags into a packed binary - format that has a separate limit. Your request can fail for this limit - even if your plaintext meets the other requirements. The - `PackedPolicySize` response element indicates by percentage how close - the policies and tags for your request are to the upper size limit. - """ - - duration_seconds: int | None = None - """ - The duration, in seconds, that the session should last. Acceptable - durations for federation sessions range from 900 seconds (15 minutes) to - 129,600 seconds (36 hours), with 43,200 seconds (12 hours) as the - default. Sessions obtained using root user credentials are restricted to - a maximum of 3,600 seconds (one hour). If the specified duration is - longer than one hour, the session obtained by using root user - credentials defaults to one hour. - """ - - tags: list[Tag] | None = None - """ - A list of session tags. Each session tag consists of a key name and an - associated value. For more information about session tags, see [Passing - Session Tags in - STS](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) - in the *IAM User Guide*. - - This parameter is optional. You can pass up to 50 session tags. The - plaintext session tag keys can't exceed 128 characters and the values - can't exceed 256 characters. For these and additional limits, see [IAM - and STS Character - Limits](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) - in the *IAM User Guide*. - - Note: - An Amazon Web Services conversion compresses the passed inline session - policy, managed policy ARNs, and session tags into a packed binary - format that has a separate limit. Your request can fail for this limit - even if your plaintext meets the other requirements. The - `PackedPolicySize` response element indicates by percentage how close - the policies and tags for your request are to the upper size limit. - - You can pass a session tag with the same key as a tag that is already - attached to the user you are federating. When you do, session tags - override a user tag with the same key. - - Tag key--value pairs are not case sensitive, but case is preserved. This - means that you cannot have separate `Department` and `department` tag - keys. Assume that the role has the `Department`=`Marketing` tag and you - pass the `department`=`engineering` session tag. `Department` and - `department` are not saved as separate tags, and the session tag passed - in the request takes precedence over the role tag. - """ - - minimum_session_token_size: int | None = None - """ - The minimum size, in bytes, of the session token that STS issues for the - request. STS increases the session token to at least this size, - regardless of its actual content. The value must not exceed 4,096 bytes. - When set to 0 or not specified, the session token size is unchanged. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_FEDERATION_TOKEN_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.name is not None: - serializer.write_string( - _SCHEMA_GET_FEDERATION_TOKEN_INPUT.members["Name"], self.name - ) - - if self.policy is not None: - serializer.write_string( - _SCHEMA_GET_FEDERATION_TOKEN_INPUT.members["Policy"], self.policy - ) - - if self.policy_arns is not None: - _serialize_policy_descriptor_list_type( - serializer, - _SCHEMA_GET_FEDERATION_TOKEN_INPUT.members["PolicyArns"], - self.policy_arns, - ) - - if self.duration_seconds is not None: - serializer.write_integer( - _SCHEMA_GET_FEDERATION_TOKEN_INPUT.members["DurationSeconds"], - self.duration_seconds, - ) - - if self.tags is not None: - _serialize_tag_list_type( - serializer, - _SCHEMA_GET_FEDERATION_TOKEN_INPUT.members["Tags"], - self.tags, - ) - - if self.minimum_session_token_size is not None: - serializer.write_integer( - _SCHEMA_GET_FEDERATION_TOKEN_INPUT.members["MinimumSessionTokenSize"], - self.minimum_session_token_size, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["name"] = de.read_string( - _SCHEMA_GET_FEDERATION_TOKEN_INPUT.members["Name"] - ) - - case 1: - kwargs["policy"] = de.read_string( - _SCHEMA_GET_FEDERATION_TOKEN_INPUT.members["Policy"] - ) - - case 2: - kwargs["policy_arns"] = _deserialize_policy_descriptor_list_type( - de, _SCHEMA_GET_FEDERATION_TOKEN_INPUT.members["PolicyArns"] - ) - - case 3: - kwargs["duration_seconds"] = de.read_integer( - _SCHEMA_GET_FEDERATION_TOKEN_INPUT.members["DurationSeconds"] - ) - - case 4: - kwargs["tags"] = _deserialize_tag_list_type( - de, _SCHEMA_GET_FEDERATION_TOKEN_INPUT.members["Tags"] - ) - - case 5: - kwargs["minimum_session_token_size"] = de.read_integer( - _SCHEMA_GET_FEDERATION_TOKEN_INPUT.members[ - "MinimumSessionTokenSize" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_FEDERATION_TOKEN_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class FederatedUser: - """ - Identifiers for the federated user that is associated with the - credentials. - """ - - federated_user_id: str - """ - The string that identifies the federated user associated with the - credentials, similar to the unique ID of an IAM user. - """ - - arn: str - """ - The ARN that specifies the federated user that is associated with the - credentials. For more information about ARNs and how to use them in - policies, see [IAM - Identifiers](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html) - in the *IAM User Guide*. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_FEDERATED_USER, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_FEDERATED_USER.members["FederatedUserId"], self.federated_user_id - ) - serializer.write_string(_SCHEMA_FEDERATED_USER.members["Arn"], self.arn) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["federated_user_id"] = de.read_string( - _SCHEMA_FEDERATED_USER.members["FederatedUserId"] - ) - - case 1: - kwargs["arn"] = de.read_string( - _SCHEMA_FEDERATED_USER.members["Arn"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_FEDERATED_USER, consumer=_consumer) - if "federated_user_id" not in kwargs: - kwargs["federated_user_id"] = "" - if "arn" not in kwargs: - kwargs["arn"] = "" - return kwargs - - -@dataclass(kw_only=True) -class GetFederationTokenOutput: - """ - Contains the response to a successful GetFederationToken request, - including temporary Amazon Web Services credentials that can be used to - make Amazon Web Services requests. - """ - - credentials: Credentials | None = None - """ - The temporary security credentials, which include an access key ID, a - secret access key, and a security (or session) token. - - Note: - The size of the security token that STS API operations return is not - fixed. We strongly recommend that you make no assumptions about the - maximum size. - """ - - federated_user: FederatedUser | None = None - """ - Identifiers for the federated user associated with the credentials (such - as `arn:aws:sts::123456789012:federated-user/Bob` or - `123456789012:Bob`). You can use the federated user's ARN in your - resource-based policies, such as an Amazon S3 bucket policy. - """ - - packed_policy_size: int | None = None - """ - A percentage value that indicates the packed size of the session - policies and session tags combined passed in the request. The request - fails if the packed size is greater than 100 percent, which means the - policies and tags exceeded the allowed space. - """ - - session_token_utilization: int | None = None - """ - The percentage (0-100) of the maximum allowed session token size that - the returned session token consumes. - """ - session_token_size: int | None = None - """ - The size, in bytes, of the session token returned in the Credentials for - this response. +class ServiceError(ModeledError): """ + Base error for all errors in the service. - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. + Some exceptions do not extend from this class, including + synthetic, implicit, and shared exception types. """ - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_FEDERATION_TOKEN_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.credentials is not None: - serializer.write_struct( - _SCHEMA_GET_FEDERATION_TOKEN_OUTPUT.members["Credentials"], - self.credentials, - ) - - if self.federated_user is not None: - serializer.write_struct( - _SCHEMA_GET_FEDERATION_TOKEN_OUTPUT.members["FederatedUser"], - self.federated_user, - ) - - if self.packed_policy_size is not None: - serializer.write_integer( - _SCHEMA_GET_FEDERATION_TOKEN_OUTPUT.members["PackedPolicySize"], - self.packed_policy_size, - ) - - if self.session_token_utilization is not None: - serializer.write_integer( - _SCHEMA_GET_FEDERATION_TOKEN_OUTPUT.members["SessionTokenUtilization"], - self.session_token_utilization, - ) - - if self.session_token_size is not None: - serializer.write_integer( - _SCHEMA_GET_FEDERATION_TOKEN_OUTPUT.members["SessionTokenSize"], - self.session_token_size, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["credentials"] = Credentials.deserialize(de) - - case 1: - kwargs["federated_user"] = FederatedUser.deserialize(de) - - case 2: - kwargs["packed_policy_size"] = de.read_integer( - _SCHEMA_GET_FEDERATION_TOKEN_OUTPUT.members["PackedPolicySize"] - ) - - case 3: - kwargs["session_token_utilization"] = de.read_integer( - _SCHEMA_GET_FEDERATION_TOKEN_OUTPUT.members[ - "SessionTokenUtilization" - ] - ) - - case 4: - kwargs["session_token_size"] = de.read_integer( - _SCHEMA_GET_FEDERATION_TOKEN_OUTPUT.members["SessionTokenSize"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_FEDERATION_TOKEN_OUTPUT, consumer=_consumer - ) - return kwargs - - -GET_FEDERATION_TOKEN = APIOperation( - input=GetFederationTokenInput, - output=GetFederationTokenOutput, - schema=_SCHEMA_GET_FEDERATION_TOKEN, - input_schema=_SCHEMA_GET_FEDERATION_TOKEN_INPUT, - output_schema=_SCHEMA_GET_FEDERATION_TOKEN_OUTPUT, - error_registry=TypeRegistry( +_registry = ModelRegistry( + _schemas, + renames={}, + index={ + "AssumedRoleUser": "ASSUMED_ROLE_USER", + "AssumeRoleInput": "ASSUME_ROLE_INPUT", + "AssumeRoleOutput": "ASSUME_ROLE_OUTPUT", + "AssumeRoleWithSAMLInput": "ASSUME_ROLE_WITH_SAML_INPUT", + "AssumeRoleWithSAMLOutput": "ASSUME_ROLE_WITH_SAML_OUTPUT", + "AssumeRoleWithWebIdentityInput": "ASSUME_ROLE_WITH_WEB_IDENTITY_INPUT", + "AssumeRoleWithWebIdentityOutput": "ASSUME_ROLE_WITH_WEB_IDENTITY_OUTPUT", + "AssumeRootInput": "ASSUME_ROOT_INPUT", + "AssumeRootOutput": "ASSUME_ROOT_OUTPUT", + "Credentials": "CREDENTIALS", + "DecodeAuthorizationMessageInput": "DECODE_AUTHORIZATION_MESSAGE_INPUT", + "DecodeAuthorizationMessageOutput": "DECODE_AUTHORIZATION_MESSAGE_OUTPUT", + "ExpiredTokenException": "EXPIRED_TOKEN_EXCEPTION", + "ExpiredTradeInTokenException": "EXPIRED_TRADE_IN_TOKEN_EXCEPTION", + "FederatedUser": "FEDERATED_USER", + "GetAccessKeyInfoInput": "GET_ACCESS_KEY_INFO_INPUT", + "GetAccessKeyInfoOutput": "GET_ACCESS_KEY_INFO_OUTPUT", + "GetCallerIdentityInput": "GET_CALLER_IDENTITY_INPUT", + "GetCallerIdentityOutput": "GET_CALLER_IDENTITY_OUTPUT", + "GetDelegatedAccessTokenInput": "GET_DELEGATED_ACCESS_TOKEN_INPUT", + "GetDelegatedAccessTokenOutput": "GET_DELEGATED_ACCESS_TOKEN_OUTPUT", + "GetFederationTokenInput": "GET_FEDERATION_TOKEN_INPUT", + "GetFederationTokenOutput": "GET_FEDERATION_TOKEN_OUTPUT", + "GetSessionTokenInput": "GET_SESSION_TOKEN_INPUT", + "GetSessionTokenOutput": "GET_SESSION_TOKEN_OUTPUT", + "GetWebIdentityTokenInput": "GET_WEB_IDENTITY_TOKEN_INPUT", + "GetWebIdentityTokenOutput": "GET_WEB_IDENTITY_TOKEN_OUTPUT", + "IDPCommunicationErrorException": "IDP_COMMUNICATION_ERROR_EXCEPTION", + "IDPRejectedClaimException": "IDP_REJECTED_CLAIM_EXCEPTION", + "InvalidAuthorizationMessageException": "INVALID_AUTHORIZATION_MESSAGE_EXCEPTION", + "InvalidIdentityTokenException": "INVALID_IDENTITY_TOKEN_EXCEPTION", + "JWTPayloadSizeExceededException": "JWT_PAYLOAD_SIZE_EXCEEDED_EXCEPTION", + "MalformedPolicyDocumentException": "MALFORMED_POLICY_DOCUMENT_EXCEPTION", + "OutboundWebIdentityFederationDisabledException": "OUTBOUND_WEB_IDENTITY_FEDERATION_DISABLED_EXCEPTION", + "PackedPolicyTooLargeException": "PACKED_POLICY_TOO_LARGE_EXCEPTION", + "PolicyDescriptorType": "POLICY_DESCRIPTOR_TYPE", + "ProvidedContext": "PROVIDED_CONTEXT", + "RegionDisabledException": "REGION_DISABLED_EXCEPTION", + "SessionDurationEscalationException": "SESSION_DURATION_ESCALATION_EXCEPTION", + "Tag": "TAG", + }, + shape_names=frozenset( { - ShapeID( - "com.amazonaws.sts#MalformedPolicyDocumentException" - ): MalformedPolicyDocumentException, - ShapeID( - "com.amazonaws.sts#PackedPolicyTooLargeException" - ): PackedPolicyTooLargeException, - ShapeID( - "com.amazonaws.sts#RegionDisabledException" - ): RegionDisabledException, + "AssumeRoleInput", + "AssumeRoleOutput", + "AssumeRoleWithSAMLInput", + "AssumeRoleWithSAMLOutput", + "AssumeRoleWithWebIdentityInput", + "AssumeRoleWithWebIdentityOutput", + "AssumeRootInput", + "AssumeRootOutput", + "AssumedRoleUser", + "Credentials", + "DecodeAuthorizationMessageInput", + "DecodeAuthorizationMessageOutput", + "ExpiredTokenException", + "ExpiredTradeInTokenException", + "FederatedUser", + "GetAccessKeyInfoInput", + "GetAccessKeyInfoOutput", + "GetCallerIdentityInput", + "GetCallerIdentityOutput", + "GetDelegatedAccessTokenInput", + "GetDelegatedAccessTokenOutput", + "GetFederationTokenInput", + "GetFederationTokenOutput", + "GetSessionTokenInput", + "GetSessionTokenOutput", + "GetWebIdentityTokenInput", + "GetWebIdentityTokenOutput", + "IDPCommunicationErrorException", + "IDPRejectedClaimException", + "InvalidAuthorizationMessageException", + "InvalidIdentityTokenException", + "JWTPayloadSizeExceededException", + "MalformedPolicyDocumentException", + "OutboundWebIdentityFederationDisabledException", + "PackedPolicyTooLargeException", + "PolicyDescriptorType", + "ProvidedContext", + "RegionDisabledException", + "SessionDurationEscalationException", + "Tag", } ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4"), ShapeID("aws.auth#sigv4a")], - error_schemas=[ - _SCHEMA_MALFORMED_POLICY_DOCUMENT_EXCEPTION, - _SCHEMA_PACKED_POLICY_TOO_LARGE_EXCEPTION, - _SCHEMA_REGION_DISABLED_EXCEPTION, - ], + service_error="ServiceError", ) -@dataclass(kw_only=True) -class GetSessionTokenInput: - """Dataclass for GetSessionTokenInput structure.""" - - duration_seconds: int | None = None - """ - The duration, in seconds, that the credentials should remain valid. - Acceptable durations for IAM user sessions range from 900 seconds (15 - minutes) to 129,600 seconds (36 hours), with 43,200 seconds (12 hours) - as the default. Sessions for Amazon Web Services account owners are - restricted to a maximum of 3,600 seconds (one hour). If the duration is - longer than one hour, the session for Amazon Web Services account owners - defaults to one hour. - """ - - serial_number: str | None = None - """ - The identification number of the MFA device that is associated with the - IAM user who is making the `GetSessionToken` call. Specify this value if - the IAM user has a policy that requires MFA authentication. The value is - either the serial number for a hardware device (such as `GAHT12345678`) - or an Amazon Resource Name (ARN) for a virtual device (such as - `arn:aws:iam::123456789012:mfa/user`). You can find the device for an - IAM user by going to the Amazon Web Services Management Console and - viewing the user's security credentials. - - The regex used to validate this parameter is a string of characters - consisting of upper- and lower-case alphanumeric characters with no - spaces. You can also include underscores or any of the following - characters: =,.@:/- - """ - - token_code: str | None = None - """ - The value provided by the MFA device, if MFA is required. If any policy - requires the IAM user to submit an MFA code, specify this value. If MFA - authentication is required, the user must provide a code when requesting - a set of temporary security credentials. A user who fails to provide the - code receives an \"access denied\" response when requesting resources - that require MFA authentication. - - The format for this parameter, as described by its regex pattern, is a - sequence of six numeric digits. - """ - - minimum_session_token_size: int | None = None - """ - The minimum size, in bytes, of the session token that STS issues for the - request. STS increases the session token to at least this size, - regardless of its actual content. The value must not exceed 4,096 bytes. - When set to 0 or not specified, the session token size is unchanged. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_SESSION_TOKEN_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.duration_seconds is not None: - serializer.write_integer( - _SCHEMA_GET_SESSION_TOKEN_INPUT.members["DurationSeconds"], - self.duration_seconds, - ) - - if self.serial_number is not None: - serializer.write_string( - _SCHEMA_GET_SESSION_TOKEN_INPUT.members["SerialNumber"], - self.serial_number, - ) - - if self.token_code is not None: - serializer.write_string( - _SCHEMA_GET_SESSION_TOKEN_INPUT.members["TokenCode"], self.token_code - ) - - if self.minimum_session_token_size is not None: - serializer.write_integer( - _SCHEMA_GET_SESSION_TOKEN_INPUT.members["MinimumSessionTokenSize"], - self.minimum_session_token_size, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} +def __getattr__(name: str): + return _registry.build(name) - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["duration_seconds"] = de.read_integer( - _SCHEMA_GET_SESSION_TOKEN_INPUT.members["DurationSeconds"] - ) - case 1: - kwargs["serial_number"] = de.read_string( - _SCHEMA_GET_SESSION_TOKEN_INPUT.members["SerialNumber"] - ) - - case 2: - kwargs["token_code"] = de.read_string( - _SCHEMA_GET_SESSION_TOKEN_INPUT.members["TokenCode"] - ) - - case 3: - kwargs["minimum_session_token_size"] = de.read_integer( - _SCHEMA_GET_SESSION_TOKEN_INPUT.members[ - "MinimumSessionTokenSize" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_SESSION_TOKEN_INPUT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class GetSessionTokenOutput: - """ - Contains the response to a successful GetSessionToken request, including - temporary Amazon Web Services credentials that can be used to make - Amazon Web Services requests. - """ +ASSUME_ROLE: APIOperation[AssumeRoleInput, AssumeRoleOutput] = APIOperation( + static_schema=_SCHEMA_ASSUME_ROLE, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sts#ExpiredTokenException"), + ShapeID("com.amazonaws.sts#MalformedPolicyDocumentException"), + ShapeID("com.amazonaws.sts#PackedPolicyTooLargeException"), + ShapeID("com.amazonaws.sts#RegionDisabledException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4"), ShapeID("aws.auth#sigv4a")], +) - credentials: Credentials | None = None - """ - The temporary security credentials, which include an access key ID, a - secret access key, and a security (or session) token. +ASSUME_ROLE_WITH_SAML: APIOperation[ + AssumeRoleWithSAMLInput, AssumeRoleWithSAMLOutput +] = APIOperation( + static_schema=_SCHEMA_ASSUME_ROLE_WITH_SAML, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sts#ExpiredTokenException"), + ShapeID("com.amazonaws.sts#IDPRejectedClaimException"), + ShapeID("com.amazonaws.sts#InvalidIdentityTokenException"), + ShapeID("com.amazonaws.sts#MalformedPolicyDocumentException"), + ShapeID("com.amazonaws.sts#PackedPolicyTooLargeException"), + ShapeID("com.amazonaws.sts#RegionDisabledException"), + ], + effective_auth_schemes=[ShapeID("smithy.api#noAuth")], +) - Note: - The size of the security token that STS API operations return is not - fixed. We strongly recommend that you make no assumptions about the - maximum size. - """ +ASSUME_ROLE_WITH_WEB_IDENTITY: APIOperation[ + AssumeRoleWithWebIdentityInput, AssumeRoleWithWebIdentityOutput +] = APIOperation( + static_schema=_SCHEMA_ASSUME_ROLE_WITH_WEB_IDENTITY, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sts#ExpiredTokenException"), + ShapeID("com.amazonaws.sts#IDPCommunicationErrorException"), + ShapeID("com.amazonaws.sts#IDPRejectedClaimException"), + ShapeID("com.amazonaws.sts#InvalidIdentityTokenException"), + ShapeID("com.amazonaws.sts#MalformedPolicyDocumentException"), + ShapeID("com.amazonaws.sts#PackedPolicyTooLargeException"), + ShapeID("com.amazonaws.sts#RegionDisabledException"), + ], + effective_auth_schemes=[ShapeID("smithy.api#noAuth")], +) - session_token_utilization: int | None = None - """ - The percentage (0-100) of the maximum allowed session token size that - the returned session token consumes. - """ +ASSUME_ROOT: APIOperation[AssumeRootInput, AssumeRootOutput] = APIOperation( + static_schema=_SCHEMA_ASSUME_ROOT, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sts#ExpiredTokenException"), + ShapeID("com.amazonaws.sts#RegionDisabledException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4"), ShapeID("aws.auth#sigv4a")], +) - session_token_size: int | None = None - """ - The size, in bytes, of the session token returned in the Credentials for - this response. - """ +DECODE_AUTHORIZATION_MESSAGE: APIOperation[ + DecodeAuthorizationMessageInput, DecodeAuthorizationMessageOutput +] = APIOperation( + static_schema=_SCHEMA_DECODE_AUTHORIZATION_MESSAGE, + model_registry=_registry, + error_ids=[ShapeID("com.amazonaws.sts#InvalidAuthorizationMessageException")], + effective_auth_schemes=[ShapeID("aws.auth#sigv4"), ShapeID("aws.auth#sigv4a")], +) - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False +GET_ACCESS_KEY_INFO: APIOperation[GetAccessKeyInfoInput, GetAccessKeyInfoOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_ACCESS_KEY_INFO, + model_registry=_registry, + error_ids=[], + effective_auth_schemes=[ShapeID("aws.auth#sigv4"), ShapeID("aws.auth#sigv4a")], ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_SESSION_TOKEN_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.credentials is not None: - serializer.write_struct( - _SCHEMA_GET_SESSION_TOKEN_OUTPUT.members["Credentials"], - self.credentials, - ) - - if self.session_token_utilization is not None: - serializer.write_integer( - _SCHEMA_GET_SESSION_TOKEN_OUTPUT.members["SessionTokenUtilization"], - self.session_token_utilization, - ) - - if self.session_token_size is not None: - serializer.write_integer( - _SCHEMA_GET_SESSION_TOKEN_OUTPUT.members["SessionTokenSize"], - self.session_token_size, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["credentials"] = Credentials.deserialize(de) - - case 1: - kwargs["session_token_utilization"] = de.read_integer( - _SCHEMA_GET_SESSION_TOKEN_OUTPUT.members[ - "SessionTokenUtilization" - ] - ) - - case 2: - kwargs["session_token_size"] = de.read_integer( - _SCHEMA_GET_SESSION_TOKEN_OUTPUT.members["SessionTokenSize"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_GET_SESSION_TOKEN_OUTPUT, consumer=_consumer) - return kwargs +) +GET_CALLER_IDENTITY: APIOperation[GetCallerIdentityInput, GetCallerIdentityOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_CALLER_IDENTITY, + model_registry=_registry, + error_ids=[], + effective_auth_schemes=[ShapeID("aws.auth#sigv4"), ShapeID("aws.auth#sigv4a")], + ) +) -GET_SESSION_TOKEN = APIOperation( - input=GetSessionTokenInput, - output=GetSessionTokenOutput, - schema=_SCHEMA_GET_SESSION_TOKEN, - input_schema=_SCHEMA_GET_SESSION_TOKEN_INPUT, - output_schema=_SCHEMA_GET_SESSION_TOKEN_OUTPUT, - error_registry=TypeRegistry( - {ShapeID("com.amazonaws.sts#RegionDisabledException"): RegionDisabledException} - ), +GET_DELEGATED_ACCESS_TOKEN: APIOperation[ + GetDelegatedAccessTokenInput, GetDelegatedAccessTokenOutput +] = APIOperation( + static_schema=_SCHEMA_GET_DELEGATED_ACCESS_TOKEN, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sts#ExpiredTradeInTokenException"), + ShapeID("com.amazonaws.sts#PackedPolicyTooLargeException"), + ShapeID("com.amazonaws.sts#RegionDisabledException"), + ], effective_auth_schemes=[ShapeID("aws.auth#sigv4"), ShapeID("aws.auth#sigv4a")], - error_schemas=[_SCHEMA_REGION_DISABLED_EXCEPTION], ) +GET_FEDERATION_TOKEN: APIOperation[ + GetFederationTokenInput, GetFederationTokenOutput +] = APIOperation( + static_schema=_SCHEMA_GET_FEDERATION_TOKEN, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sts#MalformedPolicyDocumentException"), + ShapeID("com.amazonaws.sts#PackedPolicyTooLargeException"), + ShapeID("com.amazonaws.sts#RegionDisabledException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4"), ShapeID("aws.auth#sigv4a")], +) -def _serialize_web_identity_token_audience_list_type( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_web_identity_token_audience_list_type( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class GetWebIdentityTokenInput: - """Dataclass for GetWebIdentityTokenInput structure.""" - - audience: list[str] | None = None - """ - The intended recipient of the web identity token. This value populates - the `aud` claim in the JWT and should identify the service or - application that will validate and use the token. The external service - should verify this claim to ensure the token was intended for their use. - """ - - duration_seconds: int | None = None - """ - The duration, in seconds, for which the JSON Web Token (JWT) will remain - valid. The value can range from 60 seconds (1 minute) to 3600 seconds (1 - hour). If not specified, the default duration is 300 seconds (5 - minutes). The token is designed to be short-lived and should be used for - proof of identity, then exchanged for credentials or short-lived tokens - in the external service. - """ - - signing_algorithm: str | None = None - """ - The cryptographic algorithm to use for signing the JSON Web Token (JWT). - Valid values are RS256 (RSA with SHA-256) and ES384 (ECDSA using P-384 - curve with SHA-384). - """ - - tags: list[Tag] | None = None - """ - An optional list of tags to include in the JSON Web Token (JWT). These - tags are added as custom claims to the JWT and can be used by the - downstream service for authorization decisions. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_WEB_IDENTITY_TOKEN_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.audience is not None: - _serialize_web_identity_token_audience_list_type( - serializer, - _SCHEMA_GET_WEB_IDENTITY_TOKEN_INPUT.members["Audience"], - self.audience, - ) - - if self.duration_seconds is not None: - serializer.write_integer( - _SCHEMA_GET_WEB_IDENTITY_TOKEN_INPUT.members["DurationSeconds"], - self.duration_seconds, - ) - - if self.signing_algorithm is not None: - serializer.write_string( - _SCHEMA_GET_WEB_IDENTITY_TOKEN_INPUT.members["SigningAlgorithm"], - self.signing_algorithm, - ) - - if self.tags is not None: - _serialize_tag_list_type( - serializer, - _SCHEMA_GET_WEB_IDENTITY_TOKEN_INPUT.members["Tags"], - self.tags, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["audience"] = ( - _deserialize_web_identity_token_audience_list_type( - de, _SCHEMA_GET_WEB_IDENTITY_TOKEN_INPUT.members["Audience"] - ) - ) - - case 1: - kwargs["duration_seconds"] = de.read_integer( - _SCHEMA_GET_WEB_IDENTITY_TOKEN_INPUT.members["DurationSeconds"] - ) - - case 2: - kwargs["signing_algorithm"] = de.read_string( - _SCHEMA_GET_WEB_IDENTITY_TOKEN_INPUT.members["SigningAlgorithm"] - ) - - case 3: - kwargs["tags"] = _deserialize_tag_list_type( - de, _SCHEMA_GET_WEB_IDENTITY_TOKEN_INPUT.members["Tags"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_WEB_IDENTITY_TOKEN_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetWebIdentityTokenOutput: - """Dataclass for GetWebIdentityTokenOutput structure.""" - - web_identity_token: str | None = field(repr=False, default=None) - """ - A signed JSON Web Token (JWT) that represents the caller's Amazon Web - Services identity. The token contains standard JWT claims such as - subject, audience, expiration time, and additional identity attributes - added by STS as custom claims. You can also add your own custom claims - to the token by passing tags as request parameters to the - `GetWebIdentityToken` API. The token is signed using the specified - signing algorithm and can be verified using the verification keys - available at the issuer's JWKS endpoint. - """ - - expiration: datetime | None = None - """ - The date and time when the web identity token expires, in UTC. The - expiration is determined by adding the `DurationSeconds` value to the - time the token was issued. After this time, the token should no longer - be considered valid. - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False +GET_SESSION_TOKEN: APIOperation[GetSessionTokenInput, GetSessionTokenOutput] = ( + APIOperation( + static_schema=_SCHEMA_GET_SESSION_TOKEN, + model_registry=_registry, + error_ids=[ShapeID("com.amazonaws.sts#RegionDisabledException")], + effective_auth_schemes=[ShapeID("aws.auth#sigv4"), ShapeID("aws.auth#sigv4a")], ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_WEB_IDENTITY_TOKEN_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.web_identity_token is not None: - serializer.write_string( - _SCHEMA_GET_WEB_IDENTITY_TOKEN_OUTPUT.members["WebIdentityToken"], - self.web_identity_token, - ) - - if self.expiration is not None: - serializer.write_timestamp( - _SCHEMA_GET_WEB_IDENTITY_TOKEN_OUTPUT.members["Expiration"], - self.expiration, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["web_identity_token"] = de.read_string( - _SCHEMA_GET_WEB_IDENTITY_TOKEN_OUTPUT.members[ - "WebIdentityToken" - ] - ) - - case 1: - kwargs["expiration"] = de.read_timestamp( - _SCHEMA_GET_WEB_IDENTITY_TOKEN_OUTPUT.members["Expiration"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_WEB_IDENTITY_TOKEN_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class JWTPayloadSizeExceededException(ServiceError): - """ - The requested token payload size exceeds the maximum allowed size. - Reduce the number of request tags included in the `GetWebIdentityToken` - API call to reduce the token payload size. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_JWT_PAYLOAD_SIZE_EXCEEDED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_JWT_PAYLOAD_SIZE_EXCEEDED_EXCEPTION.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_JWT_PAYLOAD_SIZE_EXCEEDED_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_JWT_PAYLOAD_SIZE_EXCEEDED_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class OutboundWebIdentityFederationDisabledException(ServiceError): - """ - The outbound web identity federation feature is not enabled for this - account. To use this feature, you must first enable it through the - Amazon Web Services Management Console or API. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_OUTBOUND_WEB_IDENTITY_FEDERATION_DISABLED_EXCEPTION, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_OUTBOUND_WEB_IDENTITY_FEDERATION_DISABLED_EXCEPTION.members[ - "message" - ], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_OUTBOUND_WEB_IDENTITY_FEDERATION_DISABLED_EXCEPTION.members[ - "message" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_OUTBOUND_WEB_IDENTITY_FEDERATION_DISABLED_EXCEPTION, - consumer=_consumer, - ) - return kwargs - - -@dataclass(kw_only=True) -class SessionDurationEscalationException(ServiceError): - """ - The requested token duration would extend the session beyond its - original expiration time. You cannot use this operation to extend the - lifetime of a session beyond what was granted when the session was - originally created. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SESSION_DURATION_ESCALATION_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_SESSION_DURATION_ESCALATION_EXCEPTION.members["message"], - self.message, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_SESSION_DURATION_ESCALATION_EXCEPTION.members["message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SESSION_DURATION_ESCALATION_EXCEPTION, consumer=_consumer - ) - return kwargs - +) -GET_WEB_IDENTITY_TOKEN = APIOperation( - input=GetWebIdentityTokenInput, - output=GetWebIdentityTokenOutput, - schema=_SCHEMA_GET_WEB_IDENTITY_TOKEN, - input_schema=_SCHEMA_GET_WEB_IDENTITY_TOKEN_INPUT, - output_schema=_SCHEMA_GET_WEB_IDENTITY_TOKEN_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.sts#JWTPayloadSizeExceededException" - ): JWTPayloadSizeExceededException, - ShapeID( - "com.amazonaws.sts#OutboundWebIdentityFederationDisabledException" - ): OutboundWebIdentityFederationDisabledException, - ShapeID( - "com.amazonaws.sts#SessionDurationEscalationException" - ): SessionDurationEscalationException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4"), ShapeID("aws.auth#sigv4a")], - error_schemas=[ - _SCHEMA_JWT_PAYLOAD_SIZE_EXCEEDED_EXCEPTION, - _SCHEMA_OUTBOUND_WEB_IDENTITY_FEDERATION_DISABLED_EXCEPTION, - _SCHEMA_SESSION_DURATION_ESCALATION_EXCEPTION, +GET_WEB_IDENTITY_TOKEN: APIOperation[ + GetWebIdentityTokenInput, GetWebIdentityTokenOutput +] = APIOperation( + static_schema=_SCHEMA_GET_WEB_IDENTITY_TOKEN, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.sts#JWTPayloadSizeExceededException"), + ShapeID("com.amazonaws.sts#OutboundWebIdentityFederationDisabledException"), + ShapeID("com.amazonaws.sts#SessionDurationEscalationException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4"), ShapeID("aws.auth#sigv4a")], ) diff --git a/clients/aws-sdk-sts/src/aws_sdk_sts/models.pyi b/clients/aws-sdk-sts/src/aws_sdk_sts/models.pyi new file mode 100644 index 00000000..b9c05360 --- /dev/null +++ b/clients/aws-sdk-sts/src/aws_sdk_sts/models.pyi @@ -0,0 +1,1818 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. + +from dataclasses import dataclass +from datetime import datetime +from typing import Self + +from smithy_core.deserializers import ShapeDeserializer +from smithy_core.exceptions import ModeledError +from smithy_core.response import ResponseMetadata +from smithy_core.schemas import APIOperation +from smithy_core.serializers import ShapeSerializer + +class _SerdeShape: + def serialize(self, serializer: ShapeSerializer) -> None: ... + def serialize_members(self, serializer: ShapeSerializer) -> None: ... + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: ... + +class ServiceError(ModeledError): + """ + Base error for all errors in the service. + + Some exceptions do not extend from this class, including + synthetic, implicit, and shared exception types. + """ + +@dataclass(kw_only=True) +class AssumedRoleUser(_SerdeShape): + """ + The identifiers for the temporary security credentials that the + operation returns. + """ + + assumed_role_id: str + """ + A unique identifier that contains the role ID and the role session name + of the role that is being assumed. The role ID is generated by Amazon + Web Services when the role is created. + """ + arn: str + """ + The ARN of the temporary security credentials that are returned from the + AssumeRole action. For more information about ARNs and how to use them + in policies, see [IAM + Identifiers](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html) + in the *IAM User Guide*. + """ + +@dataclass(kw_only=True) +class AssumeRoleInput(_SerdeShape): + """Dataclass for AssumeRoleInput structure.""" + + role_arn: str | None = ... + """The Amazon Resource Name (ARN) of the role to assume.""" + role_session_name: str | None = ... + """ + An identifier for the assumed role session. + + Use the role session name to uniquely identify a session when the same + role is assumed by different principals or for different reasons. In + cross-account scenarios, the role session name is visible to, and can be + logged by the account that owns the role. The role session name is also + used in the ARN of the assumed role principal. This means that + subsequent cross-account API requests that use the temporary security + credentials will expose the role session name to the external account in + their CloudTrail logs. + + For security purposes, administrators can view this field in [CloudTrail + logs](https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-integration.html#cloudtrail-integration_signin-tempcreds) + to help identify who performed an action in Amazon Web Services. Your + administrator might require that you specify your user name as the + session name when you assume the role. For more information, see + [`sts:RoleSessionName`](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#ck_rolesessionname) + . + + The regex used to validate this parameter is a string of characters + consisting of upper- and lower-case alphanumeric characters with no + spaces. You can also include underscores or any of the following + characters: +=,.@- + """ + policy_arns: list[PolicyDescriptorType] | None = ... + """ + The Amazon Resource Names (ARNs) of the IAM managed policies that you + want to use as managed session policies. The policies must exist in the + same account as the role. + + This parameter is optional. You can provide up to 10 managed policy + ARNs. However, the plaintext that you use for both inline and managed + session policies can't exceed 2,048 characters. For more information + about ARNs, see [Amazon Resource Names (ARNs) and Amazon Web Services + Service + Namespaces](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + in the Amazon Web Services General Reference. + + Note: + An Amazon Web Services conversion compresses the passed inline session + policy, managed policy ARNs, and session tags into a packed binary + format that has a separate limit. Your request can fail for this limit + even if your plaintext meets the other requirements. The + `PackedPolicySize` response element indicates by percentage how close + the policies and tags for your request are to the upper size limit. + + Passing policies to this operation returns new temporary credentials. + The resulting session's permissions are the intersection of the role's + identity-based policy and the session policies. You can use the role's + temporary credentials in subsequent Amazon Web Services API calls to + access resources in the account that owns the role. You cannot use + session policies to grant more permissions than those allowed by the + identity-based policy of the role that is being assumed. For more + information, see [Session + Policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) + in the *IAM User Guide*. + """ + policy: str | None = ... + """ + An IAM policy in JSON format that you want to use as an inline session + policy. + + This parameter is optional. Passing policies to this operation returns + new temporary credentials. The resulting session's permissions are the + intersection of the role's identity-based policy and the session + policies. You can use the role's temporary credentials in subsequent + Amazon Web Services API calls to access resources in the account that + owns the role. You cannot use session policies to grant more permissions + than those allowed by the identity-based policy of the role that is + being assumed. For more information, see [Session + Policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) + in the *IAM User Guide*. + + The plaintext that you use for both inline and managed session policies + can't exceed 2,048 characters. The JSON policy characters can be any + ASCII character from the space character to the end of the valid + character list (\\u0020 through \\u00FF). It can also include the tab + (\\u0009), linefeed (\\u000A), and carriage return (\\u000D) characters. + + Note: + An Amazon Web Services conversion compresses the passed inline session + policy, managed policy ARNs, and session tags into a packed binary + format that has a separate limit. Your request can fail for this limit + even if your plaintext meets the other requirements. The + `PackedPolicySize` response element indicates by percentage how close + the policies and tags for your request are to the upper size limit. + + For more information about role session permissions, see [Session + policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session). + """ + duration_seconds: int | None = ... + """ + The duration, in seconds, of the role session. The value specified can + range from 900 seconds (15 minutes) up to the maximum session duration + set for the role. The maximum session duration setting can have a value + from 1 hour to 12 hours. If you specify a value higher than this setting + or the administrator setting (whichever is lower), the operation fails. + For example, if you specify a session duration of 12 hours, but your + administrator set the maximum session duration to 6 hours, your + operation fails. + + Role chaining limits your Amazon Web Services CLI or Amazon Web Services + API role session to a maximum of one hour. When you use the `AssumeRole` + API operation to assume a role, you can specify the duration of your + role session with the `DurationSeconds` parameter. You can specify a + parameter value of up to 43200 seconds (12 hours), depending on the + maximum session duration setting for your role. However, if you assume a + role using role chaining and provide a `DurationSeconds` parameter value + greater than one hour, the operation fails. To learn how to view the + maximum value for your role, see [Update the maximum session duration + for a + role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_update-role-settings.html#id_roles_update-session-duration). + + By default, the value is set to `3600` seconds. + + Note: + The `DurationSeconds` parameter is separate from the duration of a + console session that you might request using the returned credentials. + The request to the federation endpoint for a console sign-in token takes + a `SessionDuration` parameter that specifies the maximum length of the + console session. For more information, see [Creating a URL that Enables + Federated Users to Access the Amazon Web Services Management + Console](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html) + in the *IAM User Guide*. + """ + tags: list[Tag] | None = ... + """ + A list of session tags that you want to pass. Each session tag consists + of a key name and an associated value. For more information about + session tags, see [Tagging Amazon Web Services STS + Sessions](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) + in the *IAM User Guide*. + + This parameter is optional. You can pass up to 50 session tags. The + plaintext session tag keys can't exceed 128 characters, and the values + can't exceed 256 characters. For these and additional limits, see [IAM + and STS Character + Limits](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) + in the *IAM User Guide*. + + Note: + An Amazon Web Services conversion compresses the passed inline session + policy, managed policy ARNs, and session tags into a packed binary + format that has a separate limit. Your request can fail for this limit + even if your plaintext meets the other requirements. The + `PackedPolicySize` response element indicates by percentage how close + the policies and tags for your request are to the upper size limit. + + You can pass a session tag with the same key as a tag that is already + attached to the role. When you do, session tags override a role tag with + the same key. + + Tag key--value pairs are not case sensitive, but case is preserved. This + means that you cannot have separate `Department` and `department` tag + keys. Assume that the role has the `Department`=`Marketing` tag and you + pass the `department`=`engineering` session tag. `Department` and + `department` are not saved as separate tags, and the session tag passed + in the request takes precedence over the role tag. + + Additionally, if you used temporary credentials to perform this + operation, the new session inherits any transitive session tags from the + calling session. If you pass a session tag with the same key as an + inherited tag, the operation fails. To view the inherited tags for a + session, see the CloudTrail logs. For more information, see [Viewing + Session Tags in + CloudTrail](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_ctlogs) + in the *IAM User Guide*. + """ + transitive_tag_keys: list[str] | None = ... + """ + A list of keys for session tags that you want to set as transitive. If + you set a tag key as transitive, the corresponding key and value passes + to subsequent sessions in a role chain. For more information, see + [Chaining Roles with Session + Tags](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining) + in the *IAM User Guide*. + + This parameter is optional. The transitive status of a session tag does + not impact its packed binary size. + + If you choose not to specify a transitive tag key, then no tags are + passed from this session to any subsequent sessions. + """ + external_id: str | None = ... + """ + A unique identifier that might be required when you assume a role in + another account. If the administrator of the account to which the role + belongs provided you with an external ID, then provide that value in the + `ExternalId` parameter. This value can be any string, such as a + passphrase or account number. A cross-account role is usually set up to + trust everyone in an account. Therefore, the administrator of the + trusting account might send an external ID to the administrator of the + trusted account. That way, only someone with the ID can assume the role, + rather than everyone in the account. For more information about the + external ID, see [How to Use an External ID When Granting Access to Your + Amazon Web Services Resources to a Third + Party](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html) + in the *IAM User Guide*. + + The regex used to validate this parameter is a string of characters + consisting of upper- and lower-case alphanumeric characters with no + spaces. You can also include underscores or any of the following + characters: +=,.@:\\/- + """ + serial_number: str | None = ... + """ + The identification number of the MFA device that is associated with the + user who is making the `AssumeRole` call. Specify this value if the + trust policy of the role being assumed includes a condition that + requires MFA authentication. The value is either the serial number for a + hardware device (such as `GAHT12345678`) or an Amazon Resource Name + (ARN) for a virtual device (such as + `arn:aws:iam::123456789012:mfa/user`). + + The regex used to validate this parameter is a string of characters + consisting of upper- and lower-case alphanumeric characters with no + spaces. You can also include underscores or any of the following + characters: +=/:,.@- + """ + token_code: str | None = ... + """ + The value provided by the MFA device, if the trust policy of the role + being assumed requires MFA. (In other words, if the policy includes a + condition that tests for MFA). If the role being assumed requires MFA + and if the `TokenCode` value is missing or expired, the `AssumeRole` + call returns an \"access denied\" error. + + The format for this parameter, as described by its regex pattern, is a + sequence of six numeric digits. + """ + source_identity: str | None = ... + """ + The source identity specified by the principal that is calling the + `AssumeRole` operation. The source identity value persists across + [chained + role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html#iam-term-role-chaining) + sessions. + + You can require users to specify a source identity when they assume a + role. You do this by using the + [`sts:SourceIdentity`](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-sourceidentity) + condition key in a role trust policy. You can use source identity + information in CloudTrail logs to determine who took actions with a + role. You can use the `aws:SourceIdentity` condition key to further + control access to Amazon Web Services resources based on the value of + source identity. For more information about using source identity, see + [Monitor and control actions taken with assumed + roles](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html) + in the *IAM User Guide*. + + The regex used to validate this parameter is a string of characters + consisting of upper- and lower-case alphanumeric characters with no + spaces. You can also include underscores or any of the following + characters: +=,.@-. You cannot use a value that begins with the text + `aws:`. This prefix is reserved for Amazon Web Services internal use. + """ + provided_contexts: list[ProvidedContext] | None = ... + """ + A list of previously acquired trusted context assertions in the format + of a JSON array. The trusted context assertion is signed and encrypted + by Amazon Web Services STS. + + The following is an example of a `ProvidedContext` value that includes a + single trusted context assertion and the ARN of the context provider + from which the trusted context assertion was generated. + + `[{"ProviderArn":"arn:aws:iam::aws:contextProvider/IdentityCenter","ContextAssertion":"trusted-context-assertion"}]` + """ + minimum_session_token_size: int | None = ... + """ + The minimum size, in bytes, of the session token that STS issues for the + request. STS increases the session token to at least this size, + regardless of its actual content. The value must not exceed 4,096 bytes. + When set to 0 or not specified, the session token size is unchanged. + """ + +@dataclass(kw_only=True) +class AssumeRoleOutput(_SerdeShape): + """ + Contains the response to a successful AssumeRole request, including + temporary Amazon Web Services credentials that can be used to make + Amazon Web Services requests. + """ + + credentials: Credentials | None = ... + """ + The temporary security credentials, which include an access key ID, a + secret access key, and a security (or session) token. + + Note: + The size of the security token that STS API operations return is not + fixed. We strongly recommend that you make no assumptions about the + maximum size. + """ + assumed_role_user: AssumedRoleUser | None = ... + """ + The Amazon Resource Name (ARN) and the assumed role ID, which are + identifiers that you can use to refer to the resulting temporary + security credentials. For example, you can reference these credentials + as a principal in a resource-based policy by using the ARN or assumed + role ID. The ARN and ID include the `RoleSessionName` that you specified + when you called `AssumeRole`. + """ + packed_policy_size: int | None = ... + """ + A percentage value that indicates the packed size of the session + policies and session tags combined passed in the request. The request + fails if the packed size is greater than 100 percent, which means the + policies and tags exceeded the allowed space. + """ + source_identity: str | None = ... + """ + The source identity specified by the principal that is calling the + `AssumeRole` operation. + + You can require users to specify a source identity when they assume a + role. You do this by using the `sts:SourceIdentity` condition key in a + role trust policy. You can use source identity information in CloudTrail + logs to determine who took actions with a role. You can use the + `aws:SourceIdentity` condition key to further control access to Amazon + Web Services resources based on the value of source identity. For more + information about using source identity, see [Monitor and control + actions taken with assumed + roles](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html) + in the *IAM User Guide*. + + The regex used to validate this parameter is a string of characters + consisting of upper- and lower-case alphanumeric characters with no + spaces. You can also include underscores or any of the following + characters: =,.@- + """ + session_token_utilization: int | None = ... + """ + The percentage (0-100) of the maximum allowed session token size that + the returned session token consumes. + """ + session_token_size: int | None = ... + """ + The size, in bytes, of the session token returned in the Credentials for + this response. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class AssumeRoleWithSAMLInput(_SerdeShape): + """Dataclass for AssumeRoleWithSAMLInput structure.""" + + role_arn: str | None = ... + """The Amazon Resource Name (ARN) of the role that the caller is assuming.""" + principal_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the SAML provider in IAM that + describes the IdP. + """ + saml_assertion: str | None = ... + """ + The base64 encoded SAML authentication response provided by the IdP. + + For more information, see [Configuring a Relying Party and Adding + Claims](https://docs.aws.amazon.com/IAM/latest/UserGuide/create-role-saml-IdP-tasks.html) + in the *IAM User Guide*. + """ + policy_arns: list[PolicyDescriptorType] | None = ... + """ + The Amazon Resource Names (ARNs) of the IAM managed policies that you + want to use as managed session policies. The policies must exist in the + same account as the role. + + This parameter is optional. You can provide up to 10 managed policy + ARNs. However, the plaintext that you use for both inline and managed + session policies can't exceed 2,048 characters. For more information + about ARNs, see [Amazon Resource Names (ARNs) and Amazon Web Services + Service + Namespaces](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + in the Amazon Web Services General Reference. + + Note: + An Amazon Web Services conversion compresses the passed inline session + policy, managed policy ARNs, and session tags into a packed binary + format that has a separate limit. Your request can fail for this limit + even if your plaintext meets the other requirements. The + `PackedPolicySize` response element indicates by percentage how close + the policies and tags for your request are to the upper size limit. + + Passing policies to this operation returns new temporary credentials. + The resulting session's permissions are the intersection of the role's + identity-based policy and the session policies. You can use the role's + temporary credentials in subsequent Amazon Web Services API calls to + access resources in the account that owns the role. You cannot use + session policies to grant more permissions than those allowed by the + identity-based policy of the role that is being assumed. For more + information, see [Session + Policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) + in the *IAM User Guide*. + """ + policy: str | None = ... + """ + An IAM policy in JSON format that you want to use as an inline session + policy. + + This parameter is optional. Passing policies to this operation returns + new temporary credentials. The resulting session's permissions are the + intersection of the role's identity-based policy and the session + policies. You can use the role's temporary credentials in subsequent + Amazon Web Services API calls to access resources in the account that + owns the role. You cannot use session policies to grant more permissions + than those allowed by the identity-based policy of the role that is + being assumed. For more information, see [Session + Policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) + in the *IAM User Guide*. + + The plaintext that you use for both inline and managed session policies + can't exceed 2,048 characters. The JSON policy characters can be any + ASCII character from the space character to the end of the valid + character list (\\u0020 through \\u00FF). It can also include the tab + (\\u0009), linefeed (\\u000A), and carriage return (\\u000D) characters. + + For more information about role session permissions, see [Session + policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session). + + Note: + An Amazon Web Services conversion compresses the passed inline session + policy, managed policy ARNs, and session tags into a packed binary + format that has a separate limit. Your request can fail for this limit + even if your plaintext meets the other requirements. The + `PackedPolicySize` response element indicates by percentage how close + the policies and tags for your request are to the upper size limit. + """ + duration_seconds: int | None = ... + """ + The duration, in seconds, of the role session. Your role session lasts + for the duration that you specify for the `DurationSeconds` parameter, + or until the time specified in the SAML authentication response's + `SessionNotOnOrAfter` value, whichever is shorter. You can provide a + `DurationSeconds` value from 900 seconds (15 minutes) up to the maximum + session duration setting for the role. This setting can have a value + from 1 hour to 12 hours. If you specify a value higher than this + setting, the operation fails. For example, if you specify a session + duration of 12 hours, but your administrator set the maximum session + duration to 6 hours, your operation fails. To learn how to view the + maximum value for your role, see [View the Maximum Session Duration + Setting for a + Role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session) + in the *IAM User Guide*. + + By default, the value is set to `3600` seconds. + + Note: + The `DurationSeconds` parameter is separate from the duration of a + console session that you might request using the returned credentials. + The request to the federation endpoint for a console sign-in token takes + a `SessionDuration` parameter that specifies the maximum length of the + console session. For more information, see [Creating a URL that Enables + Federated Users to Access the Amazon Web Services Management + Console](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html) + in the *IAM User Guide*. + """ + minimum_session_token_size: int | None = ... + """ + The minimum size, in bytes, of the session token that STS issues for the + request. STS increases the session token to at least this size, + regardless of its actual content. The value must not exceed 4,096 bytes. + When set to 0 or not specified, the session token size is unchanged. + """ + +@dataclass(kw_only=True) +class AssumeRoleWithSAMLOutput(_SerdeShape): + """ + Contains the response to a successful AssumeRoleWithSAML request, + including temporary Amazon Web Services credentials that can be used to + make Amazon Web Services requests. + """ + + credentials: Credentials | None = ... + """ + The temporary security credentials, which include an access key ID, a + secret access key, and a security (or session) token. + + Note: + The size of the security token that STS API operations return is not + fixed. We strongly recommend that you make no assumptions about the + maximum size. + """ + assumed_role_user: AssumedRoleUser | None = ... + """ + The identifiers for the temporary security credentials that the + operation returns. + """ + packed_policy_size: int | None = ... + """ + A percentage value that indicates the packed size of the session + policies and session tags combined passed in the request. The request + fails if the packed size is greater than 100 percent, which means the + policies and tags exceeded the allowed space. + """ + subject: str | None = ... + """ + The value of the `NameID` element in the `Subject` element of the SAML + assertion. + """ + subject_type: str | None = ... + """ + The format of the name ID, as defined by the `Format` attribute in the + `NameID` element of the SAML assertion. Typical examples of the format + are `transient` or `persistent`. + + If the format includes the prefix + `urn:oasis:names:tc:SAML:2.0:nameid-format`, that prefix is removed. For + example, `urn:oasis:names:tc:SAML:2.0:nameid-format:transient` is + returned as `transient`. If the format includes any other prefix, the + format is returned with no modifications. + """ + issuer: str | None = ... + """The value of the `Issuer` element of the SAML assertion.""" + audience: str | None = ... + """ + The value of the `Recipient` attribute of the `SubjectConfirmationData` + element of the SAML assertion. + """ + name_qualifier: str | None = ... + """ + A hash value based on the concatenation of the following: + + - The `Issuer` response value. + + - The Amazon Web Services account ID. + + - The friendly name (the last part of the ARN) of the SAML provider in + IAM. + + The combination of `NameQualifier` and `Subject` can be used to uniquely + identify a user. + + The following pseudocode shows how the hash value is calculated: + + `BASE64 ( SHA1 ( "https://example.com/saml" + "123456789012" + "/MySAMLIdP" ) )` + """ + source_identity: str | None = ... + """ + The value in the `SourceIdentity` attribute in the SAML assertion. The + source identity value persists across [chained + role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html#iam-term-role-chaining) + sessions. + + You can require users to set a source identity value when they assume a + role. You do this by using the `sts:SourceIdentity` condition key in a + role trust policy. That way, actions that are taken with the role are + associated with that user. After the source identity is set, the value + cannot be changed. It is present in the request for all actions that are + taken by the role and persists across [chained + role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html#id_roles_terms-and-concepts) + sessions. You can configure your SAML identity provider to use an + attribute associated with your users, like user name or email, as the + source identity when calling `AssumeRoleWithSAML`. You do this by adding + an attribute to the SAML assertion. For more information about using + source identity, see [Monitor and control actions taken with assumed + roles](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html) + in the *IAM User Guide*. + + The regex used to validate this parameter is a string of characters + consisting of upper- and lower-case alphanumeric characters with no + spaces. You can also include underscores or any of the following + characters: =,.@- + """ + session_token_utilization: int | None = ... + """ + The percentage (0-100) of the maximum allowed session token size that + the returned session token consumes. + """ + session_token_size: int | None = ... + """ + The size, in bytes, of the session token returned in the Credentials for + this response. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class AssumeRoleWithWebIdentityInput(_SerdeShape): + """Dataclass for AssumeRoleWithWebIdentityInput structure.""" + + role_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the role that the caller is assuming. + + Note: + Additional considerations apply to Amazon Cognito identity pools that + assume [cross-account IAM + roles](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies-cross-account-resource-access.html). + The trust policies of these roles must accept the + `cognito-identity.amazonaws.com` service principal and must contain the + `cognito-identity.amazonaws.com:aud` condition key to restrict role + assumption to users from your intended identity pools. A policy that + trusts Amazon Cognito identity pools without this condition creates a + risk that a user from an unintended identity pool can assume the role. + For more information, see [Trust policies for IAM roles in Basic + (Classic) + authentication](https://docs.aws.amazon.com/cognito/latest/developerguide/iam-roles.html#trust-policies) + in the *Amazon Cognito Developer Guide*. + """ + role_session_name: str | None = ... + """ + An identifier for the assumed role session. Typically, you pass the name + or identifier that is associated with the user who is using your + application. That way, the temporary security credentials that your + application will use are associated with that user. This session name is + included as part of the ARN and assumed role ID in the `AssumedRoleUser` + response element. + + For security purposes, administrators can view this field in [CloudTrail + logs](https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-integration.html#cloudtrail-integration_signin-tempcreds) + to help identify who performed an action in Amazon Web Services. Your + administrator might require that you specify your user name as the + session name when you assume the role. For more information, see + [`sts:RoleSessionName`](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#ck_rolesessionname) + . + + The regex used to validate this parameter is a string of characters + consisting of upper- and lower-case alphanumeric characters with no + spaces. You can also include underscores or any of the following + characters: =,.@- + """ + web_identity_token: str | None = ... + """ + The OAuth 2.0 access token or OpenID Connect ID token that is provided + by the identity provider. Your application must get this token by + authenticating the user who is using your application with a web + identity provider before the application makes an + `AssumeRoleWithWebIdentity` call. Timestamps in the token must be + formatted as either an integer or a long integer. Tokens must be signed + using either RSA keys (RS256, RS384, or RS512) or ECDSA keys (ES256, + ES384, or ES512). + """ + provider_id: str | None = ... + """ + The fully qualified host component of the domain name of the OAuth 2.0 + identity provider. Do not specify this value for an OpenID Connect + identity provider. + + Currently `www.amazon.com` and `graph.facebook.com` are the only + supported identity providers for OAuth 2.0 access tokens. Do not include + URL schemes and port numbers. + + Do not specify this value for OpenID Connect ID tokens. + """ + policy_arns: list[PolicyDescriptorType] | None = ... + """ + The Amazon Resource Names (ARNs) of the IAM managed policies that you + want to use as managed session policies. The policies must exist in the + same account as the role. + + This parameter is optional. You can provide up to 10 managed policy + ARNs. However, the plaintext that you use for both inline and managed + session policies can't exceed 2,048 characters. For more information + about ARNs, see [Amazon Resource Names (ARNs) and Amazon Web Services + Service + Namespaces](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + in the Amazon Web Services General Reference. + + Note: + An Amazon Web Services conversion compresses the passed inline session + policy, managed policy ARNs, and session tags into a packed binary + format that has a separate limit. Your request can fail for this limit + even if your plaintext meets the other requirements. The + `PackedPolicySize` response element indicates by percentage how close + the policies and tags for your request are to the upper size limit. + + Passing policies to this operation returns new temporary credentials. + The resulting session's permissions are the intersection of the role's + identity-based policy and the session policies. You can use the role's + temporary credentials in subsequent Amazon Web Services API calls to + access resources in the account that owns the role. You cannot use + session policies to grant more permissions than those allowed by the + identity-based policy of the role that is being assumed. For more + information, see [Session + Policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) + in the *IAM User Guide*. + """ + policy: str | None = ... + """ + An IAM policy in JSON format that you want to use as an inline session + policy. + + This parameter is optional. Passing policies to this operation returns + new temporary credentials. The resulting session's permissions are the + intersection of the role's identity-based policy and the session + policies. You can use the role's temporary credentials in subsequent + Amazon Web Services API calls to access resources in the account that + owns the role. You cannot use session policies to grant more permissions + than those allowed by the identity-based policy of the role that is + being assumed. For more information, see [Session + Policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) + in the *IAM User Guide*. + + The plaintext that you use for both inline and managed session policies + can't exceed 2,048 characters. The JSON policy characters can be any + ASCII character from the space character to the end of the valid + character list (\\u0020 through \\u00FF). It can also include the tab + (\\u0009), linefeed (\\u000A), and carriage return (\\u000D) characters. + + For more information about role session permissions, see [Session + policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session). + + Note: + An Amazon Web Services conversion compresses the passed inline session + policy, managed policy ARNs, and session tags into a packed binary + format that has a separate limit. Your request can fail for this limit + even if your plaintext meets the other requirements. The + `PackedPolicySize` response element indicates by percentage how close + the policies and tags for your request are to the upper size limit. + """ + duration_seconds: int | None = ... + """ + The duration, in seconds, of the role session. The value can range from + 900 seconds (15 minutes) up to the maximum session duration setting for + the role. This setting can have a value from 1 hour to 12 hours. If you + specify a value higher than this setting, the operation fails. For + example, if you specify a session duration of 12 hours, but your + administrator set the maximum session duration to 6 hours, your + operation fails. To learn how to view the maximum value for your role, + see [View the Maximum Session Duration Setting for a + Role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session) + in the *IAM User Guide*. + + By default, the value is set to `3600` seconds. + + Note: + The `DurationSeconds` parameter is separate from the duration of a + console session that you might request using the returned credentials. + The request to the federation endpoint for a console sign-in token takes + a `SessionDuration` parameter that specifies the maximum length of the + console session. For more information, see [Creating a URL that Enables + Federated Users to Access the Amazon Web Services Management + Console](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html) + in the *IAM User Guide*. + """ + minimum_session_token_size: int | None = ... + """ + The minimum size, in bytes, of the session token that STS issues for the + request. STS increases the session token to at least this size, + regardless of its actual content. The value must not exceed 4,096 bytes. + When set to 0 or not specified, the session token size is unchanged. + """ + +@dataclass(kw_only=True) +class AssumeRoleWithWebIdentityOutput(_SerdeShape): + """ + Contains the response to a successful AssumeRoleWithWebIdentity request, + including temporary Amazon Web Services credentials that can be used to + make Amazon Web Services requests. + """ + + credentials: Credentials | None = ... + """ + The temporary security credentials, which include an access key ID, a + secret access key, and a security token. + + Note: + The size of the security token that STS API operations return is not + fixed. We strongly recommend that you make no assumptions about the + maximum size. + """ + subject_from_web_identity_token: str | None = ... + """ + The unique user identifier that is returned by the identity provider. + This identifier is associated with the `WebIdentityToken` that was + submitted with the `AssumeRoleWithWebIdentity` call. The identifier is + typically unique to the user and the application that acquired the + `WebIdentityToken` (pairwise identifier). For OpenID Connect ID tokens, + this field contains the value returned by the identity provider as the + token's `sub` (Subject) claim. + """ + assumed_role_user: AssumedRoleUser | None = ... + """ + The Amazon Resource Name (ARN) and the assumed role ID, which are + identifiers that you can use to refer to the resulting temporary + security credentials. For example, you can reference these credentials + as a principal in a resource-based policy by using the ARN or assumed + role ID. The ARN and ID include the `RoleSessionName` that you specified + when you called `AssumeRole`. + """ + packed_policy_size: int | None = ... + """ + A percentage value that indicates the packed size of the session + policies and session tags combined passed in the request. The request + fails if the packed size is greater than 100 percent, which means the + policies and tags exceeded the allowed space. + """ + provider: str | None = ... + """ + The issuing authority of the web identity token presented. For OpenID + Connect ID tokens, this contains the value of the `iss` field. For OAuth + 2.0 access tokens, this contains the value of the `ProviderId` parameter + that was passed in the `AssumeRoleWithWebIdentity` request. + """ + audience: str | None = ... + """ + The intended audience (also known as client ID) of the web identity + token. This is traditionally the client identifier issued to the + application that requested the web identity token. + """ + source_identity: str | None = ... + """ + The value of the source identity that is returned in the JSON web token + (JWT) from the identity provider. + + You can require users to set a source identity value when they assume a + role. You do this by using the `sts:SourceIdentity` condition key in a + role trust policy. That way, actions that are taken with the role are + associated with that user. After the source identity is set, the value + cannot be changed. It is present in the request for all actions that are + taken by the role and persists across [chained + role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html#id_roles_terms-and-concepts) + sessions. You can configure your identity provider to use an attribute + associated with your users, like user name or email, as the source + identity when calling `AssumeRoleWithWebIdentity`. You do this by adding + a claim to the JSON web token. To learn more about OIDC tokens and + claims, see [Using Tokens with User + Pools](https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-using-tokens-with-identity-providers.html) + in the *Amazon Cognito Developer Guide*. For more information about + using source identity, see [Monitor and control actions taken with + assumed + roles](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html) + in the *IAM User Guide*. + + The regex used to validate this parameter is a string of characters + consisting of upper- and lower-case alphanumeric characters with no + spaces. You can also include underscores or any of the following + characters: =,.@- + """ + session_token_utilization: int | None = ... + """ + The percentage (0-100) of the maximum allowed session token size that + the returned session token consumes. + """ + session_token_size: int | None = ... + """ + The size, in bytes, of the session token returned in the Credentials for + this response. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class AssumeRootInput(_SerdeShape): + """Dataclass for AssumeRootInput structure.""" + + target_principal: str | None = ... + """The member account principal ARN or account ID.""" + task_policy_arn: PolicyDescriptorType | None = ... + """ + The identity based policy that scopes the session to the privileged + tasks that can be performed. You must use one of following Amazon Web + Services managed policies to scope root session actions: + + - [IAMAuditRootUserCredentials](https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMAuditRootUserCredentials) + + - [IAMCreateRootUserPassword](https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMCreateRootUserPassword) + + - [IAMDeleteRootUserCredentials](https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMDeleteRootUserCredentials) + + - [S3UnlockBucketPolicy](https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-S3UnlockBucketPolicy) + + - [SQSUnlockQueuePolicy](https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-SQSUnlockQueuePolicy) + """ + duration_seconds: int | None = ... + """ + The duration, in seconds, of the privileged session. The value can range + from 0 seconds up to the maximum session duration of 900 seconds (15 + minutes). If you specify a value higher than this setting, the operation + fails. + + By default, the value is set to `900` seconds. + """ + minimum_session_token_size: int | None = ... + """ + The minimum size, in bytes, of the session token that STS issues for the + request. STS increases the session token to at least this size, + regardless of its actual content. The value must not exceed 4,096 bytes. + When set to 0 or not specified, the session token size is unchanged. + """ + +@dataclass(kw_only=True) +class AssumeRootOutput(_SerdeShape): + """Dataclass for AssumeRootOutput structure.""" + + credentials: Credentials | None = ... + """ + The temporary security credentials, which include an access key ID, a + secret access key, and a security token. + + Note: + The size of the security token that STS API operations return is not + fixed. We strongly recommend that you make no assumptions about the + maximum size. + """ + source_identity: str | None = ... + """ + The source identity specified by the principal that is calling the + `AssumeRoot` operation. + + You can use the `aws:SourceIdentity` condition key to control access + based on the value of source identity. For more information about using + source identity, see [Monitor and control actions taken with assumed + roles](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html) + in the *IAM User Guide*. + + The regex used to validate this parameter is a string of characters + consisting of upper- and lower-case alphanumeric characters with no + spaces. You can also include underscores or any of the following + characters: =,.@- + """ + session_token_utilization: int | None = ... + """ + The percentage (0-100) of the maximum allowed session token size that + the returned session token consumes. + """ + session_token_size: int | None = ... + """ + The size, in bytes, of the session token returned in the Credentials for + this response. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class Credentials(_SerdeShape): + """Amazon Web Services credentials for API authentication.""" + + access_key_id: str + """The access key ID that identifies the temporary security credentials.""" + secret_access_key: str + """The secret access key that can be used to sign requests.""" + session_token: str + """ + The token that users must pass to the service API to use the temporary + credentials. + """ + expiration: datetime + """The date on which the current credentials expire.""" + +@dataclass(kw_only=True) +class DecodeAuthorizationMessageInput(_SerdeShape): + """Dataclass for DecodeAuthorizationMessageInput structure.""" + + encoded_message: str | None = ... + """The encoded message that was returned with the response.""" + +@dataclass(kw_only=True) +class DecodeAuthorizationMessageOutput(_SerdeShape): + """ + A document that contains additional information about the authorization + status of a request from an encoded message that is returned in response + to an Amazon Web Services request. + """ + + decoded_message: str | None = ... + """The API returns a response with the decoded message.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ExpiredTokenException(ServiceError, _SerdeShape): + """ + The web identity token that was passed is expired or is not valid. Get a + new identity token from the identity provider and then retry the + request. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class ExpiredTradeInTokenException(ServiceError, _SerdeShape): + """ + The trade-in token provided in the request has expired and can no longer + be exchanged for credentials. Request a new token and retry the + operation. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class FederatedUser(_SerdeShape): + """ + Identifiers for the federated user that is associated with the + credentials. + """ + + federated_user_id: str + """ + The string that identifies the federated user associated with the + credentials, similar to the unique ID of an IAM user. + """ + arn: str + """ + The ARN that specifies the federated user that is associated with the + credentials. For more information about ARNs and how to use them in + policies, see [IAM + Identifiers](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html) + in the *IAM User Guide*. + """ + +@dataclass(kw_only=True) +class GetAccessKeyInfoInput(_SerdeShape): + """Dataclass for GetAccessKeyInfoInput structure.""" + + access_key_id: str | None = ... + """ + The identifier of an access key. + + This parameter allows (through its regex pattern) a string of characters + that can consist of any upper- or lowercase letter or digit. + """ + +@dataclass(kw_only=True) +class GetAccessKeyInfoOutput(_SerdeShape): + """Dataclass for GetAccessKeyInfoOutput structure.""" + + account: str | None = ... + """The number used to identify the Amazon Web Services account.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetCallerIdentityInput(_SerdeShape): + """Dataclass for GetCallerIdentityInput structure.""" + +@dataclass(kw_only=True) +class GetCallerIdentityOutput(_SerdeShape): + """ + Contains the response to a successful GetCallerIdentity request, + including information about the entity making the request. + """ + + user_id: str | None = ... + """ + The unique identifier of the calling entity. The exact value depends on + the type of entity that is making the call. The values returned are + those listed in the **aws:userid** column in the [Principal + table](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_variables.html#principaltable) + found on the **Policy Variables** reference page in the *IAM User + Guide*. + """ + account: str | None = ... + """ + The Amazon Web Services account ID number of the account that owns or + contains the calling entity. + """ + arn: str | None = ... + """The Amazon Web Services ARN associated with the calling entity.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetDelegatedAccessTokenInput(_SerdeShape): + """Dataclass for GetDelegatedAccessTokenInput structure.""" + + trade_in_token: str | None = ... + """ + The token to exchange for temporary Amazon Web Services credentials. + This token must be valid and unexpired at the time of the request. + """ + +@dataclass(kw_only=True) +class GetDelegatedAccessTokenOutput(_SerdeShape): + """Dataclass for GetDelegatedAccessTokenOutput structure.""" + + credentials: Credentials | None = ... + """Amazon Web Services credentials for API authentication.""" + packed_policy_size: int | None = ... + """ + The percentage of the maximum policy size that is used by the session + policy. The policy size is calculated as the sum of all the session + policies and permission boundaries attached to the session. If the + packed size exceeds 100%, the request fails. + """ + assumed_principal: str | None = ... + """ + The Amazon Resource Name (ARN) of the principal that was assumed when + obtaining the delegated access token. This ARN identifies the IAM entity + whose permissions are granted by the temporary credentials. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetFederationTokenInput(_SerdeShape): + """Dataclass for GetFederationTokenInput structure.""" + + name: str | None = ... + """ + The name of the federated user. The name is used as an identifier for + the temporary security credentials (such as `Bob`). For example, you can + reference the federated user name in a resource-based policy, such as in + an Amazon S3 bucket policy. + + The regex used to validate this parameter is a string of characters + consisting of upper- and lower-case alphanumeric characters with no + spaces. You can also include underscores or any of the following + characters: =,.@- + """ + policy: str | None = ... + """ + An IAM policy in JSON format that you want to use as an inline session + policy. + + You must pass an inline or managed [session + policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) + to this operation. You can pass a single JSON policy document to use as + an inline session policy. You can also specify up to 10 managed policy + Amazon Resource Names (ARNs) to use as managed session policies. + + This parameter is optional. However, if you do not pass any session + policies, then the resulting federated user session has no permissions. + + When you pass session policies, the session permissions are the + intersection of the IAM user policies and the session policies that you + pass. This gives you a way to further restrict the permissions for a + federated user. You cannot use session policies to grant more + permissions than those that are defined in the permissions policy of the + IAM user. For more information, see [Session + Policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) + in the *IAM User Guide*. + + The resulting credentials can be used to access a resource that has a + resource-based policy. If that policy specifically references the + federated user session in the `Principal` element of the policy, the + session has the permissions allowed by the policy. These permissions are + granted in addition to the permissions that are granted by the session + policies. + + The plaintext that you use for both inline and managed session policies + can't exceed 2,048 characters. The JSON policy characters can be any + ASCII character from the space character to the end of the valid + character list (\\u0020 through \\u00FF). It can also include the tab + (\\u0009), linefeed (\\u000A), and carriage return (\\u000D) characters. + + Note: + An Amazon Web Services conversion compresses the passed inline session + policy, managed policy ARNs, and session tags into a packed binary + format that has a separate limit. Your request can fail for this limit + even if your plaintext meets the other requirements. The + `PackedPolicySize` response element indicates by percentage how close + the policies and tags for your request are to the upper size limit. + """ + policy_arns: list[PolicyDescriptorType] | None = ... + """ + The Amazon Resource Names (ARNs) of the IAM managed policies that you + want to use as a managed session policy. The policies must exist in the + same account as the IAM user that is requesting federated access. + + You must pass an inline or managed [session + policy](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) + to this operation. You can pass a single JSON policy document to use as + an inline session policy. You can also specify up to 10 managed policy + Amazon Resource Names (ARNs) to use as managed session policies. The + plaintext that you use for both inline and managed session policies + can't exceed 2,048 characters. You can provide up to 10 managed policy + ARNs. For more information about ARNs, see [Amazon Resource Names (ARNs) + and Amazon Web Services Service + Namespaces](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + in the Amazon Web Services General Reference. + + This parameter is optional. However, if you do not pass any session + policies, then the resulting federated user session has no permissions. + + When you pass session policies, the session permissions are the + intersection of the IAM user policies and the session policies that you + pass. This gives you a way to further restrict the permissions for a + federated user. You cannot use session policies to grant more + permissions than those that are defined in the permissions policy of the + IAM user. For more information, see [Session + Policies](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) + in the *IAM User Guide*. + + The resulting credentials can be used to access a resource that has a + resource-based policy. If that policy specifically references the + federated user session in the `Principal` element of the policy, the + session has the permissions allowed by the policy. These permissions are + granted in addition to the permissions that are granted by the session + policies. + + Note: + An Amazon Web Services conversion compresses the passed inline session + policy, managed policy ARNs, and session tags into a packed binary + format that has a separate limit. Your request can fail for this limit + even if your plaintext meets the other requirements. The + `PackedPolicySize` response element indicates by percentage how close + the policies and tags for your request are to the upper size limit. + """ + duration_seconds: int | None = ... + """ + The duration, in seconds, that the session should last. Acceptable + durations for federation sessions range from 900 seconds (15 minutes) to + 129,600 seconds (36 hours), with 43,200 seconds (12 hours) as the + default. Sessions obtained using root user credentials are restricted to + a maximum of 3,600 seconds (one hour). If the specified duration is + longer than one hour, the session obtained by using root user + credentials defaults to one hour. + """ + tags: list[Tag] | None = ... + """ + A list of session tags. Each session tag consists of a key name and an + associated value. For more information about session tags, see [Passing + Session Tags in + STS](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) + in the *IAM User Guide*. + + This parameter is optional. You can pass up to 50 session tags. The + plaintext session tag keys can't exceed 128 characters and the values + can't exceed 256 characters. For these and additional limits, see [IAM + and STS Character + Limits](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) + in the *IAM User Guide*. + + Note: + An Amazon Web Services conversion compresses the passed inline session + policy, managed policy ARNs, and session tags into a packed binary + format that has a separate limit. Your request can fail for this limit + even if your plaintext meets the other requirements. The + `PackedPolicySize` response element indicates by percentage how close + the policies and tags for your request are to the upper size limit. + + You can pass a session tag with the same key as a tag that is already + attached to the user you are federating. When you do, session tags + override a user tag with the same key. + + Tag key--value pairs are not case sensitive, but case is preserved. This + means that you cannot have separate `Department` and `department` tag + keys. Assume that the role has the `Department`=`Marketing` tag and you + pass the `department`=`engineering` session tag. `Department` and + `department` are not saved as separate tags, and the session tag passed + in the request takes precedence over the role tag. + """ + minimum_session_token_size: int | None = ... + """ + The minimum size, in bytes, of the session token that STS issues for the + request. STS increases the session token to at least this size, + regardless of its actual content. The value must not exceed 4,096 bytes. + When set to 0 or not specified, the session token size is unchanged. + """ + +@dataclass(kw_only=True) +class GetFederationTokenOutput(_SerdeShape): + """ + Contains the response to a successful GetFederationToken request, + including temporary Amazon Web Services credentials that can be used to + make Amazon Web Services requests. + """ + + credentials: Credentials | None = ... + """ + The temporary security credentials, which include an access key ID, a + secret access key, and a security (or session) token. + + Note: + The size of the security token that STS API operations return is not + fixed. We strongly recommend that you make no assumptions about the + maximum size. + """ + federated_user: FederatedUser | None = ... + """ + Identifiers for the federated user associated with the credentials (such + as `arn:aws:sts::123456789012:federated-user/Bob` or + `123456789012:Bob`). You can use the federated user's ARN in your + resource-based policies, such as an Amazon S3 bucket policy. + """ + packed_policy_size: int | None = ... + """ + A percentage value that indicates the packed size of the session + policies and session tags combined passed in the request. The request + fails if the packed size is greater than 100 percent, which means the + policies and tags exceeded the allowed space. + """ + session_token_utilization: int | None = ... + """ + The percentage (0-100) of the maximum allowed session token size that + the returned session token consumes. + """ + session_token_size: int | None = ... + """ + The size, in bytes, of the session token returned in the Credentials for + this response. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetSessionTokenInput(_SerdeShape): + """Dataclass for GetSessionTokenInput structure.""" + + duration_seconds: int | None = ... + """ + The duration, in seconds, that the credentials should remain valid. + Acceptable durations for IAM user sessions range from 900 seconds (15 + minutes) to 129,600 seconds (36 hours), with 43,200 seconds (12 hours) + as the default. Sessions for Amazon Web Services account owners are + restricted to a maximum of 3,600 seconds (one hour). If the duration is + longer than one hour, the session for Amazon Web Services account owners + defaults to one hour. + """ + serial_number: str | None = ... + """ + The identification number of the MFA device that is associated with the + IAM user who is making the `GetSessionToken` call. Specify this value if + the IAM user has a policy that requires MFA authentication. The value is + either the serial number for a hardware device (such as `GAHT12345678`) + or an Amazon Resource Name (ARN) for a virtual device (such as + `arn:aws:iam::123456789012:mfa/user`). You can find the device for an + IAM user by going to the Amazon Web Services Management Console and + viewing the user's security credentials. + + The regex used to validate this parameter is a string of characters + consisting of upper- and lower-case alphanumeric characters with no + spaces. You can also include underscores or any of the following + characters: =,.@:/- + """ + token_code: str | None = ... + """ + The value provided by the MFA device, if MFA is required. If any policy + requires the IAM user to submit an MFA code, specify this value. If MFA + authentication is required, the user must provide a code when requesting + a set of temporary security credentials. A user who fails to provide the + code receives an \"access denied\" response when requesting resources + that require MFA authentication. + + The format for this parameter, as described by its regex pattern, is a + sequence of six numeric digits. + """ + minimum_session_token_size: int | None = ... + """ + The minimum size, in bytes, of the session token that STS issues for the + request. STS increases the session token to at least this size, + regardless of its actual content. The value must not exceed 4,096 bytes. + When set to 0 or not specified, the session token size is unchanged. + """ + +@dataclass(kw_only=True) +class GetSessionTokenOutput(_SerdeShape): + """ + Contains the response to a successful GetSessionToken request, including + temporary Amazon Web Services credentials that can be used to make + Amazon Web Services requests. + """ + + credentials: Credentials | None = ... + """ + The temporary security credentials, which include an access key ID, a + secret access key, and a security (or session) token. + + Note: + The size of the security token that STS API operations return is not + fixed. We strongly recommend that you make no assumptions about the + maximum size. + """ + session_token_utilization: int | None = ... + """ + The percentage (0-100) of the maximum allowed session token size that + the returned session token consumes. + """ + session_token_size: int | None = ... + """ + The size, in bytes, of the session token returned in the Credentials for + this response. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class GetWebIdentityTokenInput(_SerdeShape): + """Dataclass for GetWebIdentityTokenInput structure.""" + + audience: list[str] | None = ... + """ + The intended recipient of the web identity token. This value populates + the `aud` claim in the JWT and should identify the service or + application that will validate and use the token. The external service + should verify this claim to ensure the token was intended for their use. + """ + duration_seconds: int | None = ... + """ + The duration, in seconds, for which the JSON Web Token (JWT) will remain + valid. The value can range from 60 seconds (1 minute) to 3600 seconds (1 + hour). If not specified, the default duration is 300 seconds (5 + minutes). The token is designed to be short-lived and should be used for + proof of identity, then exchanged for credentials or short-lived tokens + in the external service. + """ + signing_algorithm: str | None = ... + """ + The cryptographic algorithm to use for signing the JSON Web Token (JWT). + Valid values are RS256 (RSA with SHA-256) and ES384 (ECDSA using P-384 + curve with SHA-384). + """ + tags: list[Tag] | None = ... + """ + An optional list of tags to include in the JSON Web Token (JWT). These + tags are added as custom claims to the JWT and can be used by the + downstream service for authorization decisions. + """ + +@dataclass(kw_only=True) +class GetWebIdentityTokenOutput(_SerdeShape): + """Dataclass for GetWebIdentityTokenOutput structure.""" + + web_identity_token: str | None = ... + """ + A signed JSON Web Token (JWT) that represents the caller's Amazon Web + Services identity. The token contains standard JWT claims such as + subject, audience, expiration time, and additional identity attributes + added by STS as custom claims. You can also add your own custom claims + to the token by passing tags as request parameters to the + `GetWebIdentityToken` API. The token is signed using the specified + signing algorithm and can be verified using the verification keys + available at the issuer's JWKS endpoint. + """ + expiration: datetime | None = ... + """ + The date and time when the web identity token expires, in UTC. The + expiration is determined by adding the `DurationSeconds` value to the + time the token was issued. After this time, the token should no longer + be considered valid. + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class IDPCommunicationErrorException(ServiceError, _SerdeShape): + """ + The request could not be fulfilled because the identity provider (IDP) + that was asked to verify the incoming identity token could not be + reached. This is often a transient error caused by network conditions. + Retry the request a limited number of times so that you don't exceed + the request rate. If the error persists, the identity provider might be + down or not responding. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class IDPRejectedClaimException(ServiceError, _SerdeShape): + """ + The identity provider (IdP) reported that authentication failed. This + might be because the claim is invalid. + + If this error is returned for the `AssumeRoleWithWebIdentity` operation, + it can also mean that the claim has expired or has been explicitly + revoked. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidAuthorizationMessageException(ServiceError, _SerdeShape): + """ + The error returned if the message passed to `DecodeAuthorizationMessage` + was invalid. This can happen if the token contains invalid characters, + such as line breaks, or if the message has expired. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InvalidIdentityTokenException(ServiceError, _SerdeShape): + """ + The web identity token that was passed could not be validated by Amazon + Web Services. Get a new identity token from the identity provider and + then retry the request. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class JWTPayloadSizeExceededException(ServiceError, _SerdeShape): + """ + The requested token payload size exceeds the maximum allowed size. + Reduce the number of request tags included in the `GetWebIdentityToken` + API call to reduce the token payload size. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class MalformedPolicyDocumentException(ServiceError, _SerdeShape): + """ + The request was rejected because the policy document was malformed. The + error message describes the specific error. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class OutboundWebIdentityFederationDisabledException(ServiceError, _SerdeShape): + """ + The outbound web identity federation feature is not enabled for this + account. To use this feature, you must first enable it through the + Amazon Web Services Management Console or API. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class PackedPolicyTooLargeException(ServiceError, _SerdeShape): + """ + The request was rejected because the total packed size of the session + policies and session tags combined was too large. An Amazon Web Services + conversion compresses the session policy document, session policy ARNs, + and session tags into a packed binary format that has a separate limit. + The error message indicates by percentage how close the policies and + tags are to the upper size limit. For more information, see [Passing + Session Tags in + STS](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) + in the *IAM User Guide*. + + You could receive this error even though you meet other defined session + policy and session tag limits. For more information, see [IAM and STS + Entity Character + Limits](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html#reference_iam-limits-entity-length) + in the *IAM User Guide*. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class PolicyDescriptorType(_SerdeShape): + """ + A reference to the IAM managed policy that is passed as a session policy + for a role session or a federated user session. + """ + + arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the IAM managed policy to use as a + session policy for the role. For more information about ARNs, see + [Amazon Resource Names (ARNs) and Amazon Web Services Service + Namespaces](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + in the *Amazon Web Services General Reference*. + """ + +@dataclass(kw_only=True) +class ProvidedContext(_SerdeShape): + """ + Contains information about the provided context. This includes the + signed and encrypted trusted context assertion and the context provider + ARN from which the trusted context assertion was generated. + """ + + provider_arn: str | None = ... + """ + The context provider ARN from which the trusted context assertion was + generated. + """ + context_assertion: str | None = ... + """ + The signed and encrypted trusted context assertion generated by the + context provider. The trusted context assertion is signed and encrypted + by Amazon Web Services STS. + """ + +@dataclass(kw_only=True) +class RegionDisabledException(ServiceError, _SerdeShape): + """ + STS is not activated in the requested region for the account that is + being asked to generate credentials. The account administrator must use + the IAM console to activate STS in that region. For more information, + see [Activating and Deactivating STS in an Amazon Web Services + Region](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html#sts-regions-activate-deactivate) + in the *IAM User Guide*. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class SessionDurationEscalationException(ServiceError, _SerdeShape): + """ + The requested token duration would extend the session beyond its + original expiration time. You cannot use this operation to extend the + lifetime of a session beyond what was granted when the session was + originally created. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class Tag(_SerdeShape): + """ + You can pass custom key-value pair attributes when you assume a role or + federate a user. These are called session tags. You can then use the + session tags to control access to resources. For more information, see + [Tagging Amazon Web Services STS + Sessions](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) + in the *IAM User Guide*. + """ + + key: str + """ + The key for a session tag. + + You can pass up to 50 session tags. The plain text session tag keys + can't exceed 128 characters. For these and additional limits, see [IAM + and STS Character + Limits](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) + in the *IAM User Guide*. + """ + value: str + """ + The value for a session tag. + + You can pass up to 50 session tags. The plain text session tag values + can't exceed 256 characters. For these and additional limits, see [IAM + and STS Character + Limits](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) + in the *IAM User Guide*. + """ + +ASSUME_ROLE: APIOperation[AssumeRoleInput, AssumeRoleOutput] +ASSUME_ROLE_WITH_SAML: APIOperation[AssumeRoleWithSAMLInput, AssumeRoleWithSAMLOutput] +ASSUME_ROLE_WITH_WEB_IDENTITY: APIOperation[ + AssumeRoleWithWebIdentityInput, AssumeRoleWithWebIdentityOutput +] +ASSUME_ROOT: APIOperation[AssumeRootInput, AssumeRootOutput] +DECODE_AUTHORIZATION_MESSAGE: APIOperation[ + DecodeAuthorizationMessageInput, DecodeAuthorizationMessageOutput +] +GET_ACCESS_KEY_INFO: APIOperation[GetAccessKeyInfoInput, GetAccessKeyInfoOutput] +GET_CALLER_IDENTITY: APIOperation[GetCallerIdentityInput, GetCallerIdentityOutput] +GET_DELEGATED_ACCESS_TOKEN: APIOperation[ + GetDelegatedAccessTokenInput, GetDelegatedAccessTokenOutput +] +GET_FEDERATION_TOKEN: APIOperation[GetFederationTokenInput, GetFederationTokenOutput] +GET_SESSION_TOKEN: APIOperation[GetSessionTokenInput, GetSessionTokenOutput] +GET_WEB_IDENTITY_TOKEN: APIOperation[ + GetWebIdentityTokenInput, GetWebIdentityTokenOutput +] diff --git a/clients/aws-sdk-transcribe-streaming/examples/simple_file.py b/clients/aws-sdk-transcribe-streaming/examples/simple_file.py index 88124cbc..89f5dd41 100644 --- a/clients/aws-sdk-transcribe-streaming/examples/simple_file.py +++ b/clients/aws-sdk-transcribe-streaming/examples/simple_file.py @@ -30,8 +30,11 @@ from pathlib import Path import aiofile -from smithy_aws_core.identity import EnvironmentCredentialsResolver -from smithy_core.aio.interfaces.eventstream import EventPublisher, EventReceiver +from smithy_aws_core.aio.identity import AsyncEnvironmentCredentialsResolver +from smithy_core.aio.interfaces.eventstream import ( + AsyncEventPublisher, + AsyncEventReceiver, +) from smithy_http.aio.crt import AWSCRTHTTPClient from aws_sdk_transcribe_streaming.client import ( @@ -58,7 +61,7 @@ async def apply_realtime_delay( - audio_stream: EventPublisher[AudioStream], + audio_stream: AsyncEventPublisher[AudioStream], reader, bytes_per_sample: int, sample_rate: float, @@ -82,7 +85,7 @@ async def apply_realtime_delay( class TranscriptResultStreamHandler: - def __init__(self, stream: EventReceiver[TranscriptResultStream]): + def __init__(self, stream: AsyncEventReceiver[TranscriptResultStream]): self.stream = stream async def handle_events(self): @@ -105,7 +108,7 @@ async def handle_transcript_event(self, event: TranscriptEvent): print(alt.transcript) -async def write_chunks(audio_stream: EventPublisher[AudioStream]): +async def write_chunks(audio_stream: AsyncEventPublisher[AudioStream]): # NOTE: For pre-recorded files longer than 5 minutes, the sent audio # chunks should be rate limited to match the realtime bitrate of the # audio stream to avoid signing issues. @@ -124,7 +127,7 @@ async def main(): config=await AsyncTranscribeStreamingConfig.resolve( endpoint_uri=ENDPOINT_URI, region=AWS_REGION, - aws_credentials_identity_resolver=EnvironmentCredentialsResolver(), + aws_credentials_identity_resolver=AsyncEnvironmentCredentialsResolver(), transport=AWSCRTHTTPClient(), ) ) as client: diff --git a/clients/aws-sdk-transcribe-streaming/examples/simple_mic.py b/clients/aws-sdk-transcribe-streaming/examples/simple_mic.py index ab73908b..6606e293 100644 --- a/clients/aws-sdk-transcribe-streaming/examples/simple_mic.py +++ b/clients/aws-sdk-transcribe-streaming/examples/simple_mic.py @@ -30,8 +30,11 @@ from typing import Any, AsyncGenerator, Tuple import sounddevice -from smithy_aws_core.identity import EnvironmentCredentialsResolver -from smithy_core.aio.interfaces.eventstream import EventPublisher, EventReceiver +from smithy_aws_core.aio.identity import AsyncEnvironmentCredentialsResolver +from smithy_core.aio.interfaces.eventstream import ( + AsyncEventPublisher, + AsyncEventReceiver, +) from smithy_http.aio.crt import AWSCRTHTTPClient from aws_sdk_transcribe_streaming.client import ( @@ -82,7 +85,7 @@ def callback(indata, frame_count, time_info, status): class TranscriptResultStreamHandler: - def __init__(self, stream: EventReceiver[TranscriptResultStream]): + def __init__(self, stream: AsyncEventReceiver[TranscriptResultStream]): self.stream = stream async def handle_events(self): @@ -105,7 +108,7 @@ async def handle_transcript_event(self, event: TranscriptEvent): print(alt.transcript) -async def write_chunks(audio_stream: EventPublisher[AudioStream]): +async def write_chunks(audio_stream: AsyncEventPublisher[AudioStream]): # This connects the raw audio chunks generator coming from the microphone # and passes them along to the transcription stream. async for chunk, _ in mic_stream(): @@ -120,7 +123,7 @@ async def main(): config=await AsyncTranscribeStreamingConfig.resolve( endpoint_uri=ENDPOINT_URI, region=AWS_REGION, - aws_credentials_identity_resolver=EnvironmentCredentialsResolver(), + aws_credentials_identity_resolver=AsyncEnvironmentCredentialsResolver(), transport=AWSCRTHTTPClient(), ) ) as client: diff --git a/clients/aws-sdk-transcribe-streaming/scripts/docs/generate_doc_stubs.py b/clients/aws-sdk-transcribe-streaming/scripts/docs/generate_doc_stubs.py index 52d470bc..795f2e4b 100644 --- a/clients/aws-sdk-transcribe-streaming/scripts/docs/generate_doc_stubs.py +++ b/clients/aws-sdk-transcribe-streaming/scripts/docs/generate_doc_stubs.py @@ -126,7 +126,9 @@ class ClientInfo: class DocStubGenerator: """Generate markdown API Reference stubs for AWS SDK for Python v4 clients.""" - def __init__(self, client_dir: Path, output_dir: Path, service_name: str | None = None) -> None: + def __init__( + self, client_dir: Path, output_dir: Path, service_name: str | None = None + ) -> None: """ Initialize the documentation generator. @@ -190,7 +192,9 @@ def _analyze_client_package(self, package_name: str) -> ClientInfo: required = ("client", "config", "models") missing = [name for name in required if not package.modules.get(name)] if missing: - raise ValueError(f"Missing required modules in {package_name}: {', '.join(missing)}") + raise ValueError( + f"Missing required modules in {package_name}: {', '.join(missing)}" + ) # Parse submodules client_module = package.modules["client"] @@ -199,11 +203,15 @@ def _analyze_client_package(self, package_name: str) -> ClientInfo: client_class = self._find_class_with_suffix(client_module, "Client") if not client_class: - raise ValueError(f"No class ending with 'Client' found in {package_name}.client") + raise ValueError( + f"No class ending with 'Client' found in {package_name}.client" + ) config_class = self._find_class_with_suffix(config_module, "Config") if not config_class: - raise ValueError(f"No class ending with 'Config' found in {package_name}.config") + raise ValueError( + f"No class ending with 'Config' found in {package_name}.config" + ) plugin_alias = config_module.members.get("Plugin") if not plugin_alias: @@ -288,7 +296,9 @@ def _analyze_operation(self, operation: Function) -> OperationInfo: if output_type in stream_type_map: stream_type = stream_type_map[output_type] - stream_args = self._get_subscript_elements(returns, f"'{operation.name}' stream type") + stream_args = self._get_subscript_elements( + returns, f"'{operation.name}' stream type" + ) if stream_type in (StreamType.INPUT, StreamType.DUPLEX): event_input_type = stream_args[0].canonical_name @@ -316,7 +326,9 @@ def _analyze_operation(self, operation: Function) -> OperationInfo: def _get_expr(self, annotation: str | Expr | None, context: str) -> Expr: """Extract and validate an Expr from an annotation.""" if not isinstance(annotation, Expr): - raise TypeError(f"{context}: expected Expr, got {type(annotation).__name__}") + raise TypeError( + f"{context}: expected Expr, got {type(annotation).__name__}" + ) return annotation def _get_subscript_elements(self, expr: Expr, context: str) -> list[Expr]: @@ -330,7 +342,9 @@ def _get_subscript_elements(self, expr: Expr, context: str) -> list[Expr]: return [el for el in slice_expr.elements if isinstance(el, Expr)] return [slice_expr] - def _extract_models(self, models_module: Module, operations: list[OperationInfo]) -> ModelsInfo: + def _extract_models( + self, models_module: Module, operations: list[OperationInfo] + ) -> ModelsInfo: """Extract structures, unions, enums, and errors from models module.""" structures, unions, enums, errors = [], [], [], [] @@ -356,14 +370,16 @@ def _extract_models(self, models_module: Module, operations: list[OperationInfo] duplicates = [] for structure in structures: - if self._is_operation_io_type(structure.name, operations) or self._is_union_member( - structure.name, unions - ): + if self._is_operation_io_type( + structure.name, operations + ) or self._is_union_member(structure.name, unions): duplicates.append(structure) structures = [struct for struct in structures if struct not in duplicates] - return ModelsInfo(structures=structures, unions=unions, enums=enums, errors=errors) + return ModelsInfo( + structures=structures, unions=unions, enums=enums, errors=errors + ) def _is_union(self, member: Object | Alias) -> TypeGuard[Attribute]: """Check if a module member is a union type.""" @@ -399,7 +415,9 @@ def _extract_union_members( for name in member_names: if not (member_object := models_module.members.get(name)): raise ValueError(f"Union member '{name}' not found in models module") - members.append(TypeInfo(name=member_object.name, module_path=member_object.path)) + members.append( + TypeInfo(name=member_object.name, module_path=member_object.path) + ) return members @@ -408,7 +426,8 @@ def _is_enum(self, member: Object | Alias) -> TypeGuard[Class]: if not isinstance(member, Class): return False return any( - isinstance(base, ExprName) and base.name in ENUM_BASE_CLASSES for base in member.bases + isinstance(base, ExprName) and base.name in ENUM_BASE_CLASSES + for base in member.bases ) def _is_error(self, member: Object | Alias) -> TypeGuard[Class]: @@ -416,10 +435,13 @@ def _is_error(self, member: Object | Alias) -> TypeGuard[Class]: if not isinstance(member, Class): return False return any( - isinstance(base, ExprName) and base.name in ERROR_BASE_CLASSES for base in member.bases + isinstance(base, ExprName) and base.name in ERROR_BASE_CLASSES + for base in member.bases ) - def _is_operation_io_type(self, type_name: str, operations: list[OperationInfo]) -> bool: + def _is_operation_io_type( + self, type_name: str, operations: list[OperationInfo] + ) -> bool: """Check if a type is used as operation input/output.""" return any(type_name in (op.input.name, op.output.name) for op in operations) @@ -437,8 +459,12 @@ def _generate_client_docs(self, client_info: ClientInfo) -> bool: self._generate_type_stubs( client_info.models.structures, "structures", "Structure Class" ) - self._generate_type_stubs(client_info.models.errors, "errors", "Error Class") - self._generate_type_stubs(client_info.models.enums, "enums", "Enum Class", members=True) + self._generate_type_stubs( + client_info.models.errors, "errors", "Error Class" + ) + self._generate_type_stubs( + client_info.models.enums, "enums", "Enum Class", members=True + ) self._generate_union_stubs(client_info.models.unions) except OSError as e: logger.error(f"Failed to write documentation files: {e}") @@ -470,7 +496,9 @@ def _generate_index(self, client_info: ClientInfo) -> None: ] for method in sorted(client_info.client_methods, key=lambda x: x.name): - lines.extend([*self._mkdocs_directive(method.module_path, heading_level=4), ""]) + lines.extend( + [*self._mkdocs_directive(method.module_path, heading_level=4), ""] + ) # Operations section if client_info.operations: @@ -578,7 +606,9 @@ def _generate_operation_stubs(self, operations: list[OperationInfo]) -> None: output_path = self.output_dir / "operations" / f"{op.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb("Operations", op.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb("Operations", op.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(operations)} operation file(s)") @@ -600,7 +630,9 @@ def _generate_type_stubs( output_path = self.output_dir / category / f"{item.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb(category.title(), item.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb(category.title(), item.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(items)} {category} file(s)") @@ -624,7 +656,9 @@ def _generate_union_stubs(self, unions: list[UnionInfo]) -> None: output_path = self.output_dir / "unions" / f"{union.name}.md" output_path.parent.mkdir(parents=True, exist_ok=True) - output_path.write_text(self._breadcrumb("Unions", union.name) + "\n".join(lines)) + output_path.write_text( + self._breadcrumb("Unions", union.name) + "\n".join(lines) + ) logger.info(f"Wrote {len(unions)} union file(s)") diff --git a/clients/aws-sdk-transcribe-streaming/src/aws_sdk_transcribe_streaming/_private/schemas.py b/clients/aws-sdk-transcribe-streaming/src/aws_sdk_transcribe_streaming/_private/schemas.py index 1374b685..ddd96719 100644 --- a/clients/aws-sdk-transcribe-streaming/src/aws_sdk_transcribe_streaming/_private/schemas.py +++ b/clients/aws-sdk-transcribe-streaming/src/aws_sdk_transcribe_streaming/_private/schemas.py @@ -2,2836 +2,2406 @@ from types import MappingProxyType -from smithy_core.prelude import UNIT -from smithy_core.schemas import Schema -from smithy_core.shapes import ShapeID, ShapeType -from smithy_core.traits import Trait - - -STRING = Schema( - id=ShapeID("com.amazonaws.transcribestreaming#String"), shape_type=ShapeType.STRING -) - -CONFIDENCE = Schema( - id=ShapeID("com.amazonaws.transcribestreaming#Confidence"), - shape_type=ShapeType.DOUBLE, -) - -DOUBLE = Schema( - id=ShapeID("com.amazonaws.transcribestreaming#Double"), - shape_type=ShapeType.DOUBLE, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=0)], -) - -ENTITY = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#Entity"), - members={ - "StartTime": { - "target": DOUBLE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "EndTime": { - "target": DOUBLE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "Category": {"target": STRING}, - "Type": {"target": STRING}, - "Content": {"target": STRING}, - "Confidence": {"target": CONFIDENCE}, - }, -) - -ENTITY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#EntityList"), - shape_type=ShapeType.LIST, - members={"member": {"target": ENTITY}}, -) - -STABLE = Schema( - id=ShapeID("com.amazonaws.transcribestreaming#Stable"), shape_type=ShapeType.BOOLEAN -) - -ITEM_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#ItemType"), - shape_type=ShapeType.ENUM, - members={"PRONUNCIATION": {"target": UNIT}, "PUNCTUATION": {"target": UNIT}}, -) - -BOOLEAN = Schema( - id=ShapeID("com.amazonaws.transcribestreaming#Boolean"), - shape_type=ShapeType.BOOLEAN, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=False)], -) - -ITEM = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#Item"), - members={ - "StartTime": { - "target": DOUBLE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "EndTime": { - "target": DOUBLE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "Type": {"target": ITEM_TYPE}, - "Content": {"target": STRING}, - "VocabularyFilterMatch": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "Speaker": {"target": STRING}, - "Confidence": {"target": CONFIDENCE}, - "Stable": {"target": STABLE}, - }, -) - -ITEM_LIST = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#ItemList"), - shape_type=ShapeType.LIST, - members={"member": {"target": ITEM}}, -) - -ALTERNATIVE = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#Alternative"), - members={ - "Transcript": {"target": STRING}, - "Items": {"target": ITEM_LIST}, - "Entities": {"target": ENTITY_LIST}, - }, -) - -ALTERNATIVE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#AlternativeList"), - shape_type=ShapeType.LIST, - members={"member": {"target": ALTERNATIVE}}, -) - -AUDIO_CHUNK = Schema( - id=ShapeID("com.amazonaws.transcribestreaming#AudioChunk"), - shape_type=ShapeType.BLOB, -) - -AUDIO_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#AudioEvent"), - members={ - "AudioChunk": { - "target": AUDIO_CHUNK, - "traits": [Trait.new(id=ShapeID("smithy.api#eventPayload"))], - } - }, -) - -CHANNEL_ID = Schema( - id=ShapeID("com.amazonaws.transcribestreaming#ChannelId"), - shape_type=ShapeType.INTEGER, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=0)], -) - -PARTICIPANT_ROLE = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#ParticipantRole"), - shape_type=ShapeType.ENUM, - members={"AGENT": {"target": UNIT}, "CUSTOMER": {"target": UNIT}}, -) - -CHANNEL_DEFINITION = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#ChannelDefinition"), - members={ - "ChannelId": { - "target": CHANNEL_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=0), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "ParticipantRole": { - "target": PARTICIPANT_ROLE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) - -CHANNEL_DEFINITIONS = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#ChannelDefinitions"), - shape_type=ShapeType.LIST, - members={"member": {"target": CHANNEL_DEFINITION}}, -) - -CONTENT_REDACTION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#ContentRedactionOutput"), - shape_type=ShapeType.ENUM, - members={"REDACTED": {"target": UNIT}, "REDACTED_AND_UNREDACTED": {"target": UNIT}}, +from smithy_core._schema_compact import StaticOperationSchema, StaticSchema + + +n0 = "com.amazonaws.transcribestreaming" +_S = "String" +_C = "Confidence" +_D = "Double" +_s = "smithy.api#default" +_E = "Entity" +_ST = "StartTime" +_ET = "EndTime" +_Ca = "Category" +_T = "Type" +_Co = "Content" +_EL = "EntityList" +_m = "member" +_St = "Stable" +_IT = "ItemType" +_PRONUNCIATION = "PRONUNCIATION" +_sV = "smithy.api#enumValue" +_p = "pronunciation" +_PUNCTUATION = "PUNCTUATION" +_pu = "punctuation" +_B = "Boolean" +_I = "Item" +_VFM = "VocabularyFilterMatch" +_Sp = "Speaker" +_IL = "ItemList" +_A = "Alternative" +_Tr = "Transcript" +_It = "Items" +_En = "Entities" +_AL = "AlternativeList" +_AC = "AudioChunk" +_AE = "AudioEvent" +_sP = "smithy.api#eventPayload" +_CI = "ChannelId" +_PR = "ParticipantRole" +_AGENT = "AGENT" +_CUSTOMER = "CUSTOMER" +_CD = "ChannelDefinition" +_sm = "smithy.api#required" +_CDh = "ChannelDefinitions" +_CRO = "ContentRedactionOutput" +_REDACTED = "REDACTED" +_r = "redacted" +_RAU = "REDACTED_AND_UNREDACTED" +_rau = "redacted_and_unredacted" +_PCAS = "PostCallAnalyticsSettings" +_OL = "OutputLocation" +_DARA = "DataAccessRoleArn" +_OEKMSKI = "OutputEncryptionKMSKeyId" +_CE = "ConfigurationEvent" +_AS = "AudioStream" +_smi = "smithy.api#streaming" +_BRE = "BadRequestException" +_smit = "smithy.api#error" +_c = "client" +_sE = "smithy.api#httpError" +_M = "Message" +_BN = "BucketName" +_L = "Long" +_CAE = "CallAnalyticsEntity" +_BOM = "BeginOffsetMillis" +_EOM = "EndOffsetMillis" +_CAEL = "CallAnalyticsEntityList" +_CAI = "CallAnalyticsItem" +_CAIL = "CallAnalyticsItemList" +_CALC = "CallAnalyticsLanguageCode" +_EU = "EN_US" +_eU = "en-US" +_EG = "EN_GB" +_eG = "en-GB" +_EU_ = "ES_US" +_eU_ = "es-US" +_FC = "FR_CA" +_fC = "fr-CA" +_FF = "FR_FR" +_fF = "fr-FR" +_EA = "EN_AU" +_eA = "en-AU" +_II = "IT_IT" +_iI = "it-IT" +_DD = "DE_DE" +_dD = "de-DE" +_PB = "PT_BR" +_pB = "pt-BR" +_CALWS = "CallAnalyticsLanguageWithScore" +_LC = "LanguageCode" +_Sc = "Score" +_CALI = "CallAnalyticsLanguageIdentification" +_SL = "StringList" +_TR = "TimestampRange" +_TRi = "TimestampRanges" +_POI = "PointsOfInterest" +_MCD = "MatchedCategoryDetails" +_k = "key" +_v = "value" +_CEa = "CategoryEvent" +_MC = "MatchedCategories" +_MD = "MatchedDetails" +_CEo = "ConflictException" +_IFE = "InternalFailureException" +_se = "server" +_LEE = "LimitExceededException" +_SUE = "ServiceUnavailableException" +_In = "Integer" +_CO = "CharacterOffsets" +_Be = "Begin" +_End = "End" +_ID = "IssueDetected" +_IDs = "IssuesDetected" +_Se = "Sentiment" +_POSITIVE = "POSITIVE" +_NEGATIVE = "NEGATIVE" +_MIXED = "MIXED" +_NEUTRAL = "NEUTRAL" +_UE = "UtteranceEvent" +_UI = "UtteranceId" +_IP = "IsPartial" +_LI = "LanguageIdentification" +_CATRS = "CallAnalyticsTranscriptResultStream" +_U = "Uri" +_CNGS = "ClinicalNoteGenerationStatus" +_IP_ = "IN_PROGRESS" +_FAILED = "FAILED" +_COMPLETED = "COMPLETED" +_CNGR = "ClinicalNoteGenerationResult" +_CNOL = "ClinicalNoteOutputLocation" +_TOL = "TranscriptOutputLocation" +_Sta = "Status" +_FR = "FailureReason" +_MSNT = "MedicalScribeNoteTemplate" +_HAP = "HISTORY_AND_PHYSICAL" +_GIRPP = "GIRPP" +_DAP = "DAP" +_SIRP = "SIRP" +_BIRP = "BIRP" +_BS = "BEHAVIORAL_SOAP" +_PS = "PHYSICAL_SOAP" +_CNGSl = "ClinicalNoteGenerationSettings" +_OBN = "OutputBucketName" +_NT = "NoteTemplate" +_CIT = "ContentIdentificationType" +_PII = "PII" +_CRT = "ContentRedactionType" +_DT = "DateTime" +_SI = "SessionId" +_GMSSI = "GetMedicalScribeStreamInput" +_sSI = "smithy.synthetic#originalShapeId" +_cGMSSR = "com.amazonaws.transcribestreaming#GetMedicalScribeStreamRequest" +_smith = "smithy.api#input" +_sL = "smithy.api#httpLabel" +_MSCI = "MedicalScribeChannelId" +_MSPR = "MedicalScribeParticipantRole" +_PATIENT = "PATIENT" +_CLINICIAN = "CLINICIAN" +_MSCD = "MedicalScribeChannelDefinition" +_MSCDe = "MedicalScribeChannelDefinitions" +_NES = "NonEmptyString" +_KMSECM = "KMSEncryptionContextMap" +_KMSKI = "KMSKeyId" +_MSES = "MedicalScribeEncryptionSettings" +_KEC = "KmsEncryptionContext" +_KKI = "KmsKeyId" +_MSLC = "MedicalScribeLanguageCode" +_MSME = "MedicalScribeMediaEncoding" +_PCM = "PCM" +_pc = "pcm" +_OO = "OGG_OPUS" +_oo = "ogg-opus" +_FLAC = "FLAC" +_f = "flac" +_MSMSRH = "MedicalScribeMediaSampleRateHertz" +_NB = "NullableBoolean" +_MSPSAR = "MedicalScribePostStreamAnalyticsResult" +_MSPSAS = "MedicalScribePostStreamAnalyticsSettings" +_IRA = "IamRoleArn" +_MSSS = "MedicalScribeStreamStatus" +_PAUSED = "PAUSED" +_MSVFM = "MedicalScribeVocabularyFilterMethod" +_REMOVE = "REMOVE" +_re = "remove" +_MASK = "MASK" +_ma = "mask" +_TAG = "TAG" +_t = "tag" +_VFN = "VocabularyFilterName" +_VN = "VocabularyName" +_MSSD = "MedicalScribeStreamDetails" +_SCA = "StreamCreatedAt" +_SEA = "StreamEndedAt" +_MSRH = "MediaSampleRateHertz" +_ME = "MediaEncoding" +_VFMo = "VocabularyFilterMethod" +_RARA = "ResourceAccessRoleArn" +_ES = "EncryptionSettings" +_SS = "StreamStatus" +_PSAS = "PostStreamAnalyticsSettings" +_PSAR = "PostStreamAnalyticsResult" +_MSCP = "MedicalScribeContextProvided" +_GMSSO = "GetMedicalScribeStreamOutput" +_cGMSSRo = "com.amazonaws.transcribestreaming#GetMedicalScribeStreamResponse" +_smithy = "smithy.api#output" +_RNFE = "ResourceNotFoundException" +_GMSS = "GetMedicalScribeStream" +_smithya = "smithy.api#http" +_JJ = "JA_JP" +_jJ = "ja-JP" +_KK = "KO_KR" +_kK = "ko-KR" +_ZC = "ZH_CN" +_zC = "zh-CN" +_TT = "TH_TH" +_tT = "th-TH" +_EE = "ES_ES" +_eE = "es-ES" +_AS_ = "AR_SA" +_aS = "ar-SA" +_PP = "PT_PT" +_pP = "pt-PT" +_CE_ = "CA_ES" +_cE = "ca-ES" +_AA = "AR_AE" +_aA = "ar-AE" +_HI = "HI_IN" +_hI = "hi-IN" +_ZH = "ZH_HK" +_zH = "zh-HK" +_NN = "NL_NL" +_nN = "nl-NL" +_NN_ = "NO_NO" +_nN_ = "no-NO" +_SS_ = "SV_SE" +_sS = "sv-SE" +_PP_ = "PL_PL" +_pP_ = "pl-PL" +_FF_ = "FI_FI" +_fF_ = "fi-FI" +_ZT = "ZH_TW" +_zT = "zh-TW" +_EI = "EN_IN" +_eI = "en-IN" +_EI_ = "EN_IE" +_eI_ = "en-IE" +_EN = "EN_NZ" +_eN = "en-NZ" +_EA_ = "EN_AB" +_eA_ = "en-AB" +_EZ = "EN_ZA" +_eZ = "en-ZA" +_EW = "EN_WL" +_eW = "en-WL" +_DC = "DE_CH" +_dC = "de-CH" +_AZ = "AF_ZA" +_aZ = "af-ZA" +_EE_ = "EU_ES" +_eE_ = "eu-ES" +_HH = "HR_HR" +_hH = "hr-HR" +_CC = "CS_CZ" +_cC = "cs-CZ" +_DD_ = "DA_DK" +_dD_ = "da-DK" +_FI = "FA_IR" +_fI = "fa-IR" +_GE = "GL_ES" +_gE = "gl-ES" +_EG_ = "EL_GR" +_eG_ = "el-GR" +_HI_ = "HE_IL" +_hI_ = "he-IL" +_II_ = "ID_ID" +_iI_ = "id-ID" +_LL = "LV_LV" +_lL = "lv-LV" +_MM = "MS_MY" +_mM = "ms-MY" +_RR = "RO_RO" +_rR = "ro-RO" +_RR_ = "RU_RU" +_rR_ = "ru-RU" +_SR = "SR_RS" +_sR = "sr-RS" +_SS__ = "SK_SK" +_sS_ = "sk-SK" +_SS___ = "SO_SO" +_sS__ = "so-SO" +_TP = "TL_PH" +_tP = "tl-PH" +_UU = "UK_UA" +_uU = "uk-UA" +_VV = "VI_VN" +_vV = "vi-VN" +_ZZ = "ZU_ZA" +_zZ = "zu-ZA" +_AE_ = "AM_ET" +_aE = "am-ET" +_BB = "BE_BY" +_bB = "be-BY" +_BB_ = "BG_BG" +_bB_ = "bg-BG" +_BI = "BN_IN" +_bI = "bn-IN" +_BB__ = "BS_BA" +_bB__ = "bs-BA" +_CI_ = "CKB_IQ" +_cI = "ckb-IQ" +_CI__ = "CKB_IR" +_cI_ = "ckb-IR" +_CW = "CY_WL" +_cW = "cy-WL" +_EM = "ES_MX" +_eM = "es-MX" +_EE__ = "ET_ET" +_eE__ = "et-ET" +_FA = "FA_AF" +_fA = "fa-AF" +_GI = "GU_IN" +_gI = "gu-IN" +_HH_ = "HT_HT" +_hH_ = "ht-HT" +_HH__ = "HU_HU" +_hH__ = "hu-HU" +_HA = "HY_AM" +_hA = "hy-AM" +_II__ = "IS_IS" +_iI__ = "is-IS" +_JI = "JV_ID" +_jI = "jv-ID" +_KG = "KA_GE" +_kG = "ka-GE" +_KD = "KAB_DZ" +_kD = "kab-DZ" +_KK_ = "KK_KZ" +_kK_ = "kk-KZ" +_KK__ = "KM_KH" +_kK__ = "km-KH" +_KI = "KN_IN" +_kI = "kn-IN" +_LI_ = "LG_IN" +_lI = "lg-IN" +_LL_ = "LT_LT" +_lL_ = "lt-LT" +_MM_ = "MK_MK" +_mM_ = "mk-MK" +_MI = "ML_IN" +_mI = "ml-IN" +_MI_ = "MR_IN" +_mI_ = "mr-IN" +_MM__ = "MY_MM" +_mM__ = "my-MM" +_NN__ = "NE_NP" +_nN__ = "ne-NP" +_OI = "OR_IN" +_oI = "or-IN" +_PI = "PA_IN" +_pI = "pa-IN" +_PA = "PS_AF" +_pA = "ps-AF" +_SL_ = "SI_LK" +_sL_ = "si-LK" +_SS____ = "SL_SI" +_sS___ = "sl-SI" +_SA = "SQ_AL" +_sA = "sq-AL" +_SI_ = "SU_ID" +_sI = "su-ID" +_SB = "SW_BI" +_sB = "sw-BI" +_SK = "SW_KE" +_sK = "sw-KE" +_SR_ = "SW_RW" +_sR_ = "sw-RW" +_ST_ = "SW_TZ" +_sT = "sw-TZ" +_SU = "SW_UG" +_sU = "sw-UG" +_TI = "TA_IN" +_tI = "ta-IN" +_TI_ = "TE_IN" +_tI_ = "te-IN" +_TT_ = "TR_TR" +_tT_ = "tr-TR" +_UU_ = "UZ_UZ" +_uU_ = "uz-UZ" +_LWS = "LanguageWithScore" +_LO = "LanguageOptions" +_GA = "G711_ALAW" +_ga = "g711-alaw" +_GU = "G711_ULAW" +_gu = "g711-ulaw" +_G = "G729" +_g = "g729" +_MEe = "MedicalEntity" +_MEL = "MedicalEntityList" +_MIe = "MedicalItem" +_MIL = "MedicalItemList" +_MA = "MedicalAlternative" +_MAL = "MedicalAlternativeList" +_MCIT = "MedicalContentIdentificationType" +_PHI = "PHI" +_MR = "MedicalResult" +_RI = "ResultId" +_Al = "Alternatives" +_MRL = "MedicalResultList" +_MSAE = "MedicalScribeAudioEvent" +_P = "Pronouns" +_smithyap = "smithy.api#sensitive" +_HH___ = "HE_HIM" +_SH = "SHE_HER" +_TT__ = "THEY_THEM" +_MSPC = "MedicalScribePatientContext" +_MSC = "MedicalScribeContext" +_PC = "PatientContext" +_MSCE = "MedicalScribeConfigurationEvent" +_MSSCET = "MedicalScribeSessionControlEventType" +_EOS = "END_OF_SESSION" +_MSSCE = "MedicalScribeSessionControlEvent" +_MSIS = "MedicalScribeInputStream" +_SCE = "SessionControlEvent" +_MSTIT = "MedicalScribeTranscriptItemType" +_MSTI = "MedicalScribeTranscriptItem" +_BAT = "BeginAudioTime" +_EAT = "EndAudioTime" +_MSTIL = "MedicalScribeTranscriptItemList" +_MSTS = "MedicalScribeTranscriptSegment" +_SIe = "SegmentId" +_MSTE = "MedicalScribeTranscriptEvent" +_TS = "TranscriptSegment" +_MSRS = "MedicalScribeResultStream" +_TE = "TranscriptEvent" +_MT = "MedicalTranscript" +_R = "Results" +_MTE = "MedicalTranscriptEvent" +_MTRS = "MedicalTranscriptResultStream" +_MN = "ModelName" +_NOC = "NumberOfChannels" +_PRS = "PartialResultsStability" +_HIGH = "HIGH" +_h = "high" +_MEDIUM = "MEDIUM" +_me = "medium" +_LOW = "LOW" +_l = "low" +_PET = "PiiEntityTypes" +_RIe = "RequestId" +_Re = "Result" +_RL = "ResultList" +_SRW = "SessionResumeWindow" +_Spe = "Specialty" +_PRIMARYCARE = "PRIMARYCARE" +_CARDIOLOGY = "CARDIOLOGY" +_NEUROLOGY = "NEUROLOGY" +_ONCOLOGY = "ONCOLOGY" +_RADIOLOGY = "RADIOLOGY" +_UROLOGY = "UROLOGY" +_VFNo = "VocabularyFilterNames" +_VNo = "VocabularyNames" +_SCASTI = "StartCallAnalyticsStreamTranscriptionInput" +_cSCASTR = ( + "com.amazonaws.transcribestreaming#StartCallAnalyticsStreamTranscriptionRequest" +) +_sH = "smithy.api#httpHeader" +_xatlc = "x-amzn-transcribe-language-code" +_xatsr = "x-amzn-transcribe-sample-rate" +_xatme = "x-amzn-transcribe-media-encoding" +_xatvn = "x-amzn-transcribe-vocabulary-name" +_xatsi = "x-amzn-transcribe-session-id" +_sPm = "smithy.api#httpPayload" +_xatvfn = "x-amzn-transcribe-vocabulary-filter-name" +_xatvfm = "x-amzn-transcribe-vocabulary-filter-method" +_LMN = "LanguageModelName" +_xatlmn = "x-amzn-transcribe-language-model-name" +_ILd = "IdentifyLanguage" +_xatil = "x-amzn-transcribe-identify-language" +_xatlo = "x-amzn-transcribe-language-options" +_PL = "PreferredLanguage" +_xatpl = "x-amzn-transcribe-preferred-language" +_xatvn_ = "x-amzn-transcribe-vocabulary-names" +_xatvfn_ = "x-amzn-transcribe-vocabulary-filter-names" +_EPRS = "EnablePartialResultsStabilization" +_xateprs = "x-amzn-transcribe-enable-partial-results-stabilization" +_xatprs = "x-amzn-transcribe-partial-results-stability" +_xatcit = "x-amzn-transcribe-content-identification-type" +_xatcrt = "x-amzn-transcribe-content-redaction-type" +_xatpet = "x-amzn-transcribe-pii-entity-types" +_SCASTO = "StartCallAnalyticsStreamTranscriptionOutput" +_cSCASTRo = ( + "com.amazonaws.transcribestreaming#StartCallAnalyticsStreamTranscriptionResponse" +) +_xari = "x-amzn-request-id" +_SCAST = "StartCallAnalyticsStreamTranscription" +_SMSSI = "StartMedicalScribeStreamInput" +_cSMSSR = "com.amazonaws.transcribestreaming#StartMedicalScribeStreamRequest" +_IS = "InputStream" +_SMSSO = "StartMedicalScribeStreamOutput" +_cSMSSRo = "com.amazonaws.transcribestreaming#StartMedicalScribeStreamResponse" +_RS = "ResultStream" +_SMSS = "StartMedicalScribeStream" +_CONVERSATION = "CONVERSATION" +_DICTATION = "DICTATION" +_SMSTI = "StartMedicalStreamTranscriptionInput" +_cSMSTR = "com.amazonaws.transcribestreaming#StartMedicalStreamTranscriptionRequest" +_xats = "x-amzn-transcribe-specialty" +_xatt = "x-amzn-transcribe-type" +_SSL = "ShowSpeakerLabel" +_xatssl = "x-amzn-transcribe-show-speaker-label" +_ECI = "EnableChannelIdentification" +_xateci = "x-amzn-transcribe-enable-channel-identification" +_xatnoc = "x-amzn-transcribe-number-of-channels" +_SMSTO = "StartMedicalStreamTranscriptionOutput" +_cSMSTRo = "com.amazonaws.transcribestreaming#StartMedicalStreamTranscriptionResponse" +_TRS = "TranscriptResultStream" +_SMST = "StartMedicalStreamTranscription" +_TF = "TranscriptFormat" +_SPOKEN = "SPOKEN" +_sp = "spoken" +_WRITTEN = "WRITTEN" +_w = "written" +_SSTI = "StartStreamTranscriptionInput" +_cSSTR = "com.amazonaws.transcribestreaming#StartStreamTranscriptionRequest" +_IML = "IdentifyMultipleLanguages" +_xatiml = "x-amzn-transcribe-identify-multiple-languages" +_xatsrw = "x-amzn-transcribe-session-resume-window" +_xattf = "x-amzn-transcribe-transcript-format" +_SSTO = "StartStreamTranscriptionOutput" +_cSSTRo = "com.amazonaws.transcribestreaming#StartStreamTranscriptionResponse" +_SST = "StartStreamTranscription" +_Tra = "Transcribe" +_a = "aws.auth#sigv4" +_sBm = "smithy.rules#endpointBdd" +_aw = "aws.api#service" +_aJ = "aws.protocols#restJson1" + +STRING: StaticSchema = (3, n0, _S, 0) + +CONFIDENCE: StaticSchema = (10, n0, _C, 0) + +DOUBLE: StaticSchema = (10, n0, _D, {_s: 0}) + +ENTITY: StaticSchema = ( + 18, + n0, + _E, + 0, + (_ST, _ET, _Ca, _T, _Co, _C), + ( + (DOUBLE, {_s: 0}), + (DOUBLE, {_s: 0}), + (STRING, 0), + (STRING, 0), + (STRING, 0), + (CONFIDENCE, 0), + ), ) -POST_CALL_ANALYTICS_SETTINGS = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#PostCallAnalyticsSettings"), - members={ - "OutputLocation": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "DataAccessRoleArn": { - "target": STRING, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ContentRedactionOutput": {"target": CONTENT_REDACTION_OUTPUT}, - "OutputEncryptionKMSKeyId": {"target": STRING}, - }, +ENTITY_LIST: StaticSchema = (16, n0, _EL, 0, (_m,), ((ENTITY, 0),)) + +STABLE: StaticSchema = (2, n0, _St, 0) + +ITEM_TYPE: StaticSchema = ( + 14, + n0, + _IT, + 0, + (_PRONUNCIATION, _PUNCTUATION), + ((-1, {_sV: _p}), (-1, {_sV: _pu})), +) + +BOOLEAN: StaticSchema = (2, n0, _B, {_s: False}) + +ITEM: StaticSchema = ( + 18, + n0, + _I, + 0, + (_ST, _ET, _T, _Co, _VFM, _Sp, _C, _St), + ( + (DOUBLE, {_s: 0}), + (DOUBLE, {_s: 0}), + (ITEM_TYPE, 0), + (STRING, 0), + (BOOLEAN, {_s: False}), + (STRING, 0), + (CONFIDENCE, 0), + (STABLE, 0), + ), ) -CONFIGURATION_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#ConfigurationEvent"), - members={ - "ChannelDefinitions": {"target": CHANNEL_DEFINITIONS}, - "PostCallAnalyticsSettings": {"target": POST_CALL_ANALYTICS_SETTINGS}, - }, -) +ITEM_LIST: StaticSchema = (16, n0, _IL, 0, (_m,), ((ITEM, 0),)) -AUDIO_STREAM = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#AudioStream"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#streaming"))], - members={ - "AudioEvent": {"target": AUDIO_EVENT}, - "ConfigurationEvent": {"target": CONFIGURATION_EVENT}, - }, +ALTERNATIVE: StaticSchema = ( + 18, + n0, + _A, + 0, + (_Tr, _It, _En), + ((STRING, 0), (ITEM_LIST, 0), (ENTITY_LIST, 0)), ) -BAD_REQUEST_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#BadRequestException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=400), - ], - members={"Message": {"target": STRING}}, -) +ALTERNATIVE_LIST: StaticSchema = (16, n0, _AL, 0, (_m,), ((ALTERNATIVE, 0),)) -BUCKET_NAME = Schema( - id=ShapeID("com.amazonaws.transcribestreaming#BucketName"), - shape_type=ShapeType.STRING, -) +AUDIO_CHUNK: StaticSchema = (1, n0, _AC, 0) -LONG = Schema( - id=ShapeID("com.amazonaws.transcribestreaming#Long"), shape_type=ShapeType.LONG -) +AUDIO_EVENT: StaticSchema = (18, n0, _AE, 0, (_AC,), ((AUDIO_CHUNK, {_sP: None}),)) -CALL_ANALYTICS_ENTITY = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#CallAnalyticsEntity"), - members={ - "BeginOffsetMillis": {"target": LONG}, - "EndOffsetMillis": {"target": LONG}, - "Category": {"target": STRING}, - "Type": {"target": STRING}, - "Content": {"target": STRING}, - "Confidence": {"target": CONFIDENCE}, - }, -) +CHANNEL_ID: StaticSchema = (7, n0, _CI, {_s: 0}) -CALL_ANALYTICS_ENTITY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#CallAnalyticsEntityList"), - shape_type=ShapeType.LIST, - members={"member": {"target": CALL_ANALYTICS_ENTITY}}, -) - -CALL_ANALYTICS_ITEM = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#CallAnalyticsItem"), - members={ - "BeginOffsetMillis": {"target": LONG}, - "EndOffsetMillis": {"target": LONG}, - "Type": {"target": ITEM_TYPE}, - "Content": {"target": STRING}, - "Confidence": {"target": CONFIDENCE}, - "VocabularyFilterMatch": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "Stable": {"target": STABLE}, - }, -) - -CALL_ANALYTICS_ITEM_LIST = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#CallAnalyticsItemList"), - shape_type=ShapeType.LIST, - members={"member": {"target": CALL_ANALYTICS_ITEM}}, -) - -CALL_ANALYTICS_LANGUAGE_CODE = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#CallAnalyticsLanguageCode"), - shape_type=ShapeType.ENUM, - members={ - "EN_US": {"target": UNIT}, - "EN_GB": {"target": UNIT}, - "ES_US": {"target": UNIT}, - "FR_CA": {"target": UNIT}, - "FR_FR": {"target": UNIT}, - "EN_AU": {"target": UNIT}, - "IT_IT": {"target": UNIT}, - "DE_DE": {"target": UNIT}, - "PT_BR": {"target": UNIT}, - }, +PARTICIPANT_ROLE: StaticSchema = ( + 14, + n0, + _PR, + 0, + (_AGENT, _CUSTOMER), + ((-1, {_sV: _AGENT}), (-1, {_sV: _CUSTOMER})), ) -CALL_ANALYTICS_LANGUAGE_WITH_SCORE = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#CallAnalyticsLanguageWithScore"), - members={ - "LanguageCode": {"target": CALL_ANALYTICS_LANGUAGE_CODE}, - "Score": { - "target": DOUBLE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - }, +CHANNEL_DEFINITION: StaticSchema = ( + 18, + n0, + _CD, + 0, + (_CI, _PR), + ((CHANNEL_ID, {_s: 0, _sm: None}), (PARTICIPANT_ROLE, 1)), ) -CALL_ANALYTICS_LANGUAGE_IDENTIFICATION = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#CallAnalyticsLanguageIdentification"), - shape_type=ShapeType.LIST, - members={"member": {"target": CALL_ANALYTICS_LANGUAGE_WITH_SCORE}}, -) +CHANNEL_DEFINITIONS: StaticSchema = (16, n0, _CDh, 0, (_m,), ((CHANNEL_DEFINITION, 0),)) -STRING_LIST = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#StringList"), - shape_type=ShapeType.LIST, - members={"member": {"target": STRING}}, +CONTENT_REDACTION_OUTPUT: StaticSchema = ( + 14, + n0, + _CRO, + 0, + (_REDACTED, _RAU), + ((-1, {_sV: _r}), (-1, {_sV: _rau})), ) -TIMESTAMP_RANGE = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#TimestampRange"), - members={ - "BeginOffsetMillis": {"target": LONG}, - "EndOffsetMillis": {"target": LONG}, - }, +POST_CALL_ANALYTICS_SETTINGS: StaticSchema = ( + 18, + n0, + _PCAS, + 0, + (_OL, _DARA, _CRO, _OEKMSKI), + ((STRING, 1), (STRING, 1), (CONTENT_REDACTION_OUTPUT, 0), (STRING, 0)), ) -TIMESTAMP_RANGES = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#TimestampRanges"), - shape_type=ShapeType.LIST, - members={"member": {"target": TIMESTAMP_RANGE}}, +CONFIGURATION_EVENT: StaticSchema = ( + 18, + n0, + _CE, + 0, + (_CDh, _PCAS), + ((CHANNEL_DEFINITIONS, 0), (POST_CALL_ANALYTICS_SETTINGS, 0)), ) -POINTS_OF_INTEREST = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#PointsOfInterest"), - members={"TimestampRanges": {"target": TIMESTAMP_RANGES}}, +AUDIO_STREAM: StaticSchema = ( + 19, + n0, + _AS, + {_smi: None}, + (_AE, _CE), + ((AUDIO_EVENT, 0), (CONFIGURATION_EVENT, 0)), ) -MATCHED_CATEGORY_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#MatchedCategoryDetails"), - shape_type=ShapeType.MAP, - members={"key": {"target": STRING}, "value": {"target": POINTS_OF_INTEREST}}, +BAD_REQUEST_EXCEPTION: StaticSchema = ( + 18, + n0, + _BRE, + {_smit: _c, _sE: 400}, + (_M,), + ((STRING, 0),), ) -CATEGORY_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#CategoryEvent"), - members={ - "MatchedCategories": {"target": STRING_LIST}, - "MatchedDetails": {"target": MATCHED_CATEGORY_DETAILS}, - }, -) +BUCKET_NAME: StaticSchema = (3, n0, _BN, 0) -CONFLICT_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#ConflictException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=409), - ], - members={"Message": {"target": STRING}}, -) +LONG: StaticSchema = (8, n0, _L, 0) -INTERNAL_FAILURE_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#InternalFailureException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="server"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=500), - ], - members={"Message": {"target": STRING}}, +CALL_ANALYTICS_ENTITY: StaticSchema = ( + 18, + n0, + _CAE, + 0, + (_BOM, _EOM, _Ca, _T, _Co, _C), + ((LONG, 0), (LONG, 0), (STRING, 0), (STRING, 0), (STRING, 0), (CONFIDENCE, 0)), ) -LIMIT_EXCEEDED_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#LimitExceededException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=429), - ], - members={"Message": {"target": STRING}}, +CALL_ANALYTICS_ENTITY_LIST: StaticSchema = ( + 16, + n0, + _CAEL, + 0, + (_m,), + ((CALL_ANALYTICS_ENTITY, 0),), +) + +CALL_ANALYTICS_ITEM: StaticSchema = ( + 18, + n0, + _CAI, + 0, + (_BOM, _EOM, _T, _Co, _C, _VFM, _St), + ( + (LONG, 0), + (LONG, 0), + (ITEM_TYPE, 0), + (STRING, 0), + (CONFIDENCE, 0), + (BOOLEAN, {_s: False}), + (STABLE, 0), + ), ) -SERVICE_UNAVAILABLE_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#ServiceUnavailableException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="server"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=503), - ], - members={"Message": {"target": STRING}}, +CALL_ANALYTICS_ITEM_LIST: StaticSchema = ( + 16, + n0, + _CAIL, + 0, + (_m,), + ((CALL_ANALYTICS_ITEM, 0),), +) + +CALL_ANALYTICS_LANGUAGE_CODE: StaticSchema = ( + 14, + n0, + _CALC, + 0, + (_EU, _EG, _EU_, _FC, _FF, _EA, _II, _DD, _PB), + ( + (-1, {_sV: _eU}), + (-1, {_sV: _eG}), + (-1, {_sV: _eU_}), + (-1, {_sV: _fC}), + (-1, {_sV: _fF}), + (-1, {_sV: _eA}), + (-1, {_sV: _iI}), + (-1, {_sV: _dD}), + (-1, {_sV: _pB}), + ), ) -INTEGER = Schema( - id=ShapeID("com.amazonaws.transcribestreaming#Integer"), - shape_type=ShapeType.INTEGER, +CALL_ANALYTICS_LANGUAGE_WITH_SCORE: StaticSchema = ( + 18, + n0, + _CALWS, + 0, + (_LC, _Sc), + ((CALL_ANALYTICS_LANGUAGE_CODE, 0), (DOUBLE, {_s: 0})), ) -CHARACTER_OFFSETS = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#CharacterOffsets"), - members={"Begin": {"target": INTEGER}, "End": {"target": INTEGER}}, +CALL_ANALYTICS_LANGUAGE_IDENTIFICATION: StaticSchema = ( + 16, + n0, + _CALI, + 0, + (_m,), + ((CALL_ANALYTICS_LANGUAGE_WITH_SCORE, 0),), ) -ISSUE_DETECTED = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#IssueDetected"), - members={"CharacterOffsets": {"target": CHARACTER_OFFSETS}}, -) +STRING_LIST: StaticSchema = (16, n0, _SL, 0, (_m,), ((STRING, 0),)) -ISSUES_DETECTED = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#IssuesDetected"), - shape_type=ShapeType.LIST, - members={"member": {"target": ISSUE_DETECTED}}, -) +TIMESTAMP_RANGE: StaticSchema = (18, n0, _TR, 0, (_BOM, _EOM), ((LONG, 0), (LONG, 0))) -SENTIMENT = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#Sentiment"), - shape_type=ShapeType.ENUM, - members={ - "POSITIVE": {"target": UNIT}, - "NEGATIVE": {"target": UNIT}, - "MIXED": {"target": UNIT}, - "NEUTRAL": {"target": UNIT}, - }, -) +TIMESTAMP_RANGES: StaticSchema = (16, n0, _TRi, 0, (_m,), ((TIMESTAMP_RANGE, 0),)) -UTTERANCE_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#UtteranceEvent"), - members={ - "UtteranceId": {"target": STRING}, - "IsPartial": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "ParticipantRole": {"target": PARTICIPANT_ROLE}, - "BeginOffsetMillis": {"target": LONG}, - "EndOffsetMillis": {"target": LONG}, - "Transcript": {"target": STRING}, - "Items": {"target": CALL_ANALYTICS_ITEM_LIST}, - "Entities": {"target": CALL_ANALYTICS_ENTITY_LIST}, - "Sentiment": {"target": SENTIMENT}, - "IssuesDetected": {"target": ISSUES_DETECTED}, - "LanguageCode": {"target": CALL_ANALYTICS_LANGUAGE_CODE}, - "LanguageIdentification": {"target": CALL_ANALYTICS_LANGUAGE_IDENTIFICATION}, - }, -) +POINTS_OF_INTEREST: StaticSchema = (18, n0, _POI, 0, (_TRi,), ((TIMESTAMP_RANGES, 0),)) -CALL_ANALYTICS_TRANSCRIPT_RESULT_STREAM = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#CallAnalyticsTranscriptResultStream"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#streaming"))], - members={ - "UtteranceEvent": {"target": UTTERANCE_EVENT}, - "CategoryEvent": {"target": CATEGORY_EVENT}, - "BadRequestException": {"target": BAD_REQUEST_EXCEPTION}, - "LimitExceededException": {"target": LIMIT_EXCEEDED_EXCEPTION}, - "InternalFailureException": {"target": INTERNAL_FAILURE_EXCEPTION}, - "ConflictException": {"target": CONFLICT_EXCEPTION}, - "ServiceUnavailableException": {"target": SERVICE_UNAVAILABLE_EXCEPTION}, - }, +MATCHED_CATEGORY_DETAILS: StaticSchema = ( + 17, + n0, + _MCD, + 0, + (_k, _v), + ((STRING, 0), (POINTS_OF_INTEREST, 0)), ) -URI = Schema( - id=ShapeID("com.amazonaws.transcribestreaming#Uri"), shape_type=ShapeType.STRING +CATEGORY_EVENT: StaticSchema = ( + 18, + n0, + _CEa, + 0, + (_MC, _MD), + ((STRING_LIST, 0), (MATCHED_CATEGORY_DETAILS, 0)), ) -CLINICAL_NOTE_GENERATION_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#ClinicalNoteGenerationStatus"), - shape_type=ShapeType.ENUM, - members={ - "IN_PROGRESS": {"target": UNIT}, - "FAILED": {"target": UNIT}, - "COMPLETED": {"target": UNIT}, - }, +CONFLICT_EXCEPTION: StaticSchema = ( + 18, + n0, + _CEo, + {_smit: _c, _sE: 409}, + (_M,), + ((STRING, 0),), ) -CLINICAL_NOTE_GENERATION_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#ClinicalNoteGenerationResult"), - members={ - "ClinicalNoteOutputLocation": {"target": URI}, - "TranscriptOutputLocation": {"target": URI}, - "Status": {"target": CLINICAL_NOTE_GENERATION_STATUS}, - "FailureReason": {"target": STRING}, - }, +INTERNAL_FAILURE_EXCEPTION: StaticSchema = ( + 18, + n0, + _IFE, + {_smit: _se, _sE: 500}, + (_M,), + ((STRING, 0),), ) -MEDICAL_SCRIBE_NOTE_TEMPLATE = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#MedicalScribeNoteTemplate"), - shape_type=ShapeType.ENUM, - members={ - "HISTORY_AND_PHYSICAL": {"target": UNIT}, - "GIRPP": {"target": UNIT}, - "DAP": {"target": UNIT}, - "SIRP": {"target": UNIT}, - "BIRP": {"target": UNIT}, - "BEHAVIORAL_SOAP": {"target": UNIT}, - "PHYSICAL_SOAP": {"target": UNIT}, - }, +LIMIT_EXCEEDED_EXCEPTION: StaticSchema = ( + 18, + n0, + _LEE, + {_smit: _c, _sE: 429}, + (_M,), + ((STRING, 0),), ) -CLINICAL_NOTE_GENERATION_SETTINGS = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#ClinicalNoteGenerationSettings"), - members={ - "OutputBucketName": { - "target": BUCKET_NAME, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "NoteTemplate": {"target": MEDICAL_SCRIBE_NOTE_TEMPLATE}, - }, +SERVICE_UNAVAILABLE_EXCEPTION: StaticSchema = ( + 18, + n0, + _SUE, + {_smit: _se, _sE: 503}, + (_M,), + ((STRING, 0),), ) -CONTENT_IDENTIFICATION_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#ContentIdentificationType"), - shape_type=ShapeType.ENUM, - members={"PII": {"target": UNIT}}, -) +INTEGER: StaticSchema = (7, n0, _In, 0) -CONTENT_REDACTION_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#ContentRedactionType"), - shape_type=ShapeType.ENUM, - members={"PII": {"target": UNIT}}, +CHARACTER_OFFSETS: StaticSchema = ( + 18, + n0, + _CO, + 0, + (_Be, _End), + ((INTEGER, 0), (INTEGER, 0)), ) -DATE_TIME = Schema( - id=ShapeID("com.amazonaws.transcribestreaming#DateTime"), - shape_type=ShapeType.TIMESTAMP, -) +ISSUE_DETECTED: StaticSchema = (18, n0, _ID, 0, (_CO,), ((CHARACTER_OFFSETS, 0),)) -SESSION_ID = Schema( - id=ShapeID("com.amazonaws.transcribestreaming#SessionId"), - shape_type=ShapeType.STRING, -) +ISSUES_DETECTED: StaticSchema = (16, n0, _IDs, 0, (_m,), ((ISSUE_DETECTED, 0),)) -GET_MEDICAL_SCRIBE_STREAM_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#GetMedicalScribeStreamInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.transcribestreaming#GetMedicalScribeStreamRequest", - ) - ], - members={ - "SessionId": { - "target": SESSION_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpLabel")), - ], - } - }, +SENTIMENT: StaticSchema = ( + 14, + n0, + _Se, + 0, + (_POSITIVE, _NEGATIVE, _MIXED, _NEUTRAL), + ( + (-1, {_sV: _POSITIVE}), + (-1, {_sV: _NEGATIVE}), + (-1, {_sV: _MIXED}), + (-1, {_sV: _NEUTRAL}), + ), ) -MEDICAL_SCRIBE_CHANNEL_ID = Schema( - id=ShapeID("com.amazonaws.transcribestreaming#MedicalScribeChannelId"), - shape_type=ShapeType.INTEGER, - traits=[Trait.new(id=ShapeID("smithy.api#default"), value=0)], -) - -MEDICAL_SCRIBE_PARTICIPANT_ROLE = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#MedicalScribeParticipantRole"), - shape_type=ShapeType.ENUM, - members={"PATIENT": {"target": UNIT}, "CLINICIAN": {"target": UNIT}}, -) - -MEDICAL_SCRIBE_CHANNEL_DEFINITION = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#MedicalScribeChannelDefinition"), - members={ - "ChannelId": { - "target": MEDICAL_SCRIBE_CHANNEL_ID, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=0), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "ParticipantRole": { - "target": MEDICAL_SCRIBE_PARTICIPANT_ROLE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, +UTTERANCE_EVENT: StaticSchema = ( + 18, + n0, + _UE, + 0, + (_UI, _IP, _PR, _BOM, _EOM, _Tr, _It, _En, _Se, _IDs, _LC, _LI), + ( + (STRING, 0), + (BOOLEAN, {_s: False}), + (PARTICIPANT_ROLE, 0), + (LONG, 0), + (LONG, 0), + (STRING, 0), + (CALL_ANALYTICS_ITEM_LIST, 0), + (CALL_ANALYTICS_ENTITY_LIST, 0), + (SENTIMENT, 0), + (ISSUES_DETECTED, 0), + (CALL_ANALYTICS_LANGUAGE_CODE, 0), + (CALL_ANALYTICS_LANGUAGE_IDENTIFICATION, 0), + ), ) -MEDICAL_SCRIBE_CHANNEL_DEFINITIONS = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#MedicalScribeChannelDefinitions"), - shape_type=ShapeType.LIST, - members={"member": {"target": MEDICAL_SCRIBE_CHANNEL_DEFINITION}}, +CALL_ANALYTICS_TRANSCRIPT_RESULT_STREAM: StaticSchema = ( + 19, + n0, + _CATRS, + {_smi: None}, + (_UE, _CEa, _BRE, _LEE, _IFE, _CEo, _SUE), + ( + (UTTERANCE_EVENT, 0), + (CATEGORY_EVENT, 0), + (BAD_REQUEST_EXCEPTION, 0), + (LIMIT_EXCEEDED_EXCEPTION, 0), + (INTERNAL_FAILURE_EXCEPTION, 0), + (CONFLICT_EXCEPTION, 0), + (SERVICE_UNAVAILABLE_EXCEPTION, 0), + ), ) -NON_EMPTY_STRING = Schema( - id=ShapeID("com.amazonaws.transcribestreaming#NonEmptyString"), - shape_type=ShapeType.STRING, +URI: StaticSchema = (3, n0, _U, 0) + +CLINICAL_NOTE_GENERATION_STATUS: StaticSchema = ( + 14, + n0, + _CNGS, + 0, + (_IP_, _FAILED, _COMPLETED), + ((-1, {_sV: _IP_}), (-1, {_sV: _FAILED}), (-1, {_sV: _COMPLETED})), +) + +CLINICAL_NOTE_GENERATION_RESULT: StaticSchema = ( + 18, + n0, + _CNGR, + 0, + (_CNOL, _TOL, _Sta, _FR), + ((URI, 0), (URI, 0), (CLINICAL_NOTE_GENERATION_STATUS, 0), (STRING, 0)), +) + +MEDICAL_SCRIBE_NOTE_TEMPLATE: StaticSchema = ( + 14, + n0, + _MSNT, + 0, + (_HAP, _GIRPP, _DAP, _SIRP, _BIRP, _BS, _PS), + ( + (-1, {_sV: _HAP}), + (-1, {_sV: _GIRPP}), + (-1, {_sV: _DAP}), + (-1, {_sV: _SIRP}), + (-1, {_sV: _BIRP}), + (-1, {_sV: _BS}), + (-1, {_sV: _PS}), + ), ) -KMS_ENCRYPTION_CONTEXT_MAP = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#KMSEncryptionContextMap"), - shape_type=ShapeType.MAP, - members={ - "key": {"target": NON_EMPTY_STRING}, - "value": {"target": NON_EMPTY_STRING}, - }, +CLINICAL_NOTE_GENERATION_SETTINGS: StaticSchema = ( + 18, + n0, + _CNGSl, + 0, + (_OBN, _NT), + ((BUCKET_NAME, 1), (MEDICAL_SCRIBE_NOTE_TEMPLATE, 0)), ) -KMS_KEY_ID = Schema( - id=ShapeID("com.amazonaws.transcribestreaming#KMSKeyId"), - shape_type=ShapeType.STRING, +CONTENT_IDENTIFICATION_TYPE: StaticSchema = ( + 14, + n0, + _CIT, + 0, + (_PII,), + ((-1, {_sV: _PII}),), ) -MEDICAL_SCRIBE_ENCRYPTION_SETTINGS = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#MedicalScribeEncryptionSettings"), - members={ - "KmsEncryptionContext": {"target": KMS_ENCRYPTION_CONTEXT_MAP}, - "KmsKeyId": { - "target": KMS_KEY_ID, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - }, -) +CONTENT_REDACTION_TYPE: StaticSchema = (14, n0, _CRT, 0, (_PII,), ((-1, {_sV: _PII}),)) -MEDICAL_SCRIBE_LANGUAGE_CODE = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#MedicalScribeLanguageCode"), - shape_type=ShapeType.ENUM, - members={"EN_US": {"target": UNIT}}, -) +DATE_TIME: StaticSchema = (4, n0, _DT, 0) -MEDICAL_SCRIBE_MEDIA_ENCODING = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#MedicalScribeMediaEncoding"), - shape_type=ShapeType.ENUM, - members={ - "PCM": {"target": UNIT}, - "OGG_OPUS": {"target": UNIT}, - "FLAC": {"target": UNIT}, - }, -) +SESSION_ID: StaticSchema = (3, n0, _SI, 0) -MEDICAL_SCRIBE_MEDIA_SAMPLE_RATE_HERTZ = Schema( - id=ShapeID("com.amazonaws.transcribestreaming#MedicalScribeMediaSampleRateHertz"), - shape_type=ShapeType.INTEGER, +GET_MEDICAL_SCRIBE_STREAM_INPUT: StaticSchema = ( + 18, + n0, + _GMSSI, + {_sSI: _cGMSSR, _smith: None}, + (_SI,), + ((SESSION_ID, 9),), ) -NULLABLE_BOOLEAN = Schema( - id=ShapeID("com.amazonaws.transcribestreaming#NullableBoolean"), - shape_type=ShapeType.BOOLEAN, -) +MEDICAL_SCRIBE_CHANNEL_ID: StaticSchema = (7, n0, _MSCI, {_s: 0}) -MEDICAL_SCRIBE_POST_STREAM_ANALYTICS_RESULT = Schema.collection( - id=ShapeID( - "com.amazonaws.transcribestreaming#MedicalScribePostStreamAnalyticsResult" - ), - members={ - "ClinicalNoteGenerationResult": {"target": CLINICAL_NOTE_GENERATION_RESULT} - }, +MEDICAL_SCRIBE_PARTICIPANT_ROLE: StaticSchema = ( + 14, + n0, + _MSPR, + 0, + (_PATIENT, _CLINICIAN), + ((-1, {_sV: _PATIENT}), (-1, {_sV: _CLINICIAN})), ) -MEDICAL_SCRIBE_POST_STREAM_ANALYTICS_SETTINGS = Schema.collection( - id=ShapeID( - "com.amazonaws.transcribestreaming#MedicalScribePostStreamAnalyticsSettings" +MEDICAL_SCRIBE_CHANNEL_DEFINITION: StaticSchema = ( + 18, + n0, + _MSCD, + 0, + (_CI, _PR), + ( + (MEDICAL_SCRIBE_CHANNEL_ID, {_s: 0, _sm: None}), + (MEDICAL_SCRIBE_PARTICIPANT_ROLE, 1), ), - members={ - "ClinicalNoteGenerationSettings": { - "target": CLINICAL_NOTE_GENERATION_SETTINGS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, ) -IAM_ROLE_ARN = Schema( - id=ShapeID("com.amazonaws.transcribestreaming#IamRoleArn"), - shape_type=ShapeType.STRING, +MEDICAL_SCRIBE_CHANNEL_DEFINITIONS: StaticSchema = ( + 16, + n0, + _MSCDe, + 0, + (_m,), + ((MEDICAL_SCRIBE_CHANNEL_DEFINITION, 0),), ) -MEDICAL_SCRIBE_STREAM_STATUS = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#MedicalScribeStreamStatus"), - shape_type=ShapeType.ENUM, - members={ - "IN_PROGRESS": {"target": UNIT}, - "PAUSED": {"target": UNIT}, - "FAILED": {"target": UNIT}, - "COMPLETED": {"target": UNIT}, - }, -) - -MEDICAL_SCRIBE_VOCABULARY_FILTER_METHOD = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#MedicalScribeVocabularyFilterMethod"), - shape_type=ShapeType.ENUM, - members={ - "REMOVE": {"target": UNIT}, - "MASK": {"target": UNIT}, - "TAG": {"target": UNIT}, - }, -) +NON_EMPTY_STRING: StaticSchema = (3, n0, _NES, 0) -VOCABULARY_FILTER_NAME = Schema( - id=ShapeID("com.amazonaws.transcribestreaming#VocabularyFilterName"), - shape_type=ShapeType.STRING, -) - -VOCABULARY_NAME = Schema( - id=ShapeID("com.amazonaws.transcribestreaming#VocabularyName"), - shape_type=ShapeType.STRING, -) - -MEDICAL_SCRIBE_STREAM_DETAILS = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#MedicalScribeStreamDetails"), - members={ - "SessionId": {"target": SESSION_ID}, - "StreamCreatedAt": {"target": DATE_TIME}, - "StreamEndedAt": {"target": DATE_TIME}, - "LanguageCode": {"target": MEDICAL_SCRIBE_LANGUAGE_CODE}, - "MediaSampleRateHertz": {"target": MEDICAL_SCRIBE_MEDIA_SAMPLE_RATE_HERTZ}, - "MediaEncoding": {"target": MEDICAL_SCRIBE_MEDIA_ENCODING}, - "VocabularyName": {"target": VOCABULARY_NAME}, - "VocabularyFilterName": {"target": VOCABULARY_FILTER_NAME}, - "VocabularyFilterMethod": {"target": MEDICAL_SCRIBE_VOCABULARY_FILTER_METHOD}, - "ResourceAccessRoleArn": {"target": IAM_ROLE_ARN}, - "ChannelDefinitions": {"target": MEDICAL_SCRIBE_CHANNEL_DEFINITIONS}, - "EncryptionSettings": {"target": MEDICAL_SCRIBE_ENCRYPTION_SETTINGS}, - "StreamStatus": {"target": MEDICAL_SCRIBE_STREAM_STATUS}, - "PostStreamAnalyticsSettings": { - "target": MEDICAL_SCRIBE_POST_STREAM_ANALYTICS_SETTINGS - }, - "PostStreamAnalyticsResult": { - "target": MEDICAL_SCRIBE_POST_STREAM_ANALYTICS_RESULT - }, - "MedicalScribeContextProvided": {"target": NULLABLE_BOOLEAN}, - }, +KMS_ENCRYPTION_CONTEXT_MAP: StaticSchema = ( + 17, + n0, + _KMSECM, + 0, + (_k, _v), + ((NON_EMPTY_STRING, 0), (NON_EMPTY_STRING, 0)), ) -GET_MEDICAL_SCRIBE_STREAM_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#GetMedicalScribeStreamOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.transcribestreaming#GetMedicalScribeStreamResponse", - ) - ], - members={"MedicalScribeStreamDetails": {"target": MEDICAL_SCRIBE_STREAM_DETAILS}}, -) - -RESOURCE_NOT_FOUND_EXCEPTION = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#ResourceNotFoundException"), - traits=[ - Trait.new(id=ShapeID("smithy.api#error"), value="client"), - Trait.new(id=ShapeID("smithy.api#httpError"), value=404), - ], - members={"Message": {"target": STRING}}, -) - -GET_MEDICAL_SCRIBE_STREAM = Schema( - id=ShapeID("com.amazonaws.transcribestreaming#GetMedicalScribeStream"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "GET", - "uri": "/medical-scribe-stream/{SessionId}", - "code": 200, - } - ), - ) - ], -) - -LANGUAGE_CODE = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#LanguageCode"), - shape_type=ShapeType.ENUM, - members={ - "EN_US": {"target": UNIT}, - "EN_GB": {"target": UNIT}, - "ES_US": {"target": UNIT}, - "FR_CA": {"target": UNIT}, - "FR_FR": {"target": UNIT}, - "EN_AU": {"target": UNIT}, - "IT_IT": {"target": UNIT}, - "DE_DE": {"target": UNIT}, - "PT_BR": {"target": UNIT}, - "JA_JP": {"target": UNIT}, - "KO_KR": {"target": UNIT}, - "ZH_CN": {"target": UNIT}, - "TH_TH": {"target": UNIT}, - "ES_ES": {"target": UNIT}, - "AR_SA": {"target": UNIT}, - "PT_PT": {"target": UNIT}, - "CA_ES": {"target": UNIT}, - "AR_AE": {"target": UNIT}, - "HI_IN": {"target": UNIT}, - "ZH_HK": {"target": UNIT}, - "NL_NL": {"target": UNIT}, - "NO_NO": {"target": UNIT}, - "SV_SE": {"target": UNIT}, - "PL_PL": {"target": UNIT}, - "FI_FI": {"target": UNIT}, - "ZH_TW": {"target": UNIT}, - "EN_IN": {"target": UNIT}, - "EN_IE": {"target": UNIT}, - "EN_NZ": {"target": UNIT}, - "EN_AB": {"target": UNIT}, - "EN_ZA": {"target": UNIT}, - "EN_WL": {"target": UNIT}, - "DE_CH": {"target": UNIT}, - "AF_ZA": {"target": UNIT}, - "EU_ES": {"target": UNIT}, - "HR_HR": {"target": UNIT}, - "CS_CZ": {"target": UNIT}, - "DA_DK": {"target": UNIT}, - "FA_IR": {"target": UNIT}, - "GL_ES": {"target": UNIT}, - "EL_GR": {"target": UNIT}, - "HE_IL": {"target": UNIT}, - "ID_ID": {"target": UNIT}, - "LV_LV": {"target": UNIT}, - "MS_MY": {"target": UNIT}, - "RO_RO": {"target": UNIT}, - "RU_RU": {"target": UNIT}, - "SR_RS": {"target": UNIT}, - "SK_SK": {"target": UNIT}, - "SO_SO": {"target": UNIT}, - "TL_PH": {"target": UNIT}, - "UK_UA": {"target": UNIT}, - "VI_VN": {"target": UNIT}, - "ZU_ZA": {"target": UNIT}, - "AM_ET": {"target": UNIT}, - "BE_BY": {"target": UNIT}, - "BG_BG": {"target": UNIT}, - "BN_IN": {"target": UNIT}, - "BS_BA": {"target": UNIT}, - "CKB_IQ": {"target": UNIT}, - "CKB_IR": {"target": UNIT}, - "CY_WL": {"target": UNIT}, - "ES_MX": {"target": UNIT}, - "ET_ET": {"target": UNIT}, - "FA_AF": {"target": UNIT}, - "GU_IN": {"target": UNIT}, - "HT_HT": {"target": UNIT}, - "HU_HU": {"target": UNIT}, - "HY_AM": {"target": UNIT}, - "IS_IS": {"target": UNIT}, - "JV_ID": {"target": UNIT}, - "KA_GE": {"target": UNIT}, - "KAB_DZ": {"target": UNIT}, - "KK_KZ": {"target": UNIT}, - "KM_KH": {"target": UNIT}, - "KN_IN": {"target": UNIT}, - "LG_IN": {"target": UNIT}, - "LT_LT": {"target": UNIT}, - "MK_MK": {"target": UNIT}, - "ML_IN": {"target": UNIT}, - "MR_IN": {"target": UNIT}, - "MY_MM": {"target": UNIT}, - "NE_NP": {"target": UNIT}, - "OR_IN": {"target": UNIT}, - "PA_IN": {"target": UNIT}, - "PS_AF": {"target": UNIT}, - "SI_LK": {"target": UNIT}, - "SL_SI": {"target": UNIT}, - "SQ_AL": {"target": UNIT}, - "SU_ID": {"target": UNIT}, - "SW_BI": {"target": UNIT}, - "SW_KE": {"target": UNIT}, - "SW_RW": {"target": UNIT}, - "SW_TZ": {"target": UNIT}, - "SW_UG": {"target": UNIT}, - "TA_IN": {"target": UNIT}, - "TE_IN": {"target": UNIT}, - "TR_TR": {"target": UNIT}, - "UZ_UZ": {"target": UNIT}, - }, -) +KMS_KEY_ID: StaticSchema = (3, n0, _KMSKI, 0) -LANGUAGE_WITH_SCORE = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#LanguageWithScore"), - members={ - "LanguageCode": {"target": LANGUAGE_CODE}, - "Score": { - "target": DOUBLE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - }, +MEDICAL_SCRIBE_ENCRYPTION_SETTINGS: StaticSchema = ( + 18, + n0, + _MSES, + 0, + (_KEC, _KKI), + ((KMS_ENCRYPTION_CONTEXT_MAP, 0), (KMS_KEY_ID, 1)), ) -LANGUAGE_IDENTIFICATION = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#LanguageIdentification"), - shape_type=ShapeType.LIST, - members={"member": {"target": LANGUAGE_WITH_SCORE}}, +MEDICAL_SCRIBE_LANGUAGE_CODE: StaticSchema = ( + 14, + n0, + _MSLC, + 0, + (_EU,), + ((-1, {_sV: _eU}),), ) -LANGUAGE_OPTIONS = Schema( - id=ShapeID("com.amazonaws.transcribestreaming#LanguageOptions"), - shape_type=ShapeType.STRING, +MEDICAL_SCRIBE_MEDIA_ENCODING: StaticSchema = ( + 14, + n0, + _MSME, + 0, + (_PCM, _OO, _FLAC), + ((-1, {_sV: _pc}), (-1, {_sV: _oo}), (-1, {_sV: _f})), ) -MEDIA_ENCODING = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#MediaEncoding"), - shape_type=ShapeType.ENUM, - members={ - "PCM": {"target": UNIT}, - "OGG_OPUS": {"target": UNIT}, - "FLAC": {"target": UNIT}, - "G711_ALAW": {"target": UNIT}, - "G711_ULAW": {"target": UNIT}, - "G729": {"target": UNIT}, - }, -) +MEDICAL_SCRIBE_MEDIA_SAMPLE_RATE_HERTZ: StaticSchema = (7, n0, _MSMSRH, 0) -MEDIA_SAMPLE_RATE_HERTZ = Schema( - id=ShapeID("com.amazonaws.transcribestreaming#MediaSampleRateHertz"), - shape_type=ShapeType.INTEGER, -) - -MEDICAL_ENTITY = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#MedicalEntity"), - members={ - "StartTime": { - "target": DOUBLE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "EndTime": { - "target": DOUBLE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "Category": {"target": STRING}, - "Content": {"target": STRING}, - "Confidence": {"target": CONFIDENCE}, - }, -) +NULLABLE_BOOLEAN: StaticSchema = (2, n0, _NB, 0) -MEDICAL_ENTITY_LIST = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#MedicalEntityList"), - shape_type=ShapeType.LIST, - members={"member": {"target": MEDICAL_ENTITY}}, -) - -MEDICAL_ITEM = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#MedicalItem"), - members={ - "StartTime": { - "target": DOUBLE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "EndTime": { - "target": DOUBLE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "Type": {"target": ITEM_TYPE}, - "Content": {"target": STRING}, - "Confidence": {"target": CONFIDENCE}, - "Speaker": {"target": STRING}, - }, +MEDICAL_SCRIBE_POST_STREAM_ANALYTICS_RESULT: StaticSchema = ( + 18, + n0, + _MSPSAR, + 0, + (_CNGR,), + ((CLINICAL_NOTE_GENERATION_RESULT, 0),), ) -MEDICAL_ITEM_LIST = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#MedicalItemList"), - shape_type=ShapeType.LIST, - members={"member": {"target": MEDICAL_ITEM}}, +MEDICAL_SCRIBE_POST_STREAM_ANALYTICS_SETTINGS: StaticSchema = ( + 18, + n0, + _MSPSAS, + 0, + (_CNGSl,), + ((CLINICAL_NOTE_GENERATION_SETTINGS, 1),), ) -MEDICAL_ALTERNATIVE = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#MedicalAlternative"), - members={ - "Transcript": {"target": STRING}, - "Items": {"target": MEDICAL_ITEM_LIST}, - "Entities": {"target": MEDICAL_ENTITY_LIST}, - }, -) +IAM_ROLE_ARN: StaticSchema = (3, n0, _IRA, 0) -MEDICAL_ALTERNATIVE_LIST = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#MedicalAlternativeList"), - shape_type=ShapeType.LIST, - members={"member": {"target": MEDICAL_ALTERNATIVE}}, -) - -MEDICAL_CONTENT_IDENTIFICATION_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#MedicalContentIdentificationType"), - shape_type=ShapeType.ENUM, - members={"PHI": {"target": UNIT}}, -) - -MEDICAL_RESULT = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#MedicalResult"), - members={ - "ResultId": {"target": STRING}, - "StartTime": { - "target": DOUBLE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "EndTime": { - "target": DOUBLE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "IsPartial": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "Alternatives": {"target": MEDICAL_ALTERNATIVE_LIST}, - "ChannelId": {"target": STRING}, - }, +MEDICAL_SCRIBE_STREAM_STATUS: StaticSchema = ( + 14, + n0, + _MSSS, + 0, + (_IP_, _PAUSED, _FAILED, _COMPLETED), + ( + (-1, {_sV: _IP_}), + (-1, {_sV: _PAUSED}), + (-1, {_sV: _FAILED}), + (-1, {_sV: _COMPLETED}), + ), ) -MEDICAL_RESULT_LIST = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#MedicalResultList"), - shape_type=ShapeType.LIST, - members={"member": {"target": MEDICAL_RESULT}}, +MEDICAL_SCRIBE_VOCABULARY_FILTER_METHOD: StaticSchema = ( + 14, + n0, + _MSVFM, + 0, + (_REMOVE, _MASK, _TAG), + ((-1, {_sV: _re}), (-1, {_sV: _ma}), (-1, {_sV: _t})), +) + +VOCABULARY_FILTER_NAME: StaticSchema = (3, n0, _VFN, 0) + +VOCABULARY_NAME: StaticSchema = (3, n0, _VN, 0) + +MEDICAL_SCRIBE_STREAM_DETAILS: StaticSchema = ( + 18, + n0, + _MSSD, + 0, + ( + _SI, + _SCA, + _SEA, + _LC, + _MSRH, + _ME, + _VN, + _VFN, + _VFMo, + _RARA, + _CDh, + _ES, + _SS, + _PSAS, + _PSAR, + _MSCP, + ), + ( + (SESSION_ID, 0), + (DATE_TIME, 0), + (DATE_TIME, 0), + (MEDICAL_SCRIBE_LANGUAGE_CODE, 0), + (MEDICAL_SCRIBE_MEDIA_SAMPLE_RATE_HERTZ, 0), + (MEDICAL_SCRIBE_MEDIA_ENCODING, 0), + (VOCABULARY_NAME, 0), + (VOCABULARY_FILTER_NAME, 0), + (MEDICAL_SCRIBE_VOCABULARY_FILTER_METHOD, 0), + (IAM_ROLE_ARN, 0), + (MEDICAL_SCRIBE_CHANNEL_DEFINITIONS, 0), + (MEDICAL_SCRIBE_ENCRYPTION_SETTINGS, 0), + (MEDICAL_SCRIBE_STREAM_STATUS, 0), + (MEDICAL_SCRIBE_POST_STREAM_ANALYTICS_SETTINGS, 0), + (MEDICAL_SCRIBE_POST_STREAM_ANALYTICS_RESULT, 0), + (NULLABLE_BOOLEAN, 0), + ), ) -MEDICAL_SCRIBE_AUDIO_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#MedicalScribeAudioEvent"), - members={ - "AudioChunk": { - "target": AUDIO_CHUNK, - "traits": [ - Trait.new(id=ShapeID("smithy.api#eventPayload")), - Trait.new(id=ShapeID("smithy.api#required")), - ], - } - }, +GET_MEDICAL_SCRIBE_STREAM_OUTPUT: StaticSchema = ( + 18, + n0, + _GMSSO, + {_sSI: _cGMSSRo, _smithy: None}, + (_MSSD,), + ((MEDICAL_SCRIBE_STREAM_DETAILS, 0),), ) -PRONOUNS = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#Pronouns"), - shape_type=ShapeType.ENUM, - traits=[Trait.new(id=ShapeID("smithy.api#sensitive"))], - members={ - "HE_HIM": {"target": UNIT}, - "SHE_HER": {"target": UNIT}, - "THEY_THEM": {"target": UNIT}, - }, +RESOURCE_NOT_FOUND_EXCEPTION: StaticSchema = ( + 18, + n0, + _RNFE, + {_smit: _c, _sE: 404}, + (_M,), + ((STRING, 0),), ) -MEDICAL_SCRIBE_PATIENT_CONTEXT = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#MedicalScribePatientContext"), - members={"Pronouns": {"target": PRONOUNS}}, -) - -MEDICAL_SCRIBE_CONTEXT = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#MedicalScribeContext"), - members={"PatientContext": {"target": MEDICAL_SCRIBE_PATIENT_CONTEXT}}, -) - -MEDICAL_SCRIBE_CONFIGURATION_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#MedicalScribeConfigurationEvent"), - members={ - "VocabularyName": {"target": VOCABULARY_NAME}, - "VocabularyFilterName": {"target": VOCABULARY_FILTER_NAME}, - "VocabularyFilterMethod": {"target": MEDICAL_SCRIBE_VOCABULARY_FILTER_METHOD}, - "ResourceAccessRoleArn": { - "target": IAM_ROLE_ARN, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "ChannelDefinitions": {"target": MEDICAL_SCRIBE_CHANNEL_DEFINITIONS}, - "EncryptionSettings": {"target": MEDICAL_SCRIBE_ENCRYPTION_SETTINGS}, - "PostStreamAnalyticsSettings": { - "target": MEDICAL_SCRIBE_POST_STREAM_ANALYTICS_SETTINGS, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - }, - "MedicalScribeContext": {"target": MEDICAL_SCRIBE_CONTEXT}, +GET_MEDICAL_SCRIBE_STREAM: StaticOperationSchema = ( + 23, + n0, + _GMSS, + { + _smithya: MappingProxyType( + {"method": "GET", "uri": "/medical-scribe-stream/{SessionId}", "code": 200} + ) }, + GET_MEDICAL_SCRIBE_STREAM_INPUT, + GET_MEDICAL_SCRIBE_STREAM_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + INTERNAL_FAILURE_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + RESOURCE_NOT_FOUND_EXCEPTION, + ), ) -MEDICAL_SCRIBE_SESSION_CONTROL_EVENT_TYPE = Schema.collection( - id=ShapeID( - "com.amazonaws.transcribestreaming#MedicalScribeSessionControlEventType" +LANGUAGE_CODE: StaticSchema = ( + 14, + n0, + _LC, + 0, + ( + _EU, + _EG, + _EU_, + _FC, + _FF, + _EA, + _II, + _DD, + _PB, + _JJ, + _KK, + _ZC, + _TT, + _EE, + _AS_, + _PP, + _CE_, + _AA, + _HI, + _ZH, + _NN, + _NN_, + _SS_, + _PP_, + _FF_, + _ZT, + _EI, + _EI_, + _EN, + _EA_, + _EZ, + _EW, + _DC, + _AZ, + _EE_, + _HH, + _CC, + _DD_, + _FI, + _GE, + _EG_, + _HI_, + _II_, + _LL, + _MM, + _RR, + _RR_, + _SR, + _SS__, + _SS___, + _TP, + _UU, + _VV, + _ZZ, + _AE_, + _BB, + _BB_, + _BI, + _BB__, + _CI_, + _CI__, + _CW, + _EM, + _EE__, + _FA, + _GI, + _HH_, + _HH__, + _HA, + _II__, + _JI, + _KG, + _KD, + _KK_, + _KK__, + _KI, + _LI_, + _LL_, + _MM_, + _MI, + _MI_, + _MM__, + _NN__, + _OI, + _PI, + _PA, + _SL_, + _SS____, + _SA, + _SI_, + _SB, + _SK, + _SR_, + _ST_, + _SU, + _TI, + _TI_, + _TT_, + _UU_, + ), + ( + (-1, {_sV: _eU}), + (-1, {_sV: _eG}), + (-1, {_sV: _eU_}), + (-1, {_sV: _fC}), + (-1, {_sV: _fF}), + (-1, {_sV: _eA}), + (-1, {_sV: _iI}), + (-1, {_sV: _dD}), + (-1, {_sV: _pB}), + (-1, {_sV: _jJ}), + (-1, {_sV: _kK}), + (-1, {_sV: _zC}), + (-1, {_sV: _tT}), + (-1, {_sV: _eE}), + (-1, {_sV: _aS}), + (-1, {_sV: _pP}), + (-1, {_sV: _cE}), + (-1, {_sV: _aA}), + (-1, {_sV: _hI}), + (-1, {_sV: _zH}), + (-1, {_sV: _nN}), + (-1, {_sV: _nN_}), + (-1, {_sV: _sS}), + (-1, {_sV: _pP_}), + (-1, {_sV: _fF_}), + (-1, {_sV: _zT}), + (-1, {_sV: _eI}), + (-1, {_sV: _eI_}), + (-1, {_sV: _eN}), + (-1, {_sV: _eA_}), + (-1, {_sV: _eZ}), + (-1, {_sV: _eW}), + (-1, {_sV: _dC}), + (-1, {_sV: _aZ}), + (-1, {_sV: _eE_}), + (-1, {_sV: _hH}), + (-1, {_sV: _cC}), + (-1, {_sV: _dD_}), + (-1, {_sV: _fI}), + (-1, {_sV: _gE}), + (-1, {_sV: _eG_}), + (-1, {_sV: _hI_}), + (-1, {_sV: _iI_}), + (-1, {_sV: _lL}), + (-1, {_sV: _mM}), + (-1, {_sV: _rR}), + (-1, {_sV: _rR_}), + (-1, {_sV: _sR}), + (-1, {_sV: _sS_}), + (-1, {_sV: _sS__}), + (-1, {_sV: _tP}), + (-1, {_sV: _uU}), + (-1, {_sV: _vV}), + (-1, {_sV: _zZ}), + (-1, {_sV: _aE}), + (-1, {_sV: _bB}), + (-1, {_sV: _bB_}), + (-1, {_sV: _bI}), + (-1, {_sV: _bB__}), + (-1, {_sV: _cI}), + (-1, {_sV: _cI_}), + (-1, {_sV: _cW}), + (-1, {_sV: _eM}), + (-1, {_sV: _eE__}), + (-1, {_sV: _fA}), + (-1, {_sV: _gI}), + (-1, {_sV: _hH_}), + (-1, {_sV: _hH__}), + (-1, {_sV: _hA}), + (-1, {_sV: _iI__}), + (-1, {_sV: _jI}), + (-1, {_sV: _kG}), + (-1, {_sV: _kD}), + (-1, {_sV: _kK_}), + (-1, {_sV: _kK__}), + (-1, {_sV: _kI}), + (-1, {_sV: _lI}), + (-1, {_sV: _lL_}), + (-1, {_sV: _mM_}), + (-1, {_sV: _mI}), + (-1, {_sV: _mI_}), + (-1, {_sV: _mM__}), + (-1, {_sV: _nN__}), + (-1, {_sV: _oI}), + (-1, {_sV: _pI}), + (-1, {_sV: _pA}), + (-1, {_sV: _sL_}), + (-1, {_sV: _sS___}), + (-1, {_sV: _sA}), + (-1, {_sV: _sI}), + (-1, {_sV: _sB}), + (-1, {_sV: _sK}), + (-1, {_sV: _sR_}), + (-1, {_sV: _sT}), + (-1, {_sV: _sU}), + (-1, {_sV: _tI}), + (-1, {_sV: _tI_}), + (-1, {_sV: _tT_}), + (-1, {_sV: _uU_}), ), - shape_type=ShapeType.ENUM, - members={"END_OF_SESSION": {"target": UNIT}}, ) -MEDICAL_SCRIBE_SESSION_CONTROL_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#MedicalScribeSessionControlEvent"), - members={ - "Type": { - "target": MEDICAL_SCRIBE_SESSION_CONTROL_EVENT_TYPE, - "traits": [Trait.new(id=ShapeID("smithy.api#required"))], - } - }, +LANGUAGE_WITH_SCORE: StaticSchema = ( + 18, + n0, + _LWS, + 0, + (_LC, _Sc), + ((LANGUAGE_CODE, 0), (DOUBLE, {_s: 0})), +) + +LANGUAGE_IDENTIFICATION: StaticSchema = ( + 16, + n0, + _LI, + 0, + (_m,), + ((LANGUAGE_WITH_SCORE, 0),), +) + +LANGUAGE_OPTIONS: StaticSchema = (3, n0, _LO, 0) + +MEDIA_ENCODING: StaticSchema = ( + 14, + n0, + _ME, + 0, + (_PCM, _OO, _FLAC, _GA, _GU, _G), + ( + (-1, {_sV: _pc}), + (-1, {_sV: _oo}), + (-1, {_sV: _f}), + (-1, {_sV: _ga}), + (-1, {_sV: _gu}), + (-1, {_sV: _g}), + ), ) -MEDICAL_SCRIBE_INPUT_STREAM = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#MedicalScribeInputStream"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#streaming"))], - members={ - "AudioEvent": {"target": MEDICAL_SCRIBE_AUDIO_EVENT}, - "SessionControlEvent": {"target": MEDICAL_SCRIBE_SESSION_CONTROL_EVENT}, - "ConfigurationEvent": {"target": MEDICAL_SCRIBE_CONFIGURATION_EVENT}, - }, +MEDIA_SAMPLE_RATE_HERTZ: StaticSchema = (7, n0, _MSRH, 0) + +MEDICAL_ENTITY: StaticSchema = ( + 18, + n0, + _MEe, + 0, + (_ST, _ET, _Ca, _Co, _C), + ((DOUBLE, {_s: 0}), (DOUBLE, {_s: 0}), (STRING, 0), (STRING, 0), (CONFIDENCE, 0)), +) + +MEDICAL_ENTITY_LIST: StaticSchema = (16, n0, _MEL, 0, (_m,), ((MEDICAL_ENTITY, 0),)) + +MEDICAL_ITEM: StaticSchema = ( + 18, + n0, + _MIe, + 0, + (_ST, _ET, _T, _Co, _C, _Sp), + ( + (DOUBLE, {_s: 0}), + (DOUBLE, {_s: 0}), + (ITEM_TYPE, 0), + (STRING, 0), + (CONFIDENCE, 0), + (STRING, 0), + ), ) -MEDICAL_SCRIBE_TRANSCRIPT_ITEM_TYPE = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#MedicalScribeTranscriptItemType"), - shape_type=ShapeType.ENUM, - members={"PRONUNCIATION": {"target": UNIT}, "PUNCTUATION": {"target": UNIT}}, -) - -MEDICAL_SCRIBE_TRANSCRIPT_ITEM = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#MedicalScribeTranscriptItem"), - members={ - "BeginAudioTime": { - "target": DOUBLE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "EndAudioTime": { - "target": DOUBLE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "Type": {"target": MEDICAL_SCRIBE_TRANSCRIPT_ITEM_TYPE}, - "Confidence": {"target": CONFIDENCE}, - "Content": {"target": STRING}, - "VocabularyFilterMatch": {"target": NULLABLE_BOOLEAN}, - }, +MEDICAL_ITEM_LIST: StaticSchema = (16, n0, _MIL, 0, (_m,), ((MEDICAL_ITEM, 0),)) + +MEDICAL_ALTERNATIVE: StaticSchema = ( + 18, + n0, + _MA, + 0, + (_Tr, _It, _En), + ((STRING, 0), (MEDICAL_ITEM_LIST, 0), (MEDICAL_ENTITY_LIST, 0)), +) + +MEDICAL_ALTERNATIVE_LIST: StaticSchema = ( + 16, + n0, + _MAL, + 0, + (_m,), + ((MEDICAL_ALTERNATIVE, 0),), +) + +MEDICAL_CONTENT_IDENTIFICATION_TYPE: StaticSchema = ( + 14, + n0, + _MCIT, + 0, + (_PHI,), + ((-1, {_sV: _PHI}),), +) + +MEDICAL_RESULT: StaticSchema = ( + 18, + n0, + _MR, + 0, + (_RI, _ST, _ET, _IP, _Al, _CI), + ( + (STRING, 0), + (DOUBLE, {_s: 0}), + (DOUBLE, {_s: 0}), + (BOOLEAN, {_s: False}), + (MEDICAL_ALTERNATIVE_LIST, 0), + (STRING, 0), + ), ) -MEDICAL_SCRIBE_TRANSCRIPT_ITEM_LIST = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#MedicalScribeTranscriptItemList"), - shape_type=ShapeType.LIST, - members={"member": {"target": MEDICAL_SCRIBE_TRANSCRIPT_ITEM}}, -) - -MEDICAL_SCRIBE_TRANSCRIPT_SEGMENT = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#MedicalScribeTranscriptSegment"), - members={ - "SegmentId": {"target": STRING}, - "BeginAudioTime": { - "target": DOUBLE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "EndAudioTime": { - "target": DOUBLE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "Content": {"target": STRING}, - "Items": {"target": MEDICAL_SCRIBE_TRANSCRIPT_ITEM_LIST}, - "IsPartial": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "ChannelId": {"target": STRING}, - }, +MEDICAL_RESULT_LIST: StaticSchema = (16, n0, _MRL, 0, (_m,), ((MEDICAL_RESULT, 0),)) + +MEDICAL_SCRIBE_AUDIO_EVENT: StaticSchema = ( + 18, + n0, + _MSAE, + 0, + (_AC,), + ((AUDIO_CHUNK, {_sP: None, _sm: None}),), +) + +PRONOUNS: StaticSchema = ( + 14, + n0, + _P, + 4, + (_HH___, _SH, _TT__), + ((-1, {_sV: _HH___}), (-1, {_sV: _SH}), (-1, {_sV: _TT__})), +) + +MEDICAL_SCRIBE_PATIENT_CONTEXT: StaticSchema = ( + 18, + n0, + _MSPC, + 0, + (_P,), + ((PRONOUNS, 0),), +) + +MEDICAL_SCRIBE_CONTEXT: StaticSchema = ( + 18, + n0, + _MSC, + 0, + (_PC,), + ((MEDICAL_SCRIBE_PATIENT_CONTEXT, 0),), +) + +MEDICAL_SCRIBE_CONFIGURATION_EVENT: StaticSchema = ( + 18, + n0, + _MSCE, + 0, + (_VN, _VFN, _VFMo, _RARA, _CDh, _ES, _PSAS, _MSC), + ( + (VOCABULARY_NAME, 0), + (VOCABULARY_FILTER_NAME, 0), + (MEDICAL_SCRIBE_VOCABULARY_FILTER_METHOD, 0), + (IAM_ROLE_ARN, 1), + (MEDICAL_SCRIBE_CHANNEL_DEFINITIONS, 0), + (MEDICAL_SCRIBE_ENCRYPTION_SETTINGS, 0), + (MEDICAL_SCRIBE_POST_STREAM_ANALYTICS_SETTINGS, 1), + (MEDICAL_SCRIBE_CONTEXT, 0), + ), ) -MEDICAL_SCRIBE_TRANSCRIPT_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#MedicalScribeTranscriptEvent"), - members={"TranscriptSegment": {"target": MEDICAL_SCRIBE_TRANSCRIPT_SEGMENT}}, +MEDICAL_SCRIBE_SESSION_CONTROL_EVENT_TYPE: StaticSchema = ( + 14, + n0, + _MSSCET, + 0, + (_EOS,), + ((-1, {_sV: _EOS}),), +) + +MEDICAL_SCRIBE_SESSION_CONTROL_EVENT: StaticSchema = ( + 18, + n0, + _MSSCE, + 0, + (_T,), + ((MEDICAL_SCRIBE_SESSION_CONTROL_EVENT_TYPE, 1),), +) + +MEDICAL_SCRIBE_INPUT_STREAM: StaticSchema = ( + 19, + n0, + _MSIS, + {_smi: None}, + (_AE, _SCE, _CE), + ( + (MEDICAL_SCRIBE_AUDIO_EVENT, 0), + (MEDICAL_SCRIBE_SESSION_CONTROL_EVENT, 0), + (MEDICAL_SCRIBE_CONFIGURATION_EVENT, 0), + ), ) -MEDICAL_SCRIBE_RESULT_STREAM = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#MedicalScribeResultStream"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#streaming"))], - members={ - "TranscriptEvent": {"target": MEDICAL_SCRIBE_TRANSCRIPT_EVENT}, - "BadRequestException": {"target": BAD_REQUEST_EXCEPTION}, - "LimitExceededException": {"target": LIMIT_EXCEEDED_EXCEPTION}, - "InternalFailureException": {"target": INTERNAL_FAILURE_EXCEPTION}, - "ConflictException": {"target": CONFLICT_EXCEPTION}, - "ServiceUnavailableException": {"target": SERVICE_UNAVAILABLE_EXCEPTION}, - }, +MEDICAL_SCRIBE_TRANSCRIPT_ITEM_TYPE: StaticSchema = ( + 14, + n0, + _MSTIT, + 0, + (_PRONUNCIATION, _PUNCTUATION), + ((-1, {_sV: _p}), (-1, {_sV: _pu})), +) + +MEDICAL_SCRIBE_TRANSCRIPT_ITEM: StaticSchema = ( + 18, + n0, + _MSTI, + 0, + (_BAT, _EAT, _T, _C, _Co, _VFM), + ( + (DOUBLE, {_s: 0}), + (DOUBLE, {_s: 0}), + (MEDICAL_SCRIBE_TRANSCRIPT_ITEM_TYPE, 0), + (CONFIDENCE, 0), + (STRING, 0), + (NULLABLE_BOOLEAN, 0), + ), ) -MEDICAL_TRANSCRIPT = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#MedicalTranscript"), - members={"Results": {"target": MEDICAL_RESULT_LIST}}, +MEDICAL_SCRIBE_TRANSCRIPT_ITEM_LIST: StaticSchema = ( + 16, + n0, + _MSTIL, + 0, + (_m,), + ((MEDICAL_SCRIBE_TRANSCRIPT_ITEM, 0),), +) + +MEDICAL_SCRIBE_TRANSCRIPT_SEGMENT: StaticSchema = ( + 18, + n0, + _MSTS, + 0, + (_SIe, _BAT, _EAT, _Co, _It, _IP, _CI), + ( + (STRING, 0), + (DOUBLE, {_s: 0}), + (DOUBLE, {_s: 0}), + (STRING, 0), + (MEDICAL_SCRIBE_TRANSCRIPT_ITEM_LIST, 0), + (BOOLEAN, {_s: False}), + (STRING, 0), + ), ) -MEDICAL_TRANSCRIPT_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#MedicalTranscriptEvent"), - members={"Transcript": {"target": MEDICAL_TRANSCRIPT}}, +MEDICAL_SCRIBE_TRANSCRIPT_EVENT: StaticSchema = ( + 18, + n0, + _MSTE, + 0, + (_TS,), + ((MEDICAL_SCRIBE_TRANSCRIPT_SEGMENT, 0),), +) + +MEDICAL_SCRIBE_RESULT_STREAM: StaticSchema = ( + 19, + n0, + _MSRS, + {_smi: None}, + (_TE, _BRE, _LEE, _IFE, _CEo, _SUE), + ( + (MEDICAL_SCRIBE_TRANSCRIPT_EVENT, 0), + (BAD_REQUEST_EXCEPTION, 0), + (LIMIT_EXCEEDED_EXCEPTION, 0), + (INTERNAL_FAILURE_EXCEPTION, 0), + (CONFLICT_EXCEPTION, 0), + (SERVICE_UNAVAILABLE_EXCEPTION, 0), + ), ) -MEDICAL_TRANSCRIPT_RESULT_STREAM = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#MedicalTranscriptResultStream"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#streaming"))], - members={ - "TranscriptEvent": {"target": MEDICAL_TRANSCRIPT_EVENT}, - "BadRequestException": {"target": BAD_REQUEST_EXCEPTION}, - "LimitExceededException": {"target": LIMIT_EXCEEDED_EXCEPTION}, - "InternalFailureException": {"target": INTERNAL_FAILURE_EXCEPTION}, - "ConflictException": {"target": CONFLICT_EXCEPTION}, - "ServiceUnavailableException": {"target": SERVICE_UNAVAILABLE_EXCEPTION}, - }, +MEDICAL_TRANSCRIPT: StaticSchema = (18, n0, _MT, 0, (_R,), ((MEDICAL_RESULT_LIST, 0),)) + +MEDICAL_TRANSCRIPT_EVENT: StaticSchema = ( + 18, + n0, + _MTE, + 0, + (_Tr,), + ((MEDICAL_TRANSCRIPT, 0),), +) + +MEDICAL_TRANSCRIPT_RESULT_STREAM: StaticSchema = ( + 19, + n0, + _MTRS, + {_smi: None}, + (_TE, _BRE, _LEE, _IFE, _CEo, _SUE), + ( + (MEDICAL_TRANSCRIPT_EVENT, 0), + (BAD_REQUEST_EXCEPTION, 0), + (LIMIT_EXCEEDED_EXCEPTION, 0), + (INTERNAL_FAILURE_EXCEPTION, 0), + (CONFLICT_EXCEPTION, 0), + (SERVICE_UNAVAILABLE_EXCEPTION, 0), + ), ) -MODEL_NAME = Schema( - id=ShapeID("com.amazonaws.transcribestreaming#ModelName"), - shape_type=ShapeType.STRING, -) +MODEL_NAME: StaticSchema = (3, n0, _MN, 0) -NUMBER_OF_CHANNELS = Schema( - id=ShapeID("com.amazonaws.transcribestreaming#NumberOfChannels"), - shape_type=ShapeType.INTEGER, -) +NUMBER_OF_CHANNELS: StaticSchema = (7, n0, _NOC, 0) -PARTIAL_RESULTS_STABILITY = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#PartialResultsStability"), - shape_type=ShapeType.ENUM, - members={ - "HIGH": {"target": UNIT}, - "MEDIUM": {"target": UNIT}, - "LOW": {"target": UNIT}, - }, +PARTIAL_RESULTS_STABILITY: StaticSchema = ( + 14, + n0, + _PRS, + 0, + (_HIGH, _MEDIUM, _LOW), + ((-1, {_sV: _h}), (-1, {_sV: _me}), (-1, {_sV: _l})), ) -PII_ENTITY_TYPES = Schema( - id=ShapeID("com.amazonaws.transcribestreaming#PiiEntityTypes"), - shape_type=ShapeType.STRING, -) - -REQUEST_ID = Schema( - id=ShapeID("com.amazonaws.transcribestreaming#RequestId"), - shape_type=ShapeType.STRING, -) - -RESULT = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#Result"), - members={ - "ResultId": {"target": STRING}, - "StartTime": { - "target": DOUBLE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "EndTime": { - "target": DOUBLE, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=0)], - }, - "IsPartial": { - "target": BOOLEAN, - "traits": [Trait.new(id=ShapeID("smithy.api#default"), value=False)], - }, - "Alternatives": {"target": ALTERNATIVE_LIST}, - "ChannelId": {"target": STRING}, - "LanguageCode": {"target": LANGUAGE_CODE}, - "LanguageIdentification": {"target": LANGUAGE_IDENTIFICATION}, - }, -) +PII_ENTITY_TYPES: StaticSchema = (3, n0, _PET, 0) -RESULT_LIST = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#ResultList"), - shape_type=ShapeType.LIST, - members={"member": {"target": RESULT}}, -) +REQUEST_ID: StaticSchema = (3, n0, _RIe, 0) -SESSION_RESUME_WINDOW = Schema( - id=ShapeID("com.amazonaws.transcribestreaming#SessionResumeWindow"), - shape_type=ShapeType.INTEGER, +RESULT: StaticSchema = ( + 18, + n0, + _Re, + 0, + (_RI, _ST, _ET, _IP, _Al, _CI, _LC, _LI), + ( + (STRING, 0), + (DOUBLE, {_s: 0}), + (DOUBLE, {_s: 0}), + (BOOLEAN, {_s: False}), + (ALTERNATIVE_LIST, 0), + (STRING, 0), + (LANGUAGE_CODE, 0), + (LANGUAGE_IDENTIFICATION, 0), + ), ) -SPECIALTY = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#Specialty"), - shape_type=ShapeType.ENUM, - members={ - "PRIMARYCARE": {"target": UNIT}, - "CARDIOLOGY": {"target": UNIT}, - "NEUROLOGY": {"target": UNIT}, - "ONCOLOGY": {"target": UNIT}, - "RADIOLOGY": {"target": UNIT}, - "UROLOGY": {"target": UNIT}, - }, -) +RESULT_LIST: StaticSchema = (16, n0, _RL, 0, (_m,), ((RESULT, 0),)) -VOCABULARY_FILTER_METHOD = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#VocabularyFilterMethod"), - shape_type=ShapeType.ENUM, - members={ - "REMOVE": {"target": UNIT}, - "MASK": {"target": UNIT}, - "TAG": {"target": UNIT}, - }, -) +SESSION_RESUME_WINDOW: StaticSchema = (7, n0, _SRW, 0) -VOCABULARY_FILTER_NAMES = Schema( - id=ShapeID("com.amazonaws.transcribestreaming#VocabularyFilterNames"), - shape_type=ShapeType.STRING, +SPECIALTY: StaticSchema = ( + 14, + n0, + _Spe, + 0, + (_PRIMARYCARE, _CARDIOLOGY, _NEUROLOGY, _ONCOLOGY, _RADIOLOGY, _UROLOGY), + ( + (-1, {_sV: _PRIMARYCARE}), + (-1, {_sV: _CARDIOLOGY}), + (-1, {_sV: _NEUROLOGY}), + (-1, {_sV: _ONCOLOGY}), + (-1, {_sV: _RADIOLOGY}), + (-1, {_sV: _UROLOGY}), + ), ) -VOCABULARY_NAMES = Schema( - id=ShapeID("com.amazonaws.transcribestreaming#VocabularyNames"), - shape_type=ShapeType.STRING, +VOCABULARY_FILTER_METHOD: StaticSchema = ( + 14, + n0, + _VFMo, + 0, + (_REMOVE, _MASK, _TAG), + ((-1, {_sV: _re}), (-1, {_sV: _ma}), (-1, {_sV: _t})), +) + +VOCABULARY_FILTER_NAMES: StaticSchema = (3, n0, _VFNo, 0) + +VOCABULARY_NAMES: StaticSchema = (3, n0, _VNo, 0) + +START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_INPUT: StaticSchema = ( + 18, + n0, + _SCASTI, + {_sSI: _cSCASTR, _smith: None}, + ( + _LC, + _MSRH, + _ME, + _VN, + _SI, + _AS, + _VFN, + _VFMo, + _LMN, + _ILd, + _LO, + _PL, + _VNo, + _VFNo, + _EPRS, + _PRS, + _CIT, + _CRT, + _PET, + ), + ( + (CALL_ANALYTICS_LANGUAGE_CODE, {_sH: _xatlc}), + (MEDIA_SAMPLE_RATE_HERTZ, {_sH: _xatsr, _sm: None}), + (MEDIA_ENCODING, {_sH: _xatme, _sm: None}), + (VOCABULARY_NAME, {_sH: _xatvn}), + (SESSION_ID, {_sH: _xatsi}), + (AUDIO_STREAM, 17), + (VOCABULARY_FILTER_NAME, {_sH: _xatvfn}), + (VOCABULARY_FILTER_METHOD, {_sH: _xatvfm}), + (MODEL_NAME, {_sH: _xatlmn}), + (BOOLEAN, {_s: False, _sH: _xatil}), + (LANGUAGE_OPTIONS, {_sH: _xatlo}), + (CALL_ANALYTICS_LANGUAGE_CODE, {_sH: _xatpl}), + (VOCABULARY_NAMES, {_sH: _xatvn_}), + (VOCABULARY_FILTER_NAMES, {_sH: _xatvfn_}), + (BOOLEAN, {_s: False, _sH: _xateprs}), + (PARTIAL_RESULTS_STABILITY, {_sH: _xatprs}), + (CONTENT_IDENTIFICATION_TYPE, {_sH: _xatcit}), + (CONTENT_REDACTION_TYPE, {_sH: _xatcrt}), + (PII_ENTITY_TYPES, {_sH: _xatpet}), + ), ) -START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.transcribestreaming#StartCallAnalyticsStreamTranscriptionInput" +START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_OUTPUT: StaticSchema = ( + 18, + n0, + _SCASTO, + {_sSI: _cSCASTRo, _smithy: None}, + ( + _RIe, + _LC, + _MSRH, + _ME, + _VN, + _SI, + _CATRS, + _VFN, + _VFMo, + _LMN, + _ILd, + _LO, + _PL, + _VNo, + _VFNo, + _EPRS, + _PRS, + _CIT, + _CRT, + _PET, + ), + ( + (REQUEST_ID, {_sH: _xari}), + (CALL_ANALYTICS_LANGUAGE_CODE, {_sH: _xatlc}), + (MEDIA_SAMPLE_RATE_HERTZ, {_sH: _xatsr}), + (MEDIA_ENCODING, {_sH: _xatme}), + (VOCABULARY_NAME, {_sH: _xatvn}), + (SESSION_ID, {_sH: _xatsi}), + (CALL_ANALYTICS_TRANSCRIPT_RESULT_STREAM, 16), + (VOCABULARY_FILTER_NAME, {_sH: _xatvfn}), + (VOCABULARY_FILTER_METHOD, {_sH: _xatvfm}), + (MODEL_NAME, {_sH: _xatlmn}), + (BOOLEAN, {_s: False, _sH: _xatil}), + (LANGUAGE_OPTIONS, {_sH: _xatlo}), + (CALL_ANALYTICS_LANGUAGE_CODE, {_sH: _xatpl}), + (VOCABULARY_NAMES, {_sH: _xatvn_}), + (VOCABULARY_FILTER_NAMES, {_sH: _xatvfn_}), + (BOOLEAN, {_s: False, _sH: _xateprs}), + (PARTIAL_RESULTS_STABILITY, {_sH: _xatprs}), + (CONTENT_IDENTIFICATION_TYPE, {_sH: _xatcit}), + (CONTENT_REDACTION_TYPE, {_sH: _xatcrt}), + (PII_ENTITY_TYPES, {_sH: _xatpet}), ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.transcribestreaming#StartCallAnalyticsStreamTranscriptionRequest", - ) - ], - members={ - "LanguageCode": { - "target": CALL_ANALYTICS_LANGUAGE_CODE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-language-code", - ) - ], - }, - "MediaSampleRateHertz": { - "target": MEDIA_SAMPLE_RATE_HERTZ, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-sample-rate", - ), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "MediaEncoding": { - "target": MEDIA_ENCODING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-media-encoding", - ), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "VocabularyName": { - "target": VOCABULARY_NAME, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-vocabulary-name", - ) - ], - }, - "SessionId": { - "target": SESSION_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-session-id", - ) - ], - }, - "AudioStream": { - "target": AUDIO_STREAM, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpPayload")), - ], - }, - "VocabularyFilterName": { - "target": VOCABULARY_FILTER_NAME, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-vocabulary-filter-name", - ) - ], - }, - "VocabularyFilterMethod": { - "target": VOCABULARY_FILTER_METHOD, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-vocabulary-filter-method", - ) - ], - }, - "LanguageModelName": { - "target": MODEL_NAME, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-language-model-name", - ) - ], - }, - "IdentifyLanguage": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=False), - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-identify-language", - ), - ], - }, - "LanguageOptions": { - "target": LANGUAGE_OPTIONS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-language-options", - ) - ], - }, - "PreferredLanguage": { - "target": CALL_ANALYTICS_LANGUAGE_CODE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-preferred-language", - ) - ], - }, - "VocabularyNames": { - "target": VOCABULARY_NAMES, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-vocabulary-names", - ) - ], - }, - "VocabularyFilterNames": { - "target": VOCABULARY_FILTER_NAMES, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-vocabulary-filter-names", - ) - ], - }, - "EnablePartialResultsStabilization": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=False), - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-enable-partial-results-stabilization", - ), - ], - }, - "PartialResultsStability": { - "target": PARTIAL_RESULTS_STABILITY, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-partial-results-stability", - ) - ], - }, - "ContentIdentificationType": { - "target": CONTENT_IDENTIFICATION_TYPE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-content-identification-type", - ) - ], - }, - "ContentRedactionType": { - "target": CONTENT_REDACTION_TYPE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-content-redaction-type", - ) - ], - }, - "PiiEntityTypes": { - "target": PII_ENTITY_TYPES, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-pii-entity-types", - ) - ], - }, - }, ) -START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.transcribestreaming#StartCallAnalyticsStreamTranscriptionOutput" - ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.transcribestreaming#StartCallAnalyticsStreamTranscriptionResponse", +START_CALL_ANALYTICS_STREAM_TRANSCRIPTION: StaticOperationSchema = ( + 23, + n0, + _SCAST, + { + _smithya: MappingProxyType( + { + "method": "POST", + "uri": "/call-analytics-stream-transcription", + "code": 200, + } ) - ], - members={ - "RequestId": { - "target": REQUEST_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), value="x-amzn-request-id" - ) - ], - }, - "LanguageCode": { - "target": CALL_ANALYTICS_LANGUAGE_CODE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-language-code", - ) - ], - }, - "MediaSampleRateHertz": { - "target": MEDIA_SAMPLE_RATE_HERTZ, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-sample-rate", - ) - ], - }, - "MediaEncoding": { - "target": MEDIA_ENCODING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-media-encoding", - ) - ], - }, - "VocabularyName": { - "target": VOCABULARY_NAME, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-vocabulary-name", - ) - ], - }, - "SessionId": { - "target": SESSION_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-session-id", - ) - ], - }, - "CallAnalyticsTranscriptResultStream": { - "target": CALL_ANALYTICS_TRANSCRIPT_RESULT_STREAM, - "traits": [Trait.new(id=ShapeID("smithy.api#httpPayload"))], - }, - "VocabularyFilterName": { - "target": VOCABULARY_FILTER_NAME, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-vocabulary-filter-name", - ) - ], - }, - "VocabularyFilterMethod": { - "target": VOCABULARY_FILTER_METHOD, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-vocabulary-filter-method", - ) - ], - }, - "LanguageModelName": { - "target": MODEL_NAME, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-language-model-name", - ) - ], - }, - "IdentifyLanguage": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=False), - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-identify-language", - ), - ], - }, - "LanguageOptions": { - "target": LANGUAGE_OPTIONS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-language-options", - ) - ], - }, - "PreferredLanguage": { - "target": CALL_ANALYTICS_LANGUAGE_CODE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-preferred-language", - ) - ], - }, - "VocabularyNames": { - "target": VOCABULARY_NAMES, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-vocabulary-names", - ) - ], - }, - "VocabularyFilterNames": { - "target": VOCABULARY_FILTER_NAMES, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-vocabulary-filter-names", - ) - ], - }, - "EnablePartialResultsStabilization": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=False), - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-enable-partial-results-stabilization", - ), - ], - }, - "PartialResultsStability": { - "target": PARTIAL_RESULTS_STABILITY, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-partial-results-stability", - ) - ], - }, - "ContentIdentificationType": { - "target": CONTENT_IDENTIFICATION_TYPE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-content-identification-type", - ) - ], - }, - "ContentRedactionType": { - "target": CONTENT_REDACTION_TYPE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-content-redaction-type", - ) - ], - }, - "PiiEntityTypes": { - "target": PII_ENTITY_TYPES, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-pii-entity-types", - ) - ], - }, }, + START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_INPUT, + START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_FAILURE_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + SERVICE_UNAVAILABLE_EXCEPTION, + ), ) -START_CALL_ANALYTICS_STREAM_TRANSCRIPTION = Schema( - id=ShapeID( - "com.amazonaws.transcribestreaming#StartCallAnalyticsStreamTranscription" +START_MEDICAL_SCRIBE_STREAM_INPUT: StaticSchema = ( + 18, + n0, + _SMSSI, + {_sSI: _cSMSSR, _smith: None}, + (_SI, _LC, _MSRH, _ME, _IS), + ( + (SESSION_ID, {_sH: _xatsi}), + (MEDICAL_SCRIBE_LANGUAGE_CODE, {_sH: _xatlc, _sm: None}), + (MEDICAL_SCRIBE_MEDIA_SAMPLE_RATE_HERTZ, {_sH: _xatsr, _sm: None}), + (MEDICAL_SCRIBE_MEDIA_ENCODING, {_sH: _xatme, _sm: None}), + (MEDICAL_SCRIBE_INPUT_STREAM, 17), ), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - { - "method": "POST", - "uri": "/call-analytics-stream-transcription", - "code": 200, - } - ), - ) - ], ) -START_MEDICAL_SCRIBE_STREAM_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#StartMedicalScribeStreamInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.transcribestreaming#StartMedicalScribeStreamRequest", - ) - ], - members={ - "SessionId": { - "target": SESSION_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-session-id", - ) - ], - }, - "LanguageCode": { - "target": MEDICAL_SCRIBE_LANGUAGE_CODE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-language-code", - ), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "MediaSampleRateHertz": { - "target": MEDICAL_SCRIBE_MEDIA_SAMPLE_RATE_HERTZ, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-sample-rate", - ), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "MediaEncoding": { - "target": MEDICAL_SCRIBE_MEDIA_ENCODING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-media-encoding", - ), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "InputStream": { - "target": MEDICAL_SCRIBE_INPUT_STREAM, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpPayload")), - ], - }, - }, +START_MEDICAL_SCRIBE_STREAM_OUTPUT: StaticSchema = ( + 18, + n0, + _SMSSO, + {_sSI: _cSMSSRo, _smithy: None}, + (_SI, _RIe, _LC, _MSRH, _ME, _RS), + ( + (SESSION_ID, {_sH: _xatsi}), + (REQUEST_ID, {_sH: _xari}), + (MEDICAL_SCRIBE_LANGUAGE_CODE, {_sH: _xatlc}), + (MEDICAL_SCRIBE_MEDIA_SAMPLE_RATE_HERTZ, {_sH: _xatsr}), + (MEDICAL_SCRIBE_MEDIA_ENCODING, {_sH: _xatme}), + (MEDICAL_SCRIBE_RESULT_STREAM, 16), + ), ) -START_MEDICAL_SCRIBE_STREAM_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#StartMedicalScribeStreamOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.transcribestreaming#StartMedicalScribeStreamResponse", +START_MEDICAL_SCRIBE_STREAM: StaticOperationSchema = ( + 23, + n0, + _SMSS, + { + _smithya: MappingProxyType( + {"method": "POST", "uri": "/medical-scribe-stream", "code": 200} ) - ], - members={ - "SessionId": { - "target": SESSION_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-session-id", - ) - ], - }, - "RequestId": { - "target": REQUEST_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), value="x-amzn-request-id" - ) - ], - }, - "LanguageCode": { - "target": MEDICAL_SCRIBE_LANGUAGE_CODE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-language-code", - ) - ], - }, - "MediaSampleRateHertz": { - "target": MEDICAL_SCRIBE_MEDIA_SAMPLE_RATE_HERTZ, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-sample-rate", - ) - ], - }, - "MediaEncoding": { - "target": MEDICAL_SCRIBE_MEDIA_ENCODING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-media-encoding", - ) - ], - }, - "ResultStream": { - "target": MEDICAL_SCRIBE_RESULT_STREAM, - "traits": [Trait.new(id=ShapeID("smithy.api#httpPayload"))], - }, }, + START_MEDICAL_SCRIBE_STREAM_INPUT, + START_MEDICAL_SCRIBE_STREAM_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_FAILURE_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + SERVICE_UNAVAILABLE_EXCEPTION, + ), ) -START_MEDICAL_SCRIBE_STREAM = Schema( - id=ShapeID("com.amazonaws.transcribestreaming#StartMedicalScribeStream"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/medical-scribe-stream", "code": 200} - ), - ) - ], -) - -TYPE = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#Type"), - shape_type=ShapeType.ENUM, - members={"CONVERSATION": {"target": UNIT}, "DICTATION": {"target": UNIT}}, -) - -START_MEDICAL_STREAM_TRANSCRIPTION_INPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.transcribestreaming#StartMedicalStreamTranscriptionInput" +TYPE: StaticSchema = ( + 14, + n0, + _T, + 0, + (_CONVERSATION, _DICTATION), + ((-1, {_sV: _CONVERSATION}), (-1, {_sV: _DICTATION})), +) + +START_MEDICAL_STREAM_TRANSCRIPTION_INPUT: StaticSchema = ( + 18, + n0, + _SMSTI, + {_sSI: _cSMSTR, _smith: None}, + (_LC, _MSRH, _ME, _VN, _Spe, _T, _SSL, _SI, _AS, _ECI, _NOC, _CIT), + ( + (LANGUAGE_CODE, {_sH: _xatlc, _sm: None}), + (MEDIA_SAMPLE_RATE_HERTZ, {_sH: _xatsr, _sm: None}), + (MEDIA_ENCODING, {_sH: _xatme, _sm: None}), + (VOCABULARY_NAME, {_sH: _xatvn}), + (SPECIALTY, {_sH: _xats, _sm: None}), + (TYPE, {_sH: _xatt, _sm: None}), + (BOOLEAN, {_s: False, _sH: _xatssl}), + (SESSION_ID, {_sH: _xatsi}), + (AUDIO_STREAM, 17), + (BOOLEAN, {_s: False, _sH: _xateci}), + (NUMBER_OF_CHANNELS, {_sH: _xatnoc}), + (MEDICAL_CONTENT_IDENTIFICATION_TYPE, {_sH: _xatcit}), ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.transcribestreaming#StartMedicalStreamTranscriptionRequest", - ) - ], - members={ - "LanguageCode": { - "target": LANGUAGE_CODE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-language-code", - ), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "MediaSampleRateHertz": { - "target": MEDIA_SAMPLE_RATE_HERTZ, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-sample-rate", - ), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "MediaEncoding": { - "target": MEDIA_ENCODING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-media-encoding", - ), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "VocabularyName": { - "target": VOCABULARY_NAME, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-vocabulary-name", - ) - ], - }, - "Specialty": { - "target": SPECIALTY, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-specialty", - ), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "Type": { - "target": TYPE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), value="x-amzn-transcribe-type" - ), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "ShowSpeakerLabel": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=False), - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-show-speaker-label", - ), - ], - }, - "SessionId": { - "target": SESSION_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-session-id", - ) - ], - }, - "AudioStream": { - "target": AUDIO_STREAM, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpPayload")), - ], - }, - "EnableChannelIdentification": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=False), - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-enable-channel-identification", - ), - ], - }, - "NumberOfChannels": { - "target": NUMBER_OF_CHANNELS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-number-of-channels", - ) - ], - }, - "ContentIdentificationType": { - "target": MEDICAL_CONTENT_IDENTIFICATION_TYPE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-content-identification-type", - ) - ], - }, - }, ) -START_MEDICAL_STREAM_TRANSCRIPTION_OUTPUT = Schema.collection( - id=ShapeID( - "com.amazonaws.transcribestreaming#StartMedicalStreamTranscriptionOutput" +START_MEDICAL_STREAM_TRANSCRIPTION_OUTPUT: StaticSchema = ( + 18, + n0, + _SMSTO, + {_sSI: _cSMSTRo, _smithy: None}, + (_RIe, _LC, _MSRH, _ME, _VN, _Spe, _T, _SSL, _SI, _TRS, _ECI, _NOC, _CIT), + ( + (REQUEST_ID, {_sH: _xari}), + (LANGUAGE_CODE, {_sH: _xatlc}), + (MEDIA_SAMPLE_RATE_HERTZ, {_sH: _xatsr}), + (MEDIA_ENCODING, {_sH: _xatme}), + (VOCABULARY_NAME, {_sH: _xatvn}), + (SPECIALTY, {_sH: _xats}), + (TYPE, {_sH: _xatt}), + (BOOLEAN, {_s: False, _sH: _xatssl}), + (SESSION_ID, {_sH: _xatsi}), + (MEDICAL_TRANSCRIPT_RESULT_STREAM, 16), + (BOOLEAN, {_s: False, _sH: _xateci}), + (NUMBER_OF_CHANNELS, {_sH: _xatnoc}), + (MEDICAL_CONTENT_IDENTIFICATION_TYPE, {_sH: _xatcit}), ), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.transcribestreaming#StartMedicalStreamTranscriptionResponse", - ) - ], - members={ - "RequestId": { - "target": REQUEST_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), value="x-amzn-request-id" - ) - ], - }, - "LanguageCode": { - "target": LANGUAGE_CODE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-language-code", - ) - ], - }, - "MediaSampleRateHertz": { - "target": MEDIA_SAMPLE_RATE_HERTZ, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-sample-rate", - ) - ], - }, - "MediaEncoding": { - "target": MEDIA_ENCODING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-media-encoding", - ) - ], - }, - "VocabularyName": { - "target": VOCABULARY_NAME, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-vocabulary-name", - ) - ], - }, - "Specialty": { - "target": SPECIALTY, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-specialty", - ) - ], - }, - "Type": { - "target": TYPE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), value="x-amzn-transcribe-type" - ) - ], - }, - "ShowSpeakerLabel": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=False), - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-show-speaker-label", - ), - ], - }, - "SessionId": { - "target": SESSION_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-session-id", - ) - ], - }, - "TranscriptResultStream": { - "target": MEDICAL_TRANSCRIPT_RESULT_STREAM, - "traits": [Trait.new(id=ShapeID("smithy.api#httpPayload"))], - }, - "EnableChannelIdentification": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=False), - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-enable-channel-identification", - ), - ], - }, - "NumberOfChannels": { - "target": NUMBER_OF_CHANNELS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-number-of-channels", - ) - ], - }, - "ContentIdentificationType": { - "target": MEDICAL_CONTENT_IDENTIFICATION_TYPE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-content-identification-type", - ) - ], - }, - }, ) -START_MEDICAL_STREAM_TRANSCRIPTION = Schema( - id=ShapeID("com.amazonaws.transcribestreaming#StartMedicalStreamTranscription"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/medical-stream-transcription", "code": 200} - ), +START_MEDICAL_STREAM_TRANSCRIPTION: StaticOperationSchema = ( + 23, + n0, + _SMST, + { + _smithya: MappingProxyType( + {"method": "POST", "uri": "/medical-stream-transcription", "code": 200} ) - ], + }, + START_MEDICAL_STREAM_TRANSCRIPTION_INPUT, + START_MEDICAL_STREAM_TRANSCRIPTION_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_FAILURE_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + SERVICE_UNAVAILABLE_EXCEPTION, + ), ) -TRANSCRIPT_FORMAT = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#TranscriptFormat"), - shape_type=ShapeType.ENUM, - members={"SPOKEN": {"target": UNIT}, "WRITTEN": {"target": UNIT}}, +TRANSCRIPT_FORMAT: StaticSchema = ( + 14, + n0, + _TF, + 0, + (_SPOKEN, _WRITTEN), + ((-1, {_sV: _sp}), (-1, {_sV: _w})), +) + +START_STREAM_TRANSCRIPTION_INPUT: StaticSchema = ( + 18, + n0, + _SSTI, + {_sSI: _cSSTR, _smith: None}, + ( + _LC, + _MSRH, + _ME, + _VN, + _SI, + _AS, + _VFN, + _VFMo, + _SSL, + _ECI, + _NOC, + _EPRS, + _PRS, + _CIT, + _CRT, + _PET, + _LMN, + _ILd, + _LO, + _PL, + _IML, + _VNo, + _VFNo, + _SRW, + _TF, + ), + ( + (LANGUAGE_CODE, {_sH: _xatlc}), + (MEDIA_SAMPLE_RATE_HERTZ, {_sH: _xatsr, _sm: None}), + (MEDIA_ENCODING, {_sH: _xatme, _sm: None}), + (VOCABULARY_NAME, {_sH: _xatvn}), + (SESSION_ID, {_sH: _xatsi}), + (AUDIO_STREAM, 17), + (VOCABULARY_FILTER_NAME, {_sH: _xatvfn}), + (VOCABULARY_FILTER_METHOD, {_sH: _xatvfm}), + (BOOLEAN, {_s: False, _sH: _xatssl}), + (BOOLEAN, {_s: False, _sH: _xateci}), + (NUMBER_OF_CHANNELS, {_sH: _xatnoc}), + (BOOLEAN, {_s: False, _sH: _xateprs}), + (PARTIAL_RESULTS_STABILITY, {_sH: _xatprs}), + (CONTENT_IDENTIFICATION_TYPE, {_sH: _xatcit}), + (CONTENT_REDACTION_TYPE, {_sH: _xatcrt}), + (PII_ENTITY_TYPES, {_sH: _xatpet}), + (MODEL_NAME, {_sH: _xatlmn}), + (BOOLEAN, {_s: False, _sH: _xatil}), + (LANGUAGE_OPTIONS, {_sH: _xatlo}), + (LANGUAGE_CODE, {_sH: _xatpl}), + (BOOLEAN, {_s: False, _sH: _xatiml}), + (VOCABULARY_NAMES, {_sH: _xatvn_}), + (VOCABULARY_FILTER_NAMES, {_sH: _xatvfn_}), + (SESSION_RESUME_WINDOW, {_sH: _xatsrw}), + (TRANSCRIPT_FORMAT, {_sH: _xattf}), + ), ) -START_STREAM_TRANSCRIPTION_INPUT = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#StartStreamTranscriptionInput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.transcribestreaming#StartStreamTranscriptionRequest", - ) - ], - members={ - "LanguageCode": { - "target": LANGUAGE_CODE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-language-code", - ) - ], - }, - "MediaSampleRateHertz": { - "target": MEDIA_SAMPLE_RATE_HERTZ, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-sample-rate", - ), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "MediaEncoding": { - "target": MEDIA_ENCODING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-media-encoding", - ), - Trait.new(id=ShapeID("smithy.api#required")), - ], - }, - "VocabularyName": { - "target": VOCABULARY_NAME, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-vocabulary-name", - ) - ], - }, - "SessionId": { - "target": SESSION_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-session-id", - ) - ], - }, - "AudioStream": { - "target": AUDIO_STREAM, - "traits": [ - Trait.new(id=ShapeID("smithy.api#required")), - Trait.new(id=ShapeID("smithy.api#httpPayload")), - ], - }, - "VocabularyFilterName": { - "target": VOCABULARY_FILTER_NAME, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-vocabulary-filter-name", - ) - ], - }, - "VocabularyFilterMethod": { - "target": VOCABULARY_FILTER_METHOD, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-vocabulary-filter-method", - ) - ], - }, - "ShowSpeakerLabel": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=False), - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-show-speaker-label", - ), - ], - }, - "EnableChannelIdentification": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=False), - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-enable-channel-identification", - ), - ], - }, - "NumberOfChannels": { - "target": NUMBER_OF_CHANNELS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-number-of-channels", - ) - ], - }, - "EnablePartialResultsStabilization": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=False), - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-enable-partial-results-stabilization", - ), - ], - }, - "PartialResultsStability": { - "target": PARTIAL_RESULTS_STABILITY, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-partial-results-stability", - ) - ], - }, - "ContentIdentificationType": { - "target": CONTENT_IDENTIFICATION_TYPE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-content-identification-type", - ) - ], - }, - "ContentRedactionType": { - "target": CONTENT_REDACTION_TYPE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-content-redaction-type", - ) - ], - }, - "PiiEntityTypes": { - "target": PII_ENTITY_TYPES, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-pii-entity-types", - ) - ], - }, - "LanguageModelName": { - "target": MODEL_NAME, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-language-model-name", - ) - ], - }, - "IdentifyLanguage": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=False), - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-identify-language", - ), - ], - }, - "LanguageOptions": { - "target": LANGUAGE_OPTIONS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-language-options", - ) - ], - }, - "PreferredLanguage": { - "target": LANGUAGE_CODE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-preferred-language", - ) - ], - }, - "IdentifyMultipleLanguages": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=False), - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-identify-multiple-languages", - ), - ], - }, - "VocabularyNames": { - "target": VOCABULARY_NAMES, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-vocabulary-names", - ) - ], - }, - "VocabularyFilterNames": { - "target": VOCABULARY_FILTER_NAMES, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-vocabulary-filter-names", - ) - ], - }, - "SessionResumeWindow": { - "target": SESSION_RESUME_WINDOW, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-session-resume-window", - ) - ], - }, - "TranscriptFormat": { - "target": TRANSCRIPT_FORMAT, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-transcript-format", - ) - ], - }, - }, -) +TRANSCRIPT: StaticSchema = (18, n0, _Tr, 0, (_R,), ((RESULT_LIST, 0),)) -TRANSCRIPT = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#Transcript"), - members={"Results": {"target": RESULT_LIST}}, -) +TRANSCRIPT_EVENT: StaticSchema = (18, n0, _TE, 0, (_Tr,), ((TRANSCRIPT, 0),)) -TRANSCRIPT_EVENT = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#TranscriptEvent"), - members={"Transcript": {"target": TRANSCRIPT}}, +TRANSCRIPT_RESULT_STREAM: StaticSchema = ( + 19, + n0, + _TRS, + {_smi: None}, + (_TE, _BRE, _LEE, _IFE, _CEo, _SUE), + ( + (TRANSCRIPT_EVENT, 0), + (BAD_REQUEST_EXCEPTION, 0), + (LIMIT_EXCEEDED_EXCEPTION, 0), + (INTERNAL_FAILURE_EXCEPTION, 0), + (CONFLICT_EXCEPTION, 0), + (SERVICE_UNAVAILABLE_EXCEPTION, 0), + ), ) -TRANSCRIPT_RESULT_STREAM = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#TranscriptResultStream"), - shape_type=ShapeType.UNION, - traits=[Trait.new(id=ShapeID("smithy.api#streaming"))], - members={ - "TranscriptEvent": {"target": TRANSCRIPT_EVENT}, - "BadRequestException": {"target": BAD_REQUEST_EXCEPTION}, - "LimitExceededException": {"target": LIMIT_EXCEEDED_EXCEPTION}, - "InternalFailureException": {"target": INTERNAL_FAILURE_EXCEPTION}, - "ConflictException": {"target": CONFLICT_EXCEPTION}, - "ServiceUnavailableException": {"target": SERVICE_UNAVAILABLE_EXCEPTION}, - }, +START_STREAM_TRANSCRIPTION_OUTPUT: StaticSchema = ( + 18, + n0, + _SSTO, + {_sSI: _cSSTRo, _smithy: None}, + ( + _RIe, + _LC, + _MSRH, + _ME, + _VN, + _SI, + _TRS, + _VFN, + _VFMo, + _SSL, + _ECI, + _NOC, + _EPRS, + _PRS, + _CIT, + _CRT, + _PET, + _LMN, + _ILd, + _LO, + _PL, + _IML, + _VNo, + _VFNo, + _SRW, + _TF, + ), + ( + (REQUEST_ID, {_sH: _xari}), + (LANGUAGE_CODE, {_sH: _xatlc}), + (MEDIA_SAMPLE_RATE_HERTZ, {_sH: _xatsr}), + (MEDIA_ENCODING, {_sH: _xatme}), + (VOCABULARY_NAME, {_sH: _xatvn}), + (SESSION_ID, {_sH: _xatsi}), + (TRANSCRIPT_RESULT_STREAM, 16), + (VOCABULARY_FILTER_NAME, {_sH: _xatvfn}), + (VOCABULARY_FILTER_METHOD, {_sH: _xatvfm}), + (BOOLEAN, {_s: False, _sH: _xatssl}), + (BOOLEAN, {_s: False, _sH: _xateci}), + (NUMBER_OF_CHANNELS, {_sH: _xatnoc}), + (BOOLEAN, {_s: False, _sH: _xateprs}), + (PARTIAL_RESULTS_STABILITY, {_sH: _xatprs}), + (CONTENT_IDENTIFICATION_TYPE, {_sH: _xatcit}), + (CONTENT_REDACTION_TYPE, {_sH: _xatcrt}), + (PII_ENTITY_TYPES, {_sH: _xatpet}), + (MODEL_NAME, {_sH: _xatlmn}), + (BOOLEAN, {_s: False, _sH: _xatil}), + (LANGUAGE_OPTIONS, {_sH: _xatlo}), + (LANGUAGE_CODE, {_sH: _xatpl}), + (BOOLEAN, {_s: False, _sH: _xatiml}), + (VOCABULARY_NAMES, {_sH: _xatvn_}), + (VOCABULARY_FILTER_NAMES, {_sH: _xatvfn_}), + (SESSION_RESUME_WINDOW, {_sH: _xatsrw}), + (TRANSCRIPT_FORMAT, {_sH: _xattf}), + ), ) -START_STREAM_TRANSCRIPTION_OUTPUT = Schema.collection( - id=ShapeID("com.amazonaws.transcribestreaming#StartStreamTranscriptionOutput"), - traits=[ - Trait.new( - id=ShapeID("smithy.synthetic#originalShapeId"), - value="com.amazonaws.transcribestreaming#StartStreamTranscriptionResponse", +START_STREAM_TRANSCRIPTION: StaticOperationSchema = ( + 23, + n0, + _SST, + { + _smithya: MappingProxyType( + {"method": "POST", "uri": "/stream-transcription", "code": 200} ) - ], - members={ - "RequestId": { - "target": REQUEST_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), value="x-amzn-request-id" - ) - ], - }, - "LanguageCode": { - "target": LANGUAGE_CODE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-language-code", - ) - ], - }, - "MediaSampleRateHertz": { - "target": MEDIA_SAMPLE_RATE_HERTZ, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-sample-rate", - ) - ], - }, - "MediaEncoding": { - "target": MEDIA_ENCODING, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-media-encoding", - ) - ], - }, - "VocabularyName": { - "target": VOCABULARY_NAME, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-vocabulary-name", - ) - ], - }, - "SessionId": { - "target": SESSION_ID, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-session-id", - ) - ], - }, - "TranscriptResultStream": { - "target": TRANSCRIPT_RESULT_STREAM, - "traits": [Trait.new(id=ShapeID("smithy.api#httpPayload"))], - }, - "VocabularyFilterName": { - "target": VOCABULARY_FILTER_NAME, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-vocabulary-filter-name", - ) - ], - }, - "VocabularyFilterMethod": { - "target": VOCABULARY_FILTER_METHOD, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-vocabulary-filter-method", - ) - ], - }, - "ShowSpeakerLabel": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=False), - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-show-speaker-label", - ), - ], - }, - "EnableChannelIdentification": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=False), - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-enable-channel-identification", - ), - ], - }, - "NumberOfChannels": { - "target": NUMBER_OF_CHANNELS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-number-of-channels", - ) - ], - }, - "EnablePartialResultsStabilization": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=False), - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-enable-partial-results-stabilization", - ), - ], - }, - "PartialResultsStability": { - "target": PARTIAL_RESULTS_STABILITY, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-partial-results-stability", - ) - ], - }, - "ContentIdentificationType": { - "target": CONTENT_IDENTIFICATION_TYPE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-content-identification-type", - ) - ], - }, - "ContentRedactionType": { - "target": CONTENT_REDACTION_TYPE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-content-redaction-type", - ) - ], - }, - "PiiEntityTypes": { - "target": PII_ENTITY_TYPES, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-pii-entity-types", - ) - ], - }, - "LanguageModelName": { - "target": MODEL_NAME, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-language-model-name", - ) - ], - }, - "IdentifyLanguage": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=False), - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-identify-language", - ), - ], - }, - "LanguageOptions": { - "target": LANGUAGE_OPTIONS, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-language-options", - ) - ], - }, - "PreferredLanguage": { - "target": LANGUAGE_CODE, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-preferred-language", - ) - ], - }, - "IdentifyMultipleLanguages": { - "target": BOOLEAN, - "traits": [ - Trait.new(id=ShapeID("smithy.api#default"), value=False), - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-identify-multiple-languages", - ), - ], - }, - "VocabularyNames": { - "target": VOCABULARY_NAMES, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-vocabulary-names", - ) - ], - }, - "VocabularyFilterNames": { - "target": VOCABULARY_FILTER_NAMES, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-vocabulary-filter-names", - ) - ], - }, - "SessionResumeWindow": { - "target": SESSION_RESUME_WINDOW, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-session-resume-window", - ) - ], - }, - "TranscriptFormat": { - "target": TRANSCRIPT_FORMAT, - "traits": [ - Trait.new( - id=ShapeID("smithy.api#httpHeader"), - value="x-amzn-transcribe-transcript-format", - ) - ], - }, }, + START_STREAM_TRANSCRIPTION_INPUT, + START_STREAM_TRANSCRIPTION_OUTPUT, + ( + BAD_REQUEST_EXCEPTION, + CONFLICT_EXCEPTION, + INTERNAL_FAILURE_EXCEPTION, + LIMIT_EXCEEDED_EXCEPTION, + SERVICE_UNAVAILABLE_EXCEPTION, + ), ) -START_STREAM_TRANSCRIPTION = Schema( - id=ShapeID("com.amazonaws.transcribestreaming#StartStreamTranscription"), - shape_type=ShapeType.OPERATION, - traits=[ - Trait.new( - id=ShapeID("smithy.api#http"), - value=MappingProxyType( - {"method": "POST", "uri": "/stream-transcription", "code": 200} - ), - ) - ], -) - -TRANSCRIBE = Schema( - id=ShapeID("com.amazonaws.transcribestreaming#Transcribe"), - shape_type=ShapeType.SERVICE, - traits=[ - Trait.new( - id=ShapeID("aws.auth#sigv4"), value=MappingProxyType({"name": "transcribe"}) - ), - Trait.new( - id=ShapeID("smithy.rules#endpointBdd"), - value=MappingProxyType( - { - "version": "1.1", - "parameters": MappingProxyType( - { - "Region": MappingProxyType( - { - "builtIn": "AWS::Region", - "required": False, - "documentation": "The AWS region used to dispatch the request.", - "type": "string", - } - ), - "UseDualStack": MappingProxyType( - { - "builtIn": "AWS::UseDualStack", - "required": True, - "default": False, - "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", - "type": "boolean", - } - ), - "UseFIPS": MappingProxyType( - { - "builtIn": "AWS::UseFIPS", - "required": True, - "default": False, - "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", - "type": "boolean", - } - ), - "Endpoint": MappingProxyType( - { - "builtIn": "SDK::Endpoint", - "required": False, - "documentation": "Override the endpoint used to send this request", - "type": "string", - } - ), - } - ), - "conditions": ( - MappingProxyType( - { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "Endpoint"}),), - } - ), - MappingProxyType( - { - "fn": "isSet", - "argv": (MappingProxyType({"ref": "Region"}),), - } - ), - MappingProxyType( +TRANSCRIBE: StaticSchema = ( + 21, + n0, + _Tra, + { + _a: MappingProxyType({"name": "transcribe"}), + _sBm: MappingProxyType( + { + "version": "1.1", + "parameters": MappingProxyType( + { + "Region": MappingProxyType( { - "fn": "aws.partition", - "argv": (MappingProxyType({"ref": "Region"}),), - "assign": "PartitionResult", + "builtIn": "AWS::Region", + "required": False, + "documentation": "The AWS region used to dispatch the request.", + "type": "string", } ), - MappingProxyType( + "UseDualStack": MappingProxyType( { - "fn": "booleanEquals", - "argv": (MappingProxyType({"ref": "UseFIPS"}), True), + "builtIn": "AWS::UseDualStack", + "required": True, + "default": False, + "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", + "type": "boolean", } ), - MappingProxyType( + "UseFIPS": MappingProxyType( { - "fn": "booleanEquals", - "argv": ( - MappingProxyType({"ref": "UseDualStack"}), - True, - ), - } - ), - MappingProxyType( - { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "supportsDualStack", - ), - } - ), - True, - ), + "builtIn": "AWS::UseFIPS", + "required": True, + "default": False, + "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", + "type": "boolean", } ), - MappingProxyType( + "Endpoint": MappingProxyType( { - "fn": "booleanEquals", - "argv": ( - MappingProxyType( - { - "fn": "getAttr", - "argv": ( - MappingProxyType( - {"ref": "PartitionResult"} - ), - "supportsFIPS", - ), - } - ), - True, - ), + "builtIn": "SDK::Endpoint", + "required": False, + "documentation": "Override the endpoint used to send this request", + "type": "string", } ), + } + ), + "conditions": ( + MappingProxyType( + { + "fn": "isSet", + "argv": (MappingProxyType({"ref": "Endpoint"}),), + } ), - "results": ( - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: FIPS and custom endpoint are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": MappingProxyType({"ref": "Endpoint"}), - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://transcribestreaming-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "FIPS and DualStack are enabled, but this partition does not support one or both", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( - { - "url": "https://transcribestreaming-fips.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), - } - ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "FIPS is enabled but this partition does not support FIPS", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + MappingProxyType( + {"fn": "isSet", "argv": (MappingProxyType({"ref": "Region"}),)} + ), + MappingProxyType( + { + "fn": "aws.partition", + "argv": (MappingProxyType({"ref": "Region"}),), + "assign": "PartitionResult", + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": (MappingProxyType({"ref": "UseFIPS"}), True), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": (MappingProxyType({"ref": "UseDualStack"}), True), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( { - "url": "https://transcribestreaming.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "supportsDualStack", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "DualStack is enabled but this partition does not support DualStack", - "type": "error", - } - ), - MappingProxyType( - { - "conditions": (), - "endpoint": MappingProxyType( + True, + ), + } + ), + MappingProxyType( + { + "fn": "booleanEquals", + "argv": ( + MappingProxyType( { - "url": "https://transcribestreaming.{Region}.{PartitionResult#dnsSuffix}", - "properties": MappingProxyType({}), - "headers": MappingProxyType({}), + "fn": "getAttr", + "argv": ( + MappingProxyType( + {"ref": "PartitionResult"} + ), + "supportsFIPS", + ), } ), - "type": "endpoint", - } - ), - MappingProxyType( - { - "conditions": (), - "error": "Invalid Configuration: Missing Region", - "type": "error", - } - ), + True, + ), + } ), - "root": 2, - "nodeCount": 13, - "nodes": "/////wAAAAH/////AAAAAAAAAAwAAAADAAAAAQAAAAQF9eELAAAAAgAAAAUF9eELAAAAAwAAAAgAAAAGAAAABAAAAAcF9eEKAAAABQX14QgF9eEJAAAABAAAAAoAAAAJAAAABgX14QYF9eEHAAAABQAAAAsF9eEFAAAABgX14QQF9eEFAAAAAwX14QEAAAANAAAABAX14QIF9eED", - } - ), - ), - Trait.new( - id=ShapeID("aws.api#service"), - value=MappingProxyType( - { - "sdkId": "Transcribe Streaming", - "arnNamespace": "transcribe", - "cloudFormationName": "TranscribeStreaming", - "cloudTrailEventSource": "transcribestreaming.amazonaws.com", - "endpointPrefix": "transcribestreaming", - } - ), + ), + "results": ( + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: FIPS and custom endpoint are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": MappingProxyType({"ref": "Endpoint"}), + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://transcribestreaming-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS and DualStack are enabled, but this partition does not support one or both", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://transcribestreaming-fips.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "FIPS is enabled but this partition does not support FIPS", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://transcribestreaming.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "DualStack is enabled but this partition does not support DualStack", + "type": "error", + } + ), + MappingProxyType( + { + "conditions": (), + "endpoint": MappingProxyType( + { + "url": "https://transcribestreaming.{Region}.{PartitionResult#dnsSuffix}", + "properties": MappingProxyType[str, object]({}), + "headers": MappingProxyType[str, object]({}), + } + ), + "type": "endpoint", + } + ), + MappingProxyType( + { + "conditions": (), + "error": "Invalid Configuration: Missing Region", + "type": "error", + } + ), + ), + "root": 2, + "nodeCount": 13, + "nodes": "/////wAAAAH/////AAAAAAAAAAwAAAADAAAAAQAAAAQF9eELAAAAAgAAAAUF9eELAAAAAwAAAAgAAAAGAAAABAAAAAcF9eEKAAAABQX14QgF9eEJAAAABAAAAAoAAAAJAAAABgX14QYF9eEHAAAABQAAAAsF9eEFAAAABgX14QQF9eEFAAAAAwX14QEAAAANAAAABAX14QIF9eED", + } ), - Trait.new( - id=ShapeID("aws.protocols#restJson1"), - value=MappingProxyType( - {"http": ("http/1.1", "h2"), "eventStreamHttp": ("h2",)} - ), + _aw: MappingProxyType( + { + "sdkId": "Transcribe Streaming", + "arnNamespace": "transcribe", + "cloudFormationName": "TranscribeStreaming", + "cloudTrailEventSource": "transcribestreaming.amazonaws.com", + "endpointPrefix": "transcribestreaming", + } ), - ], + _aJ: MappingProxyType({"http": ("http/1.1", "h2"), "eventStreamHttp": ("h2",)}), + }, ) diff --git a/clients/aws-sdk-transcribe-streaming/src/aws_sdk_transcribe_streaming/client.py b/clients/aws-sdk-transcribe-streaming/src/aws_sdk_transcribe_streaming/client.py index c7ac5024..970cc9eb 100644 --- a/clients/aws-sdk-transcribe-streaming/src/aws_sdk_transcribe_streaming/client.py +++ b/clients/aws-sdk-transcribe-streaming/src/aws_sdk_transcribe_streaming/client.py @@ -1,19 +1,21 @@ # Code generated by smithy-python-codegen DO NOT EDIT. +from __future__ import annotations + from copy import deepcopy import logging from typing import Any, cast +from smithy_aws_core.aio.identity.chain import AsyncIdentityChain from smithy_aws_core.config import ConfigSource from smithy_aws_core.identity import AWSCredentialsIdentity -from smithy_aws_core.identity.chain import IdentityChain -from smithy_core.aio.client import AsyncClient, ClientCall, RequestPipeline -from smithy_core.aio.eventstream import DuplexEventStream +from smithy_core.aio.client import AsyncClient, AsyncClientCall, AsyncRequestPipeline +from smithy_core.aio.eventstream import AsyncDuplexEventStream from smithy_core.deserializers import DeserializeableShape from smithy_core.exceptions import ExpectationNotMetError from smithy_core.schemas import APIOperation from smithy_core.serializers import SerializeableShape -from smithy_http.aio.interfaces import HTTPClient +from smithy_http.aio.interfaces import AsyncHTTPClient from smithy_http.plugins import user_agent_plugin from .config import AsyncTranscribeStreamingConfig, Plugin @@ -21,8 +23,6 @@ AudioStream, CallAnalyticsTranscriptResultStream, GET_MEDICAL_SCRIBE_STREAM, - GetMedicalScribeStreamInput, - GetMedicalScribeStreamOutput, MedicalScribeInputStream, MedicalScribeResultStream, MedicalTranscriptResultStream, @@ -46,6 +46,11 @@ ) from .user_agent import aws_user_agent_plugin +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .models import GetMedicalScribeStreamInput, GetMedicalScribeStreamOutput + logger = logging.getLogger(__name__) @@ -131,12 +136,12 @@ async def _post_setup(self, config: AsyncTranscribeStreamingConfig) -> None: config_file = await config_context.parsed_profiles() if config_context.profile_source is ConfigSource.OVERRIDE: profile_name = config_context.profile_name - config.aws_credentials_identity_resolver = await IdentityChain.create( + config.aws_credentials_identity_resolver = await AsyncIdentityChain.create( AWSCredentialsIdentity, config_file=config_file, profile_name=profile_name, region_override=config.region, - http_client=cast(HTTPClient | None, config.transport), + http_client=cast(AsyncHTTPClient | None, config.transport), ) async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( @@ -145,7 +150,7 @@ async def _prepare_call[I: SerializeableShape, O: DeserializeableShape]( operation: APIOperation[I, O], default_plugins: list[Plugin], plugins: list[Plugin] | None, - ) -> tuple[RequestPipeline[Any, Any], ClientCall[I, O]]: + ) -> tuple[AsyncRequestPipeline[Any, Any], AsyncClientCall[I, O]]: if self._closed: raise RuntimeError( "Cannot invoke an operation on a client that has been closed." @@ -210,7 +215,7 @@ async def start_call_analytics_stream_transcription( self, input: StartCallAnalyticsStreamTranscriptionInput, plugins: list[Plugin] | None = None, - ) -> DuplexEventStream[ + ) -> AsyncDuplexEventStream[ AudioStream, CallAnalyticsTranscriptResultStream, StartCallAnalyticsStreamTranscriptionOutput, @@ -244,7 +249,7 @@ async def start_call_analytics_stream_transcription( invocations. Returns: - A `DuplexEventStream` for bidirectional streaming. + An `AsyncDuplexEventStream` for bidirectional streaming. """ pipeline, call = await self._prepare_call( input, START_CALL_ANALYTICS_STREAM_TRANSCRIPTION, [], plugins @@ -258,7 +263,7 @@ async def start_call_analytics_stream_transcription( async def start_medical_scribe_stream( self, input: StartMedicalScribeStreamInput, plugins: list[Plugin] | None = None - ) -> DuplexEventStream[ + ) -> AsyncDuplexEventStream[ MedicalScribeInputStream, MedicalScribeResultStream, StartMedicalScribeStreamOutput, @@ -312,7 +317,7 @@ async def start_medical_scribe_stream( invocations. Returns: - A `DuplexEventStream` for bidirectional streaming. + An `AsyncDuplexEventStream` for bidirectional streaming. """ pipeline, call = await self._prepare_call( input, START_MEDICAL_SCRIBE_STREAM, [], plugins @@ -328,7 +333,7 @@ async def start_medical_stream_transcription( self, input: StartMedicalStreamTranscriptionInput, plugins: list[Plugin] | None = None, - ) -> DuplexEventStream[ + ) -> AsyncDuplexEventStream[ AudioStream, MedicalTranscriptResultStream, StartMedicalStreamTranscriptionOutput, @@ -360,7 +365,7 @@ async def start_medical_stream_transcription( invocations. Returns: - A `DuplexEventStream` for bidirectional streaming. + An `AsyncDuplexEventStream` for bidirectional streaming. """ pipeline, call = await self._prepare_call( input, START_MEDICAL_STREAM_TRANSCRIPTION, [], plugins @@ -374,7 +379,7 @@ async def start_medical_stream_transcription( async def start_stream_transcription( self, input: StartStreamTranscriptionInput, plugins: list[Plugin] | None = None - ) -> DuplexEventStream[ + ) -> AsyncDuplexEventStream[ AudioStream, TranscriptResultStream, StartStreamTranscriptionOutput ]: """ @@ -404,7 +409,7 @@ async def start_stream_transcription( invocations. Returns: - A `DuplexEventStream` for bidirectional streaming. + An `AsyncDuplexEventStream` for bidirectional streaming. """ pipeline, call = await self._prepare_call( input, START_STREAM_TRANSCRIPTION, [], plugins diff --git a/clients/aws-sdk-transcribe-streaming/src/aws_sdk_transcribe_streaming/config.py b/clients/aws-sdk-transcribe-streaming/src/aws_sdk_transcribe_streaming/config.py index b08dcc3d..db895a2c 100644 --- a/clients/aws-sdk-transcribe-streaming/src/aws_sdk_transcribe_streaming/config.py +++ b/clients/aws-sdk-transcribe-streaming/src/aws_sdk_transcribe_streaming/config.py @@ -1,78 +1,95 @@ # Code generated by smithy-python-codegen DO NOT EDIT. from dataclasses import dataclass, field -from typing import Any, Callable, ClassVar, Self, TypeAlias, Union, Unpack +from typing import ( + Any, + Callable, + ClassVar, + Self, + TYPE_CHECKING, + TypeAlias, + Union, + Unpack, +) -from smithy_aws_core.aio.protocols import RestJsonClientProtocol -from smithy_aws_core.auth import SigV4AuthScheme -from smithy_aws_core.config import AwsConfigOverrides, FileSystem -from smithy_aws_core.config.aws_config import AsyncAwsConfig -from smithy_aws_core.config.resolvers import EndpointUriResolver -from smithy_aws_core.config.types import FieldSpec -from smithy_aws_core.endpoints.standard_regional import ( - StandardRegionalEndpointsResolver, +from smithy_aws_core.aio.auth.sigv4 import AsyncSigV4AuthScheme +from smithy_aws_core.aio.config import AsyncFileSystem +from smithy_aws_core.aio.config.aws_config import AsyncAwsConfig, AwsConfigOverrides +from smithy_aws_core.aio.config.resolvers import EndpointUriResolver +from smithy_aws_core.aio.endpoints.standard_regional import ( + AsyncStandardRegionalEndpointsResolver, ) +from smithy_aws_core.aio.protocols import AsyncRestJsonClientProtocol +from smithy_aws_core.config.types import FieldSpec from smithy_aws_core.identity import AWSCredentialsIdentity, AWSIdentityProperties -from smithy_core.aio.interfaces import ( - ClientProtocol, - EndpointResolver, - ProtocolConstructor, - ProtocolSettings, -) -from smithy_core.aio.interfaces.auth import AuthScheme -from smithy_core.aio.interfaces.identity import IdentityResolver -from smithy_core.interceptors import Interceptor +from smithy_core.aio.interfaces import AsyncClientProtocol, AsyncEndpointResolver +from smithy_core.aio.interfaces.auth import AsyncAuthScheme +from smithy_core.aio.interfaces.identity import AsyncIdentityResolver +from smithy_core.interfaces import ProtocolConstructor, ProtocolSettings from smithy_core.interfaces.auth import AuthSchemeResolver from smithy_core.shapes import ShapeID from smithy_http.aio.aiohttp import AIOHTTPClient +from ._private.schemas import TRANSCRIBE from .auth import HTTPAuthSchemeResolver -from .models import ( - GetMedicalScribeStreamInput, - GetMedicalScribeStreamOutput, - StartCallAnalyticsStreamTranscriptionInput, - StartCallAnalyticsStreamTranscriptionOutput, - StartMedicalScribeStreamInput, - StartMedicalScribeStreamOutput, - StartMedicalStreamTranscriptionInput, - StartMedicalStreamTranscriptionOutput, - StartStreamTranscriptionInput, - StartStreamTranscriptionOutput, -) -_ServiceInterceptor = Union[ - Interceptor[GetMedicalScribeStreamInput, GetMedicalScribeStreamOutput, Any, Any], - Interceptor[ +if TYPE_CHECKING: + from smithy_core.interceptors import Interceptor + from .models import ( + GetMedicalScribeStreamInput, + GetMedicalScribeStreamOutput, StartCallAnalyticsStreamTranscriptionInput, StartCallAnalyticsStreamTranscriptionOutput, - Any, - Any, - ], - Interceptor[ - StartMedicalScribeStreamInput, StartMedicalScribeStreamOutput, Any, Any - ], - Interceptor[ + StartMedicalScribeStreamInput, + StartMedicalScribeStreamOutput, StartMedicalStreamTranscriptionInput, StartMedicalStreamTranscriptionOutput, - Any, - Any, - ], - Interceptor[ - StartStreamTranscriptionInput, StartStreamTranscriptionOutput, Any, Any - ], -] + StartStreamTranscriptionInput, + StartStreamTranscriptionOutput, + ) + + _ServiceInterceptor = Union[ + Interceptor[ + GetMedicalScribeStreamInput, GetMedicalScribeStreamOutput, Any, Any + ], + Interceptor[ + StartCallAnalyticsStreamTranscriptionInput, + StartCallAnalyticsStreamTranscriptionOutput, + Any, + Any, + ], + Interceptor[ + StartMedicalScribeStreamInput, StartMedicalScribeStreamOutput, Any, Any + ], + Interceptor[ + StartMedicalStreamTranscriptionInput, + StartMedicalStreamTranscriptionOutput, + Any, + Any, + ], + Interceptor[ + StartStreamTranscriptionInput, StartStreamTranscriptionOutput, Any, Any + ], + ] +else: + _ServiceInterceptor = Any + _PROTOCOL_SETTINGS = ProtocolSettings( - namespace="com.amazonaws.transcribestreaming", service_target="Transcribe" + namespace="com.amazonaws.transcribestreaming", + service_target="Transcribe", + service_schema=TRANSCRIBE, ) class _AsyncTranscribeStreamingConfigOverrides(AwsConfigOverrides, total=False): - endpoint_resolver: EndpointResolver | None + endpoint_resolver: AsyncEndpointResolver | None protocol: ( - ClientProtocol[Any, Any] | ProtocolConstructor[ClientProtocol[Any, Any]] | None + AsyncClientProtocol[Any, Any] + | ProtocolConstructor[AsyncClientProtocol[Any, Any]] + | None ) - auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None + auth_schemes: dict[ShapeID, AsyncAuthScheme[Any, Any, Any, Any]] | None auth_scheme_resolver: AuthSchemeResolver | None @@ -80,17 +97,17 @@ class _AsyncTranscribeStreamingConfigOverrides(AwsConfigOverrides, total=False): class AsyncTranscribeStreamingConfig(AsyncAwsConfig): """Transcribe Streaming configuration (async-resolved).""" - endpoint_resolver: EndpointResolver | None = None + endpoint_resolver: AsyncEndpointResolver | None = None """ The endpoint resolver used to resolve the final endpoint per-operation based on the configuration. """ - protocol: ClientProtocol[Any, Any] | None = None + protocol: AsyncClientProtocol[Any, Any] | None = None """ Pass a protocol class reference from smithy_aws_core.aio.protocols to - select the protocol, e.g. protocol=AwsJson10ClientProtocol. For custom - protocols a protocol instance may also be passed. + select the protocol, e.g. protocol=AsyncAwsJson10ClientProtocol. For + custom protocols a protocol instance may also be passed. """ interceptors: list[_ServiceInterceptor] = field(default_factory=lambda: []) @@ -99,7 +116,7 @@ class AsyncTranscribeStreamingConfig(AsyncAwsConfig): execution of a request. """ - auth_schemes: dict[ShapeID, AuthScheme[Any, Any, Any, Any]] | None = None + auth_schemes: dict[ShapeID, AsyncAuthScheme[Any, Any, Any, Any]] | None = None """A map of auth scheme ids to auth schemes.""" auth_scheme_resolver: AuthSchemeResolver | None = None @@ -109,7 +126,7 @@ class AsyncTranscribeStreamingConfig(AsyncAwsConfig): """ aws_credentials_identity_resolver: ( - IdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None + AsyncIdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] | None ) = None """Resolves AWS Credentials. Required for operations that use Sigv4 Auth.""" @@ -150,24 +167,24 @@ class AsyncTranscribeStreamingConfig(AsyncAwsConfig): default=None, resolver=EndpointUriResolver("transcribe_streaming") ), "endpoint_resolver": FieldSpec( - default_factory=lambda: StandardRegionalEndpointsResolver( + default_factory=lambda: AsyncStandardRegionalEndpointsResolver( endpoint_prefix="transcribestreaming" ) ), "protocol": FieldSpec( - default_factory=lambda: RestJsonClientProtocol(_PROTOCOL_SETTINGS), + default_factory=lambda: AsyncRestJsonClientProtocol(_PROTOCOL_SETTINGS), converter=lambda p: p(_PROTOCOL_SETTINGS) if isinstance(p, type) else p, ), "auth_schemes": FieldSpec( default_factory=lambda: { - ShapeID("aws.auth#sigv4"): SigV4AuthScheme(service="transcribe") + ShapeID("aws.auth#sigv4"): AsyncSigV4AuthScheme(service="transcribe") } ), "auth_scheme_resolver": FieldSpec(default_factory=HTTPAuthSchemeResolver), "transport": FieldSpec(default_factory=lambda: AIOHTTPClient()), } - def set_auth_scheme(self, scheme: AuthScheme[Any, Any, Any, Any]) -> None: + def set_auth_scheme(self, scheme: AsyncAuthScheme[Any, Any, Any, Any]) -> None: """ Set an auth scheme implementation using its scheme ID. :param scheme: The auth scheme to add or replace. @@ -181,7 +198,7 @@ async def resolve( # pyright: ignore[reportIncompatibleMethodOverride] cls, *, profile: str | None = None, - fs: FileSystem | None = None, + fs: AsyncFileSystem | None = None, config_file_path: str | None = None, credentials_file_path: str | None = None, **overrides: Unpack[_AsyncTranscribeStreamingConfigOverrides], diff --git a/clients/aws-sdk-transcribe-streaming/src/aws_sdk_transcribe_streaming/models.py b/clients/aws-sdk-transcribe-streaming/src/aws_sdk_transcribe_streaming/models.py index 828cce0e..948729b5 100644 --- a/clients/aws-sdk-transcribe-streaming/src/aws_sdk_transcribe_streaming/models.py +++ b/clients/aws-sdk-transcribe-streaming/src/aws_sdk_transcribe_streaming/models.py @@ -1,93 +1,36 @@ # Code generated by smithy-python-codegen DO NOT EDIT. -from dataclasses import dataclass, field -from datetime import datetime -from enum import StrEnum -import logging -from typing import Any, Literal, Self, Union +from __future__ import annotations -from smithy_core.deserializers import ShapeDeserializer -from smithy_core.documents import TypeRegistry -from smithy_core.exceptions import ModeledError, SerializationError -from smithy_core.response import EMPTY_RESPONSE_METADATA, ResponseMetadata -from smithy_core.schemas import APIOperation, Schema -from smithy_core.serializers import ShapeSerializer +from ._private import schemas as _schemas +from smithy_core._dynamic_models import ModelRegistry +from smithy_core.exceptions import ModeledError +from smithy_core.schemas import APIOperation from smithy_core.shapes import ShapeID -from smithy_core.types import UnknownEnumMixin from ._private.schemas import ( - ALTERNATIVE as _SCHEMA_ALTERNATIVE, - AUDIO_EVENT as _SCHEMA_AUDIO_EVENT, - AUDIO_STREAM as _SCHEMA_AUDIO_STREAM, - BAD_REQUEST_EXCEPTION as _SCHEMA_BAD_REQUEST_EXCEPTION, - CALL_ANALYTICS_ENTITY as _SCHEMA_CALL_ANALYTICS_ENTITY, - CALL_ANALYTICS_ITEM as _SCHEMA_CALL_ANALYTICS_ITEM, - CALL_ANALYTICS_LANGUAGE_WITH_SCORE as _SCHEMA_CALL_ANALYTICS_LANGUAGE_WITH_SCORE, - CALL_ANALYTICS_TRANSCRIPT_RESULT_STREAM as _SCHEMA_CALL_ANALYTICS_TRANSCRIPT_RESULT_STREAM, - CATEGORY_EVENT as _SCHEMA_CATEGORY_EVENT, - CHANNEL_DEFINITION as _SCHEMA_CHANNEL_DEFINITION, - CHARACTER_OFFSETS as _SCHEMA_CHARACTER_OFFSETS, - CLINICAL_NOTE_GENERATION_RESULT as _SCHEMA_CLINICAL_NOTE_GENERATION_RESULT, - CLINICAL_NOTE_GENERATION_SETTINGS as _SCHEMA_CLINICAL_NOTE_GENERATION_SETTINGS, - CONFIGURATION_EVENT as _SCHEMA_CONFIGURATION_EVENT, - CONFLICT_EXCEPTION as _SCHEMA_CONFLICT_EXCEPTION, - ENTITY as _SCHEMA_ENTITY, GET_MEDICAL_SCRIBE_STREAM as _SCHEMA_GET_MEDICAL_SCRIBE_STREAM, - GET_MEDICAL_SCRIBE_STREAM_INPUT as _SCHEMA_GET_MEDICAL_SCRIBE_STREAM_INPUT, - GET_MEDICAL_SCRIBE_STREAM_OUTPUT as _SCHEMA_GET_MEDICAL_SCRIBE_STREAM_OUTPUT, - INTERNAL_FAILURE_EXCEPTION as _SCHEMA_INTERNAL_FAILURE_EXCEPTION, - ISSUE_DETECTED as _SCHEMA_ISSUE_DETECTED, - ITEM as _SCHEMA_ITEM, - LANGUAGE_WITH_SCORE as _SCHEMA_LANGUAGE_WITH_SCORE, - LIMIT_EXCEEDED_EXCEPTION as _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - MEDICAL_ALTERNATIVE as _SCHEMA_MEDICAL_ALTERNATIVE, - MEDICAL_ENTITY as _SCHEMA_MEDICAL_ENTITY, - MEDICAL_ITEM as _SCHEMA_MEDICAL_ITEM, - MEDICAL_RESULT as _SCHEMA_MEDICAL_RESULT, - MEDICAL_SCRIBE_AUDIO_EVENT as _SCHEMA_MEDICAL_SCRIBE_AUDIO_EVENT, - MEDICAL_SCRIBE_CHANNEL_DEFINITION as _SCHEMA_MEDICAL_SCRIBE_CHANNEL_DEFINITION, - MEDICAL_SCRIBE_CONFIGURATION_EVENT as _SCHEMA_MEDICAL_SCRIBE_CONFIGURATION_EVENT, - MEDICAL_SCRIBE_CONTEXT as _SCHEMA_MEDICAL_SCRIBE_CONTEXT, - MEDICAL_SCRIBE_ENCRYPTION_SETTINGS as _SCHEMA_MEDICAL_SCRIBE_ENCRYPTION_SETTINGS, - MEDICAL_SCRIBE_INPUT_STREAM as _SCHEMA_MEDICAL_SCRIBE_INPUT_STREAM, - MEDICAL_SCRIBE_PATIENT_CONTEXT as _SCHEMA_MEDICAL_SCRIBE_PATIENT_CONTEXT, - MEDICAL_SCRIBE_POST_STREAM_ANALYTICS_RESULT as _SCHEMA_MEDICAL_SCRIBE_POST_STREAM_ANALYTICS_RESULT, - MEDICAL_SCRIBE_POST_STREAM_ANALYTICS_SETTINGS as _SCHEMA_MEDICAL_SCRIBE_POST_STREAM_ANALYTICS_SETTINGS, - MEDICAL_SCRIBE_RESULT_STREAM as _SCHEMA_MEDICAL_SCRIBE_RESULT_STREAM, - MEDICAL_SCRIBE_SESSION_CONTROL_EVENT as _SCHEMA_MEDICAL_SCRIBE_SESSION_CONTROL_EVENT, - MEDICAL_SCRIBE_STREAM_DETAILS as _SCHEMA_MEDICAL_SCRIBE_STREAM_DETAILS, - MEDICAL_SCRIBE_TRANSCRIPT_EVENT as _SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_EVENT, - MEDICAL_SCRIBE_TRANSCRIPT_ITEM as _SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_ITEM, - MEDICAL_SCRIBE_TRANSCRIPT_SEGMENT as _SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_SEGMENT, - MEDICAL_TRANSCRIPT as _SCHEMA_MEDICAL_TRANSCRIPT, - MEDICAL_TRANSCRIPT_EVENT as _SCHEMA_MEDICAL_TRANSCRIPT_EVENT, - MEDICAL_TRANSCRIPT_RESULT_STREAM as _SCHEMA_MEDICAL_TRANSCRIPT_RESULT_STREAM, - POINTS_OF_INTEREST as _SCHEMA_POINTS_OF_INTEREST, - POST_CALL_ANALYTICS_SETTINGS as _SCHEMA_POST_CALL_ANALYTICS_SETTINGS, - RESOURCE_NOT_FOUND_EXCEPTION as _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - RESULT as _SCHEMA_RESULT, - SERVICE_UNAVAILABLE_EXCEPTION as _SCHEMA_SERVICE_UNAVAILABLE_EXCEPTION, START_CALL_ANALYTICS_STREAM_TRANSCRIPTION as _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION, - START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_INPUT as _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_INPUT, - START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_OUTPUT as _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_OUTPUT, START_MEDICAL_SCRIBE_STREAM as _SCHEMA_START_MEDICAL_SCRIBE_STREAM, - START_MEDICAL_SCRIBE_STREAM_INPUT as _SCHEMA_START_MEDICAL_SCRIBE_STREAM_INPUT, - START_MEDICAL_SCRIBE_STREAM_OUTPUT as _SCHEMA_START_MEDICAL_SCRIBE_STREAM_OUTPUT, START_MEDICAL_STREAM_TRANSCRIPTION as _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION, - START_MEDICAL_STREAM_TRANSCRIPTION_INPUT as _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_INPUT, - START_MEDICAL_STREAM_TRANSCRIPTION_OUTPUT as _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_OUTPUT, START_STREAM_TRANSCRIPTION as _SCHEMA_START_STREAM_TRANSCRIPTION, - START_STREAM_TRANSCRIPTION_INPUT as _SCHEMA_START_STREAM_TRANSCRIPTION_INPUT, - START_STREAM_TRANSCRIPTION_OUTPUT as _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT, - TIMESTAMP_RANGE as _SCHEMA_TIMESTAMP_RANGE, - TRANSCRIPT as _SCHEMA_TRANSCRIPT, - TRANSCRIPT_EVENT as _SCHEMA_TRANSCRIPT_EVENT, - TRANSCRIPT_RESULT_STREAM as _SCHEMA_TRANSCRIPT_RESULT_STREAM, - UTTERANCE_EVENT as _SCHEMA_UTTERANCE_EVENT, ) - -logger = logging.getLogger(__name__) +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from .models import ( + GetMedicalScribeStreamInput, + GetMedicalScribeStreamOutput, + StartCallAnalyticsStreamTranscriptionInput, + StartCallAnalyticsStreamTranscriptionOutput, + StartMedicalScribeStreamInput, + StartMedicalScribeStreamOutput, + StartMedicalStreamTranscriptionInput, + StartMedicalStreamTranscriptionOutput, + StartStreamTranscriptionInput, + StartStreamTranscriptionOutput, + ) class ServiceError(ModeledError): @@ -99,9495 +42,306 @@ class ServiceError(ModeledError): """ -@dataclass(kw_only=True) -class Entity: - """ - Contains entities identified as personally identifiable information - (PII) in your transcription output, along with various associated - attributes. Examples include category, confidence score, type, stability - score, and start and end times. - """ - - start_time: float = 0 - """ - The start time of the utterance that was identified as PII in seconds, - with millisecond precision (e.g., 1.056) - """ - - end_time: float = 0 - """ - The end time of the utterance that was identified as PII in seconds, - with millisecond precision (e.g., 1.056) - """ - - category: str | None = None - """The category of information identified. The only category is `PII`.""" - - type: str | None = None - """ - The type of PII identified. For example, `NAME` or - `CREDIT_DEBIT_NUMBER`. - """ - - content: str | None = None - """The word or words identified as PII.""" - - confidence: float | None = None - """ - The confidence score associated with the identified PII entity in your - audio. - - Confidence scores are values between 0 and 1. A larger value indicates a - higher probability that the identified entity correctly matches the - entity spoken in your media. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ENTITY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_double(_SCHEMA_ENTITY.members["StartTime"], self.start_time) - serializer.write_double(_SCHEMA_ENTITY.members["EndTime"], self.end_time) - if self.category is not None: - serializer.write_string(_SCHEMA_ENTITY.members["Category"], self.category) - - if self.type is not None: - serializer.write_string(_SCHEMA_ENTITY.members["Type"], self.type) - - if self.content is not None: - serializer.write_string(_SCHEMA_ENTITY.members["Content"], self.content) - - if self.confidence is not None: - serializer.write_double( - _SCHEMA_ENTITY.members["Confidence"], self.confidence - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["start_time"] = de.read_double( - _SCHEMA_ENTITY.members["StartTime"] - ) - - case 1: - kwargs["end_time"] = de.read_double( - _SCHEMA_ENTITY.members["EndTime"] - ) - - case 2: - kwargs["category"] = de.read_string( - _SCHEMA_ENTITY.members["Category"] - ) - - case 3: - kwargs["type"] = de.read_string(_SCHEMA_ENTITY.members["Type"]) - - case 4: - kwargs["content"] = de.read_string( - _SCHEMA_ENTITY.members["Content"] - ) - - case 5: - kwargs["confidence"] = de.read_double( - _SCHEMA_ENTITY.members["Confidence"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ENTITY, consumer=_consumer) - return kwargs - - -def _serialize_entity_list( - serializer: ShapeSerializer, schema: Schema, value: list[Entity] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_entity_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Entity]: - result: list[Entity] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Entity.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class ItemType(UnknownEnumMixin, StrEnum): - PRONUNCIATION = "pronunciation" - PUNCTUATION = "punctuation" - - -@dataclass(kw_only=True) -class Item: - """ - A word, phrase, or punctuation mark in your transcription output, along - with various associated attributes, such as confidence score, type, and - start and end times. - """ - - start_time: float = 0 - """ - The start time of the transcribed item in seconds, with millisecond - precision (e.g., 1.056) - """ - - end_time: float = 0 - """ - The end time of the transcribed item in seconds, with millisecond - precision (e.g., 1.056) - """ - - type: str | None = None - """ - The type of item identified. Options are: `PRONUNCIATION` (spoken words) - and `PUNCTUATION`. - """ - - content: str | None = None - """The word or punctuation that was transcribed.""" - - vocabulary_filter_match: bool = False - """ - Indicates whether the specified item matches a word in the vocabulary - filter included in your request. If `true`, there is a vocabulary filter - match. - """ - - speaker: str | None = None - """ - If speaker partitioning is enabled, `Speaker` labels the speaker of the - specified item. - """ - - confidence: float | None = None - """ - The confidence score associated with a word or phrase in your - transcript. - - Confidence scores are values between 0 and 1. A larger value indicates a - higher probability that the identified item correctly matches the item - spoken in your media. - """ - - stable: bool | None = None - """ - If partial result stabilization is enabled, `Stable` indicates whether - the specified item is stable (`true`) or if it may change when the - segment is complete (`false`). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ITEM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_double(_SCHEMA_ITEM.members["StartTime"], self.start_time) - serializer.write_double(_SCHEMA_ITEM.members["EndTime"], self.end_time) - if self.type is not None: - serializer.write_string(_SCHEMA_ITEM.members["Type"], self.type) - - if self.content is not None: - serializer.write_string(_SCHEMA_ITEM.members["Content"], self.content) - - serializer.write_boolean( - _SCHEMA_ITEM.members["VocabularyFilterMatch"], self.vocabulary_filter_match - ) - if self.speaker is not None: - serializer.write_string(_SCHEMA_ITEM.members["Speaker"], self.speaker) - - if self.confidence is not None: - serializer.write_double(_SCHEMA_ITEM.members["Confidence"], self.confidence) - - if self.stable is not None: - serializer.write_boolean(_SCHEMA_ITEM.members["Stable"], self.stable) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["start_time"] = de.read_double( - _SCHEMA_ITEM.members["StartTime"] - ) - - case 1: - kwargs["end_time"] = de.read_double(_SCHEMA_ITEM.members["EndTime"]) - - case 2: - kwargs["type"] = ItemType( - de.read_string(_SCHEMA_ITEM.members["Type"]) - ) - - case 3: - kwargs["content"] = de.read_string(_SCHEMA_ITEM.members["Content"]) - - case 4: - kwargs["vocabulary_filter_match"] = de.read_boolean( - _SCHEMA_ITEM.members["VocabularyFilterMatch"] - ) - - case 5: - kwargs["speaker"] = de.read_string(_SCHEMA_ITEM.members["Speaker"]) - - case 6: - kwargs["confidence"] = de.read_double( - _SCHEMA_ITEM.members["Confidence"] - ) - - case 7: - kwargs["stable"] = de.read_boolean(_SCHEMA_ITEM.members["Stable"]) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ITEM, consumer=_consumer) - return kwargs - - -def _serialize_item_list( - serializer: ShapeSerializer, schema: Schema, value: list[Item] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_item_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Item]: - result: list[Item] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Item.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class Alternative: - """ - A list of possible alternative transcriptions for the input audio. Each - alternative may contain one or more of `Items`, `Entities`, or - `Transcript`. - """ - - transcript: str | None = None - """Contains transcribed text.""" - - items: list[Item] | None = None - """ - Contains words, phrases, or punctuation marks in your transcription - output. - """ - - entities: list[Entity] | None = None - """ - Contains entities identified as personally identifiable information - (PII) in your transcription output. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ALTERNATIVE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.transcript is not None: - serializer.write_string( - _SCHEMA_ALTERNATIVE.members["Transcript"], self.transcript - ) - - if self.items is not None: - _serialize_item_list( - serializer, _SCHEMA_ALTERNATIVE.members["Items"], self.items - ) - - if self.entities is not None: - _serialize_entity_list( - serializer, _SCHEMA_ALTERNATIVE.members["Entities"], self.entities - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["transcript"] = de.read_string( - _SCHEMA_ALTERNATIVE.members["Transcript"] - ) - - case 1: - kwargs["items"] = _deserialize_item_list( - de, _SCHEMA_ALTERNATIVE.members["Items"] - ) - - case 2: - kwargs["entities"] = _deserialize_entity_list( - de, _SCHEMA_ALTERNATIVE.members["Entities"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ALTERNATIVE, consumer=_consumer) - return kwargs - - -def _serialize_alternative_list( - serializer: ShapeSerializer, schema: Schema, value: list[Alternative] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_alternative_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Alternative]: - result: list[Alternative] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Alternative.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class AudioEvent: - """ - A wrapper for your audio chunks. Your audio stream consists of one or - more audio events, which consist of one or more audio chunks. - - For more information, see [Event stream - encoding](https://docs.aws.amazon.com/transcribe/latest/dg/event-stream.html). - """ - - audio_chunk: bytes | None = None - """ - An audio blob containing the next segment of audio from your - application, with a maximum duration of 1 second. The maximum size in - bytes varies based on audio properties. - - Find recommended size in [Transcribing streaming best - practices](https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html#best-practices). - - Size calculation: - `Duration (s) * Sample Rate (Hz) * Number of Channels * 2 (Bytes per Sample)` - - For example, a 1-second chunk of 16 kHz, 2-channel, 16-bit audio would - be `1 * 16000 * 2 * 2 = 64000 bytes`. - - For 8 kHz, 1-channel, 16-bit audio, a 1-second chunk would be - `1 * 8000 * 1 * 2 = 16000 bytes`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUDIO_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.audio_chunk is not None: - serializer.write_blob( - _SCHEMA_AUDIO_EVENT.members["AudioChunk"], self.audio_chunk - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["audio_chunk"] = de.read_blob( - _SCHEMA_AUDIO_EVENT.members["AudioChunk"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_AUDIO_EVENT, consumer=_consumer) - return kwargs - - -class ParticipantRole(UnknownEnumMixin, StrEnum): - AGENT = "AGENT" - CUSTOMER = "CUSTOMER" - - -@dataclass(kw_only=True) -class ChannelDefinition: - """ - Makes it possible to specify which speaker is on which audio channel. - For example, if your agent is the first participant to speak, you would - set `ChannelId` to `0` (to indicate the first channel) and - `ParticipantRole` to `AGENT` (to indicate that it's the agent - speaking). - """ - - participant_role: str - """ - Specify the speaker you want to define. Omitting this parameter is - equivalent to specifying both participants. - """ - - channel_id: int = 0 - """Specify the audio channel you want to define.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CHANNEL_DEFINITION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer( - _SCHEMA_CHANNEL_DEFINITION.members["ChannelId"], self.channel_id - ) - serializer.write_string( - _SCHEMA_CHANNEL_DEFINITION.members["ParticipantRole"], self.participant_role - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["channel_id"] = de.read_integer( - _SCHEMA_CHANNEL_DEFINITION.members["ChannelId"] - ) - - case 1: - kwargs["participant_role"] = ParticipantRole( - de.read_string( - _SCHEMA_CHANNEL_DEFINITION.members["ParticipantRole"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CHANNEL_DEFINITION, consumer=_consumer) - if "participant_role" not in kwargs: - kwargs["participant_role"] = ParticipantRole._corrected("") - return kwargs - - -def _serialize_channel_definitions( - serializer: ShapeSerializer, schema: Schema, value: list[ChannelDefinition] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_channel_definitions( - deserializer: ShapeDeserializer, schema: Schema -) -> list[ChannelDefinition]: - result: list[ChannelDefinition] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(ChannelDefinition.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class ContentRedactionOutput(UnknownEnumMixin, StrEnum): - REDACTED = "redacted" - REDACTED_AND_UNREDACTED = "redacted_and_unredacted" - - -@dataclass(kw_only=True) -class PostCallAnalyticsSettings: - """ - Allows you to specify additional settings for your Call Analytics - post-call request, including output locations for your redacted - transcript, which IAM role to use, and which encryption key to use. - - `DataAccessRoleArn` and `OutputLocation` are required fields. - - `PostCallAnalyticsSettings` provides you with the same insights as a - Call Analytics post-call transcription. Refer to [Post-call - analytics](https://docs.aws.amazon.com/transcribe/latest/dg/tca-post-call.html) - for more information on this feature. - """ - - output_location: str - """ - The Amazon S3 location where you want your Call Analytics post-call - transcription output stored. You can use any of the following formats to - specify the output location: - - 1. s3://DOC-EXAMPLE-BUCKET - - 2. s3://DOC-EXAMPLE-BUCKET/my-output-folder/ - - 3. s3://DOC-EXAMPLE-BUCKET/my-output-folder/my-call-analytics-job.json - """ - - data_access_role_arn: str - """ - The Amazon Resource Name (ARN) of an IAM role that has permissions to - access the Amazon S3 bucket that contains your input files. If the role - that you specify doesn't have the appropriate permissions to access the - specified Amazon S3 location, your request fails. - - IAM role ARNs have the format - `arn:partition:iam::account:role/role-name-with-path`. For example: - `arn:aws:iam::111122223333:role/Admin`. For more information, see [IAM - ARNs](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-arns). - """ - - content_redaction_output: str | None = None - """ - Specify whether you want only a redacted transcript or both a redacted - and an unredacted transcript. If you choose redacted and unredacted, two - JSON files are generated and stored in the Amazon S3 output location you - specify. - - Note that to include `ContentRedactionOutput` in your request, you must - enable content redaction (`ContentRedactionType`). - """ - - output_encryption_kms_key_id: str | None = None - """ - The KMS key you want to use to encrypt your Call Analytics post-call - output. - - If using a key located in the **current** Amazon Web Services account, - you can specify your KMS key in one of four ways: - - 1. Use the KMS key ID itself. For example, - `1234abcd-12ab-34cd-56ef-1234567890ab`. - - 2. Use an alias for the KMS key ID. For example, `alias/ExampleAlias`. - - 3. Use the Amazon Resource Name (ARN) for the KMS key ID. For example, - `arn:aws:kms:region:account-ID:key/1234abcd-12ab-34cd-56ef-1234567890ab`. - - 4. Use the ARN for the KMS key alias. For example, - `arn:aws:kms:region:account-ID:alias/ExampleAlias`. - - If using a key located in a **different** Amazon Web Services account - than the current Amazon Web Services account, you can specify your KMS - key in one of two ways: - - 1. Use the ARN for the KMS key ID. For example, - `arn:aws:kms:region:account-ID:key/1234abcd-12ab-34cd-56ef-1234567890ab`. - - 2. Use the ARN for the KMS key alias. For example, - `arn:aws:kms:region:account-ID:alias/ExampleAlias`. - - Note that the role making the request must have permission to use the - specified KMS key. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_POST_CALL_ANALYTICS_SETTINGS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_POST_CALL_ANALYTICS_SETTINGS.members["OutputLocation"], - self.output_location, - ) - serializer.write_string( - _SCHEMA_POST_CALL_ANALYTICS_SETTINGS.members["DataAccessRoleArn"], - self.data_access_role_arn, - ) - if self.content_redaction_output is not None: - serializer.write_string( - _SCHEMA_POST_CALL_ANALYTICS_SETTINGS.members["ContentRedactionOutput"], - self.content_redaction_output, - ) - - if self.output_encryption_kms_key_id is not None: - serializer.write_string( - _SCHEMA_POST_CALL_ANALYTICS_SETTINGS.members[ - "OutputEncryptionKMSKeyId" - ], - self.output_encryption_kms_key_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["output_location"] = de.read_string( - _SCHEMA_POST_CALL_ANALYTICS_SETTINGS.members["OutputLocation"] - ) - - case 1: - kwargs["data_access_role_arn"] = de.read_string( - _SCHEMA_POST_CALL_ANALYTICS_SETTINGS.members[ - "DataAccessRoleArn" - ] - ) - - case 2: - kwargs["content_redaction_output"] = ContentRedactionOutput( - de.read_string( - _SCHEMA_POST_CALL_ANALYTICS_SETTINGS.members[ - "ContentRedactionOutput" - ] - ) - ) - - case 3: - kwargs["output_encryption_kms_key_id"] = de.read_string( - _SCHEMA_POST_CALL_ANALYTICS_SETTINGS.members[ - "OutputEncryptionKMSKeyId" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_POST_CALL_ANALYTICS_SETTINGS, consumer=_consumer - ) - if "output_location" not in kwargs: - kwargs["output_location"] = "" - if "data_access_role_arn" not in kwargs: - kwargs["data_access_role_arn"] = "" - return kwargs - - -@dataclass(kw_only=True) -class ConfigurationEvent: - """ - Allows you to set audio channel definitions and post-call analytics - settings. - """ - - channel_definitions: list[ChannelDefinition] | None = None - """Indicates which speaker is on which audio channel.""" - - post_call_analytics_settings: PostCallAnalyticsSettings | None = None - """ - Provides additional optional settings for your Call Analytics post-call - request, including encryption and output locations for your redacted - transcript. - - `PostCallAnalyticsSettings` provides you with the same insights as a - Call Analytics post-call transcription. Refer to [Post-call - analytics](https://docs.aws.amazon.com/transcribe/latest/dg/tca-post-call.html) - for more information on this feature. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONFIGURATION_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.channel_definitions is not None: - _serialize_channel_definitions( - serializer, - _SCHEMA_CONFIGURATION_EVENT.members["ChannelDefinitions"], - self.channel_definitions, - ) - - if self.post_call_analytics_settings is not None: - serializer.write_struct( - _SCHEMA_CONFIGURATION_EVENT.members["PostCallAnalyticsSettings"], - self.post_call_analytics_settings, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["channel_definitions"] = _deserialize_channel_definitions( - de, _SCHEMA_CONFIGURATION_EVENT.members["ChannelDefinitions"] - ) - - case 1: - kwargs["post_call_analytics_settings"] = ( - PostCallAnalyticsSettings.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONFIGURATION_EVENT, consumer=_consumer) - return kwargs - - -@dataclass -class AudioStreamAudioEvent: - """ - A blob of audio from your application. Your audio stream consists of one - or more audio events. - - For more information, see [Event stream - encoding](https://docs.aws.amazon.com/transcribe/latest/dg/event-stream.html). - """ - - value: AudioEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUDIO_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUDIO_STREAM.members["AudioEvent"], self.value) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=AudioEvent.deserialize(deserializer)) +_registry = ModelRegistry( + _schemas, + renames={}, + index={ + "Alternative": "ALTERNATIVE", + "AudioEvent": "AUDIO_EVENT", + "AudioStream": "AUDIO_STREAM", + "AudioStreamAudioEvent": "AUDIO_STREAM", + "AudioStreamConfigurationEvent": "AUDIO_STREAM", + "AudioStreamUnknown": "AUDIO_STREAM", + "BadRequestException": "BAD_REQUEST_EXCEPTION", + "CallAnalyticsEntity": "CALL_ANALYTICS_ENTITY", + "CallAnalyticsItem": "CALL_ANALYTICS_ITEM", + "CallAnalyticsLanguageCode": "CALL_ANALYTICS_LANGUAGE_CODE", + "CallAnalyticsLanguageWithScore": "CALL_ANALYTICS_LANGUAGE_WITH_SCORE", + "CallAnalyticsTranscriptResultStream": "CALL_ANALYTICS_TRANSCRIPT_RESULT_STREAM", + "CallAnalyticsTranscriptResultStreamUtteranceEvent": "CALL_ANALYTICS_TRANSCRIPT_RESULT_STREAM", + "CallAnalyticsTranscriptResultStreamCategoryEvent": "CALL_ANALYTICS_TRANSCRIPT_RESULT_STREAM", + "CallAnalyticsTranscriptResultStreamBadRequestException": "CALL_ANALYTICS_TRANSCRIPT_RESULT_STREAM", + "CallAnalyticsTranscriptResultStreamLimitExceededException": "CALL_ANALYTICS_TRANSCRIPT_RESULT_STREAM", + "CallAnalyticsTranscriptResultStreamInternalFailureException": "CALL_ANALYTICS_TRANSCRIPT_RESULT_STREAM", + "CallAnalyticsTranscriptResultStreamConflictException": "CALL_ANALYTICS_TRANSCRIPT_RESULT_STREAM", + "CallAnalyticsTranscriptResultStreamServiceUnavailableException": "CALL_ANALYTICS_TRANSCRIPT_RESULT_STREAM", + "CallAnalyticsTranscriptResultStreamUnknown": "CALL_ANALYTICS_TRANSCRIPT_RESULT_STREAM", + "CategoryEvent": "CATEGORY_EVENT", + "ChannelDefinition": "CHANNEL_DEFINITION", + "CharacterOffsets": "CHARACTER_OFFSETS", + "ClinicalNoteGenerationResult": "CLINICAL_NOTE_GENERATION_RESULT", + "ClinicalNoteGenerationSettings": "CLINICAL_NOTE_GENERATION_SETTINGS", + "ClinicalNoteGenerationStatus": "CLINICAL_NOTE_GENERATION_STATUS", + "ConfigurationEvent": "CONFIGURATION_EVENT", + "ConflictException": "CONFLICT_EXCEPTION", + "ContentIdentificationType": "CONTENT_IDENTIFICATION_TYPE", + "ContentRedactionOutput": "CONTENT_REDACTION_OUTPUT", + "ContentRedactionType": "CONTENT_REDACTION_TYPE", + "Entity": "ENTITY", + "GetMedicalScribeStreamInput": "GET_MEDICAL_SCRIBE_STREAM_INPUT", + "GetMedicalScribeStreamOutput": "GET_MEDICAL_SCRIBE_STREAM_OUTPUT", + "InternalFailureException": "INTERNAL_FAILURE_EXCEPTION", + "IssueDetected": "ISSUE_DETECTED", + "Item": "ITEM", + "ItemType": "ITEM_TYPE", + "LanguageCode": "LANGUAGE_CODE", + "LanguageWithScore": "LANGUAGE_WITH_SCORE", + "LimitExceededException": "LIMIT_EXCEEDED_EXCEPTION", + "MediaEncoding": "MEDIA_ENCODING", + "MedicalAlternative": "MEDICAL_ALTERNATIVE", + "MedicalContentIdentificationType": "MEDICAL_CONTENT_IDENTIFICATION_TYPE", + "MedicalEntity": "MEDICAL_ENTITY", + "MedicalItem": "MEDICAL_ITEM", + "MedicalResult": "MEDICAL_RESULT", + "MedicalScribeAudioEvent": "MEDICAL_SCRIBE_AUDIO_EVENT", + "MedicalScribeChannelDefinition": "MEDICAL_SCRIBE_CHANNEL_DEFINITION", + "MedicalScribeConfigurationEvent": "MEDICAL_SCRIBE_CONFIGURATION_EVENT", + "MedicalScribeContext": "MEDICAL_SCRIBE_CONTEXT", + "MedicalScribeEncryptionSettings": "MEDICAL_SCRIBE_ENCRYPTION_SETTINGS", + "MedicalScribeInputStream": "MEDICAL_SCRIBE_INPUT_STREAM", + "MedicalScribeInputStreamAudioEvent": "MEDICAL_SCRIBE_INPUT_STREAM", + "MedicalScribeInputStreamSessionControlEvent": "MEDICAL_SCRIBE_INPUT_STREAM", + "MedicalScribeInputStreamConfigurationEvent": "MEDICAL_SCRIBE_INPUT_STREAM", + "MedicalScribeInputStreamUnknown": "MEDICAL_SCRIBE_INPUT_STREAM", + "MedicalScribeLanguageCode": "MEDICAL_SCRIBE_LANGUAGE_CODE", + "MedicalScribeMediaEncoding": "MEDICAL_SCRIBE_MEDIA_ENCODING", + "MedicalScribeNoteTemplate": "MEDICAL_SCRIBE_NOTE_TEMPLATE", + "MedicalScribeParticipantRole": "MEDICAL_SCRIBE_PARTICIPANT_ROLE", + "MedicalScribePatientContext": "MEDICAL_SCRIBE_PATIENT_CONTEXT", + "MedicalScribePostStreamAnalyticsResult": "MEDICAL_SCRIBE_POST_STREAM_ANALYTICS_RESULT", + "MedicalScribePostStreamAnalyticsSettings": "MEDICAL_SCRIBE_POST_STREAM_ANALYTICS_SETTINGS", + "MedicalScribeResultStream": "MEDICAL_SCRIBE_RESULT_STREAM", + "MedicalScribeResultStreamTranscriptEvent": "MEDICAL_SCRIBE_RESULT_STREAM", + "MedicalScribeResultStreamBadRequestException": "MEDICAL_SCRIBE_RESULT_STREAM", + "MedicalScribeResultStreamLimitExceededException": "MEDICAL_SCRIBE_RESULT_STREAM", + "MedicalScribeResultStreamInternalFailureException": "MEDICAL_SCRIBE_RESULT_STREAM", + "MedicalScribeResultStreamConflictException": "MEDICAL_SCRIBE_RESULT_STREAM", + "MedicalScribeResultStreamServiceUnavailableException": "MEDICAL_SCRIBE_RESULT_STREAM", + "MedicalScribeResultStreamUnknown": "MEDICAL_SCRIBE_RESULT_STREAM", + "MedicalScribeSessionControlEvent": "MEDICAL_SCRIBE_SESSION_CONTROL_EVENT", + "MedicalScribeSessionControlEventType": "MEDICAL_SCRIBE_SESSION_CONTROL_EVENT_TYPE", + "MedicalScribeStreamDetails": "MEDICAL_SCRIBE_STREAM_DETAILS", + "MedicalScribeStreamStatus": "MEDICAL_SCRIBE_STREAM_STATUS", + "MedicalScribeTranscriptEvent": "MEDICAL_SCRIBE_TRANSCRIPT_EVENT", + "MedicalScribeTranscriptItem": "MEDICAL_SCRIBE_TRANSCRIPT_ITEM", + "MedicalScribeTranscriptItemType": "MEDICAL_SCRIBE_TRANSCRIPT_ITEM_TYPE", + "MedicalScribeTranscriptSegment": "MEDICAL_SCRIBE_TRANSCRIPT_SEGMENT", + "MedicalScribeVocabularyFilterMethod": "MEDICAL_SCRIBE_VOCABULARY_FILTER_METHOD", + "MedicalTranscript": "MEDICAL_TRANSCRIPT", + "MedicalTranscriptEvent": "MEDICAL_TRANSCRIPT_EVENT", + "MedicalTranscriptResultStream": "MEDICAL_TRANSCRIPT_RESULT_STREAM", + "MedicalTranscriptResultStreamTranscriptEvent": "MEDICAL_TRANSCRIPT_RESULT_STREAM", + "MedicalTranscriptResultStreamBadRequestException": "MEDICAL_TRANSCRIPT_RESULT_STREAM", + "MedicalTranscriptResultStreamLimitExceededException": "MEDICAL_TRANSCRIPT_RESULT_STREAM", + "MedicalTranscriptResultStreamInternalFailureException": "MEDICAL_TRANSCRIPT_RESULT_STREAM", + "MedicalTranscriptResultStreamConflictException": "MEDICAL_TRANSCRIPT_RESULT_STREAM", + "MedicalTranscriptResultStreamServiceUnavailableException": "MEDICAL_TRANSCRIPT_RESULT_STREAM", + "MedicalTranscriptResultStreamUnknown": "MEDICAL_TRANSCRIPT_RESULT_STREAM", + "PartialResultsStability": "PARTIAL_RESULTS_STABILITY", + "ParticipantRole": "PARTICIPANT_ROLE", + "PointsOfInterest": "POINTS_OF_INTEREST", + "PostCallAnalyticsSettings": "POST_CALL_ANALYTICS_SETTINGS", + "Pronouns": "PRONOUNS", + "ResourceNotFoundException": "RESOURCE_NOT_FOUND_EXCEPTION", + "Result": "RESULT", + "Sentiment": "SENTIMENT", + "ServiceUnavailableException": "SERVICE_UNAVAILABLE_EXCEPTION", + "Specialty": "SPECIALTY", + "StartCallAnalyticsStreamTranscriptionInput": "START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_INPUT", + "StartCallAnalyticsStreamTranscriptionOutput": "START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_OUTPUT", + "StartMedicalScribeStreamInput": "START_MEDICAL_SCRIBE_STREAM_INPUT", + "StartMedicalScribeStreamOutput": "START_MEDICAL_SCRIBE_STREAM_OUTPUT", + "StartMedicalStreamTranscriptionInput": "START_MEDICAL_STREAM_TRANSCRIPTION_INPUT", + "StartMedicalStreamTranscriptionOutput": "START_MEDICAL_STREAM_TRANSCRIPTION_OUTPUT", + "StartStreamTranscriptionInput": "START_STREAM_TRANSCRIPTION_INPUT", + "StartStreamTranscriptionOutput": "START_STREAM_TRANSCRIPTION_OUTPUT", + "TimestampRange": "TIMESTAMP_RANGE", + "Transcript": "TRANSCRIPT", + "TranscriptEvent": "TRANSCRIPT_EVENT", + "TranscriptFormat": "TRANSCRIPT_FORMAT", + "TranscriptResultStream": "TRANSCRIPT_RESULT_STREAM", + "TranscriptResultStreamTranscriptEvent": "TRANSCRIPT_RESULT_STREAM", + "TranscriptResultStreamBadRequestException": "TRANSCRIPT_RESULT_STREAM", + "TranscriptResultStreamLimitExceededException": "TRANSCRIPT_RESULT_STREAM", + "TranscriptResultStreamInternalFailureException": "TRANSCRIPT_RESULT_STREAM", + "TranscriptResultStreamConflictException": "TRANSCRIPT_RESULT_STREAM", + "TranscriptResultStreamServiceUnavailableException": "TRANSCRIPT_RESULT_STREAM", + "TranscriptResultStreamUnknown": "TRANSCRIPT_RESULT_STREAM", + "Type": "TYPE", + "UtteranceEvent": "UTTERANCE_EVENT", + "VocabularyFilterMethod": "VOCABULARY_FILTER_METHOD", + }, + shape_names=frozenset( + { + "Alternative", + "AudioEvent", + "AudioStream", + "BadRequestException", + "CallAnalyticsEntity", + "CallAnalyticsItem", + "CallAnalyticsLanguageCode", + "CallAnalyticsLanguageWithScore", + "CallAnalyticsTranscriptResultStream", + "CategoryEvent", + "ChannelDefinition", + "CharacterOffsets", + "ClinicalNoteGenerationResult", + "ClinicalNoteGenerationSettings", + "ClinicalNoteGenerationStatus", + "ConfigurationEvent", + "ConflictException", + "ContentIdentificationType", + "ContentRedactionOutput", + "ContentRedactionType", + "Entity", + "GetMedicalScribeStreamInput", + "GetMedicalScribeStreamOutput", + "InternalFailureException", + "IssueDetected", + "Item", + "ItemType", + "LanguageCode", + "LanguageWithScore", + "LimitExceededException", + "MediaEncoding", + "MedicalAlternative", + "MedicalContentIdentificationType", + "MedicalEntity", + "MedicalItem", + "MedicalResult", + "MedicalScribeAudioEvent", + "MedicalScribeChannelDefinition", + "MedicalScribeConfigurationEvent", + "MedicalScribeContext", + "MedicalScribeEncryptionSettings", + "MedicalScribeInputStream", + "MedicalScribeLanguageCode", + "MedicalScribeMediaEncoding", + "MedicalScribeNoteTemplate", + "MedicalScribeParticipantRole", + "MedicalScribePatientContext", + "MedicalScribePostStreamAnalyticsResult", + "MedicalScribePostStreamAnalyticsSettings", + "MedicalScribeResultStream", + "MedicalScribeSessionControlEvent", + "MedicalScribeSessionControlEventType", + "MedicalScribeStreamDetails", + "MedicalScribeStreamStatus", + "MedicalScribeTranscriptEvent", + "MedicalScribeTranscriptItem", + "MedicalScribeTranscriptItemType", + "MedicalScribeTranscriptSegment", + "MedicalScribeVocabularyFilterMethod", + "MedicalTranscript", + "MedicalTranscriptEvent", + "MedicalTranscriptResultStream", + "PartialResultsStability", + "ParticipantRole", + "PointsOfInterest", + "PostCallAnalyticsSettings", + "Pronouns", + "ResourceNotFoundException", + "Result", + "Sentiment", + "ServiceUnavailableException", + "Specialty", + "StartCallAnalyticsStreamTranscriptionInput", + "StartCallAnalyticsStreamTranscriptionOutput", + "StartMedicalScribeStreamInput", + "StartMedicalScribeStreamOutput", + "StartMedicalStreamTranscriptionInput", + "StartMedicalStreamTranscriptionOutput", + "StartStreamTranscriptionInput", + "StartStreamTranscriptionOutput", + "TimestampRange", + "Transcript", + "TranscriptEvent", + "TranscriptFormat", + "TranscriptResultStream", + "Type", + "UtteranceEvent", + "VocabularyFilterMethod", + } + ), + service_error="ServiceError", +) -@dataclass -class AudioStreamConfigurationEvent: - """Contains audio channel definitions and post-call analytics settings.""" +def __getattr__(name: str): + return _registry.build(name) - value: ConfigurationEvent - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_AUDIO_STREAM, self) +GET_MEDICAL_SCRIBE_STREAM: APIOperation[ + GetMedicalScribeStreamInput, GetMedicalScribeStreamOutput +] = APIOperation( + static_schema=_SCHEMA_GET_MEDICAL_SCRIBE_STREAM, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.transcribestreaming#BadRequestException"), + ShapeID("com.amazonaws.transcribestreaming#InternalFailureException"), + ShapeID("com.amazonaws.transcribestreaming#LimitExceededException"), + ShapeID("com.amazonaws.transcribestreaming#ResourceNotFoundException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_AUDIO_STREAM.members["ConfigurationEvent"], self.value - ) +START_CALL_ANALYTICS_STREAM_TRANSCRIPTION: APIOperation[ + StartCallAnalyticsStreamTranscriptionInput, + StartCallAnalyticsStreamTranscriptionOutput, +] = APIOperation( + static_schema=_SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.transcribestreaming#BadRequestException"), + ShapeID("com.amazonaws.transcribestreaming#ConflictException"), + ShapeID("com.amazonaws.transcribestreaming#InternalFailureException"), + ShapeID("com.amazonaws.transcribestreaming#LimitExceededException"), + ShapeID("com.amazonaws.transcribestreaming#ServiceUnavailableException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ConfigurationEvent.deserialize(deserializer)) +START_MEDICAL_SCRIBE_STREAM: APIOperation[ + StartMedicalScribeStreamInput, StartMedicalScribeStreamOutput +] = APIOperation( + static_schema=_SCHEMA_START_MEDICAL_SCRIBE_STREAM, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.transcribestreaming#BadRequestException"), + ShapeID("com.amazonaws.transcribestreaming#ConflictException"), + ShapeID("com.amazonaws.transcribestreaming#InternalFailureException"), + ShapeID("com.amazonaws.transcribestreaming#LimitExceededException"), + ShapeID("com.amazonaws.transcribestreaming#ServiceUnavailableException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) +START_MEDICAL_STREAM_TRANSCRIPTION: APIOperation[ + StartMedicalStreamTranscriptionInput, StartMedicalStreamTranscriptionOutput +] = APIOperation( + static_schema=_SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.transcribestreaming#BadRequestException"), + ShapeID("com.amazonaws.transcribestreaming#ConflictException"), + ShapeID("com.amazonaws.transcribestreaming#InternalFailureException"), + ShapeID("com.amazonaws.transcribestreaming#LimitExceededException"), + ShapeID("com.amazonaws.transcribestreaming#ServiceUnavailableException"), + ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], +) -@dataclass -class AudioStreamUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -AudioStream = Union[ - AudioStreamAudioEvent | AudioStreamConfigurationEvent | AudioStreamUnknown -] -""" -An encoded stream of audio blobs. Audio streams are encoded as either -HTTP/2 or WebSocket data frames. - -For more information, see [Transcribing streaming -audio](https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html). -""" - - -class _AudioStreamDeserializer: - _result: AudioStream | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> AudioStream: - self._result = None - deserializer.read_struct(_SCHEMA_AUDIO_STREAM, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(AudioStreamAudioEvent.deserialize(de)) - - case 1: - self._set_result(AudioStreamConfigurationEvent.deserialize(de)) - - case _: - self._set_result(AudioStreamUnknown(tag=schema.expect_member_name())) - - def _set_result(self, value: AudioStream) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class BadRequestException(ServiceError): - """ - One or more arguments to the `StartStreamTranscription`, - `StartMedicalStreamTranscription`, or - `StartCallAnalyticsStreamTranscription` operation was not valid. For - example, `MediaEncoding` or `LanguageCode` used unsupported values. - Check the specified parameters and try your request again. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_BAD_REQUEST_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_BAD_REQUEST_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_BAD_REQUEST_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_BAD_REQUEST_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class CallAnalyticsEntity: - """ - Contains entities identified as personally identifiable information - (PII) in your transcription output, along with various associated - attributes. Examples include category, confidence score, content, type, - and start and end times. - """ - - begin_offset_millis: int | None = None - """ - The time, in milliseconds, from the beginning of the audio stream to the - start of the identified entity. - """ - - end_offset_millis: int | None = None - """ - The time, in milliseconds, from the beginning of the audio stream to the - end of the identified entity. - """ - - category: str | None = None - """The category of information identified. For example, `PII`.""" - - type: str | None = None - """ - The type of PII identified. For example, `NAME` or - `CREDIT_DEBIT_NUMBER`. - """ - - content: str | None = None - """The word or words that represent the identified entity.""" - - confidence: float | None = None - """ - The confidence score associated with the identification of an entity in - your transcript. - - Confidence scores are values between 0 and 1. A larger value indicates a - higher probability that the identified entity correctly matches the - entity spoken in your media. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CALL_ANALYTICS_ENTITY, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.begin_offset_millis is not None: - serializer.write_long( - _SCHEMA_CALL_ANALYTICS_ENTITY.members["BeginOffsetMillis"], - self.begin_offset_millis, - ) - - if self.end_offset_millis is not None: - serializer.write_long( - _SCHEMA_CALL_ANALYTICS_ENTITY.members["EndOffsetMillis"], - self.end_offset_millis, - ) - - if self.category is not None: - serializer.write_string( - _SCHEMA_CALL_ANALYTICS_ENTITY.members["Category"], self.category - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_CALL_ANALYTICS_ENTITY.members["Type"], self.type - ) - - if self.content is not None: - serializer.write_string( - _SCHEMA_CALL_ANALYTICS_ENTITY.members["Content"], self.content - ) - - if self.confidence is not None: - serializer.write_double( - _SCHEMA_CALL_ANALYTICS_ENTITY.members["Confidence"], self.confidence - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["begin_offset_millis"] = de.read_long( - _SCHEMA_CALL_ANALYTICS_ENTITY.members["BeginOffsetMillis"] - ) - - case 1: - kwargs["end_offset_millis"] = de.read_long( - _SCHEMA_CALL_ANALYTICS_ENTITY.members["EndOffsetMillis"] - ) - - case 2: - kwargs["category"] = de.read_string( - _SCHEMA_CALL_ANALYTICS_ENTITY.members["Category"] - ) - - case 3: - kwargs["type"] = de.read_string( - _SCHEMA_CALL_ANALYTICS_ENTITY.members["Type"] - ) - - case 4: - kwargs["content"] = de.read_string( - _SCHEMA_CALL_ANALYTICS_ENTITY.members["Content"] - ) - - case 5: - kwargs["confidence"] = de.read_double( - _SCHEMA_CALL_ANALYTICS_ENTITY.members["Confidence"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CALL_ANALYTICS_ENTITY, consumer=_consumer) - return kwargs - - -def _serialize_call_analytics_entity_list( - serializer: ShapeSerializer, schema: Schema, value: list[CallAnalyticsEntity] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_call_analytics_entity_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[CallAnalyticsEntity]: - result: list[CallAnalyticsEntity] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(CallAnalyticsEntity.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CallAnalyticsItem: - """ - A word, phrase, or punctuation mark in your Call Analytics transcription - output, along with various associated attributes, such as confidence - score, type, and start and end times. - """ - - begin_offset_millis: int | None = None - """ - The time, in milliseconds, from the beginning of the audio stream to the - start of the identified item. - """ - - end_offset_millis: int | None = None - """ - The time, in milliseconds, from the beginning of the audio stream to the - end of the identified item. - """ - - type: str | None = None - """ - The type of item identified. Options are: `PRONUNCIATION` (spoken words) - and `PUNCTUATION`. - """ - - content: str | None = None - """The word or punctuation that was transcribed.""" - - confidence: float | None = None - """ - The confidence score associated with a word or phrase in your - transcript. - - Confidence scores are values between 0 and 1. A larger value indicates a - higher probability that the identified item correctly matches the item - spoken in your media. - """ - - vocabulary_filter_match: bool = False - """ - Indicates whether the specified item matches a word in the vocabulary - filter included in your Call Analytics request. If `true`, there is a - vocabulary filter match. - """ - - stable: bool | None = None - """ - If partial result stabilization is enabled, `Stable` indicates whether - the specified item is stable (`true`) or if it may change when the - segment is complete (`false`). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CALL_ANALYTICS_ITEM, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.begin_offset_millis is not None: - serializer.write_long( - _SCHEMA_CALL_ANALYTICS_ITEM.members["BeginOffsetMillis"], - self.begin_offset_millis, - ) - - if self.end_offset_millis is not None: - serializer.write_long( - _SCHEMA_CALL_ANALYTICS_ITEM.members["EndOffsetMillis"], - self.end_offset_millis, - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_CALL_ANALYTICS_ITEM.members["Type"], self.type - ) - - if self.content is not None: - serializer.write_string( - _SCHEMA_CALL_ANALYTICS_ITEM.members["Content"], self.content - ) - - if self.confidence is not None: - serializer.write_double( - _SCHEMA_CALL_ANALYTICS_ITEM.members["Confidence"], self.confidence - ) - - serializer.write_boolean( - _SCHEMA_CALL_ANALYTICS_ITEM.members["VocabularyFilterMatch"], - self.vocabulary_filter_match, - ) - if self.stable is not None: - serializer.write_boolean( - _SCHEMA_CALL_ANALYTICS_ITEM.members["Stable"], self.stable - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["begin_offset_millis"] = de.read_long( - _SCHEMA_CALL_ANALYTICS_ITEM.members["BeginOffsetMillis"] - ) - - case 1: - kwargs["end_offset_millis"] = de.read_long( - _SCHEMA_CALL_ANALYTICS_ITEM.members["EndOffsetMillis"] - ) - - case 2: - kwargs["type"] = ItemType( - de.read_string(_SCHEMA_CALL_ANALYTICS_ITEM.members["Type"]) - ) - - case 3: - kwargs["content"] = de.read_string( - _SCHEMA_CALL_ANALYTICS_ITEM.members["Content"] - ) - - case 4: - kwargs["confidence"] = de.read_double( - _SCHEMA_CALL_ANALYTICS_ITEM.members["Confidence"] - ) - - case 5: - kwargs["vocabulary_filter_match"] = de.read_boolean( - _SCHEMA_CALL_ANALYTICS_ITEM.members["VocabularyFilterMatch"] - ) - - case 6: - kwargs["stable"] = de.read_boolean( - _SCHEMA_CALL_ANALYTICS_ITEM.members["Stable"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CALL_ANALYTICS_ITEM, consumer=_consumer) - return kwargs - - -def _serialize_call_analytics_item_list( - serializer: ShapeSerializer, schema: Schema, value: list[CallAnalyticsItem] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_call_analytics_item_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[CallAnalyticsItem]: - result: list[CallAnalyticsItem] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(CallAnalyticsItem.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class CallAnalyticsLanguageCode(UnknownEnumMixin, StrEnum): - EN_US = "en-US" - EN_GB = "en-GB" - ES_US = "es-US" - FR_CA = "fr-CA" - FR_FR = "fr-FR" - EN_AU = "en-AU" - IT_IT = "it-IT" - DE_DE = "de-DE" - PT_BR = "pt-BR" - - -@dataclass(kw_only=True) -class CallAnalyticsLanguageWithScore: - """ - The language code that represents the language identified in your audio, - including the associated confidence score. - """ - - language_code: str | None = None - """The language code of the identified language.""" - - score: float = 0 - """ - The confidence score associated with the identified language code. - Confidence scores are values between zero and one; larger values - indicate a higher confidence in the identified language. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CALL_ANALYTICS_LANGUAGE_WITH_SCORE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.language_code is not None: - serializer.write_string( - _SCHEMA_CALL_ANALYTICS_LANGUAGE_WITH_SCORE.members["LanguageCode"], - self.language_code, - ) - - serializer.write_double( - _SCHEMA_CALL_ANALYTICS_LANGUAGE_WITH_SCORE.members["Score"], self.score - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["language_code"] = CallAnalyticsLanguageCode( - de.read_string( - _SCHEMA_CALL_ANALYTICS_LANGUAGE_WITH_SCORE.members[ - "LanguageCode" - ] - ) - ) - - case 1: - kwargs["score"] = de.read_double( - _SCHEMA_CALL_ANALYTICS_LANGUAGE_WITH_SCORE.members["Score"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CALL_ANALYTICS_LANGUAGE_WITH_SCORE, consumer=_consumer - ) - return kwargs - - -def _serialize_call_analytics_language_identification( - serializer: ShapeSerializer, - schema: Schema, - value: list[CallAnalyticsLanguageWithScore], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_call_analytics_language_identification( - deserializer: ShapeDeserializer, schema: Schema -) -> list[CallAnalyticsLanguageWithScore]: - result: list[CallAnalyticsLanguageWithScore] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(CallAnalyticsLanguageWithScore.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_string_list( - serializer: ShapeSerializer, schema: Schema, value: list[str] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_string(member_schema, e) - - -def _deserialize_string_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[str]: - result: list[str] = [] - member_schema = schema.members["member"] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(d.read_string(member_schema)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class TimestampRange: - """ - Contains the timestamp range (start time through end time) of a matched - category. - """ - - begin_offset_millis: int | None = None - """ - The time, in milliseconds, from the beginning of the audio stream to the - start of the category match. - """ - - end_offset_millis: int | None = None - """ - The time, in milliseconds, from the beginning of the audio stream to the - end of the category match. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TIMESTAMP_RANGE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.begin_offset_millis is not None: - serializer.write_long( - _SCHEMA_TIMESTAMP_RANGE.members["BeginOffsetMillis"], - self.begin_offset_millis, - ) - - if self.end_offset_millis is not None: - serializer.write_long( - _SCHEMA_TIMESTAMP_RANGE.members["EndOffsetMillis"], - self.end_offset_millis, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["begin_offset_millis"] = de.read_long( - _SCHEMA_TIMESTAMP_RANGE.members["BeginOffsetMillis"] - ) - - case 1: - kwargs["end_offset_millis"] = de.read_long( - _SCHEMA_TIMESTAMP_RANGE.members["EndOffsetMillis"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TIMESTAMP_RANGE, consumer=_consumer) - return kwargs - - -def _serialize_timestamp_ranges( - serializer: ShapeSerializer, schema: Schema, value: list[TimestampRange] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_timestamp_ranges( - deserializer: ShapeDeserializer, schema: Schema -) -> list[TimestampRange]: - result: list[TimestampRange] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(TimestampRange.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class PointsOfInterest: - """Contains the timestamps of matched categories.""" - - timestamp_ranges: list[TimestampRange] | None = None - """ - Contains the timestamp ranges (start time through end time) of matched - categories and rules. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_POINTS_OF_INTEREST, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.timestamp_ranges is not None: - _serialize_timestamp_ranges( - serializer, - _SCHEMA_POINTS_OF_INTEREST.members["TimestampRanges"], - self.timestamp_ranges, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["timestamp_ranges"] = _deserialize_timestamp_ranges( - de, _SCHEMA_POINTS_OF_INTEREST.members["TimestampRanges"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_POINTS_OF_INTEREST, consumer=_consumer) - return kwargs - - -def _serialize_matched_category_details( - serializer: ShapeSerializer, schema: Schema, value: dict[str, PointsOfInterest] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_struct(value_schema, v)) - - -def _deserialize_matched_category_details( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, PointsOfInterest]: - result: dict[str, PointsOfInterest] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = PointsOfInterest.deserialize(d) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class CategoryEvent: - """ - Provides information on any `TranscriptFilterType` categories that - matched your transcription output. Matches are identified for each - segment upon completion of that segment. - """ - - matched_categories: list[str] | None = None - """Lists the categories that were matched in your audio segment.""" - - matched_details: dict[str, PointsOfInterest] | None = None - """ - Contains information about the matched categories, including category - names and timestamps. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CATEGORY_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.matched_categories is not None: - _serialize_string_list( - serializer, - _SCHEMA_CATEGORY_EVENT.members["MatchedCategories"], - self.matched_categories, - ) - - if self.matched_details is not None: - _serialize_matched_category_details( - serializer, - _SCHEMA_CATEGORY_EVENT.members["MatchedDetails"], - self.matched_details, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["matched_categories"] = _deserialize_string_list( - de, _SCHEMA_CATEGORY_EVENT.members["MatchedCategories"] - ) - - case 1: - kwargs["matched_details"] = _deserialize_matched_category_details( - de, _SCHEMA_CATEGORY_EVENT.members["MatchedDetails"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CATEGORY_EVENT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ConflictException(ServiceError): - """ - A new stream started with the same session ID. The current stream has - been terminated. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CONFLICT_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_CONFLICT_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_CONFLICT_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CONFLICT_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class InternalFailureException(ServiceError): - """ - A problem occurred while processing the audio. Amazon Transcribe - terminated processing. - """ - - fault: Literal["client", "server"] | None = "server" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_INTERNAL_FAILURE_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_INTERNAL_FAILURE_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_INTERNAL_FAILURE_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_INTERNAL_FAILURE_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class LimitExceededException(ServiceError): - """ - Your client has exceeded one of the Amazon Transcribe limits, typically - the concurrent stream service quota. This error can also occur if a - stream exceeds the maximum session duration. In rare cases, this error - can also occur if you increase your number of concurrent streams too - quickly. Reduce your number of concurrent streams and try your request - again using an exponential backoff strategy. - """ - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LIMIT_EXCEEDED_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LIMIT_EXCEEDED_EXCEPTION, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class ServiceUnavailableException(ServiceError): - """The service is currently unavailable. Try your request later.""" - - fault: Literal["client", "server"] | None = "server" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_SERVICE_UNAVAILABLE_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_SERVICE_UNAVAILABLE_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_SERVICE_UNAVAILABLE_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_SERVICE_UNAVAILABLE_EXCEPTION, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class CharacterOffsets: - """ - Provides the location, using character count, in your transcript where a - match is identified. For example, the location of an issue or a category - match within a segment. - """ - - begin: int | None = None - """ - Provides the character count of the first character where a match is - identified. For example, the first character associated with an issue or - a category match in a segment transcript. - """ - - end: int | None = None - """ - Provides the character count of the last character where a match is - identified. For example, the last character associated with an issue or - a category match in a segment transcript. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CHARACTER_OFFSETS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.begin is not None: - serializer.write_integer( - _SCHEMA_CHARACTER_OFFSETS.members["Begin"], self.begin - ) - - if self.end is not None: - serializer.write_integer(_SCHEMA_CHARACTER_OFFSETS.members["End"], self.end) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["begin"] = de.read_integer( - _SCHEMA_CHARACTER_OFFSETS.members["Begin"] - ) - - case 1: - kwargs["end"] = de.read_integer( - _SCHEMA_CHARACTER_OFFSETS.members["End"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_CHARACTER_OFFSETS, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class IssueDetected: - """Lists the issues that were identified in your audio segment.""" - - character_offsets: CharacterOffsets | None = None - """ - Provides the timestamps that identify when in an audio segment the - specified issue occurs. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_ISSUE_DETECTED, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.character_offsets is not None: - serializer.write_struct( - _SCHEMA_ISSUE_DETECTED.members["CharacterOffsets"], - self.character_offsets, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["character_offsets"] = CharacterOffsets.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_ISSUE_DETECTED, consumer=_consumer) - return kwargs - - -def _serialize_issues_detected( - serializer: ShapeSerializer, schema: Schema, value: list[IssueDetected] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_issues_detected( - deserializer: ShapeDeserializer, schema: Schema -) -> list[IssueDetected]: - result: list[IssueDetected] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(IssueDetected.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class Sentiment(UnknownEnumMixin, StrEnum): - POSITIVE = "POSITIVE" - NEGATIVE = "NEGATIVE" - MIXED = "MIXED" - NEUTRAL = "NEUTRAL" - - -@dataclass(kw_only=True) -class UtteranceEvent: - """ - Contains set of transcription results from one or more audio segments, - along with additional information about the parameters included in your - request. For example, channel definitions, partial result stabilization, - sentiment, and issue detection. - """ - - utterance_id: str | None = None - """ - The unique identifier that is associated with the specified - `UtteranceEvent`. - """ - - is_partial: bool = False - """ - Indicates whether the segment in the `UtteranceEvent` is complete - (`FALSE`) or partial (`TRUE`). - """ - - participant_role: str | None = None - """ - Provides the role of the speaker for each audio channel, either - `CUSTOMER` or `AGENT`. - """ - - begin_offset_millis: int | None = None - """ - The time, in milliseconds, from the beginning of the audio stream to the - start of the `UtteranceEvent`. - """ - - end_offset_millis: int | None = None - """ - The time, in milliseconds, from the beginning of the audio stream to the - start of the `UtteranceEvent`. - """ - - transcript: str | None = None - """Contains transcribed text.""" - - items: list[CallAnalyticsItem] | None = None - """ - Contains words, phrases, or punctuation marks that are associated with - the specified `UtteranceEvent`. - """ - - entities: list[CallAnalyticsEntity] | None = None - """ - Contains entities identified as personally identifiable information - (PII) in your transcription output. - """ - - sentiment: str | None = None - """Provides the sentiment that was detected in the specified segment.""" - - issues_detected: list[IssueDetected] | None = None - """Provides the issue that was detected in the specified segment.""" - - language_code: str | None = None - """ - The language code that represents the language spoken in your audio - stream. - """ - - language_identification: list[CallAnalyticsLanguageWithScore] | None = None - """The language code of the dominant language identified in your stream.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_UTTERANCE_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.utterance_id is not None: - serializer.write_string( - _SCHEMA_UTTERANCE_EVENT.members["UtteranceId"], self.utterance_id - ) - - serializer.write_boolean( - _SCHEMA_UTTERANCE_EVENT.members["IsPartial"], self.is_partial - ) - if self.participant_role is not None: - serializer.write_string( - _SCHEMA_UTTERANCE_EVENT.members["ParticipantRole"], - self.participant_role, - ) - - if self.begin_offset_millis is not None: - serializer.write_long( - _SCHEMA_UTTERANCE_EVENT.members["BeginOffsetMillis"], - self.begin_offset_millis, - ) - - if self.end_offset_millis is not None: - serializer.write_long( - _SCHEMA_UTTERANCE_EVENT.members["EndOffsetMillis"], - self.end_offset_millis, - ) - - if self.transcript is not None: - serializer.write_string( - _SCHEMA_UTTERANCE_EVENT.members["Transcript"], self.transcript - ) - - if self.items is not None: - _serialize_call_analytics_item_list( - serializer, _SCHEMA_UTTERANCE_EVENT.members["Items"], self.items - ) - - if self.entities is not None: - _serialize_call_analytics_entity_list( - serializer, _SCHEMA_UTTERANCE_EVENT.members["Entities"], self.entities - ) - - if self.sentiment is not None: - serializer.write_string( - _SCHEMA_UTTERANCE_EVENT.members["Sentiment"], self.sentiment - ) - - if self.issues_detected is not None: - _serialize_issues_detected( - serializer, - _SCHEMA_UTTERANCE_EVENT.members["IssuesDetected"], - self.issues_detected, - ) - - if self.language_code is not None: - serializer.write_string( - _SCHEMA_UTTERANCE_EVENT.members["LanguageCode"], self.language_code - ) - - if self.language_identification is not None: - _serialize_call_analytics_language_identification( - serializer, - _SCHEMA_UTTERANCE_EVENT.members["LanguageIdentification"], - self.language_identification, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["utterance_id"] = de.read_string( - _SCHEMA_UTTERANCE_EVENT.members["UtteranceId"] - ) - - case 1: - kwargs["is_partial"] = de.read_boolean( - _SCHEMA_UTTERANCE_EVENT.members["IsPartial"] - ) - - case 2: - kwargs["participant_role"] = ParticipantRole( - de.read_string( - _SCHEMA_UTTERANCE_EVENT.members["ParticipantRole"] - ) - ) - - case 3: - kwargs["begin_offset_millis"] = de.read_long( - _SCHEMA_UTTERANCE_EVENT.members["BeginOffsetMillis"] - ) - - case 4: - kwargs["end_offset_millis"] = de.read_long( - _SCHEMA_UTTERANCE_EVENT.members["EndOffsetMillis"] - ) - - case 5: - kwargs["transcript"] = de.read_string( - _SCHEMA_UTTERANCE_EVENT.members["Transcript"] - ) - - case 6: - kwargs["items"] = _deserialize_call_analytics_item_list( - de, _SCHEMA_UTTERANCE_EVENT.members["Items"] - ) - - case 7: - kwargs["entities"] = _deserialize_call_analytics_entity_list( - de, _SCHEMA_UTTERANCE_EVENT.members["Entities"] - ) - - case 8: - kwargs["sentiment"] = Sentiment( - de.read_string(_SCHEMA_UTTERANCE_EVENT.members["Sentiment"]) - ) - - case 9: - kwargs["issues_detected"] = _deserialize_issues_detected( - de, _SCHEMA_UTTERANCE_EVENT.members["IssuesDetected"] - ) - - case 10: - kwargs["language_code"] = CallAnalyticsLanguageCode( - de.read_string(_SCHEMA_UTTERANCE_EVENT.members["LanguageCode"]) - ) - - case 11: - kwargs["language_identification"] = ( - _deserialize_call_analytics_language_identification( - de, - _SCHEMA_UTTERANCE_EVENT.members["LanguageIdentification"], - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_UTTERANCE_EVENT, consumer=_consumer) - return kwargs - - -@dataclass -class CallAnalyticsTranscriptResultStreamUtteranceEvent: - """ - Contains set of transcription results from one or more audio segments, - along with additional information per your request parameters. This can - include information relating to channel definitions, partial result - stabilization, sentiment, issue detection, and other - transcription-related data. - """ - - value: UtteranceEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CALL_ANALYTICS_TRANSCRIPT_RESULT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CALL_ANALYTICS_TRANSCRIPT_RESULT_STREAM.members["UtteranceEvent"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=UtteranceEvent.deserialize(deserializer)) - - -@dataclass -class CallAnalyticsTranscriptResultStreamCategoryEvent: - """ - Provides information on matched categories that were used to generate - real-time supervisor alerts. - """ - - value: CategoryEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CALL_ANALYTICS_TRANSCRIPT_RESULT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CALL_ANALYTICS_TRANSCRIPT_RESULT_STREAM.members["CategoryEvent"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=CategoryEvent.deserialize(deserializer)) - - -@dataclass -class CallAnalyticsTranscriptResultStreamBadRequestException: - """ - One or more arguments to the `StartStreamTranscription`, - `StartMedicalStreamTranscription`, or - `StartCallAnalyticsStreamTranscription` operation was not valid. For - example, `MediaEncoding` or `LanguageCode` used unsupported values. - Check the specified parameters and try your request again. - """ - - value: BadRequestException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CALL_ANALYTICS_TRANSCRIPT_RESULT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CALL_ANALYTICS_TRANSCRIPT_RESULT_STREAM.members[ - "BadRequestException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=BadRequestException.deserialize(deserializer)) - - -@dataclass -class CallAnalyticsTranscriptResultStreamLimitExceededException: - """ - Your client has exceeded one of the Amazon Transcribe limits, typically - the concurrent stream service quota. This error can also occur if a - stream exceeds the maximum session duration. In rare cases, this error - can also occur if you increase your number of concurrent streams too - quickly. Reduce your number of concurrent streams and try your request - again using an exponential backoff strategy. - """ - - value: LimitExceededException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CALL_ANALYTICS_TRANSCRIPT_RESULT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CALL_ANALYTICS_TRANSCRIPT_RESULT_STREAM.members[ - "LimitExceededException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=LimitExceededException.deserialize(deserializer)) - - -@dataclass -class CallAnalyticsTranscriptResultStreamInternalFailureException: - """ - A problem occurred while processing the audio. Amazon Transcribe - terminated processing. - """ - - value: InternalFailureException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CALL_ANALYTICS_TRANSCRIPT_RESULT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CALL_ANALYTICS_TRANSCRIPT_RESULT_STREAM.members[ - "InternalFailureException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=InternalFailureException.deserialize(deserializer)) - - -@dataclass -class CallAnalyticsTranscriptResultStreamConflictException: - """ - A new stream started with the same session ID. The current stream has - been terminated. - """ - - value: ConflictException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CALL_ANALYTICS_TRANSCRIPT_RESULT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CALL_ANALYTICS_TRANSCRIPT_RESULT_STREAM.members[ - "ConflictException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ConflictException.deserialize(deserializer)) - - -@dataclass -class CallAnalyticsTranscriptResultStreamServiceUnavailableException: - """The service is currently unavailable. Try your request later.""" - - value: ServiceUnavailableException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CALL_ANALYTICS_TRANSCRIPT_RESULT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_CALL_ANALYTICS_TRANSCRIPT_RESULT_STREAM.members[ - "ServiceUnavailableException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ServiceUnavailableException.deserialize(deserializer)) - - -@dataclass -class CallAnalyticsTranscriptResultStreamUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -CallAnalyticsTranscriptResultStream = Union[ - CallAnalyticsTranscriptResultStreamUtteranceEvent - | CallAnalyticsTranscriptResultStreamCategoryEvent - | CallAnalyticsTranscriptResultStreamBadRequestException - | CallAnalyticsTranscriptResultStreamLimitExceededException - | CallAnalyticsTranscriptResultStreamInternalFailureException - | CallAnalyticsTranscriptResultStreamConflictException - | CallAnalyticsTranscriptResultStreamServiceUnavailableException - | CallAnalyticsTranscriptResultStreamUnknown -] -""" -Contains detailed information about your real-time Call Analytics -session. These details are provided in the `UtteranceEvent` and -`CategoryEvent` objects. -""" - - -class _CallAnalyticsTranscriptResultStreamDeserializer: - _result: CallAnalyticsTranscriptResultStream | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> CallAnalyticsTranscriptResultStream: - self._result = None - deserializer.read_struct( - _SCHEMA_CALL_ANALYTICS_TRANSCRIPT_RESULT_STREAM, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - CallAnalyticsTranscriptResultStreamUtteranceEvent.deserialize(de) - ) - - case 1: - self._set_result( - CallAnalyticsTranscriptResultStreamCategoryEvent.deserialize(de) - ) - - case 2: - self._set_result( - CallAnalyticsTranscriptResultStreamBadRequestException.deserialize( - de - ) - ) - - case 3: - self._set_result( - CallAnalyticsTranscriptResultStreamLimitExceededException.deserialize( - de - ) - ) - - case 4: - self._set_result( - CallAnalyticsTranscriptResultStreamInternalFailureException.deserialize( - de - ) - ) - - case 5: - self._set_result( - CallAnalyticsTranscriptResultStreamConflictException.deserialize(de) - ) - - case 6: - self._set_result( - CallAnalyticsTranscriptResultStreamServiceUnavailableException.deserialize( - de - ) - ) - - case _: - self._set_result( - CallAnalyticsTranscriptResultStreamUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: CallAnalyticsTranscriptResultStream) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class ClinicalNoteGenerationStatus(UnknownEnumMixin, StrEnum): - IN_PROGRESS = "IN_PROGRESS" - FAILED = "FAILED" - COMPLETED = "COMPLETED" - - -@dataclass(kw_only=True) -class ClinicalNoteGenerationResult: - """ - The details for clinical note generation, including status, and output - locations for clinical note and aggregated transcript if the analytics - completed, or failure reason if the analytics failed. - """ - - clinical_note_output_location: str | None = None - """Holds the Amazon S3 URI for the output Clinical Note.""" - - transcript_output_location: str | None = None - """Holds the Amazon S3 URI for the output Transcript.""" - - status: str | None = None - """ - The status of the clinical note generation. - - Possible Values: - - - `IN_PROGRESS` - - - `FAILED` - - - `COMPLETED` - - After audio streaming finishes, and you send a - `MedicalScribeSessionControlEvent` event (with END_OF_SESSION as the - Type), the status is set to `IN_PROGRESS`. If the status is `COMPLETED`, - the analytics completed successfully, and you can find the results at - the locations specified in `ClinicalNoteOutputLocation` and - `TranscriptOutputLocation`. If the status is `FAILED`, `FailureReason` - provides details about the failure. - """ - - failure_reason: str | None = None - """ - If `ClinicalNoteGenerationResult` is `FAILED`, information about why it - failed. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CLINICAL_NOTE_GENERATION_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.clinical_note_output_location is not None: - serializer.write_string( - _SCHEMA_CLINICAL_NOTE_GENERATION_RESULT.members[ - "ClinicalNoteOutputLocation" - ], - self.clinical_note_output_location, - ) - - if self.transcript_output_location is not None: - serializer.write_string( - _SCHEMA_CLINICAL_NOTE_GENERATION_RESULT.members[ - "TranscriptOutputLocation" - ], - self.transcript_output_location, - ) - - if self.status is not None: - serializer.write_string( - _SCHEMA_CLINICAL_NOTE_GENERATION_RESULT.members["Status"], self.status - ) - - if self.failure_reason is not None: - serializer.write_string( - _SCHEMA_CLINICAL_NOTE_GENERATION_RESULT.members["FailureReason"], - self.failure_reason, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["clinical_note_output_location"] = de.read_string( - _SCHEMA_CLINICAL_NOTE_GENERATION_RESULT.members[ - "ClinicalNoteOutputLocation" - ] - ) - - case 1: - kwargs["transcript_output_location"] = de.read_string( - _SCHEMA_CLINICAL_NOTE_GENERATION_RESULT.members[ - "TranscriptOutputLocation" - ] - ) - - case 2: - kwargs["status"] = ClinicalNoteGenerationStatus( - de.read_string( - _SCHEMA_CLINICAL_NOTE_GENERATION_RESULT.members["Status"] - ) - ) - - case 3: - kwargs["failure_reason"] = de.read_string( - _SCHEMA_CLINICAL_NOTE_GENERATION_RESULT.members["FailureReason"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CLINICAL_NOTE_GENERATION_RESULT, consumer=_consumer - ) - return kwargs - - -class MedicalScribeNoteTemplate(UnknownEnumMixin, StrEnum): - HISTORY_AND_PHYSICAL = "HISTORY_AND_PHYSICAL" - GIRPP = "GIRPP" - DAP = "DAP" - SIRP = "SIRP" - BIRP = "BIRP" - BEHAVIORAL_SOAP = "BEHAVIORAL_SOAP" - PHYSICAL_SOAP = "PHYSICAL_SOAP" - - -@dataclass(kw_only=True) -class ClinicalNoteGenerationSettings: - """ - The output configuration for aggregated transcript and clinical note - generation. - """ - - output_bucket_name: str - """ - The name of the Amazon S3 bucket where you want the output of Amazon Web - Services HealthScribe post-stream analytics stored. Don't include the - `S3://` prefix of the specified bucket. - - HealthScribe outputs transcript and clinical note files under the - prefix: - `S3://$output-bucket-name/healthscribe-streaming/session-id/post-stream-analytics/clinical-notes` - - The role `ResourceAccessRoleArn` specified in the - `MedicalScribeConfigurationEvent` must have permission to use the - specified location. You can change Amazon S3 permissions using the - [Amazon Web Services Management - Console](https://console.aws.amazon.com/s3) . See also [Permissions - Required for IAM User - Roles](https://docs.aws.amazon.com/transcribe/latest/dg/security_iam_id-based-policy-examples.html#auth-role-iam-user) - . - """ - - note_template: str | None = None - """ - Specify one of the following templates to use for the clinical note - summary. The default is `HISTORY_AND_PHYSICAL`. - - - HISTORY_AND_PHYSICAL: Provides summaries for key sections of the - clinical documentation. Examples of sections include Chief Complaint, - History of Present Illness, Review of Systems, Past Medical History, - Assessment, and Plan. - - - GIRPP: Provides summaries based on the patients progress toward goals. - Examples of sections include Goal, Intervention, Response, Progress, - and Plan. - - - BIRP: Focuses on the patient's behavioral patterns and responses. - Examples of sections include Behavior, Intervention, Response, and - Plan. - - - SIRP: Emphasizes the situational context of therapy. Examples of - sections include Situation, Intervention, Response, and Plan. - - - DAP: Provides a simplified format for clinical documentation. Examples - of sections include Data, Assessment, and Plan. - - - BEHAVIORAL_SOAP: Behavioral health focused documentation format. - Examples of sections include Subjective, Objective, Assessment, and - Plan. - - - PHYSICAL_SOAP: Physical health focused documentation format. Examples - of sections include Subjective, Objective, Assessment, and Plan. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_CLINICAL_NOTE_GENERATION_SETTINGS, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_CLINICAL_NOTE_GENERATION_SETTINGS.members["OutputBucketName"], - self.output_bucket_name, - ) - if self.note_template is not None: - serializer.write_string( - _SCHEMA_CLINICAL_NOTE_GENERATION_SETTINGS.members["NoteTemplate"], - self.note_template, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["output_bucket_name"] = de.read_string( - _SCHEMA_CLINICAL_NOTE_GENERATION_SETTINGS.members[ - "OutputBucketName" - ] - ) - - case 1: - kwargs["note_template"] = MedicalScribeNoteTemplate( - de.read_string( - _SCHEMA_CLINICAL_NOTE_GENERATION_SETTINGS.members[ - "NoteTemplate" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_CLINICAL_NOTE_GENERATION_SETTINGS, consumer=_consumer - ) - if "output_bucket_name" not in kwargs: - kwargs["output_bucket_name"] = "" - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls(output_bucket_name="") - - -class ContentIdentificationType(UnknownEnumMixin, StrEnum): - PII = "PII" - - -class ContentRedactionType(UnknownEnumMixin, StrEnum): - PII = "PII" - - -@dataclass(kw_only=True) -class GetMedicalScribeStreamInput: - """Dataclass for GetMedicalScribeStreamInput structure.""" - - session_id: str | None = None - """ - The identifier of the HealthScribe streaming session you want - information about. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_MEDICAL_SCRIBE_STREAM_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.session_id is not None: - serializer.write_string( - _SCHEMA_GET_MEDICAL_SCRIBE_STREAM_INPUT.members["SessionId"], - self.session_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["session_id"] = de.read_string( - _SCHEMA_GET_MEDICAL_SCRIBE_STREAM_INPUT.members["SessionId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_MEDICAL_SCRIBE_STREAM_INPUT, consumer=_consumer - ) - return kwargs - - -class MedicalScribeParticipantRole(UnknownEnumMixin, StrEnum): - PATIENT = "PATIENT" - CLINICIAN = "CLINICIAN" - - -@dataclass(kw_only=True) -class MedicalScribeChannelDefinition: - """ - Makes it possible to specify which speaker is on which channel. For - example, if the clinician is the first participant to speak, you would - set the `ChannelId` of the first `ChannelDefinition` in the list to `0` - (to indicate the first channel) and `ParticipantRole` to `CLINICIAN` (to - indicate that it's the clinician speaking). Then you would set the - `ChannelId` of the second `ChannelDefinition` in the list to `1` (to - indicate the second channel) and `ParticipantRole` to `PATIENT` (to - indicate that it's the patient speaking). - - If you don't specify a channel definition, HealthScribe will diarize - the transcription and identify speaker roles for each speaker. - """ - - participant_role: str - """ - Specify the participant that you want to flag. The allowed options are - `CLINICIAN` and `PATIENT`. - """ - - channel_id: int = 0 - """Specify the audio channel you want to define.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDICAL_SCRIBE_CHANNEL_DEFINITION, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_integer( - _SCHEMA_MEDICAL_SCRIBE_CHANNEL_DEFINITION.members["ChannelId"], - self.channel_id, - ) - serializer.write_string( - _SCHEMA_MEDICAL_SCRIBE_CHANNEL_DEFINITION.members["ParticipantRole"], - self.participant_role, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["channel_id"] = de.read_integer( - _SCHEMA_MEDICAL_SCRIBE_CHANNEL_DEFINITION.members["ChannelId"] - ) - - case 1: - kwargs["participant_role"] = MedicalScribeParticipantRole( - de.read_string( - _SCHEMA_MEDICAL_SCRIBE_CHANNEL_DEFINITION.members[ - "ParticipantRole" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MEDICAL_SCRIBE_CHANNEL_DEFINITION, consumer=_consumer - ) - if "participant_role" not in kwargs: - kwargs["participant_role"] = MedicalScribeParticipantRole._corrected("") - return kwargs - - -def _serialize_medical_scribe_channel_definitions( - serializer: ShapeSerializer, - schema: Schema, - value: list[MedicalScribeChannelDefinition], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_medical_scribe_channel_definitions( - deserializer: ShapeDeserializer, schema: Schema -) -> list[MedicalScribeChannelDefinition]: - result: list[MedicalScribeChannelDefinition] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(MedicalScribeChannelDefinition.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -def _serialize_kms_encryption_context_map( - serializer: ShapeSerializer, schema: Schema, value: dict[str, str] -) -> None: - with serializer.begin_map(schema, len(value)) as m: - value_schema = schema.members["value"] - for k, v in value.items(): - m.entry(k, lambda vs: vs.write_string(value_schema, v)) - - -def _deserialize_kms_encryption_context_map( - deserializer: ShapeDeserializer, schema: Schema -) -> dict[str, str]: - result: dict[str, str] = {} - value_schema = schema.members["value"] - - def _read_value(k: str, d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result[k] = d.read_string(value_schema) - - deserializer.read_map(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class MedicalScribeEncryptionSettings: - """ - Contains encryption related settings to be used for data encryption with - Key Management Service, including KmsEncryptionContext and KmsKeyId. The - KmsKeyId is required, while KmsEncryptionContext is optional for - additional layer of security. - - By default, Amazon Web Services HealthScribe provides encryption at rest - to protect sensitive customer data using Amazon S3-managed keys. - HealthScribe uses the KMS key you specify as a second layer of - encryption. - - Your `ResourceAccessRoleArn` must permission to use your KMS key. For - more information, see [Data Encryption at rest for Amazon Web Services - HealthScribe](https://docs.aws.amazon.com/transcribe/latest/dg/health-scribe-encryption.html). - """ - - kms_key_id: str - """ - The ID of the KMS key you want to use for your streaming session. You - can specify its KMS key ID, key Amazon Resource Name (ARN), alias name, - or alias ARN. When using an alias name, prefix it with `"alias/"`. To - specify a KMS key in a different Amazon Web Services account, you must - use the key ARN or alias ARN. - - For example: - - - Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - - - Key ARN: - arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - - - Alias name: alias/ExampleAlias - - - Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias - - To get the key ID and key ARN for a KMS key, use the - [ListKeys](https://docs.aws.amazon.com/kms/latest/APIReference/API_ListKeys.html) - or - [DescribeKey](https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html) - KMS API operations. To get the alias name and alias ARN, use - [ListKeys](https://docs.aws.amazon.com/kms/latest/APIReference/API_ListAliases.html) - API operation. - """ - - kms_encryption_context: dict[str, str] | None = None - """ - A map of plain text, non-secret key:value pairs, known as encryption - context pairs, that provide an added layer of security for your data. - For more information, see [KMSencryption - context](https://docs.aws.amazon.com/transcribe/latest/dg/key-management.html#kms-context) - and [Asymmetric keys in - KMS](https://docs.aws.amazon.com/transcribe/latest/dg/symmetric-asymmetric.html) - . - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDICAL_SCRIBE_ENCRYPTION_SETTINGS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.kms_encryption_context is not None: - _serialize_kms_encryption_context_map( - serializer, - _SCHEMA_MEDICAL_SCRIBE_ENCRYPTION_SETTINGS.members[ - "KmsEncryptionContext" - ], - self.kms_encryption_context, - ) - - serializer.write_string( - _SCHEMA_MEDICAL_SCRIBE_ENCRYPTION_SETTINGS.members["KmsKeyId"], - self.kms_key_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["kms_encryption_context"] = ( - _deserialize_kms_encryption_context_map( - de, - _SCHEMA_MEDICAL_SCRIBE_ENCRYPTION_SETTINGS.members[ - "KmsEncryptionContext" - ], - ) - ) - - case 1: - kwargs["kms_key_id"] = de.read_string( - _SCHEMA_MEDICAL_SCRIBE_ENCRYPTION_SETTINGS.members["KmsKeyId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MEDICAL_SCRIBE_ENCRYPTION_SETTINGS, consumer=_consumer - ) - if "kms_key_id" not in kwargs: - kwargs["kms_key_id"] = "" - return kwargs - - -class MedicalScribeLanguageCode(UnknownEnumMixin, StrEnum): - EN_US = "en-US" - - -class MedicalScribeMediaEncoding(UnknownEnumMixin, StrEnum): - PCM = "pcm" - OGG_OPUS = "ogg-opus" - FLAC = "flac" - - -@dataclass(kw_only=True) -class MedicalScribePostStreamAnalyticsResult: - """Contains details for the result of post-stream analytics.""" - - clinical_note_generation_result: ClinicalNoteGenerationResult | None = None - """Provides the Clinical Note Generation result for post-stream analytics.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MEDICAL_SCRIBE_POST_STREAM_ANALYTICS_RESULT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.clinical_note_generation_result is not None: - serializer.write_struct( - _SCHEMA_MEDICAL_SCRIBE_POST_STREAM_ANALYTICS_RESULT.members[ - "ClinicalNoteGenerationResult" - ], - self.clinical_note_generation_result, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["clinical_note_generation_result"] = ( - ClinicalNoteGenerationResult.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MEDICAL_SCRIBE_POST_STREAM_ANALYTICS_RESULT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class MedicalScribePostStreamAnalyticsSettings: - """The settings for post-stream analytics.""" - - clinical_note_generation_settings: ClinicalNoteGenerationSettings - """Specify settings for the post-stream clinical note generation.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MEDICAL_SCRIBE_POST_STREAM_ANALYTICS_SETTINGS, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MEDICAL_SCRIBE_POST_STREAM_ANALYTICS_SETTINGS.members[ - "ClinicalNoteGenerationSettings" - ], - self.clinical_note_generation_settings, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["clinical_note_generation_settings"] = ( - ClinicalNoteGenerationSettings.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MEDICAL_SCRIBE_POST_STREAM_ANALYTICS_SETTINGS, consumer=_consumer - ) - if "clinical_note_generation_settings" not in kwargs: - kwargs["clinical_note_generation_settings"] = ( - ClinicalNoteGenerationSettings._smithy_default() - ) - return kwargs - - @classmethod - def _smithy_default(cls) -> Self: - return cls( - clinical_note_generation_settings=ClinicalNoteGenerationSettings._smithy_default() - ) - - -class MedicalScribeStreamStatus(UnknownEnumMixin, StrEnum): - IN_PROGRESS = "IN_PROGRESS" - PAUSED = "PAUSED" - FAILED = "FAILED" - COMPLETED = "COMPLETED" - - -class MedicalScribeVocabularyFilterMethod(UnknownEnumMixin, StrEnum): - REMOVE = "remove" - MASK = "mask" - TAG = "tag" - - -@dataclass(kw_only=True) -class MedicalScribeStreamDetails: - """ - Contains details about a Amazon Web Services HealthScribe streaming - session. - """ - - session_id: str | None = None - """The identifier of the HealthScribe streaming session.""" - - stream_created_at: datetime | None = None - """The date and time when the HealthScribe streaming session was created.""" - - stream_ended_at: datetime | None = None - """The date and time when the HealthScribe streaming session was ended.""" - - language_code: str | None = None - """The Language Code of the HealthScribe streaming session.""" - - media_sample_rate_hertz: int | None = None - """The sample rate (in hertz) of the HealthScribe streaming session.""" - - media_encoding: str | None = None - """The Media Encoding of the HealthScribe streaming session.""" - - vocabulary_name: str | None = None - """The vocabulary name of the HealthScribe streaming session.""" - - vocabulary_filter_name: str | None = None - """ - The name of the vocabulary filter used for the HealthScribe streaming - session . - """ - - vocabulary_filter_method: str | None = None - """ - The method of the vocabulary filter for the HealthScribe streaming - session. - """ - - resource_access_role_arn: str | None = None - """ - The Amazon Resource Name (ARN) of the role used in the HealthScribe - streaming session. - """ - - channel_definitions: list[MedicalScribeChannelDefinition] | None = None - """The Channel Definitions of the HealthScribe streaming session.""" - - encryption_settings: MedicalScribeEncryptionSettings | None = None - """The Encryption Settings of the HealthScribe streaming session.""" - - stream_status: str | None = None - """ - The streaming status of the HealthScribe streaming session. - - Possible Values: - - - `IN_PROGRESS` - - - `PAUSED` - - - `FAILED` - - - `COMPLETED` - - Note: - This status is specific to real-time streaming. A `COMPLETED` status - doesn't mean that the post-stream analytics is complete. To get status - of an analytics result, check the `Status` field for the analytics - result within the `MedicalScribePostStreamAnalyticsResult`. For example, - you can view the status of the `ClinicalNoteGenerationResult`. - """ - - post_stream_analytics_settings: MedicalScribePostStreamAnalyticsSettings | None = ( - None - ) - """ - The post-stream analytics settings of the HealthScribe streaming - session. - """ - - post_stream_analytics_result: MedicalScribePostStreamAnalyticsResult | None = None - """ - The result of post-stream analytics for the HealthScribe streaming - session. - """ - - medical_scribe_context_provided: bool | None = None - """ - Indicates whether the `MedicalScribeContext` object was provided when - the stream was started. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDICAL_SCRIBE_STREAM_DETAILS, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.session_id is not None: - serializer.write_string( - _SCHEMA_MEDICAL_SCRIBE_STREAM_DETAILS.members["SessionId"], - self.session_id, - ) - - if self.stream_created_at is not None: - serializer.write_timestamp( - _SCHEMA_MEDICAL_SCRIBE_STREAM_DETAILS.members["StreamCreatedAt"], - self.stream_created_at, - ) - - if self.stream_ended_at is not None: - serializer.write_timestamp( - _SCHEMA_MEDICAL_SCRIBE_STREAM_DETAILS.members["StreamEndedAt"], - self.stream_ended_at, - ) - - if self.language_code is not None: - serializer.write_string( - _SCHEMA_MEDICAL_SCRIBE_STREAM_DETAILS.members["LanguageCode"], - self.language_code, - ) - - if self.media_sample_rate_hertz is not None: - serializer.write_integer( - _SCHEMA_MEDICAL_SCRIBE_STREAM_DETAILS.members["MediaSampleRateHertz"], - self.media_sample_rate_hertz, - ) - - if self.media_encoding is not None: - serializer.write_string( - _SCHEMA_MEDICAL_SCRIBE_STREAM_DETAILS.members["MediaEncoding"], - self.media_encoding, - ) - - if self.vocabulary_name is not None: - serializer.write_string( - _SCHEMA_MEDICAL_SCRIBE_STREAM_DETAILS.members["VocabularyName"], - self.vocabulary_name, - ) - - if self.vocabulary_filter_name is not None: - serializer.write_string( - _SCHEMA_MEDICAL_SCRIBE_STREAM_DETAILS.members["VocabularyFilterName"], - self.vocabulary_filter_name, - ) - - if self.vocabulary_filter_method is not None: - serializer.write_string( - _SCHEMA_MEDICAL_SCRIBE_STREAM_DETAILS.members["VocabularyFilterMethod"], - self.vocabulary_filter_method, - ) - - if self.resource_access_role_arn is not None: - serializer.write_string( - _SCHEMA_MEDICAL_SCRIBE_STREAM_DETAILS.members["ResourceAccessRoleArn"], - self.resource_access_role_arn, - ) - - if self.channel_definitions is not None: - _serialize_medical_scribe_channel_definitions( - serializer, - _SCHEMA_MEDICAL_SCRIBE_STREAM_DETAILS.members["ChannelDefinitions"], - self.channel_definitions, - ) - - if self.encryption_settings is not None: - serializer.write_struct( - _SCHEMA_MEDICAL_SCRIBE_STREAM_DETAILS.members["EncryptionSettings"], - self.encryption_settings, - ) - - if self.stream_status is not None: - serializer.write_string( - _SCHEMA_MEDICAL_SCRIBE_STREAM_DETAILS.members["StreamStatus"], - self.stream_status, - ) - - if self.post_stream_analytics_settings is not None: - serializer.write_struct( - _SCHEMA_MEDICAL_SCRIBE_STREAM_DETAILS.members[ - "PostStreamAnalyticsSettings" - ], - self.post_stream_analytics_settings, - ) - - if self.post_stream_analytics_result is not None: - serializer.write_struct( - _SCHEMA_MEDICAL_SCRIBE_STREAM_DETAILS.members[ - "PostStreamAnalyticsResult" - ], - self.post_stream_analytics_result, - ) - - if self.medical_scribe_context_provided is not None: - serializer.write_boolean( - _SCHEMA_MEDICAL_SCRIBE_STREAM_DETAILS.members[ - "MedicalScribeContextProvided" - ], - self.medical_scribe_context_provided, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["session_id"] = de.read_string( - _SCHEMA_MEDICAL_SCRIBE_STREAM_DETAILS.members["SessionId"] - ) - - case 1: - kwargs["stream_created_at"] = de.read_timestamp( - _SCHEMA_MEDICAL_SCRIBE_STREAM_DETAILS.members["StreamCreatedAt"] - ) - - case 2: - kwargs["stream_ended_at"] = de.read_timestamp( - _SCHEMA_MEDICAL_SCRIBE_STREAM_DETAILS.members["StreamEndedAt"] - ) - - case 3: - kwargs["language_code"] = MedicalScribeLanguageCode( - de.read_string( - _SCHEMA_MEDICAL_SCRIBE_STREAM_DETAILS.members[ - "LanguageCode" - ] - ) - ) - - case 4: - kwargs["media_sample_rate_hertz"] = de.read_integer( - _SCHEMA_MEDICAL_SCRIBE_STREAM_DETAILS.members[ - "MediaSampleRateHertz" - ] - ) - - case 5: - kwargs["media_encoding"] = MedicalScribeMediaEncoding( - de.read_string( - _SCHEMA_MEDICAL_SCRIBE_STREAM_DETAILS.members[ - "MediaEncoding" - ] - ) - ) - - case 6: - kwargs["vocabulary_name"] = de.read_string( - _SCHEMA_MEDICAL_SCRIBE_STREAM_DETAILS.members["VocabularyName"] - ) - - case 7: - kwargs["vocabulary_filter_name"] = de.read_string( - _SCHEMA_MEDICAL_SCRIBE_STREAM_DETAILS.members[ - "VocabularyFilterName" - ] - ) - - case 8: - kwargs["vocabulary_filter_method"] = ( - MedicalScribeVocabularyFilterMethod( - de.read_string( - _SCHEMA_MEDICAL_SCRIBE_STREAM_DETAILS.members[ - "VocabularyFilterMethod" - ] - ) - ) - ) - - case 9: - kwargs["resource_access_role_arn"] = de.read_string( - _SCHEMA_MEDICAL_SCRIBE_STREAM_DETAILS.members[ - "ResourceAccessRoleArn" - ] - ) - - case 10: - kwargs["channel_definitions"] = ( - _deserialize_medical_scribe_channel_definitions( - de, - _SCHEMA_MEDICAL_SCRIBE_STREAM_DETAILS.members[ - "ChannelDefinitions" - ], - ) - ) - - case 11: - kwargs["encryption_settings"] = ( - MedicalScribeEncryptionSettings.deserialize(de) - ) - - case 12: - kwargs["stream_status"] = MedicalScribeStreamStatus( - de.read_string( - _SCHEMA_MEDICAL_SCRIBE_STREAM_DETAILS.members[ - "StreamStatus" - ] - ) - ) - - case 13: - kwargs["post_stream_analytics_settings"] = ( - MedicalScribePostStreamAnalyticsSettings.deserialize(de) - ) - - case 14: - kwargs["post_stream_analytics_result"] = ( - MedicalScribePostStreamAnalyticsResult.deserialize(de) - ) - - case 15: - kwargs["medical_scribe_context_provided"] = de.read_boolean( - _SCHEMA_MEDICAL_SCRIBE_STREAM_DETAILS.members[ - "MedicalScribeContextProvided" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MEDICAL_SCRIBE_STREAM_DETAILS, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class GetMedicalScribeStreamOutput: - """Dataclass for GetMedicalScribeStreamOutput structure.""" - - medical_scribe_stream_details: MedicalScribeStreamDetails | None = None - """Provides details about a HealthScribe streaming session.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_GET_MEDICAL_SCRIBE_STREAM_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.medical_scribe_stream_details is not None: - serializer.write_struct( - _SCHEMA_GET_MEDICAL_SCRIBE_STREAM_OUTPUT.members[ - "MedicalScribeStreamDetails" - ], - self.medical_scribe_stream_details, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["medical_scribe_stream_details"] = ( - MedicalScribeStreamDetails.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_GET_MEDICAL_SCRIBE_STREAM_OUTPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class ResourceNotFoundException(ServiceError): - """The request references a resource which doesn't exist.""" - - fault: Literal["client", "server"] | None = "client" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.message is not None: - serializer.write_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["Message"], self.message - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["message"] = de.read_string( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION.members["Message"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, consumer=_consumer - ) - return kwargs - - -GET_MEDICAL_SCRIBE_STREAM = APIOperation( - input=GetMedicalScribeStreamInput, - output=GetMedicalScribeStreamOutput, - schema=_SCHEMA_GET_MEDICAL_SCRIBE_STREAM, - input_schema=_SCHEMA_GET_MEDICAL_SCRIBE_STREAM_INPUT, - output_schema=_SCHEMA_GET_MEDICAL_SCRIBE_STREAM_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.transcribestreaming#BadRequestException" - ): BadRequestException, - ShapeID( - "com.amazonaws.transcribestreaming#InternalFailureException" - ): InternalFailureException, - ShapeID( - "com.amazonaws.transcribestreaming#LimitExceededException" - ): LimitExceededException, - ShapeID( - "com.amazonaws.transcribestreaming#ResourceNotFoundException" - ): ResourceNotFoundException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_INTERNAL_FAILURE_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_RESOURCE_NOT_FOUND_EXCEPTION, - ], -) - - -class LanguageCode(UnknownEnumMixin, StrEnum): - EN_US = "en-US" - EN_GB = "en-GB" - ES_US = "es-US" - FR_CA = "fr-CA" - FR_FR = "fr-FR" - EN_AU = "en-AU" - IT_IT = "it-IT" - DE_DE = "de-DE" - PT_BR = "pt-BR" - JA_JP = "ja-JP" - KO_KR = "ko-KR" - ZH_CN = "zh-CN" - TH_TH = "th-TH" - ES_ES = "es-ES" - AR_SA = "ar-SA" - PT_PT = "pt-PT" - CA_ES = "ca-ES" - AR_AE = "ar-AE" - HI_IN = "hi-IN" - ZH_HK = "zh-HK" - NL_NL = "nl-NL" - NO_NO = "no-NO" - SV_SE = "sv-SE" - PL_PL = "pl-PL" - FI_FI = "fi-FI" - ZH_TW = "zh-TW" - EN_IN = "en-IN" - EN_IE = "en-IE" - EN_NZ = "en-NZ" - EN_AB = "en-AB" - EN_ZA = "en-ZA" - EN_WL = "en-WL" - DE_CH = "de-CH" - AF_ZA = "af-ZA" - EU_ES = "eu-ES" - HR_HR = "hr-HR" - CS_CZ = "cs-CZ" - DA_DK = "da-DK" - FA_IR = "fa-IR" - GL_ES = "gl-ES" - EL_GR = "el-GR" - HE_IL = "he-IL" - ID_ID = "id-ID" - LV_LV = "lv-LV" - MS_MY = "ms-MY" - RO_RO = "ro-RO" - RU_RU = "ru-RU" - SR_RS = "sr-RS" - SK_SK = "sk-SK" - SO_SO = "so-SO" - TL_PH = "tl-PH" - UK_UA = "uk-UA" - VI_VN = "vi-VN" - ZU_ZA = "zu-ZA" - AM_ET = "am-ET" - BE_BY = "be-BY" - BG_BG = "bg-BG" - BN_IN = "bn-IN" - BS_BA = "bs-BA" - CKB_IQ = "ckb-IQ" - CKB_IR = "ckb-IR" - CY_WL = "cy-WL" - ES_MX = "es-MX" - ET_ET = "et-ET" - FA_AF = "fa-AF" - GU_IN = "gu-IN" - HT_HT = "ht-HT" - HU_HU = "hu-HU" - HY_AM = "hy-AM" - IS_IS = "is-IS" - JV_ID = "jv-ID" - KA_GE = "ka-GE" - KAB_DZ = "kab-DZ" - KK_KZ = "kk-KZ" - KM_KH = "km-KH" - KN_IN = "kn-IN" - LG_IN = "lg-IN" - LT_LT = "lt-LT" - MK_MK = "mk-MK" - ML_IN = "ml-IN" - MR_IN = "mr-IN" - MY_MM = "my-MM" - NE_NP = "ne-NP" - OR_IN = "or-IN" - PA_IN = "pa-IN" - PS_AF = "ps-AF" - SI_LK = "si-LK" - SL_SI = "sl-SI" - SQ_AL = "sq-AL" - SU_ID = "su-ID" - SW_BI = "sw-BI" - SW_KE = "sw-KE" - SW_RW = "sw-RW" - SW_TZ = "sw-TZ" - SW_UG = "sw-UG" - TA_IN = "ta-IN" - TE_IN = "te-IN" - TR_TR = "tr-TR" - UZ_UZ = "uz-UZ" - - -@dataclass(kw_only=True) -class LanguageWithScore: - """ - The language code that represents the language identified in your audio, - including the associated confidence score. If you enabled channel - identification in your request and each channel contained a different - language, you will have more than one `LanguageWithScore` result. - """ - - language_code: str | None = None - """The language code of the identified language.""" - - score: float = 0 - """ - The confidence score associated with the identified language code. - Confidence scores are values between zero and one; larger values - indicate a higher confidence in the identified language. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_LANGUAGE_WITH_SCORE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.language_code is not None: - serializer.write_string( - _SCHEMA_LANGUAGE_WITH_SCORE.members["LanguageCode"], self.language_code - ) - - serializer.write_double( - _SCHEMA_LANGUAGE_WITH_SCORE.members["Score"], self.score - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["language_code"] = LanguageCode( - de.read_string( - _SCHEMA_LANGUAGE_WITH_SCORE.members["LanguageCode"] - ) - ) - - case 1: - kwargs["score"] = de.read_double( - _SCHEMA_LANGUAGE_WITH_SCORE.members["Score"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_LANGUAGE_WITH_SCORE, consumer=_consumer) - return kwargs - - -def _serialize_language_identification( - serializer: ShapeSerializer, schema: Schema, value: list[LanguageWithScore] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_language_identification( - deserializer: ShapeDeserializer, schema: Schema -) -> list[LanguageWithScore]: - result: list[LanguageWithScore] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(LanguageWithScore.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class MediaEncoding(UnknownEnumMixin, StrEnum): - PCM = "pcm" - OGG_OPUS = "ogg-opus" - FLAC = "flac" - G711_ALAW = "g711-alaw" - G711_ULAW = "g711-ulaw" - G729 = "g729" - - -@dataclass(kw_only=True) -class MedicalEntity: - """ - Contains entities identified as personal health information (PHI) in - your transcription output, along with various associated attributes. - Examples include category, confidence score, type, stability score, and - start and end times. - """ - - start_time: float = 0 - """The start time, in seconds, of the utterance that was identified as PHI.""" - - end_time: float = 0 - """The end time, in seconds, of the utterance that was identified as PHI.""" - - category: str | None = None - """The category of information identified. The only category is `PHI`.""" - - content: str | None = None - """The word or words identified as PHI.""" - - confidence: float | None = None - """ - The confidence score associated with the identified PHI entity in your - audio. - - Confidence scores are values between 0 and 1. A larger value indicates a - higher probability that the identified entity correctly matches the - entity spoken in your media. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDICAL_ENTITY, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_double( - _SCHEMA_MEDICAL_ENTITY.members["StartTime"], self.start_time - ) - serializer.write_double( - _SCHEMA_MEDICAL_ENTITY.members["EndTime"], self.end_time - ) - if self.category is not None: - serializer.write_string( - _SCHEMA_MEDICAL_ENTITY.members["Category"], self.category - ) - - if self.content is not None: - serializer.write_string( - _SCHEMA_MEDICAL_ENTITY.members["Content"], self.content - ) - - if self.confidence is not None: - serializer.write_double( - _SCHEMA_MEDICAL_ENTITY.members["Confidence"], self.confidence - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["start_time"] = de.read_double( - _SCHEMA_MEDICAL_ENTITY.members["StartTime"] - ) - - case 1: - kwargs["end_time"] = de.read_double( - _SCHEMA_MEDICAL_ENTITY.members["EndTime"] - ) - - case 2: - kwargs["category"] = de.read_string( - _SCHEMA_MEDICAL_ENTITY.members["Category"] - ) - - case 3: - kwargs["content"] = de.read_string( - _SCHEMA_MEDICAL_ENTITY.members["Content"] - ) - - case 4: - kwargs["confidence"] = de.read_double( - _SCHEMA_MEDICAL_ENTITY.members["Confidence"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MEDICAL_ENTITY, consumer=_consumer) - return kwargs - - -def _serialize_medical_entity_list( - serializer: ShapeSerializer, schema: Schema, value: list[MedicalEntity] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_medical_entity_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[MedicalEntity]: - result: list[MedicalEntity] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(MedicalEntity.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class MedicalItem: - """ - A word, phrase, or punctuation mark in your transcription output, along - with various associated attributes, such as confidence score, type, and - start and end times. - """ - - start_time: float = 0 - """The start time, in seconds, of the transcribed item.""" - - end_time: float = 0 - """The end time, in seconds, of the transcribed item.""" - - type: str | None = None - """ - The type of item identified. Options are: `PRONUNCIATION` (spoken words) - and `PUNCTUATION`. - """ - - content: str | None = None - """The word or punctuation that was transcribed.""" - - confidence: float | None = None - """ - The confidence score associated with a word or phrase in your - transcript. - - Confidence scores are values between 0 and 1. A larger value indicates a - higher probability that the identified item correctly matches the item - spoken in your media. - """ - - speaker: str | None = None - """ - If speaker partitioning is enabled, `Speaker` labels the speaker of the - specified item. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDICAL_ITEM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_double( - _SCHEMA_MEDICAL_ITEM.members["StartTime"], self.start_time - ) - serializer.write_double(_SCHEMA_MEDICAL_ITEM.members["EndTime"], self.end_time) - if self.type is not None: - serializer.write_string(_SCHEMA_MEDICAL_ITEM.members["Type"], self.type) - - if self.content is not None: - serializer.write_string( - _SCHEMA_MEDICAL_ITEM.members["Content"], self.content - ) - - if self.confidence is not None: - serializer.write_double( - _SCHEMA_MEDICAL_ITEM.members["Confidence"], self.confidence - ) - - if self.speaker is not None: - serializer.write_string( - _SCHEMA_MEDICAL_ITEM.members["Speaker"], self.speaker - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["start_time"] = de.read_double( - _SCHEMA_MEDICAL_ITEM.members["StartTime"] - ) - - case 1: - kwargs["end_time"] = de.read_double( - _SCHEMA_MEDICAL_ITEM.members["EndTime"] - ) - - case 2: - kwargs["type"] = ItemType( - de.read_string(_SCHEMA_MEDICAL_ITEM.members["Type"]) - ) - - case 3: - kwargs["content"] = de.read_string( - _SCHEMA_MEDICAL_ITEM.members["Content"] - ) - - case 4: - kwargs["confidence"] = de.read_double( - _SCHEMA_MEDICAL_ITEM.members["Confidence"] - ) - - case 5: - kwargs["speaker"] = de.read_string( - _SCHEMA_MEDICAL_ITEM.members["Speaker"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MEDICAL_ITEM, consumer=_consumer) - return kwargs - - -def _serialize_medical_item_list( - serializer: ShapeSerializer, schema: Schema, value: list[MedicalItem] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_medical_item_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[MedicalItem]: - result: list[MedicalItem] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(MedicalItem.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class MedicalAlternative: - """ - A list of possible alternative transcriptions for the input audio. Each - alternative may contain one or more of `Items`, `Entities`, or - `Transcript`. - """ - - transcript: str | None = None - """Contains transcribed text.""" - - items: list[MedicalItem] | None = None - """ - Contains words, phrases, or punctuation marks in your transcription - output. - """ - - entities: list[MedicalEntity] | None = None - """ - Contains entities identified as personal health information (PHI) in - your transcription output. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDICAL_ALTERNATIVE, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.transcript is not None: - serializer.write_string( - _SCHEMA_MEDICAL_ALTERNATIVE.members["Transcript"], self.transcript - ) - - if self.items is not None: - _serialize_medical_item_list( - serializer, _SCHEMA_MEDICAL_ALTERNATIVE.members["Items"], self.items - ) - - if self.entities is not None: - _serialize_medical_entity_list( - serializer, - _SCHEMA_MEDICAL_ALTERNATIVE.members["Entities"], - self.entities, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["transcript"] = de.read_string( - _SCHEMA_MEDICAL_ALTERNATIVE.members["Transcript"] - ) - - case 1: - kwargs["items"] = _deserialize_medical_item_list( - de, _SCHEMA_MEDICAL_ALTERNATIVE.members["Items"] - ) - - case 2: - kwargs["entities"] = _deserialize_medical_entity_list( - de, _SCHEMA_MEDICAL_ALTERNATIVE.members["Entities"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MEDICAL_ALTERNATIVE, consumer=_consumer) - return kwargs - - -def _serialize_medical_alternative_list( - serializer: ShapeSerializer, schema: Schema, value: list[MedicalAlternative] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_medical_alternative_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[MedicalAlternative]: - result: list[MedicalAlternative] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(MedicalAlternative.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class MedicalContentIdentificationType(UnknownEnumMixin, StrEnum): - PHI = "PHI" - - -@dataclass(kw_only=True) -class MedicalResult: - """ - The `Result` associated with a . - - Contains a set of transcription results from one or more audio segments, - along with additional information per your request parameters. This can - include information relating to alternative transcriptions, channel - identification, partial result stabilization, language identification, - and other transcription-related data. - """ - - result_id: str | None = None - """Provides a unique identifier for the `Result`.""" - - start_time: float = 0 - """The start time, in seconds, of the `Result`.""" - - end_time: float = 0 - """The end time, in seconds, of the `Result`.""" - - is_partial: bool = False - """ - Indicates if the segment is complete. - - If `IsPartial` is `true`, the segment is not complete. If `IsPartial` is - `false`, the segment is complete. - """ - - alternatives: list[MedicalAlternative] | None = None - """ - A list of possible alternative transcriptions for the input audio. Each - alternative may contain one or more of `Items`, `Entities`, or - `Transcript`. - """ - - channel_id: str | None = None - """Indicates the channel identified for the `Result`.""" - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDICAL_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.result_id is not None: - serializer.write_string( - _SCHEMA_MEDICAL_RESULT.members["ResultId"], self.result_id - ) - - serializer.write_double( - _SCHEMA_MEDICAL_RESULT.members["StartTime"], self.start_time - ) - serializer.write_double( - _SCHEMA_MEDICAL_RESULT.members["EndTime"], self.end_time - ) - serializer.write_boolean( - _SCHEMA_MEDICAL_RESULT.members["IsPartial"], self.is_partial - ) - if self.alternatives is not None: - _serialize_medical_alternative_list( - serializer, - _SCHEMA_MEDICAL_RESULT.members["Alternatives"], - self.alternatives, - ) - - if self.channel_id is not None: - serializer.write_string( - _SCHEMA_MEDICAL_RESULT.members["ChannelId"], self.channel_id - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["result_id"] = de.read_string( - _SCHEMA_MEDICAL_RESULT.members["ResultId"] - ) - - case 1: - kwargs["start_time"] = de.read_double( - _SCHEMA_MEDICAL_RESULT.members["StartTime"] - ) - - case 2: - kwargs["end_time"] = de.read_double( - _SCHEMA_MEDICAL_RESULT.members["EndTime"] - ) - - case 3: - kwargs["is_partial"] = de.read_boolean( - _SCHEMA_MEDICAL_RESULT.members["IsPartial"] - ) - - case 4: - kwargs["alternatives"] = _deserialize_medical_alternative_list( - de, _SCHEMA_MEDICAL_RESULT.members["Alternatives"] - ) - - case 5: - kwargs["channel_id"] = de.read_string( - _SCHEMA_MEDICAL_RESULT.members["ChannelId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MEDICAL_RESULT, consumer=_consumer) - return kwargs - - -def _serialize_medical_result_list( - serializer: ShapeSerializer, schema: Schema, value: list[MedicalResult] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_medical_result_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[MedicalResult]: - result: list[MedicalResult] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(MedicalResult.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class MedicalScribeAudioEvent: - """ - A wrapper for your audio chunks - - For more information, see [Event stream - encoding](https://docs.aws.amazon.com/transcribe/latest/dg/event-stream.html). - """ - - audio_chunk: bytes - """ - An audio blob containing the next segment of audio from your - application, with a maximum duration of 1 second. The maximum size in - bytes varies based on audio properties. - - Find recommended size in [Transcribing streaming best - practices](https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html#best-practices). - - Size calculation: - `Duration (s) * Sample Rate (Hz) * Number of Channels * 2 (Bytes per Sample)` - - For example, a 1-second chunk of 16 kHz, 2-channel, 16-bit audio would - be `1 * 16000 * 2 * 2 = 64000 bytes`. - - For 8 kHz, 1-channel, 16-bit audio, a 1-second chunk would be - `1 * 8000 * 1 * 2 = 16000 bytes`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDICAL_SCRIBE_AUDIO_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_blob( - _SCHEMA_MEDICAL_SCRIBE_AUDIO_EVENT.members["AudioChunk"], self.audio_chunk - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["audio_chunk"] = de.read_blob( - _SCHEMA_MEDICAL_SCRIBE_AUDIO_EVENT.members["AudioChunk"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MEDICAL_SCRIBE_AUDIO_EVENT, consumer=_consumer) - if "audio_chunk" not in kwargs: - kwargs["audio_chunk"] = b"" - return kwargs - - -class Pronouns(UnknownEnumMixin, StrEnum): - HE_HIM = "HE_HIM" - SHE_HER = "SHE_HER" - THEY_THEM = "THEY_THEM" - - -@dataclass(kw_only=True) -class MedicalScribePatientContext: - """Contains patient-specific information.""" - - pronouns: str | None = field(repr=False, default=None) - """ - The patient's preferred pronouns that the user wants to provide as a - context for clinical note generation . - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDICAL_SCRIBE_PATIENT_CONTEXT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.pronouns is not None: - serializer.write_string( - _SCHEMA_MEDICAL_SCRIBE_PATIENT_CONTEXT.members["Pronouns"], - self.pronouns, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["pronouns"] = Pronouns( - de.read_string( - _SCHEMA_MEDICAL_SCRIBE_PATIENT_CONTEXT.members["Pronouns"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MEDICAL_SCRIBE_PATIENT_CONTEXT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class MedicalScribeContext: - """ - The `MedicalScribeContext` object that contains contextual information - which is used during clinical note generation to add relevant context to - the note. - """ - - patient_context: MedicalScribePatientContext | None = None - """ - Contains patient-specific information used to customize the clinical - note generation. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDICAL_SCRIBE_CONTEXT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.patient_context is not None: - serializer.write_struct( - _SCHEMA_MEDICAL_SCRIBE_CONTEXT.members["PatientContext"], - self.patient_context, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["patient_context"] = MedicalScribePatientContext.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MEDICAL_SCRIBE_CONTEXT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class MedicalScribeConfigurationEvent: - """ - Specify details to configure the streaming session, including channel - definitions, encryption settings, post-stream analytics settings, - resource access role ARN and vocabulary settings. - - Whether you are starting a new session or resuming an existing session, - your first event must be a `MedicalScribeConfigurationEvent`. If you are - resuming a session, then this event must have the same configurations - that you provided to start the session. - """ - - resource_access_role_arn: str - """ - The Amazon Resource Name (ARN) of an IAM role that has permissions to - access the Amazon S3 output bucket you specified, and use your KMS key - if supplied. If the role that you specify doesn't have the appropriate - permissions, your request fails. - - IAM role ARNs have the format - `arn:partition:iam::account:role/role-name-with-path`. For example: - `arn:aws:iam::111122223333:role/Admin`. - - For more information, see [Amazon Web Services - HealthScribe](https://docs.aws.amazon.com/transcribe/latest/dg/health-scribe-streaming.html). - """ - - post_stream_analytics_settings: MedicalScribePostStreamAnalyticsSettings - """Specify settings for post-stream analytics.""" - - vocabulary_name: str | None = None - """ - Specify the name of the custom vocabulary you want to use for your - streaming session. Custom vocabulary names are case-sensitive. - """ - - vocabulary_filter_name: str | None = None - """ - Specify the name of the custom vocabulary filter you want to include in - your streaming session. Custom vocabulary filter names are - case-sensitive. - - If you include `VocabularyFilterName` in the - `MedicalScribeConfigurationEvent`, you must also include - `VocabularyFilterMethod`. - """ - - vocabulary_filter_method: str | None = None - """ - Specify how you want your custom vocabulary filter applied to the - streaming session. - - To replace words with `***`, specify `mask`. - - To delete words, specify `remove`. - - To flag words without changing them, specify `tag`. - """ - - channel_definitions: list[MedicalScribeChannelDefinition] | None = None - """Specify which speaker is on which audio channel.""" - - encryption_settings: MedicalScribeEncryptionSettings | None = None - """Specify the encryption settings for your streaming session.""" - - medical_scribe_context: MedicalScribeContext | None = None - """ - The `MedicalScribeContext` object that contains contextual information - used to generate customized clinical notes. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDICAL_SCRIBE_CONFIGURATION_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.vocabulary_name is not None: - serializer.write_string( - _SCHEMA_MEDICAL_SCRIBE_CONFIGURATION_EVENT.members["VocabularyName"], - self.vocabulary_name, - ) - - if self.vocabulary_filter_name is not None: - serializer.write_string( - _SCHEMA_MEDICAL_SCRIBE_CONFIGURATION_EVENT.members[ - "VocabularyFilterName" - ], - self.vocabulary_filter_name, - ) - - if self.vocabulary_filter_method is not None: - serializer.write_string( - _SCHEMA_MEDICAL_SCRIBE_CONFIGURATION_EVENT.members[ - "VocabularyFilterMethod" - ], - self.vocabulary_filter_method, - ) - - serializer.write_string( - _SCHEMA_MEDICAL_SCRIBE_CONFIGURATION_EVENT.members["ResourceAccessRoleArn"], - self.resource_access_role_arn, - ) - if self.channel_definitions is not None: - _serialize_medical_scribe_channel_definitions( - serializer, - _SCHEMA_MEDICAL_SCRIBE_CONFIGURATION_EVENT.members[ - "ChannelDefinitions" - ], - self.channel_definitions, - ) - - if self.encryption_settings is not None: - serializer.write_struct( - _SCHEMA_MEDICAL_SCRIBE_CONFIGURATION_EVENT.members[ - "EncryptionSettings" - ], - self.encryption_settings, - ) - - serializer.write_struct( - _SCHEMA_MEDICAL_SCRIBE_CONFIGURATION_EVENT.members[ - "PostStreamAnalyticsSettings" - ], - self.post_stream_analytics_settings, - ) - if self.medical_scribe_context is not None: - serializer.write_struct( - _SCHEMA_MEDICAL_SCRIBE_CONFIGURATION_EVENT.members[ - "MedicalScribeContext" - ], - self.medical_scribe_context, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["vocabulary_name"] = de.read_string( - _SCHEMA_MEDICAL_SCRIBE_CONFIGURATION_EVENT.members[ - "VocabularyName" - ] - ) - - case 1: - kwargs["vocabulary_filter_name"] = de.read_string( - _SCHEMA_MEDICAL_SCRIBE_CONFIGURATION_EVENT.members[ - "VocabularyFilterName" - ] - ) - - case 2: - kwargs["vocabulary_filter_method"] = ( - MedicalScribeVocabularyFilterMethod( - de.read_string( - _SCHEMA_MEDICAL_SCRIBE_CONFIGURATION_EVENT.members[ - "VocabularyFilterMethod" - ] - ) - ) - ) - - case 3: - kwargs["resource_access_role_arn"] = de.read_string( - _SCHEMA_MEDICAL_SCRIBE_CONFIGURATION_EVENT.members[ - "ResourceAccessRoleArn" - ] - ) - - case 4: - kwargs["channel_definitions"] = ( - _deserialize_medical_scribe_channel_definitions( - de, - _SCHEMA_MEDICAL_SCRIBE_CONFIGURATION_EVENT.members[ - "ChannelDefinitions" - ], - ) - ) - - case 5: - kwargs["encryption_settings"] = ( - MedicalScribeEncryptionSettings.deserialize(de) - ) - - case 6: - kwargs["post_stream_analytics_settings"] = ( - MedicalScribePostStreamAnalyticsSettings.deserialize(de) - ) - - case 7: - kwargs["medical_scribe_context"] = MedicalScribeContext.deserialize( - de - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MEDICAL_SCRIBE_CONFIGURATION_EVENT, consumer=_consumer - ) - if "resource_access_role_arn" not in kwargs: - kwargs["resource_access_role_arn"] = "" - if "post_stream_analytics_settings" not in kwargs: - kwargs["post_stream_analytics_settings"] = ( - MedicalScribePostStreamAnalyticsSettings._smithy_default() - ) - return kwargs - - -class MedicalScribeSessionControlEventType(UnknownEnumMixin, StrEnum): - END_OF_SESSION = "END_OF_SESSION" - - -@dataclass(kw_only=True) -class MedicalScribeSessionControlEvent: - """Specify the lifecycle of your streaming session.""" - - type: str - """ - The type of `MedicalScribeSessionControlEvent`. - - Possible Values: - - - `END_OF_SESSION` - Indicates the audio streaming is complete. After - you send an END_OF_SESSION event, Amazon Web Services HealthScribe - starts the post-stream analytics. The session can't be resumed after - this event is sent. After Amazon Web Services HealthScribe processes - the event, the real-time `StreamStatus` is `COMPLETED`. You get the - `StreamStatus` and other stream details with the - [GetMedicalScribeStream](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_streaming_GetMedicalScribeStream.html) - API operation. For more information about different streaming - statuses, see the `StreamStatus` description in the - [MedicalScribeStreamDetails](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_streaming_MedicalScribeStreamDetails.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDICAL_SCRIBE_SESSION_CONTROL_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_string( - _SCHEMA_MEDICAL_SCRIBE_SESSION_CONTROL_EVENT.members["Type"], self.type - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["type"] = MedicalScribeSessionControlEventType( - de.read_string( - _SCHEMA_MEDICAL_SCRIBE_SESSION_CONTROL_EVENT.members["Type"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MEDICAL_SCRIBE_SESSION_CONTROL_EVENT, consumer=_consumer - ) - if "type" not in kwargs: - kwargs["type"] = MedicalScribeSessionControlEventType._corrected("") - return kwargs - - -@dataclass -class MedicalScribeInputStreamAudioEvent: - """ - A wrapper for your audio chunks - - For more information, see [Event stream - encoding](https://docs.aws.amazon.com/transcribe/latest/dg/event-stream.html). - """ - - value: MedicalScribeAudioEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDICAL_SCRIBE_INPUT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MEDICAL_SCRIBE_INPUT_STREAM.members["AudioEvent"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=MedicalScribeAudioEvent.deserialize(deserializer)) - - -@dataclass -class MedicalScribeInputStreamSessionControlEvent: - """ - Specify the lifecycle of your streaming session, such as ending the - session. - """ - - value: MedicalScribeSessionControlEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDICAL_SCRIBE_INPUT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MEDICAL_SCRIBE_INPUT_STREAM.members["SessionControlEvent"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=MedicalScribeSessionControlEvent.deserialize(deserializer)) - - -@dataclass -class MedicalScribeInputStreamConfigurationEvent: - """ - Specify additional streaming session configurations beyond those - provided in your initial start request headers. For example, specify - channel definitions, encryption settings, and post-stream analytics - settings. - - Whether you are starting a new session or resuming an existing session, - your first event must be a `MedicalScribeConfigurationEvent`. - """ - - value: MedicalScribeConfigurationEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDICAL_SCRIBE_INPUT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MEDICAL_SCRIBE_INPUT_STREAM.members["ConfigurationEvent"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=MedicalScribeConfigurationEvent.deserialize(deserializer)) - - -@dataclass -class MedicalScribeInputStreamUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -MedicalScribeInputStream = Union[ - MedicalScribeInputStreamAudioEvent - | MedicalScribeInputStreamSessionControlEvent - | MedicalScribeInputStreamConfigurationEvent - | MedicalScribeInputStreamUnknown -] -""" -An encoded stream of events. The stream is encoded as HTTP/2 data -frames. - -An input stream consists of the following types of events. The first -element of the input stream must be the -`MedicalScribeConfigurationEvent` event type. - -- `MedicalScribeConfigurationEvent` - -- `MedicalScribeAudioEvent` - -- `MedicalScribeSessionControlEvent` -""" - - -class _MedicalScribeInputStreamDeserializer: - _result: MedicalScribeInputStream | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> MedicalScribeInputStream: - self._result = None - deserializer.read_struct(_SCHEMA_MEDICAL_SCRIBE_INPUT_STREAM, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(MedicalScribeInputStreamAudioEvent.deserialize(de)) - - case 1: - self._set_result( - MedicalScribeInputStreamSessionControlEvent.deserialize(de) - ) - - case 2: - self._set_result( - MedicalScribeInputStreamConfigurationEvent.deserialize(de) - ) - - case _: - self._set_result( - MedicalScribeInputStreamUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: MedicalScribeInputStream) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class MedicalScribeTranscriptItemType(UnknownEnumMixin, StrEnum): - PRONUNCIATION = "pronunciation" - PUNCTUATION = "punctuation" - - -@dataclass(kw_only=True) -class MedicalScribeTranscriptItem: - """ - A word, phrase, or punctuation mark in your transcription output, along - with various associated attributes, such as confidence score, type, and - start and end times. - """ - - begin_audio_time: float = 0 - """The start time, in milliseconds, of the transcribed item.""" - - end_audio_time: float = 0 - """The end time, in milliseconds, of the transcribed item.""" - - type: str | None = None - """ - The type of item identified. Options are: `PRONUNCIATION` (spoken words) - and `PUNCTUATION`. - """ - - confidence: float | None = None - """ - The confidence score associated with a word or phrase in your - transcript. - - Confidence scores are values between 0 and 1. A larger value indicates a - higher probability that the identified item correctly matches the item - spoken in your media. - """ - - content: str | None = None - """The word, phrase or punctuation mark that was transcribed.""" - - vocabulary_filter_match: bool | None = None - """ - Indicates whether the specified item matches a word in the vocabulary - filter included in your configuration event. If `true`, there is a - vocabulary filter match. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_ITEM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_double( - _SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_ITEM.members["BeginAudioTime"], - self.begin_audio_time, - ) - serializer.write_double( - _SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_ITEM.members["EndAudioTime"], - self.end_audio_time, - ) - if self.type is not None: - serializer.write_string( - _SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_ITEM.members["Type"], self.type - ) - - if self.confidence is not None: - serializer.write_double( - _SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_ITEM.members["Confidence"], - self.confidence, - ) - - if self.content is not None: - serializer.write_string( - _SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_ITEM.members["Content"], self.content - ) - - if self.vocabulary_filter_match is not None: - serializer.write_boolean( - _SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_ITEM.members["VocabularyFilterMatch"], - self.vocabulary_filter_match, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["begin_audio_time"] = de.read_double( - _SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_ITEM.members["BeginAudioTime"] - ) - - case 1: - kwargs["end_audio_time"] = de.read_double( - _SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_ITEM.members["EndAudioTime"] - ) - - case 2: - kwargs["type"] = MedicalScribeTranscriptItemType( - de.read_string( - _SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_ITEM.members["Type"] - ) - ) - - case 3: - kwargs["confidence"] = de.read_double( - _SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_ITEM.members["Confidence"] - ) - - case 4: - kwargs["content"] = de.read_string( - _SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_ITEM.members["Content"] - ) - - case 5: - kwargs["vocabulary_filter_match"] = de.read_boolean( - _SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_ITEM.members[ - "VocabularyFilterMatch" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_ITEM, consumer=_consumer - ) - return kwargs - - -def _serialize_medical_scribe_transcript_item_list( - serializer: ShapeSerializer, - schema: Schema, - value: list[MedicalScribeTranscriptItem], -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_medical_scribe_transcript_item_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[MedicalScribeTranscriptItem]: - result: list[MedicalScribeTranscriptItem] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(MedicalScribeTranscriptItem.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -@dataclass(kw_only=True) -class MedicalScribeTranscriptSegment: - """ - Contains a set of transcription results, along with additional - information of the segment. - """ - - segment_id: str | None = None - """The identifier of the segment.""" - - begin_audio_time: float = 0 - """The start time, in milliseconds, of the segment.""" - - end_audio_time: float = 0 - """The end time, in milliseconds, of the segment.""" - - content: str | None = None - """Contains transcribed text of the segment.""" - - items: list[MedicalScribeTranscriptItem] | None = None - """Contains words, phrases, or punctuation marks in your segment.""" - - is_partial: bool = False - """ - Indicates if the segment is complete. - - If `IsPartial` is `true`, the segment is not complete. If `IsPartial` is - `false`, the segment is complete. - """ - - channel_id: str | None = None - """ - Indicates which audio channel is associated with the - `MedicalScribeTranscriptSegment`. - - If `MedicalScribeChannelDefinition` is not provided in the - `MedicalScribeConfigurationEvent`, then this field will not be included. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_SEGMENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.segment_id is not None: - serializer.write_string( - _SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_SEGMENT.members["SegmentId"], - self.segment_id, - ) - - serializer.write_double( - _SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_SEGMENT.members["BeginAudioTime"], - self.begin_audio_time, - ) - serializer.write_double( - _SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_SEGMENT.members["EndAudioTime"], - self.end_audio_time, - ) - if self.content is not None: - serializer.write_string( - _SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_SEGMENT.members["Content"], - self.content, - ) - - if self.items is not None: - _serialize_medical_scribe_transcript_item_list( - serializer, - _SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_SEGMENT.members["Items"], - self.items, - ) - - serializer.write_boolean( - _SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_SEGMENT.members["IsPartial"], - self.is_partial, - ) - if self.channel_id is not None: - serializer.write_string( - _SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_SEGMENT.members["ChannelId"], - self.channel_id, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["segment_id"] = de.read_string( - _SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_SEGMENT.members["SegmentId"] - ) - - case 1: - kwargs["begin_audio_time"] = de.read_double( - _SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_SEGMENT.members[ - "BeginAudioTime" - ] - ) - - case 2: - kwargs["end_audio_time"] = de.read_double( - _SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_SEGMENT.members[ - "EndAudioTime" - ] - ) - - case 3: - kwargs["content"] = de.read_string( - _SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_SEGMENT.members["Content"] - ) - - case 4: - kwargs["items"] = _deserialize_medical_scribe_transcript_item_list( - de, _SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_SEGMENT.members["Items"] - ) - - case 5: - kwargs["is_partial"] = de.read_boolean( - _SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_SEGMENT.members["IsPartial"] - ) - - case 6: - kwargs["channel_id"] = de.read_string( - _SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_SEGMENT.members["ChannelId"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_SEGMENT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class MedicalScribeTranscriptEvent: - """ - The event associated with `MedicalScribeResultStream`. - - Contains `MedicalScribeTranscriptSegment`, which contains segment - related information. - """ - - transcript_segment: MedicalScribeTranscriptSegment | None = None - """ - The `TranscriptSegment` associated with a - `MedicalScribeTranscriptEvent`. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.transcript_segment is not None: - serializer.write_struct( - _SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_EVENT.members["TranscriptSegment"], - self.transcript_segment, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["transcript_segment"] = ( - MedicalScribeTranscriptSegment.deserialize(de) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_MEDICAL_SCRIBE_TRANSCRIPT_EVENT, consumer=_consumer - ) - return kwargs - - -@dataclass -class MedicalScribeResultStreamTranscriptEvent: - """The transcript event that contains real-time transcription results.""" - - value: MedicalScribeTranscriptEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDICAL_SCRIBE_RESULT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MEDICAL_SCRIBE_RESULT_STREAM.members["TranscriptEvent"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=MedicalScribeTranscriptEvent.deserialize(deserializer)) - - -@dataclass -class MedicalScribeResultStreamBadRequestException: - """ - One or more arguments to the `StartStreamTranscription`, - `StartMedicalStreamTranscription`, or - `StartCallAnalyticsStreamTranscription` operation was not valid. For - example, `MediaEncoding` or `LanguageCode` used unsupported values. - Check the specified parameters and try your request again. - """ - - value: BadRequestException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDICAL_SCRIBE_RESULT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MEDICAL_SCRIBE_RESULT_STREAM.members["BadRequestException"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=BadRequestException.deserialize(deserializer)) - - -@dataclass -class MedicalScribeResultStreamLimitExceededException: - """ - Your client has exceeded one of the Amazon Transcribe limits, typically - the concurrent stream service quota. This error can also occur if a - stream exceeds the maximum session duration. In rare cases, this error - can also occur if you increase your number of concurrent streams too - quickly. Reduce your number of concurrent streams and try your request - again using an exponential backoff strategy. - """ - - value: LimitExceededException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDICAL_SCRIBE_RESULT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MEDICAL_SCRIBE_RESULT_STREAM.members["LimitExceededException"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=LimitExceededException.deserialize(deserializer)) - - -@dataclass -class MedicalScribeResultStreamInternalFailureException: - """ - A problem occurred while processing the audio. Amazon Transcribe - terminated processing. - """ - - value: InternalFailureException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDICAL_SCRIBE_RESULT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MEDICAL_SCRIBE_RESULT_STREAM.members["InternalFailureException"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=InternalFailureException.deserialize(deserializer)) - - -@dataclass -class MedicalScribeResultStreamConflictException: - """ - A new stream started with the same session ID. The current stream has - been terminated. - """ - - value: ConflictException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDICAL_SCRIBE_RESULT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MEDICAL_SCRIBE_RESULT_STREAM.members["ConflictException"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ConflictException.deserialize(deserializer)) - - -@dataclass -class MedicalScribeResultStreamServiceUnavailableException: - """The service is currently unavailable. Try your request later.""" - - value: ServiceUnavailableException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDICAL_SCRIBE_RESULT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MEDICAL_SCRIBE_RESULT_STREAM.members["ServiceUnavailableException"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ServiceUnavailableException.deserialize(deserializer)) - - -@dataclass -class MedicalScribeResultStreamUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -MedicalScribeResultStream = Union[ - MedicalScribeResultStreamTranscriptEvent - | MedicalScribeResultStreamBadRequestException - | MedicalScribeResultStreamLimitExceededException - | MedicalScribeResultStreamInternalFailureException - | MedicalScribeResultStreamConflictException - | MedicalScribeResultStreamServiceUnavailableException - | MedicalScribeResultStreamUnknown -] -""" -Result stream where you will receive the output events. The details are -provided in the `MedicalScribeTranscriptEvent` object. -""" - - -class _MedicalScribeResultStreamDeserializer: - _result: MedicalScribeResultStream | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> MedicalScribeResultStream: - self._result = None - deserializer.read_struct(_SCHEMA_MEDICAL_SCRIBE_RESULT_STREAM, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - MedicalScribeResultStreamTranscriptEvent.deserialize(de) - ) - - case 1: - self._set_result( - MedicalScribeResultStreamBadRequestException.deserialize(de) - ) - - case 2: - self._set_result( - MedicalScribeResultStreamLimitExceededException.deserialize(de) - ) - - case 3: - self._set_result( - MedicalScribeResultStreamInternalFailureException.deserialize(de) - ) - - case 4: - self._set_result( - MedicalScribeResultStreamConflictException.deserialize(de) - ) - - case 5: - self._set_result( - MedicalScribeResultStreamServiceUnavailableException.deserialize(de) - ) - - case _: - self._set_result( - MedicalScribeResultStreamUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: MedicalScribeResultStream) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class MedicalTranscript: - """ - The `MedicalTranscript` associated with a . - - `MedicalTranscript` contains `Results`, which contains a set of - transcription results from one or more audio segments, along with - additional information per your request parameters. - """ - - results: list[MedicalResult] | None = None - """ - Contains a set of transcription results from one or more audio segments, - along with additional information per your request parameters. This can - include information relating to alternative transcriptions, channel - identification, partial result stabilization, language identification, - and other transcription-related data. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDICAL_TRANSCRIPT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.results is not None: - _serialize_medical_result_list( - serializer, _SCHEMA_MEDICAL_TRANSCRIPT.members["Results"], self.results - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["results"] = _deserialize_medical_result_list( - de, _SCHEMA_MEDICAL_TRANSCRIPT.members["Results"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MEDICAL_TRANSCRIPT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class MedicalTranscriptEvent: - """ - The `MedicalTranscriptEvent` associated with a - `MedicalTranscriptResultStream`. - - Contains a set of transcription results from one or more audio segments, - along with additional information per your request parameters. - """ - - transcript: MedicalTranscript | None = None - """ - Contains `Results`, which contains a set of transcription results from - one or more audio segments, along with additional information per your - request parameters. This can include information relating to alternative - transcriptions, channel identification, partial result stabilization, - language identification, and other transcription-related data. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDICAL_TRANSCRIPT_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.transcript is not None: - serializer.write_struct( - _SCHEMA_MEDICAL_TRANSCRIPT_EVENT.members["Transcript"], self.transcript - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["transcript"] = MedicalTranscript.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_MEDICAL_TRANSCRIPT_EVENT, consumer=_consumer) - return kwargs - - -@dataclass -class MedicalTranscriptResultStreamTranscriptEvent: - """ - The `MedicalTranscriptEvent` associated with a - `MedicalTranscriptResultStream`. - - Contains a set of transcription results from one or more audio segments, - along with additional information per your request parameters. This can - include information relating to alternative transcriptions, channel - identification, partial result stabilization, language identification, - and other transcription-related data. - """ - - value: MedicalTranscriptEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDICAL_TRANSCRIPT_RESULT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MEDICAL_TRANSCRIPT_RESULT_STREAM.members["TranscriptEvent"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=MedicalTranscriptEvent.deserialize(deserializer)) - - -@dataclass -class MedicalTranscriptResultStreamBadRequestException: - """ - One or more arguments to the `StartStreamTranscription`, - `StartMedicalStreamTranscription`, or - `StartCallAnalyticsStreamTranscription` operation was not valid. For - example, `MediaEncoding` or `LanguageCode` used unsupported values. - Check the specified parameters and try your request again. - """ - - value: BadRequestException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDICAL_TRANSCRIPT_RESULT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MEDICAL_TRANSCRIPT_RESULT_STREAM.members["BadRequestException"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=BadRequestException.deserialize(deserializer)) - - -@dataclass -class MedicalTranscriptResultStreamLimitExceededException: - """ - Your client has exceeded one of the Amazon Transcribe limits, typically - the concurrent stream service quota. This error can also occur if a - stream exceeds the maximum session duration. In rare cases, this error - can also occur if you increase your number of concurrent streams too - quickly. Reduce your number of concurrent streams and try your request - again using an exponential backoff strategy. - """ - - value: LimitExceededException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDICAL_TRANSCRIPT_RESULT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MEDICAL_TRANSCRIPT_RESULT_STREAM.members["LimitExceededException"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=LimitExceededException.deserialize(deserializer)) - - -@dataclass -class MedicalTranscriptResultStreamInternalFailureException: - """ - A problem occurred while processing the audio. Amazon Transcribe - terminated processing. - """ - - value: InternalFailureException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDICAL_TRANSCRIPT_RESULT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MEDICAL_TRANSCRIPT_RESULT_STREAM.members[ - "InternalFailureException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=InternalFailureException.deserialize(deserializer)) - - -@dataclass -class MedicalTranscriptResultStreamConflictException: - """ - A new stream started with the same session ID. The current stream has - been terminated. - """ - - value: ConflictException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDICAL_TRANSCRIPT_RESULT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MEDICAL_TRANSCRIPT_RESULT_STREAM.members["ConflictException"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ConflictException.deserialize(deserializer)) - - -@dataclass -class MedicalTranscriptResultStreamServiceUnavailableException: - """The service is currently unavailable. Try your request later.""" - - value: ServiceUnavailableException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_MEDICAL_TRANSCRIPT_RESULT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_MEDICAL_TRANSCRIPT_RESULT_STREAM.members[ - "ServiceUnavailableException" - ], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ServiceUnavailableException.deserialize(deserializer)) - - -@dataclass -class MedicalTranscriptResultStreamUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -MedicalTranscriptResultStream = Union[ - MedicalTranscriptResultStreamTranscriptEvent - | MedicalTranscriptResultStreamBadRequestException - | MedicalTranscriptResultStreamLimitExceededException - | MedicalTranscriptResultStreamInternalFailureException - | MedicalTranscriptResultStreamConflictException - | MedicalTranscriptResultStreamServiceUnavailableException - | MedicalTranscriptResultStreamUnknown -] -"""Contains detailed information about your streaming session.""" - - -class _MedicalTranscriptResultStreamDeserializer: - _result: MedicalTranscriptResultStream | None = None - - def deserialize( - self, deserializer: ShapeDeserializer - ) -> MedicalTranscriptResultStream: - self._result = None - deserializer.read_struct( - _SCHEMA_MEDICAL_TRANSCRIPT_RESULT_STREAM, self._consumer - ) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result( - MedicalTranscriptResultStreamTranscriptEvent.deserialize(de) - ) - - case 1: - self._set_result( - MedicalTranscriptResultStreamBadRequestException.deserialize(de) - ) - - case 2: - self._set_result( - MedicalTranscriptResultStreamLimitExceededException.deserialize(de) - ) - - case 3: - self._set_result( - MedicalTranscriptResultStreamInternalFailureException.deserialize( - de - ) - ) - - case 4: - self._set_result( - MedicalTranscriptResultStreamConflictException.deserialize(de) - ) - - case 5: - self._set_result( - MedicalTranscriptResultStreamServiceUnavailableException.deserialize( - de - ) - ) - - case _: - self._set_result( - MedicalTranscriptResultStreamUnknown( - tag=schema.expect_member_name() - ) - ) - - def _set_result(self, value: MedicalTranscriptResultStream) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -class PartialResultsStability(UnknownEnumMixin, StrEnum): - HIGH = "high" - MEDIUM = "medium" - LOW = "low" - - -@dataclass(kw_only=True) -class Result: - """ - The `Result` associated with a . - - Contains a set of transcription results from one or more audio segments, - along with additional information per your request parameters. This can - include information relating to alternative transcriptions, channel - identification, partial result stabilization, language identification, - and other transcription-related data. - """ - - result_id: str | None = None - """Provides a unique identifier for the `Result`.""" - - start_time: float = 0 - """ - The start time of the `Result` in seconds, with millisecond precision - (e.g., 1.056). - """ - - end_time: float = 0 - """ - The end time of the `Result` in seconds, with millisecond precision - (e.g., 1.056). - """ - - is_partial: bool = False - """ - Indicates if the segment is complete. - - If `IsPartial` is `true`, the segment is not complete. If `IsPartial` is - `false`, the segment is complete. - """ - - alternatives: list[Alternative] | None = None - """ - A list of possible alternative transcriptions for the input audio. Each - alternative may contain one or more of `Items`, `Entities`, or - `Transcript`. - """ - - channel_id: str | None = None - """Indicates which audio channel is associated with the `Result`.""" - - language_code: str | None = None - """ - The language code that represents the language spoken in your audio - stream. - """ - - language_identification: list[LanguageWithScore] | None = None - """ - The language code of the dominant language identified in your stream. - - If you enabled channel identification and each channel of your audio - contains a different language, you may have more than one result. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_RESULT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.result_id is not None: - serializer.write_string(_SCHEMA_RESULT.members["ResultId"], self.result_id) - - serializer.write_double(_SCHEMA_RESULT.members["StartTime"], self.start_time) - serializer.write_double(_SCHEMA_RESULT.members["EndTime"], self.end_time) - serializer.write_boolean(_SCHEMA_RESULT.members["IsPartial"], self.is_partial) - if self.alternatives is not None: - _serialize_alternative_list( - serializer, _SCHEMA_RESULT.members["Alternatives"], self.alternatives - ) - - if self.channel_id is not None: - serializer.write_string( - _SCHEMA_RESULT.members["ChannelId"], self.channel_id - ) - - if self.language_code is not None: - serializer.write_string( - _SCHEMA_RESULT.members["LanguageCode"], self.language_code - ) - - if self.language_identification is not None: - _serialize_language_identification( - serializer, - _SCHEMA_RESULT.members["LanguageIdentification"], - self.language_identification, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["result_id"] = de.read_string( - _SCHEMA_RESULT.members["ResultId"] - ) - - case 1: - kwargs["start_time"] = de.read_double( - _SCHEMA_RESULT.members["StartTime"] - ) - - case 2: - kwargs["end_time"] = de.read_double( - _SCHEMA_RESULT.members["EndTime"] - ) - - case 3: - kwargs["is_partial"] = de.read_boolean( - _SCHEMA_RESULT.members["IsPartial"] - ) - - case 4: - kwargs["alternatives"] = _deserialize_alternative_list( - de, _SCHEMA_RESULT.members["Alternatives"] - ) - - case 5: - kwargs["channel_id"] = de.read_string( - _SCHEMA_RESULT.members["ChannelId"] - ) - - case 6: - kwargs["language_code"] = LanguageCode( - de.read_string(_SCHEMA_RESULT.members["LanguageCode"]) - ) - - case 7: - kwargs["language_identification"] = ( - _deserialize_language_identification( - de, _SCHEMA_RESULT.members["LanguageIdentification"] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_RESULT, consumer=_consumer) - return kwargs - - -def _serialize_result_list( - serializer: ShapeSerializer, schema: Schema, value: list[Result] -) -> None: - member_schema = schema.members["member"] - with serializer.begin_list(schema, len(value)) as ls: - for e in value: - ls.write_struct(member_schema, e) - - -def _deserialize_result_list( - deserializer: ShapeDeserializer, schema: Schema -) -> list[Result]: - result: list[Result] = [] - - def _read_value(d: ShapeDeserializer): - if d.is_null(): - d.read_null() - - else: - result.append(Result.deserialize(d)) - - deserializer.read_list(schema, _read_value) - return result - - -class Specialty(UnknownEnumMixin, StrEnum): - PRIMARYCARE = "PRIMARYCARE" - CARDIOLOGY = "CARDIOLOGY" - NEUROLOGY = "NEUROLOGY" - ONCOLOGY = "ONCOLOGY" - RADIOLOGY = "RADIOLOGY" - UROLOGY = "UROLOGY" - - -class VocabularyFilterMethod(UnknownEnumMixin, StrEnum): - REMOVE = "remove" - MASK = "mask" - TAG = "tag" - - -@dataclass(kw_only=True) -class StartCallAnalyticsStreamTranscriptionInput: - """Dataclass for StartCallAnalyticsStreamTranscriptionInput structure.""" - - language_code: str | None = None - """ - Specify the language code that represents the language spoken in your - audio. - - For a list of languages supported with real-time Call Analytics, refer - to the [Supported - languages](https://docs.aws.amazon.com/transcribe/latest/dg/supported-languages.html) - table. - """ - - media_sample_rate_hertz: int | None = None - """ - The sample rate of the input audio (in hertz). Low-quality audio, such - as telephone audio, is typically around 8,000 Hz. High-quality audio - typically ranges from 16,000 Hz to 48,000 Hz. Note that the sample rate - you specify must match that of your audio. - """ - - media_encoding: str | None = None - """ - Specify the encoding of your input audio. Supported formats are: - - - FLAC - - - OPUS-encoded audio in an Ogg container - - - PCM (only signed 16-bit little-endian audio formats, which does not - include WAV) - - For more information, see [Media - formats](https://docs.aws.amazon.com/transcribe/latest/dg/how-input.html#how-input-audio). - """ - - vocabulary_name: str | None = None - """ - Specify the name of the custom vocabulary that you want to use when - processing your transcription. Note that vocabulary names are case - sensitive. - - If the language of the specified custom vocabulary doesn't match the - language identified in your media, the custom vocabulary is not applied - to your transcription. - - For more information, see [Custom - vocabularies](https://docs.aws.amazon.com/transcribe/latest/dg/custom-vocabulary.html). - """ - - session_id: str | None = None - """ - Specify a name for your Call Analytics transcription session. If you - don't include this parameter in your request, Amazon Transcribe - generates an ID and returns it in the response. - """ - - vocabulary_filter_name: str | None = None - """ - Specify the name of the custom vocabulary filter that you want to use - when processing your transcription. Note that vocabulary filter names - are case sensitive. - - If the language of the specified custom vocabulary filter doesn't match - the language identified in your media, the vocabulary filter is not - applied to your transcription. - - For more information, see [Using vocabulary filtering with unwanted - words](https://docs.aws.amazon.com/transcribe/latest/dg/vocabulary-filtering.html). - """ - - vocabulary_filter_method: str | None = None - """ - Specify how you want your vocabulary filter applied to your transcript. - - To replace words with `***`, choose `mask`. - - To delete words, choose `remove`. - - To flag words without changing them, choose `tag`. - """ - - language_model_name: str | None = None - """ - Specify the name of the custom language model that you want to use when - processing your transcription. Note that language model names are case - sensitive. - - The language of the specified language model must match the language - code you specify in your transcription request. If the languages don't - match, the custom language model isn't applied. There are no errors or - warnings associated with a language mismatch. - - For more information, see [Custom language - models](https://docs.aws.amazon.com/transcribe/latest/dg/custom-language-models.html). - """ - - identify_language: bool = False - """ - Enables automatic language identification for your Call Analytics - transcription. - - If you include `IdentifyLanguage`, you must include a list of language - codes, using `LanguageOptions`, that you think may be present in your - audio stream. You must provide a minimum of two language selections. - - You can also include a preferred language using `PreferredLanguage`. - Adding a preferred language can help Amazon Transcribe identify the - language faster than if you omit this parameter. - - Note that you must include either `LanguageCode` or `IdentifyLanguage` - in your request. If you include both parameters, your transcription job - fails. - """ - - language_options: str | None = None - """ - Specify two or more language codes that represent the languages you - think may be present in your media. - - Including language options can improve the accuracy of language - identification. - - If you include `LanguageOptions` in your request, you must also include - `IdentifyLanguage`. - - For a list of languages supported with Call Analytics streaming, refer - to the [Supported - languages](https://docs.aws.amazon.com/transcribe/latest/dg/supported-languages.html) - table. - - Warning: - You can only include one language dialect per language per stream. For - example, you cannot include `en-US` and `en-AU` in the same request. - """ - - preferred_language: str | None = None - """ - Specify a preferred language from the subset of languages codes you - specified in `LanguageOptions`. - - You can only use this parameter if you've included `IdentifyLanguage` - and `LanguageOptions` in your request. - """ - - vocabulary_names: str | None = None - """ - Specify the names of the custom vocabularies that you want to use when - processing your Call Analytics transcription. Note that vocabulary names - are case sensitive. - - If the custom vocabulary's language doesn't match the identified media - language, it won't be applied to the transcription. - - Warning: - This parameter is only intended for use **with** the `IdentifyLanguage` - parameter. If you're **not** including `IdentifyLanguage` in your - request and want to use a custom vocabulary with your transcription, use - the `VocabularyName` parameter instead. - - For more information, see [Custom - vocabularies](https://docs.aws.amazon.com/transcribe/latest/dg/custom-vocabulary.html). - """ - - vocabulary_filter_names: str | None = None - """ - Specify the names of the custom vocabulary filters that you want to use - when processing your Call Analytics transcription. Note that vocabulary - filter names are case sensitive. - - These filters serve to customize the transcript output. - - Warning: - This parameter is only intended for use **with** the `IdentifyLanguage` - parameter. If you're **not** including `IdentifyLanguage` in your - request and want to use a custom vocabulary filter with your - transcription, use the `VocabularyFilterName` parameter instead. - - For more information, see [Using vocabulary filtering with unwanted - words](https://docs.aws.amazon.com/transcribe/latest/dg/vocabulary-filtering.html). - """ - - enable_partial_results_stabilization: bool = False - """ - Enables partial result stabilization for your transcription. Partial - result stabilization can reduce latency in your output, but may impact - accuracy. For more information, see [Partial-result - stabilization](https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html#streaming-partial-result-stabilization). - """ - - partial_results_stability: str | None = None - """ - Specify the level of stability to use when you enable partial results - stabilization (`EnablePartialResultsStabilization`). - - Low stability provides the highest accuracy. High stability transcribes - faster, but with slightly lower accuracy. - - For more information, see [Partial-result - stabilization](https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html#streaming-partial-result-stabilization). - """ - - content_identification_type: str | None = None - """ - Labels all personally identifiable information (PII) identified in your - transcript. - - Content identification is performed at the segment level; PII specified - in `PiiEntityTypes` is flagged upon complete transcription of an audio - segment. If you don't include `PiiEntityTypes` in your request, all PII - is identified. - - You can't set `ContentIdentificationType` and `ContentRedactionType` in - the same request. If you set both, your request returns a - `BadRequestException`. - - For more information, see [Redacting or identifying personally - identifiable - information](https://docs.aws.amazon.com/transcribe/latest/dg/pii-redaction.html). - """ - - content_redaction_type: str | None = None - """ - Redacts all personally identifiable information (PII) identified in your - transcript. - - Content redaction is performed at the segment level; PII specified in - `PiiEntityTypes` is redacted upon complete transcription of an audio - segment. If you don't include `PiiEntityTypes` in your request, all PII - is redacted. - - You can't set `ContentRedactionType` and `ContentIdentificationType` in - the same request. If you set both, your request returns a - `BadRequestException`. - - For more information, see [Redacting or identifying personally - identifiable - information](https://docs.aws.amazon.com/transcribe/latest/dg/pii-redaction.html). - """ - - pii_entity_types: str | None = None - """ - Specify which types of personally identifiable information (PII) you - want to redact in your transcript. You can include as many types as - you'd like, or you can select `ALL`. - - Values must be comma-separated and can include: `ADDRESS`, - `BANK_ACCOUNT_NUMBER`, `BANK_ROUTING`, `CREDIT_DEBIT_CVV`, - `CREDIT_DEBIT_EXPIRY`, `CREDIT_DEBIT_NUMBER`, `EMAIL`, `NAME`, `PHONE`, - `PIN`, `SSN`, or `ALL`. - - Note that if you include `PiiEntityTypes` in your request, you must also - include `ContentIdentificationType` or `ContentRedactionType`. - - If you include `ContentRedactionType` or `ContentIdentificationType` in - your request, but do not include `PiiEntityTypes`, all PII is redacted - or identified. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_INPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.language_code is not None: - serializer.write_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_INPUT.members[ - "LanguageCode" - ], - self.language_code, - ) - - if self.media_sample_rate_hertz is not None: - serializer.write_integer( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_INPUT.members[ - "MediaSampleRateHertz" - ], - self.media_sample_rate_hertz, - ) - - if self.media_encoding is not None: - serializer.write_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_INPUT.members[ - "MediaEncoding" - ], - self.media_encoding, - ) - - if self.vocabulary_name is not None: - serializer.write_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_INPUT.members[ - "VocabularyName" - ], - self.vocabulary_name, - ) - - if self.session_id is not None: - serializer.write_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_INPUT.members[ - "SessionId" - ], - self.session_id, - ) - - if self.vocabulary_filter_name is not None: - serializer.write_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_INPUT.members[ - "VocabularyFilterName" - ], - self.vocabulary_filter_name, - ) - - if self.vocabulary_filter_method is not None: - serializer.write_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_INPUT.members[ - "VocabularyFilterMethod" - ], - self.vocabulary_filter_method, - ) - - if self.language_model_name is not None: - serializer.write_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_INPUT.members[ - "LanguageModelName" - ], - self.language_model_name, - ) - - if self.identify_language is not None: - serializer.write_boolean( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_INPUT.members[ - "IdentifyLanguage" - ], - self.identify_language, - ) - - if self.language_options is not None: - serializer.write_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_INPUT.members[ - "LanguageOptions" - ], - self.language_options, - ) - - if self.preferred_language is not None: - serializer.write_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_INPUT.members[ - "PreferredLanguage" - ], - self.preferred_language, - ) - - if self.vocabulary_names is not None: - serializer.write_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_INPUT.members[ - "VocabularyNames" - ], - self.vocabulary_names, - ) - - if self.vocabulary_filter_names is not None: - serializer.write_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_INPUT.members[ - "VocabularyFilterNames" - ], - self.vocabulary_filter_names, - ) - - if self.enable_partial_results_stabilization is not None: - serializer.write_boolean( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_INPUT.members[ - "EnablePartialResultsStabilization" - ], - self.enable_partial_results_stabilization, - ) - - if self.partial_results_stability is not None: - serializer.write_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_INPUT.members[ - "PartialResultsStability" - ], - self.partial_results_stability, - ) - - if self.content_identification_type is not None: - serializer.write_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_INPUT.members[ - "ContentIdentificationType" - ], - self.content_identification_type, - ) - - if self.content_redaction_type is not None: - serializer.write_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_INPUT.members[ - "ContentRedactionType" - ], - self.content_redaction_type, - ) - - if self.pii_entity_types is not None: - serializer.write_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_INPUT.members[ - "PiiEntityTypes" - ], - self.pii_entity_types, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["language_code"] = CallAnalyticsLanguageCode( - de.read_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_INPUT.members[ - "LanguageCode" - ] - ) - ) - - case 1: - kwargs["media_sample_rate_hertz"] = de.read_integer( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_INPUT.members[ - "MediaSampleRateHertz" - ] - ) - - case 2: - kwargs["media_encoding"] = MediaEncoding( - de.read_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_INPUT.members[ - "MediaEncoding" - ] - ) - ) - - case 3: - kwargs["vocabulary_name"] = de.read_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_INPUT.members[ - "VocabularyName" - ] - ) - - case 4: - kwargs["session_id"] = de.read_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_INPUT.members[ - "SessionId" - ] - ) - - case 6: - kwargs["vocabulary_filter_name"] = de.read_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_INPUT.members[ - "VocabularyFilterName" - ] - ) - - case 7: - kwargs["vocabulary_filter_method"] = VocabularyFilterMethod( - de.read_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_INPUT.members[ - "VocabularyFilterMethod" - ] - ) - ) - - case 8: - kwargs["language_model_name"] = de.read_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_INPUT.members[ - "LanguageModelName" - ] - ) - - case 9: - kwargs["identify_language"] = de.read_boolean( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_INPUT.members[ - "IdentifyLanguage" - ] - ) - - case 10: - kwargs["language_options"] = de.read_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_INPUT.members[ - "LanguageOptions" - ] - ) - - case 11: - kwargs["preferred_language"] = CallAnalyticsLanguageCode( - de.read_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_INPUT.members[ - "PreferredLanguage" - ] - ) - ) - - case 12: - kwargs["vocabulary_names"] = de.read_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_INPUT.members[ - "VocabularyNames" - ] - ) - - case 13: - kwargs["vocabulary_filter_names"] = de.read_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_INPUT.members[ - "VocabularyFilterNames" - ] - ) - - case 14: - kwargs["enable_partial_results_stabilization"] = de.read_boolean( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_INPUT.members[ - "EnablePartialResultsStabilization" - ] - ) - - case 15: - kwargs["partial_results_stability"] = PartialResultsStability( - de.read_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_INPUT.members[ - "PartialResultsStability" - ] - ) - ) - - case 16: - kwargs["content_identification_type"] = ContentIdentificationType( - de.read_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_INPUT.members[ - "ContentIdentificationType" - ] - ) - ) - - case 17: - kwargs["content_redaction_type"] = ContentRedactionType( - de.read_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_INPUT.members[ - "ContentRedactionType" - ] - ) - ) - - case 18: - kwargs["pii_entity_types"] = de.read_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_INPUT.members[ - "PiiEntityTypes" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class StartCallAnalyticsStreamTranscriptionOutput: - """Dataclass for StartCallAnalyticsStreamTranscriptionOutput structure.""" - - request_id: str | None = None - """Provides the identifier for your real-time Call Analytics request.""" - - language_code: str | None = None - """ - Provides the language code that you specified in your Call Analytics - request. - """ - - media_sample_rate_hertz: int | None = None - """ - Provides the sample rate that you specified in your Call Analytics - request. - """ - - media_encoding: str | None = None - """ - Provides the media encoding you specified in your Call Analytics - request. - """ - - vocabulary_name: str | None = None - """ - Provides the name of the custom vocabulary that you specified in your - Call Analytics request. - """ - - session_id: str | None = None - """Provides the identifier for your Call Analytics transcription session.""" - - vocabulary_filter_name: str | None = None - """ - Provides the name of the custom vocabulary filter that you specified in - your Call Analytics request. - """ - - vocabulary_filter_method: str | None = None - """ - Provides the vocabulary filtering method used in your Call Analytics - transcription. - """ - - language_model_name: str | None = None - """ - Provides the name of the custom language model that you specified in - your Call Analytics request. - """ - - identify_language: bool = False - """ - Shows whether automatic language identification was enabled for your - Call Analytics transcription. - """ - - language_options: str | None = None - """ - Provides the language codes that you specified in your Call Analytics - request. - """ - - preferred_language: str | None = None - """ - Provides the preferred language that you specified in your Call - Analytics request. - """ - - vocabulary_names: str | None = None - """ - Provides the names of the custom vocabularies that you specified in your - Call Analytics request. - """ - - vocabulary_filter_names: str | None = None - """ - Provides the names of the custom vocabulary filters that you specified - in your Call Analytics request. - """ - - enable_partial_results_stabilization: bool = False - """ - Shows whether partial results stabilization was enabled for your Call - Analytics transcription. - """ - - partial_results_stability: str | None = None - """Provides the stabilization level used for your transcription.""" - - content_identification_type: str | None = None - """ - Shows whether content identification was enabled for your Call Analytics - transcription. - """ - - content_redaction_type: str | None = None - """ - Shows whether content redaction was enabled for your Call Analytics - transcription. - """ - - pii_entity_types: str | None = None - """Lists the PII entity types you specified in your Call Analytics request.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_OUTPUT, self - ) - - def serialize_members(self, serializer: ShapeSerializer): - if self.request_id is not None: - serializer.write_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_OUTPUT.members[ - "RequestId" - ], - self.request_id, - ) - - if self.language_code is not None: - serializer.write_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_OUTPUT.members[ - "LanguageCode" - ], - self.language_code, - ) - - if self.media_sample_rate_hertz is not None: - serializer.write_integer( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_OUTPUT.members[ - "MediaSampleRateHertz" - ], - self.media_sample_rate_hertz, - ) - - if self.media_encoding is not None: - serializer.write_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_OUTPUT.members[ - "MediaEncoding" - ], - self.media_encoding, - ) - - if self.vocabulary_name is not None: - serializer.write_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_OUTPUT.members[ - "VocabularyName" - ], - self.vocabulary_name, - ) - - if self.session_id is not None: - serializer.write_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_OUTPUT.members[ - "SessionId" - ], - self.session_id, - ) - - if self.vocabulary_filter_name is not None: - serializer.write_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_OUTPUT.members[ - "VocabularyFilterName" - ], - self.vocabulary_filter_name, - ) - - if self.vocabulary_filter_method is not None: - serializer.write_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_OUTPUT.members[ - "VocabularyFilterMethod" - ], - self.vocabulary_filter_method, - ) - - if self.language_model_name is not None: - serializer.write_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_OUTPUT.members[ - "LanguageModelName" - ], - self.language_model_name, - ) - - serializer.write_boolean( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_OUTPUT.members[ - "IdentifyLanguage" - ], - self.identify_language, - ) - if self.language_options is not None: - serializer.write_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_OUTPUT.members[ - "LanguageOptions" - ], - self.language_options, - ) - - if self.preferred_language is not None: - serializer.write_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_OUTPUT.members[ - "PreferredLanguage" - ], - self.preferred_language, - ) - - if self.vocabulary_names is not None: - serializer.write_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_OUTPUT.members[ - "VocabularyNames" - ], - self.vocabulary_names, - ) - - if self.vocabulary_filter_names is not None: - serializer.write_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_OUTPUT.members[ - "VocabularyFilterNames" - ], - self.vocabulary_filter_names, - ) - - serializer.write_boolean( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_OUTPUT.members[ - "EnablePartialResultsStabilization" - ], - self.enable_partial_results_stabilization, - ) - if self.partial_results_stability is not None: - serializer.write_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_OUTPUT.members[ - "PartialResultsStability" - ], - self.partial_results_stability, - ) - - if self.content_identification_type is not None: - serializer.write_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_OUTPUT.members[ - "ContentIdentificationType" - ], - self.content_identification_type, - ) - - if self.content_redaction_type is not None: - serializer.write_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_OUTPUT.members[ - "ContentRedactionType" - ], - self.content_redaction_type, - ) - - if self.pii_entity_types is not None: - serializer.write_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_OUTPUT.members[ - "PiiEntityTypes" - ], - self.pii_entity_types, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["request_id"] = de.read_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_OUTPUT.members[ - "RequestId" - ] - ) - - case 1: - kwargs["language_code"] = CallAnalyticsLanguageCode( - de.read_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_OUTPUT.members[ - "LanguageCode" - ] - ) - ) - - case 2: - kwargs["media_sample_rate_hertz"] = de.read_integer( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_OUTPUT.members[ - "MediaSampleRateHertz" - ] - ) - - case 3: - kwargs["media_encoding"] = MediaEncoding( - de.read_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_OUTPUT.members[ - "MediaEncoding" - ] - ) - ) - - case 4: - kwargs["vocabulary_name"] = de.read_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_OUTPUT.members[ - "VocabularyName" - ] - ) - - case 5: - kwargs["session_id"] = de.read_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_OUTPUT.members[ - "SessionId" - ] - ) - - case 7: - kwargs["vocabulary_filter_name"] = de.read_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_OUTPUT.members[ - "VocabularyFilterName" - ] - ) - - case 8: - kwargs["vocabulary_filter_method"] = VocabularyFilterMethod( - de.read_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_OUTPUT.members[ - "VocabularyFilterMethod" - ] - ) - ) - - case 9: - kwargs["language_model_name"] = de.read_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_OUTPUT.members[ - "LanguageModelName" - ] - ) - - case 10: - kwargs["identify_language"] = de.read_boolean( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_OUTPUT.members[ - "IdentifyLanguage" - ] - ) - - case 11: - kwargs["language_options"] = de.read_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_OUTPUT.members[ - "LanguageOptions" - ] - ) - - case 12: - kwargs["preferred_language"] = CallAnalyticsLanguageCode( - de.read_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_OUTPUT.members[ - "PreferredLanguage" - ] - ) - ) - - case 13: - kwargs["vocabulary_names"] = de.read_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_OUTPUT.members[ - "VocabularyNames" - ] - ) - - case 14: - kwargs["vocabulary_filter_names"] = de.read_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_OUTPUT.members[ - "VocabularyFilterNames" - ] - ) - - case 15: - kwargs["enable_partial_results_stabilization"] = de.read_boolean( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_OUTPUT.members[ - "EnablePartialResultsStabilization" - ] - ) - - case 16: - kwargs["partial_results_stability"] = PartialResultsStability( - de.read_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_OUTPUT.members[ - "PartialResultsStability" - ] - ) - ) - - case 17: - kwargs["content_identification_type"] = ContentIdentificationType( - de.read_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_OUTPUT.members[ - "ContentIdentificationType" - ] - ) - ) - - case 18: - kwargs["content_redaction_type"] = ContentRedactionType( - de.read_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_OUTPUT.members[ - "ContentRedactionType" - ] - ) - ) - - case 19: - kwargs["pii_entity_types"] = de.read_string( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_OUTPUT.members[ - "PiiEntityTypes" - ] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_OUTPUT, consumer=_consumer - ) - return kwargs - - -START_CALL_ANALYTICS_STREAM_TRANSCRIPTION = APIOperation( - input=StartCallAnalyticsStreamTranscriptionInput, - output=StartCallAnalyticsStreamTranscriptionOutput, - schema=_SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION, - input_schema=_SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_INPUT, - output_schema=_SCHEMA_START_CALL_ANALYTICS_STREAM_TRANSCRIPTION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.transcribestreaming#BadRequestException" - ): BadRequestException, - ShapeID( - "com.amazonaws.transcribestreaming#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.transcribestreaming#InternalFailureException" - ): InternalFailureException, - ShapeID( - "com.amazonaws.transcribestreaming#LimitExceededException" - ): LimitExceededException, - ShapeID( - "com.amazonaws.transcribestreaming#ServiceUnavailableException" - ): ServiceUnavailableException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_FAILURE_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_SERVICE_UNAVAILABLE_EXCEPTION, - ], -) - - -@dataclass(kw_only=True) -class StartMedicalScribeStreamInput: - """Dataclass for StartMedicalScribeStreamInput structure.""" - - session_id: str | None = None - """ - Specify an identifier for your streaming session (in UUID format). If - you don't include a SessionId in your request, Amazon Web Services - HealthScribe generates an ID and returns it in the response. - """ - - language_code: str | None = None - """Specify the language code for your HealthScribe streaming session.""" - - media_sample_rate_hertz: int | None = None - """ - Specify the sample rate of the input audio (in hertz). Amazon Web - Services HealthScribe supports a range from 16,000 Hz to 48,000 Hz. The - sample rate you specify must match that of your audio. - """ - - media_encoding: str | None = None - """ - Specify the encoding used for the input audio. - - Supported formats are: - - - FLAC - - - OPUS-encoded audio in an Ogg container - - - PCM (only signed 16-bit little-endian audio formats, which does not - include WAV) - - For more information, see [Media - formats](https://docs.aws.amazon.com/transcribe/latest/dg/how-input.html#how-input-audio). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_MEDICAL_SCRIBE_STREAM_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.session_id is not None: - serializer.write_string( - _SCHEMA_START_MEDICAL_SCRIBE_STREAM_INPUT.members["SessionId"], - self.session_id, - ) - - if self.language_code is not None: - serializer.write_string( - _SCHEMA_START_MEDICAL_SCRIBE_STREAM_INPUT.members["LanguageCode"], - self.language_code, - ) - - if self.media_sample_rate_hertz is not None: - serializer.write_integer( - _SCHEMA_START_MEDICAL_SCRIBE_STREAM_INPUT.members[ - "MediaSampleRateHertz" - ], - self.media_sample_rate_hertz, - ) - - if self.media_encoding is not None: - serializer.write_string( - _SCHEMA_START_MEDICAL_SCRIBE_STREAM_INPUT.members["MediaEncoding"], - self.media_encoding, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["session_id"] = de.read_string( - _SCHEMA_START_MEDICAL_SCRIBE_STREAM_INPUT.members["SessionId"] - ) - - case 1: - kwargs["language_code"] = MedicalScribeLanguageCode( - de.read_string( - _SCHEMA_START_MEDICAL_SCRIBE_STREAM_INPUT.members[ - "LanguageCode" - ] - ) - ) - - case 2: - kwargs["media_sample_rate_hertz"] = de.read_integer( - _SCHEMA_START_MEDICAL_SCRIBE_STREAM_INPUT.members[ - "MediaSampleRateHertz" - ] - ) - - case 3: - kwargs["media_encoding"] = MedicalScribeMediaEncoding( - de.read_string( - _SCHEMA_START_MEDICAL_SCRIBE_STREAM_INPUT.members[ - "MediaEncoding" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_START_MEDICAL_SCRIBE_STREAM_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class StartMedicalScribeStreamOutput: - """Dataclass for StartMedicalScribeStreamOutput structure.""" - - session_id: str | None = None - """ - The identifier (in UUID format) for your streaming session. - - If you already started streaming, this is same ID as the one you - specified in your initial `StartMedicalScribeStreamRequest`. - """ - - request_id: str | None = None - """The unique identifier for your streaming request.""" - - language_code: str | None = None - """ - The Language Code that you specified in your request. Same as provided - in the `StartMedicalScribeStreamRequest`. - """ - - media_sample_rate_hertz: int | None = None - """ - The sample rate (in hertz) that you specified in your request. Same as - provided in the `StartMedicalScribeStreamRequest` - """ - - media_encoding: str | None = None - """ - The Media Encoding you specified in your request. Same as provided in - the `StartMedicalScribeStreamRequest` - """ - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_MEDICAL_SCRIBE_STREAM_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.session_id is not None: - serializer.write_string( - _SCHEMA_START_MEDICAL_SCRIBE_STREAM_OUTPUT.members["SessionId"], - self.session_id, - ) - - if self.request_id is not None: - serializer.write_string( - _SCHEMA_START_MEDICAL_SCRIBE_STREAM_OUTPUT.members["RequestId"], - self.request_id, - ) - - if self.language_code is not None: - serializer.write_string( - _SCHEMA_START_MEDICAL_SCRIBE_STREAM_OUTPUT.members["LanguageCode"], - self.language_code, - ) - - if self.media_sample_rate_hertz is not None: - serializer.write_integer( - _SCHEMA_START_MEDICAL_SCRIBE_STREAM_OUTPUT.members[ - "MediaSampleRateHertz" - ], - self.media_sample_rate_hertz, - ) - - if self.media_encoding is not None: - serializer.write_string( - _SCHEMA_START_MEDICAL_SCRIBE_STREAM_OUTPUT.members["MediaEncoding"], - self.media_encoding, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["session_id"] = de.read_string( - _SCHEMA_START_MEDICAL_SCRIBE_STREAM_OUTPUT.members["SessionId"] - ) - - case 1: - kwargs["request_id"] = de.read_string( - _SCHEMA_START_MEDICAL_SCRIBE_STREAM_OUTPUT.members["RequestId"] - ) - - case 2: - kwargs["language_code"] = MedicalScribeLanguageCode( - de.read_string( - _SCHEMA_START_MEDICAL_SCRIBE_STREAM_OUTPUT.members[ - "LanguageCode" - ] - ) - ) - - case 3: - kwargs["media_sample_rate_hertz"] = de.read_integer( - _SCHEMA_START_MEDICAL_SCRIBE_STREAM_OUTPUT.members[ - "MediaSampleRateHertz" - ] - ) - - case 4: - kwargs["media_encoding"] = MedicalScribeMediaEncoding( - de.read_string( - _SCHEMA_START_MEDICAL_SCRIBE_STREAM_OUTPUT.members[ - "MediaEncoding" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_START_MEDICAL_SCRIBE_STREAM_OUTPUT, consumer=_consumer - ) - return kwargs - - -START_MEDICAL_SCRIBE_STREAM = APIOperation( - input=StartMedicalScribeStreamInput, - output=StartMedicalScribeStreamOutput, - schema=_SCHEMA_START_MEDICAL_SCRIBE_STREAM, - input_schema=_SCHEMA_START_MEDICAL_SCRIBE_STREAM_INPUT, - output_schema=_SCHEMA_START_MEDICAL_SCRIBE_STREAM_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.transcribestreaming#BadRequestException" - ): BadRequestException, - ShapeID( - "com.amazonaws.transcribestreaming#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.transcribestreaming#InternalFailureException" - ): InternalFailureException, - ShapeID( - "com.amazonaws.transcribestreaming#LimitExceededException" - ): LimitExceededException, - ShapeID( - "com.amazonaws.transcribestreaming#ServiceUnavailableException" - ): ServiceUnavailableException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_FAILURE_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_SERVICE_UNAVAILABLE_EXCEPTION, - ], -) - - -class Type(UnknownEnumMixin, StrEnum): - CONVERSATION = "CONVERSATION" - DICTATION = "DICTATION" - - -@dataclass(kw_only=True) -class StartMedicalStreamTranscriptionInput: - """Dataclass for StartMedicalStreamTranscriptionInput structure.""" - - language_code: str | None = None - """ - Specify the language code that represents the language spoken in your - audio. - - Warning: - Amazon Transcribe Medical only supports US English (`en-US`). - """ - - media_sample_rate_hertz: int | None = None - """ - The sample rate of the input audio (in hertz). Amazon Transcribe Medical - supports a range from 16,000 Hz to 48,000 Hz. Note that the sample rate - you specify must match that of your audio. - """ - - media_encoding: str | None = None - """ - Specify the encoding used for the input audio. Supported formats are: - - - FLAC - - - OPUS-encoded audio in an Ogg container - - - PCM (only signed 16-bit little-endian audio formats, which does not - include WAV) - - For more information, see [Media - formats](https://docs.aws.amazon.com/transcribe/latest/dg/how-input.html#how-input-audio). - """ - - vocabulary_name: str | None = None - """ - Specify the name of the custom vocabulary that you want to use when - processing your transcription. Note that vocabulary names are case - sensitive. - """ - - specialty: str | None = None - """Specify the medical specialty contained in your audio.""" - - type: str | None = None - """ - Specify the type of input audio. For example, choose `DICTATION` for a - provider dictating patient notes and `CONVERSATION` for a dialogue - between a patient and a medical professional. - """ - - show_speaker_label: bool = False - """ - Enables speaker partitioning (diarization) in your transcription output. - Speaker partitioning labels the speech from individual speakers in your - media file. - - For more information, see [Partitioning speakers - (diarization)](https://docs.aws.amazon.com/transcribe/latest/dg/diarization.html). - """ - - session_id: str | None = None - """ - Specify a name for your transcription session. If you don't include - this parameter in your request, Amazon Transcribe Medical generates an - ID and returns it in the response. - """ - - enable_channel_identification: bool = False - """ - Enables channel identification in multi-channel audio. - - Channel identification transcribes the audio on each channel - independently, then appends the output for each channel into one - transcript. - - If you have multi-channel audio and do not enable channel - identification, your audio is transcribed in a continuous manner and - your transcript is not separated by channel. - - If you include `EnableChannelIdentification` in your request, you must - also include `NumberOfChannels`. - - For more information, see [Transcribing multi-channel - audio](https://docs.aws.amazon.com/transcribe/latest/dg/channel-id.html). - """ - - number_of_channels: int | None = None - """ - Specify the number of channels in your audio stream. This value must be - `2`, as only two channels are supported. If your audio doesn't contain - multiple channels, do not include this parameter in your request. - - If you include `NumberOfChannels` in your request, you must also include - `EnableChannelIdentification`. - """ - - content_identification_type: str | None = None - """ - Labels all personal health information (PHI) identified in your - transcript. - - Content identification is performed at the segment level; PHI is flagged - upon complete transcription of an audio segment. - - For more information, see [Identifying personal health information (PHI) - in a - transcription](https://docs.aws.amazon.com/transcribe/latest/dg/phi-id.html). - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.language_code is not None: - serializer.write_string( - _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_INPUT.members[ - "LanguageCode" - ], - self.language_code, - ) - - if self.media_sample_rate_hertz is not None: - serializer.write_integer( - _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_INPUT.members[ - "MediaSampleRateHertz" - ], - self.media_sample_rate_hertz, - ) - - if self.media_encoding is not None: - serializer.write_string( - _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_INPUT.members[ - "MediaEncoding" - ], - self.media_encoding, - ) - - if self.vocabulary_name is not None: - serializer.write_string( - _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_INPUT.members[ - "VocabularyName" - ], - self.vocabulary_name, - ) - - if self.specialty is not None: - serializer.write_string( - _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_INPUT.members["Specialty"], - self.specialty, - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_INPUT.members["Type"], - self.type, - ) - - if self.show_speaker_label is not None: - serializer.write_boolean( - _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_INPUT.members[ - "ShowSpeakerLabel" - ], - self.show_speaker_label, - ) - - if self.session_id is not None: - serializer.write_string( - _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_INPUT.members["SessionId"], - self.session_id, - ) - - if self.enable_channel_identification is not None: - serializer.write_boolean( - _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_INPUT.members[ - "EnableChannelIdentification" - ], - self.enable_channel_identification, - ) - - if self.number_of_channels is not None: - serializer.write_integer( - _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_INPUT.members[ - "NumberOfChannels" - ], - self.number_of_channels, - ) - - if self.content_identification_type is not None: - serializer.write_string( - _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_INPUT.members[ - "ContentIdentificationType" - ], - self.content_identification_type, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["language_code"] = LanguageCode( - de.read_string( - _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_INPUT.members[ - "LanguageCode" - ] - ) - ) - - case 1: - kwargs["media_sample_rate_hertz"] = de.read_integer( - _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_INPUT.members[ - "MediaSampleRateHertz" - ] - ) - - case 2: - kwargs["media_encoding"] = MediaEncoding( - de.read_string( - _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_INPUT.members[ - "MediaEncoding" - ] - ) - ) - - case 3: - kwargs["vocabulary_name"] = de.read_string( - _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_INPUT.members[ - "VocabularyName" - ] - ) - - case 4: - kwargs["specialty"] = Specialty( - de.read_string( - _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_INPUT.members[ - "Specialty" - ] - ) - ) - - case 5: - kwargs["type"] = Type( - de.read_string( - _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_INPUT.members[ - "Type" - ] - ) - ) - - case 6: - kwargs["show_speaker_label"] = de.read_boolean( - _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_INPUT.members[ - "ShowSpeakerLabel" - ] - ) - - case 7: - kwargs["session_id"] = de.read_string( - _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_INPUT.members[ - "SessionId" - ] - ) - - case 9: - kwargs["enable_channel_identification"] = de.read_boolean( - _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_INPUT.members[ - "EnableChannelIdentification" - ] - ) - - case 10: - kwargs["number_of_channels"] = de.read_integer( - _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_INPUT.members[ - "NumberOfChannels" - ] - ) - - case 11: - kwargs["content_identification_type"] = ( - MedicalContentIdentificationType( - de.read_string( - _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_INPUT.members[ - "ContentIdentificationType" - ] - ) - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class StartMedicalStreamTranscriptionOutput: - """Dataclass for StartMedicalStreamTranscriptionOutput structure.""" - - request_id: str | None = None - """Provides the identifier for your streaming request.""" - - language_code: str | None = None - """ - Provides the language code that you specified in your request. This must - be `en-US`. - """ - - media_sample_rate_hertz: int | None = None - """Provides the sample rate that you specified in your request.""" - - media_encoding: str | None = None - """Provides the media encoding you specified in your request.""" - - vocabulary_name: str | None = None - """ - Provides the name of the custom vocabulary that you specified in your - request. - """ - - specialty: str | None = None - """Provides the medical specialty that you specified in your request.""" - - type: str | None = None - """Provides the type of audio you specified in your request.""" - - show_speaker_label: bool = False - """Shows whether speaker partitioning was enabled for your transcription.""" - - session_id: str | None = None - """Provides the identifier for your transcription session.""" - - enable_channel_identification: bool = False - """Shows whether channel identification was enabled for your transcription.""" - - number_of_channels: int | None = None - """Provides the number of channels that you specified in your request.""" - - content_identification_type: str | None = None - """Shows whether content identification was enabled for your transcription.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.request_id is not None: - serializer.write_string( - _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_OUTPUT.members["RequestId"], - self.request_id, - ) - - if self.language_code is not None: - serializer.write_string( - _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_OUTPUT.members[ - "LanguageCode" - ], - self.language_code, - ) - - if self.media_sample_rate_hertz is not None: - serializer.write_integer( - _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_OUTPUT.members[ - "MediaSampleRateHertz" - ], - self.media_sample_rate_hertz, - ) - - if self.media_encoding is not None: - serializer.write_string( - _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_OUTPUT.members[ - "MediaEncoding" - ], - self.media_encoding, - ) - - if self.vocabulary_name is not None: - serializer.write_string( - _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_OUTPUT.members[ - "VocabularyName" - ], - self.vocabulary_name, - ) - - if self.specialty is not None: - serializer.write_string( - _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_OUTPUT.members["Specialty"], - self.specialty, - ) - - if self.type is not None: - serializer.write_string( - _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_OUTPUT.members["Type"], - self.type, - ) - - serializer.write_boolean( - _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_OUTPUT.members[ - "ShowSpeakerLabel" - ], - self.show_speaker_label, - ) - if self.session_id is not None: - serializer.write_string( - _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_OUTPUT.members["SessionId"], - self.session_id, - ) - - serializer.write_boolean( - _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_OUTPUT.members[ - "EnableChannelIdentification" - ], - self.enable_channel_identification, - ) - if self.number_of_channels is not None: - serializer.write_integer( - _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_OUTPUT.members[ - "NumberOfChannels" - ], - self.number_of_channels, - ) - - if self.content_identification_type is not None: - serializer.write_string( - _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_OUTPUT.members[ - "ContentIdentificationType" - ], - self.content_identification_type, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["request_id"] = de.read_string( - _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_OUTPUT.members[ - "RequestId" - ] - ) - - case 1: - kwargs["language_code"] = LanguageCode( - de.read_string( - _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_OUTPUT.members[ - "LanguageCode" - ] - ) - ) - - case 2: - kwargs["media_sample_rate_hertz"] = de.read_integer( - _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_OUTPUT.members[ - "MediaSampleRateHertz" - ] - ) - - case 3: - kwargs["media_encoding"] = MediaEncoding( - de.read_string( - _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_OUTPUT.members[ - "MediaEncoding" - ] - ) - ) - - case 4: - kwargs["vocabulary_name"] = de.read_string( - _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_OUTPUT.members[ - "VocabularyName" - ] - ) - - case 5: - kwargs["specialty"] = Specialty( - de.read_string( - _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_OUTPUT.members[ - "Specialty" - ] - ) - ) - - case 6: - kwargs["type"] = Type( - de.read_string( - _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_OUTPUT.members[ - "Type" - ] - ) - ) - - case 7: - kwargs["show_speaker_label"] = de.read_boolean( - _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_OUTPUT.members[ - "ShowSpeakerLabel" - ] - ) - - case 8: - kwargs["session_id"] = de.read_string( - _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_OUTPUT.members[ - "SessionId" - ] - ) - - case 10: - kwargs["enable_channel_identification"] = de.read_boolean( - _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_OUTPUT.members[ - "EnableChannelIdentification" - ] - ) - - case 11: - kwargs["number_of_channels"] = de.read_integer( - _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_OUTPUT.members[ - "NumberOfChannels" - ] - ) - - case 12: - kwargs["content_identification_type"] = ( - MedicalContentIdentificationType( - de.read_string( - _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_OUTPUT.members[ - "ContentIdentificationType" - ] - ) - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_OUTPUT, consumer=_consumer - ) - return kwargs - - -START_MEDICAL_STREAM_TRANSCRIPTION = APIOperation( - input=StartMedicalStreamTranscriptionInput, - output=StartMedicalStreamTranscriptionOutput, - schema=_SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION, - input_schema=_SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_INPUT, - output_schema=_SCHEMA_START_MEDICAL_STREAM_TRANSCRIPTION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.transcribestreaming#BadRequestException" - ): BadRequestException, - ShapeID( - "com.amazonaws.transcribestreaming#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.transcribestreaming#InternalFailureException" - ): InternalFailureException, - ShapeID( - "com.amazonaws.transcribestreaming#LimitExceededException" - ): LimitExceededException, - ShapeID( - "com.amazonaws.transcribestreaming#ServiceUnavailableException" - ): ServiceUnavailableException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_FAILURE_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_SERVICE_UNAVAILABLE_EXCEPTION, - ], -) - - -class TranscriptFormat(UnknownEnumMixin, StrEnum): - SPOKEN = "spoken" - WRITTEN = "written" - - -@dataclass(kw_only=True) -class StartStreamTranscriptionInput: - """Dataclass for StartStreamTranscriptionInput structure.""" - - language_code: str | None = None - """ - Specify the language code that represents the language spoken in your - audio. - - If you're unsure of the language spoken in your audio, consider using - `IdentifyLanguage` to enable automatic language identification. - - For a list of languages supported with Amazon Transcribe streaming, - refer to the [Supported - languages](https://docs.aws.amazon.com/transcribe/latest/dg/supported-languages.html) - table. - """ - - media_sample_rate_hertz: int | None = None - """ - The sample rate of the input audio (in hertz). Low-quality audio, such - as telephone audio, is typically around 8,000 Hz. High-quality audio - typically ranges from 16,000 Hz to 48,000 Hz. Note that the sample rate - you specify must match that of your audio. - """ - - media_encoding: str | None = None - """ - Specify the encoding of your input audio. Supported formats are: - - - FLAC - - - OPUS-encoded audio in an Ogg container - - - PCM (only signed 16-bit little-endian audio formats, which does not - include WAV) - - For more information, see [Media - formats](https://docs.aws.amazon.com/transcribe/latest/dg/how-input.html#how-input-audio). - """ - - vocabulary_name: str | None = None - """ - Specify the name of the custom vocabulary that you want to use when - processing your transcription. Note that vocabulary names are case - sensitive. - - If the language of the specified custom vocabulary doesn't match the - language identified in your media, the custom vocabulary is not applied - to your transcription. - - Warning: - This parameter is **not** intended for use with the `IdentifyLanguage` - parameter. If you're including `IdentifyLanguage` in your request and - want to use one or more custom vocabularies with your transcription, use - the `VocabularyNames` parameter instead. - - For more information, see [Custom - vocabularies](https://docs.aws.amazon.com/transcribe/latest/dg/custom-vocabulary.html). - """ - - session_id: str | None = None - """ - Specify a name for your transcription session. If you don't include - this parameter in your request, Amazon Transcribe generates an ID and - returns it in the response. - """ - - vocabulary_filter_name: str | None = None - """ - Specify the name of the custom vocabulary filter that you want to use - when processing your transcription. Note that vocabulary filter names - are case sensitive. - - If the language of the specified custom vocabulary filter doesn't match - the language identified in your media, the vocabulary filter is not - applied to your transcription. - - Warning: - This parameter is **not** intended for use with the `IdentifyLanguage` - parameter. If you're including `IdentifyLanguage` in your request and - want to use one or more vocabulary filters with your transcription, use - the `VocabularyFilterNames` parameter instead. - - For more information, see [Using vocabulary filtering with unwanted - words](https://docs.aws.amazon.com/transcribe/latest/dg/vocabulary-filtering.html). - """ - - vocabulary_filter_method: str | None = None - """ - Specify how you want your vocabulary filter applied to your transcript. - - To replace words with `***`, choose `mask`. - - To delete words, choose `remove`. - - To flag words without changing them, choose `tag`. - """ - - show_speaker_label: bool = False - """ - Enables speaker partitioning (diarization) in your transcription output. - Speaker partitioning labels the speech from individual speakers in your - media file. - - For more information, see [Partitioning speakers - (diarization)](https://docs.aws.amazon.com/transcribe/latest/dg/diarization.html). - """ - - enable_channel_identification: bool = False - """ - Enables channel identification in multi-channel audio. - - Channel identification transcribes the audio on each channel - independently, then appends the output for each channel into one - transcript. - - If you have multi-channel audio and do not enable channel - identification, your audio is transcribed in a continuous manner and - your transcript is not separated by channel. - - If you include `EnableChannelIdentification` in your request, you must - also include `NumberOfChannels`. - - For more information, see [Transcribing multi-channel - audio](https://docs.aws.amazon.com/transcribe/latest/dg/channel-id.html). - """ - - number_of_channels: int | None = None - """ - Specify the number of channels in your audio stream. This value must be - `2`, as only two channels are supported. If your audio doesn't contain - multiple channels, do not include this parameter in your request. - - If you include `NumberOfChannels` in your request, you must also include - `EnableChannelIdentification`. - """ - - enable_partial_results_stabilization: bool = False - """ - Enables partial result stabilization for your transcription. Partial - result stabilization can reduce latency in your output, but may impact - accuracy. For more information, see [Partial-result - stabilization](https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html#streaming-partial-result-stabilization). - """ - - partial_results_stability: str | None = None - """ - Specify the level of stability to use when you enable partial results - stabilization (`EnablePartialResultsStabilization`). - - Low stability provides the highest accuracy. High stability transcribes - faster, but with slightly lower accuracy. - - For more information, see [Partial-result - stabilization](https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html#streaming-partial-result-stabilization). - """ - - content_identification_type: str | None = None - """ - Labels all personally identifiable information (PII) identified in your - transcript. - - Content identification is performed at the segment level; PII specified - in `PiiEntityTypes` is flagged upon complete transcription of an audio - segment. If you don't include `PiiEntityTypes` in your request, all PII - is identified. - - You can't set `ContentIdentificationType` and `ContentRedactionType` in - the same request. If you set both, your request returns a - `BadRequestException`. - - For more information, see [Redacting or identifying personally - identifiable - information](https://docs.aws.amazon.com/transcribe/latest/dg/pii-redaction.html). - """ - - content_redaction_type: str | None = None - """ - Redacts all personally identifiable information (PII) identified in your - transcript. - - Content redaction is performed at the segment level; PII specified in - `PiiEntityTypes` is redacted upon complete transcription of an audio - segment. If you don't include `PiiEntityTypes` in your request, all PII - is redacted. - - You can't set `ContentRedactionType` and `ContentIdentificationType` in - the same request. If you set both, your request returns a - `BadRequestException`. - - For more information, see [Redacting or identifying personally - identifiable - information](https://docs.aws.amazon.com/transcribe/latest/dg/pii-redaction.html). - """ - - pii_entity_types: str | None = None - """ - Specify which types of personally identifiable information (PII) you - want to redact in your transcript. You can include as many types as - you'd like, or you can select `ALL`. - - Values must be comma-separated and can include: `ADDRESS`, - `BANK_ACCOUNT_NUMBER`, `BANK_ROUTING`, `CREDIT_DEBIT_CVV`, - `CREDIT_DEBIT_EXPIRY`, `CREDIT_DEBIT_NUMBER`, `EMAIL`, `NAME`, `PHONE`, - `PIN`, `SSN`, `AGE`, `DATE_TIME`, `LICENSE_PLATE`, `PASSPORT_NUMBER`, - `PASSWORD`, `USERNAME`, `VEHICLE_IDENTIFICATION_NUMBER`, or `ALL`. - - Note that if you include `PiiEntityTypes` in your request, you must also - include `ContentIdentificationType` or `ContentRedactionType`. - - If you include `ContentRedactionType` or `ContentIdentificationType` in - your request, but do not include `PiiEntityTypes`, all PII is redacted - or identified. - """ - - language_model_name: str | None = None - """ - Specify the name of the custom language model that you want to use when - processing your transcription. Note that language model names are case - sensitive. - - The language of the specified language model must match the language - code you specify in your transcription request. If the languages don't - match, the custom language model isn't applied. There are no errors or - warnings associated with a language mismatch. - - For more information, see [Custom language - models](https://docs.aws.amazon.com/transcribe/latest/dg/custom-language-models.html). - """ - - identify_language: bool = False - """ - Enables automatic language identification for your transcription. - - If you include `IdentifyLanguage`, you must include a list of language - codes, using `LanguageOptions`, that you think may be present in your - audio stream. - - You can also include a preferred language using `PreferredLanguage`. - Adding a preferred language can help Amazon Transcribe identify the - language faster than if you omit this parameter. - - If you have multi-channel audio that contains different languages on - each channel, and you've enabled channel identification, automatic - language identification identifies the dominant language on each audio - channel. - - Note that you must include either `LanguageCode` or `IdentifyLanguage` - or `IdentifyMultipleLanguages` in your request. If you include more than - one of these parameters, your transcription job fails. - - Streaming language identification can't be combined with custom - language models or redaction. - """ - - language_options: str | None = None - """ - Specify two or more language codes that represent the languages you - think may be present in your media; including more than five is not - recommended. - - Including language options can improve the accuracy of language - identification. - - If you include `LanguageOptions` in your request, you must also include - `IdentifyLanguage` or `IdentifyMultipleLanguages`. - - For a list of languages supported with Amazon Transcribe streaming, - refer to the [Supported - languages](https://docs.aws.amazon.com/transcribe/latest/dg/supported-languages.html) - table. - - Warning: - You can only include one language dialect per language per stream. For - example, you cannot include `en-US` and `en-AU` in the same request. - """ - - preferred_language: str | None = None - """ - Specify a preferred language from the subset of languages codes you - specified in `LanguageOptions`. - - You can only use this parameter if you've included `IdentifyLanguage` - and `LanguageOptions` in your request. - """ - - identify_multiple_languages: bool = False - """ - Enables automatic multi-language identification in your transcription - job request. Use this parameter if your stream contains more than one - language. If your stream contains only one language, use - IdentifyLanguage instead. - - If you include `IdentifyMultipleLanguages`, you must include a list of - language codes, using `LanguageOptions`, that you think may be present - in your stream. - - If you want to apply a custom vocabulary or a custom vocabulary filter - to your automatic multiple language identification request, include - `VocabularyNames` or `VocabularyFilterNames`. - - Note that you must include one of `LanguageCode`, `IdentifyLanguage`, or - `IdentifyMultipleLanguages` in your request. If you include more than - one of these parameters, your transcription job fails. - """ - - vocabulary_names: str | None = None - """ - Specify the names of the custom vocabularies that you want to use when - processing your transcription. Note that vocabulary names are case - sensitive. - - If none of the languages of the specified custom vocabularies match the - language identified in your media, your job fails. - - Warning: - This parameter is only intended for use **with** the `IdentifyLanguage` - parameter. If you're **not** including `IdentifyLanguage` in your - request and want to use a custom vocabulary with your transcription, use - the `VocabularyName` parameter instead. - - For more information, see [Custom - vocabularies](https://docs.aws.amazon.com/transcribe/latest/dg/custom-vocabulary.html). - """ - - vocabulary_filter_names: str | None = None - """ - Specify the names of the custom vocabulary filters that you want to use - when processing your transcription. Note that vocabulary filter names - are case sensitive. - - If none of the languages of the specified custom vocabulary filters - match the language identified in your media, your job fails. - - Warning: - This parameter is only intended for use **with** the `IdentifyLanguage` - parameter. If you're **not** including `IdentifyLanguage` in your - request and want to use a custom vocabulary filter with your - transcription, use the `VocabularyFilterName` parameter instead. - - For more information, see [Using vocabulary filtering with unwanted - words](https://docs.aws.amazon.com/transcribe/latest/dg/vocabulary-filtering.html). - """ - - session_resume_window: int | None = None - """ - Specify the time window, in minutes, during which your transcription - session can be resumed, measured from the stream start time. This - optional parameter accepts integer values from 1 to 300 (5 hours). - - For example, if your stream starts at 1 PM and you specify a - `SessionResumeWindow` of 30 minutes, you can reconnect to the session as - many times as you want until 1:30 PM. - """ - - transcript_format: str | None = None - """ - Specify how numbers, dates, and other alphanumeric entities are rendered - in your transcription results. - - - `WRITTEN` renders these entities in their standard written form (for - example, `$50`, `10:30 AM`, and `101`). - - - `SPOKEN` renders these entities as words, exactly as they were spoken - (for example, `fifty dollars`, `ten thirty a m`, and `one oh one`). - - If you don't specify a value, Amazon Transcribe uses `WRITTEN` by - default. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_STREAM_TRANSCRIPTION_INPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.language_code is not None: - serializer.write_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_INPUT.members["LanguageCode"], - self.language_code, - ) - - if self.media_sample_rate_hertz is not None: - serializer.write_integer( - _SCHEMA_START_STREAM_TRANSCRIPTION_INPUT.members[ - "MediaSampleRateHertz" - ], - self.media_sample_rate_hertz, - ) - - if self.media_encoding is not None: - serializer.write_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_INPUT.members["MediaEncoding"], - self.media_encoding, - ) - - if self.vocabulary_name is not None: - serializer.write_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_INPUT.members["VocabularyName"], - self.vocabulary_name, - ) - - if self.session_id is not None: - serializer.write_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_INPUT.members["SessionId"], - self.session_id, - ) - - if self.vocabulary_filter_name is not None: - serializer.write_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_INPUT.members[ - "VocabularyFilterName" - ], - self.vocabulary_filter_name, - ) - - if self.vocabulary_filter_method is not None: - serializer.write_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_INPUT.members[ - "VocabularyFilterMethod" - ], - self.vocabulary_filter_method, - ) - - if self.show_speaker_label is not None: - serializer.write_boolean( - _SCHEMA_START_STREAM_TRANSCRIPTION_INPUT.members["ShowSpeakerLabel"], - self.show_speaker_label, - ) - - if self.enable_channel_identification is not None: - serializer.write_boolean( - _SCHEMA_START_STREAM_TRANSCRIPTION_INPUT.members[ - "EnableChannelIdentification" - ], - self.enable_channel_identification, - ) - - if self.number_of_channels is not None: - serializer.write_integer( - _SCHEMA_START_STREAM_TRANSCRIPTION_INPUT.members["NumberOfChannels"], - self.number_of_channels, - ) - - if self.enable_partial_results_stabilization is not None: - serializer.write_boolean( - _SCHEMA_START_STREAM_TRANSCRIPTION_INPUT.members[ - "EnablePartialResultsStabilization" - ], - self.enable_partial_results_stabilization, - ) - - if self.partial_results_stability is not None: - serializer.write_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_INPUT.members[ - "PartialResultsStability" - ], - self.partial_results_stability, - ) - - if self.content_identification_type is not None: - serializer.write_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_INPUT.members[ - "ContentIdentificationType" - ], - self.content_identification_type, - ) - - if self.content_redaction_type is not None: - serializer.write_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_INPUT.members[ - "ContentRedactionType" - ], - self.content_redaction_type, - ) - - if self.pii_entity_types is not None: - serializer.write_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_INPUT.members["PiiEntityTypes"], - self.pii_entity_types, - ) - - if self.language_model_name is not None: - serializer.write_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_INPUT.members["LanguageModelName"], - self.language_model_name, - ) - - if self.identify_language is not None: - serializer.write_boolean( - _SCHEMA_START_STREAM_TRANSCRIPTION_INPUT.members["IdentifyLanguage"], - self.identify_language, - ) - - if self.language_options is not None: - serializer.write_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_INPUT.members["LanguageOptions"], - self.language_options, - ) - - if self.preferred_language is not None: - serializer.write_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_INPUT.members["PreferredLanguage"], - self.preferred_language, - ) - - if self.identify_multiple_languages is not None: - serializer.write_boolean( - _SCHEMA_START_STREAM_TRANSCRIPTION_INPUT.members[ - "IdentifyMultipleLanguages" - ], - self.identify_multiple_languages, - ) - - if self.vocabulary_names is not None: - serializer.write_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_INPUT.members["VocabularyNames"], - self.vocabulary_names, - ) - - if self.vocabulary_filter_names is not None: - serializer.write_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_INPUT.members[ - "VocabularyFilterNames" - ], - self.vocabulary_filter_names, - ) - - if self.session_resume_window is not None: - serializer.write_integer( - _SCHEMA_START_STREAM_TRANSCRIPTION_INPUT.members["SessionResumeWindow"], - self.session_resume_window, - ) - - if self.transcript_format is not None: - serializer.write_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_INPUT.members["TranscriptFormat"], - self.transcript_format, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["language_code"] = LanguageCode( - de.read_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_INPUT.members[ - "LanguageCode" - ] - ) - ) - - case 1: - kwargs["media_sample_rate_hertz"] = de.read_integer( - _SCHEMA_START_STREAM_TRANSCRIPTION_INPUT.members[ - "MediaSampleRateHertz" - ] - ) - - case 2: - kwargs["media_encoding"] = MediaEncoding( - de.read_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_INPUT.members[ - "MediaEncoding" - ] - ) - ) - - case 3: - kwargs["vocabulary_name"] = de.read_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_INPUT.members[ - "VocabularyName" - ] - ) - - case 4: - kwargs["session_id"] = de.read_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_INPUT.members["SessionId"] - ) - - case 6: - kwargs["vocabulary_filter_name"] = de.read_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_INPUT.members[ - "VocabularyFilterName" - ] - ) - - case 7: - kwargs["vocabulary_filter_method"] = VocabularyFilterMethod( - de.read_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_INPUT.members[ - "VocabularyFilterMethod" - ] - ) - ) - - case 8: - kwargs["show_speaker_label"] = de.read_boolean( - _SCHEMA_START_STREAM_TRANSCRIPTION_INPUT.members[ - "ShowSpeakerLabel" - ] - ) - - case 9: - kwargs["enable_channel_identification"] = de.read_boolean( - _SCHEMA_START_STREAM_TRANSCRIPTION_INPUT.members[ - "EnableChannelIdentification" - ] - ) - - case 10: - kwargs["number_of_channels"] = de.read_integer( - _SCHEMA_START_STREAM_TRANSCRIPTION_INPUT.members[ - "NumberOfChannels" - ] - ) - - case 11: - kwargs["enable_partial_results_stabilization"] = de.read_boolean( - _SCHEMA_START_STREAM_TRANSCRIPTION_INPUT.members[ - "EnablePartialResultsStabilization" - ] - ) - - case 12: - kwargs["partial_results_stability"] = PartialResultsStability( - de.read_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_INPUT.members[ - "PartialResultsStability" - ] - ) - ) - - case 13: - kwargs["content_identification_type"] = ContentIdentificationType( - de.read_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_INPUT.members[ - "ContentIdentificationType" - ] - ) - ) - - case 14: - kwargs["content_redaction_type"] = ContentRedactionType( - de.read_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_INPUT.members[ - "ContentRedactionType" - ] - ) - ) - - case 15: - kwargs["pii_entity_types"] = de.read_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_INPUT.members[ - "PiiEntityTypes" - ] - ) - - case 16: - kwargs["language_model_name"] = de.read_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_INPUT.members[ - "LanguageModelName" - ] - ) - - case 17: - kwargs["identify_language"] = de.read_boolean( - _SCHEMA_START_STREAM_TRANSCRIPTION_INPUT.members[ - "IdentifyLanguage" - ] - ) - - case 18: - kwargs["language_options"] = de.read_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_INPUT.members[ - "LanguageOptions" - ] - ) - - case 19: - kwargs["preferred_language"] = LanguageCode( - de.read_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_INPUT.members[ - "PreferredLanguage" - ] - ) - ) - - case 20: - kwargs["identify_multiple_languages"] = de.read_boolean( - _SCHEMA_START_STREAM_TRANSCRIPTION_INPUT.members[ - "IdentifyMultipleLanguages" - ] - ) - - case 21: - kwargs["vocabulary_names"] = de.read_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_INPUT.members[ - "VocabularyNames" - ] - ) - - case 22: - kwargs["vocabulary_filter_names"] = de.read_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_INPUT.members[ - "VocabularyFilterNames" - ] - ) - - case 23: - kwargs["session_resume_window"] = de.read_integer( - _SCHEMA_START_STREAM_TRANSCRIPTION_INPUT.members[ - "SessionResumeWindow" - ] - ) - - case 24: - kwargs["transcript_format"] = TranscriptFormat( - de.read_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_INPUT.members[ - "TranscriptFormat" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_START_STREAM_TRANSCRIPTION_INPUT, consumer=_consumer - ) - return kwargs - - -@dataclass(kw_only=True) -class Transcript: - """ - The `Transcript` associated with a . - - `Transcript` contains `Results`, which contains a set of transcription - results from one or more audio segments, along with additional - information per your request parameters. - """ - - results: list[Result] | None = None - """ - Contains a set of transcription results from one or more audio segments, - along with additional information per your request parameters. This can - include information relating to alternative transcriptions, channel - identification, partial result stabilization, language identification, - and other transcription-related data. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRANSCRIPT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.results is not None: - _serialize_result_list( - serializer, _SCHEMA_TRANSCRIPT.members["Results"], self.results - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["results"] = _deserialize_result_list( - de, _SCHEMA_TRANSCRIPT.members["Results"] - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TRANSCRIPT, consumer=_consumer) - return kwargs - - -@dataclass(kw_only=True) -class TranscriptEvent: - """ - The `TranscriptEvent` associated with a `TranscriptResultStream`. - - Contains a set of transcription results from one or more audio segments, - along with additional information per your request parameters. - """ - - transcript: Transcript | None = None - """ - Contains `Results`, which contains a set of transcription results from - one or more audio segments, along with additional information per your - request parameters. This can include information relating to alternative - transcriptions, channel identification, partial result stabilization, - language identification, and other transcription-related data. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRANSCRIPT_EVENT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.transcript is not None: - serializer.write_struct( - _SCHEMA_TRANSCRIPT_EVENT.members["Transcript"], self.transcript - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["transcript"] = Transcript.deserialize(de) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct(_SCHEMA_TRANSCRIPT_EVENT, consumer=_consumer) - return kwargs - - -@dataclass -class TranscriptResultStreamTranscriptEvent: - """ - Contains `Transcript`, which contains `Results`. The object contains a - set of transcription results from one or more audio segments, along with - additional information per your request parameters. - """ - - value: TranscriptEvent - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRANSCRIPT_RESULT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_TRANSCRIPT_RESULT_STREAM.members["TranscriptEvent"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=TranscriptEvent.deserialize(deserializer)) - - -@dataclass -class TranscriptResultStreamBadRequestException: - """ - A client error occurred when the stream was created. Check the - parameters of the request and try your request again. - """ - - value: BadRequestException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRANSCRIPT_RESULT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_TRANSCRIPT_RESULT_STREAM.members["BadRequestException"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=BadRequestException.deserialize(deserializer)) - - -@dataclass -class TranscriptResultStreamLimitExceededException: - """ - Your client has exceeded one of the Amazon Transcribe limits, typically - the concurrent stream service quota. This error can also occur if a - stream exceeds the maximum session duration. In rare cases, this error - can also occur if you increase your number of concurrent streams too - quickly. Reduce your number of concurrent streams and try your request - again using an exponential backoff strategy. - """ - - value: LimitExceededException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRANSCRIPT_RESULT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_TRANSCRIPT_RESULT_STREAM.members["LimitExceededException"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=LimitExceededException.deserialize(deserializer)) - - -@dataclass -class TranscriptResultStreamInternalFailureException: - """ - A problem occurred while processing the audio. Amazon Transcribe - terminated processing. - """ - - value: InternalFailureException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRANSCRIPT_RESULT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_TRANSCRIPT_RESULT_STREAM.members["InternalFailureException"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=InternalFailureException.deserialize(deserializer)) - - -@dataclass -class TranscriptResultStreamConflictException: - """ - A new stream started with the same session ID. The current stream has - been terminated. - """ - - value: ConflictException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRANSCRIPT_RESULT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_TRANSCRIPT_RESULT_STREAM.members["ConflictException"], self.value - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ConflictException.deserialize(deserializer)) - - -@dataclass -class TranscriptResultStreamServiceUnavailableException: - """The service is currently unavailable. Try your request later.""" - - value: ServiceUnavailableException - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_TRANSCRIPT_RESULT_STREAM, self) - - def serialize_members(self, serializer: ShapeSerializer): - serializer.write_struct( - _SCHEMA_TRANSCRIPT_RESULT_STREAM.members["ServiceUnavailableException"], - self.value, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(value=ServiceUnavailableException.deserialize(deserializer)) - - -@dataclass -class TranscriptResultStreamUnknown: - """ - Represents an unknown variant. - - If you receive this value, you will need to update your library to receive the - parsed value. - - This value may not be deliberately sent. - """ - - tag: str - - def serialize(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - def serialize_members(self, serializer: ShapeSerializer): - raise SerializationError("Unknown union variants may not be serialized.") - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - raise NotImplementedError() - - -TranscriptResultStream = Union[ - TranscriptResultStreamTranscriptEvent - | TranscriptResultStreamBadRequestException - | TranscriptResultStreamLimitExceededException - | TranscriptResultStreamInternalFailureException - | TranscriptResultStreamConflictException - | TranscriptResultStreamServiceUnavailableException - | TranscriptResultStreamUnknown -] -"""Contains detailed information about your streaming session.""" - - -class _TranscriptResultStreamDeserializer: - _result: TranscriptResultStream | None = None - - def deserialize(self, deserializer: ShapeDeserializer) -> TranscriptResultStream: - self._result = None - deserializer.read_struct(_SCHEMA_TRANSCRIPT_RESULT_STREAM, self._consumer) - - if self._result is None: - raise SerializationError( - "Unions must have exactly one value, but found none." - ) - - return self._result - - def _consumer(self, schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - self._set_result(TranscriptResultStreamTranscriptEvent.deserialize(de)) - - case 1: - self._set_result( - TranscriptResultStreamBadRequestException.deserialize(de) - ) - - case 2: - self._set_result( - TranscriptResultStreamLimitExceededException.deserialize(de) - ) - - case 3: - self._set_result( - TranscriptResultStreamInternalFailureException.deserialize(de) - ) - - case 4: - self._set_result( - TranscriptResultStreamConflictException.deserialize(de) - ) - - case 5: - self._set_result( - TranscriptResultStreamServiceUnavailableException.deserialize(de) - ) - - case _: - self._set_result( - TranscriptResultStreamUnknown(tag=schema.expect_member_name()) - ) - - def _set_result(self, value: TranscriptResultStream) -> None: - if self._result is not None: - raise SerializationError( - "Unions must have exactly one value, but found more than one." - ) - self._result = value - - -@dataclass(kw_only=True) -class StartStreamTranscriptionOutput: - """Dataclass for StartStreamTranscriptionOutput structure.""" - - request_id: str | None = None - """Provides the identifier for your streaming request.""" - - language_code: str | None = None - """Provides the language code that you specified in your request.""" - - media_sample_rate_hertz: int | None = None - """Provides the sample rate that you specified in your request.""" - - media_encoding: str | None = None - """Provides the media encoding you specified in your request.""" - - vocabulary_name: str | None = None - """ - Provides the name of the custom vocabulary that you specified in your - request. - """ - - session_id: str | None = None - """Provides the identifier for your transcription session.""" - - vocabulary_filter_name: str | None = None - """ - Provides the name of the custom vocabulary filter that you specified in - your request. - """ - - vocabulary_filter_method: str | None = None - """Provides the vocabulary filtering method used in your transcription.""" - - show_speaker_label: bool = False - """Shows whether speaker partitioning was enabled for your transcription.""" - - enable_channel_identification: bool = False - """Shows whether channel identification was enabled for your transcription.""" - - number_of_channels: int | None = None - """Provides the number of channels that you specified in your request.""" - - enable_partial_results_stabilization: bool = False - """ - Shows whether partial results stabilization was enabled for your - transcription. - """ - - partial_results_stability: str | None = None - """Provides the stabilization level used for your transcription.""" - - content_identification_type: str | None = None - """Shows whether content identification was enabled for your transcription.""" - - content_redaction_type: str | None = None - """Shows whether content redaction was enabled for your transcription.""" - - pii_entity_types: str | None = None - """Lists the PII entity types you specified in your request.""" - - language_model_name: str | None = None - """ - Provides the name of the custom language model that you specified in - your request. - """ - - identify_language: bool = False - """ - Shows whether automatic language identification was enabled for your - transcription. - """ - - language_options: str | None = None - """Provides the language codes that you specified in your request.""" - - preferred_language: str | None = None - """Provides the preferred language that you specified in your request.""" - - identify_multiple_languages: bool = False - """ - Shows whether automatic multi-language identification was enabled for - your transcription. - """ - - vocabulary_names: str | None = None - """ - Provides the names of the custom vocabularies that you specified in your - request. - """ - - vocabulary_filter_names: str | None = None - """ - Provides the names of the custom vocabulary filters that you specified - in your request. - """ - - session_resume_window: int | None = None - """ - Provides the session resume window, in minutes, that you specified in - your request. - """ - - transcript_format: str | None = None - """Provides the transcript format that you specified in your request.""" - - response_metadata: ResponseMetadata = field( - default=EMPTY_RESPONSE_METADATA, repr=False, compare=False - ) - """ - Metadata about the response that produced this output. Use this to - recover the request identifiers a service's support team needs in order - to investigate a call. Members of the metadata are individually - optional. - """ - - def serialize(self, serializer: ShapeSerializer): - serializer.write_struct(_SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT, self) - - def serialize_members(self, serializer: ShapeSerializer): - if self.request_id is not None: - serializer.write_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT.members["RequestId"], - self.request_id, - ) - - if self.language_code is not None: - serializer.write_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT.members["LanguageCode"], - self.language_code, - ) - - if self.media_sample_rate_hertz is not None: - serializer.write_integer( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT.members[ - "MediaSampleRateHertz" - ], - self.media_sample_rate_hertz, - ) - - if self.media_encoding is not None: - serializer.write_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT.members["MediaEncoding"], - self.media_encoding, - ) - - if self.vocabulary_name is not None: - serializer.write_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT.members["VocabularyName"], - self.vocabulary_name, - ) - - if self.session_id is not None: - serializer.write_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT.members["SessionId"], - self.session_id, - ) - - if self.vocabulary_filter_name is not None: - serializer.write_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT.members[ - "VocabularyFilterName" - ], - self.vocabulary_filter_name, - ) - - if self.vocabulary_filter_method is not None: - serializer.write_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT.members[ - "VocabularyFilterMethod" - ], - self.vocabulary_filter_method, - ) - - serializer.write_boolean( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT.members["ShowSpeakerLabel"], - self.show_speaker_label, - ) - serializer.write_boolean( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT.members[ - "EnableChannelIdentification" - ], - self.enable_channel_identification, - ) - if self.number_of_channels is not None: - serializer.write_integer( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT.members["NumberOfChannels"], - self.number_of_channels, - ) - - serializer.write_boolean( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT.members[ - "EnablePartialResultsStabilization" - ], - self.enable_partial_results_stabilization, - ) - if self.partial_results_stability is not None: - serializer.write_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT.members[ - "PartialResultsStability" - ], - self.partial_results_stability, - ) - - if self.content_identification_type is not None: - serializer.write_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT.members[ - "ContentIdentificationType" - ], - self.content_identification_type, - ) - - if self.content_redaction_type is not None: - serializer.write_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT.members[ - "ContentRedactionType" - ], - self.content_redaction_type, - ) - - if self.pii_entity_types is not None: - serializer.write_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT.members["PiiEntityTypes"], - self.pii_entity_types, - ) - - if self.language_model_name is not None: - serializer.write_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT.members["LanguageModelName"], - self.language_model_name, - ) - - serializer.write_boolean( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT.members["IdentifyLanguage"], - self.identify_language, - ) - if self.language_options is not None: - serializer.write_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT.members["LanguageOptions"], - self.language_options, - ) - - if self.preferred_language is not None: - serializer.write_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT.members["PreferredLanguage"], - self.preferred_language, - ) - - serializer.write_boolean( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT.members[ - "IdentifyMultipleLanguages" - ], - self.identify_multiple_languages, - ) - if self.vocabulary_names is not None: - serializer.write_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT.members["VocabularyNames"], - self.vocabulary_names, - ) - - if self.vocabulary_filter_names is not None: - serializer.write_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT.members[ - "VocabularyFilterNames" - ], - self.vocabulary_filter_names, - ) - - if self.session_resume_window is not None: - serializer.write_integer( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT.members[ - "SessionResumeWindow" - ], - self.session_resume_window, - ) - - if self.transcript_format is not None: - serializer.write_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT.members["TranscriptFormat"], - self.transcript_format, - ) - - @classmethod - def deserialize(cls, deserializer: ShapeDeserializer) -> Self: - return cls(**cls.deserialize_kwargs(deserializer)) - - @classmethod - def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]: - kwargs: dict[str, Any] = {} - - def _consumer(schema: Schema, de: ShapeDeserializer) -> None: - match schema.expect_member_index(): - case 0: - kwargs["request_id"] = de.read_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT.members["RequestId"] - ) - - case 1: - kwargs["language_code"] = LanguageCode( - de.read_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT.members[ - "LanguageCode" - ] - ) - ) - - case 2: - kwargs["media_sample_rate_hertz"] = de.read_integer( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT.members[ - "MediaSampleRateHertz" - ] - ) - - case 3: - kwargs["media_encoding"] = MediaEncoding( - de.read_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT.members[ - "MediaEncoding" - ] - ) - ) - - case 4: - kwargs["vocabulary_name"] = de.read_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT.members[ - "VocabularyName" - ] - ) - - case 5: - kwargs["session_id"] = de.read_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT.members["SessionId"] - ) - - case 7: - kwargs["vocabulary_filter_name"] = de.read_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT.members[ - "VocabularyFilterName" - ] - ) - - case 8: - kwargs["vocabulary_filter_method"] = VocabularyFilterMethod( - de.read_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT.members[ - "VocabularyFilterMethod" - ] - ) - ) - - case 9: - kwargs["show_speaker_label"] = de.read_boolean( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT.members[ - "ShowSpeakerLabel" - ] - ) - - case 10: - kwargs["enable_channel_identification"] = de.read_boolean( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT.members[ - "EnableChannelIdentification" - ] - ) - - case 11: - kwargs["number_of_channels"] = de.read_integer( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT.members[ - "NumberOfChannels" - ] - ) - - case 12: - kwargs["enable_partial_results_stabilization"] = de.read_boolean( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT.members[ - "EnablePartialResultsStabilization" - ] - ) - - case 13: - kwargs["partial_results_stability"] = PartialResultsStability( - de.read_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT.members[ - "PartialResultsStability" - ] - ) - ) - - case 14: - kwargs["content_identification_type"] = ContentIdentificationType( - de.read_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT.members[ - "ContentIdentificationType" - ] - ) - ) - - case 15: - kwargs["content_redaction_type"] = ContentRedactionType( - de.read_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT.members[ - "ContentRedactionType" - ] - ) - ) - - case 16: - kwargs["pii_entity_types"] = de.read_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT.members[ - "PiiEntityTypes" - ] - ) - - case 17: - kwargs["language_model_name"] = de.read_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT.members[ - "LanguageModelName" - ] - ) - - case 18: - kwargs["identify_language"] = de.read_boolean( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT.members[ - "IdentifyLanguage" - ] - ) - - case 19: - kwargs["language_options"] = de.read_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT.members[ - "LanguageOptions" - ] - ) - - case 20: - kwargs["preferred_language"] = LanguageCode( - de.read_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT.members[ - "PreferredLanguage" - ] - ) - ) - - case 21: - kwargs["identify_multiple_languages"] = de.read_boolean( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT.members[ - "IdentifyMultipleLanguages" - ] - ) - - case 22: - kwargs["vocabulary_names"] = de.read_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT.members[ - "VocabularyNames" - ] - ) - - case 23: - kwargs["vocabulary_filter_names"] = de.read_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT.members[ - "VocabularyFilterNames" - ] - ) - - case 24: - kwargs["session_resume_window"] = de.read_integer( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT.members[ - "SessionResumeWindow" - ] - ) - - case 25: - kwargs["transcript_format"] = TranscriptFormat( - de.read_string( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT.members[ - "TranscriptFormat" - ] - ) - ) - - case _: - logger.debug("Unexpected member schema: %s", schema) - - deserializer.read_struct( - _SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT, consumer=_consumer - ) - return kwargs - - -START_STREAM_TRANSCRIPTION = APIOperation( - input=StartStreamTranscriptionInput, - output=StartStreamTranscriptionOutput, - schema=_SCHEMA_START_STREAM_TRANSCRIPTION, - input_schema=_SCHEMA_START_STREAM_TRANSCRIPTION_INPUT, - output_schema=_SCHEMA_START_STREAM_TRANSCRIPTION_OUTPUT, - error_registry=TypeRegistry( - { - ShapeID( - "com.amazonaws.transcribestreaming#BadRequestException" - ): BadRequestException, - ShapeID( - "com.amazonaws.transcribestreaming#ConflictException" - ): ConflictException, - ShapeID( - "com.amazonaws.transcribestreaming#InternalFailureException" - ): InternalFailureException, - ShapeID( - "com.amazonaws.transcribestreaming#LimitExceededException" - ): LimitExceededException, - ShapeID( - "com.amazonaws.transcribestreaming#ServiceUnavailableException" - ): ServiceUnavailableException, - } - ), - effective_auth_schemes=[ShapeID("aws.auth#sigv4")], - error_schemas=[ - _SCHEMA_BAD_REQUEST_EXCEPTION, - _SCHEMA_CONFLICT_EXCEPTION, - _SCHEMA_INTERNAL_FAILURE_EXCEPTION, - _SCHEMA_LIMIT_EXCEEDED_EXCEPTION, - _SCHEMA_SERVICE_UNAVAILABLE_EXCEPTION, +START_STREAM_TRANSCRIPTION: APIOperation[ + StartStreamTranscriptionInput, StartStreamTranscriptionOutput +] = APIOperation( + static_schema=_SCHEMA_START_STREAM_TRANSCRIPTION, + model_registry=_registry, + error_ids=[ + ShapeID("com.amazonaws.transcribestreaming#BadRequestException"), + ShapeID("com.amazonaws.transcribestreaming#ConflictException"), + ShapeID("com.amazonaws.transcribestreaming#InternalFailureException"), + ShapeID("com.amazonaws.transcribestreaming#LimitExceededException"), + ShapeID("com.amazonaws.transcribestreaming#ServiceUnavailableException"), ], + effective_auth_schemes=[ShapeID("aws.auth#sigv4")], ) diff --git a/clients/aws-sdk-transcribe-streaming/src/aws_sdk_transcribe_streaming/models.pyi b/clients/aws-sdk-transcribe-streaming/src/aws_sdk_transcribe_streaming/models.pyi new file mode 100644 index 00000000..50587507 --- /dev/null +++ b/clients/aws-sdk-transcribe-streaming/src/aws_sdk_transcribe_streaming/models.pyi @@ -0,0 +1,3087 @@ +# Code generated by smithy-python-codegen DO NOT EDIT. + +from dataclasses import dataclass +from datetime import datetime +from enum import StrEnum +from typing import Self, Union + +from smithy_core.deserializers import ShapeDeserializer +from smithy_core.exceptions import ModeledError +from smithy_core.response import ResponseMetadata +from smithy_core.schemas import APIOperation +from smithy_core.serializers import ShapeSerializer +from smithy_core.types import UnknownEnumMixin + +class _SerdeShape: + def serialize(self, serializer: ShapeSerializer) -> None: ... + def serialize_members(self, serializer: ShapeSerializer) -> None: ... + @classmethod + def deserialize(cls, deserializer: ShapeDeserializer) -> Self: ... + +class ServiceError(ModeledError): + """ + Base error for all errors in the service. + + Some exceptions do not extend from this class, including + synthetic, implicit, and shared exception types. + """ + +@dataclass(kw_only=True) +class Alternative(_SerdeShape): + """ + A list of possible alternative transcriptions for the input audio. Each + alternative may contain one or more of `Items`, `Entities`, or + `Transcript`. + """ + + transcript: str | None = ... + """Contains transcribed text.""" + items: list[Item] | None = ... + """ + Contains words, phrases, or punctuation marks in your transcription + output. + """ + entities: list[Entity] | None = ... + """ + Contains entities identified as personally identifiable information + (PII) in your transcription output. + """ + +@dataclass(kw_only=True) +class AudioEvent(_SerdeShape): + """ + A wrapper for your audio chunks. Your audio stream consists of one or + more audio events, which consist of one or more audio chunks. + + For more information, see [Event stream + encoding](https://docs.aws.amazon.com/transcribe/latest/dg/event-stream.html). + """ + + audio_chunk: bytes | None = ... + """ + An audio blob containing the next segment of audio from your + application, with a maximum duration of 1 second. The maximum size in + bytes varies based on audio properties. + + Find recommended size in [Transcribing streaming best + practices](https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html#best-practices). + + Size calculation: + `Duration (s) * Sample Rate (Hz) * Number of Channels * 2 (Bytes per Sample)` + + For example, a 1-second chunk of 16 kHz, 2-channel, 16-bit audio would + be `1 * 16000 * 2 * 2 = 64000 bytes`. + + For 8 kHz, 1-channel, 16-bit audio, a 1-second chunk would be + `1 * 8000 * 1 * 2 = 16000 bytes`. + """ + +@dataclass +class AudioStreamAudioEvent(_SerdeShape): + """ + A blob of audio from your application. Your audio stream consists of one + or more audio events. + + For more information, see [Event stream + encoding](https://docs.aws.amazon.com/transcribe/latest/dg/event-stream.html). + """ + + value: AudioEvent + +@dataclass +class AudioStreamConfigurationEvent(_SerdeShape): + """Contains audio channel definitions and post-call analytics settings.""" + + value: ConfigurationEvent + +@dataclass +class AudioStreamUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +AudioStream = Union[ + AudioStreamAudioEvent | AudioStreamConfigurationEvent | AudioStreamUnknown +] +""" +An encoded stream of audio blobs. Audio streams are encoded as either +HTTP/2 or WebSocket data frames. + +For more information, see [Transcribing streaming +audio](https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html). +""" + +class _AudioStreamDeserializer: + def deserialize(self, deserializer: ShapeDeserializer) -> AudioStream: ... + +@dataclass(kw_only=True) +class BadRequestException(ServiceError, _SerdeShape): + """ + One or more arguments to the `StartStreamTranscription`, + `StartMedicalStreamTranscription`, or + `StartCallAnalyticsStreamTranscription` operation was not valid. For + example, `MediaEncoding` or `LanguageCode` used unsupported values. + Check the specified parameters and try your request again. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class CallAnalyticsEntity(_SerdeShape): + """ + Contains entities identified as personally identifiable information + (PII) in your transcription output, along with various associated + attributes. Examples include category, confidence score, content, type, + and start and end times. + """ + + begin_offset_millis: int | None = ... + """ + The time, in milliseconds, from the beginning of the audio stream to the + start of the identified entity. + """ + end_offset_millis: int | None = ... + """ + The time, in milliseconds, from the beginning of the audio stream to the + end of the identified entity. + """ + category: str | None = ... + """The category of information identified. For example, `PII`.""" + type: str | None = ... + """ + The type of PII identified. For example, `NAME` or + `CREDIT_DEBIT_NUMBER`. + """ + content: str | None = ... + """The word or words that represent the identified entity.""" + confidence: float | None = ... + """ + The confidence score associated with the identification of an entity in + your transcript. + + Confidence scores are values between 0 and 1. A larger value indicates a + higher probability that the identified entity correctly matches the + entity spoken in your media. + """ + +@dataclass(kw_only=True) +class CallAnalyticsItem(_SerdeShape): + """ + A word, phrase, or punctuation mark in your Call Analytics transcription + output, along with various associated attributes, such as confidence + score, type, and start and end times. + """ + + begin_offset_millis: int | None = ... + """ + The time, in milliseconds, from the beginning of the audio stream to the + start of the identified item. + """ + end_offset_millis: int | None = ... + """ + The time, in milliseconds, from the beginning of the audio stream to the + end of the identified item. + """ + type: str | None = ... + """ + The type of item identified. Options are: `PRONUNCIATION` (spoken words) + and `PUNCTUATION`. + """ + content: str | None = ... + """The word or punctuation that was transcribed.""" + confidence: float | None = ... + """ + The confidence score associated with a word or phrase in your + transcript. + + Confidence scores are values between 0 and 1. A larger value indicates a + higher probability that the identified item correctly matches the item + spoken in your media. + """ + vocabulary_filter_match: bool = ... + """ + Indicates whether the specified item matches a word in the vocabulary + filter included in your Call Analytics request. If `true`, there is a + vocabulary filter match. + """ + stable: bool | None = ... + """ + If partial result stabilization is enabled, `Stable` indicates whether + the specified item is stable (`true`) or if it may change when the + segment is complete (`false`). + """ + +class CallAnalyticsLanguageCode(UnknownEnumMixin, StrEnum): + EN_US = "en-US" + EN_GB = "en-GB" + ES_US = "es-US" + FR_CA = "fr-CA" + FR_FR = "fr-FR" + EN_AU = "en-AU" + IT_IT = "it-IT" + DE_DE = "de-DE" + PT_BR = "pt-BR" + +@dataclass(kw_only=True) +class CallAnalyticsLanguageWithScore(_SerdeShape): + """ + The language code that represents the language identified in your audio, + including the associated confidence score. + """ + + language_code: str | None = ... + """The language code of the identified language.""" + score: float = ... + """ + The confidence score associated with the identified language code. + Confidence scores are values between zero and one; larger values + indicate a higher confidence in the identified language. + """ + +@dataclass +class CallAnalyticsTranscriptResultStreamUtteranceEvent(_SerdeShape): + """ + Contains set of transcription results from one or more audio segments, + along with additional information per your request parameters. This can + include information relating to channel definitions, partial result + stabilization, sentiment, issue detection, and other + transcription-related data. + """ + + value: UtteranceEvent + +@dataclass +class CallAnalyticsTranscriptResultStreamCategoryEvent(_SerdeShape): + """ + Provides information on matched categories that were used to generate + real-time supervisor alerts. + """ + + value: CategoryEvent + +@dataclass +class CallAnalyticsTranscriptResultStreamBadRequestException(_SerdeShape): + """ + One or more arguments to the `StartStreamTranscription`, + `StartMedicalStreamTranscription`, or + `StartCallAnalyticsStreamTranscription` operation was not valid. For + example, `MediaEncoding` or `LanguageCode` used unsupported values. + Check the specified parameters and try your request again. + """ + + value: BadRequestException + +@dataclass +class CallAnalyticsTranscriptResultStreamLimitExceededException(_SerdeShape): + """ + Your client has exceeded one of the Amazon Transcribe limits, typically + the concurrent stream service quota. This error can also occur if a + stream exceeds the maximum session duration. In rare cases, this error + can also occur if you increase your number of concurrent streams too + quickly. Reduce your number of concurrent streams and try your request + again using an exponential backoff strategy. + """ + + value: LimitExceededException + +@dataclass +class CallAnalyticsTranscriptResultStreamInternalFailureException(_SerdeShape): + """ + A problem occurred while processing the audio. Amazon Transcribe + terminated processing. + """ + + value: InternalFailureException + +@dataclass +class CallAnalyticsTranscriptResultStreamConflictException(_SerdeShape): + """ + A new stream started with the same session ID. The current stream has + been terminated. + """ + + value: ConflictException + +@dataclass +class CallAnalyticsTranscriptResultStreamServiceUnavailableException(_SerdeShape): + """The service is currently unavailable. Try your request later.""" + + value: ServiceUnavailableException + +@dataclass +class CallAnalyticsTranscriptResultStreamUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +CallAnalyticsTranscriptResultStream = Union[ + CallAnalyticsTranscriptResultStreamUtteranceEvent + | CallAnalyticsTranscriptResultStreamCategoryEvent + | CallAnalyticsTranscriptResultStreamBadRequestException + | CallAnalyticsTranscriptResultStreamLimitExceededException + | CallAnalyticsTranscriptResultStreamInternalFailureException + | CallAnalyticsTranscriptResultStreamConflictException + | CallAnalyticsTranscriptResultStreamServiceUnavailableException + | CallAnalyticsTranscriptResultStreamUnknown +] +""" +Contains detailed information about your real-time Call Analytics +session. These details are provided in the `UtteranceEvent` and +`CategoryEvent` objects. +""" + +class _CallAnalyticsTranscriptResultStreamDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> CallAnalyticsTranscriptResultStream: ... + +@dataclass(kw_only=True) +class CategoryEvent(_SerdeShape): + """ + Provides information on any `TranscriptFilterType` categories that + matched your transcription output. Matches are identified for each + segment upon completion of that segment. + """ + + matched_categories: list[str] | None = ... + """Lists the categories that were matched in your audio segment.""" + matched_details: dict[str, PointsOfInterest] | None = ... + """ + Contains information about the matched categories, including category + names and timestamps. + """ + +@dataclass(kw_only=True) +class ChannelDefinition(_SerdeShape): + """ + Makes it possible to specify which speaker is on which audio channel. + For example, if your agent is the first participant to speak, you would + set `ChannelId` to `0` (to indicate the first channel) and + `ParticipantRole` to `AGENT` (to indicate that it's the agent + speaking). + """ + + channel_id: int = ... + """Specify the audio channel you want to define.""" + participant_role: str + """ + Specify the speaker you want to define. Omitting this parameter is + equivalent to specifying both participants. + """ + +@dataclass(kw_only=True) +class CharacterOffsets(_SerdeShape): + """ + Provides the location, using character count, in your transcript where a + match is identified. For example, the location of an issue or a category + match within a segment. + """ + + begin: int | None = ... + """ + Provides the character count of the first character where a match is + identified. For example, the first character associated with an issue or + a category match in a segment transcript. + """ + end: int | None = ... + """ + Provides the character count of the last character where a match is + identified. For example, the last character associated with an issue or + a category match in a segment transcript. + """ + +@dataclass(kw_only=True) +class ClinicalNoteGenerationResult(_SerdeShape): + """ + The details for clinical note generation, including status, and output + locations for clinical note and aggregated transcript if the analytics + completed, or failure reason if the analytics failed. + """ + + clinical_note_output_location: str | None = ... + """Holds the Amazon S3 URI for the output Clinical Note.""" + transcript_output_location: str | None = ... + """Holds the Amazon S3 URI for the output Transcript.""" + status: str | None = ... + """ + The status of the clinical note generation. + + Possible Values: + + - `IN_PROGRESS` + + - `FAILED` + + - `COMPLETED` + + After audio streaming finishes, and you send a + `MedicalScribeSessionControlEvent` event (with END_OF_SESSION as the + Type), the status is set to `IN_PROGRESS`. If the status is `COMPLETED`, + the analytics completed successfully, and you can find the results at + the locations specified in `ClinicalNoteOutputLocation` and + `TranscriptOutputLocation`. If the status is `FAILED`, `FailureReason` + provides details about the failure. + """ + failure_reason: str | None = ... + """ + If `ClinicalNoteGenerationResult` is `FAILED`, information about why it + failed. + """ + +@dataclass(kw_only=True) +class ClinicalNoteGenerationSettings(_SerdeShape): + """ + The output configuration for aggregated transcript and clinical note + generation. + """ + + output_bucket_name: str + """ + The name of the Amazon S3 bucket where you want the output of Amazon Web + Services HealthScribe post-stream analytics stored. Don't include the + `S3://` prefix of the specified bucket. + + HealthScribe outputs transcript and clinical note files under the + prefix: + `S3://$output-bucket-name/healthscribe-streaming/session-id/post-stream-analytics/clinical-notes` + + The role `ResourceAccessRoleArn` specified in the + `MedicalScribeConfigurationEvent` must have permission to use the + specified location. You can change Amazon S3 permissions using the + [Amazon Web Services Management + Console](https://console.aws.amazon.com/s3) . See also [Permissions + Required for IAM User + Roles](https://docs.aws.amazon.com/transcribe/latest/dg/security_iam_id-based-policy-examples.html#auth-role-iam-user) + . + """ + note_template: str | None = ... + """ + Specify one of the following templates to use for the clinical note + summary. The default is `HISTORY_AND_PHYSICAL`. + + - HISTORY_AND_PHYSICAL: Provides summaries for key sections of the + clinical documentation. Examples of sections include Chief Complaint, + History of Present Illness, Review of Systems, Past Medical History, + Assessment, and Plan. + + - GIRPP: Provides summaries based on the patients progress toward goals. + Examples of sections include Goal, Intervention, Response, Progress, + and Plan. + + - BIRP: Focuses on the patient's behavioral patterns and responses. + Examples of sections include Behavior, Intervention, Response, and + Plan. + + - SIRP: Emphasizes the situational context of therapy. Examples of + sections include Situation, Intervention, Response, and Plan. + + - DAP: Provides a simplified format for clinical documentation. Examples + of sections include Data, Assessment, and Plan. + + - BEHAVIORAL_SOAP: Behavioral health focused documentation format. + Examples of sections include Subjective, Objective, Assessment, and + Plan. + + - PHYSICAL_SOAP: Physical health focused documentation format. Examples + of sections include Subjective, Objective, Assessment, and Plan. + """ + +class ClinicalNoteGenerationStatus(UnknownEnumMixin, StrEnum): + IN_PROGRESS = "IN_PROGRESS" + FAILED = "FAILED" + COMPLETED = "COMPLETED" + +@dataclass(kw_only=True) +class ConfigurationEvent(_SerdeShape): + """ + Allows you to set audio channel definitions and post-call analytics + settings. + """ + + channel_definitions: list[ChannelDefinition] | None = ... + """Indicates which speaker is on which audio channel.""" + post_call_analytics_settings: PostCallAnalyticsSettings | None = ... + """ + Provides additional optional settings for your Call Analytics post-call + request, including encryption and output locations for your redacted + transcript. + + `PostCallAnalyticsSettings` provides you with the same insights as a + Call Analytics post-call transcription. Refer to [Post-call + analytics](https://docs.aws.amazon.com/transcribe/latest/dg/tca-post-call.html) + for more information on this feature. + """ + +@dataclass(kw_only=True) +class ConflictException(ServiceError, _SerdeShape): + """ + A new stream started with the same session ID. The current stream has + been terminated. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class ContentIdentificationType(UnknownEnumMixin, StrEnum): + PII = "PII" + +class ContentRedactionOutput(UnknownEnumMixin, StrEnum): + REDACTED = "redacted" + REDACTED_AND_UNREDACTED = "redacted_and_unredacted" + +class ContentRedactionType(UnknownEnumMixin, StrEnum): + PII = "PII" + +@dataclass(kw_only=True) +class Entity(_SerdeShape): + """ + Contains entities identified as personally identifiable information + (PII) in your transcription output, along with various associated + attributes. Examples include category, confidence score, type, stability + score, and start and end times. + """ + + start_time: float = ... + """ + The start time of the utterance that was identified as PII in seconds, + with millisecond precision (e.g., 1.056) + """ + end_time: float = ... + """ + The end time of the utterance that was identified as PII in seconds, + with millisecond precision (e.g., 1.056) + """ + category: str | None = ... + """The category of information identified. The only category is `PII`.""" + type: str | None = ... + """ + The type of PII identified. For example, `NAME` or + `CREDIT_DEBIT_NUMBER`. + """ + content: str | None = ... + """The word or words identified as PII.""" + confidence: float | None = ... + """ + The confidence score associated with the identified PII entity in your + audio. + + Confidence scores are values between 0 and 1. A larger value indicates a + higher probability that the identified entity correctly matches the + entity spoken in your media. + """ + +@dataclass(kw_only=True) +class GetMedicalScribeStreamInput(_SerdeShape): + """Dataclass for GetMedicalScribeStreamInput structure.""" + + session_id: str | None = ... + """ + The identifier of the HealthScribe streaming session you want + information about. + """ + +@dataclass(kw_only=True) +class GetMedicalScribeStreamOutput(_SerdeShape): + """Dataclass for GetMedicalScribeStreamOutput structure.""" + + medical_scribe_stream_details: MedicalScribeStreamDetails | None = ... + """Provides details about a HealthScribe streaming session.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class InternalFailureException(ServiceError, _SerdeShape): + """ + A problem occurred while processing the audio. Amazon Transcribe + terminated processing. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class IssueDetected(_SerdeShape): + """Lists the issues that were identified in your audio segment.""" + + character_offsets: CharacterOffsets | None = ... + """ + Provides the timestamps that identify when in an audio segment the + specified issue occurs. + """ + +@dataclass(kw_only=True) +class Item(_SerdeShape): + """ + A word, phrase, or punctuation mark in your transcription output, along + with various associated attributes, such as confidence score, type, and + start and end times. + """ + + start_time: float = ... + """ + The start time of the transcribed item in seconds, with millisecond + precision (e.g., 1.056) + """ + end_time: float = ... + """ + The end time of the transcribed item in seconds, with millisecond + precision (e.g., 1.056) + """ + type: str | None = ... + """ + The type of item identified. Options are: `PRONUNCIATION` (spoken words) + and `PUNCTUATION`. + """ + content: str | None = ... + """The word or punctuation that was transcribed.""" + vocabulary_filter_match: bool = ... + """ + Indicates whether the specified item matches a word in the vocabulary + filter included in your request. If `true`, there is a vocabulary filter + match. + """ + speaker: str | None = ... + """ + If speaker partitioning is enabled, `Speaker` labels the speaker of the + specified item. + """ + confidence: float | None = ... + """ + The confidence score associated with a word or phrase in your + transcript. + + Confidence scores are values between 0 and 1. A larger value indicates a + higher probability that the identified item correctly matches the item + spoken in your media. + """ + stable: bool | None = ... + """ + If partial result stabilization is enabled, `Stable` indicates whether + the specified item is stable (`true`) or if it may change when the + segment is complete (`false`). + """ + +class ItemType(UnknownEnumMixin, StrEnum): + PRONUNCIATION = "pronunciation" + PUNCTUATION = "punctuation" + +class LanguageCode(UnknownEnumMixin, StrEnum): + EN_US = "en-US" + EN_GB = "en-GB" + ES_US = "es-US" + FR_CA = "fr-CA" + FR_FR = "fr-FR" + EN_AU = "en-AU" + IT_IT = "it-IT" + DE_DE = "de-DE" + PT_BR = "pt-BR" + JA_JP = "ja-JP" + KO_KR = "ko-KR" + ZH_CN = "zh-CN" + TH_TH = "th-TH" + ES_ES = "es-ES" + AR_SA = "ar-SA" + PT_PT = "pt-PT" + CA_ES = "ca-ES" + AR_AE = "ar-AE" + HI_IN = "hi-IN" + ZH_HK = "zh-HK" + NL_NL = "nl-NL" + NO_NO = "no-NO" + SV_SE = "sv-SE" + PL_PL = "pl-PL" + FI_FI = "fi-FI" + ZH_TW = "zh-TW" + EN_IN = "en-IN" + EN_IE = "en-IE" + EN_NZ = "en-NZ" + EN_AB = "en-AB" + EN_ZA = "en-ZA" + EN_WL = "en-WL" + DE_CH = "de-CH" + AF_ZA = "af-ZA" + EU_ES = "eu-ES" + HR_HR = "hr-HR" + CS_CZ = "cs-CZ" + DA_DK = "da-DK" + FA_IR = "fa-IR" + GL_ES = "gl-ES" + EL_GR = "el-GR" + HE_IL = "he-IL" + ID_ID = "id-ID" + LV_LV = "lv-LV" + MS_MY = "ms-MY" + RO_RO = "ro-RO" + RU_RU = "ru-RU" + SR_RS = "sr-RS" + SK_SK = "sk-SK" + SO_SO = "so-SO" + TL_PH = "tl-PH" + UK_UA = "uk-UA" + VI_VN = "vi-VN" + ZU_ZA = "zu-ZA" + AM_ET = "am-ET" + BE_BY = "be-BY" + BG_BG = "bg-BG" + BN_IN = "bn-IN" + BS_BA = "bs-BA" + CKB_IQ = "ckb-IQ" + CKB_IR = "ckb-IR" + CY_WL = "cy-WL" + ES_MX = "es-MX" + ET_ET = "et-ET" + FA_AF = "fa-AF" + GU_IN = "gu-IN" + HT_HT = "ht-HT" + HU_HU = "hu-HU" + HY_AM = "hy-AM" + IS_IS = "is-IS" + JV_ID = "jv-ID" + KA_GE = "ka-GE" + KAB_DZ = "kab-DZ" + KK_KZ = "kk-KZ" + KM_KH = "km-KH" + KN_IN = "kn-IN" + LG_IN = "lg-IN" + LT_LT = "lt-LT" + MK_MK = "mk-MK" + ML_IN = "ml-IN" + MR_IN = "mr-IN" + MY_MM = "my-MM" + NE_NP = "ne-NP" + OR_IN = "or-IN" + PA_IN = "pa-IN" + PS_AF = "ps-AF" + SI_LK = "si-LK" + SL_SI = "sl-SI" + SQ_AL = "sq-AL" + SU_ID = "su-ID" + SW_BI = "sw-BI" + SW_KE = "sw-KE" + SW_RW = "sw-RW" + SW_TZ = "sw-TZ" + SW_UG = "sw-UG" + TA_IN = "ta-IN" + TE_IN = "te-IN" + TR_TR = "tr-TR" + UZ_UZ = "uz-UZ" + +@dataclass(kw_only=True) +class LanguageWithScore(_SerdeShape): + """ + The language code that represents the language identified in your audio, + including the associated confidence score. If you enabled channel + identification in your request and each channel contained a different + language, you will have more than one `LanguageWithScore` result. + """ + + language_code: str | None = ... + """The language code of the identified language.""" + score: float = ... + """ + The confidence score associated with the identified language code. + Confidence scores are values between zero and one; larger values + indicate a higher confidence in the identified language. + """ + +@dataclass(kw_only=True) +class LimitExceededException(ServiceError, _SerdeShape): + """ + Your client has exceeded one of the Amazon Transcribe limits, typically + the concurrent stream service quota. This error can also occur if a + stream exceeds the maximum session duration. In rare cases, this error + can also occur if you increase your number of concurrent streams too + quickly. Reduce your number of concurrent streams and try your request + again using an exponential backoff strategy. + """ + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class MediaEncoding(UnknownEnumMixin, StrEnum): + PCM = "pcm" + OGG_OPUS = "ogg-opus" + FLAC = "flac" + G711_ALAW = "g711-alaw" + G711_ULAW = "g711-ulaw" + G729 = "g729" + +@dataclass(kw_only=True) +class MedicalAlternative(_SerdeShape): + """ + A list of possible alternative transcriptions for the input audio. Each + alternative may contain one or more of `Items`, `Entities`, or + `Transcript`. + """ + + transcript: str | None = ... + """Contains transcribed text.""" + items: list[MedicalItem] | None = ... + """ + Contains words, phrases, or punctuation marks in your transcription + output. + """ + entities: list[MedicalEntity] | None = ... + """ + Contains entities identified as personal health information (PHI) in + your transcription output. + """ + +class MedicalContentIdentificationType(UnknownEnumMixin, StrEnum): + PHI = "PHI" + +@dataclass(kw_only=True) +class MedicalEntity(_SerdeShape): + """ + Contains entities identified as personal health information (PHI) in + your transcription output, along with various associated attributes. + Examples include category, confidence score, type, stability score, and + start and end times. + """ + + start_time: float = ... + """The start time, in seconds, of the utterance that was identified as PHI.""" + end_time: float = ... + """The end time, in seconds, of the utterance that was identified as PHI.""" + category: str | None = ... + """The category of information identified. The only category is `PHI`.""" + content: str | None = ... + """The word or words identified as PHI.""" + confidence: float | None = ... + """ + The confidence score associated with the identified PHI entity in your + audio. + + Confidence scores are values between 0 and 1. A larger value indicates a + higher probability that the identified entity correctly matches the + entity spoken in your media. + """ + +@dataclass(kw_only=True) +class MedicalItem(_SerdeShape): + """ + A word, phrase, or punctuation mark in your transcription output, along + with various associated attributes, such as confidence score, type, and + start and end times. + """ + + start_time: float = ... + """The start time, in seconds, of the transcribed item.""" + end_time: float = ... + """The end time, in seconds, of the transcribed item.""" + type: str | None = ... + """ + The type of item identified. Options are: `PRONUNCIATION` (spoken words) + and `PUNCTUATION`. + """ + content: str | None = ... + """The word or punctuation that was transcribed.""" + confidence: float | None = ... + """ + The confidence score associated with a word or phrase in your + transcript. + + Confidence scores are values between 0 and 1. A larger value indicates a + higher probability that the identified item correctly matches the item + spoken in your media. + """ + speaker: str | None = ... + """ + If speaker partitioning is enabled, `Speaker` labels the speaker of the + specified item. + """ + +@dataclass(kw_only=True) +class MedicalResult(_SerdeShape): + """ + The `Result` associated with a . + + Contains a set of transcription results from one or more audio segments, + along with additional information per your request parameters. This can + include information relating to alternative transcriptions, channel + identification, partial result stabilization, language identification, + and other transcription-related data. + """ + + result_id: str | None = ... + """Provides a unique identifier for the `Result`.""" + start_time: float = ... + """The start time, in seconds, of the `Result`.""" + end_time: float = ... + """The end time, in seconds, of the `Result`.""" + is_partial: bool = ... + """ + Indicates if the segment is complete. + + If `IsPartial` is `true`, the segment is not complete. If `IsPartial` is + `false`, the segment is complete. + """ + alternatives: list[MedicalAlternative] | None = ... + """ + A list of possible alternative transcriptions for the input audio. Each + alternative may contain one or more of `Items`, `Entities`, or + `Transcript`. + """ + channel_id: str | None = ... + """Indicates the channel identified for the `Result`.""" + +@dataclass(kw_only=True) +class MedicalScribeAudioEvent(_SerdeShape): + """ + A wrapper for your audio chunks + + For more information, see [Event stream + encoding](https://docs.aws.amazon.com/transcribe/latest/dg/event-stream.html). + """ + + audio_chunk: bytes + """ + An audio blob containing the next segment of audio from your + application, with a maximum duration of 1 second. The maximum size in + bytes varies based on audio properties. + + Find recommended size in [Transcribing streaming best + practices](https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html#best-practices). + + Size calculation: + `Duration (s) * Sample Rate (Hz) * Number of Channels * 2 (Bytes per Sample)` + + For example, a 1-second chunk of 16 kHz, 2-channel, 16-bit audio would + be `1 * 16000 * 2 * 2 = 64000 bytes`. + + For 8 kHz, 1-channel, 16-bit audio, a 1-second chunk would be + `1 * 8000 * 1 * 2 = 16000 bytes`. + """ + +@dataclass(kw_only=True) +class MedicalScribeChannelDefinition(_SerdeShape): + """ + Makes it possible to specify which speaker is on which channel. For + example, if the clinician is the first participant to speak, you would + set the `ChannelId` of the first `ChannelDefinition` in the list to `0` + (to indicate the first channel) and `ParticipantRole` to `CLINICIAN` (to + indicate that it's the clinician speaking). Then you would set the + `ChannelId` of the second `ChannelDefinition` in the list to `1` (to + indicate the second channel) and `ParticipantRole` to `PATIENT` (to + indicate that it's the patient speaking). + + If you don't specify a channel definition, HealthScribe will diarize + the transcription and identify speaker roles for each speaker. + """ + + channel_id: int = ... + """Specify the audio channel you want to define.""" + participant_role: str + """ + Specify the participant that you want to flag. The allowed options are + `CLINICIAN` and `PATIENT`. + """ + +@dataclass(kw_only=True) +class MedicalScribeConfigurationEvent(_SerdeShape): + """ + Specify details to configure the streaming session, including channel + definitions, encryption settings, post-stream analytics settings, + resource access role ARN and vocabulary settings. + + Whether you are starting a new session or resuming an existing session, + your first event must be a `MedicalScribeConfigurationEvent`. If you are + resuming a session, then this event must have the same configurations + that you provided to start the session. + """ + + vocabulary_name: str | None = ... + """ + Specify the name of the custom vocabulary you want to use for your + streaming session. Custom vocabulary names are case-sensitive. + """ + vocabulary_filter_name: str | None = ... + """ + Specify the name of the custom vocabulary filter you want to include in + your streaming session. Custom vocabulary filter names are + case-sensitive. + + If you include `VocabularyFilterName` in the + `MedicalScribeConfigurationEvent`, you must also include + `VocabularyFilterMethod`. + """ + vocabulary_filter_method: str | None = ... + """ + Specify how you want your custom vocabulary filter applied to the + streaming session. + + To replace words with `***`, specify `mask`. + + To delete words, specify `remove`. + + To flag words without changing them, specify `tag`. + """ + resource_access_role_arn: str + """ + The Amazon Resource Name (ARN) of an IAM role that has permissions to + access the Amazon S3 output bucket you specified, and use your KMS key + if supplied. If the role that you specify doesn't have the appropriate + permissions, your request fails. + + IAM role ARNs have the format + `arn:partition:iam::account:role/role-name-with-path`. For example: + `arn:aws:iam::111122223333:role/Admin`. + + For more information, see [Amazon Web Services + HealthScribe](https://docs.aws.amazon.com/transcribe/latest/dg/health-scribe-streaming.html). + """ + channel_definitions: list[MedicalScribeChannelDefinition] | None = ... + """Specify which speaker is on which audio channel.""" + encryption_settings: MedicalScribeEncryptionSettings | None = ... + """Specify the encryption settings for your streaming session.""" + post_stream_analytics_settings: MedicalScribePostStreamAnalyticsSettings + """Specify settings for post-stream analytics.""" + medical_scribe_context: MedicalScribeContext | None = ... + """ + The `MedicalScribeContext` object that contains contextual information + used to generate customized clinical notes. + """ + +@dataclass(kw_only=True) +class MedicalScribeContext(_SerdeShape): + """ + The `MedicalScribeContext` object that contains contextual information + which is used during clinical note generation to add relevant context to + the note. + """ + + patient_context: MedicalScribePatientContext | None = ... + """ + Contains patient-specific information used to customize the clinical + note generation. + """ + +@dataclass(kw_only=True) +class MedicalScribeEncryptionSettings(_SerdeShape): + """ + Contains encryption related settings to be used for data encryption with + Key Management Service, including KmsEncryptionContext and KmsKeyId. The + KmsKeyId is required, while KmsEncryptionContext is optional for + additional layer of security. + + By default, Amazon Web Services HealthScribe provides encryption at rest + to protect sensitive customer data using Amazon S3-managed keys. + HealthScribe uses the KMS key you specify as a second layer of + encryption. + + Your `ResourceAccessRoleArn` must permission to use your KMS key. For + more information, see [Data Encryption at rest for Amazon Web Services + HealthScribe](https://docs.aws.amazon.com/transcribe/latest/dg/health-scribe-encryption.html). + """ + + kms_encryption_context: dict[str, str] | None = ... + """ + A map of plain text, non-secret key:value pairs, known as encryption + context pairs, that provide an added layer of security for your data. + For more information, see [KMSencryption + context](https://docs.aws.amazon.com/transcribe/latest/dg/key-management.html#kms-context) + and [Asymmetric keys in + KMS](https://docs.aws.amazon.com/transcribe/latest/dg/symmetric-asymmetric.html) + . + """ + kms_key_id: str + """ + The ID of the KMS key you want to use for your streaming session. You + can specify its KMS key ID, key Amazon Resource Name (ARN), alias name, + or alias ARN. When using an alias name, prefix it with `"alias/"`. To + specify a KMS key in a different Amazon Web Services account, you must + use the key ARN or alias ARN. + + For example: + + - Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab + + - Key ARN: + arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab + + - Alias name: alias/ExampleAlias + + - Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias + + To get the key ID and key ARN for a KMS key, use the + [ListKeys](https://docs.aws.amazon.com/kms/latest/APIReference/API_ListKeys.html) + or + [DescribeKey](https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html) + KMS API operations. To get the alias name and alias ARN, use + [ListKeys](https://docs.aws.amazon.com/kms/latest/APIReference/API_ListAliases.html) + API operation. + """ + +@dataclass +class MedicalScribeInputStreamAudioEvent(_SerdeShape): + """ + A wrapper for your audio chunks + + For more information, see [Event stream + encoding](https://docs.aws.amazon.com/transcribe/latest/dg/event-stream.html). + """ + + value: MedicalScribeAudioEvent + +@dataclass +class MedicalScribeInputStreamSessionControlEvent(_SerdeShape): + """ + Specify the lifecycle of your streaming session, such as ending the + session. + """ + + value: MedicalScribeSessionControlEvent + +@dataclass +class MedicalScribeInputStreamConfigurationEvent(_SerdeShape): + """ + Specify additional streaming session configurations beyond those + provided in your initial start request headers. For example, specify + channel definitions, encryption settings, and post-stream analytics + settings. + + Whether you are starting a new session or resuming an existing session, + your first event must be a `MedicalScribeConfigurationEvent`. + """ + + value: MedicalScribeConfigurationEvent + +@dataclass +class MedicalScribeInputStreamUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +MedicalScribeInputStream = Union[ + MedicalScribeInputStreamAudioEvent + | MedicalScribeInputStreamSessionControlEvent + | MedicalScribeInputStreamConfigurationEvent + | MedicalScribeInputStreamUnknown +] +""" +An encoded stream of events. The stream is encoded as HTTP/2 data +frames. + +An input stream consists of the following types of events. The first +element of the input stream must be the +`MedicalScribeConfigurationEvent` event type. + +- `MedicalScribeConfigurationEvent` + +- `MedicalScribeAudioEvent` + +- `MedicalScribeSessionControlEvent` +""" + +class _MedicalScribeInputStreamDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> MedicalScribeInputStream: ... + +class MedicalScribeLanguageCode(UnknownEnumMixin, StrEnum): + EN_US = "en-US" + +class MedicalScribeMediaEncoding(UnknownEnumMixin, StrEnum): + PCM = "pcm" + OGG_OPUS = "ogg-opus" + FLAC = "flac" + +class MedicalScribeNoteTemplate(UnknownEnumMixin, StrEnum): + HISTORY_AND_PHYSICAL = "HISTORY_AND_PHYSICAL" + GIRPP = "GIRPP" + DAP = "DAP" + SIRP = "SIRP" + BIRP = "BIRP" + BEHAVIORAL_SOAP = "BEHAVIORAL_SOAP" + PHYSICAL_SOAP = "PHYSICAL_SOAP" + +class MedicalScribeParticipantRole(UnknownEnumMixin, StrEnum): + PATIENT = "PATIENT" + CLINICIAN = "CLINICIAN" + +@dataclass(kw_only=True) +class MedicalScribePatientContext(_SerdeShape): + """Contains patient-specific information.""" + + pronouns: str | None = ... + """ + The patient's preferred pronouns that the user wants to provide as a + context for clinical note generation . + """ + +@dataclass(kw_only=True) +class MedicalScribePostStreamAnalyticsResult(_SerdeShape): + """Contains details for the result of post-stream analytics.""" + + clinical_note_generation_result: ClinicalNoteGenerationResult | None = ... + """Provides the Clinical Note Generation result for post-stream analytics.""" + +@dataclass(kw_only=True) +class MedicalScribePostStreamAnalyticsSettings(_SerdeShape): + """The settings for post-stream analytics.""" + + clinical_note_generation_settings: ClinicalNoteGenerationSettings + """Specify settings for the post-stream clinical note generation.""" + +@dataclass +class MedicalScribeResultStreamTranscriptEvent(_SerdeShape): + """The transcript event that contains real-time transcription results.""" + + value: MedicalScribeTranscriptEvent + +@dataclass +class MedicalScribeResultStreamBadRequestException(_SerdeShape): + """ + One or more arguments to the `StartStreamTranscription`, + `StartMedicalStreamTranscription`, or + `StartCallAnalyticsStreamTranscription` operation was not valid. For + example, `MediaEncoding` or `LanguageCode` used unsupported values. + Check the specified parameters and try your request again. + """ + + value: BadRequestException + +@dataclass +class MedicalScribeResultStreamLimitExceededException(_SerdeShape): + """ + Your client has exceeded one of the Amazon Transcribe limits, typically + the concurrent stream service quota. This error can also occur if a + stream exceeds the maximum session duration. In rare cases, this error + can also occur if you increase your number of concurrent streams too + quickly. Reduce your number of concurrent streams and try your request + again using an exponential backoff strategy. + """ + + value: LimitExceededException + +@dataclass +class MedicalScribeResultStreamInternalFailureException(_SerdeShape): + """ + A problem occurred while processing the audio. Amazon Transcribe + terminated processing. + """ + + value: InternalFailureException + +@dataclass +class MedicalScribeResultStreamConflictException(_SerdeShape): + """ + A new stream started with the same session ID. The current stream has + been terminated. + """ + + value: ConflictException + +@dataclass +class MedicalScribeResultStreamServiceUnavailableException(_SerdeShape): + """The service is currently unavailable. Try your request later.""" + + value: ServiceUnavailableException + +@dataclass +class MedicalScribeResultStreamUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +MedicalScribeResultStream = Union[ + MedicalScribeResultStreamTranscriptEvent + | MedicalScribeResultStreamBadRequestException + | MedicalScribeResultStreamLimitExceededException + | MedicalScribeResultStreamInternalFailureException + | MedicalScribeResultStreamConflictException + | MedicalScribeResultStreamServiceUnavailableException + | MedicalScribeResultStreamUnknown +] +""" +Result stream where you will receive the output events. The details are +provided in the `MedicalScribeTranscriptEvent` object. +""" + +class _MedicalScribeResultStreamDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> MedicalScribeResultStream: ... + +@dataclass(kw_only=True) +class MedicalScribeSessionControlEvent(_SerdeShape): + """Specify the lifecycle of your streaming session.""" + + type: str + """ + The type of `MedicalScribeSessionControlEvent`. + + Possible Values: + + - `END_OF_SESSION` - Indicates the audio streaming is complete. After + you send an END_OF_SESSION event, Amazon Web Services HealthScribe + starts the post-stream analytics. The session can't be resumed after + this event is sent. After Amazon Web Services HealthScribe processes + the event, the real-time `StreamStatus` is `COMPLETED`. You get the + `StreamStatus` and other stream details with the + [GetMedicalScribeStream](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_streaming_GetMedicalScribeStream.html) + API operation. For more information about different streaming + statuses, see the `StreamStatus` description in the + [MedicalScribeStreamDetails](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_streaming_MedicalScribeStreamDetails.html). + """ + +class MedicalScribeSessionControlEventType(UnknownEnumMixin, StrEnum): + END_OF_SESSION = "END_OF_SESSION" + +@dataclass(kw_only=True) +class MedicalScribeStreamDetails(_SerdeShape): + """ + Contains details about a Amazon Web Services HealthScribe streaming + session. + """ + + session_id: str | None = ... + """The identifier of the HealthScribe streaming session.""" + stream_created_at: datetime | None = ... + """The date and time when the HealthScribe streaming session was created.""" + stream_ended_at: datetime | None = ... + """The date and time when the HealthScribe streaming session was ended.""" + language_code: str | None = ... + """The Language Code of the HealthScribe streaming session.""" + media_sample_rate_hertz: int | None = ... + """The sample rate (in hertz) of the HealthScribe streaming session.""" + media_encoding: str | None = ... + """The Media Encoding of the HealthScribe streaming session.""" + vocabulary_name: str | None = ... + """The vocabulary name of the HealthScribe streaming session.""" + vocabulary_filter_name: str | None = ... + """ + The name of the vocabulary filter used for the HealthScribe streaming + session . + """ + vocabulary_filter_method: str | None = ... + """ + The method of the vocabulary filter for the HealthScribe streaming + session. + """ + resource_access_role_arn: str | None = ... + """ + The Amazon Resource Name (ARN) of the role used in the HealthScribe + streaming session. + """ + channel_definitions: list[MedicalScribeChannelDefinition] | None = ... + """The Channel Definitions of the HealthScribe streaming session.""" + encryption_settings: MedicalScribeEncryptionSettings | None = ... + """The Encryption Settings of the HealthScribe streaming session.""" + stream_status: str | None = ... + """ + The streaming status of the HealthScribe streaming session. + + Possible Values: + + - `IN_PROGRESS` + + - `PAUSED` + + - `FAILED` + + - `COMPLETED` + + Note: + This status is specific to real-time streaming. A `COMPLETED` status + doesn't mean that the post-stream analytics is complete. To get status + of an analytics result, check the `Status` field for the analytics + result within the `MedicalScribePostStreamAnalyticsResult`. For example, + you can view the status of the `ClinicalNoteGenerationResult`. + """ + post_stream_analytics_settings: ( + MedicalScribePostStreamAnalyticsSettings | None + ) = ... + """ + The post-stream analytics settings of the HealthScribe streaming + session. + """ + post_stream_analytics_result: MedicalScribePostStreamAnalyticsResult | None = ... + """ + The result of post-stream analytics for the HealthScribe streaming + session. + """ + medical_scribe_context_provided: bool | None = ... + """ + Indicates whether the `MedicalScribeContext` object was provided when + the stream was started. + """ + +class MedicalScribeStreamStatus(UnknownEnumMixin, StrEnum): + IN_PROGRESS = "IN_PROGRESS" + PAUSED = "PAUSED" + FAILED = "FAILED" + COMPLETED = "COMPLETED" + +@dataclass(kw_only=True) +class MedicalScribeTranscriptEvent(_SerdeShape): + """ + The event associated with `MedicalScribeResultStream`. + + Contains `MedicalScribeTranscriptSegment`, which contains segment + related information. + """ + + transcript_segment: MedicalScribeTranscriptSegment | None = ... + """ + The `TranscriptSegment` associated with a + `MedicalScribeTranscriptEvent`. + """ + +@dataclass(kw_only=True) +class MedicalScribeTranscriptItem(_SerdeShape): + """ + A word, phrase, or punctuation mark in your transcription output, along + with various associated attributes, such as confidence score, type, and + start and end times. + """ + + begin_audio_time: float = ... + """The start time, in milliseconds, of the transcribed item.""" + end_audio_time: float = ... + """The end time, in milliseconds, of the transcribed item.""" + type: str | None = ... + """ + The type of item identified. Options are: `PRONUNCIATION` (spoken words) + and `PUNCTUATION`. + """ + confidence: float | None = ... + """ + The confidence score associated with a word or phrase in your + transcript. + + Confidence scores are values between 0 and 1. A larger value indicates a + higher probability that the identified item correctly matches the item + spoken in your media. + """ + content: str | None = ... + """The word, phrase or punctuation mark that was transcribed.""" + vocabulary_filter_match: bool | None = ... + """ + Indicates whether the specified item matches a word in the vocabulary + filter included in your configuration event. If `true`, there is a + vocabulary filter match. + """ + +class MedicalScribeTranscriptItemType(UnknownEnumMixin, StrEnum): + PRONUNCIATION = "pronunciation" + PUNCTUATION = "punctuation" + +@dataclass(kw_only=True) +class MedicalScribeTranscriptSegment(_SerdeShape): + """ + Contains a set of transcription results, along with additional + information of the segment. + """ + + segment_id: str | None = ... + """The identifier of the segment.""" + begin_audio_time: float = ... + """The start time, in milliseconds, of the segment.""" + end_audio_time: float = ... + """The end time, in milliseconds, of the segment.""" + content: str | None = ... + """Contains transcribed text of the segment.""" + items: list[MedicalScribeTranscriptItem] | None = ... + """Contains words, phrases, or punctuation marks in your segment.""" + is_partial: bool = ... + """ + Indicates if the segment is complete. + + If `IsPartial` is `true`, the segment is not complete. If `IsPartial` is + `false`, the segment is complete. + """ + channel_id: str | None = ... + """ + Indicates which audio channel is associated with the + `MedicalScribeTranscriptSegment`. + + If `MedicalScribeChannelDefinition` is not provided in the + `MedicalScribeConfigurationEvent`, then this field will not be included. + """ + +class MedicalScribeVocabularyFilterMethod(UnknownEnumMixin, StrEnum): + REMOVE = "remove" + MASK = "mask" + TAG = "tag" + +@dataclass(kw_only=True) +class MedicalTranscript(_SerdeShape): + """ + The `MedicalTranscript` associated with a . + + `MedicalTranscript` contains `Results`, which contains a set of + transcription results from one or more audio segments, along with + additional information per your request parameters. + """ + + results: list[MedicalResult] | None = ... + """ + Contains a set of transcription results from one or more audio segments, + along with additional information per your request parameters. This can + include information relating to alternative transcriptions, channel + identification, partial result stabilization, language identification, + and other transcription-related data. + """ + +@dataclass(kw_only=True) +class MedicalTranscriptEvent(_SerdeShape): + """ + The `MedicalTranscriptEvent` associated with a + `MedicalTranscriptResultStream`. + + Contains a set of transcription results from one or more audio segments, + along with additional information per your request parameters. + """ + + transcript: MedicalTranscript | None = ... + """ + Contains `Results`, which contains a set of transcription results from + one or more audio segments, along with additional information per your + request parameters. This can include information relating to alternative + transcriptions, channel identification, partial result stabilization, + language identification, and other transcription-related data. + """ + +@dataclass +class MedicalTranscriptResultStreamTranscriptEvent(_SerdeShape): + """ + The `MedicalTranscriptEvent` associated with a + `MedicalTranscriptResultStream`. + + Contains a set of transcription results from one or more audio segments, + along with additional information per your request parameters. This can + include information relating to alternative transcriptions, channel + identification, partial result stabilization, language identification, + and other transcription-related data. + """ + + value: MedicalTranscriptEvent + +@dataclass +class MedicalTranscriptResultStreamBadRequestException(_SerdeShape): + """ + One or more arguments to the `StartStreamTranscription`, + `StartMedicalStreamTranscription`, or + `StartCallAnalyticsStreamTranscription` operation was not valid. For + example, `MediaEncoding` or `LanguageCode` used unsupported values. + Check the specified parameters and try your request again. + """ + + value: BadRequestException + +@dataclass +class MedicalTranscriptResultStreamLimitExceededException(_SerdeShape): + """ + Your client has exceeded one of the Amazon Transcribe limits, typically + the concurrent stream service quota. This error can also occur if a + stream exceeds the maximum session duration. In rare cases, this error + can also occur if you increase your number of concurrent streams too + quickly. Reduce your number of concurrent streams and try your request + again using an exponential backoff strategy. + """ + + value: LimitExceededException + +@dataclass +class MedicalTranscriptResultStreamInternalFailureException(_SerdeShape): + """ + A problem occurred while processing the audio. Amazon Transcribe + terminated processing. + """ + + value: InternalFailureException + +@dataclass +class MedicalTranscriptResultStreamConflictException(_SerdeShape): + """ + A new stream started with the same session ID. The current stream has + been terminated. + """ + + value: ConflictException + +@dataclass +class MedicalTranscriptResultStreamServiceUnavailableException(_SerdeShape): + """The service is currently unavailable. Try your request later.""" + + value: ServiceUnavailableException + +@dataclass +class MedicalTranscriptResultStreamUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +MedicalTranscriptResultStream = Union[ + MedicalTranscriptResultStreamTranscriptEvent + | MedicalTranscriptResultStreamBadRequestException + | MedicalTranscriptResultStreamLimitExceededException + | MedicalTranscriptResultStreamInternalFailureException + | MedicalTranscriptResultStreamConflictException + | MedicalTranscriptResultStreamServiceUnavailableException + | MedicalTranscriptResultStreamUnknown +] +"""Contains detailed information about your streaming session.""" + +class _MedicalTranscriptResultStreamDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> MedicalTranscriptResultStream: ... + +class PartialResultsStability(UnknownEnumMixin, StrEnum): + HIGH = "high" + MEDIUM = "medium" + LOW = "low" + +class ParticipantRole(UnknownEnumMixin, StrEnum): + AGENT = "AGENT" + CUSTOMER = "CUSTOMER" + +@dataclass(kw_only=True) +class PointsOfInterest(_SerdeShape): + """Contains the timestamps of matched categories.""" + + timestamp_ranges: list[TimestampRange] | None = ... + """ + Contains the timestamp ranges (start time through end time) of matched + categories and rules. + """ + +@dataclass(kw_only=True) +class PostCallAnalyticsSettings(_SerdeShape): + """ + Allows you to specify additional settings for your Call Analytics + post-call request, including output locations for your redacted + transcript, which IAM role to use, and which encryption key to use. + + `DataAccessRoleArn` and `OutputLocation` are required fields. + + `PostCallAnalyticsSettings` provides you with the same insights as a + Call Analytics post-call transcription. Refer to [Post-call + analytics](https://docs.aws.amazon.com/transcribe/latest/dg/tca-post-call.html) + for more information on this feature. + """ + + output_location: str + """ + The Amazon S3 location where you want your Call Analytics post-call + transcription output stored. You can use any of the following formats to + specify the output location: + + 1. s3://DOC-EXAMPLE-BUCKET + + 2. s3://DOC-EXAMPLE-BUCKET/my-output-folder/ + + 3. s3://DOC-EXAMPLE-BUCKET/my-output-folder/my-call-analytics-job.json + """ + data_access_role_arn: str + """ + The Amazon Resource Name (ARN) of an IAM role that has permissions to + access the Amazon S3 bucket that contains your input files. If the role + that you specify doesn't have the appropriate permissions to access the + specified Amazon S3 location, your request fails. + + IAM role ARNs have the format + `arn:partition:iam::account:role/role-name-with-path`. For example: + `arn:aws:iam::111122223333:role/Admin`. For more information, see [IAM + ARNs](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-arns). + """ + content_redaction_output: str | None = ... + """ + Specify whether you want only a redacted transcript or both a redacted + and an unredacted transcript. If you choose redacted and unredacted, two + JSON files are generated and stored in the Amazon S3 output location you + specify. + + Note that to include `ContentRedactionOutput` in your request, you must + enable content redaction (`ContentRedactionType`). + """ + output_encryption_kms_key_id: str | None = ... + """ + The KMS key you want to use to encrypt your Call Analytics post-call + output. + + If using a key located in the **current** Amazon Web Services account, + you can specify your KMS key in one of four ways: + + 1. Use the KMS key ID itself. For example, + `1234abcd-12ab-34cd-56ef-1234567890ab`. + + 2. Use an alias for the KMS key ID. For example, `alias/ExampleAlias`. + + 3. Use the Amazon Resource Name (ARN) for the KMS key ID. For example, + `arn:aws:kms:region:account-ID:key/1234abcd-12ab-34cd-56ef-1234567890ab`. + + 4. Use the ARN for the KMS key alias. For example, + `arn:aws:kms:region:account-ID:alias/ExampleAlias`. + + If using a key located in a **different** Amazon Web Services account + than the current Amazon Web Services account, you can specify your KMS + key in one of two ways: + + 1. Use the ARN for the KMS key ID. For example, + `arn:aws:kms:region:account-ID:key/1234abcd-12ab-34cd-56ef-1234567890ab`. + + 2. Use the ARN for the KMS key alias. For example, + `arn:aws:kms:region:account-ID:alias/ExampleAlias`. + + Note that the role making the request must have permission to use the + specified KMS key. + """ + +class Pronouns(UnknownEnumMixin, StrEnum): + HE_HIM = "HE_HIM" + SHE_HER = "SHE_HER" + THEY_THEM = "THEY_THEM" + +@dataclass(kw_only=True) +class ResourceNotFoundException(ServiceError, _SerdeShape): + """The request references a resource which doesn't exist.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class Result(_SerdeShape): + """ + The `Result` associated with a . + + Contains a set of transcription results from one or more audio segments, + along with additional information per your request parameters. This can + include information relating to alternative transcriptions, channel + identification, partial result stabilization, language identification, + and other transcription-related data. + """ + + result_id: str | None = ... + """Provides a unique identifier for the `Result`.""" + start_time: float = ... + """ + The start time of the `Result` in seconds, with millisecond precision + (e.g., 1.056). + """ + end_time: float = ... + """ + The end time of the `Result` in seconds, with millisecond precision + (e.g., 1.056). + """ + is_partial: bool = ... + """ + Indicates if the segment is complete. + + If `IsPartial` is `true`, the segment is not complete. If `IsPartial` is + `false`, the segment is complete. + """ + alternatives: list[Alternative] | None = ... + """ + A list of possible alternative transcriptions for the input audio. Each + alternative may contain one or more of `Items`, `Entities`, or + `Transcript`. + """ + channel_id: str | None = ... + """Indicates which audio channel is associated with the `Result`.""" + language_code: str | None = ... + """ + The language code that represents the language spoken in your audio + stream. + """ + language_identification: list[LanguageWithScore] | None = ... + """ + The language code of the dominant language identified in your stream. + + If you enabled channel identification and each channel of your audio + contains a different language, you may have more than one result. + """ + +class Sentiment(UnknownEnumMixin, StrEnum): + POSITIVE = "POSITIVE" + NEGATIVE = "NEGATIVE" + MIXED = "MIXED" + NEUTRAL = "NEUTRAL" + +@dataclass(kw_only=True) +class ServiceUnavailableException(ServiceError, _SerdeShape): + """The service is currently unavailable. Try your request later.""" + + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +class Specialty(UnknownEnumMixin, StrEnum): + PRIMARYCARE = "PRIMARYCARE" + CARDIOLOGY = "CARDIOLOGY" + NEUROLOGY = "NEUROLOGY" + ONCOLOGY = "ONCOLOGY" + RADIOLOGY = "RADIOLOGY" + UROLOGY = "UROLOGY" + +@dataclass(kw_only=True) +class StartCallAnalyticsStreamTranscriptionInput(_SerdeShape): + """Dataclass for StartCallAnalyticsStreamTranscriptionInput structure.""" + + language_code: str | None = ... + """ + Specify the language code that represents the language spoken in your + audio. + + For a list of languages supported with real-time Call Analytics, refer + to the [Supported + languages](https://docs.aws.amazon.com/transcribe/latest/dg/supported-languages.html) + table. + """ + media_sample_rate_hertz: int | None = ... + """ + The sample rate of the input audio (in hertz). Low-quality audio, such + as telephone audio, is typically around 8,000 Hz. High-quality audio + typically ranges from 16,000 Hz to 48,000 Hz. Note that the sample rate + you specify must match that of your audio. + """ + media_encoding: str | None = ... + """ + Specify the encoding of your input audio. Supported formats are: + + - FLAC + + - OPUS-encoded audio in an Ogg container + + - PCM (only signed 16-bit little-endian audio formats, which does not + include WAV) + + For more information, see [Media + formats](https://docs.aws.amazon.com/transcribe/latest/dg/how-input.html#how-input-audio). + """ + vocabulary_name: str | None = ... + """ + Specify the name of the custom vocabulary that you want to use when + processing your transcription. Note that vocabulary names are case + sensitive. + + If the language of the specified custom vocabulary doesn't match the + language identified in your media, the custom vocabulary is not applied + to your transcription. + + For more information, see [Custom + vocabularies](https://docs.aws.amazon.com/transcribe/latest/dg/custom-vocabulary.html). + """ + session_id: str | None = ... + """ + Specify a name for your Call Analytics transcription session. If you + don't include this parameter in your request, Amazon Transcribe + generates an ID and returns it in the response. + """ + vocabulary_filter_name: str | None = ... + """ + Specify the name of the custom vocabulary filter that you want to use + when processing your transcription. Note that vocabulary filter names + are case sensitive. + + If the language of the specified custom vocabulary filter doesn't match + the language identified in your media, the vocabulary filter is not + applied to your transcription. + + For more information, see [Using vocabulary filtering with unwanted + words](https://docs.aws.amazon.com/transcribe/latest/dg/vocabulary-filtering.html). + """ + vocabulary_filter_method: str | None = ... + """ + Specify how you want your vocabulary filter applied to your transcript. + + To replace words with `***`, choose `mask`. + + To delete words, choose `remove`. + + To flag words without changing them, choose `tag`. + """ + language_model_name: str | None = ... + """ + Specify the name of the custom language model that you want to use when + processing your transcription. Note that language model names are case + sensitive. + + The language of the specified language model must match the language + code you specify in your transcription request. If the languages don't + match, the custom language model isn't applied. There are no errors or + warnings associated with a language mismatch. + + For more information, see [Custom language + models](https://docs.aws.amazon.com/transcribe/latest/dg/custom-language-models.html). + """ + identify_language: bool = ... + """ + Enables automatic language identification for your Call Analytics + transcription. + + If you include `IdentifyLanguage`, you must include a list of language + codes, using `LanguageOptions`, that you think may be present in your + audio stream. You must provide a minimum of two language selections. + + You can also include a preferred language using `PreferredLanguage`. + Adding a preferred language can help Amazon Transcribe identify the + language faster than if you omit this parameter. + + Note that you must include either `LanguageCode` or `IdentifyLanguage` + in your request. If you include both parameters, your transcription job + fails. + """ + language_options: str | None = ... + """ + Specify two or more language codes that represent the languages you + think may be present in your media. + + Including language options can improve the accuracy of language + identification. + + If you include `LanguageOptions` in your request, you must also include + `IdentifyLanguage`. + + For a list of languages supported with Call Analytics streaming, refer + to the [Supported + languages](https://docs.aws.amazon.com/transcribe/latest/dg/supported-languages.html) + table. + + Warning: + You can only include one language dialect per language per stream. For + example, you cannot include `en-US` and `en-AU` in the same request. + """ + preferred_language: str | None = ... + """ + Specify a preferred language from the subset of languages codes you + specified in `LanguageOptions`. + + You can only use this parameter if you've included `IdentifyLanguage` + and `LanguageOptions` in your request. + """ + vocabulary_names: str | None = ... + """ + Specify the names of the custom vocabularies that you want to use when + processing your Call Analytics transcription. Note that vocabulary names + are case sensitive. + + If the custom vocabulary's language doesn't match the identified media + language, it won't be applied to the transcription. + + Warning: + This parameter is only intended for use **with** the `IdentifyLanguage` + parameter. If you're **not** including `IdentifyLanguage` in your + request and want to use a custom vocabulary with your transcription, use + the `VocabularyName` parameter instead. + + For more information, see [Custom + vocabularies](https://docs.aws.amazon.com/transcribe/latest/dg/custom-vocabulary.html). + """ + vocabulary_filter_names: str | None = ... + """ + Specify the names of the custom vocabulary filters that you want to use + when processing your Call Analytics transcription. Note that vocabulary + filter names are case sensitive. + + These filters serve to customize the transcript output. + + Warning: + This parameter is only intended for use **with** the `IdentifyLanguage` + parameter. If you're **not** including `IdentifyLanguage` in your + request and want to use a custom vocabulary filter with your + transcription, use the `VocabularyFilterName` parameter instead. + + For more information, see [Using vocabulary filtering with unwanted + words](https://docs.aws.amazon.com/transcribe/latest/dg/vocabulary-filtering.html). + """ + enable_partial_results_stabilization: bool = ... + """ + Enables partial result stabilization for your transcription. Partial + result stabilization can reduce latency in your output, but may impact + accuracy. For more information, see [Partial-result + stabilization](https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html#streaming-partial-result-stabilization). + """ + partial_results_stability: str | None = ... + """ + Specify the level of stability to use when you enable partial results + stabilization (`EnablePartialResultsStabilization`). + + Low stability provides the highest accuracy. High stability transcribes + faster, but with slightly lower accuracy. + + For more information, see [Partial-result + stabilization](https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html#streaming-partial-result-stabilization). + """ + content_identification_type: str | None = ... + """ + Labels all personally identifiable information (PII) identified in your + transcript. + + Content identification is performed at the segment level; PII specified + in `PiiEntityTypes` is flagged upon complete transcription of an audio + segment. If you don't include `PiiEntityTypes` in your request, all PII + is identified. + + You can't set `ContentIdentificationType` and `ContentRedactionType` in + the same request. If you set both, your request returns a + `BadRequestException`. + + For more information, see [Redacting or identifying personally + identifiable + information](https://docs.aws.amazon.com/transcribe/latest/dg/pii-redaction.html). + """ + content_redaction_type: str | None = ... + """ + Redacts all personally identifiable information (PII) identified in your + transcript. + + Content redaction is performed at the segment level; PII specified in + `PiiEntityTypes` is redacted upon complete transcription of an audio + segment. If you don't include `PiiEntityTypes` in your request, all PII + is redacted. + + You can't set `ContentRedactionType` and `ContentIdentificationType` in + the same request. If you set both, your request returns a + `BadRequestException`. + + For more information, see [Redacting or identifying personally + identifiable + information](https://docs.aws.amazon.com/transcribe/latest/dg/pii-redaction.html). + """ + pii_entity_types: str | None = ... + """ + Specify which types of personally identifiable information (PII) you + want to redact in your transcript. You can include as many types as + you'd like, or you can select `ALL`. + + Values must be comma-separated and can include: `ADDRESS`, + `BANK_ACCOUNT_NUMBER`, `BANK_ROUTING`, `CREDIT_DEBIT_CVV`, + `CREDIT_DEBIT_EXPIRY`, `CREDIT_DEBIT_NUMBER`, `EMAIL`, `NAME`, `PHONE`, + `PIN`, `SSN`, or `ALL`. + + Note that if you include `PiiEntityTypes` in your request, you must also + include `ContentIdentificationType` or `ContentRedactionType`. + + If you include `ContentRedactionType` or `ContentIdentificationType` in + your request, but do not include `PiiEntityTypes`, all PII is redacted + or identified. + """ + +@dataclass(kw_only=True) +class StartCallAnalyticsStreamTranscriptionOutput(_SerdeShape): + """Dataclass for StartCallAnalyticsStreamTranscriptionOutput structure.""" + + request_id: str | None = ... + """Provides the identifier for your real-time Call Analytics request.""" + language_code: str | None = ... + """ + Provides the language code that you specified in your Call Analytics + request. + """ + media_sample_rate_hertz: int | None = ... + """ + Provides the sample rate that you specified in your Call Analytics + request. + """ + media_encoding: str | None = ... + """ + Provides the media encoding you specified in your Call Analytics + request. + """ + vocabulary_name: str | None = ... + """ + Provides the name of the custom vocabulary that you specified in your + Call Analytics request. + """ + session_id: str | None = ... + """Provides the identifier for your Call Analytics transcription session.""" + vocabulary_filter_name: str | None = ... + """ + Provides the name of the custom vocabulary filter that you specified in + your Call Analytics request. + """ + vocabulary_filter_method: str | None = ... + """ + Provides the vocabulary filtering method used in your Call Analytics + transcription. + """ + language_model_name: str | None = ... + """ + Provides the name of the custom language model that you specified in + your Call Analytics request. + """ + identify_language: bool = ... + """ + Shows whether automatic language identification was enabled for your + Call Analytics transcription. + """ + language_options: str | None = ... + """ + Provides the language codes that you specified in your Call Analytics + request. + """ + preferred_language: str | None = ... + """ + Provides the preferred language that you specified in your Call + Analytics request. + """ + vocabulary_names: str | None = ... + """ + Provides the names of the custom vocabularies that you specified in your + Call Analytics request. + """ + vocabulary_filter_names: str | None = ... + """ + Provides the names of the custom vocabulary filters that you specified + in your Call Analytics request. + """ + enable_partial_results_stabilization: bool = ... + """ + Shows whether partial results stabilization was enabled for your Call + Analytics transcription. + """ + partial_results_stability: str | None = ... + """Provides the stabilization level used for your transcription.""" + content_identification_type: str | None = ... + """ + Shows whether content identification was enabled for your Call Analytics + transcription. + """ + content_redaction_type: str | None = ... + """ + Shows whether content redaction was enabled for your Call Analytics + transcription. + """ + pii_entity_types: str | None = ... + """Lists the PII entity types you specified in your Call Analytics request.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class StartMedicalScribeStreamInput(_SerdeShape): + """Dataclass for StartMedicalScribeStreamInput structure.""" + + session_id: str | None = ... + """ + Specify an identifier for your streaming session (in UUID format). If + you don't include a SessionId in your request, Amazon Web Services + HealthScribe generates an ID and returns it in the response. + """ + language_code: str | None = ... + """Specify the language code for your HealthScribe streaming session.""" + media_sample_rate_hertz: int | None = ... + """ + Specify the sample rate of the input audio (in hertz). Amazon Web + Services HealthScribe supports a range from 16,000 Hz to 48,000 Hz. The + sample rate you specify must match that of your audio. + """ + media_encoding: str | None = ... + """ + Specify the encoding used for the input audio. + + Supported formats are: + + - FLAC + + - OPUS-encoded audio in an Ogg container + + - PCM (only signed 16-bit little-endian audio formats, which does not + include WAV) + + For more information, see [Media + formats](https://docs.aws.amazon.com/transcribe/latest/dg/how-input.html#how-input-audio). + """ + +@dataclass(kw_only=True) +class StartMedicalScribeStreamOutput(_SerdeShape): + """Dataclass for StartMedicalScribeStreamOutput structure.""" + + session_id: str | None = ... + """ + The identifier (in UUID format) for your streaming session. + + If you already started streaming, this is same ID as the one you + specified in your initial `StartMedicalScribeStreamRequest`. + """ + request_id: str | None = ... + """The unique identifier for your streaming request.""" + language_code: str | None = ... + """ + The Language Code that you specified in your request. Same as provided + in the `StartMedicalScribeStreamRequest`. + """ + media_sample_rate_hertz: int | None = ... + """ + The sample rate (in hertz) that you specified in your request. Same as + provided in the `StartMedicalScribeStreamRequest` + """ + media_encoding: str | None = ... + """ + The Media Encoding you specified in your request. Same as provided in + the `StartMedicalScribeStreamRequest` + """ + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class StartMedicalStreamTranscriptionInput(_SerdeShape): + """Dataclass for StartMedicalStreamTranscriptionInput structure.""" + + language_code: str | None = ... + """ + Specify the language code that represents the language spoken in your + audio. + + Warning: + Amazon Transcribe Medical only supports US English (`en-US`). + """ + media_sample_rate_hertz: int | None = ... + """ + The sample rate of the input audio (in hertz). Amazon Transcribe Medical + supports a range from 16,000 Hz to 48,000 Hz. Note that the sample rate + you specify must match that of your audio. + """ + media_encoding: str | None = ... + """ + Specify the encoding used for the input audio. Supported formats are: + + - FLAC + + - OPUS-encoded audio in an Ogg container + + - PCM (only signed 16-bit little-endian audio formats, which does not + include WAV) + + For more information, see [Media + formats](https://docs.aws.amazon.com/transcribe/latest/dg/how-input.html#how-input-audio). + """ + vocabulary_name: str | None = ... + """ + Specify the name of the custom vocabulary that you want to use when + processing your transcription. Note that vocabulary names are case + sensitive. + """ + specialty: str | None = ... + """Specify the medical specialty contained in your audio.""" + type: str | None = ... + """ + Specify the type of input audio. For example, choose `DICTATION` for a + provider dictating patient notes and `CONVERSATION` for a dialogue + between a patient and a medical professional. + """ + show_speaker_label: bool = ... + """ + Enables speaker partitioning (diarization) in your transcription output. + Speaker partitioning labels the speech from individual speakers in your + media file. + + For more information, see [Partitioning speakers + (diarization)](https://docs.aws.amazon.com/transcribe/latest/dg/diarization.html). + """ + session_id: str | None = ... + """ + Specify a name for your transcription session. If you don't include + this parameter in your request, Amazon Transcribe Medical generates an + ID and returns it in the response. + """ + enable_channel_identification: bool = ... + """ + Enables channel identification in multi-channel audio. + + Channel identification transcribes the audio on each channel + independently, then appends the output for each channel into one + transcript. + + If you have multi-channel audio and do not enable channel + identification, your audio is transcribed in a continuous manner and + your transcript is not separated by channel. + + If you include `EnableChannelIdentification` in your request, you must + also include `NumberOfChannels`. + + For more information, see [Transcribing multi-channel + audio](https://docs.aws.amazon.com/transcribe/latest/dg/channel-id.html). + """ + number_of_channels: int | None = ... + """ + Specify the number of channels in your audio stream. This value must be + `2`, as only two channels are supported. If your audio doesn't contain + multiple channels, do not include this parameter in your request. + + If you include `NumberOfChannels` in your request, you must also include + `EnableChannelIdentification`. + """ + content_identification_type: str | None = ... + """ + Labels all personal health information (PHI) identified in your + transcript. + + Content identification is performed at the segment level; PHI is flagged + upon complete transcription of an audio segment. + + For more information, see [Identifying personal health information (PHI) + in a + transcription](https://docs.aws.amazon.com/transcribe/latest/dg/phi-id.html). + """ + +@dataclass(kw_only=True) +class StartMedicalStreamTranscriptionOutput(_SerdeShape): + """Dataclass for StartMedicalStreamTranscriptionOutput structure.""" + + request_id: str | None = ... + """Provides the identifier for your streaming request.""" + language_code: str | None = ... + """ + Provides the language code that you specified in your request. This must + be `en-US`. + """ + media_sample_rate_hertz: int | None = ... + """Provides the sample rate that you specified in your request.""" + media_encoding: str | None = ... + """Provides the media encoding you specified in your request.""" + vocabulary_name: str | None = ... + """ + Provides the name of the custom vocabulary that you specified in your + request. + """ + specialty: str | None = ... + """Provides the medical specialty that you specified in your request.""" + type: str | None = ... + """Provides the type of audio you specified in your request.""" + show_speaker_label: bool = ... + """Shows whether speaker partitioning was enabled for your transcription.""" + session_id: str | None = ... + """Provides the identifier for your transcription session.""" + enable_channel_identification: bool = ... + """Shows whether channel identification was enabled for your transcription.""" + number_of_channels: int | None = ... + """Provides the number of channels that you specified in your request.""" + content_identification_type: str | None = ... + """Shows whether content identification was enabled for your transcription.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class StartStreamTranscriptionInput(_SerdeShape): + """Dataclass for StartStreamTranscriptionInput structure.""" + + language_code: str | None = ... + """ + Specify the language code that represents the language spoken in your + audio. + + If you're unsure of the language spoken in your audio, consider using + `IdentifyLanguage` to enable automatic language identification. + + For a list of languages supported with Amazon Transcribe streaming, + refer to the [Supported + languages](https://docs.aws.amazon.com/transcribe/latest/dg/supported-languages.html) + table. + """ + media_sample_rate_hertz: int | None = ... + """ + The sample rate of the input audio (in hertz). Low-quality audio, such + as telephone audio, is typically around 8,000 Hz. High-quality audio + typically ranges from 16,000 Hz to 48,000 Hz. Note that the sample rate + you specify must match that of your audio. + """ + media_encoding: str | None = ... + """ + Specify the encoding of your input audio. Supported formats are: + + - FLAC + + - OPUS-encoded audio in an Ogg container + + - PCM (only signed 16-bit little-endian audio formats, which does not + include WAV) + + For more information, see [Media + formats](https://docs.aws.amazon.com/transcribe/latest/dg/how-input.html#how-input-audio). + """ + vocabulary_name: str | None = ... + """ + Specify the name of the custom vocabulary that you want to use when + processing your transcription. Note that vocabulary names are case + sensitive. + + If the language of the specified custom vocabulary doesn't match the + language identified in your media, the custom vocabulary is not applied + to your transcription. + + Warning: + This parameter is **not** intended for use with the `IdentifyLanguage` + parameter. If you're including `IdentifyLanguage` in your request and + want to use one or more custom vocabularies with your transcription, use + the `VocabularyNames` parameter instead. + + For more information, see [Custom + vocabularies](https://docs.aws.amazon.com/transcribe/latest/dg/custom-vocabulary.html). + """ + session_id: str | None = ... + """ + Specify a name for your transcription session. If you don't include + this parameter in your request, Amazon Transcribe generates an ID and + returns it in the response. + """ + vocabulary_filter_name: str | None = ... + """ + Specify the name of the custom vocabulary filter that you want to use + when processing your transcription. Note that vocabulary filter names + are case sensitive. + + If the language of the specified custom vocabulary filter doesn't match + the language identified in your media, the vocabulary filter is not + applied to your transcription. + + Warning: + This parameter is **not** intended for use with the `IdentifyLanguage` + parameter. If you're including `IdentifyLanguage` in your request and + want to use one or more vocabulary filters with your transcription, use + the `VocabularyFilterNames` parameter instead. + + For more information, see [Using vocabulary filtering with unwanted + words](https://docs.aws.amazon.com/transcribe/latest/dg/vocabulary-filtering.html). + """ + vocabulary_filter_method: str | None = ... + """ + Specify how you want your vocabulary filter applied to your transcript. + + To replace words with `***`, choose `mask`. + + To delete words, choose `remove`. + + To flag words without changing them, choose `tag`. + """ + show_speaker_label: bool = ... + """ + Enables speaker partitioning (diarization) in your transcription output. + Speaker partitioning labels the speech from individual speakers in your + media file. + + For more information, see [Partitioning speakers + (diarization)](https://docs.aws.amazon.com/transcribe/latest/dg/diarization.html). + """ + enable_channel_identification: bool = ... + """ + Enables channel identification in multi-channel audio. + + Channel identification transcribes the audio on each channel + independently, then appends the output for each channel into one + transcript. + + If you have multi-channel audio and do not enable channel + identification, your audio is transcribed in a continuous manner and + your transcript is not separated by channel. + + If you include `EnableChannelIdentification` in your request, you must + also include `NumberOfChannels`. + + For more information, see [Transcribing multi-channel + audio](https://docs.aws.amazon.com/transcribe/latest/dg/channel-id.html). + """ + number_of_channels: int | None = ... + """ + Specify the number of channels in your audio stream. This value must be + `2`, as only two channels are supported. If your audio doesn't contain + multiple channels, do not include this parameter in your request. + + If you include `NumberOfChannels` in your request, you must also include + `EnableChannelIdentification`. + """ + enable_partial_results_stabilization: bool = ... + """ + Enables partial result stabilization for your transcription. Partial + result stabilization can reduce latency in your output, but may impact + accuracy. For more information, see [Partial-result + stabilization](https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html#streaming-partial-result-stabilization). + """ + partial_results_stability: str | None = ... + """ + Specify the level of stability to use when you enable partial results + stabilization (`EnablePartialResultsStabilization`). + + Low stability provides the highest accuracy. High stability transcribes + faster, but with slightly lower accuracy. + + For more information, see [Partial-result + stabilization](https://docs.aws.amazon.com/transcribe/latest/dg/streaming.html#streaming-partial-result-stabilization). + """ + content_identification_type: str | None = ... + """ + Labels all personally identifiable information (PII) identified in your + transcript. + + Content identification is performed at the segment level; PII specified + in `PiiEntityTypes` is flagged upon complete transcription of an audio + segment. If you don't include `PiiEntityTypes` in your request, all PII + is identified. + + You can't set `ContentIdentificationType` and `ContentRedactionType` in + the same request. If you set both, your request returns a + `BadRequestException`. + + For more information, see [Redacting or identifying personally + identifiable + information](https://docs.aws.amazon.com/transcribe/latest/dg/pii-redaction.html). + """ + content_redaction_type: str | None = ... + """ + Redacts all personally identifiable information (PII) identified in your + transcript. + + Content redaction is performed at the segment level; PII specified in + `PiiEntityTypes` is redacted upon complete transcription of an audio + segment. If you don't include `PiiEntityTypes` in your request, all PII + is redacted. + + You can't set `ContentRedactionType` and `ContentIdentificationType` in + the same request. If you set both, your request returns a + `BadRequestException`. + + For more information, see [Redacting or identifying personally + identifiable + information](https://docs.aws.amazon.com/transcribe/latest/dg/pii-redaction.html). + """ + pii_entity_types: str | None = ... + """ + Specify which types of personally identifiable information (PII) you + want to redact in your transcript. You can include as many types as + you'd like, or you can select `ALL`. + + Values must be comma-separated and can include: `ADDRESS`, + `BANK_ACCOUNT_NUMBER`, `BANK_ROUTING`, `CREDIT_DEBIT_CVV`, + `CREDIT_DEBIT_EXPIRY`, `CREDIT_DEBIT_NUMBER`, `EMAIL`, `NAME`, `PHONE`, + `PIN`, `SSN`, `AGE`, `DATE_TIME`, `LICENSE_PLATE`, `PASSPORT_NUMBER`, + `PASSWORD`, `USERNAME`, `VEHICLE_IDENTIFICATION_NUMBER`, or `ALL`. + + Note that if you include `PiiEntityTypes` in your request, you must also + include `ContentIdentificationType` or `ContentRedactionType`. + + If you include `ContentRedactionType` or `ContentIdentificationType` in + your request, but do not include `PiiEntityTypes`, all PII is redacted + or identified. + """ + language_model_name: str | None = ... + """ + Specify the name of the custom language model that you want to use when + processing your transcription. Note that language model names are case + sensitive. + + The language of the specified language model must match the language + code you specify in your transcription request. If the languages don't + match, the custom language model isn't applied. There are no errors or + warnings associated with a language mismatch. + + For more information, see [Custom language + models](https://docs.aws.amazon.com/transcribe/latest/dg/custom-language-models.html). + """ + identify_language: bool = ... + """ + Enables automatic language identification for your transcription. + + If you include `IdentifyLanguage`, you must include a list of language + codes, using `LanguageOptions`, that you think may be present in your + audio stream. + + You can also include a preferred language using `PreferredLanguage`. + Adding a preferred language can help Amazon Transcribe identify the + language faster than if you omit this parameter. + + If you have multi-channel audio that contains different languages on + each channel, and you've enabled channel identification, automatic + language identification identifies the dominant language on each audio + channel. + + Note that you must include either `LanguageCode` or `IdentifyLanguage` + or `IdentifyMultipleLanguages` in your request. If you include more than + one of these parameters, your transcription job fails. + + Streaming language identification can't be combined with custom + language models or redaction. + """ + language_options: str | None = ... + """ + Specify two or more language codes that represent the languages you + think may be present in your media; including more than five is not + recommended. + + Including language options can improve the accuracy of language + identification. + + If you include `LanguageOptions` in your request, you must also include + `IdentifyLanguage` or `IdentifyMultipleLanguages`. + + For a list of languages supported with Amazon Transcribe streaming, + refer to the [Supported + languages](https://docs.aws.amazon.com/transcribe/latest/dg/supported-languages.html) + table. + + Warning: + You can only include one language dialect per language per stream. For + example, you cannot include `en-US` and `en-AU` in the same request. + """ + preferred_language: str | None = ... + """ + Specify a preferred language from the subset of languages codes you + specified in `LanguageOptions`. + + You can only use this parameter if you've included `IdentifyLanguage` + and `LanguageOptions` in your request. + """ + identify_multiple_languages: bool = ... + """ + Enables automatic multi-language identification in your transcription + job request. Use this parameter if your stream contains more than one + language. If your stream contains only one language, use + IdentifyLanguage instead. + + If you include `IdentifyMultipleLanguages`, you must include a list of + language codes, using `LanguageOptions`, that you think may be present + in your stream. + + If you want to apply a custom vocabulary or a custom vocabulary filter + to your automatic multiple language identification request, include + `VocabularyNames` or `VocabularyFilterNames`. + + Note that you must include one of `LanguageCode`, `IdentifyLanguage`, or + `IdentifyMultipleLanguages` in your request. If you include more than + one of these parameters, your transcription job fails. + """ + vocabulary_names: str | None = ... + """ + Specify the names of the custom vocabularies that you want to use when + processing your transcription. Note that vocabulary names are case + sensitive. + + If none of the languages of the specified custom vocabularies match the + language identified in your media, your job fails. + + Warning: + This parameter is only intended for use **with** the `IdentifyLanguage` + parameter. If you're **not** including `IdentifyLanguage` in your + request and want to use a custom vocabulary with your transcription, use + the `VocabularyName` parameter instead. + + For more information, see [Custom + vocabularies](https://docs.aws.amazon.com/transcribe/latest/dg/custom-vocabulary.html). + """ + vocabulary_filter_names: str | None = ... + """ + Specify the names of the custom vocabulary filters that you want to use + when processing your transcription. Note that vocabulary filter names + are case sensitive. + + If none of the languages of the specified custom vocabulary filters + match the language identified in your media, your job fails. + + Warning: + This parameter is only intended for use **with** the `IdentifyLanguage` + parameter. If you're **not** including `IdentifyLanguage` in your + request and want to use a custom vocabulary filter with your + transcription, use the `VocabularyFilterName` parameter instead. + + For more information, see [Using vocabulary filtering with unwanted + words](https://docs.aws.amazon.com/transcribe/latest/dg/vocabulary-filtering.html). + """ + session_resume_window: int | None = ... + """ + Specify the time window, in minutes, during which your transcription + session can be resumed, measured from the stream start time. This + optional parameter accepts integer values from 1 to 300 (5 hours). + + For example, if your stream starts at 1 PM and you specify a + `SessionResumeWindow` of 30 minutes, you can reconnect to the session as + many times as you want until 1:30 PM. + """ + transcript_format: str | None = ... + """ + Specify how numbers, dates, and other alphanumeric entities are rendered + in your transcription results. + + - `WRITTEN` renders these entities in their standard written form (for + example, `$50`, `10:30 AM`, and `101`). + + - `SPOKEN` renders these entities as words, exactly as they were spoken + (for example, `fifty dollars`, `ten thirty a m`, and `one oh one`). + + If you don't specify a value, Amazon Transcribe uses `WRITTEN` by + default. + """ + +@dataclass(kw_only=True) +class StartStreamTranscriptionOutput(_SerdeShape): + """Dataclass for StartStreamTranscriptionOutput structure.""" + + request_id: str | None = ... + """Provides the identifier for your streaming request.""" + language_code: str | None = ... + """Provides the language code that you specified in your request.""" + media_sample_rate_hertz: int | None = ... + """Provides the sample rate that you specified in your request.""" + media_encoding: str | None = ... + """Provides the media encoding you specified in your request.""" + vocabulary_name: str | None = ... + """ + Provides the name of the custom vocabulary that you specified in your + request. + """ + session_id: str | None = ... + """Provides the identifier for your transcription session.""" + vocabulary_filter_name: str | None = ... + """ + Provides the name of the custom vocabulary filter that you specified in + your request. + """ + vocabulary_filter_method: str | None = ... + """Provides the vocabulary filtering method used in your transcription.""" + show_speaker_label: bool = ... + """Shows whether speaker partitioning was enabled for your transcription.""" + enable_channel_identification: bool = ... + """Shows whether channel identification was enabled for your transcription.""" + number_of_channels: int | None = ... + """Provides the number of channels that you specified in your request.""" + enable_partial_results_stabilization: bool = ... + """ + Shows whether partial results stabilization was enabled for your + transcription. + """ + partial_results_stability: str | None = ... + """Provides the stabilization level used for your transcription.""" + content_identification_type: str | None = ... + """Shows whether content identification was enabled for your transcription.""" + content_redaction_type: str | None = ... + """Shows whether content redaction was enabled for your transcription.""" + pii_entity_types: str | None = ... + """Lists the PII entity types you specified in your request.""" + language_model_name: str | None = ... + """ + Provides the name of the custom language model that you specified in + your request. + """ + identify_language: bool = ... + """ + Shows whether automatic language identification was enabled for your + transcription. + """ + language_options: str | None = ... + """Provides the language codes that you specified in your request.""" + preferred_language: str | None = ... + """Provides the preferred language that you specified in your request.""" + identify_multiple_languages: bool = ... + """ + Shows whether automatic multi-language identification was enabled for + your transcription. + """ + vocabulary_names: str | None = ... + """ + Provides the names of the custom vocabularies that you specified in your + request. + """ + vocabulary_filter_names: str | None = ... + """ + Provides the names of the custom vocabulary filters that you specified + in your request. + """ + session_resume_window: int | None = ... + """ + Provides the session resume window, in minutes, that you specified in + your request. + """ + transcript_format: str | None = ... + """Provides the transcript format that you specified in your request.""" + response_metadata: ResponseMetadata = ... + """ + Metadata about the response that produced this output. Use this to + recover the request identifiers a service's support team needs in order + to investigate a call. Members of the metadata are individually + optional. + """ + +@dataclass(kw_only=True) +class TimestampRange(_SerdeShape): + """ + Contains the timestamp range (start time through end time) of a matched + category. + """ + + begin_offset_millis: int | None = ... + """ + The time, in milliseconds, from the beginning of the audio stream to the + start of the category match. + """ + end_offset_millis: int | None = ... + """ + The time, in milliseconds, from the beginning of the audio stream to the + end of the category match. + """ + +@dataclass(kw_only=True) +class Transcript(_SerdeShape): + """ + The `Transcript` associated with a . + + `Transcript` contains `Results`, which contains a set of transcription + results from one or more audio segments, along with additional + information per your request parameters. + """ + + results: list[Result] | None = ... + """ + Contains a set of transcription results from one or more audio segments, + along with additional information per your request parameters. This can + include information relating to alternative transcriptions, channel + identification, partial result stabilization, language identification, + and other transcription-related data. + """ + +@dataclass(kw_only=True) +class TranscriptEvent(_SerdeShape): + """ + The `TranscriptEvent` associated with a `TranscriptResultStream`. + + Contains a set of transcription results from one or more audio segments, + along with additional information per your request parameters. + """ + + transcript: Transcript | None = ... + """ + Contains `Results`, which contains a set of transcription results from + one or more audio segments, along with additional information per your + request parameters. This can include information relating to alternative + transcriptions, channel identification, partial result stabilization, + language identification, and other transcription-related data. + """ + +class TranscriptFormat(UnknownEnumMixin, StrEnum): + SPOKEN = "spoken" + WRITTEN = "written" + +@dataclass +class TranscriptResultStreamTranscriptEvent(_SerdeShape): + """ + Contains `Transcript`, which contains `Results`. The object contains a + set of transcription results from one or more audio segments, along with + additional information per your request parameters. + """ + + value: TranscriptEvent + +@dataclass +class TranscriptResultStreamBadRequestException(_SerdeShape): + """ + A client error occurred when the stream was created. Check the + parameters of the request and try your request again. + """ + + value: BadRequestException + +@dataclass +class TranscriptResultStreamLimitExceededException(_SerdeShape): + """ + Your client has exceeded one of the Amazon Transcribe limits, typically + the concurrent stream service quota. This error can also occur if a + stream exceeds the maximum session duration. In rare cases, this error + can also occur if you increase your number of concurrent streams too + quickly. Reduce your number of concurrent streams and try your request + again using an exponential backoff strategy. + """ + + value: LimitExceededException + +@dataclass +class TranscriptResultStreamInternalFailureException(_SerdeShape): + """ + A problem occurred while processing the audio. Amazon Transcribe + terminated processing. + """ + + value: InternalFailureException + +@dataclass +class TranscriptResultStreamConflictException(_SerdeShape): + """ + A new stream started with the same session ID. The current stream has + been terminated. + """ + + value: ConflictException + +@dataclass +class TranscriptResultStreamServiceUnavailableException(_SerdeShape): + """The service is currently unavailable. Try your request later.""" + + value: ServiceUnavailableException + +@dataclass +class TranscriptResultStreamUnknown(_SerdeShape): + """ + Represents an unknown variant. If you receive this value, you will need + to update your library to receive the parsed value. This value may not + be deliberately sent. + """ + + tag: str + +TranscriptResultStream = Union[ + TranscriptResultStreamTranscriptEvent + | TranscriptResultStreamBadRequestException + | TranscriptResultStreamLimitExceededException + | TranscriptResultStreamInternalFailureException + | TranscriptResultStreamConflictException + | TranscriptResultStreamServiceUnavailableException + | TranscriptResultStreamUnknown +] +"""Contains detailed information about your streaming session.""" + +class _TranscriptResultStreamDeserializer: + def deserialize( + self, deserializer: ShapeDeserializer + ) -> TranscriptResultStream: ... + +class Type(UnknownEnumMixin, StrEnum): + CONVERSATION = "CONVERSATION" + DICTATION = "DICTATION" + +@dataclass(kw_only=True) +class UtteranceEvent(_SerdeShape): + """ + Contains set of transcription results from one or more audio segments, + along with additional information about the parameters included in your + request. For example, channel definitions, partial result stabilization, + sentiment, and issue detection. + """ + + utterance_id: str | None = ... + """ + The unique identifier that is associated with the specified + `UtteranceEvent`. + """ + is_partial: bool = ... + """ + Indicates whether the segment in the `UtteranceEvent` is complete + (`FALSE`) or partial (`TRUE`). + """ + participant_role: str | None = ... + """ + Provides the role of the speaker for each audio channel, either + `CUSTOMER` or `AGENT`. + """ + begin_offset_millis: int | None = ... + """ + The time, in milliseconds, from the beginning of the audio stream to the + start of the `UtteranceEvent`. + """ + end_offset_millis: int | None = ... + """ + The time, in milliseconds, from the beginning of the audio stream to the + start of the `UtteranceEvent`. + """ + transcript: str | None = ... + """Contains transcribed text.""" + items: list[CallAnalyticsItem] | None = ... + """ + Contains words, phrases, or punctuation marks that are associated with + the specified `UtteranceEvent`. + """ + entities: list[CallAnalyticsEntity] | None = ... + """ + Contains entities identified as personally identifiable information + (PII) in your transcription output. + """ + sentiment: str | None = ... + """Provides the sentiment that was detected in the specified segment.""" + issues_detected: list[IssueDetected] | None = ... + """Provides the issue that was detected in the specified segment.""" + language_code: str | None = ... + """ + The language code that represents the language spoken in your audio + stream. + """ + language_identification: list[CallAnalyticsLanguageWithScore] | None = ... + """The language code of the dominant language identified in your stream.""" + +class VocabularyFilterMethod(UnknownEnumMixin, StrEnum): + REMOVE = "remove" + MASK = "mask" + TAG = "tag" + +GET_MEDICAL_SCRIBE_STREAM: APIOperation[ + GetMedicalScribeStreamInput, GetMedicalScribeStreamOutput +] +START_CALL_ANALYTICS_STREAM_TRANSCRIPTION: APIOperation[ + StartCallAnalyticsStreamTranscriptionInput, + StartCallAnalyticsStreamTranscriptionOutput, +] +START_MEDICAL_SCRIBE_STREAM: APIOperation[ + StartMedicalScribeStreamInput, StartMedicalScribeStreamOutput +] +START_MEDICAL_STREAM_TRANSCRIPTION: APIOperation[ + StartMedicalStreamTranscriptionInput, StartMedicalStreamTranscriptionOutput +] +START_STREAM_TRANSCRIPTION: APIOperation[ + StartStreamTranscriptionInput, StartStreamTranscriptionOutput +] diff --git a/clients/aws-sdk-transcribe-streaming/tests/integration/__init__.py b/clients/aws-sdk-transcribe-streaming/tests/integration/__init__.py index 95848a4e..8f50ff18 100644 --- a/clients/aws-sdk-transcribe-streaming/tests/integration/__init__.py +++ b/clients/aws-sdk-transcribe-streaming/tests/integration/__init__.py @@ -3,9 +3,9 @@ from pathlib import Path -from smithy_aws_core.config import AwsConfigOverrides -from smithy_aws_core.identity import EnvironmentCredentialsResolver -from smithy_http.aio.interfaces import HTTPClient +from smithy_aws_core.aio.config import AwsConfigOverrides +from smithy_aws_core.aio.identity import AsyncEnvironmentCredentialsResolver +from smithy_http.aio.interfaces import AsyncHTTPClient from aws_sdk_transcribe_streaming.client import AsyncTranscribeStreamingClient from aws_sdk_transcribe_streaming.config import AsyncTranscribeStreamingConfig @@ -14,13 +14,13 @@ async def create_transcribe_client( - region: str, *, transport: HTTPClient | None = None + region: str, *, transport: AsyncHTTPClient | None = None ) -> AsyncTranscribeStreamingClient: """Helper to create an AsyncTranscribeStreamingClient for a given region.""" overrides: AwsConfigOverrides = { "endpoint_uri": f"https://transcribestreaming.{region}.amazonaws.com", "region": region, - "aws_credentials_identity_resolver": EnvironmentCredentialsResolver(), + "aws_credentials_identity_resolver": AsyncEnvironmentCredentialsResolver(), } if transport is not None: overrides["transport"] = transport diff --git a/clients/aws-sdk-transcribe-streaming/tests/integration/conftest.py b/clients/aws-sdk-transcribe-streaming/tests/integration/conftest.py index b771dc1e..c55518ac 100644 --- a/clients/aws-sdk-transcribe-streaming/tests/integration/conftest.py +++ b/clients/aws-sdk-transcribe-streaming/tests/integration/conftest.py @@ -140,9 +140,9 @@ def healthscribe_resources(): role_name = f"integ-test-transcribe-streaming-role-{unique_suffix}" bucket_name = f"integ-test-transcribe-streaming-bucket-{unique_suffix}" - iam_client = boto3.client("iam") - s3_client = boto3.client("s3", region_name=REGION) - sts_client = boto3.client("sts") + iam_client = boto3.client("iam") # pyright: ignore[reportUnknownMemberType] + s3_client = boto3.client("s3", region_name=REGION) # pyright: ignore[reportUnknownMemberType] + sts_client = boto3.client("sts") # pyright: ignore[reportUnknownMemberType] try: role_arn = _create_healthscribe_resources( diff --git a/clients/aws-sdk-transcribe-streaming/tests/integration/test_bidirectional_streaming.py b/clients/aws-sdk-transcribe-streaming/tests/integration/test_bidirectional_streaming.py index 4b8e7e2b..8d237ba6 100644 --- a/clients/aws-sdk-transcribe-streaming/tests/integration/test_bidirectional_streaming.py +++ b/clients/aws-sdk-transcribe-streaming/tests/integration/test_bidirectional_streaming.py @@ -6,7 +6,7 @@ import asyncio import time -from smithy_core.aio.eventstream import DuplexEventStream +from smithy_core.aio.eventstream import AsyncDuplexEventStream from smithy_http.aio.crt import AWSCRTHTTPClient from aws_sdk_transcribe_streaming.models import ( @@ -30,7 +30,7 @@ async def _send_audio_chunks( - stream: DuplexEventStream[ + stream: AsyncDuplexEventStream[ AudioStream, TranscriptResultStream, StartStreamTranscriptionOutput ], ) -> None: @@ -53,7 +53,7 @@ async def _send_audio_chunks( async def _receive_transcription_output( - stream: DuplexEventStream[ + stream: AsyncDuplexEventStream[ AudioStream, TranscriptResultStream, StartStreamTranscriptionOutput ], ) -> tuple[bool, list[str]]: diff --git a/packages/aws-credentials-http/.changes/next-release/aws-credentials-http-breaking-a9562a726ae64d78bdd06d9c9deb5930.json b/packages/aws-credentials-http/.changes/next-release/aws-credentials-http-breaking-a9562a726ae64d78bdd06d9c9deb5930.json new file mode 100644 index 00000000..d2762b24 --- /dev/null +++ b/packages/aws-credentials-http/.changes/next-release/aws-credentials-http-breaking-a9562a726ae64d78bdd06d9c9deb5930.json @@ -0,0 +1,4 @@ +{ + "type": "breaking", + "description": "Moved the async implementations to `aws_credentials_http.aio`: `ContainerCredentialsResolver` and `EcsContainerProvider`. Update imports to the `aio` paths." +} \ No newline at end of file diff --git a/packages/aws-credentials-http/README.md b/packages/aws-credentials-http/README.md index 452fe496..10f82eb6 100644 --- a/packages/aws-credentials-http/README.md +++ b/packages/aws-credentials-http/README.md @@ -21,7 +21,7 @@ property on a service client's config to a `ContainerCredentialsResolver` instance: ```python -from aws_credentials_http import ContainerCredentialsResolver +from aws_credentials_http.aio import ContainerCredentialsResolver service_client = ServiceClient( config=ServiceClientConfig( @@ -37,7 +37,7 @@ The resolver can also be used on its own to fetch credentials directly: ```python import asyncio -from aws_credentials_http import ContainerCredentialsResolver +from aws_credentials_http.aio import ContainerCredentialsResolver async def main() -> None: diff --git a/packages/aws-credentials-http/pyproject.toml b/packages/aws-credentials-http/pyproject.toml index 330025bb..1158ea78 100644 --- a/packages/aws-credentials-http/pyproject.toml +++ b/packages/aws-credentials-http/pyproject.toml @@ -36,8 +36,14 @@ dependencies = [ "Code" = "https://github.com/aws/aws-sdk-python/tree/develop/packages/aws-credentials-http/" "Issue tracker" = "https://github.com/aws/aws-sdk-python/issues" -[project.entry-points."smithy_aws_core.identity.chain_providers"] -EcsContainer = "aws_credentials_http.providers:EcsContainerProvider" +[project.entry-points."smithy_aws_core.aio.identity.chain_providers"] +EcsContainer = "aws_credentials_http.aio.providers:EcsContainerProvider" + +[dependency-groups] +test = [ + "pytest>=9.0.1,<10.0.0", + "pytest-asyncio>=1.3.0,<1.4.0" +] [build-system] requires = ["hatchling"] @@ -53,3 +59,7 @@ exclude = [ [tool.ruff] src = ["src"] + +[tool.pytest.ini_options] +python_classes = ["!Test"] +asyncio_mode = "auto" diff --git a/packages/aws-credentials-http/src/aws_credentials_http/__init__.py b/packages/aws-credentials-http/src/aws_credentials_http/__init__.py index 5938000a..971a2546 100644 --- a/packages/aws-credentials-http/src/aws_credentials_http/__init__.py +++ b/packages/aws-credentials-http/src/aws_credentials_http/__init__.py @@ -1,11 +1,3 @@ # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 __version__ = "0.4.0" - -from .providers import EcsContainerProvider -from .resolvers import ContainerCredentialsResolver - -__all__ = ( - "ContainerCredentialsResolver", - "EcsContainerProvider", -) diff --git a/packages/aws-credentials-http/src/aws_credentials_http/aio/__init__.py b/packages/aws-credentials-http/src/aws_credentials_http/aio/__init__.py new file mode 100644 index 00000000..3cdb9607 --- /dev/null +++ b/packages/aws-credentials-http/src/aws_credentials_http/aio/__init__.py @@ -0,0 +1,9 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 +from .providers import EcsContainerProvider +from .resolvers import ContainerCredentialsResolver + +__all__ = ( + "ContainerCredentialsResolver", + "EcsContainerProvider", +) diff --git a/packages/aws-credentials-http/src/aws_credentials_http/client.py b/packages/aws-credentials-http/src/aws_credentials_http/aio/client.py similarity index 97% rename from packages/aws-credentials-http/src/aws_credentials_http/client.py rename to packages/aws-credentials-http/src/aws_credentials_http/aio/client.py index 92a0e459..9e676da8 100644 --- a/packages/aws-credentials-http/src/aws_credentials_http/client.py +++ b/packages/aws-credentials-http/src/aws_credentials_http/aio/client.py @@ -8,7 +8,7 @@ from smithy_core.exceptions import SmithyIdentityError from smithy_http import Field, Fields from smithy_http.aio import HTTPRequest -from smithy_http.aio.interfaces import HTTPClient, HTTPResponse +from smithy_http.aio.interfaces import AsyncHTTPClient, HTTPResponse from smithy_http.interfaces import HTTPRequestConfiguration _CONTAINER_METADATA_IP = "169.254.170.2" @@ -28,7 +28,7 @@ class HttpCredentialsClient: def __init__( self, - http_client: HTTPClient, + http_client: AsyncHTTPClient, *, timeout: int = _DEFAULT_TIMEOUT, retries: int = _DEFAULT_RETRIES, diff --git a/packages/aws-credentials-http/src/aws_credentials_http/providers.py b/packages/aws-credentials-http/src/aws_credentials_http/aio/providers.py similarity index 95% rename from packages/aws-credentials-http/src/aws_credentials_http/providers.py rename to packages/aws-credentials-http/src/aws_credentials_http/aio/providers.py index 45bb2342..d2c1ddc3 100644 --- a/packages/aws-credentials-http/src/aws_credentials_http/providers.py +++ b/packages/aws-credentials-http/src/aws_credentials_http/aio/providers.py @@ -4,7 +4,7 @@ from smithy_aws_core.identity import AWSCredentialsIdentity from smithy_aws_core.identity.chain import Standard, StandardProvider -from smithy_aws_core.identity.chain.provider import ChainSetup +from smithy_aws_core.aio.identity.chain.provider import ChainSetup from smithy_core.interfaces.identity import Identity from .resolvers import ContainerCredentialsResolver diff --git a/packages/aws-credentials-http/src/aws_credentials_http/resolvers.py b/packages/aws-credentials-http/src/aws_credentials_http/aio/resolvers.py similarity index 95% rename from packages/aws-credentials-http/src/aws_credentials_http/resolvers.py rename to packages/aws-credentials-http/src/aws_credentials_http/aio/resolvers.py index 0dd3f8a9..816cb112 100644 --- a/packages/aws-credentials-http/src/aws_credentials_http/resolvers.py +++ b/packages/aws-credentials-http/src/aws_credentials_http/aio/resolvers.py @@ -7,11 +7,11 @@ from smithy_aws_core.identity import AWSCredentialsIdentity, AWSIdentityProperties from smithy_core import URI -from smithy_core.aio.interfaces.identity import IdentityResolver +from smithy_core.aio.interfaces.identity import AsyncIdentityResolver from smithy_core.exceptions import SmithyIdentityError from smithy_http import Field, Fields from smithy_http.aio.aiohttp import AIOHTTPClient -from smithy_http.aio.interfaces import HTTPClient +from smithy_http.aio.interfaces import AsyncHTTPClient from .client import HttpCredentialsClient @@ -21,7 +21,7 @@ class ContainerCredentialsResolver( - IdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] + AsyncIdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] ): """Resolves AWS credentials from container HTTP endpoints.""" @@ -32,7 +32,7 @@ class ContainerCredentialsResolver( def __init__( self, - http_client: HTTPClient | None = None, + http_client: AsyncHTTPClient | None = None, *, timeout: int = _DEFAULT_TIMEOUT, retries: int = _DEFAULT_RETRIES, diff --git a/packages/aws-credentials-http/tests/unit/__init__.py b/packages/aws-credentials-http/tests/unit/__init__.py new file mode 100644 index 00000000..04f8b7b7 --- /dev/null +++ b/packages/aws-credentials-http/tests/unit/__init__.py @@ -0,0 +1,2 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/packages/aws-credentials-http/tests/unit/aio/__init__.py b/packages/aws-credentials-http/tests/unit/aio/__init__.py new file mode 100644 index 00000000..04f8b7b7 --- /dev/null +++ b/packages/aws-credentials-http/tests/unit/aio/__init__.py @@ -0,0 +1,2 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/packages/aws-credentials-http/tests/unit/test_client.py b/packages/aws-credentials-http/tests/unit/aio/test_client.py similarity index 96% rename from packages/aws-credentials-http/tests/unit/test_client.py rename to packages/aws-credentials-http/tests/unit/aio/test_client.py index 3de7d1b5..bbda2c38 100644 --- a/packages/aws-credentials-http/tests/unit/test_client.py +++ b/packages/aws-credentials-http/tests/unit/aio/test_client.py @@ -4,7 +4,7 @@ from unittest.mock import AsyncMock, patch import pytest -from aws_credentials_http.client import HttpCredentialsClient +from aws_credentials_http.aio.client import HttpCredentialsClient from smithy_core import URI from smithy_core.exceptions import SmithyIdentityError from smithy_http import Fields @@ -114,7 +114,7 @@ async def test_client_retries() -> None: http_client.send.side_effect = Exception() with patch( - "aws_credentials_http.client.asyncio.sleep", new_callable=AsyncMock + "aws_credentials_http.aio.client.asyncio.sleep", new_callable=AsyncMock ) as sleep: with pytest.raises(SmithyIdentityError): await client.get_credentials(uri, Fields()) diff --git a/packages/aws-credentials-http/tests/unit/test_providers.py b/packages/aws-credentials-http/tests/unit/aio/test_providers.py similarity index 95% rename from packages/aws-credentials-http/tests/unit/test_providers.py rename to packages/aws-credentials-http/tests/unit/aio/test_providers.py index 45315268..8aeb6b19 100644 --- a/packages/aws-credentials-http/tests/unit/test_providers.py +++ b/packages/aws-credentials-http/tests/unit/aio/test_providers.py @@ -5,10 +5,10 @@ from typing import Any import pytest -from aws_credentials_http import ContainerCredentialsResolver, EcsContainerProvider +from aws_credentials_http.aio import ContainerCredentialsResolver, EcsContainerProvider from smithy_aws_core.identity import AWSCredentialsIdentity from smithy_aws_core.identity.chain import Standard, StandardProvider -from smithy_aws_core.identity.chain.provider import ChainSetup +from smithy_aws_core.aio.identity.chain.provider import ChainSetup from smithy_core.interfaces.identity import Identity _RELATIVE_URI = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI" diff --git a/packages/aws-credentials-http/tests/unit/test_resolvers.py b/packages/aws-credentials-http/tests/unit/aio/test_resolvers.py similarity index 99% rename from packages/aws-credentials-http/tests/unit/test_resolvers.py rename to packages/aws-credentials-http/tests/unit/aio/test_resolvers.py index 292d4d47..3747baf9 100644 --- a/packages/aws-credentials-http/tests/unit/test_resolvers.py +++ b/packages/aws-credentials-http/tests/unit/aio/test_resolvers.py @@ -7,7 +7,7 @@ from unittest.mock import AsyncMock, patch import pytest -from aws_credentials_http import ContainerCredentialsResolver +from aws_credentials_http.aio import ContainerCredentialsResolver from smithy_aws_core.identity import AWSCredentialsIdentity from smithy_core import URI from smithy_core.exceptions import SmithyIdentityError diff --git a/packages/aws-credentials-imds/.changes/next-release/aws-credentials-imds-breaking-0571d5ffdf914f739c35123e288e4c2b.json b/packages/aws-credentials-imds/.changes/next-release/aws-credentials-imds-breaking-0571d5ffdf914f739c35123e288e4c2b.json new file mode 100644 index 00000000..b0a6cb8d --- /dev/null +++ b/packages/aws-credentials-imds/.changes/next-release/aws-credentials-imds-breaking-0571d5ffdf914f739c35123e288e4c2b.json @@ -0,0 +1,4 @@ +{ + "type": "breaking", + "description": "Moved the async implementations to `aws_credentials_imds.aio`: `IMDSCredentialsResolver`, `IMDSConfig` and `Ec2InstanceMetadataProvider`. `IMDSConfigurationError` remains in `aws_credentials_imds`. Update imports to the `aio` paths." +} \ No newline at end of file diff --git a/packages/aws-credentials-imds/README.md b/packages/aws-credentials-imds/README.md index 8e4df4e4..8e09b3cb 100644 --- a/packages/aws-credentials-imds/README.md +++ b/packages/aws-credentials-imds/README.md @@ -21,7 +21,7 @@ To use this resolver explicitly, set the `aws_credentials_identity_resolver` property on a service client's config to an `IMDSCredentialsResolver` instance: ```python -from aws_credentials_imds import IMDSCredentialsResolver +from aws_credentials_imds.aio import IMDSCredentialsResolver service_client = ServiceClient( config=ServiceClientConfig( @@ -34,7 +34,7 @@ Endpoint mode, token TTL, and other options can be customized through an `IMDSConfig`: ```python -from aws_credentials_imds import IMDSConfig, IMDSCredentialsResolver +from aws_credentials_imds.aio import IMDSConfig, IMDSCredentialsResolver resolver = IMDSCredentialsResolver( config=IMDSConfig(endpoint_mode="IPv6", token_ttl=300), @@ -48,7 +48,7 @@ The resolver can also be used on its own to fetch credentials directly: ```python import asyncio -from aws_credentials_imds import IMDSCredentialsResolver +from aws_credentials_imds.aio import IMDSCredentialsResolver async def main() -> None: diff --git a/packages/aws-credentials-imds/pyproject.toml b/packages/aws-credentials-imds/pyproject.toml index d5a7f6b9..2377f12f 100644 --- a/packages/aws-credentials-imds/pyproject.toml +++ b/packages/aws-credentials-imds/pyproject.toml @@ -36,8 +36,14 @@ dependencies = [ "Code" = "https://github.com/aws/aws-sdk-python/tree/develop/packages/aws-credentials-imds/" "Issue tracker" = "https://github.com/aws/aws-sdk-python/issues" -[project.entry-points."smithy_aws_core.identity.chain_providers"] -Ec2InstanceMetadata = "aws_credentials_imds.providers:Ec2InstanceMetadataProvider" +[project.entry-points."smithy_aws_core.aio.identity.chain_providers"] +Ec2InstanceMetadata = "aws_credentials_imds.aio.providers:Ec2InstanceMetadataProvider" + +[dependency-groups] +test = [ + "pytest>=9.0.1,<10.0.0", + "pytest-asyncio>=1.3.0,<1.4.0" +] [build-system] requires = ["hatchling"] @@ -53,3 +59,7 @@ exclude = [ [tool.ruff] src = ["src"] + +[tool.pytest.ini_options] +python_classes = ["!Test"] +asyncio_mode = "auto" diff --git a/packages/aws-credentials-imds/src/aws_credentials_imds/__init__.py b/packages/aws-credentials-imds/src/aws_credentials_imds/__init__.py index 4de340e3..0b83d780 100644 --- a/packages/aws-credentials-imds/src/aws_credentials_imds/__init__.py +++ b/packages/aws-credentials-imds/src/aws_credentials_imds/__init__.py @@ -2,13 +2,6 @@ # SPDX-License-Identifier: Apache-2.0 __version__ = "0.4.0" -from .client import IMDSConfig, IMDSConfigurationError -from .providers import Ec2InstanceMetadataProvider -from .resolvers import IMDSCredentialsResolver +from .client import IMDSConfigurationError -__all__ = ( - "Ec2InstanceMetadataProvider", - "IMDSConfig", - "IMDSConfigurationError", - "IMDSCredentialsResolver", -) +__all__ = ("IMDSConfigurationError",) diff --git a/packages/aws-credentials-imds/src/aws_credentials_imds/aio/__init__.py b/packages/aws-credentials-imds/src/aws_credentials_imds/aio/__init__.py new file mode 100644 index 00000000..7d6fddf4 --- /dev/null +++ b/packages/aws-credentials-imds/src/aws_credentials_imds/aio/__init__.py @@ -0,0 +1,11 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 +from .client import IMDSConfig +from .providers import Ec2InstanceMetadataProvider +from .resolvers import IMDSCredentialsResolver + +__all__ = ( + "Ec2InstanceMetadataProvider", + "IMDSConfig", + "IMDSCredentialsResolver", +) diff --git a/packages/aws-credentials-imds/src/aws_credentials_imds/aio/client.py b/packages/aws-credentials-imds/src/aws_credentials_imds/aio/client.py new file mode 100644 index 00000000..58c5306a --- /dev/null +++ b/packages/aws-credentials-imds/src/aws_credentials_imds/aio/client.py @@ -0,0 +1,166 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 +import asyncio +from dataclasses import dataclass +from types import MappingProxyType +from typing import Literal + +from smithy_core import URI +from smithy_core.aio.interfaces.retries import AsyncRetryStrategy +from smithy_core.aio.retries import AsyncSimpleRetryStrategy +from smithy_core.exceptions import SmithyIdentityError +from smithy_http import Field, Fields +from smithy_http.aio import HTTPRequest +from smithy_http.aio.interfaces import AsyncHTTPClient + +from .. import __version__ +from ..client import IMDSConfigurationError, IMDSToken + +_USER_AGENT_FIELD = Field( + name="User-Agent", + values=[f"aws-sdk-python-imds-client/{__version__}"], +) + + +@dataclass(init=False) +class IMDSConfig: + """Configuration for IMDSClient.""" + + _HOST_MAPPING = MappingProxyType( + {"IPv4": "169.254.169.254", "IPv6": "[fd00:ec2::254]"} + ) + _MIN_TTL = 5 + _MAX_TTL = 21600 + + retry_strategy: AsyncRetryStrategy + endpoint_uri: URI + endpoint_mode: Literal["IPv4", "IPv6"] + token_ttl: int + + def __init__( + self, + *, + retry_strategy: AsyncRetryStrategy | None = None, + endpoint_uri: URI | None = None, + endpoint_mode: Literal["IPv4", "IPv6"] = "IPv4", + token_ttl: int = _MAX_TTL, + ec2_instance_profile_name: str | None = None, + ): + # TODO: Implement IMDS request retries. + self.retry_strategy = retry_strategy or AsyncSimpleRetryStrategy(max_attempts=3) + self.endpoint_mode = endpoint_mode + self.endpoint_uri = self._resolve_endpoint(endpoint_uri, endpoint_mode) + self.token_ttl = self._validate_token_ttl(token_ttl) + self.ec2_instance_profile_name = ec2_instance_profile_name + + def _validate_token_ttl(self, ttl: int) -> int: + if not self._MIN_TTL <= ttl <= self._MAX_TTL: + raise IMDSConfigurationError( + f"Token TTL must be between {self._MIN_TTL} and {self._MAX_TTL} seconds." + ) + return ttl + + def _resolve_endpoint( + self, endpoint_uri: URI | None, endpoint_mode: Literal["IPv4", "IPv6"] + ) -> URI: + if endpoint_uri is not None: + return endpoint_uri + + return URI( + scheme="http", + host=self._HOST_MAPPING.get(endpoint_mode, self._HOST_MAPPING["IPv4"]), + port=80, + ) + + +class IMDSTokenCache: + """Holds and refreshes the token used to fetch instance metadata.""" + + _TOKEN_PATH = "/latest/api/token" # noqa: S105 + + def __init__(self, http_client: AsyncHTTPClient, config: IMDSConfig): + self._http_client = http_client + self._config = config + self._base_uri = config.endpoint_uri + self._refresh_lock = asyncio.Lock() + self._token = None + + def _should_refresh(self) -> bool: + return self._token is None or self._token.is_expired() + + async def _refresh(self) -> None: + async with self._refresh_lock: + if not self._should_refresh(): + return + headers = Fields( + [ + _USER_AGENT_FIELD, + Field( + name="x-aws-ec2-metadata-token-ttl-seconds", + values=[str(self._config.token_ttl)], + ), + ] + ) + request = HTTPRequest( + method="PUT", + destination=URI( + scheme=self._base_uri.scheme, + host=self._base_uri.host, + port=self._base_uri.port, + path=self._TOKEN_PATH, + ), + fields=headers, + ) + response = await self._http_client.send(request) + token_value = await response.consume_body_async() + if response.status != 200: + raise SmithyIdentityError( + f"IMDS returned {response.status} when fetching a metadata token." + ) + self._token = IMDSToken(token_value.decode("utf-8"), self._config.token_ttl) + + async def get_token(self) -> IMDSToken: + if self._should_refresh(): + await self._refresh() + assert self._token is not None # noqa: S101 + return self._token + + +class IMDSClient: + """Minimal asynchronous IMDSv2 client.""" + + def __init__(self, http_client: AsyncHTTPClient, config: IMDSConfig | None = None): + self._http_client = http_client + self._config = config or IMDSConfig() + self._token_cache = IMDSTokenCache( + http_client=self._http_client, config=self._config + ) + + async def get(self, *, path: str) -> str: + token = await self._token_cache.get_token() + headers = Fields( + [ + _USER_AGENT_FIELD, + Field( + name="x-aws-ec2-metadata-token", + values=[token.value], + ), + ] + ) + request = HTTPRequest( + method="GET", + destination=URI( + scheme=self._config.endpoint_uri.scheme, + host=self._config.endpoint_uri.host, + port=self._config.endpoint_uri.port, + path=path, + ), + fields=headers, + ) + response = await self._http_client.send(request=request) + body = await response.consume_body_async() + if response.status != 200: + raise SmithyIdentityError( + f"IMDS returned {response.status} for path '{path}'." + ) + return body.decode("utf-8") diff --git a/packages/aws-credentials-imds/src/aws_credentials_imds/providers.py b/packages/aws-credentials-imds/src/aws_credentials_imds/aio/providers.py similarity index 96% rename from packages/aws-credentials-imds/src/aws_credentials_imds/providers.py rename to packages/aws-credentials-imds/src/aws_credentials_imds/aio/providers.py index ef1b6d5a..0979bc88 100644 --- a/packages/aws-credentials-imds/src/aws_credentials_imds/providers.py +++ b/packages/aws-credentials-imds/src/aws_credentials_imds/aio/providers.py @@ -6,11 +6,12 @@ from smithy_aws_core.identity import AWSCredentialsIdentity from smithy_aws_core.identity.chain import Standard, StandardProvider -from smithy_aws_core.identity.chain.provider import ChainSetup +from smithy_aws_core.aio.identity.chain.provider import ChainSetup from smithy_core import URI from smithy_core.interfaces.identity import Identity -from .client import IMDSConfig, IMDSConfigurationError +from ..client import IMDSConfigurationError +from .client import IMDSConfig from .resolvers import IMDSCredentialsResolver _DISABLED_ENV = "AWS_EC2_METADATA_DISABLED" diff --git a/packages/aws-credentials-imds/src/aws_credentials_imds/resolvers.py b/packages/aws-credentials-imds/src/aws_credentials_imds/aio/resolvers.py similarity index 88% rename from packages/aws-credentials-imds/src/aws_credentials_imds/resolvers.py rename to packages/aws-credentials-imds/src/aws_credentials_imds/aio/resolvers.py index c98ca012..54821cfa 100644 --- a/packages/aws-credentials-imds/src/aws_credentials_imds/resolvers.py +++ b/packages/aws-credentials-imds/src/aws_credentials_imds/aio/resolvers.py @@ -4,23 +4,25 @@ from datetime import UTC, datetime from smithy_aws_core.identity import AWSCredentialsIdentity, AWSIdentityProperties -from smithy_core.aio.interfaces.identity import IdentityResolver +from smithy_core.aio.interfaces.identity import AsyncIdentityResolver from smithy_core.exceptions import SmithyIdentityError from smithy_http.aio.aiohttp import AIOHTTPClient -from smithy_http.aio.interfaces import HTTPClient +from smithy_http.aio.interfaces import AsyncHTTPClient from .client import IMDSClient, IMDSConfig class IMDSCredentialsResolver( - IdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] + AsyncIdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] ): """Resolves AWS credentials from the EC2 Instance Metadata Service.""" _METADATA_PATH_BASE = "/latest/meta-data/iam/security-credentials" def __init__( - self, http_client: HTTPClient | None = None, config: IMDSConfig | None = None + self, + http_client: AsyncHTTPClient | None = None, + config: IMDSConfig | None = None, ): self._http_client = http_client or AIOHTTPClient() self._imds_client = IMDSClient(http_client=self._http_client, config=config) diff --git a/packages/aws-credentials-imds/src/aws_credentials_imds/client.py b/packages/aws-credentials-imds/src/aws_credentials_imds/client.py index 9678a1b2..8e2a68a7 100644 --- a/packages/aws-credentials-imds/src/aws_credentials_imds/client.py +++ b/packages/aws-credentials-imds/src/aws_credentials_imds/client.py @@ -1,82 +1,14 @@ # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 -import asyncio -from dataclasses import dataclass from datetime import datetime, timedelta -from types import MappingProxyType -from typing import Literal -from smithy_core import URI -from smithy_core.aio.interfaces.retries import RetryStrategy -from smithy_core.aio.retries import SimpleRetryStrategy -from smithy_core.exceptions import SmithyError, SmithyIdentityError -from smithy_http import Field, Fields -from smithy_http.aio import HTTPRequest -from smithy_http.aio.interfaces import HTTPClient - -from . import __version__ - -_USER_AGENT_FIELD = Field( - name="User-Agent", - values=[f"aws-sdk-python-imds-client/{__version__}"], -) +from smithy_core.exceptions import SmithyError class IMDSConfigurationError(SmithyError): """Raised when IMDS credential configuration is invalid.""" -@dataclass(init=False) -class IMDSConfig: - """Configuration for IMDSClient.""" - - _HOST_MAPPING = MappingProxyType( - {"IPv4": "169.254.169.254", "IPv6": "[fd00:ec2::254]"} - ) - _MIN_TTL = 5 - _MAX_TTL = 21600 - - retry_strategy: RetryStrategy - endpoint_uri: URI - endpoint_mode: Literal["IPv4", "IPv6"] - token_ttl: int - - def __init__( - self, - *, - retry_strategy: RetryStrategy | None = None, - endpoint_uri: URI | None = None, - endpoint_mode: Literal["IPv4", "IPv6"] = "IPv4", - token_ttl: int = _MAX_TTL, - ec2_instance_profile_name: str | None = None, - ): - # TODO: Implement IMDS request retries. - self.retry_strategy = retry_strategy or SimpleRetryStrategy(max_attempts=3) - self.endpoint_mode = endpoint_mode - self.endpoint_uri = self._resolve_endpoint(endpoint_uri, endpoint_mode) - self.token_ttl = self._validate_token_ttl(token_ttl) - self.ec2_instance_profile_name = ec2_instance_profile_name - - def _validate_token_ttl(self, ttl: int) -> int: - if not self._MIN_TTL <= ttl <= self._MAX_TTL: - raise IMDSConfigurationError( - f"Token TTL must be between {self._MIN_TTL} and {self._MAX_TTL} seconds." - ) - return ttl - - def _resolve_endpoint( - self, endpoint_uri: URI | None, endpoint_mode: Literal["IPv4", "IPv6"] - ) -> URI: - if endpoint_uri is not None: - return endpoint_uri - - return URI( - scheme="http", - host=self._HOST_MAPPING.get(endpoint_mode, self._HOST_MAPPING["IPv4"]), - port=80, - ) - - class IMDSToken: """Represents an IMDSv2 session token.""" @@ -91,96 +23,3 @@ def is_expired(self) -> bool: @property def value(self) -> str: return self._value - - -class IMDSTokenCache: - """Holds and refreshes the token used to fetch instance metadata.""" - - _TOKEN_PATH = "/latest/api/token" # noqa: S105 - - def __init__(self, http_client: HTTPClient, config: IMDSConfig): - self._http_client = http_client - self._config = config - self._base_uri = config.endpoint_uri - self._refresh_lock = asyncio.Lock() - self._token = None - - def _should_refresh(self) -> bool: - return self._token is None or self._token.is_expired() - - async def _refresh(self) -> None: - async with self._refresh_lock: - if not self._should_refresh(): - return - headers = Fields( - [ - _USER_AGENT_FIELD, - Field( - name="x-aws-ec2-metadata-token-ttl-seconds", - values=[str(self._config.token_ttl)], - ), - ] - ) - request = HTTPRequest( - method="PUT", - destination=URI( - scheme=self._base_uri.scheme, - host=self._base_uri.host, - port=self._base_uri.port, - path=self._TOKEN_PATH, - ), - fields=headers, - ) - response = await self._http_client.send(request) - token_value = await response.consume_body_async() - if response.status != 200: - raise SmithyIdentityError( - f"IMDS returned {response.status} when fetching a metadata token." - ) - self._token = IMDSToken(token_value.decode("utf-8"), self._config.token_ttl) - - async def get_token(self) -> IMDSToken: - if self._should_refresh(): - await self._refresh() - assert self._token is not None # noqa: S101 - return self._token - - -class IMDSClient: - """Minimal asynchronous IMDSv2 client.""" - - def __init__(self, http_client: HTTPClient, config: IMDSConfig | None = None): - self._http_client = http_client - self._config = config or IMDSConfig() - self._token_cache = IMDSTokenCache( - http_client=self._http_client, config=self._config - ) - - async def get(self, *, path: str) -> str: - token = await self._token_cache.get_token() - headers = Fields( - [ - _USER_AGENT_FIELD, - Field( - name="x-aws-ec2-metadata-token", - values=[token.value], - ), - ] - ) - request = HTTPRequest( - method="GET", - destination=URI( - scheme=self._config.endpoint_uri.scheme, - host=self._config.endpoint_uri.host, - port=self._config.endpoint_uri.port, - path=path, - ), - fields=headers, - ) - response = await self._http_client.send(request=request) - body = await response.consume_body_async() - if response.status != 200: - raise SmithyIdentityError( - f"IMDS returned {response.status} for path '{path}'." - ) - return body.decode("utf-8") diff --git a/packages/aws-credentials-imds/tests/unit/__init__.py b/packages/aws-credentials-imds/tests/unit/__init__.py new file mode 100644 index 00000000..04f8b7b7 --- /dev/null +++ b/packages/aws-credentials-imds/tests/unit/__init__.py @@ -0,0 +1,2 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/packages/aws-credentials-imds/tests/unit/aio/__init__.py b/packages/aws-credentials-imds/tests/unit/aio/__init__.py new file mode 100644 index 00000000..04f8b7b7 --- /dev/null +++ b/packages/aws-credentials-imds/tests/unit/aio/__init__.py @@ -0,0 +1,2 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/packages/aws-credentials-imds/tests/unit/aio/test_client.py b/packages/aws-credentials-imds/tests/unit/aio/test_client.py new file mode 100644 index 00000000..ef46ce18 --- /dev/null +++ b/packages/aws-credentials-imds/tests/unit/aio/test_client.py @@ -0,0 +1,168 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + +# pyright: reportPrivateUsage=false +from unittest.mock import AsyncMock, MagicMock + +import pytest +from aws_credentials_imds.aio.client import ( + IMDSClient, + IMDSConfig, + IMDSTokenCache, +) +from aws_credentials_imds.client import IMDSConfigurationError, IMDSToken +from smithy_core import URI +from smithy_core.aio.retries import AsyncSimpleRetryStrategy +from smithy_core.exceptions import SmithyIdentityError +from smithy_http.aio import HTTPRequest + + +def test_config_defaults() -> None: + config = IMDSConfig() + assert isinstance(config.retry_strategy, AsyncSimpleRetryStrategy) + assert config.endpoint_uri == URI( + scheme="http", host=IMDSConfig._HOST_MAPPING["IPv4"], port=80 + ) + assert config.endpoint_mode == "IPv4" + assert config.token_ttl == 21600 + + +def test_endpoint_resolution() -> None: + config_ipv4 = IMDSConfig(endpoint_mode="IPv4") + config_ipv6 = IMDSConfig(endpoint_mode="IPv6") + assert config_ipv4.endpoint_uri.host == IMDSConfig._HOST_MAPPING["IPv4"] + assert config_ipv6.endpoint_uri.host == IMDSConfig._HOST_MAPPING["IPv6"] + + +def test_config_uses_custom_endpoint() -> None: + # The custom endpoint should take precedence over IPv4 endpoint resolution. + config = IMDSConfig( + endpoint_uri=URI(scheme="https", host="test.host", port=123), + endpoint_mode="IPv4", + ) + assert config.endpoint_uri == URI(scheme="https", host="test.host", port=123) + + # The custom endpoint takes precedence over IPv6 endpoint resolution. + config = IMDSConfig( + endpoint_uri=URI(scheme="https", host="test.host", port=123), + endpoint_mode="IPv6", + ) + assert config.endpoint_uri == URI(scheme="https", host="test.host", port=123) + + +def test_config_ttl_validation() -> None: + # TTL values < _MIN_TTL should raise a configuration error + with pytest.raises(IMDSConfigurationError): + IMDSConfig(token_ttl=IMDSConfig._MIN_TTL - 1) + # TTL values > _MAX_TTL should raise a configuration error + with pytest.raises(IMDSConfigurationError): + IMDSConfig(token_ttl=IMDSConfig._MAX_TTL + 1) + + +async def test_token_cache_should_refresh() -> None: + http_client = AsyncMock() + config = MagicMock() + # A new token cache needs a refresh + token_cache = IMDSTokenCache(http_client, config) + assert token_cache._should_refresh() + # A token cache with an unexpired token doesn't need a refresh + token_cache._token = MagicMock() + token_cache._token.is_expired.return_value = False + assert not token_cache._should_refresh() + # A token cache with an expired token needs a refresh + token_cache._token.is_expired.return_value = True + assert token_cache._should_refresh() + + +async def test_token_cache_refresh() -> None: + # Test that IMDSTokenCache correctly refreshes the token when needed + http_client = AsyncMock() + config = MagicMock() + config.token_ttl = 100 + config.endpoint_uri.scheme = "http" + config.endpoint_uri.host = "169.254.169.254" + response_mock = AsyncMock() + response_mock.status = 200 + response_mock.consume_body_async.return_value = b"new-token-value" + http_client.send.return_value = response_mock + token_cache = IMDSTokenCache(http_client, config) + assert token_cache._should_refresh() + await token_cache._refresh() + assert token_cache._token is not None + assert token_cache._token.value == "new-token-value" + assert token_cache._token._ttl == 100 + + +async def test_token_cache_refresh_non_200() -> None: + # A non-200 response must not be cached as the token value. + http_client = AsyncMock() + config = MagicMock() + config.token_ttl = 100 + config.endpoint_uri.scheme = "http" + config.endpoint_uri.host = "169.254.169.254" + response_mock = AsyncMock() + response_mock.status = 401 + response_mock.consume_body_async.return_value = b"Unauthorized" + http_client.send.return_value = response_mock + token_cache = IMDSTokenCache(http_client, config) + with pytest.raises(SmithyIdentityError): + await token_cache._refresh() + assert token_cache._token is None + + +async def test_token_cache_get_token() -> None: + # Test that IMDSTokenCache returns an existing token or refreshes if expired + http_client = AsyncMock() + config = MagicMock() + token_cache = IMDSTokenCache(http_client, config) + token_cache._refresh = AsyncMock() + token_cache._token = MagicMock() + token_cache._token.is_expired.return_value = False + token = await token_cache.get_token() + assert token == token_cache._token + token_cache._refresh.assert_not_awaited() + token_cache._token.is_expired.return_value = True + await token_cache.get_token() + token_cache._refresh.assert_awaited() + + +async def test_imds_client_get() -> None: + # Test IMDSClient.get() method to retrieve metadata from IMDS + http_client = AsyncMock() + config = IMDSConfig() + response = AsyncMock() + response.status = 200 + response.consume_body_async.return_value = b"metadata-response" + http_client.send.return_value = response + + client = IMDSClient(http_client, config) + client._token_cache.get_token = AsyncMock( + return_value=IMDSToken("mocked-token", config.token_ttl) + ) + + result = await client.get(path="/test-path") + assert result == "metadata-response" + + request = http_client.send.call_args.kwargs["request"] + assert isinstance(request, HTTPRequest) + assert request.destination.path == "/test-path" + assert request.method == "GET" + assert request.fields["x-aws-ec2-metadata-token"].values == ["mocked-token"] + + +async def test_imds_client_get_non_200() -> None: + # A non-200 metadata response must raise instead of returning the body. + http_client = AsyncMock() + config = IMDSConfig() + response = AsyncMock() + response.status = 404 + response.consume_body_async.return_value = b"Not Found" + http_client.send.return_value = response + + client = IMDSClient(http_client, config) + client._token_cache.get_token = AsyncMock( + return_value=IMDSToken("mocked-token", config.token_ttl) + ) + + with pytest.raises(SmithyIdentityError): + await client.get(path="/test-path") diff --git a/packages/aws-credentials-imds/tests/unit/test_providers.py b/packages/aws-credentials-imds/tests/unit/aio/test_providers.py similarity index 97% rename from packages/aws-credentials-imds/tests/unit/test_providers.py rename to packages/aws-credentials-imds/tests/unit/aio/test_providers.py index d4c8d9bb..8a1ee749 100644 --- a/packages/aws-credentials-imds/tests/unit/test_providers.py +++ b/packages/aws-credentials-imds/tests/unit/aio/test_providers.py @@ -7,13 +7,13 @@ import pytest from aws_credentials_imds.client import IMDSConfigurationError -from aws_credentials_imds.providers import Ec2InstanceMetadataProvider -from aws_credentials_imds.resolvers import IMDSCredentialsResolver +from aws_credentials_imds.aio.providers import Ec2InstanceMetadataProvider +from aws_credentials_imds.aio.resolvers import IMDSCredentialsResolver from smithy_aws_core.config.file_parser import Section, StandardizedOutput from smithy_aws_core.config.merged_config import MergedConfig from smithy_aws_core.identity import AWSCredentialsIdentity from smithy_aws_core.identity.chain import Standard, StandardProvider -from smithy_aws_core.identity.chain.provider import ChainSetup +from smithy_aws_core.aio.identity.chain.provider import ChainSetup from smithy_core.interfaces.identity import Identity _ENDPOINT_ENV = "AWS_EC2_METADATA_SERVICE_ENDPOINT" diff --git a/packages/aws-credentials-imds/tests/unit/test_resolvers.py b/packages/aws-credentials-imds/tests/unit/aio/test_resolvers.py similarity index 97% rename from packages/aws-credentials-imds/tests/unit/test_resolvers.py rename to packages/aws-credentials-imds/tests/unit/aio/test_resolvers.py index d6624d26..f56590e6 100644 --- a/packages/aws-credentials-imds/tests/unit/test_resolvers.py +++ b/packages/aws-credentials-imds/tests/unit/aio/test_resolvers.py @@ -7,8 +7,8 @@ from unittest.mock import AsyncMock import pytest -from aws_credentials_imds.client import IMDSConfig -from aws_credentials_imds.resolvers import IMDSCredentialsResolver +from aws_credentials_imds.aio.client import IMDSConfig +from aws_credentials_imds.aio.resolvers import IMDSCredentialsResolver from smithy_core.exceptions import SmithyIdentityError ISO8601 = "%Y-%m-%dT%H:%M:%SZ" diff --git a/packages/aws-credentials-imds/tests/unit/test_client.py b/packages/aws-credentials-imds/tests/unit/test_client.py index e537cd66..1c7e19f9 100644 --- a/packages/aws-credentials-imds/tests/unit/test_client.py +++ b/packages/aws-credentials-imds/tests/unit/test_client.py @@ -3,62 +3,8 @@ # pyright: reportPrivateUsage=false import time -from unittest.mock import AsyncMock, MagicMock -import pytest -from aws_credentials_imds.client import ( - IMDSClient, - IMDSConfig, - IMDSConfigurationError, - IMDSToken, - IMDSTokenCache, -) -from smithy_core import URI -from smithy_core.aio.retries import SimpleRetryStrategy -from smithy_core.exceptions import SmithyIdentityError -from smithy_http.aio import HTTPRequest - - -def test_config_defaults() -> None: - config = IMDSConfig() - assert isinstance(config.retry_strategy, SimpleRetryStrategy) - assert config.endpoint_uri == URI( - scheme="http", host=IMDSConfig._HOST_MAPPING["IPv4"], port=80 - ) - assert config.endpoint_mode == "IPv4" - assert config.token_ttl == 21600 - - -def test_endpoint_resolution() -> None: - config_ipv4 = IMDSConfig(endpoint_mode="IPv4") - config_ipv6 = IMDSConfig(endpoint_mode="IPv6") - assert config_ipv4.endpoint_uri.host == IMDSConfig._HOST_MAPPING["IPv4"] - assert config_ipv6.endpoint_uri.host == IMDSConfig._HOST_MAPPING["IPv6"] - - -def test_config_uses_custom_endpoint() -> None: - # The custom endpoint should take precedence over IPv4 endpoint resolution. - config = IMDSConfig( - endpoint_uri=URI(scheme="https", host="test.host", port=123), - endpoint_mode="IPv4", - ) - assert config.endpoint_uri == URI(scheme="https", host="test.host", port=123) - - # The custom endpoint takes precedence over IPv6 endpoint resolution. - config = IMDSConfig( - endpoint_uri=URI(scheme="https", host="test.host", port=123), - endpoint_mode="IPv6", - ) - assert config.endpoint_uri == URI(scheme="https", host="test.host", port=123) - - -def test_config_ttl_validation() -> None: - # TTL values < _MIN_TTL should raise a configuration error - with pytest.raises(IMDSConfigurationError): - IMDSConfig(token_ttl=IMDSConfig._MIN_TTL - 1) - # TTL values > _MAX_TTL should raise a configuration error - with pytest.raises(IMDSConfigurationError): - IMDSConfig(token_ttl=IMDSConfig._MAX_TTL + 1) +from aws_credentials_imds.client import IMDSToken def test_token_creation() -> None: @@ -73,112 +19,3 @@ def test_token_expiration() -> None: assert not token.is_expired() time.sleep(1.1) assert token.is_expired() - - -async def test_token_cache_should_refresh() -> None: - http_client = AsyncMock() - config = MagicMock() - # A new token cache needs a refresh - token_cache = IMDSTokenCache(http_client, config) - assert token_cache._should_refresh() - # A token cache with an unexpired token doesn't need a refresh - token_cache._token = MagicMock() - token_cache._token.is_expired.return_value = False - assert not token_cache._should_refresh() - # A token cache with an expired token needs a refresh - token_cache._token.is_expired.return_value = True - assert token_cache._should_refresh() - - -async def test_token_cache_refresh() -> None: - # Test that IMDSTokenCache correctly refreshes the token when needed - http_client = AsyncMock() - config = MagicMock() - config.token_ttl = 100 - config.endpoint_uri.scheme = "http" - config.endpoint_uri.host = "169.254.169.254" - response_mock = AsyncMock() - response_mock.status = 200 - response_mock.consume_body_async.return_value = b"new-token-value" - http_client.send.return_value = response_mock - token_cache = IMDSTokenCache(http_client, config) - assert token_cache._should_refresh() - await token_cache._refresh() - assert token_cache._token is not None - assert token_cache._token.value == "new-token-value" - assert token_cache._token._ttl == 100 - - -async def test_token_cache_refresh_non_200() -> None: - # A non-200 response must not be cached as the token value. - http_client = AsyncMock() - config = MagicMock() - config.token_ttl = 100 - config.endpoint_uri.scheme = "http" - config.endpoint_uri.host = "169.254.169.254" - response_mock = AsyncMock() - response_mock.status = 401 - response_mock.consume_body_async.return_value = b"Unauthorized" - http_client.send.return_value = response_mock - token_cache = IMDSTokenCache(http_client, config) - with pytest.raises(SmithyIdentityError): - await token_cache._refresh() - assert token_cache._token is None - - -async def test_token_cache_get_token() -> None: - # Test that IMDSTokenCache returns an existing token or refreshes if expired - http_client = AsyncMock() - config = MagicMock() - token_cache = IMDSTokenCache(http_client, config) - token_cache._refresh = AsyncMock() - token_cache._token = MagicMock() - token_cache._token.is_expired.return_value = False - token = await token_cache.get_token() - assert token == token_cache._token - token_cache._refresh.assert_not_awaited() - token_cache._token.is_expired.return_value = True - await token_cache.get_token() - token_cache._refresh.assert_awaited() - - -async def test_imds_client_get() -> None: - # Test IMDSClient.get() method to retrieve metadata from IMDS - http_client = AsyncMock() - config = IMDSConfig() - response = AsyncMock() - response.status = 200 - response.consume_body_async.return_value = b"metadata-response" - http_client.send.return_value = response - - client = IMDSClient(http_client, config) - client._token_cache.get_token = AsyncMock( - return_value=IMDSToken("mocked-token", config.token_ttl) - ) - - result = await client.get(path="/test-path") - assert result == "metadata-response" - - request = http_client.send.call_args.kwargs["request"] - assert isinstance(request, HTTPRequest) - assert request.destination.path == "/test-path" - assert request.method == "GET" - assert request.fields["x-aws-ec2-metadata-token"].values == ["mocked-token"] - - -async def test_imds_client_get_non_200() -> None: - # A non-200 metadata response must raise instead of returning the body. - http_client = AsyncMock() - config = IMDSConfig() - response = AsyncMock() - response.status = 404 - response.consume_body_async.return_value = b"Not Found" - http_client.send.return_value = response - - client = IMDSClient(http_client, config) - client._token_cache.get_token = AsyncMock( - return_value=IMDSToken("mocked-token", config.token_ttl) - ) - - with pytest.raises(SmithyIdentityError): - await client.get(path="/test-path") diff --git a/packages/aws-credentials-sts/.changes/next-release/aws-credentials-sts-breaking-f2941adc6fc748ceb6fe97f55492231c.json b/packages/aws-credentials-sts/.changes/next-release/aws-credentials-sts-breaking-f2941adc6fc748ceb6fe97f55492231c.json new file mode 100644 index 00000000..9950a290 --- /dev/null +++ b/packages/aws-credentials-sts/.changes/next-release/aws-credentials-sts-breaking-f2941adc6fc748ceb6fe97f55492231c.json @@ -0,0 +1,4 @@ +{ + "type": "breaking", + "description": "Moved the async implementations to `aws_credentials_sts.aio`: `AssumeRoleCredentialsResolver`, `ProfileAssumeRoleCredentialsResolver` and `ProfileAssumeRoleProvider`. `AssumeRoleConfigurationError` remains in `aws_credentials_sts`. Update imports to the `aio` paths." +} \ No newline at end of file diff --git a/packages/aws-credentials-sts/README.md b/packages/aws-credentials-sts/README.md index 1cc6fce5..82f7ba01 100644 --- a/packages/aws-credentials-sts/README.md +++ b/packages/aws-credentials-sts/README.md @@ -26,13 +26,13 @@ property on a service client's config to an `AssumeRoleCredentialsResolver` instance. It assumes `role_arn` using credentials from the `source_resolver`: ```python -from aws_credentials_sts import AssumeRoleCredentialsResolver -from smithy_aws_core.identity import EnvironmentCredentialsResolver +from aws_credentials_sts.aio import AssumeRoleCredentialsResolver +from smithy_aws_core.aio.identity import AsyncEnvironmentCredentialsResolver service_client = ServiceClient( config=ServiceClientConfig( aws_credentials_identity_resolver=AssumeRoleCredentialsResolver( - source_resolver=EnvironmentCredentialsResolver(), + source_resolver=AsyncEnvironmentCredentialsResolver(), role_arn="arn:aws:iam::123456789012:role/example-role", ), ) @@ -44,8 +44,8 @@ To assume the role defined in a named profile instead, use shared config/credentials files: ```python -from aws_credentials_sts import ProfileAssumeRoleCredentialsResolver -from smithy_aws_core.config import load_config +from aws_credentials_sts.aio import ProfileAssumeRoleCredentialsResolver +from smithy_aws_core.aio.config import load_config_async async def build_client() -> ServiceClient: @@ -53,7 +53,7 @@ async def build_client() -> ServiceClient: config=ServiceClientConfig( aws_credentials_identity_resolver=ProfileAssumeRoleCredentialsResolver( profile_name="my-profile", - config_file=await load_config(), + config_file=await load_config_async(), ), ) ) @@ -66,13 +66,13 @@ Either resolver can also be used on its own to fetch credentials directly: ```python import asyncio -from aws_credentials_sts import AssumeRoleCredentialsResolver -from smithy_aws_core.identity import EnvironmentCredentialsResolver +from aws_credentials_sts.aio import AssumeRoleCredentialsResolver +from smithy_aws_core.aio.identity import AsyncEnvironmentCredentialsResolver async def main() -> None: resolver = AssumeRoleCredentialsResolver( - source_resolver=EnvironmentCredentialsResolver(), + source_resolver=AsyncEnvironmentCredentialsResolver(), role_arn="arn:aws:iam::123456789012:role/example-role", ) identity = await resolver.get_identity(properties={}) diff --git a/packages/aws-credentials-sts/pyproject.toml b/packages/aws-credentials-sts/pyproject.toml index 435bf0ef..7b500aea 100644 --- a/packages/aws-credentials-sts/pyproject.toml +++ b/packages/aws-credentials-sts/pyproject.toml @@ -37,8 +37,14 @@ dependencies = [ "Code" = "https://github.com/aws/aws-sdk-python/tree/develop/packages/aws-credentials-sts/" "Issue tracker" = "https://github.com/aws/aws-sdk-python/issues" -[project.entry-points."smithy_aws_core.identity.chain_providers"] -ProfileAssumeRole = "aws_credentials_sts.providers:ProfileAssumeRoleProvider" +[project.entry-points."smithy_aws_core.aio.identity.chain_providers"] +ProfileAssumeRole = "aws_credentials_sts.aio.providers:ProfileAssumeRoleProvider" + +[dependency-groups] +test = [ + "pytest>=9.0.1,<10.0.0", + "pytest-asyncio>=1.3.0,<1.4.0" +] [build-system] requires = ["hatchling"] @@ -54,3 +60,7 @@ exclude = [ [tool.ruff] src = ["src"] + +[tool.pytest.ini_options] +python_classes = ["!Test"] +asyncio_mode = "auto" diff --git a/packages/aws-credentials-sts/src/aws_credentials_sts/__init__.py b/packages/aws-credentials-sts/src/aws_credentials_sts/__init__.py index 05b156a8..cacff41f 100644 --- a/packages/aws-credentials-sts/src/aws_credentials_sts/__init__.py +++ b/packages/aws-credentials-sts/src/aws_credentials_sts/__init__.py @@ -2,16 +2,6 @@ # SPDX-License-Identifier: Apache-2.0 __version__ = "0.4.0" -from .providers import ProfileAssumeRoleProvider -from .resolvers import ( - AssumeRoleConfigurationError, - AssumeRoleCredentialsResolver, - ProfileAssumeRoleCredentialsResolver, -) +from .resolvers import AssumeRoleConfigurationError -__all__ = ( - "AssumeRoleConfigurationError", - "AssumeRoleCredentialsResolver", - "ProfileAssumeRoleCredentialsResolver", - "ProfileAssumeRoleProvider", -) +__all__ = ("AssumeRoleConfigurationError",) diff --git a/packages/aws-credentials-sts/src/aws_credentials_sts/aio/__init__.py b/packages/aws-credentials-sts/src/aws_credentials_sts/aio/__init__.py new file mode 100644 index 00000000..2b188b94 --- /dev/null +++ b/packages/aws-credentials-sts/src/aws_credentials_sts/aio/__init__.py @@ -0,0 +1,13 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 +from .providers import ProfileAssumeRoleProvider +from .resolvers import ( + AssumeRoleCredentialsResolver, + ProfileAssumeRoleCredentialsResolver, +) + +__all__ = ( + "AssumeRoleCredentialsResolver", + "ProfileAssumeRoleCredentialsResolver", + "ProfileAssumeRoleProvider", +) diff --git a/packages/aws-credentials-sts/src/aws_credentials_sts/providers.py b/packages/aws-credentials-sts/src/aws_credentials_sts/aio/providers.py similarity index 91% rename from packages/aws-credentials-sts/src/aws_credentials_sts/providers.py rename to packages/aws-credentials-sts/src/aws_credentials_sts/aio/providers.py index 19c73353..922ec366 100644 --- a/packages/aws-credentials-sts/src/aws_credentials_sts/providers.py +++ b/packages/aws-credentials-sts/src/aws_credentials_sts/aio/providers.py @@ -2,7 +2,8 @@ # SPDX-License-Identifier: Apache-2.0 from smithy_aws_core.identity import AWSCredentialsIdentity -from smithy_aws_core.identity.chain import ChainSetup, Standard, StandardProvider +from smithy_aws_core.aio.identity.chain.provider import ChainSetup +from smithy_aws_core.identity.chain import Standard, StandardProvider from smithy_core.interfaces.identity import Identity from .resolvers import ProfileAssumeRoleCredentialsResolver diff --git a/packages/aws-credentials-sts/src/aws_credentials_sts/aio/resolvers.py b/packages/aws-credentials-sts/src/aws_credentials_sts/aio/resolvers.py new file mode 100644 index 00000000..482e89a4 --- /dev/null +++ b/packages/aws-credentials-sts/src/aws_credentials_sts/aio/resolvers.py @@ -0,0 +1,341 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +import asyncio +import uuid +from collections.abc import Callable +from importlib import metadata +from typing import TYPE_CHECKING, cast + +from smithy_aws_core.aio.config import AwsConfigOverrides +from smithy_aws_core.config.merged_config import MergedConfig +from smithy_aws_core.aio.identity import ( + AsyncAWSCredentialsResolver, + AsyncStaticCredentialsResolver, +) +from smithy_aws_core.identity import AWSCredentialsIdentity, AWSIdentityProperties +from smithy_aws_core.aio.identity.chain.provider import ( + ChainIdentityProvider, + ChainSetup, +) +from smithy_aws_core.identity.chain import StandardProvider +from smithy_core.aio.interfaces.identity import AsyncIdentityResolver +from smithy_core.exceptions import SmithyIdentityError +from smithy_http.aio.interfaces import AsyncHTTPClient + +from ..resolvers import ( + _ACCESS_KEY_ID, + _ACCOUNT_ID, + _CREDENTIAL_SOURCE, + _CREDENTIAL_SOURCE_SLOTS, + _DEFAULT_STS_REGION, + _DURATION_SECONDS, + _EXTERNAL_ID, + _ROLE_ARN, + _ROLE_SESSION_NAME, + _SECRET_ACCESS_KEY, + _SESSION_TOKEN, + _SOURCE_PROFILE, + AssumeRoleConfigurationError, + _account_id_from_arn, + _resolve_sts_region, +) + +if TYPE_CHECKING: + from aws_sdk_sts.client import AsyncSTSClient + +_CHAIN_PROVIDER_ENTRY_POINT_GROUP = "smithy_aws_core.aio.identity.chain_providers" + + +class AssumeRoleCredentialsResolver( + AsyncIdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] +): + """Resolves credentials with an STS AssumeRole call.""" + + def __init__( + self, + *, + source_resolver: AsyncAWSCredentialsResolver, + role_arn: str, + role_session_name: str | None = None, + external_id: str | None = None, + duration_seconds: int | None = None, + region: str | None = None, + http_client: AsyncHTTPClient | None = None, + ) -> None: + self._source_resolver = source_resolver + self._role_arn = role_arn + self._role_session_name = ( + role_session_name or f"aws-sdk-python-{uuid.uuid4().hex[:16]}" + ) + self._external_id = external_id + self._duration_seconds = duration_seconds + self._region = region or _DEFAULT_STS_REGION + self._http_client = http_client + self._credentials: AWSCredentialsIdentity | None = None + self._client: AsyncSTSClient | None = None + self._refresh_lock = asyncio.Lock() + + async def get_identity( + self, + *, + properties: AWSIdentityProperties, + ) -> AWSCredentialsIdentity: + """Return cached credentials if valid, otherwise call STS AssumeRole.""" + if self._credentials is not None and not self._credentials.is_expired: + return self._credentials + + async with self._refresh_lock: + if self._credentials is not None and not self._credentials.is_expired: + return self._credentials + self._credentials = await self._assume_role() + return self._credentials + + async def _assume_role(self) -> AWSCredentialsIdentity: + from aws_sdk_sts.client import AsyncSTSClient + from aws_sdk_sts.config import AsyncSTSConfig + from aws_sdk_sts.models import AssumeRoleInput + + if self._client is None: + overrides: AwsConfigOverrides = { + "aws_credentials_identity_resolver": self._source_resolver, + "region": self._region, + } + if self._http_client is not None: + overrides["transport"] = self._http_client + self._client = AsyncSTSClient( + config=await AsyncSTSConfig.resolve(**overrides) + ) + + response = await self._client.assume_role( + AssumeRoleInput( + role_arn=self._role_arn, + role_session_name=self._role_session_name, + external_id=self._external_id, + duration_seconds=self._duration_seconds, + ) + ) + + credentials = response.credentials + if credentials is None: + raise SmithyIdentityError( + "STS AssumeRole response did not contain credentials." + ) + + assumed_role_arn = ( + response.assumed_role_user.arn + if response.assumed_role_user is not None + else None + ) + return AWSCredentialsIdentity( + access_key_id=credentials.access_key_id, + secret_access_key=credentials.secret_access_key, + session_token=credentials.session_token, + expiration=credentials.expiration, + account_id=_account_id_from_arn(assumed_role_arn), + ) + + +class ProfileAssumeRoleCredentialsResolver( + AsyncIdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] +): + """Resolves credentials from a profile-based AssumeRole configuration.""" + + def __init__( + self, + *, + profile_name: str, + config_file: MergedConfig, + region_override: str | None = None, + http_client: AsyncHTTPClient | None = None, + ) -> None: + if config_file.get_profile(profile_name) is None: + raise AssumeRoleConfigurationError( + f"Profile '{profile_name}' does not exist." + ) + self._profile_name = profile_name + self._config_file = config_file + self._region = region_override or _resolve_sts_region( + config_file=config_file, profile_name=profile_name + ) + self._http_client = http_client + self._delegate: AssumeRoleCredentialsResolver | None = None + self._setup_lock = asyncio.Lock() + + async def get_identity( + self, + *, + properties: AWSIdentityProperties, + ) -> AWSCredentialsIdentity: + """Create delegate resolver if needed, then fetch assume role credentials.""" + if self._delegate is None: + async with self._setup_lock: + if self._delegate is None: + self._delegate = await self._create_assume_role_resolver( + profile_name=self._profile_name, + visited=(self._profile_name,), + ) + return await self._delegate.get_identity(properties=properties) + + async def _create_assume_role_resolver( + self, + *, + profile_name: str, + visited: tuple[str, ...], + ) -> AssumeRoleCredentialsResolver: + config_file = self._config_file + role_arn = config_file.get(profile_name, _ROLE_ARN) + if role_arn is None: + raise AssumeRoleConfigurationError( + f"Profile '{profile_name}' does not define role_arn." + ) + + source_profile = config_file.get(profile_name, _SOURCE_PROFILE) + credential_source = config_file.get(profile_name, _CREDENTIAL_SOURCE) + if source_profile is not None and credential_source is not None: + raise AssumeRoleConfigurationError( + f"Profile '{profile_name}' cannot define both 'source_profile' and 'credential_source'." + ) + elif source_profile is not None: + source_resolver = await self._create_resolver_from_source_profile( + source_profile, + visited, + ) + elif credential_source is not None: + source_resolver = await self._create_resolver_from_credential_source( + credential_source, + self._region, + ) + else: + raise AssumeRoleConfigurationError( + f"Profile '{profile_name}' must define either 'source_profile' or 'credential_source'." + ) + + return AssumeRoleCredentialsResolver( + source_resolver=source_resolver, + role_arn=role_arn, + role_session_name=config_file.get(profile_name, _ROLE_SESSION_NAME), + external_id=config_file.get(profile_name, _EXTERNAL_ID), + duration_seconds=self._parse_duration_seconds(profile_name), + region=self._region, + http_client=self._http_client, + ) + + async def _create_resolver_from_source_profile( + self, + source_profile_name: str, + visited: tuple[str, ...], + ) -> AsyncAWSCredentialsResolver: + config_file = self._config_file + is_direct_self_reference = ( + len(visited) > 0 and source_profile_name == visited[-1] + ) + if source_profile_name in visited and not is_direct_self_reference: + path = " -> ".join((*visited, source_profile_name)) + raise AssumeRoleConfigurationError( + f"Circular source_profile reference: {path}." + ) + + if config_file.get_profile(source_profile_name) is None: + raise AssumeRoleConfigurationError( + f"Source profile '{source_profile_name}' does not exist." + ) + + if any( + config_file.get(source_profile_name, key) is not None + for key in (_ACCESS_KEY_ID, _SECRET_ACCESS_KEY, _SESSION_TOKEN) + ): + return self._create_static_resolver(source_profile_name) + + if is_direct_self_reference: + raise AssumeRoleConfigurationError( + f"Self-referencing profile '{source_profile_name}' must contain " + "complete static credentials." + ) + + if config_file.get(source_profile_name, _ROLE_ARN) is not None: + return await self._create_assume_role_resolver( + profile_name=source_profile_name, + visited=(*visited, source_profile_name), + ) + + raise AssumeRoleConfigurationError( + f"Source profile '{source_profile_name}' has no supported credential source." + ) + + def _create_static_resolver( + self, + profile_name: str, + ) -> AsyncAWSCredentialsResolver: + config_file = self._config_file + access_key_id = config_file.get(profile_name, _ACCESS_KEY_ID) + secret_access_key = config_file.get(profile_name, _SECRET_ACCESS_KEY) + if access_key_id is None or secret_access_key is None: + raise AssumeRoleConfigurationError( + f"Profile '{profile_name}' contains partial credentials." + ) + + return AsyncStaticCredentialsResolver( + AWSCredentialsIdentity( + access_key_id=access_key_id, + secret_access_key=secret_access_key, + session_token=config_file.get(profile_name, _SESSION_TOKEN), + account_id=config_file.get(profile_name, _ACCOUNT_ID), + ) + ) + + async def _create_resolver_from_credential_source( + self, + credential_source: str, + region: str, + ) -> AsyncAWSCredentialsResolver: + slot = _CREDENTIAL_SOURCE_SLOTS.get(credential_source) + if slot is None: + raise AssumeRoleConfigurationError( + f"Unsupported 'credential_source': '{credential_source}'." + ) + + provider = self._find_provider(slot) + if provider is None: + raise AssumeRoleConfigurationError( + f"No provider is installed for credential source '{credential_source}'. Install '{slot.module_suggestion}'." + ) + + setup = ChainSetup( + region_override=region, + http_client=self._http_client, + ) + setup.set_current_provider(provider) + await provider.setup(AWSCredentialsIdentity, setup) + if not setup.resolvers: + raise AssumeRoleConfigurationError( + f"'{credential_source}' credential source is not configured." + ) + return cast(AsyncAWSCredentialsResolver, setup.resolvers[0]) + + def _find_provider( + self, + slot: StandardProvider, + ) -> ChainIdentityProvider | None: + for entry_point in metadata.entry_points( + group=_CHAIN_PROVIDER_ENTRY_POINT_GROUP + ): + if entry_point.name != slot.canonical_name: + continue + provider_factory = cast( + Callable[[], ChainIdentityProvider], + entry_point.load(), + ) + return provider_factory() + return None + + def _parse_duration_seconds(self, profile_name: str) -> int | None: + duration_seconds = self._config_file.get(profile_name, _DURATION_SECONDS) + if duration_seconds is None: + return None + try: + return int(duration_seconds) + except ValueError: + return None diff --git a/packages/aws-credentials-sts/src/aws_credentials_sts/resolvers.py b/packages/aws-credentials-sts/src/aws_credentials_sts/resolvers.py index 64c3a6b6..8ffb25e7 100644 --- a/packages/aws-credentials-sts/src/aws_credentials_sts/resolvers.py +++ b/packages/aws-credentials-sts/src/aws_credentials_sts/resolvers.py @@ -1,36 +1,11 @@ # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 - -from __future__ import annotations - -import asyncio import os -import uuid -from collections.abc import Callable -from importlib import metadata -from typing import TYPE_CHECKING, cast -from smithy_aws_core.config import AwsConfigOverrides from smithy_aws_core.config.merged_config import MergedConfig -from smithy_aws_core.identity import ( - AWSCredentialsIdentity, - AWSCredentialsResolver, - AWSIdentityProperties, - StaticCredentialsResolver, -) -from smithy_aws_core.identity.chain import ( - ChainIdentityProvider, - ChainSetup, - StandardProvider, -) -from smithy_core.aio.interfaces.identity import IdentityResolver -from smithy_core.exceptions import SmithyError, SmithyIdentityError -from smithy_http.aio.interfaces import HTTPClient - -if TYPE_CHECKING: - from aws_sdk_sts.client import AsyncSTSClient +from smithy_aws_core.identity.chain import StandardProvider +from smithy_core.exceptions import SmithyError -_CHAIN_PROVIDER_ENTRY_POINT_GROUP = "smithy_aws_core.identity.chain_providers" _DEFAULT_STS_REGION = "us-east-1" _ACCESS_KEY_ID = "aws_access_key_id" @@ -79,295 +54,3 @@ def _resolve_sts_region( or profile_region or _DEFAULT_STS_REGION ) - - -class AssumeRoleCredentialsResolver( - IdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] -): - """Resolves credentials with an STS AssumeRole call.""" - - def __init__( - self, - *, - source_resolver: AWSCredentialsResolver, - role_arn: str, - role_session_name: str | None = None, - external_id: str | None = None, - duration_seconds: int | None = None, - region: str | None = None, - http_client: HTTPClient | None = None, - ) -> None: - self._source_resolver = source_resolver - self._role_arn = role_arn - self._role_session_name = ( - role_session_name or f"aws-sdk-python-{uuid.uuid4().hex[:16]}" - ) - self._external_id = external_id - self._duration_seconds = duration_seconds - self._region = region or _DEFAULT_STS_REGION - self._http_client = http_client - self._credentials: AWSCredentialsIdentity | None = None - self._client: AsyncSTSClient | None = None - self._refresh_lock = asyncio.Lock() - - async def get_identity( - self, - *, - properties: AWSIdentityProperties, - ) -> AWSCredentialsIdentity: - """Return cached credentials if valid, otherwise call STS AssumeRole.""" - if self._credentials is not None and not self._credentials.is_expired: - return self._credentials - - async with self._refresh_lock: - if self._credentials is not None and not self._credentials.is_expired: - return self._credentials - self._credentials = await self._assume_role() - return self._credentials - - async def _assume_role(self) -> AWSCredentialsIdentity: - from aws_sdk_sts.client import AsyncSTSClient - from aws_sdk_sts.config import AsyncSTSConfig - from aws_sdk_sts.models import AssumeRoleInput - - if self._client is None: - overrides: AwsConfigOverrides = { - "aws_credentials_identity_resolver": self._source_resolver, - "region": self._region, - } - if self._http_client is not None: - overrides["transport"] = self._http_client - self._client = AsyncSTSClient( - config=await AsyncSTSConfig.resolve(**overrides) - ) - - response = await self._client.assume_role( - AssumeRoleInput( - role_arn=self._role_arn, - role_session_name=self._role_session_name, - external_id=self._external_id, - duration_seconds=self._duration_seconds, - ) - ) - - credentials = response.credentials - if credentials is None: - raise SmithyIdentityError( - "STS AssumeRole response did not contain credentials." - ) - - assumed_role_arn = ( - response.assumed_role_user.arn - if response.assumed_role_user is not None - else None - ) - return AWSCredentialsIdentity( - access_key_id=credentials.access_key_id, - secret_access_key=credentials.secret_access_key, - session_token=credentials.session_token, - expiration=credentials.expiration, - account_id=_account_id_from_arn(assumed_role_arn), - ) - - -class ProfileAssumeRoleCredentialsResolver( - IdentityResolver[AWSCredentialsIdentity, AWSIdentityProperties] -): - """Resolves credentials from a profile-based AssumeRole configuration.""" - - def __init__( - self, - *, - profile_name: str, - config_file: MergedConfig, - region_override: str | None = None, - http_client: HTTPClient | None = None, - ) -> None: - if config_file.get_profile(profile_name) is None: - raise AssumeRoleConfigurationError( - f"Profile '{profile_name}' does not exist." - ) - self._profile_name = profile_name - self._config_file = config_file - self._region = region_override or _resolve_sts_region( - config_file=config_file, profile_name=profile_name - ) - self._http_client = http_client - self._delegate: AssumeRoleCredentialsResolver | None = None - self._setup_lock = asyncio.Lock() - - async def get_identity( - self, - *, - properties: AWSIdentityProperties, - ) -> AWSCredentialsIdentity: - """Create delegate resolver if needed, then fetch assume role credentials.""" - if self._delegate is None: - async with self._setup_lock: - if self._delegate is None: - self._delegate = await self._create_assume_role_resolver( - profile_name=self._profile_name, - visited=(self._profile_name,), - ) - return await self._delegate.get_identity(properties=properties) - - async def _create_assume_role_resolver( - self, - *, - profile_name: str, - visited: tuple[str, ...], - ) -> AssumeRoleCredentialsResolver: - config_file = self._config_file - role_arn = config_file.get(profile_name, _ROLE_ARN) - if role_arn is None: - raise AssumeRoleConfigurationError( - f"Profile '{profile_name}' does not define role_arn." - ) - - source_profile = config_file.get(profile_name, _SOURCE_PROFILE) - credential_source = config_file.get(profile_name, _CREDENTIAL_SOURCE) - if source_profile is not None and credential_source is not None: - raise AssumeRoleConfigurationError( - f"Profile '{profile_name}' cannot define both 'source_profile' and 'credential_source'." - ) - elif source_profile is not None: - source_resolver = await self._create_resolver_from_source_profile( - source_profile, - visited, - ) - elif credential_source is not None: - source_resolver = await self._create_resolver_from_credential_source( - credential_source, - self._region, - ) - else: - raise AssumeRoleConfigurationError( - f"Profile '{profile_name}' must define either 'source_profile' or 'credential_source'." - ) - - return AssumeRoleCredentialsResolver( - source_resolver=source_resolver, - role_arn=role_arn, - role_session_name=config_file.get(profile_name, _ROLE_SESSION_NAME), - external_id=config_file.get(profile_name, _EXTERNAL_ID), - duration_seconds=self._parse_duration_seconds(profile_name), - region=self._region, - http_client=self._http_client, - ) - - async def _create_resolver_from_source_profile( - self, - source_profile_name: str, - visited: tuple[str, ...], - ) -> AWSCredentialsResolver: - config_file = self._config_file - is_direct_self_reference = ( - len(visited) > 0 and source_profile_name == visited[-1] - ) - if source_profile_name in visited and not is_direct_self_reference: - path = " -> ".join((*visited, source_profile_name)) - raise AssumeRoleConfigurationError( - f"Circular source_profile reference: {path}." - ) - - if config_file.get_profile(source_profile_name) is None: - raise AssumeRoleConfigurationError( - f"Source profile '{source_profile_name}' does not exist." - ) - - if any( - config_file.get(source_profile_name, key) is not None - for key in (_ACCESS_KEY_ID, _SECRET_ACCESS_KEY, _SESSION_TOKEN) - ): - return self._create_static_resolver(source_profile_name) - - if is_direct_self_reference: - raise AssumeRoleConfigurationError( - f"Self-referencing profile '{source_profile_name}' must contain " - "complete static credentials." - ) - - if config_file.get(source_profile_name, _ROLE_ARN) is not None: - return await self._create_assume_role_resolver( - profile_name=source_profile_name, - visited=(*visited, source_profile_name), - ) - - raise AssumeRoleConfigurationError( - f"Source profile '{source_profile_name}' has no supported credential source." - ) - - def _create_static_resolver( - self, - profile_name: str, - ) -> AWSCredentialsResolver: - config_file = self._config_file - access_key_id = config_file.get(profile_name, _ACCESS_KEY_ID) - secret_access_key = config_file.get(profile_name, _SECRET_ACCESS_KEY) - if access_key_id is None or secret_access_key is None: - raise AssumeRoleConfigurationError( - f"Profile '{profile_name}' contains partial credentials." - ) - - return StaticCredentialsResolver( - AWSCredentialsIdentity( - access_key_id=access_key_id, - secret_access_key=secret_access_key, - session_token=config_file.get(profile_name, _SESSION_TOKEN), - account_id=config_file.get(profile_name, _ACCOUNT_ID), - ) - ) - - async def _create_resolver_from_credential_source( - self, - credential_source: str, - region: str, - ) -> AWSCredentialsResolver: - slot = _CREDENTIAL_SOURCE_SLOTS.get(credential_source) - if slot is None: - raise AssumeRoleConfigurationError( - f"Unsupported 'credential_source': '{credential_source}'." - ) - - provider = self._find_provider(slot) - if provider is None: - raise AssumeRoleConfigurationError( - f"No provider is installed for credential source '{credential_source}'. Install '{slot.module_suggestion}'." - ) - - setup = ChainSetup( - region_override=region, - http_client=self._http_client, - ) - setup.set_current_provider(provider) - await provider.setup(AWSCredentialsIdentity, setup) - if not setup.resolvers: - raise AssumeRoleConfigurationError( - f"'{credential_source}' credential source is not configured." - ) - return cast(AWSCredentialsResolver, setup.resolvers[0]) - - def _find_provider( - self, - slot: StandardProvider, - ) -> ChainIdentityProvider | None: - for entry_point in metadata.entry_points( - group=_CHAIN_PROVIDER_ENTRY_POINT_GROUP - ): - if entry_point.name != slot.canonical_name: - continue - provider_factory = cast( - Callable[[], ChainIdentityProvider], - entry_point.load(), - ) - return provider_factory() - return None - - def _parse_duration_seconds(self, profile_name: str) -> int | None: - duration_seconds = self._config_file.get(profile_name, _DURATION_SECONDS) - if duration_seconds is None: - return None - try: - return int(duration_seconds) - except ValueError: - return None diff --git a/packages/aws-credentials-sts/tests/unit/__init__.py b/packages/aws-credentials-sts/tests/unit/__init__.py new file mode 100644 index 00000000..04f8b7b7 --- /dev/null +++ b/packages/aws-credentials-sts/tests/unit/__init__.py @@ -0,0 +1,2 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/packages/aws-credentials-sts/tests/unit/aio/__init__.py b/packages/aws-credentials-sts/tests/unit/aio/__init__.py new file mode 100644 index 00000000..04f8b7b7 --- /dev/null +++ b/packages/aws-credentials-sts/tests/unit/aio/__init__.py @@ -0,0 +1,2 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/packages/aws-credentials-sts/tests/unit/test_providers.py b/packages/aws-credentials-sts/tests/unit/aio/test_providers.py similarity index 92% rename from packages/aws-credentials-sts/tests/unit/test_providers.py rename to packages/aws-credentials-sts/tests/unit/aio/test_providers.py index ccf0a798..4024e1fa 100644 --- a/packages/aws-credentials-sts/tests/unit/test_providers.py +++ b/packages/aws-credentials-sts/tests/unit/aio/test_providers.py @@ -5,12 +5,13 @@ from typing import Any import pytest -from aws_credentials_sts.providers import ProfileAssumeRoleProvider -from aws_credentials_sts.resolvers import ProfileAssumeRoleCredentialsResolver +from aws_credentials_sts.aio.providers import ProfileAssumeRoleProvider +from aws_credentials_sts.aio.resolvers import ProfileAssumeRoleCredentialsResolver from smithy_aws_core.config.file_parser import Section, StandardizedOutput from smithy_aws_core.config.merged_config import MergedConfig from smithy_aws_core.identity import AWSCredentialsIdentity -from smithy_aws_core.identity.chain import ChainSetup, Standard, StandardProvider +from smithy_aws_core.aio.identity.chain.provider import ChainSetup +from smithy_aws_core.identity.chain import Standard, StandardProvider from smithy_core.interfaces.identity import Identity ROLE_ARN = "arn:aws:iam::123456789012:role/MyRole" diff --git a/packages/aws-credentials-sts/tests/unit/aio/test_resolvers.py b/packages/aws-credentials-sts/tests/unit/aio/test_resolvers.py new file mode 100644 index 00000000..e5fff07a --- /dev/null +++ b/packages/aws-credentials-sts/tests/unit/aio/test_resolvers.py @@ -0,0 +1,763 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + +# pyright: reportPrivateUsage=false +from collections.abc import Callable, Mapping +from datetime import UTC, datetime, timedelta +from unittest.mock import AsyncMock + +import pytest +from aws_credentials_sts.aio.resolvers import ( + AssumeRoleCredentialsResolver, + ProfileAssumeRoleCredentialsResolver, +) +from aws_credentials_sts.resolvers import AssumeRoleConfigurationError +from aws_sdk_sts.models import ( + AssumedRoleUser, + AssumeRoleOutput, + Credentials, +) +from smithy_aws_core.config.file_parser import Section, StandardizedOutput +from smithy_aws_core.config.merged_config import MergedConfig +from smithy_aws_core.aio.identity import AsyncStaticCredentialsResolver +from smithy_aws_core.identity import AWSCredentialsIdentity +from smithy_aws_core.aio.identity.chain.provider import ChainSetup, NamedResolver +from smithy_aws_core.identity.chain import Standard, StandardProvider +from smithy_core.exceptions import SmithyIdentityError + +ROLE_ARN = "arn:aws:iam::123456789012:role/MyRole" +SOURCE_ROLE_ARN = "arn:aws:iam::123456789012:role/SourceRole" +ASSUMED_ROLE_ARN = "arn:aws:sts::123456789012:assumed-role/MyRole/session" +ACCESS_KEY_ID = "test-access-key" +SECRET_ACCESS_KEY = "test-secret-key" +SESSION_TOKEN = "test-session-token" + + +class _FakeProvider: + """A chain provider that adds a single static resolver during setup.""" + + def __init__(self, resolver: AsyncStaticCredentialsResolver) -> None: + self._resolver = resolver + + @property + def name(self) -> str: + return StandardProvider.ENVIRONMENT.canonical_name + + @property + def ordering(self) -> Standard: + return Standard(slot=StandardProvider.ENVIRONMENT) + + async def setup(self, identity_type: object, setup: ChainSetup) -> None: + setup.add_resolver(self._resolver) + + +@pytest.fixture +def merged_config() -> Callable[..., MergedConfig]: + def _build(profiles: Mapping[str, Mapping[str, str]]) -> MergedConfig: + sections = { + name: Section(properties=dict(properties)) + for name, properties in profiles.items() + } + return MergedConfig(StandardizedOutput(profiles=sections), StandardizedOutput()) + + return _build + + +def _future_expiry() -> datetime: + return datetime.now(UTC) + timedelta(hours=1) + + +def _past_expiry() -> datetime: + return datetime.now(UTC) - timedelta(hours=1) + + +def _valid_output( + *, access_key_id: str = ACCESS_KEY_ID, expiration: datetime | None = None +) -> AssumeRoleOutput: + """An AssumeRole response with valid credentials and assumed-role user.""" + return AssumeRoleOutput( + credentials=Credentials( + access_key_id=access_key_id, + secret_access_key=SECRET_ACCESS_KEY, + session_token=SESSION_TOKEN, + expiration=expiration or _future_expiry(), + ), + assumed_role_user=AssumedRoleUser(assumed_role_id="id", arn=ASSUMED_ROLE_ARN), + ) + + +def _mock_sts_client( + resolver: AssumeRoleCredentialsResolver, *responses: AssumeRoleOutput +) -> AsyncMock: + """Attach a mock STS client returning one response per AssumeRole call.""" + client = AsyncMock() + client.assume_role.side_effect = list(responses) + resolver._client = client + return client + + +# --------------------------------------------------------------------------- +# AssumeRoleCredentialsResolver +# --------------------------------------------------------------------------- + + +async def test_resolves_identity_from_assume_role() -> None: + expiration = _future_expiry() + resolver = AssumeRoleCredentialsResolver( + source_resolver=AsyncMock(), role_arn=ROLE_ARN + ) + _mock_sts_client(resolver, _valid_output(expiration=expiration)) + + identity = await resolver.get_identity(properties={}) + + assert identity.access_key_id == ACCESS_KEY_ID + assert identity.secret_access_key == SECRET_ACCESS_KEY + assert identity.session_token == SESSION_TOKEN + assert identity.expiration == expiration + assert identity.account_id == "123456789012" + + +async def test_missing_credentials_raises() -> None: + resolver = AssumeRoleCredentialsResolver( + source_resolver=AsyncMock(), role_arn=ROLE_ARN + ) + _mock_sts_client(resolver, AssumeRoleOutput(credentials=None)) + + with pytest.raises(SmithyIdentityError, match="did not contain credentials"): + await resolver.get_identity(properties={}) + + +async def test_valid_credentials_reused() -> None: + resolver = AssumeRoleCredentialsResolver( + source_resolver=AsyncMock(), role_arn=ROLE_ARN + ) + sts_client = _mock_sts_client( + resolver, + _valid_output(access_key_id="test-access-key-1"), + _valid_output(access_key_id="test-access-key-2"), + ) + + identity_one = await resolver.get_identity(properties={}) + identity_two = await resolver.get_identity(properties={}) + + # The cached identity is returned without a second STS call. + assert identity_one is identity_two + assert sts_client.assume_role.call_count == 1 + + +async def test_expired_credentials_refreshed() -> None: + resolver = AssumeRoleCredentialsResolver( + source_resolver=AsyncMock(), role_arn=ROLE_ARN + ) + sts_client = _mock_sts_client( + resolver, + _valid_output(access_key_id="test-access-key-1", expiration=_past_expiry()), + _valid_output(access_key_id="test-access-key-2"), + ) + + identity_one = await resolver.get_identity(properties={}) + identity_two = await resolver.get_identity(properties={}) + + # The cached identity is refreshed with a second STS call. + assert identity_one is not identity_two + assert identity_one.access_key_id == "test-access-key-1" + assert identity_two.access_key_id == "test-access-key-2" + assert sts_client.assume_role.call_count == 2 + + +async def test_assume_role_request_uses_role_arn() -> None: + resolver = AssumeRoleCredentialsResolver( + source_resolver=AsyncMock(), + role_arn=ROLE_ARN, + role_session_name="test-session-name", + ) + sts_client = _mock_sts_client(resolver, _valid_output()) + + await resolver.get_identity(properties={}) + + request = sts_client.assume_role.call_args.args[0] + assert request.role_arn == ROLE_ARN + assert request.role_session_name == "test-session-name" + + +async def test_assume_role_request_forwards_external_id() -> None: + resolver = AssumeRoleCredentialsResolver( + source_resolver=AsyncMock(), + role_arn=ROLE_ARN, + external_id="my-external-id", + ) + sts_client = _mock_sts_client(resolver, _valid_output()) + + await resolver.get_identity(properties={}) + + request = sts_client.assume_role.call_args.args[0] + assert request.external_id == "my-external-id" + + +async def test_assume_role_request_forwards_duration_seconds() -> None: + resolver = AssumeRoleCredentialsResolver( + source_resolver=AsyncMock(), + role_arn=ROLE_ARN, + duration_seconds=3600, + ) + sts_client = _mock_sts_client(resolver, _valid_output()) + + await resolver.get_identity(properties={}) + + request = sts_client.assume_role.call_args.args[0] + assert request.duration_seconds == 3600 + + +async def test_role_session_name_generated_when_unset() -> None: + resolver = AssumeRoleCredentialsResolver( + source_resolver=AsyncMock(), role_arn=ROLE_ARN + ) + sts_client = _mock_sts_client(resolver, _valid_output()) + + await resolver.get_identity(properties={}) + + request = sts_client.assume_role.call_args.args[0] + assert request.role_session_name.startswith("aws-sdk-python-") + + +async def test_role_session_name_stable_across_refreshes() -> None: + resolver = AssumeRoleCredentialsResolver( + source_resolver=AsyncMock(), role_arn=ROLE_ARN + ) + sts_client = _mock_sts_client( + resolver, + _valid_output(expiration=_past_expiry()), + _valid_output(), + ) + + await resolver.get_identity(properties={}) + await resolver.get_identity(properties={}) + + first, second = sts_client.assume_role.call_args_list + assert first.args[0].role_session_name == second.args[0].role_session_name + + +# --------------------------------------------------------------------------- +# ProfileAssumeRoleCredentialsResolver +# --------------------------------------------------------------------------- + + +def test_missing_profile_raises( + merged_config: Callable[..., MergedConfig], +) -> None: + config_file = merged_config({"default": {"region": "us-east-1"}}) + + with pytest.raises( + AssumeRoleConfigurationError, match="Profile 'missing' does not exist" + ): + ProfileAssumeRoleCredentialsResolver( + profile_name="missing", config_file=config_file + ) + + +async def test_source_profile_with_static_credentials( + merged_config: Callable[..., MergedConfig], +) -> None: + config_file = merged_config( + { + "role": {"role_arn": ROLE_ARN, "source_profile": "base"}, + "base": { + "aws_access_key_id": "akid", + "aws_secret_access_key": "secret", + }, + } + ) + resolver = ProfileAssumeRoleCredentialsResolver( + profile_name="role", config_file=config_file + ) + + delegate = await resolver._create_assume_role_resolver( + profile_name="role", visited=("role",) + ) + + assert isinstance(delegate, AssumeRoleCredentialsResolver) + assert delegate._role_arn == ROLE_ARN + assert isinstance(delegate._source_resolver, AsyncStaticCredentialsResolver) + identity = await delegate._source_resolver.get_identity(properties={}) + assert identity.access_key_id == "akid" + assert identity.secret_access_key == "secret" + + +async def test_profile_duration_seconds_forwarded_to_delegate( + merged_config: Callable[..., MergedConfig], +) -> None: + config_file = merged_config( + { + "role": { + "role_arn": ROLE_ARN, + "source_profile": "base", + "duration_seconds": "43200", + }, + "base": { + "aws_access_key_id": "akid", + "aws_secret_access_key": "secret", + }, + } + ) + resolver = ProfileAssumeRoleCredentialsResolver( + profile_name="role", config_file=config_file + ) + + delegate = await resolver._create_assume_role_resolver( + profile_name="role", visited=("role",) + ) + + assert delegate._duration_seconds == 43200 + + +async def test_profile_invalid_duration_seconds_ignored( + merged_config: Callable[..., MergedConfig], +) -> None: + config_file = merged_config( + { + "role": { + "role_arn": ROLE_ARN, + "source_profile": "base", + "duration_seconds": "not-a-number", + }, + "base": { + "aws_access_key_id": "akid", + "aws_secret_access_key": "secret", + }, + } + ) + resolver = ProfileAssumeRoleCredentialsResolver( + profile_name="role", config_file=config_file + ) + + delegate = await resolver._create_assume_role_resolver( + profile_name="role", visited=("role",) + ) + + assert delegate._duration_seconds is None + + +async def test_first_profile_credentials_ignored_in_favor_of_source( + merged_config: Callable[..., MergedConfig], +) -> None: + config_file = merged_config( + { + "role": { + "role_arn": ROLE_ARN, + "source_profile": "base", + "aws_access_key_id": "ignored-akid", + "aws_secret_access_key": "ignored-secret", + }, + "base": { + "aws_access_key_id": "akid", + "aws_secret_access_key": "secret", + }, + } + ) + resolver = ProfileAssumeRoleCredentialsResolver( + profile_name="role", config_file=config_file + ) + + delegate = await resolver._create_assume_role_resolver( + profile_name="role", visited=("role",) + ) + + assert isinstance(delegate._source_resolver, AsyncStaticCredentialsResolver) + identity = await delegate._source_resolver.get_identity(properties={}) + assert identity.access_key_id == "akid" + assert identity.secret_access_key == "secret" + + +async def test_nested_source_profile_role_chain( + merged_config: Callable[..., MergedConfig], +) -> None: + config_file = merged_config( + { + "role": {"role_arn": ROLE_ARN, "source_profile": "intermediate"}, + "intermediate": { + "role_arn": SOURCE_ROLE_ARN, + "source_profile": "base", + }, + "base": { + "aws_access_key_id": "akid", + "aws_secret_access_key": "secret", + }, + } + ) + resolver = ProfileAssumeRoleCredentialsResolver( + profile_name="role", config_file=config_file + ) + + delegate = await resolver._create_assume_role_resolver( + profile_name="role", visited=("role",) + ) + + # The outer role assumes via an inner AssumeRole resolver that itself + # sources from the static base profile. + assert isinstance(delegate, AssumeRoleCredentialsResolver) + inner = delegate._source_resolver + assert isinstance(inner, AssumeRoleCredentialsResolver) + assert inner._role_arn == SOURCE_ROLE_ARN + assert isinstance(inner._source_resolver, AsyncStaticCredentialsResolver) + + +async def test_chain_terminates_at_static_credentials( + merged_config: Callable[..., MergedConfig], +) -> None: + config_file = merged_config( + { + "role": {"role_arn": ROLE_ARN, "source_profile": "middle"}, + "middle": { + "aws_access_key_id": "akid", + "aws_secret_access_key": "secret", + "role_arn": SOURCE_ROLE_ARN, + "source_profile": "base", + }, + "base": { + "aws_access_key_id": "unused-akid", + "aws_secret_access_key": "unused-secret", + }, + } + ) + resolver = ProfileAssumeRoleCredentialsResolver( + profile_name="role", config_file=config_file + ) + + delegate = await resolver._create_assume_role_resolver( + profile_name="role", visited=("role",) + ) + + assert delegate._role_arn == ROLE_ARN + assert isinstance(delegate._source_resolver, AsyncStaticCredentialsResolver) + identity = await delegate._source_resolver.get_identity(properties={}) + assert identity.access_key_id == "akid" + assert identity.secret_access_key == "secret" + + +async def test_missing_source_profile_raises( + merged_config: Callable[..., MergedConfig], +) -> None: + config_file = merged_config( + {"role": {"role_arn": ROLE_ARN, "source_profile": "ghost"}} + ) + resolver = ProfileAssumeRoleCredentialsResolver( + profile_name="role", config_file=config_file + ) + + with pytest.raises( + AssumeRoleConfigurationError, match="Source profile 'ghost' does not exist" + ): + await resolver._create_assume_role_resolver( + profile_name="role", visited=("role",) + ) + + +async def test_source_profile_without_credentials_or_role_raises( + merged_config: Callable[..., MergedConfig], +) -> None: + config_file = merged_config( + { + "role": {"role_arn": ROLE_ARN, "source_profile": "base"}, + "base": {"region": "us-east-1"}, + } + ) + resolver = ProfileAssumeRoleCredentialsResolver( + profile_name="role", config_file=config_file + ) + + with pytest.raises( + AssumeRoleConfigurationError, + match="Source profile 'base' has no supported credential source", + ): + await resolver._create_assume_role_resolver( + profile_name="role", visited=("role",) + ) + + +async def test_circular_source_profile_raises( + merged_config: Callable[..., MergedConfig], +) -> None: + config_file = merged_config( + { + "a": {"role_arn": ROLE_ARN, "source_profile": "b"}, + "b": {"role_arn": SOURCE_ROLE_ARN, "source_profile": "a"}, + } + ) + resolver = ProfileAssumeRoleCredentialsResolver( + profile_name="a", config_file=config_file + ) + + with pytest.raises(AssumeRoleConfigurationError, match="Circular"): + await resolver._create_assume_role_resolver(profile_name="a", visited=("a",)) + + +async def test_circular_source_profile_with_static_credentials_raises( + merged_config: Callable[..., MergedConfig], +) -> None: + config_file = merged_config( + { + "a": { + "aws_access_key_id": "akid", + "aws_secret_access_key": "secret", + "role_arn": ROLE_ARN, + "source_profile": "b", + }, + "b": {"role_arn": SOURCE_ROLE_ARN, "source_profile": "a"}, + } + ) + resolver = ProfileAssumeRoleCredentialsResolver( + profile_name="a", config_file=config_file + ) + + with pytest.raises( + AssumeRoleConfigurationError, + match="Circular source_profile reference: a -> b -> a", + ): + await resolver._create_assume_role_resolver(profile_name="a", visited=("a",)) + + +async def test_self_referencing_profile_requires_static_credentials( + merged_config: Callable[..., MergedConfig], +) -> None: + # A profile whose source_profile points at itself but has no static keys. + config_file = merged_config( + {"role": {"role_arn": ROLE_ARN, "source_profile": "role"}} + ) + resolver = ProfileAssumeRoleCredentialsResolver( + profile_name="role", config_file=config_file + ) + + with pytest.raises( + AssumeRoleConfigurationError, + match="Self-referencing profile 'role' must contain complete static credentials", + ): + await resolver._create_assume_role_resolver( + profile_name="role", visited=("role",) + ) + + +async def test_self_referencing_profile_with_static_credentials( + merged_config: Callable[..., MergedConfig], +) -> None: + config_file = merged_config( + { + "role": { + "role_arn": ROLE_ARN, + "source_profile": "role", + "aws_access_key_id": "akid", + "aws_secret_access_key": "secret", + } + } + ) + resolver = ProfileAssumeRoleCredentialsResolver( + profile_name="role", config_file=config_file + ) + + delegate = await resolver._create_assume_role_resolver( + profile_name="role", visited=("role",) + ) + + assert isinstance(delegate._source_resolver, AsyncStaticCredentialsResolver) + + +async def test_missing_role_arn_raises( + merged_config: Callable[..., MergedConfig], +) -> None: + config_file = merged_config({"role": {"source_profile": "base"}}) + resolver = ProfileAssumeRoleCredentialsResolver( + profile_name="role", config_file=config_file + ) + + with pytest.raises( + AssumeRoleConfigurationError, match="Profile 'role' does not define role_arn" + ): + await resolver._create_assume_role_resolver( + profile_name="role", visited=("role",) + ) + + +async def test_both_source_and_credential_source_raises( + merged_config: Callable[..., MergedConfig], +) -> None: + config_file = merged_config( + { + "role": { + "role_arn": ROLE_ARN, + "source_profile": "base", + "credential_source": "Environment", + } + } + ) + resolver = ProfileAssumeRoleCredentialsResolver( + profile_name="role", config_file=config_file + ) + + with pytest.raises( + AssumeRoleConfigurationError, + match="Profile 'role' cannot define both 'source_profile' and 'credential_source'", + ): + await resolver._create_assume_role_resolver( + profile_name="role", visited=("role",) + ) + + +async def test_neither_source_nor_credential_source_raises( + merged_config: Callable[..., MergedConfig], +) -> None: + config_file = merged_config({"role": {"role_arn": ROLE_ARN}}) + resolver = ProfileAssumeRoleCredentialsResolver( + profile_name="role", config_file=config_file + ) + + with pytest.raises( + AssumeRoleConfigurationError, + match="Profile 'role' must define either 'source_profile' or 'credential_source'", + ): + await resolver._create_assume_role_resolver( + profile_name="role", visited=("role",) + ) + + +async def test_partial_static_credentials_raise( + merged_config: Callable[..., MergedConfig], +) -> None: + config_file = merged_config( + { + "role": {"role_arn": ROLE_ARN, "source_profile": "base"}, + "base": {"aws_access_key_id": "akid"}, + } + ) + resolver = ProfileAssumeRoleCredentialsResolver( + profile_name="role", config_file=config_file + ) + + with pytest.raises( + AssumeRoleConfigurationError, + match="Profile 'base' contains partial credentials", + ): + await resolver._create_assume_role_resolver( + profile_name="role", visited=("role",) + ) + + +async def test_unsupported_credential_source_raises( + merged_config: Callable[..., MergedConfig], +) -> None: + config_file = merged_config( + {"role": {"role_arn": ROLE_ARN, "credential_source": "ProfileSso"}} + ) + resolver = ProfileAssumeRoleCredentialsResolver( + profile_name="role", config_file=config_file + ) + + with pytest.raises( + AssumeRoleConfigurationError, + match="Unsupported 'credential_source': 'ProfileSso'", + ): + await resolver._create_assume_role_resolver( + profile_name="role", visited=("role",) + ) + + +@pytest.mark.parametrize( + "credential_source", + ["Environment", "EcsContainer", "Ec2InstanceMetadata"], +) +async def test_credential_source_builds_resolver_from_provider( + merged_config: Callable[..., MergedConfig], + credential_source: str, +) -> None: + config_file = merged_config( + {"role": {"role_arn": ROLE_ARN, "credential_source": credential_source}} + ) + resolver = ProfileAssumeRoleCredentialsResolver( + profile_name="role", config_file=config_file + ) + static = AsyncStaticCredentialsResolver( + AWSCredentialsIdentity(access_key_id="akid", secret_access_key="secret") + ) + resolver._find_provider = lambda slot: _FakeProvider(static) # type: ignore[assignment] + + delegate = await resolver._create_assume_role_resolver( + profile_name="role", visited=("role",) + ) + + assert isinstance(delegate, AssumeRoleCredentialsResolver) + assert isinstance(delegate._source_resolver, NamedResolver) + assert delegate._source_resolver.resolver is static + + +async def test_credential_source_no_installed_provider_raises( + merged_config: Callable[..., MergedConfig], +) -> None: + config_file = merged_config( + {"role": {"role_arn": ROLE_ARN, "credential_source": "Ec2InstanceMetadata"}} + ) + resolver = ProfileAssumeRoleCredentialsResolver( + profile_name="role", config_file=config_file + ) + resolver._find_provider = lambda slot: None # type: ignore[assignment] + + with pytest.raises( + AssumeRoleConfigurationError, + match="No provider is installed for credential source 'Ec2InstanceMetadata'", + ): + await resolver._create_assume_role_resolver( + profile_name="role", visited=("role",) + ) + + +async def test_credential_source_provider_registers_nothing_raises( + merged_config: Callable[..., MergedConfig], +) -> None: + class _EmptyProvider: + async def setup(self, identity_type: object, setup: ChainSetup) -> None: + return None + + config_file = merged_config( + {"role": {"role_arn": ROLE_ARN, "credential_source": "Environment"}} + ) + resolver = ProfileAssumeRoleCredentialsResolver( + profile_name="role", config_file=config_file + ) + resolver._find_provider = lambda slot: _EmptyProvider() # type: ignore[assignment] + + with pytest.raises( + AssumeRoleConfigurationError, + match="'Environment' credential source is not configured", + ): + await resolver._create_assume_role_resolver( + profile_name="role", visited=("role",) + ) + + +async def test_get_identity_creates_and_reuses_delegate( + merged_config: Callable[..., MergedConfig], +) -> None: + config_file = merged_config( + { + "role": {"role_arn": ROLE_ARN, "source_profile": "base"}, + "base": { + "aws_access_key_id": "akid", + "aws_secret_access_key": "secret", + }, + } + ) + resolver = ProfileAssumeRoleCredentialsResolver( + profile_name="role", config_file=config_file + ) + expected = AWSCredentialsIdentity(access_key_id="a", secret_access_key="s") + delegate = AsyncMock() + delegate.get_identity.return_value = expected + + resolver._create_assume_role_resolver = AsyncMock() + resolver._create_assume_role_resolver.return_value = delegate + + first = await resolver.get_identity(properties={}) + second = await resolver.get_identity(properties={}) + + assert first is expected + assert second is expected + # The delegate is built once and reused across calls. + assert resolver._delegate is delegate + assert delegate.get_identity.await_count == 2 diff --git a/packages/aws-credentials-sts/tests/unit/test_resolvers.py b/packages/aws-credentials-sts/tests/unit/test_resolvers.py index 303b1466..bcd52cfc 100644 --- a/packages/aws-credentials-sts/tests/unit/test_resolvers.py +++ b/packages/aws-credentials-sts/tests/unit/test_resolvers.py @@ -3,60 +3,11 @@ # pyright: reportPrivateUsage=false from collections.abc import Callable, Mapping -from datetime import UTC, datetime, timedelta -from unittest.mock import AsyncMock import pytest -from aws_credentials_sts.resolvers import ( - AssumeRoleConfigurationError, - AssumeRoleCredentialsResolver, - ProfileAssumeRoleCredentialsResolver, - _account_id_from_arn, - _resolve_sts_region, -) -from aws_sdk_sts.models import ( - AssumedRoleUser, - AssumeRoleOutput, - Credentials, -) +from aws_credentials_sts.resolvers import _account_id_from_arn, _resolve_sts_region from smithy_aws_core.config.file_parser import Section, StandardizedOutput from smithy_aws_core.config.merged_config import MergedConfig -from smithy_aws_core.identity import ( - AWSCredentialsIdentity, - StaticCredentialsResolver, -) -from smithy_aws_core.identity.chain import ( - ChainSetup, - Standard, - StandardProvider, -) -from smithy_aws_core.identity.chain.provider import NamedResolver -from smithy_core.exceptions import SmithyIdentityError - -ROLE_ARN = "arn:aws:iam::123456789012:role/MyRole" -SOURCE_ROLE_ARN = "arn:aws:iam::123456789012:role/SourceRole" -ASSUMED_ROLE_ARN = "arn:aws:sts::123456789012:assumed-role/MyRole/session" -ACCESS_KEY_ID = "test-access-key" -SECRET_ACCESS_KEY = "test-secret-key" -SESSION_TOKEN = "test-session-token" - - -class _FakeProvider: - """A chain provider that adds a single static resolver during setup.""" - - def __init__(self, resolver: StaticCredentialsResolver) -> None: - self._resolver = resolver - - @property - def name(self) -> str: - return StandardProvider.ENVIRONMENT.canonical_name - - @property - def ordering(self) -> Standard: - return Standard(slot=StandardProvider.ENVIRONMENT) - - async def setup(self, identity_type: object, setup: ChainSetup) -> None: - setup.add_resolver(self._resolver) @pytest.fixture @@ -71,39 +22,6 @@ def _build(profiles: Mapping[str, Mapping[str, str]]) -> MergedConfig: return _build -def _future_expiry() -> datetime: - return datetime.now(UTC) + timedelta(hours=1) - - -def _past_expiry() -> datetime: - return datetime.now(UTC) - timedelta(hours=1) - - -def _valid_output( - *, access_key_id: str = ACCESS_KEY_ID, expiration: datetime | None = None -) -> AssumeRoleOutput: - """An AssumeRole response with valid credentials and assumed-role user.""" - return AssumeRoleOutput( - credentials=Credentials( - access_key_id=access_key_id, - secret_access_key=SECRET_ACCESS_KEY, - session_token=SESSION_TOKEN, - expiration=expiration or _future_expiry(), - ), - assumed_role_user=AssumedRoleUser(assumed_role_id="id", arn=ASSUMED_ROLE_ARN), - ) - - -def _mock_sts_client( - resolver: AssumeRoleCredentialsResolver, *responses: AssumeRoleOutput -) -> AsyncMock: - """Attach a mock STS client returning one response per AssumeRole call.""" - client = AsyncMock() - client.assume_role.side_effect = list(responses) - resolver._client = client - return client - - @pytest.mark.parametrize( ("env_aws_region", "env_aws_default_region", "profile_region", "expected"), [ @@ -142,7 +60,7 @@ def test_resolve_sts_region( @pytest.mark.parametrize( "arn,expected", [ - (ASSUMED_ROLE_ARN, "123456789012"), + ("arn:aws:sts::123456789012:assumed-role/MyRole/session", "123456789012"), ("arn:aws:sts:::assumed-role/MyRole/session", None), # empty account field ("not-an-arn", None), # too few segments (None, None), @@ -150,670 +68,3 @@ def test_resolve_sts_region( ) def test_account_id_from_arn(arn: str | None, expected: str | None) -> None: assert _account_id_from_arn(arn) == expected - - -# --------------------------------------------------------------------------- -# AssumeRoleCredentialsResolver -# --------------------------------------------------------------------------- - - -async def test_resolves_identity_from_assume_role() -> None: - expiration = _future_expiry() - resolver = AssumeRoleCredentialsResolver( - source_resolver=AsyncMock(), role_arn=ROLE_ARN - ) - _mock_sts_client(resolver, _valid_output(expiration=expiration)) - - identity = await resolver.get_identity(properties={}) - - assert identity.access_key_id == ACCESS_KEY_ID - assert identity.secret_access_key == SECRET_ACCESS_KEY - assert identity.session_token == SESSION_TOKEN - assert identity.expiration == expiration - assert identity.account_id == "123456789012" - - -async def test_missing_credentials_raises() -> None: - resolver = AssumeRoleCredentialsResolver( - source_resolver=AsyncMock(), role_arn=ROLE_ARN - ) - _mock_sts_client(resolver, AssumeRoleOutput(credentials=None)) - - with pytest.raises(SmithyIdentityError, match="did not contain credentials"): - await resolver.get_identity(properties={}) - - -async def test_valid_credentials_reused() -> None: - resolver = AssumeRoleCredentialsResolver( - source_resolver=AsyncMock(), role_arn=ROLE_ARN - ) - sts_client = _mock_sts_client( - resolver, - _valid_output(access_key_id="test-access-key-1"), - _valid_output(access_key_id="test-access-key-2"), - ) - - identity_one = await resolver.get_identity(properties={}) - identity_two = await resolver.get_identity(properties={}) - - # The cached identity is returned without a second STS call. - assert identity_one is identity_two - assert sts_client.assume_role.call_count == 1 - - -async def test_expired_credentials_refreshed() -> None: - resolver = AssumeRoleCredentialsResolver( - source_resolver=AsyncMock(), role_arn=ROLE_ARN - ) - sts_client = _mock_sts_client( - resolver, - _valid_output(access_key_id="test-access-key-1", expiration=_past_expiry()), - _valid_output(access_key_id="test-access-key-2"), - ) - - identity_one = await resolver.get_identity(properties={}) - identity_two = await resolver.get_identity(properties={}) - - # The cached identity is refreshed with a second STS call. - assert identity_one is not identity_two - assert identity_one.access_key_id == "test-access-key-1" - assert identity_two.access_key_id == "test-access-key-2" - assert sts_client.assume_role.call_count == 2 - - -async def test_assume_role_request_uses_role_arn() -> None: - resolver = AssumeRoleCredentialsResolver( - source_resolver=AsyncMock(), - role_arn=ROLE_ARN, - role_session_name="test-session-name", - ) - sts_client = _mock_sts_client(resolver, _valid_output()) - - await resolver.get_identity(properties={}) - - request = sts_client.assume_role.call_args.args[0] - assert request.role_arn == ROLE_ARN - assert request.role_session_name == "test-session-name" - - -async def test_assume_role_request_forwards_external_id() -> None: - resolver = AssumeRoleCredentialsResolver( - source_resolver=AsyncMock(), - role_arn=ROLE_ARN, - external_id="my-external-id", - ) - sts_client = _mock_sts_client(resolver, _valid_output()) - - await resolver.get_identity(properties={}) - - request = sts_client.assume_role.call_args.args[0] - assert request.external_id == "my-external-id" - - -async def test_assume_role_request_forwards_duration_seconds() -> None: - resolver = AssumeRoleCredentialsResolver( - source_resolver=AsyncMock(), - role_arn=ROLE_ARN, - duration_seconds=3600, - ) - sts_client = _mock_sts_client(resolver, _valid_output()) - - await resolver.get_identity(properties={}) - - request = sts_client.assume_role.call_args.args[0] - assert request.duration_seconds == 3600 - - -async def test_role_session_name_generated_when_unset() -> None: - resolver = AssumeRoleCredentialsResolver( - source_resolver=AsyncMock(), role_arn=ROLE_ARN - ) - sts_client = _mock_sts_client(resolver, _valid_output()) - - await resolver.get_identity(properties={}) - - request = sts_client.assume_role.call_args.args[0] - assert request.role_session_name.startswith("aws-sdk-python-") - - -async def test_role_session_name_stable_across_refreshes() -> None: - resolver = AssumeRoleCredentialsResolver( - source_resolver=AsyncMock(), role_arn=ROLE_ARN - ) - sts_client = _mock_sts_client( - resolver, - _valid_output(expiration=_past_expiry()), - _valid_output(), - ) - - await resolver.get_identity(properties={}) - await resolver.get_identity(properties={}) - - first, second = sts_client.assume_role.call_args_list - assert first.args[0].role_session_name == second.args[0].role_session_name - - -# --------------------------------------------------------------------------- -# ProfileAssumeRoleCredentialsResolver -# --------------------------------------------------------------------------- - - -def test_missing_profile_raises( - merged_config: Callable[..., MergedConfig], -) -> None: - config_file = merged_config({"default": {"region": "us-east-1"}}) - - with pytest.raises( - AssumeRoleConfigurationError, match="Profile 'missing' does not exist" - ): - ProfileAssumeRoleCredentialsResolver( - profile_name="missing", config_file=config_file - ) - - -async def test_source_profile_with_static_credentials( - merged_config: Callable[..., MergedConfig], -) -> None: - config_file = merged_config( - { - "role": {"role_arn": ROLE_ARN, "source_profile": "base"}, - "base": { - "aws_access_key_id": "akid", - "aws_secret_access_key": "secret", - }, - } - ) - resolver = ProfileAssumeRoleCredentialsResolver( - profile_name="role", config_file=config_file - ) - - delegate = await resolver._create_assume_role_resolver( - profile_name="role", visited=("role",) - ) - - assert isinstance(delegate, AssumeRoleCredentialsResolver) - assert delegate._role_arn == ROLE_ARN - assert isinstance(delegate._source_resolver, StaticCredentialsResolver) - identity = await delegate._source_resolver.get_identity(properties={}) - assert identity.access_key_id == "akid" - assert identity.secret_access_key == "secret" - - -async def test_profile_duration_seconds_forwarded_to_delegate( - merged_config: Callable[..., MergedConfig], -) -> None: - config_file = merged_config( - { - "role": { - "role_arn": ROLE_ARN, - "source_profile": "base", - "duration_seconds": "43200", - }, - "base": { - "aws_access_key_id": "akid", - "aws_secret_access_key": "secret", - }, - } - ) - resolver = ProfileAssumeRoleCredentialsResolver( - profile_name="role", config_file=config_file - ) - - delegate = await resolver._create_assume_role_resolver( - profile_name="role", visited=("role",) - ) - - assert delegate._duration_seconds == 43200 - - -async def test_profile_invalid_duration_seconds_ignored( - merged_config: Callable[..., MergedConfig], -) -> None: - config_file = merged_config( - { - "role": { - "role_arn": ROLE_ARN, - "source_profile": "base", - "duration_seconds": "not-a-number", - }, - "base": { - "aws_access_key_id": "akid", - "aws_secret_access_key": "secret", - }, - } - ) - resolver = ProfileAssumeRoleCredentialsResolver( - profile_name="role", config_file=config_file - ) - - delegate = await resolver._create_assume_role_resolver( - profile_name="role", visited=("role",) - ) - - assert delegate._duration_seconds is None - - -async def test_first_profile_credentials_ignored_in_favor_of_source( - merged_config: Callable[..., MergedConfig], -) -> None: - config_file = merged_config( - { - "role": { - "role_arn": ROLE_ARN, - "source_profile": "base", - "aws_access_key_id": "ignored-akid", - "aws_secret_access_key": "ignored-secret", - }, - "base": { - "aws_access_key_id": "akid", - "aws_secret_access_key": "secret", - }, - } - ) - resolver = ProfileAssumeRoleCredentialsResolver( - profile_name="role", config_file=config_file - ) - - delegate = await resolver._create_assume_role_resolver( - profile_name="role", visited=("role",) - ) - - assert isinstance(delegate._source_resolver, StaticCredentialsResolver) - identity = await delegate._source_resolver.get_identity(properties={}) - assert identity.access_key_id == "akid" - assert identity.secret_access_key == "secret" - - -async def test_nested_source_profile_role_chain( - merged_config: Callable[..., MergedConfig], -) -> None: - config_file = merged_config( - { - "role": {"role_arn": ROLE_ARN, "source_profile": "intermediate"}, - "intermediate": { - "role_arn": SOURCE_ROLE_ARN, - "source_profile": "base", - }, - "base": { - "aws_access_key_id": "akid", - "aws_secret_access_key": "secret", - }, - } - ) - resolver = ProfileAssumeRoleCredentialsResolver( - profile_name="role", config_file=config_file - ) - - delegate = await resolver._create_assume_role_resolver( - profile_name="role", visited=("role",) - ) - - # The outer role assumes via an inner AssumeRole resolver that itself - # sources from the static base profile. - assert isinstance(delegate, AssumeRoleCredentialsResolver) - inner = delegate._source_resolver - assert isinstance(inner, AssumeRoleCredentialsResolver) - assert inner._role_arn == SOURCE_ROLE_ARN - assert isinstance(inner._source_resolver, StaticCredentialsResolver) - - -async def test_chain_terminates_at_static_credentials( - merged_config: Callable[..., MergedConfig], -) -> None: - config_file = merged_config( - { - "role": {"role_arn": ROLE_ARN, "source_profile": "middle"}, - "middle": { - "aws_access_key_id": "akid", - "aws_secret_access_key": "secret", - "role_arn": SOURCE_ROLE_ARN, - "source_profile": "base", - }, - "base": { - "aws_access_key_id": "unused-akid", - "aws_secret_access_key": "unused-secret", - }, - } - ) - resolver = ProfileAssumeRoleCredentialsResolver( - profile_name="role", config_file=config_file - ) - - delegate = await resolver._create_assume_role_resolver( - profile_name="role", visited=("role",) - ) - - assert delegate._role_arn == ROLE_ARN - assert isinstance(delegate._source_resolver, StaticCredentialsResolver) - identity = await delegate._source_resolver.get_identity(properties={}) - assert identity.access_key_id == "akid" - assert identity.secret_access_key == "secret" - - -async def test_missing_source_profile_raises( - merged_config: Callable[..., MergedConfig], -) -> None: - config_file = merged_config( - {"role": {"role_arn": ROLE_ARN, "source_profile": "ghost"}} - ) - resolver = ProfileAssumeRoleCredentialsResolver( - profile_name="role", config_file=config_file - ) - - with pytest.raises( - AssumeRoleConfigurationError, match="Source profile 'ghost' does not exist" - ): - await resolver._create_assume_role_resolver( - profile_name="role", visited=("role",) - ) - - -async def test_source_profile_without_credentials_or_role_raises( - merged_config: Callable[..., MergedConfig], -) -> None: - config_file = merged_config( - { - "role": {"role_arn": ROLE_ARN, "source_profile": "base"}, - "base": {"region": "us-east-1"}, - } - ) - resolver = ProfileAssumeRoleCredentialsResolver( - profile_name="role", config_file=config_file - ) - - with pytest.raises( - AssumeRoleConfigurationError, - match="Source profile 'base' has no supported credential source", - ): - await resolver._create_assume_role_resolver( - profile_name="role", visited=("role",) - ) - - -async def test_circular_source_profile_raises( - merged_config: Callable[..., MergedConfig], -) -> None: - config_file = merged_config( - { - "a": {"role_arn": ROLE_ARN, "source_profile": "b"}, - "b": {"role_arn": SOURCE_ROLE_ARN, "source_profile": "a"}, - } - ) - resolver = ProfileAssumeRoleCredentialsResolver( - profile_name="a", config_file=config_file - ) - - with pytest.raises(AssumeRoleConfigurationError, match="Circular"): - await resolver._create_assume_role_resolver(profile_name="a", visited=("a",)) - - -async def test_circular_source_profile_with_static_credentials_raises( - merged_config: Callable[..., MergedConfig], -) -> None: - config_file = merged_config( - { - "a": { - "aws_access_key_id": "akid", - "aws_secret_access_key": "secret", - "role_arn": ROLE_ARN, - "source_profile": "b", - }, - "b": {"role_arn": SOURCE_ROLE_ARN, "source_profile": "a"}, - } - ) - resolver = ProfileAssumeRoleCredentialsResolver( - profile_name="a", config_file=config_file - ) - - with pytest.raises( - AssumeRoleConfigurationError, - match="Circular source_profile reference: a -> b -> a", - ): - await resolver._create_assume_role_resolver(profile_name="a", visited=("a",)) - - -async def test_self_referencing_profile_requires_static_credentials( - merged_config: Callable[..., MergedConfig], -) -> None: - # A profile whose source_profile points at itself but has no static keys. - config_file = merged_config( - {"role": {"role_arn": ROLE_ARN, "source_profile": "role"}} - ) - resolver = ProfileAssumeRoleCredentialsResolver( - profile_name="role", config_file=config_file - ) - - with pytest.raises( - AssumeRoleConfigurationError, - match="Self-referencing profile 'role' must contain complete static credentials", - ): - await resolver._create_assume_role_resolver( - profile_name="role", visited=("role",) - ) - - -async def test_self_referencing_profile_with_static_credentials( - merged_config: Callable[..., MergedConfig], -) -> None: - config_file = merged_config( - { - "role": { - "role_arn": ROLE_ARN, - "source_profile": "role", - "aws_access_key_id": "akid", - "aws_secret_access_key": "secret", - } - } - ) - resolver = ProfileAssumeRoleCredentialsResolver( - profile_name="role", config_file=config_file - ) - - delegate = await resolver._create_assume_role_resolver( - profile_name="role", visited=("role",) - ) - - assert isinstance(delegate._source_resolver, StaticCredentialsResolver) - - -async def test_missing_role_arn_raises( - merged_config: Callable[..., MergedConfig], -) -> None: - config_file = merged_config({"role": {"source_profile": "base"}}) - resolver = ProfileAssumeRoleCredentialsResolver( - profile_name="role", config_file=config_file - ) - - with pytest.raises( - AssumeRoleConfigurationError, match="Profile 'role' does not define role_arn" - ): - await resolver._create_assume_role_resolver( - profile_name="role", visited=("role",) - ) - - -async def test_both_source_and_credential_source_raises( - merged_config: Callable[..., MergedConfig], -) -> None: - config_file = merged_config( - { - "role": { - "role_arn": ROLE_ARN, - "source_profile": "base", - "credential_source": "Environment", - } - } - ) - resolver = ProfileAssumeRoleCredentialsResolver( - profile_name="role", config_file=config_file - ) - - with pytest.raises( - AssumeRoleConfigurationError, - match="Profile 'role' cannot define both 'source_profile' and 'credential_source'", - ): - await resolver._create_assume_role_resolver( - profile_name="role", visited=("role",) - ) - - -async def test_neither_source_nor_credential_source_raises( - merged_config: Callable[..., MergedConfig], -) -> None: - config_file = merged_config({"role": {"role_arn": ROLE_ARN}}) - resolver = ProfileAssumeRoleCredentialsResolver( - profile_name="role", config_file=config_file - ) - - with pytest.raises( - AssumeRoleConfigurationError, - match="Profile 'role' must define either 'source_profile' or 'credential_source'", - ): - await resolver._create_assume_role_resolver( - profile_name="role", visited=("role",) - ) - - -async def test_partial_static_credentials_raise( - merged_config: Callable[..., MergedConfig], -) -> None: - config_file = merged_config( - { - "role": {"role_arn": ROLE_ARN, "source_profile": "base"}, - "base": {"aws_access_key_id": "akid"}, - } - ) - resolver = ProfileAssumeRoleCredentialsResolver( - profile_name="role", config_file=config_file - ) - - with pytest.raises( - AssumeRoleConfigurationError, - match="Profile 'base' contains partial credentials", - ): - await resolver._create_assume_role_resolver( - profile_name="role", visited=("role",) - ) - - -async def test_unsupported_credential_source_raises( - merged_config: Callable[..., MergedConfig], -) -> None: - config_file = merged_config( - {"role": {"role_arn": ROLE_ARN, "credential_source": "ProfileSso"}} - ) - resolver = ProfileAssumeRoleCredentialsResolver( - profile_name="role", config_file=config_file - ) - - with pytest.raises( - AssumeRoleConfigurationError, - match="Unsupported 'credential_source': 'ProfileSso'", - ): - await resolver._create_assume_role_resolver( - profile_name="role", visited=("role",) - ) - - -@pytest.mark.parametrize( - "credential_source", - ["Environment", "EcsContainer", "Ec2InstanceMetadata"], -) -async def test_credential_source_builds_resolver_from_provider( - merged_config: Callable[..., MergedConfig], - credential_source: str, -) -> None: - config_file = merged_config( - {"role": {"role_arn": ROLE_ARN, "credential_source": credential_source}} - ) - resolver = ProfileAssumeRoleCredentialsResolver( - profile_name="role", config_file=config_file - ) - static = StaticCredentialsResolver( - AWSCredentialsIdentity(access_key_id="akid", secret_access_key="secret") - ) - resolver._find_provider = lambda slot: _FakeProvider(static) # type: ignore[assignment] - - delegate = await resolver._create_assume_role_resolver( - profile_name="role", visited=("role",) - ) - - assert isinstance(delegate, AssumeRoleCredentialsResolver) - assert isinstance(delegate._source_resolver, NamedResolver) - assert delegate._source_resolver.resolver is static - - -async def test_credential_source_no_installed_provider_raises( - merged_config: Callable[..., MergedConfig], -) -> None: - config_file = merged_config( - {"role": {"role_arn": ROLE_ARN, "credential_source": "Ec2InstanceMetadata"}} - ) - resolver = ProfileAssumeRoleCredentialsResolver( - profile_name="role", config_file=config_file - ) - resolver._find_provider = lambda slot: None # type: ignore[assignment] - - with pytest.raises( - AssumeRoleConfigurationError, - match="No provider is installed for credential source 'Ec2InstanceMetadata'", - ): - await resolver._create_assume_role_resolver( - profile_name="role", visited=("role",) - ) - - -async def test_credential_source_provider_registers_nothing_raises( - merged_config: Callable[..., MergedConfig], -) -> None: - class _EmptyProvider: - async def setup(self, identity_type: object, setup: ChainSetup) -> None: - return None - - config_file = merged_config( - {"role": {"role_arn": ROLE_ARN, "credential_source": "Environment"}} - ) - resolver = ProfileAssumeRoleCredentialsResolver( - profile_name="role", config_file=config_file - ) - resolver._find_provider = lambda slot: _EmptyProvider() # type: ignore[assignment] - - with pytest.raises( - AssumeRoleConfigurationError, - match="'Environment' credential source is not configured", - ): - await resolver._create_assume_role_resolver( - profile_name="role", visited=("role",) - ) - - -async def test_get_identity_creates_and_reuses_delegate( - merged_config: Callable[..., MergedConfig], -) -> None: - config_file = merged_config( - { - "role": {"role_arn": ROLE_ARN, "source_profile": "base"}, - "base": { - "aws_access_key_id": "akid", - "aws_secret_access_key": "secret", - }, - } - ) - resolver = ProfileAssumeRoleCredentialsResolver( - profile_name="role", config_file=config_file - ) - expected = AWSCredentialsIdentity(access_key_id="a", secret_access_key="s") - delegate = AsyncMock() - delegate.get_identity.return_value = expected - - resolver._create_assume_role_resolver = AsyncMock() - resolver._create_assume_role_resolver.return_value = delegate - - first = await resolver.get_identity(properties={}) - second = await resolver.get_identity(properties={}) - - assert first is expected - assert second is expected - # The delegate is built once and reused across calls. - assert resolver._delegate is delegate - assert delegate.get_identity.await_count == 2